@matthiaskrijgsman/mat-ui 0.0.14 → 0.0.16
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/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.umd.cjs +1 -1
- package/dist/index.umd.cjs.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/index.umd.cjs
CHANGED
|
@@ -137,5 +137,5 @@ React keys must be passed directly to JSX without using spread:
|
|
|
137
137
|
`,...r,children:i&&i.map((a,l)=>f.jsx("option",{value:a.value,disabled:a.disabled,children:a.label},l))}),f.jsxs($e,{children:[o&&f.jsx(_e,{}),f.jsx(Ce,{Icon:Qt})]})]}),f.jsx(me,{children:s}),f.jsx(pe,{children:o})]})},kt=e=>{const{children:t,onClick:n,selected:s,disabled:i=!1}=e;return f.jsxs("div",{onClick:()=>!i&&n&&n(),className:M("option-base px-4 py-2 rounded-xl cursor-pointer transition-all duration-150 select-none flex flex-row gap-3 items-center",s&&!i&&"option-selected",i&&"option-disabled cursor-not-allowed hover:bg-transparent active:bg-transparent"),children:[f.jsx("div",{className:"flex-1",children:t}),s&&!i&&f.jsx("div",{className:"shrink-0",children:f.jsx(If,{className:"h-5 w-5"})})]})};function en(){return typeof window<"u"}function st(e){return Vs(e)?(e.nodeName||"").toLowerCase():"#document"}function ne(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ge(e){var t;return(t=(Vs(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Vs(e){return en()?e instanceof Node||e instanceof ne(e).Node:!1}function H(e){return en()?e instanceof Element||e instanceof ne(e).Element:!1}function ye(e){return en()?e instanceof HTMLElement||e instanceof ne(e).HTMLElement:!1}function Is(e){return!en()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof ne(e).ShadowRoot}const Yf=new Set(["inline","contents"]);function At(e){const{overflow:t,overflowX:n,overflowY:s,display:i}=ue(e);return/auto|scroll|overlay|hidden|clip/.test(t+s+n)&&!Yf.has(i)}const Hf=new Set(["table","td","th"]);function Gf(e){return Hf.has(st(e))}const qf=[":popover-open",":modal"];function tn(e){return qf.some(t=>{try{return e.matches(t)}catch{return!1}})}const Zf=["transform","translate","scale","rotate","perspective"],Jf=["transform","translate","scale","rotate","perspective","filter"],Qf=["paint","layout","strict","content"];function Os(e){const t=Ls(),n=H(e)?ue(e):e;return Zf.some(s=>n[s]?n[s]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||Jf.some(s=>(n.willChange||"").includes(s))||Qf.some(s=>(n.contain||"").includes(s))}function eh(e){let t=je(e);for(;ye(t)&&!it(t);){if(Os(t))return t;if(tn(t))return null;t=je(t)}return null}function Ls(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const th=new Set(["html","body","#document"]);function it(e){return th.has(st(e))}function ue(e){return ne(e).getComputedStyle(e)}function nn(e){return H(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function je(e){if(st(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Is(e)&&e.host||ge(e);return Is(t)?t.host:t}function ra(e){const t=je(e);return it(t)?e.ownerDocument?e.ownerDocument.body:e.body:ye(t)&&At(t)?t:ra(t)}function jt(e,t,n){var s;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=ra(e),o=i===((s=e.ownerDocument)==null?void 0:s.body),r=ne(i);if(o){const a=Fs(r);return t.concat(r,r.visualViewport||[],At(i)?i:[],a&&n?jt(a):[])}return t.concat(i,jt(i,[],n))}function Fs(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}const Rt=Math.min,ae=Math.max,sn=Math.round,rn=Math.floor,ve=e=>({x:e,y:e});function oa(e,t){return typeof e=="function"?e(t):e}function Bs(e){return e.split("-")[0]}function aa(e){return e.split("-")[1]}function nh(e){return e==="x"?"y":"x"}function sh(e){return e==="y"?"height":"width"}const ih=new Set(["top","bottom"]);function _s(e){return ih.has(Bs(e))?"y":"x"}function rh(e){return nh(_s(e))}function oh(e){return{top:0,right:0,bottom:0,left:0,...e}}function ah(e){return typeof e!="number"?oh(e):{top:e,right:e,bottom:e,left:e}}function on(e){const{x:t,y:n,width:s,height:i}=e;return{width:s,height:i,top:n,left:t,right:t+s,bottom:n+i,x:t,y:n}}/*!
|
|
138
138
|
* tabbable 6.2.0
|
|
139
139
|
* @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
|
|
140
|
-
*/var lh=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"],$s=lh.join(","),la=typeof Element>"u",Dt=la?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,an=!la&&Element.prototype.getRootNode?function(e){var t;return e==null||(t=e.getRootNode)===null||t===void 0?void 0:t.call(e)}:function(e){return e?.ownerDocument},ln=function e(t,n){var s;n===void 0&&(n=!0);var i=t==null||(s=t.getAttribute)===null||s===void 0?void 0:s.call(t,"inert"),o=i===""||i==="true",r=o||n&&t&&e(t.parentNode);return r},ch=function(t){var n,s=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return s===""||s==="true"},uh=function(t,n,s){if(ln(t))return[];var i=Array.prototype.slice.apply(t.querySelectorAll($s));return n&&Dt.call(t,$s)&&i.unshift(t),i=i.filter(s),i},dh=function e(t,n,s){for(var i=[],o=Array.from(t);o.length;){var r=o.shift();if(!ln(r,!1))if(r.tagName==="SLOT"){var a=r.assignedElements(),l=a.length?a:r.children,u=e(l,!0,s);s.flatten?i.push.apply(i,u):i.push({scopeParent:r,candidates:u})}else{var c=Dt.call(r,$s);c&&s.filter(r)&&(n||!t.includes(r))&&i.push(r);var d=r.shadowRoot||typeof s.getShadowRoot=="function"&&s.getShadowRoot(r),h=!ln(d,!1)&&(!s.shadowRootFilter||s.shadowRootFilter(r));if(d&&h){var m=e(d===!0?r.children:d.children,!0,s);s.flatten?i.push.apply(i,m):i.push({scopeParent:r,candidates:m})}else o.unshift.apply(o,r.children)}}return i},ca=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},ua=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||ch(t))&&!ca(t)?0:t.tabIndex},fh=function(t,n){var s=ua(t);return s<0&&n&&!ca(t)?0:s},hh=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},da=function(t){return t.tagName==="INPUT"},mh=function(t){return da(t)&&t.type==="hidden"},ph=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(s){return s.tagName==="SUMMARY"});return n},gh=function(t,n){for(var s=0;s<t.length;s++)if(t[s].checked&&t[s].form===n)return t[s]},yh=function(t){if(!t.name)return!0;var n=t.form||an(t),s=function(a){return n.querySelectorAll('input[type="radio"][name="'+a+'"]')},i;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")i=s(window.CSS.escape(t.name));else try{i=s(t.name)}catch(r){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",r.message),!1}var o=gh(i,t.form);return!o||o===t},vh=function(t){return da(t)&&t.type==="radio"},xh=function(t){return vh(t)&&!yh(t)},bh=function(t){var n,s=t&&an(t),i=(n=s)===null||n===void 0?void 0:n.host,o=!1;if(s&&s!==t){var r,a,l;for(o=!!((r=i)!==null&&r!==void 0&&(a=r.ownerDocument)!==null&&a!==void 0&&a.contains(i)||t!=null&&(l=t.ownerDocument)!==null&&l!==void 0&&l.contains(t));!o&&i;){var u,c,d;s=an(i),i=(u=s)===null||u===void 0?void 0:u.host,o=!!((c=i)!==null&&c!==void 0&&(d=c.ownerDocument)!==null&&d!==void 0&&d.contains(i))}}return o},fa=function(t){var n=t.getBoundingClientRect(),s=n.width,i=n.height;return s===0&&i===0},wh=function(t,n){var s=n.displayCheck,i=n.getShadowRoot;if(getComputedStyle(t).visibility==="hidden")return!0;var o=Dt.call(t,"details>summary:first-of-type"),r=o?t.parentElement:t;if(Dt.call(r,"details:not([open]) *"))return!0;if(!s||s==="full"||s==="legacy-full"){if(typeof i=="function"){for(var a=t;t;){var l=t.parentElement,u=an(t);if(l&&!l.shadowRoot&&i(l)===!0)return fa(t);t.assignedSlot?t=t.assignedSlot:!l&&u!==t.ownerDocument?t=u.host:t=l}t=a}if(bh(t))return!t.getClientRects().length;if(s!=="legacy-full")return!0}else if(s==="non-zero-area")return fa(t);return!1},Th=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var n=t.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var s=0;s<n.children.length;s++){var i=n.children.item(s);if(i.tagName==="LEGEND")return Dt.call(n,"fieldset[disabled] *")?!0:!i.contains(t)}return!0}n=n.parentElement}return!1},Sh=function(t,n){return!(n.disabled||ln(n)||mh(n)||wh(n,t)||ph(n)||Th(n))},ha=function(t,n){return!(xh(n)||ua(n)<0||!Sh(t,n))},Ch=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},Ph=function e(t){var n=[],s=[];return t.forEach(function(i,o){var r=!!i.scopeParent,a=r?i.scopeParent:i,l=fh(a,r),u=r?e(i.candidates):a;l===0?r?n.push.apply(n,u):n.push(a):s.push({documentOrder:o,tabIndex:l,item:i,isScope:r,content:u})}),s.sort(hh).reduce(function(i,o){return o.isScope?i.push.apply(i,o.content):i.push(o.content),i},[]).concat(n)},ma=function(t,n){n=n||{};var s;return n.getShadowRoot?s=dh([t],n.includeContainer,{filter:ha.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:Ch}):s=uh(t,n.includeContainer,ha.bind(null,n)),Ph(s)};function Eh(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function kh(){return/apple/i.test(navigator.vendor)}function Ah(e){let t=e.activeElement;for(;((n=t)==null||(n=n.shadowRoot)==null?void 0:n.activeElement)!=null;){var n;t=t.shadowRoot.activeElement}return t}function jh(e,t){if(!e||!t)return!1;const n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&Is(n)){let s=t;for(;s;){if(e===s)return!0;s=s.parentNode||s.host}}return!1}function Ws(e){return e?.ownerDocument||document}var Rh=typeof document<"u",Dh=function(){},Re=Rh?T.useLayoutEffect:Dh;const Mh={...S}.useInsertionEffect||(e=>e());function Nh(e){const t=S.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return Mh(()=>{t.current=e}),S.useCallback(function(){for(var n=arguments.length,s=new Array(n),i=0;i<n;i++)s[i]=arguments[i];return t.current==null?void 0:t.current(...s)},[])}const pa=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function ga(e,t){const n=ma(e,pa()),s=n.length;if(s===0)return;const i=Ah(Ws(e)),o=n.indexOf(i),r=o===-1?t===1?0:s-1:o+t;return n[r]}function Vh(e){return ga(Ws(e).body,1)||e}function Ih(e){return ga(Ws(e).body,-1)||e}function Us(e,t){const n=t||e.currentTarget,s=e.relatedTarget;return!s||!jh(n,s)}function Oh(e){ma(e,pa()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function ya(e){e.querySelectorAll("[data-tabindex]").forEach(n=>{const s=n.dataset.tabindex;delete n.dataset.tabindex,s?n.setAttribute("tabindex",s):n.removeAttribute("tabindex")})}function va(e,t,n){let{reference:s,floating:i}=e;const o=_s(t),r=rh(t),a=sh(r),l=Bs(t),u=o==="y",c=s.x+s.width/2-i.width/2,d=s.y+s.height/2-i.height/2,h=s[a]/2-i[a]/2;let m;switch(l){case"top":m={x:c,y:s.y-i.height};break;case"bottom":m={x:c,y:s.y+s.height};break;case"right":m={x:s.x+s.width,y:d};break;case"left":m={x:s.x-i.width,y:d};break;default:m={x:s.x,y:s.y}}switch(aa(t)){case"start":m[r]-=h*(n&&u?-1:1);break;case"end":m[r]+=h*(n&&u?-1:1);break}return m}const Lh=async(e,t,n)=>{const{placement:s="bottom",strategy:i="absolute",middleware:o=[],platform:r}=n,a=o.filter(Boolean),l=await(r.isRTL==null?void 0:r.isRTL(t));let u=await r.getElementRects({reference:e,floating:t,strategy:i}),{x:c,y:d}=va(u,s,l),h=s,m={},p=0;for(let y=0;y<a.length;y++){const{name:x,fn:v}=a[y],{x:b,y:g,data:E,reset:C}=await v({x:c,y:d,initialPlacement:s,placement:h,strategy:i,middlewareData:m,rects:u,platform:r,elements:{reference:e,floating:t}});c=b??c,d=g??d,m={...m,[x]:{...m[x],...E}},C&&p<=50&&(p++,typeof C=="object"&&(C.placement&&(h=C.placement),C.rects&&(u=C.rects===!0?await r.getElementRects({reference:e,floating:t,strategy:i}):C.rects),{x:c,y:d}=va(u,h,l)),y=-1)}return{x:c,y:d,placement:h,strategy:i,middlewareData:m}};async function Fh(e,t){var n;t===void 0&&(t={});const{x:s,y:i,platform:o,rects:r,elements:a,strategy:l}=e,{boundary:u="clippingAncestors",rootBoundary:c="viewport",elementContext:d="floating",altBoundary:h=!1,padding:m=0}=oa(t,e),p=ah(m),x=a[h?d==="floating"?"reference":"floating":d],v=on(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(x)))==null||n?x:x.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(a.floating)),boundary:u,rootBoundary:c,strategy:l})),b=d==="floating"?{x:s,y:i,width:r.floating.width,height:r.floating.height}:r.reference,g=await(o.getOffsetParent==null?void 0:o.getOffsetParent(a.floating)),E=await(o.isElement==null?void 0:o.isElement(g))?await(o.getScale==null?void 0:o.getScale(g))||{x:1,y:1}:{x:1,y:1},C=on(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:b,offsetParent:g,strategy:l}):b);return{top:(v.top-C.top+p.top)/E.y,bottom:(C.bottom-v.bottom+p.bottom)/E.y,left:(v.left-C.left+p.left)/E.x,right:(C.right-v.right+p.right)/E.x}}const Bh=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,s;const{placement:i,rects:o,platform:r,elements:a}=t,{apply:l=()=>{},...u}=oa(e,t),c=await Fh(t,u),d=Bs(i),h=aa(i),m=_s(i)==="y",{width:p,height:y}=o.floating;let x,v;d==="top"||d==="bottom"?(x=d,v=h===(await(r.isRTL==null?void 0:r.isRTL(a.floating))?"start":"end")?"left":"right"):(v=d,x=h==="end"?"top":"bottom");const b=y-c.top-c.bottom,g=p-c.left-c.right,E=Rt(y-c[x],b),C=Rt(p-c[v],g),P=!t.middlewareData.shift;let k=E,A=C;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(A=g),(s=t.middlewareData.shift)!=null&&s.enabled.y&&(k=b),P&&!h){const I=ae(c.left,0),U=ae(c.right,0),se=ae(c.top,0),O=ae(c.bottom,0);m?A=p-2*(I!==0||U!==0?I+U:ae(c.left,c.right)):k=y-2*(se!==0||O!==0?se+O:ae(c.top,c.bottom))}await l({...t,availableWidth:A,availableHeight:k});const V=await r.getDimensions(a.floating);return p!==V.width||y!==V.height?{reset:{rects:!0}}:{}}}};function xa(e){const t=ue(e);let n=parseFloat(t.width)||0,s=parseFloat(t.height)||0;const i=ye(e),o=i?e.offsetWidth:n,r=i?e.offsetHeight:s,a=sn(n)!==o||sn(s)!==r;return a&&(n=o,s=r),{width:n,height:s,$:a}}function zs(e){return H(e)?e:e.contextElement}function rt(e){const t=zs(e);if(!ye(t))return ve(1);const n=t.getBoundingClientRect(),{width:s,height:i,$:o}=xa(t);let r=(o?sn(n.width):n.width)/s,a=(o?sn(n.height):n.height)/i;return(!r||!Number.isFinite(r))&&(r=1),(!a||!Number.isFinite(a))&&(a=1),{x:r,y:a}}const _h=ve(0);function ba(e){const t=ne(e);return!Ls()||!t.visualViewport?_h:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function $h(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==ne(e)?!1:t}function We(e,t,n,s){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),o=zs(e);let r=ve(1);t&&(s?H(s)&&(r=rt(s)):r=rt(e));const a=$h(o,n,s)?ba(o):ve(0);let l=(i.left+a.x)/r.x,u=(i.top+a.y)/r.y,c=i.width/r.x,d=i.height/r.y;if(o){const h=ne(o),m=s&&H(s)?ne(s):s;let p=h,y=Fs(p);for(;y&&s&&m!==p;){const x=rt(y),v=y.getBoundingClientRect(),b=ue(y),g=v.left+(y.clientLeft+parseFloat(b.paddingLeft))*x.x,E=v.top+(y.clientTop+parseFloat(b.paddingTop))*x.y;l*=x.x,u*=x.y,c*=x.x,d*=x.y,l+=g,u+=E,p=ne(y),y=Fs(p)}}return on({width:c,height:d,x:l,y:u})}function cn(e,t){const n=nn(e).scrollLeft;return t?t.left+n:We(ge(e)).left+n}function wa(e,t){const n=e.getBoundingClientRect(),s=n.left+t.scrollLeft-cn(e,n),i=n.top+t.scrollTop;return{x:s,y:i}}function Wh(e){let{elements:t,rect:n,offsetParent:s,strategy:i}=e;const o=i==="fixed",r=ge(s),a=t?tn(t.floating):!1;if(s===r||a&&o)return n;let l={scrollLeft:0,scrollTop:0},u=ve(1);const c=ve(0),d=ye(s);if((d||!d&&!o)&&((st(s)!=="body"||At(r))&&(l=nn(s)),ye(s))){const m=We(s);u=rt(s),c.x=m.x+s.clientLeft,c.y=m.y+s.clientTop}const h=r&&!d&&!o?wa(r,l):ve(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-l.scrollLeft*u.x+c.x+h.x,y:n.y*u.y-l.scrollTop*u.y+c.y+h.y}}function Uh(e){return Array.from(e.getClientRects())}function zh(e){const t=ge(e),n=nn(e),s=e.ownerDocument.body,i=ae(t.scrollWidth,t.clientWidth,s.scrollWidth,s.clientWidth),o=ae(t.scrollHeight,t.clientHeight,s.scrollHeight,s.clientHeight);let r=-n.scrollLeft+cn(e);const a=-n.scrollTop;return ue(s).direction==="rtl"&&(r+=ae(t.clientWidth,s.clientWidth)-i),{width:i,height:o,x:r,y:a}}const Ta=25;function Kh(e,t){const n=ne(e),s=ge(e),i=n.visualViewport;let o=s.clientWidth,r=s.clientHeight,a=0,l=0;if(i){o=i.width,r=i.height;const c=Ls();(!c||c&&t==="fixed")&&(a=i.offsetLeft,l=i.offsetTop)}const u=cn(s);if(u<=0){const c=s.ownerDocument,d=c.body,h=getComputedStyle(d),m=c.compatMode==="CSS1Compat"&&parseFloat(h.marginLeft)+parseFloat(h.marginRight)||0,p=Math.abs(s.clientWidth-d.clientWidth-m);p<=Ta&&(o-=p)}else u<=Ta&&(o+=u);return{width:o,height:r,x:a,y:l}}const Xh=new Set(["absolute","fixed"]);function Yh(e,t){const n=We(e,!0,t==="fixed"),s=n.top+e.clientTop,i=n.left+e.clientLeft,o=ye(e)?rt(e):ve(1),r=e.clientWidth*o.x,a=e.clientHeight*o.y,l=i*o.x,u=s*o.y;return{width:r,height:a,x:l,y:u}}function Sa(e,t,n){let s;if(t==="viewport")s=Kh(e,n);else if(t==="document")s=zh(ge(e));else if(H(t))s=Yh(t,n);else{const i=ba(e);s={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return on(s)}function Ca(e,t){const n=je(e);return n===t||!H(n)||it(n)?!1:ue(n).position==="fixed"||Ca(n,t)}function Hh(e,t){const n=t.get(e);if(n)return n;let s=jt(e,[],!1).filter(a=>H(a)&&st(a)!=="body"),i=null;const o=ue(e).position==="fixed";let r=o?je(e):e;for(;H(r)&&!it(r);){const a=ue(r),l=Os(r);!l&&a.position==="fixed"&&(i=null),(o?!l&&!i:!l&&a.position==="static"&&!!i&&Xh.has(i.position)||At(r)&&!l&&Ca(e,r))?s=s.filter(c=>c!==r):i=a,r=je(r)}return t.set(e,s),s}function Gh(e){let{element:t,boundary:n,rootBoundary:s,strategy:i}=e;const r=[...n==="clippingAncestors"?tn(t)?[]:Hh(t,this._c):[].concat(n),s],a=r[0],l=r.reduce((u,c)=>{const d=Sa(t,c,i);return u.top=ae(d.top,u.top),u.right=Rt(d.right,u.right),u.bottom=Rt(d.bottom,u.bottom),u.left=ae(d.left,u.left),u},Sa(t,a,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function qh(e){const{width:t,height:n}=xa(e);return{width:t,height:n}}function Zh(e,t,n){const s=ye(t),i=ge(t),o=n==="fixed",r=We(e,!0,o,t);let a={scrollLeft:0,scrollTop:0};const l=ve(0);function u(){l.x=cn(i)}if(s||!s&&!o)if((st(t)!=="body"||At(i))&&(a=nn(t)),s){const m=We(t,!0,o,t);l.x=m.x+t.clientLeft,l.y=m.y+t.clientTop}else i&&u();o&&!s&&i&&u();const c=i&&!s&&!o?wa(i,a):ve(0),d=r.left+a.scrollLeft-l.x-c.x,h=r.top+a.scrollTop-l.y-c.y;return{x:d,y:h,width:r.width,height:r.height}}function Ks(e){return ue(e).position==="static"}function Pa(e,t){if(!ye(e)||ue(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return ge(e)===n&&(n=n.ownerDocument.body),n}function Ea(e,t){const n=ne(e);if(tn(e))return n;if(!ye(e)){let i=je(e);for(;i&&!it(i);){if(H(i)&&!Ks(i))return i;i=je(i)}return n}let s=Pa(e,t);for(;s&&Gf(s)&&Ks(s);)s=Pa(s,t);return s&&it(s)&&Ks(s)&&!Os(s)?n:s||eh(e)||n}const Jh=async function(e){const t=this.getOffsetParent||Ea,n=this.getDimensions,s=await n(e.floating);return{reference:Zh(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:s.width,height:s.height}}};function Qh(e){return ue(e).direction==="rtl"}const em={convertOffsetParentRelativeRectToViewportRelativeRect:Wh,getDocumentElement:ge,getClippingRect:Gh,getOffsetParent:Ea,getElementRects:Jh,getClientRects:Uh,getDimensions:qh,getScale:rt,isElement:H,isRTL:Qh};function ka(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function tm(e,t){let n=null,s;const i=ge(e);function o(){var a;clearTimeout(s),(a=n)==null||a.disconnect(),n=null}function r(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),o();const u=e.getBoundingClientRect(),{left:c,top:d,width:h,height:m}=u;if(a||t(),!h||!m)return;const p=rn(d),y=rn(i.clientWidth-(c+h)),x=rn(i.clientHeight-(d+m)),v=rn(c),g={rootMargin:-p+"px "+-y+"px "+-x+"px "+-v+"px",threshold:ae(0,Rt(1,l))||1};let E=!0;function C(P){const k=P[0].intersectionRatio;if(k!==l){if(!E)return r();k?r(!1,k):s=setTimeout(()=>{r(!1,1e-7)},1e3)}k===1&&!ka(u,e.getBoundingClientRect())&&r(),E=!1}try{n=new IntersectionObserver(C,{...g,root:i.ownerDocument})}catch{n=new IntersectionObserver(C,g)}n.observe(e)}return r(!0),o}function nm(e,t,n,s){s===void 0&&(s={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:r=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=s,u=zs(e),c=i||o?[...u?jt(u):[],...jt(t)]:[];c.forEach(v=>{i&&v.addEventListener("scroll",n,{passive:!0}),o&&v.addEventListener("resize",n)});const d=u&&a?tm(u,n):null;let h=-1,m=null;r&&(m=new ResizeObserver(v=>{let[b]=v;b&&b.target===u&&m&&(m.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var g;(g=m)==null||g.observe(t)})),n()}),u&&!l&&m.observe(u),m.observe(t));let p,y=l?We(e):null;l&&x();function x(){const v=We(e);y&&!ka(y,v)&&n(),y=v,p=requestAnimationFrame(x)}return n(),()=>{var v;c.forEach(b=>{i&&b.removeEventListener("scroll",n),o&&b.removeEventListener("resize",n)}),d?.(),(v=m)==null||v.disconnect(),m=null,l&&cancelAnimationFrame(p)}}const sm=Bh,im=(e,t,n)=>{const s=new Map,i={platform:em,...n},o={...i.platform,_c:s};return Lh(e,t,{...i,platform:o})};var rm=typeof document<"u",om=function(){},un=rm?T.useLayoutEffect:om;function dn(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,s,i;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(s=n;s--!==0;)if(!dn(e[s],t[s]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(s=n;s--!==0;)if(!{}.hasOwnProperty.call(t,i[s]))return!1;for(s=n;s--!==0;){const o=i[s];if(!(o==="_owner"&&e.$$typeof)&&!dn(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function Aa(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function ja(e,t){const n=Aa(e);return Math.round(t*n)/n}function Xs(e){const t=S.useRef(e);return un(()=>{t.current=e}),t}function am(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:s=[],platform:i,elements:{reference:o,floating:r}={},transform:a=!0,whileElementsMounted:l,open:u}=e,[c,d]=S.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,m]=S.useState(s);dn(h,s)||m(s);const[p,y]=S.useState(null),[x,v]=S.useState(null),b=S.useCallback(N=>{N!==P.current&&(P.current=N,y(N))},[]),g=S.useCallback(N=>{N!==k.current&&(k.current=N,v(N))},[]),E=o||p,C=r||x,P=S.useRef(null),k=S.useRef(null),A=S.useRef(c),V=l!=null,I=Xs(l),U=Xs(i),se=Xs(u),O=S.useCallback(()=>{if(!P.current||!k.current)return;const N={placement:t,strategy:n,middleware:h};U.current&&(N.platform=U.current),im(P.current,k.current,N).then(J=>{const w={...J,isPositioned:se.current!==!1};K.current&&!dn(A.current,w)&&(A.current=w,si.flushSync(()=>{d(w)}))})},[h,t,n,U,se]);un(()=>{u===!1&&A.current.isPositioned&&(A.current.isPositioned=!1,d(N=>({...N,isPositioned:!1})))},[u]);const K=S.useRef(!1);un(()=>(K.current=!0,()=>{K.current=!1}),[]),un(()=>{if(E&&(P.current=E),C&&(k.current=C),E&&C){if(I.current)return I.current(E,C,O);O()}},[E,C,O,I,V]);const xe=S.useMemo(()=>({reference:P,floating:k,setReference:b,setFloating:g}),[b,g]),de=S.useMemo(()=>({reference:E,floating:C}),[E,C]),_=S.useMemo(()=>{const N={position:n,left:0,top:0};if(!de.floating)return N;const J=ja(de.floating,c.x),w=ja(de.floating,c.y);return a?{...N,transform:"translate("+J+"px, "+w+"px)",...Aa(de.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:J,top:w}},[n,a,de.floating,c.x,c.y]);return S.useMemo(()=>({...c,update:O,refs:xe,elements:de,floatingStyles:_}),[c,O,xe,de,_])}const lm=(e,t)=>({...sm(e),options:[e,t]}),cm={...S};let Ra=!1,um=0;const Da=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+um++;function dm(){const[e,t]=S.useState(()=>Ra?Da():void 0);return Re(()=>{e==null&&t(Da())},[]),S.useEffect(()=>{Ra=!0},[]),e}const Ma=cm.useId||dm;let Ys;process.env.NODE_ENV!=="production"&&(Ys=new Set);function fm(){for(var e,t=arguments.length,n=new Array(t),s=0;s<t;s++)n[s]=arguments[s];const i="Floating UI: "+n.join(" ");if(!((e=Ys)!=null&&e.has(i))){var o;(o=Ys)==null||o.add(i),console.error(i)}}function hm(){const e=new Map;return{emit(t,n){var s;(s=e.get(t))==null||s.forEach(i=>i(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){var s;(s=e.get(t))==null||s.delete(n)}}}const mm=S.createContext(null),pm=S.createContext(null),gm=()=>{var e;return((e=S.useContext(mm))==null?void 0:e.id)||null},ym=()=>S.useContext(pm);function Na(e){return"data-floating-ui-"+e}const Va={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0},Ia=S.forwardRef(function(t,n){const[s,i]=S.useState();Re(()=>{kh()&&i("button")},[]);const o={ref:n,tabIndex:0,role:s,"aria-hidden":s?void 0:!0,[Na("focus-guard")]:"",style:Va};return f.jsx("span",{...t,...o})}),Oa=S.createContext(null),La=Na("portal");function vm(e){e===void 0&&(e={});const{id:t,root:n}=e,s=Ma(),i=xm(),[o,r]=S.useState(null),a=S.useRef(null);return Re(()=>()=>{o?.remove(),queueMicrotask(()=>{a.current=null})},[o]),Re(()=>{if(!s||a.current)return;const l=t?document.getElementById(t):null;if(!l)return;const u=document.createElement("div");u.id=s,u.setAttribute(La,""),l.appendChild(u),a.current=u,r(u)},[t,s]),Re(()=>{if(n===null||!s||a.current)return;let l=n||i?.portalNode;l&&!Vs(l)&&(l=l.current),l=l||document.body;let u=null;t&&(u=document.createElement("div"),u.id=t,l.appendChild(u));const c=document.createElement("div");c.id=s,c.setAttribute(La,""),l=u||l,l.appendChild(c),a.current=c,r(c)},[t,n,s,i]),o}function Hs(e){const{children:t,id:n,root:s,preserveTabOrder:i=!0}=e,o=vm({id:n,root:s}),[r,a]=S.useState(null),l=S.useRef(null),u=S.useRef(null),c=S.useRef(null),d=S.useRef(null),h=r?.modal,m=r?.open,p=!!r&&!r.modal&&r.open&&i&&!!(s||o);return S.useEffect(()=>{if(!o||!i||h)return;function y(x){o&&Us(x)&&(x.type==="focusin"?ya:Oh)(o)}return o.addEventListener("focusin",y,!0),o.addEventListener("focusout",y,!0),()=>{o.removeEventListener("focusin",y,!0),o.removeEventListener("focusout",y,!0)}},[o,i,h]),S.useEffect(()=>{o&&(m||ya(o))},[m,o]),f.jsxs(Oa.Provider,{value:S.useMemo(()=>({preserveTabOrder:i,beforeOutsideRef:l,afterOutsideRef:u,beforeInsideRef:c,afterInsideRef:d,portalNode:o,setFocusManagerState:a}),[i,o]),children:[p&&o&&f.jsx(Ia,{"data-type":"outside",ref:l,onFocus:y=>{if(Us(y,o)){var x;(x=c.current)==null||x.focus()}else{const v=r?r.domReference:null,b=Ih(v);b?.focus()}}}),p&&o&&f.jsx("span",{"aria-owns":o.id,style:Va}),o&&si.createPortal(t,o),p&&o&&f.jsx(Ia,{"data-type":"outside",ref:u,onFocus:y=>{if(Us(y,o)){var x;(x=d.current)==null||x.focus()}else{const v=r?r.domReference:null,b=Vh(v);b?.focus(),r?.closeOnFocusOut&&r?.onOpenChange(!1,y.nativeEvent,"focus-out")}}})]})}const xm=()=>S.useContext(Oa);let fn=0;const Fa="--floating-ui-scrollbar-width";function bm(){const e=Eh(),t=/iP(hone|ad|od)|iOS/.test(e)||e==="MacIntel"&&navigator.maxTouchPoints>1,n=document.body.style,i=Math.round(document.documentElement.getBoundingClientRect().left)+document.documentElement.scrollLeft?"paddingLeft":"paddingRight",o=window.innerWidth-document.documentElement.clientWidth,r=n.left?parseFloat(n.left):window.scrollX,a=n.top?parseFloat(n.top):window.scrollY;if(n.overflow="hidden",n.setProperty(Fa,o+"px"),o&&(n[i]=o+"px"),t){var l,u;const c=((l=window.visualViewport)==null?void 0:l.offsetLeft)||0,d=((u=window.visualViewport)==null?void 0:u.offsetTop)||0;Object.assign(n,{position:"fixed",top:-(a-Math.floor(d))+"px",left:-(r-Math.floor(c))+"px",right:"0"})}return()=>{Object.assign(n,{overflow:"",[i]:""}),n.removeProperty(Fa),t&&(Object.assign(n,{position:"",top:"",left:"",right:""}),window.scrollTo(r,a))}}let Ba=()=>{};const Gs=S.forwardRef(function(t,n){const{lockScroll:s=!1,...i}=t;return Re(()=>{if(s)return fn++,fn===1&&(Ba=bm()),()=>{fn--,fn===0&&Ba()}},[s]),f.jsx("div",{ref:n,...i,style:{position:"fixed",overflow:"auto",top:0,right:0,bottom:0,left:0,...i.style}})});function wm(e){const{open:t=!1,onOpenChange:n,elements:s}=e,i=Ma(),o=S.useRef({}),[r]=S.useState(()=>hm()),a=gm()!=null;if(process.env.NODE_ENV!=="production"){const m=s.reference;m&&!H(m)&&fm("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.")}const[l,u]=S.useState(s.reference),c=Nh((m,p,y)=>{o.current.openEvent=m?p:void 0,r.emit("openchange",{open:m,event:p,reason:y,nested:a}),n?.(m,p,y)}),d=S.useMemo(()=>({setPositionReference:u}),[]),h=S.useMemo(()=>({reference:l||s.reference||null,floating:s.floating||null,domReference:s.reference}),[l,s.reference,s.floating]);return S.useMemo(()=>({dataRef:o,open:t,onOpenChange:c,elements:h,events:r,floatingId:i,refs:d}),[t,c,h,r,i,d])}function Tm(e){e===void 0&&(e={});const{nodeId:t}=e,n=wm({...e,elements:{reference:null,floating:null,...e.elements}}),s=e.rootContext||n,i=s.elements,[o,r]=S.useState(null),[a,l]=S.useState(null),c=i?.domReference||o,d=S.useRef(null),h=ym();Re(()=>{c&&(d.current=c)},[c]);const m=am({...e,elements:{...i,...a&&{reference:a}}}),p=S.useCallback(g=>{const E=H(g)?{getBoundingClientRect:()=>g.getBoundingClientRect(),getClientRects:()=>g.getClientRects(),contextElement:g}:g;l(E),m.refs.setReference(E)},[m.refs]),y=S.useCallback(g=>{(H(g)||g===null)&&(d.current=g,r(g)),(H(m.refs.reference.current)||m.refs.reference.current===null||g!==null&&!H(g))&&m.refs.setReference(g)},[m.refs]),x=S.useMemo(()=>({...m.refs,setReference:y,setPositionReference:p,domReference:d}),[m.refs,y,p]),v=S.useMemo(()=>({...m.elements,domReference:c}),[m.elements,c]),b=S.useMemo(()=>({...m,...s,refs:x,elements:v,nodeId:t}),[m,x,v,t,s]);return Re(()=>{s.dataRef.current.floatingContext=b;const g=h?.nodesRef.current.find(E=>E.id===t);g&&(g.context=b)}),S.useMemo(()=>({...m,context:b,refs:x,elements:v}),[m,x,v,b])}const Sm={top:"bottom center","top-start":"bottom left","top-end":"bottom right",right:"left center","right-start":"top left","right-end":"bottom left",bottom:"top center","bottom-start":"top left","bottom-end":"top right",left:"right center","left-start":"top right","left-end":"bottom right"},_a=S.memo(({open:e,children:t,className:n,onOutsideClick:s,floatingStyles:i,setFloating:o,placement:r})=>f.jsx(Hs,{children:f.jsx(Ut,{children:e&&f.jsxs(f.Fragment,{children:[s&&f.jsx(Gs,{onClick:s}),f.jsx("div",{ref:o,style:i,className:"z-50",children:f.jsx(Fe.div,{className:n,style:{transformOrigin:Sm[r]},initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.95},transition:{duration:.1,ease:"easeInOut"},children:t})})]})})})),ot=e=>{const{placement:t="bottom",onOutsideClick:n,fullWidth:s,minWidth:i,maxWidth:o}=e,r=S.useMemo(()=>[lm({apply({rects:d,elements:h}){s&&(h.floating.style.width=`${d.reference.width}px`),i&&(h.floating.style.minWidth=`${i}px`),o&&(h.floating.style.maxWidth=`${o}px`)}})],[s,o,i]),{refs:a,floatingStyles:l}=Tm({placement:t,middleware:r,whileElementsMounted:nm}),u=S.useRef({onOutsideClick:n,floatingStyles:l,setFloating:a.setFloating,placement:t});u.current={onOutsideClick:n,floatingStyles:l,setFloating:a.setFloating,placement:t};const c=S.useMemo(()=>{const d=h=>{const{floatingStyles:m,setFloating:p,onOutsideClick:y,placement:x}=u.current,{className:v,open:b,children:g}=h;return f.jsx(_a,{open:b,className:v,onOutsideClick:y,floatingStyles:m,setFloating:p,placement:x,children:g})};return S.memo(d)},[]);return{anchorRef:a.setReference,Popover:c}},Cm="flex flex-col dropdown-panel border mt-1 rounded-xl shadow-lg overflow-y-auto relative space-y-1",Pm={sm:"p-2",md:"p-3",lg:"p-4"},at=e=>{const{className:t,children:n,padding:s="md",...i}=e;return f.jsx("div",{className:M(Cm,Pm[s],t),...i,children:n})},Mt=(e,t)=>{T.useEffect(()=>{if(!e)return;const n=s=>{s.key==="Escape"&&t()};return document.addEventListener("keydown",n),()=>{document.removeEventListener("keydown",n)}},[e,t])},$a=e=>{const{className:t,label:n,description:s,options:i,onChange:o,value:r,placeholder:a,maxHeight:l=300,error:u}=e,[c,d]=T.useState(!1),h=S.useRef(null),m=i?.find(x=>x.value===r);Mt(c,()=>d(!1)),T.useEffect(()=>{c&&h.current?.focus({preventScroll:!0})},[c]);const{anchorRef:p,Popover:y}=ot({placement:"bottom",fullWidth:!0,onOutsideClick:()=>d(!1)});return f.jsxs("div",{className:M("flex flex-col",t),children:[f.jsx(Be,{children:n}),f.jsxs("div",{className:"relative flex w-full flex-col",ref:p,children:[f.jsxs("div",{ref:h,role:"button",tabIndex:0,className:M("flex flex-row items-center h-12 pl-4 pr-10 border select-trigger transition-all duration-150 rounded-xl shadow-sm ring-0 focus:ring-4 focus:outline-none select-none",u&&"select-trigger-error !pr-10",c&&"ring-4"),onKeyDown:x=>x.key===" "&&d(v=>!v),onClick:()=>d(!c),children:[m&&f.jsx("span",{children:m.label}),!m&&a&&f.jsx("span",{className:"select-placeholder",children:a})]}),f.jsxs($e,{children:[u&&f.jsx(_e,{}),!!r&&f.jsx(Ce,{Icon:nt,onClick:()=>o(null)}),f.jsx(Ce,{Icon:Qt})]}),f.jsx(y,{open:c,children:f.jsx(at,{className:"!p-0",style:{maxHeight:l},children:f.jsx("div",{className:"flex flex-col p-2 gap-1",children:i.map(x=>{const v=x.value===r;return f.jsx(kt,{onClick:()=>{!x.disabled&&o&&(o(x.value),d(!1))},selected:v,disabled:x.disabled,children:x.label},String(x.value))})})})})]}),f.jsx(me,{children:s}),f.jsx(pe,{children:u})]})},Em=e=>{const{className:t,label:n,description:s,options:i,onChange:o,onSearch:r,value:a,placeholder:l,maxHeight:u=300,error:c}=e,[d,h]=T.useState(!1),[m,p]=T.useState(i),[y,x]=T.useState(""),v=S.useRef(null),b=S.useRef(null),g=i?.find(P=>P.value===a);Mt(d,()=>h(!1)),T.useEffect(()=>{p(r(y))},[y,i,r]),T.useEffect(()=>{d&&setTimeout(()=>b.current?.focus(),100)},[d]);const{anchorRef:E,Popover:C}=ot({placement:"bottom",fullWidth:!0,onOutsideClick:()=>h(!1)});return f.jsxs("div",{className:M("flex flex-col",t),children:[f.jsx(Be,{children:n}),f.jsxs("div",{className:"relative flex w-full flex-col",ref:E,children:[f.jsxs("div",{ref:v,role:"button",tabIndex:0,className:M("flex flex-row items-center h-12 pl-4 pr-10 border select-trigger transition-all duration-150 rounded-xl shadow-sm ring-0 focus:ring-4 focus:outline-none select-none",c&&"select-trigger-error !pr-10",d&&"ring-4"),onKeyDown:P=>P.key===" "&&h(k=>!k),onClick:()=>h(!d),children:[g&&f.jsx("span",{children:g.label}),!g&&l&&f.jsx("span",{className:"select-placeholder",children:l})]}),f.jsxs($e,{children:[c&&f.jsx(_e,{}),!!a&&f.jsx(Ce,{Icon:nt,onClick:()=>o(null)}),f.jsx(Ce,{Icon:Qt})]}),f.jsx(C,{open:d,children:f.jsxs(at,{className:"gap-0 !p-0",style:{maxHeight:u},children:[f.jsxs("div",{className:"sticky top-0 border-b select-search-bar py-1 backdrop-blur-sm",children:[f.jsx("input",{ref:b,type:"text",placeholder:"Search",value:y,className:"appearance-none border-none w-full bg-transparent rounded- pl-10 transition-all duration-150 focus:outline-none ring-0 placeholder:text-[var(--color-input-placeholder)]",onChange:P=>x(P.target.value)}),f.jsx(Ms,{className:"absolute select-search-icon left-4 top-4 h-4 w-4"})]}),f.jsxs("div",{className:"flex flex-col gap-1 p-2",children:[y!==""&&f.jsxs(f.Fragment,{children:[m.length===0&&f.jsx("div",{className:"flex flex-col items-center justify-center py-6",children:f.jsx(sa,{className:"h-6 w-6 text-[var(--color-input-text)]"})}),m.map(P=>{const k=P.value===a;return f.jsx(kt,{onClick:()=>{!P.disabled&&o&&(o(P.value),h(!1))},selected:k,disabled:P.disabled,children:P.label},String(P.value))})]}),y===""&&f.jsx(f.Fragment,{children:i.map(P=>{const k=P.value===a;return f.jsx(kt,{onClick:()=>{!P.disabled&&o&&(o(P.value),h(!1))},selected:k,disabled:P.disabled,children:P.label},String(P.value))})})]})]})})]}),f.jsx(me,{children:s}),f.jsx(pe,{children:c})]})},km=(e,t)=>{const[n,s]=T.useState(e);return T.useEffect(()=>{const i=setTimeout(()=>{s(e)},t);return()=>{clearTimeout(i)}},[e,t]),n},Am=e=>{const{className:t,label:n,description:s,onChange:i,fetchOptionsByQuery:o,fetchOptionByValue:r,onSearchDebounceMs:a=300,value:l,placeholder:u,maxHeight:c=300,error:d}=e,[h,m]=T.useState(!1),p=S.useRef(null),[y,x]=T.useState(""),[v,b]=T.useState([]),[g,E]=T.useState(null),C=S.useRef(null),[P,k]=T.useState(!1),[A,V]=T.useState(!1);Mt(h,()=>m(!1));const I=km(y,a);T.useEffect(()=>{(async()=>{k(!0);const K=await o(I);b(K),k(!1)})()},[I,o]),T.useEffect(()=>{if(l==null){E(null);return}const O=v?.find(K=>K.value===l);O?E(O):(async()=>{V(!0);const xe=await r(l);E(xe),V(!1)})()},[r,v,l]),T.useEffect(()=>{h&&setTimeout(()=>C.current?.focus(),100)},[h]);const{anchorRef:U,Popover:se}=ot({placement:"bottom",fullWidth:!0,onOutsideClick:()=>m(!1)});return f.jsxs("div",{className:M("flex flex-col",t),children:[f.jsx(Be,{children:n}),f.jsxs("div",{className:"relative flex w-full flex-col",ref:U,children:[f.jsxs("div",{ref:p,role:"button",tabIndex:0,className:M("flex flex-row items-center h-12 pl-4 pr-10 border select-trigger transition-all duration-150 rounded-xl shadow-sm ring-0 focus:ring-4 focus:outline-none select-none",d&&"select-trigger-error !pr-10",h&&"ring-4"),onKeyDown:O=>O.key===" "&&m(K=>!K),onClick:()=>m(!h),children:[!A&&g&&f.jsx("span",{children:g.label}),!A&&!g&&u&&f.jsx("span",{className:"select-placeholder",children:u}),A&&f.jsx(Jt,{className:"h-4 w-4 text-[var(--color-input-text)]"})]}),f.jsxs($e,{children:[d&&f.jsx(_e,{}),!!l&&f.jsx(Ce,{Icon:nt,onClick:()=>i(null)}),f.jsx(Ce,{Icon:Qt})]}),f.jsx(se,{open:h,children:f.jsxs(at,{className:"gap-0 !p-0",style:{maxHeight:c},children:[f.jsxs("div",{className:"sticky top-0 border-b select-search-bar py-1 backdrop-blur-sm",children:[f.jsx("input",{ref:C,type:"text",placeholder:"Search",value:y,className:"appearance-none border-none w-full bg-transparent rounded- pl-10 transition-all duration-150 focus:outline-none ring-0 placeholder:text-[var(--color-input-placeholder)]",onChange:O=>x(O.target.value)}),f.jsx(Ms,{className:"absolute select-search-icon left-4 top-4 h-4 w-4"})]}),f.jsxs("div",{className:"flex flex-col gap-1 p-2",children:[!P&&v.length===0&&f.jsx("div",{className:"flex flex-col items-center justify-center py-6",children:f.jsx(sa,{className:"h-6 w-6 text-[var(--color-input-text)]"})}),P&&f.jsx("div",{className:"flex flex-col items-center justify-center py-6",children:f.jsx(Jt,{className:"h-6 w-6 text-[var(--color-input-text)]"})}),!P&&f.jsx(f.Fragment,{children:v.map(O=>{const K=O.value===l;return f.jsx(kt,{onClick:()=>{!O.disabled&&i&&(i(O.value),m(!1))},selected:K,disabled:O.disabled,children:O.label},String(O.value))})})]})]})})]}),f.jsx(me,{children:s}),f.jsx(pe,{children:d})]})},jm=S.forwardRef((e,t)=>{const{className:n,children:s,...i}=e;return f.jsx("div",{ref:t,className:M("flex flex-col gap-6 border panel-base rounded-2xl shadow-sm px-6 py-6",n),...i,children:s})}),Rm=e=>{const{className:t,vertical:n=!1,...s}=e;return f.jsx("div",{className:M(n?"w-px h-full bg-[var(--color-divider)]":"w-full h-px bg-[var(--color-divider)]",t),...s})},Dm=e=>{const{children:t,content:n,className:s,placement:i="top",minWidth:o=100,maxWidth:r=200}=e,[a,l]=T.useState(!1),{anchorRef:u,Popover:c}=ot({placement:i,minWidth:o,maxWidth:r});return f.jsxs("span",{ref:u,className:s,onMouseEnter:()=>l(!0),onMouseLeave:()=>l(!1),children:[t,f.jsx(c,{open:a,children:f.jsx(at,{children:n})})]})},Mm=e=>{const{open:t,onDismiss:n,enableDismissOnOutsideClick:s,enableDismissOnEscKey:i,enableDismissButton:o,className:r,children:a,maxWidth:l=600}=e;return Mt(!!i&&t,n||(()=>{})),f.jsx(Ut,{children:t&&f.jsxs(Hs,{children:[f.jsx(Fe.div,{style:{transformOrigin:"center"},initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.15,ease:"easeInOut"},children:f.jsx(Gs,{className:"modal-overlay backdrop-blur-[1px] z-10",onClick:s?n:void 0,lockScroll:!0})}),f.jsx("div",{className:"fixed inset-0 flex flex-col items-center pointer-events-none p-4 lg:p-12 overflow-y-auto z-20",children:f.jsxs(Fe.div,{className:M("flex flex-col modal-content rounded-2xl shadow-xl p-6 lg:p-12 pointer-events-auto w-full relative",r),style:{transformOrigin:"bottom",maxWidth:l},initial:{opacity:0,scale:.98,translateY:10},animate:{opacity:1,scale:1,translateY:0},exit:{opacity:0,scale:.98,translateY:10},transition:{duration:.15,ease:"easeInOut"},children:[o&&f.jsx(Ds,{Icon:nt,className:"absolute top-4 right-4",variant:"transparent",size:"sm",onClick:n}),a]})})]})})},Nm=e=>{const{open:t,onDismiss:n,enableDismissOnOutsideClick:s,enableDismissOnEscKey:i,enableDismissButton:o,className:r,children:a,maxWidth:l=480}=e;return Mt(!!i&&t,n||(()=>{})),f.jsx(Ut,{children:t&&f.jsxs(Hs,{children:[f.jsx(Fe.div,{style:{transformOrigin:"center"},initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.15,ease:"easeInOut"},children:f.jsx(Gs,{className:"modal-overlay backdrop-blur-[1px] z-10",onClick:s?n:void 0,lockScroll:!0})}),f.jsx("div",{className:"fixed inset-0 flex flex-row justify-end pointer-events-none z-20",children:f.jsxs(Fe.div,{className:M("flex flex-col modal-content shadow-xl p-6 lg:p-12 pointer-events-auto h-full w-full overflow-y-auto relative",r),style:{maxWidth:l},initial:{translateX:"100%"},animate:{translateX:0},exit:{translateX:"100%"},transition:{duration:.25,ease:[.32,.72,0,1]},children:[o&&f.jsx(Ds,{Icon:nt,className:"absolute top-4 right-4",variant:"transparent",size:"sm",onClick:n}),a]})})]})})},Wa={red:"bg-red-100 text-red-700 ring-red-200 dark:bg-red-950 dark:text-red-300 dark:ring-red-800",orange:"bg-orange-100 text-orange-700 ring-orange-200 dark:bg-orange-950 dark:text-orange-300 dark:ring-orange-800",amber:"bg-amber-100 text-amber-700 ring-amber-200 dark:bg-amber-950 dark:text-amber-300 dark:ring-amber-800",yellow:"bg-yellow-100 text-yellow-700 ring-yellow-200 dark:bg-yellow-950 dark:text-yellow-300 dark:ring-yellow-800",lime:"bg-lime-100 text-lime-700 ring-lime-200 dark:bg-lime-950 dark:text-lime-300 dark:ring-lime-800",green:"bg-green-100 text-green-700 ring-green-200 dark:bg-green-950 dark:text-green-300 dark:ring-green-800",emerald:"bg-emerald-100 text-emerald-700 ring-emerald-200 dark:bg-emerald-950 dark:text-emerald-300 dark:ring-emerald-800",teal:"bg-teal-100 text-teal-700 ring-teal-200 dark:bg-teal-950 dark:text-teal-300 dark:ring-teal-800",cyan:"bg-cyan-100 text-cyan-700 ring-cyan-200 dark:bg-cyan-950 dark:text-cyan-300 dark:ring-cyan-800",sky:"bg-sky-100 text-sky-700 ring-sky-200 dark:bg-sky-950 dark:text-sky-300 dark:ring-sky-800",blue:"bg-blue-100 text-blue-700 ring-blue-200 dark:bg-blue-950 dark:text-blue-300 dark:ring-blue-800",indigo:"bg-indigo-100 text-indigo-700 ring-indigo-200 dark:bg-indigo-950 dark:text-indigo-300 dark:ring-indigo-800",violet:"bg-violet-100 text-violet-700 ring-violet-200 dark:bg-violet-950 dark:text-violet-300 dark:ring-violet-800",purple:"bg-purple-100 text-purple-700 ring-purple-200 dark:bg-purple-950 dark:text-purple-300 dark:ring-purple-800",fuchsia:"bg-fuchsia-100 text-fuchsia-700 ring-fuchsia-200 dark:bg-fuchsia-950 dark:text-fuchsia-300 dark:ring-fuchsia-800",pink:"bg-pink-100 text-pink-700 ring-pink-200 dark:bg-pink-950 dark:text-pink-300 dark:ring-pink-800",rose:"bg-rose-100 text-rose-700 ring-rose-200 dark:bg-rose-950 dark:text-rose-300 dark:ring-rose-800",slate:"bg-slate-100 text-slate-700 ring-slate-200 dark:bg-slate-950 dark:text-slate-300 dark:ring-slate-800",gray:"bg-gray-100 text-gray-700 ring-gray-200 dark:bg-gray-950 dark:text-gray-300 dark:ring-gray-800",zinc:"bg-zinc-100 text-zinc-700 ring-zinc-200 dark:bg-zinc-950 dark:text-zinc-300 dark:ring-zinc-800",neutral:"bg-neutral-100 text-neutral-700 ring-neutral-200 dark:bg-neutral-950 dark:text-neutral-300 dark:ring-neutral-800",stone:"bg-stone-100 text-stone-700 ring-stone-200 dark:bg-stone-950 dark:text-stone-300 dark:ring-stone-800",white:"bg-[var(--color-badge-white-bg)] text-[var(--color-badge-white-text)] ring-[var(--color-badge-white-ring)]",black:"bg-[var(--color-badge-black-bg)] text-[var(--color-badge-black-text)] ring-[var(--color-badge-black-ring)]"},qs=S.forwardRef((e,t)=>{const{className:n,children:s,onClick:i,showCloseIcon:o,Icon:r,color:a="gray"}=e,l=M("inline-flex align-top items-center gap-2 px-3 h-7 rounded-lg font-semibold",Wa[a],n);return i?f.jsx("div",{ref:t,children:f.jsxs("button",{className:M("cursor-pointer ring-0 hover:ring-4 active:ring-1 transition-all duration-100 select-none focus:outline-none focus:ring-4",l),onClick:i,children:[r&&f.jsx(r,{className:"h-4 w-4 shrink-0"}),f.jsx("div",{className:"break-all line-clamp-1 text-left",children:s}),o&&f.jsx(nt,{className:"h-4 w-4 shrink-0"})]})}):f.jsxs("div",{className:l,ref:t,children:[r&&f.jsx(r,{className:"h-4 w-4 shrink-0"}),f.jsx("div",{className:"break-all line-clamp-1 text-left",children:s})]})}),Ua=e=>{const{className:t,tabs:n}=e;return f.jsx("div",{className:M("h-12 tab-container p-1 rounded-xl inline-flex flex-row space-x-1 overflow-x-auto",t),children:n.map((s,i)=>{const o=M("shrink-0 px-4 h-full inline-flex flex-row items-center font-semibold rounded-xl cursor-pointer border border-transparent ing-0 tab-button transition-all duration-150 select-none focus:outline-none focus:ring-0",s.active&&"tab-button-active shadow-sm");return s.href?f.jsxs("a",{href:s.href,className:o,children:[s.Icon&&f.jsx(s.Icon,{className:"h-5 w-5 shrink-0 mr-2 -ml-1"}),s.label]},i):f.jsxs("button",{className:o,onClick:s.onClick,children:[s.Icon&&f.jsx(s.Icon,{className:"h-5 w-5 shrink-0 mr-2 -ml-1"}),s.label]},i)})})},za=T.createContext(void 0),Vm=()=>({dismiss:T.useContext(za)||(()=>{})}),Im="inline-flex flex-row items-center gap-3 h-10 px-3 font-semibold ring-0 dropdown-item rounded-lg cursor-pointer transition-all duration-150 select-none focus:outline-none focus:ring-0 border border-transparent bg-transparent",ee=S.forwardRef((e,t)=>{const{className:n,children:s,Icon:i,onClick:o,dismissOnClick:r=!0,...a}=e,{dismiss:l}=Vm(),u=c=>{o&&o(c),r&&l()};return f.jsxs("button",{ref:t,className:M(Im,n),onClick:u,...a,children:[i&&f.jsx(i,{className:"h-5 w-5"}),s]})}),Zs=e=>{const{label:t,children:n,className:s}=e;return f.jsxs("div",{className:M("flex flex-col dropdown-button-group",s),children:[t&&f.jsx("div",{className:"mb-2 text-sm dropdown-group-label font-semibold px-3",children:t}),n]})},Js=e=>{const{trigger:t,children:n,placement:s="bottom-end",minWidth:i=200,className:o}=e,[r,a]=T.useState(!1),{Popover:l,anchorRef:u}=ot({placement:s,onOutsideClick:()=>a(!1),minWidth:i});return f.jsxs(f.Fragment,{children:[f.jsx("div",{ref:u,className:o,onClick:()=>a(!r),children:t}),f.jsx(l,{open:r,children:f.jsx(at,{padding:"sm",children:f.jsx(za.Provider,{value:()=>a(!1),children:n})})})]})};function Om(e){const{onDelta:t,onDragStart:n,onDragEnd:s,disabled:i=!1,primaryButtonOnly:o=!0,preventScrollOnMove:r=!0}=e,[a,l]=S.useState(!1),u=S.useRef(0),c=S.useRef(0),d=S.useRef(0),h=S.useRef(null),m=S.useRef(null),p=S.useCallback(g=>{if(!a)return;const E={clientX:g??c.current,startX:u.current,totalDeltaX:d.current,target:h.current};l(!1),window.removeEventListener("pointermove",x,{capture:!0}),window.removeEventListener("pointerup",v,{capture:!0}),window.removeEventListener("pointercancel",v,{capture:!0}),window.removeEventListener("keydown",y,!0),m.current!=null&&(cancelAnimationFrame(m.current),m.current=null),s?.(E),h.current=null,d.current=0},[a,s]),y=S.useCallback(g=>{g.key==="Escape"&&(g.preventDefault(),p())},[p]),x=S.useCallback(g=>{if(!a)return;const E=()=>{const C=g.clientX,P=C-c.current;if(P!==0){c.current=C,d.current+=P;const k={clientX:C,startX:u.current,totalDeltaX:d.current,target:h.current};r&&g.preventDefault(),t(P,k)}m.current=null};m.current==null&&(m.current=requestAnimationFrame(E))},[a,t,r]),v=S.useCallback(g=>{p(g.clientX)},[p]),b=S.useCallback(g=>{if(i||o&&g.button!==0)return;g.target.setPointerCapture?.(g.pointerId),u.current=g.clientX,c.current=g.clientX,d.current=0,h.current=g.target,l(!0);const E={clientX:g.clientX,startX:g.clientX,totalDeltaX:0,target:g.target};n?.(E),window.addEventListener("pointermove",x,{passive:!r,capture:!0}),window.addEventListener("pointerup",v,{capture:!0}),window.addEventListener("pointercancel",v,{capture:!0}),window.addEventListener("keydown",y,!0)},[i,n,y,x,v,o,r]);return S.useEffect(()=>()=>{a&&p()},[a]),{isDragging:a,bind:{onPointerDown:b,role:"separator",style:{touchAction:"none",cursor:"col-resize",userSelect:"none"}}}}const Lm=e=>{const{column:t}=e,n=t?.defaultWidth??250,{bind:s}=Om({onDelta:i=>console.log(i),onDragStart:()=>{},onDragEnd:()=>{}});return f.jsxs("div",{style:{width:n,height:44},className:"flex flex-row items-stretch select-none",children:[f.jsx("div",{className:"flex-1 content-center px-4 relative cursor-pointer table-header-cell transition-colors duration-100",children:t.header}),f.jsx("div",{...s,className:"cursor-ew-resize group py-4 table-resize-handle w-[8px]",children:f.jsx("div",{className:"w-0.5 h-full mx-auto table-resize-divider table-resize-divider-hover pointer-events-none"})})]})},Fm=e=>{const{columns:t,rows:n,className:s}=e,i=S.useRef(null),o=r=>{i.current&&i.current.scrollTo({left:r.currentTarget.scrollLeft})};return f.jsxs("div",{className:s,children:[f.jsx("div",{className:"relative h-[45px] w-full overflow-hidden",ref:i,children:f.jsx("div",{className:"absolute",children:f.jsx("div",{className:"font-medium flex flex-row table-header",children:t.map(r=>f.jsx(Lm,{column:r},r.id))})})}),f.jsx("div",{className:"relative overflow-scroll min-w-full min-h-full",onScroll:o,children:f.jsx("div",{className:"absolute",children:f.jsx("div",{className:"flex flex-col",children:n.map(r=>f.jsx("div",{className:"flex flex-row table-row transition-all duration-100",children:t.map(a=>f.jsx("div",{className:"flex-1 content-center px-4",style:{height:44,width:250},children:a.renderCell(r)},a.id))},JSON.stringify(r)))})})})]})},Bm=()=>f.jsx("div",{}),_m=[{id:1,email:"sarah.jennings@example.com",firstname:"Sarah",lastname:"Jennings",status:"active"},{id:2,email:"liam.patel@outlook.com",firstname:"Liam",lastname:"Patel",status:"inactive"},{id:3,email:"emily.wong@gmail.com",firstname:"Emily",lastname:"Wong",status:"active"},{id:4,email:"noah.thompson@yahoo.com",firstname:"Noah",lastname:"Thompson",status:"active"},{id:5,email:"isabella.martin@protonmail.com",firstname:"Isabella",lastname:"Martin",status:"active"},{id:6,email:"ethan.ross@company.io",firstname:"Ethan",lastname:"Ross",status:"inactive"},{id:7,email:"olivia.nguyen@example.org",firstname:"Olivia",lastname:"Nguyen",status:"active"},{id:8,email:"lucas.henderson@gmail.com",firstname:"Lucas",lastname:"Henderson",status:"inactive"},{id:9,email:"mia.johnson@workmail.com",firstname:"Mia",lastname:"Johnson",status:"active"},{id:10,email:"jackson.rivera@outlook.com",firstname:"Jackson",lastname:"Rivera",status:"active"},{id:11,email:"ava.sanders@example.com",firstname:"Ava",lastname:"Sanders",status:"active"},{id:12,email:"logan.bennett@company.io",firstname:"Logan",lastname:"Bennett",status:"inactive"}],$m=[{id:"id",header:"ID",renderCell:e=>e.id},{id:"email",header:"Email",renderCell:e=>f.jsx(qs,{Icon:_f,onClick:()=>{},children:e.email})},{id:"firstname",header:"First Name",renderCell:e=>e.firstname},{id:"lastname",header:"Last Name",renderCell:e=>e.lastname},{id:"status",header:"Status",renderCell:()=>f.jsx(Um,{})}],Wm=()=>f.jsxs("div",{className:"flex flex-col gap-6",children:[f.jsxs("div",{className:"flex flex-row items-center justify-start gap-3",children:[f.jsx(Ns,{Icon:Ms,placeholder:"Search..."}),f.jsx(Rs,{Icon:ia}),f.jsx(ea,{Icon:na,children:"New"}),f.jsxs(Js,{trigger:f.jsx(Rs,{Icon:ia}),children:[f.jsx(ee,{dismissOnClick:!1,Icon:na,children:"Add new"}),f.jsx(ee,{Icon:Ff,children:"Remove"}),f.jsxs(Zs,{label:"Test",className:"mt-2",children:[f.jsx(ee,{children:"Item 1"}),f.jsx(ee,{children:"Item 2"}),f.jsx(ee,{children:"Item 3"}),f.jsx(ee,{children:"Item 4"})]}),f.jsxs(Zs,{label:"Test",className:"mt-2",children:[f.jsx(ee,{children:"Item 1"}),f.jsx(ee,{children:"Item 2"}),f.jsx(ee,{children:"Item 3"}),f.jsx(ee,{children:"Item 4"})]})]}),f.jsx(Ua,{tabs:[{label:"Tab 1",Icon:ta,active:!0,onClick:()=>{}},{label:"Tab 2",active:!1,onClick:()=>{}},{label:"Tab 3",Icon:ta,active:!1,onClick:()=>{}}]})]}),f.jsx($a,{options:[{label:"Option 1",value:1},{label:"Option 2",value:2},{label:"Option 3",value:3}],value:null,onChange:()=>{}}),f.jsx(Fm,{className:"h-[300px] w-[300px]",columns:$m,rows:_m}),f.jsx(Bm,{})]}),Um=()=>f.jsx(f.Fragment,{children:f.jsxs(Js,{placement:"bottom-end",className:"inline-block",trigger:f.jsx(qs,{onClick:()=>{},children:"Test"}),children:[f.jsx(ee,{children:"Option 1"}),f.jsx(ee,{children:"Option 2"}),f.jsx(ee,{children:"Option 3"})]})});R.Badge=qs,R.BadgeColor=Wa,R.Button=ea,R.ButtonIconRound=Ds,R.ButtonIconSquare=Rs,R.Divider=Rm,R.DropdownButton=ee,R.DropdownButtonGroup=Zs,R.DropdownMenu=Js,R.DropdownPanel=at,R.Input=Ns,R.InputCheck=Kf,R.InputDescription=me,R.InputError=pe,R.InputErrorIcon=_e,R.InputIconButton=Ce,R.InputIconButtonTray=$e,R.InputLabel=Be,R.InputPassword=$f,R.InputRadio=Uf,R.InputSelect=$a,R.InputSelectNative=Xf,R.InputSelectOption=kt,R.InputSelectSearchable=Em,R.InputSelectSearchableAsync=Am,R.InputTextArea=Wf,R.InputToggle=zf,R.Modal=Mm,R.Panel=jm,R.PopoverBase=_a,R.SidebarModal=Nm,R.Spinner=Jt,R.TabButtons=Ua,R.Test=Wm,R.Tooltip=Dm,R.usePopover=ot,Object.defineProperty(R,Symbol.toStringTag,{value:"Module"})}));
|
|
140
|
+
*/var lh=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"],$s=lh.join(","),la=typeof Element>"u",Dt=la?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,an=!la&&Element.prototype.getRootNode?function(e){var t;return e==null||(t=e.getRootNode)===null||t===void 0?void 0:t.call(e)}:function(e){return e?.ownerDocument},ln=function e(t,n){var s;n===void 0&&(n=!0);var i=t==null||(s=t.getAttribute)===null||s===void 0?void 0:s.call(t,"inert"),o=i===""||i==="true",r=o||n&&t&&e(t.parentNode);return r},ch=function(t){var n,s=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return s===""||s==="true"},uh=function(t,n,s){if(ln(t))return[];var i=Array.prototype.slice.apply(t.querySelectorAll($s));return n&&Dt.call(t,$s)&&i.unshift(t),i=i.filter(s),i},dh=function e(t,n,s){for(var i=[],o=Array.from(t);o.length;){var r=o.shift();if(!ln(r,!1))if(r.tagName==="SLOT"){var a=r.assignedElements(),l=a.length?a:r.children,u=e(l,!0,s);s.flatten?i.push.apply(i,u):i.push({scopeParent:r,candidates:u})}else{var c=Dt.call(r,$s);c&&s.filter(r)&&(n||!t.includes(r))&&i.push(r);var d=r.shadowRoot||typeof s.getShadowRoot=="function"&&s.getShadowRoot(r),h=!ln(d,!1)&&(!s.shadowRootFilter||s.shadowRootFilter(r));if(d&&h){var m=e(d===!0?r.children:d.children,!0,s);s.flatten?i.push.apply(i,m):i.push({scopeParent:r,candidates:m})}else o.unshift.apply(o,r.children)}}return i},ca=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},ua=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||ch(t))&&!ca(t)?0:t.tabIndex},fh=function(t,n){var s=ua(t);return s<0&&n&&!ca(t)?0:s},hh=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},da=function(t){return t.tagName==="INPUT"},mh=function(t){return da(t)&&t.type==="hidden"},ph=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(s){return s.tagName==="SUMMARY"});return n},gh=function(t,n){for(var s=0;s<t.length;s++)if(t[s].checked&&t[s].form===n)return t[s]},yh=function(t){if(!t.name)return!0;var n=t.form||an(t),s=function(a){return n.querySelectorAll('input[type="radio"][name="'+a+'"]')},i;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")i=s(window.CSS.escape(t.name));else try{i=s(t.name)}catch(r){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",r.message),!1}var o=gh(i,t.form);return!o||o===t},vh=function(t){return da(t)&&t.type==="radio"},xh=function(t){return vh(t)&&!yh(t)},bh=function(t){var n,s=t&&an(t),i=(n=s)===null||n===void 0?void 0:n.host,o=!1;if(s&&s!==t){var r,a,l;for(o=!!((r=i)!==null&&r!==void 0&&(a=r.ownerDocument)!==null&&a!==void 0&&a.contains(i)||t!=null&&(l=t.ownerDocument)!==null&&l!==void 0&&l.contains(t));!o&&i;){var u,c,d;s=an(i),i=(u=s)===null||u===void 0?void 0:u.host,o=!!((c=i)!==null&&c!==void 0&&(d=c.ownerDocument)!==null&&d!==void 0&&d.contains(i))}}return o},fa=function(t){var n=t.getBoundingClientRect(),s=n.width,i=n.height;return s===0&&i===0},wh=function(t,n){var s=n.displayCheck,i=n.getShadowRoot;if(getComputedStyle(t).visibility==="hidden")return!0;var o=Dt.call(t,"details>summary:first-of-type"),r=o?t.parentElement:t;if(Dt.call(r,"details:not([open]) *"))return!0;if(!s||s==="full"||s==="legacy-full"){if(typeof i=="function"){for(var a=t;t;){var l=t.parentElement,u=an(t);if(l&&!l.shadowRoot&&i(l)===!0)return fa(t);t.assignedSlot?t=t.assignedSlot:!l&&u!==t.ownerDocument?t=u.host:t=l}t=a}if(bh(t))return!t.getClientRects().length;if(s!=="legacy-full")return!0}else if(s==="non-zero-area")return fa(t);return!1},Th=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var n=t.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var s=0;s<n.children.length;s++){var i=n.children.item(s);if(i.tagName==="LEGEND")return Dt.call(n,"fieldset[disabled] *")?!0:!i.contains(t)}return!0}n=n.parentElement}return!1},Sh=function(t,n){return!(n.disabled||ln(n)||mh(n)||wh(n,t)||ph(n)||Th(n))},ha=function(t,n){return!(xh(n)||ua(n)<0||!Sh(t,n))},Ch=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},Ph=function e(t){var n=[],s=[];return t.forEach(function(i,o){var r=!!i.scopeParent,a=r?i.scopeParent:i,l=fh(a,r),u=r?e(i.candidates):a;l===0?r?n.push.apply(n,u):n.push(a):s.push({documentOrder:o,tabIndex:l,item:i,isScope:r,content:u})}),s.sort(hh).reduce(function(i,o){return o.isScope?i.push.apply(i,o.content):i.push(o.content),i},[]).concat(n)},ma=function(t,n){n=n||{};var s;return n.getShadowRoot?s=dh([t],n.includeContainer,{filter:ha.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:Ch}):s=uh(t,n.includeContainer,ha.bind(null,n)),Ph(s)};function Eh(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function kh(){return/apple/i.test(navigator.vendor)}function Ah(e){let t=e.activeElement;for(;((n=t)==null||(n=n.shadowRoot)==null?void 0:n.activeElement)!=null;){var n;t=t.shadowRoot.activeElement}return t}function jh(e,t){if(!e||!t)return!1;const n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&Is(n)){let s=t;for(;s;){if(e===s)return!0;s=s.parentNode||s.host}}return!1}function Ws(e){return e?.ownerDocument||document}var Rh=typeof document<"u",Dh=function(){},Re=Rh?T.useLayoutEffect:Dh;const Mh={...S}.useInsertionEffect||(e=>e());function Nh(e){const t=S.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return Mh(()=>{t.current=e}),S.useCallback(function(){for(var n=arguments.length,s=new Array(n),i=0;i<n;i++)s[i]=arguments[i];return t.current==null?void 0:t.current(...s)},[])}const pa=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function ga(e,t){const n=ma(e,pa()),s=n.length;if(s===0)return;const i=Ah(Ws(e)),o=n.indexOf(i),r=o===-1?t===1?0:s-1:o+t;return n[r]}function Vh(e){return ga(Ws(e).body,1)||e}function Ih(e){return ga(Ws(e).body,-1)||e}function Us(e,t){const n=t||e.currentTarget,s=e.relatedTarget;return!s||!jh(n,s)}function Oh(e){ma(e,pa()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function ya(e){e.querySelectorAll("[data-tabindex]").forEach(n=>{const s=n.dataset.tabindex;delete n.dataset.tabindex,s?n.setAttribute("tabindex",s):n.removeAttribute("tabindex")})}function va(e,t,n){let{reference:s,floating:i}=e;const o=_s(t),r=rh(t),a=sh(r),l=Bs(t),u=o==="y",c=s.x+s.width/2-i.width/2,d=s.y+s.height/2-i.height/2,h=s[a]/2-i[a]/2;let m;switch(l){case"top":m={x:c,y:s.y-i.height};break;case"bottom":m={x:c,y:s.y+s.height};break;case"right":m={x:s.x+s.width,y:d};break;case"left":m={x:s.x-i.width,y:d};break;default:m={x:s.x,y:s.y}}switch(aa(t)){case"start":m[r]-=h*(n&&u?-1:1);break;case"end":m[r]+=h*(n&&u?-1:1);break}return m}const Lh=async(e,t,n)=>{const{placement:s="bottom",strategy:i="absolute",middleware:o=[],platform:r}=n,a=o.filter(Boolean),l=await(r.isRTL==null?void 0:r.isRTL(t));let u=await r.getElementRects({reference:e,floating:t,strategy:i}),{x:c,y:d}=va(u,s,l),h=s,m={},p=0;for(let y=0;y<a.length;y++){const{name:x,fn:v}=a[y],{x:b,y:g,data:E,reset:C}=await v({x:c,y:d,initialPlacement:s,placement:h,strategy:i,middlewareData:m,rects:u,platform:r,elements:{reference:e,floating:t}});c=b??c,d=g??d,m={...m,[x]:{...m[x],...E}},C&&p<=50&&(p++,typeof C=="object"&&(C.placement&&(h=C.placement),C.rects&&(u=C.rects===!0?await r.getElementRects({reference:e,floating:t,strategy:i}):C.rects),{x:c,y:d}=va(u,h,l)),y=-1)}return{x:c,y:d,placement:h,strategy:i,middlewareData:m}};async function Fh(e,t){var n;t===void 0&&(t={});const{x:s,y:i,platform:o,rects:r,elements:a,strategy:l}=e,{boundary:u="clippingAncestors",rootBoundary:c="viewport",elementContext:d="floating",altBoundary:h=!1,padding:m=0}=oa(t,e),p=ah(m),x=a[h?d==="floating"?"reference":"floating":d],v=on(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(x)))==null||n?x:x.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(a.floating)),boundary:u,rootBoundary:c,strategy:l})),b=d==="floating"?{x:s,y:i,width:r.floating.width,height:r.floating.height}:r.reference,g=await(o.getOffsetParent==null?void 0:o.getOffsetParent(a.floating)),E=await(o.isElement==null?void 0:o.isElement(g))?await(o.getScale==null?void 0:o.getScale(g))||{x:1,y:1}:{x:1,y:1},C=on(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:b,offsetParent:g,strategy:l}):b);return{top:(v.top-C.top+p.top)/E.y,bottom:(C.bottom-v.bottom+p.bottom)/E.y,left:(v.left-C.left+p.left)/E.x,right:(C.right-v.right+p.right)/E.x}}const Bh=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,s;const{placement:i,rects:o,platform:r,elements:a}=t,{apply:l=()=>{},...u}=oa(e,t),c=await Fh(t,u),d=Bs(i),h=aa(i),m=_s(i)==="y",{width:p,height:y}=o.floating;let x,v;d==="top"||d==="bottom"?(x=d,v=h===(await(r.isRTL==null?void 0:r.isRTL(a.floating))?"start":"end")?"left":"right"):(v=d,x=h==="end"?"top":"bottom");const b=y-c.top-c.bottom,g=p-c.left-c.right,E=Rt(y-c[x],b),C=Rt(p-c[v],g),P=!t.middlewareData.shift;let k=E,A=C;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(A=g),(s=t.middlewareData.shift)!=null&&s.enabled.y&&(k=b),P&&!h){const I=ae(c.left,0),U=ae(c.right,0),se=ae(c.top,0),O=ae(c.bottom,0);m?A=p-2*(I!==0||U!==0?I+U:ae(c.left,c.right)):k=y-2*(se!==0||O!==0?se+O:ae(c.top,c.bottom))}await l({...t,availableWidth:A,availableHeight:k});const V=await r.getDimensions(a.floating);return p!==V.width||y!==V.height?{reset:{rects:!0}}:{}}}};function xa(e){const t=ue(e);let n=parseFloat(t.width)||0,s=parseFloat(t.height)||0;const i=ye(e),o=i?e.offsetWidth:n,r=i?e.offsetHeight:s,a=sn(n)!==o||sn(s)!==r;return a&&(n=o,s=r),{width:n,height:s,$:a}}function zs(e){return H(e)?e:e.contextElement}function rt(e){const t=zs(e);if(!ye(t))return ve(1);const n=t.getBoundingClientRect(),{width:s,height:i,$:o}=xa(t);let r=(o?sn(n.width):n.width)/s,a=(o?sn(n.height):n.height)/i;return(!r||!Number.isFinite(r))&&(r=1),(!a||!Number.isFinite(a))&&(a=1),{x:r,y:a}}const _h=ve(0);function ba(e){const t=ne(e);return!Ls()||!t.visualViewport?_h:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function $h(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==ne(e)?!1:t}function We(e,t,n,s){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),o=zs(e);let r=ve(1);t&&(s?H(s)&&(r=rt(s)):r=rt(e));const a=$h(o,n,s)?ba(o):ve(0);let l=(i.left+a.x)/r.x,u=(i.top+a.y)/r.y,c=i.width/r.x,d=i.height/r.y;if(o){const h=ne(o),m=s&&H(s)?ne(s):s;let p=h,y=Fs(p);for(;y&&s&&m!==p;){const x=rt(y),v=y.getBoundingClientRect(),b=ue(y),g=v.left+(y.clientLeft+parseFloat(b.paddingLeft))*x.x,E=v.top+(y.clientTop+parseFloat(b.paddingTop))*x.y;l*=x.x,u*=x.y,c*=x.x,d*=x.y,l+=g,u+=E,p=ne(y),y=Fs(p)}}return on({width:c,height:d,x:l,y:u})}function cn(e,t){const n=nn(e).scrollLeft;return t?t.left+n:We(ge(e)).left+n}function wa(e,t){const n=e.getBoundingClientRect(),s=n.left+t.scrollLeft-cn(e,n),i=n.top+t.scrollTop;return{x:s,y:i}}function Wh(e){let{elements:t,rect:n,offsetParent:s,strategy:i}=e;const o=i==="fixed",r=ge(s),a=t?tn(t.floating):!1;if(s===r||a&&o)return n;let l={scrollLeft:0,scrollTop:0},u=ve(1);const c=ve(0),d=ye(s);if((d||!d&&!o)&&((st(s)!=="body"||At(r))&&(l=nn(s)),ye(s))){const m=We(s);u=rt(s),c.x=m.x+s.clientLeft,c.y=m.y+s.clientTop}const h=r&&!d&&!o?wa(r,l):ve(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-l.scrollLeft*u.x+c.x+h.x,y:n.y*u.y-l.scrollTop*u.y+c.y+h.y}}function Uh(e){return Array.from(e.getClientRects())}function zh(e){const t=ge(e),n=nn(e),s=e.ownerDocument.body,i=ae(t.scrollWidth,t.clientWidth,s.scrollWidth,s.clientWidth),o=ae(t.scrollHeight,t.clientHeight,s.scrollHeight,s.clientHeight);let r=-n.scrollLeft+cn(e);const a=-n.scrollTop;return ue(s).direction==="rtl"&&(r+=ae(t.clientWidth,s.clientWidth)-i),{width:i,height:o,x:r,y:a}}const Ta=25;function Kh(e,t){const n=ne(e),s=ge(e),i=n.visualViewport;let o=s.clientWidth,r=s.clientHeight,a=0,l=0;if(i){o=i.width,r=i.height;const c=Ls();(!c||c&&t==="fixed")&&(a=i.offsetLeft,l=i.offsetTop)}const u=cn(s);if(u<=0){const c=s.ownerDocument,d=c.body,h=getComputedStyle(d),m=c.compatMode==="CSS1Compat"&&parseFloat(h.marginLeft)+parseFloat(h.marginRight)||0,p=Math.abs(s.clientWidth-d.clientWidth-m);p<=Ta&&(o-=p)}else u<=Ta&&(o+=u);return{width:o,height:r,x:a,y:l}}const Xh=new Set(["absolute","fixed"]);function Yh(e,t){const n=We(e,!0,t==="fixed"),s=n.top+e.clientTop,i=n.left+e.clientLeft,o=ye(e)?rt(e):ve(1),r=e.clientWidth*o.x,a=e.clientHeight*o.y,l=i*o.x,u=s*o.y;return{width:r,height:a,x:l,y:u}}function Sa(e,t,n){let s;if(t==="viewport")s=Kh(e,n);else if(t==="document")s=zh(ge(e));else if(H(t))s=Yh(t,n);else{const i=ba(e);s={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return on(s)}function Ca(e,t){const n=je(e);return n===t||!H(n)||it(n)?!1:ue(n).position==="fixed"||Ca(n,t)}function Hh(e,t){const n=t.get(e);if(n)return n;let s=jt(e,[],!1).filter(a=>H(a)&&st(a)!=="body"),i=null;const o=ue(e).position==="fixed";let r=o?je(e):e;for(;H(r)&&!it(r);){const a=ue(r),l=Os(r);!l&&a.position==="fixed"&&(i=null),(o?!l&&!i:!l&&a.position==="static"&&!!i&&Xh.has(i.position)||At(r)&&!l&&Ca(e,r))?s=s.filter(c=>c!==r):i=a,r=je(r)}return t.set(e,s),s}function Gh(e){let{element:t,boundary:n,rootBoundary:s,strategy:i}=e;const r=[...n==="clippingAncestors"?tn(t)?[]:Hh(t,this._c):[].concat(n),s],a=r[0],l=r.reduce((u,c)=>{const d=Sa(t,c,i);return u.top=ae(d.top,u.top),u.right=Rt(d.right,u.right),u.bottom=Rt(d.bottom,u.bottom),u.left=ae(d.left,u.left),u},Sa(t,a,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function qh(e){const{width:t,height:n}=xa(e);return{width:t,height:n}}function Zh(e,t,n){const s=ye(t),i=ge(t),o=n==="fixed",r=We(e,!0,o,t);let a={scrollLeft:0,scrollTop:0};const l=ve(0);function u(){l.x=cn(i)}if(s||!s&&!o)if((st(t)!=="body"||At(i))&&(a=nn(t)),s){const m=We(t,!0,o,t);l.x=m.x+t.clientLeft,l.y=m.y+t.clientTop}else i&&u();o&&!s&&i&&u();const c=i&&!s&&!o?wa(i,a):ve(0),d=r.left+a.scrollLeft-l.x-c.x,h=r.top+a.scrollTop-l.y-c.y;return{x:d,y:h,width:r.width,height:r.height}}function Ks(e){return ue(e).position==="static"}function Pa(e,t){if(!ye(e)||ue(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return ge(e)===n&&(n=n.ownerDocument.body),n}function Ea(e,t){const n=ne(e);if(tn(e))return n;if(!ye(e)){let i=je(e);for(;i&&!it(i);){if(H(i)&&!Ks(i))return i;i=je(i)}return n}let s=Pa(e,t);for(;s&&Gf(s)&&Ks(s);)s=Pa(s,t);return s&&it(s)&&Ks(s)&&!Os(s)?n:s||eh(e)||n}const Jh=async function(e){const t=this.getOffsetParent||Ea,n=this.getDimensions,s=await n(e.floating);return{reference:Zh(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:s.width,height:s.height}}};function Qh(e){return ue(e).direction==="rtl"}const em={convertOffsetParentRelativeRectToViewportRelativeRect:Wh,getDocumentElement:ge,getClippingRect:Gh,getOffsetParent:Ea,getElementRects:Jh,getClientRects:Uh,getDimensions:qh,getScale:rt,isElement:H,isRTL:Qh};function ka(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function tm(e,t){let n=null,s;const i=ge(e);function o(){var a;clearTimeout(s),(a=n)==null||a.disconnect(),n=null}function r(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),o();const u=e.getBoundingClientRect(),{left:c,top:d,width:h,height:m}=u;if(a||t(),!h||!m)return;const p=rn(d),y=rn(i.clientWidth-(c+h)),x=rn(i.clientHeight-(d+m)),v=rn(c),g={rootMargin:-p+"px "+-y+"px "+-x+"px "+-v+"px",threshold:ae(0,Rt(1,l))||1};let E=!0;function C(P){const k=P[0].intersectionRatio;if(k!==l){if(!E)return r();k?r(!1,k):s=setTimeout(()=>{r(!1,1e-7)},1e3)}k===1&&!ka(u,e.getBoundingClientRect())&&r(),E=!1}try{n=new IntersectionObserver(C,{...g,root:i.ownerDocument})}catch{n=new IntersectionObserver(C,g)}n.observe(e)}return r(!0),o}function nm(e,t,n,s){s===void 0&&(s={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:r=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=s,u=zs(e),c=i||o?[...u?jt(u):[],...jt(t)]:[];c.forEach(v=>{i&&v.addEventListener("scroll",n,{passive:!0}),o&&v.addEventListener("resize",n)});const d=u&&a?tm(u,n):null;let h=-1,m=null;r&&(m=new ResizeObserver(v=>{let[b]=v;b&&b.target===u&&m&&(m.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var g;(g=m)==null||g.observe(t)})),n()}),u&&!l&&m.observe(u),m.observe(t));let p,y=l?We(e):null;l&&x();function x(){const v=We(e);y&&!ka(y,v)&&n(),y=v,p=requestAnimationFrame(x)}return n(),()=>{var v;c.forEach(b=>{i&&b.removeEventListener("scroll",n),o&&b.removeEventListener("resize",n)}),d?.(),(v=m)==null||v.disconnect(),m=null,l&&cancelAnimationFrame(p)}}const sm=Bh,im=(e,t,n)=>{const s=new Map,i={platform:em,...n},o={...i.platform,_c:s};return Lh(e,t,{...i,platform:o})};var rm=typeof document<"u",om=function(){},un=rm?T.useLayoutEffect:om;function dn(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,s,i;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(s=n;s--!==0;)if(!dn(e[s],t[s]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(s=n;s--!==0;)if(!{}.hasOwnProperty.call(t,i[s]))return!1;for(s=n;s--!==0;){const o=i[s];if(!(o==="_owner"&&e.$$typeof)&&!dn(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function Aa(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function ja(e,t){const n=Aa(e);return Math.round(t*n)/n}function Xs(e){const t=S.useRef(e);return un(()=>{t.current=e}),t}function am(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:s=[],platform:i,elements:{reference:o,floating:r}={},transform:a=!0,whileElementsMounted:l,open:u}=e,[c,d]=S.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,m]=S.useState(s);dn(h,s)||m(s);const[p,y]=S.useState(null),[x,v]=S.useState(null),b=S.useCallback(N=>{N!==P.current&&(P.current=N,y(N))},[]),g=S.useCallback(N=>{N!==k.current&&(k.current=N,v(N))},[]),E=o||p,C=r||x,P=S.useRef(null),k=S.useRef(null),A=S.useRef(c),V=l!=null,I=Xs(l),U=Xs(i),se=Xs(u),O=S.useCallback(()=>{if(!P.current||!k.current)return;const N={placement:t,strategy:n,middleware:h};U.current&&(N.platform=U.current),im(P.current,k.current,N).then(J=>{const w={...J,isPositioned:se.current!==!1};K.current&&!dn(A.current,w)&&(A.current=w,si.flushSync(()=>{d(w)}))})},[h,t,n,U,se]);un(()=>{u===!1&&A.current.isPositioned&&(A.current.isPositioned=!1,d(N=>({...N,isPositioned:!1})))},[u]);const K=S.useRef(!1);un(()=>(K.current=!0,()=>{K.current=!1}),[]),un(()=>{if(E&&(P.current=E),C&&(k.current=C),E&&C){if(I.current)return I.current(E,C,O);O()}},[E,C,O,I,V]);const xe=S.useMemo(()=>({reference:P,floating:k,setReference:b,setFloating:g}),[b,g]),de=S.useMemo(()=>({reference:E,floating:C}),[E,C]),_=S.useMemo(()=>{const N={position:n,left:0,top:0};if(!de.floating)return N;const J=ja(de.floating,c.x),w=ja(de.floating,c.y);return a?{...N,transform:"translate("+J+"px, "+w+"px)",...Aa(de.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:J,top:w}},[n,a,de.floating,c.x,c.y]);return S.useMemo(()=>({...c,update:O,refs:xe,elements:de,floatingStyles:_}),[c,O,xe,de,_])}const lm=(e,t)=>({...sm(e),options:[e,t]}),cm={...S};let Ra=!1,um=0;const Da=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+um++;function dm(){const[e,t]=S.useState(()=>Ra?Da():void 0);return Re(()=>{e==null&&t(Da())},[]),S.useEffect(()=>{Ra=!0},[]),e}const Ma=cm.useId||dm;let Ys;process.env.NODE_ENV!=="production"&&(Ys=new Set);function fm(){for(var e,t=arguments.length,n=new Array(t),s=0;s<t;s++)n[s]=arguments[s];const i="Floating UI: "+n.join(" ");if(!((e=Ys)!=null&&e.has(i))){var o;(o=Ys)==null||o.add(i),console.error(i)}}function hm(){const e=new Map;return{emit(t,n){var s;(s=e.get(t))==null||s.forEach(i=>i(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){var s;(s=e.get(t))==null||s.delete(n)}}}const mm=S.createContext(null),pm=S.createContext(null),gm=()=>{var e;return((e=S.useContext(mm))==null?void 0:e.id)||null},ym=()=>S.useContext(pm);function Na(e){return"data-floating-ui-"+e}const Va={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0},Ia=S.forwardRef(function(t,n){const[s,i]=S.useState();Re(()=>{kh()&&i("button")},[]);const o={ref:n,tabIndex:0,role:s,"aria-hidden":s?void 0:!0,[Na("focus-guard")]:"",style:Va};return f.jsx("span",{...t,...o})}),Oa=S.createContext(null),La=Na("portal");function vm(e){e===void 0&&(e={});const{id:t,root:n}=e,s=Ma(),i=xm(),[o,r]=S.useState(null),a=S.useRef(null);return Re(()=>()=>{o?.remove(),queueMicrotask(()=>{a.current=null})},[o]),Re(()=>{if(!s||a.current)return;const l=t?document.getElementById(t):null;if(!l)return;const u=document.createElement("div");u.id=s,u.setAttribute(La,""),l.appendChild(u),a.current=u,r(u)},[t,s]),Re(()=>{if(n===null||!s||a.current)return;let l=n||i?.portalNode;l&&!Vs(l)&&(l=l.current),l=l||document.body;let u=null;t&&(u=document.createElement("div"),u.id=t,l.appendChild(u));const c=document.createElement("div");c.id=s,c.setAttribute(La,""),l=u||l,l.appendChild(c),a.current=c,r(c)},[t,n,s,i]),o}function Hs(e){const{children:t,id:n,root:s,preserveTabOrder:i=!0}=e,o=vm({id:n,root:s}),[r,a]=S.useState(null),l=S.useRef(null),u=S.useRef(null),c=S.useRef(null),d=S.useRef(null),h=r?.modal,m=r?.open,p=!!r&&!r.modal&&r.open&&i&&!!(s||o);return S.useEffect(()=>{if(!o||!i||h)return;function y(x){o&&Us(x)&&(x.type==="focusin"?ya:Oh)(o)}return o.addEventListener("focusin",y,!0),o.addEventListener("focusout",y,!0),()=>{o.removeEventListener("focusin",y,!0),o.removeEventListener("focusout",y,!0)}},[o,i,h]),S.useEffect(()=>{o&&(m||ya(o))},[m,o]),f.jsxs(Oa.Provider,{value:S.useMemo(()=>({preserveTabOrder:i,beforeOutsideRef:l,afterOutsideRef:u,beforeInsideRef:c,afterInsideRef:d,portalNode:o,setFocusManagerState:a}),[i,o]),children:[p&&o&&f.jsx(Ia,{"data-type":"outside",ref:l,onFocus:y=>{if(Us(y,o)){var x;(x=c.current)==null||x.focus()}else{const v=r?r.domReference:null,b=Ih(v);b?.focus()}}}),p&&o&&f.jsx("span",{"aria-owns":o.id,style:Va}),o&&si.createPortal(t,o),p&&o&&f.jsx(Ia,{"data-type":"outside",ref:u,onFocus:y=>{if(Us(y,o)){var x;(x=d.current)==null||x.focus()}else{const v=r?r.domReference:null,b=Vh(v);b?.focus(),r?.closeOnFocusOut&&r?.onOpenChange(!1,y.nativeEvent,"focus-out")}}})]})}const xm=()=>S.useContext(Oa);let fn=0;const Fa="--floating-ui-scrollbar-width";function bm(){const e=Eh(),t=/iP(hone|ad|od)|iOS/.test(e)||e==="MacIntel"&&navigator.maxTouchPoints>1,n=document.body.style,i=Math.round(document.documentElement.getBoundingClientRect().left)+document.documentElement.scrollLeft?"paddingLeft":"paddingRight",o=window.innerWidth-document.documentElement.clientWidth,r=n.left?parseFloat(n.left):window.scrollX,a=n.top?parseFloat(n.top):window.scrollY;if(n.overflow="hidden",n.setProperty(Fa,o+"px"),o&&(n[i]=o+"px"),t){var l,u;const c=((l=window.visualViewport)==null?void 0:l.offsetLeft)||0,d=((u=window.visualViewport)==null?void 0:u.offsetTop)||0;Object.assign(n,{position:"fixed",top:-(a-Math.floor(d))+"px",left:-(r-Math.floor(c))+"px",right:"0"})}return()=>{Object.assign(n,{overflow:"",[i]:""}),n.removeProperty(Fa),t&&(Object.assign(n,{position:"",top:"",left:"",right:""}),window.scrollTo(r,a))}}let Ba=()=>{};const Gs=S.forwardRef(function(t,n){const{lockScroll:s=!1,...i}=t;return Re(()=>{if(s)return fn++,fn===1&&(Ba=bm()),()=>{fn--,fn===0&&Ba()}},[s]),f.jsx("div",{ref:n,...i,style:{position:"fixed",overflow:"auto",top:0,right:0,bottom:0,left:0,...i.style}})});function wm(e){const{open:t=!1,onOpenChange:n,elements:s}=e,i=Ma(),o=S.useRef({}),[r]=S.useState(()=>hm()),a=gm()!=null;if(process.env.NODE_ENV!=="production"){const m=s.reference;m&&!H(m)&&fm("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.")}const[l,u]=S.useState(s.reference),c=Nh((m,p,y)=>{o.current.openEvent=m?p:void 0,r.emit("openchange",{open:m,event:p,reason:y,nested:a}),n?.(m,p,y)}),d=S.useMemo(()=>({setPositionReference:u}),[]),h=S.useMemo(()=>({reference:l||s.reference||null,floating:s.floating||null,domReference:s.reference}),[l,s.reference,s.floating]);return S.useMemo(()=>({dataRef:o,open:t,onOpenChange:c,elements:h,events:r,floatingId:i,refs:d}),[t,c,h,r,i,d])}function Tm(e){e===void 0&&(e={});const{nodeId:t}=e,n=wm({...e,elements:{reference:null,floating:null,...e.elements}}),s=e.rootContext||n,i=s.elements,[o,r]=S.useState(null),[a,l]=S.useState(null),c=i?.domReference||o,d=S.useRef(null),h=ym();Re(()=>{c&&(d.current=c)},[c]);const m=am({...e,elements:{...i,...a&&{reference:a}}}),p=S.useCallback(g=>{const E=H(g)?{getBoundingClientRect:()=>g.getBoundingClientRect(),getClientRects:()=>g.getClientRects(),contextElement:g}:g;l(E),m.refs.setReference(E)},[m.refs]),y=S.useCallback(g=>{(H(g)||g===null)&&(d.current=g,r(g)),(H(m.refs.reference.current)||m.refs.reference.current===null||g!==null&&!H(g))&&m.refs.setReference(g)},[m.refs]),x=S.useMemo(()=>({...m.refs,setReference:y,setPositionReference:p,domReference:d}),[m.refs,y,p]),v=S.useMemo(()=>({...m.elements,domReference:c}),[m.elements,c]),b=S.useMemo(()=>({...m,...s,refs:x,elements:v,nodeId:t}),[m,x,v,t,s]);return Re(()=>{s.dataRef.current.floatingContext=b;const g=h?.nodesRef.current.find(E=>E.id===t);g&&(g.context=b)}),S.useMemo(()=>({...m,context:b,refs:x,elements:v}),[m,x,v,b])}const Sm={top:"bottom center","top-start":"bottom left","top-end":"bottom right",right:"left center","right-start":"top left","right-end":"bottom left",bottom:"top center","bottom-start":"top left","bottom-end":"top right",left:"right center","left-start":"top right","left-end":"bottom right"},_a=S.memo(({open:e,children:t,className:n,onOutsideClick:s,floatingStyles:i,setFloating:o,placement:r})=>f.jsx(Hs,{children:f.jsx(Ut,{children:e&&f.jsxs(f.Fragment,{children:[s&&f.jsx(Gs,{onClick:s}),f.jsx("div",{ref:o,style:i,className:"z-50",children:f.jsx(Fe.div,{className:n,style:{transformOrigin:Sm[r]},initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.95},transition:{duration:.1,ease:"easeInOut"},children:t})})]})})})),ot=e=>{const{placement:t="bottom",onOutsideClick:n,fullWidth:s,minWidth:i,maxWidth:o}=e,r=S.useMemo(()=>[lm({apply({rects:d,elements:h}){s&&(h.floating.style.width=`${d.reference.width}px`),i&&(h.floating.style.minWidth=`${i}px`),o&&(h.floating.style.maxWidth=`${o}px`)}})],[s,o,i]),{refs:a,floatingStyles:l}=Tm({placement:t,middleware:r,whileElementsMounted:nm}),u=S.useRef({onOutsideClick:n,floatingStyles:l,setFloating:a.setFloating,placement:t});u.current={onOutsideClick:n,floatingStyles:l,setFloating:a.setFloating,placement:t};const c=S.useMemo(()=>{const d=h=>{const{floatingStyles:m,setFloating:p,onOutsideClick:y,placement:x}=u.current,{className:v,open:b,children:g}=h;return f.jsx(_a,{open:b,className:v,onOutsideClick:y,floatingStyles:m,setFloating:p,placement:x,children:g})};return S.memo(d)},[]);return{anchorRef:a.setReference,Popover:c}},Cm="flex flex-col dropdown-panel border mt-1 rounded-xl shadow-lg overflow-y-auto relative space-y-1",Pm={sm:"p-2",md:"p-3",lg:"p-4"},at=e=>{const{className:t,children:n,padding:s="md",...i}=e;return f.jsx("div",{className:M(Cm,Pm[s],t),...i,children:n})},Mt=(e,t)=>{T.useEffect(()=>{if(!e)return;const n=s=>{s.key==="Escape"&&t()};return document.addEventListener("keydown",n),()=>{document.removeEventListener("keydown",n)}},[e,t])},$a=e=>{const{className:t,label:n,description:s,options:i,onChange:o,value:r,placeholder:a,maxHeight:l=300,error:u}=e,[c,d]=T.useState(!1),h=S.useRef(null),m=i?.find(x=>x.value===r);Mt(c,()=>d(!1)),T.useEffect(()=>{c&&h.current?.focus({preventScroll:!0})},[c]);const{anchorRef:p,Popover:y}=ot({placement:"bottom",fullWidth:!0,onOutsideClick:()=>d(!1)});return f.jsxs("div",{className:M("flex flex-col",t),children:[f.jsx(Be,{children:n}),f.jsxs("div",{className:"relative flex w-full flex-col",ref:p,children:[f.jsxs("div",{ref:h,role:"button",tabIndex:0,className:M("flex flex-row items-center h-12 pl-4 pr-10 border select-trigger transition-all duration-150 rounded-xl shadow-sm ring-0 focus:ring-4 focus:outline-none select-none",u&&"select-trigger-error !pr-10",c&&"ring-4"),onKeyDown:x=>x.key===" "&&d(v=>!v),onClick:()=>d(!c),children:[m&&f.jsx("span",{children:m.label}),!m&&a&&f.jsx("span",{className:"select-placeholder",children:a})]}),f.jsxs($e,{children:[u&&f.jsx(_e,{}),!!r&&f.jsx(Ce,{Icon:nt,onClick:()=>o(null)}),f.jsx(Ce,{Icon:Qt})]}),f.jsx(y,{open:c,children:f.jsx(at,{className:"!p-0",style:{maxHeight:l},children:f.jsx("div",{className:"flex flex-col p-2 gap-1",children:i.map(x=>{const v=x.value===r;return f.jsx(kt,{onClick:()=>{!x.disabled&&o&&(o(x.value),d(!1))},selected:v,disabled:x.disabled,children:x.label},String(x.value))})})})})]}),f.jsx(me,{children:s}),f.jsx(pe,{children:u})]})},Em=e=>{const{className:t,label:n,description:s,options:i,onChange:o,onSearch:r,value:a,placeholder:l,maxHeight:u=300,error:c}=e,[d,h]=T.useState(!1),[m,p]=T.useState(i),[y,x]=T.useState(""),v=S.useRef(null),b=S.useRef(null),g=i?.find(P=>P.value===a);Mt(d,()=>h(!1)),T.useEffect(()=>{p(r(y))},[y,i,r]),T.useEffect(()=>{d&&setTimeout(()=>b.current?.focus(),100)},[d]);const{anchorRef:E,Popover:C}=ot({placement:"bottom",fullWidth:!0,onOutsideClick:()=>h(!1)});return f.jsxs("div",{className:M("flex flex-col",t),children:[f.jsx(Be,{children:n}),f.jsxs("div",{className:"relative flex w-full flex-col",ref:E,children:[f.jsxs("div",{ref:v,role:"button",tabIndex:0,className:M("flex flex-row items-center h-12 pl-4 pr-10 border select-trigger transition-all duration-150 rounded-xl shadow-sm ring-0 focus:ring-4 focus:outline-none select-none",c&&"select-trigger-error !pr-10",d&&"ring-4"),onKeyDown:P=>P.key===" "&&h(k=>!k),onClick:()=>h(!d),children:[g&&f.jsx("span",{children:g.label}),!g&&l&&f.jsx("span",{className:"select-placeholder",children:l})]}),f.jsxs($e,{children:[c&&f.jsx(_e,{}),!!a&&f.jsx(Ce,{Icon:nt,onClick:()=>o(null)}),f.jsx(Ce,{Icon:Qt})]}),f.jsx(C,{open:d,children:f.jsxs(at,{className:"gap-0 !p-0",style:{maxHeight:u},children:[f.jsxs("div",{className:"sticky top-0 border-b select-search-bar py-1 backdrop-blur-sm",children:[f.jsx("input",{ref:b,type:"text",placeholder:"Search",value:y,className:"appearance-none border-none w-full bg-transparent rounded- pl-10 transition-all duration-150 focus:outline-none ring-0 placeholder:text-[var(--color-input-placeholder)]",onChange:P=>x(P.target.value)}),f.jsx(Ms,{className:"absolute select-search-icon left-4 top-4 h-4 w-4"})]}),f.jsxs("div",{className:"flex flex-col gap-1 p-2",children:[y!==""&&f.jsxs(f.Fragment,{children:[m.length===0&&f.jsx("div",{className:"flex flex-col items-center justify-center py-6",children:f.jsx(sa,{className:"h-6 w-6 text-[var(--color-input-text)]"})}),m.map(P=>{const k=P.value===a;return f.jsx(kt,{onClick:()=>{!P.disabled&&o&&(o(P.value),h(!1))},selected:k,disabled:P.disabled,children:P.label},String(P.value))})]}),y===""&&f.jsx(f.Fragment,{children:i.map(P=>{const k=P.value===a;return f.jsx(kt,{onClick:()=>{!P.disabled&&o&&(o(P.value),h(!1))},selected:k,disabled:P.disabled,children:P.label},String(P.value))})})]})]})})]}),f.jsx(me,{children:s}),f.jsx(pe,{children:c})]})},km=(e,t)=>{const[n,s]=T.useState(e);return T.useEffect(()=>{const i=setTimeout(()=>{s(e)},t);return()=>{clearTimeout(i)}},[e,t]),n},Am=e=>{const{className:t,label:n,description:s,onChange:i,fetchOptionsByQuery:o,fetchOptionByValue:r,onSearchDebounceMs:a=300,value:l,placeholder:u,maxHeight:c=300,error:d}=e,[h,m]=T.useState(!1),p=S.useRef(null),[y,x]=T.useState(""),[v,b]=T.useState([]),[g,E]=T.useState(null),C=S.useRef(null),[P,k]=T.useState(!1),[A,V]=T.useState(!1);Mt(h,()=>m(!1));const I=km(y,a);T.useEffect(()=>{(async()=>{k(!0);const K=await o(I);b(K),k(!1)})()},[I,o]),T.useEffect(()=>{if(l==null){E(null);return}const O=v?.find(K=>K.value===l);O?E(O):(async()=>{V(!0);const xe=await r(l);E(xe),V(!1)})()},[r,v,l]),T.useEffect(()=>{h&&setTimeout(()=>C.current?.focus(),100)},[h]);const{anchorRef:U,Popover:se}=ot({placement:"bottom",fullWidth:!0,onOutsideClick:()=>m(!1)});return f.jsxs("div",{className:M("flex flex-col",t),children:[f.jsx(Be,{children:n}),f.jsxs("div",{className:"relative flex w-full flex-col",ref:U,children:[f.jsxs("div",{ref:p,role:"button",tabIndex:0,className:M("flex flex-row items-center h-12 pl-4 pr-10 border select-trigger transition-all duration-150 rounded-xl shadow-sm ring-0 focus:ring-4 focus:outline-none select-none",d&&"select-trigger-error !pr-10",h&&"ring-4"),onKeyDown:O=>O.key===" "&&m(K=>!K),onClick:()=>m(!h),children:[!A&&g&&f.jsx("span",{children:g.label}),!A&&!g&&u&&f.jsx("span",{className:"select-placeholder",children:u}),A&&f.jsx(Jt,{className:"h-4 w-4 text-[var(--color-input-text)]"})]}),f.jsxs($e,{children:[d&&f.jsx(_e,{}),!!l&&f.jsx(Ce,{Icon:nt,onClick:()=>i(null)}),f.jsx(Ce,{Icon:Qt})]}),f.jsx(se,{open:h,children:f.jsxs(at,{className:"gap-0 !p-0",style:{maxHeight:c},children:[f.jsxs("div",{className:"sticky top-0 border-b select-search-bar py-1 backdrop-blur-sm",children:[f.jsx("input",{ref:C,type:"text",placeholder:"Search",value:y,className:"appearance-none border-none w-full bg-transparent rounded- pl-10 transition-all duration-150 focus:outline-none ring-0 placeholder:text-[var(--color-input-placeholder)]",onChange:O=>x(O.target.value)}),f.jsx(Ms,{className:"absolute select-search-icon left-4 top-4 h-4 w-4"})]}),f.jsxs("div",{className:"flex flex-col gap-1 p-2",children:[!P&&v.length===0&&f.jsx("div",{className:"flex flex-col items-center justify-center py-6",children:f.jsx(sa,{className:"h-6 w-6 text-[var(--color-input-text)]"})}),P&&f.jsx("div",{className:"flex flex-col items-center justify-center py-6",children:f.jsx(Jt,{className:"h-6 w-6 text-[var(--color-input-text)]"})}),!P&&f.jsx(f.Fragment,{children:v.map(O=>{const K=O.value===l;return f.jsx(kt,{onClick:()=>{!O.disabled&&i&&(i(O.value),m(!1))},selected:K,disabled:O.disabled,children:O.label},String(O.value))})})]})]})})]}),f.jsx(me,{children:s}),f.jsx(pe,{children:d})]})},jm=S.forwardRef((e,t)=>{const{className:n,children:s,...i}=e;return f.jsx("div",{ref:t,className:M("flex flex-col gap-6 border panel-base rounded-2xl shadow-sm px-6 py-6",n),...i,children:s})}),Rm=e=>{const{className:t,vertical:n=!1,...s}=e;return f.jsx("div",{className:M(n?"w-px h-full bg-[var(--color-divider)]":"w-full h-px bg-[var(--color-divider)]",t),...s})},Dm=e=>{const{children:t,content:n,className:s,placement:i="top",minWidth:o=100,maxWidth:r=200}=e,[a,l]=T.useState(!1),{anchorRef:u,Popover:c}=ot({placement:i,minWidth:o,maxWidth:r});return f.jsxs("span",{ref:u,className:s,onMouseEnter:()=>l(!0),onMouseLeave:()=>l(!1),children:[t,f.jsx(c,{open:a,children:f.jsx(at,{children:n})})]})},Mm=e=>{const{open:t,onDismiss:n,enableDismissOnOutsideClick:s,enableDismissOnEscKey:i,enableDismissButton:o,className:r,children:a,maxWidth:l=600}=e;return Mt(!!i&&t,n||(()=>{})),f.jsx(Ut,{children:t&&f.jsxs(Hs,{children:[f.jsx(Fe.div,{style:{transformOrigin:"center"},initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.15,ease:"easeInOut"},children:f.jsx(Gs,{className:"modal-overlay backdrop-blur-[1px] z-10",onClick:s?n:void 0,lockScroll:!0})}),f.jsx("div",{className:"fixed inset-0 flex flex-col items-center pointer-events-none p-4 lg:p-12 overflow-y-auto z-20",children:f.jsxs(Fe.div,{className:M("flex flex-col modal-content rounded-2xl shadow-xl p-6 lg:p-12 pointer-events-auto w-full relative",r),style:{transformOrigin:"bottom",maxWidth:l},initial:{opacity:0,scale:.98,translateY:10},animate:{opacity:1,scale:1,translateY:0},exit:{opacity:0,scale:.98,translateY:10},transition:{duration:.15,ease:"easeInOut"},children:[o&&f.jsx(Ds,{Icon:nt,className:"absolute top-4 right-4",variant:"transparent",size:"sm",onClick:n}),a]})})]})})},Nm=e=>{const{open:t,onDismiss:n,enableDismissOnOutsideClick:s,enableDismissOnEscKey:i,enableDismissButton:o,className:r,children:a,maxWidth:l=480}=e;return Mt(!!i&&t,n||(()=>{})),f.jsx(Ut,{children:t&&f.jsxs(Hs,{children:[f.jsx(Fe.div,{style:{transformOrigin:"center"},initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.15,ease:"easeInOut"},children:f.jsx(Gs,{className:"modal-overlay backdrop-blur-[1px] z-10",onClick:s?n:void 0,lockScroll:!0})}),f.jsx("div",{className:"fixed inset-0 flex flex-row justify-end pointer-events-none z-20",children:f.jsxs(Fe.div,{className:M("flex flex-col modal-content shadow-xl p-6 lg:p-12 pointer-events-auto h-full w-full overflow-y-auto relative",r),style:{maxWidth:l},initial:{translateX:"100%"},animate:{translateX:0},exit:{translateX:"100%"},transition:{duration:.25,ease:[.32,.72,0,1]},children:[o&&f.jsx(Ds,{Icon:nt,className:"absolute top-4 right-4",variant:"transparent",size:"sm",onClick:n}),a]})})]})})},Wa={red:"bg-red-100 text-red-700 ring-red-200 dark:bg-red-950 dark:text-red-300 dark:ring-red-800",orange:"bg-orange-100 text-orange-700 ring-orange-200 dark:bg-orange-950 dark:text-orange-300 dark:ring-orange-800",amber:"bg-amber-100 text-amber-700 ring-amber-200 dark:bg-amber-950 dark:text-amber-300 dark:ring-amber-800",yellow:"bg-yellow-100 text-yellow-700 ring-yellow-200 dark:bg-yellow-950 dark:text-yellow-300 dark:ring-yellow-800",lime:"bg-lime-100 text-lime-700 ring-lime-200 dark:bg-lime-950 dark:text-lime-300 dark:ring-lime-800",green:"bg-green-100 text-green-700 ring-green-200 dark:bg-green-950 dark:text-green-300 dark:ring-green-800",emerald:"bg-emerald-100 text-emerald-700 ring-emerald-200 dark:bg-emerald-950 dark:text-emerald-300 dark:ring-emerald-800",teal:"bg-teal-100 text-teal-700 ring-teal-200 dark:bg-teal-950 dark:text-teal-300 dark:ring-teal-800",cyan:"bg-cyan-100 text-cyan-700 ring-cyan-200 dark:bg-cyan-950 dark:text-cyan-300 dark:ring-cyan-800",sky:"bg-sky-100 text-sky-700 ring-sky-200 dark:bg-sky-950 dark:text-sky-300 dark:ring-sky-800",blue:"bg-blue-100 text-blue-700 ring-blue-200 dark:bg-blue-950 dark:text-blue-300 dark:ring-blue-800",indigo:"bg-indigo-100 text-indigo-700 ring-indigo-200 dark:bg-indigo-950 dark:text-indigo-300 dark:ring-indigo-800",violet:"bg-violet-100 text-violet-700 ring-violet-200 dark:bg-violet-950 dark:text-violet-300 dark:ring-violet-800",purple:"bg-purple-100 text-purple-700 ring-purple-200 dark:bg-purple-950 dark:text-purple-300 dark:ring-purple-800",fuchsia:"bg-fuchsia-100 text-fuchsia-700 ring-fuchsia-200 dark:bg-fuchsia-950 dark:text-fuchsia-300 dark:ring-fuchsia-800",pink:"bg-pink-100 text-pink-700 ring-pink-200 dark:bg-pink-950 dark:text-pink-300 dark:ring-pink-800",rose:"bg-rose-100 text-rose-700 ring-rose-200 dark:bg-rose-950 dark:text-rose-300 dark:ring-rose-800",slate:"bg-slate-100 text-slate-700 ring-slate-200 dark:bg-slate-950 dark:text-slate-300 dark:ring-slate-800",gray:"bg-gray-100 text-gray-700 ring-gray-200 dark:bg-gray-950 dark:text-gray-300 dark:ring-gray-800",zinc:"bg-zinc-100 text-zinc-700 ring-zinc-200 dark:bg-zinc-950 dark:text-zinc-300 dark:ring-zinc-800",neutral:"bg-neutral-100 text-neutral-700 ring-neutral-200 dark:bg-neutral-950 dark:text-neutral-300 dark:ring-neutral-800",stone:"bg-stone-100 text-stone-700 ring-stone-200 dark:bg-stone-950 dark:text-stone-300 dark:ring-stone-800",white:"bg-[var(--color-badge-white-bg)] text-[var(--color-badge-white-text)] ring-[var(--color-badge-white-ring)]",black:"bg-[var(--color-badge-black-bg)] text-[var(--color-badge-black-text)] ring-[var(--color-badge-black-ring)]"},qs=S.forwardRef((e,t)=>{const{className:n,children:s,onClick:i,showCloseIcon:o,Icon:r,color:a="gray"}=e,l=M("inline-flex align-top items-center gap-2 px-3 h-7 rounded-lg font-semibold",Wa[a],n);return i?f.jsx("div",{ref:t,children:f.jsxs("button",{className:M("cursor-pointer ring-0 hover:ring-4 active:ring-1 transition-all duration-100 select-none focus:outline-none focus:ring-4",l),onClick:i,children:[r&&f.jsx(r,{className:"h-4 w-4 shrink-0"}),f.jsx("div",{className:"break-all line-clamp-1 text-left",children:s}),o&&f.jsx(nt,{className:"h-4 w-4 shrink-0"})]})}):f.jsxs("div",{className:l,ref:t,children:[r&&f.jsx(r,{className:"h-4 w-4 shrink-0"}),f.jsx("div",{className:"break-all line-clamp-1 text-left",children:s})]})}),Ua=e=>{const{className:t,tabs:n}=e;return f.jsx("div",{className:M("h-12 tab-container p-1 rounded-xl inline-flex flex-row space-x-1 overflow-x-auto mat-ui-hide-scrollbars",t),children:n.map((s,i)=>{const o=M("shrink-0 px-4 h-full inline-flex flex-row items-center font-semibold rounded-xl cursor-pointer border border-transparent ing-0 tab-button transition-all duration-150 select-none focus:outline-none focus:ring-0",s.active&&"tab-button-active shadow-sm");return s.href?f.jsxs("a",{href:s.href,className:o,children:[s.Icon&&f.jsx(s.Icon,{className:"h-5 w-5 shrink-0 mr-2 -ml-1"}),s.label]},i):f.jsxs("button",{className:o,onClick:s.onClick,children:[s.Icon&&f.jsx(s.Icon,{className:"h-5 w-5 shrink-0 mr-2 -ml-1"}),s.label]},i)})})},za=T.createContext(void 0),Vm=()=>({dismiss:T.useContext(za)||(()=>{})}),Im="inline-flex flex-row items-center gap-3 h-10 px-3 font-semibold ring-0 dropdown-item rounded-lg cursor-pointer transition-all duration-150 select-none focus:outline-none focus:ring-0 border border-transparent bg-transparent",ee=S.forwardRef((e,t)=>{const{className:n,children:s,Icon:i,onClick:o,dismissOnClick:r=!0,...a}=e,{dismiss:l}=Vm(),u=c=>{o&&o(c),r&&l()};return f.jsxs("button",{ref:t,className:M(Im,n),onClick:u,...a,children:[i&&f.jsx(i,{className:"h-5 w-5"}),s]})}),Zs=e=>{const{label:t,children:n,className:s}=e;return f.jsxs("div",{className:M("flex flex-col dropdown-button-group",s),children:[t&&f.jsx("div",{className:"mb-2 text-sm dropdown-group-label font-semibold px-3",children:t}),n]})},Js=e=>{const{trigger:t,children:n,placement:s="bottom-end",minWidth:i=200,className:o}=e,[r,a]=T.useState(!1),{Popover:l,anchorRef:u}=ot({placement:s,onOutsideClick:()=>a(!1),minWidth:i});return f.jsxs(f.Fragment,{children:[f.jsx("div",{ref:u,className:o,onClick:()=>a(!r),children:t}),f.jsx(l,{open:r,children:f.jsx(at,{padding:"sm",children:f.jsx(za.Provider,{value:()=>a(!1),children:n})})})]})};function Om(e){const{onDelta:t,onDragStart:n,onDragEnd:s,disabled:i=!1,primaryButtonOnly:o=!0,preventScrollOnMove:r=!0}=e,[a,l]=S.useState(!1),u=S.useRef(0),c=S.useRef(0),d=S.useRef(0),h=S.useRef(null),m=S.useRef(null),p=S.useCallback(g=>{if(!a)return;const E={clientX:g??c.current,startX:u.current,totalDeltaX:d.current,target:h.current};l(!1),window.removeEventListener("pointermove",x,{capture:!0}),window.removeEventListener("pointerup",v,{capture:!0}),window.removeEventListener("pointercancel",v,{capture:!0}),window.removeEventListener("keydown",y,!0),m.current!=null&&(cancelAnimationFrame(m.current),m.current=null),s?.(E),h.current=null,d.current=0},[a,s]),y=S.useCallback(g=>{g.key==="Escape"&&(g.preventDefault(),p())},[p]),x=S.useCallback(g=>{if(!a)return;const E=()=>{const C=g.clientX,P=C-c.current;if(P!==0){c.current=C,d.current+=P;const k={clientX:C,startX:u.current,totalDeltaX:d.current,target:h.current};r&&g.preventDefault(),t(P,k)}m.current=null};m.current==null&&(m.current=requestAnimationFrame(E))},[a,t,r]),v=S.useCallback(g=>{p(g.clientX)},[p]),b=S.useCallback(g=>{if(i||o&&g.button!==0)return;g.target.setPointerCapture?.(g.pointerId),u.current=g.clientX,c.current=g.clientX,d.current=0,h.current=g.target,l(!0);const E={clientX:g.clientX,startX:g.clientX,totalDeltaX:0,target:g.target};n?.(E),window.addEventListener("pointermove",x,{passive:!r,capture:!0}),window.addEventListener("pointerup",v,{capture:!0}),window.addEventListener("pointercancel",v,{capture:!0}),window.addEventListener("keydown",y,!0)},[i,n,y,x,v,o,r]);return S.useEffect(()=>()=>{a&&p()},[a]),{isDragging:a,bind:{onPointerDown:b,role:"separator",style:{touchAction:"none",cursor:"col-resize",userSelect:"none"}}}}const Lm=e=>{const{column:t}=e,n=t?.defaultWidth??250,{bind:s}=Om({onDelta:i=>console.log(i),onDragStart:()=>{},onDragEnd:()=>{}});return f.jsxs("div",{style:{width:n,height:44},className:"flex flex-row items-stretch select-none",children:[f.jsx("div",{className:"flex-1 content-center px-4 relative cursor-pointer table-header-cell transition-colors duration-100",children:t.header}),f.jsx("div",{...s,className:"cursor-ew-resize group py-4 table-resize-handle w-[8px]",children:f.jsx("div",{className:"w-0.5 h-full mx-auto table-resize-divider table-resize-divider-hover pointer-events-none"})})]})},Fm=e=>{const{columns:t,rows:n,className:s}=e,i=S.useRef(null),o=r=>{i.current&&i.current.scrollTo({left:r.currentTarget.scrollLeft})};return f.jsxs("div",{className:s,children:[f.jsx("div",{className:"relative h-[45px] w-full overflow-hidden",ref:i,children:f.jsx("div",{className:"absolute",children:f.jsx("div",{className:"font-medium flex flex-row table-header",children:t.map(r=>f.jsx(Lm,{column:r},r.id))})})}),f.jsx("div",{className:"relative overflow-scroll min-w-full min-h-full",onScroll:o,children:f.jsx("div",{className:"absolute",children:f.jsx("div",{className:"flex flex-col",children:n.map(r=>f.jsx("div",{className:"flex flex-row table-row transition-all duration-100",children:t.map(a=>f.jsx("div",{className:"flex-1 content-center px-4",style:{height:44,width:250},children:a.renderCell(r)},a.id))},JSON.stringify(r)))})})})]})},Bm=()=>f.jsx("div",{}),_m=[{id:1,email:"sarah.jennings@example.com",firstname:"Sarah",lastname:"Jennings",status:"active"},{id:2,email:"liam.patel@outlook.com",firstname:"Liam",lastname:"Patel",status:"inactive"},{id:3,email:"emily.wong@gmail.com",firstname:"Emily",lastname:"Wong",status:"active"},{id:4,email:"noah.thompson@yahoo.com",firstname:"Noah",lastname:"Thompson",status:"active"},{id:5,email:"isabella.martin@protonmail.com",firstname:"Isabella",lastname:"Martin",status:"active"},{id:6,email:"ethan.ross@company.io",firstname:"Ethan",lastname:"Ross",status:"inactive"},{id:7,email:"olivia.nguyen@example.org",firstname:"Olivia",lastname:"Nguyen",status:"active"},{id:8,email:"lucas.henderson@gmail.com",firstname:"Lucas",lastname:"Henderson",status:"inactive"},{id:9,email:"mia.johnson@workmail.com",firstname:"Mia",lastname:"Johnson",status:"active"},{id:10,email:"jackson.rivera@outlook.com",firstname:"Jackson",lastname:"Rivera",status:"active"},{id:11,email:"ava.sanders@example.com",firstname:"Ava",lastname:"Sanders",status:"active"},{id:12,email:"logan.bennett@company.io",firstname:"Logan",lastname:"Bennett",status:"inactive"}],$m=[{id:"id",header:"ID",renderCell:e=>e.id},{id:"email",header:"Email",renderCell:e=>f.jsx(qs,{Icon:_f,onClick:()=>{},children:e.email})},{id:"firstname",header:"First Name",renderCell:e=>e.firstname},{id:"lastname",header:"Last Name",renderCell:e=>e.lastname},{id:"status",header:"Status",renderCell:()=>f.jsx(Um,{})}],Wm=()=>f.jsxs("div",{className:"flex flex-col gap-6",children:[f.jsxs("div",{className:"flex flex-row items-center justify-start gap-3",children:[f.jsx(Ns,{Icon:Ms,placeholder:"Search..."}),f.jsx(Rs,{Icon:ia}),f.jsx(ea,{Icon:na,children:"New"}),f.jsxs(Js,{trigger:f.jsx(Rs,{Icon:ia}),children:[f.jsx(ee,{dismissOnClick:!1,Icon:na,children:"Add new"}),f.jsx(ee,{Icon:Ff,children:"Remove"}),f.jsxs(Zs,{label:"Test",className:"mt-2",children:[f.jsx(ee,{children:"Item 1"}),f.jsx(ee,{children:"Item 2"}),f.jsx(ee,{children:"Item 3"}),f.jsx(ee,{children:"Item 4"})]}),f.jsxs(Zs,{label:"Test",className:"mt-2",children:[f.jsx(ee,{children:"Item 1"}),f.jsx(ee,{children:"Item 2"}),f.jsx(ee,{children:"Item 3"}),f.jsx(ee,{children:"Item 4"})]})]}),f.jsx(Ua,{tabs:[{label:"Tab 1",Icon:ta,active:!0,onClick:()=>{}},{label:"Tab 2",active:!1,onClick:()=>{}},{label:"Tab 3",Icon:ta,active:!1,onClick:()=>{}}]})]}),f.jsx($a,{options:[{label:"Option 1",value:1},{label:"Option 2",value:2},{label:"Option 3",value:3}],value:null,onChange:()=>{}}),f.jsx(Fm,{className:"h-[300px] w-[300px]",columns:$m,rows:_m}),f.jsx(Bm,{})]}),Um=()=>f.jsx(f.Fragment,{children:f.jsxs(Js,{placement:"bottom-end",className:"inline-block",trigger:f.jsx(qs,{onClick:()=>{},children:"Test"}),children:[f.jsx(ee,{children:"Option 1"}),f.jsx(ee,{children:"Option 2"}),f.jsx(ee,{children:"Option 3"})]})});R.Badge=qs,R.BadgeColor=Wa,R.Button=ea,R.ButtonIconRound=Ds,R.ButtonIconSquare=Rs,R.Divider=Rm,R.DropdownButton=ee,R.DropdownButtonGroup=Zs,R.DropdownMenu=Js,R.DropdownPanel=at,R.Input=Ns,R.InputCheck=Kf,R.InputDescription=me,R.InputError=pe,R.InputErrorIcon=_e,R.InputIconButton=Ce,R.InputIconButtonTray=$e,R.InputLabel=Be,R.InputPassword=$f,R.InputRadio=Uf,R.InputSelect=$a,R.InputSelectNative=Xf,R.InputSelectOption=kt,R.InputSelectSearchable=Em,R.InputSelectSearchableAsync=Am,R.InputTextArea=Wf,R.InputToggle=zf,R.Modal=Mm,R.Panel=jm,R.PopoverBase=_a,R.SidebarModal=Nm,R.Spinner=Jt,R.TabButtons=Ua,R.Test=Wm,R.Tooltip=Dm,R.usePopover=ot,Object.defineProperty(R,Symbol.toStringTag,{value:"Module"})}));
|
|
141
141
|
//# sourceMappingURL=index.umd.cjs.map
|