@aiquants/resize-panels 0.2.0 → 0.3.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/dist/Panel.d.ts +1 -1
- package/dist/Panel.d.ts.map +1 -1
- package/dist/index.es.js +1230 -1230
- package/dist/index.umd.js +4 -4
- package/dist/types.d.ts +3 -2
- package/dist/types.d.ts.map +1 -1
- package/package.json +2 -2
package/dist/index.umd.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(ae,m){typeof exports=="object"&&typeof module<"u"?m(exports,require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","react-dom"],m):(ae=typeof globalThis<"u"?globalThis:ae||self,m(ae.AiquantsResizePanels={},ae.React,ae.ReactDOM))})(this,(function(ae,m,Wt){"use strict";const Ve=m.createContext(null),Be=()=>{const e=m.useContext(Ve);if(!e)throw new Error("usePanelGroup must be used within a PanelGroup");return e},rt=(e,t=0)=>{if(!Number.isFinite(e))return e;const n=10**t,o=e*n,i=Math.floor(o),s=o-i,a=Number.EPSILON*Math.max(1,Math.abs(o));return s<.5-a?i/n:s>.5+a?(i+1)/n:(i%2===0?i:i+1)/n},it=12,ot=8,Ut=8,Vt=8,st=.05,at=10,Yt=.05,Xt=20,Jt=.05,Ye=0,lt=0,ct=6,fe=(e,t)=>t<=0?0:rt(e/t*100,ct),Ie=(e,t)=>!e||t<=0?0:e/100*t,Ee=(e,t="percentage")=>{if(e!==void 0)return typeof e=="number"?{value:e,unit:t}:e},dt=(e,t)=>e?e.unit==="percentage"?e.value/100*t:e.value:0,oe=(e,t,n)=>e?typeof e=="number"?e/100*n:e.unit==="pixels"?e.value:e.value/100*n:t,pe=(e,t,n)=>Math.min(Math.max(e,t),n),Xe=e=>{if(!Number.isFinite(e)||e<=0)return lt;const t=e*st,n=Math.min(it,at,t);return Math.max(lt,n)},Je=(e,t,n)=>{if(Math.abs(t)<=0)return t;const o=e.map((l,c)=>({panel:l,index:c})).filter(({panel:l})=>!l.collapsed&&(l.sizeUnit==="pixels"||l.originalPixelSize!==void 0));if(o.length===0)return t;const i=[...o].sort((l,c)=>{const P=l.panel.pixelAdjustPriority??l.index+1,z=c.panel.pixelAdjustPriority??c.index+1;return P===z?l.index-c.index:P-z});let s=t;return(()=>{for(const{index:l}of i){if(Math.abs(s)<=0)break;const c=e[l];if(!c||c.collapsed)continue;const P=Ee(c.minSize,"pixels"),z=Ee(c.maxSize,"pixels"),d=P?dt(P,n):0,u=z?dt(z,n):n;if(s>0){if(Math.abs(c.size)<=0&&(c.percentageSize??0)<=0)continue;const C=Math.max(0,u-c.size);if(C<=0)continue;const k=Math.min(C,s);if(k<=0)continue;const w=c.size+k,p=fe(w,n),g=c.collapsible?w:c.sizeBeforeCollapse,_=c.collapsible?c.measuredPixelSizeBeforeCollapse??c.measuredPixelSize??w:c.measuredPixelSizeBeforeCollapse;e[l]={...c,size:w,percentageSize:p,originalPixelSize:c.originalPixelSize!==void 0?c.originalPixelSize:w,sizeBeforeCollapse:g,measuredPixelSizeBeforeCollapse:_},s-=k}else{const x=Math.max(0,c.size-d);if(x<=0)continue;const C=Math.min(x,Math.abs(s));if(C<=0)continue;const k=c.size-C,w=fe(k,n),p=c.collapsible?k:c.sizeBeforeCollapse,g=c.collapsible?c.measuredPixelSizeBeforeCollapse??c.measuredPixelSize??k:c.measuredPixelSizeBeforeCollapse;e[l]={...c,size:k,percentageSize:w,originalPixelSize:c.originalPixelSize!==void 0?c.originalPixelSize:k,sizeBeforeCollapse:p,measuredPixelSizeBeforeCollapse:g},s+=C}}})(),s},Le=e=>{if(!e)return 0;const t=parseFloat(e);return Number.isFinite(t)?t:0},be=(e,t)=>{const n=e.getBoundingClientRect(),o=typeof window<"u"?window.getComputedStyle(e):null,i=o?Le(o.borderLeftWidth)+Le(o.borderRightWidth):0,s=o?Le(o.borderTopWidth)+Le(o.borderBottomWidth):0;if(t==="horizontal"){const P=n.width>0?n.width:e.offsetWidth,z=n.width>0?Math.max(0,n.width-i):e.clientWidth,d=e.offsetWidth>0?e.offsetWidth:e.clientWidth+i;return{inner:z>0?z:Math.max(0,e.clientWidth),outer:P>0?P:Math.max(0,d)}}const a=n.height>0?n.height:e.offsetHeight,l=n.height>0?Math.max(0,n.height-s):e.clientHeight,c=e.offsetHeight>0?e.offsetHeight:e.clientHeight+s;return{inner:l>0?l:Math.max(0,e.clientHeight),outer:a>0?a:Math.max(0,c)}};let ut=0,ft=0;const pt=()=>typeof window>"u"?(ut+=1,`panel-server-${ut}`):`panel-${Date.now()}-${Math.random().toString(36).substr(2,5)}`,Zt=()=>typeof window>"u"?(ft+=1,`resize-handle-server-${ft}`):`resize-handle-${Date.now()}-${Math.random().toString(36).substr(2,5)}`,mt=(e,t)=>{try{localStorage.setItem(`panel-layout-${e}`,JSON.stringify(t))}catch(n){console.warn("Failed to save panel layout:",n)}},gt=e=>{try{const t=localStorage.getItem(`panel-layout-${e}`);return t?JSON.parse(t):null}catch(t){return console.warn("Failed to load panel layout:",t),null}},Ze=(e,t)=>{const n=e.map(u=>{if(u.collapsed)return{...u,size:0,percentageSize:0};if(u.sizeUnit==="pixels"||u.originalPixelSize!==void 0){const x=oe(u.minSize,0,t),C=oe(u.maxSize,t,t),k=pe(u.size,x,C);let w=k,p=Math.abs(k-u.size)>Ye,g=u.size;if(u.originalPixelSize!==void 0&&Math.abs(u.size-u.originalPixelSize)<=Ye&&(g=u.originalPixelSize),g!==void 0){const _=pe(g,x,C);_>w+Ye&&(w=_,p=!0)}if(p){const _=fe(w,t),H=u.collapsible?w:u.sizeBeforeCollapse,X=u.collapsible?u.measuredPixelSizeBeforeCollapse??u.measuredPixelSize??w:u.measuredPixelSizeBeforeCollapse;return{...u,size:w,percentageSize:_,sizeBeforeCollapse:H,measuredPixelSizeBeforeCollapse:X}}}if(u.sizeUnit==="percentage"&&(!u.percentageSize||u.percentageSize<=0)&&u.size>0){const x=fe(u.size,t);return{...u,percentageSize:x}}return u}),o=n.reduce((u,x)=>x.collapsed?u:x.sizeUnit==="pixels"||x.originalPixelSize!==void 0?u+x.size:u,0),i=()=>{const u=n.map((p,g)=>({panel:p,index:g})).filter(({panel:p})=>!p.collapsed&&(p.sizeUnit==="pixels"||p.originalPixelSize!==void 0));if(u.length===0)return n;const x=u.reduce((p,{panel:g})=>p+g.size,0),C=t-x;if(Math.abs(C)<=.1)return n;const k=[...u].sort((p,g)=>{const _=p.panel.pixelAdjustPriority??p.index+1,H=g.panel.pixelAdjustPriority??g.index+1;return _===H?p.index-g.index:_-H});let w=C;for(const{panel:p,index:g}of k){if(Math.abs(w)<=.1)break;const _=oe(p.minSize,0,t),H=oe(p.maxSize,t,t),X=p.size;if(w>0){const A=Math.max(0,H-X);if(A<=0)continue;const te=Math.min(A,w),R=X+te,U=fe(R,t),V=p.collapsible?R:p.sizeBeforeCollapse,K=p.collapsible?p.measuredPixelSizeBeforeCollapse??p.measuredPixelSize??R:p.measuredPixelSizeBeforeCollapse;n[g]={...p,size:R,percentageSize:U,sizeBeforeCollapse:V,measuredPixelSizeBeforeCollapse:K},w-=te}else{const A=Math.max(0,X-_);if(A<=0)continue;const te=Math.min(A,Math.abs(w)),R=X-te,U=fe(R,t),V=p.collapsible?R:p.sizeBeforeCollapse,K=p.collapsible?p.measuredPixelSizeBeforeCollapse??p.measuredPixelSize??R:p.measuredPixelSizeBeforeCollapse;n[g]={...p,size:R,percentageSize:U,sizeBeforeCollapse:V,measuredPixelSizeBeforeCollapse:K},w+=te}}return n},s=n.reduce((u,x,C)=>(!x.collapsed&&x.sizeUnit==="percentage"&&x.originalPixelSize===void 0&&u.push(C),u),[]);if(s.length===0)return i();const a=Math.max(0,t-o),l=s.map(u=>{const x=n[u];return x.percentageSize!==void 0&&x.percentageSize>0?Ie(x.percentageSize,t):x.size>0?x.size:0}),c=l.reduce((u,x)=>x>0?u+x:u,0);if(c<=0)return i();const P=[...n];let z=0;s.forEach((u,x)=>{const C=P[u],k=l[x];let w;if(k>0){const A=k/c;w=a*A}else w=C.size;const p=oe(C.minSize,0,t),g=oe(C.maxSize,t,t);w=pe(w,p,g),z+=w;const _=fe(w,t),H=C.collapsible?w:C.sizeBeforeCollapse,X=C.collapsible?C.measuredPixelSizeBeforeCollapse??C.measuredPixelSize??w:C.measuredPixelSizeBeforeCollapse;P[u]={...C,size:w,percentageSize:_,sizeBeforeCollapse:H,measuredPixelSizeBeforeCollapse:X}});const d=a-z;return Math.abs(d)>.1&&Je(P,d,t),we(P)},we=e=>{let t=0;for(const i of e)i.collapsed||(t+=Math.max(i.size,0));if(t<=0){let i=!1;const s=e.map(a=>(a.percentageSize??0)!==0?(i=!0,{...a,percentageSize:0,measuredPercentageSize:a.measuredPercentageSize!==void 0?0:a.measuredPercentageSize}):!a.collapsed&&a.sizeBeforeCollapse!==a.size?(i=!0,{...a,sizeBeforeCollapse:a.size}):a);return i?s:e}let n=!1;const o=e.map(i=>{if(i.collapsed)return(i.percentageSize??0)!==0?(n=!0,{...i,percentageSize:0,measuredPercentageSize:i.measuredPercentageSize!==void 0?0:i.measuredPercentageSize}):i;const s=fe(i.size,t),a=i.measuredPercentageSize,P=(a!==void 0?Math.abs(a-s):1/0)<1e-4&&a!==void 0?a:s,z=rt(P,ct),u=Math.abs((i.percentageSize??0)-z)>0||i.percentageSize===void 0,x=i.sizeBeforeCollapse===void 0||i.sizeBeforeCollapse!==i.size,C=i.collapsible&&x,k=i.measuredPixelSize??i.size,w=i.collapsible&&(i.measuredPixelSizeBeforeCollapse===void 0||i.measuredPixelSizeBeforeCollapse!==k);if(!(u||C||w))return i;n=!0;const p=C?i.size:i.sizeBeforeCollapse,g=w?k:i.measuredPixelSizeBeforeCollapse;return{...i,percentageSize:z,sizeBeforeCollapse:p,measuredPixelSizeBeforeCollapse:g}});return n?o:e},De=(e,t)=>{if(t<=0)return!1;const n=[];let o=0;for(let z=0;z<e.length;z+=1){const d=e[z];!d||d.collapsed||(n.push(z),o+=d.size)}if(n.length===0)return!1;let i=t-o;if(Math.abs(i)<=0)return!1;let s=!1;const a=z=>{const d=e[z],u=oe(d.minSize,0,t),x=oe(d.maxSize,t,t),C=d.sizeUnit==="percentage"&&d.originalPixelSize===void 0;return{index:z,minSize:u,maxSize:x,isFlexible:C}},l=(z,d)=>{if(!Number.isFinite(d)||Math.abs(d)<=0)return;const u=e[z];if(!u)return;const x=Math.max(0,u.size+d);if(Math.abs(x-u.size)<=0)return;const C=fe(x,t),k=u.collapsible?x:u.sizeBeforeCollapse,w=u.collapsible?u.measuredPixelSizeBeforeCollapse??u.measuredPixelSize??x:u.measuredPixelSizeBeforeCollapse;e[z]={...u,size:x,percentageSize:C,sizeBeforeCollapse:k,measuredPixelSizeBeforeCollapse:w,measuredPixelSize:void 0,measuredPercentageSize:void 0},i-=d,s=!0},c=z=>{for(const d of z){if(Math.abs(i)<=0)break;const u=e[d.index];if(!u||u.collapsed)continue;const x=u.size;if(i>0){const C=Math.max(0,d.maxSize-x);if(C<=0)continue;const k=Math.min(C,i);if(k<=0)continue;l(d.index,k)}else{const C=Math.max(0,x-d.minSize);if(C<=0)continue;const k=Math.min(C,Math.abs(i));if(k<=0)continue;l(d.index,-k)}}},P=n.map(z=>a(z)).filter(z=>z.isFlexible);if(P.length>0&&c(P),Math.abs(i)>0){const z=i;i=Je(e,i,t),Math.abs(i-z)>0&&(s=!0)}return s},ht=(e,t,n)=>{if(!(e.sizeUnit==="pixels"||e.originalPixelSize!==void 0)||e.pixelAdjustPriority!==void 0)return e;const i=t.filter((a,l)=>l!==n&&(a.sizeUnit==="pixels"||a.originalPixelSize!==void 0)).map(a=>a.pixelAdjustPriority).filter(a=>a!==void 0),s=i.length>0?Math.max(...i)+1:1;return{...e,pixelAdjustPriority:s}},Qt=(e,t)=>{switch(t.type){case"REGISTER_PANEL":{console.log("REGISTER_PANEL",t.panel);const n=e.findIndex(s=>s.id===t.panel.id);if(n>=0){const s=[...e],a=e[n],l={...a,minSize:t.panel.minSize,maxSize:t.panel.maxSize,collapsible:t.panel.collapsible,sizeUnit:t.panel.sizeUnit,originalPixelSize:t.panel.originalPixelSize,pixelAdjustPriority:t.panel.pixelAdjustPriority!==void 0?t.panel.pixelAdjustPriority:a.pixelAdjustPriority},c=ht(l,e,n);return s[n]=c,s}const o={...t.panel},i=ht(o,e);return[...e,i]}case"UNREGISTER_PANEL":{console.log("UNREGISTER_PANEL",t.id);const n=e.filter(o=>o.id!==t.id);return we(n)}case"RESIZE_PANELS":{console.log("RESIZE_PANELS",t.leftId,t.rightId,t.leftSize,t.rightSize);const n=e.findIndex(N=>N.id===t.leftId),o=e.findIndex(N=>N.id===t.rightId);if(n===-1||o===-1)return e;const i=[...e],s=i[n],a=i[o];if(s.collapsed||a.collapsed||t.leftSize===s.size&&t.rightSize===a.size)return e;const l=t.containerSize??e.reduce((N,G)=>N+G.size,0),c=oe(s.minSize,0,l),P=oe(s.maxSize,l,l),z=oe(a.minSize,0,l),d=oe(a.maxSize,l,l),u=s.size+a.size,x=e.reduce((N,G)=>G.collapsed?N:N+G.size,0),C=x-u,k=c+z,w=P+d,p=pe(t.leftSize+t.rightSize,k,w);let g=l>0?l-C:p;Number.isFinite(g)||(g=p);const _=pe(Math.max(p,g),k,w),H=N=>({min:Math.max(c,N-d),max:Math.min(P,N-z)}),X=N=>({min:Math.max(z,N-P),max:Math.min(d,N-c)}),A=Math.abs(t.leftSize-s.size),te=Math.abs(t.rightSize-a.size),R=A>=te;let U=s.size,V=a.size;if(R){const N=H(_);if(N.min>N.max)return e;const G=pe(t.leftSize,N.min,N.max),E=_-G;if(E<z||E>d)return e;U=G,V=E}else{const N=X(_);if(N.min>N.max)return e;const G=pe(t.rightSize,N.min,N.max),E=_-G;if(E<c||E>P)return e;V=G,U=E}const K=U+V;if(_!==K)return e;const ne=x-s.size-a.size+K,J=l>0?l:ne,q=J>0?fe(U,J):0,W=J>0?fe(V,J):0;return i[n]={...s,size:U,percentageSize:q,sizeBeforeCollapse:s.collapsible?U:s.sizeBeforeCollapse,measuredPixelSize:void 0,measuredPercentageSize:void 0},i[o]={...a,size:V,percentageSize:W,sizeBeforeCollapse:a.collapsible?V:a.sizeBeforeCollapse,measuredPixelSize:void 0,measuredPercentageSize:void 0},l>0&&De(i,l)?we(i):i}case"SET_PANELS":return console.log("SET_PANELS",t.panels),we(t.panels);case"CONTAINER_RESIZED":{console.log("CONTAINER_RESIZED",t.containerSize);const n=Ze(e,t.containerSize);return t.containerSize>0&&De(n,t.containerSize)?we(n):n}case"COLLAPSE_PANEL":{console.log("COLLAPSE_PANEL",t.id);const n=e.findIndex(P=>P.id===t.id);if(n===-1)return e;const o=e[n];if(!o.collapsible||o.collapsed)return e;const i=o.size,s=o.measuredPixelSize??i,a={...o,collapsed:!0,sizeBeforeCollapse:i,measuredPixelSizeBeforeCollapse:s,size:0,percentageSize:0,measuredPixelSize:o.measuredPixelSize!==void 0?0:o.measuredPixelSize,measuredPercentageSize:o.measuredPercentageSize!==void 0?0:o.measuredPercentageSize},l=[...e];l[n]=a;const c=Ze(l,t.containerSize);return t.containerSize>0&&De(c,t.containerSize)?we(c):c}case"EXPAND_PANEL":{console.log("EXPAND_PANEL",t.id,t.targetSize);const n=e.findIndex(w=>w.id===t.id);if(n===-1)return e;const o=t.containerSize,i=e[n];if(!(i.collapsible&&i.collapsed))return e;const a=[t.targetSize,i.sizeBeforeCollapse,i.measuredPixelSizeBeforeCollapse,i.originalPixelSize].find(w=>w!==void 0)??0,l=oe(i.minSize,0,o),c=oe(i.maxSize,o,o),P=pe(a,l,c),z=fe(P,o),d=i.measuredPixelSizeBeforeCollapse??P,u=fe(d,o),x={...i,collapsed:!1,size:P,percentageSize:z,sizeBeforeCollapse:P,measuredPixelSize:P,measuredPixelSizeBeforeCollapse:d,measuredPercentageSize:u},C=[...e];C[n]=x;const k=Ze(C,o);return o>0&&De(k,o)?we(k):k}default:return e}},xt=({direction:e,style:t,onLayout:n,autoSaveId:o,showDebugInfo:i=!1})=>{const[s,a]=m.useReducer(Qt,[]),[l,c]=m.useState({width:0,height:0}),[P,z]=m.useState(!1),[d,u]=m.useState(!1),[x,C]=m.useState(null),[k,w]=m.useState({}),[p,g]=m.useState({}),_=m.useRef(null),H=m.useRef(n),X=m.useRef(!1),A=m.useRef(0),te=m.useRef(l);m.useLayoutEffect(()=>{if(!_.current)return;const I=new ResizeObserver(r=>{for(const S of r){const M=S.target,T=M?be(M,"horizontal"):null,Y=M?be(M,"vertical"):null,y=T?T.inner:0,b=Y?Y.inner:0,h=S.contentRect.width,v=S.contentRect.height,L=y>0?y:h,B=b>0?b:v;c(F=>(!P&&L>0&&B>0&&z(!0),F.width===L&&F.height===B?F:{width:L,height:B}))}});return I.observe(_.current),()=>I.disconnect()},[P]),m.useLayoutEffect(()=>{const I=te.current,r=l,S=e==="horizontal"?Math.abs(I.width-r.width)>0:Math.abs(I.height-r.height)>0;if(d&&S){const M=e==="horizontal"?r.width:r.height;a({type:"CONTAINER_RESIZED",containerSize:M,direction:e})}te.current=r},[l,d,e]);const R=m.useCallback(()=>{console.log("panels[0]?.id",s[0]?.id);const I=s.some(f=>{if(f.collapsed||f.sizeUnit!=="percentage")return!1;const Z=f.collapsible?f.sizeBeforeCollapse??f.measuredPixelSizeBeforeCollapse??f.originalPixelSize??f.measuredPixelSize??0:f.measuredPixelSize??f.originalPixelSize??f.size,ce=f.percentageSize!==void 0&&f.percentageSize>0;return f.size<=0&&(Z>0||ce)}),r=e==="horizontal"?l.width:l.height,S=r>0;if(x||!S||!(s.length>0&&(s.length!==A.current||!d||I)))return;const Y=s.filter(f=>!f.collapsed&&(f.originalPixelSize!==void 0||f.sizeUnit==="pixels")).reduce((f,Z)=>Z.originalPixelSize!==void 0?f+Z.originalPixelSize:f+Z.size,0),y=s.filter(f=>f.sizeUnit==="percentage"&&!f.collapsed),b=y.map(f=>f.id),h=y.map(f=>f.percentageSize!==void 0&&f.percentageSize>0?Ie(f.percentageSize,r):f.size>0?f.size:0),v=h.reduce((f,Z)=>f+Z,0),L=r-Y,B=Math.max(0,L),F=B>0,re=s.map(f=>{if(f.collapsed){const Z=f.sizeBeforeCollapse??f.measuredPixelSizeBeforeCollapse??f.originalPixelSize??(f.sizeUnit==="pixels"?f.size:void 0),ce=f.sizeUnit==="percentage"&&f.percentageSize!==void 0?Ie(f.percentageSize,r):void 0,se=Z??ce??0,ue=f.measuredPixelSizeBeforeCollapse??f.measuredPixelSize??se;return{...f,size:0,percentageSize:0,sizeBeforeCollapse:se,measuredPixelSizeBeforeCollapse:ue}}if(f.sizeUnit==="pixels"||f.originalPixelSize!==void 0){const Z=f.size,ce=r>0?fe(Z,r):0,se={...f,size:Z,percentageSize:ce};if(f.collapsible){const ue=f.sizeBeforeCollapse??Z,he=f.measuredPixelSizeBeforeCollapse??f.measuredPixelSize??ue;se.sizeBeforeCollapse=ue,se.measuredPixelSizeBeforeCollapse=he}return se}if(f.sizeUnit==="percentage"){const Z=b.indexOf(f.id),ce=Z!==-1?h[Z]:0,se=oe(f.minSize,0,r),ue=oe(f.maxSize,r,r),he=Math.max(se,f.sizeBeforeCollapse??0,f.measuredPixelSizeBeforeCollapse??0,f.measuredPixelSize??0,f.originalPixelSize??0,f.size>0?f.size:0,f.percentageSize!==void 0?Ie(f.percentageSize,r):0,1),ge=ce>0?ce:he;let me;if(!F)me=se;else if(Z!==-1&&v>0){const Se=ge/v,ve=B*Se;me=pe(ve,se,ue)}else{const Se=f.percentageSize!==void 0?Ie(f.percentageSize,r):f.size,ve=Se>0?Se:ge;me=pe(ve,se,ue)}const xe=r>0?fe(me,r):0,ke={...f,size:me,percentageSize:xe};if(f.collapsible){const Se=f.sizeBeforeCollapse??me,ve=f.measuredPixelSizeBeforeCollapse??f.measuredPixelSize??Se;ke.sizeBeforeCollapse=Se,ke.measuredPixelSizeBeforeCollapse=ve}return ke}return f}),ee=[];for(let f=0;f<re.length;f+=1){const Z=re[f];Z.sizeUnit==="percentage"&&!Z.collapsed&&ee.push(f)}const $=ee.reduce((f,Z)=>f+re[Z].size,0),le=L-$;Math.abs(le)>0&&Je(re,le,r),a({type:"SET_PANELS",panels:re}),A.current=s.length,u(!0)},[s,e,l.width,l.height,d,x]);m.useEffect(()=>{const I=e==="horizontal"?l.width:l.height,r=I>0,S=r&&s.length>0,M=S?s.reduce((v,L)=>{if(L.collapsed)return v;const B=oe(L.minSize,0,I);return v+Math.max(0,B)},0):null,T=S?s.reduce((v,L)=>{if(L.collapsed)return v;const B=oe(L.maxSize,I,I);return v+Math.max(0,B)},0):null,Y=M??x?.totalMinimumSize??null,y=T??x?.totalMaximumSize??null;if(!r){x&&C(v=>!v||v.availableContainerSize===I?v:{reason:v.reason,totalMinimumSize:null,totalMaximumSize:null,availableContainerSize:I});return}const b=Y!==null&&Y-I>Number.EPSILON,h=y!==null&&I-y>Number.EPSILON;if(b||h){const L={reason:b?"minimum-exceeded":"maximum-insufficient",totalMinimumSize:Y,totalMaximumSize:y,availableContainerSize:I};C(B=>B&&B.reason===L.reason&&Math.abs((B.totalMinimumSize??0)-(L.totalMinimumSize??0))<=Number.EPSILON&&Math.abs((B.totalMaximumSize??0)-(L.totalMaximumSize??0))<=Number.EPSILON&&Math.abs(B.availableContainerSize-L.availableContainerSize)<=Number.EPSILON?B:L);return}if(x){const v=x.reason==="minimum-exceeded",L=x.reason==="maximum-insufficient";(!v||Y!==null)&&(!L||y!==null)&&!b&&!h&&C($=>$&&null)}},[s,e,l.width,l.height,x]),m.useEffect(()=>{R()},[R]),m.useEffect(()=>{H.current=n},[n]);const U=m.useMemo(()=>s.map(I=>I.size),[s]);m.useLayoutEffect(()=>{U.length>0&&H.current&&H.current(U)},[U]),m.useEffect(()=>{if(o&&U.length>0){const I=setTimeout(()=>{mt(o,U)},200);return()=>clearTimeout(I)}},[o,U]),m.useEffect(()=>{if(!o||s.length===0||X.current)return;const I=e==="horizontal"?l.width:l.height;if(I<=0)return;const r=gt(o);if(r&&r.length===s.length){const S=s.map((M,T)=>{const Y=oe(M.minSize,0,I),y=oe(M.maxSize,I,I),b=pe(r[T],Y,y),h=fe(b,I);return{...M,size:b,percentageSize:h}});a({type:"SET_PANELS",panels:S}),X.current=!0}},[o,s,l.width,l.height,e]);const V=m.useCallback(I=>{a({type:"REGISTER_PANEL",panel:I})},[]),K=m.useCallback(I=>{a({type:"UNREGISTER_PANEL",id:I}),w(r=>{if(!(I in r))return r;const S={...r};return delete S[I],S})},[]),ne=m.useCallback((I,r,S,M)=>{const T=e==="horizontal"?l.width:l.height,Y=s.find($=>$.id===I),y=s.find($=>$.id===r);if(!(Y&&y)){a({type:"RESIZE_PANELS",leftId:I,rightId:r,leftSize:S,rightSize:M,containerSize:T});return}if(Y.collapsed||y.collapsed)return;const b=oe(Y.minSize,0,T),h=oe(Y.maxSize,T,T),v=oe(y.minSize,0,T),L=oe(y.maxSize,T,T);let B=pe(S,b,h),F=pe(M,v,L);const re=B+F,ee=S+M;if(re!==ee){const $=ee-re;if($>0){const le=h-B,f=L-F,Z=le+f;if(Z>0){const ce=Math.min($*(le/Z),le),se=Math.min($-ce,f);B+=ce,F+=se}}else if($<0){const le=Math.abs($),f=B-b,Z=F-v,ce=f+Z;if(ce>0){const se=Math.min(le*(f/ce),f),ue=Math.min(le-se,Z);B-=se,F-=ue}}}B=pe(B,b,h),F=pe(F,v,L),console.assert(B+F===ee,"Total size after constraints should be close to the original total size.",{constrainedLeftSize:B,constrainedRightSize:F,originalTotalSize:ee}),a({type:"RESIZE_PANELS",leftId:I,rightId:r,leftSize:B,rightSize:F,containerSize:T})},[e,l.width,l.height,s]),J=m.useCallback(I=>{const r=e==="horizontal"?l.width:l.height;a({type:"COLLAPSE_PANEL",id:I,containerSize:r})},[e,l.width,l.height]),q=m.useCallback((I,r)=>{const S=e==="horizontal"?l.width:l.height;a({type:"EXPAND_PANEL",id:I,containerSize:S,targetSize:r})},[e,l.width,l.height]),W=m.useCallback(I=>s.find(r=>r.id===I),[s]),N=m.useCallback((I,r)=>{w(S=>{if(r===null){if(!(I in S))return S;const T={...S};return delete T[I],T}const M=S[I];return M&&M.pixelSize===r.pixelSize&&M.percentageSize===r.percentageSize?S:{...S,[I]:r}})},[]),G=m.useCallback((I,r)=>{g(S=>{if(r===null){if(!(I in S))return S;const T={...S};return delete T[I],T}const M=S[I];return M&&Math.abs(M.thickness-r.thickness)<=.25&&M.visible===r.visible&&M.direction===r.direction&&M.startPanelId===r.startPanelId&&M.endPanelId===r.endPanelId?S:{...S,[I]:r}})},[]),E=m.useMemo(()=>({direction:e,panels:s,containerSize:l,isContainerReady:P,showDebugInfo:i,registerPanel:V,unregisterPanel:K,resizePanels:ne,collapsePanel:J,expandPanel:q,getPanel:W,reportPanelMeasurement:N,panelMeasurements:k,reportHandleMeasurement:G,handleMeasurements:p,layoutConstraintViolation:x}),[e,s,l,P,i,V,K,ne,J,q,W,N,k,G,p,x]),ie=m.useMemo(()=>({display:"flex",flexDirection:e==="horizontal"?"row":"column",alignItems:"stretch",width:"100%",height:"100%",minWidth:"0px",minHeight:"0px",position:"relative",overflow:"hidden",...t}),[e,t]);return{groupRef:_,contextValue:E,groupStyle:ie}},Kt=e=>{const{getPanel:t,collapsePanel:n,expandPanel:o}=Be(),i=t(e),s=m.useCallback(()=>{n(e)},[n,e]),a=m.useCallback(c=>{o(e,c)},[o,e]),l=m.useCallback(()=>{i?.collapsed?a():s()},[i?.collapsed,s,a]);return m.useMemo(()=>({panel:i,isCollapsed:i?.collapsed??!1,collapse:s,expand:a,toggle:l}),[i,s,a,l])};var Ge={exports:{}},Ae={};/**
|
|
1
|
+
(function(le,m){typeof exports=="object"&&typeof module<"u"?m(exports,require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","react-dom"],m):(le=typeof globalThis<"u"?globalThis:le||self,m(le.AiquantsResizePanels={},le.React,le.ReactDOM))})(this,(function(le,m,Wt){"use strict";const Ve=m.createContext(null),Be=()=>{const e=m.useContext(Ve);if(!e)throw new Error("usePanelGroup must be used within a PanelGroup");return e},rt=(e,t=0)=>{if(!Number.isFinite(e))return e;const n=10**t,o=e*n,i=Math.floor(o),s=o-i,a=Number.EPSILON*Math.max(1,Math.abs(o));return s<.5-a?i/n:s>.5+a?(i+1)/n:(i%2===0?i:i+1)/n},it=12,ot=8,Ut=8,Vt=8,st=.05,at=10,Yt=.05,Xt=20,Jt=.05,Ye=0,lt=0,ct=6,pe=(e,t)=>t<=0?0:rt(e/t*100,ct),Ie=(e,t)=>!e||t<=0?0:e/100*t,ke=(e,t="percentage")=>{if(e!==void 0)return typeof e=="number"?{value:e,unit:t}:e},dt=(e,t)=>e?e.unit==="percentage"?e.value/100*t:e.value:0,ie=(e,t,n)=>e?typeof e=="number"?e/100*n:e.unit==="pixels"?e.value:e.value/100*n:t,me=(e,t,n)=>Math.min(Math.max(e,t),n),Xe=e=>{if(!Number.isFinite(e)||e<=0)return lt;const t=e*st,n=Math.min(it,at,t);return Math.max(lt,n)},Je=(e,t,n)=>{if(Math.abs(t)<=0)return t;const o=e.map((l,c)=>({panel:l,index:c})).filter(({panel:l})=>!l.collapsed&&(l.sizeUnit==="pixels"||l.originalPixelSize!==void 0));if(o.length===0)return t;const i=[...o].sort((l,c)=>{const y=l.panel.pixelAdjustPriority??l.index+1,S=c.panel.pixelAdjustPriority??c.index+1;return y===S?l.index-c.index:y-S});let s=t;return(()=>{for(const{index:l}of i){if(Math.abs(s)<=0)break;const c=e[l];if(!c||c.collapsed)continue;const y=ke(c.minSize,"pixels"),S=ke(c.maxSize,"pixels"),f=y?dt(y,n):0,d=S?dt(S,n):n;if(s>0){if(Math.abs(c.size)<=0&&(c.percentageSize??0)<=0)continue;const w=Math.max(0,d-c.size);if(w<=0)continue;const C=Math.min(w,s);if(C<=0)continue;const k=c.size+C,p=pe(k,n),b=c.collapsible?k:c.sizeBeforeCollapse,E=c.collapsible?c.measuredPixelSizeBeforeCollapse??c.measuredPixelSize??k:c.measuredPixelSizeBeforeCollapse;e[l]={...c,size:k,percentageSize:p,originalPixelSize:c.originalPixelSize!==void 0?c.originalPixelSize:k,sizeBeforeCollapse:b,measuredPixelSizeBeforeCollapse:E},s-=C}else{const x=Math.max(0,c.size-f);if(x<=0)continue;const w=Math.min(x,Math.abs(s));if(w<=0)continue;const C=c.size-w,k=pe(C,n),p=c.collapsible?C:c.sizeBeforeCollapse,b=c.collapsible?c.measuredPixelSizeBeforeCollapse??c.measuredPixelSize??C:c.measuredPixelSizeBeforeCollapse;e[l]={...c,size:C,percentageSize:k,originalPixelSize:c.originalPixelSize!==void 0?c.originalPixelSize:C,sizeBeforeCollapse:p,measuredPixelSizeBeforeCollapse:b},s+=w}}})(),s},Le=e=>{if(!e)return 0;const t=parseFloat(e);return Number.isFinite(t)?t:0},be=(e,t)=>{const n=e.getBoundingClientRect(),o=typeof window<"u"?window.getComputedStyle(e):null,i=o?Le(o.borderLeftWidth)+Le(o.borderRightWidth):0,s=o?Le(o.borderTopWidth)+Le(o.borderBottomWidth):0;if(t==="horizontal"){const y=n.width>0?n.width:e.offsetWidth,S=n.width>0?Math.max(0,n.width-i):e.clientWidth,f=e.offsetWidth>0?e.offsetWidth:e.clientWidth+i;return{inner:S>0?S:Math.max(0,e.clientWidth),outer:y>0?y:Math.max(0,f)}}const a=n.height>0?n.height:e.offsetHeight,l=n.height>0?Math.max(0,n.height-s):e.clientHeight,c=e.offsetHeight>0?e.offsetHeight:e.clientHeight+s;return{inner:l>0?l:Math.max(0,e.clientHeight),outer:a>0?a:Math.max(0,c)}};let ut=0,ft=0;const pt=()=>typeof window>"u"?(ut+=1,`panel-server-${ut}`):`panel-${Date.now()}-${Math.random().toString(36).substr(2,5)}`,Zt=()=>typeof window>"u"?(ft+=1,`resize-handle-server-${ft}`):`resize-handle-${Date.now()}-${Math.random().toString(36).substr(2,5)}`,mt=(e,t)=>{try{localStorage.setItem(`panel-layout-${e}`,JSON.stringify(t))}catch(n){console.warn("Failed to save panel layout:",n)}},gt=e=>{try{const t=localStorage.getItem(`panel-layout-${e}`);return t?JSON.parse(t):null}catch(t){return console.warn("Failed to load panel layout:",t),null}},Ze=(e,t)=>{const n=e.map(d=>{if(d.collapsed)return{...d,size:0,percentageSize:0};if(d.sizeUnit==="pixels"||d.originalPixelSize!==void 0){const x=ie(d.minSize,0,t),w=ie(d.maxSize,t,t),C=me(d.size,x,w);let k=C,p=Math.abs(C-d.size)>Ye,b=d.size;if(d.originalPixelSize!==void 0&&Math.abs(d.size-d.originalPixelSize)<=Ye&&(b=d.originalPixelSize),b!==void 0){const E=me(b,x,w);E>k+Ye&&(k=E,p=!0)}if(p){const E=pe(k,t),U=d.collapsible?k:d.sizeBeforeCollapse,K=d.collapsible?d.measuredPixelSizeBeforeCollapse??d.measuredPixelSize??k:d.measuredPixelSizeBeforeCollapse;return{...d,size:k,percentageSize:E,sizeBeforeCollapse:U,measuredPixelSizeBeforeCollapse:K}}}if(d.sizeUnit==="percentage"&&(!d.percentageSize||d.percentageSize<=0)&&d.size>0){const x=pe(d.size,t);return{...d,percentageSize:x}}return d}),o=n.reduce((d,x)=>x.collapsed?d:x.sizeUnit==="pixels"||x.originalPixelSize!==void 0?d+x.size:d,0),i=()=>{const d=n.map((p,b)=>({panel:p,index:b})).filter(({panel:p})=>!p.collapsed&&(p.sizeUnit==="pixels"||p.originalPixelSize!==void 0));if(d.length===0)return n;const x=d.reduce((p,{panel:b})=>p+b.size,0),w=t-x;if(Math.abs(w)<=.1)return n;const C=[...d].sort((p,b)=>{const E=p.panel.pixelAdjustPriority??p.index+1,U=b.panel.pixelAdjustPriority??b.index+1;return E===U?p.index-b.index:E-U});let k=w;for(const{panel:p,index:b}of C){if(Math.abs(k)<=.1)break;const E=ie(p.minSize,0,t),U=ie(p.maxSize,t,t),K=p.size;if(k>0){const W=Math.max(0,U-K);if(W<=0)continue;const B=Math.min(W,k),M=K+B,Q=pe(M,t),H=p.collapsible?M:p.sizeBeforeCollapse,J=p.collapsible?p.measuredPixelSizeBeforeCollapse??p.measuredPixelSize??M:p.measuredPixelSizeBeforeCollapse;n[b]={...p,size:M,percentageSize:Q,sizeBeforeCollapse:H,measuredPixelSizeBeforeCollapse:J},k-=B}else{const W=Math.max(0,K-E);if(W<=0)continue;const B=Math.min(W,Math.abs(k)),M=K-B,Q=pe(M,t),H=p.collapsible?M:p.sizeBeforeCollapse,J=p.collapsible?p.measuredPixelSizeBeforeCollapse??p.measuredPixelSize??M:p.measuredPixelSizeBeforeCollapse;n[b]={...p,size:M,percentageSize:Q,sizeBeforeCollapse:H,measuredPixelSizeBeforeCollapse:J},k+=B}}return n},s=n.reduce((d,x,w)=>(!x.collapsed&&x.sizeUnit==="percentage"&&x.originalPixelSize===void 0&&d.push(w),d),[]);if(s.length===0)return i();const a=Math.max(0,t-o),l=s.map(d=>{const x=n[d];return x.percentageSize!==void 0&&x.percentageSize>0?Ie(x.percentageSize,t):x.size>0?x.size:0}),c=l.reduce((d,x)=>x>0?d+x:d,0);if(c<=0)return i();const y=[...n];let S=0;s.forEach((d,x)=>{const w=y[d],C=l[x];let k;if(C>0){const W=C/c;k=a*W}else k=w.size;const p=ie(w.minSize,0,t),b=ie(w.maxSize,t,t);k=me(k,p,b),S+=k;const E=pe(k,t),U=w.collapsible?k:w.sizeBeforeCollapse,K=w.collapsible?w.measuredPixelSizeBeforeCollapse??w.measuredPixelSize??k:w.measuredPixelSizeBeforeCollapse;y[d]={...w,size:k,percentageSize:E,sizeBeforeCollapse:U,measuredPixelSizeBeforeCollapse:K}});const f=a-S;return Math.abs(f)>.1&&Je(y,f,t),we(y)},we=e=>{let t=0;for(const i of e)i.collapsed||(t+=Math.max(i.size,0));if(t<=0){let i=!1;const s=e.map(a=>(a.percentageSize??0)!==0?(i=!0,{...a,percentageSize:0,measuredPercentageSize:a.measuredPercentageSize!==void 0?0:a.measuredPercentageSize}):!a.collapsed&&a.sizeBeforeCollapse!==a.size?(i=!0,{...a,sizeBeforeCollapse:a.size}):a);return i?s:e}let n=!1;const o=e.map(i=>{if(i.collapsed)return(i.percentageSize??0)!==0?(n=!0,{...i,percentageSize:0,measuredPercentageSize:i.measuredPercentageSize!==void 0?0:i.measuredPercentageSize}):i;const s=pe(i.size,t),a=i.measuredPercentageSize,y=(a!==void 0?Math.abs(a-s):1/0)<1e-4&&a!==void 0?a:s,S=rt(y,ct),d=Math.abs((i.percentageSize??0)-S)>0||i.percentageSize===void 0,x=i.sizeBeforeCollapse===void 0||i.sizeBeforeCollapse!==i.size,w=i.collapsible&&x,C=i.measuredPixelSize??i.size,k=i.collapsible&&(i.measuredPixelSizeBeforeCollapse===void 0||i.measuredPixelSizeBeforeCollapse!==C);if(!(d||w||k))return i;n=!0;const p=w?i.size:i.sizeBeforeCollapse,b=k?C:i.measuredPixelSizeBeforeCollapse;return{...i,percentageSize:S,sizeBeforeCollapse:p,measuredPixelSizeBeforeCollapse:b}});return n?o:e},De=(e,t)=>{if(t<=0)return!1;const n=[];let o=0;for(let S=0;S<e.length;S+=1){const f=e[S];!f||f.collapsed||(n.push(S),o+=f.size)}if(n.length===0)return!1;let i=t-o;if(Math.abs(i)<=0)return!1;let s=!1;const a=S=>{const f=e[S],d=ie(f.minSize,0,t),x=ie(f.maxSize,t,t),w=f.sizeUnit==="percentage"&&f.originalPixelSize===void 0;return{index:S,minSize:d,maxSize:x,isFlexible:w}},l=(S,f)=>{if(!Number.isFinite(f)||Math.abs(f)<=0)return;const d=e[S];if(!d)return;const x=Math.max(0,d.size+f);if(Math.abs(x-d.size)<=0)return;const w=pe(x,t),C=d.collapsible?x:d.sizeBeforeCollapse,k=d.collapsible?d.measuredPixelSizeBeforeCollapse??d.measuredPixelSize??x:d.measuredPixelSizeBeforeCollapse;e[S]={...d,size:x,percentageSize:w,sizeBeforeCollapse:C,measuredPixelSizeBeforeCollapse:k,measuredPixelSize:void 0,measuredPercentageSize:void 0},i-=f,s=!0},c=S=>{for(const f of S){if(Math.abs(i)<=0)break;const d=e[f.index];if(!d||d.collapsed)continue;const x=d.size;if(i>0){const w=Math.max(0,f.maxSize-x);if(w<=0)continue;const C=Math.min(w,i);if(C<=0)continue;l(f.index,C)}else{const w=Math.max(0,x-f.minSize);if(w<=0)continue;const C=Math.min(w,Math.abs(i));if(C<=0)continue;l(f.index,-C)}}},y=n.map(S=>a(S)).filter(S=>S.isFlexible);if(y.length>0&&c(y),Math.abs(i)>0){const S=i;i=Je(e,i,t),Math.abs(i-S)>0&&(s=!0)}return s},ht=(e,t,n)=>{if(!(e.sizeUnit==="pixels"||e.originalPixelSize!==void 0)||e.pixelAdjustPriority!==void 0)return e;const i=t.filter((a,l)=>l!==n&&(a.sizeUnit==="pixels"||a.originalPixelSize!==void 0)).map(a=>a.pixelAdjustPriority).filter(a=>a!==void 0),s=i.length>0?Math.max(...i)+1:1;return{...e,pixelAdjustPriority:s}},Qt=(e,t)=>{switch(t.type){case"REGISTER_PANEL":{console.log("REGISTER_PANEL",t.panel);const n=e.findIndex(s=>s.id===t.panel.id);if(n>=0){const s=[...e],a=e[n],l={...a,minSize:t.panel.minSize,maxSize:t.panel.maxSize,collapsible:t.panel.collapsible,sizeUnit:t.panel.sizeUnit,originalPixelSize:t.panel.originalPixelSize,pixelAdjustPriority:t.panel.pixelAdjustPriority!==void 0?t.panel.pixelAdjustPriority:a.pixelAdjustPriority},c=ht(l,e,n);return s[n]=c,s}const o={...t.panel},i=ht(o,e);return[...e,i]}case"UNREGISTER_PANEL":{console.log("UNREGISTER_PANEL",t.id);const n=e.filter(o=>o.id!==t.id);return we(n)}case"RESIZE_PANELS":{console.log("RESIZE_PANELS",t.leftId,t.rightId,t.leftSize,t.rightSize);const n=e.findIndex(I=>I.id===t.leftId),o=e.findIndex(I=>I.id===t.rightId);if(n===-1||o===-1)return e;const i=[...e],s=i[n],a=i[o];if(s.collapsed||a.collapsed||t.leftSize===s.size&&t.rightSize===a.size)return e;const l=t.containerSize??e.reduce((I,G)=>I+G.size,0),c=ie(s.minSize,0,l),y=ie(s.maxSize,l,l),S=ie(a.minSize,0,l),f=ie(a.maxSize,l,l),d=s.size+a.size,x=e.reduce((I,G)=>G.collapsed?I:I+G.size,0),w=x-d,C=c+S,k=y+f,p=me(t.leftSize+t.rightSize,C,k);let b=l>0?l-w:p;Number.isFinite(b)||(b=p);const E=me(Math.max(p,b),C,k),U=I=>({min:Math.max(c,I-f),max:Math.min(y,I-S)}),K=I=>({min:Math.max(S,I-y),max:Math.min(f,I-c)}),W=Math.abs(t.leftSize-s.size),B=Math.abs(t.rightSize-a.size),M=W>=B;let Q=s.size,H=a.size;if(M){const I=U(E);if(I.min>I.max)return e;const G=me(t.leftSize,I.min,I.max),v=E-G;if(v<S||v>f)return e;Q=G,H=v}else{const I=K(E);if(I.min>I.max)return e;const G=me(t.rightSize,I.min,I.max),v=E-G;if(v<c||v>y)return e;H=G,Q=v}const J=Q+H;if(E!==J)return e;const ne=x-s.size-a.size+J,X=l>0?l:ne,ee=X>0?pe(Q,X):0,V=X>0?pe(H,X):0;return i[n]={...s,size:Q,percentageSize:ee,sizeBeforeCollapse:s.collapsible?Q:s.sizeBeforeCollapse,measuredPixelSize:void 0,measuredPercentageSize:void 0},i[o]={...a,size:H,percentageSize:V,sizeBeforeCollapse:a.collapsible?H:a.sizeBeforeCollapse,measuredPixelSize:void 0,measuredPercentageSize:void 0},l>0&&De(i,l)?we(i):i}case"SET_PANELS":return console.log("SET_PANELS",t.panels),we(t.panels);case"CONTAINER_RESIZED":{console.log("CONTAINER_RESIZED",t.containerSize);const n=Ze(e,t.containerSize);return t.containerSize>0&&De(n,t.containerSize)?we(n):n}case"COLLAPSE_PANEL":{console.log("COLLAPSE_PANEL",t.id);const n=e.findIndex(y=>y.id===t.id);if(n===-1)return e;const o=e[n];if(!o.collapsible||o.collapsed)return e;const i=o.size,s=o.measuredPixelSize??i,a={...o,collapsed:!0,sizeBeforeCollapse:i,measuredPixelSizeBeforeCollapse:s,size:0,percentageSize:0,measuredPixelSize:o.measuredPixelSize!==void 0?0:o.measuredPixelSize,measuredPercentageSize:o.measuredPercentageSize!==void 0?0:o.measuredPercentageSize},l=[...e];l[n]=a;const c=Ze(l,t.containerSize);return t.containerSize>0&&De(c,t.containerSize)?we(c):c}case"EXPAND_PANEL":{console.log("EXPAND_PANEL",t.id,t.targetSize);const n=e.findIndex(k=>k.id===t.id);if(n===-1)return e;const o=t.containerSize,i=e[n];if(!(i.collapsible&&i.collapsed))return e;const a=[t.targetSize,i.sizeBeforeCollapse,i.measuredPixelSizeBeforeCollapse,i.originalPixelSize].find(k=>k!==void 0)??0,l=ie(i.minSize,0,o),c=ie(i.maxSize,o,o),y=me(a,l,c),S=pe(y,o),f=i.measuredPixelSizeBeforeCollapse??y,d=pe(f,o),x={...i,collapsed:!1,size:y,percentageSize:S,sizeBeforeCollapse:y,measuredPixelSize:y,measuredPixelSizeBeforeCollapse:f,measuredPercentageSize:d},w=[...e];w[n]=x;const C=Ze(w,o);return o>0&&De(C,o)?we(C):C}default:return e}},xt=({direction:e,style:t,onLayout:n,autoSaveId:o,showDebugInfo:i=!1})=>{const[s,a]=m.useReducer(Qt,[]),[l,c]=m.useState({width:0,height:0}),[y,S]=m.useState(!1),[f,d]=m.useState(!1),[x,w]=m.useState(null),[C,k]=m.useState({}),[p,b]=m.useState({}),E=m.useRef(null),U=m.useRef(n),K=m.useRef(!1),W=m.useRef(0),B=m.useRef(l);m.useLayoutEffect(()=>{if(!E.current)return;const R=new ResizeObserver(r=>{for(const P of r){const _=P.target,N=_?be(_,"horizontal"):null,te=_?be(_,"vertical"):null,g=N?N.inner:0,z=te?te.inner:0,D=P.contentRect.width,h=P.contentRect.height,A=g>0?g:D,j=z>0?z:h;c(F=>(!y&&A>0&&j>0&&S(!0),F.width===A&&F.height===j?F:{width:A,height:j}))}});return R.observe(E.current),()=>R.disconnect()},[y]),m.useLayoutEffect(()=>{const R=B.current,r=l,P=e==="horizontal"?Math.abs(R.width-r.width)>0:Math.abs(R.height-r.height)>0;if(f&&P){const _=e==="horizontal"?r.width:r.height;a({type:"CONTAINER_RESIZED",containerSize:_,direction:e})}B.current=r},[l,f,e]);const M=m.useCallback(()=>{console.log("panels[0]?.id",s[0]?.id);const R=s.some(u=>{if(u.collapsed||u.sizeUnit!=="percentage")return!1;const Y=u.collapsible?u.sizeBeforeCollapse??u.measuredPixelSizeBeforeCollapse??u.originalPixelSize??u.measuredPixelSize??0:u.measuredPixelSize??u.originalPixelSize??u.size,ue=u.percentageSize!==void 0&&u.percentageSize>0;return u.size<=0&&(Y>0||ue)}),r=e==="horizontal"?l.width:l.height,P=r>0;if(x||!P||!(s.length>0&&(s.length!==W.current||!f||R)))return;const te=s.filter(u=>!u.collapsed&&(u.originalPixelSize!==void 0||u.sizeUnit==="pixels")).reduce((u,Y)=>Y.originalPixelSize!==void 0?u+Y.originalPixelSize:u+Y.size,0),g=s.filter(u=>u.sizeUnit==="percentage"&&!u.collapsed),z=g.map(u=>u.id),D=g.map(u=>u.percentageSize!==void 0&&u.percentageSize>0?Ie(u.percentageSize,r):u.size>0?u.size:0),h=D.reduce((u,Y)=>u+Y,0),A=r-te,j=Math.max(0,A),F=j>0,$=s.map(u=>{if(u.collapsed){const Y=u.sizeBeforeCollapse??u.measuredPixelSizeBeforeCollapse??u.originalPixelSize??(u.sizeUnit==="pixels"?u.size:void 0),ue=u.sizeUnit==="percentage"&&u.percentageSize!==void 0?Ie(u.percentageSize,r):void 0,ae=Y??ue??0,ce=u.measuredPixelSizeBeforeCollapse??u.measuredPixelSize??ae;return{...u,size:0,percentageSize:0,sizeBeforeCollapse:ae,measuredPixelSizeBeforeCollapse:ce}}if(u.sizeUnit==="pixels"||u.originalPixelSize!==void 0){const Y=u.size,ue=r>0?pe(Y,r):0,ae={...u,size:Y,percentageSize:ue};if(u.collapsible){const ce=u.sizeBeforeCollapse??Y,xe=u.measuredPixelSizeBeforeCollapse??u.measuredPixelSize??ce;ae.sizeBeforeCollapse=ce,ae.measuredPixelSizeBeforeCollapse=xe}return ae}if(u.sizeUnit==="percentage"){const Y=z.indexOf(u.id),ue=Y!==-1?D[Y]:0,ae=ie(u.minSize,0,r),ce=ie(u.maxSize,r,r),xe=Math.max(ae,u.sizeBeforeCollapse??0,u.measuredPixelSizeBeforeCollapse??0,u.measuredPixelSize??0,u.originalPixelSize??0,u.size>0?u.size:0,u.percentageSize!==void 0?Ie(u.percentageSize,r):0,1),ge=ue>0?ue:xe;let fe;if(!F)fe=ae;else if(Y!==-1&&h>0){const Se=ge/h,ve=j*Se;fe=me(ve,ae,ce)}else{const Se=u.percentageSize!==void 0?Ie(u.percentageSize,r):u.size,ve=Se>0?Se:ge;fe=me(ve,ae,ce)}const _e=r>0?pe(fe,r):0,he={...u,size:fe,percentageSize:_e};if(u.collapsible){const Se=u.sizeBeforeCollapse??fe,ve=u.measuredPixelSizeBeforeCollapse??u.measuredPixelSize??Se;he.sizeBeforeCollapse=Se,he.measuredPixelSizeBeforeCollapse=ve}return he}return u}),se=[];for(let u=0;u<$.length;u+=1){const Y=$[u];Y.sizeUnit==="percentage"&&!Y.collapsed&&se.push(u)}const q=se.reduce((u,Y)=>u+$[Y].size,0),re=A-q;Math.abs(re)>0&&Je($,re,r),a({type:"SET_PANELS",panels:$}),W.current=s.length,d(!0)},[s,e,l.width,l.height,f,x]);m.useEffect(()=>{const R=e==="horizontal"?l.width:l.height,r=R>0,P=r&&s.length>0,_=P?s.reduce((h,A)=>{if(A.collapsed)return h;const j=ie(A.minSize,0,R);return h+Math.max(0,j)},0):null,N=P?s.reduce((h,A)=>{if(A.collapsed)return h;const j=ie(A.maxSize,R,R);return h+Math.max(0,j)},0):null,te=_??x?.totalMinimumSize??null,g=N??x?.totalMaximumSize??null;if(!r){x&&w(h=>!h||h.availableContainerSize===R?h:{reason:h.reason,totalMinimumSize:null,totalMaximumSize:null,availableContainerSize:R});return}const z=te!==null&&te-R>Number.EPSILON,D=g!==null&&R-g>Number.EPSILON;if(z||D){const A={reason:z?"minimum-exceeded":"maximum-insufficient",totalMinimumSize:te,totalMaximumSize:g,availableContainerSize:R};w(j=>j&&j.reason===A.reason&&Math.abs((j.totalMinimumSize??0)-(A.totalMinimumSize??0))<=Number.EPSILON&&Math.abs((j.totalMaximumSize??0)-(A.totalMaximumSize??0))<=Number.EPSILON&&Math.abs(j.availableContainerSize-A.availableContainerSize)<=Number.EPSILON?j:A);return}if(x){const h=x.reason==="minimum-exceeded",A=x.reason==="maximum-insufficient";(!h||te!==null)&&(!A||g!==null)&&!z&&!D&&w(q=>q&&null)}},[s,e,l.width,l.height,x]),m.useEffect(()=>{M()},[M]),m.useEffect(()=>{U.current=n},[n]);const Q=m.useMemo(()=>s.map(R=>R.size),[s]);m.useLayoutEffect(()=>{Q.length>0&&U.current&&U.current(Q)},[Q]),m.useEffect(()=>{if(o&&Q.length>0){const R=setTimeout(()=>{mt(o,Q)},200);return()=>clearTimeout(R)}},[o,Q]),m.useEffect(()=>{if(!o||s.length===0||K.current)return;const R=e==="horizontal"?l.width:l.height;if(R<=0)return;const r=gt(o);if(r&&r.length===s.length){const P=s.map((_,N)=>{const te=ie(_.minSize,0,R),g=ie(_.maxSize,R,R),z=me(r[N],te,g),D=pe(z,R);return{..._,size:z,percentageSize:D}});a({type:"SET_PANELS",panels:P}),K.current=!0}},[o,s,l.width,l.height,e]);const H=m.useCallback(R=>{a({type:"REGISTER_PANEL",panel:R})},[]),J=m.useCallback(R=>{a({type:"UNREGISTER_PANEL",id:R}),k(r=>{if(!(R in r))return r;const P={...r};return delete P[R],P})},[]),ne=m.useCallback((R,r,P,_)=>{const N=e==="horizontal"?l.width:l.height,te=s.find(q=>q.id===R),g=s.find(q=>q.id===r);if(!(te&&g)){a({type:"RESIZE_PANELS",leftId:R,rightId:r,leftSize:P,rightSize:_,containerSize:N});return}if(te.collapsed||g.collapsed)return;const z=ie(te.minSize,0,N),D=ie(te.maxSize,N,N),h=ie(g.minSize,0,N),A=ie(g.maxSize,N,N);let j=me(P,z,D),F=me(_,h,A);const $=j+F,se=P+_;if($!==se){const q=se-$;if(q>0){const re=D-j,u=A-F,Y=re+u;if(Y>0){const ue=Math.min(q*(re/Y),re),ae=Math.min(q-ue,u);j+=ue,F+=ae}}else if(q<0){const re=Math.abs(q),u=j-z,Y=F-h,ue=u+Y;if(ue>0){const ae=Math.min(re*(u/ue),u),ce=Math.min(re-ae,Y);j-=ae,F-=ce}}}j=me(j,z,D),F=me(F,h,A),console.assert(j+F===se,"Total size after constraints should be close to the original total size.",{constrainedLeftSize:j,constrainedRightSize:F,originalTotalSize:se}),a({type:"RESIZE_PANELS",leftId:R,rightId:r,leftSize:j,rightSize:F,containerSize:N})},[e,l.width,l.height,s]),X=m.useCallback(R=>{const r=e==="horizontal"?l.width:l.height;a({type:"COLLAPSE_PANEL",id:R,containerSize:r})},[e,l.width,l.height]),ee=m.useCallback((R,r)=>{const P=e==="horizontal"?l.width:l.height;a({type:"EXPAND_PANEL",id:R,containerSize:P,targetSize:r})},[e,l.width,l.height]),V=m.useCallback(R=>s.find(r=>r.id===R),[s]),I=m.useCallback((R,r)=>{k(P=>{if(r===null){if(!(R in P))return P;const N={...P};return delete N[R],N}const _=P[R];return _&&_.pixelSize===r.pixelSize&&_.percentageSize===r.percentageSize?P:{...P,[R]:r}})},[]),G=m.useCallback((R,r)=>{b(P=>{if(r===null){if(!(R in P))return P;const N={...P};return delete N[R],N}const _=P[R];return _&&Math.abs(_.thickness-r.thickness)<=.25&&_.visible===r.visible&&_.direction===r.direction&&_.startPanelId===r.startPanelId&&_.endPanelId===r.endPanelId?P:{...P,[R]:r}})},[]),v=m.useMemo(()=>({direction:e,panels:s,containerSize:l,isContainerReady:y,showDebugInfo:i,registerPanel:H,unregisterPanel:J,resizePanels:ne,collapsePanel:X,expandPanel:ee,getPanel:V,reportPanelMeasurement:I,panelMeasurements:C,reportHandleMeasurement:G,handleMeasurements:p,layoutConstraintViolation:x}),[e,s,l,y,i,H,J,ne,X,ee,V,I,C,G,p,x]),oe=m.useMemo(()=>({display:"flex",flexDirection:e==="horizontal"?"row":"column",alignItems:"stretch",width:"100%",height:"100%",minWidth:"0px",minHeight:"0px",position:"relative",overflow:"hidden",...t}),[e,t]);return{groupRef:E,contextValue:v,groupStyle:oe}},Kt=e=>{const{getPanel:t,collapsePanel:n,expandPanel:o}=Be(),i=t(e),s=m.useCallback(()=>{n(e)},[n,e]),a=m.useCallback(c=>{o(e,c)},[o,e]),l=m.useCallback(()=>{i?.collapsed?a():s()},[i?.collapsed,s,a]);return m.useMemo(()=>({panel:i,isCollapsed:i?.collapsed??!1,collapse:s,expand:a,toggle:l}),[i,s,a,l])};var Ge={exports:{}},Ae={};/**
|
|
2
2
|
* @license React
|
|
3
3
|
* react-jsx-runtime.production.js
|
|
4
4
|
*
|
|
@@ -14,10 +14,10 @@
|
|
|
14
14
|
*
|
|
15
15
|
* This source code is licensed under the MIT license found in the
|
|
16
16
|
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var zt;function $t(){return zt||(zt=1,process.env.NODE_ENV!=="production"&&(function(){function e(r){if(r==null)return null;if(typeof r=="function")return r.$$typeof===
|
|
17
|
+
*/var zt;function $t(){return zt||(zt=1,process.env.NODE_ENV!=="production"&&(function(){function e(r){if(r==null)return null;if(typeof r=="function")return r.$$typeof===J?null:r.displayName||r.name||null;if(typeof r=="string")return r;switch(r){case k:return"Fragment";case b:return"Profiler";case p:return"StrictMode";case W:return"Suspense";case B:return"SuspenseList";case H:return"Activity"}if(typeof r=="object")switch(typeof r.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),r.$$typeof){case C:return"Portal";case U:return r.displayName||"Context";case E:return(r._context.displayName||"Context")+".Consumer";case K:var P=r.render;return r=r.displayName,r||(r=P.displayName||P.name||"",r=r!==""?"ForwardRef("+r+")":"ForwardRef"),r;case M:return P=r.displayName||null,P!==null?P:e(r.type)||"Memo";case Q:P=r._payload,r=r._init;try{return e(r(P))}catch{}}return null}function t(r){return""+r}function n(r){try{t(r);var P=!1}catch{P=!0}if(P){P=console;var _=P.error,N=typeof Symbol=="function"&&Symbol.toStringTag&&r[Symbol.toStringTag]||r.constructor.name||"Object";return _.call(P,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",N),t(r)}}function o(r){if(r===k)return"<>";if(typeof r=="object"&&r!==null&&r.$$typeof===Q)return"<...>";try{var P=e(r);return P?"<"+P+">":"<...>"}catch{return"<...>"}}function i(){var r=ne.A;return r===null?null:r.getOwner()}function s(){return Error("react-stack-top-frame")}function a(r){if(X.call(r,"key")){var P=Object.getOwnPropertyDescriptor(r,"key").get;if(P&&P.isReactWarning)return!1}return r.key!==void 0}function l(r,P){function _(){I||(I=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",P))}_.isReactWarning=!0,Object.defineProperty(r,"key",{get:_,configurable:!0})}function c(){var r=e(this.type);return G[r]||(G[r]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),r=this.props.ref,r!==void 0?r:null}function y(r,P,_,N,te,g){var z=_.ref;return r={$$typeof:w,type:r,key:P,props:_,_owner:N},(z!==void 0?z:null)!==null?Object.defineProperty(r,"ref",{enumerable:!1,get:c}):Object.defineProperty(r,"ref",{enumerable:!1,value:null}),r._store={},Object.defineProperty(r._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(r,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(r,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:te}),Object.defineProperty(r,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:g}),Object.freeze&&(Object.freeze(r.props),Object.freeze(r)),r}function S(r,P,_,N,te,g){var z=P.children;if(z!==void 0)if(N)if(ee(z)){for(N=0;N<z.length;N++)f(z[N]);Object.freeze&&Object.freeze(z)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else f(z);if(X.call(P,"key")){z=e(r);var D=Object.keys(P).filter(function(A){return A!=="key"});N=0<D.length?"{key: someKey, "+D.join(": ..., ")+": ...}":"{key: someKey}",R[z+N]||(D=0<D.length?"{"+D.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
|
|
18
18
|
let props = %s;
|
|
19
19
|
<%s {...props} />
|
|
20
20
|
React keys must be passed directly to JSX without using spread:
|
|
21
21
|
let props = %s;
|
|
22
|
-
<%s key={someKey} {...props} />`,T,b,h,b),I[b+T]=!0)}if(b=null,M!==void 0&&(n(M),b=""+M),a(S)&&(n(S.key),b=""+S.key),"key"in S){M={};for(var v in S)v!=="key"&&(M[v]=S[v])}else M=S;return b&&l(M,typeof r=="function"?r.displayName||r.name||"Unknown":r),P(r,b,M,i(),Y,y)}function d(r){u(r)?r._store&&(r._store.validated=1):typeof r=="object"&&r!==null&&r.$$typeof===U&&(r._payload.status==="fulfilled"?u(r._payload.value)&&r._payload.value._store&&(r._payload.value._store.validated=1):r._store&&(r._store.validated=1))}function u(r){return typeof r=="object"&&r!==null&&r.$$typeof===C}var x=m,C=Symbol.for("react.transitional.element"),k=Symbol.for("react.portal"),w=Symbol.for("react.fragment"),p=Symbol.for("react.strict_mode"),g=Symbol.for("react.profiler"),_=Symbol.for("react.consumer"),H=Symbol.for("react.context"),X=Symbol.for("react.forward_ref"),A=Symbol.for("react.suspense"),te=Symbol.for("react.suspense_list"),R=Symbol.for("react.memo"),U=Symbol.for("react.lazy"),V=Symbol.for("react.activity"),K=Symbol.for("react.client.reference"),ne=x.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,J=Object.prototype.hasOwnProperty,q=Array.isArray,W=console.createTask?console.createTask:function(){return null};x={react_stack_bottom_frame:function(r){return r()}};var N,G={},E=x.react_stack_bottom_frame.bind(x,s)(),ie=W(o(s)),I={};Ne.Fragment=w,Ne.jsx=function(r,S,M){var T=1e4>ne.recentlyCreatedOwnerStacks++;return z(r,S,M,!1,T?Error("react-stack-top-frame"):E,T?W(o(r)):ie)},Ne.jsxs=function(r,S,M){var T=1e4>ne.recentlyCreatedOwnerStacks++;return z(r,S,M,!0,T?Error("react-stack-top-frame"):E,T?W(o(r)):ie)}})()),Ne}var St;function en(){return St||(St=1,process.env.NODE_ENV==="production"?Ge.exports=qt():Ge.exports=$t()),Ge.exports}var D=en();const Qe="-",tn=e=>{const t=rn(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:o}=e;return{getClassGroupId:a=>{const l=a.split(Qe);return l[0]===""&&l.length!==1&&l.shift(),Pt(l,t)||nn(a)},getConflictingClassGroupIds:(a,l)=>{const c=n[a]||[];return l&&o[a]?[...c,...o[a]]:c}}},Pt=(e,t)=>{if(e.length===0)return t.classGroupId;const n=e[0],o=t.nextPart.get(n),i=o?Pt(e.slice(1),o):void 0;if(i)return i;if(t.validators.length===0)return;const s=e.join(Qe);return t.validators.find(({validator:a})=>a(s))?.classGroupId},yt=/^\[(.+)\]$/,nn=e=>{if(yt.test(e)){const t=yt.exec(e)[1],n=t?.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},rn=e=>{const{theme:t,classGroups:n}=e,o={nextPart:new Map,validators:[]};for(const i in n)Ke(n[i],o,i,t);return o},Ke=(e,t,n,o)=>{e.forEach(i=>{if(typeof i=="string"){const s=i===""?t:vt(t,i);s.classGroupId=n;return}if(typeof i=="function"){if(on(i)){Ke(i(o),t,n,o);return}t.validators.push({validator:i,classGroupId:n});return}Object.entries(i).forEach(([s,a])=>{Ke(a,vt(t,s),n,o)})})},vt=(e,t)=>{let n=e;return t.split(Qe).forEach(o=>{n.nextPart.has(o)||n.nextPart.set(o,{nextPart:new Map,validators:[]}),n=n.nextPart.get(o)}),n},on=e=>e.isThemeGetter,sn=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,o=new Map;const i=(s,a)=>{n.set(s,a),t++,t>e&&(t=0,o=n,n=new Map)};return{get(s){let a=n.get(s);if(a!==void 0)return a;if((a=o.get(s))!==void 0)return i(s,a),a},set(s,a){n.has(s)?n.set(s,a):i(s,a)}}},qe="!",$e=":",an=$e.length,ln=e=>{const{prefix:t,experimentalParseClassName:n}=e;let o=i=>{const s=[];let a=0,l=0,c=0,P;for(let C=0;C<i.length;C++){let k=i[C];if(a===0&&l===0){if(k===$e){s.push(i.slice(c,C)),c=C+an;continue}if(k==="/"){P=C;continue}}k==="["?a++:k==="]"?a--:k==="("?l++:k===")"&&l--}const z=s.length===0?i:i.substring(c),d=cn(z),u=d!==z,x=P&&P>c?P-c:void 0;return{modifiers:s,hasImportantModifier:u,baseClassName:d,maybePostfixModifierPosition:x}};if(t){const i=t+$e,s=o;o=a=>a.startsWith(i)?s(a.substring(i.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:a,maybePostfixModifierPosition:void 0}}if(n){const i=o;o=s=>n({className:s,parseClassName:i})}return o},cn=e=>e.endsWith(qe)?e.substring(0,e.length-1):e.startsWith(qe)?e.substring(1):e,dn=e=>{const t=Object.fromEntries(e.orderSensitiveModifiers.map(o=>[o,!0]));return o=>{if(o.length<=1)return o;const i=[];let s=[];return o.forEach(a=>{a[0]==="["||t[a]?(i.push(...s.sort(),a),s=[]):s.push(a)}),i.push(...s.sort()),i}},un=e=>({cache:sn(e.cacheSize),parseClassName:ln(e),sortModifiers:dn(e),...tn(e)}),fn=/\s+/,pn=(e,t)=>{const{parseClassName:n,getClassGroupId:o,getConflictingClassGroupIds:i,sortModifiers:s}=t,a=[],l=e.trim().split(fn);let c="";for(let P=l.length-1;P>=0;P-=1){const z=l[P],{isExternal:d,modifiers:u,hasImportantModifier:x,baseClassName:C,maybePostfixModifierPosition:k}=n(z);if(d){c=z+(c.length>0?" "+c:c);continue}let w=!!k,p=o(w?C.substring(0,k):C);if(!p){if(!w){c=z+(c.length>0?" "+c:c);continue}if(p=o(C),!p){c=z+(c.length>0?" "+c:c);continue}w=!1}const g=s(u).join(":"),_=x?g+qe:g,H=_+p;if(a.includes(H))continue;a.push(H);const X=i(p,w);for(let A=0;A<X.length;++A){const te=X[A];a.push(_+te)}c=z+(c.length>0?" "+c:c)}return c};function mn(){let e=0,t,n,o="";for(;e<arguments.length;)(t=arguments[e++])&&(n=wt(t))&&(o&&(o+=" "),o+=n);return o}const wt=e=>{if(typeof e=="string")return e;let t,n="";for(let o=0;o<e.length;o++)e[o]&&(t=wt(e[o]))&&(n&&(n+=" "),n+=t);return n};function gn(e,...t){let n,o,i,s=a;function a(c){const P=t.reduce((z,d)=>d(z),e());return n=un(P),o=n.cache.get,i=n.cache.set,s=l,l(c)}function l(c){const P=o(c);if(P)return P;const z=pn(c,n);return i(c,z),z}return function(){return s(mn.apply(null,arguments))}}const de=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},Ct=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,kt=/^\((?:(\w[\w-]*):)?(.+)\)$/i,hn=/^\d+\/\d+$/,xn=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,bn=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,zn=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Sn=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Pn=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Me=e=>hn.test(e),Q=e=>!!e&&!Number.isNaN(Number(e)),ye=e=>!!e&&Number.isInteger(Number(e)),et=e=>e.endsWith("%")&&Q(e.slice(0,-1)),Pe=e=>xn.test(e),yn=()=>!0,vn=e=>bn.test(e)&&!zn.test(e),Et=()=>!1,wn=e=>Sn.test(e),Cn=e=>Pn.test(e),kn=e=>!O(e)&&!j(e),En=e=>Re(e,At,Et),O=e=>Ct.test(e),Ce=e=>Re(e,Nt,vn),tt=e=>Re(e,An,Q),Mt=e=>Re(e,_t,Et),Mn=e=>Re(e,It,Cn),Fe=e=>Re(e,Tt,wn),j=e=>kt.test(e),Te=e=>_e(e,Nt),Rn=e=>_e(e,Nn),Rt=e=>_e(e,_t),_n=e=>_e(e,At),In=e=>_e(e,It),He=e=>_e(e,Tt,!0),Re=(e,t,n)=>{const o=Ct.exec(e);return o?o[1]?t(o[1]):n(o[2]):!1},_e=(e,t,n=!1)=>{const o=kt.exec(e);return o?o[1]?t(o[1]):n:!1},_t=e=>e==="position"||e==="percentage",It=e=>e==="image"||e==="url",At=e=>e==="length"||e==="size"||e==="bg-size",Nt=e=>e==="length",An=e=>e==="number",Nn=e=>e==="family-name",Tt=e=>e==="shadow",Oe=gn(()=>{const e=de("color"),t=de("font"),n=de("text"),o=de("font-weight"),i=de("tracking"),s=de("leading"),a=de("breakpoint"),l=de("container"),c=de("spacing"),P=de("radius"),z=de("shadow"),d=de("inset-shadow"),u=de("text-shadow"),x=de("drop-shadow"),C=de("blur"),k=de("perspective"),w=de("aspect"),p=de("ease"),g=de("animate"),_=()=>["auto","avoid","all","avoid-page","page","left","right","column"],H=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],X=()=>[...H(),j,O],A=()=>["auto","hidden","clip","visible","scroll"],te=()=>["auto","contain","none"],R=()=>[j,O,c],U=()=>[Me,"full","auto",...R()],V=()=>[ye,"none","subgrid",j,O],K=()=>["auto",{span:["full",ye,j,O]},ye,j,O],ne=()=>[ye,"auto",j,O],J=()=>["auto","min","max","fr",j,O],q=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],W=()=>["start","end","center","stretch","center-safe","end-safe"],N=()=>["auto",...R()],G=()=>[Me,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...R()],E=()=>[e,j,O],ie=()=>[...H(),Rt,Mt,{position:[j,O]}],I=()=>["no-repeat",{repeat:["","x","y","space","round"]}],r=()=>["auto","cover","contain",_n,En,{size:[j,O]}],S=()=>[et,Te,Ce],M=()=>["","none","full",P,j,O],T=()=>["",Q,Te,Ce],Y=()=>["solid","dashed","dotted","double"],y=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],b=()=>[Q,et,Rt,Mt],h=()=>["","none",C,j,O],v=()=>["none",Q,j,O],L=()=>["none",Q,j,O],B=()=>[Q,j,O],F=()=>[Me,"full",...R()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Pe],breakpoint:[Pe],color:[yn],container:[Pe],"drop-shadow":[Pe],ease:["in","out","in-out"],font:[kn],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Pe],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Pe],shadow:[Pe],spacing:["px",Q],text:[Pe],"text-shadow":[Pe],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Me,O,j,w]}],container:["container"],columns:[{columns:[Q,O,j,l]}],"break-after":[{"break-after":_()}],"break-before":[{"break-before":_()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:X()}],overflow:[{overflow:A()}],"overflow-x":[{"overflow-x":A()}],"overflow-y":[{"overflow-y":A()}],overscroll:[{overscroll:te()}],"overscroll-x":[{"overscroll-x":te()}],"overscroll-y":[{"overscroll-y":te()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:U()}],"inset-x":[{"inset-x":U()}],"inset-y":[{"inset-y":U()}],start:[{start:U()}],end:[{end:U()}],top:[{top:U()}],right:[{right:U()}],bottom:[{bottom:U()}],left:[{left:U()}],visibility:["visible","invisible","collapse"],z:[{z:[ye,"auto",j,O]}],basis:[{basis:[Me,"full","auto",l,...R()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Q,Me,"auto","initial","none",O]}],grow:[{grow:["",Q,j,O]}],shrink:[{shrink:["",Q,j,O]}],order:[{order:[ye,"first","last","none",j,O]}],"grid-cols":[{"grid-cols":V()}],"col-start-end":[{col:K()}],"col-start":[{"col-start":ne()}],"col-end":[{"col-end":ne()}],"grid-rows":[{"grid-rows":V()}],"row-start-end":[{row:K()}],"row-start":[{"row-start":ne()}],"row-end":[{"row-end":ne()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":J()}],"auto-rows":[{"auto-rows":J()}],gap:[{gap:R()}],"gap-x":[{"gap-x":R()}],"gap-y":[{"gap-y":R()}],"justify-content":[{justify:[...q(),"normal"]}],"justify-items":[{"justify-items":[...W(),"normal"]}],"justify-self":[{"justify-self":["auto",...W()]}],"align-content":[{content:["normal",...q()]}],"align-items":[{items:[...W(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...W(),{baseline:["","last"]}]}],"place-content":[{"place-content":q()}],"place-items":[{"place-items":[...W(),"baseline"]}],"place-self":[{"place-self":["auto",...W()]}],p:[{p:R()}],px:[{px:R()}],py:[{py:R()}],ps:[{ps:R()}],pe:[{pe:R()}],pt:[{pt:R()}],pr:[{pr:R()}],pb:[{pb:R()}],pl:[{pl:R()}],m:[{m:N()}],mx:[{mx:N()}],my:[{my:N()}],ms:[{ms:N()}],me:[{me:N()}],mt:[{mt:N()}],mr:[{mr:N()}],mb:[{mb:N()}],ml:[{ml:N()}],"space-x":[{"space-x":R()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":R()}],"space-y-reverse":["space-y-reverse"],size:[{size:G()}],w:[{w:[l,"screen",...G()]}],"min-w":[{"min-w":[l,"screen","none",...G()]}],"max-w":[{"max-w":[l,"screen","none","prose",{screen:[a]},...G()]}],h:[{h:["screen","lh",...G()]}],"min-h":[{"min-h":["screen","lh","none",...G()]}],"max-h":[{"max-h":["screen","lh",...G()]}],"font-size":[{text:["base",n,Te,Ce]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[o,j,tt]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",et,O]}],"font-family":[{font:[Rn,O,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[i,j,O]}],"line-clamp":[{"line-clamp":[Q,"none",j,tt]}],leading:[{leading:[s,...R()]}],"list-image":[{"list-image":["none",j,O]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",j,O]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:E()}],"text-color":[{text:E()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Y(),"wavy"]}],"text-decoration-thickness":[{decoration:[Q,"from-font","auto",j,Ce]}],"text-decoration-color":[{decoration:E()}],"underline-offset":[{"underline-offset":[Q,"auto",j,O]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:R()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",j,O]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",j,O]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:ie()}],"bg-repeat":[{bg:I()}],"bg-size":[{bg:r()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},ye,j,O],radial:["",j,O],conic:[ye,j,O]},In,Mn]}],"bg-color":[{bg:E()}],"gradient-from-pos":[{from:S()}],"gradient-via-pos":[{via:S()}],"gradient-to-pos":[{to:S()}],"gradient-from":[{from:E()}],"gradient-via":[{via:E()}],"gradient-to":[{to:E()}],rounded:[{rounded:M()}],"rounded-s":[{"rounded-s":M()}],"rounded-e":[{"rounded-e":M()}],"rounded-t":[{"rounded-t":M()}],"rounded-r":[{"rounded-r":M()}],"rounded-b":[{"rounded-b":M()}],"rounded-l":[{"rounded-l":M()}],"rounded-ss":[{"rounded-ss":M()}],"rounded-se":[{"rounded-se":M()}],"rounded-ee":[{"rounded-ee":M()}],"rounded-es":[{"rounded-es":M()}],"rounded-tl":[{"rounded-tl":M()}],"rounded-tr":[{"rounded-tr":M()}],"rounded-br":[{"rounded-br":M()}],"rounded-bl":[{"rounded-bl":M()}],"border-w":[{border:T()}],"border-w-x":[{"border-x":T()}],"border-w-y":[{"border-y":T()}],"border-w-s":[{"border-s":T()}],"border-w-e":[{"border-e":T()}],"border-w-t":[{"border-t":T()}],"border-w-r":[{"border-r":T()}],"border-w-b":[{"border-b":T()}],"border-w-l":[{"border-l":T()}],"divide-x":[{"divide-x":T()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":T()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...Y(),"hidden","none"]}],"divide-style":[{divide:[...Y(),"hidden","none"]}],"border-color":[{border:E()}],"border-color-x":[{"border-x":E()}],"border-color-y":[{"border-y":E()}],"border-color-s":[{"border-s":E()}],"border-color-e":[{"border-e":E()}],"border-color-t":[{"border-t":E()}],"border-color-r":[{"border-r":E()}],"border-color-b":[{"border-b":E()}],"border-color-l":[{"border-l":E()}],"divide-color":[{divide:E()}],"outline-style":[{outline:[...Y(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Q,j,O]}],"outline-w":[{outline:["",Q,Te,Ce]}],"outline-color":[{outline:E()}],shadow:[{shadow:["","none",z,He,Fe]}],"shadow-color":[{shadow:E()}],"inset-shadow":[{"inset-shadow":["none",d,He,Fe]}],"inset-shadow-color":[{"inset-shadow":E()}],"ring-w":[{ring:T()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:E()}],"ring-offset-w":[{"ring-offset":[Q,Ce]}],"ring-offset-color":[{"ring-offset":E()}],"inset-ring-w":[{"inset-ring":T()}],"inset-ring-color":[{"inset-ring":E()}],"text-shadow":[{"text-shadow":["none",u,He,Fe]}],"text-shadow-color":[{"text-shadow":E()}],opacity:[{opacity:[Q,j,O]}],"mix-blend":[{"mix-blend":[...y(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":y()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Q]}],"mask-image-linear-from-pos":[{"mask-linear-from":b()}],"mask-image-linear-to-pos":[{"mask-linear-to":b()}],"mask-image-linear-from-color":[{"mask-linear-from":E()}],"mask-image-linear-to-color":[{"mask-linear-to":E()}],"mask-image-t-from-pos":[{"mask-t-from":b()}],"mask-image-t-to-pos":[{"mask-t-to":b()}],"mask-image-t-from-color":[{"mask-t-from":E()}],"mask-image-t-to-color":[{"mask-t-to":E()}],"mask-image-r-from-pos":[{"mask-r-from":b()}],"mask-image-r-to-pos":[{"mask-r-to":b()}],"mask-image-r-from-color":[{"mask-r-from":E()}],"mask-image-r-to-color":[{"mask-r-to":E()}],"mask-image-b-from-pos":[{"mask-b-from":b()}],"mask-image-b-to-pos":[{"mask-b-to":b()}],"mask-image-b-from-color":[{"mask-b-from":E()}],"mask-image-b-to-color":[{"mask-b-to":E()}],"mask-image-l-from-pos":[{"mask-l-from":b()}],"mask-image-l-to-pos":[{"mask-l-to":b()}],"mask-image-l-from-color":[{"mask-l-from":E()}],"mask-image-l-to-color":[{"mask-l-to":E()}],"mask-image-x-from-pos":[{"mask-x-from":b()}],"mask-image-x-to-pos":[{"mask-x-to":b()}],"mask-image-x-from-color":[{"mask-x-from":E()}],"mask-image-x-to-color":[{"mask-x-to":E()}],"mask-image-y-from-pos":[{"mask-y-from":b()}],"mask-image-y-to-pos":[{"mask-y-to":b()}],"mask-image-y-from-color":[{"mask-y-from":E()}],"mask-image-y-to-color":[{"mask-y-to":E()}],"mask-image-radial":[{"mask-radial":[j,O]}],"mask-image-radial-from-pos":[{"mask-radial-from":b()}],"mask-image-radial-to-pos":[{"mask-radial-to":b()}],"mask-image-radial-from-color":[{"mask-radial-from":E()}],"mask-image-radial-to-color":[{"mask-radial-to":E()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":H()}],"mask-image-conic-pos":[{"mask-conic":[Q]}],"mask-image-conic-from-pos":[{"mask-conic-from":b()}],"mask-image-conic-to-pos":[{"mask-conic-to":b()}],"mask-image-conic-from-color":[{"mask-conic-from":E()}],"mask-image-conic-to-color":[{"mask-conic-to":E()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:ie()}],"mask-repeat":[{mask:I()}],"mask-size":[{mask:r()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",j,O]}],filter:[{filter:["","none",j,O]}],blur:[{blur:h()}],brightness:[{brightness:[Q,j,O]}],contrast:[{contrast:[Q,j,O]}],"drop-shadow":[{"drop-shadow":["","none",x,He,Fe]}],"drop-shadow-color":[{"drop-shadow":E()}],grayscale:[{grayscale:["",Q,j,O]}],"hue-rotate":[{"hue-rotate":[Q,j,O]}],invert:[{invert:["",Q,j,O]}],saturate:[{saturate:[Q,j,O]}],sepia:[{sepia:["",Q,j,O]}],"backdrop-filter":[{"backdrop-filter":["","none",j,O]}],"backdrop-blur":[{"backdrop-blur":h()}],"backdrop-brightness":[{"backdrop-brightness":[Q,j,O]}],"backdrop-contrast":[{"backdrop-contrast":[Q,j,O]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Q,j,O]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Q,j,O]}],"backdrop-invert":[{"backdrop-invert":["",Q,j,O]}],"backdrop-opacity":[{"backdrop-opacity":[Q,j,O]}],"backdrop-saturate":[{"backdrop-saturate":[Q,j,O]}],"backdrop-sepia":[{"backdrop-sepia":["",Q,j,O]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":R()}],"border-spacing-x":[{"border-spacing-x":R()}],"border-spacing-y":[{"border-spacing-y":R()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",j,O]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Q,"initial",j,O]}],ease:[{ease:["linear","initial",p,j,O]}],delay:[{delay:[Q,j,O]}],animate:[{animate:["none",g,j,O]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[k,j,O]}],"perspective-origin":[{"perspective-origin":X()}],rotate:[{rotate:v()}],"rotate-x":[{"rotate-x":v()}],"rotate-y":[{"rotate-y":v()}],"rotate-z":[{"rotate-z":v()}],scale:[{scale:L()}],"scale-x":[{"scale-x":L()}],"scale-y":[{"scale-y":L()}],"scale-z":[{"scale-z":L()}],"scale-3d":["scale-3d"],skew:[{skew:B()}],"skew-x":[{"skew-x":B()}],"skew-y":[{"skew-y":B()}],transform:[{transform:[j,O,"","none","gpu","cpu"]}],"transform-origin":[{origin:X()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:F()}],"translate-x":[{"translate-x":F()}],"translate-y":[{"translate-y":F()}],"translate-z":[{"translate-z":F()}],"translate-none":["translate-none"],accent:[{accent:E()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:E()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",j,O]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":R()}],"scroll-mx":[{"scroll-mx":R()}],"scroll-my":[{"scroll-my":R()}],"scroll-ms":[{"scroll-ms":R()}],"scroll-me":[{"scroll-me":R()}],"scroll-mt":[{"scroll-mt":R()}],"scroll-mr":[{"scroll-mr":R()}],"scroll-mb":[{"scroll-mb":R()}],"scroll-ml":[{"scroll-ml":R()}],"scroll-p":[{"scroll-p":R()}],"scroll-px":[{"scroll-px":R()}],"scroll-py":[{"scroll-py":R()}],"scroll-ps":[{"scroll-ps":R()}],"scroll-pe":[{"scroll-pe":R()}],"scroll-pt":[{"scroll-pt":R()}],"scroll-pr":[{"scroll-pr":R()}],"scroll-pb":[{"scroll-pb":R()}],"scroll-pl":[{"scroll-pl":R()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",j,O]}],fill:[{fill:["none",...E()]}],"stroke-w":[{stroke:[Q,Te,Ce,tt]}],stroke:[{stroke:["none",...E()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}}),Tn=({panel:e,isLastFlexiblePanel:t,measuredPixelSize:n,measuredPercentageSize:o,containerAxisSize:i,containerLabel:s})=>{const a=e?.size,l=typeof a=="number"&&Number.isFinite(a)?`${a.toFixed(3)}px`:"-",c=e?.percentageSize!==void 0?`${e.percentageSize.toFixed(3)}%`:"-",P=Number.isFinite(n)?`${n.toFixed(3)}px`:"-",z=Number.isFinite(o)?`${o.toFixed(3)}%`:"-",d=Number.isFinite(i)?`${i.toFixed(3)}px`:"-",u=`${l} / ${c}`,x=`${P} / ${z}`,C=`${e?.sizeUnit==="pixels"?"Fixed":"Flexible"}${t?" (Grow)":""}`,k=[C,`${s}: ${d}`,`size (state): ${u}`,`size (measured): ${x}`];return{stateValueDisplay:u,measuredValueDisplay:x,containerDisplay:d,headlineLabel:C,titleText:k.join(`
|
|
23
|
-
`)}},On=m.memo(({panel:e,isLastFlexiblePanel:t,measuredPixelSize:n,measuredPercentageSize:o,containerAxisSize:i,direction:s})=>{const a=s==="horizontal"?"container width":"container height",{stateValueDisplay:l,measuredValueDisplay:c,containerDisplay:P,headlineLabel:z,titleText:d}=m.useMemo(()=>Tn({panel:e,isLastFlexiblePanel:t,measuredPixelSize:n,measuredPercentageSize:o,containerAxisSize:i,containerLabel:a}),[e,t,n,o,i,a]),u={position:"absolute",top:"2px",right:"4px",backgroundColor:"rgba(30, 41, 59, 0.6)",color:"#fff",padding:"4px 8px",borderRadius:"6px",fontSize:"11px",fontFamily:"monospace",pointerEvents:"auto",zIndex:10,boxShadow:"0 2px 4px rgba(0,0,0,0.3)",border:"1px solid rgba(255,255,255,0.1)",maxWidth:"calc(100% - 12px)",minWidth:"60px",width:"fit-content",overflow:"hidden"},x={display:"flex",flexDirection:"column",gap:"1px",minWidth:"0",width:"100%"},C={display:"flex",justifyContent:"flex-start",alignItems:"center",gap:"6px",fontSize:"10px",color:"#ccc",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",minWidth:"0",width:"100%"},k={display:"flex",justifyContent:"space-between",alignItems:"center",gap:"6px",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",minWidth:"0",width:"100%"},w={marginLeft:"auto",fontVariantNumeric:"tabular-nums",whiteSpace:"nowrap"};return D.jsx("div",{style:u,title:d,children:D.jsxs("div",{style:x,children:[D.jsx("div",{style:C,children:D.jsx("span",{children:z})}),D.jsxs("div",{style:k,children:[D.jsx("span",{children:a}),D.jsx("span",{style:w,children:P})]}),D.jsxs("div",{style:k,children:[D.jsx("span",{children:"size (state)"}),D.jsx("span",{style:w,children:l})]}),D.jsxs("div",{style:k,children:[D.jsx("span",{children:"size (measured)"}),D.jsx("span",{style:w,children:c})]})]})})}),jn=m.memo(({id:e,defaultSize:t={value:50,unit:"percentage"},minSize:n,maxSize:o,className:i,style:s,children:a,order:l=0,collapsible:c=!1,defaultCollapsed:P=!1,pixelAdjustPriority:z})=>{const{direction:d,registerPanel:u,unregisterPanel:x,getPanel:C,showDebugInfo:k,panels:w,isContainerReady:p,reportPanelMeasurement:g,containerSize:_}=Be(),H=m.useRef(null),X=m.useRef(e||pt()),A=C(X.current),te=!!A?.collapsed,R=(A?.size??0)<=0,U=te||R,[V,K]=m.useState(()=>{const h=Ee(t);return h?.unit==="pixels"?h.value:A?.size!==void 0?A.size:0}),[ne,J]=m.useState(()=>{const h=Ee(t);return h?.unit==="percentage"?h.value:A?.percentageSize!==void 0?A.percentageSize:0}),q=m.useRef(ne);q.current=ne;const W=m.useRef(V);W.current=V;const N=m.useCallback(h=>{if(!Number.isFinite(h))return;const v=h<0?0:h;W.current!==v&&(W.current=v,console.debug("[resize-panels] commit pixel",{panelId:X.current,pixel:v}),K(v))},[]),G=m.useCallback(h=>{if(!Number.isFinite(h))return;const v=h<0?0:h;q.current!==v&&(q.current=v,console.debug("[resize-panels] commit percentage",{panelId:X.current,percentage:v}),J(v))},[]);m.useEffect(()=>{e||console.warn("Panel component should have an explicit 'id' prop to avoid hydration issues. Auto-generated ID may cause SSR/client mismatch.")},[e]),m.useEffect(()=>{if(!p)return;const h=Ee(t),v=h?.unit==="pixels";let L=0;if(v){let f=h.value;n&&typeof n=="object"&&n.unit==="pixels"&&(f=Math.max(f,n.value)),o&&typeof o=="object"&&o.unit==="pixels"&&(f=Math.min(f,o.value)),L=f}const B=v?void 0:h?.value,F=P,re=c&&F&&v?L:void 0,ee=c?B:void 0,$={id:X.current,size:F?0:L,percentageSize:F?0:B,sizeUnit:h?.unit||"percentage",originalPixelSize:v?L:void 0,minSize:n,maxSize:o,collapsible:c,collapsed:F,sizeBeforeCollapse:re,percentageSizeBeforeCollapse:ee,pixelAdjustPriority:z};return u($),()=>{x(X.current),g(X.current,null)}},[t,n,o,u,x,c,P,z,g,p]);const E=A?.size??0;m.useEffect(()=>{const h=H.current;if(!h)return;const v=()=>{if(!A)return;const ee=h.parentElement;if(!ee)return;const{width:$,height:le}=h.getBoundingClientRect(),{inner:f}=be(ee,"horizontal"),{inner:Z}=be(ee,"vertical"),ce=d==="horizontal"?$:le,se=d==="horizontal"?f:Z,ue=Xe(se);if(U){W.current!==0&&(W.current=0,K(0)),q.current!==0&&(q.current=0,J(0));return}const he=A?.size??0,ge=Math.max(2,ue*.5);if(!U&&he>ue&&ce<ge){console.debug("[resize-panels] skip noisy measurement",{panelId:X.current,expectedPanelSize:he,measured:ce,noiseThreshold:ge});return}if(ce>0){if(N(ce),se>0){const xe=ce/se*100;G(xe)}}else if(A?.size!==void 0&&N(A.size),A?.percentageSize!==void 0){const xe=A.percentageSize;G(xe)}else if(A?.sizeUnit==="pixels"&&A?.size!==void 0&&se>0){const xe=A.size/se*100;G(xe)}},L=new ResizeObserver(()=>{v()});L.observe(h),v();const B=[],F=new MutationObserver(()=>{(()=>{if(!H.current)return!1;const $=H.current.getBoundingClientRect();return(d==="horizontal"?$.width:$.height)!==W.current})()&&setTimeout(v,0)}),re=h.parentElement;return re&&F.observe(re,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["style","class"]}),()=>{L.disconnect(),F.disconnect();for(const ee of B)clearTimeout(ee)}},[d,A,U,N,G]);const ie=A?.size,I=A?.percentageSize,r=A?.sizeUnit;m.useEffect(()=>{if(A){if(U){W.current!==0&&(W.current=0,K(0)),q.current!==0&&(q.current=0,J(0));return}if(ie!==void 0&&N(ie),I!==void 0)G(I);else if(r==="pixels"&&ie!==void 0){const h=H.current,v=h?.parentElement;if(h&&v){const{width:L,height:B}=h.getBoundingClientRect(),F=v.clientWidth,re=v.clientHeight,ee=d==="horizontal"?L:B,$=d==="horizontal"?F:re;if(ee>0&&$>0){const le=ee/$*100;G(le)}}}}},[ie,I,r,d,U,N,G,A]),m.useEffect(()=>{g(X.current,{pixelSize:V,percentageSize:ne})},[g,V,ne]);const S=()=>U?"0px":A?.originalPixelSize!==void 0?`${E}px`:A?.percentageSize!==void 0?`${A.percentageSize}%`:`${E}px`,M=(()=>{if(!w||w.length===0)return!1;const h=w.filter(B=>B.sizeUnit==="percentage");if(h.length===0||h[h.length-1]?.id!==X.current)return!1;const L=A?.percentageSize;return!(L!==void 0&&h.filter(F=>Math.abs((F.percentageSize||0)-L)<.01).length>1)})(),T=A?.sizeUnit==="percentage"&&!A?.collapsed?1:0,Y={flexBasis:S(),flexGrow:M?1:0,flexShrink:T,overflow:"hidden",position:"relative",boxSizing:"border-box",minHeight:"0px",minWidth:"0px",...s};d==="horizontal"?(Y.height="100%",Y.minWidth=0):(Y.width="100%",Y.minHeight=0),U&&(d==="horizontal"?(Y.width="0px",Y.minWidth="0px"):(Y.height="0px",Y.minHeight="0px"),Y.flexGrow=0,Y.flexShrink=0,Y.pointerEvents="none",Y.visibility="hidden",te&&(Y.display="none"));const y=d==="horizontal"?_.width:_.height,b=m.useMemo(()=>({position:"absolute",inset:"0px",overflow:"auto",display:"flex",flexDirection:"column",width:"100%",height:"100%",minWidth:"0px",minHeight:"0px"}),[]);return D.jsxs("div",{ref:H,className:Oe("panel",i),style:Y,"data-panel-id":X.current,"data-panel-size":E,"data-panel-size-unit":A?.sizeUnit||"percentage","data-panel-pixel-size":A?.sizeUnit==="pixels"?A?.originalPixelSize:null,"data-panel-order":l,"data-panel-collapsible":c,"data-panel-collapsed":A?.collapsed,"aria-hidden":U,children:[D.jsx("div",{style:b,children:a}),k&&D.jsx(On,{panel:A,isLastFlexiblePanel:M,measuredPixelSize:V,measuredPercentageSize:ne,containerAxisSize:y,direction:d})]})}),Bn=e=>JSON.stringify(e.map(t=>({id:t.id,size:t.size,percentageSize:t.percentageSize??null,sizeUnit:t.sizeUnit,originalPixelSize:t.originalPixelSize??null,minSize:t.minSize??null,maxSize:t.maxSize??null,collapsible:t.collapsible??!1,collapsed:t.collapsed??!1,sizeBeforeCollapse:t.sizeBeforeCollapse??null,measuredPixelSizeBeforeCollapse:t.measuredPixelSizeBeforeCollapse??null,pixelAdjustPriority:t.pixelAdjustPriority??null,measuredPixelSize:t.measuredPixelSize??null,measuredPercentageSize:t.measuredPercentageSize??null}))),Ln=e=>JSON.stringify(e.map(t=>({id:t.id,thickness:t.thickness,visible:t.visible,direction:t.direction,startPanelId:t.startPanelId??null,endPanelId:t.endPanelId??null}))),ze=(()=>{const e=new Set,t=new Map,n=new Set;let o=null,i=0,s=!0,a=[],l={ownerId:null,groups:a};const c=()=>{for(const p of e)p()},P=()=>{s=!0,c()},z=()=>{const p=o;if(p&&n.has(p))return!1;o=null;const g=n.values().next();return g.done||(o=g.value),p!==o};return{subscribe:p=>(e.add(p),()=>{e.delete(p)}),getSnapshot:()=>(z()&&(s=!0),s&&(a=Array.from(t.values()).sort((g,_)=>g.index-_.index).map(({serializedPanels:g,serializedHandles:_,...H})=>H),l={ownerId:o,groups:a},s=!1),l),getOwnerId:()=>(z()&&(s=!0),o),enableGroup:p=>{const g=n.size;n.add(p),n.size!==g&&z()&&P()},disableGroup:p=>{n.delete(p)&&z()&&P()},updateGroup:(p,g)=>{const _=t.get(p),H=_?.index??i++,X=Bn(g.panels),A=Ln(g.handles),te=_?.displayName!==g.displayName,R=_?.direction!==g.direction,U=_?_.containerSize.width!==g.containerSize.width||_.containerSize.height!==g.containerSize.height:!0;let V=_?.serializedPanels!==X;if(!V&&_)if(_.panels.length!==g.panels.length)V=!0;else for(let W=0;W<g.panels.length;W+=1){const N=_.panels[W],G=g.panels[W];if(!(N&&G)){V=!0;break}if(N.id!==G.id||N.size!==G.size||N.percentageSize!==G.percentageSize||N.collapsed!==G.collapsed||N.measuredPixelSize!==G.measuredPixelSize||N.measuredPercentageSize!==G.measuredPercentageSize){V=!0;break}}let K=_?.serializedHandles!==A;if(!K&&_)if(_.handles.length!==g.handles.length)K=!0;else for(let W=0;W<g.handles.length;W+=1){const N=_.handles[W],G=g.handles[W];if(!(N&&G)){K=!0;break}if(N.id!==G.id||N.thickness!==G.thickness||N.visible!==G.visible||N.direction!==G.direction||N.startPanelId!==G.startPanelId||N.endPanelId!==G.endPanelId){K=!0;break}}if(!_&&g.panels.length===0&&g.handles.length===0||_&&!te&&!R&&!U&&!V&&!K)return;const ne=g.panels.map(W=>({...W})),J=g.handles.map(W=>({...W})),q={...g.containerSize};t.set(p,{groupId:p,displayName:g.displayName,direction:g.direction,containerSize:q,panels:ne,handles:J,index:H,serializedPanels:X,serializedHandles:A}),P()},removeGroup:p=>{const g=t.delete(p),_=n.delete(p),H=z();(g||_||H)&&P()}}})(),Dn=()=>m.useSyncExternalStore(ze.subscribe,ze.getOwnerId,ze.getOwnerId),Gn=()=>m.useSyncExternalStore(ze.subscribe,ze.getSnapshot,ze.getSnapshot),Fn=e=>{ze.enableGroup(e)},Ot=e=>{ze.disableGroup(e)},Hn=(e,t)=>{ze.updateGroup(e,t)},jt=e=>{ze.removeGroup(e)};let Bt=0;const Wn=()=>(Bt+=1,`panel-group-${Bt}`),Lt=(e,t)=>typeof e!="number"||!Number.isFinite(e)?"—":`${(e<0?0:e).toFixed(8)}${t}`,We=e=>Lt(e,"px"),Dt=e=>Lt(e,"%"),Un=e=>{const{id:t,className:n,style:o,children:i,direction:s}=e,{groupRef:a,contextValue:l,groupStyle:c}=xt(e),[P,z]=m.useState({width:0,height:0}),d=l.layoutConstraintViolation,u=!!d,x=u&&d?D.jsxs("div",{className:"flex w-full flex-1 flex-col items-center justify-center gap-2 rounded-lg border border-slate-300 border-dashed bg-slate-100/70 px-6 py-8 text-center text-slate-600 text-sm dark:border-slate-600 dark:bg-slate-800/50 dark:text-slate-200","data-panel-group-placeholder":"constraint-violation",children:[D.jsx("span",{children:d.reason==="minimum-exceeded"?"Layout unavailable: minimum panel sizes exceed the container.":"Layout unavailable: panels cannot fill the container with their maximum sizes."}),D.jsx("span",{className:"text-slate-500 text-xs dark:text-slate-400",children:d.reason==="minimum-exceeded"?`Min required: ${Math.ceil(d.totalMinimumSize??0)}px | Available: ${Math.floor(d.availableContainerSize)}px`:`Max total: ${Math.floor(d.totalMaximumSize??0)}px | Needed: ${Math.floor(d.availableContainerSize)}px`})]}):null,k=m.useRef(t??Wn()).current,w=t??k,p=l.showDebugInfo&&l.panels.length>0,g=p?l.panels:[],_=p?l.panelMeasurements:{},H=m.useMemo(()=>{if(!p)return[];const K=Object.values(l.handleMeasurements);return K.length<=1?K:K.slice().sort((ne,J)=>ne.id.localeCompare(J.id))},[l.handleMeasurements,p]),X=l.containerSize,A=P.width>0?P.width:X.width,te=P.height>0?P.height:X.height,R=Dn(),U=p&&R===k;m.useLayoutEffect(()=>{if(!p){z({width:0,height:0});return}if(typeof window>"u"||typeof ResizeObserver>"u")return;const K=a.current;if(!K)return;const ne=new ResizeObserver(E=>{for(const ie of E){if(ie.target!==K)continue;const I=ie.target,r=I?be(I,"horizontal"):null,S=I?be(I,"vertical"):null,M=r?r.inner:0,T=S?S.inner:0,Y=ie.contentRect.width,y=ie.contentRect.height,b=M>0?M:Y,h=T>0?T:y;z(v=>v.width===b&&v.height===h?v:{width:b,height:h})}});ne.observe(K);const{inner:J}=be(K,"horizontal"),{inner:q}=be(K,"vertical"),W=K.getBoundingClientRect(),N=J>0?J:W.width,G=q>0?q:W.height;return z({width:N,height:G}),()=>{ne.disconnect()}},[a,p]);const V=m.useMemo(()=>{if(g.length===0)return g;let K=!1;const ne=g.map(J=>{const q=_[J.id];return!q||J.measuredPixelSize===q.pixelSize&&J.measuredPercentageSize===q.percentageSize?J:(K=!0,{...J,measuredPixelSize:q.pixelSize,measuredPercentageSize:q.percentageSize})});return K?ne:g},[g,_]);return m.useEffect(()=>{if(!p){Ot(k),jt(k);return}return Fn(k),()=>{Ot(k),jt(k)}},[p,k]),m.useEffect(()=>{p&&Hn(k,{displayName:w,direction:s,containerSize:{width:A,height:te},panels:V,handles:H})},[p,k,w,s,A,te,V,H]),D.jsxs(Ve.Provider,{value:l,children:[D.jsx("div",{ref:a,className:Oe("panel-group",s==="horizontal"?"flex-row":"flex-col",n),style:{...c,...o},"data-panel-group-id":t,"data-panel-group-direction":s,children:u?x:i}),U&&D.jsx(Vn,{})]})},Vn=()=>{const t=Gn().groups,[n,o]=m.useState(!0);if(t.length===0||typeof document>"u")return null;const i=t.reduce((c,P)=>c+P.panels.length,0),s=t.reduce((c,P)=>c+(P.handles?.length??0),0),a=()=>{o(c=>!c)},l=D.jsxs("div",{style:{position:"fixed",left:"50%",bottom:"20px",transform:"translate(-50%, 0)",zIndex:100,maxWidth:"min(90vw, 1120px)",width:"100%",padding:n?"10px 18px":"14px 18px",borderRadius:"14px",backgroundColor:"rgba(15, 23, 42, 0.72)",color:"#e2e8f0",fontFamily:"monospace",fontSize:"11px",lineHeight:1.6,boxShadow:"0 22px 45px rgba(15,23,42,0.45)",border:"1px solid rgba(148, 163, 184, 0.22)",backdropFilter:"blur(10px)",WebkitBackdropFilter:"blur(10px)",pointerEvents:"auto",overflow:"auto",maxHeight:n?"52px":"min(65vh, 520px)",transition:"max-height 0.24s ease, padding 0.24s ease"},children:[D.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",flexWrap:"wrap",gap:"12px",marginBottom:n?0:"12px"},children:[D.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"4px"},children:[D.jsx("span",{style:{fontWeight:700,fontSize:"12px",letterSpacing:"0.03em"},children:"Panel Overview"}),D.jsxs("span",{style:{color:"#cbd5f5"},children:["groups: ",t.length," / panels: ",i," / resizers: ",s]})]}),D.jsx("button",{type:"button",onClick:()=>a(),style:{padding:"6px 10px",borderRadius:"9999px",border:"1px solid rgba(148, 163, 184, 0.35)",backgroundColor:n?"rgba(59, 130, 246, 0.2)":"rgba(71, 85, 105, 0.45)",color:"#e2e8f0",fontWeight:600,fontSize:"10px",letterSpacing:"0.03em",textTransform:"uppercase",cursor:"pointer",transition:"background-color 0.18s ease, 0.18s ease border-color"},title:n?"Panel Overview を開く":"Panel Overview を閉じる",children:n?"開く":"閉じる"})]}),!n&&D.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"12px",maxHeight:"45vh",overflowY:"auto",paddingRight:"6px"},children:t.map((c,P)=>{const z=c.direction==="horizontal"?c.containerSize.width:c.containerSize.height;return D.jsxs("div",{style:{padding:"10px 12px",borderRadius:"10px",backgroundColor:"rgba(30, 41, 59, 0.55)",border:"1px solid rgba(148, 163, 184, 0.18)",display:"flex",flexDirection:"column",gap:"10px"},children:[D.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",flexWrap:"wrap",gap:"10px",color:"#dbeafe"},children:[D.jsxs("span",{style:{fontWeight:600,fontSize:"11px",letterSpacing:"0.02em",textTransform:"uppercase"},children:["group ",P+1,": ",c.displayName]}),D.jsxs("span",{children:["direction: ",c.direction," / container: ",We(c.containerSize.width)," × ",We(c.containerSize.height)]})]}),D.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(220px, 1fr))",gap:"10px"},children:c.panels.map((d,u)=>{const x=d.measuredPixelSize??d.size,C=d.size,k=We(C),w=d.percentageSize??(z>0?d.size/z*100:void 0),p=d.measuredPercentageSize!==void 0?d.measuredPercentageSize:z>0?x/z*100:void 0,g=d.collapsed||x<=it,_=d.collapsed?"collapsed":g?"hidden":"visible",H=Dt(w),X=Dt(p),A=We(x);return D.jsxs("div",{style:{padding:"8px 10px",borderRadius:"8px",backgroundColor:"rgba(15, 23, 42, 0.55)",border:"1px solid rgba(148, 163, 184, 0.16)",display:"flex",flexDirection:"column",gap:"4px"},children:[D.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",gap:"6px"},children:[D.jsx("span",{style:{flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis"},children:d.id}),D.jsx("span",{style:{padding:"2px 6px",borderRadius:"9999px",fontSize:"10px",textTransform:"uppercase",backgroundColor:d.collapsed?"rgba(251, 113, 133, 0.25)":g?"rgba(250, 204, 21, 0.25)":"rgba(74, 222, 128, 0.25)",color:d.collapsed?"#fecdd3":g?"#fef08a":"#bbf7d0"},children:_})]}),D.jsxs("div",{style:{display:"grid",gridTemplateColumns:"auto 1fr",gap:"2px 10px",color:"#e2e8f0"},children:[D.jsx("span",{children:"size (state):"}),D.jsx("span",{children:k}),D.jsx("span",{children:"size (measured):"}),D.jsx("span",{children:A}),D.jsx("span",{children:"percentage (state):"}),D.jsx("span",{children:H}),D.jsx("span",{children:"percentage (measured):"}),D.jsx("span",{children:X}),D.jsx("span",{children:"unit:"}),D.jsx("span",{children:d.sizeUnit}),D.jsx("span",{children:"min:"}),D.jsx("span",{children:d.minSize!==void 0?JSON.stringify(d.minSize):"—"}),D.jsx("span",{children:"max:"}),D.jsx("span",{children:d.maxSize!==void 0?JSON.stringify(d.maxSize):"—"}),D.jsx("span",{children:"priority:"}),D.jsx("span",{children:d.pixelAdjustPriority??"—"})]})]},d.id||u)})})]},c.groupId)})})]});return Wt.createPortal(l,document.body)},Yn=m.memo(({id:e,disabled:t=!1,className:n,style:o,children:i,onDragging:s})=>{const{direction:a,resizePanels:l,getPanel:c,collapsePanel:P,expandPanel:z,panels:d,reportHandleMeasurement:u,containerSize:x}=Be(),[C,k]=m.useState(!1),w=m.useRef(null),p=m.useRef(null),g=m.useRef(""),_=m.useRef(""),[H,X]=m.useState({left:null,right:null}),A=m.useRef(e??Zt()),te=m.useRef(null),R=e??A.current;m.useEffect(()=>{if(w.current){const y=w.current.parentElement;if(y){p.current=y;const b=Array.from(y.children),h=w.current,v=b.indexOf(h);if(v>0&&v<b.length-1){let L=null,B=null;for(let F=v-1;F>=0;F-=1){const re=b[F];if(re.dataset.panelId){L=re;break}}for(let F=v+1;F<b.length;F+=1){const re=b[F];if(re.dataset.panelId){B=re;break}}g.current=L?.dataset.panelId||"",_.current=B?.dataset.panelId||"",X({left:g.current||null,right:_.current||null})}}}},[]),m.useEffect(()=>{if(R===A.current)return;const y=A.current;A.current=R,te.current=null,y!==R&&u(y,null)},[u,R]),m.useEffect(()=>{const y=A.current;return()=>{u(y,null)}},[u]);const U=m.useCallback(y=>{if(t||!p.current)return;y.preventDefault(),y.stopPropagation();const b=p.current,{inner:h}=be(b,a),v={x:y.clientX,y:y.clientY},L=c(g.current),B=c(_.current);if(!(L&&B))return;const F=L.size,re=B.size;let ee=0;const $=Vt;k(!0),s?.(!0),y.currentTarget.setPointerCapture(y.pointerId);const le=Z=>{if(!w.current)return;Z.preventDefault(),Z.stopPropagation();const ce=performance.now();if(ce-ee<$)return;ee=ce;const se=a==="horizontal"?Z.clientX-v.x:Z.clientY-v.y;if(se===0)return;const ue=F+se,he=re-se,ge=c(g.current),me=c(_.current);if(ge&&me&&g.current&&_.current){const xe=oe(ge.minSize,0,h),ke=oe(me.minSize,0,h),Se=xe,ve=ke,Gt=Math.min(h*st,at),Ft=Math.min(h*Yt,Xt);if(me.collapsible&&!me.collapsed&&he<=Math.max(ke*.3,Gt)){P(_.current);return}if(ge.collapsible&&!ge.collapsed&&ue<=Math.max(xe*.3,Gt)){P(g.current);return}if(me.collapsed&&he>Math.max(ke*.3,Ft)){z(_.current,he);return}if(ge.collapsed&&ue>Math.max(xe*.3,Ft)){z(g.current,ue);return}if(h>0){const Ht=ge.size+me.size,Ue=Xe(h);let nt=!1;if(Se<=Ue&&ue<=Ue&&F!==0){const je=Math.max(0,Ht-0);je>=ve&&(l(g.current,_.current,0,je),nt=!0)}else if(ve<=Ue&&he<=Ue&&re!==0){const je=Math.max(0,Ht-0);je>=Se&&(l(g.current,_.current,je,0),nt=!0)}if(nt)return}if(ge.collapsed||me.collapsed)return;l(g.current,_.current,ue,he)}},f=()=>{k(!1),s?.(!1),document.removeEventListener("pointermove",le),document.removeEventListener("pointerup",f)};document.addEventListener("pointermove",le),document.addEventListener("pointerup",f)},[t,a,l,c,P,z,s]),V=a==="horizontal",ne=Oe("group absolute z-20 flex select-none items-center justify-center border-none bg-transparent transition-colors duration-150 overflow-visible",V?"cursor-col-resize":"cursor-row-resize",V?"h-full":"w-full",!t&&"hover:bg-gray-200/70 dark:hover:bg-gray-700/70",!t&&"active:bg-blue-300/60 dark:active:bg-blue-700/60",C&&"bg-blue-200/80 dark:bg-blue-800/60",t&&"cursor-not-allowed opacity-50","focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-opacity-50",n),J=m.useMemo(()=>{const y=b=>{if(!b)return-1;for(let h=0;h<d.length;h+=1)if(d[h].id===b)return h;return-1};return{left:y(H.left),right:y(H.right)}},[H.left,H.right,d]),q=V?x.width:x.height,W=m.useMemo(()=>{const y=(b,h)=>{if(b>h)return 0;let v=0;for(let L=b;L<=h;L+=1){const B=d[L];if(!B)continue;const F=B.size??0,re=Math.max(0,F);v+=B.collapsed?0:re}return v};return J.left>=0?y(0,J.left):J.right>0?y(0,J.right-1):0},[J.left,J.right,d]),N=m.useMemo(()=>!Number.isFinite(W)||W<0?0:q>0&&W>q?q:W,[W,q]),G=m.useMemo(()=>{const y={position:"absolute",zIndex:20,touchAction:"none"};return V?(y.top=0,y.left=`${N}px`,y.transform="translateX(-50%)",y.width=`${ot}px`,y.height="100%"):(y.left=0,y.top=`${N}px`,y.transform="translateY(-50%)",y.height=`${ot}px`,y.width="100%"),y},[N,V]),E=m.useMemo(()=>{const y=Xe(q),b=$=>{if($<0||$>=d.length)return!1;const le=d[$];return le?le.collapsed?!0:le.size<=y:!1},h=($,le)=>{if(!b($))return 0;let f=0;for(let Z=$;Z>=0&&Z<d.length&&b(Z);Z+=le)f+=1;return f},v=J.left,L=J.right,B=v>=0?h(v,-1):0,F=L>=0?h(L,1):0;return{groupSize:B+F+1,overlapIndex:B}},[J.left,J.right,d,q]),ie=m.useMemo(()=>{if(E.groupSize<=1)return!1;const y=E.groupSize-1;return E.overlapIndex>0&&E.overlapIndex<y},[E]),I=m.useMemo(()=>{if(E.groupSize<=1||ie)return 0;const y=E.groupSize>1?2:1;if(y===1)return 0;const b=E.overlapIndex===0?0:y-1,h=(y-1)/2;return(b-h)*Ut},[E,ie]),r=m.useMemo(()=>{if(ie)return{display:"none"};if(I!==0)return V?{transform:`translateX(${I}px)`}:{transform:`translateY(${I}px)`}},[I,V,ie]),S=Oe("flex items-center justify-center rounded-full bg-white text-slate-700 ring-1 ring-inset ring-white/80 backdrop-blur-sm transition-colors duration-150 shadow-[0_0_0_1px_rgba(255,255,255,0.85),0_1px_3px_rgba(15,23,42,0.18)]","dark:bg-slate-800/95 dark:text-slate-200 dark:ring-slate-500/60 dark:shadow-[0_0_0_1px_rgba(148,163,184,0.45),0_1px_3px_rgba(2,6,23,0.55)]",V?"h-12 w-[6px] px-[2px]":"h-[6px] w-20 py-[2px]",C&&"bg-blue-200/80 ring-blue-300 shadow-[0_0_0_1px_rgba(191,219,254,0.65),0_1px_4px_rgba(59,130,246,0.45)] dark:bg-blue-900/70 dark:ring-blue-400 dark:shadow-[0_0_0_1px_rgba(147,197,253,0.5),0_1px_4px_rgba(59,130,246,0.55)]"),M=Oe("rounded-full bg-slate-600 transition-colors duration-150 shadow-[0_0_0_1px_rgba(255,255,255,0.9)] dark:bg-slate-200 dark:shadow-[0_0_0_1px_rgba(15,23,42,0.55)]",V?"h-8 w-[2px]":"h-[2px] w-16",C&&"bg-blue-500 dark:bg-blue-300",!t&&"group-hover:bg-slate-700 dark:group-hover:bg-slate-100"),T=m.useCallback(()=>{const y=w.current;if(!y)return;let b=0;if(!ie){const L=a==="horizontal"?y.offsetWidth:y.offsetHeight;let B=0,F=0;if(typeof window<"u"){const ee=window.getComputedStyle(y);a==="horizontal"?(B=Number.parseFloat(ee.marginLeft||"0"),F=Number.parseFloat(ee.marginRight||"0")):(B=Number.parseFloat(ee.marginTop||"0"),F=Number.parseFloat(ee.marginBottom||"0"))}b=[L,B,F].reduce((ee,$)=>Number.isFinite($)?ee+$:ee,0)}(!Number.isFinite(b)||b<0)&&(b=0);const h={id:R,thickness:b,direction:a,visible:!ie&&b>Jt,startPanelId:H.left,endPanelId:H.right},v=te.current;v&&Math.abs(v.thickness-h.thickness)<=.25&&v.visible===h.visible&&v.direction===h.direction&&v.startPanelId===h.startPanelId&&v.endPanelId===h.endPanelId||(te.current=h,u(R,h))},[a,H.left,H.right,u,R,ie]);m.useEffect(()=>{T()},[T]),m.useEffect(()=>{const y=w.current;if(!y)return;if(typeof ResizeObserver>"u"){T();return}const b=new ResizeObserver(()=>{T()});return b.observe(y),()=>{b.disconnect()}},[T]);const Y=m.useMemo(()=>{const y=o?{...G,...o}:G;return ie?{...y,display:"none",pointerEvents:"none",visibility:"hidden"}:y},[G,ie,o]);return D.jsx("button",{type:"button",ref:w,className:ne,style:Y,onPointerDown:U,disabled:t,"aria-hidden":ie||void 0,"aria-label":`Resize ${V?"columns":"rows"} - Drag to collapse/expand panels`,"data-resize-handle-id":R,title:`ドラッグして${V?"列":"行"}をリサイズ、端まで移動して折りたたみ/展開`,children:i||D.jsx("div",{className:S,style:r,children:D.jsx("span",{className:M})})})}),Xn=e=>document.querySelector(`[data-panel-id="${e}"]`),Jn=e=>document.querySelector(`[data-panel-group-id="${e}"]`),Zn=e=>document.querySelector(`[data-resize-handle-id="${e}"]`);ae.Panel=jn,ae.PanelGroup=Un,ae.PanelGroupContext=Ve,ae.PanelResizeHandle=Yn,ae.clamp=pe,ae.generatePanelId=pt,ae.getConstraintInPixels=oe,ae.getContainerSize=be,ae.getPanelElement=Xn,ae.getPanelGroupElement=Jn,ae.getResizeHandleElement=Zn,ae.loadLayout=gt,ae.normalizeSizeConfig=Ee,ae.saveLayout=mt,ae.usePanelControls=Kt,ae.usePanelGroup=Be,ae.useResizablePanels=xt,Object.defineProperty(ae,Symbol.toStringTag,{value:"Module"})}));
|
|
22
|
+
<%s key={someKey} {...props} />`,N,z,D,z),R[z+N]=!0)}if(z=null,_!==void 0&&(n(_),z=""+_),a(P)&&(n(P.key),z=""+P.key),"key"in P){_={};for(var h in P)h!=="key"&&(_[h]=P[h])}else _=P;return z&&l(_,typeof r=="function"?r.displayName||r.name||"Unknown":r),y(r,z,_,i(),te,g)}function f(r){d(r)?r._store&&(r._store.validated=1):typeof r=="object"&&r!==null&&r.$$typeof===Q&&(r._payload.status==="fulfilled"?d(r._payload.value)&&r._payload.value._store&&(r._payload.value._store.validated=1):r._store&&(r._store.validated=1))}function d(r){return typeof r=="object"&&r!==null&&r.$$typeof===w}var x=m,w=Symbol.for("react.transitional.element"),C=Symbol.for("react.portal"),k=Symbol.for("react.fragment"),p=Symbol.for("react.strict_mode"),b=Symbol.for("react.profiler"),E=Symbol.for("react.consumer"),U=Symbol.for("react.context"),K=Symbol.for("react.forward_ref"),W=Symbol.for("react.suspense"),B=Symbol.for("react.suspense_list"),M=Symbol.for("react.memo"),Q=Symbol.for("react.lazy"),H=Symbol.for("react.activity"),J=Symbol.for("react.client.reference"),ne=x.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,X=Object.prototype.hasOwnProperty,ee=Array.isArray,V=console.createTask?console.createTask:function(){return null};x={react_stack_bottom_frame:function(r){return r()}};var I,G={},v=x.react_stack_bottom_frame.bind(x,s)(),oe=V(o(s)),R={};Ne.Fragment=k,Ne.jsx=function(r,P,_){var N=1e4>ne.recentlyCreatedOwnerStacks++;return S(r,P,_,!1,N?Error("react-stack-top-frame"):v,N?V(o(r)):oe)},Ne.jsxs=function(r,P,_){var N=1e4>ne.recentlyCreatedOwnerStacks++;return S(r,P,_,!0,N?Error("react-stack-top-frame"):v,N?V(o(r)):oe)}})()),Ne}var St;function en(){return St||(St=1,process.env.NODE_ENV==="production"?Ge.exports=qt():Ge.exports=$t()),Ge.exports}var L=en();const Qe="-",tn=e=>{const t=rn(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:o}=e;return{getClassGroupId:a=>{const l=a.split(Qe);return l[0]===""&&l.length!==1&&l.shift(),Pt(l,t)||nn(a)},getConflictingClassGroupIds:(a,l)=>{const c=n[a]||[];return l&&o[a]?[...c,...o[a]]:c}}},Pt=(e,t)=>{if(e.length===0)return t.classGroupId;const n=e[0],o=t.nextPart.get(n),i=o?Pt(e.slice(1),o):void 0;if(i)return i;if(t.validators.length===0)return;const s=e.join(Qe);return t.validators.find(({validator:a})=>a(s))?.classGroupId},yt=/^\[(.+)\]$/,nn=e=>{if(yt.test(e)){const t=yt.exec(e)[1],n=t?.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},rn=e=>{const{theme:t,classGroups:n}=e,o={nextPart:new Map,validators:[]};for(const i in n)Ke(n[i],o,i,t);return o},Ke=(e,t,n,o)=>{e.forEach(i=>{if(typeof i=="string"){const s=i===""?t:vt(t,i);s.classGroupId=n;return}if(typeof i=="function"){if(on(i)){Ke(i(o),t,n,o);return}t.validators.push({validator:i,classGroupId:n});return}Object.entries(i).forEach(([s,a])=>{Ke(a,vt(t,s),n,o)})})},vt=(e,t)=>{let n=e;return t.split(Qe).forEach(o=>{n.nextPart.has(o)||n.nextPart.set(o,{nextPart:new Map,validators:[]}),n=n.nextPart.get(o)}),n},on=e=>e.isThemeGetter,sn=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,o=new Map;const i=(s,a)=>{n.set(s,a),t++,t>e&&(t=0,o=n,n=new Map)};return{get(s){let a=n.get(s);if(a!==void 0)return a;if((a=o.get(s))!==void 0)return i(s,a),a},set(s,a){n.has(s)?n.set(s,a):i(s,a)}}},qe="!",$e=":",an=$e.length,ln=e=>{const{prefix:t,experimentalParseClassName:n}=e;let o=i=>{const s=[];let a=0,l=0,c=0,y;for(let w=0;w<i.length;w++){let C=i[w];if(a===0&&l===0){if(C===$e){s.push(i.slice(c,w)),c=w+an;continue}if(C==="/"){y=w;continue}}C==="["?a++:C==="]"?a--:C==="("?l++:C===")"&&l--}const S=s.length===0?i:i.substring(c),f=cn(S),d=f!==S,x=y&&y>c?y-c:void 0;return{modifiers:s,hasImportantModifier:d,baseClassName:f,maybePostfixModifierPosition:x}};if(t){const i=t+$e,s=o;o=a=>a.startsWith(i)?s(a.substring(i.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:a,maybePostfixModifierPosition:void 0}}if(n){const i=o;o=s=>n({className:s,parseClassName:i})}return o},cn=e=>e.endsWith(qe)?e.substring(0,e.length-1):e.startsWith(qe)?e.substring(1):e,dn=e=>{const t=Object.fromEntries(e.orderSensitiveModifiers.map(o=>[o,!0]));return o=>{if(o.length<=1)return o;const i=[];let s=[];return o.forEach(a=>{a[0]==="["||t[a]?(i.push(...s.sort(),a),s=[]):s.push(a)}),i.push(...s.sort()),i}},un=e=>({cache:sn(e.cacheSize),parseClassName:ln(e),sortModifiers:dn(e),...tn(e)}),fn=/\s+/,pn=(e,t)=>{const{parseClassName:n,getClassGroupId:o,getConflictingClassGroupIds:i,sortModifiers:s}=t,a=[],l=e.trim().split(fn);let c="";for(let y=l.length-1;y>=0;y-=1){const S=l[y],{isExternal:f,modifiers:d,hasImportantModifier:x,baseClassName:w,maybePostfixModifierPosition:C}=n(S);if(f){c=S+(c.length>0?" "+c:c);continue}let k=!!C,p=o(k?w.substring(0,C):w);if(!p){if(!k){c=S+(c.length>0?" "+c:c);continue}if(p=o(w),!p){c=S+(c.length>0?" "+c:c);continue}k=!1}const b=s(d).join(":"),E=x?b+qe:b,U=E+p;if(a.includes(U))continue;a.push(U);const K=i(p,k);for(let W=0;W<K.length;++W){const B=K[W];a.push(E+B)}c=S+(c.length>0?" "+c:c)}return c};function mn(){let e=0,t,n,o="";for(;e<arguments.length;)(t=arguments[e++])&&(n=wt(t))&&(o&&(o+=" "),o+=n);return o}const wt=e=>{if(typeof e=="string")return e;let t,n="";for(let o=0;o<e.length;o++)e[o]&&(t=wt(e[o]))&&(n&&(n+=" "),n+=t);return n};function gn(e,...t){let n,o,i,s=a;function a(c){const y=t.reduce((S,f)=>f(S),e());return n=un(y),o=n.cache.get,i=n.cache.set,s=l,l(c)}function l(c){const y=o(c);if(y)return y;const S=pn(c,n);return i(c,S),S}return function(){return s(mn.apply(null,arguments))}}const de=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},Ct=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,kt=/^\((?:(\w[\w-]*):)?(.+)\)$/i,hn=/^\d+\/\d+$/,xn=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,bn=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,zn=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Sn=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Pn=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ee=e=>hn.test(e),Z=e=>!!e&&!Number.isNaN(Number(e)),ye=e=>!!e&&Number.isInteger(Number(e)),et=e=>e.endsWith("%")&&Z(e.slice(0,-1)),Pe=e=>xn.test(e),yn=()=>!0,vn=e=>bn.test(e)&&!zn.test(e),Et=()=>!1,wn=e=>Sn.test(e),Cn=e=>Pn.test(e),kn=e=>!T(e)&&!O(e),En=e=>Me(e,At,Et),T=e=>Ct.test(e),Ce=e=>Me(e,Nt,vn),tt=e=>Me(e,An,Z),Mt=e=>Me(e,_t,Et),Mn=e=>Me(e,It,Cn),Fe=e=>Me(e,Tt,wn),O=e=>kt.test(e),Te=e=>Re(e,Nt),Rn=e=>Re(e,Nn),Rt=e=>Re(e,_t),_n=e=>Re(e,At),In=e=>Re(e,It),He=e=>Re(e,Tt,!0),Me=(e,t,n)=>{const o=Ct.exec(e);return o?o[1]?t(o[1]):n(o[2]):!1},Re=(e,t,n=!1)=>{const o=kt.exec(e);return o?o[1]?t(o[1]):n:!1},_t=e=>e==="position"||e==="percentage",It=e=>e==="image"||e==="url",At=e=>e==="length"||e==="size"||e==="bg-size",Nt=e=>e==="length",An=e=>e==="number",Nn=e=>e==="family-name",Tt=e=>e==="shadow",Oe=gn(()=>{const e=de("color"),t=de("font"),n=de("text"),o=de("font-weight"),i=de("tracking"),s=de("leading"),a=de("breakpoint"),l=de("container"),c=de("spacing"),y=de("radius"),S=de("shadow"),f=de("inset-shadow"),d=de("text-shadow"),x=de("drop-shadow"),w=de("blur"),C=de("perspective"),k=de("aspect"),p=de("ease"),b=de("animate"),E=()=>["auto","avoid","all","avoid-page","page","left","right","column"],U=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],K=()=>[...U(),O,T],W=()=>["auto","hidden","clip","visible","scroll"],B=()=>["auto","contain","none"],M=()=>[O,T,c],Q=()=>[Ee,"full","auto",...M()],H=()=>[ye,"none","subgrid",O,T],J=()=>["auto",{span:["full",ye,O,T]},ye,O,T],ne=()=>[ye,"auto",O,T],X=()=>["auto","min","max","fr",O,T],ee=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],V=()=>["start","end","center","stretch","center-safe","end-safe"],I=()=>["auto",...M()],G=()=>[Ee,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...M()],v=()=>[e,O,T],oe=()=>[...U(),Rt,Mt,{position:[O,T]}],R=()=>["no-repeat",{repeat:["","x","y","space","round"]}],r=()=>["auto","cover","contain",_n,En,{size:[O,T]}],P=()=>[et,Te,Ce],_=()=>["","none","full",y,O,T],N=()=>["",Z,Te,Ce],te=()=>["solid","dashed","dotted","double"],g=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],z=()=>[Z,et,Rt,Mt],D=()=>["","none",w,O,T],h=()=>["none",Z,O,T],A=()=>["none",Z,O,T],j=()=>[Z,O,T],F=()=>[Ee,"full",...M()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Pe],breakpoint:[Pe],color:[yn],container:[Pe],"drop-shadow":[Pe],ease:["in","out","in-out"],font:[kn],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Pe],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Pe],shadow:[Pe],spacing:["px",Z],text:[Pe],"text-shadow":[Pe],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Ee,T,O,k]}],container:["container"],columns:[{columns:[Z,T,O,l]}],"break-after":[{"break-after":E()}],"break-before":[{"break-before":E()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:K()}],overflow:[{overflow:W()}],"overflow-x":[{"overflow-x":W()}],"overflow-y":[{"overflow-y":W()}],overscroll:[{overscroll:B()}],"overscroll-x":[{"overscroll-x":B()}],"overscroll-y":[{"overscroll-y":B()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:Q()}],"inset-x":[{"inset-x":Q()}],"inset-y":[{"inset-y":Q()}],start:[{start:Q()}],end:[{end:Q()}],top:[{top:Q()}],right:[{right:Q()}],bottom:[{bottom:Q()}],left:[{left:Q()}],visibility:["visible","invisible","collapse"],z:[{z:[ye,"auto",O,T]}],basis:[{basis:[Ee,"full","auto",l,...M()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Z,Ee,"auto","initial","none",T]}],grow:[{grow:["",Z,O,T]}],shrink:[{shrink:["",Z,O,T]}],order:[{order:[ye,"first","last","none",O,T]}],"grid-cols":[{"grid-cols":H()}],"col-start-end":[{col:J()}],"col-start":[{"col-start":ne()}],"col-end":[{"col-end":ne()}],"grid-rows":[{"grid-rows":H()}],"row-start-end":[{row:J()}],"row-start":[{"row-start":ne()}],"row-end":[{"row-end":ne()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":X()}],"auto-rows":[{"auto-rows":X()}],gap:[{gap:M()}],"gap-x":[{"gap-x":M()}],"gap-y":[{"gap-y":M()}],"justify-content":[{justify:[...ee(),"normal"]}],"justify-items":[{"justify-items":[...V(),"normal"]}],"justify-self":[{"justify-self":["auto",...V()]}],"align-content":[{content:["normal",...ee()]}],"align-items":[{items:[...V(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...V(),{baseline:["","last"]}]}],"place-content":[{"place-content":ee()}],"place-items":[{"place-items":[...V(),"baseline"]}],"place-self":[{"place-self":["auto",...V()]}],p:[{p:M()}],px:[{px:M()}],py:[{py:M()}],ps:[{ps:M()}],pe:[{pe:M()}],pt:[{pt:M()}],pr:[{pr:M()}],pb:[{pb:M()}],pl:[{pl:M()}],m:[{m:I()}],mx:[{mx:I()}],my:[{my:I()}],ms:[{ms:I()}],me:[{me:I()}],mt:[{mt:I()}],mr:[{mr:I()}],mb:[{mb:I()}],ml:[{ml:I()}],"space-x":[{"space-x":M()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":M()}],"space-y-reverse":["space-y-reverse"],size:[{size:G()}],w:[{w:[l,"screen",...G()]}],"min-w":[{"min-w":[l,"screen","none",...G()]}],"max-w":[{"max-w":[l,"screen","none","prose",{screen:[a]},...G()]}],h:[{h:["screen","lh",...G()]}],"min-h":[{"min-h":["screen","lh","none",...G()]}],"max-h":[{"max-h":["screen","lh",...G()]}],"font-size":[{text:["base",n,Te,Ce]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[o,O,tt]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",et,T]}],"font-family":[{font:[Rn,T,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[i,O,T]}],"line-clamp":[{"line-clamp":[Z,"none",O,tt]}],leading:[{leading:[s,...M()]}],"list-image":[{"list-image":["none",O,T]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",O,T]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:v()}],"text-color":[{text:v()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...te(),"wavy"]}],"text-decoration-thickness":[{decoration:[Z,"from-font","auto",O,Ce]}],"text-decoration-color":[{decoration:v()}],"underline-offset":[{"underline-offset":[Z,"auto",O,T]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:M()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",O,T]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",O,T]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:oe()}],"bg-repeat":[{bg:R()}],"bg-size":[{bg:r()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},ye,O,T],radial:["",O,T],conic:[ye,O,T]},In,Mn]}],"bg-color":[{bg:v()}],"gradient-from-pos":[{from:P()}],"gradient-via-pos":[{via:P()}],"gradient-to-pos":[{to:P()}],"gradient-from":[{from:v()}],"gradient-via":[{via:v()}],"gradient-to":[{to:v()}],rounded:[{rounded:_()}],"rounded-s":[{"rounded-s":_()}],"rounded-e":[{"rounded-e":_()}],"rounded-t":[{"rounded-t":_()}],"rounded-r":[{"rounded-r":_()}],"rounded-b":[{"rounded-b":_()}],"rounded-l":[{"rounded-l":_()}],"rounded-ss":[{"rounded-ss":_()}],"rounded-se":[{"rounded-se":_()}],"rounded-ee":[{"rounded-ee":_()}],"rounded-es":[{"rounded-es":_()}],"rounded-tl":[{"rounded-tl":_()}],"rounded-tr":[{"rounded-tr":_()}],"rounded-br":[{"rounded-br":_()}],"rounded-bl":[{"rounded-bl":_()}],"border-w":[{border:N()}],"border-w-x":[{"border-x":N()}],"border-w-y":[{"border-y":N()}],"border-w-s":[{"border-s":N()}],"border-w-e":[{"border-e":N()}],"border-w-t":[{"border-t":N()}],"border-w-r":[{"border-r":N()}],"border-w-b":[{"border-b":N()}],"border-w-l":[{"border-l":N()}],"divide-x":[{"divide-x":N()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":N()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...te(),"hidden","none"]}],"divide-style":[{divide:[...te(),"hidden","none"]}],"border-color":[{border:v()}],"border-color-x":[{"border-x":v()}],"border-color-y":[{"border-y":v()}],"border-color-s":[{"border-s":v()}],"border-color-e":[{"border-e":v()}],"border-color-t":[{"border-t":v()}],"border-color-r":[{"border-r":v()}],"border-color-b":[{"border-b":v()}],"border-color-l":[{"border-l":v()}],"divide-color":[{divide:v()}],"outline-style":[{outline:[...te(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Z,O,T]}],"outline-w":[{outline:["",Z,Te,Ce]}],"outline-color":[{outline:v()}],shadow:[{shadow:["","none",S,He,Fe]}],"shadow-color":[{shadow:v()}],"inset-shadow":[{"inset-shadow":["none",f,He,Fe]}],"inset-shadow-color":[{"inset-shadow":v()}],"ring-w":[{ring:N()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:v()}],"ring-offset-w":[{"ring-offset":[Z,Ce]}],"ring-offset-color":[{"ring-offset":v()}],"inset-ring-w":[{"inset-ring":N()}],"inset-ring-color":[{"inset-ring":v()}],"text-shadow":[{"text-shadow":["none",d,He,Fe]}],"text-shadow-color":[{"text-shadow":v()}],opacity:[{opacity:[Z,O,T]}],"mix-blend":[{"mix-blend":[...g(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":g()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Z]}],"mask-image-linear-from-pos":[{"mask-linear-from":z()}],"mask-image-linear-to-pos":[{"mask-linear-to":z()}],"mask-image-linear-from-color":[{"mask-linear-from":v()}],"mask-image-linear-to-color":[{"mask-linear-to":v()}],"mask-image-t-from-pos":[{"mask-t-from":z()}],"mask-image-t-to-pos":[{"mask-t-to":z()}],"mask-image-t-from-color":[{"mask-t-from":v()}],"mask-image-t-to-color":[{"mask-t-to":v()}],"mask-image-r-from-pos":[{"mask-r-from":z()}],"mask-image-r-to-pos":[{"mask-r-to":z()}],"mask-image-r-from-color":[{"mask-r-from":v()}],"mask-image-r-to-color":[{"mask-r-to":v()}],"mask-image-b-from-pos":[{"mask-b-from":z()}],"mask-image-b-to-pos":[{"mask-b-to":z()}],"mask-image-b-from-color":[{"mask-b-from":v()}],"mask-image-b-to-color":[{"mask-b-to":v()}],"mask-image-l-from-pos":[{"mask-l-from":z()}],"mask-image-l-to-pos":[{"mask-l-to":z()}],"mask-image-l-from-color":[{"mask-l-from":v()}],"mask-image-l-to-color":[{"mask-l-to":v()}],"mask-image-x-from-pos":[{"mask-x-from":z()}],"mask-image-x-to-pos":[{"mask-x-to":z()}],"mask-image-x-from-color":[{"mask-x-from":v()}],"mask-image-x-to-color":[{"mask-x-to":v()}],"mask-image-y-from-pos":[{"mask-y-from":z()}],"mask-image-y-to-pos":[{"mask-y-to":z()}],"mask-image-y-from-color":[{"mask-y-from":v()}],"mask-image-y-to-color":[{"mask-y-to":v()}],"mask-image-radial":[{"mask-radial":[O,T]}],"mask-image-radial-from-pos":[{"mask-radial-from":z()}],"mask-image-radial-to-pos":[{"mask-radial-to":z()}],"mask-image-radial-from-color":[{"mask-radial-from":v()}],"mask-image-radial-to-color":[{"mask-radial-to":v()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":U()}],"mask-image-conic-pos":[{"mask-conic":[Z]}],"mask-image-conic-from-pos":[{"mask-conic-from":z()}],"mask-image-conic-to-pos":[{"mask-conic-to":z()}],"mask-image-conic-from-color":[{"mask-conic-from":v()}],"mask-image-conic-to-color":[{"mask-conic-to":v()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:oe()}],"mask-repeat":[{mask:R()}],"mask-size":[{mask:r()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",O,T]}],filter:[{filter:["","none",O,T]}],blur:[{blur:D()}],brightness:[{brightness:[Z,O,T]}],contrast:[{contrast:[Z,O,T]}],"drop-shadow":[{"drop-shadow":["","none",x,He,Fe]}],"drop-shadow-color":[{"drop-shadow":v()}],grayscale:[{grayscale:["",Z,O,T]}],"hue-rotate":[{"hue-rotate":[Z,O,T]}],invert:[{invert:["",Z,O,T]}],saturate:[{saturate:[Z,O,T]}],sepia:[{sepia:["",Z,O,T]}],"backdrop-filter":[{"backdrop-filter":["","none",O,T]}],"backdrop-blur":[{"backdrop-blur":D()}],"backdrop-brightness":[{"backdrop-brightness":[Z,O,T]}],"backdrop-contrast":[{"backdrop-contrast":[Z,O,T]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Z,O,T]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Z,O,T]}],"backdrop-invert":[{"backdrop-invert":["",Z,O,T]}],"backdrop-opacity":[{"backdrop-opacity":[Z,O,T]}],"backdrop-saturate":[{"backdrop-saturate":[Z,O,T]}],"backdrop-sepia":[{"backdrop-sepia":["",Z,O,T]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":M()}],"border-spacing-x":[{"border-spacing-x":M()}],"border-spacing-y":[{"border-spacing-y":M()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",O,T]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Z,"initial",O,T]}],ease:[{ease:["linear","initial",p,O,T]}],delay:[{delay:[Z,O,T]}],animate:[{animate:["none",b,O,T]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[C,O,T]}],"perspective-origin":[{"perspective-origin":K()}],rotate:[{rotate:h()}],"rotate-x":[{"rotate-x":h()}],"rotate-y":[{"rotate-y":h()}],"rotate-z":[{"rotate-z":h()}],scale:[{scale:A()}],"scale-x":[{"scale-x":A()}],"scale-y":[{"scale-y":A()}],"scale-z":[{"scale-z":A()}],"scale-3d":["scale-3d"],skew:[{skew:j()}],"skew-x":[{"skew-x":j()}],"skew-y":[{"skew-y":j()}],transform:[{transform:[O,T,"","none","gpu","cpu"]}],"transform-origin":[{origin:K()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:F()}],"translate-x":[{"translate-x":F()}],"translate-y":[{"translate-y":F()}],"translate-z":[{"translate-z":F()}],"translate-none":["translate-none"],accent:[{accent:v()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:v()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",O,T]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":M()}],"scroll-mx":[{"scroll-mx":M()}],"scroll-my":[{"scroll-my":M()}],"scroll-ms":[{"scroll-ms":M()}],"scroll-me":[{"scroll-me":M()}],"scroll-mt":[{"scroll-mt":M()}],"scroll-mr":[{"scroll-mr":M()}],"scroll-mb":[{"scroll-mb":M()}],"scroll-ml":[{"scroll-ml":M()}],"scroll-p":[{"scroll-p":M()}],"scroll-px":[{"scroll-px":M()}],"scroll-py":[{"scroll-py":M()}],"scroll-ps":[{"scroll-ps":M()}],"scroll-pe":[{"scroll-pe":M()}],"scroll-pt":[{"scroll-pt":M()}],"scroll-pr":[{"scroll-pr":M()}],"scroll-pb":[{"scroll-pb":M()}],"scroll-pl":[{"scroll-pl":M()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",O,T]}],fill:[{fill:["none",...v()]}],"stroke-w":[{stroke:[Z,Te,Ce,tt]}],stroke:[{stroke:["none",...v()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}}),Tn=({panel:e,isLastFlexiblePanel:t,measuredPixelSize:n,measuredPercentageSize:o,containerAxisSize:i,containerLabel:s})=>{const a=e?.size,l=typeof a=="number"&&Number.isFinite(a)?`${a.toFixed(3)}px`:"-",c=e?.percentageSize!==void 0?`${e.percentageSize.toFixed(3)}%`:"-",y=Number.isFinite(n)?`${n.toFixed(3)}px`:"-",S=Number.isFinite(o)?`${o.toFixed(3)}%`:"-",f=Number.isFinite(i)?`${i.toFixed(3)}px`:"-",d=`${l} / ${c}`,x=`${y} / ${S}`,w=`${e?.sizeUnit==="pixels"?"Fixed":"Flexible"}${t?" (Grow)":""}`,C=[w,`${s}: ${f}`,`size (state): ${d}`,`size (measured): ${x}`];return{stateValueDisplay:d,measuredValueDisplay:x,containerDisplay:f,headlineLabel:w,titleText:C.join(`
|
|
23
|
+
`)}},On=m.memo(({panel:e,isLastFlexiblePanel:t,measuredPixelSize:n,measuredPercentageSize:o,containerAxisSize:i,direction:s})=>{const a=s==="horizontal"?"container width":"container height",{stateValueDisplay:l,measuredValueDisplay:c,containerDisplay:y,headlineLabel:S,titleText:f}=m.useMemo(()=>Tn({panel:e,isLastFlexiblePanel:t,measuredPixelSize:n,measuredPercentageSize:o,containerAxisSize:i,containerLabel:a}),[e,t,n,o,i,a]),d={position:"absolute",top:"2px",right:"4px",backgroundColor:"rgba(30, 41, 59, 0.6)",color:"#fff",padding:"4px 8px",borderRadius:"6px",fontSize:"11px",fontFamily:"monospace",pointerEvents:"auto",zIndex:10,boxShadow:"0 2px 4px rgba(0,0,0,0.3)",border:"1px solid rgba(255,255,255,0.1)",maxWidth:"calc(100% - 12px)",minWidth:"60px",width:"fit-content",overflow:"hidden"},x={display:"flex",flexDirection:"column",gap:"1px",minWidth:"0",width:"100%"},w={display:"flex",justifyContent:"flex-start",alignItems:"center",gap:"6px",fontSize:"10px",color:"#ccc",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",minWidth:"0",width:"100%"},C={display:"flex",justifyContent:"space-between",alignItems:"center",gap:"6px",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",minWidth:"0",width:"100%"},k={marginLeft:"auto",fontVariantNumeric:"tabular-nums",whiteSpace:"nowrap"};return L.jsx("div",{style:d,title:f,children:L.jsxs("div",{style:x,children:[L.jsx("div",{style:w,children:L.jsx("span",{children:S})}),L.jsxs("div",{style:C,children:[L.jsx("span",{children:a}),L.jsx("span",{style:k,children:y})]}),L.jsxs("div",{style:C,children:[L.jsx("span",{children:"size (state)"}),L.jsx("span",{style:k,children:l})]}),L.jsxs("div",{style:C,children:[L.jsx("span",{children:"size (measured)"}),L.jsx("span",{style:k,children:c})]})]})})}),jn=m.memo(({id:e,defaultSize:t={value:50,unit:"percentage"},minSize:n,maxSize:o,className:i,style:s,children:a,order:l=0,collapsible:c=!1,defaultCollapsed:y=!1,pixelAdjustPriority:S,contentOverflow:f="auto"})=>{const{direction:d,registerPanel:x,unregisterPanel:w,getPanel:C,showDebugInfo:k,panels:p,isContainerReady:b,reportPanelMeasurement:E,containerSize:U}=Be(),K=m.useRef(null),W=m.useRef(e||pt()),B=C(W.current),M=!!B?.collapsed,Q=(B?.size??0)<=0,H=M||Q,[J,ne]=m.useState(()=>{const h=ke(t);return h?.unit==="pixels"?h.value:B?.size!==void 0?B.size:0}),[X,ee]=m.useState(()=>{const h=ke(t);return h?.unit==="percentage"?h.value:B?.percentageSize!==void 0?B.percentageSize:0}),V=m.useRef(X);V.current=X;const I=m.useRef(J);I.current=J;const G=m.useCallback(h=>{if(!Number.isFinite(h))return;const A=h<0?0:h;I.current!==A&&(I.current=A,console.debug("[resize-panels] commit pixel",{panelId:W.current,pixel:A}),ne(A))},[]),v=m.useCallback(h=>{if(!Number.isFinite(h))return;const A=h<0?0:h;V.current!==A&&(V.current=A,console.debug("[resize-panels] commit percentage",{panelId:W.current,percentage:A}),ee(A))},[]);m.useEffect(()=>{e||console.warn("Panel component should have an explicit 'id' prop to avoid hydration issues. Auto-generated ID may cause SSR/client mismatch.")},[e]),m.useEffect(()=>{if(!b)return;const h=ke(t),A=h?.unit==="pixels";let j=0;if(A){let Y=h.value;n&&typeof n=="object"&&n.unit==="pixels"&&(Y=Math.max(Y,n.value)),o&&typeof o=="object"&&o.unit==="pixels"&&(Y=Math.min(Y,o.value)),j=Y}const F=A?void 0:h?.value,$=y,se=c&&$&&A?j:void 0,q=c?F:void 0,re={id:W.current,size:$?0:j,percentageSize:$?0:F,sizeUnit:h?.unit||"percentage",originalPixelSize:A?j:void 0,minSize:n,maxSize:o,collapsible:c,collapsed:$,sizeBeforeCollapse:se,percentageSizeBeforeCollapse:q,pixelAdjustPriority:S};return x(re),()=>{w(W.current),E(W.current,null)}},[t,n,o,x,w,c,y,S,E,b]);const oe=B?.size??0;m.useEffect(()=>{const h=K.current;if(!h)return;const A=()=>{if(!B)return;const q=h.parentElement;if(!q)return;const{width:re,height:u}=h.getBoundingClientRect(),{inner:Y}=be(q,"horizontal"),{inner:ue}=be(q,"vertical"),ae=d==="horizontal"?re:u,ce=d==="horizontal"?Y:ue,xe=Xe(ce);if(H){I.current!==0&&(I.current=0,ne(0)),V.current!==0&&(V.current=0,ee(0));return}const ge=B?.size??0,fe=Math.max(2,xe*.5);if(!H&&ge>xe&&ae<fe){console.debug("[resize-panels] skip noisy measurement",{panelId:W.current,expectedPanelSize:ge,measured:ae,noiseThreshold:fe});return}if(ae>0){if(G(ae),ce>0){const he=ae/ce*100;v(he)}}else if(B?.size!==void 0&&G(B.size),B?.percentageSize!==void 0){const he=B.percentageSize;v(he)}else if(B?.sizeUnit==="pixels"&&B?.size!==void 0&&ce>0){const he=B.size/ce*100;v(he)}},j=new ResizeObserver(()=>{A()});j.observe(h),A();const F=[],$=new MutationObserver(()=>{(()=>{if(!K.current)return!1;const re=K.current.getBoundingClientRect();return(d==="horizontal"?re.width:re.height)!==I.current})()&&setTimeout(A,0)}),se=h.parentElement;return se&&$.observe(se,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["style","class"]}),()=>{j.disconnect(),$.disconnect();for(const q of F)clearTimeout(q)}},[d,B,H,G,v]);const R=B?.size,r=B?.percentageSize,P=B?.sizeUnit;m.useEffect(()=>{if(B){if(H){I.current!==0&&(I.current=0,ne(0)),V.current!==0&&(V.current=0,ee(0));return}if(R!==void 0&&G(R),r!==void 0)v(r);else if(P==="pixels"&&R!==void 0){const h=K.current,A=h?.parentElement;if(h&&A){const{width:j,height:F}=h.getBoundingClientRect(),$=A.clientWidth,se=A.clientHeight,q=d==="horizontal"?j:F,re=d==="horizontal"?$:se;if(q>0&&re>0){const u=q/re*100;v(u)}}}}},[R,r,P,d,H,G,v,B]),m.useEffect(()=>{E(W.current,{pixelSize:J,percentageSize:X})},[E,J,X]);const _=()=>H?"0px":B?.originalPixelSize!==void 0?`${oe}px`:B?.percentageSize!==void 0?`${B.percentageSize}%`:`${oe}px`,N=(()=>{if(!p||p.length===0)return!1;const h=p.filter(F=>F.sizeUnit==="percentage");if(h.length===0||h[h.length-1]?.id!==W.current)return!1;const j=B?.percentageSize;return!(j!==void 0&&h.filter($=>Math.abs(($.percentageSize||0)-j)<.01).length>1)})(),te=B?.sizeUnit==="percentage"&&!B?.collapsed?1:0,g={flexBasis:_(),flexGrow:N?1:0,flexShrink:te,overflow:"hidden",position:"relative",boxSizing:"border-box",minHeight:"0px",minWidth:"0px",...s};d==="horizontal"?(g.height="100%",g.minWidth=0):(g.width="100%",g.minHeight=0),H&&(d==="horizontal"?(g.width="0px",g.minWidth="0px"):(g.height="0px",g.minHeight="0px"),g.flexGrow=0,g.flexShrink=0,g.pointerEvents="none",g.visibility="hidden",M&&(g.display="none"));const z=d==="horizontal"?U.width:U.height,D=m.useMemo(()=>({position:"absolute",inset:"0px",overflow:f,display:"flex",flexDirection:"column",width:"100%",height:"100%",minWidth:"0px",minHeight:"0px"}),[f]);return L.jsxs("div",{ref:K,className:Oe("panel",i),style:g,"data-panel-id":W.current,"data-panel-size":oe,"data-panel-size-unit":B?.sizeUnit||"percentage","data-panel-pixel-size":B?.sizeUnit==="pixels"?B?.originalPixelSize:null,"data-panel-order":l,"data-panel-collapsible":c,"data-panel-collapsed":B?.collapsed,"aria-hidden":H,children:[L.jsx("div",{style:D,children:a}),k&&L.jsx(On,{panel:B,isLastFlexiblePanel:N,measuredPixelSize:J,measuredPercentageSize:X,containerAxisSize:z,direction:d})]})}),Bn=e=>JSON.stringify(e.map(t=>({id:t.id,size:t.size,percentageSize:t.percentageSize??null,sizeUnit:t.sizeUnit,originalPixelSize:t.originalPixelSize??null,minSize:t.minSize??null,maxSize:t.maxSize??null,collapsible:t.collapsible??!1,collapsed:t.collapsed??!1,sizeBeforeCollapse:t.sizeBeforeCollapse??null,measuredPixelSizeBeforeCollapse:t.measuredPixelSizeBeforeCollapse??null,pixelAdjustPriority:t.pixelAdjustPriority??null,measuredPixelSize:t.measuredPixelSize??null,measuredPercentageSize:t.measuredPercentageSize??null}))),Ln=e=>JSON.stringify(e.map(t=>({id:t.id,thickness:t.thickness,visible:t.visible,direction:t.direction,startPanelId:t.startPanelId??null,endPanelId:t.endPanelId??null}))),ze=(()=>{const e=new Set,t=new Map,n=new Set;let o=null,i=0,s=!0,a=[],l={ownerId:null,groups:a};const c=()=>{for(const p of e)p()},y=()=>{s=!0,c()},S=()=>{const p=o;if(p&&n.has(p))return!1;o=null;const b=n.values().next();return b.done||(o=b.value),p!==o};return{subscribe:p=>(e.add(p),()=>{e.delete(p)}),getSnapshot:()=>(S()&&(s=!0),s&&(a=Array.from(t.values()).sort((b,E)=>b.index-E.index).map(({serializedPanels:b,serializedHandles:E,...U})=>U),l={ownerId:o,groups:a},s=!1),l),getOwnerId:()=>(S()&&(s=!0),o),enableGroup:p=>{const b=n.size;n.add(p),n.size!==b&&S()&&y()},disableGroup:p=>{n.delete(p)&&S()&&y()},updateGroup:(p,b)=>{const E=t.get(p),U=E?.index??i++,K=Bn(b.panels),W=Ln(b.handles),B=E?.displayName!==b.displayName,M=E?.direction!==b.direction,Q=E?E.containerSize.width!==b.containerSize.width||E.containerSize.height!==b.containerSize.height:!0;let H=E?.serializedPanels!==K;if(!H&&E)if(E.panels.length!==b.panels.length)H=!0;else for(let V=0;V<b.panels.length;V+=1){const I=E.panels[V],G=b.panels[V];if(!(I&&G)){H=!0;break}if(I.id!==G.id||I.size!==G.size||I.percentageSize!==G.percentageSize||I.collapsed!==G.collapsed||I.measuredPixelSize!==G.measuredPixelSize||I.measuredPercentageSize!==G.measuredPercentageSize){H=!0;break}}let J=E?.serializedHandles!==W;if(!J&&E)if(E.handles.length!==b.handles.length)J=!0;else for(let V=0;V<b.handles.length;V+=1){const I=E.handles[V],G=b.handles[V];if(!(I&&G)){J=!0;break}if(I.id!==G.id||I.thickness!==G.thickness||I.visible!==G.visible||I.direction!==G.direction||I.startPanelId!==G.startPanelId||I.endPanelId!==G.endPanelId){J=!0;break}}if(!E&&b.panels.length===0&&b.handles.length===0||E&&!B&&!M&&!Q&&!H&&!J)return;const ne=b.panels.map(V=>({...V})),X=b.handles.map(V=>({...V})),ee={...b.containerSize};t.set(p,{groupId:p,displayName:b.displayName,direction:b.direction,containerSize:ee,panels:ne,handles:X,index:U,serializedPanels:K,serializedHandles:W}),y()},removeGroup:p=>{const b=t.delete(p),E=n.delete(p),U=S();(b||E||U)&&y()}}})(),Dn=()=>m.useSyncExternalStore(ze.subscribe,ze.getOwnerId,ze.getOwnerId),Gn=()=>m.useSyncExternalStore(ze.subscribe,ze.getSnapshot,ze.getSnapshot),Fn=e=>{ze.enableGroup(e)},Ot=e=>{ze.disableGroup(e)},Hn=(e,t)=>{ze.updateGroup(e,t)},jt=e=>{ze.removeGroup(e)};let Bt=0;const Wn=()=>(Bt+=1,`panel-group-${Bt}`),Lt=(e,t)=>typeof e!="number"||!Number.isFinite(e)?"—":`${(e<0?0:e).toFixed(8)}${t}`,We=e=>Lt(e,"px"),Dt=e=>Lt(e,"%"),Un=e=>{const{id:t,className:n,style:o,children:i,direction:s}=e,{groupRef:a,contextValue:l,groupStyle:c}=xt(e),[y,S]=m.useState({width:0,height:0}),f=l.layoutConstraintViolation,d=!!f,x=d&&f?L.jsxs("div",{className:"flex w-full flex-1 flex-col items-center justify-center gap-2 rounded-lg border border-slate-300 border-dashed bg-slate-100/70 px-6 py-8 text-center text-slate-600 text-sm dark:border-slate-600 dark:bg-slate-800/50 dark:text-slate-200","data-panel-group-placeholder":"constraint-violation",children:[L.jsx("span",{children:f.reason==="minimum-exceeded"?"Layout unavailable: minimum panel sizes exceed the container.":"Layout unavailable: panels cannot fill the container with their maximum sizes."}),L.jsx("span",{className:"text-slate-500 text-xs dark:text-slate-400",children:f.reason==="minimum-exceeded"?`Min required: ${Math.ceil(f.totalMinimumSize??0)}px | Available: ${Math.floor(f.availableContainerSize)}px`:`Max total: ${Math.floor(f.totalMaximumSize??0)}px | Needed: ${Math.floor(f.availableContainerSize)}px`})]}):null,C=m.useRef(t??Wn()).current,k=t??C,p=l.showDebugInfo&&l.panels.length>0,b=p?l.panels:[],E=p?l.panelMeasurements:{},U=m.useMemo(()=>{if(!p)return[];const J=Object.values(l.handleMeasurements);return J.length<=1?J:J.slice().sort((ne,X)=>ne.id.localeCompare(X.id))},[l.handleMeasurements,p]),K=l.containerSize,W=y.width>0?y.width:K.width,B=y.height>0?y.height:K.height,M=Dn(),Q=p&&M===C;m.useLayoutEffect(()=>{if(!p){S({width:0,height:0});return}if(typeof window>"u"||typeof ResizeObserver>"u")return;const J=a.current;if(!J)return;const ne=new ResizeObserver(v=>{for(const oe of v){if(oe.target!==J)continue;const R=oe.target,r=R?be(R,"horizontal"):null,P=R?be(R,"vertical"):null,_=r?r.inner:0,N=P?P.inner:0,te=oe.contentRect.width,g=oe.contentRect.height,z=_>0?_:te,D=N>0?N:g;S(h=>h.width===z&&h.height===D?h:{width:z,height:D})}});ne.observe(J);const{inner:X}=be(J,"horizontal"),{inner:ee}=be(J,"vertical"),V=J.getBoundingClientRect(),I=X>0?X:V.width,G=ee>0?ee:V.height;return S({width:I,height:G}),()=>{ne.disconnect()}},[a,p]);const H=m.useMemo(()=>{if(b.length===0)return b;let J=!1;const ne=b.map(X=>{const ee=E[X.id];return!ee||X.measuredPixelSize===ee.pixelSize&&X.measuredPercentageSize===ee.percentageSize?X:(J=!0,{...X,measuredPixelSize:ee.pixelSize,measuredPercentageSize:ee.percentageSize})});return J?ne:b},[b,E]);return m.useEffect(()=>{if(!p){Ot(C),jt(C);return}return Fn(C),()=>{Ot(C),jt(C)}},[p,C]),m.useEffect(()=>{p&&Hn(C,{displayName:k,direction:s,containerSize:{width:W,height:B},panels:H,handles:U})},[p,C,k,s,W,B,H,U]),L.jsxs(Ve.Provider,{value:l,children:[L.jsx("div",{ref:a,className:Oe("panel-group",s==="horizontal"?"flex-row":"flex-col",n),style:{...c,...o},"data-panel-group-id":t,"data-panel-group-direction":s,children:d?x:i}),Q&&L.jsx(Vn,{})]})},Vn=()=>{const t=Gn().groups,[n,o]=m.useState(!0);if(t.length===0||typeof document>"u")return null;const i=t.reduce((c,y)=>c+y.panels.length,0),s=t.reduce((c,y)=>c+(y.handles?.length??0),0),a=()=>{o(c=>!c)},l=L.jsxs("div",{style:{position:"fixed",left:"50%",bottom:"20px",transform:"translate(-50%, 0)",zIndex:100,maxWidth:"min(90vw, 1120px)",width:"100%",padding:n?"10px 18px":"14px 18px",borderRadius:"14px",backgroundColor:"rgba(15, 23, 42, 0.72)",color:"#e2e8f0",fontFamily:"monospace",fontSize:"11px",lineHeight:1.6,boxShadow:"0 22px 45px rgba(15,23,42,0.45)",border:"1px solid rgba(148, 163, 184, 0.22)",backdropFilter:"blur(10px)",WebkitBackdropFilter:"blur(10px)",pointerEvents:"auto",overflow:"auto",maxHeight:n?"52px":"min(65vh, 520px)",transition:"max-height 0.24s ease, padding 0.24s ease"},children:[L.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",flexWrap:"wrap",gap:"12px",marginBottom:n?0:"12px"},children:[L.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"4px"},children:[L.jsx("span",{style:{fontWeight:700,fontSize:"12px",letterSpacing:"0.03em"},children:"Panel Overview"}),L.jsxs("span",{style:{color:"#cbd5f5"},children:["groups: ",t.length," / panels: ",i," / resizers: ",s]})]}),L.jsx("button",{type:"button",onClick:()=>a(),style:{padding:"6px 10px",borderRadius:"9999px",border:"1px solid rgba(148, 163, 184, 0.35)",backgroundColor:n?"rgba(59, 130, 246, 0.2)":"rgba(71, 85, 105, 0.45)",color:"#e2e8f0",fontWeight:600,fontSize:"10px",letterSpacing:"0.03em",textTransform:"uppercase",cursor:"pointer",transition:"background-color 0.18s ease, 0.18s ease border-color"},title:n?"Panel Overview を開く":"Panel Overview を閉じる",children:n?"開く":"閉じる"})]}),!n&&L.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"12px",maxHeight:"45vh",overflowY:"auto",paddingRight:"6px"},children:t.map((c,y)=>{const S=c.direction==="horizontal"?c.containerSize.width:c.containerSize.height;return L.jsxs("div",{style:{padding:"10px 12px",borderRadius:"10px",backgroundColor:"rgba(30, 41, 59, 0.55)",border:"1px solid rgba(148, 163, 184, 0.18)",display:"flex",flexDirection:"column",gap:"10px"},children:[L.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",flexWrap:"wrap",gap:"10px",color:"#dbeafe"},children:[L.jsxs("span",{style:{fontWeight:600,fontSize:"11px",letterSpacing:"0.02em",textTransform:"uppercase"},children:["group ",y+1,": ",c.displayName]}),L.jsxs("span",{children:["direction: ",c.direction," / container: ",We(c.containerSize.width)," × ",We(c.containerSize.height)]})]}),L.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(220px, 1fr))",gap:"10px"},children:c.panels.map((f,d)=>{const x=f.measuredPixelSize??f.size,w=f.size,C=We(w),k=f.percentageSize??(S>0?f.size/S*100:void 0),p=f.measuredPercentageSize!==void 0?f.measuredPercentageSize:S>0?x/S*100:void 0,b=f.collapsed||x<=it,E=f.collapsed?"collapsed":b?"hidden":"visible",U=Dt(k),K=Dt(p),W=We(x);return L.jsxs("div",{style:{padding:"8px 10px",borderRadius:"8px",backgroundColor:"rgba(15, 23, 42, 0.55)",border:"1px solid rgba(148, 163, 184, 0.16)",display:"flex",flexDirection:"column",gap:"4px"},children:[L.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",gap:"6px"},children:[L.jsx("span",{style:{flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis"},children:f.id}),L.jsx("span",{style:{padding:"2px 6px",borderRadius:"9999px",fontSize:"10px",textTransform:"uppercase",backgroundColor:f.collapsed?"rgba(251, 113, 133, 0.25)":b?"rgba(250, 204, 21, 0.25)":"rgba(74, 222, 128, 0.25)",color:f.collapsed?"#fecdd3":b?"#fef08a":"#bbf7d0"},children:E})]}),L.jsxs("div",{style:{display:"grid",gridTemplateColumns:"auto 1fr",gap:"2px 10px",color:"#e2e8f0"},children:[L.jsx("span",{children:"size (state):"}),L.jsx("span",{children:C}),L.jsx("span",{children:"size (measured):"}),L.jsx("span",{children:W}),L.jsx("span",{children:"percentage (state):"}),L.jsx("span",{children:U}),L.jsx("span",{children:"percentage (measured):"}),L.jsx("span",{children:K}),L.jsx("span",{children:"unit:"}),L.jsx("span",{children:f.sizeUnit}),L.jsx("span",{children:"min:"}),L.jsx("span",{children:f.minSize!==void 0?JSON.stringify(f.minSize):"—"}),L.jsx("span",{children:"max:"}),L.jsx("span",{children:f.maxSize!==void 0?JSON.stringify(f.maxSize):"—"}),L.jsx("span",{children:"priority:"}),L.jsx("span",{children:f.pixelAdjustPriority??"—"})]})]},f.id||d)})})]},c.groupId)})})]});return Wt.createPortal(l,document.body)},Yn=m.memo(({id:e,disabled:t=!1,className:n,style:o,children:i,onDragging:s})=>{const{direction:a,resizePanels:l,getPanel:c,collapsePanel:y,expandPanel:S,panels:f,reportHandleMeasurement:d,containerSize:x}=Be(),[w,C]=m.useState(!1),k=m.useRef(null),p=m.useRef(null),b=m.useRef(""),E=m.useRef(""),[U,K]=m.useState({left:null,right:null}),W=m.useRef(e??Zt()),B=m.useRef(null),M=e??W.current;m.useEffect(()=>{if(k.current){const g=k.current.parentElement;if(g){p.current=g;const z=Array.from(g.children),D=k.current,h=z.indexOf(D);if(h>0&&h<z.length-1){let A=null,j=null;for(let F=h-1;F>=0;F-=1){const $=z[F];if($.dataset.panelId){A=$;break}}for(let F=h+1;F<z.length;F+=1){const $=z[F];if($.dataset.panelId){j=$;break}}b.current=A?.dataset.panelId||"",E.current=j?.dataset.panelId||"",K({left:b.current||null,right:E.current||null})}}}},[]),m.useEffect(()=>{if(M===W.current)return;const g=W.current;W.current=M,B.current=null,g!==M&&d(g,null)},[d,M]),m.useEffect(()=>{const g=W.current;return()=>{d(g,null)}},[d]);const Q=m.useCallback(g=>{if(t||!p.current)return;g.preventDefault(),g.stopPropagation();const z=p.current,{inner:D}=be(z,a),h={x:g.clientX,y:g.clientY},A=c(b.current),j=c(E.current);if(!(A&&j))return;const F=A.size,$=j.size;let se=0;const q=Vt;C(!0),s?.(!0),g.currentTarget.setPointerCapture(g.pointerId);const re=Y=>{if(!k.current)return;Y.preventDefault(),Y.stopPropagation();const ue=performance.now();if(ue-se<q)return;se=ue;const ae=a==="horizontal"?Y.clientX-h.x:Y.clientY-h.y;if(ae===0)return;const ce=F+ae,xe=$-ae,ge=c(b.current),fe=c(E.current);if(ge&&fe&&b.current&&E.current){const _e=ie(ge.minSize,0,D),he=ie(fe.minSize,0,D),Se=_e,ve=he,Gt=Math.min(D*st,at),Ft=Math.min(D*Yt,Xt);if(fe.collapsible&&!fe.collapsed&&xe<=Math.max(he*.3,Gt)){y(E.current);return}if(ge.collapsible&&!ge.collapsed&&ce<=Math.max(_e*.3,Gt)){y(b.current);return}if(fe.collapsed&&xe>Math.max(he*.3,Ft)){S(E.current,xe);return}if(ge.collapsed&&ce>Math.max(_e*.3,Ft)){S(b.current,ce);return}if(D>0){const Ht=ge.size+fe.size,Ue=Xe(D);let nt=!1;if(Se<=Ue&&ce<=Ue&&F!==0){const je=Math.max(0,Ht-0);je>=ve&&(l(b.current,E.current,0,je),nt=!0)}else if(ve<=Ue&&xe<=Ue&&$!==0){const je=Math.max(0,Ht-0);je>=Se&&(l(b.current,E.current,je,0),nt=!0)}if(nt)return}if(ge.collapsed||fe.collapsed)return;l(b.current,E.current,ce,xe)}},u=()=>{C(!1),s?.(!1),document.removeEventListener("pointermove",re),document.removeEventListener("pointerup",u)};document.addEventListener("pointermove",re),document.addEventListener("pointerup",u)},[t,a,l,c,y,S,s]),H=a==="horizontal",ne=Oe("group absolute z-20 flex select-none items-center justify-center border-none bg-transparent transition-colors duration-150 overflow-visible",H?"cursor-col-resize":"cursor-row-resize",H?"h-full":"w-full",!t&&"hover:bg-gray-200/70 dark:hover:bg-gray-700/70",!t&&"active:bg-blue-300/60 dark:active:bg-blue-700/60",w&&"bg-blue-200/80 dark:bg-blue-800/60",t&&"cursor-not-allowed opacity-50","focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-opacity-50",n),X=m.useMemo(()=>{const g=z=>{if(!z)return-1;for(let D=0;D<f.length;D+=1)if(f[D].id===z)return D;return-1};return{left:g(U.left),right:g(U.right)}},[U.left,U.right,f]),ee=H?x.width:x.height,V=m.useMemo(()=>{const g=(z,D)=>{if(z>D)return 0;let h=0;for(let A=z;A<=D;A+=1){const j=f[A];if(!j)continue;const F=j.size??0,$=Math.max(0,F);h+=j.collapsed?0:$}return h};return X.left>=0?g(0,X.left):X.right>0?g(0,X.right-1):0},[X.left,X.right,f]),I=m.useMemo(()=>!Number.isFinite(V)||V<0?0:ee>0&&V>ee?ee:V,[V,ee]),G=m.useMemo(()=>{const g={position:"absolute",zIndex:20,touchAction:"none"};return H?(g.top=0,g.left=`${I}px`,g.transform="translateX(-50%)",g.width=`${ot}px`,g.height="100%"):(g.left=0,g.top=`${I}px`,g.transform="translateY(-50%)",g.height=`${ot}px`,g.width="100%"),g},[I,H]),v=m.useMemo(()=>{const g=Xe(ee),z=q=>{if(q<0||q>=f.length)return!1;const re=f[q];return re?re.collapsed?!0:re.size<=g:!1},D=(q,re)=>{if(!z(q))return 0;let u=0;for(let Y=q;Y>=0&&Y<f.length&&z(Y);Y+=re)u+=1;return u},h=X.left,A=X.right,j=h>=0?D(h,-1):0,F=A>=0?D(A,1):0;return{groupSize:j+F+1,overlapIndex:j}},[X.left,X.right,f,ee]),oe=m.useMemo(()=>{if(v.groupSize<=1)return!1;const g=v.groupSize-1;return v.overlapIndex>0&&v.overlapIndex<g},[v]),R=m.useMemo(()=>{if(v.groupSize<=1||oe)return 0;const g=v.groupSize>1?2:1;if(g===1)return 0;const z=v.overlapIndex===0?0:g-1,D=(g-1)/2;return(z-D)*Ut},[v,oe]),r=m.useMemo(()=>{if(oe)return{display:"none"};if(R!==0)return H?{transform:`translateX(${R}px)`}:{transform:`translateY(${R}px)`}},[R,H,oe]),P=Oe("flex items-center justify-center rounded-full bg-white text-slate-700 ring-1 ring-inset ring-white/80 backdrop-blur-sm transition-colors duration-150 shadow-[0_0_0_1px_rgba(255,255,255,0.85),0_1px_3px_rgba(15,23,42,0.18)]","dark:bg-slate-800/95 dark:text-slate-200 dark:ring-slate-500/60 dark:shadow-[0_0_0_1px_rgba(148,163,184,0.45),0_1px_3px_rgba(2,6,23,0.55)]",H?"h-12 w-[6px] px-[2px]":"h-[6px] w-20 py-[2px]",w&&"bg-blue-200/80 ring-blue-300 shadow-[0_0_0_1px_rgba(191,219,254,0.65),0_1px_4px_rgba(59,130,246,0.45)] dark:bg-blue-900/70 dark:ring-blue-400 dark:shadow-[0_0_0_1px_rgba(147,197,253,0.5),0_1px_4px_rgba(59,130,246,0.55)]"),_=Oe("rounded-full bg-slate-600 transition-colors duration-150 shadow-[0_0_0_1px_rgba(255,255,255,0.9)] dark:bg-slate-200 dark:shadow-[0_0_0_1px_rgba(15,23,42,0.55)]",H?"h-8 w-[2px]":"h-[2px] w-16",w&&"bg-blue-500 dark:bg-blue-300",!t&&"group-hover:bg-slate-700 dark:group-hover:bg-slate-100"),N=m.useCallback(()=>{const g=k.current;if(!g)return;let z=0;if(!oe){const A=a==="horizontal"?g.offsetWidth:g.offsetHeight;let j=0,F=0;if(typeof window<"u"){const se=window.getComputedStyle(g);a==="horizontal"?(j=Number.parseFloat(se.marginLeft||"0"),F=Number.parseFloat(se.marginRight||"0")):(j=Number.parseFloat(se.marginTop||"0"),F=Number.parseFloat(se.marginBottom||"0"))}z=[A,j,F].reduce((se,q)=>Number.isFinite(q)?se+q:se,0)}(!Number.isFinite(z)||z<0)&&(z=0);const D={id:M,thickness:z,direction:a,visible:!oe&&z>Jt,startPanelId:U.left,endPanelId:U.right},h=B.current;h&&Math.abs(h.thickness-D.thickness)<=.25&&h.visible===D.visible&&h.direction===D.direction&&h.startPanelId===D.startPanelId&&h.endPanelId===D.endPanelId||(B.current=D,d(M,D))},[a,U.left,U.right,d,M,oe]);m.useEffect(()=>{N()},[N]),m.useEffect(()=>{const g=k.current;if(!g)return;if(typeof ResizeObserver>"u"){N();return}const z=new ResizeObserver(()=>{N()});return z.observe(g),()=>{z.disconnect()}},[N]);const te=m.useMemo(()=>{const g=o?{...G,...o}:G;return oe?{...g,display:"none",pointerEvents:"none",visibility:"hidden"}:g},[G,oe,o]);return L.jsx("button",{type:"button",ref:k,className:ne,style:te,onPointerDown:Q,disabled:t,"aria-hidden":oe||void 0,"aria-label":`Resize ${H?"columns":"rows"} - Drag to collapse/expand panels`,"data-resize-handle-id":M,title:`ドラッグして${H?"列":"行"}をリサイズ、端まで移動して折りたたみ/展開`,children:i||L.jsx("div",{className:P,style:r,children:L.jsx("span",{className:_})})})}),Xn=e=>document.querySelector(`[data-panel-id="${e}"]`),Jn=e=>document.querySelector(`[data-panel-group-id="${e}"]`),Zn=e=>document.querySelector(`[data-resize-handle-id="${e}"]`);le.Panel=jn,le.PanelGroup=Un,le.PanelGroupContext=Ve,le.PanelResizeHandle=Yn,le.clamp=me,le.generatePanelId=pt,le.getConstraintInPixels=ie,le.getContainerSize=be,le.getPanelElement=Xn,le.getPanelGroupElement=Jn,le.getResizeHandleElement=Zn,le.loadLayout=gt,le.normalizeSizeConfig=ke,le.saveLayout=mt,le.usePanelControls=Kt,le.usePanelGroup=Be,le.useResizablePanels=xt,Object.defineProperty(le,Symbol.toStringTag,{value:"Module"})}));
|
package/dist/types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
1
|
+
import { CSSProperties, ReactNode } from 'react';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Pixel threshold used to decide when panels snap closed or open.
|
|
@@ -140,12 +140,13 @@ export interface PanelProps {
|
|
|
140
140
|
minSize?: FlexibleSize;
|
|
141
141
|
maxSize?: FlexibleSize;
|
|
142
142
|
className?: string;
|
|
143
|
-
style?:
|
|
143
|
+
style?: CSSProperties;
|
|
144
144
|
children?: ReactNode;
|
|
145
145
|
order?: number;
|
|
146
146
|
collapsible?: boolean;
|
|
147
147
|
defaultCollapsed?: boolean;
|
|
148
148
|
pixelAdjustPriority?: number;
|
|
149
|
+
contentOverflow?: CSSProperties["overflow"];
|
|
149
150
|
}
|
|
150
151
|
/**
|
|
151
152
|
* Props for the PanelGroup component
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAErD;;;GAGG;AACH,eAAO,MAAM,oBAAoB,KAAK,CAAA;AAEtC;;;GAGG;AACH,eAAO,MAAM,sBAAsB,IAAI,CAAA;AAEvC;;;GAGG;AACH,eAAO,MAAM,+BAA+B,IAAI,CAAA;AAEhD;;;GAGG;AACH,eAAO,MAAM,6BAA6B,IAAI,CAAA;AAE9C;;;GAGG;AACH,eAAO,MAAM,8BAA8B,OAAO,CAAA;AAElD;;;GAGG;AACH,eAAO,MAAM,4BAA4B,KAAK,CAAA;AAE9C;;;GAGG;AACH,eAAO,MAAM,4BAA4B,OAAO,CAAA;AAEhD;;;GAGG;AACH,eAAO,MAAM,0BAA0B,KAAK,CAAA;AAE5C;;;GAGG;AACH,eAAO,MAAM,iCAAiC,OAAO,CAAA;AAErD;;;GAGG;AACH,eAAO,MAAM,4BAA4B,4CAA6C,CAAA;AAEtF;;;GAGG;AACH,eAAO,MAAM,8BAA8B,IAAO,CAAA;AAElD;;;GAGG;AACH,eAAO,MAAM,wBAAwB,IAAO,CAAA;AAE5C;;;GAGG;AACH,MAAM,MAAM,cAAc,GAAG,YAAY,GAAG,UAAU,CAAA;AAEtD;;;GAGG;AACH,MAAM,MAAM,QAAQ,GAAG,YAAY,GAAG,QAAQ,CAAA;AAE9C;;;GAGG;AACH,MAAM,MAAM,UAAU,GAAG;IACrB,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,QAAQ,CAAA;CACjB,CAAA;AAED;;;GAGG;AACH,MAAM,MAAM,YAAY,GAAG,UAAU,GAAG,MAAM,CAAA;AAE9C;;;GAGG;AACH,MAAM,MAAM,aAAa,GAAG;IACxB,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,MAAM,CAAA;CACjB,CAAA;AAED;;;GAGG;AACH,MAAM,MAAM,wBAAwB,GAAG;IACnC,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,MAAM,CAAA;CAChB,CAAA;AAED;;;GAGG;AACH,MAAM,MAAM,+BAA+B,GAAG,kBAAkB,GAAG,sBAAsB,CAAA;AAEzF,MAAM,MAAM,yBAAyB,GAAG;IACpC,MAAM,EAAE,+BAA+B,CAAA;IACvC,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAA;IAC/B,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAA;IAC/B,sBAAsB,EAAE,MAAM,CAAA;CACjC,CAAA;AAED;;;GAGG;AACH,MAAM,WAAW,eAAe;IAC5B,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,QAAQ,EAAE,QAAQ,CAAA;IAClB,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAC1B,OAAO,CAAC,EAAE,YAAY,CAAA;IACtB,OAAO,CAAC,EAAE,YAAY,CAAA;IACtB,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,kBAAkB,CAAC,EAAE,MAAM,CAAA;IAC3B,mBAAmB,CAAC,EAAE,MAAM,CAAA;IAC5B,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAC1B,sBAAsB,CAAC,EAAE,MAAM,CAAA;IAC/B,+BAA+B,CAAC,EAAE,MAAM,CAAA;CAC3C;AAED;;;GAGG;AACH,MAAM,WAAW,UAAU;IACvB,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,WAAW,CAAC,EAAE,YAAY,CAAA;IAC1B,OAAO,CAAC,EAAE,YAAY,CAAA;IACtB,OAAO,CAAC,EAAE,YAAY,CAAA;IACtB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,KAAK,CAAC,EAAE,aAAa,CAAA;IACrB,QAAQ,CAAC,EAAE,SAAS,CAAA;IACpB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAC1B,mBAAmB,CAAC,EAAE,MAAM,CAAA;IAC5B,eAAe,CAAC,EAAE,aAAa,CAAC,UAAU,CAAC,CAAA;CAC9C;AAED;;;GAGG;AACH,MAAM,WAAW,eAAe;IAC5B,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,SAAS,EAAE,cAAc,CAAA;IACzB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAA;IAC3B,QAAQ,CAAC,EAAE,SAAS,CAAA;IACpB,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,QAAQ,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,KAAK,IAAI,CAAA;IACzC,UAAU,CAAC,EAAE,MAAM,CAAA;CACtB;AAED;;;GAGG;AACH,MAAM,WAAW,sBAAsB;IACnC,SAAS,EAAE,cAAc,CAAA;IACzB,aAAa,EAAE,CAAC,KAAK,EAAE,eAAe,KAAK,IAAI,CAAA;IAC/C,eAAe,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAA;IACrC,QAAQ,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,eAAe,GAAG,SAAS,CAAA;IACrD,MAAM,EAAE,eAAe,EAAE,CAAA;IACzB,gBAAgB,EAAE,OAAO,CAAA;IACzB,aAAa,EAAE,OAAO,CAAA;IACtB,YAAY,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,KAAK,IAAI,CAAA;IAC5F,aAAa,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAA;IACnC,WAAW,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,KAAK,IAAI,CAAA;IACtD,aAAa,EAAE,aAAa,CAAA;IAC5B,sBAAsB,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,WAAW,EAAE,gBAAgB,GAAG,IAAI,KAAK,IAAI,CAAA;IAClF,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAA;IACnD,uBAAuB,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,WAAW,EAAE,sBAAsB,GAAG,IAAI,KAAK,IAAI,CAAA;IACzF,kBAAkB,EAAE,MAAM,CAAC,MAAM,EAAE,sBAAsB,CAAC,CAAA;IAC1D,yBAAyB,EAAE,yBAAyB,GAAG,IAAI,CAAA;CAC9D;AAED;;;GAGG;AACH,MAAM,WAAW,sBAAsB;IACnC,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,UAAU,CAAC,EAAE,CAAC,UAAU,EAAE,OAAO,KAAK,IAAI,CAAA;IAC1C,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAA;IAC3B,QAAQ,CAAC,EAAE,SAAS,CAAA;CACvB;AAED,MAAM,WAAW,gBAAgB;IAC7B,SAAS,EAAE,MAAM,CAAA;IACjB,cAAc,EAAE,MAAM,CAAA;CACzB;AAED;;;GAGG;AACH,MAAM,WAAW,sBAAsB;IACnC,EAAE,EAAE,MAAM,CAAA;IACV,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,EAAE,cAAc,CAAA;IACzB,OAAO,EAAE,OAAO,CAAA;IAChB,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC5B,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAC7B"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aiquants/resize-panels",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "Reusable resizable panel components and utilities for React",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"import": "./dist/index.es.js",
|
|
25
25
|
"require": "./dist/index.umd.js"
|
|
26
26
|
},
|
|
27
|
-
"./css": "./dist/resize-panels.css"
|
|
27
|
+
"./resize-panels.css": "./dist/resize-panels.css"
|
|
28
28
|
},
|
|
29
29
|
"files": [
|
|
30
30
|
"dist",
|