@mxtommy/kip 4.5.2 → 4.6.0
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 +12 -3
- package/package.json +13 -15
- package/plugin/history-series.service.js +14 -24
- package/plugin/index.js +139 -95
- package/plugin/{duckdb-parquet-storage.service.js → sqlite-history-storage.service.js} +330 -503
- package/public/assets/help-docs/widget-historical-series.md +5 -5
- package/public/{chunk-TVNXBPFF.js → chunk-356CW47X.js} +1 -1
- package/public/{chunk-NFJ4RQSE.js → chunk-3JA4CQ7T.js} +1 -1
- package/public/{chunk-VXTTEFRP.js → chunk-5SAXWR6Z.js} +8 -8
- package/public/{chunk-67V4XHCY.js → chunk-6A4NRSCL.js} +1 -1
- package/public/{chunk-P7JKENHI.js → chunk-AC6VD2FN.js} +1 -1
- package/public/{chunk-TBNKOU7M.js → chunk-B4NYOD6L.js} +1 -1
- package/public/{chunk-WH5CIUSB.js → chunk-BGGO4PGD.js} +1 -1
- package/public/{chunk-KQEEYPK3.js → chunk-BMHMHQFO.js} +1 -1
- package/public/{chunk-RCYOZLZB.js → chunk-CSIELI2Z.js} +2 -2
- package/public/{chunk-R36UY4Q4.js → chunk-CYTLQDGF.js} +1 -1
- package/public/{chunk-YI3MZWRZ.js → chunk-HSKVTFFQ.js} +1 -1
- package/public/{chunk-IH4CEW4C.js → chunk-MDNGWQNG.js} +8 -8
- package/public/{chunk-VPF5756E.js → chunk-MGLD6QDJ.js} +1 -1
- package/public/{chunk-P4CRTB7N.js → chunk-NJISHUGY.js} +1 -1
- package/public/{chunk-ISF5E3CX.js → chunk-P3M6SJQT.js} +11 -11
- package/public/{chunk-WQSJFJLW.js → chunk-POMIQBAL.js} +2 -2
- package/public/{chunk-SJFJEOSG.js → chunk-PPF5S5CV.js} +1 -1
- package/public/{chunk-OPTBDYBL.js → chunk-PUPM3HUQ.js} +1 -1
- package/public/chunk-PZ6I6W3H.js +16 -0
- package/public/{chunk-VXCYPAWR.js → chunk-QU3JR4YV.js} +1 -1
- package/public/{chunk-Q2ANAJAD.js → chunk-SUWMN3AE.js} +1 -1
- package/public/{chunk-CD5TQSCS.js → chunk-UYHRT3PR.js} +1 -1
- package/public/{chunk-FZFDGAQO.js → chunk-WJFXI5PQ.js} +1 -1
- package/public/{chunk-I4SJ5UNN.js → chunk-ZXO4VMEH.js} +1 -1
- package/public/{chunk-XBSU7OGT.js → chunk-ZY3U4H4Z.js} +1 -1
- package/public/index.html +1 -1
- package/public/{main-B6TXB3EB.js → main-I33LH3HC.js} +1 -1
- package/plugin/plugin-auth.service.js +0 -75
- package/public/chunk-BTFZS2TW.js +0 -16
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{a as te,b as $,d as q,e as Te,f as Ot,g as Nt,h as ze,n as Me,p as oe,q as At,r as He,s as ne,t as Lt,u as Pe}from"./chunk-ISF5E3CX.js";import{c as Mt,g as re}from"./chunk-VXTTEFRP.js";import{a as Ht,b as Pt,e as Oe,f as Ne,h as Ae,i as Wt,j as Le}from"./chunk-VPF5756E.js";import{e as Tt}from"./chunk-FZFDGAQO.js";import{a as Se,d as F,i as ke,m as Rt,n as zt}from"./chunk-P7JKENHI.js";import{$a as Ye,$b as Ee,Aa as Q,Ab as lt,Ac as _t,Bb as dt,Bd as Et,Ca as P,Cb as I,Db as y,Dc as bt,Eb as b,Ec as U,Fa as _e,Fb as Ce,Fc as vt,Ga as L,Gb as J,Hb as ge,Ib as ht,Ka as ce,Lb as ct,Mb as K,Ob as x,Oc as wt,Oe as me,Pe as Re,Qb as O,Rb as Qe,Re as ie,Sb as xe,Se as se,Ta as rt,Tb as ut,Ua as Ke,Ub as pe,V as st,Va as M,Vb as Z,Wb as ee,Yb as gt,Yc as Ct,Zb as pt,a as m,b as E,bb as be,cb as ue,dc as v,ec as ft,f as z,fb as S,fc as mt,ge as Dt,hb as ot,he as St,jb as ve,je as kt,ka as X,kb as we,lb as nt,mb as at,mc as yt,nc as Je,oc as De,pa as _,ua as N,va as A,vb as Xe,wb as W,x as Ve,xb as B,xc as Ze,yd as xt,zc as fe}from"./chunk-BTFZS2TW.js";var h=class l{static getElements(o,e=document){if(typeof o=="string"){let t="getElementById"in e?e:void 0;if(t&&!isNaN(+o[0])){let s=t.getElementById(o);return s?[s]:[]}let i=e.querySelectorAll(o);if(!i.length&&o[0]!=="."&&o[0]!=="#"&&(i=e.querySelectorAll("."+o),i.length||(i=e.querySelectorAll("#"+o)),!i.length)){let s=e.querySelector(`[gs-id="${o}"]`);return s?[s]:[]}return Array.from(i)}return[o]}static getElement(o,e=document){if(typeof o=="string"){let t="getElementById"in e?e:void 0;if(!o.length)return null;if(t&&o[0]==="#")return t.getElementById(o.substring(1));if(o[0]==="#"||o[0]==="."||o[0]==="[")return e.querySelector(o);if(t&&!isNaN(+o[0]))return t.getElementById(o);let i=e.querySelector(o);return t&&!i&&(i=t.getElementById(o)),i||(i=e.querySelector("."+o)),i}return o}static lazyLoad(o){return o.lazyLoad||o.grid?.opts?.lazyLoad&&o.lazyLoad!==!1}static createDiv(o,e){let t=document.createElement("div");return o.forEach(i=>{i&&t.classList.add(i)}),e?.appendChild(t),t}static shouldSizeToContent(o,e=!1){return o?.grid&&(e?o.sizeToContent===!0||o.grid.opts.sizeToContent===!0&&o.sizeToContent===void 0:!!o.sizeToContent||o.grid.opts.sizeToContent&&o.sizeToContent!==!1)}static isIntercepted(o,e){return!(o.y>=e.y+e.h||o.y+o.h<=e.y||o.x+o.w<=e.x||o.x>=e.x+e.w)}static isTouching(o,e){return l.isIntercepted(o,{x:e.x-.5,y:e.y-.5,w:e.w+1,h:e.h+1})}static areaIntercept(o,e){let t=o.x>e.x?o.x:e.x,i=o.x+o.w<e.x+e.w?o.x+o.w:e.x+e.w;if(i<=t)return 0;let s=o.y>e.y?o.y:e.y,r=o.y+o.h<e.y+e.h?o.y+o.h:e.y+e.h;return r<=s?0:(i-t)*(r-s)}static area(o){return o.w*o.h}static sort(o,e=1){return o.sort((i,s)=>{let r=e*((i.y??1e4)-(s.y??1e4));return r===0?e*((i.x??1e4)-(s.x??1e4)):r})}static find(o,e){return e?o.find(t=>t.id===e):void 0}static toBool(o){return typeof o=="boolean"?o:typeof o=="string"?(o=o.toLowerCase(),!(o===""||o==="no"||o==="false"||o==="0")):!!o}static toNumber(o){return o===null||o.length===0?void 0:Number(o)}static parseHeight(o){let e,t="px";if(typeof o=="string")if(o==="auto"||o==="")e=0;else{let i=o.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 = ${o}`);t=i[2]||"px",e=parseFloat(i[1])}else e=o;return{h:e,unit:t}}static defaults(o,...e){return e.forEach(t=>{for(let i in t){if(!t.hasOwnProperty(i))return;o[i]===null||o[i]===void 0?o[i]=t[i]:typeof t[i]=="object"&&typeof o[i]=="object"&&l.defaults(o[i],t[i])}}),o}static same(o,e){if(typeof o!="object")return o==e;if(typeof o!=typeof e||Object.keys(o).length!==Object.keys(e).length)return!1;for(let t in o)if(o[t]!==e[t])return!1;return!0}static copyPos(o,e,t=!1){return e.x!==void 0&&(o.x=e.x),e.y!==void 0&&(o.y=e.y),e.w!==void 0&&(o.w=e.w),e.h!==void 0&&(o.h=e.h),t&&(e.minW&&(o.minW=e.minW),e.minH&&(o.minH=e.minH),e.maxW&&(o.maxW=e.maxW),e.maxH&&(o.maxH=e.maxH)),o}static samePos(o,e){return o&&e&&o.x===e.x&&o.y===e.y&&(o.w||1)===(e.w||1)&&(o.h||1)===(e.h||1)}static sanitizeMinMax(o){o.minW||delete o.minW,o.minH||delete o.minH,o.maxW||delete o.maxW,o.maxH||delete o.maxH}static removeInternalAndSame(o,e){if(!(typeof o!="object"||typeof e!="object")&&!(Array.isArray(o)||Array.isArray(e)))for(let t in o){let i=o[t],s=e[t];t[0]==="_"||i===s?delete o[t]:i&&typeof i=="object"&&s!==void 0&&(l.removeInternalAndSame(i,s),Object.keys(i).length||delete o[t])}}static removeInternalForSave(o,e=!0){for(let t in o)(t[0]==="_"||o[t]===null||o[t]===void 0)&&delete o[t];delete o.grid,e&&delete o.el,o.autoPosition||delete o.autoPosition,o.noResize||delete o.noResize,o.noMove||delete o.noMove,o.locked||delete o.locked,(o.w===1||o.w===o.minW)&&delete o.w,(o.h===1||o.h===o.minH)&&delete o.h}static throttle(o,e){let t=!1;return(...i)=>{t||(t=!0,setTimeout(()=>{o(...i),t=!1},e))}}static removePositioningStyles(o){let e=o.style;e.position&&e.removeProperty("position"),e.left&&e.removeProperty("left"),e.top&&e.removeProperty("top"),e.width&&e.removeProperty("width"),e.height&&e.removeProperty("height")}static getScrollElement(o){if(!o)return document.scrollingElement||document.documentElement;let e=getComputedStyle(o);return/(auto|scroll)/.test(e.overflow+e.overflowY)?o:l.getScrollElement(o.parentElement)}static updateScrollPosition(o,e,t){let i=l.getScrollElement(o);if(!i)return;let s=o.getBoundingClientRect(),r=i.getBoundingClientRect(),n=window.innerHeight||document.documentElement.clientHeight,a=s.bottom-Math.min(r.bottom,n),u=s.top-Math.max(r.top,0),c=i.scrollTop;u<0&&t<0?o.offsetHeight>r.height?i.scrollTop+=t:i.scrollTop+=Math.abs(u)>Math.abs(t)?t:u:a>0&&t>0&&(o.offsetHeight>r.height?i.scrollTop+=t:i.scrollTop+=a>t?t:a),e.top+=i.scrollTop-c}static updateScrollResize(o,e,t){let i=l.getScrollElement(e),s=i.clientHeight,r=i===l.getScrollElement()?0:i.getBoundingClientRect().top,n=o.clientY-r,a=n<t,u=n>s-t;a?i.scrollBy({behavior:"smooth",top:n-t}):u&&i.scrollBy({behavior:"smooth",top:t-(s-n)})}static clone(o){return o==null||typeof o!="object"?o:o instanceof Array?[...o]:m({},o)}static cloneDeep(o){let e=["parentGrid","el","grid","subGrid","engine"],t=l.clone(o);for(let i in t)t.hasOwnProperty(i)&&typeof t[i]=="object"&&i.substring(0,2)!=="__"&&!e.find(s=>s===i)&&(t[i]=l.cloneDeep(o[i]));return t}static cloneNode(o){let e=o.cloneNode(!0);return e.removeAttribute("id"),e}static appendTo(o,e){let t;typeof e=="string"?t=l.getElement(e):t=e,t&&t.appendChild(o)}static addElStyles(o,e){if(e instanceof Object)for(let t in e)e.hasOwnProperty(t)&&(Array.isArray(e[t])?e[t].forEach(i=>{o.style[t]=i}):o.style[t]=e[t])}static initEvent(o,e){let t={type:e.type},i={button:0,which:0,buttons:1,bubbles:!0,cancelable:!0,target:e.target?e.target:o.target};return["altKey","ctrlKey","metaKey","shiftKey"].forEach(s=>t[s]=o[s]),["pageX","pageY","clientX","clientY","screenX","screenY"].forEach(s=>t[s]=o[s]),m(m({},t),i)}static simulateMouseEvent(o,e,t){let i=o,s=new MouseEvent(e,{bubbles:!0,composed:!0,cancelable:!0,view:window,detail:1,screenX:o.screenX,screenY:o.screenY,clientX:o.clientX,clientY:o.clientY,ctrlKey:i.ctrlKey??!1,altKey:i.altKey??!1,shiftKey:i.shiftKey??!1,metaKey:i.metaKey??!1,button:0,relatedTarget:o.target});(t||o.target).dispatchEvent(s)}static getValuesFromTransformedElement(o){let e=document.createElement("div");l.addElStyles(e,{opacity:"0",position:"fixed",top:"0px",left:"0px",width:"1px",height:"1px",zIndex:"-999999"}),o.appendChild(e);let t=e.getBoundingClientRect();return o.removeChild(e),e.remove(),{xScale:1/t.width,yScale:1/t.height,xOffset:t.left,yOffset:t.top}}static swap(o,e,t){if(!o)return;let i=o[e];o[e]=o[t],o[t]=i}static canBeRotated(o){return!(!o||o.w===o.h||o.locked||o.noResize||o.grid?.opts.disableResize||o.minW&&o.minW===o.maxW||o.minH&&o.minH===o.maxH)}};var et=(()=>{class l{constructor(e={}){this.addedNodes=[],this.removedNodes=[],this.defaultColumn=12,this.column=e.column||this.defaultColumn,this.column>this.defaultColumn&&(this.defaultColumn=this.column),this.maxRow=e.maxRow,this._float=e.float,this.nodes=e.nodes||[],this.onChange=e.onChange}batchUpdate(e=!0,t=!0){return!!this.batchMode===e?this:(this.batchMode=e,e?(this._prevFloat=this._float,this._float=!0,this.cleanNodes(),this.saveInitial()):(this._float=this._prevFloat,delete this._prevFloat,t&&this._packNodes(),this._notify()),this)}_useEntireRowArea(e,t){return(!this.float||this.batchMode&&!this._prevFloat)&&!this._hasLocked&&(!e._moving||e._skipDown||t.y<=e.y)}_fixCollisions(e,t=e,i,s={}){if(this.sortNodes(-1),i=i||this.collide(e,t),!i)return!1;if(e._moving&&!s.nested&&!this.float&&this.swap(e,i))return!0;let r=t;!this._loading&&this._useEntireRowArea(e,t)&&(r={x:0,w:this.column,y:t.y,h:t.h},i=this.collide(e,r,s.skip));let n=!1,a={nested:!0,pack:!1},u=0;for(;i=i||this.collide(e,r,s.skip);){if(u++>this.nodes.length*2)throw new Error("Infinite collide check");let c;if(i.locked||this._loading||e._moving&&!e._skipDown&&t.y>e.y&&!this.float&&(!this.collide(i,E(m({},i),{y:e.y}),e)||!this.collide(i,E(m({},i),{y:t.y-i.h}),e))){e._skipDown=e._skipDown||t.y>e.y;let d=m(E(m({},t),{y:i.y+i.h}),a);c=this._loading&&h.samePos(e,d)?!0:this.moveNode(e,d),(i.locked||this._loading)&&c?h.copyPos(t,e):!i.locked&&c&&s.pack&&(this._packNodes(),t.y=i.y+i.h,h.copyPos(e,t)),n=n||c}else c=this.moveNode(i,m(E(m({},i),{y:t.y+t.h,skip:e}),a));if(!c)return n;i=void 0}return n}collide(e,t=e,i){let s=e._id,r=i?._id;return this.nodes.find(n=>n._id!==s&&n._id!==r&&h.isIntercepted(n,t))}collideAll(e,t=e,i){let s=e._id,r=i?._id;return this.nodes.filter(n=>n._id!==s&&n._id!==r&&h.isIntercepted(n,t))}directionCollideCoverage(e,t,i){if(!t.rect||!e._rect)return;let s=e._rect,r=m({},t.rect);r.y>s.y?(r.h+=r.y-s.y,r.y=s.y):r.h+=s.y-r.y,r.x>s.x?(r.w+=r.x-s.x,r.x=s.x):r.w+=s.x-r.x;let n,a=.5;for(let u of i){if(u.locked||!u._rect)break;let c=u._rect,d=Number.MAX_VALUE,g=Number.MAX_VALUE;s.y<c.y?d=(r.y+r.h-c.y)/c.h:s.y+s.h>c.y+c.h&&(d=(c.y+c.h-r.y)/c.h),s.x<c.x?g=(r.x+r.w-c.x)/c.w:s.x+s.w>c.x+c.w&&(g=(c.x+c.w-r.x)/c.w);let p=Math.min(g,d);p>a&&(a=p,n=u)}return t.collide=n,n}cacheRects(e,t,i,s,r,n){return this.nodes.forEach(a=>a._rect={y:a.y*t+i,x:a.x*e+n,w:a.w*e-n-s,h:a.h*t-i-r}),this}swap(e,t){if(!t||t.locked||!e||e.locked)return!1;function i(){let r=t.x,n=t.y;return t.x=e.x,t.y=e.y,e.h!=t.h?(e.x=r,e.y=t.y+t.h):e.w!=t.w?(e.x=t.x+t.w,e.y=n):(e.x=r,e.y=n),e._dirty=t._dirty=!0,!0}let s;if(e.w===t.w&&e.h===t.h&&(e.x===t.x||e.y===t.y)&&(s=h.isTouching(e,t)))return i();if(s!==!1){if(e.w===t.w&&e.x===t.x&&(s||(s=h.isTouching(e,t)))){if(t.y<e.y){let r=e;e=t,t=r}return i()}if(s!==!1){if(e.h===t.h&&e.y===t.y&&(s||(s=h.isTouching(e,t)))){if(t.x<e.x){let r=e;e=t,t=r}return i()}return!1}}}isAreaEmpty(e,t,i,s){let r={x:e||0,y:t||0,w:i||1,h:s||1};return!this.collide(r)}compact(e="compact",t=!0){if(this.nodes.length===0)return this;t&&this.sortNodes();let i=this.batchMode;i||this.batchUpdate();let s=this._inColumnResize;s||(this._inColumnResize=!0);let r=this.nodes;return this.nodes=[],r.forEach((n,a,u)=>{let c;n.locked||(n.autoPosition=!0,e==="list"&&a&&(c=u[a-1])),this.addNode(n,!1,c)}),s||delete this._inColumnResize,i||this.batchUpdate(!1),this}set float(e){this._float!==e&&(this._float=e||!1,e||this._packNodes()._notify())}get float(){return this._float||!1}sortNodes(e=1){return this.nodes=h.sort(this.nodes,e),this}_packNodes(){return this.batchMode?this:(this.sortNodes(),this.float?this.nodes.forEach(e=>{if(e._updating||e._orig===void 0||e.y===e._orig.y)return;let t=e.y;for(;t>e._orig.y;)--t,this.collide(e,{x:e.x,y:t,w:e.w,h:e.h})||(e._dirty=!0,e.y=t)}):this.nodes.forEach((e,t)=>{if(!e.locked)for(;e.y>0;){let i=t===0?0:e.y-1;if(!(t===0||!this.collide(e,{x:e.x,y:i,w:e.w,h:e.h})))break;e._dirty=e.y!==i,e.y=i}}),this)}prepareNode(e,t){e._id=e._id??l._idSeq++;let i=e.id;if(i){let r=1;for(;this.nodes.find(n=>n.id===e.id&&n!==e);)e.id=i+"_"+r++}(e.x===void 0||e.y===void 0||e.x===null||e.y===null)&&(e.autoPosition=!0);let s={x:0,y:0,w:1,h:1};return h.defaults(e,s),e.autoPosition||delete e.autoPosition,e.noResize||delete e.noResize,e.noMove||delete e.noMove,h.sanitizeMinMax(e),typeof e.x=="string"&&(e.x=Number(e.x)),typeof e.y=="string"&&(e.y=Number(e.y)),typeof e.w=="string"&&(e.w=Number(e.w)),typeof e.h=="string"&&(e.h=Number(e.h)),isNaN(e.x)&&(e.x=s.x,e.autoPosition=!0),isNaN(e.y)&&(e.y=s.y,e.autoPosition=!0),isNaN(e.w)&&(e.w=s.w),isNaN(e.h)&&(e.h=s.h),this.nodeBoundFix(e,t),e}nodeBoundFix(e,t){let i=e._orig||h.copyPos({},e);if(e.maxW&&(e.w=Math.min(e.w||1,e.maxW)),e.maxH&&(e.h=Math.min(e.h||1,e.maxH)),e.minW&&(e.w=Math.max(e.w||1,e.minW)),e.minH&&(e.h=Math.max(e.h||1,e.minH)),(e.x||0)+(e.w||1)>this.column&&this.column<this.defaultColumn&&!this._inColumnResize&&!this.skipCacheUpdate&&e._id!=null&&this.findCacheLayout(e,this.defaultColumn)===-1){let r=m({},e);r.autoPosition||r.x===void 0?(delete r.x,delete r.y):r.x=Math.min(this.defaultColumn-1,r.x),r.w=Math.min(this.defaultColumn,r.w||1),this.cacheOneLayout(r,this.defaultColumn)}return e.w>this.column?e.w=this.column:e.w<1&&(e.w=1),this.maxRow&&e.h>this.maxRow?e.h=this.maxRow:e.h<1&&(e.h=1),e.x<0&&(e.x=0),e.y<0&&(e.y=0),e.x+e.w>this.column&&(t?e.w=this.column-e.x:e.x=this.column-e.w),this.maxRow&&e.y+e.h>this.maxRow&&(t?e.h=this.maxRow-e.y:e.y=this.maxRow-e.h),h.samePos(e,i)||(e._dirty=!0),this}getDirtyNodes(e){return e?this.nodes.filter(t=>t._dirty&&!h.samePos(t,t._orig)):this.nodes.filter(t=>t._dirty)}_notify(e){if(this.batchMode||!this.onChange)return this;let t=(e||[]).concat(this.getDirtyNodes());return this.onChange(t),this}cleanNodes(){return this.batchMode?this:(this.nodes.forEach(e=>{delete e._dirty,delete e._lastTried}),this)}saveInitial(){return this.nodes.forEach(e=>{e._orig=h.copyPos({},e),delete e._dirty}),this._hasLocked=this.nodes.some(e=>e.locked),this}restoreInitial(){return this.nodes.forEach(e=>{!e._orig||h.samePos(e,e._orig)||(h.copyPos(e,e._orig),e._dirty=!0)}),this._notify(),this}findEmptyPosition(e,t=this.nodes,i=this.column,s){let r=s?s.y*i+(s.x+s.w):0,n=!1;for(let a=r;!n;++a){let u=a%i,c=Math.floor(a/i);if(u+e.w>i)continue;let d={x:u,y:c,w:e.w,h:e.h};t.find(g=>h.isIntercepted(d,g))||((e.x!==u||e.y!==c)&&(e._dirty=!0),e.x=u,e.y=c,delete e.autoPosition,n=!0)}return n}addNode(e,t=!1,i){let s=this.nodes.find(n=>n._id===e._id);if(s)return s;this._inColumnResize?this.nodeBoundFix(e):this.prepareNode(e),delete e._temporaryRemoved,delete e._removeDOM;let r;return e.autoPosition&&this.findEmptyPosition(e,this.nodes,this.column,i)&&(delete e.autoPosition,r=!0),this.nodes.push(e),t&&this.addedNodes.push(e),r||this._fixCollisions(e),this.batchMode||this._packNodes()._notify(),e}removeNode(e,t=!0,i=!1){return this.nodes.find(s=>s._id===e._id)?(i&&this.removedNodes.push(e),t&&(e._removeDOM=!0),this.nodes=this.nodes.filter(s=>s._id!==e._id),e._isAboutToRemove||this._packNodes(),this._notify([e]),this):this}removeAll(e=!0,t=!0){if(delete this._layouts,!this.nodes.length)return this;e&&this.nodes.forEach(s=>s._removeDOM=!0);let i=this.nodes;return this.removedNodes=t?i:[],this.nodes=[],this._notify(i)}moveNodeCheck(e,t){if(!this.changedPosConstrain(e,t))return!1;if(t.pack=!0,!this.maxRow)return this.moveNode(e,t);let i,s=new l({column:this.column,float:this.float,nodes:this.nodes.map(n=>n._id===e._id?(i=m({},n),i):m({},n))});if(!i)return!1;let r=s.moveNode(i,t)&&s.getRow()<=Math.max(this.getRow(),this.maxRow);if(!r&&!t.resizing&&t.collide){let n=t.collide.el.gridstackNode;if(this.swap(e,n))return this._notify(),!0}return r?(s.nodes.filter(n=>n._dirty).forEach(n=>{let a=this.nodes.find(u=>u._id===n._id);a&&(h.copyPos(a,n),a._dirty=!0)}),this._notify(),!0):!1}willItFit(e){if(delete e._willFitPos,!this.maxRow)return!0;let t=new l({column:this.column,float:this.float,nodes:this.nodes.map(s=>m({},s))}),i=m({},e);return this.cleanupNode(i),delete i.el,delete i._id,delete i.content,delete i.grid,t.addNode(i),t.getRow()<=this.maxRow?(e._willFitPos=h.copyPos({},i),!0):!1}changedPosConstrain(e,t){return t.w=t.w||e.w,t.h=t.h||e.h,e.x!==t.x||e.y!==t.y?!0:(e.maxW&&(t.w=Math.min(t.w,e.maxW)),e.maxH&&(t.h=Math.min(t.h,e.maxH)),e.minW&&(t.w=Math.max(t.w,e.minW)),e.minH&&(t.h=Math.max(t.h,e.minH)),e.w!==t.w||e.h!==t.h)}moveNode(e,t){if(!e||!t)return!1;let i;t.pack===void 0&&!this.batchMode&&(i=t.pack=!0),typeof t.x!="number"&&(t.x=e.x),typeof t.y!="number"&&(t.y=e.y),typeof t.w!="number"&&(t.w=e.w),typeof t.h!="number"&&(t.h=e.h);let s=e.w!==t.w||e.h!==t.h,r=h.copyPos({},e,!0);if(h.copyPos(r,t),this.nodeBoundFix(r,s),h.copyPos(t,r),!t.forceCollide&&h.samePos(e,t))return!1;let n=h.copyPos({},e),a=this.collideAll(e,r,t.skip),u=!0;if(a.length){let c=e._moving&&!t.nested,d=c?this.directionCollideCoverage(e,t,a):a[0];if(c&&d&&e.grid?.opts?.subGridDynamic&&!e.grid._isTemp){let g=h.areaIntercept(t.rect,d._rect),p=h.area(t.rect),w=h.area(d._rect);g/(p<w?p:w)>.8&&(d.grid.makeSubGrid(d.el,void 0,e),d=void 0)}d?u=!this._fixCollisions(e,r,d,t):(u=!1,i&&delete t.pack)}return u&&!h.samePos(e,r)&&(e._dirty=!0,h.copyPos(e,r)),t.pack&&this._packNodes()._notify(),!h.samePos(e,n)}getRow(){return this.nodes.reduce((e,t)=>Math.max(e,t.y+t.h),0)}beginUpdate(e){return e._updating||(e._updating=!0,delete e._skipDown,this.batchMode||this.saveInitial()),this}endUpdate(){let e=this.nodes.find(t=>t._updating);return e&&(delete e._updating,delete e._skipDown),this}save(e=!0,t,i){let s=this._layouts?.length||0,r;s&&(i?i!==this.column&&(r=this._layouts[i]):this.column!==s-1&&(r=this._layouts[s-1]));let n=[];return this.sortNodes(),this.nodes.forEach(a=>{let u=r?.find(d=>d._id===a._id),c=m(m({},a),u||{});h.removeInternalForSave(c,!e),t&&t(a,c),n.push(c)}),n}layoutsNodesChange(e){return!this._layouts||this._inColumnResize?this:(this._layouts.forEach((t,i)=>{if(!t||i===this.column)return this;if(i<this.column)this._layouts[i]=void 0;else{let s=i/this.column;e.forEach(r=>{if(!r._orig)return;let n=t.find(a=>a._id===r._id);n&&(n.y>=0&&r.y!==r._orig.y&&(n.y+=r.y-r._orig.y,n.y<0&&(n.y=0)),r.x!==r._orig.x&&(n.x=Math.round(r.x*s),n.x<0&&(n.x=0)),r.w!==r._orig.w&&(n.w=Math.round(r.w*s),n.w<1&&(n.w=1)))})}}),this)}columnChanged(e,t,i="moveScale"){if(!this.nodes.length||!t||e===t)return this;let s=i==="compact"||i==="list";s&&this.sortNodes(1),t<e&&this.cacheLayout(this.nodes,e),this.batchUpdate();let r=[],n=s?this.nodes:h.sort(this.nodes,-1);if(t>e&&this._layouts){let a=this._layouts[t]||[],u=this._layouts.length-1;!a.length&&e!==u&&this._layouts[u]?.length&&(e=u,this._layouts[u].forEach(c=>{let d=n.find(g=>g._id===c._id);d&&(!s&&!c.autoPosition&&(d.x=c.x??d.x,d.y=c.y??d.y),d.w=c.w??d.w,(c.x==null||c.y===void 0)&&(d.autoPosition=!0))})),a.forEach(c=>{let d=n.findIndex(g=>g._id===c._id);if(d!==-1){let g=n[d];if(s){g.w=c.w;return}(c.autoPosition||isNaN(c.x)||isNaN(c.y))&&this.findEmptyPosition(c,r),c.autoPosition||(g.x=c.x??g.x,g.y=c.y??g.y,g.w=c.w??g.w,r.push(g)),n.splice(d,1)}})}if(s)this.compact(i,!1);else{if(n.length)if(typeof i=="function")i(t,e,r,n);else{let a=s||i==="none"?1:t/e,u=i==="move"||i==="moveScale",c=i==="scale"||i==="moveScale";n.forEach(d=>{d.x=t===1?0:u?Math.round(d.x*a):Math.min(d.x,t-1),d.w=t===1||e===1?1:c?Math.round(d.w*a)||1:Math.min(d.w,t),r.push(d)}),n=[]}r=h.sort(r,-1),this._inColumnResize=!0,this.nodes=[],r.forEach(a=>{this.addNode(a,!1),delete a._orig})}return this.nodes.forEach(a=>delete a._orig),this.batchUpdate(!1,!s),delete this._inColumnResize,this}cacheLayout(e,t,i=!1){let s=[];return e.forEach((r,n)=>{if(r._id===void 0){let a=r.id?this.nodes.find(u=>u.id===r.id):void 0;r._id=a?._id??l._idSeq++}s[n]={x:r.x,y:r.y,w:r.w,_id:r._id}}),this._layouts=i?[]:this._layouts||[],this._layouts[t]=s,this}cacheOneLayout(e,t){e._id=e._id??l._idSeq++;let i={x:e.x,y:e.y,w:e.w,_id:e._id};(e.autoPosition||e.x===void 0)&&(delete i.x,delete i.y,e.autoPosition&&(i.autoPosition=!0)),this._layouts=this._layouts||[],this._layouts[t]=this._layouts[t]||[];let s=this.findCacheLayout(e,t);return s===-1?this._layouts[t].push(i):this._layouts[t][s]=i,this}findCacheLayout(e,t){return this._layouts?.[t]?.findIndex(i=>i._id===e._id)??-1}removeNodeFromLayoutCache(e){if(this._layouts)for(let t=0;t<this._layouts.length;t++){let i=this.findCacheLayout(e,t);i!==-1&&this._layouts[t].splice(i,1)}}cleanupNode(e){for(let t in e)t[0]==="_"&&t!=="_id"&&delete e[t];return this}}return l._idSeq=0,l})();var H={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 f=class{};var k=typeof window<"u"&&typeof document<"u"&&("ontouchstart"in document||"ontouchstart"in window||window.DocumentTouch&&document instanceof window.DocumentTouch||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0),D=class{};function We(l,o){l.touches.length>1||(l.cancelable&&l.preventDefault(),h.simulateMouseEvent(l.changedTouches[0],o))}function Bt(l,o){l.cancelable&&l.preventDefault(),h.simulateMouseEvent(l,o)}function ae(l){D.touchHandled||(D.touchHandled=!0,We(l,"mousedown"))}function le(l){D.touchHandled&&We(l,"mousemove")}function de(l){if(!D.touchHandled)return;D.pointerLeaveTimeout&&(window.clearTimeout(D.pointerLeaveTimeout),delete D.pointerLeaveTimeout);let o=!!f.dragElement;We(l,"mouseup"),o||We(l,"click"),D.touchHandled=!1}function he(l){l.pointerType!=="mouse"&&l.target.releasePointerCapture(l.pointerId)}function tt(l){f.dragElement&&l.pointerType!=="mouse"&&Bt(l,"mouseenter")}function it(l){f.dragElement&&l.pointerType!=="mouse"&&(D.pointerLeaveTimeout=window.setTimeout(()=>{delete D.pointerLeaveTimeout,Bt(l,"mouseleave")},10))}var It=(()=>{class l{constructor(e,t,i){this.host=e,this.dir=t,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(){if(this.option.element)try{this.el=this.option.element instanceof HTMLElement?this.option.element:this.host.querySelector(this.option.element)}catch(e){this.option.element=void 0,console.error("Query for resizeable handle failed, falling back",e)}return this.el||(this.el=document.createElement("div"),this.host.appendChild(this.el)),this.el.classList.add("ui-resizable-handle"),this.el.classList.add(`${l.prefix}${this.dir}`),this.el.style.zIndex="100",this.el.style.userSelect="none",this.el.addEventListener("mousedown",this._mouseDown),k&&(this.el.addEventListener("touchstart",ae),this.el.addEventListener("pointerdown",he)),this}destroy(){return this.moving&&this._mouseUp(this.mouseDownEvent),this.el.removeEventListener("mousedown",this._mouseDown),k&&(this.el.removeEventListener("touchstart",ae),this.el.removeEventListener("pointerdown",he)),this.option.element||this.host.removeChild(this.el),delete this.el,delete this.host,this}_mouseDown(e){this.mouseDownEvent=e,document.addEventListener("mousemove",this._mouseMove,{capture:!0,passive:!0}),document.addEventListener("mouseup",this._mouseUp,!0),k&&(this.el.addEventListener("touchmove",le),this.el.addEventListener("touchend",de)),e.stopPropagation(),e.preventDefault()}_mouseMove(e){let t=this.mouseDownEvent;this.moving?this._triggerEvent("move",e):Math.abs(e.x-t.x)+Math.abs(e.y-t.y)>2&&(this.moving=!0,this._triggerEvent("start",this.mouseDownEvent),this._triggerEvent("move",e),document.addEventListener("keydown",this._keyEvent)),e.stopPropagation()}_mouseUp(e){this.moving&&(this._triggerEvent("stop",e),document.removeEventListener("keydown",this._keyEvent)),document.removeEventListener("mousemove",this._mouseMove,!0),document.removeEventListener("mouseup",this._mouseUp,!0),k&&(this.el.removeEventListener("touchmove",le),this.el.removeEventListener("touchend",de)),delete this.moving,delete this.mouseDownEvent,e.stopPropagation(),e.preventDefault()}_keyEvent(e){e.key==="Escape"&&(this.host.gridstackNode?.grid?.engine.restoreInitial(),this._mouseUp(this.mouseDownEvent))}_triggerEvent(e,t){return this.option[e]&&this.option[e](t),this}}return l.prefix="ui-resizable-",l})();var j=class{constructor(){this._eventRegister={}}get disabled(){return this._disabled}on(o,e){this._eventRegister[o]=e}off(o){delete this._eventRegister[o]}enable(){this._disabled=!1}disable(){this._disabled=!0}destroy(){delete this._eventRegister}triggerEvent(o,e){if(!this.disabled&&this._eventRegister&&this._eventRegister[o])return this._eventRegister[o](e)}};var Ft=(()=>{class l extends j{constructor(e,t={}){super(),this.el=e,this.option=t,this.rectScale={x:1,y:1},this._ui=()=>{let s=this.el.parentElement.getBoundingClientRect(),r={width:this.originalRect.width,height:this.originalRect.height+this.scrolled,left:this.originalRect.left,top:this.originalRect.top-this.scrolled},n=this.temporalRect||r;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(e,t){super.on(e,t)}off(e){super.off(e)}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(e){let t=e.handles&&e.handles!==this.option.handles,i=e.autoHide&&e.autoHide!==this.option.autoHide;return Object.keys(e).forEach(s=>this.option[s]=e[s]),t&&(this._removeHandlers(),this._setupHandlers()),i&&this._setupAutoHide(this.option.autoHide),this}_setupAutoHide(e){return e?(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),f.overResizeElement===this&&delete f.overResizeElement),this}_mouseOver(e){f.overResizeElement||f.dragElement||(f.overResizeElement=this,this.el.classList.remove("ui-resizable-autohide"))}_mouseOut(e){f.overResizeElement===this&&(delete f.overResizeElement,this.el.classList.add("ui-resizable-autohide"))}_setupHandlers(){return this.handlers=this.option.handles.split(",").map(e=>e.trim()).map(e=>new It(this.el,e,{element:this.option.element,start:t=>this._resizeStart(t),stop:t=>this._resizeStop(t),move:t=>this._resizing(t,e)})),this}_resizeStart(e){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=e,this._setupHelper(),this._applyChange();let t=h.initEvent(e,{type:"resizestart",target:this.el});return this.option.start&&this.option.start(t,this._ui()),this.el.classList.add("ui-resizable-resizing"),this.triggerEvent("resizestart",t),this}_resizing(e,t){this.scrolled=this.scrollEl.scrollTop-this.scrollY,this.temporalRect=this._getChange(e,t),this._applyChange();let i=h.initEvent(e,{type:"resize",target:this.el});return this.option.resize&&this.option.resize(i,this._ui()),this.triggerEvent("resize",i),this}_resizeStop(e){let t=h.initEvent(e,{type:"resizestop",target:this.el});return this._cleanHelper(),this.option.stop&&this.option.stop(t),this.el.classList.remove("ui-resizable-resizing"),this.triggerEvent("resizestop",t),delete this.startEvent,delete this.originalRect,delete this.temporalRect,delete this.scrollY,delete this.scrolled,this}_setupHelper(){this.elOriginStyleVal=l._originStyleProp.map(i=>this.el.style[i]),this.parentOriginStylePosition=this.el.parentElement.style.position;let e=this.el.parentElement,t=h.getValuesFromTransformedElement(e);return this.rectScale={x:t.xScale,y:t.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 l._originStyleProp.forEach((e,t)=>{this.el.style[e]=this.elOriginStyleVal[t]||null}),this.el.parentElement.style.position=this.parentOriginStylePosition||null,this}_getChange(e,t){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},r=e.clientX-i.clientX,n=this.sizeToContent?0:e.clientY-i.clientY,a,u;t.indexOf("e")>-1?s.width+=r:t.indexOf("w")>-1&&(s.width-=r,s.left+=r,a=!0),t.indexOf("s")>-1?s.height+=n:t.indexOf("n")>-1&&(s.height-=n,s.top+=n,u=!0);let c=this._constrainSize(s.width,s.height,a,u);return Math.round(s.width)!==Math.round(c.width)&&(t.indexOf("w")>-1&&(s.left+=s.width-c.width),s.width=c.width),Math.round(s.height)!==Math.round(c.height)&&(t.indexOf("n")>-1&&(s.top+=s.height-c.height),s.height=c.height),s}_constrainSize(e,t,i,s){let r=this.option,n=(i?r.maxWidthMoveLeft:r.maxWidth)||Number.MAX_SAFE_INTEGER,a=r.minWidth/this.rectScale.x||e,u=(s?r.maxHeightMoveUp:r.maxHeight)||Number.MAX_SAFE_INTEGER,c=r.minHeight/this.rectScale.y||t,d=Math.min(n,Math.max(a,e)),g=Math.min(u,Math.max(c,t));return{width:d,height:g}}_applyChange(){let e={left:0,top:0,width:0,height:0};if(this.el.style.position==="absolute"){let t=this.el.parentElement,{left:i,top:s}=t.getBoundingClientRect();e={left:i,top:s,width:0,height:0}}return this.temporalRect?(Object.keys(this.temporalRect).forEach(t=>{let i=this.temporalRect[t],s=t==="width"||t==="left"?this.rectScale.x:t==="height"||t==="top"?this.rectScale.y:1;this.el.style[t]=(i-e[t])*s+"px"}),this):this}_removeHandlers(){return this.handlers.forEach(e=>e.destroy()),delete this.handlers,this}}return l._originStyleProp=["width","height","position","left","top","opacity","zIndex"],l})();var ti='input,textarea,button,select,option,[contenteditable="true"],.ui-resizable-handle',Gt=(()=>{class l extends j{constructor(e,t={}){super(),this.el=e,this.option=t,this.dragTransform={xScale:1,yScale:1,xOffset:0,yOffset:0};let i=t?.handle?.substring(1),s=e.gridstackNode;this.dragEls=!i||e.classList.contains(i)?[e]:s?.subGrid?[e.querySelector(t.handle)||e]:Array.from(e.querySelectorAll(t.handle)),this.dragEls.length===0&&(this.dragEls=[e]),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(e,t){super.on(e,t)}off(e){super.off(e)}enable(){this.disabled!==!1&&(super.enable(),this.dragEls.forEach(e=>{e.addEventListener("mousedown",this._mouseDown),k&&(e.addEventListener("touchstart",ae),e.addEventListener("pointerdown",he))}),this.el.classList.remove("ui-draggable-disabled"))}disable(e=!1){this.disabled!==!0&&(super.disable(),this.dragEls.forEach(t=>{t.removeEventListener("mousedown",this._mouseDown),k&&(t.removeEventListener("touchstart",ae),t.removeEventListener("pointerdown",he))}),e||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(e){return Object.keys(e).forEach(t=>this.option[t]=e[t]),this}_mouseDown(e){if(D.touchHandled&&e.isTrusted&&(D.touchHandled=!1),!f.mouseHandled)return e.button!==0||!this.dragEls.find(t=>t===e.target)&&e.target.closest(ti)||this.option.cancel&&e.target.closest(this.option.cancel)||(this.mouseDownEvent=e,delete this.dragging,delete f.dragElement,delete f.dropElement,document.addEventListener("mousemove",this._mouseMove,{capture:!0,passive:!0}),document.addEventListener("mouseup",this._mouseUp,!0),k&&(e.currentTarget.addEventListener("touchmove",le),e.currentTarget.addEventListener("touchend",de)),e.preventDefault(),document.activeElement&&document.activeElement.blur(),f.mouseHandled=!0),!0}_callDrag(e){if(!this.dragging)return;let t=h.initEvent(e,{target:this.el,type:"drag"});this.option.drag&&this.option.drag(t,this.ui()),this.triggerEvent("drag",t)}_mouseMove(e){let t=this.mouseDownEvent;if(this.lastDrag=e,this.dragging)if(this._dragFollow(e),f.pauseDrag){let i=Number.isInteger(f.pauseDrag)?f.pauseDrag:100;this.dragTimeout&&window.clearTimeout(this.dragTimeout),this.dragTimeout=window.setTimeout(()=>this._callDrag(e),i)}else this._callDrag(e);else if(Math.abs(e.x-t.x)+Math.abs(e.y-t.y)>3){this.dragging=!0,f.dragElement=this;let i=this.el.gridstackNode?.grid;i?f.dropElement=i.el.ddElement.ddDroppable:delete f.dropElement,this.helper=this._createHelper(),this._setupHelperContainmentStyle(),this.dragTransform=h.getValuesFromTransformedElement(this.helperContainment),this.dragOffset=this._getDragOffset(e,this.el,this.helperContainment),this._setupHelperStyle(e);let s=h.initEvent(e,{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(e){if(document.removeEventListener("mousemove",this._mouseMove,!0),document.removeEventListener("mouseup",this._mouseUp,!0),k&&e.currentTarget&&(e.currentTarget.removeEventListener("touchmove",le,!0),e.currentTarget.removeEventListener("touchend",de,!0)),this.dragging){delete this.dragging,delete this.el.gridstackNode?._origRotate,document.removeEventListener("keydown",this._keyEvent),f.dropElement?.el===this.el.parentElement&&delete f.dropElement,this.helperContainment.style.position=this.parentOriginStylePosition||null,this.helper!==this.el&&this.helper.remove(),this._removeHelperStyle();let t=h.initEvent(e,{target:this.el,type:"dragstop"});this.option.stop&&this.option.stop(t),this.triggerEvent("dragstop",t),f.dropElement&&f.dropElement.drop(e)}delete this.helper,delete this.mouseDownEvent,delete f.dragElement,delete f.dropElement,delete f.mouseHandled,e.preventDefault()}_keyEvent(e){let t=this.el.gridstackNode,i=t?.grid||f.dropElement?.el?.gridstack;if(e.key==="Escape")t&&t._origRotate&&(t._orig=t._origRotate,delete t._origRotate),i?.cancelDrag(),this._mouseUp(this.mouseDownEvent);else if(t&&i&&(e.key==="r"||e.key==="R")){if(!h.canBeRotated(t))return;t._origRotate=t._origRotate||m({},t._orig),delete t._moving,i.setAnimation(!1).rotate(t.el,{top:-this.dragOffset.offsetTop,left:-this.dragOffset.offsetLeft}).setAnimation(),t._moving=!0,this.dragOffset=this._getDragOffset(this.lastDrag,t.el,this.helperContainment),this.helper.style.width=this.dragOffset.width+"px",this.helper.style.height=this.dragOffset.height+"px",h.swap(t._orig,"w","h"),delete t._rect,this._mouseMove(this.lastDrag)}}_createHelper(){let e=this.el;return typeof this.option.helper=="function"?e=this.option.helper(this.el):this.option.helper==="clone"&&(e=h.cloneNode(this.el)),e.parentElement||h.appendTo(e,this.option.appendTo==="parent"?this.el.parentElement:this.option.appendTo),this.dragElementOriginStyle=l.originStyleProp.map(t=>this.el.style[t]),e}_setupHelperStyle(e){this.helper.classList.add("ui-draggable-dragging"),this.el.gridstackNode?.grid?.el.classList.add("grid-stack-dragging");let t=this.helper.style;return t.pointerEvents="none",t.width=this.dragOffset.width+"px",t.height=this.dragOffset.height+"px",t.willChange="left, top",t.position="fixed",this._dragFollow(e),t.transition="none",setTimeout(()=>{this.helper&&(t.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 t=this.helper,i=this.dragElementOriginStyle.transition||null;t.style.transition=this.dragElementOriginStyle.transition="none",l.originStyleProp.forEach(s=>t.style[s]=this.dragElementOriginStyle[s]||null),setTimeout(()=>t.style.transition=i,50)}return delete this.dragElementOriginStyle,this}_dragFollow(e){let t={left:0,top:0},i=this.helper.style,s=this.dragOffset;i.left=(e.clientX+s.offsetLeft-t.left)*this.dragTransform.xScale+"px",i.top=(e.clientY+s.offsetTop-t.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(e,t,i){let s=0,r=0;i&&(s=this.dragTransform.xOffset,r=this.dragTransform.yOffset);let n=t.getBoundingClientRect();return{left:n.left,top:n.top,offsetLeft:-e.clientX+n.left-s,offsetTop:-e.clientY+n.top-r,width:n.width*this.dragTransform.xScale,height:n.height*this.dragTransform.yScale}}ui(){let t=this.el.parentElement.getBoundingClientRect(),i=this.helper.getBoundingClientRect();return{position:{top:(i.top-t.top)*this.dragTransform.yScale,left:(i.left-t.left)*this.dragTransform.xScale}}}}return l.originStyleProp=["width","height","transform","transform-origin","transition","pointerEvents","position","left","top","minWidth","willChange"],l})();var Be=class extends j{constructor(o,e={}){super(),this.el=o,this.option=e,this._mouseEnter=this._mouseEnter.bind(this),this._mouseLeave=this._mouseLeave.bind(this),this.enable(),this._setupAccept()}on(o,e){super.on(o,e)}off(o){super.off(o)}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),k&&(this.el.addEventListener("pointerenter",tt),this.el.addEventListener("pointerleave",it)))}disable(o=!1){this.disabled!==!0&&(super.disable(),this.el.classList.remove("ui-droppable"),o||this.el.classList.add("ui-droppable-disabled"),this.el.removeEventListener("mouseenter",this._mouseEnter),this.el.removeEventListener("mouseleave",this._mouseLeave),k&&(this.el.removeEventListener("pointerenter",tt),this.el.removeEventListener("pointerleave",it)))}destroy(){this.disable(!0),this.el.classList.remove("ui-droppable"),this.el.classList.remove("ui-droppable-disabled"),super.destroy()}updateOption(o){return Object.keys(o).forEach(e=>this.option[e]=o[e]),this._setupAccept(),this}_mouseEnter(o){if(!f.dragElement||D.touchHandled&&o.isTrusted||!this._canDrop(f.dragElement.el))return;o.preventDefault(),o.stopPropagation(),f.dropElement&&f.dropElement!==this&&f.dropElement._mouseLeave(o,!0),f.dropElement=this;let e=h.initEvent(o,{target:this.el,type:"dropover"});this.option.over&&this.option.over(e,this._ui(f.dragElement)),this.triggerEvent("dropover",e),this.el.classList.add("ui-droppable-over")}_mouseLeave(o,e=!1){if(!f.dragElement||f.dropElement!==this)return;o.preventDefault(),o.stopPropagation();let t=h.initEvent(o,{target:this.el,type:"dropout"});if(this.option.out&&this.option.out(t,this._ui(f.dragElement)),this.triggerEvent("dropout",t),f.dropElement===this&&(delete f.dropElement,!e)){let i,s=this.el.parentElement;for(;!i&&s;)i=s.ddElement?.ddDroppable,s=s.parentElement;i&&i._mouseEnter(o)}}drop(o){o.preventDefault();let e=h.initEvent(o,{target:this.el,type:"drop"});this.option.drop&&this.option.drop(e,this._ui(f.dragElement)),this.triggerEvent("drop",e)}_canDrop(o){return o&&(!this.accept||this.accept(o))}_setupAccept(){return this.option.accept?(typeof this.option.accept=="string"?this.accept=o=>o.classList.contains(this.option.accept)||o.matches(this.option.accept):this.accept=this.option.accept,this):this}_ui(o){return m({draggable:o.el},o.ui())}};var Ie=class l{static init(o){return o.ddElement||(o.ddElement=new l(o)),o.ddElement}constructor(o){this.el=o}on(o,e){return this.ddDraggable&&["drag","dragstart","dragstop"].indexOf(o)>-1?this.ddDraggable.on(o,e):this.ddDroppable&&["drop","dropover","dropout"].indexOf(o)>-1?this.ddDroppable.on(o,e):this.ddResizable&&["resizestart","resize","resizestop"].indexOf(o)>-1&&this.ddResizable.on(o,e),this}off(o){return this.ddDraggable&&["drag","dragstart","dragstop"].indexOf(o)>-1?this.ddDraggable.off(o):this.ddDroppable&&["drop","dropover","dropout"].indexOf(o)>-1?this.ddDroppable.off(o):this.ddResizable&&["resizestart","resize","resizestop"].indexOf(o)>-1&&this.ddResizable.off(o),this}setupDraggable(o){return this.ddDraggable?this.ddDraggable.updateOption(o):this.ddDraggable=new Gt(this.el,o),this}cleanDraggable(){return this.ddDraggable&&(this.ddDraggable.destroy(),delete this.ddDraggable),this}setupResizable(o){return this.ddResizable?this.ddResizable.updateOption(o):this.ddResizable=new Ft(this.el,o),this}cleanResizable(){return this.ddResizable&&(this.ddResizable.destroy(),delete this.ddResizable),this}setupDroppable(o){return this.ddDroppable?this.ddDroppable.updateOption(o):this.ddDroppable=new Be(this.el,o),this}cleanDroppable(){return this.ddDroppable&&(this.ddDroppable.destroy(),delete this.ddDroppable),this}};var Fe=class{resizable(o,e,t,i){return this._getDDElements(o,e).forEach(s=>{if(e==="disable"||e==="enable")s.ddResizable&&s.ddResizable[e]();else if(e==="destroy")s.ddResizable&&s.cleanResizable();else if(e==="option")s.setupResizable({[t]:i});else{let n=s.el.gridstackNode.grid,a=s.el.getAttribute("gs-resize-handles")||n.opts.resizable.handles||"e,s,se";a==="all"&&(a="n,e,s,w,se,sw,ne,nw");let u=!n.opts.alwaysShowResizeHandle;s.setupResizable(E(m({},n.opts.resizable),{handles:a,autoHide:u,start:e.start,stop:e.stop,resize:e.resize}))}}),this}draggable(o,e,t,i){return this._getDDElements(o,e).forEach(s=>{if(e==="disable"||e==="enable")s.ddDraggable&&s.ddDraggable[e]();else if(e==="destroy")s.ddDraggable&&s.cleanDraggable();else if(e==="option")s.setupDraggable({[t]:i});else{let r=s.el.gridstackNode.grid;s.setupDraggable(E(m({},r.opts.draggable),{start:e.start,stop:e.stop,drag:e.drag}))}}),this}dragIn(o,e){return this._getDDElements(o).forEach(t=>t.setupDraggable(e)),this}droppable(o,e,t,i){return typeof e.accept=="function"&&!e._accept&&(e._accept=e.accept,e.accept=s=>e._accept(s)),this._getDDElements(o,e).forEach(s=>{e==="disable"||e==="enable"?s.ddDroppable&&s.ddDroppable[e]():e==="destroy"?s.ddDroppable&&s.cleanDroppable():e==="option"?s.setupDroppable({[t]:i}):s.setupDroppable(e)}),this}isDroppable(o){return!!(o?.ddElement?.ddDroppable&&!o.ddElement.ddDroppable.disabled)}isDraggable(o){return!!(o?.ddElement?.ddDraggable&&!o.ddElement.ddDraggable.disabled)}isResizable(o){return!!(o?.ddElement?.ddResizable&&!o.ddElement.ddResizable.disabled)}on(o,e,t){return this._getDDElements(o).forEach(i=>i.on(e,s=>{t(s,f.dragElement?f.dragElement.el:s.target,f.dragElement?f.dragElement.helper:null)})),this}off(o,e){return this._getDDElements(o).forEach(t=>t.off(e)),this}_getDDElements(o,e){let t=o.gridstack||e!=="destroy"&&e!=="disable",i=h.getElements(o);return i.length?i.map(r=>r.ddElement||(t?Ie.init(r):null)).filter(r=>r):[]}};var R=new Fe,V=(()=>{class l{static init(e={},t=".grid-stack"){if(typeof document>"u")return null;let i=l.getGridElement(t);return i?(i.gridstack||(i.gridstack=new l(i,h.cloneDeep(e))),i.gridstack):(console.error(typeof t=="string"?'GridStack.initAll() no grid was found with selector "'+t+`" - element missing or wrong selector ?
|
|
1
|
+
import{a as te,b as $,d as q,e as Te,f as Ot,g as Nt,h as ze,n as Me,p as oe,q as At,r as He,s as ne,t as Lt,u as Pe}from"./chunk-P3M6SJQT.js";import{c as Mt,g as re}from"./chunk-5SAXWR6Z.js";import{a as Ht,b as Pt,e as Oe,f as Ne,h as Ae,i as Wt,j as Le}from"./chunk-MGLD6QDJ.js";import{e as Tt}from"./chunk-WJFXI5PQ.js";import{a as Se,d as F,i as ke,m as Rt,n as zt}from"./chunk-AC6VD2FN.js";import{$a as Ye,$b as Ee,Aa as Q,Ab as lt,Ac as _t,Bb as dt,Bd as Et,Ca as P,Cb as I,Db as y,Dc as bt,Eb as b,Ec as U,Fa as _e,Fb as Ce,Fc as vt,Ga as L,Gb as J,Hb as ge,Ib as ht,Ka as ce,Lb as ct,Mb as K,Ob as x,Oc as wt,Oe as me,Pe as Re,Qb as O,Rb as Qe,Re as ie,Sb as xe,Se as se,Ta as rt,Tb as ut,Ua as Ke,Ub as pe,V as st,Va as M,Vb as Z,Wb as ee,Yb as gt,Yc as Ct,Zb as pt,a as m,b as E,bb as be,cb as ue,dc as v,ec as ft,f as z,fb as S,fc as mt,ge as Dt,hb as ot,he as St,jb as ve,je as kt,ka as X,kb as we,lb as nt,mb as at,mc as yt,nc as Je,oc as De,pa as _,ua as N,va as A,vb as Xe,wb as W,x as Ve,xb as B,xc as Ze,yd as xt,zc as fe}from"./chunk-PZ6I6W3H.js";var h=class l{static getElements(o,e=document){if(typeof o=="string"){let t="getElementById"in e?e:void 0;if(t&&!isNaN(+o[0])){let s=t.getElementById(o);return s?[s]:[]}let i=e.querySelectorAll(o);if(!i.length&&o[0]!=="."&&o[0]!=="#"&&(i=e.querySelectorAll("."+o),i.length||(i=e.querySelectorAll("#"+o)),!i.length)){let s=e.querySelector(`[gs-id="${o}"]`);return s?[s]:[]}return Array.from(i)}return[o]}static getElement(o,e=document){if(typeof o=="string"){let t="getElementById"in e?e:void 0;if(!o.length)return null;if(t&&o[0]==="#")return t.getElementById(o.substring(1));if(o[0]==="#"||o[0]==="."||o[0]==="[")return e.querySelector(o);if(t&&!isNaN(+o[0]))return t.getElementById(o);let i=e.querySelector(o);return t&&!i&&(i=t.getElementById(o)),i||(i=e.querySelector("."+o)),i}return o}static lazyLoad(o){return o.lazyLoad||o.grid?.opts?.lazyLoad&&o.lazyLoad!==!1}static createDiv(o,e){let t=document.createElement("div");return o.forEach(i=>{i&&t.classList.add(i)}),e?.appendChild(t),t}static shouldSizeToContent(o,e=!1){return o?.grid&&(e?o.sizeToContent===!0||o.grid.opts.sizeToContent===!0&&o.sizeToContent===void 0:!!o.sizeToContent||o.grid.opts.sizeToContent&&o.sizeToContent!==!1)}static isIntercepted(o,e){return!(o.y>=e.y+e.h||o.y+o.h<=e.y||o.x+o.w<=e.x||o.x>=e.x+e.w)}static isTouching(o,e){return l.isIntercepted(o,{x:e.x-.5,y:e.y-.5,w:e.w+1,h:e.h+1})}static areaIntercept(o,e){let t=o.x>e.x?o.x:e.x,i=o.x+o.w<e.x+e.w?o.x+o.w:e.x+e.w;if(i<=t)return 0;let s=o.y>e.y?o.y:e.y,r=o.y+o.h<e.y+e.h?o.y+o.h:e.y+e.h;return r<=s?0:(i-t)*(r-s)}static area(o){return o.w*o.h}static sort(o,e=1){return o.sort((i,s)=>{let r=e*((i.y??1e4)-(s.y??1e4));return r===0?e*((i.x??1e4)-(s.x??1e4)):r})}static find(o,e){return e?o.find(t=>t.id===e):void 0}static toBool(o){return typeof o=="boolean"?o:typeof o=="string"?(o=o.toLowerCase(),!(o===""||o==="no"||o==="false"||o==="0")):!!o}static toNumber(o){return o===null||o.length===0?void 0:Number(o)}static parseHeight(o){let e,t="px";if(typeof o=="string")if(o==="auto"||o==="")e=0;else{let i=o.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 = ${o}`);t=i[2]||"px",e=parseFloat(i[1])}else e=o;return{h:e,unit:t}}static defaults(o,...e){return e.forEach(t=>{for(let i in t){if(!t.hasOwnProperty(i))return;o[i]===null||o[i]===void 0?o[i]=t[i]:typeof t[i]=="object"&&typeof o[i]=="object"&&l.defaults(o[i],t[i])}}),o}static same(o,e){if(typeof o!="object")return o==e;if(typeof o!=typeof e||Object.keys(o).length!==Object.keys(e).length)return!1;for(let t in o)if(o[t]!==e[t])return!1;return!0}static copyPos(o,e,t=!1){return e.x!==void 0&&(o.x=e.x),e.y!==void 0&&(o.y=e.y),e.w!==void 0&&(o.w=e.w),e.h!==void 0&&(o.h=e.h),t&&(e.minW&&(o.minW=e.minW),e.minH&&(o.minH=e.minH),e.maxW&&(o.maxW=e.maxW),e.maxH&&(o.maxH=e.maxH)),o}static samePos(o,e){return o&&e&&o.x===e.x&&o.y===e.y&&(o.w||1)===(e.w||1)&&(o.h||1)===(e.h||1)}static sanitizeMinMax(o){o.minW||delete o.minW,o.minH||delete o.minH,o.maxW||delete o.maxW,o.maxH||delete o.maxH}static removeInternalAndSame(o,e){if(!(typeof o!="object"||typeof e!="object")&&!(Array.isArray(o)||Array.isArray(e)))for(let t in o){let i=o[t],s=e[t];t[0]==="_"||i===s?delete o[t]:i&&typeof i=="object"&&s!==void 0&&(l.removeInternalAndSame(i,s),Object.keys(i).length||delete o[t])}}static removeInternalForSave(o,e=!0){for(let t in o)(t[0]==="_"||o[t]===null||o[t]===void 0)&&delete o[t];delete o.grid,e&&delete o.el,o.autoPosition||delete o.autoPosition,o.noResize||delete o.noResize,o.noMove||delete o.noMove,o.locked||delete o.locked,(o.w===1||o.w===o.minW)&&delete o.w,(o.h===1||o.h===o.minH)&&delete o.h}static throttle(o,e){let t=!1;return(...i)=>{t||(t=!0,setTimeout(()=>{o(...i),t=!1},e))}}static removePositioningStyles(o){let e=o.style;e.position&&e.removeProperty("position"),e.left&&e.removeProperty("left"),e.top&&e.removeProperty("top"),e.width&&e.removeProperty("width"),e.height&&e.removeProperty("height")}static getScrollElement(o){if(!o)return document.scrollingElement||document.documentElement;let e=getComputedStyle(o);return/(auto|scroll)/.test(e.overflow+e.overflowY)?o:l.getScrollElement(o.parentElement)}static updateScrollPosition(o,e,t){let i=l.getScrollElement(o);if(!i)return;let s=o.getBoundingClientRect(),r=i.getBoundingClientRect(),n=window.innerHeight||document.documentElement.clientHeight,a=s.bottom-Math.min(r.bottom,n),u=s.top-Math.max(r.top,0),c=i.scrollTop;u<0&&t<0?o.offsetHeight>r.height?i.scrollTop+=t:i.scrollTop+=Math.abs(u)>Math.abs(t)?t:u:a>0&&t>0&&(o.offsetHeight>r.height?i.scrollTop+=t:i.scrollTop+=a>t?t:a),e.top+=i.scrollTop-c}static updateScrollResize(o,e,t){let i=l.getScrollElement(e),s=i.clientHeight,r=i===l.getScrollElement()?0:i.getBoundingClientRect().top,n=o.clientY-r,a=n<t,u=n>s-t;a?i.scrollBy({behavior:"smooth",top:n-t}):u&&i.scrollBy({behavior:"smooth",top:t-(s-n)})}static clone(o){return o==null||typeof o!="object"?o:o instanceof Array?[...o]:m({},o)}static cloneDeep(o){let e=["parentGrid","el","grid","subGrid","engine"],t=l.clone(o);for(let i in t)t.hasOwnProperty(i)&&typeof t[i]=="object"&&i.substring(0,2)!=="__"&&!e.find(s=>s===i)&&(t[i]=l.cloneDeep(o[i]));return t}static cloneNode(o){let e=o.cloneNode(!0);return e.removeAttribute("id"),e}static appendTo(o,e){let t;typeof e=="string"?t=l.getElement(e):t=e,t&&t.appendChild(o)}static addElStyles(o,e){if(e instanceof Object)for(let t in e)e.hasOwnProperty(t)&&(Array.isArray(e[t])?e[t].forEach(i=>{o.style[t]=i}):o.style[t]=e[t])}static initEvent(o,e){let t={type:e.type},i={button:0,which:0,buttons:1,bubbles:!0,cancelable:!0,target:e.target?e.target:o.target};return["altKey","ctrlKey","metaKey","shiftKey"].forEach(s=>t[s]=o[s]),["pageX","pageY","clientX","clientY","screenX","screenY"].forEach(s=>t[s]=o[s]),m(m({},t),i)}static simulateMouseEvent(o,e,t){let i=o,s=new MouseEvent(e,{bubbles:!0,composed:!0,cancelable:!0,view:window,detail:1,screenX:o.screenX,screenY:o.screenY,clientX:o.clientX,clientY:o.clientY,ctrlKey:i.ctrlKey??!1,altKey:i.altKey??!1,shiftKey:i.shiftKey??!1,metaKey:i.metaKey??!1,button:0,relatedTarget:o.target});(t||o.target).dispatchEvent(s)}static getValuesFromTransformedElement(o){let e=document.createElement("div");l.addElStyles(e,{opacity:"0",position:"fixed",top:"0px",left:"0px",width:"1px",height:"1px",zIndex:"-999999"}),o.appendChild(e);let t=e.getBoundingClientRect();return o.removeChild(e),e.remove(),{xScale:1/t.width,yScale:1/t.height,xOffset:t.left,yOffset:t.top}}static swap(o,e,t){if(!o)return;let i=o[e];o[e]=o[t],o[t]=i}static canBeRotated(o){return!(!o||o.w===o.h||o.locked||o.noResize||o.grid?.opts.disableResize||o.minW&&o.minW===o.maxW||o.minH&&o.minH===o.maxH)}};var et=(()=>{class l{constructor(e={}){this.addedNodes=[],this.removedNodes=[],this.defaultColumn=12,this.column=e.column||this.defaultColumn,this.column>this.defaultColumn&&(this.defaultColumn=this.column),this.maxRow=e.maxRow,this._float=e.float,this.nodes=e.nodes||[],this.onChange=e.onChange}batchUpdate(e=!0,t=!0){return!!this.batchMode===e?this:(this.batchMode=e,e?(this._prevFloat=this._float,this._float=!0,this.cleanNodes(),this.saveInitial()):(this._float=this._prevFloat,delete this._prevFloat,t&&this._packNodes(),this._notify()),this)}_useEntireRowArea(e,t){return(!this.float||this.batchMode&&!this._prevFloat)&&!this._hasLocked&&(!e._moving||e._skipDown||t.y<=e.y)}_fixCollisions(e,t=e,i,s={}){if(this.sortNodes(-1),i=i||this.collide(e,t),!i)return!1;if(e._moving&&!s.nested&&!this.float&&this.swap(e,i))return!0;let r=t;!this._loading&&this._useEntireRowArea(e,t)&&(r={x:0,w:this.column,y:t.y,h:t.h},i=this.collide(e,r,s.skip));let n=!1,a={nested:!0,pack:!1},u=0;for(;i=i||this.collide(e,r,s.skip);){if(u++>this.nodes.length*2)throw new Error("Infinite collide check");let c;if(i.locked||this._loading||e._moving&&!e._skipDown&&t.y>e.y&&!this.float&&(!this.collide(i,E(m({},i),{y:e.y}),e)||!this.collide(i,E(m({},i),{y:t.y-i.h}),e))){e._skipDown=e._skipDown||t.y>e.y;let d=m(E(m({},t),{y:i.y+i.h}),a);c=this._loading&&h.samePos(e,d)?!0:this.moveNode(e,d),(i.locked||this._loading)&&c?h.copyPos(t,e):!i.locked&&c&&s.pack&&(this._packNodes(),t.y=i.y+i.h,h.copyPos(e,t)),n=n||c}else c=this.moveNode(i,m(E(m({},i),{y:t.y+t.h,skip:e}),a));if(!c)return n;i=void 0}return n}collide(e,t=e,i){let s=e._id,r=i?._id;return this.nodes.find(n=>n._id!==s&&n._id!==r&&h.isIntercepted(n,t))}collideAll(e,t=e,i){let s=e._id,r=i?._id;return this.nodes.filter(n=>n._id!==s&&n._id!==r&&h.isIntercepted(n,t))}directionCollideCoverage(e,t,i){if(!t.rect||!e._rect)return;let s=e._rect,r=m({},t.rect);r.y>s.y?(r.h+=r.y-s.y,r.y=s.y):r.h+=s.y-r.y,r.x>s.x?(r.w+=r.x-s.x,r.x=s.x):r.w+=s.x-r.x;let n,a=.5;for(let u of i){if(u.locked||!u._rect)break;let c=u._rect,d=Number.MAX_VALUE,g=Number.MAX_VALUE;s.y<c.y?d=(r.y+r.h-c.y)/c.h:s.y+s.h>c.y+c.h&&(d=(c.y+c.h-r.y)/c.h),s.x<c.x?g=(r.x+r.w-c.x)/c.w:s.x+s.w>c.x+c.w&&(g=(c.x+c.w-r.x)/c.w);let p=Math.min(g,d);p>a&&(a=p,n=u)}return t.collide=n,n}cacheRects(e,t,i,s,r,n){return this.nodes.forEach(a=>a._rect={y:a.y*t+i,x:a.x*e+n,w:a.w*e-n-s,h:a.h*t-i-r}),this}swap(e,t){if(!t||t.locked||!e||e.locked)return!1;function i(){let r=t.x,n=t.y;return t.x=e.x,t.y=e.y,e.h!=t.h?(e.x=r,e.y=t.y+t.h):e.w!=t.w?(e.x=t.x+t.w,e.y=n):(e.x=r,e.y=n),e._dirty=t._dirty=!0,!0}let s;if(e.w===t.w&&e.h===t.h&&(e.x===t.x||e.y===t.y)&&(s=h.isTouching(e,t)))return i();if(s!==!1){if(e.w===t.w&&e.x===t.x&&(s||(s=h.isTouching(e,t)))){if(t.y<e.y){let r=e;e=t,t=r}return i()}if(s!==!1){if(e.h===t.h&&e.y===t.y&&(s||(s=h.isTouching(e,t)))){if(t.x<e.x){let r=e;e=t,t=r}return i()}return!1}}}isAreaEmpty(e,t,i,s){let r={x:e||0,y:t||0,w:i||1,h:s||1};return!this.collide(r)}compact(e="compact",t=!0){if(this.nodes.length===0)return this;t&&this.sortNodes();let i=this.batchMode;i||this.batchUpdate();let s=this._inColumnResize;s||(this._inColumnResize=!0);let r=this.nodes;return this.nodes=[],r.forEach((n,a,u)=>{let c;n.locked||(n.autoPosition=!0,e==="list"&&a&&(c=u[a-1])),this.addNode(n,!1,c)}),s||delete this._inColumnResize,i||this.batchUpdate(!1),this}set float(e){this._float!==e&&(this._float=e||!1,e||this._packNodes()._notify())}get float(){return this._float||!1}sortNodes(e=1){return this.nodes=h.sort(this.nodes,e),this}_packNodes(){return this.batchMode?this:(this.sortNodes(),this.float?this.nodes.forEach(e=>{if(e._updating||e._orig===void 0||e.y===e._orig.y)return;let t=e.y;for(;t>e._orig.y;)--t,this.collide(e,{x:e.x,y:t,w:e.w,h:e.h})||(e._dirty=!0,e.y=t)}):this.nodes.forEach((e,t)=>{if(!e.locked)for(;e.y>0;){let i=t===0?0:e.y-1;if(!(t===0||!this.collide(e,{x:e.x,y:i,w:e.w,h:e.h})))break;e._dirty=e.y!==i,e.y=i}}),this)}prepareNode(e,t){e._id=e._id??l._idSeq++;let i=e.id;if(i){let r=1;for(;this.nodes.find(n=>n.id===e.id&&n!==e);)e.id=i+"_"+r++}(e.x===void 0||e.y===void 0||e.x===null||e.y===null)&&(e.autoPosition=!0);let s={x:0,y:0,w:1,h:1};return h.defaults(e,s),e.autoPosition||delete e.autoPosition,e.noResize||delete e.noResize,e.noMove||delete e.noMove,h.sanitizeMinMax(e),typeof e.x=="string"&&(e.x=Number(e.x)),typeof e.y=="string"&&(e.y=Number(e.y)),typeof e.w=="string"&&(e.w=Number(e.w)),typeof e.h=="string"&&(e.h=Number(e.h)),isNaN(e.x)&&(e.x=s.x,e.autoPosition=!0),isNaN(e.y)&&(e.y=s.y,e.autoPosition=!0),isNaN(e.w)&&(e.w=s.w),isNaN(e.h)&&(e.h=s.h),this.nodeBoundFix(e,t),e}nodeBoundFix(e,t){let i=e._orig||h.copyPos({},e);if(e.maxW&&(e.w=Math.min(e.w||1,e.maxW)),e.maxH&&(e.h=Math.min(e.h||1,e.maxH)),e.minW&&(e.w=Math.max(e.w||1,e.minW)),e.minH&&(e.h=Math.max(e.h||1,e.minH)),(e.x||0)+(e.w||1)>this.column&&this.column<this.defaultColumn&&!this._inColumnResize&&!this.skipCacheUpdate&&e._id!=null&&this.findCacheLayout(e,this.defaultColumn)===-1){let r=m({},e);r.autoPosition||r.x===void 0?(delete r.x,delete r.y):r.x=Math.min(this.defaultColumn-1,r.x),r.w=Math.min(this.defaultColumn,r.w||1),this.cacheOneLayout(r,this.defaultColumn)}return e.w>this.column?e.w=this.column:e.w<1&&(e.w=1),this.maxRow&&e.h>this.maxRow?e.h=this.maxRow:e.h<1&&(e.h=1),e.x<0&&(e.x=0),e.y<0&&(e.y=0),e.x+e.w>this.column&&(t?e.w=this.column-e.x:e.x=this.column-e.w),this.maxRow&&e.y+e.h>this.maxRow&&(t?e.h=this.maxRow-e.y:e.y=this.maxRow-e.h),h.samePos(e,i)||(e._dirty=!0),this}getDirtyNodes(e){return e?this.nodes.filter(t=>t._dirty&&!h.samePos(t,t._orig)):this.nodes.filter(t=>t._dirty)}_notify(e){if(this.batchMode||!this.onChange)return this;let t=(e||[]).concat(this.getDirtyNodes());return this.onChange(t),this}cleanNodes(){return this.batchMode?this:(this.nodes.forEach(e=>{delete e._dirty,delete e._lastTried}),this)}saveInitial(){return this.nodes.forEach(e=>{e._orig=h.copyPos({},e),delete e._dirty}),this._hasLocked=this.nodes.some(e=>e.locked),this}restoreInitial(){return this.nodes.forEach(e=>{!e._orig||h.samePos(e,e._orig)||(h.copyPos(e,e._orig),e._dirty=!0)}),this._notify(),this}findEmptyPosition(e,t=this.nodes,i=this.column,s){let r=s?s.y*i+(s.x+s.w):0,n=!1;for(let a=r;!n;++a){let u=a%i,c=Math.floor(a/i);if(u+e.w>i)continue;let d={x:u,y:c,w:e.w,h:e.h};t.find(g=>h.isIntercepted(d,g))||((e.x!==u||e.y!==c)&&(e._dirty=!0),e.x=u,e.y=c,delete e.autoPosition,n=!0)}return n}addNode(e,t=!1,i){let s=this.nodes.find(n=>n._id===e._id);if(s)return s;this._inColumnResize?this.nodeBoundFix(e):this.prepareNode(e),delete e._temporaryRemoved,delete e._removeDOM;let r;return e.autoPosition&&this.findEmptyPosition(e,this.nodes,this.column,i)&&(delete e.autoPosition,r=!0),this.nodes.push(e),t&&this.addedNodes.push(e),r||this._fixCollisions(e),this.batchMode||this._packNodes()._notify(),e}removeNode(e,t=!0,i=!1){return this.nodes.find(s=>s._id===e._id)?(i&&this.removedNodes.push(e),t&&(e._removeDOM=!0),this.nodes=this.nodes.filter(s=>s._id!==e._id),e._isAboutToRemove||this._packNodes(),this._notify([e]),this):this}removeAll(e=!0,t=!0){if(delete this._layouts,!this.nodes.length)return this;e&&this.nodes.forEach(s=>s._removeDOM=!0);let i=this.nodes;return this.removedNodes=t?i:[],this.nodes=[],this._notify(i)}moveNodeCheck(e,t){if(!this.changedPosConstrain(e,t))return!1;if(t.pack=!0,!this.maxRow)return this.moveNode(e,t);let i,s=new l({column:this.column,float:this.float,nodes:this.nodes.map(n=>n._id===e._id?(i=m({},n),i):m({},n))});if(!i)return!1;let r=s.moveNode(i,t)&&s.getRow()<=Math.max(this.getRow(),this.maxRow);if(!r&&!t.resizing&&t.collide){let n=t.collide.el.gridstackNode;if(this.swap(e,n))return this._notify(),!0}return r?(s.nodes.filter(n=>n._dirty).forEach(n=>{let a=this.nodes.find(u=>u._id===n._id);a&&(h.copyPos(a,n),a._dirty=!0)}),this._notify(),!0):!1}willItFit(e){if(delete e._willFitPos,!this.maxRow)return!0;let t=new l({column:this.column,float:this.float,nodes:this.nodes.map(s=>m({},s))}),i=m({},e);return this.cleanupNode(i),delete i.el,delete i._id,delete i.content,delete i.grid,t.addNode(i),t.getRow()<=this.maxRow?(e._willFitPos=h.copyPos({},i),!0):!1}changedPosConstrain(e,t){return t.w=t.w||e.w,t.h=t.h||e.h,e.x!==t.x||e.y!==t.y?!0:(e.maxW&&(t.w=Math.min(t.w,e.maxW)),e.maxH&&(t.h=Math.min(t.h,e.maxH)),e.minW&&(t.w=Math.max(t.w,e.minW)),e.minH&&(t.h=Math.max(t.h,e.minH)),e.w!==t.w||e.h!==t.h)}moveNode(e,t){if(!e||!t)return!1;let i;t.pack===void 0&&!this.batchMode&&(i=t.pack=!0),typeof t.x!="number"&&(t.x=e.x),typeof t.y!="number"&&(t.y=e.y),typeof t.w!="number"&&(t.w=e.w),typeof t.h!="number"&&(t.h=e.h);let s=e.w!==t.w||e.h!==t.h,r=h.copyPos({},e,!0);if(h.copyPos(r,t),this.nodeBoundFix(r,s),h.copyPos(t,r),!t.forceCollide&&h.samePos(e,t))return!1;let n=h.copyPos({},e),a=this.collideAll(e,r,t.skip),u=!0;if(a.length){let c=e._moving&&!t.nested,d=c?this.directionCollideCoverage(e,t,a):a[0];if(c&&d&&e.grid?.opts?.subGridDynamic&&!e.grid._isTemp){let g=h.areaIntercept(t.rect,d._rect),p=h.area(t.rect),w=h.area(d._rect);g/(p<w?p:w)>.8&&(d.grid.makeSubGrid(d.el,void 0,e),d=void 0)}d?u=!this._fixCollisions(e,r,d,t):(u=!1,i&&delete t.pack)}return u&&!h.samePos(e,r)&&(e._dirty=!0,h.copyPos(e,r)),t.pack&&this._packNodes()._notify(),!h.samePos(e,n)}getRow(){return this.nodes.reduce((e,t)=>Math.max(e,t.y+t.h),0)}beginUpdate(e){return e._updating||(e._updating=!0,delete e._skipDown,this.batchMode||this.saveInitial()),this}endUpdate(){let e=this.nodes.find(t=>t._updating);return e&&(delete e._updating,delete e._skipDown),this}save(e=!0,t,i){let s=this._layouts?.length||0,r;s&&(i?i!==this.column&&(r=this._layouts[i]):this.column!==s-1&&(r=this._layouts[s-1]));let n=[];return this.sortNodes(),this.nodes.forEach(a=>{let u=r?.find(d=>d._id===a._id),c=m(m({},a),u||{});h.removeInternalForSave(c,!e),t&&t(a,c),n.push(c)}),n}layoutsNodesChange(e){return!this._layouts||this._inColumnResize?this:(this._layouts.forEach((t,i)=>{if(!t||i===this.column)return this;if(i<this.column)this._layouts[i]=void 0;else{let s=i/this.column;e.forEach(r=>{if(!r._orig)return;let n=t.find(a=>a._id===r._id);n&&(n.y>=0&&r.y!==r._orig.y&&(n.y+=r.y-r._orig.y,n.y<0&&(n.y=0)),r.x!==r._orig.x&&(n.x=Math.round(r.x*s),n.x<0&&(n.x=0)),r.w!==r._orig.w&&(n.w=Math.round(r.w*s),n.w<1&&(n.w=1)))})}}),this)}columnChanged(e,t,i="moveScale"){if(!this.nodes.length||!t||e===t)return this;let s=i==="compact"||i==="list";s&&this.sortNodes(1),t<e&&this.cacheLayout(this.nodes,e),this.batchUpdate();let r=[],n=s?this.nodes:h.sort(this.nodes,-1);if(t>e&&this._layouts){let a=this._layouts[t]||[],u=this._layouts.length-1;!a.length&&e!==u&&this._layouts[u]?.length&&(e=u,this._layouts[u].forEach(c=>{let d=n.find(g=>g._id===c._id);d&&(!s&&!c.autoPosition&&(d.x=c.x??d.x,d.y=c.y??d.y),d.w=c.w??d.w,(c.x==null||c.y===void 0)&&(d.autoPosition=!0))})),a.forEach(c=>{let d=n.findIndex(g=>g._id===c._id);if(d!==-1){let g=n[d];if(s){g.w=c.w;return}(c.autoPosition||isNaN(c.x)||isNaN(c.y))&&this.findEmptyPosition(c,r),c.autoPosition||(g.x=c.x??g.x,g.y=c.y??g.y,g.w=c.w??g.w,r.push(g)),n.splice(d,1)}})}if(s)this.compact(i,!1);else{if(n.length)if(typeof i=="function")i(t,e,r,n);else{let a=s||i==="none"?1:t/e,u=i==="move"||i==="moveScale",c=i==="scale"||i==="moveScale";n.forEach(d=>{d.x=t===1?0:u?Math.round(d.x*a):Math.min(d.x,t-1),d.w=t===1||e===1?1:c?Math.round(d.w*a)||1:Math.min(d.w,t),r.push(d)}),n=[]}r=h.sort(r,-1),this._inColumnResize=!0,this.nodes=[],r.forEach(a=>{this.addNode(a,!1),delete a._orig})}return this.nodes.forEach(a=>delete a._orig),this.batchUpdate(!1,!s),delete this._inColumnResize,this}cacheLayout(e,t,i=!1){let s=[];return e.forEach((r,n)=>{if(r._id===void 0){let a=r.id?this.nodes.find(u=>u.id===r.id):void 0;r._id=a?._id??l._idSeq++}s[n]={x:r.x,y:r.y,w:r.w,_id:r._id}}),this._layouts=i?[]:this._layouts||[],this._layouts[t]=s,this}cacheOneLayout(e,t){e._id=e._id??l._idSeq++;let i={x:e.x,y:e.y,w:e.w,_id:e._id};(e.autoPosition||e.x===void 0)&&(delete i.x,delete i.y,e.autoPosition&&(i.autoPosition=!0)),this._layouts=this._layouts||[],this._layouts[t]=this._layouts[t]||[];let s=this.findCacheLayout(e,t);return s===-1?this._layouts[t].push(i):this._layouts[t][s]=i,this}findCacheLayout(e,t){return this._layouts?.[t]?.findIndex(i=>i._id===e._id)??-1}removeNodeFromLayoutCache(e){if(this._layouts)for(let t=0;t<this._layouts.length;t++){let i=this.findCacheLayout(e,t);i!==-1&&this._layouts[t].splice(i,1)}}cleanupNode(e){for(let t in e)t[0]==="_"&&t!=="_id"&&delete e[t];return this}}return l._idSeq=0,l})();var H={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 f=class{};var k=typeof window<"u"&&typeof document<"u"&&("ontouchstart"in document||"ontouchstart"in window||window.DocumentTouch&&document instanceof window.DocumentTouch||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0),D=class{};function We(l,o){l.touches.length>1||(l.cancelable&&l.preventDefault(),h.simulateMouseEvent(l.changedTouches[0],o))}function Bt(l,o){l.cancelable&&l.preventDefault(),h.simulateMouseEvent(l,o)}function ae(l){D.touchHandled||(D.touchHandled=!0,We(l,"mousedown"))}function le(l){D.touchHandled&&We(l,"mousemove")}function de(l){if(!D.touchHandled)return;D.pointerLeaveTimeout&&(window.clearTimeout(D.pointerLeaveTimeout),delete D.pointerLeaveTimeout);let o=!!f.dragElement;We(l,"mouseup"),o||We(l,"click"),D.touchHandled=!1}function he(l){l.pointerType!=="mouse"&&l.target.releasePointerCapture(l.pointerId)}function tt(l){f.dragElement&&l.pointerType!=="mouse"&&Bt(l,"mouseenter")}function it(l){f.dragElement&&l.pointerType!=="mouse"&&(D.pointerLeaveTimeout=window.setTimeout(()=>{delete D.pointerLeaveTimeout,Bt(l,"mouseleave")},10))}var It=(()=>{class l{constructor(e,t,i){this.host=e,this.dir=t,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(){if(this.option.element)try{this.el=this.option.element instanceof HTMLElement?this.option.element:this.host.querySelector(this.option.element)}catch(e){this.option.element=void 0,console.error("Query for resizeable handle failed, falling back",e)}return this.el||(this.el=document.createElement("div"),this.host.appendChild(this.el)),this.el.classList.add("ui-resizable-handle"),this.el.classList.add(`${l.prefix}${this.dir}`),this.el.style.zIndex="100",this.el.style.userSelect="none",this.el.addEventListener("mousedown",this._mouseDown),k&&(this.el.addEventListener("touchstart",ae),this.el.addEventListener("pointerdown",he)),this}destroy(){return this.moving&&this._mouseUp(this.mouseDownEvent),this.el.removeEventListener("mousedown",this._mouseDown),k&&(this.el.removeEventListener("touchstart",ae),this.el.removeEventListener("pointerdown",he)),this.option.element||this.host.removeChild(this.el),delete this.el,delete this.host,this}_mouseDown(e){this.mouseDownEvent=e,document.addEventListener("mousemove",this._mouseMove,{capture:!0,passive:!0}),document.addEventListener("mouseup",this._mouseUp,!0),k&&(this.el.addEventListener("touchmove",le),this.el.addEventListener("touchend",de)),e.stopPropagation(),e.preventDefault()}_mouseMove(e){let t=this.mouseDownEvent;this.moving?this._triggerEvent("move",e):Math.abs(e.x-t.x)+Math.abs(e.y-t.y)>2&&(this.moving=!0,this._triggerEvent("start",this.mouseDownEvent),this._triggerEvent("move",e),document.addEventListener("keydown",this._keyEvent)),e.stopPropagation()}_mouseUp(e){this.moving&&(this._triggerEvent("stop",e),document.removeEventListener("keydown",this._keyEvent)),document.removeEventListener("mousemove",this._mouseMove,!0),document.removeEventListener("mouseup",this._mouseUp,!0),k&&(this.el.removeEventListener("touchmove",le),this.el.removeEventListener("touchend",de)),delete this.moving,delete this.mouseDownEvent,e.stopPropagation(),e.preventDefault()}_keyEvent(e){e.key==="Escape"&&(this.host.gridstackNode?.grid?.engine.restoreInitial(),this._mouseUp(this.mouseDownEvent))}_triggerEvent(e,t){return this.option[e]&&this.option[e](t),this}}return l.prefix="ui-resizable-",l})();var j=class{constructor(){this._eventRegister={}}get disabled(){return this._disabled}on(o,e){this._eventRegister[o]=e}off(o){delete this._eventRegister[o]}enable(){this._disabled=!1}disable(){this._disabled=!0}destroy(){delete this._eventRegister}triggerEvent(o,e){if(!this.disabled&&this._eventRegister&&this._eventRegister[o])return this._eventRegister[o](e)}};var Ft=(()=>{class l extends j{constructor(e,t={}){super(),this.el=e,this.option=t,this.rectScale={x:1,y:1},this._ui=()=>{let s=this.el.parentElement.getBoundingClientRect(),r={width:this.originalRect.width,height:this.originalRect.height+this.scrolled,left:this.originalRect.left,top:this.originalRect.top-this.scrolled},n=this.temporalRect||r;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(e,t){super.on(e,t)}off(e){super.off(e)}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(e){let t=e.handles&&e.handles!==this.option.handles,i=e.autoHide&&e.autoHide!==this.option.autoHide;return Object.keys(e).forEach(s=>this.option[s]=e[s]),t&&(this._removeHandlers(),this._setupHandlers()),i&&this._setupAutoHide(this.option.autoHide),this}_setupAutoHide(e){return e?(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),f.overResizeElement===this&&delete f.overResizeElement),this}_mouseOver(e){f.overResizeElement||f.dragElement||(f.overResizeElement=this,this.el.classList.remove("ui-resizable-autohide"))}_mouseOut(e){f.overResizeElement===this&&(delete f.overResizeElement,this.el.classList.add("ui-resizable-autohide"))}_setupHandlers(){return this.handlers=this.option.handles.split(",").map(e=>e.trim()).map(e=>new It(this.el,e,{element:this.option.element,start:t=>this._resizeStart(t),stop:t=>this._resizeStop(t),move:t=>this._resizing(t,e)})),this}_resizeStart(e){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=e,this._setupHelper(),this._applyChange();let t=h.initEvent(e,{type:"resizestart",target:this.el});return this.option.start&&this.option.start(t,this._ui()),this.el.classList.add("ui-resizable-resizing"),this.triggerEvent("resizestart",t),this}_resizing(e,t){this.scrolled=this.scrollEl.scrollTop-this.scrollY,this.temporalRect=this._getChange(e,t),this._applyChange();let i=h.initEvent(e,{type:"resize",target:this.el});return this.option.resize&&this.option.resize(i,this._ui()),this.triggerEvent("resize",i),this}_resizeStop(e){let t=h.initEvent(e,{type:"resizestop",target:this.el});return this._cleanHelper(),this.option.stop&&this.option.stop(t),this.el.classList.remove("ui-resizable-resizing"),this.triggerEvent("resizestop",t),delete this.startEvent,delete this.originalRect,delete this.temporalRect,delete this.scrollY,delete this.scrolled,this}_setupHelper(){this.elOriginStyleVal=l._originStyleProp.map(i=>this.el.style[i]),this.parentOriginStylePosition=this.el.parentElement.style.position;let e=this.el.parentElement,t=h.getValuesFromTransformedElement(e);return this.rectScale={x:t.xScale,y:t.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 l._originStyleProp.forEach((e,t)=>{this.el.style[e]=this.elOriginStyleVal[t]||null}),this.el.parentElement.style.position=this.parentOriginStylePosition||null,this}_getChange(e,t){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},r=e.clientX-i.clientX,n=this.sizeToContent?0:e.clientY-i.clientY,a,u;t.indexOf("e")>-1?s.width+=r:t.indexOf("w")>-1&&(s.width-=r,s.left+=r,a=!0),t.indexOf("s")>-1?s.height+=n:t.indexOf("n")>-1&&(s.height-=n,s.top+=n,u=!0);let c=this._constrainSize(s.width,s.height,a,u);return Math.round(s.width)!==Math.round(c.width)&&(t.indexOf("w")>-1&&(s.left+=s.width-c.width),s.width=c.width),Math.round(s.height)!==Math.round(c.height)&&(t.indexOf("n")>-1&&(s.top+=s.height-c.height),s.height=c.height),s}_constrainSize(e,t,i,s){let r=this.option,n=(i?r.maxWidthMoveLeft:r.maxWidth)||Number.MAX_SAFE_INTEGER,a=r.minWidth/this.rectScale.x||e,u=(s?r.maxHeightMoveUp:r.maxHeight)||Number.MAX_SAFE_INTEGER,c=r.minHeight/this.rectScale.y||t,d=Math.min(n,Math.max(a,e)),g=Math.min(u,Math.max(c,t));return{width:d,height:g}}_applyChange(){let e={left:0,top:0,width:0,height:0};if(this.el.style.position==="absolute"){let t=this.el.parentElement,{left:i,top:s}=t.getBoundingClientRect();e={left:i,top:s,width:0,height:0}}return this.temporalRect?(Object.keys(this.temporalRect).forEach(t=>{let i=this.temporalRect[t],s=t==="width"||t==="left"?this.rectScale.x:t==="height"||t==="top"?this.rectScale.y:1;this.el.style[t]=(i-e[t])*s+"px"}),this):this}_removeHandlers(){return this.handlers.forEach(e=>e.destroy()),delete this.handlers,this}}return l._originStyleProp=["width","height","position","left","top","opacity","zIndex"],l})();var ti='input,textarea,button,select,option,[contenteditable="true"],.ui-resizable-handle',Gt=(()=>{class l extends j{constructor(e,t={}){super(),this.el=e,this.option=t,this.dragTransform={xScale:1,yScale:1,xOffset:0,yOffset:0};let i=t?.handle?.substring(1),s=e.gridstackNode;this.dragEls=!i||e.classList.contains(i)?[e]:s?.subGrid?[e.querySelector(t.handle)||e]:Array.from(e.querySelectorAll(t.handle)),this.dragEls.length===0&&(this.dragEls=[e]),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(e,t){super.on(e,t)}off(e){super.off(e)}enable(){this.disabled!==!1&&(super.enable(),this.dragEls.forEach(e=>{e.addEventListener("mousedown",this._mouseDown),k&&(e.addEventListener("touchstart",ae),e.addEventListener("pointerdown",he))}),this.el.classList.remove("ui-draggable-disabled"))}disable(e=!1){this.disabled!==!0&&(super.disable(),this.dragEls.forEach(t=>{t.removeEventListener("mousedown",this._mouseDown),k&&(t.removeEventListener("touchstart",ae),t.removeEventListener("pointerdown",he))}),e||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(e){return Object.keys(e).forEach(t=>this.option[t]=e[t]),this}_mouseDown(e){if(D.touchHandled&&e.isTrusted&&(D.touchHandled=!1),!f.mouseHandled)return e.button!==0||!this.dragEls.find(t=>t===e.target)&&e.target.closest(ti)||this.option.cancel&&e.target.closest(this.option.cancel)||(this.mouseDownEvent=e,delete this.dragging,delete f.dragElement,delete f.dropElement,document.addEventListener("mousemove",this._mouseMove,{capture:!0,passive:!0}),document.addEventListener("mouseup",this._mouseUp,!0),k&&(e.currentTarget.addEventListener("touchmove",le),e.currentTarget.addEventListener("touchend",de)),e.preventDefault(),document.activeElement&&document.activeElement.blur(),f.mouseHandled=!0),!0}_callDrag(e){if(!this.dragging)return;let t=h.initEvent(e,{target:this.el,type:"drag"});this.option.drag&&this.option.drag(t,this.ui()),this.triggerEvent("drag",t)}_mouseMove(e){let t=this.mouseDownEvent;if(this.lastDrag=e,this.dragging)if(this._dragFollow(e),f.pauseDrag){let i=Number.isInteger(f.pauseDrag)?f.pauseDrag:100;this.dragTimeout&&window.clearTimeout(this.dragTimeout),this.dragTimeout=window.setTimeout(()=>this._callDrag(e),i)}else this._callDrag(e);else if(Math.abs(e.x-t.x)+Math.abs(e.y-t.y)>3){this.dragging=!0,f.dragElement=this;let i=this.el.gridstackNode?.grid;i?f.dropElement=i.el.ddElement.ddDroppable:delete f.dropElement,this.helper=this._createHelper(),this._setupHelperContainmentStyle(),this.dragTransform=h.getValuesFromTransformedElement(this.helperContainment),this.dragOffset=this._getDragOffset(e,this.el,this.helperContainment),this._setupHelperStyle(e);let s=h.initEvent(e,{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(e){if(document.removeEventListener("mousemove",this._mouseMove,!0),document.removeEventListener("mouseup",this._mouseUp,!0),k&&e.currentTarget&&(e.currentTarget.removeEventListener("touchmove",le,!0),e.currentTarget.removeEventListener("touchend",de,!0)),this.dragging){delete this.dragging,delete this.el.gridstackNode?._origRotate,document.removeEventListener("keydown",this._keyEvent),f.dropElement?.el===this.el.parentElement&&delete f.dropElement,this.helperContainment.style.position=this.parentOriginStylePosition||null,this.helper!==this.el&&this.helper.remove(),this._removeHelperStyle();let t=h.initEvent(e,{target:this.el,type:"dragstop"});this.option.stop&&this.option.stop(t),this.triggerEvent("dragstop",t),f.dropElement&&f.dropElement.drop(e)}delete this.helper,delete this.mouseDownEvent,delete f.dragElement,delete f.dropElement,delete f.mouseHandled,e.preventDefault()}_keyEvent(e){let t=this.el.gridstackNode,i=t?.grid||f.dropElement?.el?.gridstack;if(e.key==="Escape")t&&t._origRotate&&(t._orig=t._origRotate,delete t._origRotate),i?.cancelDrag(),this._mouseUp(this.mouseDownEvent);else if(t&&i&&(e.key==="r"||e.key==="R")){if(!h.canBeRotated(t))return;t._origRotate=t._origRotate||m({},t._orig),delete t._moving,i.setAnimation(!1).rotate(t.el,{top:-this.dragOffset.offsetTop,left:-this.dragOffset.offsetLeft}).setAnimation(),t._moving=!0,this.dragOffset=this._getDragOffset(this.lastDrag,t.el,this.helperContainment),this.helper.style.width=this.dragOffset.width+"px",this.helper.style.height=this.dragOffset.height+"px",h.swap(t._orig,"w","h"),delete t._rect,this._mouseMove(this.lastDrag)}}_createHelper(){let e=this.el;return typeof this.option.helper=="function"?e=this.option.helper(this.el):this.option.helper==="clone"&&(e=h.cloneNode(this.el)),e.parentElement||h.appendTo(e,this.option.appendTo==="parent"?this.el.parentElement:this.option.appendTo),this.dragElementOriginStyle=l.originStyleProp.map(t=>this.el.style[t]),e}_setupHelperStyle(e){this.helper.classList.add("ui-draggable-dragging"),this.el.gridstackNode?.grid?.el.classList.add("grid-stack-dragging");let t=this.helper.style;return t.pointerEvents="none",t.width=this.dragOffset.width+"px",t.height=this.dragOffset.height+"px",t.willChange="left, top",t.position="fixed",this._dragFollow(e),t.transition="none",setTimeout(()=>{this.helper&&(t.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 t=this.helper,i=this.dragElementOriginStyle.transition||null;t.style.transition=this.dragElementOriginStyle.transition="none",l.originStyleProp.forEach(s=>t.style[s]=this.dragElementOriginStyle[s]||null),setTimeout(()=>t.style.transition=i,50)}return delete this.dragElementOriginStyle,this}_dragFollow(e){let t={left:0,top:0},i=this.helper.style,s=this.dragOffset;i.left=(e.clientX+s.offsetLeft-t.left)*this.dragTransform.xScale+"px",i.top=(e.clientY+s.offsetTop-t.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(e,t,i){let s=0,r=0;i&&(s=this.dragTransform.xOffset,r=this.dragTransform.yOffset);let n=t.getBoundingClientRect();return{left:n.left,top:n.top,offsetLeft:-e.clientX+n.left-s,offsetTop:-e.clientY+n.top-r,width:n.width*this.dragTransform.xScale,height:n.height*this.dragTransform.yScale}}ui(){let t=this.el.parentElement.getBoundingClientRect(),i=this.helper.getBoundingClientRect();return{position:{top:(i.top-t.top)*this.dragTransform.yScale,left:(i.left-t.left)*this.dragTransform.xScale}}}}return l.originStyleProp=["width","height","transform","transform-origin","transition","pointerEvents","position","left","top","minWidth","willChange"],l})();var Be=class extends j{constructor(o,e={}){super(),this.el=o,this.option=e,this._mouseEnter=this._mouseEnter.bind(this),this._mouseLeave=this._mouseLeave.bind(this),this.enable(),this._setupAccept()}on(o,e){super.on(o,e)}off(o){super.off(o)}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),k&&(this.el.addEventListener("pointerenter",tt),this.el.addEventListener("pointerleave",it)))}disable(o=!1){this.disabled!==!0&&(super.disable(),this.el.classList.remove("ui-droppable"),o||this.el.classList.add("ui-droppable-disabled"),this.el.removeEventListener("mouseenter",this._mouseEnter),this.el.removeEventListener("mouseleave",this._mouseLeave),k&&(this.el.removeEventListener("pointerenter",tt),this.el.removeEventListener("pointerleave",it)))}destroy(){this.disable(!0),this.el.classList.remove("ui-droppable"),this.el.classList.remove("ui-droppable-disabled"),super.destroy()}updateOption(o){return Object.keys(o).forEach(e=>this.option[e]=o[e]),this._setupAccept(),this}_mouseEnter(o){if(!f.dragElement||D.touchHandled&&o.isTrusted||!this._canDrop(f.dragElement.el))return;o.preventDefault(),o.stopPropagation(),f.dropElement&&f.dropElement!==this&&f.dropElement._mouseLeave(o,!0),f.dropElement=this;let e=h.initEvent(o,{target:this.el,type:"dropover"});this.option.over&&this.option.over(e,this._ui(f.dragElement)),this.triggerEvent("dropover",e),this.el.classList.add("ui-droppable-over")}_mouseLeave(o,e=!1){if(!f.dragElement||f.dropElement!==this)return;o.preventDefault(),o.stopPropagation();let t=h.initEvent(o,{target:this.el,type:"dropout"});if(this.option.out&&this.option.out(t,this._ui(f.dragElement)),this.triggerEvent("dropout",t),f.dropElement===this&&(delete f.dropElement,!e)){let i,s=this.el.parentElement;for(;!i&&s;)i=s.ddElement?.ddDroppable,s=s.parentElement;i&&i._mouseEnter(o)}}drop(o){o.preventDefault();let e=h.initEvent(o,{target:this.el,type:"drop"});this.option.drop&&this.option.drop(e,this._ui(f.dragElement)),this.triggerEvent("drop",e)}_canDrop(o){return o&&(!this.accept||this.accept(o))}_setupAccept(){return this.option.accept?(typeof this.option.accept=="string"?this.accept=o=>o.classList.contains(this.option.accept)||o.matches(this.option.accept):this.accept=this.option.accept,this):this}_ui(o){return m({draggable:o.el},o.ui())}};var Ie=class l{static init(o){return o.ddElement||(o.ddElement=new l(o)),o.ddElement}constructor(o){this.el=o}on(o,e){return this.ddDraggable&&["drag","dragstart","dragstop"].indexOf(o)>-1?this.ddDraggable.on(o,e):this.ddDroppable&&["drop","dropover","dropout"].indexOf(o)>-1?this.ddDroppable.on(o,e):this.ddResizable&&["resizestart","resize","resizestop"].indexOf(o)>-1&&this.ddResizable.on(o,e),this}off(o){return this.ddDraggable&&["drag","dragstart","dragstop"].indexOf(o)>-1?this.ddDraggable.off(o):this.ddDroppable&&["drop","dropover","dropout"].indexOf(o)>-1?this.ddDroppable.off(o):this.ddResizable&&["resizestart","resize","resizestop"].indexOf(o)>-1&&this.ddResizable.off(o),this}setupDraggable(o){return this.ddDraggable?this.ddDraggable.updateOption(o):this.ddDraggable=new Gt(this.el,o),this}cleanDraggable(){return this.ddDraggable&&(this.ddDraggable.destroy(),delete this.ddDraggable),this}setupResizable(o){return this.ddResizable?this.ddResizable.updateOption(o):this.ddResizable=new Ft(this.el,o),this}cleanResizable(){return this.ddResizable&&(this.ddResizable.destroy(),delete this.ddResizable),this}setupDroppable(o){return this.ddDroppable?this.ddDroppable.updateOption(o):this.ddDroppable=new Be(this.el,o),this}cleanDroppable(){return this.ddDroppable&&(this.ddDroppable.destroy(),delete this.ddDroppable),this}};var Fe=class{resizable(o,e,t,i){return this._getDDElements(o,e).forEach(s=>{if(e==="disable"||e==="enable")s.ddResizable&&s.ddResizable[e]();else if(e==="destroy")s.ddResizable&&s.cleanResizable();else if(e==="option")s.setupResizable({[t]:i});else{let n=s.el.gridstackNode.grid,a=s.el.getAttribute("gs-resize-handles")||n.opts.resizable.handles||"e,s,se";a==="all"&&(a="n,e,s,w,se,sw,ne,nw");let u=!n.opts.alwaysShowResizeHandle;s.setupResizable(E(m({},n.opts.resizable),{handles:a,autoHide:u,start:e.start,stop:e.stop,resize:e.resize}))}}),this}draggable(o,e,t,i){return this._getDDElements(o,e).forEach(s=>{if(e==="disable"||e==="enable")s.ddDraggable&&s.ddDraggable[e]();else if(e==="destroy")s.ddDraggable&&s.cleanDraggable();else if(e==="option")s.setupDraggable({[t]:i});else{let r=s.el.gridstackNode.grid;s.setupDraggable(E(m({},r.opts.draggable),{start:e.start,stop:e.stop,drag:e.drag}))}}),this}dragIn(o,e){return this._getDDElements(o).forEach(t=>t.setupDraggable(e)),this}droppable(o,e,t,i){return typeof e.accept=="function"&&!e._accept&&(e._accept=e.accept,e.accept=s=>e._accept(s)),this._getDDElements(o,e).forEach(s=>{e==="disable"||e==="enable"?s.ddDroppable&&s.ddDroppable[e]():e==="destroy"?s.ddDroppable&&s.cleanDroppable():e==="option"?s.setupDroppable({[t]:i}):s.setupDroppable(e)}),this}isDroppable(o){return!!(o?.ddElement?.ddDroppable&&!o.ddElement.ddDroppable.disabled)}isDraggable(o){return!!(o?.ddElement?.ddDraggable&&!o.ddElement.ddDraggable.disabled)}isResizable(o){return!!(o?.ddElement?.ddResizable&&!o.ddElement.ddResizable.disabled)}on(o,e,t){return this._getDDElements(o).forEach(i=>i.on(e,s=>{t(s,f.dragElement?f.dragElement.el:s.target,f.dragElement?f.dragElement.helper:null)})),this}off(o,e){return this._getDDElements(o).forEach(t=>t.off(e)),this}_getDDElements(o,e){let t=o.gridstack||e!=="destroy"&&e!=="disable",i=h.getElements(o);return i.length?i.map(r=>r.ddElement||(t?Ie.init(r):null)).filter(r=>r):[]}};var R=new Fe,V=(()=>{class l{static init(e={},t=".grid-stack"){if(typeof document>"u")return null;let i=l.getGridElement(t);return i?(i.gridstack||(i.gridstack=new l(i,h.cloneDeep(e))),i.gridstack):(console.error(typeof t=="string"?'GridStack.initAll() no grid was found with selector "'+t+`" - element missing or wrong selector ?
|
|
2
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(e={},t=".grid-stack"){let i=[];return typeof document>"u"||(l.getGridElements(t).forEach(s=>{s.gridstack||(s.gridstack=new l(s,h.cloneDeep(e))),i.push(s.gridstack)}),i.length===0&&console.error('GridStack.initAll() no grid was found with selector "'+t+`" - element missing or wrong selector ?
|
|
3
3
|
Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the default selector.`)),i}static addGrid(e,t={}){if(!e)return null;let i=e;if(i.gridstack){let n=i.gridstack;return t&&(n.opts=m(m({},n.opts),t)),t.children!==void 0&&n.load(t.children),n}return(!e.classList.contains("grid-stack")||l.addRemoveCB)&&(l.addRemoveCB?i=l.addRemoveCB(e,t,!0,!0):i=h.createDiv(["grid-stack",t.class],e)),l.init(t,i)}static registerEngine(e){l.engineClass=e}get placeholder(){if(!this._placeholder){this._placeholder=h.createDiv([this.opts.placeholderClass,H.itemClass,this.opts.itemClass]);let e=h.createDiv(["placeholder-content"],this._placeholder);this.opts.placeholderText&&(e.textContent=this.opts.placeholderText)}return this._placeholder}constructor(e,t={}){this.el=e,this.opts=t,this.animationDelay=310,this._gsEventHandler={},this._extraDragRow=0,this.dragTransform={xScale:1,yScale:1,xOffset:0,yOffset:0},e.gridstack=this,this.opts=t=t||{},e.classList.contains("grid-stack")||this.el.classList.add("grid-stack"),t.row&&(t.minRow=t.maxRow=t.row,delete t.row);let i=h.toNumber(e.getAttribute("gs-row"));t.column==="auto"&&delete t.column,t.alwaysShowResizeHandle!==void 0&&(t._alwaysShowResizeHandle=t.alwaysShowResizeHandle);let s=t.columnOpts;if(s){let c=s.breakpoints;!s.columnWidth&&!c?.length?delete t.columnOpts:(s.columnMax=s.columnMax||12,c?.length>1&&c.sort((d,g)=>(g.w||0)-(d.w||0)))}let r=E(m({},h.cloneDeep(H)),{column:h.toNumber(e.getAttribute("gs-column"))||H.column,minRow:i||h.toNumber(e.getAttribute("gs-min-row"))||H.minRow,maxRow:i||h.toNumber(e.getAttribute("gs-max-row"))||H.maxRow,staticGrid:h.toBool(e.getAttribute("gs-static"))||H.staticGrid,sizeToContent:h.toBool(e.getAttribute("gs-size-to-content"))||void 0,draggable:{handle:(t.handleClass?"."+t.handleClass:t.handle?t.handle:"")||H.draggable.handle},removableOptions:{accept:t.itemClass||H.removableOptions.accept,decline:H.removableOptions.decline}});e.getAttribute("gs-animate")&&(r.animate=h.toBool(e.getAttribute("gs-animate"))),t=h.defaults(t,r),this._initMargin(),this.checkDynamicColumn(),this._updateColumnVar(t),t.rtl==="auto"&&(t.rtl=e.style.direction==="rtl"),t.rtl&&this.el.classList.add("grid-stack-rtl");let a=this.el.closest("."+H.itemClass)?.gridstackNode;if(a&&(a.subGrid=this,this.parentGridNode=a,this.el.classList.add("grid-stack-nested"),a.el.classList.add("grid-stack-sub-grid")),this._isAutoCellHeight=t.cellHeight==="auto",this._isAutoCellHeight||t.cellHeight==="initial")this.cellHeight(void 0);else{typeof t.cellHeight=="number"&&t.cellHeightUnit&&t.cellHeightUnit!==H.cellHeightUnit&&(t.cellHeight=t.cellHeight+t.cellHeightUnit,delete t.cellHeightUnit);let c=t.cellHeight;delete t.cellHeight,this.cellHeight(c)}t.alwaysShowResizeHandle==="mobile"&&(t.alwaysShowResizeHandle=k),this._setStaticClass();let u=t.engineClass||l.engineClass||et;if(this.engine=new u({column:this.getColumn(),float:t.float,maxRow:t.maxRow,onChange:c=>{c.forEach(d=>{let g=d.el;g&&(d._removeDOM?(g&&g.remove(),delete d._removeDOM):this._writePosAttr(g,d))}),this._updateContainerHeight()}}),t.auto&&(this.batchUpdate(),this.engine._loading=!0,this.getGridItems().forEach(c=>this._prepareElement(c)),delete this.engine._loading,this.batchUpdate(!1)),t.children){let c=t.children;delete t.children,c.length&&this.load(c)}this.setAnimation(),t.subGridDynamic&&!f.pauseDrag&&(f.pauseDrag=!0),t.draggable?.pause!==void 0&&(f.pauseDrag=t.draggable.pause),this._setupRemoveDrop(),this._setupAcceptWidget(),this._updateResizeEvent()}_updateColumnVar(e=this.opts){this.el.classList.add("gs-"+e.column),typeof e.column=="number"&&this.el.style.setProperty("--gs-column-width",`${100/e.column}%`)}addWidget(e){if(!e)return;if(typeof e=="string"){console.error("V11: GridStack.addWidget() does not support string anymore. see #2736");return}if(e.ELEMENT_NODE)return console.error("V11: GridStack.addWidget() does not support HTMLElement anymore. use makeWidget()"),this.makeWidget(e);let t,i=e;if(i.grid=this,i.el?t=i.el:l.addRemoveCB?t=l.addRemoveCB(this.el,e,!0,!1):t=this.createWidgetDivs(i),!t)return;if(i=t.gridstackNode,i&&t.parentElement===this.el&&this.engine.nodes.find(r=>r._id===i._id))return t;let s=this._readAttr(t);return h.defaults(e,s),this.engine.prepareNode(e),this.el.appendChild(t),this.makeWidget(t,e),t}createWidgetDivs(e){let t=h.createDiv(["grid-stack-item",this.opts.itemClass]),i=h.createDiv(["grid-stack-item-content"],t);return h.lazyLoad(e)?e.visibleObservable||(e.visibleObservable=new IntersectionObserver(([s])=>{s.isIntersecting&&(e.visibleObservable?.disconnect(),delete e.visibleObservable,l.renderCB(i,e),e.grid?.prepareDragDrop(e.el))}),window.setTimeout(()=>e.visibleObservable?.observe(t))):l.renderCB(i,e),t}makeSubGrid(e,t,i,s=!0){let r=e.gridstackNode;if(r||(r=this.makeWidget(e).gridstackNode),r.subGrid?.el)return r.subGrid;let n,a=this;for(;a&&!n;)n=a.opts?.subGridOpts,a=a.parentGridNode?.grid;t=h.cloneDeep(m(m(E(m({},this.opts),{id:void 0,children:void 0,column:"auto",columnOpts:void 0,layout:"list",subGridOpts:void 0}),n||{}),t||r.subGridOpts||{})),r.subGridOpts=t;let u;t.column==="auto"&&(u=!0,t.column=Math.max(r.w||1,i?.w||1),delete t.columnOpts);let c=r.el.querySelector(".grid-stack-item-content"),d,g;if(s&&(this._removeDD(r.el),g=E(m({},r),{x:0,y:0}),h.removeInternalForSave(g),delete g.subGridOpts,r.content&&(g.content=r.content,delete r.content),l.addRemoveCB?d=l.addRemoveCB(this.el,g,!0,!1):(d=h.createDiv(["grid-stack-item"]),d.appendChild(c),c=h.createDiv(["grid-stack-item-content"],r.el)),this.prepareDragDrop(r.el)),i){let w=u?t.column:r.w,C=r.h+i.h,T=r.el.style;T.transition="none",this.update(r.el,{w,h:C}),setTimeout(()=>T.transition=null)}let p=r.subGrid=l.addGrid(c,t);return i?._moving&&(p._isTemp=!0),u&&(p._autoColumn=!0),s&&p.makeWidget(d,g),i&&(i._moving?window.setTimeout(()=>h.simulateMouseEvent(i._event,"mouseenter",p.el),0):p.makeWidget(r.el,r)),this.resizeToContentCheck(!1,r),p}removeAsSubGrid(e){let t=this.parentGridNode?.grid;t&&(t.batchUpdate(),t.removeWidget(this.parentGridNode.el,!0,!0),this.engine.nodes.forEach(i=>{i.x+=this.parentGridNode.x,i.y+=this.parentGridNode.y,t.makeWidget(i.el,i)}),t.batchUpdate(!1),this.parentGridNode&&delete this.parentGridNode.subGrid,delete this.parentGridNode,e&&window.setTimeout(()=>h.simulateMouseEvent(e._event,"mouseenter",t.el),0))}save(e=!0,t=!1,i=l.saveCB,s){let r=this.engine.save(e,i,s);if(r.forEach(n=>{if(e&&n.el&&!n.subGrid&&!i){let a=n.el.querySelector(".grid-stack-item-content");n.content=a?.innerHTML,n.content||delete n.content}else if(!e&&!i&&delete n.content,n.subGrid?.el){let a=n.w||n.subGrid.getColumn(),u=n.subGrid.save(e,t,i,a);n.subGridOpts=t?u:{children:u},delete n.subGrid}delete n.el}),t){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 a=n._alwaysShowResizeHandle;return delete n._alwaysShowResizeHandle,a!==void 0?n.alwaysShowResizeHandle=a:delete n.alwaysShowResizeHandle,h.removeInternalAndSame(n,H),n.children=r,n}return r}load(e,t=l.addRemoveCB||!0){e=h.cloneDeep(e);let i=this.getColumn();e.forEach(d=>{d.w=d.w||d.minW||1,d.h=d.h||d.minH||1}),e=h.sort(e),this.engine.skipCacheUpdate=this._ignoreLayoutsNodeChange=!0;let s=0;e.forEach(d=>{s=Math.max(s,(d.x||0)+d.w)}),s>this.engine.defaultColumn&&(this.engine.defaultColumn=s),s>i&&(this.engine.nodes.length===0&&this.responseLayout?(this.engine.nodes=e,this.engine.columnChanged(s,i,this.responseLayout),e=this.engine.nodes,this.engine.nodes=[],delete this.responseLayout):this.engine.cacheLayout(e,s,!0));let r=l.addRemoveCB;typeof t=="function"&&(l.addRemoveCB=t);let n=[];this.batchUpdate();let a=!this.engine.nodes.length,u=a&&this.opts.animate;u&&this.setAnimation(!1),!a&&t&&[...this.engine.nodes].forEach(g=>{if(!g.id)return;h.find(e,g.id)||(l.addRemoveCB&&l.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(d=>h.find(e,d.id)?(c.push(d),!1):!0),e.forEach(d=>{let g=h.find(c,d.id);if(g){if(h.shouldSizeToContent(g)&&(d.h=g.h),this.engine.nodeBoundFix(d),(d.autoPosition||d.x===void 0||d.y===void 0)&&(d.w=d.w||g.w,d.h=d.h||g.h,this.engine.findEmptyPosition(d)),this.engine.nodes.push(g),h.samePos(g,d)&&this.engine.nodes.length>1&&(this.moveNode(g,E(m({},d),{forceCollide:!0})),h.copyPos(d,g)),this.update(g.el,d),d.subGridOpts?.children){let p=g.el.querySelector(".grid-stack");p&&p.gridstack&&p.gridstack.load(d.subGridOpts.children)}}else t&&this.addWidget(d)}),delete this.engine._loading,this.engine.removedNodes=n,this.batchUpdate(!1),delete this._ignoreLayoutsNodeChange,delete this.engine.skipCacheUpdate,r?l.addRemoveCB=r:delete l.addRemoveCB,u&&this.setAnimation(!0,!0),this}batchUpdate(e=!0){return this.engine.batchUpdate(e),e||(this._updateContainerHeight(),this._triggerRemoveEvent(),this._triggerAddEvent(),this._triggerChangeEvent()),this}getCellHeight(e=!1){if(this.opts.cellHeight&&this.opts.cellHeight!=="auto"&&(!e||!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 t=this.el.querySelector("."+this.opts.itemClass);if(t){let s=h.toNumber(t.getAttribute("gs-h"))||1;return Math.round(t.offsetHeight/s)}let i=parseInt(this.el.getAttribute("gs-current-row"));return i?Math.round(this.el.getBoundingClientRect().height/i):this.opts.cellHeight}cellHeight(e){if(e!==void 0&&this._isAutoCellHeight!==(e==="auto")&&(this._isAutoCellHeight=e==="auto",this._updateResizeEvent()),(e==="initial"||e==="auto")&&(e=void 0),e===void 0){let i=-this.opts.marginRight-this.opts.marginLeft+this.opts.marginTop+this.opts.marginBottom;e=this.cellWidth()+i}let t=h.parseHeight(e);return this.opts.cellHeightUnit===t.unit&&this.opts.cellHeight===t.h?this:(this.opts.cellHeightUnit=t.unit,this.opts.cellHeight=t.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(e=!1){return e&&this.opts.columnOpts?.breakpointForWindow?window.innerWidth:this.el.clientWidth||this.el.parentElement.clientWidth||window.innerWidth}checkDynamicColumn(){let e=this.opts.columnOpts;if(!e||!e.columnWidth&&!e.breakpoints?.length)return!1;let t=this.getColumn(),i=t,s=this._widthOrContainer(!0);if(e.columnWidth)i=Math.min(Math.round(s/e.columnWidth)||1,e.columnMax);else{i=e.columnMax;let r=0;for(;r<e.breakpoints.length&&s<=e.breakpoints[r].w;)i=e.breakpoints[r++].c||t}if(i!==t){let r=e.breakpoints?.find(n=>n.c===i);return this.column(i,r?.layout||e.layout),!0}return!1}compact(e="compact",t=!0){return this.engine.compact(e,t),this._triggerChangeEvent(),this}column(e,t="moveScale"){if(!e||e<1||this.opts.column===e)return this;let i=this.getColumn();return this.opts.column=e,this.engine?(this.engine.column=e,this.el.classList.remove("gs-"+i),this._updateColumnVar(),this.engine.columnChanged(i,e,t),this._isAutoCellHeight&&this.cellHeight(),this.resizeToContentCheck(!0),this._ignoreLayoutsNodeChange=!0,this._triggerChangeEvent(),delete this._ignoreLayoutsNodeChange,this):(this.responseLayout=t,this)}getColumn(){return this.opts.column}getGridItems(){return Array.from(this.el.children).filter(e=>e.matches("."+this.opts.itemClass)&&!e.matches("."+this.opts.placeholderClass))}isIgnoreChangeCB(){return this._ignoreLayoutsNodeChange}destroy(e=!0){if(this.el)return this.offAll(),this._updateResizeEvent(!0),this.setStatic(!0,!1),this.setAnimation(!1),e?this.el.parentNode.removeChild(this.el):(this.removeAll(e),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(e){return this.opts.float!==e&&(this.opts.float=this.engine.float=e,this._triggerChangeEvent()),this}getFloat(){return this.engine.float}getCellFromPixel(e,t=!1){let i=this.el.getBoundingClientRect(),s;t?s={top:i.top+document.documentElement.scrollTop,left:i.left}:s={top:this.el.offsetTop,left:this.el.offsetLeft};let r=e.left-s.left,n=e.top-s.top,a=i.width/this.getColumn(),u=i.height/parseInt(this.el.getAttribute("gs-current-row"));return{x:Math.floor(r/a),y:Math.floor(n/u)}}getRow(){return Math.max(this.engine.getRow(),this.opts.minRow||0)}isAreaEmpty(e,t,i,s){return this.engine.isAreaEmpty(e,t,i,s)}makeWidget(e,t){let i=l.getElement(e);if(!i||i.gridstackNode)return i;i.parentElement||this.el.appendChild(i),this._prepareElement(i,!0,t);let s=i.gridstackNode;this._updateContainerHeight(),s.subGridOpts&&this.makeSubGrid(i,s.subGridOpts,void 0,!1);let r;return this.opts.column===1&&!this._ignoreLayoutsNodeChange&&(r=this._ignoreLayoutsNodeChange=!0),this._triggerAddEvent(),this._triggerChangeEvent(),r&&delete this._ignoreLayoutsNodeChange,i}on(e,t){return e.indexOf(" ")!==-1?(e.split(" ").forEach(s=>this.on(s,t)),this):(e==="change"||e==="added"||e==="removed"||e==="enable"||e==="disable"?(e==="enable"||e==="disable"?this._gsEventHandler[e]=s=>t(s):this._gsEventHandler[e]=s=>{s.detail&&t(s,s.detail)},this.el.addEventListener(e,this._gsEventHandler[e])):e==="drag"||e==="dragstart"||e==="dragstop"||e==="resizestart"||e==="resize"||e==="resizestop"||e==="dropped"||e==="resizecontent"?this._gsEventHandler[e]=t:console.error("GridStack.on("+e+") event not supported"),this)}off(e){return e.indexOf(" ")!==-1?(e.split(" ").forEach(i=>this.off(i)),this):((e==="change"||e==="added"||e==="removed"||e==="enable"||e==="disable")&&this._gsEventHandler[e]&&this.el.removeEventListener(e,this._gsEventHandler[e]),delete this._gsEventHandler[e],this)}offAll(){return Object.keys(this._gsEventHandler).forEach(e=>this.off(e)),this}removeWidget(e,t=!0,i=!0){return e?(l.getElements(e).forEach(s=>{if(s.parentElement&&s.parentElement!==this.el)return;let r=s.gridstackNode;r||(r=this.engine.nodes.find(n=>s===n.el)),r&&(t&&l.addRemoveCB&&l.addRemoveCB(this.el,r,!1,!1),delete s.gridstackNode,this._removeDD(s),this.engine.removeNode(r,t,i),t&&s.parentElement&&s.remove())}),i&&(this._triggerRemoveEvent(),this._triggerChangeEvent()),this):(console.error("Error: GridStack.removeWidget(undefined) called"),this)}removeAll(e=!0,t=!0){return this.engine.nodes.forEach(i=>{e&&l.addRemoveCB&&l.addRemoveCB(this.el,i,!1,!1),delete i.el.gridstackNode,this.opts.staticGrid||this._removeDD(i.el)}),this.engine.removeAll(e,t),t&&this._triggerRemoveEvent(),this}setAnimation(e=this.opts.animate,t){return t?setTimeout(()=>{this.opts&&this.setAnimation(e)}):e?this.el.classList.add("grid-stack-animate"):this.el.classList.remove("grid-stack-animate"),this.opts.animate=e,this}hasAnimationCSS(){return this.el.classList.contains("grid-stack-animate")}setStatic(e,t=!0,i=!0){return!!this.opts.staticGrid===e?this:(e?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(e,t,i)}),t&&this._setStaticClass(),this)}updateOptions(e){let t=this.opts;return e===t?this:(e.acceptWidgets!==void 0&&(t.acceptWidgets=e.acceptWidgets,this._setupAcceptWidget()),e.animate!==void 0&&this.setAnimation(e.animate),e.cellHeight&&this.cellHeight(e.cellHeight),e.class!==void 0&&e.class!==t.class&&(t.class&&this.el.classList.remove(t.class),e.class&&this.el.classList.add(e.class)),e.columnOpts?(this.opts.columnOpts=e.columnOpts,this.checkDynamicColumn()):e.columnOpts===null&&this.opts.columnOpts?(delete this.opts.columnOpts,this._updateResizeEvent()):typeof e.column=="number"&&this.column(e.column),e.margin!==void 0&&this.margin(e.margin),e.staticGrid!==void 0&&this.setStatic(e.staticGrid),e.disableDrag!==void 0&&!e.staticGrid&&this.enableMove(!e.disableDrag),e.disableResize!==void 0&&!e.staticGrid&&this.enableResize(!e.disableResize),e.float!==void 0&&this.float(e.float),e.row!==void 0?(t.minRow=t.maxRow=t.row=e.row,this._updateContainerHeight()):(e.minRow!==void 0&&(t.minRow=e.minRow,this._updateContainerHeight()),e.maxRow!==void 0&&(t.maxRow=e.maxRow)),e.lazyLoad!==void 0&&(t.lazyLoad=e.lazyLoad),e.children?.length&&this.load(e.children),this)}update(e,t){return l.getElements(e).forEach(i=>{let s=i?.gridstackNode;if(!s)return;let r=m(m({},h.copyPos({},s)),h.cloneDeep(t));this.engine.nodeBoundFix(r),delete r.autoPosition;let n=["x","y","w","h"],a;if(n.some(d=>r[d]!==void 0&&r[d]!==s[d])&&(a={},n.forEach(d=>{a[d]=r[d]!==void 0?r[d]:s[d],delete r[d]})),!a&&(r.minW||r.minH||r.maxW||r.maxH)&&(a={}),r.content!==void 0){let d=i.querySelector(".grid-stack-item-content");d&&d.textContent!==r.content&&(s.content=r.content,l.renderCB(d,r),s.subGrid?.el&&(d.appendChild(s.subGrid.el),s.subGrid._updateContainerHeight())),delete r.content}let u=!1,c=!1;for(let d in r)d[0]!=="_"&&s[d]!==r[d]&&(s[d]=r[d],u=!0,c=c||!this.opts.staticGrid&&(d==="noResize"||d==="noMove"||d==="locked"));if(h.sanitizeMinMax(s),a){let d=a.w!==void 0&&a.w!==s.w;this.moveNode(s,a),d&&s.subGrid?s.subGrid.onResize(this.hasAnimationCSS()?s.w:void 0):this.resizeToContentCheck(d,s),delete s._orig}(a||u)&&this._writeAttr(i,s),c&&this.prepareDragDrop(s.el),l.updateCB&&l.updateCB(s)}),this}moveNode(e,t){let i=e._updating;i||this.engine.cleanNodes().beginUpdate(e),this.engine.moveNode(e,t),this._updateContainerHeight(),i||(this._triggerChangeEvent(),this.engine.endUpdate())}resizeToContent(e){if(!e||(e.classList.remove("size-to-content-max"),!e.clientHeight))return;let t=e.gridstackNode;if(!t)return;let i=t.grid;if(!i||e.parentElement!==i.el)return;let s=i.getCellHeight(!0);if(!s)return;let r=t.h?t.h*s:e.clientHeight,n;if(t.resizeToContentParent&&(n=e.querySelector(t.resizeToContentParent)),n||(n=e.querySelector(l.resizeToContentParent)),!n)return;let a=e.clientHeight-n.clientHeight,u=t.h?t.h*s-a:n.clientHeight,c;if(t.subGrid){c=t.subGrid.getRow()*t.subGrid.getCellHeight(!0);let p=t.subGrid.el.getBoundingClientRect(),w=e.getBoundingClientRect();c+=p.top-w.top}else{if(t.subGridOpts?.children?.length)return;{let p=n.firstElementChild;if(!p){console.error(`Error: GridStack.resizeToContent() widget id:${t.id} '${l.resizeToContentParent}'.firstElementChild is null, make sure to have a div like container. Skipping sizing.`);return}c=p.getBoundingClientRect().height||u}}if(u===c)return;r+=c-u;let d=Math.ceil(r/s),g=Number.isInteger(t.sizeToContent)?t.sizeToContent:0;g&&d>g&&(d=g,e.classList.add("size-to-content-max")),t.minH&&d<t.minH?d=t.minH:t.maxH&&d>t.maxH&&(d=t.maxH),d!==t.h&&(i._ignoreLayoutsNodeChange=!0,i.moveNode(t,{h:d}),delete i._ignoreLayoutsNodeChange)}resizeToContentCBCheck(e){l.resizeToContentCB?l.resizeToContentCB(e):this.resizeToContent(e)}rotate(e,t){return l.getElements(e).forEach(i=>{let s=i.gridstackNode;if(!h.canBeRotated(s))return;let r={w:s.h,h:s.w,minH:s.minW,minW:s.minH,maxH:s.maxW,maxW:s.maxH};if(t){let a=t.left>0?Math.floor(t.left/this.cellWidth()):0,u=t.top>0?Math.floor(t.top/this.opts.cellHeight):0;r.x=s.x+a-(s.h-(u+1)),r.y=s.y+u-a}Object.keys(r).forEach(a=>{r[a]===void 0&&delete r[a]});let n=s._orig;this.update(i,r),s._orig=n}),this}margin(e){if(!(typeof e=="string"&&e.split(" ").length>1)){let i=h.parseHeight(e);if(this.opts.marginUnit===i.unit&&this.opts.margin===i.h)return}return this.opts.margin=e,this.opts.marginTop=this.opts.marginBottom=this.opts.marginLeft=this.opts.marginRight=void 0,this._initMargin(),this}getMargin(){return this.opts.margin}willItFit(e){return this.engine.willItFit(e)}_triggerChangeEvent(){if(this.engine.batchMode)return this;let e=this.engine.getDirtyNodes(!0);return e&&e.length&&(this._ignoreLayoutsNodeChange||this.engine.layoutsNodesChange(e),this._triggerEvent("change",e)),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(t=>{delete t._dirty});let e=[...this.engine.addedNodes];this.engine.addedNodes=[],this._triggerEvent("added",e)}return this}_triggerRemoveEvent(){if(this.engine.batchMode)return this;if(this.engine.removedNodes?.length){let e=[...this.engine.removedNodes];this.engine.removedNodes=[],this._triggerEvent("removed",e)}return this}_triggerEvent(e,t){let i=t?new CustomEvent(e,{bubbles:!1,detail:t}):new Event(e),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 e=this.parentGridNode,t=this.getRow()+this._extraDragRow,i=this.opts.cellHeight,s=this.opts.cellHeightUnit;if(!i)return this;if(!e&&!this.opts.minRow){let r=h.parseHeight(getComputedStyle(this.el).minHeight);if(r.h>0&&r.unit===s){let n=Math.floor(r.h/i);t<n&&(t=n)}}return this.el.setAttribute("gs-current-row",String(t)),this.el.style.removeProperty("min-height"),this.el.style.removeProperty("height"),t&&(this.el.style[e?"minHeight":"height"]=t*i+s),e&&h.shouldSizeToContent(e)&&e.grid.resizeToContentCBCheck(e.el),this}_prepareElement(e,t=!1,i){i=i||this._readAttr(e),e.gridstackNode=i,i.el=e,i.grid=this,i=this.engine.addNode(i,t),this._writeAttr(e,i),e.classList.add(H.itemClass,this.opts.itemClass);let s=h.shouldSizeToContent(i);return s?e.classList.add("size-to-content"):e.classList.remove("size-to-content"),s&&this.resizeToContentCheck(!1,i),h.lazyLoad(i)||this.prepareDragDrop(i.el),this}_writePosAttr(e,t){return(!t._moving&&!t._resizing||this._placeholder===e)&&(e.style.top=t.y?t.y===1?"var(--gs-cell-height)":`calc(${t.y} * var(--gs-cell-height))`:null,e.style.left=t.x?t.x===1?"var(--gs-column-width)":`calc(${t.x} * var(--gs-column-width))`:null,e.style.width=t.w>1?`calc(${t.w} * var(--gs-column-width))`:null,e.style.height=t.h>1?`calc(${t.h} * var(--gs-cell-height))`:null),e.setAttribute("gs-x",String(t.x)),e.setAttribute("gs-y",String(t.y)),t.w>1?e.setAttribute("gs-w",String(t.w)):e.removeAttribute("gs-w"),t.h>1?e.setAttribute("gs-h",String(t.h)):e.removeAttribute("gs-h"),this}_writeAttr(e,t){if(!t)return this;this._writePosAttr(e,t);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)t[s]?e.setAttribute(i[s],String(t[s])):e.removeAttribute(i[s]);return this}_readAttr(e,t=!0){let i={};i.x=h.toNumber(e.getAttribute("gs-x")),i.y=h.toNumber(e.getAttribute("gs-y")),i.w=h.toNumber(e.getAttribute("gs-w")),i.h=h.toNumber(e.getAttribute("gs-h")),i.autoPosition=h.toBool(e.getAttribute("gs-auto-position")),i.noResize=h.toBool(e.getAttribute("gs-no-resize")),i.noMove=h.toBool(e.getAttribute("gs-no-move")),i.locked=h.toBool(e.getAttribute("gs-locked"));let s=e.getAttribute("gs-size-to-content");s&&(s==="true"||s==="false"?i.sizeToContent=h.toBool(s):i.sizeToContent=parseInt(s,10)),i.id=e.getAttribute("gs-id"),i.maxW=h.toNumber(e.getAttribute("gs-max-w")),i.minW=h.toNumber(e.getAttribute("gs-min-w")),i.maxH=h.toNumber(e.getAttribute("gs-max-h")),i.minH=h.toNumber(e.getAttribute("gs-min-h")),t&&(i.w===1&&e.removeAttribute("gs-w"),i.h===1&&e.removeAttribute("gs-h"),i.maxW&&e.removeAttribute("gs-max-w"),i.minW&&e.removeAttribute("gs-min-w"),i.maxH&&e.removeAttribute("gs-max-h"),i.minH&&e.removeAttribute("gs-min-h"));for(let r in i){if(!i.hasOwnProperty(r))return;!i[r]&&i[r]!==0&&r!=="sizeToContent"&&delete i[r]}return i}_setStaticClass(){let e=["grid-stack-static"];return this.opts.staticGrid?(this.el.classList.add(...e),this.el.setAttribute("gs-static","true")):(this.el.classList.remove(...e),this.el.removeAttribute("gs-static")),this}onResize(e=this.el?.clientWidth){if(!e||this.prevWidth===e)return;this.prevWidth=e,this.batchUpdate();let t=!1;return this._autoColumn&&this.parentGridNode?this.opts.column!==this.parentGridNode.w&&(this.column(this.parentGridNode.w,this.opts.layout||"list"),t=!0):t=this.checkDynamicColumn(),this._isAutoCellHeight&&this.cellHeight(),this.engine.nodes.forEach(i=>{i.subGrid&&i.subGrid.onResize()}),this._skipInitialResize||this.resizeToContentCheck(t),delete this._skipInitialResize,this.batchUpdate(!1),this}resizeToContentCheck(e=!1,t=void 0){if(this.engine){if(e&&this.hasAnimationCSS())return setTimeout(()=>this.resizeToContentCheck(!1,t),this.animationDelay);if(t)h.shouldSizeToContent(t)&&this.resizeToContentCBCheck(t.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,t?[t]:this.engine.nodes)}}_updateResizeEvent(e=!1){let t=!this.parentGridNode&&(this._isAutoCellHeight||this.opts.sizeToContent||this.opts.columnOpts||this.engine.nodes.find(i=>i.sizeToContent));return!e&&t&&!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):(e||!t)&&this.resizeObserver&&(this.resizeObserver.disconnect(),delete this.resizeObserver,delete this._sizeThrottle),this}static getElement(e=".grid-stack-item"){return h.getElement(e)}static getElements(e=".grid-stack-item"){return h.getElements(e)}static getGridElement(e){return l.getElement(e)}static getGridElements(e){return h.getElements(e)}_initMargin(){let e,t=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]):(e=h.parseHeight(this.opts.margin),this.opts.marginUnit=e.unit,t=this.opts.margin=e.h),["marginTop","marginRight","marginBottom","marginLeft"].forEach(n=>{this.opts[n]===void 0?this.opts[n]=t:(e=h.parseHeight(this.opts[n]),this.opts[n]=e.h,delete this.opts.margin)}),this.opts.marginUnit=e.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 r=this.el.style;return r.setProperty("--gs-item-margin-top",`${this.opts.marginTop}${this.opts.marginUnit}`),r.setProperty("--gs-item-margin-bottom",`${this.opts.marginBottom}${this.opts.marginUnit}`),r.setProperty("--gs-item-margin-right",`${this.opts.marginRight}${this.opts.marginUnit}`),r.setProperty("--gs-item-margin-left",`${this.opts.marginLeft}${this.opts.marginUnit}`),this}static getDD(){return R}static setupDragIn(e,t,i,s=document){t?.pause!==void 0&&(f.pauseDrag=t.pause),t=m({appendTo:"body",helper:"clone"},t||{}),(typeof e=="string"?h.getElements(e,s):e).forEach((n,a)=>{R.isDraggable(n)||R.dragIn(n,t),i?.[a]&&(n.gridstackNode=i[a])})}movable(e,t){return this.opts.staticGrid?this:(l.getElements(e).forEach(i=>{let s=i.gridstackNode;s&&(t?delete s.noMove:s.noMove=!0,this.prepareDragDrop(s.el))}),this)}resizable(e,t){return this.opts.staticGrid?this:(l.getElements(e).forEach(i=>{let s=i.gridstackNode;s&&(t?delete s.noResize:s.noResize=!0,this.prepareDragDrop(s.el))}),this)}disable(e=!0){if(!this.opts.staticGrid)return this.enableMove(!1,e),this.enableResize(!1,e),this._triggerEvent("disable"),this}enable(e=!0){if(!this.opts.staticGrid)return this.enableMove(!0,e),this.enableResize(!0,e),this._triggerEvent("enable"),this}enableMove(e,t=!0){return this.opts.staticGrid?this:(e?delete this.opts.disableDrag:this.opts.disableDrag=!0,this.engine.nodes.forEach(i=>{this.prepareDragDrop(i.el),i.subGrid&&t&&i.subGrid.enableMove(e,t)}),this)}enableResize(e,t=!0){return this.opts.staticGrid?this:(e?delete this.opts.disableResize:this.opts.disableResize=!0,this.engine.nodes.forEach(i=>{this.prepareDragDrop(i.el),i.subGrid&&t&&i.subGrid.enableResize(e,t)}),this)}cancelDrag(){let e=this._placeholder?.gridstackNode;e&&(e._isExternal?(e._isAboutToRemove=!0,this.engine.removeNode(e)):e._isAboutToRemove&&l._itemRemoving(e.el,!1),this.engine.restoreInitial())}_removeDD(e){return R.draggable(e,"destroy").resizable(e,"destroy"),e.gridstackNode&&delete e.gridstackNode._initDD,delete e.ddElement,this}_setupAcceptWidget(){if(this.opts.staticGrid||!this.opts.acceptWidgets&&!this.opts.removable)return R.droppable(this.el,"destroy"),this;let e,t,i=(s,r,n)=>{n=n||r;let a=n.gridstackNode;if(!a)return;if(!a.grid?.el){n.style.transform=`scale(${1/this.dragTransform.xScale},${1/this.dragTransform.yScale})`;let p=n.getBoundingClientRect();n.style.left=p.x+(this.dragTransform.xScale-1)*(s.clientX-p.x)/this.dragTransform.xScale+"px",n.style.top=p.y+(this.dragTransform.yScale-1)*(s.clientY-p.y)/this.dragTransform.yScale+"px",n.style.transformOrigin="0px 0px"}let{top:u,left:c}=n.getBoundingClientRect(),d=this.el.getBoundingClientRect();c-=d.left,u-=d.top;let g={position:{top:u*this.dragTransform.xScale,left:c*this.dragTransform.yScale}};if(a._temporaryRemoved){if(a.x=Math.max(0,Math.round(c/t)),a.y=Math.max(0,Math.round(u/e)),delete a.autoPosition,this.engine.nodeBoundFix(a),!this.engine.willItFit(a)){if(a.autoPosition=!0,!this.engine.willItFit(a)){R.off(r,"drag");return}a._willFitPos&&(h.copyPos(a,a._willFitPos),delete a._willFitPos)}this._onStartMoving(n,s,g,a,t,e)}else this._dragOrResize(n,s,g,a,t,e)};return R.droppable(this.el,{accept:s=>{let r=s.gridstackNode||this._readAttr(s,!1);if(r?.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 a=this.opts.acceptWidgets===!0?".grid-stack-item":this.opts.acceptWidgets;n=s.matches(a)}if(n&&r&&this.opts.maxRow){let a={w:r.w,h:r.h,minW:r.minW,minH:r.minH};n=this.engine.willItFit(a)}return n}}).on(this.el,"dropover",(s,r,n)=>{let a=n?.gridstackNode||r.gridstackNode;if(a?.grid===this&&!a._temporaryRemoved)return!1;if(a?._sidebarOrig&&(a.w=a._sidebarOrig.w,a.h=a._sidebarOrig.h),a?.grid&&a.grid!==this&&!a._temporaryRemoved&&a.grid._leave(r,n),n=n||r,t=this.cellWidth(),e=this.getCellHeight(!0),!a){let d=n.getAttribute("data-gs-widget")||n.getAttribute("gridstacknode");if(d){try{a=JSON.parse(d)}catch(g){console.error("Gridstack dropover: Bad JSON format: ",d)}n.removeAttribute("data-gs-widget"),n.removeAttribute("gridstacknode")}a||(a=this._readAttr(n)),a._sidebarOrig={w:a.w,h:a.h}}a.grid||(a.el||(a=m({},a)),a._isExternal=!0,n.gridstackNode=a);let u=a.w||Math.round(n.offsetWidth/t)||1,c=a.h||Math.round(n.offsetHeight/e)||1;return a.grid&&a.grid!==this?(r._gridstackNodeOrig||(r._gridstackNodeOrig=a),r.gridstackNode=a=E(m({},a),{w:u,h:c,grid:this}),delete a.x,delete a.y,this.engine.cleanupNode(a).nodeBoundFix(a),a._initDD=a._isExternal=a._temporaryRemoved=!0):(a.w=u,a.h=c,a._temporaryRemoved=!0),l._itemRemoving(a.el,!1),R.on(r,"drag",i),i(s,r,n),!1}).on(this.el,"dropout",(s,r,n)=>{let a=n?.gridstackNode||r.gridstackNode;return a&&(!a.grid||a.grid===this)&&(this._leave(r,n),this._isTemp&&this.removeAsSubGrid(a)),!1}).on(this.el,"drop",(s,r,n)=>{let a=n?.gridstackNode||r.gridstackNode;if(a?.grid===this&&!a._isExternal)return!1;let u=!!this.placeholder.parentElement,c=r!==n;this.placeholder.remove(),delete this.placeholder.gridstackNode,u&&this.opts.animate&&(this.setAnimation(!1),this.setAnimation(!0,!0));let d=r._gridstackNodeOrig;if(delete r._gridstackNodeOrig,u&&d?.grid&&d.grid!==this){let p=d.grid;p.engine.removeNodeFromLayoutCache(d),p.engine.removedNodes.push(d),p._triggerRemoveEvent()._triggerChangeEvent(),p.parentGridNode&&!p.engine.nodes.length&&p.opts.subGridDynamic&&p.removeAsSubGrid()}if(!a||(u&&(this.engine.cleanupNode(a),a.grid=this),delete a.grid?._isTemp,R.off(r,"drag"),n!==r?(n.remove(),r=n):r.remove(),this._removeDD(r),!u))return!1;let g=a.subGrid?.el?.gridstack;return h.copyPos(a,this._readAttr(this.placeholder)),h.removePositioningStyles(r),c&&(a.content||a.subGridOpts||l.addRemoveCB)?(delete a.el,r=this.addWidget(a)):(this._prepareElement(r,!0,a),this.el.appendChild(r),this.resizeToContentCheck(!1,a),g&&(g.parentGridNode=a),this._updateContainerHeight()),this.engine.addedNodes.push(a),this._triggerAddEvent(),this._triggerChangeEvent(),this.engine.endUpdate(),this._gsEventHandler.dropped&&this._gsEventHandler.dropped(E(m({},s),{type:"dropped"}),d&&d.grid?d:void 0,a),!1}),this}static _itemRemoving(e,t){if(!e)return;let i=e?e.gridstackNode:void 0;!i?.grid||e.classList.contains(i.grid.opts.removableOptions.decline)||(t?i._isAboutToRemove=!0:delete i._isAboutToRemove,t?e.classList.add("grid-stack-item-removing"):e.classList.remove("grid-stack-item-removing"))}_setupRemoveDrop(){if(typeof this.opts.removable!="string")return this;let e=document.querySelector(this.opts.removable);return e?(!this.opts.staticGrid&&!R.isDroppable(e)&&R.droppable(e,this.opts.removableOptions).on(e,"dropover",(t,i)=>l._itemRemoving(i,!0)).on(e,"dropout",(t,i)=>l._itemRemoving(i,!1)),this):this}prepareDragDrop(e,t=!1){let i=e?.gridstackNode;if(!i)return;let s=i.noMove||this.opts.disableDrag,r=i.noResize||this.opts.disableResize,n=this.opts.staticGrid||s&&r;if((t||n)&&(i._initDD&&(this._removeDD(e),delete i._initDD),n&&e.classList.add("ui-draggable-disabled","ui-resizable-disabled"),!t))return this;if(!i._initDD){let a,u,c=(p,w)=>{this.triggerEvent(p,p.target),a=this.cellWidth(),u=this.getCellHeight(!0),this._onStartMoving(e,p,w,i,a,u)},d=(p,w)=>{this._dragOrResize(e,p,w,i,a,u)},g=p=>{this.placeholder.remove(),delete this.placeholder.gridstackNode,delete i._moving,delete i._resizing,delete i._event,delete i._lastTried;let w=i.w!==i._orig.w,C=p.target;if(!(!C.gridstackNode||C.gridstackNode.grid!==this)){if(i.el=C,i._isAboutToRemove){let T=e.gridstackNode.grid;T._gsEventHandler[p.type]&&T._gsEventHandler[p.type](p,C),T.engine.nodes.push(i),T.removeWidget(e,!0,!0)}else h.removePositioningStyles(C),i._temporaryRemoved?(this._writePosAttr(C,i),this.engine.addNode(i)):this._writePosAttr(C,i),this.triggerEvent(p,C);this._extraDragRow=0,this._updateContainerHeight(),this._triggerChangeEvent(),this.engine.endUpdate(),p.type==="resizestop"&&(Number.isInteger(i.sizeToContent)&&(i.sizeToContent=i.h),this.resizeToContentCheck(w,i))}};R.draggable(e,{start:c,stop:g,drag:d}).resizable(e,{start:c,stop:g,resize:d}),i._initDD=!0}return R.draggable(e,s?"disable":"enable").resizable(e,r?"disable":"enable"),this}_onStartMoving(e,t,i,s,r,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(e);else if(this.placeholder&&this.placeholder.closest(".grid-stack")){let a=this.placeholder.closest(".grid-stack");this.dragTransform=h.getValuesFromTransformedElement(a)}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=t.type==="dragstart",s._resizing=t.type==="resizestart",delete s._lastTried,t.type==="dropover"&&s._temporaryRemoved&&(this.engine.addNode(s),s._moving=!0),this.engine.cacheRects(r,n,this.opts.marginTop,this.opts.marginRight,this.opts.marginBottom,this.opts.marginLeft),t.type==="resizestart"){let a=this.getColumn()-s.x,u=(this.opts.maxRow||Number.MAX_SAFE_INTEGER)-s.y;R.resizable(e,"option","minWidth",r*Math.min(s.minW||1,a)).resizable(e,"option","minHeight",n*Math.min(s.minH||1,u)).resizable(e,"option","maxWidth",r*Math.min(s.maxW||Number.MAX_SAFE_INTEGER,a)).resizable(e,"option","maxWidthMoveLeft",r*Math.min(s.maxW||Number.MAX_SAFE_INTEGER,s.x+s.w)).resizable(e,"option","maxHeight",n*Math.min(s.maxH||Number.MAX_SAFE_INTEGER,u)).resizable(e,"option","maxHeightMoveUp",n*Math.min(s.maxH||Number.MAX_SAFE_INTEGER,s.y+s.h))}}_dragOrResize(e,t,i,s,r,n){let a=m({},s._orig),u,c=this.opts.marginLeft,d=this.opts.marginRight,g=this.opts.marginTop,p=this.opts.marginBottom,w=Math.round(n*.1),C=Math.round(r*.1);if(c=Math.min(c,C),d=Math.min(d,C),g=Math.min(g,w),p=Math.min(p,w),t.type==="drag"){if(s._temporaryRemoved)return;let Y=i.position.top-s._prevYPix;s._prevYPix=i.position.top,this.opts.draggable.scroll!==!1&&h.updateScrollPosition(e,i.position,Y);let $e=i.position.left+(i.position.left>s._lastUiPosition.left?-d:c),Zt=i.position.top+(i.position.top>s._lastUiPosition.top?-p:g);a.x=Math.round($e/r),a.y=Math.round(Zt/n);let ei=this._extraDragRow;if(this.engine.collide(s,a)){let qe=this.getRow(),je=Math.max(0,a.y+s.h-qe);this.opts.maxRow&&qe+je>this.opts.maxRow&&(je=Math.max(0,this.opts.maxRow-qe)),this._extraDragRow=je}else this._extraDragRow=0;if(this._extraDragRow!==ei&&this._updateContainerHeight(),s.x===a.x&&s.y===a.y)return}else if(t.type==="resize"){if(a.x<0||(h.updateScrollResize(t,e,n),a.w=Math.round((i.size.width-c)/r),a.h=Math.round((i.size.height-g)/n),s.w===a.w&&s.h===a.h)||s._lastTried&&s._lastTried.w===a.w&&s._lastTried.h===a.h)return;let Y=i.position.left+c,$e=i.position.top+g;a.x=Math.round(Y/r),a.y=Math.round($e/n),u=!0}s._event=t,s._lastTried=a;let T={x:i.position.left+c,y:i.position.top+g,w:(i.size?i.size.width:s.w*r)-c-d,h:(i.size?i.size.height:s.h*n)-g-p};if(this.engine.moveNodeCheck(s,E(m({},a),{cellWidth:r,cellHeight:n,rect:T,resizing:u}))){s._lastUiPosition=i.position,this.engine.cacheRects(r,n,g,d,p,c),delete s._skipDown,u&&s.subGrid&&s.subGrid.onResize(),this._extraDragRow=0,this._updateContainerHeight();let Y=t.target;s._sidebarOrig||this._writePosAttr(Y,s),this.triggerEvent(t,Y)}}triggerEvent(e,t){let i=this;for(;i.parentGridNode;)i=i.parentGridNode.grid;i._gsEventHandler[e.type]&&i._gsEventHandler[e.type](e,t)}_leave(e,t){t=t||e;let i=t.gridstackNode;if(!i||(t.style.transform=t.style.transformOrigin=null,R.off(e,"drag"),i._temporaryRemoved))return;i._temporaryRemoved=!0,this.engine.removeNode(i),i.el=i._isExternal&&t?t:e;let s=i._sidebarOrig;i._isExternal&&this.engine.cleanupNode(i),i._sidebarOrig=s,this.opts.removable===!0&&l._itemRemoving(e,!0),e._gridstackNodeOrig?(e.gridstackNode=e._gridstackNodeOrig,delete e._gridstackNodeOrig):i._isExternal&&this.engine.restoreInitial()}}return l.renderCB=(o,e)=>{o&&e?.content&&(o.textContent=e.content)},l.resizeToContentParent=".grid-stack-item-content",l.Utils=h,l.Engine=et,l.GDRev="12.4.2",l})();var Ut=["container"],ii=["*"];function si(l,o){}var ri=["*",[["","empty-content",""]]],oi=["*","[empty-content]"];function ni(l,o){l&1&&xe(0,1,["*ngIf","isEmpty"])}function ai(l,o){}var Ge=(()=>{class l{serialize(){}deserialize(e){this.widgetItem=e,e&&e.input&&Object.assign(this,e.input)}}return l.\u0275fac=function(e){return new(e||l)},l.\u0275prov=X({token:l,factory:l.\u0275fac}),l})(),$t=(()=>{class l{constructor(e){this.elementRef=e,this.el._gridItemComp=this}set options(e){let t=this.el.gridstackNode?.grid;t?t.update(this.el,e):this._options=E(m({},e),{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 l.\u0275fac=function(e){return new(e||l)(Ye(ce))},l.\u0275cmp=S({type:l,selectors:[["gridstack-item"]],viewQuery:function(e,t){if(e&1&&pe(Ut,7,ue),e&2){let i;Z(i=ee())&&(t.container=i.first)}},inputs:{options:"options"},ngContentSelectors:ii,decls:5,vars:1,consts:[["container",""],[1,"grid-stack-item-content"]],template:function(e,t){e&1&&(Qe(),J(0,"div",1),at(1,si,0,0,"ng-template",null,0,Ze),xe(3),v(4),ge()),e&2&&(M(4),mt(" ",t.options.content," "))},styles:["[_nghost-%COMP%]{display:block}"]}),l})(),ye=(()=>{class l{constructor(e){this.elementRef=e,this.addedCB=new P,this.changeCB=new P,this.disableCB=new P,this.dragCB=new P,this.dragStartCB=new P,this.dragStopCB=new P,this.droppedCB=new P,this.enableCB=new P,this.removedCB=new P,this.resizeCB=new P,this.resizeStartCB=new P,this.resizeStopCB=new P,V.addRemoveCB||(V.addRemoveCB=li),V.saveCB||(V.saveCB=di),V.updateCB||(V.updateCB=hi),this.el._gridComp=this}set options(e){this._grid?this._grid.updateOptions(e):this._options=e}get options(){return this._grid?.opts||this._options||{}}get el(){return this.elementRef.nativeElement}get grid(){return this._grid}static addComponentToSelectorType(e){e.forEach(t=>l.selectorToType[l.getSelector(t)]=t)}static getSelector(e){return wt(e).selector}ngOnInit(){this.loaded=!!this.options?.children?.length,this._grid=V.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 e=[];this.gridstackItems?.forEach(t=>{e.push(t.options),t.clearOptions()}),this.grid.load(e)}checkEmpty(){this.grid&&(this.isEmpty=!this.grid.engine.nodes.length)}hookEvents(e){e&&(e.parentGridNode||e.on("added",(t,i)=>{(i[0].grid?.el._gridComp||this).checkEmpty(),this.addedCB.emit({event:t,nodes:i})}).on("change",(t,i)=>this.changeCB.emit({event:t,nodes:i})).on("disable",t=>this.disableCB.emit({event:t})).on("drag",(t,i)=>this.dragCB.emit({event:t,el:i})).on("dragstart",(t,i)=>this.dragStartCB.emit({event:t,el:i})).on("dragstop",(t,i)=>this.dragStopCB.emit({event:t,el:i})).on("dropped",(t,i,s)=>this.droppedCB.emit({event:t,previousNode:i,newNode:s})).on("enable",t=>this.enableCB.emit({event:t})).on("removed",(t,i)=>{(i[0].grid?.el._gridComp||this).checkEmpty(),this.removedCB.emit({event:t,nodes:i})}).on("resize",(t,i)=>this.resizeCB.emit({event:t,el:i})).on("resizestart",(t,i)=>this.resizeStartCB.emit({event:t,el:i})).on("resizestop",(t,i)=>this.resizeStopCB.emit({event:t,el:i})))}unhookEvents(e){e&&(e.parentGridNode||e.off("added change disable drag dragstart dragstop dropped enable removed resize resizestart resizestop"))}}return l.selectorToType={},l.\u0275fac=function(e){return new(e||l)(Ye(ce))},l.\u0275cmp=S({type:l,selectors:[["gridstack"]],contentQueries:function(e,t,i){if(e&1&&ut(i,$t,4),e&2){let s;Z(s=ee())&&(t.gridstackItems=s)}},viewQuery:function(e,t){if(e&1&&pe(Ut,7,ue),e&2){let i;Z(i=ee())&&(t.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:oi,decls:4,vars:1,consts:[["container",""],[4,"ngIf"]],template:function(e,t){e&1&&(Qe(ri),nt(0,ni,1,0,"ng-content",1)(1,ai,0,0,"ng-template",null,0,Ze),xe(3)),e&2&&I("ngIf",t.isEmpty)},dependencies:[Ct],styles:["[_nghost-%COMP%]{display:block}"]}),l})();function li(l,o,e,t){if(e){if(!l)return;if(t){let i=l.parentElement?._gridItemComp;if(!i)return;let r=(i.childWidget?.container||i.container)?.createComponent(ye),n=r?.instance;return n?(n.ref=r,n.options=o,n.el):void 0}else{let s=l._gridComp?.container?.createComponent($t),r=s?.instance;if(!r)return;r.ref=s;let n=o.selector,a=n?ye.selectorToType[n]:void 0;if(a){let u=()=>{let d=r.container?.createComponent(a)?.instance;d&&typeof d.serialize=="function"&&typeof d.deserialize=="function"&&(r.childWidget=d,d.deserialize(o))};o.lazyLoad||o.grid?.opts?.lazyLoad&&o.lazyLoad!==!1?o.visibleObservable||(o.visibleObservable=new IntersectionObserver(([d])=>{d.isIntersecting&&(o.visibleObservable?.disconnect(),delete o.visibleObservable,u())}),window.setTimeout(()=>o.visibleObservable?.observe(r.el))):u()}return r.el}}else if(t){let i=o.el?._gridComp;i?.ref?i.ref.destroy():i?.ngOnDestroy()}else{let i=o.el?._gridItemComp;i?.ref?i.ref.destroy():i?.ngOnDestroy()}}function di(l,o){let e=l.el?._gridItemComp;if(e){let i=e.childWidget?.serialize();i&&(o.input=i);return}let t=l.el?._gridComp}function hi(l){let o=l,e=l.el?._gridItemComp;e?.childWidget&&o.input&&e.childWidget.deserialize(o)}var ci=(l,o)=>o.id;function ui(l,o){if(l&1&&ht(0,"div",4),l&2){let e=o.$index;O(2);let t=De(0);Ee("background-color",t===e?"var(--mat-sys-on-surface)":"var(--mat-sys-inverse-on-surface)")}}function gi(l,o){if(l&1&&(J(0,"div",0),Xe("fade-toast"),J(1,"span",1),v(2),ge()(),J(3,"div",2),Xe("fade-toast"),lt(4,ui,1,2,"div",3,ci),ge()),l&2){O();let e=De(0),t=De(1);M(2),ft(t[e].name),M(2),dt(t)}}var qt=(()=>{class l{activePage=U();dashboards=U();visible=_e(!1);constructor(){L(()=>{let e=this.activePage();if(e==null){this.visible.set(!1);return}this.visible.set(!1),queueMicrotask(()=>this.visible.set(!0))})}static \u0275fac=function(t){return new(t||l)};static \u0275cmp=S({type:l,selectors:[["dashboard-scroller"]],inputs:{activePage:[1,"activePage"],dashboards:[1,"dashboards"]},decls:3,vars:3,consts:[[1,"page-scroll-title","page-scroll-container"],[1,"page-label"],[1,"page-scroll-page-number","page-scroll-container","fade-toast"],[1,"page-marker",3,"background-color"],[1,"page-marker"]],template:function(t,i){t&1&&(yt(0)(1),W(2,gi,6,1)),t&2&&(Je(i.activePage()),M(),Je(i.dashboards()),M(),B(i.visible()?2:-1))},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)}@keyframes _ngcontent-%COMP%_fadeInHoldFadeOut{0%{opacity:0}7.407%{opacity:1}25.926%{opacity:1}to{opacity:0}}.fade-toast[_ngcontent-%COMP%]{opacity:0;animation:_ngcontent-%COMP%_fadeInHoldFadeOut 1.35s linear forwards}"]})}return l})();var jt=(()=>{class l{twoFingerTapEnabled=U(!0);twoFingerTapMaxDurationMs=U(450);twoFingerTapMoveThresholdPx=U(24);twoFingerTapPreventDefault=U(!0);twoFingerTap=bt();pointers=new Map;candidate=!1;moved=!1;startedAtMs=0;blocked=!1;onPointerDown(e){if(!(!this.twoFingerTapEnabled()||e.pointerType!=="touch")){if(this.pointers.set(e.pointerId,{x:e.clientX,y:e.clientY}),this.pointers.size===2&&!this.blocked){this.candidate=!0,this.moved=!1,this.startedAtMs=Date.now();return}this.pointers.size>2&&(this.blocked=!0,this.resetTracking(!1))}}onPointerMove(e){if(!this.candidate||e.pointerType!=="touch")return;let t=this.pointers.get(e.pointerId);if(!t)return;let i=e.clientX-t.x,s=e.clientY-t.y;Math.hypot(i,s)>this.twoFingerTapMoveThresholdPx()&&(this.moved=!0)}onPointerUp(e){if(e.pointerType!=="touch")return;if(this.pointers.delete(e.pointerId),this.blocked){this.pointers.size===0&&(this.blocked=!1);return}if(!this.candidate||this.pointers.size>0)return;let t=Date.now()-this.startedAtMs,i=!this.moved&&t<=this.twoFingerTapMaxDurationMs();this.resetTracking(!1),i&&(this.twoFingerTapPreventDefault()&&(e.preventDefault(),e.stopPropagation()),this.twoFingerTap.emit(e))}onPointerCancel(e){e.pointerType==="touch"&&(this.pointers.delete(e.pointerId),this.pointers.size===0&&this.resetTracking(!0))}resetTracking(e){this.pointers.clear(),this.candidate=!1,this.moved=!1,this.startedAtMs=0,e||(this.blocked=!1)}static \u0275fac=function(t){return new(t||l)};static \u0275dir=ot({type:l,selectors:[["","twoFingerTap",""]],hostBindings:function(t,i){t&1&&x("pointerdown",function(r){return i.onPointerDown(r)})("pointermove",function(r){return i.onPointerMove(r)})("pointerup",function(r){return i.onPointerUp(r)})("pointercancel",function(r){return i.onPointerCancel(r)})},inputs:{twoFingerTapEnabled:[1,"twoFingerTapEnabled"],twoFingerTapMaxDurationMs:[1,"twoFingerTapMaxDurationMs"],twoFingerTapMoveThresholdPx:[1,"twoFingerTapMoveThresholdPx"],twoFingerTapPreventDefault:[1,"twoFingerTapPreventDefault"]},outputs:{twoFingerTap:"twoFingerTap"}})}return l})();function fi(l,o){if(l&1){let e=K();y(0,"button",0),x("click",function(){N(e);let i=O();return A(i.clickAction("cancel"))}),y(1,"mat-icon",1),v(2,"close"),b(),y(3,"span"),v(4,"Close"),b()()}}var Ue=(()=>{class l{_bottomSheetRef=_(He);data=_(At);showCancel=!!(this.data&&this.data.showCancel);clickAction(e){this._bottomSheetRef.dismiss(e)}static \u0275fac=function(t){return new(t||l)};static \u0275cmp=S({type:l,selectors:[["widget-host-bottom-sheet"]],decls:22,vars:1,consts:[["mat-list-item","",3,"click"],["matListItemIcon",""],["mat-list-item",""]],template:function(t,i){t&1&&(y(0,"mat-action-list")(1,"button",0),x("click",function(){return i.clickAction("duplicate")}),y(2,"mat-icon",1),v(3,"add_to_photos"),b(),y(4,"span"),v(5,"Duplicate"),b()(),y(6,"button",0),x("click",function(){return i.clickAction("copy")}),y(7,"mat-icon",1),v(8,"content_copy"),b(),y(9,"span"),v(10,"Copy"),b()(),y(11,"button",0),x("click",function(){return i.clickAction("cut")}),y(12,"mat-icon",1),v(13,"content_cut"),b(),y(14,"span"),v(15,"Cut"),b()(),y(16,"button",0),x("click",function(){return i.clickAction("delete")}),y(17,"mat-icon",1),v(18,"delete_forever"),b(),y(19,"span"),v(20,"Delete"),b()(),W(21,fi,5,0,"button",2),b()),t&2&&(M(21),B(i.showCancel?21:-1))},dependencies:[Le,Ne,Ae,Oe,se,ie],encapsulation:2})}return l})();var Kt=(()=>{class l{http=_(Et);connection=_(ke);pluginConfig=_(re);destroyRef=_(Q);kipPluginServiceUrl=null;constructor(){this.connection.serverServiceEndpoint$.pipe(me(this.destroyRef)).subscribe(e=>{let t=e?.httpServiceUrl||null;this.kipPluginServiceUrl=this.resolveKipPluginServiceUrl(t)})}resolveKipPluginServiceUrl(e){let t=this.connection.signalKURL?.url?.trim();return t?`${t.endsWith("/")?t.slice(0,-1):t}/plugins/kip/`:e?`${(e.endsWith("/")?e.slice(0,-1):e).replace(/\/signalk\/v2\/api$/,"").replace(/\/signalk\/v1\/api$/,"").replace(/\/signalk\/v2$/,"").replace(/\/signalk\/v1$/,"").replace(/\/signalk$/,"")}/plugins/kip/`:null}reconcileSeries(e){return z(this,null,function*(){try{if(!(yield this.pluginConfig.getKipRuntimeModeConfigCached("kip")).historySeriesServiceEnabled)return console.warn("[KipSeriesApiClientService] Reconcile skipped because history-series service is disabled in KIP plugin settings"),null;if(!this.kipPluginServiceUrl)return console.warn("[KipSeriesApiClientService] No KIP plugin endpoint available for series reconcile"),null;let i=`${this.kipPluginServiceUrl}series/reconcile`;console.log(`[KipSeriesApiClientService] POST ${i} (${e.length} series)`);let s=yield Ve(this.http.post(i,e));return console.log(`[KipSeriesApiClientService] Series reconcile successful (created=${s.created}, updated=${s.updated}, deleted=${s.deleted}, total=${s.total})`),s}catch(t){return console.error("[KipSeriesApiClientService] Series reconcile request failed:",t),null}})}getValues(e){return z(this,null,function*(){try{if(!this.kipPluginServiceUrl)return console.warn("[HistoryApiClientService] No HTTP service URL available"),null;let t=`${this.kipPluginServiceUrl}history/values`,i=new xt;i=i.set("paths",e.paths),e.context&&(i=i.set("context",e.context)),e.from&&(i=i.set("from",e.from)),e.to&&(i=i.set("to",e.to)),e.duration&&(i=i.set("duration",e.duration.toString())),e.resolution!==void 0&&e.resolution!==null&&(i=i.set("resolution",e.resolution.toString()));let s=`${t}?${i.toString()}`;console.log(`[HistoryApiClientService] GET ${s}`);let r=yield Ve(this.http.get(t,{params:i}));return console.log(`[HistoryApiClientService] History fetch successful, received ${r.data?.length??0} data points`),r}catch(t){return console.error("[HistoryApiClientService] History API request failed:",t),null}})}static \u0275fac=function(t){return new(t||l)};static \u0275prov=X({token:l,factory:l.\u0275fac,providedIn:"root"})}return l})();var Yt=(()=>{class l{dashboard=_($);kipSeries=_(Kt);destroyRef=_(Q);connection=_(ke);pluginConfig=_(re);widgetService=_(Me);serverEndpoint=Re(this.connection.serverServiceEndpoint$,{initialValue:null});RECONCILE_DEBOUNCE_MS=750;AUTO_RETENTION_MS=1440*60*1e3;reconcileTimer=null;lastSubmittedSignature=null;pendingSignature=null;pendingSeries=[];constructor(){L(()=>{let e=this.serverEndpoint(),t=this.dashboard.dashboards();if(!e?.httpServiceUrl)return;let i=this.extractSeriesFromDashboards(t);this.scheduleReconcile(i)}),this.destroyRef.onDestroy(()=>{this.reconcileTimer!==null&&(clearTimeout(this.reconcileTimer),this.reconcileTimer=null)})}scheduleReconcile(e){let t=JSON.stringify(e);t!==this.lastSubmittedSignature&&(this.pendingSeries=e,this.pendingSignature=t,this.reconcileTimer!==null&&clearTimeout(this.reconcileTimer),this.reconcileTimer=window.setTimeout(()=>{this.flushReconcile()},this.RECONCILE_DEBOUNCE_MS))}flushReconcile(){return z(this,null,function*(){if(!this.pendingSignature)return;let e=this.pendingSignature,t=this.pendingSeries;if(this.pendingSignature=null,this.reconcileTimer=null,!(yield this.pluginConfig.getKipRuntimeModeConfigCached("kip")).historySeriesServiceEnabled){console.warn("[DashboardHistorySeriesSyncService] Reconcile skipped because history series service mode is disabled"),this.lastSubmittedSignature=e;return}yield this.kipSeries.reconcileSeries(t),this.lastSubmittedSignature=e})}extractSeriesFromDashboards(e){let t=[];return e.forEach(i=>{let s=this.coerceNodeList(i.configuration);this.collectSeriesFromNodes(s,t)}),t.sort((i,s)=>i.seriesId.localeCompare(s.seriesId))}resolveSeriesForWidget(e){let t=e?.type,i=e?.uuid,s=this.resolveWidgetConfig(t,e?.config);if(!t||!i||s?.supportAutomaticHistoricalSeries===!1)return[];if(t==="widget-data-chart"){let r=this.mapDataChartWidget(i,t,s);return r?[r]:[]}return t==="widget-windtrends-chart"?this.mapWindTrendsWidget(i,t,s):this.mapAutomaticHistorySeries(i,t,s)}resolveWidgetConfig(e,t){if(!e)return t;let i=this.getDefaultConfigForType(e);return i?t?E(m(m({},i),t),{paths:t.paths??i.paths}):i:t}getDefaultConfigForType(e){try{return this.widgetService.getComponentType(e)?.DEFAULT_CONFIG}catch(t){return}}collectSeriesFromNodes(e,t){e.forEach(i=>{let s=i?.input?.widgetProperties;t.push(...this.resolveSeriesForWidget(s));let r=this.coerceNodeList(i?.subGridOpts?.children);r.length>0&&this.collectSeriesFromNodes(r,t)})}mapDataChartWidget(e,t,i){let s=this.normalizeString(i?.datachartPath);return s?{seriesId:`${e}:datachart`,datasetUuid:e,ownerWidgetUuid:e,ownerWidgetSelector:t,path:s,context:null,source:this.normalizeString(i?.datachartSource),timeScale:this.normalizeString(i?.timeScale),period:this.normalizeNumber(i?.period),retentionDurationMs:null,sampleTime:null,enabled:!0}:null}mapWindTrendsWidget(e,t,i){let s={ownerWidgetUuid:e,ownerWidgetSelector:t,context:null,source:"default",timeScale:this.normalizeString(i?.timeScale),period:30,retentionDurationMs:null,sampleTime:null,enabled:!0};return[E(m({},s),{seriesId:`${e}:wind-direction`,datasetUuid:`${e}-twd`,path:"self.environment.wind.directionTrue"}),E(m({},s),{seriesId:`${e}:wind-speed`,datasetUuid:`${e}-tws`,path:"self.environment.wind.speedTrue"})]}mapAutomaticHistorySeries(e,t,i){let s=this.extractWidgetPaths(i?.paths),r=new Map;return s.forEach(n=>{if(n.pathType!=="number")return;let a=this.normalizeString(n.path);if(!a)return;let u=this.normalizeString(n.source),c=`${a}|${u??"default"}`;if(r.has(c))return;let d=this.slugify(a),g=this.slugify(u??"default"),p=this.normalizeNumber(n.sampleTime);r.set(c,{seriesId:`${e}:auto:${d}:${g}`,datasetUuid:`${e}:${d}:${g}`,ownerWidgetUuid:e,ownerWidgetSelector:t,path:a,context:null,source:u,timeScale:this.normalizeString(i?.timeScale),period:this.normalizeNumber(i?.period),retentionDurationMs:this.AUTO_RETENTION_MS,sampleTime:p,enabled:!0})}),[...r.values()]}extractWidgetPaths(e){return e?Array.isArray(e)?e:Object.values(e):[]}slugify(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}normalizeString(e){if(typeof e!="string")return null;let t=e.trim();return t.length>0?t:null}normalizeNumber(e){return typeof e!="number"||!Number.isFinite(e)?null:e}coerceNodeList(e){return Array.isArray(e)?e:[]}static \u0275fac=function(t){return new(t||l)};static \u0275prov=X({token:l,factory:l.\u0275fac,providedIn:"root"})}return l})();var yi=["childOutlet"],Xt=(()=>{class l extends Ge{widgetProperties;outlet;dialog=_(oe);dashboard=_($);bottomSheet=_(ne);streams=_(Te,{optional:!0});meta=_(ze,{optional:!0});runtime=_(q,{optional:!0});widgetService=_(Me);app=_(Mt);historySync=_(Yt);_uiEvent=_(Pe);settings=_(Rt);theme=Re(this.app.cssThemeColorRoles$,{requireSync:!0});childRef;compType;_hasInitialized=!1;_sheetOpen=!1;_optionsOpen=!1;_historyDialogOpen=!1;isDebugEnabled(){try{return typeof localStorage<"u"&&localStorage.getItem("kip:gesturesDebug")==="1"}catch(e){return!1}}debug(...e){this.isDebugEnabled()&&console.debug("[Host2]",...e)}constructor(){super(),L(()=>{let e=this.dashboard.layoutEditCanceled();!this._hasInitialized||!e||fe(()=>{this.reinitFromSavedConfig()})})}ngOnInit(){let e=this.widgetProperties.type;if(!e)return;this.compType=this.widgetService.getComponentType(e);let t=this.getDefaultConfig();this.runtime?.initialize?.(t,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,{bindings:[be("id",()=>this.widgetProperties.uuid),be("type",()=>this.widgetProperties.type),be("theme",this.theme)]})),this._hasInitialized=!0}serialize(){let e=this.runtime?.options();return e?this.widgetProperties.config=e:this.widgetProperties.config||(this.widgetProperties.config={}),{widgetProperties:this.widgetProperties}}applyRuntimeConfig(e){e&&this.runtime?.setRuntimeConfig?.(e);let t=this.runtime?.options();t&&(this.widgetProperties.config=t),this.streams?.applyStreamsConfigDiff?.(t),this.meta?.applyMetaConfigDiff?.(t)}reinitFromSavedConfig(){try{let e=this.getSavedConfigForSelf(),t=this.getDefaultConfig();this.runtime?.initialize?.(t,F(e));let i=this.runtime?.options();i&&(this.widgetProperties.config=i),this.streams?.applyStreamsConfigDiff?.(i),this.meta?.applyMetaConfigDiff?.(i)}catch(e){}}getSavedConfigForSelf(){try{let e=this.dashboard.dashboards(),t=this.dashboard.activeDashboard(),r=(e?.[t]?.configuration??[]).find(n=>n?.id===this.widgetProperties.uuid);return r?.input?.widgetProperties?.config??r?.widgetProperties?.config??void 0}catch(e){return}}getDefaultConfig(){let e=this.compType&&this.compType.DEFAULT_CONFIG;if(!e&&this.compType&&this.outlet){let t=this.outlet.createComponent(this.compType);e=t.instance.defaultConfig,t.destroy()}return e}openWidgetOptions(e){if(e.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(t=>{this._optionsOpen=!1,t&&(this.debug("options saved",{widgetId:this.widgetProperties?.uuid}),this.applyRuntimeConfig(t))})}}openBottomSheet(e){if(e.stopPropagation(),this.debug("openBottomSheet invoked",{widgetId:this.widgetProperties?.uuid,static:this.dashboard.isDashboardStatic()}),!this.dashboard.isDashboardStatic()){if(this._uiEvent.isDragging()){this.debug("bottom sheet suppressed during drag",{widgetId:this.widgetProperties?.uuid});return}if(this._sheetOpen){this.debug("sheet already open; ignoring");return}this._sheetOpen=!0;let t=typeof navigator<"u"&&/Linux/.test(navigator.platform)&&/Firefox/.test(navigator.userAgent);this.bottomSheet.open(Ue,t?{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;case"copy":this.dashboard.copyWidget(this.widgetProperties.uuid);break;case"cut":this.dashboard.cutWidget(this.widgetProperties.uuid);break;default:break}})}}openWidgetHistoryDialog(e){e.preventDefault(),e.stopPropagation(),this.openWidgetHistoryDialogInternal()}onHistoryTwoFingerTap(e){e.preventDefault(),e.stopPropagation(),this.openWidgetHistoryDialogInternal()}openWidgetHistoryDialogInternal(){if(this.settings.getWidgetHistoryDisabled()||!this.dashboard.isDashboardStatic()||this._historyDialogOpen)return;let e=this.historySync.resolveSeriesForWidget(this.widgetProperties);if(!this.isHistoryDialogEligible(this.widgetProperties,e))return;let t=this.widgetProperties?.config?.displayName||this.widgetProperties?.type||"Widget History";this._historyDialogOpen=!0,this.dialog.openWidgetHistoryDialog({title:t,widget:this.widgetProperties,seriesDefinitions:e}).afterClosed().subscribe(()=>{this._historyDialogOpen=!1})}isHistoryDialogEligible(e,t){if(!e?.config||e.config.supportAutomaticHistoricalSeries===!1)return!1;let i=this.extractNumericPaths(e.config.paths);return i.length?t.some(s=>{let r=typeof s.path=="string"?s.path.trim():"";return i.includes(r)?s.enabled!==!1:!1}):!1}extractNumericPaths(e){if(!e)return[];let t=Array.isArray(e)?e:Object.values(e),i=new Set;return t.forEach(s=>{if(s?.pathType!=="number")return;let r=typeof s.path=="string"?s.path.trim():"";r.length&&i.add(r)}),[...i]}static \u0275fac=function(t){return new(t||l)};static \u0275cmp=S({type:l,selectors:[["widget-host2"]],viewQuery:function(t,i){if(t&1&&pe(yi,7,ue),t&2){let s;Z(s=ee())&&(i.outlet=s.first)}},inputs:{widgetProperties:"widgetProperties"},features:[ve([Te,ze,q]),we],decls:3,vars:3,consts:[["childOutlet",""],["kipGestures","","mode","press","appearance","raised","twoFingerTap","",1,"widget-container","kip-widget-card-colors",3,"twoFingerTap","doubletap","press","contextmenu","twoFingerTapEnabled"]],template:function(t,i){t&1&&(y(0,"mat-card",1),x("twoFingerTap",function(r){return i.onHistoryTwoFingerTap(r)})("doubletap",function(r){return i.openWidgetOptions(r)})("press",function(r){return i.openBottomSheet(r)})("contextmenu",function(r){return i.openWidgetHistoryDialog(r)}),ct(1,null,0),b()),t&2&&(Ee("border",i.dashboard.isDashboardStatic()?"1px dashed transparent":"1px dashed var(--mat-sys-outline)"),I("twoFingerTapEnabled",i.dashboard.isDashboardStatic()))},dependencies:[Pt,Ht,Lt,te,jt],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 l})();function _i(l,o){if(l&1){let e=K();y(0,"div",2),x("doubletap",function(i){N(e);let s=O();return A(s.openWidgetOptions(i))})("press",function(i){N(e);let s=O();return A(s.openBottomSheet(i))}),b()}}var Qt=(()=>{class l extends Ge{widgetProperties;dashboard=_($);_dialog=_(oe);_bottomSheet=_(ne);runtime=_(q);static DEFAULT_CONFIG={displayName:"Gauge Label",color:"contrast"};_sheetOpen=!1;_optionsOpen=!1;constructor(){super()}ngOnInit(){this.runtime?.initialize?.(l.DEFAULT_CONFIG,this.widgetProperties.config)}serialize(){let e=this.runtime?.options();return e?this.widgetProperties.config=e:this.widgetProperties.config||(this.widgetProperties.config={}),{widgetProperties:this.widgetProperties}}openWidgetOptions(e){if(e.stopPropagation(),!this.dashboard.isDashboardStatic()){if(this._optionsOpen)return;this._optionsOpen=!0,this._dialog.openWidgetOptions({title:"Widget Options",config:F(this.runtime.options()),confirmBtnText:"Save",cancelBtnText:"Cancel"}).afterClosed().subscribe(t=>{this._optionsOpen=!1,t&&this.runtime.setRuntimeConfig(t)})}}openBottomSheet(e){if(e.stopPropagation(),!this.dashboard.isDashboardStatic()){if(this._sheetOpen)return;this._sheetOpen=!0;let t=typeof navigator<"u"&&/Linux/.test(navigator.platform)&&/Firefox/.test(navigator.userAgent);this._bottomSheet.open(Ue,t?{disableClose:!0,data:{showCancel:!0}}:{}).afterDismissed().subscribe(s=>{this._sheetOpen=!1,s==="delete"&&this.dashboard.deleteWidget(this.widgetProperties.uuid)})}}static \u0275fac=function(t){return new(t||l)};static \u0275cmp=S({type:l,selectors:[["group-widget"]],inputs:{widgetProperties:"widgetProperties"},features:[ve([q]),we],decls:2,vars:3,consts:[[3,"text","color"],["kipGestures","","mode","press",1,"widgetOverlay"],["kipGestures","","mode","press",1,"widgetOverlay",3,"doubletap","press"]],template:function(t,i){t&1&&(Ce(0,"widget-title",0),W(1,_i,1,0,"div",1)),t&2&&(I("text",i.runtime.options().displayName)("color",i.runtime.options().color),M(),B(i.dashboard.isDashboardStatic()?-1:1))},dependencies:[Nt,te],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 l})();var Jt=(()=>{class l{_bottomSheetRef=_(He);clickAction(e){this._bottomSheetRef.dismiss(e)}static \u0275fac=function(t){return new(t||l)};static \u0275cmp=S({type:l,selectors:[["dashboard-clipboard-bottom-sheet"]],decls:20,vars:0,consts:[["mat-subheader",""],["mat-list-item","",3,"click"],["matListItemIcon",""]],template:function(t,i){t&1&&(y(0,"mat-action-list")(1,"div",0),v(2,"Clipboard"),b(),y(3,"button",1),x("click",function(){return i.clickAction("paste")}),y(4,"mat-icon",2),v(5,"content_paste"),b(),y(6,"span"),v(7,"Paste"),b()(),y(8,"button",1),x("click",function(){return i.clickAction("clear")}),y(9,"mat-icon",2),v(10,"clear"),b(),y(11,"span"),v(12,"Clear"),b()(),y(13,"div",0),v(14,"New Widget"),b(),y(15,"button",1),x("click",function(){return i.clickAction("add")}),y(16,"mat-icon",2),v(17,"add_circle"),b(),y(18,"span"),v(19,"Add"),b()()())},dependencies:[Le,Ne,Ae,Oe,Wt,se,ie],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}return l})();var bi=["grid"];function vi(l,o){l&1&&(y(0,"p",9)(1,"strong"),v(2,"Long press/click and hold anywhere"),b(),v(3," to add widgets"),b(),y(4,"mat-icon",10),v(5,"touch_app"),b())}function wi(l,o){if(l&1){let e=K();y(0,"p",9),v(1,"This empty dashboard is ready to be customized."),b(),y(2,"button",11),x("click",function(){N(e);let i=O();return A(i.editDashboard())}),y(3,"mat-icon"),v(4,"lock_open"),b(),v(5," Unlock and Customize "),b()}}function Ci(l,o){if(l&1){let e=K();y(0,"div",7)(1,"button",12),x("click",function(){N(e);let i=O();return A(i.cancelLayoutChanges())}),y(2,"mat-icon"),v(3,"close"),b()(),y(4,"button",13),x("click",function(){N(e);let i=O();return A(i.saveLayoutChanges())}),y(5,"mat-icon"),v(6,"done"),b()()()}}function xi(l,o){if(l&1&&Ce(0,"dashboard-scroller",8),l&2){let e=O();I("activePage",e.dashboard.activeDashboard())("dashboards",e.dashboard.dashboards())}}var Lo=(()=>{class l{toast=_(zt);_dialog=_(oe);_bottomSheet=_(ne);dashboard=_($);_destroyRef=_(Q);_uiEvent=_(Pe);datasetLifecycle=_(Ot);_pluginConfig=_(re);_router=_(Tt);_hostEl=_(ce);isDashboardStatic=_t(()=>this.dashboard.isDashboardStatic());_gridstack=vt.required("grid");_previousIsStaticState=!0;_suppressDrag=!1;subGridOptions={cellHeight:"auto",column:"auto",acceptWidgets:!0,subGridDynamic:!1,class:"group-container"};gridOptions=_e({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;_clipboardSheetOpen=!1;constructor(){ye.addComponentToSelectorType([Xt,Qt]),L(()=>{let e=this.dashboard.isDashboardStatic();fe(()=>{if(this._previousIsStaticState!==e){this._previousIsStaticState=e;try{this._gridstack().grid.setStatic(e)}catch(t){}}})}),L(()=>{let e=this.dashboard.activeDashboard();fe(()=>{this.loadDashboard(e)})})}ngAfterViewInit(){this._gridstack().grid?.setStatic(this._previousIsStaticState),this.resizeGridColumns(),this.setupResizeObserver(),this._uiEvent.addHotkeyListener(this._boundHandleKeyDown,{ctrlKey:!0,keys:["arrowdown","arrowup"]});try{let e=this._gridstack().grid;e&&typeof e.on=="function"&&(e.on("dragstart",()=>{this._uiEvent.isDragging.set(!0)}),e.on("dragstop",()=>{setTimeout(()=>this._uiEvent.isDragging.set(!1),0)}),e.on("resizestart",()=>{this._uiEvent.isDragging.set(!0)}),e.on("resizestop",()=>{setTimeout(()=>this._uiEvent.isDragging.set(!1),0)}))}catch(e){}this.dashboard.widgetAction$.pipe(me(this._destroyRef)).subscribe(e=>{e&&this._gridstack().grid.getGridItems().forEach(t=>{if(t.gridstackNode.id===e.id)switch(e.operation){case"delete":this.deleteWidget(t);break;case"duplicate":this.duplicateWidget(t);break;case"copy":this.dashboard.setWidgetClipboardFromNode(t.gridstackNode);break;case"cut":this.dashboard.setWidgetClipboardFromNode(t.gridstackNode),this.deleteWidget(t);break;default:break}})})}setupResizeObserver(){if(this._resizeObserver)return;let e=this._hostEl.nativeElement;try{this._resizeObserver=new ResizeObserver(()=>{this._pendingResizeRaf===null&&(this._pendingResizeRaf=requestAnimationFrame(()=>{this._pendingResizeRaf=null,this.resizeGridColumns()}))}),this._resizeObserver.observe(e)}catch(t){}}handleKeyDown(e){e==="arrowdown"?this.previousDashboard():e==="arrowup"&&this.nextDashboard()}resizeGridColumns(){try{let t=this._gridstack().grid;if(!t)return;let i=t,s=this._hostEl.nativeElement.clientHeight||window.innerHeight;if(s===this._lastContainerHeight&&this._lastCellHeight>0)return;let r=i.getRow?i.getRow():0;if(r>0&&i.cellHeight){let n=Number(r)||0,a=n>0?s/n:1;if(a=Math.max(1,Math.round(a*100)/100),this._lastCellHeight===a&&this._lastContainerHeight===s)return;i.cellHeight(a),i.batchUpdate&&(i.batchUpdate(),i.batchUpdate(!1)),this._lastContainerHeight=s,this._lastCellHeight=a}}catch(e){}}loadDashboard(e){let t=F(this.dashboard.dashboards()[e]),i=this._gridstack();if(!i?.grid){queueMicrotask(()=>this.loadDashboard(e));return}i.grid.batchUpdate(),i.grid.load(t.configuration),i.grid.batchUpdate(!1)}saveDashboard(){let e=this._gridstack().grid.save(!1,!1)||null,t=F(e);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(e){if(!this.dashboard.isDashboardStatic()&&e.detail!==void 0){if(this._addDialogOpen||this._clipboardSheetOpen)return;let t=e.detail||{},i=t.center?.x??t.x??0,s=t.center?.y??t.y??0,r=this._gridstack().grid.getCellFromPixel({left:i,top:s});if(this._gridstack().grid.isAreaEmpty(r.x,r.y,1,2)){if(this.dashboard.widgetClipboard()){this.openClipboardBottomSheet(r.x,r.y);return}this.openAddWidgetDialog(r.x,r.y)}else this.toast.show("Not enough free space at the selected location to add a widget. Please reorganize the dashboard to free up space or try a larger empty area.",0,!1,"error")}}openClipboardBottomSheet(e,t){if(this._clipboardSheetOpen)return;this._clipboardSheetOpen=!0,this._bottomSheet.open(Jt).afterDismissed().subscribe(s=>{switch(this._clipboardSheetOpen=!1,s){case"paste":this.pasteCopiedWidget(e,t);break;case"clear":this.dashboard.clearWidgetClipboard();break;case"add":this.openAddWidgetDialog(e,t);break;default:break}})}openAddWidgetDialog(e,t){this._addDialogOpen=!0,this._dialog.openFrameDialog({title:"Add Widget",component:"select-widget"},!0).pipe(st(()=>{this._addDialogOpen=!1})).subscribe(i=>z(this,null,function*(){if(!i||typeof i!="object")return;let s=i;yield this.tryAddWidgetWithDependencyChecks(s,e,t)}))}tryAddWidgetWithDependencyChecks(e,t,i){return z(this,null,function*(){let s=yield this.getDisabledRequiredPlugins(e.requiredPlugins??[]);if(s.length>0){this.promptEnableRequiredPlugins(e,t,i,s);return}let r=yield this.getAnyOfPluginActivationState(e.anyOfPlugins??[]),n=r.installed.length>0,a=r.enabled.length>0;if(n&&!a){this.notifyAnyOfPluginsRequireManualActivation(e,r.installed);return}this.addWidgetToGrid(e,t,i)})}getDisabledRequiredPlugins(e){return z(this,null,function*(){if(!e?.length)return[];let t=[...new Set(e)];return(yield Promise.all(t.map(s=>z(this,null,function*(){let r=yield this._pluginConfig.getPlugin(s);return{pluginId:s,enabled:r.ok&&r.data.state.enabled}})))).filter(s=>!s.enabled).map(s=>s.pluginId)})}getAnyOfPluginActivationState(e){return z(this,null,function*(){if(!e?.length)return{installed:[],enabled:[]};let t=[...new Set(e)],i=yield Promise.all(t.map(s=>z(this,null,function*(){let r=yield this._pluginConfig.getPlugin(s);return{pluginId:s,installed:r.ok,enabled:r.ok&&r.data.state.enabled}})));return{installed:i.filter(s=>s.installed).map(s=>s.pluginId),enabled:i.filter(s=>s.enabled).map(s=>s.pluginId)}})}notifyAnyOfPluginsRequireManualActivation(e,t){let i=t.join(", ");this.toast.show(`Cannot add "${e.name}" yet. Any-of plugin${t.length>1?"s are":" is"} installed (${i}) but none ${t.length>1?"are":"is"} active. Please manually activate and configure one or all in Signal K Plugin Config, then come back and add the widget.`,0,!1,"warn")}promptEnableRequiredPlugins(e,t,i,s){let r=s.join(", ");this.toast.show(`Cannot add "${e.name}" widget until required plugin${s.length>1?"s are":" is"} enabled: ${r}.`,0,!1,"warn","Enable").onAction().pipe(me(this._destroyRef)).subscribe(()=>{this.enableRequiredPluginsAndAddWidget(e,t,i,s)})}enableRequiredPluginsAndAddWidget(e,t,i,s){return z(this,null,function*(){let r=[...new Set(s)],a=(yield Promise.all(r.map(u=>z(this,null,function*(){return{pluginId:u,result:yield this._pluginConfig.setPluginEnabled(u,!0)}})))).filter(u=>!u.result.ok).map(u=>u.pluginId);if(a.length>0){this.toast.show(`Failed to enable required plugin${a.length>1?"s":""}: ${a.join(", ")}.`,0,!1,"error");return}this.toast.show(`Enabled required plugin${r.length>1?"s":""}: ${r.join(", ")}.`,3e3,!0,"success"),yield this.tryAddWidgetWithDependencyChecks(e,t,i)})}addWidgetToGrid(e,t,i){let s=Se.create(),r={};e.selector==="group-widget"?r={x:t,y:i,w:3,h:4,id:s,selector:"group-widget",input:{widgetProperties:{type:e.selector,uuid:s,config:{displayName:"Group Widget",color:"contrast"}}},subGridOpts:{children:[]}}:r={x:t,y:i,w:e.defaultWidth,h:e.defaultHeight,minW:e.minWidth,minH:e.minHeight,id:s,selector:"widget-host2",input:{widgetProperties:{type:e.selector,uuid:s}}};let n=this._gridstack().grid,a=Number(e.minWidth??1),u=Number(e.minHeight??2),c=Number(e.defaultWidth??a),d=Number(e.defaultHeight??u);if(!(n.isAreaEmpty(t,i,c,d)&&n.willItFit({x:t,y:i,w:c,h:d}))){let w=this.findBestWidgetSizeAtCell(n,t,i,a,u,c,d);if(!w){this.toast.show(`Not enough free space to add "${e.name}" widget at the selected location. Please reorganize the dashboard to free up space or try a larger empty area.`,0,!1,"error");return}r.w=w.w,r.h=w.h}let p=this._gridstack().grid.addWidget(r);p.gridstackNode.subGrid&&(p.gridstackNode.subGridOpts.row=p.gridstackNode.subGridOpts.minRow=p.gridstackNode.subGridOpts.maxRow=p.gridstackNode.h)}findBestWidgetSizeAtCell(e,t,i,s,r,n,a){let u=Math.max(1,Math.floor(s)),c=Math.max(1,Math.floor(r)),d=Math.max(u,Math.floor(n)),g=Math.max(c,Math.floor(a)),p=null;for(let w=u;w<=d;w++)for(let C=c;C<=g;C++){if(!e.isAreaEmpty(t,i,w,C)||!e.willItFit({x:t,y:i,w,h:C}))continue;let T=w*C;(!p||T>p.area||T===p.area&&C>p.h||T===p.area&&C===p.h&&w>p.w)&&(p={w,h:C,area:T})}return p?{w:p.w,h:p.h}:null}cancelPointerSequence(){if(!this._suppressDrag){this._suppressDrag=!0;try{this._gridstack().grid.setStatic(!0)}catch(e){}["pointerup","mouseup","touchend"].forEach(e=>{document.dispatchEvent(new Event(e,{bubbles:!0}))})}}onPointerRelease(){if(this._suppressDrag&&(this._suppressDrag=!1,!this.dashboard.isDashboardStatic()))try{this._gridstack().grid.setStatic(!1)}catch(e){}}duplicateWidget(e){let t=Se.create(),i=e.gridstackNode,s={w:i.w,h:i.h,id:t,selector:i.selector,input:{widgetProperties:{type:i.input.widgetProperties.type,uuid:t,config:F(i.input.widgetProperties.config)}}},r=this._gridstack();r.grid.willItFit(s)?r.grid.addWidget(s):(s.h=2,s.w=1,r.grid.willItFit(s)?r.grid.addWidget(s):this.toast.show("Insufficient space on the dashboard. Please reorganize to free up space.",0,!1,"error"))}pasteCopiedWidget(e,t){if(this.dashboard.isDashboardStatic())return;let i=this.dashboard.widgetClipboard(),s=i?.input?.widgetProperties;if(!i||!s?.type)return;let r=Se.create(),n={w:i.w,h:i.h,id:r,selector:i.selector,input:{widgetProperties:{type:s.type,uuid:r,config:F(s.config)}}};typeof e=="number"&&typeof t=="number"&&(n.x=e,n.y=t);let a=this._gridstack();a.grid.willItFit(n)?(a.grid.addWidget(n),this.dashboard.clearWidgetClipboard()):(n.h=2,n.w=1,a.grid.willItFit(n)?(a.grid.addWidget(n),this.dashboard.clearWidgetClipboard()):this.toast.show("Insufficient space on the dashboard. Please reorganize to free up space.",0,!1,"error"))}deleteWidget(e){let t=e.gridstackNode;this._gridstack().grid.removeWidget(e),t?.id&&this.datasetLifecycle.removeOwnedDatasets(t.id,!0)}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 e=this._gridstack();if(e?.grid&&(e.grid.offAll(),e.grid.destroy()),this._resizeObserver){try{this._resizeObserver.disconnect()}catch(t){}this._resizeObserver=void 0}this._pendingResizeRaf!==null&&(cancelAnimationFrame(this._pendingResizeRaf),this._pendingResizeRaf=null),this._uiEvent.removeHotkeyListener(this._boundHandleKeyDown)}static \u0275fac=function(t){return new(t||l)};static \u0275cmp=S({type:l,selectors:[["dashboard"]],viewQuery:function(t,i){t&1&>(i._gridstack,bi,5),t&2&&pt()},hostBindings:function(t,i){t&1&&x("mouseup",function(){return i.onPointerRelease()},Ke)("touchend",function(){return i.onPointerRelease()},Ke)},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(t,i){if(t&1&&(y(0,"gridstack",1,0),x("swipeup",function(){return i.previousDashboard()})("swipedown",function(){return i.nextDashboard()})("press",function(r){return i.addNewWidget(r)})("resize",function(){return i.resizeGridColumns()},rt),y(2,"div",2)(3,"div",3)(4,"mat-icon",4),v(5,"dashboard"),b(),W(6,vi,6,0)(7,wi,6,0),b(),y(8,"div")(9,"div",5)(10,"button",6),x("click",function(){return i.navigateToHelp()}),y(11,"mat-icon"),v(12,"help"),b(),v(13," Get Help "),b()()()()(),W(14,Ci,7,0,"div",7)(15,xi,1,2,"dashboard-scroller",8)),t&2){let s=i.dashboard.isDashboardStatic();I("mode",s?"dashboard":"editor")("enablePress",!s)("enableDoubleTap",!1)("options",i.gridOptions()),M(6),B(s?7:6),M(8),B(s?15:14)}},dependencies:[ye,qt,se,ie,kt,Dt,St,te],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 l})();export{Yt as a,Lo as b};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{Ca as w,Cb as ve,Ce as Xe,Da as me,Db as X,De as je,Eb as j,Fa as ue,Fb as z,Gb as W,Ge as ze,Hb as Ce,J as C,Jc as y,Je as We,K as ae,Ka as k,La as ce,Lc as m,Mb as xe,Nb as we,Nd as Oe,Ne as Qe,Ob as Q,Od as Ee,Pb as ke,Q as oe,Qb as l,Qd as Ae,Rb as U,Sb as I,Tb as De,Ub as Ie,Va as L,Vb as b,Wb as M,Xa as de,Xd as Z,Ya as H,_a as he,a as A,ab as pe,ac as K,ae as Fe,b as ne,ba as x,be as Be,ca as B,cb as Y,cc as Pe,da as se,de as Ne,ee as Le,fb as V,fe as He,g as v,gb as _e,gd as Re,hb as D,hd as Te,k as d,kb as ge,la as re,le as J,mb as fe,na as h,ne as Ye,pa as o,pd as q,rc as G,rd as Se,s as F,sb as be,ua as p,ub as f,va as _,wa as le,wb as Me,xb as ye,ya as g,za as N,ze as Ve}from"./chunk-BTFZS2TW.js";var it=["mat-menu-item",""],nt=[[["mat-icon"],["","matMenuItemIcon",""]],"*"],at=["mat-icon, [matMenuItemIcon]","*"];function ot(a,qe){a&1&&(le(),X(0,"svg",2),z(1,"polygon",3),j())}var st=["*"];function rt(a,qe){if(a&1){let e=xe();W(0,"div",0),ke("click",function(){p(e);let i=l();return _(i.closed.emit("click"))})("animationstart",function(i){p(e);let n=l();return _(n._onAnimationStart(i.animationName))})("animationend",function(i){p(e);let n=l();return _(n._onAnimationDone(i.animationName))})("animationcancel",function(i){p(e);let n=l();return _(n._onAnimationDone(i.animationName))}),W(1,"div",1),I(2),Ce()()}if(a&2){let e=l();Pe(e._classList),K("mat-menu-panel-animations-disabled",e._animationsDisabled)("mat-menu-panel-exit-animation",e._panelAnimationState==="void")("mat-menu-panel-animating",e._isAnimating()),we("id",e.panelId),f("aria-label",e.ariaLabel||null)("aria-labelledby",e.ariaLabelledby||null)("aria-describedby",e.ariaDescribedby||null)}}var te=new h("MAT_MENU_PANEL"),ee=(()=>{class a{_elementRef=o(k);_document=o(N);_focusMonitor=o(q);_parentMenu=o(te,{optional:!0});_changeDetectorRef=o(y);role="menuitem";disabled=!1;disableRipple=!1;_hovered=new d;_focused=new d;_highlighted=!1;_triggersSubmenu=!1;constructor(){o(Se).load(Be),this._parentMenu?.addItem?.(this)}focus(e,t){this._focusMonitor&&e?this._focusMonitor.focusVia(this._getHostElement(),e,t):this._getHostElement().focus(t),this._focused.next(this)}ngAfterViewInit(){this._focusMonitor&&this._focusMonitor.monitor(this._elementRef,!1)}ngOnDestroy(){this._focusMonitor&&this._focusMonitor.stopMonitoring(this._elementRef),this._parentMenu&&this._parentMenu.removeItem&&this._parentMenu.removeItem(this),this._hovered.complete(),this._focused.complete()}_getTabIndex(){return this.disabled?"-1":"0"}_getHostElement(){return this._elementRef.nativeElement}_checkDisabled(e){this.disabled&&(e.preventDefault(),e.stopPropagation())}_handleMouseEnter(){this._hovered.next(this)}getLabel(){let e=this._elementRef.nativeElement.cloneNode(!0),t=e.querySelectorAll("mat-icon, .material-icons");for(let i=0;i<t.length;i++)t[i].remove();return e.textContent?.trim()||""}_setHighlighted(e){this._highlighted=e,this._changeDetectorRef.markForCheck()}_setTriggersSubmenu(e){this._triggersSubmenu=e,this._changeDetectorRef.markForCheck()}_hasFocus(){return this._document&&this._document.activeElement===this._getHostElement()}static \u0275fac=function(t){return new(t||a)};static \u0275cmp=V({type:a,selectors:[["","mat-menu-item",""]],hostAttrs:[1,"mat-mdc-menu-item","mat-focus-indicator"],hostVars:8,hostBindings:function(t,i){t&1&&Q("click",function(s){return i._checkDisabled(s)})("mouseenter",function(){return i._handleMouseEnter()}),t&2&&(f("role",i.role)("tabindex",i._getTabIndex())("aria-disabled",i.disabled)("disabled",i.disabled||null),K("mat-mdc-menu-item-highlighted",i._highlighted)("mat-mdc-menu-item-submenu-trigger",i._triggersSubmenu))},inputs:{role:"role",disabled:[2,"disabled","disabled",m],disableRipple:[2,"disableRipple","disableRipple",m]},exportAs:["matMenuItem"],attrs:it,ngContentSelectors:at,decls:5,vars:3,consts:[[1,"mat-mdc-menu-item-text"],["matRipple","",1,"mat-mdc-menu-ripple",3,"matRippleDisabled","matRippleTrigger"],["viewBox","0 0 5 10","focusable","false","aria-hidden","true",1,"mat-mdc-menu-submenu-icon"],["points","0,0 5,5 0,10"]],template:function(t,i){t&1&&(U(nt),I(0),X(1,"span",0),I(2,1),j(),z(3,"div",1),Me(4,ot,2,0,":svg:svg",2)),t&2&&(L(3),ve("matRippleDisabled",i.disableRipple||i.disabled)("matRippleTrigger",i._getHostElement()),L(),ye(i._triggersSubmenu?4:-1))},dependencies:[Fe],encapsulation:2,changeDetection:0})}return a})();var Ge=new h("MatMenuContent"),Ht=(()=>{class a{_template=o(H);_appRef=o(be);_injector=o(g);_viewContainerRef=o(Y);_document=o(N);_changeDetectorRef=o(y);_portal;_outlet;_attached=new d;constructor(){}attach(e={}){this._portal||(this._portal=new J(this._template,this._viewContainerRef)),this.detach(),this._outlet||(this._outlet=new Ye(this._document.createElement("div"),this._appRef,this._injector));let t=this._template.elementRef.nativeElement;t.parentNode.insertBefore(this._outlet.outletElement,t),this._changeDetectorRef.markForCheck(),this._portal.attach(this._outlet,e),this._attached.next()}detach(){this._portal?.isAttached&&this._portal.detach()}ngOnDestroy(){this.detach(),this._outlet?.dispose()}static \u0275fac=function(t){return new(t||a)};static \u0275dir=D({type:a,selectors:[["ng-template","matMenuContent",""]],features:[G([{provide:Ge,useExisting:a}])]})}return a})(),lt=new h("mat-menu-default-options",{providedIn:"root",factory:()=>({overlapTrigger:!1,xPosition:"after",yPosition:"below",backdropClass:"cdk-overlay-transparent-backdrop"})}),$="_mat-menu-enter",P="_mat-menu-exit",R=(()=>{class a{_elementRef=o(k);_changeDetectorRef=o(y);_injector=o(g);_keyManager;_xPosition;_yPosition;_firstItemFocusRef;_exitFallbackTimeout;_animationsDisabled=Z();_allItems;_directDescendantItems=new ce;_classList={};_panelAnimationState="void";_animationDone=new d;_isAnimating=ue(!1);parentMenu;direction;overlayPanelClass;backdropClass;ariaLabel;ariaLabelledby;ariaDescribedby;get xPosition(){return this._xPosition}set xPosition(e){this._xPosition=e,this.setPositionClasses()}get yPosition(){return this._yPosition}set yPosition(e){this._yPosition=e,this.setPositionClasses()}templateRef;items;lazyContent;overlapTrigger=!1;hasBackdrop;set panelClass(e){let t=this._previousPanelClass,i=A({},this._classList);t&&t.length&&t.split(" ").forEach(n=>{i[n]=!1}),this._previousPanelClass=e,e&&e.length&&(e.split(" ").forEach(n=>{i[n]=!0}),this._elementRef.nativeElement.className=""),this._classList=i}_previousPanelClass;get classList(){return this.panelClass}set classList(e){this.panelClass=e}closed=new w;close=this.closed;panelId=o(Oe).getId("mat-menu-panel-");constructor(){let e=o(lt);this.overlayPanelClass=e.overlayPanelClass||"",this._xPosition=e.xPosition,this._yPosition=e.yPosition,this.backdropClass=e.backdropClass,this.overlapTrigger=e.overlapTrigger,this.hasBackdrop=e.hasBackdrop}ngOnInit(){this.setPositionClasses()}ngAfterContentInit(){this._updateDirectDescendants(),this._keyManager=new Ae(this._directDescendantItems).withWrap().withTypeAhead().withHomeAndEnd(),this._keyManager.tabOut.subscribe(()=>this.closed.emit("tab")),this._directDescendantItems.changes.pipe(x(this._directDescendantItems),B(e=>C(...e.map(t=>t._focused)))).subscribe(e=>this._keyManager.updateActiveItem(e)),this._directDescendantItems.changes.subscribe(e=>{let t=this._keyManager;if(this._panelAnimationState==="enter"&&t.activeItem?._hasFocus()){let i=e.toArray(),n=Math.max(0,Math.min(i.length-1,t.activeItemIndex||0));i[n]&&!i[n].disabled?t.setActiveItem(n):t.setNextItemActive()}})}ngOnDestroy(){this._keyManager?.destroy(),this._directDescendantItems.destroy(),this.closed.complete(),this._firstItemFocusRef?.destroy(),clearTimeout(this._exitFallbackTimeout)}_hovered(){return this._directDescendantItems.changes.pipe(x(this._directDescendantItems),B(t=>C(...t.map(i=>i._hovered))))}addItem(e){}removeItem(e){}_handleKeydown(e){let t=e.keyCode,i=this._keyManager;switch(t){case 27:Ee(e)||(e.preventDefault(),this.closed.emit("keydown"));break;case 37:this.parentMenu&&this.direction==="ltr"&&this.closed.emit("keydown");break;case 39:this.parentMenu&&this.direction==="rtl"&&this.closed.emit("keydown");break;default:(t===38||t===40)&&i.setFocusOrigin("keyboard"),i.onKeydown(e);return}}focusFirstItem(e="program"){this._firstItemFocusRef?.destroy(),this._firstItemFocusRef=de(()=>{let t=this._resolvePanel();if(!t||!t.contains(document.activeElement)){let i=this._keyManager;i.setFocusOrigin(e).setFirstItemActive(),!i.activeItem&&t&&t.focus()}},{injector:this._injector})}resetActiveItem(){this._keyManager.setActiveItem(-1)}setElevation(e){}setPositionClasses(e=this.xPosition,t=this.yPosition){this._classList=ne(A({},this._classList),{"mat-menu-before":e==="before","mat-menu-after":e==="after","mat-menu-above":t==="above","mat-menu-below":t==="below"}),this._changeDetectorRef.markForCheck()}_onAnimationDone(e){let t=e===P;(t||e===$)&&(t&&(clearTimeout(this._exitFallbackTimeout),this._exitFallbackTimeout=void 0),this._animationDone.next(t?"void":"enter"),this._isAnimating.set(!1))}_onAnimationStart(e){(e===$||e===P)&&this._isAnimating.set(!0)}_setIsOpen(e){if(this._panelAnimationState=e?"enter":"void",e){if(this._keyManager.activeItemIndex===0){let t=this._resolvePanel();t&&(t.scrollTop=0)}}else this._animationsDisabled||(this._exitFallbackTimeout=setTimeout(()=>this._onAnimationDone(P),200));this._animationsDisabled&&setTimeout(()=>{this._onAnimationDone(e?$:P)}),this._changeDetectorRef.markForCheck()}_updateDirectDescendants(){this._allItems.changes.pipe(x(this._allItems)).subscribe(e=>{this._directDescendantItems.reset(e.filter(t=>t._parentMenu===this)),this._directDescendantItems.notifyOnChanges()})}_resolvePanel(){let e=null;return this._directDescendantItems.length&&(e=this._directDescendantItems.first._getHostElement().closest('[role="menu"]')),e}static \u0275fac=function(t){return new(t||a)};static \u0275cmp=V({type:a,selectors:[["mat-menu"]],contentQueries:function(t,i,n){if(t&1&&De(n,Ge,5)(n,ee,5)(n,ee,4),t&2){let s;b(s=M())&&(i.lazyContent=s.first),b(s=M())&&(i._allItems=s),b(s=M())&&(i.items=s)}},viewQuery:function(t,i){if(t&1&&Ie(H,5),t&2){let n;b(n=M())&&(i.templateRef=n.first)}},hostVars:3,hostBindings:function(t,i){t&2&&f("aria-label",null)("aria-labelledby",null)("aria-describedby",null)},inputs:{backdropClass:"backdropClass",ariaLabel:[0,"aria-label","ariaLabel"],ariaLabelledby:[0,"aria-labelledby","ariaLabelledby"],ariaDescribedby:[0,"aria-describedby","ariaDescribedby"],xPosition:"xPosition",yPosition:"yPosition",overlapTrigger:[2,"overlapTrigger","overlapTrigger",m],hasBackdrop:[2,"hasBackdrop","hasBackdrop",e=>e==null?null:m(e)],panelClass:[0,"class","panelClass"],classList:"classList"},outputs:{closed:"closed",close:"close"},exportAs:["matMenu"],features:[G([{provide:te,useExisting:a}])],ngContentSelectors:st,decls:1,vars:0,consts:[["tabindex","-1","role","menu",1,"mat-mdc-menu-panel",3,"click","animationstart","animationend","animationcancel","id"],[1,"mat-mdc-menu-content"]],template:function(t,i){t&1&&(U(),fe(0,rt,3,12,"ng-template"))},styles:[`mat-menu{display:none}.mat-mdc-menu-content{margin:0;padding:8px 0;outline:0}.mat-mdc-menu-content,.mat-mdc-menu-content .mat-mdc-menu-item .mat-mdc-menu-item-text{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;flex:1;white-space:normal;font-family:var(--mat-menu-item-label-text-font, var(--mat-sys-label-large-font));line-height:var(--mat-menu-item-label-text-line-height, var(--mat-sys-label-large-line-height));font-size:var(--mat-menu-item-label-text-size, var(--mat-sys-label-large-size));letter-spacing:var(--mat-menu-item-label-text-tracking, var(--mat-sys-label-large-tracking));font-weight:var(--mat-menu-item-label-text-weight, var(--mat-sys-label-large-weight))}@keyframes _mat-menu-enter{from{opacity:0;transform:scale(0.8)}to{opacity:1;transform:none}}@keyframes _mat-menu-exit{from{opacity:1}to{opacity:0}}.mat-mdc-menu-panel{min-width:112px;max-width:280px;overflow:auto;box-sizing:border-box;outline:0;animation:_mat-menu-enter 120ms cubic-bezier(0, 0, 0.2, 1);border-radius:var(--mat-menu-container-shape, var(--mat-sys-corner-extra-small));background-color:var(--mat-menu-container-color, var(--mat-sys-surface-container));box-shadow:var(--mat-menu-container-elevation-shadow, 0px 3px 1px -2px rgba(0, 0, 0, 0.2), 0px 2px 2px 0px rgba(0, 0, 0, 0.14), 0px 1px 5px 0px rgba(0, 0, 0, 0.12));will-change:transform,opacity}.mat-mdc-menu-panel.mat-menu-panel-exit-animation{animation:_mat-menu-exit 100ms 25ms linear forwards}.mat-mdc-menu-panel.mat-menu-panel-animations-disabled{animation:none}.mat-mdc-menu-panel.mat-menu-panel-animating{pointer-events:none}.mat-mdc-menu-panel.mat-menu-panel-animating:has(.mat-mdc-menu-content:empty){display:none}@media(forced-colors: active){.mat-mdc-menu-panel{outline:solid 1px}}.mat-mdc-menu-panel .mat-divider{border-top-color:var(--mat-menu-divider-color, var(--mat-sys-surface-variant));margin-bottom:var(--mat-menu-divider-bottom-spacing, 8px);margin-top:var(--mat-menu-divider-top-spacing, 8px)}.mat-mdc-menu-item{display:flex;position:relative;align-items:center;justify-content:flex-start;overflow:hidden;padding:0;cursor:pointer;width:100%;text-align:left;box-sizing:border-box;color:inherit;font-size:inherit;background:none;text-decoration:none;margin:0;min-height:48px;padding-left:var(--mat-menu-item-leading-spacing, 12px);padding-right:var(--mat-menu-item-trailing-spacing, 12px);-webkit-user-select:none;user-select:none;cursor:pointer;outline:none;border:none;-webkit-tap-highlight-color:rgba(0,0,0,0)}.mat-mdc-menu-item::-moz-focus-inner{border:0}[dir=rtl] .mat-mdc-menu-item{padding-left:var(--mat-menu-item-trailing-spacing, 12px);padding-right:var(--mat-menu-item-leading-spacing, 12px)}.mat-mdc-menu-item:has(.material-icons,mat-icon,[matButtonIcon]){padding-left:var(--mat-menu-item-with-icon-leading-spacing, 12px);padding-right:var(--mat-menu-item-with-icon-trailing-spacing, 12px)}[dir=rtl] .mat-mdc-menu-item:has(.material-icons,mat-icon,[matButtonIcon]){padding-left:var(--mat-menu-item-with-icon-trailing-spacing, 12px);padding-right:var(--mat-menu-item-with-icon-leading-spacing, 12px)}.mat-mdc-menu-item,.mat-mdc-menu-item:visited,.mat-mdc-menu-item:link{color:var(--mat-menu-item-label-text-color, var(--mat-sys-on-surface))}.mat-mdc-menu-item .mat-icon-no-color,.mat-mdc-menu-item .mat-mdc-menu-submenu-icon{color:var(--mat-menu-item-icon-color, var(--mat-sys-on-surface-variant))}.mat-mdc-menu-item[disabled]{cursor:default;opacity:.38}.mat-mdc-menu-item[disabled]::after{display:block;position:absolute;content:"";top:0;left:0;bottom:0;right:0}.mat-mdc-menu-item:focus{outline:0}.mat-mdc-menu-item .mat-icon{flex-shrink:0;margin-right:var(--mat-menu-item-spacing, 12px);height:var(--mat-menu-item-icon-size, 24px);width:var(--mat-menu-item-icon-size, 24px)}[dir=rtl] .mat-mdc-menu-item{text-align:right}[dir=rtl] .mat-mdc-menu-item .mat-icon{margin-right:0;margin-left:var(--mat-menu-item-spacing, 12px)}.mat-mdc-menu-item:not([disabled]):hover{background-color:var(--mat-menu-item-hover-state-layer-color, color-mix(in srgb, var(--mat-sys-on-surface) calc(var(--mat-sys-hover-state-layer-opacity) * 100%), transparent))}.mat-mdc-menu-item:not([disabled]).cdk-program-focused,.mat-mdc-menu-item:not([disabled]).cdk-keyboard-focused,.mat-mdc-menu-item:not([disabled]).mat-mdc-menu-item-highlighted{background-color:var(--mat-menu-item-focus-state-layer-color, color-mix(in srgb, var(--mat-sys-on-surface) calc(var(--mat-sys-focus-state-layer-opacity) * 100%), transparent))}@media(forced-colors: active){.mat-mdc-menu-item{margin-top:1px}}.mat-mdc-menu-submenu-icon{width:var(--mat-menu-item-icon-size, 24px);height:10px;fill:currentColor;padding-left:var(--mat-menu-item-spacing, 12px)}[dir=rtl] .mat-mdc-menu-submenu-icon{padding-right:var(--mat-menu-item-spacing, 12px);padding-left:0}[dir=rtl] .mat-mdc-menu-submenu-icon polygon{transform:scaleX(-1);transform-origin:center}@media(forced-colors: active){.mat-mdc-menu-submenu-icon{fill:CanvasText}}.mat-mdc-menu-item .mat-mdc-menu-ripple{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none}
|
|
2
|
-
`],encapsulation:2,changeDetection:0})}return a})(),mt=new h("mat-menu-scroll-strategy",{providedIn:"root",factory:()=>{let a=o(g);return()=>Xe(a)}});var u=new WeakMap,ut=(()=>{class a{_canHaveBackdrop;_element=o(k);_viewContainerRef=o(Y);_menuItemInstance=o(ee,{optional:!0,self:!0});_dir=o(Ne,{optional:!0});_focusMonitor=o(q);_ngZone=o(me);_injector=o(g);_scrollStrategy=o(mt);_changeDetectorRef=o(y);_animationsDisabled=Z();_portal;_overlayRef=null;_menuOpen=!1;_closingActionsSubscription=v.EMPTY;_menuCloseSubscription=v.EMPTY;_pendingRemoval;_parentMaterialMenu;_parentInnerPadding;_openedBy=void 0;get _menu(){return this._menuInternal}set _menu(e){e!==this._menuInternal&&(this._menuInternal=e,this._menuCloseSubscription.unsubscribe(),e&&(this._parentMaterialMenu,this._menuCloseSubscription=e.close.subscribe(t=>{this._destroyMenu(t),(t==="click"||t==="tab")&&this._parentMaterialMenu&&this._parentMaterialMenu.closed.emit(t)})),this._menuItemInstance?._setTriggersSubmenu(this._triggersSubmenu()))}_menuInternal=null;constructor(e){this._canHaveBackdrop=e;let t=o(te,{optional:!0});this._parentMaterialMenu=t instanceof R?t:void 0}ngOnDestroy(){this._menu&&this._ownsMenu(this._menu)&&u.delete(this._menu),this._pendingRemoval?.unsubscribe(),this._menuCloseSubscription.unsubscribe(),this._closingActionsSubscription.unsubscribe(),this._overlayRef&&(this._overlayRef.dispose(),this._overlayRef=null)}get menuOpen(){return this._menuOpen}get dir(){return this._dir&&this._dir.value==="rtl"?"rtl":"ltr"}_triggersSubmenu(){return!!(this._menuItemInstance&&this._parentMaterialMenu&&this._menu)}_closeMenu(){this._menu?.close.emit()}_openMenu(e){if(this._triggerIsAriaDisabled())return;let t=this._menu;if(this._menuOpen||!t)return;this._pendingRemoval?.unsubscribe();let i=u.get(t);u.set(t,this),i&&i!==this&&i._closeMenu();let n=this._createOverlay(t),s=n.getConfig(),r=s.positionStrategy;this._setPosition(t,r),this._canHaveBackdrop?s.hasBackdrop=t.hasBackdrop==null?!this._triggersSubmenu():t.hasBackdrop:s.hasBackdrop
|
|
1
|
+
import{Ca as w,Cb as ve,Ce as Xe,Da as me,Db as X,De as je,Eb as j,Fa as ue,Fb as z,Gb as W,Ge as ze,Hb as Ce,J as C,Jc as y,Je as We,K as ae,Ka as k,La as ce,Lc as m,Mb as xe,Nb as we,Nd as Oe,Ne as Qe,Ob as Q,Od as Ee,Pb as ke,Q as oe,Qb as l,Qd as Ae,Rb as U,Sb as I,Tb as De,Ub as Ie,Va as L,Vb as b,Wb as M,Xa as de,Xd as Z,Ya as H,_a as he,a as A,ab as pe,ac as K,ae as Fe,b as ne,ba as x,be as Be,ca as B,cb as Y,cc as Pe,da as se,de as Ne,ee as Le,fb as V,fe as He,g as v,gb as _e,gd as Re,hb as D,hd as Te,k as d,kb as ge,la as re,le as J,mb as fe,na as h,ne as Ye,pa as o,pd as q,rc as G,rd as Se,s as F,sb as be,ua as p,ub as f,va as _,wa as le,wb as Me,xb as ye,ya as g,za as N,ze as Ve}from"./chunk-PZ6I6W3H.js";var it=["mat-menu-item",""],nt=[[["mat-icon"],["","matMenuItemIcon",""]],"*"],at=["mat-icon, [matMenuItemIcon]","*"];function ot(a,qe){a&1&&(le(),X(0,"svg",2),z(1,"polygon",3),j())}var st=["*"];function rt(a,qe){if(a&1){let e=xe();W(0,"div",0),ke("click",function(){p(e);let i=l();return _(i.closed.emit("click"))})("animationstart",function(i){p(e);let n=l();return _(n._onAnimationStart(i.animationName))})("animationend",function(i){p(e);let n=l();return _(n._onAnimationDone(i.animationName))})("animationcancel",function(i){p(e);let n=l();return _(n._onAnimationDone(i.animationName))}),W(1,"div",1),I(2),Ce()()}if(a&2){let e=l();Pe(e._classList),K("mat-menu-panel-animations-disabled",e._animationsDisabled)("mat-menu-panel-exit-animation",e._panelAnimationState==="void")("mat-menu-panel-animating",e._isAnimating()),we("id",e.panelId),f("aria-label",e.ariaLabel||null)("aria-labelledby",e.ariaLabelledby||null)("aria-describedby",e.ariaDescribedby||null)}}var te=new h("MAT_MENU_PANEL"),ee=(()=>{class a{_elementRef=o(k);_document=o(N);_focusMonitor=o(q);_parentMenu=o(te,{optional:!0});_changeDetectorRef=o(y);role="menuitem";disabled=!1;disableRipple=!1;_hovered=new d;_focused=new d;_highlighted=!1;_triggersSubmenu=!1;constructor(){o(Se).load(Be),this._parentMenu?.addItem?.(this)}focus(e,t){this._focusMonitor&&e?this._focusMonitor.focusVia(this._getHostElement(),e,t):this._getHostElement().focus(t),this._focused.next(this)}ngAfterViewInit(){this._focusMonitor&&this._focusMonitor.monitor(this._elementRef,!1)}ngOnDestroy(){this._focusMonitor&&this._focusMonitor.stopMonitoring(this._elementRef),this._parentMenu&&this._parentMenu.removeItem&&this._parentMenu.removeItem(this),this._hovered.complete(),this._focused.complete()}_getTabIndex(){return this.disabled?"-1":"0"}_getHostElement(){return this._elementRef.nativeElement}_checkDisabled(e){this.disabled&&(e.preventDefault(),e.stopPropagation())}_handleMouseEnter(){this._hovered.next(this)}getLabel(){let e=this._elementRef.nativeElement.cloneNode(!0),t=e.querySelectorAll("mat-icon, .material-icons");for(let i=0;i<t.length;i++)t[i].remove();return e.textContent?.trim()||""}_setHighlighted(e){this._highlighted=e,this._changeDetectorRef.markForCheck()}_setTriggersSubmenu(e){this._triggersSubmenu=e,this._changeDetectorRef.markForCheck()}_hasFocus(){return this._document&&this._document.activeElement===this._getHostElement()}static \u0275fac=function(t){return new(t||a)};static \u0275cmp=V({type:a,selectors:[["","mat-menu-item",""]],hostAttrs:[1,"mat-mdc-menu-item","mat-focus-indicator"],hostVars:8,hostBindings:function(t,i){t&1&&Q("click",function(s){return i._checkDisabled(s)})("mouseenter",function(){return i._handleMouseEnter()}),t&2&&(f("role",i.role)("tabindex",i._getTabIndex())("aria-disabled",i.disabled)("disabled",i.disabled||null),K("mat-mdc-menu-item-highlighted",i._highlighted)("mat-mdc-menu-item-submenu-trigger",i._triggersSubmenu))},inputs:{role:"role",disabled:[2,"disabled","disabled",m],disableRipple:[2,"disableRipple","disableRipple",m]},exportAs:["matMenuItem"],attrs:it,ngContentSelectors:at,decls:5,vars:3,consts:[[1,"mat-mdc-menu-item-text"],["matRipple","",1,"mat-mdc-menu-ripple",3,"matRippleDisabled","matRippleTrigger"],["viewBox","0 0 5 10","focusable","false","aria-hidden","true",1,"mat-mdc-menu-submenu-icon"],["points","0,0 5,5 0,10"]],template:function(t,i){t&1&&(U(nt),I(0),X(1,"span",0),I(2,1),j(),z(3,"div",1),Me(4,ot,2,0,":svg:svg",2)),t&2&&(L(3),ve("matRippleDisabled",i.disableRipple||i.disabled)("matRippleTrigger",i._getHostElement()),L(),ye(i._triggersSubmenu?4:-1))},dependencies:[Fe],encapsulation:2,changeDetection:0})}return a})();var Ge=new h("MatMenuContent"),Ht=(()=>{class a{_template=o(H);_appRef=o(be);_injector=o(g);_viewContainerRef=o(Y);_document=o(N);_changeDetectorRef=o(y);_portal;_outlet;_attached=new d;constructor(){}attach(e={}){this._portal||(this._portal=new J(this._template,this._viewContainerRef)),this.detach(),this._outlet||(this._outlet=new Ye(this._document.createElement("div"),this._appRef,this._injector));let t=this._template.elementRef.nativeElement;t.parentNode.insertBefore(this._outlet.outletElement,t),this._changeDetectorRef.markForCheck(),this._portal.attach(this._outlet,e),this._attached.next()}detach(){this._portal?.isAttached&&this._portal.detach()}ngOnDestroy(){this.detach(),this._outlet?.dispose()}static \u0275fac=function(t){return new(t||a)};static \u0275dir=D({type:a,selectors:[["ng-template","matMenuContent",""]],features:[G([{provide:Ge,useExisting:a}])]})}return a})(),lt=new h("mat-menu-default-options",{providedIn:"root",factory:()=>({overlapTrigger:!1,xPosition:"after",yPosition:"below",backdropClass:"cdk-overlay-transparent-backdrop"})}),$="_mat-menu-enter",P="_mat-menu-exit",R=(()=>{class a{_elementRef=o(k);_changeDetectorRef=o(y);_injector=o(g);_keyManager;_xPosition;_yPosition;_firstItemFocusRef;_exitFallbackTimeout;_animationsDisabled=Z();_allItems;_directDescendantItems=new ce;_classList={};_panelAnimationState="void";_animationDone=new d;_isAnimating=ue(!1);parentMenu;direction;overlayPanelClass;backdropClass;ariaLabel;ariaLabelledby;ariaDescribedby;get xPosition(){return this._xPosition}set xPosition(e){this._xPosition=e,this.setPositionClasses()}get yPosition(){return this._yPosition}set yPosition(e){this._yPosition=e,this.setPositionClasses()}templateRef;items;lazyContent;overlapTrigger=!1;hasBackdrop;set panelClass(e){let t=this._previousPanelClass,i=A({},this._classList);t&&t.length&&t.split(" ").forEach(n=>{i[n]=!1}),this._previousPanelClass=e,e&&e.length&&(e.split(" ").forEach(n=>{i[n]=!0}),this._elementRef.nativeElement.className=""),this._classList=i}_previousPanelClass;get classList(){return this.panelClass}set classList(e){this.panelClass=e}closed=new w;close=this.closed;panelId=o(Oe).getId("mat-menu-panel-");constructor(){let e=o(lt);this.overlayPanelClass=e.overlayPanelClass||"",this._xPosition=e.xPosition,this._yPosition=e.yPosition,this.backdropClass=e.backdropClass,this.overlapTrigger=e.overlapTrigger,this.hasBackdrop=e.hasBackdrop}ngOnInit(){this.setPositionClasses()}ngAfterContentInit(){this._updateDirectDescendants(),this._keyManager=new Ae(this._directDescendantItems).withWrap().withTypeAhead().withHomeAndEnd(),this._keyManager.tabOut.subscribe(()=>this.closed.emit("tab")),this._directDescendantItems.changes.pipe(x(this._directDescendantItems),B(e=>C(...e.map(t=>t._focused)))).subscribe(e=>this._keyManager.updateActiveItem(e)),this._directDescendantItems.changes.subscribe(e=>{let t=this._keyManager;if(this._panelAnimationState==="enter"&&t.activeItem?._hasFocus()){let i=e.toArray(),n=Math.max(0,Math.min(i.length-1,t.activeItemIndex||0));i[n]&&!i[n].disabled?t.setActiveItem(n):t.setNextItemActive()}})}ngOnDestroy(){this._keyManager?.destroy(),this._directDescendantItems.destroy(),this.closed.complete(),this._firstItemFocusRef?.destroy(),clearTimeout(this._exitFallbackTimeout)}_hovered(){return this._directDescendantItems.changes.pipe(x(this._directDescendantItems),B(t=>C(...t.map(i=>i._hovered))))}addItem(e){}removeItem(e){}_handleKeydown(e){let t=e.keyCode,i=this._keyManager;switch(t){case 27:Ee(e)||(e.preventDefault(),this.closed.emit("keydown"));break;case 37:this.parentMenu&&this.direction==="ltr"&&this.closed.emit("keydown");break;case 39:this.parentMenu&&this.direction==="rtl"&&this.closed.emit("keydown");break;default:(t===38||t===40)&&i.setFocusOrigin("keyboard"),i.onKeydown(e);return}}focusFirstItem(e="program"){this._firstItemFocusRef?.destroy(),this._firstItemFocusRef=de(()=>{let t=this._resolvePanel();if(!t||!t.contains(document.activeElement)){let i=this._keyManager;i.setFocusOrigin(e).setFirstItemActive(),!i.activeItem&&t&&t.focus()}},{injector:this._injector})}resetActiveItem(){this._keyManager.setActiveItem(-1)}setElevation(e){}setPositionClasses(e=this.xPosition,t=this.yPosition){this._classList=ne(A({},this._classList),{"mat-menu-before":e==="before","mat-menu-after":e==="after","mat-menu-above":t==="above","mat-menu-below":t==="below"}),this._changeDetectorRef.markForCheck()}_onAnimationDone(e){let t=e===P;(t||e===$)&&(t&&(clearTimeout(this._exitFallbackTimeout),this._exitFallbackTimeout=void 0),this._animationDone.next(t?"void":"enter"),this._isAnimating.set(!1))}_onAnimationStart(e){(e===$||e===P)&&this._isAnimating.set(!0)}_setIsOpen(e){if(this._panelAnimationState=e?"enter":"void",e){if(this._keyManager.activeItemIndex===0){let t=this._resolvePanel();t&&(t.scrollTop=0)}}else this._animationsDisabled||(this._exitFallbackTimeout=setTimeout(()=>this._onAnimationDone(P),200));this._animationsDisabled&&setTimeout(()=>{this._onAnimationDone(e?$:P)}),this._changeDetectorRef.markForCheck()}_updateDirectDescendants(){this._allItems.changes.pipe(x(this._allItems)).subscribe(e=>{this._directDescendantItems.reset(e.filter(t=>t._parentMenu===this)),this._directDescendantItems.notifyOnChanges()})}_resolvePanel(){let e=null;return this._directDescendantItems.length&&(e=this._directDescendantItems.first._getHostElement().closest('[role="menu"]')),e}static \u0275fac=function(t){return new(t||a)};static \u0275cmp=V({type:a,selectors:[["mat-menu"]],contentQueries:function(t,i,n){if(t&1&&De(n,Ge,5)(n,ee,5)(n,ee,4),t&2){let s;b(s=M())&&(i.lazyContent=s.first),b(s=M())&&(i._allItems=s),b(s=M())&&(i.items=s)}},viewQuery:function(t,i){if(t&1&&Ie(H,5),t&2){let n;b(n=M())&&(i.templateRef=n.first)}},hostVars:3,hostBindings:function(t,i){t&2&&f("aria-label",null)("aria-labelledby",null)("aria-describedby",null)},inputs:{backdropClass:"backdropClass",ariaLabel:[0,"aria-label","ariaLabel"],ariaLabelledby:[0,"aria-labelledby","ariaLabelledby"],ariaDescribedby:[0,"aria-describedby","ariaDescribedby"],xPosition:"xPosition",yPosition:"yPosition",overlapTrigger:[2,"overlapTrigger","overlapTrigger",m],hasBackdrop:[2,"hasBackdrop","hasBackdrop",e=>e==null?null:m(e)],panelClass:[0,"class","panelClass"],classList:"classList"},outputs:{closed:"closed",close:"close"},exportAs:["matMenu"],features:[G([{provide:te,useExisting:a}])],ngContentSelectors:st,decls:1,vars:0,consts:[["tabindex","-1","role","menu",1,"mat-mdc-menu-panel",3,"click","animationstart","animationend","animationcancel","id"],[1,"mat-mdc-menu-content"]],template:function(t,i){t&1&&(U(),fe(0,rt,3,12,"ng-template"))},styles:[`mat-menu{display:none}.mat-mdc-menu-content{margin:0;padding:8px 0;outline:0}.mat-mdc-menu-content,.mat-mdc-menu-content .mat-mdc-menu-item .mat-mdc-menu-item-text{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;flex:1;white-space:normal;font-family:var(--mat-menu-item-label-text-font, var(--mat-sys-label-large-font));line-height:var(--mat-menu-item-label-text-line-height, var(--mat-sys-label-large-line-height));font-size:var(--mat-menu-item-label-text-size, var(--mat-sys-label-large-size));letter-spacing:var(--mat-menu-item-label-text-tracking, var(--mat-sys-label-large-tracking));font-weight:var(--mat-menu-item-label-text-weight, var(--mat-sys-label-large-weight))}@keyframes _mat-menu-enter{from{opacity:0;transform:scale(0.8)}to{opacity:1;transform:none}}@keyframes _mat-menu-exit{from{opacity:1}to{opacity:0}}.mat-mdc-menu-panel{min-width:112px;max-width:280px;overflow:auto;box-sizing:border-box;outline:0;animation:_mat-menu-enter 120ms cubic-bezier(0, 0, 0.2, 1);border-radius:var(--mat-menu-container-shape, var(--mat-sys-corner-extra-small));background-color:var(--mat-menu-container-color, var(--mat-sys-surface-container));box-shadow:var(--mat-menu-container-elevation-shadow, 0px 3px 1px -2px rgba(0, 0, 0, 0.2), 0px 2px 2px 0px rgba(0, 0, 0, 0.14), 0px 1px 5px 0px rgba(0, 0, 0, 0.12));will-change:transform,opacity}.mat-mdc-menu-panel.mat-menu-panel-exit-animation{animation:_mat-menu-exit 100ms 25ms linear forwards}.mat-mdc-menu-panel.mat-menu-panel-animations-disabled{animation:none}.mat-mdc-menu-panel.mat-menu-panel-animating{pointer-events:none}.mat-mdc-menu-panel.mat-menu-panel-animating:has(.mat-mdc-menu-content:empty){display:none}@media(forced-colors: active){.mat-mdc-menu-panel{outline:solid 1px}}.mat-mdc-menu-panel .mat-divider{border-top-color:var(--mat-menu-divider-color, var(--mat-sys-surface-variant));margin-bottom:var(--mat-menu-divider-bottom-spacing, 8px);margin-top:var(--mat-menu-divider-top-spacing, 8px)}.mat-mdc-menu-item{display:flex;position:relative;align-items:center;justify-content:flex-start;overflow:hidden;padding:0;cursor:pointer;width:100%;text-align:left;box-sizing:border-box;color:inherit;font-size:inherit;background:none;text-decoration:none;margin:0;min-height:48px;padding-left:var(--mat-menu-item-leading-spacing, 12px);padding-right:var(--mat-menu-item-trailing-spacing, 12px);-webkit-user-select:none;user-select:none;cursor:pointer;outline:none;border:none;-webkit-tap-highlight-color:rgba(0,0,0,0)}.mat-mdc-menu-item::-moz-focus-inner{border:0}[dir=rtl] .mat-mdc-menu-item{padding-left:var(--mat-menu-item-trailing-spacing, 12px);padding-right:var(--mat-menu-item-leading-spacing, 12px)}.mat-mdc-menu-item:has(.material-icons,mat-icon,[matButtonIcon]){padding-left:var(--mat-menu-item-with-icon-leading-spacing, 12px);padding-right:var(--mat-menu-item-with-icon-trailing-spacing, 12px)}[dir=rtl] .mat-mdc-menu-item:has(.material-icons,mat-icon,[matButtonIcon]){padding-left:var(--mat-menu-item-with-icon-trailing-spacing, 12px);padding-right:var(--mat-menu-item-with-icon-leading-spacing, 12px)}.mat-mdc-menu-item,.mat-mdc-menu-item:visited,.mat-mdc-menu-item:link{color:var(--mat-menu-item-label-text-color, var(--mat-sys-on-surface))}.mat-mdc-menu-item .mat-icon-no-color,.mat-mdc-menu-item .mat-mdc-menu-submenu-icon{color:var(--mat-menu-item-icon-color, var(--mat-sys-on-surface-variant))}.mat-mdc-menu-item[disabled]{cursor:default;opacity:.38}.mat-mdc-menu-item[disabled]::after{display:block;position:absolute;content:"";top:0;left:0;bottom:0;right:0}.mat-mdc-menu-item:focus{outline:0}.mat-mdc-menu-item .mat-icon{flex-shrink:0;margin-right:var(--mat-menu-item-spacing, 12px);height:var(--mat-menu-item-icon-size, 24px);width:var(--mat-menu-item-icon-size, 24px)}[dir=rtl] .mat-mdc-menu-item{text-align:right}[dir=rtl] .mat-mdc-menu-item .mat-icon{margin-right:0;margin-left:var(--mat-menu-item-spacing, 12px)}.mat-mdc-menu-item:not([disabled]):hover{background-color:var(--mat-menu-item-hover-state-layer-color, color-mix(in srgb, var(--mat-sys-on-surface) calc(var(--mat-sys-hover-state-layer-opacity) * 100%), transparent))}.mat-mdc-menu-item:not([disabled]).cdk-program-focused,.mat-mdc-menu-item:not([disabled]).cdk-keyboard-focused,.mat-mdc-menu-item:not([disabled]).mat-mdc-menu-item-highlighted{background-color:var(--mat-menu-item-focus-state-layer-color, color-mix(in srgb, var(--mat-sys-on-surface) calc(var(--mat-sys-focus-state-layer-opacity) * 100%), transparent))}@media(forced-colors: active){.mat-mdc-menu-item{margin-top:1px}}.mat-mdc-menu-submenu-icon{width:var(--mat-menu-item-icon-size, 24px);height:10px;fill:currentColor;padding-left:var(--mat-menu-item-spacing, 12px)}[dir=rtl] .mat-mdc-menu-submenu-icon{padding-right:var(--mat-menu-item-spacing, 12px);padding-left:0}[dir=rtl] .mat-mdc-menu-submenu-icon polygon{transform:scaleX(-1);transform-origin:center}@media(forced-colors: active){.mat-mdc-menu-submenu-icon{fill:CanvasText}}.mat-mdc-menu-item .mat-mdc-menu-ripple{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none}
|
|
2
|
+
`],encapsulation:2,changeDetection:0})}return a})(),mt=new h("mat-menu-scroll-strategy",{providedIn:"root",factory:()=>{let a=o(g);return()=>Xe(a)}});var u=new WeakMap,ut=(()=>{class a{_canHaveBackdrop;_element=o(k);_viewContainerRef=o(Y);_menuItemInstance=o(ee,{optional:!0,self:!0});_dir=o(Ne,{optional:!0});_focusMonitor=o(q);_ngZone=o(me);_injector=o(g);_scrollStrategy=o(mt);_changeDetectorRef=o(y);_animationsDisabled=Z();_portal;_overlayRef=null;_menuOpen=!1;_closingActionsSubscription=v.EMPTY;_menuCloseSubscription=v.EMPTY;_pendingRemoval;_parentMaterialMenu;_parentInnerPadding;_openedBy=void 0;get _menu(){return this._menuInternal}set _menu(e){e!==this._menuInternal&&(this._menuInternal=e,this._menuCloseSubscription.unsubscribe(),e&&(this._parentMaterialMenu,this._menuCloseSubscription=e.close.subscribe(t=>{this._destroyMenu(t),(t==="click"||t==="tab")&&this._parentMaterialMenu&&this._parentMaterialMenu.closed.emit(t)})),this._menuItemInstance?._setTriggersSubmenu(this._triggersSubmenu()))}_menuInternal=null;constructor(e){this._canHaveBackdrop=e;let t=o(te,{optional:!0});this._parentMaterialMenu=t instanceof R?t:void 0}ngOnDestroy(){this._menu&&this._ownsMenu(this._menu)&&u.delete(this._menu),this._pendingRemoval?.unsubscribe(),this._menuCloseSubscription.unsubscribe(),this._closingActionsSubscription.unsubscribe(),this._overlayRef&&(this._overlayRef.dispose(),this._overlayRef=null)}get menuOpen(){return this._menuOpen}get dir(){return this._dir&&this._dir.value==="rtl"?"rtl":"ltr"}_triggersSubmenu(){return!!(this._menuItemInstance&&this._parentMaterialMenu&&this._menu)}_closeMenu(){this._menu?.close.emit()}_openMenu(e){if(this._triggerIsAriaDisabled())return;let t=this._menu;if(this._menuOpen||!t)return;this._pendingRemoval?.unsubscribe();let i=u.get(t);u.set(t,this),i&&i!==this&&i._closeMenu();let n=this._createOverlay(t),s=n.getConfig(),r=s.positionStrategy;this._setPosition(t,r),this._canHaveBackdrop?s.hasBackdrop=t.hasBackdrop==null?!this._triggersSubmenu():t.hasBackdrop:s.hasBackdrop=t.hasBackdrop??!1,n.hasAttached()||(n.attach(this._getPortal(t)),t.lazyContent?.attach(this.menuData)),this._closingActionsSubscription=this._menuClosingActions().subscribe(()=>this._closeMenu()),t.parentMenu=this._triggersSubmenu()?this._parentMaterialMenu:void 0,t.direction=this.dir,e&&t.focusFirstItem(this._openedBy||"program"),this._setIsMenuOpen(!0),t instanceof R&&(t._setIsOpen(!0),t._directDescendantItems.changes.pipe(se(t.close)).subscribe(()=>{r.withLockedPosition(!1).reapplyLastPosition(),r.withLockedPosition(!0)}))}focus(e,t){this._focusMonitor&&e?this._focusMonitor.focusVia(this._element,e,t):this._element.nativeElement.focus(t)}_destroyMenu(e){let t=this._overlayRef,i=this._menu;!t||!this.menuOpen||(this._closingActionsSubscription.unsubscribe(),this._pendingRemoval?.unsubscribe(),i instanceof R&&this._ownsMenu(i)?(this._pendingRemoval=i._animationDone.pipe(oe(1)).subscribe(()=>{t.detach(),u.has(i)||i.lazyContent?.detach()}),i._setIsOpen(!1)):(t.detach(),i?.lazyContent?.detach()),i&&this._ownsMenu(i)&&u.delete(i),this.restoreFocus&&(e==="keydown"||!this._openedBy||!this._triggersSubmenu())&&this.focus(this._openedBy),this._openedBy=void 0,this._setIsMenuOpen(!1))}_setIsMenuOpen(e){e!==this._menuOpen&&(this._menuOpen=e,this._menuOpen?this.menuOpened.emit():this.menuClosed.emit(),this._triggersSubmenu()&&this._menuItemInstance._setHighlighted(e),this._changeDetectorRef.markForCheck())}_createOverlay(e){if(!this._overlayRef){let t=this._getOverlayConfig(e);this._subscribeToPositions(e,t.positionStrategy),this._overlayRef=We(this._injector,t),this._overlayRef.keydownEvents().subscribe(i=>{this._menu instanceof R&&this._menu._handleKeydown(i)})}return this._overlayRef}_getOverlayConfig(e){return new je({positionStrategy:ze(this._injector,this._getOverlayOrigin()).withLockedPosition().withGrowAfterOpen().withTransformOriginOn(".mat-menu-panel, .mat-mdc-menu-panel"),backdropClass:e.backdropClass||"cdk-overlay-transparent-backdrop",panelClass:e.overlayPanelClass,scrollStrategy:this._scrollStrategy(),direction:this._dir||"ltr",disableAnimations:this._animationsDisabled})}_subscribeToPositions(e,t){e.setPositionClasses&&t.positionChanges.subscribe(i=>{this._ngZone.run(()=>{let n=i.connectionPair.overlayX==="start"?"after":"before",s=i.connectionPair.overlayY==="top"?"below":"above";e.setPositionClasses(n,s)})})}_setPosition(e,t){let[i,n]=e.xPosition==="before"?["end","start"]:["start","end"],[s,r]=e.yPosition==="above"?["bottom","top"]:["top","bottom"],[T,S]=[s,r],[O,E]=[i,n],c=0;if(this._triggersSubmenu()){if(E=i=e.xPosition==="before"?"start":"end",n=O=i==="end"?"start":"end",this._parentMaterialMenu){if(this._parentInnerPadding==null){let ie=this._parentMaterialMenu.items.first;this._parentInnerPadding=ie?ie._getHostElement().offsetTop:0}c=s==="bottom"?this._parentInnerPadding:-this._parentInnerPadding}}else e.overlapTrigger||(T=s==="top"?"bottom":"top",S=r==="top"?"bottom":"top");t.withPositions([{originX:i,originY:T,overlayX:O,overlayY:s,offsetY:c},{originX:n,originY:T,overlayX:E,overlayY:s,offsetY:c},{originX:i,originY:S,overlayX:O,overlayY:r,offsetY:-c},{originX:n,originY:S,overlayX:E,overlayY:r,offsetY:-c}])}_menuClosingActions(){let e=this._getOutsideClickStream(this._overlayRef),t=this._overlayRef.detachments(),i=this._parentMaterialMenu?this._parentMaterialMenu.closed:F(),n=this._parentMaterialMenu?this._parentMaterialMenu._hovered().pipe(ae(s=>this._menuOpen&&s!==this._menuItemInstance)):F();return C(e,i,n,t)}_getPortal(e){return(!this._portal||this._portal.templateRef!==e.templateRef)&&(this._portal=new J(e.templateRef,this._viewContainerRef)),this._portal}_ownsMenu(e){return u.get(e)===this}_triggerIsAriaDisabled(){return m(this._element.nativeElement.getAttribute("aria-disabled"))}static \u0275fac=function(t){pe()};static \u0275dir=D({type:a})}return a})(),Yt=(()=>{class a extends ut{_cleanupTouchstart;_hoverSubscription=v.EMPTY;get _deprecatedMatMenuTriggerFor(){return this.menu}set _deprecatedMatMenuTriggerFor(e){this.menu=e}get menu(){return this._menu}set menu(e){this._menu=e}menuData;restoreFocus=!0;menuOpened=new w;onMenuOpen=this.menuOpened;menuClosed=new w;onMenuClose=this.menuClosed;constructor(){super(!0);let e=o(he);this._cleanupTouchstart=e.listen(this._element.nativeElement,"touchstart",t=>{Te(t)||(this._openedBy="touch")},{passive:!0})}triggersSubmenu(){return super._triggersSubmenu()}toggleMenu(){return this.menuOpen?this.closeMenu():this.openMenu()}openMenu(){this._openMenu(!0)}closeMenu(){this._closeMenu()}updatePosition(){this._overlayRef?.updatePosition()}ngAfterContentInit(){this._handleHover()}ngOnDestroy(){super.ngOnDestroy(),this._cleanupTouchstart(),this._hoverSubscription.unsubscribe()}_getOverlayOrigin(){return this._element}_getOutsideClickStream(e){return e.backdropClick()}_handleMousedown(e){Re(e)||(this._openedBy=e.button===0?"mouse":void 0,this.triggersSubmenu()&&e.preventDefault())}_handleKeydown(e){let t=e.keyCode;(t===13||t===32)&&(this._openedBy="keyboard"),this.triggersSubmenu()&&(t===39&&this.dir==="ltr"||t===37&&this.dir==="rtl")&&(this._openedBy="keyboard",this.openMenu())}_handleClick(e){this.triggersSubmenu()?(e.stopPropagation(),this.openMenu()):this.toggleMenu()}_handleHover(){this.triggersSubmenu()&&this._parentMaterialMenu&&(this._hoverSubscription=this._parentMaterialMenu._hovered().subscribe(e=>{e===this._menuItemInstance&&!e.disabled&&this._parentMaterialMenu?._panelAnimationState!=="void"&&(this._openedBy="mouse",this._openMenu(!1))}))}static \u0275fac=function(t){return new(t||a)};static \u0275dir=D({type:a,selectors:[["","mat-menu-trigger-for",""],["","matMenuTriggerFor",""]],hostAttrs:[1,"mat-mdc-menu-trigger"],hostVars:3,hostBindings:function(t,i){t&1&&Q("click",function(s){return i._handleClick(s)})("mousedown",function(s){return i._handleMousedown(s)})("keydown",function(s){return i._handleKeydown(s)}),t&2&&f("aria-haspopup",i.menu?"menu":null)("aria-expanded",i.menuOpen)("aria-controls",i.menuOpen?i.menu==null?null:i.menu.panelId:null)},inputs:{_deprecatedMatMenuTriggerFor:[0,"mat-menu-trigger-for","_deprecatedMatMenuTriggerFor"],menu:[0,"matMenuTriggerFor","menu"],menuData:[0,"matMenuTriggerData","menuData"],restoreFocus:[0,"matMenuTriggerRestoreFocus","restoreFocus"]},outputs:{menuOpened:"menuOpened",onMenuOpen:"onMenuOpen",menuClosed:"menuClosed",onMenuClose:"onMenuClose"},exportAs:["matMenuTrigger"],features:[ge]})}return a})();var Vt=(()=>{class a{static \u0275fac=function(t){return new(t||a)};static \u0275mod=_e({type:a});static \u0275inj=re({imports:[He,Qe,Le,Ve]})}return a})();export{ee as a,Ht as b,R as c,Yt as d,Vt as e};
|