iobroker.vis-2
Version:
Next generation graphical user interface for ioBroker.
94 lines • 812 kB
JavaScript
import{a as tf,i as wn}from"./iobroker_vis__mf_v__runtimeInit__mf_v__-D4ESSABP.js";import{j as h,g as Oe,a as je,c as Ee,b as Te,d as nf}from"./createStyled-KRzCdWth.js";import{i as k,a as be}from"./iobroker_vis__loadShare___mf_0_mui_mf_1_icons_mf_2_material__loadShare__-kzbpjce9.js";import{i as D,R as ve}from"./iobroker_vis__loadShare__react__loadShare__-CBSDylZ8.js";import{a as Jt}from"./_commonjsHelpers-_d1bhYXs.js";import{i as bt}from"./iobroker_vis__loadShare___mf_0_mui_mf_1_system__loadShare__-DH7sF_c4.js";import{_ as me,i as _,j as Mo,h as rf,u as Ie,k as sf,l as of,n as Pe,T as Kt,I as zi,o as fi,p as he,q as Hi,r as st,M as Pd,s as Od,v as af,w as jd,x as Wr,y as lf,z as cf,F as df,A as uf,C as Ed,D as Rd,E as Fr,G as Ad,H as ko,J as pf,K as hf,L as Is,P as ff,N as mf,B as pn,O as gf,Q as vf,R as xf,S as yf,U as Lr,V as bf,W as Ol,X as wf}from"./Dialog-alBgzgEa.js";import{E as Df,F as Sf}from"./InsertDriveFile-BSnwK3M4.js";import{P as C}from"./iobroker_vis__loadShare__prop_mf_2_types__loadShare__-IJSryeM_.js";import{i as If,R as Cf}from"./iobroker_vis__loadShare__react_mf_2_dom__loadShare__-DoQgihzr.js";import{c as Xt,a as ce}from"./createSvgIcon-CbfCWRSf.js";import{u as Tt,a as Ft}from"./useMediaQuery-C_6g133D.js";const{loadShare:_f}=wn,{initPromise:Mf}=tf,kf=Mf.then(i=>_f("@iobroker/adapter-react-v5",{customShareInfo:{shareConfig:{singleton:!0,strictVersion:!1,requiredVersion:"*"}}})),Tf=await kf.then(i=>i());var N=Tf;const Br=C.oneOfType([C.func,C.object]),Nd=D.createContext({dragDropManager:void 0});function Dn(i){"@babel/helpers - typeof";return Dn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Dn(i)}function Pf(i,e){if(Dn(i)!="object"||!i)return i;var t=i[Symbol.toPrimitive];if(t!==void 0){var n=t.call(i,e);if(Dn(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(i)}function Of(i){var e=Pf(i,"string");return Dn(e)=="symbol"?e:e+""}function jf(i,e,t){return(e=Of(e))in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}function jl(i,e){var t=Object.keys(i);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(i);e&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(i,r).enumerable})),t.push.apply(t,n)}return t}function El(i){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?jl(Object(t),!0).forEach(function(n){jf(i,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(t)):jl(Object(t)).forEach(function(n){Object.defineProperty(i,n,Object.getOwnPropertyDescriptor(t,n))})}return i}function rt(i){return"Minified Redux error #"+i+"; visit https://redux.js.org/Errors?code="+i+" for the full message or use the non-minified dev environment for full errors. "}var Rl=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}(),Al=function(){return Math.random().toString(36).substring(7).split("").join(".")},Nl={INIT:"@@redux/INIT"+Al(),REPLACE:"@@redux/REPLACE"+Al()};function Ef(i){if(typeof i!="object"||i===null)return!1;for(var e=i;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(i)===e}function To(i,e,t){var n;if(typeof e=="function"&&typeof t=="function"||typeof t=="function"&&typeof arguments[3]=="function")throw new Error(rt(0));if(typeof e=="function"&&typeof t>"u"&&(t=e,e=void 0),typeof t<"u"){if(typeof t!="function")throw new Error(rt(1));return t(To)(i,e)}if(typeof i!="function")throw new Error(rt(2));var r=i,s=e,o=[],a=o,l=!1;function c(){a===o&&(a=o.slice())}function u(){if(l)throw new Error(rt(3));return s}function p(v){if(typeof v!="function")throw new Error(rt(4));if(l)throw new Error(rt(5));var g=!0;return c(),a.push(v),function(){if(g){if(l)throw new Error(rt(6));g=!1,c();var y=a.indexOf(v);a.splice(y,1),o=null}}}function d(v){if(!Ef(v))throw new Error(rt(7));if(typeof v.type>"u")throw new Error(rt(8));if(l)throw new Error(rt(9));try{l=!0,s=r(s,v)}finally{l=!1}for(var g=o=a,x=0;x<g.length;x++){var y=g[x];y()}return v}function f(v){if(typeof v!="function")throw new Error(rt(10));r=v,d({type:Nl.REPLACE})}function m(){var v,g=p;return v={subscribe:function(y){if(typeof y!="object"||y===null)throw new Error(rt(11));function w(){y.next&&y.next(u())}w();var S=g(w);return{unsubscribe:S}}},v[Rl]=function(){return this},v}return d({type:Nl.INIT}),n={dispatch:d,subscribe:p,getState:u,replaceReducer:f},n[Rl]=m,n}function $l(i,e){return function(){return e(i.apply(this,arguments))}}function Wl(i,e){if(typeof i=="function")return $l(i,e);if(typeof i!="object"||i===null)throw new Error(rt(16));var t={};for(var n in i){var r=i[n];typeof r=="function"&&(t[n]=$l(r,e))}return t}function $d(){for(var i=arguments.length,e=new Array(i),t=0;t<i;t++)e[t]=arguments[t];return e.length===0?function(n){return n}:e.length===1?e[0]:e.reduce(function(n,r){return function(){return n(r.apply(void 0,arguments))}})}function Rf(){for(var i=arguments.length,e=new Array(i),t=0;t<i;t++)e[t]=arguments[t];return function(n){return function(){var r=n.apply(void 0,arguments),s=function(){throw new Error(rt(15))},o={getState:r.getState,dispatch:function(){return s.apply(void 0,arguments)}},a=e.map(function(l){return l(o)});return s=$d.apply(void 0,a)(r.dispatch),El(El({},r),{},{dispatch:s})}}}function De(i,e,...t){if(Af()&&e===void 0)throw new Error("invariant requires an error message argument");if(!i){let n;if(e===void 0)n=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{let r=0;n=new Error(e.replace(/%s/g,function(){return t[r++]})),n.name="Invariant Violation"}throw n.framesToPop=1,n}}function Af(){return typeof process<"u"&&!0}function Nf(i,e,t){return e.split(".").reduce((n,r)=>n&&n[r]?n[r]:t||null,i)}function $f(i,e){return i.filter(t=>t!==e)}function Wd(i){return typeof i=="object"}function Wf(i,e){const t=new Map,n=s=>{t.set(s,t.has(s)?t.get(s)+1:1)};i.forEach(n),e.forEach(n);const r=[];return t.forEach((s,o)=>{s===1&&r.push(o)}),r}function Ff(i,e){return i.filter(t=>e.indexOf(t)>-1)}const Po="dnd-core/INIT_COORDS",Vr="dnd-core/BEGIN_DRAG",Oo="dnd-core/PUBLISH_DRAG_SOURCE",zr="dnd-core/HOVER",Hr="dnd-core/DROP",qr="dnd-core/END_DRAG";function Fl(i,e){return{type:Po,payload:{sourceClientOffset:e||null,clientOffset:i||null}}}const Lf={type:Po,payload:{clientOffset:null,sourceClientOffset:null}};function Bf(i){return function(t=[],n={publishSource:!0}){const{publishSource:r=!0,clientOffset:s,getSourceClientOffset:o}=n,a=i.getMonitor(),l=i.getRegistry();i.dispatch(Fl(s)),Vf(t,a,l);const c=qf(t,a);if(c==null){i.dispatch(Lf);return}let u=null;if(s){if(!o)throw new Error("getSourceClientOffset must be defined");zf(o),u=o(c)}i.dispatch(Fl(s,u));const d=l.getSource(c).beginDrag(a,c);if(d==null)return;Hf(d),l.pinSource(c);const f=l.getSourceType(c);return{type:Vr,payload:{itemType:f,item:d,sourceId:c,clientOffset:s||null,sourceClientOffset:u||null,isSourcePublic:!!r}}}}function Vf(i,e,t){De(!e.isDragging(),"Cannot call beginDrag while dragging."),i.forEach(function(n){De(t.getSource(n),"Expected sourceIds to be registered.")})}function zf(i){De(typeof i=="function","When clientOffset is provided, getSourceClientOffset must be a function.")}function Hf(i){De(Wd(i),"Item must be an object.")}function qf(i,e){let t=null;for(let n=i.length-1;n>=0;n--)if(e.canDragSource(i[n])){t=i[n];break}return t}function Uf(i,e,t){return e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}function Yf(i){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{},n=Object.keys(t);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(t).filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable}))),n.forEach(function(r){Uf(i,r,t[r])})}return i}function Gf(i){return function(t={}){const n=i.getMonitor(),r=i.getRegistry();Jf(n),Zf(n).forEach((o,a)=>{const l=Kf(o,a,r,n),c={type:Hr,payload:{dropResult:Yf({},t,l)}};i.dispatch(c)})}}function Jf(i){De(i.isDragging(),"Cannot call drop while not dragging."),De(!i.didDrop(),"Cannot call drop twice during one drag operation.")}function Kf(i,e,t,n){const r=t.getTarget(i);let s=r?r.drop(n,i):void 0;return Xf(s),typeof s>"u"&&(s=e===0?{}:n.getDropResult()),s}function Xf(i){De(typeof i>"u"||Wd(i),"Drop result must either be an object or undefined.")}function Zf(i){const e=i.getTargetIds().filter(i.canDropOnTarget,i);return e.reverse(),e}function Qf(i){return function(){const t=i.getMonitor(),n=i.getRegistry();em(t);const r=t.getSourceId();return r!=null&&(n.getSource(r,!0).endDrag(t,r),n.unpinSource()),{type:qr}}}function em(i){De(i.isDragging(),"Cannot call endDrag while not dragging.")}function Xs(i,e){return e===null?i===null:Array.isArray(i)?i.some(t=>t===e):i===e}function tm(i){return function(t,{clientOffset:n}={}){im(t);const r=t.slice(0),s=i.getMonitor(),o=i.getRegistry(),a=s.getItemType();return rm(r,o,a),nm(r,s,o),sm(r,s,o),{type:zr,payload:{targetIds:r,clientOffset:n||null}}}}function im(i){De(Array.isArray(i),"Expected targetIds to be an array.")}function nm(i,e,t){De(e.isDragging(),"Cannot call hover while not dragging."),De(!e.didDrop(),"Cannot call hover after drop.");for(let n=0;n<i.length;n++){const r=i[n];De(i.lastIndexOf(r)===n,"Expected targetIds to be unique in the passed array.");const s=t.getTarget(r);De(s,"Expected targetIds to be registered.")}}function rm(i,e,t){for(let n=i.length-1;n>=0;n--){const r=i[n],s=e.getTargetType(r);Xs(s,t)||i.splice(n,1)}}function sm(i,e,t){i.forEach(function(n){t.getTarget(n).hover(e,n)})}function om(i){return function(){if(i.getMonitor().isDragging())return{type:Oo}}}function am(i){return{beginDrag:Bf(i),publishDragSource:om(i),hover:tm(i),drop:Gf(i),endDrag:Qf(i)}}class lm{receiveBackend(e){this.backend=e}getMonitor(){return this.monitor}getBackend(){return this.backend}getRegistry(){return this.monitor.registry}getActions(){const e=this,{dispatch:t}=this.store;function n(s){return(...o)=>{const a=s.apply(e,o);typeof a<"u"&&t(a)}}const r=am(this);return Object.keys(r).reduce((s,o)=>{const a=r[o];return s[o]=n(a),s},{})}dispatch(e){this.store.dispatch(e)}constructor(e,t){this.isSetUp=!1,this.handleRefCountChange=()=>{const n=this.store.getState().refCount>0;this.backend&&(n&&!this.isSetUp?(this.backend.setup(),this.isSetUp=!0):!n&&this.isSetUp&&(this.backend.teardown(),this.isSetUp=!1))},this.store=e,this.monitor=t,e.subscribe(this.handleRefCountChange)}}function cm(i,e){return{x:i.x+e.x,y:i.y+e.y}}function Fd(i,e){return{x:i.x-e.x,y:i.y-e.y}}function dm(i){const{clientOffset:e,initialClientOffset:t,initialSourceClientOffset:n}=i;return!e||!t||!n?null:Fd(cm(e,n),t)}function um(i){const{clientOffset:e,initialClientOffset:t}=i;return!e||!t?null:Fd(e,t)}const fn=[],jo=[];fn.__IS_NONE__=!0;jo.__IS_ALL__=!0;function pm(i,e){return i===fn?!1:i===jo||typeof e>"u"?!0:Ff(e,i).length>0}class hm{subscribeToStateChange(e,t={}){const{handlerIds:n}=t;De(typeof e=="function","listener must be a function."),De(typeof n>"u"||Array.isArray(n),"handlerIds, when specified, must be an array of strings.");let r=this.store.getState().stateId;const s=()=>{const o=this.store.getState(),a=o.stateId;try{a===r||a===r+1&&!pm(o.dirtyHandlerIds,n)||e()}finally{r=a}};return this.store.subscribe(s)}subscribeToOffsetChange(e){De(typeof e=="function","listener must be a function.");let t=this.store.getState().dragOffset;const n=()=>{const r=this.store.getState().dragOffset;r!==t&&(t=r,e())};return this.store.subscribe(n)}canDragSource(e){if(!e)return!1;const t=this.registry.getSource(e);return De(t,`Expected to find a valid source. sourceId=${e}`),this.isDragging()?!1:t.canDrag(this,e)}canDropOnTarget(e){if(!e)return!1;const t=this.registry.getTarget(e);if(De(t,`Expected to find a valid target. targetId=${e}`),!this.isDragging()||this.didDrop())return!1;const n=this.registry.getTargetType(e),r=this.getItemType();return Xs(n,r)&&t.canDrop(this,e)}isDragging(){return!!this.getItemType()}isDraggingSource(e){if(!e)return!1;const t=this.registry.getSource(e,!0);if(De(t,`Expected to find a valid source. sourceId=${e}`),!this.isDragging()||!this.isSourcePublic())return!1;const n=this.registry.getSourceType(e),r=this.getItemType();return n!==r?!1:t.isDragging(this,e)}isOverTarget(e,t={shallow:!1}){if(!e)return!1;const{shallow:n}=t;if(!this.isDragging())return!1;const r=this.registry.getTargetType(e),s=this.getItemType();if(s&&!Xs(r,s))return!1;const o=this.getTargetIds();if(!o.length)return!1;const a=o.indexOf(e);return n?a===o.length-1:a>-1}getItemType(){return this.store.getState().dragOperation.itemType}getItem(){return this.store.getState().dragOperation.item}getSourceId(){return this.store.getState().dragOperation.sourceId}getTargetIds(){return this.store.getState().dragOperation.targetIds}getDropResult(){return this.store.getState().dragOperation.dropResult}didDrop(){return this.store.getState().dragOperation.didDrop}isSourcePublic(){return!!this.store.getState().dragOperation.isSourcePublic}getInitialClientOffset(){return this.store.getState().dragOffset.initialClientOffset}getInitialSourceClientOffset(){return this.store.getState().dragOffset.initialSourceClientOffset}getClientOffset(){return this.store.getState().dragOffset.clientOffset}getSourceClientOffset(){return dm(this.store.getState().dragOffset)}getDifferenceFromInitialOffset(){return um(this.store.getState().dragOffset)}constructor(e,t){this.store=e,this.registry=t}}const Ll=typeof global<"u"?global:self,Ld=Ll.MutationObserver||Ll.WebKitMutationObserver;function Bd(i){return function(){const t=setTimeout(r,0),n=setInterval(r,50);function r(){clearTimeout(t),clearInterval(n),i()}}}function fm(i){let e=1;const t=new Ld(i),n=document.createTextNode("");return t.observe(n,{characterData:!0}),function(){e=-e,n.data=e}}const mm=typeof Ld=="function"?fm:Bd;class gm{enqueueTask(e){const{queue:t,requestFlush:n}=this;t.length||(n(),this.flushing=!0),t[t.length]=e}constructor(){this.queue=[],this.pendingErrors=[],this.flushing=!1,this.index=0,this.capacity=1024,this.flush=()=>{const{queue:e}=this;for(;this.index<e.length;){const t=this.index;if(this.index++,e[t].call(),this.index>this.capacity){for(let n=0,r=e.length-this.index;n<r;n++)e[n]=e[n+this.index];e.length-=this.index,this.index=0}}e.length=0,this.index=0,this.flushing=!1},this.registerPendingError=e=>{this.pendingErrors.push(e),this.requestErrorThrow()},this.requestFlush=mm(this.flush),this.requestErrorThrow=Bd(()=>{if(this.pendingErrors.length)throw this.pendingErrors.shift()})}}class vm{call(){try{this.task&&this.task()}catch(e){this.onError(e)}finally{this.task=null,this.release(this)}}constructor(e,t){this.onError=e,this.release=t,this.task=null}}class xm{create(e){const t=this.freeTasks,n=t.length?t.pop():new vm(this.onError,r=>t[t.length]=r);return n.task=e,n}constructor(e){this.onError=e,this.freeTasks=[]}}const Vd=new gm,ym=new xm(Vd.registerPendingError);function bm(i){Vd.enqueueTask(ym.create(i))}const Eo="dnd-core/ADD_SOURCE",Ro="dnd-core/ADD_TARGET",Ao="dnd-core/REMOVE_SOURCE",Ur="dnd-core/REMOVE_TARGET";function wm(i){return{type:Eo,payload:{sourceId:i}}}function Dm(i){return{type:Ro,payload:{targetId:i}}}function Sm(i){return{type:Ao,payload:{sourceId:i}}}function Im(i){return{type:Ur,payload:{targetId:i}}}function Cm(i){De(typeof i.canDrag=="function","Expected canDrag to be a function."),De(typeof i.beginDrag=="function","Expected beginDrag to be a function."),De(typeof i.endDrag=="function","Expected endDrag to be a function.")}function _m(i){De(typeof i.canDrop=="function","Expected canDrop to be a function."),De(typeof i.hover=="function","Expected hover to be a function."),De(typeof i.drop=="function","Expected beginDrag to be a function.")}function Zs(i,e){if(e&&Array.isArray(i)){i.forEach(t=>Zs(t,!1));return}De(typeof i=="string"||typeof i=="symbol",e?"Type can only be a string, a symbol, or an array of either.":"Type can only be a string or a symbol.")}var vt;(function(i){i.SOURCE="SOURCE",i.TARGET="TARGET"})(vt||(vt={}));let Mm=0;function km(){return Mm++}function Tm(i){const e=km().toString();switch(i){case vt.SOURCE:return`S${e}`;case vt.TARGET:return`T${e}`;default:throw new Error(`Unknown Handler Role: ${i}`)}}function Bl(i){switch(i[0]){case"S":return vt.SOURCE;case"T":return vt.TARGET;default:throw new Error(`Cannot parse handler ID: ${i}`)}}function Vl(i,e){const t=i.entries();let n=!1;do{const{done:r,value:[,s]}=t.next();if(s===e)return!0;n=!!r}while(!n);return!1}class Pm{addSource(e,t){Zs(e),Cm(t);const n=this.addHandler(vt.SOURCE,e,t);return this.store.dispatch(wm(n)),n}addTarget(e,t){Zs(e,!0),_m(t);const n=this.addHandler(vt.TARGET,e,t);return this.store.dispatch(Dm(n)),n}containsHandler(e){return Vl(this.dragSources,e)||Vl(this.dropTargets,e)}getSource(e,t=!1){return De(this.isSourceId(e),"Expected a valid source ID."),t&&e===this.pinnedSourceId?this.pinnedSource:this.dragSources.get(e)}getTarget(e){return De(this.isTargetId(e),"Expected a valid target ID."),this.dropTargets.get(e)}getSourceType(e){return De(this.isSourceId(e),"Expected a valid source ID."),this.types.get(e)}getTargetType(e){return De(this.isTargetId(e),"Expected a valid target ID."),this.types.get(e)}isSourceId(e){return Bl(e)===vt.SOURCE}isTargetId(e){return Bl(e)===vt.TARGET}removeSource(e){De(this.getSource(e),"Expected an existing source."),this.store.dispatch(Sm(e)),bm(()=>{this.dragSources.delete(e),this.types.delete(e)})}removeTarget(e){De(this.getTarget(e),"Expected an existing target."),this.store.dispatch(Im(e)),this.dropTargets.delete(e),this.types.delete(e)}pinSource(e){const t=this.getSource(e);De(t,"Expected an existing source."),this.pinnedSourceId=e,this.pinnedSource=t}unpinSource(){De(this.pinnedSource,"No source is pinned at the time."),this.pinnedSourceId=null,this.pinnedSource=null}addHandler(e,t,n){const r=Tm(e);return this.types.set(r,t),e===vt.SOURCE?this.dragSources.set(r,n):e===vt.TARGET&&this.dropTargets.set(r,n),r}constructor(e){this.types=new Map,this.dragSources=new Map,this.dropTargets=new Map,this.pinnedSourceId=null,this.pinnedSource=null,this.store=e}}const Om=(i,e)=>i===e;function jm(i,e){return!i&&!e?!0:!i||!e?!1:i.x===e.x&&i.y===e.y}function Em(i,e,t=Om){if(i.length!==e.length)return!1;for(let n=0;n<i.length;++n)if(!t(i[n],e[n]))return!1;return!0}function Rm(i=fn,e){switch(e.type){case zr:break;case Eo:case Ro:case Ur:case Ao:return fn;case Vr:case Oo:case qr:case Hr:default:return jo}const{targetIds:t=[],prevTargetIds:n=[]}=e.payload,r=Wf(t,n);if(!(r.length>0||!Em(t,n)))return fn;const o=n[n.length-1],a=t[t.length-1];return o!==a&&(o&&r.push(o),a&&r.push(a)),r}function Am(i,e,t){return e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}function Nm(i){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{},n=Object.keys(t);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(t).filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable}))),n.forEach(function(r){Am(i,r,t[r])})}return i}const zl={initialSourceClientOffset:null,initialClientOffset:null,clientOffset:null};function $m(i=zl,e){const{payload:t}=e;switch(e.type){case Po:case Vr:return{initialSourceClientOffset:t.sourceClientOffset,initialClientOffset:t.clientOffset,clientOffset:t.clientOffset};case zr:return jm(i.clientOffset,t.clientOffset)?i:Nm({},i,{clientOffset:t.clientOffset});case qr:case Hr:return zl;default:return i}}function Wm(i,e,t){return e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}function Si(i){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{},n=Object.keys(t);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(t).filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable}))),n.forEach(function(r){Wm(i,r,t[r])})}return i}const Fm={itemType:null,item:null,sourceId:null,targetIds:[],dropResult:null,didDrop:!1,isSourcePublic:null};function Lm(i=Fm,e){const{payload:t}=e;switch(e.type){case Vr:return Si({},i,{itemType:t.itemType,item:t.item,sourceId:t.sourceId,isSourcePublic:t.isSourcePublic,dropResult:null,didDrop:!1});case Oo:return Si({},i,{isSourcePublic:!0});case zr:return Si({},i,{targetIds:t.targetIds});case Ur:return i.targetIds.indexOf(t.targetId)===-1?i:Si({},i,{targetIds:$f(i.targetIds,t.targetId)});case Hr:return Si({},i,{dropResult:t.dropResult,didDrop:!0,targetIds:[]});case qr:return Si({},i,{itemType:null,item:null,sourceId:null,dropResult:null,didDrop:!1,isSourcePublic:null,targetIds:[]});default:return i}}function Bm(i=0,e){switch(e.type){case Eo:case Ro:return i+1;case Ao:case Ur:return i-1;default:return i}}function Vm(i=0){return i+1}function zm(i,e,t){return e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}function Hm(i){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{},n=Object.keys(t);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(t).filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable}))),n.forEach(function(r){zm(i,r,t[r])})}return i}function qm(i={},e){return{dirtyHandlerIds:Rm(i.dirtyHandlerIds,{type:e.type,payload:Hm({},e.payload,{prevTargetIds:Nf(i,"dragOperation.targetIds",[])})}),dragOffset:$m(i.dragOffset,e),refCount:Bm(i.refCount,e),dragOperation:Lm(i.dragOperation,e),stateId:Vm(i.stateId)}}function Um(i,e=void 0,t={},n=!1){const r=Ym(n),s=new hm(r,new Pm(r)),o=new lm(r,s),a=i(o,e,t);return o.receiveBackend(a),o}function Ym(i){const e=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__;return To(qm,i&&e&&e({name:"dnd-core",instanceId:"dnd-core"}))}function Gm(i,e){if(i==null)return{};var t=Jm(i,e),n,r;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(i);for(r=0;r<s.length;r++)n=s[r],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(i,n)&&(t[n]=i[n])}return t}function Jm(i,e){if(i==null)return{};var t={},n=Object.keys(i),r,s;for(s=0;s<n.length;s++)r=n[s],!(e.indexOf(r)>=0)&&(t[r]=i[r]);return t}let Hl=0;const ur=Symbol.for("__REACT_DND_CONTEXT_INSTANCE__");var Km=D.memo(function(e){var{children:t}=e,n=Gm(e,["children"]);const[r,s]=Xm(n);return D.useEffect(()=>{if(s){const o=zd();return++Hl,()=>{--Hl===0&&(o[ur]=null)}}},[]),h.jsx(Nd.Provider,{value:r,children:t})});function Xm(i){if("manager"in i)return[{dragDropManager:i.manager},!1];const e=Zm(i.backend,i.context,i.options,i.debugMode),t=!i.context;return[e,t]}function Zm(i,e=zd(),t,n){const r=e;return r[ur]||(r[ur]={dragDropManager:Um(i,e,t,n)}),r[ur]}function zd(){return typeof global<"u"?global:window}var Qm=function i(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;var n,r,s;if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(!i(e[r],t[r]))return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===t.toString();if(s=Object.keys(e),n=s.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!Object.prototype.hasOwnProperty.call(t,s[r]))return!1;for(r=n;r--!==0;){var o=s[r];if(!i(e[o],t[o]))return!1}return!0}return e!==e&&t!==t};const eg=Jt(Qm),mi=typeof window<"u"?D.useLayoutEffect:D.useEffect;function tg(i,e,t){const[n,r]=D.useState(()=>e(i)),s=D.useCallback(()=>{const o=e(i);eg(n,o)||(r(o),t&&t())},[n,i,t]);return mi(s),[n,s]}function ig(i,e,t){const[n,r]=tg(i,e,t);return mi(function(){const o=i.getHandlerId();if(o!=null)return i.subscribeToStateChange(r,{handlerIds:[o]})},[i,r]),n}function Hd(i,e,t){return ig(e,i||(()=>({})),()=>t.reconnect())}function qd(i,e){const t=[...e||[]];return e==null&&typeof i!="function"&&t.push(i),D.useMemo(()=>typeof i=="function"?i():i,t)}function ng(i){return D.useMemo(()=>i.hooks.dragSource(),[i])}function rg(i){return D.useMemo(()=>i.hooks.dragPreview(),[i])}let Cs=!1,_s=!1;class sg{receiveHandlerId(e){this.sourceId=e}getHandlerId(){return this.sourceId}canDrag(){De(!Cs,"You may not call monitor.canDrag() inside your canDrag() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return Cs=!0,this.internalMonitor.canDragSource(this.sourceId)}finally{Cs=!1}}isDragging(){if(!this.sourceId)return!1;De(!_s,"You may not call monitor.isDragging() inside your isDragging() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return _s=!0,this.internalMonitor.isDraggingSource(this.sourceId)}finally{_s=!1}}subscribeToStateChange(e,t){return this.internalMonitor.subscribeToStateChange(e,t)}isDraggingSource(e){return this.internalMonitor.isDraggingSource(e)}isOverTarget(e,t){return this.internalMonitor.isOverTarget(e,t)}getTargetIds(){return this.internalMonitor.getTargetIds()}isSourcePublic(){return this.internalMonitor.isSourcePublic()}getSourceId(){return this.internalMonitor.getSourceId()}subscribeToOffsetChange(e){return this.internalMonitor.subscribeToOffsetChange(e)}canDragSource(e){return this.internalMonitor.canDragSource(e)}canDropOnTarget(e){return this.internalMonitor.canDropOnTarget(e)}getItemType(){return this.internalMonitor.getItemType()}getItem(){return this.internalMonitor.getItem()}getDropResult(){return this.internalMonitor.getDropResult()}didDrop(){return this.internalMonitor.didDrop()}getInitialClientOffset(){return this.internalMonitor.getInitialClientOffset()}getInitialSourceClientOffset(){return this.internalMonitor.getInitialSourceClientOffset()}getSourceClientOffset(){return this.internalMonitor.getSourceClientOffset()}getClientOffset(){return this.internalMonitor.getClientOffset()}getDifferenceFromInitialOffset(){return this.internalMonitor.getDifferenceFromInitialOffset()}constructor(e){this.sourceId=null,this.internalMonitor=e.getMonitor()}}let Ms=!1;class og{receiveHandlerId(e){this.targetId=e}getHandlerId(){return this.targetId}subscribeToStateChange(e,t){return this.internalMonitor.subscribeToStateChange(e,t)}canDrop(){if(!this.targetId)return!1;De(!Ms,"You may not call monitor.canDrop() inside your canDrop() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target-monitor");try{return Ms=!0,this.internalMonitor.canDropOnTarget(this.targetId)}finally{Ms=!1}}isOver(e){return this.targetId?this.internalMonitor.isOverTarget(this.targetId,e):!1}getItemType(){return this.internalMonitor.getItemType()}getItem(){return this.internalMonitor.getItem()}getDropResult(){return this.internalMonitor.getDropResult()}didDrop(){return this.internalMonitor.didDrop()}getInitialClientOffset(){return this.internalMonitor.getInitialClientOffset()}getInitialSourceClientOffset(){return this.internalMonitor.getInitialSourceClientOffset()}getSourceClientOffset(){return this.internalMonitor.getSourceClientOffset()}getClientOffset(){return this.internalMonitor.getClientOffset()}getDifferenceFromInitialOffset(){return this.internalMonitor.getDifferenceFromInitialOffset()}constructor(e){this.targetId=null,this.internalMonitor=e.getMonitor()}}function ag(i,e,t){const n=t.getRegistry(),r=n.addTarget(i,e);return[r,()=>n.removeTarget(r)]}function lg(i,e,t){const n=t.getRegistry(),r=n.addSource(i,e);return[r,()=>n.removeSource(r)]}function Qs(i,e,t,n){let r;if(r!==void 0)return!!r;if(i===e)return!0;if(typeof i!="object"||!i||typeof e!="object"||!e)return!1;const s=Object.keys(i),o=Object.keys(e);if(s.length!==o.length)return!1;const a=Object.prototype.hasOwnProperty.bind(e);for(let l=0;l<s.length;l++){const c=s[l];if(!a(c))return!1;const u=i[c],p=e[c];if(r=void 0,r===!1||r===void 0&&u!==p)return!1}return!0}function eo(i){return i!==null&&typeof i=="object"&&Object.prototype.hasOwnProperty.call(i,"current")}function cg(i){if(typeof i.type=="string")return;const e=i.type.displayName||i.type.name||"the component";throw new Error(`Only native element nodes can now be passed to React DnD connectors.You can either wrap ${e} into a <div>, or turn it into a drag source or a drop target itself.`)}function dg(i){return(e=null,t=null)=>{if(!D.isValidElement(e)){const s=e;return i(s,t),s}const n=e;return cg(n),ug(n,t?s=>i(s,t):i)}}function Ud(i){const e={};return Object.keys(i).forEach(t=>{const n=i[t];if(t.endsWith("Ref"))e[t]=i[t];else{const r=dg(n);e[t]=()=>r}}),e}function ql(i,e){typeof i=="function"?i(e):i.current=e}function ug(i,e){const t=i.ref;return De(typeof t!="string","Cannot connect React DnD to an element with an existing string ref. Please convert it to use a callback ref instead, or wrap it into a <span> or <div>. Read more: https://reactjs.org/docs/refs-and-the-dom.html#callback-refs"),t?D.cloneElement(i,{ref:n=>{ql(t,n),ql(e,n)}}):D.cloneElement(i,{ref:e})}class pg{receiveHandlerId(e){this.handlerId!==e&&(this.handlerId=e,this.reconnect())}get connectTarget(){return this.dragSource}get dragSourceOptions(){return this.dragSourceOptionsInternal}set dragSourceOptions(e){this.dragSourceOptionsInternal=e}get dragPreviewOptions(){return this.dragPreviewOptionsInternal}set dragPreviewOptions(e){this.dragPreviewOptionsInternal=e}reconnect(){const e=this.reconnectDragSource();this.reconnectDragPreview(e)}reconnectDragSource(){const e=this.dragSource,t=this.didHandlerIdChange()||this.didConnectedDragSourceChange()||this.didDragSourceOptionsChange();return t&&this.disconnectDragSource(),this.handlerId?e?(t&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragSource=e,this.lastConnectedDragSourceOptions=this.dragSourceOptions,this.dragSourceUnsubscribe=this.backend.connectDragSource(this.handlerId,e,this.dragSourceOptions)),t):(this.lastConnectedDragSource=e,t):t}reconnectDragPreview(e=!1){const t=this.dragPreview,n=e||this.didHandlerIdChange()||this.didConnectedDragPreviewChange()||this.didDragPreviewOptionsChange();if(n&&this.disconnectDragPreview(),!!this.handlerId){if(!t){this.lastConnectedDragPreview=t;return}n&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragPreview=t,this.lastConnectedDragPreviewOptions=this.dragPreviewOptions,this.dragPreviewUnsubscribe=this.backend.connectDragPreview(this.handlerId,t,this.dragPreviewOptions))}}didHandlerIdChange(){return this.lastConnectedHandlerId!==this.handlerId}didConnectedDragSourceChange(){return this.lastConnectedDragSource!==this.dragSource}didConnectedDragPreviewChange(){return this.lastConnectedDragPreview!==this.dragPreview}didDragSourceOptionsChange(){return!Qs(this.lastConnectedDragSourceOptions,this.dragSourceOptions)}didDragPreviewOptionsChange(){return!Qs(this.lastConnectedDragPreviewOptions,this.dragPreviewOptions)}disconnectDragSource(){this.dragSourceUnsubscribe&&(this.dragSourceUnsubscribe(),this.dragSourceUnsubscribe=void 0)}disconnectDragPreview(){this.dragPreviewUnsubscribe&&(this.dragPreviewUnsubscribe(),this.dragPreviewUnsubscribe=void 0,this.dragPreviewNode=null,this.dragPreviewRef=null)}get dragSource(){return this.dragSourceNode||this.dragSourceRef&&this.dragSourceRef.current}get dragPreview(){return this.dragPreviewNode||this.dragPreviewRef&&this.dragPreviewRef.current}clearDragSource(){this.dragSourceNode=null,this.dragSourceRef=null}clearDragPreview(){this.dragPreviewNode=null,this.dragPreviewRef=null}constructor(e){this.hooks=Ud({dragSource:(t,n)=>{this.clearDragSource(),this.dragSourceOptions=n||null,eo(t)?this.dragSourceRef=t:this.dragSourceNode=t,this.reconnectDragSource()},dragPreview:(t,n)=>{this.clearDragPreview(),this.dragPreviewOptions=n||null,eo(t)?this.dragPreviewRef=t:this.dragPreviewNode=t,this.reconnectDragPreview()}}),this.handlerId=null,this.dragSourceRef=null,this.dragSourceOptionsInternal=null,this.dragPreviewRef=null,this.dragPreviewOptionsInternal=null,this.lastConnectedHandlerId=null,this.lastConnectedDragSource=null,this.lastConnectedDragSourceOptions=null,this.lastConnectedDragPreview=null,this.lastConnectedDragPreviewOptions=null,this.backend=e}}class hg{get connectTarget(){return this.dropTarget}reconnect(){const e=this.didHandlerIdChange()||this.didDropTargetChange()||this.didOptionsChange();e&&this.disconnectDropTarget();const t=this.dropTarget;if(this.handlerId){if(!t){this.lastConnectedDropTarget=t;return}e&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDropTarget=t,this.lastConnectedDropTargetOptions=this.dropTargetOptions,this.unsubscribeDropTarget=this.backend.connectDropTarget(this.handlerId,t,this.dropTargetOptions))}}receiveHandlerId(e){e!==this.handlerId&&(this.handlerId=e,this.reconnect())}get dropTargetOptions(){return this.dropTargetOptionsInternal}set dropTargetOptions(e){this.dropTargetOptionsInternal=e}didHandlerIdChange(){return this.lastConnectedHandlerId!==this.handlerId}didDropTargetChange(){return this.lastConnectedDropTarget!==this.dropTarget}didOptionsChange(){return!Qs(this.lastConnectedDropTargetOptions,this.dropTargetOptions)}disconnectDropTarget(){this.unsubscribeDropTarget&&(this.unsubscribeDropTarget(),this.unsubscribeDropTarget=void 0)}get dropTarget(){return this.dropTargetNode||this.dropTargetRef&&this.dropTargetRef.current}clearDropTarget(){this.dropTargetRef=null,this.dropTargetNode=null}constructor(e){this.hooks=Ud({dropTarget:(t,n)=>{this.clearDropTarget(),this.dropTargetOptions=n,eo(t)?this.dropTargetRef=t:this.dropTargetNode=t,this.reconnect()}}),this.handlerId=null,this.dropTargetRef=null,this.dropTargetOptionsInternal=null,this.lastConnectedHandlerId=null,this.lastConnectedDropTarget=null,this.lastConnectedDropTargetOptions=null,this.backend=e}}function qi(){const{dragDropManager:i}=D.useContext(Nd);return De(i!=null,"Expected drag drop context"),i}function fg(i,e){const t=qi(),n=D.useMemo(()=>new pg(t.getBackend()),[t]);return mi(()=>(n.dragSourceOptions=i||null,n.reconnect(),()=>n.disconnectDragSource()),[n,i]),mi(()=>(n.dragPreviewOptions=e||null,n.reconnect(),()=>n.disconnectDragPreview()),[n,e]),n}function mg(){const i=qi();return D.useMemo(()=>new sg(i),[i])}class gg{beginDrag(){const e=this.spec,t=this.monitor;let n=null;return typeof e.item=="object"?n=e.item:typeof e.item=="function"?n=e.item(t):n={},n??null}canDrag(){const e=this.spec,t=this.monitor;return typeof e.canDrag=="boolean"?e.canDrag:typeof e.canDrag=="function"?e.canDrag(t):!0}isDragging(e,t){const n=this.spec,r=this.monitor,{isDragging:s}=n;return s?s(r):t===e.getSourceId()}endDrag(){const e=this.spec,t=this.monitor,n=this.connector,{end:r}=e;r&&r(t.getItem(),t),n.reconnect()}constructor(e,t,n){this.spec=e,this.monitor=t,this.connector=n}}function vg(i,e,t){const n=D.useMemo(()=>new gg(i,e,t),[e,t]);return D.useEffect(()=>{n.spec=i},[i]),n}function xg(i){return D.useMemo(()=>{const e=i.type;return De(e!=null,"spec.type must be defined"),e},[i])}function yg(i,e,t){const n=qi(),r=vg(i,e,t),s=xg(i);mi(function(){if(s!=null){const[a,l]=lg(s,r,n);return e.receiveHandlerId(a),t.receiveHandlerId(a),l}},[n,e,t,r,s])}function bg(i,e){const t=qd(i,e);De(!t.begin,"useDrag::spec.begin was deprecated in v14. Replace spec.begin() with spec.item(). (see more here - https://react-dnd.github.io/react-dnd/docs/api/use-drag)");const n=mg(),r=fg(t.options,t.previewOptions);return yg(t,n,r),[Hd(t.collect,n,r),ng(r),rg(r)]}function wg(i){return D.useMemo(()=>i.hooks.dropTarget(),[i])}function Dg(i){const e=qi(),t=D.useMemo(()=>new hg(e.getBackend()),[e]);return mi(()=>(t.dropTargetOptions=i||null,t.reconnect(),()=>t.disconnectDropTarget()),[i]),t}function Sg(){const i=qi();return D.useMemo(()=>new og(i),[i])}function Ig(i){const{accept:e}=i;return D.useMemo(()=>(De(i.accept!=null,"accept must be defined"),Array.isArray(e)?e:[e]),[e])}class Cg{canDrop(){const e=this.spec,t=this.monitor;return e.canDrop?e.canDrop(t.getItem(),t):!0}hover(){const e=this.spec,t=this.monitor;e.hover&&e.hover(t.getItem(),t)}drop(){const e=this.spec,t=this.monitor;if(e.drop)return e.drop(t.getItem(),t)}constructor(e,t){this.spec=e,this.monitor=t}}function _g(i,e){const t=D.useMemo(()=>new Cg(i,e),[e]);return D.useEffect(()=>{t.spec=i},[i]),t}function Mg(i,e,t){const n=qi(),r=_g(i,e),s=Ig(i);mi(function(){const[a,l]=ag(s,r,n);return e.receiveHandlerId(a),t.receiveHandlerId(a),l},[n,e,r,t,s.map(o=>o.toString()).join("|")])}function kg(i,e){const t=qd(i,e),n=Sg(),r=Dg(t.options);return Mg(t,n,r),[Hd(t.collect,n,r),wg(r)]}function Yd(i){let e=null;return()=>(e==null&&(e=i()),e)}function Tg(i,e){return i.filter(t=>t!==e)}function Pg(i,e){const t=new Set,n=s=>t.add(s);i.forEach(n),e.forEach(n);const r=[];return t.forEach(s=>r.push(s)),r}class Og{enter(e){const t=this.entered.length,n=r=>this.isNodeInDocument(r)&&(!r.contains||r.contains(e));return this.entered=Pg(this.entered.filter(n),[e]),t===0&&this.entered.length>0}leave(e){const t=this.entered.length;return this.entered=Tg(this.entered.filter(this.isNodeInDocument),e),t>0&&this.entered.length===0}reset(){this.entered=[]}constructor(e){this.entered=[],this.isNodeInDocument=e}}class jg{initializeExposedProperties(){Object.keys(this.config.exposeProperties).forEach(e=>{Object.defineProperty(this.item,e,{configurable:!0,enumerable:!0,get(){return console.warn(`Browser doesn't allow reading "${e}" until the drop event.`),null}})})}loadDataTransfer(e){if(e){const t={};Object.keys(this.config.exposeProperties).forEach(n=>{const r=this.config.exposeProperties[n];r!=null&&(t[n]={value:r(e,this.config.matchesTypes),configurable:!0,enumerable:!0})}),Object.defineProperties(this.item,t)}}canDrag(){return!0}beginDrag(){return this.item}isDragging(e,t){return t===e.getSourceId()}endDrag(){}constructor(e){this.config=e,this.item={},this.initializeExposedProperties()}}const Gd="__NATIVE_FILE__",Jd="__NATIVE_URL__",Kd="__NATIVE_TEXT__",Xd="__NATIVE_HTML__",Ul=Object.freeze(Object.defineProperty({__proto__:null,FILE:Gd,HTML:Xd,TEXT:Kd,URL:Jd},Symbol.toStringTag,{value:"Module"}));function ks(i,e,t){const n=e.reduce((r,s)=>r||i.getData(s),"");return n??t}const to={[Gd]:{exposeProperties:{files:i=>Array.prototype.slice.call(i.files),items:i=>i.items,dataTransfer:i=>i},matchesTypes:["Files"]},[Xd]:{exposeProperties:{html:(i,e)=>ks(i,e,""),dataTransfer:i=>i},matchesTypes:["Html","text/html"]},[Jd]:{exposeProperties:{urls:(i,e)=>ks(i,e,"").split(`
`),dataTransfer:i=>i},matchesTypes:["Url","text/uri-list"]},[Kd]:{exposeProperties:{text:(i,e)=>ks(i,e,""),dataTransfer:i=>i},matchesTypes:["Text","text/plain"]}};function Eg(i,e){const t=to[i];if(!t)throw new Error(`native type ${i} has no configuration`);const n=new jg(t);return n.loadDataTransfer(e),n}function Ts(i){if(!i)return null;const e=Array.prototype.slice.call(i.types||[]);return Object.keys(to).filter(t=>{const n=to[t];return n!=null&&n.matchesTypes?n.matchesTypes.some(r=>e.indexOf(r)>-1):!1})[0]||null}const Rg=Yd(()=>/firefox/i.test(navigator.userAgent)),Zd=Yd(()=>!!window.safari);class Yl{interpolate(e){const{xs:t,ys:n,c1s:r,c2s:s,c3s:o}=this;let a=t.length-1;if(e===t[a])return n[a];let l=0,c=o.length-1,u;for(;l<=c;){u=Math.floor(.5*(l+c));const f=t[u];if(f<e)l=u+1;else if(f>e)c=u-1;else return n[u]}a=Math.max(0,c);const p=e-t[a],d=p*p;return n[a]+r[a]*p+s[a]*d+o[a]*p*d}constructor(e,t){const{length:n}=e,r=[];for(let f=0;f<n;f++)r.push(f);r.sort((f,m)=>e[f]<e[m]?-1:1);const s=[],o=[];let a,l;for(let f=0;f<n-1;f++)a=e[f+1]-e[f],l=t[f+1]-t[f],s.push(a),o.push(l/a);const c=[o[0]];for(let f=0;f<s.length-1;f++){const m=o[f],v=o[f+1];if(m*v<=0)c.push(0);else{a=s[f];const g=s[f+1],x=a+g;c.push(3*x/((x+g)/m+(x+a)/v))}}c.push(o[o.length-1]);const u=[],p=[];let d;for(let f=0;f<c.length-1;f++){d=o[f];const m=c[f],v=1/s[f],g=m+c[f+1]-d-d;u.push((d-m-g)*v),p.push(g*v*v)}this.xs=e,this.ys=t,this.c1s=c,this.c2s=u,this.c3s=p}}const Ag=1;function Qd(i){const e=i.nodeType===Ag?i:i.parentElement;if(!e)return null;const{top:t,left:n}=e.getBoundingClientRect();return{x:n,y:t}}function Kn(i){return{x:i.clientX,y:i.clientY}}function Ng(i){var e;return i.nodeName==="IMG"&&(Rg()||!(!((e=document.documentElement)===null||e===void 0)&&e.contains(i)))}function $g(i,e,t,n){let r=i?e.width:t,s=i?e.height:n;return Zd()&&i&&(s/=window.devicePixelRatio,r/=window.devicePixelRatio),{dragPreviewWidth:r,dragPreviewHeight:s}}function Wg(i,e,t,n,r){const s=Ng(e),a=Qd(s?i:e),l={x:t.x-a.x,y:t.y-a.y},{offsetWidth:c,offsetHeight:u}=i,{anchorX:p,anchorY:d}=n,{dragPreviewWidth:f,dragPreviewHeight:m}=$g(s,e,c,u),v=()=>{let b=new Yl([0,.5,1],[l.y,l.y/u*m,l.y+m-u]).interpolate(d);return Zd()&&s&&(b+=(window.devicePixelRatio-1)*m),b},g=()=>new Yl([0,.5,1],[l.x,l.x/c*f,l.x+f-c]).interpolate(p),{offsetX:x,offsetY:y}=r,w=x===0||x,S=y===0||y;return{x:w?x:g(),y:S?y:v()}}class Fg{get window(){if(this.globalContext)return this.globalContext;if(typeof window<"u")return window}get document(){var e;return!((e=this.globalContext)===null||e===void 0)&&e.document?this.globalContext.document:this.window?this.window.document:void 0}get rootElement(){var e;return((e=this.optionsArgs)===null||e===void 0?void 0:e.rootElement)||this.window}constructor(e,t){this.ownerDocument=null,this.globalContext=e,this.optionsArgs=t}}function Lg(i,e,t){return e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}function Gl(i){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{},n=Object.keys(t);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(t).filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable}))),n.forEach(function(r){Lg(i,r,t[r])})}return i}class Bg{profile(){var e,t;return{sourcePreviewNodes:this.sourcePreviewNodes.size,sourcePreviewNodeOptions:this.sourcePreviewNodeOptions.size,sourceNodeOptions:this.sourceNodeOptions.size,sourceNodes:this.sourceNodes.size,dragStartSourceIds:((e=this.dragStartSourceIds)===null||e===void 0?void 0:e.length)||0,dropTargetIds:this.dropTargetIds.length,dragEnterTargetIds:this.dragEnterTargetIds.length,dragOverTargetIds:((t=this.dragOverTargetIds)===null||t===void 0?void 0:t.length)||0}}get window(){return this.options.window}get document(){return this.options.document}get rootElement(){return this.options.rootElement}setup(){const e=this.rootElement;if(e!==void 0){if(e.__isReactDndBackendSetUp)throw new Error("Cannot have two HTML5 backends at the same time.");e.__isReactDndBackendSetUp=!0,this.addEventListeners(e)}}teardown(){const e=this.rootElement;if(e!==void 0&&(e.__isReactDndBackendSetUp=!1,this.removeEventListeners(this.rootElement),this.clearCurrentDragSourceNode(),this.asyncEndDragFrameId)){var t;(t=this.window)===null||t===void 0||t.cancelAnimationFrame(this.asyncEndDragFrameId)}}connectDragPreview(e,t,n){return this.sourcePreviewNodeOptions.set(e,n),this.sourcePreviewNodes.set(e,t),()=>{this.sourcePreviewNodes.delete(e),this.sourcePreviewNodeOptions.delete(e)}}connectDragSource(e,t,n){this.sourceNodes.set(e,t),this.sourceNodeOptions.set(e,n);const r=o=>this.handleDragStart(o,e),s=o=>this.handleSelectStart(o);return t.setAttribute("draggable","true"),t.addEventListener("dragstart",r),t.addEventListener("selectstart",s),()=>{this.sourceNodes.delete(e),this.sourceNodeOptions.delete(e),t.removeEventListener("dragstart",r),t.removeEventListener("selectstart",s),t.setAttribute("draggable","false")}}connectDropTarget(e,t){const n=o=>this.handleDragEnter(o,e),r=o=>this.handleDragOver(o,e),s=o=>this.handleDrop(o,e);return t.addEventListener("dragenter",n),t.addEventListener("dragover",r),t.addEventListener("drop",s),()=>{t.removeEventListener("dragenter",n),t.removeEventListener("dragover",r),t.removeEventListener("drop",s)}}addEventListeners(e){e.addEventListener&&(e.addEventListener("dragstart",this.handleTopDragStart),e.addEventListener("dragstart",this.handleTopDragStartCapture,!0),e.addEventListener("dragend",this.handleTopDragEndCapture,!0),e.addEventListener("dragenter",this.handleTopDragEnter),e.addEventListener("dragenter",this.handleTopDragEnterCapture,!0),e.addEventListener("dragleave",this.handleTopDragLeaveCapture,!0),e.addEventListener("dragover",this.handleTopDragOver),e.addEventListener("dragover",this.handleTopDragOverCapture,!0),e.addEventListener("drop",this.handleTopDrop),e.addEventListener("drop",this.handleTopDropCapture,!0))}removeEventListeners(e){e.removeEventListener&&(e.removeEventListener("dragstart",this.handleTopDragStart),e.removeEventListener("dragstart",this.handleTopDragStartCapture,!0),e.removeEventListener("dragend",this.handleTopDragEndCapture,!0),e.removeEventListener("dragenter",this.handleTopDragEnter),e.removeEventListener("dragenter",this.handleTopDragEnterCapture,!0),e.removeEventListener("dragleave",this.handleTopDragLeaveCapture,!0),e.removeEventListener("dragover",this.handleTopDragOver),e.removeEventListener("dragover",this.handleTopDragOverCapture,!0),e.removeEventListener("drop",this.handleTopDrop),e.removeEventListener("drop",this.handleTopDropCapture,!0))}getCurrentSourceNodeOptions(){const e=this.monitor.getSourceId(),t=this.sourceNodeOptions.get(e);return Gl({dropEffect:this.altKeyPressed?"copy":"move"},t||{})}getCurrentDropEffect(){return this.isDraggingNativeItem()?"copy":this.getCurrentSourceNodeOptions().dropEffect}getCurrentSourcePreviewNodeOptions(){const e=this.monitor.getSourceId(),t=this.sourcePreviewNodeOptions.get(e);return Gl({anchorX:.5,anchorY:.5,captureDraggingState:!1},t||{})}isDraggingNativeItem(){const e=this.monitor.getItemType();return Object.keys(Ul).some(t=>Ul[t]===e)}beginDragNativeItem(e,t){this.clearCurrentDragSourceNode(),this.currentNativeSource=Eg(e,t),this.currentNativeHandle=this.registry.addSource(e,this.currentNativeSource),this.actions.beginDrag([this.currentNativeHandle])}setCurrentDragSourceNode(e){this.clearCurrentDragSourceNode(),this.currentDragSourceNode=e;const t=1e3;this.mouseMoveTimeoutTimer=setTimeout(()=>{var n;return(n=this.rootElement)===null||n===void 0?void 0:n.addEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)},t)}clearCurrentDragSourceNode(){if(this.currentDragSourceNode){if(this.currentDragSourceNode=null,this.rootElement){var e;(e=this.window)===null||e===void 0||e.clearTimeout(this.mouseMoveTimeoutTimer||void 0),this.rootElement.removeEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)}return this.mouseMoveTimeoutTimer=null,!0}return!1}handleDragStart(e,t){e.defaultPrevented||(this.dragStartSourceIds||(this.dragStartSourceIds=[]),this.dragStartSourceIds.unshift(t))}handleDragEnter(e,t){this.dragEnterTargetIds.unshift(t)}handleDragOver(e,t){this.dragOverTargetIds===null&&(this.dragOverTargetIds=[]),this.dragOverTargetIds.unshift(t)}handleDrop(e,t){this.dropTargetIds.unshift(t)}constructor(e,t,n){this.sourcePreviewNodes=new Map,this.sourcePreviewNodeOptions=new Map,this.sourceNodes=new Map,this.sourceNodeOptions=new Map,this.dragStartSourceIds=null,this.dropTargetIds=[],this.dragEnterTargetIds=[],this.currentNativeSource=null,this.currentNativeHandle=null,this.currentDragSourceNode=null,this.altKeyPressed=!1,this.mouseMoveTimeoutTimer=null,this.asyncEndDragFrameId=null,this.dragOverTargetIds=null,this.lastClientOffset=null,this.hoverRafId=null,this.getSourceClientOffset=r=>{const s=this.sourceNodes.get(r);return s&&Qd(s)||null},this.endDragNativeItem=()=>{this.isDraggingNativeItem()&&(this.actions.endDrag(),this.currentNativeHandle&&this.registry.removeSource(this.currentNativeHandle),this.currentNativeHandle=null,this.currentNativeSource=null)},this.isNodeInDocument=r=>!!(r&&this.document&&this.document.body&&this.document.body.contains(r)),this.endDragIfSourceWasRemovedFromDOM=()=>{const r=this.currentDragSourceNode;r==null||this.isNodeInDocument(r)||(this.clearCurrentDragSourceNode()&&this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover())},this.scheduleHover=r=>{this.hoverRafId===null&&typeof requestAnimationFrame<"u"&&(this.hoverRafId=requestAnimationFrame(()=>{this.monitor.isDragging()&&this.actions.hover(r||[],{clientOffset:this.lastClientOffset}),this.hoverRafId=null}))},this.cancelHover=()=>{this.hoverRafId!==null&&typeof cancelAnimationFrame<"u"&&(cancelAnimationFrame(this.hoverRafId),this.hoverRafId=null)},this.handleTopDragStartCapture=()=>{this.clearCurrentDragSourceNode(),this.dragStartSourceIds=[]},this.handleTopDragStart=r=>{if(r.defaultPrevented)return;const{dragStartSourceIds:s}=this;this.dragStartSourceIds=null;const o=Kn(r);this.monitor.isDragging()&&(this.actions.endDrag(),this.cancelHover()),this.actions.beginDrag(s||[],{publishSource:!1,getSourceClientOffset:this.getSourceClientOffset,clientOffset:o});const{dataTransfer:a}=r,l=Ts(a);if(this.monitor.isDragging()){if(a&&typeof a.setDragImage=="function"){const u=this.monitor.getSourceId(),p=this.sourceNodes.get(u),d=this.sourcePreviewNodes.get(u)||p;if(d){const{anchorX:f,anchorY:m,offsetX:v,offsetY:g}=this.getCurrentSourcePreviewNodeOptions(),w=Wg(p,d,o,{anchorX:f,anchorY:m},{offsetX:v,offsetY:g});a.setDragImage(d,w.x,w.y)}}try{a==null||a.setData("application/json",{})}catch{}this.setCurrentDragSourceNode(r.target);const{captureDraggingState:c}=this.getCurrentSourcePreviewNodeOptions();c?this.actions.publishDragSource():setTimeout(()=>this.actions.publishDragSource(),0)}else if(l)this.beginDragNativeItem(l);else{if(a&&!a.types&&(r.target&&!r.target.hasAttribute||!r.target.hasAttribute("draggable")))return;r.preventDefault()}},this.handleTopDragEndCapture=()=>{this.clearCurrentDragSourceNode()&&this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover()},this.handleTopDragEnterCapture=r=>{if(this.dragEnterTargetIds=[],this.isDraggingNativeItem()){var s;(s=this.currentNativeSource)===null||s===void 0||s.loadDataTransfer(r.dataTransfer)}if(!this.enterLeaveCounter.enter(r.target)||this.monitor.isDragging())return;const{dataTransfer:a}=r,l=Ts(a);l&&this.beginDragNativeItem(l,a)},this.handleTopDragEnter=r=>{const{dragEnterTargetIds:s}=this;if(this.dragEnterTargetIds=[],!this.monitor.isDragging())return;this.altKeyPressed=r.altKey,s.length>0&&this.actions.hover(s,{clientOffset:Kn(r)}),s.some(a=>this.monitor.canDropOnTarget(a))&&(r.preventDefault(),r.dataTransfer&&(r.dataTransfer.dropEffect=this.getCurrentDropEffect()))},this.handleTopDragOverCapture=r=>{if(this.dragOverTargetIds=[],this.isDraggingNativeItem()){var s;(s=this.currentNativeSource)===null||s===void 0||s.loadDataTransfer(r.dataTransfer)}},this.handleTopDragOver=r=>{const{dragOverTargetIds:s}=this;if(this.dragOverTargetIds=[],!this.monitor.isDragging()){r.preventDefault(),r.dataTransfer&&(r.dataTransfer.dropEffect="none");return}this.altKeyPressed=r.altKey,this.lastClientOffset=Kn(r),this.scheduleHover(s),(s||[]).some(a=>this.monitor.canDropOnTarget(a))?(r.preventDefault(),r.dataTransfer&&(r.dataTransfer.dropEffect=this.getCurrentDropEffect())):this.isDraggingNativeItem()?r.preventDefault():(r.preventDefault(),r.dataTransfer&&(r.dataTransfer.dropEffect="none"))},this.handleTopDragLeaveCapture=r=>{this.isDraggingNativeItem()&&r.preventDefault(),this.enterLeaveCounter.leave(r.target)&&(this.isDraggingNativeItem()&&setTimeout(()=>this.endDragNativeItem(),0),this.cancelHover())},this.handleTopDropCapture=r=>{if(this.dropTargetIds=[],this.isDraggingNativeItem()){var s;r.preventDefault(),(s=this.currentNativeSource)===null||s===void 0||s.loadDataTransfer(r.dataTransfer)}else Ts(r.dataTransfer)&&r.preventDefault();this.enterLeaveCounter.reset()},this.handleTopDrop=r=>{const{dropTargetIds:s}=this;this.dropTargetIds=[],this.actions.hover(s,{clientOffset:Kn(r)}),this.actions.drop({dropEffect:this.getCurrentDropEffect()}),this.isDraggingNativeItem()?this.endDragNativeItem():this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover()},this.handleSelectStart=r=>{const s=r.target;typeof s.dragDrop=="function"&&(s.tagName==="INPUT"||s.tagName==="SELECT"||s.tagName==="TEXTAREA"||s.isContentEditable||(r.preventDefault(),s.dragDrop()))},this.options=new Fg(t,n),this.actions=e.getActions(),this.monitor=e.getMonitor(),this.registry=e.getRegistry(),this.enterLeaveCounter=new Og(this.isNodeInDocument)}}const Vg=function(e,t,n){return new Bg(e,t,n)};function Ke(i){return`Minified Redux error #${i}; visit https://redux.js.org/Errors?code=${i} for the full message or use the non-minified dev environment for full errors. `}var zg=typeof Symbol=="function"&&Symbol.observable||"@@observable",Jl=zg,Ps=()=>Math.random().toString(36).substring(7).split("").join("."),Hg={INIT:`@@redux/INIT${Ps()}`,REPLACE:`@@redux/REPLACE${Ps()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${Ps()}`},gr=Hg;function No(i){if(typeof i!="object"||i===null)return!1;let e=i;for(;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(i)===e||Object.getPrototypeOf(i)===null}function eu(i,e,t){if(typeof i!="function")throw new Error(Ke(2));if(typeof e=="function"&&typeof t=="function"||typeof t=="function"&&typeof arguments[3]=="function")throw new Error(Ke(0));if(typeof e=="function"&&typeof t>"u"&&(t=e,e=void 0),typeof t<"u"){if(typeof t!="function")throw new Error(Ke(1));return t(eu)(i,e)}let n=i,r=e,s=new Map,o=s,a=0,l=!1;function c(){o===s&&(o=new Map,s.forEach((g,x)=>{o.set(x,g)}))}function u(){if(l)throw new Error(Ke(3));return r}function p(g){if(typeof g!="function")throw new Error(Ke(4));if(l)throw new Error(Ke(5));let x=!0;c();const y=a++;return o.set(y,g),function(){if(x){if(l)throw new Error(Ke(6));x=!1,c(),o.delete(y),s=null}}}function d(g){if(!No(g))throw new Error(Ke(7));if(typeof g.type>"u")throw new Error(Ke(8));if(typeof g.type!="string")throw new Error(Ke(17));if(l)throw new Error(Ke(9));try{l=!0,r=n(r,g)}finally{l=!1}return(s=o).forEach(y=>{y()}),g}function f(g){if(typeof g!="function")throw new Error(Ke(10));n=g,d({type:gr.REPLACE})}function m(){const g=p;return{subscribe(x){if(typeof x!="object"||x===null)throw new Error(Ke(11));function y(){const S=x;S.next&&S.next(u())}return y(),{unsubscribe:g(y)}},[Jl](){return this}}}return d({type:gr.INIT}),{dispatch:d,subscribe:p,getState:u,replaceReducer:f,[Jl]:m}}function qg(i){Object.keys(i).forEach(e=>{const t=i[e];if(typeof t(void 0,{type:gr.INIT})>"u")throw new Error(Ke(12));if(typeof t(void 0,{type:gr.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(Ke(13))})}function Ug(i){const e=Object.keys(i),t={};for(let s=0;s<e.length;s++){const o=e[s];typeof i[o]=="function"&&(t[o]=i[o])}const n=Object.keys(t);let r;try{qg(t)}catch(s){r=s}return function(o={},a){if(r)throw r;let l=!1;const c={};for(let u=0;u<n.length;u++){const p=n[u],d=t[p],f=o[p],m=d(f,a);if(typeof m>"u")throw a&&a.type,new Error(Ke(14));c[p]=m,l=l||m!==f}return l=l||n.length!==Object.keys(o).length,l?c:o}}function vr(...i){return i.length===0?e=>e:i.length===1?i[0]:i.reduce((e,t)=>(...n)=>e(t(...n)))}function Yg(...i){return e=>(t,n)=>{const r=e(t,n);let s=()=>{throw new Error(Ke(15))};const o={getState:r.getState,dispatch:(l,...c)=>s(l,...c)},a=i.map(l=>l(o));return s=vr(...a)(r.dispatch),{...r,dispatch:s}}}function Gg(i){return No(i)&&"type"in i&&typeof i.type=="string"}var tu=Symbol.for("immer-nothing"),Kl=Symbol.for("immer-draftable"),dt=Symbol.for("immer-state");function Ct(i,...e){throw new Error(`[Immer] minified error nr: ${i}. Full error at: https://bit.ly/3cXEKWf`)}var $i=Object.getPrototypeOf;function gi(i){return!!i&&!!i[dt]}function Lt(i){var e;return i?iu(i)||Array.isArray(i)||!!i[Kl]||!!((e=i.constructor)!=null&&e[Kl])||Gr(i)||Jr(i):!1}var Jg=Object.prototype.constructor.toString();function iu(i){if(!i||typeof i!="object")return!1;const e=$i(i);if(e===null)return!0;const t=Object.hasOwnProperty.call(e,"constructor")&&e.constructor;return t===Object?!0:typeof t=="function"&&Function.toString.call(t)===Jg}function xr(i,e){Yr(i)===0?Reflect.ownKeys(i).forEach(t=>{e(t,i[t],i)}):i.forEach((t,n)=>e(n,t,i))}function Yr(i){const e=i[dt];return e?e.type_:Array.isArray(i)?1:Gr(i)?2:Jr(i)?3:0}function io(i,e){return Yr(i)===2?i.has(e):Object.prototype.hasOwnProperty.call(i,e)}function nu(i,e,t){const n=Yr(i);n===2?i.set(e,t):n===3?i.add(t):i[e]=t}function Kg(i,e){return i===e?i!==0||1/i===1/e:i!==i&&e!==e}function Gr(i){return i instanceof Map}function Jr(i){return i instanceof Set}function di(i){return i.copy_||i.base_}function no(i,e){if(Gr(i))return new Map(i);if(Jr(i))return new Set(i);if(Array.isArray(i))return Array.prototype.slice.call(i);const t=iu(i);if(e===!0||e==="class_only"&&!t){const n=Object.getOwnPropertyDescriptors(i);delete n[dt];let r=Reflect.ownKeys(n);for(let s=0;s<r.length;s++){const o=r[s],a=n[o];a.writable===!1&&(a.writable=!0,a.configurable=!0),(a.get||a.set)&&(n[o]={configurable:!0,writable:!0,enumerable:a.enumerable,value:i[o]})}return Object.create($i(i),n)}else{const n=$i(i);if(n!==null&&t)return{...i};const r=Object.create(n);return Object.assign(r,i)}}function $o(i,e=!1){return Kr(i)||gi(i)||!Lt(i)||(Yr(i)>1&&(i.set=i.add=i.clear=i.delete=Xg),Object.freeze(i),e&&Object.entries(i).forEach(([t,n])=>$o(n,!0))),i}function Xg(){Ct(2)}function Kr(i){return Object.isFrozen(i)}var Zg={};function vi(i){const e=Zg[i];return e||Ct(0,i),e}var Sn;function ru(){return Sn}function Qg(i,e){return{drafts_:[],parent_:i,immer_:e,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function Xl(i,e){e&&(vi("Patches"),i.patches_=[],i.inversePatches_=[],i.patchListener_=e)}function ro(i){so(i),i.drafts_.forEach(ev),i.drafts_=null}function so(i){i===Sn&&(Sn=i.parent_)}function Zl(i){return Sn=Qg(Sn,i)}function ev(i){const e=i[dt];e.type_===0||e.type_===1?e.revoke_():e.revoked_=!0}function Ql(i,e){e.unfinalizedDrafts_=e.drafts_.length;const t=e.drafts_[0];return i!==void 0&&i!==t?(t[dt].modified_&&(ro(e),Ct(4)),Lt(i)&&(i=yr(e,i),e.parent_||br(e,i)),e.patches_&&vi("Patches").generateReplacementPatches_(t[dt].base_,i,e.patches_,e.inversePatches_)):i=yr(e,t,[]),ro(e),e.patches_&&e.patchListener_(e.patches_,e.inversePatches_),i!==tu?i:void 0}function yr(i,e,t){if(Kr(e))return e;const n=e[dt];if(!n)return xr(e,(r,s)=>ec(i,n,e,r,s,t)),e;if(n.scope_!==i)return e;if(!n.modified_)return br(i,n.base_,!0),n.base_;if(!n.finalized_){n.finalized_=!0,n.scope_.unfinalizedDrafts_--;const r=n.copy_;let s=r,o=!1;n.type_===3&&(s=new Set(r),r.clear(),o=!0),xr(s,(a,l)=>ec(i,n,r,a,l,t,o)),br(i,r,!1),t&&i.patches_&&vi("Patches").generatePatches_(n,t,i.patches_,i.inversePatches_)}return n.copy_}function ec(i,e,t,n,r,s,o){if(gi(r)){const a=s&&e&&e.type_!==3&&!io(e.assigned_,n)?s.concat(n):void 0,l=yr(i,r,a);if(nu(t,n,l),gi(l))i.canAutoFreeze_=!1;else return}else o&&t.add(r);if(Lt(r)&&!Kr(r)){if(!i.immer_.autoFreeze_&&i.unfinalizedDrafts_<1)return;yr(i,r),(!e||!e.scope_.parent_)&&typeof n!="symbol"&&Object.prototype.propertyIsEnumerable.call(t,n)&&br(i,r)}}function br(i,e,t=!1){!i.parent_&&i.immer_.autoFreeze_&&i.canAutoFreeze_&&$o(e,t)}function tv(i,e){const t=Array.isArray(i),n={type_:t?1:0,scope_:e?e.scope_:ru(),modified_:!1,finalized_:!1,assigned_:{},parent_:e,base_:i,draft_:null,copy_:null,revoke_:null,isManual_:!1};let r=n,s=Wo;t&&(r=[n],s=In);const{revoke:o,proxy:a}=Proxy.revocable(r,s);return n.draft_=a,n.revoke_=o,a}var Wo={get(i,e){if(e===dt)return i;const t=di(i);if(!io(t,e))return iv(i,t,e);const n=t[e];return i.finalized_||!Lt(n)?n:n===Os(i.base_,e)?(js(i),i.copy_[e]=ao(n,i)):n},has(i,e){return e in di(i)},ownKeys(i){return Reflect.ownKeys(di(i))},set(i,e,t){const n=su(di(i),e);if(n!=null&&n.set)return n.set.call(i.draft_,t),!0;if(!i.modified_){const r=Os(di(i),e),s=r==null?void 0:r[dt];if(s&&s.base_===t)return i.copy_[e]=t,i.assigned_[e]=!1,!0;if(Kg(t,r)&&(t!==void 0||io(i.base_,e)))return!0;js(i),oo(i)}return i.copy_[e]===t&&(t!==void 0||e in i.copy_)||Number.isNaN(t)&&Number.isNaN(i.copy_[e])||(i.copy_[e]=t,i.assigned_[e]=!0),!0},deleteProperty(i,e){return Os(i.base_,e)!==void 0||e in i.base_?(i.assigned_[e]=!1,js(i),oo(i)):delete i.assigned_[e],i.copy_&&delete i.copy_[e],!0},getOwnPropertyDescriptor(i,e){const t=di(i),n=Reflect.getOwnPropertyDescriptor(t,e);return n&&{writable:!0,configurable:i.type_!==1||e!=="length",enumerable:n.enumerable,value:t[e]}},defineProperty(){Ct(11)},getPrototypeOf(i){return $i(i.base_)},setPrototypeOf(){Ct(12)}},In={};xr(Wo,(i,e)=>{In[i]=function(){return arguments[0]=arguments[0][0],e.apply(this,arguments)}});In.deleteProperty=function(i,e){return In.set.call(this,i,e,void 0)};In.set=function(i,e,t){return Wo.set.call(this,i[0],e,t,i[0])};function Os(i,e){const t=i[dt];return(t?di(t):i)[e]}function iv(i,e,t){var r;const n=su(e,t);return n?"value"in n?n.value:(r=n.get)==null?void 0:r.call(i.draft_):void 0}function su(i,e){if(!(e in i))return;let t=$i(i);for(;t;){const n=Object.getOwnPropertyDescriptor(t,e);if(n)return n;t=$i(t)}}function oo(i){i.modified_||(i.modified_=!0,i.parent_&&oo(i.parent_))}function js(i){i.copy_||(i.copy_=no(i.base_,i.scope_.immer_.useStrictShallowCopy_))}var nv=class{constructor(i){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(e,t,n)=>{if(typeof e=="function"&&typeof t!="function"){const s=t;t=e;const o=this;return function(l=s,...c){return o.produce(l,u=>t.call(this,u,...c))}}typeof t!="function"&&Ct(6),n!==void 0&&typeof n!="function"&&Ct(7);let r;if(Lt(e)){const s=Zl(this),o=ao(e,void 0);let a=!0;try{r=t(o),a=!1}finally{a?ro(s):so(s)}return Xl(s,n),Ql(r,s)}else if(!e||typeof e!="object"){if(r=t(e),r===void 0&&(r=e),r===tu&&(r=void 0),this.autoFreeze_&&$o(r,!0),n){const s=[],o=[];vi("Patches").generateReplacementPatches_(e,r,s,o),n(s,o)}return r}else Ct(1,e)},this.produceWithPatches=(e,t)=>{if(typeof e=="function")return(o,...a)=>this.produceWithPatches(o,l=>e(l,...a));let n,r;return[this.produce(e,t,(o,a)=>{n=o,r=a}),n,r]},typeof(i==null?void 0:i.autoFreeze)=="boolean"&&this.setAutoFreeze(i.autoFreeze),typeof(i==null?void 0:i.useStrictShallowCopy)=="boolean"&&this.setUseStrictShallowCopy(i.useStrictShallowCopy)}createDraft(i){Lt(i)||Ct(8),gi(i)&&(i=rv(i));const e=Zl(this),t=ao(i,void 0);return t[dt].isManual_=!0,so(e),t}finishDraft(i,e){const t=i&&i[dt];(!t||!t.isManual_)&&Ct(9);const{scope_:n}=t;return Xl(n,e),Ql(void 0,n)}setAutoFreeze(i){this.autoFreeze_=i}setUseStrictShallowCopy(i){this.useStrictShallowCopy_=i}applyPatches(i,e){let t;for(t=e.length-1;t>=0;t--){const r=e[t];if(r.path.length===0&&r.op==="replace"){i=r.value;break}}t>-1&&(e=e.slice(t+1));const n=vi("Patches").applyPatches_;return gi(i)?n(i,e):this.produce(i,r=>n(r,e))}};function ao(i,e){const t=Gr(i)?vi("MapSet").proxyMap_(i,e):Jr(i)?vi("MapSet").proxySet_(i,e):tv(i,e);return(e?e.scope_:ru()).drafts_.push(t),t}function rv(i){return gi(i)||Ct(10,i),ou(i)}function ou(i){if(!Lt(i)||Kr(i))return i;const e=i[dt];let t;if(e){if(!e.modified_)return e.base_;e.finalized_=!0,t=no(i,e.scope_.immer_.useStrictShallowCopy_)}else t=no(i,!0);return xr(t,(n,r)=>{nu(t,n,ou(r))}),e&&(e.finalized_=!1),t}var ut=new nv,au=ut.produce;ut.produceWithPatches.bind(ut);ut.setAutoFreeze.bind(ut);ut.setUseStrictShallowCopy.bind(ut);ut.applyPatches.bind(ut);ut.createDraft.bind(ut);ut.finishDraft.bind(ut);function sv(i,e=`expected a function, instead received ${typeof i}`){if(typeof i!="function")throw new TypeError(e)}function ov(i,e=`expected an object, instead received ${typeof i}`){if(typeof i!="object")throw new TypeError(e)}function av(i,e="expected all items to be functions, instead received the following types: "){if(!i.every(t=>typeof t=="function")){const t=i.map(n=>typeof n=="function"?`function ${n.name||"unnamed"}()`:typeof n).join(", ");throw new TypeError(`${e}[${t}]`)}}var tc=i=>Array.isArray(i)?i:[i];function lv(i){const e=Array.isArray(i[0])?i[0]:i;return av(e,"createSelector expects all input-selectors to be functions, but received the following types: "),e}function cv(i,e){const t=[],{length:n}=i;for(let r=0;r<n;r++)t.push(i[r].apply(null,e));return t}var dv=class{constructor(i){this.value=i}deref(){return this.value}},uv=typeof WeakRef<"u"?WeakRef:dv,pv=0,ic=1;function Xn(){return{s:pv,v:void 0,o:null,p:null}}function lu(i,e={}){let t=Xn();const{resultEqualityCheck:n}=e;let r,s=0;function o(){var p;let a=t;const{length:l}=arguments;for(let d=0,f=l;d<f;d++){const m=arguments[d];if(typeof m=="function"||typeof m=="object"&&m!==null){let v=a.o;v===null&&(a.o=v=new WeakMap);const g=v.get(m);g===void 0?(a=Xn(),v.set(m,a)):a=g}else{let v=a.p;v===null&&(a.p=v=new Map);const g=v.get(m);g===void 0?(a=Xn(),v.set(m,a)):a=g}}const c=a;let u;if(a.s===ic)u=a.v;else if(u=i.apply(null,arguments),s++,n){const d=((p=r==null?void 0:r.deref)==null?void 0:p.call(r))??r;d!=null&&n(d,u)&&(u=d,s!==0&&s--),r=typeof u=="object"&&u!==null||typeof u=="function"?new uv(u):u}return c.s=ic,c.v=u,u}return o.clearCache=()=>{t=Xn(),o.resetResultsCount()},o.resultsCount=()=>s,o.resetResultsCount=()=>{s=0},o}function hv(i,...e){const t=typeof i=="function"?{memoize:i,memoizeOptions:e}:i,n=(...r)=>{let s=0,o=0,a,l={},c=r.pop();typeof c=="object"&&(l=c,c=r.pop()),sv(c,`createSelector expects an output function after the inputs, but received: [${typeof c}]`);const u={...t,...l},{memoize:p,memoizeOptions:d=[],argsMemoize:f=lu,argsMemoizeOptions:m=[]}=u,v=tc(d),g=tc(m),x=lv(r),y=p(function(){return s++,c.apply(null,arguments)},...v),w=f(function(){o++;const M=cv(x,arguments);return a=y.apply(null,M),a},...g);return Object.assign(w,{resultFunc:c,memoizedResultFunc:y,dependencies:x,dependencyRecomputations:()=>o,resetDependencyRecomputations:()=>{o=0},lastResult:()=>a,recomputations:()=>s,resetRecomputations:()=>{s=0},memoize:p,argsMemoize:f})};return Object.assign(n,{withTypes:()=>n}),n}var Fo=hv(lu),fv=Object.assign((i,e=Fo)=>{ov(i,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof i}`);const t=Object.keys(i),n=t.map(s=>i[s]);return e(n,(...s)=>s.reduce((o,a,l)=>(o[t[l]]=a,o),{}))},{withTypes:()=>fv});function cu(i){return({dispatch:t,getState:n})=>r=>s=>typeof s=="function"?s(t,n,i):r(s)}var mv=cu(),gv=cu,vv=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?vr:vr.apply(null,arguments)};function Ui(i,e){function t(...n){return{type:i,payload:n[0]}}return t.toString=()=>`${i}`,t.type=i,t.match=n=>Gg(n)&&n.type===i,t}var du=class hn extends Array{constructor(...e){super(...e),Object.setPrototypeOf(this,hn.prototype)}static get[Symbol.species](){return hn}concat(...e){return super.concat.apply(this,e)}prepend(...e){return e.length===1&&Array.isArray(e[0])?new hn(...e[0].concat(this)):new hn(...e.concat(this))}};function nc(i){return Lt(i)?au(i,()=>{}):i}function xv(i){return typeof i=="boolean"}var yv=()=>function(e){const{thunk:t=!0,immutableCheck:n=!0,serializableCheck:r=!0,actionCreatorCheck:s=!0}=e??{};let o=new du;return t&&(xv(t)?o.push(mv):o.push(gv(t.extraArgument))),o},bv="RTK_autoBatch",rc=i=>e=>{setTimeout(e,i)},wv=(i={type:"raf"})=>e=>(...t)=>{const n=e(...t);let r=!0,s=!1,o=!1;const a=new Set,l=i.type==="tick"?queueMicrotask:i.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:rc(10):i.type==="callback"?i.queueNotification:rc(i.timeout),c=()=>{o=!1,s&&(s=!1,a.forEach(u=>u()))};return Object.assign({},n,{subscribe(u){const p=()=>r&&u(),d=n.subscribe(p);return a.add(u),()=>{d(),a.delete(u)}},dispatch(u){var p;try{return r=!((p=u==null?void 0:u.meta)!=null&&p[bv]),s=!r,s&&(o||(o=!0,l(c))),n.dispatch(u)}finally{r=!0}}})},Dv=i=>function(t){const{autoBatch:n=!0}=t??{};let r=new du(i);return n&&r.push(wv(typeof n=="object"?n:void 0)),r};function Sv(i){const e=yv(),{reducer:t=void 0,middleware:n,devTools:r=!0,preloadedState:s=void 0,enhancers:o=void 0}=i||{};let a;if(typeof t=="function")a=t;else if(No(t))a=Ug(t);else throw new Error(lo(1));let l;typeof n=="function"?l=n(e):l=e();let c=vr;r&&(c=vv({trace:!1,...typeof r=="object"&&r}));const u=Yg(...l),p=Dv(u);let d=typeof o=="function"?o(p):p();const f=c(...d);return eu(a,s,f)}function Iv(i){const e={},t=[];let n;const r={addCase(s,o){const a=typeof s=="string"?s:s.type;if(!a)throw new Error(lo(28));if(a in e)throw new Error(lo(29));return e[a]=o,r},addMatcher(s,o){return t.push({matcher:s,reducer:o}),r},addDefaultCase(s){return n=s,r}};return i(r),[e,t,n]}function Cv(i){return typeof i=="function"}function _v(i,e){let[t,n,r]=Iv(e),s;if(Cv(i))s=()=>nc(i());else{const a=nc(i);s=()=>a}function o(a=s(),l){let c=[t[l.type],...n.filter(({matcher:u})=>u(l)).map(({reducer:u})=>u)];return c.filter(u=>!!u).length===0&&(c=[r]),c.reduce((u,p)=>{if(p)if(gi(u)){const f=p(u,l);return f===void 0?u:f}else{if(Lt(u))return au(u,d=>p(d,l));{const d=p(u,l);if(d===void 0){if(u===null)return u;throw Error("A case reducer on a non-draftable value must not return undefined")}return d}}return u},a)}return o.getInitialState=s,o}function lo(i){return`Minified Redux Toolkit error #${i}; visit https://redux-toolkit.js.org/Errors?code=${i} for the full message or use the non-minified dev environment for full errors. `}const sc="fakeId",Mv=Ui("project/update"),uu=Ui("view/update"),pr=Ui("widget/update"),kv=Ui("group/update"),Tv=Ui("activeUser/update"),wr=Ui("attributes/recalculate"),Pv={visProject:{},recalculateFields:!1,activeUser:""},Ov=_v(Pv,i=>{i.addCase(Mv,(e,t)=>{e.visProject=t.payload}).addCase(uu,(e,t)=>{const{viewId:n,data:r}=t.payload;e.visProject[n]=r}).addCase(pr,(e,t)=>{const{viewId:n,widgetId:r,data:s}=t.payload;if(r!==sc){if(!(n in e.visProject)){console.error(`Cannot update widget "${r}". The view "${n}" does not exist in the project.`);return}e.visProject[n].widgets[r]=s}}).addCase(kv,(e,t)=>{const{viewId:n,widgetId:r,data:s}=t.payload;if(r!==sc){if(!(n in e.visProject)){console.error(`Cannot update group widget "${r}". The view "${n}" does not exist in the project.`);return}e.visProject[n].widgets[r]=s}}).addCase(Tv,(e,t)=>{e.activeUser=t.payload}).addCase(wr,(e,t)=>{e.recalculateFields=t.payload})}),jv=i=>i.visProject,co=Fo([jv,(i,e)=>e],(i,e)=>i[e]),o1=Fo([co,(i,e,t)=>t],(i,e)=>i.widgets[e]),_e=Sv({reducer:Ov}),Ev="nothing_selected";function Lo(i){!i.overflowX&&!i.overflowY?i.overflow="visible":i.overflow&&delete i.overflow}function Ve(i){return window.isFinite(i)}function Rv(i){return i.tpl==="_tplGroup"}function it(i){return JSON.parse(JSON.stringify(i))}function pu(i,e,t=0){const n=[];e=e||_e.getState().visProject,Object.keys(e).forEach(s=>e[s].widgets&&Object.keys(e[s].widgets).forEach(o=>n.push(o)));let r=1;return n.forEach(s=>{const o=i?s.match(/^g([0-9]+)$/):s.match(/^w([0-9]+)$/);if(o){const a=parseInt(o[1],10);a>=r&&(r=a+1)}}),r+t}function hu(i,e=0){return`w${pu(!1,i,e).toString().padStart(6,"0")}`}function Av(i,e=0){return`g${pu(!0,i,e).toString().padStart(6,"0")}`}function a1(i){const{widgets:e,offset:t,project:n,widget:r,selectedGroup:s}=i,o=hu(n,t);return s&&Rv(e[s])&&(r.grouped=!0,r.groupid=s,e[s].data.members.push(o)),e[o]=r,o}function l1(i){const{widgets:e,group:t,groupMembers:n,offset:r,project:s}=i,o=Av(s,r??0);for(let a=0;a<t.data.members.length;a++){const l=t.data.members[a],c=it(n[l]),u=hu(s,a);c.groupid=o,t.data.members[a]=u,e[u]=c}return e[o]=t,o}function c1(i){i=it(i||_e.getState().visProject);for(const[e,t]of Object.entries(i))if(e!=="___settings")for(const n of Object.keys(t.widgets))n.includes("_")&&delete t.widgets[n];return i}const Bo={read:!0,write:!0};function d1(i){var s,o;const{project:e,user:t,editMode:n}=i,r=((o=(s=e==null?void 0:e.___settings)==null?void 0:s.permissions)==null?void 0:o[t])??Bo;return n&&(r!=null&&r.write)?!0:!n&&r.read}function u1(i){var o,a,l;const{project:e,user:t,editMode:n,view:r}=i,s=((l=(a=(o=e[r])==null?void 0:o.settings)==null?void 0:a.permissions)==null?void 0:l[t])??Bo;return n&&s.write?!0:!n&&s.read}function Nv(i){var a,l,c;const{project:e,user:t,editMode:n,view:r,wid:s}=i,o=((c=(l=(a=e[r])==null?void 0:a.widgets[s])==null?void 0:l.permissions)==null?void 0:c[t])??Bo;return n&&o.write?!0:!n&&o.read}function Mi(i,e){let t=i,n=!1,r=i.match(/(groupAttr\d+)+?/g);return r&&(n=!0,r.forEach(s=>{const o=e[s];o==null?t=t.replace(/groupAttr(\d+)/,""):t=t.replace(/groupAttr(\d+)/,e[s])})),r=i.match(/%([-_a-zA-Z\d]+)+?%/g),r&&(n=!0,r.forEach(s=>{const o=s.substring(1,s.length-1),a=e[o];a==null?t=t.replace(s,""):t=t.replace(s,a)})),{doesMatch:n,newString:t}}function tn(i,e,t){var o;const n=i[e].widgets,r=(o=n[t])==null?void 0:o.groupid;return r&&n[r]?i[e].widgets[t].groupid:Object.keys(n).find(a=>{var l,c;return(c=(l=n[a].data)==null?void 0:l.members)==null?void 0:c.includes(t)})}function $v(i){return!!i.match(/^[\d\w_]+:\s?[-.\d\w_#]+$/)}function oc(i){var n;const e=i.match(/{(.+?)}/g);let t=null;if(e){e.length>50&&console.warn(`Too many bindings in one widget: ${e.length}[max = 50]`);for(let r=0;r<e.length&&r<50;r++){const s=e[r].substring(1,e[r].length-1);if(s[0]==="{"||s&&s[0]==='"')continue;const o=s.split(";");t=t||[];let a=o[0].trim(),l=a,c=l.substring(l.length-4).trim(),u=l.substring(l.length-3).trim();l&&c!==".val"&&u!==".ts"&&u!==".lc"&&c!==".ack"&&(l+=".val");const p=u===".ts"||u===".lc";c=a.substring(a.length-4),u=a.substring(a.length-3),c===".val"||c===".ack"?a=a.substring(0,a.length-4):(u===".lc"||u===".ts")&&(a=a.substring(0,a.length-3));let d=null;if(l.match(/^[\d\w_]+:\s?[-._/ :!#$%&()+=@^{}|~\p{Ll}\p{Lu}\p{Nd}]+$/u)||!l.length&&o.length>0){const m=l.split(":",2),v=a.split(":",2);l=m[1].trim(),a=v[1].trim(),d=[],d.push({op:"eval",arg:[{name:m[0],visOid:l,systemOid:a}]});for(let g=1;g<o.length;g++){const x=o[g].trim();if($v(x)){const y=x.split(":",2);let w=y[1].trim(),S=w;c=w.substring(w.length-4),u=w.substring(w.length-3),c!==".val"&&u!==".ts"&&u!==".lc"&&c!==".ack"&&(w+=".val"),c=S.substring(S.length-4),c===".val"||c===".ack"?S=S.substring(0,S.length-4):(u=S.substring(S.length-3),(u===".lc"||u===".ts")&&(S=S.substring(0,S.length-3))),(n=d[0].arg)==null||n.push({name:y[0].trim(),visOid:w,systemOid:S})}else if(o[g]=o[g].replace(/::/g,":"),d[0].formula){const y=it(d[0]);y.formula=o[g],d.push(y)}else d[0].formula=o[g]}}else for(let m=1;m<o.length;m++){const v=o[m].match(/([\w\s/+*-]+)(\(.+\))?/);if(v&&v[1]){const g=v[1].trim();if(g==="*"||g==="+"||g==="-"||g==="/"||g==="%"||g==="min"||g==="max")if(v[2]===void 0)console.log(`Invalid format of format string: ${i}`);else{let x=(v[2]||"").trim().replace(",",".");x=x.substring(1,x.length-1).trim();const y=parseFloat(x);y.toString()==="NaN"?console.log(`Invalid format of format string: ${i}`):(d=d||[],d.push({op:g,arg:y}))}else if(g==="date"||g==="momentDate"){d=d||[];let x=(v[2]||"").trim();x=x.substring(1,x.length-1),d.push({op:g,arg:x})}else if(g==="array"){d=d||[];let x=(v[2]||"").trim();x=x.substring(1,x.length-1),d.push({op:g,arg:x.split(",")})}else if(g==="value"){d=d||[];let x=v[2]===void 0?"(2)":v[2]||"";x=x.trim(),x=x.substring(1,x.length-1),d.push({op:g,arg:x})}else if(g==="pow"||g==="round"||g==="random")if(v[2]===void 0)d=d||[],d.push({op:g});else{let x=(v[2]||"").trim().replace(",",".");x=x.substring(1,x.length-1);const y=parseFloat(x.trim());y.toString()==="NaN"?console.log(`Invalid format of format string: ${i}`):(d=d||[],d.push({op:g,arg:y}))}else if(g==="json"){d=d||[];let x=(v[2]||"").trim();x=x.substring(1,x.length-1),d.push({op:g,arg:x})}else d=d||[],d.push({op:g})}else console.log(`Invalid format ${i}`)}t.push({visOid:l,systemOid:a,token:e[r],operations:d||void 0,format:i,isSeconds:p})}}return t}function uo(i,e,t,n){var a;const r=it(i[e].widgets[t]);r.groupped&&(r.grouped=!0,delete r.groupped),r.widgetSet==="hqWidgets"&&(r.widgetSet="hqwidgets"),r.widgetSet==="RGraph"&&(r.widgetSet="rgraph"),r.widgetSet==="timeAndWeather"&&(r.widgetSet="timeandweather"),r.tpl==="tplShowValue"&&(r.tpl="tplHtml",r.data["visibility-oid"]=r.data.oid,r.data["visibility-val"]=r.data.value,delete r.data.oid,delete r.data.value),r.tpl==="tplHideTrue"&&(r.tpl="tplHtml",r.data["visibility-cond"]="!=",r.data["visibility-oid"]=r.data.oid,r.data["visibility-val"]=!0,delete r.data.oid),r.tpl==="tplHide"&&(r.tpl="tplHtml",r.data["visibility-cond"]="!=",r.data["visibility-oid"]=r.data.oid,r.data["visibility-val"]=!1,delete r.data.oid),r.tpl==="tplHmWindow"&&(r.tpl="tplValueBool",r.data.html_false=r.data.html_closed,r.data.html_true=r.data.html_open,delete r.data.html_closed,delete r.data.html_open),r.tpl==="tplHmWindowRotary"&&(r.tpl="tplValueListHtml8",r.data.count=2,r.data.value0=r.data.html_closed,r.data.value1=r.data.html_open,r.data.value2=r.data.html_tilt,delete r.data.html_closed,delete r.data.html_open,delete r.data.html_tilt),r.tpl==="tplBulbOnOff"&&(r.tpl="tplBulbOnOffCtrl",r.data.readOnly=!0),r.tpl==="tplValueFloatBarVertical"&&(r.tpl="tplValueFloatBar",r.data.orientation="vertical");let{data:s}=r;const{style:o}=r;if(r.grouped){if(r.groupid||_e.dispatch(pr({viewId:e,widgetId:t,data:{...r,groupid:tn(i,e,t)}})),r.groupid&&!_e.getState().visProject[e].widgets[r.groupid]&&(_e.dispatch(pr({viewId:e,widgetId:t,data:{...r,groupid:tn(i,e,t)}})),!r.groupid)){let l=1,c=`g${l.toString().padStart(5,"0")}`;for(;i[e].widgets[c];)l++,c=`g${l.toString().padStart(5,"0")}`;const u=it(i[e]);u.widgets[c]={tpl:"_tplGroup",data:{members:[t]},style:{top:"100px",left:"100px",width:"200px",height:"200px"},widgetSet:null},_e.dispatch(uu({viewId:e,data:u}))}if(r.groupid){const l=(a=i[e].widgets[r.groupid])==null?void 0:a.data;if(l){let c;Object.keys(s).forEach(u=>{if(typeof s[u]=="string"){const p=Mi(s[u],l);p.doesMatch&&(c=c||it(s),c[u]=p.newString||"")}}),c&&(s=c)}else console.error(`Invalid group id "${r.groupid}" in widget "${t}"`)}}Object.keys(s||{}).forEach(l=>{var c;if(l&&typeof s[l]=="string"){let u;const p=oc(s[l]);if(p)p.forEach(d=>{const f=d.systemOid;f&&(!n.IDs.includes(f)&&n.IDs.push(f),n.byViews&&!n.byViews[e].includes(f)&&n.byViews[e].push(f),n.bindings[f]=n.bindings[f]||[],d.type="data",d.attr=l,d.view=e,d.widget=t,n.bindings[f].push(d));const m=d.operations&&d.operations[0];if(m&&Array.isArray(m.arg))for(let v=0;v<m.arg.length;v++){const x=m.arg[v].systemOid;x&&(!n.IDs.includes(x)&&n.IDs.push(x),n.byViews&&!n.byViews[e].includes(x)&&n.byViews[e].push(x),n.bindings[x]=n.bindings[x]||[],n.bindings[x].includes(d)||n.bindings[x].push(d))}});else if(l!=="oidTrueValue"&&l!=="oidFalseValue"&&s[l]&&s[l]!=="nothing_selected"){let d=!!l.match(/oid\d{0,2}$/);if(l.startsWith("oid"))d=!0;else if(l.startsWith("signals-oid-"))d=!0;else if(n.widgetAttrInfo){const f=l.replace(/\d{0,2}$/,"");((c=n.widgetAttrInfo[f])==null?void 0:c.type)==="id"&&n.widgetAttrInfo[f].noSubscribe!==!0&&(d=!0)}if(d){if(s[l].startsWith('"')||(n.IDs.includes(s[l])||n.IDs.push(s[l]),n.byViews&&!n.byViews[e].includes(s[l])&&n.byViews[e].push(s[l])),l==="visibility-oid"){let f=s["visibility-oid"];if(r.grouped){const m=tn(i,e,t);if(m)if(i[e].widgets[m]){const v=Mi(f,i[e].widgets[m].data);v.doesMatch&&(f=v.newString)}else console.warn(`Invalid group: ${m} in ${e} / ${t}`)}n.visibility[f]=n.visibility[f]||[],n.visibility[f].push({view:e,widget:t})}else if(l.startsWith("signals-oid-")){let f=s[l];if(r.grouped){const m=tn(i,e,t);if(m){const v=Mi(f,i[e].widgets[m].data);v.doesMatch&&(f=v.newString)}}n.signals[f]=n.signals[f]||[],n.signals[f].push({view:e,widget:t,index:parseInt(l.substring(12),10)})}else if(l==="lc-oid"){let f=s[l];if(r.grouped){const m=tn(i,e,t);if(m){const v=Mi(f,i[e].widgets[m].data);v.doesMatch&&(f=v.newString)}}n.lastChanges[f]=n.lastChanges[f]||[],n.lastChanges[f].push({view:e,widget:t})}}else if(s[l]==="id"&&(u=l.match(/^attrType(\d+)$/),u)){const f=`groupAttr${u[1]}`;s[f]&&(n.IDs.includes(s[f])||n.IDs.push(s[f]),n.byViews&&!n.byViews[e].includes(s[f])&&n.byViews[e].push(s[f]))}}}}),o&&Object.keys(o).forEach(l=>{const c=o[l];if(l&&c&&typeof c=="string"){const u=oc(c);u&&u.forEach(p=>{const d=p.systemOid;d&&(!n.IDs.includes(d)&&n.IDs.push(d),n.byViews&&n.byViews[e].includes(d)&&n.byViews[e].push(d),n.bindings[d]=n.bindings[d]||[],p.type="style",p.attr=l,p.view=e,p.widget=t,n.bindings[d].push(p));const f=p.operations&&p.operations[0];if(f&&Array.isArray(f.arg))for(let m=0;m<f.arg.length;m++){const g=f.arg[m].systemOid;g&&(!n.IDs.includes(g)&&n.IDs.push(g),n.byViews&&!n.byViews[e].includes(g)&&n.byViews[e].push(g),n.bindings[g]=n.bindings[g]||[],n.bindings[g].includes||n.bindings[g].push(p))}})}}),_e.dispatch(pr({viewId:e,widgetId:t,data:r}))}function p1(i){const e=window.location.search.substring(1).split("&");for(let t=0;t<e.length;t++){const n=e[t].split("=");if(n[0]===i)return typeof n[1]>"u"?!0:decodeURIComponent(n[1])}return""}async function h1(i,e,t,n){const r=await i.readFile(e,t);let s="",o="";return typeof r=="object"?(n&&(s=r.mimeType?r.mimeType:r.type?r.type:""),o=r.file||r.data):o=r,n?{file:o,mimeType:s}:o}function _t(i,e){if(i){const t=i.split(" ").map(n=>n.trim()).filter(n=>n);return e&&!t.includes(e)&&t.push(e),t.join(" ")}return e||""}function nn(i,e){if(i){const t=i.split(" ").map(r=>r.trim()).filter(r=>r),n=t.indexOf(e);return n!==-1&&t.splice(n,1),t.join(" ")}return""}function ht(i){const e={value:0,dimension:"px"};if(!i)return e;const t=i.toString().match(/^([0-9-.]+)([a-z%]*)$/);return t&&(e.value=parseInt(t[1]),e.dimension=t[2]||"px"),e}function Wv(i,e,t,n){if(e)return n=n||[],Object.keys(i[e].widgets).forEach(s=>{if(s===t)return;const o=i[e].widgets[s];Object.keys(o.data).forEach(l=>{l.startsWith("widget")&&o.data[l]===t&&n.push({view:e,wid:s,attr:l})})}),n;const r=[];return Object.keys(i).forEach(s=>s!=="___settings"&&Wv(i,s,t,n)),r}function f1(i,e,t){i||=window.location.pathname.includes("edit.html")?"Editor.vis":"ioBroker.vis",e||=window.location.pathname.includes("edit.html")?"./faviconEdit.ico":"./favicon.ico",window.document.title=i,e.startsWith("../")?e=e.substring(3):e.startsWith("_PRJ_NAME/")&&(e=e.replace("_PRJ_NAME/",`../${t.adapterName}.${t.instance}/${t.projectName}/`));const n=window.document.querySelector('link[rel="icon"]');if(n)n.setAttribute("href",e);else{const l=window.document.createElement("link");l.setAttribute("rel","icon"),l.setAttribute("href",e),window.document.head.appendChild(l)}const r={short_name:i,name:i,icons:[{src:e,sizes:"64x64 32x32 24x24 16x16",type:"image/x-icon"}],start_url:".",display:"standalone",theme_color:t.themeType==="dark"?"rgb(51, 51, 51)":"rgb(230, 230, 230)",background_color:t.themeType==="dark"?"#000":"#FFF"},s=JSON.stringify(r),o=new Blob([s],{type:"application/json"}),a=URL.createObjectURL(o);document.querySelector("#vis-manifest").setAttribute("href",a)}const Zn={backgroundClass:{display:"flex",alignItems:"center"},backgroundClassSquare:{width:40,height:40,display:"inline-block",marginRight:4},selected:i=>({backgroundColor:i.palette.primary.main,color:i.palette.primary.contrastText}),clearPadding:{p:0,mt:0,mb:0,ml:0,mr:0,minHeight:"initial"},fieldContent:{fontSize:"80%","& svg":{fontSize:"1rem"}},fieldContentColor:{"& label":{display:"none"},"& input":{fontSize:"80%"}},fieldContentSlider:{display:"inline",width:"calc(100% - 50px)",marginRight:8},fieldContentSliderInput:{display:"inline",width:50},menuItem:{cursor:"pointer"},listFolder:{backgroundColor:"inherit",lineHeight:"36px"},iconFolder:{verticalAlign:"middle",marginRight:6,marginTop:-3,fontSize:20,color:"#00dc00"},iconPreview:{}};function bi(i,e,t,n){function r(s){return s instanceof t?s:new t(function(o){o(s)})}return new(t||(t=Promise))(function(s,o){function a(u){try{c(n.next(u))}catch(p){o(p)}}function l(u){try{c(n.throw(u))}catch(p){o(p)}}function c(u){u.done?s(u.value):r(u.value).then(a,l)}c((n=n.apply(i,e||[])).next())})}const Fv=new Map([["1km","application/vnd.1000minds.decision-model+xml"],["3dml","text/vnd.in3d.3dml"],["3ds","image/x-3ds"],["3g2","video/3gpp2"],["3gp","video/3gp"],["3gpp","video/3gpp"],["3mf","model/3mf"],["7z","application/x-7z-compressed"],["7zip","application/x-7z-compressed"],["123","application/vnd.lotus-1-2-3"],["aab","application/x-authorware-bin"],["aac","audio/x-acc"],["aam","application/x-authorware-map"],["aas","application/x-authorware-seg"],["abw","application/x-abiword"],["ac","application/vnd.nokia.n-gage.ac+xml"],["ac3","audio/ac3"],["acc","application/vnd.americandynamics.acc"],["ace","application/x-ace-compressed"],["acu","application/vnd.acucobol"],["acutc","application/vnd.acucorp"],["adp","audio/adpcm"],["aep","application/vnd.audiograph"],["afm","application/x-font-type1"],["afp","application/vnd.ibm.modcap"],["ahead","application/vnd.ahead.space"],["ai","application/pdf"],["aif","audio/x-aiff"],["aifc","audio/x-aiff"],["aiff","audio/x-aiff"],["air","application/vnd.adobe.air-application-installer-package+zip"],["ait","application/vnd.dvb.ait"],["ami","application/vnd.amiga.ami"],["amr","audio/amr"],["apk","application/vnd.android.package-archive"],["apng","image/apng"],["appcache","text/cache-manifest"],["application","application/x-ms-application"],["apr","application/vnd.lotus-approach"],["arc","application/x-freearc"],["arj","application/x-arj"],["asc","application/pgp-signature"],["asf","video/x-ms-asf"],["asm","text/x-asm"],["aso","application/vnd.accpac.simply.aso"],["asx","video/x-ms-asf"],["atc","application/vnd.acucorp"],["atom","application/atom+xml"],["atomcat","application/atomcat+xml"],["atomdeleted","application/atomdeleted+xml"],["atomsvc","application/atomsvc+xml"],["atx","application/vnd.antix.game-component"],["au","audio/x-au"],["avi","video/x-msvideo"],["avif","image/avif"],["aw","application/applixware"],["azf","application/vnd.airzip.filesecure.azf"],["azs","application/vnd.airzip.filesecure.azs"],["azv","image/vnd.airzip.accelerator.azv"],["azw","application/vnd.amazon.ebook"],["b16","image/vnd.pco.b16"],["bat","application/x-msdownload"],["bcpio","application/x-bcpio"],["bdf","application/x-font-bdf"],["bdm","application/vnd.syncml.dm+wbxml"],["bdoc","application/x-bdoc"],["bed","application/vnd.realvnc.bed"],["bh2","application/vnd.fujitsu.oasysprs"],["bin","application/octet-stream"],["blb","application/x-blorb"],["blorb","application/x-blorb"],["bmi","application/vnd.bmi"],["bmml","application/vnd.balsamiq.bmml+xml"],["bmp","image/bmp"],["book","application/vnd.framemaker"],["box","application/vnd.previewsystems.box"],["boz","application/x-bzip2"],["bpk","application/octet-stream"],["bpmn","application/octet-stream"],["bsp","model/vnd.valve.source.compiled-map"],["btif","image/prs.btif"],["buffer","application/octet-stream"],["bz","application/x-bzip"],["bz2","application/x-bzip2"],["c","text/x-c"],["c4d","application/vnd.clonk.c4group"],["c4f","application/vnd.clonk.c4group"],["c4g","application/vnd.clonk.c4group"],["c4p","application/vnd.clonk.c4group"],["c4u","application/vnd.clonk.c4group"],["c11amc","application/vnd.cluetrust.cartomobile-config"],["c11amz","application/vnd.cluetrust.cartomobile-config-pkg"],["cab","application/vnd.ms-cab-compressed"],["caf","audio/x-caf"],["cap","application/vnd.tcpdump.pcap"],["car","application/vnd.curl.car"],["cat","application/vnd.ms-pki.seccat"],["cb7","application/x-cbr"],["cba","application/x-cbr"],["cbr","application/x-cbr"],["cbt","application/x-cbr"],["cbz","application/x-cbr"],["cc","text/x-c"],["cco","application/x-cocoa"],["cct","application/x-director"],["ccxml","application/ccxml+xml"],["cdbcmsg","application/vnd.contact.cmsg"],["cda","application/x-cdf"],["cdf","application/x-netcdf"],["cdfx","application/cdfx+xml"],["cdkey","application/vnd.mediastation.cdkey"],["cdmia","application/cdmi-capability"],["cdmic","application/cdmi-container"],["cdmid","application/cdmi-domain"],["cdmio","application/cdmi-object"],["cdmiq","application/cdmi-queue"],["cdr","application/cdr"],["cdx","chemical/x-cdx"],["cdxml","application/vnd.chemdraw+xml"],["cdy","application/vnd.cinderella"],["cer","application/pkix-cert"],["cfs","application/x-cfs-compressed"],["cgm","image/cgm"],["chat","application/x-chat"],["chm","application/vnd.ms-htmlhelp"],["chrt","application/vnd.kde.kchart"],["cif","chemical/x-cif"],["cii","application/vnd.anser-web-certificate-issue-initiation"],["cil","application/vnd.ms-artgalry"],["cjs","application/node"],["cla","application/vnd.claymore"],["class","application/octet-stream"],["clkk","application/vnd.crick.clicker.keyboard"],["clkp","application/vnd.crick.clicker.palette"],["clkt","application/vnd.crick.clicker.template"],["clkw","application/vnd.crick.clicker.wordbank"],["clkx","application/vnd.crick.clicker"],["clp","application/x-msclip"],["cmc","application/vnd.cosmocaller"],["cmdf","chemical/x-cmdf"],["cml","chemical/x-cml"],["cmp","application/vnd.yellowriver-custom-menu"],["cmx","image/x-cmx"],["cod","application/vnd.rim.cod"],["coffee","text/coffeescript"],["com","application/x-msdownload"],["conf","text/plain"],["cpio","application/x-cpio"],["cpp","text/x-c"],["cpt","application/mac-compactpro"],["crd","application/x-mscardfile"],["crl","application/pkix-crl"],["crt","application/x-x509-ca-cert"],["crx","application/x-chrome-extension"],["cryptonote","application/vnd.rig.cryptonote"],["csh","application/x-csh"],["csl","application/vnd.citationstyles.style+xml"],["csml","chemical/x-csml"],["csp","application/vnd.commonspace"],["csr","application/octet-stream"],["css","text/css"],["cst","application/x-director"],["csv","text/csv"],["cu","application/cu-seeme"],["curl","text/vnd.curl"],["cww","application/prs.cww"],["cxt","application/x-director"],["cxx","text/x-c"],["dae","model/vnd.collada+xml"],["daf","application/vnd.mobius.daf"],["dart","application/vnd.dart"],["dataless","application/vnd.fdsn.seed"],["davmount","application/davmount+xml"],["dbf","application/vnd.dbf"],["dbk","application/docbook+xml"],["dcr","application/x-director"],["dcurl","text/vnd.curl.dcurl"],["dd2","application/vnd.oma.dd2+xml"],["ddd","application/vnd.fujixerox.ddd"],["ddf","application/vnd.syncml.dmddf+xml"],["dds","image/vnd.ms-dds"],["deb","application/x-debian-package"],["def","text/plain"],["deploy","application/octet-stream"],["der","application/x-x509-ca-cert"],["dfac","application/vnd.dreamfactory"],["dgc","application/x-dgc-compressed"],["dic","text/x-c"],["dir","application/x-director"],["dis","application/vnd.mobius.dis"],["disposition-notification","message/disposition-notification"],["dist","application/octet-stream"],["distz","application/octet-stream"],["djv","image/vnd.djvu"],["djvu","image/vnd.djvu"],["dll","application/octet-stream"],["dmg","application/x-apple-diskimage"],["dmn","application/octet-stream"],["dmp","application/vnd.tcpdump.pcap"],["dms","application/octet-stream"],["dna","application/vnd.dna"],["doc","application/msword"],["docm","application/vnd.ms-word.template.macroEnabled.12"],["docx","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],["dot","application/msword"],["dotm","application/vnd.ms-word.template.macroEnabled.12"],["dotx","application/vnd.openxmlformats-officedocument.wordprocessingml.template"],["dp","application/vnd.osgi.dp"],["dpg","application/vnd.dpgraph"],["dra","audio/vnd.dra"],["drle","image/dicom-rle"],["dsc","text/prs.lines.tag"],["dssc","application/dssc+der"],["dtb","application/x-dtbook+xml"],["dtd","application/xml-dtd"],["dts","audio/vnd.dts"],["dtshd","audio/vnd.dts.hd"],["dump","application/octet-stream"],["dvb","video/vnd.dvb.file"],["dvi","application/x-dvi"],["dwd","application/atsc-dwd+xml"],["dwf","model/vnd.dwf"],["dwg","image/vnd.dwg"],["dxf","image/vnd.dxf"],["dxp","application/vnd.spotfire.dxp"],["dxr","application/x-director"],["ear","application/java-archive"],["ecelp4800","audio/vnd.nuera.ecelp4800"],["ecelp7470","audio/vnd.nuera.ecelp7470"],["ecelp9600","audio/vnd.nuera.ecelp9600"],["ecma","application/ecmascript"],["edm","application/vnd.novadigm.edm"],["edx","application/vnd.novadigm.edx"],["efif","application/vnd.picsel"],["ei6","application/vnd.pg.osasli"],["elc","application/octet-stream"],["emf","image/emf"],["eml","message/rfc822"],["emma","application/emma+xml"],["emotionml","application/emotionml+xml"],["emz","application/x-msmetafile"],["eol","audio/vnd.digital-winds"],["eot","application/vnd.ms-fontobject"],["eps","application/postscript"],["epub","application/epub+zip"],["es","application/ecmascript"],["es3","application/vnd.eszigno3+xml"],["esa","application/vnd.osgi.subsystem"],["esf","application/vnd.epson.esf"],["et3","application/vnd.eszigno3+xml"],["etx","text/x-setext"],["eva","application/x-eva"],["evy","application/x-envoy"],["exe","application/octet-stream"],["exi","application/exi"],["exp","application/express"],["exr","image/aces"],["ext","application/vnd.novadigm.ext"],["ez","application/andrew-inset"],["ez2","application/vnd.ezpix-album"],["ez3","application/vnd.ezpix-package"],["f","text/x-fortran"],["f4v","video/mp4"],["f77","text/x-fortran"],["f90","text/x-fortran"],["fbs","image/vnd.fastbidsheet"],["fcdt","application/vnd.adobe.formscentral.fcdt"],["fcs","application/vnd.isac.fcs"],["fdf","application/vnd.fdf"],["fdt","application/fdt+xml"],["fe_launch","application/vnd.denovo.fcselayout-link"],["fg5","application/vnd.fujitsu.oasysgp"],["fgd","application/x-director"],["fh","image/x-freehand"],["fh4","image/x-freehand"],["fh5","image/x-freehand"],["fh7","image/x-freehand"],["fhc","image/x-freehand"],["fig","application/x-xfig"],["fits","image/fits"],["flac","audio/x-flac"],["fli","video/x-fli"],["flo","application/vnd.micrografx.flo"],["flv","video/x-flv"],["flw","application/vnd.kde.kivio"],["flx","text/vnd.fmi.flexstor"],["fly","text/vnd.fly"],["fm","application/vnd.framemaker"],["fnc","application/vnd.frogans.fnc"],["fo","application/vnd.software602.filler.form+xml"],["for","text/x-fortran"],["fpx","image/vnd.fpx"],["frame","application/vnd.framemaker"],["fsc","application/vnd.fsc.weblaunch"],["fst","image/vnd.fst"],["ftc","application/vnd.fluxtime.clip"],["fti","application/vnd.anser-web-funds-transfer-initiation"],["fvt","video/vnd.fvt"],["fxp","application/vnd.adobe.fxp"],["fxpl","application/vnd.adobe.fxp"],["fzs","application/vnd.fuzzysheet"],["g2w","application/vnd.geoplan"],["g3","image/g3fax"],["g3w","application/vnd.geospace"],["gac","application/vnd.groove-account"],["gam","application/x-tads"],["gbr","application/rpki-ghostbusters"],["gca","application/x-gca-compressed"],["gdl","model/vnd.gdl"],["gdoc","application/vnd.google-apps.document"],["geo","application/vnd.dynageo"],["geojson","application/geo+json"],["gex","application/vnd.geometry-explorer"],["ggb","application/vnd.geogebra.file"],["ggt","application/vnd.geogebra.tool"],["ghf","application/vnd.groove-help"],["gif","image/gif"],["gim","application/vnd.groove-identity-message"],["glb","model/gltf-binary"],["gltf","model/gltf+json"],["gml","application/gml+xml"],["gmx","application/vnd.gmx"],["gnumeric","application/x-gnumeric"],["gpg","application/gpg-keys"],["gph","application/vnd.flographit"],["gpx","application/gpx+xml"],["gqf","application/vnd.grafeq"],["gqs","application/vnd.grafeq"],["gram","application/srgs"],["gramps","application/x-gramps-xml"],["gre","application/vnd.geometry-explorer"],["grv","application/vnd.groove-injector"],["grxml","application/srgs+xml"],["gsf","application/x-font-ghostscript"],["gsheet","application/vnd.google-apps.spreadsheet"],["gslides","application/vnd.google-apps.presentation"],["gtar","application/x-gtar"],["gtm","application/vnd.groove-tool-message"],["gtw","model/vnd.gtw"],["gv","text/vnd.graphviz"],["gxf","application/gxf"],["gxt","application/vnd.geonext"],["gz","application/gzip"],["gzip","application/gzip"],["h","text/x-c"],["h261","video/h261"],["h263","video/h263"],["h264","video/h264"],["hal","application/vnd.hal+xml"],["hbci","application/vnd.hbci"],["hbs","text/x-handlebars-template"],["hdd","application/x-virtualbox-hdd"],["hdf","application/x-hdf"],["heic","image/heic"],["heics","image/heic-sequence"],["heif","image/heif"],["heifs","image/heif-sequence"],["hej2","image/hej2k"],["held","application/atsc-held+xml"],["hh","text/x-c"],["hjson","application/hjson"],["hlp","application/winhlp"],["hpgl","application/vnd.hp-hpgl"],["hpid","application/vnd.hp-hpid"],["hps","application/vnd.hp-hps"],["hqx","application/mac-binhex40"],["hsj2","image/hsj2"],["htc","text/x-component"],["htke","application/vnd.kenameaapp"],["htm","text/html"],["html","text/html"],["hvd","application/vnd.yamaha.hv-dic"],["hvp","application/vnd.yamaha.hv-voice"],["hvs","application/vnd.yamaha.hv-script"],["i2g","application/vnd.intergeo"],["icc","application/vnd.iccprofile"],["ice","x-conference/x-cooltalk"],["icm","application/vnd.iccprofile"],["ico","image/x-icon"],["ics","text/calendar"],["ief","image/ief"],["ifb","text/calendar"],["ifm","application/vnd.shana.informed.formdata"],["iges","model/iges"],["igl","application/vnd.igloader"],["igm","application/vnd.insors.igm"],["igs","model/iges"],["igx","application/vnd.micrografx.igx"],["iif","application/vnd.shana.informed.interchange"],["img","application/octet-stream"],["imp","application/vnd.accpac.simply.imp"],["ims","application/vnd.ms-ims"],["in","text/plain"],["ini","text/plain"],["ink","application/inkml+xml"],["inkml","application/inkml+xml"],["install","application/x-install-instructions"],["iota","application/vnd.astraea-software.iota"],["ipfix","application/ipfix"],["ipk","application/vnd.shana.informed.package"],["irm","application/vnd.ibm.rights-management"],["irp","application/vnd.irepository.package+xml"],["iso","application/x-iso9660-image"],["itp","application/vnd.shana.informed.formtemplate"],["its","application/its+xml"],["ivp","application/vnd.immervision-ivp"],["ivu","application/vnd.immervision-ivu"],["jad","text/vnd.sun.j2me.app-descriptor"],["jade","text/jade"],["jam","application/vnd.jam"],["jar","application/java-archive"],["jardiff","application/x-java-archive-diff"],["java","text/x-java-source"],["jhc","image/jphc"],["jisp","application/vnd.jisp"],["jls","image/jls"],["jlt","application/vnd.hp-jlyt"],["jng","image/x-jng"],["jnlp","application/x-java-jnlp-file"],["joda","application/vnd.joost.joda-archive"],["jp2","image/jp2"],["jpe","image/jpeg"],["jpeg","image/jpeg"],["jpf","image/jpx"],["jpg","image/jpeg"],["jpg2","image/jp2"],["jpgm","video/jpm"],["jpgv","video/jpeg"],["jph","image/jph"],["jpm","video/jpm"],["jpx","image/jpx"],["js","application/javascript"],["json","application/json"],["json5","application/json5"],["jsonld","application/ld+json"],["jsonl","application/jsonl"],["jsonml","application/jsonml+json"],["jsx","text/jsx"],["jxr","image/jxr"],["jxra","image/jxra"],["jxrs","image/jxrs"],["jxs","image/jxs"],["jxsc","image/jxsc"],["jxsi","image/jxsi"],["jxss","image/jxss"],["kar","audio/midi"],["karbon","application/vnd.kde.karbon"],["kdb","application/octet-stream"],["kdbx","application/x-keepass2"],["key","application/x-iwork-keynote-sffkey"],["kfo","application/vnd.kde.kformula"],["kia","application/vnd.kidspiration"],["kml","application/vnd.google-earth.kml+xml"],["kmz","application/vnd.google-earth.kmz"],["kne","application/vnd.kinar"],["knp","application/vnd.kinar"],["kon","application/vnd.kde.kontour"],["kpr","application/vnd.kde.kpresenter"],["kpt","application/vnd.kde.kpresenter"],["kpxx","application/vnd.ds-keypoint"],["ksp","application/vnd.kde.kspread"],["ktr","application/vnd.kahootz"],["ktx","image/ktx"],["ktx2","image/ktx2"],["ktz","application/vnd.kahootz"],["kwd","application/vnd.kde.kword"],["kwt","application/vnd.kde.kword"],["lasxml","application/vnd.las.las+xml"],["latex","application/x-latex"],["lbd","application/vnd.llamagraphics.life-balance.desktop"],["lbe","application/vnd.llamagraphics.life-balance.exchange+xml"],["les","application/vnd.hhe.lesson-player"],["less","text/less"],["lgr","application/lgr+xml"],["lha","application/octet-stream"],["link66","application/vnd.route66.link66+xml"],["list","text/plain"],["list3820","application/vnd.ibm.modcap"],["listafp","application/vnd.ibm.modcap"],["litcoffee","text/coffeescript"],["lnk","application/x-ms-shortcut"],["log","text/plain"],["lostxml","application/lost+xml"],["lrf","application/octet-stream"],["lrm","application/vnd.ms-lrm"],["ltf","application/vnd.frogans.ltf"],["lua","text/x-lua"],["luac","application/x-lua-bytecode"],["lvp","audio/vnd.lucent.voice"],["lwp","application/vnd.lotus-wordpro"],["lzh","application/octet-stream"],["m1v","video/mpeg"],["m2a","audio/mpeg"],["m2v","video/mpeg"],["m3a","audio/mpeg"],["m3u","text/plain"],["m3u8","application/vnd.apple.mpegurl"],["m4a","audio/x-m4a"],["m4p","application/mp4"],["m4s","video/iso.segment"],["m4u","application/vnd.mpegurl"],["m4v","video/x-m4v"],["m13","application/x-msmediaview"],["m14","application/x-msmediaview"],["m21","application/mp21"],["ma","application/mathematica"],["mads","application/mads+xml"],["maei","application/mmt-aei+xml"],["mag","application/vnd.ecowin.chart"],["maker","application/vnd.framemaker"],["man","text/troff"],["manifest","text/cache-manifest"],["map","application/json"],["mar","application/octet-stream"],["markdown","text/markdown"],["mathml","application/mathml+xml"],["mb","application/mathematica"],["mbk","application/vnd.mobius.mbk"],["mbox","application/mbox"],["mc1","application/vnd.medcalcdata"],["mcd","application/vnd.mcd"],["mcurl","text/vnd.curl.mcurl"],["md","text/markdown"],["mdb","application/x-msaccess"],["mdi","image/vnd.ms-modi"],["mdx","text/mdx"],["me","text/troff"],["mesh","model/mesh"],["meta4","application/metalink4+xml"],["metalink","application/metalink+xml"],["mets","application/mets+xml"],["mfm","application/vnd.mfmp"],["mft","application/rpki-manifest"],["mgp","application/vnd.osgeo.mapguide.package"],["mgz","application/vnd.proteus.magazine"],["mid","audio/midi"],["midi","audio/midi"],["mie","application/x-mie"],["mif","application/vnd.mif"],["mime","message/rfc822"],["mj2","video/mj2"],["mjp2","video/mj2"],["mjs","application/javascript"],["mk3d","video/x-matroska"],["mka","audio/x-matroska"],["mkd","text/x-markdown"],["mks","video/x-matroska"],["mkv","video/x-matroska"],["mlp","application/vnd.dolby.mlp"],["mmd","application/vnd.chipnuts.karaoke-mmd"],["mmf","application/vnd.smaf"],["mml","text/mathml"],["mmr","image/vnd.fujixerox.edmics-mmr"],["mng","video/x-mng"],["mny","application/x-msmoney"],["mobi","application/x-mobipocket-ebook"],["mods","application/mods+xml"],["mov","video/quicktime"],["movie","video/x-sgi-movie"],["mp2","audio/mpeg"],["mp2a","audio/mpeg"],["mp3","audio/mpeg"],["mp4","video/mp4"],["mp4a","audio/mp4"],["mp4s","application/mp4"],["mp4v","video/mp4"],["mp21","application/mp21"],["mpc","application/vnd.mophun.certificate"],["mpd","application/dash+xml"],["mpe","video/mpeg"],["mpeg","video/mpeg"],["mpg","video/mpeg"],["mpg4","video/mp4"],["mpga","audio/mpeg"],["mpkg","application/vnd.apple.installer+xml"],["mpm","application/vnd.blueice.multipass"],["mpn","application/vnd.mophun.application"],["mpp","application/vnd.ms-project"],["mpt","application/vnd.ms-project"],["mpy","application/vnd.ibm.minipay"],["mqy","application/vnd.mobius.mqy"],["mrc","application/marc"],["mrcx","application/marcxml+xml"],["ms","text/troff"],["mscml","application/mediaservercontrol+xml"],["mseed","application/vnd.fdsn.mseed"],["mseq","application/vnd.mseq"],["msf","application/vnd.epson.msf"],["msg","application/vnd.ms-outlook"],["msh","model/mesh"],["msi","application/x-msdownload"],["msl","application/vnd.mobius.msl"],["msm","application/octet-stream"],["msp","application/octet-stream"],["msty","application/vnd.muvee.style"],["mtl","model/mtl"],["mts","model/vnd.mts"],["mus","application/vnd.musician"],["musd","application/mmt-usd+xml"],["musicxml","application/vnd.recordare.musicxml+xml"],["mvb","application/x-msmediaview"],["mvt","application/vnd.mapbox-vector-tile"],["mwf","application/vnd.mfer"],["mxf","application/mxf"],["mxl","application/vnd.recordare.musicxml"],["mxmf","audio/mobile-xmf"],["mxml","application/xv+xml"],["mxs","application/vnd.triscape.mxs"],["mxu","video/vnd.mpegurl"],["n-gage","application/vnd.nokia.n-gage.symbian.install"],["n3","text/n3"],["nb","application/mathematica"],["nbp","application/vnd.wolfram.player"],["nc","application/x-netcdf"],["ncx","application/x-dtbncx+xml"],["nfo","text/x-nfo"],["ngdat","application/vnd.nokia.n-gage.data"],["nitf","application/vnd.nitf"],["nlu","application/vnd.neurolanguage.nlu"],["nml","application/vnd.enliven"],["nnd","application/vnd.noblenet-directory"],["nns","application/vnd.noblenet-sealer"],["nnw","application/vnd.noblenet-web"],["npx","image/vnd.net-fpx"],["nq","application/n-quads"],["nsc","application/x-conference"],["nsf","application/vnd.lotus-notes"],["nt","application/n-triples"],["ntf","application/vnd.nitf"],["numbers","application/x-iwork-numbers-sffnumbers"],["nzb","application/x-nzb"],["oa2","application/vnd.fujitsu.oasys2"],["oa3","application/vnd.fujitsu.oasys3"],["oas","application/vnd.fujitsu.oasys"],["obd","application/x-msbinder"],["obgx","application/vnd.openblox.game+xml"],["obj","model/obj"],["oda","application/oda"],["odb","application/vnd.oasis.opendocument.database"],["odc","application/vnd.oasis.opendocument.chart"],["odf","application/vnd.oasis.opendocument.formula"],["odft","application/vnd.oasis.opendocument.formula-template"],["odg","application/vnd.oasis.opendocument.graphics"],["odi","application/vnd.oasis.opendocument.image"],["odm","application/vnd.oasis.opendocument.text-master"],["odp","application/vnd.oasis.opendocument.presentation"],["ods","application/vnd.oasis.opendocument.spreadsheet"],["odt","application/vnd.oasis.opendocument.text"],["oga","audio/ogg"],["ogex","model/vnd.opengex"],["ogg","audio/ogg"],["ogv","video/ogg"],["ogx","application/ogg"],["omdoc","application/omdoc+xml"],["onepkg","application/onenote"],["onetmp","application/onenote"],["onetoc","application/onenote"],["onetoc2","application/onenote"],["opf","application/oebps-package+xml"],["opml","text/x-opml"],["oprc","application/vnd.palm"],["opus","audio/ogg"],["org","text/x-org"],["osf","application/vnd.yamaha.openscoreformat"],["osfpvg","application/vnd.yamaha.openscoreformat.osfpvg+xml"],["osm","application/vnd.openstreetmap.data+xml"],["otc","application/vnd.oasis.opendocument.chart-template"],["otf","font/otf"],["otg","application/vnd.oasis.opendocument.graphics-template"],["oth","application/vnd.oasis.opendocument.text-web"],["oti","application/vnd.oasis.opendocument.image-template"],["otp","application/vnd.oasis.opendocument.presentation-template"],["ots","application/vnd.oasis.opendocument.spreadsheet-template"],["ott","application/vnd.oasis.opendocument.text-template"],["ova","application/x-virtualbox-ova"],["ovf","application/x-virtualbox-ovf"],["owl","application/rdf+xml"],["oxps","application/oxps"],["oxt","application/vnd.openofficeorg.extension"],["p","text/x-pascal"],["p7a","application/x-pkcs7-signature"],["p7b","application/x-pkcs7-certificates"],["p7c","application/pkcs7-mime"],["p7m","application/pkcs7-mime"],["p7r","application/x-pkcs7-certreqresp"],["p7s","application/pkcs7-signature"],["p8","application/pkcs8"],["p10","application/x-pkcs10"],["p12","application/x-pkcs12"],["pac","application/x-ns-proxy-autoconfig"],["pages","application/x-iwork-pages-sffpages"],["pas","text/x-pascal"],["paw","application/vnd.pawaafile"],["pbd","application/vnd.powerbuilder6"],["pbm","image/x-portable-bitmap"],["pcap","application/vnd.tcpdump.pcap"],["pcf","application/x-font-pcf"],["pcl","application/vnd.hp-pcl"],["pclxl","application/vnd.hp-pclxl"],["pct","image/x-pict"],["pcurl","application/vnd.curl.pcurl"],["pcx","image/x-pcx"],["pdb","application/x-pilot"],["pde","text/x-processing"],["pdf","application/pdf"],["pem","application/x-x509-user-cert"],["pfa","application/x-font-type1"],["pfb","application/x-font-type1"],["pfm","application/x-font-type1"],["pfr","application/font-tdpfr"],["pfx","application/x-pkcs12"],["pgm","image/x-portable-graymap"],["pgn","application/x-chess-pgn"],["pgp","application/pgp"],["php","application/x-httpd-php"],["php3","application/x-httpd-php"],["php4","application/x-httpd-php"],["phps","application/x-httpd-php-source"],["phtml","application/x-httpd-php"],["pic","image/x-pict"],["pkg","application/octet-stream"],["pki","application/pkixcmp"],["pkipath","application/pkix-pkipath"],["pkpass","application/vnd.apple.pkpass"],["pl","application/x-perl"],["plb","application/vnd.3gpp.pic-bw-large"],["plc","application/vnd.mobius.plc"],["plf","application/vnd.pocketlearn"],["pls","application/pls+xml"],["pm","application/x-perl"],["pml","application/vnd.ctc-posml"],["png","image/png"],["pnm","image/x-portable-anymap"],["portpkg","application/vnd.macports.portpkg"],["pot","application/vnd.ms-powerpoint"],["potm","application/vnd.ms-powerpoint.presentation.macroEnabled.12"],["potx","application/vnd.openxmlformats-officedocument.presentationml.template"],["ppa","application/vnd.ms-powerpoint"],["ppam","application/vnd.ms-powerpoint.addin.macroEnabled.12"],["ppd","application/vnd.cups-ppd"],["ppm","image/x-portable-pixmap"],["pps","application/vnd.ms-powerpoint"],["ppsm","application/vnd.ms-powerpoint.slideshow.macroEnabled.12"],["ppsx","application/vnd.openxmlformats-officedocument.presentationml.slideshow"],["ppt","application/powerpoint"],["pptm","application/vnd.ms-powerpoint.presentation.macroEnabled.12"],["pptx","application/vnd.openxmlformats-officedocument.presentationml.presentation"],["pqa","application/vnd.palm"],["prc","application/x-pilot"],["pre","application/vnd.lotus-freelance"],["prf","application/pics-rules"],["provx","application/provenance+xml"],["ps","application/postscript"],["psb","application/vnd.3gpp.pic-bw-small"],["psd","application/x-photoshop"],["psf","application/x-font-linux-psf"],["pskcxml","application/pskc+xml"],["pti","image/prs.pti"],["ptid","application/vnd.pvi.ptid1"],["pub","application/x-mspublisher"],["pvb","application/vnd.3gpp.pic-bw-var"],["pwn","application/vnd.3m.post-it-notes"],["pya","audio/vnd.ms-playready.media.pya"],["pyv","video/vnd.ms-playready.media.pyv"],["qam","application/vnd.epson.quickanime"],["qbo","application/vnd.intu.qbo"],["qfx","application/vnd.intu.qfx"],["qps","application/vnd.publishare-delta-tree"],["qt","video/quicktime"],["qwd","application/vnd.quark.quarkxpress"],["qwt","application/vnd.quark.quarkxpress"],["qxb","application/vnd.quark.quarkxpress"],["qxd","application/vnd.quark.quarkxpress"],["qxl","application/vnd.quark.quarkxpress"],["qxt","application/vnd.quark.quarkxpress"],["ra","audio/x-realaudio"],["ram","audio/x-pn-realaudio"],["raml","application/raml+yaml"],["rapd","application/route-apd+xml"],["rar","application/x-rar"],["ras","image/x-cmu-raster"],["rcprofile","application/vnd.ipunplugged.rcprofile"],["rdf","application/rdf+xml"],["rdz","application/vnd.data-vision.rdz"],["relo","application/p2p-overlay+xml"],["rep","application/vnd.businessobjects"],["res","application/x-dtbresource+xml"],["rgb","image/x-rgb"],["rif","application/reginfo+xml"],["rip","audio/vnd.rip"],["ris","application/x-research-info-systems"],["rl","application/resource-lists+xml"],["rlc","image/vnd.fujixerox.edmics-rlc"],["rld","application/resource-lists-diff+xml"],["rm","audio/x-pn-realaudio"],["rmi","audio/midi"],["rmp","audio/x-pn-realaudio-plugin"],["rms","application/vnd.jcp.javame.midlet-rms"],["rmvb","application/vnd.rn-realmedia-vbr"],["rnc","application/relax-ng-compact-syntax"],["rng","application/xml"],["roa","application/rpki-roa"],["roff","text/troff"],["rp9","application/vnd.cloanto.rp9"],["rpm","audio/x-pn-realaudio-plugin"],["rpss","application/vnd.nokia.radio-presets"],["rpst","application/vnd.nokia.radio-preset"],["rq","application/sparql-query"],["rs","application/rls-services+xml"],["rsa","application/x-pkcs7"],["rsat","application/atsc-rsat+xml"],["rsd","application/rsd+xml"],["rsheet","application/urc-ressheet+xml"],["rss","application/rss+xml"],["rtf","text/rtf"],["rtx","text/richtext"],["run","application/x-makeself"],["rusd","application/route-usd+xml"],["rv","video/vnd.rn-realvideo"],["s","text/x-asm"],["s3m","audio/s3m"],["saf","application/vnd.yamaha.smaf-audio"],["sass","text/x-sass"],["sbml","application/sbml+xml"],["sc","application/vnd.ibm.secure-container"],["scd","application/x-msschedule"],["scm","application/vnd.lotus-screencam"],["scq","application/scvp-cv-request"],["scs","application/scvp-cv-response"],["scss","text/x-scss"],["scurl","text/vnd.curl.scurl"],["sda","application/vnd.stardivision.draw"],["sdc","application/vnd.stardivision.calc"],["sdd","application/vnd.stardivision.impress"],["sdkd","application/vnd.solent.sdkm+xml"],["sdkm","application/vnd.solent.sdkm+xml"],["sdp","application/sdp"],["sdw","application/vnd.stardivision.writer"],["sea","application/octet-stream"],["see","application/vnd.seemail"],["seed","application/vnd.fdsn.seed"],["sema","application/vnd.sema"],["semd","application/vnd.semd"],["semf","application/vnd.semf"],["senmlx","application/senml+xml"],["sensmlx","application/sensml+xml"],["ser","application/java-serialized-object"],["setpay","application/set-payment-initiation"],["setreg","application/set-registration-initiation"],["sfd-hdstx","application/vnd.hydrostatix.sof-data"],["sfs","application/vnd.spotfire.sfs"],["sfv","text/x-sfv"],["sgi","image/sgi"],["sgl","application/vnd.stardivision.writer-global"],["sgm","text/sgml"],["sgml","text/sgml"],["sh","application/x-sh"],["shar","application/x-shar"],["shex","text/shex"],["shf","application/shf+xml"],["shtml","text/html"],["sid","image/x-mrsid-image"],["sieve","application/sieve"],["sig","application/pgp-signature"],["sil","audio/silk"],["silo","model/mesh"],["sis","application/vnd.symbian.install"],["sisx","application/vnd.symbian.install"],["sit","application/x-stuffit"],["sitx","application/x-stuffitx"],["siv","application/sieve"],["skd","application/vnd.koan"],["skm","application/vnd.koan"],["skp","application/vnd.koan"],["skt","application/vnd.koan"],["sldm","application/vnd.ms-powerpoint.slide.macroenabled.12"],["sldx","application/vnd.openxmlformats-officedocument.presentationml.slide"],["slim","text/slim"],["slm","text/slim"],["sls","application/route-s-tsid+xml"],["slt","application/vnd.epson.salt"],["sm","application/vnd.stepmania.stepchart"],["smf","application/vnd.stardivision.math"],["smi","application/smil"],["smil","application/smil"],["smv","video/x-smv"],["smzip","application/vnd.stepmania.package"],["snd","audio/basic"],["snf","application/x-font-snf"],["so","application/octet-stream"],["spc","application/x-pkcs7-certificates"],["spdx","text/spdx"],["spf","application/vnd.yamaha.smaf-phrase"],["spl","application/x-futuresplash"],["spot","text/vnd.in3d.spot"],["spp","application/scvp-vp-response"],["spq","application/scvp-vp-request"],["spx","audio/ogg"],["sql","application/x-sql"],["src","application/x-wais-source"],["srt","application/x-subrip"],["sru","application/sru+xml"],["srx","application/sparql-results+xml"],["ssdl","application/ssdl+xml"],["sse","application/vnd.kodak-descriptor"],["ssf","application/vnd.epson.ssf"],["ssml","application/ssml+xml"],["sst","application/octet-stream"],["st","application/vnd.sailingtracker.track"],["stc","application/vnd.sun.xml.calc.template"],["std","application/vnd.sun.xml.draw.template"],["stf","application/vnd.wt.stf"],["sti","application/vnd.sun.xml.impress.template"],["stk","application/hyperstudio"],["stl","model/stl"],["stpx","model/step+xml"],["stpxz","model/step-xml+zip"],["stpz","model/step+zip"],["str","application/vnd.pg.format"],["stw","application/vnd.sun.xml.writer.template"],["styl","text/stylus"],["stylus","text/stylus"],["sub","text/vnd.dvb.subtitle"],["sus","application/vnd.sus-calendar"],["susp","application/vnd.sus-calendar"],["sv4cpio","application/x-sv4cpio"],["sv4crc","application/x-sv4crc"],["svc","application/vnd.dvb.service"],["svd","application/vnd.svd"],["svg","image/svg+xml"],["svgz","image/svg+xml"],["swa","application/x-director"],["swf","application/x-shockwave-flash"],["swi","application/vnd.aristanetworks.swi"],["swidtag","application/swid+xml"],["sxc","application/vnd.sun.xml.calc"],["sxd","application/vnd.sun.xml.draw"],["sxg","application/vnd.sun.xml.writer.global"],["sxi","application/vnd.sun.xml.impress"],["sxm","application/vnd.sun.xml.math"],["sxw","application/vnd.sun.xml.writer"],["t","text/troff"],["t3","application/x-t3vm-image"],["t38","image/t38"],["taglet","application/vnd.mynfc"],["tao","application/vnd.tao.intent-module-archive"],["tap","image/vnd.tencent.tap"],["tar","application/x-tar"],["tcap","application/vnd.3gpp2.tcap"],["tcl","application/x-tcl"],["td","application/urc-targetdesc+xml"],["teacher","application/vnd.smart.teacher"],["tei","application/tei+xml"],["teicorpus","application/tei+xml"],["tex","application/x-tex"],["texi","application/x-texinfo"],["texinfo","application/x-texinfo"],["text","text/plain"],["tfi","application/thraud+xml"],["tfm","application/x-tex-tfm"],["tfx","image/tiff-fx"],["tga","image/x-tga"],["tgz","application/x-tar"],["thmx","application/vnd.ms-officetheme"],["tif","image/tiff"],["tiff","image/tiff"],["tk","application/x-tcl"],["tmo","application/vnd.tmobile-livetv"],["toml","application/toml"],["torrent","application/x-bittorrent"],["tpl","application/vnd.groove-tool-template"],["tpt","application/vnd.trid.tpt"],["tr","text/troff"],["tra","application/vnd.trueapp"],["trig","application/trig"],["trm","application/x-msterminal"],["ts","video/mp2t"],["tsd","application/timestamped-data"],["tsv","text/tab-separated-values"],["ttc","font/collection"],["ttf","font/ttf"],["ttl","text/turtle"],["ttml","application/ttml+xml"],["twd","application/vnd.simtech-mindmapper"],["twds","application/vnd.simtech-mindmapper"],["txd","application/vnd.genomatix.tuxedo"],["txf","application/vnd.mobius.txf"],["txt","text/plain"],["u8dsn","message/global-delivery-status"],["u8hdr","message/global-headers"],["u8mdn","message/global-disposition-notification"],["u8msg","message/global"],["u32","application/x-authorware-bin"],["ubj","application/ubjson"],["udeb","application/x-debian-package"],["ufd","application/vnd.ufdl"],["ufdl","application/vnd.ufdl"],["ulx","application/x-glulx"],["umj","application/vnd.umajin"],["unityweb","application/vnd.unity"],["uoml","application/vnd.uoml+xml"],["uri","text/uri-list"],["uris","text/uri-list"],["urls","text/uri-list"],["usdz","model/vnd.usdz+zip"],["ustar","application/x-ustar"],["utz","application/vnd.uiq.theme"],["uu","text/x-uuencode"],["uva","audio/vnd.dece.audio"],["uvd","application/vnd.dece.data"],["uvf","application/vnd.dece.data"],["uvg","image/vnd.dece.graphic"],["uvh","video/vnd.dece.hd"],["uvi","image/vnd.dece.graphic"],["uvm","video/vnd.dece.mobile"],["uvp","video/vnd.dece.pd"],["uvs","video/vnd.dece.sd"],["uvt","application/vnd.dece.ttml+xml"],["uvu","video/vnd.uvvu.mp4"],["uvv","video/vnd.dece.video"],["uvva","audio/vnd.dece.audio"],["uvvd","application/vnd.dece.data"],["uvvf","application/vnd.dece.data"],["uvvg","image/vnd.dece.graphic"],["uvvh","video/vnd.dece.hd"],["uvvi","image/vnd.dece.graphic"],["uvvm","video/vnd.dece.mobile"],["uvvp","video/vnd.dece.pd"],["uvvs","video/vnd.dece.sd"],["uvvt","application/vnd.dece.ttml+xml"],["uvvu","video/vnd.uvvu.mp4"],["uvvv","video/vnd.dece.video"],["uvvx","application/vnd.dece.unspecified"],["uvvz","application/vnd.dece.zip"],["uvx","application/vnd.dece.unspecified"],["uvz","application/vnd.dece.zip"],["vbox","application/x-virtualbox-vbox"],["vbox-extpack","application/x-virtualbox-vbox-extpack"],["vcard","text/vcard"],["vcd","application/x-cdlink"],["vcf","text/x-vcard"],["vcg","application/vnd.groove-vcard"],["vcs","text/x-vcalendar"],["vcx","application/vnd.vcx"],["vdi","application/x-virtualbox-vdi"],["vds","model/vnd.sap.vds"],["vhd","application/x-virtualbox-vhd"],["vis","application/vnd.visionary"],["viv","video/vnd.vivo"],["vlc","application/videolan"],["vmdk","application/x-virtualbox-vmdk"],["vob","video/x-ms-vob"],["vor","application/vnd.stardivision.writer"],["vox","application/x-authorware-bin"],["vrml","model/vrml"],["vsd","application/vnd.visio"],["vsf","application/vnd.vsf"],["vss","application/vnd.visio"],["vst","application/vnd.visio"],["vsw","application/vnd.visio"],["vtf","image/vnd.valve.source.texture"],["vtt","text/vtt"],["vtu","model/vnd.vtu"],["vxml","application/voicexml+xml"],["w3d","application/x-director"],["wad","application/x-doom"],["wadl","application/vnd.sun.wadl+xml"],["war","application/java-archive"],["wasm","application/wasm"],["wav","audio/x-wav"],["wax","audio/x-ms-wax"],["wbmp","image/vnd.wap.wbmp"],["wbs","application/vnd.criticaltools.wbs+xml"],["wbxml","application/wbxml"],["wcm","application/vnd.ms-works"],["wdb","application/vnd.ms-works"],["wdp","image/vnd.ms-photo"],["weba","audio/webm"],["webapp","application/x-web-app-manifest+json"],["webm","video/webm"],["webmanifest","application/manifest+json"],["webp","image/webp"],["wg","application/vnd.pmi.widget"],["wgt","application/widget"],["wks","application/vnd.ms-works"],["wm","video/x-ms-wm"],["wma","audio/x-ms-wma"],["wmd","application/x-ms-wmd"],["wmf","image/wmf"],["wml","text/vnd.wap.wml"],["wmlc","application/wmlc"],["wmls","text/vnd.wap.wmlscript"],["wmlsc","application/vnd.wap.wmlscriptc"],["wmv","video/x-ms-wmv"],["wmx","video/x-ms-wmx"],["wmz","application/x-msmetafile"],["woff","font/woff"],["woff2","font/woff2"],["word","application/msword"],["wpd","application/vnd.wordperfect"],["wpl","application/vnd.ms-wpl"],["wps","application/vnd.ms-works"],["wqd","application/vnd.wqd"],["wri","application/x-mswrite"],["wrl","model/vrml"],["wsc","message/vnd.wfa.wsc"],["wsdl","application/wsdl+xml"],["wspolicy","application/wspolicy+xml"],["wtb","application/vnd.webturbo"],["wvx","video/x-ms-wvx"],["x3d","model/x3d+xml"],["x3db","model/x3d+fastinfoset"],["x3dbz","model/x3d+binary"],["x3dv","model/x3d-vrml"],["x3dvz","model/x3d+vrml"],["x3dz","model/x3d+xml"],["x32","application/x-authorware-bin"],["x_b","model/vnd.parasolid.transmit.binary"],["x_t","model/vnd.parasolid.transmit.text"],["xaml","application/xaml+xml"],["xap","application/x-silverlight-app"],["xar","application/vnd.xara"],["xav","application/xcap-att+xml"],["xbap","application/x-ms-xbap"],["xbd","application/vnd.fujixerox.docuworks.binder"],["xbm","image/x-xbitmap"],["xca","application/xcap-caps+xml"],["xcs","application/calendar+xml"],["xdf","application/xcap-diff+xml"],["xdm","application/vnd.syncml.dm+xml"],["xdp","application/vnd.adobe.xdp+xml"],["xdssc","application/dssc+xml"],["xdw","application/vnd.fujixerox.docuworks"],["xel","application/xcap-el+xml"],["xenc","application/xenc+xml"],["xer","application/patch-ops-error+xml"],["xfdf","application/vnd.adobe.xfdf"],["xfdl","application/vnd.xfdl"],["xht","application/xhtml+xml"],["xhtml","application/xhtml+xml"],["xhvml","application/xv+xml"],["xif","image/vnd.xiff"],["xl","application/excel"],["xla","application/vnd.ms-excel"],["xlam","application/vnd.ms-excel.addin.macroEnabled.12"],["xlc","application/vnd.ms-excel"],["xlf","application/xliff+xml"],["xlm","application/vnd.ms-excel"],["xls","application/vnd.ms-excel"],["xlsb","application/vnd.ms-excel.sheet.binary.macroEnabled.12"],["xlsm","application/vnd.ms-excel.sheet.macroEnabled.12"],["xlsx","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],["xlt","application/vnd.ms-excel"],["xltm","application/vnd.ms-excel.template.macroEnabled.12"],["xltx","application/vnd.openxmlformats-officedocument.spreadsheetml.template"],["xlw","application/vnd.ms-excel"],["xm","audio/xm"],["xml","application/xml"],["xns","application/xcap-ns+xml"],["xo","application/vnd.olpc-sugar"],["xop","application/xop+xml"],["xpi","application/x-xpinstall"],["xpl","application/xproc+xml"],["xpm","image/x-xpixmap"],["xpr","application/vnd.is-xpr"],["xps","application/vnd.ms-xpsdocument"],["xpw","application/vnd.intercon.formnet"],["xpx","application/vnd.intercon.formnet"],["xsd","application/xml"],["xsl","application/xml"],["xslt","application/xslt+xml"],["xsm","application/vnd.syncml+xml"],["xspf","application/xspf+xml"],["xul","application/vnd.mozilla.xul+xml"],["xvm","application/xv+xml"],["xvml","application/xv+xml"],["xwd","image/x-xwindowdump"],["xyz","chemical/x-xyz"],["xz","application/x-xz"],["yaml","text/yaml"],["yang","application/yang"],["yin","application/yin+xml"],["yml","text/yaml"],["ymp","text/x-suse-ymp"],["z","application/x-compress"],["z1","application/x-zmachine"],["z2","application/x-zmachine"],["z3","application/x-zmachine"],["z4","application/x-zmachine"],["z5","application/x-zmachine"],["z6","application/x-zmachine"],["z7","application/x-zmachine"],["z8","application/x-zmachine"],["zaz","application/vnd.zzazz.deck+xml"],["zip","application/zip"],["zir","application/vnd.zul"],["zirz","application/vnd.zul"],["zmm","application/vnd.handheld-entertainment+xml"],["zsh","text/x-scriptzsh"]]);function Wi(i,e,t){const n=Lv(i),{webkitRelativePath:r}=i,s=typeof e=="string"?e:typeof r=="string"&&r.length>0?r:`./${i.name}`;return typeof n.path!="string"&&ac(n,"path",s),ac(n,"relativePath",s),n}function Lv(i){const{name:e}=i;if(e&&e.lastIndexOf(".")!==-1&&!i.type){const n=e.split(".").pop().toLowerCase(),r=Fv.get(n);r&&Object.defineProperty(i,"type",{value:r,writable:!1,configurable:!1,enumerable:!0})}return i}function ac(i,e,t){Object.defineProperty(i,e,{value:t,writable:!1,configurable:!1,enumerable:!0})}const Bv=[".DS_Store","Thumbs.db"];function Vv(i){return bi(this,void 0,void 0,function*(){return Dr(i)&&zv(i.dataTransfer)?Yv(i.dataTransfer,i.type):Hv(i)?qv(i):Array.isArray(i)&&i.every(e=>"getFile"in e&&typeof e.getFile=="function")?Uv(i):[]})}function zv(i){return Dr(i)}function Hv(i){return Dr(i)&&Dr(i.target)}function Dr(i){return typeof i=="object"&&i!==null}function qv(i){return po(i.target.files).map(e=>Wi(e))}function Uv(i){return bi(this,void 0,void 0,function*(){return(yield Promise.all(i.map(t=>t.getFile()))).map(t=>Wi(t))})}function Yv(i,e){return bi(this,void 0,void 0,function*(){if(i.items){const t=po(i.items).filter(r=>r.kind==="file");if(e!=="drop")return t;const n=yield Promise.all(t.map(Gv));return lc(fu(n))}return lc(po(i.files).map(t=>Wi(t)))})}function lc(i){return i.filter(e=>Bv.indexOf(e.name)===-1)}function po(i){if(i===null)return[];const e=[];for(let t=0;t<i.length;t++){const n=i[t];e.push(n)}return e}function Gv(i){if(typeof i.webkitGetAsEntry!="function")return cc(i);const e=i.webkitGetAsEntry();return e&&e.isDirectory?mu(e):cc(i,e)}function fu(i){return i.reduce((e,t)=>[...e,...Array.isArray(t)?fu(t):[t]],[])}function cc(i,e){return bi(this,void 0,void 0,function*(){var t;if(globalThis.isSecureContext&&typeof i.getAsFileSystemHandle=="function"){const s=yield i.getAsFileSystemHandle();if(s===null)throw new Error(`${i} is not a File`);if(s!==void 0){const o=yield s.getFile();return o.handle=s,Wi(o)}}const n=i.getAsFile();if(!n)throw new Error(`${i} is not a File`);return Wi(n,(t=e==null?void 0:e.fullPath)!==null&&t!==void 0?t:void 0)})}function Jv(i){return bi(this,void 0,void 0,function*(){return i.isDirectory?mu(i):Kv(i)})}function mu(i){const e=i.createReader();return new Promise((t,n)=>{const r=[];function s(){e.readEntries(o=>bi(this,void 0,void 0,function*(){if(o.length){const a=Promise.all(o.map(Jv));r.push(a),s()}else try{const a=yield Promise.all(r);t(a)}catch(a){n(a)}}),o=>{n(o)})}s()})}function Kv(i){return bi(this,void 0,void 0,function*(){return new Promise((e,t)=>{i.file(n=>{const r=Wi(n,i.fullPath);e(r)},n=>{t(n)})})})}var Es=function(i,e){if(i&&e){var t=Array.isArray(e)?e:e.split(",");if(t.length===0)return!0;var n=i.name||"",r=(i.type||"").toLowerCase(),s=r.replace(/\/.*$/,"");return t.some(function(o){var a=o.trim().toLowerCase();return a.charAt(0)==="."?n.toLowerCase().endsWith(a):a.endsWith("/*")?s===a.replace(/\/.*$/,""):r===a})}return!0};function dc(i){return Qv(i)||Zv(i)||vu(i)||Xv()}function Xv(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Zv(i){if(typeof Symbol<"u"&&i[Symbol.iterator]!=null||i["@@iterator"]!=null)return Array.from(i)}function Qv(i){if(Array.isArray(i))return ho(i)}function uc(i,e){var t=Object.keys(i);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(i);e&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(i,r).enumerable})),t.push.apply(t,n)}return t}function pc(i){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?uc(Object(t),!0).forEach(function(n){gu(i,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(t)):uc(Object(t)).forEach(function(n){Object.defineProperty(i,n,Object.getOwnPropertyDescriptor(t,n))})}return i}function gu(i,e,t){return e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}function Cn(i,e){return ix(i)||tx(i,e)||vu(i,e)||ex()}function ex(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function vu(i,e){if(i){if(typeof i=="string")return ho(i,e);var t=Object.prototype.toString.call(i).slice(8,-1);if(t==="Object"&&i.constructor&&(t=i.constructor.name),t==="Map"||t==="Set")return Array.from(i);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return ho(i,e)}}function ho(i,e){(e==null||e>i.length)&&(e=i.length);for(var t=0,n=new Array(e);t<e;t++)n[t]=i[t];return n}function tx(i,e){var t=i==null?null:typeof Symbol<"u"&&i[Symbol.iterator]||i["@@iterator"];if(t!=null){var n=[],r=!0,s=!1,o,a;try{for(t=t.call(i);!(r=(o=t.next()).done)&&(n.push(o.value),!(e&&n.length===e));r=!0);}catch(l){s=!0,a=l}finally{try{!r&&t.return!=null&&t.return()}finally{if(s)throw a}}return n}}function ix(i){if(Array.isArray(i))return i}var nx=typeof Es=="function"?Es:Es.default,rx="file-invalid-type",sx="file-too-large",ox="file-too-small",ax="too-many-files",lx=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",t=e.split(","),n=t.length>1?"one of ".concat(t.join(", ")):t[0];return{code:rx,message:"File type must be ".concat(n)}},hc=function(e){return{code:sx,message:"File is larger than ".concat(e," ").concat(e===1?"byte":"bytes")}},fc=function(e){return{code:ox,message:"File is smaller than ".concat(e," ").concat(e===1?"byte":"bytes")}},cx={code:ax,message:"Too many files"};function xu(i,e){var t=i.type==="application/x-moz-file"||nx(i,e);return[t,t?null:lx(e)]}function yu(i,e,t){if(pi(i.size))if(pi(e)&&pi(t)){if(i.size>t)return[!1,hc(t)];if(i.size<e)return[!1,fc(e)]}else{if(pi(e)&&i.size<e)return[!1,fc(e)];if(pi(t)&&i.size>t)return[!1,hc(t)]}return[!0,null]}function pi(i){return i!=null}function dx(i){var e=i.files,t=i.accept,n=i.minSize,r=i.maxSize,s=i.multiple,o=i.maxFiles,a=i.validator;return!s&&e.length>1||s&&o>=1&&e.length>o?!1:e.every(function(l){var c=xu(l,t),u=Cn(c,1),p=u[0],d=yu(l,n,r),f=Cn(d,1),m=f[0],v=a?a(l):null;return p&&m&&!v})}function Sr(i){return typeof i.isPropagationStopped=="function"?i.isPropagationStopped():typeof i.cancelBubble<"u"?i.cancelBubble:!1}function Qn(i){return i.dataTransfer?Array.prototype.some.call(i.dataTransfer.types,function(e){return e==="Files"||e==="application/x-moz-file"}):!!i.target&&!!i.target.files}function mc(i){i.preventDefault()}function ux(i){return i.indexOf("MSIE")!==-1||i.indexOf("Trident/")!==-1}function px(i){return i.indexOf("Edge/")!==-1}function hx(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.navigator.userAgent;return ux(i)||px(i)}function Et(){for(var i=arguments.length,e=new Array(i),t=0;t<i;t++)e[t]=arguments[t];return function(n){for(var r=arguments.length,s=new Array(r>1?r-1:0),o=1;o<r;o++)s[o-1]=arguments[o];return e.some(function(a){return!Sr(n)&&a&&a.apply(void 0,[n].concat(s)),Sr(n)})}}function fx(){return"showOpenFilePicker"in window}function mx(i){if(pi(i)){var e=Object.entries(i).filter(function(t){var n=Cn(t,2),r=n[0],s=n[1],o=!0;return bu(r)||(console.warn('Skipped "'.concat(r,'" because it is not a valid MIME type. Check https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types for a list of valid MIME types.')),o=!1),(!Array.isArray(s)||!s.every(wu))&&(console.warn('Skipped "'.concat(r,'" because an invalid file extension was provided.')),o=!1),o}).reduce(function(t,n){var r=Cn(n,2),s=r[0],o=r[1];return pc(pc({},t),{},gu({},s,o))},{});return[{description:"Files",accept:e}]}return i}function gx(i){if(pi(i))return Object.entries(i).reduce(function(e,t){var n=Cn(t,2),r=n[0],s=n[1];return[].concat(dc(e),[r],dc(s))},[]).filter(function(e){return bu(e)||wu(e)}).join(",")}function vx(i){return i instanceof DOMException&&(i.name==="AbortError"||i.code===i.ABORT_ERR)}function xx(i){return i instanceof DOMException&&(i.name==="SecurityError"||i.code===i.SECURITY_ERR)}function bu(i){return i==="audio/*"||i==="video/*"||i==="image/*"||i==="text/*"||i==="application/*"||/\w+\/[-+.\w]+/g.test(i)}function wu(i){return/^.*\.[\w]+$/.test(i)}var yx=["children"],bx=["open"],wx=["refKey","role","onKeyDown","onFocus","onBlur","onClick","onDragEnter","onDragOver","onDragLeave","onDrop"],Dx=["refKey","onChange","onClick"];function Sx(i){return _x(i)||Cx(i)||Du(i)||Ix()}function Ix(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Cx(i){if(typeof Symbol<"u"&&i[Symbol.iterator]!=null||i["@@iterator"]!=null)return Array.from(i)}function _x(i){if(Array.isArray(i))return fo(i)}function Rs(i,e){return Tx(i)||kx(i,e)||Du(i,e)||Mx()}function Mx(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Du(i,e){if(i){if(typeof i=="string")return fo(i,e);var t=Object.prototype.toString.call(i).slice(8,-1);if(t==="Object"&&i.constructor&&(t=i.constructor.name),t==="Map"||t==="Set")return Array.from(i);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return fo(i,e)}}function fo(i,e){(e==null||e>i.length)&&(e=i.length);for(var t=0,n=new Array(e);t<e;t++)n[t]=i[t];return n}function kx(i,e){var t=i==null?null:typeof Symbol<"u"&&i[Symbol.iterator]||i["@@iterator"];if(t!=null){var n=[],r=!0,s=!1,o,a;try{for(t=t.call(i);!(r=(o=t.next()).done)&&(n.push(o.value),!(e&&n.length===e));r=!0);}catch(l){s=!0,a=l}finally{try{!r&&t.return!=null&&t.return()}finally{if(s)throw a}}return n}}function Tx(i){if(Array.isArray(i))return i}function gc(i,e){var t=Object.keys(i);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(i);e&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(i,r).enumerable})),t.push.apply(t,n)}return t}function We(i){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?gc(Object(t),!0).forEach(function(n){mo(i,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(t)):gc(Object(t)).forEach(function(n){Object.defineProperty(i,n,Object.getOwnPropertyDescriptor(t,n))})}return i}function mo(i,e,t){return e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}function Ir(i,e){if(i==null)return{};var t=Px(i,e),n,r;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(i);for(r=0;r<s.length;r++)n=s[r],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(i,n)&&(t[n]=i[n])}return t}function Px(i,e){if(i==null)return{};var t={},n=Object.keys(i),r,s;for(s=0;s<n.length;s++)r=n[s],!(e.indexOf(r)>=0)&&(t[r]=i[r]);return t}var Vo=D.forwardRef(function(i,e){var t=i.children,n=Ir(i,yx),r=Iu(n),s=r.open,o=Ir(r,bx);return D.useImperativeHandle(e,function(){return{open:s}},[s]),ve.createElement(D.Fragment,null,t(We(We({},o),{},{open:s})))});Vo.displayName="Dropzone";var Su={disabled:!1,getFilesFromEvent:Vv,maxSize:1/0,minSize:0,multiple:!0,maxFiles:0,preventDropOnDocument:!0,noClick:!1,noKeyboard:!1,noDrag:!1,noDragEventsBubbling:!1,validator:null,useFsAccessApi:!1,autoFocus:!1};Vo.defaultProps=Su;Vo.propTypes={children:C.func,accept:C.objectOf(C.arrayOf(C.string)),multiple:C.bool,preventDropOnDocument:C.bool,noClick:C.bool,noKeyboard:C.bool,noDrag:C.bool,noDragEventsBubbling:C.bool,minSize:C.number,maxSize:C.number,maxFiles:C.number,disabled:C.bool,getFilesFromEvent:C.func,onFileDialogCancel:C.func,onFileDialogOpen:C.func,useFsAccessApi:C.bool,autoFocus:C.bool,onDragEnter:C.func,onDragLeave:C.func,onDragOver:C.func,onDrop:C.func,onDropAccepted:C.func,onDropRejected:C.func,onError:C.func,validator:C.func};var go={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function Iu(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=We(We({},Su),i),t=e.accept,n=e.disabled,r=e.getFilesFromEvent,s=e.maxSize,o=e.minSize,a=e.multiple,l=e.maxFiles,c=e.onDragEnter,u=e.onDragLeave,p=e.onDragOver,d=e.onDrop,f=e.onDropAccepted,m=e.onDropRejected,v=e.onFileDialogCancel,g=e.onFileDialogOpen,x=e.useFsAccessApi,y=e.autoFocus,w=e.preventDropOnDocument,S=e.noClick,M=e.noKeyboard,b=e.noDrag,I=e.noDragEventsBubbling,P=e.onError,E=e.validator,A=D.useMemo(function(){return gx(t)},[t]),T=D.useMemo(function(){return mx(t)},[t]),W=D.useMemo(function(){return typeof g=="function"?g:vc},[g]),F=D.useMemo(function(){return typeof v=="function"?v:vc},[v]),j=D.useRef(null),O=D.useRef(null),R=D.useReducer(Ox,go),B=Rs(R,2),$=B[0],J=B[1],q=$.isFocused,L=$.isFileDialogActive,Q=D.useRef(typeof window<"u"&&window.isSecureContext&&x&&fx()),G=function(){!Q.current&&L&&setTimeout(function(){if(O.current){var pe=O.current.files;pe.length||(J({type:"closeDialog"}),F())}},300)};D.useEffect(function(){return window.addEventListener("focus",G,!1),function(){window.removeEventListener("focus",G,!1)}},[O,L,F,Q]);var ne=D.useRef([]),U=function(pe){j.current&&j.current.contains(pe.target)||(pe.preventDefault(),ne.current=[])};D.useEffect(function(){return w&&(document.addEventListener("dragover",mc,!1),document.addEventListener("drop",U,!1)),function(){w&&(document.removeEventListener("dragover",mc),document.removeEventListener("drop",U))}},[j,w]),D.useEffect(function(){return!n&&y&&j.current&&j.current.focus(),function(){}},[j,y,n]);var re=D.useCallback(function(ue){P?P(ue):console.error(ue)},[P]),ie=D.useCallback(function(ue){ue.preventDefault(),ue.persist(),de(ue),ne.current=[].concat(Sx(ne.current),[ue.target]),Qn(ue)&&Promise.resolve(r(ue)).then(function(pe){if(!(Sr(ue)&&!I)){var Ce=pe.length,Ae=Ce>0&&dx({files:pe,accept:A,minSize:o,maxSize:s,multiple:a,maxFiles:l,validator:E}),ze=Ce>0&&!Ae;J({isDragAccept:Ae,isDragReject:ze,isDragActive:!0,type:"setDraggedFiles"}),c&&c(ue)}}).catch(function(pe){return re(pe)})},[r,c,re,I,A,o,s,a,l,E]),Y=D.useCallback(function(ue){ue.preventDefault(),ue.persist(),de(ue);var pe=Qn(ue);if(pe&&ue.dataTransfer)try{ue.dataTransfer.dropEffect="copy"}catch{}return pe&&p&&p(ue),!1},[p,I]),K=D.useCallback(function(ue){ue.preventDefault(),ue.persist(),de(ue);var pe=ne.current.filter(function(Ae){return j.current&&j.current.contains(Ae)}),Ce=pe.indexOf(ue.target);Ce!==-1&&pe.splice(Ce,1),ne.current=pe,!(pe.length>0)&&(J({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),Qn(ue)&&u&&u(ue))},[j,u,I]),se=D.useCallback(function(ue,pe){var Ce=[],Ae=[];ue.forEach(function(ze){var Qt=xu(ze,A),Bt=Rs(Qt,2),Xi=Bt[0],Zi=Bt[1],ei=yu(ze,o,s),ti=Rs(ei,2),ii=ti[0],ni=ti[1],ri=E?E(ze):null;if(Xi&&ii&&!ri)Ce.push(ze);else{var Qi=[Zi,ni];ri&&(Qi=Qi.concat(ri)),Ae.push({file:ze,errors:Qi.filter(function($e){return $e})})}}),(!a&&Ce.length>1||a&&l>=1&&Ce.length>l)&&(Ce.forEach(function(ze){Ae.push({file:ze,errors:[cx]})}),Ce.splice(0)),J({acceptedFiles:Ce,fileRejections:Ae,isDragReject:Ae.length>0,type:"setFiles"}),d&&d(Ce,Ae,pe),Ae.length>0&&m&&m(Ae,pe),Ce.length>0&&f&&f(Ce,pe)},[J,a,A,o,s,l,d,f,m,E]),ae=D.useCallback(function(ue){ue.preventDefault(),ue.persist(),de(ue),ne.current=[],Qn(ue)&&Promise.resolve(r(ue)).then(function(pe){Sr(ue)&&!I||se(pe,ue)}).catch(function(pe){return re(pe)}),J({type:"reset"})},[r,se,re,I]),oe=D.useCallback(function(){if(Q.current){J({type:"openDialog"}),W();var ue={multiple:a,types:T};window.showOpenFilePicker(ue).then(function(pe){return r(pe)}).then(function(pe){se(pe,null),J({type:"closeDialog"})}).catch(function(pe){vx(pe)?(F(pe),J({type:"closeDialog"})):xx(pe)?(Q.current=!1,O.current?(O.current.value=null,O.current.click()):re(new Error("Cannot open the file picker because the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API is not supported and no <input> was provided."))):re(pe)});return}O.current&&(J({type:"openDialog"}),W(),O.current.value=null,O.current.click())},[J,W,F,x,se,re,T,a]),V=D.useCallback(function(ue){!j.current||!j.current.isEqualNode(ue.target)||(ue.key===" "||ue.key==="Enter"||ue.keyCode===32||ue.keyCode===13)&&(ue.preventDefault(),oe())},[j,oe]),z=D.useCallback(function(){J({type:"focus"})},[]),Z=D.useCallback(function(){J({type:"blur"})},[]),X=D.useCallback(function(){S||(hx()?setTimeout(oe,0):oe())},[S,oe]),H=function(pe){return n?null:pe},ee=function(pe){return M?null:H(pe)},te=function(pe){return b?null:H(pe)},de=function(pe){I&&pe.stopPropagation()},ye=D.useMemo(function(){return function(){var ue=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},pe=ue.refKey,Ce=pe===void 0?"ref":pe,Ae=ue.role,ze=ue.onKeyDown,Qt=ue.onFocus,Bt=ue.onBlur,Xi=ue.onClick,Zi=ue.onDragEnter,ei=ue.onDragOver,ti=ue.onDragLeave,ii=ue.onDrop,ni=Ir(ue,wx);return We(We(mo({onKeyDown:ee(Et(ze,V)),onFocus:ee(Et(Qt,z)),onBlur:ee(Et(Bt,Z)),onClick:H(Et(Xi,X)),onDragEnter:te(Et(Zi,ie)),onDragOver:te(Et(ei,Y)),onDragLeave:te(Et(ti,K)),onDrop:te(Et(ii,ae)),role:typeof Ae=="string"&&Ae!==""?Ae:"presentation"},Ce,j),!n&&!M?{tabIndex:0}:{}),ni)}},[j,V,z,Z,X,ie,Y,K,ae,M,b,n]),Le=D.useCallback(function(ue){ue.stopPropagation()},[]),nt=D.useMemo(function(){return function(){var ue=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},pe=ue.refKey,Ce=pe===void 0?"ref":pe,Ae=ue.onChange,ze=ue.onClick,Qt=Ir(ue,Dx),Bt=mo({accept:A,multiple:a,type:"file",style:{border:0,clip:"rect(0, 0, 0, 0)",clipPath:"inset(50%)",height:"1px",margin:"0 -1px -1px 0",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap"},onChange:H(Et(Ae,ae)),onClick:H(Et(ze,Le)),tabIndex:-1},Ce,O);return We(We({},Bt),Qt)}},[O,t,a,ae,n]);return We(We({},$),{},{isFocused:q&&!n,getRootProps:ye,getInputProps:nt,rootRef:j,inputRef:O,open:H(oe)})}function Ox(i,e){switch(e.type){case"focus":return We(We({},i),{},{isFocused:!0});case"blur":return We(We({},i),{},{isFocused:!1});case"openDialog":return We(We({},go),{},{isFileDialogActive:!0});case"closeDialog":return We(We({},i),{},{isFileDialogActive:!1});case"setDraggedFiles":return We(We({},i),{},{isDragActive:e.isDragActive,isDragAccept:e.isDragAccept,isDragReject:e.isDragReject});case"setFiles":return We(We({},i),{},{acceptedFiles:e.acceptedFiles,fileRejections:e.fileRejections,isDragReject:e.isDragReject});case"reset":return We({},go);default:return i}}function vc(){}const jx=[".png",".jpg",".svg",".gif",".apng",".avif",".webp",".jpeg",".bmp",".ico",".tiff",".tif"],Ex=i=>{const[e,t]=D.useState(""),[n,r]=D.useState(null),[s,o]=D.useState(!1),[a,l]=D.useState(""),c=D.useCallback((f,m)=>{if(f!=null&&f.length){o(!0),a&&l("");const v=new FileReader;t(f[0].name),v.onload=g=>{o(!1),r(g.target.result),i.onUpload(f[0].name,g.target.result)},v.readAsDataURL(f[0])}m!=null&&m.length&&m[0].errors.forEach(v=>{v.code==="file-too-large"?l(N.I18n.t("File too large")):v.code==="file-invalid-type"?l(N.I18n.t("Invalid file type")):l(`Error: ${v.message}`),setTimeout(()=>{a&&l("")},3e3)})},[a]),{getRootProps:u,getInputProps:p,isDragActive:d}=Iu({onDrop:c,maxFiles:1,maxSize:i.maxSize||void 0,accept:i.accept});return h.jsxs("div",{...u(),style:{display:"flex",alignItems:"center",justifyContent:"center",width:"100%",height:200,borderRadius:4,boxSizing:"border-box",borderStyle:"dashed",borderWidth:1,borderColor:d?i.themeType==="dark"?"lightgreen":"green":"inherit"},children:[a?h.jsx("div",{style:{color:"#a90000"},children:a}):null,i.disabled||s?null:h.jsx("input",{...p()}),s?h.jsx(k.CircularProgress,{}):h.jsx("p",{style:{textAlign:"center",color:d?i.themeType==="dark"?"lightgreen":"green":"inherit"},children:e?h.jsxs(h.Fragment,{children:[h.jsx("div",{children:e}),e.endsWith(".zip")?h.jsx(be.FolderZip,{}):null,jx.find(f=>e.toLowerCase().endsWith(f))?h.jsx("img",{src:n,alt:"uploaded",style:{maxWidth:100,maxHeight:100}}):null,n?h.jsxs("div",{style:{fontSize:10,opacity:.5},children:["(",N.Utils.formatBytes(n.length),")"]}):null]}):i.instruction||`${N.I18n.t("Drop the files here ...")} ${i.maxSize?N.I18n.t("(Maximal file size is %s)",N.Utils.formatBytes(i.maxSize)):""}`})]})},As=250,si={dialog:{height:"100%"},iconName:{fontSize:10,width:50,overflow:"hidden",textOverflow:"ellipsis"},iconDiv:i=>({margin:0,textAlign:"center",cursor:"pointer",padding:2,borderRadius:2,"&:hover":{backgroundColor:i.palette.secondary.main}}),icon:i=>({width:48,height:48,color:i.palette.text.primary}),iconSelected:i=>({backgroundColor:i.palette.primary.main,"&:hover":{backgroundColor:i.palette.primary.light}}),typeName:{whiteSpace:"nowrap"}},xc=["baseline","outline","round","sharp","twotone","knx-uf","upload"];class zo extends D.Component{list={};index=null;filterTimer=null;constructor(e){super(e);const t=this.props.iconType||window.localStorage.getItem("vis.icon.type")||xc[0];this.state={listLoaded:!1,selectedIcon:"",filter:this.props.filter||window.localStorage.getItem("vis.icon.filter")||"",iconType:t,iconTypeLoaded:{},filtered:[],loading:t!=="upload",page:1,maxPages:0}}setStateAsync(e){return new Promise(t=>{this.setState(e,()=>t())})}async loadIconSet(e){if(!this.list[e]){if(await this.setStateAsync({loading:!0}),this.list[e]=!0,e==="customIcons")try{this.list[e]=await fetch(this.props.customIcons).then(n=>n.json())}catch(n){this.list[e]={},console.error(`Cannot load custom icons from ${this.props.customIcons}: ${n}`)}else this.list[e]=await fetch(`./material-icons/${e}.json`).then(n=>n.json());const t=Object.keys(this.list[e]);for(let n=0;n<t.length;n++){const r=t[n];this.list[e][r]=`data:image/svg+xml;base64,${this.list[e][r]}`}this.setState({iconTypeLoaded:{...this.state.iconTypeLoaded,[e]:!0},filtered:[],loading:!1},()=>this.applyFilter(!0))}}loadList(){this.state.listLoaded||fetch("./material-icons/index.json").then(e=>e.json()).then(async e=>{this.index=e,await this.loadIconSet(this.state.iconType),this.setState({listLoaded:!0},()=>this.applyFilter(!0))})}componentWillUnmount(){this.filterTimer&&clearTimeout(this.filterTimer)}applyFilter(e){let t=200;e===!0&&(t=0,e=void 0),this.filterTimer&&clearTimeout(this.filterTimer),this.filterTimer=setTimeout(()=>{this.filterTimer=null;let n;e=e===void 0?this.state.filter:e,e?(e=e.toLowerCase(),this.state.iconType==="knx-uf"?n=Object.keys(this.list["knx-uf"]).filter(r=>r.includes(e)):this.state.iconType==="customIcons"?n=Object.keys(this.list.customIcons).filter(r=>r.includes(e)):n=this.index.filter(r=>{var s,o;return!((s=r.unsupported_families)!=null&&s.includes(this.state.iconType))&&(r.name.includes(e)||((o=r.tags)==null?void 0:o.find(a=>a.includes(e))))}).map(r=>r.name)):this.state.iconType==="knx-uf"?n=Object.keys(this.list["knx-uf"]):this.state.iconType==="customIcons"?n=Object.keys(this.list.customIcons):n=this.index.filter(r=>!r.unsupported_families||!r.unsupported_families.includes(this.state.iconType)).map(r=>r.name),this.setState({filtered:n,page:1,maxPages:Math.ceil(n.length/As)})},t)}componentDidMount(){this.loadList()}onSelect(){this.state.selectedIcon&&this.state.selectedIcon.startsWith("data:")?this.props.onClose(this.state.selectedIcon):this.list[this.state.iconType]&&this.list[this.state.iconType]!==!0&&this.props.onClose(this.list[this.state.iconType][this.state.selectedIcon])}renderIcons(){const e=this.props.customColor&&this.state.iconType==="customIcons"?{color:this.props.customColor}:{},t=[];for(let n=(this.state.page-1)*As;n<this.state.page*As&&n<this.state.filtered.length;n++){const r=this.state.filtered[n];t.push(h.jsxs(k.Box,{component:"div",sx:N.Utils.getStyle(this.props.theme,si.iconDiv,this.state.selectedIcon===r&&si.iconSelected),onClick:()=>this.setState({selectedIcon:r}),onDoubleClick:()=>this.setState({selectedIcon:r},()=>this.onSelect()),children:[h.jsx(N.Icon,{src:this.list[this.state.iconType][r],style:N.Utils.getStyle(this.props.theme,si.icon,e)}),h.jsx("div",{style:si.iconName,children:r.replace(/_/g," ")})]},r))}return t}render(){return h.jsxs(k.Dialog,{open:!0,maxWidth:"lg",fullWidth:!0,sx:{"& .MuiDialog-paper":si.dialog},children:[h.jsxs(k.DialogTitle,{children:[h.jsxs("span",{style:{marginRight:20},children:[this.state.iconType==="knx-uf"?"KNX UF":this.state.iconType!=="upload"?"Material":""," Icon Selector"]}),this.state.iconType!=="upload"?h.jsx(k.TextField,{value:this.state.filter,slotProps:{input:{startAdornment:h.jsx(k.InputAdornment,{position:"start",children:h.jsx(be.Search,{})}),endAdornment:this.state.filter?h.jsx(k.InputAdornment,{position:"start",children:h.jsx(be.Close,{style:{cursor:"pointer"},onClick:()=>{window.localStorage.removeItem("vis.icon.filter"),this.setState({filter:""},()=>this.applyFilter(!0))}})}):null}},variant:"standard",onChange:e=>{window.localStorage.setItem("vis.icon.filter",e.target.value),this.setState({filter:e.target.value},()=>this.applyFilter())},helperText:N.I18n.t("material_icons_result",this.state.filtered.length)}):null]}),h.jsxs(k.DialogContent,{style:{overflowY:"hidden",height:"100%"},children:[this.props.iconType?null:h.jsx("div",{style:{width:140,display:"inline-block",verticalAlign:"top"},children:h.jsx(k.FormControl,{children:h.jsxs(k.RadioGroup,{value:this.state.iconType,onChange:e=>this.setState({iconType:e.target.value}),children:[xc.map(e=>h.jsx(k.FormControlLabel,{onClick:async()=>{window.localStorage.setItem("vis.icon.type",e);const t={iconType:e};e!=="upload"?(await this.loadIconSet(e),this.state.selectedIcon&&!this.list[e][this.state.selectedIcon]&&(t.selectedIcon="")):(t.selectedIcon="",t.maxPages=0),this.setState(t,()=>this.applyFilter(!0))},value:e,control:h.jsx(k.Radio,{}),label:N.I18n.t(`material_icons_${e}`),sx:{".& MuiRadioGroup-label":si.typeName}},e)),this.props.customIcons?h.jsx(k.FormControlLabel,{onClick:async()=>{window.localStorage.setItem("vis.icon.type","customIcons"),await this.loadIconSet("customIcons");const e={iconType:"customIcons"};this.state.selectedIcon&&!this.list.customIcons[this.state.selectedIcon]&&(e.selectedIcon=""),this.setState(e)},value:"customIcons",control:h.jsx(k.Radio,{}),label:N.I18n.t("custom_icons"),sx:{"& .MuiFormControlLabel-label":si.typeName}},"customIcons"):null]})})}),h.jsxs("div",{style:{width:"calc(100% - 150px)",display:"inline-block",height:"100%",overflowY:"auto",paddingLeft:10},children:[this.state.iconType==="knx-uf"?h.jsxs("div",{style:{paddingBottom:20},children:[N.I18n.t("Source:")," ",h.jsx("a",{style:{textDecoration:"none"},href:"https://github.com/OpenAutomationProject/knx-uf-iconset",target:"_blank",rel:"noreferrer",children:"https://github.com/OpenAutomationProject/knx-uf-iconset"})]}):null,this.state.iconType!=="upload"&&!this.state.loading&&this.list[this.state.iconType]&&this.list[this.state.iconType]!==!0?h.jsx("div",{style:{width:"100%"},children:h.jsx(k.Grid,{container:!0,spacing:2,style:{width:"100%",paddingTop:20},children:this.renderIcons()})}):this.state.iconType!=="upload"?h.jsx(k.LinearProgress,{}):null,this.state.iconType==="upload"?h.jsxs("div",{children:[h.jsxs("div",{style:{width:"100%",textAlign:"center",marginBottom:10,marginTop:10},children:[N.I18n.t("icon_upload_hint"),h.jsx("br",{}),h.jsx(k.Button,{variant:"outlined",onClick:()=>window.open("https://github.com/ioBroker/ioBroker.vis-2#svg-and-currentcolor","_blank"),children:N.I18n.t("Read about currentColor in SVG")})]}),h.jsx(Ex,{themeType:this.props.themeType,onUpload:(e,t)=>this.setState({selectedIcon:t.toString()}),maxSize:15e3,accept:{"image/png":[".png"],"image/jpeg":[".jpg"],"image/svg+xml":[".svg"],"image/gif":[".gif"],"image/apng":[".apng"],"image/avif":[".avif"],"image/webp":[".webp"]}})]}):null]})]}),h.jsxs(k.DialogActions,{children:[this.state.maxPages>1&&!this.state.loading?h.jsx("div",{style:{marginLeft:140},children:h.jsx(k.Pagination,{count:this.state.maxPages,color:"primary",page:this.state.page,onChange:(e,t)=>this.setState({page:t})})}):null,this.state.maxPages>1?h.jsx("div",{style:{flexGrow:1}}):null,this.props.value?h.jsx(k.Button,{variant:"outlined",color:"grey",onClick:()=>this.props.onClose(""),startIcon:h.jsx(be.Delete,{}),children:N.I18n.t("Delete")}):null,h.jsx(k.Button,{variant:"contained",color:"primary",onClick:()=>this.onSelect(),disabled:!this.state.selectedIcon,startIcon:h.jsx(be.Check,{}),children:N.I18n.t("Select")}),h.jsx(k.Button,{variant:"contained",color:"grey",onClick:()=>this.props.onClose(null),startIcon:h.jsx(be.Close,{}),children:N.I18n.t("Cancel")})]})]})}}window.VisMaterialIconSelector=zo;var Cu=ve.createContext(null);function Rx(i){i()}var _u=Rx,Ax=function(e){return _u=e},Nx=function(){return _u};function $x(){var i=Nx(),e=null,t=null;return{clear:function(){e=null,t=null},notify:function(){i(function(){for(var r=e;r;)r.callback(),r=r.next})},get:function(){for(var r=[],s=e;s;)r.push(s),s=s.next;return r},subscribe:function(r){var s=!0,o=t={callback:r,next:null,prev:t};return o.prev?o.prev.next=o:e=o,function(){!s||e===null||(s=!1,o.next?o.next.prev=o.prev:t=o.prev,o.prev?o.prev.next=o.next:e=o.next)}}}}var yc={notify:function(){},get:function(){return[]}};function Mu(i,e){var t,n=yc;function r(p){return l(),n.subscribe(p)}function s(){n.notify()}function o(){u.onStateChange&&u.onStateChange()}function a(){return!!t}function l(){t||(t=e?e.addNestedSub(o):i.subscribe(o),n=$x())}function c(){t&&(t(),t=void 0,n.clear(),n=yc)}var u={addNestedSub:r,notifyNestedSubs:s,handleChangeWrapper:o,isSubscribed:a,trySubscribe:l,tryUnsubscribe:c,getListeners:function(){return n}};return u}var ku=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?D.useLayoutEffect:D.useEffect;function Wx(i){var e=i.store,t=i.context,n=i.children,r=D.useMemo(function(){var a=Mu(e);return{store:e,subscription:a}},[e]),s=D.useMemo(function(){return e.getState()},[e]);ku(function(){var a=r.subscription;return a.onStateChange=a.notifyNestedSubs,a.trySubscribe(),s!==e.getState()&&a.notifyNestedSubs(),function(){a.tryUnsubscribe(),a.onStateChange=null}},[r,s]);var o=t||Cu;return ve.createElement(o.Provider,{value:r},n)}var Tu={exports:{}},Re={};/** @license React v16.13.1
* react-is.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var Ye=typeof Symbol=="function"&&Symbol.for,Ho=Ye?Symbol.for("react.element"):60103,qo=Ye?Symbol.for("react.portal"):60106,Xr=Ye?Symbol.for("react.fragment"):60107,Zr=Ye?Symbol.for("react.strict_mode"):60108,Qr=Ye?Symbol.for("react.profiler"):60114,es=Ye?Symbol.for("react.provider"):60109,ts=Ye?Symbol.for("react.context"):60110,Uo=Ye?Symbol.for("react.async_mode"):60111,is=Ye?Symbol.for("react.concurrent_mode"):60111,ns=Ye?Symbol.for("react.forward_ref"):60112,rs=Ye?Symbol.for("react.suspense"):60113,Fx=Ye?Symbol.for("react.suspense_list"):60120,ss=Ye?Symbol.for("react.memo"):60115,os=Ye?Symbol.for("react.lazy"):60116,Lx=Ye?Symbol.for("react.block"):60121,Bx=Ye?Symbol.for("react.fundamental"):60117,Vx=Ye?Symbol.for("react.responder"):60118,zx=Ye?Symbol.for("react.scope"):60119;function pt(i){if(typeof i=="object"&&i!==null){var e=i.$$typeof;switch(e){case Ho:switch(i=i.type,i){case Uo:case is:case Xr:case Qr:case Zr:case rs:return i;default:switch(i=i&&i.$$typeof,i){case ts:case ns:case os:case ss:case es:return i;default:return e}}case qo:return e}}}function Pu(i){return pt(i)===is}Re.AsyncMode=Uo;Re.ConcurrentMode=is;Re.ContextConsumer=ts;Re.ContextProvider=es;Re.Element=Ho;Re.ForwardRef=ns;Re.Fragment=Xr;Re.Lazy=os;Re.Memo=ss;Re.Portal=qo;Re.Profiler=Qr;Re.StrictMode=Zr;Re.Suspense=rs;Re.isAsyncMode=function(i){return Pu(i)||pt(i)===Uo};Re.isConcurrentMode=Pu;Re.isContextConsumer=function(i){return pt(i)===ts};Re.isContextProvider=function(i){return pt(i)===es};Re.isElement=function(i){return typeof i=="object"&&i!==null&&i.$$typeof===Ho};Re.isForwardRef=function(i){return pt(i)===ns};Re.isFragment=function(i){return pt(i)===Xr};Re.isLazy=function(i){return pt(i)===os};Re.isMemo=function(i){return pt(i)===ss};Re.isPortal=function(i){return pt(i)===qo};Re.isProfiler=function(i){return pt(i)===Qr};Re.isStrictMode=function(i){return pt(i)===Zr};Re.isSuspense=function(i){return pt(i)===rs};Re.isValidElementType=function(i){return typeof i=="string"||typeof i=="function"||i===Xr||i===is||i===Qr||i===Zr||i===rs||i===Fx||typeof i=="object"&&i!==null&&(i.$$typeof===os||i.$$typeof===ss||i.$$typeof===es||i.$$typeof===ts||i.$$typeof===ns||i.$$typeof===Bx||i.$$typeof===Vx||i.$$typeof===zx||i.$$typeof===Lx)};Re.typeOf=pt;Tu.exports=Re;var Hx=Tu.exports,Yo=Hx,qx={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},Ux={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},Yx={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},Ou={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},Go={};Go[Yo.ForwardRef]=Yx;Go[Yo.Memo]=Ou;function bc(i){return Yo.isMemo(i)?Ou:Go[i.$$typeof]||qx}var Gx=Object.defineProperty,Jx=Object.getOwnPropertyNames,wc=Object.getOwnPropertySymbols,Kx=Object.getOwnPropertyDescriptor,Xx=Object.getPrototypeOf,Dc=Object.prototype;function ju(i,e,t){if(typeof e!="string"){if(Dc){var n=Xx(e);n&&n!==Dc&&ju(i,n,t)}var r=Jx(e);wc&&(r=r.concat(wc(e)));for(var s=bc(i),o=bc(e),a=0;a<r.length;++a){var l=r[a];if(!Ux[l]&&!(t&&t[l])&&!(o&&o[l])&&!(s&&s[l])){var c=Kx(e,l);try{Gx(i,l,c)}catch{}}}}return i}var Zx=ju;const Sc=Jt(Zx);var Eu={exports:{}},Ne={};/** @license React v17.0.2
* react-is.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var as=60103,ls=60106,An=60107,Nn=60108,$n=60114,Wn=60109,Fn=60110,Ln=60112,Bn=60113,Jo=60120,Vn=60115,zn=60116,Ru=60121,Au=60122,Nu=60117,$u=60129,Wu=60131;if(typeof Symbol=="function"&&Symbol.for){var Ge=Symbol.for;as=Ge("react.element"),ls=Ge("react.portal"),An=Ge("react.fragment"),Nn=Ge("react.strict_mode"),$n=Ge("react.profiler"),Wn=Ge("react.provider"),Fn=Ge("react.context"),Ln=Ge("react.forward_ref"),Bn=Ge("react.suspense"),Jo=Ge("react.suspense_list"),Vn=Ge("react.memo"),zn=Ge("react.lazy"),Ru=Ge("react.block"),Au=Ge("react.server.block"),Nu=Ge("react.fundamental"),$u=Ge("react.debug_trace_mode"),Wu=Ge("react.legacy_hidden")}function Pt(i){if(typeof i=="object"&&i!==null){var e=i.$$typeof;switch(e){case as:switch(i=i.type,i){case An:case $n:case Nn:case Bn:case Jo:return i;default:switch(i=i&&i.$$typeof,i){case Fn:case Ln:case zn:case Vn:case Wn:return i;default:return e}}case ls:return e}}}var Qx=Wn,ey=as,ty=Ln,iy=An,ny=zn,ry=Vn,sy=ls,oy=$n,ay=Nn,ly=Bn;Ne.ContextConsumer=Fn;Ne.ContextProvider=Qx;Ne.Element=ey;Ne.ForwardRef=ty;Ne.Fragment=iy;Ne.Lazy=ny;Ne.Memo=ry;Ne.Portal=sy;Ne.Profiler=oy;Ne.StrictMode=ay;Ne.Suspense=ly;Ne.isAsyncMode=function(){return!1};Ne.isConcurrentMode=function(){return!1};Ne.isContextConsumer=function(i){return Pt(i)===Fn};Ne.isContextProvider=function(i){return Pt(i)===Wn};Ne.isElement=function(i){return typeof i=="object"&&i!==null&&i.$$typeof===as};Ne.isForwardRef=function(i){return Pt(i)===Ln};Ne.isFragment=function(i){return Pt(i)===An};Ne.isLazy=function(i){return Pt(i)===zn};Ne.isMemo=function(i){return Pt(i)===Vn};Ne.isPortal=function(i){return Pt(i)===ls};Ne.isProfiler=function(i){return Pt(i)===$n};Ne.isStrictMode=function(i){return Pt(i)===Nn};Ne.isSuspense=function(i){return Pt(i)===Bn};Ne.isValidElementType=function(i){return typeof i=="string"||typeof i=="function"||i===An||i===$n||i===$u||i===Nn||i===Bn||i===Jo||i===Wu||typeof i=="object"&&i!==null&&(i.$$typeof===zn||i.$$typeof===Vn||i.$$typeof===Wn||i.$$typeof===Fn||i.$$typeof===Ln||i.$$typeof===Nu||i.$$typeof===Ru||i[0]===Au)};Ne.typeOf=Pt;Eu.exports=Ne;var cy=Eu.exports,dy=["getDisplayName","methodName","renderCountProp","shouldHandleStateChanges","storeKey","withRef","forwardRef","context"],uy=["reactReduxForwardedRef"],py=[],hy=[null,null];function fy(i,e){var t=i[1];return[e.payload,t+1]}function Ic(i,e,t){ku(function(){return i.apply(void 0,e)},t)}function my(i,e,t,n,r,s,o){i.current=n,e.current=r,t.current=!1,s.current&&(s.current=null,o())}function gy(i,e,t,n,r,s,o,a,l,c){if(i){var u=!1,p=null,d=function(){if(!u){var v=e.getState(),g,x;try{g=n(v,r.current)}catch(y){x=y,p=y}x||(p=null),g===s.current?o.current||l():(s.current=g,a.current=g,o.current=!0,c({type:"STORE_UPDATED",payload:{error:x}}))}};t.onStateChange=d,t.trySubscribe(),d();var f=function(){if(u=!0,t.tryUnsubscribe(),t.onStateChange=null,p)throw p};return f}}var vy=function(){return[null,0]};function xy(i,e){e===void 0&&(e={});var t=e,n=t.getDisplayName,r=n===void 0?function(w){return"ConnectAdvanced("+w+")"}:n,s=t.methodName,o=s===void 0?"connectAdvanced":s,a=t.renderCountProp,l=a===void 0?void 0:a,c=t.shouldHandleStateChanges,u=c===void 0?!0:c,p=t.storeKey,d=p===void 0?"store":p;t.withRef;var f=t.forwardRef,m=f===void 0?!1:f,v=t.context,g=v===void 0?Cu:v,x=me(t,dy),y=g;return function(S){var M=S.displayName||S.name||"Component",b=r(M),I=_({},x,{getDisplayName:r,methodName:o,renderCountProp:l,shouldHandleStateChanges:u,storeKey:d,displayName:b,wrappedComponentName:M,WrappedComponent:S}),P=x.pure;function E(j){return i(j.dispatch,I)}var A=P?D.useMemo:function(j){return j()};function T(j){var O=D.useMemo(function(){var te=j.reactReduxForwardedRef,de=me(j,uy);return[j.context,te,de]},[j]),R=O[0],B=O[1],$=O[2],J=D.useMemo(function(){return R&&R.Consumer&&cy.isContextConsumer(ve.createElement(R.Consumer,null))?R:y},[R,y]),q=D.useContext(J),L=!!j.store&&!!j.store.getState&&!!j.store.dispatch;q&&q.store;var Q=L?j.store:q.store,G=D.useMemo(function(){return E(Q)},[Q]),ne=D.useMemo(function(){if(!u)return hy;var te=Mu(Q,L?null:q.subscription),de=te.notifyNestedSubs.bind(te);return[te,de]},[Q,L,q]),U=ne[0],re=ne[1],ie=D.useMemo(function(){return L?q:_({},q,{subscription:U})},[L,q,U]),Y=D.useReducer(fy,py,vy),K=Y[0],se=K[0],ae=Y[1];if(se&&se.error)throw se.error;var oe=D.useRef(),V=D.useRef($),z=D.useRef(),Z=D.useRef(!1),X=A(function(){return z.current&&$===V.current?z.current:G(Q.getState(),$)},[Q,se,$]);Ic(my,[V,oe,Z,$,X,z,re]),Ic(gy,[u,Q,U,G,V,oe,Z,z,re,ae],[Q,U,G]);var H=D.useMemo(function(){return ve.createElement(S,_({},X,{ref:B}))},[B,S,X]),ee=D.useMemo(function(){return u?ve.createElement(J.Provider,{value:ie},H):H},[J,H,ie]);return ee}var W=P?ve.memo(T):T;if(W.WrappedComponent=S,W.displayName=T.displayName=b,m){var F=ve.forwardRef(function(O,R){return ve.createElement(W,_({},O,{reactReduxForwardedRef:R}))});return F.displayName=b,F.WrappedComponent=S,Sc(F,S)}return Sc(W,S)}}function Cc(i,e){return i===e?i!==0||e!==0||1/i===1/e:i!==i&&e!==e}function Ns(i,e){if(Cc(i,e))return!0;if(typeof i!="object"||i===null||typeof e!="object"||e===null)return!1;var t=Object.keys(i),n=Object.keys(e);if(t.length!==n.length)return!1;for(var r=0;r<t.length;r++)if(!Object.prototype.hasOwnProperty.call(e,t[r])||!Cc(i[t[r]],e[t[r]]))return!1;return!0}function yy(i,e){var t={},n=function(o){var a=i[o];typeof a=="function"&&(t[o]=function(){return e(a.apply(void 0,arguments))})};for(var r in i)n(r);return t}function Ko(i){return function(t,n){var r=i(t,n);function s(){return r}return s.dependsOnOwnProps=!1,s}}function _c(i){return i.dependsOnOwnProps!==null&&i.dependsOnOwnProps!==void 0?!!i.dependsOnOwnProps:i.length!==1}function Fu(i,e){return function(n,r){r.displayName;var s=function(a,l){return s.dependsOnOwnProps?s.mapToProps(a,l):s.mapToProps(a)};return s.dependsOnOwnProps=!0,s.mapToProps=function(a,l){s.mapToProps=i,s.dependsOnOwnProps=_c(i);var c=s(a,l);return typeof c=="function"&&(s.mapToProps=c,s.dependsOnOwnProps=_c(c),c=s(a,l)),c},s}}function by(i){return typeof i=="function"?Fu(i):void 0}function wy(i){return i?void 0:Ko(function(e){return{dispatch:e}})}function Dy(i){return i&&typeof i=="object"?Ko(function(e){return yy(i,e)}):void 0}const Sy=[by,wy,Dy];function Iy(i){return typeof i=="function"?Fu(i):void 0}function Cy(i){return i?void 0:Ko(function(){return{}})}const _y=[Iy,Cy];function My(i,e,t){return _({},t,i,e)}function ky(i){return function(t,n){n.displayName;var r=n.pure,s=n.areMergedPropsEqual,o=!1,a;return function(c,u,p){var d=i(c,u,p);return o?(!r||!s(d,a))&&(a=d):(o=!0,a=d),a}}}function Ty(i){return typeof i=="function"?ky(i):void 0}function Py(i){return i?void 0:function(){return My}}const Oy=[Ty,Py];var jy=["initMapStateToProps","initMapDispatchToProps","initMergeProps"];function Ey(i,e,t,n){return function(s,o){return t(i(s,o),e(n,o),o)}}function Ry(i,e,t,n,r){var s=r.areStatesEqual,o=r.areOwnPropsEqual,a=r.areStatePropsEqual,l=!1,c,u,p,d,f;function m(w,S){return c=w,u=S,p=i(c,u),d=e(n,u),f=t(p,d,u),l=!0,f}function v(){return p=i(c,u),e.dependsOnOwnProps&&(d=e(n,u)),f=t(p,d,u),f}function g(){return i.dependsOnOwnProps&&(p=i(c,u)),e.dependsOnOwnProps&&(d=e(n,u)),f=t(p,d,u),f}function x(){var w=i(c,u),S=!a(w,p);return p=w,S&&(f=t(p,d,u)),f}function y(w,S){var M=!o(S,u),b=!s(w,c,S,u);return c=w,u=S,M&&b?v():M?g():b?x():f}return function(S,M){return l?y(S,M):m(S,M)}}function Ay(i,e){var t=e.initMapStateToProps,n=e.initMapDispatchToProps,r=e.initMergeProps,s=me(e,jy),o=t(i,s),a=n(i,s),l=r(i,s),c=s.pure?Ry:Ey;return c(o,a,l,i,s)}var Ny=["pure","areStatesEqual","areOwnPropsEqual","areStatePropsEqual","areMergedPropsEqual"];function $s(i,e,t){for(var n=e.length-1;n>=0;n--){var r=e[n](i);if(r)return r}return function(s,o){throw new Error("Invalid value of type "+typeof i+" for "+t+" argument when connecting component "+o.wrappedComponentName+".")}}function $y(i,e){return i===e}function Wy(i){var e=i===void 0?{}:i,t=e.connectHOC,n=t===void 0?xy:t,r=e.mapStateToPropsFactories,s=r===void 0?_y:r,o=e.mapDispatchToPropsFactories,a=o===void 0?Sy:o,l=e.mergePropsFactories,c=l===void 0?Oy:l,u=e.selectorFactory,p=u===void 0?Ay:u;return function(f,m,v,g){g===void 0&&(g={});var x=g,y=x.pure,w=y===void 0?!0:y,S=x.areStatesEqual,M=S===void 0?$y:S,b=x.areOwnPropsEqual,I=b===void 0?Ns:b,P=x.areStatePropsEqual,E=P===void 0?Ns:P,A=x.areMergedPropsEqual,T=A===void 0?Ns:A,W=me(x,Ny),F=$s(f,s,"mapStateToProps"),j=$s(m,a,"mapDispatchToProps"),O=$s(v,c,"mergeProps");return n(p,_({methodName:"connect",getDisplayName:function(B){return"Connect("+B+")"},shouldHandleStateChanges:!!f,initMapStateToProps:F,initMapDispatchToProps:j,initMergeProps:O,pure:w,areStatesEqual:M,areOwnPropsEqual:I,areStatePropsEqual:E,areMergedPropsEqual:T},W))}}const Lu=Wy();Ax(If.unstable_batchedUpdates);function Fy(i,e){if(i.length!==e.length)return!1;for(var t=0;t<i.length;t++)if(i[t]!==e[t])return!1;return!0}function Bu(i,e){var t=D.useState(function(){return{inputs:e,result:i()}})[0],n=D.useRef(!0),r=D.useRef(t),s=n.current||!!(e&&r.current.inputs&&Fy(e,r.current.inputs)),o=s?r.current:{inputs:e,result:i()};return D.useEffect(function(){n.current=!1,r.current=o},[o]),o.result}function Ly(i,e){return Bu(function(){return i},e)}var ke=Bu,ge=Ly,By="Invariant failed";function Vy(i,e){throw new Error(By)}var Mt=function(e){var t=e.top,n=e.right,r=e.bottom,s=e.left,o=n-s,a=r-t,l={top:t,right:n,bottom:r,left:s,width:o,height:a,x:s,y:t,center:{x:(n+s)/2,y:(r+t)/2}};return l},Xo=function(e,t){return{top:e.top-t.top,left:e.left-t.left,bottom:e.bottom+t.bottom,right:e.right+t.right}},Mc=function(e,t){return{top:e.top+t.top,left:e.left+t.left,bottom:e.bottom-t.bottom,right:e.right-t.right}},zy=function(e,t){return{top:e.top+t.y,left:e.left+t.x,bottom:e.bottom+t.y,right:e.right+t.x}},Ws={top:0,right:0,bottom:0,left:0},Zo=function(e){var t=e.borderBox,n=e.margin,r=n===void 0?Ws:n,s=e.border,o=s===void 0?Ws:s,a=e.padding,l=a===void 0?Ws:a,c=Mt(Xo(t,r)),u=Mt(Mc(t,o)),p=Mt(Mc(u,l));return{marginBox:c,borderBox:Mt(t),paddingBox:u,contentBox:p,margin:r,border:o,padding:l}},ft=function(e){var t=e.slice(0,-2),n=e.slice(-2);if(n!=="px")return 0;var r=Number(t);return isNaN(r)&&Vy(),r},Hy=function(){return{x:window.pageXOffset,y:window.pageYOffset}},Cr=function(e,t){var n=e.borderBox,r=e.border,s=e.margin,o=e.padding,a=zy(n,t);return Zo({borderBox:a,border:r,margin:s,padding:o})},_r=function(e,t){return t===void 0&&(t=Hy()),Cr(e,t)},Vu=function(e,t){var n={top:ft(t.marginTop),right:ft(t.marginRight),bottom:ft(t.marginBottom),left:ft(t.marginLeft)},r={top:ft(t.paddingTop),right:ft(t.paddingRight),bottom:ft(t.paddingBottom),left:ft(t.paddingLeft)},s={top:ft(t.borderTopWidth),right:ft(t.borderRightWidth),bottom:ft(t.borderBottomWidth),left:ft(t.borderLeftWidth)};return Zo({borderBox:e,margin:n,padding:r,border:s})},zu=function(e){var t=e.getBoundingClientRect(),n=window.getComputedStyle(e);return Vu(t,n)},kc=Number.isNaN||function(e){return typeof e=="number"&&e!==e};function qy(i,e){return!!(i===e||kc(i)&&kc(e))}function Uy(i,e){if(i.length!==e.length)return!1;for(var t=0;t<i.length;t++)if(!qy(i[t],e[t]))return!1;return!0}function He(i,e){e===void 0&&(e=Uy);var t,n=[],r,s=!1;function o(){for(var a=[],l=0;l<arguments.length;l++)a[l]=arguments[l];return s&&t===this&&e(a,n)||(r=i.apply(this,a),s=!0,t=this,n=a),r}return o}var _n=function(e){var t=[],n=null,r=function(){for(var o=arguments.length,a=new Array(o),l=0;l<o;l++)a[l]=arguments[l];t=a,!n&&(n=requestAnimationFrame(function(){n=null,e.apply(void 0,t)}))};return r.cancel=function(){n&&(cancelAnimationFrame(n),n=null)},r};function Hu(i,e){}Hu.bind(null,"warn");Hu.bind(null,"error");function qt(){}function Yy(i,e){return _({},i,{},e)}function xt(i,e,t){var n=e.map(function(r){var s=Yy(t,r.options);return i.addEventListener(r.eventName,r.fn,s),function(){i.removeEventListener(r.eventName,r.fn,s)}});return function(){n.forEach(function(s){s()})}}var Gy="Invariant failed";function Mr(i){this.message=i}Mr.prototype.toString=function(){return this.message};function le(i,e){throw new Mr(Gy)}var Jy=function(i){Mo(e,i);function e(){for(var n,r=arguments.length,s=new Array(r),o=0;o<r;o++)s[o]=arguments[o];return n=i.call.apply(i,[this].concat(s))||this,n.callbacks=null,n.unbind=qt,n.onWindowError=function(a){var l=n.getCallbacks();l.isDragging()&&l.tryAbort();var c=a.error;c instanceof Mr&&a.preventDefault()},n.getCallbacks=function(){if(!n.callbacks)throw new Error("Unable to find AppCallbacks in <ErrorBoundary/>");return n.callbacks},n.setCallbacks=function(a){n.callbacks=a},n}var t=e.prototype;return t.componentDidMount=function(){this.unbind=xt(window,[{eventName:"error",fn:this.onWindowError}])},t.componentDidCatch=function(r){if(r instanceof Mr){this.setState({});return}throw r},t.componentWillUnmount=function(){this.unbind()},t.render=function(){return this.props.children(this.setCallbacks)},e}(ve.Component),Ky=`
Press space bar to start a drag.
When dragging you can use the arrow keys to move the item around and escape to cancel.
Some screen readers may require you to be in focus mode or to use your pass through key
`,kr=function(e){return e+1},Xy=function(e){return`
You have lifted an item in position `+kr(e.source.index)+`
`},qu=function(e,t){var n=e.droppableId===t.droppableId,r=kr(e.index),s=kr(t.index);return n?`
You have moved the item from position `+r+`
to position `+s+`
`:`
You have moved the item from position `+r+`
in list `+e.droppableId+`
to list `+t.droppableId+`
in position `+s+`
`},Uu=function(e,t,n){var r=t.droppableId===n.droppableId;return r?`
The item `+e+`
has been combined with `+n.draggableId:`
The item `+e+`
in list `+t.droppableId+`
has been combined with `+n.draggableId+`
in list `+n.droppableId+`
`},Zy=function(e){var t=e.destination;if(t)return qu(e.source,t);var n=e.combine;return n?Uu(e.draggableId,e.source,n):"You are over an area that cannot be dropped on"},Tc=function(e){return`
The item has returned to its starting position
of `+kr(e.index)+`
`},Qy=function(e){if(e.reason==="CANCEL")return`
Movement cancelled.
`+Tc(e.source)+`
`;var t=e.destination,n=e.combine;return t?`
You have dropped the item.
`+qu(e.source,t)+`
`:n?`
You have dropped the item.
`+Uu(e.draggableId,e.source,n)+`
`:`
The item has been dropped while not over a drop area.
`+Tc(e.source)+`
`},hr={dragHandleUsageInstructions:Ky,onDragStart:Xy,onDragUpdate:Zy,onDragEnd:Qy},qe={x:0,y:0},Xe=function(e,t){return{x:e.x+t.x,y:e.y+t.y}},at=function(e,t){return{x:e.x-t.x,y:e.y-t.y}},Ut=function(e,t){return e.x===t.x&&e.y===t.y},Yi=function(e){return{x:e.x!==0?-e.x:0,y:e.y!==0?-e.y:0}},xi=function(e,t,n){var r;return n===void 0&&(n=0),r={},r[e]=t,r[e==="x"?"y":"x"]=n,r},Mn=function(e,t){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))},Pc=function(e,t){return Math.min.apply(Math,t.map(function(n){return Mn(e,n)}))},Yu=function(e){return function(t){return{x:e(t.x),y:e(t.y)}}},eb=function(i,e){var t=Mt({top:Math.max(e.top,i.top),right:Math.min(e.right,i.right),bottom:Math.min(e.bottom,i.bottom),left:Math.max(e.left,i.left)});return t.width<=0||t.height<=0?null:t},Hn=function(e,t){return{top:e.top+t.y,left:e.left+t.x,bottom:e.bottom+t.y,right:e.right+t.x}},Oc=function(e){return[{x:e.left,y:e.top},{x:e.right,y:e.top},{x:e.left,y:e.bottom},{x:e.right,y:e.bottom}]},tb={top:0,right:0,bottom:0,left:0},ib=function(e,t){return t?Hn(e,t.scroll.diff.displacement):e},nb=function(e,t,n){if(n&&n.increasedBy){var r;return _({},e,(r={},r[t.end]=e[t.end]+n.increasedBy[t.line],r))}return e},rb=function(e,t){return t&&t.shouldClipSubject?eb(t.pageMarginBox,e):Mt(e)},Fi=function(i){var e=i.page,t=i.withPlaceholder,n=i.axis,r=i.frame,s=ib(e.marginBox,r),o=nb(s,n,t),a=rb(o,r);return{page:e,withPlaceholder:t,active:a}},Qo=function(i,e){i.frame||le();var t=i.frame,n=at(e,t.scroll.initial),r=Yi(n),s=_({},t,{scroll:{initial:t.scroll.initial,current:e,diff:{value:n,displacement:r},max:t.scroll.max}}),o=Fi({page:i.subject.page,withPlaceholder:i.subject.withPlaceholder,axis:i.axis,frame:s}),a=_({},i,{frame:s,subject:o});return a};function Tr(i){return Object.values?Object.values(i):Object.keys(i).map(function(e){return i[e]})}function ea(i,e){if(i.findIndex)return i.findIndex(e);for(var t=0;t<i.length;t++)if(e(i[t]))return t;return-1}function Zt(i,e){if(i.find)return i.find(e);var t=ea(i,e);if(t!==-1)return i[t]}function Gu(i){return Array.prototype.slice.call(i)}var Ju=He(function(i){return i.reduce(function(e,t){return e[t.descriptor.id]=t,e},{})}),Ku=He(function(i){return i.reduce(function(e,t){return e[t.descriptor.id]=t,e},{})}),cs=He(function(i){return Tr(i)}),sb=He(function(i){return Tr(i)}),Gi=He(function(i,e){var t=sb(e).filter(function(n){return i===n.descriptor.droppableId}).sort(function(n,r){return n.descriptor.index-r.descriptor.index});return t});function ta(i){return i.at&&i.at.type==="REORDER"?i.at.destination:null}function ds(i){return i.at&&i.at.type==="COMBINE"?i.at.combine:null}var us=He(function(i,e){return e.filter(function(t){return t.descriptor.id!==i.descriptor.id})}),ob=function(i){var e=i.isMovingForward,t=i.draggable,n=i.destination,r=i.insideDestination,s=i.previousImpact;if(!n.isCombineEnabled)return null;var o=ta(s);if(!o)return null;function a(v){var g={type:"COMBINE",combine:{draggableId:v,droppableId:n.descriptor.id}};return _({},s,{at:g})}var l=s.displaced.all,c=l.length?l[0]:null;if(e)return c?a(c):null;var u=us(t,r);if(!c){if(!u.length)return null;var p=u[u.length-1];return a(p.descriptor.id)}var d=ea(u,function(v){return v.descriptor.id===c});d===-1&&le();var f=d-1;if(f<0)return null;var m=u[f];return a(m.descriptor.id)},Ji=function(i,e){return i.descriptor.droppableId===e.descriptor.id},Xu={point:qe,value:0},kn={invisible:{},visible:{},all:[]},ab={displaced:kn,displacedBy:Xu,at:null},yt=function(i,e){return function(t){return i<=t&&t<=e}},Zu=function(i){var e=yt(i.top,i.bottom),t=yt(i.left,i.right);return function(n){var r=e(n.top)&&e(n.bottom)&&t(n.left)&&t(n.right);if(r)return!0;var s=e(n.top)||e(n.bottom),o=t(n.left)||t(n.right),a=s&&o;if(a)return!0;var l=n.top<i.top&&n.bottom>i.bottom,c=n.left<i.left&&n.right>i.right,u=l&&c;if(u)return!0;var p=l&&o||c&&s;return p}},lb=function(i){var e=yt(i.top,i.bottom),t=yt(i.left,i.right);return function(n){var r=e(n.top)&&e(n.bottom)&&t(n.left)&&t(n.right);return r}},ia={direction:"vertical",line:"y",crossAxisLine:"x",start:"top",end:"bottom",size:"height",crossAxisStart:"left",crossAxisEnd:"right",crossAxisSize:"width"},Qu={direction:"horizontal",line:"x",crossAxisLine:"y",start:"left",end:"right",size:"width",crossAxisStart:"top",crossAxisEnd:"bottom",crossAxisSize:"height"},cb=function(i){return function(e){var t=yt(e.top,e.bottom),n=yt(e.left,e.right);return function(r){return i===ia?t(r.top)&&t(r.bottom):n(r.left)&&n(r.right)}}},db=function(e,t){var n=t.frame?t.frame.scroll.diff.displacement:qe;return Hn(e,n)},ub=function(e,t,n){return t.subject.active?n(t.subject.active)(e):!1},pb=function(e,t,n){return n(t)(e)},na=function(e){var t=e.target,n=e.destination,r=e.viewport,s=e.withDroppableDisplacement,o=e.isVisibleThroughFrameFn,a=s?db(t,n):t;return ub(a,n,o)&&pb(a,r,o)},hb=function(e){return na(_({},e,{isVisibleThroughFrameFn:Zu}))},ep=function(e){return na(_({},e,{isVisibleThroughFrameFn:lb}))},fb=function(e){return na(_({},e,{isVisibleThroughFrameFn:cb(e.destination.axis)}))},mb=function(e,t,n){if(typeof n=="boolean")return n;if(!t)return!0;var r=t.invisible,s=t.visible;if(r[e])return!1;var o=s[e];return o?o.shouldAnimate:!0};function gb(i,e){var t=i.page.marginBox,n={top:e.point.y,right:0,bottom:0,left:e.point.x};return Mt(Xo(t,n))}function Tn(i){var e=i.afterDragging,t=i.destination,n=i.displacedBy,r=i.viewport,s=i.forceShouldAnimate,o=i.last;return e.reduce(function(l,c){var u=gb(c,n),p=c.descriptor.id;l.all.push(p);var d=hb({target:u,destination:t,viewport:r,withDroppableDisplacement:!0});if(!d)return l.invisible[c.descriptor.id]=!0,l;var f=mb(p,o,s),m={draggableId:p,shouldAnimate:f};return l.visible[p]=m,l},{all:[],visible:{},invisible:{}})}function vb(i,e){if(!i.length)return 0;var t=i[i.length-1].descriptor.index;return e.inHomeList?t:t+1}function jc(i){var e=i.insideDestination,t=i.inHomeList,n=i.displacedBy,r=i.destination,s=vb(e,{inHomeList:t});return{displaced:kn,displacedBy:n,at:{type:"REORDER",destination:{droppableId:r.descriptor.id,index:s}}}}function Pr(i){var e=i.draggable,t=i.insideDestination,n=i.destination,r=i.viewport,s=i.displacedBy,o=i.last,a=i.index,l=i.forceShouldAnimate,c=Ji(e,n);if(a==null)return jc({insideDestination:t,inHomeList:c,displacedBy:s,destination:n});var u=Zt(t,function(v){return v.descriptor.index===a});if(!u)return jc({insideDestination:t,inHomeList:c,displacedBy:s,destination:n});var p=us(e,t),d=t.indexOf(u),f=p.slice(d),m=Tn({afterDragging:f,destination:n,displacedBy:s,last:o,viewport:r.frame,forceShouldAnimate:l});return{displaced:m,displacedBy:s,at:{type:"REORDER",destination:{droppableId:n.descriptor.id,index:a}}}}function Gt(i,e){return!!e.effected[i]}var xb=function(i){var e=i.isMovingForward,t=i.destination,n=i.draggables,r=i.combine,s=i.afterCritical;if(!t.isCombineEnabled)return null;var o=r.draggableId,a=n[o],l=a.descriptor.index,c=Gt(o,s);return c?e?l:l-1:e?l+1:l},yb=function(i){var e=i.isMovingForward,t=i.isInHomeList,n=i.insideDestination,r=i.location;if(!n.length)return null;var s=r.index,o=e?s+1:s-1,a=n[0].descriptor.index,l=n[n.length-1].descriptor.index,c=t?l:l+1;return o<a||o>c?null:o},bb=function(i){var e=i.isMovingForward,t=i.isInHomeList,n=i.draggable,r=i.draggables,s=i.destination,o=i.insideDestination,a=i.previousImpact,l=i.viewport,c=i.afterCritical,u=a.at;if(u||le(),u.type==="REORDER"){var p=yb({isMovingForward:e,isInHomeList:t,location:u.destination,insideDestination:o});return p==null?null:Pr({draggable:n,insideDestination:o,destination:s,viewport:l,last:a.displaced,displacedBy:a.displacedBy,index:p})}var d=xb({isMovingForward:e,destination:s,displaced:a.displaced,draggables:r,combine:u.combine,afterCritical:c});return d==null?null:Pr({draggable:n,insideDestination:o,destination:s,viewport:l,last:a.displaced,displacedBy:a.displacedBy,index:d})},wb=function(i){var e=i.displaced,t=i.afterCritical,n=i.combineWith,r=i.displacedBy,s=!!(e.visible[n]||e.invisible[n]);return Gt(n,t)?s?qe:Yi(r.point):s?r.point:qe},Db=function(i){var e=i.afterCritical,t=i.impact,n=i.draggables,r=ds(t);r||le();var s=r.draggableId,o=n[s].page.borderBox.center,a=wb({displaced:t.displaced,afterCritical:e,combineWith:s,displacedBy:t.displacedBy});return Xe(o,a)},tp=function(e,t){return t.margin[e.start]+t.borderBox[e.size]/2},Sb=function(e,t){return t.margin[e.end]+t.borderBox[e.size]/2},ra=function(e,t,n){return t[e.crossAxisStart]+n.margin[e.crossAxisStart]+n.borderBox[e.crossAxisSize]/2},Ec=function(e){var t=e.axis,n=e.moveRelativeTo,r=e.isMoving;return xi(t.line,n.marginBox[t.end]+tp(t,r),ra(t,n.marginBox,r))},Rc=function(e){var t=e.axis,n=e.moveRelativeTo,r=e.isMoving;return xi(t.line,n.marginBox[t.start]-Sb(t,r),ra(t,n.marginBox,r))},Ib=function(e){var t=e.axis,n=e.moveInto,r=e.isMoving;return xi(t.line,n.contentBox[t.start]+tp(t,r),ra(t,n.contentBox,r))},Cb=function(i){var e=i.impact,t=i.draggable,n=i.draggables,r=i.droppable,s=i.afterCritical,o=Gi(r.descriptor.id,n),a=t.page,l=r.axis;if(!o.length)return Ib({axis:l,moveInto:r.page,isMoving:a});var c=e.displaced,u=e.displacedBy,p=c.all[0];if(p){var d=n[p];if(Gt(p,s))return Rc({axis:l,moveRelativeTo:d.page,isMoving:a});var f=Cr(d.page,u.point);return Rc({axis:l,moveRelativeTo:f,isMoving:a})}var m=o[o.length-1];if(m.descriptor.id===t.descriptor.id)return a.borderBox.center;if(Gt(m.descriptor.id,s)){var v=Cr(m.page,Yi(s.displacedBy.point));return Ec({axis:l,moveRelativeTo:v,isMoving:a})}return Ec({axis:l,moveRelativeTo:m.page,isMoving:a})},vo=function(i,e){var t=i.frame;return t?Xe(e,t.scroll.diff.displacement):e},_b=function(e){var t=e.impact,n=e.draggable,r=e.droppable,s=e.draggables,o=e.afterCritical,a=n.page.borderBox.center,l=t.at;return!r||!l?a:l.type==="REORDER"?Cb({impact:t,draggable:n,draggables:s,droppable:r,afterCritical:o}):Db({impact:t,draggables:s,afterCritical:o})},ps=function(i){var e=_b(i),t=i.droppable,n=t?vo(t,e):e;return n},ip=function(i,e){var t=at(e,i.scroll.initial),n=Yi(t),r=Mt({top:e.y,bottom:e.y+i.frame.height,left:e.x,right:e.x+i.frame.width}),s={frame:r,scroll:{initial:i.scroll.initial,max:i.scroll.max,current:e,diff:{value:t,displacement:n}}};return s};function Ac(i,e){return i.map(function(t){return e[t]})}function Mb(i,e){for(var t=0;t<e.length;t++){var n=e[t].visible[i];if(n)return n}return null}var kb=function(i){var e=i.impact,t=i.viewport,n=i.destination,r=i.draggables,s=i.maxScrollChange,o=ip(t,Xe(t.scroll.current,s)),a=n.frame?Qo(n,Xe(n.frame.scroll.current,s)):n,l=e.displaced,c=Tn({afterDragging:Ac(l.all,r),destination:n,displacedBy:e.displacedBy,viewport:o.frame,last:l,forceShouldAnimate:!1}),u=Tn({afterDragging:Ac(l.all,r),destination:a,displacedBy:e.displacedBy,viewport:t.frame,last:l,forceShouldAnimate:!1}),p={},d={},f=[l,c,u];l.all.forEach(function(v){var g=Mb(v,f);if(g){d[v]=g;return}p[v]=!0});var m=_({},e,{displaced:{all:l.all,invisible:p,visible:d}});return m},Tb=function(i,e){return Xe(i.scroll.diff.displacement,e)},sa=function(i){var e=i.pageBorderBoxCenter,t=i.draggable,n=i.viewport,r=Tb(n,e),s=at(r,t.page.borderBox.center);return Xe(t.client.borderBox.center,s)},np=function(i){var e=i.draggable,t=i.destination,n=i.newPageBorderBoxCenter,r=i.viewport,s=i.withDroppableDisplacement,o=i.onlyOnMainAxis,a=o===void 0?!1:o,l=at(n,e.page.borderBox.center),c=Hn(e.page.borderBox,l),u={target:c,destination:t,withDroppableDisplacement:s,viewport:r};return a?fb(u):ep(u)},Pb=function(i){var e=i.isMovingForward,t=i.draggable,n=i.destination,r=i.draggables,s=i.previousImpact,o=i.viewport,a=i.previousPageBorderBoxCenter,l=i.previousClientSelection,c=i.afterCritical;if(!n.isEnabled)return null;var u=Gi(n.descriptor.id,r),p=Ji(t,n),d=ob({isMovingForward:e,draggable:t,destination:n,insideDestination:u,previousImpact:s})||bb({isMovingForward:e,isInHomeList:p,draggable:t,draggables:r,destination:n,insideDestination:u,previousImpact:s,viewport:o,afterCritical:c});if(!d)return null;var f=ps({impact:d,draggable:t,droppable:n,draggables:r,afterCritical:c}),m=np({draggable:t,destination:n,newPageBorderBoxCenter:f,viewport:o.frame,withDroppableDisplacement:!1,onlyOnMainAxis:!0});if(m){var v=sa({pageBorderBoxCenter:f,draggable:t,viewport:o});return{clientSelection:v,impact:d,scrollJumpRequest:null}}var g=at(f,a),x=kb({impact:d,viewport:o,destination:n,draggables:r,maxScrollChange:g});return{clientSelection:l,impact:x,scrollJumpRequest:g}},et=function(e){var t=e.subject.active;return t||le(),t},Ob=function(i){var e=i.isMovingForward,t=i.pageBorderBoxCenter,n=i.source,r=i.droppables,s=i.viewport,o=n.subject.active;if(!o)return null;var a=n.axis,l=yt(o[a.start],o[a.end]),c=cs(r).filter(function(p){return p!==n}).filter(function(p){return p.isEnabled}).filter(function(p){return!!p.subject.active}).filter(function(p){return Zu(s.frame)(et(p))}).filter(function(p){var d=et(p);return e?o[a.crossAxisEnd]<d[a.crossAxisEnd]:d[a.crossAxisStart]<o[a.crossAxisStart]}).filter(function(p){var d=et(p),f=yt(d[a.start],d[a.end]);return l(d[a.start])||l(d[a.end])||f(o[a.start])||f(o[a.end])}).sort(function(p,d){var f=et(p)[a.crossAxisStart],m=et(d)[a.crossAxisStart];return e?f-m:m-f}).filter(function(p,d,f){return et(p)[a.crossAxisStart]===et(f[0])[a.crossAxisStart]});if(!c.length)return null;if(c.length===1)return c[0];var u=c.filter(function(p){var d=yt(et(p)[a.start],et(p)[a.end]);return d(t[a.line])});return u.length===1?u[0]:u.length>1?u.sort(function(p,d){return et(p)[a.start]-et(d)[a.start]})[0]:c.sort(function(p,d){var f=Pc(t,Oc(et(p))),m=Pc(t,Oc(et(d)));return f!==m?f-m:et(p)[a.start]-et(d)[a.start]})[0]},Nc=function(e,t){var n=e.page.borderBox.center;return Gt(e.descriptor.id,t)?at(n,t.displacedBy.point):n},jb=function(e,t){var n=e.page.borderBox;return Gt(e.descriptor.id,t)?Hn(n,Yi(t.displacedBy.point)):n},Eb=function(i){var e=i.pageBorderBoxCenter,t=i.viewport,n=i.destination,r=i.insideDestination,s=i.afterCritical,o=r.filter(function(a){return ep({target:jb(a,s),destination:n,viewport:t.frame,withDroppableDisplacement:!0})}).sort(function(a,l){var c=Mn(e,vo(n,Nc(a,s))),u=Mn(e,vo(n,Nc(l,s)));return c<u?-1:u<c?1:a.descriptor.index-l.descriptor.index});return o[0]||null},qn=He(function(e,t){var n=t[e.line];return{value:n,point:xi(e.line,n)}}),Rb=function(e,t,n){var r=e.axis;if(e.descriptor.mode==="virtual")return xi(r.line,t[r.line]);var s=e.subject.page.contentBox[r.size],o=Gi(e.descriptor.id,n),a=o.reduce(function(u,p){return u+p.client.marginBox[r.size]},0),l=a+t[r.line],c=l-s;return c<=0?null:xi(r.line,c)},rp=function(e,t){return _({},e,{scroll:_({},e.scroll,{max:t})})},sp=function(e,t,n){var r=e.frame;Ji(t,e)&&le(),e.subject.withPlaceholder&&le();var s=qn(e.axis,t.displaceBy).point,o=Rb(e,s,n),a={placeholderSize:s,increasedBy:o,oldFrameMaxScroll:e.frame?e.frame.scroll.max:null};if(!r){var l=Fi({page:e.subject.page,withPlaceholder:a,axis:e.axis,frame:e.frame});return _({},e,{subject:l})}var c=o?Xe(r.scroll.max,o):r.scroll.max,u=rp(r,c),p=Fi({page:e.subject.page,withPlaceholder:a,axis:e.axis,frame:u});return _({},e,{subject:p,frame:u})},Ab=function(e){var t=e.subject.withPlaceholder;t||le();var n=e.frame;if(!n){var r=Fi({page:e.subject.page,axis:e.axis,frame:null,withPlaceholder:null});return _({},e,{subject:r})}var s=t.oldFrameMaxScroll;s||le();var o=rp(n,s),a=Fi({page:e.subject.page,axis:e.axis,frame:o,withPlaceholder:null});return _({},e,{subject:a,frame:o})},Nb=function(i){var e=i.previousPageBorderBoxCenter,t=i.moveRelativeTo,n=i.insideDestination,r=i.draggable,s=i.draggables,o=i.destination,a=i.viewport,l=i.afterCritical;if(!t){if(n.length)return null;var c={displaced:kn,displacedBy:Xu,at:{type:"REORDER",destination:{droppableId:o.descriptor.id,index:0}}},u=ps({impact:c,draggable:r,droppable:o,draggables:s,afterCritical:l}),p=Ji(r,o)?o:sp(o,r,s),d=np({draggable:r,destination:p,newPageBorderBoxCenter:u,viewport:a.frame,withDroppableDisplacement:!1,onlyOnMainAxis:!0});return d?c:null}var f=e[o.axis.line]<=t.page.borderBox.center[o.axis.line],m=function(){var g=t.descriptor.index;return t.descriptor.id===r.descriptor.id||f?g:g+1}(),v=qn(o.axis,r.displaceBy);return Pr({draggable:r,insideDestination:n,destination:o,viewport:a,displacedBy:v,last:kn,index:m})},$b=function(i){var e=i.isMovingForward,t=i.previousPageBorderBoxCenter,n=i.draggable,r=i.isOver,s=i.draggables,o=i.droppables,a=i.viewport,l=i.afterCritical,c=Ob({isMovingForward:e,pageBorderBoxCenter:t,source:r,droppables:o,viewport:a});if(!c)return null;var u=Gi(c.descriptor.id,s),p=Eb({pageBorderBoxCenter:t,viewport:a,destination:c,insideDestination:u,afterCritical:l}),d=Nb({previousPageBorderBoxCenter:t,destination:c,draggable:n,draggables:s,moveRelativeTo:p,insideDestination:u,viewport:a,afterCritical:l});if(!d)return null;var f=ps({impact:d,draggable:n,droppable:c,draggables:s,afterCritical:l}),m=sa({pageBorderBoxCenter:f,draggable:n,viewport:a});return{clientSelection:m,impact:d,scrollJumpRequest:null}},lt=function(i){var e=i.at;return e?e.type==="REORDER"?e.destination.droppableId:e.combine.droppableId:null},Wb=function(e,t){var n=lt(e);return n?t[n]:null},Fb=function(i){var e=i.state,t=i.type,n=Wb(e.impact,e.dimensions.droppables),r=!!n,s=e.dimensions.droppables[e.critical.droppable.id],o=n||s,a=o.axis.direction,l=a==="vertical"&&(t==="MOVE_UP"||t==="MOVE_DOWN")||a==="horizontal"&&(t==="MOVE_LEFT"||t==="MOVE_RIGHT");if(l&&!r)return null;var c=t==="MOVE_DOWN"||t==="MOVE_RIGHT",u=e.dimensions.draggables[e.critical.draggable.id],p=e.current.page.borderBoxCenter,d=e.dimensions,f=d.draggables,m=d.droppables;return l?Pb({isMovingForward:c,previousPageBorderBoxCenter:p,draggable:u,destination:o,draggables:f,viewport:e.viewport,previousClientSelection:e.current.client.selection,previousImpact:e.impact,afterCritical:e.afterCritical}):$b({isMovingForward:c,previousPageBorderBoxCenter:p,draggable:u,isOver:o,draggables:f,droppables:m,viewport:e.viewport,afterCritical:e.afterCritical})};function ui(i){return i.phase==="DRAGGING"||i.phase==="COLLECTING"}function op(i){var e=yt(i.top,i.bottom),t=yt(i.left,i.right);return function(r){return e(r.y)&&t(r.x)}}function Lb(i,e){return i.left<e.right&&i.right>e.left&&i.top<e.bottom&&i.bottom>e.top}function Bb(i){var e=i.pageBorderBox,t=i.draggable,n=i.candidates,r=t.page.borderBox.center,s=n.map(function(o){var a=o.axis,l=xi(o.axis.line,e.center[a.line],o.page.borderBox.center[a.crossAxisLine]);return{id:o.descriptor.id,distance:Mn(r,l)}}).sort(function(o,a){return a.distance-o.distance});return s[0]?s[0].id:null}function Vb(i){var e=i.pageBorderBox,t=i.draggable,n=i.droppables,r=cs(n).filter(function(s){if(!s.isEnabled)return!1;var o=s.subject.active;if(!o||!Lb(e,o))return!1;if(op(o)(e.center))return!0;var a=s.axis,l=o.center[a.crossAxisLine],c=e[a.crossAxisStart],u=e[a.crossAxisEnd],p=yt(o[a.crossAxisStart],o[a.crossAxisEnd]),d=p(c),f=p(u);return!d&&!f?!0:d?c<l:u>l});return r.length?r.length===1?r[0].descriptor.id:Bb({pageBorderBox:e,draggable:t,candidates:r}):null}var ap=function(e,t){return Mt(Hn(e,t))},zb=function(i,e){var t=i.frame;return t?ap(e,t.scroll.diff.value):e};function lp(i){var e=i.displaced,t=i.id;return!!(e.visible[t]||e.invisible[t])}function Hb(i){var e=i.draggable,t=i.closest,n=i.inHomeList;return t?n&&t.descriptor.index>e.descriptor.index?t.descriptor.index-1:t.descriptor.index:null}var qb=function(i){var e=i.pageBorderBoxWithDroppableScroll,t=i.draggable,n=i.destination,r=i.insideDestination,s=i.last,o=i.viewport,a=i.afterCritical,l=n.axis,c=qn(n.axis,t.displaceBy),u=c.value,p=e[l.start],d=e[l.end],f=us(t,r),m=Zt(f,function(g){var x=g.descriptor.id,y=g.page.borderBox.center[l.line],w=Gt(x,a),S=lp({displaced:s,id:x});return w?S?d<=y:p<y-u:S?d<=y+u:p<y}),v=Hb({draggable:t,closest:m,inHomeList:Ji(t,n)});return Pr({draggable:t,insideDestination:r,destination:n,viewport:o,last:s,displacedBy:c,index:v})},Ub=4,Yb=function(i){var e=i.draggable,t=i.pageBorderBoxWithDroppableScroll,n=i.previousImpact,r=i.destination,s=i.insideDestination,o=i.afterCritical;if(!r.isCombineEnabled)return null;var a=r.axis,l=qn(r.axis,e.displaceBy),c=l.value,u=t[a.start],p=t[a.end],d=us(e,s),f=Zt(d,function(v){var g=v.descriptor.id,x=v.page.borderBox,y=x[a.size],w=y/Ub,S=Gt(g,o),M=lp({displaced:n.displaced,id:g});return S?M?p>x[a.start]+w&&p<x[a.end]-w:u>x[a.start]-c+w&&u<x[a.end]-c-w:M?p>x[a.start]+c+w&&p<x[a.end]+c-w:u>x[a.start]+w&&u<x[a.end]-w});if(!f)return null;var m={displacedBy:l,displaced:n.displaced,at:{type:"COMBINE",combine:{draggableId:f.descriptor.id,droppableId:r.descriptor.id}}};return m},cp=function(i){var e=i.pageOffset,t=i.draggable,n=i.draggables,r=i.droppables,s=i.previousImpact,o=i.viewport,a=i.afterCritical,l=ap(t.page.borderBox,e),c=Vb({pageBorderBox:l,draggable:t,droppables:r});if(!c)return ab;var u=r[c],p=Gi(u.descriptor.id,n),d=zb(u,l);return Yb({pageBorderBoxWithDroppableScroll:d,draggable:t,previousImpact:s,destination:u,insideDestination:p,afterCritical:a})||qb({pageBorderBoxWithDroppableScroll:d,draggable:t,destination:u,insideDestination:p,last:s.displaced,viewport:o,afterCritical:a})},oa=function(i,e){var t;return _({},i,(t={},t[e.descriptor.id]=e,t))},Gb=function(e){var t=e.previousImpact,n=e.impact,r=e.droppables,s=lt(t),o=lt(n);if(!s||s===o)return r;var a=r[s];if(!a.subject.withPlaceholder)return r;var l=Ab(a);return oa(r,l)},Jb=function(i){var e=i.draggable,t=i.draggables,n=i.droppables,r=i.previousImpact,s=i.impact,o=Gb({previousImpact:r,impact:s,droppables:n}),a=lt(s);if(!a)return o;var l=n[a];if(Ji(e,l)||l.subject.withPlaceholder)return o;var c=sp(l,e,t);return oa(o,c)},mn=function(i){var e=i.state,t=i.clientSelection,n=i.dimensions,r=i.viewport,s=i.impact,o=i.scrollJumpRequest,a=r||e.viewport,l=n||e.dimensions,c=t||e.current.client.selection,u=at(c,e.initial.client.selection),p={offset:u,selection:c,borderBoxCenter:Xe(e.initial.client.borderBoxCenter,u)},d={selection:Xe(p.selection,a.scroll.current),borderBoxCenter:Xe(p.borderBoxCenter,a.scroll.current),offset:Xe(p.offset,a.scroll.diff.value)},f={client:p,page:d};if(e.phase==="COLLECTING")return _({phase:"COLLECTING"},e,{dimensions:l,viewport:a,current:f});var m=l.draggables[e.critical.draggable.id],v=s||cp({pageOffset:d.offset,draggable:m,draggables:l.draggables,droppables:l.droppables,previousImpact:e.impact,viewport:a,afterCritical:e.afterCritical}),g=Jb({draggable:m,impact:v,previousImpact:e.impact,draggables:l.draggables,droppables:l.droppables}),x=_({},e,{current:f,dimensions:{draggables:l.draggables,droppables:g},impact:v,viewport:a,scrollJumpRequest:o||null,forceShouldAnimate:o?!1:null});return x};function Kb(i,e){return i.map(function(t){return e[t]})}var dp=function(i){var e=i.impact,t=i.viewport,n=i.draggables,r=i.destination,s=i.forceShouldAnimate,o=e.displaced,a=Kb(o.all,n),l=Tn({afterDragging:a,destination:r,displacedBy:e.displacedBy,viewport:t.frame,forceShouldAnimate:s,last:o});return _({},e,{displaced:l})},up=function(i){var e=i.impact,t=i.draggable,n=i.droppable,r=i.draggables,s=i.viewport,o=i.afterCritical,a=ps({impact:e,draggable:t,draggables:r,droppable:n,afterCritical:o});return sa({pageBorderBoxCenter:a,draggable:t,viewport:s})},pp=function(i){var e=i.state,t=i.dimensions,n=i.viewport;e.movementMode!=="SNAP"&&le();var r=e.impact,s=n||e.viewport,o=t||e.dimensions,a=o.draggables,l=o.droppables,c=a[e.critical.draggable.id],u=lt(r);u||le();var p=l[u],d=dp({impact:r,viewport:s,destination:p,draggables:a}),f=up({impact:d,draggable:c,droppable:p,draggables:a,viewport:s,afterCritical:e.afterCritical});return mn({impact:d,clientSelection:f,state:e,dimensions:o,viewport:s})},Xb=function(i){return{index:i.index,droppableId:i.droppableId}},hp=function(i){var e=i.draggable,t=i.home,n=i.draggables,r=i.viewport,s=qn(t.axis,e.displaceBy),o=Gi(t.descriptor.id,n),a=o.indexOf(e);a===-1&&le();var l=o.slice(a+1),c=l.reduce(function(f,m){return f[m.descriptor.id]=!0,f},{}),u={inVirtualList:t.descriptor.mode==="virtual",displacedBy:s,effected:c},p=Tn({afterDragging:l,destination:t,displacedBy:s,last:null,viewport:r.frame,forceShouldAnimate:!1}),d={displaced:p,displacedBy:s,at:{type:"REORDER",destination:Xb(e.descriptor)}};return{impact:d,afterCritical:u}},Zb=function(i,e){return{draggables:i.draggables,droppables:oa(i.droppables,e)}},Qb=function(i){var e=i.draggable,t=i.offset,n=i.initialWindowScroll,r=Cr(e.client,t),s=_r(r,n),o=_({},e,{placeholder:_({},e.placeholder,{client:r}),client:r,page:s});return o},ew=function(i){var e=i.frame;return e||le(),e},tw=function(i){var e=i.additions,t=i.updatedDroppables,n=i.viewport,r=n.scroll.diff.value;return e.map(function(s){var o=s.descriptor.droppableId,a=t[o],l=ew(a),c=l.scroll.diff.value,u=Xe(r,c),p=Qb({draggable:s,offset:u,initialWindowScroll:n.scroll.initial});return p})},iw=function(i){var e=i.state,t=i.published,n=t.modified.map(function(w){var S=e.dimensions.droppables[w.droppableId],M=Qo(S,w.scroll);return M}),r=_({},e.dimensions.droppables,{},Ju(n)),s=Ku(tw({additions:t.additions,updatedDroppables:r,viewport:e.viewport})),o=_({},e.dimensions.draggables,{},s);t.removals.forEach(function(w){delete o[w]});var a={droppables:r,draggables:o},l=lt(e.impact),c=l?a.droppables[l]:null,u=a.draggables[e.critical.draggable.id],p=a.droppables[e.critical.droppable.id],d=hp({draggable:u,home:p,draggables:o,viewport:e.viewport}),f=d.impact,m=d.afterCritical,v=c&&c.isCombineEnabled?e.impact:f,g=cp({pageOffset:e.current.page.offset,draggable:a.draggables[e.critical.draggable.id],draggables:a.draggables,droppables:a.droppables,previousImpact:v,viewport:e.viewport,afterCritical:m}),x=_({phase:"DRAGGING"},e,{phase:"DRAGGING",impact:g,onLiftImpact:f,dimensions:a,afterCritical:m,forceShouldAnimate:!1});if(e.phase==="COLLECTING")return x;var y=_({phase:"DROP_PENDING"},x,{phase:"DROP_PENDING",reason:e.reason,isWaiting:!1});return y},xo=function(e){return e.movementMode==="SNAP"},Fs=function(e,t,n){var r=Zb(e.dimensions,t);return!xo(e)||n?mn({state:e,dimensions:r}):pp({state:e,dimensions:r})};function Ls(i){return i.isDragging&&i.movementMode==="SNAP"?_({phase:"DRAGGING"},i,{scrollJumpRequest:null}):i}var $c={phase:"IDLE",completed:null,shouldFlush:!1},nw=function(i,e){if(i===void 0&&(i=$c),e.type==="FLUSH")return _({},$c,{shouldFlush:!0});if(e.type==="INITIAL_PUBLISH"){i.phase!=="IDLE"&&le();var t=e.payload,n=t.critical,r=t.clientSelection,s=t.viewport,o=t.dimensions,a=t.movementMode,l=o.draggables[n.draggable.id],c=o.droppables[n.droppable.id],u={selection:r,borderBoxCenter:l.client.borderBox.center,offset:qe},p={client:u,page:{selection:Xe(u.selection,s.scroll.initial),borderBoxCenter:Xe(u.selection,s.scroll.initial),offset:Xe(u.selection,s.scroll.diff.value)}},d=cs(o.droppables).every(function(ae){return!ae.isFixedOnPage}),f=hp({draggable:l,home:c,draggables:o.draggables,viewport:s}),m=f.impact,v=f.afterCritical,g={phase:"DRAGGING",isDragging:!0,critical:n,movementMode:a,dimensions:o,initial:p,current:p,isWindowScrollAllowed:d,impact:m,afterCritical:v,onLiftImpact:m,viewport:s,scrollJumpRequest:null,forceShouldAnimate:null};return g}if(e.type==="COLLECTION_STARTING"){if(i.phase==="COLLECTING"||i.phase==="DROP_PENDING")return i;i.phase!=="DRAGGING"&&le();var x=_({phase:"COLLECTING"},i,{phase:"COLLECTING"});return x}if(e.type==="PUBLISH_WHILE_DRAGGING")return i.phase==="COLLECTING"||i.phase==="DROP_PENDING"||le(),iw({state:i,published:e.payload});if(e.type==="MOVE"){if(i.phase==="DROP_PENDING")return i;ui(i)||le();var y=e.payload.client;return Ut(y,i.current.client.selection)?i:mn({state:i,clientSelection:y,impact:xo(i)?i.impact:null})}if(e.type==="UPDATE_DROPPABLE_SCROLL"){if(i.phase==="DROP_PENDING"||i.phase==="COLLECTING")return Ls(i);ui(i)||le();var w=e.payload,S=w.id,M=w.newScroll,b=i.dimensions.droppables[S];if(!b)return i;var I=Qo(b,M);return Fs(i,I,!1)}if(e.type==="UPDATE_DROPPABLE_IS_ENABLED"){if(i.phase==="DROP_PENDING")return i;ui(i)||le();var P=e.payload,E=P.id,A=P.isEnabled,T=i.dimensions.droppables[E];T||le(),T.isEnabled===A&&le();var W=_({},T,{isEnabled:A});return Fs(i,W,!0)}if(e.type==="UPDATE_DROPPABLE_IS_COMBINE_ENABLED"){if(i.phase==="DROP_PENDING")return i;ui(i)||le();var F=e.payload,j=F.id,O=F.isCombineEnabled,R=i.dimensions.droppables[j];R||le(),R.isCombineEnabled===O&&le();var B=_({},R,{isCombineEnabled:O});return Fs(i,B,!0)}if(e.type==="MOVE_BY_WINDOW_SCROLL"){if(i.phase==="DROP_PENDING"||i.phase==="DROP_ANIMATING")return i;ui(i)||le(),i.isWindowScrollAllowed||le();var $=e.payload.newScroll;if(Ut(i.viewport.scroll.current,$))return Ls(i);var J=ip(i.viewport,$);return xo(i)?pp({state:i,viewport:J}):mn({state:i,viewport:J})}if(e.type==="UPDATE_VIEWPORT_MAX_SCROLL"){if(!ui(i))return i;var q=e.payload.maxScroll;if(Ut(q,i.viewport.scroll.max))return i;var L=_({},i.viewport,{scroll:_({},i.viewport.scroll,{max:q})});return _({phase:"DRAGGING"},i,{viewport:L})}if(e.type==="MOVE_UP"||e.type==="MOVE_DOWN"||e.type==="MOVE_LEFT"||e.type==="MOVE_RIGHT"){if(i.phase==="COLLECTING"||i.phase==="DROP_PENDING")return i;i.phase!=="DRAGGING"&&le();var Q=Fb({state:i,type:e.type});return Q?mn({state:i,impact:Q.impact,clientSelection:Q.clientSelection,scrollJumpRequest:Q.scrollJumpRequest}):i}if(e.type==="DROP_PENDING"){var G=e.payload.reason;i.phase!=="COLLECTING"&&le();var ne=_({phase:"DROP_PENDING"},i,{phase:"DROP_PENDING",isWaiting:!0,reason:G});return ne}if(e.type==="DROP_ANIMATE"){var U=e.payload,re=U.completed,ie=U.dropDuration,Y=U.newHomeClientOffset;i.phase==="DRAGGING"||i.phase==="DROP_PENDING"||le();var K={phase:"DROP_ANIMATING",completed:re,dropDuration:ie,newHomeClientOffset:Y,dimensions:i.dimensions};return K}if(e.type==="DROP_COMPLETE"){var se=e.payload.completed;return{phase:"IDLE",completed:se,shouldFlush:!1}}return i},rw=function(e){return{type:"BEFORE_INITIAL_CAPTURE",payload:e}},sw=function(e){return{type:"LIFT",payload:e}},ow=function(e){return{type:"INITIAL_PUBLISH",payload:e}},aw=function(e){return{type:"PUBLISH_WHILE_DRAGGING",payload:e}},lw=function(){return{type:"COLLECTION_STARTING",payload:null}},cw=function(e){return{type:"UPDATE_DROPPABLE_SCROLL",payload:e}},dw=function(e){return{type:"UPDATE_DROPPABLE_IS_ENABLED",payload:e}},uw=function(e){return{type:"UPDATE_DROPPABLE_IS_COMBINE_ENABLED",payload:e}},fp=function(e){return{type:"MOVE",payload:e}},pw=function(e){return{type:"MOVE_BY_WINDOW_SCROLL",payload:e}},hw=function(e){return{type:"UPDATE_VIEWPORT_MAX_SCROLL",payload:e}},fw=function(){return{type:"MOVE_UP",payload:null}},mw=function(){return{type:"MOVE_DOWN",payload:null}},gw=function(){return{type:"MOVE_RIGHT",payload:null}},vw=function(){return{type:"MOVE_LEFT",payload:null}},aa=function(){return{type:"FLUSH",payload:null}},xw=function(e){return{type:"DROP_ANIMATE",payload:e}},la=function(e){return{type:"DROP_COMPLETE",payload:e}},mp=function(e){return{type:"DROP",payload:e}},yw=function(e){return{type:"DROP_PENDING",payload:e}},gp=function(){return{type:"DROP_ANIMATION_FINISHED",payload:null}},bw=function(i){return function(e){var t=e.getState,n=e.dispatch;return function(r){return function(s){if(s.type!=="LIFT"){r(s);return}var o=s.payload,a=o.id,l=o.clientSelection,c=o.movementMode,u=t();u.phase==="DROP_ANIMATING"&&n(la({completed:u.completed})),t().phase!=="IDLE"&&le(),n(aa()),n(rw({draggableId:a,movementMode:c}));var p={shouldPublishImmediately:c==="SNAP"},d={draggableId:a,scrollOptions:p},f=i.startPublishing(d),m=f.critical,v=f.dimensions,g=f.viewport;n(ow({critical:m,dimensions:v,clientSelection:l,movementMode:c,viewport:g}))}}}},ww=function(i){return function(){return function(e){return function(t){t.type==="INITIAL_PUBLISH"&&i.dragging(),t.type==="DROP_ANIMATE"&&i.dropping(t.payload.completed.result.reason),(t.type==="FLUSH"||t.type==="DROP_COMPLETE")&&i.resting(),e(t)}}}},ca={outOfTheWay:"cubic-bezier(0.2, 0, 0, 1)",drop:"cubic-bezier(.2,1,.1,1)"},Pn={opacity:{drop:0,combining:.7},scale:{drop:.75}},da={outOfTheWay:.2,minDropTime:.33,maxDropTime:.55},oi=da.outOfTheWay+"s "+ca.outOfTheWay,gn={fluid:"opacity "+oi,snap:"transform "+oi+", opacity "+oi,drop:function(e){var t=e+"s "+ca.drop;return"transform "+t+", opacity "+t},outOfTheWay:"transform "+oi,placeholder:"height "+oi+", width "+oi+", margin "+oi},Wc=function(e){return Ut(e,qe)?null:"translate("+e.x+"px, "+e.y+"px)"},yo={moveTo:Wc,drop:function(e,t){var n=Wc(e);return n?t?n+" scale("+Pn.scale.drop+")":n:null}},bo=da.minDropTime,vp=da.maxDropTime,Dw=vp-bo,Fc=1500,Sw=.6,Iw=function(i){var e=i.current,t=i.destination,n=i.reason,r=Mn(e,t);if(r<=0)return bo;if(r>=Fc)return vp;var s=r/Fc,o=bo+Dw*s,a=n==="CANCEL"?o*Sw:o;return Number(a.toFixed(2))},Cw=function(i){var e=i.impact,t=i.draggable,n=i.dimensions,r=i.viewport,s=i.afterCritical,o=n.draggables,a=n.droppables,l=lt(e),c=l?a[l]:null,u=a[t.descriptor.droppableId],p=up({impact:e,draggable:t,draggables:o,afterCritical:s,droppable:c||u,viewport:r}),d=at(p,t.client.borderBox.center);return d},_w=function(i){var e=i.draggables,t=i.reason,n=i.lastImpact,r=i.home,s=i.viewport,o=i.onLiftImpact;if(!n.at||t!=="DROP"){var a=dp({draggables:e,impact:o,destination:r,viewport:s,forceShouldAnimate:!0});return{impact:a,didDropInsideDroppable:!1}}if(n.at.type==="REORDER")return{impact:n,didDropInsideDroppable:!0};var l=_({},n,{displaced:kn});return{impact:l,didDropInsideDroppable:!0}},Mw=function(i){var e=i.getState,t=i.dispatch;return function(n){return function(r){if(r.type!=="DROP"){n(r);return}var s=e(),o=r.payload.reason;if(s.phase==="COLLECTING"){t(yw({reason:o}));return}if(s.phase!=="IDLE"){var a=s.phase==="DROP_PENDING"&&s.isWaiting;a&&le(),s.phase==="DRAGGING"||s.phase==="DROP_PENDING"||le();var l=s.critical,c=s.dimensions,u=c.draggables[s.critical.draggable.id],p=_w({reason:o,lastImpact:s.impact,afterCritical:s.afterCritical,onLiftImpact:s.onLiftImpact,home:s.dimensions.droppables[s.critical.droppable.id],viewport:s.viewport,draggables:s.dimensions.draggables}),d=p.impact,f=p.didDropInsideDroppable,m=f?ta(d):null,v=f?ds(d):null,g={index:l.draggable.index,droppableId:l.droppable.id},x={draggableId:u.descriptor.id,type:u.descriptor.type,source:g,reason:o,mode:s.movementMode,destination:m,combine:v},y=Cw({impact:d,draggable:u,dimensions:c,viewport:s.viewport,afterCritical:s.afterCritical}),w={critical:s.critical,afterCritical:s.afterCritical,result:x,impact:d},S=!Ut(s.current.client.offset,y)||!!x.combine;if(!S){t(la({completed:w}));return}var M=Iw({current:s.current.client.offset,destination:y,reason:o}),b={newHomeClientOffset:y,dropDuration:M,completed:w};t(xw(b))}}}},xp=function(){return{x:window.pageXOffset,y:window.pageYOffset}};function kw(i){return{eventName:"scroll",options:{passive:!0,capture:!1},fn:function(t){t.target!==window&&t.target!==window.document||i()}}}function Tw(i){var e=i.onWindowScroll;function t(){e(xp())}var n=_n(t),r=kw(n),s=qt;function o(){return s!==qt}function a(){o()&&le(),s=xt(window,[r])}function l(){o()||le(),n.cancel(),s(),s=qt}return{start:a,stop:l,isActive:o}}var Pw=function(e){return e.type==="DROP_COMPLETE"||e.type==="DROP_ANIMATE"||e.type==="FLUSH"},Ow=function(i){var e=Tw({onWindowScroll:function(n){i.dispatch(pw({newScroll:n}))}});return function(t){return function(n){!e.isActive()&&n.type==="INITIAL_PUBLISH"&&e.start(),e.isActive()&&Pw(n)&&e.stop(),t(n)}}},jw=function(i){var e=!1,t=!1,n=setTimeout(function(){t=!0}),r=function(o){e||t||(e=!0,i(o),clearTimeout(n))};return r.wasCalled=function(){return e},r},Ew=function(){var i=[],e=function(s){var o=ea(i,function(c){return c.timerId===s});o===-1&&le();var a=i.splice(o,1),l=a[0];l.callback()},t=function(s){var o=setTimeout(function(){return e(o)}),a={timerId:o,callback:s};i.push(a)},n=function(){if(i.length){var s=[].concat(i);i.length=0,s.forEach(function(o){clearTimeout(o.timerId),o.callback()})}};return{add:t,flush:n}},Rw=function(e,t){return e==null&&t==null?!0:e==null||t==null?!1:e.droppableId===t.droppableId&&e.index===t.index},Aw=function(e,t){return e==null&&t==null?!0:e==null||t==null?!1:e.draggableId===t.draggableId&&e.droppableId===t.droppableId},Nw=function(e,t){if(e===t)return!0;var n=e.draggable.id===t.draggable.id&&e.draggable.droppableId===t.draggable.droppableId&&e.draggable.type===t.draggable.type&&e.draggable.index===t.draggable.index,r=e.droppable.id===t.droppable.id&&e.droppable.type===t.droppable.type;return n&&r},rn=function(e,t){t()},er=function(e,t){return{draggableId:e.draggable.id,type:e.droppable.type,source:{droppableId:e.droppable.id,index:e.draggable.index},mode:t}},Bs=function(e,t,n,r){if(!e){n(r(t));return}var s=jw(n),o={announce:s};e(t,o),s.wasCalled()||n(r(t))},$w=function(i,e){var t=Ew(),n=null,r=function(d,f){n&&le(),rn("onBeforeCapture",function(){var m=i().onBeforeCapture;if(m){var v={draggableId:d,mode:f};m(v)}})},s=function(d,f){n&&le(),rn("onBeforeDragStart",function(){var m=i().onBeforeDragStart;m&&m(er(d,f))})},o=function(d,f){n&&le();var m=er(d,f);n={mode:f,lastCritical:d,lastLocation:m.source,lastCombine:null},t.add(function(){rn("onDragStart",function(){return Bs(i().onDragStart,m,e,hr.onDragStart)})})},a=function(d,f){var m=ta(f),v=ds(f);n||le();var g=!Nw(d,n.lastCritical);g&&(n.lastCritical=d);var x=!Rw(n.lastLocation,m);x&&(n.lastLocation=m);var y=!Aw(n.lastCombine,v);if(y&&(n.lastCombine=v),!(!g&&!x&&!y)){var w=_({},er(d,n.mode),{combine:v,destination:m});t.add(function(){rn("onDragUpdate",function(){return Bs(i().onDragUpdate,w,e,hr.onDragUpdate)})})}},l=function(){n||le(),t.flush()},c=function(d){n||le(),n=null,rn("onDragEnd",function(){return Bs(i().onDragEnd,d,e,hr.onDragEnd)})},u=function(){if(n){var d=_({},er(n.lastCritical,n.mode),{combine:null,destination:null,reason:"CANCEL"});c(d)}};return{beforeCapture:r,beforeStart:s,start:o,update:a,flush:l,drop:c,abort:u}},Ww=function(i,e){var t=$w(i,e);return function(n){return function(r){return function(s){if(s.type==="BEFORE_INITIAL_CAPTURE"){t.beforeCapture(s.payload.draggableId,s.payload.movementMode);return}if(s.type==="INITIAL_PUBLISH"){var o=s.payload.critical;t.beforeStart(o,s.payload.movementMode),r(s),t.start(o,s.payload.movementMode);return}if(s.type==="DROP_COMPLETE"){var a=s.payload.completed.result;t.flush(),r(s),t.drop(a);return}if(r(s),s.type==="FLUSH"){t.abort();return}var l=n.getState();l.phase==="DRAGGING"&&t.update(l.critical,l.impact)}}}},Fw=function(i){return function(e){return function(t){if(t.type!=="DROP_ANIMATION_FINISHED"){e(t);return}var n=i.getState();n.phase!=="DROP_ANIMATING"&&le(),i.dispatch(la({completed:n.completed}))}}},Lw=function(i){var e=null,t=null;function n(){t&&(cancelAnimationFrame(t),t=null),e&&(e(),e=null)}return function(r){return function(s){if((s.type==="FLUSH"||s.type==="DROP_COMPLETE"||s.type==="DROP_ANIMATION_FINISHED")&&n(),r(s),s.type==="DROP_ANIMATE"){var o={eventName:"scroll",options:{capture:!0,passive:!1,once:!0},fn:function(){var l=i.getState();l.phase==="DROP_ANIMATING"&&i.dispatch(gp())}};t=requestAnimationFrame(function(){t=null,e=xt(window,[o])})}}}},Bw=function(i){return function(){return function(e){return function(t){(t.type==="DROP_COMPLETE"||t.type==="FLUSH"||t.type==="DROP_ANIMATE")&&i.stopPublishing(),e(t)}}}},Vw=function(i){var e=!1;return function(){return function(t){return function(n){if(n.type==="INITIAL_PUBLISH"){e=!0,i.tryRecordFocus(n.payload.critical.draggable.id),t(n),i.tryRestoreFocusRecorded();return}if(t(n),!!e){if(n.type==="FLUSH"){e=!1,i.tryRestoreFocusRecorded();return}if(n.type==="DROP_COMPLETE"){e=!1;var r=n.payload.completed.result;r.combine&&i.tryShiftRecord(r.draggableId,r.combine.draggableId),i.tryRestoreFocusRecorded()}}}}}},zw=function(e){return e.type==="DROP_COMPLETE"||e.type==="DROP_ANIMATE"||e.type==="FLUSH"},Hw=function(i){return function(e){return function(t){return function(n){if(zw(n)){i.stop(),t(n);return}if(n.type==="INITIAL_PUBLISH"){t(n);var r=e.getState();r.phase!=="DRAGGING"&&le(),i.start(r);return}t(n),i.scroll(e.getState())}}}},qw=function(i){return function(e){return function(t){if(e(t),t.type==="PUBLISH_WHILE_DRAGGING"){var n=i.getState();n.phase==="DROP_PENDING"&&(n.isWaiting||i.dispatch(mp({reason:n.reason})))}}}},Uw=$d,Yw=function(i){var e=i.dimensionMarshal,t=i.focusMarshal,n=i.styleMarshal,r=i.getResponders,s=i.announce,o=i.autoScroller;return To(nw,Uw(Rf(ww(n),Bw(e),bw(e),Mw,Fw,Lw,qw,Hw(o),Ow,Vw(t),Ww(r,s))))},Vs=function(){return{additions:{},removals:{},modified:{}}};function Gw(i){var e=i.registry,t=i.callbacks,n=Vs(),r=null,s=function(){r||(t.collectionStarting(),r=requestAnimationFrame(function(){r=null;var u=n,p=u.additions,d=u.removals,f=u.modified,m=Object.keys(p).map(function(x){return e.draggable.getById(x).getDimension(qe)}).sort(function(x,y){return x.descriptor.index-y.descriptor.index}),v=Object.keys(f).map(function(x){var y=e.droppable.getById(x),w=y.callbacks.getScrollWhileDragging();return{droppableId:x,scroll:w}}),g={additions:m,removals:Object.keys(d),modified:v};n=Vs(),t.publish(g)}))},o=function(u){var p=u.descriptor.id;n.additions[p]=u,n.modified[u.descriptor.droppableId]=!0,n.removals[p]&&delete n.removals[p],s()},a=function(u){var p=u.descriptor;n.removals[p.id]=!0,n.modified[p.droppableId]=!0,n.additions[p.id]&&delete n.additions[p.id],s()},l=function(){r&&(cancelAnimationFrame(r),r=null,n=Vs())};return{add:o,remove:a,stop:l}}var yp=function(i){var e=i.scrollHeight,t=i.scrollWidth,n=i.height,r=i.width,s=at({x:t,y:e},{x:r,y:n}),o={x:Math.max(0,s.x),y:Math.max(0,s.y)};return o},bp=function(){var i=document.documentElement;return i||le(),i},wp=function(){var i=bp(),e=yp({scrollHeight:i.scrollHeight,scrollWidth:i.scrollWidth,width:i.clientWidth,height:i.clientHeight});return e},Jw=function(){var i=xp(),e=wp(),t=i.y,n=i.x,r=bp(),s=r.clientWidth,o=r.clientHeight,a=n+s,l=t+o,c=Mt({top:t,left:n,right:a,bottom:l}),u={frame:c,scroll:{initial:i,current:i,max:e,diff:{value:qe,displacement:qe}}};return u},Kw=function(i){var e=i.critical,t=i.scrollOptions,n=i.registry,r=Jw(),s=r.scroll.current,o=e.droppable,a=n.droppable.getAllByType(o.type).map(function(p){return p.callbacks.getDimensionAndWatchScroll(s,t)}),l=n.draggable.getAllByType(e.draggable.type).map(function(p){return p.getDimension(s)}),c={draggables:Ku(l),droppables:Ju(a)},u={dimensions:c,critical:e,viewport:r};return u};function Lc(i,e,t){if(t.descriptor.id===e.id||t.descriptor.type!==e.type)return!1;var n=i.droppable.getById(t.descriptor.droppableId);return n.descriptor.mode==="virtual"}var Xw=function(i,e){var t=null,n=Gw({callbacks:{publish:e.publishWhileDragging,collectionStarting:e.collectionStarting},registry:i}),r=function(f,m){i.droppable.exists(f)||le(),t&&e.updateDroppableIsEnabled({id:f,isEnabled:m})},s=function(f,m){t&&(i.droppable.exists(f)||le(),e.updateDroppableIsCombineEnabled({id:f,isCombineEnabled:m}))},o=function(f,m){t&&(i.droppable.exists(f)||le(),e.updateDroppableScroll({id:f,newScroll:m}))},a=function(f,m){t&&i.droppable.getById(f).callbacks.scroll(m)},l=function(){if(t){n.stop();var f=t.critical.droppable;i.droppable.getAllByType(f.type).forEach(function(m){return m.callbacks.dragStopped()}),t.unsubscribe(),t=null}},c=function(f){t||le();var m=t.critical.draggable;f.type==="ADDITION"&&Lc(i,m,f.value)&&n.add(f.value),f.type==="REMOVAL"&&Lc(i,m,f.value)&&n.remove(f.value)},u=function(f){t&&le();var m=i.draggable.getById(f.draggableId),v=i.droppable.getById(m.descriptor.droppableId),g={draggable:m.descriptor,droppable:v.descriptor},x=i.subscribe(c);return t={critical:g,unsubscribe:x},Kw({critical:g,registry:i,scrollOptions:f.scrollOptions})},p={updateDroppableIsEnabled:r,updateDroppableIsCombineEnabled:s,scrollDroppable:a,updateDroppableScroll:o,startPublishing:u,stopPublishing:l};return p},Dp=function(i,e){return i.phase==="IDLE"?!0:i.phase!=="DROP_ANIMATING"||i.completed.result.draggableId===e?!1:i.completed.result.reason==="DROP"},Zw=function(i){window.scrollBy(i.x,i.y)},Qw=He(function(i){return cs(i).filter(function(e){return!(!e.isEnabled||!e.frame)})}),eD=function(e,t){var n=Zt(Qw(t),function(r){return r.frame||le(),op(r.frame.pageMarginBox)(e)});return n},tD=function(i){var e=i.center,t=i.destination,n=i.droppables;if(t){var r=n[t];return r.frame?r:null}var s=eD(e,n);return s},Yt={startFromPercentage:.25,maxScrollAtPercentage:.05,maxPixelScroll:28,ease:function(e){return Math.pow(e,2)},durationDampening:{stopDampeningAt:1200,accelerateAt:360}},iD=function(i,e){var t=i[e.size]*Yt.startFromPercentage,n=i[e.size]*Yt.maxScrollAtPercentage,r={startScrollingFrom:t,maxScrollValueAt:n};return r},Sp=function(i){var e=i.startOfRange,t=i.endOfRange,n=i.current,r=t-e;if(r===0)return 0;var s=n-e,o=s/r;return o},ua=1,nD=function(i,e){if(i>e.startScrollingFrom)return 0;if(i<=e.maxScrollValueAt)return Yt.maxPixelScroll;if(i===e.startScrollingFrom)return ua;var t=Sp({startOfRange:e.maxScrollValueAt,endOfRange:e.startScrollingFrom,current:i}),n=1-t,r=Yt.maxPixelScroll*Yt.ease(n);return Math.ceil(r)},Bc=Yt.durationDampening.accelerateAt,Vc=Yt.durationDampening.stopDampeningAt,rD=function(i,e){var t=e,n=Vc,r=Date.now(),s=r-t;if(s>=Vc)return i;if(s<Bc)return ua;var o=Sp({startOfRange:Bc,endOfRange:n,current:s}),a=i*Yt.ease(o);return Math.ceil(a)},zc=function(i){var e=i.distanceToEdge,t=i.thresholds,n=i.dragStartTime,r=i.shouldUseTimeDampening,s=nD(e,t);return s===0?0:r?Math.max(rD(s,n),ua):s},Hc=function(i){var e=i.container,t=i.distanceToEdges,n=i.dragStartTime,r=i.axis,s=i.shouldUseTimeDampening,o=iD(e,r),a=t[r.end]<t[r.start];return a?zc({distanceToEdge:t[r.end],thresholds:o,dragStartTime:n,shouldUseTimeDampening:s}):-1*zc({distanceToEdge:t[r.start],thresholds:o,dragStartTime:n,shouldUseTimeDampening:s})},sD=function(i){var e=i.container,t=i.subject,n=i.proposedScroll,r=t.height>e.height,s=t.width>e.width;return!s&&!r?n:s&&r?null:{x:s?0:n.x,y:r?0:n.y}},oD=Yu(function(i){return i===0?0:i}),Ip=function(i){var e=i.dragStartTime,t=i.container,n=i.subject,r=i.center,s=i.shouldUseTimeDampening,o={top:r.y-t.top,right:t.right-r.x,bottom:t.bottom-r.y,left:r.x-t.left},a=Hc({container:t,distanceToEdges:o,dragStartTime:e,axis:ia,shouldUseTimeDampening:s}),l=Hc({container:t,distanceToEdges:o,dragStartTime:e,axis:Qu,shouldUseTimeDampening:s}),c=oD({x:l,y:a});if(Ut(c,qe))return null;var u=sD({container:t,subject:n,proposedScroll:c});return u?Ut(u,qe)?null:u:null},aD=Yu(function(i){return i===0?0:i>0?1:-1}),pa=function(){var i=function(t,n){return t<0?t:t>n?t-n:0};return function(e){var t=e.current,n=e.max,r=e.change,s=Xe(t,r),o={x:i(s.x,n.x),y:i(s.y,n.y)};return Ut(o,qe)?null:o}}(),Cp=function(e){var t=e.max,n=e.current,r=e.change,s={x:Math.max(n.x,t.x),y:Math.max(n.y,t.y)},o=aD(r),a=pa({max:s,current:n,change:o});return!a||o.x!==0&&a.x===0||o.y!==0&&a.y===0},ha=function(e,t){return Cp({current:e.scroll.current,max:e.scroll.max,change:t})},lD=function(e,t){if(!ha(e,t))return null;var n=e.scroll.max,r=e.scroll.current;return pa({current:r,max:n,change:t})},fa=function(e,t){var n=e.frame;return n?Cp({current:n.scroll.current,max:n.scroll.max,change:t}):!1},cD=function(e,t){var n=e.frame;return!n||!fa(e,t)?null:pa({current:n.scroll.current,max:n.scroll.max,change:t})},dD=function(i){var e=i.viewport,t=i.subject,n=i.center,r=i.dragStartTime,s=i.shouldUseTimeDampening,o=Ip({dragStartTime:r,container:e.frame,subject:t,center:n,shouldUseTimeDampening:s});return o&&ha(e,o)?o:null},uD=function(i){var e=i.droppable,t=i.subject,n=i.center,r=i.dragStartTime,s=i.shouldUseTimeDampening,o=e.frame;if(!o)return null;var a=Ip({dragStartTime:r,container:o.pageMarginBox,subject:t,center:n,shouldUseTimeDampening:s});return a&&fa(e,a)?a:null},qc=function(i){var e=i.state,t=i.dragStartTime,n=i.shouldUseTimeDampening,r=i.scrollWindow,s=i.scrollDroppable,o=e.current.page.borderBoxCenter,a=e.dimensions.draggables[e.critical.draggable.id],l=a.page.marginBox;if(e.isWindowScrollAllowed){var c=e.viewport,u=dD({dragStartTime:t,viewport:c,subject:l,center:o,shouldUseTimeDampening:n});if(u){r(u);return}}var p=tD({center:o,destination:lt(e.impact),droppables:e.dimensions.droppables});if(p){var d=uD({dragStartTime:t,droppable:p,subject:l,center:o,shouldUseTimeDampening:n});d&&s(p.descriptor.id,d)}},pD=function(i){var e=i.scrollWindow,t=i.scrollDroppable,n=_n(e),r=_n(t),s=null,o=function(u){s||le();var p=s,d=p.shouldUseTimeDampening,f=p.dragStartTime;qc({state:u,scrollWindow:n,scrollDroppable:r,dragStartTime:f,shouldUseTimeDampening:d})},a=function(u){s&&le();var p=Date.now(),d=!1,f=function(){d=!0};qc({state:u,dragStartTime:0,shouldUseTimeDampening:!1,scrollWindow:f,scrollDroppable:f}),s={dragStartTime:p,shouldUseTimeDampening:d},d&&o(u)},l=function(){s&&(n.cancel(),r.cancel(),s=null)};return{start:a,stop:l,scroll:o}},hD=function(i){var e=i.move,t=i.scrollDroppable,n=i.scrollWindow,r=function(c,u){var p=Xe(c.current.client.selection,u);e({client:p})},s=function(c,u){if(!fa(c,u))return u;var p=cD(c,u);if(!p)return t(c.descriptor.id,u),null;var d=at(u,p);t(c.descriptor.id,d);var f=at(u,d);return f},o=function(c,u,p){if(!c||!ha(u,p))return p;var d=lD(u,p);if(!d)return n(p),null;var f=at(p,d);n(f);var m=at(p,f);return m},a=function(c){var u=c.scrollJumpRequest;if(u){var p=lt(c.impact);p||le();var d=s(c.dimensions.droppables[p],u);if(d){var f=c.viewport,m=o(c.isWindowScrollAllowed,f,d);m&&r(c,m)}}};return a},fD=function(i){var e=i.scrollDroppable,t=i.scrollWindow,n=i.move,r=pD({scrollWindow:t,scrollDroppable:e}),s=hD({move:n,scrollWindow:t,scrollDroppable:e}),o=function(c){if(c.phase==="DRAGGING"){if(c.movementMode==="FLUID"){r.scroll(c);return}c.scrollJumpRequest&&s(c)}},a={scroll:o,start:r.start,stop:r.stop};return a},Li="data-rbd",Bi=function(){var i=Li+"-drag-handle";return{base:i,draggableId:i+"-draggable-id",contextId:i+"-context-id"}}(),wo=function(){var i=Li+"-draggable";return{base:i,contextId:i+"-context-id",id:i+"-id"}}(),mD=function(){var i=Li+"-droppable";return{base:i,contextId:i+"-context-id",id:i+"-id"}}(),Uc={contextId:Li+"-scroll-container-context-id"},gD=function(e){return function(t){return"["+t+'="'+e+'"]'}},sn=function(e,t){return e.map(function(n){var r=n.styles[t];return r?n.selector+" { "+r+" }":""}).join(" ")},vD="pointer-events: none;",xD=function(i){var e=gD(i),t=function(){var a=`
cursor: -webkit-grab;
cursor: grab;
`;return{selector:e(Bi.contextId),styles:{always:`
-webkit-touch-callout: none;
-webkit-tap-highlight-color: rgba(0,0,0,0);
touch-action: manipulation;
`,resting:a,dragging:vD,dropAnimating:a}}}(),n=function(){var a=`
transition: `+gn.outOfTheWay+`;
`;return{selector:e(wo.contextId),styles:{dragging:a,dropAnimating:a,userCancel:a}}}(),r={selector:e(mD.contextId),styles:{always:"overflow-anchor: none;"}},s={selector:"body",styles:{dragging:`
cursor: grabbing;
cursor: -webkit-grabbing;
user-select: none;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
overflow-anchor: none;
`}},o=[n,t,r,s];return{always:sn(o,"always"),resting:sn(o,"resting"),dragging:sn(o,"dragging"),dropAnimating:sn(o,"dropAnimating"),userCancel:sn(o,"userCancel")}},ct=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?D.useLayoutEffect:D.useEffect,zs=function(){var e=document.querySelector("head");return e||le(),e},Yc=function(e){var t=document.createElement("style");return e&&t.setAttribute("nonce",e),t.type="text/css",t};function yD(i,e){var t=ke(function(){return xD(i)},[i]),n=D.useRef(null),r=D.useRef(null),s=ge(He(function(p){var d=r.current;d||le(),d.textContent=p}),[]),o=ge(function(p){var d=n.current;d||le(),d.textContent=p},[]);ct(function(){!n.current&&!r.current||le();var p=Yc(e),d=Yc(e);return n.current=p,r.current=d,p.setAttribute(Li+"-always",i),d.setAttribute(Li+"-dynamic",i),zs().appendChild(p),zs().appendChild(d),o(t.always),s(t.resting),function(){var f=function(v){var g=v.current;g||le(),zs().removeChild(g),v.current=null};f(n),f(r)}},[e,o,s,t.always,t.resting,i]);var a=ge(function(){return s(t.dragging)},[s,t.dragging]),l=ge(function(p){if(p==="DROP"){s(t.dropAnimating);return}s(t.userCancel)},[s,t.dropAnimating,t.userCancel]),c=ge(function(){r.current&&s(t.resting)},[s,t.resting]),u=ke(function(){return{dragging:a,dropping:l,resting:c}},[a,l,c]);return u}var _p=function(i){return i&&i.ownerDocument?i.ownerDocument.defaultView:window};function hs(i){return i instanceof _p(i).HTMLElement}function bD(i,e){var t="["+Bi.contextId+'="'+i+'"]',n=Gu(document.querySelectorAll(t));if(!n.length)return null;var r=Zt(n,function(s){return s.getAttribute(Bi.draggableId)===e});return!r||!hs(r)?null:r}function wD(i){var e=D.useRef({}),t=D.useRef(null),n=D.useRef(null),r=D.useRef(!1),s=ge(function(d,f){var m={id:d,focus:f};return e.current[d]=m,function(){var g=e.current,x=g[d];x!==m&&delete g[d]}},[]),o=ge(function(d){var f=bD(i,d);f&&f!==document.activeElement&&f.focus()},[i]),a=ge(function(d,f){t.current===d&&(t.current=f)},[]),l=ge(function(){n.current||r.current&&(n.current=requestAnimationFrame(function(){n.current=null;var d=t.current;d&&o(d)}))},[o]),c=ge(function(d){t.current=null;var f=document.activeElement;f&&f.getAttribute(Bi.draggableId)===d&&(t.current=d)},[]);ct(function(){return r.current=!0,function(){r.current=!1;var d=n.current;d&&cancelAnimationFrame(d)}},[]);var u=ke(function(){return{register:s,tryRecordFocus:c,tryRestoreFocusRecorded:l,tryShiftRecord:a}},[s,c,l,a]);return u}function DD(){var i={draggables:{},droppables:{}},e=[];function t(p){return e.push(p),function(){var f=e.indexOf(p);f!==-1&&e.splice(f,1)}}function n(p){e.length&&e.forEach(function(d){return d(p)})}function r(p){return i.draggables[p]||null}function s(p){var d=r(p);return d||le(),d}var o={register:function(d){i.draggables[d.descriptor.id]=d,n({type:"ADDITION",value:d})},update:function(d,f){var m=i.draggables[f.descriptor.id];m&&m.uniqueId===d.uniqueId&&(delete i.draggables[f.descriptor.id],i.draggables[d.descriptor.id]=d)},unregister:function(d){var f=d.descriptor.id,m=r(f);m&&d.uniqueId===m.uniqueId&&(delete i.draggables[f],n({type:"REMOVAL",value:d}))},getById:s,findById:r,exists:function(d){return!!r(d)},getAllByType:function(d){return Tr(i.draggables).filter(function(f){return f.descriptor.type===d})}};function a(p){return i.droppables[p]||null}function l(p){var d=a(p);return d||le(),d}var c={register:function(d){i.droppables[d.descriptor.id]=d},unregister:function(d){var f=a(d.descriptor.id);f&&d.uniqueId===f.uniqueId&&delete i.droppables[d.descriptor.id]},getById:l,findById:a,exists:function(d){return!!a(d)},getAllByType:function(d){return Tr(i.droppables).filter(function(f){return f.descriptor.type===d})}};function u(){i.draggables={},i.droppables={},e.length=0}return{draggable:o,droppable:c,subscribe:t,clean:u}}function SD(){var i=ke(DD,[]);return D.useEffect(function(){return function(){requestAnimationFrame(i.clean)}},[i]),i}var ma=ve.createContext(null),Or=function(){var i=document.body;return i||le(),i},ID={position:"absolute",width:"1px",height:"1px",margin:"-1px",border:"0",padding:"0",overflow:"hidden",clip:"rect(0 0 0 0)","clip-path":"inset(100%)"},CD=function(e){return"rbd-announcement-"+e};function _D(i){var e=ke(function(){return CD(i)},[i]),t=D.useRef(null);D.useEffect(function(){var s=document.createElement("div");return t.current=s,s.id=e,s.setAttribute("aria-live","assertive"),s.setAttribute("aria-atomic","true"),_(s.style,ID),Or().appendChild(s),function(){setTimeout(function(){var l=Or();l.contains(s)&&l.removeChild(s),s===t.current&&(t.current=null)})}},[e]);var n=ge(function(r){var s=t.current;if(s){s.textContent=r;return}},[]);return n}var MD=0,kD={separator:"::"};function ga(i,e){return e===void 0&&(e=kD),ke(function(){return""+i+e.separator+MD++},[e.separator,i])}function TD(i){var e=i.contextId,t=i.uniqueId;return"rbd-hidden-text-"+e+"-"+t}function PD(i){var e=i.contextId,t=i.text,n=ga("hidden-text",{separator:"-"}),r=ke(function(){return TD({contextId:e,uniqueId:n})},[n,e]);return D.useEffect(function(){var o=document.createElement("div");return o.id=r,o.textContent=t,o.style.display="none",Or().appendChild(o),function(){var l=Or();l.contains(o)&&l.removeChild(o)}},[r,t]),r}var fs=ve.createContext(null);function Mp(i){var e=D.useRef(i);return D.useEffect(function(){e.current=i}),e}function OD(){var i=null;function e(){return!!i}function t(o){return o===i}function n(o){i&&le();var a={abandon:o};return i=a,a}function r(){i||le(),i=null}function s(){i&&(i.abandon(),r())}return{isClaimed:e,isActive:t,claim:n,release:r,tryAbandon:s}}var jD=9,ED=13,va=27,kp=32,RD=33,AD=34,ND=35,$D=36,WD=37,FD=38,LD=39,BD=40,tr,VD=(tr={},tr[ED]=!0,tr[jD]=!0,tr),Tp=function(i){VD[i.keyCode]&&i.preventDefault()},ms=function(){var i="visibilitychange";if(typeof document>"u")return i;var e=[i,"ms"+i,"webkit"+i,"moz"+i,"o"+i],t=Zt(e,function(n){return"on"+n in document});return t||i}(),Pp=0,Gc=5;function zD(i,e){return Math.abs(e.x-i.x)>=Gc||Math.abs(e.y-i.y)>=Gc}var Jc={type:"IDLE"};function HD(i){var e=i.cancel,t=i.completed,n=i.getPhase,r=i.setPhase;return[{eventName:"mousemove",fn:function(o){var a=o.button,l=o.clientX,c=o.clientY;if(a===Pp){var u={x:l,y:c},p=n();if(p.type==="DRAGGING"){o.preventDefault(),p.actions.move(u);return}p.type!=="PENDING"&&le();var d=p.point;if(zD(d,u)){o.preventDefault();var f=p.actions.fluidLift(u);r({type:"DRAGGING",actions:f})}}}},{eventName:"mouseup",fn:function(o){var a=n();if(a.type!=="DRAGGING"){e();return}o.preventDefault(),a.actions.drop({shouldBlockNextClick:!0}),t()}},{eventName:"mousedown",fn:function(o){n().type==="DRAGGING"&&o.preventDefault(),e()}},{eventName:"keydown",fn:function(o){var a=n();if(a.type==="PENDING"){e();return}if(o.keyCode===va){o.preventDefault(),e();return}Tp(o)}},{eventName:"resize",fn:e},{eventName:"scroll",options:{passive:!0,capture:!1},fn:function(){n().type==="PENDING"&&e()}},{eventName:"webkitmouseforcedown",fn:function(o){var a=n();if(a.type==="IDLE"&&le(),a.actions.shouldRespectForcePress()){e();return}o.preventDefault()}},{eventName:ms,fn:e}]}function qD(i){var e=D.useRef(Jc),t=D.useRef(qt),n=ke(function(){return{eventName:"mousedown",fn:function(p){if(!p.defaultPrevented&&p.button===Pp&&!(p.ctrlKey||p.metaKey||p.shiftKey||p.altKey)){var d=i.findClosestDraggableId(p);if(d){var f=i.tryGetLock(d,o,{sourceEvent:p});if(f){p.preventDefault();var m={x:p.clientX,y:p.clientY};t.current(),c(f,m)}}}}}},[i]),r=ke(function(){return{eventName:"webkitmouseforcewillbegin",fn:function(p){if(!p.defaultPrevented){var d=i.findClosestDraggableId(p);if(d){var f=i.findOptionsForDraggable(d);f&&(f.shouldRespectForcePress||i.canGetLock(d)&&p.preventDefault())}}}}},[i]),s=ge(function(){var p={passive:!1,capture:!0};t.current=xt(window,[r,n],p)},[r,n]),o=ge(function(){var u=e.current;u.type!=="IDLE"&&(e.current=Jc,t.current(),s())},[s]),a=ge(function(){var u=e.current;o(),u.type==="DRAGGING"&&u.actions.cancel({shouldBlockNextClick:!0}),u.type==="PENDING"&&u.actions.abort()},[o]),l=ge(function(){var p={capture:!0,passive:!1},d=HD({cancel:a,completed:o,getPhase:function(){return e.current},setPhase:function(m){e.current=m}});t.current=xt(window,d,p)},[a,o]),c=ge(function(p,d){e.current.type!=="IDLE"&&le(),e.current={type:"PENDING",point:d,actions:p},l()},[l]);ct(function(){return s(),function(){t.current()}},[s])}var Ii;function UD(){}var YD=(Ii={},Ii[AD]=!0,Ii[RD]=!0,Ii[$D]=!0,Ii[ND]=!0,Ii);function GD(i,e){function t(){e(),i.cancel()}function n(){e(),i.drop()}return[{eventName:"keydown",fn:function(s){if(s.keyCode===va){s.preventDefault(),t();return}if(s.keyCode===kp){s.preventDefault(),n();return}if(s.keyCode===BD){s.preventDefault(),i.moveDown();return}if(s.keyCode===FD){s.preventDefault(),i.moveUp();return}if(s.keyCode===LD){s.preventDefault(),i.moveRight();return}if(s.keyCode===WD){s.preventDefault(),i.moveLeft();return}if(YD[s.keyCode]){s.preventDefault();return}Tp(s)}},{eventName:"mousedown",fn:t},{eventName:"mouseup",fn:t},{eventName:"click",fn:t},{eventName:"touchstart",fn:t},{eventName:"resize",fn:t},{eventName:"wheel",fn:t,options:{passive:!0}},{eventName:ms,fn:t}]}function JD(i){var e=D.useRef(UD),t=ke(function(){return{eventName:"keydown",fn:function(s){if(s.defaultPrevented||s.keyCode!==kp)return;var o=i.findClosestDraggableId(s);if(!o)return;var a=i.tryGetLock(o,u,{sourceEvent:s});if(!a)return;s.preventDefault();var l=!0,c=a.snapLift();e.current();function u(){l||le(),l=!1,e.current(),n()}e.current=xt(window,GD(c,u),{capture:!0,passive:!1})}}},[i]),n=ge(function(){var s={passive:!1,capture:!0};e.current=xt(window,[t],s)},[t]);ct(function(){return n(),function(){e.current()}},[n])}var Hs={type:"IDLE"},KD=120,XD=.15;function ZD(i){var e=i.cancel,t=i.getPhase;return[{eventName:"orientationchange",fn:e},{eventName:"resize",fn:e},{eventName:"contextmenu",fn:function(r){r.preventDefault()}},{eventName:"keydown",fn:function(r){if(t().type!=="DRAGGING"){e();return}r.keyCode===va&&r.preventDefault(),e()}},{eventName:ms,fn:e}]}function QD(i){var e=i.cancel,t=i.completed,n=i.getPhase;return[{eventName:"touchmove",options:{capture:!1},fn:function(s){var o=n();if(o.type!=="DRAGGING"){e();return}o.hasMoved=!0;var a=s.touches[0],l=a.clientX,c=a.clientY,u={x:l,y:c};s.preventDefault(),o.actions.move(u)}},{eventName:"touchend",fn:function(s){var o=n();if(o.type!=="DRAGGING"){e();return}s.preventDefault(),o.actions.drop({shouldBlockNextClick:!0}),t()}},{eventName:"touchcancel",fn:function(s){if(n().type!=="DRAGGING"){e();return}s.preventDefault(),e()}},{eventName:"touchforcechange",fn:function(s){var o=n();o.type==="IDLE"&&le();var a=s.touches[0];if(a){var l=a.force>=XD;if(l){var c=o.actions.shouldRespectForcePress();if(o.type==="PENDING"){c&&e();return}if(c){if(o.hasMoved){s.preventDefault();return}e();return}s.preventDefault()}}}},{eventName:ms,fn:e}]}function eS(i){var e=D.useRef(Hs),t=D.useRef(qt),n=ge(function(){return e.current},[]),r=ge(function(f){e.current=f},[]),s=ke(function(){return{eventName:"touchstart",fn:function(f){if(!f.defaultPrevented){var m=i.findClosestDraggableId(f);if(m){var v=i.tryGetLock(m,a,{sourceEvent:f});if(v){var g=f.touches[0],x=g.clientX,y=g.clientY,w={x,y};t.current(),p(v,w)}}}}}},[i]),o=ge(function(){var f={capture:!0,passive:!1};t.current=xt(window,[s],f)},[s]),a=ge(function(){var d=e.current;d.type!=="IDLE"&&(d.type==="PENDING"&&clearTimeout(d.longPressTimerId),r(Hs),t.current(),o())},[o,r]),l=ge(function(){var d=e.current;a(),d.type==="DRAGGING"&&d.actions.cancel({shouldBlockNextClick:!0}),d.type==="PENDING"&&d.actions.abort()},[a]),c=ge(function(){var f={capture:!0,passive:!1},m={cancel:l,completed:a,getPhase:n},v=xt(window,QD(m),f),g=xt(window,ZD(m),f);t.current=function(){v(),g()}},[l,n,a]),u=ge(function(){var f=n();f.type!=="PENDING"&&le();var m=f.actions.fluidLift(f.point);r({type:"DRAGGING",actions:m,hasMoved:!1})},[n,r]),p=ge(function(f,m){n().type!=="IDLE"&&le();var v=setTimeout(u,KD);r({type:"PENDING",point:m,actions:f,longPressTimerId:v}),c()},[c,n,r,u]);ct(function(){return o(),function(){t.current();var m=n();m.type==="PENDING"&&(clearTimeout(m.longPressTimerId),r(Hs))}},[n,o,r]),ct(function(){var f=xt(window,[{eventName:"touchmove",fn:function(){},options:{capture:!1,passive:!1}}]);return f},[])}var tS={input:!0,button:!0,textarea:!0,select:!0,option:!0,optgroup:!0,video:!0,audio:!0};function Op(i,e){if(e==null)return!1;var t=!!tS[e.tagName.toLowerCase()];if(t)return!0;var n=e.getAttribute("contenteditable");return n==="true"||n===""?!0:e===i?!1:Op(i,e.parentElement)}function iS(i,e){var t=e.target;return hs(t)?Op(i,t):!1}var nS=function(i){return Mt(i.getBoundingClientRect()).center};function rS(i){return i instanceof _p(i).Element}var sS=function(){var i="matches";if(typeof document>"u")return i;var e=[i,"msMatchesSelector","webkitMatchesSelector"],t=Zt(e,function(n){return n in Element.prototype});return t||i}();function jp(i,e){return i==null?null:i[sS](e)?i:jp(i.parentElement,e)}function oS(i,e){return i.closest?i.closest(e):jp(i,e)}function aS(i){return"["+Bi.contextId+'="'+i+'"]'}function lS(i,e){var t=e.target;if(!rS(t))return null;var n=aS(i),r=oS(t,n);return!r||!hs(r)?null:r}function cS(i,e){var t=lS(i,e);return t?t.getAttribute(Bi.draggableId):null}function dS(i,e){var t="["+wo.contextId+'="'+i+'"]',n=Gu(document.querySelectorAll(t)),r=Zt(n,function(s){return s.getAttribute(wo.id)===e});return!r||!hs(r)?null:r}function uS(i){i.preventDefault()}function ir(i){var e=i.expected,t=i.phase,n=i.isLockActive;return i.shouldWarn,!(!n()||e!==t)}function Ep(i){var e=i.lockAPI,t=i.store,n=i.registry,r=i.draggableId;if(e.isClaimed())return!1;var s=n.draggable.findById(r);return!(!s||!s.options.isEnabled||!Dp(t.getState(),r))}function pS(i){var e=i.lockAPI,t=i.contextId,n=i.store,r=i.registry,s=i.draggableId,o=i.forceSensorStop,a=i.sourceEvent,l=Ep({lockAPI:e,store:n,registry:r,draggableId:s});if(!l)return null;var c=r.draggable.getById(s),u=dS(t,c.descriptor.id);if(!u||a&&!c.options.canDragInteractiveElements&&iS(u,a))return null;var p=e.claim(o||qt),d="PRE_DRAG";function f(){return c.options.shouldRespectForcePress}function m(){return e.isActive(p)}function v(b,I){ir({expected:b,phase:d,isLockActive:m,shouldWarn:!0})&&n.dispatch(I())}var g=v.bind(null,"DRAGGING");function x(b){function I(){e.release(),d="COMPLETED"}d!=="PRE_DRAG"&&(I(),d!=="PRE_DRAG"&&le()),n.dispatch(sw(b.liftActionArgs)),d="DRAGGING";function P(E,A){if(A===void 0&&(A={shouldBlockNextClick:!1}),b.cleanup(),A.shouldBlockNextClick){var T=xt(window,[{eventName:"click",fn:uS,options:{once:!0,passive:!1,capture:!0}}]);setTimeout(T)}I(),n.dispatch(mp({reason:E}))}return _({isActive:function(){return ir({expected:"DRAGGING",phase:d,isLockActive:m,shouldWarn:!1})},shouldRespectForcePress:f,drop:function(A){return P("DROP",A)},cancel:function(A){return P("CANCEL",A)}},b.actions)}function y(b){var I=_n(function(E){g(function(){return fp({client:E})})}),P=x({liftActionArgs:{id:s,clientSelection:b,movementMode:"FLUID"},cleanup:function(){return I.cancel()},actions:{move:I}});return _({},P,{move:I})}function w(){var b={moveUp:function(){return g(fw)},moveRight:function(){return g(gw)},moveDown:function(){return g(mw)},moveLeft:function(){return g(vw)}};return x({liftActionArgs:{id:s,clientSelection:nS(u),movementMode:"SNAP"},cleanup:qt,actions:b})}function S(){var b=ir({expected:"PRE_DRAG",phase:d,isLockActive:m,shouldWarn:!0});b&&e.release()}var M={isActive:function(){return ir({expected:"PRE_DRAG",phase:d,isLockActive:m,shouldWarn:!1})},shouldRespectForcePress:f,fluidLift:y,snapLift:w,abort:S};return M}var hS=[qD,JD,eS];function fS(i){var e=i.contextId,t=i.store,n=i.registry,r=i.customSensors,s=i.enableDefaultSensors,o=[].concat(s?hS:[],r||[]),a=D.useState(function(){return OD()})[0],l=ge(function(y,w){y.isDragging&&!w.isDragging&&a.tryAbandon()},[a]);ct(function(){var y=t.getState(),w=t.subscribe(function(){var S=t.getState();l(y,S),y=S});return w},[a,t,l]),ct(function(){return a.tryAbandon},[a.tryAbandon]);for(var c=ge(function(x){return Ep({lockAPI:a,registry:n,store:t,draggableId:x})},[a,n,t]),u=ge(function(x,y,w){return pS({lockAPI:a,registry:n,contextId:e,store:t,draggableId:x,forceSensorStop:y,sourceEvent:w&&w.sourceEvent?w.sourceEvent:null})},[e,a,n,t]),p=ge(function(x){return cS(e,x)},[e]),d=ge(function(x){var y=n.draggable.findById(x);return y?y.options:null},[n.draggable]),f=ge(function(){a.isClaimed()&&(a.tryAbandon(),t.getState().phase!=="IDLE"&&t.dispatch(aa()))},[a,t]),m=ge(a.isClaimed,[a]),v=ke(function(){return{canGetLock:c,tryGetLock:u,findClosestDraggableId:p,findOptionsForDraggable:d,tryReleaseLock:f,isLockClaimed:m}},[c,u,p,d,f,m]),g=0;g<o.length;g++)o[g](v)}var mS=function(e){return{onBeforeCapture:e.onBeforeCapture,onBeforeDragStart:e.onBeforeDragStart,onDragStart:e.onDragStart,onDragEnd:e.onDragEnd,onDragUpdate:e.onDragUpdate}};function on(i){return i.current||le(),i.current}function gS(i){var e=i.contextId,t=i.setCallbacks,n=i.sensors,r=i.nonce,s=i.dragHandleUsageInstructions,o=D.useRef(null),a=Mp(i),l=ge(function(){return mS(a.current)},[a]),c=_D(e),u=PD({contextId:e,text:s}),p=yD(e,r),d=ge(function(E){on(o).dispatch(E)},[]),f=ke(function(){return Wl({publishWhileDragging:aw,updateDroppableScroll:cw,updateDroppableIsEnabled:dw,updateDroppableIsCombineEnabled:uw,collectionStarting:lw},d)},[d]),m=SD(),v=ke(function(){return Xw(m,f)},[m,f]),g=ke(function(){return fD(_({scrollWindow:Zw,scrollDroppable:v.scrollDroppable},Wl({move:fp},d)))},[v.scrollDroppable,d]),x=wD(e),y=ke(function(){return Yw({announce:c,autoScroller:g,dimensionMarshal:v,focusMarshal:x,getResponders:l,styleMarshal:p})},[c,g,v,x,l,p]);o.current=y;var w=ge(function(){var E=on(o),A=E.getState();A.phase!=="IDLE"&&E.dispatch(aa())},[]),S=ge(function(){var E=on(o).getState();return E.isDragging||E.phase==="DROP_ANIMATING"},[]),M=ke(function(){return{isDragging:S,tryAbort:w}},[S,w]);t(M);var b=ge(function(E){return Dp(on(o).getState(),E)},[]),I=ge(function(){return ui(on(o).getState())},[]),P=ke(function(){return{marshal:v,focus:x,contextId:e,canLift:b,isMovementAllowed:I,dragHandleUsageInstructionsId:u,registry:m}},[e,v,u,x,b,I,m]);return fS({contextId:e,store:y,registry:m,customSensors:n,enableDefaultSensors:i.enableDefaultSensors!==!1}),D.useEffect(function(){return w},[w]),ve.createElement(fs.Provider,{value:P},ve.createElement(Wx,{context:ma,store:y},i.children))}var vS=0;function xS(){return ke(function(){return""+vS++},[])}function yS(i){var e=xS(),t=i.dragHandleUsageInstructions||hr.dragHandleUsageInstructions;return ve.createElement(Jy,null,function(n){return ve.createElement(gS,{nonce:i.nonce,contextId:e,setCallbacks:n,dragHandleUsageInstructions:t,enableDefaultSensors:i.enableDefaultSensors,sensors:i.sensors,onBeforeCapture:i.onBeforeCapture,onBeforeDragStart:i.onBeforeDragStart,onDragStart:i.onDragStart,onDragUpdate:i.onDragUpdate,onDragEnd:i.onDragEnd},i.children)})}var Rp=function(e){return function(t){return e===t}},bS=Rp("scroll"),wS=Rp("auto"),Kc=function(e,t){return t(e.overflowX)||t(e.overflowY)},DS=function(e){var t=window.getComputedStyle(e),n={overflowX:t.overflowX,overflowY:t.overflowY};return Kc(n,bS)||Kc(n,wS)},SS=function(){return!1},IS=function i(e){return e==null?null:e===document.body?SS()?e:null:e===document.documentElement?null:DS(e)?e:i(e.parentElement)},Do=function(i){return{x:i.scrollLeft,y:i.scrollTop}},CS=function i(e){if(!e)return!1;var t=window.getComputedStyle(e);return t.position==="fixed"?!0:i(e.parentElement)},_S=function(i){var e=IS(i),t=CS(i);return{closestScrollable:e,isFixedOnPage:t}},MS=function(i){var e=i.descriptor,t=i.isEnabled,n=i.isCombineEnabled,r=i.isFixedOnPage,s=i.direction,o=i.client,a=i.page,l=i.closest,c=function(){if(!l)return null;var f=l.scrollSize,m=l.client,v=yp({scrollHeight:f.scrollHeight,scrollWidth:f.scrollWidth,height:m.paddingBox.height,width:m.paddingBox.width});return{pageMarginBox:l.page.marginBox,frameClient:m,scrollSize:f,shouldClipSubject:l.shouldClipSubject,scroll:{initial:l.scroll,current:l.scroll,max:v,diff:{value:qe,displacement:qe}}}}(),u=s==="vertical"?ia:Qu,p=Fi({page:a,withPlaceholder:null,axis:u,frame:c}),d={descriptor:e,isCombineEnabled:n,isFixedOnPage:r,axis:u,isEnabled:t,client:o,page:a,frame:c,subject:p};return d},kS=function(e,t){var n=zu(e);if(!t||e!==t)return n;var r=n.paddingBox.top-t.scrollTop,s=n.paddingBox.left-t.scrollLeft,o=r+t.scrollHeight,a=s+t.scrollWidth,l={top:r,right:a,bottom:o,left:s},c=Xo(l,n.border),u=Zo({borderBox:c,margin:n.margin,border:n.border,padding:n.padding});return u},TS=function(i){var e=i.ref,t=i.descriptor,n=i.env,r=i.windowScroll,s=i.direction,o=i.isDropDisabled,a=i.isCombineEnabled,l=i.shouldClipSubject,c=n.closestScrollable,u=kS(e,c),p=_r(u,r),d=function(){if(!c)return null;var m=zu(c),v={scrollHeight:c.scrollHeight,scrollWidth:c.scrollWidth};return{client:m,page:_r(m,r),scroll:Do(c),scrollSize:v,shouldClipSubject:l}}(),f=MS({descriptor:t,isEnabled:!o,isCombineEnabled:a,isFixedOnPage:n.isFixedOnPage,direction:s,client:u,page:p,closest:d});return f},PS={passive:!1},OS={passive:!0},Xc=function(i){return i.shouldPublishImmediately?PS:OS};function jr(i){var e=D.useContext(i);return e||le(),e}var nr=function(e){return e&&e.env.closestScrollable||null};function jS(i){var e=D.useRef(null),t=jr(fs),n=ga("droppable"),r=t.registry,s=t.marshal,o=Mp(i),a=ke(function(){return{id:i.droppableId,type:i.type,mode:i.mode}},[i.droppableId,i.mode,i.type]),l=D.useRef(a),c=ke(function(){return He(function(S,M){e.current||le();var b={x:S,y:M};s.updateDroppableScroll(a.id,b)})},[a.id,s]),u=ge(function(){var S=e.current;return!S||!S.env.closestScrollable?qe:Do(S.env.closestScrollable)},[]),p=ge(function(){var S=u();c(S.x,S.y)},[u,c]),d=ke(function(){return _n(p)},[p]),f=ge(function(){var S=e.current,M=nr(S);S&&M||le();var b=S.scrollOptions;if(b.shouldPublishImmediately){p();return}d()},[d,p]),m=ge(function(S,M){e.current&&le();var b=o.current,I=b.getDroppableRef();I||le();var P=_S(I),E={ref:I,descriptor:a,env:P,scrollOptions:M};e.current=E;var A=TS({ref:I,descriptor:a,env:P,windowScroll:S,direction:b.direction,isDropDisabled:b.isDropDisabled,isCombineEnabled:b.isCombineEnabled,shouldClipSubject:!b.ignoreContainerClipping}),T=P.closestScrollable;return T&&(T.setAttribute(Uc.contextId,t.contextId),T.addEventListener("scroll",f,Xc(E.scrollOptions))),A},[t.contextId,a,f,o]),v=ge(function(){var S=e.current,M=nr(S);return S&&M||le(),Do(M)},[]),g=ge(function(){var S=e.current;S||le();var M=nr(S);e.current=null,M&&(d.cancel(),M.removeAttribute(Uc.contextId),M.removeEventListener("scroll",f,Xc(S.scrollOptions)))},[f,d]),x=ge(function(S){var M=e.current;M||le();var b=nr(M);b||le(),b.scrollTop+=S.y,b.scrollLeft+=S.x},[]),y=ke(function(){return{getDimensionAndWatchScroll:m,getScrollWhileDragging:v,dragStopped:g,scroll:x}},[g,m,v,x]),w=ke(function(){return{uniqueId:n,descriptor:a,callbacks:y}},[y,a,n]);ct(function(){return l.current=w.descriptor,r.droppable.register(w),function(){e.current&&g(),r.droppable.unregister(w)}},[y,a,g,w,s,r.droppable]),ct(function(){e.current&&s.updateDroppableIsEnabled(l.current.id,!i.isDropDisabled)},[i.isDropDisabled,s]),ct(function(){e.current&&s.updateDroppableIsCombineEnabled(l.current.id,i.isCombineEnabled)},[i.isCombineEnabled,s])}function qs(){}var Zc={width:0,height:0,margin:tb},ES=function(e){var t=e.isAnimatingOpenOnMount,n=e.placeholder,r=e.animate;return t||r==="close"?Zc:{height:n.client.borderBox.height,width:n.client.borderBox.width,margin:n.client.margin}},RS=function(e){var t=e.isAnimatingOpenOnMount,n=e.placeholder,r=e.animate,s=ES({isAnimatingOpenOnMount:t,placeholder:n,animate:r});return{display:n.display,boxSizing:"border-box",width:s.width,height:s.height,marginTop:s.margin.top,marginRight:s.margin.right,marginBottom:s.margin.bottom,marginLeft:s.margin.left,flexShrink:"0",flexGrow:"0",pointerEvents:"none",transition:r!=="none"?gn.placeholder:null}};function AS(i){var e=D.useRef(null),t=ge(function(){e.current&&(clearTimeout(e.current),e.current=null)},[]),n=i.animate,r=i.onTransitionEnd,s=i.onClose,o=i.contextId,a=D.useState(i.animate==="open"),l=a[0],c=a[1];D.useEffect(function(){return l?n!=="open"?(t(),c(!1),qs):e.current?qs:(e.current=setTimeout(function(){e.current=null,c(!1)}),t):qs},[n,l,t]);var u=ge(function(d){d.propertyName==="height"&&(r(),n==="close"&&s())},[n,s,r]),p=RS({isAnimatingOpenOnMount:l,animate:i.animate,placeholder:i.placeholder});return ve.createElement(i.placeholder.tagName,{style:p,"data-rbd-placeholder-context-id":o,onTransitionEnd:u,ref:i.innerRef})}var NS=ve.memo(AS),xa=ve.createContext(null),$S=function(i){Mo(e,i);function e(){for(var n,r=arguments.length,s=new Array(r),o=0;o<r;o++)s[o]=arguments[o];return n=i.call.apply(i,[this].concat(s))||this,n.state={isVisible:!!n.props.on,data:n.props.on,animate:n.props.shouldAnimate&&n.props.on?"open":"none"},n.onClose=function(){n.state.animate==="close"&&n.setState({isVisible:!1})},n}e.getDerivedStateFromProps=function(r,s){return r.shouldAnimate?r.on?{isVisible:!0,data:r.on,animate:"open"}:s.isVisible?{isVisible:!0,data:s.data,animate:"close"}:{isVisible:!1,animate:"close",data:null}:{isVisible:!!r.on,data:r.on,animate:"none"}};var t=e.prototype;return t.render=function(){if(!this.state.isVisible)return null;var r={onClose:this.onClose,data:this.state.data,animate:this.state.animate};return this.props.children(r)},e}(ve.PureComponent),Qc={dragging:5e3,dropAnimating:4500},WS=function(e,t){return t?gn.drop(t.duration):e?gn.snap:gn.fluid},FS=function(e,t){return e?t?Pn.opacity.drop:Pn.opacity.combining:null},LS=function(e){return e.forceShouldAnimate!=null?e.forceShouldAnimate:e.mode==="SNAP"};function BS(i){var e=i.dimension,t=e.client,n=i.offset,r=i.combineWith,s=i.dropping,o=!!r,a=LS(i),l=!!s,c=l?yo.drop(n,o):yo.moveTo(n),u={position:"fixed",top:t.marginBox.top,left:t.marginBox.left,boxSizing:"border-box",width:t.borderBox.width,height:t.borderBox.height,transition:WS(a,s),transform:c,opacity:FS(o,l),zIndex:l?Qc.dropAnimating:Qc.dragging,pointerEvents:"none"};return u}function VS(i){return{transform:yo.moveTo(i.offset),transition:i.shouldAnimateDisplacement?null:"none"}}function zS(i){return i.type==="DRAGGING"?BS(i):VS(i)}function HS(i,e,t){t===void 0&&(t=qe);var n=window.getComputedStyle(e),r=e.getBoundingClientRect(),s=Vu(r,n),o=_r(s,t),a={client:s,tagName:e.tagName.toLowerCase(),display:n.display},l={x:s.marginBox.width,y:s.marginBox.height},c={descriptor:i,placeholder:a,displaceBy:l,client:s,page:o};return c}function qS(i){var e=ga("draggable"),t=i.descriptor,n=i.registry,r=i.getDraggableRef,s=i.canDragInteractiveElements,o=i.shouldRespectForcePress,a=i.isEnabled,l=ke(function(){return{canDragInteractiveElements:s,shouldRespectForcePress:o,isEnabled:a}},[s,a,o]),c=ge(function(f){var m=r();return m||le(),HS(t,m,f)},[t,r]),u=ke(function(){return{uniqueId:e,descriptor:t,options:l,getDimension:c}},[t,c,l,e]),p=D.useRef(u),d=D.useRef(!0);ct(function(){return n.draggable.register(p.current),function(){return n.draggable.unregister(p.current)}},[n.draggable]),ct(function(){if(d.current){d.current=!1;return}var f=p.current;p.current=u,n.draggable.update(u,f)},[u,n.draggable])}function US(i){i.preventDefault()}function YS(i){var e=D.useRef(null),t=ge(function(E){e.current=E},[]),n=ge(function(){return e.current},[]),r=jr(fs),s=r.contextId,o=r.dragHandleUsageInstructionsId,a=r.registry,l=jr(xa),c=l.type,u=l.droppableId,p=ke(function(){return{id:i.draggableId,index:i.index,type:c,droppableId:u}},[i.draggableId,i.index,c,u]),d=i.children,f=i.draggableId,m=i.isEnabled,v=i.shouldRespectForcePress,g=i.canDragInteractiveElements,x=i.isClone,y=i.mapped,w=i.dropAnimationFinished;if(!x){var S=ke(function(){return{descriptor:p,registry:a,getDraggableRef:n,canDragInteractiveElements:g,shouldRespectForcePress:v,isEnabled:m}},[p,a,n,g,v,m]);qS(S)}var M=ke(function(){return m?{tabIndex:0,role:"button","aria-describedby":o,"data-rbd-drag-handle-draggable-id":f,"data-rbd-drag-handle-context-id":s,draggable:!1,onDragStart:US}:null},[s,o,f,m]),b=ge(function(E){y.type==="DRAGGING"&&y.dropping&&E.propertyName==="transform"&&w()},[w,y]),I=ke(function(){var E=zS(y),A=y.type==="DRAGGING"&&y.dropping?b:null,T={innerRef:t,draggableProps:{"data-rbd-draggable-context-id":s,"data-rbd-draggable-id":f,style:E,onTransitionEnd:A},dragHandleProps:M};return T},[s,M,f,y,b,t]),P=ke(function(){return{draggableId:p.id,type:p.type,source:{index:p.index,droppableId:p.droppableId}}},[p.droppableId,p.id,p.index,p.type]);return d(I,y.snapshot,P)}var Ap=function(i,e){return i===e},Np=function(i){var e=i.combine,t=i.destination;return t?t.droppableId:e?e.droppableId:null},GS=function(e){return e.combine?e.combine.draggableId:null},JS=function(e){return e.at&&e.at.type==="COMBINE"?e.at.combine.draggableId:null};function KS(){var i=He(function(r,s){return{x:r,y:s}}),e=He(function(r,s,o,a,l){return{isDragging:!0,isClone:s,isDropAnimating:!!l,dropAnimation:l,mode:r,draggingOver:o,combineWith:a,combineTargetFor:null}}),t=He(function(r,s,o,a,l,c,u){return{mapped:{type:"DRAGGING",dropping:null,draggingOver:l,combineWith:c,mode:s,offset:r,dimension:o,forceShouldAnimate:u,snapshot:e(s,a,l,c,null)}}}),n=function(s,o){if(s.isDragging){if(s.critical.draggable.id!==o.draggableId)return null;var a=s.current.client.offset,l=s.dimensions.draggables[o.draggableId],c=lt(s.impact),u=JS(s.impact),p=s.forceShouldAnimate;return t(i(a.x,a.y),s.movementMode,l,o.isClone,c,u,p)}if(s.phase==="DROP_ANIMATING"){var d=s.completed;if(d.result.draggableId!==o.draggableId)return null;var f=o.isClone,m=s.dimensions.draggables[o.draggableId],v=d.result,g=v.mode,x=Np(v),y=GS(v),w=s.dropDuration,S={duration:w,curve:ca.drop,moveTo:s.newHomeClientOffset,opacity:y?Pn.opacity.drop:null,scale:y?Pn.scale.drop:null};return{mapped:{type:"DRAGGING",offset:s.newHomeClientOffset,dimension:m,dropping:S,draggingOver:x,combineWith:y,mode:g,forceShouldAnimate:null,snapshot:e(g,f,x,y,S)}}}return null};return n}function $p(i){return{isDragging:!1,isDropAnimating:!1,isClone:!1,dropAnimation:null,mode:null,draggingOver:null,combineTargetFor:i,combineWith:null}}var XS={mapped:{type:"SECONDARY",offset:qe,combineTargetFor:null,shouldAnimateDisplacement:!0,snapshot:$p(null)}};function ZS(){var i=He(function(o,a){return{x:o,y:a}}),e=He($p),t=He(function(o,a,l){return a===void 0&&(a=null),{mapped:{type:"SECONDARY",offset:o,combineTargetFor:a,shouldAnimateDisplacement:l,snapshot:e(a)}}}),n=function(a){return a?t(qe,a,!0):null},r=function(a,l,c,u){var p=c.displaced.visible[a],d=!!(u.inVirtualList&&u.effected[a]),f=ds(c),m=f&&f.draggableId===a?l:null;if(!p){if(!d)return n(m);if(c.displaced.invisible[a])return null;var v=Yi(u.displacedBy.point),g=i(v.x,v.y);return t(g,m,!0)}if(d)return n(m);var x=c.displacedBy.point,y=i(x.x,x.y);return t(y,m,p.shouldAnimate)},s=function(a,l){if(a.isDragging)return a.critical.draggable.id===l.draggableId?null:r(l.draggableId,a.critical.draggable.id,a.impact,a.afterCritical);if(a.phase==="DROP_ANIMATING"){var c=a.completed;return c.result.draggableId===l.draggableId?null:r(l.draggableId,c.result.draggableId,c.impact,c.afterCritical)}return null};return s}var QS=function(){var e=KS(),t=ZS(),n=function(s,o){return e(s,o)||t(s,o)||XS};return n},e0={dropAnimationFinished:gp},t0=Lu(QS,e0,null,{context:ma,pure:!0,areStatePropsEqual:Ap})(YS);function Wp(i){var e=jr(xa),t=e.isUsingCloneFor;return t===i.draggableId&&!i.isClone?null:ve.createElement(t0,i)}function i0(i){var e=typeof i.isDragDisabled=="boolean"?!i.isDragDisabled:!0,t=!!i.disableInteractiveElementBlocking,n=!!i.shouldRespectForcePress;return ve.createElement(Wp,_({},i,{isClone:!1,isEnabled:e,canDragInteractiveElements:t,shouldRespectForcePress:n}))}function n0(i){var e=D.useContext(fs);e||le();var t=e.contextId,n=e.isMovementAllowed,r=D.useRef(null),s=D.useRef(null),o=i.children,a=i.droppableId,l=i.type,c=i.mode,u=i.direction,p=i.ignoreContainerClipping,d=i.isDropDisabled,f=i.isCombineEnabled,m=i.snapshot,v=i.useClone,g=i.updateViewportMaxScroll,x=i.getContainerForClone,y=ge(function(){return r.current},[]),w=ge(function(T){r.current=T},[]);ge(function(){return s.current},[]);var S=ge(function(T){s.current=T},[]),M=ge(function(){n()&&g({maxScroll:wp()})},[n,g]);jS({droppableId:a,type:l,mode:c,direction:u,isDropDisabled:d,isCombineEnabled:f,ignoreContainerClipping:p,getDroppableRef:y});var b=ve.createElement($S,{on:i.placeholder,shouldAnimate:i.shouldAnimatePlaceholder},function(T){var W=T.onClose,F=T.data,j=T.animate;return ve.createElement(NS,{placeholder:F,onClose:W,innerRef:S,animate:j,contextId:t,onTransitionEnd:M})}),I=ke(function(){return{innerRef:w,placeholder:b,droppableProps:{"data-rbd-droppable-id":a,"data-rbd-droppable-context-id":t}}},[t,a,b,w]),P=v?v.dragging.draggableId:null,E=ke(function(){return{droppableId:a,type:l,isUsingCloneFor:P}},[a,P,l]);function A(){if(!v)return null;var T=v.dragging,W=v.render,F=ve.createElement(Wp,{draggableId:T.draggableId,index:T.source.index,isClone:!0,isEnabled:!0,shouldRespectForcePress:!1,canDragInteractiveElements:!0},function(j,O){return W(j,O,T)});return Cf.createPortal(F,x())}return ve.createElement(xa.Provider,{value:E},o(I,m),A())}var Us=function(e,t){return e===t.droppable.type},ed=function(e,t){return t.draggables[e.draggable.id]},r0=function(){var e={placeholder:null,shouldAnimatePlaceholder:!0,snapshot:{isDraggingOver:!1,draggingOverWith:null,draggingFromThisWith:null,isUsingPlaceholder:!1},useClone:null},t=_({},e,{shouldAnimatePlaceholder:!1}),n=He(function(o){return{draggableId:o.id,type:o.type,source:{index:o.index,droppableId:o.droppableId}}}),r=He(function(o,a,l,c,u,p){var d=u.descriptor.id,f=u.descriptor.droppableId===o;if(f){var m=p?{render:p,dragging:n(u.descriptor)}:null,v={isDraggingOver:l,draggingOverWith:l?d:null,draggingFromThisWith:d,isUsingPlaceholder:!0};return{placeholder:u.placeholder,shouldAnimatePlaceholder:!1,snapshot:v,useClone:m}}if(!a)return t;if(!c)return e;var g={isDraggingOver:l,draggingOverWith:d,draggingFromThisWith:null,isUsingPlaceholder:!0};return{placeholder:u.placeholder,shouldAnimatePlaceholder:!0,snapshot:g,useClone:null}}),s=function(a,l){var c=l.droppableId,u=l.type,p=!l.isDropDisabled,d=l.renderClone;if(a.isDragging){var f=a.critical;if(!Us(u,f))return t;var m=ed(f,a.dimensions),v=lt(a.impact)===c;return r(c,p,v,v,m,d)}if(a.phase==="DROP_ANIMATING"){var g=a.completed;if(!Us(u,g.critical))return t;var x=ed(g.critical,a.dimensions);return r(c,p,Np(g.result)===c,lt(g.impact)===c,x,d)}if(a.phase==="IDLE"&&a.completed&&!a.shouldFlush){var y=a.completed;if(!Us(u,y.critical))return t;var w=lt(y.impact)===c,S=!!(y.impact.at&&y.impact.at.type==="COMBINE"),M=y.critical.droppable.id===c;return w?S?e:t:M?e:t}return t};return s},s0={updateViewportMaxScroll:hw};function o0(){return document.body||le(),document.body}var a0={mode:"standard",type:"DEFAULT",direction:"vertical",isDropDisabled:!1,isCombineEnabled:!1,ignoreContainerClipping:!1,renderClone:null,getContainerForClone:o0},Fp=Lu(r0,s0,null,{context:ma,pure:!0,areStatePropsEqual:Ap})(n0);Fp.defaultProps=a0;function m1(i){window.__widgetsLoadIndicator=i}wn.init({name:"iobroker_vis",remotes:[]});function td(i){const e=[];for(let t=0;t<i.visWidgetsCollection.components.length;t++)((n,r)=>{i.countRef.max++;const s=wn.loadRemote(`${i.visWidgetsCollection.name}/${r.components[n]}`).then(o=>{o&&(i.countRef.count++,o.default?(o.default.adapter=i.dynamicWidgetInstance._id.substring(15).replace(/\.\d*$/,""),o.default.version=i.dynamicWidgetInstance.common.version,o.default.url=r.url,i.i18nPrefix&&(o.default.i18nPrefix=i.i18nPrefix),i.result.push(o.default)):console.error(`Cannot load widget ${i.dynamicWidgetInstance._id}. No default found`),window.__widgetsLoadIndicator&&window.__widgetsLoadIndicator(i.countRef.count,i.countRef.max))}).catch(o=>{console.error(`Cannot load widget ${i.dynamicWidgetInstance._id}: ${o.toString()}`),console.error(`Cannot load widget ${i.dynamicWidgetInstance._id}: ${JSON.stringify(o)}`)});e.push(s)})(t,i.visWidgetsCollection);return Promise.all(e)}function l0(i){return typeof i=="object"?i[N.I18n.getLanguage()]||i.en||"":(i||"").toString()}function c0(i,e){return i.getObjectViewSystem("instance","system.adapter.","system.adapter.香").then(t=>{var l;const n=[],r={count:0,max:0},o=Object.values(t).filter(c=>c.common.visWidgets?!(c.common.visWidgets.ignoreInVersions||[]).includes(2)&&(!e||e.includes(l0(c.common.name))):!1),a=[];for(let c=0;c<o.length;c++){const u=o[c];for(const p in u.common.visWidgets)if(p==="i18n"){const d=Object.keys(u.common.visWidgets).find(f=>f!=="i18n");console.warn(`common.visWidgets.i18n is deprecated. Use common.visWidgets.${d}.i18n instead.`)}else{const d=u.common.visWidgets[p];if(Array.isArray(d.ignoreInVersions)&&d.ignoreInVersions.includes(2))continue;(l=d.url)!=null&&l.startsWith("http")||(d.url=`./vis-2/widgets/${d.url}`),wn.registerRemotes([{name:d.name,entry:d.url,type:d.bundlerType||void 0}]),d.components&&((f,m)=>{try{let v="",g;if(f.url&&f.i18n===!0){const x=f.url.lastIndexOf("/");let y;x!==-1?y=f.url.substring(0,x):y=f.url;const w=N.I18n.getLanguage();g=fetch(`${y}/i18n/${w}.json`).then(S=>S.json()).then(S=>{r.count++,N.I18n.extendTranslations(S,w),window.__widgetsLoadIndicator&&window.__widgetsLoadIndicator(r.count,a.length)}).catch(S=>w!=="en"?fetch(`${y}/i18n/en.json`).then(M=>M.json()).then(M=>{r.count++,N.I18n.extendTranslations(M,w),window.__widgetsLoadIndicator&&window.__widgetsLoadIndicator(r.count,a.length)}).catch(M=>console.log(`Cannot load i18n "${y}/i18n/${w}.json": ${M}`)):(console.log(`Cannot load i18n "${y}/i18n/${w}.json": ${S}`),null)),a.push(g)}else if(f.url&&f.i18n==="component")g=wn.loadRemote(`${f.name}/translations`).then(x=>{r.count++,x.default.prefix===!0&&(x.default.prefix=`${m.common.name}_`),v=x.default.prefix,N.I18n.extendTranslations(x.default),window.__widgetsLoadIndicator&&window.__widgetsLoadIndicator(r.count,a.length)}).catch(x=>console.log(`Cannot load i18n "${f.name}": ${x}`));else if(f.i18n&&typeof f.i18n=="object")try{N.I18n.extendTranslations(f.i18n)}catch(x){console.error(`Cannot import i18n: ${x}`)}f.components?g instanceof Promise?a.push(g.then(()=>td({visWidgetsCollection:f,countRef:r,dynamicWidgetInstance:m,i18nPrefix:v,result:n}))):a.push(td({visWidgetsCollection:f,countRef:r,dynamicWidgetInstance:m,i18nPrefix:v,result:n})):g instanceof Promise&&a.push(g)}catch(v){console.error(v)}})(d,u)}}return Promise.all(a).then(()=>n)}).catch(t=>console.error("Cannot read instances",t))}const Nt={widgetIcon:{overflow:"hidden",width:40,height:40,display:"inline-block",marginRight:4},icon:{width:"100%",height:"100%",objectFit:"contain"},widgetName:{verticalAlign:"top",display:"inline-block"},widgetImage:{display:"block",width:30,height:30,transformOrigin:"0 0"},widgetType:{verticalAlign:"top",display:"inline-block",fontSize:12,fontStyle:"italic",marginLeft:8},widgetNameText:{lineHeight:"20px"},coloredWidgetSet:{padding:"0 3px",borderRadius:3}},id=34,d0=[".png",".jpg",".svg",".gif",".apng",".avif",".webp"],u0=({id:i,children:e,index:t,moveCard:n,onDropped:r,selected:s})=>{const o=D.useRef(null),[{handlerId:a},l]=kg({accept:"widget",collect(d){return{handlerId:d.getHandlerId()}},drop(){r()},hover(d,f){var S;if(!o.current)return;const m=d.index,v=t;if(m===v)return;const g=(S=o.current)==null?void 0:S.getBoundingClientRect(),x=(g.bottom-g.top)/2,y=f.getClientOffset(),w=((y==null?void 0:y.y)||0)-g.top;m<v&&w<x||m>v&&w>x||(n(m,v),d.index=v)}}),[{isDragging:c},u]=bg({type:"widget",item:()=>({id:i,index:t}),collect:d=>({isDragging:d.isDragging()})}),p=c?0:1;return u(l(o)),h.jsx(k.MenuItem,{ref:o,selected:s,style:{opacity:p},"data-handler-id":a,onClick:()=>r(t),children:e})};class p0 extends ve.Component{imageRef;widgetTypes;constructor(e){super(e),this.widgetTypes=mr(),this.imageRef=[];for(let t=0;t<this.props.order.length;t++)this.imageRef.push(ve.createRef());this.state={order:[...this.props.order]}}componentDidUpdate(){var e;for(let t=0;t<this.state.order.length;t++)if((e=this.imageRef[t].current)!=null&&e.children[0]){const n=this.imageRef[t].current.children[0].clientHeight;n>id&&(this.imageRef[t].current.style.transform=`scale(${id/n})`)}}moveCard=(e,t)=>{const n=[...this.state.order],r=n[e];n.splice(e,1),n.splice(t,0,r),this.setState({order:n})};getWidgetDiv(e,t){var d;const n=this.props.views[this.props.view].widgets[e],r=n.tpl,s=this.widgetTypes.find(f=>f.name===r);let o=(s==null?void 0:s.title)||"",a=s==null?void 0:s.setColor;s!=null&&s.label&&(o=N.I18n.t(s.label)),o=o.split("<br")[0],o=o.split("<span")[0],o=o.split("<div")[0];let l=s==null?void 0:s.set;if(s!=null&&s.setLabel)l=N.I18n.t(s.setLabel);else if(l){const f=this.widgetTypes.find(m=>m.set===l&&m.setLabel);f&&(a=f.setColor,f.setLabel&&(l=N.I18n.t(f.setLabel)))}let c=(s==null?void 0:s.preview)||"";if(c.startsWith("<img")){const f=c.match(/src="([^"]+)"/);f&&f[1]&&(c=f[1])}let u;if((d=s==null?void 0:s.preview)!=null&&d.startsWith("<img")){const f=(s==null?void 0:s.preview.match(/src="([^"]+)"/))||(s==null?void 0:s.preview.match(/src='([^']+)'/));f&&(u=h.jsx("img",{src:f[1],style:Nt.icon,alt:e}))}else if(s!=null&&s.preview){const f=s.preview.toLowerCase();d0.find(m=>f.endsWith(m))&&(u=h.jsx("img",{src:s==null?void 0:s.preview,style:Nt.icon,alt:e}))}!u&&(s!=null&&s.preview)&&(u=h.jsx("span",{style:Nt.widgetImage,ref:this.imageRef[t],dangerouslySetInnerHTML:{__html:s.preview}}));let p;return a&&(p=N.Utils.getInvertedColor(a,this.props.themeType,!1),p==="#DDD"?p="#FFF":p==="#111"&&(p="#000")),r==="_tplGroup"&&(o=N.I18n.t("group")),n.marketplace&&(l=`${n.marketplace.name}`,o=`${N.I18n.t("version")} ${n.marketplace.version}`),h.jsx(u0,{id:e,index:t,selected:this.props.wid===e,moveCard:this.moveCard,onDropped:f=>this.onMove(f),children:h.jsxs("div",{style:{display:"flex",flexWrap:"wrap"},children:[c?h.jsx("div",{style:Nt.widgetIcon,children:u}):null,h.jsx("div",{style:Nt.widgetName,children:e}),h.jsxs("div",{style:Nt.widgetType,children:[h.jsx("div",{style:{...Nt.widgetNameText,...p?Nt.coloredWidgetSet:void 0,fontWeight:"bold",color:a,backgroundColor:p},children:l}),h.jsx("div",{style:Nt.widgetNameText,children:o})]})]})},e)}onMove(e){if(e!==void 0){const t=[...this.state.order],n=t[e];t[e]=this.props.wid,t[this.state.order.indexOf(this.props.wid)]=n,this.setState({order:t},()=>{JSON.stringify(this.state.order)!==JSON.stringify(this.props.order)&&this.props.onClose(this.state.order)});return}JSON.stringify(this.state.order)!==JSON.stringify(this.props.order)&&this.props.onClose(this.state.order)}render(){return h.jsxs(k.Menu,{anchorEl:this.props.anchorEl,open:!0,onClose:()=>this.props.onClose(),children:[h.jsx("div",{style:{padding:21,fontWeight:"normal",width:250,fontSize:12,fontStyle:"italic",textAlign:"center"},children:N.I18n.t("order_help")}),h.jsx(Km,{backend:Vg,children:this.state.order.map((e,t)=>this.getWidgetDiv(e,t))})]})}}class Se extends ve.Component{static FORBIDDEN_CHARS=/[^._\-/ :!#$%&()+=@^{}|~]+/g;relativeMoveMenu;resize=!1;uuid=`${Date.now()}.${Math.round(Math.random()*1e6)}`;refService=ve.createRef();widDiv=null;onCommandBound;onResize;updateInterval;pressTimeout;shadowDiv;stealCursor;beforeIncludeColor;lastClick;movement;resizeLocked;visDynamicResizable;isCanWidget;constructor(e){var a,l,c;super(e);const t=e.context.views[e.view].widgets[e.id],n=e.id.includes("_"),r=!n&&e.editMode&&((a=e.selectedWidgets)==null?void 0:a.includes(e.id)),s=it(t.data||{}),o=it(t.style||{});Se.replacePRJ_NAME(s,o,e),this.state={data:s,style:o,applyBindings:!1,editMode:!n&&this.props.editMode,multiViewWidget:n,selected:r,selectedOne:r&&this.props.selectedWidgets.length===1,resizable:!0,resizeHandles:["n","e","s","w","nw","ne","sw","se"],widgetHint:e.context.widgetHint,isHidden:Se.isWidgetFilteredOutStatic(e.viewsActiveFilter,t.data,e.view,e.editMode),usedInWidget:t.usedInWidget,hideHelper:!1,gap:o.position==="relative"&&Ve((l=e.context.views[e.view].settings)==null?void 0:l.rowGap)?parseFloat((c=e.context.views[e.view].settings)==null?void 0:c.rowGap):0},this.onCommandBound=this.onCommand.bind(this)}static replacePRJ_NAME(e,t,n){const r=n.context;e&&(delete e._originalData,Object.keys(e).forEach(s=>{s&&e[s]&&typeof e[s]=="string"&&(s.startsWith("src")||s.endsWith("src")||s.includes("icon"))&&e[s].startsWith("_PRJ_NAME")&&(e._originalData||(e._originalData=JSON.stringify(e)),e[s]=`../${r.adapterName}.${r.instance}/${r.projectName}${e[s].substring(9)}`)})),t&&(delete t._originalData,t["background-image"]&&t["background-image"].startsWith("_PRJ_NAME")&&(t._originalData||(t._originalData=JSON.stringify(t)),t["background-image"]=`../${r.adapterName}.${r.instance}/${r.projectName}${t["background-image"].substring(9)}`))}componentDidMount(){this.props.askView&&this.props.askView("register",{id:this.props.id,uuid:this.uuid,widDiv:this.widDiv,refService:this.refService,onMove:this.onMove,onResize:this.onResize,onTempSelect:this.onTempSelect,onCommand:this.onCommandBound})}componentWillUnmount(){this.updateInterval&&clearInterval(this.updateInterval),this.updateInterval=void 0,this.pressTimeout&&clearTimeout(this.pressTimeout),this.pressTimeout=void 0,this.props.askView&&this.props.askView("unregister",{id:this.props.id,uuid:this.uuid}),this.shadowDiv&&(this.shadowDiv.remove(),this.shadowDiv=null)}onCommand(e,t){var n,r,s,o,a,l,c,u;if(e==="includePossible"){const p=(n=this.refService.current)==null?void 0:n.querySelector(".vis-editmode-overlay");return p&&this.beforeIncludeColor===void 0&&(this.beforeIncludeColor=p.style.backgroundColor,p.style.backgroundColor="rgba(0, 255, 0, 0.3)"),!0}if(e==="includePossibleNOT"){if(this.beforeIncludeColor!==void 0){const p=(r=this.refService.current)==null?void 0:r.querySelector(".vis-editmode-overlay");p&&(p.style.backgroundColor=this.beforeIncludeColor),this.beforeIncludeColor=void 0}return!0}if(e==="startStealMode"){this.stealCursor=((s=this.refService.current)==null?void 0:s.style.cursor)||"nocursor",this.refService.current&&(this.refService.current.style.cursor="crosshair",this.refService.current.className=_t(this.refService.current.className,"vis-editmode-steal-style"));const p=(o=this.refService.current)==null?void 0:o.querySelectorAll(".vis-editmode-resizer");return p==null||p.forEach(d=>d.style.display="none"),!0}if(e==="cancelStealMode"){this.stealCursor!=="nocursor"&&this.refService.current&&this.stealCursor&&(this.refService.current.style.cursor=this.stealCursor),this.stealCursor=void 0,this.refService.current&&(this.refService.current.className=nn(this.refService.current.className,"vis-editmode-steal-style"));const p=(a=this.refService.current)==null?void 0:a.querySelectorAll(".vis-editmode-resizer");return p==null||p.forEach(d=>d.style.display=""),!0}if(e==="startMove"||e==="startResize"){const p=(l=this.refService.current)==null?void 0:l.querySelector(".vis-editmode-overlay");return p&&(this.state.selected?p.className=nn(p.className,"vis-editmode-selected"):p.className=nn(p.className,"vis-editmode-overlay-not-selected")),e==="startResize"&&(this.resize=!0),!0}if(e==="stopMove"||e==="stopResize"){const p=(c=this.refService.current)==null?void 0:c.querySelector(".vis-editmode-overlay");p&&(this.beforeIncludeColor!==void 0&&(p.style.backgroundColor=this.beforeIncludeColor,this.beforeIncludeColor=void 0),this.state.selected?p.className=_t(p.className,"vis-editmode-selected"):p.className=_t(p.className,"vis-editmode-overlay-not-selected"));const d=(u=this.refService.current)==null?void 0:u.querySelectorAll(".vis-editmode-resizer");return d==null||d.forEach(f=>f.style.display="block"),e==="stopResize"&&(this.resize=!1),!0}return!1}static getDerivedStateFromProps(e,t){var f,m,v,g;const n=e.context;let r=null,s=n.views[e.view].widgets[e.id];const o=s.style.position==="relative"&&Ve((f=n.views[e.view].settings)==null?void 0:f.rowGap)?parseFloat((m=n.views[e.view].settings)==null?void 0:m.rowGap):0;let a=!1;if(s.groupid){const x=n.views[e.view].widgets[s.groupid].data,y=Object.keys(x).map(w=>w.startsWith("attrType_")?w.substring(9):null).filter(w=>w);if(y.length&&s.data){for(const[w,S]of Object.entries(s.data))if(typeof S=="string"&&y.find(M=>S.includes(M))){const M=Mi(s.data[w],x);M.doesMatch&&(a||(a=!0,s=it(s)),s.data[w]=M.newString||"")}}}const l=(v=t.style)!=null&&v._originalData?t.style._originalData:JSON.stringify(t.style),c=(g=t.data)!=null&&g._originalData?t.data._originalData:JSON.stringify(t.data),u=Se.isWidgetFilteredOutStatic(e.viewsActiveFilter,s.data,e.view,e.editMode);if(JSON.stringify(s.style||{})!==l||JSON.stringify(s.data||{})!==c||o!==t.gap||u!==t.isHidden){if(!e.runtime){const w=JSON.parse(l);Object.keys(w).forEach(M=>{const b=s.style[M],I=w[M];I!==b&&console.log(`[${Date.now()} / ${e.id}] Rerender because of style.${M}: ${I} !== ${b}`)}),Object.keys(s.style).forEach(M=>{const b=s.style[M],I=w[M];I!==b&&console.log(`[${Date.now()} / ${e.id}] Rerender because of style.${M}: ${I} !== ${b}`)});const S=JSON.parse(c);Object.keys(S).forEach(M=>{JSON.stringify(S[M])!==JSON.stringify(s.data[M])&&console.log(`[${Date.now()} / ${e.id}] Rerender because of data.${M}: ${S[M]} !== ${s.data[M]}`)})}let x,y;a?(x=s.data||{bindings:[]},y=s.style||{bindings:[]}):(x=s.data?it(s.data):{bindings:[]},y=s.style?it(s.style):{bindings:[]}),Se.replacePRJ_NAME(x,y,e),r={},r.isHidden=u,r.style=y,r.data=x,r.gap=o,r.applyBindings={top:s.style.top,left:s.style.left}}e.editMode!==t.editMode&&(r=r||{},r.editMode=e.editMode,r.applyBindings=!0),e.context.widgetHint!==t.widgetHint&&(r=r||{},r.widgetHint=e.context.widgetHint);const p=!t.multiViewWidget&&e.editMode&&e.selectedWidgets&&e.selectedWidgets.includes(e.id),d=p&&e.selectedWidgets.length===1;return(p!==t.selected||d!==t.selectedOne)&&(r=r||{},r.selected=p,r.selectedOne=d),!!s.usedInWidget!=!!t.usedInWidget&&(r=r||{},r.usedInWidget=!!s.usedInWidget),r}static removeFromArray(e,t,n,r){e&&Object.keys(e).forEach(s=>{if(!t||t.includes(s))for(let o=e[s].length-1;o>=0;o--){const a=e[s][o];a.view===n&&a.widget===r&&e[s].splice(o,1)}})}static parseStyle(e,t){const n={};return(e||"").split(";").forEach(r=>{if(r=r.trim(),r){let[s,o]=r.split(":");if(s=s.trim(),s&&o){if(o=o.trim(),!t&&(s==="top"||s==="left"||s==="width"||s==="height"))if(!t)o!=="0"&&o.match(/^[-+]?\d+$/)&&(o=`${o}px`);else{const a=parseFloat(o);o===a.toString()&&(o=a)}o&&(t&&(s=s.replace(/(-\w)/,a=>a[1].toUpperCase())),n[s]=o)}}}),n}onMouseDown(e){if(e.stopPropagation(),this.stealCursor&&!this.state.multiViewWidget){e.stopPropagation(),this.props.mouseDownOnView(e,this.props.id,this.props.isRelative);return}if(!this.props.context.views[this.props.view].widgets[this.props.id].data.locked){if(this.lastClick!==void 0&&Date.now()-this.lastClick<250&&console.log("AAA"),this.lastClick&&this.state.multiViewWidget){if(Date.now()-this.lastClick<250){const t=this.props.id.split("_"),n=t[0],r=t[1];this.props.context.setSelectedWidgets([r],n)}this.lastClick=Date.now();return}if(e.shiftKey||e.ctrlKey){const t=this.props.selectedWidgets.indexOf(this.props.id);if(t===-1){const n=[...this.props.selectedWidgets,this.props.id];this.props.context.setSelectedWidgets(n)}else{const n=[...this.props.selectedWidgets];n.splice(t,1),this.props.context.setSelectedWidgets(n)}return}this.props.selectedWidgets.includes(this.props.id)?this.props.moveAllowed&&this.state.draggable!==!1&&(this.props.isRelative?this.lastClick&&Date.now()-this.lastClick<250&&this.props.selectedWidgets.length===1&&this.props.context.views[this.props.view].widgets[this.props.selectedWidgets[0]].tpl==="_tplGroup"&&this.props.context.setSelectedGroup(this.props.selectedWidgets[0]):this.props.mouseDownOnView(e,this.props.id,this.props.isRelative,!1,this.lastClick!==void 0&&Date.now()-this.lastClick<300)):this.props.context.setSelectedWidgets([this.props.id]),this.lastClick=Date.now()}}createWidgetMovementShadow(){if(this.shadowDiv&&(this.shadowDiv.remove(),this.shadowDiv=null),!this.movement){console.error("Unknown issue, movement is falsy");return}this.shadowDiv=window.document.createElement("div"),this.shadowDiv.setAttribute("id",`${this.props.id}_shadow`),this.shadowDiv.className="vis-editmode-widget-shadow",this.refService.current&&(this.shadowDiv.style.width=`${this.refService.current.clientWidth}px`,this.shadowDiv.style.height=`${this.refService.current.clientHeight}px`,this.refService.current.style.borderRadius&&(this.shadowDiv.style.borderRadius=this.refService.current.style.borderRadius));let e;Object.prototype.hasOwnProperty.call(this.props.refParent,"current")?e=this.props.refParent.current:e=this.props.refParent,this.widDiv?(e.insertBefore(this.shadowDiv,this.widDiv),this.widDiv.style.position="absolute",this.widDiv.style.left=`${this.movement.left}px`,this.widDiv.style.top=`${this.movement.top}px`):(e.insertBefore(this.shadowDiv,this.refService.current),this.refService.current&&(this.refService.current.style.position="absolute")),this.refService.current&&(this.refService.current.style.left=`${this.movement.left}px`,this.refService.current.style.top=`${this.movement.top}px`)}isResizable(){return this.visDynamicResizable?typeof this.state.data.visResizable=="boolean"?this.state.data.visResizable:this.visDynamicResizable.default:this.state.resizable}onMove=(e,t,n,r)=>{var o,a;if(this.state.multiViewWidget||!this.state.editMode)return;const s=this.movement;if(this.refService.current){if(this.resize){if(this.isResizable()===!1)return;if(e===void 0){const l=(o=this.widDiv||this.refService.current)==null?void 0:o.getBoundingClientRect();l&&(this.movement={top:this.refService.current.offsetTop,left:this.refService.current.offsetLeft,width:l.width,height:l.height}),this.refService.current.querySelectorAll(".vis-editmode-resizer").forEach(u=>{u._storedOpacity=u.style.opacity,u.style.opacity="0.3"})}else s&&t!==void 0&&(this.resize==="top"?(this.refService.current.style.top=`${s.top+t}px`,this.refService.current.style.height=`${s.height-t}px`,this.resizeLocked&&(this.refService.current.style.width=this.refService.current.style.height),this.widDiv&&(this.widDiv.style.top=`${s.top+t}px`,this.widDiv.style.height=`${s.height-t}px`,this.resizeLocked&&(this.widDiv.style.width=this.widDiv.style.height))):this.resize==="bottom"?(this.widDiv&&(this.widDiv.style.height=`${s.height+t}px`),this.refService.current.style.height=`${s.height+t}px`,this.resizeLocked&&(this.refService.current.style.width=this.refService.current.style.height),this.widDiv&&this.resizeLocked&&(this.widDiv.style.width=this.widDiv.style.height)):this.resize==="left"?(this.refService.current.style.left=`${s.left+e}px`,this.refService.current.style.width=`${s.width-e}px`,this.resizeLocked&&(this.refService.current.style.height=this.refService.current.style.width),this.widDiv&&(this.widDiv.style.left=`${s.left+e}px`,this.widDiv.style.width=`${s.width-e}px`,this.resizeLocked&&(this.widDiv.style.height=this.widDiv.style.width))):this.resize==="right"?(this.widDiv&&(this.widDiv.style.width=`${s.width+e}px`),this.refService.current.style.width=`${s.width+e}px`,this.resizeLocked&&(this.refService.current.style.height=this.refService.current.style.width),this.widDiv&&this.resizeLocked&&(this.widDiv.style.height=this.widDiv.style.width)):this.resize==="top-left"?(this.refService.current.style.top=`${s.top+t}px`,this.refService.current.style.left=`${s.left+e}px`,this.refService.current.style.height=`${s.height-t}px`,this.refService.current.style.width=`${s.width-e}px`,this.resizeLocked&&(this.refService.current.style.height=this.refService.current.style.width),this.widDiv&&(this.widDiv.style.top=`${s.top+t}px`,this.widDiv.style.left=`${s.left+e}px`,this.widDiv.style.height=`${s.height-t}px`,this.widDiv.style.width=`${s.width-e}px`,this.resizeLocked&&(this.widDiv.style.height=this.widDiv.style.width))):this.resize==="top-right"?(this.refService.current.style.top=`${s.top+t}px`,this.refService.current.style.height=`${s.height-t}px`,this.refService.current.style.width=`${s.width+e}px`,this.resizeLocked&&(this.refService.current.style.height=this.refService.current.style.width),this.widDiv&&(this.widDiv.style.top=`${s.top+t}px`,this.widDiv.style.height=`${s.height-t}px`,this.widDiv.style.width=`${s.width+e}px`,this.resizeLocked&&(this.widDiv.style.height=this.widDiv.style.width))):this.resize==="bottom-left"?(this.refService.current.style.left=`${s.left+e}px`,this.refService.current.style.height=`${s.height+t}px`,this.refService.current.style.width=`${s.width-e}px`,this.resizeLocked&&(this.refService.current.style.height=this.refService.current.style.width),this.widDiv&&(this.widDiv.style.left=`${s.left+e}px`,this.widDiv.style.height=`${s.height+t}px`,this.widDiv.style.width=`${s.width-e}px`,this.resizeLocked&&(this.widDiv.style.height=this.widDiv.style.width))):(this.refService.current.style.height=`${s.height+t}px`,this.refService.current.style.width=`${s.width+e}px`,this.resizeLocked&&(this.refService.current.style.height=this.refService.current.style.width),this.widDiv&&(this.widDiv.style.height=`${s.height+t}px`,this.widDiv.style.width=`${s.width+e}px`,this.resizeLocked&&(this.widDiv.style.height=this.widDiv.style.width))));if(n){const l=(a=this.refService.current)==null?void 0:a.querySelectorAll(".vis-editmode-resizer");l==null||l.forEach(c=>{c._storedOpacity!==void 0&&(c.style.opacity=c._storedOpacity,delete c._storedOpacity)}),this.resize=!1,this.props.context.onWidgetsChanged([{wid:this.props.id,view:this.props.view,style:{top:this.refService.current.style.top,left:this.refService.current.style.left,width:this.refService.current.style.width,height:this.refService.current.style.height}}]),this.movement=void 0}}else if(e===void 0){if(this.state.draggable===!1)return;this.movement={top:this.refService.current.offsetTop,left:this.refService.current.offsetLeft,order:[...this.props.relativeWidgetOrder],width:0,height:0},this.refService.current.querySelectorAll(".vis-editmode-resizer").forEach(c=>c.style.display="none"),this.props.isRelative&&this.createWidgetMovementShadow()}else if(this.movement&&t!==void 0&&e!==void 0){const l=`${this.movement.left+e}px`,c=`${this.movement.top+t}px`;if(this.refService.current&&(this.refService.current.style.left=l,this.refService.current.style.top=c),this.widDiv&&(this.widDiv.style.left=l,this.widDiv.style.top=c,this.widDiv._customHandlers&&this.widDiv._customHandlers.onMove&&this.widDiv._customHandlers.onMove(this.widDiv,this.props.id)),this.props.isRelative&&r&&r(this.props.id,l,c,this.shadowDiv,this.movement.order),n){if(this.refService.current.querySelectorAll(".vis-editmode-resizer").forEach(p=>p.style.display="block"),this.props.isRelative){let p;Object.prototype.hasOwnProperty.call(this.props.refParent,"current")?p=this.props.refParent.current:p=this.props.refParent,this.widDiv?(this.widDiv.style.position="relative",this.widDiv.style.top="0",this.widDiv.style.left="0",p.insertBefore(this.widDiv,this.shadowDiv),this.refService.current.style.top=`${this.widDiv.offsetTop}px`,this.refService.current.style.left=`${this.widDiv.offsetLeft}px`):(p.insertBefore(this.refService.current,this.shadowDiv),this.refService.current.style.position="relative",this.refService.current.style.top="0",this.refService.current.style.left="0"),this.shadowDiv.remove(),this.shadowDiv=null,this.props.context.onWidgetsChanged([{wid:this.props.id,view:this.props.view,style:{left:null,top:null}}],this.props.view,{order:this.movement.order})}else this.props.context.onWidgetsChanged([{wid:this.props.id,view:this.props.view,style:{left:this.movement.left+e,top:this.movement.top+t}}]);this.movement=void 0}}}};onTempSelect=e=>{var n;const t=(n=this.refService.current)==null?void 0:n.querySelector(".vis-editmode-overlay");t&&(e==null?this.props.selectedWidgets.includes(this.props.id)?t.className.includes("vis-editmode-selected")||(t.className=_t("vis-editmode-selected",t.className)):(t.style.backgroundColor="",t.className=nn(t.className,"vis-editmode-selected")):e?t.className.includes("vis-editmode-selected")||(t.className=_t("vis-editmode-selected",t.className)):t.className=nn(t.className,"vis-editmode-selected"))};onResizeStart(e,t){e.stopPropagation(),this.resize=t,this.props.mouseDownOnView(e,this.props.id,this.props.isRelative,!0)}getResizeHandlers(e,t,n){var E;if(!this.state.editMode||!e||((E=this.props.selectedWidgets)==null?void 0:E.length)!==1)return null;const r=.4,s=.3,o=.4,a=`calc(${s-o}em - ${n})`,l=`${o}em`,c=`${s}em`,u=`${r}em`,p=`calc(${s-r}em - ${n})`,d=t.style.width==="100%",f=t.style.height==="100%",m="#014488",v=`0.1em dashed ${m}`,g="0.1em dashed #888",x=this.isResizable();let y=x&&this.state.resizeHandles?this.state.resizeHandles:[];x&&this.props.selectedGroup&&this.props.selectedGroup===this.props.id&&(y=["s","e","se"]);const w=.9,S=.5,M=t.usedInWidget||this.props.isRelative,b={top:!M&&y.includes("n"),bottom:!t.usedInWidget&&!f&&y.includes("s"),left:!M&&y.includes("w"),right:!t.usedInWidget&&!d&&y.includes("e"),"top-left":!f&&!d&&!M&&y.includes("nw"),"top-right":!f&&!d&&!M&&y.includes("ne"),"bottom-left":!f&&!d&&!M&&y.includes("sw"),"bottom-right":!f&&!d&&!t.usedInWidget&&y.includes("se")},I={top:{top:p,height:u,left:b["top-left"]?c:0,right:b["top-right"]?c:0,cursor:"ns-resize",background:"transparent",opacity:b.top?w:S,borderTop:b.top?v:g},bottom:{bottom:p,height:u,left:b["bottom-left"]?c:0,right:b["bottom-right"]?c:0,cursor:"ns-resize",background:"transparent",opacity:b.bottom?w:S,borderBottom:b.bottom?v:g},left:{top:b["top-left"]?c:0,bottom:b["bottom-left"]?c:0,left:p,width:u,cursor:"ew-resize",background:"transparent",opacity:b.left?w:S,borderLeft:b.left?v:g},right:{top:b["top-right"]?c:0,bottom:b["bottom-right"]?c:0,right:p,width:u,cursor:"ew-resize",background:"transparent",opacity:b.right?w:S,borderRight:b.right?v:g},"top-left":{top:a,height:l,left:a,width:l,cursor:"nwse-resize",background:m,opacity:w},"top-right":{top:a,height:l,right:a,width:l,cursor:"nesw-resize",background:m,opacity:w},"bottom-left":{bottom:a,height:l,left:a,width:l,cursor:"nesw-resize",background:m,opacity:w},"bottom-right":{bottom:a,height:l,right:a,width:l,cursor:"nwse-resize",background:m,opacity:w}},P={position:"absolute",zIndex:1001};return Object.keys(I).map(A=>{const T=I[A];if(!b[A]){if(A.includes("-"))return null;T.cursor="default"}return h.jsx("div",{className:"vis-editmode-resizer",style:Object.assign(T,P),onMouseDown:T.opacity===w?W=>this.onResizeStart(W,A):void 0},A)})}isUserMemberOfGroup(e,t){return t?(Array.isArray(t)||(t=[t]),!!t.find(n=>{var s,o;const r=this.props.context.userGroups[`system.group.${n}`];return((o=(s=r==null?void 0:r.common)==null?void 0:s.members)==null?void 0:o.length)&&r.common.members.includes(`system.user.${e}`)})):!0}static isWidgetFilteredOutStatic(e,t,n,r){if(!e)return console.warn(`viewsActiveFilter is not defined in ${n}, data: ${JSON.stringify(t)}`),!1;const s=e[n];if(!r&&(t!=null&&t.filterkey)&&(s!=null&&s.length)){if(s[0]==="$")return!0;let o;typeof t.filterkey=="string"?o=t.filterkey.split(",").map(a=>a.trim()).filter(a=>a):o=t.filterkey;for(let a=0;a<o.length;a++)if(s.includes(o[a]))return!1;return!0}return!1}isWidgetFilteredOut(e){return Se.isWidgetFilteredOutStatic(this.props.viewsActiveFilter,e,this.props.view,this.state.editMode)}static isWidgetHidden(e,t,n){const r=e["visibility-oid"],s=e["visibility-cond"];if(r){if(!Object.keys(t).includes(`${r}.val`))return!0;let o=t[`${r}.val`];if(o==null)return s==="not exist";let a=e["visibility-val"];if(!s||a===void 0||a===null)return s==="not exist";if(o==="null"&&s!=="exist"&&s!=="not exist")return!1;const l=typeof o;switch(l==="boolean"||o==="false"||o==="true"?a=a==="true"||a===!0||a===1||a==="1":l==="number"?a=parseFloat(a):l==="object"&&(o=JSON.stringify(o)),s){case"==":return a=a.toString(),o=o.toString(),o==="1"&&(o="true"),a==="1"&&(a="true"),o==="0"&&(o="false"),a==="0"&&(a="false"),a!==o;case"!=":return a=a.toString(),o=o.toString(),o==="1"&&(o="true"),a==="1"&&(a="true"),o==="0"&&(o="false"),a==="0"&&(a="false"),a===o;case">=":return o<a;case"<=":return o>a;case">":return o<=a;case"<":return o>=a;case"consist":return a=a.toString(),o=o.toString(),!o.toString().includes(a);case"not consist":return a=a.toString(),o=o.toString(),o.toString().includes(a);case"exist":return o==="null";case"not exist":return o!=="null";default:return console.log(`[${n}] Unknown visibility condition: ${s}`),!1}}else return s&&s==="not exist"}renderWidgetBody(e){return h.jsxs("div",{style:{width:"100%",height:"100%",overflow:"hidden",background:"repeating-linear-gradient(45deg, #333, #333 10px, #666 10px, #666 20px)",color:"#FFF"},children:[h.jsx("div",{style:{color:"#FF0000",paddingLeft:10},children:N.I18n.t('Unknown widget type "%s"',this.props.tpl)}),h.jsx("pre",{children:JSON.stringify(this.state.data,null,2)})]})}changeOrder(e,t){if(e.stopPropagation(),e.preventDefault(),this.state.multiViewWidget||!this.state.editMode)return;const n=[...this.props.relativeWidgetOrder],r=n.indexOf(this.props.id);if(t>0){if(r===n.length-1)return;const s=n[r+1];n[r+1]=this.props.id,n[r]=s}else if(r){const s=n[r-1];n[r-1]=this.props.id,n[r]=s}else return;this.props.context.onWidgetsChanged(null,this.props.view,{order:n})}static formatValue(e,t,n){typeof t!="number"&&(t=2,n=t);const r=n===void 0?".,":n;return typeof e!="number"&&(e=parseFloat(e)),Number.isNaN(e)?"":e.toFixed(t||0).replace(r[0],r[1]).replace(/\B(?=(\d{3})+(?!\d))/g,r[0])}formatIntervalHelper(e,t){let n,r,s;if(this.props.context.lang==="de"?t==="seconds"?(n="Sekunde",r="Sekunden"):t==="minutes"?(n="Minute",r="Minuten"):t==="hours"?(n="Stunde",r="Stunden"):t==="days"&&(n="Tag",r="Tagen"):this.props.context.lang==="ru"?t==="seconds"?(n="секунду",r="секунд",s="секунды"):t==="minutes"?(n="минуту",r="минут",s="минуты"):t==="hours"?(n="час",r="часов",s="часа"):t==="days"&&(n="день",r="дней",s="дня"):t==="seconds"?(n="second",r="seconds"):t==="minutes"?(n="minute",r="minutes"):t==="hours"?(n="hour",r="hours"):t==="days"&&(n="day",r="days"),e===1)return this.props.context.lang==="de"?t==="days"?`einem ${n}`:`einer ${n}`:this.props.context.lang==="ru"?t==="days"||t==="hours"?`один ${n}`:`одну ${n}`:`one ${n}`;if(this.props.context.lang==="de")return`${e} ${r}`;if(this.props.context.lang==="ru"){const o=e%10;return o===1&&e!==11?`${e} ${n}`:o>=2&&o<=4&&(e>20||e<10)?`${e} ${s}`:`${e} ${r}`}return`${e} ${r}`}formatInterval(e,t){if(t)return this.props.context.moment(new Date(e)).fromNow();let n=Date.now()-e;n=Math.round(n/1e3);let r;if(n<=60)this.props.context.lang==="de"?r=`vor ${this.formatIntervalHelper(n,"seconds")}`:this.props.context.lang==="ru"?r=`${this.formatIntervalHelper(n,"seconds")} назад`:r=`${this.formatIntervalHelper(n,"seconds")} ago`;else if(n<3600){const s=Math.floor(n/60),o=n-s*60;r="",this.props.context.lang==="de"?r=`vor ${this.formatIntervalHelper(s,"minutes")}`:this.props.context.lang==="ru"?r=this.formatIntervalHelper(s,"minutes"):r=this.formatIntervalHelper(s,"minutes"),s<5&&(this.props.context.lang==="de"?r+=` und ${this.formatIntervalHelper(o,"seconds")}`:this.props.context.lang==="ru"?r+=` и ${this.formatIntervalHelper(o,"seconds")}`:r+=` and ${this.formatIntervalHelper(o,"seconds")}`),this.props.context.lang==="de"||(this.props.context.lang==="ru"?r+=" назад":r+=" ago")}else if(n<3600*24){const s=Math.floor(n/3600),o=Math.floor((n-s*3600)/60);r="",this.props.context.lang==="de"?r=`vor ${this.formatIntervalHelper(s,"hours")}`:this.props.context.lang==="ru"?r=this.formatIntervalHelper(s,"hours"):r=this.formatIntervalHelper(s,"hours"),s<10&&(this.props.context.lang==="de"?r+=` und ${this.formatIntervalHelper(o,"minutes")}`:this.props.context.lang==="ru"?r+=` и ${this.formatIntervalHelper(o,"minutes")}`:r+=` and ${this.formatIntervalHelper(o,"minutes")}`),this.props.context.lang==="de"||(this.props.context.lang==="ru"?r+=" назад":r+=" ago")}else{const s=Math.floor(n/86400),o=Math.floor((n-s*(3600*24))/3600);r="",this.props.context.lang==="de"?r=`vor ${this.formatIntervalHelper(s,"days")}`:this.props.context.lang==="ru"?r=this.formatIntervalHelper(s,"days"):r=this.formatIntervalHelper(s,"days"),s<3&&(this.props.context.lang==="de"?r+=` und ${this.formatIntervalHelper(o,"hours")}`:this.props.context.lang==="ru"?r+=` и ${this.formatIntervalHelper(o,"hours")}`:r+=` and ${this.formatIntervalHelper(o,"hours")}`),this.props.context.lang==="de"||(this.props.context.lang==="ru"?r+=" назад":r+=" ago")}return r}startUpdateInterval(){this.updateInterval=this.updateInterval||setInterval(()=>{var t;const e=(t=this.widDiv||this.refService.current)==null?void 0:t.querySelector(".time-interval");if(e){const n=parseInt(e.dataset.time,10);e.innerHTML=this.formatInterval(n,e.dataset.moment==="true")}},1e4)}formatDate(e,t,n,r,s){if(typeof t=="boolean"&&(n=t,t="auto"),t==="auto"&&(t=`${this.props.context.dateFormat||"DD.MM.YYYY"} hh:mm:ss`),t=t||this.props.context.dateFormat||"DD.MM.YYYY",!e)return"";let o;const a=typeof e;if(a==="string"&&(o=new Date(e)),a!=="object"&&(Ve(e)?parseInt(e,10)>9466812e5?o=new Date(e):o=new Date(e*1e3):o=new Date(e)),n)return this.startUpdateInterval(),s?h.jsx("span",{className:"time-interval","data-time":o.getTime(),"data-moment":r||!1,title:o.toLocaleString(),children:this.formatInterval(o.getTime(),r)}):`<span class="time-interval" data-time="${o.getTime()}" data-moment="${r||!1}">${this.formatInterval(o.getTime(),r)}</span>`;if(t.includes("YYYY")||t.includes("JJJJ")||t.includes("ГГГГ")){const l=o.getFullYear().toString();t=t.replace("YYYY",l),t=t.replace("JJJJ",l),t=t.replace("ГГГГ",l)}else if(t.includes("YY")||t.includes("JJ")||t.includes("ГГ")){const l=(o.getFullYear()%100).toString();t=t.replace("YY",l),t=t.replace("JJ",l),t=t.replace("ГГ",l)}if(t.includes("MM")||t.includes("ММ")){const l=(o.getMonth()+1).toString().padStart(2,"0");t=t.replace("MM",l),t=t.replace("ММ",l)}else if(t.includes("M")||t.includes("М")){const l=(o.getMonth()+1).toString();t=t.replace("M",l),t=t.replace("М",l)}if(t.includes("DD")||t.includes("TT")||t.includes("ДД")){const l=o.getDate().toString().padStart(2,"0");t=t.replace("DD",l),t=t.replace("TT",l),t=t.replace("ДД",l)}else if(t.includes("D")||t.includes("TT")||t.includes("Д")){const l=o.getDate().toString();t=t.replace("D",l),t=t.replace("T",l),t=t.replace("Д",l)}if(t.includes("hh")||t.includes("SS")||t.includes("чч")){const l=o.getHours().toString().padStart(2,"0");t=t.replace("hh",l),t=t.replace("SS",l),t=t.replace("чч",l)}else if(t.includes("h")||t.includes("S")||t.includes("ч")){const l=o.getHours().toString();t=t.replace("h",l),t=t.replace("S",l),t=t.replace("ч",l)}if(t.includes("mm")||t.includes("мм")){const l=o.getMinutes().toString().padStart(2,"0");t=t.replace("mm",l),t=t.replace("мм",l)}else if(t.includes("m")||t.includes("м")){const l=o.getMinutes().toString();t=t.replace("m",l),t=t.replace("v",l)}if(t.includes("sss")||t.includes("ссс")){const l=o.getMilliseconds().toString().padStart(3,"0");t=t.replace("sss",l),t=t.replace("ссс",l)}if(t.includes("ss")||t.includes("сс")){const l=o.getSeconds().toString().padStart(2,"0");t=t.replace("ss",l),t=t.replace("cc",l)}else if(t.includes("s")||t.includes("с")){const l=o.getSeconds().toString();t=t.replace("s",l),t=t.replace("с",l)}return t}onToggleRelative(e){e.stopPropagation(),e.preventDefault();const t=this.props.context.views[this.props.view].widgets[this.props.id],n=this.props.isRelative?t.style.absoluteWidth||"100px":"100%";this.props.context.onWidgetsChanged([{wid:this.props.id,view:this.props.view,style:{position:this.props.isRelative?"absolute":"relative",width:n,absoluteWidth:this.props.isRelative?null:t.style.width,noPxToPercent:!0}}])}onToggleWidth(e){e.stopPropagation(),e.preventDefault();const t=this.props.context.views[this.props.view].widgets[this.props.id];this.props.context.onWidgetsChanged([{wid:this.props.id,view:this.props.view,style:{width:t.style.width==="100%"?t.style.absoluteWidth||"100px":"100%",absoluteWidth:t.style.width!=="100%"?t.style.width:null,noPxToPercent:!0}}])}onToggleLineBreak(e){e.stopPropagation(),e.preventDefault();const t=this.props.context.views[this.props.view].widgets[this.props.id];this.props.context.onWidgetsChanged([{wid:this.props.id,view:this.props.view,style:{newLine:!t.style.newLine}}])}static correctStylePxValue(e){return typeof e=="string"&&Ve(e)?parseFloat(e)||0:e}renderRelativeMoveMenu(){return this.props.context.runtime||!this.state.editMode?null:h.jsx(p0,{anchorEl:this.state.showRelativeMoveMenu?this.relativeMoveMenu:void 0,order:this.props.relativeWidgetOrder,wid:this.props.id,view:this.props.view,views:this.props.context.views,themeType:this.props.context.themeType,onClose:e=>{this.props.onIgnoreMouseEvents(!1),this.setState({showRelativeMoveMenu:!1}),e&&this.props.context.onWidgetsChanged(null,this.props.view,{order:e})}})}render(){var g,x,y,w,S,M,b,I,P;const e=this.props.context.views[this.props.view].widgets[this.props.id];if(!e||typeof e!="object")return console.error(`EMPTY Widget: ${this.props.id}`),null;const t={boxSizing:"border-box"},n=!this.state.multiViewWidget&&this.state.editMode&&((g=this.props.selectedWidgets)==null?void 0:g.includes(this.props.id)),r=n?["vis-editmode-selected"]:["vis-editmode-overlay-not-selected"];n&&this.state.widgetHint==="hide"&&r.push("vis-editmode-selected-background"),this.state.editMode&&!(e.groupid&&!this.props.selectedGroup)&&(!this.props.isRelative&&Object.prototype.hasOwnProperty.call(this.state.style,"top")&&(t.top=Se.correctStylePxValue(this.state.style.top)),!this.props.isRelative&&Object.prototype.hasOwnProperty.call(this.state.style,"left")&&(t.left=Se.correctStylePxValue(this.state.style.left)),Object.prototype.hasOwnProperty.call(this.state.style,"width")&&(t.width=Se.correctStylePxValue(this.state.style.width)),Object.prototype.hasOwnProperty.call(this.state.style,"height")&&(t.height=Se.correctStylePxValue(this.state.style.height)),!this.props.isRelative&&Object.prototype.hasOwnProperty.call(this.state.style,"right")&&(t.right=Se.correctStylePxValue(this.state.style.right)),!this.props.isRelative&&Object.prototype.hasOwnProperty.call(this.state.style,"bottom")&&(t.bottom=Se.correctStylePxValue(this.state.style.bottom)),t.position=this.props.isRelative?"relative":"absolute",t.userSelect="none",n?this.props.moveAllowed&&this.state.draggable!==!1&&!this.props.isRelative&&(!this.props.selectedGroup||this.props.selectedGroup!==this.props.id)?t.cursor="move":t.cursor="default":(x=e.data)!=null&&x.locked?t.cursor="default":this.props.selectedGroup!==this.props.id&&!this.state.multiViewWidget&&(t.cursor="pointer"),(y=this.props.tpl)!=null&&y.toLowerCase().includes("image")&&r.push("vis-editmode-helper"));const s={className:"",overlayClassNames:r,style:t,id:`rx_${this.props.id}`,refService:this.refService,widget:e};let o=!1,a=!1;this.visDynamicResizable&&!this.isResizable()&&(this.visDynamicResizable.desiredSize===!1?(o=!0,a=!0,delete t.width,delete t.height):typeof this.visDynamicResizable.desiredSize=="object"&&(this.state.style.width?t.width=Se.correctStylePxValue(this.visDynamicResizable.desiredSize.width):(o=!0,delete t.width),this.state.style.height?t.height=Se.correctStylePxValue(this.visDynamicResizable.desiredSize.height):(a=!0,delete t.height))),this.props.isRelative&&Ve((w=this.props.context.views[this.props.view].settings)==null?void 0:w.rowGap)&&(t.marginBottom=parseFloat((S=this.props.context.views[this.props.view].settings)==null?void 0:S.rowGap)||0);const l=this.renderWidgetBody(s);o&&delete t.width,a&&delete t.height,this.props.id===this.props.selectedGroup&&(t.top=0,t.left=0),this.props.isRelative||(t.top=t.top||0,t.left=t.left||0),["top","left","width","height","right","bottom","fontSize","borderRadius","paddingLeft","paddingTop","paddingRight","paddingBottom","marginTop","marginBottom","marginLeft","marginRight","borderWidth"].forEach(E=>{var T,W,F;const A=t;if(A[E]!==void 0&&typeof A[E]=="string"){if(Ve(A[E]))A[E]=parseFloat(A[E])||0;else if(A[E].includes("{")){const j=(T=this.state.rxStyle)==null?void 0:T[E];if(this.state.rxStyle&&j!==void 0)j&&typeof j=="string"&&!j.includes("{")&&(A[E]=Se.correctStylePxValue(j));else{const O=(F=(W=this.props.context.allWidgets[this.props.id])==null?void 0:W.style)==null?void 0:F[E];O!=null&&(O.toString().includes("{")||(A[E]=Se.correctStylePxValue(O)))}}}}),r.push("vis-editmode-overlay");let c=null,u=null;const p=(typeof t.borderWidth=="number"?`${t.borderWidth}px`:t.borderWidth)||"0px";if(this.state.widgetHint!=="hide"&&!this.state.hideHelper&&this.state.editMode&&(!e.groupid||this.props.selectedGroup)&&this.props.selectedGroup!==this.props.id&&this.props.context.showWidgetNames!==!1){const E=!e.usedInWidget&&(((M=this.refService.current)==null?void 0:M.offsetTop)===0||((b=this.refService.current)==null?void 0:b.offsetTop)&&((I=this.refService.current)==null?void 0:I.offsetTop)<15);this.refService.current||setTimeout(()=>this.forceUpdate(),50);const A=this.state.multiViewWidget?this.props.id.split("_"):[null,null],T=A[0],W=A[1],F=!e.usedInWidget&&this.isResizable();if(c=h.jsxs("div",{title:this.state.multiViewWidget?N.I18n.t("Jump to widget by double click"):this.props.tpl==="_tplGroup"?N.I18n.t("Switch to group edit mode by double click"):void 0,className:N.Utils.clsx("vis-editmode-widget-name",n&&"vis-editmode-widget-name-selected",this.state.widgetHint,E&&"vis-editmode-widget-name-bottom",this.props.isRelative&&F&&"vis-editmode-widget-name-long"),style:{top:E?void 0:`calc(-14px - ${p})`},onMouseDown:j=>{this.props.context.setSelectedWidgets&&this.onMouseDown(j)},children:[h.jsx("span",{children:this.state.multiViewWidget?N.I18n.t("%s from %s",W,T):((P=e.data)==null?void 0:P.name)||this.props.id}),this.state.multiViewWidget||e.usedInWidget?null:h.jsx(be.Anchor,{onMouseDown:j=>this.onToggleRelative(j),className:N.Utils.clsx("vis-anchor",this.props.isRelative?"vis-anchor-enabled":"vis-anchor-disabled")}),this.state.multiViewWidget||!this.props.isRelative||!F||e.usedInWidget?null:h.jsx(be.Expand,{onMouseDown:j=>this.onToggleWidth(j),className:N.Utils.clsx("vis-expand",e.style.width==="100%"?"vis-expand-enabled":"vis-expand-disabled")}),this.state.multiViewWidget||!this.props.isRelative||e.usedInWidget?null:h.jsx(be.KeyboardReturn,{onMouseDown:j=>this.onToggleLineBreak(j),className:N.Utils.clsx("vis-new-line",e.style.newLine?"vis-new-line-enabled":"vis-new-line-disabled")})]}),this.props.isRelative&&!this.state.multiViewWidget&&!e.usedInWidget){const j=this.props.relativeWidgetOrder.indexOf(this.props.id),O=!!j;let R=j!==this.props.relativeWidgetOrder.length-1;R&&this.props.selectedGroup&&this.props.context.views[this.props.view].widgets[this.props.relativeWidgetOrder[j+1]].style.position==="absolute"&&(R=!1),(O||R)&&(u=h.jsxs("div",{className:N.Utils.clsx("vis-editmode-widget-move-buttons",this.state.widgetHint,E&&"vis-editmode-widget-name-bottom"),style:{width:!O||!R?30:void 0},children:[h.jsx("div",{className:"vis-editmode-widget-number",children:this.props.relativeWidgetOrder.indexOf(this.props.id)+1}),O?h.jsx("div",{className:"vis-editmode-move-button",title:N.I18n.t("Move widget up or press longer to open re-order menu"),children:h.jsx(be.ArrowUpward,{onMouseDown:B=>{B.stopPropagation(),B.preventDefault(),this.pressTimeout=setTimeout($=>{this.props.onIgnoreMouseEvents(!0),this.relativeMoveMenu=$,this.setState({showRelativeMoveMenu:!0}),this.pressTimeout=void 0},300,B.currentTarget)},onMouseUp:B=>this.changeOrder(B,-1)})}):null,R?h.jsx("div",{className:"vis-editmode-move-button",style:{left:O?30:void 0},title:N.I18n.t("Move widget down or press longer to open re-order menu"),children:h.jsx(be.ArrowDownward,{onMouseDown:B=>{B.stopPropagation(),B.preventDefault(),this.pressTimeout=setTimeout($=>{this.props.onIgnoreMouseEvents(!0),this.relativeMoveMenu=$,this.setState({showRelativeMoveMenu:!0}),this.pressTimeout=void 0},300,B.currentTarget)},onMouseUp:B=>this.changeOrder(B,1)})}):null]}))}Lo(t)}!this.isCanWidget&&this.state.multiViewWidget&&this.state.editMode&&(t.opacity===void 0||t.opacity===null||t.opacity>.5)&&(t.opacity=.5);const d=!this.state.hideHelper&&!e.usedInWidget&&this.state.editMode&&!e.data.locked&&(!e.groupid||this.props.selectedGroup)&&this.props.selectedGroup!==this.props.id?h.jsx("div",{className:r.join(" "),onMouseDown:E=>{this.props.context.setSelectedWidgets&&this.onMouseDown(E)}}):null;let f=null;this.props.selectedGroup===this.props.id&&(t.borderBottom="1px dotted #888",t.borderRight="1px dotted #888",f=h.jsx("div",{style:{position:"absolute",bottom:-24,left:0,fontSize:10,fontStyle:"italic",opacity:.5,width:350,cursor:"pointer"},onClick:E=>{E.stopPropagation(),this.props.context.setSelectedWidgets([this.props.id])},children:N.I18n.t("group_size_hint")}));const m=this.renderSignals?this.renderSignals():null,v=this.renderLastChange?this.renderLastChange(t):null;return h.jsxs("div",{id:s.id,className:s.className,ref:this.refService,style:t,children:[m,v,c,u,d,this.getResizeHandlers(n,e,p),l,f,this.state.showRelativeMoveMenu&&this.renderRelativeMoveMenu()]})}}function nd(i,e){const t="#dd5325",n="#73b6a8",r=N.Theme(i,e);r.palette.text.danger={color:t},r.palette.text.success={color:n};const s={blockHeader:{fontSize:16,textAlign:"left",marginTop:"8px",borderRadius:"2px",paddingLeft:"8px"},viewTabs:{minHeight:0},viewTab:{minWidth:0,minHeight:0},lightedPanel:{backgroundColor:i==="dark"||i==="blue"?"hsl(0deg 0% 20%)":"hsl(0deg 0% 90%)"},toolbar:{display:"flex",alignItems:"center",paddingTop:"10px",paddingBottom:"10px"},viewManageBlock:{display:"flex",alignItems:"center"},viewManageButtonActions:{textAlign:"right",flex:1}};return r.classes?Object.assign(r.classes,s):r.classes=s,r}function rd(i,e,t){if(e=e||{},e.resizable=!0,e.draggable=!0,i!=null&&i.dataset){const n=i.dataset.visResizable;if(n){let s=null;try{s=JSON.parse(n)}catch{console.error(`Cannot parse resizable options by ${i.getAttribute("id")}: ${JSON.stringify(s)}`)}s&&(s.disabled!==void 0&&(e.resizable=!s.disabled),s.handles!==void 0&&(e.resizeHandles=s.handles.split(",").map(o=>o.trim()))),t&&!e.resizable&&(!t.width||!t.height)&&(e.virtualHeight=i.clientHeight,e.virtualWidth=i.clientWidth)}const r=i.dataset.visDraggable;if(r){let s=null;try{s=JSON.parse(r)}catch{console.error(`Cannot parse draggable options by ${i.getAttribute("id")}: ${JSON.stringify(s)}`)}s&&s.disabled!==void 0&&(e.draggable=!s.disabled)}e.hideHelper=i.dataset.visHideHelper==="true"}return e}class $t extends Se{refViews={};isCanWidget=!0;bindings;IDs;bindingsTimer=null;filterDisplay;lastState;oldEditMode;oldData;oldStyle;updateOnStyle;constructor(e){super(e),Object.assign(this.state,{mounted:!1,legacyViewContainers:[],hideHelper:!1,resizable:!0,draggable:!0}),this.setupSubscriptions(),e.context.linkContext.registerChangeHandler(e.id,this.changeHandler),e.context.buildLegacyStructures()}setupSubscriptions(){this.bindings={};const e={IDs:[],bindings:this.bindings,visibility:this.props.context.linkContext.visibility,lastChanges:this.props.context.linkContext.lastChanges,signals:this.props.context.linkContext.signals};uo(this.props.context.views,this.props.view,this.props.id,e),this.IDs=e.IDs,Object.keys(this.bindings).forEach(t=>{this.props.context.linkContext.bindings[t]=this.props.context.linkContext.bindings[t]||[],this.bindings[t].forEach(n=>this.props.context.linkContext.bindings[t].push(n))}),Object.keys(e).forEach(t=>e[t]=null)}componentDidMount(){super.componentDidMount(),this.props.context.linkContext.subscribe(this.IDs),this.widDiv||this.renderWidget(void 0,void 0,void 0,void 0,()=>{const e={mounted:!0};this.props.context.allWidgets[this.props.id]&&rd(this.widDiv,e,this.props.context.allWidgets[this.props.id].style),this.setState(e)})}componentWillUnmount(){super.componentWillUnmount(),this.props.context.linkContext&&this.props.context.linkContext&&this.props.context.linkContext.unregisterChangeHandler&&this.props.context.linkContext.unregisterChangeHandler(this.props.id,this.changeHandler),this.bindings={},this.props.context.linkContext&&(this.props.context.linkContext.unsubscribe&&this.props.context.linkContext.unsubscribe(this.IDs),Se.removeFromArray(this.props.context.linkContext.visibility,this.IDs,this.props.view,this.props.id),Se.removeFromArray(this.props.context.linkContext.lastChanges,this.IDs,this.props.view,this.props.id),Se.removeFromArray(this.props.context.linkContext.signals,this.IDs,this.props.view,this.props.id),Se.removeFromArray(this.props.context.linkContext.bindings,this.IDs,this.props.view,this.props.id)),this.destroy()}static applyStyle(e,t,n,r){if(typeof t=="string"){const s=Se.parseStyle(t);Object.keys(s).forEach(o=>{if(!o.startsWith("_")){let a=s[o];(o==="top"||o==="left"||o==="width"||o==="height")&&a!=="0"&&a!==0&&a!==null&&a!==""&&a.toString().match(/^[+-]?([0-9]*[.])?[0-9]+$/)&&(a=`${a}px`),o.includes("-")&&(console.log(`${o} to ${a}`),o=o.replace(/-([a-z])/g,l=>l[1].toUpperCase())),a?e.style[o]=a:e.style[o]&&(e.style[o]="")}})}else if(t){const s=t;if(Object.keys(s).forEach(o=>{let a=s[o];o&&a!==void 0&&a!==null&&!o.startsWith("_")&&((o==="top"||o==="left"||o==="width"||o==="height")&&a!=="0"&&a!==0&&a!==null&&a!==""&&a.toString().match(/^[+-]?([0-9]*[.])?[0-9]+$/)&&(a=`${a}px`),o.includes("-")&&(o=o.replace(/-([a-z])/g,l=>l[1].toUpperCase())),a?e.style[o]=a:e.style[o]&&(e.style[o]=""))}),r){n&&(e.style.zIndex=(500+(parseInt(s["z-index"],10)||0)).toString());const o=parseInt(e.style.zIndex,10)||0,a=e.parentNode.querySelector(`#rx_${e.id}`);a&&(a.style.zIndex=(o+1).toString()),e.style.userSelect="none",e.style.pointerEvents="none"}e.style.position==="absolute"&&(e.style.top||(e.style.top="0px"),e.style.left||(e.style.left="0px"))}}onCommand(e,t){var r,s,o,a,l,c,u,p,d,f,m,v;const n=super.onCommand(e,t);if(n===!1){if(e==="updatePosition")this.refService.current&&this.widDiv&&(this.refService.current.style.width=`${this.widDiv.offsetWidth}px`,this.refService.current.style.height=`${this.widDiv.offsetHeight}px`,this.refService.current.style.left=`${this.widDiv.offsetLeft}px`,this.refService.current.style.top=`${this.widDiv.offsetTop}px`);else if(e==="updateContainers"){const g=this.widDiv.querySelectorAll(".vis-view-container");if(g.length){const x=[];for(let y=0;y<g.length;y++){const w=(g[y].dataset.visContains||"").trim();w&&w!=="undefined"&&w!=="null"&&(x.push(w),g[y].className=_t(g[y].className,"vis-editmode-helper"))}x.sort(),JSON.stringify(x)!==JSON.stringify(this.state.legacyViewContainers)&&this.setState({legacyViewContainers:x})}}else if(e==="changeFilter"){if(!this.widDiv)return null;if(!((r=t==null?void 0:t.filter)!=null&&r.length))this.filterDisplay!==void 0&&(this.widDiv.style.display=this.filterDisplay,(s=this.widDiv._customHandlers)!=null&&s.onShow&&this.widDiv._customHandlers.onShow(this.widDiv,this.props.id));else if(t.filter[0]==="$")(a=(o=this.props.context.allWidgets[this.props.id])==null?void 0:o.data)!=null&&a.filterkey&&this.widDiv.style.display!=="none"&&(this.filterDisplay=this.widDiv.style.display,this.widDiv.style.display="none",(l=this.widDiv._customHandlers)!=null&&l.onHide&&this.widDiv._customHandlers.onHide(this.widDiv,this.props.id));else{const g=(c=this.props.context.allWidgets[this.props.id])==null?void 0:c.data.filterkey;if(g){let x=!1;for(let y=0;y<g.length;y++)if(t.filter.includes(g[y])){x=!0;break}x?this.filterDisplay!==void 0&&this.widDiv.style.display==="none"&&(this.widDiv.style.display=this.filterDisplay,(d=this.widDiv._customHandlers)!=null&&d.onShow&&((f=this.widDiv._customHandlers)==null||f.onShow(this.widDiv,this.props.id))):this.widDiv.style.display!=="none"&&(this.filterDisplay=this.widDiv.style.display,this.widDiv.style.display="none",(u=this.widDiv._customHandlers)!=null&&u.onHide&&((p=this.widDiv._customHandlers)==null||p.onHide(this.widDiv,this.props.id)))}}}else if(e==="collectFilters")return(v=(m=this.props.context.allWidgets[this.props.id])==null?void 0:m.data)==null?void 0:v.filterkey}return n}destroy(e){if(this.props.context.allWidgets[this.props.id]&&delete this.props.context.allWidgets[this.props.id],this.widDiv&&(!e||!this.props.id.startsWith("g"))){const t=this.props.context.jQuery(this.widDiv),n=t.data("destroy");typeof n=="function"&&(n(this.props.id,t),t.data("destroy",null)),this.widDiv.remove(),this.widDiv=null}}changeHandler=(e,t,n)=>{this.widDiv&&(e==="style"?this.props.context.allWidgets[this.props.id]&&$t.applyStyle(this.widDiv,this.props.context.allWidgets[this.props.id].style,this.state.selected,this.state.editMode):e==="signal"?this.updateSignal(t):e==="visibility"?this.updateVisibility():e==="lastChange"?this.updateLastChange():e==="binding"&&this.applyBinding(n))};updateSignal(e){if(this.widDiv){const t=this.widDiv.querySelector(`.vis-signal[data-index="${e.index}"]`);t&&(this.isSignalVisible(e.index)?t.style.display="":t.style.display="none")}}updateLastChange(){var e;if(this.widDiv){const t=(e=this.props.context.allWidgets[this.props.id])==null?void 0:e.data;if(t){const n=this.widDiv.querySelector(".vis-last-change");n?n.innerHTML=window.vis.binds.basic.formatDate(this.props.context.canStates.attr(`${t["lc-oid"]}.${t["lc-type"]==="last-change"?"lc":"ts"}`),t["lc-format"],t["lc-is-interval"],t["lc-is-moment"]):console.warn(`[${this.props.id}] Last change not found!`)}}}updateVisibility(){var e;if(this.widDiv&&!this.state.editMode){const t=(e=this.props.context.allWidgets[this.props.id])==null?void 0:e.data;t&&(Se.isWidgetHidden(t,this.props.context.canStates,this.props.id)||this.isWidgetFilteredOut(t)?(this.widDiv._storedDisplay=this.widDiv.style.display,this.widDiv.style.display="none",this.widDiv&&this.widDiv._customHandlers&&this.widDiv._customHandlers.onHide&&this.widDiv._customHandlers.onHide(this.widDiv,this.props.id)):(this.widDiv.style.display=this.widDiv._storedDisplay||"",this.widDiv._storedDisplay="",this.widDiv&&this.widDiv._customHandlers&&this.widDiv._customHandlers.onShow&&this.widDiv._customHandlers.onShow(this.widDiv,this.props.id)))}}isSignalVisible(e,t){if(t=t||this.props.context.allWidgets[this.props.id].data,!t)return!1;if(this.state.editMode)return!t[`signals-hide-edit-${e}`];const n=t[`signals-oid-${e}`];if(n){const r=this.props.context.canStates.attr(`${n}.val`),s=t[`signals-cond-${e}`];let o=t[`signals-val-${e}`];if(r==null||!s||o===void 0||o===null)return s==="not exist";if(r==="null"&&s!=="exist"&&s!=="not exist")return!1;let a=r;const l=typeof a;switch(l==="boolean"||r==="false"||r==="true"?o=o==="true"||o===!0||o===1||o==="1":l==="number"?o=parseFloat(o):l==="object"&&(a=JSON.stringify(a)),s){case"==":return o=o.toString(),a=a.toString(),a==="1"&&(a="true"),o==="1"&&(o="true"),a==="0"&&(a="false"),o==="0"&&(o="false"),o===a;case"!=":return o=o.toString(),a=a.toString(),a==="1"&&(a="true"),o==="1"&&(o="true"),a==="0"&&(a="false"),o==="0"&&(o="false"),o!==a;case">=":return a>=o;case"<=":return a<=o;case">":return a>o;case"<":return a<o;case"consist":return o=o.toString(),a=a.toString(),a.toString().includes(o);case"not consist":return o=o.toString(),a=a.toString(),!a.toString().includes(o);case"exist":return o!=="null";case"not exist":return o==="null";default:return console.log(`[${this.props.id}] Unknown signals condition: ${s}`),!1}}else return!1}addSignalIcon(e,t){var a;if(e||=(a=this.props.context.allWidgets[this.props.id])==null?void 0:a.data,!e)return;const n=window.document.createElement("div");n.className=`vis-signal ${e[`signals-blink-${t}`]?"vis-signals-blink":""} ${e[`signals-text-class-${t}`]||""}`,n.dataset.index=t.toString(),n.style.display=this.isSignalVisible(t)?"":"none",n.style.pointerEvents="none",n.style.position="absolute",n.style.zIndex="10",n.style.top=`${e[`signals-vert-${t}`]||0}%`,n.style.left=`${e[`signals-horz-${t}`]||0}%`;const r=window.document.createElement("img");r.className="vis-signal-icon";let s=e[`signals-icon-${t}`];s&&(s.startsWith("/vis/")||s.startsWith("/vis-2/")?s=s.substring(5):s.startsWith("/vis-2-beta/")&&(s=s.substring(12))),r.src=s,r.style.width=`${e[`signals-icon-size-${t}`]||32}px`,r.style.height="auto",$t.applyStyle(r,e[`signals-icon-style-${t}`]),n.appendChild(r);const o=e[`signals-text-${t}`];if(o){const l=window.document.createElement("div"),c=this.props.context.canStates.attr(`${e[`signals-oid-${t}`]}.val`);l.className="vis-signal-text",$t.applyStyle(l,e[`signals-text-style-${t}`]),l.innerHTML=o.replace("%s",(c??"").toString()),n.appendChild(l)}this.widDiv.appendChild(n)}addLastChange(e){const t=`${parseInt(e["lc-border-radius"],10)||0}px`,n={background:"rgba(182,182,182,0.6)",fontFamily:"Tahoma",position:"absolute",zIndex:0,borderRadius:e["lc-position-horz"]==="left"?`${t} 0 0 ${t}`:e["lc-position-horz"]==="right"?`0 ${t} ${t} 0`:t,whiteSpace:"nowrap"};e["lc-font-size"]&&(n.fontSize=e["lc-font-size"]),e["lc-font-style"]&&(n.fontStyle=e["lc-font-style"]),e["lc-font-family"]&&(n.fontFamily=e["lc-font-family"]),e["lc-bkg-color"]&&(n.background=e["lc-bkg-color"]),e["lc-color"]&&(n.color=e["lc-color"]),e["lc-border-width"]&&(n.borderWidth=parseInt(e["lc-border-width"],10)||0),e["lc-border-style"]&&(n.borderStyle=e["lc-border-style"]),e["lc-border-color"]&&(n.borderColor=e["lc-border-color"]),e["lc-padding"]?n.padding=e["lc-padding"]:(n.paddingTop=3,n.paddingBottom=3),e["lc-zindex"]&&(n.zIndex=e["lc-zindex"]),e["lc-position-vert"]==="top"?n.top=`${parseInt(e["lc-offset-vert"],10)}px`:e["lc-position-vert"]==="bottom"?n.bottom=`${parseInt(e["lc-offset-vert"],10)}px`:e["lc-position-vert"]==="middle"&&(n.top=`calc(50% + ${parseInt(e["lc-offset-vert"],10)-10}px)`);const r=parseFloat(e["lc-offset-horz"])||0;e["lc-position-horz"]==="left"?(n.right=`calc(100% - ${r}px)`,e["lc-padding"]||(n.paddingRight=10,n.paddingLeft=10)):e["lc-position-horz"]==="right"?(n.left=`calc(100% + ${r}px)`,e["lc-padding"]||(n.paddingRight=10,n.paddingLeft=10)):e["lc-position-horz"]==="middle"&&(n.left=`calc(50% + ${r}px)`);const s=window.document.createElement("div");s.className="vis-last-change",s.innerHTML=this.formatDate(this.props.context.canStates.attr(`${e["lc-oid"]}.${e["lc-type"]==="last-change"?"lc":"ts"}`),e["lc-format"],e["lc-is-interval"],e["lc-is-moment"]),Object.keys(n).forEach(o=>s.style[o]=n[o]),this.widDiv.prepend(s),Lo(this.widDiv.style)}addChart(e){this.widDiv.onclick=()=>{console.log(`[${this.props.id}] Show dialog with chart for ${e["echart-oid"]}`)}}applyBindings(e,t,n){Object.keys(this.bindings).forEach(r=>this.applyBinding(r,e,t,n))}applyBinding(e,t,n,r){const s=this.props.context.allWidgets[this.props.id];if(!s&&(!n||!r))return;const o=this.props.context.views[this.props.view].widgets[this.props.id];this.bindings[e].forEach(a=>{r=r||s.style;const l=this.props.context.formatUtils.formatBinding({format:a.format,view:a.view,wid:this.props.id,widget:o,widgetData:n||s.data,moment:this.props.context.moment});a.type==="data"?n?n[a.attr]=l:s&&s.data.attr(a.attr,l):a.type==="style"&&(r?(r[a.attr]=l,!t&&$t.applyStyle(this.widDiv,r,this.state.selected,this.state.editMode)):s&&(s.style.attr(a.attr,l),!t&&$t.applyStyle(this.widDiv,s.style,this.state.selected,this.state.editMode)))})}calcData(e,t,n){let r,s,o;try{r={wid:e,...t.data||{}},s=it(n||t.style||{}),Object.keys(r).forEach(a=>{a&&r[a]&&typeof r[a]=="string"&&(a.startsWith("src")||a.endsWith("src")||a.includes("icon"))&&r[a].startsWith("_PRJ_NAME")&&(r[a]=`../${this.props.context.adapterName}.${this.props.context.instance}/${this.props.context.projectName}${r[a].substring(9)}`)}),s["background-image"]&&s["background-image"].startsWith("_PRJ_NAME")&&(s["background-image"]=`../${this.props.context.adapterName}.${this.props.context.instance}/${this.props.context.projectName}${s["background-image"].substring(9)}`),this.applyBindings(!0,r,s),r.filterkey&&typeof r.filterkey=="string"&&(r.filterKeyParsed=r.filterkey.split(",").map(a=>a.trim()).filter(a=>a)),o=this.props.isRelative!==void 0?this.props.isRelative:s&&(s.position==="relative"||s.position==="static"||s.position==="sticky"),o&&(delete s.top,delete s.left,Ve(this.props.context.views[this.props.view].settings.rowGap)&&(s["margin-bottom"]=`${parseFloat(this.props.context.views[this.props.view].settings.rowGap)}px`)),this.state.multiViewWidget&&this.state.editMode&&(s.opacity===void 0||s.opacity===null||s.opacity>.3)&&(s.opacity=.3)}catch(a){return console.warn(`[${e}] Cannot bind data of widget: ${a}`),{widgetData:null,widgetStyle:null,isRelative:!1}}return{widgetData:r,widgetStyle:s,isRelative:o}}renderWidget(e,t,n,r,s){var w;r=r||0;const o=this.props.refParent;let a;if(Object.prototype.hasOwnProperty.call(o,"current")?a=o.current:(console.log("IT does EXIST!!!. CHECK ME!"),a=o),!a){r<5&&setTimeout(()=>this.renderWidget(e,t,n,r+1,s),50);return}const l=this.props.id;let c=this.props.context.views[this.props.view].widgets[l];if(!c||typeof c!="object")return;if(c!=null&&c.groupid){const S=this.props.context.views[this.props.view].widgets[c.groupid].data,M=Object.keys(S).map(b=>b.startsWith("attrType_")?b.substring(9):null).filter(b=>b);if(M.length&&c.data){let b=!1;Object.keys(c.data).forEach(I=>{if(typeof c.data[I]=="string"&&M.find(P=>c.data[I].includes(P))){const P=Mi(c.data[I],S);P.doesMatch&&(b||(b=!0,c=JSON.parse(JSON.stringify(c))),c.data[I]=P.newString||"")}})}}if(!e){const{isRelative:S,widgetData:M,widgetStyle:b}=this.calcData(l,c,n),I=JSON.stringify(M),P=JSON.stringify(b);if(this.widDiv&&this.oldEditMode===this.state.editMode&&this.oldData===I&&!e){if(this.oldStyle===P||M._no_style)return;if(!this.updateOnStyle){if(this.oldStyle=P,this.props.context.allWidgets[l]&&this.props.context.allWidgets[l].style){const E=this.props.context.allWidgets[l].style;Object.keys(b).forEach(A=>{typeof b[A]!="function"&&E[A]!==b[A]&&E.attr(A,b[A])})}$t.applyStyle(this.widDiv,b,this.state.selected,this.state.editMode),this.widDiv.style.position=S?b.position||"relative":"absolute",console.log("Rerender ignored as only style applied");return}}}this.destroy(e);const u=this.IDs;Se.removeFromArray(this.props.context.linkContext.visibility,this.IDs,this.props.view,l),Se.removeFromArray(this.props.context.linkContext.lastChanges,this.IDs,this.props.view,l),Se.removeFromArray(this.props.context.linkContext.signals,this.IDs,this.props.view,l),Se.removeFromArray(this.props.context.linkContext.bindings,this.IDs,this.props.view,l),this.setupSubscriptions();const p=u.filter(S=>!this.IDs.includes(S));p.length&&this.props.context.linkContext.unsubscribe(p);const d=this.IDs.filter(S=>!u.includes(S));d.length&&this.props.context.linkContext.subscribe(d);const{isRelative:f,widgetData:m,widgetStyle:v}=this.calcData(l,c,n),g=JSON.stringify(m),x=JSON.stringify(v);this.oldEditMode=this.state.editMode,this.oldData=g,this.oldStyle=x,m.wid=l,this.props.context.allWidgets[l]={style:new this.props.context.can.Map(v),data:new this.props.context.can.Map(m),wid:l};let y=m["visibility-groups"];if(!this.state.editMode&&(y!=null&&y.length)){if(m["visibility-groups-action"]==="hide"){if(!this.isUserMemberOfGroup(this.props.context.user,y))return;y=null}}else y=null;try{if(this.props.tpl){if(!this.widDiv||!e||!((w=c==null?void 0:c.data)!=null&&w.members.length)){const S={data:this.props.context.allWidgets[l].data,viewDiv:this.props.view,view:this.props.view,style:this.props.context.allWidgets[l].style};m!=null&&m.oid&&(S.val=this.props.context.canStates.attr(`${m.oid}.val`));const M=this.props.context.can.view(this.props.tpl,S),b=Array.from(M.querySelectorAll("script"));for(let I=0;I<b.length;I++){const P=b[I],E=document.createElement("script");E.innerHTML=P.innerHTML,P.parentNode.replaceChild(E,P)}if(f){const I=this.props.relativeWidgetOrder.indexOf(l);if(I===0)a.prepend(M);else if(I===this.props.relativeWidgetOrder.length-1)a.appendChild(M);else{let P;for(let E=I+1;E<this.props.relativeWidgetOrder.length;E++)if(P=a.querySelector(`#${this.props.relativeWidgetOrder[E]}`),P){a.insertBefore(M,P);break}P||a.appendChild(M)}}else a.appendChild(M)}}else{console.error(`[${l}] Widget is invalid. Please delete it.`);return}if(this.widDiv=a.querySelector(`#${l}`),this.widDiv){this.props.context.allWidgets[l].style&&!m._no_style&&$t.applyStyle(this.widDiv,this.props.context.allWidgets[l].style,this.state.selected,this.state.editMode),this.widDiv.style.position=f?this.props.context.allWidgets[l].style.position||"relative":"absolute",this.widDiv.style.boxSizing="border-box",m&&m.class&&(this.widDiv.className=_t(this.widDiv.className,m.class));const S=window.document.getElementById(this.props.tpl),M=S.dataset.visName||(l[0]==="g"?"group":"noname"),b=S.dataset.visSet||"noset";if(this.updateOnStyle=S.dataset.visUpdateStyle==="true",this.resizeLocked=S.dataset.visResizeLocked==="true",this.widDiv.className=_t(this.widDiv.className,`vis-tpl-${b}-${M.replace(/\s/g,"-")}`),!this.state.editMode)this.updateVisibility();else if(this.props.context.allWidgets[this.props.id]){const P=rd(this.widDiv,null,this.props.context.allWidgets[this.props.id].style);(this.state.resizable!==P.resizable||this.state.hideHelper!==P.hideHelper||this.state.draggable!==P.draggable)&&setTimeout(()=>this.setState(P),50)}let I=0;for(;m[`signals-oid-${I}`];)this.addSignalIcon(m,I),I++;m["lc-oid"]&&m["lc-oid"]!=="nothing_selected"&&this.addLastChange(m),!this.state.editMode&&m["echart-oid"]&&this.addChart(m),y&&c.data["visibility-groups-action"]==="disabled"&&!this.isUserMemberOfGroup(this.props.context.user,y)&&(this.widDiv.className=_t(this.widDiv.className,"vis-user-disabled")),this.refService.current&&setTimeout(()=>{this.refService.current&&this.widDiv&&(this.refService.current.style.width=`${this.widDiv.offsetWidth}px`,this.refService.current.style.height=`${this.widDiv.offsetHeight}px`,f&&(this.refService.current.style.left=`${this.widDiv.offsetLeft}px`,this.refService.current.style.top=`${this.widDiv.offsetTop}px`))},50),this.onCommand("updateContainers")}else console.log("Div not yet rendered");this.props.askView&&this.props.askView("register",{id:l,widDiv:this.widDiv||null,refService:this.refService,onMove:this.onMove,onResize:this.onResize,onTempSelect:this.onTempSelect,onCommand:this.onCommandBound})}catch(S){const M=(S.toString()+S.stack.toString()).split(`
`),b=`can't render ${this.props.tpl} ${l} on "${this.props.view}": `;this.props.context.socket.log(b,"error"),console.error(b);for(let I=0;I<M.length;I++){const P=`${I} - ${M[I]}`;this.props.context.socket.log(P,"error"),console.error(P)}}s&&s()}shouldComponentUpdate(e,t){const n=JSON.stringify(t);return this.widDiv?!this.lastState||n!==this.lastState?(this.lastState=n,!0):!1:(this.lastState=n,!0)}renderWidgetBody(e){if(this.state.applyBindings&&!this.bindingsTimer&&(this.bindingsTimer=setTimeout(()=>{this.bindingsTimer=null,this.renderWidget(!0)},10)),this.widDiv&&this.state.editMode&&this.props.context.allWidgets[this.props.id]){const n=this.props.context.allWidgets[this.props.id].style["z-index"],r=parseInt(n||0,10);this.state.selected?this.widDiv.style.zIndex=(500+(r||0)).toString():n!==void 0&&(this.widDiv.style.zIndex=parseInt(n||0,10).toString()),this.state.selected?e.style.zIndex=500+(r||0)+1:e.style.zIndex=(r||0)+1,this.widDiv.style.userSelect="none",this.widDiv.style.pointerEvents="none",this.filterDisplay!==void 0&&(this.widDiv.style.display=this.filterDisplay,delete this.filterDisplay)}e.style.position="absolute";const t=this.state.legacyViewContainers.length?this.state.legacyViewContainers.map(n=>{const r=this.props.context,s=r.VisView;this.refViews[n]=this.refViews[n]||ve.createRef();const o=r.linkContext.getViewRef(n);return o&&o!==this.refViews[n]?(console.log("View is not rendered as used somewhere else!"),null):n&&r.views[n]?h.jsx(s,{context:r,activeView:n,editMode:!1,view:n,visInWidget:!0,theme:this.props.context.theme,viewsActiveFilter:this.props.viewsActiveFilter},n):null}):null;return this.state.editMode||(e.style.display="none"),t}}const h0=200,sd=56,ot=48,we={root:{width:"100%",height:"100%",display:"flex",position:"relative"},rootHorizontal:{width:"100%",height:"100%",display:"flex",position:"relative",flexDirection:"column"},toolBar:i=>({width:"100%",height:ot,overflow:"hidden",lineHeight:`${ot}px`,pl:"16px",fontSize:20,backgroundColor:i.palette.primary.main,color:i.palette.primary.contrastText,transition:"padding-left 0.4s ease-in-out",display:"flex",alignItems:"center",gap:8}),toolbarIcon:{height:32,width:"auto"},verticalMenu:i=>({width:"100%",top:0,left:0,height:ot,overflow:"hidden",lineHeight:`${ot}px`,backgroundColor:i.palette.primary.main,zIndex:450}),toolBarWithClosedMenu:{paddingLeft:`${16+ot}px`},viewContentWithToolbar:{position:"relative",height:`calc(100% - ${ot}px)`,width:"100%"},viewContentWithoutToolbar:{position:"relative",height:"100%",width:"100%"},openMenuButton:{position:"absolute",top:5,width:ot,height:ot,zIndex:999,transition:"all 0.4s ease-in-out"},openMenuButtonFull:{},openMenuButtonNarrow:{left:9},openMenuButtonHidden:{left:9,opacity:.5},openMenuButtonIconHidden:{transform:"rotate(180deg)",transformOrigin:"center",transition:"all 0.3s ease-in-out"},menu:{transition:"width 0.4s ease-in-out, opacity 0.3s ease-in-out"},menuFull:{height:"100%",display:"inline-block",overflow:"hidden",opacity:1},menuNarrow:{width:sd,height:"100%",display:"inline-block",overflow:"hidden",opacity:1},menuHidden:{width:0,height:"100%",display:"inline-block",opacity:0},afterMenu:{transition:"width 0.4s ease-in-out"},afterMenuFull:{height:"100%",display:"inline-block"},afterMenuNarrow:{width:`calc(100% - ${sd}px)`,height:"100%",display:"inline-block"},afterMenuHidden:{width:"100%",height:"100%",display:"inline-block"},menuList:{width:"100%",height:"calc(100% - 49px)",overflowY:"auto",overflowX:"hidden"},menuItem:{minHeight:ot},listItemIcon:{width:24,height:24},listItemIconText:{paddingLeft:8,opacity:1,transition:"opacity 0.3s ease-in-out",position:"absolute",top:12,left:16},listItemText:{whiteSpace:"nowrap",transition:"all 0.3s ease-in-out",opacity:1},listItemTextNarrow:{opacity:0},selectedMenu:i=>({backgroundColor:i.palette.secondary.main,color:i.palette.secondary.contrastText}),menuToolbar:{height:ot,display:"flex",lineHeight:`${ot}px`,verticalAlign:"middle",paddingLeft:16,fontSize:20,whiteSpace:"nowrap",transition:"opacity 0.3s ease-in-out"},menuToolbarFull:{opacity:1},menuToolbarNarrow:{opacity:0},transparent:{opacity:0}};class f0 extends ve.Component{renderMenu(e,t){const n=[];if(Object.keys(this.props.context.views).forEach(o=>{var l;if(o==="___settings")return;const a=this.props.context.views[o].settings;if(a.navigation){const c={text:e.navigationOrientation==="horizontal"&&a.navigationOnlyIcon?null:a.navigationTitle||o,color:a.navigationColor,icon:a.navigationIcon||a.navigationImage,noText:a.navigationOnlyIcon,order:parseInt(a.navigationOrder||"0"),view:o};n.push(c),(l=c.icon)!=null&&l.startsWith("_PRJ_NAME/")&&(c.icon=`../${this.props.context.adapterName}.${this.props.context.instance}/${this.props.context.projectName}${c.icon.substring(9)}`)}}),n.sort((o,a)=>o.order===a.order?0:o.order<a.order?-1:1),e.navigationOrientation==="horizontal")return h.jsx(k.Box,{component:"div",sx:we.verticalMenu,style:{backgroundColor:e.navigationBarColor||this.props.context.theme.palette.background.paper,opacity:this.props.editMode?.4:1,position:this.props.context.runtime?"fixed":"relative"},children:h.jsx(k.Tabs,{value:this.props.activeView,children:n.map((o,a)=>h.jsx(k.Tab,{iconPosition:"start",style:{minHeight:48,minWidth:o.noText?20:void 0,color:this.props.activeView===o.view?e.navigationSelectedColor:e.navigationColor},icon:o.icon?h.jsx(N.Icon,{src:o.icon,style:{...we.listItemIcon,color:this.props.activeView===o.view?e.navigationSelectedColor:e.navigationColor}}):void 0,onClick:()=>this.props.context.changeView(o.view),value:o.view,label:o.text},a))})});const r={...we.menu,width:this.props.menuWidth==="full"?t:void 0,...this.props.menuWidth==="full"?we.menuFull:void 0,...this.props.menuWidth==="narrow"?we.menuNarrow:void 0,...this.props.menuWidth==="hidden"?we.menuHidden:void 0,opacity:this.props.editMode?.4:1,backgroundColor:e.navigationBackground||void 0};e.navigationHideOnSelection&&(r.zIndex=998,r.position=this.props.context.runtime?"fixed":"absolute",r.top=0,r.left=0,r.backgroundColor=e.navigationBackground||this.props.context.theme.palette.background.paper);const s={...we.menuToolbar,...this.props.menuWidth==="full"?we.menuToolbarFull:void 0,...this.props.menuWidth==="narrow"?we.menuToolbarNarrow:void 0,...this.props.menuWidth==="hidden"?we.menuToolbarNarrow:void 0,color:e.navigationHeaderTextColor||void 0};return h.jsxs("div",{style:r,children:[h.jsx("div",{style:s,children:e.navigationHeaderText||""}),h.jsx(k.Divider,{}),h.jsx("div",{style:we.menuList,children:h.jsx(k.List,{children:n.map((o,a)=>{const l=h.jsx(k.ListItem,{disablePadding:!0,sx:N.Utils.getStyle(this.props.theme,we.menuItem,this.props.activeView===o.view&&we.selectedMenu),style:{backgroundColor:this.props.activeView===o.view?e.navigationSelectedBackground:void 0},onClick:()=>{e.navigationHideOnSelection&&this.hideNavigationMenu(),this.props.context.changeView(o.view)},children:h.jsxs(k.ListItemButton,{children:[h.jsx(k.ListItemIcon,{children:o.icon?h.jsx(N.Icon,{src:o.icon,style:{color:this.props.activeView===o.view?e.navigationSelectedColor:e.navigationColor,backgroundColor:"rgba(1,1,1,0)"},sx:N.Utils.getStyle(this.props.theme,we.listItemIcon,this.props.activeView===o.view&&we.selectedMenu)}):h.jsxs(h.Fragment,{children:[h.jsx(be.Dashboard,{style:{color:this.props.activeView===o.view?e.navigationSelectedColor:e.navigationColor,backgroundColor:"rgba(1,1,1,0)"},sx:N.Utils.getStyle(this.props.theme,this.props.menuWidth!=="full"&&we.transparent,this.props.activeView===o.view&&we.selectedMenu)}),o.text?h.jsx("span",{style:{...we.listItemIconText,...this.props.menuWidth==="full"?we.transparent:void 0,color:this.props.activeView===o.view?e.navigationSelectedColor:e.navigationColor},children:o.text[0].toUpperCase()}):null]})}),h.jsx(k.ListItemText,{primary:o.text,style:{color:this.props.activeView===o.view?e.navigationSelectedColor:e.navigationColor},sx:{"&.MuListItemText-primary":N.Utils.getStyle(this.props.theme,we.listItemText,this.props.activeView===o.view&&!e.navigationSelectedColor&&we.selectedMenu,this.props.menuWidth==="narrow"&&we.listItemTextNarrow)}})]})},a);return h.jsx(k.Tooltip,{title:this.props.menuWidth!=="full"?o.text:"",slotProps:{popper:{sx:{pointerEvents:"none"}}},children:l},a)})})})]})}renderToolbar(e){if(!e.navigationBar)return null;let t;e.navigationBarColor?t={backgroundColor:e.navigationBarColor,color:N.Utils.getInvertedColor(e.navigationBarColor,this.props.context.themeType,!0)}:t={},t.opacity=this.props.editMode?.4:1;let n=e.navigationBarIcon||e.navigationBarImage;return n!=null&&n.startsWith("_PRJ_NAME/")&&(n=`../${this.props.context.adapterName}.${this.props.context.instance}/${this.props.context.projectName}${n.substring(9)}`),h.jsxs(k.Box,{component:"div",sx:N.Utils.getStyle(this.props.theme,we.toolBar,this.props.menuWidth==="hidden"&&we.toolBarWithClosedMenu),style:t,children:[n?h.jsx(N.Icon,{src:n,style:we.toolbarIcon}):null,e.navigationBarText||this.props.activeView]})}hideNavigationMenu(){window.localStorage.setItem("vis.navOpened","hidden"),this.props.setMenuWidth("hidden")}renderOpenMenuButton(e){let t,n;return this.props.menuWidth==="hidden"?(e.navigationButtonBackground?t=this.props.context.themeType==="dark"?"#FFFFFF40":"#00000040":t="transparent",e.navigationBar&&!e.navigationChevronColor?e.navigationBarColor?n=N.Utils.getInvertedColor(e.navigationBarColor,this.props.context.themeType,!0):n=this.props.context.themeType==="dark"?"#FFF":"#000":n=e.navigationChevronColor):t="transparent",h.jsx(k.IconButton,{onClick:()=>{e.navigationHideOnSelection?this.props.menuWidth==="full"?this.hideNavigationMenu():(window.localStorage.setItem("vis.navOpened","full"),this.props.setMenuWidth("full")):this.props.menuWidth==="full"?(window.localStorage.setItem("vis.navOpened","narrow"),this.props.setMenuWidth("narrow")):this.props.menuWidth==="narrow"?e.navigationNoHide?(window.localStorage.setItem("vis.navOpened","full"),this.props.setMenuWidth("full")):this.hideNavigationMenu():(window.localStorage.setItem("vis.navOpened","full"),this.props.setMenuWidth("full"))},style:{backgroundColor:t},children:h.jsx(be.ChevronLeft,{style:{...this.props.menuWidth==="hidden"||this.props.menuWidth==="narrow"&&e.navigationNoHide?we.openMenuButtonIconHidden:void 0,color:n}})})}render(){if(!this.props.context.views||!this.props.context.views[this.props.view])return null;const e=this.props.context.views[this.props.view].settings,t=parseInt(e.navigationWidth,10)||h0;if(e.navigation&&!this.props.visInWidget&&e.navigationOrientation==="horizontal"&&this.props.view===this.props.activeView)return h.jsxs("div",{style:we.rootHorizontal,children:[this.renderMenu(e,t),h.jsx("div",{style:{...we.viewContentWithToolbar,marginTop:this.props.context.runtime?ot:void 0},children:this.props.children})]});if(!e.navigation&&e.navigationBar)return h.jsxs("div",{style:we.afterMenuHidden,children:[this.renderToolbar(e),h.jsx("div",{style:we.viewContentWithToolbar,children:this.props.children})]});const n=e.navigationHideOnSelection?"hidden":this.props.menuWidth,r={...we.openMenuButton};this.props.menuWidth==="full"?(r.left=t-ot,Object.assign(r,we.openMenuButtonFull)):this.props.menuWidth==="narrow"?Object.assign(r,we.openMenuButtonNarrow):(Object.assign(r,we.openMenuButtonHidden),e.navigationBar&&(r.opacity=1));const s={...we.afterMenu};return e.navigationHideMenu?Object.assign(s,we.afterMenuHidden):n==="full"?(Object.assign(s,we.afterMenuFull),s.width=`calc(100% - ${t}px)`):n==="narrow"?Object.assign(s,we.afterMenuNarrow):Object.assign(s,we.afterMenuHidden),h.jsxs("div",{style:we.root,children:[e.navigationHideMenu?null:h.jsx("div",{style:r,children:this.renderOpenMenuButton(e)}),e.navigationHideMenu?null:this.renderMenu(e,t),h.jsxs("div",{style:s,children:[this.renderToolbar(e),h.jsx("div",{style:e.navigationBar?we.viewContentWithToolbar:we.viewContentWithoutToolbar,children:this.props.children})]})]})}}const rr=8;class St extends ve.Component{static Z_INDEXES={VIEW_SELECT_RECTANGLE:1201,WIDGET_SERVICE_DIV:1200};calculateRelativeWidgetPosition=null;static themeCache={};promiseToCollect;refView;refRelativeView;refRelativeColumnsView;widgetsRefs;selectDiv;movement;theme;ignoreMouseEvents;oldFilter;registerDone=!1;lastClick=0;nextClickIsSteal=null;loadingTheme=!1;moveTimer=null;keysHandlerInstalled=!1;constructor(e){super(e),this.promiseToCollect=Fe.collectRxInformation(e.context.socket,_e.getState().visProject,e.context.changeProject),this.state={mounted:!1,rulers:[],loadedjQueryTheme:"",themeCode:"",width:0,menuWidth:window.localStorage.getItem("vis.menuWidth")||"full"},this.refView=ve.createRef(),this.refRelativeView=ve.createRef(),this.refRelativeColumnsView=new Array(rr);for(let t=0;t<rr;t++)this.refRelativeColumnsView[t]=ve.createRef();this.widgetsRefs={},this.selectDiv=null,this.movement=null,this.theme={},this.ignoreMouseEvents=!1,this.oldFilter=JSON.stringify(e.viewsActiveFilter&&e.viewsActiveFilter[this.props.view]||[])}async componentDidMount(){this.updateViewWidth(),await this.promiseToCollect,this.props.context.linkContext.registerViewRef(this.props.view,this.refView,this.onCommand),await this.loadJqueryTheme(this.getJQueryThemeName()),this.setState({mounted:!0},()=>this.registerEditorHandlers())}componentWillUnmount(){var e;this.props.context.linkContext.unregisterViewRef(this.props.view,this.refView),(e=this.refView.current)!=null&&e._originalParent&&(this.refView.current._originalParent.appendChild(this.refView.current),this.refView.current._originalParent=null),this.selectDiv&&(this.selectDiv.remove(),this.selectDiv=null),this.widgetsRefs={},this.registerEditorHandlers(!0),this.uninstallKeyHandlers()}onCommand=(e,t)=>{var n;if(e==="updateContainers")return Object.keys(this.widgetsRefs).forEach(r=>{var s;(s=this.widgetsRefs[r])!=null&&s.onCommand&&this.widgetsRefs[r].onCommand("updateContainers")}),null;if(e==="changeFilter")return this.changeFilter(t),null;if(e==="closeDialog"||e==="openDialog")return(n=this.widgetsRefs[t])!=null&&n.onCommand&&this.widgetsRefs[t].onCommand(e),null;if(e==="collectFilters"){const r=_e.getState().visProject[this.props.view].widgets,s=[];return Object.keys(r).forEach(o=>{var l,c,u,p;let a;(l=this.widgetsRefs[o])!=null&&l.onCommand?a=(c=this.widgetsRefs[o])==null?void 0:c.onCommand("collectFilters"):a=(p=(u=r[o])==null?void 0:u.data)==null?void 0:p.filterkey,a&&(a&&typeof a=="string"&&(a=a.split(",").map(d=>d.trim()).filter(d=>d)),a.forEach(d=>!s.includes(d)&&s.push(d)))}),s}return null};changeFilter(e){if(e={filter:[],...e},e.filter&&(this.props.viewsActiveFilter[this.props.view]=e.filter,Object.keys(this.widgetsRefs).forEach(t=>{var n;(n=this.widgetsRefs[t])!=null&&n.onCommand&&this.widgetsRefs[t].onCommand("changeFilter")}),window.vis.binds.bars&&window.vis.binds.bars.filterChanged))try{window.vis.binds.bars.filterChanged(this.props.view,e.filter.join(","))}catch(t){console.error(`Cannot change filter: ${t}`)}return null}askView=(e,t)=>{const n=this.widgetsRefs;if(e==="register"){if(t){const r=t.id;n[r]=t}}else if(e==="unregister")t&&n[t.id]&&n[t.id].uuid===t.uuid&&delete n[t.id];else if(e==="update")t&&n[t.id]&&n[t.id].uuid===t.uuid&&Object.assign(n[t.id],t);else if(e==="getRef"){if(t)return n[t.id]}else if(e==="getViewClass")return this;return null};onMouseWindowDown=e=>{var t;(t=this.refView.current)!=null&&t.contains(e.target)||this.cancelStealMode(null)};onStealStyle=(e,t)=>{if(!e){this.cancelStealMode(null);return}this.nextClickIsSteal={attr:e,cb:t},Object.keys(this.widgetsRefs).forEach(n=>{var r;(r=this.widgetsRefs[n])!=null&&r.onCommand&&this.widgetsRefs[n].onCommand("startStealMode")}),window.document.addEventListener("mousedown",this.onMouseWindowDown)};cancelStealMode(e){this.nextClickIsSteal&&(window.document.removeEventListener("mousedown",this.onMouseWindowDown),this.nextClickIsSteal.cb(e),Object.keys(this.widgetsRefs).forEach(t=>{var r;const n=(r=this.widgetsRefs[t])==null?void 0:r.onCommand;n&&n("cancelStealMode")}),this.nextClickIsSteal=null)}mouseDownLocal=this.props.context.runtime?null:e=>{var n;if(this.ignoreMouseEvents||e.button===2)return;if(this.nextClickIsSteal){this.cancelStealMode(null);return}this.props.context.setSelectedWidgets([]),this.onMouseViewMove&&window.document.addEventListener("mousemove",this.onMouseViewMove),this.onMouseViewUp&&window.document.addEventListener("mouseup",this.onMouseViewUp);const t=(n=this.refView.current)==null?void 0:n.getBoundingClientRect();t&&(this.movement={moved:!1,x:e.clientX-t.left,y:e.clientY-t.top,startX:e.pageX,startY:e.pageY,w:0,h:0,selectedWidgetsWithRectangle:[],simpleMode:e.shiftKey||e.ctrlKey})};doubleClickOnView=()=>{var e;this.props.editMode&&((e=this.props.selectedWidgets)==null?void 0:e.length)===1&&_e.getState().visProject[this.props.view].widgets[this.props.selectedWidgets[0]].tpl==="_tplGroup"&&this.props.context.setSelectedGroup(this.props.selectedWidgets[0])};getWidgetsInRect(e,t){const n=Object.keys(this.widgetsRefs).filter(r=>{var o;if(!_e.getState().visProject[this.props.view].widgets[r])return r!=="fakeId"&&console.warn(`Orphaned widget ${r} found!`),null;if(_e.getState().visProject[this.props.view].widgets[r].groupid&&!this.props.selectedGroup)return null;const s=this.widgetsRefs[r].widDiv||((o=this.widgetsRefs[r].refService)==null?void 0:o.current);if(s){const a=s.getBoundingClientRect();if(t){if(a.top>=e.top&&a.top<=e.bottom&&a.left>=e.left&&a.left<=e.right||a.bottom>=e.top&&a.bottom<=e.bottom&&a.right>=e.left&&a.right<=e.right||a.top>=e.top&&a.top<=e.bottom&&a.right>=e.left&&a.right<=e.right||a.bottom>=e.top&&a.bottom<=e.bottom&&a.left>=e.left&&a.left<=e.right)return!0}else if(a.top>=e.top&&a.top<=e.bottom&&a.left>=e.left&&a.left<=e.right&&a.bottom>=e.top&&a.bottom<=e.bottom&&a.right>=e.left&&a.right<=e.right)return!0}return!1});return n.sort(),n}onMouseViewMove=this.props.context.runtime?null:e=>{if(!(this.ignoreMouseEvents||!this.movement)&&(!this.selectDiv&&this.refView.current&&(this.selectDiv=window.document.createElement("div"),this.selectDiv.style.position="absolute",this.selectDiv.style.zIndex=St.Z_INDEXES.VIEW_SELECT_RECTANGLE.toString(),this.selectDiv.className="vis-editmode-select-rect",this.refView.current.appendChild(this.selectDiv)),this.movement.moved=!0,this.movement.w=e.pageX-(this.movement.startX||0),this.movement.h=e.pageY-(this.movement.startY||0),this.selectDiv)){this.movement.w>=0?(this.selectDiv.style.left=`${this.movement.x}px`,this.selectDiv.style.width=`${this.movement.w}px`):(this.selectDiv.style.left=`${this.movement.x+this.movement.w}px`,this.selectDiv.style.width=`${-this.movement.w}px`),this.movement.h>=0?(this.selectDiv.style.top=`${this.movement.y}px`,this.selectDiv.style.height=`${this.movement.h}px`):(this.selectDiv.style.top=`${this.movement.y+this.movement.h}px`,this.selectDiv.style.height=`${-this.movement.h}px`);const t=this.getWidgetsInRect(this.selectDiv.getBoundingClientRect(),this.movement.simpleMode||!1);this.movement.selectedWidgetsWithRectangle&&JSON.stringify(t)!==JSON.stringify(this.movement.selectedWidgetsWithRectangle)&&(t.forEach(n=>{var r,s,o;!((s=(r=this.movement)==null?void 0:r.selectedWidgetsWithRectangle)!=null&&s.includes(n))&&this.widgetsRefs[n]&&!_e.getState().visProject[this.props.view].widgets[n].data.locked&&this.props.selectedGroup!==n&&(o=this.widgetsRefs[n])!=null&&o.onTempSelect&&this.widgetsRefs[n].onTempSelect(!0)}),this.movement.selectedWidgetsWithRectangle.forEach(n=>{var r;!t.includes(n)&&((r=this.widgetsRefs[n])!=null&&r.onTempSelect)&&this.widgetsRefs[n].onTempSelect(!1)}),this.movement.selectedWidgetsWithRectangle=t.filter(n=>!_e.getState().visProject[this.props.view].widgets[n].data.locked))}};onMouseViewUp=this.props.context.runtime?null:e=>{var t;this.ignoreMouseEvents||(e&&e.stopPropagation(),this.onMouseViewMove&&window.document.removeEventListener("mousemove",this.onMouseViewMove),this.onMouseViewUp&&window.document.removeEventListener("mouseup",this.onMouseViewUp),this.selectDiv&&(this.selectDiv.remove(),this.selectDiv=null),(t=this.movement)!=null&&t.selectedWidgetsWithRectangle&&this.props.context.setSelectedWidgets(this.movement.selectedWidgetsWithRectangle),this.movement=null)};mouseDownOnView=this.props.context.runtime?null:(e,t,n,r,s)=>{var a,l;if(this.ignoreMouseEvents)return;if(this.nextClickIsSteal){if(this.widgetsRefs[t]){const c=this.widgetsRefs[t].widDiv||((a=this.widgetsRefs[t].refService)==null?void 0:a.current);this.cancelStealMode(c?c.style[this.nextClickIsSteal.attr]:null)}else this.cancelStealMode(null);return}if(this.props.context.disableInteraction||this.props.context.lockDragging||this.props.selectedWidgets.map(c=>_e.getState().visProject[this.props.view].widgets[c]).find(c=>c.data.locked))return;if(this.lastClick&&Date.now()-this.lastClick<250||s){this.lastClick=Date.now(),this.props.selectedWidgets.length===1&&_e.getState().visProject[this.props.view].widgets[this.props.selectedWidgets[0]].tpl==="_tplGroup"&&this.props.context.setSelectedGroup(this.props.selectedWidgets[0]);return}if(this.lastClick=Date.now(),this.props.selectedWidgets.includes(this.props.selectedGroup)&&!r)return;this.onMouseWidgetMove&&((l=this.refView.current)==null||l.addEventListener("mousemove",this.onMouseWidgetMove)),this.onMouseWidgetUp&&window.document.addEventListener("mouseup",this.onMouseWidgetUp),this.movement={moved:!1,startX:e.pageX,startY:e.pageY,isResize:r,x:0,y:0};const o=this.widgetsRefs;this.props.selectedWidgets.forEach(c=>{var p,d,f,m;const u=(d=(p=o[c].refService)==null?void 0:p.current)==null?void 0:d.getBoundingClientRect();this.movement&&u&&e.pageX<=u.right&&e.pageX>=u.left&&e.pageY<=u.bottom&&e.pageY>=u.top&&(this.movement.startWidget=(m=(f=o[c].refService)==null?void 0:f.current)==null?void 0:m.getBoundingClientRect())}),this.props.selectedWidgets.forEach(c=>{var u;(u=o[c])!=null&&u.onMove&&o[c].onMove()}),Object.keys(o).forEach(c=>{var u;(u=o[c])!=null&&u.onCommand&&o[c].onCommand("startMove")})};onIgnoreMouseEvents=e=>{var t;this.props.editMode&&(this.ignoreMouseEvents=e,this.props.context.onIgnoreMouseEvents(e),e&&this.movement&&(this.onMouseWidgetMove&&((t=this.refView.current)==null||t.removeEventListener("mousemove",this.onMouseWidgetMove)),this.onMouseWidgetUp&&window.document.removeEventListener("mouseup",this.onMouseWidgetUp),this.movement=null))};onMouseWidgetMove=this.props.context.runtime?null:e=>{var r,s,o,a,l,c,u,p,d,f,m,v,g,x,y,w,S,M,b;if(!this.movement||!this.refView.current||this.props.selectedWidgets.includes(this.props.selectedGroup)&&!this.movement.isResize)return;const t=this.widgetsRefs;this.movement.moved=!0,this.movement.x=e.pageX-(this.movement.startX||0),this.movement.y=e.pageY-(this.movement.startY||0);const n=this.refView.current.getBoundingClientRect();if(!this.movement.isResize&&((r=_e.getState().visProject[this.props.view].settings)==null?void 0:r.snapType)===2){const I=parseInt(((s=_e.getState().visProject[this.props.view].settings)==null?void 0:s.gridSize)||0,10)||10;this.movement.x-=Math.ceil(((((o=this.movement.startWidget)==null?void 0:o.left)||0)-n.left+this.movement.x)%I),this.movement.y-=Math.ceil(((((a=this.movement.startWidget)==null?void 0:a.top)||0)-n.top+this.movement.y)%I)}if(!this.movement.isResize&&((l=_e.getState().visProject[this.props.view].settings)==null?void 0:l.snapType)===1){const I=(((c=this.movement.startWidget)==null?void 0:c.left)||0)+this.movement.x,P=(((u=this.movement.startWidget)==null?void 0:u.right)||0)+this.movement.x,E=(((p=this.movement.startWidget)==null?void 0:p.top)||0)+this.movement.y,A=(((d=this.movement.startWidget)==null?void 0:d.bottom)||0)+this.movement.y;for(const T in t){const W=T;if(this.props.selectedWidgets.includes(W))continue;const F=(m=(f=t[W].refService)==null?void 0:f.current)==null?void 0:m.getBoundingClientRect();if(F){if(Math.abs(F.top-A)<=10&&I<=F.right&&P>=F.left){this.movement.y+=Math.round(F.top-A);break}if(Math.abs(F.bottom-E)<=10&&I<=F.right&&P>=F.left){this.movement.y+=Math.round(F.bottom-E);break}if(Math.abs(F.left-P)<=10&&E<=F.bottom&&A>=F.top){this.movement.x+=Math.round(F.left-P);break}if(Math.abs(F.right-I)<=10&&E<=F.bottom&&A>=F.top){this.movement.x+=Math.round(F.right-I);break}}}}if(this.showRulers(),this.props.selectedWidgets.forEach(I=>{var T;const P=(T=t[I])==null?void 0:T.onMove;P&&this.movement&&P(this.movement.x,this.movement.y,!1,this.calculateRelativeWidgetPosition);const E=_e.getState().visProject[this.props.view].widgets[I];Object.keys(E.data).forEach(W=>{var F;if(W.startsWith("widget")&&E.data[W]){const j=(F=t[E.data[W]])==null?void 0:F.onCommand;j&&j("updatePosition")}})}),this.props.selectedWidgets.length===1&&((g=(v=t[this.props.selectedWidgets[0]])==null?void 0:v.refService)!=null&&g.current)){let I=!1;for(const P in t){const E=P;if(this.props.selectedWidgets.includes(E)||!t[E]||!t[E].canHaveWidgets||t[E].doNotWantIncludeWidgets||!t[E].onCommand||!((x=t[E].refService)!=null&&x.current))continue;const A=(w=(y=t[this.props.selectedWidgets[0]].refService)==null?void 0:y.current)==null?void 0:w.getBoundingClientRect(),T=(M=(S=t[E].refService)==null?void 0:S.current)==null?void 0:M.getBoundingClientRect(),W=(b=t[E])==null?void 0:b.onCommand;!I&&A&&T&&A.top>=T.top&&A.left>=T.left&&A.right<=T.right&&A.bottom<=T.bottom?(I=!0,W&&W("includePossible")):W&&W("includePossibleNOT")}}};showRulers=e=>{var l,c,u,p,d,f;const t=[];if(e){this.setState({rulers:t});return}const n=[],r=[],s=(l=this.refView.current)==null?void 0:l.getBoundingClientRect();if(!s)return;for(const m of Object.keys(this.widgetsRefs)){const v=m,{widgets:g}=co(_e.getState(),this.props.view);if(!this.props.selectedWidgets.includes(v)&&g[v]&&(this.props.selectedGroup&&g[this.props.selectedGroup].data.members.includes(v)||!this.props.selectedGroup)&&(!g[v].grouped||this.props.selectedGroup))if(!((c=this.widgetsRefs[v].refService)!=null&&c.current))console.error(`CHECK WHY!!! ${v} has no refService.current`);else{const x=(p=(u=this.widgetsRefs[v].refService)==null?void 0:u.current)==null?void 0:p.getBoundingClientRect();x&&(r.push(Math.round(x.top)),r.push(Math.round(x.bottom)),n.push(Math.round(x.left)),n.push(Math.round(x.right)))}}const o=[],a=[];for(const m of this.props.selectedWidgets){const{widgets:v}=co(_e.getState(),this.props.view);if(v[m]&&(!v[m].grouped||this.props.selectedGroup)){const g=(f=(d=this.widgetsRefs[m].refService)==null?void 0:d.current)==null?void 0:f.getBoundingClientRect();g&&(o.push(Math.round(g.top)),o.push(Math.round(g.bottom)),a.push(Math.round(g.left)),a.push(Math.round(g.right)))}}r.forEach(m=>o.forEach(v=>{Math.abs(m-v)<=.3&&t.push({type:"horizontal",value:m-s.top})})),n.forEach(m=>a.forEach(v=>{Math.abs(m-v)<=.3&&t.push({type:"vertical",value:m-s.left})})),this.setState({rulers:t})};onMouseWidgetUp=this.props.context.runtime?null:e=>{var n,r,s,o,a,l,c,u,p;const t=this.widgetsRefs;if(e&&e.stopPropagation(),this.onMouseWidgetMove&&((n=this.refView.current)==null||n.removeEventListener("mousemove",this.onMouseWidgetMove)),this.onMouseWidgetUp&&window.document.removeEventListener("mouseup",this.onMouseWidgetUp),(r=this.movement)!=null&&r.moved&&(this.props.selectedWidgets.forEach(d=>{var m;const f=(m=t[d])==null?void 0:m.onMove;f&&this.movement&&f(this.movement.x,this.movement.y,!0)}),_e.dispatch(wr(!0))),Object.keys(t).forEach(d=>{var m;const f=(m=t[d])==null?void 0:m.onCommand;f&&f("stopMove")}),this.props.selectedWidgets.length===1&&((o=(s=t[this.props.selectedWidgets[0]])==null?void 0:s.refService)!=null&&o.current))for(const d in t){const f=d;if(this.props.selectedWidgets.includes(f)||!t[f]||!t[f].canHaveWidgets||t[f].doNotWantIncludeWidgets||!t[f].onCommand||!((a=t[f].refService)!=null&&a.current))continue;const m=(c=(l=t[this.props.selectedWidgets[0]].refService)==null?void 0:l.current)==null?void 0:c.getBoundingClientRect(),v=(p=(u=t[f].refService)==null?void 0:u.current)==null?void 0:p.getBoundingClientRect();v&&m&&m.top>=v.top&&m.left>=v.left&&m.right<=v.right&&m.bottom<=v.bottom&&this.props.context.askAboutInclude(this.props.selectedWidgets[0],f,(g,x)=>{var w;const y=(w=t[x])==null?void 0:w.onCommand;y&&y("include",g)})}this.showRulers(!0)};editWidgetsRect(e){var a;if(!this.refView.current)return null;const t=this.refView.current.offsetLeft,n=this.refView.current.offsetTop,r=this.widgetsRefs[e].widDiv||((a=this.widgetsRefs[e].refService)==null?void 0:a.current);if(!r)return null;let s=r.offsetTop-n,o=r.offsetLeft-t;if(!o&&!s){const l=_e.getState().visProject[this.props.view].widgets[e].style;o=parseInt((l==null?void 0:l.left)||"0",10)+parseInt(r.offsetLeft,10),s=parseInt((l==null?void 0:l.top)||"0",10)+parseInt(r.offsetTop,10),o=o||0,s=s||0}return{top:s,left:o,width:r.clientWidth,height:r.clientHeight}}pxToPercent=(e,t)=>{if(!this.refView.current)return null;const n={left:this.refView.current.clientLeft,top:this.refView.current.clientTop,height:this.refView.current.clientHeight,width:this.refView.current.clientWidth};e.position==="relative"&&(delete t.top,delete t.left,e.width==="100%"&&delete t.width,e.height==="100%"&&delete t.height);const r={...t};return t.top&&ht(e.top).dimension==="%"&&ht(t.top).dimension!=="%"&&(r.top=ht(t.top).value*100/n.height,r.top=`${Math.round(r.top*100)/100}%`),t.left&&ht(e.left).dimension==="%"&&ht(t.left).dimension!=="%"&&(r.left=ht(t.left).value*100/n.width,r.left=`${Math.round(r.left*100)/100}%`),t.width&&ht(e.width).dimension==="%"&&ht(t.width).dimension!=="%"&&(r.width=ht(t.width).value/n.width*100,r.width=`${Math.round(r.width*100)/100}%`),t.height&&ht(e.height).dimension==="%"&&ht(t.height).dimension!=="%"&&(r.height=ht(t.height).value/n.height*100,r.height=`${Math.round(r.height*100)/100}%`),{...e,...r}};onPxToPercent=(e,t,n)=>{if(!this.refView.current)return[];const r={height:this.refView.current.clientHeight,width:this.refView.current.clientWidth},s=e.map(o=>{const a=this.editWidgetsRect(o);if(!a)return null;let l;return t==="top"?l=a.top*100/r.height:t==="left"?l=a.left*100/r.width:t==="width"?l=a.width/r.width*100:l=a.height/r.height*100,`${Math.round(l*100)/100}%`});return n&&n(s),s};onPercentToPx=(e,t,n)=>{const r=e.map(s=>{const o=this.editWidgetsRect(s);return o?`${Math.round(o[t])}px`:null});return n&&n(r),r};registerEditorHandlers(e){this.props.context.registerEditorCallback&&(!e&&this.props.activeView===this.props.view?this.registerDone||(this.registerDone=!0,this.props.context.registerEditorCallback("onStealStyle",this.props.view,this.onStealStyle),this.props.context.registerEditorCallback("onPxToPercent",this.props.view,this.onPxToPercent),this.props.context.registerEditorCallback("pxToPercent",this.props.view,this.pxToPercent),this.props.context.registerEditorCallback("onPercentToPx",this.props.view,this.onPercentToPx)):(this.registerDone=!1,this.props.context.registerEditorCallback("onStealStyle",this.props.view),this.props.context.registerEditorCallback("onPxToPercent",this.props.view),this.props.context.registerEditorCallback("pxToPercent",this.props.view),this.props.context.registerEditorCallback("onPercentToPx",this.props.view)))}updateViewWidth(){this.refRelativeView.current&&this.refRelativeView.current.offsetWidth!==this.state.width&&this.setState({width:this.refRelativeView.current.offsetWidth})}componentDidUpdate(){if(this.registerEditorHandlers(),this.updateViewWidth(),!this.props.editMode){const e=JSON.stringify(this.props.viewsActiveFilter&&this.props.viewsActiveFilter[this.props.view]||[]);this.oldFilter!==e&&(this.oldFilter=e,this.changeFilter({filter:JSON.parse(e)}))}}static renderGitter(e,t){t=t||"#D0D0D0",e=e||10;const n=e*5,r=e,o=`url(data:image/svg+xml;base64,${btoa(`<svg width="${n}" height="${n}" xmlns="http://www.w3.org/2000/svg">
<defs>
<pattern id="grid" width="${n}" height="${n}" patternUnits="userSpaceOnUse">
<path d="M 0 ${r} L ${n} ${r} M ${r} 0 L ${r} ${n} M 0 ${2*r} L ${n} ${2*r} M ${2*r} 0 L ${2*r} ${n} M 0 ${3*r} L ${n} ${3*r} M ${3*r} 0 L ${3*r} ${n} M 0 ${4*r} L ${n} ${4*r} M ${4*r} 0 L ${4*r} ${n}" fill="none" stroke="${t}" opacity="0.2" stroke-width="1"/>
<path d="M ${n} 0 L 0 0 0 ${n}" fill="none" stroke="${t}" stroke-width="1"/>
</pattern>
</defs>
<rect width="100%" height="100%" fill="url(#grid)"/>
</svg>`)})`;return h.jsx("div",{style:{opacity:.2,zIndex:-1,userSelect:"none",pointerEvents:"none",width:"100%",height:"100%",backgroundImage:o,backgroundPosition:"-1px -1px"}})}static getOneWidget(e,t,n){var s;if(!Fe.rxWidgets)return null;const r=Fe.rxWidgets[t.tpl]||((s=Fe.allWidgetsList)!=null&&s.includes(t.tpl)?$t:Se);return h.jsx(r,{tpl:t.tpl,...n},`${e}_${n.id}`)}async loadJqueryTheme(e){if(St.themeCache[e]&&this.props.view){let t=St.themeCache[e];const n=`visview_${this.props.view.replace(/\s/g,"_")}`;t=t.replace(".ui-helper-hidden",`
#${n} .ui-helper-hidden`),t=t.replace(/(}.)/g,`}
#${n} .`),t=t.replace(/,\./g,`,#${n} .`),t=t.replace(/images/g,`../../lib/css/themes/jquery-ui/${e}/images`),this.setState({loadedjQueryTheme:e,themeCode:t})}else try{let n=await(await fetch(`../../lib/css/themes/jquery-ui/${e}/jquery-ui.min.css`)).text();St.themeCache[e]=n;const r=`visview_${this.props.view.replace(/\s/g,"_")}`;n=n.replace(".ui-helper-hidden",`
#${r} .ui-helper-hidden`),n=n.replace(/(}.)/g,`}
#${r} .`),n=n.replace(/,\./g,`,#${r} .`),n=n.replace(/images/g,`../../lib/css/themes/jquery-ui/${e}/images`),this.setState({loadedjQueryTheme:e,themeCode:n})}catch(t){console.warn(`Cannot load jQueryUI theme "${e}": ${t.stack}`)}this.loadingTheme=!1}getJQueryThemeName(){var t;const e=this.props.view&&((t=_e.getState().visProject[this.props.view])==null?void 0:t.settings);return(e==null?void 0:e.theme)||"redmond"}installKeyHandlers(){this.keysHandlerInstalled||(this.keysHandlerInstalled=!0,window.addEventListener("keydown",this.onKeyDown,!1))}uninstallKeyHandlers(){this.keysHandlerInstalled&&(this.keysHandlerInstalled=!1,window.removeEventListener("keydown",this.onKeyDown,!1))}moveWidgets=(e,t)=>{this.moveTimer||(this.movement={x:0,y:0},this.props.selectedWidgets.forEach(n=>{var s;const r=(s=this.widgetsRefs[n])==null?void 0:s.onMove;r&&r()}),Object.keys(this.widgetsRefs).forEach(n=>{var s;const r=(s=this.widgetsRefs[n])==null?void 0:s.onCommand;r&&r("startMove")})),this.movement&&(this.movement.x+=e,this.movement.y+=t,this.props.selectedWidgets.forEach(n=>{var o;const s=(o=this.widgetsRefs[n])==null?void 0:o.onMove;s&&this.movement&&s(this.movement.x,this.movement.y,!1,this.calculateRelativeWidgetPosition)}),this.showRulers(),this.moveTimer&&clearTimeout(this.moveTimer),this.moveTimer=setTimeout(()=>{this.moveTimer=null,this.showRulers(!0),_e.dispatch(wr(!0)),this.props.selectedWidgets.forEach(n=>{var s;const r=(s=this.widgetsRefs[n])==null?void 0:s.onMove;r&&this.movement&&r(this.movement.x,this.movement.y,!0,this.calculateRelativeWidgetPosition)}),this.movement=null,Object.keys(this.widgetsRefs).forEach(n=>{var s;const r=(s=this.widgetsRefs[n])==null?void 0:s.onCommand;r&&r("stopMove")})},800))};resizeWidgets=(e,t)=>{this.moveTimer||(this.movement={x:0,y:0,isResize:!0},Object.keys(this.widgetsRefs).forEach(n=>{var s;const r=(s=this.widgetsRefs[n])==null?void 0:s.onCommand;r&&r("startResize")}),this.props.selectedWidgets.forEach(n=>{var s;const r=(s=this.widgetsRefs[n])==null?void 0:s.onMove;r&&r()})),this.movement&&(this.movement.x+=e,this.movement.y+=t,this.props.selectedWidgets.forEach(n=>{var o;const s=(o=this.widgetsRefs[n])==null?void 0:o.onMove;s&&this.movement&&s(this.movement.x,this.movement.y,!1,this.calculateRelativeWidgetPosition)}),this.showRulers(),this.moveTimer&&clearTimeout(this.moveTimer),this.moveTimer=setTimeout(()=>{this.moveTimer=null,this.showRulers(!0),this.props.selectedWidgets.forEach(n=>{var s;const r=(s=this.widgetsRefs[n])==null?void 0:s.onMove;r&&this.movement&&r(this.movement.x,this.movement.y,!0,this.calculateRelativeWidgetPosition)}),Object.keys(this.widgetsRefs).forEach(n=>{var s;const r=(s=this.widgetsRefs[n])==null?void 0:s.onCommand;r&&r("stopResize")}),this.movement=null},800))};onKeyDown=e=>{var t;this.props.editMode&&((t=document.activeElement)==null?void 0:t.tagName)==="BODY"&&this.props.selectedWidgets.length&&(e.key==="ArrowLeft"&&(e.preventDefault(),this[e.shiftKey?"resizeWidgets":"moveWidgets"](e.ctrlKey?-10:-1,0)),e.key==="ArrowRight"&&(e.preventDefault(),this[e.shiftKey?"resizeWidgets":"moveWidgets"](e.ctrlKey?10:1,0)),e.key==="ArrowUp"&&(e.preventDefault(),this[e.shiftKey?"resizeWidgets":"moveWidgets"](0,e.ctrlKey?-10:-1)),e.key==="ArrowDown"&&(e.preventDefault(),this[e.shiftKey?"resizeWidgets":"moveWidgets"](0,e.ctrlKey?10:1)))};renderScreenSize(){var n,r;const e=parseInt(((n=_e.getState().visProject[this.props.view].settings)==null?void 0:n.sizex)||0,10),t=parseInt(((r=_e.getState().visProject[this.props.view].settings)==null?void 0:r.sizey)||0,10);return!this.props.editMode||!this.props.view||!e||!t?null:[h.jsx("div",{style:{top:0,left:0,width:`${e}px`,height:`${t}px`,position:"absolute",borderTopWidth:0,borderLeftWidth:0,borderRightWidth:1,borderBottomWidth:1,boxSizing:"content-box",borderStyle:"dashed",borderColor:"black",zIndex:1e3,pointerEvents:"none",userSelect:"none",opacity:.7}},"black"),h.jsx("div",{style:{top:0,left:0,width:`${e+1}px`,height:`${t+1}px`,position:"absolute",borderTopWidth:0,borderLeftWidth:0,borderRightWidth:1,borderBottomWidth:1,boxSizing:"content-box",borderStyle:"dashed",borderColor:"white",zIndex:1e3,pointerEvents:"none",userSelect:"none",opacity:.7}},"white")]}getRelativeStyle(e,t,n){var s;const r={};if(t){const o=_e.getState().visProject[this.props.view].widgets[t].style;r.width=(o==null?void 0:o.width)||"100%",r.height=(o==null?void 0:o.height)||"100%"}else{if(e.sizex&&!n){let o=e.sizex,a=e.sizey||0;Ve(o)&&(o=parseFloat(o)),Ve(a)&&(a=parseFloat(a)),(typeof o=="number"||o.match(/\d$/))&&(o=`${o.toString()}px`),(typeof a=="number"||a.match(/\d$/))&&(a=`${a.toString()}px`),r.width=o,r.height=a}else r.width="100%",r.height="100%";r.display=((s=e.style)==null?void 0:s.display)||"flex",r.display==="flex"&&(r.flexWrap="wrap",r.columnGap=8,Ve(e.columnGap)&&(r.columnGap=parseInt(e.columnGap,10)))}return r.position="absolute",r.top=0,r.left=0,r}getCountOfRelativeColumns(e,t){const n=this.state.width;if(n){if(e.columnWidth&&Ve(e.columnWidth))return Math.floor(this.state.width/e.columnWidth)+1;let r;return n<600?r=1:n<900?r=2:n<1200?r=3:n<2064?r=4:r=Math.floor(n/500)+1,r>t&&(r=t),r>rr&&(r=rr),r}return 1}renderNavigation(e){return h.jsx(f0,{context:this.props.context,activeView:this.props.activeView,view:this.props.view,editMode:this.props.editMode,menuWidth:this.state.menuWidth,theme:this.props.context.theme,setMenuWidth:t=>(window.localStorage.setItem("vis.menuWidth",t),this.setState({menuWidth:t}),new Promise(n=>{setTimeout(()=>{this.updateViewWidth(),n(null)},400)})),children:e})}render(){var g,x,y,w,S,M,b,I,P,E,A,T,W,F,j,O,R,B,$,J,q;let e=[],t=[],n;const r=_e.getState().visProject[this.props.view];if(!this.props.view||!r)return null;const s=r.settings;if(this.props.view===this.props.activeView&&this.props.editMode&&!this.keysHandlerInstalled?this.installKeyHandlers():(this.props.view!==this.props.activeView||!this.props.editMode)&&this.keysHandlerInstalled&&this.uninstallKeyHandlers(),this.state.mounted&&this.state.themeCode&&this.refView.current){(g=this.props.viewsActiveFilter)!=null&&g[this.props.view]||(this.props.viewsActiveFilter[this.props.view]=(((x=r.settings)==null?void 0:x.filterkey)||"").split(",").map(G=>G.trim()).filter(G=>G));const L=r.widgets;let Q=!0;if(L){let G=[];this.props.selectedGroup?G=[...((w=(y=L[this.props.selectedGroup])==null?void 0:y.data)==null?void 0:w.members)??[]]:(S=r.settings)!=null&&S.order&&(G=[...r.settings.order]),this.props.selectedGroup&&G.sort((z,Z)=>{const X=L[z],H=L[Z],ee=X.style&&(X.style.position==="relative"||X.style.position==="static"||X.style.position==="sticky"),te=H.style&&(H.style.position==="relative"||H.style.position==="static"||H.style.position==="sticky");return ee&&te?0:ee?-1:1});const ne=[],U=[],re=[];this.props.editMode&&((M=this.props.selectedWidgets)!=null&&M.length)&&(this.props.selectedWidgets.forEach(z=>{const Z=r.widgets[z];!Z||Z.groupid&&!this.props.selectedGroup||(Z.style?Z.style.position==="relative"?ne.push(z):!Z.style.position||Z.style.position==="absolute"?U.push(z):re.push(z):U.push(z))}),(re.length||ne.length&&U.length)&&(Q=!1));const ie=[],Y=[],K=r.filterWidgets,se=r.filterInvert;if(Object.keys(L).forEach(z=>{var H;if(z===this.props.selectedGroup)return;const Z=r.widgets[z];if(!Z||Z.grouped&&!this.props.selectedGroup||!this.props.selectedGroup&&Z.usedInWidget||!Nv({view:this.props.view,editMode:this.props.editMode,project:_e.getState().visProject,user:_e.getState().activeUser,wid:z})||this.props.selectedGroup&&z!==this.props.selectedGroup&&Z.groupid!==this.props.selectedGroup)return;if(this.props.editMode&&(K!=null&&K.length)){if((H=Z.data)!=null&&H.filterkey){let ee=Z.data.filterkey;if(ee&&typeof ee=="string"&&(ee=ee.split(",").map(te=>te.trim()).filter(te=>te)),se){if(!K.find(te=>ee.includes(te)))return}else if(K.find(te=>ee.includes(te)))return}else if(se)return}if(Z.style&&(Z.style.position==="relative"||Z.style.position==="static"||Z.style.position==="sticky")&&z!==this.props.selectedGroup)ie.includes(z)||ie.push(z);else{const ee=ie.indexOf(z);ee!==-1&&ie.splice(ee,1),Y.includes(z)||Y.push(z)}}),!this.props.selectedGroup)for(let z=G.length-1;z>=0;z--)r.widgets[G[z]]||G.splice(z,1);ie.sort((z,Z)=>{const X=G.indexOf(z),H=G.indexOf(Z);return X===-1&&H===-1?0:X===-1?1:H===-1?-1:X-H});const ae=this.props.selectedGroup||!s?1:this.getCountOfRelativeColumns(s,ie.length),oe=new Array(ae);for(let z=0;z<oe.length;z++)oe[z]=[];const V=this.props.view;if(e=Y.map((z,Z)=>{var X;return St.getOneWidget(Z,r.widgets[z],{context:this.props.context,editMode:this.props.editMode,id:z,isRelative:!1,mouseDownOnView:this.mouseDownOnView,moveAllowed:Q,ignoreMouseEvents:this.ignoreMouseEvents,onIgnoreMouseEvents:this.onIgnoreMouseEvents,refParent:this.props.selectedGroup?this.refRelativeView:this.refView,askView:this.askView,relativeWidgetOrder:G,selectedGroup:this.props.selectedGroup,selectedWidgets:((X=this.movement)==null?void 0:X.selectedWidgetsWithRectangle)||this.props.selectedWidgets,view:V,viewsActiveFilter:this.props.viewsActiveFilter,customSettings:this.props.customSettings})}),ie.length){let z=0;if(ie.forEach((Z,X)=>{var te;const H=_e.getState().visProject[V].widgets[Z];H.style.newLine&&(z=0);const ee=St.getOneWidget(X,H,{context:this.props.context,editMode:this.props.editMode,id:Z,isRelative:!0,mouseDownOnView:this.mouseDownOnView,moveAllowed:Q,ignoreMouseEvents:this.ignoreMouseEvents,onIgnoreMouseEvents:this.onIgnoreMouseEvents,refParent:this.props.selectedGroup?this.refRelativeView:this.refRelativeColumnsView[z],askView:this.askView,relativeWidgetOrder:this.props.selectedGroup?G:ie,selectedWidgets:((te=this.movement)==null?void 0:te.selectedWidgetsWithRectangle)||this.props.selectedWidgets,selectedGroup:this.props.selectedGroup,view:V,customSettings:this.props.customSettings,viewsActiveFilter:this.props.viewsActiveFilter});oe[z].push(ee),z++,z>=ae&&(z=0)}),this.props.selectedGroup)t=oe[0];else{const Z={};s!=null&&s.columnWidth&&Ve(s.columnWidth)&&(Z.maxWidth=parseFloat(s.columnWidth)),t=oe.map((X,H)=>h.jsx("div",{ref:this.refRelativeColumnsView[H],style:Z,className:N.Utils.clsx("vis-view-column",this.props.editMode&&"vis-view-column-edit"),children:X},H))}}else t=null;this.props.selectedGroup&&(n=St.getOneWidget(0,r.widgets[this.props.selectedGroup],{context:this.props.context,editMode:this.props.editMode,id:this.props.selectedGroup,isRelative:!1,mouseDownOnView:this.mouseDownOnView,moveAllowed:Q,ignoreMouseEvents:this.ignoreMouseEvents,onIgnoreMouseEvents:this.onIgnoreMouseEvents,refParent:this.refView,askView:this.askView,relativeWidgetOrder:G,selectedGroup:this.props.selectedGroup,selectedWidgets:((b=this.movement)==null?void 0:b.selectedWidgetsWithRectangle)||this.props.selectedWidgets,view:V,viewsActiveFilter:this.props.viewsActiveFilter,customSettings:this.props.customSettings}))}}let o="vis-view";const a={width:"100%",height:"100%"};this.state.loadedjQueryTheme!==this.getJQueryThemeName()&&this.props.view&&(this.loadingTheme||(this.loadingTheme=!0,setTimeout(()=>this.loadJqueryTheme(this.getJQueryThemeName()),this.state.loadedjQueryTheme?50:0)));const l={},c=((I=s==null?void 0:s.style)==null?void 0:I.background_class)||"";s!=null&&s.style&&Object.keys(s.style).forEach(L=>{var Q;if(L==="background_class")o=_t(o,(Q=s.style)==null?void 0:Q.background_class);else{const G=L.startsWith("background");if(!s["bg-image"]||!G){const ne=s.style[L];L=L.replace(/(-\w)/g,U=>U[1].toUpperCase()),a[L]=ne,G&&(l[L]=ne)}}});let u=this.props.context.theme;const p=(P=this.props.customSettings)==null?void 0:P.themeType;(A=(E=this.props.customSettings)==null?void 0:E.viewStyle)!=null&&A.overrides?u=nd(p||this.props.context.theme.palette.mode,this.props.customSettings.viewStyle.overrides):p&&p!==u.palette.mode&&(this.theme[p]||(this.theme[p]=nd(p)),u=this.theme[p]),!a.backgroundColor&&!a.background&&((W=(T=this.props.customSettings)==null?void 0:T.viewStyle)!=null&&W.backgroundColor?l.backgroundColor=this.props.customSettings.viewStyle.backgroundColor:((F=this.props.customSettings)==null?void 0:F.themeType)==="dark"?l.backgroundColor="#000":l.backgroundColor=u.palette.mode==="dark"?"#000":"#fff"),a.color||((O=(j=this.props.customSettings)==null?void 0:j.viewStyle)!=null&&O.color?a.color=this.props.customSettings.viewStyle.color:a.color=u.palette.mode==="dark"?"#fff":"#000"),!a.fontFamily&&((B=(R=this.props.customSettings)==null?void 0:R.viewStyle)!=null&&B.fontFamily)&&(a.fontFamily=this.props.customSettings.viewStyle.fontFamily),this.props.view!==this.props.activeView&&(a.display="none"),this.props.context.container&&(a.overflow="hidden");let d=null;if((($=_e.getState().visProject[this.props.view].settings)==null?void 0:$.snapType)===2&&this.props.editMode&&(d=St.renderGitter((J=r.settings)==null?void 0:J.gridSize,(q=r.settings)==null?void 0:q.snapColor)),this.props.style&&Object.assign(a,this.props.style),s&&s["bg-image"]){if(l.backgroundImage=`url("../${this.props.context.adapterName}.${this.props.context.instance}/${this.props.context.projectName}${s["bg-image"].substring(9)}")`,l.backgroundRepeat="no-repeat",l.backgroundPosition="top left",s["bg-color"]&&(l.backgroundColor=s["bg-color"]),s["bg-position-x"]&&(l.backgroundPositionX=Ve(s["bg-position-x"])?`${s["bg-position-x"]}px`:s["bg-position-x"]),s["bg-position-y"]&&(l.backgroundPositionY=Ve(s["bg-position-y"])?`${s["bg-position-y"]}px`:s["bg-position-y"]),s["bg-width"]&&s["bg-height"]){const L=Ve(s["bg-width"])?`${s["bg-width"]}px`:s["bg-width"],Q=Ve(s["bg-height"])?`${s["bg-height"]}px`:s["bg-height"];l.backgroundSize=`${L} ${Q}`}else if(s["bg-width"])l.backgroundSize=`${Ve(s["bg-width"])?`${s["bg-width"]}px`:s["bg-width"]} auto`;else if(s["bg-height"]){const L=Ve(s["bg-height"])?`${s["bg-height"]}px`:s["bg-height"];l.backgroundSize=`auto ${L}`}}Object.assign(a,l);let f,m=null;if(s!=null&&s.limitScreen&&(window.screen.width>=800&&window.screen.height>=800||!s.limitScreenDesktop)){let L=!1;if(s.limitForInstances){const Q=window.localStorage.getItem("visInstance");if(Q){const G=s.limitForInstances.split(",").map(ne=>ne.trim()).filter(ne=>ne);G.length&&!G.includes(Q)&&(L=!0)}else L=!0}if(!L){const Q=Ve(s.sizex)?parseFloat(s.sizex):0,G=Ve(s.sizey)?parseFloat(s.sizey):0;if(Q&&G){const ne=parseFloat(s.limitScreenBorderWidth)||0,U=s.limitScreenBorderColor||"#333",re=s.limitScreenBorderStyle||"dotted",ie=s.limitScreenBackgroundColor||null;m={...l,width:Q+ne*2,height:G+ne*2,minWidth:Q+ne*2,minHeight:G+ne*2,overflow:"auto",position:"relative",boxSizing:"border-box",borderWidth:ne,borderColor:U,borderStyle:re},a.display="flex",a.justifyContent="center",a.alignItems="center",a.backgroundColor=ie}}}this.props.selectedGroup?f=n:s&&(f=h.jsxs(h.Fragment,{children:[t?h.jsx("div",{ref:this.refRelativeView,style:this.getRelativeStyle(s,this.props.selectedGroup,!!m),className:"vis-relative-view",children:t}):null,e]})),m&&(f=h.jsx("div",{style:m,className:"vis-limit-screen",children:f}));let v=h.jsxs("div",{className:`${o} visview_${this.props.view.replace(/\s/g,"_")}`,ref:this.refView,id:`visview_${this.props.view.replace(/\s/g,"_")}`,onMouseDown:this.props.context.runtime?void 0:L=>this.props.editMode&&this.mouseDownLocal&&this.mouseDownLocal(L),onDoubleClick:this.props.context.runtime?()=>this.props.editMode&&this.doubleClickOnView&&this.doubleClickOnView():void 0,style:a,children:[h.jsx("style",{children:this.state.themeCode}),d,m?null:this.renderScreenSize(),this.state.rulers.map((L,Q)=>h.jsx("div",{style:{pointerEvents:"none",userSelect:"none",position:"absolute",width:L.type==="horizontal"?"100%":10,height:L.type==="horizontal"?10:"100%",borderStyle:"solid",borderColor:"red",borderWidth:0,borderLeftWidth:L.type==="horizontal"?0:1,borderTopWidth:L.type==="horizontal"?1:0,left:L.type==="horizontal"?0:L.value,top:L.type==="horizontal"?L.value:0,zIndex:1e3}},Q)),f]});if(s&&(s.navigation||s.navigationBar)&&this.props.view===this.props.activeView&&(v=this.renderNavigation(v)),!this.props.visInWidget&&this.props.activeView===this.props.view){const L=JSON.stringify(l);(!window._lastAppliedStyle||window._lastAppliedStyle!==L)&&(window._lastAppliedStyle=L,window.document.documentElement.removeAttribute("style"),Object.keys(l).forEach(Q=>window.document.documentElement.style[Q]=l[Q])),window.document.documentElement.className=c}return h.jsx(bt.StyledEngineProvider,{injectFirst:!0,children:h.jsx(rf,{theme:u,children:v})})}}const fr=["background","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","border","border-color","border-radius","border-style","border-width","box-shadow","box-sizing","color","font-family","font-size","font-style","font-variant","font-weight","letter-spacing","line-height","text-align","text-shadow","word-spacing"];class xe extends Se{static POSSIBLE_MUI_STYLES=fr;linkContext;onStateChangedBind;newState;wrappedContent;updateTimer;ignoreMouseEvents;mouseDownOnView;bindingsTimer;informIncludedWidgets;filterDisplay;constructor(e){var o;super(e);const t=this.getWidgetInfo(),n={};Array.isArray(t.visAttrs)&&t.visAttrs.forEach(a=>{var l;return(l=a.fields)==null?void 0:l.forEach(c=>{n[c.name]={name:c.name,type:c.type},n[c.name].type||(n[c.name].type="")})}),this.linkContext={IDs:[],bindings:{},visibility:{},lastChanges:{},signals:{},widgetAttrInfo:n},uo(e.context.views,e.view,e.id,this.linkContext),this.onStateChangedBind=this.onStateChanged.bind(this);const r=this.onStateChanged(null,null,!0);r&&(r.visible=this.checkVisibility((o=r.rxData)==null?void 0:o["visibility-oid"],r)),this.resizeLocked=!!t.visResizeLocked;const s=xe.findField(t,"visResizable");s?this.visDynamicResizable={default:s.default!==void 0?s.default:!0,desiredSize:s.desiredSize}:this.visDynamicResizable=null,this.state={...this.state,resizable:t.resizable===void 0?t.visResizable===void 0?!0:t.visResizable:t.resizable,draggable:t.visDraggable===void 0?!0:t.visDraggable,resizeHandles:t.resizeHandles===void 0?t.visResizeHandles===void 0?["n","e","s","w","nw","ne","sw","se"]:t.visResizeHandles:t.resizeHandles,rxData:r.rxData,rxStyle:r.rxStyle,values:{},visible:r.visible,disabled:!1}}static findField(e,t){if(!e.visAttrs)return null;for(let n=0;n<e.visAttrs.length;n++){const r=e.visAttrs[n];if(r.fields){for(let s=0;s<r.fields.length;s++)if(r.fields[s].name===t)return r.fields[s]}}return null}static getI18nPrefix(){return""}static getText(e){return typeof e=="object"?e[N.I18n.getLanguage()]||e.en:e}static t(e,...t){return this.getI18nPrefix?N.I18n.t(`${this.getI18nPrefix()}${e}`,...t):N.I18n.t(e)}static getLanguage(){return N.I18n.getLanguage()}onCommand(e,t){var r;const n=super.onCommand(e);if(n===!1){if(e==="collectFilters")return(r=this.state.rxData)==null?void 0:r.filterkey;if(e==="changeFilter"){const s=this.checkVisibility();s!==this.state.visible&&this.setState({visible:s})}}return n}onStateUpdated(e,t){}onIoBrokerStateChanged=(e,t)=>{this.onStateChanged(e,t)};onStateChanged(e,t,n){var r;if(this.newState||(this.newState={values:it(this.state.values||{}),rxData:{...this.state.data},rxStyle:{...this.state.style},editMode:this.props.editMode,applyBindings:!1}),!this.newState)return null;if(this.newState.rxData&&delete this.newState.rxData._originalData,this.newState.rxStyle&&delete this.newState.rxStyle._originalData,e&&t&&(Object.keys(t).forEach(s=>this.newState.values[`${e}.${s}`]=t[s]),setTimeout(()=>this.onStateUpdated(e,t),60)),Object.keys(this.linkContext.bindings).forEach(s=>this.applyBinding(s,this.newState)),e===((r=this.newState.rxData)==null?void 0:r["visibility-oid"])&&(this.newState.visible=this.checkVisibility(e,this.newState)),this.newState.rxData){const s=this.newState.rxData["visibility-groups"];this.newState.disabled=!1,this.newState.rxData.filterkey&&typeof this.newState.rxData.filterkey=="string"&&(this.newState.rxData.filterkey=this.newState.rxData.filterkey.split(/[;,]+/).map(o=>o.trim()).filter(o=>o)),s!=null&&s.length&&!this.isUserMemberOfGroup(this.props.context.user,s)&&(this.newState.rxData["visibility-groups-action"]==="disabled"?this.newState.disabled=!0:this.newState.visible=!1)}if(n){const s=this.newState;return this.newState=null,s}return this.updateTimer&&(clearTimeout(this.updateTimer),this.updateTimer=null),JSON.stringify(this.state.values)!==JSON.stringify(this.newState.values)||JSON.stringify(this.state.rxData)!==JSON.stringify(this.newState.rxData)||JSON.stringify(this.state.rxStyle)!==JSON.stringify(this.newState.rxStyle)||JSON.stringify(this.state.applyBindings)!==JSON.stringify(this.newState.applyBindings)?this.updateTimer=setTimeout(()=>{this.updateTimer=void 0;const s=this.newState??null;this.newState=null,s&&this.setState(s)},50):this.newState=null,null}applyBinding(e,t){var n;(n=this.linkContext.bindings[e])==null||n.forEach(r=>{const s=this.props.context.formatUtils.formatBinding({format:r.format,view:r.view,wid:this.props.id,widget:this.props.context.views[r.view].widgets[this.props.id],widgetData:t.rxData,values:t.values,moment:this.props.context.moment});r.type==="data"?t.rxData[r.attr]=s:t.rxStyle&&(t.rxStyle[r.attr]=s)})}componentDidMount(){super.componentDidMount(),this.linkContext.IDs.length&&this.props.context.socket.subscribeStateAsync(this.linkContext.IDs,this.onStateChangedBind).catch(e=>console.error(`Cannot subscribe on ${this.linkContext.IDs}: ${e}`))}onRxDataChanged(e){}onRxStyleChanged(e){}componentDidUpdate(e,t){t&&(JSON.stringify(this.state.rxData)!==JSON.stringify(t.rxData)&&this.onRxDataChanged(t.rxData),JSON.stringify(this.state.rxStyle)!==JSON.stringify(t.rxStyle)&&this.onRxStyleChanged(t.rxStyle))}componentWillUnmount(){this.linkContext.IDs.length&&this.props.context.socket.unsubscribeState(this.linkContext.IDs,this.onIoBrokerStateChanged),super.componentWillUnmount()}isWidgetVisibleForGroup(e){const t=e.rxData["visibility-groups"];return!(e.rxData["visibility-groups-action"]==="hide"&&t!=null&&t.length&&!this.isUserMemberOfGroup(this.props.context.user,t))}checkVisibility(e,t){if(t=t||this.state,!this.isWidgetVisibleForGroup(t))return!1;if(!this.state.editMode){if(this.isWidgetFilteredOut(t.rxData))return!1;if(e){if(this.linkContext.visibility[e])return!Se.isWidgetHidden(t.rxData,t.values,this.props.id)}else return!Se.isWidgetHidden(t.rxData,t.values,this.props.id)}return!0}onPropertiesUpdated(){const e=this.linkContext.IDs;this.linkContext={IDs:[],bindings:{},visibility:{},lastChanges:{},signals:{},widgetAttrInfo:this.linkContext.widgetAttrInfo};const t=this.props.context;uo(t.views,this.props.view,this.props.id,this.linkContext);const n=e.filter(s=>!this.linkContext.IDs.includes(s));n.length&&t.socket.unsubscribeState(n,this.onIoBrokerStateChanged);const r=this.linkContext.IDs.filter(s=>!e.includes(s));r.length&&t.socket.subscribeState(r,this.onIoBrokerStateChanged),this.onStateChanged()}formatValue(e,t){var n,r;return typeof e=="number"&&(t===1?e=Math.round(e*10)/10:t===0?e=Math.round(e):e=Math.round(e*100)/100,(r=(n=this.props.context.systemConfig)==null?void 0:n.common)!=null&&r.isFloatComma&&(e=e.toString().replace(".",","))),e==null?"":e.toString()}wrapContent(e,t,n,r,s,o){var u,p;if(this.props.context.views[this.props.view].widgets[this.props.id].usedInWidget)return e;const a=(o==null?void 0:o.Card)||k.Card,l=(o==null?void 0:o.CardContent)||k.CardContent,c={width:"calc(100% - 8px)",height:"calc(100% - 8px)",margin:4,boxSizing:"border-box",...(p=(u=this.props.customSettings)==null?void 0:u.viewStyle)==null?void 0:p.visCard};return Object.keys(this.state.rxStyle).forEach(d=>{const f=this.state.rxStyle[d];f!=null&&fr.includes(d)&&(d=d.replace(/(-\w)/g,m=>m[1].toUpperCase()),c[d]=f)}),this.wrappedContent=!0,h.jsx(a,{className:"vis_rx_widget_card",style:c,onClick:s,children:h.jsxs(l,{className:"vis_rx_widget_card_content",style:{display:"flex",flexDirection:"column",alignItems:"center",height:"calc(100% - 32px)",paddingBottom:16,position:"relative",...n},children:[this.state.rxData.widgetTitle?h.jsxs("div",{className:"vis_rx_widget_card_name",style:{display:"flex",justifyContent:"space-between",width:"100%",alignItems:"center"},children:[h.jsx("div",{className:"vis_rx_widget_card_name_div",style:{fontSize:24,paddingTop:0,paddingBottom:4,...r},children:this.state.rxData.widgetTitle}),t||null]}):t||null,e]})})}renderWidgetBody(e){var t;if(e.id=this.props.id,e.className=`vis-widget${this.state.rxData.class?` ${this.state.rxData.class}`:""}`,!this.state.editMode&&this.state.disabled&&(e.className=_t(e.className,"vis-user-disabled")),Object.keys(this.state.rxStyle).forEach(n=>{const r=this.state.rxStyle[n];r!=null&&(!this.wrappedContent||!fr.includes(n))&&(n=n.replace(/(-\w)/g,s=>s[1].toUpperCase()),e.style[n]=r)}),this.props.isRelative?(e.style.position=((t=this.state.rxStyle)==null?void 0:t.position)||"relative",delete e.style.top,delete e.style.left):e.style.position="absolute",this.state.editMode){const n=this.state.rxStyle?parseInt(this.state.rxStyle["z-index"]||"0",10):0;this.state.selected?e.style.zIndex=800+n:e.style.zIndex=n}return null}getWidgetView(e,t){const r=this.props.context.VisView;return t=t||{},h.jsx(r,{context:this.props.context,viewsActiveFilter:this.props.viewsActiveFilter,activeView:e,editMode:!1,view:e,visInWidget:!0,theme:this.props.context.theme,...t},`${this.props.id}_${e}`)}getWidgetInWidget(e,t,n){var r;return n=n||{},St.getOneWidget(n.index||0,this.props.context.views[e].widgets[t],{context:this.props.context,editMode:this.state.editMode,id:t,isRelative:n.isRelative!==void 0?n.isRelative:!0,mouseDownOnView:this.mouseDownOnView,moveAllowed:!1,ignoreMouseEvents:this.state.editMode?!0:this.ignoreMouseEvents,onIgnoreMouseEvents:this.props.onIgnoreMouseEvents,refParent:n.refParent,askView:this.props.askView,relativeWidgetOrder:[t],selectedGroup:this.props.selectedGroup,selectedWidgets:((r=this.movement)==null?void 0:r.selectedWidgetsWithRectangle)||this.props.selectedWidgets,view:e,viewsActiveFilter:this.props.viewsActiveFilter,customSettings:this.props.customSettings})}isSignalVisible(e){const t=this.state.rxData[`signals-oid-${e}`];if(t){let n=this.state.values[`${t}.val`];const r=this.state.rxData[`signals-cond-${e}`]??"==";let s=this.state.rxData[`signals-val-${e}`]??"true";if(n==null||!r||s===void 0||s===null)return r==="not exist";if(n==="null"&&r!=="exist"&&r!=="not exist")return!1;const o=typeof n;switch(o==="boolean"||n==="false"||n==="true"?s=s==="true"||s===!0||s===1||s==="1":o==="number"?s=parseFloat(s):o==="object"&&(n=JSON.stringify(n)),r){case"==":return s=s.toString(),n=n.toString(),n==="1"&&(n="true"),s==="1"&&(s="true"),n==="0"&&(n="false"),s==="0"&&(s="false"),s===n;case"!=":return s=s.toString(),n=n.toString(),n==="1"&&(n="true"),s==="1"&&(s="true"),n==="0"&&(n="false"),s==="0"&&(s="false"),s!==n;case">=":return n>=s;case"<=":return n<=s;case">":return n>s;case"<":return n<s;case"consist":return s=s.toString(),n=n.toString(),n.toString().includes(s);case"not consist":return s=s.toString(),n=n.toString(),!n.toString().includes(s);case"exist":return s!=="null";case"not exist":return s==="null";default:return console.log(`Unknown signals condition for ${this.props.id}: ${r}`),!1}}else return!1}static text2style(e,t){return e&&(t=t||{},e.split(";").forEach(r=>{const[s,o]=r.split(":");if(s&&o){const a=s.trim().split("-");for(let l=1;l<a.length;l++)a[l]=a[l][0].toUpperCase()+a[l].substring(1);t[a.join("")]=o.trim()}})),t}renderSignal(e){const t=this.state.rxData[`signals-oid-${e}`];if(!t||t==="nothing_selected"||this.props.editMode&&this.state.rxData[`signals-hide-edit-${e}`])return null;if(this.props.editMode||this.isSignalVisible(e)){let n=this.state.rxData[`signals-smallIcon-${e}`],r;n?r=this.state.rxData[`signals-color-${e}`]:n=this.state.rxData[`signals-icon-${e}`];const s={color:r,position:"absolute",top:`${parseInt(this.state.rxData[`signals-vert-${e}`],10)||0}%`,left:`${parseInt(this.state.rxData[`signals-horz-${e}`],10)||0}%`,zIndex:10,textAlign:"center",pointerEvents:"none"};if(n){const a={width:parseFloat(this.state.rxData[`signals-icon-size-${e}`])||32,height:"auto"};n=h.jsx(N.Icon,{src:n,style:a,className:"vis-signal-icon"})}xe.text2style(this.state.rxData[`signals-icon-style-${e}`],s);let o=this.state.rxData[`signals-text-${e}`];if(o){const a={color:this.state.rxData[`signals-color-${e}`]};xe.text2style(this.state.rxData[`signals-text-style-${e}`],a),o=h.jsx("div",{className:"vis-signal-text",style:a,children:this.state.rxData[`signals-text-${e}`].replace("%s",(this.state.values[`${t}.val`]??"").toString())})}else o=null;return h.jsxs("div",{style:s,className:this.state.rxData[`signals-blink-${e}`]?"vis-signals-blink":null,children:[n,o]})}return null}renderLastChange(e){const t=this.state.rxData["lc-oid"];if(!t||t==="nothing_selected")return null;const n=parseInt(this.state.rxData["lc-border-radius"],10)||0,r={backgroundColor:"rgba(182, 182, 182, 0.6)",fontFamily:"Tahoma",position:"absolute",zIndex:0,borderRadius:this.state.rxData["lc-position-horz"]==="left"?`${n}px 0 0 ${n}px`:this.state.rxData["lc-position-horz"]==="right"?`0 ${n}px ${n}px 0`:n,whiteSpace:"nowrap"},s=this.state.rxData["lc-font-size"];s&&(s.match(/\D/)?r.fontSize=this.state.rxData["lc-font-size"]:r.fontSize=parseFloat(this.state.rxData["lc-font-size"])),this.state.rxData["lc-font-style"]&&(r.fontStyle=this.state.rxData["lc-font-style"]),this.state.rxData["lc-font-family"]&&(r.fontFamily=this.state.rxData["lc-font-family"]),this.state.rxData["lc-bkg-color"]&&(r.backgroundColor=this.state.rxData["lc-bkg-color"]),this.state.rxData["lc-color"]&&(r.color=this.state.rxData["lc-color"]),this.state.rxData["lc-border-width"]&&(r.borderWidth=parseInt(this.state.rxData["lc-border-width"],10)||0),this.state.rxData["lc-border-style"]&&(r.borderStyle=this.state.rxData["lc-border-style"]),this.state.rxData["lc-border-color"]&&(r.borderColor=this.state.rxData["lc-border-color"]);const o=parseInt(this.state.rxData["lc-padding"],10);o?r.padding=o:(r.paddingTop=3,r.paddingBottom=3),this.state.rxData["lc-zindex"]&&(r.zIndex=this.state.rxData["lc-zindex"]),this.state.rxData["lc-position-vert"]==="top"?r.top=parseInt(this.state.rxData["lc-offset-vert"],10):this.state.rxData["lc-position-vert"]==="bottom"?r.bottom=parseInt(this.state.rxData["lc-offset-vert"],10):this.state.rxData["lc-position-vert"]==="middle"&&(r.top=`calc(50% + ${parseInt(this.state.rxData["lc-offset-vert"],10)-10}px)`);const a=parseFloat(this.state.rxData["lc-offset-horz"])||0;this.state.rxData["lc-position-horz"]==="left"?(r.right=`calc(100% - ${a}px)`,o||(r.paddingRight=10,r.paddingLeft=10)):this.state.rxData["lc-position-horz"]==="right"?(r.left=`calc(100% + ${a}px)`,o||(r.paddingRight=10,r.paddingLeft=10)):this.state.rxData["lc-position-horz"]==="middle"&&(r.left=`calc(50% + ${a}px)`);const l=window.document.createElement("div");return l.className="",Lo(e),h.jsx("div",{className:"vis-last-change",style:r,children:this.formatDate(this.state.values[`${this.state.rxData["lc-oid"]}.${this.state.rxData["lc-type"]==="last-change"?"lc":"ts"}`],this.state.rxData["lc-format"],this.state.rxData["lc-is-interval"],this.state.rxData["lc-is-moment"],!0)})}renderSignals(){var n;const e=parseInt((n=this.state.rxData)==null?void 0:n["signals-count"],10)||0;if(!e)return null;const t=[];for(let r=0;r<e;r++)t.push(this.renderSignal(r));return t}render(){return!this.state.visible&&!this.state.editMode?null:(this.state.applyBindings&&!this.bindingsTimer&&(this.bindingsTimer=setTimeout(()=>{this.bindingsTimer=void 0,this.onPropertiesUpdated();const e=[],t=this.props.context.views[this.props.view].widgets[this.props.id];Object.keys(t.data).forEach(r=>{if(r.startsWith("widget")&&t.data[r]){const s=this.props.askView&&this.props.askView("getRef",{id:t.data[r]});s&&e.push(s)}}),this.informIncludedWidgets&&clearTimeout(this.informIncludedWidgets),e&&(this.informIncludedWidgets=setTimeout(()=>{this.informIncludedWidgets=void 0,e.forEach(r=>r.onCommand("updatePosition"))},200))},10)),this.state.editMode&&this.filterDisplay!==void 0&&this.refService.current&&(this.refService.current.style.display=this.filterDisplay,delete this.filterDisplay),super.render())}getWidgetInfo(){throw new Error("not implemented")}}const g1=Object.freeze(Object.defineProperty({__proto__:null,POSSIBLE_MUI_STYLES:fr,VisRxWidget:xe,default:xe},Symbol.toStringTag,{value:"Module"}));class ya extends xe{static getWidgetInfo(){return{id:"tplValueFloatBar",visSet:"basic",visName:"Bar",visPrev:"widgets/basic/img/Prev_ValueFloatBar.png",visAttrs:[{name:"common",fields:[{name:"oid",type:"id"},{name:"min",type:"number",default:0},{name:"max",type:"number",default:100},{name:"orientation",type:"select",default:"horizontal",options:[{value:"horizontal",label:"horizontal"},{value:"vertical",label:"vertical"}]},{name:"color",type:"color",default:"blue"},{name:"border",type:"text"},{name:"shadow",type:"text"},{name:"reverse",type:"checkbox"}]}],visDefaultStyle:{width:200,height:130}}}getWidgetInfo(){return ya.getWidgetInfo()}extractWidth(e,t){const n=e.match(/([0-9]+)(px|em)?/);if(n)return n[1]&&n[2]?parseInt(n[1],10)*(t||1)+n[2]:parseInt(n[1],10)*(t||1)}getCalc(){const e=this.state.rxData.min||this.state.rxData.min===0?Number(this.state.rxData.min):0,t=this.state.rxData.max||this.state.rxData.max===0?Number(this.state.rxData.max):100;let n=parseFloat(this.state.values[`${this.state.rxData.oid}.val`])||0;return n=(n-e)/(t-e),this.state.rxData.border?`calc(${Math.round(n*100)}% - ${this.extractWidth(this.state.rxData.border,2)})`:`${Math.round(n*100)}%`}renderWidgetBody(e){super.renderWidgetBody(e);let t;return this.state.rxData.orientation==="vertical"?(t={height:this.getCalc()},this.state.rxData.reverse&&(t={...t,left:0,position:"absolute",bottom:"0"}),this.state.rxData.border&&(t={...t,border:this.state.rxData.border,width:`calc(100% - ${this.extractWidth(this.state.rxData.border,2)}`})):(t={width:this.getCalc()},this.state.rxData.reverse&&(t={...t,float:"right"}),this.state.rxData.border&&(t={...t,border:this.state.rxData.border,height:`calc(100% - ${this.extractWidth(this.state.rxData.border,2)}`})),this.state.rxData.shadow&&(t={...t,boxShadow:this.state.rxData.shadow}),this.state.rxData.color&&(t={...t,backgroundColor:this.state.rxData.color}),h.jsx("div",{className:"vis-widget-body",children:h.jsx("div",{"data-oid":this.state.rxData.oid,className:"vis-widget-body",style:t})})}}class ba extends xe{getWidgetInfo(){return ba.getWidgetInfo()}static getWidgetInfo(){return{id:"tplBulbOnOffCtrl",visSet:"basic",visName:"Bulb on/off",visPrev:"widgets/basic/img/Prev_BulbOnOffCtrl.png",visAttrs:[{name:"common",fields:[{name:"oid",type:"id"},{name:"min"},{name:"max"},{name:"icon_off",type:"image",default:"img/bulb_off.png"},{name:"icon_on",type:"image",default:"img/bulb_on.png"},{name:"readOnly",type:"checkbox"}]},{name:"ccontrol",fields:[{name:"urlTrue"},{name:"urlFalse"},{name:"oidTrue",type:"id"},{name:"oidFalse",type:"id"},{name:"oidTrueValue"},{name:"oidFalseValue"}]}]}}toggle(){if(this.state.rxData.oid===Ev||this.state.rxData.readOnly)return;let e=this.state.values[`${this.state.rxData.oid}.val`];const{oidTrue:t,urlTrue:n,oid:r,min:s,max:o,oidTrueValue:a,oidFalseValue:l}=this.state.rxData;let{urlFalse:c,oidFalse:u}=this.state.rxData,p=s??"",d=o??"",f=a??"",m=l??"";if(t||n){if(!u&&t&&(u=t),!c&&n&&(c=n),d!==""?(d==="true"?d=!0:d==="false"&&(d=!1),e==="true"?e=!0:e==="false"&&(e=!1),e=e===d):e=e===1||e==="1"||e===!0||e==="true",e=!e,p===""||p==="false"||p===null?p=!1:(d===""||d==="true"||d===null)&&(d=!0),t&&typeof t=="string"){if(e){if(f===""&&(f=d),f==="false"?f=!1:f==="true"&&(f=!0),typeof f=="string"){const v=parseFloat(f);v.toString()===f&&(f=v)}this.props.context.setValue(t,f)}else if(typeof u=="string"){if(m===""?m=p:m==="false"?m=!1:m==="true"&&(m=!0),typeof m=="string"){const v=parseFloat(m);v.toString()===m&&(m=v)}this.props.context.setValue(u,m)}}n&&(e?this.props.context.socket.getRawSocket().emit("httpGet",n):this.props.context.socket.getRawSocket().emit("httpGet",c))}else p===""&&(e===null||e===""||e===void 0||e===!1||e==="false")||p!==""&&p===e?typeof r=="string"&&this.props.context.setValue(r,d!==""?d:!0):d===""&&(e===!0||e==="true")||d!==""&&e===d?typeof r=="string"&&this.props.context.setValue(r,p!==""?p:!1):typeof r=="string"&&(e=parseFloat(e),p!==""&&d!==""&&(typeof d=="number"||typeof d=="string")&&(typeof p=="number"||typeof p=="string")?e>=(parseFloat(d)-parseFloat(p))/2?e=p:e=d:e>=.5?e=0:e=1,this.props.context.setValue(r,e))}isFalse(e,t,n){if(t!=null&&t!=="")return e!==void 0&&typeof e!="string"&&(e=e.toString()),n!=null&&n!==""?e!==n:e===t;if(e==null||e===!1||e==="false"||e==="FALSE"||e==="False"||e==="OFF"||e==="Off"||e==="off"||e===""||e==="0"||e===0)return!0;const r=parseFloat(e);return r.toString()!=="NaN"?!r:!1}renderWidgetBody(e){super.renderWidgetBody(e);const t=this.state.values[`${this.state.rxData.oid}.val`],n=this.isFalse(t,this.state.rxData.min,this.state.rxData.max);let r;return n?r=this.state.rxData.icon_off||"img/bulb_off.png":r=this.state.rxData.icon_on||"img/bulb_on.png",h.jsx("div",{className:"vis-widget-body",onClick:()=>this.toggle(),children:h.jsx("img",{src:r.toString(),alt:"tplBulbOnOffCtrl",width:"100%"})})}}const m0=i=>h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 24",style:i.style,children:h.jsx("path",{fill:"currentColor",d:"m7.97,0.026c-4.324,0 -7.82,3.72 -7.82,8.324c0,6.24 7.82,15.46 7.82,15.46s7.82,-9.21 7.82,-15.46c0,-4.6 -3.49,-8.32 -7.82,-8.32zm0,0"})});class wa extends xe{static getWidgetInfo(){return{id:"tplRedNumber",visSet:"basic",visName:"Red Number",visPrev:"widgets/basic/img/Prev_RedNumber.png",visAttrs:[{name:"common",fields:[{name:"oid",type:"id"},{name:"type",type:"select",options:[{value:"circle",label:"basic_circle"},{value:"pin",label:"basic_pin"}]},{name:"html_prepend",type:"html"},{name:"html_append_singular",type:"html"},{name:"html_append_plural",type:"html"},{name:"background",type:"color"},{name:"borderColor",label:"basic_borderColor",type:"color",hidden:'data.type === "pin"'},{name:"borderRadius",label:"basic_borderRadius",type:"slider",min:0,max:100,step:1,default:16,hidden:'data.type === "pin"'}]}],visDefaultStyle:{width:52,height:30}}}getWidgetInfo(){return wa.getWidgetInfo()}renderWidgetBody(e){super.renderWidgetBody(e);const t=this.state.rxData.oid&&this.state.rxData.oid!=="nothing_selected"?parseFloat(this.state.values[`${this.state.rxData.oid}.val`]):null;if(!this.props.editMode&&(!t||this.state.values[`${this.state.rxData.oid}.val`]==="false"))return null;if(this.state.rxData.type==="pin")return h.jsxs("div",{className:"vis-widget-body",children:[h.jsx(m0,{style:{width:"100%",height:"100%",position:"absolute",top:0,left:0,zIndex:0,color:typeof this.state.rxData.background=="string"&&this.state.rxData.background||"red"}}),h.jsxs("div",{style:{position:"absolute",top:"22%",width:"96%",textAlign:"center",zIndex:1},children:[this.state.rxData.html_prepend?h.jsx("span",{dangerouslySetInnerHTML:{__html:this.state.rxData.html_prepend}}):null,t===null?"--":t,t===1?h.jsx("span",{dangerouslySetInnerHTML:{__html:this.state.rxData.html_append_singular}}):h.jsx("span",{dangerouslySetInnerHTML:{__html:this.state.rxData.html_append_plural}})]})]});const n={padding:3,borderRadius:this.state.rxData.borderRadius!==void 0&&this.state.rxData.borderRadius!==null?parseFloat(this.state.rxData.borderRadius):16,borderColor:this.state.rxData.borderColor||"white",borderWidth:3,borderStyle:"solid",backgroundColor:this.state.rxData.background||"red",minWidth:21,textAlign:"center",color:e.style.color||"white",fontSize:e.style.fontSize||20,fontFamily:e.style.fontFamily||"Helvetica",display:"flex",justifyContent:"center",alignItems:"center",boxSizing:"border-box"};return h.jsxs("div",{className:"vis-widget-body",style:n,children:[this.state.rxData.html_prepend?h.jsx("span",{dangerouslySetInnerHTML:{__html:this.state.rxData.html_prepend}}):null,t===null?"--":t,t===1?h.jsx("span",{dangerouslySetInnerHTML:{__html:this.state.rxData.html_append_singular}}):h.jsx("span",{dangerouslySetInnerHTML:{__html:this.state.rxData.html_append_plural}})]})}}class Da extends ve.Component{componentDidMount(){const t=new DOMParser().parseFromString(this.props.html,"text/html").getElementsByTagName("script");let n=0;const r=Array.from(document.querySelectorAll("script[type='text/javascript']"));for(const s of Array.from(t)){const o=`${this.props.wid}-${n++}`;if(r.find(c=>c.id===o))return;const l=document.createElement("script");l.id=o,l.type="text/javascript",l.async=!0,l.innerHTML=s.innerHTML,document.body.appendChild(l)}}render(){const{isDiv:e,html:t,...n}=this.props;return e?h.jsx("div",{dangerouslySetInnerHTML:{__html:t},...n}):h.jsx("span",{dangerouslySetInnerHTML:{__html:t},...n})}}class Sa extends xe{interval=null;static getWidgetInfo(){return{id:"tplHtml",visSet:"basic",visName:"HTML",visPrev:"widgets/basic/img/Prev_HTML.png",visAttrs:[{name:"common",fields:[{name:"html",type:"html"},{name:"refreshInterval",type:"slider",min:0,max:18e4,step:100}]}],visDefaultStyle:{width:200,height:130}}}getWidgetInfo(){return Sa.getWidgetInfo()}componentWillUnmount(){this.interval&&(clearInterval(this.interval),this.interval=null),super.componentWillUnmount()}componentDidMount(){super.componentDidMount(),parseInt(this.state.rxData.refreshInterval,10)&&(this.interval=setInterval(()=>this.forceUpdate(),parseInt(this.state.rxData.refreshInterval,10)))}onRxDataChanged(e){super.onRxDataChanged(e),this.interval&&(clearInterval(this.interval),this.interval=null),parseInt(this.state.rxData.refreshInterval,10)&&(this.interval=setInterval(()=>this.forceUpdate(),parseInt(this.state.rxData.refreshInterval,10)))}renderWidgetBody(e){return super.renderWidgetBody(e),h.jsx(Da,{className:"vis-widget-body",html:(this.state.rxData.html||"").toString(),isDiv:!0,wid:this.props.id})}}class Ia extends xe{static getWidgetInfo(){return{id:"tplValueString",visSet:"basic",visName:"String",visPrev:"widgets/basic/img/Prev_ValueString.png",visAttrs:[{name:"common",fields:[{name:"oid",type:"id"},{name:"html_prepend",type:"html"},{name:"html_append",type:"html"},{name:"test_html",type:"html"},{name:"icon",type:"icon64"},{name:"iconSize",label:"icon_size_in_pixels",type:"slider",min:5,max:200,hidden:"!data.icon"}]}],visWidgetLabel:"value_string",visDefaultStyle:{width:100,height:30}}}getWidgetInfo(){return Ia.getWidgetInfo()}renderWidgetBody(e){super.renderWidgetBody(e),e.style.width===void 0&&(e.style.width=50),e.style.height===void 0&&(e.style.height=20);const t=this.state.rxData.oid&&this.state.rxData.oid.includes('"')?"":this.state.rxData.oid||"";let n;this.props.editMode&&this.state.rxData.test_html?n=this.state.rxData.test_html:this.state.rxData.oid?this.state.rxData.oid.includes('"')?n=this.state.rxData.oid.substring(1,this.state.rxData.oid.length-1):t?n=this.state.values[`${t}.val`]:n="":n="";const r=this.state.rxData.icon?{display:"flex",alignItems:"center"}:{};return h.jsx("div",{className:"vis-widget-body",children:h.jsxs("div",{"data-oid":t,style:r,children:[this.state.rxData.icon?h.jsx(N.Icon,{src:this.state.rxData.icon,style:{width:this.state.rxData.iconSize||24,height:this.state.rxData.iconSize||24}}):null,h.jsx("span",{dangerouslySetInnerHTML:{__html:this.state.rxData.html_prepend??""}}),h.jsx("span",{children:n}),h.jsx("span",{dangerouslySetInnerHTML:{__html:this.state.rxData.html_append??""}})]})})}}class Ca extends xe{setTimer=null;static getWidgetInfo(){return{id:"tplValueInput",visSet:"basic",visName:"Input val",visWidgetLabel:"vis-2-widgets-basic-input_value",visPrev:"widgets/basic/img/Prev_ValueInput.png",visAttrs:[{name:"common",fields:[{name:"oid",type:"id"},{name:"html_prepend",type:"html"},{name:"html_append",type:"html"},{name:"numeric",type:"checkbox"},{name:"min",type:"number",hidden:"!data.numeric"},{name:"max",type:"number",hidden:"!data.numeric"},{name:"autoSet",type:"checkbox"},{name:"autoSetDelay",label:"vis-2-widgets-basic-autoSetDelay",type:"number",hidden:"!data.autoSet",default:1e3},{name:"readOnly",type:"checkbox"},{name:"autoFocus",type:"checkbox"},{name:"noStyle",type:"checkbox",label:"vis-2-widgets-basic-noStyle"},{name:"withEnter",type:"checkbox",hidden:"!!data.noStyle"},{name:"variant",type:"select",hidden:"!!data.noStyle",noTranslation:!0,options:[{value:"standard",label:"standard"},{value:"outlined",label:"outlined"},{value:"standard",label:"standard"}],default:"standard"}]}],visDefaultStyle:{width:150,height:70}}}componentDidMount(){super.componentDidMount();const e=this.state.rxData.oid&&this.state.rxData.oid!=="nothing_selected"&&this.state.rxData.oid.includes('"')?"":this.state.rxData.oid||"";let t;this.state.rxData.oid?this.state.rxData.oid.includes('"')?t=this.state.rxData.oid.substring(1,this.state.rxData.oid.length-1):e?t=this.state.values[`${e}.val`]!==null&&this.state.values[`${e}.val`]!==void 0?this.state.values[`${e}.val`].toString():"":t="":t="",this.setState({value:t,sentValue:!0})}onStateUpdated(e,t){if(e===this.state.rxData.oid&&t&&t.val!==null&&t.val!==void 0){const n=t.val.toString();this.state.value.toString()!==n&&this.setState({value:n})}}getWidgetInfo(){return Ca.getWidgetInfo()}renderWidgetBody(e){super.renderWidgetBody(e),e.style.width===void 0&&(e.style.width=100),e.style.height===void 0&&(e.style.height=25);const t=this.state.rxData.oid&&this.state.rxData.oid!=="nothing_selected"&&this.state.rxData.oid.includes('"')?"":this.state.rxData.oid||"";let n;this.state.rxData.oid?this.state.rxData.oid.includes('"')?n=this.state.rxData.oid.substring(1,this.state.rxData.oid.length-1):t?(n=this.state.value,n==null&&(n="")):n="":n="";let r;return this.state.rxData.noStyle?r=h.jsx("input",{type:this.state.rxData.numeric?"number":"text",style:{flexGrow:1,height:"calc(100% - 6px)",backgroundColor:this.props.context.themeType==="dark"?"#333":"#fff",color:this.props.context.themeType==="dark"?"#FFF":"#000"},readOnly:this.state.rxData.readOnly||this.props.editMode,autoFocus:this.state.rxData.autoFocus,value:n,onChange:s=>this.setState({value:s.target.value,sentValue:!1},()=>{this.state.rxData.autoSet&&(this.setTimer&&clearTimeout(this.setTimer),this.setTimer=setTimeout(()=>{this.setTimer=null,this.setState({sentValue:!0},()=>this.props.context.setValue(t,this.state.value))},this.state.rxData.autoSetDelay||1e3))}),onKeyDown:s=>{s.key==="Enter"&&t&&this.setState({sentValue:!0},()=>this.props.context.setValue(t,this.state.value))}}):r=h.jsx(k.TextField,{type:this.state.rxData.numeric?"number":"text",style:{flexGrow:1,height:"100%"},sx:{"& .MuiInputBase-root":{height:"100%"}},variant:this.state.rxData.variant,slotProps:{inputLabel:{shrink:!0},input:{readOnly:this.state.rxData.readOnly||this.props.editMode,endAdornment:!this.props.editMode&&this.state.rxData.withEnter&&t&&!this.state.sentValue?h.jsx(k.IconButton,{size:"small",onClick:()=>this.setState({sentValue:!0},()=>this.props.context.setValue(t,this.state.value)),children:h.jsx(be.KeyboardReturn,{})}):null}},label:this.state.rxData.html_prepend,helperText:this.state.rxData.html_append,value:n,onChange:s=>{this.setState({value:s.target.value,sentValue:!1},()=>{this.state.rxData.autoSet&&t&&(this.setTimer&&clearTimeout(this.setTimer),this.setTimer=setTimeout(()=>{this.setTimer=null,this.setState({sentValue:!0},()=>this.props.context.setValue(t,this.state.value))},this.state.rxData.autoSetDelay||1e3))})},onKeyDown:s=>{s.key==="Enter"&&t&&this.setState({sentValue:!0},()=>this.props.context.setValue(t,this.state.value))}}),h.jsxs("div",{className:"vis-widget-body",style:{display:"flex",alignItems:"center",gap:3},children:[this.state.rxData.noStyle?h.jsx("span",{dangerouslySetInnerHTML:{__html:this.state.rxData.html_prepend??""}}):null,r,this.state.rxData.noStyle?h.jsx("span",{dangerouslySetInnerHTML:{__html:this.state.rxData.html_append??""}}):null]})}}var Lp={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},od=ve.createContext&&ve.createContext(Lp),g0=["attr","size","title"];function v0(i,e){if(i==null)return{};var t=x0(i,e),n,r;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(i);for(r=0;r<s.length;r++)n=s[r],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(i,n)&&(t[n]=i[n])}return t}function x0(i,e){if(i==null)return{};var t={};for(var n in i)if(Object.prototype.hasOwnProperty.call(i,n)){if(e.indexOf(n)>=0)continue;t[n]=i[n]}return t}function Er(){return Er=Object.assign?Object.assign.bind():function(i){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(i[n]=t[n])}return i},Er.apply(this,arguments)}function ad(i,e){var t=Object.keys(i);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(i);e&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(i,r).enumerable})),t.push.apply(t,n)}return t}function Rr(i){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?ad(Object(t),!0).forEach(function(n){y0(i,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(t)):ad(Object(t)).forEach(function(n){Object.defineProperty(i,n,Object.getOwnPropertyDescriptor(t,n))})}return i}function y0(i,e,t){return e=b0(e),e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}function b0(i){var e=w0(i,"string");return typeof e=="symbol"?e:e+""}function w0(i,e){if(typeof i!="object"||!i)return i;var t=i[Symbol.toPrimitive];if(t!==void 0){var n=t.call(i,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(i)}function Bp(i){return i&&i.map((e,t)=>ve.createElement(e.tag,Rr({key:t},e.attr),Bp(e.child)))}function Vp(i){return e=>ve.createElement(D0,Er({attr:Rr({},i.attr)},e),Bp(i.child))}function D0(i){var e=t=>{var{attr:n,size:r,title:s}=i,o=v0(i,g0),a=r||t.size||"1em",l;return t.className&&(l=t.className),i.className&&(l=(l?l+" ":"")+i.className),ve.createElement("svg",Er({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},t.attr,n,o,{className:l,style:Rr(Rr({color:i.color||t.color},t.style),i.style),height:a,width:a,xmlns:"http://www.w3.org/2000/svg"}),s&&ve.createElement("title",null,s),i.children)};return od!==void 0?ve.createElement(od.Consumer,null,t=>e(t)):e(Lp)}function S0(i){return Vp({attr:{viewBox:"0 0 576 512"},child:[{tag:"path",attr:{d:"M572.694 292.093L500.27 416.248A63.997 63.997 0 0 1 444.989 448H45.025c-18.523 0-30.064-20.093-20.731-36.093l72.424-124.155A64 64 0 0 1 152 256h399.964c18.523 0 30.064 20.093 20.73 36.093zM152 224h328v-48c0-26.51-21.49-48-48-48H272l-64-64H48C21.49 64 0 85.49 0 112v278.046l69.077-118.418C86.214 242.25 117.989 224 152 224z"},child:[]}]})(i)}function v1(i){return Vp({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M464 128H272l-64-64H48C21.49 64 0 85.49 0 112v288c0 26.51 21.49 48 48 48h416c26.51 0 48-21.49 48-48V176c0-26.51-21.49-48-48-48z"},child:[]}]})(i)}class _a extends xe{static getWidgetInfo(){return{id:"tplContainerView",visSet:"basic",visName:"View in widget",visAttrs:[{name:"common",fields:[{name:"contains_view",label:"vis_2_widgets_basic_contains_view",type:"views"}]}],visPrev:"widgets/basic/img/Prev_ContainerView.png",visWidgetLabel:"vis_2_widgets_basic_view_in_widget",visSetLabel:"set_basic",visDefaultStyle:{width:300,height:200}}}getWidgetInfo(){return _a.getWidgetInfo()}getViewOptions(e,t,n=null,r=0){return e.___settings.folders.filter(o=>(o.parentId||null)===n).forEach(o=>{t.push({type:"folder",folder:o,level:r+1}),this.getViewOptions(e,t,o.id,r+1)}),Object.keys(e).filter(o=>(e[o].parentId||null)===n&&!o.startsWith("__")).forEach(o=>{t.push({type:"view",view:o,level:r+1})}),t}renderViewSelector(){const e=this.getViewOptions(this.props.context.views,[],null,0).filter(t=>t.type==="folder"||t.view!==this.props.view);return[h.jsx(k.IconButton,{style:this.props.context.editModeComponentStyle,onMouseDown:t=>{t.stopPropagation(),t.preventDefault(),this.props.onIgnoreMouseEvents(!0),this.setState({showViewSelector:!0})},children:h.jsx(Df,{})},"button"),this.state.showViewSelector?h.jsxs(k.Dialog,{open:!0,onClose:()=>this.setState({showViewSelector:!1},()=>this.props.onIgnoreMouseEvents(!1)),children:[h.jsx(k.DialogTitle,{children:N.I18n.t("vis_2_widgets_basic_contains_view")}),h.jsx(k.DialogContent,{children:e.map((t,n)=>t.type==="view"?h.jsxs(k.MenuItem,{value:t.view,onClick:()=>this.setState({showViewSelector:!1},()=>{this.props.onIgnoreMouseEvents(!1),this.props.context.onWidgetsChanged([{wid:this.props.id,view:this.props.view,data:{contains_view:t.view}}])}),style:{paddingLeft:t.level*16,lineHeight:"36px"},children:[h.jsx(Sf,{style:{verticalAlign:"middle",marginRight:4}}),h.jsx(k.ListItemText,{primary:t.view,style:{verticalAlign:"middle"}})]},n.toString()):h.jsxs(k.ListSubheader,{style:{paddingLeft:t.level*16,lineHeight:"36px",backgroundColor:"inherit"},children:[h.jsx(S0,{style:{verticalAlign:"middle",marginRight:6,marginTop:-3,fontSize:20,color:"#00dc00"}}),h.jsx("span",{style:{fontSize:"1rem"},children:t.folder.name})]},n))})]},"dialog"):null]}renderWidgetBody(e){super.renderWidgetBody(e),e.style.width===void 0&&(e.style.width=400),e.style.height===void 0&&(e.style.height=270);const t=this.state.rxData.contains_view;if(t===this.props.view)return h.jsx("div",{className:"vis-widget-body",style:{overflow:"hidden",position:"absolute"},children:N.I18n.t("vis_2_widgets_basic_cannot_recursive")});if(!t)return h.jsxs("div",{className:"vis-widget-body",style:{overflow:"hidden",position:"absolute"},children:[N.I18n.t("vis_2_widgets_basic_view_not_defined"),this.props.editMode?this.renderViewSelector():null]});const n={position:"absolute"};return this.state.rxStyle["overflow-x"]&&this.state.rxStyle["overflow-y"]?(delete e.style.overflow,this.state.rxStyle["overflow-y"]===this.state.rxStyle["overflow-x"]?n.overflow=this.state.rxStyle["overflow-x"]:(n.overflowX=this.state.rxStyle["overflow-x"],n.overflowY=this.state.rxStyle["overflow-y"])):this.state.rxStyle["overflow-x"]?(n.overflowX=this.state.rxStyle["overflow-x"],delete e.style.overflow):this.state.rxStyle["overflow-y"]?(n.overflowY=this.state.rxStyle["overflow-y"],delete e.style.overflow):this.state.rxStyle.overflow?n.overflow=this.state.rxStyle.overflow:n.overflow="hidden",delete e.style.overflow,delete e.style.overflowX,delete e.style.overflowY,h.jsxs("div",{className:"vis-widget-body",style:n,children:[this.state.editMode?h.jsx("div",{className:"vis-editmode-helper"}):null,super.getWidgetView(t,void 0)]})}}class Ma extends xe{static getWidgetInfo(){return{id:"tplStatefulContainerView8",visSet:"basic",visName:"View in widget 8",visAttrs:"oid;count[1]/number;group.views;contains_view_(0-count)/views",visPrev:"widgets/basic/img/Prev_StatefulContainerView8.png"}}getWidgetInfo(){return Ma.getWidgetInfo()}renderWidgetBody(e){super.renderWidgetBody(e),e.style.width===void 0&&(e.style.width=400),e.style.height===void 0&&(e.style.height=270);const t=[];let n=0;for(;this.state.rxData[`contains_view_${n}`]!==void 0;)t.push(this.state.rxData[`contains_view_${n}`]),n++;const r=this.state.rxData.oid;let s=this.state.values[`${r}.val`],o;if(r!=="nothing_selected"&&s!==void 0?((s==="true"||s===!0)&&(s=1),(s==="false"||s===!1)&&(s=0),o=t[s]):o=t[0],o===this.props.view)return h.jsx("div",{className:"vis-widget-body",style:{overflow:"hidden",position:"absolute"},children:N.I18n.t("vis_2_widgets_basic_cannot_recursive")});const a={position:"absolute"};return this.state.rxStyle["overflow-x"]&&this.state.rxStyle["overflow-y"]?(delete e.style.overflow,this.state.rxStyle["overflow-y"]===this.state.rxStyle["overflow-x"]?a.overflow=this.state.rxStyle["overflow-x"]:(a.overflowX=this.state.rxStyle["overflow-x"],a.overflowY=this.state.rxStyle["overflow-y"])):this.state.rxStyle["overflow-x"]?(a.overflowX=this.state.rxStyle["overflow-x"],delete e.style.overflow):this.state.rxStyle["overflow-y"]?(a.overflowY=this.state.rxStyle["overflow-y"],delete e.style.overflow):this.state.rxStyle.overflow?a.overflow=this.state.rxStyle.overflow:a.overflow="hidden",delete e.style.overflow,delete e.style.overflowX,delete e.style.overflowY,h.jsxs("div",{className:"vis-widget-body",style:a,children:[this.state.editMode?h.jsx("div",{className:"vis-editmode-helper"}):null,super.getWidgetView(o,void 0)]})}}class Ar extends xe{static getWidgetInfo(){return{id:"_tplGroup",visSet:"basic",visName:"Group",visPrev:"",visAttrs:[{name:"common",fields:[]}]}}componentDidMount(){super.componentDidMount(),this.setState({mounted:!0})}static _visAttrs(e,t,n){const r=e.members,s=[];r.forEach(c=>{var p;const u=(p=t[n].widgets[c])==null?void 0:p.data;u&&Object.keys(u).forEach(d=>{if(typeof u[d]=="string"){let f=u[d].match(/(groupAttr\d+)+?/g);f&&f.forEach(m=>!s.includes(m)&&s.push(m)),f=u[d].match(/%([-_a-zA-Z\d]+)+?%/g),f&&f.forEach(m=>{const v=m.substring(1,m.length-1);!s.includes(v)&&s.push(v)})}})});const o={name:"common",fields:[{name:"group_hint",label:"group_hint",type:"help",text:"group_help"}]},a={name:"objects",label:"group_fields",fields:[]},l=[o,a];for(let c=0;c<s.length;c++){const u=s[c],p=u.startsWith("groupAttr")?parseInt(u.substring(9),10):0;o.fields.push({name:u,title:e[`attrName_${u}`]||e[`attrName${p}`]||u,type:e[`attrType_${u}`]||e[`attrType${p}`]||""}),a.fields.push({name:`attrName_${u}`,title:`${N.I18n.t("group_attrName")} [${u}]`,type:"text"}),a.fields.push({name:`attrType_${u}`,title:`${N.I18n.t("group_attrType")} [${u}]`,type:"select",noTranslation:!0,options:["","text","checkbox","number","html","image","icon","icon64","id","color","views","widget","history","password","fontname","widget","groups","class","filters","json"]})}return l}getWidgetInfo(){const e=Ar.getWidgetInfo();return e.visAttrs=Ar._visAttrs(this.props.context.views[this.props.view].widgets[this.props.id].data,this.props.context.views,this.props.view),e}renderWidgetBody(e){var o;const t=this.props.context;super.renderWidgetBody(e);const n=t.views[this.props.view].widgets[this.props.id];this.props.id===this.props.selectedGroup&&(e.style.overflow="visible");const r=[...((o=n==null?void 0:n.data)==null?void 0:o.members)||[]];let s=null;return r!=null&&r.length&&this.state.mounted&&(r.sort((a,l)=>{const c=t.views[this.props.view].widgets[a],u=t.views[this.props.view].widgets[l],p=(c==null?void 0:c.style)&&(c.style.position==="relative"||c.style.position==="static"||c.style.position==="sticky"),d=(u==null?void 0:u.style)&&(u.style.position==="relative"||u.style.position==="static"||u.style.position==="sticky");return p&&d?0:p?-1:1}),s=r.map((a,l)=>{const c=t.views[this.props.view].widgets[a];if(!c)return null;const u=c.style&&(c.style.position==="relative"||c.style.position==="static"||c.style.position==="sticky");return St.getOneWidget(l,c,{selectedGroup:this.props.selectedGroup,selectedWidgets:this.props.selectedWidgets,context:this.props.context,editMode:this.props.editMode,moveAllowed:this.props.moveAllowed,mouseDownOnView:this.props.mouseDownOnView,index:l,id:a,view:this.props.view,isRelative:u,askView:this.props.askView,refParent:e.refService,relativeWidgetOrder:r,viewsActiveFilter:this.props.viewsActiveFilter,customSettings:this.props.customSettings})})),s}}class ka extends xe{static getWidgetInfo(){return{id:"tplValueBoolCtrlSvg",visSet:"basic",visName:"Bool SVG",visWidgetLabel:"qui_Bool SVG",visPrev:"widgets/basic/img/Prev_ValueBoolCtrlSvg.png",visAttrs:[{name:"common",fields:[{name:"oid",type:"id"},{name:"no_control",type:"checkbox"},{name:"svg_false",type:"html",default:"<polygon points='100,10 40,198 190,78 10,78 160,198' style='fill:lime; stroke:purple; stroke-width:5; fill-rule:nonzero' transform='scale(0.4)' />"},{name:"svg_true",type:"html",default:"<polygon points='100,10 40,198 190,78 10,78 160,198' style='fill:yellow; stroke:red; stroke-width:5; fill-rule:nonzero' transform='scale(0.4)' />"},{name:"svg_opacity",type:"slider",min:0,max:1,step:.05}]}],visDefaultStyle:{width:85,height:85}}}getWidgetInfo(){return ka.getWidgetInfo()}onSvgClick(){const e=this.state.rxData.oid;let t=this.state.values[`${this.state.rxData.oid}.val`];t===null||t===""||t===void 0||t===!1||t==="false"?this.props.context.setValue(e,!0):t===!0||t==="true"?this.props.context.setValue(e,!1):(t=parseFloat(t),t>=.5?t=1:t=0,this.props.context.setValue(e,1-t))}renderSvg(){let e=this.state.values[`${this.state.rxData.oid}.val`];typeof e=="string"&&(e=e.toLowerCase());const t=parseFloat(e);let n=this.state.rxData.svg_opacity;this.props.editMode&&((n==null||n==="")&&(n=1),parseFloat(n)<.2&&(n=.2));let r;return t===0||e==="false"||e==="0"||e==="off"||e===!1||e===null||e===void 0?r=this.state.rxData.svg_false:r=this.state.rxData.svg_true,h.jsx("svg",{style:{width:"100%",height:"100%",opacity:n},dangerouslySetInnerHTML:{__html:r}})}renderWidgetBody(e){return super.renderWidgetBody(e),h.jsx("div",{onClick:this.props.editMode?null:()=>this.onSvgClick(),className:"vis-widget-body",children:this.renderSvg()})}}class Rt extends xe{static getWidgetInfo(){return{id:"tplShapes",visSet:"basic",visName:"SVG shape",visPrev:"widgets/basic/img/Prev_SvgShape.png",visAttrs:[{name:"common",fields:[{name:"svgType",type:"select",options:[{value:"line",label:"basic_line"},{value:"triangle",label:"basic_triangle"},{value:"square",label:"basic_square"},{value:"pentagone",label:"basic_pentagone"},{value:"hexagone",label:"basic_hexagone"},{value:"octagone",label:"basic_octagone"},{value:"circle",label:"basic_circle"},{value:"star",label:"basic_star"},{value:"arrow",label:"basic_arrow"},{value:"custom",label:"basic_custom"}],default:"circle"},{name:"points",type:"slider",min:3,max:20,default:3,hidden:'data.svgType !== "custom"'},{name:"strokeColor",type:"color",default:"#009cb3"},{name:"fill",type:"color",default:"#00b3ac"},{name:"strokeWidth",type:"slider",min:0,max:100,default:5},{name:"rotate",type:"slider",min:0,max:360,default:0},{name:"scaleWidth",type:"slider",min:0,max:1,step:.05,default:1},{name:"scaleHeight",type:"slider",min:0,max:1,step:.05,default:1}]}],visDefaultStyle:{width:100,height:100}}}getWidgetInfo(){return Rt.getWidgetInfo()}static circlePoints(e,t,n){n=n||360/t;let r="";const s=Math.PI/180;for(let o=0;o<t;o++){const a=s*(o*n-180),l={x:Math.sin(a)*e,y:Math.cos(a)*e};r+=`${l.x}, ${l.y} `}return r}renderWidgetBody(e){super.renderWidgetBody(e);let t=null;const n=Number(this.state.rxData.rotate)||0,r=Number(this.state.rxData.scaleWidth)||1,s=Number(this.state.rxData.scaleHeight)||1,o=Number(this.state.rxData.strokeWidth)||0,a=`rotate(${n}) scale(${r}, ${s})`;return this.state.rxData.svgType==="triangle"?t=h.jsx("polygon",{transform:a,points:Rt.circlePoints(50-o,3)}):this.state.rxData.svgType==="line"?t=h.jsx("line",{vectorEffect:"non-scaling-stroke",transform:`rotate(${n})`,x1:"-50",y1:"0",x2:"50",y2:"0"}):this.state.rxData.svgType==="circle"?t=h.jsx("circle",{transform:a,cx:"0",cy:"0",r:50-o/2}):this.state.rxData.svgType==="pentagone"?t=h.jsx("polygon",{transform:a,points:Rt.circlePoints(50-o,5)}):this.state.rxData.svgType==="square"?t=h.jsx("polygon",{transform:a,points:Rt.circlePoints(50-o,4)}):this.state.rxData.svgType==="hexagone"?t=h.jsx("polygon",{transform:a,points:Rt.circlePoints(50-o,6)}):this.state.rxData.svgType==="octagone"?t=h.jsx("polygon",{transform:a,points:Rt.circlePoints(50-o,8)}):this.state.rxData.svgType==="custom"?t=h.jsx("polygon",{transform:a,points:Rt.circlePoints(50-o,Number(this.state.rxData.points)||3)}):this.state.rxData.svgType==="star"?t=h.jsx("polygon",{transform:a,points:Rt.circlePoints(50-o,5,144)}):this.state.rxData.svgType==="arrow"&&(t=h.jsx("polygon",{transform:`${a} translate(0,10)`,points:"0, -50 -43.3, 25 0,0 43.3, 25"})),h.jsx("div",{className:"vis-widget-body",children:h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",version:"1.1",viewBox:"-50 -50 100 100",style:{display:"block",width:"100%",height:"100%",fill:this.state.rxData.fill,stroke:this.state.rxData.strokeColor,strokeWidth:this.state.rxData.strokeWidth},children:t})})}}class Ta extends xe{essentialData;constructor(e){super(e),this.state={...this.state,width:document.documentElement.clientWidth,height:document.documentElement.clientHeight},this.essentialData=JSON.stringify(this.buildEssentialProjectData())}buildEssentialProjectData(){return Object.keys(this.props.context.views).sort().filter(e=>e!=="___settings").map(e=>{var t,n,r,s,o,a;return{id:e,sizex:(n=(t=this.props.context.views[e])==null?void 0:t.settings)==null?void 0:n.sizex,sizey:(s=(r=this.props.context.views[e])==null?void 0:r.settings)==null?void 0:s.sizey,useAsDefault:(a=(o=this.props.context.views[e])==null?void 0:o.settings)==null?void 0:a.useAsDefault}})}static getWidgetInfo(){return{id:"tplScreenResolution",visSet:"basic",visName:"Screen Resolution",visPrev:"widgets/basic/img/Prev_ScreenResolution.png",visAttrs:[],visDefaultStyle:{width:170,height:75}}}componentDidMount(){super.componentDidMount(),window.addEventListener("resize",this.onResize),window.addEventListener("hashchange",this.onResize),this.onResize()}componentWillUnmount(){super.componentWillUnmount(),window.removeEventListener("resize",this.onResize),window.removeEventListener("hashchange",this.onResize)}getWidgetInfo(){return Ta.getWidgetInfo()}createScreenText(){return h.jsx("span",{style:{fontWeight:"bold",cursor:"pointer"},onClick:()=>{window.vis.instance||(window.vis.generateInstance(),window.vis.instance?this.forceUpdate():window.alert("Cannot generate!"))},children:N.I18n.t("click to create")})}onResize=()=>{var r,s,o,a;let e,t,n;this.props.editMode?(e=((s=(r=this.props.context.views[this.props.context.activeView])==null?void 0:r.settings)==null?void 0:s.sizex)||window.document.documentElement.clientWidth,t=((a=(o=this.props.context.views[this.props.context.activeView])==null?void 0:o.settings)==null?void 0:a.sizey)||window.document.documentElement.clientHeight,n=window.vis.findNearestResolution(e,t)):(e=document.documentElement.clientWidth||0,t=document.documentElement.clientHeight,n=window.vis.findNearestResolution()),this.setState({width:e,height:t,defaultView:n})};renderWidgetBody(e){super.renderWidgetBody(e);const t=this.state,n=JSON.stringify(this.buildEssentialProjectData());n!==this.essentialData&&(this.essentialData=n,setTimeout(()=>this.onResize(),100));const r={border:"1px solid #888",fontSize:12,opacity:.8,width:"100%",height:"100%",boxSizing:"border-box",padding:10,display:"flex",flexDirection:"column",overflow:"hidden",justifyContent:"center"},s={marginLeft:8,fontWeight:"bold"};return h.jsxs("div",{className:"vis-widget-body",style:r,children:[h.jsxs("div",{children:[N.I18n.t("Default view"),":",h.jsx("span",{style:s,children:t.defaultView})]}),h.jsxs("div",{children:[N.I18n.t("Width"),":",h.jsxs("span",{style:s,children:[t.width,"px"]})]}),h.jsxs("div",{children:[N.I18n.t("Height"),":",h.jsxs("span",{style:s,children:[t.height,"px"]})]}),h.jsxs("div",{children:[N.I18n.t("Instance"),":",h.jsx("span",{style:s,children:window.vis.instance||this.createScreenText()})]})]})}}class Pa extends xe{recognition;ignoreOnEnd=!1;componentDidMount(){super.componentDidMount(),this.setState({text:window.webkitSpeechRecognition?"":N.I18n.t("basic_speech2text_info_upgrade"),image:this.state.rxData.imageInactive,result:"",resultColor:this.state.rxData.keyWordColor}),window.webkitSpeechRecognition&&(this.state.rxData.speechMode==="continuous"&&!this.state.editMode?this.startRecognition():this.setState({text:N.I18n.t("basic_speech2text_info_start")}))}getWidgetInfo(){return Pa.getWidgetInfo()}static getWidgetInfo(){return{id:"tplSpeech2Text",visSet:"basic",visName:"Speech to Text",visPrev:"widgets/basic/img/Prev_Speech2Text.png",visAttrs:[{name:"common",fields:[{name:"oid",type:"id"},{name:"speechMode",type:"select",default:"single",options:[{value:"single",label:"basic_speech2text_single"},{value:"startstop",label:"basic_speech2text_start_stop"},{value:"continuous",label:"basic_speech2text_continuous"}]},{name:"language",type:"select",options:[{value:"",label:""},{value:"en-US",label:"basic_speech2text_en_us"},{value:"de",label:"de"},{value:"ru-RU",label:"basic_speech2text_ru_ru"}]},{name:"keywords"}]},{name:"image",label:"Image",fields:[{name:"noImage",type:"checkbox",label:"basic_speech2text_no_image"},{name:"imageInactive",default:"widgets/basic/img/micInactive.svg",type:"image",label:"basic_speech2text_image_inactive"},{name:"imageActive",default:"widgets/basic/img/micActive.svg",type:"image",label:"basic_speech2text_image_active"},{name:"imageStarted",default:"widgets/basic/img/micStarted.svg",type:"image",label:"basic_speech2text_started"},{name:"imageDetected",default:"widgets/basic/img/micDetected.svg",type:"image",label:"basic_speech2text_detected"},{name:"imageSent",default:"widgets/basic/img/micSent.svg",type:"image",label:"basic_speech2text_sent"},{name:"imageHeightPx",default:70,type:"slider",min:0,max:200,step:1,label:"basic_speech2text_height"},{name:"imageWidthPx",default:70,type:"slider",min:0,max:200,step:1,label:"basic_speech2text_width"}]},{name:"text",label:"Text",fields:[{name:"noText",type:"checkbox",label:"basic_speech2text_no_text"},{name:"noResults",type:"checkbox",label:"basic_speech2text_no_results"},{name:"keyWordColor",type:"color",default:"#FFB051",label:"basic_speech2text_key_word_color",tooltip:"basic_speech2text_key_word_color_tooltip"},{name:"textSentColor",type:"color",default:"#7E88D3",label:"basic_speech2text_text_sent_color",tooltip:"basic_speech2text_text_sent_color_tooltip"}]}],visDefaultStyle:{width:500,height:77}}}findKeyWord(e){const t=this.state.rxData.keywords?this.state.rxData.keywords.toLowerCase().split(/[\s,;]+/g):null;let n=!1;if(t){const r=e.toLowerCase().split(" ");for(let s=0;s<t.length;s++){const o=r.indexOf(t[s]);if(o!==-1){let a=0;for(let l=0;l<o;l++)a+=r[l].length+1;e=`${e.substring(0,a)}<b>${e.substring(a,a+r[o].length)}</b>${e.substring(a+r[o].length)}`,n=!0;break}}}else return!0;return n?e:!1}startRecognition(){if(this.recognition){this.state.rxData.speechMode==="startstop"&&(this.recognition.onend=null,this.recognition.stop(),this.recognition=null,this.setState({text:N.I18n.t("basic_speech2text_info_start"),image:this.state.rxData.imageInactive}));return}this.recognition=new window.webkitSpeechRecognition,this.recognition.continuous=this.state.rxData.speechMode==="continuous"||this.state.rxData.speechMode==="startstop",this.recognition.interimResults=!0,this.recognition.maxAlternatives=1;const e=Date.now();let t="",n,r="",s;this.recognition.onstart=()=>{this.setState({text:N.I18n.t("basic_speech2text_info_speak_now"),image:this.state.rxData.imageActive,result:""})},this.recognition.onerror=o=>{this.setState({result:"",image:this.state.rxData.imageInactive}),o.error==="no-speech"&&this.setState({text:N.I18n.t("basic_speech2text_info_no_speech")}),o.error==="audio-capture"&&(this.setState({text:N.I18n.t("basic_speech2text_info_no_microphone")}),this.ignoreOnEnd=!0),o.error==="not-allowed"&&(o.timeStamp-e<100?this.setState({text:N.I18n.t("basic_speech2text_info_blocked")}):this.setState({text:N.I18n.t("basic_speech2text_info_denied")}),this.ignoreOnEnd=!0)},this.recognition.onend=()=>{this.recognition.stop(),this.recognition=null,this.ignoreOnEnd||setTimeout(()=>{this.setState({image:this.state.rxData.imageInactive}),this.state.rxData.speechMode==="continuous"?(this.setState({result:"",text:N.I18n.t("basic_speech2text_info_speak_now")}),this.startRecognition()):this.setState({result:"",text:N.I18n.t("basic_speech2text_info_start")})},1e3)},this.recognition.onresult=o=>{let a="";if(typeof o.results>"u"){this.recognition.onend=null,this.recognition.stop();return}for(let u=o.resultIndex;u<o.results.length;++u)o.results[u].isFinal?t+=o.results[u][0].transcript:a+=o.results[u][0].transcript;this.state.image===this.state.rxData.imageActive&&this.setState({image:this.state.rxData.imageStarted}),this.setState({text:""});let l=t||a;const c=this.findKeyWord(l);s||(s=this.state.resultColor),c&&(l=typeof c=="string"?c:l,this.state.image===this.state.rxData.imageStarted&&this.setState({image:this.state.rxData.imageDetected}),this.state.rxData.keyWordColor&&this.setState({resultColor:this.state.rxData.keyWordColor})),this.setState({text:l}),t?(n&&clearTimeout(n),c&&(this.setState({image:this.state.rxData.imageSent}),this.state.rxData.textSentColor&&this.setState({resultColor:this.state.rxData.textSentColor}),this.props.context.setValue(this.state.rxData.oid,t)),t="",r="",setTimeout(()=>{this.setState({image:this.state.rxData.imageActive,text:N.I18n.t("basic_speech2text_info_speak_now"),resultColor:s,result:""})},1e3)):(r=a,n&&clearTimeout(n),n=setTimeout(()=>{this.recognition.onend=null,this.recognition.stop(),this.recognition=null,!!this.findKeyWord(r)&&(this.setState({image:this.state.rxData.imageSent}),this.state.rxData.textSentColor&&this.setState({resultColor:this.state.rxData.textSentColor}),this.props.context.setValue(this.state.rxData.oid,t)),t="",r="",setTimeout(()=>{this.setState({image:this.state.rxData.imageActive,text:N.I18n.t("basic_speech2text_info_speak_now"),resultColor:s,result:""}),this.startRecognition()},1e3)},3e3))},this.recognition.lang=this.state.rxData.language,this.recognition.start()}renderWidgetBody(e){return super.renderWidgetBody(e),h.jsx("div",{className:"vis-widget-body",children:h.jsx("table",{style:{height:"100%",width:"100%"},onClick:()=>{this.state.rxData.speechMode!=="continuous"&&!this.state.editMode&&window.webkitSpeechRecognition&&this.startRecognition()},children:h.jsx("tbody",{children:h.jsxs("tr",{children:[h.jsx("td",{style:{display:this.state.rxData.noImage?"none":void 0},children:h.jsx(N.Icon,{alt:"mic",style:{height:`${this.state.rxData.imageHeightPx}px`,width:`${this.state.rxData.imageWidthPx}px`},src:this.state.image})}),h.jsxs("td",{className:"mic-text",style:{width:"100%"},children:[h.jsx("div",{style:{display:this.state.rxData.noText?"none":void 0},dangerouslySetInnerHTML:{__html:this.state.text}}),h.jsx("div",{style:{display:this.state.rxData.noResults?"none":void 0,color:this.state.resultColor},dangerouslySetInnerHTML:{__html:this.state.result}})]})]})})})})}}class ki extends xe{refreshInterval=null;frameRef;hashInstalled=!1;onWakeUpInstalled=!1;startedInterval=0;constructor(e){super(e),this.frameRef=ve.createRef()}static getWidgetInfo(){return{id:"tplIFrame",visSet:"basic",visName:"iFrame",visPrev:"widgets/basic/img/Prev_iFrame.png",visAttrs:[{name:"common",fields:[{name:"src",type:"url"},{name:"refreshInterval",tooltip:"basic_refreshInterval_tooltip",type:"slider",min:0,max:18e4,step:100,default:0},{name:"noSandbox",type:"checkbox"},{name:"refreshOnWakeUp",type:"checkbox"},{name:"refreshOnViewChange",type:"checkbox"},{name:"refreshWithNoQuery",type:"checkbox"},{name:"scrollX",type:"checkbox"},{name:"scrollY",type:"checkbox"},{name:"seamless",type:"checkbox",default:!0}]}],visDefaultStyle:{width:600,height:320}}}componentDidMount(){super.componentDidMount(),this.onPropertyUpdate()}componentWillUnmount(){super.componentWillUnmount(),this.refreshInterval&&(clearInterval(this.refreshInterval),this.refreshInterval=null),this.hashInstalled&&(this.hashInstalled=!1,window.removeEventListener("hashchange",this.onHashChange))}getWidgetInfo(){return ki.getWidgetInfo()}onHashChange=()=>{this.props.context.activeView===this.props.view&&this.refreshIFrame()};refreshIFrame(){var e,t;this.state.rxData.refreshWithNoQuery===!0?(t=(e=this.frameRef.current)==null?void 0:e.contentWindow)==null||t.location.reload():this.frameRef.current&&(this.frameRef.current.src=`${this.state.rxData.src}${this.state.rxData.src.includes("?")?"&":"?"}_refts=${Date.now()}`)}static isHidden(e){return e.offsetParent===null}static getParents(e){const t=[];let n=e;do n=n.parentNode,t.unshift(e);while(n);return t}onPropertyUpdate(){const e=this.state.rxData.src||"",t=Number(this.state.rxData.refreshInterval)||0,n=this.state.rxData.refreshOnViewChange===!0,r=this.state.rxData.refreshOnWakeUp===!0;e&&(n?this.hashInstalled||(this.hashInstalled=!0,window.addEventListener("hashchange",this.onHashChange)):this.hashInstalled&&(this.hashInstalled=!1,window.removeEventListener("hashchange",this.onHashChange)),t>0?(this.startedInterval!==t&&(this.startedInterval=t,this.refreshInterval&&clearInterval(this.refreshInterval),this.refreshInterval=null),this.refreshInterval=this.refreshInterval||setInterval(()=>{if(this.frameRef.current&&!ki.isHidden(this.frameRef.current)){const s=ki.getParents(this.frameRef.current).filter(o=>ki.isHidden(o));(!s.length||s[0].tagName==="BODY"||s[0].id==="materialdesign-vuetify-container")&&this.refreshIFrame()}},t)):this.refreshInterval&&(this.startedInterval=0,clearInterval(this.refreshInterval),this.refreshInterval=null),r?this.onWakeUpInstalled||(this.onWakeUpInstalled=!0,window.vis.onWakeUp(this.onHashChange,this.props.id)):this.onWakeUpInstalled&&(this.onWakeUpInstalled=!1,window.vis.onWakeUp(null,this.props.id)))}onRxDataChanged(){this.onPropertyUpdate()}renderWidgetBody(e){super.renderWidgetBody(e),this.props.editMode&&e.overlayClassNames.push("vis-editmode-helper");const t={position:"absolute",boxSizing:"border-box",padding:0,margin:0,border:0,width:"100%",height:"100%",overflowX:this.state.rxData.scrollX?"scroll":"hidden",overflowY:this.state.rxData.scrollY?"scroll":"hidden"};return this.state.rxData.src||""?h.jsx("div",{className:"vis-widget-body",children:h.jsx("iframe",{style:t,ref:this.frameRef,title:this.props.id,src:this.state.rxData.src,sandbox:this.state.rxData.noSandbox?"allow-modals allow-forms allow-pointer-lock allow-popups allow-same-origin allow-scripts":void 0,seamless:this.state.rxData.seamless})}):null}}class Ti extends xe{refreshInterval=null;frameRef;hashInstalled=!1;onWakeUpInstalled=!1;startedInterval=0;constructor(e){super(e),this.frameRef=ve.createRef()}static getWidgetInfo(){return{id:"tplStatefulIFrame8",visSet:"basic",visName:"iFrame 8",visPrev:"widgets/basic/img/Prev_StatefulIFrame8.png",visAttrs:[{name:"common",fields:[{name:"oid",type:"id"},{name:"refreshInterval",tooltip:"basic_refreshInterval_tooltip",type:"slider",min:0,max:18e4,step:100,default:0},{name:"refreshOnWakeUp",type:"checkbox"},{name:"refreshOnViewChange",type:"checkbox"},{name:"refreshWithNoQuery",type:"checkbox"},{name:"scrollX",type:"checkbox"},{name:"scrollY",type:"checkbox"},{name:"seamless",type:"checkbox",default:!0},{name:"count",type:"slider",min:1,max:20,default:2}]},{name:"frames",label:"frames",indexFrom:0,indexTo:"count",fields:[{name:"src_",type:"id"},{name:"noSandbox",type:"checkbox"}]}],visDefaultStyle:{width:600,height:320}}}componentDidMount(){super.componentDidMount(),this.onPropertyUpdate()}componentWillUnmount(){super.componentWillUnmount(),this.refreshInterval&&clearInterval(this.refreshInterval),this.hashInstalled&&(this.hashInstalled=!1,window.removeEventListener("hashchange",this.onHashChange))}getWidgetInfo(){return Ti.getWidgetInfo()}getSrc(){const e=this.state.values[`${this.state.rxData.oid}.val`];return e==null?this.state.rxData.src_1:this.state.rxData[`src_${e}`]||""}getNoSandBox(){const e=this.state.values[`${this.state.rxData.oid}.val`];return e==null?this.state.rxData.noSandbox1:this.state.rxData[`noSandbox${e}`]===!0||this.state.rxData[`noSandbox${e}`]==="true"}onHashChange=()=>{this.props.context.activeView===this.props.view&&this.refreshIFrame()};refreshIFrame(){var e,t;if(this.state.rxData.refreshWithNoQuery===!0)(t=(e=this.frameRef.current)==null?void 0:e.contentWindow)==null||t.location.reload();else if(this.frameRef.current){const n=this.getSrc();this.frameRef.current.src=`${n}${n.includes("?")?"&":"?"}_refts=${Date.now()}`}}static isHidden(e){return e.offsetParent===null}static getParents(e){const t=[];let n=e;do n=n.parentNode,t.unshift(e);while(n);return t}onPropertyUpdate(){const e=this.getSrc(),t=Number(this.state.rxData.refreshInterval)||0,n=this.state.rxData.refreshOnViewChange===!0,r=this.state.rxData.refreshOnWakeUp===!0;e&&(n?this.hashInstalled||(this.hashInstalled=!0,window.addEventListener("hashchange",this.onHashChange)):this.hashInstalled&&(this.hashInstalled=!1,window.removeEventListener("hashchange",this.onHashChange)),t>0?(this.startedInterval!==t&&(this.startedInterval=t,this.refreshInterval&&clearInterval(this.refreshInterval),this.refreshInterval=null),this.refreshInterval=this.refreshInterval||setInterval(()=>{if(this.frameRef.current&&!Ti.isHidden(this.frameRef.current)){const s=Ti.getParents(this.frameRef.current).filter(o=>Ti.isHidden(o));(!s.length||s[0].tagName==="BODY"||s[0].id==="materialdesign-vuetify-container")&&this.refreshIFrame()}},t)):this.refreshInterval&&(this.startedInterval=0,clearInterval(this.refreshInterval),this.refreshInterval=null),r?this.onWakeUpInstalled||(this.onWakeUpInstalled=!0,window.vis.onWakeUp(this.onHashChange,this.props.id)):this.onWakeUpInstalled&&(this.onWakeUpInstalled=!1,window.vis.onWakeUp(null,this.props.id)))}onRxDataChanged(){this.onPropertyUpdate()}renderWidgetBody(e){super.renderWidgetBody(e),this.props.editMode&&e.overlayClassNames.push("vis-editmode-helper");const t={position:"absolute",boxSizing:"border-box",padding:0,margin:0,border:0,width:"100%",height:"100%",overflowX:this.state.rxData.scrollX?"scroll":"hidden",overflowY:this.state.rxData.scrollY?"scroll":"hidden"},n=this.getSrc(),r=this.getNoSandBox();return n?h.jsx("div",{className:"vis-widget-body",children:h.jsx("iframe",{style:t,ref:this.frameRef,title:this.props.id,src:n,sandbox:r?"allow-modals allow-forms allow-pointer-lock allow-popups allow-same-origin allow-scripts":void 0,seamless:this.state.rxData.seamless})}):null}}class Oi extends xe{refreshInterval=null;imageRef;hashInstalled=!1;onWakeUpInstalled=!1;startedInterval=0;constructor(e){super(e),this.imageRef=ve.createRef()}componentDidMount(){super.componentDidMount(),this.onPropertyUpdate()}componentWillUnmount(){super.componentWillUnmount(),this.refreshInterval&&clearInterval(this.refreshInterval),this.hashInstalled&&(this.hashInstalled=!1,window.removeEventListener("hashchange",this.onHashChange))}onHashChange=()=>{this.props.context.activeView===this.props.view&&this.refreshImage()};refreshImage(){if(this.imageRef.current){const e=this.getImage();this.state.rxData.refreshWithNoQuery===!0?this.imageRef.current.src=e:this.imageRef.current.src=`${e}${e.includes("?")?"&":"?"}_refts=${Date.now()}`}}static isHidden(e){return e.offsetParent===null}static getParents(e){const t=[];let n=e;do n=n.parentNode,t.unshift(e);while(n);return t}onPropertyUpdate(){const e=this.getImage(),t=Number(this.state.rxData.refreshInterval)||0,n=this.state.rxData.refreshOnViewChange===!0,r=this.state.rxData.refreshOnWakeUp===!0;e&&(n?this.hashInstalled||(this.hashInstalled=!0,window.addEventListener("hashchange",this.onHashChange)):this.hashInstalled&&(this.hashInstalled=!1,window.removeEventListener("hashchange",this.onHashChange)),t>0?(this.startedInterval!==t&&(this.startedInterval=t,this.refreshInterval&&clearInterval(this.refreshInterval),this.refreshInterval=null),this.refreshInterval=this.refreshInterval||setInterval(()=>{if(this.imageRef.current&&!Oi.isHidden(this.imageRef.current)){const s=Oi.getParents(this.imageRef.current).filter(o=>Oi.isHidden(o));(!s.length||s[0].tagName==="BODY"||s[0].id==="materialdesign-vuetify-container")&&this.refreshImage()}},t)):this.refreshInterval&&(this.startedInterval=0,clearInterval(this.refreshInterval),this.refreshInterval=null),r?this.onWakeUpInstalled||(this.onWakeUpInstalled=!0,window.vis.onWakeUp(this.onHashChange,this.props.id)):this.onWakeUpInstalled&&(this.onWakeUpInstalled=!1,window.vis.onWakeUp(null,this.props.id)))}onRxDataChanged(){this.onPropertyUpdate()}renderWidgetBody(e){super.renderWidgetBody(e),this.props.editMode?e.overlayClassNames.push("vis-editmode-helper"):this.state.rxData.allowUserInteractions||(e.style.pointerEvents="none",e.style.userSelect="none",e.style.touchAction="none");const t={padding:0,margin:0,border:0,width:"100%",height:"auto"};this.state.rxData.stretch&&(t.height="100%"),this.state.rxData.allowUserInteractions||(t.touchAction="none",t.userSelect="none",t.pointerEvents="none");const n=this.getImage();return n?h.jsx("div",{className:"vis-widget-body",style:{overflow:"hidden",pointerEvents:this.state.rxData.allowUserInteractions?void 0:"none",touchAction:this.state.rxData.allowUserInteractions?void 0:"none",userSelect:this.state.rxData.allowUserInteractions?void 0:"none"},children:h.jsx(N.Icon,{style:t,ref:this.imageRef,src:n,alt:this.props.id})}):null}}class Oa extends Oi{static getWidgetInfo(){return{id:"tplImage",visSet:"basic",visName:"Image",visPrev:"widgets/basic/img/Prev_Image.png",visAttrs:[{name:"common",fields:[{name:"src",type:"image"},{name:"stretch",type:"checkbox"},{name:"refreshInterval",tooltip:"basic_refreshInterval_tooltip",type:"slider",min:0,max:18e4,step:100,default:0},{name:"refreshOnWakeUp",type:"checkbox"},{name:"refreshOnViewChange",type:"checkbox"},{name:"refreshWithNoQuery",type:"checkbox"},{name:"allowUserInteractions",type:"checkbox"}]}],visDefaultStyle:{width:200,height:130}}}getWidgetInfo(){return Oa.getWidgetInfo()}getImage(){return this.state.rxData.src||""}}class ja extends xe{static getWidgetInfo(){return{id:"tplHtmlNav",visSet:"basic",visName:"HTML navigation",visPrev:"widgets/basic/img/Prev_HTMLnavigation.png",visAttrs:[{name:"common",fields:[{name:"html",type:"html"},{name:"nav_view",type:"views"},{name:"sub_view",label:"basic_sub_view",type:"text",tooltip:"sub_view_tooltip",hidden:"!data.nav_view"}]}],visDefaultStyle:{width:200,height:130}}}getWidgetInfo(){return ja.getWidgetInfo()}onNavigate=()=>{this.state.rxData.nav_view&&this.props.context.changeView((this.state.rxData.nav_view||"").toString(),this.state.rxData.sub_view?this.state.rxData.sub_view.toString():void 0)};renderWidgetBody(e){return super.renderWidgetBody(e),e.style.width===void 0&&(e.style.width=200),e.style.height===void 0&&(e.style.height=130),h.jsx(Da,{className:"vis-widget-body",html:(this.state.rxData.html||"").toString(),isDiv:!0,wid:this.props.id,onClick:this.props.editMode?null:this.onNavigate})}}const Je=[];for(let i=0;i<256;++i)Je.push((i+256).toString(16).slice(1));function I0(i,e=0){return(Je[i[e+0]]+Je[i[e+1]]+Je[i[e+2]]+Je[i[e+3]]+"-"+Je[i[e+4]]+Je[i[e+5]]+"-"+Je[i[e+6]]+Je[i[e+7]]+"-"+Je[i[e+8]]+Je[i[e+9]]+"-"+Je[i[e+10]]+Je[i[e+11]]+Je[i[e+12]]+Je[i[e+13]]+Je[i[e+14]]+Je[i[e+15]]).toLowerCase()}let Ys;const C0=new Uint8Array(16);function _0(){if(!Ys){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");Ys=crypto.getRandomValues.bind(crypto)}return Ys(C0)}const M0=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),ld={randomUUID:M0};function sr(i,e,t){var r;if(ld.randomUUID&&!i)return ld.randomUUID();i=i||{};const n=i.random??((r=i.rng)==null?void 0:r.call(i))??_0();if(n.length<16)throw new Error("Random bytes length must be >= 16");return n[6]=n[6]&15|64,n[8]=n[8]&63|128,I0(n)}const mt={handlerCell:{alignItems:"center",whiteSpace:"nowrap",padding:"1px 4px",verticalAlign:"middle"},grab:{marginRight:4,marginTop:12},index:{display:"inline-block",verticalAlign:"top",marginTop:15},cell:{padding:"1px 4px",verticalAlign:"bottom"},cellText:{padding:"12px 4px 0px 4px"},cellImage:{padding:"0px 4px",verticalAlign:"bottom"},cellButton:{padding:"0px 4px"},rowEven:i=>({backgroundColor:i.palette.mode==="dark"?"rgba(255, 255, 255, 0.04)":"rgba(0, 0, 0, 0.04)"})};class k0 extends D.Component{originalItems;constructor(e){var n;super(e);const t=(e.items||[]).map(r=>({...r,id:sr()}));this.state={filters:((n=window.vis)==null?void 0:n.updateFilter())||[],items:t,applyItems:JSON.stringify(e.items||[]),selectIcon:null,selectImage:null,anchorEl:null},this.originalItems=this.state.applyItems}updateItems(e){const t=JSON.parse(JSON.stringify(e));t.forEach(n=>delete n.id),this.setState({items:e,applyItems:JSON.stringify(t)})}renderSelectIconDialog(){return this.state.selectIcon===null?null:h.jsx(zo,{themeType:this.props.context.theme.palette.mode,theme:this.props.context.theme,value:this.state.items[this.state.selectIcon],onClose:e=>{if(e!==null){const t=JSON.parse(JSON.stringify(this.state.items));t[this.state.selectIcon].icon=e,this.updateItems(t)}this.setState({selectIcon:null})}})}renderFilterSelector(){if(!this.state.anchorEl)return null;const e=this.state.filters.filter(t=>!this.state.items.find(n=>n.value===t));return h.jsxs(k.Menu,{anchorEl:this.state.anchorEl,open:!0,onClose:()=>this.setState({anchorEl:null}),children:[e==null?void 0:e.map(t=>h.jsx(k.MenuItem,{onClick:()=>{const n=JSON.parse(JSON.stringify(this.state.items));n.push({label:t,value:t,id:sr()}),this.setState({anchorEl:null},()=>this.updateItems(n))},value:t,children:t},t)),h.jsx(k.MenuItem,{sx:t=>({color:t.palette.primary.main}),onClick:()=>{const t=JSON.parse(JSON.stringify(this.state.items));t.push({label:"",value:"",id:sr()}),this.setState({anchorEl:null},()=>this.updateItems(t))},children:N.I18n.t("Custom")}),e.length>1?h.jsx(k.MenuItem,{sx:t=>({color:t.palette.primary.main}),onClick:()=>{const t=JSON.parse(JSON.stringify(this.state.items));e.forEach(n=>t.push({label:n,value:n,id:sr()})),this.setState({anchorEl:null},()=>this.updateItems(t))},children:N.I18n.t("basic_all_filters")}):null]})}renderSelectImageDialog(){if(this.state.selectImage===null)return null;let e=this.state.items[this.state.selectImage].image||"";return e.startsWith("../")?e=e.substring(3):e.startsWith("_PRJ_NAME/")&&(e=e.replace("_PRJ_NAME/",`../${this.props.context.adapterName}.${this.props.context.instance}/${this.props.context.projectName}/`)),h.jsx(N.SelectFile,{theme:this.props.context.theme,title:N.I18n.t("Select file"),onClose:()=>this.setState({selectImage:null}),restrictToFolder:`${this.props.context.adapterName}.${this.props.context.instance}/${this.props.context.projectName}`,allowNonRestricted:!0,allowUpload:!0,allowDownload:!0,allowCreateFolder:!0,allowDelete:!0,allowView:!0,showToolbar:!0,imagePrefix:"../",selected:e,filterByType:"images",onOk:t=>{let n=t?Array.isArray(t)?t[0]:t:"";const r=`${this.props.context.adapterName}.${this.props.context.instance}/${this.props.context.projectName}/`;n!=null&&n.startsWith(r)?n=`_PRJ_NAME/${n.substring(r.length)}`:n!=null&&n.startsWith("/")?n=`..${n}`:n&&!n.startsWith(".")&&(n=`../${n}`);const s=JSON.parse(JSON.stringify(this.state.items));s[this.state.selectImage].image=n,this.updateItems(s),this.setState({selectImage:null})},socket:this.props.context.socket})}renderTableRow(e,t){let n=e.image;return n&&(n.startsWith("../")?n=n.substring(3):n.startsWith("_PRJ_NAME/")&&(n=n.replace("_PRJ_NAME/",`../${this.props.context.adapterName}.${this.props.context.instance}/${this.props.context.projectName}/`))),h.jsx(i0,{draggableId:e.id||"",index:t,children:r=>h.jsxs(k.TableRow,{sx:t%2?mt.rowEven:void 0,ref:r.innerRef,...r.draggableProps,children:[h.jsxs(k.TableCell,{style:mt.handlerCell,...r.dragHandleProps,children:[h.jsx(be.DragHandle,{style:mt.grab}),h.jsxs("div",{style:mt.index,children:[t+1,"."]})]}),h.jsx(k.TableCell,{style:mt.cellText,children:h.jsx(k.TextField,{variant:"standard",fullWidth:!0,value:e.value||"",onChange:s=>{const o=JSON.parse(JSON.stringify(this.state.items));o[t].value=s.target.value,this.updateItems(o)},InputLabelProps:{shrink:!0}})}),h.jsx(k.TableCell,{style:mt.cellText,children:h.jsx(k.TextField,{variant:"standard",fullWidth:!0,value:e.label||"",onChange:s=>{const o=JSON.parse(JSON.stringify(this.state.items));o[t].label=s.target.value,this.updateItems(o)},InputLabelProps:{shrink:!0}})}),h.jsx(k.TableCell,{style:mt.cellImage,children:e.image?null:h.jsxs("div",{style:{display:"flex",alignItems:"center"},children:[h.jsx(k.TextField,{fullWidth:!0,size:"small",variant:"standard",value:e.icon,onChange:s=>{const o=JSON.parse(JSON.stringify(this.state.items));o[t].icon=s.target.value,this.updateItems(o)},slotProps:{input:{endAdornment:e.icon?h.jsx(k.IconButton,{size:"small",onClick:()=>{const s=JSON.parse(JSON.stringify(this.state.items));s[t].icon="",this.updateItems(s)},children:h.jsx(be.Clear,{})}):null}}}),h.jsx(k.Button,{variant:e.icon?"outlined":void 0,color:e.icon?"grey":void 0,onClick:()=>this.setState({selectIcon:t}),children:e.icon?h.jsx(N.Icon,{src:e.icon,style:{width:36,height:36}}):"..."})]})}),h.jsx(k.TableCell,{style:mt.cellImage,children:e.icon?null:h.jsxs("div",{style:{display:"flex",alignItems:"center"},children:[h.jsx(k.TextField,{variant:"standard",fullWidth:!0,slotProps:{input:{endAdornment:e.image?h.jsx(k.IconButton,{size:"small",onClick:()=>{const s=JSON.parse(JSON.stringify(this.state.items));s[t].image="",this.updateItems(s)},children:h.jsx(be.Clear,{})}):null}},value:e.image,onChange:s=>{const o=JSON.parse(JSON.stringify(this.state.items));o[t].image=s.target.value,this.updateItems(o)}}),h.jsx(k.Button,{variant:n?"outlined":void 0,color:n?"grey":void 0,onClick:()=>this.setState({selectImage:t}),children:n?h.jsx(N.Icon,{src:n,style:{width:36,height:36}}):"..."})]})}),h.jsx(k.TableCell,{style:mt.cell,children:h.jsx(N.ColorPicker,{style:{width:"100%"},value:e.color,onChange:s=>{const o=JSON.parse(JSON.stringify(this.state.items));o[t].color=s,this.updateItems(o)}})}),h.jsx(k.TableCell,{style:mt.cell,children:h.jsx(N.ColorPicker,{style:{width:"100%"},value:e.activeColor,onChange:s=>{const o=JSON.parse(JSON.stringify(this.state.items));o[t].activeColor=s,this.updateItems(o)}})}),h.jsx(k.TableCell,{style:mt.cellButton,children:h.jsx(k.Checkbox,{checked:!!e.default,onChange:s=>{const o=JSON.parse(JSON.stringify(this.state.items));!this.props.multiple&&s.target.checked&&o.forEach(a=>a.default=!1),o[t].default=s.target.checked,this.updateItems(o)}})}),h.jsx(k.TableCell,{style:mt.cellButton,children:h.jsx(k.IconButton,{size:"small",onClick:()=>{const s=JSON.parse(JSON.stringify(this.state.items));s.splice(t,1),this.updateItems(s)},children:h.jsx(be.Delete,{})})})]})},e.id)}renderTable(){return h.jsxs(k.Table,{stickyHeader:!0,size:"small",children:[h.jsx(k.TableHead,{children:h.jsxs(k.TableRow,{children:[h.jsx(k.TableCell,{style:{width:40},children:h.jsx(k.Fab,{size:"small",onClick:e=>this.setState({anchorEl:e.currentTarget}),children:h.jsx(be.Add,{})})}),h.jsx(k.TableCell,{style:{width:70},children:N.I18n.t("Value")}),h.jsx(k.TableCell,{style:{width:"calc(100% - 700px)"},children:N.I18n.t("Title")}),h.jsx(k.TableCell,{style:{width:150},children:N.I18n.t("Icon")}),h.jsx(k.TableCell,{style:{width:150},children:N.I18n.t("Image")}),h.jsx(k.TableCell,{style:{width:150},children:N.I18n.t("Text color")}),h.jsx(k.TableCell,{style:{width:150},children:N.I18n.t("jqui_active_color")}),h.jsx(k.TableCell,{style:{width:70},children:N.I18n.t("Default")}),h.jsx(k.TableCell,{style:{width:40}})]})}),h.jsx(yS,{onDragEnd:e=>{if(!e.destination)return;const t=JSON.parse(JSON.stringify(this.state.items)),[n]=t.splice(e.source.index,1);t.splice(e.destination.index,0,n),this.updateItems(t)},children:h.jsx(Fp,{droppableId:"items",type:"ROW",children:e=>h.jsxs(k.TableBody,{ref:e.innerRef,...e.droppableProps,children:[this.state.items.map((t,n)=>this.renderTableRow(t,n)),e.placeholder]})})})]})}render(){return h.jsxs(k.Dialog,{fullWidth:!0,maxWidth:"xl",open:!0,onClose:()=>this.props.onClose(),children:[h.jsx(k.DialogTitle,{children:N.I18n.t("Edit")}),h.jsxs(k.DialogContent,{style:{minHeight:"calc(90vh - 164px)"},children:[this.renderSelectIconDialog(),this.renderSelectImageDialog(),this.renderFilterSelector(),this.renderTable()]}),h.jsxs(k.DialogActions,{children:[h.jsx(k.Button,{disabled:this.originalItems===this.state.applyItems,variant:"contained",onClick:()=>this.props.onClose(JSON.parse(this.state.applyItems)),color:"primary",startIcon:h.jsx(be.Check,{}),children:N.I18n.t("Apply")}),h.jsx(k.Button,{variant:"contained",color:"grey",onClick:()=>this.props.onClose(),startIcon:h.jsx(be.Close,{}),children:N.I18n.t("Cancel")})]})]})}}function or(i){const e=i.length;for(let t=0;t<e;t++){const n=i[t];if(n.includes(",")){const r=n.split(",").map(o=>o.trim()).filter(o=>o),s=r.shift();s&&(i[t]=s,r.length&&i.push(...r))}else if(n.includes(";")){const r=n.split(";").map(o=>o.trim()).filter(o=>o),s=r.shift();s&&(i[t]=s,r.length&&i.push(...r))}}}const T0=i=>{const[e,t]=D.useState(!1);let n=i.data.items;if(e&&!n&&i.data.filters&&(n=i.data.filters.split(";").map(r=>({label:r.trim(),value:r.trim()})).filter(r=>r.value)),e&&typeof n=="string")try{n=JSON.parse(n)}catch{n=[]}return h.jsxs(h.Fragment,{children:[h.jsx(k.Button,{style:{whiteSpace:"nowrap"},onClick:()=>t(!0),variant:"outlined",startIcon:h.jsx(be.Edit,{}),children:N.I18n.t("Edit")}),e?h.jsx(k0,{context:i.context,items:n||[],multiple:i.data.multiple,onClose:r=>{if(r){const s=JSON.parse(JSON.stringify(i.data));s.items=JSON.stringify(r),i.setData(s)}t(!1)}}):null]})};class Ea extends xe{editMode;static getWidgetInfo(){return{id:"tplFilterDropdown",visSet:"basic",visName:"filter - dropdown",visPrev:"widgets/basic/img/Prev_FilterDropdown.png",visAttrs:[{name:"common",fields:[{name:"items",label:"editor",type:"custom",noBinding:!0,component:(e,t,n,r)=>h.jsx(T0,{data:t,setData:n,context:r.context}),default:"[]"},{name:"type",label:"Type",type:"select",options:[{value:"dropdown",label:"basic_filter_type_dropdown"},{value:"horizontal_buttons",label:"basic_filter_type_horizontal_buttons"},{value:"vertical_buttons",label:"basic_filter_type_vertical_buttons"}],default:"horizontal_buttons"},{name:"widgetTitle",label:"name",hidden:'data.type !== "dropdown"'},{name:"autoFocus",type:"checkbox",hidden:'data.type !== "dropdown"'},{name:"multiple",label:"basic_filter_multiple",type:"checkbox"},{name:"noAllOption",label:"basic_no_all_option",type:"checkbox"},{name:"noFilterText",label:"basic_no_filter_text",type:"text",hidden:"!!data.noAllOption"},{name:"dropdownVariant",label:"jqui_variant",type:"select",noTranslation:!0,options:[{value:"standard",label:"standard"},{value:"outlined",label:"outlined"},{value:"filled",label:"filled"}],default:"standard",hidden:'data.type !== "dropdown"'},{name:"buttonsVariant",label:"jqui_variant",type:"select",noTranslation:!0,options:[{value:"outlined",label:"outlined"},{value:"contained",label:"contained"},{value:"text",label:"text"}],default:"outlined",hidden:'data.type === "dropdown"'},{name:"dropdownSmall",label:"basic_small",default:!1,type:"checkbox",hidden:'data.type !== "dropdown"'}]}],visDefaultStyle:{width:200,height:50}}}getWidgetInfo(){return Ea.getWidgetInfo()}componentDidMount(){if(super.componentDidMount(),this.props.editMode)this.editMode=!0;else{this.editMode=!1;const e=this.getItems();if(e.find(t=>t.default&&t.value)){const t=[];e.forEach(n=>n.default&&t.push(n.value)),or(t),setTimeout(()=>{this.props.askView("getViewClass").onCommand("changeFilter",{filter:t})},0)}}}onCommand(e){e==="changeFilter"&&this.forceUpdate(),super.onCommand(e)}renderDropdown(e){const t=this.props.viewsActiveFilter[this.props.view]||[];let n;return this.state.rxData.multiple?n=t:n=t[0]||"",h.jsxs(k.FormControl,{fullWidth:!0,variant:this.state.rxData.dropdownVariant||"standard",children:[this.state.rxData.widgetTitle?h.jsx(k.InputLabel,{children:this.state.rxData.widgetTitle}):null,h.jsxs(k.Select,{fullWidth:!0,value:n||"_",onChange:r=>{let s=r.target.value==="_"?[]:r.target.value;typeof s=="string"&&(s=s.split(",")),(s.includes("")||s.includes("_"))&&(s=[]),or(s),this.props.askView("getViewClass").onCommand("changeFilter",{filter:s})},renderValue:r=>{const s=e.find(o=>o.value===r);return s?h.jsx("span",{style:{color:s.color},children:s.label}):r==="_"||!r?this.state.rxData.noAllOption?"":N.I18n.t("basic_no_filter"):r},multiple:!!this.state.rxData.multiple,autoFocus:!!this.state.rxData.autoFocus,children:[this.state.rxData.noAllOption?null:h.jsx(k.MenuItem,{value:"_",children:h.jsx("em",{children:this.state.rxData.noFilterText||N.I18n.t("basic_no_filter")})}),e.map(r=>{let s=r.icon;return!s&&r.image&&(s=r.image,s.startsWith("_PRJ_NAME/")&&(s=s.replace("_PRJ_NAME/",`../${this.props.context.adapterName}.${this.props.context.instance}/${this.props.context.projectName}/`))),h.jsxs(k.MenuItem,{value:r.value,selected:t.includes(r.value),style:{color:t.includes(r.value)?r.color:r.activeColor||r.color},children:[s?h.jsx(N.Icon,{src:s,style:{width:24,height:24,marginRight:8}}):null,r.label]},r.value)})]})]})}renderButtons(e){const t=this.props.viewsActiveFilter[this.props.view]||[];return h.jsxs(k.ButtonGroup,{variant:this.state.rxData.buttonsVariant||"contained",orientation:this.state.rxData.type==="horizontal_buttons"?"horizontal":"vertical",style:{width:"100%",height:"100%"},children:[this.state.rxData.noAllOption?null:h.jsx(k.Button,{style:{flexGrow:1},onClick:()=>{this.props.askView("getViewClass").onCommand("changeFilter",{filter:[]})},children:h.jsx("em",{children:this.state.rxData.noFilterText||N.I18n.t("basic_no_filter")})}),e.map(n=>{let r=n.icon;return!r&&n.image&&(r=n.image,r.startsWith("_PRJ_NAME/")&&(r=r.replace("_PRJ_NAME/",`../${this.props.context.adapterName}.${this.props.context.instance}/${this.props.context.projectName}/`))),h.jsx(k.Button,{onClick:()=>{let s;this.state.rxData.multiple?s=t.includes(n.value)?t.filter(a=>a!==n.value):[...t,n.value]:s=[n.value];const o=this.props.askView("getViewClass");or(s),o.onCommand("changeFilter",{filter:s})},color:t.includes(n.value)?"primary":void 0,sx:s=>({backgroundColor:t.includes(n.value)?this.state.rxData.buttonsVariant==="contained"?s.palette.secondary.main:s.palette.primary.main:void 0,color:t.includes(n.value)?this.state.rxData.buttonsVariant==="contained"?s.palette.secondary.contrastText:s.palette.primary.contrastText:void 0,"&:hover":{backgroundColor:t.includes(n.value)?this.state.rxData.buttonsVariant==="contained"?s.palette.secondary.light:s.palette.primary.light:void 0,color:t.includes(n.value)?this.state.rxData.buttonsVariant==="contained"?s.palette.secondary.contrastText:s.palette.primary.contrastText:void 0}}),startIcon:r?h.jsx(N.Icon,{src:r,alt:n.label,style:{height:24}}):null,style:{flexGrow:1,color:t.includes(n.value)&&n.activeColor||n.color},children:n.label},n.value)})]})}getItems(){let e=this.state.data.items;if(!e&&this.state.data.filters&&(e=this.state.data.filters.split(";").map(t=>({label:t.trim(),value:t.trim()})).filter(t=>t.value)),typeof e=="string")try{e=JSON.parse(e)}catch{e=[]}return e=e||[],e}renderWidgetBody(e){super.renderWidgetBody(e),e.style.width===void 0&&(e.style.width=200),e.style.height===void 0&&(e.style.height=50);const t=this.getItems();if(this.editMode!==void 0&&this.editMode!==this.props.editMode&&(this.editMode=this.props.editMode,!this.editMode&&t.find(r=>r.default&&r.value))){const r=[];t.forEach(s=>s.default&&r.push(s.value)),or(r),setTimeout(()=>{this.props.askView("getViewClass").onCommand("changeFilter",{filter:r})},0)}const n=this.state.rxData.type||"dropdown";return n==="horizontal_buttons"||n==="vertical_buttons"?this.renderButtons(t):this.renderDropdown(t)}}class Ra extends xe{static getWidgetInfo(){return{id:"tplLink",visSet:"basic",visName:"link",visPrev:"widgets/basic/img/Prev_tplLink.png",visAttrs:[{name:"common",fields:[{name:"html",type:"html"},{name:"href",type:"url"},{name:"target",label:"target",type:"auto",options:["auto","_blank","_self","_parent","_top"],hidden:"!data.href"}]}],visDefaultStyle:{width:200,height:130}}}getWidgetInfo(){return Ra.getWidgetInfo()}renderWidgetBody(e){return super.renderWidgetBody(e),e.style.width===void 0&&(e.style.width=200),e.style.height===void 0&&(e.style.height=130),h.jsx("a",{href:this.state.rxData.href,target:this.state.rxData.target,style:{textDecoration:"none",width:"100%",height:"100%"},children:h.jsx(Da,{className:"vis-widget-body",html:this.state.rxData.html,isDiv:!0,wid:this.props.id})})}}class Aa extends Oi{static getWidgetInfo(){return{id:"tplStatefulImage8",visSet:"basic",visName:"Image 8",visPrev:"widgets/basic/img/Prev_StatefulImage.png",visDefaultStyle:{width:200,height:130},visAttrs:[{name:"common",fields:[{name:"oid",type:"id"},{name:"count",type:"number",default:0,onChange:(e,t,n)=>{const{count:r}=t;for(let s=0;s<r;s++)t[`g_images-${s}`]=!0;return n(t),_e.dispatch(wr(!0)),Promise.resolve()}},{name:"stretch",type:"checkbox"},{name:"refreshInterval",tooltip:"basic_refreshInterval_tooltip",type:"slider",min:0,max:18e4,step:100,default:0},{name:"refreshOnWakeUp",type:"checkbox"},{name:"refreshOnViewChange",type:"checkbox"},{name:"refreshWithNoQuery",type:"checkbox"},{name:"allowUserInteractions",type:"checkbox"}]},{name:"images",label:"Image",indexFrom:0,indexTo:"count",fields:[{name:"src_",type:"image"}]}]}}getWidgetInfo(){return Aa.getWidgetInfo()}getImage(){const e=[];for(let t=0;t<=this.state.rxData.count;t++)this.state.rxData[`src_${t}`]&&e.push(this.state.rxData[`src_${t}`]);if(this.state.rxData.oid!=="nothing_selected"&&this.state.values[`${this.state.rxData.oid}.val`]!==void 0){let t=this.state.values[`${this.state.rxData.oid}.val`];return(t==="true"||t===!0)&&(t=1),(t==="false"||t===!1)&&(t=0),e[t]||""}return e[0]||""}}class Na extends xe{static getWidgetInfo(){return{id:"tplFrame",visSet:"basic",visName:"Border",visPrev:"widgets/basic/img/Prev_tplFrame.png",visAttrs:[{name:"common",fields:[{name:"title",type:"text",default:N.I18n.t("jqui_widgetTitle")},{name:"title_back",type:"color"},{name:"title_top",type:"slider",min:-20,max:20,default:-10},{name:"title_left",type:"slider",min:-20,max:30,default:20},{name:"header_height",type:"slider",min:0,max:100},{name:"header_color",type:"color"}]}],visDefaultStyle:{width:100,height:70,"border-style":"solid","border-width":"1px","border-color":"#888","overflow-x":"visible","overflow-y":"visible"}}}getWidgetInfo(){return Na.getWidgetInfo()}renderWidgetBody(e){super.renderWidgetBody(e);let t=h.jsx("div",{style:{position:"absolute",top:this.state.rxData.title_top,left:this.state.rxData.title_left,backgroundColor:this.state.rxData.title_back||(this.state.rxData.header_height?void 0:this.props.context.themeType==="dark"?"#000":"#fff"),padding:"0 5px"},children:this.state.rxData.title});return this.state.rxData.header_height&&(t=h.jsx("div",{style:{width:"100%",height:this.state.rxData.header_height,backgroundColor:this.state.rxData.header_color||(this.props.context.themeType==="dark"?"#000":"#fff")},children:t})),h.jsx("div",{className:"vis-widget-body",children:t})}}class $a extends xe{constructor(e){super(e),Object.assign(this.state,{dialog:!1,text:""})}static getWidgetInfo(){return{id:"tplNote",visSet:"basic",visName:"Note",visPrev:"widgets/basic/img/Prev_Note.png",visAttrs:[{name:"common",fields:[{name:"oid",type:"id"},{name:"html_prepend",type:"html"},{name:"html_append",type:"html"},{name:"test_text",type:"html"},{name:"hide_corner",label:"basic_node_hide_corner",type:"checkbox"}]}],visDefaultStyle:{width:100,height:70,"border-radius":"5px","border-style":"solid","border-width":"1px","border-color":"#888","background-color":"rgba(255,255,105,0.8)"}}}getWidgetInfo(){return $a.getWidgetInfo()}renderDialog(){return this.state.dialog?h.jsxs(k.Dialog,{open:!0,onClose:()=>this.setState({dialog:!1}),fullWidth:!0,sx:{"& .MuiDialog-paper":{}},children:[h.jsx(k.DialogContent,{children:h.jsx(k.TextareaAutosize,{style:{width:"calc(100% - 6px)",minHeight:200,backgroundColor:this.props.context.themeType==="dark"?"black":"white",resize:"vertical",color:this.props.context.themeType==="dark"?"white":"black"},value:this.state.text,onChange:e=>this.setState({text:e.target.value})})}),h.jsxs(k.DialogActions,{children:[this.state.text?h.jsx(k.IconButton,{onClick:e=>{e.stopPropagation(),this.setState({text:""})},children:h.jsx(be.Delete,{})}):null,h.jsx("div",{style:{flex:1}}),h.jsx(k.Button,{variant:"contained",color:"primary",onClick:e=>{e.stopPropagation(),this.setState({dialog:!1}),this.props.context.setValue(this.state.rxData.oid,this.state.text)},children:h.jsx(be.Check,{})}),h.jsx(k.Button,{variant:"contained",color:"grey",onClick:e=>{e.stopPropagation(),this.setState({dialog:!1})},children:h.jsx(be.Close,{})})]})]}):null}renderWidgetBody(e){super.renderWidgetBody(e);let t=null;return this.state.rxData.hide_corner||(t=h.jsx("div",{style:{position:"absolute",right:-10,bottom:-10,width:20,height:20,backgroundColor:this.state.rxStyle["border-color"],transform:"rotate(45deg)"}})),h.jsx("div",{className:"vis-widget-body",onClick:()=>!this.props.editMode&&this.setState({dialog:!0,text:this.state.values[`${this.state.rxData.oid}.val`]}),children:h.jsxs("div",{style:{width:"100%",height:"100%",position:"relative",overflow:this.state.rxData.hide_corner?void 0:"hidden"},children:[h.jsxs("div",{style:{padding:10,cursor:this.props.editMode?"default":"pointer",width:"calc(100% - 20px)",height:"calc(100% - 20px)"},children:[this.props.editMode?null:this.renderDialog(),this.state.rxData.html_prepend||"",this.props.editMode&&this.state.rxData.test_text?this.state.rxData.test_text:this.state.values[`${this.state.rxData.oid}.val`]||"",this.state.rxData.html_append||""]}),t]})})}}class Wa extends xe{static getWidgetInfo(){return{id:"tplHtmlLogout",visSet:"basic",visName:"HTML logout",visPrev:"widgets/basic/img/Prev_HtmlLogout.png",visAttrs:[{name:"common",fields:[{name:"html",type:"html",default:"Logout"},{name:"redirect_url",type:"url"},{name:"in_app_close",type:"checkbox"},{name:"variant",label:"jqui_variant",type:"select",noTranslation:!0,options:["contained","outlined","text"],default:"contained"},{name:"icon",label:"jqui_icon",type:"icon64",hidden:"!!data.image"},{name:"image",type:"image",label:"jqui_image",hidden:"!!data.icon"}]}],visDefaultStyle:{width:70,height:30}}}getWidgetInfo(){return Wa.getWidgetInfo()}async onLogout(){if(!this.props.editMode)if(this.state.rxData.in_app_close)typeof window.logout=="function"?window.logout():window.alert(N.I18n.t("This option works only in APP"));else{if(!this.props.context.socket.isSecure){window.alert(N.I18n.t("This option works only for connection with authentication"));return}await this.props.context.socket.logout(),this.state.rxData.redirect_url?window.location.href=this.state.rxData.redirect_url:window.location.reload()}}renderWidgetBody(e){return super.renderWidgetBody(e),h.jsx("div",{className:"vis-widget-body",children:h.jsx(k.Button,{style:{width:"100%",height:"100%",minWidth:30,background:this.state.rxStyle.background||void 0,backgroundColor:this.state.rxStyle["background-color"]||void 0,color:this.state.rxStyle.color||void 0,borderStyle:this.state.rxStyle["border-style"]||void 0,borderWidth:this.state.rxStyle["border-width"]||void 0,borderColor:this.state.rxStyle["border-color"]||void 0,borderRadius:this.state.rxStyle["border-radius"]||void 0},variant:this.state.rxData.variant,onClick:()=>this.onLogout(),startIcon:this.state.rxData.html&&(this.state.rxData.icon||this.state.rxData.image)?h.jsx(N.Icon,{src:this.state.rxData.icon||this.state.rxData.image}):void 0,children:this.state.rxData.html?h.jsx("div",{dangerouslySetInnerHTML:{__html:this.state.rxData.html}}):this.state.rxData.icon||this.state.rxData.image?h.jsx(N.Icon,{src:this.state.rxData.icon||this.state.rxData.image}):h.jsx(be.Close,{})})})}}class fe extends xe{refButton;refDialog;hideTimeout;setObjectType;constructor(e){super(e),this.state.width=0,this.state.height=0,this.state.dialogVisible=!1,this.state.showPassword=!1,this.state.password="",this.refButton=ve.createRef(),this.refDialog=ve.createRef()}static getWidgetInfo(){return{id:"tplJquiButtonLink",visSet:"jqui",visName:"Button Link",visSetLabel:"jqui_set_label",visWidgetLabel:"jqui_button_link",visPrev:"widgets/jqui/img/Prev_ButtonLink.png",visOrder:1,visAttrs:[{name:"common",fields:[{name:"buttontext",type:"text",default:"URL",hidden:e=>!!e.html||!!(e.buttontext_view&&e.nav_view)||!!e.externalDialog},{name:"html",type:"html",default:"",tooltip:"jqui_html_tooltip",disabled:e=>!!e.buttontext||!!e.icon||!!e.src||!!e.externalDialog},{name:"Password",type:"password",label:"password",tooltip:"jqui_password_tooltip",disabled:e=>!e.nav_view&&!e.url&&!e.href&&!e.html_dialog&&!e.contains_view}]},{name:"view",label:"jqui_view_group",hidden:e=>!!e.url||!!e.href||!!e.html_dialog||!!e.contains_view,fields:[{name:"nav_view",label:"jqui_nav_view",type:"views"},{name:"buttontext_view",label:"jqui_buttontext_view",type:"checkbox",hidden:e=>!e.nav_view},{name:"sub_view",label:"basic_sub_view",type:"text",tooltip:"sub_view_tooltip",hidden:e=>!e.nav_view}]},{name:"URL",label:"jqui_url_group",hidden:e=>!!e.html_dialog||!!e.contains_view||!!e.nav_view,fields:[{name:"href",label:"jqui_url_in_browser",type:"url",hidden:e=>!!e.url,tooltip:"jqui_href_tooltip"},{name:"url",label:"jqui_url_in_background",type:"url",hidden:e=>!!e.href,tooltip:"jqui_url_tooltip"},{name:"target",type:"auto",options:["_blank","_self","_parent","_top"],hidden:e=>!!e.url||!e.href}]},{name:"style",label:"Style",hidden:e=>!!e.externalDialog,fields:[{name:"no_style",type:"checkbox",hidden:e=>e.jquery_style},{name:"jquery_style",label:"jqui_jquery_style",type:"checkbox",hidden:e=>e.no_style},{name:"padding",type:"slider",min:0,max:100,default:5},{name:"variant",label:"jqui_variant",type:"select",noTranslation:!0,options:["contained","outlined","standard"],default:"contained",hidden:e=>e.jquery_style||e.no_style},{name:"color",label:"jqui_button_color",type:"select",noTranslation:!0,options:["","primary","secondary"],default:"",hidden:e=>e.jquery_style||e.no_style},{name:"html_prepend",type:"html"},{name:"html_append",type:"html"},{name:"visResizable",label:"visResizable",type:"checkbox",default:!1,desiredSize:!1}]},{name:"icon",hidden:e=>!!e.externalDialog||e.jquery_style,fields:[{name:"src",label:"jqui_image",type:"image",hidden:e=>e.icon},{name:"icon",label:"jqui_icon",type:"icon64",hidden:e=>e.src},{name:"invert_icon",type:"checkbox",hidden:e=>!e.icon&&!e.src},{name:"imageHeight",type:"slider",min:0,max:200,default:100,hidden:e=>!e.src}]},{name:"dialog",hidden:e=>!!e.url||!!e.href||!!e.nav_view,fields:[{name:"html_dialog",type:"html",hidden:e=>!!e.contains_view},{name:"contains_view",type:"views",hidden:e=>!!e.html_dialog},{name:"title",type:"text",hidden:e=>!e.html_dialog&&!e.contains_view},{name:"autoclose",type:"slider",min:0,max:3e4,step:100,hidden:e=>!e.html_dialog&&!e.contains_view},{name:"modal",type:"checkbox",default:!0,hidden:e=>!e.html_dialog&&!e.contains_view},{name:"dialog_width",type:"text",hidden:e=>!e.html_dialog&&!e.contains_view},{name:"dialog_height",type:"text",hidden:e=>!e.html_dialog&&!e.contains_view},{name:"dialog_class",label:"CSS Class",type:"text",hidden:e=>!e.html_dialog&&!e.contains_view},{name:"persistent",type:"checkbox",hidden:e=>!e.html_dialog&&!e.contains_view},{name:"preload",type:"checkbox",hidden:e=>!e.html_dialog&&!e.contains_view},{name:"closeOnClick",type:"checkbox",hidden:e=>!e.html_dialog&&!e.contains_view},{name:"hideCloseButton",label:"jqui_hide_close_button",type:"checkbox",hidden:e=>!e.html_dialog&&!e.contains_view&&!!e.closeOnClick},{name:"dialogBackgroundColor",label:"Background color",type:"color",hidden:e=>!e.html_dialog&&!e.contains_view},{name:"dialogTitleColor",type:"color",label:"Text color",hidden:e=>!e.html_dialog&&!e.contains_view},{name:"overflowX",type:"select",noTranslation:!0,options:["","auto","hidden","visible","scroll","initial","inherit"],hidden:e=>!e.html_dialog&&!e.contains_view},{name:"overflowY",type:"select",noTranslation:!0,options:["","auto","hidden","visible","scroll","initial","inherit"],hidden:e=>!e.html_dialog&&!e.contains_view},{name:"setId",type:"id",tooltip:"jqui_dialog_set_id_tooltip",hidden:e=>!e.html_dialog&&!e.contains_view},{name:"setValue",type:"text",hidden:e=>!e.setId||!e.html_dialog&&!e.contains_view},{name:"dialogName",label:"jqui_dialog_name",type:"text",hidden:e=>!e.html_dialog&&!e.contains_view},{name:"externalDialog",label:"jqui_external_dialog",tooltip:"jqui_external_dialog_tooltip",type:"checkbox",hidden:e=>!e.html_dialog&&!e.contains_view}]}]}}static findField(e,t){return xe.findField(e,t)}getWidgetInfo(){return fe.getWidgetInfo()}componentDidMount(){super.componentDidMount(),this.componentDidUpdate()}componentWillUnmount(){this.hideTimeout&&clearTimeout(this.hideTimeout),this.hideTimeout=null,super.componentWillUnmount()}componentDidUpdate(){this.refButton.current&&(this.state.rxData.jquery_style&&!this.refButton.current._jQueryDone&&(this.refButton.current._jQueryDone=!0,window.jQuery(this.refButton.current).button()),(this.refButton.current.clientWidth!==this.state.width||this.refButton.current.clientHeight!==this.state.height)&&this.setState({width:this.refButton.current.clientWidth,height:this.refButton.current.clientHeight})),this.refService.current&&(this.state.rxData.html_dialog||this.state.rxData.contains_view)&&!this.refService.current._showDialog&&(this.refService.current._showDialog=this.showDialog),this.refService.current&&(this.refService.current.dataset.dialogName||"")!==(this.state.rxData.dialogName||"")&&(this.state.rxData.dialogName?this.refService.current.dataset.dialogName=this.state.rxData.dialogName:delete this.refService.current.dataset.dialogName)}showDialog=e=>{this.setState({dialogVisible:e});let t=this.state.rxData.autoclose;(t===!0||t==="true")&&(t=1e4),!(t==null||t==="")&&(t=parseInt(t,10),t<60&&(t*=1e3),t=t||1e3,t&&(e?this.hideTimeout=setTimeout(()=>{this.hideTimeout=null,this.showDialog(!1)},t):this.hideTimeout&&(clearTimeout(this.hideTimeout),this.hideTimeout=null)))};onPasswordEnter(){this.state.password===this.state.rxData.Password?this.setState({showPassword:!1},()=>this.onClick(!0)):(window.alert(N.I18n.t("Wrong password")),this.setState({passwordError:!0},()=>{setTimeout(()=>this.setState({passwordError:!1}),3e3)}))}renderPasswordDialog(){return this.state.showPassword?h.jsxs(k.Dialog,{open:!0,onClose:()=>this.setState({showPassword:!1}),children:[h.jsx(k.DialogTitle,{children:N.I18n.t("Enter password")}),h.jsx(k.DialogContent,{children:h.jsx(k.TextField,{label:N.I18n.t("Password"),error:this.state.passwordError,helperText:this.state.passwordError?N.I18n.t("Wrong password"):null,type:"password",autoFocus:!0,fullWidth:!0,variant:"standard",value:this.state.password||"",onChange:e=>this.setState({password:e.target.value}),onKeyUp:e=>e.key==="Enter"&&this.onPasswordEnter()})}),h.jsxs(k.DialogActions,{children:[h.jsx(k.Button,{disabled:!this.state.password,startIcon:h.jsx(be.Check,{}),onClick:e=>{e.stopPropagation(),e.preventDefault(),this.onPasswordEnter()},color:"primary",variant:"contained",children:N.I18n.t("Enter")}),h.jsx(k.Button,{startIcon:h.jsx(be.Close,{}),onClick:e=>{e.stopPropagation(),e.preventDefault(),this.setState({showPassword:!1})},color:"grey",variant:"contained",children:N.I18n.t("Cancel")})]})]}):null}async setObjectWithState(e,t){var n;if(this.setObjectType===void 0){try{const r=await this.props.context.socket.getObject(e);this.setObjectType=((n=r==null?void 0:r.common)==null?void 0:n.type)||"string",await this.setObjectWithState(e,t)}catch(r){console.warn(`Object ${e} not found: ${r}`)}return}this.setObjectType==="boolean"?t=t==="true"||t===!0||t==="1"||t===1||t==="on"||t==="ON":this.setObjectType==="number"?t=parseFloat(t):t!=null&&(t=t.toString()),this.props.context.setValue(e,t)}onCommand(e){return super.onCommand(e),e==="openDialog"?(this.showDialog(!0),!0):e==="closeDialog"?(this.showDialog(!1),!0):!1}onClick(e){if(!this.state.dialogVisible){if(!e&&this.state.rxData.Password){this.props.editMode?window.alert(N.I18n.t("Ignored in edit mode")):this.setState({showPassword:!0,password:""});return}this.state.rxData.nav_view?this.props.context.changeView(this.state.rxData.nav_view):!this.props.editMode&&this.state.rxData.href?this.state.rxData.target||this.props.tpl==="tplJquiButtonLinkBlank"&&this.state.rxData.target===void 0?window.open(this.state.rxData.href,this.state.rxData.target):window.location.href=this.state.rxData.href:this.state.rxData.url&&this.props.context.socket.getRawSocket().emit("httpGet",this.state.rxData.url,t=>console.log("httpGet",this.state.rxData.url,t)),(this.state.rxData.html_dialog||this.state.rxData.contains_view)&&(this.state.rxData.setId&&this.setObjectWithState(this.state.rxData.setId,this.state.rxData.setValue).catch(t=>console.warn(`Cannot set state: ${t}`)),this.showDialog(!0))}}renderRxDialog(e,t){if(console.log("test"),this.state.rxData.modal)return console.log("in"),h.jsx(k.Dialog,{maxWidth:"xl",id:`${this.props.id}_dialog`,ref:this.refDialog,open:this.state.dialogVisible,onClick:()=>{this.state.rxData.closeOnClick&&this.showDialog(!1)},children:h.jsxs("div",{style:{backgroundColor:this.state.rxData.dialogBackgroundColor},children:[this.state.rxData.title?h.jsx(k.DialogTitle,{sx:{color:this.state.rxData.dialogTitleColor},children:this.state.rxData.title}):null,!this.state.rxData.hideCloseButton||!this.state.rxData.closeOnClick?h.jsx(k.IconButton,{sx:{color:this.state.rxData.dialogTitleColor},style:{position:"absolute",top:0,right:0,zIndex:800},onClick:()=>this.showDialog(!1),children:h.jsx(be.Close,{})}):null,h.jsx(k.DialogContent,{children:t})]})});this.state.dialogVisible||(e.display="none"),(!e.minWidth||e.minWidth<200)&&(e.minWidth=200),(!e.minHeight||e.minHeight<100)&&(e.minHeight=100),e.backgroundColor="blue";const n={...e};return delete n.top,delete n.left,n.padding=this.state.rxData.title?"0 24px 24px 24px":"26px 24px 24px 24px",h.jsx(k.Popper,{open:this.state.dialogVisible,id:`${this.props.id}_dialog`,ref:this.refDialog,anchorEl:this.refButton.current,style:e,onClick:()=>{this.state.rxData.closeOnClick&&this.showDialog(!1)},children:h.jsxs(k.Paper,{style:{...n,background:"red !important"},children:[this.state.rxData.title?h.jsx(k.DialogTitle,{style:{padding:"16px 0 0 0"},children:h.jsx("div",{children:this.state.rxData.title})}):null,h.jsx(k.IconButton,{style:{position:"absolute",top:0,right:0,zIndex:800},onClick:()=>this.showDialog(!1),children:h.jsx(be.Close,{})}),h.jsx(k.DialogContent,{children:t})]})})}renderJQueryDialog(e,t){return h.jsx("div",{id:`${this.props.id}_dialog`,className:"vis-widget-dialog",title:this.state.rxData.title,style:e,ref:this.refDialog,children:this.state.rxData.preload?t:null})}renderDialog(){if(this.props.editMode||!this.state.dialogVisible&&!this.state.rxData.persistent&&!this.state.rxData.externalDialog||!this.state.rxData.html_dialog&&!this.state.rxData.contains_view)return null;const e=Ve(this.state.rxData.dialog_width)?parseFloat(this.state.rxData.dialog_width):this.state.rxData.dialog_width,t=Ve(this.state.rxData.dialog_height)?parseFloat(this.state.rxData.dialog_height):this.state.rxData.dialog_height,n={minWidth:e||window.innerWidth-50,minHeight:t||window.innerHeight-50,overflowX:this.state.rxData.overflowX,overflowY:this.state.rxData.overflowY};let r;return this.state.rxData.contains_view?r=h.jsx("div",{style:n,className:this.state.rxData.dialog_class,children:super.getWidgetView(this.state.rxData.contains_view,void 0)}):r=h.jsx("div",{style:n,className:this.state.rxData.dialog_class,dangerouslySetInnerHTML:{__html:this.state.rxData.html_dialog}}),this.state.rxData.jquery_style,this.renderRxDialog(n,r)}renderWidgetBody(e){var c,u;super.renderWidgetBody(e);const t={marginRight:4,filter:this.state.rxData.invert_icon?"invert(1)":void 0};!this.state.rxData.jquery_style&&this.state.rxData.src&&(this.state.width>this.state.height?(t.height=`${this.state.rxData.imageHeight||100}%`,t.width="auto"):(t.width=`${this.state.rxData.imageHeight||100}%`,t.height="auto"));let n=!this.state.rxData.jquery_style&&(this.state.rxData.src||this.state.rxData.icon);n&&n.startsWith("_PRJ_NAME/")&&(n=n.replace("_PRJ_NAME/",`../${this.props.context.adapterName}.${this.props.context.instance}/${this.props.context.projectName}/`));const r=n?h.jsx(N.Icon,{src:n,style:t}):null,s={textTransform:"none"};Object.keys(this.state.rxStyle).forEach(p=>{const d=this.state.rxStyle[p];d!=null&&xe.POSSIBLE_MUI_STYLES.includes(p)&&(p=p.replace(/(-\w)/g,f=>f[1].toUpperCase()),s[p]=d)}),s.borderWidth&&(s.borderWidth=Se.correctStylePxValue(s.borderWidth)),s.fontSize&&(s.fontSize=Se.correctStylePxValue(s.fontSize));let o=this.state.data.visResizable;o==null&&(this.props.tpl==="tplJquiButtonNav"||this.props.tpl==="tplJquiNavPw"||this.props.tpl==="tplContainerDialog"||this.props.tpl==="tplContainerIconDialog"||this.props.tpl==="tplJquiDialog"||this.props.tpl==="tplJquiIconDialog"||this.props.tpl==="tplIconHttpGet"||this.props.tpl==="tplIconLink"||this.props.tpl==="tplJquiIconNav")&&(o=!0),o?(s.width="100%",s.height="100%"):s.padding=this.state.rxData.padding,s.minWidth="unset";let a;this.state.rxData.html||(this.state.rxData.nav_view&&this.state.rxData.buttontext_view?a=((u=(c=this.props.context.views[this.state.rxData.nav_view])==null?void 0:c.settings)==null?void 0:u.navigationTitle)||this.state.rxData.nav_view:this.state.rxData.buttontext===void 0?a=this.state.rxData.text||"":a=this.state.rxData.buttontext);let l;return this.state.rxData.externalDialog?l=this.props.editMode?h.jsxs("div",{style:{width:"100%",height:"100%",border:"2px dashed red",backgroundColor:"grey",color:"white",boxSizing:"border-box"},children:[h.jsx(k.IconButton,{style:{...this.props.context.editModeComponentStyle,position:"absolute",bottom:0,right:0,opacity:.4},onClick:p=>{p.stopPropagation(),p.preventDefault();const d=`setState('${this.props.context.adapterName}.${this.props.context.instance}.control.command', '${JSON.stringify({command:"dialog",instance:window.localStorage.getItem("visInstance"),data:this.state.rxData.dialogName||this.props.id})}')`;window.alert(N.I18n.t("Copied %s",d)),N.Utils.copyToClipboard(d)},children:h.jsx(N.IconCopy,{})}),h.jsx("div",{children:N.I18n.t("External dialog")}),h.jsx("div",{children:this.state.rxData.html_dialog?"HTML":`View: ${this.state.rxData.contains_view}`}),h.jsx("div",{children:`Name: ${this.state.rxData.dialogName?`${this.state.rxData.dialogName} (${this.props.id})`:this.props.id}`}),h.jsx("div",{style:{fontSize:10},children:N.I18n.t("You can open dialog with following script:")}),h.jsx("div",{style:{fontSize:10},children:`setState('${this.props.context.adapterName}.${this.props.context.instance}.control.command', '${JSON.stringify({command:"dialog",instance:window.localStorage.getItem("visInstance"),data:this.state.rxData.dialogName||this.props.id})}')`})]}):null:l=[this.state.rxData.html_prepend?h.jsx("span",{dangerouslySetInnerHTML:{__html:this.state.rxData.html_prepend}},"prepend"):null,this.state.rxData.html?h.jsx("span",{dangerouslySetInnerHTML:{__html:this.state.rxData.html}},"content"):this.state.rxData.no_style||this.state.rxData.jquery_style?h.jsxs("button",{className:this.state.rxData.nav_view&&this.state.rxData.nav_view===window.location.hash.slice(1)?"ui-state-active":void 0,ref:this.refButton,type:"button",style:s,onClick:()=>this.onClick(),children:[r,a]},"content"):h.jsxs(k.Button,{ref:this.refButton,style:s,color:this.state.rxData.nav_view&&this.state.rxData.nav_view===window.location.hash.slice(1)?this.state.rxData.color==="primary"?"secondary":"primary":this.state.rxData.color||"grey",variant:this.state.rxData.variant===void 0?"contained":this.state.rxData.variant,onClick:()=>this.onClick(),children:[r,a]},"content"),this.state.rxData.html_append?h.jsx("span",{dangerouslySetInnerHTML:{__html:this.state.rxData.html_append}},"append"):null],h.jsxs("div",{className:"vis-widget-body",onClick:this.state.rxData.html?()=>this.onClick():void 0,children:[l,this.renderDialog(),this.renderPasswordDialog()]})}}class Fa extends fe{static getWidgetInfo(){const t={id:"tplJquiButtonLinkBlank",visSet:"jqui",visName:"Button Link",visWidgetLabel:"jqui_button_link_blank",visPrev:"widgets/jqui/img/Prev_ButtonLinkBlank.png",visOrder:2,visAttrs:fe.getWidgetInfo().visAttrs};t.visAttrs[0].fields.unshift({name:"_note",type:"help",text:"jqui_button_link_blank_note"});const n=fe.findField(t,"target");n.default="_blank";const r=fe.findField(t,"visResizable");r.default=!1;const s=fe.findField(t,"buttontext");return s.default="URL Browser",t}getWidgetInfo(){return Fa.getWidgetInfo()}}class La extends fe{static getWidgetInfo(){const t={id:"tplIconLink",visSet:"jqui",visName:"Button Link",visWidgetLabel:"jqui_icon_link",visPrev:"widgets/jqui/img/Prev_IconLink.png",visOrder:3,visAttrs:fe.getWidgetInfo().visAttrs};t.visAttrs[0].fields.unshift({name:"_note",type:"help",text:"jqui_button_link_blank_note"});const n=fe.findField(t,"target");n.default="_blank";const r=fe.findField(t,"visResizable");return r.default=!0,t}getWidgetInfo(){return La.getWidgetInfo()}}class ji extends xe{iterateInterval=null;iterateTimeout=null;constructor(e){super(e),Object.assign(this.state,{value:"",valueType:null})}static getWidgetInfo(){return{id:"tplIconState",visSet:"jqui",visName:"Icon State",visWidgetLabel:"jqui_write_value",visPrev:"widgets/jqui/img/Prev_WriteState.png",visOrder:26,visAttrs:[{name:"common",fields:[{name:"oid",type:"id",onChange:async(e,t,n,r)=>{var s,o,a,l,c,u;if(t.oid&&t.oid!=="nothing_selected"){const p=await r.getObject(t.oid);let d=!1;((s=p==null?void 0:p.common)==null?void 0:s.min)!==void 0&&((o=p==null?void 0:p.common)==null?void 0:o.min)!==null&&t.min!==p.common.min&&(t.min=p.common.min,d=!0),((a=p==null?void 0:p.common)==null?void 0:a.max)!==void 0&&((l=p==null?void 0:p.common)==null?void 0:l.max)!==null&&(t.max!==p.common.max&&(t.max=p.common.max,d=!0),t.step>0?t.minmax!==p.common.max&&(t.minmax=p.common.max,d=!0):t.minmax!==p.common.min&&(t.minmax=p.common.min,d=!0)),t.step||((c=p==null?void 0:p.common)==null?void 0:c.step)!==void 0&&((u=p==null?void 0:p.common)==null?void 0:u.step)!==null&&t.step!==p.common.step&&(t.step=p.common.step,d=!0),d&&n(t)}}},{name:"click_id",type:"id",noSubscribe:!0},{name:"type",label:"jqui_type",type:"select",default:"value",options:[{value:"value",label:"jqui_from_value"},{value:"oid",label:"jqui_from_oid"},{value:"toggle",label:"jqui_toggle"},{value:"change",label:"jqui_increment_decrement"}]},{name:"value_oid",type:"id",hidden:e=>e.type!=="oid"},{name:"value",type:"text",hidden:e=>e.type!=="value"},{name:"step",type:"number",hidden:e=>e.type!=="change",default:1},{name:"minmax",label:"jqui_max",type:"number",hidden:e=>e.type!=="change"||(parseFloat(e.step)||0)<0,default:1},{name:"minmax",label:"jqui_min",type:"number",hidden:e=>e.type!=="change"||(parseFloat(e.step)||0)>=0,default:1},{name:"repeat_delay",type:"number",label:"jqui_repeat_delay",hidden:e=>e.type!=="change",default:800},{name:"repeat_interval",type:"number",label:"jqui_repeat_interval",hidden:e=>e.type!=="change",default:300},{name:"min",type:"number",label:"jqui_min",hidden:e=>e.type!=="toggle",default:0},{name:"max",label:"jqui_max",type:"number",hidden:e=>e.type!=="toggle",default:100}]},{name:"style",fields:[{name:"variant",label:"jqui_variant",type:"select",noTranslation:!0,options:["contained","outlined","standard"],default:"contained"},{name:"text",type:"text",default:N.I18n.t("jqui_Write state")},{name:"src",type:"image",label:"jqui_image",hidden:e=>!!e.icon},{name:"icon",type:"icon64",label:"jqui_icon",hidden:e=>!!e.src},{name:"text_active",label:"jqui_text_active",type:"text"},{name:"src_active",type:"image",label:"jqui_image_active",hidden:e=>!!e.icon_active},{name:"icon_active",type:"icon64",label:"jqui_icon_active",hidden:e=>!!e.src_active},{name:"invert_icon",type:"checkbox",hidden:e=>!e.icon||!e.src},{name:"invert_icon_active",type:"checkbox",hidden:e=>!e.icon_active||!e.src_active}]}],visDefaultStyle:{width:100,height:40}}}async componentDidMount(){if(super.componentDidMount(),this.state.rxData.oid&&this.state.rxData.oid!=="nothing_selected")try{const e=await this.props.context.socket.getState(this.state.rxData.oid);this.onStateUpdated(this.state.rxData.oid,e)}catch(e){console.error(`Cannot get state ${this.state.rxData.oid}: ${e}`)}}static findField(e,t){return xe.findField(e,t)}getWidgetInfo(){return ji.getWidgetInfo()}onStateUpdated(e,t){if(e===this.state.rxData.oid&&t){const n=t.val===null||t.val===void 0?"":t.val;this.state.value!==n.toString()&&this.setState({value:n.toString()})}}getControlOid(){return this.state.rxData.click_id&&this.state.rxData.click_id!=="nothing_selected"?this.state.rxData.click_id:this.state.rxData.oid&&this.state.rxData.oid!=="nothing_selected"?this.state.rxData.oid:""}onClick(){if(this.props.editMode)return;let e;switch(this.state.rxData.type){case"value":e=this.state.rxData.value.toString();break;case"oid":{if(e=this.state.values[`${this.state.rxData.value_oid}.val`],e==null)return;break}case"toggle":e=parseFloat(this.state.values[`${this.state.rxData.oid}.val`])||0,e=e.toString()===(this.state.rxData.max||0).toString()?this.state.rxData.min:this.state.rxData.max;break;case"change":e=parseFloat(this.state.values[`${this.state.rxData.oid}.val`])||0,e+=parseFloat(this.state.rxData.step)||0,this.state.rxData.step>0?e>parseFloat(this.state.rxData.minmax)&&(e=parseFloat(this.state.rxData.minmax)):e<parseFloat(this.state.rxData.minmax)&&(e=parseFloat(this.state.rxData.minmax));break;default:return}const t=this.getControlOid();t&&(this.state.valueType==="number"?this.props.context.setValue(t,parseFloat(e)):this.props.context.setValue(t,e)),this.setState({value:e})}renderIcon(e){let t,n=null;e&&(n=this.state.rxData.invert_icon_active,t=this.state.rxData.icon_active||this.state.rxData.src_active),t||(t=this.state.rxData.icon||this.state.rxData.src,n=this.state.rxData.invert_icon);const r=this.state.rxStyle.color;return t?(t.startsWith("_PRJ_NAME/")&&(t=t.replace("_PRJ_NAME/",`../${this.props.context.adapterName}.${this.props.context.instance}/${this.props.context.projectName}/`)),h.jsx(N.Icon,{style:{color:r,filter:n?"invert(100%)":void 0,width:"100%",height:"100%"},src:t},"icon")):null}renderText(){let e=this.state.rxData.text;const t=this.state.rxStyle.color;return e||(this.state.rxData.type==="oid"?e=this.state.values[`${this.state.rxData.value_oid}.val`]:this.state.rxData.type==="value"?e=this.state.rxData.value:this.state.rxData.type==="change"&&(this.state.rxData.step>0?e=`+${this.state.rxData.step}`:e=this.state.rxData.step.toString())),e?h.jsx("span",{style:{color:t},children:e}):null}getIsActive(){let e=this.state.value;switch(e==null&&(e=""),this.state.rxData.type){case"value":{let t=this.state.rxData.value;return t==null&&(t=""),e.toString()===t.toString()}case"oid":{let t=this.state.values[`${this.state.rxData.value_oid}.val`];return t==null&&(t=""),e.toString()===t.toString()}case"toggle":return e.toString()===(this.state.rxData.max||0).toString();default:return!1}}componentWillUnmount(){super.componentWillUnmount(),this.iterateInterval&&clearInterval(this.iterateInterval),this.iterateInterval=null,this.iterateTimeout&&clearTimeout(this.iterateTimeout),this.iterateTimeout=null}renderWidgetBody(e){super.renderWidgetBody(e);const t=this.getIsActive(),n={};Object.keys(this.state.rxStyle).forEach(a=>{const l=this.state.rxStyle[a];l!=null&&xe.POSSIBLE_MUI_STYLES.includes(a)&&(a=a.replace(/(-\w)/g,c=>c[1].toUpperCase()),n[a]=l)}),n.borderWidth&&(n.borderWidth=Se.correctStylePxValue(n.borderWidth)),n.fontSize&&(n.fontSize=Se.correctStylePxValue(n.fontSize));const r=this.renderText();n.width="100%",n.height="100%",n.minWidth="unset";const s=t?"primary":"grey",o=h.jsx(k.Button,{style:n,color:s,startIcon:r?this.renderIcon(t):null,onClick:()=>this.onClick(),onMouseDown:()=>{if(this.props.editMode)return;const a=parseInt(this.state.rxData.repeat_delay,10);a&&(this.iterateTimeout&&clearTimeout(this.iterateTimeout),this.iterateTimeout=setTimeout(()=>{this.iterateTimeout=null,this.iterateInterval&&clearInterval(this.iterateInterval),this.iterateInterval=setInterval(()=>this.onClick(),parseInt(this.state.rxData.repeat_interval,10)||500),this.onClick()},a))},onMouseUp:()=>{this.props.editMode||(this.iterateInterval&&clearInterval(this.iterateInterval),this.iterateInterval=null,this.iterateTimeout&&clearTimeout(this.iterateTimeout),this.iterateTimeout=null)},variant:this.state.rxData.variant||"contained",children:r||this.renderIcon(t)});return h.jsx("div",{className:"vis-widget-body",children:o})}}class Ba extends ji{static getWidgetInfo(){const t={id:"tplIconInc",visSet:"jqui",visName:"Icon Increment",visWidgetLabel:"jqui_icon_increment",visPrev:"widgets/jqui/img/Prev_IconInc.png",visOrder:27,visAttrs:ji.getWidgetInfo().visAttrs};t.visAttrs[0].fields.unshift({name:"_note",type:"help",text:"jqui_write_state_note"});const n=ji.findField(t,"type");return n.default="change",t}getWidgetInfo(){return Ba.getWidgetInfo()}}class Va extends fe{static getWidgetInfo(){const t={id:"tplIconHttpGet",visSet:"jqui",visName:"Icon HTTP GET",visWidgetLabel:"jqui_icon_http_get",visPrev:"widgets/jqui/img/Prev_IconHttpGet.png",visOrder:4,visAttrs:fe.getWidgetInfo().visAttrs};t.visAttrs[0].fields.unshift({name:"_note",type:"help",text:"jqui_button_link_blank_note"});const n=fe.findField(t,"url");n.default="http://";const r=fe.findField(t,"buttontext");r.default="URL Backend";const s=fe.findField(t,"visResizable");return s.default=!0,t}getWidgetInfo(){return Va.getWidgetInfo()}}class za extends fe{static getWidgetInfo(){const t={id:"tplJquiDialog",visSet:"jqui",visName:"HTML - Dialog",visWidgetLabel:"jqui_html_dialog",visPrev:"widgets/jqui/img/Prev_JquiDialog.png",visOrder:5,visAttrs:fe.getWidgetInfo().visAttrs};t.visAttrs[0].fields.unshift({name:"_note",type:"help",text:"jqui_button_link_blank_note"});const n=fe.findField(t,"visResizable");n.default=!0;const r=fe.findField(t,"html");r.default="<div>HTML</div>";const s=fe.findField(t,"buttontext");delete s.default;const o=fe.findField(t,"html_dialog");return o.default="<div>HTML Dialog</div>",t.visDefaultStyle={"border-width":"1px","border-style":"solid","border-color":"#000",width:"200px",height:"130px",cursor:"pointer"},t}getWidgetInfo(){return za.getWidgetInfo()}}class Ha extends fe{static getWidgetInfo(){const t={id:"tplJquiIconDialog",visSet:"jqui",visName:"Icon - Dialog",visWidgetLabel:"jqui_icon_dialog",visPrev:"widgets/jqui/img/Prev_JquiIconDialog.png",visOrder:6,visAttrs:fe.getWidgetInfo().visAttrs};t.visAttrs[0].fields.unshift({name:"_note",type:"help",text:"jqui_button_link_blank_note"});const n=fe.findField(t,"visResizable");n.default=!0;const r=fe.findField(t,"buttontext");r.default="Icon Dialog";const s=fe.findField(t,"html_dialog");return s.default="<div>HTML Dialog</div>",t}getWidgetInfo(){return Ha.getWidgetInfo()}}class qa extends fe{static getWidgetInfo(){const t={id:"tplContainerDialog",visSet:"jqui",visName:"container - HTML - view in jqui Dialog",visWidgetLabel:"jqui_container_dialog",visPrev:"widgets/jqui/img/Prev_ContainerDialog.png",visOrder:7,visAttrs:fe.getWidgetInfo().visAttrs};t.visAttrs[0].fields.unshift({name:"_note",type:"help",text:"jqui_button_link_blank_note"});const n=fe.findField(t,"visResizable");n.default=!0;const r=fe.findField(t,"buttontext");r.default="Container Dialog";const s=fe.findField(t,"html_dialog");return s.default="<div>HTML Dialog</div>",t}getWidgetInfo(){return qa.getWidgetInfo()}}class Ua extends fe{static getWidgetInfo(){const t={id:"tplJquiButtonNav",visSet:"jqui",visName:"Navigation Button",visWidgetLabel:"jqui_navigation_button",visPrev:"widgets/jqui/img/Prev_ButtonNav.png",visOrder:8,visAttrs:fe.getWidgetInfo().visAttrs};t.visAttrs[0].fields.unshift({name:"_note",type:"help",text:"jqui_button_nav_blank_note"});const n=fe.findField(t,"modal");delete n.default;const r=fe.findField(t,"nav_view");r.default="";const s=fe.findField(t,"buttontext");s.default="View";const o=fe.findField(t,"visResizable");return o.default=!0,t}getWidgetInfo(){return Ua.getWidgetInfo()}}class Ya extends fe{static getWidgetInfo(){const t={id:"tplJquiIconNav",visSet:"jqui",visName:"Navigation Icon",visWidgetLabel:"jqui_navigation_icon",visPrev:"widgets/jqui/img/Prev_IconNav.png",visOrder:9,visAttrs:fe.getWidgetInfo().visAttrs};t.visAttrs[0].fields.unshift({name:"_note",type:"help",text:"jqui_button_nav_blank_note"});const n=fe.findField(t,"buttontext");delete n.default;const r=fe.findField(t,"modal");delete r.default;const s=fe.findField(t,"nav_view");s.default="";const o=fe.findField(t,"icon");o.default="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBmaWxsPSJjdXJyZW50Q29sb3IiIGQ9Ik0yMSAzTDMgMTAuNTN2Ljk4bDYuODQgMi42NUwxMi40OCAyMWguOThMMjEgM3oiLz48L3N2Zz4=";const a=fe.findField(t,"visResizable");return a.default=!0,t}getWidgetInfo(){return Ya.getWidgetInfo()}}class Ga extends fe{static getWidgetInfo(){const t={id:"tplJquiNavPw",visSet:"jqui",visName:"Navigation with password",visWidgetLabel:"jqui_navigation_password",visPrev:"widgets/jqui/img/Prev_ButtonNavPw.png",visOrder:10,visAttrs:fe.getWidgetInfo().visAttrs};t.visAttrs[0].fields.unshift({name:"_note",type:"help",text:"jqui_button_nav_blank_note"});const n=fe.findField(t,"modal");delete n.default;const r=fe.findField(t,"buttontext");r.default="Password";const s=fe.findField(t,"nav_view");s.default="";const o=fe.findField(t,"Password");o.default="";const a=fe.findField(t,"visResizable");return a.default=!0,t}getWidgetInfo(){return Ga.getWidgetInfo()}}class Ja extends fe{static getWidgetInfo(){const t={id:"tplContainerDialogExternal",visSet:"jqui",visName:"External Dialog",visWidgetLabel:"jqui_html_external_dialog",visPrev:"widgets/jqui/img/Prev_JquiExternalDialog.png",visOrder:11,visAttrs:fe.getWidgetInfo().visAttrs};t.visAttrs[0].fields.unshift({name:"_note",type:"help",text:"jqui_button_link_blank_note"});const n=fe.findField(t,"externalDialog");n.default=!0;const r=fe.findField(t,"html_dialog");return r.default="<div>HTML Dialog</div>",t}getWidgetInfo(){return Ja.getWidgetInfo()}}class Ka extends xe{constructor(e){super(e),this.state.width=0,this.state.height=0}static getWidgetInfo(){return{id:"tplJquiButtonDialogClose",visSet:"jqui",visName:"Button dialog close",visWidgetLabel:"jqui_button_dialog_close",visPrev:"widgets/jqui/img/Prev_ButtonDialogClose.png",visOrder:13,visAttrs:[{name:"common",fields:[{label:"jqui_dialog_name",tooltip:"jqui_dialog_name_tooltip",type:"custom",component:(e,t,n,r)=>{const s=[];return Object.keys(r.context.views).forEach(o=>{const a=r.context.views[o].widgets;a&&Object.keys(a).forEach(l=>{var c,u,p;((c=a[l].data)!=null&&c.html_dialog||(u=a[l].data)!=null&&u.contains_view||(p=a[l].data)!=null&&p.externalDialog)&&(a[l].data.dialogName?s.push({label:`${a[l].data.dialogName} (${l})`,value:a[l].data.dialogName}):s.push({label:l,value:l}))})}),h.jsx(k.Autocomplete,{freeSolo:!0,options:s,value:t.dlgName||"",sx:{width:"100%"},onInputChange:(o,a)=>{typeof a=="object"&&a!==null&&(a=a.value),n({dlgName:a})},onChange:(o,a)=>{typeof a=="object"&&a!==null&&(a=a.value),n({dlgName:a})},getOptionLabel:o=>typeof o=="string"?o:o.label,renderInput:o=>h.jsx(k.TextField,{variant:"standard",...o})})}},{name:"buttontext",type:"text",default:N.I18n.t("jqui_Close").replace("jqui_",""),hidden:e=>!!e.html},{name:"html",type:"html",default:"",tooltip:"jqui_html_tooltip",disabled:e=>!!e.buttontext||!!e.icon||!!e.src}]},{name:"style",hidden:e=>!!e.externalDialog,fields:[{name:"no_style",type:"checkbox",hidden:e=>e.jquery_style},{name:"jquery_style",label:"jqui_jquery_style",type:"checkbox",hidden:e=>e.no_style},{name:"padding",type:"slider",min:0,max:100,default:5},{name:"variant",label:"jqui_variant",type:"select",noTranslation:!0,options:["contained","outlined","standard"],default:"contained",hidden:e=>e.jquery_style||e.no_style},{name:"color",label:"jqui_button_color",type:"select",noTranslation:!0,options:["","primary","secondary"],default:"",hidden:e=>e.jquery_style||e.no_style},{name:"html_prepend",type:"html"},{name:"html_append",type:"html"},{name:"visResizable",label:"visResizable",type:"checkbox",default:!1,desiredSize:!1}]},{name:"icon",hidden:e=>!!e.html,fields:[{name:"src",label:"jqui_image",type:"image",hidden:e=>e.icon||e.jquery_style},{name:"icon",label:"jqui_icon",type:"icon64",default:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBmaWxsPSJjdXJyZW50Q29sb3IiIGQ9Ik0xOSA2LjQxTDE3LjU5IDVMMTIgMTAuNTlMNi40MSA1TDUgNi40MUwxMC41OSAxMkw1IDE3LjU5TDYuNDEgMTlMMTIgMTMuNDFMMTcuNTkgMTlMMTkgMTcuNTlMMTMuNDEgMTJ6Ii8+PC9zdmc+",hidden:e=>e.src||e.jquery_style},{name:"invert_icon",type:"checkbox",hidden:e=>(!e.icon||!e.image)&&e.jquery_style},{name:"imageHeight",type:"slider",min:0,max:200,default:100,hidden:e=>!e.src||e.jquery_style}]}]}}getWidgetInfo(){return Ka.getWidgetInfo()}onClick(){var t;let e=this.state.rxData.dlgName;if(!e){const n=Object.keys(this.props.context.views);for(let r=0;r<n.length;r++){const s=this.props.context.views[n[r]].widgets;if(s){const o=Object.keys(s);for(let a=0;a<o.length;a++)if(((t=s[o[a]].data)==null?void 0:t.contains_view)===this.props.view){e=o[a];break}}if(e)break}}if(e){const n=window.document.getElementById(e)||window.document.querySelector(`[data-dialog-name="${e}"]`),r=Object.keys(this.props.context.views).find(s=>this.props.context.views[s].widgets[e]);this.props.context.onCommand("closeDialog",r,e),n!=null&&n._showDialog?n._showDialog(!1):window.jQuery(`#${e}_dialog`).dialog("close")}else window.alert("Dialog not found")}renderWidgetBody(e){super.renderWidgetBody(e);const t={filter:this.state.rxData.invert_icon?"invert(1)":void 0};!this.state.rxData.jquery_style&&this.state.rxData.src&&(this.state.width>this.state.height?(t.height=`${this.state.rxData.imageHeight||100}%`,t.width="auto"):(t.width=`${this.state.rxData.imageHeight||100}%`,t.height="auto"));let n=!this.state.rxData.jquery_style&&(this.state.rxData.src||this.state.rxData.icon);n&&n.startsWith("_PRJ_NAME/")&&(n=n.replace("_PRJ_NAME/",`../${this.props.context.adapterName}.${this.props.context.instance}/${this.props.context.projectName}/`));const r=n?h.jsx(N.Icon,{src:n,style:t}):null,s={};Object.keys(this.state.rxStyle).forEach(l=>{const c=this.state.rxStyle[l];c!=null&&xe.POSSIBLE_MUI_STYLES.includes(l)&&(l=l.replace(/(-\w)/g,u=>u[1].toUpperCase()),s[l]=c)}),s.minWidth="unset",s.borderWidth&&(s.borderWidth=Se.correctStylePxValue(s.borderWidth)),s.fontSize&&(s.fontSize=Se.correctStylePxValue(s.fontSize)),this.state.data.visResizable?(s.width="100%",s.height="100%"):s.padding=this.state.rxData.padding;let o;this.state.rxData.html||(o=this.state.rxData.buttontext);const a=[this.state.rxData.html_prepend?h.jsx("span",{dangerouslySetInnerHTML:{__html:this.state.rxData.html_prepend}},"prepend"):null,this.state.rxData.html?h.jsx("span",{dangerouslySetInnerHTML:{__html:this.state.rxData.html}},"content"):this.state.rxData.no_style||this.state.rxData.jquery_style?h.jsxs("button",{type:"button",style:s,onClick:()=>this.onClick(),children:[r,o]},"content"):o?h.jsx(k.Button,{style:s,color:this.state.rxData.color||"grey",variant:this.state.rxData.variant===void 0?"contained":this.state.rxData.variant,onClick:()=>this.onClick(),startIcon:r,children:o},"content"):h.jsx(k.Fab,{style:{zIndex:this.props.editMode?0:void 0},color:this.state.rxData.color||"grey",onClick:()=>this.onClick(),size:"small",children:r},"content"),this.state.rxData.html_append?h.jsx("span",{dangerouslySetInnerHTML:{__html:this.state.rxData.html_append}},"append"):null];return h.jsx("div",{className:"vis-widget-body",onClick:this.state.rxData.html?()=>this.onClick():void 0,children:a})}}class Xa extends fe{static getWidgetInfo(){const t={id:"tplContainerButtonDialog",visSet:"jqui",visName:"container - Button - view in jqui Dialog",visWidgetLabel:"jqui_container_button_dialog",visPrev:"widgets/jqui/img/Prev_ContainerButtonDialog.png",visOrder:11,visAttrs:fe.getWidgetInfo().visAttrs};t.visAttrs[0].fields.unshift({name:"_note",type:"help",text:"jqui_button_link_blank_note"});const n=fe.findField(t,"buttontext");n.default="Container Dialog";const r=fe.findField(t,"contains_view");return r.default="",t}getWidgetInfo(){return Xa.getWidgetInfo()}}class Za extends fe{static getWidgetInfo(){const t={id:"tplContainerIconDialog",visSet:"jqui",visName:"container - Icon - view in jqui Dialog",visWidgetLabel:"jqui_container_icon_dialog",visPrev:"widgets/jqui/img/Prev_ContainerIconDialog.png",visOrder:12,visAttrs:fe.getWidgetInfo().visAttrs};t.visAttrs[0].fields.unshift({name:"_note",type:"help",text:"jqui_button_link_blank_note"});const n=fe.findField(t,"visResizable");n.default=!0;const r=fe.findField(t,"icon");r.default="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBmaWxsPSJjdXJyZW50Q29sb3IiIGQ9Ik0xOSAxOUg1VjVoN1YzSDVhMiAyIDAgMCAwLTIgMnYxNGEyIDIgMCAwIDAgMiAyaDE0YzEuMSAwIDItLjkgMi0ydi03aC0ydjd6TTE0IDN2MmgzLjU5bC05LjgzIDkuODNsMS40MSAxLjQxTDE5IDYuNDFWMTBoMlYzaC03eiIvPjwvc3ZnPg==";const s=fe.findField(t,"buttontext");delete s.default;const o=fe.findField(t,"contains_view");return o.default="",t}getWidgetInfo(){return Za.getWidgetInfo()}}class hi extends xe{focused=!1;inputRef;jQueryDone=!1;object=null;constructor(e){super(e),Object.assign(this.state,{input:""}),this.inputRef=ve.createRef()}static getWidgetInfo(){return{id:"tplJquiInput",visSet:"jqui",visName:"Input",visWidgetLabel:"jqui_input",visPrev:"widgets/jqui/img/Prev_Input.png",visOrder:13,visAttrs:[{name:"common",fields:[{name:"label",type:"text",default:N.I18n.t("jqui_input").replace("jqui_","")},{name:"oid",type:"id",onChange:async(e,t,n,r)=>{var s,o,a;if(t.oid&&t.oid!=="nothing_selected"){const l=await r.getObject(t.oid);let c=!1;(s=l==null?void 0:l.common)!=null&&s.unit&&t.unit!==l.common.unit&&(t.unit=l.common.unit,c=!0),((o=l==null?void 0:l.common)==null?void 0:o.type)!=="number"?t.asString||(t.asString=!0,c=!0):((a=l==null?void 0:l.common)==null?void 0:a.type)==="number"&&t.asString&&(t.asString=!1,c=!0),c&&n(t)}}},{name:"asString",type:"checkbox",label:"jqui_as_string"},{name:"autoFocus",type:"checkbox"},{name:"readOnly",type:"checkbox",label:"jqui_read_only"},{name:"withEnter",type:"checkbox",label:"jqui_with_enter_button",hidden:"!!data.readOnly"},{name:"buttontext",type:"text",label:"jqui_button_text",hidden:"!data.withEnter || !!data.readOnly"},{name:"selectAllOnFocus",type:"checkbox",label:"jqui_select_all_on_focus",tooltip:"jqui_select_all_on_focus_tooltip"},{name:"unit",type:"text",label:"jqui_unit"}]},{name:"style",fields:[{name:"no_style",type:"checkbox",hidden:e=>e.jquery_style},{name:"jquery_style",label:"jqui_jquery_style",type:"checkbox",hidden:e=>e.no_style},{name:"variant",label:"jqui_variant",type:"select",noTranslation:!0,options:["filled","outlined","standard"],default:"standard",hidden:e=>e.jquery_style||e.no_style},{name:"size",type:"slider",min:4,max:100,default:10,hidden:e=>!e.no_style}]}]}}getWidgetInfo(){return hi.getWidgetInfo()}static findField(e,t){return xe.findField(e,t)}async componentDidMount(){super.componentDidMount();try{const e=await this.props.context.socket.getState(this.state.rxData.oid);e&&e.val!==void 0&&e.val!==null&&(e.val=e.val.toString(),this.setState({input:e.val}))}catch(e){console.error(`Cannot get state ${this.state.rxData.oid}: ${e}`)}this.inputRef.current&&this.state.rxData.autoFocus&&!this.props.editMode&&(this.state.rxData.jquery_style||this.state.rxData.no_style)&&setTimeout(()=>this.inputRef.current.focus(),100)}onStateUpdated(e,t){super.onStateUpdated(e,t),(t!=null&&t.val||(t==null?void 0:t.val)===0)&&e===this.state.rxData.oid&&!this.focused&&t.val.toString()!==this.state.input.toString()&&this.setState({input:t.val})}componentDidUpdate(){this.inputRef.current&&this.state.rxData.jquery_style&&!this.jQueryDone&&(this.jQueryDone=!0,window.jQuery(this.inputRef.current).button().addClass("ui-state-default"))}async setValue(e){var t,n,r;if(!(((t=this.object)==null?void 0:t._id)!==this.state.rxData.oid&&(this.object=await this.props.context.socket.getObject(this.state.rxData.oid),!this.object)))if(((r=(n=this.object)==null?void 0:n.common)==null?void 0:r.type)==="number"){let s=parseFloat(e.replace(",","."));Number.isNaN(e)&&(s=0),this.props.context.setValue(this.state.rxData.oid,s)}else this.props.context.setValue(this.state.rxData.oid,e)}onChange(e){this.setState({input:e}),this.state.rxData.withEnter||this.setValue(e)}renderWidgetBody(e){super.renderWidgetBody(e),e.style.overflow="visible";let t;const n=this.state.rxData.label;return!this.state.rxData.jquery_style&&!this.state.rxData.no_style?t=h.jsx(k.TextField,{fullWidth:!0,value:this.state.input===null||this.state.input===void 0?"":this.state.rxData.asString?this.state.input.toString():this.state.input,type:this.state.rxData.asString?"text":"number",onFocus:r=>{this.focused=!0,this.state.rxData.selectAllOnFocus&&r.target.select()},onBlur:()=>this.focused=!1,autoFocus:!this.props.editMode&&this.state.rxData.autoFocus,variant:this.state.rxData.variant===void 0?"standard":this.state.rxData.variant,slotProps:{htmlInput:{readOnly:this.state.rxData.readOnly},input:{endAdornment:this.state.rxData.withEnter&&!this.state.rxData.readOnly?h.jsx(k.InputAdornment,{position:"end",children:this.state.rxData.buttontext?h.jsx(k.Button,{onClick:()=>this.setValue(this.state.input),variant:"contained",style:{marginBottom:10,minWidth:40},children:this.state.rxData.buttontext}):h.jsx(k.IconButton,{onClick:()=>this.setValue(this.state.input),edge:"end",children:h.jsx(be.KeyboardReturn,{})})}):void 0,startAdornment:this.state.rxData.unit?h.jsx(k.InputAdornment,{position:"start",children:this.state.rxData.unit}):void 0}},label:n,onChange:r=>this.onChange(r.target.value)}):t=[h.jsx("div",{style:{marginRight:8},children:n},"label"),h.jsx("input",{style:{flexGrow:1},readOnly:this.state.rxData.readOnly,value:this.state.input||"",ref:this.inputRef,size:this.state.rxData.size||10,onFocus:r=>{this.focused=!0,this.state.rxData.selectAllOnFocus&&r.target.select()},onBlur:()=>this.focused=!1,onChange:r=>this.onChange(r.target.value)},"input"),this.state.rxData.withEnter&&!this.state.rxData.readOnly?h.jsx(k.IconButton,{style:{marginRight:5},onClick:()=>this.setValue(this.state.input),edge:"end",children:h.jsx(be.KeyboardReturn,{})},"button"):void 0],h.jsx("div",{className:"vis-widget-body",style:{display:"flex",alignItems:"center"},children:t})}}class Qa extends hi{static getWidgetInfo(){const t={id:"tplJquiInputSet",visSet:"jqui",visName:"Input + Button",visWidgetLabel:"jqui_input_with_button",visPrev:"widgets/jqui/img/Prev_InputWithButton.png",visOrder:14,visAttrs:hi.getWidgetInfo().visAttrs,visDefaultStyle:{width:150,height:45}};t.visAttrs[0].fields.unshift({name:"_note",type:"help",text:"jqui_button_input_note"});const n=hi.findField(t,"withEnter");n&&(n.default=!0);const r=hi.findField(t,"buttontext");return r&&(r.default="OK"),t}getWidgetInfo(){return Qa.getWidgetInfo()}}class Ze extends xe{textsLengthCache={};constructor(e){super(e),Object.assign(this.state,{isOn:!1,height:0,width:0})}static getWidgetInfo(){return{id:"tplJquiBool",visSet:"jqui",visName:"Html Bool",visWidgetLabel:"jqui_binary_control",visPrev:"widgets/jqui/img/Prev_BinaryControl.png",visOrder:14,visAttrs:[{name:"common",fields:[{name:"type",label:"jqui_type",type:"select",noTranslation:!0,default:"button",options:["button","round-button","html","radio","checkbox","image","switch"]},{name:"oid",type:"id"},{name:"readOnly",type:"checkbox"},{name:"pushMode",type:"checkbox",label:"jqui_push_mode",tooltip:"jqui_push_mode_tooltip",hidden:e=>e.type!=="button"&&e.type!=="round-button"&&e.type!=="image"},{name:"click_id",type:"id",noSubscribe:!0,hidden:e=>!!e.readOnly},{name:"invert",label:"jqui_inverted",type:"checkbox"},{name:"test",type:"select",label:"jqui_test",options:[{value:"",label:"none"},{value:!0,label:"jqui_true"},{value:!1,label:"jqui_false"}]}]},{name:"html",label:"jqui_html",hidden:e=>e.type!=="html",fields:[{name:"html_true",type:"html",label:"jqui_html_true"},{name:"html_false",type:"html",label:"jqui_html_false"}]},{name:"text",label:"group_text",fields:[{name:"text_false",type:"text",label:"text_false",default:N.I18n.t("jqui_off").replace("jqui_",""),hidden:e=>e.type==="image"||e.type==="html"},{name:"text_true",type:"text",label:"text_true",default:N.I18n.t("jqui_on").replace("jqui_",""),hidden:e=>e.type==="image"||e.type==="html"||e.type==="round-button"},{name:"color_false",type:"color",label:"color_false",hidden:e=>e.type==="image"||e.type==="html"||!e.text_false},{name:"color_true",type:"color",label:"color_true",hidden:e=>e.type==="image"||e.type==="html"||!e.text_true},{name:"alt_false",type:"text",label:"alt_false"},{name:"alt_true",type:"text",label:"alt_true"},{name:"equal_text_length",type:"checkbox",label:"jqui_equal_text_length",tooltip:"jqui_equal_text_length_tooltip",hidden:e=>!e.text_true||!e.text_false}]},{name:"style",fields:[{name:"jquery_style",label:"jqui_jquery_style",type:"checkbox",hidden:e=>e.type!=="button"},{name:"padding",type:"slider",min:0,max:100,default:5},{name:"variant",label:"jqui_variant",type:"select",noTranslation:!0,options:["contained","outlined","standard"],default:"contained",hidden:e=>e.type!=="button"&&e.type!=="radio"},{name:"orientation",label:"jqui_orientation",type:"select",noTranslation:!0,options:["horizontal","vertical"],default:"horizontal",hidden:e=>e.type!=="radio"},{name:"notEqualLength",label:"jqui_not_equal_length",type:"checkbox",hidden:e=>e.type!=="radio"||e.orientation!=="horizontal"},{name:"html_prepend",type:"html"},{name:"html_append",type:"html"}]},{name:"icon_false",label:"group_icon_false",fields:[{name:"src_false",label:"jqui_image",type:"image",hidden:e=>e.icon_false},{name:"icon_false",label:"jqui_icon",type:"icon64",hidden:e=>e.src_false},{name:"icon_color_false",label:"jqui_color",type:"color",hidden:e=>!e.icon_false},{name:"invert_icon_false",label:"jqui_invert_icon",type:"checkbox",hidden:e=>!e.src_false&&!e.icon_false},{name:"imageHeight_false",label:"jqui_image_height",type:"slider",min:0,max:200,hidden:e=>!e.src_false&&!e.icon_false}]},{name:"icon_true",label:"group_icon_true",fields:[{name:"src_true",label:"jqui_image",type:"image",hidden:e=>e.icon_true},{name:"icon_true",label:"jqui_icon",type:"icon64",hidden:e=>e.src_true},{name:"icon_color_true",label:"jqui_color",type:"color",hidden:e=>!e.icon_true&&!e.icon_false},{name:"invert_icon_true",label:"jqui_invert_icon",type:"checkbox",hidden:e=>!e.src_true&&!e.icon_true},{name:"imageHeight_true",label:"jqui_image_height",type:"slider",min:0,max:200,hidden:e=>!e.src_true&&!e.icon_true}]}]}}async componentDidMount(){if(super.componentDidMount(),(this.props.tpl==="tplIconStateBool"||this.props.tpl==="tplIconStatePushButton")&&(this.state.data.false_text||this.state.data.true_text)){const e=JSON.parse(JSON.stringify(this.state.data));e.text_false=e.false_text,e.text_true=e.true_text,e.src_false=e.false_src,e.src_true=e.true_src,e.alt_false=e.false_alt,e.alt_true=e.true_alt,e.invert_icon_false=e.invert_icon,e.invert_icon_true=e.invert_icon,this.props.tpl==="tplIconStatePushButton"&&(e.pushMode=!0),e.false_text=null,e.true_text=null,this.props.context.onWidgetsChanged&&setTimeout(()=>this.props.context.onWidgetsChanged([{wid:this.props.id,view:this.props.view,data:e}]),100)}if(this.state.rxData.oid&&this.state.rxData.oid!=="nothing_selected")try{const e=await this.props.context.socket.getState(this.state.rxData.oid);this.onStateUpdated(this.state.rxData.oid,e)}catch(e){console.error(`Cannot get state ${this.state.rxData.oid}: ${e}`)}}static findField(e,t){return xe.findField(e,t)}getWidgetInfo(){return Ze.getWidgetInfo()}onStateUpdated(e,t){if(e===this.state.rxData.oid&&t){const n=t.val===!0||t.val==="true"||t.val===1||t.val==="1"||t.val==="on"||t.val==="ON"||t.val==="On";this.state.isOn!==n&&this.setState({isOn:n})}}getControlOid(){return this.state.rxData.click_id&&this.state.rxData.click_id!=="nothing_selected"?this.state.rxData.click_id:this.state.rxData.oid&&this.state.rxData.oid!=="nothing_selected"?this.state.rxData.oid:""}onClick(e){if(this.state.rxData.readOnly||this.props.editMode)return;e!==!1&&e!==!0&&(e=!this.isOn());const t=this.getControlOid();t&&this.props.context.setValue(t,e),this.setState({isOn:e})}onMyMouseDown(){const e=this.getControlOid();e&&this.props.context.setValue(e,!this.state.rxData.invert),this.setState({isOn:!0})}onMyMouseUp(){const e=this.getControlOid();e&&this.props.context.setValue(e,!!this.state.rxData.invert),this.setState({isOn:!1})}isOn(){let e;return this.props.editMode&&(this.state.rxData.test===!0||this.state.rxData.test===!1)?e=this.state.rxData.test:e=this.state.isOn,e==null&&(e=!1),this.state.rxData.invert&&(e=!e),e}renderIcon(e,t){let n,r,s,o;e&&(n=this.state.rxData.src_true||this.state.rxData.icon_true,n&&(r=this.state.rxData.invert_icon_true,s=this.state.rxData.imageHeight_true),o=this.state.rxData.icon_color_true),!n&&(!e||!t)&&(n=this.state.rxData.src_false||this.state.rxData.icon_false,n&&(r=this.state.rxData.invert_icon_false,s=this.state.rxData.imageHeight_false,o=o||this.state.rxData.icon_color_false));const a={};return r&&(a.filter="invert(1)"),o&&(a.color=o),s?(a.height=s,a.width="auto"):this.state.width&&this.state.rxData.type==="image"?this.state.width<this.state.height?(a.width=`calc(100% - ${(this.state.rxData.padding||0)*2}px)`,a.height="auto",a.maxHeight="100%"):(a.height=`calc(100% - ${(this.state.rxData.padding||0)*2}px)`,a.width="auto",a.maxWidth="100%"):this.state.rxData.type==="round-button"?this.state.width<this.state.height?(a.width=`calc(70% - ${(this.state.rxData.padding||0)*2}px)`,a.height="auto",a.maxHeight="100%"):(a.height=`calc(70% - ${(this.state.rxData.padding||0)*2}px)`,a.width="auto",a.maxWidth="100%"):this.state.width<this.state.height?(a.width=`calc(100% - ${(this.state.rxData.padding||0)*2}px)`,a.height="auto",a.maxHeight="100%"):(a.height=`calc(100% - ${(this.state.rxData.padding||0)*2}px)`,a.width="auto",a.maxWidth="100%"),this.state.rxData.padding&&(a.padding=this.state.rxData.padding),n?(n.startsWith("_PRJ_NAME/")&&(n=n.replace("_PRJ_NAME/",`../${this.props.context.adapterName}.${this.props.context.instance}/${this.props.context.projectName}/`)),h.jsx(N.Icon,{style:a,src:n},"icon")):null}getTextWidth(e){if(!this.refService.current)return e*14;if(this.textsLengthCache[e])return this.textsLengthCache[e];const t=document.createElement("div");t.style.position="absolute",t.style.visibility="hidden",t.style.height="auto",t.style.width="auto",t.innerHTML=e,this.refService.current.appendChild(t);const n=t.clientWidth;return this.refService.current.removeChild(t),this.textsLengthCache[e]=n,n}renderText(e){let t,n;if(e&&(t=this.state.rxData.text_true!==void 0?this.state.rxData.text_true:this.state.rxData.on_text,n=this.state.rxData.color_true),t=t||(this.state.rxData.text_false!==void 0?this.state.rxData.text_false:this.state.rxData.off_text),n=n||this.state.rxData.color_false,this.state.rxData.equal_text_length&&this.state.rxData.text_false&&this.state.rxData.text_true){const r=this.getTextWidth(this.state.rxData.text_false),s=this.getTextWidth(this.state.rxData.text_true),o=Math.max(r,s);return{text:h.jsx("div",{style:{width:o,display:"inline-block",color:n},children:t}),color:n}}return{text:t,color:n}}renderButton(e,t){const n=this.renderIcon(e),r=this.renderText(e);return t.color=r.color||void 0,h.jsxs(k.Button,{variant:this.state.rxData.variant===void 0?"contained":this.state.rxData.variant,color:e?"primary":"grey",onMouseDown:this.state.rxData.pushMode&&!this.state.rxData.readOnly&&!this.props.editMode?()=>this.onMyMouseDown():void 0,onMouseUp:this.state.rxData.pushMode&&!this.state.rxData.readOnly&&!this.props.editMode?()=>this.onMyMouseUp():void 0,onClick:!this.state.rxData.pushMode&&!this.state.rxData.readOnly&&!this.props.editMode?()=>this.onClick():void 0,style:t,children:[n,r.text]})}renderFab(e,t){const n=this.renderIcon(e),r=this.renderText(e);return t.zIndex=this.props.editMode?0:void 0,h.jsx(k.Fab,{style:t,color:e?"primary":"grey",onMouseDown:this.state.rxData.pushMode&&!this.state.rxData.readOnly&&!this.props.editMode?()=>this.onMyMouseDown():void 0,onMouseUp:this.state.rxData.pushMode&&!this.state.rxData.readOnly&&!this.props.editMode?()=>this.onMyMouseUp():void 0,onClick:!this.state.rxData.pushMode&&!this.state.rxData.readOnly&&!this.props.editMode?()=>this.onClick():void 0,children:n||r.text})}renderHtml(e){let t;e&&(t=this.state.rxData.html_true),t||(t=this.state.rxData.html_false);const n=this.renderIcon(e);return[this.state.rxData.html_prepend?h.jsx("span",{dangerouslySetInnerHTML:{__html:this.state.rxData.html_prepend}},"prepend"):null,n,t?h.jsx("span",{dangerouslySetInnerHTML:{__html:t}},"content"):null,this.state.rxData.html_append?h.jsx("span",{dangerouslySetInnerHTML:{__html:this.state.rxData.html_append}},"append"):null]}renderSwitch(e,t){const n=this.state.rxData.text_true!==void 0?this.state.rxData.text_true:this.state.rxData.on_text,r=this.state.rxData.color_true,s=this.state.rxData.text_false!==void 0?this.state.rxData.text_false:this.state.rxData.off_text,o=this.state.rxData.color_false,a=this.renderIcon(!0,!0),l=this.renderIcon(!1);if((n||a)&&(s||l))return t.display="flex",t.alignItems="center",h.jsxs("div",{style:t,children:[h.jsx("div",{style:{marginTop:-2,color:o},children:s}),h.jsx("div",{children:l}),h.jsx(k.Switch,{checked:e,onChange:()=>this.onClick()}),h.jsx("div",{children:a}),h.jsx("div",{style:{marginTop:-2,color:r},children:n})]});if(s||l){let c;return l&&s?c=h.jsxs("div",{style:{display:"flex",alignItems:"center",color:o},children:[l,s]}):c=s||l,t.marginLeft=5,h.jsx(k.FormControlLabel,{style:t,control:h.jsx(k.Switch,{checked:e,onChange:()=>this.onClick()}),label:c})}return h.jsx("div",{style:t,children:h.jsx(k.Switch,{checked:!1,onChange:()=>this.onClick()})})}renderCheckbox(e,t){let n=e?this.state.rxData.text_true!==void 0?this.state.rxData.text_true:this.state.rxData.on_text:this.state.rxData.text_false!==void 0?this.state.rxData.text_false:this.state.rxData.off_text;n||(n=this.state.rxData.text_false!==void 0?this.state.rxData.text_false:this.state.rxData.off_text);const r=e?this.renderIcon(!0):this.renderIcon(!1);return t.marginLeft=5,n||r?h.jsx(k.FormControlLabel,{style:t,control:h.jsx(k.Checkbox,{checked:e,onChange:()=>this.onClick()}),label:h.jsxs("div",{style:{display:"flex",alignItems:"center"},children:[r,n]})}):h.jsx(k.Checkbox,{style:t,checked:e,onChange:()=>this.onClick()})}renderRadio(e,t){const n=this.state.rxData.text_true!==void 0?this.state.rxData.text_true:this.state.rxData.on_text,r=this.state.rxData.text_false!==void 0?this.state.rxData.text_false:this.state.rxData.off_text,s=this.renderIcon(!0),o=this.renderIcon(!1);let a=this.state.rxData.variant===void 0?"contained":this.state.rxData.variant;a==="standard"&&(a="text");const l=this.state.rxData.orientation==="vertical"?{height:"50%"}:this.state.rxData.notEqualLength?void 0:{width:"50%"};return h.jsxs(k.ButtonGroup,{style:t,variant:a,orientation:this.state.rxData.orientation||"horizontal",children:[h.jsx(k.Button,{style:l,startIcon:o,color:e?"grey":"primary",onClick:()=>this.onClick(!1),children:r||N.I18n.t("off")}),h.jsx(k.Button,{style:l,color:e?"primary":"grey",startIcon:s,onClick:()=>this.onClick(!0),children:n||N.I18n.t("on")})]})}componentDidUpdate(){if(this.refService.current&&(this.state.rxData.type==="image"||this.state.rxData.type==="html"||this.state.rxData.type==="button"&&this.state.rxData.jquery_style)){if(this.state.rxData.type==="button"){const e=this.refService.current.getElementsByClassName("vis-widget-body");if(e!=null&&e.length&&!this.refService.current._jQueryDone){this.refService.current._jQueryDone=!0,window.jQuery(e[0]).button();const t=e[0].getElementsByClassName("ui-button-text");t!=null&&t.length&&(t[0].style.display="flex",t[0].style.alignItems="center")}}(this.refService.current.clientWidth!==this.state.width||this.refService.current.clientHeight!==this.state.height)&&this.setState({width:this.refService.current.clientWidth,height:this.refService.current.clientHeight})}}renderWidgetBody(e){super.renderWidgetBody(e);const t=this.isOn(),n={};Object.keys(this.state.rxStyle).forEach(l=>{const c=this.state.rxStyle[l];c!=null&&xe.POSSIBLE_MUI_STYLES.includes(l)&&(l=l.replace(/(-\w)/g,u=>u[1].toUpperCase()),n[l]=c)});let r=this.state.rxData.type;!r&&this.props.tpl==="tplJquiRadio"&&(r="radio"),n.borderWidth&&(n.borderWidth=Se.correctStylePxValue(n.borderWidth)),n.fontSize&&(n.fontSize=Se.correctStylePxValue(n.fontSize)),n.width="100%",n.height="100%",n.minWidth="unset";let s;const o={textAlign:"center"};r==="radio"?s=this.renderRadio(t,n):r==="html"||r==="button"&&this.state.rxData.jquery_style?(o.display="flex",o.flexDirection=this.state.height>this.state.width?"column":"row",o.alignItems="center",o.justifyContent="center",o.cursor=this.state.rxData.readOnly?void 0:"pointer",s=this.renderHtml(t)):r==="switch"?s=this.renderSwitch(t,n):r==="checkbox"?s=this.renderCheckbox(t,n):r==="image"?(o.cursor=this.state.rxData.readOnly?void 0:"pointer",s=this.renderIcon(t,!!n)):r==="round-button"?s=this.renderFab(t,n):this.state.rxData.jquery_style||(s=this.renderButton(t,n));const a=h.jsx("div",{className:"vis-widget-body",style:o,onClick:r==="image"||r==="html"?()=>this.onClick():void 0,children:s});return t&&this.state.rxData.alt_true?h.jsx(k.Tooltip,{title:this.state.rxData.alt_true,slotProps:{popper:{sx:{pointerEvents:"none"}}},children:a}):!t&&this.state.rxData.alt_false?h.jsx(k.Tooltip,{title:this.state.rxData.alt_false,slotProps:{popper:{sx:{pointerEvents:"none"}}},children:a}):a}}class el extends Ze{static getWidgetInfo(){const t={id:"tplJquiRadio",visSet:"jqui",visName:"Radiobuttons on/off",visWidgetLabel:"jqui_radio_buttons_on_off",visPrev:"widgets/jqui/img/Prev_RadioButtonsOnOff.png",visOrder:15,visAttrs:Ze.getWidgetInfo().visAttrs,visDefaultStyle:{width:150,height:45}};t.visAttrs[0].fields.unshift({name:"_note",type:"help",text:"jqui_button_binary_control_note"});const n=Ze.findField(t,"type");return n&&(n.default="radio"),t}getWidgetInfo(){return el.getWidgetInfo()}}const ar={AUTO:"thermostat_auto",MANUAL:"pan_tool",VACATION:"houseboat",PARTY:"celebration",COOL:"ac_unit",DRY:"dry",ECO:"park",FAN_ONLY:"air",HEAT:"wb_sunny",HEATING:"wb_sunny",OFF:"power_settings_new"};class zt extends ve.Component{textRef;constructor(e){super(e),this.state={textDialogFocused:[],states:null,unit:"",originalUnit:"",usePercents:!0,min:0,max:100,steps:4,texts:[],values:[],colors:[],activeColors:[],icons:[],images:[],tooltips:[],iconDialog:null,imageDialog:null,dialog:!1,dialogDelete:null},this.textRef=[]}static iconPromise;static getIcon(e){return zt.iconPromise instanceof Promise||(zt.iconPromise=fetch("./material-icons/baseline.json").then(t=>t.json())),zt.iconPromise.then(t=>t[e]?`data:image/svg+xml;base64,${t[e]}`:null).catch(t=>(console.error(t),null))}static async generateFields(e,t){var r,s;const n=e.oid;if(!n||n==="nothing_selected")return!1;if(e.count<=1){let o=!1;const a=await t.getObject(n);if((r=a==null?void 0:a.common)!=null&&r.states){let l=a.common.states;Array.isArray(l)&&(l={},Object.keys(a.common.states).forEach(u=>l[u]=u));const c=Object.keys(a.common.states);for(let u=0;u<c.length;u++){if(e[`text${u+1}`]!==l[c[u]]&&(e[`text${u+1}`]=l[c[u]],o=!0),e[`value${u+1}`]!==c[u]&&(e[`value${u+1}`]=c[u],o=!0),ar[l[c[u]].toUpperCase()]){const p=await zt.getIcon(ar[l[c[u]].toUpperCase()]);e[`icon${u+1}`]!==p&&(e[`icon${u+1}`]=p),o=!0}e[`g_states-${u+1}`]||(e[`g_states-${u+1}`]=!0,o=!0)}e.count!==c.length&&(e.count=c.length,o=!0)}else if(((s=a==null?void 0:a.common)==null?void 0:s.type)==="number"){const l=a.common.unit||"",c=a.common.min!==void 0?a.common.min:0,u=a.common.max!==void 0?a.common.max:100,p=(u-c)/4;let d=0;for(let f=c;f<u;f+=p){d++;const m=Math.round((f-c)/(u-c)*100);e[`text${d}`]!==m.toString()+l&&(e[`text${d}`]=m.toString()+l,o=!0),e[`value${d}`]!==f.toString()&&(e[`value${d}`]=f.toString(),o=!0),e[`g_states-${d}`]||(e[`g_states-${d}`]=!0,o=!0)}d++,e[`text${d}`]!==100+l&&(e[`text${d}`]=100+l,o=!0),e[`value${d}`]!==u.toString()&&(e[`value${d}`]=u.toString(),o=!0),e[`g_states-${d}`]||(e[`g_states-${d}`]=!0,o=!0),e.count!==d&&(o=!0,e.count=d)}return o?e:!1}return!1}async calculateFirst(e){var n,r;const t={...this.state,dialog:!0};if(this.props.data.count<1||e!==void 0){const s=this.props.data.oid;if(s&&s!=="nothing_selected"){const o=await this.props.socket.getObject(s);if(t.texts=[],t.values=[],(n=o==null?void 0:o.common)!=null&&n.states){t.numbers=!1;let a=o.common.states;Array.isArray(a)&&(a={},Object.keys(o.common.states).forEach(c=>a[c]=c)),t.states=a;const l=Object.keys(a);t.texts=[],t.values=[];for(let c=0;c<l.length;c++)t.texts[c]=a[l[c]],t.values[c]=l[c],ar[a[l[c]].toUpperCase()]&&(t.icons[c]=await zt.getIcon(ar[a[l[c]].toUpperCase()]))}else if(((r=o==null?void 0:o.common)==null?void 0:r.type)==="number"){t.numbers=!0,t.unit=o.common.unit||"",t.min=o.common.min!==void 0?o.common.min:0,t.max=o.common.max!==void 0?o.common.max:100,t.step=(t.max-t.min)/4;for(let a=t.min;a<t.max;a+=t.step){const l=Math.round((a-t.min)/(t.max-t.min)*100);t.texts.push(l+t.unit),t.values.push(a)}t.texts.push(100+t.unit),t.values.push(t.max)}}}else{t.texts=[],t.values=[],t.icons=[],t.images=[],t.colors=[],t.activeColors=[],t.tooltips=[];for(let s=0;s<this.props.data.count;s++)t.texts[s]=this.props.data[`text${s+1}`]||"",t.values[s]=this.props.data[`value${s+1}`]||"",t.icons[s]=this.props.data[`icon${s+1}`]||"",t.images[s]=this.props.data[`image${s+1}`]||"",t.colors[s]=this.props.data[`color${s+1}`]||"",t.activeColors[s]=this.props.data[`activeColor${s+1}`]||"",t.tooltips[s]=this.props.data[`tooltip${s+1}`]||""}this.setState(t)}renderDeleteDialog(){return this.state.dialogDelete===null?null:h.jsxs(k.Dialog,{open:!0,onClose:()=>this.setState({dialogDelete:null}),children:[h.jsx(k.DialogContent,{children:N.I18n.t("jqui_Are you sure?")}),h.jsxs(k.DialogActions,{children:[h.jsx(k.Button,{variant:"contained",color:"primary",startIcon:h.jsx(be.Delete,{}),onClick:()=>{const e=[...this.state.values],t=[...this.state.texts],n=[...this.state.icons],r=[...this.state.images],s=[...this.state.colors],o=[...this.state.activeColors],a=[...this.state.tooltips];typeof this.state.dialogDelete=="number"&&(e.splice(this.state.dialogDelete,1),t.splice(this.state.dialogDelete,1),n.splice(this.state.dialogDelete,1),r.splice(this.state.dialogDelete,1),s.splice(this.state.dialogDelete,1),a.splice(this.state.dialogDelete,1),o.splice(this.state.dialogDelete,1)),this.setState({values:e,texts:t,icons:n,images:r,colors:s,activeColors:o,tooltips:a,dialogDelete:null})},children:N.I18n.t("Delete")}),h.jsx(k.Button,{variant:"contained",color:"grey",startIcon:h.jsx(be.Close,{}),onClick:()=>this.setState({dialogDelete:null}),children:N.I18n.t("Cancel")})]})]},"deleteDialog")}renderMaterialDialog(){return this.state.iconDialog===null?null:h.jsx(zo,{theme:this.props.theme,themeType:this.props.themeType,value:this.state.icons[this.state.iconDialog],onClose:e=>{if(this.setState({iconDialog:null}),e!==null){const t=[...this.state.icons];typeof this.state.iconDialog=="number"&&(t[this.state.iconDialog]=e),this.setState({icons:t,iconDialog:null})}}},"iconDialog")}renderImageDialog(){if(this.state.imageDialog===null)return null;let e=this.state.images[this.state.imageDialog];e.startsWith("../")?e=e.substring(3):e.startsWith("_PRJ_NAME/")&&(e=e.replace("_PRJ_NAME/",`../${this.props.adapterName}.${this.props.instance}/${this.props.projectName}/`));const t=(n,r)=>{const s=`${this.props.adapterName}.${this.props.instance}/${this.props.projectName}/`;n!=null&&n.startsWith(s)?n=`_PRJ_NAME/${n.substring(s.length)}`:n!=null&&n.startsWith("/")?n=`..${n}`:n&&!n.startsWith(".")&&(n=`../${n}`);const o=[...this.state.images];typeof this.state.imageDialog=="number"&&(o[this.state.imageDialog]=n||""),this.setState({images:o}),this.setState({imageDialog:null})};return h.jsx(N.SelectFile,{theme:this.props.theme,title:N.I18n.t("jqui_Select file"),onClose:()=>this.setState({imageDialog:null}),restrictToFolder:`${this.props.adapterName}.${this.props.instance}/${this.props.projectName}`,allowNonRestricted:!0,allowUpload:!0,allowDownload:!0,allowCreateFolder:!0,allowDelete:!0,allowView:!0,showToolbar:!0,imagePrefix:"../",selected:e,filterByType:"images",onOk:n=>t(Array.isArray(n)?n[0]:n),socket:this.props.socket},"imageDialog")}onEnter(){var t,n;const e=[...this.state.values];if((t=this.state.editDialog)!=null&&t.add){const r=e.length;e[r]=this.state.editDialog.value;const s=[...this.state.texts],o=[...this.state.icons],a=[...this.state.images],l=[...this.state.colors],c=[...this.state.activeColors],u=[...this.state.tooltips];s[r]=s[r]||"",o[r]=o[r]||"",a[r]=a[r]||"",l[r]=l[r]||"",c[r]=c[r]||"",u[r]=u[r]||"",this.setState({values:e,texts:s,icons:o,images:a,colors:l,activeColors:c,tooltips:u,editDialog:null})}else((n=this.state.editDialog)==null?void 0:n.index)!==void 0&&(e[this.state.editDialog.index]=this.state.editDialog.value),this.setState({values:e,editDialog:null})}renderEditDialog(){if(!this.state.editDialog)return null;const e=!this.state.values.map(t=>typeof t=="string"?t.trim():t).includes(this.state.editDialog.value);return h.jsxs(k.Dialog,{maxWidth:"sm",open:!0,onClose:()=>this.setState({editDialog:null}),children:[h.jsx(k.DialogTitle,{children:this.state.editDialog.add?N.I18n.t("jqui_Add new value"):N.I18n.t("Edit")}),h.jsx(k.DialogContent,{children:h.jsx(k.TextField,{onKeyDown:t=>{var n;return t.key==="Enter"&&e&&((n=this.state.editDialog)==null?void 0:n.value)&&this.onEnter()},fullWidth:!0,autoFocus:!0,variant:"standard",label:N.I18n.t("Value"),value:this.state.editDialog.value,onChange:t=>{this.state.editDialog&&this.setState({editDialog:{value:t.target.value,add:this.state.editDialog.add,index:this.state.editDialog.index}})}})}),h.jsxs(k.DialogActions,{children:[h.jsx(k.Button,{variant:"contained",color:"primary",disabled:!e||!this.state.editDialog.value,startIcon:this.state.editDialog.add?h.jsx(be.Add,{}):h.jsx(be.Check,{}),onClick:()=>this.onEnter(),children:this.state.editDialog.add?N.I18n.t("Add"):N.I18n.t("Apply")}),h.jsx(k.Button,{variant:"contained",color:"grey",startIcon:h.jsx(be.Close,{}),onClick:()=>this.setState({editDialog:null}),children:N.I18n.t("Cancel")})]})]},"editDialog")}renderLine(e){var s;let t=null;if(this.textRef[e]=this.textRef[e]||ve.createRef(),!this.state.icons[e]){const o=this.state.images[e],a=h.jsx(k.Popper,{open:!!(this.state.textDialogFocused[e]&&(o!=null&&o.toString().startsWith(window.location.origin))),anchorEl:(s=this.textRef[e])==null?void 0:s.current,placement:"bottom",transition:!0,children:({TransitionProps:l})=>h.jsx(k.Fade,{...l,timeout:350,children:h.jsxs(k.Paper,{children:[h.jsxs(k.Button,{style:{textTransform:"none"},onClick:()=>{const c=[...this.state.images];c[e]=`.${c[e].toString().slice(window.location.origin.length)}`,this.setState({images:c})},children:[N.I18n.t("jqui_Replace to"),` .${o.toString().slice(window.location.origin.length)}`]}),h.jsx(k.IconButton,{size:"small",onClick:()=>{const c=[...this.state.textDialogFocused];c[e]=!1,this.setState({textDialogFocused:c})},children:h.jsx(be.Clear,{fontSize:"small"})})]})})},"popper");t=[h.jsx(k.TextField,{variant:"standard",fullWidth:!0,slotProps:{input:{sx:{...Zn.clearPadding,...Zn.fieldContent},endAdornment:h.jsx(k.Button,{size:"small",onClick:()=>this.setState({imageDialog:e}),children:"..."})}},ref:this.textRef[e],value:this.state.images[e]||"",onFocus:()=>{const l=[...this.state.textDialogFocused];l[e]=!0,this.setState({textDialogFocused:l})},onBlur:()=>{const l=[...this.state.textDialogFocused];l[e]=!1,this.setState({textDialogFocused:l})},onChange:l=>{const c=[...this.state.images];c[e]=l.target.value,this.setState({images:c})}},"image"),a]}let n,r=this.state.images[e]||this.state.icons[e]||"";if(r.startsWith("_PRJ_NAME/")&&(r=r.replace("_PRJ_NAME/",`../${this.props.adapterName}.${this.props.instance}/${this.props.projectName}/`)),this.props.data.type==="radio"){const o=h.jsx(N.Icon,{src:r,style:{width:24,height:24}}),a=h.jsxs("div",{style:{display:"flex",gap:4},children:[o,this.state.texts[e]]});n=h.jsx(k.FormControlLabel,{control:h.jsx(k.Radio,{onClick:()=>this.setState({activeLine:e}),checked:this.state.activeLine===e}),labelPlacement:"end",label:a})}else if(this.props.data.type==="select"){const o=h.jsx(N.Icon,{src:r,style:{width:24,height:24}}),a=h.jsxs("div",{style:{display:"flex",gap:4},children:[o,this.state.texts[e]]});n=h.jsx(k.MenuItem,{onClick:()=>this.setState({activeLine:e}),selected:this.state.activeLine===e,children:a})}else n=h.jsx(k.Button,{style:{color:this.state.activeLine===e?this.state.activeColors[e]||this.state.colors[e]:this.state.colors[e]||void 0},color:this.state.activeLine===e?"primary":"grey",variant:this.props.data.variant===void 0||this.props.data.variant==="standard"?"contained":this.props.data.variant,onClick:()=>this.setState({activeLine:e}),startIcon:h.jsx(N.Icon,{src:r,style:{width:24,height:24}}),children:this.state.texts[e]});return h.jsxs(k.TableRow,{children:[h.jsxs(k.TableCell,{style:{display:"flex",alignItems:"center"},children:[this.state.values[e],h.jsx(k.IconButton,{size:"small",onClick:()=>this.setState({editDialog:{add:!1,index:e,value:this.state.values[e]}}),children:h.jsx(be.Edit,{})})]}),h.jsx(k.TableCell,{children:h.jsx(k.TextField,{size:"small",fullWidth:!0,variant:"standard",value:this.state.texts[e]||"",onChange:o=>{const a=[...this.state.texts];a[e]=o.target.value,this.setState({texts:a})}})}),h.jsx(k.TableCell,{children:this.state.images[e]?null:h.jsxs("div",{style:{display:"flex",width:"100%",alignItems:"center"},children:[h.jsx(k.TextField,{fullWidth:!0,size:"small",variant:"standard",value:this.state.icons[e]||"",onChange:o=>{const a=[...this.state.icons];a[e]=o.target.value,this.setState({icons:a})},slotProps:{input:{endAdornment:this.state.icons[e]?h.jsx(k.IconButton,{size:"small",onClick:()=>{const o=[...this.state.icons];o[e]="",this.setState({icons:o})},children:h.jsx(be.Clear,{})}):null,sx:{...Zn.clearPadding,...Zn.fieldContent}}}}),h.jsx(k.Button,{variant:this.state.icons[e]?"outlined":void 0,color:this.state.icons[e]?"grey":void 0,onClick:()=>this.setState({iconDialog:e}),children:this.state.icons[e]?h.jsx(N.Icon,{src:this.state.icons[e],style:{width:36,height:36}}):"..."})]})}),h.jsx(k.TableCell,{children:t}),h.jsx(k.TableCell,{children:h.jsx(N.ColorPicker,{value:this.state.colors[e],onChange:o=>{const a=[...this.state.colors];a[e]=o,this.setState({colors:a})}})}),h.jsx(k.TableCell,{children:h.jsx(N.ColorPicker,{value:this.state.activeColors[e],onChange:o=>{const a=[...this.state.activeColors];a[e]=o,this.setState({activeColors:a})}})}),h.jsx(k.TableCell,{children:h.jsx(k.TextField,{size:"small",fullWidth:!0,variant:"standard",value:this.state.tooltips[e]||"",onChange:o=>{const a=[...this.state.tooltips];a[e]=o.target.value,this.setState({tooltips:a})}})}),h.jsx(k.TableCell,{children:h.jsx(k.IconButton,{onClick:()=>this.setState({dialogDelete:e}),children:h.jsx(be.Delete,{})})}),h.jsx(k.TableCell,{children:n})]},`${this.state.values[e]}_${e}`)}renderMinMaxDialog(){if(!this.state.minMaxDialog)return null;const e=[],t=Math.round((this.state.max-this.state.min)/this.state.steps);for(let n=this.state.min;n<this.state.max;n+=t){let r=n;this.state.usePercents&&(r=Math.round((n-this.state.min)/(this.state.max-this.state.min)*100)),e.push(h.jsx(k.Button,{variant:"contained",disabled:!0,children:Math.round(r).toString()+this.state.unit},n))}return e.push(h.jsx(k.Button,{variant:"contained",disabled:!0,children:(this.state.usePercents?100:this.state.max).toString()+this.state.unit},1e3)),h.jsxs(k.Dialog,{fullWidth:!0,maxWidth:"md",open:!0,onClose:()=>this.setState({minMaxDialog:!1}),children:[h.jsx(k.DialogTitle,{children:N.I18n.t("jqui_Number settings")}),h.jsxs(k.DialogContent,{children:[this.state.min!==0||this.state.max!==100?h.jsx("div",{style:{width:"100%"},children:h.jsx(k.FormControlLabel,{control:h.jsx(k.Checkbox,{checked:this.state.usePercents,onChange:n=>{let r=this.state.unit;n.target.checked?r=r||"%":r==="%"&&(r=this.state.originalUnit||""),this.setState({usePercents:n.target.checked,unit:r})}}),label:N.I18n.t("jqui_Percents")})}):null,h.jsx(k.TextField,{fullWidth:!0,type:"number",variant:"standard",label:N.I18n.t("jqui_Minimum value"),value:this.state.min,onChange:n=>this.setState({min:Number(n.target.value)})}),h.jsx(k.TextField,{fullWidth:!0,type:"number",variant:"standard",label:N.I18n.t("jqui_Maximum value"),value:this.state.max,onChange:n=>this.setState({max:Number(n.target.value)})}),h.jsxs("div",{style:{width:"100%"},children:[h.jsx("div",{style:{width:"100%"},children:N.I18n.t("Steps")}),h.jsx("div",{style:{width:"100%"},children:h.jsx(k.Slider,{value:this.state.steps,step:1,valueLabelDisplay:"auto",min:2,max:20,marks:[{value:0,label:"0"},{value:20,label:"20"}],onChange:(n,r)=>this.setState({steps:r})})})]}),h.jsx(k.TextField,{fullWidth:!0,variant:"standard",label:N.I18n.t("Unit"),value:this.state.unit,onChange:n=>this.setState({unit:n.target.value})}),h.jsx(k.ButtonGroup,{style:{marginTop:20},variant:this.props.data.variant===void 0||this.props.data.variant==="standard"?"contained":this.props.data.variant,children:e})]}),h.jsxs(k.DialogActions,{children:[h.jsx(k.Button,{variant:"contained",color:"primary",startIcon:h.jsx(be.Check,{}),onClick:()=>{const n={...this.state,minMaxDialog:!1,values:[],texts:[...this.state.texts],icons:[...this.state.icons],images:[...this.state.images],colors:[...this.state.colors],activeColors:[...this.state.activeColors],tooltips:[...this.state.tooltips]},r=Math.round((this.state.max-this.state.min)/this.state.steps);let s=0;for(let o=this.state.min;o<this.state.max;o+=r)this.state.usePercents?n.texts[s]=Math.round((o-this.state.min)/(this.state.max-this.state.min)*100)+this.state.unit:n.texts[s]=o+this.state.unit,n.values[s]=o.toString(),n.icons[s]=n.icons[s]||"",n.images[s]=n.images[s]||"",n.colors[s]=n.colors[s]||"",n.activeColors[s]=n.activeColors[s]||"",n.tooltips[s]=n.tooltips[s]||"",s++;n.values[s]=this.state.max.toString(),n.texts[s]=100+this.state.unit,this.setState(n)},children:N.I18n.t("Apply")}),h.jsx(k.Button,{variant:"contained",color:"grey",startIcon:h.jsx(be.Close,{}),onClick:()=>this.setState({minMaxDialog:!1}),children:N.I18n.t("Cancel")})]})]},"minMaxDialog")}renderDialog(){return this.state.dialog?h.jsxs(k.Dialog,{fullWidth:!0,maxWidth:"lg",open:!0,onClose:()=>this.setState({dialog:!1}),children:[h.jsx(k.DialogTitle,{children:N.I18n.t("jqui_Bulk edit")}),h.jsxs(k.DialogContent,{children:[h.jsx(k.Button,{variant:"contained",onClick:async()=>{var n,r,s;const e=this.props.data.oid,t={...this.state,minMaxDialog:!0,usePercents:!0,min:this.state.min,max:this.state.max||100,steps:4,unit:"%"};if(e&&e!=="nothing_selected"){const o=await this.props.socket.getObject(e);t.min=(n=o==null?void 0:o.common)==null?void 0:n.min,(t.min===void 0||t.min===null)&&(t.min=0),t.max=(r=o==null?void 0:o.common)==null?void 0:r.max,(t.max===void 0||t.max===null)&&(t.max=100),t.originalUnit=((s=o==null?void 0:o.common)==null?void 0:s.unit)||""}this.setState(t)},children:N.I18n.t("jqui_Generate steps")}),this.state.states?h.jsx(k.Button,{variant:"contained",onClick:()=>this.calculateFirst(!0),children:N.I18n.t("jqui_Generate states")}):null,h.jsxs(k.Table,{children:[h.jsx(k.TableHead,{children:h.jsxs(k.TableRow,{children:[h.jsx(k.TableCell,{children:N.I18n.t("Value")}),h.jsx(k.TableCell,{children:N.I18n.t("Text")}),h.jsx(k.TableCell,{children:N.I18n.t("Icon")}),h.jsx(k.TableCell,{children:N.I18n.t("Image")}),h.jsx(k.TableCell,{children:N.I18n.t("color")}),h.jsx(k.TableCell,{children:N.I18n.t("jqui_active_color")}),h.jsx(k.TableCell,{children:N.I18n.t("jqui_tooltip")}),h.jsx(k.TableCell,{children:h.jsx(k.Fab,{size:"small",style:{marginRight:8},onClick:()=>this.setState({editDialog:{add:!0,value:""}}),children:h.jsx(be.Add,{})})}),h.jsx(k.TableCell,{children:N.I18n.t("jqui_Example")})]})}),h.jsx(k.TableBody,{children:this.state.values.map((e,t)=>this.renderLine(t))})]})]}),h.jsxs(k.DialogActions,{children:[h.jsx(k.Button,{variant:"contained",color:"primary",startIcon:h.jsx(be.Check,{}),onClick:()=>{const e={...this.props.data};for(let t=0;t<this.state.values.length;t++)e[`text${t+1}`]=this.state.texts[t],e[`value${t+1}`]=this.state.values[t],e[`icon${t+1}`]=this.state.icons[t],e[`image${t+1}`]=this.state.images[t],e[`color${t+1}`]=this.state.colors[t],e[`tooltip${t+1}`]=this.state.tooltips[t],e[`activeColor${t+1}`]=this.state.activeColors[t],e[`g_states-${t+1}`]=!0;for(let t=this.state.values.length+1;t<30;t++)delete e[`text${t}`],delete e[`value${t}`],delete e[`icon${t}`],delete e[`image${t}`],delete e[`color${t}`],delete e[`tooltip${t}`],delete e[`activeColor${t}`],delete e[`g_states-${t}`];e.count=this.state.values.length,this.props.onDataChange(e),this.setState({dialog:!1})},children:N.I18n.t("Apply")}),h.jsx(k.Button,{variant:"contained",color:"grey",startIcon:h.jsx(be.Close,{}),onClick:()=>this.setState({dialog:!1}),children:N.I18n.t("Cancel")})]})]},"dialog"):null}render(){return[h.jsx(k.Button,{fullWidth:!0,variant:"outlined",disabled:!this.props.data.oid,onClick:()=>this.calculateFirst(),children:N.I18n.t("jqui_generate")},"button"),this.renderMinMaxDialog(),this.renderImageDialog(),this.renderMaterialDialog(),this.renderDeleteDialog(),this.renderDialog(),this.renderEditDialog()]}}class kt extends xe{controlTimeout=null;constructor(e){super(e),Object.assign(this.state,{value:"",object:null})}static getWidgetInfo(){return{id:"tplJquiButtonState",visSet:"jqui",visName:"States control",visWidgetLabel:"jqui_states_control",visPrev:"widgets/jqui/img/Prev_ButtonState.png",visOrder:14,visAttrs:[{name:"common",fields:[{name:"type",label:"jqui_type",type:"select",noTranslation:!0,default:"button",options:["button","select","radio","slider"]},{name:"oid",type:"id",onChange:async(e,t,n,r)=>{t.oid&&await zt.generateFields(t,r)&&n(t)}},{name:"readOnly",type:"checkbox"},{name:"click_id",type:"id",noSubscribe:!0,hidden:e=>!!e.readOnly},{name:"count",type:"slider",min:0,default:1,max:10,hidden:e=>!!e.percents},{type:"custom",component:(e,t,n,r)=>h.jsx(zt,{theme:r.context.theme,data:t||{},onDataChange:n,socket:r.context.socket,themeType:r.context.theme.palette.mode==="dark"?"dark":"light",adapterName:r.context.adapterName,instance:r.context.instance,projectName:r.context.projectName})},{name:"variant",label:"jqui_variant",type:"select",noTranslation:!0,options:["contained","outlined","text","standard"],default:"contained",hidden:e=>e.type!=="button"&&e.type!=="select"},{name:"orientation",label:"orientation",type:"select",options:["horizontal","vertical"],default:"horizontal",hidden:e=>e.type!=="button"&&e.type!=="slider"},{name:"widgetTitle",label:"jqui_name",type:"text"},{name:"timeout",label:"jqui_set_timeout",type:"number",hidden:e=>e.type!=="slider"},{name:"open",label:"jqui_open",type:"checkbox",hidden:e=>e.type!=="select"}]},{name:"states",label:"jqui_group_value",indexFrom:1,indexTo:"count",hidden:e=>!!e.percents,fields:[{name:"value",type:"text",label:"jqui_value",default:"0"},{name:"test",type:"checkbox",label:"jqui_test",onChange:(e,t,n,r,s)=>{if(t[e.name]){let o=!1;for(let a=1;a<=t.count;a++)a!==s&&t[`test${a}`]&&(o=!0,t[`test${a}`]=!1);o&&n(t)}return Promise.resolve()},hidden:(e,t)=>e.type==="slider"||e[`value${t}`]===""||e[`value${t}`]===null||e[`value${t}`]===void 0},{name:"onlyIcon",type:"checkbox",label:"jqui_only_icon"},{name:"text",default:N.I18n.t("Value"),type:"text",label:"jqui_text",hidden:(e,t)=>!!e[`onlyIcon${t}`]||e[`value${t}`]===""||e[`value${t}`]===null||e[`value${t}`]===void 0},{name:"color",type:"color",label:"color",hidden:(e,t)=>e.type==="slider"||e[`value${t}`]===""||e[`value${t}`]===null||e[`value${t}`]===void 0},{name:"activeColor",type:"color",label:"jqui_active_color",hidden:(e,t)=>e.type==="slider"||e[`value${t}`]===""||e[`value${t}`]===null||e[`value${t}`]===void 0},{name:"image",label:"jqui_image",type:"image",hidden:(e,t)=>e.type==="slider"||!!e.icon||e[`value${t}`]===""||e[`value${t}`]===null||e[`value${t}`]===void 0},{name:"icon",label:"jqui_icon",type:"icon64",hidden:(e,t)=>e.type==="slider"||!!e.image||e[`value${t}`]===""||e[`value${t}`]===null||e[`value${t}`]===void 0},{name:"tooltip",label:"jqui_tooltip",type:"text",hidden:(e,t)=>e.type==="slider"||e[`value${t}`]===""||e[`value${t}`]===null||e[`value${t}`]===void 0}]}],visDefaultStyle:{width:300,height:45}}}async componentDidMount(){if(super.componentDidMount(),this.props.tpl==="tplJquiRadioSteps"&&this.state.data&&this.props.context.onWidgetsChanged&&this.state.data.count===void 0){const e=it(this.state.data);e.count=5;const t=parseFloat(e.min||0),n=parseFloat(e.max||100);e.value1=t,e.text1=N.I18n.t("jqui_off"),e["g_states-1"]=!0,e.value5=n,e.text5="100%",e["g_states-5"]=!0,e.value2=(n-t)*.25+t,e.text2="25%",e["g_states-2"]=!0,e.value3=(n-t)*.5+t,e.text3="50%",e["g_states-3"]=!0,e.value4=(n-t)*.75+t,e.text4="75%",e["g_states-4"]=!0,e.min=null,e.max=null,setTimeout(()=>this.props.context.onWidgetsChanged([{wid:this.props.id,view:this.props.view,data:e}]),100)}if((this.props.tpl==="tplJquiRadioList"||this.props.tpl==="tplJquiSelectList")&&this.state.data&&this.state.data.values&&this.state.data.texts&&this.props.context.onWidgetsChanged){const e=this.state.data.values.split(";"),t=this.state.data.texts.split(";"),n=it(this.state.data);n.values=null,n.texts=null,n.count=e.length;for(let r=1;r<=e.length;r++)n[`value${r}`]=e[r-1],n[`text${r}`]=t[r-1],n[`g_states-${r}`]=!0;n.type=this.props.tpl==="tplJquiRadioList"?"radio":"select",this.props.context.onWidgetsChanged&&setTimeout(()=>this.props.context.onWidgetsChanged([{wid:this.props.id,view:this.props.view,data:n}]),100)}if(this.state.rxData.oid&&this.state.rxData.oid!=="nothing_selected")try{const e=await this.props.context.socket.getState(this.state.rxData.oid);this.onStateUpdated(this.state.rxData.oid,e)}catch(e){console.error(`Cannot get state ${this.state.rxData.oid}: ${e}`)}}componentWillUnmount(){super.componentWillUnmount(),this.controlTimeout&&(clearTimeout(this.controlTimeout),this.controlTimeout=null)}static findField(e,t){return xe.findField(e,t)}getWidgetInfo(){return kt.getWidgetInfo()}onStateUpdated(e,t){if(e===this.state.rxData.oid&&t){const n=t.val===null||t.val===void 0?"":t.val;this.state.value!==n.toString()&&this.setState({value:n.toString()})}}getControlOid(){return this.state.rxData.click_id&&this.state.rxData.click_id!=="nothing_selected"?this.state.rxData.click_id:this.state.rxData.oid&&this.state.rxData.oid!=="nothing_selected"?this.state.rxData.oid:""}onClick(e,t){var n;if(!(this.state.rxData.readOnly||this.props.editMode))if(this.state.rxData.type==="slider")this.controlTimeout&&clearTimeout(this.controlTimeout),this.controlTimeout=setTimeout(()=>{this.controlTimeout=null;const r=this.getControlOid();r&&this.props.context.setValue(r,parseFloat(e))},t?0:parseInt(this.state.rxData.timeout,10)||300),this.setState({value:e});else{const r=this.getControlOid();r&&(typeof this.state.object=="object"&&((n=this.state.object)==null?void 0:n.common.type)==="number"?this.props.context.setValue(r,parseFloat(this.state.rxData[`value${e}`])):this.props.context.setValue(r,this.state.rxData[`value${e}`])),this.setState({value:this.state.rxData[`value${e}`]})}}getSelectedIndex(e){if(e===void 0&&(e=this.state.value),this.props.editMode){for(let t=1;t<=this.state.rxData.count;t++)if(this.state.rxData[`test${t}`])return t}for(let t=1;t<=this.state.rxData.count;t++)if(this.state.rxData[`value${t}`]===e)return t;return 0}renderIcon(e,t){let n;const r=this.state.rxData;let s=r[`icon${e}`]||r[`image${e}`];if(s&&r[`color${e}`]&&(n=r[`color${e}`],e===t&&r[`activeColor${e}`]&&(n=r[`activeColor${e}`])),s){s.startsWith("_PRJ_NAME/")&&(s=s.replace("_PRJ_NAME/",`../${this.props.context.adapterName}.${this.props.context.instance}/${this.props.context.projectName}/`));const o={color:n};return o.width="auto",o.height=24,h.jsx(N.Icon,{style:o,src:s},"icon")}return null}renderText(e,t){const n=this.state.rxData;if(n[`onlyIcon${e}`])return null;let r=n[`text${e}`],s=n[`color${e}`];return e===t&&n[`activeColor${e}`]&&(s=n[`activeColor${e}`]),r=r||n[`value${e}`],h.jsx("span",{style:{color:s},children:r})}renderButton(e,t,n){const r=this.state.rxData,s=this.renderIcon(e,t),o=this.renderText(e,t),a=h.jsx(k.Button,{disabled:this.props.editMode,style:{...n,flexGrow:1},startIcon:o?s:void 0,color:t===e?"primary":"grey",onClick:()=>this.onClick(e),children:o||s},e);return r[`tooltip${e}`]?h.jsx(k.Tooltip,{title:r[`tooltip${e}`],slotProps:{popper:{sx:{pointerEvents:"none"}}},children:a},e):a}renderRadio(e,t,n){const r=this.state.rxData,s=this.renderIcon(e,t);let o=this.renderText(e,t);s&&o&&(o=h.jsxs("div",{style:{display:"flex",gap:4},children:[s,o]}));const a=h.jsx(k.FormControlLabel,{style:n,control:h.jsx(k.Radio,{disabled:this.props.editMode,onClick:()=>this.onClick(e),checked:t===e}),labelPlacement:"end",label:o||s},e);return r[`tooltip${e}`]?h.jsx(k.Tooltip,{title:r[`tooltip${e}`],slotProps:{popper:{sx:{pointerEvents:"none"}}},children:a},e):a}renderMenuItem(e,t,n){const r=this.state.rxData,s=this.renderIcon(e,t);let o=this.renderText(e,t);return s&&o&&(o=h.jsxs("div",{style:{display:"flex",gap:4},children:[s,o]})),h.jsx(k.MenuItem,{title:r[`tooltip${e}`],disabled:this.props.editMode,selected:t===e,style:n,value:r[`value${e}`],onClick:r.open?()=>this.onClick(e):void 0,children:o||s},e)}renderWidgetBody(e){var o;super.renderWidgetBody(e);const t=this.getSelectedIndex(),n=this.state.rxData;((o=this.state.object)==null?void 0:o._id)!==this.state.rxData.oid&&this.state.object!==!1&&(Object.assign(this.state,{object:!1}),setTimeout(async()=>{var a;if(this.state.rxData.oid&&this.state.rxData.oid!=="nothing_selected"){const l=await this.props.context.socket.getObject(this.state.rxData.oid);if((a=l==null?void 0:l.common)!=null&&a.type){this.setState({object:{_id:l._id,common:{type:l.common.type},type:"state",native:{}}});return}}this.setState({object:{_id:this.state.rxData.oid,common:{type:"string"},type:"state",native:{}}})},0));const r={};Object.keys(this.state.rxStyle).forEach(a=>{const l=n[a];l!=null&&xe.POSSIBLE_MUI_STYLES.includes(a)&&(a=a.replace(/(-\w)/g,c=>c[1].toUpperCase()),r[a]=l)}),r.minWidth="unset",r.borderWidth&&(r.borderWidth=Se.correctStylePxValue(r.borderWidth)),r.fontSize&&(r.fontSize=Se.correctStylePxValue(r.fontSize));let s;if((!this.state.rxData.count||this.state.rxData.count===1&&!n.text0&&!n.icon0&&!n.image0)&&(!this.state.rxData.oid||this.state.rxData.oid==="nothing_selected"))s=h.jsx(k.Button,{variant:"outlined",style:{width:"100%",height:"100%"},children:N.I18n.t("Select object ID")});else if(!this.state.rxData.count)s=h.jsx(k.Button,{variant:"outlined",style:{width:"100%",height:"100%"},children:N.I18n.t("Please define states")});else if(this.state.rxData.type==="radio"){const a=[];for(let l=1;l<=this.state.rxData.count;l++)a.push(this.renderRadio(l,t,r));s=h.jsx(k.RadioGroup,{style:{width:"100%",height:"100%"},children:a})}else if(this.state.rxData.type==="select"){const a=[];for(let c=1;c<=this.state.rxData.count;c++)a.push(this.renderMenuItem(c,t,r));let l="standard";this.state.rxData.variant==="contained"?l="filled":this.state.rxData.variant==="outlined"&&(l="outlined"),this.state.rxData.open?s=h.jsx(k.List,{style:{width:"100%",height:"100%"},children:a}):s=h.jsx(k.Select,{disabled:this.props.editMode,style:{width:"100%",height:"100%"},value:this.state.value===void 0?"":this.state.value,onChange:c=>this.onClick(this.getSelectedIndex(c.target.value)),variant:l,sx:{"& .MuiSelect-select":l==="filled"?{mb:"10px"}:void 0},children:a})}else if(this.state.rxData.type==="slider"){e.style.overflow="visible";const a=[];for(let l=1;l<=this.state.rxData.count;l++)a.push({value:parseFloat(n[`value${l}`])||0,label:n[`text${l}`]||0});s=h.jsx(k.Slider,{disabled:this.props.editMode,style:!this.state.rxData.orientation||this.state.rxData.orientation==="horizontal"?{marginLeft:20,marginRight:20,width:"calc(100% - 40px)"}:{marginTop:10,marginBottom:10},value:parseFloat(this.state.value)||0,valueLabelDisplay:"auto",min:a[0].value,max:a[a.length-1].value,orientation:this.state.rxData.orientation||"horizontal",marks:a,onChangeCommitted:(l,c)=>this.onClick(c,!0),onChange:(l,c)=>this.onClick(c)})}else{const a=[];for(let l=1;l<=this.state.rxData.count;l++)a.push(this.renderButton(l,t,r));s=h.jsx(k.ButtonGroup,{disabled:this.props.editMode,style:{width:"100%",height:"100%"},orientation:this.state.rxData.orientation||"horizontal",variant:this.state.rxData.variant===void 0?"contained":this.state.rxData.variant==="standard"?"text":this.state.rxData.variant,children:a})}return this.state.rxData.widgetTitle&&(s=h.jsxs(k.FormControl,{fullWidth:!0,variant:this.state.rxData.variant===void 0||this.state.rxData.variant==="text"?"standard":this.state.rxData.variant==="contained"?"filled":this.state.rxData.variant,style:{marginTop:this.state.rxData.type==="select"&&this.state.rxData.variant==="outlined"?5:void 0,width:"100%",height:this.state.rxData.type==="select"&&this.state.rxData.variant==="outlined"?"calc(100% - 5px)":"100%"},children:[this.state.rxData.type==="select"?h.jsx(k.InputLabel,{children:this.state.rxData.widgetTitle}):h.jsx(k.FormLabel,{style:this.state.rxData.type==="slider"?{marginLeft:10}:void 0,children:this.state.rxData.widgetTitle}),s]})),h.jsx("div",{className:"vis-widget-body",children:s})}}class tl extends kt{static getWidgetInfo(){const t={id:"tplJquiRadioList",visSet:"jqui",visName:"Radiobuttons ValueList",visWidgetLabel:"jqui_radio_list",visPrev:"widgets/jqui/img/Prev_RadioList.png",visOrder:15,visAttrs:kt.getWidgetInfo().visAttrs,visDefaultStyle:{width:250,height:45}},n=kt.findField(t,"type");return n.default="radio",t.visAttrs[0].fields.unshift({name:"_note",type:"help",text:"jqui_state_note"}),t}getWidgetInfo(){return tl.getWidgetInfo()}}class il extends kt{static getWidgetInfo(){const t={id:"tplJquiSelectList",visSet:"jqui",visName:"Select ValueList",visWidgetLabel:"jqui_select_list",visPrev:"widgets/jqui/img/Prev_SelectList.png",visOrder:16,visAttrs:kt.getWidgetInfo().visAttrs,visDefaultStyle:{width:250,height:45}},n=kt.findField(t,"type");return n.default="select",t.visAttrs[0].fields.unshift({name:"_note",type:"help",text:"jqui_state_note"}),t}getWidgetInfo(){return il.getWidgetInfo()}}class nl extends Ze{static getWidgetInfo(){const t={id:"tplIconStatePushButton",visSet:"jqui",visName:"Binary Icon Push Button",visWidgetLabel:"jqui_icon_state_push_button",visPrev:"widgets/jqui/img/Prev_IconPushButton.png",visOrder:15,visAttrs:Ze.getWidgetInfo().visAttrs,visDefaultStyle:{width:70,height:30}},n=Ze.findField(t,"pushMode");return n&&(n.default=!0),t.visAttrs[0].fields.unshift({name:"_note",type:"help",text:"jqui_button_binary_control_note"}),t}getWidgetInfo(){return nl.getWidgetInfo()}}class rl extends Ze{static getWidgetInfo(){const t={id:"tplIconStateBool",visSet:"jqui",visName:"Binary Icon State",visWidgetLabel:"jqui_icon_state_bool",visPrev:"widgets/jqui/img/Prev_IconStateBool.png",visOrder:15,visAttrs:Ze.getWidgetInfo().visAttrs,visDefaultStyle:{width:70,height:30}},n=Ze.findField(t,"icon_false");return n&&(n.default="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBmaWxsPSJjdXJyZW50Q29sb3IiIGQ9Ik05IDIxYzAgLjUuNCAxIDEgMWg0Yy42IDAgMS0uNSAxLTF2LTFIOXYxem0zLTE5QzguMSAyIDUgNS4xIDUgOWMwIDIuNCAxLjIgNC41IDMgNS43VjE3YzAgLjUuNCAxIDEgMWg2Yy42IDAgMS0uNSAxLTF2LTIuM2MxLjgtMS4zIDMtMy40IDMtNS43YzAtMy45LTMuMS03LTctN3oiLz48L3N2Zz4="),t.visAttrs[0].fields.unshift({name:"_note",type:"help",text:"jqui_button_binary_control_note"}),t}getWidgetInfo(){return rl.getWidgetInfo()}}class sl extends kt{static getWidgetInfo(){const t={id:"tplJquiRadioSteps",visSet:"jqui",visName:"Radiobuttons 25%",visWidgetLabel:"jqui_radio_steps",visPrev:"widgets/jqui/img/Prev_RadioSteps.png",visOrder:25,visAttrs:kt.getWidgetInfo().visAttrs,visDefaultStyle:{width:350,height:35}};return t.visAttrs[0].fields.unshift({name:"_note",type:"help",text:"jqui_state_note"}),t}getWidgetInfo(){return sl.getWidgetInfo()}}class Ei extends xe{controlTimeout=null;lastChanged=0;constructor(e){super(e),Object.assign(this.state,{value:"",valueMax:null})}static getWidgetInfo(){return{id:"tplJquiSlider",visSet:"jqui",visName:"Slider",visWidgetLabel:"jqui_slider",visPrev:"widgets/jqui/img/Prev_Slider.png",visOrder:24,visAttrs:[{name:"common",fields:[{name:"type",label:"jqui_type",type:"select",options:[{value:"single",label:"jqui_single"},{value:"range",label:"jqui_range"}]},{name:"oid",type:"id",onChange:async(e,t,n,r)=>{var s,o,a,l,c,u,p;if(t.oid&&t.oid!=="nothing_selected"){const d=await r.getObject(t.oid);let f=!1;((s=d==null?void 0:d.common)==null?void 0:s.min)!==void 0&&((o=d==null?void 0:d.common)==null?void 0:o.min)!==null&&(t.min!==d.common.min&&(t.min=d.common.min,f=!0),t.text!==d.common.min.toString()+(d.common.unit||"")&&(t.text=d.common.min.toString()+(d.common.unit||""),f=!0)),((a=d==null?void 0:d.common)==null?void 0:a.max)!==void 0&&((l=d==null?void 0:d.common)==null?void 0:l.max)!==null&&(t.max!==d.common.max&&(t.max=d.common.max,f=!0),t["text-2"]!==d.common.max.toString()+(d.common.unit||"")&&(t["text-2"]=d.common.max.toString()+(d.common.unit||""),f=!0)),(c=d==null?void 0:d.common)!=null&&c.unit&&t.unit!==d.common.unit&&(t.unit=d.common.unit,f=!0),t.step||((u=d==null?void 0:d.common)==null?void 0:u.step)!==void 0&&((p=d==null?void 0:d.common)==null?void 0:p.step)!==null&&t.step!==d.common.step&&(t.step=d.common.step,f=!0),f&&n(t)}}},{name:"click_id",type:"id",noSubscribe:!0},{name:"inverted",type:"checkbox",label:"jqui_inverted"},{name:"min",type:"number",label:"jqui_min"},{name:"max",type:"number",label:"jqui_max"},{name:"min_distance",type:"number",hidden:e=>e.type!=="range"},{name:"shift_min_distance",type:"checkbox",hidden:e=>e.type!=="range"||!e.min_distance},{name:"step",type:"number",min:0},{name:"unit"},{name:"timeout",label:"jqui_set_timeout",type:"number"},{name:"oid-working",label:"jqui_oid_working",type:"id"}]},{name:"second",hidden:e=>e.type!=="range",fields:[{name:"inverted-2",type:"checkbox",label:"jqui_inverted"},{name:"oid-2",type:"id",hidden:e=>e.type!=="range"},{name:"click_id-2",type:"id",noSubscribe:!0,hidden:e=>!e["oid-2"]||e.type!=="range"}]},{name:"style",fields:[{name:"widgetTitle",label:"jqui_name",type:"text"},{name:"orientation",label:"orientation",type:"select",options:["horizontal","vertical"],default:"horizontal"},{name:"text",label:"jqui_text",hidden:e=>!!e.icon||!!e.image},{name:"text-2",label:"jqui_text_max",hidden:e=>!!e["icon-2"]||!!e["image-2"]},{name:"image",label:"jqui_image",type:"image",hidden:e=>!!e.icon||!!e.text},{name:"icon",label:"jqui_icon",type:"icon64",hidden:e=>!!e.image||!!e.text},{name:"image-2",label:"jqui_image_max",type:"image",hidden:e=>!!e["icon-2"]||!!e["text-2"]},{name:"icon-2",label:"jqui_icon_max",type:"icon64",hidden:e=>!!e["image-2"]||!!e["text-2"]},{name:"valueLabelDisplay",type:"select",label:"jqui_value_label_display",options:[{value:"auto",label:"jqui_auto"},{value:"on",label:"jqui_on"},{value:"off",label:"jqui_off"}]}]}],visDefaultStyle:{width:300,height:40}}}async componentDidMount(){if(super.componentDidMount(),this.state.rxData.oid&&this.state.rxData.oid!=="nothing_selected")try{const e=await this.props.context.socket.getState(this.state.rxData.oid);this.onStateUpdated(this.state.rxData.oid,e)}catch(e){console.error(`Cannot get state ${this.state.rxData.oid}: ${e}`)}if(this.state.rxData.type==="range"&&this.state.rxData["oid-2"]&&this.state.rxData["oid-2"]!=="nothing_selected")try{const e=await this.props.context.socket.getState(this.state.rxData["oid-2"]);this.onStateUpdated(this.state.rxData["oid-2"],e)}catch(e){console.error(`Cannot get state ${this.state.rxData.oid}: ${e}`)}}componentWillUnmount(){super.componentWillUnmount(),this.controlTimeout&&(clearTimeout(this.controlTimeout),this.controlTimeout=null)}static findField(e,t){return xe.findField(e,t)}getWidgetInfo(){return Ei.getWidgetInfo()}onStateUpdated(e,t){if(e===this.state.rxData.oid&&t){let n=parseFloat(t.val===null||t.val===void 0?"0":t.val)||0;this.state.rxData.inverted&&(n=parseFloat(this.state.rxData.max)-n+parseFloat(this.state.rxData.min)),this.state.value!==n.toString()&&this.setState({value:n.toString()})}else if(e===this.state.rxData["oid-2"]&&t){let n=parseFloat(t.val===null||t.val===void 0?"0":t.val)||0;this.state.rxData["inverted-2"]&&(n=parseFloat(this.state.rxData.max)-n+parseFloat(this.state.rxData.min)),this.state.valueMax!==n&&this.setState({valueMax:n})}}getControlOid(e){if(e){if(this.state.rxData["click_id-2"]&&this.state.rxData["click_id-2"]!=="nothing_selected")return this.state.rxData["click_id-2"];if(this.state.rxData["oid-2"]&&this.state.rxData["oid-2"]!=="nothing_selected")return this.state.rxData["oid-2"]}else{if(this.state.rxData.click_id&&this.state.rxData.click_id!=="nothing_selected")return this.state.rxData.click_id;if(this.state.rxData.oid&&this.state.rxData.oid!=="nothing_selected")return this.state.rxData.oid}return""}onChange(e,t,n){if(this.props.editMode)return;this.newState=this.newState||{};const r=(t||this.state.rxData.type==="range")&&parseFloat(this.state.rxData.min_distance)||0;let s,o;t?Array.isArray(e)?(console.log(`Set ${e[0]} - ${e[1]}`),o=e[0],s=e[1],r&&(this.lastChanged===2?this.state.rxData.shift_min_distance?(s=Math.max(s,parseFloat(this.state.rxData.min)+r),s-r<o&&(o=s-r)):s=Math.max(s,parseFloat(this.state.value)+r):this.state.rxData.shift_min_distance?(o=Math.min(o,parseFloat(this.state.rxData.max)-r),s=this.state.valueMax,s-r<o&&(s=o+r)):o=Math.min(o,this.state.valueMax-r)),console.log(`Set ${o} - ${s}`)):(this.lastChanged=2,s=e,r&&(this.state.rxData.shift_min_distance?(s=Math.max(s,parseFloat(this.state.rxData.min)+r),o=parseFloat(this.state.value),s-r<o&&(o=s-r)):s=Math.max(e,parseFloat(this.state.value)+r)),console.log(`Set (${o||this.state.value}) - ${s}`)):(this.lastChanged=1,o=e,r&&(this.state.rxData.shift_min_distance?(o=Math.min(o,parseFloat(this.state.rxData.max)-r),s=this.state.valueMax,s-r<o&&(s=o+r)):o=Math.min(o,this.state.valueMax-r)),console.log(`Set ${o} - (${s||this.state.valueMax})`)),this.newState.valueMax=s,this.newState.value=o.toString(),this.controlTimeout&&clearTimeout(this.controlTimeout),this.controlTimeout=setTimeout(()=>{this.controlTimeout=null;const a=this.newState;if(this.newState=null,!a){console.error("This can't be true!");return}if(a.value!==void 0){const l=this.getControlOid();if(l){let c=parseFloat(a.value);this.state.rxData.inverted&&(c=parseFloat(this.state.rxData.max)-c+parseFloat(this.state.rxData.min)),this.state.values[`${this.state.rxData.oid}.val`]!==c&&this.props.context.setValue(l,c)}}if(a.valueMax!==void 0){const l=this.getControlOid(!0);if(l){let c=a.valueMax;this.state.rxData["inverted-2"]&&(c=parseFloat(this.state.rxData.max)-c+parseFloat(this.state.rxData.min)),this.state.values[`${this.state.rxData["oid-2"]}.val`]!==c&&this.props.context.setValue(l,c)}}},n?0:parseInt(this.state.rxData.timeout,10)||300),this.setState(this.newState)}renderIcon(e){let t;return e?t=this.state.rxData["icon-2"]||this.state.rxData["image-2"]:t=this.state.rxData.icon||this.state.rxData.image,t?(t&&t.startsWith("_PRJ_NAME/")&&(t=t.replace("_PRJ_NAME/",`../${this.props.context.adapterName}.${this.props.context.instance}/${this.props.context.projectName}/`)),h.jsx(N.Icon,{src:t})):null}renderText(e){return e?this.state.rxData["text-2"]:this.state.rxData.text}renderWidgetBody(e){super.renderWidgetBody(e),e.style.overflow="visible";const t=this.state.rxData.step===void 0||this.state.rxData.step===null?0:parseFloat(this.state.rxData.step);let n;return this.state.rxData.type==="range"?n=h.jsx(k.Slider,{valueLabelFormat:r=>r+(this.state.rxData.unit||""),value:[parseFloat(this.state.value)||0,this.state.valueMax||0],valueLabelDisplay:this.state.rxData.valueLabelDisplay||"auto",min:parseFloat(this.state.rxData.min===void 0||this.state.rxData.min===null?"0":this.state.rxData.min),max:parseFloat(this.state.rxData.max===void 0||this.state.rxData.max===null?"100":this.state.rxData.max),orientation:this.state.rxData.orientation||"horizontal",disabled:!!this.state.values[`${this.state.rxData["oid-working"]}.val`],step:t===0?void 0:t,disableSwap:this.state.rxData.type==="range"?!0:void 0,marks:t===0?void 0:!0,onChangeCommitted:(r,s)=>this.onChange(s,!0,!0),onChange:(r,s,o)=>this.onChange(s[o],!!o)},"control"):n=h.jsx(k.Slider,{valueLabelFormat:r=>r+(this.state.rxData.unit||""),value:parseFloat(this.state.value)||0,valueLabelDisplay:this.state.rxData.valueLabelDisplay||"auto",min:parseFloat(this.state.rxData.min===void 0||this.state.rxData.min===null?"0":this.state.rxData.min),max:parseFloat(this.state.rxData.max===void 0||this.state.rxData.max===null?"100":this.state.rxData.max),disabled:!!this.state.values[`${this.state.rxData["oid-working"]}.val`],orientation:this.state.rxData.orientation||"horizontal",step:t===0?void 0:t,marks:t===0?void 0:!0,onChangeCommitted:(r,s)=>this.onChange(s,!1,!0),onChange:(r,s)=>this.onChange(s)},"control2"),(this.state.rxData.text||this.state.rxData["text-2"]||this.state.rxData.icon||this.state.rxData["icon-2"]||this.state.rxData.image||this.state.rxData["image-2"])&&(n=h.jsxs(k.Stack,{spacing:1,style:{width:"100%",height:"100%"},direction:this.state.rxData.orientation==="vertical"?"column":"row",sx:{mb:1},alignItems:"center",children:[this.renderText(this.state.rxData.orientation==="vertical"),this.renderIcon(this.state.rxData.orientation==="vertical"),n,this.renderIcon(this.state.rxData.orientation!=="vertical"),this.renderText(this.state.rxData.orientation!=="vertical")]},"stack")),this.state.rxData.widgetTitle&&(n=h.jsxs(k.FormControl,{fullWidth:!0,style:{width:"100%",height:"100%"},children:[h.jsx(k.FormLabel,{style:{marginLeft:10},children:this.state.rxData.widgetTitle}),n]},"form")),this.state.rxData["oid-working"]&&this.state.values[`${this.state.rxData["oid-working"]}.val`]&&(n=[n,h.jsx(k.LinearProgress,{style:{position:"absolute",bottom:0,left:0,right:0}},"progress")]),h.jsx("div",{className:"vis-widget-body",style:{position:"relative"},children:n})}}class ol extends Ei{static getWidgetInfo(){const t={id:"tplJquiSliderVertical",visSet:"jqui",visName:"Vertical slider ",visWidgetLabel:"jqui_slider_vertical",visPrev:"widgets/jqui/img/Prev_SliderVertical.png",visOrder:25,visAttrs:Ei.getWidgetInfo().visAttrs,visDefaultStyle:{width:40,height:300}};t.visAttrs[0].fields.unshift({name:"_note",type:"help",text:"jqui_slider_note"});const n=Ei.findField(t,"orientation");return n.default="vertical",t}getWidgetInfo(){return ol.getWidgetInfo()}}var al={exports:{}},P0=al.exports;(function(i,e){(function(t,n){i.exports=n()})(P0,function(){var t=1e3,n=6e4,r=36e5,s="millisecond",o="second",a="minute",l="hour",c="day",u="week",p="month",d="quarter",f="year",m="date",v="Invalid Date",g=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,x=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,y={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(j){var O=["th","st","nd","rd"],R=j%100;return"["+j+(O[(R-20)%10]||O[R]||O[0])+"]"}},w=function(j,O,R){var B=String(j);return!B||B.length>=O?j:""+Array(O+1-B.length).join(R)+j},S={s:w,z:function(j){var O=-j.utcOffset(),R=Math.abs(O),B=Math.floor(R/60),$=R%60;return(O<=0?"+":"-")+w(B,2,"0")+":"+w($,2,"0")},m:function j(O,R){if(O.date()<R.date())return-j(R,O);var B=12*(R.year()-O.year())+(R.month()-O.month()),$=O.clone().add(B,p),J=R-$<0,q=O.clone().add(B+(J?-1:1),p);return+(-(B+(R-$)/(J?$-q:q-$))||0)},a:function(j){return j<0?Math.ceil(j)||0:Math.floor(j)},p:function(j){return{M:p,y:f,w:u,d:c,D:m,h:l,m:a,s:o,ms:s,Q:d}[j]||String(j||"").toLowerCase().replace(/s$/,"")},u:function(j){return j===void 0}},M="en",b={};b[M]=y;var I="$isDayjsObject",P=function(j){return j instanceof W||!(!j||!j[I])},E=function j(O,R,B){var $;if(!O)return M;if(typeof O=="string"){var J=O.toLowerCase();b[J]&&($=J),R&&(b[J]=R,$=J);var q=O.split("-");if(!$&&q.length>1)return j(q[0])}else{var L=O.name;b[L]=O,$=L}return!B&&$&&(M=$),$||!B&&M},A=function(j,O){if(P(j))return j.clone();var R=typeof O=="object"?O:{};return R.date=j,R.args=arguments,new W(R)},T=S;T.l=E,T.i=P,T.w=function(j,O){return A(j,{locale:O.$L,utc:O.$u,x:O.$x,$offset:O.$offset})};var W=function(){function j(R){this.$L=E(R.locale,null,!0),this.parse(R),this.$x=this.$x||R.x||{},this[I]=!0}var O=j.prototype;return O.parse=function(R){this.$d=function(B){var $=B.date,J=B.utc;if($===null)return new Date(NaN);if(T.u($))return new Date;if($ instanceof Date)return new Date($);if(typeof $=="string"&&!/Z$/i.test($)){var q=$.match(g);if(q){var L=q[2]-1||0,Q=(q[7]||"0").substring(0,3);return J?new Date(Date.UTC(q[1],L,q[3]||1,q[4]||0,q[5]||0,q[6]||0,Q)):new Date(q[1],L,q[3]||1,q[4]||0,q[5]||0,q[6]||0,Q)}}return new Date($)}(R),this.init()},O.init=function(){var R=this.$d;this.$y=R.getFullYear(),this.$M=R.getMonth(),this.$D=R.getDate(),this.$W=R.getDay(),this.$H=R.getHours(),this.$m=R.getMinutes(),this.$s=R.getSeconds(),this.$ms=R.getMilliseconds()},O.$utils=function(){return T},O.isValid=function(){return this.$d.toString()!==v},O.isSame=function(R,B){var $=A(R);return this.startOf(B)<=$&&$<=this.endOf(B)},O.isAfter=function(R,B){return A(R)<this.startOf(B)},O.isBefore=function(R,B){return this.endOf(B)<A(R)},O.$g=function(R,B,$){return T.u(R)?this[B]:this.set($,R)},O.unix=function(){return Math.floor(this.valueOf()/1e3)},O.valueOf=function(){return this.$d.getTime()},O.startOf=function(R,B){var $=this,J=!!T.u(B)||B,q=T.p(R),L=function(K,se){var ae=T.w($.$u?Date.UTC($.$y,se,K):new Date($.$y,se,K),$);return J?ae:ae.endOf(c)},Q=function(K,se){return T.w($.toDate()[K].apply($.toDate("s"),(J?[0,0,0,0]:[23,59,59,999]).slice(se)),$)},G=this.$W,ne=this.$M,U=this.$D,re="set"+(this.$u?"UTC":"");switch(q){case f:return J?L(1,0):L(31,11);case p:return J?L(1,ne):L(0,ne+1);case u:var ie=this.$locale().weekStart||0,Y=(G<ie?G+7:G)-ie;return L(J?U-Y:U+(6-Y),ne);case c:case m:return Q(re+"Hours",0);case l:return Q(re+"Minutes",1);case a:return Q(re+"Seconds",2);case o:return Q(re+"Milliseconds",3);default:return this.clone()}},O.endOf=function(R){return this.startOf(R,!1)},O.$set=function(R,B){var $,J=T.p(R),q="set"+(this.$u?"UTC":""),L=($={},$[c]=q+"Date",$[m]=q+"Date",$[p]=q+"Month",$[f]=q+"FullYear",$[l]=q+"Hours",$[a]=q+"Minutes",$[o]=q+"Seconds",$[s]=q+"Milliseconds",$)[J],Q=J===c?this.$D+(B-this.$W):B;if(J===p||J===f){var G=this.clone().set(m,1);G.$d[L](Q),G.init(),this.$d=G.set(m,Math.min(this.$D,G.daysInMonth())).$d}else L&&this.$d[L](Q);return this.init(),this},O.set=function(R,B){return this.clone().$set(R,B)},O.get=function(R){return this[T.p(R)]()},O.add=function(R,B){var $,J=this;R=Number(R);var q=T.p(B),L=function(ne){var U=A(J);return T.w(U.date(U.date()+Math.round(ne*R)),J)};if(q===p)return this.set(p,this.$M+R);if(q===f)return this.set(f,this.$y+R);if(q===c)return L(1);if(q===u)return L(7);var Q=($={},$[a]=n,$[l]=r,$[o]=t,$)[q]||1,G=this.$d.getTime()+R*Q;return T.w(G,this)},O.subtract=function(R,B){return this.add(-1*R,B)},O.format=function(R){var B=this,$=this.$locale();if(!this.isValid())return $.invalidDate||v;var J=R||"YYYY-MM-DDTHH:mm:ssZ",q=T.z(this),L=this.$H,Q=this.$m,G=this.$M,ne=$.weekdays,U=$.months,re=$.meridiem,ie=function(se,ae,oe,V){return se&&(se[ae]||se(B,J))||oe[ae].slice(0,V)},Y=function(se){return T.s(L%12||12,se,"0")},K=re||function(se,ae,oe){var V=se<12?"AM":"PM";return oe?V.toLowerCase():V};return J.replace(x,function(se,ae){return ae||function(oe){switch(oe){case"YY":return String(B.$y).slice(-2);case"YYYY":return T.s(B.$y,4,"0");case"M":return G+1;case"MM":return T.s(G+1,2,"0");case"MMM":return ie($.monthsShort,G,U,3);case"MMMM":return ie(U,G);case"D":return B.$D;case"DD":return T.s(B.$D,2,"0");case"d":return String(B.$W);case"dd":return ie($.weekdaysMin,B.$W,ne,2);case"ddd":return ie($.weekdaysShort,B.$W,ne,3);case"dddd":return ne[B.$W];case"H":return String(L);case"HH":return T.s(L,2,"0");case"h":return Y(1);case"hh":return Y(2);case"a":return K(L,Q,!0);case"A":return K(L,Q,!1);case"m":return String(Q);case"mm":return T.s(Q,2,"0");case"s":return String(B.$s);case"ss":return T.s(B.$s,2,"0");case"SSS":return T.s(B.$ms,3,"0");case"Z":return q}return null}(se)||q.replace(":","")})},O.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},O.diff=function(R,B,$){var J,q=this,L=T.p(B),Q=A(R),G=(Q.utcOffset()-this.utcOffset())*n,ne=this-Q,U=function(){return T.m(q,Q)};switch(L){case f:J=U()/12;break;case p:J=U();break;case d:J=U()/3;break;case u:J=(ne-G)/6048e5;break;case c:J=(ne-G)/864e5;break;case l:J=ne/r;break;case a:J=ne/n;break;case o:J=ne/t;break;default:J=ne}return $?J:T.a(J)},O.daysInMonth=function(){return this.endOf(p).$D},O.$locale=function(){return b[this.$L]},O.locale=function(R,B){if(!R)return this.$L;var $=this.clone(),J=E(R,B,!0);return J&&($.$L=J),$},O.clone=function(){return T.w(this.$d,this)},O.toDate=function(){return new Date(this.valueOf())},O.toJSON=function(){return this.isValid()?this.toISOString():null},O.toISOString=function(){return this.$d.toISOString()},O.toString=function(){return this.$d.toUTCString()},j}(),F=W.prototype;return A.prototype=F,[["$ms",s],["$s",o],["$m",a],["$H",l],["$W",c],["$M",p],["$y",f],["$D",m]].forEach(function(j){F[j[1]]=function(O){return this.$g(O,j[0],j[1])}}),A.extend=function(j,O){return j.$i||(j(O,W,A),j.$i=!0),A},A.locale=E,A.isDayjs=P,A.unix=function(j){return A(1e3*j)},A.en=b[M],A.Ls=b,A.p={},A})})(al);var Ot=al.exports;const Be=Jt(Ot),O0=["localeText"],So=D.createContext(null),ll=function(e){const{localeText:t}=e,n=me(e,O0),{utils:r,localeText:s}=D.useContext(So)??{utils:void 0,localeText:void 0},o=Ie({props:n,name:"MuiLocalizationProvider"}),{children:a,dateAdapter:l,dateFormats:c,dateLibInstance:u,adapterLocale:p,localeText:d}=o,f=D.useMemo(()=>_({},d,s,t),[d,s,t]),m=D.useMemo(()=>{if(!l)return r||null;const x=new l({locale:p,formats:c,instance:u});if(!x.isMUIAdapter)throw new Error(["MUI X: The date adapter should be imported from `@mui/x-date-pickers` or `@mui/x-date-pickers-pro`, not from `@date-io`","For example, `import { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs'` instead of `import AdapterDayjs from '@date-io/dayjs'`","More information on the installation documentation: https://mui.com/x/react-date-pickers/getting-started/#installation"].join(`
`));return x},[l,p,c,u,r]),v=D.useMemo(()=>m?{minDate:m.date("1900-01-01T00:00:00.000"),maxDate:m.date("2099-12-31T00:00:00.000")}:null,[m]),g=D.useMemo(()=>({utils:m,defaultDates:v,localeText:f}),[v,m,f]);return h.jsx(So.Provider,{value:g,children:a})},j0=i=>({components:{MuiLocalizationProvider:{defaultProps:{localeText:_({},i)}}}}),gs=i=>{const{utils:e,formatKey:t,contextTranslation:n,propsTranslation:r}=i;return s=>{const o=s!==null&&e.isValid(s)?e.format(s,t):null;return(r??n)(s,e,o)}},zp={previousMonth:"Previous month",nextMonth:"Next month",openPreviousView:"Open previous view",openNextView:"Open next view",calendarViewSwitchingButtonAriaLabel:i=>i==="year"?"year view is open, switch to calendar view":"calendar view is open, switch to year view",start:"Start",end:"End",startDate:"Start date",startTime:"Start time",endDate:"End date",endTime:"End time",cancelButtonLabel:"Cancel",clearButtonLabel:"Clear",okButtonLabel:"OK",todayButtonLabel:"Today",datePickerToolbarTitle:"Select date",dateTimePickerToolbarTitle:"Select date & time",timePickerToolbarTitle:"Select time",dateRangePickerToolbarTitle:"Select date range",clockLabelText:(i,e,t,n)=>`Select ${i}. ${!n&&(e===null||!t.isValid(e))?"No time selected":`Selected time is ${n??t.format(e,"fullTime")}`}`,hoursClockNumberText:i=>`${i} hours`,minutesClockNumberText:i=>`${i} minutes`,secondsClockNumberText:i=>`${i} seconds`,selectViewText:i=>`Select ${i}`,calendarWeekNumberHeaderLabel:"Week number",calendarWeekNumberHeaderText:"#",calendarWeekNumberAriaLabelText:i=>`Week ${i}`,calendarWeekNumberText:i=>`${i}`,openDatePickerDialogue:(i,e,t)=>t||i!==null&&e.isValid(i)?`Choose date, selected date is ${t??e.format(i,"fullDate")}`:"Choose date",openTimePickerDialogue:(i,e,t)=>t||i!==null&&e.isValid(i)?`Choose time, selected time is ${t??e.format(i,"fullTime")}`:"Choose time",fieldClearLabel:"Clear",timeTableLabel:"pick time",dateTableLabel:"pick date",fieldYearPlaceholder:i=>"Y".repeat(i.digitAmount),fieldMonthPlaceholder:i=>i.contentType==="letter"?"MMMM":"MM",fieldDayPlaceholder:()=>"DD",fieldWeekDayPlaceholder:i=>i.contentType==="letter"?"EEEE":"EE",fieldHoursPlaceholder:()=>"hh",fieldMinutesPlaceholder:()=>"mm",fieldSecondsPlaceholder:()=>"ss",fieldMeridiemPlaceholder:()=>"aa",year:"Year",month:"Month",day:"Day",weekDay:"Week day",hours:"Hours",minutes:"Minutes",seconds:"Seconds",meridiem:"Meridiem",empty:"Empty"},E0=zp;j0(zp);const wi=()=>{const i=D.useContext(So);if(i===null)throw new Error(["MUI X: Can not find the date and time pickers localization context.","It looks like you forgot to wrap your component in LocalizationProvider.","This can also happen if you are bundling multiple versions of the `@mui/x-date-pickers` package"].join(`
`));if(i.utils===null)throw new Error(["MUI X: Can not find the date and time pickers adapter from its localization context.","It looks like you forgot to pass a `dateAdapter` to your LocalizationProvider."].join(`
`));const e=D.useMemo(()=>_({},E0,i.localeText),[i.localeText]);return D.useMemo(()=>_({},i,{localeText:e}),[i,e])},Me=()=>wi().utils,Un=()=>wi().defaultDates,Di=i=>{const e=Me(),t=D.useRef(void 0);return t.current===void 0&&(t.current=e.date(void 0,i)),t.current},Qe=()=>wi().localeText;function R0(i,e){return i.classList?!!e&&i.classList.contains(e):(" "+(i.className.baseVal||i.className)+" ").indexOf(" "+e+" ")!==-1}function A0(i,e){i.classList?i.classList.add(e):R0(i,e)||(typeof i.className=="string"?i.className=i.className+" "+e:i.setAttribute("class",(i.className&&i.className.baseVal||"")+" "+e))}function cd(i,e){return i.replace(new RegExp("(^|\\s)"+e+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}function N0(i,e){i.classList?i.classList.remove(e):typeof i.className=="string"?i.className=cd(i.className,e):i.setAttribute("class",cd(i.className&&i.className.baseVal||"",e))}var $0=function(e,t){return e&&t&&t.split(" ").forEach(function(n){return A0(e,n)})},Gs=function(e,t){return e&&t&&t.split(" ").forEach(function(n){return N0(e,n)})},cl=function(i){Mo(e,i);function e(){for(var n,r=arguments.length,s=new Array(r),o=0;o<r;o++)s[o]=arguments[o];return n=i.call.apply(i,[this].concat(s))||this,n.appliedClasses={appear:{},enter:{},exit:{}},n.onEnter=function(a,l){var c=n.resolveArguments(a,l),u=c[0],p=c[1];n.removeClasses(u,"exit"),n.addClass(u,p?"appear":"enter","base"),n.props.onEnter&&n.props.onEnter(a,l)},n.onEntering=function(a,l){var c=n.resolveArguments(a,l),u=c[0],p=c[1],d=p?"appear":"enter";n.addClass(u,d,"active"),n.props.onEntering&&n.props.onEntering(a,l)},n.onEntered=function(a,l){var c=n.resolveArguments(a,l),u=c[0],p=c[1],d=p?"appear":"enter";n.removeClasses(u,d),n.addClass(u,d,"done"),n.props.onEntered&&n.props.onEntered(a,l)},n.onExit=function(a){var l=n.resolveArguments(a),c=l[0];n.removeClasses(c,"appear"),n.removeClasses(c,"enter"),n.addClass(c,"exit","base"),n.props.onExit&&n.props.onExit(a)},n.onExiting=function(a){var l=n.resolveArguments(a),c=l[0];n.addClass(c,"exit","active"),n.props.onExiting&&n.props.onExiting(a)},n.onExited=function(a){var l=n.resolveArguments(a),c=l[0];n.removeClasses(c,"exit"),n.addClass(c,"exit","done"),n.props.onExited&&n.props.onExited(a)},n.resolveArguments=function(a,l){return n.props.nodeRef?[n.props.nodeRef.current,a]:[a,l]},n.getClassNames=function(a){var l=n.props.classNames,c=typeof l=="string",u=c&&l?l+"-":"",p=c?""+u+a:l[a],d=c?p+"-active":l[a+"Active"],f=c?p+"-done":l[a+"Done"];return{baseClassName:p,activeClassName:d,doneClassName:f}},n}var t=e.prototype;return t.addClass=function(r,s,o){var a=this.getClassNames(s)[o+"ClassName"],l=this.getClassNames("enter"),c=l.doneClassName;s==="appear"&&o==="done"&&c&&(a+=" "+c),o==="active"&&r&&sf(r),a&&(this.appliedClasses[s][o]=a,$0(r,a))},t.removeClasses=function(r,s){var o=this.appliedClasses[s],a=o.base,l=o.active,c=o.done;this.appliedClasses[s]={},a&&Gs(r,a),l&&Gs(r,l),c&&Gs(r,c)},t.render=function(){var r=this.props;r.classNames;var s=me(r,["classNames"]);return ve.createElement(of,_({},s,{onEnter:this.onEnter,onEntered:this.onEntered,onEntering:this.onEntering,onExit:this.onExit,onExiting:this.onExiting,onExited:this.onExited}))},e}(ve.Component);cl.defaultProps={classNames:""};cl.propTypes={};const W0=Xt(h.jsx("path",{d:"M7 10l5 5 5-5z"}),"ArrowDropDown"),F0=Xt(h.jsx("path",{d:"M15.41 16.59L10.83 12l4.58-4.59L14 6l-6 6 6 6 1.41-1.41z"}),"ArrowLeft"),L0=Xt(h.jsx("path",{d:"M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"}),"ArrowRight"),B0=Xt(h.jsx("path",{d:"M17 12h-5v5h5v-5zM16 1v2H8V1H6v2H5c-1.11 0-1.99.9-1.99 2L3 19c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2h-1V1h-2zm3 18H5V8h14v11z"}),"Calendar"),V0=Xt(h.jsxs(D.Fragment,{children:[h.jsx("path",{d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}),h.jsx("path",{d:"M12.5 7H11v6l5.25 3.15.75-1.23-4.5-2.67z"})]}),"Clock");Xt(h.jsx("path",{d:"M9 11H7v2h2v-2zm4 0h-2v2h2v-2zm4 0h-2v2h2v-2zm2-7h-1V2h-2v2H8V2H6v2H5c-1.11 0-1.99.9-1.99 2L3 20c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 16H5V9h14v11z"}),"DateRange");Xt(h.jsxs(D.Fragment,{children:[h.jsx("path",{d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}),h.jsx("path",{d:"M12.5 7H11v6l5.25 3.15.75-1.23-4.5-2.67z"})]}),"Time");const z0=Xt(h.jsx("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Clear");function H0(i){return Oe("MuiPickersArrowSwitcher",i)}je("MuiPickersArrowSwitcher",["root","spacer","button","previousIconButton","nextIconButton","leftArrowIcon","rightArrowIcon"]);const q0=["children","className","slots","slotProps","isNextDisabled","isNextHidden","onGoToNext","nextLabel","isPreviousDisabled","isPreviousHidden","onGoToPrevious","previousLabel","labelId"],U0=["ownerState"],Y0=["ownerState"],G0=ce("div",{name:"MuiPickersArrowSwitcher",slot:"Root",overridesResolver:(i,e)=>e.root})({display:"flex"}),J0=ce("div",{name:"MuiPickersArrowSwitcher",slot:"Spacer",overridesResolver:(i,e)=>e.spacer})(({theme:i})=>({width:i.spacing(3)})),dd=ce(zi,{name:"MuiPickersArrowSwitcher",slot:"Button",overridesResolver:(i,e)=>e.button})({variants:[{props:{hidden:!0},style:{visibility:"hidden"}}]}),K0=i=>{const{classes:e}=i;return Te({root:["root"],spacer:["spacer"],button:["button"],previousIconButton:["previousIconButton"],nextIconButton:["nextIconButton"],leftArrowIcon:["leftArrowIcon"],rightArrowIcon:["rightArrowIcon"]},H0,e)},Hp=D.forwardRef(function(e,t){const n=Tt(),r=Ie({props:e,name:"MuiPickersArrowSwitcher"}),{children:s,className:o,slots:a,slotProps:l,isNextDisabled:c,isNextHidden:u,onGoToNext:p,nextLabel:d,isPreviousDisabled:f,isPreviousHidden:m,onGoToPrevious:v,previousLabel:g,labelId:x}=r,y=me(r,q0),w=r,S=K0(w),M={isDisabled:c,isHidden:u,goTo:p,label:d},b={isDisabled:f,isHidden:m,goTo:v,label:g},I=(a==null?void 0:a.previousIconButton)??dd,P=Pe({elementType:I,externalSlotProps:l==null?void 0:l.previousIconButton,additionalProps:{size:"medium",title:b.label,"aria-label":b.label,disabled:b.isDisabled,edge:"end",onClick:b.goTo},ownerState:_({},w,{hidden:b.isHidden}),className:Ee(S.button,S.previousIconButton)}),E=(a==null?void 0:a.nextIconButton)??dd,A=Pe({elementType:E,externalSlotProps:l==null?void 0:l.nextIconButton,additionalProps:{size:"medium",title:M.label,"aria-label":M.label,disabled:M.isDisabled,edge:"start",onClick:M.goTo},ownerState:_({},w,{hidden:M.isHidden}),className:Ee(S.button,S.nextIconButton)}),T=(a==null?void 0:a.leftArrowIcon)??F0,W=Pe({elementType:T,externalSlotProps:l==null?void 0:l.leftArrowIcon,additionalProps:{fontSize:"inherit"},ownerState:w,className:S.leftArrowIcon}),F=me(W,U0),j=(a==null?void 0:a.rightArrowIcon)??L0,O=Pe({elementType:j,externalSlotProps:l==null?void 0:l.rightArrowIcon,additionalProps:{fontSize:"inherit"},ownerState:w,className:S.rightArrowIcon}),R=me(O,Y0);return h.jsxs(G0,_({ref:t,className:Ee(S.root,o),ownerState:w},y,{children:[h.jsx(I,_({},P,{children:n?h.jsx(j,_({},R)):h.jsx(T,_({},F))})),s?h.jsx(Kt,{variant:"subtitle1",component:"span",id:x,children:s}):h.jsx(J0,{className:S.spacer,ownerState:w}),h.jsx(E,_({},A,{children:n?h.jsx(T,_({},F)):h.jsx(j,_({},R))}))]}))}),At=(i,e)=>i.length!==e.length?!1:e.every(t=>i.includes(t)),qp=({openTo:i,defaultOpenTo:e,views:t,defaultViews:n})=>{const r=t??n;let s;if(i!=null)s=i;else if(r.includes(e))s=e;else if(r.length>0)s=r[0];else throw new Error("MUI X: The `views` prop must contain at least one view.");return{views:r,openTo:s}},Up=["hours","minutes","seconds"],On=i=>Up.includes(i),X0=i=>Up.includes(i)||i==="meridiem",Z0=(i,e)=>i?e.getHours(i)>=12?"pm":"am":null,jn=(i,e,t)=>t&&(i>=12?"pm":"am")!==e?e==="am"?i-12:i+12:i,Q0=(i,e,t,n)=>{const r=jn(n.getHours(i),e,t);return n.setHours(i,r)},ud=(i,e)=>e.getHours(i)*3600+e.getMinutes(i)*60+e.getSeconds(i),Yn=(i,e)=>(t,n)=>i?e.isAfter(t,n):ud(t,e)>ud(n,e),Yp=(i,{format:e,views:t,ampm:n})=>{if(e!=null)return e;const r=i.formats;return At(t,["hours"])?n?`${r.hours12h} ${r.meridiem}`:r.hours24h:At(t,["minutes"])?r.minutes:At(t,["seconds"])?r.seconds:At(t,["minutes","seconds"])?`${r.minutes}:${r.seconds}`:At(t,["hours","minutes","seconds"])?n?`${r.hours12h}:${r.minutes}:${r.seconds} ${r.meridiem}`:`${r.hours24h}:${r.minutes}:${r.seconds}`:n?`${r.hours12h}:${r.minutes} ${r.meridiem}`:`${r.hours24h}:${r.minutes}`};function Gn({onChange:i,onViewChange:e,openTo:t,view:n,views:r,autoFocus:s,focusedView:o,onFocusedViewChange:a}){const l=D.useRef(t),c=D.useRef(r),u=D.useRef(r.includes(t)?t:r[0]),[p,d]=fi({name:"useViews",state:"view",controlled:n,default:u.current}),f=D.useRef(s?p:null),[m,v]=fi({name:"useViews",state:"focusedView",controlled:o,default:f.current});D.useEffect(()=>{(l.current&&l.current!==t||c.current&&c.current.some(I=>!r.includes(I)))&&(d(r.includes(t)?t:r[0]),c.current=r,l.current=t)},[t,d,p,r]);const g=r.indexOf(p),x=r[g-1]??null,y=r[g+1]??null,w=he((I,P)=>{v(P?I:E=>I===E?null:E),a==null||a(I,P)}),S=he(I=>{w(I,!0),I!==p&&(d(I),e&&e(I))}),M=he(()=>{y&&S(y)}),b=he((I,P,E)=>{const A=P==="finish",T=E?r.indexOf(E)<r.length-1:!!y;if(i(I,A&&T?"partial":P,E),E&&E!==p){const F=r[r.indexOf(E)+1];F&&S(F)}else A&&M()});return{view:p,setView:S,focusedView:m,setFocusedView:w,nextView:y,previousView:x,defaultView:r.includes(t)?t:r[0],goToNextView:M,setValueAndGoToNextView:b}}function eI(i,{disableFuture:e,maxDate:t,timezone:n}){const r=Me();return D.useMemo(()=>{const s=r.date(void 0,n),o=r.startOfMonth(e&&r.isBefore(s,t)?s:t);return!r.isAfter(o,i)},[e,t,i,r,n])}function tI(i,{disablePast:e,minDate:t,timezone:n}){const r=Me();return D.useMemo(()=>{const s=r.date(void 0,n),o=r.startOfMonth(e&&r.isAfter(s,t)?s:t);return!r.isBefore(o,i)},[e,t,i,r,n])}function dl(i,e,t,n){const r=Me(),s=Z0(i,r),o=D.useCallback(a=>{const l=i==null?null:Q0(i,a,!!e,r);t(l,n??"partial")},[e,i,t,n,r]);return{meridiemMode:s,handleMeridiemChange:o}}const En=36,vs=2,xs=320,iI=280,ul=336,Gp=232,nI=48,ys=ce("div")({overflow:"hidden",width:xs,maxHeight:ul,display:"flex",flexDirection:"column",margin:"0 auto"});function rI(i){return Oe("MuiTimeClock",i)}je("MuiTimeClock",["root","arrowSwitcher"]);const Vi=220,Wt=36,Rn={x:Vi/2,y:Vi/2},Jp={x:Rn.x,y:0},sI=Jp.x-Rn.x,oI=Jp.y-Rn.y,aI=i=>i*(180/Math.PI),Kp=(i,e,t)=>{const n=e-Rn.x,r=t-Rn.y,s=Math.atan2(sI,oI)-Math.atan2(n,r);let o=aI(s);o=Math.round(o/i)*i,o%=360;const a=Math.floor(o/i)||0,l=n**2+r**2,c=Math.sqrt(l);return{value:a,distance:c}},lI=(i,e,t=1)=>{const n=t*6;let{value:r}=Kp(n,i,e);return r=r*t%60,r},cI=(i,e,t)=>{const{value:n,distance:r}=Kp(30,i,e);let s=n||12;return t?s%=12:r<Vi/2-Wt&&(s+=12,s%=24),s};function dI(i){return Oe("MuiClockPointer",i)}je("MuiClockPointer",["root","thumb"]);const uI=["className","hasSelected","isInner","type","viewValue"],pI=i=>{const{classes:e}=i;return Te({root:["root"],thumb:["thumb"]},dI,e)},hI=ce("div",{name:"MuiClockPointer",slot:"Root",overridesResolver:(i,e)=>e.root})(({theme:i})=>({width:2,backgroundColor:(i.vars||i).palette.primary.main,position:"absolute",left:"calc(50% - 1px)",bottom:"50%",transformOrigin:"center bottom 0px",variants:[{props:{shouldAnimate:!0},style:{transition:i.transitions.create(["transform","height"])}}]})),fI=ce("div",{name:"MuiClockPointer",slot:"Thumb",overridesResolver:(i,e)=>e.thumb})(({theme:i})=>({width:4,height:4,backgroundColor:(i.vars||i).palette.primary.contrastText,borderRadius:"50%",position:"absolute",top:-21,left:`calc(50% - ${Wt/2}px)`,border:`${(Wt-4)/2}px solid ${(i.vars||i).palette.primary.main}`,boxSizing:"content-box",variants:[{props:{hasSelected:!0},style:{backgroundColor:(i.vars||i).palette.primary.main}}]}));function mI(i){const e=Ie({props:i,name:"MuiClockPointer"}),{className:t,isInner:n,type:r,viewValue:s}=e,o=me(e,uI),a=D.useRef(r);D.useEffect(()=>{a.current=r},[r]);const l=_({},e,{shouldAnimate:a.current!==r}),c=pI(l),u=()=>{let d=360/(r==="hours"?12:60)*s;return r==="hours"&&s>12&&(d-=360),{height:Math.round((n?.26:.4)*Vi),transform:`rotateZ(${d}deg)`}};return h.jsx(hI,_({style:u(),className:Ee(c.root,t),ownerState:l},o,{children:h.jsx(fI,{ownerState:l,className:c.thumb})}))}function gI(i){return Oe("MuiClock",i)}je("MuiClock",["root","clock","wrapper","squareMask","pin","amButton","pmButton","meridiemText","selected"]);const Nr=(i,e,t)=>{let n=e;return n=i.setHours(n,i.getHours(t)),n=i.setMinutes(n,i.getMinutes(t)),n=i.setSeconds(n,i.getSeconds(t)),n=i.setMilliseconds(n,i.getMilliseconds(t)),n},vn=({date:i,disableFuture:e,disablePast:t,maxDate:n,minDate:r,isDateDisabled:s,utils:o,timezone:a})=>{const l=Nr(o,o.date(void 0,a),i);t&&o.isBefore(r,l)&&(r=l),e&&o.isAfter(n,l)&&(n=l);let c=i,u=i;for(o.isBefore(i,r)&&(c=r,u=null),o.isAfter(i,n)&&(u&&(u=n),c=null);c||u;){if(c&&o.isAfter(c,n)&&(c=null),u&&o.isBefore(u,r)&&(u=null),c){if(!s(c))return c;c=o.addDays(c,1)}if(u){if(!s(u))return u;u=o.addDays(u,-1)}}return null},vI=(i,e)=>e==null||!i.isValid(e)?null:e,wt=(i,e,t)=>e==null||!i.isValid(e)?t:e,xI=(i,e,t)=>!i.isValid(e)&&e!=null&&!i.isValid(t)&&t!=null?!0:i.isEqual(e,t),pl=(i,e)=>{const n=[i.startOfYear(e)];for(;n.length<12;){const r=n[n.length-1];n.push(i.addMonths(r,1))}return n},hl=(i,e,t)=>t==="date"?i.startOfDay(i.date(void 0,e)):i.date(void 0,e),Ht=(i,e)=>{const t=i.setHours(i.date(),e==="am"?2:14);return i.format(t,"meridiem")},yI=["year","month","day"],pd=i=>yI.includes(i),fl=(i,{format:e,views:t},n)=>{if(e!=null)return e;const r=i.formats;return At(t,["year"])?r.year:At(t,["month"])?r.month:At(t,["day"])?r.dayOfMonth:At(t,["month","year"])?`${r.month} ${r.year}`:At(t,["day","month"])?`${r.month} ${r.dayOfMonth}`:n?/en/.test(i.getCurrentLocaleCode())?r.normalDateWithWeekday:r.normalDate:r.keyboardDate},bI=(i,e)=>{const t=i.startOfWeek(e);return[0,1,2,3,4,5,6].map(n=>i.addDays(t,n))},wI=i=>{const{classes:e,meridiemMode:t}=i;return Te({root:["root"],clock:["clock"],wrapper:["wrapper"],squareMask:["squareMask"],pin:["pin"],amButton:["amButton",t==="am"&&"selected"],pmButton:["pmButton",t==="pm"&&"selected"],meridiemText:["meridiemText"]},gI,e)},DI=ce("div",{name:"MuiClock",slot:"Root",overridesResolver:(i,e)=>e.root})(({theme:i})=>({display:"flex",justifyContent:"center",alignItems:"center",margin:i.spacing(2)})),SI=ce("div",{name:"MuiClock",slot:"Clock",overridesResolver:(i,e)=>e.clock})({backgroundColor:"rgba(0,0,0,.07)",borderRadius:"50%",height:220,width:220,flexShrink:0,position:"relative",pointerEvents:"none"}),II=ce("div",{name:"MuiClock",slot:"Wrapper",overridesResolver:(i,e)=>e.wrapper})({"&:focus":{outline:"none"}}),CI=ce("div",{name:"MuiClock",slot:"SquareMask",overridesResolver:(i,e)=>e.squareMask})({width:"100%",height:"100%",position:"absolute",pointerEvents:"auto",outline:0,touchAction:"none",userSelect:"none",variants:[{props:{disabled:!1},style:{"@media (pointer: fine)":{cursor:"pointer",borderRadius:"50%"},"&:active":{cursor:"move"}}}]}),_I=ce("div",{name:"MuiClock",slot:"Pin",overridesResolver:(i,e)=>e.pin})(({theme:i})=>({width:6,height:6,borderRadius:"50%",backgroundColor:(i.vars||i).palette.primary.main,position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)"})),Xp=(i,e)=>({zIndex:1,bottom:8,paddingLeft:4,paddingRight:4,width:Wt,variants:[{props:{meridiemMode:e},style:{backgroundColor:(i.vars||i).palette.primary.main,color:(i.vars||i).palette.primary.contrastText,"&:hover":{backgroundColor:(i.vars||i).palette.primary.light}}}]}),MI=ce(zi,{name:"MuiClock",slot:"AmButton",overridesResolver:(i,e)=>e.amButton})(({theme:i})=>_({},Xp(i,"am"),{position:"absolute",left:8})),kI=ce(zi,{name:"MuiClock",slot:"PmButton",overridesResolver:(i,e)=>e.pmButton})(({theme:i})=>_({},Xp(i,"pm"),{position:"absolute",right:8})),hd=ce(Kt,{name:"MuiClock",slot:"meridiemText",overridesResolver:(i,e)=>e.meridiemText})({overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"});function TI(i){const e=Ie({props:i,name:"MuiClock"}),{ampm:t,ampmInClock:n,autoFocus:r,children:s,value:o,handleMeridiemChange:a,isTimeDisabled:l,meridiemMode:c,minutesStep:u=1,onChange:p,selectedId:d,type:f,viewValue:m,viewRange:[v,g],disabled:x=!1,readOnly:y,className:w}=e,S=e,M=Me(),b=Qe(),I=D.useRef(!1),P=wI(S),E=l(m,f),A=!t&&f==="hours"&&(m<1||m>12),T=(G,ne)=>{x||y||l(G,f)||p(G,ne)},W=(G,ne)=>{let{offsetX:U,offsetY:re}=G;if(U===void 0){const Y=G.target.getBoundingClientRect();U=G.changedTouches[0].clientX-Y.left,re=G.changedTouches[0].clientY-Y.top}const ie=f==="seconds"||f==="minutes"?lI(U,re,u):cI(U,re,!!t);T(ie,ne)},F=G=>{I.current=!0,W(G,"shallow")},j=G=>{I.current&&(W(G,"finish"),I.current=!1),G.preventDefault()},O=G=>{G.buttons>0&&W(G.nativeEvent,"shallow")},R=G=>{I.current&&(I.current=!1),W(G.nativeEvent,"finish")},B=D.useMemo(()=>f==="hours"?!0:m%5===0,[f,m]),$=f==="minutes"?u:1,J=D.useRef(null);Ft(()=>{r&&J.current.focus()},[r]);const q=G=>Math.max(v,Math.min(g,G)),L=G=>(G+(g+1))%(g+1),Q=G=>{if(!I.current)switch(G.key){case"Home":T(v,"partial"),G.preventDefault();break;case"End":T(g,"partial"),G.preventDefault();break;case"ArrowUp":T(L(m+$),"partial"),G.preventDefault();break;case"ArrowDown":T(L(m-$),"partial"),G.preventDefault();break;case"PageUp":T(q(m+5),"partial"),G.preventDefault();break;case"PageDown":T(q(m-5),"partial"),G.preventDefault();break;case"Enter":case" ":T(m,"finish"),G.preventDefault();break}};return h.jsxs(DI,{className:Ee(P.root,w),children:[h.jsxs(SI,{className:P.clock,children:[h.jsx(CI,{onTouchMove:F,onTouchStart:F,onTouchEnd:j,onMouseUp:R,onMouseMove:O,ownerState:{disabled:x},className:P.squareMask}),!E&&h.jsxs(D.Fragment,{children:[h.jsx(_I,{className:P.pin}),o!=null&&h.jsx(mI,{type:f,viewValue:m,isInner:A,hasSelected:B})]}),h.jsx(II,{"aria-activedescendant":d,"aria-label":b.clockLabelText(f,o,M,o==null?null:M.format(o,"fullTime")),ref:J,role:"listbox",onKeyDown:Q,tabIndex:0,className:P.wrapper,children:s})]}),t&&n&&h.jsxs(D.Fragment,{children:[h.jsx(MI,{onClick:y?void 0:()=>a("am"),disabled:x||c===null,ownerState:S,className:P.amButton,title:Ht(M,"am"),children:h.jsx(hd,{variant:"caption",className:P.meridiemText,children:Ht(M,"am")})}),h.jsx(kI,{disabled:x||c===null,onClick:y?void 0:()=>a("pm"),ownerState:S,className:P.pmButton,title:Ht(M,"pm"),children:h.jsx(hd,{variant:"caption",className:P.meridiemText,children:Ht(M,"pm")})})]})]})}function PI(i){return Oe("MuiClockNumber",i)}const lr=je("MuiClockNumber",["root","selected","disabled"]),OI=["className","disabled","index","inner","label","selected"],jI=i=>{const{classes:e,selected:t,disabled:n}=i;return Te({root:["root",t&&"selected",n&&"disabled"]},PI,e)},EI=ce("span",{name:"MuiClockNumber",slot:"Root",overridesResolver:(i,e)=>[e.root,{[`&.${lr.disabled}`]:e.disabled},{[`&.${lr.selected}`]:e.selected}]})(({theme:i})=>({height:Wt,width:Wt,position:"absolute",left:`calc((100% - ${Wt}px) / 2)`,display:"inline-flex",justifyContent:"center",alignItems:"center",borderRadius:"50%",color:(i.vars||i).palette.text.primary,fontFamily:i.typography.fontFamily,"&:focused":{backgroundColor:(i.vars||i).palette.background.paper},[`&.${lr.selected}`]:{color:(i.vars||i).palette.primary.contrastText},[`&.${lr.disabled}`]:{pointerEvents:"none",color:(i.vars||i).palette.text.disabled},variants:[{props:{inner:!0},style:_({},i.typography.body2,{color:(i.vars||i).palette.text.secondary})}]}));function Zp(i){const e=Ie({props:i,name:"MuiClockNumber"}),{className:t,disabled:n,index:r,inner:s,label:o,selected:a}=e,l=me(e,OI),c=e,u=jI(c),p=r%12/12*Math.PI*2-Math.PI/2,d=(Vi-Wt-2)/2*(s?.65:1),f=Math.round(Math.cos(p)*d),m=Math.round(Math.sin(p)*d);return h.jsx(EI,_({className:Ee(u.root,t),"aria-disabled":n?!0:void 0,"aria-selected":a?!0:void 0,role:"option",style:{transform:`translate(${f}px, ${m+(Vi-Wt)/2}px`},ownerState:c},l,{children:o}))}const RI=({ampm:i,value:e,getClockNumberText:t,isDisabled:n,selectedId:r,utils:s})=>{const o=e?s.getHours(e):null,a=[],l=i?1:0,c=i?12:23,u=p=>o===null?!1:i?p===12?o===12||o===0:o===p||o-12===p:o===p;for(let p=l;p<=c;p+=1){let d=p.toString();p===0&&(d="00");const f=!i&&(p===0||p>12);d=s.formatNumber(d);const m=u(p);a.push(h.jsx(Zp,{id:m?r:void 0,index:p,inner:f,selected:m,disabled:n(p),label:d,"aria-label":t(d)},p))}return a},fd=({utils:i,value:e,isDisabled:t,getClockNumberText:n,selectedId:r})=>{const s=i.formatNumber;return[[5,s("05")],[10,s("10")],[15,s("15")],[20,s("20")],[25,s("25")],[30,s("30")],[35,s("35")],[40,s("40")],[45,s("45")],[50,s("50")],[55,s("55")],[0,s("00")]].map(([o,a],l)=>{const c=o===e;return h.jsx(Zp,{label:a,id:c?r:void 0,index:l+1,inner:!1,disabled:t(o),selected:c,"aria-label":n(a)},o)})},ml=({timezone:i,value:e,defaultValue:t,referenceDate:n,onChange:r,valueManager:s})=>{const o=Me(),a=D.useRef(t),l=e??a.current??s.emptyValue,c=D.useMemo(()=>s.getTimezone(o,l),[o,s,l]),u=he(m=>c==null?m:s.setTimezone(o,c,m));let p;i?p=i:c?p=c:n?p=o.getTimezone(n):p="default";const d=D.useMemo(()=>s.setTimezone(o,p,l),[s,o,p,l]),f=he((m,...v)=>{const g=u(m);r==null||r(g,...v)});return{value:d,handleValueChange:f,timezone:p}},Ki=({name:i,timezone:e,value:t,defaultValue:n,referenceDate:r,onChange:s,valueManager:o})=>{const[a,l]=fi({name:i,state:"value",controlled:t,default:n??o.emptyValue}),c=he((u,...p)=>{l(u),s==null||s(u,...p)});return ml({timezone:e,value:a,defaultValue:void 0,referenceDate:r,onChange:c,valueManager:o})},It={year:1,month:2,day:3,hours:4,minutes:5,seconds:6,milliseconds:7},AI=i=>Math.max(...i.map(e=>It[e.type]??1)),an=(i,e,t)=>{if(e===It.year)return i.startOfYear(t);if(e===It.month)return i.startOfMonth(t);if(e===It.day)return i.startOfDay(t);let n=t;return e<It.minutes&&(n=i.setMinutes(n,0)),e<It.seconds&&(n=i.setSeconds(n,0)),e<It.milliseconds&&(n=i.setMilliseconds(n,0)),n},NI=({props:i,utils:e,granularity:t,timezone:n,getTodayDate:r})=>{let s=r?r():an(e,t,hl(e,n));i.minDate!=null&&e.isAfterDay(i.minDate,s)&&(s=an(e,t,i.minDate)),i.maxDate!=null&&e.isBeforeDay(i.maxDate,s)&&(s=an(e,t,i.maxDate));const o=Yn(i.disableIgnoringDatePartForTimeValidation??!1,e);return i.minTime!=null&&o(i.minTime,s)&&(s=an(e,t,i.disableIgnoringDatePartForTimeValidation?i.minTime:Nr(e,s,i.minTime))),i.maxTime!=null&&o(s,i.maxTime)&&(s=an(e,t,i.disableIgnoringDatePartForTimeValidation?i.maxTime:Nr(e,s,i.maxTime))),s},Qp=(i,e)=>{const t=i.formatTokenMap[e];if(t==null)throw new Error([`MUI X: The token "${e}" is not supported by the Date and Time Pickers.`,"Please try using another token or open an issue on https://github.com/mui/mui-x/issues/new/choose if you think it should be supported."].join(`
`));return typeof t=="string"?{type:t,contentType:t==="meridiem"?"letter":"digit",maxLength:void 0}:{type:t.sectionType,contentType:t.contentType,maxLength:t.maxLength}},$I=i=>{switch(i){case"ArrowUp":return 1;case"ArrowDown":return-1;case"PageUp":return 5;case"PageDown":return-5;default:return 0}},bs=(i,e)=>{const t=[],n=i.date(void 0,"default"),r=i.startOfWeek(n),s=i.endOfWeek(n);let o=r;for(;i.isBefore(o,s);)t.push(o),o=i.addDays(o,1);return t.map(a=>i.formatByString(a,e))},eh=(i,e,t,n)=>{switch(t){case"month":return pl(i,i.date(void 0,e)).map(r=>i.formatByString(r,n));case"weekDay":return bs(i,n);case"meridiem":{const r=i.date(void 0,e);return[i.startOfDay(r),i.endOfDay(r)].map(s=>i.formatByString(s,n))}default:return[]}},md="s",WI=["0","1","2","3","4","5","6","7","8","9"],FI=i=>{const e=i.date(void 0);return i.formatByString(i.setSeconds(e,0),md)==="0"?WI:Array.from({length:10}).map((n,r)=>i.formatByString(i.setSeconds(e,r),md))},yi=(i,e)=>{if(e[0]==="0")return i;const t=[];let n="";for(let r=0;r<i.length;r+=1){n+=i[r];const s=e.indexOf(n);s>-1&&(t.push(s.toString()),n="")}return t.join("")},gl=(i,e)=>e[0]==="0"?i:i.split("").map(t=>e[Number(t)]).join(""),gd=(i,e)=>{const t=yi(i,e);return t!==" "&&!Number.isNaN(Number(t))},th=(i,e)=>{let t=i;for(t=Number(t).toString();t.length<e;)t=`0${t}`;return t},ih=(i,e,t,n,r)=>{if(r.type==="day"&&r.contentType==="digit-with-letter"){const o=i.setDate(t.longestMonth,e);return i.formatByString(o,r.format)}let s=e.toString();return r.hasLeadingZerosInInput&&(s=th(s,r.maxLength)),gl(s,n)},LI=(i,e,t,n,r,s,o,a)=>{const l=$I(n),c=n==="Home",u=n==="End",p=t.value===""||c||u,d=()=>{const m=r[t.type]({currentDate:o,format:t.format,contentType:t.contentType}),v=y=>ih(i,y,m,s,t),g=t.type==="minutes"&&(a!=null&&a.minutesStep)?a.minutesStep:1;let x;if(p){if(t.type==="year"&&!u&&!c)return i.formatByString(i.date(void 0,e),t.format);l>0||c?x=m.minimum:x=m.maximum}else x=parseInt(yi(t.value,s),10)+l*g;return x%g!==0&&((l<0||c)&&(x+=g-(g+x)%g),(l>0||u)&&(x-=x%g)),x>m.maximum?v(m.minimum+(x-m.maximum-1)%(m.maximum-m.minimum+1)):x<m.minimum?v(m.maximum-(m.minimum-x-1)%(m.maximum-m.minimum+1)):v(x)},f=()=>{const m=eh(i,e,t.type,t.format);if(m.length===0)return t.value;if(p)return l>0||c?m[0]:m[m.length-1];const x=((m.indexOf(t.value)+l)%m.length+m.length)%m.length;return m[x]};return t.contentType==="digit"||t.contentType==="digit-with-letter"?d():f()},vl=(i,e,t)=>{let n=i.value||i.placeholder;const r=e==="non-input"?i.hasLeadingZerosInFormat:i.hasLeadingZerosInInput;return e==="non-input"&&i.hasLeadingZerosInInput&&!i.hasLeadingZerosInFormat&&(n=Number(yi(n,t)).toString()),["input-rtl","input-ltr"].includes(e)&&i.contentType==="digit"&&!r&&n.length===1&&(n=`${n}`),e==="input-rtl"&&(n=`${n}`),n},vd=(i,e,t,n)=>i.formatByString(i.parse(e,t),n),BI=(i,e)=>i.formatByString(i.date(void 0,"system"),e).length===4,nh=(i,e,t,n)=>{if(e!=="digit")return!1;const r=i.date(void 0,"default");switch(t){case"year":return i.lib==="dayjs"&&n==="YY"?!0:i.formatByString(i.setYear(r,1),n).startsWith("0");case"month":return i.formatByString(i.startOfYear(r),n).length>1;case"day":return i.formatByString(i.startOfMonth(r),n).length>1;case"weekDay":return i.formatByString(i.startOfWeek(r),n).length>1;case"hours":return i.formatByString(i.setHours(r,1),n).length>1;case"minutes":return i.formatByString(i.setMinutes(r,1),n).length>1;case"seconds":return i.formatByString(i.setSeconds(r,1),n).length>1;default:throw new Error("Invalid section type")}},VI=(i,e,t)=>{const n=e.some(l=>l.type==="day"),r=[],s=[];for(let l=0;l<e.length;l+=1){const c=e[l];n&&c.type==="weekDay"||(r.push(c.format),s.push(vl(c,"non-input",t)))}const o=r.join(" "),a=s.join(" ");return i.parse(a,o)},zI=i=>i.map(e=>`${e.startSeparator}${e.value||e.placeholder}${e.endSeparator}`).join(""),HI=(i,e,t)=>{const r=i.map(s=>{const o=vl(s,t?"input-rtl":"input-ltr",e);return`${s.startSeparator}${o}${s.endSeparator}`}).join("");return t?`${r}`:r},qI=(i,e,t)=>{const n=i.date(void 0,t),r=i.endOfYear(n),s=i.endOfDay(n),{maxDaysInMonth:o,longestMonth:a}=pl(i,n).reduce((l,c)=>{const u=i.getDaysInMonth(c);return u>l.maxDaysInMonth?{maxDaysInMonth:u,longestMonth:c}:l},{maxDaysInMonth:0,longestMonth:null});return{year:({format:l})=>({minimum:0,maximum:BI(i,l)?9999:99}),month:()=>({minimum:1,maximum:i.getMonth(r)+1}),day:({currentDate:l})=>({minimum:1,maximum:l!=null&&i.isValid(l)?i.getDaysInMonth(l):o,longestMonth:a}),weekDay:({format:l,contentType:c})=>{if(c==="digit"){const u=bs(i,l).map(Number);return{minimum:Math.min(...u),maximum:Math.max(...u)}}return{minimum:1,maximum:7}},hours:({format:l})=>{const c=i.getHours(s);return yi(i.formatByString(i.endOfDay(n),l),e)!==c.toString()?{minimum:1,maximum:Number(yi(i.formatByString(i.startOfDay(n),l),e))}:{minimum:0,maximum:c}},minutes:()=>({minimum:0,maximum:i.getMinutes(s)}),seconds:()=>({minimum:0,maximum:i.getSeconds(s)}),meridiem:()=>({minimum:0,maximum:1}),empty:()=>({minimum:0,maximum:0})}},UI=(i,e,t,n)=>{switch(e.type){case"year":return i.setYear(n,i.getYear(t));case"month":return i.setMonth(n,i.getMonth(t));case"weekDay":{const r=bs(i,e.format),s=i.formatByString(t,e.format),o=r.indexOf(s),l=r.indexOf(e.value)-o;return i.addDays(t,l)}case"day":return i.setDate(n,i.getDate(t));case"meridiem":{const r=i.getHours(t)<12,s=i.getHours(n);return r&&s>=12?i.addHours(n,-12):!r&&s<12?i.addHours(n,12):n}case"hours":return i.setHours(n,i.getHours(t));case"minutes":return i.setMinutes(n,i.getMinutes(t));case"seconds":return i.setSeconds(n,i.getSeconds(t));default:return n}},xd={year:1,month:2,day:3,weekDay:4,hours:5,minutes:6,seconds:7,meridiem:8,empty:9},yd=(i,e,t,n,r)=>[...t].sort((s,o)=>xd[s.type]-xd[o.type]).reduce((s,o)=>!r||o.modified?UI(i,o,e,s):s,n),YI=()=>navigator.userAgent.toLowerCase().includes("android"),GI=(i,e)=>{const t={};if(!e)return i.forEach((l,c)=>{const u=c===0?null:c-1,p=c===i.length-1?null:c+1;t[c]={leftIndex:u,rightIndex:p}}),{neighbors:t,startIndex:0,endIndex:i.length-1};const n={},r={};let s=0,o=0,a=i.length-1;for(;a>=0;){o=i.findIndex((l,c)=>{var u;return c>=s&&((u=l.endSeparator)==null?void 0:u.includes(" "))&&l.endSeparator!==" / "}),o===-1&&(o=i.length-1);for(let l=o;l>=s;l-=1)r[l]=a,n[a]=l,a-=1;s=o+1}return i.forEach((l,c)=>{const u=r[c],p=u===0?null:n[u-1],d=u===i.length-1?null:n[u+1];t[c]={leftIndex:p,rightIndex:d}}),{neighbors:t,startIndex:n[0],endIndex:n[i.length-1]}},Io=(i,e)=>{if(i==null)return null;if(i==="all")return"all";if(typeof i=="string"){const t=e.findIndex(n=>n.type===i);return t===-1?null:t}return i},JI=(i,e)=>{if(i.value)switch(i.type){case"month":{if(i.contentType==="digit")return e.format(e.setMonth(e.date(),Number(i.value)-1),"month");const t=e.parse(i.value,i.format);return t?e.format(t,"month"):void 0}case"day":return i.contentType==="digit"?e.format(e.setDate(e.startOfYear(e.date()),Number(i.value)),"dayOfMonthFull"):i.value;case"weekDay":return;default:return}},KI=(i,e)=>{if(i.value)switch(i.type){case"weekDay":return i.contentType==="letter"?void 0:Number(i.value);case"meridiem":{const t=e.parse(`01:00 ${i.value}`,`${e.formats.hours12h}:${e.formats.minutes} ${i.format}`);return t?e.getHours(t)>=12?1:0:void 0}case"day":return i.contentType==="digit-with-letter"?parseInt(i.value,10):Number(i.value);case"month":{if(i.contentType==="digit")return Number(i.value);const t=e.parse(i.value,i.format);return t?e.getMonth(t)+1:void 0}default:return i.contentType!=="letter"?Number(i.value):void 0}},XI=["value","referenceDate"],Ue={emptyValue:null,getTodayValue:hl,getInitialReferenceValue:i=>{let{value:e,referenceDate:t}=i,n=me(i,XI);return e!=null&&n.utils.isValid(e)?e:t??NI(n)},cleanValue:vI,areValuesEqual:xI,isSameError:(i,e)=>i===e,hasError:i=>i!=null,defaultErrorState:null,getTimezone:(i,e)=>e==null||!i.isValid(e)?null:i.getTimezone(e),setTimezone:(i,e,t)=>t==null?null:i.setTimezone(t,e)},rh={updateReferenceValue:(i,e,t)=>e==null||!i.isValid(e)?t:e,getSectionsFromValue:(i,e,t,n)=>!i.isValid(e)&&!!t?t:n(e),getV7HiddenInputValueFromSections:zI,getV6InputValueFromSections:HI,getActiveDateManager:(i,e)=>({date:e.value,referenceDate:e.referenceValue,getSections:t=>t,getNewValuesFromNewActiveDate:t=>({value:t,referenceValue:t==null||!i.isValid(t)?e.referenceValue:t})}),parseValueStr:(i,e,t)=>t(i.trim(),e)},xl=({value:i,referenceDate:e,utils:t,props:n,timezone:r})=>{const s=D.useMemo(()=>Ue.getInitialReferenceValue({value:i,utils:t,props:n,referenceDate:e,granularity:It.day,timezone:r,getTodayDate:()=>hl(t,r,"date")}),[]);return i??s},ZI=["ampm","ampmInClock","autoFocus","slots","slotProps","value","defaultValue","referenceDate","disableIgnoringDatePartForTimeValidation","maxTime","minTime","disableFuture","disablePast","minutesStep","shouldDisableTime","showViewSwitcher","onChange","view","views","openTo","onViewChange","focusedView","onFocusedViewChange","className","disabled","readOnly","timezone"],QI=i=>{const{classes:e}=i;return Te({root:["root"],arrowSwitcher:["arrowSwitcher"]},rI,e)},eC=ce(ys,{name:"MuiTimeClock",slot:"Root",overridesResolver:(i,e)=>e.root})({display:"flex",flexDirection:"column",position:"relative"}),tC=ce(Hp,{name:"MuiTimeClock",slot:"ArrowSwitcher",overridesResolver:(i,e)=>e.arrowSwitcher})({position:"absolute",right:12,top:15}),iC=["hours","minutes"],nC=D.forwardRef(function(e,t){const n=Me(),r=Ie({props:e,name:"MuiTimeClock"}),{ampm:s=n.is12HourCycleInCurrentLocale(),ampmInClock:o=!1,autoFocus:a,slots:l,slotProps:c,value:u,defaultValue:p,referenceDate:d,disableIgnoringDatePartForTimeValidation:f=!1,maxTime:m,minTime:v,disableFuture:g,disablePast:x,minutesStep:y=1,shouldDisableTime:w,showViewSwitcher:S,onChange:M,view:b,views:I=iC,openTo:P,onViewChange:E,focusedView:A,onFocusedViewChange:T,className:W,disabled:F,readOnly:j,timezone:O}=r,R=me(r,ZI),{value:B,handleValueChange:$,timezone:J}=Ki({name:"TimeClock",timezone:O,value:u,defaultValue:p,referenceDate:d,onChange:M,valueManager:Ue}),q=xl({value:B,referenceDate:d,utils:n,props:r,timezone:J}),L=Qe(),Q=Di(J),{view:G,setView:ne,previousView:U,nextView:re,setValueAndGoToNextView:ie}=Gn({view:b,views:I,openTo:P,onViewChange:E,onChange:$,focusedView:A,onFocusedViewChange:T}),{meridiemMode:Y,handleMeridiemChange:K}=dl(q,s,ie),se=D.useCallback((Z,X)=>{const H=Yn(f,n),ee=X==="hours"||X==="minutes"&&I.includes("seconds"),te=({start:ye,end:Le})=>!(v&&H(v,Le)||m&&H(ye,m)||g&&H(ye,Q)||x&&H(Q,ee?Le:ye)),de=(ye,Le=1)=>{if(ye%Le!==0)return!1;if(w)switch(X){case"hours":return!w(n.setHours(q,ye),"hours");case"minutes":return!w(n.setMinutes(q,ye),"minutes");case"seconds":return!w(n.setSeconds(q,ye),"seconds");default:return!1}return!0};switch(X){case"hours":{const ye=jn(Z,Y,s),Le=n.setHours(q,ye);if(n.getHours(Le)!==ye)return!0;const nt=n.setSeconds(n.setMinutes(Le,0),0),ue=n.setSeconds(n.setMinutes(Le,59),59);return!te({start:nt,end:ue})||!de(ye)}case"minutes":{const ye=n.setMinutes(q,Z),Le=n.setSeconds(ye,0),nt=n.setSeconds(ye,59);return!te({start:Le,end:nt})||!de(Z,y)}case"seconds":{const ye=n.setSeconds(q,Z);return!te({start:ye,end:ye})||!de(Z)}default:throw new Error("not supported")}},[s,q,f,m,Y,v,y,w,n,g,x,Q,I]),ae=Hi(),oe=D.useMemo(()=>{switch(G){case"hours":{const Z=(ee,te)=>{const de=jn(ee,Y,s);ie(n.setHours(q,de),te,"hours")},X=n.getHours(q);let H;return s?X>12?H=[12,23]:H=[0,11]:H=[0,23],{onChange:Z,viewValue:X,children:RI({value:B,utils:n,ampm:s,getClockNumberText:L.hoursClockNumberText,isDisabled:ee=>F||se(ee,"hours"),selectedId:ae}),viewRange:H}}case"minutes":{const Z=n.getMinutes(q);return{viewValue:Z,onChange:(H,ee)=>{ie(n.setMinutes(q,H),ee,"minutes")},children:fd({utils:n,value:Z,getClockNumberText:L.minutesClockNumberText,isDisabled:H=>F||se(H,"minutes"),selectedId:ae}),viewRange:[0,59]}}case"seconds":{const Z=n.getSeconds(q);return{viewValue:Z,onChange:(H,ee)=>{ie(n.setSeconds(q,H),ee,"seconds")},children:fd({utils:n,value:Z,getClockNumberText:L.secondsClockNumberText,isDisabled:H=>F||se(H,"seconds"),selectedId:ae}),viewRange:[0,59]}}default:throw new Error("You must provide the type for ClockView")}},[G,n,B,s,L.hoursClockNumberText,L.minutesClockNumberText,L.secondsClockNumberText,Y,ie,q,se,ae,F]),V=r,z=QI(V);return h.jsxs(eC,_({ref:t,className:Ee(z.root,W),ownerState:V},R,{children:[h.jsx(TI,_({autoFocus:a??!!A,ampmInClock:o&&I.includes("hours"),value:B,type:G,ampm:s,minutesStep:y,isTimeDisabled:se,meridiemMode:Y,handleMeridiemChange:K,selectedId:ae,disabled:F,readOnly:j},oe)),S&&h.jsx(tC,{className:z.arrowSwitcher,slots:l,slotProps:c,onGoToPrevious:()=>ne(U),isPreviousDisabled:!U,previousLabel:L.openPreviousView,onGoToNext:()=>ne(re),isNextDisabled:!re,nextLabel:L.openNextView,ownerState:V})]}))});function rC(i){return Oe("MuiDigitalClock",i)}je("MuiDigitalClock",["root","list","item"]);function _i(i,e){return Array.isArray(e)?e.every(t=>i.indexOf(t)!==-1):i.indexOf(e)!==-1}const sC=(i,e)=>t=>{(t.key==="Enter"||t.key===" ")&&(i(t),t.preventDefault(),t.stopPropagation())},tt=(i=document)=>{const e=i.activeElement;return e?e.shadowRoot?tt(e.shadowRoot):e:null},$r=i=>Array.from(i.children).indexOf(tt(document)),sh="@media (pointer: fine)",oC=["ampm","timeStep","autoFocus","slots","slotProps","value","defaultValue","referenceDate","disableIgnoringDatePartForTimeValidation","maxTime","minTime","disableFuture","disablePast","minutesStep","shouldDisableTime","onChange","view","openTo","onViewChange","focusedView","onFocusedViewChange","className","disabled","readOnly","views","skipDisabled","timezone"],aC=i=>{const{classes:e}=i;return Te({root:["root"],list:["list"],item:["item"]},rC,e)},lC=ce(ys,{name:"MuiDigitalClock",slot:"Root",overridesResolver:(i,e)=>e.root})({overflowY:"auto",width:"100%","@media (prefers-reduced-motion: no-preference)":{scrollBehavior:"auto"},maxHeight:Gp,variants:[{props:{alreadyRendered:!0},style:{"@media (prefers-reduced-motion: no-preference)":{scrollBehavior:"smooth"}}}]}),cC=ce(Od,{name:"MuiDigitalClock",slot:"List",overridesResolver:(i,e)=>e.list})({padding:0}),dC=ce(Pd,{name:"MuiDigitalClock",slot:"Item",overridesResolver:(i,e)=>e.item})(({theme:i})=>({padding:"8px 16px",margin:"2px 4px","&:first-of-type":{marginTop:4},"&:hover":{backgroundColor:i.vars?`rgba(${i.vars.palette.primary.mainChannel} / ${i.vars.palette.action.hoverOpacity})`:bt.alpha(i.palette.primary.main,i.palette.action.hoverOpacity)},"&.Mui-selected":{backgroundColor:(i.vars||i).palette.primary.main,color:(i.vars||i).palette.primary.contrastText,"&:focus-visible, &:hover":{backgroundColor:(i.vars||i).palette.primary.dark}},"&.Mui-focusVisible":{backgroundColor:i.vars?`rgba(${i.vars.palette.primary.mainChannel} / ${i.vars.palette.action.focusOpacity})`:bt.alpha(i.palette.primary.main,i.palette.action.focusOpacity)}})),uC=D.forwardRef(function(e,t){const n=Me(),r=D.useRef(null),s=st(t,r),o=D.useRef(null),a=Ie({props:e,name:"MuiDigitalClock"}),{ampm:l=n.is12HourCycleInCurrentLocale(),timeStep:c=30,autoFocus:u,slots:p,slotProps:d,value:f,defaultValue:m,referenceDate:v,disableIgnoringDatePartForTimeValidation:g=!1,maxTime:x,minTime:y,disableFuture:w,disablePast:S,minutesStep:M=1,shouldDisableTime:b,onChange:I,view:P,openTo:E,onViewChange:A,focusedView:T,onFocusedViewChange:W,className:F,disabled:j,readOnly:O,views:R=["hours"],skipDisabled:B=!1,timezone:$}=a,J=me(a,oC),{value:q,handleValueChange:L,timezone:Q}=Ki({name:"DigitalClock",timezone:$,value:f,defaultValue:m,referenceDate:v,onChange:I,valueManager:Ue}),G=Qe(),ne=Di(Q),U=D.useMemo(()=>_({},a,{alreadyRendered:!!r.current}),[a]),re=aC(U),ie=(p==null?void 0:p.digitalClockItem)??dC,Y=Pe({elementType:ie,externalSlotProps:d==null?void 0:d.digitalClockItem,ownerState:{},className:re.item}),K=xl({value:q,referenceDate:v,utils:n,props:a,timezone:Q}),se=he(H=>L(H,"finish","hours")),{setValueAndGoToNextView:ae}=Gn({view:P,views:R,openTo:E,onViewChange:A,onChange:se,focusedView:T,onFocusedViewChange:W}),oe=he(H=>{ae(H,"finish")});D.useEffect(()=>{if(r.current===null)return;const H=r.current.querySelector('[role="listbox"] [role="option"][tabindex="0"], [role="listbox"] [role="option"][aria-selected="true"]');if(!H)return;const ee=H.offsetTop;(u||T)&&H.focus(),r.current.scrollTop=ee-4});const V=D.useCallback(H=>{const ee=Yn(g,n),te=()=>!(y&&ee(y,H)||x&&ee(H,x)||w&&ee(H,ne)||S&&ee(ne,H)),de=()=>n.getMinutes(H)%M!==0?!1:b?!b(H,"hours"):!0;return!te()||!de()},[g,n,y,x,w,ne,S,M,b]),z=D.useMemo(()=>{const H=[];let te=n.startOfDay(K);for(;n.isSameDay(K,te);)H.push(te),te=n.addMinutes(te,c);return H},[K,c,n]),Z=z.findIndex(H=>n.isEqual(H,K)),X=H=>{switch(H.key){case"PageUp":{const ee=$r(o.current)-5,te=o.current.children,de=Math.max(0,ee),ye=te[de];ye&&ye.focus(),H.preventDefault();break}case"PageDown":{const ee=$r(o.current)+5,te=o.current.children,de=Math.min(te.length-1,ee),ye=te[de];ye&&ye.focus(),H.preventDefault();break}}};return h.jsx(lC,_({ref:s,className:Ee(re.root,F),ownerState:U},J,{children:h.jsx(cC,{ref:o,role:"listbox","aria-label":G.timePickerToolbarTitle,className:re.list,onKeyDown:X,children:z.map((H,ee)=>{if(B&&V(H))return null;const te=n.isEqual(H,q),de=n.format(H,l?"fullTime12h":"fullTime24h"),ye=Z===ee||Z===-1&&ee===0?0:-1;return h.jsx(ie,_({onClick:()=>!O&&oe(H),selected:te,disabled:j||V(H),disableRipple:O,role:"option","aria-disabled":O,"aria-selected":te,tabIndex:ye},Y,{children:de}),`${H.valueOf()}-${de}`)})})}))});function pC(i){return Oe("MuiMultiSectionDigitalClock",i)}je("MuiMultiSectionDigitalClock",["root"]);function hC(i){return Oe("MuiMultiSectionDigitalClockSection",i)}je("MuiMultiSectionDigitalClockSection",["root","item"]);const fC=["autoFocus","onChange","className","disabled","readOnly","items","active","slots","slotProps","skipDisabled"],mC=i=>{const{classes:e}=i;return Te({root:["root"],item:["item"]},hC,e)},gC=ce(Od,{name:"MuiMultiSectionDigitalClockSection",slot:"Root",overridesResolver:(i,e)=>e.root})(({theme:i})=>({maxHeight:Gp,width:56,padding:0,overflow:"hidden","@media (prefers-reduced-motion: no-preference)":{scrollBehavior:"auto"},"@media (pointer: fine)":{"&:hover":{overflowY:"auto"}},"@media (pointer: none), (pointer: coarse)":{overflowY:"auto"},"&:not(:first-of-type)":{borderLeft:`1px solid ${(i.vars||i).palette.divider}`},"&::after":{display:"block",content:'""',height:"calc(100% - 40px - 6px)"},variants:[{props:{alreadyRendered:!0},style:{"@media (prefers-reduced-motion: no-preference)":{scrollBehavior:"smooth"}}}]})),vC=ce(Pd,{name:"MuiMultiSectionDigitalClockSection",slot:"Item",overridesResolver:(i,e)=>e.item})(({theme:i})=>({padding:8,margin:"2px 4px",width:nI,justifyContent:"center","&:first-of-type":{marginTop:4},"&:hover":{backgroundColor:i.vars?`rgba(${i.vars.palette.primary.mainChannel} / ${i.vars.palette.action.hoverOpacity})`:bt.alpha(i.palette.primary.main,i.palette.action.hoverOpacity)},"&.Mui-selected":{backgroundColor:(i.vars||i).palette.primary.main,color:(i.vars||i).palette.primary.contrastText,"&:focus-visible, &:hover":{backgroundColor:(i.vars||i).palette.primary.dark}},"&.Mui-focusVisible":{backgroundColor:i.vars?`rgba(${i.vars.palette.primary.mainChannel} / ${i.vars.palette.action.focusOpacity})`:bt.alpha(i.palette.primary.main,i.palette.action.focusOpacity)}})),xC=D.forwardRef(function(e,t){const n=D.useRef(null),r=st(t,n),s=D.useRef(null),o=Ie({props:e,name:"MuiMultiSectionDigitalClockSection"}),{autoFocus:a,onChange:l,className:c,disabled:u,readOnly:p,items:d,active:f,slots:m,slotProps:v,skipDisabled:g}=o,x=me(o,fC),y=D.useMemo(()=>_({},o,{alreadyRendered:!!n.current}),[o]),w=mC(y),S=(m==null?void 0:m.digitalClockSectionItem)??vC;D.useEffect(()=>{if(n.current===null)return;const I=n.current.querySelector('[role="option"][tabindex="0"], [role="option"][aria-selected="true"]');if(f&&a&&I&&I.focus(),!I||s.current===I)return;s.current=I;const P=I.offsetTop;n.current.scrollTop=P-4});const M=d.findIndex(I=>I.isFocused(I.value)),b=I=>{switch(I.key){case"PageUp":{const P=$r(n.current)-5,E=n.current.children,A=Math.max(0,P),T=E[A];T&&T.focus(),I.preventDefault();break}case"PageDown":{const P=$r(n.current)+5,E=n.current.children,A=Math.min(E.length-1,P),T=E[A];T&&T.focus(),I.preventDefault();break}}};return h.jsx(gC,_({ref:r,className:Ee(w.root,c),ownerState:y,autoFocusItem:a&&f,role:"listbox",onKeyDown:b},x,{children:d.map((I,P)=>{var F;const E=(F=I.isDisabled)==null?void 0:F.call(I,I.value),A=u||E;if(g&&A)return null;const T=I.isSelected(I.value),W=M===P||M===-1&&P===0?0:-1;return h.jsx(S,_({onClick:()=>!p&&l(I.value),selected:T,disabled:A,disableRipple:p,role:"option","aria-disabled":p||A||void 0,"aria-label":I.ariaLabel,"aria-selected":T,tabIndex:W,className:w.item},v==null?void 0:v.digitalClockSectionItem,{children:I.label}),I.label)})}))}),yC=({now:i,value:e,utils:t,ampm:n,isDisabled:r,resolveAriaLabel:s,timeStep:o,valueOrReferenceDate:a})=>{const l=e?t.getHours(e):null,c=[],u=(f,m)=>{const v=m??l;return v===null?!1:n?f===12?v===12||v===0:v===f||v-12===f:v===f},p=f=>u(f,t.getHours(a)),d=n?11:23;for(let f=0;f<=d;f+=o){let m=t.format(t.setHours(i,f),n?"hours12h":"hours24h");const v=s(parseInt(m,10).toString());m=t.formatNumber(m),c.push({value:f,label:m,isSelected:u,isDisabled:r,isFocused:p,ariaLabel:v})}return c},bd=({value:i,utils:e,isDisabled:t,timeStep:n,resolveLabel:r,resolveAriaLabel:s,hasValue:o=!0})=>{const a=c=>i===null?!1:o&&i===c,l=c=>i===c;return[...Array.from({length:Math.ceil(60/n)},(c,u)=>{const p=n*u;return{value:p,label:e.formatNumber(r(p)),isDisabled:t,isSelected:a,isFocused:l,ariaLabel:s(p.toString())}})]},bC=["ampm","timeSteps","autoFocus","slots","slotProps","value","defaultValue","referenceDate","disableIgnoringDatePartForTimeValidation","maxTime","minTime","disableFuture","disablePast","minutesStep","shouldDisableTime","onChange","view","views","openTo","onViewChange","focusedView","onFocusedViewChange","className","disabled","readOnly","skipDisabled","timezone"],wC=i=>{const{classes:e}=i;return Te({root:["root"]},pC,e)},DC=ce(ys,{name:"MuiMultiSectionDigitalClock",slot:"Root",overridesResolver:(i,e)=>e.root})(({theme:i})=>({display:"flex",flexDirection:"row",width:"100%",borderBottom:`1px solid ${(i.vars||i).palette.divider}`})),SC=D.forwardRef(function(e,t){const n=Me(),r=Tt(),s=Ie({props:e,name:"MuiMultiSectionDigitalClock"}),{ampm:o=n.is12HourCycleInCurrentLocale(),timeSteps:a,autoFocus:l,slots:c,slotProps:u,value:p,defaultValue:d,referenceDate:f,disableIgnoringDatePartForTimeValidation:m=!1,maxTime:v,minTime:g,disableFuture:x,disablePast:y,minutesStep:w=1,shouldDisableTime:S,onChange:M,view:b,views:I=["hours","minutes"],openTo:P,onViewChange:E,focusedView:A,onFocusedViewChange:T,className:W,disabled:F,readOnly:j,skipDisabled:O=!1,timezone:R}=s,B=me(s,bC),{value:$,handleValueChange:J,timezone:q}=Ki({name:"MultiSectionDigitalClock",timezone:R,value:p,defaultValue:d,referenceDate:f,onChange:M,valueManager:Ue}),L=Qe(),Q=Di(q),G=D.useMemo(()=>_({hours:1,minutes:5,seconds:5},a),[a]),ne=xl({value:$,referenceDate:f,utils:n,props:s,timezone:q}),U=he((te,de,ye)=>J(te,de,ye)),re=D.useMemo(()=>!o||!I.includes("hours")||I.includes("meridiem")?I:[...I,"meridiem"],[o,I]),{view:ie,setValueAndGoToNextView:Y,focusedView:K}=Gn({view:b,views:re,openTo:P,onViewChange:E,onChange:U,focusedView:A,onFocusedViewChange:T}),se=he(te=>{Y(te,"finish","meridiem")}),{meridiemMode:ae,handleMeridiemChange:oe}=dl(ne,o,se,"finish"),V=D.useCallback((te,de)=>{const ye=Yn(m,n),Le=de==="hours"||de==="minutes"&&re.includes("seconds"),nt=({start:pe,end:Ce})=>!(g&&ye(g,Ce)||v&&ye(pe,v)||x&&ye(pe,Q)||y&&ye(Q,Le?Ce:pe)),ue=(pe,Ce=1)=>{if(pe%Ce!==0)return!1;if(S)switch(de){case"hours":return!S(n.setHours(ne,pe),"hours");case"minutes":return!S(n.setMinutes(ne,pe),"minutes");case"seconds":return!S(n.setSeconds(ne,pe),"seconds");default:return!1}return!0};switch(de){case"hours":{const pe=jn(te,ae,o),Ce=n.setHours(ne,pe);if(n.getHours(Ce)!==pe)return!0;const Ae=n.setSeconds(n.setMinutes(Ce,0),0),ze=n.setSeconds(n.setMinutes(Ce,59),59);return!nt({start:Ae,end:ze})||!ue(pe)}case"minutes":{const pe=n.setMinutes(ne,te),Ce=n.setSeconds(pe,0),Ae=n.setSeconds(pe,59);return!nt({start:Ce,end:Ae})||!ue(te,w)}case"seconds":{const pe=n.setSeconds(ne,te);return!nt({start:pe,end:pe})||!ue(te)}default:throw new Error("not supported")}},[o,ne,m,v,ae,g,w,S,n,x,y,Q,re]),z=D.useCallback(te=>{switch(te){case"hours":return{onChange:de=>{const ye=jn(de,ae,o);Y(n.setHours(ne,ye),"finish","hours")},items:yC({now:Q,value:$,ampm:o,utils:n,isDisabled:de=>V(de,"hours"),timeStep:G.hours,resolveAriaLabel:L.hoursClockNumberText,valueOrReferenceDate:ne})};case"minutes":return{onChange:de=>{Y(n.setMinutes(ne,de),"finish","minutes")},items:bd({value:n.getMinutes(ne),utils:n,isDisabled:de=>V(de,"minutes"),resolveLabel:de=>n.format(n.setMinutes(Q,de),"minutes"),timeStep:G.minutes,hasValue:!!$,resolveAriaLabel:L.minutesClockNumberText})};case"seconds":return{onChange:de=>{Y(n.setSeconds(ne,de),"finish","seconds")},items:bd({value:n.getSeconds(ne),utils:n,isDisabled:de=>V(de,"seconds"),resolveLabel:de=>n.format(n.setSeconds(Q,de),"seconds"),timeStep:G.seconds,hasValue:!!$,resolveAriaLabel:L.secondsClockNumberText})};case"meridiem":{const de=Ht(n,"am"),ye=Ht(n,"pm");return{onChange:oe,items:[{value:"am",label:de,isSelected:()=>!!$&&ae==="am",isFocused:()=>!!ne&&ae==="am",ariaLabel:de},{value:"pm",label:ye,isSelected:()=>!!$&&ae==="pm",isFocused:()=>!!ne&&ae==="pm",ariaLabel:ye}]}}default:throw new Error(`Unknown view: ${te} found.`)}},[Q,$,o,n,G.hours,G.minutes,G.seconds,L.hoursClockNumberText,L.minutesClockNumberText,L.secondsClockNumberText,ae,Y,ne,V,oe]),Z=D.useMemo(()=>{if(!r)return re;const te=re.filter(de=>de!=="meridiem");return te.reverse(),re.includes("meridiem")&&te.push("meridiem"),te},[r,re]),X=D.useMemo(()=>re.reduce((te,de)=>_({},te,{[de]:z(de)}),{}),[re,z]),H=s,ee=wC(H);return h.jsx(DC,_({ref:t,className:Ee(ee.root,W),ownerState:H,role:"group"},B,{children:Z.map(te=>h.jsx(xC,{items:X[te].items,onChange:X[te].onChange,active:ie===te,autoFocus:l||K===te,disabled:F,readOnly:j,slots:c,slotProps:u,skipDisabled:O,"aria-label":L.selectViewText(te)},te))}))});function IC(i){return Oe("MuiPickersDay",i)}const ai=je("MuiPickersDay",["root","dayWithMargin","dayOutsideMonth","hiddenDaySpacingFiller","today","selected","disabled"]),CC=["autoFocus","className","day","disabled","disableHighlightToday","disableMargin","hidden","isAnimating","onClick","onDaySelect","onFocus","onBlur","onKeyDown","onMouseDown","onMouseEnter","outsideCurrentMonth","selected","showDaysOutsideCurrentMonth","children","today","isFirstVisibleCell","isLastVisibleCell"],_C=i=>{const{selected:e,disableMargin:t,disableHighlightToday:n,today:r,disabled:s,outsideCurrentMonth:o,showDaysOutsideCurrentMonth:a,classes:l}=i,c=o&&!a;return Te({root:["root",e&&!c&&"selected",s&&"disabled",!t&&"dayWithMargin",!n&&r&&"today",o&&a&&"dayOutsideMonth",c&&"hiddenDaySpacingFiller"],hiddenDaySpacingFiller:["hiddenDaySpacingFiller"]},IC,l)},oh=({theme:i})=>_({},i.typography.caption,{width:En,height:En,borderRadius:"50%",padding:0,backgroundColor:"transparent",transition:i.transitions.create("background-color",{duration:i.transitions.duration.short}),color:(i.vars||i).palette.text.primary,"@media (pointer: fine)":{"&:hover":{backgroundColor:i.vars?`rgba(${i.vars.palette.primary.mainChannel} / ${i.vars.palette.action.hoverOpacity})`:bt.alpha(i.palette.primary.main,i.palette.action.hoverOpacity)}},"&:focus":{backgroundColor:i.vars?`rgba(${i.vars.palette.primary.mainChannel} / ${i.vars.palette.action.focusOpacity})`:bt.alpha(i.palette.primary.main,i.palette.action.focusOpacity),[`&.${ai.selected}`]:{willChange:"background-color",backgroundColor:(i.vars||i).palette.primary.dark}},[`&.${ai.selected}`]:{color:(i.vars||i).palette.primary.contrastText,backgroundColor:(i.vars||i).palette.primary.main,fontWeight:i.typography.fontWeightMedium,"&:hover":{willChange:"background-color",backgroundColor:(i.vars||i).palette.primary.dark}},[`&.${ai.disabled}:not(.${ai.selected})`]:{color:(i.vars||i).palette.text.disabled},[`&.${ai.disabled}&.${ai.selected}`]:{opacity:.6},variants:[{props:{disableMargin:!1},style:{margin:`0 ${vs}px`}},{props:{outsideCurrentMonth:!0,showDaysOutsideCurrentMonth:!0},style:{color:(i.vars||i).palette.text.secondary}},{props:{disableHighlightToday:!1,today:!0},style:{[`&:not(.${ai.selected})`]:{border:`1px solid ${(i.vars||i).palette.text.secondary}`}}}]}),ah=(i,e)=>{const{ownerState:t}=i;return[e.root,!t.disableMargin&&e.dayWithMargin,!t.disableHighlightToday&&t.today&&e.today,!t.outsideCurrentMonth&&t.showDaysOutsideCurrentMonth&&e.dayOutsideMonth,t.outsideCurrentMonth&&!t.showDaysOutsideCurrentMonth&&e.hiddenDaySpacingFiller]},MC=ce(af,{name:"MuiPickersDay",slot:"Root",overridesResolver:ah})(oh),kC=ce("div",{name:"MuiPickersDay",slot:"Root",overridesResolver:ah})(({theme:i})=>_({},oh({theme:i}),{opacity:0,pointerEvents:"none"})),ln=()=>{},TC=D.forwardRef(function(e,t){const n=Ie({props:e,name:"MuiPickersDay"}),{autoFocus:r=!1,className:s,day:o,disabled:a=!1,disableHighlightToday:l=!1,disableMargin:c=!1,isAnimating:u,onClick:p,onDaySelect:d,onFocus:f=ln,onBlur:m=ln,onKeyDown:v=ln,onMouseDown:g=ln,onMouseEnter:x=ln,outsideCurrentMonth:y,selected:w=!1,showDaysOutsideCurrentMonth:S=!1,children:M,today:b=!1}=n,I=me(n,CC),P=_({},n,{autoFocus:r,disabled:a,disableHighlightToday:l,disableMargin:c,selected:w,showDaysOutsideCurrentMonth:S,today:b}),E=_C(P),A=Me(),T=D.useRef(null),W=st(T,t);Ft(()=>{r&&!a&&!u&&!y&&T.current.focus()},[r,a,u,y]);const F=O=>{g(O),y&&O.preventDefault()},j=O=>{a||d(o),y&&O.currentTarget.focus(),p&&p(O)};return y&&!S?h.jsx(kC,{className:Ee(E.root,E.hiddenDaySpacingFiller,s),ownerState:P,role:I.role}):h.jsx(MC,_({className:Ee(E.root,s),ref:W,centerRipple:!0,disabled:a,tabIndex:w?0:-1,onKeyDown:O=>v(O,o),onFocus:O=>f(O,o),onBlur:O=>m(O,o),onMouseEnter:O=>x(O,o),onClick:j,onMouseDown:F},I,{ownerState:P,children:M||A.format(o,"dayOfMonth")}))}),PC=D.memo(TC),Jn=({props:i,value:e,timezone:t,adapter:n})=>{if(e===null)return null;const{shouldDisableDate:r,shouldDisableMonth:s,shouldDisableYear:o,disablePast:a,disableFuture:l}=i,c=n.utils.date(void 0,t),u=wt(n.utils,i.minDate,n.defaultDates.minDate),p=wt(n.utils,i.maxDate,n.defaultDates.maxDate);switch(!0){case!n.utils.isValid(e):return"invalidDate";case!!(r&&r(e)):return"shouldDisableDate";case!!(s&&s(e)):return"shouldDisableMonth";case!!(o&&o(e)):return"shouldDisableYear";case!!(l&&n.utils.isAfterDay(e,c)):return"disableFuture";case!!(a&&n.utils.isBeforeDay(e,c)):return"disablePast";case!!(u&&n.utils.isBeforeDay(e,u)):return"minDate";case!!(p&&n.utils.isAfterDay(e,p)):return"maxDate";default:return null}};Jn.valueManager=Ue;const ws=({adapter:i,value:e,timezone:t,props:n})=>{if(e===null)return null;const{minTime:r,maxTime:s,minutesStep:o,shouldDisableTime:a,disableIgnoringDatePartForTimeValidation:l=!1,disablePast:c,disableFuture:u}=n,p=i.utils.date(void 0,t),d=Yn(l,i.utils);switch(!0){case!i.utils.isValid(e):return"invalidDate";case!!(r&&d(r,e)):return"minTime";case!!(s&&d(e,s)):return"maxTime";case!!(u&&i.utils.isAfter(e,p)):return"disableFuture";case!!(c&&i.utils.isBefore(e,p)):return"disablePast";case!!(a&&a(e,"hours")):return"shouldDisableTime-hours";case!!(a&&a(e,"minutes")):return"shouldDisableTime-minutes";case!!(a&&a(e,"seconds")):return"shouldDisableTime-seconds";case!!(o&&i.utils.getMinutes(e)%o!==0):return"minutesStep";default:return null}};ws.valueManager=Ue;const Co=["disablePast","disableFuture","minDate","maxDate","shouldDisableDate","shouldDisableMonth","shouldDisableYear"],_o=["disablePast","disableFuture","minTime","maxTime","shouldDisableTime","minutesStep","ampm","disableIgnoringDatePartForTimeValidation"],lh=["minDateTime","maxDateTime"],OC=[...Co,..._o,...lh],Ds=i=>OC.reduce((e,t)=>(i.hasOwnProperty(t)&&(e[t]=i[t]),e),{});function ch(i){const{props:e,validator:t,value:n,timezone:r,onError:s}=i,o=wi(),a=D.useRef(t.valueManager.defaultErrorState),l=t({adapter:o,value:n,timezone:r,props:e}),c=t.valueManager.hasError(l);D.useEffect(()=>{s&&!t.valueManager.isSameError(l,a.current)&&s(l,n),a.current=l},[t,s,l,n]);const u=he(p=>t({adapter:o,value:p,timezone:r,props:e}));return{validationError:l,hasValidationError:c,getValidationErrorForNewValue:u}}const jC=({utils:i,format:e})=>{let t=10,n=e,r=i.expandFormat(e);for(;r!==n;)if(n=r,r=i.expandFormat(n),t-=1,t<0)throw new Error("MUI X: The format expansion seems to be in an infinite loop. Please open an issue with the format passed to the picker component.");return r},EC=({utils:i,expandedFormat:e})=>{const t=[],{start:n,end:r}=i.escapedCharacters,s=new RegExp(`(\\${n}[^\\${r}]*\\${r})+`,"g");let o=null;for(;o=s.exec(e);)t.push({start:o.index,end:s.lastIndex-1});return t},RC=(i,e,t,n)=>{switch(t.type){case"year":return e.fieldYearPlaceholder({digitAmount:i.formatByString(i.date(void 0,"default"),n).length,format:n});case"month":return e.fieldMonthPlaceholder({contentType:t.contentType,format:n});case"day":return e.fieldDayPlaceholder({format:n});case"weekDay":return e.fieldWeekDayPlaceholder({contentType:t.contentType,format:n});case"hours":return e.fieldHoursPlaceholder({format:n});case"minutes":return e.fieldMinutesPlaceholder({format:n});case"seconds":return e.fieldSecondsPlaceholder({format:n});case"meridiem":return e.fieldMeridiemPlaceholder({format:n});default:return n}},AC=({utils:i,date:e,shouldRespectLeadingZeros:t,localeText:n,localizedDigits:r,now:s,token:o,startSeparator:a})=>{if(o==="")throw new Error("MUI X: Should not call `commitToken` with an empty token");const l=Qp(i,o),c=nh(i,l.contentType,l.type,o),u=t?c:l.contentType==="digit",p=e!=null&&i.isValid(e);let d=p?i.formatByString(e,o):"",f=null;if(u)if(c)f=d===""?i.formatByString(s,o).length:d.length;else{if(l.maxLength==null)throw new Error(`MUI X: The token ${o} should have a 'maxDigitNumber' property on it's adapter`);f=l.maxLength,p&&(d=gl(th(yi(d,r),f),r))}return _({},l,{format:o,maxLength:f,value:d,placeholder:RC(i,n,l,o),hasLeadingZerosInFormat:c,hasLeadingZerosInInput:u,startSeparator:a,endSeparator:"",modified:!1})},NC=i=>{var f;const{utils:e,expandedFormat:t,escapedParts:n}=i,r=e.date(void 0),s=[];let o="";const a=Object.keys(e.formatTokenMap).sort((m,v)=>v.length-m.length),l=/^([a-zA-Z]+)/,c=new RegExp(`^(${a.join("|")})*$`),u=new RegExp(`^(${a.join("|")})`),p=m=>n.find(v=>v.start<=m&&v.end>=m);let d=0;for(;d<t.length;){const m=p(d),v=m!=null,g=(f=l.exec(t.slice(d)))==null?void 0:f[1];if(!v&&g!=null&&c.test(g)){let x=g;for(;x.length>0;){const y=u.exec(x)[1];x=x.slice(y.length),s.push(AC(_({},i,{now:r,token:y,startSeparator:o}))),o=""}d+=g.length}else{const x=t[d];v&&(m==null?void 0:m.start)===d||(m==null?void 0:m.end)===d||(s.length===0?o+=x:s[s.length-1].endSeparator+=x),d+=1}}return s.length===0&&o.length>0&&s.push({type:"empty",contentType:"letter",maxLength:null,format:"",value:"",placeholder:"",hasLeadingZerosInFormat:!1,hasLeadingZerosInInput:!1,startSeparator:o,endSeparator:"",modified:!1}),s},$C=({isRtl:i,formatDensity:e,sections:t})=>t.map(n=>{const r=s=>{let o=s;return i&&o!==null&&o.includes(" ")&&(o=`${o}`),e==="spacious"&&["/",".","-"].includes(o)&&(o=` ${o} `),o};return n.startSeparator=r(n.startSeparator),n.endSeparator=r(n.endSeparator),n}),wd=i=>{let e=jC(i);i.isRtl&&i.enableAccessibleFieldDOMStructure&&(e=e.split(" ").reverse().join(" "));const t=EC(_({},i,{expandedFormat:e})),n=NC(_({},i,{expandedFormat:e,escapedParts:t}));return $C(_({},i,{sections:n}))},WC=i=>{const e=Me(),t=Qe(),n=wi(),r=Tt(),{valueManager:s,fieldValueManager:o,valueType:a,validator:l,internalProps:c,internalProps:{value:u,defaultValue:p,referenceDate:d,onChange:f,format:m,formatDensity:v="dense",selectedSections:g,onSelectedSectionsChange:x,shouldRespectLeadingZeros:y=!1,timezone:w,enableAccessibleFieldDOMStructure:S=!1}}=i,{timezone:M,value:b,handleValueChange:I}=ml({timezone:w,value:u,defaultValue:p,referenceDate:d,onChange:f,valueManager:s}),P=D.useMemo(()=>FI(e),[e]),E=D.useMemo(()=>qI(e,P,M),[e,P,M]),A=D.useCallback((U,re=null)=>o.getSectionsFromValue(e,U,re,ie=>wd({utils:e,localeText:t,localizedDigits:P,format:m,date:ie,formatDensity:v,shouldRespectLeadingZeros:y,enableAccessibleFieldDOMStructure:S,isRtl:r})),[o,m,t,P,r,y,e,v,S]),[T,W]=D.useState(()=>{const U=A(b),re={sections:U,value:b,referenceValue:s.emptyValue,tempValueStrAndroid:null},ie=AI(U),Y=s.getInitialReferenceValue({referenceDate:d,value:b,utils:e,props:c,granularity:ie,timezone:M});return _({},re,{referenceValue:Y})}),[F,j]=fi({controlled:g,default:null,name:"useField",state:"selectedSections"}),O=U=>{j(U),x==null||x(U)},R=D.useMemo(()=>Io(F,T.sections),[F,T.sections]),B=R==="all"?0:R,$=({value:U,referenceValue:re,sections:ie})=>{if(W(K=>_({},K,{sections:ie,value:U,referenceValue:re,tempValueStrAndroid:null})),s.areValuesEqual(e,T.value,U))return;const Y={validationError:l({adapter:n,value:U,timezone:M,props:c})};I(U,Y)},J=(U,re)=>{const ie=[...T.sections];return ie[U]=_({},ie[U],{value:re,modified:!0}),ie},q=()=>{$({value:s.emptyValue,referenceValue:T.referenceValue,sections:A(s.emptyValue)})},L=()=>{if(B==null)return;const U=T.sections[B],re=o.getActiveDateManager(e,T,U),Y=re.getSections(T.sections).filter(oe=>oe.value!=="").length===(U.value===""?0:1),K=J(B,""),se=Y?null:e.getInvalidDate(),ae=re.getNewValuesFromNewActiveDate(se);$(_({},ae,{sections:K}))},Q=U=>{const re=(K,se)=>{const ae=e.parse(K,m);if(ae==null||!e.isValid(ae))return null;const oe=wd({utils:e,localeText:t,localizedDigits:P,format:m,date:ae,formatDensity:v,shouldRespectLeadingZeros:y,enableAccessibleFieldDOMStructure:S,isRtl:r});return yd(e,ae,oe,se,!1)},ie=o.parseValueStr(U,T.referenceValue,re),Y=o.updateReferenceValue(e,ie,T.referenceValue);$({value:ie,referenceValue:Y,sections:A(ie,T.sections)})},G=({activeSection:U,newSectionValue:re,shouldGoToNextSection:ie})=>{ie&&B<T.sections.length-1&&O(B+1);const Y=o.getActiveDateManager(e,T,U),K=J(B,re),se=Y.getSections(K),ae=VI(e,se,P);let oe,V;if(ae!=null&&e.isValid(ae)){const z=yd(e,ae,se,Y.referenceDate,!0);oe=Y.getNewValuesFromNewActiveDate(z),V=!0}else oe=Y.getNewValuesFromNewActiveDate(ae),V=(ae!=null&&!e.isValid(ae))!=(Y.date!=null&&!e.isValid(Y.date));return V?$(_({},oe,{sections:K})):W(z=>_({},z,oe,{sections:K,tempValueStrAndroid:null}))},ne=U=>W(re=>_({},re,{tempValueStrAndroid:U}));return D.useEffect(()=>{const U=A(T.value);W(re=>_({},re,{sections:U}))},[m,e.locale,r]),D.useEffect(()=>{let U;s.areValuesEqual(e,T.value,b)?U=s.getTimezone(e,T.value)!==s.getTimezone(e,b):U=!0,U&&W(re=>_({},re,{value:b,referenceValue:o.updateReferenceValue(e,b,re.referenceValue),sections:A(b)}))},[b]),{state:T,activeSectionIndex:B,parsedSelectedSections:R,setSelectedSections:O,clearValue:q,clearActiveSection:L,updateSectionValue:G,updateValueFromValueStr:Q,setTempAndroidValueStr:ne,getSectionsFromValue:A,sectionsValueBoundaries:E,localizedDigits:P,timezone:M}},FC=5e3,Ci=i=>i.saveQuery!=null,LC=({sections:i,updateSectionValue:e,sectionsValueBoundaries:t,localizedDigits:n,setTempAndroidValueStr:r,timezone:s})=>{const o=Me(),[a,l]=D.useState(null),c=he(()=>l(null));D.useEffect(()=>{var m;a!=null&&((m=i[a.sectionIndex])==null?void 0:m.type)!==a.sectionType&&c()},[i,a,c]),D.useEffect(()=>{if(a!=null){const m=setTimeout(()=>c(),FC);return()=>{clearTimeout(m)}}return()=>{}},[a,c]);const u=({keyPressed:m,sectionIndex:v},g,x)=>{const y=m.toLowerCase(),w=i[v];if(a!=null&&(!x||x(a.value))&&a.sectionIndex===v){const M=`${a.value}${y}`,b=g(M,w);if(!Ci(b))return l({sectionIndex:v,value:M,sectionType:w.type}),b}const S=g(y,w);return Ci(S)&&!S.saveQuery?(c(),null):(l({sectionIndex:v,value:y,sectionType:w.type}),Ci(S)?null:S)},p=m=>{const v=(y,w,S)=>{const M=w.filter(b=>b.toLowerCase().startsWith(S));return M.length===0?{saveQuery:!1}:{sectionValue:M[0],shouldGoToNextSection:M.length===1}},g=(y,w,S,M)=>{const b=I=>eh(o,s,w.type,I);if(w.contentType==="letter")return v(w.format,b(w.format),y);if(S&&M!=null&&Qp(o,S).contentType==="letter"){const I=b(S),P=v(S,I,y);return Ci(P)?{saveQuery:!1}:_({},P,{sectionValue:M(P.sectionValue,I)})}return{saveQuery:!1}};return u(m,(y,w)=>{switch(w.type){case"month":{const S=M=>vd(o,M,o.formats.month,w.format);return g(y,w,o.formats.month,S)}case"weekDay":{const S=(M,b)=>b.indexOf(M).toString();return g(y,w,o.formats.weekday,S)}case"meridiem":return g(y,w);default:return{saveQuery:!1}}})},d=m=>{const v=(x,y)=>{const w=yi(x,n),S=Number(w),M=t[y.type]({currentDate:null,format:y.format,contentType:y.contentType});if(S>M.maximum)return{saveQuery:!1};if(S<M.minimum)return{saveQuery:!0};const b=S*10>M.maximum||w.length===M.maximum.toString().length;return{sectionValue:ih(o,S,M,n,y),shouldGoToNextSection:b}};return u(m,(x,y)=>{if(y.contentType==="digit"||y.contentType==="digit-with-letter")return v(x,y);if(y.type==="month"){nh(o,"digit","month","MM");const w=v(x,{type:y.type,format:"MM",hasLeadingZerosInInput:!0,contentType:"digit",maxLength:2});if(Ci(w))return w;const S=vd(o,w.sectionValue,"MM",y.format);return _({},w,{sectionValue:S})}if(y.type==="weekDay"){const w=v(x,y);if(Ci(w))return w;const S=bs(o,y.format)[Number(w.sectionValue)-1];return _({},w,{sectionValue:S})}return{saveQuery:!1}},x=>gd(x,n))};return{applyCharacterEditing:he(m=>{const v=i[m.sectionIndex],x=gd(m.keyPressed,n)?d(_({},m,{keyPressed:gl(m.keyPressed,n)})):p(m);if(x==null){r(null);return}e({activeSection:v,newSectionValue:x.sectionValue,shouldGoToNextSection:x.shouldGoToNextSection})}),resetCharacterQuery:c}},BC=i=>{const{internalProps:{disabled:e,readOnly:t=!1},forwardedProps:{sectionListRef:n,onBlur:r,onClick:s,onFocus:o,onInput:a,onPaste:l,focused:c,autoFocus:u=!1},fieldValueManager:p,applyCharacterEditing:d,resetCharacterQuery:f,setSelectedSections:m,parsedSelectedSections:v,state:g,clearActiveSection:x,clearValue:y,updateSectionValue:w,updateValueFromValueStr:S,sectionOrder:M,areAllSectionsEmpty:b,sectionsValueBoundaries:I}=i,P=D.useRef(null),E=st(n,P),A=Qe(),T=Me(),W=Hi(),[F,j]=D.useState(!1),O=D.useMemo(()=>({syncSelectionToDOM:()=>{if(!P.current)return;const V=document.getSelection();if(!V)return;if(v==null){V.rangeCount>0&&P.current.getRoot().contains(V.getRangeAt(0).startContainer)&&V.removeAllRanges(),F&&P.current.getRoot().blur();return}if(!P.current.getRoot().contains(tt(document)))return;const z=new window.Range;let Z;v==="all"?Z=P.current.getRoot():g.sections[v].type==="empty"?Z=P.current.getSectionContainer(v):Z=P.current.getSectionContent(v),z.selectNodeContents(Z),Z.focus(),V.removeAllRanges(),V.addRange(z)},getActiveSectionIndexFromDOM:()=>{const V=tt(document);return!V||!P.current||!P.current.getRoot().contains(V)?null:P.current.getSectionIndexFromDOMElement(V)},focusField:(V=0)=>{if(!P.current||O.getActiveSectionIndexFromDOM()!=null)return;const z=Io(V,g.sections);j(!0),P.current.getSectionContent(z).focus()},setSelectedSections:V=>{if(!P.current)return;const z=Io(V,g.sections);j((z==="all"?0:z)!==null),m(V)},isFieldFocused:()=>{const V=tt(document);return!!P.current&&P.current.getRoot().contains(V)}}),[v,m,g.sections,F]),R=he(V=>{if(!P.current)return;const z=g.sections[V];P.current.getSectionContent(V).innerHTML=z.value||z.placeholder,O.syncSelectionToDOM()}),B=he((V,...z)=>{V.isDefaultPrevented()||!P.current||(j(!0),s==null||s(V,...z),v==="all"?setTimeout(()=>{const Z=document.getSelection().getRangeAt(0).startOffset;if(Z===0){m(M.startIndex);return}let X=0,H=0;for(;H<Z&&X<g.sections.length;){const ee=g.sections[X];X+=1,H+=`${ee.startSeparator}${ee.value||ee.placeholder}${ee.endSeparator}`.length}m(X-1)}):F?P.current.getRoot().contains(V.target)||m(M.startIndex):(j(!0),m(M.startIndex)))}),$=he(V=>{if(a==null||a(V),!P.current||v!=="all")return;const Z=V.target.textContent??"";P.current.getRoot().innerHTML=g.sections.map(X=>`${X.startSeparator}${X.value||X.placeholder}${X.endSeparator}`).join(""),O.syncSelectionToDOM(),Z.length===0||Z.charCodeAt(0)===10?(f(),y(),m("all")):Z.length>1?S(Z):(v==="all"&&m(0),d({keyPressed:Z,sectionIndex:0}))}),J=he(V=>{if(l==null||l(V),t||v!=="all"){V.preventDefault();return}const z=V.clipboardData.getData("text");V.preventDefault(),f(),S(z)}),q=he((...V)=>{if(o==null||o(...V),F||!P.current)return;j(!0),P.current.getSectionIndexFromDOMElement(tt(document))!=null||m(M.startIndex)}),L=he((...V)=>{r==null||r(...V),setTimeout(()=>{if(!P.current)return;const z=tt(document);!P.current.getRoot().contains(z)&&(j(!1),m(null))})}),Q=he(V=>z=>{z.isDefaultPrevented()||m(V)}),G=he(V=>{V.preventDefault()}),ne=he(V=>()=>{m(V)}),U=he(V=>{if(V.preventDefault(),t||e||typeof v!="number")return;const z=g.sections[v],Z=V.clipboardData.getData("text"),X=/^[a-zA-Z]+$/.test(Z),H=/^[0-9]+$/.test(Z),ee=/^(([a-zA-Z]+)|)([0-9]+)(([a-zA-Z]+)|)$/.test(Z);z.contentType==="letter"&&X||z.contentType==="digit"&&H||z.contentType==="digit-with-letter"&&ee?(f(),w({activeSection:z,newSectionValue:Z,shouldGoToNextSection:!0})):!X&&!H&&(f(),S(Z))}),re=he(V=>{V.preventDefault(),V.dataTransfer.dropEffect="none"}),ie=he(V=>{if(!P.current)return;const z=V.target,Z=z.textContent??"",X=P.current.getSectionIndexFromDOMElement(z),H=g.sections[X];if(t||!P.current){R(X);return}if(Z.length===0){if(H.value===""){R(X);return}const ee=V.nativeEvent.inputType;if(ee==="insertParagraph"||ee==="insertLineBreak"){R(X);return}f(),x();return}d({keyPressed:Z,sectionIndex:X}),R(X)});Ft(()=>{if(!(!F||!P.current)){if(v==="all")P.current.getRoot().focus();else if(typeof v=="number"){const V=P.current.getSectionContent(v);V&&V.focus()}}},[v,F]);const Y=D.useMemo(()=>g.sections.reduce((V,z)=>(V[z.type]=I[z.type]({currentDate:null,contentType:z.contentType,format:z.format}),V),{}),[I,g.sections]),K=v==="all",se=D.useMemo(()=>g.sections.map((V,z)=>{const Z=!K&&!e&&!t;return{container:{"data-sectionindex":z,onClick:Q(z)},content:{tabIndex:K||z>0?-1:0,contentEditable:!K&&!e&&!t,role:"spinbutton",id:`${W}-${V.type}`,"aria-labelledby":`${W}-${V.type}`,"aria-readonly":t,"aria-valuenow":KI(V,T),"aria-valuemin":Y[V.type].minimum,"aria-valuemax":Y[V.type].maximum,"aria-valuetext":V.value?JI(V,T):A.empty,"aria-label":A[V.type],"aria-disabled":e,spellCheck:Z?!1:void 0,autoCapitalize:Z?"off":void 0,autoCorrect:Z?"off":void 0,[parseInt(D.version,10)>=17?"enterKeyHint":"enterkeyhint"]:Z?"next":void 0,children:V.value||V.placeholder,onInput:ie,onPaste:U,onFocus:ne(z),onDragOver:re,onMouseUp:G,inputMode:V.contentType==="letter"?"text":"numeric"},before:{children:V.startSeparator},after:{children:V.endSeparator}}}),[g.sections,ne,U,re,ie,Q,G,e,t,K,A,T,Y,W]),ae=he(V=>{S(V.target.value)}),oe=D.useMemo(()=>b?"":p.getV7HiddenInputValueFromSections(g.sections),[b,g.sections,p]);return D.useEffect(()=>{if(P.current==null)throw new Error(["MUI X: The `sectionListRef` prop has not been initialized by `PickersSectionList`","You probably tried to pass a component to the `textField` slot that contains an `<input />` element instead of a `PickersSectionList`.","","If you want to keep using an `<input />` HTML element for the editing, please remove the `enableAccessibleFieldDOMStructure` prop from your picker or field component:","","<DatePicker slots={{ textField: MyCustomTextField }} />","","Learn more about the field accessible DOM structure on the MUI documentation: https://mui.com/x/react-date-pickers/fields/#fields-to-edit-a-single-element"].join(`
`));u&&P.current&&P.current.getSectionContent(M.startIndex).focus()},[]),{interactions:O,returnedValue:{autoFocus:u,readOnly:t,focused:c??F,sectionListRef:E,onBlur:L,onClick:B,onFocus:q,onInput:$,onPaste:J,enableAccessibleFieldDOMStructure:!0,elements:se,tabIndex:v===0?-1:0,contentEditable:K,value:oe,onChange:ae,areAllSectionsEmpty:b}}},Pi=i=>i.replace(/[\u2066\u2067\u2068\u2069]/g,""),VC=(i,e,t)=>{let n=0,r=t?1:0;const s=[];for(let o=0;o<i.length;o+=1){const a=i[o],l=vl(a,t?"input-rtl":"input-ltr",e),c=`${a.startSeparator}${l}${a.endSeparator}`,u=Pi(c).length,p=c.length,d=Pi(l),f=r+(d===""?0:l.indexOf(d[0]))+a.startSeparator.length,m=f+d.length;s.push(_({},a,{start:n,end:n+u,startInInput:f,endInInput:m})),n+=u,r+=p}return s},zC=i=>{const e=Tt(),t=D.useRef(void 0),n=D.useRef(void 0),{forwardedProps:{onFocus:r,onClick:s,onPaste:o,onBlur:a,inputRef:l,placeholder:c},internalProps:{readOnly:u=!1,disabled:p=!1},parsedSelectedSections:d,activeSectionIndex:f,state:m,fieldValueManager:v,valueManager:g,applyCharacterEditing:x,resetCharacterQuery:y,updateSectionValue:w,updateValueFromValueStr:S,clearActiveSection:M,clearValue:b,setTempAndroidValueStr:I,setSelectedSections:P,getSectionsFromValue:E,areAllSectionsEmpty:A,localizedDigits:T}=i,W=D.useRef(null),F=st(l,W),j=D.useMemo(()=>VC(m.sections,T,e),[m.sections,T,e]),O=D.useMemo(()=>({syncSelectionToDOM:()=>{if(!W.current)return;if(d==null){W.current.scrollLeft&&(W.current.scrollLeft=0);return}if(W.current!==tt(document))return;const ie=W.current.scrollTop;if(d==="all")W.current.select();else{const Y=j[d],K=Y.type==="empty"?Y.startInInput-Y.startSeparator.length:Y.startInInput,se=Y.type==="empty"?Y.endInInput+Y.endSeparator.length:Y.endInInput;(K!==W.current.selectionStart||se!==W.current.selectionEnd)&&W.current===tt(document)&&W.current.setSelectionRange(K,se),clearTimeout(n.current),n.current=setTimeout(()=>{W.current&&W.current===tt(document)&&W.current.selectionStart===W.current.selectionEnd&&(W.current.selectionStart!==K||W.current.selectionEnd!==se)&&O.syncSelectionToDOM()})}W.current.scrollTop=ie},getActiveSectionIndexFromDOM:()=>{const ie=W.current.selectionStart??0,Y=W.current.selectionEnd??0;if(ie===0&&Y===0)return null;const K=ie<=j[0].startInInput?1:j.findIndex(se=>se.startInInput-se.startSeparator.length>ie);return K===-1?j.length-1:K-1},focusField:(ie=0)=>{var Y;tt(document)!==W.current&&((Y=W.current)==null||Y.focus(),P(ie))},setSelectedSections:ie=>P(ie),isFieldFocused:()=>W.current===tt(document)}),[W,d,j,P]),R=()=>{const ie=W.current.selectionStart??0;let Y;ie<=j[0].startInInput||ie>=j[j.length-1].endInInput?Y=1:Y=j.findIndex(se=>se.startInInput-se.startSeparator.length>ie);const K=Y===-1?j.length-1:Y-1;P(K)},B=he((...ie)=>{r==null||r(...ie);const Y=W.current;clearTimeout(t.current),t.current=setTimeout(()=>{!Y||Y!==W.current||f==null&&(Y.value.length&&Number(Y.selectionEnd)-Number(Y.selectionStart)===Y.value.length?P("all"):R())})}),$=he((ie,...Y)=>{ie.isDefaultPrevented()||(s==null||s(ie,...Y),R())}),J=he(ie=>{if(o==null||o(ie),ie.preventDefault(),u||p)return;const Y=ie.clipboardData.getData("text");if(typeof d=="number"){const K=m.sections[d],se=/^[a-zA-Z]+$/.test(Y),ae=/^[0-9]+$/.test(Y),oe=/^(([a-zA-Z]+)|)([0-9]+)(([a-zA-Z]+)|)$/.test(Y);if(K.contentType==="letter"&&se||K.contentType==="digit"&&ae||K.contentType==="digit-with-letter"&&oe){y(),w({activeSection:K,newSectionValue:Y,shouldGoToNextSection:!0});return}if(se||ae)return}y(),S(Y)}),q=he((...ie)=>{a==null||a(...ie),P(null)}),L=he(ie=>{if(u)return;const Y=ie.target.value;if(Y===""){y(),b();return}const K=ie.nativeEvent.data,se=K&&K.length>1,ae=se?K:Y,oe=Pi(ae);if(d==="all"&&P(f),f==null||se){S(se?K:oe);return}let V;if(d==="all"&&oe.length===1)V=oe;else{const z=Pi(v.getV6InputValueFromSections(j,T,e));let Z=-1,X=-1;for(let de=0;de<z.length;de+=1)Z===-1&&z[de]!==oe[de]&&(Z=de),X===-1&&z[z.length-de-1]!==oe[oe.length-de-1]&&(X=de);const H=j[f];if(Z<H.start||z.length-X-1>H.end)return;const te=oe.length-z.length+H.end-Pi(H.endSeparator||"").length;V=oe.slice(H.start+Pi(H.startSeparator||"").length,te)}if(V.length===0){YI()&&I(ae),y(),M();return}x({keyPressed:V,sectionIndex:f})}),Q=D.useMemo(()=>c!==void 0?c:v.getV6InputValueFromSections(E(g.emptyValue),T,e),[c,v,E,g.emptyValue,T,e]),G=D.useMemo(()=>m.tempValueStrAndroid??v.getV6InputValueFromSections(m.sections,T,e),[m.sections,v,m.tempValueStrAndroid,T,e]);D.useEffect(()=>(W.current&&W.current===tt(document)&&P("all"),()=>{clearTimeout(t.current),clearTimeout(n.current)}),[]);const ne=D.useMemo(()=>f==null||m.sections[f].contentType==="letter"?"text":"numeric",[f,m.sections]),re=!(W.current&&W.current===tt(document))&&A;return{interactions:O,returnedValue:{readOnly:u,onBlur:q,onClick:$,onFocus:B,onPaste:J,inputRef:F,enableAccessibleFieldDOMStructure:!1,placeholder:Q,inputMode:ne,autoComplete:"off",value:re?"":G,onChange:L}}},dh=i=>{const e=Me(),{internalProps:t,internalProps:{unstableFieldRef:n,minutesStep:r,enableAccessibleFieldDOMStructure:s=!1,disabled:o=!1,readOnly:a=!1},forwardedProps:{onKeyDown:l,error:c,clearable:u,onClear:p},fieldValueManager:d,valueManager:f,validator:m}=i,v=Tt(),g=WC(i),{state:x,activeSectionIndex:y,parsedSelectedSections:w,setSelectedSections:S,clearValue:M,clearActiveSection:b,updateSectionValue:I,setTempAndroidValueStr:P,sectionsValueBoundaries:E,localizedDigits:A,timezone:T}=g,W=LC({sections:x.sections,updateSectionValue:I,sectionsValueBoundaries:E,localizedDigits:A,setTempAndroidValueStr:P,timezone:T}),{resetCharacterQuery:F}=W,j=f.areValuesEqual(e,x.value,f.emptyValue),O=s?BC:zC,R=D.useMemo(()=>GI(x.sections,v&&!s),[x.sections,v,s]),{returnedValue:B,interactions:$}=O(_({},i,g,W,{areAllSectionsEmpty:j,sectionOrder:R})),J=he(U=>{if(l==null||l(U),!o)switch(!0){case((U.ctrlKey||U.metaKey)&&String.fromCharCode(U.keyCode)==="A"&&!U.shiftKey&&!U.altKey):{U.preventDefault(),S("all");break}case U.key==="ArrowRight":{if(U.preventDefault(),w==null)S(R.startIndex);else if(w==="all")S(R.endIndex);else{const re=R.neighbors[w].rightIndex;re!==null&&S(re)}break}case U.key==="ArrowLeft":{if(U.preventDefault(),w==null)S(R.endIndex);else if(w==="all")S(R.startIndex);else{const re=R.neighbors[w].leftIndex;re!==null&&S(re)}break}case U.key==="Delete":{if(U.preventDefault(),a)break;w==null||w==="all"?M():b(),F();break}case["ArrowUp","ArrowDown","Home","End","PageUp","PageDown"].includes(U.key):{if(U.preventDefault(),a||y==null)break;w==="all"&&S(y);const re=x.sections[y],ie=d.getActiveDateManager(e,x,re),Y=LI(e,T,re,U.key,E,A,ie.date,{minutesStep:r});I({activeSection:re,newSectionValue:Y,shouldGoToNextSection:!1});break}}});Ft(()=>{$.syncSelectionToDOM()});const{hasValidationError:q}=ch({props:t,validator:m,timezone:T,value:x.value,onError:t.onError}),L=D.useMemo(()=>c!==void 0?c:q,[q,c]);D.useEffect(()=>{!L&&y==null&&F()},[x.referenceValue,y,L]),D.useEffect(()=>{x.tempValueStrAndroid!=null&&y!=null&&(F(),b())},[x.sections]),D.useImperativeHandle(n,()=>({getSections:()=>x.sections,getActiveSectionIndex:$.getActiveSectionIndexFromDOM,setSelectedSections:$.setSelectedSections,focusField:$.focusField,isFieldFocused:$.isFieldFocused}));const Q=he((U,...re)=>{U.preventDefault(),p==null||p(U,...re),M(),$.isFieldFocused()?S(R.startIndex):$.focusField(0)}),G={onKeyDown:J,onClear:Q,error:L,clearable:!!(u&&!j&&!a&&!o)},ne={disabled:o,readOnly:a};return _({},i.forwardedProps,G,ne,B)},HC=["clearable","onClear","InputProps","sx","slots","slotProps"],qC=["ownerState"],uh=i=>{const e=Qe(),{clearable:t,onClear:n,InputProps:r,sx:s,slots:o,slotProps:a}=i,l=me(i,HC),c=(o==null?void 0:o.clearButton)??zi,u=Pe({elementType:c,externalSlotProps:a==null?void 0:a.clearButton,ownerState:{},className:"clearButton",additionalProps:{title:e.fieldClearLabel}}),p=me(u,qC),d=(o==null?void 0:o.clearIcon)??z0,f=Pe({elementType:d,externalSlotProps:a==null?void 0:a.clearIcon,ownerState:{}});return _({},l,{InputProps:_({},r,{endAdornment:h.jsxs(D.Fragment,{children:[t&&h.jsx(jd,{position:"end",sx:{marginRight:r!=null&&r.endAdornment?-1:-1.5},children:h.jsx(c,_({},p,{onClick:n,children:h.jsx(d,_({fontSize:"small"},f))}))}),r==null?void 0:r.endAdornment]})}),sx:[{"& .clearButton":{opacity:1},"@media (pointer: fine)":{"& .clearButton":{opacity:0},"&:hover, &:focus-within":{".clearButton":{opacity:1}}}},...Array.isArray(s)?s:[s]]})},UC=["value","defaultValue","referenceDate","format","formatDensity","onChange","timezone","onError","shouldRespectLeadingZeros","selectedSections","onSelectedSectionsChange","unstableFieldRef","enableAccessibleFieldDOMStructure","disabled","readOnly","dateSeparator"],ph=(i,e)=>D.useMemo(()=>{const t=_({},i),n={},r=s=>{t.hasOwnProperty(s)&&(n[s]=t[s],delete t[s])};return UC.forEach(r),e==="date"?Co.forEach(r):e==="time"?_o.forEach(r):e==="date-time"&&(Co.forEach(r),_o.forEach(r),lh.forEach(r)),{forwardedProps:t,internalProps:n}},[i,e]),YC=D.createContext(null);function hh(i){const{contextValue:e,localeText:t,children:n}=i;return h.jsx(YC.Provider,{value:e,children:h.jsx(ll,{localeText:t,children:n})})}const GC=i=>{const e=Me(),t=Un();return _({},i,{disablePast:i.disablePast??!1,disableFuture:i.disableFuture??!1,format:i.format??e.formats.keyboardDate,minDate:wt(e,i.minDate,t.minDate),maxDate:wt(e,i.maxDate,t.maxDate)})},JC=i=>{const e=Me(),n=i.ampm??e.is12HourCycleInCurrentLocale()?e.formats.fullTime12h:e.formats.fullTime24h;return _({},i,{disablePast:i.disablePast??!1,disableFuture:i.disableFuture??!1,format:i.format??n})},KC=i=>{const e=GC(i),{forwardedProps:t,internalProps:n}=ph(e,"date");return dh({forwardedProps:t,internalProps:n,valueManager:Ue,fieldValueManager:rh,validator:Jn,valueType:"date"})};function XC(i){return Oe("MuiPickersTextField",i)}je("MuiPickersTextField",["root","focused","disabled","error","required"]);function ZC(i){return Oe("MuiPickersInputBase",i)}const Ri=je("MuiPickersInputBase",["root","focused","disabled","error","notchedOutline","sectionContent","sectionBefore","sectionAfter","adornedStart","adornedEnd","input"]);function QC(i){return Oe("MuiPickersSectionList",i)}const cn=je("MuiPickersSectionList",["root","section","sectionContent"]),e_=["slots","slotProps","elements","sectionListRef"],fh=ce("div",{name:"MuiPickersSectionList",slot:"Root",overridesResolver:(i,e)=>e.root})({direction:"ltr /*! @noflip */",outline:"none"}),mh=ce("span",{name:"MuiPickersSectionList",slot:"Section",overridesResolver:(i,e)=>e.section})({}),gh=ce("span",{name:"MuiPickersSectionList",slot:"SectionSeparator",overridesResolver:(i,e)=>e.sectionSeparator})({whiteSpace:"pre"}),vh=ce("span",{name:"MuiPickersSectionList",slot:"SectionContent",overridesResolver:(i,e)=>e.sectionContent})({outline:"none"}),t_=i=>{const{classes:e}=i;return Te({root:["root"],section:["section"],sectionContent:["sectionContent"]},QC,e)};function i_(i){const{slots:e,slotProps:t,element:n,classes:r}=i,s=(e==null?void 0:e.section)??mh,o=Pe({elementType:s,externalSlotProps:t==null?void 0:t.section,externalForwardedProps:n.container,className:r.section,ownerState:{}}),a=(e==null?void 0:e.sectionContent)??vh,l=Pe({elementType:a,externalSlotProps:t==null?void 0:t.sectionContent,externalForwardedProps:n.content,additionalProps:{suppressContentEditableWarning:!0},className:r.sectionContent,ownerState:{}}),c=(e==null?void 0:e.sectionSeparator)??gh,u=Pe({elementType:c,externalSlotProps:t==null?void 0:t.sectionSeparator,externalForwardedProps:n.before,ownerState:{position:"before"}}),p=Pe({elementType:c,externalSlotProps:t==null?void 0:t.sectionSeparator,externalForwardedProps:n.after,ownerState:{position:"after"}});return h.jsxs(s,_({},o,{children:[h.jsx(c,_({},u)),h.jsx(a,_({},l)),h.jsx(c,_({},p))]}))}const n_=D.forwardRef(function(e,t){const n=Ie({props:e,name:"MuiPickersSectionList"}),{slots:r,slotProps:s,elements:o,sectionListRef:a}=n,l=me(n,e_),c=t_(n),u=D.useRef(null),p=st(t,u),d=v=>{if(!u.current)throw new Error(`MUI X: Cannot call sectionListRef.${v} before the mount of the component.`);return u.current};D.useImperativeHandle(a,()=>({getRoot(){return d("getRoot")},getSectionContainer(v){return d("getSectionContainer").querySelector(`.${cn.section}[data-sectionindex="${v}"]`)},getSectionContent(v){return d("getSectionContent").querySelector(`.${cn.section}[data-sectionindex="${v}"] .${cn.sectionContent}`)},getSectionIndexFromDOMElement(v){const g=d("getSectionIndexFromDOMElement");if(v==null||!g.contains(v))return null;let x=null;return v.classList.contains(cn.section)?x=v:v.classList.contains(cn.sectionContent)&&(x=v.parentElement),x==null?null:Number(x.dataset.sectionindex)}}));const f=(r==null?void 0:r.root)??fh,m=Pe({elementType:f,externalSlotProps:s==null?void 0:s.root,externalForwardedProps:l,additionalProps:{ref:p,suppressContentEditableWarning:!0},className:c.root,ownerState:{}});return h.jsx(f,_({},m,{children:m.contentEditable?o.map(({content:v,before:g,after:x})=>`${g.children}${v.children}${x.children}`).join(""):h.jsx(D.Fragment,{children:o.map((v,g)=>h.jsx(i_,{slots:r,slotProps:s,element:v,classes:c},g))})}))}),r_=["elements","areAllSectionsEmpty","defaultValue","label","value","onChange","id","autoFocus","endAdornment","startAdornment","renderSuffix","slots","slotProps","contentEditable","tabIndex","onInput","onPaste","onKeyDown","fullWidth","name","readOnly","inputProps","inputRef","sectionListRef"],s_=i=>Math.round(i*1e5)/1e5,Ss=ce("div",{name:"MuiPickersInputBase",slot:"Root",overridesResolver:(i,e)=>e.root})(({theme:i})=>_({},i.typography.body1,{color:(i.vars||i).palette.text.primary,cursor:"text",padding:0,display:"flex",justifyContent:"flex-start",alignItems:"center",position:"relative",boxSizing:"border-box",letterSpacing:`${s_(.15/16)}em`,variants:[{props:{fullWidth:!0},style:{width:"100%"}}]})),yl=ce(fh,{name:"MuiPickersInputBase",slot:"SectionsContainer",overridesResolver:(i,e)=>e.sectionsContainer})(({theme:i})=>({padding:"4px 0 5px",fontFamily:i.typography.fontFamily,fontSize:"inherit",lineHeight:"1.4375em",flexGrow:1,outline:"none",display:"flex",flexWrap:"nowrap",overflow:"hidden",letterSpacing:"inherit",width:"182px",variants:[{props:{isRtl:!0},style:{textAlign:"right /*! @noflip */"}},{props:{size:"small"},style:{paddingTop:1}},{props:{adornedStart:!1,focused:!1,filled:!1},style:{color:"currentColor",opacity:0}},{props:({adornedStart:e,focused:t,filled:n,label:r})=>!e&&!t&&!n&&r==null,style:i.vars?{opacity:i.vars.opacity.inputPlaceholder}:{opacity:i.palette.mode==="light"?.42:.5}}]})),o_=ce(mh,{name:"MuiPickersInputBase",slot:"Section",overridesResolver:(i,e)=>e.section})(({theme:i})=>({fontFamily:i.typography.fontFamily,fontSize:"inherit",letterSpacing:"inherit",lineHeight:"1.4375em",display:"inline-block",whiteSpace:"nowrap"})),a_=ce(vh,{name:"MuiPickersInputBase",slot:"SectionContent",overridesResolver:(i,e)=>e.content})(({theme:i})=>({fontFamily:i.typography.fontFamily,lineHeight:"1.4375em",letterSpacing:"inherit",width:"fit-content",outline:"none"})),l_=ce(gh,{name:"MuiPickersInputBase",slot:"Separator",overridesResolver:(i,e)=>e.separator})(()=>({whiteSpace:"pre",letterSpacing:"inherit"})),c_=ce("input",{name:"MuiPickersInputBase",slot:"Input",overridesResolver:(i,e)=>e.hiddenInput})(_({},lf)),d_=i=>{const{focused:e,disabled:t,error:n,classes:r,fullWidth:s,readOnly:o,color:a,size:l,endAdornment:c,startAdornment:u}=i,p={root:["root",e&&!t&&"focused",t&&"disabled",o&&"readOnly",n&&"error",s&&"fullWidth",`color${nf(a)}`,l==="small"&&"inputSizeSmall",!!u&&"adornedStart",!!c&&"adornedEnd"],notchedOutline:["notchedOutline"],input:["input"],sectionsContainer:["sectionsContainer"],sectionContent:["sectionContent"],sectionBefore:["sectionBefore"],sectionAfter:["sectionAfter"]};return Te(p,ZC,r)},bl=D.forwardRef(function(e,t){const n=Ie({props:e,name:"MuiPickersInputBase"}),{elements:r,areAllSectionsEmpty:s,value:o,onChange:a,id:l,endAdornment:c,startAdornment:u,renderSuffix:p,slots:d,slotProps:f,contentEditable:m,tabIndex:v,onInput:g,onPaste:x,onKeyDown:y,name:w,readOnly:S,inputProps:M,inputRef:b,sectionListRef:I}=n,P=me(n,r_),E=D.useRef(null),A=st(t,E),T=st(M==null?void 0:M.ref,b),W=Tt(),F=Wr();if(!F)throw new Error("MUI X: PickersInputBase should always be used inside a PickersTextField component");const j=q=>{var L;if(F.disabled){q.stopPropagation();return}(L=F.onFocus)==null||L.call(F,q)};D.useEffect(()=>{F&&F.setAdornedStart(!!u)},[F,u]),D.useEffect(()=>{F&&(s?F.onEmpty():F.onFilled())},[F,s]);const O=_({},n,F,{isRtl:W}),R=d_(O),B=(d==null?void 0:d.root)||Ss,$=Pe({elementType:B,externalSlotProps:f==null?void 0:f.root,externalForwardedProps:P,additionalProps:{"aria-invalid":F.error,ref:A},className:R.root,ownerState:O}),J=(d==null?void 0:d.input)||yl;return h.jsxs(B,_({},$,{children:[u,h.jsx(n_,{sectionListRef:I,elements:r,contentEditable:m,tabIndex:v,className:R.sectionsContainer,onFocus:j,onBlur:F.onBlur,onInput:g,onPaste:x,onKeyDown:y,slots:{root:J,section:o_,sectionContent:a_,sectionSeparator:l_},slotProps:{root:{ownerState:O},sectionContent:{className:Ri.sectionContent},sectionSeparator:({position:q})=>({className:q==="before"?Ri.sectionBefore:Ri.sectionAfter})}}),c,p?p(_({},F)):null,h.jsx(c_,_({name:w,className:R.input,value:o,onChange:a,id:l,"aria-hidden":"true",tabIndex:-1,readOnly:S,required:F.required,disabled:F.disabled},M,{ref:T}))]}))});function u_(i){return Oe("MuiPickersOutlinedInput",i)}const Dt=_({},Ri,je("MuiPickersOutlinedInput",["root","notchedOutline","input"])),p_=["children","className","label","notched","shrink"],h_=ce("fieldset",{name:"MuiPickersOutlinedInput",slot:"NotchedOutline",overridesResolver:(i,e)=>e.notchedOutline})(({theme:i})=>{const e=i.palette.mode==="light"?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return{textAlign:"left",position:"absolute",bottom:0,right:0,top:-5,left:0,margin:0,padding:"0 8px",pointerEvents:"none",borderRadius:"inherit",borderStyle:"solid",borderWidth:1,overflow:"hidden",minWidth:"0%",borderColor:i.vars?`rgba(${i.vars.palette.common.onBackgroundChannel} / 0.23)`:e}}),Dd=ce("span")(({theme:i})=>({fontFamily:i.typography.fontFamily,fontSize:"inherit"})),f_=ce("legend")(({theme:i})=>({float:"unset",width:"auto",overflow:"hidden",variants:[{props:{withLabel:!1},style:{padding:0,lineHeight:"11px",transition:i.transitions.create("width",{duration:150,easing:i.transitions.easing.easeOut})}},{props:{withLabel:!0},style:{display:"block",padding:0,height:11,fontSize:"0.75em",visibility:"hidden",maxWidth:.01,transition:i.transitions.create("max-width",{duration:50,easing:i.transitions.easing.easeOut}),whiteSpace:"nowrap","& > span":{paddingLeft:5,paddingRight:5,display:"inline-block",opacity:0,visibility:"visible"}}},{props:{withLabel:!0,notched:!0},style:{maxWidth:"100%",transition:i.transitions.create("max-width",{duration:100,easing:i.transitions.easing.easeOut,delay:50})}}]}));function m_(i){const{className:e,label:t}=i,n=me(i,p_),r=t!=null&&t!=="",s=_({},i,{withLabel:r});return h.jsx(h_,_({"aria-hidden":!0,className:e},n,{ownerState:s,children:h.jsx(f_,{ownerState:s,children:r?h.jsx(Dd,{children:t}):h.jsx(Dd,{className:"notranslate",children:""})})}))}const g_=["label","autoFocus","ownerState","notched"],v_=ce(Ss,{name:"MuiPickersOutlinedInput",slot:"Root",overridesResolver:(i,e)=>e.root})(({theme:i})=>{const e=i.palette.mode==="light"?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return{padding:"0 14px",borderRadius:(i.vars||i).shape.borderRadius,[`&:hover .${Dt.notchedOutline}`]:{borderColor:(i.vars||i).palette.text.primary},"@media (hover: none)":{[`&:hover .${Dt.notchedOutline}`]:{borderColor:i.vars?`rgba(${i.vars.palette.common.onBackgroundChannel} / 0.23)`:e}},[`&.${Dt.focused} .${Dt.notchedOutline}`]:{borderStyle:"solid",borderWidth:2},[`&.${Dt.disabled}`]:{[`& .${Dt.notchedOutline}`]:{borderColor:(i.vars||i).palette.action.disabled},"*":{color:(i.vars||i).palette.action.disabled}},[`&.${Dt.error} .${Dt.notchedOutline}`]:{borderColor:(i.vars||i).palette.error.main},variants:Object.keys((i.vars??i).palette).filter(t=>{var n;return((n=(i.vars??i).palette[t])==null?void 0:n.main)??!1}).map(t=>({props:{color:t},style:{[`&.${Dt.focused}:not(.${Dt.error}) .${Dt.notchedOutline}`]:{borderColor:(i.vars||i).palette[t].main}}}))}}),x_=ce(yl,{name:"MuiPickersOutlinedInput",slot:"SectionsContainer",overridesResolver:(i,e)=>e.sectionsContainer})({padding:"16.5px 0",variants:[{props:{size:"small"},style:{padding:"8.5px 0"}}]}),y_=i=>{const{classes:e}=i,n=Te({root:["root"],notchedOutline:["notchedOutline"],input:["input"]},u_,e);return _({},e,n)},xh=D.forwardRef(function(e,t){const n=Ie({props:e,name:"MuiPickersOutlinedInput"}),{label:r,ownerState:s,notched:o}=n,a=me(n,g_),l=Wr(),c=_({},n,s,l,{color:(l==null?void 0:l.color)||"primary"}),u=y_(c);return h.jsx(bl,_({slots:{root:v_,input:x_},renderSuffix:p=>h.jsx(m_,{shrink:!!(o||p.adornedStart||p.focused||p.filled),notched:!!(o||p.adornedStart||p.focused||p.filled),className:u.notchedOutline,label:r!=null&&r!==""&&(l!=null&&l.required)?h.jsxs(D.Fragment,{children:[r," ","*"]}):r,ownerState:c})},a,{label:r,classes:u,ref:t}))});xh.muiName="Input";function b_(i){return Oe("MuiPickersFilledInput",i)}const li=_({},Ri,je("MuiPickersFilledInput",["root","underline","input"])),w_=["label","autoFocus","disableUnderline","ownerState"],D_=ce(Ss,{name:"MuiPickersFilledInput",slot:"Root",overridesResolver:(i,e)=>e.root,shouldForwardProp:i=>bt.shouldForwardProp(i)&&i!=="disableUnderline"})(({theme:i})=>{const e=i.palette.mode==="light",t=e?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)",n=e?"rgba(0, 0, 0, 0.06)":"rgba(255, 255, 255, 0.09)",r=e?"rgba(0, 0, 0, 0.09)":"rgba(255, 255, 255, 0.13)",s=e?"rgba(0, 0, 0, 0.12)":"rgba(255, 255, 255, 0.12)";return{backgroundColor:i.vars?i.vars.palette.FilledInput.bg:n,borderTopLeftRadius:(i.vars||i).shape.borderRadius,borderTopRightRadius:(i.vars||i).shape.borderRadius,transition:i.transitions.create("background-color",{duration:i.transitions.duration.shorter,easing:i.transitions.easing.easeOut}),"&:hover":{backgroundColor:i.vars?i.vars.palette.FilledInput.hoverBg:r,"@media (hover: none)":{backgroundColor:i.vars?i.vars.palette.FilledInput.bg:n}},[`&.${li.focused}`]:{backgroundColor:i.vars?i.vars.palette.FilledInput.bg:n},[`&.${li.disabled}`]:{backgroundColor:i.vars?i.vars.palette.FilledInput.disabledBg:s},variants:[...Object.keys((i.vars??i).palette).filter(o=>(i.vars??i).palette[o].main).map(o=>{var a;return{props:{color:o,disableUnderline:!1},style:{"&::after":{borderBottom:`2px solid ${(a=(i.vars||i).palette[o])==null?void 0:a.main}`}}}}),{props:{disableUnderline:!1},style:{"&::after":{left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:i.transitions.create("transform",{duration:i.transitions.duration.shorter,easing:i.transitions.easing.easeOut}),pointerEvents:"none"},[`&.${li.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${li.error}`]:{"&:before, &:after":{borderBottomColor:(i.vars||i).palette.error.main}},"&::before":{borderBottom:`1px solid ${i.vars?`rgba(${i.vars.palette.common.onBackgroundChannel} / ${i.vars.opacity.inputUnderline})`:t}`,left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:i.transitions.create("border-bottom-color",{duration:i.transitions.duration.shorter}),pointerEvents:"none"},[`&:hover:not(.${li.disabled}, .${li.error}):before`]:{borderBottom:`1px solid ${(i.vars||i).palette.text.primary}`},[`&.${li.disabled}:before`]:{borderBottomStyle:"dotted"}}},{props:({startAdornment:o})=>!!o,style:{paddingLeft:12}},{props:({endAdornment:o})=>!!o,style:{paddingRight:12}}]}}),S_=ce(yl,{name:"MuiPickersFilledInput",slot:"sectionsContainer",overridesResolver:(i,e)=>e.sectionsContainer})({paddingTop:25,paddingRight:12,paddingBottom:8,paddingLeft:12,variants:[{props:{size:"small"},style:{paddingTop:21,paddingBottom:4}},{props:({startAdornment:i})=>!!i,style:{paddingLeft:0}},{props:({endAdornment:i})=>!!i,style:{paddingRight:0}},{props:{hiddenLabel:!0},style:{paddingTop:16,paddingBottom:17}},{props:{hiddenLabel:!0,size:"small"},style:{paddingTop:8,paddingBottom:9}}]}),I_=i=>{const{classes:e,disableUnderline:t}=i,r=Te({root:["root",!t&&"underline"],input:["input"]},b_,e);return _({},e,r)},yh=D.forwardRef(function(e,t){const n=Ie({props:e,name:"MuiPickersFilledInput"}),{label:r,disableUnderline:s=!1,ownerState:o}=n,a=me(n,w_),l=Wr(),c=_({},n,o,l,{color:(l==null?void 0:l.color)||"primary"}),u=I_(c);return h.jsx(bl,_({slots:{root:D_,input:S_},slotProps:{root:{disableUnderline:s}}},a,{label:r,classes:u,ref:t}))});yh.muiName="Input";function C_(i){return Oe("MuiPickersFilledInput",i)}const dn=_({},Ri,je("MuiPickersInput",["root","input"])),__=["label","autoFocus","disableUnderline","ownerState"],M_=ce(Ss,{name:"MuiPickersInput",slot:"Root",overridesResolver:(i,e)=>e.root})(({theme:i})=>{let t=i.palette.mode==="light"?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)";return i.vars&&(t=`rgba(${i.vars.palette.common.onBackgroundChannel} / ${i.vars.opacity.inputUnderline})`),{"label + &":{marginTop:16},variants:[...Object.keys((i.vars??i).palette).filter(n=>(i.vars??i).palette[n].main).map(n=>({props:{color:n},style:{"&::after":{borderBottom:`2px solid ${(i.vars||i).palette[n].main}`}}})),{props:{disableUnderline:!1},style:{"&::after":{background:"red",left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:i.transitions.create("transform",{duration:i.transitions.duration.shorter,easing:i.transitions.easing.easeOut}),pointerEvents:"none"},[`&.${dn.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${dn.error}`]:{"&:before, &:after":{borderBottomColor:(i.vars||i).palette.error.main}},"&::before":{borderBottom:`1px solid ${t}`,left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:i.transitions.create("border-bottom-color",{duration:i.transitions.duration.shorter}),pointerEvents:"none"},[`&:hover:not(.${dn.disabled}, .${dn.error}):before`]:{borderBottom:`2px solid ${(i.vars||i).palette.text.primary}`,"@media (hover: none)":{borderBottom:`1px solid ${t}`}},[`&.${dn.disabled}:before`]:{borderBottomStyle:"dotted"}}}]}}),k_=i=>{const{classes:e,disableUnderline:t}=i,r=Te({root:["root",!t&&"underline"],input:["input"]},C_,e);return _({},e,r)},bh=D.forwardRef(function(e,t){const n=Ie({props:e,name:"MuiPickersInput"}),{label:r,disableUnderline:s=!1,ownerState:o}=n,a=me(n,__),l=Wr(),c=_({},n,o,l,{disableUnderline:s,color:(l==null?void 0:l.color)||"primary"}),u=k_(c);return h.jsx(bl,_({slots:{root:M_}},a,{label:r,classes:u,ref:t}))});bh.muiName="Input";const T_=["onFocus","onBlur","className","color","disabled","error","variant","required","InputProps","inputProps","inputRef","sectionListRef","elements","areAllSectionsEmpty","onClick","onKeyDown","onKeyUp","onPaste","onInput","endAdornment","startAdornment","tabIndex","contentEditable","focused","value","onChange","fullWidth","id","name","helperText","FormHelperTextProps","label","InputLabelProps"],P_={standard:bh,filled:yh,outlined:xh},O_=ce(uf,{name:"MuiPickersTextField",slot:"Root",overridesResolver:(i,e)=>e.root})({maxWidth:"100%"}),j_=i=>{const{focused:e,disabled:t,classes:n,required:r}=i;return Te({root:["root",e&&!t&&"focused",t&&"disabled",r&&"required"]},XC,n)},wh=D.forwardRef(function(e,t){const n=Ie({props:e,name:"MuiPickersTextField"}),{onFocus:r,onBlur:s,className:o,color:a="primary",disabled:l=!1,error:c=!1,variant:u="outlined",required:p=!1,InputProps:d,inputProps:f,inputRef:m,sectionListRef:v,elements:g,areAllSectionsEmpty:x,onClick:y,onKeyDown:w,onKeyUp:S,onPaste:M,onInput:b,endAdornment:I,startAdornment:P,tabIndex:E,contentEditable:A,focused:T,value:W,onChange:F,fullWidth:j,id:O,name:R,helperText:B,FormHelperTextProps:$,label:J,InputLabelProps:q}=n,L=me(n,T_),Q=D.useRef(null),G=st(t,Q),ne=Hi(O),U=B&&ne?`${ne}-helper-text`:void 0,re=J&&ne?`${ne}-label`:void 0,ie=_({},n,{color:a,disabled:l,error:c,focused:T,required:p,variant:u}),Y=j_(ie),K=P_[u];return h.jsxs(O_,_({className:Ee(Y.root,o),ref:G,focused:T,onFocus:r,onBlur:s,disabled:l,variant:u,error:c,color:a,fullWidth:j,required:p,ownerState:ie},L,{children:[h.jsx(cf,_({htmlFor:ne,id:re},q,{children:J})),h.jsx(K,_({elements:g,areAllSectionsEmpty:x,onClick:y,onKeyDown:w,onKeyUp:S,onInput:b,onPaste:M,endAdornment:I,startAdornment:P,tabIndex:E,contentEditable:A,value:W,onChange:F,id:ne,fullWidth:j,inputProps:f,inputRef:m,sectionListRef:v,label:J,name:R,role:"group","aria-labelledby":re,"aria-describedby":U,"aria-live":U?"polite":void 0},d)),B&&h.jsx(df,_({id:U},$,{children:B}))]}))}),E_=["enableAccessibleFieldDOMStructure"],R_=["InputProps","readOnly"],A_=["onPaste","onKeyDown","inputMode","readOnly","InputProps","inputProps","inputRef"],Dh=i=>{let{enableAccessibleFieldDOMStructure:e}=i,t=me(i,E_);if(e){const{InputProps:p,readOnly:d}=t,f=me(t,R_);return _({},f,{InputProps:_({},p??{},{readOnly:d})})}const{onPaste:n,onKeyDown:r,inputMode:s,readOnly:o,InputProps:a,inputProps:l,inputRef:c}=t,u=me(t,A_);return _({},u,{InputProps:_({},a??{},{readOnly:o}),inputProps:_({},l??{},{inputMode:s,onPaste:n,onKeyDown:r,ref:c})})},N_=["slots","slotProps","InputProps","inputProps"],Sh=D.forwardRef(function(e,t){const n=Ie({props:e,name:"MuiDateField"}),{slots:r,slotProps:s,InputProps:o,inputProps:a}=n,l=me(n,N_),c=n,u=(r==null?void 0:r.textField)??(e.enableAccessibleFieldDOMStructure?wh:Ed),p=Pe({elementType:u,externalSlotProps:s==null?void 0:s.textField,externalForwardedProps:l,additionalProps:{ref:t},ownerState:c});p.inputProps=_({},a,p.inputProps),p.InputProps=_({},o,p.InputProps);const d=KC(p),f=Dh(d),m=uh(_({},f,{slots:r,slotProps:s}));return h.jsx(u,_({},m))}),$_=i=>{const e=JC(i),{forwardedProps:t,internalProps:n}=ph(e,"time");return dh({forwardedProps:t,internalProps:n,valueManager:Ue,fieldValueManager:rh,validator:ws,valueType:"time"})},W_=["slots","slotProps","InputProps","inputProps"],Ih=D.forwardRef(function(e,t){const n=Ie({props:e,name:"MuiTimeField"}),{slots:r,slotProps:s,InputProps:o,inputProps:a}=n,l=me(n,W_),c=n,u=(r==null?void 0:r.textField)??(e.enableAccessibleFieldDOMStructure?wh:Ed),p=Pe({elementType:u,externalSlotProps:s==null?void 0:s.textField,externalForwardedProps:l,ownerState:c,additionalProps:{ref:t}});p.inputProps=_({},a,p.inputProps),p.InputProps=_({},o,p.InputProps);const d=$_(p),f=Dh(d),m=uh(_({},f,{slots:r,slotProps:s}));return h.jsx(u,_({},m))}),Ch=({shouldDisableDate:i,shouldDisableMonth:e,shouldDisableYear:t,minDate:n,maxDate:r,disableFuture:s,disablePast:o,timezone:a})=>{const l=wi();return D.useCallback(c=>Jn({adapter:l,value:c,timezone:a,props:{shouldDisableDate:i,shouldDisableMonth:e,shouldDisableYear:t,minDate:n,maxDate:r,disableFuture:s,disablePast:o}})!==null,[l,i,e,t,n,r,s,o,a])},F_=(i,e,t)=>(n,r)=>{switch(r.type){case"changeMonth":return _({},n,{slideDirection:r.direction,currentMonth:r.newMonth,isMonthSwitchingAnimating:!i});case"changeMonthTimezone":{const s=r.newTimezone;if(t.getTimezone(n.currentMonth)===s)return n;let o=t.setTimezone(n.currentMonth,s);return t.getMonth(o)!==t.getMonth(n.currentMonth)&&(o=t.setMonth(o,t.getMonth(n.currentMonth))),_({},n,{currentMonth:o})}case"finishMonthSwitchingAnimation":return _({},n,{isMonthSwitchingAnimating:!1});case"changeFocusedDay":{if(n.focusedDay!=null&&r.focusedDay!=null&&t.isSameDay(r.focusedDay,n.focusedDay))return n;const s=r.focusedDay!=null&&!e&&!t.isSameMonth(n.currentMonth,r.focusedDay);return _({},n,{focusedDay:r.focusedDay,isMonthSwitchingAnimating:s&&!i&&!r.withoutMonthSwitchingAnimation,currentMonth:s?t.startOfMonth(r.focusedDay):n.currentMonth,slideDirection:r.focusedDay!=null&&t.isAfterDay(r.focusedDay,n.currentMonth)?"left":"right"})}default:throw new Error("missing support")}},L_=i=>{const{value:e,referenceDate:t,disableFuture:n,disablePast:r,disableSwitchToMonthOnDayFocus:s=!1,maxDate:o,minDate:a,onMonthChange:l,reduceAnimations:c,shouldDisableDate:u,timezone:p}=i,d=Me(),f=D.useRef(F_(!!c,s,d)).current,m=D.useMemo(()=>Ue.getInitialReferenceValue({value:e,utils:d,timezone:p,props:i,referenceDate:t,granularity:It.day}),[t,p]),[v,g]=D.useReducer(f,{isMonthSwitchingAnimating:!1,focusedDay:m,currentMonth:d.startOfMonth(m),slideDirection:"left"});D.useEffect(()=>{g({type:"changeMonthTimezone",newTimezone:d.getTimezone(m)})},[m,d]);const x=D.useCallback(b=>{g(_({type:"changeMonth"},b)),l&&l(b.newMonth)},[l]),y=D.useCallback(b=>{const I=b;d.isSameMonth(I,v.currentMonth)||x({newMonth:d.startOfMonth(I),direction:d.isAfterDay(I,v.currentMonth)?"left":"right"})},[v.currentMonth,x,d]),w=Ch({shouldDisableDate:u,minDate:a,maxDate:o,disableFuture:n,disablePast:r,timezone:p}),S=D.useCallback(()=>{g({type:"finishMonthSwitchingAnimation"})},[]),M=he((b,I)=>{w(b)||g({type:"changeFocusedDay",focusedDay:b,withoutMonthSwitchingAnimation:I})});return{referenceDate:m,calendarState:v,changeMonth:y,changeFocusedDay:M,isDateDisabled:w,onMonthSwitchingAnimationEnd:S,handleChangeMonth:x}},B_=i=>Oe("MuiPickersFadeTransitionGroup",i);je("MuiPickersFadeTransitionGroup",["root"]);const V_=i=>{const{classes:e}=i;return Te({root:["root"]},B_,e)},z_=ce(Ad,{name:"MuiPickersFadeTransitionGroup",slot:"Root",overridesResolver:(i,e)=>e.root})({display:"block",position:"relative"});function _h(i){const e=Ie({props:i,name:"MuiPickersFadeTransitionGroup"}),{children:t,className:n,reduceAnimations:r,transKey:s}=e,o=V_(e),a=Rd();return r?t:h.jsx(z_,{className:Ee(o.root,n),children:h.jsx(Fr,{appear:!1,mountOnEnter:!0,unmountOnExit:!0,timeout:{appear:a.transitions.duration.enteringScreen,enter:a.transitions.duration.enteringScreen,exit:0},children:t},s)})}const H_=i=>Oe("MuiPickersSlideTransition",i),gt=je("MuiPickersSlideTransition",["root","slideEnter-left","slideEnter-right","slideEnterActive","slideExit","slideExitActiveLeft-left","slideExitActiveLeft-right"]),q_=["children","className","reduceAnimations","slideDirection","transKey","classes"],U_=i=>{const{classes:e,slideDirection:t}=i,n={root:["root"],exit:["slideExit"],enterActive:["slideEnterActive"],enter:[`slideEnter-${t}`],exitActive:[`slideExitActiveLeft-${t}`]};return Te(n,H_,e)},Y_=ce(Ad,{name:"MuiPickersSlideTransition",slot:"Root",overridesResolver:(i,e)=>[e.root,{[`.${gt["slideEnter-left"]}`]:e["slideEnter-left"]},{[`.${gt["slideEnter-right"]}`]:e["slideEnter-right"]},{[`.${gt.slideEnterActive}`]:e.slideEnterActive},{[`.${gt.slideExit}`]:e.slideExit},{[`.${gt["slideExitActiveLeft-left"]}`]:e["slideExitActiveLeft-left"]},{[`.${gt["slideExitActiveLeft-right"]}`]:e["slideExitActiveLeft-right"]}]})(({theme:i})=>{const e=i.transitions.create("transform",{duration:i.transitions.duration.complex,easing:"cubic-bezier(0.35, 0.8, 0.4, 1)"});return{display:"block",position:"relative",overflowX:"hidden","& > *":{position:"absolute",top:0,right:0,left:0},[`& .${gt["slideEnter-left"]}`]:{willChange:"transform",transform:"translate(100%)",zIndex:1},[`& .${gt["slideEnter-right"]}`]:{willChange:"transform",transform:"translate(-100%)",zIndex:1},[`& .${gt.slideEnterActive}`]:{transform:"translate(0%)",transition:e},[`& .${gt.slideExit}`]:{transform:"translate(0%)"},[`& .${gt["slideExitActiveLeft-left"]}`]:{willChange:"transform",transform:"translate(-100%)",transition:e,zIndex:0},[`& .${gt["slideExitActiveLeft-right"]}`]:{willChange:"transform",transform:"translate(100%)",transition:e,zIndex:0}}});function G_(i){const e=Ie({props:i,name:"MuiPickersSlideTransition"}),{children:t,className:n,reduceAnimations:r,transKey:s}=e,o=me(e,q_),a=U_(e),l=Rd();if(r)return h.jsx("div",{className:Ee(a.root,n),children:t});const c={exit:a.exit,enterActive:a.enterActive,enter:a.enter,exitActive:a.exitActive};return h.jsx(Y_,{className:Ee(a.root,n),childFactory:u=>D.cloneElement(u,{classNames:c}),role:"presentation",children:h.jsx(cl,_({mountOnEnter:!0,unmountOnExit:!0,timeout:l.transitions.duration.complex,classNames:c},o,{children:t}),s)})}const J_=i=>Oe("MuiDayCalendar",i);je("MuiDayCalendar",["root","header","weekDayLabel","loadingContainer","slideTransition","monthContainer","weekContainer","weekNumberLabel","weekNumber"]);const K_=["parentProps","day","focusableDay","selectedDays","isDateDisabled","currentMonthNumber","isViewFocused"],X_=["ownerState"],Z_=i=>{const{classes:e}=i;return Te({root:["root"],header:["header"],weekDayLabel:["weekDayLabel"],loadingContainer:["loadingContainer"],slideTransition:["slideTransition"],monthContainer:["monthContainer"],weekContainer:["weekContainer"],weekNumberLabel:["weekNumberLabel"],weekNumber:["weekNumber"]},J_,e)},Mh=(En+vs*2)*6,Q_=ce("div",{name:"MuiDayCalendar",slot:"Root",overridesResolver:(i,e)=>e.root})({}),eM=ce("div",{name:"MuiDayCalendar",slot:"Header",overridesResolver:(i,e)=>e.header})({display:"flex",justifyContent:"center",alignItems:"center"}),tM=ce(Kt,{name:"MuiDayCalendar",slot:"WeekDayLabel",overridesResolver:(i,e)=>e.weekDayLabel})(({theme:i})=>({width:36,height:40,margin:"0 2px",textAlign:"center",display:"flex",justifyContent:"center",alignItems:"center",color:(i.vars||i).palette.text.secondary})),iM=ce(Kt,{name:"MuiDayCalendar",slot:"WeekNumberLabel",overridesResolver:(i,e)=>e.weekNumberLabel})(({theme:i})=>({width:36,height:40,margin:"0 2px",textAlign:"center",display:"flex",justifyContent:"center",alignItems:"center",color:i.palette.text.disabled})),nM=ce(Kt,{name:"MuiDayCalendar",slot:"WeekNumber",overridesResolver:(i,e)=>e.weekNumber})(({theme:i})=>_({},i.typography.caption,{width:En,height:En,padding:0,margin:`0 ${vs}px`,color:i.palette.text.disabled,fontSize:"0.75rem",alignItems:"center",justifyContent:"center",display:"inline-flex"})),rM=ce("div",{name:"MuiDayCalendar",slot:"LoadingContainer",overridesResolver:(i,e)=>e.loadingContainer})({display:"flex",justifyContent:"center",alignItems:"center",minHeight:Mh}),sM=ce(G_,{name:"MuiDayCalendar",slot:"SlideTransition",overridesResolver:(i,e)=>e.slideTransition})({minHeight:Mh}),oM=ce("div",{name:"MuiDayCalendar",slot:"MonthContainer",overridesResolver:(i,e)=>e.monthContainer})({overflow:"hidden"}),aM=ce("div",{name:"MuiDayCalendar",slot:"WeekContainer",overridesResolver:(i,e)=>e.weekContainer})({margin:`${vs}px 0`,display:"flex",justifyContent:"center"});function lM(i){let{parentProps:e,day:t,focusableDay:n,selectedDays:r,isDateDisabled:s,currentMonthNumber:o,isViewFocused:a}=i,l=me(i,K_);const{disabled:c,disableHighlightToday:u,isMonthSwitchingAnimating:p,showDaysOutsideCurrentMonth:d,slots:f,slotProps:m,timezone:v}=e,g=Me(),x=Di(v),y=n!==null&&g.isSameDay(t,n),w=r.some(W=>g.isSameDay(W,t)),S=g.isSameDay(t,x),M=(f==null?void 0:f.day)??PC,b=Pe({elementType:M,externalSlotProps:m==null?void 0:m.day,additionalProps:_({disableHighlightToday:u,showDaysOutsideCurrentMonth:d,role:"gridcell",isAnimating:p,"data-timestamp":g.toJsDate(t).valueOf()},l),ownerState:_({},e,{day:t,selected:w})}),I=me(b,X_),P=D.useMemo(()=>c||s(t),[c,s,t]),E=D.useMemo(()=>g.getMonth(t)!==o,[g,t,o]),A=D.useMemo(()=>{const W=g.startOfMonth(g.setMonth(t,o));return d?g.isSameDay(t,g.startOfWeek(W)):g.isSameDay(t,W)},[o,t,d,g]),T=D.useMemo(()=>{const W=g.endOfMonth(g.setMonth(t,o));return d?g.isSameDay(t,g.endOfWeek(W)):g.isSameDay(t,W)},[o,t,d,g]);return h.jsx(M,_({},I,{day:t,disabled:P,autoFocus:a&&y,today:S,outsideCurrentMonth:E,isFirstVisibleCell:A,isLastVisibleCell:T,selected:w,tabIndex:y?0:-1,"aria-selected":w,"aria-current":S?"date":void 0}))}function cM(i){const e=Ie({props:i,name:"MuiDayCalendar"}),t=Me(),{onFocusedDayChange:n,className:r,currentMonth:s,selectedDays:o,focusedDay:a,loading:l,onSelectedDaysChange:c,onMonthSwitchingAnimationEnd:u,readOnly:p,reduceAnimations:d,renderLoading:f=()=>h.jsx("span",{children:"..."}),slideDirection:m,TransitionProps:v,disablePast:g,disableFuture:x,minDate:y,maxDate:w,shouldDisableDate:S,shouldDisableMonth:M,shouldDisableYear:b,dayOfWeekFormatter:I=X=>t.format(X,"weekdayShort").charAt(0).toUpperCase(),hasFocus:P,onFocusedViewChange:E,gridLabelId:A,displayWeekNumber:T,fixedWeekNumber:W,autoFocus:F,timezone:j}=e,O=Di(j),R=Z_(e),B=Tt(),$=Ch({shouldDisableDate:S,shouldDisableMonth:M,shouldDisableYear:b,minDate:y,maxDate:w,disablePast:g,disableFuture:x,timezone:j}),J=Qe(),[q,L]=fi({name:"DayCalendar",state:"hasFocus",controlled:P,default:F??!1}),[Q,G]=D.useState(()=>a||O),ne=he(X=>{p||c(X)}),U=X=>{$(X)||(n(X),G(X),E==null||E(!0),L(!0))},re=he((X,H)=>{switch(X.key){case"ArrowUp":U(t.addDays(H,-7)),X.preventDefault();break;case"ArrowDown":U(t.addDays(H,7)),X.preventDefault();break;case"ArrowLeft":{const ee=t.addDays(H,B?1:-1),te=t.addMonths(H,B?1:-1),de=vn({utils:t,date:ee,minDate:B?ee:t.startOfMonth(te),maxDate:B?t.endOfMonth(te):ee,isDateDisabled:$,timezone:j});U(de||ee),X.preventDefault();break}case"ArrowRight":{const ee=t.addDays(H,B?-1:1),te=t.addMonths(H,B?-1:1),de=vn({utils:t,date:ee,minDate:B?t.startOfMonth(te):ee,maxDate:B?ee:t.endOfMonth(te),isDateDisabled:$,timezone:j});U(de||ee),X.preventDefault();break}case"Home":U(t.startOfWeek(H)),X.preventDefault();break;case"End":U(t.endOfWeek(H)),X.preventDefault();break;case"PageUp":U(t.addMonths(H,1)),X.preventDefault();break;case"PageDown":U(t.addMonths(H,-1)),X.preventDefault();break}}),ie=he((X,H)=>U(H)),Y=he((X,H)=>{q&&t.isSameDay(Q,H)&&(E==null||E(!1))}),K=t.getMonth(s),se=t.getYear(s),ae=D.useMemo(()=>o.filter(X=>!!X).map(X=>t.startOfDay(X)),[t,o]),oe=`${se}-${K}`,V=D.useMemo(()=>D.createRef(),[oe]),z=D.useMemo(()=>{const X=t.startOfMonth(s),H=t.endOfMonth(s);return $(Q)||t.isAfterDay(Q,H)||t.isBeforeDay(Q,X)?vn({utils:t,date:Q,minDate:X,maxDate:H,disablePast:g,disableFuture:x,isDateDisabled:$,timezone:j}):Q},[s,x,g,Q,$,t,j]),Z=D.useMemo(()=>{const X=t.getWeekArray(s);let H=t.addMonths(s,1);for(;W&&X.length<W;){const ee=t.getWeekArray(H),te=t.isSameDay(X[X.length-1][0],ee[0][0]);ee.slice(te?1:0).forEach(de=>{X.length<W&&X.push(de)}),H=t.addMonths(H,1)}return X},[s,W,t]);return h.jsxs(Q_,{role:"grid","aria-labelledby":A,className:R.root,children:[h.jsxs(eM,{role:"row",className:R.header,children:[T&&h.jsx(iM,{variant:"caption",role:"columnheader","aria-label":J.calendarWeekNumberHeaderLabel,className:R.weekNumberLabel,children:J.calendarWeekNumberHeaderText}),bI(t,O).map((X,H)=>h.jsx(tM,{variant:"caption",role:"columnheader","aria-label":t.format(X,"weekday"),className:R.weekDayLabel,children:I(X)},H.toString()))]}),l?h.jsx(rM,{className:R.loadingContainer,children:f()}):h.jsx(sM,_({transKey:oe,onExited:u,reduceAnimations:d,slideDirection:m,className:Ee(r,R.slideTransition)},v,{nodeRef:V,children:h.jsx(oM,{ref:V,role:"rowgroup",className:R.monthContainer,children:Z.map((X,H)=>h.jsxs(aM,{role:"row",className:R.weekContainer,"aria-rowindex":H+1,children:[T&&h.jsx(nM,{className:R.weekNumber,role:"rowheader","aria-label":J.calendarWeekNumberAriaLabelText(t.getWeekNumber(X[0])),children:J.calendarWeekNumberText(t.getWeekNumber(X[0]))}),X.map((ee,te)=>h.jsx(lM,{parentProps:e,day:ee,selectedDays:ae,focusableDay:z,onKeyDown:re,onFocus:ie,onBlur:Y,onDaySelect:ne,isDateDisabled:$,currentMonthNumber:K,isViewFocused:q,"aria-colindex":te+1},ee.toString()))]},`week-${X[0]}`))})}))]})}function dM(i){return Oe("MuiPickersMonth",i)}const cr=je("MuiPickersMonth",["root","monthButton","disabled","selected"]),uM=["autoFocus","className","children","disabled","selected","value","tabIndex","onClick","onKeyDown","onFocus","onBlur","aria-current","aria-label","monthsPerRow","slots","slotProps"],pM=i=>{const{disabled:e,selected:t,classes:n}=i;return Te({root:["root"],monthButton:["monthButton",e&&"disabled",t&&"selected"]},dM,n)},hM=ce("div",{name:"MuiPickersMonth",slot:"Root",overridesResolver:(i,e)=>[e.root]})({display:"flex",alignItems:"center",justifyContent:"center",flexBasis:"33.3%",variants:[{props:{monthsPerRow:4},style:{flexBasis:"25%"}}]}),fM=ce("button",{name:"MuiPickersMonth",slot:"MonthButton",overridesResolver:(i,e)=>[e.monthButton,{[`&.${cr.disabled}`]:e.disabled},{[`&.${cr.selected}`]:e.selected}]})(({theme:i})=>_({color:"unset",backgroundColor:"transparent",border:0,outline:0},i.typography.subtitle1,{margin:"8px 0",height:36,width:72,borderRadius:18,cursor:"pointer","&:focus":{backgroundColor:i.vars?`rgba(${i.vars.palette.action.activeChannel} / ${i.vars.palette.action.hoverOpacity})`:bt.alpha(i.palette.action.active,i.palette.action.hoverOpacity)},"&:hover":{backgroundColor:i.vars?`rgba(${i.vars.palette.action.activeChannel} / ${i.vars.palette.action.hoverOpacity})`:bt.alpha(i.palette.action.active,i.palette.action.hoverOpacity)},"&:disabled":{cursor:"auto",pointerEvents:"none"},[`&.${cr.disabled}`]:{color:(i.vars||i).palette.text.secondary},[`&.${cr.selected}`]:{color:(i.vars||i).palette.primary.contrastText,backgroundColor:(i.vars||i).palette.primary.main,"&:focus, &:hover":{backgroundColor:(i.vars||i).palette.primary.dark}}})),mM=D.memo(function(e){const t=Ie({props:e,name:"MuiPickersMonth"}),{autoFocus:n,className:r,children:s,disabled:o,selected:a,value:l,tabIndex:c,onClick:u,onKeyDown:p,onFocus:d,onBlur:f,"aria-current":m,"aria-label":v,slots:g,slotProps:x}=t,y=me(t,uM),w=D.useRef(null),S=pM(t);Ft(()=>{var I;n&&((I=w.current)==null||I.focus())},[n]);const M=(g==null?void 0:g.monthButton)??fM,b=Pe({elementType:M,externalSlotProps:x==null?void 0:x.monthButton,additionalProps:{children:s,disabled:o,tabIndex:c,ref:w,type:"button",role:"radio","aria-current":m,"aria-checked":a,"aria-label":v,onClick:I=>u(I,l),onKeyDown:I=>p(I,l),onFocus:I=>d(I,l),onBlur:I=>f(I,l)},ownerState:t,className:S.monthButton});return h.jsx(hM,_({className:Ee(S.root,r),ownerState:t},y,{children:h.jsx(M,_({},b))}))});function gM(i){return Oe("MuiMonthCalendar",i)}je("MuiMonthCalendar",["root"]);const vM=["className","value","defaultValue","referenceDate","disabled","disableFuture","disablePast","maxDate","minDate","onChange","shouldDisableMonth","readOnly","disableHighlightToday","autoFocus","onMonthFocus","hasFocus","onFocusedViewChange","monthsPerRow","timezone","gridLabelId","slots","slotProps"],xM=i=>{const{classes:e}=i;return Te({root:["root"]},gM,e)};function yM(i,e){const t=Me(),n=Un(),r=Ie({props:i,name:e});return _({disableFuture:!1,disablePast:!1},r,{minDate:wt(t,r.minDate,n.minDate),maxDate:wt(t,r.maxDate,n.maxDate)})}const bM=ce("div",{name:"MuiMonthCalendar",slot:"Root",overridesResolver:(i,e)=>e.root})({display:"flex",flexWrap:"wrap",alignContent:"stretch",padding:"0 4px",width:xs,boxSizing:"border-box"}),wM=D.forwardRef(function(e,t){const n=yM(e,"MuiMonthCalendar"),{className:r,value:s,defaultValue:o,referenceDate:a,disabled:l,disableFuture:c,disablePast:u,maxDate:p,minDate:d,onChange:f,shouldDisableMonth:m,readOnly:v,autoFocus:g=!1,onMonthFocus:x,hasFocus:y,onFocusedViewChange:w,monthsPerRow:S=3,timezone:M,gridLabelId:b,slots:I,slotProps:P}=n,E=me(n,vM),{value:A,handleValueChange:T,timezone:W}=Ki({name:"MonthCalendar",timezone:M,value:s,defaultValue:o,referenceDate:a,onChange:f,valueManager:Ue}),F=Di(W),j=Tt(),O=Me(),R=D.useMemo(()=>Ue.getInitialReferenceValue({value:A,utils:O,props:n,timezone:W,referenceDate:a,granularity:It.month}),[]),B=n,$=xM(B),J=D.useMemo(()=>O.getMonth(F),[O,F]),q=D.useMemo(()=>A!=null?O.getMonth(A):null,[A,O]),[L,Q]=D.useState(()=>q||O.getMonth(R)),[G,ne]=fi({name:"MonthCalendar",state:"hasFocus",controlled:y,default:g??!1}),U=he(oe=>{ne(oe),w&&w(oe)}),re=D.useCallback(oe=>{const V=O.startOfMonth(u&&O.isAfter(F,d)?F:d),z=O.startOfMonth(c&&O.isBefore(F,p)?F:p),Z=O.startOfMonth(oe);return O.isBefore(Z,V)||O.isAfter(Z,z)?!0:m?m(Z):!1},[c,u,p,d,F,m,O]),ie=he((oe,V)=>{if(v)return;const z=O.setMonth(A??R,V);T(z)}),Y=he(oe=>{re(O.setMonth(A??R,oe))||(Q(oe),U(!0),x&&x(oe))});D.useEffect(()=>{Q(oe=>q!==null&&oe!==q?q:oe)},[q]);const K=he((oe,V)=>{switch(oe.key){case"ArrowUp":Y((12+V-3)%12),oe.preventDefault();break;case"ArrowDown":Y((12+V+3)%12),oe.preventDefault();break;case"ArrowLeft":Y((12+V+(j?1:-1))%12),oe.preventDefault();break;case"ArrowRight":Y((12+V+(j?-1:1))%12),oe.preventDefault();break}}),se=he((oe,V)=>{Y(V)}),ae=he((oe,V)=>{L===V&&U(!1)});return h.jsx(bM,_({ref:t,className:Ee($.root,r),ownerState:B,role:"radiogroup","aria-labelledby":b},E,{children:pl(O,A??R).map(oe=>{const V=O.getMonth(oe),z=O.format(oe,"monthShort"),Z=O.format(oe,"month"),X=V===q,H=l||re(oe);return h.jsx(mM,{selected:X,value:V,onClick:ie,onKeyDown:K,autoFocus:G&&V===L,disabled:H,tabIndex:V===L&&!H?0:-1,onFocus:se,onBlur:ae,"aria-current":J===V?"date":void 0,"aria-label":Z,monthsPerRow:S,slots:I,slotProps:P,children:z},z)})}))});function DM(i){return Oe("MuiPickersYear",i)}const dr=je("MuiPickersYear",["root","yearButton","selected","disabled"]),SM=["autoFocus","className","children","disabled","selected","value","tabIndex","onClick","onKeyDown","onFocus","onBlur","aria-current","yearsPerRow","slots","slotProps"],IM=i=>{const{disabled:e,selected:t,classes:n}=i;return Te({root:["root"],yearButton:["yearButton",e&&"disabled",t&&"selected"]},DM,n)},CM=ce("div",{name:"MuiPickersYear",slot:"Root",overridesResolver:(i,e)=>[e.root]})({display:"flex",alignItems:"center",justifyContent:"center",flexBasis:"33.3%",variants:[{props:{yearsPerRow:4},style:{flexBasis:"25%"}}]}),_M=ce("button",{name:"MuiPickersYear",slot:"YearButton",overridesResolver:(i,e)=>[e.yearButton,{[`&.${dr.disabled}`]:e.disabled},{[`&.${dr.selected}`]:e.selected}]})(({theme:i})=>_({color:"unset",backgroundColor:"transparent",border:0,outline:0},i.typography.subtitle1,{margin:"6px 0",height:36,width:72,borderRadius:18,cursor:"pointer","&:focus":{backgroundColor:i.vars?`rgba(${i.vars.palette.action.activeChannel} / ${i.vars.palette.action.focusOpacity})`:bt.alpha(i.palette.action.active,i.palette.action.focusOpacity)},"&:hover":{backgroundColor:i.vars?`rgba(${i.vars.palette.action.activeChannel} / ${i.vars.palette.action.hoverOpacity})`:bt.alpha(i.palette.action.active,i.palette.action.hoverOpacity)},"&:disabled":{cursor:"auto",pointerEvents:"none"},[`&.${dr.disabled}`]:{color:(i.vars||i).palette.text.secondary},[`&.${dr.selected}`]:{color:(i.vars||i).palette.primary.contrastText,backgroundColor:(i.vars||i).palette.primary.main,"&:focus, &:hover":{backgroundColor:(i.vars||i).palette.primary.dark}}})),MM=D.memo(function(e){const t=Ie({props:e,name:"MuiPickersYear"}),{autoFocus:n,className:r,children:s,disabled:o,selected:a,value:l,tabIndex:c,onClick:u,onKeyDown:p,onFocus:d,onBlur:f,"aria-current":m,slots:v,slotProps:g}=t,x=me(t,SM),y=D.useRef(null),w=IM(t);Ft(()=>{var b;n&&((b=y.current)==null||b.focus())},[n]);const S=(v==null?void 0:v.yearButton)??_M,M=Pe({elementType:S,externalSlotProps:g==null?void 0:g.yearButton,additionalProps:{children:s,disabled:o,tabIndex:c,ref:y,type:"button",role:"radio","aria-current":m,"aria-checked":a,onClick:b=>u(b,l),onKeyDown:b=>p(b,l),onFocus:b=>d(b,l),onBlur:b=>f(b,l)},ownerState:t,className:w.yearButton});return h.jsx(CM,_({className:Ee(w.root,r),ownerState:t},x,{children:h.jsx(S,_({},M))}))});function kM(i){return Oe("MuiYearCalendar",i)}je("MuiYearCalendar",["root"]);const TM=["autoFocus","className","value","defaultValue","referenceDate","disabled","disableFuture","disablePast","maxDate","minDate","onChange","readOnly","shouldDisableYear","disableHighlightToday","onYearFocus","hasFocus","onFocusedViewChange","yearsOrder","yearsPerRow","timezone","gridLabelId","slots","slotProps"],PM=i=>{const{classes:e}=i;return Te({root:["root"]},kM,e)};function OM(i,e){const t=Me(),n=Un(),r=Ie({props:i,name:e});return _({disablePast:!1,disableFuture:!1},r,{yearsPerRow:r.yearsPerRow??3,minDate:wt(t,r.minDate,n.minDate),maxDate:wt(t,r.maxDate,n.maxDate)})}const jM=ce("div",{name:"MuiYearCalendar",slot:"Root",overridesResolver:(i,e)=>e.root})({display:"flex",flexDirection:"row",flexWrap:"wrap",overflowY:"auto",height:"100%",padding:"0 4px",width:xs,maxHeight:iI,boxSizing:"border-box",position:"relative"}),EM=D.forwardRef(function(e,t){const n=OM(e,"MuiYearCalendar"),{autoFocus:r,className:s,value:o,defaultValue:a,referenceDate:l,disabled:c,disableFuture:u,disablePast:p,maxDate:d,minDate:f,onChange:m,readOnly:v,shouldDisableYear:g,onYearFocus:x,hasFocus:y,onFocusedViewChange:w,yearsOrder:S="asc",yearsPerRow:M,timezone:b,gridLabelId:I,slots:P,slotProps:E}=n,A=me(n,TM),{value:T,handleValueChange:W,timezone:F}=Ki({name:"YearCalendar",timezone:b,value:o,defaultValue:a,referenceDate:l,onChange:m,valueManager:Ue}),j=Di(F),O=Tt(),R=Me(),B=D.useMemo(()=>Ue.getInitialReferenceValue({value:T,utils:R,props:n,timezone:F,referenceDate:l,granularity:It.year}),[]),$=n,J=PM($),q=D.useMemo(()=>R.getYear(j),[R,j]),L=D.useMemo(()=>T!=null?R.getYear(T):null,[T,R]),[Q,G]=D.useState(()=>L||R.getYear(B)),[ne,U]=fi({name:"YearCalendar",state:"hasFocus",controlled:y,default:r??!1}),re=he(ee=>{U(ee),w&&w(ee)}),ie=D.useCallback(ee=>{if(p&&R.isBeforeYear(ee,j)||u&&R.isAfterYear(ee,j)||f&&R.isBeforeYear(ee,f)||d&&R.isAfterYear(ee,d))return!0;if(!g)return!1;const te=R.startOfYear(ee);return g(te)},[u,p,d,f,j,g,R]),Y=he((ee,te)=>{if(v)return;const de=R.setYear(T??B,te);W(de)}),K=he(ee=>{ie(R.setYear(T??B,ee))||(G(ee),re(!0),x==null||x(ee))});D.useEffect(()=>{G(ee=>L!==null&&ee!==L?L:ee)},[L]);const se=S!=="desc"?M*1:M*-1,ae=O&&S==="asc"||!O&&S==="desc"?-1:1,oe=he((ee,te)=>{switch(ee.key){case"ArrowUp":K(te-se),ee.preventDefault();break;case"ArrowDown":K(te+se),ee.preventDefault();break;case"ArrowLeft":K(te-ae),ee.preventDefault();break;case"ArrowRight":K(te+ae),ee.preventDefault();break}}),V=he((ee,te)=>{K(te)}),z=he((ee,te)=>{Q===te&&re(!1)}),Z=D.useRef(null),X=st(t,Z);D.useEffect(()=>{if(r||Z.current===null)return;const ee=Z.current.querySelector('[tabindex="0"]');if(!ee)return;const te=ee.offsetHeight,de=ee.offsetTop,ye=Z.current.clientHeight,Le=Z.current.scrollTop,nt=de+te;te>ye||de<Le||(Z.current.scrollTop=nt-ye/2-te/2)},[r]);const H=R.getYearRange([f,d]);return S==="desc"&&H.reverse(),h.jsx(jM,_({ref:X,className:Ee(J.root,s),ownerState:$,role:"radiogroup","aria-labelledby":I},A,{children:H.map(ee=>{const te=R.getYear(ee),de=te===L,ye=c||ie(ee);return h.jsx(MM,{selected:de,value:te,onClick:Y,onKeyDown:oe,autoFocus:ne&&te===Q,disabled:ye,tabIndex:te===Q&&!ye?0:-1,onFocus:V,onBlur:z,"aria-current":q===te?"date":void 0,yearsPerRow:M,slots:P,slotProps:E,children:R.format(ee,"year")},R.format(ee,"year"))})}))}),RM=i=>Oe("MuiPickersCalendarHeader",i),AM=je("MuiPickersCalendarHeader",["root","labelContainer","label","switchViewButton","switchViewIcon"]),NM=["slots","slotProps","currentMonth","disabled","disableFuture","disablePast","maxDate","minDate","onMonthChange","onViewChange","view","reduceAnimations","views","labelId","className","timezone","format"],$M=["ownerState"],WM=i=>{const{classes:e}=i;return Te({root:["root"],labelContainer:["labelContainer"],label:["label"],switchViewButton:["switchViewButton"],switchViewIcon:["switchViewIcon"]},RM,e)},FM=ce("div",{name:"MuiPickersCalendarHeader",slot:"Root",overridesResolver:(i,e)=>e.root})({display:"flex",alignItems:"center",marginTop:12,marginBottom:4,paddingLeft:24,paddingRight:12,maxHeight:40,minHeight:40}),LM=ce("div",{name:"MuiPickersCalendarHeader",slot:"LabelContainer",overridesResolver:(i,e)=>e.labelContainer})(({theme:i})=>_({display:"flex",overflow:"hidden",alignItems:"center",cursor:"pointer",marginRight:"auto"},i.typography.body1,{fontWeight:i.typography.fontWeightMedium})),BM=ce("div",{name:"MuiPickersCalendarHeader",slot:"Label",overridesResolver:(i,e)=>e.label})({marginRight:6}),VM=ce(zi,{name:"MuiPickersCalendarHeader",slot:"SwitchViewButton",overridesResolver:(i,e)=>e.switchViewButton})({marginRight:"auto",variants:[{props:{view:"year"},style:{[`.${AM.switchViewIcon}`]:{transform:"rotate(180deg)"}}}]}),zM=ce(W0,{name:"MuiPickersCalendarHeader",slot:"SwitchViewIcon",overridesResolver:(i,e)=>e.switchViewIcon})(({theme:i})=>({willChange:"transform",transition:i.transitions.create("transform"),transform:"rotate(0deg)"})),HM=D.forwardRef(function(e,t){const n=Qe(),r=Me(),s=Ie({props:e,name:"MuiPickersCalendarHeader"}),{slots:o,slotProps:a,currentMonth:l,disabled:c,disableFuture:u,disablePast:p,maxDate:d,minDate:f,onMonthChange:m,onViewChange:v,view:g,reduceAnimations:x,views:y,labelId:w,className:S,timezone:M,format:b=`${r.formats.month} ${r.formats.year}`}=s,I=me(s,NM),P=s,E=WM(s),A=(o==null?void 0:o.switchViewButton)??VM,T=Pe({elementType:A,externalSlotProps:a==null?void 0:a.switchViewButton,additionalProps:{size:"small","aria-label":n.calendarViewSwitchingButtonAriaLabel(g)},ownerState:P,className:E.switchViewButton}),W=(o==null?void 0:o.switchViewIcon)??zM,F=Pe({elementType:W,externalSlotProps:a==null?void 0:a.switchViewIcon,ownerState:P,className:E.switchViewIcon}),j=me(F,$M),O=()=>m(r.addMonths(l,1),"left"),R=()=>m(r.addMonths(l,-1),"right"),B=eI(l,{disableFuture:u,maxDate:d,timezone:M}),$=tI(l,{disablePast:p,minDate:f,timezone:M}),J=()=>{if(!(y.length===1||!v||c))if(y.length===2)v(y.find(L=>L!==g)||y[0]);else{const L=y.indexOf(g)!==0?0:1;v(y[L])}};if(y.length===1&&y[0]==="year")return null;const q=r.formatByString(l,b);return h.jsxs(FM,_({},I,{ownerState:P,className:Ee(E.root,S),ref:t,children:[h.jsxs(LM,{role:"presentation",onClick:J,ownerState:P,"aria-live":"polite",className:E.labelContainer,children:[h.jsx(_h,{reduceAnimations:x,transKey:q,children:h.jsx(BM,{id:w,ownerState:P,className:E.label,children:q})}),y.length>1&&!c&&h.jsx(A,_({},T,{children:h.jsx(W,_({},j))}))]}),h.jsx(Fr,{in:g==="day",appear:!x,enter:!x,children:h.jsx(Hp,{slots:o,slotProps:a,onGoToPrevious:R,isPreviousDisabled:$,previousLabel:n.previousMonth,onGoToNext:O,isNextDisabled:B,nextLabel:n.nextMonth})})]}))}),qM="@media (prefers-reduced-motion: reduce)",Ai=typeof navigator<"u"&&navigator.userAgent.match(/android\s(\d+)|OS\s(\d+)/i),Sd=Ai&&Ai[1]?parseInt(Ai[1],10):null,Id=Ai&&Ai[2]?parseInt(Ai[2],10):null,UM=Sd&&Sd<10||Id&&Id<13||!1,kh=()=>ko(qM,{defaultMatches:!1})||UM,YM=i=>Oe("MuiDateCalendar",i);je("MuiDateCalendar",["root","viewTransitionContainer"]);const GM=["autoFocus","onViewChange","value","defaultValue","referenceDate","disableFuture","disablePast","onChange","onYearChange","onMonthChange","reduceAnimations","shouldDisableDate","shouldDisableMonth","shouldDisableYear","view","views","openTo","className","disabled","readOnly","minDate","maxDate","disableHighlightToday","focusedView","onFocusedViewChange","showDaysOutsideCurrentMonth","fixedWeekNumber","dayOfWeekFormatter","slots","slotProps","loading","renderLoading","displayWeekNumber","yearsOrder","yearsPerRow","monthsPerRow","timezone"],JM=i=>{const{classes:e}=i;return Te({root:["root"],viewTransitionContainer:["viewTransitionContainer"]},YM,e)};function KM(i,e){const t=Me(),n=Un(),r=kh(),s=Ie({props:i,name:e});return _({},s,{loading:s.loading??!1,disablePast:s.disablePast??!1,disableFuture:s.disableFuture??!1,openTo:s.openTo??"day",views:s.views??["year","day"],reduceAnimations:s.reduceAnimations??r,renderLoading:s.renderLoading??(()=>h.jsx("span",{children:"..."})),minDate:wt(t,s.minDate,n.minDate),maxDate:wt(t,s.maxDate,n.maxDate)})}const XM=ce(ys,{name:"MuiDateCalendar",slot:"Root",overridesResolver:(i,e)=>e.root})({display:"flex",flexDirection:"column",height:ul}),ZM=ce(_h,{name:"MuiDateCalendar",slot:"ViewTransitionContainer",overridesResolver:(i,e)=>e.viewTransitionContainer})({}),QM=D.forwardRef(function(e,t){const n=Me(),r=Hi(),s=KM(e,"MuiDateCalendar"),{autoFocus:o,onViewChange:a,value:l,defaultValue:c,referenceDate:u,disableFuture:p,disablePast:d,onChange:f,onYearChange:m,onMonthChange:v,reduceAnimations:g,shouldDisableDate:x,shouldDisableMonth:y,shouldDisableYear:w,view:S,views:M,openTo:b,className:I,disabled:P,readOnly:E,minDate:A,maxDate:T,disableHighlightToday:W,focusedView:F,onFocusedViewChange:j,showDaysOutsideCurrentMonth:O,fixedWeekNumber:R,dayOfWeekFormatter:B,slots:$,slotProps:J,loading:q,renderLoading:L,displayWeekNumber:Q,yearsOrder:G,yearsPerRow:ne,monthsPerRow:U,timezone:re}=s,ie=me(s,GM),{value:Y,handleValueChange:K,timezone:se}=Ki({name:"DateCalendar",timezone:re,value:l,defaultValue:c,referenceDate:u,onChange:f,valueManager:Ue}),{view:ae,setView:oe,focusedView:V,setFocusedView:z,goToNextView:Z,setValueAndGoToNextView:X}=Gn({view:S,views:M,openTo:b,onChange:K,onViewChange:a,autoFocus:o,focusedView:F,onFocusedViewChange:j}),{referenceDate:H,calendarState:ee,changeFocusedDay:te,changeMonth:de,handleChangeMonth:ye,isDateDisabled:Le,onMonthSwitchingAnimationEnd:nt}=L_({value:Y,referenceDate:u,reduceAnimations:g,onMonthChange:v,minDate:A,maxDate:T,shouldDisableDate:x,disablePast:d,disableFuture:p,timezone:se}),ue=P&&Y||A,pe=P&&Y||T,Ce=`${r}-grid-label`,Ae=V!==null,ze=($==null?void 0:$.calendarHeader)??HM,Qt=Pe({elementType:ze,externalSlotProps:J==null?void 0:J.calendarHeader,additionalProps:{views:M,view:ae,currentMonth:ee.currentMonth,onViewChange:oe,onMonthChange:($e,jt)=>ye({newMonth:$e,direction:jt}),minDate:ue,maxDate:pe,disabled:P,disablePast:d,disableFuture:p,reduceAnimations:g,timezone:se,labelId:Ce},ownerState:s}),Bt=he($e=>{const jt=n.startOfMonth($e),en=n.endOfMonth($e),Vt=Le($e)?vn({utils:n,date:$e,minDate:n.isBefore(A,jt)?jt:A,maxDate:n.isAfter(T,en)?en:T,disablePast:d,disableFuture:p,isDateDisabled:Le,timezone:se}):$e;Vt?(X(Vt,"finish"),v==null||v(jt)):(Z(),de(jt)),te(Vt,!0)}),Xi=he($e=>{const jt=n.startOfYear($e),en=n.endOfYear($e),Vt=Le($e)?vn({utils:n,date:$e,minDate:n.isBefore(A,jt)?jt:A,maxDate:n.isAfter(T,en)?en:T,disablePast:d,disableFuture:p,isDateDisabled:Le,timezone:se}):$e;Vt?(X(Vt,"finish"),m==null||m(Vt)):(Z(),de(jt)),te(Vt,!0)}),Zi=he($e=>K($e&&Nr(n,$e,Y??H),"finish",ae));D.useEffect(()=>{Y!=null&&n.isValid(Y)&&de(Y)},[Y]);const ei=s,ti=JM(ei),ii={disablePast:d,disableFuture:p,maxDate:T,minDate:A},ni={disableHighlightToday:W,readOnly:E,disabled:P,timezone:se,gridLabelId:Ce,slots:$,slotProps:J},ri=D.useRef(ae);D.useEffect(()=>{ri.current!==ae&&(V===ri.current&&z(ae,!0),ri.current=ae)},[V,z,ae]);const Qi=D.useMemo(()=>[Y],[Y]);return h.jsxs(XM,_({ref:t,className:Ee(ti.root,I),ownerState:ei},ie,{children:[h.jsx(ze,_({},Qt,{slots:$,slotProps:J})),h.jsx(ZM,{reduceAnimations:g,className:ti.viewTransitionContainer,transKey:ae,ownerState:ei,children:h.jsxs("div",{children:[ae==="year"&&h.jsx(EM,_({},ii,ni,{value:Y,onChange:Xi,shouldDisableYear:w,hasFocus:Ae,onFocusedViewChange:$e=>z("year",$e),yearsOrder:G,yearsPerRow:ne,referenceDate:H})),ae==="month"&&h.jsx(wM,_({},ii,ni,{hasFocus:Ae,className:I,value:Y,onChange:Bt,shouldDisableMonth:y,onFocusedViewChange:$e=>z("month",$e),monthsPerRow:U,referenceDate:H})),ae==="day"&&h.jsx(cM,_({},ee,ii,ni,{onMonthSwitchingAnimationEnd:nt,onFocusedDayChange:te,reduceAnimations:g,selectedDays:Qi,onSelectedDaysChange:Zi,shouldDisableDate:x,shouldDisableMonth:y,shouldDisableYear:w,hasFocus:Ae,onFocusedViewChange:$e=>z("day",$e),showDaysOutsideCurrentMonth:O,fixedWeekNumber:R,dayOfWeekFormatter:B,displayWeekNumber:Q,loading:q,renderLoading:L}))]})})]}))});function Th(i){return Oe("MuiPickersToolbar",i)}je("MuiPickersToolbar",["root","content"]);const ek=["children","className","toolbarTitle","hidden","titleId","isLandscape","classes","landscapeDirection"],tk=i=>{const{classes:e}=i;return Te({root:["root"],content:["content"]},Th,e)},ik=ce("div",{name:"MuiPickersToolbar",slot:"Root",overridesResolver:(i,e)=>e.root})(({theme:i})=>({display:"flex",flexDirection:"column",alignItems:"flex-start",justifyContent:"space-between",padding:i.spacing(2,3),variants:[{props:{isLandscape:!0},style:{height:"auto",maxWidth:160,padding:16,justifyContent:"flex-start",flexWrap:"wrap"}}]})),nk=ce("div",{name:"MuiPickersToolbar",slot:"Content",overridesResolver:(i,e)=>e.content})({display:"flex",flexWrap:"wrap",width:"100%",flex:1,justifyContent:"space-between",alignItems:"center",flexDirection:"row",variants:[{props:{isLandscape:!0},style:{justifyContent:"flex-start",alignItems:"flex-start",flexDirection:"column"}},{props:{isLandscape:!0,landscapeDirection:"row"},style:{flexDirection:"row"}}]}),Ph=D.forwardRef(function(e,t){const n=Ie({props:e,name:"MuiPickersToolbar"}),{children:r,className:s,toolbarTitle:o,hidden:a,titleId:l}=n,c=me(n,ek),u=n,p=tk(u);return a?null:h.jsxs(ik,_({ref:t,className:Ee(p.root,s),ownerState:u},c,{children:[h.jsx(Kt,{color:"text.secondary",variant:"overline",id:l,children:o}),h.jsx(nk,{className:p.content,ownerState:u,children:r})]}))});function rk(i){return Oe("MuiDatePickerToolbar",i)}je("MuiDatePickerToolbar",["root","title"]);const sk=["value","isLandscape","onChange","toolbarFormat","toolbarPlaceholder","views","className","onViewChange","view"],ok=i=>{const{classes:e}=i;return Te({root:["root"],title:["title"]},rk,e)},ak=ce(Ph,{name:"MuiDatePickerToolbar",slot:"Root",overridesResolver:(i,e)=>e.root})({}),lk=ce(Kt,{name:"MuiDatePickerToolbar",slot:"Title",overridesResolver:(i,e)=>e.title})({variants:[{props:{isLandscape:!0},style:{margin:"auto 16px auto auto"}}]}),ck=D.forwardRef(function(e,t){const n=Ie({props:e,name:"MuiDatePickerToolbar"}),{value:r,isLandscape:s,toolbarFormat:o,toolbarPlaceholder:a="––",views:l,className:c}=n,u=me(n,sk),p=Me(),d=Qe(),f=ok(n),m=D.useMemo(()=>{if(!r)return a;const g=fl(p,{format:o,views:l},!0);return p.formatByString(r,g)},[r,o,a,p,l]),v=n;return h.jsx(ak,_({ref:t,toolbarTitle:d.datePickerToolbarTitle,isLandscape:s,className:Ee(f.root,c)},u,{children:h.jsx(lk,{variant:"h4",align:s?"left":"center",ownerState:v,className:f.title,children:m})}))});function Oh(i,e){const t=Me(),n=Un(),r=Ie({props:i,name:e}),s=D.useMemo(()=>{var o;return((o=r.localeText)==null?void 0:o.toolbarTitle)==null?r.localeText:_({},r.localeText,{datePickerToolbarTitle:r.localeText.toolbarTitle})},[r.localeText]);return _({},r,{localeText:s},qp({views:r.views,openTo:r.openTo,defaultViews:["year","day"],defaultOpenTo:"day"}),{disableFuture:r.disableFuture??!1,disablePast:r.disablePast??!1,minDate:wt(t,r.minDate,n.minDate),maxDate:wt(t,r.maxDate,n.maxDate),slots:_({toolbar:ck},r.slots)})}function dk(i){return Oe("MuiPickersPopper",i)}je("MuiPickersPopper",["root","paper"]);const uk=["PaperComponent","popperPlacement","ownerState","children","paperSlotProps","paperClasses","onPaperClick","onPaperTouchStart"],pk=i=>{const{classes:e}=i;return Te({root:["root"],paper:["paper"]},dk,e)},hk=ce(mf,{name:"MuiPickersPopper",slot:"Root",overridesResolver:(i,e)=>e.root})(({theme:i})=>({zIndex:i.zIndex.modal})),fk=ce(ff,{name:"MuiPickersPopper",slot:"Paper",overridesResolver:(i,e)=>e.paper})({outline:0,transformOrigin:"top center",variants:[{props:({placement:i})=>["top","top-start","top-end"].includes(i),style:{transformOrigin:"bottom center"}}]});function mk(i,e){return e.documentElement.clientWidth<i.clientX||e.documentElement.clientHeight<i.clientY}function gk(i,e){const t=D.useRef(!1),n=D.useRef(!1),r=D.useRef(null),s=D.useRef(!1);D.useEffect(()=>{if(!i)return;function l(){s.current=!0}return document.addEventListener("mousedown",l,!0),document.addEventListener("touchstart",l,!0),()=>{document.removeEventListener("mousedown",l,!0),document.removeEventListener("touchstart",l,!0),s.current=!1}},[i]);const o=he(l=>{if(!s.current)return;const c=n.current;n.current=!1;const u=Is(r.current);if(!r.current||"clientX"in l&&mk(l,u))return;if(t.current){t.current=!1;return}let p;l.composedPath?p=l.composedPath().indexOf(r.current)>-1:p=!u.documentElement.contains(l.target)||r.current.contains(l.target),!p&&!c&&e(l)}),a=()=>{n.current=!0};return D.useEffect(()=>{if(i){const l=Is(r.current),c=()=>{t.current=!0};return l.addEventListener("touchstart",o),l.addEventListener("touchmove",c),()=>{l.removeEventListener("touchstart",o),l.removeEventListener("touchmove",c)}}},[i,o]),D.useEffect(()=>{if(i){const l=Is(r.current);return l.addEventListener("click",o),()=>{l.removeEventListener("click",o),n.current=!1}}},[i,o]),[r,a,a]}const vk=D.forwardRef((i,e)=>{const{PaperComponent:t,popperPlacement:n,ownerState:r,children:s,paperSlotProps:o,paperClasses:a,onPaperClick:l,onPaperTouchStart:c}=i,u=me(i,uk),p=_({},r,{placement:n}),d=Pe({elementType:t,externalSlotProps:o,additionalProps:{tabIndex:-1,elevation:8,ref:e},className:a,ownerState:p});return h.jsx(t,_({},u,d,{onClick:f=>{var m;l(f),(m=d.onClick)==null||m.call(d,f)},onTouchStart:f=>{var m;c(f),(m=d.onTouchStart)==null||m.call(d,f)},ownerState:p,children:s}))});function xk(i){const e=Ie({props:i,name:"MuiPickersPopper"}),{anchorEl:t,children:n,containerRef:r=null,shouldRestoreFocus:s,onBlur:o,onDismiss:a,open:l,role:c,placement:u,slots:p,slotProps:d,reduceAnimations:f}=e;D.useEffect(()=>{function O(R){l&&R.key==="Escape"&&a()}return document.addEventListener("keydown",O),()=>{document.removeEventListener("keydown",O)}},[a,l]);const m=D.useRef(null);D.useEffect(()=>{c==="tooltip"||s&&!s()||(l?m.current=tt(document):m.current&&m.current instanceof HTMLElement&&setTimeout(()=>{m.current instanceof HTMLElement&&m.current.focus()}))},[l,c,s]);const[v,g,x]=gk(l,o??a),y=D.useRef(null),w=st(y,r),S=st(w,v),M=e,b=pk(M),I=kh(),P=f??I,E=O=>{O.key==="Escape"&&(O.stopPropagation(),a())},A=(p==null?void 0:p.desktopTransition)??P?Fr:pf,T=(p==null?void 0:p.desktopTrapFocus)??hf,W=(p==null?void 0:p.desktopPaper)??fk,F=(p==null?void 0:p.popper)??hk,j=Pe({elementType:F,externalSlotProps:d==null?void 0:d.popper,additionalProps:{transition:!0,role:c,open:l,anchorEl:t,placement:u,onKeyDown:E},className:b.root,ownerState:e});return h.jsx(F,_({},j,{children:({TransitionProps:O,placement:R})=>h.jsx(T,_({open:l,disableAutoFocus:!0,disableRestoreFocus:!0,disableEnforceFocus:c==="tooltip",isEnabled:()=>!0},d==null?void 0:d.desktopTrapFocus,{children:h.jsx(A,_({},O,d==null?void 0:d.desktopTransition,{children:h.jsx(vk,{PaperComponent:W,ownerState:M,popperPlacement:R,ref:S,onPaperClick:g,onPaperTouchStart:x,paperClasses:b.paper,paperSlotProps:d==null?void 0:d.desktopPaper,children:n})}))}))}))}const yk=({open:i,onOpen:e,onClose:t})=>{const n=D.useRef(typeof i=="boolean").current,[r,s]=D.useState(!1);D.useEffect(()=>{if(n){if(typeof i!="boolean")throw new Error("You must not mix controlling and uncontrolled mode for `open` prop");s(i)}},[n,i]);const o=D.useCallback(a=>{n||s(a),a&&e&&e(),!a&&t&&t()},[n,e,t]);return{isOpen:r,setIsOpen:o}},bk=i=>{const{action:e,hasChanged:t,dateState:n,isControlled:r}=i,s=!r&&!n.hasBeenModifiedSinceMount;return e.name==="setValueFromField"?!0:e.name==="setValueFromAction"?s&&["accept","today","clear"].includes(e.pickerAction)?!0:t(n.lastPublishedValue):e.name==="setValueFromView"&&e.selectionState!=="shallow"||e.name==="setValueFromShortcut"?s?!0:t(n.lastPublishedValue):!1},wk=i=>{const{action:e,hasChanged:t,dateState:n,isControlled:r,closeOnSelect:s}=i,o=!r&&!n.hasBeenModifiedSinceMount;return e.name==="setValueFromAction"?o&&["accept","today","clear"].includes(e.pickerAction)?!0:t(n.lastCommittedValue):e.name==="setValueFromView"&&e.selectionState==="finish"&&s?o?!0:t(n.lastCommittedValue):e.name==="setValueFromShortcut"?e.changeImportance==="accept"&&t(n.lastCommittedValue):!1},Dk=i=>{const{action:e,closeOnSelect:t}=i;return e.name==="setValueFromAction"?!0:e.name==="setValueFromView"?e.selectionState==="finish"&&t:e.name==="setValueFromShortcut"?e.changeImportance==="accept":!1},Sk=({props:i,valueManager:e,valueType:t,wrapperVariant:n,validator:r})=>{const{onAccept:s,onChange:o,value:a,defaultValue:l,closeOnSelect:c=n==="desktop",timezone:u,referenceDate:p}=i,{current:d}=D.useRef(l),{current:f}=D.useRef(a!==void 0),[m,v]=D.useState(u),g=Me(),x=wi(),{isOpen:y,setIsOpen:w}=yk(i),{timezone:S,value:M,handleValueChange:b}=ml({timezone:u,value:a,defaultValue:d,referenceDate:p,onChange:o,valueManager:e}),[I,P]=D.useState(()=>{let K;return M!==void 0?K=M:d!==void 0?K=d:K=e.emptyValue,{draft:K,lastPublishedValue:K,lastCommittedValue:K,lastControlledValue:a,hasBeenModifiedSinceMount:!1}}),E=e.getTimezone(g,I.draft);m!==u&&(v(u),u&&E&&u!==E&&P(K=>_({},K,{draft:e.setTimezone(g,u,K.draft)})));const{getValidationErrorForNewValue:A}=ch({props:i,validator:r,timezone:S,value:I.draft,onError:i.onError}),T=he(K=>{const se={action:K,dateState:I,hasChanged:X=>!e.areValuesEqual(g,K.value,X),isControlled:f,closeOnSelect:c},ae=bk(se),oe=wk(se),V=Dk(se);P(X=>_({},X,{draft:K.value,lastPublishedValue:ae?K.value:X.lastPublishedValue,lastCommittedValue:oe?K.value:X.lastCommittedValue,hasBeenModifiedSinceMount:!0}));let z=null;const Z=()=>(z||(z={validationError:K.name==="setValueFromField"?K.context.validationError:A(K.value)},K.name==="setValueFromShortcut"&&(z.shortcut=K.shortcut)),z);ae&&b(K.value,Z()),oe&&s&&s(K.value,Z()),V&&w(!1)});if(I.lastControlledValue!==a){const K=e.areValuesEqual(g,I.draft,M);P(se=>_({},se,{lastControlledValue:a},K?{}:{lastCommittedValue:M,lastPublishedValue:M,draft:M,hasBeenModifiedSinceMount:!0}))}const W=he(()=>{T({value:e.emptyValue,name:"setValueFromAction",pickerAction:"clear"})}),F=he(()=>{T({value:I.lastPublishedValue,name:"setValueFromAction",pickerAction:"accept"})}),j=he(()=>{T({value:I.lastPublishedValue,name:"setValueFromAction",pickerAction:"dismiss"})}),O=he(()=>{T({value:I.lastCommittedValue,name:"setValueFromAction",pickerAction:"cancel"})}),R=he(()=>{T({value:e.getTodayValue(g,S,t),name:"setValueFromAction",pickerAction:"today"})}),B=he(K=>{K.preventDefault(),w(!0)}),$=he(K=>{K==null||K.preventDefault(),w(!1)}),J=he((K,se="partial")=>T({name:"setValueFromView",value:K,selectionState:se})),q=he((K,se,ae)=>T({name:"setValueFromShortcut",value:K,changeImportance:se,shortcut:ae})),L=he((K,se)=>T({name:"setValueFromField",value:K,context:se})),Q={onClear:W,onAccept:F,onDismiss:j,onCancel:O,onSetToday:R,onOpen:B,onClose:$},G={value:I.draft,onChange:L},ne=D.useMemo(()=>e.cleanValue(g,I.draft),[g,e,I.draft]),U={value:ne,onChange:J,onClose:$,open:y},ie=_({},Q,{value:ne,onChange:J,onSelectShortcut:q,isValid:K=>{const se=r({adapter:x,value:K,timezone:S,props:i});return!e.hasError(se)}}),Y=D.useMemo(()=>({onOpen:B,onClose:$,open:y}),[y,$,B]);return{open:y,fieldProps:G,viewProps:U,layoutProps:ie,actions:Q,contextValue:Y}},Ik=["className","sx"],Ck=({props:i,propsFromPickerValue:e,additionalViewProps:t,autoFocusView:n,rendererInterceptor:r,fieldRef:s})=>{const{onChange:o,open:a,onClose:l}=e,{view:c,views:u,openTo:p,onViewChange:d,viewRenderers:f,timezone:m}=i,v=me(i,Ik),{view:g,setView:x,defaultView:y,focusedView:w,setFocusedView:S,setValueAndGoToNextView:M}=Gn({view:c,views:u,openTo:p,onChange:o,onViewChange:d,autoFocus:n}),{hasUIView:b,viewModeLookup:I}=D.useMemo(()=>u.reduce((j,O)=>{let R;return f[O]!=null?R="UI":R="field",j.viewModeLookup[O]=R,R==="UI"&&(j.hasUIView=!0),j},{hasUIView:!1,viewModeLookup:{}}),[f,u]),P=D.useMemo(()=>u.reduce((j,O)=>f[O]!=null&&On(O)?j+1:j,0),[f,u]),E=I[g],A=he(()=>E==="UI"),[T,W]=D.useState(E==="UI"?g:null);return T!==g&&I[g]==="UI"&&W(g),Ft(()=>{E==="field"&&a&&(l(),setTimeout(()=>{var j,O;(j=s==null?void 0:s.current)==null||j.setSelectedSections(g),(O=s==null?void 0:s.current)==null||O.focusField(g)}))},[g]),Ft(()=>{if(!a)return;let j=g;E==="field"&&T!=null&&(j=T),j!==y&&I[j]==="UI"&&I[y]==="UI"&&(j=y),j!==g&&x(j),S(j,!0)},[a]),{hasUIView:b,shouldRestoreFocus:A,layoutProps:{views:u,view:T,onViewChange:x},renderCurrentView:()=>{if(T==null)return null;const j=f[T];if(j==null)return null;const O=_({},v,t,e,{views:u,timezone:m,onChange:M,view:T,onViewChange:x,focusedView:w,onFocusedViewChange:S,showViewSwitcher:P>1,timeViewsCount:P});return r?r(f,T,O):j(O)}}};function Cd(){return typeof window>"u"?"portrait":window.screen&&window.screen.orientation&&window.screen.orientation.angle?Math.abs(window.screen.orientation.angle)===90?"landscape":"portrait":window.orientation&&Math.abs(Number(window.orientation))===90?"landscape":"portrait"}const _k=(i,e)=>{const[t,n]=D.useState(Cd);return Ft(()=>{const s=()=>{n(Cd())};return window.addEventListener("orientationchange",s),()=>{window.removeEventListener("orientationchange",s)}},[]),_i(i,["hours","minutes","seconds"])?!1:(e||t)==="landscape"},Mk=({props:i,propsFromPickerValue:e,propsFromPickerViews:t,wrapperVariant:n})=>{const{orientation:r}=i,s=_k(t.views,r),o=Tt();return{layoutProps:_({},t,e,{isLandscape:s,isRtl:o,wrapperVariant:n,disabled:i.disabled,readOnly:i.readOnly})}};function kk(i){const{props:e,pickerValueResponse:t}=i;return D.useMemo(()=>({value:t.viewProps.value,open:t.open,disabled:e.disabled??!1,readOnly:e.readOnly??!1}),[t.viewProps.value,t.open,e.disabled,e.readOnly])}const jh=({props:i,valueManager:e,valueType:t,wrapperVariant:n,additionalViewProps:r,validator:s,autoFocusView:o,rendererInterceptor:a,fieldRef:l})=>{const c=Sk({props:i,valueManager:e,valueType:t,wrapperVariant:n,validator:s}),u=Ck({props:i,additionalViewProps:r,autoFocusView:o,fieldRef:l,propsFromPickerValue:c.viewProps,rendererInterceptor:a}),p=Mk({props:i,wrapperVariant:n,propsFromPickerValue:c.layoutProps,propsFromPickerViews:u.layoutProps}),d=kk({props:i,pickerValueResponse:c});return{open:c.open,actions:c.actions,fieldProps:c.fieldProps,renderCurrentView:u.renderCurrentView,hasUIView:u.hasUIView,shouldRestoreFocus:u.shouldRestoreFocus,layoutProps:p.layoutProps,contextValue:c.contextValue,ownerState:d}};function Eh(i){return Oe("MuiPickersLayout",i)}const ci=je("MuiPickersLayout",["root","landscape","contentWrapper","toolbar","actionBar","tabs","shortcuts"]),Tk=["onAccept","onClear","onCancel","onSetToday","actions"];function Pk(i){const{onAccept:e,onClear:t,onCancel:n,onSetToday:r,actions:s}=i,o=me(i,Tk),a=Qe();if(s==null||s.length===0)return null;const l=s==null?void 0:s.map(c=>{switch(c){case"clear":return h.jsx(pn,{onClick:t,children:a.clearButtonLabel},c);case"cancel":return h.jsx(pn,{onClick:n,children:a.cancelButtonLabel},c);case"accept":return h.jsx(pn,{onClick:e,children:a.okButtonLabel},c);case"today":return h.jsx(pn,{onClick:r,children:a.todayButtonLabel},c);default:return null}});return h.jsx(gf,_({},o,{children:l}))}const Ok=["items","changeImportance","isLandscape","onChange","isValid"],jk=["getValue"];function Ek(i){const{items:e,changeImportance:t="accept",onChange:n,isValid:r}=i,s=me(i,Ok);if(e==null||e.length===0)return null;const o=e.map(a=>{let{getValue:l}=a,c=me(a,jk);const u=l({isValid:r});return _({},c,{label:c.label,onClick:()=>{n(u,t,c)},disabled:!r(u)})});return h.jsx(vf,_({dense:!0,sx:[{maxHeight:ul,maxWidth:200,overflow:"auto"},...Array.isArray(s.sx)?s.sx:[s.sx]]},s,{children:o.map(a=>h.jsx(xf,{children:h.jsx(yf,_({},a))},a.id??a.label))}))}function Rk(i){return i.view!==null}const Ak=i=>{const{classes:e,isLandscape:t}=i;return Te({root:["root",t&&"landscape"],contentWrapper:["contentWrapper"],toolbar:["toolbar"],actionBar:["actionBar"],tabs:["tabs"],landscape:["landscape"],shortcuts:["shortcuts"]},Eh,e)},Nk=i=>{const{wrapperVariant:e,onAccept:t,onClear:n,onCancel:r,onSetToday:s,view:o,views:a,onViewChange:l,value:c,onChange:u,onSelectShortcut:p,isValid:d,isLandscape:f,disabled:m,readOnly:v,children:g,slots:x,slotProps:y}=i,w=Ak(i),S=(x==null?void 0:x.actionBar)??Pk,M=Pe({elementType:S,externalSlotProps:y==null?void 0:y.actionBar,additionalProps:{onAccept:t,onClear:n,onCancel:r,onSetToday:s,actions:e==="desktop"?[]:["cancel","accept"]},className:w.actionBar,ownerState:_({},i,{wrapperVariant:e})}),b=h.jsx(S,_({},M)),I=x==null?void 0:x.toolbar,P=Pe({elementType:I,externalSlotProps:y==null?void 0:y.toolbar,additionalProps:{isLandscape:f,onChange:u,value:c,view:o,onViewChange:l,views:a,disabled:m,readOnly:v},className:w.toolbar,ownerState:_({},i,{wrapperVariant:e})}),E=Rk(P)&&I?h.jsx(I,_({},P)):null,A=g,T=x==null?void 0:x.tabs,W=o&&T?h.jsx(T,_({view:o,onViewChange:l,className:w.tabs},y==null?void 0:y.tabs)):null,F=(x==null?void 0:x.shortcuts)??Ek,j=Pe({elementType:F,externalSlotProps:y==null?void 0:y.shortcuts,additionalProps:{isValid:d,isLandscape:f,onChange:p},className:w.shortcuts,ownerState:{isValid:d,isLandscape:f,onChange:p,wrapperVariant:e}}),O=o&&F?h.jsx(F,_({},j)):null;return{toolbar:E,content:A,tabs:W,actionBar:b,shortcuts:O}},$k=i=>{const{isLandscape:e,classes:t}=i;return Te({root:["root",e&&"landscape"],contentWrapper:["contentWrapper"]},Eh,t)},Wk=ce("div",{name:"MuiPickersLayout",slot:"Root",overridesResolver:(i,e)=>e.root})({display:"grid",gridAutoColumns:"max-content auto max-content",gridAutoRows:"max-content auto max-content",[`& .${ci.actionBar}`]:{gridColumn:"1 / 4",gridRow:3},variants:[{props:{isLandscape:!0},style:{[`& .${ci.toolbar}`]:{gridColumn:1,gridRow:"2 / 3"},[`.${ci.shortcuts}`]:{gridColumn:"2 / 4",gridRow:1}}},{props:{isLandscape:!0,isRtl:!0},style:{[`& .${ci.toolbar}`]:{gridColumn:3}}},{props:{isLandscape:!1},style:{[`& .${ci.toolbar}`]:{gridColumn:"2 / 4",gridRow:1},[`& .${ci.shortcuts}`]:{gridColumn:1,gridRow:"2 / 3"}}},{props:{isLandscape:!1,isRtl:!0},style:{[`& .${ci.shortcuts}`]:{gridColumn:3}}}]}),Fk=ce("div",{name:"MuiPickersLayout",slot:"ContentWrapper",overridesResolver:(i,e)=>e.contentWrapper})({gridColumn:2,gridRow:2,display:"flex",flexDirection:"column"}),Rh=D.forwardRef(function(e,t){const n=Ie({props:e,name:"MuiPickersLayout"}),{toolbar:r,content:s,tabs:o,actionBar:a,shortcuts:l}=Nk(n),{sx:c,className:u,isLandscape:p,wrapperVariant:d}=n,f=$k(n);return h.jsxs(Wk,{ref:t,sx:c,className:Ee(f.root,u),ownerState:n,children:[p?l:r,p?r:l,h.jsx(Fk,{className:f.contentWrapper,children:d==="desktop"?h.jsxs(D.Fragment,{children:[s,o]}):h.jsxs(D.Fragment,{children:[o,s]})}),a]})}),Lk=["props","getOpenDialogAriaText"],Bk=["ownerState"],Vk=["ownerState"],Ah=i=>{var Z;let{props:e,getOpenDialogAriaText:t}=i,n=me(i,Lk);const{slots:r,slotProps:s,className:o,sx:a,format:l,formatDensity:c,enableAccessibleFieldDOMStructure:u,selectedSections:p,onSelectedSectionsChange:d,timezone:f,name:m,label:v,inputRef:g,readOnly:x,disabled:y,autoFocus:w,localeText:S,reduceAnimations:M}=e,b=D.useRef(null),I=D.useRef(null),P=Hi(),E=((Z=s==null?void 0:s.toolbar)==null?void 0:Z.hidden)??!1,{open:A,actions:T,hasUIView:W,layoutProps:F,renderCurrentView:j,shouldRestoreFocus:O,fieldProps:R,contextValue:B,ownerState:$}=jh(_({},n,{props:e,fieldRef:I,autoFocusView:!0,additionalViewProps:{},wrapperVariant:"desktop"})),J=r.inputAdornment??jd,q=Pe({elementType:J,externalSlotProps:s==null?void 0:s.inputAdornment,additionalProps:{position:"end"},ownerState:e}),L=me(q,Bk),Q=r.openPickerButton??zi,G=Pe({elementType:Q,externalSlotProps:s==null?void 0:s.openPickerButton,additionalProps:{disabled:y||x,onClick:A?T.onClose:T.onOpen,"aria-label":t(R.value),edge:L.position},ownerState:e}),ne=me(G,Vk),U=r.openPickerIcon,re=Pe({elementType:U,externalSlotProps:s==null?void 0:s.openPickerIcon,ownerState:$}),ie=r.field,Y=Pe({elementType:ie,externalSlotProps:s==null?void 0:s.field,additionalProps:_({},R,E&&{id:P},{readOnly:x,disabled:y,className:o,sx:a,format:l,formatDensity:c,enableAccessibleFieldDOMStructure:u,selectedSections:p,onSelectedSectionsChange:d,timezone:f,label:v,name:m,autoFocus:w&&!e.open,focused:A?!0:void 0},g?{inputRef:g}:{}),ownerState:e});W&&(Y.InputProps=_({},Y.InputProps,{ref:b},!e.disableOpenPicker&&{[`${L.position}Adornment`]:h.jsx(J,_({},L,{children:h.jsx(Q,_({},ne,{children:h.jsx(U,_({},re))}))}))}));const K=_({textField:r.textField,clearIcon:r.clearIcon,clearButton:r.clearButton},Y.slots),se=r.layout??Rh;let ae=P;E&&(v?ae=`${P}-label`:ae=void 0);const oe=_({},s,{toolbar:_({},s==null?void 0:s.toolbar,{titleId:P}),popper:_({"aria-labelledby":ae},s==null?void 0:s.popper)}),V=st(I,Y.unstableFieldRef);return{renderPicker:()=>h.jsxs(hh,{contextValue:B,localeText:S,children:[h.jsx(ie,_({},Y,{slots:K,slotProps:oe,unstableFieldRef:V})),h.jsx(xk,_({role:"dialog",placement:"bottom-start",anchorEl:b.current},T,{open:A,slots:r,slotProps:oe,shouldRestoreFocus:O,reduceAnimations:M,children:h.jsx(se,_({},F,oe==null?void 0:oe.layout,{slots:r,slotProps:oe,children:j()}))}))]})}},Ni=({view:i,onViewChange:e,views:t,focusedView:n,onFocusedViewChange:r,value:s,defaultValue:o,referenceDate:a,onChange:l,className:c,classes:u,disableFuture:p,disablePast:d,minDate:f,maxDate:m,shouldDisableDate:v,shouldDisableMonth:g,shouldDisableYear:x,reduceAnimations:y,onMonthChange:w,monthsPerRow:S,onYearChange:M,yearsOrder:b,yearsPerRow:I,slots:P,slotProps:E,loading:A,renderLoading:T,disableHighlightToday:W,readOnly:F,disabled:j,showDaysOutsideCurrentMonth:O,dayOfWeekFormatter:R,sx:B,autoFocus:$,fixedWeekNumber:J,displayWeekNumber:q,timezone:L})=>h.jsx(QM,{view:i,onViewChange:e,views:t.filter(pd),focusedView:n&&pd(n)?n:null,onFocusedViewChange:r,value:s,defaultValue:o,referenceDate:a,onChange:l,className:c,classes:u,disableFuture:p,disablePast:d,minDate:f,maxDate:m,shouldDisableDate:v,shouldDisableMonth:g,shouldDisableYear:x,reduceAnimations:y,onMonthChange:w,monthsPerRow:S,onYearChange:M,yearsOrder:b,yearsPerRow:I,slots:P,slotProps:E,loading:A,renderLoading:T,disableHighlightToday:W,readOnly:F,disabled:j,showDaysOutsideCurrentMonth:O,dayOfWeekFormatter:R,sx:B,autoFocus:$,fixedWeekNumber:J,displayWeekNumber:q,timezone:L}),Nh=D.forwardRef(function(e,t){var c,u;const n=Qe(),r=Me(),s=Oh(e,"MuiDesktopDatePicker"),o=_({day:Ni,month:Ni,year:Ni},s.viewRenderers),a=_({},s,{viewRenderers:o,format:fl(r,s,!1),yearsPerRow:s.yearsPerRow??4,slots:_({openPickerIcon:B0,field:Sh},s.slots),slotProps:_({},s.slotProps,{field:p=>{var d;return _({},Lr((d=s.slotProps)==null?void 0:d.field,p),Ds(s),{ref:t})},toolbar:_({hidden:!0},(c=s.slotProps)==null?void 0:c.toolbar)})}),{renderPicker:l}=Ah({props:a,valueManager:Ue,valueType:"date",getOpenDialogAriaText:gs({utils:r,formatKey:"fullDate",contextTranslation:n.openDatePickerDialogue,propsTranslation:(u=a.localeText)==null?void 0:u.openDatePickerDialogue}),validator:Jn});return l()});Nh.propTypes={autoFocus:C.bool,className:C.string,closeOnSelect:C.bool,dayOfWeekFormatter:C.func,defaultValue:C.object,disabled:C.bool,disableFuture:C.bool,disableHighlightToday:C.bool,disableOpenPicker:C.bool,disablePast:C.bool,displayWeekNumber:C.bool,enableAccessibleFieldDOMStructure:C.any,fixedWeekNumber:C.number,format:C.string,formatDensity:C.oneOf(["dense","spacious"]),inputRef:Br,label:C.node,loading:C.bool,localeText:C.object,maxDate:C.object,minDate:C.object,monthsPerRow:C.oneOf([3,4]),name:C.string,onAccept:C.func,onChange:C.func,onClose:C.func,onError:C.func,onMonthChange:C.func,onOpen:C.func,onSelectedSectionsChange:C.func,onViewChange:C.func,onYearChange:C.func,open:C.bool,openTo:C.oneOf(["day","month","year"]),orientation:C.oneOf(["landscape","portrait"]),readOnly:C.bool,reduceAnimations:C.bool,referenceDate:C.object,renderLoading:C.func,selectedSections:C.oneOfType([C.oneOf(["all","day","empty","hours","meridiem","minutes","month","seconds","weekDay","year"]),C.number]),shouldDisableDate:C.func,shouldDisableMonth:C.func,shouldDisableYear:C.func,showDaysOutsideCurrentMonth:C.bool,slotProps:C.object,slots:C.object,sx:C.oneOfType([C.arrayOf(C.oneOfType([C.func,C.object,C.bool])),C.func,C.object]),timezone:C.string,value:C.object,view:C.oneOf(["day","month","year"]),viewRenderers:C.shape({day:C.func,month:C.func,year:C.func}),views:C.arrayOf(C.oneOf(["day","month","year"]).isRequired),yearsOrder:C.oneOf(["asc","desc"]),yearsPerRow:C.oneOf([3,4])};const zk=ce(bf)({[`& .${Ol.container}`]:{outline:0},[`& .${Ol.paper}`]:{outline:0,minWidth:xs}}),Hk=ce(wf)({"&:first-of-type":{padding:0}});function qk(i){const{children:e,onDismiss:t,open:n,slots:r,slotProps:s}=i,o=(r==null?void 0:r.dialog)??zk,a=(r==null?void 0:r.mobileTransition)??Fr;return h.jsx(o,_({open:n,onClose:t},s==null?void 0:s.dialog,{TransitionComponent:a,TransitionProps:s==null?void 0:s.mobileTransition,PaperComponent:r==null?void 0:r.mobilePaper,PaperProps:s==null?void 0:s.mobilePaper,children:h.jsx(Hk,{children:e})}))}const Uk=["props","getOpenDialogAriaText"],$h=i=>{var L;let{props:e,getOpenDialogAriaText:t}=i,n=me(i,Uk);const{slots:r,slotProps:s,className:o,sx:a,format:l,formatDensity:c,enableAccessibleFieldDOMStructure:u,selectedSections:p,onSelectedSectionsChange:d,timezone:f,name:m,label:v,inputRef:g,readOnly:x,disabled:y,localeText:w}=e,S=D.useRef(null),M=Hi(),b=((L=s==null?void 0:s.toolbar)==null?void 0:L.hidden)??!1,{open:I,actions:P,layoutProps:E,renderCurrentView:A,fieldProps:T,contextValue:W}=jh(_({},n,{props:e,fieldRef:S,autoFocusView:!0,additionalViewProps:{},wrapperVariant:"mobile"})),F=r.field,j=Pe({elementType:F,externalSlotProps:s==null?void 0:s.field,additionalProps:_({},T,b&&{id:M},!(y||x)&&{onClick:P.onOpen,onKeyDown:sC(P.onOpen)},{readOnly:x??!0,disabled:y,className:o,sx:a,format:l,formatDensity:c,enableAccessibleFieldDOMStructure:u,selectedSections:p,onSelectedSectionsChange:d,timezone:f,label:v,name:m},g?{inputRef:g}:{}),ownerState:e});j.inputProps=_({},j.inputProps,{"aria-label":t(T.value)});const O=_({textField:r.textField},j.slots),R=r.layout??Rh;let B=M;b&&(v?B=`${M}-label`:B=void 0);const $=_({},s,{toolbar:_({},s==null?void 0:s.toolbar,{titleId:M}),mobilePaper:_({"aria-labelledby":B},s==null?void 0:s.mobilePaper)}),J=st(S,j.unstableFieldRef);return{renderPicker:()=>h.jsxs(hh,{contextValue:W,localeText:w,children:[h.jsx(F,_({},j,{slots:O,slotProps:$,unstableFieldRef:J})),h.jsx(qk,_({},P,{open:I,slots:r,slotProps:$,children:h.jsx(R,_({},E,$==null?void 0:$.layout,{slots:r,slotProps:$,children:A()}))}))]})}},Wh=D.forwardRef(function(e,t){var c,u;const n=Qe(),r=Me(),s=Oh(e,"MuiMobileDatePicker"),o=_({day:Ni,month:Ni,year:Ni},s.viewRenderers),a=_({},s,{viewRenderers:o,format:fl(r,s,!1),slots:_({field:Sh},s.slots),slotProps:_({},s.slotProps,{field:p=>{var d;return _({},Lr((d=s.slotProps)==null?void 0:d.field,p),Ds(s),{ref:t})},toolbar:_({hidden:!1},(c=s.slotProps)==null?void 0:c.toolbar)})}),{renderPicker:l}=$h({props:a,valueManager:Ue,valueType:"date",getOpenDialogAriaText:gs({utils:r,formatKey:"fullDate",contextTranslation:n.openDatePickerDialogue,propsTranslation:(u=a.localeText)==null?void 0:u.openDatePickerDialogue}),validator:Jn});return l()});Wh.propTypes={autoFocus:C.bool,className:C.string,closeOnSelect:C.bool,dayOfWeekFormatter:C.func,defaultValue:C.object,disabled:C.bool,disableFuture:C.bool,disableHighlightToday:C.bool,disableOpenPicker:C.bool,disablePast:C.bool,displayWeekNumber:C.bool,enableAccessibleFieldDOMStructure:C.any,fixedWeekNumber:C.number,format:C.string,formatDensity:C.oneOf(["dense","spacious"]),inputRef:Br,label:C.node,loading:C.bool,localeText:C.object,maxDate:C.object,minDate:C.object,monthsPerRow:C.oneOf([3,4]),name:C.string,onAccept:C.func,onChange:C.func,onClose:C.func,onError:C.func,onMonthChange:C.func,onOpen:C.func,onSelectedSectionsChange:C.func,onViewChange:C.func,onYearChange:C.func,open:C.bool,openTo:C.oneOf(["day","month","year"]),orientation:C.oneOf(["landscape","portrait"]),readOnly:C.bool,reduceAnimations:C.bool,referenceDate:C.object,renderLoading:C.func,selectedSections:C.oneOfType([C.oneOf(["all","day","empty","hours","meridiem","minutes","month","seconds","weekDay","year"]),C.number]),shouldDisableDate:C.func,shouldDisableMonth:C.func,shouldDisableYear:C.func,showDaysOutsideCurrentMonth:C.bool,slotProps:C.object,slots:C.object,sx:C.oneOfType([C.arrayOf(C.oneOfType([C.func,C.object,C.bool])),C.func,C.object]),timezone:C.string,value:C.object,view:C.oneOf(["day","month","year"]),viewRenderers:C.shape({day:C.func,month:C.func,year:C.func}),views:C.arrayOf(C.oneOf(["day","month","year"]).isRequired),yearsOrder:C.oneOf(["asc","desc"]),yearsPerRow:C.oneOf([3,4])};const Yk=["desktopModeMediaQuery"],Gk=D.forwardRef(function(e,t){const n=Ie({props:e,name:"MuiDatePicker"}),{desktopModeMediaQuery:r=sh}=n,s=me(n,Yk);return ko(r,{defaultMatches:!0})?h.jsx(Nh,_({ref:t},s)):h.jsx(Wh,_({ref:t},s))});function Jk(i){return Oe("MuiPickersToolbarText",i)}const _d=je("MuiPickersToolbarText",["root","selected"]),Kk=["className","selected","value"],Xk=i=>{const{classes:e,selected:t}=i;return Te({root:["root",t&&"selected"]},Jk,e)},Zk=ce(Kt,{name:"MuiPickersToolbarText",slot:"Root",overridesResolver:(i,e)=>[e.root,{[`&.${_d.selected}`]:e.selected}]})(({theme:i})=>({transition:i.transitions.create("color"),color:(i.vars||i).palette.text.secondary,[`&.${_d.selected}`]:{color:(i.vars||i).palette.text.primary}})),Fh=D.forwardRef(function(e,t){const n=Ie({props:e,name:"MuiPickersToolbarText"}),{className:r,value:s}=n,o=me(n,Kk),a=Xk(n);return h.jsx(Zk,_({ref:t,className:Ee(a.root,r),component:"span"},o,{children:s}))}),Qk=["align","className","selected","typographyClassName","value","variant","width"],eT=i=>{const{classes:e}=i;return Te({root:["root"]},Th,e)},tT=ce(pn,{name:"MuiPickersToolbarButton",slot:"Root",overridesResolver:(i,e)=>e.root})({padding:0,minWidth:16,textTransform:"none"}),un=D.forwardRef(function(e,t){const n=Ie({props:e,name:"MuiPickersToolbarButton"}),{align:r,className:s,selected:o,typographyClassName:a,value:l,variant:c,width:u}=n,p=me(n,Qk),d=eT(n);return h.jsx(tT,_({variant:"text",ref:t,className:Ee(d.root,s)},u?{sx:{width:u}}:{},p,{children:h.jsx(Fh,{align:r,className:a,variant:c,value:l,selected:o})}))});function iT(i){return Oe("MuiTimePickerToolbar",i)}const xn=je("MuiTimePickerToolbar",["root","separator","hourMinuteLabel","hourMinuteLabelLandscape","hourMinuteLabelReverse","ampmSelection","ampmLandscape","ampmLabel"]),nT=["ampm","ampmInClock","value","isLandscape","onChange","view","onViewChange","views","disabled","readOnly","className"],rT=i=>{const{isLandscape:e,classes:t,isRtl:n}=i;return Te({root:["root"],separator:["separator"],hourMinuteLabel:["hourMinuteLabel",e&&"hourMinuteLabelLandscape",n&&"hourMinuteLabelReverse"],ampmSelection:["ampmSelection",e&&"ampmLandscape"],ampmLabel:["ampmLabel"]},iT,t)},sT=ce(Ph,{name:"MuiTimePickerToolbar",slot:"Root",overridesResolver:(i,e)=>e.root})({}),oT=ce(Fh,{name:"MuiTimePickerToolbar",slot:"Separator",overridesResolver:(i,e)=>e.separator})({outline:0,margin:"0 4px 0 2px",cursor:"default"}),aT=ce("div",{name:"MuiTimePickerToolbar",slot:"HourMinuteLabel",overridesResolver:(i,e)=>[{[`&.${xn.hourMinuteLabelLandscape}`]:e.hourMinuteLabelLandscape,[`&.${xn.hourMinuteLabelReverse}`]:e.hourMinuteLabelReverse},e.hourMinuteLabel]})({display:"flex",justifyContent:"flex-end",alignItems:"flex-end",variants:[{props:{isRtl:!0},style:{flexDirection:"row-reverse"}},{props:{isLandscape:!0},style:{marginTop:"auto"}}]}),lT=ce("div",{name:"MuiTimePickerToolbar",slot:"AmPmSelection",overridesResolver:(i,e)=>[{[`.${xn.ampmLabel}`]:e.ampmLabel},{[`&.${xn.ampmLandscape}`]:e.ampmLandscape},e.ampmSelection]})({display:"flex",flexDirection:"column",marginRight:"auto",marginLeft:12,[`& .${xn.ampmLabel}`]:{fontSize:17},variants:[{props:{isLandscape:!0},style:{margin:"4px 0 auto",flexDirection:"row",justifyContent:"space-around",flexBasis:"100%"}}]});function cT(i){const e=Ie({props:i,name:"MuiTimePickerToolbar"}),{ampm:t,ampmInClock:n,value:r,isLandscape:s,onChange:o,view:a,onViewChange:l,views:c,disabled:u,readOnly:p,className:d}=e,f=me(e,nT),m=Me(),v=Qe(),g=Tt(),x=!!(t&&!n&&c.includes("hours")),{meridiemMode:y,handleMeridiemChange:w}=dl(r,t,o),S=P=>t?m.format(P,"hours12h"):m.format(P,"hours24h"),M=_({},e,{isRtl:g}),b=rT(M),I=h.jsx(oT,{tabIndex:-1,value:":",variant:"h3",selected:!1,className:b.separator});return h.jsxs(sT,_({landscapeDirection:"row",toolbarTitle:v.timePickerToolbarTitle,isLandscape:s,ownerState:M,className:Ee(b.root,d)},f,{children:[h.jsxs(aT,{className:b.hourMinuteLabel,ownerState:M,children:[_i(c,"hours")&&h.jsx(un,{tabIndex:-1,variant:"h3",onClick:()=>l("hours"),selected:a==="hours",value:r?S(r):"--"}),_i(c,["hours","minutes"])&&I,_i(c,"minutes")&&h.jsx(un,{tabIndex:-1,variant:"h3",onClick:()=>l("minutes"),selected:a==="minutes",value:r?m.format(r,"minutes"):"--"}),_i(c,["minutes","seconds"])&&I,_i(c,"seconds")&&h.jsx(un,{variant:"h3",onClick:()=>l("seconds"),selected:a==="seconds",value:r?m.format(r,"seconds"):"--"})]}),x&&h.jsxs(lT,{className:b.ampmSelection,ownerState:M,children:[h.jsx(un,{disableRipple:!0,variant:"subtitle2",selected:y==="am",typographyClassName:b.ampmLabel,value:Ht(m,"am"),onClick:p?void 0:()=>w("am"),disabled:u}),h.jsx(un,{disableRipple:!0,variant:"subtitle2",selected:y==="pm",typographyClassName:b.ampmLabel,value:Ht(m,"pm"),onClick:p?void 0:()=>w("pm"),disabled:u})]})]}))}function Lh(i,e){var o;const t=Me(),n=Ie({props:i,name:e}),r=n.ampm??t.is12HourCycleInCurrentLocale(),s=D.useMemo(()=>{var a;return((a=n.localeText)==null?void 0:a.toolbarTitle)==null?n.localeText:_({},n.localeText,{timePickerToolbarTitle:n.localeText.toolbarTitle})},[n.localeText]);return _({},n,{ampm:r,localeText:s},qp({views:n.views,openTo:n.openTo,defaultViews:["hours","minutes"],defaultOpenTo:"hours"}),{disableFuture:n.disableFuture??!1,disablePast:n.disablePast??!1,slots:_({toolbar:cT},n.slots),slotProps:_({},n.slotProps,{toolbar:_({ampm:r,ampmInClock:n.ampmInClock},(o=n.slotProps)==null?void 0:o.toolbar)})})}const Js=({view:i,onViewChange:e,focusedView:t,onFocusedViewChange:n,views:r,value:s,defaultValue:o,referenceDate:a,onChange:l,className:c,classes:u,disableFuture:p,disablePast:d,minTime:f,maxTime:m,shouldDisableTime:v,minutesStep:g,ampm:x,ampmInClock:y,slots:w,slotProps:S,readOnly:M,disabled:b,sx:I,autoFocus:P,showViewSwitcher:E,disableIgnoringDatePartForTimeValidation:A,timezone:T})=>h.jsx(nC,{view:i,onViewChange:e,focusedView:t&&On(t)?t:null,onFocusedViewChange:n,views:r.filter(On),value:s,defaultValue:o,referenceDate:a,onChange:l,className:c,classes:u,disableFuture:p,disablePast:d,minTime:f,maxTime:m,shouldDisableTime:v,minutesStep:g,ampm:x,ampmInClock:y,slots:w,slotProps:S,readOnly:M,disabled:b,sx:I,autoFocus:P,showViewSwitcher:E,disableIgnoringDatePartForTimeValidation:A,timezone:T}),dT=({view:i,onViewChange:e,focusedView:t,onFocusedViewChange:n,views:r,value:s,defaultValue:o,referenceDate:a,onChange:l,className:c,classes:u,disableFuture:p,disablePast:d,minTime:f,maxTime:m,shouldDisableTime:v,minutesStep:g,ampm:x,slots:y,slotProps:w,readOnly:S,disabled:M,sx:b,autoFocus:I,disableIgnoringDatePartForTimeValidation:P,timeSteps:E,skipDisabled:A,timezone:T})=>h.jsx(uC,{view:i,onViewChange:e,focusedView:t,onFocusedViewChange:n,views:r.filter(On),value:s,defaultValue:o,referenceDate:a,onChange:l,className:c,classes:u,disableFuture:p,disablePast:d,minTime:f,maxTime:m,shouldDisableTime:v,minutesStep:g,ampm:x,slots:y,slotProps:w,readOnly:S,disabled:M,sx:b,autoFocus:I,disableIgnoringDatePartForTimeValidation:P,timeStep:E==null?void 0:E.minutes,skipDisabled:A,timezone:T}),Md=({view:i,onViewChange:e,focusedView:t,onFocusedViewChange:n,views:r,value:s,defaultValue:o,referenceDate:a,onChange:l,className:c,classes:u,disableFuture:p,disablePast:d,minTime:f,maxTime:m,shouldDisableTime:v,minutesStep:g,ampm:x,slots:y,slotProps:w,readOnly:S,disabled:M,sx:b,autoFocus:I,disableIgnoringDatePartForTimeValidation:P,timeSteps:E,skipDisabled:A,timezone:T})=>h.jsx(SC,{view:i,onViewChange:e,focusedView:t,onFocusedViewChange:n,views:r.filter(On),value:s,defaultValue:o,referenceDate:a,onChange:l,className:c,classes:u,disableFuture:p,disablePast:d,minTime:f,maxTime:m,shouldDisableTime:v,minutesStep:g,ampm:x,slots:y,slotProps:w,readOnly:S,disabled:M,sx:b,autoFocus:I,disableIgnoringDatePartForTimeValidation:P,timeSteps:E,skipDisabled:A,timezone:T}),uT=(i,e,t)=>t?e.filter(n=>!X0(n)||n==="hours"):i?[...e,"meridiem"]:e,pT=(i,e)=>24*60/((i.hours??1)*(i.minutes??5))<=e;function hT({thresholdToRenderTimeInASingleColumn:i,ampm:e,timeSteps:t,views:n}){const r=i??24,s=_({hours:1,minutes:5,seconds:5},t),o=pT(s,r);return{thresholdToRenderTimeInASingleColumn:r,timeSteps:s,shouldRenderTimeInASingleColumn:o,views:uT(e,n,o)}}const Bh=D.forwardRef(function(e,t){var x,y,w,S;const n=Qe(),r=Me(),s=Lh(e,"MuiDesktopTimePicker"),{shouldRenderTimeInASingleColumn:o,views:a,timeSteps:l}=hT(s),c=o?dT:Md,u=_({hours:c,minutes:c,seconds:c,meridiem:c},s.viewRenderers),p=s.ampmInClock??!0,d=o?[]:["accept"],m=((x=u.hours)==null?void 0:x.name)===Md.name?a:a.filter(M=>M!=="meridiem"),v=_({},s,{ampmInClock:p,timeSteps:l,viewRenderers:u,format:Yp(r,s),views:o?["hours"]:m,slots:_({field:Ih,openPickerIcon:V0},s.slots),slotProps:_({},s.slotProps,{field:M=>{var b;return _({},Lr((b=s.slotProps)==null?void 0:b.field,M),Ds(s),{ref:t})},toolbar:_({hidden:!0,ampmInClock:p},(y=s.slotProps)==null?void 0:y.toolbar),actionBar:_({actions:d},(w=s.slotProps)==null?void 0:w.actionBar)})}),{renderPicker:g}=Ah({props:v,valueManager:Ue,valueType:"time",getOpenDialogAriaText:gs({utils:r,formatKey:"fullTime",contextTranslation:n.openTimePickerDialogue,propsTranslation:(S=v.localeText)==null?void 0:S.openTimePickerDialogue}),validator:ws});return g()});Bh.propTypes={ampm:C.bool,ampmInClock:C.bool,autoFocus:C.bool,className:C.string,closeOnSelect:C.bool,defaultValue:C.object,disabled:C.bool,disableFuture:C.bool,disableIgnoringDatePartForTimeValidation:C.bool,disableOpenPicker:C.bool,disablePast:C.bool,enableAccessibleFieldDOMStructure:C.any,format:C.string,formatDensity:C.oneOf(["dense","spacious"]),inputRef:Br,label:C.node,localeText:C.object,maxTime:C.object,minTime:C.object,minutesStep:C.number,name:C.string,onAccept:C.func,onChange:C.func,onClose:C.func,onError:C.func,onOpen:C.func,onSelectedSectionsChange:C.func,onViewChange:C.func,open:C.bool,openTo:C.oneOf(["hours","meridiem","minutes","seconds"]),orientation:C.oneOf(["landscape","portrait"]),readOnly:C.bool,reduceAnimations:C.bool,referenceDate:C.object,selectedSections:C.oneOfType([C.oneOf(["all","day","empty","hours","meridiem","minutes","month","seconds","weekDay","year"]),C.number]),shouldDisableTime:C.func,skipDisabled:C.bool,slotProps:C.object,slots:C.object,sx:C.oneOfType([C.arrayOf(C.oneOfType([C.func,C.object,C.bool])),C.func,C.object]),thresholdToRenderTimeInASingleColumn:C.number,timeSteps:C.shape({hours:C.number,minutes:C.number,seconds:C.number}),timezone:C.string,value:C.object,view:C.oneOf(["hours","meridiem","minutes","seconds"]),viewRenderers:C.shape({hours:C.func,meridiem:C.func,minutes:C.func,seconds:C.func}),views:C.arrayOf(C.oneOf(["hours","minutes","seconds"]).isRequired)};const Vh=D.forwardRef(function(e,t){var u,p;const n=Qe(),r=Me(),s=Lh(e,"MuiMobileTimePicker"),o=_({hours:Js,minutes:Js,seconds:Js},s.viewRenderers),a=s.ampmInClock??!1,l=_({},s,{ampmInClock:a,viewRenderers:o,format:Yp(r,s),slots:_({field:Ih},s.slots),slotProps:_({},s.slotProps,{field:d=>{var f;return _({},Lr((f=s.slotProps)==null?void 0:f.field,d),Ds(s),{ref:t})},toolbar:_({hidden:!1,ampmInClock:a},(u=s.slotProps)==null?void 0:u.toolbar)})}),{renderPicker:c}=$h({props:l,valueManager:Ue,valueType:"time",getOpenDialogAriaText:gs({utils:r,formatKey:"fullTime",contextTranslation:n.openTimePickerDialogue,propsTranslation:(p=l.localeText)==null?void 0:p.openTimePickerDialogue}),validator:ws});return c()});Vh.propTypes={ampm:C.bool,ampmInClock:C.bool,autoFocus:C.bool,className:C.string,closeOnSelect:C.bool,defaultValue:C.object,disabled:C.bool,disableFuture:C.bool,disableIgnoringDatePartForTimeValidation:C.bool,disableOpenPicker:C.bool,disablePast:C.bool,enableAccessibleFieldDOMStructure:C.any,format:C.string,formatDensity:C.oneOf(["dense","spacious"]),inputRef:Br,label:C.node,localeText:C.object,maxTime:C.object,minTime:C.object,minutesStep:C.number,name:C.string,onAccept:C.func,onChange:C.func,onClose:C.func,onError:C.func,onOpen:C.func,onSelectedSectionsChange:C.func,onViewChange:C.func,open:C.bool,openTo:C.oneOf(["hours","minutes","seconds"]),orientation:C.oneOf(["landscape","portrait"]),readOnly:C.bool,reduceAnimations:C.bool,referenceDate:C.object,selectedSections:C.oneOfType([C.oneOf(["all","day","empty","hours","meridiem","minutes","month","seconds","weekDay","year"]),C.number]),shouldDisableTime:C.func,slotProps:C.object,slots:C.object,sx:C.oneOfType([C.arrayOf(C.oneOfType([C.func,C.object,C.bool])),C.func,C.object]),timezone:C.string,value:C.object,view:C.oneOf(["hours","minutes","seconds"]),viewRenderers:C.shape({hours:C.func,minutes:C.func,seconds:C.func}),views:C.arrayOf(C.oneOf(["hours","minutes","seconds"]).isRequired)};const fT=["desktopModeMediaQuery"],mT=D.forwardRef(function(e,t){const n=Ie({props:e,name:"MuiTimePicker"}),{desktopModeMediaQuery:r=sh}=n,s=me(n,fT);return ko(r,{defaultMatches:!0})?h.jsx(Bh,_({ref:t},s)):h.jsx(Vh,_({ref:t},s))});var wl={exports:{}},gT=wl.exports;(function(i,e){(function(t,n){i.exports=n()})(gT,function(){var t="week",n="year";return function(r,s,o){var a=s.prototype;a.week=function(l){if(l===void 0&&(l=null),l!==null)return this.add(7*(l-this.week()),"day");var c=this.$locale().yearStart||1;if(this.month()===11&&this.date()>25){var u=o(this).startOf(n).add(1,n).date(c),p=o(this).endOf(t);if(u.isBefore(p))return 1}var d=o(this).startOf(n).date(c).startOf(t).subtract(1,"millisecond"),f=this.diff(d,t,!0);return f<0?o(this).startOf("week").week():Math.ceil(f)},a.weeks=function(l){return l===void 0&&(l=null),this.week(l)}}})})(wl);var vT=wl.exports;const xT=Jt(vT);var Dl={exports:{}},yT=Dl.exports;(function(i,e){(function(t,n){i.exports=n()})(yT,function(){var t={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},n=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,r=/\d/,s=/\d\d/,o=/\d\d?/,a=/\d*[^-_:/,()\s\d]+/,l={},c=function(g){return(g=+g)+(g>68?1900:2e3)},u=function(g){return function(x){this[g]=+x}},p=[/[+-]\d\d:?(\d\d)?|Z/,function(g){(this.zone||(this.zone={})).offset=function(x){if(!x||x==="Z")return 0;var y=x.match(/([+-]|\d\d)/g),w=60*y[1]+(+y[2]||0);return w===0?0:y[0]==="+"?-w:w}(g)}],d=function(g){var x=l[g];return x&&(x.indexOf?x:x.s.concat(x.f))},f=function(g,x){var y,w=l.meridiem;if(w){for(var S=1;S<=24;S+=1)if(g.indexOf(w(S,0,x))>-1){y=S>12;break}}else y=g===(x?"pm":"PM");return y},m={A:[a,function(g){this.afternoon=f(g,!1)}],a:[a,function(g){this.afternoon=f(g,!0)}],Q:[r,function(g){this.month=3*(g-1)+1}],S:[r,function(g){this.milliseconds=100*+g}],SS:[s,function(g){this.milliseconds=10*+g}],SSS:[/\d{3}/,function(g){this.milliseconds=+g}],s:[o,u("seconds")],ss:[o,u("seconds")],m:[o,u("minutes")],mm:[o,u("minutes")],H:[o,u("hours")],h:[o,u("hours")],HH:[o,u("hours")],hh:[o,u("hours")],D:[o,u("day")],DD:[s,u("day")],Do:[a,function(g){var x=l.ordinal,y=g.match(/\d+/);if(this.day=y[0],x)for(var w=1;w<=31;w+=1)x(w).replace(/\[|\]/g,"")===g&&(this.day=w)}],w:[o,u("week")],ww:[s,u("week")],M:[o,u("month")],MM:[s,u("month")],MMM:[a,function(g){var x=d("months"),y=(d("monthsShort")||x.map(function(w){return w.slice(0,3)})).indexOf(g)+1;if(y<1)throw new Error;this.month=y%12||y}],MMMM:[a,function(g){var x=d("months").indexOf(g)+1;if(x<1)throw new Error;this.month=x%12||x}],Y:[/[+-]?\d+/,u("year")],YY:[s,function(g){this.year=c(g)}],YYYY:[/\d{4}/,u("year")],Z:p,ZZ:p};function v(g){var x,y;x=g,y=l&&l.formats;for(var w=(g=x.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(A,T,W){var F=W&&W.toUpperCase();return T||y[W]||t[W]||y[F].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(j,O,R){return O||R.slice(1)})})).match(n),S=w.length,M=0;M<S;M+=1){var b=w[M],I=m[b],P=I&&I[0],E=I&&I[1];w[M]=E?{regex:P,parser:E}:b.replace(/^\[|\]$/g,"")}return function(A){for(var T={},W=0,F=0;W<S;W+=1){var j=w[W];if(typeof j=="string")F+=j.length;else{var O=j.regex,R=j.parser,B=A.slice(F),$=O.exec(B)[0];R.call(T,$),A=A.replace($,"")}}return function(J){var q=J.afternoon;if(q!==void 0){var L=J.hours;q?L<12&&(J.hours+=12):L===12&&(J.hours=0),delete J.afternoon}}(T),T}}return function(g,x,y){y.p.customParseFormat=!0,g&&g.parseTwoDigitYear&&(c=g.parseTwoDigitYear);var w=x.prototype,S=w.parse;w.parse=function(M){var b=M.date,I=M.utc,P=M.args;this.$u=I;var E=P[1];if(typeof E=="string"){var A=P[2]===!0,T=P[3]===!0,W=A||T,F=P[2];T&&(F=P[2]),l=this.$locale(),!A&&F&&(l=y.Ls[F]),this.$d=function(B,$,J,q){try{if(["x","X"].indexOf($)>-1)return new Date(($==="X"?1e3:1)*B);var L=v($)(B),Q=L.year,G=L.month,ne=L.day,U=L.hours,re=L.minutes,ie=L.seconds,Y=L.milliseconds,K=L.zone,se=L.week,ae=new Date,oe=ne||(Q||G?1:ae.getDate()),V=Q||ae.getFullYear(),z=0;Q&&!G||(z=G>0?G-1:ae.getMonth());var Z,X=U||0,H=re||0,ee=ie||0,te=Y||0;return K?new Date(Date.UTC(V,z,oe,X,H,ee,te+60*K.offset*1e3)):J?new Date(Date.UTC(V,z,oe,X,H,ee,te)):(Z=new Date(V,z,oe,X,H,ee,te),se&&(Z=q(Z).week(se).toDate()),Z)}catch{return new Date("")}}(b,E,I,y),this.init(),F&&F!==!0&&(this.$L=this.locale(F).$L),W&&b!=this.format(E)&&(this.$d=new Date("")),l={}}else if(E instanceof Array)for(var j=E.length,O=1;O<=j;O+=1){P[1]=E[O-1];var R=y.apply(this,P);if(R.isValid()){this.$d=R.$d,this.$L=R.$L,this.init();break}O===j&&(this.$d=new Date(""))}else S.call(this,M)}}})})(Dl);var bT=Dl.exports;const wT=Jt(bT);var Sl={exports:{}},DT=Sl.exports;(function(i,e){(function(t,n){i.exports=n()})(DT,function(){var t={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};return function(n,r,s){var o=r.prototype,a=o.format;s.en.formats=t,o.format=function(l){l===void 0&&(l="YYYY-MM-DDTHH:mm:ssZ");var c=this.$locale().formats,u=function(p,d){return p.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(f,m,v){var g=v&&v.toUpperCase();return m||d[v]||t[v]||d[g].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(x,y,w){return y||w.slice(1)})})}(l,c===void 0?{}:c);return a.call(this,u)}}})})(Sl);var ST=Sl.exports;const IT=Jt(ST);var Il={exports:{}},CT=Il.exports;(function(i,e){(function(t,n){i.exports=n()})(CT,function(){return function(t,n,r){n.prototype.isBetween=function(s,o,a,l){var c=r(s),u=r(o),p=(l=l||"()")[0]==="(",d=l[1]===")";return(p?this.isAfter(c,a):!this.isBefore(c,a))&&(d?this.isBefore(u,a):!this.isAfter(u,a))||(p?this.isBefore(c,a):!this.isAfter(c,a))&&(d?this.isAfter(u,a):!this.isBefore(u,a))}}})})(Il);var _T=Il.exports;const MT=Jt(_T);var Cl={exports:{}},kT=Cl.exports;(function(i,e){(function(t,n){i.exports=n()})(kT,function(){return function(t,n){var r=n.prototype,s=r.format;r.format=function(o){var a=this,l=this.$locale();if(!this.isValid())return s.bind(this)(o);var c=this.$utils(),u=(o||"YYYY-MM-DDTHH:mm:ssZ").replace(/\[([^\]]+)]|Q|wo|ww|w|WW|W|zzz|z|gggg|GGGG|Do|X|x|k{1,2}|S/g,function(p){switch(p){case"Q":return Math.ceil((a.$M+1)/3);case"Do":return l.ordinal(a.$D);case"gggg":return a.weekYear();case"GGGG":return a.isoWeekYear();case"wo":return l.ordinal(a.week(),"W");case"w":case"ww":return c.s(a.week(),p==="w"?1:2,"0");case"W":case"WW":return c.s(a.isoWeek(),p==="W"?1:2,"0");case"k":case"kk":return c.s(String(a.$H===0?24:a.$H),p==="k"?1:2,"0");case"X":return Math.floor(a.$d.getTime()/1e3);case"x":return a.$d.getTime();case"z":return"["+a.offsetName()+"]";case"zzz":return"["+a.offsetName("long")+"]";default:return p}});return s.bind(this)(u)}}})})(Cl);var TT=Cl.exports;const PT=Jt(TT);Be.extend(IT);Be.extend(xT);Be.extend(MT);Be.extend(PT);const OT={YY:"year",YYYY:{sectionType:"year",contentType:"digit",maxLength:4},M:{sectionType:"month",contentType:"digit",maxLength:2},MM:"month",MMM:{sectionType:"month",contentType:"letter"},MMMM:{sectionType:"month",contentType:"letter"},D:{sectionType:"day",contentType:"digit",maxLength:2},DD:"day",Do:{sectionType:"day",contentType:"digit-with-letter"},d:{sectionType:"weekDay",contentType:"digit",maxLength:2},dd:{sectionType:"weekDay",contentType:"letter"},ddd:{sectionType:"weekDay",contentType:"letter"},dddd:{sectionType:"weekDay",contentType:"letter"},A:"meridiem",a:"meridiem",H:{sectionType:"hours",contentType:"digit",maxLength:2},HH:"hours",h:{sectionType:"hours",contentType:"digit",maxLength:2},hh:"hours",m:{sectionType:"minutes",contentType:"digit",maxLength:2},mm:"minutes",s:{sectionType:"seconds",contentType:"digit",maxLength:2},ss:"seconds"},jT={year:"YYYY",month:"MMMM",monthShort:"MMM",dayOfMonth:"D",dayOfMonthFull:"Do",weekday:"dddd",weekdayShort:"dd",hours24h:"HH",hours12h:"hh",meridiem:"A",minutes:"mm",seconds:"ss",fullDate:"ll",keyboardDate:"L",shortDate:"MMM D",normalDate:"D MMMM",normalDateWithWeekday:"ddd, MMM D",fullTime:"LT",fullTime12h:"hh:mm A",fullTime24h:"HH:mm",keyboardDateTime:"L LT",keyboardDateTime12h:"L hh:mm A",keyboardDateTime24h:"L HH:mm"},Ks=["Missing UTC plugin","To be able to use UTC or timezones, you have to enable the `utc` plugin","Find more information on https://mui.com/x/react-date-pickers/timezone/#day-js-and-utc"].join(`
`),kd=["Missing timezone plugin","To be able to use timezones, you have to enable both the `utc` and the `timezone` plugin","Find more information on https://mui.com/x/react-date-pickers/timezone/#day-js-and-timezone"].join(`
`),ET=(i,e)=>e?(...t)=>i(...t).locale(e):i;class zh{constructor({locale:e,formats:t}={}){this.isMUIAdapter=!0,this.isTimezoneCompatible=!0,this.lib="dayjs",this.dayjs=void 0,this.locale=void 0,this.formats=void 0,this.escapedCharacters={start:"[",end:"]"},this.formatTokenMap=OT,this.setLocaleToValue=n=>{const r=this.getCurrentLocaleCode();return r===n.locale()?n:n.locale(r)},this.hasUTCPlugin=()=>typeof Be.utc<"u",this.hasTimezonePlugin=()=>typeof Be.tz<"u",this.isSame=(n,r,s)=>{const o=this.setTimezone(r,this.getTimezone(n));return n.format(s)===o.format(s)},this.cleanTimezone=n=>{switch(n){case"default":return;case"system":return Be.tz.guess();default:return n}},this.createSystemDate=n=>{if(this.hasUTCPlugin()&&this.hasTimezonePlugin()){const r=Be.tz.guess();return r!=="UTC"?Be.tz(n,r):Be(n)}return Be(n)},this.createUTCDate=n=>{if(!this.hasUTCPlugin())throw new Error(Ks);return Be.utc(n)},this.createTZDate=(n,r)=>{if(!this.hasUTCPlugin())throw new Error(Ks);if(!this.hasTimezonePlugin())throw new Error(kd);const s=n!==void 0&&!n.endsWith("Z");return Be(n).tz(this.cleanTimezone(r),s)},this.getLocaleFormats=()=>{const n=Be.Ls,r=this.locale||"en";let s=n[r];return s===void 0&&(s=n.en),s.formats},this.adjustOffset=n=>{if(!this.hasTimezonePlugin())return n;const r=this.getTimezone(n);if(r!=="UTC"){const s=n.tz(this.cleanTimezone(r),!0);if(s.$offset===(n.$offset??0))return n;n.$offset=s.$offset}return n},this.date=(n,r="default")=>{if(n===null)return null;let s;return r==="UTC"?s=this.createUTCDate(n):r==="system"||r==="default"&&!this.hasTimezonePlugin()?s=this.createSystemDate(n):s=this.createTZDate(n,r),this.locale===void 0?s:s.locale(this.locale)},this.getInvalidDate=()=>Be(new Date("Invalid date")),this.getTimezone=n=>{var r;if(this.hasTimezonePlugin()){const s=(r=n.$x)==null?void 0:r.$timezone;if(s)return s}return this.hasUTCPlugin()&&n.isUTC()?"UTC":"system"},this.setTimezone=(n,r)=>{if(this.getTimezone(n)===r)return n;if(r==="UTC"){if(!this.hasUTCPlugin())throw new Error(Ks);return n.utc()}if(r==="system")return n.local();if(!this.hasTimezonePlugin()){if(r==="default")return n;throw new Error(kd)}return Be.tz(n,this.cleanTimezone(r))},this.toJsDate=n=>n.toDate(),this.parse=(n,r)=>n===""?null:this.dayjs(n,r,this.locale,!0),this.getCurrentLocaleCode=()=>this.locale||"en",this.is12HourCycleInCurrentLocale=()=>/A|a/.test(this.getLocaleFormats().LT||""),this.expandFormat=n=>{const r=this.getLocaleFormats(),s=o=>o.replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(a,l,c)=>l||c.slice(1));return n.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(o,a,l)=>{const c=l&&l.toUpperCase();return a||r[l]||s(r[c])})},this.isValid=n=>n==null?!1:n.isValid(),this.format=(n,r)=>this.formatByString(n,this.formats[r]),this.formatByString=(n,r)=>this.dayjs(n).format(r),this.formatNumber=n=>n,this.isEqual=(n,r)=>n===null&&r===null?!0:n===null||r===null?!1:n.toDate().getTime()===r.toDate().getTime(),this.isSameYear=(n,r)=>this.isSame(n,r,"YYYY"),this.isSameMonth=(n,r)=>this.isSame(n,r,"YYYY-MM"),this.isSameDay=(n,r)=>this.isSame(n,r,"YYYY-MM-DD"),this.isSameHour=(n,r)=>n.isSame(r,"hour"),this.isAfter=(n,r)=>n>r,this.isAfterYear=(n,r)=>this.hasUTCPlugin()?!this.isSameYear(n,r)&&n.utc()>r.utc():n.isAfter(r,"year"),this.isAfterDay=(n,r)=>this.hasUTCPlugin()?!this.isSameDay(n,r)&&n.utc()>r.utc():n.isAfter(r,"day"),this.isBefore=(n,r)=>n<r,this.isBeforeYear=(n,r)=>this.hasUTCPlugin()?!this.isSameYear(n,r)&&n.utc()<r.utc():n.isBefore(r,"year"),this.isBeforeDay=(n,r)=>this.hasUTCPlugin()?!this.isSameDay(n,r)&&n.utc()<r.utc():n.isBefore(r,"day"),this.isWithinRange=(n,[r,s])=>n>=r&&n<=s,this.startOfYear=n=>this.adjustOffset(n.startOf("year")),this.startOfMonth=n=>this.adjustOffset(n.startOf("month")),this.startOfWeek=n=>this.adjustOffset(this.setLocaleToValue(n).startOf("week")),this.startOfDay=n=>this.adjustOffset(n.startOf("day")),this.endOfYear=n=>this.adjustOffset(n.endOf("year")),this.endOfMonth=n=>this.adjustOffset(n.endOf("month")),this.endOfWeek=n=>this.adjustOffset(this.setLocaleToValue(n).endOf("week")),this.endOfDay=n=>this.adjustOffset(n.endOf("day")),this.addYears=(n,r)=>this.adjustOffset(r<0?n.subtract(Math.abs(r),"year"):n.add(r,"year")),this.addMonths=(n,r)=>this.adjustOffset(r<0?n.subtract(Math.abs(r),"month"):n.add(r,"month")),this.addWeeks=(n,r)=>this.adjustOffset(r<0?n.subtract(Math.abs(r),"week"):n.add(r,"week")),this.addDays=(n,r)=>this.adjustOffset(r<0?n.subtract(Math.abs(r),"day"):n.add(r,"day")),this.addHours=(n,r)=>this.adjustOffset(r<0?n.subtract(Math.abs(r),"hour"):n.add(r,"hour")),this.addMinutes=(n,r)=>this.adjustOffset(r<0?n.subtract(Math.abs(r),"minute"):n.add(r,"minute")),this.addSeconds=(n,r)=>this.adjustOffset(r<0?n.subtract(Math.abs(r),"second"):n.add(r,"second")),this.getYear=n=>n.year(),this.getMonth=n=>n.month(),this.getDate=n=>n.date(),this.getHours=n=>n.hour(),this.getMinutes=n=>n.minute(),this.getSeconds=n=>n.second(),this.getMilliseconds=n=>n.millisecond(),this.setYear=(n,r)=>this.adjustOffset(n.set("year",r)),this.setMonth=(n,r)=>this.adjustOffset(n.set("month",r)),this.setDate=(n,r)=>this.adjustOffset(n.set("date",r)),this.setHours=(n,r)=>this.adjustOffset(n.set("hour",r)),this.setMinutes=(n,r)=>this.adjustOffset(n.set("minute",r)),this.setSeconds=(n,r)=>this.adjustOffset(n.set("second",r)),this.setMilliseconds=(n,r)=>this.adjustOffset(n.set("millisecond",r)),this.getDaysInMonth=n=>n.daysInMonth(),this.getWeekArray=n=>{const r=this.startOfWeek(this.startOfMonth(n)),s=this.endOfWeek(this.endOfMonth(n));let o=0,a=r;const l=[];for(;a<s;){const c=Math.floor(o/7);l[c]=l[c]||[],l[c].push(a),a=this.addDays(a,1),o+=1}return l},this.getWeekNumber=n=>n.week(),this.getYearRange=([n,r])=>{const s=this.startOfYear(n),o=this.endOfYear(r),a=[];let l=s;for(;this.isBefore(l,o);)a.push(l),l=this.addYears(l,1);return a},this.dayjs=ET(Be,e),this.locale=e,this.formats=_({},jT,t),Be.extend(wT)}getDayOfWeek(e){return e.day()+1}}var Hh={exports:{}},RT=Hh.exports;(function(i,e){(function(t,n){i.exports=n(Ot)})(RT,function(t){function n(l){return l&&typeof l=="object"&&"default"in l?l:{default:l}}var r=n(t),s={s:"ein paar Sekunden",m:["eine Minute","einer Minute"],mm:"%d Minuten",h:["eine Stunde","einer Stunde"],hh:"%d Stunden",d:["ein Tag","einem Tag"],dd:["%d Tage","%d Tagen"],M:["ein Monat","einem Monat"],MM:["%d Monate","%d Monaten"],y:["ein Jahr","einem Jahr"],yy:["%d Jahre","%d Jahren"]};function o(l,c,u){var p=s[u];return Array.isArray(p)&&(p=p[c?0:1]),p.replace("%d",l)}var a={name:"de",weekdays:"Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag".split("_"),weekdaysShort:"So._Mo._Di._Mi._Do._Fr._Sa.".split("_"),weekdaysMin:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),months:"Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jan._Feb._März_Apr._Mai_Juni_Juli_Aug._Sept._Okt._Nov._Dez.".split("_"),ordinal:function(l){return l+"."},weekStart:1,yearStart:4,formats:{LTS:"HH:mm:ss",LT:"HH:mm",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd, D. MMMM YYYY HH:mm"},relativeTime:{future:"in %s",past:"vor %s",s:o,m:o,mm:o,h:o,hh:o,d:o,dd:o,M:o,MM:o,y:o,yy:o}};return r.default.locale(a,null,!0),a})})(Hh);var qh={exports:{}},AT=qh.exports;(function(i,e){(function(t,n){i.exports=n()})(AT,function(){return{name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(t){var n=["th","st","nd","rd"],r=t%100;return"["+t+(n[(r-20)%10]||n[r]||n[0])+"]"}}})})(qh);var Uh={exports:{}},NT=Uh.exports;(function(i,e){(function(t,n){i.exports=n(Ot)})(NT,function(t){function n(m){return m&&typeof m=="object"&&"default"in m?m:{default:m}}var r=n(t),s="января_февраля_марта_апреля_мая_июня_июля_августа_сентября_октября_ноября_декабря".split("_"),o="январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь".split("_"),a="янв._февр._мар._апр._мая_июня_июля_авг._сент._окт._нояб._дек.".split("_"),l="янв._февр._март_апр._май_июнь_июль_авг._сент._окт._нояб._дек.".split("_"),c=/D[oD]?(\[[^[\]]*\]|\s)+MMMM?/;function u(m,v,g){var x,y;return g==="m"?v?"минута":"минуту":m+" "+(x=+m,y={mm:v?"минута_минуты_минут":"минуту_минуты_минут",hh:"час_часа_часов",dd:"день_дня_дней",MM:"месяц_месяца_месяцев",yy:"год_года_лет"}[g].split("_"),x%10==1&&x%100!=11?y[0]:x%10>=2&&x%10<=4&&(x%100<10||x%100>=20)?y[1]:y[2])}var p=function(m,v){return c.test(v)?s[m.month()]:o[m.month()]};p.s=o,p.f=s;var d=function(m,v){return c.test(v)?a[m.month()]:l[m.month()]};d.s=l,d.f=a;var f={name:"ru",weekdays:"воскресенье_понедельник_вторник_среда_четверг_пятница_суббота".split("_"),weekdaysShort:"вск_пнд_втр_срд_чтв_птн_сбт".split("_"),weekdaysMin:"вс_пн_вт_ср_чт_пт_сб".split("_"),months:p,monthsShort:d,weekStart:1,yearStart:4,formats:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY г.",LLL:"D MMMM YYYY г., H:mm",LLLL:"dddd, D MMMM YYYY г., H:mm"},relativeTime:{future:"через %s",past:"%s назад",s:"несколько секунд",m:u,mm:u,h:"час",hh:u,d:"день",dd:u,M:"месяц",MM:u,y:"год",yy:u},ordinal:function(m){return m},meridiem:function(m){return m<4?"ночи":m<12?"утра":m<17?"дня":"вечера"}};return r.default.locale(f,null,!0),f})})(Uh);var Yh={exports:{}},$T=Yh.exports;(function(i,e){(function(t,n){i.exports=n(Ot)})($T,function(t){function n(o){return o&&typeof o=="object"&&"default"in o?o:{default:o}}var r=n(t),s={name:"zh-cn",weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"周日_周一_周二_周三_周四_周五_周六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),ordinal:function(o,a){return a==="W"?o+"周":o+"日"},weekStart:1,yearStart:4,formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日Ah点mm分",LLLL:"YYYY年M月D日ddddAh点mm分",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},relativeTime:{future:"%s内",past:"%s前",s:"几秒",m:"1 分钟",mm:"%d 分钟",h:"1 小时",hh:"%d 小时",d:"1 天",dd:"%d 天",M:"1 个月",MM:"%d 个月",y:"1 年",yy:"%d 年"},meridiem:function(o,a){var l=100*o+a;return l<600?"凌晨":l<900?"早上":l<1100?"上午":l<1300?"中午":l<1800?"下午":"晚上"}};return r.default.locale(s,null,!0),s})})(Yh);var Gh={exports:{}},WT=Gh.exports;(function(i,e){(function(t,n){i.exports=n(Ot)})(WT,function(t){function n(p){return p&&typeof p=="object"&&"default"in p?p:{default:p}}var r=n(t),s="січня_лютого_березня_квітня_травня_червня_липня_серпня_вересня_жовтня_листопада_грудня".split("_"),o="січень_лютий_березень_квітень_травень_червень_липень_серпень_вересень_жовтень_листопад_грудень".split("_"),a=/D[oD]?(\[[^[\]]*\]|\s)+MMMM?/;function l(p,d,f){var m,v;return f==="m"?d?"хвилина":"хвилину":f==="h"?d?"година":"годину":p+" "+(m=+p,v={ss:d?"секунда_секунди_секунд":"секунду_секунди_секунд",mm:d?"хвилина_хвилини_хвилин":"хвилину_хвилини_хвилин",hh:d?"година_години_годин":"годину_години_годин",dd:"день_дні_днів",MM:"місяць_місяці_місяців",yy:"рік_роки_років"}[f].split("_"),m%10==1&&m%100!=11?v[0]:m%10>=2&&m%10<=4&&(m%100<10||m%100>=20)?v[1]:v[2])}var c=function(p,d){return a.test(d)?s[p.month()]:o[p.month()]};c.s=o,c.f=s;var u={name:"uk",weekdays:"неділя_понеділок_вівторок_середа_четвер_п’ятниця_субота".split("_"),weekdaysShort:"ндл_пнд_втр_срд_чтв_птн_сбт".split("_"),weekdaysMin:"нд_пн_вт_ср_чт_пт_сб".split("_"),months:c,monthsShort:"січ_лют_бер_квіт_трав_черв_лип_серп_вер_жовт_лист_груд".split("_"),weekStart:1,relativeTime:{future:"за %s",past:"%s тому",s:"декілька секунд",m:l,mm:l,h:l,hh:l,d:"день",dd:l,M:"місяць",MM:l,y:"рік",yy:l},ordinal:function(p){return p},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY р.",LLL:"D MMMM YYYY р., HH:mm",LLLL:"dddd, D MMMM YYYY р., HH:mm"}};return r.default.locale(u,null,!0),u})})(Gh);var Jh={exports:{}},FT=Jh.exports;(function(i,e){(function(t,n){i.exports=n(Ot)})(FT,function(t){function n(o){return o&&typeof o=="object"&&"default"in o?o:{default:o}}var r=n(t),s={name:"it",weekdays:"domenica_lunedì_martedì_mercoledì_giovedì_venerdì_sabato".split("_"),weekdaysShort:"dom_lun_mar_mer_gio_ven_sab".split("_"),weekdaysMin:"do_lu_ma_me_gi_ve_sa".split("_"),months:"gennaio_febbraio_marzo_aprile_maggio_giugno_luglio_agosto_settembre_ottobre_novembre_dicembre".split("_"),weekStart:1,monthsShort:"gen_feb_mar_apr_mag_giu_lug_ago_set_ott_nov_dic".split("_"),formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},relativeTime:{future:"tra %s",past:"%s fa",s:"qualche secondo",m:"un minuto",mm:"%d minuti",h:"un' ora",hh:"%d ore",d:"un giorno",dd:"%d giorni",M:"un mese",MM:"%d mesi",y:"un anno",yy:"%d anni"},ordinal:function(o){return o+"º"}};return r.default.locale(s,null,!0),s})})(Jh);var Kh={exports:{}},LT=Kh.exports;(function(i,e){(function(t,n){i.exports=n(Ot)})(LT,function(t){function n(o){return o&&typeof o=="object"&&"default"in o?o:{default:o}}var r=n(t),s={name:"fr",weekdays:"dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"),weekdaysShort:"dim._lun._mar._mer._jeu._ven._sam.".split("_"),weekdaysMin:"di_lu_ma_me_je_ve_sa".split("_"),months:"janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre".split("_"),monthsShort:"janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.".split("_"),weekStart:1,yearStart:4,formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},relativeTime:{future:"dans %s",past:"il y a %s",s:"quelques secondes",m:"une minute",mm:"%d minutes",h:"une heure",hh:"%d heures",d:"un jour",dd:"%d jours",M:"un mois",MM:"%d mois",y:"un an",yy:"%d ans"},ordinal:function(o){return""+o+(o===1?"er":"")}};return r.default.locale(s,null,!0),s})})(Kh);var Xh={exports:{}},BT=Xh.exports;(function(i,e){(function(t,n){i.exports=n(Ot)})(BT,function(t){function n(o){return o&&typeof o=="object"&&"default"in o?o:{default:o}}var r=n(t),s={name:"es",monthsShort:"ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_"),weekdays:"domingo_lunes_martes_miércoles_jueves_viernes_sábado".split("_"),weekdaysShort:"dom._lun._mar._mié._jue._vie._sáb.".split("_"),weekdaysMin:"do_lu_ma_mi_ju_vi_sá".split("_"),months:"enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"),weekStart:1,formats:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY H:mm",LLLL:"dddd, D [de] MMMM [de] YYYY H:mm"},relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un día",dd:"%d días",M:"un mes",MM:"%d meses",y:"un año",yy:"%d años"},ordinal:function(o){return o+"º"}};return r.default.locale(s,null,!0),s})})(Xh);var Zh={exports:{}},VT=Zh.exports;(function(i,e){(function(t,n){i.exports=n(Ot)})(VT,function(t){function n(d){return d&&typeof d=="object"&&"default"in d?d:{default:d}}var r=n(t);function s(d){return d%10<5&&d%10>1&&~~(d/10)%10!=1}function o(d,f,m){var v=d+" ";switch(m){case"m":return f?"minuta":"minutę";case"mm":return v+(s(d)?"minuty":"minut");case"h":return f?"godzina":"godzinę";case"hh":return v+(s(d)?"godziny":"godzin");case"MM":return v+(s(d)?"miesiące":"miesięcy");case"yy":return v+(s(d)?"lata":"lat")}}var a="stycznia_lutego_marca_kwietnia_maja_czerwca_lipca_sierpnia_września_października_listopada_grudnia".split("_"),l="styczeń_luty_marzec_kwiecień_maj_czerwiec_lipiec_sierpień_wrzesień_październik_listopad_grudzień".split("_"),c=/D MMMM/,u=function(d,f){return c.test(f)?a[d.month()]:l[d.month()]};u.s=l,u.f=a;var p={name:"pl",weekdays:"niedziela_poniedziałek_wtorek_środa_czwartek_piątek_sobota".split("_"),weekdaysShort:"ndz_pon_wt_śr_czw_pt_sob".split("_"),weekdaysMin:"Nd_Pn_Wt_Śr_Cz_Pt_So".split("_"),months:u,monthsShort:"sty_lut_mar_kwi_maj_cze_lip_sie_wrz_paź_lis_gru".split("_"),ordinal:function(d){return d+"."},weekStart:1,yearStart:4,relativeTime:{future:"za %s",past:"%s temu",s:"kilka sekund",m:o,mm:o,h:o,hh:o,d:"1 dzień",dd:"%d dni",M:"miesiąc",MM:o,y:"rok",yy:o},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"}};return r.default.locale(p,null,!0),p})})(Zh);var Qh={exports:{}},zT=Qh.exports;(function(i,e){(function(t,n){i.exports=n(Ot)})(zT,function(t){function n(o){return o&&typeof o=="object"&&"default"in o?o:{default:o}}var r=n(t),s={name:"pt",weekdays:"domingo_segunda-feira_terça-feira_quarta-feira_quinta-feira_sexta-feira_sábado".split("_"),weekdaysShort:"dom_seg_ter_qua_qui_sex_sab".split("_"),weekdaysMin:"Do_2ª_3ª_4ª_5ª_6ª_Sa".split("_"),months:"janeiro_fevereiro_março_abril_maio_junho_julho_agosto_setembro_outubro_novembro_dezembro".split("_"),monthsShort:"jan_fev_mar_abr_mai_jun_jul_ago_set_out_nov_dez".split("_"),ordinal:function(o){return o+"º"},weekStart:1,yearStart:4,formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY [às] HH:mm",LLLL:"dddd, D [de] MMMM [de] YYYY [às] HH:mm"},relativeTime:{future:"em %s",past:"há %s",s:"alguns segundos",m:"um minuto",mm:"%d minutos",h:"uma hora",hh:"%d horas",d:"um dia",dd:"%d dias",M:"um mês",MM:"%d meses",y:"um ano",yy:"%d anos"}};return r.default.locale(s,null,!0),s})})(Qh);var ef={exports:{}},HT=ef.exports;(function(i,e){(function(t,n){i.exports=n(Ot)})(HT,function(t){function n(o){return o&&typeof o=="object"&&"default"in o?o:{default:o}}var r=n(t),s={name:"nl",weekdays:"zondag_maandag_dinsdag_woensdag_donderdag_vrijdag_zaterdag".split("_"),weekdaysShort:"zo._ma._di._wo._do._vr._za.".split("_"),weekdaysMin:"zo_ma_di_wo_do_vr_za".split("_"),months:"januari_februari_maart_april_mei_juni_juli_augustus_september_oktober_november_december".split("_"),monthsShort:"jan_feb_mrt_apr_mei_jun_jul_aug_sep_okt_nov_dec".split("_"),ordinal:function(o){return"["+o+(o===1||o===8||o>=20?"ste":"de")+"]"},weekStart:1,yearStart:4,formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},relativeTime:{future:"over %s",past:"%s geleden",s:"een paar seconden",m:"een minuut",mm:"%d minuten",h:"een uur",hh:"%d uur",d:"een dag",dd:"%d dagen",M:"een maand",MM:"%d maanden",y:"een jaar",yy:"%d jaar"}};return r.default.locale(s,null,!0),s})})(ef);const qT={textRoot:{"& .MuiInputBase-root":{width:"100%",height:"100%"}}};class _l extends xe{EASY_DATE_FORMAT="DD.MM.YYYY";static getWidgetInfo(){return{id:"tplJquiInputDate",visSet:"jqui",visName:"Input Date",visWidgetLabel:"jqui_input_date",visPrev:"widgets/jqui/img/Prev_InputDate.png",visOrder:30,visAttrs:[{name:"common",fields:[{name:"oid",type:"id"},{name:"variant",label:"jqui_variant",type:"select",options:[{label:"standard",value:"standard"},{label:"outlined",value:"outlined"},{label:"filled",value:"filled"}],default:"standard"},{name:"autoFocus",type:"checkbox"},{name:"clearable",label:"jqui_clearable",type:"checkbox"},{name:"widgetTitle",label:"jqui_widgetTitle",type:"text"},{name:"disableFuture",label:"jqui_disableFuture",type:"checkbox",hidden:"!!data.disablePast"},{name:"disablePast",label:"jqui_disablePast",type:"checkbox",hidden:"!!data.disableFuture"},{name:"asFullDate",label:"jqui_asFullDate",type:"checkbox"},{name:"displayWeekNumber",label:"jqui_displayWeekNumber",type:"checkbox"},{name:"wideFormat",label:"jqui_wideFormat",type:"checkbox"}]}],visDefaultStyle:{width:250,height:56}}}getWidgetInfo(){return _l.getWidgetInfo()}renderWidgetBody(e){return super.renderWidgetBody(e),e.style.overflow="visible",h.jsx("div",{className:"vis-widget-body",children:h.jsx(ll,{dateAdapter:zh,adapterLocale:this.props.context.lang,children:h.jsx(Gk,{value:this.state.rxData.asFullDate?Be(this.state.values[`${this.state.rxData.oid}.val`])||"":Be(this.state.values[`${this.state.rxData.oid}.val`],this.EASY_DATE_FORMAT),label:this.state.rxData.widgetTitle||null,autoFocus:this.state.rxData.autoFocus||!1,onChange:t=>{if(!t)return;const n=this.state.rxData.asFullDate?t.toDate().toString():t.format(this.EASY_DATE_FORMAT);this.props.context.setValue(this.state.rxData.oid,n)},formatDensity:this.state.rxData.wideFormat?"spacious":"dense",slotProps:{textField:{variant:this.state.rxData.variant||"standard",style:{width:"100%",height:"100%"},sx:qT.textRoot},field:{clearable:this.state.rxData.clearable,onClear:()=>this.props.context.setValue(this.state.rxData.oid,"")}},disableFuture:this.state.rxData.disableFuture||!1,disablePast:this.state.rxData.disablePast||!1,displayWeekNumber:this.state.rxData.displayWeekNumber||!1})})})}}const UT={textRoot:{"& .MuiInputBase-root":{width:"100%",height:"100%"}}};class Ml extends xe{static getWidgetInfo(){return{id:"tplJquiInputDatetime",visSet:"jqui",visName:"Input Time",visWidgetLabel:"jqui_input_time",visPrev:"widgets/jqui/img/Prev_InputDateTime.png",visOrder:31,visAttrs:[{name:"common",fields:[{name:"oid",type:"id"},{name:"variant",label:"jqui_variant",type:"select",options:[{label:"standard",value:"standard"},{label:"outlined",value:"outlined"},{label:"filled",value:"filled"}],default:"standard"},{name:"autoFocus",type:"checkbox"},{name:"clearable",label:"jqui_clearable",type:"checkbox"},{name:"widgetTitle",label:"jqui_widgetTitle",type:"text"},{name:"ampm",label:"jqui_ampm",type:"checkbox"},{name:"asDate",label:"jqui_asDate",type:"checkbox"},{name:"stepMinute",label:"jqui_stepMinute",type:"select",options:[{label:"1 minute",value:1},{label:"2 minutes",value:2},{label:"3 minutes",value:3},{label:"4 minutes",value:4},{label:"5 minutes",value:5},{label:"10 minutes",value:10},{label:"15 minutes",value:15},{label:"20 minutes",value:20},{label:"30 minutes",value:30},{label:"60 minutes",value:60}]}]}],visDefaultStyle:{width:250,height:56}}}getWidgetInfo(){return Ml.getWidgetInfo()}renderWidgetBody(e){super.renderWidgetBody(e);const t=this.state.values[`${this.state.rxData.oid}.val`],n=this.state.rxData.asDate;return e.style.overflow="visible",h.jsx("div",{className:"vis-widget-body",children:h.jsx(ll,{dateAdapter:zh,adapterLocale:this.props.context.lang,children:h.jsx(mT,{value:t&&!n?Be(t,"HH:mm"):Be(t),ampm:this.state.rxData.ampm||!1,minutesStep:parseInt(this.state.rxData.stepMinute,10)||1,label:this.state.rxData.widgetTitle||null,formatDensity:"dense",format:"HH:mm",autoFocus:this.state.rxData.autoFocus||!1,onChange:r=>{if(!r)return;const s=n?r.second(0).millisecond(0).toDate().toString():r.format("HH:mm");this.props.context.setValue(this.state.rxData.oid,s)},slotProps:{textField:{variant:this.state.rxData.variant||"standard",style:{width:"100%",height:"100%"},sx:UT.textRoot},field:{clearable:this.state.rxData.clearable,onClear:()=>this.props.context.setValue(this.state.rxData.oid,"")}}})})})}}class kl extends Ze{static getWidgetInfo(){const t={id:"tplJquiToogle",visSet:"jqui",visName:"Icon Toggle",visWidgetLabel:"jqui_icon_toggle",visPrev:"widgets/jqui/img/Prev_IconToggle.png",visOrder:32,visAttrs:Ze.getWidgetInfo().visAttrs,visDefaultStyle:{width:92,height:36}};t.visAttrs[0].fields.unshift({name:"_note",type:"help",text:"jqui_button_binary_control_note"});const n=Ze.findField(t,"icon_false");n&&(n.default="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBmaWxsPSJjdXJyZW50Q29sb3IiIGQ9Ik0xMyAzaC0ydjEwaDJWM3ptNC44MyAyLjE3bC0xLjQyIDEuNDJBNi45MiA2LjkyIDAgMCAxIDE5IDEyYzAgMy44Ny0zLjEzIDctNyA3QTYuOTk1IDYuOTk1IDAgMCAxIDcuNTggNi41OEw2LjE3IDUuMTdBOC45MzIgOC45MzIgMCAwIDAgMyAxMmE5IDkgMCAwIDAgMTggMGMwLTIuNzQtMS4yMy01LjE4LTMuMTctNi44M3oiLz48L3N2Zz4=");const r=Ze.findField(t,"color_true");return r&&(r.default="#93ff93"),t}getWidgetInfo(){return kl.getWidgetInfo()}}class Tl extends xe{static getWidgetInfo(){return{id:"tplSTab",visSet:"tabs",visName:"SliderTabs",visSetLabel:"Tabs",visPrev:"widgets/tabs/img/Prev_SliderTabs.png",visWidgetLabel:"vis_2_widgets_widgets_tabs_label",visSetIcon:"widgets/tabs/img/Prev_SliderTabs.png",visAttrs:[{name:"common",fields:[{name:"show_tabs",type:"slider",min:1,max:20,label:"vis_2_widgets_widgets_tabs_show_tabs",default:2},{name:"vertical",type:"checkbox",label:"vis_2_widgets_widgets_tabs_vertical"},{name:"variant",type:"select",label:"vis_2_widgets_widgets_tabs_variant",hidden:"!!data.vertical",options:[{value:"",label:"vis_2_widgets_widgets_tabs_variant_default"},{value:"centered",label:"vis_2_widgets_widgets_tabs_variant_centered"},{value:"fullWidth",label:"vis_2_widgets_widgets_tabs_variant_full_width"}]},{name:"color",type:"color",label:"vis_2_widgets_widgets_tabs_color"}]},{name:"node",label:"vis_2_widgets_widgets_tabs_group_tab",indexFrom:1,indexTo:"show_tabs",fields:[{name:"title_tab_",label:"vis_2_widgets_widgets_tabs_tab_title"},{name:"contains_view_",multiple:!1,type:"select-views",label:"vis_2_widgets_widgets_tabs_tab_view"},{name:"icon_tab_",type:"icon64",label:"vis_2_widgets_widgets_tabs_tab_icon",hidden:'!!data["image_tab_" + index"]'},{name:"image_tab_",type:"image",label:"vis_2_widgets_widgets_tabs_tab_image",hidden:'!!data["icon_tab_" + index"]'},{name:"icon_size_",type:"slider",min:0,max:100,label:"vis_2_widgets_widgets_tabs_tab_icon_size",hidden:'!data["icon_tab_" + index"] && !data["image_tab_" + index"]'},{name:"icon_color_",type:"color",label:"vis_2_widgets_widgets_tabs_tab_icon_color",hidden:'!data["icon_tab_" + index"]'},{name:"overflow_x_",label:"vis_2_widgets_widgets_tabs_tab_overflow_x",type:"select",noTranslation:!0,options:["","visible","hidden","scroll","auto","initial","inherit"]},{name:"overflow_y_",label:"vis_2_widgets_widgets_tabs_tab_overflow_y",type:"select",noTranslation:!0,options:["","visible","hidden","scroll","auto","initial","inherit"]}]}],visDefaultStyle:{width:250,height:250}}}componentDidMount(){super.componentDidMount();const e=window.localStorage.getItem(`${this.props.id}-tabIndex`);let t=0;e&&(t=parseInt(e,10)||0),this.setState({tabIndex:t})}getWidgetInfo(){return Tl.getWidgetInfo()}getWidgetView(){const e=this.state.rxData[`contains_view_${this.state.tabIndex+1}`],t={flex:1,position:"relative"},n=this.state.rxData[`overflow_x_${this.state.tabIndex+1}`],r=this.state.rxData[`overflow_y_${this.state.tabIndex+1}`];return n&&r?r===n?t.overflow=n:(t.overflowX=n,t.overflowY=r):n?t.overflowX=n:r?t.overflowY=r:t.overflow="hidden",h.jsxs("div",{className:"vis-widget-body",style:t,children:[this.state.editMode?h.jsx("div",{className:"vis-editmode-helper"}):null,e?super.getWidgetView(e):null]})}renderWidgetBody(e){super.renderWidgetBody(e),e.style.width===void 0&&(e.style.width=250),e.style.height===void 0&&(e.style.height=250);const t=[];for(let n=0;n<parseInt(this.state.rxData.show_tabs,10);n++){const r=this.state.rxData[`icon_color_${n+1}`],s=this.state.rxData[`icon_tab_${n+1}`];let o=this.state.rxData[`image_tab_${n+1}`];const a=this.state.rxData[`icon_size_${n+1}`],l=this.state.rxData[`title_tab_${n+1}`];o&&o.startsWith("_PRJ_NAME/")&&(o=o.replace("_PRJ_NAME/",`../${this.props.context.adapterName}.${this.props.context.instance}/${this.props.context.projectName}/`)),t.push(h.jsx(k.Tab,{label:l||(s||o?"":`Tab ${n+1}`),icon:s?h.jsx(N.Icon,{src:s,style:{color:r,width:a,height:a}}):o?h.jsx(N.Icon,{src:o,style:{width:a,height:a}}):null,iconPosition:"start",value:n,style:{color:this.state.rxData.color,textTransform:"none"},wrapped:!0},n.toString()))}return h.jsxs("div",{className:"vis-widget-body",style:{display:"flex",flexDirection:this.state.rxData.vertical?"row":"column"},children:[h.jsx("div",{style:{width:"100%",overflow:"hidden"},children:h.jsx(k.Tabs,{TabIndicatorProps:{style:{backgroundColor:this.state.rxData.color}},value:this.state.tabIndex||0,onChange:(n,r)=>{window.localStorage.setItem(`${this.props.id}-tabIndex`,r.toString()),this.setState({tabIndex:r})},scrollButtons:"auto",centered:this.state.rxData.variant==="centered",variant:this.state.rxData.variant==="fullWidth"?"fullWidth":this.state.rxData.variant==="centered"?void 0:"scrollable",orientation:this.state.rxData.vertical?"vertical":void 0,children:t})}),this.getWidgetView()]})}}class yn{el;locked=!1;x0=null;onSwipeLeft=null;onSwipeRight=null;hideIndication=!1;indicationLeft="";indicationRight="";swipeThreshold=30;indicatorNode=null;constructor(e){this.onSwipeRight=e.onSwipeRight,this.onSwipeLeft=e.onSwipeLeft}install(e,t){e&&(this.el=e),t&&(t.hideIndication!==void 0&&(this.hideIndication=t.hideIndication),t.indicationLeft!==void 0&&(this.indicationLeft=t.indicationLeft),t.indicationRight!==void 0&&(this.indicationRight=t.indicationRight),t.swipeThreshold!==void 0&&(this.swipeThreshold=Math.abs(t.swipeThreshold)||30)),this.init()}destroy(){var e;(e=this.el)!=null&&e._swipe&&(this.el.removeEventListener("mousedown",this.moveStart,!1),this.el.removeEventListener("touchstart",this.moveStart,!1),delete this.el._swipe,this.removeIndicator())}static unify(e){return e.changedTouches?e.changedTouches[0]:e}move=e=>{if(e.preventDefault(),this.locked){const t=yn.unify(e).clientX-this.x0;t>0&&this.onSwipeRight&&this.indicationRight?this.el.style.transform=`translateX(${t}px)`:t<0&&this.onSwipeLeft&&this.indicationLeft&&(this.el.style.transform=`translateX(${t}px)`),Math.abs(t)>this.swipeThreshold?this.showIndication(t):this.indicatorNode&&(this.indicatorNode.style.display="none")}};removeIndicator(){this.indicatorNode&&(this.indicatorNode.remove(),this.indicatorNode=null),this.locked&&(this.el&&(this.el.style.transform="",this.el.removeEventListener("mousemove",this.move,!1),this.el.removeEventListener("touchmove",this.move,!1),this.el.removeEventListener("mouseup",this.moveEnd,!1),this.el.removeEventListener("touchend",this.moveEnd,!1)),this.x0=null,this.locked=!1)}moveEnd=e=>{if(this.locked){const t=yn.unify(e).clientX-this.x0;this.removeIndicator(),t>this.swipeThreshold&&this.onSwipeRight?this.onSwipeRight():t<-1*this.swipeThreshold&&this.onSwipeLeft&&this.onSwipeLeft()}};moveStart=e=>{this.locked||(this.locked=!0,this.x0=yn.unify(e).clientX,this.el.addEventListener("mousemove",this.move,!1),this.el.addEventListener("touchmove",this.move,!1),this.el.addEventListener("mouseup",this.moveEnd,!1),this.el.addEventListener("touchend",this.moveEnd,!1))};init(){this.el._swipe||(this.el.addEventListener("mousedown",this.moveStart,!1),this.el.addEventListener("touchstart",this.moveStart,!1),this.el._swipe=!0)}showIndication(e){this.hideIndication||(this.indicatorNode||(this.indicatorNode=document.createElement("div"),this.indicatorNode.style.position="absolute",this.indicatorNode.setAttribute("id","vis-2-swipe-indicator"),this.indicatorNode.style.top="calc(50% - 16px)",this.indicatorNode.style.zIndex="2000",this.indicatorNode.style.fontSize="32px",this.el.parentNode.appendChild(this.indicatorNode)),e>this.swipeThreshold?(this.indicatorNode.innerHTML=`← ${this.indicationRight}`,this.indicatorNode.style.left="5%",this.indicatorNode.style.right="",this.indicatorNode.style.display="block"):e<-1*this.swipeThreshold?(this.indicatorNode.innerHTML=`${this.indicationLeft} →`,this.indicatorNode.style.right="5%",this.indicatorNode.style.left="",this.indicatorNode.style.display="block"):this.indicatorNode.style.display="none")}}class Pl extends xe{swipeable=null;static getWidgetInfo(){return{id:"tplSwipe",visSet:"swipe",visName:"Swipe Navigation",visSetLabel:"vis_2_widgets_widgets_swipe_label",visPrev:"widgets/swipe/img/Prev_Swipe.png",visWidgetLabel:"vis_2_widgets_widgets_swipe_label",visSetIcon:"widgets/swipe/img/Prev_Swipe.png",visAttrs:[{name:"common",fields:[{name:"left_nav_view",type:"select-views",multiple:!1},{name:"right_nav_view",type:"select-views",multiple:!1},{name:"hideIndication",label:"vis_2_widgets_swipe_hide_indication_label",type:"checkbox"},{name:"threshold",label:"vis_2_widgets_swipe_threshold_label",type:"number",default:30}]}],visDefaultStyle:{width:160,height:82}}}componentDidMount(){super.componentDidMount(),this.swipeable=this.swipeable||new yn({onSwipeLeft:()=>{this.state.rxData.left_nav_view&&this.props.context.changeView(this.state.rxData.left_nav_view)},onSwipeRight:()=>{this.state.rxData.right_nav_view&&this.props.context.changeView(this.state.rxData.right_nav_view)}})}getWidgetInfo(){return Pl.getWidgetInfo()}renderWidgetBody(e){var n,r,s,o;if(super.renderWidgetBody(e),this.props.editMode)return(n=this.swipeable)==null||n.destroy(),h.jsxs("div",{className:"vis-widget-body",children:[h.jsx("div",{style:{fontWeight:"bold"},children:N.I18n.t("Swipe Navigation")}),h.jsx("table",{children:h.jsxs("tbody",{children:[h.jsxs("tr",{children:[h.jsx("td",{style:{width:40},children:N.I18n.t("left")}),h.jsx("td",{style:{width:20},children:">"}),h.jsx("td",{children:this.state.rxData.left_nav_view})]}),h.jsxs("tr",{children:[h.jsx("td",{style:{width:40},children:N.I18n.t("right")}),h.jsx("td",{style:{width:20},children:"<"}),h.jsx("td",{children:this.state.rxData.right_nav_view})]})]})})]});const t=(r=this.props.refParent)==null?void 0:r.current;return this.swipeable&&t&&this.swipeable.install(t,{hideIndication:this.state.rxData.hideIndication,indicationRight:this.state.rxData.right_nav_view?((s=this.props.context.views[this.state.rxData.right_nav_view])==null?void 0:s.name)||this.state.rxData.right_nav_view:"",indicationLeft:this.state.rxData.left_nav_view?((o=this.props.context.views[this.state.rxData.left_nav_view])==null?void 0:o.name)||this.state.rxData.left_nav_view:"",swipeThreshold:this.state.rxData.threshold||30}),null}}const YT=[ya,ba,Sa,ja,Ea,Ra,Ia,Ca,_a,Ma,Ar,ka,wa,Rt,Ta,Pa,ki,Ti,Oa,Aa,Na,$a,Wa,fe,Fa,La,Ba,Va,za,Ha,qa,Ua,Ya,Ga,Ja,Xa,Za,Ka,hi,Qa,Ze,el,kt,tl,il,sl,ji,Ei,ol,nl,rl,_l,Ml,kl,Tl,Pl],Td={basic:"#f1f1f1",bars:"#f6594e",dwd:"#cb8928",echarts:"#98B1C0",eventlist:"#c52699",hqwidgets:"#005067",jqplot:"#00e753",jqui:"#008be0",metro:"#9f8ad8",swipe:"#858585",tabs:"#00d5a3","spotify-premium":"#00ae03"},mr=i=>{if(!window.visWidgetTypes){if(window.visSets={},Fe.allWidgetsList=[],!Fe.rxWidgets)return[];window.visWidgetTypes=Array.from(document.querySelectorAll('script[type="text/ejs"]')).map(t=>{var l,c;const n=t.getAttribute("id");if(!n||!Fe.rxWidgets)return null;let r;if((l=Fe.rxWidgets[n])!=null&&l.getWidgetInfo&&(r=Fe.rxWidgets[n].getWidgetInfo(),r!=null&&r.visAttrs&&typeof r.visAttrs!="string"))return null;const s=t.getAttribute("data-vis-set")||"basic";if(i&&!i.includes(s))return console.log(`Ignored ${s}/${n} because not used in project`),null;const o=t.getAttribute("data-vis-color");window.visSets[s]=window.visSets[s]||{},o?window.visSets[s].color=o:!window.visSets[s].color&&Td[s]&&(window.visSets[s].color=Td[s]);const a={name:n,title:(r==null?void 0:r.visName)||t.getAttribute("data-vis-name")||void 0,label:r!=null&&r.visWidgetLabel||(r==null?void 0:r.visWidgetLabel)===""?r.visWidgetLabel:void 0,preview:(r==null?void 0:r.visPrev)||t.getAttribute("data-vis-prev")||void 0,help:t.getAttribute("data-vis-help")||void 0,set:(r==null?void 0:r.visSet)||s,imageHTML:t.getAttribute("data-vis-prev")||"",init:t.getAttribute("data-vis-init")||void 0,color:(r==null?void 0:r.visWidgetColor)||void 0,params:(r==null?void 0:r.visAttrs)||Object.values(t.attributes).filter(u=>u.name.startsWith("data-vis-attrs")).map(u=>u.value).join(""),setLabel:(r==null?void 0:r.visSetLabel)||void 0,setColor:(r==null?void 0:r.visSetColor)||void 0,order:(r==null?void 0:r.visOrder)===void 0||(r==null?void 0:r.visOrder)===null?1e3:typeof r.visOrder=="string"?parseInt(r.visOrder,10):r.visOrder,hidden:t.getAttribute("data-vis-no-palette")==="true"};return(c=Fe.allWidgetsList)==null||c.push(a.name),a}).filter(t=>t),Object.values(Fe.rxWidgets).forEach(t=>{var a;const n=t.getWidgetInfo(),r=t.i18nPrefix||"",s={name:n.id,preview:n.visPrev,title:n.visName,params:n.visAttrs,set:n.visSet,style:n.visDefaultStyle,label:n.visWidgetLabel?r+n.visWidgetLabel:n.visWidgetLabel===""?"":void 0,setLabel:n.visSetLabel?r+n.visSetLabel:void 0,setColor:n.visSetColor,setIcon:n.visSetIcon,color:n.visWidgetColor,resizable:n.visResizable,resizeLocked:n.visResizeLocked,draggable:n.visDraggable,adapter:t.adapter||void 0,version:t.version||void 0,hidden:t.visHidden,order:n.visOrder===void 0?1e3:n.visOrder,customPalette:n.customPalette,rx:!0,developerMode:(a=t.url)==null?void 0:a.startsWith("http://"),i18nPrefix:r};Fe.allWidgetsList&&!Fe.allWidgetsList.includes(s.name)&&Fe.allWidgetsList.push(s.name);const o=window.visWidgetTypes.findIndex(l=>l.name===s.name);o>-1?window.visWidgetTypes[o]=s:window.visWidgetTypes.push(s),r&&typeof n.visAttrs=="object"&&n.visAttrs.forEach(l=>{l.label&&!l.label.startsWith(r)&&(l.label=r+l.label),l.fields&&l.fields.forEach(c=>{const u=c;u.label&&!u.label.startsWith(r)&&(u.label=r+u.label),u.tooltip&&!u.tooltip.startsWith(r)&&(u.tooltip=r+u.tooltip),u.options&&!u.noTranslation&&Array.isArray(u.options)&&u.options.forEach(p=>{typeof p=="object"&&p.label&&!p.label.startsWith(r)&&(p.label=r+p.label)})})})})}return window.visWidgetTypes};class Fe{static rxWidgets=null;static allWidgetsList=null;static getUsedWidgetSets(e){let t=!1;const n=[],r=Object.keys(e);for(let s=0;s<r.length;s++){if(r[s]==="___settings")continue;const o=e[r[s]].widgets,a=Object.keys(o);for(let l=0;l<a.length;l++){const c=o[a[l]].widgetSet;if(!c||o[a[l]].wSet||o[a[l]].set){t=!0;break}n.includes(c)||n.push(c)}if(t){console.warn("Found widgets without widget set. Will load all widget sets");break}}return!t&&n.sort(),t?!1:n}static setUsedWidgetSets(e){let t;const n=window.visWidgetTypes,r=Object.keys(e);for(let s=0;s<r.length;s++){if(r[s]==="___settings")continue;const o=e[r[s]].widgets,a=Object.keys(o);for(let l=0;l<a.length;l++){if(o[a[l]].set&&(t=t||JSON.parse(JSON.stringify(e)),delete t[r[s]].widgets[a[l]].set),o[a[l]].wSet&&(t=t||JSON.parse(JSON.stringify(e)),delete t[r[s]].widgets[a[l]].wSet),o[a[l]].widgetSet)continue;const c=o[a[l]].tpl;if(c==="_tplGroup")t=t||JSON.parse(JSON.stringify(e)),t[r[s]].widgets[a[l]].widgetSet="basic";else{const u=n.find(p=>p.name===c);u&&(t=t||JSON.parse(JSON.stringify(e)),t[r[s]].widgets[a[l]].widgetSet=u.set)}}}return t}static collectRxInformation(e,t,n){if(!Fe.rxWidgets){Fe.rxWidgets={};let r=null;return t&&(r=Fe.getUsedWidgetSets(t)),new Promise(s=>{setTimeout(()=>c0(e,!n&&r?r:!1).then(o=>{if([...YT,...o||[]].forEach(l=>{if(!(l!=null&&l.getWidgetInfo))console.error(`Invalid widget without getWidgetInfo: ${l.constructor.name}`);else{const c=l.getWidgetInfo();c.visSet||console.error(`No visSet in info for "${l.constructor.name}"`),c.id?Fe.rxWidgets&&(Fe.rxWidgets[c.id]=l):console.error(`No id in info for "${l.constructor.name}"`)}}),n?mr():r?mr(r):mr(),r===!1&&n){const l=Fe.setUsedWidgetSets(t);l&&(console.warn("Found widgets without widget set. Project updated"),n(l))}s(Fe.rxWidgets)}),0)})}return Promise.resolve(Fe.rxWidgets)}}function bn(i){if(Array.isArray(i)){const t=[];for(let n=0;n<i.length;n++)i[n]!==void 0&&(Array.isArray(i[n])||typeof i[n]=="object"?Object.prototype.hasOwnProperty.call(i,"$$typeof")?t[n]=i[n]:t[n]=bn(i[n]):t[n]=i[n]);return t}const e={};for(const t in i)i[t]!==void 0&&(Array.isArray(i[t])||typeof i[t]=="object"?Object.prototype.hasOwnProperty.call(i,"$$typeof")?e[t]=i[t]:e[t]=bn(i[t]):e[t]=i[t]);return e}const x1=(i,e,t,n,r,s)=>{var o;if(typeof i=="string"){let a="common",l={},c=!1;t=t||{common:1},n=n||{};const u=[{name:"common",singleName:"common",fields:[]}];let p=u[0];return e=e||0,i.split(";").forEach(d=>{var f,m,v,g,x;if(d)if(d.startsWith("group.")){const y=d.split("/");if(a=y[0].split(".")[1],e!==void 0&&e>0&&t&&!t[a])return;l={},y[1]!=="byindex"?(p=u.find(w=>w.name===a),p||(u.push({name:a,singleName:a,fields:[]}),p=u[u.length-1]),t&&(t[a]||(t[a]=0),t[a]++),c=!1):c=!0}else{const y=d.match(/([a-zA-Z0-9._-]+)(\([a-zA-Z.0-9-_]*\))?(\[.*])?(\/[-_,^§~\s:/.a-zA-Z0-9]+)?/);if(!y){console.warn(`Invalid attribute ${d}`);return}const w=y[2];let S,M;if(y[4]){const I=y[4].substring(1).split("/");S=I[0],M=I[1]}else S=null;const b={name:y[1],default:y[3]?y[3].substring(1,y[3].length-1):void 0,type:S,onChangeFunc:M};if(b.type&&(b.type=b.type.replace(/§/g,";").replace(/~/g,"/").replace(/\^/g,'"').replace(/\^\^/g,"^")),typeof b.default=="string"&&(b.default=b.default.replace(/§/g,";").replace(/~/g,"/").replace(/\^/g,'"').replace(/\^\^/g,"^")),b.onChangeFunc&&b.onChangeFunc.startsWith("filterType")&&(b.filter=b.onChangeFunc.substring(10).toLowerCase(),delete b.onChangeFunc),e&&e>0&&!w&&n&&!n[`${a}.${b.name}`])return;if(b.name==="oid"||b.name.match(/^oid-/)?b.type=b.type||"id":b.name==="color"?b.type="color":b.name.match(/nav_view$/)?b.type="views":b.name==="sound"||b.name.includes("_effect")||b.name.includes("_eff_opt")?b.type="text":b.type||(b.type="text"),b.type&&b.type.startsWith("id,")){const I=b.type.split(",");b.type=I[0],b.filter=I[1]}if(b.type&&(b.type.startsWith("select,")||b.type.startsWith("nselect,")||b.type.startsWith("auto,"))){const I=b.type.split(",");b.type=I[0],b.options=I.slice(1)}if(b.type&&(b.type.startsWith("slider,")||b.type.startsWith("number,"))){const I=b.type.split(",");b.type=I[0],b.min=parseInt(I[1]),b.max=parseInt(I[2]),b.step=parseInt(I[3]),b.step||(b.step=b.max-b.min/100)}if(b.type&&b.type.startsWith("style,")){const I=b.type.split(",");b.type=I[0],b.filterFile=I[1],b.filterName=I[2],b.filterAttrs=I[3],b.removeName=I[4],!b.step&&b.max!==void 0&&b.min!==void 0&&(b.step=b.max-b.min/100)}if((f=b.type)!=null&&f.startsWith("style,")&&(console.warn(`Attribute "${b.name}" of ${r} has wrong type: ${b.type}`),b.type=b.type.split(",")[0]),b.singleName=b.name,b.set=r,w){const I=w.match(/\(([0-9a-z_]+)-([0-9a-z_]+)\)/i),P=b.name;if(I){let E=1,A=1;I[1].match(/^[0-9]$/)||(E=s?parseInt(s[I[1]]):0),I[2].match(/^[0-9]$/)||(A=s?parseInt(s[I[2]]):0);for(let T=E;T<=A;T++)if(c){if(t&&e&&e>0&&!t[`${a}-${T}`]||n&&e&&e>0&&!n[`${a}-${T}.${b.name}`])return;l[T]||(p={name:`${a}-${T}`,singleName:a,index:T,fields:[]},l[T]=p,u.push(p)),t&&(t[`${a}-${T}`]||(t[`${a}-${T}`]=0),t[`${a}-${T}`]++),b.name=`${P}${T}`,(v=(m=l[T])==null?void 0:m.fields)==null||v.push({...b}),n&&(n[`${a}-${T}.${b.name}`]||(n[`${a}-${T}.${b.name}`]=0),n[`${a}-${T}.${b.name}`]++)}else b.name=`${P}${T}`,b.index=T,(g=p==null?void 0:p.fields)==null||g.push({...b}),n&&(n[`${a}.${b.name}`]||(n[`${a}.${b.name}`]=0),n[`${a}.${b.name}`]++)}}else(x=p==null?void 0:p.fields)==null||x.push(b),n&&(n[`${a}.${b.name}`]||(n[`${a}.${b.name}`]=0),n[`${a}.${b.name}`]++)}}),u}if(Array.isArray(i)){t=t||{common:1},n=n||{};const a=bn(i);let l=a.findIndex(c=>typeof c.indexFrom=="number");for(;l>-1;){const c=a[l];c.singleName=c.name;let u,p;Number.isInteger(c.indexFrom)?u=c.indexFrom:(u=parseInt(s==null?void 0:s[c.indexFrom||1]),p=u);let d,f;Number.isInteger(c.indexTo)?d=parseInt(c.indexTo||"1",10):(d=parseInt(s==null?void 0:s[c.indexTo||1]),f=c.indexTo),delete c.indexFrom,delete c.indexTo;const m=[];for(let v=u;v<=d;v++){const g={...bn(c),index:v,name:`${c.singleName}-${v}`,hidden:c.hidden,iterable:{group:c.singleName||"",isFirst:v===u,isLast:v===d,indexTo:f,indexFrom:p}};(o=g.fields)==null||o.forEach((x,y)=>{x.singleName=x.name,x.name=`${x.name}${v}`,x.index=v,c.fields&&c.fields[y]&&(typeof c.fields[y].hidden=="function"&&(x.hidden=c.fields[y].hidden),typeof c.fields[y].component=="function"&&(x.component=c.fields[y].component),typeof c.fields[y].onChange=="function"&&(x.onChange=c.fields[y].onChange),typeof c.fields[y].disabled=="function"&&(x.disabled=c.fields[y].disabled),typeof c.fields[y].error=="function"&&(x.error=c.fields[y].error))}),m.push(g)}a.splice(l,1,...m),l=a.findIndex(v=>v.indexFrom)}return a.forEach(c=>{var u;if(c.name||(c.name="common"),c.singleName||(c.singleName=c.name),t&&(t[c.name]||(t[c.name]=0),t[c.name]++),c.fields){let p=c.fields.findIndex(d=>d.indexFrom);for(;p>-1;){const d=c.fields[p];d.singleName=d.name;let f=1,m;Number.isInteger(d.indexFrom)?f=parseInt(d.indexFrom,10):typeof d.indexFrom=="string"&&(f=parseInt(s==null?void 0:s[d.indexFrom]),m=f);let v=1,g;Number.isInteger(d.indexTo)?v=parseInt(d.indexTo,10):typeof d.indexTo=="string"&&(v=parseInt(s==null?void 0:s[d.indexTo]),g=d.indexTo),delete d.indexFrom,delete d.indexTo;const x=[];for(let y=f;y<=v;y++){const w=bn(d);w.index=y,w.name=`${d.singleName}${y}`,w.iterable={group:d.singleName,isFirst:y===f,isLast:y===v,indexFrom:m,indexTo:g},x.push(w)}(u=c.fields)==null||u.splice(p,1,...x),p=c.fields.findIndex(y=>y.indexFrom)}c.fields.forEach(d=>{d.singleName||(d.singleName=d.name),d.set=r,n&&(n[`${c.name}.${d.name}`]||(n[`${c.name}.${d.name}`]=0),n[`${c.name}.${d.name}`]++)})}}),a}return null};export{f1 as A,Bo as B,Fp as C,yS as D,p1 as E,S0 as F,Vp as G,Vg as H,St as I,m1 as J,nd as K,Mv as L,zo as M,Tv as N,d1 as O,i0 as P,a1 as Q,c1 as R,g1 as S,Ex as U,Fe as V,tg as a,N as b,Zn as c,it as d,wr as e,Wv as f,o1 as g,oc as h,De as i,mr as j,pr as k,pu as l,hu as m,bg as n,v1 as o,x1 as p,kg as q,h1 as r,_e as s,Km as t,qi as u,sr as v,u1 as w,Rv as x,l1 as y,Av as z};