@mxtommy/kip 4.0.7 → 4.1.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2 -2
- package/package.json +1 -1
- package/plugin/index.js +59 -8
- package/plugin/openApi.json +1 -1
- package/public/3rdpartylicenses.txt +26 -26
- package/public/assets/help-docs/chartplotter.md +5 -5
- package/public/chunk-2QCDSHYY.js +2 -0
- package/public/chunk-7UI7K4WB.js +52 -0
- package/public/{chunk-KZW5Z46K.js → chunk-ADTF2732.js} +1 -1
- package/public/chunk-AQ66AGUC.js +1 -0
- package/public/chunk-BRLXMYKY.js +3 -0
- package/public/{chunk-QLTN6G6E.js → chunk-CWBDCB4U.js} +1 -1
- package/public/{chunk-QZJKBIMY.js → chunk-D3OVXRDS.js} +1 -1
- package/public/{chunk-IJ22WXFB.js → chunk-GYERRI2M.js} +1 -1
- package/public/chunk-GZCIAVS6.js +2 -0
- package/public/{chunk-35577QTX.js → chunk-JEFO22J2.js} +2 -2
- package/public/chunk-JPSGB24W.js +3 -0
- package/public/{chunk-OQULS6SV.js → chunk-JWT2WFAW.js} +1 -1
- package/public/{chunk-QVCMARCU.js → chunk-KITN4REV.js} +1 -1
- package/public/{chunk-2DBQEP6W.js → chunk-KNBOI7TL.js} +1 -1
- package/public/{chunk-BMDGKBYM.js → chunk-L4NM3HUK.js} +26 -26
- package/public/chunk-LKUCWQH6.js +1 -0
- package/public/{chunk-RYHOAWDD.js → chunk-MHCWCMEF.js} +1 -1
- package/public/chunk-MKKQCG3C.js +2 -0
- package/public/chunk-PR5JLJLD.js +15 -0
- package/public/chunk-QL3G7CWF.js +1 -0
- package/public/chunk-RIZZU7FJ.js +1 -0
- package/public/{chunk-HIADZ4BV.js → chunk-RVSQUIEX.js} +1 -1
- package/public/{chunk-52M2PJJL.js → chunk-TKCKTVDR.js} +1 -1
- package/public/chunk-UDAYIL7R.js +1 -0
- package/public/{chunk-SZ2GUIT5.js → chunk-W4VRE5PG.js} +1 -1
- package/public/chunk-Z6B2WXN3.js +1 -0
- package/public/index.html +1 -1
- package/public/main-PRDRZK7G.js +5 -0
- package/public/{polyfills-HMJGV7SQ.js → polyfills-C5VXBGWL.js} +1 -1
- package/rm-npmjs-beta.sh +50 -0
- package/public/chunk-4NJ3ZL5U.js +0 -1
- package/public/chunk-AB255PKD.js +0 -2
- package/public/chunk-BISZS3TE.js +0 -3
- package/public/chunk-D2CYLQZF.js +0 -1
- package/public/chunk-DADLXEYG.js +0 -1
- package/public/chunk-JCVEDDSQ.js +0 -2
- package/public/chunk-NDOR4O4J.js +0 -1
- package/public/chunk-OB3QLUH6.js +0 -15
- package/public/chunk-PKKBBIJK.js +0 -3
- package/public/chunk-ROD2YZ6L.js +0 -52
- package/public/chunk-TIWUK3AU.js +0 -1
- package/public/chunk-XDPHEQEO.js +0 -2
- package/public/main-NJAW6UFC.js +0 -5
package/public/chunk-BISZS3TE.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{a as $,b as xe,c as B,d as bt,f as Ee,g as vt,l as De,n as Q,o as Re,p as ke,q as ze,r as wt,s as Se}from"./chunk-ROD2YZ6L.js";import{a as we,b as Ce,d as Oe,e as Te,g as He,h as Ne}from"./chunk-RYHOAWDD.js";import{a as X,b as yt}from"./chunk-DADLXEYG.js";import{a as At,d as U}from"./chunk-XDPHEQEO.js";import{Ab as q,Bb as Y,Da as Qt,Db as re,Ea as Ht,Eb as oe,Fa as S,Gb as ft,Gd as mt,Hd as _t,Ja as Nt,Kb as v,La as st,Lb as ne,Mb as ae,Nc as Bt,Oa as T,Oc as fe,P as qt,Sa as ct,Sb as de,Ta as ut,Tb as le,Ua as Kt,Ub as he,Uc as me,Va as Jt,Wa as H,Wc as _e,Xd as ye,Yd as be,_d as ve,a as m,b as w,bb as G,bc as Pt,ca as Yt,cb as F,cc as at,dc as ce,ec as dt,fb as Zt,ga as y,gb as te,hb as P,ib as _,ja as C,jb as b,jc as Lt,ka as x,kb as gt,kc as ue,lb as rt,mb as ot,nb as ee,pa as $t,qb as ie,ra as Xt,rb as L,tb as D,tc as ge,vb as N,wa as it,wb as Mt,xb as pt,yb as se,zb as nt,zc as pe}from"./chunk-OB3QLUH6.js";function Me(a,r,t,e,i){let s=(...o)=>(console.warn("gridstack.js: Function `"+t+"` is deprecated in "+i+" and has been replaced with `"+e+"`. It will be **removed** in a future release"),r.apply(a,o));return s.prototype=r.prototype,s}var h=class a{static getElements(r,t=document){if(typeof r=="string"){let e="getElementById"in t?t:void 0;if(e&&!isNaN(+r[0])){let s=e.getElementById(r);return s?[s]:[]}let i=t.querySelectorAll(r);return!i.length&&r[0]!=="."&&r[0]!=="#"&&(i=t.querySelectorAll("."+r),i.length||(i=t.querySelectorAll("#"+r))),Array.from(i)}return[r]}static getElement(r,t=document){if(typeof r=="string"){let e="getElementById"in t?t:void 0;if(!r.length)return null;if(e&&r[0]==="#")return e.getElementById(r.substring(1));if(r[0]==="#"||r[0]==="."||r[0]==="[")return t.querySelector(r);if(e&&!isNaN(+r[0]))return e.getElementById(r);let i=t.querySelector(r);return e&&!i&&(i=e.getElementById(r)),i||(i=t.querySelector("."+r)),i}return r}static lazyLoad(r){return r.lazyLoad||r.grid?.opts?.lazyLoad&&r.lazyLoad!==!1}static createDiv(r,t){let e=document.createElement("div");return r.forEach(i=>{i&&e.classList.add(i)}),t?.appendChild(e),e}static shouldSizeToContent(r,t=!1){return r?.grid&&(t?r.sizeToContent===!0||r.grid.opts.sizeToContent===!0&&r.sizeToContent===void 0:!!r.sizeToContent||r.grid.opts.sizeToContent&&r.sizeToContent!==!1)}static isIntercepted(r,t){return!(r.y>=t.y+t.h||r.y+r.h<=t.y||r.x+r.w<=t.x||r.x>=t.x+t.w)}static isTouching(r,t){return a.isIntercepted(r,{x:t.x-.5,y:t.y-.5,w:t.w+1,h:t.h+1})}static areaIntercept(r,t){let e=r.x>t.x?r.x:t.x,i=r.x+r.w<t.x+t.w?r.x+r.w:t.x+t.w;if(i<=e)return 0;let s=r.y>t.y?r.y:t.y,o=r.y+r.h<t.y+t.h?r.y+r.h:t.y+t.h;return o<=s?0:(i-e)*(o-s)}static area(r){return r.w*r.h}static sort(r,t=1){return r.sort((i,s)=>{let o=t*((i.y??1e4)-(s.y??1e4));return o===0?t*((i.x??1e4)-(s.x??1e4)):o})}static find(r,t){return t?r.find(e=>e.id===t):void 0}static toBool(r){return typeof r=="boolean"?r:typeof r=="string"?(r=r.toLowerCase(),!(r===""||r==="no"||r==="false"||r==="0")):!!r}static toNumber(r){return r===null||r.length===0?void 0:Number(r)}static parseHeight(r){let t,e="px";if(typeof r=="string")if(r==="auto"||r==="")t=0;else{let i=r.match(/^(-[0-9]+\.[0-9]+|[0-9]*\.[0-9]+|-[0-9]+|[0-9]+)(px|em|rem|vh|vw|%|cm|mm)?$/);if(!i)throw new Error(`Invalid height val = ${r}`);e=i[2]||"px",t=parseFloat(i[1])}else t=r;return{h:t,unit:e}}static defaults(r,...t){return t.forEach(e=>{for(let i in e){if(!e.hasOwnProperty(i))return;r[i]===null||r[i]===void 0?r[i]=e[i]:typeof e[i]=="object"&&typeof r[i]=="object"&&a.defaults(r[i],e[i])}}),r}static same(r,t){if(typeof r!="object")return r==t;if(typeof r!=typeof t||Object.keys(r).length!==Object.keys(t).length)return!1;for(let e in r)if(r[e]!==t[e])return!1;return!0}static copyPos(r,t,e=!1){return t.x!==void 0&&(r.x=t.x),t.y!==void 0&&(r.y=t.y),t.w!==void 0&&(r.w=t.w),t.h!==void 0&&(r.h=t.h),e&&(t.minW&&(r.minW=t.minW),t.minH&&(r.minH=t.minH),t.maxW&&(r.maxW=t.maxW),t.maxH&&(r.maxH=t.maxH)),r}static samePos(r,t){return r&&t&&r.x===t.x&&r.y===t.y&&(r.w||1)===(t.w||1)&&(r.h||1)===(t.h||1)}static sanitizeMinMax(r){r.minW||delete r.minW,r.minH||delete r.minH,r.maxW||delete r.maxW,r.maxH||delete r.maxH}static removeInternalAndSame(r,t){if(!(typeof r!="object"||typeof t!="object"))for(let e in r){let i=r[e],s=t[e];e[0]==="_"||i===s?delete r[e]:i&&typeof i=="object"&&s!==void 0&&(a.removeInternalAndSame(i,s),Object.keys(i).length||delete r[e])}}static removeInternalForSave(r,t=!0){for(let e in r)(e[0]==="_"||r[e]===null||r[e]===void 0)&&delete r[e];delete r.grid,t&&delete r.el,r.autoPosition||delete r.autoPosition,r.noResize||delete r.noResize,r.noMove||delete r.noMove,r.locked||delete r.locked,(r.w===1||r.w===r.minW)&&delete r.w,(r.h===1||r.h===r.minH)&&delete r.h}static throttle(r,t){let e=!1;return(...i)=>{e||(e=!0,setTimeout(()=>{r(...i),e=!1},t))}}static removePositioningStyles(r){let t=r.style;t.position&&t.removeProperty("position"),t.left&&t.removeProperty("left"),t.top&&t.removeProperty("top"),t.width&&t.removeProperty("width"),t.height&&t.removeProperty("height")}static getScrollElement(r){if(!r)return document.scrollingElement||document.documentElement;let t=getComputedStyle(r);return/(auto|scroll)/.test(t.overflow+t.overflowY)?r:a.getScrollElement(r.parentElement)}static updateScrollPosition(r,t,e){let i=a.getScrollElement(r);if(!i)return;let s=r.getBoundingClientRect(),o=i.getBoundingClientRect(),n=window.innerHeight||document.documentElement.clientHeight,d=s.bottom-Math.min(o.bottom,n),u=s.top-Math.max(o.top,0),c=i.scrollTop;u<0&&e<0?r.offsetHeight>o.height?i.scrollTop+=e:i.scrollTop+=Math.abs(u)>Math.abs(e)?e:u:d>0&&e>0&&(r.offsetHeight>o.height?i.scrollTop+=e:i.scrollTop+=d>e?e:d),t.top+=i.scrollTop-c}static updateScrollResize(r,t,e){let i=a.getScrollElement(t),s=i.clientHeight,o=i===a.getScrollElement()?0:i.getBoundingClientRect().top,n=r.clientY-o,d=n<e,u=n>s-e;d?i.scrollBy({behavior:"smooth",top:n-e}):u&&i.scrollBy({behavior:"smooth",top:e-(s-n)})}static clone(r){return r==null||typeof r!="object"?r:r instanceof Array?[...r]:m({},r)}static cloneDeep(r){let t=["parentGrid","el","grid","subGrid","engine"],e=a.clone(r);for(let i in e)e.hasOwnProperty(i)&&typeof e[i]=="object"&&i.substring(0,2)!=="__"&&!t.find(s=>s===i)&&(e[i]=a.cloneDeep(r[i]));return e}static cloneNode(r){let t=r.cloneNode(!0);return t.removeAttribute("id"),t}static appendTo(r,t){let e;typeof t=="string"?e=a.getElement(t):e=t,e&&e.appendChild(r)}static addElStyles(r,t){if(t instanceof Object)for(let e in t)t.hasOwnProperty(e)&&(Array.isArray(t[e])?t[e].forEach(i=>{r.style[e]=i}):r.style[e]=t[e])}static initEvent(r,t){let e={type:t.type},i={button:0,which:0,buttons:1,bubbles:!0,cancelable:!0,target:t.target?t.target:r.target};return["altKey","ctrlKey","metaKey","shiftKey"].forEach(s=>e[s]=r[s]),["pageX","pageY","clientX","clientY","screenX","screenY"].forEach(s=>e[s]=r[s]),m(m({},e),i)}static simulateMouseEvent(r,t,e){let i=r,s=new MouseEvent(t,{bubbles:!0,composed:!0,cancelable:!0,view:window,detail:1,screenX:r.screenX,screenY:r.screenY,clientX:r.clientX,clientY:r.clientY,ctrlKey:i.ctrlKey??!1,altKey:i.altKey??!1,shiftKey:i.shiftKey??!1,metaKey:i.metaKey??!1,button:0,relatedTarget:r.target});(e||r.target).dispatchEvent(s)}static getValuesFromTransformedElement(r){let t=document.createElement("div");a.addElStyles(t,{opacity:"0",position:"fixed",top:"0px",left:"0px",width:"1px",height:"1px",zIndex:"-999999"}),r.appendChild(t);let e=t.getBoundingClientRect();return r.removeChild(t),t.remove(),{xScale:1/e.width,yScale:1/e.height,xOffset:e.left,yOffset:e.top}}static swap(r,t,e){if(!r)return;let i=r[t];r[t]=r[e],r[e]=i}static canBeRotated(r){return!(!r||r.w===r.h||r.locked||r.noResize||r.grid?.opts.disableResize||r.minW&&r.minW===r.maxW||r.minH&&r.minH===r.maxH)}};var It=(()=>{class a{constructor(t={}){this.addedNodes=[],this.removedNodes=[],this.defaultColumn=12,this.column=t.column||this.defaultColumn,this.column>this.defaultColumn&&(this.defaultColumn=this.column),this.maxRow=t.maxRow,this._float=t.float,this.nodes=t.nodes||[],this.onChange=t.onChange}batchUpdate(t=!0,e=!0){return!!this.batchMode===t?this:(this.batchMode=t,t?(this._prevFloat=this._float,this._float=!0,this.cleanNodes(),this.saveInitial()):(this._float=this._prevFloat,delete this._prevFloat,e&&this._packNodes(),this._notify()),this)}_useEntireRowArea(t,e){return(!this.float||this.batchMode&&!this._prevFloat)&&!this._hasLocked&&(!t._moving||t._skipDown||e.y<=t.y)}_fixCollisions(t,e=t,i,s={}){if(this.sortNodes(-1),i=i||this.collide(t,e),!i)return!1;if(t._moving&&!s.nested&&!this.float&&this.swap(t,i))return!0;let o=e;!this._loading&&this._useEntireRowArea(t,e)&&(o={x:0,w:this.column,y:e.y,h:e.h},i=this.collide(t,o,s.skip));let n=!1,d={nested:!0,pack:!1},u=0;for(;i=i||this.collide(t,o,s.skip);){if(u++>this.nodes.length*2)throw new Error("Infinite collide check");let c;if(i.locked||this._loading||t._moving&&!t._skipDown&&e.y>t.y&&!this.float&&(!this.collide(i,w(m({},i),{y:t.y}),t)||!this.collide(i,w(m({},i),{y:e.y-i.h}),t))){t._skipDown=t._skipDown||e.y>t.y;let l=m(w(m({},e),{y:i.y+i.h}),d);c=this._loading&&h.samePos(t,l)?!0:this.moveNode(t,l),(i.locked||this._loading)&&c?h.copyPos(e,t):!i.locked&&c&&s.pack&&(this._packNodes(),e.y=i.y+i.h,h.copyPos(t,e)),n=n||c}else c=this.moveNode(i,m(w(m({},i),{y:e.y+e.h,skip:t}),d));if(!c)return n;i=void 0}return n}collide(t,e=t,i){let s=t._id,o=i?._id;return this.nodes.find(n=>n._id!==s&&n._id!==o&&h.isIntercepted(n,e))}collideAll(t,e=t,i){let s=t._id,o=i?._id;return this.nodes.filter(n=>n._id!==s&&n._id!==o&&h.isIntercepted(n,e))}directionCollideCoverage(t,e,i){if(!e.rect||!t._rect)return;let s=t._rect,o=m({},e.rect);o.y>s.y?(o.h+=o.y-s.y,o.y=s.y):o.h+=s.y-o.y,o.x>s.x?(o.w+=o.x-s.x,o.x=s.x):o.w+=s.x-o.x;let n,d=.5;for(let u of i){if(u.locked||!u._rect)break;let c=u._rect,l=Number.MAX_VALUE,g=Number.MAX_VALUE;s.y<c.y?l=(o.y+o.h-c.y)/c.h:s.y+s.h>c.y+c.h&&(l=(c.y+c.h-o.y)/c.h),s.x<c.x?g=(o.x+o.w-c.x)/c.w:s.x+s.w>c.x+c.w&&(g=(c.x+c.w-o.x)/c.w);let f=Math.min(g,l);f>d&&(d=f,n=u)}return e.collide=n,n}cacheRects(t,e,i,s,o,n){return this.nodes.forEach(d=>d._rect={y:d.y*e+i,x:d.x*t+n,w:d.w*t-n-s,h:d.h*e-i-o}),this}swap(t,e){if(!e||e.locked||!t||t.locked)return!1;function i(){let o=e.x,n=e.y;return e.x=t.x,e.y=t.y,t.h!=e.h?(t.x=o,t.y=e.y+e.h):t.w!=e.w?(t.x=e.x+e.w,t.y=n):(t.x=o,t.y=n),t._dirty=e._dirty=!0,!0}let s;if(t.w===e.w&&t.h===e.h&&(t.x===e.x||t.y===e.y)&&(s=h.isTouching(t,e)))return i();if(s!==!1){if(t.w===e.w&&t.x===e.x&&(s||(s=h.isTouching(t,e)))){if(e.y<t.y){let o=t;t=e,e=o}return i()}if(s!==!1){if(t.h===e.h&&t.y===e.y&&(s||(s=h.isTouching(t,e)))){if(e.x<t.x){let o=t;t=e,e=o}return i()}return!1}}}isAreaEmpty(t,e,i,s){let o={x:t||0,y:e||0,w:i||1,h:s||1};return!this.collide(o)}compact(t="compact",e=!0){if(this.nodes.length===0)return this;e&&this.sortNodes();let i=this.batchMode;i||this.batchUpdate();let s=this._inColumnResize;s||(this._inColumnResize=!0);let o=this.nodes;return this.nodes=[],o.forEach((n,d,u)=>{let c;n.locked||(n.autoPosition=!0,t==="list"&&d&&(c=u[d-1])),this.addNode(n,!1,c)}),s||delete this._inColumnResize,i||this.batchUpdate(!1),this}set float(t){this._float!==t&&(this._float=t||!1,t||this._packNodes()._notify())}get float(){return this._float||!1}sortNodes(t=1){return this.nodes=h.sort(this.nodes,t),this}_packNodes(){return this.batchMode?this:(this.sortNodes(),this.float?this.nodes.forEach(t=>{if(t._updating||t._orig===void 0||t.y===t._orig.y)return;let e=t.y;for(;e>t._orig.y;)--e,this.collide(t,{x:t.x,y:e,w:t.w,h:t.h})||(t._dirty=!0,t.y=e)}):this.nodes.forEach((t,e)=>{if(!t.locked)for(;t.y>0;){let i=e===0?0:t.y-1;if(!(e===0||!this.collide(t,{x:t.x,y:i,w:t.w,h:t.h})))break;t._dirty=t.y!==i,t.y=i}}),this)}prepareNode(t,e){t._id=t._id??a._idSeq++;let i=t.id;if(i){let o=1;for(;this.nodes.find(n=>n.id===t.id&&n!==t);)t.id=i+"_"+o++}(t.x===void 0||t.y===void 0||t.x===null||t.y===null)&&(t.autoPosition=!0);let s={x:0,y:0,w:1,h:1};return h.defaults(t,s),t.autoPosition||delete t.autoPosition,t.noResize||delete t.noResize,t.noMove||delete t.noMove,h.sanitizeMinMax(t),typeof t.x=="string"&&(t.x=Number(t.x)),typeof t.y=="string"&&(t.y=Number(t.y)),typeof t.w=="string"&&(t.w=Number(t.w)),typeof t.h=="string"&&(t.h=Number(t.h)),isNaN(t.x)&&(t.x=s.x,t.autoPosition=!0),isNaN(t.y)&&(t.y=s.y,t.autoPosition=!0),isNaN(t.w)&&(t.w=s.w),isNaN(t.h)&&(t.h=s.h),this.nodeBoundFix(t,e),t}nodeBoundFix(t,e){let i=t._orig||h.copyPos({},t);if(t.maxW&&(t.w=Math.min(t.w||1,t.maxW)),t.maxH&&(t.h=Math.min(t.h||1,t.maxH)),t.minW&&(t.w=Math.max(t.w||1,t.minW)),t.minH&&(t.h=Math.max(t.h||1,t.minH)),(t.x||0)+(t.w||1)>this.column&&this.column<this.defaultColumn&&!this._inColumnResize&&!this.skipCacheUpdate&&t._id!=null&&this.findCacheLayout(t,this.defaultColumn)===-1){let o=m({},t);o.autoPosition||o.x===void 0?(delete o.x,delete o.y):o.x=Math.min(this.defaultColumn-1,o.x),o.w=Math.min(this.defaultColumn,o.w||1),this.cacheOneLayout(o,this.defaultColumn)}return t.w>this.column?t.w=this.column:t.w<1&&(t.w=1),this.maxRow&&t.h>this.maxRow?t.h=this.maxRow:t.h<1&&(t.h=1),t.x<0&&(t.x=0),t.y<0&&(t.y=0),t.x+t.w>this.column&&(e?t.w=this.column-t.x:t.x=this.column-t.w),this.maxRow&&t.y+t.h>this.maxRow&&(e?t.h=this.maxRow-t.y:t.y=this.maxRow-t.h),h.samePos(t,i)||(t._dirty=!0),this}getDirtyNodes(t){return t?this.nodes.filter(e=>e._dirty&&!h.samePos(e,e._orig)):this.nodes.filter(e=>e._dirty)}_notify(t){if(this.batchMode||!this.onChange)return this;let e=(t||[]).concat(this.getDirtyNodes());return this.onChange(e),this}cleanNodes(){return this.batchMode?this:(this.nodes.forEach(t=>{delete t._dirty,delete t._lastTried}),this)}saveInitial(){return this.nodes.forEach(t=>{t._orig=h.copyPos({},t),delete t._dirty}),this._hasLocked=this.nodes.some(t=>t.locked),this}restoreInitial(){return this.nodes.forEach(t=>{!t._orig||h.samePos(t,t._orig)||(h.copyPos(t,t._orig),t._dirty=!0)}),this._notify(),this}findEmptyPosition(t,e=this.nodes,i=this.column,s){let o=s?s.y*i+(s.x+s.w):0,n=!1;for(let d=o;!n;++d){let u=d%i,c=Math.floor(d/i);if(u+t.w>i)continue;let l={x:u,y:c,w:t.w,h:t.h};e.find(g=>h.isIntercepted(l,g))||((t.x!==u||t.y!==c)&&(t._dirty=!0),t.x=u,t.y=c,delete t.autoPosition,n=!0)}return n}addNode(t,e=!1,i){let s=this.nodes.find(n=>n._id===t._id);if(s)return s;this._inColumnResize?this.nodeBoundFix(t):this.prepareNode(t),delete t._temporaryRemoved,delete t._removeDOM;let o;return t.autoPosition&&this.findEmptyPosition(t,this.nodes,this.column,i)&&(delete t.autoPosition,o=!0),this.nodes.push(t),e&&this.addedNodes.push(t),o||this._fixCollisions(t),this.batchMode||this._packNodes()._notify(),t}removeNode(t,e=!0,i=!1){return this.nodes.find(s=>s._id===t._id)?(i&&this.removedNodes.push(t),e&&(t._removeDOM=!0),this.nodes=this.nodes.filter(s=>s._id!==t._id),t._isAboutToRemove||this._packNodes(),this._notify([t]),this):this}removeAll(t=!0,e=!0){if(delete this._layouts,!this.nodes.length)return this;t&&this.nodes.forEach(s=>s._removeDOM=!0);let i=this.nodes;return this.removedNodes=e?i:[],this.nodes=[],this._notify(i)}moveNodeCheck(t,e){if(!this.changedPosConstrain(t,e))return!1;if(e.pack=!0,!this.maxRow)return this.moveNode(t,e);let i,s=new a({column:this.column,float:this.float,nodes:this.nodes.map(n=>n._id===t._id?(i=m({},n),i):m({},n))});if(!i)return!1;let o=s.moveNode(i,e)&&s.getRow()<=Math.max(this.getRow(),this.maxRow);if(!o&&!e.resizing&&e.collide){let n=e.collide.el.gridstackNode;if(this.swap(t,n))return this._notify(),!0}return o?(s.nodes.filter(n=>n._dirty).forEach(n=>{let d=this.nodes.find(u=>u._id===n._id);d&&(h.copyPos(d,n),d._dirty=!0)}),this._notify(),!0):!1}willItFit(t){if(delete t._willFitPos,!this.maxRow)return!0;let e=new a({column:this.column,float:this.float,nodes:this.nodes.map(s=>m({},s))}),i=m({},t);return this.cleanupNode(i),delete i.el,delete i._id,delete i.content,delete i.grid,e.addNode(i),e.getRow()<=this.maxRow?(t._willFitPos=h.copyPos({},i),!0):!1}changedPosConstrain(t,e){return e.w=e.w||t.w,e.h=e.h||t.h,t.x!==e.x||t.y!==e.y?!0:(t.maxW&&(e.w=Math.min(e.w,t.maxW)),t.maxH&&(e.h=Math.min(e.h,t.maxH)),t.minW&&(e.w=Math.max(e.w,t.minW)),t.minH&&(e.h=Math.max(e.h,t.minH)),t.w!==e.w||t.h!==e.h)}moveNode(t,e){if(!t||!e)return!1;let i;e.pack===void 0&&!this.batchMode&&(i=e.pack=!0),typeof e.x!="number"&&(e.x=t.x),typeof e.y!="number"&&(e.y=t.y),typeof e.w!="number"&&(e.w=t.w),typeof e.h!="number"&&(e.h=t.h);let s=t.w!==e.w||t.h!==e.h,o=h.copyPos({},t,!0);if(h.copyPos(o,e),this.nodeBoundFix(o,s),h.copyPos(e,o),!e.forceCollide&&h.samePos(t,e))return!1;let n=h.copyPos({},t),d=this.collideAll(t,o,e.skip),u=!0;if(d.length){let c=t._moving&&!e.nested,l=c?this.directionCollideCoverage(t,e,d):d[0];if(c&&l&&t.grid?.opts?.subGridDynamic&&!t.grid._isTemp){let g=h.areaIntercept(e.rect,l._rect),f=h.area(e.rect),E=h.area(l._rect);g/(f<E?f:E)>.8&&(l.grid.makeSubGrid(l.el,void 0,t),l=void 0)}l?u=!this._fixCollisions(t,o,l,e):(u=!1,i&&delete e.pack)}return u&&!h.samePos(t,o)&&(t._dirty=!0,h.copyPos(t,o)),e.pack&&this._packNodes()._notify(),!h.samePos(t,n)}getRow(){return this.nodes.reduce((t,e)=>Math.max(t,e.y+e.h),0)}beginUpdate(t){return t._updating||(t._updating=!0,delete t._skipDown,this.batchMode||this.saveInitial()),this}endUpdate(){let t=this.nodes.find(e=>e._updating);return t&&(delete t._updating,delete t._skipDown),this}save(t=!0,e,i){let s=this._layouts?.length||0,o;s&&(i?i!==this.column&&(o=this._layouts[i]):this.column!==s-1&&(o=this._layouts[s-1]));let n=[];return this.sortNodes(),this.nodes.forEach(d=>{let u=o?.find(l=>l._id===d._id),c=m(m({},d),u||{});h.removeInternalForSave(c,!t),e&&e(d,c),n.push(c)}),n}layoutsNodesChange(t){return!this._layouts||this._inColumnResize?this:(this._layouts.forEach((e,i)=>{if(!e||i===this.column)return this;if(i<this.column)this._layouts[i]=void 0;else{let s=i/this.column;t.forEach(o=>{if(!o._orig)return;let n=e.find(d=>d._id===o._id);n&&(n.y>=0&&o.y!==o._orig.y&&(n.y+=o.y-o._orig.y),o.x!==o._orig.x&&(n.x=Math.round(o.x*s)),o.w!==o._orig.w&&(n.w=Math.round(o.w*s)))})}}),this)}columnChanged(t,e,i="moveScale"){if(!this.nodes.length||!e||t===e)return this;let s=i==="compact"||i==="list";s&&this.sortNodes(1),e<t&&this.cacheLayout(this.nodes,t),this.batchUpdate();let o=[],n=s?this.nodes:h.sort(this.nodes,-1);if(e>t&&this._layouts){let d=this._layouts[e]||[],u=this._layouts.length-1;!d.length&&t!==u&&this._layouts[u]?.length&&(t=u,this._layouts[u].forEach(c=>{let l=n.find(g=>g._id===c._id);l&&(!s&&!c.autoPosition&&(l.x=c.x??l.x,l.y=c.y??l.y),l.w=c.w??l.w,(c.x==null||c.y===void 0)&&(l.autoPosition=!0))})),d.forEach(c=>{let l=n.findIndex(g=>g._id===c._id);if(l!==-1){let g=n[l];if(s){g.w=c.w;return}(c.autoPosition||isNaN(c.x)||isNaN(c.y))&&this.findEmptyPosition(c,o),c.autoPosition||(g.x=c.x??g.x,g.y=c.y??g.y,g.w=c.w??g.w,o.push(g)),n.splice(l,1)}})}if(s)this.compact(i,!1);else{if(n.length)if(typeof i=="function")i(e,t,o,n);else{let d=s||i==="none"?1:e/t,u=i==="move"||i==="moveScale",c=i==="scale"||i==="moveScale";n.forEach(l=>{l.x=e===1?0:u?Math.round(l.x*d):Math.min(l.x,e-1),l.w=e===1||t===1?1:c?Math.round(l.w*d)||1:Math.min(l.w,e),o.push(l)}),n=[]}o=h.sort(o,-1),this._inColumnResize=!0,this.nodes=[],o.forEach(d=>{this.addNode(d,!1),delete d._orig})}return this.nodes.forEach(d=>delete d._orig),this.batchUpdate(!1,!s),delete this._inColumnResize,this}cacheLayout(t,e,i=!1){let s=[];return t.forEach((o,n)=>{if(o._id===void 0){let d=o.id?this.nodes.find(u=>u.id===o.id):void 0;o._id=d?._id??a._idSeq++}s[n]={x:o.x,y:o.y,w:o.w,_id:o._id}}),this._layouts=i?[]:this._layouts||[],this._layouts[e]=s,this}cacheOneLayout(t,e){t._id=t._id??a._idSeq++;let i={x:t.x,y:t.y,w:t.w,_id:t._id};(t.autoPosition||t.x===void 0)&&(delete i.x,delete i.y,t.autoPosition&&(i.autoPosition=!0)),this._layouts=this._layouts||[],this._layouts[e]=this._layouts[e]||[];let s=this.findCacheLayout(t,e);return s===-1?this._layouts[e].push(i):this._layouts[e][s]=i,this}findCacheLayout(t,e){return this._layouts?.[e]?.findIndex(i=>i._id===t._id)??-1}removeNodeFromLayoutCache(t){if(this._layouts)for(let e=0;e<this._layouts.length;e++){let i=this.findCacheLayout(t,e);i!==-1&&this._layouts[e].splice(i,1)}}cleanupNode(t){for(let e in t)e[0]==="_"&&e!=="_id"&&delete t[e];return this}}return a._idSeq=0,a})();var O={alwaysShowResizeHandle:"mobile",animate:!0,auto:!0,cellHeight:"auto",cellHeightThrottle:100,cellHeightUnit:"px",column:12,draggable:{handle:".grid-stack-item-content",appendTo:"body",scroll:!0},handle:".grid-stack-item-content",itemClass:"grid-stack-item",margin:10,marginUnit:"px",maxRow:0,minRow:0,placeholderClass:"grid-stack-placeholder",placeholderText:"",removableOptions:{accept:"grid-stack-item",decline:"grid-stack-non-removable"},resizable:{handles:"se"},rtl:"auto"};var p=class{};var R=typeof window<"u"&&typeof document<"u"&&("ontouchstart"in document||"ontouchstart"in window||window.DocumentTouch&&document instanceof window.DocumentTouch||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0),M=class{};function Ct(a,r){a.touches.length>1||(a.cancelable&&a.preventDefault(),h.simulateMouseEvent(a.changedTouches[0],r))}function Pe(a,r){a.cancelable&&a.preventDefault(),h.simulateMouseEvent(a,r)}function K(a){M.touchHandled||(M.touchHandled=!0,Ct(a,"mousedown"))}function J(a){M.touchHandled&&Ct(a,"mousemove")}function Z(a){if(!M.touchHandled)return;M.pointerLeaveTimeout&&(window.clearTimeout(M.pointerLeaveTimeout),delete M.pointerLeaveTimeout);let r=!!p.dragElement;Ct(a,"mouseup"),r||Ct(a,"click"),M.touchHandled=!1}function tt(a){a.pointerType!=="mouse"&&a.target.releasePointerCapture(a.pointerId)}function Wt(a){p.dragElement&&a.pointerType!=="mouse"&&Pe(a,"mouseenter")}function Gt(a){p.dragElement&&a.pointerType!=="mouse"&&(M.pointerLeaveTimeout=window.setTimeout(()=>{delete M.pointerLeaveTimeout,Pe(a,"mouseleave")},10))}var Le=(()=>{class a{constructor(t,e,i){this.host=t,this.dir=e,this.option=i,this.moving=!1,this._mouseDown=this._mouseDown.bind(this),this._mouseMove=this._mouseMove.bind(this),this._mouseUp=this._mouseUp.bind(this),this._keyEvent=this._keyEvent.bind(this),this._init()}_init(){let t=this.el=document.createElement("div");return t.classList.add("ui-resizable-handle"),t.classList.add(`${a.prefix}${this.dir}`),t.style.zIndex="100",t.style.userSelect="none",this.host.appendChild(this.el),this.el.addEventListener("mousedown",this._mouseDown),R&&(this.el.addEventListener("touchstart",K),this.el.addEventListener("pointerdown",tt)),this}destroy(){return this.moving&&this._mouseUp(this.mouseDownEvent),this.el.removeEventListener("mousedown",this._mouseDown),R&&(this.el.removeEventListener("touchstart",K),this.el.removeEventListener("pointerdown",tt)),this.host.removeChild(this.el),delete this.el,delete this.host,this}_mouseDown(t){this.mouseDownEvent=t,document.addEventListener("mousemove",this._mouseMove,{capture:!0,passive:!0}),document.addEventListener("mouseup",this._mouseUp,!0),R&&(this.el.addEventListener("touchmove",J),this.el.addEventListener("touchend",Z)),t.stopPropagation(),t.preventDefault()}_mouseMove(t){let e=this.mouseDownEvent;this.moving?this._triggerEvent("move",t):Math.abs(t.x-e.x)+Math.abs(t.y-e.y)>2&&(this.moving=!0,this._triggerEvent("start",this.mouseDownEvent),this._triggerEvent("move",t),document.addEventListener("keydown",this._keyEvent)),t.stopPropagation()}_mouseUp(t){this.moving&&(this._triggerEvent("stop",t),document.removeEventListener("keydown",this._keyEvent)),document.removeEventListener("mousemove",this._mouseMove,!0),document.removeEventListener("mouseup",this._mouseUp,!0),R&&(this.el.removeEventListener("touchmove",J),this.el.removeEventListener("touchend",Z)),delete this.moving,delete this.mouseDownEvent,t.stopPropagation(),t.preventDefault()}_keyEvent(t){t.key==="Escape"&&(this.host.gridstackNode?.grid?.engine.restoreInitial(),this._mouseUp(this.mouseDownEvent))}_triggerEvent(t,e){return this.option[t]&&this.option[t](e),this}}return a.prefix="ui-resizable-",a})();var I=class{constructor(){this._eventRegister={}}get disabled(){return this._disabled}on(r,t){this._eventRegister[r]=t}off(r){delete this._eventRegister[r]}enable(){this._disabled=!1}disable(){this._disabled=!0}destroy(){delete this._eventRegister}triggerEvent(r,t){if(!this.disabled&&this._eventRegister&&this._eventRegister[r])return this._eventRegister[r](t)}};var Ae=(()=>{class a extends I{constructor(t,e={}){super(),this.el=t,this.option=e,this.rectScale={x:1,y:1},this._ui=()=>{let s=this.el.parentElement.getBoundingClientRect(),o={width:this.originalRect.width,height:this.originalRect.height+this.scrolled,left:this.originalRect.left,top:this.originalRect.top-this.scrolled},n=this.temporalRect||o;return{position:{left:(n.left-s.left)*this.rectScale.x,top:(n.top-s.top)*this.rectScale.y},size:{width:n.width*this.rectScale.x,height:n.height*this.rectScale.y}}},this._mouseOver=this._mouseOver.bind(this),this._mouseOut=this._mouseOut.bind(this),this.enable(),this._setupAutoHide(this.option.autoHide),this._setupHandlers()}on(t,e){super.on(t,e)}off(t){super.off(t)}enable(){super.enable(),this.el.classList.remove("ui-resizable-disabled"),this._setupAutoHide(this.option.autoHide)}disable(){super.disable(),this.el.classList.add("ui-resizable-disabled"),this._setupAutoHide(!1)}destroy(){this._removeHandlers(),this._setupAutoHide(!1),delete this.el,super.destroy()}updateOption(t){let e=t.handles&&t.handles!==this.option.handles,i=t.autoHide&&t.autoHide!==this.option.autoHide;return Object.keys(t).forEach(s=>this.option[s]=t[s]),e&&(this._removeHandlers(),this._setupHandlers()),i&&this._setupAutoHide(this.option.autoHide),this}_setupAutoHide(t){return t?(this.el.classList.add("ui-resizable-autohide"),this.el.addEventListener("mouseover",this._mouseOver),this.el.addEventListener("mouseout",this._mouseOut)):(this.el.classList.remove("ui-resizable-autohide"),this.el.removeEventListener("mouseover",this._mouseOver),this.el.removeEventListener("mouseout",this._mouseOut),p.overResizeElement===this&&delete p.overResizeElement),this}_mouseOver(t){p.overResizeElement||p.dragElement||(p.overResizeElement=this,this.el.classList.remove("ui-resizable-autohide"))}_mouseOut(t){p.overResizeElement===this&&(delete p.overResizeElement,this.el.classList.add("ui-resizable-autohide"))}_setupHandlers(){return this.handlers=this.option.handles.split(",").map(t=>t.trim()).map(t=>new Le(this.el,t,{start:e=>{this._resizeStart(e)},stop:e=>{this._resizeStop(e)},move:e=>{this._resizing(e,t)}})),this}_resizeStart(t){this.sizeToContent=h.shouldSizeToContent(this.el.gridstackNode,!0),this.originalRect=this.el.getBoundingClientRect(),this.scrollEl=h.getScrollElement(this.el),this.scrollY=this.scrollEl.scrollTop,this.scrolled=0,this.startEvent=t,this._setupHelper(),this._applyChange();let e=h.initEvent(t,{type:"resizestart",target:this.el});return this.option.start&&this.option.start(e,this._ui()),this.el.classList.add("ui-resizable-resizing"),this.triggerEvent("resizestart",e),this}_resizing(t,e){this.scrolled=this.scrollEl.scrollTop-this.scrollY,this.temporalRect=this._getChange(t,e),this._applyChange();let i=h.initEvent(t,{type:"resize",target:this.el});return this.option.resize&&this.option.resize(i,this._ui()),this.triggerEvent("resize",i),this}_resizeStop(t){let e=h.initEvent(t,{type:"resizestop",target:this.el});return this._cleanHelper(),this.option.stop&&this.option.stop(e),this.el.classList.remove("ui-resizable-resizing"),this.triggerEvent("resizestop",e),delete this.startEvent,delete this.originalRect,delete this.temporalRect,delete this.scrollY,delete this.scrolled,this}_setupHelper(){this.elOriginStyleVal=a._originStyleProp.map(i=>this.el.style[i]),this.parentOriginStylePosition=this.el.parentElement.style.position;let t=this.el.parentElement,e=h.getValuesFromTransformedElement(t);return this.rectScale={x:e.xScale,y:e.yScale},getComputedStyle(this.el.parentElement).position.match(/static/)&&(this.el.parentElement.style.position="relative"),this.el.style.position="absolute",this.el.style.opacity="0.8",this}_cleanHelper(){return a._originStyleProp.forEach((t,e)=>{this.el.style[t]=this.elOriginStyleVal[e]||null}),this.el.parentElement.style.position=this.parentOriginStylePosition||null,this}_getChange(t,e){let i=this.startEvent,s={width:this.originalRect.width,height:this.originalRect.height+this.scrolled,left:this.originalRect.left,top:this.originalRect.top-this.scrolled},o=t.clientX-i.clientX,n=this.sizeToContent?0:t.clientY-i.clientY,d,u;e.indexOf("e")>-1?s.width+=o:e.indexOf("w")>-1&&(s.width-=o,s.left+=o,d=!0),e.indexOf("s")>-1?s.height+=n:e.indexOf("n")>-1&&(s.height-=n,s.top+=n,u=!0);let c=this._constrainSize(s.width,s.height,d,u);return Math.round(s.width)!==Math.round(c.width)&&(e.indexOf("w")>-1&&(s.left+=s.width-c.width),s.width=c.width),Math.round(s.height)!==Math.round(c.height)&&(e.indexOf("n")>-1&&(s.top+=s.height-c.height),s.height=c.height),s}_constrainSize(t,e,i,s){let o=this.option,n=(i?o.maxWidthMoveLeft:o.maxWidth)||Number.MAX_SAFE_INTEGER,d=o.minWidth/this.rectScale.x||t,u=(s?o.maxHeightMoveUp:o.maxHeight)||Number.MAX_SAFE_INTEGER,c=o.minHeight/this.rectScale.y||e,l=Math.min(n,Math.max(d,t)),g=Math.min(u,Math.max(c,e));return{width:l,height:g}}_applyChange(){let t={left:0,top:0,width:0,height:0};if(this.el.style.position==="absolute"){let e=this.el.parentElement,{left:i,top:s}=e.getBoundingClientRect();t={left:i,top:s,width:0,height:0}}return this.temporalRect?(Object.keys(this.temporalRect).forEach(e=>{let i=this.temporalRect[e],s=e==="width"||e==="left"?this.rectScale.x:e==="height"||e==="top"?this.rectScale.y:1;this.el.style[e]=(i-t[e])*s+"px"}),this):this}_removeHandlers(){return this.handlers.forEach(t=>t.destroy()),delete this.handlers,this}}return a._originStyleProp=["width","height","position","left","top","opacity","zIndex"],a})();var qe='input,textarea,button,select,option,[contenteditable="true"],.ui-resizable-handle',Be=(()=>{class a extends I{constructor(t,e={}){super(),this.el=t,this.option=e,this.dragTransform={xScale:1,yScale:1,xOffset:0,yOffset:0};let i=e?.handle?.substring(1),s=t.gridstackNode;this.dragEls=!i||t.classList.contains(i)?[t]:s?.subGrid?[t.querySelector(e.handle)||t]:Array.from(t.querySelectorAll(e.handle)),this.dragEls.length===0&&(this.dragEls=[t]),this._mouseDown=this._mouseDown.bind(this),this._mouseMove=this._mouseMove.bind(this),this._mouseUp=this._mouseUp.bind(this),this._keyEvent=this._keyEvent.bind(this),this.enable()}on(t,e){super.on(t,e)}off(t){super.off(t)}enable(){this.disabled!==!1&&(super.enable(),this.dragEls.forEach(t=>{t.addEventListener("mousedown",this._mouseDown),R&&(t.addEventListener("touchstart",K),t.addEventListener("pointerdown",tt))}),this.el.classList.remove("ui-draggable-disabled"))}disable(t=!1){this.disabled!==!0&&(super.disable(),this.dragEls.forEach(e=>{e.removeEventListener("mousedown",this._mouseDown),R&&(e.removeEventListener("touchstart",K),e.removeEventListener("pointerdown",tt))}),t||this.el.classList.add("ui-draggable-disabled"))}destroy(){this.dragTimeout&&window.clearTimeout(this.dragTimeout),delete this.dragTimeout,this.mouseDownEvent&&this._mouseUp(this.mouseDownEvent),this.disable(!0),delete this.el,delete this.helper,delete this.option,super.destroy()}updateOption(t){return Object.keys(t).forEach(e=>this.option[e]=t[e]),this}_mouseDown(t){if(!p.mouseHandled)return t.button!==0||!this.dragEls.find(e=>e===t.target)&&t.target.closest(qe)||this.option.cancel&&t.target.closest(this.option.cancel)||(this.mouseDownEvent=t,delete this.dragging,delete p.dragElement,delete p.dropElement,document.addEventListener("mousemove",this._mouseMove,{capture:!0,passive:!0}),document.addEventListener("mouseup",this._mouseUp,!0),R&&(t.currentTarget.addEventListener("touchmove",J),t.currentTarget.addEventListener("touchend",Z)),t.preventDefault(),document.activeElement&&document.activeElement.blur(),p.mouseHandled=!0),!0}_callDrag(t){if(!this.dragging)return;let e=h.initEvent(t,{target:this.el,type:"drag"});this.option.drag&&this.option.drag(e,this.ui()),this.triggerEvent("drag",e)}_mouseMove(t){let e=this.mouseDownEvent;if(this.lastDrag=t,this.dragging)if(this._dragFollow(t),p.pauseDrag){let i=Number.isInteger(p.pauseDrag)?p.pauseDrag:100;this.dragTimeout&&window.clearTimeout(this.dragTimeout),this.dragTimeout=window.setTimeout(()=>this._callDrag(t),i)}else this._callDrag(t);else if(Math.abs(t.x-e.x)+Math.abs(t.y-e.y)>3){this.dragging=!0,p.dragElement=this;let i=this.el.gridstackNode?.grid;i?p.dropElement=i.el.ddElement.ddDroppable:delete p.dropElement,this.helper=this._createHelper(),this._setupHelperContainmentStyle(),this.dragTransform=h.getValuesFromTransformedElement(this.helperContainment),this.dragOffset=this._getDragOffset(t,this.el,this.helperContainment),this._setupHelperStyle(t);let s=h.initEvent(t,{target:this.el,type:"dragstart"});this.option.start&&this.option.start(s,this.ui()),this.triggerEvent("dragstart",s),document.addEventListener("keydown",this._keyEvent)}return!0}_mouseUp(t){if(document.removeEventListener("mousemove",this._mouseMove,!0),document.removeEventListener("mouseup",this._mouseUp,!0),R&&t.currentTarget&&(t.currentTarget.removeEventListener("touchmove",J,!0),t.currentTarget.removeEventListener("touchend",Z,!0)),this.dragging){delete this.dragging,delete this.el.gridstackNode?._origRotate,document.removeEventListener("keydown",this._keyEvent),p.dropElement?.el===this.el.parentElement&&delete p.dropElement,this.helperContainment.style.position=this.parentOriginStylePosition||null,this.helper!==this.el&&this.helper.remove(),this._removeHelperStyle();let e=h.initEvent(t,{target:this.el,type:"dragstop"});this.option.stop&&this.option.stop(e),this.triggerEvent("dragstop",e),p.dropElement&&p.dropElement.drop(t)}delete this.helper,delete this.mouseDownEvent,delete p.dragElement,delete p.dropElement,delete p.mouseHandled,t.preventDefault()}_keyEvent(t){let e=this.el.gridstackNode,i=e?.grid||p.dropElement?.el?.gridstack;if(t.key==="Escape")e&&e._origRotate&&(e._orig=e._origRotate,delete e._origRotate),i?.cancelDrag(),this._mouseUp(this.mouseDownEvent);else if(e&&i&&(t.key==="r"||t.key==="R")){if(!h.canBeRotated(e))return;e._origRotate=e._origRotate||m({},e._orig),delete e._moving,i.setAnimation(!1).rotate(e.el,{top:-this.dragOffset.offsetTop,left:-this.dragOffset.offsetLeft}).setAnimation(),e._moving=!0,this.dragOffset=this._getDragOffset(this.lastDrag,e.el,this.helperContainment),this.helper.style.width=this.dragOffset.width+"px",this.helper.style.height=this.dragOffset.height+"px",h.swap(e._orig,"w","h"),delete e._rect,this._mouseMove(this.lastDrag)}}_createHelper(){let t=this.el;return typeof this.option.helper=="function"?t=this.option.helper(this.el):this.option.helper==="clone"&&(t=h.cloneNode(this.el)),t.parentElement||h.appendTo(t,this.option.appendTo==="parent"?this.el.parentElement:this.option.appendTo),this.dragElementOriginStyle=a.originStyleProp.map(e=>this.el.style[e]),t}_setupHelperStyle(t){this.helper.classList.add("ui-draggable-dragging"),this.el.gridstackNode?.grid?.el.classList.add("grid-stack-dragging");let e=this.helper.style;return e.pointerEvents="none",e.width=this.dragOffset.width+"px",e.height=this.dragOffset.height+"px",e.willChange="left, top",e.position="fixed",this._dragFollow(t),e.transition="none",setTimeout(()=>{this.helper&&(e.transition=null)},0),this}_removeHelperStyle(){if(this.helper.classList.remove("ui-draggable-dragging"),this.el.gridstackNode?.grid?.el.classList.remove("grid-stack-dragging"),!this.helper?.gridstackNode?._isAboutToRemove&&this.dragElementOriginStyle){let e=this.helper,i=this.dragElementOriginStyle.transition||null;e.style.transition=this.dragElementOriginStyle.transition="none",a.originStyleProp.forEach(s=>e.style[s]=this.dragElementOriginStyle[s]||null),setTimeout(()=>e.style.transition=i,50)}return delete this.dragElementOriginStyle,this}_dragFollow(t){let e={left:0,top:0},i=this.helper.style,s=this.dragOffset;i.left=(t.clientX+s.offsetLeft-e.left)*this.dragTransform.xScale+"px",i.top=(t.clientY+s.offsetTop-e.top)*this.dragTransform.yScale+"px"}_setupHelperContainmentStyle(){return this.helperContainment=this.helper.parentElement,this.helper.style.position!=="fixed"&&(this.parentOriginStylePosition=this.helperContainment.style.position,getComputedStyle(this.helperContainment).position.match(/static/)&&(this.helperContainment.style.position="relative")),this}_getDragOffset(t,e,i){let s=0,o=0;i&&(s=this.dragTransform.xOffset,o=this.dragTransform.yOffset);let n=e.getBoundingClientRect();return{left:n.left,top:n.top,offsetLeft:-t.clientX+n.left-s,offsetTop:-t.clientY+n.top-o,width:n.width*this.dragTransform.xScale,height:n.height*this.dragTransform.yScale}}ui(){let e=this.el.parentElement.getBoundingClientRect(),i=this.helper.getBoundingClientRect();return{position:{top:(i.top-e.top)*this.dragTransform.yScale,left:(i.left-e.left)*this.dragTransform.xScale}}}}return a.originStyleProp=["width","height","transform","transform-origin","transition","pointerEvents","position","left","top","minWidth","willChange"],a})();var xt=class extends I{constructor(r,t={}){super(),this.el=r,this.option=t,this._mouseEnter=this._mouseEnter.bind(this),this._mouseLeave=this._mouseLeave.bind(this),this.enable(),this._setupAccept()}on(r,t){super.on(r,t)}off(r){super.off(r)}enable(){this.disabled!==!1&&(super.enable(),this.el.classList.add("ui-droppable"),this.el.classList.remove("ui-droppable-disabled"),this.el.addEventListener("mouseenter",this._mouseEnter),this.el.addEventListener("mouseleave",this._mouseLeave),R&&(this.el.addEventListener("pointerenter",Wt),this.el.addEventListener("pointerleave",Gt)))}disable(r=!1){this.disabled!==!0&&(super.disable(),this.el.classList.remove("ui-droppable"),r||this.el.classList.add("ui-droppable-disabled"),this.el.removeEventListener("mouseenter",this._mouseEnter),this.el.removeEventListener("mouseleave",this._mouseLeave),R&&(this.el.removeEventListener("pointerenter",Wt),this.el.removeEventListener("pointerleave",Gt)))}destroy(){this.disable(!0),this.el.classList.remove("ui-droppable"),this.el.classList.remove("ui-droppable-disabled"),super.destroy()}updateOption(r){return Object.keys(r).forEach(t=>this.option[t]=r[t]),this._setupAccept(),this}_mouseEnter(r){if(!p.dragElement||!this._canDrop(p.dragElement.el))return;r.preventDefault(),r.stopPropagation(),p.dropElement&&p.dropElement!==this&&p.dropElement._mouseLeave(r,!0),p.dropElement=this;let t=h.initEvent(r,{target:this.el,type:"dropover"});this.option.over&&this.option.over(t,this._ui(p.dragElement)),this.triggerEvent("dropover",t),this.el.classList.add("ui-droppable-over")}_mouseLeave(r,t=!1){if(!p.dragElement||p.dropElement!==this)return;r.preventDefault(),r.stopPropagation();let e=h.initEvent(r,{target:this.el,type:"dropout"});if(this.option.out&&this.option.out(e,this._ui(p.dragElement)),this.triggerEvent("dropout",e),p.dropElement===this&&(delete p.dropElement,!t)){let i,s=this.el.parentElement;for(;!i&&s;)i=s.ddElement?.ddDroppable,s=s.parentElement;i&&i._mouseEnter(r)}}drop(r){r.preventDefault();let t=h.initEvent(r,{target:this.el,type:"drop"});this.option.drop&&this.option.drop(t,this._ui(p.dragElement)),this.triggerEvent("drop",t)}_canDrop(r){return r&&(!this.accept||this.accept(r))}_setupAccept(){return this.option.accept?(typeof this.option.accept=="string"?this.accept=r=>r.classList.contains(this.option.accept)||r.matches(this.option.accept):this.accept=this.option.accept,this):this}_ui(r){return m({draggable:r.el},r.ui())}};var Et=class a{static init(r){return r.ddElement||(r.ddElement=new a(r)),r.ddElement}constructor(r){this.el=r}on(r,t){return this.ddDraggable&&["drag","dragstart","dragstop"].indexOf(r)>-1?this.ddDraggable.on(r,t):this.ddDroppable&&["drop","dropover","dropout"].indexOf(r)>-1?this.ddDroppable.on(r,t):this.ddResizable&&["resizestart","resize","resizestop"].indexOf(r)>-1&&this.ddResizable.on(r,t),this}off(r){return this.ddDraggable&&["drag","dragstart","dragstop"].indexOf(r)>-1?this.ddDraggable.off(r):this.ddDroppable&&["drop","dropover","dropout"].indexOf(r)>-1?this.ddDroppable.off(r):this.ddResizable&&["resizestart","resize","resizestop"].indexOf(r)>-1&&this.ddResizable.off(r),this}setupDraggable(r){return this.ddDraggable?this.ddDraggable.updateOption(r):this.ddDraggable=new Be(this.el,r),this}cleanDraggable(){return this.ddDraggable&&(this.ddDraggable.destroy(),delete this.ddDraggable),this}setupResizable(r){return this.ddResizable?this.ddResizable.updateOption(r):this.ddResizable=new Ae(this.el,r),this}cleanResizable(){return this.ddResizable&&(this.ddResizable.destroy(),delete this.ddResizable),this}setupDroppable(r){return this.ddDroppable?this.ddDroppable.updateOption(r):this.ddDroppable=new xt(this.el,r),this}cleanDroppable(){return this.ddDroppable&&(this.ddDroppable.destroy(),delete this.ddDroppable),this}};var Dt=class{resizable(r,t,e,i){return this._getDDElements(r,t).forEach(s=>{if(t==="disable"||t==="enable")s.ddResizable&&s.ddResizable[t]();else if(t==="destroy")s.ddResizable&&s.cleanResizable();else if(t==="option")s.setupResizable({[e]:i});else{let n=s.el.gridstackNode.grid,d=s.el.getAttribute("gs-resize-handles")||n.opts.resizable.handles||"e,s,se";d==="all"&&(d="n,e,s,w,se,sw,ne,nw");let u=!n.opts.alwaysShowResizeHandle;s.setupResizable(w(m({},n.opts.resizable),{handles:d,autoHide:u,start:t.start,stop:t.stop,resize:t.resize}))}}),this}draggable(r,t,e,i){return this._getDDElements(r,t).forEach(s=>{if(t==="disable"||t==="enable")s.ddDraggable&&s.ddDraggable[t]();else if(t==="destroy")s.ddDraggable&&s.cleanDraggable();else if(t==="option")s.setupDraggable({[e]:i});else{let o=s.el.gridstackNode.grid;s.setupDraggable(w(m({},o.opts.draggable),{start:t.start,stop:t.stop,drag:t.drag}))}}),this}dragIn(r,t){return this._getDDElements(r).forEach(e=>e.setupDraggable(t)),this}droppable(r,t,e,i){return typeof t.accept=="function"&&!t._accept&&(t._accept=t.accept,t.accept=s=>t._accept(s)),this._getDDElements(r,t).forEach(s=>{t==="disable"||t==="enable"?s.ddDroppable&&s.ddDroppable[t]():t==="destroy"?s.ddDroppable&&s.cleanDroppable():t==="option"?s.setupDroppable({[e]:i}):s.setupDroppable(t)}),this}isDroppable(r){return!!(r?.ddElement?.ddDroppable&&!r.ddElement.ddDroppable.disabled)}isDraggable(r){return!!(r?.ddElement?.ddDraggable&&!r.ddElement.ddDraggable.disabled)}isResizable(r){return!!(r?.ddElement?.ddResizable&&!r.ddElement.ddResizable.disabled)}on(r,t,e){return this._getDDElements(r).forEach(i=>i.on(t,s=>{e(s,p.dragElement?p.dragElement.el:s.target,p.dragElement?p.dragElement.helper:null)})),this}off(r,t){return this._getDDElements(r).forEach(e=>e.off(t)),this}_getDDElements(r,t){let e=r.gridstack||t!=="destroy"&&t!=="disable",i=h.getElements(r);return i.length?i.map(o=>o.ddElement||(e?Et.init(o):null)).filter(o=>o):[]}};var k=new Dt,W=(()=>{class a{static init(t={},e=".grid-stack"){if(typeof document>"u")return null;let i=a.getGridElement(e);return i?(i.gridstack||(i.gridstack=new a(i,h.cloneDeep(t))),i.gridstack):(console.error(typeof e=="string"?'GridStack.initAll() no grid was found with selector "'+e+`" - element missing or wrong selector ?
|
|
2
|
-
Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the default selector.`:"GridStack.init() no grid element was passed."),null)}static initAll(t={},e=".grid-stack"){let i=[];return typeof document>"u"||(a.getGridElements(e).forEach(s=>{s.gridstack||(s.gridstack=new a(s,h.cloneDeep(t))),i.push(s.gridstack)}),i.length===0&&console.error('GridStack.initAll() no grid was found with selector "'+e+`" - element missing or wrong selector ?
|
|
3
|
-
Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the default selector.`)),i}static addGrid(t,e={}){if(!t)return null;let i=t;if(i.gridstack){let n=i.gridstack;return e&&(n.opts=m(m({},n.opts),e)),e.children!==void 0&&n.load(e.children),n}return(!t.classList.contains("grid-stack")||a.addRemoveCB)&&(a.addRemoveCB?i=a.addRemoveCB(t,e,!0,!0):i=h.createDiv(["grid-stack",e.class],t)),a.init(e,i)}static registerEngine(t){a.engineClass=t}get placeholder(){if(!this._placeholder){this._placeholder=h.createDiv([this.opts.placeholderClass,O.itemClass,this.opts.itemClass]);let t=h.createDiv(["placeholder-content"],this._placeholder);this.opts.placeholderText&&(t.textContent=this.opts.placeholderText)}return this._placeholder}constructor(t,e={}){this.el=t,this.opts=e,this.animationDelay=310,this._gsEventHandler={},this._extraDragRow=0,this.dragTransform={xScale:1,yScale:1,xOffset:0,yOffset:0},t.gridstack=this,this.opts=e=e||{},t.classList.contains("grid-stack")||this.el.classList.add("grid-stack"),e.row&&(e.minRow=e.maxRow=e.row,delete e.row);let i=h.toNumber(t.getAttribute("gs-row"));e.column==="auto"&&delete e.column,e.alwaysShowResizeHandle!==void 0&&(e._alwaysShowResizeHandle=e.alwaysShowResizeHandle);let s=e.columnOpts;if(s){let c=s.breakpoints;!s.columnWidth&&!c?.length?delete e.columnOpts:(s.columnMax=s.columnMax||12,c?.length>1&&c.sort((l,g)=>(g.w||0)-(l.w||0)))}let o=w(m({},h.cloneDeep(O)),{column:h.toNumber(t.getAttribute("gs-column"))||O.column,minRow:i||h.toNumber(t.getAttribute("gs-min-row"))||O.minRow,maxRow:i||h.toNumber(t.getAttribute("gs-max-row"))||O.maxRow,staticGrid:h.toBool(t.getAttribute("gs-static"))||O.staticGrid,sizeToContent:h.toBool(t.getAttribute("gs-size-to-content"))||void 0,draggable:{handle:(e.handleClass?"."+e.handleClass:e.handle?e.handle:"")||O.draggable.handle},removableOptions:{accept:e.itemClass||O.removableOptions.accept,decline:O.removableOptions.decline}});t.getAttribute("gs-animate")&&(o.animate=h.toBool(t.getAttribute("gs-animate"))),e=h.defaults(e,o),this._initMargin(),this.checkDynamicColumn(),this._updateColumnVar(e),e.rtl==="auto"&&(e.rtl=t.style.direction==="rtl"),e.rtl&&this.el.classList.add("grid-stack-rtl");let d=this.el.closest("."+O.itemClass)?.gridstackNode;if(d&&(d.subGrid=this,this.parentGridNode=d,this.el.classList.add("grid-stack-nested"),d.el.classList.add("grid-stack-sub-grid")),this._isAutoCellHeight=e.cellHeight==="auto",this._isAutoCellHeight||e.cellHeight==="initial")this.cellHeight(void 0);else{typeof e.cellHeight=="number"&&e.cellHeightUnit&&e.cellHeightUnit!==O.cellHeightUnit&&(e.cellHeight=e.cellHeight+e.cellHeightUnit,delete e.cellHeightUnit);let c=e.cellHeight;delete e.cellHeight,this.cellHeight(c)}e.alwaysShowResizeHandle==="mobile"&&(e.alwaysShowResizeHandle=R),this._setStaticClass();let u=e.engineClass||a.engineClass||It;if(this.engine=new u({column:this.getColumn(),float:e.float,maxRow:e.maxRow,onChange:c=>{c.forEach(l=>{let g=l.el;g&&(l._removeDOM?(g&&g.remove(),delete l._removeDOM):this._writePosAttr(g,l))}),this._updateContainerHeight()}}),e.auto&&(this.batchUpdate(),this.engine._loading=!0,this.getGridItems().forEach(c=>this._prepareElement(c)),delete this.engine._loading,this.batchUpdate(!1)),e.children){let c=e.children;delete e.children,c.length&&this.load(c)}this.setAnimation(),e.subGridDynamic&&!p.pauseDrag&&(p.pauseDrag=!0),e.draggable?.pause!==void 0&&(p.pauseDrag=e.draggable.pause),this._setupRemoveDrop(),this._setupAcceptWidget(),this._updateResizeEvent()}_updateColumnVar(t=this.opts){this.el.classList.add("gs-"+t.column),typeof t.column=="number"&&this.el.style.setProperty("--gs-column-width",`${100/t.column}%`)}addWidget(t){if(!t)return;if(typeof t=="string"){console.error("V11: GridStack.addWidget() does not support string anymore. see #2736");return}if(t.ELEMENT_NODE)return console.error("V11: GridStack.addWidget() does not support HTMLElement anymore. use makeWidget()"),this.makeWidget(t);let e,i=t;if(i.grid=this,i.el?e=i.el:a.addRemoveCB?e=a.addRemoveCB(this.el,t,!0,!1):e=this.createWidgetDivs(i),!e)return;if(i=e.gridstackNode,i&&e.parentElement===this.el&&this.engine.nodes.find(o=>o._id===i._id))return e;let s=this._readAttr(e);return h.defaults(t,s),this.engine.prepareNode(t),this.el.appendChild(e),this.makeWidget(e,t),e}createWidgetDivs(t){let e=h.createDiv(["grid-stack-item",this.opts.itemClass]),i=h.createDiv(["grid-stack-item-content"],e);return h.lazyLoad(t)?t.visibleObservable||(t.visibleObservable=new IntersectionObserver(([s])=>{s.isIntersecting&&(t.visibleObservable?.disconnect(),delete t.visibleObservable,a.renderCB(i,t),t.grid?.prepareDragDrop(t.el))}),window.setTimeout(()=>t.visibleObservable?.observe(e))):a.renderCB(i,t),e}makeSubGrid(t,e,i,s=!0){let o=t.gridstackNode;if(o||(o=this.makeWidget(t).gridstackNode),o.subGrid?.el)return o.subGrid;let n,d=this;for(;d&&!n;)n=d.opts?.subGridOpts,d=d.parentGridNode?.grid;e=h.cloneDeep(m(m(w(m({},this.opts),{id:void 0,children:void 0,column:"auto",columnOpts:void 0,layout:"list",subGridOpts:void 0}),n||{}),e||o.subGridOpts||{})),o.subGridOpts=e;let u;e.column==="auto"&&(u=!0,e.column=Math.max(o.w||1,i?.w||1),delete e.columnOpts);let c=o.el.querySelector(".grid-stack-item-content"),l,g;if(s&&(this._removeDD(o.el),g=w(m({},o),{x:0,y:0}),h.removeInternalForSave(g),delete g.subGridOpts,o.content&&(g.content=o.content,delete o.content),a.addRemoveCB?l=a.addRemoveCB(this.el,g,!0,!1):(l=h.createDiv(["grid-stack-item"]),l.appendChild(c),c=h.createDiv(["grid-stack-item-content"],o.el)),this.prepareDragDrop(o.el)),i){let E=u?e.column:o.w,z=o.h+i.h,A=o.el.style;A.transition="none",this.update(o.el,{w:E,h:z}),setTimeout(()=>A.transition=null)}let f=o.subGrid=a.addGrid(c,e);return i?._moving&&(f._isTemp=!0),u&&(f._autoColumn=!0),s&&f.makeWidget(l,g),i&&(i._moving?window.setTimeout(()=>h.simulateMouseEvent(i._event,"mouseenter",f.el),0):f.makeWidget(o.el,o)),this.resizeToContentCheck(!1,o),f}removeAsSubGrid(t){let e=this.parentGridNode?.grid;e&&(e.batchUpdate(),e.removeWidget(this.parentGridNode.el,!0,!0),this.engine.nodes.forEach(i=>{i.x+=this.parentGridNode.x,i.y+=this.parentGridNode.y,e.makeWidget(i.el,i)}),e.batchUpdate(!1),this.parentGridNode&&delete this.parentGridNode.subGrid,delete this.parentGridNode,t&&window.setTimeout(()=>h.simulateMouseEvent(t._event,"mouseenter",e.el),0))}save(t=!0,e=!1,i=a.saveCB,s){let o=this.engine.save(t,i,s);if(o.forEach(n=>{if(t&&n.el&&!n.subGrid&&!i){let d=n.el.querySelector(".grid-stack-item-content");n.content=d?.innerHTML,n.content||delete n.content}else if(!t&&!i&&delete n.content,n.subGrid?.el){let d=n.w||n.subGrid.getColumn(),u=n.subGrid.save(t,e,i,d);n.subGridOpts=e?u:{children:u},delete n.subGrid}delete n.el}),e){let n=h.cloneDeep(this.opts);n.marginBottom===n.marginTop&&n.marginRight===n.marginLeft&&n.marginTop===n.marginRight&&(n.margin=n.marginTop,delete n.marginTop,delete n.marginRight,delete n.marginBottom,delete n.marginLeft),n.rtl===(this.el.style.direction==="rtl")&&(n.rtl="auto"),this._isAutoCellHeight&&(n.cellHeight="auto"),this._autoColumn&&(n.column="auto");let d=n._alwaysShowResizeHandle;return delete n._alwaysShowResizeHandle,d!==void 0?n.alwaysShowResizeHandle=d:delete n.alwaysShowResizeHandle,h.removeInternalAndSame(n,O),n.children=o,n}return o}load(t,e=a.addRemoveCB||!0){t=h.cloneDeep(t);let i=this.getColumn();t.forEach(l=>{l.w=l.w||l.minW||1,l.h=l.h||l.minH||1}),t=h.sort(t),this.engine.skipCacheUpdate=this._ignoreLayoutsNodeChange=!0;let s=0;t.forEach(l=>{s=Math.max(s,(l.x||0)+l.w)}),s>this.engine.defaultColumn&&(this.engine.defaultColumn=s),s>i&&(this.engine.nodes.length===0&&this.responseLayout?(this.engine.nodes=t,this.engine.columnChanged(s,i,this.responseLayout),t=this.engine.nodes,this.engine.nodes=[],delete this.responseLayout):this.engine.cacheLayout(t,s,!0));let o=a.addRemoveCB;typeof e=="function"&&(a.addRemoveCB=e);let n=[];this.batchUpdate();let d=!this.engine.nodes.length,u=d&&this.opts.animate;u&&this.setAnimation(!1),!d&&e&&[...this.engine.nodes].forEach(g=>{if(!g.id)return;h.find(t,g.id)||(a.addRemoveCB&&a.addRemoveCB(this.el,g,!1,!1),n.push(g),this.removeWidget(g.el,!0,!1))}),this.engine._loading=!0;let c=[];return this.engine.nodes=this.engine.nodes.filter(l=>h.find(t,l.id)?(c.push(l),!1):!0),t.forEach(l=>{let g=h.find(c,l.id);if(g){if(h.shouldSizeToContent(g)&&(l.h=g.h),this.engine.nodeBoundFix(l),(l.autoPosition||l.x===void 0||l.y===void 0)&&(l.w=l.w||g.w,l.h=l.h||g.h,this.engine.findEmptyPosition(l)),this.engine.nodes.push(g),h.samePos(g,l)&&this.engine.nodes.length>1&&(this.moveNode(g,w(m({},l),{forceCollide:!0})),h.copyPos(l,g)),this.update(g.el,l),l.subGridOpts?.children){let f=g.el.querySelector(".grid-stack");f&&f.gridstack&&f.gridstack.load(l.subGridOpts.children)}}else e&&this.addWidget(l)}),delete this.engine._loading,this.engine.removedNodes=n,this.batchUpdate(!1),delete this._ignoreLayoutsNodeChange,delete this.engine.skipCacheUpdate,o?a.addRemoveCB=o:delete a.addRemoveCB,u&&this.setAnimation(!0,!0),this}batchUpdate(t=!0){return this.engine.batchUpdate(t),t||(this._updateContainerHeight(),this._triggerRemoveEvent(),this._triggerAddEvent(),this._triggerChangeEvent()),this}getCellHeight(t=!1){if(this.opts.cellHeight&&this.opts.cellHeight!=="auto"&&(!t||!this.opts.cellHeightUnit||this.opts.cellHeightUnit==="px"))return this.opts.cellHeight;if(this.opts.cellHeightUnit==="rem")return this.opts.cellHeight*parseFloat(getComputedStyle(document.documentElement).fontSize);if(this.opts.cellHeightUnit==="em")return this.opts.cellHeight*parseFloat(getComputedStyle(this.el).fontSize);if(this.opts.cellHeightUnit==="cm")return this.opts.cellHeight*(96/2.54);if(this.opts.cellHeightUnit==="mm")return this.opts.cellHeight*(96/2.54)/10;let e=this.el.querySelector("."+this.opts.itemClass);if(e){let s=h.toNumber(e.getAttribute("gs-h"))||1;return Math.round(e.offsetHeight/s)}let i=parseInt(this.el.getAttribute("gs-current-row"));return i?Math.round(this.el.getBoundingClientRect().height/i):this.opts.cellHeight}cellHeight(t){if(t!==void 0&&this._isAutoCellHeight!==(t==="auto")&&(this._isAutoCellHeight=t==="auto",this._updateResizeEvent()),(t==="initial"||t==="auto")&&(t=void 0),t===void 0){let i=-this.opts.marginRight-this.opts.marginLeft+this.opts.marginTop+this.opts.marginBottom;t=this.cellWidth()+i}let e=h.parseHeight(t);return this.opts.cellHeightUnit===e.unit&&this.opts.cellHeight===e.h?this:(this.opts.cellHeightUnit=e.unit,this.opts.cellHeight=e.h,this.el.style.setProperty("--gs-cell-height",`${this.opts.cellHeight}${this.opts.cellHeightUnit}`),this._updateContainerHeight(),this.resizeToContentCheck(),this)}cellWidth(){return this._widthOrContainer()/this.getColumn()}_widthOrContainer(t=!1){return t&&this.opts.columnOpts?.breakpointForWindow?window.innerWidth:this.el.clientWidth||this.el.parentElement.clientWidth||window.innerWidth}checkDynamicColumn(){let t=this.opts.columnOpts;if(!t||!t.columnWidth&&!t.breakpoints?.length)return!1;let e=this.getColumn(),i=e,s=this._widthOrContainer(!0);if(t.columnWidth)i=Math.min(Math.round(s/t.columnWidth)||1,t.columnMax);else{i=t.columnMax;let o=0;for(;o<t.breakpoints.length&&s<=t.breakpoints[o].w;)i=t.breakpoints[o++].c||e}if(i!==e){let o=t.breakpoints?.find(n=>n.c===i);return this.column(i,o?.layout||t.layout),!0}return!1}compact(t="compact",e=!0){return this.engine.compact(t,e),this._triggerChangeEvent(),this}column(t,e="moveScale"){if(!t||t<1||this.opts.column===t)return this;let i=this.getColumn();return this.opts.column=t,this.engine?(this.engine.column=t,this.el.classList.remove("gs-"+i),this._updateColumnVar(),this.engine.columnChanged(i,t,e),this._isAutoCellHeight&&this.cellHeight(),this.resizeToContentCheck(!0),this._ignoreLayoutsNodeChange=!0,this._triggerChangeEvent(),delete this._ignoreLayoutsNodeChange,this):(this.responseLayout=e,this)}getColumn(){return this.opts.column}getGridItems(){return Array.from(this.el.children).filter(t=>t.matches("."+this.opts.itemClass)&&!t.matches("."+this.opts.placeholderClass))}isIgnoreChangeCB(){return this._ignoreLayoutsNodeChange}destroy(t=!0){if(this.el)return this.offAll(),this._updateResizeEvent(!0),this.setStatic(!0,!1),this.setAnimation(!1),t?this.el.parentNode.removeChild(this.el):(this.removeAll(t),this.el.removeAttribute("gs-current-row")),this.parentGridNode&&delete this.parentGridNode.subGrid,delete this.parentGridNode,delete this.opts,delete this._placeholder?.gridstackNode,delete this._placeholder,delete this.engine,delete this.el.gridstack,delete this.el,this}float(t){return this.opts.float!==t&&(this.opts.float=this.engine.float=t,this._triggerChangeEvent()),this}getFloat(){return this.engine.float}getCellFromPixel(t,e=!1){let i=this.el.getBoundingClientRect(),s;e?s={top:i.top+document.documentElement.scrollTop,left:i.left}:s={top:this.el.offsetTop,left:this.el.offsetLeft};let o=t.left-s.left,n=t.top-s.top,d=i.width/this.getColumn(),u=i.height/parseInt(this.el.getAttribute("gs-current-row"));return{x:Math.floor(o/d),y:Math.floor(n/u)}}getRow(){return Math.max(this.engine.getRow(),this.opts.minRow||0)}isAreaEmpty(t,e,i,s){return this.engine.isAreaEmpty(t,e,i,s)}makeWidget(t,e){let i=a.getElement(t);if(!i||i.gridstackNode)return i;i.parentElement||this.el.appendChild(i),this._prepareElement(i,!0,e);let s=i.gridstackNode;this._updateContainerHeight(),s.subGridOpts&&this.makeSubGrid(i,s.subGridOpts,void 0,!1);let o;return this.opts.column===1&&!this._ignoreLayoutsNodeChange&&(o=this._ignoreLayoutsNodeChange=!0),this._triggerAddEvent(),this._triggerChangeEvent(),o&&delete this._ignoreLayoutsNodeChange,i}on(t,e){return t.indexOf(" ")!==-1?(t.split(" ").forEach(s=>this.on(s,e)),this):(t==="change"||t==="added"||t==="removed"||t==="enable"||t==="disable"?(t==="enable"||t==="disable"?this._gsEventHandler[t]=s=>e(s):this._gsEventHandler[t]=s=>{s.detail&&e(s,s.detail)},this.el.addEventListener(t,this._gsEventHandler[t])):t==="drag"||t==="dragstart"||t==="dragstop"||t==="resizestart"||t==="resize"||t==="resizestop"||t==="dropped"||t==="resizecontent"?this._gsEventHandler[t]=e:console.error("GridStack.on("+t+") event not supported"),this)}off(t){return t.indexOf(" ")!==-1?(t.split(" ").forEach(i=>this.off(i)),this):((t==="change"||t==="added"||t==="removed"||t==="enable"||t==="disable")&&this._gsEventHandler[t]&&this.el.removeEventListener(t,this._gsEventHandler[t]),delete this._gsEventHandler[t],this)}offAll(){return Object.keys(this._gsEventHandler).forEach(t=>this.off(t)),this}removeWidget(t,e=!0,i=!0){return t?(a.getElements(t).forEach(s=>{if(s.parentElement&&s.parentElement!==this.el)return;let o=s.gridstackNode;o||(o=this.engine.nodes.find(n=>s===n.el)),o&&(e&&a.addRemoveCB&&a.addRemoveCB(this.el,o,!1,!1),delete s.gridstackNode,this._removeDD(s),this.engine.removeNode(o,e,i),e&&s.parentElement&&s.remove())}),i&&(this._triggerRemoveEvent(),this._triggerChangeEvent()),this):(console.error("Error: GridStack.removeWidget(undefined) called"),this)}removeAll(t=!0,e=!0){return this.engine.nodes.forEach(i=>{t&&a.addRemoveCB&&a.addRemoveCB(this.el,i,!1,!1),delete i.el.gridstackNode,this.opts.staticGrid||this._removeDD(i.el)}),this.engine.removeAll(t,e),e&&this._triggerRemoveEvent(),this}setAnimation(t=this.opts.animate,e){return e?setTimeout(()=>{this.opts&&this.setAnimation(t)}):t?this.el.classList.add("grid-stack-animate"):this.el.classList.remove("grid-stack-animate"),this.opts.animate=t,this}hasAnimationCSS(){return this.el.classList.contains("grid-stack-animate")}setStatic(t,e=!0,i=!0){return!!this.opts.staticGrid===t?this:(t?this.opts.staticGrid=!0:delete this.opts.staticGrid,this._setupRemoveDrop(),this._setupAcceptWidget(),this.engine.nodes.forEach(s=>{this.prepareDragDrop(s.el),s.subGrid&&i&&s.subGrid.setStatic(t,e,i)}),e&&this._setStaticClass(),this)}updateOptions(t){let e=this.opts;return t===e?this:(t.acceptWidgets!==void 0&&(e.acceptWidgets=t.acceptWidgets,this._setupAcceptWidget()),t.animate!==void 0&&this.setAnimation(t.animate),t.cellHeight&&this.cellHeight(t.cellHeight),t.class!==void 0&&t.class!==e.class&&(e.class&&this.el.classList.remove(e.class),t.class&&this.el.classList.add(t.class)),t.columnOpts?(this.opts.columnOpts=t.columnOpts,this.checkDynamicColumn()):t.columnOpts===null&&this.opts.columnOpts?(delete this.opts.columnOpts,this._updateResizeEvent()):typeof t.column=="number"&&this.column(t.column),t.margin!==void 0&&this.margin(t.margin),t.staticGrid!==void 0&&this.setStatic(t.staticGrid),t.disableDrag!==void 0&&!t.staticGrid&&this.enableMove(!t.disableDrag),t.disableResize!==void 0&&!t.staticGrid&&this.enableResize(!t.disableResize),t.float!==void 0&&this.float(t.float),t.row!==void 0?(e.minRow=e.maxRow=e.row=t.row,this._updateContainerHeight()):(t.minRow!==void 0&&(e.minRow=t.minRow,this._updateContainerHeight()),t.maxRow!==void 0&&(e.maxRow=t.maxRow)),t.children?.length&&this.load(t.children),this)}update(t,e){return a.getElements(t).forEach(i=>{let s=i?.gridstackNode;if(!s)return;let o=m(m({},h.copyPos({},s)),h.cloneDeep(e));this.engine.nodeBoundFix(o),delete o.autoPosition;let n=["x","y","w","h"],d;if(n.some(l=>o[l]!==void 0&&o[l]!==s[l])&&(d={},n.forEach(l=>{d[l]=o[l]!==void 0?o[l]:s[l],delete o[l]})),!d&&(o.minW||o.minH||o.maxW||o.maxH)&&(d={}),o.content!==void 0){let l=i.querySelector(".grid-stack-item-content");l&&l.textContent!==o.content&&(s.content=o.content,a.renderCB(l,o),s.subGrid?.el&&(l.appendChild(s.subGrid.el),s.subGrid._updateContainerHeight())),delete o.content}let u=!1,c=!1;for(let l in o)l[0]!=="_"&&s[l]!==o[l]&&(s[l]=o[l],u=!0,c=c||!this.opts.staticGrid&&(l==="noResize"||l==="noMove"||l==="locked"));if(h.sanitizeMinMax(s),d){let l=d.w!==void 0&&d.w!==s.w;this.moveNode(s,d),l&&s.subGrid?s.subGrid.onResize(this.hasAnimationCSS()?s.w:void 0):this.resizeToContentCheck(l,s),delete s._orig}(d||u)&&this._writeAttr(i,s),c&&this.prepareDragDrop(s.el),a.updateCB&&a.updateCB(s)}),this}moveNode(t,e){let i=t._updating;i||this.engine.cleanNodes().beginUpdate(t),this.engine.moveNode(t,e),this._updateContainerHeight(),i||(this._triggerChangeEvent(),this.engine.endUpdate())}resizeToContent(t){if(!t||(t.classList.remove("size-to-content-max"),!t.clientHeight))return;let e=t.gridstackNode;if(!e)return;let i=e.grid;if(!i||t.parentElement!==i.el)return;let s=i.getCellHeight(!0);if(!s)return;let o=e.h?e.h*s:t.clientHeight,n;if(e.resizeToContentParent&&(n=t.querySelector(e.resizeToContentParent)),n||(n=t.querySelector(a.resizeToContentParent)),!n)return;let d=t.clientHeight-n.clientHeight,u=e.h?e.h*s-d:n.clientHeight,c;if(e.subGrid){c=e.subGrid.getRow()*e.subGrid.getCellHeight(!0);let f=e.subGrid.el.getBoundingClientRect(),E=t.getBoundingClientRect();c+=f.top-E.top}else{if(e.subGridOpts?.children?.length)return;{let f=n.firstElementChild;if(!f){console.error(`Error: GridStack.resizeToContent() widget id:${e.id} '${a.resizeToContentParent}'.firstElementChild is null, make sure to have a div like container. Skipping sizing.`);return}c=f.getBoundingClientRect().height||u}}if(u===c)return;o+=c-u;let l=Math.ceil(o/s),g=Number.isInteger(e.sizeToContent)?e.sizeToContent:0;g&&l>g&&(l=g,t.classList.add("size-to-content-max")),e.minH&&l<e.minH?l=e.minH:e.maxH&&l>e.maxH&&(l=e.maxH),l!==e.h&&(i._ignoreLayoutsNodeChange=!0,i.moveNode(e,{h:l}),delete i._ignoreLayoutsNodeChange)}resizeToContentCBCheck(t){a.resizeToContentCB?a.resizeToContentCB(t):this.resizeToContent(t)}rotate(t,e){return a.getElements(t).forEach(i=>{let s=i.gridstackNode;if(!h.canBeRotated(s))return;let o={w:s.h,h:s.w,minH:s.minW,minW:s.minH,maxH:s.maxW,maxW:s.maxH};if(e){let d=e.left>0?Math.floor(e.left/this.cellWidth()):0,u=e.top>0?Math.floor(e.top/this.opts.cellHeight):0;o.x=s.x+d-(s.h-(u+1)),o.y=s.y+u-d}Object.keys(o).forEach(d=>{o[d]===void 0&&delete o[d]});let n=s._orig;this.update(i,o),s._orig=n}),this}margin(t){if(!(typeof t=="string"&&t.split(" ").length>1)){let i=h.parseHeight(t);if(this.opts.marginUnit===i.unit&&this.opts.margin===i.h)return}return this.opts.margin=t,this.opts.marginTop=this.opts.marginBottom=this.opts.marginLeft=this.opts.marginRight=void 0,this._initMargin(),this}getMargin(){return this.opts.margin}willItFit(t){if(arguments.length>1){console.warn("gridstack.ts: `willItFit(x,y,w,h,autoPosition)` is deprecated. Use `willItFit({x, y,...})`. It will be removed soon");let e=arguments,i=0,s={x:e[i++],y:e[i++],w:e[i++],h:e[i++],autoPosition:e[i++]};return this.willItFit(s)}return this.engine.willItFit(t)}_triggerChangeEvent(){if(this.engine.batchMode)return this;let t=this.engine.getDirtyNodes(!0);return t&&t.length&&(this._ignoreLayoutsNodeChange||this.engine.layoutsNodesChange(t),this._triggerEvent("change",t)),this.engine.saveInitial(),this}_triggerAddEvent(){if(this.engine.batchMode)return this;if(this.engine.addedNodes?.length){this._ignoreLayoutsNodeChange||this.engine.layoutsNodesChange(this.engine.addedNodes),this.engine.addedNodes.forEach(e=>{delete e._dirty});let t=[...this.engine.addedNodes];this.engine.addedNodes=[],this._triggerEvent("added",t)}return this}_triggerRemoveEvent(){if(this.engine.batchMode)return this;if(this.engine.removedNodes?.length){let t=[...this.engine.removedNodes];this.engine.removedNodes=[],this._triggerEvent("removed",t)}return this}_triggerEvent(t,e){let i=e?new CustomEvent(t,{bubbles:!1,detail:e}):new Event(t),s=this;for(;s.parentGridNode;)s=s.parentGridNode.grid;return s.el.dispatchEvent(i),this}_updateContainerHeight(){if(!this.engine||this.engine.batchMode)return this;let t=this.parentGridNode,e=this.getRow()+this._extraDragRow,i=this.opts.cellHeight,s=this.opts.cellHeightUnit;if(!i)return this;if(!t&&!this.opts.minRow){let o=h.parseHeight(getComputedStyle(this.el).minHeight);if(o.h>0&&o.unit===s){let n=Math.floor(o.h/i);e<n&&(e=n)}}return this.el.setAttribute("gs-current-row",String(e)),this.el.style.removeProperty("min-height"),this.el.style.removeProperty("height"),e&&(this.el.style[t?"minHeight":"height"]=e*i+s),t&&h.shouldSizeToContent(t)&&t.grid.resizeToContentCBCheck(t.el),this}_prepareElement(t,e=!1,i){i=i||this._readAttr(t),t.gridstackNode=i,i.el=t,i.grid=this,i=this.engine.addNode(i,e),this._writeAttr(t,i),t.classList.add(O.itemClass,this.opts.itemClass);let s=h.shouldSizeToContent(i);return s?t.classList.add("size-to-content"):t.classList.remove("size-to-content"),s&&this.resizeToContentCheck(!1,i),h.lazyLoad(i)||this.prepareDragDrop(i.el),this}_writePosAttr(t,e){return(!e._moving&&!e._resizing||this._placeholder===t)&&(t.style.top=e.y?e.y===1?"var(--gs-cell-height)":`calc(${e.y} * var(--gs-cell-height))`:null,t.style.left=e.x?e.x===1?"var(--gs-column-width)":`calc(${e.x} * var(--gs-column-width))`:null,t.style.width=e.w>1?`calc(${e.w} * var(--gs-column-width))`:null,t.style.height=e.h>1?`calc(${e.h} * var(--gs-cell-height))`:null),e.x>0?t.setAttribute("gs-x",String(e.x)):t.removeAttribute("gs-x"),e.y>0?t.setAttribute("gs-y",String(e.y)):t.removeAttribute("gs-y"),e.w>1?t.setAttribute("gs-w",String(e.w)):t.removeAttribute("gs-w"),e.h>1?t.setAttribute("gs-h",String(e.h)):t.removeAttribute("gs-h"),this}_writeAttr(t,e){if(!e)return this;this._writePosAttr(t,e);let i={noResize:"gs-no-resize",noMove:"gs-no-move",locked:"gs-locked",id:"gs-id",sizeToContent:"gs-size-to-content"};for(let s in i)e[s]?t.setAttribute(i[s],String(e[s])):t.removeAttribute(i[s]);return this}_readAttr(t,e=!0){let i={};i.x=h.toNumber(t.getAttribute("gs-x")),i.y=h.toNumber(t.getAttribute("gs-y")),i.w=h.toNumber(t.getAttribute("gs-w")),i.h=h.toNumber(t.getAttribute("gs-h")),i.autoPosition=h.toBool(t.getAttribute("gs-auto-position")),i.noResize=h.toBool(t.getAttribute("gs-no-resize")),i.noMove=h.toBool(t.getAttribute("gs-no-move")),i.locked=h.toBool(t.getAttribute("gs-locked"));let s=t.getAttribute("gs-size-to-content");s&&(s==="true"||s==="false"?i.sizeToContent=h.toBool(s):i.sizeToContent=parseInt(s,10)),i.id=t.getAttribute("gs-id"),i.maxW=h.toNumber(t.getAttribute("gs-max-w")),i.minW=h.toNumber(t.getAttribute("gs-min-w")),i.maxH=h.toNumber(t.getAttribute("gs-max-h")),i.minH=h.toNumber(t.getAttribute("gs-min-h")),e&&(i.w===1&&t.removeAttribute("gs-w"),i.h===1&&t.removeAttribute("gs-h"),i.maxW&&t.removeAttribute("gs-max-w"),i.minW&&t.removeAttribute("gs-min-w"),i.maxH&&t.removeAttribute("gs-max-h"),i.minH&&t.removeAttribute("gs-min-h"));for(let o in i){if(!i.hasOwnProperty(o))return;!i[o]&&i[o]!==0&&o!=="sizeToContent"&&delete i[o]}return i}_setStaticClass(){let t=["grid-stack-static"];return this.opts.staticGrid?(this.el.classList.add(...t),this.el.setAttribute("gs-static","true")):(this.el.classList.remove(...t),this.el.removeAttribute("gs-static")),this}onResize(t=this.el?.clientWidth){if(!t||this.prevWidth===t)return;this.prevWidth=t,this.batchUpdate();let e=!1;return this._autoColumn&&this.parentGridNode?this.opts.column!==this.parentGridNode.w&&(this.column(this.parentGridNode.w,this.opts.layout||"list"),e=!0):e=this.checkDynamicColumn(),this._isAutoCellHeight&&this.cellHeight(),this.engine.nodes.forEach(i=>{i.subGrid&&i.subGrid.onResize()}),this._skipInitialResize||this.resizeToContentCheck(e),delete this._skipInitialResize,this.batchUpdate(!1),this}resizeToContentCheck(t=!1,e=void 0){if(this.engine){if(t&&this.hasAnimationCSS())return setTimeout(()=>this.resizeToContentCheck(!1,e),this.animationDelay);if(e)h.shouldSizeToContent(e)&&this.resizeToContentCBCheck(e.el);else if(this.engine.nodes.some(i=>h.shouldSizeToContent(i))){let i=[...this.engine.nodes];this.batchUpdate(),i.forEach(s=>{h.shouldSizeToContent(s)&&this.resizeToContentCBCheck(s.el)}),this._ignoreLayoutsNodeChange=!0,this.batchUpdate(!1),this._ignoreLayoutsNodeChange=!1}this._gsEventHandler.resizecontent&&this._gsEventHandler.resizecontent(null,e?[e]:this.engine.nodes)}}_updateResizeEvent(t=!1){let e=!this.parentGridNode&&(this._isAutoCellHeight||this.opts.sizeToContent||this.opts.columnOpts||this.engine.nodes.find(i=>i.sizeToContent));return!t&&e&&!this.resizeObserver?(this._sizeThrottle=h.throttle(()=>this.onResize(),this.opts.cellHeightThrottle),this.resizeObserver=new ResizeObserver(()=>this._sizeThrottle()),this.resizeObserver.observe(this.el),this._skipInitialResize=!0):(t||!e)&&this.resizeObserver&&(this.resizeObserver.disconnect(),delete this.resizeObserver,delete this._sizeThrottle),this}static getElement(t=".grid-stack-item"){return h.getElement(t)}static getElements(t=".grid-stack-item"){return h.getElements(t)}static getGridElement(t){return a.getElement(t)}static getGridElements(t){return h.getElements(t)}_initMargin(){let t,e=0,i=[];typeof this.opts.margin=="string"&&(i=this.opts.margin.split(" ")),i.length===2?(this.opts.marginTop=this.opts.marginBottom=i[0],this.opts.marginLeft=this.opts.marginRight=i[1]):i.length===4?(this.opts.marginTop=i[0],this.opts.marginRight=i[1],this.opts.marginBottom=i[2],this.opts.marginLeft=i[3]):(t=h.parseHeight(this.opts.margin),this.opts.marginUnit=t.unit,e=this.opts.margin=t.h),["marginTop","marginRight","marginBottom","marginLeft"].forEach(n=>{this.opts[n]===void 0?this.opts[n]=e:(t=h.parseHeight(this.opts[n]),this.opts[n]=t.h,delete this.opts.margin)}),this.opts.marginUnit=t.unit,this.opts.marginTop===this.opts.marginBottom&&this.opts.marginLeft===this.opts.marginRight&&this.opts.marginTop===this.opts.marginRight&&(this.opts.margin=this.opts.marginTop);let o=this.el.style;return o.setProperty("--gs-item-margin-top",`${this.opts.marginTop}${this.opts.marginUnit}`),o.setProperty("--gs-item-margin-bottom",`${this.opts.marginBottom}${this.opts.marginUnit}`),o.setProperty("--gs-item-margin-right",`${this.opts.marginRight}${this.opts.marginUnit}`),o.setProperty("--gs-item-margin-left",`${this.opts.marginLeft}${this.opts.marginUnit}`),this}static getDD(){return k}static setupDragIn(t,e,i,s=document){e?.pause!==void 0&&(p.pauseDrag=e.pause),e=m({appendTo:"body",helper:"clone"},e||{}),(typeof t=="string"?h.getElements(t,s):t).forEach((n,d)=>{k.isDraggable(n)||k.dragIn(n,e),i?.[d]&&(n.gridstackNode=i[d])})}movable(t,e){return this.opts.staticGrid?this:(a.getElements(t).forEach(i=>{let s=i.gridstackNode;s&&(e?delete s.noMove:s.noMove=!0,this.prepareDragDrop(s.el))}),this)}resizable(t,e){return this.opts.staticGrid?this:(a.getElements(t).forEach(i=>{let s=i.gridstackNode;s&&(e?delete s.noResize:s.noResize=!0,this.prepareDragDrop(s.el))}),this)}disable(t=!0){if(!this.opts.staticGrid)return this.enableMove(!1,t),this.enableResize(!1,t),this._triggerEvent("disable"),this}enable(t=!0){if(!this.opts.staticGrid)return this.enableMove(!0,t),this.enableResize(!0,t),this._triggerEvent("enable"),this}enableMove(t,e=!0){return this.opts.staticGrid?this:(t?delete this.opts.disableDrag:this.opts.disableDrag=!0,this.engine.nodes.forEach(i=>{this.prepareDragDrop(i.el),i.subGrid&&e&&i.subGrid.enableMove(t,e)}),this)}enableResize(t,e=!0){return this.opts.staticGrid?this:(t?delete this.opts.disableResize:this.opts.disableResize=!0,this.engine.nodes.forEach(i=>{this.prepareDragDrop(i.el),i.subGrid&&e&&i.subGrid.enableResize(t,e)}),this)}cancelDrag(){let t=this._placeholder?.gridstackNode;t&&(t._isExternal?(t._isAboutToRemove=!0,this.engine.removeNode(t)):t._isAboutToRemove&&a._itemRemoving(t.el,!1),this.engine.restoreInitial())}_removeDD(t){return k.draggable(t,"destroy").resizable(t,"destroy"),t.gridstackNode&&delete t.gridstackNode._initDD,delete t.ddElement,this}_setupAcceptWidget(){if(this.opts.staticGrid||!this.opts.acceptWidgets&&!this.opts.removable)return k.droppable(this.el,"destroy"),this;let t,e,i=(s,o,n)=>{n=n||o;let d=n.gridstackNode;if(!d)return;if(!d.grid?.el){n.style.transform=`scale(${1/this.dragTransform.xScale},${1/this.dragTransform.yScale})`;let f=n.getBoundingClientRect();n.style.left=f.x+(this.dragTransform.xScale-1)*(s.clientX-f.x)/this.dragTransform.xScale+"px",n.style.top=f.y+(this.dragTransform.yScale-1)*(s.clientY-f.y)/this.dragTransform.yScale+"px",n.style.transformOrigin="0px 0px"}let{top:u,left:c}=n.getBoundingClientRect(),l=this.el.getBoundingClientRect();c-=l.left,u-=l.top;let g={position:{top:u*this.dragTransform.xScale,left:c*this.dragTransform.yScale}};if(d._temporaryRemoved){if(d.x=Math.max(0,Math.round(c/e)),d.y=Math.max(0,Math.round(u/t)),delete d.autoPosition,this.engine.nodeBoundFix(d),!this.engine.willItFit(d)){if(d.autoPosition=!0,!this.engine.willItFit(d)){k.off(o,"drag");return}d._willFitPos&&(h.copyPos(d,d._willFitPos),delete d._willFitPos)}this._onStartMoving(n,s,g,d,e,t)}else this._dragOrResize(n,s,g,d,e,t)};return k.droppable(this.el,{accept:s=>{let o=s.gridstackNode||this._readAttr(s,!1);if(o?.grid===this)return!0;if(!this.opts.acceptWidgets)return!1;let n=!0;if(typeof this.opts.acceptWidgets=="function")n=this.opts.acceptWidgets(s);else{let d=this.opts.acceptWidgets===!0?".grid-stack-item":this.opts.acceptWidgets;n=s.matches(d)}if(n&&o&&this.opts.maxRow){let d={w:o.w,h:o.h,minW:o.minW,minH:o.minH};n=this.engine.willItFit(d)}return n}}).on(this.el,"dropover",(s,o,n)=>{let d=n?.gridstackNode||o.gridstackNode;if(d?.grid===this&&!d._temporaryRemoved)return!1;if(d?._sidebarOrig&&(d.w=d._sidebarOrig.w,d.h=d._sidebarOrig.h),d?.grid&&d.grid!==this&&!d._temporaryRemoved&&d.grid._leave(o,n),n=n||o,e=this.cellWidth(),t=this.getCellHeight(!0),!d){let l=n.getAttribute("data-gs-widget")||n.getAttribute("gridstacknode");if(l){try{d=JSON.parse(l)}catch{console.error("Gridstack dropover: Bad JSON format: ",l)}n.removeAttribute("data-gs-widget"),n.removeAttribute("gridstacknode")}d||(d=this._readAttr(n)),d._sidebarOrig={w:d.w,h:d.h}}d.grid||(d.el||(d=m({},d)),d._isExternal=!0,n.gridstackNode=d);let u=d.w||Math.round(n.offsetWidth/e)||1,c=d.h||Math.round(n.offsetHeight/t)||1;return d.grid&&d.grid!==this?(o._gridstackNodeOrig||(o._gridstackNodeOrig=d),o.gridstackNode=d=w(m({},d),{w:u,h:c,grid:this}),delete d.x,delete d.y,this.engine.cleanupNode(d).nodeBoundFix(d),d._initDD=d._isExternal=d._temporaryRemoved=!0):(d.w=u,d.h=c,d._temporaryRemoved=!0),a._itemRemoving(d.el,!1),k.on(o,"drag",i),i(s,o,n),!1}).on(this.el,"dropout",(s,o,n)=>{let d=n?.gridstackNode||o.gridstackNode;return d&&(!d.grid||d.grid===this)&&(this._leave(o,n),this._isTemp&&this.removeAsSubGrid(d)),!1}).on(this.el,"drop",(s,o,n)=>{let d=n?.gridstackNode||o.gridstackNode;if(d?.grid===this&&!d._isExternal)return!1;let u=!!this.placeholder.parentElement,c=o!==n;this.placeholder.remove(),delete this.placeholder.gridstackNode,u&&this.opts.animate&&(this.setAnimation(!1),this.setAnimation(!0,!0));let l=o._gridstackNodeOrig;if(delete o._gridstackNodeOrig,u&&l?.grid&&l.grid!==this){let f=l.grid;f.engine.removeNodeFromLayoutCache(l),f.engine.removedNodes.push(l),f._triggerRemoveEvent()._triggerChangeEvent(),f.parentGridNode&&!f.engine.nodes.length&&f.opts.subGridDynamic&&f.removeAsSubGrid()}if(!d||(u&&(this.engine.cleanupNode(d),d.grid=this),delete d.grid?._isTemp,k.off(o,"drag"),n!==o?(n.remove(),o=n):o.remove(),this._removeDD(o),!u))return!1;let g=d.subGrid?.el?.gridstack;return h.copyPos(d,this._readAttr(this.placeholder)),h.removePositioningStyles(o),c&&(d.content||d.subGridOpts||a.addRemoveCB)?(delete d.el,o=this.addWidget(d)):(this._prepareElement(o,!0,d),this.el.appendChild(o),this.resizeToContentCheck(!1,d),g&&(g.parentGridNode=d),this._updateContainerHeight()),this.engine.addedNodes.push(d),this._triggerAddEvent(),this._triggerChangeEvent(),this.engine.endUpdate(),this._gsEventHandler.dropped&&this._gsEventHandler.dropped(w(m({},s),{type:"dropped"}),l&&l.grid?l:void 0,d),!1}),this}static _itemRemoving(t,e){if(!t)return;let i=t?t.gridstackNode:void 0;!i?.grid||t.classList.contains(i.grid.opts.removableOptions.decline)||(e?i._isAboutToRemove=!0:delete i._isAboutToRemove,e?t.classList.add("grid-stack-item-removing"):t.classList.remove("grid-stack-item-removing"))}_setupRemoveDrop(){if(typeof this.opts.removable!="string")return this;let t=document.querySelector(this.opts.removable);return t?(!this.opts.staticGrid&&!k.isDroppable(t)&&k.droppable(t,this.opts.removableOptions).on(t,"dropover",(e,i)=>a._itemRemoving(i,!0)).on(t,"dropout",(e,i)=>a._itemRemoving(i,!1)),this):this}prepareDragDrop(t,e=!1){let i=t?.gridstackNode;if(!i)return;let s=i.noMove||this.opts.disableDrag,o=i.noResize||this.opts.disableResize,n=this.opts.staticGrid||s&&o;if((e||n)&&(i._initDD&&(this._removeDD(t),delete i._initDD),n&&t.classList.add("ui-draggable-disabled","ui-resizable-disabled"),!e))return this;if(!i._initDD){let d,u,c=(f,E)=>{this.triggerEvent(f,f.target),d=this.cellWidth(),u=this.getCellHeight(!0),this._onStartMoving(t,f,E,i,d,u)},l=(f,E)=>{this._dragOrResize(t,f,E,i,d,u)},g=f=>{this.placeholder.remove(),delete this.placeholder.gridstackNode,delete i._moving,delete i._resizing,delete i._event,delete i._lastTried;let E=i.w!==i._orig.w,z=f.target;if(!(!z.gridstackNode||z.gridstackNode.grid!==this)){if(i.el=z,i._isAboutToRemove){let A=t.gridstackNode.grid;A._gsEventHandler[f.type]&&A._gsEventHandler[f.type](f,z),A.engine.nodes.push(i),A.removeWidget(t,!0,!0)}else h.removePositioningStyles(z),i._temporaryRemoved?(this._writePosAttr(z,i),this.engine.addNode(i)):this._writePosAttr(z,i),this.triggerEvent(f,z);this._extraDragRow=0,this._updateContainerHeight(),this._triggerChangeEvent(),this.engine.endUpdate(),f.type==="resizestop"&&(Number.isInteger(i.sizeToContent)&&(i.sizeToContent=i.h),this.resizeToContentCheck(E,i))}};k.draggable(t,{start:c,stop:g,drag:l}).resizable(t,{start:c,stop:g,resize:l}),i._initDD=!0}return k.draggable(t,s?"disable":"enable").resizable(t,o?"disable":"enable"),this}_onStartMoving(t,e,i,s,o,n){if(this.engine.cleanNodes().beginUpdate(s),this._writePosAttr(this.placeholder,s),this.el.appendChild(this.placeholder),this.placeholder.gridstackNode=s,s.grid?.el)this.dragTransform=h.getValuesFromTransformedElement(t);else if(this.placeholder&&this.placeholder.closest(".grid-stack")){let d=this.placeholder.closest(".grid-stack");this.dragTransform=h.getValuesFromTransformedElement(d)}else this.dragTransform={xScale:1,xOffset:0,yScale:1,yOffset:0};if(s.el=this.placeholder,s._lastUiPosition=i.position,s._prevYPix=i.position.top,s._moving=e.type==="dragstart",s._resizing=e.type==="resizestart",delete s._lastTried,e.type==="dropover"&&s._temporaryRemoved&&(this.engine.addNode(s),s._moving=!0),this.engine.cacheRects(o,n,this.opts.marginTop,this.opts.marginRight,this.opts.marginBottom,this.opts.marginLeft),e.type==="resizestart"){let d=this.getColumn()-s.x,u=(this.opts.maxRow||Number.MAX_SAFE_INTEGER)-s.y;k.resizable(t,"option","minWidth",o*Math.min(s.minW||1,d)).resizable(t,"option","minHeight",n*Math.min(s.minH||1,u)).resizable(t,"option","maxWidth",o*Math.min(s.maxW||Number.MAX_SAFE_INTEGER,d)).resizable(t,"option","maxWidthMoveLeft",o*Math.min(s.maxW||Number.MAX_SAFE_INTEGER,s.x+s.w)).resizable(t,"option","maxHeight",n*Math.min(s.maxH||Number.MAX_SAFE_INTEGER,u)).resizable(t,"option","maxHeightMoveUp",n*Math.min(s.maxH||Number.MAX_SAFE_INTEGER,s.y+s.h))}}_dragOrResize(t,e,i,s,o,n){let d=m({},s._orig),u,c=this.opts.marginLeft,l=this.opts.marginRight,g=this.opts.marginTop,f=this.opts.marginBottom,E=Math.round(n*.1),z=Math.round(o*.1);if(c=Math.min(c,z),l=Math.min(l,z),g=Math.min(g,E),f=Math.min(f,E),e.type==="drag"){if(s._temporaryRemoved)return;let j=i.position.top-s._prevYPix;s._prevYPix=i.position.top,this.opts.draggable.scroll!==!1&&h.updateScrollPosition(t,i.position,j);let St=i.position.left+(i.position.left>s._lastUiPosition.left?-l:c),Ve=i.position.top+(i.position.top>s._lastUiPosition.top?-f:g);d.x=Math.round(St/o),d.y=Math.round(Ve/n);let je=this._extraDragRow;if(this.engine.collide(s,d)){let Ot=this.getRow(),Tt=Math.max(0,d.y+s.h-Ot);this.opts.maxRow&&Ot+Tt>this.opts.maxRow&&(Tt=Math.max(0,this.opts.maxRow-Ot)),this._extraDragRow=Tt}else this._extraDragRow=0;if(this._extraDragRow!==je&&this._updateContainerHeight(),s.x===d.x&&s.y===d.y)return}else if(e.type==="resize"){if(d.x<0||(h.updateScrollResize(e,t,n),d.w=Math.round((i.size.width-c)/o),d.h=Math.round((i.size.height-g)/n),s.w===d.w&&s.h===d.h)||s._lastTried&&s._lastTried.w===d.w&&s._lastTried.h===d.h)return;let j=i.position.left+c,St=i.position.top+g;d.x=Math.round(j/o),d.y=Math.round(St/n),u=!0}s._event=e,s._lastTried=d;let A={x:i.position.left+c,y:i.position.top+g,w:(i.size?i.size.width:s.w*o)-c-l,h:(i.size?i.size.height:s.h*n)-g-f};if(this.engine.moveNodeCheck(s,w(m({},d),{cellWidth:o,cellHeight:n,rect:A,resizing:u}))){s._lastUiPosition=i.position,this.engine.cacheRects(o,n,g,l,f,c),delete s._skipDown,u&&s.subGrid&&s.subGrid.onResize(),this._extraDragRow=0,this._updateContainerHeight();let j=e.target;s._sidebarOrig||this._writePosAttr(j,s),this.triggerEvent(e,j)}}triggerEvent(t,e){let i=this;for(;i.parentGridNode;)i=i.parentGridNode.grid;i._gsEventHandler[t.type]&&i._gsEventHandler[t.type](t,e)}_leave(t,e){e=e||t;let i=e.gridstackNode;if(!i||(e.style.transform=e.style.transformOrigin=null,k.off(t,"drag"),i._temporaryRemoved))return;i._temporaryRemoved=!0,this.engine.removeNode(i),i.el=i._isExternal&&e?e:t;let s=i._sidebarOrig;i._isExternal&&this.engine.cleanupNode(i),i._sidebarOrig=s,this.opts.removable===!0&&a._itemRemoving(t,!0),t._gridstackNodeOrig?(t.gridstackNode=t._gridstackNodeOrig,delete t._gridstackNodeOrig):i._isExternal&&this.engine.restoreInitial()}commit(){return Me(this,this.batchUpdate(!1),"commit","batchUpdate","5.2"),this}}return a.renderCB=(r,t)=>{r&&t?.content&&(r.textContent=t.content)},a.resizeToContentParent=".grid-stack-item-content",a.Utils=h,a.Engine=It,a.GDRev="12.3.2",a})();var Ie=["container"],Ye=["*"];function $e(a,r){}var Xe=["*",[["","empty-content",""]]],Qe=["*","[empty-content]"];function Ke(a,r){a&1&&pt(0,1,["*ngIf","isEmpty"])}function Je(a,r){}var Rt=(()=>{class a{serialize(){}deserialize(t){this.widgetItem=t,t&&t.input&&Object.assign(this,t.input)}}return a.\u0275fac=function(t){return new(t||a)},a.\u0275prov=Yt({token:a,factory:a.\u0275fac}),a})(),We=(()=>{class a{constructor(t){this.elementRef=t,this.el._gridItemComp=this}set options(t){let e=this.el.gridstackNode?.grid;e?e.update(this.el,t):this._options=w(m({},t),{el:this.el})}get options(){return this.el.gridstackNode||this._options||{el:this.el}}get el(){return this.elementRef.nativeElement}clearOptions(){delete this._options}ngOnDestroy(){this.clearOptions(),delete this.childWidget,delete this.el._gridItemComp,delete this.container,delete this.ref}}return a.\u0275fac=function(t){return new(t||a)(Nt(it))},a.\u0275cmp=T({type:a,selectors:[["gridstack-item"]],viewQuery:function(t,e){if(t&1&&nt(Ie,7,st),t&2){let i;q(i=Y())&&(e.container=i.first)}},inputs:{options:"options"},ngContentSelectors:Ye,decls:5,vars:1,consts:[["container",""],[1,"grid-stack-item-content"]],template:function(t,e){t&1&&(Mt(),rt(0,"div",1),Jt(1,$e,0,0,"ng-template",null,0,Pt),pt(3),v(4),ot()),t&2&&(S(4),ae(" ",e.options.content," "))},styles:["[_nghost-%COMP%]{display:block}"]}),a})(),lt=(()=>{class a{constructor(t){this.elementRef=t,this.addedCB=new H,this.changeCB=new H,this.disableCB=new H,this.dragCB=new H,this.dragStartCB=new H,this.dragStopCB=new H,this.droppedCB=new H,this.enableCB=new H,this.removedCB=new H,this.resizeCB=new H,this.resizeStartCB=new H,this.resizeStopCB=new H,W.addRemoveCB||(W.addRemoveCB=Ze),W.saveCB||(W.saveCB=ti),W.updateCB||(W.updateCB=ei),this.el._gridComp=this}set options(t){this._grid?this._grid.updateOptions(t):this._options=t}get options(){return this._grid?.opts||this._options||{}}get el(){return this.elementRef.nativeElement}get grid(){return this._grid}static addComponentToSelectorType(t){t.forEach(e=>a.selectorToType[a.getSelector(e)]=e)}static getSelector(t){return ge(t).selector}ngOnInit(){this.loaded=!!this.options?.children?.length,this._grid=W.init(this._options,this.el),delete this._options,this.checkEmpty()}ngAfterContentInit(){this._sub=this.gridstackItems?.changes.subscribe(()=>this.updateAll()),this.loaded||this.updateAll(),this.hookEvents(this.grid)}ngOnDestroy(){this.unhookEvents(this._grid),this._sub?.unsubscribe(),this._grid?.destroy(),delete this._grid,delete this.el._gridComp,delete this.container,delete this.ref}updateAll(){if(!this.grid)return;let t=[];this.gridstackItems?.forEach(e=>{t.push(e.options),e.clearOptions()}),this.grid.load(t)}checkEmpty(){this.grid&&(this.isEmpty=!this.grid.engine.nodes.length)}hookEvents(t){t&&(t.parentGridNode||t.on("added",(e,i)=>{(i[0].grid?.el._gridComp||this).checkEmpty(),this.addedCB.emit({event:e,nodes:i})}).on("change",(e,i)=>this.changeCB.emit({event:e,nodes:i})).on("disable",e=>this.disableCB.emit({event:e})).on("drag",(e,i)=>this.dragCB.emit({event:e,el:i})).on("dragstart",(e,i)=>this.dragStartCB.emit({event:e,el:i})).on("dragstop",(e,i)=>this.dragStopCB.emit({event:e,el:i})).on("dropped",(e,i,s)=>this.droppedCB.emit({event:e,previousNode:i,newNode:s})).on("enable",e=>this.enableCB.emit({event:e})).on("removed",(e,i)=>{(i[0].grid?.el._gridComp||this).checkEmpty(),this.removedCB.emit({event:e,nodes:i})}).on("resize",(e,i)=>this.resizeCB.emit({event:e,el:i})).on("resizestart",(e,i)=>this.resizeStartCB.emit({event:e,el:i})).on("resizestop",(e,i)=>this.resizeStopCB.emit({event:e,el:i})))}unhookEvents(t){t&&(t.parentGridNode||t.off("added change disable drag dragstart dragstop dropped enable removed resize resizestart resizestop"))}}return a.selectorToType={},a.\u0275fac=function(t){return new(t||a)(Nt(it))},a.\u0275cmp=T({type:a,selectors:[["gridstack"]],contentQueries:function(t,e,i){if(t&1&&se(i,We,4),t&2){let s;q(s=Y())&&(e.gridstackItems=s)}},viewQuery:function(t,e){if(t&1&&nt(Ie,7,st),t&2){let i;q(i=Y())&&(e.container=i.first)}},inputs:{options:"options",isEmpty:"isEmpty"},outputs:{addedCB:"addedCB",changeCB:"changeCB",disableCB:"disableCB",dragCB:"dragCB",dragStartCB:"dragStartCB",dragStopCB:"dragStopCB",droppedCB:"droppedCB",enableCB:"enableCB",removedCB:"removedCB",resizeCB:"resizeCB",resizeStartCB:"resizeStartCB",resizeStopCB:"resizeStopCB"},ngContentSelectors:Qe,decls:4,vars:1,consts:[["container",""],[4,"ngIf"]],template:function(t,e){t&1&&(Mt(Xe),Kt(0,Ke,1,0,"ng-content",1)(1,Je,0,0,"ng-template",null,0,Pt),pt(3)),t&2&&P("ngIf",e.isEmpty)},dependencies:[pe],styles:["[_nghost-%COMP%]{display:block}"]}),a})();function Ze(a,r,t,e){if(t){if(!a)return;if(e){let i=a.parentElement?._gridItemComp;if(!i)return;let o=(i.childWidget?.container||i.container)?.createComponent(lt),n=o?.instance;return n?(n.ref=o,n.options=r,n.el):void 0}else{let s=a._gridComp?.container?.createComponent(We),o=s?.instance;if(!o)return;o.ref=s;let n=r.selector,d=n?lt.selectorToType[n]:void 0;if(d){let u=()=>{let l=o.container?.createComponent(d)?.instance;l&&typeof l.serialize=="function"&&typeof l.deserialize=="function"&&(o.childWidget=l,l.deserialize(r))};r.lazyLoad||r.grid?.opts?.lazyLoad&&r.lazyLoad!==!1?r.visibleObservable||(r.visibleObservable=new IntersectionObserver(([l])=>{l.isIntersecting&&(r.visibleObservable?.disconnect(),delete r.visibleObservable,u())}),window.setTimeout(()=>r.visibleObservable?.observe(o.el))):u()}return o.el}}else if(e){let i=r.el?._gridComp;i?.ref?i.ref.destroy():i?.ngOnDestroy()}else{let i=r.el?._gridItemComp;i?.ref?i.ref.destroy():i?.ngOnDestroy()}}function ti(a,r){let t=a.el?._gridItemComp;if(t){let i=t.childWidget?.serialize();i&&(r.input=i);return}let e=a.el?._gridComp}function ei(a){let r=a,t=a.el?._gridItemComp;t?.childWidget&&r.input&&t.childWidget.deserialize(r)}var V=(function(a){return a[a.State=0]="State",a[a.Transition=1]="Transition",a[a.Sequence=2]="Sequence",a[a.Group=3]="Group",a[a.Animate=4]="Animate",a[a.Keyframes=5]="Keyframes",a[a.Style=6]="Style",a[a.Trigger=7]="Trigger",a[a.Reference=8]="Reference",a[a.AnimateChild=9]="AnimateChild",a[a.AnimateRef=10]="AnimateRef",a[a.Query=11]="Query",a[a.Stagger=12]="Stagger",a})(V||{}),ii="*";function Vt(a,r){return{type:V.Trigger,name:a,definitions:r,options:{}}}function kt(a,r=null){return{type:V.Animate,styles:r,timings:a}}function Ms(a,r=null){return{type:V.Sequence,steps:a,options:r}}function et(a){return{type:V.Style,styles:a,offset:null}}function jt(a,r,t=null){return{type:V.Transition,expr:a,animation:r,options:t}}var Ft=class{_onDoneFns=[];_onStartFns=[];_onDestroyFns=[];_originalOnDoneFns=[];_originalOnStartFns=[];_started=!1;_destroyed=!1;_finished=!1;_position=0;parentPlayer=null;totalTime;constructor(r=0,t=0){this.totalTime=r+t}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach(r=>r()),this._onDoneFns=[])}onStart(r){this._originalOnStartFns.push(r),this._onStartFns.push(r)}onDone(r){this._originalOnDoneFns.push(r),this._onDoneFns.push(r)}onDestroy(r){this._onDestroyFns.push(r)}hasStarted(){return this._started}init(){}play(){this.hasStarted()||(this._onStart(),this.triggerMicrotask()),this._started=!0}triggerMicrotask(){queueMicrotask(()=>this._onFinish())}_onStart(){this._onStartFns.forEach(r=>r()),this._onStartFns=[]}pause(){}restart(){}finish(){this._onFinish()}destroy(){this._destroyed||(this._destroyed=!0,this.hasStarted()||this._onStart(),this.finish(),this._onDestroyFns.forEach(r=>r()),this._onDestroyFns=[])}reset(){this._started=!1,this._finished=!1,this._onStartFns=this._originalOnStartFns,this._onDoneFns=this._originalOnDoneFns}setPosition(r){this._position=this.totalTime?r*this.totalTime:1}getPosition(){return this.totalTime?this._position/this.totalTime:1}triggerCallback(r){let t=r=="start"?this._onStartFns:this._onDoneFns;t.forEach(e=>e()),t.length=0}},Ut=class{_onDoneFns=[];_onStartFns=[];_finished=!1;_started=!1;_destroyed=!1;_onDestroyFns=[];parentPlayer=null;totalTime=0;players;constructor(r){this.players=r;let t=0,e=0,i=0,s=this.players.length;s==0?queueMicrotask(()=>this._onFinish()):this.players.forEach(o=>{o.onDone(()=>{++t==s&&this._onFinish()}),o.onDestroy(()=>{++e==s&&this._onDestroy()}),o.onStart(()=>{++i==s&&this._onStart()})}),this.totalTime=this.players.reduce((o,n)=>Math.max(o,n.totalTime),0)}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach(r=>r()),this._onDoneFns=[])}init(){this.players.forEach(r=>r.init())}onStart(r){this._onStartFns.push(r)}_onStart(){this.hasStarted()||(this._started=!0,this._onStartFns.forEach(r=>r()),this._onStartFns=[])}onDone(r){this._onDoneFns.push(r)}onDestroy(r){this._onDestroyFns.push(r)}hasStarted(){return this._started}play(){this.parentPlayer||this.init(),this._onStart(),this.players.forEach(r=>r.play())}pause(){this.players.forEach(r=>r.pause())}restart(){this.players.forEach(r=>r.restart())}finish(){this._onFinish(),this.players.forEach(r=>r.finish())}destroy(){this._onDestroy()}_onDestroy(){this._destroyed||(this._destroyed=!0,this._onFinish(),this.players.forEach(r=>r.destroy()),this._onDestroyFns.forEach(r=>r()),this._onDestroyFns=[])}reset(){this.players.forEach(r=>r.reset()),this._destroyed=!1,this._finished=!1,this._started=!1}setPosition(r){let t=r*this.totalTime;this.players.forEach(e=>{let i=e.totalTime?Math.min(1,t/e.totalTime):1;e.setPosition(i)})}getPosition(){let r=this.players.reduce((t,e)=>t===null||e.totalTime>t.totalTime?e:t,null);return r!=null?r.getPosition():0}beforeDestroy(){this.players.forEach(r=>{r.beforeDestroy&&r.beforeDestroy()})}triggerCallback(r){let t=r=="start"?this._onStartFns:this._onDoneFns;t.forEach(e=>e()),t.length=0}},si="!";var ri=(a,r)=>r.id;function oi(a,r){if(a&1&&ee(0,"div",4),a&2){let t=r.$index;N();let e=he(0);ft("background-color",e===t?"var(--mat-sys-on-surface)":"var(--mat-sys-inverse-on-surface)")}}var Ge=(()=>{class a{activePage=Lt();dashboards=Lt();static \u0275fac=function(e){return new(e||a)};static \u0275cmp=T({type:a,selectors:[["dashboard-scroller"]],inputs:{activePage:[1,"activePage"],dashboards:[1,"dashboards"]},decls:7,vars:4,consts:[[1,"page-scroll-title","page-scroll-container"],[1,"page-label"],[1,"page-scroll-page-number","page-scroll-container"],[1,"page-marker",3,"background-color"],[1,"page-marker"]],template:function(e,i){if(e&1&&(de(0),rt(1,"div",0)(2,"span",1),v(3),ot()(),rt(4,"div",2),Zt(5,oi,1,2,"div",3,ri),ot()),e&2){let s=i.dashboards(),o=le(i.activePage());S(),P("@fadeInOut",o),S(2),ne(s[o].name),S(),P("@fadeInOut",o),S(),te(s)}},styles:["[_nghost-%COMP%]{pointer-events:none}.page-scroll-title[_ngcontent-%COMP%]{position:absolute;top:50%;right:54px;transform:translateY(-50%);z-index:100;cursor:default;text-align:center;padding:10px;color:var(--mat-sys-inverse-surface)}.page-scroll-page-number[_ngcontent-%COMP%]{position:absolute;top:50%;right:15px;transform:translateY(-50%);z-index:100;cursor:default;display:grid;padding:0}.page-scroll-container[_ngcontent-%COMP%]{opacity:0;background-color:var(--mat-sys-tertiary-fixed-dim);border-radius:10px;border:1px solid var(--mat-sys-inverse-surface)}.page-label[_ngcontent-%COMP%]{color:var(--mat-sys-on-surface);text-shadow:1px 1px 0 var(--mat-sys-outline),-1px 1px 0 var(--mat-sys-outline),-1px -1px 0 var(--mat-sys-outline),1px -1px 0 var(--mat-sys-outline);font-size:x-large}.page-marker[_ngcontent-%COMP%]{height:20px;width:20px;margin:4px;border-radius:50%;border:1px solid var(--mat-sys-outline)}"],data:{animation:[Vt("fadeInOut",[jt(":increment, :decrement",[et({opacity:0}),kt(100,et({opacity:1})),et({opacity:1}),kt("250ms 1000ms",et({opacity:0}))])])]}})}return a})();function ai(a,r){if(a&1){let t=L();_(0,"button",0),D("click",function(){C(t);let i=N();return x(i.clickAction("cancel"))}),_(1,"mat-icon",1),v(2,"close"),b(),_(3,"span"),v(4,"Close"),b()()}}var zt=(()=>{class a{_bottomSheetRef=y(ze);data=y(ke);showCancel=!!(this.data&&this.data.showCancel);clickAction(t){this._bottomSheetRef.dismiss(t)}static \u0275fac=function(e){return new(e||a)};static \u0275cmp=T({type:a,selectors:[["widget-host-bottom-sheet"]],decls:12,vars:1,consts:[["mat-list-item","",3,"click"],["matListItemIcon",""],["mat-list-item",""]],template:function(e,i){e&1&&(_(0,"mat-action-list")(1,"button",0),D("click",function(){return i.clickAction("duplicate")}),_(2,"mat-icon",1),v(3,"content_copy"),b(),_(4,"span"),v(5,"Duplicate"),b()(),_(6,"button",0),D("click",function(){return i.clickAction("delete")}),_(7,"mat-icon",1),v(8,"delete_forever"),b(),_(9,"span"),v(10,"Delete"),b()(),G(11,ai,5,0,"button",2),b()),e&2&&(S(11),F(i.showCancel?11:-1))},dependencies:[Ne,Te,He,Oe,_t,mt],encapsulation:2})}return a})();var li=["childOutlet"],Fe=(()=>{class a extends Rt{widgetProperties;outlet;_dialog=y(Q);_dashboard=y(X);_bottomSheet=y(wt);_streams=y(bt,{optional:!0});_meta=y(vt,{optional:!0});_runtime=y(B,{optional:!0});_widgetService=y(De);_app=y(yt);theme=fe(this._app.cssThemeColorRoles$,{requireSync:!0});childRef;compType;_hasInitialized=!1;_sheetOpen=!1;_optionsOpen=!1;isDebugEnabled(){try{return typeof localStorage<"u"&&localStorage.getItem("kip:gesturesDebug")==="1"}catch{return!1}}debug(...t){this.isDebugEnabled()&&console.debug("[Host2]",...t)}constructor(){super(),dt(()=>{let t=this.theme();this.childRef&&at(()=>{this.childRef.setInput("theme",t)})}),dt(()=>{let t=this._dashboard.layoutEditCanceled();!this._hasInitialized||!t||at(()=>{this.reinitFromSavedConfig()})})}ngOnInit(){let t=this.widgetProperties.type;if(!t)return;this.compType=this._widgetService.getComponentType(t);let e=this.getDefaultConfig();this._runtime?.initialize?.(e,this.widgetProperties.config);let i=this._runtime?.options();i&&(this.widgetProperties.config=i),this._streams?.applyStreamsConfigDiff?.(i),this._meta?.applyMetaConfigDiff?.(i),this.outlet&&this.compType&&(this.childRef=this.outlet.createComponent(this.compType),this.childRef.setInput("id",this.widgetProperties.uuid),this.childRef.setInput("type",this.widgetProperties.type),this.childRef.setInput("theme",this.theme())),this._hasInitialized=!0}serialize(){let t=this._runtime?.options();return t?this.widgetProperties.config=t:this.widgetProperties.config||(this.widgetProperties.config={}),{widgetProperties:this.widgetProperties}}applyRuntimeConfig(t){t&&this._runtime?.setRuntimeConfig?.(t);let e=this._runtime.options();e&&(this.widgetProperties.config=e),this._streams?.applyStreamsConfigDiff?.(e),this._meta?.applyMetaConfigDiff?.(e)}reinitFromSavedConfig(){try{let t=this.getSavedConfigForSelf(),e=this.getDefaultConfig();this._runtime?.initialize?.(e,U(t));let i=this._runtime?.options();i&&(this.widgetProperties.config=i),this._streams?.applyStreamsConfigDiff?.(i),this._meta?.applyMetaConfigDiff?.(i)}catch{}}getSavedConfigForSelf(){try{let t=this._dashboard.dashboards(),e=this._dashboard.activeDashboard(),o=(t?.[e]?.configuration??[]).find(n=>n?.id===this.widgetProperties.uuid);return o?.input?.widgetProperties?.config??o?.widgetProperties?.config??void 0}catch{return}}getDefaultConfig(){let t=this.compType&&this.compType.DEFAULT_CONFIG;if(!t&&this.compType&&this.outlet){let e=this.outlet.createComponent(this.compType);t=e.instance.defaultConfig,e.destroy()}return t}openWidgetOptions(t){if(t.stopPropagation(),this.debug("openWidgetOptions invoked",{widgetId:this.widgetProperties?.uuid,static:this._dashboard.isDashboardStatic()}),!this._dashboard.isDashboardStatic()){if(this._optionsOpen){this.debug("options already open; ignoring");return}if(this._optionsOpen=!0,!this.widgetProperties)return;this._dialog.openWidgetOptions({title:"Widget Options",config:this.widgetProperties.config,confirmBtnText:"Save",cancelBtnText:"Cancel"}).afterClosed().subscribe(e=>{this._optionsOpen=!1,e&&(this.debug("options saved",{widgetId:this.widgetProperties?.uuid}),this.applyRuntimeConfig(e))})}}openBottomSheet(t){if(t.stopPropagation(),this.debug("openBottomSheet invoked",{widgetId:this.widgetProperties?.uuid,static:this._dashboard.isDashboardStatic()}),!this._dashboard.isDashboardStatic()){if(this._sheetOpen){this.debug("sheet already open; ignoring");return}this._sheetOpen=!0;let e=typeof navigator<"u"&&/Linux/.test(navigator.platform)&&/Firefox/.test(navigator.userAgent);this._bottomSheet.open(zt,e?{disableClose:!0,data:{showCancel:!0}}:{}).afterDismissed().subscribe(s=>{switch(this._sheetOpen=!1,this.debug("bottom sheet dismissed",{widgetId:this.widgetProperties?.uuid,action:s}),s){case"delete":this._dashboard.deleteWidget(this.widgetProperties.uuid);break;case"duplicate":this._dashboard.duplicateWidget(this.widgetProperties.uuid);break;default:break}})}}static \u0275fac=function(e){return new(e||a)};static \u0275cmp=T({type:a,selectors:[["widget-host2"]],viewQuery:function(e,i){if(e&1&&nt(li,7,st),e&2){let s;q(s=Y())&&(i.outlet=s.first)}},inputs:{widgetProperties:"widgetProperties"},features:[ut([bt,vt,B]),ct],decls:3,vars:2,consts:[["childOutlet",""],["kipGestures","","mode","press","appearance","raised",1,"widget-container","kip-widget-card-colors",3,"doubletap","press"]],template:function(e,i){if(e&1){let s=L();_(0,"mat-card",1),D("doubletap",function(n){return C(s),x(i.openWidgetOptions(n))})("press",function(n){return C(s),x(i.openBottomSheet(n))}),ie(1,null,0),b()}e&2&&ft("border",i._dashboard.isDashboardStatic()?"1px dashed transparent":"1px dashed var(--mat-sys-outline)")},dependencies:[Ce,we,Se,$],styles:["[_nghost-%COMP%]{width:100%;height:100%;display:block;overflow:hidden}.widget-container[_ngcontent-%COMP%]{display:block;width:100%;height:100%;margin:0;padding:0}.kip-widget-card-colors[_ngcontent-%COMP%]{background-color:var(--kip-widget-card-background-color)}"],changeDetection:0})}return a})();function hi(a,r){if(a&1){let t=L();_(0,"div",2),D("doubletap",function(i){C(t);let s=N();return x(s.openWidgetOptions(i))})("press",function(i){C(t);let s=N();return x(s.openBottomSheet(i))}),b()}}var Ue=(()=>{class a extends Rt{widgetProperties;dashboard=y(X);_dialog=y(Q);_bottomSheet=y(wt);runtime=y(B);static DEFAULT_CONFIG={displayName:"Gauge Label",color:"contrast"};_sheetOpen=!1;_optionsOpen=!1;constructor(){super()}ngOnInit(){this.runtime?.initialize?.(a.DEFAULT_CONFIG,this.widgetProperties.config)}serialize(){let t=this.runtime?.options();return t?this.widgetProperties.config=t:this.widgetProperties.config||(this.widgetProperties.config={}),{widgetProperties:this.widgetProperties}}openWidgetOptions(t){if(t.stopPropagation(),!this.dashboard.isDashboardStatic()){if(this._optionsOpen)return;this._optionsOpen=!0,this._dialog.openWidgetOptions({title:"Widget Options",config:U(this.runtime.options()),confirmBtnText:"Save",cancelBtnText:"Cancel"}).afterClosed().subscribe(e=>{this._optionsOpen=!1,e&&this.runtime.setRuntimeConfig(e)})}}openBottomSheet(t){if(t.stopPropagation(),!this.dashboard.isDashboardStatic()){if(this._sheetOpen)return;this._sheetOpen=!0;let e=typeof navigator<"u"&&/Linux/.test(navigator.platform)&&/Firefox/.test(navigator.userAgent);this._bottomSheet.open(zt,e?{disableClose:!0,data:{showCancel:!0}}:{}).afterDismissed().subscribe(s=>{switch(this._sheetOpen=!1,s){case"delete":this.dashboard.deleteWidget(this.widgetProperties.uuid);break;default:break}})}}static \u0275fac=function(e){return new(e||a)};static \u0275cmp=T({type:a,selectors:[["group-widget"]],inputs:{widgetProperties:"widgetProperties"},features:[ut([B]),ct],decls:2,vars:3,consts:[[3,"text","color"],["kipGestures","","mode","press",1,"widgetOverlay"],["kipGestures","","mode","press",1,"widgetOverlay",3,"doubletap","press"]],template:function(e,i){e&1&&(gt(0,"widget-title",0),G(1,hi,1,0,"div",1)),e&2&&(P("text",i.runtime.options().displayName)("color",i.runtime.options().color),S(),F(i.dashboard.isDashboardStatic()?-1:1))},dependencies:[Ee,$],styles:["[_nghost-%COMP%]{display:block;height:15%}.widgetOverlay[_ngcontent-%COMP%]{position:absolute;width:100%;height:15%;right:0;top:0;color:transparent;z-index:21}"],changeDetection:0})}return a})();var ci=["grid"];function ui(a,r){a&1&&(_(0,"p",9)(1,"strong"),v(2,"Long press/click and hold anywhere"),b(),v(3," to add widgets"),b(),_(4,"mat-icon",10),v(5,"touch_app"),b())}function gi(a,r){if(a&1){let t=L();_(0,"p",9),v(1,"This empty dashboard is ready to be customized."),b(),_(2,"button",11),D("click",function(){C(t);let i=N();return x(i.editDashboard())}),_(3,"mat-icon"),v(4,"lock_open"),b(),v(5," Unlock and Customize "),b()}}function pi(a,r){if(a&1){let t=L();_(0,"div",7)(1,"button",12),D("click",function(){C(t);let i=N();return x(i.cancelLayoutChanges())}),_(2,"mat-icon"),v(3,"close"),b()(),_(4,"button",13),D("click",function(){C(t);let i=N();return x(i.saveLayoutChanges())}),_(5,"mat-icon"),v(6,"done"),b()()()}}function fi(a,r){if(a&1&>(0,"dashboard-scroller",8),a&2){let t=N();P("activePage",t.dashboard.activeDashboard())("dashboards",t.dashboard.dashboards())}}var no=(()=>{class a{activatedRoute=y(me);_app=y(yt);_dialog=y(Q);dashboard=y(X);_destroyRef=y($t);_uiEvent=y(Re);_dataset=y(xe);_router=y(_e);_hostEl=y(it);isDashboardStatic=ce(()=>this.dashboard.isDashboardStatic());_gridstack=ue.required("grid");_previousIsStaticState=!0;_suppressDrag=!1;subGridOptions={cellHeight:"auto",column:"auto",acceptWidgets:!0,subGridDynamic:!1,class:"group-container"};gridOptions=Xt({column:24,row:24,margin:4,float:!0,resizable:{handles:"all"},acceptWidgets:!0,subGridDynamic:!1,subGridOpts:this.subGridOptions,children:[]});_boundHandleKeyDown=this.handleKeyDown.bind(this);_resizeObserver;_pendingResizeRaf=null;_lastContainerHeight=0;_lastCellHeight=0;_addDialogOpen=!1;constructor(){lt.addComponentToSelectorType([Fe,Ue]),dt(()=>{let t=this.dashboard.isDashboardStatic();at(()=>{if(this._previousIsStaticState!==t){this._previousIsStaticState=t;try{this._gridstack().grid.setStatic(t)}catch{}}})})}ngAfterViewInit(){this._gridstack().grid?.setStatic(this._previousIsStaticState),this.resizeGridColumns(),this.setupResizeObserver(),this._uiEvent.addHotkeyListener(this._boundHandleKeyDown,{ctrlKey:!0,keys:["arrowdown","arrowup"]});try{let t=this._gridstack().grid;t&&typeof t.on=="function"&&(t.on("dragstart",()=>{this._uiEvent.isDragging.set(!0)}),t.on("dragstop",()=>{setTimeout(()=>this._uiEvent.isDragging.set(!1),0)}),t.on("resizestart",()=>{this._uiEvent.isDragging.set(!0)}),t.on("resizestop",(e,i)=>{setTimeout(()=>this._uiEvent.isDragging.set(!1),0)}))}catch{}this.dashboard.widgetAction$.pipe(Bt(this._destroyRef)).subscribe(t=>{t&&this._gridstack().grid.getGridItems().forEach(e=>{let i={};if(e.gridstackNode.subGridOpts&&(i=e.gridstackNode.subGridOpts),e.gridstackNode.id===t.id)switch(t.operation){case"delete":this.deleteWidget(e);break;case"duplicate":this.duplicateWidget(e);break;default:break}})}),this.activatedRoute.params.pipe(Bt(this._destroyRef)).subscribe(t=>{let e=t.id;t.id===""?e=void 0:e=t.id;let i=Number(e),s=e!==void 0&&e!==""&&!isNaN(i);if(e!==void 0&&!s||i<0||i>=this.dashboard.dashboards().length)return;let o=this.dashboard.activeDashboard();isNaN(i)?this.loadDashboard(o):(this.dashboard.setActiveDashboard(i),this.loadDashboard(i))})}setupResizeObserver(){if(this._resizeObserver)return;let t=this._hostEl.nativeElement;try{this._resizeObserver=new ResizeObserver(()=>{this._pendingResizeRaf===null&&(this._pendingResizeRaf=requestAnimationFrame(()=>{this._pendingResizeRaf=null,this.resizeGridColumns()}))}),this._resizeObserver.observe(t)}catch{}}handleKeyDown(t){t==="arrowdown"?this.previousDashboard():t==="arrowup"&&this.nextDashboard()}resizeGridColumns(){try{let e=this._gridstack().grid;if(!e)return;let i=e,s=this._hostEl.nativeElement.clientHeight||window.innerHeight;if(s===this._lastContainerHeight&&this._lastCellHeight>0)return;let o=i.getRow?i.getRow():0;if(o>0&&i.cellHeight){let n=Number(o)||0,d=n>0?s/n:1;if(d=Math.max(1,Math.round(d*100)/100),this._lastCellHeight===d&&this._lastContainerHeight===s)return;i.cellHeight(d),i.batchUpdate&&i.commit&&(i.batchUpdate(),i.commit()),this._lastContainerHeight=s,this._lastCellHeight=d}}catch{}}loadDashboard(t){let e=U(this.dashboard.dashboards()[t]),i=this._gridstack();if(!i?.grid){queueMicrotask(()=>this.loadDashboard(t));return}i.grid.batchUpdate(),i.grid.load(e.configuration),i.grid.commit()}saveDashboard(){let t=this._gridstack().grid.save(!1,!1)||null;this.dashboard.updateConfiguration(this.dashboard.activeDashboard(),t)}saveLayoutChanges(){this.dashboard.setStaticDashboard(!0),this.saveDashboard(),this.dashboard.notifyLayoutEditSaved()}cancelLayoutChanges(){this.loadDashboard(this.dashboard.activeDashboard()),this.dashboard.setStaticDashboard(!0),this.dashboard.notifyLayoutEditCanceled()}addNewWidget(t){if(!this.dashboard.isDashboardStatic()&&t.detail!==void 0){if(this._addDialogOpen)return;let e=t.detail||{},i=e.center?.x??e.x??0,s=e.center?.y??e.y??0,o=this._gridstack().grid.getCellFromPixel({left:i,top:s});this._gridstack().grid.isAreaEmpty(o.x,o.y,1,2)&&(this._gridstack().grid.willItFit({x:o.x,y:o.y,w:4,h:6})?(this._addDialogOpen=!0,this._dialog.openFrameDialog({title:"Add Widget",component:"select-widget"},!0).pipe(qt(()=>{this._addDialogOpen=!1})).subscribe(d=>{if(!d||typeof d!="object")return;let u=d,c=At.create(),l={};u.selector==="group-widget"?l={x:o.x,y:o.y,w:3,h:4,id:c,selector:"group-widget",input:{widgetProperties:{type:u.selector,uuid:c,config:{displayName:"Group Widget",color:"contrast"}}},subGridOpts:{children:[]}}:l={x:o.x,y:o.y,w:u.defaultWidth,h:u.defaultHeight,minW:u.minWidth,minH:u.minHeight,id:c,selector:"widget-host2",input:{widgetProperties:{type:u.selector,uuid:c}}};let g=this._gridstack().grid.addWidget(l);g.gridstackNode.subGrid&&(g.gridstackNode.subGridOpts.row=g.gridstackNode.subGridOpts.minRow=g.gridstackNode.subGridOpts.maxRow=g.gridstackNode.h)})):this._app.sendSnackbarNotification("Error Adding Widget: Not enough space at the selected location. Please reorganize the dashboard to free up space or choose a larger empty area.",0))}}cancelPointerSequence(){if(!this._suppressDrag){this._suppressDrag=!0;try{this._gridstack().grid.setStatic(!0)}catch{}["pointerup","mouseup","touchend"].forEach(t=>{document.dispatchEvent(new Event(t,{bubbles:!0}))})}}onPointerRelease(){if(this._suppressDrag&&(this._suppressDrag=!1,!this.dashboard.isDashboardStatic()))try{this._gridstack().grid.setStatic(!1)}catch{}}duplicateWidget(t){let e=At.create(),i=t.gridstackNode,s={w:i.w,h:i.h,id:e,selector:i.selector,input:{widgetProperties:{type:i.input.widgetProperties.type,uuid:e,config:U(i.input.widgetProperties.config)}}},o=this._gridstack();o.grid.willItFit(s)?o.grid.addWidget(s):(s.h=2,s.w=1,o.grid.willItFit(s)?o.grid.addWidget(s):this._app.sendSnackbarNotification("Duplication failed: Insufficient space on the dashboard. Please reorganize to free up space.",0))}deleteWidget(t){let e=t.gridstackNode;switch(this._gridstack().grid.removeWidget(t),e.selector){case"widget-numeric-chart":case"widget-windtrends-chart":{(this._dataset.list()?.filter(o=>o.uuid===e.id||o.uuid?.startsWith(`${e.id}-`))||[]).forEach(o=>this._dataset.remove(o.uuid));break}}}nextDashboard(){this.dashboard.isDashboardStatic()&&this.dashboard.navigateToNextDashboard()}previousDashboard(){this.dashboard.isDashboardStatic()&&this.dashboard.navigateToPreviousDashboard()}editDashboard(){this.dashboard.isDashboardStatic.set(!1)}navigateToHelp(){this._router.navigate(["/help"])}ngOnDestroy(){let t=this._gridstack();if(t?.grid&&(t.grid.offAll(),t.grid.destroy()),this._resizeObserver){try{this._resizeObserver.disconnect()}catch{}this._resizeObserver=void 0}this._pendingResizeRaf!==null&&(cancelAnimationFrame(this._pendingResizeRaf),this._pendingResizeRaf=null),this._uiEvent.removeHotkeyListener(this._boundHandleKeyDown)}static \u0275fac=function(e){return new(e||a)};static \u0275cmp=T({type:a,selectors:[["dashboard"]],viewQuery:function(e,i){e&1&&re(i._gridstack,ci,5),e&2&&oe()},hostBindings:function(e,i){e&1&&D("mouseup",function(){return i.onPointerRelease()},Ht)("touchend",function(){return i.onPointerRelease()},Ht)},decls:16,vars:6,consts:[["grid",""],["kipGestures","",3,"swipeup","swipedown","press","resize","mode","enablePress","enableDoubleTap","options"],["empty-content","",1,"dashboard-empty-state-container"],[1,"dashboard-empty-state-action"],[1,"empty-state-icon"],[1,"empty-state-help"],["mat-button","",1,"empty-state-help-button",3,"click"],[1,"edit-layout-close-icon"],[3,"activePage","dashboards"],[1,"empty-state-text"],[1,"touch-icon"],["mat-flat-button","",1,"empty-state-button",3,"click"],["mat-fab","",1,"cancel",2,"margin-right","10px",3,"click"],["mat-fab","",1,"save",3,"click"]],template:function(e,i){if(e&1){let s=L();_(0,"gridstack",1,0),D("swipeup",function(){return C(s),x(i.previousDashboard())})("swipedown",function(){return C(s),x(i.nextDashboard())})("press",function(n){return C(s),x(i.addNewWidget(n))})("resize",function(){return C(s),x(i.resizeGridColumns())},Qt),_(2,"div",2)(3,"div",3)(4,"mat-icon",4),v(5,"dashboard"),b(),G(6,ui,6,0)(7,gi,6,0),b(),_(8,"div")(9,"div",5)(10,"button",6),D("click",function(){return C(s),x(i.navigateToHelp())}),_(11,"mat-icon"),v(12,"help"),b(),v(13," Get Help "),b()()()()(),G(14,pi,7,0,"div",7)(15,fi,1,2,"dashboard-scroller",8)}if(e&2){let s=i.dashboard.isDashboardStatic();P("mode",s?"dashboard":"editor")("enablePress",!s)("enableDoubleTap",!1)("options",i.gridOptions()),S(6),F(s?7:6),S(8),F(s?15:14)}},dependencies:[lt,Ge,_t,mt,ve,ye,be,$],styles:["[_nghost-%COMP%]{display:flex;flex-direction:row;flex-wrap:nowrap;height:100%;width:100%;overflow:hidden}.grid-stack[_ngcontent-%COMP%]{width:100%;height:100%;box-sizing:border-box;position:relative} .grid-stack-sub-grid{border:1px solid var(--mat-sys-outline);border-radius:8px} .grid-stack-sub-grid div{display:flex;flex-direction:column} .grid-stack-sub-grid div .grid-stack{flex:1 1 auto;min-height:500px}.edit-layout-close-icon[_ngcontent-%COMP%]{position:absolute;bottom:20px;right:20px;cursor:pointer;z-index:100}.cancel[_ngcontent-%COMP%]{--mat-fab-container-color: var(--mat-sys-primary);--mat-fab-foreground-color: var(--mat-sys-background)}.save[_ngcontent-%COMP%]{--mat-fab-container-color: var(--mat-sys-primary-fixed);--mat-fab-foreground-color: var(--mat-sys-background)}.dashboard-empty-state-container[_ngcontent-%COMP%]{position:absolute;inset:0;display:flex;flex-direction:column;flex-wrap:nowrap;align-items:center;justify-content:space-around;padding:1.5rem;text-align:center;box-sizing:border-box;overflow:hidden;pointer-events:auto}@media (orientation: landscape) and (max-height: 420px){.dashboard-empty-state-container[_ngcontent-%COMP%]{padding:.75rem}.empty-state-icon[_ngcontent-%COMP%]{font-size:3.25rem;width:3.25rem;height:3.25rem}}.dashboard-empty-state-action[_ngcontent-%COMP%]{max-width:500px;color:var(--mat-sys-outline-variant)}.dashboard-empty-state-action[_ngcontent-%COMP%] .touch-icon[_ngcontent-%COMP%]{font-size:2rem;width:2rem;height:2rem;color:var(--mat-sys-outline-variant);margin-top:.5rem;animation:_ngcontent-%COMP%_bounce 2s infinite}.empty-state-icon[_ngcontent-%COMP%]{font-size:4rem;width:4rem;height:4rem;color:var(--mat-sys-outline-variant);margin-bottom:1rem}.empty-state-button[_ngcontent-%COMP%]{--mat-button-filled-label-text-color: var(--kip-widget-card-background-color);--mat-button-filled-container-color: var(--mat-sys-outline-variant);--mat-button-filled-hover-state-layer-opacity: .7;--mat-button-filled-state-layer-color: var(--mat-sys-primary-fixed-dim)}.empty-state-help-button[_ngcontent-%COMP%]{--mat-button-text-label-text-color: var(--mat-sys-outline-variant);--mat-button-text-hover-state-layer-opacity: .7;--mat-button-text-state-layer-color: var(--mat-sys-primary-fixed-dim)}.empty-state-text[_ngcontent-%COMP%]{color:var(--mat-sys-outline-variant);font-style:italic}@keyframes _ngcontent-%COMP%_bounce{0%,20%,50%,80%,to{transform:translateY(0)}40%{transform:translateY(-10px)}60%{transform:translateY(-5px)}}"]})}return a})();export{V as a,ii as b,Ms as c,et as d,Ft as e,Ut as f,si as g,no as h};
|
package/public/chunk-D2CYLQZF.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Fa as r,Gb as p,Gd as f,Hd as v,Kb as o,Lb as h,Oa as c,Vd as x,Wc as u,_d as b,ga as d,hb as m,ib as e,jb as t,jc as s,kb as g,tb as l}from"./chunk-OB3QLUH6.js";var O=(()=>{class a{pageTitle=s.required();svgIconId=s.required();_router=d(u);backPage(){this._router.navigate(["/settings"])}closePage(){this._router.navigate(["/dashboard"])}static \u0275fac=function(n){return new(n||a)};static \u0275cmp=c({type:a,selectors:[["page-header"]],inputs:{pageTitle:[1,"pageTitle"],svgIconId:[1,"svgIconId"]},decls:11,vars:6,consts:[[1,"page-icon-container"],["aria-hidden","false",3,"svgIcon"],[1,"page-title"],[1,"dialog-close-icon"],["mat-icon-button","",3,"click"]],template:function(n,i){n&1&&(e(0,"div",0),g(1,"mat-icon",1),t(),e(2,"h6",2),o(3),t(),e(4,"div",3)(5,"button",4),l("click",function(){return i.backPage()}),e(6,"mat-icon"),o(7,"arrow_back_ios"),t()(),e(8,"button",4),l("click",function(){return i.closePage()}),e(9,"mat-icon"),o(10,"close"),t()()()),n&2&&(r(),p("width",24,"px")("height",24,"px"),m("svgIcon",i.svgIconId()),r(2),h(i.pageTitle()))},dependencies:[b,x,v,f],styles:["[_nghost-%COMP%]{display:flex;justify-content:space-between;align-items:center;flex-direction:row;flex-wrap:nowrap}.page-icon-container[_ngcontent-%COMP%]{width:100px;height:max-content;padding-left:15px;padding-top:6px}.page-title[_ngcontent-%COMP%]{margin-block-start:0px;margin-block-end:0px;padding:18px 0 13px;color:var(--mat-dialog-subhead-color, var(--mat-sys-on-surface, rgba(0, 0, 0, .87)));font-family:var(--mat-dialog-subhead-font, var(--mat-sys-headline-small-font, inherit));line-height:var(--mat-dialog-subhead-line-height, var(--mat-sys-headline-small-line-height, 1.5rem));font-size:var(--mat-dialog-subhead-size, var(--mat-sys-headline-small-size, 1rem));font-weight:var(--mat-dialog-subhead-weight, var(--mat-sys-headline-small-weight, 400));letter-spacing:var(--mat-dialog-subhead-tracking, var(--mat-sys-headline-small-tracking, .03125em))}.dialog-close-icon[_ngcontent-%COMP%]{display:flex;flex-direction:row;flex-wrap:nowrap;gap:5px;padding-right:15px}.mat-mdc-dialog-content[_ngcontent-%COMP%]{max-height:max-content}"]})}return a})();export{O as a};
|
package/public/chunk-DADLXEYG.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{d as D}from"./chunk-QLTN6G6E.js";import{a as f,d as I,e as S,m as b}from"./chunk-XDPHEQEO.js";import{$c as E,Ic as A,Nc as P,Oc as m,Sc as M,Wc as j,a as g,b as v,c as C,ca as u,cc as p,ec as h,f as R,ga as a,j as w,l as y,pa as N,ra as l,t as _}from"./chunk-OB3QLUH6.js";var T=[{id:null,name:"Dashboard 1",icon:"dashboard-dashboard",configuration:[{w:24,h:24,id:"d1d58e6f-f8b4-4a72-9597-7f92aa6776fc",selector:"widget-host2",input:{widgetProperties:{type:"widget-tutorial",uuid:"d1d58e6f-f8b4-4a72-9597-7f92aa6776fc"}},x:0,y:0}],collapseSplitShell:!1}];var x=(()=>{class i{_settings=a(b);_router=a(j);dashboards=l([],{equal:S});activeDashboard=l(0);_widgetAction=new y(null);widgetAction$=this._widgetAction.asObservable();isDashboardStatic=l(!0);layoutEditSaved=l(0);layoutEditCanceled=l(0);constructor(){let e=this._settings.getDashboardConfig();if(!e||e.length===0){console.warn("[Dashboard Service] No dashboards found in settings, creating blank dashboard");let t=T.map(r=>v(g({},r),{id:f.create()}));this.dashboards.set([...t])}else this.dashboards.set(this._settings.getDashboardConfig());h(()=>{let t=this.dashboards();this._settings.saveDashboards(t)})}toggleStaticDashboard(){this.isDashboardStatic.set(!this.isDashboardStatic())}add(e,t,r,s){let n=0;return this.dashboards.update(o=>{let c=[...o,{id:f.create(),name:e,icon:r??"dashboard-dashboard",configuration:t,collapseSplitShell:s??!1}];return n=c.length-1,c}),n}update(e,t,r,s){this.dashboards.update(n=>n.map((o,c)=>c===e?v(g({},o),{name:t,icon:r??"dashboard-dashboard",collapseSplitShell:s??!1}):o))}delete(e){this.dashboards.update(t=>t.filter((r,s)=>s!==e)),this.dashboards().length===0?(this.add("Dashboard "+(this.dashboards().length+1),[]),this.activeDashboard.set(0)):this.activeDashboard()>this.dashboards().length-1&&this.activeDashboard.set(this.dashboards().length-1)}duplicate(e,t,r,s){if(e<0||e>=this.dashboards().length)return console.error(`[Dashboard Service] Invalid itemIndex: ${e}`),-1;let n=this.dashboards()[e],o=I(n);o.id=f.create(),o.name=t,o.icon=r||"dashboard-dashboard",o.collapseSplitShell=s??!1,Array.isArray(o.configuration)?o.configuration.forEach(d=>{d&&d.input?.widgetProperties?(d.id=f.create(),d.input.widgetProperties.uuid=d.id):console.error("Dashboard Service] Widget configuration is missing required properties:",d)}):(console.error("Dashboard Service] Dashboard configuration is not an array:",o.configuration),o.configuration=[]);let c=-1;return this.dashboards.update(d=>{let k=[...d,o];return c=k.length-1,k}),c}updateConfiguration(e,t){this.dashboards.update(r=>r.map((s,n)=>n===e?S(s.configuration,t)?s:v(g({},s),{configuration:t}):s))}previousDashboard(){this.activeDashboard()+1>this.dashboards().length-1?this.activeDashboard.set(0):this.activeDashboard.set(this.activeDashboard()+1)}nextDashboard(){this.activeDashboard()-1<0?this.activeDashboard.set(this.dashboards().length-1):this.activeDashboard.set(this.activeDashboard()-1)}setActiveDashboard(e){e!==this.activeDashboard()&&(e>=0&&e<this.dashboards().length?this.activeDashboard.set(e):console.error(`[Dashboard Service] Invalid dashboard ID: ${e}`))}navigateToActive(){this._router.navigate(["/dashboard",this.activeDashboard()])}navigateTo(e){e>=0&&e<this.dashboards().length?this._router.navigate(["/dashboard",e]):console.error(`[Dashboard Service] Invalid dashboard ID: ${e}`)}navigateToNextDashboard(){let e=null;this.activeDashboard()-1<0?e=this.dashboards().length-1:e=this.activeDashboard()-1,this._router.navigate(["/dashboard",e])}navigateToPreviousDashboard(){let e=null;this.activeDashboard()+1>=this.dashboards().length?e=0:e=this.activeDashboard()+1,this._router.navigate(["/dashboard",e])}deleteWidget(e){this._widgetAction.next({id:e,operation:"delete"})}duplicateWidget(e){this._widgetAction.next({id:e,operation:"duplicate"})}setStaticDashboard(e){this.isDashboardStatic.set(e)}notifyLayoutEditSaved(){this.layoutEditSaved.update(e=>e+1)}notifyLayoutEditCanceled(){this.layoutEditCanceled.update(e=>e+1)}static \u0275fac=function(t){return new(t||i)};static \u0275prov=u({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})();var $={name:"@mxtommy/kip",version:"4.0.7",description:"An advanced and versatile marine instrumentation package to display Signal K data.",license:"MIT",author:{name:"Thomas St.Pierre, David Godin"},contributors:[{name:"David Godin",email:"godind@hotmail.com"},{name:"Thomas St.Pierre",email:"thomas@samoht.ca"}],homepage:"https://github.com/mxtommy/Kip",bugs:"https://github.com/mxtommy/Kip/issues",repository:{type:"git",url:"git+https://github.com/mxtommy/Kip.git"},keywords:["signalk-webapp","signalk-category-instruments","signalk-category-notifications","signalk-node-server-plugin","signal k","signalk","instruments","dashboard","marine","nmea"],signalk:{appIcon:"assets/icon-72x72.png",displayName:"KIP Instrument MFD"},main:"plugin/index.js","signalk-plugin-enabled-by-default":!0,scripts:{test:"CI=1 ng test --watch=false","test:interactive":"ng test","test:headless":"CI=1 ng test --browsers=ChromeHeadless --watch=false",lint:"ng lint",dev:"ng serve --configuration=dev --serve-path=/@mxtommy/kip/","build:plugin":"tsc -p ./kip-plugin/tsconfig.plugin.json","build:dev":"ng build --configuration=dev","build:prod":"ng build --configuration=production","build:all":"npm run build:plugin && npm run build:prod",e2e:"ng e2e","generate:widget":"npx schematics ./tools/schematics/collection.json:create-host2-widget --dry-run=false"},schematics:"tools/schematics/collection.json",devDependencies:{"@angular-devkit/schematics-cli":"^20.1.6","@angular-devkit/build-angular":"^20.1.6","@angular/animations":"20.1.7","@angular/build":"^20.1.6","@angular/cdk":"20.1.6","@angular/cli":"^20.1.6","@angular/common":"20.1.7","@angular/compiler":"20.1.7","@angular/compiler-cli":"20.1.7","@angular/core":"20.1.7","@angular/forms":"20.1.7","@angular/language-service":"20.1.7","@angular/material":"20.1.6","@angular/platform-browser":"20.1.7","@angular/platform-browser-dynamic":"20.1.7","@angular/router":"20.1.7","@godind/ng-canvas-gauges":"^6.2.1","@robloche/chartjs-plugin-streaming":"^3.1.0","@types/canvas-gauges":"^2.1.8","@types/howler":"^2.2.10","@types/jasmine":"~3.6.0","@types/jasminewd2":"^2.0.9","@types/js-quantities":"^1.6.6","@types/lodash-es":"^4.17.9","@types/node":"^24.1.0","@zakj/no-sleep":"^0.13.5","angular-eslint":"20.1.1","chart.js":"^4.4.9","chartjs-adapter-date-fns":"^3.0.0","chartjs-plugin-annotation":"^3.0.1",codelyzer:"^6.0.0","compare-versions":"^6.1.1","core-js":"^3.13.1","date-fns":"^2.30.0",eslint:"^9.29.0",gridstack:"^12.3.3",howler:"^2.2.4","jasmine-core":"~4.0.1","jasmine-spec-reporter":"~5.0.0","js-quantities":"^1.8.0",karma:"^6.4.4","karma-spec-reporter":"^0.0.36","karma-chrome-launcher":"~3.1.0","karma-cli":"~2.0.0","karma-coverage":"^2.2.0","karma-jasmine":"~4.0.0","karma-jasmine-html-reporter":"^1.6.0","lodash-es":"^4.17.21","ng-packagr":"^20.0.1","ngx-markdown":"^20.0.0",prismjs:"^1.30.0",clipboard:"^2.0.11","ngx-resize-observer":"^3.1.0",protractor:"~7.0.0","pwa-asset-generator":"^8.1.1",rxjs:"^7.8.2",sass:"^1.49.9",screenfull:"^6.0.2",steelseries:"^2.0.9","ts-node":"^10.9.2",tslib:"^2.6.2",typescript:"^5.8.3","zone.js":"^0.15.1"},dependencies:{"@signalk/server-api":"^2.7.2"}};var L=(()=>{class i{_http=a(A);_settings=a(b);_dashboard=a(x);_data=a(D);_destroyRef=a(N);_displayName=m(this._settings.getInstanceNameAsO());_isRemoteControl=m(this._settings.getIsRemoteControlAsO());PLUGIN_URL=this._settings.signalkUrl.url+"/plugins/kip";KIP_UUID=this._settings.KipUUID;ACTIVE_SCREEN_PATH=`self.displays.${this.KIP_UUID}.activeScreen`;previousIsRemoteControl=!1;isRemoteScreenIdxCleared=!0;constructor(){let e=this.setActiveDashboard(this.KIP_UUID,null).then(()=>{console.log("[Remote Dashboards] Startup: cleared stale activeScreen (unconditional)")}).catch(t=>{console.warn("[Remote Dashboards] Startup: failed to clear stale activeScreen",t)});h(()=>{let t=this._isRemoteControl();if(!t&&!this.previousIsRemoteControl)return;let r=this._displayName(),s=this._dashboard.dashboards();p(()=>{this.previousIsRemoteControl=t;let n;if(!t)n=null;else{let o=s.map(k=>{var V=k,{configuration:c}=V,d=C(V,["configuration"]);return d});n={displayName:r,screens:o},this.isRemoteScreenIdxCleared=!1}this.shareScreens(this.KIP_UUID,n).then(()=>{console.log("[Remote Dashboards] Screen configuration shared")}).catch(o=>{console.error("[Remote Dashboards] Error sharing screen configuration:",o)})})}),h(()=>{let t=this._isRemoteControl(),r=this._dashboard.activeDashboard();p(()=>{t?this.setActiveDashboard(this.KIP_UUID,r).then(()=>{}).catch(s=>{console.error("[Remote Dashboards] Error sharing active dashboard:",s)}):this.isRemoteScreenIdxCleared||(this.setActiveDashboard(this.KIP_UUID,null).then(()=>{console.log("[Remote Dashboards] Disabled: Cleared active dashboard on server")}).catch(s=>{console.error("[Remote Dashboards] Error clearing active dashboard on server:",s)}),this.isRemoteScreenIdxCleared=!0)})}),e.finally(()=>this.setupRemoteControlListener())}setupRemoteControlListener(){this._settings.getIsRemoteControlAsO().pipe(P(this._destroyRef)).subscribe(e=>{e?this._data.subscribePath(this.ACTIVE_SCREEN_PATH,"default").pipe(P(this._destroyRef)).subscribe(t=>{if(t.data.value==null)return;let r=Number(t.data.value);!isNaN(r)&&r>=0&&r<this._dashboard.dashboards().length&&this._dashboard.activeDashboard()!==r&&(console.log(`[Remote Dashboards] Setting active dashboard to ${r} from remote update`),this._dashboard.navigateTo(r))}):this._data.unsubscribePath(this.ACTIVE_SCREEN_PATH)})}setActiveDashboard(e,t){return R(this,null,function*(){let r=t===null?null:{screenIdx:t};return _(this._http.put(`${this.PLUGIN_URL}/displays/${e}/activeScreen`,r))})}shareScreens(e,t){let r=t===null?null:g({},t);return _(this._http.put(`${this.PLUGIN_URL}/displays/${e}`,r))}static \u0275fac=function(t){return new(t||i)};static \u0275prov=u({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})();var De=(()=>{class i{MODE_PATH="self.environment.mode";configurableThemeColors=[{label:"Contrast",value:"contrast"},{label:"Blue",value:"blue"},{label:"Green",value:"green"},{label:"Orange",value:"orange"},{label:"Yellow",value:"yellow"},{label:"Pink",value:"pink"},{label:"Purple",value:"purple"},{label:"Grey",value:"grey"}];snackbarAppNotifications=new w;cssThemeColorRoles$=new y(null);_cssThemeColorRoles=null;_settings=a(b);_data=a(D);_iconRegistry=a(E);_sanitizer=a(M);_remote=a(L);isNightMode=l(!1);_useAutoNightMode=m(this._settings.getAutoNightModeAsO(),{requireSync:!0});_theme=m(this._settings.getThemeNameAsO(),{requireSync:!0});_redNightMode=m(this._settings.getRedNightModeAsO(),{requireSync:!0});_environmentMode=m(this._data.subscribePath(this.MODE_PATH,"default"));previousEnvironmentMode=null;appVersion=l($.version);browserVersion=l("Unknown");osVersion=l("Unknown");constructor(){this._iconRegistry.addSvgIconSet(this._sanitizer.bypassSecurityTrustResourceUrl("assets/svg/icons.svg")),h(()=>{this._theme()==="light-theme"?document.body.classList.toggle("light-theme",this._theme()==="light-theme"):document.body.classList.remove("light-theme")}),h(()=>{let e=this._environmentMode().data.value;p(()=>{this.previousEnvironmentMode!==e&&(this.previousEnvironmentMode=e,this._useAutoNightMode()&&(this.isNightMode.set(e==="night"),this.toggleDayNightMode()))})}),h(()=>{let e=this._redNightMode();p(()=>{e?this.toggleDayNightMode():this.toggleDayNightMode()})}),this.readThemeCssRoleVariables(),this._cssThemeColorRoles=this.cssThemeColorRoles$.getValue(),this.browserVersion.set(this.getBrowserVersion()),this.osVersion.set(this.getOSVersion()),console.log("*********** KIP Version Information ***********"),console.log(`** App Version: ${this.appVersion()}`),console.log(`** Browser Version: ${this.browserVersion()}`),console.log(`** OS Version: ${this.osVersion()}`),console.log("***********************************************")}sendSnackbarNotification(e,t=1e4,r=!1,s="Dismiss"){this.snackbarAppNotifications.next({message:e,duration:t,silent:r,action:s})}getSnackbarAppNotifications(){return this.snackbarAppNotifications.asObservable()}readThemeCssRoleVariables(){let e=document.body,t=getComputedStyle(e),r={background:t.getPropertyValue("--mat-sys-background").trim(),cardColor:t.getPropertyValue("--kip-widget-card-background-color").trim(),blue:t.getPropertyValue("--kip-blue-color").trim(),blueDim:t.getPropertyValue("--kip-blue-dim-color").trim(),blueDimmer:t.getPropertyValue("--kip-blue-dimmer-color").trim(),green:t.getPropertyValue("--kip-green-color").trim(),greenDim:t.getPropertyValue("--kip-green-dim-color").trim(),greenDimmer:t.getPropertyValue("--kip-green-dimmer-color").trim(),grey:t.getPropertyValue("--kip-grey-color").trim(),greyDim:t.getPropertyValue("--kip-grey-dim-color").trim(),greyDimmer:t.getPropertyValue("--kip-grey-dimmer-color").trim(),orange:t.getPropertyValue("--kip-orange-color").trim(),orangeDim:t.getPropertyValue("--kip-orange-dim-color").trim(),orangeDimmer:t.getPropertyValue("--kip-orange-dimmer-color").trim(),pink:t.getPropertyValue("--kip-pink-color").trim(),pinkDim:t.getPropertyValue("--kip-pink-dim-color").trim(),pinkDimmer:t.getPropertyValue("--kip-pink-dimmer-color").trim(),purple:t.getPropertyValue("--kip-purple-color").trim(),purpleDim:t.getPropertyValue("--kip-purple-dim-color").trim(),purpleDimmer:t.getPropertyValue("--kip-purple-dimmer-color").trim(),contrast:t.getPropertyValue("--kip-contrast-color").trim(),contrastDim:t.getPropertyValue("--kip-contrast-dim-color").trim(),contrastDimmer:t.getPropertyValue("--kip-contrast-dimmer-color").trim(),yellow:t.getPropertyValue("--kip-yellow-color").trim(),yellowDim:t.getPropertyValue("--kip-yellow-dim-color").trim(),yellowDimmer:t.getPropertyValue("--kip-yellow-dimmer-color").trim(),port:t.getPropertyValue("--kip-port-color").trim(),starboard:t.getPropertyValue("--kip-starboard-color").trim(),zoneNominal:t.getPropertyValue("--kip-zone-nominal-color").trim(),zoneAlert:t.getPropertyValue("--kip-zone-alert-color").trim(),zoneWarn:t.getPropertyValue("--kip-zone-warn-color").trim(),zoneAlarm:t.getPropertyValue("--kip-zone-alarm-color").trim(),zoneEmergency:t.getPropertyValue("--kip-zone-emergency-color").trim()};this.cssThemeColorRoles$.next(r)}get cssThemeColors(){return this._cssThemeColorRoles}setBrightness(e,t=!1){let r=document.body;r.style.setProperty("--kip-nightModeBrightness",`${e}`);let s=t?" sepia(0.5) hue-rotate(-30deg)":"";r.style.setProperty("--kip-nightModeFilters",s)}toggleDayNightMode(){this.isNightMode()?this._redNightMode()?(document.body.classList.toggle("night-theme",!0),this.setBrightness(1,!1)):(this.setBrightness(this._settings.getNightModeBrightness(),!0),document.body.classList.remove("night-theme"),this._theme()==="light-theme"?document.body.classList.toggle("light-theme",this._theme()==="light-theme"):document.body.classList.remove("light-theme")):(document.body.classList.remove("night-theme"),this._theme()==="light-theme"&&document.body.classList.toggle("light-theme",this._theme()==="light-theme"),this.setBrightness(1,!1)),this.readThemeCssRoleVariables(),this._cssThemeColorRoles=this.cssThemeColorRoles$.getValue()}getBrowserVersion(){let e=navigator.userAgent,t="Unknown";return e.includes("Edg")?t=`Edge ${e.match(/Edg\/(\d+)/)?.[1]}`:e.includes("Chrome")&&!e.includes("Edg")&&!e.includes("Chromium")?t=`Chrome ${e.match(/Chrome\/(\d+)/)?.[1]}`:e.includes("Chromium")?t=`Chromium ${e.match(/Chromium\/(\d+)/)?.[1]}`:e.includes("Firefox")?t=`Firefox ${e.match(/Firefox\/(\d+)/)?.[1]}`:e.includes("Safari")&&!e.includes("Chrome")&&!e.includes("Chromium")?t=`Safari ${e.match(/Version\/(\d+)/)?.[1]}`:(e.includes("Opera")||e.includes("OPR"))&&(t=`Opera ${e.match(/(Opera|OPR)\/(\d+)/)?.[2]}`),t}getOSVersion(){let e=navigator.platform,t=navigator.userAgent;return e.startsWith("Mac")?"macOS":e.startsWith("Win")?"Windows":/Linux/.test(e)?t.includes("ARM")||t.includes("aarch64")||t.includes("Raspberry")||e.includes("armv7l")||e.includes("armv8l")?"Raspberry Pi":"Linux":"Unknown OS"}static \u0275fac=function(t){return new(t||i)};static \u0275prov=u({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})();export{x as a,De as b};
|
package/public/chunk-JCVEDDSQ.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as Xe,n as mt,o as ut,p as ft,q as vt,r as Dt,s as bt}from"./chunk-ROD2YZ6L.js";import"./chunk-QVCMARCU.js";import{a as xt}from"./chunk-IJ22WXFB.js";import{d as wt,e as St,g as Pt,h as yt}from"./chunk-RYHOAWDD.js";import"./chunk-PKKBBIJK.js";import"./chunk-HIADZ4BV.js";import{a as et,b as at}from"./chunk-DADLXEYG.js";import{b as gt}from"./chunk-OQULS6SV.js";import"./chunk-QLTN6G6E.js";import"./chunk-XDPHEQEO.js";import"./chunk-SZ2GUIT5.js";import{D as Ae,Dd as fe,E as $,Ea as ae,Fa as b,Gb as Ke,Gd as M,Ha as le,Hb as ce,Hd as L,Jb as F,K as Fe,Kb as f,La as Ge,Lb as he,Ld as ve,Oa as R,Oc as me,Qa as de,Sc as Je,Td as lt,V as ie,Vd as dt,W as He,Wa as S,Wc as Qe,Wd as ct,X as A,Xa as U,Xb as pe,Ya as $e,Yd as ht,Z as Be,_d as q,ab as Ue,ad as tt,bb as We,bd as it,ca as se,cb as Ze,cd as j,dc as _e,de as pt,ea as k,ed as H,fb as je,fe as _t,g as T,ga as c,gb as qe,hb as I,hd as ue,i as te,ib as p,j as _,ja as E,jb as g,jd as x,ka as C,kb as W,l as Me,md as st,n as Le,na as ze,nc as ge,oa as ne,od as nt,pc as O,pd as rt,qc as Ye,ra as re,rb as Z,tb as m,ua as Ve,vb as y,w as Ne,wa as oe,wd as ot}from"./chunk-OB3QLUH6.js";function we(r){let t=r.cloneNode(!0),e=t.querySelectorAll("[id]"),i=r.nodeName.toLowerCase();t.removeAttribute("id");for(let s=0;s<e.length;s++)e[s].removeAttribute("id");return i==="canvas"?Rt(r,t):(i==="input"||i==="select"||i==="textarea")&&Ct(r,t),Et("canvas",r,t,Rt),Et("input, textarea, select",r,t,Ct),t}function Et(r,t,e,i){let s=t.querySelectorAll(r);if(s.length){let n=e.querySelectorAll(r);for(let o=0;o<s.length;o++)i(s[o],n[o])}}var ni=0;function Ct(r,t){t.type!=="file"&&(t.value=r.value),t.type==="radio"&&t.name&&(t.name=`mat-clone-${t.name}-${ni++}`)}function Rt(r,t){let e=t.getContext("2d");if(e)try{e.drawImage(r,0,0)}catch{}}function Re(r){let t=r.getBoundingClientRect();return{top:t.top,right:t.right,bottom:t.bottom,left:t.left,width:t.width,height:t.height,x:t.x,y:t.y}}function Se(r,t,e){let{top:i,bottom:s,left:n,right:o}=r;return e>=i&&e<=s&&t>=n&&t<=o}function ri(r,t){let e=t.left<r.left,i=t.left+t.width>r.right,s=t.top<r.top,n=t.top+t.height>r.bottom;return e||i||s||n}function V(r,t,e){r.top+=t,r.bottom=r.top+r.height,r.left+=e,r.right=r.left+r.width}function It(r,t,e,i){let{top:s,right:n,bottom:o,left:a,width:l,height:d}=r,h=l*t,v=d*t;return i>s-v&&i<o+v&&e>a-h&&e<n+h}var K=class{_document;positions=new Map;constructor(t){this._document=t}clear(){this.positions.clear()}cache(t){this.clear(),this.positions.set(this._document,{scrollPosition:this.getViewportScrollPosition()}),t.forEach(e=>{this.positions.set(e,{scrollPosition:{top:e.scrollTop,left:e.scrollLeft},clientRect:Re(e)})})}handleScroll(t){let e=H(t),i=this.positions.get(e);if(!i)return null;let s=i.scrollPosition,n,o;if(e===this._document){let d=this.getViewportScrollPosition();n=d.top,o=d.left}else n=e.scrollTop,o=e.scrollLeft;let a=s.top-n,l=s.left-o;return this.positions.forEach((d,h)=>{d.clientRect&&e!==h&&e.contains(h)&&V(d.clientRect,a,l)}),s.top=n,s.left=o,{top:a,left:l}}getViewportScrollPosition(){return{top:window.scrollY,left:window.scrollX}}};function Gt(r,t){let e=r.rootNodes;if(e.length===1&&e[0].nodeType===t.ELEMENT_NODE)return e[0];let i=t.createElement("div");return e.forEach(s=>i.appendChild(s)),i}function Ie(r,t,e){for(let i in t)if(t.hasOwnProperty(i)){let s=t[i];s?r.setProperty(i,s,e?.has(i)?"important":""):r.removeProperty(i)}return r}function N(r,t){let e=t?"":"none";Ie(r.style,{"touch-action":t?"":"none","-webkit-user-drag":t?"":"none","-webkit-tap-highlight-color":t?"":"transparent","user-select":e,"-ms-user-select":e,"-webkit-user-select":e,"-moz-user-select":e})}function Tt(r,t,e){Ie(r.style,{position:t?"":"fixed",top:t?"":"0",opacity:t?"":"0",left:t?"":"-999em"},e)}function Y(r,t){return t&&t!="none"?r+" "+t:r}function kt(r,t){r.style.width=`${t.width}px`,r.style.height=`${t.height}px`,r.style.transform=G(t.left,t.top)}function G(r,t){return`translate3d(${Math.round(r)}px, ${Math.round(t)}px, 0)`}function Ot(r){let t=r.toLowerCase().indexOf("ms")>-1?1:1e3;return parseFloat(r)*t}function oi(r){let t=getComputedStyle(r),e=De(t,"transition-property"),i=e.find(a=>a==="transform"||a==="all");if(!i)return 0;let s=e.indexOf(i),n=De(t,"transition-duration"),o=De(t,"transition-delay");return Ot(n[s])+Ot(o[s])}function De(r,t){return r.getPropertyValue(t).split(",").map(i=>i.trim())}var ai=new Set(["position"]),Pe=class{_document;_rootElement;_direction;_initialDomRect;_previewTemplate;_previewClass;_pickupPositionOnPage;_initialTransform;_zIndex;_renderer;_previewEmbeddedView;_preview;get element(){return this._preview}constructor(t,e,i,s,n,o,a,l,d,h){this._document=t,this._rootElement=e,this._direction=i,this._initialDomRect=s,this._previewTemplate=n,this._previewClass=o,this._pickupPositionOnPage=a,this._initialTransform=l,this._zIndex=d,this._renderer=h}attach(t){this._preview=this._createPreview(),t.appendChild(this._preview),Mt(this._preview)&&this._preview.showPopover()}destroy(){this._preview.remove(),this._previewEmbeddedView?.destroy(),this._preview=this._previewEmbeddedView=null}setTransform(t){this._preview.style.transform=t}getBoundingClientRect(){return this._preview.getBoundingClientRect()}addClass(t){this._preview.classList.add(t)}getTransitionDuration(){return oi(this._preview)}addEventListener(t,e){return this._renderer.listen(this._preview,t,e)}_createPreview(){let t=this._previewTemplate,e=this._previewClass,i=t?t.template:null,s;if(i&&t){let n=t.matchSize?this._initialDomRect:null,o=t.viewContainer.createEmbeddedView(i,t.context);o.detectChanges(),s=Gt(o,this._document),this._previewEmbeddedView=o,t.matchSize?kt(s,n):s.style.transform=G(this._pickupPositionOnPage.x,this._pickupPositionOnPage.y)}else s=we(this._rootElement),kt(s,this._initialDomRect),this._initialTransform&&(s.style.transform=this._initialTransform);return Ie(s.style,{"pointer-events":"none",margin:Mt(s)?"0 auto 0 0":"0",position:"fixed",top:"0",left:"0","z-index":this._zIndex+""},ai),N(s,!1),s.classList.add("cdk-drag-preview"),s.setAttribute("popover","manual"),s.setAttribute("dir",this._direction),e&&(Array.isArray(e)?e.forEach(n=>s.classList.add(n)):s.classList.add(e)),s}};function Mt(r){return"showPopover"in r}var li={passive:!0},Lt={passive:!1},di={passive:!1,capture:!0},ci=800,Nt="cdk-drag-placeholder",At=new Set(["position"]),ye=class{_config;_document;_ngZone;_viewportRuler;_dragDropRegistry;_renderer;_rootElementCleanups;_cleanupShadowRootSelectStart;_preview;_previewContainer;_placeholderRef;_placeholder;_pickupPositionInElement;_pickupPositionOnPage;_marker;_anchor=null;_passiveTransform={x:0,y:0};_activeTransform={x:0,y:0};_initialTransform;_hasStartedDragging=re(!1);_hasMoved;_initialContainer;_initialIndex;_parentPositions;_moveEvents=new _;_pointerDirectionDelta;_pointerPositionAtLastDirectionChange;_lastKnownPointerPosition;_rootElement;_ownerSVGElement;_rootElementTapHighlight;_pointerMoveSubscription=T.EMPTY;_pointerUpSubscription=T.EMPTY;_scrollSubscription=T.EMPTY;_resizeSubscription=T.EMPTY;_lastTouchEventTime;_dragStartTime;_boundaryElement=null;_nativeInteractionsEnabled=!0;_initialDomRect;_previewRect;_boundaryRect;_previewTemplate;_placeholderTemplate;_handles=[];_disabledHandles=new Set;_dropContainer;_direction="ltr";_parentDragRef;_cachedShadowRoot;lockAxis;dragStartDelay=0;previewClass;scale=1;get disabled(){return this._disabled||!!(this._dropContainer&&this._dropContainer.disabled)}set disabled(t){t!==this._disabled&&(this._disabled=t,this._toggleNativeDragInteractions(),this._handles.forEach(e=>N(e,t)))}_disabled=!1;beforeStarted=new _;started=new _;released=new _;ended=new _;entered=new _;exited=new _;dropped=new _;moved=this._moveEvents;data;constrainPosition;constructor(t,e,i,s,n,o,a){this._config=e,this._document=i,this._ngZone=s,this._viewportRuler=n,this._dragDropRegistry=o,this._renderer=a,this.withRootElement(t).withParent(e.parentDragRef||null),this._parentPositions=new K(i),o.registerDragItem(this)}getPlaceholderElement(){return this._placeholder}getRootElement(){return this._rootElement}getVisibleElement(){return this.isDragging()?this.getPlaceholderElement():this.getRootElement()}withHandles(t){this._handles=t.map(i=>x(i)),this._handles.forEach(i=>N(i,this.disabled)),this._toggleNativeDragInteractions();let e=new Set;return this._disabledHandles.forEach(i=>{this._handles.indexOf(i)>-1&&e.add(i)}),this._disabledHandles=e,this}withPreviewTemplate(t){return this._previewTemplate=t,this}withPlaceholderTemplate(t){return this._placeholderTemplate=t,this}withRootElement(t){let e=x(t);if(e!==this._rootElement){this._removeRootElementListeners();let i=this._renderer;this._rootElementCleanups=this._ngZone.runOutsideAngular(()=>[i.listen(e,"mousedown",this._pointerDown,Lt),i.listen(e,"touchstart",this._pointerDown,li),i.listen(e,"dragstart",this._nativeDragStart,Lt)]),this._initialTransform=void 0,this._rootElement=e}return typeof SVGElement<"u"&&this._rootElement instanceof SVGElement&&(this._ownerSVGElement=this._rootElement.ownerSVGElement),this}withBoundaryElement(t){return this._boundaryElement=t?x(t):null,this._resizeSubscription.unsubscribe(),t&&(this._resizeSubscription=this._viewportRuler.change(10).subscribe(()=>this._containInsideBoundaryOnResize())),this}withParent(t){return this._parentDragRef=t,this}dispose(){this._removeRootElementListeners(),this.isDragging()&&this._rootElement?.remove(),this._marker?.remove(),this._destroyPreview(),this._destroyPlaceholder(),this._dragDropRegistry.removeDragItem(this),this._removeListeners(),this.beforeStarted.complete(),this.started.complete(),this.released.complete(),this.ended.complete(),this.entered.complete(),this.exited.complete(),this.dropped.complete(),this._moveEvents.complete(),this._handles=[],this._disabledHandles.clear(),this._dropContainer=void 0,this._resizeSubscription.unsubscribe(),this._parentPositions.clear(),this._boundaryElement=this._rootElement=this._ownerSVGElement=this._placeholderTemplate=this._previewTemplate=this._marker=this._parentDragRef=null}isDragging(){return this._hasStartedDragging()&&this._dragDropRegistry.isDragging(this)}reset(){this._rootElement.style.transform=this._initialTransform||"",this._activeTransform={x:0,y:0},this._passiveTransform={x:0,y:0}}resetToBoundary(){if(this._boundaryElement&&this._rootElement&&ri(this._boundaryElement.getBoundingClientRect(),this._rootElement.getBoundingClientRect())){let t=this._boundaryElement.getBoundingClientRect(),e=this._rootElement.getBoundingClientRect(),i=0,s=0;e.left<t.left?i=t.left-e.left:e.right>t.right&&(i=t.right-e.right),e.top<t.top?s=t.top-e.top:e.bottom>t.bottom&&(s=t.bottom-e.bottom);let n=this._activeTransform.x,o=this._activeTransform.y,a=n+i,l=o+s;this._rootElement.style.transform=G(a,l),this._activeTransform={x:a,y:l},this._passiveTransform={x:a,y:l}}}disableHandle(t){!this._disabledHandles.has(t)&&this._handles.indexOf(t)>-1&&(this._disabledHandles.add(t),N(t,!0))}enableHandle(t){this._disabledHandles.has(t)&&(this._disabledHandles.delete(t),N(t,this.disabled))}withDirection(t){return this._direction=t,this}_withDropContainer(t){this._dropContainer=t}getFreeDragPosition(){let t=this.isDragging()?this._activeTransform:this._passiveTransform;return{x:t.x,y:t.y}}setFreeDragPosition(t){return this._activeTransform={x:0,y:0},this._passiveTransform.x=t.x,this._passiveTransform.y=t.y,this._dropContainer||this._applyRootElementTransform(t.x,t.y),this}withPreviewContainer(t){return this._previewContainer=t,this}_sortFromLastPointerPosition(){let t=this._lastKnownPointerPosition;t&&this._dropContainer&&this._updateActiveDropContainer(this._getConstrainedPointerPosition(t),t)}_removeListeners(){this._pointerMoveSubscription.unsubscribe(),this._pointerUpSubscription.unsubscribe(),this._scrollSubscription.unsubscribe(),this._cleanupShadowRootSelectStart?.(),this._cleanupShadowRootSelectStart=void 0}_destroyPreview(){this._preview?.destroy(),this._preview=null}_destroyPlaceholder(){this._anchor?.remove(),this._placeholder?.remove(),this._placeholderRef?.destroy(),this._placeholder=this._anchor=this._placeholderRef=null}_pointerDown=t=>{if(this.beforeStarted.next(),this._handles.length){let e=this._getTargetHandle(t);e&&!this._disabledHandles.has(e)&&!this.disabled&&this._initializeDragSequence(e,t)}else this.disabled||this._initializeDragSequence(this._rootElement,t)};_pointerMove=t=>{let e=this._getPointerPositionOnPage(t);if(!this._hasStartedDragging()){let s=Math.abs(e.x-this._pickupPositionOnPage.x),n=Math.abs(e.y-this._pickupPositionOnPage.y);if(s+n>=this._config.dragStartThreshold){let a=Date.now()>=this._dragStartTime+this._getDragStartDelay(t),l=this._dropContainer;if(!a){this._endDragSequence(t);return}(!l||!l.isDragging()&&!l.isReceiving())&&(t.cancelable&&t.preventDefault(),this._hasStartedDragging.set(!0),this._ngZone.run(()=>this._startDragSequence(t)))}return}t.cancelable&&t.preventDefault();let i=this._getConstrainedPointerPosition(e);if(this._hasMoved=!0,this._lastKnownPointerPosition=e,this._updatePointerDirectionDelta(i),this._dropContainer)this._updateActiveDropContainer(i,e);else{let s=this.constrainPosition?this._initialDomRect:this._pickupPositionOnPage,n=this._activeTransform;n.x=i.x-s.x+this._passiveTransform.x,n.y=i.y-s.y+this._passiveTransform.y,this._applyRootElementTransform(n.x,n.y)}this._moveEvents.observers.length&&this._ngZone.run(()=>{this._moveEvents.next({source:this,pointerPosition:i,event:t,distance:this._getDragDistance(i),delta:this._pointerDirectionDelta})})};_pointerUp=t=>{this._endDragSequence(t)};_endDragSequence(t){if(this._dragDropRegistry.isDragging(this)&&(this._removeListeners(),this._dragDropRegistry.stopDragging(this),this._toggleNativeDragInteractions(),this._handles&&(this._rootElement.style.webkitTapHighlightColor=this._rootElementTapHighlight),!!this._hasStartedDragging()))if(this.released.next({source:this,event:t}),this._dropContainer)this._dropContainer._stopScrolling(),this._animatePreviewToPlaceholder().then(()=>{this._cleanupDragArtifacts(t),this._cleanupCachedDimensions(),this._dragDropRegistry.stopDragging(this)});else{this._passiveTransform.x=this._activeTransform.x;let e=this._getPointerPositionOnPage(t);this._passiveTransform.y=this._activeTransform.y,this._ngZone.run(()=>{this.ended.next({source:this,distance:this._getDragDistance(e),dropPoint:e,event:t})}),this._cleanupCachedDimensions(),this._dragDropRegistry.stopDragging(this)}}_startDragSequence(t){B(t)&&(this._lastTouchEventTime=Date.now()),this._toggleNativeDragInteractions();let e=this._getShadowRoot(),i=this._dropContainer;if(e&&this._ngZone.runOutsideAngular(()=>{this._cleanupShadowRootSelectStart=this._renderer.listen(e,"selectstart",hi,di)}),i){let s=this._rootElement,n=s.parentNode,o=this._placeholder=this._createPlaceholderElement(),a=this._marker=this._marker||this._document.createComment("");n.insertBefore(a,s),this._initialTransform=s.style.transform||"",this._preview=new Pe(this._document,this._rootElement,this._direction,this._initialDomRect,this._previewTemplate||null,this.previewClass||null,this._pickupPositionOnPage,this._initialTransform,this._config.zIndex||1e3,this._renderer),this._preview.attach(this._getPreviewInsertionPoint(n,e)),Tt(s,!1,At),this._document.body.appendChild(n.replaceChild(o,s)),this.started.next({source:this,event:t}),i.start(),this._initialContainer=i,this._initialIndex=i.getItemIndex(this)}else this.started.next({source:this,event:t}),this._initialContainer=this._initialIndex=void 0;this._parentPositions.cache(i?i.getScrollableParents():[])}_initializeDragSequence(t,e){this._parentDragRef&&e.stopPropagation();let i=this.isDragging(),s=B(e),n=!s&&e.button!==0,o=this._rootElement,a=H(e),l=!s&&this._lastTouchEventTime&&this._lastTouchEventTime+ci>Date.now(),d=s?it(e):tt(e);if(a&&a.draggable&&e.type==="mousedown"&&e.preventDefault(),i||n||l||d)return;if(this._handles.length){let P=o.style;this._rootElementTapHighlight=P.webkitTapHighlightColor||"",P.webkitTapHighlightColor="transparent"}this._hasMoved=!1,this._hasStartedDragging.set(this._hasMoved),this._removeListeners(),this._initialDomRect=this._rootElement.getBoundingClientRect(),this._pointerMoveSubscription=this._dragDropRegistry.pointerMove.subscribe(this._pointerMove),this._pointerUpSubscription=this._dragDropRegistry.pointerUp.subscribe(this._pointerUp),this._scrollSubscription=this._dragDropRegistry.scrolled(this._getShadowRoot()).subscribe(P=>this._updateOnScroll(P)),this._boundaryElement&&(this._boundaryRect=Re(this._boundaryElement));let h=this._previewTemplate;this._pickupPositionInElement=h&&h.template&&!h.matchSize?{x:0,y:0}:this._getPointerPositionInElement(this._initialDomRect,t,e);let v=this._pickupPositionOnPage=this._lastKnownPointerPosition=this._getPointerPositionOnPage(e);this._pointerDirectionDelta={x:0,y:0},this._pointerPositionAtLastDirectionChange={x:v.x,y:v.y},this._dragStartTime=Date.now(),this._dragDropRegistry.startDragging(this,e)}_cleanupDragArtifacts(t){Tt(this._rootElement,!0,At),this._marker.parentNode.replaceChild(this._rootElement,this._marker),this._destroyPreview(),this._destroyPlaceholder(),this._initialDomRect=this._boundaryRect=this._previewRect=this._initialTransform=void 0,this._ngZone.run(()=>{let e=this._dropContainer,i=e.getItemIndex(this),s=this._getPointerPositionOnPage(t),n=this._getDragDistance(s),o=e._isOverContainer(s.x,s.y);this.ended.next({source:this,distance:n,dropPoint:s,event:t}),this.dropped.next({item:this,currentIndex:i,previousIndex:this._initialIndex,container:e,previousContainer:this._initialContainer,isPointerOverContainer:o,distance:n,dropPoint:s,event:t}),e.drop(this,i,this._initialIndex,this._initialContainer,o,n,s,t),this._dropContainer=this._initialContainer})}_updateActiveDropContainer({x:t,y:e},{x:i,y:s}){let n=this._initialContainer._getSiblingContainerFromPosition(this,t,e);!n&&this._dropContainer!==this._initialContainer&&this._initialContainer._isOverContainer(t,e)&&(n=this._initialContainer),n&&n!==this._dropContainer&&this._ngZone.run(()=>{let o=this._dropContainer.getItemIndex(this),a=this._dropContainer.getItemAtIndex(o+1)?.getVisibleElement()||null;this.exited.next({item:this,container:this._dropContainer}),this._dropContainer.exit(this),this._conditionallyInsertAnchor(n,this._dropContainer,a),this._dropContainer=n,this._dropContainer.enter(this,t,e,n===this._initialContainer&&n.sortingDisabled?this._initialIndex:void 0),this.entered.next({item:this,container:n,currentIndex:n.getItemIndex(this)})}),this.isDragging()&&(this._dropContainer._startScrollingIfNecessary(i,s),this._dropContainer._sortItem(this,t,e,this._pointerDirectionDelta),this.constrainPosition?this._applyPreviewTransform(t,e):this._applyPreviewTransform(t-this._pickupPositionInElement.x,e-this._pickupPositionInElement.y))}_animatePreviewToPlaceholder(){if(!this._hasMoved)return Promise.resolve();let t=this._placeholder.getBoundingClientRect();this._preview.addClass("cdk-drag-animating"),this._applyPreviewTransform(t.left,t.top);let e=this._preview.getTransitionDuration();return e===0?Promise.resolve():this._ngZone.runOutsideAngular(()=>new Promise(i=>{let s=a=>{(!a||this._preview&&H(a)===this._preview.element&&a.propertyName==="transform")&&(o(),i(),clearTimeout(n))},n=setTimeout(s,e*1.5),o=this._preview.addEventListener("transitionend",s)}))}_createPlaceholderElement(){let t=this._placeholderTemplate,e=t?t.template:null,i;return e?(this._placeholderRef=t.viewContainer.createEmbeddedView(e,t.context),this._placeholderRef.detectChanges(),i=Gt(this._placeholderRef,this._document)):i=we(this._rootElement),i.style.pointerEvents="none",i.classList.add(Nt),i}_getPointerPositionInElement(t,e,i){let s=e===this._rootElement?null:e,n=s?s.getBoundingClientRect():t,o=B(i)?i.targetTouches[0]:i,a=this._getViewportScrollPosition(),l=o.pageX-n.left-a.left,d=o.pageY-n.top-a.top;return{x:n.left-t.left+l,y:n.top-t.top+d}}_getPointerPositionOnPage(t){let e=this._getViewportScrollPosition(),i=B(t)?t.touches[0]||t.changedTouches[0]||{pageX:0,pageY:0}:t,s=i.pageX-e.left,n=i.pageY-e.top;if(this._ownerSVGElement){let o=this._ownerSVGElement.getScreenCTM();if(o){let a=this._ownerSVGElement.createSVGPoint();return a.x=s,a.y=n,a.matrixTransform(o.inverse())}}return{x:s,y:n}}_getConstrainedPointerPosition(t){let e=this._dropContainer?this._dropContainer.lockAxis:null,{x:i,y:s}=this.constrainPosition?this.constrainPosition(t,this,this._initialDomRect,this._pickupPositionInElement):t;if(this.lockAxis==="x"||e==="x"?s=this._pickupPositionOnPage.y-(this.constrainPosition?this._pickupPositionInElement.y:0):(this.lockAxis==="y"||e==="y")&&(i=this._pickupPositionOnPage.x-(this.constrainPosition?this._pickupPositionInElement.x:0)),this._boundaryRect){let{x:n,y:o}=this.constrainPosition?{x:0,y:0}:this._pickupPositionInElement,a=this._boundaryRect,{width:l,height:d}=this._getPreviewRect(),h=a.top+o,v=a.bottom-(d-o),P=a.left+n,Q=a.right-(l-n);i=Ft(i,P,Q),s=Ft(s,h,v)}return{x:i,y:s}}_updatePointerDirectionDelta(t){let{x:e,y:i}=t,s=this._pointerDirectionDelta,n=this._pointerPositionAtLastDirectionChange,o=Math.abs(e-n.x),a=Math.abs(i-n.y);return o>this._config.pointerDirectionChangeThreshold&&(s.x=e>n.x?1:-1,n.x=e),a>this._config.pointerDirectionChangeThreshold&&(s.y=i>n.y?1:-1,n.y=i),s}_toggleNativeDragInteractions(){if(!this._rootElement||!this._handles)return;let t=this._handles.length>0||!this.isDragging();t!==this._nativeInteractionsEnabled&&(this._nativeInteractionsEnabled=t,N(this._rootElement,t))}_removeRootElementListeners(){this._rootElementCleanups?.forEach(t=>t()),this._rootElementCleanups=void 0}_applyRootElementTransform(t,e){let i=1/this.scale,s=G(t*i,e*i),n=this._rootElement.style;this._initialTransform==null&&(this._initialTransform=n.transform&&n.transform!="none"?n.transform:""),n.transform=Y(s,this._initialTransform)}_applyPreviewTransform(t,e){let i=this._previewTemplate?.template?void 0:this._initialTransform,s=G(t,e);this._preview.setTransform(Y(s,i))}_getDragDistance(t){let e=this._pickupPositionOnPage;return e?{x:t.x-e.x,y:t.y-e.y}:{x:0,y:0}}_cleanupCachedDimensions(){this._boundaryRect=this._previewRect=void 0,this._parentPositions.clear()}_containInsideBoundaryOnResize(){let{x:t,y:e}=this._passiveTransform;if(t===0&&e===0||this.isDragging()||!this._boundaryElement)return;let i=this._rootElement.getBoundingClientRect(),s=this._boundaryElement.getBoundingClientRect();if(s.width===0&&s.height===0||i.width===0&&i.height===0)return;let n=s.left-i.left,o=i.right-s.right,a=s.top-i.top,l=i.bottom-s.bottom;s.width>i.width?(n>0&&(t+=n),o>0&&(t-=o)):t=0,s.height>i.height?(a>0&&(e+=a),l>0&&(e-=l)):e=0,(t!==this._passiveTransform.x||e!==this._passiveTransform.y)&&this.setFreeDragPosition({y:e,x:t})}_getDragStartDelay(t){let e=this.dragStartDelay;return typeof e=="number"?e:B(t)?e.touch:e?e.mouse:0}_updateOnScroll(t){let e=this._parentPositions.handleScroll(t);if(e){let i=H(t);this._boundaryRect&&i!==this._boundaryElement&&i.contains(this._boundaryElement)&&V(this._boundaryRect,e.top,e.left),this._pickupPositionOnPage.x+=e.left,this._pickupPositionOnPage.y+=e.top,this._dropContainer||(this._activeTransform.x-=e.left,this._activeTransform.y-=e.top,this._applyRootElementTransform(this._activeTransform.x,this._activeTransform.y))}}_getViewportScrollPosition(){return this._parentPositions.positions.get(this._document)?.scrollPosition||this._parentPositions.getViewportScrollPosition()}_getShadowRoot(){return this._cachedShadowRoot===void 0&&(this._cachedShadowRoot=j(this._rootElement)),this._cachedShadowRoot}_getPreviewInsertionPoint(t,e){let i=this._previewContainer||"global";if(i==="parent")return t;if(i==="global"){let s=this._document;return e||s.fullscreenElement||s.webkitFullscreenElement||s.mozFullScreenElement||s.msFullscreenElement||s.body}return x(i)}_getPreviewRect(){return(!this._previewRect||!this._previewRect.width&&!this._previewRect.height)&&(this._previewRect=this._preview?this._preview.getBoundingClientRect():this._initialDomRect),this._previewRect}_nativeDragStart=t=>{if(this._handles.length){let e=this._getTargetHandle(t);e&&!this._disabledHandles.has(e)&&!this.disabled&&t.preventDefault()}else this.disabled||t.preventDefault()};_getTargetHandle(t){return this._handles.find(e=>t.target&&(t.target===e||e.contains(t.target)))}_conditionallyInsertAnchor(t,e,i){if(t===this._initialContainer)this._anchor?.remove(),this._anchor=null;else if(e===this._initialContainer&&e.hasAnchor){let s=this._anchor??=we(this._placeholder);s.classList.remove(Nt),s.classList.add("cdk-drag-anchor"),s.style.transform="",i?i.before(s):x(e.element).appendChild(s)}}};function Ft(r,t,e){return Math.max(t,Math.min(e,r))}function B(r){return r.type[0]==="t"}function hi(r){r.preventDefault()}function J(r,t,e){let i=Ht(t,r.length-1),s=Ht(e,r.length-1);if(i===s)return;let n=r[i],o=s<i?-1:1;for(let a=i;a!==s;a+=o)r[a]=r[a+o];r[s]=n}function Ht(r,t){return Math.max(0,Math.min(t,r))}var X=class{_dragDropRegistry;_element;_sortPredicate;_itemPositions=[];_activeDraggables;orientation="vertical";direction;constructor(t){this._dragDropRegistry=t}_previousSwap={drag:null,delta:0,overlaps:!1};start(t){this.withItems(t)}sort(t,e,i,s){let n=this._itemPositions,o=this._getItemIndexFromPointerPosition(t,e,i,s);if(o===-1&&n.length>0)return null;let a=this.orientation==="horizontal",l=n.findIndex(D=>D.drag===t),d=n[o],h=n[l].clientRect,v=d.clientRect,P=l>o?1:-1,Q=this._getItemOffsetPx(h,v,P),ti=this._getSiblingOffsetPx(l,n,P),ii=n.slice();return J(n,l,o),n.forEach((D,si)=>{if(ii[si]===D)return;let Te=D.drag===t,ee=Te?Q:ti,ke=Te?t.getPlaceholderElement():D.drag.getRootElement();D.offset+=ee;let Oe=Math.round(D.offset*(1/D.drag.scale));a?(ke.style.transform=Y(`translate3d(${Oe}px, 0, 0)`,D.initialTransform),V(D.clientRect,0,ee)):(ke.style.transform=Y(`translate3d(0, ${Oe}px, 0)`,D.initialTransform),V(D.clientRect,ee,0))}),this._previousSwap.overlaps=Se(v,e,i),this._previousSwap.drag=d.drag,this._previousSwap.delta=a?s.x:s.y,{previousIndex:l,currentIndex:o}}enter(t,e,i,s){let n=s==null||s<0?this._getItemIndexFromPointerPosition(t,e,i):s,o=this._activeDraggables,a=o.indexOf(t),l=t.getPlaceholderElement(),d=o[n];if(d===t&&(d=o[n+1]),!d&&(n==null||n===-1||n<o.length-1)&&this._shouldEnterAsFirstChild(e,i)&&(d=o[0]),a>-1&&o.splice(a,1),d&&!this._dragDropRegistry.isDragging(d)){let h=d.getRootElement();h.parentElement.insertBefore(l,h),o.splice(n,0,t)}else this._element.appendChild(l),o.push(t);l.style.transform="",this._cacheItemPositions()}withItems(t){this._activeDraggables=t.slice(),this._cacheItemPositions()}withSortPredicate(t){this._sortPredicate=t}reset(){this._activeDraggables?.forEach(t=>{let e=t.getRootElement();if(e){let i=this._itemPositions.find(s=>s.drag===t)?.initialTransform;e.style.transform=i||""}}),this._itemPositions=[],this._activeDraggables=[],this._previousSwap.drag=null,this._previousSwap.delta=0,this._previousSwap.overlaps=!1}getActiveItemsSnapshot(){return this._activeDraggables}getItemIndex(t){return this._getVisualItemPositions().findIndex(e=>e.drag===t)}getItemAtIndex(t){return this._getVisualItemPositions()[t]?.drag||null}updateOnScroll(t,e){this._itemPositions.forEach(({clientRect:i})=>{V(i,t,e)}),this._itemPositions.forEach(({drag:i})=>{this._dragDropRegistry.isDragging(i)&&i._sortFromLastPointerPosition()})}withElementContainer(t){this._element=t}_cacheItemPositions(){let t=this.orientation==="horizontal";this._itemPositions=this._activeDraggables.map(e=>{let i=e.getVisibleElement();return{drag:e,offset:0,initialTransform:i.style.transform||"",clientRect:Re(i)}}).sort((e,i)=>t?e.clientRect.left-i.clientRect.left:e.clientRect.top-i.clientRect.top)}_getVisualItemPositions(){return this.orientation==="horizontal"&&this.direction==="rtl"?this._itemPositions.slice().reverse():this._itemPositions}_getItemOffsetPx(t,e,i){let s=this.orientation==="horizontal",n=s?e.left-t.left:e.top-t.top;return i===-1&&(n+=s?e.width-t.width:e.height-t.height),n}_getSiblingOffsetPx(t,e,i){let s=this.orientation==="horizontal",n=e[t].clientRect,o=e[t+i*-1],a=n[s?"width":"height"]*i;if(o){let l=s?"left":"top",d=s?"right":"bottom";i===-1?a-=o.clientRect[l]-n[d]:a+=n[l]-o.clientRect[d]}return a}_shouldEnterAsFirstChild(t,e){if(!this._activeDraggables.length)return!1;let i=this._itemPositions,s=this.orientation==="horizontal";if(i[0].drag!==this._activeDraggables[0]){let o=i[i.length-1].clientRect;return s?t>=o.right:e>=o.bottom}else{let o=i[0].clientRect;return s?t<=o.left:e<=o.top}}_getItemIndexFromPointerPosition(t,e,i,s){let n=this.orientation==="horizontal",o=this._itemPositions.findIndex(({drag:a,clientRect:l})=>{if(a===t)return!1;if(s){let d=n?s.x:s.y;if(a===this._previousSwap.drag&&this._previousSwap.overlaps&&d===this._previousSwap.delta)return!1}return n?e>=Math.floor(l.left)&&e<Math.floor(l.right):i>=Math.floor(l.top)&&i<Math.floor(l.bottom)});return o===-1||!this._sortPredicate(o,t)?-1:o}},xe=class{_document;_dragDropRegistry;_element;_sortPredicate;_rootNode;_activeItems;_previousSwap={drag:null,deltaX:0,deltaY:0,overlaps:!1};_relatedNodes=[];constructor(t,e){this._document=t,this._dragDropRegistry=e}start(t){let e=this._element.childNodes;this._relatedNodes=[];for(let i=0;i<e.length;i++){let s=e[i];this._relatedNodes.push([s,s.nextSibling])}this.withItems(t)}sort(t,e,i,s){let n=this._getItemIndexFromPointerPosition(t,e,i),o=this._previousSwap;if(n===-1||this._activeItems[n]===t)return null;let a=this._activeItems[n];if(o.drag===a&&o.overlaps&&o.deltaX===s.x&&o.deltaY===s.y)return null;let l=this.getItemIndex(t),d=t.getPlaceholderElement(),h=a.getRootElement();n>l?h.after(d):h.before(d),J(this._activeItems,l,n);let v=this._getRootNode().elementFromPoint(e,i);return o.deltaX=s.x,o.deltaY=s.y,o.drag=a,o.overlaps=h===v||h.contains(v),{previousIndex:l,currentIndex:n}}enter(t,e,i,s){let n=this._activeItems.indexOf(t);n>-1&&this._activeItems.splice(n,1);let o=s==null||s<0?this._getItemIndexFromPointerPosition(t,e,i):s;o===-1&&(o=this._getClosestItemIndexToPointer(t,e,i));let a=this._activeItems[o];a&&!this._dragDropRegistry.isDragging(a)?(this._activeItems.splice(o,0,t),a.getRootElement().before(t.getPlaceholderElement())):(this._activeItems.push(t),this._element.appendChild(t.getPlaceholderElement()))}withItems(t){this._activeItems=t.slice()}withSortPredicate(t){this._sortPredicate=t}reset(){let t=this._element,e=this._previousSwap;for(let i=this._relatedNodes.length-1;i>-1;i--){let[s,n]=this._relatedNodes[i];s.parentNode===t&&s.nextSibling!==n&&(n===null?t.appendChild(s):n.parentNode===t&&t.insertBefore(s,n))}this._relatedNodes=[],this._activeItems=[],e.drag=null,e.deltaX=e.deltaY=0,e.overlaps=!1}getActiveItemsSnapshot(){return this._activeItems}getItemIndex(t){return this._activeItems.indexOf(t)}getItemAtIndex(t){return this._activeItems[t]||null}updateOnScroll(){this._activeItems.forEach(t=>{this._dragDropRegistry.isDragging(t)&&t._sortFromLastPointerPosition()})}withElementContainer(t){t!==this._element&&(this._element=t,this._rootNode=void 0)}_getItemIndexFromPointerPosition(t,e,i){let s=this._getRootNode().elementFromPoint(Math.floor(e),Math.floor(i)),n=s?this._activeItems.findIndex(o=>{let a=o.getRootElement();return s===a||a.contains(s)}):-1;return n===-1||!this._sortPredicate(n,t)?-1:n}_getRootNode(){return this._rootNode||(this._rootNode=j(this._element)||this._document),this._rootNode}_getClosestItemIndexToPointer(t,e,i){if(this._activeItems.length===0)return-1;if(this._activeItems.length===1)return 0;let s=1/0,n=-1;for(let o=0;o<this._activeItems.length;o++){let a=this._activeItems[o];if(a!==t){let{x:l,y:d}=a.getRootElement().getBoundingClientRect(),h=Math.hypot(e-l,i-d);h<s&&(s=h,n=o)}}return n}},Bt=.05,$t=.05,w=(function(r){return r[r.NONE=0]="NONE",r[r.UP=1]="UP",r[r.DOWN=2]="DOWN",r})(w||{}),u=(function(r){return r[r.NONE=0]="NONE",r[r.LEFT=1]="LEFT",r[r.RIGHT=2]="RIGHT",r})(u||{}),Ee=class{_dragDropRegistry;_ngZone;_viewportRuler;element;disabled=!1;sortingDisabled=!1;lockAxis;autoScrollDisabled=!1;autoScrollStep=2;hasAnchor=!1;enterPredicate=()=>!0;sortPredicate=()=>!0;beforeStarted=new _;entered=new _;exited=new _;dropped=new _;sorted=new _;receivingStarted=new _;receivingStopped=new _;data;_container;_isDragging=!1;_parentPositions;_sortStrategy;_domRect;_draggables=[];_siblings=[];_activeSiblings=new Set;_viewportScrollSubscription=T.EMPTY;_verticalScrollDirection=w.NONE;_horizontalScrollDirection=u.NONE;_scrollNode;_stopScrollTimers=new _;_cachedShadowRoot=null;_document;_scrollableElements=[];_initialScrollSnap;_direction="ltr";constructor(t,e,i,s,n){this._dragDropRegistry=e,this._ngZone=s,this._viewportRuler=n;let o=this.element=x(t);this._document=i,this.withOrientation("vertical").withElementContainer(o),e.registerDropContainer(this),this._parentPositions=new K(i)}dispose(){this._stopScrolling(),this._stopScrollTimers.complete(),this._viewportScrollSubscription.unsubscribe(),this.beforeStarted.complete(),this.entered.complete(),this.exited.complete(),this.dropped.complete(),this.sorted.complete(),this.receivingStarted.complete(),this.receivingStopped.complete(),this._activeSiblings.clear(),this._scrollNode=null,this._parentPositions.clear(),this._dragDropRegistry.removeDropContainer(this)}isDragging(){return this._isDragging}start(){this._draggingStarted(),this._notifyReceivingSiblings()}enter(t,e,i,s){this._draggingStarted(),s==null&&this.sortingDisabled&&(s=this._draggables.indexOf(t)),this._sortStrategy.enter(t,e,i,s),this._cacheParentPositions(),this._notifyReceivingSiblings(),this.entered.next({item:t,container:this,currentIndex:this.getItemIndex(t)})}exit(t){this._reset(),this.exited.next({item:t,container:this})}drop(t,e,i,s,n,o,a,l={}){this._reset(),this.dropped.next({item:t,currentIndex:e,previousIndex:i,container:this,previousContainer:s,isPointerOverContainer:n,distance:o,dropPoint:a,event:l})}withItems(t){let e=this._draggables;return this._draggables=t,t.forEach(i=>i._withDropContainer(this)),this.isDragging()&&(e.filter(s=>s.isDragging()).every(s=>t.indexOf(s)===-1)?this._reset():this._sortStrategy.withItems(this._draggables)),this}withDirection(t){return this._direction=t,this._sortStrategy instanceof X&&(this._sortStrategy.direction=t),this}connectedTo(t){return this._siblings=t.slice(),this}withOrientation(t){if(t==="mixed")this._sortStrategy=new xe(this._document,this._dragDropRegistry);else{let e=new X(this._dragDropRegistry);e.direction=this._direction,e.orientation=t,this._sortStrategy=e}return this._sortStrategy.withElementContainer(this._container),this._sortStrategy.withSortPredicate((e,i)=>this.sortPredicate(e,i,this)),this}withScrollableParents(t){let e=this._container;return this._scrollableElements=t.indexOf(e)===-1?[e,...t]:t.slice(),this}withElementContainer(t){if(t===this._container)return this;let e=x(this.element),i=this._scrollableElements.indexOf(this._container),s=this._scrollableElements.indexOf(t);return i>-1&&this._scrollableElements.splice(i,1),s>-1&&this._scrollableElements.splice(s,1),this._sortStrategy&&this._sortStrategy.withElementContainer(t),this._cachedShadowRoot=null,this._scrollableElements.unshift(t),this._container=t,this}getScrollableParents(){return this._scrollableElements}getItemIndex(t){return this._isDragging?this._sortStrategy.getItemIndex(t):this._draggables.indexOf(t)}getItemAtIndex(t){return this._isDragging?this._sortStrategy.getItemAtIndex(t):this._draggables[t]||null}isReceiving(){return this._activeSiblings.size>0}_sortItem(t,e,i,s){if(this.sortingDisabled||!this._domRect||!It(this._domRect,Bt,e,i))return;let n=this._sortStrategy.sort(t,e,i,s);n&&this.sorted.next({previousIndex:n.previousIndex,currentIndex:n.currentIndex,container:this,item:t})}_startScrollingIfNecessary(t,e){if(this.autoScrollDisabled)return;let i,s=w.NONE,n=u.NONE;if(this._parentPositions.positions.forEach((o,a)=>{a===this._document||!o.clientRect||i||It(o.clientRect,Bt,t,e)&&([s,n]=pi(a,o.clientRect,this._direction,t,e),(s||n)&&(i=a))}),!s&&!n){let{width:o,height:a}=this._viewportRuler.getViewportSize(),l={width:o,height:a,top:0,right:o,bottom:a,left:0};s=Ut(l,e),n=Wt(l,t),i=window}i&&(s!==this._verticalScrollDirection||n!==this._horizontalScrollDirection||i!==this._scrollNode)&&(this._verticalScrollDirection=s,this._horizontalScrollDirection=n,this._scrollNode=i,(s||n)&&i?this._ngZone.runOutsideAngular(this._startScrollInterval):this._stopScrolling())}_stopScrolling(){this._stopScrollTimers.next()}_draggingStarted(){let t=this._container.style;this.beforeStarted.next(),this._isDragging=!0,this._initialScrollSnap=t.msScrollSnapType||t.scrollSnapType||"",t.scrollSnapType=t.msScrollSnapType="none",this._sortStrategy.start(this._draggables),this._cacheParentPositions(),this._viewportScrollSubscription.unsubscribe(),this._listenToScrollEvents()}_cacheParentPositions(){this._parentPositions.cache(this._scrollableElements),this._domRect=this._parentPositions.positions.get(this._container).clientRect}_reset(){this._isDragging=!1;let t=this._container.style;t.scrollSnapType=t.msScrollSnapType=this._initialScrollSnap,this._siblings.forEach(e=>e._stopReceiving(this)),this._sortStrategy.reset(),this._stopScrolling(),this._viewportScrollSubscription.unsubscribe(),this._parentPositions.clear()}_startScrollInterval=()=>{this._stopScrolling(),Ae(0,Le).pipe(A(this._stopScrollTimers)).subscribe(()=>{let t=this._scrollNode,e=this.autoScrollStep;this._verticalScrollDirection===w.UP?t.scrollBy(0,-e):this._verticalScrollDirection===w.DOWN&&t.scrollBy(0,e),this._horizontalScrollDirection===u.LEFT?t.scrollBy(-e,0):this._horizontalScrollDirection===u.RIGHT&&t.scrollBy(e,0)})};_isOverContainer(t,e){return this._domRect!=null&&Se(this._domRect,t,e)}_getSiblingContainerFromPosition(t,e,i){return this._siblings.find(s=>s._canReceive(t,e,i))}_canReceive(t,e,i){if(!this._domRect||!Se(this._domRect,e,i)||!this.enterPredicate(t,this))return!1;let s=this._getShadowRoot().elementFromPoint(e,i);return s?s===this._container||this._container.contains(s):!1}_startReceiving(t,e){let i=this._activeSiblings;!i.has(t)&&e.every(s=>this.enterPredicate(s,this)||this._draggables.indexOf(s)>-1)&&(i.add(t),this._cacheParentPositions(),this._listenToScrollEvents(),this.receivingStarted.next({initiator:t,receiver:this,items:e}))}_stopReceiving(t){this._activeSiblings.delete(t),this._viewportScrollSubscription.unsubscribe(),this.receivingStopped.next({initiator:t,receiver:this})}_listenToScrollEvents(){this._viewportScrollSubscription=this._dragDropRegistry.scrolled(this._getShadowRoot()).subscribe(t=>{if(this.isDragging()){let e=this._parentPositions.handleScroll(t);e&&this._sortStrategy.updateOnScroll(e.top,e.left)}else this.isReceiving()&&this._cacheParentPositions()})}_getShadowRoot(){if(!this._cachedShadowRoot){let t=j(this._container);this._cachedShadowRoot=t||this._document}return this._cachedShadowRoot}_notifyReceivingSiblings(){let t=this._sortStrategy.getActiveItemsSnapshot().filter(e=>e.isDragging());this._siblings.forEach(e=>e._startReceiving(this,t))}};function Ut(r,t){let{top:e,bottom:i,height:s}=r,n=s*$t;return t>=e-n&&t<=e+n?w.UP:t>=i-n&&t<=i+n?w.DOWN:w.NONE}function Wt(r,t){let{left:e,right:i,width:s}=r,n=s*$t;return t>=e-n&&t<=e+n?u.LEFT:t>=i-n&&t<=i+n?u.RIGHT:u.NONE}function pi(r,t,e,i,s){let n=Ut(t,s),o=Wt(t,i),a=w.NONE,l=u.NONE;if(n){let d=r.scrollTop;n===w.UP?d>0&&(a=w.UP):r.scrollHeight-d>r.clientHeight&&(a=w.DOWN)}if(o){let d=r.scrollLeft;e==="rtl"?o===u.RIGHT?d<0&&(l=u.RIGHT):r.scrollWidth+d>r.clientWidth&&(l=u.LEFT):o===u.LEFT?d>0&&(l=u.LEFT):r.scrollWidth-d>r.clientWidth&&(l=u.RIGHT)}return[a,l]}var z={capture:!0},be={passive:!1,capture:!0},_i=(()=>{class r{static \u0275fac=function(i){return new(i||r)};static \u0275cmp=R({type:r,selectors:[["ng-component"]],hostAttrs:["cdk-drag-resets-container",""],decls:0,vars:0,template:function(i,s){},styles:[`@layer cdk-resets{.cdk-drag-preview{background:none;border:none;padding:0;color:inherit;inset:auto}}.cdk-drag-placeholder *,.cdk-drag-preview *{pointer-events:none !important}
|
|
2
|
-
`],encapsulation:2,changeDetection:0})}return r})(),Zt=(()=>{class r{_ngZone=c(U);_document=c(ne);_styleLoader=c(st);_renderer=c(le).createRenderer(null,null);_cleanupDocumentTouchmove;_scroll=new _;_dropInstances=new Set;_dragInstances=new Set;_activeDragInstances=re([]);_globalListeners;_draggingPredicate=e=>e.isDragging();_domNodesToDirectives=null;pointerMove=new _;pointerUp=new _;constructor(){}registerDropContainer(e){this._dropInstances.has(e)||this._dropInstances.add(e)}registerDragItem(e){this._dragInstances.add(e),this._dragInstances.size===1&&this._ngZone.runOutsideAngular(()=>{this._cleanupDocumentTouchmove?.(),this._cleanupDocumentTouchmove=this._renderer.listen(this._document,"touchmove",this._persistentTouchmoveListener,be)})}removeDropContainer(e){this._dropInstances.delete(e)}removeDragItem(e){this._dragInstances.delete(e),this.stopDragging(e),this._dragInstances.size===0&&this._cleanupDocumentTouchmove?.()}startDragging(e,i){if(!(this._activeDragInstances().indexOf(e)>-1)&&(this._styleLoader.load(_i),this._activeDragInstances.update(s=>[...s,e]),this._activeDragInstances().length===1)){let s=i.type.startsWith("touch"),n=a=>this.pointerUp.next(a),o=[["scroll",a=>this._scroll.next(a),z],["selectstart",this._preventDefaultWhileDragging,be]];s?o.push(["touchend",n,z],["touchcancel",n,z]):o.push(["mouseup",n,z]),s||o.push(["mousemove",a=>this.pointerMove.next(a),be]),this._ngZone.runOutsideAngular(()=>{this._globalListeners=o.map(([a,l,d])=>this._renderer.listen(this._document,a,l,d))})}}stopDragging(e){this._activeDragInstances.update(i=>{let s=i.indexOf(e);return s>-1?(i.splice(s,1),[...i]):i}),this._activeDragInstances().length===0&&this._clearGlobalListeners()}isDragging(e){return this._activeDragInstances().indexOf(e)>-1}scrolled(e){let i=[this._scroll];return e&&e!==this._document&&i.push(new te(s=>this._ngZone.runOutsideAngular(()=>{let n=this._renderer.listen(e,"scroll",o=>{this._activeDragInstances().length&&s.next(o)},z);return()=>{n()}}))),$(...i)}registerDirectiveNode(e,i){this._domNodesToDirectives??=new WeakMap,this._domNodesToDirectives.set(e,i)}removeDirectiveNode(e){this._domNodesToDirectives?.delete(e)}getDragDirectiveForNode(e){return this._domNodesToDirectives?.get(e)||null}ngOnDestroy(){this._dragInstances.forEach(e=>this.removeDragItem(e)),this._dropInstances.forEach(e=>this.removeDropContainer(e)),this._domNodesToDirectives=null,this._clearGlobalListeners(),this.pointerMove.complete(),this.pointerUp.complete()}_preventDefaultWhileDragging=e=>{this._activeDragInstances().length>0&&e.preventDefault()};_persistentTouchmoveListener=e=>{this._activeDragInstances().length>0&&(this._activeDragInstances().some(this._draggingPredicate)&&e.preventDefault(),this.pointerMove.next(e))};_clearGlobalListeners(){this._globalListeners?.forEach(e=>e()),this._globalListeners=void 0}static \u0275fac=function(i){return new(i||r)};static \u0275prov=se({token:r,factory:r.\u0275fac,providedIn:"root"})}return r})(),gi={dragStartThreshold:5,pointerDirectionChangeThreshold:5},jt=(()=>{class r{_document=c(ne);_ngZone=c(U);_viewportRuler=c(_t);_dragDropRegistry=c(Zt);_renderer=c(le).createRenderer(null,null);constructor(){}createDrag(e,i=gi){return new ye(e,i,this._document,this._ngZone,this._viewportRuler,this._dragDropRegistry,this._renderer)}createDropList(e){return new Ee(e,this._dragDropRegistry,this._document,this._ngZone,this._viewportRuler)}static \u0275fac=function(i){return new(i||r)};static \u0275prov=se({token:r,factory:r.\u0275fac,providedIn:"root"})}return r})(),zt=new k("CDK_DRAG_PARENT");var mi=new k("CdkDragHandle");var qt=new k("CDK_DRAG_CONFIG"),Kt=new k("CdkDropList"),Yt=(()=>{class r{element=c(oe);dropContainer=c(Kt,{optional:!0,skipSelf:!0});_ngZone=c(U);_viewContainerRef=c(Ge);_dir=c(fe,{optional:!0});_changeDetectorRef=c(ge);_selfHandle=c(mi,{optional:!0,self:!0});_parentDrag=c(zt,{optional:!0,skipSelf:!0});_dragDropRegistry=c(Zt);_destroyed=new _;_handles=new Me([]);_previewTemplate;_placeholderTemplate;_dragRef;data;lockAxis;rootElementSelector;boundaryElement;dragStartDelay;freeDragPosition;get disabled(){return this._disabled||!!(this.dropContainer&&this.dropContainer.disabled)}set disabled(e){this._disabled=e,this._dragRef.disabled=this._disabled}_disabled;constrainPosition;previewClass;previewContainer;scale=1;started=new S;released=new S;ended=new S;entered=new S;exited=new S;dropped=new S;moved=new te(e=>{let i=this._dragRef.moved.pipe(Ne(s=>({source:this,pointerPosition:s.pointerPosition,event:s.event,delta:s.delta,distance:s.distance}))).subscribe(e);return()=>{i.unsubscribe()}});_injector=c(ze);constructor(){let e=this.dropContainer,i=c(qt,{optional:!0}),s=c(jt);this._dragRef=s.createDrag(this.element,{dragStartThreshold:i&&i.dragStartThreshold!=null?i.dragStartThreshold:5,pointerDirectionChangeThreshold:i&&i.pointerDirectionChangeThreshold!=null?i.pointerDirectionChangeThreshold:5,zIndex:i?.zIndex}),this._dragRef.data=this,this._dragDropRegistry.registerDirectiveNode(this.element.nativeElement,this),i&&this._assignDefaults(i),e&&(e.addItem(this),e._dropListRef.beforeStarted.pipe(A(this._destroyed)).subscribe(()=>{this._dragRef.scale=this.scale})),this._syncInputs(this._dragRef),this._handleEvents(this._dragRef)}getPlaceholderElement(){return this._dragRef.getPlaceholderElement()}getRootElement(){return this._dragRef.getRootElement()}reset(){this._dragRef.reset()}resetToBoundary(){this._dragRef.resetToBoundary()}getFreeDragPosition(){return this._dragRef.getFreeDragPosition()}setFreeDragPosition(e){this._dragRef.setFreeDragPosition(e)}ngAfterViewInit(){$e(()=>{this._updateRootElement(),this._setupHandlesListener(),this._dragRef.scale=this.scale,this.freeDragPosition&&this._dragRef.setFreeDragPosition(this.freeDragPosition)},{injector:this._injector})}ngOnChanges(e){let i=e.rootElementSelector,s=e.freeDragPosition;i&&!i.firstChange&&this._updateRootElement(),this._dragRef.scale=this.scale,s&&!s.firstChange&&this.freeDragPosition&&this._dragRef.setFreeDragPosition(this.freeDragPosition)}ngOnDestroy(){this.dropContainer&&this.dropContainer.removeItem(this),this._dragDropRegistry.removeDirectiveNode(this.element.nativeElement),this._ngZone.runOutsideAngular(()=>{this._handles.complete(),this._destroyed.next(),this._destroyed.complete(),this._dragRef.dispose()})}_addHandle(e){let i=this._handles.getValue();i.push(e),this._handles.next(i)}_removeHandle(e){let i=this._handles.getValue(),s=i.indexOf(e);s>-1&&(i.splice(s,1),this._handles.next(i))}_setPreviewTemplate(e){this._previewTemplate=e}_resetPreviewTemplate(e){e===this._previewTemplate&&(this._previewTemplate=null)}_setPlaceholderTemplate(e){this._placeholderTemplate=e}_resetPlaceholderTemplate(e){e===this._placeholderTemplate&&(this._placeholderTemplate=null)}_updateRootElement(){let e=this.element.nativeElement,i=e;this.rootElementSelector&&(i=e.closest!==void 0?e.closest(this.rootElementSelector):e.parentElement?.closest(this.rootElementSelector)),this._dragRef.withRootElement(i||e)}_getBoundaryElement(){let e=this.boundaryElement;return e?typeof e=="string"?this.element.nativeElement.closest(e):x(e):null}_syncInputs(e){e.beforeStarted.subscribe(()=>{if(!e.isDragging()){let i=this._dir,s=this.dragStartDelay,n=this._placeholderTemplate?{template:this._placeholderTemplate.templateRef,context:this._placeholderTemplate.data,viewContainer:this._viewContainerRef}:null,o=this._previewTemplate?{template:this._previewTemplate.templateRef,context:this._previewTemplate.data,matchSize:this._previewTemplate.matchSize,viewContainer:this._viewContainerRef}:null;e.disabled=this.disabled,e.lockAxis=this.lockAxis,e.scale=this.scale,e.dragStartDelay=typeof s=="object"&&s?s:ue(s),e.constrainPosition=this.constrainPosition,e.previewClass=this.previewClass,e.withBoundaryElement(this._getBoundaryElement()).withPlaceholderTemplate(n).withPreviewTemplate(o).withPreviewContainer(this.previewContainer||"global"),i&&e.withDirection(i.value)}}),e.beforeStarted.pipe(Fe(1)).subscribe(()=>{if(this._parentDrag){e.withParent(this._parentDrag._dragRef);return}let i=this.element.nativeElement.parentElement;for(;i;){let s=this._dragDropRegistry.getDragDirectiveForNode(i);if(s){e.withParent(s._dragRef);break}i=i.parentElement}})}_handleEvents(e){e.started.subscribe(i=>{this.started.emit({source:this,event:i.event}),this._changeDetectorRef.markForCheck()}),e.released.subscribe(i=>{this.released.emit({source:this,event:i.event})}),e.ended.subscribe(i=>{this.ended.emit({source:this,distance:i.distance,dropPoint:i.dropPoint,event:i.event}),this._changeDetectorRef.markForCheck()}),e.entered.subscribe(i=>{this.entered.emit({container:i.container.data,item:this,currentIndex:i.currentIndex})}),e.exited.subscribe(i=>{this.exited.emit({container:i.container.data,item:this})}),e.dropped.subscribe(i=>{this.dropped.emit({previousIndex:i.previousIndex,currentIndex:i.currentIndex,previousContainer:i.previousContainer.data,container:i.container.data,isPointerOverContainer:i.isPointerOverContainer,item:this,distance:i.distance,dropPoint:i.dropPoint,event:i.event})})}_assignDefaults(e){let{lockAxis:i,dragStartDelay:s,constrainPosition:n,previewClass:o,boundaryElement:a,draggingDisabled:l,rootElementSelector:d,previewContainer:h}=e;this.disabled=l??!1,this.dragStartDelay=s||0,i&&(this.lockAxis=i),n&&(this.constrainPosition=n),o&&(this.previewClass=o),a&&(this.boundaryElement=a),d&&(this.rootElementSelector=d),h&&(this.previewContainer=h)}_setupHandlesListener(){this._handles.pipe(Be(e=>{let i=e.map(s=>s.element);this._selfHandle&&this.rootElementSelector&&i.push(this.element),this._dragRef.withHandles(i)}),He(e=>$(...e.map(i=>i._stateChanges.pipe(ie(i))))),A(this._destroyed)).subscribe(e=>{let i=this._dragRef,s=e.element.nativeElement;e.disabled?i.disableHandle(s):i.enableHandle(s)})}static \u0275fac=function(i){return new(i||r)};static \u0275dir=de({type:r,selectors:[["","cdkDrag",""]],hostAttrs:[1,"cdk-drag"],hostVars:4,hostBindings:function(i,s){i&2&&ce("cdk-drag-disabled",s.disabled)("cdk-drag-dragging",s._dragRef.isDragging())},inputs:{data:[0,"cdkDragData","data"],lockAxis:[0,"cdkDragLockAxis","lockAxis"],rootElementSelector:[0,"cdkDragRootElement","rootElementSelector"],boundaryElement:[0,"cdkDragBoundary","boundaryElement"],dragStartDelay:[0,"cdkDragStartDelay","dragStartDelay"],freeDragPosition:[0,"cdkDragFreeDragPosition","freeDragPosition"],disabled:[2,"cdkDragDisabled","disabled",O],constrainPosition:[0,"cdkDragConstrainPosition","constrainPosition"],previewClass:[0,"cdkDragPreviewClass","previewClass"],previewContainer:[0,"cdkDragPreviewContainer","previewContainer"],scale:[2,"cdkDragScale","scale",Ye]},outputs:{started:"cdkDragStarted",released:"cdkDragReleased",ended:"cdkDragEnded",entered:"cdkDragEntered",exited:"cdkDragExited",dropped:"cdkDragDropped",moved:"cdkDragMoved"},exportAs:["cdkDrag"],features:[pe([{provide:zt,useExisting:r}]),Ve]})}return r})(),Vt=new k("CdkDropListGroup");var Xt=(()=>{class r{element=c(oe);_changeDetectorRef=c(ge);_scrollDispatcher=c(pt);_dir=c(fe,{optional:!0});_group=c(Vt,{optional:!0,skipSelf:!0});_latestSortedRefs;_destroyed=new _;_scrollableParentsResolved;static _dropLists=[];_dropListRef;connectedTo=[];data;orientation;id=c(ot).getId("cdk-drop-list-");lockAxis;get disabled(){return this._disabled||!!this._group&&this._group.disabled}set disabled(e){this._dropListRef.disabled=this._disabled=e}_disabled;sortingDisabled;enterPredicate=()=>!0;sortPredicate=()=>!0;autoScrollDisabled;autoScrollStep;elementContainerSelector;hasAnchor;dropped=new S;entered=new S;exited=new S;sorted=new S;_unsortedItems=new Set;constructor(){let e=c(jt),i=c(qt,{optional:!0});this._dropListRef=e.createDropList(this.element),this._dropListRef.data=this,i&&this._assignDefaults(i),this._dropListRef.enterPredicate=(s,n)=>this.enterPredicate(s.data,n.data),this._dropListRef.sortPredicate=(s,n,o)=>this.sortPredicate(s,n.data,o.data),this._setupInputSyncSubscription(this._dropListRef),this._handleEvents(this._dropListRef),r._dropLists.push(this),this._group&&this._group._items.add(this)}addItem(e){this._unsortedItems.add(e),e._dragRef._withDropContainer(this._dropListRef),this._dropListRef.isDragging()&&this._syncItemsWithRef(this.getSortedItems().map(i=>i._dragRef))}removeItem(e){if(this._unsortedItems.delete(e),this._latestSortedRefs){let i=this._latestSortedRefs.indexOf(e._dragRef);i>-1&&(this._latestSortedRefs.splice(i,1),this._syncItemsWithRef(this._latestSortedRefs))}}getSortedItems(){return Array.from(this._unsortedItems).sort((e,i)=>e._dragRef.getVisibleElement().compareDocumentPosition(i._dragRef.getVisibleElement())&Node.DOCUMENT_POSITION_FOLLOWING?-1:1)}ngOnDestroy(){let e=r._dropLists.indexOf(this);e>-1&&r._dropLists.splice(e,1),this._group&&this._group._items.delete(this),this._latestSortedRefs=void 0,this._unsortedItems.clear(),this._dropListRef.dispose(),this._destroyed.next(),this._destroyed.complete()}_setupInputSyncSubscription(e){this._dir&&this._dir.change.pipe(ie(this._dir.value),A(this._destroyed)).subscribe(i=>e.withDirection(i)),e.beforeStarted.subscribe(()=>{let i=nt(this.connectedTo).map(s=>{if(typeof s=="string"){let n=r._dropLists.find(o=>o.id===s);return n}return s});if(this._group&&this._group._items.forEach(s=>{i.indexOf(s)===-1&&i.push(s)}),!this._scrollableParentsResolved){let s=this._scrollDispatcher.getAncestorScrollContainers(this.element).map(n=>n.getElementRef().nativeElement);this._dropListRef.withScrollableParents(s),this._scrollableParentsResolved=!0}if(this.elementContainerSelector){let s=this.element.nativeElement.querySelector(this.elementContainerSelector);e.withElementContainer(s)}e.disabled=this.disabled,e.lockAxis=this.lockAxis,e.sortingDisabled=this.sortingDisabled,e.autoScrollDisabled=this.autoScrollDisabled,e.autoScrollStep=ue(this.autoScrollStep,2),e.hasAnchor=this.hasAnchor,e.connectedTo(i.filter(s=>s&&s!==this).map(s=>s._dropListRef)).withOrientation(this.orientation)})}_handleEvents(e){e.beforeStarted.subscribe(()=>{this._syncItemsWithRef(this.getSortedItems().map(i=>i._dragRef)),this._changeDetectorRef.markForCheck()}),e.entered.subscribe(i=>{this.entered.emit({container:this,item:i.item.data,currentIndex:i.currentIndex})}),e.exited.subscribe(i=>{this.exited.emit({container:this,item:i.item.data}),this._changeDetectorRef.markForCheck()}),e.sorted.subscribe(i=>{this.sorted.emit({previousIndex:i.previousIndex,currentIndex:i.currentIndex,container:this,item:i.item.data})}),e.dropped.subscribe(i=>{this.dropped.emit({previousIndex:i.previousIndex,currentIndex:i.currentIndex,previousContainer:i.previousContainer.data,container:i.container.data,item:i.item.data,isPointerOverContainer:i.isPointerOverContainer,distance:i.distance,dropPoint:i.dropPoint,event:i.event}),this._changeDetectorRef.markForCheck()}),$(e.receivingStarted,e.receivingStopped).subscribe(()=>this._changeDetectorRef.markForCheck())}_assignDefaults(e){let{lockAxis:i,draggingDisabled:s,sortingDisabled:n,listAutoScrollDisabled:o,listOrientation:a}=e;this.disabled=s??!1,this.sortingDisabled=n??!1,this.autoScrollDisabled=o??!1,this.orientation=a||"vertical",i&&(this.lockAxis=i)}_syncItemsWithRef(e){this._latestSortedRefs=e,this._dropListRef.withItems(e)}static \u0275fac=function(i){return new(i||r)};static \u0275dir=de({type:r,selectors:[["","cdkDropList",""],["cdk-drop-list"]],hostAttrs:[1,"cdk-drop-list"],hostVars:7,hostBindings:function(i,s){i&2&&(Ue("id",s.id),ce("cdk-drop-list-disabled",s.disabled)("cdk-drop-list-dragging",s._dropListRef.isDragging())("cdk-drop-list-receiving",s._dropListRef.isReceiving()))},inputs:{connectedTo:[0,"cdkDropListConnectedTo","connectedTo"],data:[0,"cdkDropListData","data"],orientation:[0,"cdkDropListOrientation","orientation"],id:"id",lockAxis:[0,"cdkDropListLockAxis","lockAxis"],disabled:[2,"cdkDropListDisabled","disabled",O],sortingDisabled:[2,"cdkDropListSortingDisabled","sortingDisabled",O],enterPredicate:[0,"cdkDropListEnterPredicate","enterPredicate"],sortPredicate:[0,"cdkDropListSortPredicate","sortPredicate"],autoScrollDisabled:[2,"cdkDropListAutoScrollDisabled","autoScrollDisabled",O],autoScrollStep:[0,"cdkDropListAutoScrollStep","autoScrollStep"],elementContainerSelector:[0,"cdkDropListElementContainer","elementContainerSelector"],hasAnchor:[2,"cdkDropListHasAnchor","hasAnchor",O]},outputs:{dropped:"cdkDropListDropped",entered:"cdkDropListEntered",exited:"cdkDropListExited",sorted:"cdkDropListSorted"},exportAs:["cdkDropList"],features:[pe([{provide:Vt,useValue:void 0},{provide:Kt,useExisting:r}])]})}return r})();function ui(r,t){if(r&1){let e=Z();p(0,"button",0),m("click",function(){E(e);let s=y();return C(s.clickAction("cancel"))}),p(1,"mat-icon",1),f(2,"close"),g(),p(3,"span"),f(4,"Close"),g()()}}var Qt=(()=>{class r{_bottomSheetRef=c(vt);data=c(ft);showCancel=!!(this.data&&this.data.showCancel);clickAction(e){this._bottomSheetRef.dismiss(e)}static \u0275fac=function(i){return new(i||r)};static \u0275cmp=R({type:r,selectors:[["dashboards-bottom-sheet"]],decls:12,vars:1,consts:[["mat-list-item","",3,"click"],["matListItemIcon",""],["mat-list-item",""]],template:function(i,s){i&1&&(p(0,"mat-action-list")(1,"button",0),m("click",function(){return s.clickAction("duplicate")}),p(2,"mat-icon",1),f(3,"content_copy"),g(),p(4,"span"),f(5,"Duplicate"),g()(),p(6,"button",0),m("click",function(){return s.clickAction("delete")}),p(7,"mat-icon",1),f(8,"delete_forever"),g(),p(9,"span"),f(10,"Delete"),g()(),We(11,ui,5,0,"button",2),g()),i&2&&(b(11),Ze(s.showCancel?11:-1))},dependencies:[yt,St,Pt,wt,L,M],encapsulation:2})}return r})();var vi=(r,t)=>t.id;function Di(r,t){if(r&1){let e=Z();p(0,"div",5),m("cdkDragStarted",function(){E(e);let s=y();return C(s.dragStart())})("cdkDragMoved",function(s){E(e);let n=y();return C(n.onDragMoved(s))})("cdkDragEnded",function(){E(e);let s=y();return C(s.dragEnd())})("press",function(){let s=E(e).$index,n=y();return C(n.onPress(s))})("doubletap",function(){let s=E(e).$index,n=y();return C(n.editDashboard(s))}),p(1,"div",6),f(2),g(),p(3,"div"),W(4,"mat-icon",7),g(),p(5,"p",8),f(6),g()()}if(r&2){let e=t.$implicit,i=t.$index,s=y();I("mode","editor")("disableGestures",s._sheetOpen||s.suppressDrag)("cdkDragDisabled",s._sheetOpen||s.suppressDrag),b(2),he(i+1),b(2),Ke("width",72,"px")("height",72,"px"),I("svgIcon",e.icon||"dashboard"),b(2),he(e.name)}}var ei=(()=>{class r{pageTitle="Dashboards";_bottomSheet=c(Dt);_dashboard=c(et);_uiEvent=c(ut);_dialog=c(mt);_sanitizer=c(Je);_sheetOpen=!1;suppressDrag=!1;_dragActive=!1;_dragMoved=!1;_dragSuppressThresholdPx=4;addDashboard(){this._dialog.openDashboardPageEditorDialog({title:"New Dashboard",name:`Dashboard ${this._dashboard.dashboards().length+1}`,icon:"dashboard-dashboard",confirmBtnText:"Create",cancelBtnText:"Cancel"}).afterClosed().subscribe(e=>{e&&this._dashboard.add(e.name,[],e.icon,e.collapseSplitShell)})}openBottomSheet(e){if(this._sheetOpen)return;this._sheetOpen=!0;let i=typeof navigator<"u"&&/Linux/.test(navigator.platform)&&/Firefox/.test(navigator.userAgent);this._bottomSheet.open(Qt,i?{disableClose:!0,data:{showCancel:!0}}:{}).afterDismissed().subscribe(n=>{switch(this._sheetOpen=!1,n){case"delete":this.deleteDashboard(e);break;case"duplicate":this.duplicateDashboard(e,`${this._dashboard.dashboards()[e].name}`);break;default:break}})}editDashboard(e){let i=this._dashboard.dashboards()[e];this._dialog.openDashboardPageEditorDialog({title:"Dashboard Options",name:i.name,icon:i.icon||"dashboard-dashboard",confirmBtnText:"Save",cancelBtnText:"Cancel",collapseSplitShell:i.collapseSplitShell??!1}).afterClosed().subscribe(s=>{s&&this._dashboard.update(e,s.name,s.icon,s.collapseSplitShell)})}deleteDashboard(e){this._dashboard.delete(e)}duplicateDashboard(e,i){let s=this._dashboard.dashboards()[e];this._dialog.openDashboardPageEditorDialog({title:"Duplicate Dashboard",name:`${i} copy`,icon:s.icon||"dashboard-dashboard",confirmBtnText:"Save",cancelBtnText:"Cancel",collapseSplitShell:s.collapseSplitShell??!1}).afterClosed().subscribe(n=>{n&&this._dashboard.duplicate(e,n.name,n.icon,n.collapseSplitShell)})}drop(e){this._dashboard.dashboards.update(i=>{let s=[...i];J(s,e.previousIndex,e.currentIndex);let n=this._dashboard.activeDashboard();return n===e.previousIndex?this._dashboard.activeDashboard.set(e.currentIndex):n>e.previousIndex&&n<=e.currentIndex?this._dashboard.activeDashboard.set(n-1):n<e.previousIndex&&n>=e.currentIndex&&this._dashboard.activeDashboard.set(n+1),s})}dragStart(){this._sheetOpen||this.suppressDrag||(this._uiEvent.isDragging.set(!0),this._dragActive=!0,this._dragMoved=!1)}dragEnd(){this._uiEvent.isDragging.set(!1),this._dragActive=!1,setTimeout(()=>{this._dragMoved=!1},60)}onDragMoved(e){if(!this._dragActive||this._dragMoved)return;Math.hypot(e.distance.x,e.distance.y)>this._dragSuppressThresholdPx&&(this._dragMoved=!0)}onPress(e){this._sheetOpen||this._dragMoved||(this.cancelPointerSequence(),this.openBottomSheet(e))}cancelPointerSequence(){this.suppressDrag=!0,this._dragActive=!1,this._dragMoved=!1,["pointerup","mouseup","touchend"].forEach(e=>{document.dispatchEvent(new Event(e,{bubbles:!0}))})}onPointerRelease(){this._sheetOpen||(this.suppressDrag=!1)}static \u0275fac=function(i){return new(i||r)};static \u0275cmp=R({type:r,selectors:[["dashboards-editor"]],hostBindings:function(i,s){i&1&&m("mouseup",function(){return s.onPointerRelease()},ae)("touchend",function(){return s.onPointerRelease()},ae)},decls:10,vars:0,consts:[["cdkDropList","","cdkDropListOrientation","mixed",1,"dashboard-manage",3,"cdkDropListDropped"],["kipGestures","","matRipple","","cdkDrag","","cdkDragBoundary",".dashboard-manage","tabindex","0",1,"dashboard-card","dashboard-item",3,"mode","disableGestures","cdkDragDisabled"],["tabindex","0",1,"dashboard-card","dashboard-item-add","dashboard-add-btn",3,"click","keydown"],["mat-fab",""],[2,"margin-top","10px"],["kipGestures","","matRipple","","cdkDrag","","cdkDragBoundary",".dashboard-manage","tabindex","0",1,"dashboard-card","dashboard-item",3,"cdkDragStarted","cdkDragMoved","cdkDragEnded","press","doubletap","mode","disableGestures","cdkDragDisabled"],[1,"item-index"],["aria-hidden","false",1,"dashboard-icon",3,"svgIcon"],[1,"dashboard-name"]],template:function(i,s){i&1&&(p(0,"div",0),m("cdkDropListDropped",function(o){return s.drop(o)}),je(1,Di,7,10,"div",1,vi),p(3,"div",2),m("click",function(){return s.addDashboard()})("keydown",function(){return s.addDashboard()}),p(4,"button",3)(5,"mat-icon"),f(6,"add_box"),g()(),p(7,"p",4)(8,"i"),f(9,"Add Dashboard"),g()()()()),i&2&&(b(),qe(s._dashboard.dashboards()))},dependencies:[bt,q,ht,L,M,Xt,Yt,ct,lt,Xe],styles:["[_nghost-%COMP%]{display:block;width:100%;height:100%;overflow-y:auto;scroll-behavior:smooth}.dashboard-manage[_ngcontent-%COMP%]{box-sizing:border-box;padding:0 60px;width:100%;height:100%;display:flex;flex-wrap:wrap;align-items:flex-start;justify-content:space-around;overflow-y:auto;scroll-behavior:smooth}.dashboard-card[_ngcontent-%COMP%]{position:relative;height:200px;width:300px;margin:10px;border-radius:15px;padding:10px;align-content:center;text-align:center;border:2px solid transparent}@media (max-width: 600px) and (orientation: portrait){.dashboard-manage[_ngcontent-%COMP%]{padding:0 70px}.dashboard-card[_ngcontent-%COMP%]{height:175px}}.dashboard-item[_ngcontent-%COMP%]{background-color:var(--mat-sys-surface-container-highest);cursor:pointer}.dashboard-item[_ngcontent-%COMP%]:hover{border:2px solid var(--mat-sys-outline)}.dashboard-item-add[_ngcontent-%COMP%]{background-color:var(--mat-sys-surface-container);cursor:pointer}.dashboard-item-add[_ngcontent-%COMP%]:hover{border:2px solid var(--mat-sys-outline)}.dashboard-add-btn[_ngcontent-%COMP%]{align-content:center;text-align:center;border:dashed 1px var(--mat-sys-outline)}.item-index[_ngcontent-%COMP%]{position:absolute;top:20px;left:20px;display:inline-flex;flex-wrap:wrap;height:42px;width:42px;background-color:var(--kip-contrast-dim-color);color:var(--mat-sys-surface-bright);border-radius:25%;align-content:center;align-items:center;justify-content:center;font-weight:700;font-size:1.25em;z-index:1}.dashboard-icon[_ngcontent-%COMP%]{opacity:.5}.dashboard-name[_ngcontent-%COMP%]{margin-top:10px;margin-bottom:0;font-size:1.1em}.cdk-drag-preview[_ngcontent-%COMP%]{box-sizing:border-box;border-radius:4px;box-shadow:0 5px 5px -3px var(--mat-sys-on-primary-container),0 8px 10px 1px var(--mat-sys-on-primary-container),0 3px 14px 2px var(--mat-sys-on-primary-container)}.cdk-drag-placeholder[_ngcontent-%COMP%]{opacity:0}.cdk-drag-animating[_ngcontent-%COMP%]{transition:transform .25s cubic-bezier(0,0,.2,1)}"]})}return r})();var Ps=(()=>{class r{_router=c(Qe);app=c(at);_responsive=c(rt);_isPhonePortrait=me(this._responsive.observe(ve.HandsetPortrait));_isPhoneLandscape=me(this._responsive.observe(ve.HandsetLandscape));isPhonePortrait=_e(()=>this._isPhonePortrait().matches);isPhoneLandscape=_e(()=>this._isPhoneLandscape().matches);closePage(){this._router.navigate(["/dashboard"])}onActionItem(e){switch(e){case"help":this._router.navigate(["/help"]);break;case"datainspector":this._router.navigate(["/data"]);break;case"remotecontrol":this._router.navigate(["/remote"]);break;case"options":this._router.navigate(["/options"]);break;default:break}}static \u0275fac=function(i){return new(i||r)};static \u0275cmp=R({type:r,selectors:[["settings"]],decls:11,vars:20,consts:[[1,"home-container"],[1,"actions-header-container"],[1,"actions-buttons-container"],["tabindex","0","svgIcon","settings","label","Options",3,"click","iconOnly","compact","iconSize"],["tabindex","0","svgIcon","troubleshoot","label","Data Inspector",3,"click","iconOnly","compact","iconSize"],["tabindex","0","svgIcon","remote-control","label","Remote Control",3,"click","iconOnly","compact","iconSize"],["tabindex","0","svgIcon","help-center","label","Help",3,"click","iconOnly","compact","iconSize"],["mat-icon-button","",1,"dialog-close-icon",3,"click"],[1,"dashboards-editor"]],template:function(i,s){i&1&&(p(0,"div",0)(1,"div",1)(2,"div",2)(3,"tile-large-icon",3),m("click",function(){return s.onActionItem("options")}),g(),p(4,"tile-large-icon",4),m("click",function(){return s.onActionItem("datainspector")}),g(),p(5,"tile-large-icon",5),m("click",function(){return s.onActionItem("remotecontrol")}),g(),p(6,"tile-large-icon",6),m("click",function(){return s.onActionItem("help")}),g()(),p(7,"button",7),m("click",function(){return s.closePage()}),p(8,"mat-icon"),f(9,"close"),g()()(),W(10,"dashboards-editor",8),g()),i&2&&(b(3),F(`${s.isPhonePortrait()?"no-label":"with-label"}`),I("iconOnly",s.isPhonePortrait())("compact",!0)("iconSize",48),b(),F(`${s.isPhonePortrait()?"no-label":"with-label"}`),I("iconOnly",s.isPhonePortrait())("compact",!0)("iconSize",48),b(),F(`${s.isPhonePortrait()?"no-label":"with-label"}`),I("iconOnly",s.isPhonePortrait())("compact",!0)("iconSize",48),b(),F(`${s.isPhonePortrait()?"no-label":"with-label"}`),I("iconOnly",s.isPhonePortrait())("compact",!0)("iconSize",48))},dependencies:[L,M,q,dt,xt,gt,ei],styles:["[_nghost-%COMP%]{display:block;width:100%;height:100%}.home-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;height:100%}.actions-header-container[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:flex-start;width:100%;padding:5px 0 5px 10px}.with-label[_ngcontent-%COMP%]{height:80px;width:100px}.no-label[_ngcontent-%COMP%]{height:58px;width:63px}.dashboard-editor[_ngcontent-%COMP%]{flex:1 1 auto;min-height:0;overflow:auto}.actions-buttons-container[_ngcontent-%COMP%]{display:flex;flex-direction:row;flex-wrap:nowrap;gap:5px}.dialog-close-icon[_ngcontent-%COMP%]{margin-right:15px;margin-top:6px}.mat-mdc-dialog-content[_ngcontent-%COMP%]{max-height:max-content}"]})}return r})();export{Ps as SettingsComponent};
|
package/public/chunk-NDOR4O4J.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as H,b as B,c as N,d as z,e as A,f as j}from"./chunk-52M2PJJL.js";import{a as U}from"./chunk-IJ22WXFB.js";import{e as L,g as E,h as F}from"./chunk-RYHOAWDD.js";import{a as V}from"./chunk-D2CYLQZF.js";import"./chunk-HIADZ4BV.js";import"./chunk-OQULS6SV.js";import{m as $}from"./chunk-XDPHEQEO.js";import{Fa as d,Gd as k,Hb as T,Hd as O,Ic as D,Kb as s,Lb as R,Mc as S,Oa as I,_d as P,bb as M,cb as b,db as w,fb as f,ga as g,gb as v,hb as h,ib as a,ja as u,jb as r,ka as _,kb as x,ra as c,rb as y,t as p,tb as C,vb as l}from"./chunk-OB3QLUH6.js";var K=(t,n)=>n.id;function q(t,n){if(t&1){let e=y();a(0,"button",9),C("click",function(){let o=u(e).$implicit,m=l();return _(m.displayDashboards(o.displayId))}),s(1),r()}if(t&2){let e=n.$implicit,i=l();T("selected",i.selectedDisplayButtonId()===e.displayId),d(),R(e.displayName)}}function W(t,n){t&1&&(a(0,"button",5)(1,"i"),s(2,'"No Remote"'),r()())}function G(t,n){t&1&&(a(0,"div",7),x(1,"mat-progress-spinner",10),r())}function J(t,n){if(t&1){let e=y();a(0,"tile-large-icon",12,0),C("click",function(){let o=u(e).$index,m=l(2);return _(m.setActiveScreen(o))}),r()}if(t&2){let e=n.$implicit,i=n.$index,o=l(2);h("active",o.activeScreen.value()===i)("svgIcon",e.icon)("iconSize",72)("label",e.name)}}function Q(t,n){if(t&1&&f(0,J,2,4,"tile-large-icon",11,K),t&2){let e=l();v(e.screens.value())}}function X(t,n){t&1&&(a(0,"div",8)(1,"mat-icon",13),s(2,"cast"),r(),a(3,"div",14)(4,"p"),s(5,"Select an available remote KIP in the menu."),r(),a(6,"p"),s(7,"To allow remote control of a dashboard, on that KIP device open Options \u2192 Display \u2192 Remote Control and enable it."),r()()())}var _e=(()=>{class t{http=g(D);_settings=g($);HOST_URL=this._settings.signalkUrl.url;pageTitle="Remote Control";displayId=c(null);displays=c(null);screens=S(()=>{if(this.displayId())return`${this.HOST_URL}/plugins/kip/displays/${this.displayId()}`});activeScreen=S(()=>{if(this.displayId())return`${this.HOST_URL}/plugins/kip/displays/${this.displayId()}/activeScreen`});selectedDisplayButtonId=c(null);appID="";ngOnInit(){this.appID=this._settings.KipUUID,p(this.http.get(`${this.HOST_URL}/plugins/kip/displays`)).then(e=>{this.displays.set(e.filter(i=>i.displayId!==this.appID))})}displayDashboards(e){this.displayId.set(e),this.selectedDisplayButtonId.set(e)}setActiveScreen(e){p(this.http.put(`${this.HOST_URL}/plugins/kip/displays/${this.displayId()}/activeScreen`,{screenIdx:e})).then(i=>{i.statusCode!==200&&console.error(`Failed to set active screen: ${i.message}`)}),this.activeScreen.set(e)}static \u0275fac=function(i){return new(i||t)};static \u0275cmp=I({type:t,selectors:[["remote-control"]],decls:11,vars:3,consts:[["tile",""],["svgIconId","remote-control",3,"pageTitle"],[1,"sidenav-remote-control-container"],["mode","side","opened",""],["mat-list-item","","tabindex","0",3,"selected"],["mat-list-item","","tabindex","0","disabled","true",2,"text-align","center"],[1,"sidenav-remote-control-content"],["aria-label","Loading screens",1,"loading-container"],["role","status","aria-live","polite",1,"empty-state-msg"],["mat-list-item","","tabindex","0",3,"click"],["mode","indeterminate","diameter","64","strokeWidth","5"],["tabindex","0",3,"active","svgIcon","iconSize","label"],["tabindex","0",3,"click","active","svgIcon","iconSize","label"],["aria-hidden","true","color","primary",1,"empty-state-icon"],[1,"copy"]],template:function(i,o){i&1&&(x(0,"page-header",1),a(1,"mat-sidenav-container",2)(2,"mat-sidenav",3)(3,"mat-action-list"),f(4,q,2,3,"button",4,w,!1,W,3,0,"button",5),r()(),a(7,"mat-sidenav-content",6),M(8,G,2,0,"div",7)(9,Q,2,0)(10,X,8,0,"div",8),r()()),i&2&&(h("pageTitle",o.pageTitle),d(4),v(o.displays()),d(4),b(o.screens.isLoading()?8:o.screens.hasValue()?9:10))},dependencies:[V,z,B,N,H,F,L,E,P,j,A,U,O,k],styles:[".sidenav-remote-control-container[_ngcontent-%COMP%]{height:calc(100% - 87px);width:calc(100% - 48px);margin:0 24px 24px;border:1px solid var(--mat-sys-outline-variant)}mat-sidenav[_ngcontent-%COMP%]{width:150px;--mat-sidenav-container-shape: square}.selected[_ngcontent-%COMP%]{background-color:var(--mat-sys-inverse-on-surface)}.loading-container[_ngcontent-%COMP%]{min-height:100%;display:flex;align-items:center;justify-content:center;padding:24px}.sidenav-remote-control-content[_ngcontent-%COMP%]{display:flex;flex-direction:row;flex-wrap:wrap;align-content:flex-start;height:100%;width:100%;padding:5px;gap:5px;overflow-y:auto;scrollbar-width:none;overflow-x:hidden;scroll-behavior:smooth;flex:1 1 auto;min-height:0}tile-large-icon[_ngcontent-%COMP%]{width:190px}.empty-state-msg[_ngcontent-%COMP%]{display:flex;flex-direction:column;flex-wrap:nowrap;align-items:center;justify-content:center;height:100%;width:calc(100% - 150px);min-height:70vh;padding:2rem;text-align:center;color:var(--mat-sys-outline-variant);font-style:italic}.empty-state-icon[_ngcontent-%COMP%]{font-size:4rem;width:4rem;height:4rem;color:var(--mat-sys-outline-variant);margin-bottom:1rem}"]})}return t})();export{_e as RemoteControlComponent};
|