UNPKG

strapi-plugin-navigation

Version:
7 lines 970 kB
"use strict";const g=require("react"),u=require("react/jsx-runtime"),C=require("styled-components"),ce=require("@strapi/strapi/admin"),Md=require("react-dnd"),Dy=require("react-dnd-html5-backend"),Sc=require("react-router-dom"),Qi=require("react-dom"),ie=require("lodash"),Re=require("@tanstack/react-query"),de=require("react-intl"),$e=require("@sensinum/strapi-utils"),F=require("zod"),Na=require("lodash/fp"),Oy=t=>t&&t.__esModule?t:{default:t};function sh(t){if(t&&t.__esModule)return t;const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:()=>t[n]})}}return e.default=t,Object.freeze(e)}const y=sh(g),kn=Oy(C),Qr=sh(Qi),M=sh(F),Pt="navigation",jy=({setPlugin:t})=>{const e=g.useRef(t);return g.useEffect(()=>{e.current?.(Pt)},[]),null},Ly=92,Ny=kn.default.svg` path { fill: ${({theme:t})=>t.colors.neutral500}; } `,By=({width:t=20,height:e=20})=>u.jsx(Ny,{viewBox:`0 0 ${t} ${e}`,xmlns:"http://www.w3.org/2000/svg",height:e,width:t,children:u.jsx("g",{style:{transform:`scale(${t/Ly})`},children:u.jsx("path",{d:`M78,23.5H14c-3.6,0-6.5-2.9-6.5-6.5s2.9-6.5,6.5-6.5h64c3.6,0,6.5,2.9,6.5,6.5S81.6,23.5,78,23.5z M84.5,46 c0-3.6-2.9-6.5-6.5-6.5H14c-3.6,0-6.5,2.9-6.5,6.5s2.9,6.5,6.5,6.5h64C81.6,52.5,84.5,49.6,84.5,46z M84.5,75c0-3.6-2.9-6.5-6.5-6.5 H14c-3.6,0-6.5,2.9-6.5,6.5s2.9,6.5,6.5,6.5h64C81.6,81.5,84.5,78.6,84.5,75z`})})}),Fy=()=>u.jsx(By,{});function Ke(t){const e=g.useRef(t);return g.useEffect(()=>{e.current=t}),g.useMemo(()=>(...n)=>{var r;return(r=e.current)===null||r===void 0?void 0:r.call(e,...n)},[])}function Ac(t,e){return t-e*Math.floor(t/e)}const Wg=1721426;function Os(t,e,n,r){e=ah(t,e);let i=e-1,o=-2;return n<=2?o=0:ya(e)&&(o=-1),Wg-1+365*i+Math.floor(i/4)-Math.floor(i/100)+Math.floor(i/400)+Math.floor((367*n-362)/12+o+r)}function ya(t){return t%4===0&&(t%100!==0||t%400===0)}function ah(t,e){return t==="BC"?1-e:e}function Vy(t){let e="AD";return t<=0&&(e="BC",t=1-t),[e,t]}const _y={standard:[31,28,31,30,31,30,31,31,30,31,30,31],leapyear:[31,29,31,30,31,30,31,31,30,31,30,31]};class ji{fromJulianDay(e){let n=e,r=n-Wg,i=Math.floor(r/146097),o=Ac(r,146097),s=Math.floor(o/36524),a=Ac(o,36524),l=Math.floor(a/1461),c=Ac(a,1461),d=Math.floor(c/365),h=i*400+s*100+l*4+d+(s!==4&&d!==4?1:0),[f,m]=Vy(h),p=n-Os(f,m,1,1),b=2;n<Os(f,m,3,1)?b=0:ya(m)&&(b=1);let v=Math.floor(((p+b)*12+373)/367),x=n-Os(f,m,v,1)+1;return new Fo(f,m,v,x)}toJulianDay(e){return Os(e.era,e.year,e.month,e.day)}getDaysInMonth(e){return _y[ya(e.year)?"leapyear":"standard"][e.month-1]}getMonthsInYear(e){return 12}getDaysInYear(e){return ya(e.year)?366:365}getYearsInEra(e){return 9999}getEras(){return["BC","AD"]}isInverseEra(e){return e.era==="BC"}balanceDate(e){e.year<=0&&(e.era=e.era==="BC"?"AD":"BC",e.year=1-e.year)}constructor(){this.identifier="gregory"}}const zy={"001":1,AD:1,AE:6,AF:6,AI:1,AL:1,AM:1,AN:1,AR:1,AT:1,AU:1,AX:1,AZ:1,BA:1,BE:1,BG:1,BH:6,BM:1,BN:1,BY:1,CH:1,CL:1,CM:1,CN:1,CR:1,CY:1,CZ:1,DE:1,DJ:6,DK:1,DZ:6,EC:1,EE:1,EG:6,ES:1,FI:1,FJ:1,FO:1,FR:1,GB:1,GE:1,GF:1,GP:1,GR:1,HR:1,HU:1,IE:1,IQ:6,IR:6,IS:1,IT:1,JO:6,KG:1,KW:6,KZ:1,LB:1,LI:1,LK:1,LT:1,LU:1,LV:1,LY:6,MC:1,MD:1,ME:1,MK:1,MN:1,MQ:1,MV:5,MY:1,NL:1,NO:1,NZ:1,OM:6,PL:1,QA:6,RE:1,RO:1,RS:1,RU:1,SD:6,SE:1,SI:1,SK:1,SM:1,SY:6,TJ:1,TM:1,TR:1,UA:1,UY:1,UZ:1,VA:1,VN:1,XK:1};function qg(t,e){return e=Ut(e,t.calendar),t.era===e.era&&t.year===e.year&&t.month===e.month&&t.day===e.day}function Ug(t,e){let n=t.calendar.toJulianDay(t),r=Math.ceil(n+1-Ky(e))%7;return r<0&&(r+=7),r}function Py(t){return _n(Date.now(),t)}function lh(t){return Zg(Py(t))}function Kg(t,e){return t.calendar.toJulianDay(t)-e.calendar.toJulianDay(e)}function Hy(t,e){return b0(t)-b0(e)}function b0(t){return t.hour*36e5+t.minute*6e4+t.second*1e3+t.millisecond}let kc=null;function Li(){return kc==null&&(kc=new Intl.DateTimeFormat().resolvedOptions().timeZone),kc}function Wy(t){return t.subtract({days:t.day-1})}function qy(t){return t.add({days:t.calendar.getDaysInMonth(t)-t.day})}function Gg(t,e){let n=Ug(t,e);return t.subtract({days:n})}const v0=new Map;function Uy(t){if(Intl.Locale){let n=v0.get(t);return n||(n=new Intl.Locale(t).maximize().region,n&&v0.set(t,n)),n}let e=t.split("-")[1];return e==="u"?void 0:e}function Ky(t){let e=Uy(t);return e&&zy[e]||0}function Ed(t,e){return t&&e?t.compare(e)<=0?t:e:t||e}function Id(t,e){return t&&e?t.compare(e)>=0?t:e:t||e}function Ni(t){t=Ut(t,new ji);let e=ah(t.era,t.year);return Yg(e,t.month,t.day,t.hour,t.minute,t.second,t.millisecond)}function Yg(t,e,n,r,i,o,s){let a=new Date;return a.setUTCHours(r,i,o,s),a.setUTCFullYear(t,e-1,n),a.getTime()}function Dd(t,e){if(e==="UTC")return 0;if(t>0&&e===Li())return new Date(t).getTimezoneOffset()*-6e4;let{year:n,month:r,day:i,hour:o,minute:s,second:a}=Xg(t,e);return Yg(n,r,i,o,s,a,0)-Math.floor(t/1e3)*1e3}const x0=new Map;function Xg(t,e){let n=x0.get(e);n||(n=new Intl.DateTimeFormat("en-US",{timeZone:e,hour12:!1,era:"short",year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"}),x0.set(e,n));let r=n.formatToParts(new Date(t)),i={};for(let o of r)o.type!=="literal"&&(i[o.type]=o.value);return{year:i.era==="BC"||i.era==="B"?-i.year+1:+i.year,month:+i.month,day:+i.day,hour:i.hour==="24"?0:+i.hour,minute:+i.minute,second:+i.second}}const w0=864e5;function Gy(t,e,n,r){return(n===r?[n]:[n,r]).filter(o=>Yy(t,e,o))}function Yy(t,e,n){let r=Xg(n,e);return t.year===r.year&&t.month===r.month&&t.day===r.day&&t.hour===r.hour&&t.minute===r.minute&&t.second===r.second}function Bn(t,e,n="compatible"){let r=_r(t);if(e==="UTC")return Ni(r);if(e===Li()&&n==="compatible"){r=Ut(r,new ji);let l=new Date,c=ah(r.era,r.year);return l.setFullYear(c,r.month-1,r.day),l.setHours(r.hour,r.minute,r.second,r.millisecond),l.getTime()}let i=Ni(r),o=Dd(i-w0,e),s=Dd(i+w0,e),a=Gy(r,e,i-o,i-s);if(a.length===1)return a[0];if(a.length>1)switch(n){case"compatible":case"earlier":return a[0];case"later":return a[a.length-1];case"reject":throw new RangeError("Multiple possible absolute times found")}switch(n){case"earlier":return Math.min(i-o,i-s);case"compatible":case"later":return Math.max(i-o,i-s);case"reject":throw new RangeError("No such absolute time found")}}function Qg(t,e,n="compatible"){return new Date(Bn(t,e,n))}function _n(t,e){let n=Dd(t,e),r=new Date(t+n),i=r.getUTCFullYear(),o=r.getUTCMonth()+1,s=r.getUTCDate(),a=r.getUTCHours(),l=r.getUTCMinutes(),c=r.getUTCSeconds(),d=r.getUTCMilliseconds();return new Bi(i,o,s,e,n,a,l,c,d)}function Zg(t){return new Fo(t.calendar,t.era,t.year,t.month,t.day)}function _r(t,e){let n=0,r=0,i=0,o=0;if("timeZone"in t)({hour:n,minute:r,second:i,millisecond:o}=t);else if("hour"in t&&!e)return t;return e&&({hour:n,minute:r,second:i,millisecond:o}=e),new Fa(t.calendar,t.era,t.year,t.month,t.day,n,r,i,o)}function Ut(t,e){if(t.calendar.identifier===e.identifier)return t;let n=e.fromJulianDay(t.calendar.toJulianDay(t)),r=t.copy();return r.calendar=e,r.era=n.era,r.year=n.year,r.month=n.month,r.day=n.day,zr(r),r}function Xy(t,e,n){if(t instanceof Bi)return t.timeZone===e?t:Jg(t,e);let r=Bn(t,e,n);return _n(r,e)}function Qy(t){let e=Ni(t)-t.offset;return new Date(e)}function Jg(t,e){let n=Ni(t)-t.offset;return Ut(_n(n,e),t.calendar)}const mo=36e5;function Sl(t,e){let n=t.copy(),r="hour"in n?t3(n,e):0;Od(n,e.years||0),n.calendar.balanceYearMonth&&n.calendar.balanceYearMonth(n,t),n.month+=e.months||0,jd(n),ep(n),n.day+=(e.weeks||0)*7,n.day+=e.days||0,n.day+=r,Zy(n),n.calendar.balanceDate&&n.calendar.balanceDate(n),n.year<1&&(n.year=1,n.month=1,n.day=1);let i=n.calendar.getYearsInEra(n);if(n.year>i){var o,s;let l=(o=(s=n.calendar).isInverseEra)===null||o===void 0?void 0:o.call(s,n);n.year=i,n.month=l?1:n.calendar.getMonthsInYear(n),n.day=l?1:n.calendar.getDaysInMonth(n)}n.month<1&&(n.month=1,n.day=1);let a=n.calendar.getMonthsInYear(n);return n.month>a&&(n.month=a,n.day=n.calendar.getDaysInMonth(n)),n.day=Math.max(1,Math.min(n.calendar.getDaysInMonth(n),n.day)),n}function Od(t,e){var n,r;!((n=(r=t.calendar).isInverseEra)===null||n===void 0)&&n.call(r,t)&&(e=-e),t.year+=e}function jd(t){for(;t.month<1;)Od(t,-1),t.month+=t.calendar.getMonthsInYear(t);let e=0;for(;t.month>(e=t.calendar.getMonthsInYear(t));)t.month-=e,Od(t,1)}function Zy(t){for(;t.day<1;)t.month--,jd(t),t.day+=t.calendar.getDaysInMonth(t);for(;t.day>t.calendar.getDaysInMonth(t);)t.day-=t.calendar.getDaysInMonth(t),t.month++,jd(t)}function ep(t){t.month=Math.max(1,Math.min(t.calendar.getMonthsInYear(t),t.month)),t.day=Math.max(1,Math.min(t.calendar.getDaysInMonth(t),t.day))}function zr(t){t.calendar.constrainDate&&t.calendar.constrainDate(t),t.year=Math.max(1,Math.min(t.calendar.getYearsInEra(t),t.year)),ep(t)}function tp(t){let e={};for(let n in t)typeof t[n]=="number"&&(e[n]=-t[n]);return e}function np(t,e){return Sl(t,tp(e))}function ch(t,e){let n=t.copy();return e.era!=null&&(n.era=e.era),e.year!=null&&(n.year=e.year),e.month!=null&&(n.month=e.month),e.day!=null&&(n.day=e.day),zr(n),n}function Ba(t,e){let n=t.copy();return e.hour!=null&&(n.hour=e.hour),e.minute!=null&&(n.minute=e.minute),e.second!=null&&(n.second=e.second),e.millisecond!=null&&(n.millisecond=e.millisecond),e3(n),n}function Jy(t){t.second+=Math.floor(t.millisecond/1e3),t.millisecond=js(t.millisecond,1e3),t.minute+=Math.floor(t.second/60),t.second=js(t.second,60),t.hour+=Math.floor(t.minute/60),t.minute=js(t.minute,60);let e=Math.floor(t.hour/24);return t.hour=js(t.hour,24),e}function e3(t){t.millisecond=Math.max(0,Math.min(t.millisecond,1e3)),t.second=Math.max(0,Math.min(t.second,59)),t.minute=Math.max(0,Math.min(t.minute,59)),t.hour=Math.max(0,Math.min(t.hour,23))}function js(t,e){let n=t%e;return n<0&&(n+=e),n}function t3(t,e){return t.hour+=e.hours||0,t.minute+=e.minutes||0,t.second+=e.seconds||0,t.millisecond+=e.milliseconds||0,Jy(t)}function dh(t,e,n,r){let i=t.copy();switch(e){case"era":{let a=t.calendar.getEras(),l=a.indexOf(t.era);if(l<0)throw new Error("Invalid era: "+t.era);l=zn(l,n,0,a.length-1,r?.round),i.era=a[l],zr(i);break}case"year":var o,s;!((o=(s=i.calendar).isInverseEra)===null||o===void 0)&&o.call(s,i)&&(n=-n),i.year=zn(t.year,n,-1/0,9999,r?.round),i.year===-1/0&&(i.year=1),i.calendar.balanceYearMonth&&i.calendar.balanceYearMonth(i,t);break;case"month":i.month=zn(t.month,n,1,t.calendar.getMonthsInYear(t),r?.round);break;case"day":i.day=zn(t.day,n,1,t.calendar.getDaysInMonth(t),r?.round);break;default:throw new Error("Unsupported field "+e)}return t.calendar.balanceDate&&t.calendar.balanceDate(i),zr(i),i}function rp(t,e,n,r){let i=t.copy();switch(e){case"hour":{let o=t.hour,s=0,a=23;if(r?.hourCycle===12){let l=o>=12;s=l?12:0,a=l?23:11}i.hour=zn(o,n,s,a,r?.round);break}case"minute":i.minute=zn(t.minute,n,0,59,r?.round);break;case"second":i.second=zn(t.second,n,0,59,r?.round);break;case"millisecond":i.millisecond=zn(t.millisecond,n,0,999,r?.round);break;default:throw new Error("Unsupported field "+e)}return i}function zn(t,e,n,r,i=!1){if(i){t+=Math.sign(e),t<n&&(t=r);let o=Math.abs(e);e>0?t=Math.ceil(t/o)*o:t=Math.floor(t/o)*o,t>r&&(t=n)}else t+=e,t<n?t=r-(n-t-1):t>r&&(t=n+(t-r-1));return t}function ip(t,e){let n;if(e.years!=null&&e.years!==0||e.months!=null&&e.months!==0||e.weeks!=null&&e.weeks!==0||e.days!=null&&e.days!==0){let i=Sl(_r(t),{years:e.years,months:e.months,weeks:e.weeks,days:e.days});n=Bn(i,t.timeZone)}else n=Ni(t)-t.offset;n+=e.milliseconds||0,n+=(e.seconds||0)*1e3,n+=(e.minutes||0)*6e4,n+=(e.hours||0)*36e5;let r=_n(n,t.timeZone);return Ut(r,t.calendar)}function n3(t,e){return ip(t,tp(e))}function r3(t,e,n,r){switch(e){case"hour":{let i=0,o=23;if(r?.hourCycle===12){let p=t.hour>=12;i=p?12:0,o=p?23:11}let s=_r(t),a=Ut(Ba(s,{hour:i}),new ji),l=[Bn(a,t.timeZone,"earlier"),Bn(a,t.timeZone,"later")].filter(p=>_n(p,t.timeZone).day===a.day)[0],c=Ut(Ba(s,{hour:o}),new ji),d=[Bn(c,t.timeZone,"earlier"),Bn(c,t.timeZone,"later")].filter(p=>_n(p,t.timeZone).day===c.day).pop(),h=Ni(t)-t.offset,f=Math.floor(h/mo),m=h%mo;return h=zn(f,n,Math.floor(l/mo),Math.floor(d/mo),r?.round)*mo+m,Ut(_n(h,t.timeZone),t.calendar)}case"minute":case"second":case"millisecond":return rp(t,e,n,r);case"era":case"year":case"month":case"day":{let i=dh(_r(t),e,n,r),o=Bn(i,t.timeZone);return Ut(_n(o,t.timeZone),t.calendar)}default:throw new Error("Unsupported field "+e)}}function i3(t,e,n){let r=_r(t),i=Ba(ch(r,e),e);if(i.compare(r)===0)return t;let o=Bn(i,t.timeZone,n);return Ut(_n(o,t.timeZone),t.calendar)}const o3=/^(\d{4})-(\d{2})-(\d{2})(?:T(\d{2}))?(?::(\d{2}))?(?::(\d{2}))?(\.\d+)?(?:(?:([+-]\d{2})(?::?(\d{2}))?)|Z)$/;function op(t,e){let n=t.match(o3);if(!n)throw new Error("Invalid ISO 8601 date time string: "+t);let r=new Bi(On(n[1],1,9999),On(n[2],1,12),1,e,0,n[4]?On(n[4],0,23):0,n[5]?On(n[5],0,59):0,n[6]?On(n[6],0,59):0,n[7]?On(n[7],0,1/0)*1e3:0);r.day=On(n[3],0,r.calendar.getDaysInMonth(r));var i;return n[8]&&(r.offset=On(n[8],-23,23)*36e5+On((i=n[9])!==null&&i!==void 0?i:"0",0,59)*6e4),Jg(r,e)}function s3(t){return op(t,Li())}function On(t,e,n){let r=Number(t);if(r<e||r>n)throw new RangeError(`Value out of range: ${e} <= ${r} <= ${n}`);return r}function a3(t){return`${String(t.hour).padStart(2,"0")}:${String(t.minute).padStart(2,"0")}:${String(t.second).padStart(2,"0")}${t.millisecond?String(t.millisecond/1e3).slice(1):""}`}function sp(t){let e=Ut(t,new ji);return`${String(e.year).padStart(4,"0")}-${String(e.month).padStart(2,"0")}-${String(e.day).padStart(2,"0")}`}function ap(t){return`${sp(t)}T${a3(t)}`}function l3(t){let e=Math.sign(t)<0?"-":"+";t=Math.abs(t);let n=Math.floor(t/36e5),r=t%36e5/6e4;return`${e}${String(n).padStart(2,"0")}:${String(r).padStart(2,"0")}`}function c3(t){return`${ap(t)}${l3(t.offset)}[${t.timeZone}]`}function d3(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function uh(t,e,n){d3(t,e),e.set(t,n)}function hh(t){let e=typeof t[0]=="object"?t.shift():new ji,n;if(typeof t[0]=="string")n=t.shift();else{let s=e.getEras();n=s[s.length-1]}let r=t.shift(),i=t.shift(),o=t.shift();return[e,n,r,i,o]}var u3=new WeakMap;class Fo{copy(){return this.era?new Fo(this.calendar,this.era,this.year,this.month,this.day):new Fo(this.calendar,this.year,this.month,this.day)}add(e){return Sl(this,e)}subtract(e){return np(this,e)}set(e){return ch(this,e)}cycle(e,n,r){return dh(this,e,n,r)}toDate(e){return Qg(this,e)}toString(){return sp(this)}compare(e){return Kg(this,e)}constructor(...e){uh(this,u3,{writable:!0,value:void 0});let[n,r,i,o,s]=hh(e);this.calendar=n,this.era=r,this.year=i,this.month=o,this.day=s,zr(this)}}var h3=new WeakMap;class Fa{copy(){return this.era?new Fa(this.calendar,this.era,this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond):new Fa(this.calendar,this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond)}add(e){return Sl(this,e)}subtract(e){return np(this,e)}set(e){return ch(Ba(this,e),e)}cycle(e,n,r){switch(e){case"era":case"year":case"month":case"day":return dh(this,e,n,r);default:return rp(this,e,n,r)}}toDate(e,n){return Qg(this,e,n)}toString(){return ap(this)}compare(e){let n=Kg(this,e);return n===0?Hy(this,_r(e)):n}constructor(...e){uh(this,h3,{writable:!0,value:void 0});let[n,r,i,o,s]=hh(e);this.calendar=n,this.era=r,this.year=i,this.month=o,this.day=s,this.hour=e.shift()||0,this.minute=e.shift()||0,this.second=e.shift()||0,this.millisecond=e.shift()||0,zr(this)}}var f3=new WeakMap;class Bi{copy(){return this.era?new Bi(this.calendar,this.era,this.year,this.month,this.day,this.timeZone,this.offset,this.hour,this.minute,this.second,this.millisecond):new Bi(this.calendar,this.year,this.month,this.day,this.timeZone,this.offset,this.hour,this.minute,this.second,this.millisecond)}add(e){return ip(this,e)}subtract(e){return n3(this,e)}set(e,n){return i3(this,e,n)}cycle(e,n,r){return r3(this,e,n,r)}toDate(){return Qy(this)}toString(){return c3(this)}toAbsoluteString(){return this.toDate().toISOString()}compare(e){return this.toDate().getTime()-Xy(e,this.timeZone).toDate().getTime()}constructor(...e){uh(this,f3,{writable:!0,value:void 0});let[n,r,i,o,s]=hh(e),a=e.shift(),l=e.shift();this.calendar=n,this.era=r,this.year=i,this.month=o,this.day=s,this.timeZone=a,this.offset=l,this.hour=e.shift()||0,this.minute=e.shift()||0,this.second=e.shift()||0,this.millisecond=e.shift()||0,zr(this)}}let Tc=new Map;class m3{format(e){return this.formatter.format(e)}formatToParts(e){return this.formatter.formatToParts(e)}formatRange(e,n){if(typeof this.formatter.formatRange=="function")return this.formatter.formatRange(e,n);if(n<e)throw new RangeError("End date must be >= start date");return`${this.formatter.format(e)} – ${this.formatter.format(n)}`}formatRangeToParts(e,n){if(typeof this.formatter.formatRangeToParts=="function")return this.formatter.formatRangeToParts(e,n);if(n<e)throw new RangeError("End date must be >= start date");let r=this.formatter.formatToParts(e),i=this.formatter.formatToParts(n);return[...r.map(o=>({...o,source:"startRange"})),{type:"literal",value:" – ",source:"shared"},...i.map(o=>({...o,source:"endRange"}))]}resolvedOptions(){let e=this.formatter.resolvedOptions();return b3()&&(this.resolvedHourCycle||(this.resolvedHourCycle=v3(e.locale,this.options)),e.hourCycle=this.resolvedHourCycle,e.hour12=this.resolvedHourCycle==="h11"||this.resolvedHourCycle==="h12"),e.calendar==="ethiopic-amete-alem"&&(e.calendar="ethioaa"),e}constructor(e,n={}){this.formatter=lp(e,n),this.options=n}}const g3={true:{ja:"h11"},false:{}};function lp(t,e={}){if(typeof e.hour12=="boolean"&&p3()){e={...e};let i=g3[String(e.hour12)][t.split("-")[0]],o=e.hour12?"h12":"h23";e.hourCycle=i??o,delete e.hour12}let n=t+(e?Object.entries(e).sort((i,o)=>i[0]<o[0]?-1:1).join():"");if(Tc.has(n))return Tc.get(n);let r=new Intl.DateTimeFormat(t,e);return Tc.set(n,r),r}let Rc=null;function p3(){return Rc==null&&(Rc=new Intl.DateTimeFormat("en-US",{hour:"numeric",hour12:!1}).format(new Date(2020,2,3,0))==="24"),Rc}let Mc=null;function b3(){return Mc==null&&(Mc=new Intl.DateTimeFormat("fr",{hour:"numeric",hour12:!1}).resolvedOptions().hourCycle==="h12"),Mc}function v3(t,e){if(!e.timeStyle&&!e.hour)return;t=t.replace(/(-u-)?-nu-[a-zA-Z0-9]+/,""),t+=(t.includes("-u-")?"":"-u")+"-nu-latn";let n=lp(t,{...e,timeZone:void 0}),r=parseInt(n.formatToParts(new Date(2020,2,3,0)).find(o=>o.type==="hour").value,10),i=parseInt(n.formatToParts(new Date(2020,2,3,23)).find(o=>o.type==="hour").value,10);if(r===0&&i===23)return"h23";if(r===24&&i===23)return"h24";if(r===0&&i===11)return"h11";if(r===12&&i===11)return"h12";throw new Error("Unexpected hour cycle result")}function V(){return V=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)({}).hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},V.apply(null,arguments)}function U(t,e,{checkForDefaultPrevented:n=!0}={}){return function(i){if(t?.(i),n===!1||!i.defaultPrevented)return e?.(i)}}function x3(t,e){typeof t=="function"?t(e):t!=null&&(t.current=e)}function Al(...t){return e=>t.forEach(n=>x3(n,e))}function le(...t){return g.useCallback(Al(...t),t)}function fh(t,e){const n=g.createContext(e);function r(o){const{children:s,...a}=o,l=g.useMemo(()=>a,Object.values(a));return g.createElement(n.Provider,{value:l},s)}function i(o){const s=g.useContext(n);if(s)return s;if(e!==void 0)return e;throw new Error(`\`${o}\` must be used within \`${t}\``)}return r.displayName=t+"Provider",[r,i]}function qe(t,e=[]){let n=[];function r(o,s){const a=g.createContext(s),l=n.length;n=[...n,s];function c(h){const{scope:f,children:m,...p}=h,b=f?.[t][l]||a,v=g.useMemo(()=>p,Object.values(p));return g.createElement(b.Provider,{value:v},m)}function d(h,f){const m=f?.[t][l]||a,p=g.useContext(m);if(p)return p;if(s!==void 0)return s;throw new Error(`\`${h}\` must be used within \`${o}\``)}return c.displayName=o+"Provider",[c,d]}const i=()=>{const o=n.map(s=>g.createContext(s));return function(a){const l=a?.[t]||o;return g.useMemo(()=>({[`__scope${t}`]:{...a,[t]:l}}),[a,l])}};return i.scopeName=t,[r,w3(i,...e)]}function w3(...t){const e=t[0];if(t.length===1)return e;const n=()=>{const r=t.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(o){const s=r.reduce((a,{useScope:l,scopeName:c})=>{const h=l(o)[`__scope${c}`];return{...a,...h}},{});return g.useMemo(()=>({[`__scope${e.scopeName}`]:s}),[s])}};return n.scopeName=e.scopeName,n}const yn=g.forwardRef((t,e)=>{const{children:n,...r}=t,i=g.Children.toArray(n),o=i.find(y3);if(o){const s=o.props.children,a=i.map(l=>l===o?g.Children.count(s)>1?g.Children.only(null):g.isValidElement(s)?s.props.children:null:l);return g.createElement(Ld,V({},r,{ref:e}),g.isValidElement(s)?g.cloneElement(s,void 0,a):null)}return g.createElement(Ld,V({},r,{ref:e}),n)});yn.displayName="Slot";const Ld=g.forwardRef((t,e)=>{const{children:n,...r}=t;return g.isValidElement(n)?g.cloneElement(n,{...C3(r,n.props),ref:e?Al(e,n.ref):n.ref}):g.Children.count(n)>1?g.Children.only(null):null});Ld.displayName="SlotClone";const mh=({children:t})=>g.createElement(g.Fragment,null,t);function y3(t){return g.isValidElement(t)&&t.type===mh}function C3(t,e){const n={...e};for(const r in e){const i=t[r],o=e[r];/^on[A-Z]/.test(r)?i&&o?n[r]=(...a)=>{o(...a),i(...a)}:i&&(n[r]=i):r==="style"?n[r]={...i,...o}:r==="className"&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...t,...n}}const $3=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],oe=$3.reduce((t,e)=>{const n=g.forwardRef((r,i)=>{const{asChild:o,...s}=r,a=o?yn:e;return g.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),g.createElement(a,V({},s,{ref:i}))});return n.displayName=`Primitive.${e}`,{...t,[e]:n}},{});function S3(t,e){t&&Qi.flushSync(()=>t.dispatchEvent(e))}function A3(t,e=globalThis?.document){const n=Ke(t);g.useEffect(()=>{const r=i=>{i.key==="Escape"&&n(i)};return e.addEventListener("keydown",r),()=>e.removeEventListener("keydown",r)},[n,e])}const Nd="dismissableLayer.update",k3="dismissableLayer.pointerDownOutside",T3="dismissableLayer.focusOutside";let y0;const R3=g.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Zr=g.forwardRef((t,e)=>{var n;const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:s,onInteractOutside:a,onDismiss:l,...c}=t,d=g.useContext(R3),[h,f]=g.useState(null),m=(n=h?.ownerDocument)!==null&&n!==void 0?n:globalThis?.document,[,p]=g.useState({}),b=le(e,E=>f(E)),v=Array.from(d.layers),[x]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),w=v.indexOf(x),$=h?v.indexOf(h):-1,S=d.layersWithOutsidePointerEventsDisabled.size>0,A=$>=w,k=M3(E=>{const I=E.target,D=[...d.branches].some(B=>B.contains(I));!A||D||(o?.(E),a?.(E),E.defaultPrevented||l?.())},m),T=E3(E=>{const I=E.target;[...d.branches].some(B=>B.contains(I))||(s?.(E),a?.(E),E.defaultPrevented||l?.())},m);return A3(E=>{$===d.layers.size-1&&(i?.(E),!E.defaultPrevented&&l&&(E.preventDefault(),l()))},m),g.useEffect(()=>{if(h)return r&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(y0=m.body.style.pointerEvents,m.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(h)),d.layers.add(h),C0(),()=>{r&&d.layersWithOutsidePointerEventsDisabled.size===1&&(m.body.style.pointerEvents=y0)}},[h,m,r,d]),g.useEffect(()=>()=>{h&&(d.layers.delete(h),d.layersWithOutsidePointerEventsDisabled.delete(h),C0())},[h,d]),g.useEffect(()=>{const E=()=>p({});return document.addEventListener(Nd,E),()=>document.removeEventListener(Nd,E)},[]),g.createElement(oe.div,V({},c,{ref:b,style:{pointerEvents:S?A?"auto":"none":void 0,...t.style},onFocusCapture:U(t.onFocusCapture,T.onFocusCapture),onBlurCapture:U(t.onBlurCapture,T.onBlurCapture),onPointerDownCapture:U(t.onPointerDownCapture,k.onPointerDownCapture)}))});function M3(t,e=globalThis?.document){const n=Ke(t),r=g.useRef(!1),i=g.useRef(()=>{});return g.useEffect(()=>{const o=a=>{if(a.target&&!r.current){let c=function(){cp(k3,n,l,{discrete:!0})};const l={originalEvent:a};a.pointerType==="touch"?(e.removeEventListener("click",i.current),i.current=c,e.addEventListener("click",i.current,{once:!0})):c()}else e.removeEventListener("click",i.current);r.current=!1},s=window.setTimeout(()=>{e.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(s),e.removeEventListener("pointerdown",o),e.removeEventListener("click",i.current)}},[e,n]),{onPointerDownCapture:()=>r.current=!0}}function E3(t,e=globalThis?.document){const n=Ke(t),r=g.useRef(!1);return g.useEffect(()=>{const i=o=>{o.target&&!r.current&&cp(T3,n,{originalEvent:o},{discrete:!1})};return e.addEventListener("focusin",i),()=>e.removeEventListener("focusin",i)},[e,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function C0(){const t=new CustomEvent(Nd);document.dispatchEvent(t)}function cp(t,e,n,{discrete:r}){const i=n.originalEvent.target,o=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:n});e&&i.addEventListener(t,e,{once:!0}),r?S3(i,o):i.dispatchEvent(o)}const I3=Zr,Be=globalThis?.document?g.useLayoutEffect:()=>{},D3=y.useId||(()=>{});let O3=0;function at(t){const[e,n]=y.useState(D3());return Be(()=>{n(r=>r??String(O3++))},[t]),e?`radix-${e}`:""}const j3=["top","right","bottom","left"],dr=Math.min,Ot=Math.max,Va=Math.round,Ls=Math.floor,bn=t=>({x:t,y:t}),L3={left:"right",right:"left",bottom:"top",top:"bottom"},N3={start:"end",end:"start"};function Bd(t,e,n){return Ot(t,dr(e,n))}function qn(t,e){return typeof t=="function"?t(e):t}function Un(t){return t.split("-")[0]}function Zi(t){return t.split("-")[1]}function gh(t){return t==="x"?"y":"x"}function ph(t){return t==="y"?"height":"width"}const B3=new Set(["top","bottom"]);function fn(t){return B3.has(Un(t))?"y":"x"}function bh(t){return gh(fn(t))}function F3(t,e,n){n===void 0&&(n=!1);const r=Zi(t),i=bh(t),o=ph(i);let s=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[o]>e.floating[o]&&(s=_a(s)),[s,_a(s)]}function V3(t){const e=_a(t);return[Fd(t),e,Fd(e)]}function Fd(t){return t.replace(/start|end/g,e=>N3[e])}const $0=["left","right"],S0=["right","left"],_3=["top","bottom"],z3=["bottom","top"];function P3(t,e,n){switch(t){case"top":case"bottom":return n?e?S0:$0:e?$0:S0;case"left":case"right":return e?_3:z3;default:return[]}}function H3(t,e,n,r){const i=Zi(t);let o=P3(Un(t),n==="start",r);return i&&(o=o.map(s=>s+"-"+i),e&&(o=o.concat(o.map(Fd)))),o}function _a(t){return t.replace(/left|right|bottom|top/g,e=>L3[e])}function W3(t){return{top:0,right:0,bottom:0,left:0,...t}}function dp(t){return typeof t!="number"?W3(t):{top:t,right:t,bottom:t,left:t}}function za(t){const{x:e,y:n,width:r,height:i}=t;return{width:r,height:i,top:n,left:e,right:e+r,bottom:n+i,x:e,y:n}}function A0(t,e,n){let{reference:r,floating:i}=t;const o=fn(e),s=bh(e),a=ph(s),l=Un(e),c=o==="y",d=r.x+r.width/2-i.width/2,h=r.y+r.height/2-i.height/2,f=r[a]/2-i[a]/2;let m;switch(l){case"top":m={x:d,y:r.y-i.height};break;case"bottom":m={x:d,y:r.y+r.height};break;case"right":m={x:r.x+r.width,y:h};break;case"left":m={x:r.x-i.width,y:h};break;default:m={x:r.x,y:r.y}}switch(Zi(e)){case"start":m[s]-=f*(n&&c?-1:1);break;case"end":m[s]+=f*(n&&c?-1:1);break}return m}const q3=async(t,e,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:s}=n,a=o.filter(Boolean),l=await(s.isRTL==null?void 0:s.isRTL(e));let c=await s.getElementRects({reference:t,floating:e,strategy:i}),{x:d,y:h}=A0(c,r,l),f=r,m={},p=0;for(let b=0;b<a.length;b++){const{name:v,fn:x}=a[b],{x:w,y:$,data:S,reset:A}=await x({x:d,y:h,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:c,platform:s,elements:{reference:t,floating:e}});d=w??d,h=$??h,m={...m,[v]:{...m[v],...S}},A&&p<=50&&(p++,typeof A=="object"&&(A.placement&&(f=A.placement),A.rects&&(c=A.rects===!0?await s.getElementRects({reference:t,floating:e,strategy:i}):A.rects),{x:d,y:h}=A0(c,f,l)),b=-1)}return{x:d,y:h,placement:f,strategy:i,middlewareData:m}};async function Vo(t,e){var n;e===void 0&&(e={});const{x:r,y:i,platform:o,rects:s,elements:a,strategy:l}=t,{boundary:c="clippingAncestors",rootBoundary:d="viewport",elementContext:h="floating",altBoundary:f=!1,padding:m=0}=qn(e,t),p=dp(m),v=a[f?h==="floating"?"reference":"floating":h],x=za(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(v)))==null||n?v:v.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(a.floating)),boundary:c,rootBoundary:d,strategy:l})),w=h==="floating"?{x:r,y:i,width:s.floating.width,height:s.floating.height}:s.reference,$=await(o.getOffsetParent==null?void 0:o.getOffsetParent(a.floating)),S=await(o.isElement==null?void 0:o.isElement($))?await(o.getScale==null?void 0:o.getScale($))||{x:1,y:1}:{x:1,y:1},A=za(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:w,offsetParent:$,strategy:l}):w);return{top:(x.top-A.top+p.top)/S.y,bottom:(A.bottom-x.bottom+p.bottom)/S.y,left:(x.left-A.left+p.left)/S.x,right:(A.right-x.right+p.right)/S.x}}const U3=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:r,placement:i,rects:o,platform:s,elements:a,middlewareData:l}=e,{element:c,padding:d=0}=qn(t,e)||{};if(c==null)return{};const h=dp(d),f={x:n,y:r},m=bh(i),p=ph(m),b=await s.getDimensions(c),v=m==="y",x=v?"top":"left",w=v?"bottom":"right",$=v?"clientHeight":"clientWidth",S=o.reference[p]+o.reference[m]-f[m]-o.floating[p],A=f[m]-o.reference[m],k=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c));let T=k?k[$]:0;(!T||!await(s.isElement==null?void 0:s.isElement(k)))&&(T=a.floating[$]||o.floating[p]);const E=S/2-A/2,I=T/2-b[p]/2-1,D=dr(h[x],I),B=dr(h[w],I),O=D,H=T-b[p]-B,z=T/2-b[p]/2+E,W=Bd(O,z,H),G=!l.arrow&&Zi(i)!=null&&z!==W&&o.reference[p]/2-(z<O?D:B)-b[p]/2<0,_=G?z<O?z-O:z-H:0;return{[m]:f[m]+_,data:{[m]:W,centerOffset:z-W-_,...G&&{alignmentOffset:_}},reset:G}}}),K3=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,r;const{placement:i,middlewareData:o,rects:s,initialPlacement:a,platform:l,elements:c}=e,{mainAxis:d=!0,crossAxis:h=!0,fallbackPlacements:f,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:b=!0,...v}=qn(t,e);if((n=o.arrow)!=null&&n.alignmentOffset)return{};const x=Un(i),w=fn(a),$=Un(a)===a,S=await(l.isRTL==null?void 0:l.isRTL(c.floating)),A=f||($||!b?[_a(a)]:V3(a)),k=p!=="none";!f&&k&&A.push(...H3(a,b,p,S));const T=[a,...A],E=await Vo(e,v),I=[];let D=((r=o.flip)==null?void 0:r.overflows)||[];if(d&&I.push(E[x]),h){const z=F3(i,s,S);I.push(E[z[0]],E[z[1]])}if(D=[...D,{placement:i,overflows:I}],!I.every(z=>z<=0)){var B,O;const z=(((B=o.flip)==null?void 0:B.index)||0)+1,W=T[z];if(W&&(!(h==="alignment"?w!==fn(W):!1)||D.every(N=>fn(N.placement)===w?N.overflows[0]>0:!0)))return{data:{index:z,overflows:D},reset:{placement:W}};let G=(O=D.filter(_=>_.overflows[0]<=0).sort((_,N)=>_.overflows[1]-N.overflows[1])[0])==null?void 0:O.placement;if(!G)switch(m){case"bestFit":{var H;const _=(H=D.filter(N=>{if(k){const j=fn(N.placement);return j===w||j==="y"}return!0}).map(N=>[N.placement,N.overflows.filter(j=>j>0).reduce((j,Y)=>j+Y,0)]).sort((N,j)=>N[1]-j[1])[0])==null?void 0:H[0];_&&(G=_);break}case"initialPlacement":G=a;break}if(i!==G)return{reset:{placement:G}}}return{}}}};function k0(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function T0(t){return j3.some(e=>t[e]>=0)}const G3=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n}=e,{strategy:r="referenceHidden",...i}=qn(t,e);switch(r){case"referenceHidden":{const o=await Vo(e,{...i,elementContext:"reference"}),s=k0(o,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:T0(s)}}}case"escaped":{const o=await Vo(e,{...i,altBoundary:!0}),s=k0(o,n.floating);return{data:{escapedOffsets:s,escaped:T0(s)}}}default:return{}}}}},up=new Set(["left","top"]);async function Y3(t,e){const{placement:n,platform:r,elements:i}=t,o=await(r.isRTL==null?void 0:r.isRTL(i.floating)),s=Un(n),a=Zi(n),l=fn(n)==="y",c=up.has(s)?-1:1,d=o&&l?-1:1,h=qn(e,t);let{mainAxis:f,crossAxis:m,alignmentAxis:p}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return a&&typeof p=="number"&&(m=a==="end"?p*-1:p),l?{x:m*d,y:f*c}:{x:f*c,y:m*d}}const X3=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,r;const{x:i,y:o,placement:s,middlewareData:a}=e,l=await Y3(e,t);return s===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:i+l.x,y:o+l.y,data:{...l,placement:s}}}}},Q3=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:r,placement:i}=e,{mainAxis:o=!0,crossAxis:s=!1,limiter:a={fn:v=>{let{x,y:w}=v;return{x,y:w}}},...l}=qn(t,e),c={x:n,y:r},d=await Vo(e,l),h=fn(Un(i)),f=gh(h);let m=c[f],p=c[h];if(o){const v=f==="y"?"top":"left",x=f==="y"?"bottom":"right",w=m+d[v],$=m-d[x];m=Bd(w,m,$)}if(s){const v=h==="y"?"top":"left",x=h==="y"?"bottom":"right",w=p+d[v],$=p-d[x];p=Bd(w,p,$)}const b=a.fn({...e,[f]:m,[h]:p});return{...b,data:{x:b.x-n,y:b.y-r,enabled:{[f]:o,[h]:s}}}}}},Z3=function(t){return t===void 0&&(t={}),{options:t,fn(e){const{x:n,y:r,placement:i,rects:o,middlewareData:s}=e,{offset:a=0,mainAxis:l=!0,crossAxis:c=!0}=qn(t,e),d={x:n,y:r},h=fn(i),f=gh(h);let m=d[f],p=d[h];const b=qn(a,e),v=typeof b=="number"?{mainAxis:b,crossAxis:0}:{mainAxis:0,crossAxis:0,...b};if(l){const $=f==="y"?"height":"width",S=o.reference[f]-o.floating[$]+v.mainAxis,A=o.reference[f]+o.reference[$]-v.mainAxis;m<S?m=S:m>A&&(m=A)}if(c){var x,w;const $=f==="y"?"width":"height",S=up.has(Un(i)),A=o.reference[h]-o.floating[$]+(S&&((x=s.offset)==null?void 0:x[h])||0)+(S?0:v.crossAxis),k=o.reference[h]+o.reference[$]+(S?0:((w=s.offset)==null?void 0:w[h])||0)-(S?v.crossAxis:0);p<A?p=A:p>k&&(p=k)}return{[f]:m,[h]:p}}}},J3=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var n,r;const{placement:i,rects:o,platform:s,elements:a}=e,{apply:l=()=>{},...c}=qn(t,e),d=await Vo(e,c),h=Un(i),f=Zi(i),m=fn(i)==="y",{width:p,height:b}=o.floating;let v,x;h==="top"||h==="bottom"?(v=h,x=f===(await(s.isRTL==null?void 0:s.isRTL(a.floating))?"start":"end")?"left":"right"):(x=h,v=f==="end"?"top":"bottom");const w=b-d.top-d.bottom,$=p-d.left-d.right,S=dr(b-d[v],w),A=dr(p-d[x],$),k=!e.middlewareData.shift;let T=S,E=A;if((n=e.middlewareData.shift)!=null&&n.enabled.x&&(E=$),(r=e.middlewareData.shift)!=null&&r.enabled.y&&(T=w),k&&!f){const D=Ot(d.left,0),B=Ot(d.right,0),O=Ot(d.top,0),H=Ot(d.bottom,0);m?E=p-2*(D!==0||B!==0?D+B:Ot(d.left,d.right)):T=b-2*(O!==0||H!==0?O+H:Ot(d.top,d.bottom))}await l({...e,availableWidth:E,availableHeight:T});const I=await s.getDimensions(a.floating);return p!==I.width||b!==I.height?{reset:{rects:!0}}:{}}}};function kl(){return typeof window<"u"}function Ji(t){return hp(t)?(t.nodeName||"").toLowerCase():"#document"}function Lt(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function Tn(t){var e;return(e=(hp(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function hp(t){return kl()?t instanceof Node||t instanceof Lt(t).Node:!1}function Xt(t){return kl()?t instanceof Element||t instanceof Lt(t).Element:!1}function Cn(t){return kl()?t instanceof HTMLElement||t instanceof Lt(t).HTMLElement:!1}function R0(t){return!kl()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof Lt(t).ShadowRoot}const e6=new Set(["inline","contents"]);function ds(t){const{overflow:e,overflowX:n,overflowY:r,display:i}=Qt(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&!e6.has(i)}const t6=new Set(["table","td","th"]);function n6(t){return t6.has(Ji(t))}const r6=[":popover-open",":modal"];function Tl(t){return r6.some(e=>{try{return t.matches(e)}catch{return!1}})}const i6=["transform","translate","scale","rotate","perspective"],o6=["transform","translate","scale","rotate","perspective","filter"],s6=["paint","layout","strict","content"];function vh(t){const e=xh(),n=Xt(t)?Qt(t):t;return i6.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||o6.some(r=>(n.willChange||"").includes(r))||s6.some(r=>(n.contain||"").includes(r))}function a6(t){let e=ur(t);for(;Cn(e)&&!Fi(e);){if(vh(e))return e;if(Tl(e))return null;e=ur(e)}return null}function xh(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const l6=new Set(["html","body","#document"]);function Fi(t){return l6.has(Ji(t))}function Qt(t){return Lt(t).getComputedStyle(t)}function Rl(t){return Xt(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function ur(t){if(Ji(t)==="html")return t;const e=t.assignedSlot||t.parentNode||R0(t)&&t.host||Tn(t);return R0(e)?e.host:e}function fp(t){const e=ur(t);return Fi(e)?t.ownerDocument?t.ownerDocument.body:t.body:Cn(e)&&ds(e)?e:fp(e)}function _o(t,e,n){var r;e===void 0&&(e=[]),n===void 0&&(n=!0);const i=fp(t),o=i===((r=t.ownerDocument)==null?void 0:r.body),s=Lt(i);if(o){const a=Vd(s);return e.concat(s,s.visualViewport||[],ds(i)?i:[],a&&n?_o(a):[])}return e.concat(i,_o(i,[],n))}function Vd(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function mp(t){const e=Qt(t);let n=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const i=Cn(t),o=i?t.offsetWidth:n,s=i?t.offsetHeight:r,a=Va(n)!==o||Va(r)!==s;return a&&(n=o,r=s),{width:n,height:r,$:a}}function wh(t){return Xt(t)?t:t.contextElement}function Ci(t){const e=wh(t);if(!Cn(e))return bn(1);const n=e.getBoundingClientRect(),{width:r,height:i,$:o}=mp(e);let s=(o?Va(n.width):n.width)/r,a=(o?Va(n.height):n.height)/i;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const c6=bn(0);function gp(t){const e=Lt(t);return!xh()||!e.visualViewport?c6:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function d6(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==Lt(t)?!1:e}function Pr(t,e,n,r){e===void 0&&(e=!1),n===void 0&&(n=!1);const i=t.getBoundingClientRect(),o=wh(t);let s=bn(1);e&&(r?Xt(r)&&(s=Ci(r)):s=Ci(t));const a=d6(o,n,r)?gp(o):bn(0);let l=(i.left+a.x)/s.x,c=(i.top+a.y)/s.y,d=i.width/s.x,h=i.height/s.y;if(o){const f=Lt(o),m=r&&Xt(r)?Lt(r):r;let p=f,b=Vd(p);for(;b&&r&&m!==p;){const v=Ci(b),x=b.getBoundingClientRect(),w=Qt(b),$=x.left+(b.clientLeft+parseFloat(w.paddingLeft))*v.x,S=x.top+(b.clientTop+parseFloat(w.paddingTop))*v.y;l*=v.x,c*=v.y,d*=v.x,h*=v.y,l+=$,c+=S,p=Lt(b),b=Vd(p)}}return za({width:d,height:h,x:l,y:c})}function Ml(t,e){const n=Rl(t).scrollLeft;return e?e.left+n:Pr(Tn(t)).left+n}function pp(t,e){const n=t.getBoundingClientRect(),r=n.left+e.scrollLeft-Ml(t,n),i=n.top+e.scrollTop;return{x:r,y:i}}function u6(t){let{elements:e,rect:n,offsetParent:r,strategy:i}=t;const o=i==="fixed",s=Tn(r),a=e?Tl(e.floating):!1;if(r===s||a&&o)return n;let l={scrollLeft:0,scrollTop:0},c=bn(1);const d=bn(0),h=Cn(r);if((h||!h&&!o)&&((Ji(r)!=="body"||ds(s))&&(l=Rl(r)),Cn(r))){const m=Pr(r);c=Ci(r),d.x=m.x+r.clientLeft,d.y=m.y+r.clientTop}const f=s&&!h&&!o?pp(s,l):bn(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+d.x+f.x,y:n.y*c.y-l.scrollTop*c.y+d.y+f.y}}function h6(t){return Array.from(t.getClientRects())}function f6(t){const e=Tn(t),n=Rl(t),r=t.ownerDocument.body,i=Ot(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),o=Ot(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+Ml(t);const a=-n.scrollTop;return Qt(r).direction==="rtl"&&(s+=Ot(e.clientWidth,r.clientWidth)-i),{width:i,height:o,x:s,y:a}}const M0=25;function m6(t,e){const n=Lt(t),r=Tn(t),i=n.visualViewport;let o=r.clientWidth,s=r.clientHeight,a=0,l=0;if(i){o=i.width,s=i.height;const d=xh();(!d||d&&e==="fixed")&&(a=i.offsetLeft,l=i.offsetTop)}const c=Ml(r);if(c<=0){const d=r.ownerDocument,h=d.body,f=getComputedStyle(h),m=d.compatMode==="CSS1Compat"&&parseFloat(f.marginLeft)+parseFloat(f.marginRight)||0,p=Math.abs(r.clientWidth-h.clientWidth-m);p<=M0&&(o-=p)}else c<=M0&&(o+=c);return{width:o,height:s,x:a,y:l}}const g6=new Set(["absolute","fixed"]);function p6(t,e){const n=Pr(t,!0,e==="fixed"),r=n.top+t.clientTop,i=n.left+t.clientLeft,o=Cn(t)?Ci(t):bn(1),s=t.clientWidth*o.x,a=t.clientHeight*o.y,l=i*o.x,c=r*o.y;return{width:s,height:a,x:l,y:c}}function E0(t,e,n){let r;if(e==="viewport")r=m6(t,n);else if(e==="document")r=f6(Tn(t));else if(Xt(e))r=p6(e,n);else{const i=gp(t);r={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return za(r)}function bp(t,e){const n=ur(t);return n===e||!Xt(n)||Fi(n)?!1:Qt(n).position==="fixed"||bp(n,e)}function b6(t,e){const n=e.get(t);if(n)return n;let r=_o(t,[],!1).filter(a=>Xt(a)&&Ji(a)!=="body"),i=null;const o=Qt(t).position==="fixed";let s=o?ur(t):t;for(;Xt(s)&&!Fi(s);){const a=Qt(s),l=vh(s);!l&&a.position==="fixed"&&(i=null),(o?!l&&!i:!l&&a.position==="static"&&!!i&&g6.has(i.position)||ds(s)&&!l&&bp(t,s))?r=r.filter(d=>d!==s):i=a,s=ur(s)}return e.set(t,r),r}function v6(t){let{element:e,boundary:n,rootBoundary:r,strategy:i}=t;const s=[...n==="clippingAncestors"?Tl(e)?[]:b6(e,this._c):[].concat(n),r],a=s[0],l=s.reduce((c,d)=>{const h=E0(e,d,i);return c.top=Ot(h.top,c.top),c.right=dr(h.right,c.right),c.bottom=dr(h.bottom,c.bottom),c.left=Ot(h.left,c.left),c},E0(e,a,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function x6(t){const{width:e,height:n}=mp(t);return{width:e,height:n}}function w6(t,e,n){const r=Cn(e),i=Tn(e),o=n==="fixed",s=Pr(t,!0,o,e);let a={scrollLeft:0,scrollTop:0};const l=bn(0);function c(){l.x=Ml(i)}if(r||!r&&!o)if((Ji(e)!=="body"||ds(i))&&(a=Rl(e)),r){const m=Pr(e,!0,o,e);l.x=m.x+e.clientLeft,l.y=m.y+e.clientTop}else i&&c();o&&!r&&i&&c();const d=i&&!r&&!o?pp(i,a):bn(0),h=s.left+a.scrollLeft-l.x-d.x,f=s.top+a.scrollTop-l.y-d.y;return{x:h,y:f,width:s.width,height:s.height}}function Ec(t){return Qt(t).position==="static"}function I0(t,e){if(!Cn(t)||Qt(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return Tn(t)===n&&(n=n.ownerDocument.body),n}function vp(t,e){const n=Lt(t);if(Tl(t))return n;if(!Cn(t)){let i=ur(t);for(;i&&!Fi(i);){if(Xt(i)&&!Ec(i))return i;i=ur(i)}return n}let r=I0(t,e);for(;r&&n6(r)&&Ec(r);)r=I0(r,e);return r&&Fi(r)&&Ec(r)&&!vh(r)?n:r||a6(t)||n}const y6=async function(t){const e=this.getOffsetParent||vp,n=this.getDimensions,r=await n(t.floating);return{reference:w6(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function C6(t){return Qt(t).direction==="rtl"}const $6={convertOffsetParentRelativeRectToViewportRelativeRect:u6,getDocumentElement:Tn,getClippingRect:v6,getOffsetParent:vp,getElementRects:y6,getClientRects:h6,getDimensions:x6,getScale:Ci,isElement:Xt,isRTL:C6};function xp(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function S6(t,e){let n=null,r;const i=Tn(t);function o(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function s(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),o();const c=t.getBoundingClientRect(),{left:d,top:h,width:f,height:m}=c;if(a||e(),!f||!m)return;const p=Ls(h),b=Ls(i.clientWidth-(d+f)),v=Ls(i.clientHeight-(h+m)),x=Ls(d),$={rootMargin:-p+"px "+-b+"px "+-v+"px "+-x+"px",threshold:Ot(0,dr(1,l))||1};let S=!0;function A(k){const T=k[0].intersectionRatio;if(T!==l){if(!S)return s();T?s(!1,T):r=setTimeout(()=>{s(!1,1e-7)},1e3)}T===1&&!xp(c,t.getBoundingClientRect())&&s(),S=!1}try{n=new IntersectionObserver(A,{...$,root:i.ownerDocument})}catch{n=new IntersectionObserver(A,$)}n.observe(t)}return s(!0),o}function wp(t,e,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,c=wh(t),d=i||o?[...c?_o(c):[],..._o(e)]:[];d.forEach(x=>{i&&x.addEventListener("scroll",n,{passive:!0}),o&&x.addEventListener("resize",n)});const h=c&&a?S6(c,n):null;let f=-1,m=null;s&&(m=new ResizeObserver(x=>{let[w]=x;w&&w.target===c&&m&&(m.unobserve(e),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var $;($=m)==null||$.observe(e)})),n()}),c&&!l&&m.observe(c),m.observe(e));let p,b=l?Pr(t):null;l&&v();function v(){const x=Pr(t);b&&!xp(b,x)&&n(),b=x,p=requestAnimationFrame(v)}return n(),()=>{var x;d.forEach(w=>{i&&w.removeEventListener("scroll",n),o&&w.removeEventListener("resize",n)}),h?.(),(x=m)==null||x.disconnect(),m=null,l&&cancelAnimationFrame(p)}}const yp=X3,Cp=Q3,$p=K3,A6=J3,k6=G3,D0=U3,T6=Z3,Sp=(t,e,n)=>{const r=new Map,i={platform:$6,...n},o={...i.platform,_c:r};return q3(t,e,{...i,platform:o})};var R6=typeof document<"u",M6=function(){},Ca=R6?g.useLayoutEffect:M6;function Pa(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let n,r,i;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(n=t.length,n!==e.length)return!1;for(r=n;r--!==0;)if(!Pa(t[r],e[r]))return!1;return!0}if(i=Object.keys(t),n=i.length,n!==Object.keys(e).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(e,i[r]))return!1;for(r=n;r--!==0;){const o=i[r];if(!(o==="_owner"&&t.$$typeof)&&!Pa(t[o],e[o]))return!1}return!0}return t!==t&&e!==e}function Ap(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function O0(t,e){const n=Ap(t);return Math.round(e*n)/n}function Ic(t){const e=y.useRef(t);return Ca(()=>{e.current=t}),e}function E6(t){t===void 0&&(t={});const{placement:e="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:o,floating:s}={},transform:a=!0,whileElementsMounted:l,open:c}=t,[d,h]=y.useState({x:0,y:0,strategy:n,placement:e,middlewareData:{},isPositioned:!1}),[f,m]=y.useState(r);Pa(f,r)||m(r);const[p,b]=y.useState(null),[v,x]=y.useState(null),w=y.useCallback(N=>{N!==k.current&&(k.current=N,b(N))},[]),$=y.useCallback(N=>{N!==T.current&&(T.current=N,x(N))},[]),S=o||p,A=s||v,k=y.useRef(null),T=y.useRef(null),E=y.useRef(d),I=l!=null,D=Ic(l),B=Ic(i),O=Ic(c),H=y.useCallback(()=>{if(!k.current||!T.current)return;const N={placement:e,strategy:n,middleware:f};B.current&&(N.platform=B.current),Sp(k.current,T.current,N).then(j=>{const Y={...j,isPositioned:O.current!==!1};z.current&&!Pa(E.current,Y)&&(E.current=Y,Qr.flushSync(()=>{h(Y)}))})},[f,e,n,B,O]);Ca(()=>{c===!1&&E.current.isPositioned&&(E.current.isPositioned=!1,h(N=>({...N,isPositioned:!1})))},[c]);const z=y.useRef(!1);Ca(()=>(z.current=!0,()=>{z.current=!1}),[]),Ca(()=>{if(S&&(k.current=S),A&&(T.current=A),S&&A){if(D.current)return D.current(S,A,H);H()}},[S,A,H,D,I]);const W=y.useMemo(()=>({reference:k,floating:T,setReference:w,setFloating:$}),[w,$]),G=y.useMemo(()=>({reference:S,floating:A}),[S,A]),_=y.useMemo(()=>{const N={position:n,left:0,top:0};if(!G.floating)return N;const j=O0(G.floating,d.x),Y=O0(G.floating,d.y);return a?{...N,transform:"translate("+j+"px, "+Y+"px)",...Ap(G.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:j,top:Y}},[n,a,G.floating,d.x,d.y]);return y.useMemo(()=>({...d,update:H,refs:W,elements:G,floatingStyles:_}),[d,H,W,G,_])}const I6=t=>{function e(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:t,fn(n){const{element:r,padding:i}=typeof t=="function"?t(n):t;return r&&e(r)?r.current!=null?D0({element:r.current,padding:i}).fn(n):{}:r?D0({element:r,padding:i}).fn(n):{}}}},D6=(t,e)=>({...yp(t),options:[t,e]}),O6=(t,e)=>({...Cp(t),options:[t,e]}),j6=(t,e)=>({...T6(t),options:[t,e]}),L6=(t,e)=>({...$p(t),options:[t,e]}),N6=(t,e)=>({...A6(t),options:[t,e]}),B6=(t,e)=>({...k6(t),options:[t,e]}),F6=(t,e)=>({...I6(t),options:[t,e]}),V6=g.forwardRef((t,e)=>{const{children:n,width:r=10,height:i=5,...o}=t;return g.createElement(oe.svg,V({},o,{ref:e,width:r,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none"}),t.asChild?n:g.createElement("polygon",{points:"0,0 30,0 15,10"}))}),_6=V6;function El(t){const[e,n]=g.useState(void 0);return Be(()=>{if(t){n({width:t.offsetWidth,height:t.offsetHeight});const r=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const o=i[0];let s,a;if("borderBoxSize"in o){const l=o.borderBoxSize,c=Array.isArray(l)?l[0]:l;s=c.inlineSize,a=c.blockSize}else s=t.offsetWidth,a=t.offsetHeight;n({width:s,height:a})});return r.observe(t,{box:"border-box"}),()=>r.unobserve(t)}else n(void 0)},[t]),e}const kp="Popper",[Tp,vr]=qe(kp),[z6,Rp]=Tp(kp),P6=t=>{const{__scopePopper:e,children:n}=t,[r,i]=g.useState(null);return g.createElement(z6,{scope:e,anchor:r,onAnchorChange:i},n)},H6="PopperAnchor",W6=g.forwardRef((t,e)=>{const{__scopePopper:n,virtualRef:r,...i}=t,o=Rp(H6,n),s=g.useRef(null),a=le(e,s);return g.useEffect(()=>{o.onAnchorChange(r?.current||s.current)}),r?null:g.createElement(oe.div,V({},i,{ref:a}))}),Mp="PopperContent",[q6,U6]=Tp(Mp),K6=g.forwardRef((t,e)=>{var n,r,i,o,s,a,l,c;const{__scopePopper:d,side:h="bottom",sideOffset:f=0,align:m="center",alignOffset:p=0,arrowPadding:b=0,avoidCollisions:v=!0,collisionBoundary:x=[],collisionPadding:w=0,sticky:$="partial",hideWhenDetached:S=!1,updatePositionStrategy:A="optimized",onPlaced:k,...T}=t,E=Rp(Mp,d),[I,D]=g.useState(null),B=le(e,xe=>D(xe)),[O,H]=g.useState(null),z=El(O),W=(n=z?.width)!==null&&n!==void 0?n:0,G=(r=z?.height)!==null&&r!==void 0?r:0,_=h+(m!=="center"?"-"+m:""),N=typeof w=="number"?w:{top:0,right:0,bottom:0,left:0,...w},j=Array.isArray(x)?x:[x],Y=j.length>0,Z={padding:N,boundary:j.filter(Q6),altBoundary:Y},{refs:he,floatingStyles:se,placement:pe,isPositioned:be,middlewareData:Ae}=E6({strategy:"fixed",placement:_,whileElementsMounted:(...xe)=>wp(...xe,{animationFrame:A==="always"}),elements:{reference:E.anchor},middleware:[D6({mainAxis:f+G,alignmentAxis:p}),v&&O6({mainAxis:!0,crossAxis:!1,limiter:$==="partial"?j6():void 0,...Z}),v&&