@theroutingcompany/components 0.0.145 → 0.0.146

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.
@@ -225,7 +225,7 @@ object-assign
225
225
  height: 18px;
226
226
  }
227
227
  }
228
- `,sg=c.createContext(void 0),$a=()=>{const e=c.useContext(sg);if(!e)throw new Error("ActionMenu components must be used within an ActionMenu root");return e},cg=c.forwardRef(function({children:t,closeOnOutsideClick:n=!0,triggerMoveBehavior:r="follow",size:o="small",align:i="right",autoAdjustAlign:a=!0},l){const[s,u]=c.useState(!1),d=c.useRef(null),p=c.useRef(null),g=c.useCallback(()=>{u(!1)},[]);return c.useEffect(()=>{if(!s||!n)return;const m=h=>{const b=h.target;d.current&&p.current&&!d.current.contains(b)&&!p.current.contains(b)&&g()};return document.addEventListener("mousedown",m),()=>{document.removeEventListener("mousedown",m)}},[s,n,g]),c.useEffect(()=>{if(!s)return;const m=h=>{var b;h.key==="Escape"&&(g(),(b=p.current)==null||b.focus())};return document.addEventListener("keydown",m),()=>{document.removeEventListener("keydown",m)}},[s,g]),w(sg.Provider,{value:{isOpen:s,setIsOpen:u,close:g,contentRef:d,triggerRef:p,closeOnOutsideClick:n,triggerMoveBehavior:r,size:o,align:i,autoAdjustAlign:a},children:w("div",{ref:l,children:t})})});cg.displayName="ActionMenu";const ug=c.forwardRef(function({children:t,"aria-label":n="View actions"},r){const{isOpen:o,setIsOpen:i,triggerRef:a,size:l}=$a();return w("button",{ref:u=>{a.current=u,typeof r=="function"?r(u):r&&(r.current=u)},onClick:()=>{i(!o)},"aria-haspopup":"menu","aria-expanded":o,"aria-label":n,style:{all:"unset",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",width:l==="small"?"24px":"auto",height:l==="small"?"24px":"auto",padding:l==="small"?"0":"4px",borderRadius:"4px",transition:"background-color 100ms ease-out",fontSize:l==="small"?"16px":"20px"},children:t})});ug.displayName="ActionMenuTrigger";const dg=c.forwardRef(function({children:t},n){const{isOpen:r,contentRef:o,triggerRef:i,triggerMoveBehavior:a,close:l,align:s,autoAdjustAlign:u}=$a(),[d,p]=c.useState({top:0,right:0}),[g,m]=c.useState(s),[h,b]=c.useState(16),v=c.useRef(null),_=c.useRef(200),y=c.useCallback(()=>{var x;if(!i.current)return;const E=i.current.getBoundingClientRect(),S=((x=o.current)==null?void 0:x.offsetWidth)||_.current;_.current=S;const C=E.left+E.width/2,T=8;let O=s,$=C-S/2;u?$<T?($=T,O="left"):$+S>window.innerWidth-T?($=window.innerWidth-S-T,O="right"):O=s:$=C-S/2,m(O);const k={top:E.bottom+8,left:$},A=C-$;b(Math.max(8,Math.min(S-8,A))),p(k),v.current=E},[i,o,s,u]);return c.useEffect(()=>{if(!r||!i.current)return;y();const E=new ResizeObserver(()=>{if(!v.current||!i.current){y();return}const C=i.current.getBoundingClientRect();(C.top!==v.current.top||C.left!==v.current.left||C.width!==v.current.width||C.height!==v.current.height)&&(a==="follow"?y():l())});E.observe(i.current);const S=()=>{a==="follow"?y():l()};return window.addEventListener("scroll",S,!0),window.addEventListener("resize",S),()=>{E.disconnect(),window.removeEventListener("scroll",S,!0),window.removeEventListener("resize",S)}},[r,i,a,y,l]),w(Zo,{children:Q(IP,{ref:E=>{o.current=E,typeof n=="function"?n(E):n&&(n.current=E)},"data-state":r?"open":"closed",style:{top:`${d.top}px`,left:`${d.left}px`},children:[w(MP,{$position:h}),w(OP,{role:"menu",children:t})]})})});dg.displayName="ActionMenuContent";const fg=c.forwardRef(function({children:t,onClick:n,disabled:r=!1,icon:o,title:i,"aria-label":a,hidden:l},s){const{close:u}=$a(),d=()=>{r||(n==null||n(),u())},{size:p}=$a();return Q(FP,{ref:s,onClick:d,disabled:r,"data-disabled":r,title:i,"aria-label":a,hidden:l,role:"menuitem","data-size":p,children:[o&&w("span",{children:o}),w("span",{children:t})]})});fg.displayName="ActionMenuItem";function LP(e,t=globalThis==null?void 0:globalThis.document){const n=rt(e);c.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r),()=>t.removeEventListener("keydown",r)},[n,t])}const ac="dismissableLayer.update",zP="dismissableLayer.pointerDownOutside",NP="dismissableLayer.focusOutside";let pg;const gg=c.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Jo=c.forwardRef((e,t)=>{var n;const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:o,onPointerDownOutside:i,onFocusOutside:a,onInteractOutside:l,onDismiss:s,...u}=e,d=c.useContext(gg),[p,g]=c.useState(null),m=(n=p==null?void 0:p.ownerDocument)!==null&&n!==void 0?n:globalThis==null?void 0:globalThis.document,[,h]=c.useState({}),b=Ce(t,$=>g($)),v=Array.from(d.layers),[_]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),y=v.indexOf(_),E=p?v.indexOf(p):-1,S=d.layersWithOutsidePointerEventsDisabled.size>0,C=E>=y,T=KP($=>{const k=$.target,A=[...d.branches].some(x=>x.contains(k));!C||A||(i==null||i($),l==null||l($),$.defaultPrevented||s==null||s())},m),O=VP($=>{const k=$.target;[...d.branches].some(x=>x.contains(k))||(a==null||a($),l==null||l($),$.defaultPrevented||s==null||s())},m);return LP($=>{E===d.layers.size-1&&(o==null||o($),!$.defaultPrevented&&s&&($.preventDefault(),s()))},m),c.useEffect(()=>{if(p)return r&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(pg=m.body.style.pointerEvents,m.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(p)),d.layers.add(p),mg(),()=>{r&&d.layersWithOutsidePointerEventsDisabled.size===1&&(m.body.style.pointerEvents=pg)}},[p,m,r,d]),c.useEffect(()=>()=>{p&&(d.layers.delete(p),d.layersWithOutsidePointerEventsDisabled.delete(p),mg())},[p,d]),c.useEffect(()=>{const $=()=>h({});return document.addEventListener(ac,$),()=>document.removeEventListener(ac,$)},[]),c.createElement(me.div,K({},u,{ref:b,style:{pointerEvents:S?C?"auto":"none":void 0,...e.style},onFocusCapture:ie(e.onFocusCapture,O.onFocusCapture),onBlurCapture:ie(e.onBlurCapture,O.onBlurCapture),onPointerDownCapture:ie(e.onPointerDownCapture,T.onPointerDownCapture)}))}),RP=c.forwardRef((e,t)=>{const n=c.useContext(gg),r=c.useRef(null),o=Ce(t,r);return c.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),c.createElement(me.div,K({},e,{ref:o}))});function KP(e,t=globalThis==null?void 0:globalThis.document){const n=rt(e),r=c.useRef(!1),o=c.useRef(()=>{});return c.useEffect(()=>{const i=l=>{if(l.target&&!r.current){let u=function(){hg(zP,n,s,{discrete:!0})};const s={originalEvent:l};l.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=u,t.addEventListener("click",o.current,{once:!0})):u()}r.current=!1},a=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(a),t.removeEventListener("pointerdown",i),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function VP(e,t=globalThis==null?void 0:globalThis.document){const n=rt(e),r=c.useRef(!1);return c.useEffect(()=>{const o=i=>{i.target&&!r.current&&hg(NP,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function mg(){const e=new CustomEvent(ac);document.dispatchEvent(e)}function hg(e,t,n,{discrete:r}){const o=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?Us(o,i):o.dispatchEvent(i)}const BP=Jo,jP=RP,lc="focusScope.autoFocusOnMount",sc="focusScope.autoFocusOnUnmount",bg={bubbles:!1,cancelable:!0},cc=c.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:i,...a}=e,[l,s]=c.useState(null),u=rt(o),d=rt(i),p=c.useRef(null),g=Ce(t,b=>s(b)),m=c.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;c.useEffect(()=>{if(r){let b=function(E){if(m.paused||!l)return;const S=E.target;l.contains(S)?p.current=S:zn(p.current,{select:!0})},v=function(E){if(m.paused||!l)return;const S=E.relatedTarget;S!==null&&(l.contains(S)||zn(p.current,{select:!0}))},_=function(E){const S=document.activeElement;for(const C of E)C.removedNodes.length>0&&(l!=null&&l.contains(S)||zn(l))};document.addEventListener("focusin",b),document.addEventListener("focusout",v);const y=new MutationObserver(_);return l&&y.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",b),document.removeEventListener("focusout",v),y.disconnect()}}},[r,l,m.paused]),c.useEffect(()=>{if(l){$g.add(m);const b=document.activeElement;if(!l.contains(b)){const _=new CustomEvent(lc,bg);l.addEventListener(lc,u),l.dispatchEvent(_),_.defaultPrevented||(UP(qP(vg(l)),{select:!0}),document.activeElement===b&&zn(l))}return()=>{l.removeEventListener(lc,u),setTimeout(()=>{const _=new CustomEvent(sc,bg);l.addEventListener(sc,d),l.dispatchEvent(_),_.defaultPrevented||zn(b??document.body,{select:!0}),l.removeEventListener(sc,d),$g.remove(m)},0)}}},[l,u,d,m]);const h=c.useCallback(b=>{if(!n&&!r||m.paused)return;const v=b.key==="Tab"&&!b.altKey&&!b.ctrlKey&&!b.metaKey,_=document.activeElement;if(v&&_){const y=b.currentTarget,[E,S]=WP(y);E&&S?!b.shiftKey&&_===S?(b.preventDefault(),n&&zn(E,{select:!0})):b.shiftKey&&_===E&&(b.preventDefault(),n&&zn(S,{select:!0})):_===y&&b.preventDefault()}},[n,r,m.paused]);return c.createElement(me.div,K({tabIndex:-1},a,{ref:g,onKeyDown:h}))});function UP(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(zn(r,{select:t}),document.activeElement!==n)return}function WP(e){const t=vg(e),n=yg(t,e),r=yg(t.reverse(),e);return[n,r]}function vg(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function yg(e,t){for(const n of e)if(!HP(n,{upTo:t}))return n}function HP(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function GP(e){return e instanceof HTMLInputElement&&"select"in e}function zn(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&GP(e)&&t&&e.select()}}const $g=YP();function YP(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=_g(e,t),e.unshift(t)},remove(t){var n;e=_g(e,t),(n=e[0])===null||n===void 0||n.resume()}}}function _g(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function qP(e){return e.filter(t=>t.tagName!=="A")}const Qo=c.forwardRef((e,t)=>{var n;const{container:r=globalThis==null||(n=globalThis.document)===null||n===void 0?void 0:n.body,...o}=e;return r?cn.default.createPortal(c.createElement(me.div,K({},o,{ref:t})),r):null});let uc=0;function dc(){c.useEffect(()=>{var e,t;const n=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",(e=n[0])!==null&&e!==void 0?e:xg()),document.body.insertAdjacentElement("beforeend",(t=n[1])!==null&&t!==void 0?t:xg()),uc++,()=>{uc===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(r=>r.remove()),uc--}},[])}function xg(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",e}var en=function(){return en=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},en.apply(this,arguments)};function wg(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function XP(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,i;r<o;r++)(i||!(r in t))&&(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))}typeof SuppressedError=="function"&&SuppressedError;var _a="right-scroll-bar-position",xa="width-before-scroll-bar",ZP="with-scroll-bars-hidden",JP="--removed-body-scroll-bar-size";function QP(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function eT(e,t){var n=c.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=t,n.facade}function Eg(e,t){return eT(t||null,function(n){return e.forEach(function(r){return QP(r,n)})})}function Sg(e){return e}function Dg(e,t){t===void 0&&(t=Sg);var n=[],r=!1,o={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(i){var a=t(i,r);return n.push(a),function(){n=n.filter(function(l){return l!==a})}},assignSyncMedium:function(i){for(r=!0;n.length;){var a=n;n=[],a.forEach(i)}n={push:function(l){return i(l)},filter:function(){return n}}},assignMedium:function(i){r=!0;var a=[];if(n.length){var l=n;n=[],l.forEach(i),a=n}var s=function(){var d=a;a=[],d.forEach(i)},u=function(){return Promise.resolve().then(s)};u(),n={push:function(d){a.push(d),u()},filter:function(d){return a=a.filter(d),n}}}};return o}function fc(e,t){return t===void 0&&(t=Sg),Dg(e,t)}function Pg(e){e===void 0&&(e={});var t=Dg(null);return t.options=en({async:!0,ssr:!1},e),t}var Tg=function(e){var t=e.sideCar,n=wg(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return P.createElement(r,en({},n))};Tg.isSideCarExport=!0;function tT(e,t){return e.useMedium(t),Tg}var kg=Pg(),pc=function(){},wa=P.forwardRef(function(e,t){var n=P.useRef(null),r=P.useState({onScrollCapture:pc,onWheelCapture:pc,onTouchMoveCapture:pc}),o=r[0],i=r[1],a=e.forwardProps,l=e.children,s=e.className,u=e.removeScrollBar,d=e.enabled,p=e.shards,g=e.sideCar,m=e.noIsolation,h=e.inert,b=e.allowPinchZoom,v=e.as,_=v===void 0?"div":v,y=wg(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as"]),E=g,S=Eg([n,t]),C=en(en({},y),o);return P.createElement(P.Fragment,null,d&&P.createElement(E,{sideCar:kg,removeScrollBar:u,shards:p,noIsolation:m,inert:h,setCallbacks:i,allowPinchZoom:!!b,lockRef:n}),a?P.cloneElement(P.Children.only(l),en(en({},C),{ref:S})):P.createElement(_,en({},C,{className:s,ref:S}),l))});wa.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},wa.classNames={fullWidth:xa,zeroRight:_a};var Cg,nT=function(){if(Cg)return Cg;if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function rT(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=nT();return t&&e.setAttribute("nonce",t),e}function oT(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function iT(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var aT=function(){var e=0,t=null;return{add:function(n){e==0&&(t=rT())&&(oT(t,n),iT(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},lT=function(){var e=aT();return function(t,n){P.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Ag=function(){var e=lT(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},sT={left:0,top:0,right:0,gap:0},gc=function(e){return parseInt(e||"",10)||0},cT=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[gc(n),gc(r),gc(o)]},uT=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return sT;var t=cT(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},dT=Ag(),fT=function(e,t,n,r){var o=e.left,i=e.top,a=e.right,l=e.gap;return n===void 0&&(n="margin"),`
228
+ `,sg=c.createContext(void 0),$a=()=>{const e=c.useContext(sg);if(!e)throw new Error("ActionMenu components must be used within an ActionMenu root");return e},cg=c.forwardRef(function({children:t,closeOnOutsideClick:n=!0,triggerMoveBehavior:r="follow",size:o="small",align:i="right",autoAdjustAlign:a=!0},l){const[s,u]=c.useState(!1),d=c.useRef(null),p=c.useRef(null),g=c.useCallback(()=>{u(!1)},[]);return c.useEffect(()=>{if(!s||!n)return;const m=h=>{const b=h.target;d.current&&p.current&&!d.current.contains(b)&&!p.current.contains(b)&&g()};return document.addEventListener("mousedown",m),()=>{document.removeEventListener("mousedown",m)}},[s,n,g]),c.useEffect(()=>{if(!s)return;const m=h=>{var b;h.key==="Escape"&&(g(),(b=p.current)==null||b.focus())};return document.addEventListener("keydown",m),()=>{document.removeEventListener("keydown",m)}},[s,g]),w(sg.Provider,{value:{isOpen:s,setIsOpen:u,close:g,contentRef:d,triggerRef:p,closeOnOutsideClick:n,triggerMoveBehavior:r,size:o,align:i,autoAdjustAlign:a},children:w("div",{ref:l,children:t})})});cg.displayName="ActionMenu";const ug=c.forwardRef(function({children:t,"aria-label":n="View actions"},r){const{isOpen:o,setIsOpen:i,triggerRef:a,size:l}=$a();return w("button",{type:"button",ref:u=>{a.current=u,typeof r=="function"?r(u):r&&(r.current=u)},onClick:()=>{i(!o)},"aria-haspopup":"menu","aria-expanded":o,"aria-label":n,style:{all:"unset",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",width:l==="small"?"24px":"auto",height:l==="small"?"24px":"auto",padding:l==="small"?"0":"4px",borderRadius:"4px",transition:"background-color 100ms ease-out",fontSize:l==="small"?"16px":"20px"},children:t})});ug.displayName="ActionMenuTrigger";const dg=c.forwardRef(function({children:t},n){const{isOpen:r,contentRef:o,triggerRef:i,triggerMoveBehavior:a,close:l,align:s,autoAdjustAlign:u}=$a(),[d,p]=c.useState({top:0,right:0}),[g,m]=c.useState(s),[h,b]=c.useState(16),v=c.useRef(null),_=c.useRef(200),y=c.useCallback(()=>{var x;if(!i.current)return;const E=i.current.getBoundingClientRect(),S=((x=o.current)==null?void 0:x.offsetWidth)||_.current;_.current=S;const C=E.left+E.width/2,T=8;let O=s,$=C-S/2;u?$<T?($=T,O="left"):$+S>window.innerWidth-T?($=window.innerWidth-S-T,O="right"):O=s:$=C-S/2,m(O);const k={top:E.bottom+8,left:$},A=C-$;b(Math.max(8,Math.min(S-8,A))),p(k),v.current=E},[i,o,s,u]);return c.useEffect(()=>{if(!r||!i.current)return;y();const E=new ResizeObserver(()=>{if(!v.current||!i.current){y();return}const C=i.current.getBoundingClientRect();(C.top!==v.current.top||C.left!==v.current.left||C.width!==v.current.width||C.height!==v.current.height)&&(a==="follow"?y():l())});E.observe(i.current);const S=()=>{a==="follow"?y():l()};return window.addEventListener("scroll",S,!0),window.addEventListener("resize",S),()=>{E.disconnect(),window.removeEventListener("scroll",S,!0),window.removeEventListener("resize",S)}},[r,i,a,y,l]),w(Zo,{children:Q(IP,{ref:E=>{o.current=E,typeof n=="function"?n(E):n&&(n.current=E)},"data-state":r?"open":"closed",style:{top:`${d.top}px`,left:`${d.left}px`},children:[w(MP,{$position:h}),w(OP,{role:"menu",children:t})]})})});dg.displayName="ActionMenuContent";const fg=c.forwardRef(function({children:t,onClick:n,disabled:r=!1,icon:o,title:i,"aria-label":a,hidden:l},s){const{close:u}=$a(),d=()=>{r||(n==null||n(),u())},{size:p}=$a();return Q(FP,{ref:s,onClick:d,disabled:r,"data-disabled":r,title:i,"aria-label":a,hidden:l,role:"menuitem","data-size":p,children:[o&&w("span",{children:o}),w("span",{children:t})]})});fg.displayName="ActionMenuItem";function LP(e,t=globalThis==null?void 0:globalThis.document){const n=rt(e);c.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r),()=>t.removeEventListener("keydown",r)},[n,t])}const ac="dismissableLayer.update",zP="dismissableLayer.pointerDownOutside",NP="dismissableLayer.focusOutside";let pg;const gg=c.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Jo=c.forwardRef((e,t)=>{var n;const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:o,onPointerDownOutside:i,onFocusOutside:a,onInteractOutside:l,onDismiss:s,...u}=e,d=c.useContext(gg),[p,g]=c.useState(null),m=(n=p==null?void 0:p.ownerDocument)!==null&&n!==void 0?n:globalThis==null?void 0:globalThis.document,[,h]=c.useState({}),b=Ce(t,$=>g($)),v=Array.from(d.layers),[_]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),y=v.indexOf(_),E=p?v.indexOf(p):-1,S=d.layersWithOutsidePointerEventsDisabled.size>0,C=E>=y,T=KP($=>{const k=$.target,A=[...d.branches].some(x=>x.contains(k));!C||A||(i==null||i($),l==null||l($),$.defaultPrevented||s==null||s())},m),O=VP($=>{const k=$.target;[...d.branches].some(x=>x.contains(k))||(a==null||a($),l==null||l($),$.defaultPrevented||s==null||s())},m);return LP($=>{E===d.layers.size-1&&(o==null||o($),!$.defaultPrevented&&s&&($.preventDefault(),s()))},m),c.useEffect(()=>{if(p)return r&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(pg=m.body.style.pointerEvents,m.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(p)),d.layers.add(p),mg(),()=>{r&&d.layersWithOutsidePointerEventsDisabled.size===1&&(m.body.style.pointerEvents=pg)}},[p,m,r,d]),c.useEffect(()=>()=>{p&&(d.layers.delete(p),d.layersWithOutsidePointerEventsDisabled.delete(p),mg())},[p,d]),c.useEffect(()=>{const $=()=>h({});return document.addEventListener(ac,$),()=>document.removeEventListener(ac,$)},[]),c.createElement(me.div,K({},u,{ref:b,style:{pointerEvents:S?C?"auto":"none":void 0,...e.style},onFocusCapture:ie(e.onFocusCapture,O.onFocusCapture),onBlurCapture:ie(e.onBlurCapture,O.onBlurCapture),onPointerDownCapture:ie(e.onPointerDownCapture,T.onPointerDownCapture)}))}),RP=c.forwardRef((e,t)=>{const n=c.useContext(gg),r=c.useRef(null),o=Ce(t,r);return c.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),c.createElement(me.div,K({},e,{ref:o}))});function KP(e,t=globalThis==null?void 0:globalThis.document){const n=rt(e),r=c.useRef(!1),o=c.useRef(()=>{});return c.useEffect(()=>{const i=l=>{if(l.target&&!r.current){let u=function(){hg(zP,n,s,{discrete:!0})};const s={originalEvent:l};l.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=u,t.addEventListener("click",o.current,{once:!0})):u()}r.current=!1},a=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(a),t.removeEventListener("pointerdown",i),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function VP(e,t=globalThis==null?void 0:globalThis.document){const n=rt(e),r=c.useRef(!1);return c.useEffect(()=>{const o=i=>{i.target&&!r.current&&hg(NP,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function mg(){const e=new CustomEvent(ac);document.dispatchEvent(e)}function hg(e,t,n,{discrete:r}){const o=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?Us(o,i):o.dispatchEvent(i)}const BP=Jo,jP=RP,lc="focusScope.autoFocusOnMount",sc="focusScope.autoFocusOnUnmount",bg={bubbles:!1,cancelable:!0},cc=c.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:i,...a}=e,[l,s]=c.useState(null),u=rt(o),d=rt(i),p=c.useRef(null),g=Ce(t,b=>s(b)),m=c.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;c.useEffect(()=>{if(r){let b=function(E){if(m.paused||!l)return;const S=E.target;l.contains(S)?p.current=S:zn(p.current,{select:!0})},v=function(E){if(m.paused||!l)return;const S=E.relatedTarget;S!==null&&(l.contains(S)||zn(p.current,{select:!0}))},_=function(E){const S=document.activeElement;for(const C of E)C.removedNodes.length>0&&(l!=null&&l.contains(S)||zn(l))};document.addEventListener("focusin",b),document.addEventListener("focusout",v);const y=new MutationObserver(_);return l&&y.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",b),document.removeEventListener("focusout",v),y.disconnect()}}},[r,l,m.paused]),c.useEffect(()=>{if(l){$g.add(m);const b=document.activeElement;if(!l.contains(b)){const _=new CustomEvent(lc,bg);l.addEventListener(lc,u),l.dispatchEvent(_),_.defaultPrevented||(UP(qP(vg(l)),{select:!0}),document.activeElement===b&&zn(l))}return()=>{l.removeEventListener(lc,u),setTimeout(()=>{const _=new CustomEvent(sc,bg);l.addEventListener(sc,d),l.dispatchEvent(_),_.defaultPrevented||zn(b??document.body,{select:!0}),l.removeEventListener(sc,d),$g.remove(m)},0)}}},[l,u,d,m]);const h=c.useCallback(b=>{if(!n&&!r||m.paused)return;const v=b.key==="Tab"&&!b.altKey&&!b.ctrlKey&&!b.metaKey,_=document.activeElement;if(v&&_){const y=b.currentTarget,[E,S]=WP(y);E&&S?!b.shiftKey&&_===S?(b.preventDefault(),n&&zn(E,{select:!0})):b.shiftKey&&_===E&&(b.preventDefault(),n&&zn(S,{select:!0})):_===y&&b.preventDefault()}},[n,r,m.paused]);return c.createElement(me.div,K({tabIndex:-1},a,{ref:g,onKeyDown:h}))});function UP(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(zn(r,{select:t}),document.activeElement!==n)return}function WP(e){const t=vg(e),n=yg(t,e),r=yg(t.reverse(),e);return[n,r]}function vg(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function yg(e,t){for(const n of e)if(!HP(n,{upTo:t}))return n}function HP(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function GP(e){return e instanceof HTMLInputElement&&"select"in e}function zn(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&GP(e)&&t&&e.select()}}const $g=YP();function YP(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=_g(e,t),e.unshift(t)},remove(t){var n;e=_g(e,t),(n=e[0])===null||n===void 0||n.resume()}}}function _g(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function qP(e){return e.filter(t=>t.tagName!=="A")}const Qo=c.forwardRef((e,t)=>{var n;const{container:r=globalThis==null||(n=globalThis.document)===null||n===void 0?void 0:n.body,...o}=e;return r?cn.default.createPortal(c.createElement(me.div,K({},o,{ref:t})),r):null});let uc=0;function dc(){c.useEffect(()=>{var e,t;const n=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",(e=n[0])!==null&&e!==void 0?e:xg()),document.body.insertAdjacentElement("beforeend",(t=n[1])!==null&&t!==void 0?t:xg()),uc++,()=>{uc===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(r=>r.remove()),uc--}},[])}function xg(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",e}var en=function(){return en=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},en.apply(this,arguments)};function wg(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function XP(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,i;r<o;r++)(i||!(r in t))&&(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))}typeof SuppressedError=="function"&&SuppressedError;var _a="right-scroll-bar-position",xa="width-before-scroll-bar",ZP="with-scroll-bars-hidden",JP="--removed-body-scroll-bar-size";function QP(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function eT(e,t){var n=c.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=t,n.facade}function Eg(e,t){return eT(t||null,function(n){return e.forEach(function(r){return QP(r,n)})})}function Sg(e){return e}function Dg(e,t){t===void 0&&(t=Sg);var n=[],r=!1,o={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(i){var a=t(i,r);return n.push(a),function(){n=n.filter(function(l){return l!==a})}},assignSyncMedium:function(i){for(r=!0;n.length;){var a=n;n=[],a.forEach(i)}n={push:function(l){return i(l)},filter:function(){return n}}},assignMedium:function(i){r=!0;var a=[];if(n.length){var l=n;n=[],l.forEach(i),a=n}var s=function(){var d=a;a=[],d.forEach(i)},u=function(){return Promise.resolve().then(s)};u(),n={push:function(d){a.push(d),u()},filter:function(d){return a=a.filter(d),n}}}};return o}function fc(e,t){return t===void 0&&(t=Sg),Dg(e,t)}function Pg(e){e===void 0&&(e={});var t=Dg(null);return t.options=en({async:!0,ssr:!1},e),t}var Tg=function(e){var t=e.sideCar,n=wg(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return P.createElement(r,en({},n))};Tg.isSideCarExport=!0;function tT(e,t){return e.useMedium(t),Tg}var kg=Pg(),pc=function(){},wa=P.forwardRef(function(e,t){var n=P.useRef(null),r=P.useState({onScrollCapture:pc,onWheelCapture:pc,onTouchMoveCapture:pc}),o=r[0],i=r[1],a=e.forwardProps,l=e.children,s=e.className,u=e.removeScrollBar,d=e.enabled,p=e.shards,g=e.sideCar,m=e.noIsolation,h=e.inert,b=e.allowPinchZoom,v=e.as,_=v===void 0?"div":v,y=wg(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as"]),E=g,S=Eg([n,t]),C=en(en({},y),o);return P.createElement(P.Fragment,null,d&&P.createElement(E,{sideCar:kg,removeScrollBar:u,shards:p,noIsolation:m,inert:h,setCallbacks:i,allowPinchZoom:!!b,lockRef:n}),a?P.cloneElement(P.Children.only(l),en(en({},C),{ref:S})):P.createElement(_,en({},C,{className:s,ref:S}),l))});wa.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},wa.classNames={fullWidth:xa,zeroRight:_a};var Cg,nT=function(){if(Cg)return Cg;if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function rT(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=nT();return t&&e.setAttribute("nonce",t),e}function oT(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function iT(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var aT=function(){var e=0,t=null;return{add:function(n){e==0&&(t=rT())&&(oT(t,n),iT(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},lT=function(){var e=aT();return function(t,n){P.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Ag=function(){var e=lT(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},sT={left:0,top:0,right:0,gap:0},gc=function(e){return parseInt(e||"",10)||0},cT=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[gc(n),gc(r),gc(o)]},uT=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return sT;var t=cT(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},dT=Ag(),fT=function(e,t,n,r){var o=e.left,i=e.top,a=e.right,l=e.gap;return n===void 0&&(n="margin"),`
229
229
  .`.concat(ZP,` {
230
230
  overflow: hidden `).concat(r,`;
231
231
  padding-right: `).concat(l,"px ").concat(r,`;