@window-splitter/vue 1.1.3 → 1.2.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/.turbo/turbo-build.log +5 -5
- package/.turbo/turbo-test.log +18 -376
- package/CHANGELOG.md +17 -0
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +826 -809
- package/dist/index.mjs.map +1 -1
- package/package.json +20 -20
- package/src/PanelGroup.vue +2 -2
- package/.turbo/turbo-lint.log +0 -18
- package/LICENSE +0 -7
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const w=require("vue");var Ee=20,Be=1,X=1e6,Ke=1e6,Ne=-7,Oe=21,He=!1,ee="[big.js] ",W=ee+"Invalid ",se=W+"decimal places",$e=W+"rounding mode",ye=ee+"Division by zero",y={},O=void 0,Me=/^-?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i;function Pe(){function e(t){var a=this;if(!(a instanceof e))return t===O?Pe():new e(t);if(t instanceof e)a.s=t.s,a.e=t.e,a.c=t.c.slice();else{if(typeof t!="string"){if(e.strict===!0&&typeof t!="bigint")throw TypeError(W+"value");t=t===0&&1/t<0?"-0":String(t)}Le(a,t)}a.constructor=e}return e.prototype=y,e.DP=Ee,e.RM=Be,e.NE=Ne,e.PE=Oe,e.strict=He,e.roundDown=0,e.roundHalfUp=1,e.roundHalfEven=2,e.roundUp=3,e}function Le(e,t){var a,r,l;if(!Me.test(t))throw Error(W+"number");for(e.s=t.charAt(0)=="-"?(t=t.slice(1),-1):1,(a=t.indexOf("."))>-1&&(t=t.replace(".","")),(r=t.search(/e/i))>0?(a<0&&(a=r),a+=+t.slice(r+1),t=t.substring(0,r)):a<0&&(a=t.length),l=t.length,r=0;r<l&&t.charAt(r)=="0";)++r;if(r==l)e.c=[e.e=0];else{for(;l>0&&t.charAt(--l)=="0";);for(e.e=a-r-1,e.c=[],a=0;r<=l;)e.c[a++]=+t.charAt(r++)}return e}function U(e,t,a,r){var l=e.c;if(a===O&&(a=e.constructor.RM),a!==0&&a!==1&&a!==2&&a!==3)throw Error($e);if(t<1)r=a===3&&(r||!!l[0])||t===0&&(a===1&&l[0]>=5||a===2&&(l[0]>5||l[0]===5&&(r||l[1]!==O))),l.length=1,r?(e.e=e.e-t+1,l[0]=1):l[0]=e.e=0;else if(t<l.length){if(r=a===1&&l[t]>=5||a===2&&(l[t]>5||l[t]===5&&(r||l[t+1]!==O||l[t-1]&1))||a===3&&(r||!!l[0]),l.length=t,r){for(;++l[--t]>9;)if(l[t]=0,t===0){++e.e,l.unshift(1);break}}for(t=l.length;!l[--t];)l.pop()}return e}function Y(e,t,a){var r=e.e,l=e.c.join(""),n=l.length;if(t)l=l.charAt(0)+(n>1?"."+l.slice(1):"")+(r<0?"e":"e+")+r;else if(r<0){for(;++r;)l="0"+l;l="0."+l}else if(r>0)if(++r>n)for(r-=n;r--;)l+="0";else r<n&&(l=l.slice(0,r)+"."+l.slice(r));else n>1&&(l=l.charAt(0)+"."+l.slice(1));return e.s<0&&a?"-"+l:l}y.abs=function(){var e=new this.constructor(this);return e.s=1,e};y.cmp=function(e){var t,a=this,r=a.c,l=(e=new a.constructor(e)).c,n=a.s,i=e.s,u=a.e,d=e.e;if(!r[0]||!l[0])return r[0]?n:l[0]?-i:0;if(n!=i)return n;if(t=n<0,u!=d)return u>d^t?1:-1;for(i=(u=r.length)<(d=l.length)?u:d,n=-1;++n<i;)if(r[n]!=l[n])return r[n]>l[n]^t?1:-1;return u==d?0:u>d^t?1:-1};y.div=function(e){var t=this,a=t.constructor,r=t.c,l=(e=new a(e)).c,n=t.s==e.s?1:-1,i=a.DP;if(i!==~~i||i<0||i>X)throw Error(se);if(!l[0])throw Error(ye);if(!r[0])return e.s=n,e.c=[e.e=0],e;var u,d,c,s,m,o=l.slice(),f=u=l.length,g=r.length,p=r.slice(0,u),v=p.length,h=e,b=h.c=[],P=0,V=i+(h.e=t.e-e.e)+1;for(h.s=n,n=V<0?0:V,o.unshift(0);v++<u;)p.push(0);do{for(c=0;c<10;c++){if(u!=(v=p.length))s=u>v?1:-1;else for(m=-1,s=0;++m<u;)if(l[m]!=p[m]){s=l[m]>p[m]?1:-1;break}if(s<0){for(d=v==u?l:o;v;){if(p[--v]<d[v]){for(m=v;m&&!p[--m];)p[m]=9;--p[m],p[v]+=10}p[v]-=d[v]}for(;!p[0];)p.shift()}else break}b[P++]=s?c:++c,p[0]&&s?p[v]=r[f]||0:p=[r[f]]}while((f++<g||p[0]!==O)&&n--);return!b[0]&&P!=1&&(b.shift(),h.e--,V--),P>V&&U(h,V,a.RM,p[0]!==O),h};y.eq=function(e){return this.cmp(e)===0};y.gt=function(e){return this.cmp(e)>0};y.gte=function(e){return this.cmp(e)>-1};y.lt=function(e){return this.cmp(e)<0};y.lte=function(e){return this.cmp(e)<1};y.minus=y.sub=function(e){var t,a,r,l,n=this,i=n.constructor,u=n.s,d=(e=new i(e)).s;if(u!=d)return e.s=-d,n.plus(e);var c=n.c.slice(),s=n.e,m=e.c,o=e.e;if(!c[0]||!m[0])return m[0]?e.s=-d:c[0]?e=new i(n):e.s=1,e;if(u=s-o){for((l=u<0)?(u=-u,r=c):(o=s,r=m),r.reverse(),d=u;d--;)r.push(0);r.reverse()}else for(a=((l=c.length<m.length)?c:m).length,u=d=0;d<a;d++)if(c[d]!=m[d]){l=c[d]<m[d];break}if(l&&(r=c,c=m,m=r,e.s=-e.s),(d=(a=m.length)-(t=c.length))>0)for(;d--;)c[t++]=0;for(d=t;a>u;){if(c[--a]<m[a]){for(t=a;t&&!c[--t];)c[t]=9;--c[t],c[a]+=10}c[a]-=m[a]}for(;c[--d]===0;)c.pop();for(;c[0]===0;)c.shift(),--o;return c[0]||(e.s=1,c=[o=0]),e.c=c,e.e=o,e};y.mod=function(e){var t,a=this,r=a.constructor,l=a.s,n=(e=new r(e)).s;if(!e.c[0])throw Error(ye);return a.s=e.s=1,t=e.cmp(a)==1,a.s=l,e.s=n,t?new r(a):(l=r.DP,n=r.RM,r.DP=r.RM=0,a=a.div(e),r.DP=l,r.RM=n,this.minus(a.times(e)))};y.neg=function(){var e=new this.constructor(this);return e.s=-e.s,e};y.plus=y.add=function(e){var t,a,r,l=this,n=l.constructor;if(e=new n(e),l.s!=e.s)return e.s=-e.s,l.minus(e);var i=l.e,u=l.c,d=e.e,c=e.c;if(!u[0]||!c[0])return c[0]||(u[0]?e=new n(l):e.s=l.s),e;if(u=u.slice(),t=i-d){for(t>0?(d=i,r=c):(t=-t,r=u),r.reverse();t--;)r.push(0);r.reverse()}for(u.length-c.length<0&&(r=c,c=u,u=r),t=c.length,a=0;t;u[t]%=10)a=(u[--t]=u[t]+c[t]+a)/10|0;for(a&&(u.unshift(a),++d),t=u.length;u[--t]===0;)u.pop();return e.c=u,e.e=d,e};y.pow=function(e){var t=this,a=new t.constructor("1"),r=a,l=e<0;if(e!==~~e||e<-1e6||e>Ke)throw Error(W+"exponent");for(l&&(e=-e);e&1&&(r=r.times(t)),e>>=1,!!e;)t=t.times(t);return l?a.div(r):r};y.prec=function(e,t){if(e!==~~e||e<1||e>X)throw Error(W+"precision");return U(new this.constructor(this),e,t)};y.round=function(e,t){if(e===O)e=0;else if(e!==~~e||e<-1e6||e>X)throw Error(se);return U(new this.constructor(this),e+this.e+1,t)};y.sqrt=function(){var e,t,a,r=this,l=r.constructor,n=r.s,i=r.e,u=new l("0.5");if(!r.c[0])return new l(r);if(n<0)throw Error(ee+"No square root");n=Math.sqrt(r+""),n===0||n===1/0?(t=r.c.join(""),t.length+i&1||(t+="0"),n=Math.sqrt(t),i=((i+1)/2|0)-(i<0||i&1),e=new l((n==1/0?"5e":(n=n.toExponential()).slice(0,n.indexOf("e")+1))+i)):e=new l(n+""),i=e.e+(l.DP+=4);do a=e,e=u.times(a.plus(r.div(a)));while(a.c.slice(0,i).join("")!==e.c.slice(0,i).join(""));return U(e,(l.DP-=4)+e.e+1,l.RM)};y.times=y.mul=function(e){var t,a=this,r=a.constructor,l=a.c,n=(e=new r(e)).c,i=l.length,u=n.length,d=a.e,c=e.e;if(e.s=a.s==e.s?1:-1,!l[0]||!n[0])return e.c=[e.e=0],e;for(e.e=d+c,i<u&&(t=l,l=n,n=t,c=i,i=u,u=c),t=new Array(c=i+u);c--;)t[c]=0;for(d=u;d--;){for(u=0,c=i+d;c>d;)u=t[c]+n[d]*l[c-d-1]+u,t[c--]=u%10,u=u/10|0;t[c]=u}for(u?++e.e:t.shift(),d=t.length;!t[--d];)t.pop();return e.c=t,e};y.toExponential=function(e,t){var a=this,r=a.c[0];if(e!==O){if(e!==~~e||e<0||e>X)throw Error(se);for(a=U(new a.constructor(a),++e,t);a.c.length<e;)a.c.push(0)}return Y(a,!0,!!r)};y.toFixed=function(e,t){var a=this,r=a.c[0];if(e!==O){if(e!==~~e||e<0||e>X)throw Error(se);for(a=U(new a.constructor(a),e+a.e+1,t),e=e+a.e+1;a.c.length<e;)a.c.push(0)}return Y(a,!1,!!r)};y[Symbol.for("nodejs.util.inspect.custom")]=y.toJSON=y.toString=function(){var e=this,t=e.constructor;return Y(e,e.e<=t.NE||e.e>=t.PE,!!e.c[0])};y.toNumber=function(){var e=Number(Y(this,!0,!0));if(this.constructor.strict===!0&&!this.eq(e.toString()))throw Error(ee+"Imprecise conversion");return e};y.toPrecision=function(e,t){var a=this,r=a.constructor,l=a.c[0];if(e!==O){if(e!==~~e||e<1||e>X)throw Error(W+"precision");for(a=U(new r(a),e,t);a.c.length<e;)a.c.push(0)}return Y(a,e<=a.e||a.e<=r.NE||a.e>=r.PE,!!l)};y.valueOf=function(){var e=this,t=e.constructor;if(t.strict===!0)throw Error(ee+"valueOf disallowed");return Y(e,e.e<=t.NE||e.e>=t.PE,!0)};var I=Pe();function qe(e,t){e.forEach(a=>{try{t(a)}catch(r){console.error(r)}})}let Q=0;function Fe(){let e=new Set,t=e;return{add(a){Q+=t==e&&!e.has(a)?1:0,e.add(a)},delete(a){return Q-=t==e&&e.has(a)?1:0,e.delete(a)},flush(a){t.size&&(e=new Set,Q-=t.size,qe(t,r=>r(a)&&e.add(r)),Q+=e.size,t=e)}}}const Se=Fe(),Ce=typeof window<"u"?window.requestAnimationFrame:()=>{},te=e=>je(e,Se);te.now=typeof performance<"u"?()=>performance.now():Date.now;te.batchedUpdates=e=>e();let j=-1;function je(e,t){t.add(e),Te()}function Te(){j<0&&(j=0,Ce(Ae))}function We(){j=-1}function Ae(){~j&&(Ce(Ae),te.batchedUpdates(Ue))}function Ue(){const e=j;if(j=te.now(),!Q){We();return}Se.flush(e?Math.min(64,j-e):16.667)}const ve=50;function Ge(e){return{type:"percent",value:new I(e)}}function $(e){return{type:"pixel",value:new I(e)}}function Xe(e){let t=ce.linear,a=300;return e.collapseAnimation&&(typeof e.collapseAnimation=="string"?t=ce[e.collapseAnimation]:(a=e.collapseAnimation.duration,t=typeof e.collapseAnimation.easing=="function"?e.collapseAnimation.easing:ce[e.collapseAnimation.easing])),{ease:t,duration:a}}const ce={"ease-in-out":function(t){return((t*=2)<=1?t*t:--t*(2-t)+1)/2},bounce:function(t){return((t*=2)<1?t*t*((1.70158+1)*t-1.70158):(t-=2)*t*((1.70158+1)*t+1.70158)+2)/2},linear:function(t){return+t}};function we(e){return e.orientation==="horizontal"?e.dragOvershoot.gt(0)?"w-resize":e.dragOvershoot.lt(0)?"e-resize":"ew-resize":e.dragOvershoot.gt(0)?"n-resize":e.dragOvershoot.lt(0)?"s-resize":"ns-resize"}function Ye(e){if("context"in e&&(e=e.context),"items"in e){e.dragOvershoot=new I(e.dragOvershoot||0);for(const t of e.items)S(t)?(t.currentValue.value=new I(t.currentValue.value),t.collapsedSize.value=new I(t.collapsedSize.value),t.min.value=new I(t.min.value),t.default&&(t.default.value=new I(t.default.value)),t.max&&t.max!=="1fr"&&(t.max.value=new I(t.max.value))):t.size.value=new I(t.size.value);return e}}function T(e,t){if(!e)throw new Error(t)}function J(e,t){T(t.includes(e.type),`Invalid event type: ${t}. Expected: ${t.join(" | ")}`)}function S(e){return!!(e&&typeof e=="object"&&"type"in e&&e.type==="panel")}function k(e){return!!(e&&typeof e=="object"&&"type"in e&&e.type==="handle")}function Je(e){const t=()=>{let r=null;return l=>{var n,i;if(!r||r.pixel===l.pixel&&r.percentage===l.percentage){r=l;return}r=l,(i=(n=e.onResize)==null?void 0:n.current)==null||i.call(n,l)}};return{...{type:"panel",min:F(e.min||"0px"),max:e.max?F(e.max):"1fr",collapsed:e.collapsible?e.collapsed??e.defaultCollapsed??!1:void 0,collapsible:e.collapsible,collapsedSize:F(e.collapsedSize??"0px"),onCollapseChange:e.onCollapseChange,onResize:{current:t()},collapseIsControlled:typeof e.collapsed<"u",sizeBeforeCollapse:void 0,id:e.id,collapseAnimation:e.collapseAnimation,default:e.default?F(e.default):void 0,isStaticAtRest:e.isStaticAtRest},currentValue:$(-1)}}function Z(e,t){return e.type===t.type&&e.value.eq(t.value)}function Qe(e,t){return!!(!t||!Z(e.min,t.min)||e.max==="1fr"&&t.max!=="1fr"||e.max!=="1fr"&&t.max==="1fr"||e.max!=="1fr"&&t.max!=="1fr"&&!Z(e.max,t.max)||e.default&&!t.default||!e.default&&t.default||e.default&&t.default&&!Z(e.default,t.default)||!Z(e.collapsedSize,t.collapsedSize)||e.isStaticAtRest!==t.isStaticAtRest||e.collapseAnimation&&!t.collapseAnimation||!e.collapseAnimation&&t.collapseAnimation||typeof e.collapseAnimation=="string"&&typeof t.collapseAnimation=="string"&&e.collapseAnimation!==t.collapseAnimation||typeof e.collapseAnimation=="object"&&typeof t.collapseAnimation=="object"&&(e.collapseAnimation.duration!==t.collapseAnimation.duration||e.collapseAnimation.easing!==t.collapseAnimation.easing)||e.collapsible!==t.collapsible)}function Ze(e,t){return!t||!Z(e.size,t.size)}function _e(e){return{type:"handle",...e,size:typeof e.size=="string"?F(e.size):e.size}}function F(e){if(e==="1fr"&&(e="100%"),e.endsWith("px"))return $(parseFloat(e));if(e.endsWith("%"))return Ge(parseFloat(e)/100);throw new Error(`Invalid unit: ${e}`)}function G(e,t){return t.type==="pixel"?e===0?0:t.value.div(e).toNumber():t.value.toNumber()}function R(e){return e.orientation==="horizontal"?e.size.width:e.size.height}function A(e,t){const a=t==="1fr"?F(t):t;return a.type==="pixel"?a.value:a.value.mul(R(e))}function H(e,t,a){const r=A(e,t.min),l=A(e,t.max);return a.gte(r)&&a.lte(l)?a:a.lt(r)?r:l}function B(e,t){const a=e.items.find(r=>r.id===t);if(a&&S(a))return a;throw new Error(`Expected panel with id: ${t}`)}function ge(e,t){const a=e.items.findIndex(r=>r.id===t);if(a!==-1&&k(e.items[a]))return a;throw new Error(`Expected panel handle with id: ${t}`)}function et(e,t){if(!e.items.length)throw new Error("No items in group");const a=ge(e,t),r=e.items[a-1],l=e.items[a+1];if(r&&S(r)&&r.collapsible)return r;if(l&&S(l)&&l.collapsible)return l;throw new Error(`No collapsible panel found for handle: ${t}`)}function ie(e,t){const a=e.items.findIndex(l=>l.id===t);if(e.activeDragHandleId){const l=ge(e,e.activeDragHandleId),n=e.items[l];if(n&&k(n))return{item:n,direction:l>a?1:-1}}T(a!==-1,`Expected panel before: ${t}`);let r=e.items[a+1];if(r&&k(r))return{item:r,direction:1};if(r=e.items[a-1],r&&k(r))return{item:r,direction:-1};throw new Error(`Cant find handle for panel: ${t}`)}function xe(e,t){const a=e.items.findIndex(l=>l.id===t);T(a!==-1,`Expected panel before: ${t}`);let r=e.items[a+1];return r&&k(r)&&_(e,e.items,a+1,1,"add")?{item:r,direction:1}:(r=e.items[a-1],r&&k(r)&&_(e,e.items,a-1,-1,"add")?{item:r,direction:-1}:ie(e,t))}function Ve(e){const t={},a=e.map(i=>i.order).filter(i=>i!==void 0);let r=0;for(const i of e)if(i.order===void 0){for(;a.includes(r)||Object.values(t).includes(r);)r++;t[i.id]=r}const l=e.filter(i=>i.order===void 0),n=e.filter(i=>i.order!==void 0).sort((i,u)=>i.order-u.order);for(const i of n)l.splice(i.order,0,i);return l}function tt(e,t,a){return T(t.currentValue.type==="pixel",`panelHasSpace only works with number values: ${t.id} ${t.currentValue}`),t.collapsible?!t.collapsed:a==="add"?t.currentValue.value.gte(A(e,t.min))&&t.currentValue.value.lt(A(e,t.max)):t.currentValue.value.gt(A(e,t.min))}function _(e,t,a,r,l,n){const i=r===-1?t.slice(0,a+1).reverse():t.slice(a);for(const u of i){if(!S(u))continue;const d=n?fe(e,u):u;if(tt(e,d,l))return u}}function ue(e){let t=new I(0);for(const a of e.items)k(a)?t=t.add(a.size.value):(a.collapsed&&a.currentValue.type==="pixel"||a.isStaticAtRest)&&(t=t.add(a.currentValue.value));return t}function E(e){return e.type==="pixel"?`${e.value.toNumber()}px`:`${e.value.mul(100).toNumber()}%`}function nt(e){return K(e).map(t=>S(t)?t.currentValue.value.toNumber():A(e,t.size).toNumber())}function at(e,t){return B({...e,items:K(e)},t).currentValue.value.toNumber()}function rt(e){return he({...e,items:K(e)}).map(a=>k(a)?G(R(e),a.size):G(R(e),a.currentValue))}function lt(e,t){const a=K(e),r=B({...e,items:a},t);return G(R(e),r.currentValue)}function ze(e){const t=ue(e);let a=!1;return e.items.map(r=>{if(r.type==="panel"){const l=E(r.min);if(r.currentValue.type==="pixel"&&r.currentValue.value.toNumber()!==-1){if(r.isStaticAtRest){const n=r.max==="1fr"?"100%":E(r.max);return`clamp(${l}, ${E(r.currentValue)}, ${n})`}return E(r.currentValue)}else if(r.currentValue.type==="percent"){if(!a&&(r.max==="1fr"||r.max.type==="percent"&&r.max.value.eq(100)))return a=!0,`minmax(${l}, 1fr)`;const n=r.max==="1fr"?"100%":E(r.max);return`minmax(${l}, min(calc(${r.currentValue.value} * (100% - ${t}px)), ${n}))`}else{if(r.collapsible&&r.collapsed)return E(r.collapsedSize);if(r.default){if(e.items.some(u=>S(u)&&u.id!==r.id&&!u.collapsed&&(u.max==="1fr"||u.max.type==="percent"&&u.max.value.eq(100))))return E(r.default);const i=r.max==="1fr"?"1fr":E(r.max);return`minmax(${E(r.default)}, ${i})`}else{const n=r.max==="1fr"?"1fr":E(r.max);return`minmax(${l}, ${n})`}}}return E(r.size)}).join(" ")}function de(e,t){const a=e.findIndex(l=>l.id===t.id||typeof l.order=="number"&&l.order===t.order);let r=e;return a!==-1&&(r=e.filter((l,n)=>n!==a)),Ve([...r,t])}function fe(e,t){return{...t,min:$(-1e5),max:$(1e5)}}function K(e){const t=ue(e),a=[];for(const r of e.items){if(!r||!S(r)){a.push({...r});continue}if(r.lastKnownSize){const n=$(e.orientation==="horizontal"?r.lastKnownSize.width:r.lastKnownSize.height);a.push({...r,currentValue:n});continue}if(r.currentValue.type==="pixel"){a.push({...r});continue}const l=new I(R(e)).minus(t).mul(r.currentValue.value);a.push({...r,currentValue:$(l.toNumber())})}return a}function re(e,t){var D,N,M,L;const a=ge(e,t.handleId),r=e.items[a],n=e.items.some(z=>S(z)&&z.currentValue.type!=="pixel")?K(e):[...e.items];let i=e.orientation==="horizontal"?t.value.deltaX:t.value.deltaY;if(t.value.shiftKey&&(i*=e.shiftAmount??15),i===0)return{};const u=i/Math.abs(i),d=_(e,n,a+u,u,"subtract",t.disregardCollapseBuffer);if(!d)return{dragOvershoot:e.dragOvershoot.add(i)};T(S(d),`Expected panel before: ${r.id}`);const c=t.type==="collapsePanel"&&(n.find(z=>z.id===t.panelId&&d.id!==t.panelId)||_(e,n,a-u,u*-1,"add",t.disregardCollapseBuffer))||n[a-u];if(T(c&&S(c),`Expected panel after: ${r.id}`),c.currentValue.value.eq(A(e,c.max)))return{dragOvershoot:e.dragOvershoot.add(i)};const s=e.dragOvershoot.add(i);if(!t.disregardCollapseBuffer&&!t.controlled){const z=s.lt(0)&&u>0,C=s.gt(0)&&u>0,q=s.gt(0)&&u<0,ne=s.lt(0)&&u<0,ae=c.currentValue.value.add(new I(s).mul(q?u:1)),De=A(e,c.min),ke=s.abs().lt(ve)&&!c.currentValue.value.add(s.abs()).gte(c.min.value)&&c.collapsible&&c.collapsed&&(C||ne);if(ae.lte(De)&&(s.eq(0)||q||z||ke))return{dragOvershoot:s}}if(!t.disregardCollapseBuffer&&!t.controlled&&d.collapsible&&d.currentValue.value.eq(A(e,d.min))){const z=d.currentValue.value.sub(s.abs());if(s.abs().lt(ve)&&z.gt(A(e,d.collapsedSize)))return{dragOvershoot:s}}const m=fe(e,d),o=d.currentValue.value,f=d.currentValue.value.minus(new I(i).mul(u));let g=t.disregardCollapseBuffer?H(e,m,f):H(e,d,f);const p=fe(e,c),v=c.currentValue.value,h=o.minus(g),b=c.currentValue.value.add(h);let P=t.disregardCollapseBuffer?H(e,p,b):H(e,c,b);if(t.disregardCollapseBuffer)c.collapsible&&c.collapsed&&(c.collapsed=!1);else if(c.collapsible&&c.collapsed){if((D=c.onCollapseChange)!=null&&D.current&&c.collapseIsControlled&&!t.controlled&&!t.isVirtual)return c.onCollapseChange.current(!1),{dragOvershoot:s};const z=A(e,c.collapsedSize).add(e.dragOvershoot.abs()).sub(P.add(Math.abs(i)));if(z.gt(0)&&(P=P.add(z)),g=g.minus(P.minus(v).minus(Math.abs(i))),g.lt(d.min.value)&&!d.collapsible)return{dragOvershoot:s};c.collapsed=!1,(N=c.onCollapseChange)!=null&&N.current&&!c.collapseIsControlled&&!t.controlled&&!t.isVirtual&&c.onCollapseChange.current(!1)}const V=d.currentValue.value.eq(A(e,d.min));if(!t.disregardCollapseBuffer&&d.collapsible&&V){if((M=d.onCollapseChange)!=null&&M.current&&d.collapseIsControlled&&!t.controlled&&!t.isVirtual)return d.onCollapseChange.current(!0),{dragOvershoot:s};d.collapsed=!0,g=A(e,d.collapsedSize),P=c.currentValue.value.add(o.minus(g)),(L=d.onCollapseChange)!=null&&L.current&&!d.collapseIsControlled&&!t.controlled&&!t.isVirtual&&d.onCollapseChange.current(!0)}d.currentValue={type:"pixel",value:g},c.currentValue={type:"pixel",value:P};const x=new I(R(e)).minus(n.reduce((z,C)=>z.add(S(C)?C.currentValue.value:C.size.value),new I(0)));return x.eq(0)||(d.currentValue.value=H(e,d,d.currentValue.value.add(x))),{items:n}}function he(e){const t=[...e.items];t.forEach((r,l)=>{r.type==="panel"&&r.collapsed&&(t[l]={...r,currentValue:r.collapsedSize})});const a=ue({...e,items:t});return t.forEach((r,l)=>{r.type!=="panel"||r.collapsed||r.isStaticAtRest||(t[l]={...r,currentValue:{type:"percent",value:r.currentValue.value.div(new I(R(e)).sub(a))}})}),t}function pe({delta:e,orientation:t="horizontal",shiftKey:a=!1}){return{type:"move",pointerType:"keyboard",shiftKey:a,ctrlKey:!1,altKey:!1,metaKey:!1,deltaX:t==="horizontal"?e:0,deltaY:t==="horizontal"?0:e}}function oe({context:e,handleId:t,delta:a,direction:r,controlled:l,disregardCollapseBuffer:n,isVirtual:i,panelId:u}){let d=e;for(let c=0;c<a.abs().toNumber();c++)d=re({...e,...d},{handleId:t,type:"collapsePanel",controlled:l,disregardCollapseBuffer:n,isVirtual:i,panelId:u,value:pe({delta:r,orientation:e.orientation})});return d}function me(e,t,a,r){let l=!1,n=1,i=new I(r);for(;i.toNumber()!==0;){const u=_(e,t,a+n,n,r.gt(0)?"add":"subtract");if(!u){if(l)break;n=n===1?-1:1,l=!0;continue}const d=u.currentValue.value,c=H(e,u,d.add(i));u.currentValue.value=c,i=i.sub(c.sub(d)),n=n===1?-1:1}}function it(e){if(e.items.some(d=>S(d)&&d.currentValue.value.eq(-1)))return e;const t=new I(R(e)),a=t.sub(ue(e).toNumber()),l=e.items.map(d=>{if(k(d))return d.size.value;if(d.collapsed)return A(e,d.currentValue);const c=d.currentValue.type==="pixel"&&d.currentValue.value||d.currentValue.value.mul(a);return H(e,d,c)}).reduce((d,c)=>d.add(c),new I(0)),n=l.abs().sub(t);if(n.eq(0)||t.eq(0))return e;let i={...e,items:K(e)};const u=i.items.find(d=>!!(S(d)&&d.collapsible));if(u){const d=i.items.findIndex(m=>m.id===u.id),c=ie(i,u.id),s=u.currentValue.value.sub(A(i,u.collapsedSize));i={...i,...oe({handleId:c.item.id,delta:s,direction:c.direction*-1,panelId:u.id,context:{...i,size:{width:l.toNumber(),height:l.toNumber()}}})},me(i,i.items,d,n.neg())}return{...i,items:he(i)}}function be(e){return e.map(t=>({...t,lastKnownSize:void 0}))}function ot(e,t){document.cookie=`${e}=${encodeURIComponent(`${t}`)};path=/;max-age=31536000`}function Re(e,t){const a=B(e,t.panelId);if(t.type==="expandPanel")return new I(a.sizeBeforeCollapse??A(e,a.min)).minus(a.currentValue.value);const r=A(e,a.collapsedSize);return a.currentValue.value.minus(r)}function Ie(e,t,a,r){const l=B(e,t.panelId),n=xe(e,t.panelId);let i=new I(n.direction);const u=Re(e,t),d={...e,items:K(e)},c=oe({context:d,panelId:t.panelId,handleId:n.item.id,delta:u,direction:n.direction,isVirtual:!0});return new Promise((s,m)=>{r.signal.addEventListener("abort",()=>{m(new Error("Operation was canceled"))}),t.type==="collapsePanel"&&(l.sizeBeforeCollapse=l.currentValue.value.toNumber(),i=i.mul(new I(-1)));const o=60,{duration:f,ease:g}=Xe(l),p=Math.ceil(l.collapseAnimation?f/(1e3/o):1);let v=0,h=new I(0);function b(){const P=++v/p,V=new I(l.collapseAnimation?g(P):1),x=V.mul(u).sub(h).mul(i);if(a({type:"applyDelta",handleId:n.item.id,delta:x.toNumber(),panelId:l.id}),h=h.add(x.abs().mul(x.gt(0)&&i.lt(0)||x.lt(0)&&i.gt(0)?-1:1)),V.eq(1)){e.items.find(N=>S(N)&&N.currentValue.value.round(void 0,I.roundHalfEven).lt(0))&&le(e,c);const D=t.type==="expandPanel"?"expand":"collapse";return s({panelId:l.id,action:D,resolve:t.resolve}),!1}return!0}te(b)})}function le(e,t){for(const a in t)e[a]=t[a]}let st=0;function ut(e,t){const a=new AbortController,r={current:"idle"};let l=!1;const n={size:e.size||{width:0,height:0},items:e.items||[],orientation:e.orientation||"horizontal",dragOvershoot:new I(0),groupId:e.groupId||`group-${st++}`,autosaveStrategy:e.autosaveStrategy,shiftAmount:e.shiftAmount??15},i={prepare:()=>{n.items=K(n)},clearLastKnownSize:()=>{n.items=be(n.items)},commit:()=>{n.dragOvershoot=new I(0),n.items=he(n)},onResize:()=>{var s,m;for(const o of n.items)if(S(o)){const f=o.lastKnownSize?new I(n.orientation==="horizontal"?o.lastKnownSize.width:o.lastKnownSize.height):H(n,o,A(n,o.currentValue)),g=R(n);(m=(s=o.onResize)==null?void 0:s.current)==null||m.call(s,{pixel:f.toNumber(),percentage:g>0?f.div(R(n)).toNumber():-1})}},onAutosave:()=>{if(!n.autosaveStrategy||typeof window>"u")return;const s={...n};s.items=be(n.items),s.activeDragHandleId=n.activeDragHandleId;const m=JSON.stringify(s);n.autosaveStrategy==="localStorage"?localStorage.setItem(n.groupId,m):ot(n.groupId,m)},removeItem:s=>{const m=n.items.findIndex(p=>p.id===s),o=n.items[m];if(!o)return;const f=n.items.filter(p=>p.id!==s),g=S(o)?o.currentValue.value:o.size.value;me(n,f,m,g),n.items=f},notifyCollapseToggle:s=>{var o,f;J(s,["collapsePanel","expandPanel"]);const m=B(n,s.panelId);(f=(o=m.onCollapseChange)==null?void 0:o.current)==null||f.call(o,!m.collapsed)},runCollapseToggle:s=>{J(s,["collapsePanel","expandPanel"]);const m=ie(n,s.panelId),o=s.type==="collapsePanel"?m.direction*-1:m.direction,f=re(n,{panelId:s.panelId,handleId:m.item.id,type:"dragHandle",controlled:s.controlled,value:pe({delta:o,orientation:n.orientation})});le(n,f)},onAnimationEnd:s=>{var o,f;T(s,"Expected output from animation actor");const m=B(n,s.panelId);m.collapsed=s.action==="collapse",m.collapsed&&(m.currentValue=m.collapsedSize),m.collapseIsControlled||(f=(o=m.onCollapseChange)==null?void 0:o.current)==null||f.call(o,m.collapsed),i.commit()}};i.onAutosave();const u={shouldNotifyCollapseToggle:s=>{J(s,["collapsePanel","expandPanel"]);const m=B(n,s.panelId);return!s.controlled&&m.collapseIsControlled===!0},shouldCollapseToggle:s=>(J(s,["collapsePanel","expandPanel"]),B(n,s.panelId).collapseIsControlled===!0),cannotExpandPanel:s=>{J(s,["expandPanel"]);const m=K(n);let o={...n,items:m};const f=Re(n,s),g=xe(o,s.panelId);o={...o,...oe({context:o,panelId:s.panelId,handleId:g.item.id,controlled:s.controlled,delta:f,direction:g.direction,isVirtual:!0})};const p=o.items.find(b=>b.id===s.panelId),v=o.items.reduce((b,P)=>b.add(S(P)?P.currentValue.value:P.size.value),new I(0)),h=p&&S(p)&&!p.currentValue.value.eq(p.collapsedSize.value);return v.gt(R(n))||!h}};function d(s){switch(r.current){case"dragging":i.commit(),n.activeDragHandleId=void 0;break}switch(s){case"idle":i.onAutosave();break;case"dragging":i.prepare();break;case"togglingCollapse":i.prepare(),i.clearLastKnownSize();break}r.current=s,t==null||t(n)}function c(s){var m;switch(s.type){case"lockGroup":l=!0;break;case"unlockGroup":l=!1;break}if(!l){switch(s.type){case"updateItemIndex":n.items=Ve(n.items.map(o=>o.id===s.itemId?{...o,order:s.index}:o));break;case"registerPanel":n.items=de(n.items,{type:"panel",currentValue:$(-1),...s.data});break;case"unregisterPanel":i.prepare(),i.removeItem(s.id),i.clearLastKnownSize(),i.commit(),i.onResize(),i.onAutosave();break;case"registerPanelHandle":{n.items=de(n.items,s.data);break}case"unregisterPanelHandle":i.prepare(),i.removeItem(s.id),i.clearLastKnownSize(),i.commit(),i.onResize(),i.onAutosave();break;case"registerDynamicPanel":{i.prepare();let o=$(0);s.data.collapsible&&s.data.collapsed&&s.data.collapsedSize?o={type:"pixel",value:A(n,s.data.collapsedSize)}:s.data.default?o={type:"pixel",value:A(n,s.data.default)}:o={type:"pixel",value:A(n,s.data.min)};const f=de(n.items,{type:"panel",...s.data,currentValue:o}),g=f.findIndex(h=>h.id===s.data.id),p={...n},v=n.items.reduce((h,b)=>k(b)?h.add(A(n,b.size)):h.add(b.currentValue.value),new I(0)).minus(R(n));me(p,f,g,o.value.add(v).neg()),n.items=f,i.clearLastKnownSize(),i.commit(),i.onResize(),i.onAutosave();break}case"rebindPanelCallbacks":for(const o of n.items)S(o)&&o.id===s.data.id&&(o.onCollapseChange=s.data.onCollapseChange,o.onResize=s.data.onResize);break;case"updateConstraints":i.prepare();for(const o of n.items)if(S(o)&&o.id===s.data.id){const f=s.data;o.min=f.min,o.max=f.max,o.default=f.default,o.collapsedSize=f.collapsedSize,o.isStaticAtRest=f.isStaticAtRest,o.collapseAnimation=f.collapseAnimation,o.collapsible=f.collapsible}else if(k(o)&&o.id===s.data.id){const f=s.data;o.size=f.size}i.clearLastKnownSize(),i.commit(),i.onResize(),i.onAutosave();break;case"setActualItemsSize":{const o=n.items.map(p=>{if(!S(p))return p;const v=s.childrenSizes[p.id]||p.lastKnownSize;return{...p,lastKnownSize:v}});let f=0,g=!1;for(const p of o)if(S(p)){const v=(m=p.lastKnownSize)==null?void 0:m[n.orientation==="horizontal"?"width":"height"];if(!v){n.items=o,g=!0;break}f+=v}else f+=p.size.value.toNumber();g?n.items=o:f>R(n)&&r.current!=="dragging"?n.items=it({...n,items:K({...n,items:o})}).items:n.items=o,i.onResize();break}case"setSize":{n.size=s.size,i.onResize();break}case"setOrientation":n.orientation=s.orientation,i.clearLastKnownSize(),i.onResize();break}if(r.current==="idle")switch(s.type){case"dragHandleStart":d("dragging"),n.activeDragHandleId=s.handleId;break;case"setPanelPixelSize":{i.prepare(),i.clearLastKnownSize();const o=B(n,s.panelId),f=ie(n,s.panelId),g=o.currentValue.value,p=H(n,o,A(n,F(s.size))),v=p.gt(g),h=v?p.minus(g):g.minus(p);o.sizeBeforeCollapse=p.toNumber(),Object.assign(n,oe({context:n,panelId:s.panelId,direction:f.direction*(v?1:-1),handleId:f.item.id,delta:h})),i.commit(),i.onResize(),i.onAutosave();break}case"collapsePanel":u.shouldNotifyCollapseToggle(s)?i.notifyCollapseToggle(s):B(n,s.panelId).collapsed||(d("togglingCollapse"),a.abort(),Ie(n,s,c,a).then(f=>{i.onAnimationEnd(f),d("idle"),s.resolve&&requestAnimationFrame(s.resolve)}));break;case"expandPanel":if(u.cannotExpandPanel(s))break;u.shouldNotifyCollapseToggle(s)?i.notifyCollapseToggle(s):B(n,s.panelId).collapsed&&(d("togglingCollapse"),a.abort(),Ie(n,s,c,a).then(f=>{i.onAnimationEnd(f),d("idle"),s.resolve&&requestAnimationFrame(s.resolve)}));break}else if(r.current==="dragging")switch(s.type){case"dragHandle":i.clearLastKnownSize(),le(n,re(n,s)),i.onResize();break;case"dragHandleEnd":d("idle");break;case"expandPanel":case"collapsePanel":u.shouldCollapseToggle(s)&&i.runCollapseToggle(s);break}else if(r.current==="togglingCollapse")switch(s.type){case"applyDelta":le(n,re(n,{panelId:s.panelId,handleId:s.handleId,type:"collapsePanel",disregardCollapseBuffer:!0,value:pe({delta:s.delta,orientation:n.orientation})})),i.onResize();break}t==null||t(n)}}return[n,c,r]}function ct({groupId:e,id:t,collapsible:a,collapsed:r}){const l={id:t,"data-splitter-group-id":e,"data-splitter-type":"panel","data-splitter-id":t};return a&&(l["data-collapsed"]=r),l}function dt({groupId:e,id:t,orientation:a,isDragging:r,activeDragHandleId:l,disabled:n,controlsId:i,min:u,max:d,currentValue:c,groupSize:s}){return{id:t,role:"separator","data-splitter-type":"handle","data-splitter-id":t,"data-splitter-group-id":e,"data-handle-orientation":a,"data-state":r?"dragging":l?"inactive":"idle","aria-label":"Resize Handle","aria-disabled":n,"aria-controls":i,"aria-valuemin":u?G(s,u):void 0,"aria-valuemax":d==="1fr"?100:d?G(s,d):void 0,"aria-valuenow":c?G(s,c):void 0}}function ft(e,t){const a=new ResizeObserver(l=>{const n={};for(const i of l){const d=i.target.getAttribute("data-splitter-id"),c=i.borderBoxSize[0];d&&c&&(n[d]={width:c.inlineSize,height:c.blockSize})}t(n)}),r=document.querySelectorAll(`[data-splitter-group-id="${e}"]`);for(const l of r)a.observe(l);return()=>{a.disconnect()}}function pt(e){const{onMoveStart:t,onMove:a,onMoveEnd:r}=e,l={didMove:!1,lastPosition:null,id:null},n=(o,f,g,p)=>{g===0&&p===0||(l.didMove||(l.didMove=!0,t==null||t({type:"movestart",pointerType:f,shiftKey:o.shiftKey,metaKey:o.metaKey,ctrlKey:o.ctrlKey,altKey:o.altKey})),a==null||a({type:"move",pointerType:f,deltaX:g,deltaY:p,shiftKey:o.shiftKey,metaKey:o.metaKey,ctrlKey:o.ctrlKey,altKey:o.altKey}))},i=(o,f)=>{l.didMove&&(r==null||r({type:"moveend",pointerType:f,shiftKey:o.shiftKey,metaKey:o.metaKey,ctrlKey:o.ctrlKey,altKey:o.altKey}))},u={},d=()=>{l.didMove=!1},c=o=>{var f,g;if(o.pointerId===l.id){const p=o.pointerType||"mouse";n(o,p,o.pageX-(((f=l.lastPosition)==null?void 0:f.pageX)??0),o.pageY-(((g=l.lastPosition)==null?void 0:g.pageY)??0)),l.lastPosition={pageX:o.pageX,pageY:o.pageY}}},s=o=>{if(o.pointerId===l.id){const f=o.pointerType||"mouse";i(o,f),l.id=null,window.removeEventListener("pointermove",c,!1),window.removeEventListener("pointerup",s,!1),window.removeEventListener("pointercancel",s,!1)}};u.onPointerDown=o=>{o.button===0&&l.id==null&&(d(),o.stopPropagation(),o.preventDefault(),l.lastPosition={pageX:o.pageX,pageY:o.pageY},l.id=o.pointerId,window.addEventListener("pointermove",c,!1),window.addEventListener("pointerup",s,!1),window.addEventListener("pointercancel",s,!1))};const m=(o,f,g)=>{d(),n(o,"keyboard",f,g),i(o,"keyboard")};return u.onKeyDown=o=>{switch(o.key){case"Left":case"ArrowLeft":o.preventDefault(),o.stopPropagation(),m(o,-1,0);break;case"Right":case"ArrowRight":o.preventDefault(),o.stopPropagation(),m(o,1,0);break;case"Up":case"ArrowUp":o.preventDefault(),o.stopPropagation(),m(o,0,-1);break;case"Down":case"ArrowDown":o.preventDefault(),o.stopPropagation(),m(o,0,1);break}},{moveProps:u}}const mt=w.defineComponent({__name:"Panel",props:{onResize:{},collapsed:{type:Boolean,default:void 0},onCollapseChange:{},min:{},max:{},default:{},collapsible:{type:Boolean},defaultCollapsed:{type:Boolean},collapsedSize:{},isStaticAtRest:{type:Boolean},collapseAnimation:{},id:{}},setup(e,{expose:t}){const a=e,{min:r,max:l,id:n,collapsible:i,collapsedSize:u,onCollapseChange:d,collapseAnimation:c,onResize:s,defaultCollapsed:m,default:o,isStaticAtRest:f,collapsed:g,...p}=a,v=n||w.useId(),h=w.inject("send"),b=w.inject("state"),P=w.inject("isPrerender"),V=()=>Je({id:v,min:a.min,max:a.max,collapsible:a.collapsible,collapsed:a.collapsed,collapsedSize:a.collapsedSize,onCollapseChange:a.onCollapseChange?{current:a.onCollapseChange}:void 0,collapseAnimation:a.collapseAnimation,onResize:a.onResize?{current:a.onResize}:void 0,defaultCollapsed:m,default:o,isStaticAtRest:f}),x=w.computed(()=>{var C;const z=(C=b==null?void 0:b.value)==null?void 0:C.items.find(q=>q.id===v);if(!(!z||!S(z)))return z});let D=!1;x.value?h==null||h({type:"rebindPanelCallbacks",data:{id:v,onCollapseChange:a.onCollapseChange?{current:a.onCollapseChange}:void 0,onResize:a.onResize?{current:a.onResize}:void 0}}):P!=null&&P.value?h==null||h({type:"registerPanel",data:V()}):D=!0,w.onMounted(()=>{var ae;const z=(ae=b==null?void 0:b.value)==null?void 0:ae.groupId;if(!z||!D)return;const C=document.getElementById(z);if(!C)return;const q=document.getElementById(v);if(!q)return;const ne=Array.from(C.children).indexOf(q);typeof ne=="number"&&(h==null||h({type:"registerDynamicPanel",data:{...V(),order:ne}}),D=!1)});const N=w.computed(()=>!D&&Qe(V(),x.value));w.watchEffect(()=>{N.value&&(h==null||h({type:"updateConstraints",data:V()}))}),w.onUnmounted(()=>{requestAnimationFrame(()=>h==null?void 0:h({type:"unregisterPanel",id:v}))}),t({getId:()=>v,collapse:async()=>{var z;if((z=x.value)!=null&&z.collapsible)return await new Promise(C=>{h==null||h({type:"collapsePanel",panelId:v,controlled:!0,resolve:C})})},isCollapsed:()=>{var z,C;return!!((z=x.value)!=null&&z.collapsible&&((C=x.value)!=null&&C.collapsed))},expand:async()=>{var z;if((z=x.value)!=null&&z.collapsible)return await new Promise(C=>{h==null||h({type:"expandPanel",panelId:v,controlled:!0,resolve:C})})},isExpanded:()=>{var z,C;return!!((z=x.value)!=null&&z.collapsible&&!((C=x.value)!=null&&C.collapsed))},getPixelSize:()=>at(b.value,v),getPercentageSize:()=>lt(b.value,v),setSize:z=>h==null?void 0:h({type:"setPanelPixelSize",panelId:v,size:z})});const M=w.computed(()=>{var z;return(z=x.value)==null?void 0:z.collapseIsControlled});w.watchEffect(()=>{a.collapsed,requestAnimationFrame(()=>{M.value&&(a.collapsed?h==null||h({type:"collapsePanel",panelId:v,controlled:!0}):h==null||h({type:"expandPanel",panelId:v,controlled:!0}))})});const L=w.computed(()=>{var C;const z=x.value;return{...p,...ct({groupId:(C=b==null?void 0:b.value)==null?void 0:C.groupId,id:v,collapsible:z==null?void 0:z.collapsible,collapsed:z==null?void 0:z.collapsed}),style:{minWidth:0,minHeight:0,overflow:"hidden"}}});return(z,C)=>(w.openBlock(),w.createElementBlock("div",w.normalizeProps(w.guardReactiveProps(L.value)),[w.renderSlot(z.$slots,"default")],16))}}),gt=["id"],ht=w.defineComponent({__name:"PanelGroup",props:{snapshot:{},autosaveId:{},orientation:{default:"horizontal"},autosaveStrategy:{default:"localStorage"},shiftAmount:{},id:{}},setup(e,{expose:t}){const a=w.createPropsRestProxy(e,["orientation","autosaveStrategy","snapshot","autosaveId","id","shiftAmount"]);let r=e.snapshot;if(!r&&typeof window<"u"&&e.autosaveId&&e.autosaveStrategy==="localStorage"){const f=localStorage.getItem(e.autosaveId);f&&(r=JSON.parse(f))}const l=w.ref(!0);w.provide("isPrerender",l);const n=e.autosaveId||e.id||w.useId(),[i,u,d]=ut({orientation:e.orientation,groupId:n,autosaveStrategy:e.autosaveStrategy,shiftAmount:e.shiftAmount,...r?Ye(r):void 0},f=>{c.value={...f}});w.onMounted(()=>{l.value=!1});const c=w.ref(i),s=w.computed(()=>{const f=ze(c.value);return{height:"100%",display:"grid",gridTemplateColumns:e.orientation==="horizontal"?f:void 0,gridTemplateRows:e.orientation==="vertical"?f:void 0}});w.provide("send",u),w.provide("state",c),w.provide("id",d);const m=w.ref(null);w.onMounted(()=>{const f=new ResizeObserver(([g])=>{g&&g.contentRect.width>0&&g.contentRect.height>0&&(u==null||u({type:"setSize",size:g.contentRect}))});return m.value&&f.observe(m.value),()=>f.disconnect()});const o=w.computed(()=>{var f;return(f=c.value)==null?void 0:f.items.map(g=>g.id).join(",")});return w.onMounted(()=>{w.watchEffect(()=>{o.value;const f=ft(n,g=>{u({type:"setActualItemsSize",childrenSizes:g})});w.onWatcherCleanup(f)})}),w.onMounted(()=>(u({type:"unlockGroup"}),()=>u({type:"lockGroup"}))),t({getId:()=>n,getPixelSizes:()=>nt(c.value),getPercentageSizes:()=>rt(c.value),getTemplate:()=>ze({...c.value,items:K(c.value)}),getState:()=>d.current==="idle"?"idle":"dragging",setSizes:f=>{var g;for(let p=0;p<f.length;p++){const v=(g=c.value)==null?void 0:g.items[p],h=f[p];v&&S(v)&&h&&u({type:"setPanelPixelSize",panelId:v.id,size:h})}}}),(f,g)=>(w.openBlock(),w.createElementBlock("div",w.mergeProps(a,{id:w.unref(n),ref_key:"elementRef",ref:m,"data-panel-group-wrapper":"",style:s.value}),[w.renderSlot(f.$slots,"default")],16,gt))}}),vt=["tabindex"],wt=w.defineComponent({__name:"PanelResizer",props:{disabled:{type:Boolean},size:{default:"0px"},onDragStart:{type:Function},onDrag:{type:Function},onDragEnd:{type:Function},setSize:{type:Function},id:{}},setup(e){const t=w.createPropsRestProxy(e,["size","id","onDragStart","onDrag","onDragEnd","disabled"]),r=e.id||w.useId(),l=w.inject("send"),n=w.inject("state"),i=w.inject("isPrerender"),u=()=>_e({size:e.size,id:r}),d=w.computed(()=>{var p;const g=(p=n==null?void 0:n.value)==null?void 0:p.items.find(v=>v.id===r);if(!(!g||!k(g)))return g});let c=!1;d.value||(i!=null&&i.value?l==null||l({type:"registerPanelHandle",data:u()}):c=!0),w.onMounted(()=>{var b,P;if(!((b=n==null?void 0:n.value)==null?void 0:b.groupId)||!c)return;const p=document.getElementById((P=n==null?void 0:n.value)==null?void 0:P.groupId);if(!p)return;const v=document.getElementById(r);if(!v)return;const h=Array.from(p.children).indexOf(v);typeof h=="number"&&(l==null||l({type:"registerPanelHandle",data:{...u(),order:h}}),c=!1)});const s=w.computed(()=>!c&&Ze(u(),d.value));w.watchEffect(()=>{s.value&&(l==null||l({type:"updateConstraints",data:u()}))}),w.onUnmounted(()=>{requestAnimationFrame(()=>l==null?void 0:l({type:"unregisterPanelHandle",id:r}))});const{moveProps:m}=pt({onMoveStart:()=>{var g;l==null||l({type:"dragHandleStart",handleId:r}),(g=e.onDragStart)==null||g.call(e),n!=null&&n.value&&(document.body.style.cursor=we(n==null?void 0:n.value)||"auto")},onMove:g=>{var p;l==null||l({type:"dragHandle",handleId:r,value:g}),(p=e.onDrag)==null||p.call(e)},onMoveEnd:()=>{var g;l==null||l({type:"dragHandleEnd",handleId:r}),(g=e.onDragEnd)==null||g.call(e),document.body.style.cursor="auto"}}),o=g=>{if(n!=null&&n.value)try{const p=et(n==null?void 0:n.value,r);g.key==="Enter"&&p&&(p.collapsed?l==null||l({type:"expandPanel",panelId:p.id}):l==null||l({type:"collapsePanel",panelId:p.id}))}catch{}},f=w.computed(()=>{var h,b,P,V,x,D,N,M,L;const g=(h=n==null?void 0:n.value)==null?void 0:h.items.findIndex(z=>z.id===r);if(!g)return{id:r};const p=(b=n==null?void 0:n.value)==null?void 0:b.items[g],v=(P=n==null?void 0:n.value)==null?void 0:P.items[g-1];return!v||!S(v)?{id:r}:{...t,...dt({groupId:(V=n==null?void 0:n.value)==null?void 0:V.groupId,id:r,orientation:((x=n==null?void 0:n.value)==null?void 0:x.orientation)||"horizontal",isDragging:((D=n==null?void 0:n.value)==null?void 0:D.activeDragHandleId)===r,activeDragHandleId:(N=n==null?void 0:n.value)==null?void 0:N.activeDragHandleId,disabled:e.disabled,controlsId:v.id,min:v.min,max:v.max,currentValue:v.currentValue,groupSize:R(n.value)}),onpointerdown:e.disabled?void 0:m.onPointerDown,onkeydown:e.disabled?void 0:z=>{m.onKeyDown(z),o(z)},style:{cursor:n!=null&&n.value?we(n.value):void 0,width:((M=n==null?void 0:n.value)==null?void 0:M.orientation)==="horizontal"?`${p==null?void 0:p.size.value.toNumber()}px`:"100%",height:((L=n==null?void 0:n.value)==null?void 0:L.orientation)==="vertical"?`${p==null?void 0:p.size.value.toNumber()}px`:"100%"}}});return(g,p)=>(w.openBlock(),w.createElementBlock("div",w.mergeProps(f.value,{tabindex:g.disabled?-1:0}),[w.renderSlot(g.$slots,"default")],16,vt))}});exports.Panel=mt;exports.PanelGroup=ht;exports.PanelResizer=wt;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const v=require("vue");var Be=20,Ee=1,Y=1e6,Ke=1e6,Oe=-7,Ne=21,He=!1,ee="[big.js] ",W=ee+"Invalid ",ue=W+"decimal places",$e=W+"rounding mode",Ie=ee+"Division by zero",P={},N=void 0,Me=/^-?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i;function Pe(){function e(t){var n=this;if(!(n instanceof e))return t===N?Pe():new e(t);if(t instanceof e)n.s=t.s,n.e=t.e,n.c=t.c.slice();else{if(typeof t!="string"){if(e.strict===!0&&typeof t!="bigint")throw TypeError(W+"value");t=t===0&&1/t<0?"-0":String(t)}Le(n,t)}n.constructor=e}return e.prototype=P,e.DP=Be,e.RM=Ee,e.NE=Oe,e.PE=Ne,e.strict=He,e.roundDown=0,e.roundHalfUp=1,e.roundHalfEven=2,e.roundUp=3,e}function Le(e,t){var n,a,r;if(!Me.test(t))throw Error(W+"number");for(e.s=t.charAt(0)=="-"?(t=t.slice(1),-1):1,(n=t.indexOf("."))>-1&&(t=t.replace(".","")),(a=t.search(/e/i))>0?(n<0&&(n=a),n+=+t.slice(a+1),t=t.substring(0,a)):n<0&&(n=t.length),r=t.length,a=0;a<r&&t.charAt(a)=="0";)++a;if(a==r)e.c=[e.e=0];else{for(;r>0&&t.charAt(--r)=="0";);for(e.e=n-a-1,e.c=[],n=0;a<=r;)e.c[n++]=+t.charAt(a++)}return e}function U(e,t,n,a){var r=e.c;if(n===N&&(n=e.constructor.RM),n!==0&&n!==1&&n!==2&&n!==3)throw Error($e);if(t<1)a=n===3&&(a||!!r[0])||t===0&&(n===1&&r[0]>=5||n===2&&(r[0]>5||r[0]===5&&(a||r[1]!==N))),r.length=1,a?(e.e=e.e-t+1,r[0]=1):r[0]=e.e=0;else if(t<r.length){if(a=n===1&&r[t]>=5||n===2&&(r[t]>5||r[t]===5&&(a||r[t+1]!==N||r[t-1]&1))||n===3&&(a||!!r[0]),r.length=t,a){for(;++r[--t]>9;)if(r[t]=0,t===0){++e.e,r.unshift(1);break}}for(t=r.length;!r[--t];)r.pop()}return e}function G(e,t,n){var a=e.e,r=e.c.join(""),i=r.length;if(t)r=r.charAt(0)+(i>1?"."+r.slice(1):"")+(a<0?"e":"e+")+a;else if(a<0){for(;++a;)r="0"+r;r="0."+r}else if(a>0)if(++a>i)for(a-=i;a--;)r+="0";else a<i&&(r=r.slice(0,a)+"."+r.slice(a));else i>1&&(r=r.charAt(0)+"."+r.slice(1));return e.s<0&&n?"-"+r:r}P.abs=function(){var e=new this.constructor(this);return e.s=1,e};P.cmp=function(e){var t,n=this,a=n.c,r=(e=new n.constructor(e)).c,i=n.s,l=e.s,o=n.e,u=e.e;if(!a[0]||!r[0])return a[0]?i:r[0]?-l:0;if(i!=l)return i;if(t=i<0,o!=u)return o>u^t?1:-1;for(l=(o=a.length)<(u=r.length)?o:u,i=-1;++i<l;)if(a[i]!=r[i])return a[i]>r[i]^t?1:-1;return o==u?0:o>u^t?1:-1};P.div=function(e){var t=this,n=t.constructor,a=t.c,r=(e=new n(e)).c,i=t.s==e.s?1:-1,l=n.DP;if(l!==~~l||l<0||l>Y)throw Error(ue);if(!r[0])throw Error(Ie);if(!a[0])return e.s=i,e.c=[e.e=0],e;var o,u,c,w,s,f=r.slice(),m=o=r.length,d=a.length,p=a.slice(0,o),g=p.length,h=e,b=h.c=[],y=0,S=l+(h.e=t.e-e.e)+1;for(h.s=i,i=S<0?0:S,f.unshift(0);g++<o;)p.push(0);do{for(c=0;c<10;c++){if(o!=(g=p.length))w=o>g?1:-1;else for(s=-1,w=0;++s<o;)if(r[s]!=p[s]){w=r[s]>p[s]?1:-1;break}if(w<0){for(u=g==o?r:f;g;){if(p[--g]<u[g]){for(s=g;s&&!p[--s];)p[s]=9;--p[s],p[g]+=10}p[g]-=u[g]}for(;!p[0];)p.shift()}else break}b[y++]=w?c:++c,p[0]&&w?p[g]=a[m]||0:p=[a[m]]}while((m++<d||p[0]!==N)&&i--);return!b[0]&&y!=1&&(b.shift(),h.e--,S--),y>S&&U(h,S,n.RM,p[0]!==N),h};P.eq=function(e){return this.cmp(e)===0};P.gt=function(e){return this.cmp(e)>0};P.gte=function(e){return this.cmp(e)>-1};P.lt=function(e){return this.cmp(e)<0};P.lte=function(e){return this.cmp(e)<1};P.minus=P.sub=function(e){var t,n,a,r,i=this,l=i.constructor,o=i.s,u=(e=new l(e)).s;if(o!=u)return e.s=-u,i.plus(e);var c=i.c.slice(),w=i.e,s=e.c,f=e.e;if(!c[0]||!s[0])return s[0]?e.s=-u:c[0]?e=new l(i):e.s=1,e;if(o=w-f){for((r=o<0)?(o=-o,a=c):(f=w,a=s),a.reverse(),u=o;u--;)a.push(0);a.reverse()}else for(n=((r=c.length<s.length)?c:s).length,o=u=0;u<n;u++)if(c[u]!=s[u]){r=c[u]<s[u];break}if(r&&(a=c,c=s,s=a,e.s=-e.s),(u=(n=s.length)-(t=c.length))>0)for(;u--;)c[t++]=0;for(u=t;n>o;){if(c[--n]<s[n]){for(t=n;t&&!c[--t];)c[t]=9;--c[t],c[n]+=10}c[n]-=s[n]}for(;c[--u]===0;)c.pop();for(;c[0]===0;)c.shift(),--f;return c[0]||(e.s=1,c=[f=0]),e.c=c,e.e=f,e};P.mod=function(e){var t,n=this,a=n.constructor,r=n.s,i=(e=new a(e)).s;if(!e.c[0])throw Error(Ie);return n.s=e.s=1,t=e.cmp(n)==1,n.s=r,e.s=i,t?new a(n):(r=a.DP,i=a.RM,a.DP=a.RM=0,n=n.div(e),a.DP=r,a.RM=i,this.minus(n.times(e)))};P.neg=function(){var e=new this.constructor(this);return e.s=-e.s,e};P.plus=P.add=function(e){var t,n,a,r=this,i=r.constructor;if(e=new i(e),r.s!=e.s)return e.s=-e.s,r.minus(e);var l=r.e,o=r.c,u=e.e,c=e.c;if(!o[0]||!c[0])return c[0]||(o[0]?e=new i(r):e.s=r.s),e;if(o=o.slice(),t=l-u){for(t>0?(u=l,a=c):(t=-t,a=o),a.reverse();t--;)a.push(0);a.reverse()}for(o.length-c.length<0&&(a=c,c=o,o=a),t=c.length,n=0;t;o[t]%=10)n=(o[--t]=o[t]+c[t]+n)/10|0;for(n&&(o.unshift(n),++u),t=o.length;o[--t]===0;)o.pop();return e.c=o,e.e=u,e};P.pow=function(e){var t=this,n=new t.constructor("1"),a=n,r=e<0;if(e!==~~e||e<-1e6||e>Ke)throw Error(W+"exponent");for(r&&(e=-e);e&1&&(a=a.times(t)),e>>=1,!!e;)t=t.times(t);return r?n.div(a):a};P.prec=function(e,t){if(e!==~~e||e<1||e>Y)throw Error(W+"precision");return U(new this.constructor(this),e,t)};P.round=function(e,t){if(e===N)e=0;else if(e!==~~e||e<-1e6||e>Y)throw Error(ue);return U(new this.constructor(this),e+this.e+1,t)};P.sqrt=function(){var e,t,n,a=this,r=a.constructor,i=a.s,l=a.e,o=new r("0.5");if(!a.c[0])return new r(a);if(i<0)throw Error(ee+"No square root");i=Math.sqrt(a+""),i===0||i===1/0?(t=a.c.join(""),t.length+l&1||(t+="0"),i=Math.sqrt(t),l=((l+1)/2|0)-(l<0||l&1),e=new r((i==1/0?"5e":(i=i.toExponential()).slice(0,i.indexOf("e")+1))+l)):e=new r(i+""),l=e.e+(r.DP+=4);do n=e,e=o.times(n.plus(a.div(n)));while(n.c.slice(0,l).join("")!==e.c.slice(0,l).join(""));return U(e,(r.DP-=4)+e.e+1,r.RM)};P.times=P.mul=function(e){var t,n=this,a=n.constructor,r=n.c,i=(e=new a(e)).c,l=r.length,o=i.length,u=n.e,c=e.e;if(e.s=n.s==e.s?1:-1,!r[0]||!i[0])return e.c=[e.e=0],e;for(e.e=u+c,l<o&&(t=r,r=i,i=t,c=l,l=o,o=c),t=new Array(c=l+o);c--;)t[c]=0;for(u=o;u--;){for(o=0,c=l+u;c>u;)o=t[c]+i[u]*r[c-u-1]+o,t[c--]=o%10,o=o/10|0;t[c]=o}for(o?++e.e:t.shift(),u=t.length;!t[--u];)t.pop();return e.c=t,e};P.toExponential=function(e,t){var n=this,a=n.c[0];if(e!==N){if(e!==~~e||e<0||e>Y)throw Error(ue);for(n=U(new n.constructor(n),++e,t);n.c.length<e;)n.c.push(0)}return G(n,!0,!!a)};P.toFixed=function(e,t){var n=this,a=n.c[0];if(e!==N){if(e!==~~e||e<0||e>Y)throw Error(ue);for(n=U(new n.constructor(n),e+n.e+1,t),e=e+n.e+1;n.c.length<e;)n.c.push(0)}return G(n,!1,!!a)};P[Symbol.for("nodejs.util.inspect.custom")]=P.toJSON=P.toString=function(){var e=this,t=e.constructor;return G(e,e.e<=t.NE||e.e>=t.PE,!!e.c[0])};P.toNumber=function(){var e=Number(G(this,!0,!0));if(this.constructor.strict===!0&&!this.eq(e.toString()))throw Error(ee+"Imprecise conversion");return e};P.toPrecision=function(e,t){var n=this,a=n.constructor,r=n.c[0];if(e!==N){if(e!==~~e||e<1||e>Y)throw Error(W+"precision");for(n=U(new a(n),e,t);n.c.length<e;)n.c.push(0)}return G(n,e<=n.e||n.e<=a.NE||n.e>=a.PE,!!r)};P.valueOf=function(){var e=this,t=e.constructor;if(t.strict===!0)throw Error(ee+"valueOf disallowed");return G(e,e.e<=t.NE||e.e>=t.PE,!0)};var I=Pe();function qe(e,t){e.forEach(n=>{try{t(n)}catch(a){console.error(a)}})}let Q=0;function Te(){let e=new Set,t=e;return{add(n){Q+=t==e&&!e.has(n)?1:0,e.add(n)},delete(n){return Q-=t==e&&e.has(n)?1:0,e.delete(n)},flush(n){t.size&&(e=new Set,Q-=t.size,qe(t,a=>a(n)&&e.add(a)),Q+=e.size,t=e)}}}const Se=Te(),Ce=typeof window<"u"?window.requestAnimationFrame:()=>{},te=e=>Fe(e,Se);te.now=typeof performance<"u"?()=>performance.now():Date.now;te.batchedUpdates=e=>e();let F=-1;function Fe(e,t){t.add(e),je()}function je(){F<0&&(F=0,Ce(Ae))}function We(){F=-1}function Ae(){~F&&(Ce(Ae),te.batchedUpdates(Ue))}function Ue(){const e=F;if(F=te.now(),!Q){We();return}Se.flush(e?Math.min(64,F-e):16.667)}const we=50;function Xe(e){return{type:"percent",value:new I(e)}}function $(e){return{type:"pixel",value:new I(e)}}function Ye(e){let t=de.linear,n=300;return e.collapseAnimation&&(typeof e.collapseAnimation=="string"?t=de[e.collapseAnimation]:(n=e.collapseAnimation.duration,t=typeof e.collapseAnimation.easing=="function"?e.collapseAnimation.easing:de[e.collapseAnimation.easing])),{ease:t,duration:n}}const de={"ease-in-out":function(t){return((t*=2)<=1?t*t:--t*(2-t)+1)/2},bounce:function(t){return((t*=2)<1?t*t*((1.70158+1)*t-1.70158):(t-=2)*t*((1.70158+1)*t+1.70158)+2)/2},linear:function(t){return+t}};function ze(e){return e.orientation==="horizontal"?e.dragOvershoot.gt(0)?"w-resize":e.dragOvershoot.lt(0)?"e-resize":"ew-resize":e.dragOvershoot.gt(0)?"n-resize":e.dragOvershoot.lt(0)?"s-resize":"ns-resize"}function Ge(e){if("context"in e&&(e=e.context),"items"in e){e.dragOvershoot=new I(e.dragOvershoot||0);for(const t of e.items)C(t)?(t.currentValue.value=new I(t.currentValue.value),t.collapsedSize.value=new I(t.collapsedSize.value),t.min.value=new I(t.min.value),t.default&&(t.default.value=new I(t.default.value)),t.max&&t.max!=="1fr"&&(t.max.value=new I(t.max.value))):t.size.value=new I(t.size.value);return e}}function j(e,t){if(!e)throw new Error(t)}function J(e,t){j(t.includes(e.type),`Invalid event type: ${t}. Expected: ${t.join(" | ")}`)}function C(e){return!!(e&&typeof e=="object"&&"type"in e&&e.type==="panel")}function D(e){return!!(e&&typeof e=="object"&&"type"in e&&e.type==="handle")}function Je(e){const t=()=>{let a=null;return r=>{var i,l;if(!a||a.pixel===r.pixel&&a.percentage===r.percentage){a=r;return}a=r,(l=(i=e.onResize)==null?void 0:i.current)==null||l.call(i,r)}};return{...{type:"panel",min:T(e.min||"0px"),max:e.max?T(e.max):"1fr",collapsed:e.collapsible?e.collapsed??e.defaultCollapsed??!1:void 0,collapsible:e.collapsible,collapsedSize:T(e.collapsedSize??"0px"),onCollapseChange:e.onCollapseChange,onResize:{current:t()},collapseIsControlled:typeof e.collapsed<"u",sizeBeforeCollapse:void 0,id:e.id,collapseAnimation:e.collapseAnimation,default:e.default?T(e.default):void 0,isStaticAtRest:e.isStaticAtRest},currentValue:$(-1)}}function Z(e,t){return e.type===t.type&&e.value.eq(t.value)}function Qe(e,t){return!!(!t||!Z(e.min,t.min)||e.max==="1fr"&&t.max!=="1fr"||e.max!=="1fr"&&t.max==="1fr"||e.max!=="1fr"&&t.max!=="1fr"&&!Z(e.max,t.max)||e.default&&!t.default||!e.default&&t.default||e.default&&t.default&&!Z(e.default,t.default)||!Z(e.collapsedSize,t.collapsedSize)||e.isStaticAtRest!==t.isStaticAtRest||e.collapseAnimation&&!t.collapseAnimation||!e.collapseAnimation&&t.collapseAnimation||typeof e.collapseAnimation=="string"&&typeof t.collapseAnimation=="string"&&e.collapseAnimation!==t.collapseAnimation||typeof e.collapseAnimation=="object"&&typeof t.collapseAnimation=="object"&&(e.collapseAnimation.duration!==t.collapseAnimation.duration||e.collapseAnimation.easing!==t.collapseAnimation.easing)||e.collapsible!==t.collapsible)}function Ze(e,t){return!t||!Z(e.size,t.size)}function _e(e){return{type:"handle",...e,size:typeof e.size=="string"?T(e.size):e.size}}function T(e){if(e==="1fr"&&(e="100%"),e.endsWith("px"))return $(parseFloat(e));if(e.endsWith("%"))return Xe(parseFloat(e)/100);throw new Error(`Invalid unit: ${e}`)}function X(e,t){return t.type==="pixel"?e===0?0:t.value.div(e).toNumber():t.value.toNumber()}function R(e){return e.orientation==="horizontal"?e.size.width:e.size.height}function x(e,t){const n=t==="1fr"?T(t):t;return n.type==="pixel"?n.value:n.value.mul(R(e))}function H(e,t,n){const a=x(e,t.min),r=x(e,t.max);return n.gte(a)&&n.lte(r)?n:n.lt(a)?a:r}function E(e,t){const n=e.items.find(a=>a.id===t);if(n&&C(n))return n;throw new Error(`Expected panel with id: ${t}`)}function ge(e,t){const n=e.items.findIndex(a=>a.id===t);if(n!==-1&&D(e.items[n]))return n;throw new Error(`Expected panel handle with id: ${t}`)}function et(e,t){if(!e.items.length)throw new Error("No items in group");const n=ge(e,t),a=e.items[n-1],r=e.items[n+1];if(a&&C(a)&&a.collapsible)return a;if(r&&C(r)&&r.collapsible)return r;throw new Error(`No collapsible panel found for handle: ${t}`)}function ie(e,t){const n=e.items.findIndex(r=>r.id===t);if(e.activeDragHandleId){const r=ge(e,e.activeDragHandleId),i=e.items[r];if(i&&D(i))return{item:i,direction:r>n?1:-1}}j(n!==-1,`Expected panel before: ${t}`);let a=e.items[n+1];if(a&&D(a))return{item:a,direction:1};if(a=e.items[n-1],a&&D(a))return{item:a,direction:-1};throw new Error(`Cant find handle for panel: ${t}`)}function xe(e,t){const n=e.items.findIndex(r=>r.id===t);j(n!==-1,`Expected panel before: ${t}`);let a=e.items[n+1];return a&&D(a)&&_(e,e.items,n+1,1,"add")?{item:a,direction:1}:(a=e.items[n-1],a&&D(a)&&_(e,e.items,n-1,-1,"add")?{item:a,direction:-1}:ie(e,t))}function Ve(e){const t={},n=e.map(l=>l.order).filter(l=>l!==void 0);let a=0;for(const l of e)if(l.order===void 0){for(;n.includes(a)||Object.values(t).includes(a);)a++;t[l.id]=a}const r=e.filter(l=>l.order===void 0),i=e.filter(l=>l.order!==void 0).sort((l,o)=>l.order-o.order);for(const l of i)r.splice(l.order,0,l);return r}function tt(e,t,n){return j(t.currentValue.type==="pixel",`panelHasSpace only works with number values: ${t.id} ${t.currentValue}`),t.collapsible?!t.collapsed:n==="add"?t.currentValue.value.gte(x(e,t.min))&&t.currentValue.value.lt(x(e,t.max)):t.currentValue.value.gt(x(e,t.min))}function _(e,t,n,a,r,i){const l=a===-1?t.slice(0,n+1).reverse():t.slice(n);for(const o of l){if(!C(o))continue;const u=i?pe(e,o):o;if(tt(e,u,r))return o}}function ce(e){let t=new I(0);for(const n of e.items)D(n)?t=t.add(n.size.value):(n.collapsed&&n.currentValue.type==="pixel"||n.isStaticAtRest)&&(t=t.add(n.currentValue.value));return t}function B(e){return e.type==="pixel"?`${e.value.toNumber()}px`:`${e.value.mul(100).toNumber()}%`}function nt(e){return K(e).map(t=>C(t)?t.currentValue.value.toNumber():x(e,t.size).toNumber())}function at(e,t){return E({...e,items:K(e)},t).currentValue.value.toNumber()}function rt(e){return ve({...e,items:K(e)}).map(n=>D(n)?X(R(e),n.size):X(R(e),n.currentValue))}function lt(e,t){const n=K(e),a=E({...e,items:n},t);return X(R(e),a.currentValue)}function oe(e){const t=ce(e);let n=!1;return e.items.map(a=>{if(a.type==="panel"){const r=B(a.min);if(a.currentValue.type==="pixel"&&a.currentValue.value.toNumber()!==-1){if(a.isStaticAtRest){const i=a.max==="1fr"?"100%":B(a.max);return`clamp(${r}, ${B(a.currentValue)}, ${i})`}return B(a.currentValue)}else if(a.currentValue.type==="percent"){if(!n&&(a.max==="1fr"||a.max.type==="percent"&&a.max.value.eq(100)))return n=!0,`minmax(${r}, 1fr)`;const i=a.max==="1fr"?"100%":B(a.max);return`minmax(${r}, min(calc(${a.currentValue.value} * (100% - ${t}px)), ${i}))`}else{if(a.collapsible&&a.collapsed)return B(a.collapsedSize);if(a.default){if(e.items.some(o=>C(o)&&o.id!==a.id&&!o.collapsed&&(o.max==="1fr"||o.max.type==="percent"&&o.max.value.eq(100))))return B(a.default);const l=a.max==="1fr"?"1fr":B(a.max);return`minmax(${B(a.default)}, ${l})`}else{const i=a.max==="1fr"?"1fr":B(a.max);return`minmax(${r}, ${i})`}}}return B(a.size)}).join(" ")}function fe(e,t){const n=e.findIndex(r=>r.id===t.id||typeof r.order=="number"&&r.order===t.order);let a=e;return n!==-1&&(a=e.filter((r,i)=>i!==n)),Ve([...a,t])}function pe(e,t){return{...t,min:$(-1e5),max:$(1e5)}}function K(e){const t=ce(e),n=[];for(const a of e.items){if(!a||!C(a)){n.push({...a});continue}if(a.lastKnownSize){const i=$(e.orientation==="horizontal"?a.lastKnownSize.width:a.lastKnownSize.height);n.push({...a,currentValue:i});continue}if(a.currentValue.type==="pixel"){n.push({...a});continue}const r=new I(R(e)).minus(t).mul(a.currentValue.value);n.push({...a,currentValue:$(r.toNumber())})}return n}function re(e,t){var k,O,M,L;const n=ge(e,t.handleId),a=e.items[n],i=e.items.some(z=>C(z)&&z.currentValue.type!=="pixel")?K(e):[...e.items];let l=e.orientation==="horizontal"?t.value.deltaX:t.value.deltaY;if(t.value.shiftKey&&(l*=e.shiftAmount??15),l===0)return{};const o=l/Math.abs(l),u=_(e,i,n+o,o,"subtract",t.disregardCollapseBuffer);if(!u)return{dragOvershoot:e.dragOvershoot.add(l)};j(C(u),`Expected panel before: ${a.id}`);const c=t.type==="collapsePanel"&&(i.find(z=>z.id===t.panelId&&u.id!==t.panelId)||_(e,i,n-o,o*-1,"add",t.disregardCollapseBuffer))||i[n-o];if(j(c&&C(c),`Expected panel after: ${a.id}`),c.currentValue.value.eq(x(e,c.max)))return{dragOvershoot:e.dragOvershoot.add(l)};const w=e.dragOvershoot.add(l);if(!t.disregardCollapseBuffer&&!t.controlled){const z=w.lt(0)&&o>0,A=w.gt(0)&&o>0,q=w.gt(0)&&o<0,ne=w.lt(0)&&o<0,ae=c.currentValue.value.add(new I(w).mul(q?o:1)),ke=x(e,c.min),De=w.abs().lt(we)&&!c.currentValue.value.add(w.abs()).gte(c.min.value)&&c.collapsible&&c.collapsed&&(A||ne);if(ae.lte(ke)&&(w.eq(0)||q||z||De))return{dragOvershoot:w}}if(!t.disregardCollapseBuffer&&!t.controlled&&u.collapsible&&u.currentValue.value.eq(x(e,u.min))){const z=u.currentValue.value.sub(w.abs());if(w.abs().lt(we)&&z.gt(x(e,u.collapsedSize)))return{dragOvershoot:w}}const s=pe(e,u),f=u.currentValue.value,m=u.currentValue.value.minus(new I(l).mul(o));let d=t.disregardCollapseBuffer?H(e,s,m):H(e,u,m);const p=pe(e,c),g=c.currentValue.value,h=f.minus(d),b=c.currentValue.value.add(h);let y=t.disregardCollapseBuffer?H(e,p,b):H(e,c,b);if(t.disregardCollapseBuffer)c.collapsible&&c.collapsed&&(c.collapsed=!1);else if(c.collapsible&&c.collapsed){if((k=c.onCollapseChange)!=null&&k.current&&c.collapseIsControlled&&!t.controlled&&!t.isVirtual)return c.onCollapseChange.current(!1),{dragOvershoot:w};const z=x(e,c.collapsedSize).add(e.dragOvershoot.abs()).sub(y.add(Math.abs(l)));if(z.gt(0)&&(y=y.add(z)),d=d.minus(y.minus(g).minus(Math.abs(l))),d.lt(u.min.value)&&!u.collapsible)return{dragOvershoot:w};c.collapsed=!1,(O=c.onCollapseChange)!=null&&O.current&&!c.collapseIsControlled&&!t.controlled&&!t.isVirtual&&c.onCollapseChange.current(!1)}const S=u.currentValue.value.eq(x(e,u.min));if(!t.disregardCollapseBuffer&&u.collapsible&&S){if((M=u.onCollapseChange)!=null&&M.current&&u.collapseIsControlled&&!t.controlled&&!t.isVirtual)return u.onCollapseChange.current(!0),{dragOvershoot:w};u.collapsed=!0,d=x(e,u.collapsedSize),y=c.currentValue.value.add(f.minus(d)),(L=u.onCollapseChange)!=null&&L.current&&!u.collapseIsControlled&&!t.controlled&&!t.isVirtual&&u.onCollapseChange.current(!0)}u.currentValue={type:"pixel",value:d},c.currentValue={type:"pixel",value:y};const V=new I(R(e)).minus(i.reduce((z,A)=>z.add(C(A)?A.currentValue.value:A.size.value),new I(0)));return V.eq(0)||(u.currentValue.value=H(e,u,u.currentValue.value.add(V))),{items:i}}function ve(e){const t=[...e.items];t.forEach((a,r)=>{a.type==="panel"&&a.collapsed&&(t[r]={...a,currentValue:a.collapsedSize})});const n=ce({...e,items:t});return t.forEach((a,r)=>{a.type!=="panel"||a.collapsed||a.isStaticAtRest||(t[r]={...a,currentValue:{type:"percent",value:a.currentValue.value.div(new I(R(e)).sub(n))}})}),t}function me({delta:e,orientation:t="horizontal",shiftKey:n=!1}){return{type:"move",pointerType:"keyboard",shiftKey:n,ctrlKey:!1,altKey:!1,metaKey:!1,deltaX:t==="horizontal"?e:0,deltaY:t==="horizontal"?0:e}}function se({context:e,handleId:t,delta:n,direction:a,controlled:r,disregardCollapseBuffer:i,isVirtual:l,panelId:o}){let u=e;for(let c=0;c<n.abs().toNumber();c++)u=re({...e,...u},{handleId:t,type:"collapsePanel",controlled:r,disregardCollapseBuffer:i,isVirtual:l,panelId:o,value:me({delta:a,orientation:e.orientation})});return u}function he(e,t,n,a){let r=!1,i=1,l=new I(a);for(;l.toNumber()!==0;){const o=_(e,t,n+i,i,a.gt(0)?"add":"subtract");if(!o){if(r)break;i=i===1?-1:1,r=!0;continue}const u=o.currentValue.value,c=H(e,o,u.add(l));o.currentValue.value=c,l=l.sub(c.sub(u)),i=i===1?-1:1}}function it(e){if(e.items.some(u=>C(u)&&u.currentValue.value.eq(-1)))return e;const t=new I(R(e)),n=t.sub(ce(e).toNumber()),r=e.items.map(u=>{if(D(u))return u.size.value;if(u.collapsed)return x(e,u.currentValue);const c=u.currentValue.type==="pixel"&&u.currentValue.value||u.currentValue.value.mul(n);return H(e,u,c)}).reduce((u,c)=>u.add(c),new I(0)),i=r.abs().sub(t);if(i.abs().lt(1)||t.eq(0))return e;let l={...e,items:K(e)};const o=l.items.find(u=>!!(C(u)&&u.collapsible));if(o){const u=l.items.findIndex(s=>s.id===o.id),c=ie(l,o.id),w=o.currentValue.value.sub(x(l,o.collapsedSize));l={...l,...se({handleId:c.item.id,delta:w,direction:c.direction*-1,panelId:o.id,context:{...l,size:{width:r.toNumber(),height:r.toNumber()}}})},he(l,l.items,u,i.neg())}return{...l,items:ve(l)}}function be(e){return e.map(t=>({...t,lastKnownSize:void 0}))}function ot(e,t){document.cookie=`${e}=${encodeURIComponent(`${t}`)};path=/;max-age=31536000`}function Re(e,t){const n=E(e,t.panelId);if(t.type==="expandPanel")return new I(n.sizeBeforeCollapse??x(e,n.min)).minus(n.currentValue.value);const a=x(e,n.collapsedSize);return n.currentValue.value.minus(a)}function ye(e,t,n,a){const r=E(e,t.panelId),i=xe(e,t.panelId);let l=new I(i.direction);const o=Re(e,t),u={...e,items:K(e)},c=se({context:u,panelId:t.panelId,handleId:i.item.id,delta:o,direction:i.direction,isVirtual:!0});return new Promise((w,s)=>{a.signal.addEventListener("abort",()=>{s(new Error("Operation was canceled"))}),t.type==="collapsePanel"&&(r.sizeBeforeCollapse=r.currentValue.value.toNumber(),l=l.mul(new I(-1)));const f=60,{duration:m,ease:d}=Ye(r),p=Math.ceil(r.collapseAnimation?m/(1e3/f):1);let g=0,h=new I(0);function b(){const y=++g/p,S=new I(r.collapseAnimation?d(y):1),V=S.mul(o).sub(h).mul(l);if(n({type:"applyDelta",handleId:i.item.id,delta:V.toNumber(),panelId:r.id}),h=h.add(V.abs().mul(V.gt(0)&&l.lt(0)||V.lt(0)&&l.gt(0)?-1:1)),S.eq(1)){e.items.find(O=>C(O)&&O.currentValue.value.round(void 0,I.roundHalfEven).lt(0))&&le(e,c);const k=t.type==="expandPanel"?"expand":"collapse";return w({panelId:r.id,action:k,resolve:t.resolve}),!1}return!0}te(b)})}function le(e,t){for(const n in t)e[n]=t[n]}let st=0;function ut(e,t,n){const a=new AbortController,r={current:"idle"};let i=!1;const l={size:e.size||{width:0,height:0},items:e.items||[],orientation:e.orientation||"horizontal",dragOvershoot:new I(0),groupId:e.groupId||`group-${st++}`,autosaveStrategy:e.autosaveStrategy,shiftAmount:e.shiftAmount??15},o={prepare:()=>{l.items=K(l)},clearLastKnownSize:()=>{l.items=be(l.items)},commit:()=>{l.dragOvershoot=new I(0),l.items=ve(l)},onResize:()=>{var s,f;for(const m of l.items)if(C(m)){const d=m.lastKnownSize?new I(l.orientation==="horizontal"?m.lastKnownSize.width:m.lastKnownSize.height):H(l,m,x(l,m.currentValue)),p=R(l);(f=(s=m.onResize)==null?void 0:s.current)==null||f.call(s,{pixel:d.toNumber(),percentage:p>0?d.div(R(l)).toNumber():-1})}},onAutosave:()=>{if(!l.autosaveStrategy||typeof window>"u")return;const s={...l};s.items=be(l.items),s.activeDragHandleId=l.activeDragHandleId;const f=JSON.stringify(s);l.autosaveStrategy==="localStorage"?localStorage.setItem(l.groupId,f):ot(l.groupId,f)},removeItem:s=>{const f=l.items.findIndex(g=>g.id===s),m=l.items[f];if(!m)return;const d=l.items.filter(g=>g.id!==s),p=C(m)?m.currentValue.value:m.size.value;he(l,d,f,p),l.items=d},notifyCollapseToggle:s=>{var m,d;J(s,["collapsePanel","expandPanel"]);const f=E(l,s.panelId);(d=(m=f.onCollapseChange)==null?void 0:m.current)==null||d.call(m,!f.collapsed)},runCollapseToggle:s=>{J(s,["collapsePanel","expandPanel"]);const f=ie(l,s.panelId),m=s.type==="collapsePanel"?f.direction*-1:f.direction,d=re(l,{panelId:s.panelId,handleId:f.item.id,type:"dragHandle",controlled:s.controlled,value:me({delta:m,orientation:l.orientation})});le(l,d)},onAnimationEnd:s=>{var m,d;j(s,"Expected output from animation actor");const f=E(l,s.panelId);f.collapsed=s.action==="collapse",f.collapsed&&(f.currentValue=f.collapsedSize),f.collapseIsControlled||(d=(m=f.onCollapseChange)==null?void 0:m.current)==null||d.call(m,f.collapsed),o.commit()}};o.onAutosave();const u={shouldNotifyCollapseToggle:s=>{J(s,["collapsePanel","expandPanel"]);const f=E(l,s.panelId);return!s.controlled&&f.collapseIsControlled===!0},shouldCollapseToggle:s=>(J(s,["collapsePanel","expandPanel"]),E(l,s.panelId).collapseIsControlled===!0),cannotExpandPanel:s=>{J(s,["expandPanel"]);const f=K(l);let m={...l,items:f};const d=Re(l,s),p=xe(m,s.panelId);m={...m,...se({context:m,panelId:s.panelId,handleId:p.item.id,controlled:s.controlled,delta:d,direction:p.direction,isVirtual:!0})};const g=m.items.find(y=>y.id===s.panelId),h=m.items.reduce((y,S)=>y.add(C(S)?S.currentValue.value:S.size.value),new I(0)),b=g&&C(g)&&!g.currentValue.value.eq(g.collapsedSize.value);return h.gt(R(l))||!b}};function c(s){switch(r.current){case"dragging":o.commit(),l.activeDragHandleId=void 0;break}let f=!1;switch(s){case"idle":o.onAutosave();break;case"dragging":o.prepare();break;case"togglingCollapse":if(o.prepare(),o.clearLastKnownSize(),n){const m=n();if(m){const d=oe(l);l.orientation==="horizontal"?m.style.gridTemplateColumns=d:m.style.gridTemplateRows=d,f=!0}}break}return r.current=s,f||t==null||t(l),f}function w(s){var m;let f=!1;switch(s.type){case"lockGroup":i=!0;break;case"unlockGroup":i=!1;break}if(!i){switch(s.type){case"updateItemIndex":l.items=Ve(l.items.map(d=>d.id===s.itemId?{...d,order:s.index}:d));break;case"registerPanel":l.items=fe(l.items,{type:"panel",currentValue:$(-1),...s.data});break;case"unregisterPanel":o.prepare(),o.removeItem(s.id),o.clearLastKnownSize(),o.commit(),o.onResize(),o.onAutosave();break;case"registerPanelHandle":{l.items=fe(l.items,s.data);break}case"unregisterPanelHandle":o.prepare(),o.removeItem(s.id),o.clearLastKnownSize(),o.commit(),o.onResize(),o.onAutosave();break;case"registerDynamicPanel":{o.prepare();let d=$(0);s.data.collapsible&&s.data.collapsed&&s.data.collapsedSize?d={type:"pixel",value:x(l,s.data.collapsedSize)}:s.data.default?d={type:"pixel",value:x(l,s.data.default)}:d={type:"pixel",value:x(l,s.data.min)};const p=fe(l.items,{type:"panel",...s.data,currentValue:d}),g=p.findIndex(y=>y.id===s.data.id),h={...l},b=l.items.reduce((y,S)=>D(S)?y.add(x(l,S.size)):y.add(S.currentValue.value),new I(0)).minus(R(l));he(h,p,g,d.value.add(b).neg()),l.items=p,o.clearLastKnownSize(),o.commit(),o.onResize(),o.onAutosave();break}case"rebindPanelCallbacks":for(const d of l.items)C(d)&&d.id===s.data.id&&(d.onCollapseChange=s.data.onCollapseChange,d.onResize=s.data.onResize);break;case"updateConstraints":o.prepare();for(const d of l.items)if(C(d)&&d.id===s.data.id){const p=s.data;d.min=p.min,d.max=p.max,d.default=p.default,d.collapsedSize=p.collapsedSize,d.isStaticAtRest=p.isStaticAtRest,d.collapseAnimation=p.collapseAnimation,d.collapsible=p.collapsible}else if(D(d)&&d.id===s.data.id){const p=s.data;d.size=p.size}o.clearLastKnownSize(),o.commit(),o.onResize(),o.onAutosave();break;case"setActualItemsSize":{if(r.current==="togglingCollapse"&&n){f=!0;break}const d=l.items.map(h=>{if(!C(h))return h;const b=s.childrenSizes[h.id]||h.lastKnownSize;return{...h,lastKnownSize:b}});let p=0,g=!1;for(const h of d)if(C(h)){const b=(m=h.lastKnownSize)==null?void 0:m[l.orientation==="horizontal"?"width":"height"];if(!b){l.items=d,g=!0;break}p+=b}else p+=h.size.value.toNumber();g?l.items=d:p>R(l)&&r.current==="idle"?l.items=it({...l,items:K({...l,items:d})}).items:l.items=d,o.onResize();break}case"setSize":{l.size=s.size,o.onResize();break}case"setOrientation":l.orientation=s.orientation,o.clearLastKnownSize(),o.onResize();break}if(r.current==="idle")switch(s.type){case"dragHandleStart":c("dragging"),l.activeDragHandleId=s.handleId;break;case"setPanelPixelSize":{o.prepare(),o.clearLastKnownSize();const d=E(l,s.panelId),p=ie(l,s.panelId),g=d.currentValue.value,h=H(l,d,x(l,T(s.size))),b=h.gt(g),y=b?h.minus(g):g.minus(h);d.sizeBeforeCollapse=h.toNumber(),Object.assign(l,se({context:l,panelId:s.panelId,direction:p.direction*(b?1:-1),handleId:p.item.id,delta:y})),o.commit(),o.onResize(),o.onAutosave();break}case"collapsePanel":u.shouldNotifyCollapseToggle(s)?o.notifyCollapseToggle(s):E(l,s.panelId).collapsed||(c("togglingCollapse")&&(f=!0),a.abort(),ye(l,s,w,a).then(p=>{o.onAnimationEnd(p),c("idle"),s.resolve&&requestAnimationFrame(s.resolve)}));break;case"expandPanel":if(u.cannotExpandPanel(s))break;u.shouldNotifyCollapseToggle(s)?o.notifyCollapseToggle(s):E(l,s.panelId).collapsed&&(c("togglingCollapse")&&(f=!0),a.abort(),ye(l,s,w,a).then(p=>{o.onAnimationEnd(p),c("idle"),s.resolve&&requestAnimationFrame(s.resolve)}));break}else if(r.current==="dragging")switch(s.type){case"dragHandle":o.clearLastKnownSize(),le(l,re(l,s)),o.onResize();break;case"dragHandleEnd":c("idle");break;case"expandPanel":case"collapsePanel":u.shouldCollapseToggle(s)&&o.runCollapseToggle(s);break}else if(r.current==="togglingCollapse")switch(s.type){case"applyDelta":if(le(l,re(l,{panelId:s.panelId,handleId:s.handleId,type:"collapsePanel",disregardCollapseBuffer:!0,value:me({delta:s.delta,orientation:l.orientation})})),o.onResize(),n){const d=n();if(d){const p=oe(l);l.orientation==="horizontal"?d.style.gridTemplateColumns=p:d.style.gridTemplateRows=p,f=!0}}break}f||t==null||t(l)}}return[l,w,r]}function ct({groupId:e,id:t,collapsible:n,collapsed:a}){const r={id:t,"data-splitter-group-id":e,"data-splitter-type":"panel","data-splitter-id":t};return n&&(r["data-collapsed"]=a),r}function dt({groupId:e,id:t,orientation:n,isDragging:a,activeDragHandleId:r,disabled:i,controlsId:l,min:o,max:u,currentValue:c,groupSize:w}){return{id:t,role:"separator","data-splitter-type":"handle","data-splitter-id":t,"data-splitter-group-id":e,"data-handle-orientation":n,"data-state":a?"dragging":r?"inactive":"idle","aria-label":"Resize Handle","aria-disabled":i,"aria-controls":l,"aria-valuemin":o?X(w,o):void 0,"aria-valuemax":u==="1fr"?100:u?X(w,u):void 0,"aria-valuenow":c?X(w,c):void 0}}function ft(e,t){const n=new ResizeObserver(r=>{const i={};for(const l of r){const u=l.target.getAttribute("data-splitter-id"),c=l.borderBoxSize[0];u&&c&&(i[u]={width:c.inlineSize,height:c.blockSize})}t(i)}),a=document.querySelectorAll(`[data-splitter-group-id="${e}"]`);for(const r of a)n.observe(r);return()=>{n.disconnect()}}function pt(e){const{onMoveStart:t,onMove:n,onMoveEnd:a}=e,r={didMove:!1,lastPosition:null,id:null},i=(f,m,d,p)=>{d===0&&p===0||(r.didMove||(r.didMove=!0,t==null||t({type:"movestart",pointerType:m,shiftKey:f.shiftKey,metaKey:f.metaKey,ctrlKey:f.ctrlKey,altKey:f.altKey})),n==null||n({type:"move",pointerType:m,deltaX:d,deltaY:p,shiftKey:f.shiftKey,metaKey:f.metaKey,ctrlKey:f.ctrlKey,altKey:f.altKey}))},l=(f,m)=>{r.didMove&&(a==null||a({type:"moveend",pointerType:m,shiftKey:f.shiftKey,metaKey:f.metaKey,ctrlKey:f.ctrlKey,altKey:f.altKey}))},o={},u=()=>{r.didMove=!1},c=f=>{var m,d;if(f.pointerId===r.id){const p=f.pointerType||"mouse";i(f,p,f.pageX-(((m=r.lastPosition)==null?void 0:m.pageX)??0),f.pageY-(((d=r.lastPosition)==null?void 0:d.pageY)??0)),r.lastPosition={pageX:f.pageX,pageY:f.pageY}}},w=f=>{if(f.pointerId===r.id){const m=f.pointerType||"mouse";l(f,m),r.id=null,window.removeEventListener("pointermove",c,!1),window.removeEventListener("pointerup",w,!1),window.removeEventListener("pointercancel",w,!1)}};o.onPointerDown=f=>{f.button===0&&r.id==null&&(u(),f.stopPropagation(),f.preventDefault(),r.lastPosition={pageX:f.pageX,pageY:f.pageY},r.id=f.pointerId,window.addEventListener("pointermove",c,!1),window.addEventListener("pointerup",w,!1),window.addEventListener("pointercancel",w,!1))};const s=(f,m,d)=>{u(),i(f,"keyboard",m,d),l(f,"keyboard")};return o.onKeyDown=f=>{switch(f.key){case"Left":case"ArrowLeft":f.preventDefault(),f.stopPropagation(),s(f,-1,0);break;case"Right":case"ArrowRight":f.preventDefault(),f.stopPropagation(),s(f,1,0);break;case"Up":case"ArrowUp":f.preventDefault(),f.stopPropagation(),s(f,0,-1);break;case"Down":case"ArrowDown":f.preventDefault(),f.stopPropagation(),s(f,0,1);break}},{moveProps:o}}const mt=v.defineComponent({__name:"Panel",props:{onResize:{},collapsed:{type:Boolean,default:void 0},onCollapseChange:{},min:{},max:{},default:{},collapsible:{type:Boolean},defaultCollapsed:{type:Boolean},collapsedSize:{},isStaticAtRest:{type:Boolean},collapseAnimation:{},id:{}},setup(e,{expose:t}){const n=e,{min:a,max:r,id:i,collapsible:l,collapsedSize:o,onCollapseChange:u,collapseAnimation:c,onResize:w,defaultCollapsed:s,default:f,isStaticAtRest:m,collapsed:d,...p}=n,g=i||v.useId(),h=v.inject("send"),b=v.inject("state"),y=v.inject("isPrerender"),S=()=>Je({id:g,min:n.min,max:n.max,collapsible:n.collapsible,collapsed:n.collapsed,collapsedSize:n.collapsedSize,onCollapseChange:n.onCollapseChange?{current:n.onCollapseChange}:void 0,collapseAnimation:n.collapseAnimation,onResize:n.onResize?{current:n.onResize}:void 0,defaultCollapsed:s,default:f,isStaticAtRest:m}),V=v.computed(()=>{var A;const z=(A=b==null?void 0:b.value)==null?void 0:A.items.find(q=>q.id===g);if(!(!z||!C(z)))return z});let k=!1;V.value?h==null||h({type:"rebindPanelCallbacks",data:{id:g,onCollapseChange:n.onCollapseChange?{current:n.onCollapseChange}:void 0,onResize:n.onResize?{current:n.onResize}:void 0}}):y!=null&&y.value?h==null||h({type:"registerPanel",data:S()}):k=!0,v.onMounted(()=>{var ae;const z=(ae=b==null?void 0:b.value)==null?void 0:ae.groupId;if(!z||!k)return;const A=document.getElementById(z);if(!A)return;const q=document.getElementById(g);if(!q)return;const ne=Array.from(A.children).indexOf(q);typeof ne=="number"&&(h==null||h({type:"registerDynamicPanel",data:{...S(),order:ne}}),k=!1)});const O=v.computed(()=>!k&&Qe(S(),V.value));v.watchEffect(()=>{O.value&&(h==null||h({type:"updateConstraints",data:S()}))}),v.onUnmounted(()=>{requestAnimationFrame(()=>h==null?void 0:h({type:"unregisterPanel",id:g}))}),t({getId:()=>g,collapse:async()=>{var z;if((z=V.value)!=null&&z.collapsible)return await new Promise(A=>{h==null||h({type:"collapsePanel",panelId:g,controlled:!0,resolve:A})})},isCollapsed:()=>{var z,A;return!!((z=V.value)!=null&&z.collapsible&&((A=V.value)!=null&&A.collapsed))},expand:async()=>{var z;if((z=V.value)!=null&&z.collapsible)return await new Promise(A=>{h==null||h({type:"expandPanel",panelId:g,controlled:!0,resolve:A})})},isExpanded:()=>{var z,A;return!!((z=V.value)!=null&&z.collapsible&&!((A=V.value)!=null&&A.collapsed))},getPixelSize:()=>at(b.value,g),getPercentageSize:()=>lt(b.value,g),setSize:z=>h==null?void 0:h({type:"setPanelPixelSize",panelId:g,size:z})});const M=v.computed(()=>{var z;return(z=V.value)==null?void 0:z.collapseIsControlled});v.watchEffect(()=>{n.collapsed,requestAnimationFrame(()=>{M.value&&(n.collapsed?h==null||h({type:"collapsePanel",panelId:g,controlled:!0}):h==null||h({type:"expandPanel",panelId:g,controlled:!0}))})});const L=v.computed(()=>{var A;const z=V.value;return{...p,...ct({groupId:(A=b==null?void 0:b.value)==null?void 0:A.groupId,id:g,collapsible:z==null?void 0:z.collapsible,collapsed:z==null?void 0:z.collapsed}),style:{minWidth:0,minHeight:0,overflow:"hidden"}}});return(z,A)=>(v.openBlock(),v.createElementBlock("div",v.normalizeProps(v.guardReactiveProps(L.value)),[v.renderSlot(z.$slots,"default")],16))}}),ht=["id"],gt=v.defineComponent({__name:"PanelGroup",props:{snapshot:{},autosaveId:{},orientation:{default:"horizontal"},autosaveStrategy:{default:"localStorage"},shiftAmount:{},id:{}},setup(e,{expose:t}){const n=v.createPropsRestProxy(e,["orientation","autosaveStrategy","snapshot","autosaveId","id","shiftAmount"]);let a=e.snapshot;if(!a&&typeof window<"u"&&e.autosaveId&&e.autosaveStrategy==="localStorage"){const m=localStorage.getItem(e.autosaveId);m&&(a=JSON.parse(m))}const r=v.ref(!0);v.provide("isPrerender",r);const i=e.autosaveId||e.id||v.useId(),l=v.ref(null),[o,u,c]=ut({orientation:e.orientation,groupId:i,autosaveStrategy:e.autosaveStrategy,shiftAmount:e.shiftAmount,...a?Ge(a):void 0},m=>{w.value={...m}},()=>l.value);v.onMounted(()=>{r.value=!1});const w=v.ref(o),s=v.computed(()=>{const m=oe(w.value);return{height:"100%",display:"grid",gridTemplateColumns:e.orientation==="horizontal"?m:void 0,gridTemplateRows:e.orientation==="vertical"?m:void 0}});v.provide("send",u),v.provide("state",w),v.provide("id",c),v.onMounted(()=>{const m=new ResizeObserver(([d])=>{d&&d.contentRect.width>0&&d.contentRect.height>0&&(u==null||u({type:"setSize",size:d.contentRect}))});return l.value&&m.observe(l.value),()=>m.disconnect()});const f=v.computed(()=>{var m;return(m=w.value)==null?void 0:m.items.map(d=>d.id).join(",")});return v.onMounted(()=>{v.watchEffect(()=>{f.value;const m=ft(i,d=>{u({type:"setActualItemsSize",childrenSizes:d})});v.onWatcherCleanup(m)})}),v.onMounted(()=>(u({type:"unlockGroup"}),()=>u({type:"lockGroup"}))),t({getId:()=>i,getPixelSizes:()=>nt(w.value),getPercentageSizes:()=>rt(w.value),getTemplate:()=>oe({...w.value,items:K(w.value)}),getState:()=>c.current==="idle"?"idle":"dragging",setSizes:m=>{var d;for(let p=0;p<m.length;p++){const g=(d=w.value)==null?void 0:d.items[p],h=m[p];g&&C(g)&&h&&u({type:"setPanelPixelSize",panelId:g.id,size:h})}}}),(m,d)=>(v.openBlock(),v.createElementBlock("div",v.mergeProps(n,{id:v.unref(i),ref_key:"elementRef",ref:l,"data-panel-group-wrapper":"",style:s.value}),[v.renderSlot(m.$slots,"default")],16,ht))}}),vt=["tabindex"],wt=v.defineComponent({__name:"PanelResizer",props:{disabled:{type:Boolean},size:{default:"0px"},onDragStart:{type:Function},onDrag:{type:Function},onDragEnd:{type:Function},setSize:{type:Function},id:{}},setup(e){const t=v.createPropsRestProxy(e,["size","id","onDragStart","onDrag","onDragEnd","disabled"]),a=e.id||v.useId(),r=v.inject("send"),i=v.inject("state"),l=v.inject("isPrerender"),o=()=>_e({size:e.size,id:a}),u=v.computed(()=>{var p;const d=(p=i==null?void 0:i.value)==null?void 0:p.items.find(g=>g.id===a);if(!(!d||!D(d)))return d});let c=!1;u.value||(l!=null&&l.value?r==null||r({type:"registerPanelHandle",data:o()}):c=!0),v.onMounted(()=>{var b,y;if(!((b=i==null?void 0:i.value)==null?void 0:b.groupId)||!c)return;const p=document.getElementById((y=i==null?void 0:i.value)==null?void 0:y.groupId);if(!p)return;const g=document.getElementById(a);if(!g)return;const h=Array.from(p.children).indexOf(g);typeof h=="number"&&(r==null||r({type:"registerPanelHandle",data:{...o(),order:h}}),c=!1)});const w=v.computed(()=>!c&&Ze(o(),u.value));v.watchEffect(()=>{w.value&&(r==null||r({type:"updateConstraints",data:o()}))}),v.onUnmounted(()=>{requestAnimationFrame(()=>r==null?void 0:r({type:"unregisterPanelHandle",id:a}))});const{moveProps:s}=pt({onMoveStart:()=>{var d;r==null||r({type:"dragHandleStart",handleId:a}),(d=e.onDragStart)==null||d.call(e),i!=null&&i.value&&(document.body.style.cursor=ze(i==null?void 0:i.value)||"auto")},onMove:d=>{var p;r==null||r({type:"dragHandle",handleId:a,value:d}),(p=e.onDrag)==null||p.call(e)},onMoveEnd:()=>{var d;r==null||r({type:"dragHandleEnd",handleId:a}),(d=e.onDragEnd)==null||d.call(e),document.body.style.cursor="auto"}}),f=d=>{if(i!=null&&i.value)try{const p=et(i==null?void 0:i.value,a);d.key==="Enter"&&p&&(p.collapsed?r==null||r({type:"expandPanel",panelId:p.id}):r==null||r({type:"collapsePanel",panelId:p.id}))}catch{}},m=v.computed(()=>{var h,b,y,S,V,k,O,M,L;const d=(h=i==null?void 0:i.value)==null?void 0:h.items.findIndex(z=>z.id===a);if(!d)return{id:a};const p=(b=i==null?void 0:i.value)==null?void 0:b.items[d],g=(y=i==null?void 0:i.value)==null?void 0:y.items[d-1];return!g||!C(g)?{id:a}:{...t,...dt({groupId:(S=i==null?void 0:i.value)==null?void 0:S.groupId,id:a,orientation:((V=i==null?void 0:i.value)==null?void 0:V.orientation)||"horizontal",isDragging:((k=i==null?void 0:i.value)==null?void 0:k.activeDragHandleId)===a,activeDragHandleId:(O=i==null?void 0:i.value)==null?void 0:O.activeDragHandleId,disabled:e.disabled,controlsId:g.id,min:g.min,max:g.max,currentValue:g.currentValue,groupSize:R(i.value)}),onpointerdown:e.disabled?void 0:s.onPointerDown,onkeydown:e.disabled?void 0:z=>{s.onKeyDown(z),f(z)},style:{cursor:i!=null&&i.value?ze(i.value):void 0,width:((M=i==null?void 0:i.value)==null?void 0:M.orientation)==="horizontal"?`${p==null?void 0:p.size.value.toNumber()}px`:"100%",height:((L=i==null?void 0:i.value)==null?void 0:L.orientation)==="vertical"?`${p==null?void 0:p.size.value.toNumber()}px`:"100%"}}});return(d,p)=>(v.openBlock(),v.createElementBlock("div",v.mergeProps(m.value,{tabindex:d.disabled?-1:0}),[v.renderSlot(d.$slots,"default")],16,vt))}});exports.Panel=mt;exports.PanelGroup=gt;exports.PanelResizer=wt;
|
|
2
2
|
//# sourceMappingURL=index.js.map
|