import{s as e,t}from"./chunk-Bj-mKKzh.js";import{l as n,n as r,o as i,t as a}from"./polymorph-DYV3w3iw.js";import{t as o}from"./react-D28festP.js";import{t as s}from"./jsx-runtime-Chcf38RU.js";import{u as c}from"./dexie-db-nHcUhGem.js";var l=e(o()),u=function(){return u=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a}var p=function(e){return e.replace(RegExp(`\xA0`,`g`),` `)},m=function(e,t){var n=e.length,r=t+1;return n>=r?e:`${`0`.repeat(r-n)}${e}`},h=function(e){return e.replace(/^0+([0-9]+)/,`$1`)},g=function(e,t,n){var r=e.length-2,i=h(e.substring(0,r)),a=e.substring(r);return i.split(/(?=(?:\d{3})*$)/).join(t)+n+a},_=function(e){return e===void 0&&(e=``),e.replace(/(-(?!\d))|[^0-9|-]/g,``)||``},v=function(e){return Number.parseFloat(e.replace(/,/g,`.`).replace(/(.*)\./,function(e){return`${e.replace(/\./g,``)}.`}).replace(/[^0-9.]/g,``))},y=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},b=function(e){var t=(0,l.useRef)(e);return(0,l.useEffect)(function(){t.current=e},[e]),t},x=function(e){return e===`money`||e===`currency`},S=function(e,t,n){return new Intl.NumberFormat(e,{style:`currency`,currency:t,currencyDisplay:n}).formatToParts(1e3).reduce(function(e,t){var n;return u(u({},e),(n={},n[t.type]=t.value,n))},{currency:``,currencyDisplay:``,decimal:`,`,fraction:``,group:``,integer:``,literal:``})},C=function(e,t){var n=m(_(e),t.fraction.length);return p(`${t.currency}${g(n,t.group,t.decimal)}`)},w=(0,l.forwardRef)(function(e,t){var n=e.locale,r=n===void 0?`pt-BR`:n,i=e.currency,a=i===void 0?`BRL`:i,o=e.currencyDisplay,s=o===void 0?`symbol`:o;e.mask;var c=e.onChange,f=d(e,[`locale`,`currency`,`currencyDisplay`,`mask`,`onChange`]),m=(0,l.useRef)(null);(0,l.useImperativeHandle)(t,function(){return m.current});var h=(0,l.useMemo)(function(){var e=S(r,a,s);return e.currency=p(`${e.currency.trim()} `),e.literal=p(e.literal.trim()),e},[r,a]),g=function(e){var t=C(e.target.value,h),n=v(t);e.target.value=t,e.target.setAttribute(`data-number`,n.toString()),c?.(e),n!==0&&(m.current.selectionEnd=t.length)};(0,l.useEffect)(function(){if(m.current!==null){var e=m.current.value;if(e!==``){var t=C(e,h),n=v(t);m.current.value=t,m.current.setAttribute(`data-number`,n.toString());var r=new InputEvent(`change`,{});c?.(u(u({},r),{target:m.current,currentTarget:m.current})),n!==0&&(m.current.selectionEnd=t.length)}}},[h]);var _=f.defaultValue?C(f.defaultValue,h):void 0;return l.createElement(`input`,u({},f,{value:typeof f.value==`string`?C(f.value,h):f.value,defaultValue:_,type:`text`,ref:m,onChange:g,inputMode:`decimal`}))}),T=1,E=function(e){return e===`percentage`||e===`percent`||e===`percentual`},D=function(e){return new Intl.NumberFormat(e,{style:`percent`,minimumFractionDigits:2}).formatToParts(1e3).reduce(function(e,t){var n;return u(u({},e),(n={},n[t.type]=t.value,n))},{decimal:``,fraction:``,group:``,integer:``,percentSign:``,type:``,value:``})},O=function(e,t){return p(`${g(m(_(e),t.fraction.length),t.group,t.decimal)} ${t.percentSign}`)},k=(0,l.forwardRef)(function(e,t){var n=e.locale,r=n===void 0?`pt-BR`:n;e.mask;var i=e.onChange,a=e.onKeyUp,o=d(e,[`locale`,`mask`,`onChange`,`onKeyUp`]),s=(0,l.useRef)(null),c=f((0,l.useState)(function(){return o.value?.toString()??``}),2),m=c[0],h=c[1];(0,l.useImperativeHandle)(t,function(){return s.current}),(0,l.useEffect)(function(){h(O(Number.parseFloat(`${o.value??`0`}`).toFixed(g.fraction.length),g))},[o.value]);var g=(0,l.useMemo)(function(){var e=D(r);return e.percentSign=p(`${e.percentSign}`),e},[r]),_=m.length-g.percentSign.length-T,y=function(e){var t,n=s.current;n&&(n.setSelectionRange(_,_),e&&((t=o.onFocus)==null||t.call(o,e)))},b=function(e){var t=e.currentTarget;if(t.selectionStart!==null){var n=t.selectionStart;n===t.selectionEnd&&_4?`#HHHHHH`:`#HHH`},cpfCnpj:function(e){return L(e).length<=11?re:I},int:function(e){return e===void 0&&(e=``),ee.test(e.toString().slice(-1))?`d`.repeat(Math.max(e.length,0)):`d`.repeat(Math.max(e.length-1,0))},cellTelephone:function(e){return L(e).length<11?ne:te},time:function(e){return L(e)[0]===`2`?ie:ae}},z=function(e,t,n){return n===void 0&&(n={}),u({mask:e,inputMode:t,strict:!0,pattern:n.pattern??typeof e==`function`?void 0:M(e,``,!0),infinity:n.infinity},n)},B={cellTelephone:z(R.cellTelephone,`tel`),cellphone:z(R.cellphone,`tel`),cep:z(R.cep,`decimal`),cnpj:z(R.cnpj,`decimal`),color:z(R.color,`decimal`,{pattern:`#[a-fA-F0-9]{3}([a-fA-F0-9]{3})?`}),cpf:z(R.cpf,`decimal`),cpfCnpj:z(R.cpfCnpj,`decimal`,{transform:L}),creditCard:z(R.creditCard,`decimal`,{pattern:`[0-9]{4} [0-9]{4} [0-9]{4} [0-9]{3,4}`}),date:z(R.date,`decimal`),int:z(R.int,`decimal`,{pattern:`[0-9]+`}),isoDate:z(R.isoDate,`decimal`),telephone:z(R.telephone,`tel`),time:z(R.time,`decimal`,{pattern:`[0-9]{2}:[0-9]{2}`}),uuid:z(R.uuid,`decimal`,{pattern:`[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}`})};function oe(e,t,n,r){r===void 0&&(r=F);for(var i=n(e),a=``,o=0,s=0;o=j.length)return c.value=j,f(c,d-1,d-1);var m=!1;l.lengthe.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),he=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),ge=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),_e=e=>{let t=ge(e);return t.charAt(0).toUpperCase()+t.slice(1)},ve={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},ye=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},be=(0,l.forwardRef)(({color:e=`currentColor`,size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>(0,l.createElement)(`svg`,{ref:c,...ve,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:me(`lucide`,i),...!a&&!ye(s)&&{"aria-hidden":`true`},...s},[...o.map(([e,t])=>(0,l.createElement)(e,t)),...Array.isArray(a)?a:[a]])),xe=(e,t)=>{let n=(0,l.forwardRef)(({className:n,...r},i)=>(0,l.createElement)(be,{ref:i,iconNode:t,className:me(`lucide-${he(_e(e))}`,`lucide-${e}`,n),...r}));return n.displayName=_e(e),n},Se=xe(`circle-check-big`,[[`path`,{d:`M21.801 10A10 10 0 1 1 17 3.335`,key:`yps3ct`}],[`path`,{d:`m9 11 3 3L22 4`,key:`1pflzl`}]]),Ce=xe(`circle-x`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]]),we=xe(`info`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 16v-4`,key:`1dtifu`}],[`path`,{d:`M12 8h.01`,key:`e9boi3`}]]),Te={hex:e=>e,raw:e=>e,hsl:e=>`hsl(${e})`,rgb:e=>`rgb(${e})`,z:(e,t,n)=>`var(--z-${n})`,hsla:e=>`hsla(${e})`,rgba:e=>`rgba(${e})`,cssVariable:(e,t,n)=>`var(--${n})`,formatWithVar:e=>(t,n,r)=>`${e}(var(--${r}), )`},Ee=(e,t,n=``,r=``)=>Object.entries(e).reduce((e,[i,a])=>{let o=r===``?`${n}${i}`:`${r}-${i}`;if(typeof a==`string`){let s=r===``?`${n}${i}`:i;return e.concat(t(a,s,o))}return e.concat(Ee(a,t,n,o))},[]),De=(e,t)=>{let n=t.value||((e,t)=>t),r=e.map(e=>`${e.key}: ${n(e.key,e.value)}`).join(`;`);return t.result(r)},Oe=e=>(t,n,r)=>{let i={key:`--${r}`,value:`${t}`};return e?e(i):i},ke=e=>({key:e.key.replace(/^--/,`--z-`),value:e.value}),Ae=(e,t)=>{let n=Ee(e.colors,Oe(t?.colors)),r=Ee(e.spacing,Oe(t?.spacing)),i=Ee(e.rounded,Oe(t?.rounded)),a=Ee(e.shadow,Oe(t?.rounded)),o=Ee(e.zIndex,Oe(t?.zIndex??ke)),s=e.custom?Ee(e.custom,Oe(t?.customTokens)):[];return n.concat(r,i,s,o,a)},je=(e,t)=>De(Ae(e,t),{result:e=>`html${t?.name?`.${t.name}`:``} {${e}}`,value:(e,t)=>t}),V=s(),Me={autocompleteEmpty:`Nothing here...`,calendarBackMonth:`Back month`,calendarFromDate:`From`,calendarMonthLabel:`Month`,calendarNextMonth:`Next month`,calendarDatetimeTitle:`Time`,calendarToDate:`To`,calendarToday:`Today`,pageCalendarMonthView:`Month view`,pageCalendarWeekView:`Week view`,pageCalendarDayView:`Day view`,pageCalendarPrevious:`Previous`,pageCalendarNext:`Next`,pageCalendarToday:`Today`,pageCalendarAddEvent:`Add event`,pageCalendarWeekLabel:e=>`Week ${e}`,pageCalendarFilter:`Filter:`,pageCalendarMoreEvents:e=>`+${e} more...`,pageCalendarLabel:`Calendar`,pageCalendarNavigation:`Calendar navigation`,pageCalendarMonthGrid:`Calendar month`,pageCalendarFilterEnabled:`enabled`,pageCalendarFilterDisabled:`disabled`,pageCalendarEventCount:e=>e===1?`1 event`:`${e} events`,pageCalendarEventAt:(e,t)=>`${e} at ${t}`,commandPaletteEmpty:`Nothing here...`,commandPaletteLoading:`Loading...`,datePickerCalendarButtonLabel:`Click to open a date picker`,emptyDataMessage:`No data`,inputCaretDown:`Click to see all options`,inputCloseValue:`Click to clear the value`,inputOptionalLabel:`Optional`,driverNext:`Next`,driverPrevious:`Previous`,driverFinish:`Finish`,driverSkip:`Skip`,multiSelectInnerPlaceholder:`Search...`,multiSelectSelectedLabel:`Selected`,tableColumnResizer:`Resize column`,tableFilterColumnPlaceholder:`Filter by`,tableFilterColumnTitle:`Filter by`,tableFilterDropdownTitle:`Filters`,tableFilterDropdownTitleUnique:`Filter by`,tableFilterLabel:`Filters`,tableFilterNewFilter:`New filter`,tableFilterOperatorPlaceholder:`Equals to...`,tableFilterOperatorTitle:`Operation`,tableFilterTypeContains:`Contains`,tableFilterTypeEndsWith:`Ends with`,tableFilterTypeGreaterThan:`Greater than`,tableFilterTypeIs:`Is`,tableFilterTypeIsNot:`Is not`,tableFilterTypeLessThan:`Less than`,tableFilterTypeNotContains:`Not contains`,tableFilterTypeStartsWith:`Starts with`,tableFilterValuePlaceholder:`Something...`,tableFilterValueTitle:`Value`,tableGroupLabel:`Group`,tableGroupLabelWithCount:`Group`,tablePaginationFooter:e=>(0,V.jsxs)(l.Fragment,{children:[e.current,` to `,e.pages,` of `,e.totalItems,` items.`,Array.isArray(e.sizes)?e.select:null,` `,`per page.`]}),tablePaginationNext:`Next`,tablePaginationPrevious:`Previous`,tablePaginationSelectLabel:`Select the size of page`,tableSortAddButton:`Add sort`,tableSortAsc:`Ascending`,tableSortDesc:`Descending`,tableSortDropdownTitle:`Order by`,tableSortOrderByLabel:`Order by`,tableSortOrderInputPlaceholder:`Order by`,tableSortOrderInputTitle:`Order by`,tableSortTypeInputPlaceholder:`Ascending`,tableSortTypeInputTitle:`Sort type`,uploadIdle:`You can drag your files here`,uploadIdleButton:`Choose your files`,uploadDragging:e=>`Dragging ${e.n} ${e.n>0?`files`:`file`}`,uploadDialogTitle:`Details of your file`,datepickerPlaceholder:e=>`day/month/year`},Ne={input:{iconFeedback:!0},table:{operations:!0,sorters:!0,filters:!0,sticky:void 0}},Pe=(0,l.createContext)({parser:Te.hsla,tweaks:Ne,floatingRef:void 0,map:Me,locale:void 0}),Fe=()=>{let e=(0,l.useContext)(Pe);return e?e.map:Me},Ie=()=>{let e=(0,l.useContext)(Pe);return e?e.tweaks:Ne};function Le(){return typeof window<`u`}function Re(e){return Be(e)?(e.nodeName||``).toLowerCase():`#document`}function H(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ze(e){return((Be(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function Be(e){return Le()?e instanceof Node||e instanceof H(e).Node:!1}function U(e){return Le()?e instanceof Element||e instanceof H(e).Element:!1}function W(e){return Le()?e instanceof HTMLElement||e instanceof H(e).HTMLElement:!1}function Ve(e){return!Le()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof H(e).ShadowRoot}function He(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=G(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function Ue(e){return/^(table|td|th)$/.test(Re(e))}function We(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var Ge=/transform|translate|scale|rotate|perspective|filter/,Ke=/paint|layout|strict|content/,qe=e=>!!e&&e!==`none`,Je;function Ye(e){let t=U(e)?G(e):e;return qe(t.transform)||qe(t.translate)||qe(t.scale)||qe(t.rotate)||qe(t.perspective)||!Ze()&&(qe(t.backdropFilter)||qe(t.filter))||Ge.test(t.willChange||``)||Ke.test(t.contain||``)}function Xe(e){let t=et(e);for(;W(t)&&!Qe(t);){if(Ye(t))return t;if(We(t))return null;t=et(t)}return null}function Ze(){return Je??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),Je}function Qe(e){return/^(html|body|#document)$/.test(Re(e))}function G(e){return H(e).getComputedStyle(e)}function $e(e){return U(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function et(e){if(Re(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||Ve(e)&&e.host||ze(e);return Ve(t)?t.host:t}function tt(e){let t=et(e);return Qe(t)?e.ownerDocument?e.ownerDocument.body:e.body:W(t)&&He(t)?t:tt(t)}function nt(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=tt(e),i=r===e.ownerDocument?.body,a=H(r);if(i){let e=rt(a);return t.concat(a,a.visualViewport||[],He(r)?r:[],e&&n?nt(e):[])}else return t.concat(r,nt(r,[],n))}function rt(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}var it=[`top`,`right`,`bottom`,`left`],at=[`start`,`end`],ot=it.reduce((e,t)=>e.concat(t,t+`-`+at[0],t+`-`+at[1]),[]),st=Math.min,ct=Math.max,lt=Math.round,ut=Math.floor,dt=e=>({x:e,y:e}),ft={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function pt(e,t,n){return ct(e,st(t,n))}function mt(e,t){return typeof e==`function`?e(t):e}function ht(e){return e.split(`-`)[0]}function gt(e){return e.split(`-`)[1]}function _t(e){return e===`x`?`y`:`x`}function vt(e){return e===`y`?`height`:`width`}function yt(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function bt(e){return _t(yt(e))}function xt(e,t,n){n===void 0&&(n=!1);let r=gt(e),i=bt(e),a=vt(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=At(o)),[o,At(o)]}function St(e){let t=At(e);return[Ct(e),t,Ct(t)]}function Ct(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var wt=[`left`,`right`],Tt=[`right`,`left`],Et=[`top`,`bottom`],Dt=[`bottom`,`top`];function Ot(e,t,n){switch(e){case`top`:case`bottom`:return n?t?Tt:wt:t?wt:Tt;case`left`:case`right`:return t?Et:Dt;default:return[]}}function kt(e,t,n,r){let i=gt(e),a=Ot(ht(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(Ct)))),a}function At(e){let t=ht(e);return ft[t]+e.slice(t.length)}function jt(e){return{top:0,right:0,bottom:0,left:0,...e}}function Mt(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:jt(e)}function Nt(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}var Pt=[`input:not([inert]):not([inert] *)`,`select:not([inert]):not([inert] *)`,`textarea:not([inert]):not([inert] *)`,`a[href]:not([inert]):not([inert] *)`,`button:not([inert]):not([inert] *)`,`[tabindex]:not(slot):not([inert]):not([inert] *)`,`audio[controls]:not([inert]):not([inert] *)`,`video[controls]:not([inert]):not([inert] *)`,`[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)`,`details>summary:first-of-type:not([inert]):not([inert] *)`,`details:not([inert]):not([inert] *)`].join(`,`),Ft=typeof Element>`u`,It=Ft?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Lt=!Ft&&Element.prototype.getRootNode?function(e){return e?.getRootNode?.call(e)}:function(e){return e?.ownerDocument},Rt=function(e,t){t===void 0&&(t=!0);var n=e?.getAttribute?.call(e,`inert`);return n===``||n===`true`||t&&e&&(typeof e.closest==`function`?e.closest(`[inert]`):Rt(e.parentNode))},zt=function(e){var t=e?.getAttribute?.call(e,`contenteditable`);return t===``||t===`true`},Bt=function(e,t,n){if(Rt(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(Pt));return t&&It.call(e,Pt)&&r.unshift(e),r=r.filter(n),r},Vt=function(e,t,n){for(var r=[],i=Array.from(e);i.length;){var a=i.shift();if(!Rt(a,!1))if(a.tagName===`SLOT`){var o=a.assignedElements(),s=Vt(o.length?o:a.children,!0,n);n.flatten?r.push.apply(r,s):r.push({scopeParent:a,candidates:s})}else{It.call(a,Pt)&&n.filter(a)&&(t||!e.includes(a))&&r.push(a);var c=a.shadowRoot||typeof n.getShadowRoot==`function`&&n.getShadowRoot(a),l=!Rt(c,!1)&&(!n.shadowRootFilter||n.shadowRootFilter(a));if(c&&l){var u=Vt(c===!0?a.children:c.children,!0,n);n.flatten?r.push.apply(r,u):r.push({scopeParent:a,candidates:u})}else i.unshift.apply(i,a.children)}}return r},Ht=function(e){return!isNaN(parseInt(e.getAttribute(`tabindex`),10))},Ut=function(e){if(!e)throw Error(`No node provided`);return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||zt(e))&&!Ht(e)?0:e.tabIndex},Wt=function(e,t){var n=Ut(e);return n<0&&t&&!Ht(e)?0:n},Gt=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},Kt=function(e){return e.tagName===`INPUT`},qt=function(e){return Kt(e)&&e.type===`hidden`},Jt=function(e){return e.tagName===`DETAILS`&&Array.prototype.slice.apply(e.children).some(function(e){return e.tagName===`SUMMARY`})},Yt=function(e,t){for(var n=0;nsummary:first-of-type`)?e.parentElement:e;if(It.call(i,`details:not([open]) *`))return!0;if(!n||n===`full`||n===`full-native`||n===`legacy-full`){if(typeof r==`function`){for(var a=e;e;){var o=e.parentElement,s=Lt(e);if(o&&!o.shadowRoot&&r(o)===!0)return en(e);e=e.assignedSlot?e.assignedSlot:!o&&s!==e.ownerDocument?s.host:o}e=a}if($t(e))return!e.getClientRects().length;if(n!==`legacy-full`)return!0}else if(n===`non-zero-area`)return en(e);return!1},nn=function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if(t.tagName===`FIELDSET`&&t.disabled){for(var n=0;n=0)},sn=function(e){var t=[],n=[];return e.forEach(function(e,r){var i=!!e.scopeParent,a=i?e.scopeParent:e,o=Wt(a,i),s=i?sn(e.candidates):a;o===0?i?t.push.apply(t,s):t.push(a):n.push({documentOrder:r,tabIndex:o,item:e,isScope:i,content:s})}),n.sort(Gt).reduce(function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e},[]).concat(t)},cn=function(e,t){return t||={},sn(t.getShadowRoot?Vt([e],t.includeContainer,{filter:an.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:on}):Bt(e,t.includeContainer,an.bind(null,t)))},ln=function(e,t){return t||={},t.getShadowRoot?Vt([e],t.includeContainer,{filter:rn.bind(null,t),flatten:!0,getShadowRoot:t.getShadowRoot}):Bt(e,t.includeContainer,rn.bind(null,t))},un=function(e,t){if(t||={},!e)throw Error(`No node provided`);return It.call(e,Pt)===!1?!1:an(t,e)};function dn(){let e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function fn(){let e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(e=>{let{brand:t,version:n}=e;return t+`/`+n}).join(` `):navigator.userAgent}function pn(){return/apple/i.test(navigator.vendor)}function mn(){let e=/android/i;return e.test(dn())||e.test(fn())}function hn(){return dn().toLowerCase().startsWith(`mac`)&&!navigator.maxTouchPoints}function gn(){return fn().includes(`jsdom/`)}var _n=`data-floating-ui-focusable`,vn=`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`,yn=`ArrowLeft`,bn=`ArrowRight`,xn=`ArrowUp`,Sn=`ArrowDown`;function Cn(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 K(e,t){if(!e||!t)return!1;let n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&Ve(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function wn(e){return`composedPath`in e?e.composedPath()[0]:e.target}function Tn(e,t){if(t==null)return!1;if(`composedPath`in e)return e.composedPath().includes(t);let n=e;return n.target!=null&&t.contains(n.target)}function En(e){return e.matches(`html,body`)}function q(e){return e?.ownerDocument||document}function Dn(e){return W(e)&&e.matches(vn)}function On(e){return e?e.getAttribute(`role`)===`combobox`&&Dn(e):!1}function kn(e){if(!e||gn())return!0;try{return e.matches(`:focus-visible`)}catch{return!0}}function An(e){return e?e.hasAttribute(_n)?e:e.querySelector(`[`+_n+`]`)||e:null}function jn(e,t,n){return n===void 0&&(n=!0),e.filter(e=>e.parentId===t&&(!n||e.context?.open)).flatMap(t=>[t,...jn(e,t.id,n)])}function Mn(e,t){let n,r=-1;function i(t,a){a>r&&(n=t,r=a),jn(e,t).forEach(e=>{i(e.id,a+1)})}return i(t,0),e.find(e=>e.id===n)}function Nn(e,t){let n=[],r=e.find(e=>e.id===t)?.parentId;for(;r;){let t=e.find(e=>e.id===r);r=t?.parentId,t&&(n=n.concat(t))}return n}function J(e){e.preventDefault(),e.stopPropagation()}function Pn(e){return`nativeEvent`in e}function Fn(e){return e.mozInputSource===0&&e.isTrusted?!0:mn()&&e.pointerType?e.type===`click`&&e.buttons===1:e.detail===0&&!e.pointerType}function In(e){return gn()?!1:!mn()&&e.width===0&&e.height===0||mn()&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType===`mouse`||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType===`touch`}function Ln(e,t){let n=[`mouse`,`pen`];return t||n.push(``,void 0),n.includes(e)}var Y=typeof document<`u`?l.useLayoutEffect:function(){},Rn={...l};function X(e){let t=l.useRef(e);return Y(()=>{t.current=e}),t}var zn=Rn.useInsertionEffect||(e=>e());function Z(e){let t=l.useRef(()=>{});return zn(()=>{t.current=e}),l.useCallback(function(){var e=[...arguments];return t.current==null?void 0:t.current(...e)},[])}function Bn(e,t,n){return Math.floor(e/t)!==n}function Vn(e,t){return t<0||t>=e.current.length}function Hn(e,t){return Q(e,{disabledIndices:t})}function Un(e,t){return Q(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function Q(e,t){let{startingIndex:n=-1,decrement:r=!1,disabledIndices:i,amount:a=1}=t===void 0?{}:t,o=n;do o+=r?-a:a;while(o>=0&&o<=e.current.length-1&&Jn(e,o,i));return o}function Wn(e,t){let{event:n,orientation:r,loop:i,rtl:a,cols:o,disabledIndices:s,minIndex:c,maxIndex:l,prevIndex:u,stopEvent:d=!1}=t,f=u;if(n.key===xn){if(d&&J(n),u===-1)f=l;else if(f=Q(e,{startingIndex:f,amount:o,decrement:!0,disabledIndices:s}),i&&(u-oe?n:n-o}Vn(e,f)&&(f=u)}if(n.key===Sn&&(d&&J(n),u===-1?f=c:(f=Q(e,{startingIndex:u,amount:o,disabledIndices:s}),i&&u+o>l&&(f=Q(e,{startingIndex:u%o-o,amount:o,disabledIndices:s}))),Vn(e,f)&&(f=u)),r===`both`){let t=ut(u/o);n.key===(a?yn:bn)&&(d&&J(n),u%o===o-1?i&&(f=Q(e,{startingIndex:u-u%o-1,disabledIndices:s})):(f=Q(e,{startingIndex:u,disabledIndices:s}),i&&Bn(f,o,t)&&(f=Q(e,{startingIndex:u-u%o-1,disabledIndices:s}))),Bn(f,o,t)&&(f=u)),n.key===(a?bn:yn)&&(d&&J(n),u%o===0?i&&(f=Q(e,{startingIndex:u+(o-u%o),decrement:!0,disabledIndices:s})):(f=Q(e,{startingIndex:u,decrement:!0,disabledIndices:s}),i&&Bn(f,o,t)&&(f=Q(e,{startingIndex:u+(o-u%o),decrement:!0,disabledIndices:s}))),Bn(f,o,t)&&(f=u));let r=ut(l/o)===t;Vn(e,f)&&(f=i&&r?n.key===(a?bn:yn)?l:Q(e,{startingIndex:u-u%o-1,disabledIndices:s}):u)}return f}function Gn(e,t,n){let r=[],i=0;return e.forEach((e,a)=>{let{width:o,height:s}=e,c=!1;for(n&&(i=0);!c;){let e=[];for(let n=0;nr[e]==null)?(e.forEach(e=>{r[e]=a}),c=!0):i++}}),[...r]}function Kn(e,t,n,r,i){if(e===-1)return-1;let a=n.indexOf(e),o=t[e];switch(i){case`tl`:return a;case`tr`:return o?a+o.width-1:a;case`bl`:return o?a+(o.height-1)*r:a;case`br`:return n.lastIndexOf(e)}}function qn(e,t){return t.flatMap((t,n)=>e.includes(t)?[n]:[])}function Jn(e,t,n){if(typeof n==`function`)return n(t);if(n)return n.includes(t);let r=e.current[t];return r==null||r.hasAttribute(`disabled`)||r.getAttribute(`aria-disabled`)===`true`}var Yn=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver==`function`&&ResizeObserver.toString().includes(`[native code]`)?`full`:`none`});function Xn(e,t){let n=cn(e,Yn()),r=n.length;if(r===0)return;let i=Cn(q(e)),a=n.indexOf(i);return n[a===-1?t===1?0:r-1:a+t]}function Zn(e){return Xn(q(e).body,1)||e}function Qn(e){return Xn(q(e).body,-1)||e}function $n(e,t){let n=t||e.currentTarget,r=e.relatedTarget;return!r||!K(n,r)}function er(e){cn(e,Yn()).forEach(e=>{e.dataset.tabindex=e.getAttribute(`tabindex`)||``,e.setAttribute(`tabindex`,`-1`)})}function tr(e){e.querySelectorAll(`[data-tabindex]`).forEach(e=>{let t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute(`tabindex`,t):e.removeAttribute(`tabindex`)})}var nr=t((e=>{var t=o();function n(e){var t=`https://react.dev/errors/`+e;if(1{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=nr()}));function ir(e,t,n){let{reference:r,floating:i}=e,a=yt(t),o=bt(t),s=vt(o),c=ht(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}switch(gt(t)){case`start`:p[o]-=f*(n&&l?-1:1);break;case`end`:p[o]+=f*(n&&l?-1:1);break}return p}async function ar(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=mt(t,e),p=Mt(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=Nt(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=Nt(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var or=50,sr=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:ar},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=ir(l,r,c),f=r,p=0,m={};for(let n=0;n({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=mt(e,t)||{};if(l==null)return{};let d=Mt(u),f={x:n,y:r},p=bt(i),m=vt(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,E=st(d[_],T),D=st(d[v],T),O=E,k=C-h[m]-D,A=C/2-h[m]/2+w,j=pt(O,A,k),M=!c.arrow&>(i)!=null&&A!==j&&a.reference[m]/2-(Agt(t)===e),...n.filter(t=>gt(t)!==e)]:n.filter(e=>ht(e)===e)).filter(n=>e?gt(n)===e||(t?Ct(n)!==n:!1):!0)}var ur=function(e){return e===void 0&&(e={}),{name:`autoPlacement`,options:e,async fn(t){let{rects:n,middlewareData:r,placement:i,platform:a,elements:o}=t,{crossAxis:s=!1,alignment:c,allowedPlacements:l=ot,autoAlignment:u=!0,...d}=mt(e,t),f=c!==void 0||l===ot?lr(c||null,u,l):l,p=await a.detectOverflow(t,d),m=r.autoPlacement?.index||0,h=f[m];if(h==null)return{};let g=xt(h,n,await(a.isRTL==null?void 0:a.isRTL(o.floating)));if(i!==h)return{reset:{placement:f[0]}};let _=[p[ht(h)],p[g[0]],p[g[1]]],v=[...r.autoPlacement?.overflows||[],{placement:h,overflows:_}],y=f[m+1];if(y)return{data:{index:m+1,overflows:v},reset:{placement:y}};let b=v.map(e=>{let t=gt(e.placement);return[e.placement,t&&s?e.overflows.slice(0,2).reduce((e,t)=>e+t,0):e.overflows[0],e.overflows]}).sort((e,t)=>e[1]-t[1]),x=b.filter(e=>e[2].slice(0,gt(e[0])?2:3).every(e=>e<=0))[0]?.[0]||b[0][0];return x===i?{}:{data:{index:m+1,overflows:v},reset:{placement:x}}}}},dr=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=mt(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=ht(r),_=yt(o),v=ht(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[At(o)]:St(o)),x=p!==`none`;!d&&x&&b.push(...kt(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=xt(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(!(u===`alignment`&&_!==yt(t))||T.every(e=>yt(e.placement)===_?e.overflows[0]>0:!0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=yt(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o;break}if(r!==n)return{reset:{placement:n}}}return{}}}};function fr(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function pr(e){return it.some(t=>e[t]>=0)}var mr=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=mt(e,t);switch(i){case`referenceHidden`:{let e=fr(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:pr(e)}}}case`escaped`:{let e=fr(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:pr(e)}}}default:return{}}}}},hr=new Set([`left`,`top`]);async function gr(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=ht(n),s=gt(n),c=yt(n)===`y`,l=hr.has(o)?-1:1,u=a&&c?-1:1,d=mt(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var _r=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await gr(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},vr=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=mt(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=yt(ht(i)),p=_t(f),m=u[p],h=u[f];if(o){let e=p===`y`?`top`:`left`,t=p===`y`?`bottom`:`right`,n=m+d[e],r=m-d[t];m=pt(n,m,r)}if(s){let e=f===`y`?`top`:`left`,t=f===`y`?`bottom`:`right`,n=h+d[e],r=h-d[t];h=pt(n,h,r)}let g=c.fn({...t,[p]:m,[f]:h});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[p]:o,[f]:s}}}}}},yr=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=mt(e,t),u={x:n,y:r},d=yt(i),f=_t(d),p=u[f],m=u[d],h=mt(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;pn&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=hr.has(ht(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);mr&&(m=r)}return{[f]:p,[d]:m}}}},br=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){var n,r;let{placement:i,rects:a,platform:o,elements:s}=t,{apply:c=()=>{},...l}=mt(e,t),u=await o.detectOverflow(t,l),d=ht(i),f=gt(i),p=yt(i)===`y`,{width:m,height:h}=a.floating,g,_;d===`top`||d===`bottom`?(g=d,_=f===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?`start`:`end`)?`left`:`right`):(_=d,g=f===`end`?`top`:`bottom`);let v=h-u.top-u.bottom,y=m-u.left-u.right,b=st(h-u[g],v),x=st(m-u[_],y),S=!t.middlewareData.shift,C=b,w=x;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(w=y),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(C=v),S&&!f){let e=ct(u.left,0),t=ct(u.right,0),n=ct(u.top,0),r=ct(u.bottom,0);p?w=m-2*(e!==0||t!==0?e+t:ct(u.left,u.right)):C=h-2*(n!==0||r!==0?n+r:ct(u.top,u.bottom))}await c({...t,availableWidth:w,availableHeight:C});let T=await o.getDimensions(s.floating);return m!==T.width||h!==T.height?{reset:{rects:!0}}:{}}}};function xr(e){let t=G(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=W(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=lt(n)!==a||lt(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function Sr(e){return U(e)?e:e.contextElement}function Cr(e){let t=Sr(e);if(!W(t))return dt(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=xr(t),o=(a?lt(n.width):n.width)/r,s=(a?lt(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var wr=dt(0);function Tr(e){let t=H(e);return!Ze()||!t.visualViewport?wr:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Er(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==H(e)?!1:t}function Dr(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=Sr(e),o=dt(1);t&&(r?U(r)&&(o=Cr(r)):o=Cr(e));let s=Er(a,n,r)?Tr(a):dt(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a){let e=H(a),t=r&&U(r)?H(r):r,n=e,i=rt(n);for(;i&&r&&t!==n;){let e=Cr(i),t=i.getBoundingClientRect(),r=G(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=H(i),i=rt(n)}}return Nt({width:u,height:d,x:c,y:l})}function Or(e,t){let n=$e(e).scrollLeft;return t?t.left+n:Dr(ze(e)).left+n}function kr(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Or(e,n),y:n.top+t.scrollTop}}function Ar(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=ze(r),s=t?We(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=dt(1),u=dt(0),d=W(r);if((d||!d&&!a)&&((Re(r)!==`body`||He(o))&&(c=$e(r)),d)){let e=Dr(r);l=Cr(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?kr(o,c):dt(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function jr(e){return Array.from(e.getClientRects())}function Mr(e){let t=ze(e),n=$e(e),r=e.ownerDocument.body,i=ct(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=ct(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+Or(e),s=-n.scrollTop;return G(r).direction===`rtl`&&(o+=ct(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}var Nr=25;function Pr(e,t){let n=H(e),r=ze(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=Ze();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=Or(r);if(l<=0){let e=r.ownerDocument,t=e.body,n=getComputedStyle(t),i=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,o=Math.abs(r.clientWidth-t.clientWidth-i);o<=Nr&&(a-=o)}else l<=Nr&&(a+=l);return{width:a,height:o,x:s,y:c}}function Fr(e,t){let n=Dr(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=W(e)?Cr(e):dt(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function Ir(e,t,n){let r;if(t===`viewport`)r=Pr(e,n);else if(t===`document`)r=Mr(ze(e));else if(U(t))r=Fr(t,n);else{let n=Tr(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return Nt(r)}function Lr(e,t){let n=et(e);return n===t||!U(n)||Qe(n)?!1:G(n).position===`fixed`||Lr(n,t)}function Rr(e,t){let n=t.get(e);if(n)return n;let r=nt(e,[],!1).filter(e=>U(e)&&Re(e)!==`body`),i=null,a=G(e).position===`fixed`,o=a?et(e):e;for(;U(o)&&!Qe(o);){let t=G(o),n=Ye(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&(i.position===`absolute`||i.position===`fixed`)||He(o)&&!n&&Lr(e,o))?r=r.filter(e=>e!==o):i=t,o=et(o)}return t.set(e,r),r}function zr(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?We(t)?[]:Rr(t,this._c):[].concat(n),r],o=Ir(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e{o(!1,1e-7)},1e3)}n===1&&!Jr(l,e.getBoundingClientRect())&&o(),y=!1}try{n=new IntersectionObserver(b,{...v,root:i.ownerDocument})}catch{n=new IntersectionObserver(b,v)}n.observe(e)}return o(!0),a}function Xr(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=Sr(e),u=i||a?[...l?nt(l):[],...t?nt(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n,{passive:!0}),a&&e.addEventListener(`resize`,n)});let d=l&&s?Yr(l,n):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?Dr(e):null;c&&g();function g(){let t=Dr(e);h&&!Jr(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var Zr=_r,Qr=ur,$r=vr,ei=dr,ti=br,ni=mr,ri=cr,ii=yr,ai=(e,t,n)=>{let r=new Map,i={platform:qr,...n},a={...i.platform,_c:r};return sr(e,t,{...i,platform:a})},oi=e(rr(),1),si=typeof document<`u`?l.useLayoutEffect:function(){};function ci(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,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!ci(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!ci(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function li(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function ui(e,t){let n=li(e);return Math.round(t*n)/n}function di(e){let t=l.useRef(e);return si(()=>{t.current=e}),t}function fi(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:u}=e,[d,f]=l.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,m]=l.useState(r);ci(p,r)||m(r);let[h,g]=l.useState(null),[_,v]=l.useState(null),y=l.useCallback(e=>{e!==C.current&&(C.current=e,g(e))},[]),b=l.useCallback(e=>{e!==w.current&&(w.current=e,v(e))},[]),x=a||h,S=o||_,C=l.useRef(null),w=l.useRef(null),T=l.useRef(d),E=c!=null,D=di(c),O=di(i),k=di(u),A=l.useCallback(()=>{if(!C.current||!w.current)return;let e={placement:t,strategy:n,middleware:p};O.current&&(e.platform=O.current),ai(C.current,w.current,e).then(e=>{let t={...e,isPositioned:k.current!==!1};j.current&&!ci(T.current,t)&&(T.current=t,oi.flushSync(()=>{f(t)}))})},[p,t,n,O,k]);si(()=>{u===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,f(e=>({...e,isPositioned:!1})))},[u]);let j=l.useRef(!1);si(()=>(j.current=!0,()=>{j.current=!1}),[]),si(()=>{if(x&&(C.current=x),S&&(w.current=S),x&&S){if(D.current)return D.current(x,S,A);A()}},[x,S,A,D,E]);let M=l.useMemo(()=>({reference:C,floating:w,setReference:y,setFloating:b}),[y,b]),N=l.useMemo(()=>({reference:x,floating:S}),[x,S]),P=l.useMemo(()=>{let e={position:n,left:0,top:0};if(!N.floating)return e;let t=ui(N.floating,d.x),r=ui(N.floating,d.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...li(N.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,N.floating,d.x,d.y]);return l.useMemo(()=>({...d,update:A,refs:M,elements:N,floatingStyles:P}),[d,A,M,N,P])}var pi=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:ri({element:r.current,padding:i}).fn(n):r?ri({element:r,padding:i}).fn(n):{}}}},mi=(e,t)=>{let n=Zr(e);return{name:n.name,fn:n.fn,options:[e,t]}},hi=(e,t)=>{let n=$r(e);return{name:n.name,fn:n.fn,options:[e,t]}},gi=(e,t)=>({fn:ii(e).fn,options:[e,t]}),_i=(e,t)=>{let n=ei(e);return{name:n.name,fn:n.fn,options:[e,t]}},vi=(e,t)=>{let n=ti(e);return{name:n.name,fn:n.fn,options:[e,t]}},yi=(e,t)=>{let n=Qr(e);return{name:n.name,fn:n.fn,options:[e,t]}},bi=(e,t)=>{let n=ni(e);return{name:n.name,fn:n.fn,options:[e,t]}},xi=(e,t)=>{let n=pi(e);return{name:n.name,fn:n.fn,options:[e,t]}};function Si(e,t){let n=e.compareDocumentPosition(t);return n&Node.DOCUMENT_POSITION_FOLLOWING||n&Node.DOCUMENT_POSITION_CONTAINED_BY?-1:n&Node.DOCUMENT_POSITION_PRECEDING||n&Node.DOCUMENT_POSITION_CONTAINS?1:0}var Ci=l.createContext({register:()=>{},unregister:()=>{},map:new Map,elementsRef:{current:[]}});function wi(e){let{children:t,elementsRef:n,labelsRef:r}=e,[i,a]=l.useState(()=>new Set),o=l.useCallback(e=>{a(t=>new Set(t).add(e))},[]),s=l.useCallback(e=>{a(t=>{let n=new Set(t);return n.delete(e),n})},[]),c=l.useMemo(()=>{let e=new Map;return Array.from(i.keys()).sort(Si).forEach((t,n)=>{e.set(t,n)}),e},[i]);return(0,V.jsx)(Ci.Provider,{value:l.useMemo(()=>({register:o,unregister:s,map:c,elementsRef:n,labelsRef:r}),[o,s,c,n,r]),children:t})}function Ti(e){e===void 0&&(e={});let{label:t}=e,{register:n,unregister:r,map:i,elementsRef:a,labelsRef:o}=l.useContext(Ci),[s,c]=l.useState(null),u=l.useRef(null),d=l.useCallback(e=>{if(u.current=e,s!==null&&(a.current[s]=e,o)){let n=t!==void 0;o.current[s]=n?t:e?.textContent??null}},[s,a,o,t]);return Y(()=>{let e=u.current;if(e)return n(e),()=>{r(e)}},[n,r]),Y(()=>{let e=u.current?i.get(u.current):null;e!=null&&c(e)},[i]),l.useMemo(()=>({ref:d,index:s??-1}),[s,d])}var Ei=`data-floating-ui-focusable`,Di=`active`,Oi=`selected`,ki=`ArrowLeft`,Ai=`ArrowRight`,ji=`ArrowUp`,Mi=`ArrowDown`,Ni=[ki,Ai],Pi=[ji,Mi];[...Ni,...Pi];var Fi={...l},Ii=!1,Li=0,Ri=()=>`floating-ui-`+Math.random().toString(36).slice(2,6)+ Li++;function zi(){let[e,t]=l.useState(()=>Ii?Ri():void 0);return Y(()=>{e??t(Ri())},[]),l.useEffect(()=>{Ii=!0},[]),e}var Bi=Fi.useId||zi,Vi=l.forwardRef(function(e,t){let{context:{placement:n,elements:{floating:r},middlewareData:{arrow:i,shift:a}},width:o=14,height:s=7,tipRadius:c=0,strokeWidth:u=0,staticOffset:d,stroke:f,d:p,style:{transform:m,...h}={},...g}=e,_=Bi(),[v,y]=l.useState(!1);if(Y(()=>{r&&G(r).direction===`rtl`&&y(!0)},[r]),!r)return null;let[b,x]=n.split(`-`),S=b===`top`||b===`bottom`,C=d;(S&&a!=null&&a.x||!S&&a!=null&&a.y)&&(C=null);let w=u*2,T=w/2,E=o/2*(c/-8+1),D=s/2*c/4,O=!!p,k=C&&x===`end`?`bottom`:`top`,A=C&&x===`end`?`right`:`left`;C&&v&&(A=x===`end`?`left`:`right`);let j=i?.x==null?``:C||i.x,M=i?.y==null?``:C||i.y,N=p||`M0,0`+(` H`+o)+(` L`+(o-E)+`,`+(s-D))+(` Q`+o/2+`,`+s+` `+E+`,`+(s-D))+` Z`,P={top:O?`rotate(180deg)`:``,left:O?`rotate(90deg)`:`rotate(-90deg)`,bottom:O?``:`rotate(180deg)`,right:O?`rotate(-90deg)`:`rotate(90deg)`}[b];return(0,V.jsxs)(`svg`,{...g,"aria-hidden":!0,ref:t,width:O?o:o+w,height:o,viewBox:`0 0 `+o+` `+(s>o?s:o),style:{position:`absolute`,pointerEvents:`none`,[A]:j,[k]:M,[b]:S||O?`100%`:`calc(100% - `+w/2+`px)`,transform:[P,m].filter(e=>!!e).join(` `),...h},children:[w>0&&(0,V.jsx)(`path`,{clipPath:`url(#`+_+`)`,fill:`none`,stroke:f,strokeWidth:w+(p?0:1),d:N}),(0,V.jsx)(`path`,{stroke:w&&!p?g.fill:`none`,d:N}),(0,V.jsx)(`clipPath`,{id:_,children:(0,V.jsx)(`rect`,{x:-T,y:T*(O?-1:1),width:o+w,height:o})})]})});function Hi(){let e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(e=>e(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){var r;(r=e.get(t))==null||r.delete(n)}}}var Ui=l.createContext(null),Wi=l.createContext(null),Gi=()=>l.useContext(Ui)?.id||null,Ki=()=>l.useContext(Wi);function qi(e){let t=Bi(),n=Ki(),r=Gi(),i=e||r;return Y(()=>{if(!t)return;let e={id:t,parentId:i};return n?.addNode(e),()=>{n?.removeNode(e)}},[n,t,i]),t}function Ji(e){let{children:t,id:n}=e,r=Gi();return(0,V.jsx)(Ui.Provider,{value:l.useMemo(()=>({id:n,parentId:r}),[n,r]),children:t})}function Yi(e){let{children:t}=e,n=l.useRef([]),r=l.useCallback(e=>{n.current=[...n.current,e]},[]),i=l.useCallback(e=>{n.current=n.current.filter(t=>t!==e)},[]),[a]=l.useState(()=>Hi());return(0,V.jsx)(Wi.Provider,{value:l.useMemo(()=>({nodesRef:n,addNode:r,removeNode:i,events:a}),[r,i,a]),children:t})}function Xi(e){return`data-floating-ui-`+e}function $(e){e.current!==-1&&(clearTimeout(e.current),e.current=-1)}var Zi=Xi(`safe-polygon`);function Qi(e,t,n){if(n&&!Ln(n))return 0;if(typeof e==`number`)return e;if(typeof e==`function`){let n=e();return typeof n==`number`?n:n?.[t]}return e?.[t]}function $i(e){return typeof e==`function`?e():e}function ea(e,t){t===void 0&&(t={});let{open:n,onOpenChange:r,dataRef:i,events:a,elements:o}=e,{enabled:s=!0,delay:c=0,handleClose:u=null,mouseOnly:d=!1,restMs:f=0,move:p=!0}=t,m=Ki(),h=Gi(),g=X(u),_=X(c),v=X(n),y=X(f),b=l.useRef(),x=l.useRef(-1),S=l.useRef(),C=l.useRef(-1),w=l.useRef(!0),T=l.useRef(!1),E=l.useRef(()=>{}),D=l.useRef(!1),O=Z(()=>{let e=i.current.openEvent?.type;return e?.includes(`mouse`)&&e!==`mousedown`});l.useEffect(()=>{if(!s)return;function e(e){let{open:t}=e;t||($(x),$(C),w.current=!0,D.current=!1)}return a.on(`openchange`,e),()=>{a.off(`openchange`,e)}},[s,a]),l.useEffect(()=>{if(!s||!g.current||!n)return;function e(e){O()&&r(!1,e,`hover`)}let t=q(o.floating).documentElement;return t.addEventListener(`mouseleave`,e),()=>{t.removeEventListener(`mouseleave`,e)}},[o.floating,n,r,s,g,O]);let k=l.useCallback(function(e,t,n){t===void 0&&(t=!0),n===void 0&&(n=`hover`);let i=Qi(_.current,`close`,b.current);i&&!S.current?($(x),x.current=window.setTimeout(()=>r(!1,e,n),i)):t&&($(x),r(!1,e,n))},[_,r]),A=Z(()=>{E.current(),S.current=void 0}),j=Z(()=>{if(T.current){let e=q(o.floating).body;e.style.pointerEvents=``,e.removeAttribute(Zi),T.current=!1}}),M=Z(()=>i.current.openEvent?[`click`,`mousedown`].includes(i.current.openEvent.type):!1);l.useEffect(()=>{if(!s)return;function e(e){if($(x),w.current=!1,d&&!Ln(b.current)||$i(y.current)>0&&!Qi(_.current,`open`))return;let t=Qi(_.current,`open`,b.current);t?x.current=window.setTimeout(()=>{v.current||r(!0,e,`hover`)},t):n||r(!0,e,`hover`)}function t(e){if(M()){j();return}E.current();let t=q(o.floating);if($(C),D.current=!1,g.current&&i.current.floatingContext){n||$(x),S.current=g.current({...i.current.floatingContext,tree:m,x:e.clientX,y:e.clientY,onClose(){j(),A(),M()||k(e,!0,`safe-polygon`)}});let r=S.current;t.addEventListener(`mousemove`,r),E.current=()=>{t.removeEventListener(`mousemove`,r)};return}(b.current!==`touch`||!K(o.floating,e.relatedTarget))&&k(e)}function a(e){M()||i.current.floatingContext&&(g.current==null||g.current({...i.current.floatingContext,tree:m,x:e.clientX,y:e.clientY,onClose(){j(),A(),M()||k(e)}})(e))}function c(){$(x)}function l(e){M()||k(e,!1)}if(U(o.domReference)){let r=o.domReference,i=o.floating;return n&&r.addEventListener(`mouseleave`,a),p&&r.addEventListener(`mousemove`,e,{once:!0}),r.addEventListener(`mouseenter`,e),r.addEventListener(`mouseleave`,t),i&&(i.addEventListener(`mouseleave`,a),i.addEventListener(`mouseenter`,c),i.addEventListener(`mouseleave`,l)),()=>{n&&r.removeEventListener(`mouseleave`,a),p&&r.removeEventListener(`mousemove`,e),r.removeEventListener(`mouseenter`,e),r.removeEventListener(`mouseleave`,t),i&&(i.removeEventListener(`mouseleave`,a),i.removeEventListener(`mouseenter`,c),i.removeEventListener(`mouseleave`,l))}}},[o,s,e,d,p,k,A,j,r,n,v,m,_,g,i,M,y]),Y(()=>{var e;if(s&&n&&(e=g.current)!=null&&(e=e.__options)!=null&&e.blockPointerEvents&&O()){T.current=!0;let e=o.floating;if(U(o.domReference)&&e){var t;let n=q(o.floating).body;n.setAttribute(Zi,``);let r=o.domReference,i=m==null||(t=m.nodesRef.current.find(e=>e.id===h))==null||(t=t.context)==null?void 0:t.elements.floating;return i&&(i.style.pointerEvents=``),n.style.pointerEvents=`none`,r.style.pointerEvents=`auto`,e.style.pointerEvents=`auto`,()=>{n.style.pointerEvents=``,r.style.pointerEvents=``,e.style.pointerEvents=``}}}},[s,n,h,o,m,g,O]),Y(()=>{n||(b.current=void 0,D.current=!1,A(),j())},[n,A,j]),l.useEffect(()=>()=>{A(),$(x),$(C),j()},[s,o.domReference,A,j]);let N=l.useMemo(()=>{function e(e){b.current=e.pointerType}return{onPointerDown:e,onPointerEnter:e,onMouseMove(e){let{nativeEvent:t}=e;function i(){!w.current&&!v.current&&r(!0,t,`hover`)}d&&!Ln(b.current)||n||$i(y.current)===0||D.current&&e.movementX**2+e.movementY**2<2||($(C),b.current===`touch`?i():(D.current=!0,C.current=window.setTimeout(i,$i(y.current))))}}},[d,r,n,v,y]);return l.useMemo(()=>s?{reference:N}:{},[s,N])}var ta=0;function na(e,t){t===void 0&&(t={});let{preventScroll:n=!1,cancelPrevious:r=!0,sync:i=!1}=t;r&&cancelAnimationFrame(ta);let a=()=>e?.focus({preventScroll:n});i?a():ta=requestAnimationFrame(a)}function ra(e,t){if(!e||!t)return!1;let n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&Ve(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function ia(e){return`composedPath`in e?e.composedPath()[0]:e.target}function aa(e){return e?.ownerDocument||document}var oa={inert:new WeakMap,"aria-hidden":new WeakMap,none:new WeakMap};function sa(e){return e===`inert`?oa.inert:e===`aria-hidden`?oa[`aria-hidden`]:oa.none}var ca=new WeakSet,la={},ua=0,da=()=>typeof HTMLElement<`u`&&`inert`in HTMLElement.prototype,fa=e=>e&&(e.host||fa(e.parentNode)),pa=(e,t)=>t.map(t=>{if(e.contains(t))return t;let n=fa(t);return e.contains(n)?n:null}).filter(e=>e!=null);function ma(e,t,n,r){let i=`data-floating-ui-inert`,a=r?`inert`:n?`aria-hidden`:null,o=pa(t,e),s=new Set,c=new Set(o),l=[];la[i]||(la[i]=new WeakMap);let u=la[i];o.forEach(d),f(t),s.clear();function d(e){!e||s.has(e)||(s.add(e),e.parentNode&&d(e.parentNode))}function f(e){!e||c.has(e)||[].forEach.call(e.children,e=>{if(Re(e)!==`script`)if(s.has(e))f(e);else{let t=a?e.getAttribute(a):null,n=t!==null&&t!==`false`,r=sa(a),o=(r.get(e)||0)+1,s=(u.get(e)||0)+1;r.set(e,o),u.set(e,s),l.push(e),o===1&&n&&ca.add(e),s===1&&e.setAttribute(i,``),!n&&a&&e.setAttribute(a,a===`inert`?``:`true`)}})}return ua++,()=>{l.forEach(e=>{let t=sa(a),n=(t.get(e)||0)-1,r=(u.get(e)||0)-1;t.set(e,n),u.set(e,r),n||(!ca.has(e)&&a&&e.removeAttribute(a),ca.delete(e)),r||e.removeAttribute(i)}),ua--,ua||(oa.inert=new WeakMap,oa[`aria-hidden`]=new WeakMap,oa.none=new WeakMap,ca=new WeakSet,la={})}}function ha(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);let r=aa(e[0]).body;return ma(e.concat(Array.from(r.querySelectorAll(`[aria-live],[role="status"],output`))),r,t,n)}var ga={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},_a=l.forwardRef(function(e,t){let[n,r]=l.useState();Y(()=>{pn()&&r(`button`)},[]);let i={ref:t,tabIndex:0,role:n,"aria-hidden":n?void 0:!0,[Xi(`focus-guard`)]:``,style:ga};return(0,V.jsx)(`span`,{...e,...i})}),va={clipPath:`inset(50%)`,position:`fixed`,top:0,left:0},ya=l.createContext(null),ba=Xi(`portal`);function xa(e){e===void 0&&(e={});let{id:t,root:n}=e,r=Bi(),i=Ca(),[a,o]=l.useState(null),s=l.useRef(null);return Y(()=>()=>{a?.remove(),queueMicrotask(()=>{s.current=null})},[a]),Y(()=>{if(!r||s.current)return;let e=t?document.getElementById(t):null;if(!e)return;let n=document.createElement(`div`);n.id=r,n.setAttribute(ba,``),e.appendChild(n),s.current=n,o(n)},[t,r]),Y(()=>{if(n===null||!r||s.current)return;let e=n||i?.portalNode;e&&!Be(e)&&(e=e.current),e||=document.body;let a=null;t&&(a=document.createElement(`div`),a.id=t,e.appendChild(a));let c=document.createElement(`div`);c.id=r,c.setAttribute(ba,``),e=a||e,e.appendChild(c),s.current=c,o(c)},[t,n,r,i]),a}function Sa(e){let{children:t,id:n,root:r,preserveTabOrder:i=!0}=e,a=xa({id:n,root:r}),[o,s]=l.useState(null),c=l.useRef(null),u=l.useRef(null),d=l.useRef(null),f=l.useRef(null),p=o?.modal,m=o?.open,h=!!o&&!o.modal&&o.open&&i&&!!(r||a);return l.useEffect(()=>{if(!a||!i||p)return;function e(e){a&&$n(e)&&(e.type===`focusin`?tr:er)(a)}return a.addEventListener(`focusin`,e,!0),a.addEventListener(`focusout`,e,!0),()=>{a.removeEventListener(`focusin`,e,!0),a.removeEventListener(`focusout`,e,!0)}},[a,i,p]),l.useEffect(()=>{a&&(m||tr(a))},[m,a]),(0,V.jsxs)(ya.Provider,{value:l.useMemo(()=>({preserveTabOrder:i,beforeOutsideRef:c,afterOutsideRef:u,beforeInsideRef:d,afterInsideRef:f,portalNode:a,setFocusManagerState:s}),[i,a]),children:[h&&a&&(0,V.jsx)(_a,{"data-type":`outside`,ref:c,onFocus:e=>{if($n(e,a)){var t;(t=d.current)==null||t.focus()}else Qn(o?o.domReference:null)?.focus()}}),h&&a&&(0,V.jsx)(`span`,{"aria-owns":a.id,style:va}),a&&oi.createPortal(t,a),h&&a&&(0,V.jsx)(_a,{"data-type":`outside`,ref:u,onFocus:e=>{if($n(e,a)){var t;(t=f.current)==null||t.focus()}else Zn(o?o.domReference:null)?.focus(),o!=null&&o.closeOnFocusOut&&o?.onOpenChange(!1,e.nativeEvent,`focus-out`)}})]})}var Ca=()=>l.useContext(ya);function wa(e){return l.useMemo(()=>t=>{e.forEach(e=>{e&&(e.current=t)})},e)}var Ta=20,Ea=[];function Da(){Ea=Ea.filter(e=>e.deref()?.isConnected)}function Oa(e){Da(),e&&Re(e)!==`body`&&(Ea.push(new WeakRef(e)),Ea.length>Ta&&(Ea=Ea.slice(-20)))}function ka(){return Da(),Ea[Ea.length-1]?.deref()}function Aa(e){let t=Yn();return un(e,t)?e:cn(e,t)[0]||e}function ja(e,t){var n;if(!t.current.includes(`floating`)&&!((n=e.getAttribute(`role`))!=null&&n.includes(`dialog`)))return;let r=Yn(),i=ln(e,r).filter(e=>{let t=e.getAttribute(`data-tabindex`)||``;return un(e,r)||e.hasAttribute(`data-tabindex`)&&!t.startsWith(`-`)}),a=e.getAttribute(`tabindex`);t.current.includes(`floating`)||i.length===0?a!==`0`&&e.setAttribute(`tabindex`,`0`):(a!==`-1`||e.hasAttribute(`data-tabindex`)&&e.getAttribute(`data-tabindex`)!==`-1`)&&(e.setAttribute(`tabindex`,`-1`),e.setAttribute(`data-tabindex`,`-1`))}var Ma=l.forwardRef(function(e,t){return(0,V.jsx)(`button`,{...e,type:`button`,ref:t,tabIndex:-1,style:ga})});function Na(e){let{context:t,children:n,disabled:r=!1,order:i=[`content`],guards:a=!0,initialFocus:o=0,returnFocus:s=!0,restoreFocus:c=!1,modal:u=!0,visuallyHiddenDismiss:d=!1,closeOnFocusOut:f=!0,outsideElementsInert:p=!1,getInsideElements:m=()=>[]}=e,{open:h,onOpenChange:g,events:_,dataRef:v,elements:{domReference:y,floating:b}}=t,x=Z(()=>v.current.floatingContext?.nodeId),S=Z(m),C=typeof o==`number`&&o<0,w=On(y)&&C,T=da(),E=T?a:!0,D=!E||T&&p,O=X(i),k=X(o),A=X(s),j=Ki(),M=Ca(),N=l.useRef(null),P=l.useRef(null),F=l.useRef(!1),ee=l.useRef(!1),te=l.useRef(-1),ne=l.useRef(-1),re=M!=null,I=An(b),L=Z(function(e){return e===void 0&&(e=I),e?cn(e,Yn()):[]}),ie=Z(e=>{let t=L(e);return O.current.map(e=>y&&e===`reference`?y:I&&e===`floating`?I:t).filter(Boolean).flat()});l.useEffect(()=>{if(r||!u)return;function e(e){if(e.key===`Tab`){K(I,Cn(q(I)))&&L().length===0&&!w&&J(e);let t=ie(),n=wn(e);O.current[0]===`reference`&&n===y&&(J(e),e.shiftKey?na(t[t.length-1]):na(t[1])),O.current[1]===`floating`&&n===I&&e.shiftKey&&(J(e),na(t[0]))}}let t=q(I);return t.addEventListener(`keydown`,e),()=>{t.removeEventListener(`keydown`,e)}},[r,y,I,u,O,w,L,ie]),l.useEffect(()=>{if(r||!b)return;function e(e){let t=wn(e),n=L().indexOf(t);n!==-1&&(te.current=n)}return b.addEventListener(`focusin`,e),()=>{b.removeEventListener(`focusin`,e)}},[r,b,L]),l.useEffect(()=>{if(r||!f)return;function e(){ee.current=!0,setTimeout(()=>{ee.current=!1})}function t(e){let t=e.relatedTarget,n=e.currentTarget,r=wn(e);queueMicrotask(()=>{let i=x(),a=!(K(y,t)||K(b,t)||K(t,b)||K(M?.portalNode,t)||t!=null&&t.hasAttribute(Xi(`focus-guard`))||j&&(jn(j.nodesRef.current,i).find(e=>K(e.context?.elements.floating,t)||K(e.context?.elements.domReference,t))||Nn(j.nodesRef.current,i).find(e=>[e.context?.elements.floating,An(e.context?.elements.floating)].includes(t)||e.context?.elements.domReference===t)));if(n===y&&I&&ja(I,O),c&&n!==y&&!(r!=null&&r.isConnected)&&Cn(q(I))===q(I).body){W(I)&&I.focus();let e=te.current,t=L(),n=t[e]||t[t.length-1]||I;W(n)&&n.focus()}if(v.current.insideReactTree){v.current.insideReactTree=!1;return}(w||!u)&&t&&a&&!ee.current&&t!==ka()&&(F.current=!0,g(!1,e,`focus-out`))})}let n=!!(!j&&M);function i(){$(ne),v.current.insideReactTree=!0,ne.current=window.setTimeout(()=>{v.current.insideReactTree=!1})}if(b&&W(y))return y.addEventListener(`focusout`,t),y.addEventListener(`pointerdown`,e),b.addEventListener(`focusout`,t),n&&b.addEventListener(`focusout`,i,!0),()=>{y.removeEventListener(`focusout`,t),y.removeEventListener(`pointerdown`,e),b.removeEventListener(`focusout`,t),n&&b.removeEventListener(`focusout`,i,!0)}},[r,y,b,I,u,j,M,g,f,c,L,w,x,O,v]);let ae=l.useRef(null),R=l.useRef(null),z=wa([ae,M?.beforeInsideRef]),B=wa([R,M?.afterInsideRef]);l.useEffect(()=>{var e,t;if(r||!b)return;let n=Array.from((M==null||(e=M.portalNode)==null?void 0:e.querySelectorAll(`[`+Xi(`portal`)+`]`))||[]),i=[b,(t=(j?Nn(j.nodesRef.current,x()):[]).find(e=>On(e.context?.elements.domReference||null)))==null||(t=t.context)==null?void 0:t.elements.domReference,...n,...S(),N.current,P.current,ae.current,R.current,M?.beforeOutsideRef.current,M?.afterOutsideRef.current,O.current.includes(`reference`)||w?y:null].filter(e=>e!=null),a=u||w?ha(i,!D,D):ha(i);return()=>{a()}},[r,y,b,u,O,M,w,E,D,j,x,S]),Y(()=>{if(r||!W(I))return;let e=Cn(q(I));queueMicrotask(()=>{let t=ie(I),n=k.current,r=(typeof n==`number`?t[n]:n.current)||I,i=K(I,e);!C&&!i&&h&&na(r,{preventScroll:r===I})})},[r,h,I,C,ie,k]),Y(()=>{if(r||!I)return;let e=q(I);Oa(Cn(e));function t(e){let{reason:t,event:n,nested:r}=e;if([`hover`,`safe-polygon`].includes(t)&&n.type===`mouseleave`&&(F.current=!0),t===`outside-press`)if(r)F.current=!1;else if(Fn(n)||In(n))F.current=!1;else{let e=!1;document.createElement(`div`).focus({get preventScroll(){return e=!0,!1}}),e?F.current=!1:F.current=!0}}_.on(`openchange`,t);let n=e.createElement(`span`);n.setAttribute(`tabindex`,`-1`),n.setAttribute(`aria-hidden`,`true`),Object.assign(n.style,ga),re&&y&&y.insertAdjacentElement(`afterend`,n);function i(){if(typeof A.current==`boolean`){let e=y||ka();return e&&e.isConnected?e:n}return A.current.current||n}return()=>{_.off(`openchange`,t);let r=Cn(e),a=K(b,r)||j&&jn(j.nodesRef.current,x(),!1).some(e=>K(e.context?.elements.floating,r)),o=i();queueMicrotask(()=>{let t=Aa(o);A.current&&!F.current&&W(t)&&(!(t!==r&&r!==e.body)||a)&&t.focus({preventScroll:!0}),n.remove()})}},[r,b,I,A,v,_,j,re,y,x]),l.useEffect(()=>(queueMicrotask(()=>{F.current=!1}),()=>{queueMicrotask(Da)}),[r]),Y(()=>{if(!r&&M)return M.setFocusManagerState({modal:u,closeOnFocusOut:f,open:h,onOpenChange:g,domReference:y}),()=>{M.setFocusManagerState(null)}},[r,M,u,h,g,f,y]),Y(()=>{r||I&&ja(I,O)},[r,I,O]);function oe(e){return r||!d||!u?null:(0,V.jsx)(Ma,{ref:e===`start`?N:P,onClick:e=>g(!1,e.nativeEvent),children:typeof d==`string`?d:`Dismiss`})}let se=!r&&E&&(u?!w:!0)&&(re||u);return(0,V.jsxs)(V.Fragment,{children:[se&&(0,V.jsx)(_a,{"data-type":`inside`,ref:z,onFocus:e=>{if(u){let e=ie();na(i[0]===`reference`?e[0]:e[e.length-1])}else if(M!=null&&M.preserveTabOrder&&M.portalNode)if(F.current=!1,$n(e,M.portalNode))Zn(y)?.focus();else{var t;(t=M.beforeOutsideRef.current)==null||t.focus()}}}),!w&&oe(`start`),n,oe(`end`),se&&(0,V.jsx)(_a,{"data-type":`inside`,ref:B,onFocus:e=>{if(u)na(ie()[0]);else if(M!=null&&M.preserveTabOrder&&M.portalNode)if(f&&(F.current=!0),$n(e,M.portalNode))Qn(y)?.focus();else{var t;(t=M.afterOutsideRef.current)==null||t.focus()}}})]})}var Pa=0,Fa=`--floating-ui-scrollbar-width`;function Ia(){let e=dn(),t=/iP(hone|ad|od)|iOS/.test(e)||e===`MacIntel`&&navigator.maxTouchPoints>1,n=document.body.style,r=Math.round(document.documentElement.getBoundingClientRect().left)+document.documentElement.scrollLeft?`paddingLeft`:`paddingRight`,i=window.innerWidth-document.documentElement.clientWidth,a=n.left?parseFloat(n.left):window.scrollX,o=n.top?parseFloat(n.top):window.scrollY;if(n.overflow=`hidden`,n.setProperty(Fa,i+`px`),i&&(n[r]=i+`px`),t){let e=window.visualViewport?.offsetLeft||0,t=window.visualViewport?.offsetTop||0;Object.assign(n,{position:`fixed`,top:-(o-Math.floor(t))+`px`,left:-(a-Math.floor(e))+`px`,right:`0`})}return()=>{Object.assign(n,{overflow:``,[r]:``}),n.removeProperty(Fa),t&&(Object.assign(n,{position:``,top:``,left:``,right:``}),window.scrollTo(a,o))}}var La=()=>{},Ra=l.forwardRef(function(e,t){let{lockScroll:n=!1,...r}=e;return Y(()=>{if(n)return Pa++,Pa===1&&(La=Ia()),()=>{Pa--,Pa===0&&La()}},[n]),(0,V.jsx)(`div`,{ref:t,...r,style:{position:`fixed`,overflow:`auto`,top:0,right:0,bottom:0,left:0,...r.style}})});function za(e){return W(e.target)&&e.target.tagName===`BUTTON`}function Ba(e){return W(e.target)&&e.target.tagName===`A`}function Va(e){return Dn(e)}function Ha(e,t){t===void 0&&(t={});let{open:n,onOpenChange:r,dataRef:i,elements:{domReference:a}}=e,{enabled:o=!0,event:s=`click`,toggle:c=!0,ignoreMouse:u=!1,keyboardHandlers:d=!0,stickIfOpen:f=!0}=t,p=l.useRef(),m=l.useRef(!1),h=l.useMemo(()=>({onPointerDown(e){p.current=e.pointerType},onMouseDown(e){let t=p.current;e.button===0&&s!==`click`&&(Ln(t,!0)&&u||(n&&c&&(!(i.current.openEvent&&f)||i.current.openEvent.type===`mousedown`)?r(!1,e.nativeEvent,`click`):(e.preventDefault(),r(!0,e.nativeEvent,`click`))))},onClick(e){let t=p.current;if(s===`mousedown`&&p.current){p.current=void 0;return}Ln(t,!0)&&u||(n&&c&&(!(i.current.openEvent&&f)||i.current.openEvent.type===`click`)?r(!1,e.nativeEvent,`click`):r(!0,e.nativeEvent,`click`))},onKeyDown(e){p.current=void 0,!(e.defaultPrevented||!d||za(e))&&(e.key===` `&&!Va(a)&&(e.preventDefault(),m.current=!0),!Ba(e)&&e.key===`Enter`&&r(!(n&&c),e.nativeEvent,`click`))},onKeyUp(e){e.defaultPrevented||!d||za(e)||Va(a)||e.key===` `&&m.current&&(m.current=!1,r(!(n&&c),e.nativeEvent,`click`))}}),[i,a,s,u,d,r,n,f,c]);return l.useMemo(()=>o?{reference:h}:{},[o,h])}function Ua(e,t){let n=null,r=null,i=!1;return{contextElement:e||void 0,getBoundingClientRect(){let a=e?.getBoundingClientRect()||{width:0,height:0,x:0,y:0},o=t.axis===`x`||t.axis===`both`,s=t.axis===`y`||t.axis===`both`,c=[`mouseenter`,`mousemove`].includes(t.dataRef.current.openEvent?.type||``)&&t.pointerType!==`touch`,l=a.width,u=a.height,d=a.x,f=a.y;return n==null&&t.x&&o&&(n=a.x-t.x),r==null&&t.y&&s&&(r=a.y-t.y),d-=n||0,f-=r||0,l=0,u=0,!i||c?(l=t.axis===`y`?a.width:0,u=t.axis===`x`?a.height:0,d=o&&t.x!=null?t.x:d,f=s&&t.y!=null?t.y:f):i&&!c&&(u=t.axis===`x`?a.height:u,l=t.axis===`y`?a.width:l),i=!0,{width:l,height:u,x:d,y:f,top:f,right:d+l,bottom:f+u,left:d}}}}function Wa(e){return e!=null&&e.clientX!=null}function Ga(e,t){t===void 0&&(t={});let{open:n,dataRef:r,elements:{floating:i,domReference:a},refs:o}=e,{enabled:s=!0,axis:c=`both`,x:u=null,y:d=null}=t,f=l.useRef(!1),p=l.useRef(null),[m,h]=l.useState(),[g,_]=l.useState([]),v=Z((e,t)=>{f.current||r.current.openEvent&&!Wa(r.current.openEvent)||o.setPositionReference(Ua(a,{x:e,y:t,axis:c,dataRef:r,pointerType:m}))}),y=Z(e=>{u!=null||d!=null||(n?p.current||_([]):v(e.clientX,e.clientY))}),b=Ln(m)?i:n,x=l.useCallback(()=>{if(!b||!s||u!=null||d!=null)return;let e=H(i);function t(n){K(i,wn(n))?(e.removeEventListener(`mousemove`,t),p.current=null):v(n.clientX,n.clientY)}if(!r.current.openEvent||Wa(r.current.openEvent)){e.addEventListener(`mousemove`,t);let n=()=>{e.removeEventListener(`mousemove`,t),p.current=null};return p.current=n,n}o.setPositionReference(a)},[b,s,u,d,i,r,o,a,v]);l.useEffect(()=>x(),[x,g]),l.useEffect(()=>{s&&!i&&(f.current=!1)},[s,i]),l.useEffect(()=>{!s&&n&&(f.current=!0)},[s,n]),Y(()=>{s&&(u!=null||d!=null)&&(f.current=!1,v(u,d))},[s,u,d,v]);let S=l.useMemo(()=>{function e(e){let{pointerType:t}=e;h(t)}return{onPointerDown:e,onPointerEnter:e,onMouseMove:y,onMouseEnter:y}},[y]);return l.useMemo(()=>s?{reference:S}:{},[s,S])}var Ka={pointerdown:`onPointerDown`,mousedown:`onMouseDown`,click:`onClick`},qa={pointerdown:`onPointerDownCapture`,mousedown:`onMouseDownCapture`,click:`onClickCapture`},Ja=e=>({escapeKey:typeof e==`boolean`?e:e?.escapeKey??!1,outsidePress:typeof e==`boolean`?e:e?.outsidePress??!0});function Ya(e,t){t===void 0&&(t={});let{open:n,onOpenChange:r,elements:i,dataRef:a}=e,{enabled:o=!0,escapeKey:s=!0,outsidePress:c=!0,outsidePressEvent:u=`pointerdown`,referencePress:d=!1,referencePressEvent:f=`pointerdown`,ancestorScroll:p=!1,bubbles:m,capture:h}=t,g=Ki(),_=Z(typeof c==`function`?c:()=>!1),v=typeof c==`function`?_:c,y=l.useRef(!1),{escapeKey:b,outsidePress:x}=Ja(m),{escapeKey:S,outsidePress:C}=Ja(h),w=l.useRef(!1),T=Z(e=>{if(!n||!o||!s||e.key!==`Escape`||w.current)return;let t=a.current.floatingContext?.nodeId,i=g?jn(g.nodesRef.current,t):[];if(!b&&(e.stopPropagation(),i.length>0)){let e=!0;if(i.forEach(t=>{var n;if((n=t.context)!=null&&n.open&&!t.context.dataRef.current.__escapeKeyBubbles){e=!1;return}}),!e)return}r(!1,Pn(e)?e.nativeEvent:e,`escape-key`)}),E=Z(e=>{var t;let n=()=>{var t;T(e),(t=wn(e))==null||t.removeEventListener(`keydown`,n)};(t=wn(e))==null||t.addEventListener(`keydown`,n)}),D=Z(e=>{let t=a.current.insideReactTree;a.current.insideReactTree=!1;let n=y.current;if(y.current=!1,u===`click`&&n||t||typeof v==`function`&&!v(e))return;let o=wn(e),s=`[`+Xi(`inert`)+`]`,c=q(i.floating).querySelectorAll(s),l=U(o)?o:null;for(;l&&!Qe(l);){let e=et(l);if(Qe(e)||!U(e))break;l=e}if(c.length&&U(o)&&!En(o)&&!K(o,i.floating)&&Array.from(c).every(e=>!K(l,e)))return;if(W(o)&&A){let t=Qe(o),n=G(o),r=/auto|scroll/,i=t||r.test(n.overflowX),a=t||r.test(n.overflowY),s=i&&o.clientWidth>0&&o.scrollWidth>o.clientWidth,c=a&&o.clientHeight>0&&o.scrollHeight>o.clientHeight,l=n.direction===`rtl`,u=c&&(l?e.offsetX<=o.offsetWidth-o.clientWidth:e.offsetX>o.clientWidth),d=s&&e.offsetY>o.clientHeight;if(u||d)return}let d=a.current.floatingContext?.nodeId,f=g&&jn(g.nodesRef.current,d).some(t=>Tn(e,t.context?.elements.floating));if(Tn(e,i.floating)||Tn(e,i.domReference)||f)return;let p=g?jn(g.nodesRef.current,d):[];if(p.length>0){let e=!0;if(p.forEach(t=>{var n;if((n=t.context)!=null&&n.open&&!t.context.dataRef.current.__outsidePressBubbles){e=!1;return}}),!e)return}r(!1,e,`outside-press`)}),O=Z(e=>{var t;let n=()=>{var t;D(e),(t=wn(e))==null||t.removeEventListener(u,n)};(t=wn(e))==null||t.addEventListener(u,n)});l.useEffect(()=>{if(!n||!o)return;a.current.__escapeKeyBubbles=b,a.current.__outsidePressBubbles=x;let e=-1;function t(e){r(!1,e,`ancestor-scroll`)}function c(){window.clearTimeout(e),w.current=!0}function l(){e=window.setTimeout(()=>{w.current=!1},Ze()?5:0)}let d=q(i.floating);s&&(d.addEventListener(`keydown`,S?E:T,S),d.addEventListener(`compositionstart`,c),d.addEventListener(`compositionend`,l)),v&&d.addEventListener(u,C?O:D,C);let f=[];return p&&(U(i.domReference)&&(f=nt(i.domReference)),U(i.floating)&&(f=f.concat(nt(i.floating))),!U(i.reference)&&i.reference&&i.reference.contextElement&&(f=f.concat(nt(i.reference.contextElement)))),f=f.filter(e=>e!==d.defaultView?.visualViewport),f.forEach(e=>{e.addEventListener(`scroll`,t,{passive:!0})}),()=>{s&&(d.removeEventListener(`keydown`,S?E:T,S),d.removeEventListener(`compositionstart`,c),d.removeEventListener(`compositionend`,l)),v&&d.removeEventListener(u,C?O:D,C),f.forEach(e=>{e.removeEventListener(`scroll`,t)}),window.clearTimeout(e)}},[a,i,s,v,u,n,r,p,o,b,x,T,S,E,D,C,O]),l.useEffect(()=>{a.current.insideReactTree=!1},[a,v,u]);let k=l.useMemo(()=>({onKeyDown:T,...d&&{[Ka[f]]:e=>{r(!1,e.nativeEvent,`reference-press`)},...f!==`click`&&{onClick(e){r(!1,e.nativeEvent,`reference-press`)}}}}),[T,r,d,f]),A=l.useMemo(()=>({onKeyDown:T,onMouseDown(){y.current=!0},onMouseUp(){y.current=!0},[qa[u]]:()=>{a.current.insideReactTree=!0}}),[T,u,a]);return l.useMemo(()=>o?{reference:k,floating:A}:{},[o,k,A])}function Xa(e){let{open:t=!1,onOpenChange:n,elements:r}=e,i=Bi(),a=l.useRef({}),[o]=l.useState(()=>Hi()),s=Gi()!=null,[c,u]=l.useState(r.reference),d=Z((e,t,r)=>{a.current.openEvent=e?t:void 0,o.emit(`openchange`,{open:e,event:t,reason:r,nested:s}),n?.(e,t,r)}),f=l.useMemo(()=>({setPositionReference:u}),[]),p=l.useMemo(()=>({reference:c||r.reference||null,floating:r.floating||null,domReference:r.reference}),[c,r.reference,r.floating]);return l.useMemo(()=>({dataRef:a,open:t,onOpenChange:d,elements:p,events:o,floatingId:i,refs:f}),[t,d,p,o,i,f])}function Za(e){e===void 0&&(e={});let{nodeId:t}=e,n=Xa({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,i=r.elements,[a,o]=l.useState(null),[s,c]=l.useState(null),u=i?.domReference||a,d=l.useRef(null),f=Ki();Y(()=>{u&&(d.current=u)},[u]);let p=fi({...e,elements:{...i,...s&&{reference:s}}}),m=l.useCallback(e=>{let t=U(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;c(t),p.refs.setReference(t)},[p.refs]),h=l.useCallback(e=>{(U(e)||e===null)&&(d.current=e,o(e)),(U(p.refs.reference.current)||p.refs.reference.current===null||e!==null&&!U(e))&&p.refs.setReference(e)},[p.refs]),g=l.useMemo(()=>({...p.refs,setReference:h,setPositionReference:m,domReference:d}),[p.refs,h,m]),_=l.useMemo(()=>({...p.elements,domReference:u}),[p.elements,u]),v=l.useMemo(()=>({...p,...r,refs:g,elements:_,nodeId:t}),[p,g,_,t,r]);return Y(()=>{r.dataRef.current.floatingContext=v;let e=f?.nodesRef.current.find(e=>e.id===t);e&&(e.context=v)}),l.useMemo(()=>({...p,context:v,refs:g,elements:_}),[p,g,_,v])}function Qa(){return hn()&&pn()}function $a(e,t){t===void 0&&(t={});let{open:n,onOpenChange:r,events:i,dataRef:a,elements:o}=e,{enabled:s=!0,visibleOnly:c=!0}=t,u=l.useRef(!1),d=l.useRef(-1),f=l.useRef(!0);l.useEffect(()=>{if(!s)return;let e=H(o.domReference);function t(){!n&&W(o.domReference)&&o.domReference===Cn(q(o.domReference))&&(u.current=!0)}function r(){f.current=!0}function i(){f.current=!1}return e.addEventListener(`blur`,t),Qa()&&(e.addEventListener(`keydown`,r,!0),e.addEventListener(`pointerdown`,i,!0)),()=>{e.removeEventListener(`blur`,t),Qa()&&(e.removeEventListener(`keydown`,r,!0),e.removeEventListener(`pointerdown`,i,!0))}},[o.domReference,n,s]),l.useEffect(()=>{if(!s)return;function e(e){let{reason:t}=e;(t===`reference-press`||t===`escape-key`)&&(u.current=!0)}return i.on(`openchange`,e),()=>{i.off(`openchange`,e)}},[i,s]),l.useEffect(()=>()=>{$(d)},[]);let p=l.useMemo(()=>({onMouseLeave(){u.current=!1},onFocus(e){if(u.current)return;let t=wn(e.nativeEvent);if(c&&U(t)){if(Qa()&&!e.relatedTarget){if(!f.current&&!Dn(t))return}else if(!kn(t))return}r(!0,e.nativeEvent,`focus`)},onBlur(e){u.current=!1;let t=e.relatedTarget,n=e.nativeEvent,i=U(t)&&t.hasAttribute(Xi(`focus-guard`))&&t.getAttribute(`data-type`)===`outside`;d.current=window.setTimeout(()=>{let e=Cn(o.domReference?o.domReference.ownerDocument:document);!t&&e===o.domReference||K(a.current.floatingContext?.refs.floating.current,e)||K(o.domReference,e)||i||r(!1,n,`focus`)})}}),[a,o.domReference,r,c]);return l.useMemo(()=>s?{reference:p}:{},[s,p])}function eo(e,t,n){let r=new Map,i=n===`item`,a=e;if(i&&e){let{[Di]:t,[Oi]:n,...r}=e;a=r}return{...n===`floating`&&{tabIndex:-1,[Ei]:``},...a,...t.map(t=>{let r=t?t[n]:null;return typeof r==`function`?e?r(e):null:r}).concat(e).reduce((e,t)=>(t&&Object.entries(t).forEach(t=>{let[n,a]=t;if(!(i&&[Di,Oi].includes(n)))if(n.indexOf(`on`)===0){if(r.has(n)||r.set(n,[]),typeof a==`function`){var o;(o=r.get(n))==null||o.push(a),e[n]=function(){var e=[...arguments];return r.get(n)?.map(t=>t(...e)).find(e=>e!==void 0)}}}else e[n]=a}),e),{})}}function to(e){e===void 0&&(e=[]);let t=e.map(e=>e?.reference),n=e.map(e=>e?.floating),r=e.map(e=>e?.item),i=l.useCallback(t=>eo(t,e,`reference`),t),a=l.useCallback(t=>eo(t,e,`floating`),n),o=l.useCallback(t=>eo(t,e,`item`),r);return l.useMemo(()=>({getReferenceProps:i,getFloatingProps:a,getItemProps:o}),[i,a,o])}var no=`Escape`;function ro(e,t,n){switch(e){case`vertical`:return t;case`horizontal`:return n;default:return t||n}}function io(e,t){return ro(t,e===ji||e===Mi,e===ki||e===Ai)}function ao(e,t,n){return ro(t,e===Mi,n?e===ki:e===Ai)||e===`Enter`||e===` `||e===``}function oo(e,t,n){return ro(t,n?e===ki:e===Ai,e===Mi)}function so(e,t,n,r){return t===`both`||t===`horizontal`&&r&&r>1?e===no:ro(t,n?e===Ai:e===ki,e===ji)}function co(e,t){let{open:n,onOpenChange:r,elements:i,floatingId:a}=e,{listRef:o,activeIndex:s,onNavigate:c=()=>{},enabled:u=!0,selectedIndex:d=null,allowEscape:f=!1,loop:p=!1,nested:m=!1,rtl:h=!1,virtual:g=!1,focusItemOnOpen:_=`auto`,focusItemOnHover:v=!0,openOnArrowKeyDown:y=!0,disabledIndices:b=void 0,orientation:x=`vertical`,parentOrientation:S,cols:C=1,scrollItemIntoView:w=!0,virtualItemRef:T,itemSizes:E,dense:D=!1}=t,O=X(An(i.floating)),k=Gi(),A=Ki();Y(()=>{e.dataRef.current.orientation=x},[e,x]);let j=Z(()=>{c(P.current===-1?null:P.current)}),M=On(i.domReference),N=l.useRef(_),P=l.useRef(d??-1),F=l.useRef(null),ee=l.useRef(!0),te=l.useRef(j),ne=l.useRef(!!i.floating),re=l.useRef(n),I=l.useRef(!1),L=l.useRef(!1),ie=X(b),ae=X(n),R=X(w),z=X(d),[B,oe]=l.useState(),[se,ce]=l.useState(),le=Z(()=>{function e(e){if(g){var t;(t=e.id)!=null&&t.endsWith(`-fui-option`)&&(e.id=a+`-`+Math.random().toString(16).slice(2,10)),oe(e.id),A?.events.emit(`virtualfocus`,e),T&&(T.current=e)}else na(e,{sync:I.current,preventScroll:!0})}let t=o.current[P.current],n=L.current;t&&e(t),(I.current?e=>e():requestAnimationFrame)(()=>{let r=o.current[P.current]||t;if(!r)return;t||e(r);let i=R.current;i&&de&&(n||!ee.current)&&(r.scrollIntoView==null||r.scrollIntoView(typeof i==`boolean`?{block:`nearest`,inline:`nearest`}:i))})});Y(()=>{u&&(n&&i.floating?N.current&&d!=null&&(L.current=!0,P.current=d,j()):ne.current&&(P.current=-1,te.current()))},[u,n,i.floating,d,j]),Y(()=>{if(u&&n&&i.floating)if(s==null){if(I.current=!1,z.current!=null)return;if(ne.current&&(P.current=-1,le()),(!re.current||!ne.current)&&N.current&&(F.current!=null||N.current===!0&&F.current==null)){let e=0,t=()=>{o.current[0]==null?(e<2&&(e?requestAnimationFrame:queueMicrotask)(t),e++):(P.current=F.current==null||ao(F.current,x,h)||m?Hn(o,ie.current):Un(o,ie.current),F.current=null,j())};t()}}else Vn(o,s)||(P.current=s,le(),L.current=!1)},[u,n,i.floating,s,z,m,o,x,h,j,le,ie]),Y(()=>{var e;if(!u||i.floating||!A||g||!ne.current)return;let t=A.nodesRef.current,n=(e=t.find(e=>e.id===k))==null||(e=e.context)==null?void 0:e.elements.floating,r=Cn(q(i.floating)),a=t.some(e=>e.context&&K(e.context.elements.floating,r));n&&!a&&ee.current&&n.focus({preventScroll:!0})},[u,i.floating,A,k,g]),Y(()=>{if(!u||!A||!g||k)return;function e(e){ce(e.id),T&&(T.current=e)}return A.events.on(`virtualfocus`,e),()=>{A.events.off(`virtualfocus`,e)}},[u,A,g,k,T]),Y(()=>{te.current=j,re.current=n,ne.current=!!i.floating}),Y(()=>{n||(F.current=null,N.current=_)},[n,_]);let ue=s!=null,de=l.useMemo(()=>{function e(e){if(!ae.current)return;let t=o.current.indexOf(e);t!==-1&&P.current!==t&&(P.current=t,j())}return{onFocus(t){let{currentTarget:n}=t;I.current=!0,e(n)},onClick:e=>{let{currentTarget:t}=e;return t.focus({preventScroll:!0})},onMouseMove(t){let{currentTarget:n}=t;I.current=!0,L.current=!1,v&&e(n)},onPointerLeave(e){let{pointerType:t}=e;if(!(!ee.current||t===`touch`)&&(I.current=!0,v&&(P.current=-1,j(),!g))){var n;(n=O.current)==null||n.focus({preventScroll:!0})}}}},[ae,O,v,o,j,g]),fe=l.useCallback(()=>{var e;return S??(A==null||(e=A.nodesRef.current.find(e=>e.id===k))==null||(e=e.context)==null||(e=e.dataRef)==null?void 0:e.current.orientation)},[k,A,S]),pe=Z(e=>{if(ee.current=!1,I.current=!0,e.which===229||!ae.current&&e.currentTarget===O.current)return;if(m&&so(e.key,x,h,C)){io(e.key,fe())||J(e),r(!1,e.nativeEvent,`list-navigation`),W(i.domReference)&&(g?A?.events.emit(`virtualfocus`,i.domReference):i.domReference.focus());return}let t=P.current,a=Hn(o,b),s=Un(o,b);if(M||(e.key===`Home`&&(J(e),P.current=a,j()),e.key===`End`&&(J(e),P.current=s,j())),C>1){let t=E||Array.from({length:o.current.length},()=>({width:1,height:1})),n=Gn(t,C,D),r=n.findIndex(e=>e!=null&&!Jn(o,e,b)),i=n.reduce((e,t,n)=>t!=null&&!Jn(o,t,b)?n:e,-1),c=n[Wn({current:n.map(e=>e==null?null:o.current[e])},{event:e,orientation:x,loop:p,rtl:h,cols:C,disabledIndices:qn([...(typeof b==`function`?null:b)||o.current.map((e,t)=>Jn(o,t,b)?t:void 0),void 0],n),minIndex:r,maxIndex:i,prevIndex:Kn(P.current>s?a:P.current,t,n,C,e.key===Mi?`bl`:e.key===(h?ki:Ai)?`tr`:`tl`),stopEvent:!0})];if(c!=null&&(P.current=c,j()),x===`both`)return}if(io(e.key,x)){if(J(e),n&&!g&&Cn(e.currentTarget.ownerDocument)===e.currentTarget){P.current=ao(e.key,x,h)?a:s,j();return}ao(e.key,x,h)?p?P.current=t>=s?f&&t!==o.current.length?-1:a:Q(o,{startingIndex:t,disabledIndices:b}):P.current=Math.min(s,Q(o,{startingIndex:t,disabledIndices:b})):p?P.current=t<=a?f&&t!==-1?o.current.length:s:Q(o,{startingIndex:t,decrement:!0,disabledIndices:b}):P.current=Math.max(a,Q(o,{startingIndex:t,decrement:!0,disabledIndices:b})),Vn(o,P.current)&&(P.current=-1),j()}}),me=l.useMemo(()=>g&&n&&ue&&{"aria-activedescendant":se||B},[g,n,ue,se,B]),he=l.useMemo(()=>({"aria-orientation":x===`both`?void 0:x,...M?{}:me,onKeyDown:pe,onPointerMove(){ee.current=!0}}),[me,pe,x,M]),ge=l.useMemo(()=>{function e(e){_===`auto`&&Fn(e.nativeEvent)&&(N.current=!0)}function t(e){N.current=_,_===`auto`&&In(e.nativeEvent)&&(N.current=!0)}return{...me,onKeyDown(e){ee.current=!1;let t=e.key.startsWith(`Arrow`),i=[`Home`,`End`].includes(e.key),a=t||i,s=oo(e.key,x,h),c=so(e.key,x,h,C),l=oo(e.key,fe(),h),u=io(e.key,x),f=(m?l:u)||e.key===`Enter`||e.key.trim()===``;if(g&&n){let t=A?.nodesRef.current.find(e=>e.parentId==null),n=A&&t?Mn(A.nodesRef.current,t.id):null;if(a&&n&&T){let t=new KeyboardEvent(`keydown`,{key:e.key,bubbles:!0});if(s||c){let r=n.context?.elements.domReference===e.currentTarget,i=c&&!r?n.context?.elements.domReference:s?o.current.find(e=>e?.id===B):null;i&&(J(e),i.dispatchEvent(t),ce(void 0))}if((u||i)&&n.context&&n.context.open&&n.parentId&&e.currentTarget!==n.context.elements.domReference){var p;J(e),(p=n.context.elements.domReference)==null||p.dispatchEvent(t);return}}return pe(e)}if(!(!n&&!y&&t)){if(f){let t=io(e.key,fe());F.current=m&&t?null:e.key}if(m){l&&(J(e),n?(P.current=Hn(o,ie.current),j()):r(!0,e.nativeEvent,`list-navigation`));return}u&&(d!=null&&(P.current=d),J(e),!n&&y?r(!0,e.nativeEvent,`list-navigation`):pe(e),n&&j())}},onFocus(){n&&!g&&(P.current=-1,j())},onPointerDown:t,onPointerEnter:t,onMouseDown:e,onClick:e}},[B,me,C,pe,ie,_,o,m,j,r,n,y,x,fe,h,d,A,g,T]);return l.useMemo(()=>u?{reference:ge,floating:he,item:de}:{},[u,ge,he,de])}var lo=new Map([[`select`,`listbox`],[`combobox`,`listbox`],[`label`,!1]]);function uo(e,t){t===void 0&&(t={});let{open:n,elements:r,floatingId:i}=e,{enabled:a=!0,role:o=`dialog`}=t,s=Bi(),c=r.domReference?.id||s,u=l.useMemo(()=>An(r.floating)?.id||i,[r.floating,i]),d=lo.get(o)??o,f=Gi()!=null,p=l.useMemo(()=>d===`tooltip`||o===`label`?{[`aria-`+(o===`label`?`labelledby`:`describedby`)]:n?u:void 0}:{"aria-expanded":n?`true`:`false`,"aria-haspopup":d===`alertdialog`?`dialog`:d,"aria-controls":n?u:void 0,...d===`listbox`&&{role:`combobox`},...d===`menu`&&{id:c},...d===`menu`&&f&&{role:`menuitem`},...o===`select`&&{"aria-autocomplete":`none`},...o===`combobox`&&{"aria-autocomplete":`list`}},[d,u,f,n,c,o]),m=l.useMemo(()=>{let e={id:u,...d&&{role:d}};return d===`tooltip`||o===`label`?e:{...e,...d===`menu`&&{"aria-labelledby":c}}},[d,u,c,o]),h=l.useCallback(e=>{let{active:t,selected:n}=e,r={role:`option`,...t&&{id:u+`-fui-option`}};switch(o){case`select`:case`combobox`:return{...r,"aria-selected":n}}return{}},[u,o]);return l.useMemo(()=>a?{reference:p,floating:m,item:h}:{},[a,p,m,h])}var fo=e=>e.replace(/[A-Z]+(?![a-z])|[A-Z]/g,(e,t)=>(t?`-`:``)+e.toLowerCase());function po(e,t){return typeof e==`function`?e(t):e}function mo(e,t){let[n,r]=l.useState(e);return e&&!n&&r(!0),l.useEffect(()=>{if(!e&&n){let e=setTimeout(()=>r(!1),t);return()=>clearTimeout(e)}},[e,n,t]),n}function ho(e,t){t===void 0&&(t={});let{open:n,elements:{floating:r}}=e,{duration:i=250}=t,a=(typeof i==`number`?i:i.close)||0,[o,s]=l.useState(`unmounted`),c=mo(n,a);return!c&&o===`close`&&s(`unmounted`),Y(()=>{if(r){if(n){s(`initial`);let e=requestAnimationFrame(()=>{oi.flushSync(()=>{s(`open`)})});return()=>{cancelAnimationFrame(e)}}s(`close`)}},[n,r]),{isMounted:c,status:o}}function go(e,t){t===void 0&&(t={});let{initial:n={opacity:0},open:r,close:i,common:a,duration:o=250}=t,s=e.placement,c=s.split(`-`)[0],u=l.useMemo(()=>({side:c,placement:s}),[c,s]),d=typeof o==`number`,f=(d?o:o.open)||0,p=(d?o:o.close)||0,[m,h]=l.useState(()=>({...po(a,u),...po(n,u)})),{isMounted:g,status:_}=ho(e,{duration:o}),v=X(n),y=X(r),b=X(i),x=X(a);return Y(()=>{let e=po(v.current,u),t=po(b.current,u),n=po(x.current,u),r=po(y.current,u)||Object.keys(e).reduce((e,t)=>(e[t]=``,e),{});if(_===`initial`&&h(t=>({transitionProperty:t.transitionProperty,...n,...e})),_===`open`&&h({transitionProperty:Object.keys(r).map(fo).join(`,`),transitionDuration:f+`ms`,...n,...r}),_===`close`){let r=t||e;h({transitionProperty:Object.keys(r).map(fo).join(`,`),transitionDuration:p+`ms`,...n,...r})}},[p,b,v,y,x,f,_,u]),{isMounted:g,styles:m}}function _o(e,t){let{open:n,dataRef:r}=e,{listRef:i,activeIndex:a,onMatch:o,onTypingChange:s,enabled:c=!0,findMatch:u=null,resetMs:d=750,ignoreKeys:f=[],selectedIndex:p=null}=t,m=l.useRef(-1),h=l.useRef(``),g=l.useRef(p??a??-1),_=l.useRef(null),v=Z(o),y=Z(s),b=X(u),x=X(f);Y(()=>{n&&($(m),_.current=null,h.current=``)},[n]),Y(()=>{n&&h.current===``&&(g.current=p??a??-1)},[n,p,a]);let S=Z(e=>{e?r.current.typing||(r.current.typing=e,y(e)):r.current.typing&&(r.current.typing=e,y(e))}),C=Z(e=>{function t(e,t,n){let r=b.current?b.current(t,n):t.find(e=>e?.toLocaleLowerCase().indexOf(n.toLocaleLowerCase())===0);return r?e.indexOf(r):-1}let r=i.current;if(h.current.length>0&&h.current[0]!==` `&&(t(r,r,h.current)===-1?S(!1):e.key===` `&&J(e)),r==null||x.current.includes(e.key)||e.key.length!==1||e.ctrlKey||e.metaKey||e.altKey)return;n&&e.key!==` `&&(J(e),S(!0)),r.every(e=>e?e[0]?.toLocaleLowerCase()!==e[1]?.toLocaleLowerCase():!0)&&h.current===e.key&&(h.current=``,g.current=_.current),h.current+=e.key,$(m),m.current=window.setTimeout(()=>{h.current=``,g.current=_.current,S(!1)},d);let a=g.current,o=t(r,[...r.slice((a||0)+1),...r.slice(0,(a||0)+1)],h.current);o===-1?e.key!==` `&&(h.current=``,S(!1)):(v(o),_.current=o)}),w=l.useMemo(()=>({onKeyDown:C}),[C]),T=l.useMemo(()=>({onKeyDown:C,onKeyUp(e){e.key===` `&&S(!1)}}),[C,S]);return l.useMemo(()=>c?{reference:w,floating:T}:{},[c,w,T])}function vo(e,t,n){return n===void 0&&(n=!0),e.filter(e=>e.parentId===t&&(!n||e.context?.open)).flatMap(t=>[t,...vo(e,t.id,n)])}function yo(e,t){let[n,r]=e,i=!1,a=t.length;for(let e=0,o=a-1;e=r!=l>=r&&n<=(c-a)*(r-s)/(l-s)+a&&(i=!i)}return i}function bo(e,t){return e[0]>=t.x&&e[0]<=t.x+t.width&&e[1]>=t.y&&e[1]<=t.y+t.height}function xo(e){e===void 0&&(e={});let{buffer:t=.5,blockPointerEvents:n=!1,requireIntent:r=!0}=e,i={current:-1},a=!1,o=null,s=null,c=typeof performance<`u`?performance.now():0;function l(e,t){let n=performance.now(),r=n-c;if(o===null||s===null||r===0)return o=e,s=t,c=n,null;let i=e-o,a=t-s,l=Math.sqrt(i*i+a*a)/r;return o=e,s=t,c=n,l}let u=e=>{let{x:n,y:o,placement:s,elements:c,onClose:u,nodeId:d,tree:f}=e;return function(e){function p(){$(i),u()}if($(i),!c.domReference||!c.floating||s==null||n==null||o==null)return;let{clientX:m,clientY:h}=e,g=[m,h],_=ia(e),v=e.type===`mouseleave`,y=ra(c.floating,_),b=ra(c.domReference,_),x=c.domReference.getBoundingClientRect(),S=c.floating.getBoundingClientRect(),C=s.split(`-`)[0],w=n>S.right-S.width/2,T=o>S.bottom-S.height/2,E=bo(g,x),D=S.width>x.width,O=S.height>x.height,k=(D?x:S).left,A=(D?x:S).right,j=(O?x:S).top,M=(O?x:S).bottom;if(y&&(a=!0,!v))return;if(b&&(a=!1),b&&!v){a=!0;return}if(v&&U(e.relatedTarget)&&ra(c.floating,e.relatedTarget)||f&&vo(f.nodesRef.current,d).length)return;if(C===`top`&&o>=x.bottom-1||C===`bottom`&&o<=x.top+1||C===`left`&&n>=x.right-1||C===`right`&&n<=x.left+1)return p();let N=[];switch(C){case`top`:N=[[k,x.top+1],[k,S.bottom-1],[A,S.bottom-1],[A,x.top+1]];break;case`bottom`:N=[[k,S.top+1],[k,x.bottom-1],[A,x.bottom-1],[A,S.top+1]];break;case`left`:N=[[S.right-1,M],[S.right-1,j],[x.left+1,j],[x.left+1,M]];break;case`right`:N=[[x.right-1,M],[x.right-1,j],[S.left+1,j],[S.left+1,M]];break}function P(e){let[n,r]=e;switch(C){case`top`:return[[D?n+t/2:w?n+t*4:n-t*4,r+t+1],[D?n-t/2:w?n+t*4:n-t*4,r+t+1],...[[S.left,w||D?S.bottom-t:S.top],[S.right,w?D?S.bottom-t:S.top:S.bottom-t]]];case`bottom`:return[[D?n+t/2:w?n+t*4:n-t*4,r-t],[D?n-t/2:w?n+t*4:n-t*4,r-t],...[[S.left,w||D?S.top+t:S.bottom],[S.right,w?D?S.top+t:S.bottom:S.top+t]]];case`left`:{let e=[n+t+1,O?r+t/2:T?r+t*4:r-t*4],i=[n+t+1,O?r-t/2:T?r+t*4:r-t*4];return[...[[T||O?S.right-t:S.left,S.top],[T?O?S.right-t:S.left:S.right-t,S.bottom]],e,i]}case`right`:return[[n-t,O?r+t/2:T?r+t*4:r-t*4],[n-t,O?r-t/2:T?r+t*4:r-t*4],...[[T||O?S.left+t:S.right,S.top],[T?O?S.left+t:S.right:S.left+t,S.bottom]]]}}if(!yo([m,h],N)){if(a&&!E)return p();if(!v&&r){let t=l(e.clientX,e.clientY);if(t!==null&&t<.1)return p()}yo([m,h],P([n,o]))?!a&&r&&(i.current=window.setTimeout(p,40)):p()}}};return u.__options={blockPointerEvents:n},u}var So=(0,l.forwardRef)(function({as:e,open:t,title:r,children:i,placement:o,focus:s=!0,hover:u=!0,enabled:d=!0,popover:f=!0,onChange:p=c,followCursor:m=!1,...h},g){let[_,v]=(0,l.useState)(t??!1),y=(0,l.useRef)(null),b=e||`span`,{refs:x,floatingStyles:S,context:C}=Za({placement:o,open:_,whileElementsMounted:Xr,onOpenChange:t?void 0:e=>{v(e),p?.(e)},middleware:[hi(),mi(5),yi(),xi({padding:5,element:y}),_i({fallbackAxisSideDirection:`start`})]}),w=Ya(C,{enabled:d}),T=uo(C,{role:`tooltip`,enabled:d}),E=$a(C,{enabled:d?s:!1}),D=Ha(C,{enabled:d?f:!1}),O=Ga(C,{enabled:!!d&&!!m}),k=ea(C,{move:!0,delay:{open:200},enabled:d?u:!1,handleClose:f?xo():null}),{getReferenceProps:A,getFloatingProps:j}=to([T,w,O,s?E:void 0,u?k:void 0,f?D:void 0]);return(0,l.useEffect)(()=>v(t===void 0?!1:t),[t]),(0,V.jsxs)(l.Fragment,{children:[(0,V.jsx)(b,{...A(h),ref:n(x.setReference,g),children:r}),_&&(0,V.jsx)(Sa,{children:(0,V.jsxs)(a,{...j(),ref:x.setFloating,style:S,className:`isolate z-tooltip rounded-lg border border-tooltip-border bg-tooltip-background p-3 text-tooltip-foreground shadow-shadow-floating`,children:[(0,V.jsx)(Vi,{ref:y,context:C,strokeWidth:.1,className:`fill-tooltip-background stroke-tooltip-border`}),i]})})]})}),Co=({reportStatus:e,id:t,hideLeft:n=!1,className:i,info:a,children:o,title:s})=>(0,V.jsxs)(`span`,{className:r(`w-full justify-between`,n&&o===null?`hidden`:`flex`,i),children:[n?null:(0,V.jsxs)(`span`,{className:`flex items-center gap-1 transition-colors group-focus-within:text-primary group-hover:text-primary group-disabled:text-disabled group-error:text-danger`,children:[s,e||a?(0,V.jsxs)(`span`,{className:`flex items-center justify-center gap-1`,children:[a?(0,V.jsx)(So,{as:`button`,type:`button`,"aria-label":typeof a==`string`?a:void 0,"aria-describedby":typeof a==`string`?void 0:t?`tooltip-info-content-${t}`:void 0,title:(0,V.jsx)(`span`,{className:`cursor-help`,children:(0,V.jsx)(we,{className:`aspect-square size-3`,"aria-hidden":`true`,size:16,strokeWidth:1,absoluteStrokeWidth:!0})}),children:(0,V.jsx)(`div`,{id:t?`tooltip-info-content-${t}`:void 0,className:`w-full max-w-48 whitespace-break-spaces break-words`,children:a})}):null,e?(0,V.jsxs)(`span`,{className:`flex h-3 min-w-6 items-center`,children:[(0,V.jsx)(Se,{className:`hidden aspect-square size-3 opacity-0 transition-opacity group-assert:block group-assert:text-success group-assert:opacity-100`,"aria-hidden":`true`,size:16,strokeWidth:1,absoluteStrokeWidth:!0}),(0,V.jsx)(Ce,{className:`hidden aspect-square size-3 opacity-0 transition-opacity group-error:block group-error:opacity-100`,"aria-hidden":`true`,size:16,strokeWidth:1,absoluteStrokeWidth:!0})]}):null]}):null]}),o]}),wo=(0,l.forwardRef)(({optionalText:e,left:t,rightLabel:n,container:i,feedback:a,interactive:o,right:s,info:c,children:u,error:d,form:f,id:p,labelClassName:m=``,name:h,title:g,componentName:_,placeholder:v,hideLeft:y=!1,required:b,disabled:x,reportStatus:S,hiddenLabel:C},w)=>{let T=Ie(),E=S===void 0?T.input.iconFeedback:S,D=p??h,O=Fe(),k=e??O.inputOptionalLabel;return(0,V.jsxs)(`fieldset`,{ref:w,form:f,disabled:x,"data-error":!!d,"aria-disabled":x,"data-component":_,"data-interactive":!!o,className:r(`group flex min-h-0 min-w-0 max-w-full flex-col items-start`,i),children:[(0,V.jsxs)(`label`,{form:f,htmlFor:D,className:`relative inline-flex w-full max-w-full cursor-text flex-row flex-wrap justify-between gap-1 text-field-label text-sm transition-colors empty:hidden group-disabled:cursor-not-allowed group-error:text-danger`,children:[C?null:(0,V.jsx)(Co,{info:c,hideLeft:y,reportStatus:E,title:g,placeholder:v,children:k||n?(0,V.jsxs)(l.Fragment,{children:[b?null:(0,V.jsx)(`span`,{"aria-disabled":x,className:`text-opacity-70 transition-colors group-focus-within:text-primary group-hover:text-primary aria-disabled:text-disabled`,children:k}),n?(0,V.jsx)(l.Fragment,{children:n}):null]}):null}),(0,V.jsxs)(`div`,{className:`group relative flex w-full flex-row flex-nowrap items-center gap-x-2 gap-y-1 rounded-md border border-input-border bg-transparent transition-colors group-hover:border-primary group-disabled:border-disabled group-error:border-danger ${m}`,children:[t?(0,V.jsx)(`span`,{className:`flex flex-nowrap gap-1 whitespace-nowrap pl-2`,children:t}):null,u,s?(0,V.jsx)(`span`,{className:`flex flex-nowrap gap-2 whitespace-nowrap pr-2`,children:s}):null]})]}),(0,V.jsx)(`p`,{className:`mt-input-gap hidden whitespace-pre-wrap text-wrap text-xs empty:mt-0 empty:hidden group-has-[input:not(:focus):invalid[data-initialized=true]]:flex group-error:flex group-error:text-danger`,children:d}),(0,V.jsx)(`p`,{className:`mt-input-gap text-xs empty:mt-0 empty:hidden group-has-[input:not(:focus):valid[data-initialized=true]]:block group-assert:block group-error:hidden`,children:a})]})}),To=(e,t,a,o)=>(0,l.forwardRef)(({info:s,left:c,next:u,error:d,right:f,container:p,rightLabel:m,interactive:h,optionalText:g,type:_=`text`,labelClassName:v,feedback:y=null,hideLeft:b=!1,loading:x,hiddenLabel:S,...C},w)=>{let T=e,E=C.id??C.name,D=(0,l.useRef)(null);return(0,l.useEffect)(()=>{if(D.current===null)return;let e=D.current,t=i(D.current),n=o?.(e),r=t=>{let n=t;if(n.key===`Enter`&&e.enterKeyHint===`next`){let t=e.getAttribute(`data-next`);if(t){let e=document.getElementById(t);if(e){e.focus(),n.preventDefault();return}}}};return e.addEventListener(`keydown`,r),()=>{n?.(),t(),e.removeEventListener(`keydown`,r)}},[]),(0,V.jsx)(wo,{...a,info:s,left:c,error:d,right:f,form:C.form,loading:x,name:C.name,feedback:y,hideLeft:b,title:C.title,rightLabel:m,disabled:C.disabled,hiddenLabel:S,interactive:h,required:C.required,componentName:t,id:C.name||C.id,optionalText:g,labelClassName:v,placeholder:C.placeholder,container:r(p,a.container),children:(0,V.jsx)(T,{...a,...C,id:E,name:E,type:_,"data-next":u,"aria-busy":C.disabled,"aria-disabled":C.disabled,"aria-readonly":C.readOnly,ref:n(w,D),className:r(`input placeholder-input-mask group h-input-height w-full flex-1`,`rounded-md bg-transparent px-input-x py-input-y text-base text-foreground`,`outline-none transition-colors focus:ring-2 focus:ring-inset focus:ring-primary`,`group-error:text-danger group-error:placeholder-input-mask-error`,`resize-y group-focus-within:border-primary group-hover:border-primary`,`disabled:cursor-not-allowed disabled:text-disabled`,C.className)})})}),Eo=To(pe,`input`,{type:`text`});export{xe as $,gi as A,H as B,uo as C,yi as D,xi as E,Xr as F,Fe as G,Be as H,ai as I,Me as J,Pe as K,ei as L,hi as M,vi as N,_i as O,fi as P,Se as Q,$r as R,co as S,_o as T,Ve as U,W as V,Ie as W,Te as X,je as Y,we as Z,Gi as _,Vi as a,to as b,Ji as c,Yi as d,pe as et,xo as f,qi as g,Za as h,So as i,mi as j,bi as k,Ra as l,Ya as m,To as n,Na as o,Ha as p,Ne as q,wo as r,wi as s,Eo as t,Sa as u,Ki as v,go as w,Ti as x,ea as y,rr as z}; //# sourceMappingURL=input-DTKA2jrk.js.map