@principal-ade/panels 1.0.53 → 1.0.55
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/components/CollapsibleSplitPane.d.ts +53 -0
- package/dist/components/CollapsibleSplitPane.d.ts.map +1 -0
- package/dist/components/ConfigurablePanelLayout.d.ts.map +1 -1
- package/dist/hooks/usePanelBounds.d.ts +67 -0
- package/dist/hooks/usePanelBounds.d.ts.map +1 -0
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.esm.js +71 -5614
- package/dist/index.esm.js.map +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/index.umd.js.map +1 -1
- package/dist/panels.css +1 -1
- package/dist/types/index.d.ts +26 -0
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +22 -23
package/dist/index.umd.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react/jsx-runtime"),require("react"),require("react-resizable-panels"),require("react-dom"),require("@principal-ade/industry-theme")):"function"==typeof define&&define.amd?define(["exports","react/jsx-runtime","react","react-resizable-panels","react-dom","@principal-ade/industry-theme"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).A24ZPanels={},e["react/jsx-runtime"],e.React,e.ReactResizablePanels,e.ReactDOM,e.IndustryTheme)}(this,function(e,t,n,r,o,a){"use strict";function l(e){return{"--panel-background":e.colors.background,"--panel-border":e.colors.border,"--panel-handle":e.colors.backgroundSecondary,"--panel-handle-hover":e.colors.backgroundHover,"--panel-handle-active":e.colors.primary,"--panel-button-bg":e.colors.surface,"--panel-button-hover":e.colors.backgroundHover,"--panel-button-border":e.colors.border,"--panel-button-icon":e.colors.textSecondary,"--panel-accent-bg":e.colors.primary+"15"}}function i(e){return{"--tab-list-bg":e.colors.backgroundSecondary,"--tab-border":e.colors.border,"--tab-bg":e.colors.surface,"--tab-bg-hover":e.colors.backgroundHover,"--tab-bg-active":e.colors.primary,"--tab-text":e.colors.textSecondary,"--tab-text-hover":e.colors.text,"--tab-text-active":e.colors.background,"--tab-icon-color":e.colors.textTertiary,"--tab-icon-active":e.colors.background,"--tab-border-hover":e.colors.textSecondary,"--tab-border-active":e.colors.primary,"--tab-focus":e.colors.primary,"--tab-content-bg":e.colors.background,"--tab-empty-text":e.colors.textMuted,"--tab-font-family":e.fonts.body,"--tab-font-size":"11px","--tab-font-weight":String(e.fontWeights.medium),"--mobile-tab-text-active":e.colors.primary,"--mobile-tab-icon-active":e.colors.primary}}const s=({panelIds:e,panels:r,config:o={},className:a="",theme:l})=>{const{defaultActiveTab:s=0,tabPosition:c="top",centered:d=!0,hideTabList:u=!1,activeTabIndex:p,onTabChange:f}=o,[h,m]=n.useState(s),g=void 0!==p,b=g?p:h;n.useEffect(()=>{g||m(s)},[s,g]);const v=i(l),y=e.map(e=>r.find(t=>t.id===e)).filter(e=>void 0!==e),x=Math.min(b,y.length-1),w=y[x];if(0===y.length)return t.jsx("div",{className:"tab-group-empty",children:"No panels available"});const C="top"===c||"bottom"===c||d,R=t.jsx("div",{className:"tab-list "+(C?"centered":""),role:"tablist",children:y.map((e,n)=>t.jsx("button",{role:"tab","aria-selected":n===x,"aria-controls":`tabpanel-${e.id}`,id:`tab-${e.id}`,className:"tab-button "+(n===x?"active":""),onClick:()=>(e=>{g||m(e),f?.(e)})(n),title:e.icon?e.label:void 0,children:e.icon?t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"tab-icon",children:e.icon}),t.jsx("span",{className:"tab-label",children:e.label})]}):e.label},e.id))}),S=w?t.jsx("div",{className:"tab-content",role:"tabpanel",id:`tabpanel-${w.id}`,"aria-labelledby":`tab-${w.id}`,children:w.content}):null;return t.jsxs("div",{className:`tab-group tab-position-${c} ${a}`,style:v,children:[!u&&("top"===c||"left"===c)&&R,S,!u&&("bottom"===c||"right"===c)&&R]})},c=({panels:e,layout:a,slotDataAttributes:i={},collapsiblePanels:c={left:!0,middle:!1,right:!0},defaultSizes:d={left:20,middle:60,right:20},minSizes:u={left:5,middle:10,right:5},className:p="",collapsed:f={left:!1,middle:!1,right:!1},style:h,showCollapseButtons:m=!1,animationDuration:g=300,animationEasing:b="cubic-bezier(0.4, 0, 0.2, 1)",theme:v,onLeftCollapseStart:y,onLeftCollapseComplete:x,onLeftExpandStart:w,onLeftExpandComplete:C,onMiddleCollapseStart:R,onMiddleCollapseComplete:S,onMiddleExpandStart:E,onMiddleExpandComplete:k,onRightCollapseStart:N,onRightCollapseComplete:D,onRightExpandStart:z,onRightExpandComplete:M,onPanelResize:j})=>{const T=null!==a.left&&void 0!==a.left,A=null!==a.middle&&void 0!==a.middle,P=null!==a.right&&void 0!==a.right,L=[T,A,P].filter(Boolean).length,F={left:T?d?.left??(2===L?50:3===L?20:100):0,middle:A?d?.middle??(2===L?50:3===L?60:100):0,right:P?d?.right??(2===L?50:3===L?20:100):0},$={left:u?.left??5,middle:u?.middle??10,right:u?.right??5},[B,O]=n.useState(f.left||!T),[I,q]=n.useState(f.middle||!A),[H,U]=n.useState(f.right||!P),[W,K]=n.useState(!1),[V,X]=n.useState(!1),[Y,G]=n.useState(!1),[J,_]=n.useState(!1),Q=B&&!W,Z=I&&!V,ee=H&&!Y,te=n.useCallback(t=>{if(!t)return null;const n=e.find(e=>e.id===t);return n?.content||null},[e]),ne=n.useCallback(n=>{if(null===n)return null;if("object"==typeof n&&"type"in n){const r=n;return"tabs"===r.type?t.jsx(s,{panelIds:r.panels,panels:e,config:r.config,theme:v}):null}return te(n)},[e,te,v]),re=ne(a.left??null),oe=ne(a.middle??null),ae=ne(a.right??null),[le,ie]=n.useState(f.left||!T?0:F.left),[se,ce]=n.useState(f.middle||!A?0:F.middle),[de,ue]=n.useState(f.right||!P?0:F.right),[pe,fe]=n.useState(F.left),[he,me]=n.useState(F.middle),[ge,be]=n.useState(F.right),ve=n.useRef(null),ye=n.useRef(null),xe=n.useRef(null),we=n.useRef(null),Ce=n.useRef(void 0),Re=n.useRef(void 0),Se=n.useRef(void 0),Ee=n.useRef(void 0),ke=n.useRef(void 0),Ne=n.useRef(void 0),De=n.useCallback((e,t)=>{const n=e.filter(e=>e.panelRef.current);if(0===n.length)return;n.forEach(e=>{e.animationFrameRef.current&&cancelAnimationFrame(e.animationFrameRef.current)});let r=0;const o=()=>{r++;const e=r/10;if(e>=1)return n.forEach(e=>{e.panelRef.current&&(0===e.toSize?e.panelRef.current.collapse():e.panelRef.current.resize(e.toSize))}),void(t&&t());const a=e<.5?4*e*e*e:1-Math.pow(-2*e+2,3)/2;n.forEach(e=>{if(e.panelRef.current){const t=e.fromSize+(e.toSize-e.fromSize)*a;e.panelRef.current.resize(t)}}),n[0].animationFrameRef.current=requestAnimationFrame(()=>{setTimeout(o,g/10)})};o()},[g]),ze=n.useCallback(()=>{W||J||!c.left||(o.flushSync(()=>{K(!0),X(!0),G(!0),O(!0)}),y&&y(),Ce.current&&cancelAnimationFrame(Ce.current),Ce.current=requestAnimationFrame(()=>{const e=ve.current?.getLayout(),t=Math.round(1e3*(e?.[0]??le))/1e3,n=Math.round(1e3*(e?.[1]??se))/1e3,r=Math.round(1e3*(e?.[2]??de))/1e3,o=n+r,a=o>0?n/o*100:A?50:0,l=o>0?r/o*100:P?50:0;a>0&&me(a),l>0&&be(l),De([{panelRef:ye,fromSize:t,toSize:0,animationFrameRef:Ce,startTimeRef:Ee},{panelRef:xe,fromSize:n,toSize:a,animationFrameRef:Re,startTimeRef:ke},{panelRef:we,fromSize:r,toSize:l,animationFrameRef:Se,startTimeRef:Ne}],()=>{ie(0),ce(a),ue(l),K(!1),X(!1),G(!1),x&&x()})}))},[W,J,le,se,de,A,P,c.left,De,y,x]),Me=n.useCallback(()=>{W||J||!c.left||(o.flushSync(()=>{K(!0),X(!0),G(!0),O(!1)}),w&&w(),Ce.current&&cancelAnimationFrame(Ce.current),Ce.current=requestAnimationFrame(()=>{const e=ve.current?.getLayout(),t=Math.round(1e3*(e?.[0]??0))/1e3,n=Math.round(1e3*(e?.[1]??se))/1e3,r=Math.round(1e3*(e?.[2]??de))/1e3,o=pe||F.left,a=100-o,l=n+r,i=l>0?n/l*a:A?a/2:0,s=l>0?r/l*a:P?a/2:0;i>0&&me(i),s>0&&be(s),De([{panelRef:ye,fromSize:t,toSize:o,animationFrameRef:Ce,startTimeRef:Ee},{panelRef:xe,fromSize:n,toSize:i,animationFrameRef:Re,startTimeRef:ke},{panelRef:we,fromSize:r,toSize:s,animationFrameRef:Se,startTimeRef:Ne}],()=>{ie(o),ce(i),ue(s),K(!1),X(!1),G(!1),C&&C()})}))},[W,J,se,de,F.left,pe,A,P,c.left,De,w,C]),je=n.useCallback(()=>{Y||J||!c.right||(o.flushSync(()=>{K(!0),X(!0),G(!0),U(!0)}),N&&N(),Se.current&&cancelAnimationFrame(Se.current),Se.current=requestAnimationFrame(()=>{const e=ve.current?.getLayout(),t=Math.round(1e3*(e?.[0]??le))/1e3,n=Math.round(1e3*(e?.[1]??se))/1e3,r=Math.round(1e3*(e?.[2]??de))/1e3,o=t+n,a=o>0?t/o*100:T?50:0,l=o>0?n/o*100:A?50:0;a>0&&fe(a),l>0&&me(l),De([{panelRef:ye,fromSize:t,toSize:a,animationFrameRef:Ce,startTimeRef:Ee},{panelRef:xe,fromSize:n,toSize:l,animationFrameRef:Re,startTimeRef:ke},{panelRef:we,fromSize:r,toSize:0,animationFrameRef:Se,startTimeRef:Ne}],()=>{ie(a),ce(l),ue(0),K(!1),X(!1),G(!1),D&&D()})}))},[Y,J,le,se,de,T,A,c.right,De,N,D]),Te=n.useCallback(()=>{Y||J||!c.right||(o.flushSync(()=>{K(!0),X(!0),G(!0),U(!1)}),z&&z(),Se.current&&cancelAnimationFrame(Se.current),Se.current=requestAnimationFrame(()=>{const e=ve.current?.getLayout(),t=Math.round(1e3*(e?.[0]??le))/1e3,n=Math.round(1e3*(e?.[1]??se))/1e3,r=Math.round(1e3*(e?.[2]??0))/1e3,o=ge||F.right,a=100-o,l=t+n,i=l>0?t/l*a:T?a/2:0,s=l>0?n/l*a:A?a/2:0;i>0&&fe(i),s>0&&me(s),De([{panelRef:ye,fromSize:t,toSize:i,animationFrameRef:Ce,startTimeRef:Ee},{panelRef:xe,fromSize:n,toSize:s,animationFrameRef:Re,startTimeRef:ke},{panelRef:we,fromSize:r,toSize:o,animationFrameRef:Se,startTimeRef:Ne}],()=>{ie(i),ce(s),ue(o),K(!1),X(!1),G(!1),M&&M()})}))},[Y,J,le,se,F.right,ge,T,A,c.right,De,z,M]),Ae=n.useCallback(()=>{B?Me():ze()},[B,ze,Me]),Pe=n.useCallback(()=>{V||J||!c.middle||(o.flushSync(()=>{K(!0),X(!0),G(!0),q(!0)}),R&&R(),Re.current&&cancelAnimationFrame(Re.current),Re.current=requestAnimationFrame(()=>{const e=ve.current?.getLayout(),t=Math.round(1e3*(e?.[0]??le))/1e3,n=Math.round(1e3*(e?.[1]??se))/1e3,r=Math.round(1e3*(e?.[2]??de))/1e3,o=t+r,a=o>0?t/o*100:T?50:0,l=o>0?r/o*100:P?50:0;a>0&&fe(a),l>0&&be(l),De([{panelRef:ye,fromSize:t,toSize:a,animationFrameRef:Ce,startTimeRef:Ee},{panelRef:xe,fromSize:n,toSize:0,animationFrameRef:Re,startTimeRef:ke},{panelRef:we,fromSize:r,toSize:l,animationFrameRef:Se,startTimeRef:Ne}],()=>{ie(a),ce(0),ue(l),K(!1),X(!1),G(!1),S&&S()})}))},[V,J,le,se,de,T,P,c.middle,De,R,S]),Le=n.useCallback(()=>{V||J||!c.middle||(o.flushSync(()=>{K(!0),X(!0),G(!0),q(!1)}),E&&E(),Re.current&&cancelAnimationFrame(Re.current),Re.current=requestAnimationFrame(()=>{const e=ve.current?.getLayout(),t=Math.round(1e3*(e?.[0]??le))/1e3,n=Math.round(1e3*(e?.[1]??0))/1e3,r=Math.round(1e3*(e?.[2]??de))/1e3,o=he||F.middle,a=100-o,l=t+r,i=l>0?t/l*a:T?a/2:0,s=l>0?r/l*a:P?a/2:0;i>0&&fe(i),s>0&&be(s),De([{panelRef:ye,fromSize:t,toSize:i,animationFrameRef:Ce,startTimeRef:Ee},{panelRef:xe,fromSize:n,toSize:o,animationFrameRef:Re,startTimeRef:ke},{panelRef:we,fromSize:r,toSize:s,animationFrameRef:Se,startTimeRef:Ne}],()=>{ie(i),ce(o),ue(s),K(!1),X(!1),G(!1),k&&k()})}))},[V,J,le,de,F.middle,he,T,P,c.middle,De,E,k]),Fe=n.useCallback(()=>{H?Te():je()},[H,je,Te]),$e=n.useCallback(e=>{W||V||Y||(ie(e),e>0&&(fe(e),O(!1)))},[W,V,Y]),Be=n.useCallback(e=>{W||V||Y||(ce(e),e>0&&(me(e),q(!1)))},[W,V,Y]),Oe=n.useCallback(e=>{W||V||Y||(ue(e),e>0&&(be(e),U(!1)))},[W,V,Y]),Ie=n.useCallback(()=>{if(j){j({left:B?pe:le,middle:I?he:se,right:H?ge:de})}},[le,se,de,B,I,H,pe,he,ge,j]),qe=n.useCallback(e=>{_(e),e||Ie()},[Ie]);n.useEffect(()=>{void 0!==f.left&&f.left!==B&&queueMicrotask(()=>{f.left?ze():Me()})},[f.left,B,ze,Me]),n.useEffect(()=>{void 0!==f.middle&&f.middle!==I&&queueMicrotask(()=>{f.middle?Pe():Le()})},[f.middle,I,Pe,Le]),n.useEffect(()=>{void 0!==f.right&&f.right!==H&&queueMicrotask(()=>{f.right?je():Te()})},[f.right,H,je,Te]),n.useEffect(()=>()=>{Ce.current&&cancelAnimationFrame(Ce.current),Re.current&&cancelAnimationFrame(Re.current),Se.current&&cancelAnimationFrame(Se.current)},[]);const He=e=>{let t="three-panel-item";return"left"===e?!c.left&&T||(t+=" collapsible-panel",W&&!J&&(t+=" animating"),Q&&(t+=" collapsed")):"middle"===e?(t+=" middle-panel",!c.middle&&A||(t+=" collapsible-panel",V&&!J&&(t+=" animating"),Z&&(t+=" collapsed"))):"right"===e&&(!c.right&&P||(t+=" collapsible-panel",Y&&!J&&(t+=" animating"),ee&&(t+=" collapsed"))),t},Ue=W&&!J?{transition:`width ${g}ms ${b}`,width:B?"0%":`${F.left}%`}:void 0,We=V&&!J?{transition:`width ${g}ms ${b}`,width:I?"0%":`${F.middle}%`}:void 0,Ke=Y&&!J?{transition:`width ${g}ms ${b}`,width:H?"0%":`${F.right}%`}:void 0,Ve=l(v),Xe=W||V||Y?0:$.left,Ye=W||V||Y?0:$.middle,Ge=W||V||Y?0:$.right;return t.jsx("div",{className:`three-panel-layout ${p}`,style:{...Ve,...h},children:t.jsxs(r.PanelGroup,{ref:ve,direction:"horizontal",onLayout:Ie,children:[t.jsx(r.Panel,{ref:ye,collapsible:c.left||!T,defaultSize:f.left||!T?0:F.left,minSize:Xe,collapsedSize:0,onResize:$e,onCollapse:()=>O(!0),onExpand:()=>O(!1),className:He("left"),style:Ue,...i.left||{},children:t.jsx("div",{className:"panel-content-wrapper",style:{opacity:B?0:1,transition:W?`opacity ${.5*g}ms ${b}`:"none"},children:re})}),t.jsx(r.PanelResizeHandle,{className:"resize-handle left-handle "+(!Q&&T&&A?"":"collapsed"),onDragging:qe,disabled:Q||!T||!A,children:m&&c.left&&t.jsx("div",{className:"handle-bar",children:t.jsx("button",{onClick:Ae,className:"collapse-toggle",disabled:W,"aria-label":B?"Expand left panel":"Collapse left panel",children:B?"▸":"◂"})})}),t.jsx(r.Panel,{ref:xe,collapsible:c.middle||!A,defaultSize:f.middle||!A?0:F.middle,minSize:Ye,collapsedSize:0,onResize:Be,onCollapse:()=>q(!0),onExpand:()=>q(!1),className:He("middle"),style:We,...i.middle||{},children:t.jsx("div",{className:"panel-content-wrapper",style:{opacity:I?0:1,transition:V?`opacity ${.5*g}ms ${b}`:"none"},children:oe})}),t.jsx(r.PanelResizeHandle,{className:"resize-handle right-handle "+(ee||!P||!A&&!T?"collapsed":""),onDragging:qe,disabled:ee||!P||!A&&!T,children:m&&c.right&&t.jsx("div",{className:"handle-bar",children:t.jsx("button",{onClick:Fe,className:"collapse-toggle",disabled:Y,"aria-label":H?"Expand right panel":"Collapse right panel",children:H?"◂":"▸"})})}),t.jsx(r.Panel,{ref:we,collapsible:c.right||!P,defaultSize:f.right||!P?0:F.right,minSize:Ge,collapsedSize:0,onResize:Oe,onCollapse:()=>U(!0),onExpand:()=>U(!1),className:He("right"),style:Ke,...i.right||{},children:t.jsx("div",{className:"panel-content-wrapper",style:{opacity:H?0:1,transition:Y?`opacity ${.5*g}ms ${b}`:"none"},children:ae})})]})})},d=n.forwardRef(({panels:e,className:r="",style:o,theme:a,minPanelWidth:i=350,idealPanelWidth:s=.333,showSeparator:c=!1,onPanelChange:d,preventKeyboardScroll:u=!0,disableSwipe:p=!1},f)=>{const h=n.useRef(null),m=n.useRef(!1),g=n.useRef(null),b=l(a);n.useImperativeHandle(f,()=>({scrollToPanel:e=>{if(!h.current)return;const t=h.current,n=t.children[e];if(n){m.current=!0,g.current&&clearTimeout(g.current);const e=n.offsetLeft;t.scrollTo({left:e,behavior:"smooth"}),g.current=setTimeout(()=>{m.current=!1},500)}},getCurrentPanel:()=>{if(!h.current||0===h.current.children.length)return 0;const e=h.current,t=e.getBoundingClientRect().left;let n=0,r=1/0;for(let o=0;o<e.children.length;o++){const a=e.children[o].getBoundingClientRect(),l=Math.abs(a.left-t);l<r&&(r=l,n=o)}return n}}));n.useEffect(()=>{if(!u||!h.current)return;const e=h.current,t=e=>{const t=e.target;if("INPUT"===t.tagName||"TEXTAREA"===t.tagName||"SELECT"===t.tagName||t.isContentEditable||null!==t.closest(".xterm")||null!==t.closest('[contenteditable="true"]'))return;[" ","Space","ArrowUp","ArrowDown","ArrowLeft","ArrowRight","PageUp","PageDown"].includes(e.key)&&e.preventDefault()};return e.addEventListener("keydown",t),()=>{e.removeEventListener("keydown",t)}},[u]),n.useEffect(()=>()=>{g.current&&clearTimeout(g.current)},[]);const v=e.length,y=2*i;let x;x=1===v||2===v?"100%":`max(${i}px, ${100*s}%)`;const w=n.useId().replace(/:/g,"_");return t.jsxs(t.Fragment,{children:[2===v&&t.jsx("style",{children:`\n .snap-carousel-container[data-carousel-id="${w}"][data-panel-count="2"] .snap-carousel-panel {\n width: 100%;\n }\n @container (min-width: ${y}px) {\n .snap-carousel-container[data-carousel-id="${w}"][data-panel-count="2"] .snap-carousel-panel {\n width: 50%;\n }\n }\n `}),t.jsx("div",{ref:h,className:`snap-carousel-container ${p?"swipe-disabled":""} ${r}`,style:{...b,...o,"--snap-carousel-min-width":`${i}px`,"--snap-carousel-ideal-width":100*s+"%","--snap-carousel-gap":c?"1px":"0px","--snap-carousel-panel-width":x,"--snap-carousel-panel-count":v,"--snap-carousel-two-panel-threshold":`${y}px`},onScroll:e=>{if(!d||!h.current||0===h.current.children.length)return;if(m.current)return;const t=h.current,n=t.getBoundingClientRect().left;let r=0,o=1/0;for(let a=0;a<t.children.length;a++){const e=t.children[a].getBoundingClientRect(),l=Math.abs(e.left-n);l<o&&(o=l,r=a)}d(r)},"data-panel-count":v,"data-carousel-id":w,children:e.map((e,n)=>t.jsx("div",{className:"snap-carousel-panel",children:e},n))})]})});function u(e){const[t,r]=n.useState(()=>"undefined"!=typeof window&&window.matchMedia(e).matches);return n.useEffect(()=>{if("undefined"==typeof window)return;const t=window.matchMedia(e),n=e=>{r(e.matches)};return r(t.matches),t.addEventListener?(t.addEventListener("change",n),()=>t.removeEventListener("change",n)):(t.addListener(n),()=>t.removeListener(n))},[e]),t}d.displayName="SnapCarousel";const p="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement;function f(e){const t=Object.prototype.toString.call(e);return"[object Window]"===t||"[object global]"===t}function h(e){return"nodeType"in e}function m(e){var t,n;return e?f(e)?e:h(e)&&null!=(t=null==(n=e.ownerDocument)?void 0:n.defaultView)?t:window:window}function g(e){const{Document:t}=m(e);return e instanceof t}function b(e){return!f(e)&&e instanceof m(e).HTMLElement}function v(e){return e instanceof m(e).SVGElement}function y(e){return e?f(e)?e.document:h(e)?g(e)?e:b(e)||v(e)?e.ownerDocument:document:document:document}const x=p?n.useLayoutEffect:n.useEffect;function w(e){const t=n.useRef(e);return x(()=>{t.current=e}),n.useCallback(function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return null==t.current?void 0:t.current(...n)},[])}function C(e,t){void 0===t&&(t=[e]);const r=n.useRef(e);return x(()=>{r.current!==e&&(r.current=e)},t),r}function R(e,t){const r=n.useRef();return n.useMemo(()=>{const t=e(r.current);return r.current=t,t},[...t])}function S(e){const t=w(e),r=n.useRef(null),o=n.useCallback(e=>{e!==r.current&&(null==t||t(e,r.current)),r.current=e},[]);return[r,o]}function E(e){const t=n.useRef();return n.useEffect(()=>{t.current=e},[e]),t.current}let k={};function N(e,t){return n.useMemo(()=>{if(t)return t;const n=null==k[e]?0:k[e]+1;return k[e]=n,e+"-"+n},[e,t])}function D(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return r.reduce((t,n)=>{const r=Object.entries(n);for(const[o,a]of r){const n=t[o];null!=n&&(t[o]=n+e*a)}return t},{...t})}}const z=D(1),M=D(-1);function j(e){if(!e)return!1;const{KeyboardEvent:t}=m(e.target);return t&&e instanceof t}function T(e){if(function(e){if(!e)return!1;const{TouchEvent:t}=m(e.target);return t&&e instanceof t}(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return function(e){return"clientX"in e&&"clientY"in e}(e)?{x:e.clientX,y:e.clientY}:null}const A="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function P(e){return e.matches(A)?e:e.querySelector(A)}const L={display:"none"};function F(e){let{id:t,value:r}=e;return n.createElement("div",{id:t,style:L},r)}function $(e){let{id:t,announcement:r,ariaLiveType:o="assertive"}=e;return n.createElement("div",{id:t,style:{position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"},role:"status","aria-live":o,"aria-atomic":!0},r)}const B=n.createContext(null);const O={draggable:"\n To pick up a draggable item, press the space bar.\n While dragging, use the arrow keys to move the item.\n Press space again to drop the item in its new position, or press escape to cancel.\n "},I={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was moved over droppable area "+n.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was dropped over droppable area "+n.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function q(e){let{announcements:t=I,container:r,hiddenTextDescribedById:a,screenReaderInstructions:l=O}=e;const{announce:i,announcement:s}=function(){const[e,t]=n.useState("");return{announce:n.useCallback(e=>{null!=e&&t(e)},[]),announcement:e}}(),c=N("DndLiveRegion"),[d,u]=n.useState(!1);if(n.useEffect(()=>{u(!0)},[]),function(e){const t=n.useContext(B);n.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}(n.useMemo(()=>({onDragStart(e){let{active:n}=e;i(t.onDragStart({active:n}))},onDragMove(e){let{active:n,over:r}=e;t.onDragMove&&i(t.onDragMove({active:n,over:r}))},onDragOver(e){let{active:n,over:r}=e;i(t.onDragOver({active:n,over:r}))},onDragEnd(e){let{active:n,over:r}=e;i(t.onDragEnd({active:n,over:r}))},onDragCancel(e){let{active:n,over:r}=e;i(t.onDragCancel({active:n,over:r}))}}),[i,t])),!d)return null;const p=n.createElement(n.Fragment,null,n.createElement(F,{id:a,value:l.draggable}),n.createElement($,{id:c,announcement:s}));return r?o.createPortal(p,r):p}var H,U;function W(){}(U=H||(H={})).DragStart="dragStart",U.DragMove="dragMove",U.DragEnd="dragEnd",U.DragCancel="dragCancel",U.DragOver="dragOver",U.RegisterDroppable="registerDroppable",U.SetDroppableDisabled="setDroppableDisabled",U.UnregisterDroppable="unregisterDroppable";const K=Object.freeze({x:0,y:0});function V(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function X(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function Y(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function G(e,t,n){return void 0===t&&(t=e.left),void 0===n&&(n=e.top),{x:t+.5*e.width,y:n+.5*e.height}}const J=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=G(t,t.left,t.top),a=[];for(const l of r){const{id:e}=l,t=n.get(e);if(t){const n=V(G(t),o);a.push({id:e,data:{droppableContainer:l,value:n}})}}return a.sort(X)};function _(e,t){const n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),o=Math.min(t.left+t.width,e.left+e.width),a=Math.min(t.top+t.height,e.top+e.height),l=o-r,i=a-n;if(r<o&&n<a){const n=t.width*t.height,r=e.width*e.height,o=l*i;return Number((o/(n+r-o)).toFixed(4))}return 0}const Q=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=[];for(const a of r){const{id:e}=a,r=n.get(e);if(r){const n=_(r,t);n>0&&o.push({id:e,data:{droppableContainer:a,value:n}})}}return o.sort(Y)};function Z(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:K}function ee(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return r.reduce((t,n)=>({...t,top:t.top+e*n.y,bottom:t.bottom+e*n.y,left:t.left+e*n.x,right:t.right+e*n.x}),{...t})}}const te=ee(1);const ne={ignoreTransform:!1};function re(e,t){void 0===t&&(t=ne);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:t,transformOrigin:r}=m(e).getComputedStyle(e);t&&(n=function(e,t,n){const r=function(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}(t);if(!r)return e;const{scaleX:o,scaleY:a,x:l,y:i}=r,s=e.left-l-(1-o)*parseFloat(n),c=e.top-i-(1-a)*parseFloat(n.slice(n.indexOf(" ")+1)),d=o?e.width/o:e.width,u=a?e.height/a:e.height;return{width:d,height:u,top:c,right:s+d,bottom:c+u,left:s}}(n,t,r))}const{top:r,left:o,width:a,height:l,bottom:i,right:s}=n;return{top:r,left:o,width:a,height:l,bottom:i,right:s}}function oe(e){return re(e,{ignoreTransform:!0})}function ae(e,t){const n=[];return e?function r(o){if(null!=t&&n.length>=t)return n;if(!o)return n;if(g(o)&&null!=o.scrollingElement&&!n.includes(o.scrollingElement))return n.push(o.scrollingElement),n;if(!b(o)||v(o))return n;if(n.includes(o))return n;const a=m(e).getComputedStyle(o);return o!==e&&function(e,t){void 0===t&&(t=m(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(e=>{const r=t[e];return"string"==typeof r&&n.test(r)})}(o,a)&&n.push(o),function(e,t){return void 0===t&&(t=m(e).getComputedStyle(e)),"fixed"===t.position}(o,a)?n:r(o.parentNode)}(e):n}function le(e){const[t]=ae(e,1);return null!=t?t:null}function ie(e){return p&&e?f(e)?e:h(e)?g(e)||e===y(e).scrollingElement?window:b(e)?e:null:null:null}function se(e){return f(e)?e.scrollX:e.scrollLeft}function ce(e){return f(e)?e.scrollY:e.scrollTop}function de(e){return{x:se(e),y:ce(e)}}var ue,pe;function fe(e){return!(!p||!e)&&e===document.scrollingElement}function he(e){const t={x:0,y:0},n=fe(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height};return{isTop:e.scrollTop<=t.y,isLeft:e.scrollLeft<=t.x,isBottom:e.scrollTop>=r.y,isRight:e.scrollLeft>=r.x,maxScroll:r,minScroll:t}}(pe=ue||(ue={}))[pe.Forward=1]="Forward",pe[pe.Backward=-1]="Backward";const me={x:.2,y:.2};function ge(e,t,n,r,o){let{top:a,left:l,right:i,bottom:s}=n;void 0===r&&(r=10),void 0===o&&(o=me);const{isTop:c,isBottom:d,isLeft:u,isRight:p}=he(e),f={x:0,y:0},h={x:0,y:0},m=t.height*o.y,g=t.width*o.x;return!c&&a<=t.top+m?(f.y=ue.Backward,h.y=r*Math.abs((t.top+m-a)/m)):!d&&s>=t.bottom-m&&(f.y=ue.Forward,h.y=r*Math.abs((t.bottom-m-s)/m)),!p&&i>=t.right-g?(f.x=ue.Forward,h.x=r*Math.abs((t.right-g-i)/g)):!u&&l<=t.left+g&&(f.x=ue.Backward,h.x=r*Math.abs((t.left+g-l)/g)),{direction:f,speed:h}}function be(e){if(e===document.scrollingElement){const{innerWidth:e,innerHeight:t}=window;return{top:0,left:0,right:e,bottom:t,width:e,height:t}}const{top:t,left:n,right:r,bottom:o}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:o,width:e.clientWidth,height:e.clientHeight}}function ve(e){return e.reduce((e,t)=>z(e,de(t)),K)}const ye=[["x",["left","right"],function(e){return e.reduce((e,t)=>e+se(t),0)}],["y",["top","bottom"],function(e){return e.reduce((e,t)=>e+ce(t),0)}]];class xe{constructor(e,t){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const n=ae(t),r=ve(n);this.rect={...e},this.width=e.width,this.height=e.height;for(const[o,a,l]of ye)for(const e of a)Object.defineProperty(this,e,{get:()=>{const t=l(n),a=r[o]-t;return this.rect[e]+a},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class we{constructor(e){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(e=>{var t;return null==(t=this.target)?void 0:t.removeEventListener(...e)})},this.target=e}add(e,t,n){var r;null==(r=this.target)||r.addEventListener(e,t,n),this.listeners.push([e,t,n])}}function Ce(e,t){const n=Math.abs(e.x),r=Math.abs(e.y);return"number"==typeof t?Math.sqrt(n**2+r**2)>t:"x"in t&&"y"in t?n>t.x&&r>t.y:"x"in t?n>t.x:"y"in t&&r>t.y}var Re,Se,Ee,ke;function Ne(e){e.preventDefault()}function De(e){e.stopPropagation()}(Se=Re||(Re={})).Click="click",Se.DragStart="dragstart",Se.Keydown="keydown",Se.ContextMenu="contextmenu",Se.Resize="resize",Se.SelectionChange="selectionchange",Se.VisibilityChange="visibilitychange",(ke=Ee||(Ee={})).Space="Space",ke.Down="ArrowDown",ke.Right="ArrowRight",ke.Left="ArrowLeft",ke.Up="ArrowUp",ke.Esc="Escape",ke.Enter="Enter",ke.Tab="Tab";const ze={start:[Ee.Space,Ee.Enter],cancel:[Ee.Esc],end:[Ee.Space,Ee.Enter,Ee.Tab]},Me=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case Ee.Right:return{...n,x:n.x+25};case Ee.Left:return{...n,x:n.x-25};case Ee.Down:return{...n,y:n.y+25};case Ee.Up:return{...n,y:n.y-25}}};class je{constructor(e){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=e;const{event:{target:t}}=e;this.props=e,this.listeners=new we(y(t)),this.windowListeners=new we(m(t)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Re.Resize,this.handleCancel),this.windowListeners.add(Re.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Re.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:e,onStart:t}=this.props,n=e.node.current;n&&function(e,t){if(void 0===t&&(t=re),!e)return;const{top:n,left:r,bottom:o,right:a}=t(e);le(e)&&(o<=0||a<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}(n),t(K)}handleKeyDown(e){if(j(e)){const{active:t,context:n,options:r}=this.props,{keyboardCodes:o=ze,coordinateGetter:a=Me,scrollBehavior:l="smooth"}=r,{code:i}=e;if(o.end.includes(i))return void this.handleEnd(e);if(o.cancel.includes(i))return void this.handleCancel(e);const{collisionRect:s}=n.current,c=s?{x:s.left,y:s.top}:K;this.referenceCoordinates||(this.referenceCoordinates=c);const d=a(e,{active:t,context:n.current,currentCoordinates:c});if(d){const t=M(d,c),r={x:0,y:0},{scrollableAncestors:o}=n.current;for(const n of o){const o=e.code,{isTop:a,isRight:i,isLeft:s,isBottom:c,maxScroll:u,minScroll:p}=he(n),f=be(n),h={x:Math.min(o===Ee.Right?f.right-f.width/2:f.right,Math.max(o===Ee.Right?f.left:f.left+f.width/2,d.x)),y:Math.min(o===Ee.Down?f.bottom-f.height/2:f.bottom,Math.max(o===Ee.Down?f.top:f.top+f.height/2,d.y))},m=o===Ee.Right&&!i||o===Ee.Left&&!s,g=o===Ee.Down&&!c||o===Ee.Up&&!a;if(m&&h.x!==d.x){const e=n.scrollLeft+t.x,a=o===Ee.Right&&e<=u.x||o===Ee.Left&&e>=p.x;if(a&&!t.y)return void n.scrollTo({left:e,behavior:l});r.x=a?n.scrollLeft-e:o===Ee.Right?n.scrollLeft-u.x:n.scrollLeft-p.x,r.x&&n.scrollBy({left:-r.x,behavior:l});break}if(g&&h.y!==d.y){const e=n.scrollTop+t.y,a=o===Ee.Down&&e<=u.y||o===Ee.Up&&e>=p.y;if(a&&!t.x)return void n.scrollTo({top:e,behavior:l});r.y=a?n.scrollTop-e:o===Ee.Down?n.scrollTop-u.y:n.scrollTop-p.y,r.y&&n.scrollBy({top:-r.y,behavior:l});break}}this.handleMove(e,z(M(d,this.referenceCoordinates),r))}}}handleMove(e,t){const{onMove:n}=this.props;e.preventDefault(),n(t)}handleEnd(e){const{onEnd:t}=this.props;e.preventDefault(),this.detach(),t()}handleCancel(e){const{onCancel:t}=this.props;e.preventDefault(),this.detach(),t()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}function Te(e){return Boolean(e&&"distance"in e)}function Ae(e){return Boolean(e&&"delay"in e)}je.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=ze,onActivation:o}=t,{active:a}=n;const{code:l}=e.nativeEvent;if(r.start.includes(l)){const t=a.activatorNode.current;return(!t||e.target===t)&&(e.preventDefault(),null==o||o({event:e.nativeEvent}),!0)}return!1}}];class Pe{constructor(e,t,n){var r;void 0===n&&(n=function(e){const{EventTarget:t}=m(e);return e instanceof t?e:y(e)}(e.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=e,this.events=t;const{event:o}=e,{target:a}=o;this.props=e,this.events=t,this.document=y(a),this.documentListeners=new we(this.document),this.listeners=new we(n),this.windowListeners=new we(m(a)),this.initialCoordinates=null!=(r=T(o))?r:K,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:e,props:{options:{activationConstraint:t,bypassActivationConstraint:n}}}=this;if(this.listeners.add(e.move.name,this.handleMove,{passive:!1}),this.listeners.add(e.end.name,this.handleEnd),e.cancel&&this.listeners.add(e.cancel.name,this.handleCancel),this.windowListeners.add(Re.Resize,this.handleCancel),this.windowListeners.add(Re.DragStart,Ne),this.windowListeners.add(Re.VisibilityChange,this.handleCancel),this.windowListeners.add(Re.ContextMenu,Ne),this.documentListeners.add(Re.Keydown,this.handleKeydown),t){if(null!=n&&n({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(Ae(t))return this.timeoutId=setTimeout(this.handleStart,t.delay),void this.handlePending(t);if(Te(t))return void this.handlePending(t)}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),null!==this.timeoutId&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(e,t){const{active:n,onPending:r}=this.props;r(n,e,this.initialCoordinates,t)}handleStart(){const{initialCoordinates:e}=this,{onStart:t}=this.props;e&&(this.activated=!0,this.documentListeners.add(Re.Click,De,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Re.SelectionChange,this.removeTextSelection),t(e))}handleMove(e){var t;const{activated:n,initialCoordinates:r,props:o}=this,{onMove:a,options:{activationConstraint:l}}=o;if(!r)return;const i=null!=(t=T(e))?t:K,s=M(r,i);if(!n&&l){if(Te(l)){if(null!=l.tolerance&&Ce(s,l.tolerance))return this.handleCancel();if(Ce(s,l.distance))return this.handleStart()}return Ae(l)&&Ce(s,l.tolerance)?this.handleCancel():void this.handlePending(l,s)}e.cancelable&&e.preventDefault(),a(i)}handleEnd(){const{onAbort:e,onEnd:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleCancel(){const{onAbort:e,onCancel:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleKeydown(e){e.code===Ee.Esc&&this.handleCancel()}removeTextSelection(){var e;null==(e=this.document.getSelection())||e.removeAllRanges()}}const Le={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class Fe extends Pe{constructor(e){const{event:t}=e,n=y(t.target);super(e,Le,n)}}Fe.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!(!n.isPrimary||0!==n.button)&&(null==r||r({event:n}),!0)}}];const $e={move:{name:"mousemove"},end:{name:"mouseup"}};var Be,Oe;(Oe=Be||(Be={}))[Oe.RightClick=2]="RightClick";(class extends Pe{constructor(e){super(e,$e,y(e.event.target))}}).activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button!==Be.RightClick&&(null==r||r({event:n}),!0)}}];const Ie={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};var qe,He,Ue,We;function Ke(e){let{acceleration:t,activator:r=qe.Pointer,canScroll:o,draggingRect:a,enabled:l,interval:i=5,order:s=Ue.TreeOrder,pointerCoordinates:c,scrollableAncestors:d,scrollableAncestorRects:u,delta:p,threshold:f}=e;const h=function(e){let{delta:t,disabled:n}=e;const r=E(t);return R(e=>{if(n||!r||!e)return Ve;const o={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[ue.Backward]:e.x[ue.Backward]||-1===o.x,[ue.Forward]:e.x[ue.Forward]||1===o.x},y:{[ue.Backward]:e.y[ue.Backward]||-1===o.y,[ue.Forward]:e.y[ue.Forward]||1===o.y}}},[n,t,r])}({delta:p,disabled:!l}),[m,g]=function(){const e=n.useRef(null);return[n.useCallback((t,n)=>{e.current=setInterval(t,n)},[]),n.useCallback(()=>{null!==e.current&&(clearInterval(e.current),e.current=null)},[])]}(),b=n.useRef({x:0,y:0}),v=n.useRef({x:0,y:0}),y=n.useMemo(()=>{switch(r){case qe.Pointer:return c?{top:c.y,bottom:c.y,left:c.x,right:c.x}:null;case qe.DraggableRect:return a}},[r,a,c]),x=n.useRef(null),w=n.useCallback(()=>{const e=x.current;if(!e)return;const t=b.current.x*v.current.x,n=b.current.y*v.current.y;e.scrollBy(t,n)},[]),C=n.useMemo(()=>s===Ue.TreeOrder?[...d].reverse():d,[s,d]);n.useEffect(()=>{if(l&&d.length&&y){for(const e of C){if(!1===(null==o?void 0:o(e)))continue;const n=d.indexOf(e),r=u[n];if(!r)continue;const{direction:a,speed:l}=ge(e,r,y,t,f);for(const e of["x","y"])h[e][a[e]]||(l[e]=0,a[e]=0);if(l.x>0||l.y>0)return g(),x.current=e,m(w,i),b.current=l,void(v.current=a)}b.current={x:0,y:0},v.current={x:0,y:0},g()}else g()},[t,w,o,g,l,i,JSON.stringify(y),JSON.stringify(h),m,d,C,u,JSON.stringify(f)])}(class extends Pe{constructor(e){super(e,Ie)}static setup(){return window.addEventListener(Ie.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(Ie.move.name,e)};function e(){}}}).activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;const{touches:o}=n;return!(o.length>1)&&(null==r||r({event:n}),!0)}}],(He=qe||(qe={}))[He.Pointer=0]="Pointer",He[He.DraggableRect=1]="DraggableRect",(We=Ue||(Ue={}))[We.TreeOrder=0]="TreeOrder",We[We.ReversedTreeOrder=1]="ReversedTreeOrder";const Ve={x:{[ue.Backward]:!1,[ue.Forward]:!1},y:{[ue.Backward]:!1,[ue.Forward]:!1}};var Xe,Ye,Ge;(Ye=Xe||(Xe={}))[Ye.Always=0]="Always",Ye[Ye.BeforeDragging=1]="BeforeDragging",Ye[Ye.WhileDragging=2]="WhileDragging",(Ge||(Ge={})).Optimized="optimized";const Je=new Map;function _e(e,t){return R(n=>e?n||("function"==typeof t?t(e):e):null,[t,e])}function Qe(e){let{callback:t,disabled:r}=e;const o=w(t),a=n.useMemo(()=>{if(r||"undefined"==typeof window||void 0===window.ResizeObserver)return;const{ResizeObserver:e}=window;return new e(o)},[r]);return n.useEffect(()=>()=>null==a?void 0:a.disconnect(),[a]),a}function Ze(e){return new xe(re(e),e)}function et(e,t,r){void 0===t&&(t=Ze);const[o,a]=n.useState(null);function l(){a(n=>{if(!e)return null;var o;if(!1===e.isConnected)return null!=(o=null!=n?n:r)?o:null;const a=t(e);return JSON.stringify(n)===JSON.stringify(a)?n:a})}const i=function(e){let{callback:t,disabled:r}=e;const o=w(t),a=n.useMemo(()=>{if(r||"undefined"==typeof window||void 0===window.MutationObserver)return;const{MutationObserver:e}=window;return new e(o)},[o,r]);return n.useEffect(()=>()=>null==a?void 0:a.disconnect(),[a]),a}({callback(t){if(e)for(const n of t){const{type:t,target:r}=n;if("childList"===t&&r instanceof HTMLElement&&r.contains(e)){l();break}}}}),s=Qe({callback:l});return x(()=>{l(),e?(null==s||s.observe(e),null==i||i.observe(document.body,{childList:!0,subtree:!0})):(null==s||s.disconnect(),null==i||i.disconnect())},[e]),o}const tt=[];function nt(e,t){void 0===t&&(t=[]);const r=n.useRef(null);return n.useEffect(()=>{r.current=null},t),n.useEffect(()=>{const t=e!==K;t&&!r.current&&(r.current=e),!t&&r.current&&(r.current=null)},[e]),r.current?M(e,r.current):K}function rt(e){return n.useMemo(()=>e?function(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}(e):null,[e])}const ot=[];function at(e){let{measure:t}=e;const[r,o]=n.useState(null),a=Qe({callback:n.useCallback(e=>{for(const{target:n}of e)if(b(n)){o(e=>{const r=t(n);return e?{...e,width:r.width,height:r.height}:r});break}},[t])}),l=n.useCallback(e=>{const n=function(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return b(t)?t:e}(e);null==a||a.disconnect(),n&&(null==a||a.observe(n)),o(n?t(n):null)},[t,a]),[i,s]=S(l);return n.useMemo(()=>({nodeRef:i,rect:r,setRef:s}),[r,i,s])}const lt=[{sensor:Fe,options:{}},{sensor:je,options:{}}],it={current:{}},st={draggable:{measure:oe},droppable:{measure:oe,strategy:Xe.WhileDragging,frequency:Ge.Optimized},dragOverlay:{measure:re}};class ct extends Map{get(e){var t;return null!=e&&null!=(t=super.get(e))?t:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(e=>{let{disabled:t}=e;return!t})}getNodeFor(e){var t,n;return null!=(t=null==(n=this.get(e))?void 0:n.node.current)?t:void 0}}const dt={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new ct,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:W},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:st,measureDroppableContainers:W,windowRect:null,measuringScheduled:!1},ut={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:W,draggableNodes:new Map,over:null,measureDroppableContainers:W},pt=n.createContext(ut),ft=n.createContext(dt);function ht(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new ct}}}function mt(e,t){switch(t.type){case H.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case H.DragMove:return null==e.draggable.active?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case H.DragEnd:case H.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case H.RegisterDroppable:{const{element:n}=t,{id:r}=n,o=new ct(e.droppable.containers);return o.set(r,n),{...e,droppable:{...e.droppable,containers:o}}}case H.SetDroppableDisabled:{const{id:n,key:r,disabled:o}=t,a=e.droppable.containers.get(n);if(!a||r!==a.key)return e;const l=new ct(e.droppable.containers);return l.set(n,{...a,disabled:o}),{...e,droppable:{...e.droppable,containers:l}}}case H.UnregisterDroppable:{const{id:n,key:r}=t,o=e.droppable.containers.get(n);if(!o||r!==o.key)return e;const a=new ct(e.droppable.containers);return a.delete(n),{...e,droppable:{...e.droppable,containers:a}}}default:return e}}function gt(e){let{disabled:t}=e;const{active:r,activatorEvent:o,draggableNodes:a}=n.useContext(pt),l=E(o),i=E(null==r?void 0:r.id);return n.useEffect(()=>{if(!t&&!o&&l&&null!=i){if(!j(l))return;if(document.activeElement===l.target)return;const e=a.get(i);if(!e)return;const{activatorNode:t,node:n}=e;if(!t.current&&!n.current)return;requestAnimationFrame(()=>{for(const e of[t.current,n.current]){if(!e)continue;const t=P(e);if(t){t.focus();break}}})}},[o,t,a,i,l]),null}const bt=n.createContext({...K,scaleX:1,scaleY:1});var vt,yt;(yt=vt||(vt={}))[yt.Uninitialized=0]="Uninitialized",yt[yt.Initializing=1]="Initializing",yt[yt.Initialized=2]="Initialized";const xt=n.memo(function(e){var t,r,a,l;let{id:i,accessibility:s,autoScroll:c=!0,children:d,sensors:u=lt,collisionDetection:f=Q,measuring:h,modifiers:g,...b}=e;const v=n.useReducer(mt,void 0,ht),[y,w]=v,[S,E]=function(){const[e]=n.useState(()=>new Set),t=n.useCallback(t=>(e.add(t),()=>e.delete(t)),[e]);return[n.useCallback(t=>{let{type:n,event:r}=t;e.forEach(e=>{var t;return null==(t=e[n])?void 0:t.call(e,r)})},[e]),t]}(),[k,D]=n.useState(vt.Uninitialized),M=k===vt.Initialized,{draggable:{active:j,nodes:A,translate:P},droppable:{containers:L}}=y,F=null!=j?A.get(j):null,$=n.useRef({initial:null,translated:null}),O=n.useMemo(()=>{var e;return null!=j?{id:j,data:null!=(e=null==F?void 0:F.data)?e:it,rect:$}:null},[j,F]),I=n.useRef(null),[U,W]=n.useState(null),[V,X]=n.useState(null),Y=C(b,Object.values(b)),G=N("DndDescribedBy",i),J=n.useMemo(()=>L.getEnabled(),[L]),_=(ee=h,n.useMemo(()=>({draggable:{...st.draggable,...null==ee?void 0:ee.draggable},droppable:{...st.droppable,...null==ee?void 0:ee.droppable},dragOverlay:{...st.dragOverlay,...null==ee?void 0:ee.dragOverlay}}),[null==ee?void 0:ee.draggable,null==ee?void 0:ee.droppable,null==ee?void 0:ee.dragOverlay]));var ee;const{droppableRects:ne,measureDroppableContainers:oe,measuringScheduled:se}=function(e,t){let{dragging:r,dependencies:o,config:a}=t;const[l,i]=n.useState(null),{frequency:s,measure:c,strategy:d}=a,u=n.useRef(e),p=function(){switch(d){case Xe.Always:return!1;case Xe.BeforeDragging:return r;default:return!r}}(),f=C(p),h=n.useCallback(function(e){void 0===e&&(e=[]),f.current||i(t=>null===t?e:t.concat(e.filter(e=>!t.includes(e))))},[f]),m=n.useRef(null),g=R(t=>{if(p&&!r)return Je;if(!t||t===Je||u.current!==e||null!=l){const t=new Map;for(let n of e){if(!n)continue;if(l&&l.length>0&&!l.includes(n.id)&&n.rect.current){t.set(n.id,n.rect.current);continue}const e=n.node.current,r=e?new xe(c(e),e):null;n.rect.current=r,r&&t.set(n.id,r)}return t}return t},[e,l,r,p,c]);return n.useEffect(()=>{u.current=e},[e]),n.useEffect(()=>{p||h()},[r,p]),n.useEffect(()=>{l&&l.length>0&&i(null)},[JSON.stringify(l)]),n.useEffect(()=>{p||"number"!=typeof s||null!==m.current||(m.current=setTimeout(()=>{h(),m.current=null},s))},[s,p,h,...o]),{droppableRects:g,measureDroppableContainers:h,measuringScheduled:null!=l}}(J,{dragging:M,dependencies:[P.x,P.y],config:_.droppable}),ce=function(e,t){const n=null!=t?e.get(t):void 0,r=n?n.node.current:null;return R(e=>{var n;return null==t?null:null!=(n=null!=r?r:e)?n:null},[r,t])}(A,j),ue=n.useMemo(()=>V?T(V):null,[V]),pe=function(){const e=!1===(null==U?void 0:U.autoScrollEnabled),t="object"==typeof c?!1===c.enabled:!1===c,n=M&&!e&&!t;if("object"==typeof c)return{...c,enabled:n};return{enabled:n}}(),he=function(e,t){return _e(e,t)}(ce,_.draggable.measure);!function(e){let{activeNode:t,measure:r,initialRect:o,config:a=!0}=e;const l=n.useRef(!1),{x:i,y:s}="boolean"==typeof a?{x:a,y:a}:a;x(()=>{if(!i&&!s||!t)return void(l.current=!1);if(l.current||!o)return;const e=null==t?void 0:t.node.current;if(!e||!1===e.isConnected)return;const n=Z(r(e),o);if(i||(n.x=0),s||(n.y=0),l.current=!0,Math.abs(n.x)>0||Math.abs(n.y)>0){const t=le(e);t&&t.scrollBy({top:n.y,left:n.x})}},[t,i,s,o,r])}({activeNode:null!=j?A.get(j):null,config:pe.layoutShiftCompensation,initialRect:he,measure:_.draggable.measure});const me=et(ce,_.draggable.measure,he),ge=et(ce?ce.parentElement:null),be=n.useRef({activatorEvent:null,active:null,activeNode:ce,collisionRect:null,collisions:null,droppableRects:ne,draggableNodes:A,draggingNode:null,draggingNodeRect:null,droppableContainers:L,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),ye=L.getNodeFor(null==(t=be.current.over)?void 0:t.id),we=at({measure:_.dragOverlay.measure}),Ce=null!=(r=we.nodeRef.current)?r:ce,Re=M?null!=(a=we.rect)?a:me:null,Se=Boolean(we.nodeRef.current&&we.rect),Ee=Z(ke=Se?null:me,_e(ke));var ke;const Ne=rt(Ce?m(Ce):null),De=function(e){const t=n.useRef(e),r=R(n=>e?n&&n!==tt&&e&&t.current&&e.parentNode===t.current.parentNode?n:ae(e):tt,[e]);return n.useEffect(()=>{t.current=e},[e]),r}(M?null!=ye?ye:ce:null),ze=function(e,t){void 0===t&&(t=re);const[r]=e,o=rt(r?m(r):null),[a,l]=n.useState(ot);function i(){l(()=>e.length?e.map(e=>fe(e)?o:new xe(t(e),e)):ot)}const s=Qe({callback:i});return x(()=>{null==s||s.disconnect(),i(),e.forEach(e=>null==s?void 0:s.observe(e))},[e]),a}(De),Me=function(e,t){let{transform:n,...r}=t;return null!=e&&e.length?e.reduce((e,t)=>t({transform:e,...r}),n):n}(g,{transform:{x:P.x-Ee.x,y:P.y-Ee.y,scaleX:1,scaleY:1},activatorEvent:V,active:O,activeNodeRect:me,containerNodeRect:ge,draggingNodeRect:Re,over:be.current.over,overlayNodeRect:we.rect,scrollableAncestors:De,scrollableAncestorRects:ze,windowRect:Ne}),je=ue?z(ue,P):null,Te=function(e){const[t,r]=n.useState(null),o=n.useRef(e),a=n.useCallback(e=>{const t=ie(e.target);t&&r(e=>e?(e.set(t,de(t)),new Map(e)):null)},[]);return n.useEffect(()=>{const t=o.current;if(e!==t){n(t);const l=e.map(e=>{const t=ie(e);return t?(t.addEventListener("scroll",a,{passive:!0}),[t,de(t)]):null}).filter(e=>null!=e);r(l.length?new Map(l):null),o.current=e}return()=>{n(e),n(t)};function n(e){e.forEach(e=>{const t=ie(e);null==t||t.removeEventListener("scroll",a)})}},[a,e]),n.useMemo(()=>e.length?t?Array.from(t.values()).reduce((e,t)=>z(e,t),K):ve(e):K,[e,t])}(De),Ae=nt(Te),Pe=nt(Te,[me]),Le=z(Me,Ae),Fe=Re?te(Re,Me):null,$e=O&&Fe?f({active:O,collisionRect:Fe,droppableRects:ne,droppableContainers:J,pointerCoordinates:je}):null,Be=function(e,t){if(!e||0===e.length)return null;const[n]=e;return n[t]}($e,"id"),[Oe,Ie]=n.useState(null),qe=function(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}(Se?Me:z(Me,Pe),null!=(l=null==Oe?void 0:Oe.rect)?l:null,me),He=n.useRef(null),Ue=n.useCallback((e,t)=>{let{sensor:n,options:r}=t;if(null==I.current)return;const a=A.get(I.current);if(!a)return;const l=e.nativeEvent,i=new n({active:I.current,activeNode:a,event:l,options:r,context:be,onAbort(e){if(!A.get(e))return;const{onDragAbort:t}=Y.current,n={id:e};null==t||t(n),S({type:"onDragAbort",event:n})},onPending(e,t,n,r){if(!A.get(e))return;const{onDragPending:o}=Y.current,a={id:e,constraint:t,initialCoordinates:n,offset:r};null==o||o(a),S({type:"onDragPending",event:a})},onStart(e){const t=I.current;if(null==t)return;const n=A.get(t);if(!n)return;const{onDragStart:r}=Y.current,a={activatorEvent:l,active:{id:t,data:n.data,rect:$}};o.unstable_batchedUpdates(()=>{null==r||r(a),D(vt.Initializing),w({type:H.DragStart,initialCoordinates:e,active:t}),S({type:"onDragStart",event:a}),W(He.current),X(l)})},onMove(e){w({type:H.DragMove,coordinates:e})},onEnd:s(H.DragEnd),onCancel:s(H.DragCancel)});function s(e){return async function(){const{active:t,collisions:n,over:r,scrollAdjustedTranslate:a}=be.current;let i=null;if(t&&a){const{cancelDrop:o}=Y.current;if(i={activatorEvent:l,active:t,collisions:n,delta:a,over:r},e===H.DragEnd&&"function"==typeof o){await Promise.resolve(o(i))&&(e=H.DragCancel)}}I.current=null,o.unstable_batchedUpdates(()=>{w({type:e}),D(vt.Uninitialized),Ie(null),W(null),X(null),He.current=null;const t=e===H.DragEnd?"onDragEnd":"onDragCancel";if(i){const e=Y.current[t];null==e||e(i),S({type:t,event:i})}})}}He.current=i},[A]),We=function(e,t){return n.useMemo(()=>e.reduce((e,n)=>{const{sensor:r}=n;return[...e,...r.activators.map(e=>({eventName:e.eventName,handler:t(e.handler,n)}))]},[]),[e,t])}(u,n.useCallback((e,t)=>(n,r)=>{const o=n.nativeEvent,a=A.get(r);if(null!==I.current||!a||o.dndKit||o.defaultPrevented)return;const l={active:a};!0===e(n,t.options,l)&&(o.dndKit={capturedBy:t.sensor},I.current=r,Ue(n,t))},[A,Ue]));!function(e){n.useEffect(()=>{if(!p)return;const t=e.map(e=>{let{sensor:t}=e;return null==t.setup?void 0:t.setup()});return()=>{for(const e of t)null==e||e()}},e.map(e=>{let{sensor:t}=e;return t}))}(u),x(()=>{me&&k===vt.Initializing&&D(vt.Initialized)},[me,k]),n.useEffect(()=>{const{onDragMove:e}=Y.current,{active:t,activatorEvent:n,collisions:r,over:a}=be.current;if(!t||!n)return;const l={active:t,activatorEvent:n,collisions:r,delta:{x:Le.x,y:Le.y},over:a};o.unstable_batchedUpdates(()=>{null==e||e(l),S({type:"onDragMove",event:l})})},[Le.x,Le.y]),n.useEffect(()=>{const{active:e,activatorEvent:t,collisions:n,droppableContainers:r,scrollAdjustedTranslate:a}=be.current;if(!e||null==I.current||!t||!a)return;const{onDragOver:l}=Y.current,i=r.get(Be),s=i&&i.rect.current?{id:i.id,rect:i.rect.current,data:i.data,disabled:i.disabled}:null,c={active:e,activatorEvent:t,collisions:n,delta:{x:a.x,y:a.y},over:s};o.unstable_batchedUpdates(()=>{Ie(s),null==l||l(c),S({type:"onDragOver",event:c})})},[Be]),x(()=>{be.current={activatorEvent:V,active:O,activeNode:ce,collisionRect:Fe,collisions:$e,droppableRects:ne,draggableNodes:A,draggingNode:Ce,draggingNodeRect:Re,droppableContainers:L,over:Oe,scrollableAncestors:De,scrollAdjustedTranslate:Le},$.current={initial:Re,translated:Fe}},[O,ce,$e,Fe,A,Ce,Re,ne,L,Oe,De,Le]),Ke({...pe,delta:P,draggingRect:Fe,pointerCoordinates:je,scrollableAncestors:De,scrollableAncestorRects:ze});const Ve=n.useMemo(()=>({active:O,activeNode:ce,activeNodeRect:me,activatorEvent:V,collisions:$e,containerNodeRect:ge,dragOverlay:we,draggableNodes:A,droppableContainers:L,droppableRects:ne,over:Oe,measureDroppableContainers:oe,scrollableAncestors:De,scrollableAncestorRects:ze,measuringConfiguration:_,measuringScheduled:se,windowRect:Ne}),[O,ce,me,V,$e,ge,we,A,L,ne,Oe,oe,De,ze,_,se,Ne]),Ye=n.useMemo(()=>({activatorEvent:V,activators:We,active:O,activeNodeRect:me,ariaDescribedById:{draggable:G},dispatch:w,draggableNodes:A,over:Oe,measureDroppableContainers:oe}),[V,We,O,me,w,G,A,Oe,oe]);return n.createElement(B.Provider,{value:E},n.createElement(pt.Provider,{value:Ye},n.createElement(ft.Provider,{value:Ve},n.createElement(bt.Provider,{value:qe},d)),n.createElement(gt,{disabled:!1===(null==s?void 0:s.restoreFocus)})),n.createElement(q,{...s,hiddenTextDescribedById:G}))}),wt=n.createContext(null),Ct="button";function Rt(e){let{id:t,data:r,disabled:o=!1,attributes:a}=e;const l=N("Draggable"),{activators:i,activatorEvent:s,active:c,activeNodeRect:d,ariaDescribedById:u,draggableNodes:p,over:f}=n.useContext(pt),{role:h=Ct,roleDescription:m="draggable",tabIndex:g=0}=null!=a?a:{},b=(null==c?void 0:c.id)===t,v=n.useContext(b?bt:wt),[y,w]=S(),[R,E]=S(),k=function(e,t){return n.useMemo(()=>e.reduce((e,n)=>{let{eventName:r,handler:o}=n;return e[r]=e=>{o(e,t)},e},{}),[e,t])}(i,t),D=C(r);x(()=>(p.set(t,{id:t,key:l,node:y,activatorNode:R,data:D}),()=>{const e=p.get(t);e&&e.key===l&&p.delete(t)}),[p,t]);return{active:c,activatorEvent:s,activeNodeRect:d,attributes:n.useMemo(()=>({role:h,tabIndex:g,"aria-disabled":o,"aria-pressed":!(!b||h!==Ct)||void 0,"aria-roledescription":m,"aria-describedby":u.draggable}),[o,h,g,b,m,u.draggable]),isDragging:b,listeners:o?void 0:k,node:y,over:f,setNodeRef:w,setActivatorNodeRef:E,transform:v}}const St={timeout:25};const Et=({slotPosition:e,isEditing:r,isDragging:o,children:a})=>{const{attributes:l,listeners:i,setNodeRef:s,transform:c}=Rt({id:`slot-${e}`,data:{slotPosition:e},disabled:!r}),{setNodeRef:d,isOver:u}=function(e){let{data:t,disabled:r=!1,id:o,resizeObserverConfig:a}=e;const l=N("Droppable"),{active:i,dispatch:s,over:c,measureDroppableContainers:d}=n.useContext(pt),u=n.useRef({disabled:r}),p=n.useRef(!1),f=n.useRef(null),h=n.useRef(null),{disabled:m,updateMeasurementsFor:g,timeout:b}={...St,...a},v=C(null!=g?g:o),y=Qe({callback:n.useCallback(()=>{p.current?(null!=h.current&&clearTimeout(h.current),h.current=setTimeout(()=>{d(Array.isArray(v.current)?v.current:[v.current]),h.current=null},b)):p.current=!0},[b]),disabled:m||!i}),x=n.useCallback((e,t)=>{y&&(t&&(y.unobserve(t),p.current=!1),e&&y.observe(e))},[y]),[w,R]=S(x),E=C(t);return n.useEffect(()=>{y&&w.current&&(y.disconnect(),p.current=!1,y.observe(w.current))},[w,y]),n.useEffect(()=>(s({type:H.RegisterDroppable,element:{id:o,key:l,disabled:r,node:w,rect:f,data:E}}),()=>s({type:H.UnregisterDroppable,key:l,id:o})),[o]),n.useEffect(()=>{r!==u.current.disabled&&(s({type:H.SetDroppableDisabled,id:o,key:l,disabled:r}),u.current.disabled=r)},[o,l,r,s]),{active:i,rect:f,isOver:(null==c?void 0:c.id)===o,node:w,over:c,setNodeRef:R}}({id:`drop-${e}`,data:{slotPosition:e}}),p={position:"relative",height:"100%",width:"100%",transform:c?`translate3d(${c.x}px, ${c.y}px, 0)`:void 0},f=n.useCallback(e=>{s(e),d(e)},[s,d]);return t.jsxs("div",{ref:f,style:p,className:`slot-with-overlay ${r?"edit-mode":""} ${o?"dragging":""} ${u?"drag-over":""}`,children:[a,r&&t.jsxs("div",{className:"slot-edit-overlay",...l,...i,children:[t.jsx("div",{className:"drag-indicator",children:"⋮⋮"}),t.jsx("div",{className:"slot-position-label",children:e.toUpperCase()})]})]})},kt=({layout:e,activeSlot:r})=>{const[o,a]=n.useState(new Map);return n.useEffect(()=>{const e=()=>{const e=new Map;["left","middle","right"].forEach(t=>{const n=document.querySelector(`[data-slot="${t}"]`);if(n){const r=n.getBoundingClientRect();e.set(t,r)}}),a(e)};e(),window.addEventListener("resize",e);const t=setInterval(e,100);return()=>{window.removeEventListener("resize",e),clearInterval(t)}},[e]),t.jsx("div",{style:{pointerEvents:"none",position:"absolute",top:0,left:0,right:0,bottom:0,zIndex:999},children:["left","middle","right"].map(n=>{if(!e[n])return null;const a=o.get(n);if(!a)return null;const l=r===n;return t.jsx("div",{style:{position:"fixed",top:a.top,left:a.left,width:a.width,height:a.height,pointerEvents:"auto"},children:t.jsx(Et,{slotPosition:n,isEditing:!0,isDragging:l,children:t.jsx("div",{style:{height:"100%"}})})},n)})})},Nt=e=>null!=e&&"object"==typeof e&&"type"in e,Dt=e=>null==e?[]:"string"==typeof e?[e]:Nt(e)?e.panels:[];e.AnimatedResizableLayout=({leftPanel:e,rightPanel:o,collapsibleSide:a="left",defaultSize:i=25,minSize:s=5,className:c="",collapsed:d=!1,style:u,showCollapseButton:p=!1,animationDuration:f=300,animationEasing:h="cubic-bezier(0.4, 0, 0.2, 1)",onCollapseStart:m,onCollapseComplete:g,onExpandStart:b,onExpandComplete:v,theme:y})=>{const[x,w]=n.useState(d),[C,R]=n.useState(!1),[S,E]=n.useState(!1),[k,N]=n.useState(d),[D,z]=n.useState(d?0:i),M=n.useRef(null),j=n.useRef(void 0),T=n.useRef(void 0),A=n.useRef(void 0),P=n.useCallback((e,t,n)=>{if(!M.current)return;j.current&&cancelAnimationFrame(j.current),T.current=performance.now();const r=o=>{if(!T.current||!M.current)return;const a=o-T.current,l=Math.min(a/f,1),i=l<.5?4*l*l*l:1-Math.pow(-2*l+2,3)/2,s=e+(t-e)*i;M.current.resize(s),l<1?j.current=requestAnimationFrame(r):(0===t?M.current.collapse():M.current.resize(t),R(!1),n&&n())};j.current=requestAnimationFrame(r)},[f]),L=n.useCallback(()=>{C||S||(R(!0),w(!0),m&&m(),P(D,0,()=>{z(0),N(!0),g&&g()}))},[C,S,D,P,m,g]),F=n.useCallback(()=>{C||S||(R(!0),w(!1),N(!1),b&&b(),P(0,i,()=>{z(i),v&&v()}))},[C,S,i,P,b,v]),$=n.useCallback(()=>{x?F():L()},[x,L,F]),B=n.useCallback(e=>{C||(z(e),e>0&&w(!1))},[C]),O=n.useCallback(()=>{E(!0)},[]),I=n.useCallback(()=>{E(!1)},[]);n.useEffect(()=>{d!==x&&(d?L():F())},[d]),n.useEffect(()=>{d&&!C?N(!0):d||C||N(!1)},[d,C]),n.useEffect(()=>{const e=j.current,t=A.current;return()=>{e&&cancelAnimationFrame(e),t&&clearTimeout(t)}},[]);const q="left"===a,H=x?q?"▸":"◂":q?"◂":"▸",U=l(y),W=C&&!S?{transition:`flex ${f}ms ${h}`}:void 0,K=e=>{let t="hybrid-panel";return e&&(t+=" collapsible-panel",C&&!S&&(t+=" animating"),x&&(t+=" collapsed")),t};return t.jsx("div",{className:`animated-resizable-layout ${c}`,style:{...U,...u},children:t.jsxs(r.PanelGroup,{direction:"horizontal",onLayout:I,children:[t.jsx(r.Panel,{ref:q?M:void 0,collapsible:q,defaultSize:q?d?0:i:void 0,minSize:q?s:30,collapsedSize:0,onResize:q?B:void 0,onCollapse:q?()=>w(!0):void 0,onExpand:q?()=>w(!1):void 0,className:K(q),style:q?W:void 0,children:t.jsx("div",{className:"panel-content-wrapper",style:{opacity:q&&x?0:1,transition:C?`opacity ${.5*f}ms ${h}`:"none"},children:e})}),t.jsx(r.PanelResizeHandle,{className:"resize-handle "+(k?"collapsed":""),onDragging:O,style:k?{visibility:"hidden",width:0}:void 0,children:p&&t.jsx("div",{className:"handle-bar",children:t.jsx("button",{onClick:$,className:"collapse-toggle",disabled:C,"aria-label":x?"Expand panel":"Collapse panel",children:H})})}),t.jsx(r.Panel,{ref:q?void 0:M,collapsible:!q,defaultSize:q?void 0:d?0:i,minSize:q?30:s,collapsedSize:0,onResize:q?void 0:B,onCollapse:q?void 0:()=>w(!0),onExpand:q?void 0:()=>w(!1),className:K(!q),style:q?void 0:W,children:t.jsx("div",{className:"panel-content-wrapper",style:{opacity:!q&&x?0:1,transition:C?`opacity ${.5*f}ms ${h}`:"none"},children:o})})]})})},e.AnimatedVerticalLayout=({topPanel:e,bottomPanel:o,collapsiblePanels:a={top:!0,bottom:!0},defaultSizes:i={top:30,bottom:30},minSizes:s={top:5,bottom:5},className:c="",collapsed:d={top:!1,bottom:!1},style:u,showCollapseButtons:p=!1,animationDuration:f=300,animationEasing:h="cubic-bezier(0.4, 0, 0.2, 1)",theme:m,onTopCollapseStart:g,onTopCollapseComplete:b,onTopExpandStart:v,onTopExpandComplete:y,onBottomCollapseStart:x,onBottomCollapseComplete:w,onBottomExpandStart:C,onBottomExpandComplete:R,onPanelResize:S})=>{const[E,k]=n.useState(d.top||!1),[N,D]=n.useState(!1),[z,M]=n.useState(d.top?0:i.top),j=n.useRef(null),T=n.useRef(void 0),A=n.useRef(void 0),[P,L]=n.useState(d.bottom||!1),[F,$]=n.useState(!1),[B,O]=n.useState(d.bottom?0:i.bottom),I=n.useRef(null),q=n.useRef(void 0),H=n.useRef(void 0),[U,W]=n.useState(!1),K=n.useCallback((e,t,n)=>{if(!j.current)return;T.current&&cancelAnimationFrame(T.current),A.current=performance.now();const r=o=>{if(!A.current||!j.current)return;const a=o-A.current,l=Math.min(a/f,1),i=l<.5?4*l*l*l:1-Math.pow(-2*l+2,3)/2,s=e+(t-e)*i;j.current.resize(s),l<1?T.current=requestAnimationFrame(r):(0===t?j.current.collapse():j.current.resize(t),D(!1),n&&n())};T.current=requestAnimationFrame(r)},[f]),V=n.useCallback((e,t,n)=>{if(!I.current)return;q.current&&cancelAnimationFrame(q.current),H.current=performance.now();const r=o=>{if(!H.current||!I.current)return;const a=o-H.current,l=Math.min(a/f,1),i=l<.5?4*l*l*l:1-Math.pow(-2*l+2,3)/2,s=e+(t-e)*i;I.current.resize(s),l<1?q.current=requestAnimationFrame(r):(0===t?I.current.collapse():I.current.resize(t),$(!1),n&&n())};q.current=requestAnimationFrame(r)},[f]),X=n.useCallback(()=>{N||U||!a.top||(D(!0),k(!0),g&&g(),K(z,0,()=>{M(0),b&&b()}))},[N,U,z,a.top,K,g,b]),Y=n.useCallback(()=>{N||U||!a.top||(D(!0),k(!1),v&&v(),K(0,i.top,()=>{M(i.top),y&&y()}))},[N,U,i.top,a.top,K,v,y]),G=n.useCallback(()=>{E?Y():X()},[E,X,Y]),J=n.useCallback(()=>{F||U||!a.bottom||($(!0),L(!0),x&&x(),V(B,0,()=>{O(0),w&&w()}))},[F,U,B,a.bottom,V,x,w]),_=n.useCallback(()=>{F||U||!a.bottom||($(!0),L(!1),C&&C(),V(0,i.bottom,()=>{O(i.bottom),R&&R()}))},[F,U,i.bottom,a.bottom,V,C,R]),Q=n.useCallback(()=>{P?_():J()},[P,J,_]),Z=n.useCallback(e=>{N||(M(e),e>0&&k(!1))},[N]),ee=n.useCallback(e=>{F||(O(e),e>0&&L(!1))},[F]),te=n.useCallback(()=>{W(!0)},[]),ne=n.useCallback(()=>{W(!1),S&&S({top:z,bottom:B})},[z,B,S]);n.useEffect(()=>{void 0!==d.top&&d.top!==E&&(d.top?X():Y())},[d.top]),n.useEffect(()=>{void 0!==d.bottom&&d.bottom!==P&&(d.bottom?J():_())},[d.bottom]),n.useEffect(()=>()=>{T.current&&cancelAnimationFrame(T.current),q.current&&cancelAnimationFrame(q.current)},[]);const re=l(m),oe=N&&!U?{transition:`flex ${f}ms ${h}`}:void 0,ae=F&&!U?{transition:`flex ${f}ms ${h}`}:void 0;return t.jsx("div",{className:`animated-vertical-layout ${c}`,style:{...re,...u},children:t.jsxs(r.PanelGroup,{direction:"vertical",onLayout:ne,children:[t.jsx(r.Panel,{ref:j,collapsible:a.top,defaultSize:d.top?0:i.top,minSize:s.top,collapsedSize:0,onResize:Z,onCollapse:()=>k(!0),onExpand:()=>k(!1),className:(()=>{let e="vertical-panel collapsible-panel";return N&&!U&&(e+=" animating"),E&&(e+=" collapsed"),e})(),style:oe,children:t.jsx("div",{className:"panel-content-wrapper",style:{opacity:E?0:1,transition:N?`opacity ${.5*f}ms ${h}`:"none"},children:e})}),t.jsx(r.PanelResizeHandle,{className:"vertical-resize-handle",onDragging:te,children:p&&t.jsxs("div",{className:"handle-bar",children:[a.top&&t.jsx("button",{onClick:G,className:"collapse-toggle collapse-toggle-top",disabled:N,"aria-label":E?"Expand top panel":"Collapse top panel",children:E?"▾":"▴"}),a.bottom&&t.jsx("button",{onClick:Q,className:"collapse-toggle collapse-toggle-bottom",disabled:F,"aria-label":P?"Expand bottom panel":"Collapse bottom panel",children:P?"▴":"▾"})]})}),t.jsx(r.Panel,{ref:I,collapsible:a.bottom,defaultSize:d.bottom?0:i.bottom,minSize:s.bottom,collapsedSize:0,onResize:ee,onCollapse:()=>L(!0),onExpand:()=>L(!1),className:(()=>{let e="vertical-panel collapsible-panel";return F&&!U&&(e+=" animating"),P&&(e+=" collapsed"),e})(),style:ae,children:t.jsx("div",{className:"panel-content-wrapper",style:{opacity:P?0:1,transition:F?`opacity ${.5*f}ms ${h}`:"none"},children:o})})]})})},e.ConfigurablePanelLayout=c,e.EditableConfigurablePanelLayout=({isEditMode:e,onLayoutChange:r,panels:o,layout:a,...l})=>{const[i,s]=n.useState(null),[d,u]=n.useState({x:0,y:0}),p=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return n.useMemo(()=>[...t].filter(e=>null!=e),[...t])}((f=Fe,h={activationConstraint:{distance:8}},n.useMemo(()=>({sensor:f,options:null!=h?h:{}}),[f,h])));var f,h;const m=n.useCallback(e=>{const t=e.active.id;if(t.startsWith("slot-")){const e=t.replace("slot-","");s(e),u({x:0,y:0})}},[]),g=n.useCallback(e=>{const{delta:t}=e;u({x:t.x,y:t.y})},[]),b=n.useCallback(e=>{const{active:t,over:n}=e;if(s(null),u({x:0,y:0}),!n)return;const o=t.id,l=n.id,i=o.replace("slot-",""),c=l.replace("drop-","");if(i===c)return;const d={...a},p=d[i];d[i]=d[c],d[c]=p,r&&r(d)},[a,r]);n.useEffect(()=>{if(!i||!e)return;const t=document.querySelector(`[data-slot="${i}"]`);return t&&(t.setAttribute("data-dragging","true"),t.style.setProperty("transform",`scale(0.95) translate(${d.x}px, ${d.y}px)`,"important"),t.style.setProperty("z-index","1000","important"),t.style.setProperty("transition","none","important"),t.style.setProperty("opacity","0.95","important"),t.style.setProperty("box-shadow","0 12px 24px rgba(0, 0, 0, 0.25)","important")),()=>{t&&(t.removeAttribute("data-dragging"),t.style.removeProperty("transform"),t.style.removeProperty("z-index"),t.style.removeProperty("transition"),t.style.removeProperty("opacity"),t.style.removeProperty("box-shadow"))}},[i,d,e]);const v={left:{"data-slot":"left","data-edit-mode":e?"true":"false"},middle:{"data-slot":"middle","data-edit-mode":e?"true":"false"},right:{"data-slot":"right","data-edit-mode":e?"true":"false"}};return t.jsx(xt,{sensors:p,collisionDetection:J,onDragStart:m,onDragMove:g,onDragEnd:b,children:t.jsxs("div",{className:"editable-panel-layout "+(e?"edit-mode-active":""),children:[t.jsx(c,{...l,panels:o,layout:a,slotDataAttributes:v}),e&&t.jsx(kt,{layout:a,activeSlot:i,onDragStart:()=>{},onDragEnd:()=>{}})]})})},e.PanelConfigurator=({availablePanels:e,currentLayout:r,onChange:o,className:l="",theme:i})=>{const s=a.useTheme(),c=i||s.theme,[d,u]=n.useState(null),p=n.useCallback(t=>t&&e.find(e=>e.id===t)||null,[e]),f=n.useCallback(()=>[...e].sort((e,t)=>e.label.localeCompare(t.label)),[e]),h=n.useCallback(e=>{const t=Dt(r.left),n=Dt(r.middle),o=Dt(r.right);return t.includes(e)||n.includes(e)||o.includes(e)},[r]),m=n.useCallback((e,t)=>{const n={...e};return["left","middle","right"].forEach(e=>{const r=n[e];if(r===t)n[e]=null;else if(null!=r&&Nt(r)){const o=r.panels.filter(e=>e!==t);0===o.length?n[e]=null:1===o.length?n[e]=o[0]:n[e]={...r,panels:o}}}),n},[]),g=n.useCallback((e,t)=>{const n=r[e];if(!Nt(n)||"tabs"!==n.type)return;const a=n.panels.filter(e=>e!==t),l={...r};l[e]={...n,panels:a},o(l)},[r,o]),b=n.useCallback((e,t)=>{t.stopPropagation();const n=r[e];if(Nt(n)&&"tabs"===n.type){const t={...r};t[e]=n.panels.length>0?n.panels[0]:null,o(t),u(null)}else{const t=n&&"string"==typeof n?[n]:[],a={...r};a[e]={type:"tabs",panels:t,config:{defaultActiveTab:0,tabPosition:"top"}},o(a),u({type:"slot",position:e})}},[r,o]),v=n.useCallback(e=>{if(d)if("slot"===d.type){if(d.position===e)return;const t={...r},n=t[d.position];t[d.position]=t[e],t[e]=n,o(t),u(null)}else{const t=r[e];if(Nt(t)&&"tabs"===t.type){if(t.panels.includes(d.id))return void g(e,d.id);const n=t,a=m(r,d.id);return a[e]={...n,panels:[...n.panels,d.id]},void o(a)}{const t=m(r,d.id);t[e]=d.id,o(t),u(null)}}else u({type:"slot",position:e})},[d,r,o,m,g]),y=n.useCallback(e=>{if(d)if("slot"===d.type){const t=r[d.position];if(Nt(t)&&"tabs"===t.type){if(t.panels.includes(e))return void g(d.position,e);const n=t,a=m(r,e);return a[d.position]={...n,panels:[...n.panels,e]},void o(a)}{const t=m(r,e);t[d.position]=e,o(t),u(null)}}else u({type:"panel",id:e});else u({type:"panel",id:e})},[d,r,o,m,g]),x=n.useCallback((e,t)=>{t.stopPropagation();const n={...r};n[e]=null,o(n),u(null)},[r,o]),w=n.useCallback((e,t,n)=>{n.stopPropagation();const a=r[e];if(!Nt(a)||"tabs"!==a.type)return;const l=a.panels.filter(e=>e!==t),i={...r};i[e]={...a,panels:l},o(i)},[r,o]),C=n.useCallback((e,t)=>{const n=r[e];if(!Nt(n)||"tabs"!==n.type)return;const a={...r};a[e]={...n,config:{...n.config,...t}},o(a)},[r,o]),R=f(),S=e=>{const t=r[e];return Nt(t)&&"tabs"===t.type},E={"--configurator-bg":c.colors.background,"--configurator-title":c.colors.textSecondary,"--slot-bg":c.colors.backgroundSecondary,"--slot-border":c.colors.border,"--slot-border-hover":c.colors.textTertiary,"--slot-border-selected":c.colors.primary,"--slot-bg-selected":c.colors.backgroundLight,"--slot-label":c.colors.textTertiary,"--slot-content-text":c.colors.text,"--slot-preview-bg":c.colors.backgroundTertiary,"--slot-preview-border":c.colors.border,"--slot-preview-text":c.colors.textMuted,"--slot-empty-text":c.colors.textMuted,"--panel-bg":c.colors.backgroundSecondary,"--panel-border":c.colors.border,"--panel-border-hover":c.colors.textSecondary,"--panel-border-selected":c.colors.primary,"--panel-bg-selected":c.colors.backgroundLight,"--panel-label-text":c.colors.text,"--panel-preview-bg":c.colors.backgroundTertiary,"--panel-preview-text":c.colors.textMuted,"--clear-btn-bg":c.colors.error,"--clear-btn-text":c.colors.background,"--clear-btn-hover":c.colors.error,"--hint-bg":c.colors.backgroundLight,"--hint-border":c.colors.primary,"--hint-text":c.colors.text};return t.jsxs("div",{className:`panel-configurator ${l}`,style:E,children:[t.jsxs("div",{className:"configurator-section",children:[t.jsx("h3",{className:"section-title",children:"Panel Layout (3 Slots)"}),t.jsx("div",{className:"slots-container",children:["left","middle","right"].map(e=>{const n=r[e],o=(e=>"slot"===d?.type&&d.position===e)(e),a=Nt(n)&&"tabs"===n.type,l=null!==n;return t.jsxs("div",{"data-position":e,className:`slot ${o?"selected":""} ${l?"filled":"empty"} ${a?"tab-group":""}`,onClick:()=>v(e),children:[t.jsx("button",{className:"tab-mode-toggle "+(a?"active":""),onClick:t=>b(e,t),title:a?"Disable tab mode":"Enable tab mode",children:t.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",children:t.jsx("path",{d:"M2 2h4v2H2V2zm5 0h4v2H7V2zm5 0h2v2h-2V2zM2 5h12v9H2V5zm1 1v7h10V6H3z"})})}),null===n?t.jsx("div",{className:"slot-empty-state",children:a?"Click panels to add tabs":"Empty"}):Nt(n)?t.jsxs("div",{className:"slot-content group-content",children:["tabs"===n.type&&n.panels.length>0&&t.jsx("div",{className:"tab-config-controls",children:t.jsxs("label",{className:"tab-config-label",children:["Tabs:",t.jsxs("select",{value:n.config?.tabPosition||"top",onChange:t=>C(e,{tabPosition:t.target.value}),onClick:e=>e.stopPropagation(),children:[t.jsx("option",{value:"top",children:"Top (centered)"}),t.jsx("option",{value:"bottom",children:"Bottom (centered)"}),t.jsx("option",{value:"left",children:"Left"}),t.jsx("option",{value:"right",children:"Right"})]})]})}),t.jsx("div",{className:"group-panels",children:0===n.panels.length?t.jsx("div",{className:"slot-empty-state",children:"Click panels to add tabs"}):n.panels.map((r,o)=>{const a=p(r),l="tabs"===n.type&&(n.config?.defaultActiveTab??0)===o;return a?t.jsxs("div",{className:"group-panel-item",children:[t.jsxs("span",{className:"group-panel-label",children:[a.label,l&&t.jsx("span",{className:"default-badge",children:"★"})]}),t.jsx("button",{className:"remove-from-group-btn",onClick:t=>w(e,r,t),title:`Remove ${a.label}`,children:"×"})]},r):null})})]}):t.jsxs("div",{className:"slot-content",children:["string"==typeof n&&p(n)?.preview&&t.jsx("div",{className:"slot-preview",children:p(n)?.preview}),t.jsx("div",{className:"slot-panel-label",children:"string"==typeof n?p(n)?.label:""}),t.jsx("button",{className:"slot-clear-btn",onClick:t=>x(e,t),"aria-label":`Remove ${"string"==typeof n?p(n)?.label:"panel"} from ${e} slot`,children:"×"})]})]},e)})})]}),t.jsxs("div",{className:"configurator-section",children:[t.jsx("h3",{className:"section-title",children:"Available Panels"}),t.jsx("div",{className:"available-panels",children:R.map(e=>{const n=(r=e.id,"panel"===d?.type&&d.id===r);var r;const o=h(e.id);return t.jsxs("div",{className:`available-panel ${n?"selected":""} ${o?"in-use":""}`,onClick:()=>y(e.id),children:[t.jsx("div",{className:"panel-label",children:e.label}),e.preview&&t.jsx("div",{className:"panel-preview",children:e.preview})]},e.id)})})]}),d&&t.jsx("div",{className:"selection-hint",children:"slot"===d.type?S(d.position)?t.jsxs(t.Fragment,{children:["Selected: ",d.position," slot (Tab Mode). Click panels to add them to the tab group."]}):t.jsxs(t.Fragment,{children:["Selected: ",d.position," slot. Click another slot to swap, or click a panel to assign."]}):t.jsxs(t.Fragment,{children:["Selected: ",p(d.id)?.label,". Click a slot to assign",S("left")||S("middle")||S("right")?" (or add to tab group)":"","."]})}),t.jsxs("div",{className:"usage-hint",children:[t.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",style:{verticalAlign:"text-bottom",marginRight:"4px"},children:t.jsx("path",{d:"M8 1a7 7 0 100 14A7 7 0 008 1zm0 1a6 6 0 110 12A6 6 0 018 2zm.5 3.5v3h-1v-3h1zm0 4v1h-1v-1h1z"})}),t.jsx("strong",{children:"Tip:"})," Toggle the tab icon on a slot to enable tab mode, then click panels to add multiple tabs."]})]})},e.ResponsiveConfigurablePanelLayout=({mobileBreakpoint:e="(max-width: 768px)",mobileCarouselProps:r,onMobilePanelChange:o,theme:a,layout:l,panels:p,...f})=>{const h=u(e),m=n.useRef(null),[g,b]=n.useState(0),v=n.useMemo(()=>[l?.left,l?.middle,l?.right],[l]),y=["left","middle","right"],x=n.useMemo(()=>{const e=e=>{if(!e)return null;const t=p.find(t=>t.id===e);return t?.content??null},n=e=>{const t=p.find(t=>t.id===e);return t?.label??e},r=e=>{const t=p.find(t=>t.id===e);return t?.icon??null};return v.map((o,l)=>((o,l)=>{if(null==o)return null;if("object"==typeof o&&"type"in o){const e=o;if("tabs"===e.type){const o=e.panels[0],i=e.panels.length>0?n(o):"Tab Group",c=e.panels.length>0?r(o):null;return{content:t.jsx(s,{panelIds:e.panels,panels:p,config:e.config,theme:a}),label:i,icon:c,slot:l}}return null}return{content:e(o),label:n(o),icon:r(o),slot:l}})(o,y[l])).filter(e=>null!==e)},[v,p,a]),w=e=>{b(e),r?.onPanelChange?.(e);const t=x[e]?.slot;t&&o?.(e,t)},{onPanelChange:C,...R}=r??{},S=i(a);if(h){if(0===x.length)return null;const e=x.map(e=>e.content);return t.jsxs("div",{className:"mobile-tab-layout",style:S,children:[t.jsx("div",{className:"mobile-tab-content",children:t.jsx(d,{ref:m,theme:a,panels:e,minPanelWidth:0,idealPanelWidth:1,disableSwipe:!0,onPanelChange:w,...R})}),t.jsx("nav",{className:"mobile-tab-nav",role:"tablist",children:x.map((e,n)=>t.jsxs("button",{role:"tab","aria-selected":n===g,className:"mobile-tab-button "+(n===g?"active":""),onClick:()=>(e=>{b(e),m.current?.scrollToPanel(e);const t=x[e]?.slot;t&&o?.(e,t)})(n),children:[e.icon&&t.jsx("span",{className:"tab-icon",children:e.icon}),t.jsx("span",{className:"tab-label",children:e.label})]},n))})]})}return t.jsx(c,{theme:a,layout:l,panels:p,...f})},e.SnapCarousel=d,e.TabGroup=s,e.mapThemeToPanelVars=l,e.mapThemeToTabVars=i,e.useMediaQuery=u,Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})});
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react/jsx-runtime"),require("react"),require("react-resizable-panels"),require("react-dom"),require("@principal-ade/industry-theme")):"function"==typeof define&&define.amd?define(["exports","react/jsx-runtime","react","react-resizable-panels","react-dom","@principal-ade/industry-theme"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).A24ZPanels={},e["react/jsx-runtime"],e.React,e.ReactResizablePanels,e.ReactDOM,e.IndustryTheme)}(this,function(e,t,n,r,a,o){"use strict";function l(e){return{"--panel-background":e.colors.background,"--panel-border":e.colors.border,"--panel-handle":e.colors.backgroundSecondary,"--panel-handle-hover":e.colors.backgroundHover,"--panel-handle-active":e.colors.primary,"--panel-button-bg":e.colors.surface,"--panel-button-hover":e.colors.backgroundHover,"--panel-button-border":e.colors.border,"--panel-button-icon":e.colors.textSecondary,"--panel-accent-bg":e.colors.primary+"15"}}function i(e){return{"--tab-list-bg":e.colors.backgroundSecondary,"--tab-border":e.colors.border,"--tab-bg":e.colors.surface,"--tab-bg-hover":e.colors.backgroundHover,"--tab-bg-active":e.colors.primary,"--tab-text":e.colors.textSecondary,"--tab-text-hover":e.colors.text,"--tab-text-active":e.colors.background,"--tab-icon-color":e.colors.textTertiary,"--tab-icon-active":e.colors.background,"--tab-border-hover":e.colors.textSecondary,"--tab-border-active":e.colors.primary,"--tab-focus":e.colors.primary,"--tab-content-bg":e.colors.background,"--tab-empty-text":e.colors.textMuted,"--tab-font-family":e.fonts.body,"--tab-font-size":"11px","--tab-font-weight":String(e.fontWeights.medium),"--mobile-tab-text-active":e.colors.primary,"--mobile-tab-icon-active":e.colors.primary}}const s=({panelIds:e,panels:r,config:a={},className:o="",theme:l})=>{const{defaultActiveTab:s=0,tabPosition:c="top",centered:d=!0,hideTabList:u=!1,activeTabIndex:p,onTabChange:h}=a,[f,m]=n.useState(s),g=void 0!==p,b=g?p:f;n.useEffect(()=>{g||m(s)},[s,g]);const v=i(l),y=e.map(e=>r.find(t=>t.id===e)).filter(e=>void 0!==e),x=Math.min(b,y.length-1),w=y[x];if(0===y.length)return t.jsx("div",{className:"tab-group-empty",children:"No panels available"});const C="top"===c||"bottom"===c||d,S=t.jsx("div",{className:"tab-list "+(C?"centered":""),role:"tablist",children:y.map((e,n)=>t.jsx("button",{role:"tab","aria-selected":n===x,"aria-controls":`tabpanel-${e.id}`,id:`tab-${e.id}`,className:"tab-button "+(n===x?"active":""),onClick:()=>(e=>{g||m(e),h?.(e)})(n),title:e.icon?e.label:void 0,children:e.icon?t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"tab-icon",children:e.icon}),t.jsx("span",{className:"tab-label",children:e.label})]}):e.label},e.id))}),R=w?t.jsx("div",{className:"tab-content",role:"tabpanel",id:`tabpanel-${w.id}`,"aria-labelledby":`tab-${w.id}`,children:w.content}):null;return t.jsxs("div",{className:`tab-group tab-position-${c} ${o}`,style:v,children:[!u&&("top"===c||"left"===c)&&S,R,!u&&("bottom"===c||"right"===c)&&S]})},c={x:0,y:0,width:0,height:0},d=n.createContext(null),u=({slot:e,children:r})=>{const a=n.useRef(null),[o,l]=n.useState(c),i=n.useCallback(()=>{if(a.current){const e=a.current.getBoundingClientRect();l({x:e.left,y:e.top,width:e.width,height:e.height})}},[]);n.useEffect(()=>{const e=a.current;if(!e)return;i();const t=new ResizeObserver(()=>{i()});return t.observe(e),window.addEventListener("resize",i),window.addEventListener("scroll",i,!0),()=>{t.disconnect(),window.removeEventListener("resize",i),window.removeEventListener("scroll",i,!0)}},[i]);const s={slot:e,bounds:o};return t.jsx(d.Provider,{value:s,children:t.jsx("div",{ref:a,className:"panel-bounds-container",style:{width:"100%",height:"100%"},children:r})})};function p(){const e=n.useContext(d);return e?{slot:e.slot,bounds:e.bounds,isInPanel:!0}:{slot:null,bounds:c,isInPanel:!1}}const h=({panels:e,layout:o,slotDataAttributes:i={},collapsiblePanels:c={left:!0,middle:!1,right:!0},defaultSizes:d={left:20,middle:60,right:20},minSizes:p={left:5,middle:10,right:5},className:h="",collapsed:f={left:!1,middle:!1,right:!1},style:m,showCollapseButtons:g=!1,animationDuration:b=300,animationEasing:v="cubic-bezier(0.4, 0, 0.2, 1)",theme:y,onLeftCollapseStart:x,onLeftCollapseComplete:w,onLeftExpandStart:C,onLeftExpandComplete:S,onMiddleCollapseStart:R,onMiddleCollapseComplete:E,onMiddleExpandStart:k,onMiddleExpandComplete:N,onRightCollapseStart:j,onRightCollapseComplete:z,onRightExpandStart:D,onRightExpandComplete:M,onPanelResize:T})=>{const P=null!==o.left&&void 0!==o.left,A=null!==o.middle&&void 0!==o.middle,L=null!==o.right&&void 0!==o.right,F=[P,A,L].filter(Boolean).length,$={left:P?d?.left??(2===F?50:3===F?20:100):0,middle:A?d?.middle??(2===F?50:3===F?60:100):0,right:L?d?.right??(2===F?50:3===F?20:100):0},B={left:p?.left??5,middle:p?.middle??10,right:p?.right??5},[O,I]=n.useState(f.left||!P),[q,H]=n.useState(f.middle||!A),[W,U]=n.useState(f.right||!L),[K,V]=n.useState(!1),[X,Y]=n.useState(!1),[G,J]=n.useState(!1),[_,Q]=n.useState(!1),Z=O&&!K,ee=q&&!X,te=W&&!G,ne=n.useCallback(t=>{if(!t)return null;const n=e.find(e=>e.id===t);return n?.content||null},[e]),re=n.useCallback(n=>{if(null===n)return null;if("object"==typeof n&&"type"in n){const r=n;return"tabs"===r.type?t.jsx(s,{panelIds:r.panels,panels:e,config:r.config,theme:y}):null}return ne(n)},[e,ne,y]),ae=re(o.left??null),oe=re(o.middle??null),le=re(o.right??null),[ie,se]=n.useState(f.left||!P?0:$.left),[ce,de]=n.useState(f.middle||!A?0:$.middle),[ue,pe]=n.useState(f.right||!L?0:$.right),[he,fe]=n.useState($.left),[me,ge]=n.useState($.middle),[be,ve]=n.useState($.right),ye=n.useRef(null),xe=n.useRef(null),we=n.useRef(null),Ce=n.useRef(null),Se=n.useRef(void 0),Re=n.useRef(void 0),Ee=n.useRef(void 0),ke=n.useRef(void 0),Ne=n.useRef(void 0),je=n.useRef(void 0),ze=n.useCallback((e,t)=>{const n=e.filter(e=>e.panelRef.current);if(0===n.length)return;n.forEach(e=>{e.animationFrameRef.current&&cancelAnimationFrame(e.animationFrameRef.current)});let r=0;const a=()=>{r++;const e=r/10;if(e>=1)return n.forEach(e=>{e.panelRef.current&&(0===e.toSize?e.panelRef.current.collapse():e.panelRef.current.resize(e.toSize))}),void(t&&t());const o=e<.5?4*e*e*e:1-Math.pow(-2*e+2,3)/2;n.forEach(e=>{if(e.panelRef.current){const t=e.fromSize+(e.toSize-e.fromSize)*o;e.panelRef.current.resize(t)}}),n[0].animationFrameRef.current=requestAnimationFrame(()=>{setTimeout(a,b/10)})};a()},[b]),De=n.useCallback(()=>{K||_||!c.left||(a.flushSync(()=>{V(!0),Y(!0),J(!0),I(!0)}),x&&x(),Se.current&&cancelAnimationFrame(Se.current),Se.current=requestAnimationFrame(()=>{const e=ye.current?.getLayout(),t=Math.round(1e3*(e?.[0]??ie))/1e3,n=Math.round(1e3*(e?.[1]??ce))/1e3,r=Math.round(1e3*(e?.[2]??ue))/1e3,a=n+r,o=a>0?n/a*100:A?50:0,l=a>0?r/a*100:L?50:0;o>0&&ge(o),l>0&&ve(l),ze([{panelRef:xe,fromSize:t,toSize:0,animationFrameRef:Se,startTimeRef:ke},{panelRef:we,fromSize:n,toSize:o,animationFrameRef:Re,startTimeRef:Ne},{panelRef:Ce,fromSize:r,toSize:l,animationFrameRef:Ee,startTimeRef:je}],()=>{se(0),de(o),pe(l),V(!1),Y(!1),J(!1),w&&w()})}))},[K,_,ie,ce,ue,A,L,c.left,ze,x,w]),Me=n.useCallback(()=>{K||_||!c.left||(a.flushSync(()=>{V(!0),Y(!0),J(!0),I(!1)}),C&&C(),Se.current&&cancelAnimationFrame(Se.current),Se.current=requestAnimationFrame(()=>{const e=ye.current?.getLayout(),t=Math.round(1e3*(e?.[0]??0))/1e3,n=Math.round(1e3*(e?.[1]??ce))/1e3,r=Math.round(1e3*(e?.[2]??ue))/1e3,a=he||$.left,o=100-a,l=n+r,i=l>0?n/l*o:A?o/2:0,s=l>0?r/l*o:L?o/2:0;i>0&&ge(i),s>0&&ve(s),ze([{panelRef:xe,fromSize:t,toSize:a,animationFrameRef:Se,startTimeRef:ke},{panelRef:we,fromSize:n,toSize:i,animationFrameRef:Re,startTimeRef:Ne},{panelRef:Ce,fromSize:r,toSize:s,animationFrameRef:Ee,startTimeRef:je}],()=>{se(a),de(i),pe(s),V(!1),Y(!1),J(!1),S&&S()})}))},[K,_,ce,ue,$.left,he,A,L,c.left,ze,C,S]),Te=n.useCallback(()=>{G||_||!c.right||(a.flushSync(()=>{V(!0),Y(!0),J(!0),U(!0)}),j&&j(),Ee.current&&cancelAnimationFrame(Ee.current),Ee.current=requestAnimationFrame(()=>{const e=ye.current?.getLayout(),t=Math.round(1e3*(e?.[0]??ie))/1e3,n=Math.round(1e3*(e?.[1]??ce))/1e3,r=Math.round(1e3*(e?.[2]??ue))/1e3,a=t+n,o=a>0?t/a*100:P?50:0,l=a>0?n/a*100:A?50:0;o>0&&fe(o),l>0&&ge(l),ze([{panelRef:xe,fromSize:t,toSize:o,animationFrameRef:Se,startTimeRef:ke},{panelRef:we,fromSize:n,toSize:l,animationFrameRef:Re,startTimeRef:Ne},{panelRef:Ce,fromSize:r,toSize:0,animationFrameRef:Ee,startTimeRef:je}],()=>{se(o),de(l),pe(0),V(!1),Y(!1),J(!1),z&&z()})}))},[G,_,ie,ce,ue,P,A,c.right,ze,j,z]),Pe=n.useCallback(()=>{G||_||!c.right||(a.flushSync(()=>{V(!0),Y(!0),J(!0),U(!1)}),D&&D(),Ee.current&&cancelAnimationFrame(Ee.current),Ee.current=requestAnimationFrame(()=>{const e=ye.current?.getLayout(),t=Math.round(1e3*(e?.[0]??ie))/1e3,n=Math.round(1e3*(e?.[1]??ce))/1e3,r=Math.round(1e3*(e?.[2]??0))/1e3,a=be||$.right,o=100-a,l=t+n,i=l>0?t/l*o:P?o/2:0,s=l>0?n/l*o:A?o/2:0;i>0&&fe(i),s>0&&ge(s),ze([{panelRef:xe,fromSize:t,toSize:i,animationFrameRef:Se,startTimeRef:ke},{panelRef:we,fromSize:n,toSize:s,animationFrameRef:Re,startTimeRef:Ne},{panelRef:Ce,fromSize:r,toSize:a,animationFrameRef:Ee,startTimeRef:je}],()=>{se(i),de(s),pe(a),V(!1),Y(!1),J(!1),M&&M()})}))},[G,_,ie,ce,$.right,be,P,A,c.right,ze,D,M]),Ae=n.useCallback(()=>{O?Me():De()},[O,De,Me]),Le=n.useCallback(()=>{X||_||!c.middle||(a.flushSync(()=>{V(!0),Y(!0),J(!0),H(!0)}),R&&R(),Re.current&&cancelAnimationFrame(Re.current),Re.current=requestAnimationFrame(()=>{const e=ye.current?.getLayout(),t=Math.round(1e3*(e?.[0]??ie))/1e3,n=Math.round(1e3*(e?.[1]??ce))/1e3,r=Math.round(1e3*(e?.[2]??ue))/1e3,a=t+r,o=a>0?t/a*100:P?50:0,l=a>0?r/a*100:L?50:0;o>0&&fe(o),l>0&&ve(l),ze([{panelRef:xe,fromSize:t,toSize:o,animationFrameRef:Se,startTimeRef:ke},{panelRef:we,fromSize:n,toSize:0,animationFrameRef:Re,startTimeRef:Ne},{panelRef:Ce,fromSize:r,toSize:l,animationFrameRef:Ee,startTimeRef:je}],()=>{se(o),de(0),pe(l),V(!1),Y(!1),J(!1),E&&E()})}))},[X,_,ie,ce,ue,P,L,c.middle,ze,R,E]),Fe=n.useCallback(()=>{X||_||!c.middle||(a.flushSync(()=>{V(!0),Y(!0),J(!0),H(!1)}),k&&k(),Re.current&&cancelAnimationFrame(Re.current),Re.current=requestAnimationFrame(()=>{const e=ye.current?.getLayout(),t=Math.round(1e3*(e?.[0]??ie))/1e3,n=Math.round(1e3*(e?.[1]??0))/1e3,r=Math.round(1e3*(e?.[2]??ue))/1e3,a=me||$.middle,o=100-a,l=t+r,i=l>0?t/l*o:P?o/2:0,s=l>0?r/l*o:L?o/2:0;i>0&&fe(i),s>0&&ve(s),ze([{panelRef:xe,fromSize:t,toSize:i,animationFrameRef:Se,startTimeRef:ke},{panelRef:we,fromSize:n,toSize:a,animationFrameRef:Re,startTimeRef:Ne},{panelRef:Ce,fromSize:r,toSize:s,animationFrameRef:Ee,startTimeRef:je}],()=>{se(i),de(a),pe(s),V(!1),Y(!1),J(!1),N&&N()})}))},[X,_,ie,ue,$.middle,me,P,L,c.middle,ze,k,N]),$e=n.useCallback(()=>{W?Pe():Te()},[W,Te,Pe]),Be=n.useCallback(e=>{K||X||G||(se(e),e>0&&(fe(e),I(!1)))},[K,X,G]),Oe=n.useCallback(e=>{K||X||G||(de(e),e>0&&(ge(e),H(!1)))},[K,X,G]),Ie=n.useCallback(e=>{K||X||G||(pe(e),e>0&&(ve(e),U(!1)))},[K,X,G]),qe=n.useCallback(()=>{if(T){T({left:O?he:ie,middle:q?me:ce,right:W?be:ue})}},[ie,ce,ue,O,q,W,he,me,be,T]),He=n.useCallback(e=>{Q(e),e||qe()},[qe]);n.useEffect(()=>{void 0!==f.left&&f.left!==O&&queueMicrotask(()=>{f.left?De():Me()})},[f.left,O,De,Me]),n.useEffect(()=>{void 0!==f.middle&&f.middle!==q&&queueMicrotask(()=>{f.middle?Le():Fe()})},[f.middle,q,Le,Fe]),n.useEffect(()=>{void 0!==f.right&&f.right!==W&&queueMicrotask(()=>{f.right?Te():Pe()})},[f.right,W,Te,Pe]),n.useEffect(()=>()=>{Se.current&&cancelAnimationFrame(Se.current),Re.current&&cancelAnimationFrame(Re.current),Ee.current&&cancelAnimationFrame(Ee.current)},[]);const We=e=>{let t="three-panel-item";return"left"===e?!c.left&&P||(t+=" collapsible-panel",K&&!_&&(t+=" animating"),Z&&(t+=" collapsed")):"middle"===e?(t+=" middle-panel",!c.middle&&A||(t+=" collapsible-panel",X&&!_&&(t+=" animating"),ee&&(t+=" collapsed"))):"right"===e&&(!c.right&&L||(t+=" collapsible-panel",G&&!_&&(t+=" animating"),te&&(t+=" collapsed"))),t},Ue=K&&!_?{transition:`width ${b}ms ${v}`,width:O?"0%":`${$.left}%`}:void 0,Ke=X&&!_?{transition:`width ${b}ms ${v}`,width:q?"0%":`${$.middle}%`}:void 0,Ve=G&&!_?{transition:`width ${b}ms ${v}`,width:W?"0%":`${$.right}%`}:void 0,Xe=l(y),Ye=K||X||G?0:B.left,Ge=K||X||G?0:B.middle,Je=K||X||G?0:B.right;return t.jsx("div",{className:`three-panel-layout ${h}`,style:{...Xe,...m},children:t.jsxs(r.PanelGroup,{ref:ye,direction:"horizontal",onLayout:qe,children:[t.jsx(r.Panel,{ref:xe,collapsible:c.left||!P,defaultSize:f.left||!P?0:$.left,minSize:Ye,collapsedSize:0,onResize:Be,onCollapse:()=>I(!0),onExpand:()=>I(!1),className:We("left"),style:Ue,...i.left||{},children:t.jsx("div",{className:"panel-content-wrapper",style:{opacity:O?0:1,transition:K?`opacity ${.5*b}ms ${v}`:"none"},children:t.jsx(u,{slot:"left",children:ae})})}),t.jsx(r.PanelResizeHandle,{className:"resize-handle left-handle "+(!Z&&P&&A?"":"collapsed"),onDragging:He,disabled:Z||!P||!A,children:g&&c.left&&t.jsx("div",{className:"handle-bar",children:t.jsx("button",{onClick:Ae,className:"collapse-toggle",disabled:K,"aria-label":O?"Expand left panel":"Collapse left panel",children:O?"▸":"◂"})})}),t.jsx(r.Panel,{ref:we,collapsible:c.middle||!A,defaultSize:f.middle||!A?0:$.middle,minSize:Ge,collapsedSize:0,onResize:Oe,onCollapse:()=>H(!0),onExpand:()=>H(!1),className:We("middle"),style:Ke,...i.middle||{},children:t.jsx("div",{className:"panel-content-wrapper",style:{opacity:q?0:1,transition:X?`opacity ${.5*b}ms ${v}`:"none"},children:t.jsx(u,{slot:"middle",children:oe})})}),t.jsx(r.PanelResizeHandle,{className:"resize-handle right-handle "+(te||!L||!A&&!P?"collapsed":""),onDragging:He,disabled:te||!L||!A&&!P,children:g&&c.right&&t.jsx("div",{className:"handle-bar",children:t.jsx("button",{onClick:$e,className:"collapse-toggle",disabled:G,"aria-label":W?"Expand right panel":"Collapse right panel",children:W?"◂":"▸"})})}),t.jsx(r.Panel,{ref:Ce,collapsible:c.right||!L,defaultSize:f.right||!L?0:$.right,minSize:Je,collapsedSize:0,onResize:Ie,onCollapse:()=>U(!0),onExpand:()=>U(!1),className:We("right"),style:Ve,...i.right||{},children:t.jsx("div",{className:"panel-content-wrapper",style:{opacity:W?0:1,transition:G?`opacity ${.5*b}ms ${v}`:"none"},children:t.jsx(u,{slot:"right",children:le})})})]})})},f=n.forwardRef(({panels:e,className:r="",style:a,theme:o,minPanelWidth:i=350,idealPanelWidth:s=.333,showSeparator:c=!1,onPanelChange:d,preventKeyboardScroll:u=!0,disableSwipe:p=!1},h)=>{const f=n.useRef(null),m=n.useRef(!1),g=n.useRef(null),b=l(o);n.useImperativeHandle(h,()=>({scrollToPanel:e=>{if(!f.current)return;const t=f.current,n=t.children[e];if(n){m.current=!0,g.current&&clearTimeout(g.current);const e=n.offsetLeft;t.scrollTo({left:e,behavior:"smooth"}),g.current=setTimeout(()=>{m.current=!1},500)}},getCurrentPanel:()=>{if(!f.current||0===f.current.children.length)return 0;const e=f.current,t=e.getBoundingClientRect().left;let n=0,r=1/0;for(let a=0;a<e.children.length;a++){const o=e.children[a].getBoundingClientRect(),l=Math.abs(o.left-t);l<r&&(r=l,n=a)}return n}}));n.useEffect(()=>{if(!u||!f.current)return;const e=f.current,t=e=>{const t=e.target;if("INPUT"===t.tagName||"TEXTAREA"===t.tagName||"SELECT"===t.tagName||t.isContentEditable||null!==t.closest(".xterm")||null!==t.closest('[contenteditable="true"]'))return;[" ","Space","ArrowUp","ArrowDown","ArrowLeft","ArrowRight","PageUp","PageDown"].includes(e.key)&&e.preventDefault()};return e.addEventListener("keydown",t),()=>{e.removeEventListener("keydown",t)}},[u]),n.useEffect(()=>()=>{g.current&&clearTimeout(g.current)},[]);const v=e.length,y=2*i;let x;x=1===v||2===v?"100%":`max(${i}px, ${100*s}%)`;const w=n.useId().replace(/:/g,"_");return t.jsxs(t.Fragment,{children:[2===v&&t.jsx("style",{children:`\n .snap-carousel-container[data-carousel-id="${w}"][data-panel-count="2"] .snap-carousel-panel {\n width: 100%;\n }\n @container (min-width: ${y}px) {\n .snap-carousel-container[data-carousel-id="${w}"][data-panel-count="2"] .snap-carousel-panel {\n width: 50%;\n }\n }\n `}),t.jsx("div",{ref:f,className:`snap-carousel-container ${p?"swipe-disabled":""} ${r}`,style:{...b,...a,"--snap-carousel-min-width":`${i}px`,"--snap-carousel-ideal-width":100*s+"%","--snap-carousel-gap":c?"1px":"0px","--snap-carousel-panel-width":x,"--snap-carousel-panel-count":v,"--snap-carousel-two-panel-threshold":`${y}px`},onScroll:e=>{if(!d||!f.current||0===f.current.children.length)return;if(m.current)return;const t=f.current,n=t.getBoundingClientRect().left;let r=0,a=1/0;for(let o=0;o<t.children.length;o++){const e=t.children[o].getBoundingClientRect(),l=Math.abs(e.left-n);l<a&&(a=l,r=o)}d(r)},"data-panel-count":v,"data-carousel-id":w,children:e.map((e,n)=>t.jsx("div",{className:"snap-carousel-panel",children:e},n))})]})});function m(e){const[t,r]=n.useState(()=>"undefined"!=typeof window&&window.matchMedia(e).matches);return n.useEffect(()=>{if("undefined"==typeof window)return;const t=window.matchMedia(e),n=e=>{r(e.matches)};return r(t.matches),t.addEventListener?(t.addEventListener("change",n),()=>t.removeEventListener("change",n)):(t.addListener(n),()=>t.removeListener(n))},[e]),t}f.displayName="SnapCarousel";const g="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement;function b(e){const t=Object.prototype.toString.call(e);return"[object Window]"===t||"[object global]"===t}function v(e){return"nodeType"in e}function y(e){var t,n;return e?b(e)?e:v(e)&&null!=(t=null==(n=e.ownerDocument)?void 0:n.defaultView)?t:window:window}function x(e){const{Document:t}=y(e);return e instanceof t}function w(e){return!b(e)&&e instanceof y(e).HTMLElement}function C(e){return e instanceof y(e).SVGElement}function S(e){return e?b(e)?e.document:v(e)?x(e)?e:w(e)||C(e)?e.ownerDocument:document:document:document}const R=g?n.useLayoutEffect:n.useEffect;function E(e){const t=n.useRef(e);return R(()=>{t.current=e}),n.useCallback(function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return null==t.current?void 0:t.current(...n)},[])}function k(e,t){void 0===t&&(t=[e]);const r=n.useRef(e);return R(()=>{r.current!==e&&(r.current=e)},t),r}function N(e,t){const r=n.useRef();return n.useMemo(()=>{const t=e(r.current);return r.current=t,t},[...t])}function j(e){const t=E(e),r=n.useRef(null),a=n.useCallback(e=>{e!==r.current&&(null==t||t(e,r.current)),r.current=e},[]);return[r,a]}function z(e){const t=n.useRef();return n.useEffect(()=>{t.current=e},[e]),t.current}let D={};function M(e,t){return n.useMemo(()=>{if(t)return t;const n=null==D[e]?0:D[e]+1;return D[e]=n,e+"-"+n},[e,t])}function T(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),a=1;a<n;a++)r[a-1]=arguments[a];return r.reduce((t,n)=>{const r=Object.entries(n);for(const[a,o]of r){const n=t[a];null!=n&&(t[a]=n+e*o)}return t},{...t})}}const P=T(1),A=T(-1);function L(e){if(!e)return!1;const{KeyboardEvent:t}=y(e.target);return t&&e instanceof t}function F(e){if(function(e){if(!e)return!1;const{TouchEvent:t}=y(e.target);return t&&e instanceof t}(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return function(e){return"clientX"in e&&"clientY"in e}(e)?{x:e.clientX,y:e.clientY}:null}const $="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function B(e){return e.matches($)?e:e.querySelector($)}const O={display:"none"};function I(e){let{id:t,value:r}=e;return n.createElement("div",{id:t,style:O},r)}function q(e){let{id:t,announcement:r,ariaLiveType:a="assertive"}=e;return n.createElement("div",{id:t,style:{position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"},role:"status","aria-live":a,"aria-atomic":!0},r)}const H=n.createContext(null);const W={draggable:"\n To pick up a draggable item, press the space bar.\n While dragging, use the arrow keys to move the item.\n Press space again to drop the item in its new position, or press escape to cancel.\n "},U={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was moved over droppable area "+n.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was dropped over droppable area "+n.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function K(e){let{announcements:t=U,container:r,hiddenTextDescribedById:o,screenReaderInstructions:l=W}=e;const{announce:i,announcement:s}=function(){const[e,t]=n.useState("");return{announce:n.useCallback(e=>{null!=e&&t(e)},[]),announcement:e}}(),c=M("DndLiveRegion"),[d,u]=n.useState(!1);if(n.useEffect(()=>{u(!0)},[]),function(e){const t=n.useContext(H);n.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}(n.useMemo(()=>({onDragStart(e){let{active:n}=e;i(t.onDragStart({active:n}))},onDragMove(e){let{active:n,over:r}=e;t.onDragMove&&i(t.onDragMove({active:n,over:r}))},onDragOver(e){let{active:n,over:r}=e;i(t.onDragOver({active:n,over:r}))},onDragEnd(e){let{active:n,over:r}=e;i(t.onDragEnd({active:n,over:r}))},onDragCancel(e){let{active:n,over:r}=e;i(t.onDragCancel({active:n,over:r}))}}),[i,t])),!d)return null;const p=n.createElement(n.Fragment,null,n.createElement(I,{id:o,value:l.draggable}),n.createElement(q,{id:c,announcement:s}));return r?a.createPortal(p,r):p}var V,X;function Y(){}(X=V||(V={})).DragStart="dragStart",X.DragMove="dragMove",X.DragEnd="dragEnd",X.DragCancel="dragCancel",X.DragOver="dragOver",X.RegisterDroppable="registerDroppable",X.SetDroppableDisabled="setDroppableDisabled",X.UnregisterDroppable="unregisterDroppable";const G=Object.freeze({x:0,y:0});function J(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function _(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function Q(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function Z(e,t,n){return void 0===t&&(t=e.left),void 0===n&&(n=e.top),{x:t+.5*e.width,y:n+.5*e.height}}const ee=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const a=Z(t,t.left,t.top),o=[];for(const l of r){const{id:e}=l,t=n.get(e);if(t){const n=J(Z(t),a);o.push({id:e,data:{droppableContainer:l,value:n}})}}return o.sort(_)};function te(e,t){const n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),a=Math.min(t.left+t.width,e.left+e.width),o=Math.min(t.top+t.height,e.top+e.height),l=a-r,i=o-n;if(r<a&&n<o){const n=t.width*t.height,r=e.width*e.height,a=l*i;return Number((a/(n+r-a)).toFixed(4))}return 0}const ne=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const a=[];for(const o of r){const{id:e}=o,r=n.get(e);if(r){const n=te(r,t);n>0&&a.push({id:e,data:{droppableContainer:o,value:n}})}}return a.sort(Q)};function re(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:G}function ae(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),a=1;a<n;a++)r[a-1]=arguments[a];return r.reduce((t,n)=>({...t,top:t.top+e*n.y,bottom:t.bottom+e*n.y,left:t.left+e*n.x,right:t.right+e*n.x}),{...t})}}const oe=ae(1);const le={ignoreTransform:!1};function ie(e,t){void 0===t&&(t=le);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:t,transformOrigin:r}=y(e).getComputedStyle(e);t&&(n=function(e,t,n){const r=function(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}(t);if(!r)return e;const{scaleX:a,scaleY:o,x:l,y:i}=r,s=e.left-l-(1-a)*parseFloat(n),c=e.top-i-(1-o)*parseFloat(n.slice(n.indexOf(" ")+1)),d=a?e.width/a:e.width,u=o?e.height/o:e.height;return{width:d,height:u,top:c,right:s+d,bottom:c+u,left:s}}(n,t,r))}const{top:r,left:a,width:o,height:l,bottom:i,right:s}=n;return{top:r,left:a,width:o,height:l,bottom:i,right:s}}function se(e){return ie(e,{ignoreTransform:!0})}function ce(e,t){const n=[];return e?function r(a){if(null!=t&&n.length>=t)return n;if(!a)return n;if(x(a)&&null!=a.scrollingElement&&!n.includes(a.scrollingElement))return n.push(a.scrollingElement),n;if(!w(a)||C(a))return n;if(n.includes(a))return n;const o=y(e).getComputedStyle(a);return a!==e&&function(e,t){void 0===t&&(t=y(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(e=>{const r=t[e];return"string"==typeof r&&n.test(r)})}(a,o)&&n.push(a),function(e,t){return void 0===t&&(t=y(e).getComputedStyle(e)),"fixed"===t.position}(a,o)?n:r(a.parentNode)}(e):n}function de(e){const[t]=ce(e,1);return null!=t?t:null}function ue(e){return g&&e?b(e)?e:v(e)?x(e)||e===S(e).scrollingElement?window:w(e)?e:null:null:null}function pe(e){return b(e)?e.scrollX:e.scrollLeft}function he(e){return b(e)?e.scrollY:e.scrollTop}function fe(e){return{x:pe(e),y:he(e)}}var me,ge;function be(e){return!(!g||!e)&&e===document.scrollingElement}function ve(e){const t={x:0,y:0},n=be(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height};return{isTop:e.scrollTop<=t.y,isLeft:e.scrollLeft<=t.x,isBottom:e.scrollTop>=r.y,isRight:e.scrollLeft>=r.x,maxScroll:r,minScroll:t}}(ge=me||(me={}))[ge.Forward=1]="Forward",ge[ge.Backward=-1]="Backward";const ye={x:.2,y:.2};function xe(e,t,n,r,a){let{top:o,left:l,right:i,bottom:s}=n;void 0===r&&(r=10),void 0===a&&(a=ye);const{isTop:c,isBottom:d,isLeft:u,isRight:p}=ve(e),h={x:0,y:0},f={x:0,y:0},m=t.height*a.y,g=t.width*a.x;return!c&&o<=t.top+m?(h.y=me.Backward,f.y=r*Math.abs((t.top+m-o)/m)):!d&&s>=t.bottom-m&&(h.y=me.Forward,f.y=r*Math.abs((t.bottom-m-s)/m)),!p&&i>=t.right-g?(h.x=me.Forward,f.x=r*Math.abs((t.right-g-i)/g)):!u&&l<=t.left+g&&(h.x=me.Backward,f.x=r*Math.abs((t.left+g-l)/g)),{direction:h,speed:f}}function we(e){if(e===document.scrollingElement){const{innerWidth:e,innerHeight:t}=window;return{top:0,left:0,right:e,bottom:t,width:e,height:t}}const{top:t,left:n,right:r,bottom:a}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:a,width:e.clientWidth,height:e.clientHeight}}function Ce(e){return e.reduce((e,t)=>P(e,fe(t)),G)}const Se=[["x",["left","right"],function(e){return e.reduce((e,t)=>e+pe(t),0)}],["y",["top","bottom"],function(e){return e.reduce((e,t)=>e+he(t),0)}]];class Re{constructor(e,t){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const n=ce(t),r=Ce(n);this.rect={...e},this.width=e.width,this.height=e.height;for(const[a,o,l]of Se)for(const e of o)Object.defineProperty(this,e,{get:()=>{const t=l(n),o=r[a]-t;return this.rect[e]+o},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class Ee{constructor(e){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(e=>{var t;return null==(t=this.target)?void 0:t.removeEventListener(...e)})},this.target=e}add(e,t,n){var r;null==(r=this.target)||r.addEventListener(e,t,n),this.listeners.push([e,t,n])}}function ke(e,t){const n=Math.abs(e.x),r=Math.abs(e.y);return"number"==typeof t?Math.sqrt(n**2+r**2)>t:"x"in t&&"y"in t?n>t.x&&r>t.y:"x"in t?n>t.x:"y"in t&&r>t.y}var Ne,je,ze,De;function Me(e){e.preventDefault()}function Te(e){e.stopPropagation()}(je=Ne||(Ne={})).Click="click",je.DragStart="dragstart",je.Keydown="keydown",je.ContextMenu="contextmenu",je.Resize="resize",je.SelectionChange="selectionchange",je.VisibilityChange="visibilitychange",(De=ze||(ze={})).Space="Space",De.Down="ArrowDown",De.Right="ArrowRight",De.Left="ArrowLeft",De.Up="ArrowUp",De.Esc="Escape",De.Enter="Enter",De.Tab="Tab";const Pe={start:[ze.Space,ze.Enter],cancel:[ze.Esc],end:[ze.Space,ze.Enter,ze.Tab]},Ae=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case ze.Right:return{...n,x:n.x+25};case ze.Left:return{...n,x:n.x-25};case ze.Down:return{...n,y:n.y+25};case ze.Up:return{...n,y:n.y-25}}};class Le{constructor(e){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=e;const{event:{target:t}}=e;this.props=e,this.listeners=new Ee(S(t)),this.windowListeners=new Ee(y(t)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Ne.Resize,this.handleCancel),this.windowListeners.add(Ne.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Ne.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:e,onStart:t}=this.props,n=e.node.current;n&&function(e,t){if(void 0===t&&(t=ie),!e)return;const{top:n,left:r,bottom:a,right:o}=t(e);de(e)&&(a<=0||o<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}(n),t(G)}handleKeyDown(e){if(L(e)){const{active:t,context:n,options:r}=this.props,{keyboardCodes:a=Pe,coordinateGetter:o=Ae,scrollBehavior:l="smooth"}=r,{code:i}=e;if(a.end.includes(i))return void this.handleEnd(e);if(a.cancel.includes(i))return void this.handleCancel(e);const{collisionRect:s}=n.current,c=s?{x:s.left,y:s.top}:G;this.referenceCoordinates||(this.referenceCoordinates=c);const d=o(e,{active:t,context:n.current,currentCoordinates:c});if(d){const t=A(d,c),r={x:0,y:0},{scrollableAncestors:a}=n.current;for(const n of a){const a=e.code,{isTop:o,isRight:i,isLeft:s,isBottom:c,maxScroll:u,minScroll:p}=ve(n),h=we(n),f={x:Math.min(a===ze.Right?h.right-h.width/2:h.right,Math.max(a===ze.Right?h.left:h.left+h.width/2,d.x)),y:Math.min(a===ze.Down?h.bottom-h.height/2:h.bottom,Math.max(a===ze.Down?h.top:h.top+h.height/2,d.y))},m=a===ze.Right&&!i||a===ze.Left&&!s,g=a===ze.Down&&!c||a===ze.Up&&!o;if(m&&f.x!==d.x){const e=n.scrollLeft+t.x,o=a===ze.Right&&e<=u.x||a===ze.Left&&e>=p.x;if(o&&!t.y)return void n.scrollTo({left:e,behavior:l});r.x=o?n.scrollLeft-e:a===ze.Right?n.scrollLeft-u.x:n.scrollLeft-p.x,r.x&&n.scrollBy({left:-r.x,behavior:l});break}if(g&&f.y!==d.y){const e=n.scrollTop+t.y,o=a===ze.Down&&e<=u.y||a===ze.Up&&e>=p.y;if(o&&!t.x)return void n.scrollTo({top:e,behavior:l});r.y=o?n.scrollTop-e:a===ze.Down?n.scrollTop-u.y:n.scrollTop-p.y,r.y&&n.scrollBy({top:-r.y,behavior:l});break}}this.handleMove(e,P(A(d,this.referenceCoordinates),r))}}}handleMove(e,t){const{onMove:n}=this.props;e.preventDefault(),n(t)}handleEnd(e){const{onEnd:t}=this.props;e.preventDefault(),this.detach(),t()}handleCancel(e){const{onCancel:t}=this.props;e.preventDefault(),this.detach(),t()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}function Fe(e){return Boolean(e&&"distance"in e)}function $e(e){return Boolean(e&&"delay"in e)}Le.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=Pe,onActivation:a}=t,{active:o}=n;const{code:l}=e.nativeEvent;if(r.start.includes(l)){const t=o.activatorNode.current;return(!t||e.target===t)&&(e.preventDefault(),null==a||a({event:e.nativeEvent}),!0)}return!1}}];class Be{constructor(e,t,n){var r;void 0===n&&(n=function(e){const{EventTarget:t}=y(e);return e instanceof t?e:S(e)}(e.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=e,this.events=t;const{event:a}=e,{target:o}=a;this.props=e,this.events=t,this.document=S(o),this.documentListeners=new Ee(this.document),this.listeners=new Ee(n),this.windowListeners=new Ee(y(o)),this.initialCoordinates=null!=(r=F(a))?r:G,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:e,props:{options:{activationConstraint:t,bypassActivationConstraint:n}}}=this;if(this.listeners.add(e.move.name,this.handleMove,{passive:!1}),this.listeners.add(e.end.name,this.handleEnd),e.cancel&&this.listeners.add(e.cancel.name,this.handleCancel),this.windowListeners.add(Ne.Resize,this.handleCancel),this.windowListeners.add(Ne.DragStart,Me),this.windowListeners.add(Ne.VisibilityChange,this.handleCancel),this.windowListeners.add(Ne.ContextMenu,Me),this.documentListeners.add(Ne.Keydown,this.handleKeydown),t){if(null!=n&&n({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if($e(t))return this.timeoutId=setTimeout(this.handleStart,t.delay),void this.handlePending(t);if(Fe(t))return void this.handlePending(t)}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),null!==this.timeoutId&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(e,t){const{active:n,onPending:r}=this.props;r(n,e,this.initialCoordinates,t)}handleStart(){const{initialCoordinates:e}=this,{onStart:t}=this.props;e&&(this.activated=!0,this.documentListeners.add(Ne.Click,Te,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Ne.SelectionChange,this.removeTextSelection),t(e))}handleMove(e){var t;const{activated:n,initialCoordinates:r,props:a}=this,{onMove:o,options:{activationConstraint:l}}=a;if(!r)return;const i=null!=(t=F(e))?t:G,s=A(r,i);if(!n&&l){if(Fe(l)){if(null!=l.tolerance&&ke(s,l.tolerance))return this.handleCancel();if(ke(s,l.distance))return this.handleStart()}return $e(l)&&ke(s,l.tolerance)?this.handleCancel():void this.handlePending(l,s)}e.cancelable&&e.preventDefault(),o(i)}handleEnd(){const{onAbort:e,onEnd:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleCancel(){const{onAbort:e,onCancel:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleKeydown(e){e.code===ze.Esc&&this.handleCancel()}removeTextSelection(){var e;null==(e=this.document.getSelection())||e.removeAllRanges()}}const Oe={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class Ie extends Be{constructor(e){const{event:t}=e,n=S(t.target);super(e,Oe,n)}}Ie.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!(!n.isPrimary||0!==n.button)&&(null==r||r({event:n}),!0)}}];const qe={move:{name:"mousemove"},end:{name:"mouseup"}};var He,We;(We=He||(He={}))[We.RightClick=2]="RightClick";(class extends Be{constructor(e){super(e,qe,S(e.event.target))}}).activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button!==He.RightClick&&(null==r||r({event:n}),!0)}}];const Ue={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};var Ke,Ve,Xe,Ye;function Ge(e){let{acceleration:t,activator:r=Ke.Pointer,canScroll:a,draggingRect:o,enabled:l,interval:i=5,order:s=Xe.TreeOrder,pointerCoordinates:c,scrollableAncestors:d,scrollableAncestorRects:u,delta:p,threshold:h}=e;const f=function(e){let{delta:t,disabled:n}=e;const r=z(t);return N(e=>{if(n||!r||!e)return Je;const a={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[me.Backward]:e.x[me.Backward]||-1===a.x,[me.Forward]:e.x[me.Forward]||1===a.x},y:{[me.Backward]:e.y[me.Backward]||-1===a.y,[me.Forward]:e.y[me.Forward]||1===a.y}}},[n,t,r])}({delta:p,disabled:!l}),[m,g]=function(){const e=n.useRef(null);return[n.useCallback((t,n)=>{e.current=setInterval(t,n)},[]),n.useCallback(()=>{null!==e.current&&(clearInterval(e.current),e.current=null)},[])]}(),b=n.useRef({x:0,y:0}),v=n.useRef({x:0,y:0}),y=n.useMemo(()=>{switch(r){case Ke.Pointer:return c?{top:c.y,bottom:c.y,left:c.x,right:c.x}:null;case Ke.DraggableRect:return o}},[r,o,c]),x=n.useRef(null),w=n.useCallback(()=>{const e=x.current;if(!e)return;const t=b.current.x*v.current.x,n=b.current.y*v.current.y;e.scrollBy(t,n)},[]),C=n.useMemo(()=>s===Xe.TreeOrder?[...d].reverse():d,[s,d]);n.useEffect(()=>{if(l&&d.length&&y){for(const e of C){if(!1===(null==a?void 0:a(e)))continue;const n=d.indexOf(e),r=u[n];if(!r)continue;const{direction:o,speed:l}=xe(e,r,y,t,h);for(const e of["x","y"])f[e][o[e]]||(l[e]=0,o[e]=0);if(l.x>0||l.y>0)return g(),x.current=e,m(w,i),b.current=l,void(v.current=o)}b.current={x:0,y:0},v.current={x:0,y:0},g()}else g()},[t,w,a,g,l,i,JSON.stringify(y),JSON.stringify(f),m,d,C,u,JSON.stringify(h)])}(class extends Be{constructor(e){super(e,Ue)}static setup(){return window.addEventListener(Ue.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(Ue.move.name,e)};function e(){}}}).activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;const{touches:a}=n;return!(a.length>1)&&(null==r||r({event:n}),!0)}}],(Ve=Ke||(Ke={}))[Ve.Pointer=0]="Pointer",Ve[Ve.DraggableRect=1]="DraggableRect",(Ye=Xe||(Xe={}))[Ye.TreeOrder=0]="TreeOrder",Ye[Ye.ReversedTreeOrder=1]="ReversedTreeOrder";const Je={x:{[me.Backward]:!1,[me.Forward]:!1},y:{[me.Backward]:!1,[me.Forward]:!1}};var _e,Qe,Ze;(Qe=_e||(_e={}))[Qe.Always=0]="Always",Qe[Qe.BeforeDragging=1]="BeforeDragging",Qe[Qe.WhileDragging=2]="WhileDragging",(Ze||(Ze={})).Optimized="optimized";const et=new Map;function tt(e,t){return N(n=>e?n||("function"==typeof t?t(e):e):null,[t,e])}function nt(e){let{callback:t,disabled:r}=e;const a=E(t),o=n.useMemo(()=>{if(r||"undefined"==typeof window||void 0===window.ResizeObserver)return;const{ResizeObserver:e}=window;return new e(a)},[r]);return n.useEffect(()=>()=>null==o?void 0:o.disconnect(),[o]),o}function rt(e){return new Re(ie(e),e)}function at(e,t,r){void 0===t&&(t=rt);const[a,o]=n.useState(null);function l(){o(n=>{if(!e)return null;var a;if(!1===e.isConnected)return null!=(a=null!=n?n:r)?a:null;const o=t(e);return JSON.stringify(n)===JSON.stringify(o)?n:o})}const i=function(e){let{callback:t,disabled:r}=e;const a=E(t),o=n.useMemo(()=>{if(r||"undefined"==typeof window||void 0===window.MutationObserver)return;const{MutationObserver:e}=window;return new e(a)},[a,r]);return n.useEffect(()=>()=>null==o?void 0:o.disconnect(),[o]),o}({callback(t){if(e)for(const n of t){const{type:t,target:r}=n;if("childList"===t&&r instanceof HTMLElement&&r.contains(e)){l();break}}}}),s=nt({callback:l});return R(()=>{l(),e?(null==s||s.observe(e),null==i||i.observe(document.body,{childList:!0,subtree:!0})):(null==s||s.disconnect(),null==i||i.disconnect())},[e]),a}const ot=[];function lt(e,t){void 0===t&&(t=[]);const r=n.useRef(null);return n.useEffect(()=>{r.current=null},t),n.useEffect(()=>{const t=e!==G;t&&!r.current&&(r.current=e),!t&&r.current&&(r.current=null)},[e]),r.current?A(e,r.current):G}function it(e){return n.useMemo(()=>e?function(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}(e):null,[e])}const st=[];function ct(e){let{measure:t}=e;const[r,a]=n.useState(null),o=nt({callback:n.useCallback(e=>{for(const{target:n}of e)if(w(n)){a(e=>{const r=t(n);return e?{...e,width:r.width,height:r.height}:r});break}},[t])}),l=n.useCallback(e=>{const n=function(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return w(t)?t:e}(e);null==o||o.disconnect(),n&&(null==o||o.observe(n)),a(n?t(n):null)},[t,o]),[i,s]=j(l);return n.useMemo(()=>({nodeRef:i,rect:r,setRef:s}),[r,i,s])}const dt=[{sensor:Ie,options:{}},{sensor:Le,options:{}}],ut={current:{}},pt={draggable:{measure:se},droppable:{measure:se,strategy:_e.WhileDragging,frequency:Ze.Optimized},dragOverlay:{measure:ie}};class ht extends Map{get(e){var t;return null!=e&&null!=(t=super.get(e))?t:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(e=>{let{disabled:t}=e;return!t})}getNodeFor(e){var t,n;return null!=(t=null==(n=this.get(e))?void 0:n.node.current)?t:void 0}}const ft={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new ht,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Y},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:pt,measureDroppableContainers:Y,windowRect:null,measuringScheduled:!1},mt={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Y,draggableNodes:new Map,over:null,measureDroppableContainers:Y},gt=n.createContext(mt),bt=n.createContext(ft);function vt(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new ht}}}function yt(e,t){switch(t.type){case V.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case V.DragMove:return null==e.draggable.active?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case V.DragEnd:case V.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case V.RegisterDroppable:{const{element:n}=t,{id:r}=n,a=new ht(e.droppable.containers);return a.set(r,n),{...e,droppable:{...e.droppable,containers:a}}}case V.SetDroppableDisabled:{const{id:n,key:r,disabled:a}=t,o=e.droppable.containers.get(n);if(!o||r!==o.key)return e;const l=new ht(e.droppable.containers);return l.set(n,{...o,disabled:a}),{...e,droppable:{...e.droppable,containers:l}}}case V.UnregisterDroppable:{const{id:n,key:r}=t,a=e.droppable.containers.get(n);if(!a||r!==a.key)return e;const o=new ht(e.droppable.containers);return o.delete(n),{...e,droppable:{...e.droppable,containers:o}}}default:return e}}function xt(e){let{disabled:t}=e;const{active:r,activatorEvent:a,draggableNodes:o}=n.useContext(gt),l=z(a),i=z(null==r?void 0:r.id);return n.useEffect(()=>{if(!t&&!a&&l&&null!=i){if(!L(l))return;if(document.activeElement===l.target)return;const e=o.get(i);if(!e)return;const{activatorNode:t,node:n}=e;if(!t.current&&!n.current)return;requestAnimationFrame(()=>{for(const e of[t.current,n.current]){if(!e)continue;const t=B(e);if(t){t.focus();break}}})}},[a,t,o,i,l]),null}const wt=n.createContext({...G,scaleX:1,scaleY:1});var Ct,St;(St=Ct||(Ct={}))[St.Uninitialized=0]="Uninitialized",St[St.Initializing=1]="Initializing",St[St.Initialized=2]="Initialized";const Rt=n.memo(function(e){var t,r,o,l;let{id:i,accessibility:s,autoScroll:c=!0,children:d,sensors:u=dt,collisionDetection:p=ne,measuring:h,modifiers:f,...m}=e;const b=n.useReducer(yt,void 0,vt),[v,x]=b,[w,C]=function(){const[e]=n.useState(()=>new Set),t=n.useCallback(t=>(e.add(t),()=>e.delete(t)),[e]);return[n.useCallback(t=>{let{type:n,event:r}=t;e.forEach(e=>{var t;return null==(t=e[n])?void 0:t.call(e,r)})},[e]),t]}(),[S,E]=n.useState(Ct.Uninitialized),j=S===Ct.Initialized,{draggable:{active:z,nodes:D,translate:T},droppable:{containers:A}}=v,L=null!=z?D.get(z):null,$=n.useRef({initial:null,translated:null}),B=n.useMemo(()=>{var e;return null!=z?{id:z,data:null!=(e=null==L?void 0:L.data)?e:ut,rect:$}:null},[z,L]),O=n.useRef(null),[I,q]=n.useState(null),[W,U]=n.useState(null),X=k(m,Object.values(m)),Y=M("DndDescribedBy",i),J=n.useMemo(()=>A.getEnabled(),[A]),_=(Q=h,n.useMemo(()=>({draggable:{...pt.draggable,...null==Q?void 0:Q.draggable},droppable:{...pt.droppable,...null==Q?void 0:Q.droppable},dragOverlay:{...pt.dragOverlay,...null==Q?void 0:Q.dragOverlay}}),[null==Q?void 0:Q.draggable,null==Q?void 0:Q.droppable,null==Q?void 0:Q.dragOverlay]));var Q;const{droppableRects:Z,measureDroppableContainers:ee,measuringScheduled:te}=function(e,t){let{dragging:r,dependencies:a,config:o}=t;const[l,i]=n.useState(null),{frequency:s,measure:c,strategy:d}=o,u=n.useRef(e),p=function(){switch(d){case _e.Always:return!1;case _e.BeforeDragging:return r;default:return!r}}(),h=k(p),f=n.useCallback(function(e){void 0===e&&(e=[]),h.current||i(t=>null===t?e:t.concat(e.filter(e=>!t.includes(e))))},[h]),m=n.useRef(null),g=N(t=>{if(p&&!r)return et;if(!t||t===et||u.current!==e||null!=l){const t=new Map;for(let n of e){if(!n)continue;if(l&&l.length>0&&!l.includes(n.id)&&n.rect.current){t.set(n.id,n.rect.current);continue}const e=n.node.current,r=e?new Re(c(e),e):null;n.rect.current=r,r&&t.set(n.id,r)}return t}return t},[e,l,r,p,c]);return n.useEffect(()=>{u.current=e},[e]),n.useEffect(()=>{p||f()},[r,p]),n.useEffect(()=>{l&&l.length>0&&i(null)},[JSON.stringify(l)]),n.useEffect(()=>{p||"number"!=typeof s||null!==m.current||(m.current=setTimeout(()=>{f(),m.current=null},s))},[s,p,f,...a]),{droppableRects:g,measureDroppableContainers:f,measuringScheduled:null!=l}}(J,{dragging:j,dependencies:[T.x,T.y],config:_.droppable}),ae=function(e,t){const n=null!=t?e.get(t):void 0,r=n?n.node.current:null;return N(e=>{var n;return null==t?null:null!=(n=null!=r?r:e)?n:null},[r,t])}(D,z),le=n.useMemo(()=>W?F(W):null,[W]),se=function(){const e=!1===(null==I?void 0:I.autoScrollEnabled),t="object"==typeof c?!1===c.enabled:!1===c,n=j&&!e&&!t;if("object"==typeof c)return{...c,enabled:n};return{enabled:n}}(),pe=function(e,t){return tt(e,t)}(ae,_.draggable.measure);!function(e){let{activeNode:t,measure:r,initialRect:a,config:o=!0}=e;const l=n.useRef(!1),{x:i,y:s}="boolean"==typeof o?{x:o,y:o}:o;R(()=>{if(!i&&!s||!t)return void(l.current=!1);if(l.current||!a)return;const e=null==t?void 0:t.node.current;if(!e||!1===e.isConnected)return;const n=re(r(e),a);if(i||(n.x=0),s||(n.y=0),l.current=!0,Math.abs(n.x)>0||Math.abs(n.y)>0){const t=de(e);t&&t.scrollBy({top:n.y,left:n.x})}},[t,i,s,a,r])}({activeNode:null!=z?D.get(z):null,config:se.layoutShiftCompensation,initialRect:pe,measure:_.draggable.measure});const he=at(ae,_.draggable.measure,pe),me=at(ae?ae.parentElement:null),ge=n.useRef({activatorEvent:null,active:null,activeNode:ae,collisionRect:null,collisions:null,droppableRects:Z,draggableNodes:D,draggingNode:null,draggingNodeRect:null,droppableContainers:A,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),ve=A.getNodeFor(null==(t=ge.current.over)?void 0:t.id),ye=ct({measure:_.dragOverlay.measure}),xe=null!=(r=ye.nodeRef.current)?r:ae,we=j?null!=(o=ye.rect)?o:he:null,Se=Boolean(ye.nodeRef.current&&ye.rect),Ee=re(ke=Se?null:he,tt(ke));var ke;const Ne=it(xe?y(xe):null),je=function(e){const t=n.useRef(e),r=N(n=>e?n&&n!==ot&&e&&t.current&&e.parentNode===t.current.parentNode?n:ce(e):ot,[e]);return n.useEffect(()=>{t.current=e},[e]),r}(j?null!=ve?ve:ae:null),ze=function(e,t){void 0===t&&(t=ie);const[r]=e,a=it(r?y(r):null),[o,l]=n.useState(st);function i(){l(()=>e.length?e.map(e=>be(e)?a:new Re(t(e),e)):st)}const s=nt({callback:i});return R(()=>{null==s||s.disconnect(),i(),e.forEach(e=>null==s?void 0:s.observe(e))},[e]),o}(je),De=function(e,t){let{transform:n,...r}=t;return null!=e&&e.length?e.reduce((e,t)=>t({transform:e,...r}),n):n}(f,{transform:{x:T.x-Ee.x,y:T.y-Ee.y,scaleX:1,scaleY:1},activatorEvent:W,active:B,activeNodeRect:he,containerNodeRect:me,draggingNodeRect:we,over:ge.current.over,overlayNodeRect:ye.rect,scrollableAncestors:je,scrollableAncestorRects:ze,windowRect:Ne}),Me=le?P(le,T):null,Te=function(e){const[t,r]=n.useState(null),a=n.useRef(e),o=n.useCallback(e=>{const t=ue(e.target);t&&r(e=>e?(e.set(t,fe(t)),new Map(e)):null)},[]);return n.useEffect(()=>{const t=a.current;if(e!==t){n(t);const l=e.map(e=>{const t=ue(e);return t?(t.addEventListener("scroll",o,{passive:!0}),[t,fe(t)]):null}).filter(e=>null!=e);r(l.length?new Map(l):null),a.current=e}return()=>{n(e),n(t)};function n(e){e.forEach(e=>{const t=ue(e);null==t||t.removeEventListener("scroll",o)})}},[o,e]),n.useMemo(()=>e.length?t?Array.from(t.values()).reduce((e,t)=>P(e,t),G):Ce(e):G,[e,t])}(je),Pe=lt(Te),Ae=lt(Te,[he]),Le=P(De,Pe),Fe=we?oe(we,De):null,$e=B&&Fe?p({active:B,collisionRect:Fe,droppableRects:Z,droppableContainers:J,pointerCoordinates:Me}):null,Be=function(e,t){if(!e||0===e.length)return null;const[n]=e;return n[t]}($e,"id"),[Oe,Ie]=n.useState(null),qe=function(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}(Se?De:P(De,Ae),null!=(l=null==Oe?void 0:Oe.rect)?l:null,he),He=n.useRef(null),We=n.useCallback((e,t)=>{let{sensor:n,options:r}=t;if(null==O.current)return;const o=D.get(O.current);if(!o)return;const l=e.nativeEvent,i=new n({active:O.current,activeNode:o,event:l,options:r,context:ge,onAbort(e){if(!D.get(e))return;const{onDragAbort:t}=X.current,n={id:e};null==t||t(n),w({type:"onDragAbort",event:n})},onPending(e,t,n,r){if(!D.get(e))return;const{onDragPending:a}=X.current,o={id:e,constraint:t,initialCoordinates:n,offset:r};null==a||a(o),w({type:"onDragPending",event:o})},onStart(e){const t=O.current;if(null==t)return;const n=D.get(t);if(!n)return;const{onDragStart:r}=X.current,o={activatorEvent:l,active:{id:t,data:n.data,rect:$}};a.unstable_batchedUpdates(()=>{null==r||r(o),E(Ct.Initializing),x({type:V.DragStart,initialCoordinates:e,active:t}),w({type:"onDragStart",event:o}),q(He.current),U(l)})},onMove(e){x({type:V.DragMove,coordinates:e})},onEnd:s(V.DragEnd),onCancel:s(V.DragCancel)});function s(e){return async function(){const{active:t,collisions:n,over:r,scrollAdjustedTranslate:o}=ge.current;let i=null;if(t&&o){const{cancelDrop:a}=X.current;if(i={activatorEvent:l,active:t,collisions:n,delta:o,over:r},e===V.DragEnd&&"function"==typeof a){await Promise.resolve(a(i))&&(e=V.DragCancel)}}O.current=null,a.unstable_batchedUpdates(()=>{x({type:e}),E(Ct.Uninitialized),Ie(null),q(null),U(null),He.current=null;const t=e===V.DragEnd?"onDragEnd":"onDragCancel";if(i){const e=X.current[t];null==e||e(i),w({type:t,event:i})}})}}He.current=i},[D]),Ue=function(e,t){return n.useMemo(()=>e.reduce((e,n)=>{const{sensor:r}=n;return[...e,...r.activators.map(e=>({eventName:e.eventName,handler:t(e.handler,n)}))]},[]),[e,t])}(u,n.useCallback((e,t)=>(n,r)=>{const a=n.nativeEvent,o=D.get(r);if(null!==O.current||!o||a.dndKit||a.defaultPrevented)return;const l={active:o};!0===e(n,t.options,l)&&(a.dndKit={capturedBy:t.sensor},O.current=r,We(n,t))},[D,We]));!function(e){n.useEffect(()=>{if(!g)return;const t=e.map(e=>{let{sensor:t}=e;return null==t.setup?void 0:t.setup()});return()=>{for(const e of t)null==e||e()}},e.map(e=>{let{sensor:t}=e;return t}))}(u),R(()=>{he&&S===Ct.Initializing&&E(Ct.Initialized)},[he,S]),n.useEffect(()=>{const{onDragMove:e}=X.current,{active:t,activatorEvent:n,collisions:r,over:o}=ge.current;if(!t||!n)return;const l={active:t,activatorEvent:n,collisions:r,delta:{x:Le.x,y:Le.y},over:o};a.unstable_batchedUpdates(()=>{null==e||e(l),w({type:"onDragMove",event:l})})},[Le.x,Le.y]),n.useEffect(()=>{const{active:e,activatorEvent:t,collisions:n,droppableContainers:r,scrollAdjustedTranslate:o}=ge.current;if(!e||null==O.current||!t||!o)return;const{onDragOver:l}=X.current,i=r.get(Be),s=i&&i.rect.current?{id:i.id,rect:i.rect.current,data:i.data,disabled:i.disabled}:null,c={active:e,activatorEvent:t,collisions:n,delta:{x:o.x,y:o.y},over:s};a.unstable_batchedUpdates(()=>{Ie(s),null==l||l(c),w({type:"onDragOver",event:c})})},[Be]),R(()=>{ge.current={activatorEvent:W,active:B,activeNode:ae,collisionRect:Fe,collisions:$e,droppableRects:Z,draggableNodes:D,draggingNode:xe,draggingNodeRect:we,droppableContainers:A,over:Oe,scrollableAncestors:je,scrollAdjustedTranslate:Le},$.current={initial:we,translated:Fe}},[B,ae,$e,Fe,D,xe,we,Z,A,Oe,je,Le]),Ge({...se,delta:T,draggingRect:Fe,pointerCoordinates:Me,scrollableAncestors:je,scrollableAncestorRects:ze});const Ke=n.useMemo(()=>({active:B,activeNode:ae,activeNodeRect:he,activatorEvent:W,collisions:$e,containerNodeRect:me,dragOverlay:ye,draggableNodes:D,droppableContainers:A,droppableRects:Z,over:Oe,measureDroppableContainers:ee,scrollableAncestors:je,scrollableAncestorRects:ze,measuringConfiguration:_,measuringScheduled:te,windowRect:Ne}),[B,ae,he,W,$e,me,ye,D,A,Z,Oe,ee,je,ze,_,te,Ne]),Ve=n.useMemo(()=>({activatorEvent:W,activators:Ue,active:B,activeNodeRect:he,ariaDescribedById:{draggable:Y},dispatch:x,draggableNodes:D,over:Oe,measureDroppableContainers:ee}),[W,Ue,B,he,x,Y,D,Oe,ee]);return n.createElement(H.Provider,{value:C},n.createElement(gt.Provider,{value:Ve},n.createElement(bt.Provider,{value:Ke},n.createElement(wt.Provider,{value:qe},d)),n.createElement(xt,{disabled:!1===(null==s?void 0:s.restoreFocus)})),n.createElement(K,{...s,hiddenTextDescribedById:Y}))}),Et=n.createContext(null),kt="button";function Nt(e){let{id:t,data:r,disabled:a=!1,attributes:o}=e;const l=M("Draggable"),{activators:i,activatorEvent:s,active:c,activeNodeRect:d,ariaDescribedById:u,draggableNodes:p,over:h}=n.useContext(gt),{role:f=kt,roleDescription:m="draggable",tabIndex:g=0}=null!=o?o:{},b=(null==c?void 0:c.id)===t,v=n.useContext(b?wt:Et),[y,x]=j(),[w,C]=j(),S=function(e,t){return n.useMemo(()=>e.reduce((e,n)=>{let{eventName:r,handler:a}=n;return e[r]=e=>{a(e,t)},e},{}),[e,t])}(i,t),E=k(r);R(()=>(p.set(t,{id:t,key:l,node:y,activatorNode:w,data:E}),()=>{const e=p.get(t);e&&e.key===l&&p.delete(t)}),[p,t]);return{active:c,activatorEvent:s,activeNodeRect:d,attributes:n.useMemo(()=>({role:f,tabIndex:g,"aria-disabled":a,"aria-pressed":!(!b||f!==kt)||void 0,"aria-roledescription":m,"aria-describedby":u.draggable}),[a,f,g,b,m,u.draggable]),isDragging:b,listeners:a?void 0:S,node:y,over:h,setNodeRef:x,setActivatorNodeRef:C,transform:v}}const jt={timeout:25};const zt=({slotPosition:e,isEditing:r,isDragging:a,children:o})=>{const{attributes:l,listeners:i,setNodeRef:s,transform:c}=Nt({id:`slot-${e}`,data:{slotPosition:e},disabled:!r}),{setNodeRef:d,isOver:u}=function(e){let{data:t,disabled:r=!1,id:a,resizeObserverConfig:o}=e;const l=M("Droppable"),{active:i,dispatch:s,over:c,measureDroppableContainers:d}=n.useContext(gt),u=n.useRef({disabled:r}),p=n.useRef(!1),h=n.useRef(null),f=n.useRef(null),{disabled:m,updateMeasurementsFor:g,timeout:b}={...jt,...o},v=k(null!=g?g:a),y=nt({callback:n.useCallback(()=>{p.current?(null!=f.current&&clearTimeout(f.current),f.current=setTimeout(()=>{d(Array.isArray(v.current)?v.current:[v.current]),f.current=null},b)):p.current=!0},[b]),disabled:m||!i}),x=n.useCallback((e,t)=>{y&&(t&&(y.unobserve(t),p.current=!1),e&&y.observe(e))},[y]),[w,C]=j(x),S=k(t);return n.useEffect(()=>{y&&w.current&&(y.disconnect(),p.current=!1,y.observe(w.current))},[w,y]),n.useEffect(()=>(s({type:V.RegisterDroppable,element:{id:a,key:l,disabled:r,node:w,rect:h,data:S}}),()=>s({type:V.UnregisterDroppable,key:l,id:a})),[a]),n.useEffect(()=>{r!==u.current.disabled&&(s({type:V.SetDroppableDisabled,id:a,key:l,disabled:r}),u.current.disabled=r)},[a,l,r,s]),{active:i,rect:h,isOver:(null==c?void 0:c.id)===a,node:w,over:c,setNodeRef:C}}({id:`drop-${e}`,data:{slotPosition:e}}),p={position:"relative",height:"100%",width:"100%",transform:c?`translate3d(${c.x}px, ${c.y}px, 0)`:void 0},h=n.useCallback(e=>{s(e),d(e)},[s,d]);return t.jsxs("div",{ref:h,style:p,className:`slot-with-overlay ${r?"edit-mode":""} ${a?"dragging":""} ${u?"drag-over":""}`,children:[o,r&&t.jsxs("div",{className:"slot-edit-overlay",...l,...i,children:[t.jsx("div",{className:"drag-indicator",children:"⋮⋮"}),t.jsx("div",{className:"slot-position-label",children:e.toUpperCase()})]})]})},Dt=({layout:e,activeSlot:r})=>{const[a,o]=n.useState(new Map);return n.useEffect(()=>{const e=()=>{const e=new Map;["left","middle","right"].forEach(t=>{const n=document.querySelector(`[data-slot="${t}"]`);if(n){const r=n.getBoundingClientRect();e.set(t,r)}}),o(e)};e(),window.addEventListener("resize",e);const t=setInterval(e,100);return()=>{window.removeEventListener("resize",e),clearInterval(t)}},[e]),t.jsx("div",{style:{pointerEvents:"none",position:"absolute",top:0,left:0,right:0,bottom:0,zIndex:999},children:["left","middle","right"].map(n=>{if(!e[n])return null;const o=a.get(n);if(!o)return null;const l=r===n;return t.jsx("div",{style:{position:"fixed",top:o.top,left:o.left,width:o.width,height:o.height,pointerEvents:"auto"},children:t.jsx(zt,{slotPosition:n,isEditing:!0,isDragging:l,children:t.jsx("div",{style:{height:"100%"}})})},n)})})},Mt=e=>null!=e&&"object"==typeof e&&"type"in e,Tt=e=>null==e?[]:"string"==typeof e?[e]:Mt(e)?e.panels:[];e.AnimatedResizableLayout=({leftPanel:e,rightPanel:a,collapsibleSide:o="left",defaultSize:i=25,minSize:s=5,className:c="",collapsed:d=!1,style:u,showCollapseButton:p=!1,animationDuration:h=300,animationEasing:f="cubic-bezier(0.4, 0, 0.2, 1)",onCollapseStart:m,onCollapseComplete:g,onExpandStart:b,onExpandComplete:v,theme:y})=>{const[x,w]=n.useState(d),[C,S]=n.useState(!1),[R,E]=n.useState(!1),[k,N]=n.useState(d),[j,z]=n.useState(d?0:i),D=n.useRef(null),M=n.useRef(void 0),T=n.useRef(void 0),P=n.useRef(void 0),A=n.useCallback((e,t,n)=>{if(!D.current)return;M.current&&cancelAnimationFrame(M.current),T.current=performance.now();const r=a=>{if(!T.current||!D.current)return;const o=a-T.current,l=Math.min(o/h,1),i=l<.5?4*l*l*l:1-Math.pow(-2*l+2,3)/2,s=e+(t-e)*i;D.current.resize(s),l<1?M.current=requestAnimationFrame(r):(0===t?D.current.collapse():D.current.resize(t),S(!1),n&&n())};M.current=requestAnimationFrame(r)},[h]),L=n.useCallback(()=>{C||R||(S(!0),w(!0),m&&m(),A(j,0,()=>{z(0),N(!0),g&&g()}))},[C,R,j,A,m,g]),F=n.useCallback(()=>{C||R||(S(!0),w(!1),N(!1),b&&b(),A(0,i,()=>{z(i),v&&v()}))},[C,R,i,A,b,v]),$=n.useCallback(()=>{x?F():L()},[x,L,F]),B=n.useCallback(e=>{C||(z(e),e>0&&w(!1))},[C]),O=n.useCallback(()=>{E(!0)},[]),I=n.useCallback(()=>{E(!1)},[]);n.useEffect(()=>{d!==x&&(d?L():F())},[d]),n.useEffect(()=>{d&&!C?N(!0):d||C||N(!1)},[d,C]),n.useEffect(()=>{const e=M.current,t=P.current;return()=>{e&&cancelAnimationFrame(e),t&&clearTimeout(t)}},[]);const q="left"===o,H=x?q?"▸":"◂":q?"◂":"▸",W=l(y),U=C&&!R?{transition:`flex ${h}ms ${f}`}:void 0,K=e=>{let t="hybrid-panel";return e&&(t+=" collapsible-panel",C&&!R&&(t+=" animating"),x&&(t+=" collapsed")),t};return t.jsx("div",{className:`animated-resizable-layout ${c}`,style:{...W,...u},children:t.jsxs(r.PanelGroup,{direction:"horizontal",onLayout:I,children:[t.jsx(r.Panel,{ref:q?D:void 0,collapsible:q,defaultSize:q?d?0:i:void 0,minSize:q?s:30,collapsedSize:0,onResize:q?B:void 0,onCollapse:q?()=>w(!0):void 0,onExpand:q?()=>w(!1):void 0,className:K(q),style:q?U:void 0,children:t.jsx("div",{className:"panel-content-wrapper",style:{opacity:q&&x?0:1,transition:C?`opacity ${.5*h}ms ${f}`:"none"},children:e})}),t.jsx(r.PanelResizeHandle,{className:"resize-handle "+(k?"collapsed":""),onDragging:O,style:k?{visibility:"hidden",width:0}:void 0,children:p&&t.jsx("div",{className:"handle-bar",children:t.jsx("button",{onClick:$,className:"collapse-toggle",disabled:C,"aria-label":x?"Expand panel":"Collapse panel",children:H})})}),t.jsx(r.Panel,{ref:q?void 0:D,collapsible:!q,defaultSize:q?void 0:d?0:i,minSize:q?30:s,collapsedSize:0,onResize:q?void 0:B,onCollapse:q?void 0:()=>w(!0),onExpand:q?void 0:()=>w(!1),className:K(!q),style:q?void 0:U,children:t.jsx("div",{className:"panel-content-wrapper",style:{opacity:!q&&x?0:1,transition:C?`opacity ${.5*h}ms ${f}`:"none"},children:a})})]})})},e.AnimatedVerticalLayout=({topPanel:e,bottomPanel:a,collapsiblePanels:o={top:!0,bottom:!0},defaultSizes:i={top:30,bottom:30},minSizes:s={top:5,bottom:5},className:c="",collapsed:d={top:!1,bottom:!1},style:u,showCollapseButtons:p=!1,animationDuration:h=300,animationEasing:f="cubic-bezier(0.4, 0, 0.2, 1)",theme:m,onTopCollapseStart:g,onTopCollapseComplete:b,onTopExpandStart:v,onTopExpandComplete:y,onBottomCollapseStart:x,onBottomCollapseComplete:w,onBottomExpandStart:C,onBottomExpandComplete:S,onPanelResize:R})=>{const[E,k]=n.useState(d.top||!1),[N,j]=n.useState(!1),[z,D]=n.useState(d.top?0:i.top),M=n.useRef(null),T=n.useRef(void 0),P=n.useRef(void 0),[A,L]=n.useState(d.bottom||!1),[F,$]=n.useState(!1),[B,O]=n.useState(d.bottom?0:i.bottom),I=n.useRef(null),q=n.useRef(void 0),H=n.useRef(void 0),[W,U]=n.useState(!1),K=n.useCallback((e,t,n)=>{if(!M.current)return;T.current&&cancelAnimationFrame(T.current),P.current=performance.now();const r=a=>{if(!P.current||!M.current)return;const o=a-P.current,l=Math.min(o/h,1),i=l<.5?4*l*l*l:1-Math.pow(-2*l+2,3)/2,s=e+(t-e)*i;M.current.resize(s),l<1?T.current=requestAnimationFrame(r):(0===t?M.current.collapse():M.current.resize(t),j(!1),n&&n())};T.current=requestAnimationFrame(r)},[h]),V=n.useCallback((e,t,n)=>{if(!I.current)return;q.current&&cancelAnimationFrame(q.current),H.current=performance.now();const r=a=>{if(!H.current||!I.current)return;const o=a-H.current,l=Math.min(o/h,1),i=l<.5?4*l*l*l:1-Math.pow(-2*l+2,3)/2,s=e+(t-e)*i;I.current.resize(s),l<1?q.current=requestAnimationFrame(r):(0===t?I.current.collapse():I.current.resize(t),$(!1),n&&n())};q.current=requestAnimationFrame(r)},[h]),X=n.useCallback(()=>{N||W||!o.top||(j(!0),k(!0),g&&g(),K(z,0,()=>{D(0),b&&b()}))},[N,W,z,o.top,K,g,b]),Y=n.useCallback(()=>{N||W||!o.top||(j(!0),k(!1),v&&v(),K(0,i.top,()=>{D(i.top),y&&y()}))},[N,W,i.top,o.top,K,v,y]),G=n.useCallback(()=>{E?Y():X()},[E,X,Y]),J=n.useCallback(()=>{F||W||!o.bottom||($(!0),L(!0),x&&x(),V(B,0,()=>{O(0),w&&w()}))},[F,W,B,o.bottom,V,x,w]),_=n.useCallback(()=>{F||W||!o.bottom||($(!0),L(!1),C&&C(),V(0,i.bottom,()=>{O(i.bottom),S&&S()}))},[F,W,i.bottom,o.bottom,V,C,S]),Q=n.useCallback(()=>{A?_():J()},[A,J,_]),Z=n.useCallback(e=>{N||(D(e),e>0&&k(!1))},[N]),ee=n.useCallback(e=>{F||(O(e),e>0&&L(!1))},[F]),te=n.useCallback(()=>{U(!0)},[]),ne=n.useCallback(()=>{U(!1),R&&R({top:z,bottom:B})},[z,B,R]);n.useEffect(()=>{void 0!==d.top&&d.top!==E&&(d.top?X():Y())},[d.top]),n.useEffect(()=>{void 0!==d.bottom&&d.bottom!==A&&(d.bottom?J():_())},[d.bottom]),n.useEffect(()=>()=>{T.current&&cancelAnimationFrame(T.current),q.current&&cancelAnimationFrame(q.current)},[]);const re=l(m),ae=N&&!W?{transition:`flex ${h}ms ${f}`}:void 0,oe=F&&!W?{transition:`flex ${h}ms ${f}`}:void 0;return t.jsx("div",{className:`animated-vertical-layout ${c}`,style:{...re,...u},children:t.jsxs(r.PanelGroup,{direction:"vertical",onLayout:ne,children:[t.jsx(r.Panel,{ref:M,collapsible:o.top,defaultSize:d.top?0:i.top,minSize:s.top,collapsedSize:0,onResize:Z,onCollapse:()=>k(!0),onExpand:()=>k(!1),className:(()=>{let e="vertical-panel collapsible-panel";return N&&!W&&(e+=" animating"),E&&(e+=" collapsed"),e})(),style:ae,children:t.jsx("div",{className:"panel-content-wrapper",style:{opacity:E?0:1,transition:N?`opacity ${.5*h}ms ${f}`:"none"},children:e})}),t.jsx(r.PanelResizeHandle,{className:"vertical-resize-handle",onDragging:te,children:p&&t.jsxs("div",{className:"handle-bar",children:[o.top&&t.jsx("button",{onClick:G,className:"collapse-toggle collapse-toggle-top",disabled:N,"aria-label":E?"Expand top panel":"Collapse top panel",children:E?"▾":"▴"}),o.bottom&&t.jsx("button",{onClick:Q,className:"collapse-toggle collapse-toggle-bottom",disabled:F,"aria-label":A?"Expand bottom panel":"Collapse bottom panel",children:A?"▴":"▾"})]})}),t.jsx(r.Panel,{ref:I,collapsible:o.bottom,defaultSize:d.bottom?0:i.bottom,minSize:s.bottom,collapsedSize:0,onResize:ee,onCollapse:()=>L(!0),onExpand:()=>L(!1),className:(()=>{let e="vertical-panel collapsible-panel";return F&&!W&&(e+=" animating"),A&&(e+=" collapsed"),e})(),style:oe,children:t.jsx("div",{className:"panel-content-wrapper",style:{opacity:A?0:1,transition:F?`opacity ${.5*h}ms ${f}`:"none"},children:a})})]})})},e.CollapsibleSplitPane=({primaryContent:e,secondaryContent:a,collapsedHeader:o,collapsed:i,onCollapsedChange:s,ratio:c,onRatioChange:d,minRatio:u=.1,maxRatio:p=.8,collapsedHeight:h=28,theme:f,className:m="",style:g,animationDuration:b=200,onCollapseStart:v,onCollapseComplete:y,onExpandStart:x,onExpandComplete:w})=>{const[C,S]=n.useState(!1),[R,E]=n.useState(!1),k=n.useRef(null),N=n.useRef(void 0),j=n.useRef(void 0),z=n.useRef(c),D=e=>100*e;n.useEffect(()=>{!i&&c>0&&(z.current=c)},[i,c]);const M=n.useCallback((e,t,n)=>{if(!k.current)return;N.current&&cancelAnimationFrame(N.current),j.current=performance.now();const r=a=>{if(!j.current||!k.current)return;const o=a-j.current,l=Math.min(o/b,1),i=l<.5?4*l*l*l:1-Math.pow(-2*l+2,3)/2,s=e+(t-e)*i;k.current.resize(s),l<1?N.current=requestAnimationFrame(r):(0===t?k.current.collapse():k.current.resize(t),S(!1),n&&n())};N.current=requestAnimationFrame(r)},[b]),T=n.useCallback(()=>{if(C||R)return;S(!0),v?.();const e=D(c);M(e,0,()=>{s(!0),y?.()})},[C,R,c,M,s,v,y]),P=n.useCallback(()=>{if(C||R)return;S(!0),x?.();const e=z.current||c||.3,t=D(e);M(0,t,()=>{s(!1),d(e),w?.()})},[C,R,c,M,s,d,x,w]),A=n.useCallback(()=>{i?P():T()},[i,T,P]),L=n.useCallback(e=>{if(!C&&!i){const t=e/100;d(t)}},[C,i,d]),F=n.useCallback(()=>{E(!0)},[]),$=n.useCallback(()=>{E(!1)},[]);n.useEffect(()=>{if(i&&!C&&k.current){k.current.getSize()>0&&T()}else if(!i&&!C&&k.current){0===k.current.getSize()&&P()}},[i]),n.useEffect(()=>()=>{N.current&&cancelAnimationFrame(N.current)},[]);const B=l(f),O=["csp-secondary-panel",C&&!R?"csp-animating":"",i?"csp-collapsed":""].filter(Boolean).join(" ");return t.jsx("div",{className:`collapsible-split-pane ${m}`,style:{...B,...g},children:i?t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"csp-collapsed-header",style:{height:h},onClick:A,role:"button",tabIndex:0,onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),A())},"aria-expanded":!1,"aria-label":`Expand ${o.title}`,children:[o.icon&&t.jsx("span",{className:"csp-collapsed-header-icon",children:o.icon}),t.jsx("span",{className:"csp-collapsed-header-title",children:o.title}),t.jsx("button",{className:"csp-collapsed-header-expand",onClick:e=>{e.stopPropagation(),A()},"aria-label":`Expand ${o.title}`,children:t.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:t.jsx("path",{d:"M3 5L6 8L9 5"})})})]}),t.jsx("div",{className:"csp-primary-content-full",children:e})]}):t.jsxs(r.PanelGroup,{direction:"vertical",onLayout:$,children:[t.jsx(r.Panel,{ref:k,collapsible:!0,defaultSize:D(c),minSize:D(u),maxSize:D(p),collapsedSize:0,onResize:L,onCollapse:()=>s(!0),className:O,children:t.jsxs("div",{className:"csp-panel-content",children:[t.jsxs("div",{className:"csp-secondary-header",children:[o.icon&&t.jsx("span",{className:"csp-secondary-header-icon",children:o.icon}),t.jsx("span",{className:"csp-secondary-header-title",children:o.title}),t.jsx("button",{className:"csp-secondary-header-collapse",onClick:T,"aria-label":`Collapse ${o.title}`,children:t.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:t.jsx("path",{d:"M3 7L6 4L9 7"})})})]}),t.jsx("div",{className:"csp-secondary-body",children:a})]})}),t.jsx(r.PanelResizeHandle,{className:"csp-resize-handle",onDragging:F,children:t.jsx("div",{className:"csp-resize-handle-bar"})}),t.jsx(r.Panel,{className:"csp-primary-panel",minSize:20,children:t.jsx("div",{className:"csp-panel-content",children:e})})]})})},e.ConfigurablePanelLayout=h,e.EditableConfigurablePanelLayout=({isEditMode:e,onLayoutChange:r,panels:a,layout:o,...l})=>{const[i,s]=n.useState(null),[c,d]=n.useState({x:0,y:0}),u=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return n.useMemo(()=>[...t].filter(e=>null!=e),[...t])}((p=Ie,f={activationConstraint:{distance:8}},n.useMemo(()=>({sensor:p,options:null!=f?f:{}}),[p,f])));var p,f;const m=n.useCallback(e=>{const t=e.active.id;if(t.startsWith("slot-")){const e=t.replace("slot-","");s(e),d({x:0,y:0})}},[]),g=n.useCallback(e=>{const{delta:t}=e;d({x:t.x,y:t.y})},[]),b=n.useCallback(e=>{const{active:t,over:n}=e;if(s(null),d({x:0,y:0}),!n)return;const a=t.id,l=n.id,i=a.replace("slot-",""),c=l.replace("drop-","");if(i===c)return;const u={...o},p=u[i];u[i]=u[c],u[c]=p,r&&r(u)},[o,r]);n.useEffect(()=>{if(!i||!e)return;const t=document.querySelector(`[data-slot="${i}"]`);return t&&(t.setAttribute("data-dragging","true"),t.style.setProperty("transform",`scale(0.95) translate(${c.x}px, ${c.y}px)`,"important"),t.style.setProperty("z-index","1000","important"),t.style.setProperty("transition","none","important"),t.style.setProperty("opacity","0.95","important"),t.style.setProperty("box-shadow","0 12px 24px rgba(0, 0, 0, 0.25)","important")),()=>{t&&(t.removeAttribute("data-dragging"),t.style.removeProperty("transform"),t.style.removeProperty("z-index"),t.style.removeProperty("transition"),t.style.removeProperty("opacity"),t.style.removeProperty("box-shadow"))}},[i,c,e]);const v={left:{"data-slot":"left","data-edit-mode":e?"true":"false"},middle:{"data-slot":"middle","data-edit-mode":e?"true":"false"},right:{"data-slot":"right","data-edit-mode":e?"true":"false"}};return t.jsx(Rt,{sensors:u,collisionDetection:ee,onDragStart:m,onDragMove:g,onDragEnd:b,children:t.jsxs("div",{className:"editable-panel-layout "+(e?"edit-mode-active":""),children:[t.jsx(h,{...l,panels:a,layout:o,slotDataAttributes:v}),e&&t.jsx(Dt,{layout:o,activeSlot:i,onDragStart:()=>{},onDragEnd:()=>{}})]})})},e.PanelBoundsProvider=u,e.PanelConfigurator=({availablePanels:e,currentLayout:r,onChange:a,className:l="",theme:i})=>{const s=o.useTheme(),c=i||s.theme,[d,u]=n.useState(null),p=n.useCallback(t=>t&&e.find(e=>e.id===t)||null,[e]),h=n.useCallback(()=>[...e].sort((e,t)=>e.label.localeCompare(t.label)),[e]),f=n.useCallback(e=>{const t=Tt(r.left),n=Tt(r.middle),a=Tt(r.right);return t.includes(e)||n.includes(e)||a.includes(e)},[r]),m=n.useCallback((e,t)=>{const n={...e};return["left","middle","right"].forEach(e=>{const r=n[e];if(r===t)n[e]=null;else if(null!=r&&Mt(r)){const a=r.panels.filter(e=>e!==t);0===a.length?n[e]=null:1===a.length?n[e]=a[0]:n[e]={...r,panels:a}}}),n},[]),g=n.useCallback((e,t)=>{const n=r[e];if(!Mt(n)||"tabs"!==n.type)return;const o=n.panels.filter(e=>e!==t),l={...r};l[e]={...n,panels:o},a(l)},[r,a]),b=n.useCallback((e,t)=>{t.stopPropagation();const n=r[e];if(Mt(n)&&"tabs"===n.type){const t={...r};t[e]=n.panels.length>0?n.panels[0]:null,a(t),u(null)}else{const t=n&&"string"==typeof n?[n]:[],o={...r};o[e]={type:"tabs",panels:t,config:{defaultActiveTab:0,tabPosition:"top"}},a(o),u({type:"slot",position:e})}},[r,a]),v=n.useCallback(e=>{if(d)if("slot"===d.type){if(d.position===e)return;const t={...r},n=t[d.position];t[d.position]=t[e],t[e]=n,a(t),u(null)}else{const t=r[e];if(Mt(t)&&"tabs"===t.type){if(t.panels.includes(d.id))return void g(e,d.id);const n=t,o=m(r,d.id);return o[e]={...n,panels:[...n.panels,d.id]},void a(o)}{const t=m(r,d.id);t[e]=d.id,a(t),u(null)}}else u({type:"slot",position:e})},[d,r,a,m,g]),y=n.useCallback(e=>{if(d)if("slot"===d.type){const t=r[d.position];if(Mt(t)&&"tabs"===t.type){if(t.panels.includes(e))return void g(d.position,e);const n=t,o=m(r,e);return o[d.position]={...n,panels:[...n.panels,e]},void a(o)}{const t=m(r,e);t[d.position]=e,a(t),u(null)}}else u({type:"panel",id:e});else u({type:"panel",id:e})},[d,r,a,m,g]),x=n.useCallback((e,t)=>{t.stopPropagation();const n={...r};n[e]=null,a(n),u(null)},[r,a]),w=n.useCallback((e,t,n)=>{n.stopPropagation();const o=r[e];if(!Mt(o)||"tabs"!==o.type)return;const l=o.panels.filter(e=>e!==t),i={...r};i[e]={...o,panels:l},a(i)},[r,a]),C=n.useCallback((e,t)=>{const n=r[e];if(!Mt(n)||"tabs"!==n.type)return;const o={...r};o[e]={...n,config:{...n.config,...t}},a(o)},[r,a]),S=h(),R=e=>{const t=r[e];return Mt(t)&&"tabs"===t.type},E={"--configurator-bg":c.colors.background,"--configurator-title":c.colors.textSecondary,"--slot-bg":c.colors.backgroundSecondary,"--slot-border":c.colors.border,"--slot-border-hover":c.colors.textTertiary,"--slot-border-selected":c.colors.primary,"--slot-bg-selected":c.colors.backgroundLight,"--slot-label":c.colors.textTertiary,"--slot-content-text":c.colors.text,"--slot-preview-bg":c.colors.backgroundTertiary,"--slot-preview-border":c.colors.border,"--slot-preview-text":c.colors.textMuted,"--slot-empty-text":c.colors.textMuted,"--panel-bg":c.colors.backgroundSecondary,"--panel-border":c.colors.border,"--panel-border-hover":c.colors.textSecondary,"--panel-border-selected":c.colors.primary,"--panel-bg-selected":c.colors.backgroundLight,"--panel-label-text":c.colors.text,"--panel-preview-bg":c.colors.backgroundTertiary,"--panel-preview-text":c.colors.textMuted,"--clear-btn-bg":c.colors.error,"--clear-btn-text":c.colors.background,"--clear-btn-hover":c.colors.error,"--hint-bg":c.colors.backgroundLight,"--hint-border":c.colors.primary,"--hint-text":c.colors.text};return t.jsxs("div",{className:`panel-configurator ${l}`,style:E,children:[t.jsxs("div",{className:"configurator-section",children:[t.jsx("h3",{className:"section-title",children:"Panel Layout (3 Slots)"}),t.jsx("div",{className:"slots-container",children:["left","middle","right"].map(e=>{const n=r[e],a=(e=>"slot"===d?.type&&d.position===e)(e),o=Mt(n)&&"tabs"===n.type,l=null!==n;return t.jsxs("div",{"data-position":e,className:`slot ${a?"selected":""} ${l?"filled":"empty"} ${o?"tab-group":""}`,onClick:()=>v(e),children:[t.jsx("button",{className:"tab-mode-toggle "+(o?"active":""),onClick:t=>b(e,t),title:o?"Disable tab mode":"Enable tab mode",children:t.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",children:t.jsx("path",{d:"M2 2h4v2H2V2zm5 0h4v2H7V2zm5 0h2v2h-2V2zM2 5h12v9H2V5zm1 1v7h10V6H3z"})})}),null===n?t.jsx("div",{className:"slot-empty-state",children:o?"Click panels to add tabs":"Empty"}):Mt(n)?t.jsxs("div",{className:"slot-content group-content",children:["tabs"===n.type&&n.panels.length>0&&t.jsx("div",{className:"tab-config-controls",children:t.jsxs("label",{className:"tab-config-label",children:["Tabs:",t.jsxs("select",{value:n.config?.tabPosition||"top",onChange:t=>C(e,{tabPosition:t.target.value}),onClick:e=>e.stopPropagation(),children:[t.jsx("option",{value:"top",children:"Top (centered)"}),t.jsx("option",{value:"bottom",children:"Bottom (centered)"}),t.jsx("option",{value:"left",children:"Left"}),t.jsx("option",{value:"right",children:"Right"})]})]})}),t.jsx("div",{className:"group-panels",children:0===n.panels.length?t.jsx("div",{className:"slot-empty-state",children:"Click panels to add tabs"}):n.panels.map((r,a)=>{const o=p(r),l="tabs"===n.type&&(n.config?.defaultActiveTab??0)===a;return o?t.jsxs("div",{className:"group-panel-item",children:[t.jsxs("span",{className:"group-panel-label",children:[o.label,l&&t.jsx("span",{className:"default-badge",children:"★"})]}),t.jsx("button",{className:"remove-from-group-btn",onClick:t=>w(e,r,t),title:`Remove ${o.label}`,children:"×"})]},r):null})})]}):t.jsxs("div",{className:"slot-content",children:["string"==typeof n&&p(n)?.preview&&t.jsx("div",{className:"slot-preview",children:p(n)?.preview}),t.jsx("div",{className:"slot-panel-label",children:"string"==typeof n?p(n)?.label:""}),t.jsx("button",{className:"slot-clear-btn",onClick:t=>x(e,t),"aria-label":`Remove ${"string"==typeof n?p(n)?.label:"panel"} from ${e} slot`,children:"×"})]})]},e)})})]}),t.jsxs("div",{className:"configurator-section",children:[t.jsx("h3",{className:"section-title",children:"Available Panels"}),t.jsx("div",{className:"available-panels",children:S.map(e=>{const n=(r=e.id,"panel"===d?.type&&d.id===r);var r;const a=f(e.id);return t.jsxs("div",{className:`available-panel ${n?"selected":""} ${a?"in-use":""}`,onClick:()=>y(e.id),children:[t.jsx("div",{className:"panel-label",children:e.label}),e.preview&&t.jsx("div",{className:"panel-preview",children:e.preview})]},e.id)})})]}),d&&t.jsx("div",{className:"selection-hint",children:"slot"===d.type?R(d.position)?t.jsxs(t.Fragment,{children:["Selected: ",d.position," slot (Tab Mode). Click panels to add them to the tab group."]}):t.jsxs(t.Fragment,{children:["Selected: ",d.position," slot. Click another slot to swap, or click a panel to assign."]}):t.jsxs(t.Fragment,{children:["Selected: ",p(d.id)?.label,". Click a slot to assign",R("left")||R("middle")||R("right")?" (or add to tab group)":"","."]})}),t.jsxs("div",{className:"usage-hint",children:[t.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",style:{verticalAlign:"text-bottom",marginRight:"4px"},children:t.jsx("path",{d:"M8 1a7 7 0 100 14A7 7 0 008 1zm0 1a6 6 0 110 12A6 6 0 018 2zm.5 3.5v3h-1v-3h1zm0 4v1h-1v-1h1z"})}),t.jsx("strong",{children:"Tip:"})," Toggle the tab icon on a slot to enable tab mode, then click panels to add multiple tabs."]})]})},e.ResponsiveConfigurablePanelLayout=({mobileBreakpoint:e="(max-width: 768px)",mobileCarouselProps:r,onMobilePanelChange:a,theme:o,layout:l,panels:c,...d})=>{const u=m(e),p=n.useRef(null),[g,b]=n.useState(0),v=n.useMemo(()=>[l?.left,l?.middle,l?.right],[l]),y=["left","middle","right"],x=n.useMemo(()=>{const e=e=>{if(!e)return null;const t=c.find(t=>t.id===e);return t?.content??null},n=e=>{const t=c.find(t=>t.id===e);return t?.label??e},r=e=>{const t=c.find(t=>t.id===e);return t?.icon??null};return v.map((a,l)=>((a,l)=>{if(null==a)return null;if("object"==typeof a&&"type"in a){const e=a;if("tabs"===e.type){const a=e.panels[0],i=e.panels.length>0?n(a):"Tab Group",d=e.panels.length>0?r(a):null;return{content:t.jsx(s,{panelIds:e.panels,panels:c,config:e.config,theme:o}),label:i,icon:d,slot:l}}return null}return{content:e(a),label:n(a),icon:r(a),slot:l}})(a,y[l])).filter(e=>null!==e)},[v,c,o]),w=e=>{b(e),r?.onPanelChange?.(e);const t=x[e]?.slot;t&&a?.(e,t)},{onPanelChange:C,...S}=r??{},R=i(o);if(u){if(0===x.length)return null;const e=x.map(e=>e.content);return t.jsxs("div",{className:"mobile-tab-layout",style:R,children:[t.jsx("div",{className:"mobile-tab-content",children:t.jsx(f,{ref:p,theme:o,panels:e,minPanelWidth:0,idealPanelWidth:1,disableSwipe:!0,onPanelChange:w,...S})}),t.jsx("nav",{className:"mobile-tab-nav",role:"tablist",children:x.map((e,n)=>t.jsxs("button",{role:"tab","aria-selected":n===g,className:"mobile-tab-button "+(n===g?"active":""),onClick:()=>(e=>{b(e),p.current?.scrollToPanel(e);const t=x[e]?.slot;t&&a?.(e,t)})(n),children:[e.icon&&t.jsx("span",{className:"tab-icon",children:e.icon}),t.jsx("span",{className:"tab-label",children:e.label})]},n))})]})}return t.jsx(h,{theme:o,layout:l,panels:c,...d})},e.SnapCarousel=f,e.TabGroup=s,e.mapThemeToPanelVars=l,e.mapThemeToTabVars=i,e.useMediaQuery=m,e.usePanelBounds=p,e.usePanelOffset=function(){const{bounds:e}=p();return{offsetX:e.x,offsetY:e.y}},Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})});
|
|
2
2
|
//# sourceMappingURL=index.umd.js.map
|