UNPKG

strapi-plugin-comments

Version:
1 lines 913 kB
"use strict";const b=require("react"),k=require("styled-components"),p=require("react/jsx-runtime"),Za=require("react-dom");function yw(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 $=yw(b),yo=yw(Za),s0=(t,e="")=>Object.keys(t).reduce((n,r)=>{const i=e.length?`${e}.`:"";return typeof t[r]=="object"&&t[r]!==null&&!Array.isArray(t[r])?Object.assign(n,s0(t[r],i+r)):n[i+r]=t[r],n},{}),bv=(t,e)=>{if(!e)throw new TypeError("pluginId can't be empty");return Object.keys(t).reduce((n,r)=>(n[`${e}.${r}`]=t[r],n),{})};function Ct(t){const e=b.useRef(t);return b.useEffect(()=>{e.current=t}),b.useMemo(()=>(...n)=>{var r;return(r=e.current)===null||r===void 0?void 0:r.call(e,...n)},[])}function ud(t,e){return t-e*Math.floor(t/e)}const Cw=1721426;function uc(t,e,n,r){e=H1(t,e);let i=e-1,o=-2;return n<=2?o=0:Gc(e)&&(o=-1),Cw-1+365*i+Math.floor(i/4)-Math.floor(i/100)+Math.floor(i/400)+Math.floor((367*n-362)/12+o+r)}function Gc(t){return t%4===0&&(t%100!==0||t%400===0)}function H1(t,e){return t==="BC"?1-e:e}function lT(t){let e="AD";return t<=0&&(e="BC",t=1-t),[e,t]}const cT={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 ds{fromJulianDay(e){let n=e,r=n-Cw,i=Math.floor(r/146097),o=ud(r,146097),s=Math.floor(o/36524),a=ud(o,36524),c=Math.floor(a/1461),h=ud(a,1461),f=Math.floor(h/365),d=i*400+s*100+c*4+f+(s!==4&&f!==4?1:0),[m,v]=lT(d),w=n-uc(m,v,1,1),x=2;n<uc(m,v,3,1)?x=0:Gc(v)&&(x=1);let C=Math.floor(((w+x)*12+373)/367),S=n-uc(m,v,C,1)+1;return new Ra(m,v,C,S)}toJulianDay(e){return uc(e.era,e.year,e.month,e.day)}getDaysInMonth(e){return cT[Gc(e.year)?"leapyear":"standard"][e.month-1]}getMonthsInYear(e){return 12}getDaysInYear(e){return Gc(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 uT={"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 $w(t,e){return e=Gn(e,t.calendar),t.era===e.era&&t.year===e.year&&t.month===e.month&&t.day===e.day}function Sw(t,e){let n=t.calendar.toJulianDay(t),r=Math.ceil(n+1-pT(e))%7;return r<0&&(r+=7),r}function hT(t){return Gr(Date.now(),t)}function P1(t){return Ew(hT(t))}function Aw(t,e){return t.calendar.toJulianDay(t)-e.calendar.toJulianDay(e)}function fT(t,e){return wv(t)-wv(e)}function wv(t){return t.hour*36e5+t.minute*6e4+t.second*1e3+t.millisecond}let hd=null;function gs(){return hd==null&&(hd=new Intl.DateTimeFormat().resolvedOptions().timeZone),hd}function dT(t){return t.subtract({days:t.day-1})}function gT(t){return t.add({days:t.calendar.getDaysInMonth(t)-t.day})}function Rw(t,e){let n=Sw(t,e);return t.subtract({days:n})}const xv=new Map;function mT(t){if(Intl.Locale){let n=xv.get(t);return n||(n=new Intl.Locale(t).maximize().region,n&&xv.set(t,n)),n}let e=t.split("-")[1];return e==="u"?void 0:e}function pT(t){let e=mT(t);return e&&uT[e]||0}function a0(t,e){return t&&e?t.compare(e)<=0?t:e:t||e}function l0(t,e){return t&&e?t.compare(e)>=0?t:e:t||e}function ms(t){t=Gn(t,new ds);let e=H1(t.era,t.year);return kw(e,t.month,t.day,t.hour,t.minute,t.second,t.millisecond)}function kw(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 c0(t,e){if(e==="UTC")return 0;if(t>0&&e===gs())return new Date(t).getTimezoneOffset()*-6e4;let{year:n,month:r,day:i,hour:o,minute:s,second:a}=Tw(t,e);return kw(n,r,i,o,s,a,0)-Math.floor(t/1e3)*1e3}const yv=new Map;function Tw(t,e){let n=yv.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"}),yv.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 Cv=864e5;function vT(t,e,n,r){return(n===r?[n]:[n,r]).filter(o=>bT(t,e,o))}function bT(t,e,n){let r=Tw(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 qr(t,e,n="compatible"){let r=co(t);if(e==="UTC")return ms(r);if(e===gs()&&n==="compatible"){r=Gn(r,new ds);let c=new Date,h=H1(r.era,r.year);return c.setFullYear(h,r.month-1,r.day),c.setHours(r.hour,r.minute,r.second,r.millisecond),c.getTime()}let i=ms(r),o=c0(i-Cv,e),s=c0(i+Cv,e),a=vT(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 Mw(t,e,n="compatible"){return new Date(qr(t,e,n))}function Gr(t,e){let n=c0(t,e),r=new Date(t+n),i=r.getUTCFullYear(),o=r.getUTCMonth()+1,s=r.getUTCDate(),a=r.getUTCHours(),c=r.getUTCMinutes(),h=r.getUTCSeconds(),f=r.getUTCMilliseconds();return new ps(i,o,s,e,n,a,c,h,f)}function Ew(t){return new Ra(t.calendar,t.era,t.year,t.month,t.day)}function co(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 hu(t.calendar,t.era,t.year,t.month,t.day,n,r,i,o)}function Gn(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,uo(r),r}function wT(t,e,n){if(t instanceof ps)return t.timeZone===e?t:Ow(t,e);let r=qr(t,e,n);return Gr(r,e)}function xT(t){let e=ms(t)-t.offset;return new Date(e)}function Ow(t,e){let n=ms(t)-t.offset;return Gn(Gr(n,e),t.calendar)}const oa=36e5;function Qu(t,e){let n=t.copy(),r="hour"in n?ST(n,e):0;u0(n,e.years||0),n.calendar.balanceYearMonth&&n.calendar.balanceYearMonth(n,t),n.month+=e.months||0,h0(n),Dw(n),n.day+=(e.weeks||0)*7,n.day+=e.days||0,n.day+=r,yT(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 c=(o=(s=n.calendar).isInverseEra)===null||o===void 0?void 0:o.call(s,n);n.year=i,n.month=c?1:n.calendar.getMonthsInYear(n),n.day=c?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 u0(t,e){var n,r;!((n=(r=t.calendar).isInverseEra)===null||n===void 0)&&n.call(r,t)&&(e=-e),t.year+=e}function h0(t){for(;t.month<1;)u0(t,-1),t.month+=t.calendar.getMonthsInYear(t);let e=0;for(;t.month>(e=t.calendar.getMonthsInYear(t));)t.month-=e,u0(t,1)}function yT(t){for(;t.day<1;)t.month--,h0(t),t.day+=t.calendar.getDaysInMonth(t);for(;t.day>t.calendar.getDaysInMonth(t);)t.day-=t.calendar.getDaysInMonth(t),t.month++,h0(t)}function Dw(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 uo(t){t.calendar.constrainDate&&t.calendar.constrainDate(t),t.year=Math.max(1,Math.min(t.calendar.getYearsInEra(t),t.year)),Dw(t)}function Iw(t){let e={};for(let n in t)typeof t[n]=="number"&&(e[n]=-t[n]);return e}function _w(t,e){return Qu(t,Iw(e))}function W1(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),uo(n),n}function uu(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),$T(n),n}function CT(t){t.second+=Math.floor(t.millisecond/1e3),t.millisecond=hc(t.millisecond,1e3),t.minute+=Math.floor(t.second/60),t.second=hc(t.second,60),t.hour+=Math.floor(t.minute/60),t.minute=hc(t.minute,60);let e=Math.floor(t.hour/24);return t.hour=hc(t.hour,24),e}function $T(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 hc(t,e){let n=t%e;return n<0&&(n+=e),n}function ST(t,e){return t.hour+=e.hours||0,t.minute+=e.minutes||0,t.second+=e.seconds||0,t.millisecond+=e.milliseconds||0,CT(t)}function z1(t,e,n,r){let i=t.copy();switch(e){case"era":{let a=t.calendar.getEras(),c=a.indexOf(t.era);if(c<0)throw new Error("Invalid era: "+t.era);c=Yr(c,n,0,a.length-1,r?.round),i.era=a[c],uo(i);break}case"year":var o,s;!((o=(s=i.calendar).isInverseEra)===null||o===void 0)&&o.call(s,i)&&(n=-n),i.year=Yr(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=Yr(t.month,n,1,t.calendar.getMonthsInYear(t),r?.round);break;case"day":i.day=Yr(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),uo(i),i}function Lw(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 c=o>=12;s=c?12:0,a=c?23:11}i.hour=Yr(o,n,s,a,r?.round);break}case"minute":i.minute=Yr(t.minute,n,0,59,r?.round);break;case"second":i.second=Yr(t.second,n,0,59,r?.round);break;case"millisecond":i.millisecond=Yr(t.millisecond,n,0,999,r?.round);break;default:throw new Error("Unsupported field "+e)}return i}function Yr(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 Bw(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=Qu(co(t),{years:e.years,months:e.months,weeks:e.weeks,days:e.days});n=qr(i,t.timeZone)}else n=ms(t)-t.offset;n+=e.milliseconds||0,n+=(e.seconds||0)*1e3,n+=(e.minutes||0)*6e4,n+=(e.hours||0)*36e5;let r=Gr(n,t.timeZone);return Gn(r,t.calendar)}function AT(t,e){return Bw(t,Iw(e))}function RT(t,e,n,r){switch(e){case"hour":{let i=0,o=23;if(r?.hourCycle===12){let w=t.hour>=12;i=w?12:0,o=w?23:11}let s=co(t),a=Gn(uu(s,{hour:i}),new ds),c=[qr(a,t.timeZone,"earlier"),qr(a,t.timeZone,"later")].filter(w=>Gr(w,t.timeZone).day===a.day)[0],h=Gn(uu(s,{hour:o}),new ds),f=[qr(h,t.timeZone,"earlier"),qr(h,t.timeZone,"later")].filter(w=>Gr(w,t.timeZone).day===h.day).pop(),d=ms(t)-t.offset,m=Math.floor(d/oa),v=d%oa;return d=Yr(m,n,Math.floor(c/oa),Math.floor(f/oa),r?.round)*oa+v,Gn(Gr(d,t.timeZone),t.calendar)}case"minute":case"second":case"millisecond":return Lw(t,e,n,r);case"era":case"year":case"month":case"day":{let i=z1(co(t),e,n,r),o=qr(i,t.timeZone);return Gn(Gr(o,t.timeZone),t.calendar)}default:throw new Error("Unsupported field "+e)}}function kT(t,e,n){let r=co(t),i=uu(W1(r,e),e);if(i.compare(r)===0)return t;let o=qr(i,t.timeZone,n);return Gn(Gr(o,t.timeZone),t.calendar)}const TT=/^(\d{4})-(\d{2})-(\d{2})(?:T(\d{2}))?(?::(\d{2}))?(?::(\d{2}))?(\.\d+)?(?:(?:([+-]\d{2})(?::?(\d{2}))?)|Z)$/;function Nw(t,e){let n=t.match(TT);if(!n)throw new Error("Invalid ISO 8601 date time string: "+t);let r=new ps(Hr(n[1],1,9999),Hr(n[2],1,12),1,e,0,n[4]?Hr(n[4],0,23):0,n[5]?Hr(n[5],0,59):0,n[6]?Hr(n[6],0,59):0,n[7]?Hr(n[7],0,1/0)*1e3:0);r.day=Hr(n[3],0,r.calendar.getDaysInMonth(r));var i;return n[8]&&(r.offset=Hr(n[8],-23,23)*36e5+Hr((i=n[9])!==null&&i!==void 0?i:"0",0,59)*6e4),Ow(r,e)}function MT(t){return Nw(t,gs())}function Hr(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 ET(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 jw(t){let e=Gn(t,new ds);return`${String(e.year).padStart(4,"0")}-${String(e.month).padStart(2,"0")}-${String(e.day).padStart(2,"0")}`}function Fw(t){return`${jw(t)}T${ET(t)}`}function OT(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 DT(t){return`${Fw(t)}${OT(t.offset)}[${t.timeZone}]`}function IT(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function U1(t,e,n){IT(t,e),e.set(t,n)}function q1(t){let e=typeof t[0]=="object"?t.shift():new ds,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 _T=new WeakMap;class Ra{copy(){return this.era?new Ra(this.calendar,this.era,this.year,this.month,this.day):new Ra(this.calendar,this.year,this.month,this.day)}add(e){return Qu(this,e)}subtract(e){return _w(this,e)}set(e){return W1(this,e)}cycle(e,n,r){return z1(this,e,n,r)}toDate(e){return Mw(this,e)}toString(){return jw(this)}compare(e){return Aw(this,e)}constructor(...e){U1(this,_T,{writable:!0,value:void 0});let[n,r,i,o,s]=q1(e);this.calendar=n,this.era=r,this.year=i,this.month=o,this.day=s,uo(this)}}var LT=new WeakMap;class hu{copy(){return this.era?new hu(this.calendar,this.era,this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond):new hu(this.calendar,this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond)}add(e){return Qu(this,e)}subtract(e){return _w(this,e)}set(e){return W1(uu(this,e),e)}cycle(e,n,r){switch(e){case"era":case"year":case"month":case"day":return z1(this,e,n,r);default:return Lw(this,e,n,r)}}toDate(e,n){return Mw(this,e,n)}toString(){return Fw(this)}compare(e){let n=Aw(this,e);return n===0?fT(this,co(e)):n}constructor(...e){U1(this,LT,{writable:!0,value:void 0});let[n,r,i,o,s]=q1(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,uo(this)}}var BT=new WeakMap;class ps{copy(){return this.era?new ps(this.calendar,this.era,this.year,this.month,this.day,this.timeZone,this.offset,this.hour,this.minute,this.second,this.millisecond):new ps(this.calendar,this.year,this.month,this.day,this.timeZone,this.offset,this.hour,this.minute,this.second,this.millisecond)}add(e){return Bw(this,e)}subtract(e){return AT(this,e)}set(e,n){return kT(this,e,n)}cycle(e,n,r){return RT(this,e,n,r)}toDate(){return xT(this)}toString(){return DT(this)}toAbsoluteString(){return this.toDate().toISOString()}compare(e){return this.toDate().getTime()-wT(e,this.timeZone).toDate().getTime()}constructor(...e){U1(this,BT,{writable:!0,value:void 0});let[n,r,i,o,s]=q1(e),a=e.shift(),c=e.shift();this.calendar=n,this.era=r,this.year=i,this.month=o,this.day=s,this.timeZone=a,this.offset=c,this.hour=e.shift()||0,this.minute=e.shift()||0,this.second=e.shift()||0,this.millisecond=e.shift()||0,uo(this)}}let fd=new Map;class NT{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 VT()&&(this.resolvedHourCycle||(this.resolvedHourCycle=HT(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=Vw(e,n),this.options=n}}const jT={true:{ja:"h11"},false:{}};function Vw(t,e={}){if(typeof e.hour12=="boolean"&&FT()){e={...e};let i=jT[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(fd.has(n))return fd.get(n);let r=new Intl.DateTimeFormat(t,e);return fd.set(n,r),r}let dd=null;function FT(){return dd==null&&(dd=new Intl.DateTimeFormat("en-US",{hour:"numeric",hour12:!1}).format(new Date(2020,2,3,0))==="24"),dd}let gd=null;function VT(){return gd==null&&(gd=new Intl.DateTimeFormat("fr",{hour:"numeric",hour12:!1}).resolvedOptions().hourCycle==="h12"),gd}function HT(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=Vw(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 U(){return U=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},U.apply(null,arguments)}function ne(t,e,{checkForDefaultPrevented:n=!0}={}){return function(i){if(t?.(i),n===!1||!i.defaultPrevented)return e?.(i)}}function PT(t,e){typeof t=="function"?t(e):t!=null&&(t.current=e)}function Ju(...t){return e=>t.forEach(n=>PT(n,e))}function ye(...t){return b.useCallback(Ju(...t),t)}function K1(t,e){const n=b.createContext(e);function r(o){const{children:s,...a}=o,c=b.useMemo(()=>a,Object.values(a));return b.createElement(n.Provider,{value:c},s)}function i(o){const s=b.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 bt(t,e=[]){let n=[];function r(o,s){const a=b.createContext(s),c=n.length;n=[...n,s];function h(d){const{scope:m,children:v,...w}=d,x=m?.[t][c]||a,C=b.useMemo(()=>w,Object.values(w));return b.createElement(x.Provider,{value:C},v)}function f(d,m){const v=m?.[t][c]||a,w=b.useContext(v);if(w)return w;if(s!==void 0)return s;throw new Error(`\`${d}\` must be used within \`${o}\``)}return h.displayName=o+"Provider",[h,f]}const i=()=>{const o=n.map(s=>b.createContext(s));return function(a){const c=a?.[t]||o;return b.useMemo(()=>({[`__scope${t}`]:{...a,[t]:c}}),[a,c])}};return i.scopeName=t,[r,WT(i,...e)]}function WT(...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:c,scopeName:h})=>{const d=c(o)[`__scope${h}`];return{...a,...d}},{});return b.useMemo(()=>({[`__scope${e.scopeName}`]:s}),[s])}};return n.scopeName=e.scopeName,n}const Cr=b.forwardRef((t,e)=>{const{children:n,...r}=t,i=b.Children.toArray(n),o=i.find(zT);if(o){const s=o.props.children,a=i.map(c=>c===o?b.Children.count(s)>1?b.Children.only(null):b.isValidElement(s)?s.props.children:null:c);return b.createElement(f0,U({},r,{ref:e}),b.isValidElement(s)?b.cloneElement(s,void 0,a):null)}return b.createElement(f0,U({},r,{ref:e}),n)});Cr.displayName="Slot";const f0=b.forwardRef((t,e)=>{const{children:n,...r}=t;return b.isValidElement(n)?b.cloneElement(n,{...UT(r,n.props),ref:e?Ju(e,n.ref):n.ref}):b.Children.count(n)>1?b.Children.only(null):null});f0.displayName="SlotClone";const G1=({children:t})=>b.createElement(b.Fragment,null,t);function zT(t){return b.isValidElement(t)&&t.type===G1}function UT(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 qT=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],me=qT.reduce((t,e)=>{const n=b.forwardRef((r,i)=>{const{asChild:o,...s}=r,a=o?Cr:e;return b.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),b.createElement(a,U({},s,{ref:i}))});return n.displayName=`Primitive.${e}`,{...t,[e]:n}},{});function Hw(t,e){t&&Za.flushSync(()=>t.dispatchEvent(e))}function KT(t,e=globalThis?.document){const n=Ct(t);b.useEffect(()=>{const r=i=>{i.key==="Escape"&&n(i)};return e.addEventListener("keydown",r),()=>e.removeEventListener("keydown",r)},[n,e])}const d0="dismissableLayer.update",GT="dismissableLayer.pointerDownOutside",YT="dismissableLayer.focusOutside";let $v;const XT=b.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Co=b.forwardRef((t,e)=>{var n;const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:s,onInteractOutside:a,onDismiss:c,...h}=t,f=b.useContext(XT),[d,m]=b.useState(null),v=(n=d?.ownerDocument)!==null&&n!==void 0?n:globalThis?.document,[,w]=b.useState({}),x=ye(e,V=>m(V)),C=Array.from(f.layers),[S]=[...f.layersWithOutsidePointerEventsDisabled].slice(-1),A=C.indexOf(S),T=d?C.indexOf(d):-1,O=f.layersWithOutsidePointerEventsDisabled.size>0,D=T>=A,L=ZT(V=>{const F=V.target,H=[...f.branches].some(K=>K.contains(F));!D||H||(o?.(V),a?.(V),V.defaultPrevented||c?.())},v),I=QT(V=>{const F=V.target;[...f.branches].some(K=>K.contains(F))||(s?.(V),a?.(V),V.defaultPrevented||c?.())},v);return KT(V=>{T===f.layers.size-1&&(i?.(V),!V.defaultPrevented&&c&&(V.preventDefault(),c()))},v),b.useEffect(()=>{if(d)return r&&(f.layersWithOutsidePointerEventsDisabled.size===0&&($v=v.body.style.pointerEvents,v.body.style.pointerEvents="none"),f.layersWithOutsidePointerEventsDisabled.add(d)),f.layers.add(d),Sv(),()=>{r&&f.layersWithOutsidePointerEventsDisabled.size===1&&(v.body.style.pointerEvents=$v)}},[d,v,r,f]),b.useEffect(()=>()=>{d&&(f.layers.delete(d),f.layersWithOutsidePointerEventsDisabled.delete(d),Sv())},[d,f]),b.useEffect(()=>{const V=()=>w({});return document.addEventListener(d0,V),()=>document.removeEventListener(d0,V)},[]),b.createElement(me.div,U({},h,{ref:x,style:{pointerEvents:O?D?"auto":"none":void 0,...t.style},onFocusCapture:ne(t.onFocusCapture,I.onFocusCapture),onBlurCapture:ne(t.onBlurCapture,I.onBlurCapture),onPointerDownCapture:ne(t.onPointerDownCapture,L.onPointerDownCapture)}))});function ZT(t,e=globalThis?.document){const n=Ct(t),r=b.useRef(!1),i=b.useRef(()=>{});return b.useEffect(()=>{const o=a=>{if(a.target&&!r.current){let h=function(){Pw(GT,n,c,{discrete:!0})};const c={originalEvent:a};a.pointerType==="touch"?(e.removeEventListener("click",i.current),i.current=h,e.addEventListener("click",i.current,{once:!0})):h()}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 QT(t,e=globalThis?.document){const n=Ct(t),r=b.useRef(!1);return b.useEffect(()=>{const i=o=>{o.target&&!r.current&&Pw(YT,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 Sv(){const t=new CustomEvent(d0);document.dispatchEvent(t)}function Pw(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?Hw(i,o):i.dispatchEvent(o)}const JT=Co,ut=globalThis?.document?b.useLayoutEffect:()=>{},eM=$.useId||(()=>{});let tM=0;function Lt(t){const[e,n]=$.useState(eM());return ut(()=>{n(r=>r??String(tM++))},[t]),e?`radix-${e}`:""}const nM=["top","right","bottom","left"],Ri=Math.min,An=Math.max,fu=Math.round,fc=Math.floor,wr=t=>({x:t,y:t}),rM={left:"right",right:"left",bottom:"top",top:"bottom"},iM={start:"end",end:"start"};function g0(t,e,n){return An(t,Ri(e,n))}function Qr(t,e){return typeof t=="function"?t(e):t}function Jr(t){return t.split("-")[0]}function Es(t){return t.split("-")[1]}function Y1(t){return t==="x"?"y":"x"}function X1(t){return t==="y"?"height":"width"}function ki(t){return["top","bottom"].includes(Jr(t))?"y":"x"}function Z1(t){return Y1(ki(t))}function oM(t,e,n){n===void 0&&(n=!1);const r=Es(t),i=Z1(t),o=X1(i);let s=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[o]>e.floating[o]&&(s=du(s)),[s,du(s)]}function sM(t){const e=du(t);return[m0(t),e,m0(e)]}function m0(t){return t.replace(/start|end/g,e=>iM[e])}function aM(t,e,n){const r=["left","right"],i=["right","left"],o=["top","bottom"],s=["bottom","top"];switch(t){case"top":case"bottom":return n?e?i:r:e?r:i;case"left":case"right":return e?o:s;default:return[]}}function lM(t,e,n,r){const i=Es(t);let o=aM(Jr(t),n==="start",r);return i&&(o=o.map(s=>s+"-"+i),e&&(o=o.concat(o.map(m0)))),o}function du(t){return t.replace(/left|right|bottom|top/g,e=>rM[e])}function cM(t){return{top:0,right:0,bottom:0,left:0,...t}}function Ww(t){return typeof t!="number"?cM(t):{top:t,right:t,bottom:t,left:t}}function gu(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 Av(t,e,n){let{reference:r,floating:i}=t;const o=ki(e),s=Z1(e),a=X1(s),c=Jr(e),h=o==="y",f=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,m=r[a]/2-i[a]/2;let v;switch(c){case"top":v={x:f,y:r.y-i.height};break;case"bottom":v={x:f,y:r.y+r.height};break;case"right":v={x:r.x+r.width,y:d};break;case"left":v={x:r.x-i.width,y:d};break;default:v={x:r.x,y:r.y}}switch(Es(e)){case"start":v[s]-=m*(n&&h?-1:1);break;case"end":v[s]+=m*(n&&h?-1:1);break}return v}const uM=async(t,e,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:s}=n,a=o.filter(Boolean),c=await(s.isRTL==null?void 0:s.isRTL(e));let h=await s.getElementRects({reference:t,floating:e,strategy:i}),{x:f,y:d}=Av(h,r,c),m=r,v={},w=0;for(let x=0;x<a.length;x++){const{name:C,fn:S}=a[x],{x:A,y:T,data:O,reset:D}=await S({x:f,y:d,initialPlacement:r,placement:m,strategy:i,middlewareData:v,rects:h,platform:s,elements:{reference:t,floating:e}});f=A??f,d=T??d,v={...v,[C]:{...v[C],...O}},D&&w<=50&&(w++,typeof D=="object"&&(D.placement&&(m=D.placement),D.rects&&(h=D.rects===!0?await s.getElementRects({reference:t,floating:e,strategy:i}):D.rects),{x:f,y:d}=Av(h,m,c)),x=-1)}return{x:f,y:d,placement:m,strategy:i,middlewareData:v}};async function ka(t,e){var n;e===void 0&&(e={});const{x:r,y:i,platform:o,rects:s,elements:a,strategy:c}=t,{boundary:h="clippingAncestors",rootBoundary:f="viewport",elementContext:d="floating",altBoundary:m=!1,padding:v=0}=Qr(e,t),w=Ww(v),C=a[m?d==="floating"?"reference":"floating":d],S=gu(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(C)))==null||n?C:C.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(a.floating)),boundary:h,rootBoundary:f,strategy:c})),A=d==="floating"?{x:r,y:i,width:s.floating.width,height:s.floating.height}:s.reference,T=await(o.getOffsetParent==null?void 0:o.getOffsetParent(a.floating)),O=await(o.isElement==null?void 0:o.isElement(T))?await(o.getScale==null?void 0:o.getScale(T))||{x:1,y:1}:{x:1,y:1},D=gu(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:A,offsetParent:T,strategy:c}):A);return{top:(S.top-D.top+w.top)/O.y,bottom:(D.bottom-S.bottom+w.bottom)/O.y,left:(S.left-D.left+w.left)/O.x,right:(D.right-S.right+w.right)/O.x}}const hM=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:r,placement:i,rects:o,platform:s,elements:a,middlewareData:c}=e,{element:h,padding:f=0}=Qr(t,e)||{};if(h==null)return{};const d=Ww(f),m={x:n,y:r},v=Z1(i),w=X1(v),x=await s.getDimensions(h),C=v==="y",S=C?"top":"left",A=C?"bottom":"right",T=C?"clientHeight":"clientWidth",O=o.reference[w]+o.reference[v]-m[v]-o.floating[w],D=m[v]-o.reference[v],L=await(s.getOffsetParent==null?void 0:s.getOffsetParent(h));let I=L?L[T]:0;(!I||!await(s.isElement==null?void 0:s.isElement(L)))&&(I=a.floating[T]||o.floating[w]);const V=O/2-D/2,F=I/2-x[w]/2-1,H=Ri(d[S],F),K=Ri(d[A],F),W=H,J=I-x[w]-K,G=I/2-x[w]/2+V,re=g0(W,G,J),oe=!c.arrow&&Es(i)!=null&&G!==re&&o.reference[w]/2-(G<W?H:K)-x[w]/2<0,te=oe?G<W?G-W:G-J:0;return{[v]:m[v]+te,data:{[v]:re,centerOffset:G-re-te,...oe&&{alignmentOffset:te}},reset:oe}}}),fM=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:c,elements:h}=e,{mainAxis:f=!0,crossAxis:d=!0,fallbackPlacements:m,fallbackStrategy:v="bestFit",fallbackAxisSideDirection:w="none",flipAlignment:x=!0,...C}=Qr(t,e);if((n=o.arrow)!=null&&n.alignmentOffset)return{};const S=Jr(i),A=ki(a),T=Jr(a)===a,O=await(c.isRTL==null?void 0:c.isRTL(h.floating)),D=m||(T||!x?[du(a)]:sM(a)),L=w!=="none";!m&&L&&D.push(...lM(a,x,w,O));const I=[a,...D],V=await ka(e,C),F=[];let H=((r=o.flip)==null?void 0:r.overflows)||[];if(f&&F.push(V[S]),d){const G=oM(i,s,O);F.push(V[G[0]],V[G[1]])}if(H=[...H,{placement:i,overflows:F}],!F.every(G=>G<=0)){var K,W;const G=(((K=o.flip)==null?void 0:K.index)||0)+1,re=I[G];if(re)return{data:{index:G,overflows:H},reset:{placement:re}};let oe=(W=H.filter(te=>te.overflows[0]<=0).sort((te,ie)=>te.overflows[1]-ie.overflows[1])[0])==null?void 0:W.placement;if(!oe)switch(v){case"bestFit":{var J;const te=(J=H.filter(ie=>{if(L){const Y=ki(ie.placement);return Y===A||Y==="y"}return!0}).map(ie=>[ie.placement,ie.overflows.filter(Y=>Y>0).reduce((Y,ue)=>Y+ue,0)]).sort((ie,Y)=>ie[1]-Y[1])[0])==null?void 0:J[0];te&&(oe=te);break}case"initialPlacement":oe=a;break}if(i!==oe)return{reset:{placement:oe}}}return{}}}};function Rv(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function kv(t){return nM.some(e=>t[e]>=0)}const dM=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n}=e,{strategy:r="referenceHidden",...i}=Qr(t,e);switch(r){case"referenceHidden":{const o=await ka(e,{...i,elementContext:"reference"}),s=Rv(o,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:kv(s)}}}case"escaped":{const o=await ka(e,{...i,altBoundary:!0}),s=Rv(o,n.floating);return{data:{escapedOffsets:s,escaped:kv(s)}}}default:return{}}}}};async function gM(t,e){const{placement:n,platform:r,elements:i}=t,o=await(r.isRTL==null?void 0:r.isRTL(i.floating)),s=Jr(n),a=Es(n),c=ki(n)==="y",h=["left","top"].includes(s)?-1:1,f=o&&c?-1:1,d=Qr(e,t);let{mainAxis:m,crossAxis:v,alignmentAxis:w}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&typeof w=="number"&&(v=a==="end"?w*-1:w),c?{x:v*f,y:m*h}:{x:m*h,y:v*f}}const mM=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,c=await gM(e,t);return s===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:i+c.x,y:o+c.y,data:{...c,placement:s}}}}},pM=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:C=>{let{x:S,y:A}=C;return{x:S,y:A}}},...c}=Qr(t,e),h={x:n,y:r},f=await ka(e,c),d=ki(Jr(i)),m=Y1(d);let v=h[m],w=h[d];if(o){const C=m==="y"?"top":"left",S=m==="y"?"bottom":"right",A=v+f[C],T=v-f[S];v=g0(A,v,T)}if(s){const C=d==="y"?"top":"left",S=d==="y"?"bottom":"right",A=w+f[C],T=w-f[S];w=g0(A,w,T)}const x=a.fn({...e,[m]:v,[d]:w});return{...x,data:{x:x.x-n,y:x.y-r,enabled:{[m]:o,[d]:s}}}}}},vM=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:c=!0,crossAxis:h=!0}=Qr(t,e),f={x:n,y:r},d=ki(i),m=Y1(d);let v=f[m],w=f[d];const x=Qr(a,e),C=typeof x=="number"?{mainAxis:x,crossAxis:0}:{mainAxis:0,crossAxis:0,...x};if(c){const T=m==="y"?"height":"width",O=o.reference[m]-o.floating[T]+C.mainAxis,D=o.reference[m]+o.reference[T]-C.mainAxis;v<O?v=O:v>D&&(v=D)}if(h){var S,A;const T=m==="y"?"width":"height",O=["top","left"].includes(Jr(i)),D=o.reference[d]-o.floating[T]+(O&&((S=s.offset)==null?void 0:S[d])||0)+(O?0:C.crossAxis),L=o.reference[d]+o.reference[T]+(O?0:((A=s.offset)==null?void 0:A[d])||0)-(O?C.crossAxis:0);w<D?w=D:w>L&&(w=L)}return{[m]:v,[d]:w}}}},bM=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:c=()=>{},...h}=Qr(t,e),f=await ka(e,h),d=Jr(i),m=Es(i),v=ki(i)==="y",{width:w,height:x}=o.floating;let C,S;d==="top"||d==="bottom"?(C=d,S=m===(await(s.isRTL==null?void 0:s.isRTL(a.floating))?"start":"end")?"left":"right"):(S=d,C=m==="end"?"top":"bottom");const A=x-f.top-f.bottom,T=w-f.left-f.right,O=Ri(x-f[C],A),D=Ri(w-f[S],T),L=!e.middlewareData.shift;let I=O,V=D;if((n=e.middlewareData.shift)!=null&&n.enabled.x&&(V=T),(r=e.middlewareData.shift)!=null&&r.enabled.y&&(I=A),L&&!m){const H=An(f.left,0),K=An(f.right,0),W=An(f.top,0),J=An(f.bottom,0);v?V=w-2*(H!==0||K!==0?H+K:An(f.left,f.right)):I=x-2*(W!==0||J!==0?W+J:An(f.top,f.bottom))}await c({...e,availableWidth:V,availableHeight:I});const F=await s.getDimensions(a.floating);return w!==F.width||x!==F.height?{reset:{rects:!0}}:{}}}};function eh(){return typeof window<"u"}function Os(t){return zw(t)?(t.nodeName||"").toLowerCase():"#document"}function kn(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function Ar(t){var e;return(e=(zw(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function zw(t){return eh()?t instanceof Node||t instanceof kn(t).Node:!1}function Qn(t){return eh()?t instanceof Element||t instanceof kn(t).Element:!1}function $r(t){return eh()?t instanceof HTMLElement||t instanceof kn(t).HTMLElement:!1}function Tv(t){return!eh()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof kn(t).ShadowRoot}function Qa(t){const{overflow:e,overflowX:n,overflowY:r,display:i}=Jn(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&!["inline","contents"].includes(i)}function wM(t){return["table","td","th"].includes(Os(t))}function th(t){return[":popover-open",":modal"].some(e=>{try{return t.matches(e)}catch{return!1}})}function Q1(t){const e=J1(),n=Qn(t)?Jn(t):t;return["transform","translate","scale","rotate","perspective"].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)||["transform","translate","scale","rotate","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function xM(t){let e=Ti(t);for(;$r(e)&&!vs(e);){if(Q1(e))return e;if(th(e))return null;e=Ti(e)}return null}function J1(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function vs(t){return["html","body","#document"].includes(Os(t))}function Jn(t){return kn(t).getComputedStyle(t)}function nh(t){return Qn(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function Ti(t){if(Os(t)==="html")return t;const e=t.assignedSlot||t.parentNode||Tv(t)&&t.host||Ar(t);return Tv(e)?e.host:e}function Uw(t){const e=Ti(t);return vs(e)?t.ownerDocument?t.ownerDocument.body:t.body:$r(e)&&Qa(e)?e:Uw(e)}function Ta(t,e,n){var r;e===void 0&&(e=[]),n===void 0&&(n=!0);const i=Uw(t),o=i===((r=t.ownerDocument)==null?void 0:r.body),s=kn(i);if(o){const a=p0(s);return e.concat(s,s.visualViewport||[],Qa(i)?i:[],a&&n?Ta(a):[])}return e.concat(i,Ta(i,[],n))}function p0(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function qw(t){const e=Jn(t);let n=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const i=$r(t),o=i?t.offsetWidth:n,s=i?t.offsetHeight:r,a=fu(n)!==o||fu(r)!==s;return a&&(n=o,r=s),{width:n,height:r,$:a}}function eg(t){return Qn(t)?t:t.contextElement}function rs(t){const e=eg(t);if(!$r(e))return wr(1);const n=e.getBoundingClientRect(),{width:r,height:i,$:o}=qw(e);let s=(o?fu(n.width):n.width)/r,a=(o?fu(n.height):n.height)/i;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const yM=wr(0);function Kw(t){const e=kn(t);return!J1()||!e.visualViewport?yM:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function CM(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==kn(t)?!1:e}function ho(t,e,n,r){e===void 0&&(e=!1),n===void 0&&(n=!1);const i=t.getBoundingClientRect(),o=eg(t);let s=wr(1);e&&(r?Qn(r)&&(s=rs(r)):s=rs(t));const a=CM(o,n,r)?Kw(o):wr(0);let c=(i.left+a.x)/s.x,h=(i.top+a.y)/s.y,f=i.width/s.x,d=i.height/s.y;if(o){const m=kn(o),v=r&&Qn(r)?kn(r):r;let w=m,x=p0(w);for(;x&&r&&v!==w;){const C=rs(x),S=x.getBoundingClientRect(),A=Jn(x),T=S.left+(x.clientLeft+parseFloat(A.paddingLeft))*C.x,O=S.top+(x.clientTop+parseFloat(A.paddingTop))*C.y;c*=C.x,h*=C.y,f*=C.x,d*=C.y,c+=T,h+=O,w=kn(x),x=p0(w)}}return gu({width:f,height:d,x:c,y:h})}function tg(t,e){const n=nh(t).scrollLeft;return e?e.left+n:ho(Ar(t)).left+n}function Gw(t,e,n){n===void 0&&(n=!1);const r=t.getBoundingClientRect(),i=r.left+e.scrollLeft-(n?0:tg(t,r)),o=r.top+e.scrollTop;return{x:i,y:o}}function $M(t){let{elements:e,rect:n,offsetParent:r,strategy:i}=t;const o=i==="fixed",s=Ar(r),a=e?th(e.floating):!1;if(r===s||a&&o)return n;let c={scrollLeft:0,scrollTop:0},h=wr(1);const f=wr(0),d=$r(r);if((d||!d&&!o)&&((Os(r)!=="body"||Qa(s))&&(c=nh(r)),$r(r))){const v=ho(r);h=rs(r),f.x=v.x+r.clientLeft,f.y=v.y+r.clientTop}const m=s&&!d&&!o?Gw(s,c,!0):wr(0);return{width:n.width*h.x,height:n.height*h.y,x:n.x*h.x-c.scrollLeft*h.x+f.x+m.x,y:n.y*h.y-c.scrollTop*h.y+f.y+m.y}}function SM(t){return Array.from(t.getClientRects())}function AM(t){const e=Ar(t),n=nh(t),r=t.ownerDocument.body,i=An(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),o=An(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+tg(t);const a=-n.scrollTop;return Jn(r).direction==="rtl"&&(s+=An(e.clientWidth,r.clientWidth)-i),{width:i,height:o,x:s,y:a}}function RM(t,e){const n=kn(t),r=Ar(t),i=n.visualViewport;let o=r.clientWidth,s=r.clientHeight,a=0,c=0;if(i){o=i.width,s=i.height;const h=J1();(!h||h&&e==="fixed")&&(a=i.offsetLeft,c=i.offsetTop)}return{width:o,height:s,x:a,y:c}}function kM(t,e){const n=ho(t,!0,e==="fixed"),r=n.top+t.clientTop,i=n.left+t.clientLeft,o=$r(t)?rs(t):wr(1),s=t.clientWidth*o.x,a=t.clientHeight*o.y,c=i*o.x,h=r*o.y;return{width:s,height:a,x:c,y:h}}function Mv(t,e,n){let r;if(e==="viewport")r=RM(t,n);else if(e==="document")r=AM(Ar(t));else if(Qn(e))r=kM(e,n);else{const i=Kw(t);r={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return gu(r)}function Yw(t,e){const n=Ti(t);return n===e||!Qn(n)||vs(n)?!1:Jn(n).position==="fixed"||Yw(n,e)}function TM(t,e){const n=e.get(t);if(n)return n;let r=Ta(t,[],!1).filter(a=>Qn(a)&&Os(a)!=="body"),i=null;const o=Jn(t).position==="fixed";let s=o?Ti(t):t;for(;Qn(s)&&!vs(s);){const a=Jn(s),c=Q1(s);!c&&a.position==="fixed"&&(i=null),(o?!c&&!i:!c&&a.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||Qa(s)&&!c&&Yw(t,s))?r=r.filter(f=>f!==s):i=a,s=Ti(s)}return e.set(t,r),r}function MM(t){let{element:e,boundary:n,rootBoundary:r,strategy:i}=t;const s=[...n==="clippingAncestors"?th(e)?[]:TM(e,this._c):[].concat(n),r],a=s[0],c=s.reduce((h,f)=>{const d=Mv(e,f,i);return h.top=An(d.top,h.top),h.right=Ri(d.right,h.right),h.bottom=Ri(d.bottom,h.bottom),h.left=An(d.left,h.left),h},Mv(e,a,i));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function EM(t){const{width:e,height:n}=qw(t);return{width:e,height:n}}function OM(t,e,n){const r=$r(e),i=Ar(e),o=n==="fixed",s=ho(t,!0,o,e);let a={scrollLeft:0,scrollTop:0};const c=wr(0);if(r||!r&&!o)if((Os(e)!=="body"||Qa(i))&&(a=nh(e)),r){const m=ho(e,!0,o,e);c.x=m.x+e.clientLeft,c.y=m.y+e.clientTop}else i&&(c.x=tg(i));const h=i&&!r&&!o?Gw(i,a):wr(0),f=s.left+a.scrollLeft-c.x-h.x,d=s.top+a.scrollTop-c.y-h.y;return{x:f,y:d,width:s.width,height:s.height}}function md(t){return Jn(t).position==="static"}function Ev(t,e){if(!$r(t)||Jn(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return Ar(t)===n&&(n=n.ownerDocument.body),n}function Xw(t,e){const n=kn(t);if(th(t))return n;if(!$r(t)){let i=Ti(t);for(;i&&!vs(i);){if(Qn(i)&&!md(i))return i;i=Ti(i)}return n}let r=Ev(t,e);for(;r&&wM(r)&&md(r);)r=Ev(r,e);return r&&vs(r)&&md(r)&&!Q1(r)?n:r||xM(t)||n}const DM=async function(t){const e=this.getOffsetParent||Xw,n=this.getDimensions,r=await n(t.floating);return{reference:OM(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function IM(t){return Jn(t).direction==="rtl"}const _M={convertOffsetParentRelativeRectToViewportRelativeRect:$M,getDocumentElement:Ar,getClippingRect:MM,getOffsetParent:Xw,getElementRects:DM,getClientRects:SM,getDimensions:EM,getScale:rs,isElement:Qn,isRTL:IM};function Zw(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function LM(t,e){let n=null,r;const i=Ar(t);function o(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function s(a,c){a===void 0&&(a=!1),c===void 0&&(c=1),o();const h=t.getBoundingClientRect(),{left:f,top:d,width:m,height:v}=h;if(a||e(),!m||!v)return;const w=fc(d),x=fc(i.clientWidth-(f+m)),C=fc(i.clientHeight-(d+v)),S=fc(f),T={rootMargin:-w+"px "+-x+"px "+-C+"px "+-S+"px",threshold:An(0,Ri(1,c))||1};let O=!0;function D(L){const I=L[0].intersectionRatio;if(I!==c){if(!O)return s();I?s(!1,I):r=setTimeout(()=>{s(!1,1e-7)},1e3)}I===1&&!Zw(h,t.getBoundingClientRect())&&s(),O=!1}try{n=new IntersectionObserver(D,{...T,root:i.ownerDocument})}catch{n=new IntersectionObserver(D,T)}n.observe(t)}return s(!0),o}function Qw(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:c=!1}=r,h=eg(t),f=i||o?[...h?Ta(h):[],...Ta(e)]:[];f.forEach(S=>{i&&S.addEventListener("scroll",n,{passive:!0}),o&&S.addEventListener("resize",n)});const d=h&&a?LM(h,n):null;let m=-1,v=null;s&&(v=new ResizeObserver(S=>{let[A]=S;A&&A.target===h&&v&&(v.unobserve(e),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var T;(T=v)==null||T.observe(e)})),n()}),h&&!c&&v.observe(h),v.observe(e));let w,x=c?ho(t):null;c&&C();function C(){const S=ho(t);x&&!Zw(x,S)&&n(),x=S,w=requestAnimationFrame(C)}return n(),()=>{var S;f.forEach(A=>{i&&A.removeEventListener("scroll",n),o&&A.removeEventListener("resize",n)}),d?.(),(S=v)==null||S.disconnect(),v=null,c&&cancelAnimationFrame(w)}}const Jw=mM,ex=pM,tx=fM,BM=bM,NM=dM,Ov=hM,jM=vM,nx=(t,e,n)=>{const r=new Map,i={platform:_M,...n},o={...i.platform,_c:r};return uM(t,e,{...i,platform:o})};var Yc=typeof document<"u"?b.useLayoutEffect:b.useEffect;function mu(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(!mu(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)&&!mu(t[o],e[o]))return!1}return!0}return t!==t&&e!==e}function rx(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function Dv(t,e){const n=rx(t);return Math.round(e*n)/n}function pd(t){const e=$.useRef(t);return Yc(()=>{e.current=t}),e}function FM(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:c,open:h}=t,[f,d]=$.useState({x:0,y:0,strategy:n,placement:e,middlewareData:{},isPositioned:!1}),[m,v]=$.useState(r);mu(m,r)||v(r);const[w,x]=$.useState(null),[C,S]=$.useState(null),A=$.useCallback(ie=>{ie!==L.current&&(L.current=ie,x(ie))},[]),T=$.useCallback(ie=>{ie!==I.current&&(I.current=ie,S(ie))},[]),O=o||w,D=s||C,L=$.useRef(null),I=$.useRef(null),V=$.useRef(f),F=c!=null,H=pd(c),K=pd(i),W=pd(h),J=$.useCallback(()=>{if(!L.current||!I.current)return;const ie={placement:e,strategy:n,middleware:m};K.current&&(ie.platform=K.current),nx(L.current,I.current,ie).then(Y=>{const ue={...Y,isPositioned:W.current!==!1};G.current&&!mu(V.current,ue)&&(V.current=ue,yo.flushSync(()=>{d(ue)}))})},[m,e,n,K,W]);Yc(()=>{h===!1&&V.current.isPositioned&&(V.current.isPositioned=!1,d(ie=>({...ie,isPositioned:!1})))},[h]);const G=$.useRef(!1);Yc(()=>(G.current=!0,()=>{G.current=!1}),[]),Yc(()=>{if(O&&(L.current=O),D&&(I.current=D),O&&D){if(H.current)return H.current(O,D,J);J()}},[O,D,J,H,F]);const re=$.useMemo(()=>({reference:L,floating:I,setReference:A,setFloating:T}),[A,T]),oe=$.useMemo(()=>({reference:O,floating:D}),[O,D]),te=$.useMemo(()=>{const ie={position:n,left:0,top:0};if(!oe.floating)return ie;const Y=Dv(oe.floating,f.x),ue=Dv(oe.floating,f.y);return a?{...ie,transform:"translate("+Y+"px, "+ue+"px)",...rx(oe.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:Y,top:ue}},[n,a,oe.floating,f.x,f.y]);return $.useMemo(()=>({...f,update:J,refs:re,elements:oe,floatingStyles:te}),[f,J,re,oe,te])}const VM=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?Ov({element:r.current,padding:i}).fn(n):{}:r?Ov({element:r,padding:i}).fn(n):{}}}},HM=(t,e)=>({...Jw(t),options:[t,e]}),PM=(t,e)=>({...ex(t),options:[t,e]}),WM=(t,e)=>({...jM(t),options:[t,e]}),zM=(t,e)=>({...tx(t),options:[t,e]}),UM=(t,e)=>({...BM(t),options:[t,e]}),qM=(t,e)=>({...NM(t),options:[t,e]}),KM=(t,e)=>({...VM(t),options:[t,e]}),GM=b.forwardRef((t,e)=>{const{children:n,width:r=10,height:i=5,...o}=t;return b.createElement(me.svg,U({},o,{ref:e,width:r,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none"}),t.asChild?n:b.createElement("polygon",{points:"0,0 30,0 15,10"}))}),YM=GM;function rh(t){const[e,n]=b.useState(void 0);return ut(()=>{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 c=o.borderBoxSize,h=Array.isArray(c)?c[0]:c;s=h.inlineSize,a=h.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 ix="Popper",[ox,Li]=bt(ix),[XM,sx]=ox(ix),ZM=t=>{const{__scopePopper:e,children:n}=t,[r,i]=b.useState(null);return b.createElement(XM,{scope:e,anchor:r,onAnchorChange:i},n)},QM="PopperAnchor",JM=b.forwardRef((t,e)=>{const{__scopePopper:n,virtualRef:r,...i}=t,o=sx(QM,n),s=b.useRef(null),a=ye(e,s);return b.useEffect(()=>{o.onAnchorChange(r?.current||s.current)}),r?null:b.createElement(me.div,U({},i,{ref:a}))}),ax="PopperContent",[eE,tE]=ox(ax),nE=b.forwardRef((t,e)=>{var n,r,i,o,s,a,c,h;const{__scopePopper:f,side:d="bottom",sideOffset:m=0,align:v="center",alignOffset:w=0,arrowPadding:x=0,avoidCollisions:C=!0,collisionBoundary:S=[],collisionPadding:A=0,sticky:T="partial",hideWhenDetached:O=!1,updatePositionStrategy:D="optimized",onPlaced:L,...I}=t,V=sx(ax,f),[F,H]=b.useState(null),K=ye(e,Pe=>H(Pe)),[W,J]=b.useState(null),G=rh(W),re=(n=G?.width)!==null&&n!==void 0?n:0,oe=(r=G?.height)!==null&&r!==void 0?r:0,te=d+(v!=="center"?"-"+v:""),ie=typeof A=="number"?A:{top:0,right:0,bottom:0,left:0,...A},Y=Array.isArray(S)?S:[S],ue=Y.length>0,ge={padding:ie,boundary:Y.filter(sE),altBoundary:ue},{refs:De,floatingStyles:we,placement:Ve,isPositioned:Ne,middlewareData:He}=FM({strategy:"fixed",placement:te,whileElementsMounted:(...Pe)=>Qw(...Pe,{animationFrame:D==="always"}),elements:{reference:V.anchor},middleware:[HM({mainAxis:m+oe,alignmentAxis:w}),C&&PM({mainAxis:!0,crossAxis:!1,limiter:T==="partial"?WM():void 0,...ge}),C&&zM({...ge}),UM({...ge,apply:({elements:Pe,rects:Yt,availableWidth:ft,availableHeight:Hi})=>{const{width:Ps,height:or}=Yt.reference,wt=Pe.floating.style;wt.setProperty("--radix-popper-available-width",`${ft}px`),wt.setProperty("--radix-popper-available-height",`${Hi}px`),wt.setProperty("--radix-popper-anchor-width",`${Ps}px`),wt.setProperty("--radix-popper-anchor-height",`${or}px`)}}),W&&KM({element:W,padding:x}),aE({arrowWidth:re,arrowHeight:oe}),O&&qM({strategy:"referenceHidden",...ge})]}),[pe,Oe]=lx(Ve),ke=Ct(L);ut(()=>{Ne&&ke?.()},[Ne,ke]);const Ae=(i=He.arrow)===null||i===void 0?void 0:i.x,_e=(o=He.arrow)===null||o===void 0?void 0:o.y,ze=((s=He.arrow)===null||s===void 0?void 0:s.centerOffset)!==0,[Et,Ze]=b.useState();return ut(()=>{F&&Ze(window.getComputedStyle(F).zIndex)},[F]),b.createElement("div",{ref:De.setFloating,"data-radix-popper-content-wrapper":"",style:{...we,transform:Ne?we.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Et,"--radix-popper-transform-origin":[(a=He.transformOrigin)===null||a===void 0?void 0:a.x,(c=He.transformOrigin)===null||c===void 0?void 0:c.y].join(" ")},dir:t.dir},b.createElement(eE