react-beauty-calendar 2.0.0 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/@types/calendar-instance.d.ts +8 -7
- package/dist/@types/index.d.ts +1 -1
- package/dist/build/assets/main.css +1 -1
- package/dist/build/main.cjs.js +61 -61
- package/dist/build/main.es.js +19885 -19778
- package/dist/components/ui/Checkbox.d.ts +1 -1
- package/dist/constants/index.d.ts +2 -2
- package/dist/context/date-and-time/DateAndTimeContext.d.ts +1 -1
- package/dist/context/index.d.ts +4 -4
- package/dist/context/users-info/users-info-store.d.ts +2 -2
- package/dist/core/Root.d.ts +1 -1
- package/dist/core/booking-card/BookingCardOnResize.d.ts +1 -1
- package/dist/core/booking-card/CardContent.d.ts +1 -1
- package/dist/core/booking-creation-dialog/BookingCreationDialog.d.ts +1 -1
- package/dist/core/calendar/CalendarActionButton.d.ts +5 -0
- package/dist/core/calendar/CalendarDayHeader.d.ts +5 -0
- package/dist/core/calendar/CalendarDays.d.ts +5 -0
- package/dist/core/calendar/CalendarHolder.d.ts +1 -1
- package/dist/core/calendar/CalendarView.d.ts +4 -0
- package/dist/core/calendar/DateCalendarIndicator.d.ts +8 -0
- package/dist/core/calendar/DaysOfWeek.d.ts +1 -2
- package/dist/core/calendar/HourWithActions.d.ts +1 -1
- package/dist/core/calendar/ScheduleSlots.d.ts +14 -0
- package/dist/core/calendar/SlotRender.d.ts +1 -1
- package/dist/core/calendar/TableDayOfWeekColumn.d.ts +6 -0
- package/dist/core/card-slots/ResizableTimeSlot.d.ts +17 -0
- package/dist/core/card-slots/SlotTrigger.d.ts +1 -1
- package/dist/core/card-slots/TimeInfo.d.ts +4 -2
- package/dist/core/card-slots/UniSlot.d.ts +3 -0
- package/dist/core/header-calendar/Actions.d.ts +5 -0
- package/dist/core/header-calendar/Header.d.ts +4 -7
- package/dist/core/header-calendar/HeaderDayActions.d.ts +1 -1
- package/dist/core/header-calendar/HeaderTodayAction.d.ts +2 -4
- package/dist/core/slots/CardOverlay.d.ts +1 -2
- package/dist/core/table-view-type/Columns.d.ts +1 -1
- package/dist/core/table-view-type/TableViewType.d.ts +4 -4
- package/dist/hooks/index.d.ts +2 -2
- package/dist/hooks/useCalendarInstance.d.ts +1 -1
- package/dist/hooks/useResizableBothSides.d.ts +1 -1
- package/dist/utils/cardResize.utils.d.ts +9 -0
- package/dist/utils/date.utils.d.ts +1 -0
- package/dist/utils/forward.d.ts +6 -1
- package/dist/utils/index.d.ts +5 -4
- package/dist/utils/props.d.ts +41 -36
- package/dist/utils/types.d.ts +8 -1
- package/package.json +1 -1
- package/dist/core/calendar/Slots.d.ts +0 -15
- package/dist/core/card-slots/EmptySlot.d.ts +0 -3
package/dist/build/main.cjs.js
CHANGED
|
@@ -1,137 +1,137 @@
|
|
|
1
|
-
"use strict";require('./assets/main.css');var
|
|
1
|
+
"use strict";require('./assets/main.css');var _v=Object.defineProperty;var kv=(e,t,n)=>t in e?_v(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var un=(e,t,n)=>kv(e,typeof t!="symbol"?t+"":t,n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const y=require("react/jsx-runtime"),R=require("react"),Pt=require("react-dom");function df(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const T=df(R),ls=df(Pt);class Iv extends ReferenceError{constructor(t="Calendar instance is not initialized. Ensure the calendar is rendered before calling this method."){super(t),this.name="ReferenceErrorCustom"}}var Nv={cm:!0,mm:!0,in:!0,px:!0,pt:!0,pc:!0,em:!0,ex:!0,ch:!0,rem:!0,vw:!0,vh:!0,vmin:!0,vmax:!0,"%":!0};function Fi(e){if(typeof e=="number")return{value:e,unit:"px"};var t,n=(e.match(/^[0-9.]*/)||"").toString();n.includes(".")?t=parseFloat(n):t=parseInt(n,10);var r=(e.match(/[^0-9]*$/)||"").toString();return Nv[r]?{value:t,unit:r}:(console.warn("React Spinners: ".concat(e," is not a valid css value. Defaulting to ").concat(t,"px.")),{value:t,unit:"px"})}function Gs(e){var t=Fi(e);return"".concat(t.value).concat(t.unit)}var jv=function(e,t,n){var r="react-spinners-".concat(e,"-").concat(n);if(typeof window>"u"||!window.document)return r;var o=document.createElement("style");document.head.appendChild(o);var s=o.sheet,i=`
|
|
2
2
|
@keyframes `.concat(r,` {
|
|
3
3
|
`).concat(t,`
|
|
4
4
|
}
|
|
5
|
-
`);return s&&s.insertRule(i,0),r},$o=function(){return $o=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},$o.apply(this,arguments)},Iv=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n},Nv=kv("GridLoader","0% {transform: scale(1)} 50% {transform: scale(0.5); opacity: 0.7} 100% {transform: scale(1); opacity: 1}","grid"),xt=function(e){return Math.random()*e};function jv(e){var t=e.loading,n=t===void 0?!0:t,r=e.color,o=r===void 0?"#000000":r,s=e.speedMultiplier,i=s===void 0?1:s,a=e.cssOverride,l=a===void 0?{}:a,c=e.size,u=c===void 0?15:c,d=e.margin,f=d===void 0?2:d,h=Iv(e,["loading","color","speedMultiplier","cssOverride","size","margin"]),m=_i(u),p=_i(f),b=parseFloat(m.value.toString())*3+parseFloat(p.value.toString())*6,y=$o({width:"".concat(b).concat(m.unit),fontSize:0,display:"inline-block"},l),g=function(w){return{display:"inline-block",backgroundColor:o,width:"".concat(Bs(u)),height:"".concat(Bs(u)),margin:Bs(f),borderRadius:"100%",animationFillMode:"both",animation:"".concat(Nv," ").concat((w/100+.6)/i,"s ").concat(w/100-.2,"s infinite ease")}};return n?R.createElement("span",$o({style:y},h,{ref:function(w){w&&w.style.setProperty("width","".concat(b).concat(m.unit),"important")}}),R.createElement("span",{style:g(xt(100))}),R.createElement("span",{style:g(xt(100))}),R.createElement("span",{style:g(xt(100))}),R.createElement("span",{style:g(xt(100))}),R.createElement("span",{style:g(xt(100))}),R.createElement("span",{style:g(xt(100))}),R.createElement("span",{style:g(xt(100))}),R.createElement("span",{style:g(xt(100))}),R.createElement("span",{style:g(xt(100))})):null}const cc=e=>{let t;const n=new Set,r=(c,u)=>{const d=typeof c=="function"?c(t):c;if(!Object.is(d,t)){const f=t;t=u??(typeof d!="object"||d===null)?d:Object.assign({},t,d),n.forEach(h=>h(t,f))}},o=()=>t,a={setState:r,getState:o,getInitialState:()=>l,subscribe:c=>(n.add(c),()=>n.delete(c))},l=t=e(r,o,a);return a},Wn=e=>e?cc(e):cc,Fv=e=>e;function zr(e,t=Fv){const n=T.useSyncExternalStore(e.subscribe,()=>t(e.getState()),()=>t(e.getInitialState()));return T.useDebugValue(n),n}const uc=e=>{const t=Wn(e),n=r=>zr(t,r);return Object.assign(n,t),n},ls=e=>e?uc(e):uc,Vv=T.createContext(null),sf=T.createContext(void 0),wn=()=>{const e=T.use(sf);if(!e)throw new Error("useBookingModal must be used within a BookingModalProvider");return e},ae={DAY:"day",WEEK:"week",TABLE:"table",MONTH:"month"},Lv=(e,t)=>({bookingViewType:"week",bookingBulkData:{user:{id:"",profile:{id:"",color:"#14b8a6",name:""}},booking:[]},setBookingBulkData:n=>e(r=>({...r,bookingBulkData:{...n}})),updatingBookingBulkData:(n,r)=>{e(o=>{const s=o.bookingBulkData.booking.map(i=>new Date(i.startAt).getDate()===r&&n.id===i.id?n:i);return{...o,bookingBulkData:{...o.bookingBulkData,booking:s}}})},resetBookingResponse:()=>e(n=>({...n,bookingResponse:null})),setBookingViewType:n=>e(r=>({...r,bookingViewType:n})),optimisticCardUpdate:(n,r,o,s)=>{const i={...n,startAt:r,finishAt:o},a=new Date(s.day).getDate();t().updatingBookingBulkData(i,a)}}),pn=e=>{var i;const t=new Date(e.key),n=t.getDate().toString().padStart(2,"0"),r=(t.getMonth()+1).toString().padStart(2,"0"),s=`${t.getFullYear()}-${r}-${n}`;return(i=e.userId)!=null&&i.length?`${s};${e.time};${e.userId}`:`${s};${e.time}`},ki={resizeBookingNorthId:e=>e!=null&&e.overflow?{startAt:e.startAt,id:e.id}:e,resizeBookingSouthId:e=>e!=null&&e.overflow?{finishAt:e.finishAt,id:e.id}:e,resetToFirstHourNextDay:e=>{const t=new Date(e.startAt);return t.setHours(0,0,0,0),t.setDate(e.finishAt.getDate()),t}},af=6e4,$v=36e5,dc=Symbol.for("constructDateFrom");function Ma(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&dc in e?e[dc](t):e instanceof Date?new e.constructor(t):new Date(t)}function Ii(e,t){return Ma(e,e)}function lf(e,...t){const n=Ma.bind(null,t.find(r=>typeof r=="object"));return t.map(n)}function Bv(e,t,n){const r=Ii(e);return r.setTime(r.getTime()+t*af),r}function cf(e){return t=>{const r=(e?Math[e]:Math.trunc)(t);return r===0?0:r}}function zv(e,t,n){const[r,o]=lf(n==null?void 0:n.in,e,t),s=(+r-+o)/$v;return cf(n==null?void 0:n.roundingMethod)(s)}function Hv(e,t){return+Ii(e)-+Ii(t)}function Wv(e,t,n){const r=Hv(e,t)/af;return cf(n==null?void 0:n.roundingMethod)(r)}function Uv(e,t){const[n,r]=lf(e,t.start,t.end);return{start:n,end:r}}function Gv(e,t){const{start:n,end:r}=Uv(t==null?void 0:t.in,e);let o=+n>+r;const s=o?+n:+r,i=o?r:n;i.setMinutes(0,0,0);let a=1;const l=[];for(;+i<=s;)l.push(Ma(n,i)),i.setHours(i.getHours()+a);return o?l.reverse():l}function Kv(e,t,n){return Bv(e,-t)}function Yv(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function qv(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var o=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,o.get?o:{enumerable:!0,get:function(){return e[r]}})}),n}var Ao={exports:{}},Xv=Ao.exports,fc;function Zv(){return fc||(fc=1,function(e,t){(function(n,r){e.exports=r()})(Xv,function(){var n=1e3,r=6e4,o=36e5,s="millisecond",i="second",a="minute",l="hour",c="day",u="week",d="month",f="quarter",h="year",m="date",p="Invalid Date",b=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,y=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,g={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(L){var j=["th","st","nd","rd"],_=L%100;return"["+L+(j[(_-20)%10]||j[_]||j[0])+"]"}},w=function(L,j,_){var N=String(L);return!N||N.length>=j?L:""+Array(j+1-N.length).join(_)+L},C={s:w,z:function(L){var j=-L.utcOffset(),_=Math.abs(j),N=Math.floor(_/60),O=_%60;return(j<=0?"+":"-")+w(N,2,"0")+":"+w(O,2,"0")},m:function L(j,_){if(j.date()<_.date())return-L(_,j);var N=12*(_.year()-j.year())+(_.month()-j.month()),O=j.clone().add(N,d),V=_-O<0,k=j.clone().add(N+(V?-1:1),d);return+(-(N+(_-O)/(V?O-k:k-O))||0)},a:function(L){return L<0?Math.ceil(L)||0:Math.floor(L)},p:function(L){return{M:d,y:h,w:u,d:c,D:m,h:l,m:a,s:i,ms:s,Q:f}[L]||String(L||"").toLowerCase().replace(/s$/,"")},u:function(L){return L===void 0}},x="en",M={};M[x]=g;var S="$isDayjsObject",D=function(L){return L instanceof F||!(!L||!L[S])},P=function L(j,_,N){var O;if(!j)return x;if(typeof j=="string"){var V=j.toLowerCase();M[V]&&(O=V),_&&(M[V]=_,O=V);var k=j.split("-");if(!O&&k.length>1)return L(k[0])}else{var I=j.name;M[I]=j,O=I}return!N&&O&&(x=O),O||!N&&x},E=function(L,j){if(D(L))return L.clone();var _=typeof j=="object"?j:{};return _.date=L,_.args=arguments,new F(_)},A=C;A.l=P,A.i=D,A.w=function(L,j){return E(L,{locale:j.$L,utc:j.$u,x:j.$x,$offset:j.$offset})};var F=function(){function L(_){this.$L=P(_.locale,null,!0),this.parse(_),this.$x=this.$x||_.x||{},this[S]=!0}var j=L.prototype;return j.parse=function(_){this.$d=function(N){var O=N.date,V=N.utc;if(O===null)return new Date(NaN);if(A.u(O))return new Date;if(O instanceof Date)return new Date(O);if(typeof O=="string"&&!/Z$/i.test(O)){var k=O.match(b);if(k){var I=k[2]-1||0,$=(k[7]||"0").substring(0,3);return V?new Date(Date.UTC(k[1],I,k[3]||1,k[4]||0,k[5]||0,k[6]||0,$)):new Date(k[1],I,k[3]||1,k[4]||0,k[5]||0,k[6]||0,$)}}return new Date(O)}(_),this.init()},j.init=function(){var _=this.$d;this.$y=_.getFullYear(),this.$M=_.getMonth(),this.$D=_.getDate(),this.$W=_.getDay(),this.$H=_.getHours(),this.$m=_.getMinutes(),this.$s=_.getSeconds(),this.$ms=_.getMilliseconds()},j.$utils=function(){return A},j.isValid=function(){return this.$d.toString()!==p},j.isSame=function(_,N){var O=E(_);return this.startOf(N)<=O&&O<=this.endOf(N)},j.isAfter=function(_,N){return E(_)<this.startOf(N)},j.isBefore=function(_,N){return this.endOf(N)<E(_)},j.$g=function(_,N,O){return A.u(_)?this[N]:this.set(O,_)},j.unix=function(){return Math.floor(this.valueOf()/1e3)},j.valueOf=function(){return this.$d.getTime()},j.startOf=function(_,N){var O=this,V=!!A.u(N)||N,k=A.p(_),I=function(X,G){var ne=A.w(O.$u?Date.UTC(O.$y,G,X):new Date(O.$y,G,X),O);return V?ne:ne.endOf(c)},$=function(X,G){return A.w(O.toDate()[X].apply(O.toDate("s"),(V?[0,0,0,0]:[23,59,59,999]).slice(G)),O)},H=this.$W,U=this.$M,Z=this.$D,q="set"+(this.$u?"UTC":"");switch(k){case h:return V?I(1,0):I(31,11);case d:return V?I(1,U):I(0,U+1);case u:var B=this.$locale().weekStart||0,K=(H<B?H+7:H)-B;return I(V?Z-K:Z+(6-K),U);case c:case m:return $(q+"Hours",0);case l:return $(q+"Minutes",1);case a:return $(q+"Seconds",2);case i:return $(q+"Milliseconds",3);default:return this.clone()}},j.endOf=function(_){return this.startOf(_,!1)},j.$set=function(_,N){var O,V=A.p(_),k="set"+(this.$u?"UTC":""),I=(O={},O[c]=k+"Date",O[m]=k+"Date",O[d]=k+"Month",O[h]=k+"FullYear",O[l]=k+"Hours",O[a]=k+"Minutes",O[i]=k+"Seconds",O[s]=k+"Milliseconds",O)[V],$=V===c?this.$D+(N-this.$W):N;if(V===d||V===h){var H=this.clone().set(m,1);H.$d[I]($),H.init(),this.$d=H.set(m,Math.min(this.$D,H.daysInMonth())).$d}else I&&this.$d[I]($);return this.init(),this},j.set=function(_,N){return this.clone().$set(_,N)},j.get=function(_){return this[A.p(_)]()},j.add=function(_,N){var O,V=this;_=Number(_);var k=A.p(N),I=function(U){var Z=E(V);return A.w(Z.date(Z.date()+Math.round(U*_)),V)};if(k===d)return this.set(d,this.$M+_);if(k===h)return this.set(h,this.$y+_);if(k===c)return I(1);if(k===u)return I(7);var $=(O={},O[a]=r,O[l]=o,O[i]=n,O)[k]||1,H=this.$d.getTime()+_*$;return A.w(H,this)},j.subtract=function(_,N){return this.add(-1*_,N)},j.format=function(_){var N=this,O=this.$locale();if(!this.isValid())return O.invalidDate||p;var V=_||"YYYY-MM-DDTHH:mm:ssZ",k=A.z(this),I=this.$H,$=this.$m,H=this.$M,U=O.weekdays,Z=O.months,q=O.meridiem,B=function(G,ne,z,le){return G&&(G[ne]||G(N,V))||z[ne].slice(0,le)},K=function(G){return A.s(I%12||12,G,"0")},X=q||function(G,ne,z){var le=G<12?"AM":"PM";return z?le.toLowerCase():le};return V.replace(y,function(G,ne){return ne||function(z){switch(z){case"YY":return String(N.$y).slice(-2);case"YYYY":return A.s(N.$y,4,"0");case"M":return H+1;case"MM":return A.s(H+1,2,"0");case"MMM":return B(O.monthsShort,H,Z,3);case"MMMM":return B(Z,H);case"D":return N.$D;case"DD":return A.s(N.$D,2,"0");case"d":return String(N.$W);case"dd":return B(O.weekdaysMin,N.$W,U,2);case"ddd":return B(O.weekdaysShort,N.$W,U,3);case"dddd":return U[N.$W];case"H":return String(I);case"HH":return A.s(I,2,"0");case"h":return K(1);case"hh":return K(2);case"a":return X(I,$,!0);case"A":return X(I,$,!1);case"m":return String($);case"mm":return A.s($,2,"0");case"s":return String(N.$s);case"ss":return A.s(N.$s,2,"0");case"SSS":return A.s(N.$ms,3,"0");case"Z":return k}return null}(G)||k.replace(":","")})},j.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},j.diff=function(_,N,O){var V,k=this,I=A.p(N),$=E(_),H=($.utcOffset()-this.utcOffset())*r,U=this-$,Z=function(){return A.m(k,$)};switch(I){case h:V=Z()/12;break;case d:V=Z();break;case f:V=Z()/3;break;case u:V=(U-H)/6048e5;break;case c:V=(U-H)/864e5;break;case l:V=U/o;break;case a:V=U/r;break;case i:V=U/n;break;default:V=U}return O?V:A.a(V)},j.daysInMonth=function(){return this.endOf(d).$D},j.$locale=function(){return M[this.$L]},j.locale=function(_,N){if(!_)return this.$L;var O=this.clone(),V=P(_,N,!0);return V&&(O.$L=V),O},j.clone=function(){return A.w(this.$d,this)},j.toDate=function(){return new Date(this.valueOf())},j.toJSON=function(){return this.isValid()?this.toISOString():null},j.toISOString=function(){return this.$d.toISOString()},j.toString=function(){return this.$d.toUTCString()},L}(),W=F.prototype;return E.prototype=W,[["$ms",s],["$s",i],["$m",a],["$H",l],["$W",c],["$M",d],["$y",h],["$D",m]].forEach(function(L){W[L[1]]=function(j){return this.$g(j,L[0],L[1])}}),E.extend=function(L,j){return L.$i||(L(j,F,E),L.$i=!0),E},E.locale=P,E.isDayjs=D,E.unix=function(L){return E(1e3*L)},E.en=M[x],E.Ls=M,E.p={},E})}(Ao)),Ao.exports}var Jv=Zv();const hc=Yv(Jv),Ht=600,Oo=15,Pa="00:00",Nn=["Janeiro","Fevereiro","Março","Abril","Maio","Junho","Julho","Agosto","Setembro","Outubro","Novembro","Dezembro"],uf=-Math.abs(1.98),Bo=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],Qv=["Domingo","Segunda","Terça","Quarta","Quinta","Sexta","Sábado"],Y={findIndexToStart(e=new Date){const t=Bo[e.getDay()];return this.findActualDayIndex(t)},findActualDayIndex(e){return Bo.indexOf(e)},generateWeekDays(e){const t=this.findIndexToStart(e);return{week:new Array(7).fill(0).map((o,s)=>{const i=e||new Date,a=s-t;return new Date(i.getFullYear(),i.getMonth(),i.getDate()+a)})}},generateDays(e,t){const n=[],r=new Date(e.getFullYear(),e.getMonth(),e.getDate()+t);return n.push(r),n},addDay(e,t){return new Date(e.getFullYear(),e.getMonth(),e.getDate()+t)},formatDate(e){return e.split(" ").slice(2,3).join(",").replace(","," | ")},dateTimeAsString(e){const t=String(e.getHours()).padStart(2,"0"),n=String(e.getMinutes()).padStart(2,"0");return`${t}:${n}`},getTimeDiff(e,t){const n=Number(new Date(t))-Number(new Date(e)),r=Math.floor(n/1e3/60),o=Math.floor(r/60),s=r%60;return`${o}:${s.toString().padStart(2,"0")}`},buildFutureDateList(e,t,n=1){const r=(o,s)=>{const i=new Date(o),a=i.getDate()+s+n;return i.setDate(a),i};return Array.from({length:t},(o,s)=>r(e.startAt,s))},bookingTimeRange:(e,t)=>{const n=Y.getTimeDiff(e.startAt,e.finishAt),r=Y.getNewFinishAt(t,n);return{id:e.id,startAt:new Date(t),finishAt:r}},getNewFinishAt(e,t){const n=new Date(e),r=t.split(":"),o=Number(r[0]),s=Number(r[1]);return n.setHours(n.getHours()+o),n.setMinutes(n.getMinutes()+s),n},minuteDifference(e,t){return Wv(e,t)},calculateDaysDifference(e,t){return e.getDate()-t.getDate()},dateAndHourDateToString(e){const t=new Date(e);return`${t.getHours().toLocaleString().padStart(2,"0")}:${t.getMinutes().toLocaleString().padStart(2,"0")}`},shortMonthDescription(...e){return`${Nn[e[0].getMonth()].slice(0,3)} - ${Nn[e[1].getMonth()].slice(0,3)}`},timeDiffInMinutes(e,t){const n=hc(e),r=hc(t);return n.diff(r)/6e4},subtractMinutes(e,t){return Kv(e,t)},addMinuteToHour(e,t){return`${e.split(":")[0]}:${t}`},dateToString(e){return new Date(e).toTimeString()},dateToStringSelected(e){return new Date(e).toDateString()},roundMinutes(e){return e>=15&&e<30?15:e>=30&&e<45?30:e>=45&&e<60?45:0},hourMinutesStringToDate(e){const t=new Date,[n,r]=e.split(":");return t.setHours(Number(n),Number(r)),t},addMinutesToDate(e,t){const n=new Date(e);return n.setHours(n.getHours(),n.getMinutes()+t,n.getMinutes()),n},newDateKey(e,t){const n=new Date(e);return n.setHours(Number(t.split(":")[0])),n.setMinutes(Number(t.split(":")[1])),n.toString()},addMinutesToHour(e,t){const n=Y.hourMinutesStringToDate(e),r=Y.addMinutesToDate(n,t);return Y.dateAndHourDateToString(r)},convertStringTimeToDateFormat(e){const t=new Date,[n,r]=e.split(":");return t.setHours(Number(n),Number(r),0,0),t},isTodayDate(e){const t=new Date,n=e.getDate()===t.getDate(),r=e.getMonth()===t.getMonth(),o=e.getFullYear()===t.getFullYear();return n&&r&&o},firstAndLastWeekDays(e){return{firstDayOfWeek:e[0],lastDayOfWeek:e[e.length-1]}},generateWeekMonthLabel(e){const{firstDayOfWeek:t,lastDayOfWeek:n}=Y.firstAndLastWeekDays(e),r=t.getMonth();return r!==n.getMonth()?Y.shortMonthDescription(t,n):Nn[r]},isFinishDateAnotherDay(e,t){return e.getDate()>t.getDate()},compareSameDate(e,t){const n=e.getMonth()===t.getMonth(),r=e.getFullYear()===t.getFullYear();return n&&r}},ey={capitalize(e){return`${this.returnFirstChar(e)}${e.slice(1,e.length)}`},returnFirstChar(e){return e.charAt(0).toUpperCase()}},pc=(e,t)=>{const r=Gv({start:new Date(2014,9,6,e),end:new Date(2014,9,6,t)}).sort((o,s)=>{const i=new Date(o).getHours(),a=new Date(s).getHours();return i-a});return Object.values(r).map(o=>`${String(o.getHours()).padStart(2,"0")}:00`)},zs=1,Hs=24,ty=Y.generateWeekDays(),ny=(e,t)=>({hours:pc(zs,Hs),daysOfWeek:ty.week,operationalStartTime:zs,operationalEndTime:Hs,configure:n=>{const r=n.startTime??zs,o=n.endTime??Hs;e(s=>({...s,hours:pc(r,o),operationalStartTime:r,operationalEndTime:o}))},setTodayDay:n=>{const r=Y.generateDays(n,0);return e(o=>({...o,daysOfWeek:r,lastDayOfWeek:r[0]||new Date})),r[0]},todayWeek:n=>{let r=[];return e(o=>{const{week:s}=Y.generateWeekDays(n);return r=s,{...o,daysOfWeek:s}}),r},nextWeek:()=>{const n=Y.addDay(t().getWeek().lastDayOfWeek,1);let r=[];const{week:o}=Y.generateWeekDays(n);return r=o,e(s=>({...s,daysOfWeek:o})),r},previousWeek:()=>{const n=Y.addDay(t().getWeek().firstDayOfWeek,-1);let r=[];const{week:o}=Y.generateWeekDays(n);return r=o,e(s=>({...s,daysOfWeek:o})),r},setDays:n=>{const r=t().daysOfWeek[0];if(!r)return[];const o=Y.generateDays(r,n);return e(s=>({...s,daysOfWeek:o})),o},getWeek:()=>{const n=t().daysOfWeek[0],r=t().daysOfWeek[t().daysOfWeek.length-1];return{firstDayOfWeek:n,lastDayOfWeek:r}}}),ry=(e,t)=>({setWeekAndViewType:n=>{const r=t().todayWeek(n);return t().setBookingViewType(ae.WEEK),Y.firstAndLastWeekDays(r)},setTodayDayAndViewType:n=>{const r=t().setTodayDay(n);return t().setBookingViewType(ae.DAY),r}}),$e=ls()((...e)=>({...ny(...e),...Lv(...e),...ry(...e)})),df=()=>{const{setBookingViewType:e,todayWeek:t,setTodayDay:n,daysOfWeek:r,getWeek:o}=$e();return{onViewTypeChange:i=>{switch(i){case ae.DAY:{e(ae.DAY),n(r[0]);break}case ae.WEEK:{e(ae.WEEK),t(o().firstDayOfWeek);break}case ae.TABLE:{e(ae.TABLE),n(o().firstDayOfWeek);break}}}}},ff=T.createContext(null),hf=e=>{const t=T.use(ff);if(!t)throw new Error("Missing useMonthDescription must be within a MonthDescriptionProvider");return zr(t,e)},Ni={date:"",startAt:"",finishAt:"",slotStartAt:""},oy=e=>Wn((t,n)=>({...Ni,...e,updateForm:r=>t(o=>({...o,...r})),updateDynamicForm:(r,o)=>t(s=>({...s,[r]:o})),updateStartAt:r=>t(o=>({...o,startAt:r})),updateFinishAt:r=>t(o=>({...o,finishAt:r})),updateFinishAtWithOffset:(r,o=15)=>{const s=Y.addMinutesToHour(r,o);return n().updateFinishAt(s),s},updateClient:(r,o)=>t(s=>({...s,client:{id:r,name:o}})),updateDate:r=>t(o=>({...o,date:r})),updatePrevStartAt:r=>t(o=>({...o,slotStartAt:r})),resetForm:()=>t(Ni)})),pf=T.createContext(null),sy=({children:e,ref:t,...n})=>{const r=T.useRef(null);r.current||(r.current=oy(n));const o=s=>{var i;(i=r.current)==null||i.getState().updateFinishAt(s)};return T.useImperativeHandle(t,()=>({updateFinishAt:o})),v.jsx(pf,{value:r.current,children:e})},gf=e=>{const t=T.use(pf);if(!t)throw new Error("Missing useNewEventContextProvider must be within a NewEventProvider");return zr(t,e)},mf=T.createContext(null),Hr=e=>{const t=T.use(mf);if(!t)throw new Error("Missing useUserInfoStore must be within a UsersInfoProvider");return zr(t,e)},vf=T.createContext(null),yf=e=>{const t=T.use(vf);if(!t)throw new Error("useConfig must be used within a ConfigContext");return zr(t,e)},wf={selectedDate:new Date,isBookingLoading:!1,bookingModalState:!1,selectedHour:"",cardsRef:new Map},iy=e=>Wn(t=>({...wf,...e,clearDraggingBookings:()=>t(n=>({...n,draggingBooking:null})),changeNewBookingStateModal:()=>t({bookingModalState:!0}),openNewBookingModal:(n,r)=>{n&&t({selectedDate:n}),r&&t({selectedHour:r})},setIsBookingLoading:()=>t({isBookingLoading:!0}),setSelectedDate:n=>t(r=>({...r,selectedDate:n})),setSelectedHour:n=>t(r=>({...r,selectedHour:n})),setCardRef:(n,r)=>t(o=>({...o,cardsRef:o.cardsRef.set(n,r)}))})),ay=({children:e,...t})=>{const n=T.useRef(null);return n.current||(n.current=iy(t)),v.jsx(Vv,{value:n.current,children:e})},ly=({children:e,...t})=>v.jsx(sf,{value:{...t},children:e}),cy={systemColor:"#059669",isTimeInfoVisible:!0},uy=e=>Wn(t=>({...cy,...e,updateSystemColor:n=>{t(r=>({...r,systemColor:n}))},changeTimeInfoVisibility:n=>{t(r=>({...r,isTimeInfoVisible:n}))}})),dy=({children:e,...t})=>{const n=T.useRef(null);return n.current||(n.current=uy(t)),v.jsx(vf,{value:n.current,children:e})},xf={month:new Date().getMonth(),fullYear:new Date().getFullYear(),monthMessage:""},fy=e=>Wn((t,n)=>({...e,...xf,updateMonthMessage:r=>{t(o=>({...o,...r}))},updateHeaderDateLabel:r=>{n().updateMonthMessage({month:r.getMonth(),fullYear:r.getFullYear(),monthMessage:Nn[r.getMonth()]})}})),hy=({children:e,...t})=>{const n=T.useRef(null);return n.current||(n.current=fy(t)),v.jsx(ff,{value:n.current,children:e})},py={isDragging:!1},xn=ls(e=>({...py,updateIsDragging:t=>e(n=>({...n,isDragging:t}))})),Jt=ls((e,t)=>({emptySlotNodes:new Map,selectedNode:"",setEmptySlotNode:(n,r,o)=>{e(s=>{const i=new Map(s.emptySlotNodes),f=(zv(new Date(`1970/01/01 ${o.endTime}`),new Date(2014,6,0,Number(o.startTime),0))+2)*4*7-1;i.size>f&&i.clear();const m=pn(r);return i.set(m,n),{...s,emptySlotNodes:i}})},setSelectedNode:n=>{const r=new Map(t().emptySlotNodes),o=t().selectedNode;e(s=>{if(o.length){const i=r.get(o);i&&i.closeEvent()}return{...s,selectedNode:n}})},resetSelectedNode:()=>e(n=>({...n,selectedNode:""})),resetNodes:()=>{e(n=>{const r=new Map(n.emptySlotNodes);return r.clear(),{...n,emptySlotNodes:r}})}})),bf=ls(e=>({startAt:"",booking:null,slotData:null,updateStartAt:t=>e(n=>({...n,startAt:t})),updateBooking:t=>{e(n=>{var r;return(t==null?void 0:t.startAt)!==((r=n.booking)==null?void 0:r.startAt)?{...n,booking:t}:n})},updateSlotData:t=>{e(n=>({...n,slotData:t}))}})),gy={users:[]},my=e=>Wn(t=>({...gy,...e,updateUsers:n=>t(r=>({...r,users:n})),updateUsersDisabled:(n,r)=>t(o=>{const i=o.users.map(a=>a.id===n?{...a,status:r}:a);return{...o,users:i}})})),vy=({children:e,ref:t,...n})=>{const r=T.useRef(null);r.current||(r.current=my(n));const o=(s,i)=>{var a;(a=r.current)==null||a.getState().updateUsersDisabled(s,i)};return T.useImperativeHandle(t,()=>({updateDisabledUser:o})),v.jsx(mf,{value:r.current,children:e})},cs=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Un(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function Ea(e){return"nodeType"in e}function Fe(e){var t,n;return e?Un(e)?e:Ea(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function Aa(e){const{Document:t}=Fe(e);return e instanceof t}function Wr(e){return Un(e)?!1:e instanceof Fe(e).HTMLElement}function Sf(e){return e instanceof Fe(e).SVGElement}function Gn(e){return e?Un(e)?e.document:Ea(e)?Aa(e)?e:Wr(e)||Sf(e)?e.ownerDocument:document:document:document}const Dt=cs?T.useLayoutEffect:T.useEffect;function us(e){const t=T.useRef(e);return Dt(()=>{t.current=e}),T.useCallback(function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return t.current==null?void 0:t.current(...r)},[])}function yy(){const e=T.useRef(null),t=T.useCallback((r,o)=>{e.current=setInterval(r,o)},[]),n=T.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,n]}function Pr(e,t){t===void 0&&(t=[e]);const n=T.useRef(e);return Dt(()=>{n.current!==e&&(n.current=e)},t),n}function Ur(e,t){const n=T.useRef();return T.useMemo(()=>{const r=e(n.current);return n.current=r,r},[...t])}function zo(e){const t=us(e),n=T.useRef(null),r=T.useCallback(o=>{o!==n.current&&(t==null||t(o,n.current)),n.current=o},[]);return[n,r]}function Ho(e){const t=T.useRef();return T.useEffect(()=>{t.current=e},[e]),t.current}let Ws={};function ds(e,t){return T.useMemo(()=>{if(t)return t;const n=Ws[e]==null?0:Ws[e]+1;return Ws[e]=n,e+"-"+n},[e,t])}function Cf(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return r.reduce((s,i)=>{const a=Object.entries(i);for(const[l,c]of a){const u=s[l];u!=null&&(s[l]=u+e*c)}return s},{...t})}}const jn=Cf(1),Wo=Cf(-1);function wy(e){return"clientX"in e&&"clientY"in e}function Oa(e){if(!e)return!1;const{KeyboardEvent:t}=Fe(e.target);return t&&e instanceof t}function xy(e){if(!e)return!1;const{TouchEvent:t}=Fe(e.target);return t&&e instanceof t}function Uo(e){if(xy(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return wy(e)?{x:e.clientX,y:e.clientY}:null}const Er=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:n}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:n}=e;return"scaleX("+t+") scaleY("+n+")"}},Transform:{toString(e){if(e)return[Er.Translate.toString(e),Er.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),gc="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function by(e){return e.matches(gc)?e:e.querySelector(gc)}const Sy={display:"none"};function Cy(e){let{id:t,value:n}=e;return T.createElement("div",{id:t,style:Sy},n)}function Ry(e){let{id:t,announcement:n,ariaLiveType:r="assertive"}=e;const o={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return T.createElement("div",{id:t,style:o,role:"status","aria-live":r,"aria-atomic":!0},n)}function Dy(){const[e,t]=T.useState("");return{announce:T.useCallback(r=>{r!=null&&t(r)},[]),announcement:e}}const Rf=T.createContext(null);function Gr(e){const t=T.useContext(Rf);T.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function Ty(){const[e]=T.useState(()=>new Set),t=T.useCallback(r=>(e.add(r),()=>e.delete(r)),[e]);return[T.useCallback(r=>{let{type:o,event:s}=r;e.forEach(i=>{var a;return(a=i[o])==null?void 0:a.call(i,s)})},[e]),t]}const My={draggable:`
|
|
5
|
+
`);return s&&s.insertRule(i,0),r},zo=function(){return zo=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},zo.apply(this,arguments)},Fv=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n},Vv=jv("GridLoader","0% {transform: scale(1)} 50% {transform: scale(0.5); opacity: 0.7} 100% {transform: scale(1); opacity: 1}","grid"),Tt=function(e){return Math.random()*e};function Lv(e){var t=e.loading,n=t===void 0?!0:t,r=e.color,o=r===void 0?"#000000":r,s=e.speedMultiplier,i=s===void 0?1:s,a=e.cssOverride,l=a===void 0?{}:a,c=e.size,u=c===void 0?15:c,d=e.margin,p=d===void 0?2:d,f=Fv(e,["loading","color","speedMultiplier","cssOverride","size","margin"]),g=Fi(u),h=Fi(p),b=parseFloat(g.value.toString())*3+parseFloat(h.value.toString())*6,w=zo({width:"".concat(b).concat(g.unit),fontSize:0,display:"inline-block"},l),v=function(m){return{display:"inline-block",backgroundColor:o,width:"".concat(Gs(u)),height:"".concat(Gs(u)),margin:Gs(p),borderRadius:"100%",animationFillMode:"both",animation:"".concat(Vv," ").concat((m/100+.6)/i,"s ").concat(m/100-.2,"s infinite ease")}};return n?T.createElement("span",zo({style:w},f,{ref:function(m){m&&m.style.setProperty("width","".concat(b).concat(g.unit),"important")}}),T.createElement("span",{style:v(Tt(100))}),T.createElement("span",{style:v(Tt(100))}),T.createElement("span",{style:v(Tt(100))}),T.createElement("span",{style:v(Tt(100))}),T.createElement("span",{style:v(Tt(100))}),T.createElement("span",{style:v(Tt(100))}),T.createElement("span",{style:v(Tt(100))}),T.createElement("span",{style:v(Tt(100))}),T.createElement("span",{style:v(Tt(100))})):null}const dc=e=>{let t;const n=new Set,r=(c,u)=>{const d=typeof c=="function"?c(t):c;if(!Object.is(d,t)){const p=t;t=u??(typeof d!="object"||d===null)?d:Object.assign({},t,d),n.forEach(f=>f(t,p))}},o=()=>t,a={setState:r,getState:o,getInitialState:()=>l,subscribe:c=>(n.add(c),()=>n.delete(c))},l=t=e(r,o,a);return a},Kn=e=>e?dc(e):dc,$v=e=>e;function Kr(e,t=$v){const n=R.useSyncExternalStore(e.subscribe,()=>t(e.getState()),()=>t(e.getInitialState()));return R.useDebugValue(n),n}const fc=e=>{const t=Kn(e),n=r=>Kr(t,r);return Object.assign(n,t),n},cs=e=>e?fc(e):fc,Bv=R.createContext(null),ff=R.createContext(void 0),nn=()=>{const e=R.use(ff);if(!e)throw new Error("useBookingModal must be used within a BookingModalProvider");return e},ie={DAY:"day",WEEK:"week",TABLE:"table",MONTH:"month"},zv=(e,t)=>({bookingViewType:"week",bookingBulkData:{user:{id:"",profile:{id:"",color:"#14b8a6",name:""}},booking:[]},setBookingBulkData:n=>e(r=>({...r,bookingBulkData:{...n}})),updatingBookingBulkData:(n,r)=>{e(o=>{const s=o.bookingBulkData.booking.map(i=>new Date(i.startAt).getDate()===r&&n.id===i.id?n:i);return{...o,bookingBulkData:{...o.bookingBulkData,booking:s}}})},resetBookingResponse:()=>e(n=>({...n,bookingResponse:null})),setBookingViewType:n=>e(r=>({...r,bookingViewType:n})),optimisticCardUpdate:(n,r,o,s)=>{const i={...n,startAt:r,finishAt:o},a=new Date(s.day).getDate();t().updatingBookingBulkData(i,a)}}),Vi={resizeBookingNorthId:e=>e!=null&&e.overflow?{startAt:e.startAt,id:e.id}:e,resizeBookingSouthId:e=>e!=null&&e.overflow?{finishAt:e.finishAt,id:e.id}:e,resetToFirstHourNextDay:e=>{const t=new Date(e.startAt);return t.setHours(0,0,0,0),t.setDate(e.finishAt.getDate()),t}},qn=e=>{var i;const t=new Date(e.key),n=t.getDate().toString().padStart(2,"0"),r=(t.getMonth()+1).toString().padStart(2,"0"),s=`${t.getFullYear()}-${r}-${n}`;return(i=e.userId)!=null&&i.length?`${s};${e.time};${e.userId}`:`${s};${e.time}`},Hv={upperBound:45,lowerBound:15},De={isUpperBoundReached(e,t){const n=(e||24)-1;return De.checkBoundConditions(t.getHours(),n,t.getMinutes(),"upperBound")},isLowerBoundReached(e,t){const n=e?e+1:0;return De.checkBoundConditions(t.getHours(),n,t.getMinutes(),"lowerBound")},adjustedDateMinutes(e,t){const n=new Date(e),r=n.getMinutes();return t==="add"&&n.setMinutes(r+15),t==="remove"&&n.setMinutes(r-15),n},baseValueLimitMin(e){return e===0},checkBoundConditions(e,t,n,r){return e===t&&n===Hv[r]}},pf=6e4,Wv=36e5,pc=Symbol.for("constructDateFrom");function ka(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&pc in e?e[pc](t):e instanceof Date?new e.constructor(t):new Date(t)}function Li(e,t){return ka(e,e)}function hf(e,...t){const n=ka.bind(null,t.find(r=>typeof r=="object"));return t.map(n)}function Uv(e,t,n){const r=Li(e);return r.setTime(r.getTime()+t*pf),r}function gf(e){return t=>{const r=(e?Math[e]:Math.trunc)(t);return r===0?0:r}}function Gv(e,t,n){const[r,o]=hf(n==null?void 0:n.in,e,t),s=(+r-+o)/Wv;return gf(n==null?void 0:n.roundingMethod)(s)}function Yv(e,t){return+Li(e)-+Li(t)}function Kv(e,t,n){const r=Yv(e,t)/pf;return gf(n==null?void 0:n.roundingMethod)(r)}function qv(e,t){const[n,r]=hf(e,t.start,t.end);return{start:n,end:r}}function Xv(e,t){const{start:n,end:r}=qv(t==null?void 0:t.in,e);let o=+n>+r;const s=o?+n:+r,i=o?r:n;i.setMinutes(0,0,0);let a=1;const l=[];for(;+i<=s;)l.push(ka(n,i)),i.setHours(i.getHours()+a);return o?l.reverse():l}function Zv(e,t,n){return Uv(e,-t)}function Jv(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Qv(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var o=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,o.get?o:{enumerable:!0,get:function(){return e[r]}})}),n}var _o={exports:{}},ey=_o.exports,hc;function ty(){return hc||(hc=1,function(e,t){(function(n,r){e.exports=r()})(ey,function(){var n=1e3,r=6e4,o=36e5,s="millisecond",i="second",a="minute",l="hour",c="day",u="week",d="month",p="quarter",f="year",g="date",h="Invalid Date",b=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,w=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,v={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(F){var L=["th","st","nd","rd"],k=F%100;return"["+F+(L[(k-20)%10]||L[k]||L[0])+"]"}},m=function(F,L,k){var j=String(F);return!j||j.length>=L?F:""+Array(L+1-j.length).join(k)+F},C={s:m,z:function(F){var L=-F.utcOffset(),k=Math.abs(L),j=Math.floor(k/60),E=k%60;return(L<=0?"+":"-")+m(j,2,"0")+":"+m(E,2,"0")},m:function F(L,k){if(L.date()<k.date())return-F(k,L);var j=12*(k.year()-L.year())+(k.month()-L.month()),E=L.clone().add(j,d),N=k-E<0,A=L.clone().add(j+(N?-1:1),d);return+(-(j+(k-E)/(N?E-A:A-E))||0)},a:function(F){return F<0?Math.ceil(F)||0:Math.floor(F)},p:function(F){return{M:d,y:f,w:u,d:c,D:g,h:l,m:a,s:i,ms:s,Q:p}[F]||String(F||"").toLowerCase().replace(/s$/,"")},u:function(F){return F===void 0}},x="en",D={};D[x]=v;var S="$isDayjsObject",M=function(F){return F instanceof V||!(!F||!F[S])},P=function F(L,k,j){var E;if(!L)return x;if(typeof L=="string"){var N=L.toLowerCase();D[N]&&(E=N),k&&(D[N]=k,E=N);var A=L.split("-");if(!E&&A.length>1)return F(A[0])}else{var I=L.name;D[I]=L,E=I}return!j&&E&&(x=E),E||!j&&x},O=function(F,L){if(M(F))return F.clone();var k=typeof L=="object"?L:{};return k.date=F,k.args=arguments,new V(k)},_=C;_.l=P,_.i=M,_.w=function(F,L){return O(F,{locale:L.$L,utc:L.$u,x:L.$x,$offset:L.$offset})};var V=function(){function F(k){this.$L=P(k.locale,null,!0),this.parse(k),this.$x=this.$x||k.x||{},this[S]=!0}var L=F.prototype;return L.parse=function(k){this.$d=function(j){var E=j.date,N=j.utc;if(E===null)return new Date(NaN);if(_.u(E))return new Date;if(E instanceof Date)return new Date(E);if(typeof E=="string"&&!/Z$/i.test(E)){var A=E.match(b);if(A){var I=A[2]-1||0,B=(A[7]||"0").substring(0,3);return N?new Date(Date.UTC(A[1],I,A[3]||1,A[4]||0,A[5]||0,A[6]||0,B)):new Date(A[1],I,A[3]||1,A[4]||0,A[5]||0,A[6]||0,B)}}return new Date(E)}(k),this.init()},L.init=function(){var k=this.$d;this.$y=k.getFullYear(),this.$M=k.getMonth(),this.$D=k.getDate(),this.$W=k.getDay(),this.$H=k.getHours(),this.$m=k.getMinutes(),this.$s=k.getSeconds(),this.$ms=k.getMilliseconds()},L.$utils=function(){return _},L.isValid=function(){return this.$d.toString()!==h},L.isSame=function(k,j){var E=O(k);return this.startOf(j)<=E&&E<=this.endOf(j)},L.isAfter=function(k,j){return O(k)<this.startOf(j)},L.isBefore=function(k,j){return this.endOf(j)<O(k)},L.$g=function(k,j,E){return _.u(k)?this[j]:this.set(E,k)},L.unix=function(){return Math.floor(this.valueOf()/1e3)},L.valueOf=function(){return this.$d.getTime()},L.startOf=function(k,j){var E=this,N=!!_.u(j)||j,A=_.p(k),I=function(X,U){var te=_.w(E.$u?Date.UTC(E.$y,U,X):new Date(E.$y,U,X),E);return N?te:te.endOf(c)},B=function(X,U){return _.w(E.toDate()[X].apply(E.toDate("s"),(N?[0,0,0,0]:[23,59,59,999]).slice(U)),E)},H=this.$W,W=this.$M,Z=this.$D,K="set"+(this.$u?"UTC":"");switch(A){case f:return N?I(1,0):I(31,11);case d:return N?I(1,W):I(0,W+1);case u:var $=this.$locale().weekStart||0,q=(H<$?H+7:H)-$;return I(N?Z-q:Z+(6-q),W);case c:case g:return B(K+"Hours",0);case l:return B(K+"Minutes",1);case a:return B(K+"Seconds",2);case i:return B(K+"Milliseconds",3);default:return this.clone()}},L.endOf=function(k){return this.startOf(k,!1)},L.$set=function(k,j){var E,N=_.p(k),A="set"+(this.$u?"UTC":""),I=(E={},E[c]=A+"Date",E[g]=A+"Date",E[d]=A+"Month",E[f]=A+"FullYear",E[l]=A+"Hours",E[a]=A+"Minutes",E[i]=A+"Seconds",E[s]=A+"Milliseconds",E)[N],B=N===c?this.$D+(j-this.$W):j;if(N===d||N===f){var H=this.clone().set(g,1);H.$d[I](B),H.init(),this.$d=H.set(g,Math.min(this.$D,H.daysInMonth())).$d}else I&&this.$d[I](B);return this.init(),this},L.set=function(k,j){return this.clone().$set(k,j)},L.get=function(k){return this[_.p(k)]()},L.add=function(k,j){var E,N=this;k=Number(k);var A=_.p(j),I=function(W){var Z=O(N);return _.w(Z.date(Z.date()+Math.round(W*k)),N)};if(A===d)return this.set(d,this.$M+k);if(A===f)return this.set(f,this.$y+k);if(A===c)return I(1);if(A===u)return I(7);var B=(E={},E[a]=r,E[l]=o,E[i]=n,E)[A]||1,H=this.$d.getTime()+k*B;return _.w(H,this)},L.subtract=function(k,j){return this.add(-1*k,j)},L.format=function(k){var j=this,E=this.$locale();if(!this.isValid())return E.invalidDate||h;var N=k||"YYYY-MM-DDTHH:mm:ssZ",A=_.z(this),I=this.$H,B=this.$m,H=this.$M,W=E.weekdays,Z=E.months,K=E.meridiem,$=function(U,te,z,le){return U&&(U[te]||U(j,N))||z[te].slice(0,le)},q=function(U){return _.s(I%12||12,U,"0")},X=K||function(U,te,z){var le=U<12?"AM":"PM";return z?le.toLowerCase():le};return N.replace(w,function(U,te){return te||function(z){switch(z){case"YY":return String(j.$y).slice(-2);case"YYYY":return _.s(j.$y,4,"0");case"M":return H+1;case"MM":return _.s(H+1,2,"0");case"MMM":return $(E.monthsShort,H,Z,3);case"MMMM":return $(Z,H);case"D":return j.$D;case"DD":return _.s(j.$D,2,"0");case"d":return String(j.$W);case"dd":return $(E.weekdaysMin,j.$W,W,2);case"ddd":return $(E.weekdaysShort,j.$W,W,3);case"dddd":return W[j.$W];case"H":return String(I);case"HH":return _.s(I,2,"0");case"h":return q(1);case"hh":return q(2);case"a":return X(I,B,!0);case"A":return X(I,B,!1);case"m":return String(B);case"mm":return _.s(B,2,"0");case"s":return String(j.$s);case"ss":return _.s(j.$s,2,"0");case"SSS":return _.s(j.$ms,3,"0");case"Z":return A}return null}(U)||A.replace(":","")})},L.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},L.diff=function(k,j,E){var N,A=this,I=_.p(j),B=O(k),H=(B.utcOffset()-this.utcOffset())*r,W=this-B,Z=function(){return _.m(A,B)};switch(I){case f:N=Z()/12;break;case d:N=Z();break;case p:N=Z()/3;break;case u:N=(W-H)/6048e5;break;case c:N=(W-H)/864e5;break;case l:N=W/o;break;case a:N=W/r;break;case i:N=W/n;break;default:N=W}return E?N:_.a(N)},L.daysInMonth=function(){return this.endOf(d).$D},L.$locale=function(){return D[this.$L]},L.locale=function(k,j){if(!k)return this.$L;var E=this.clone(),N=P(k,j,!0);return N&&(E.$L=N),E},L.clone=function(){return _.w(this.$d,this)},L.toDate=function(){return new Date(this.valueOf())},L.toJSON=function(){return this.isValid()?this.toISOString():null},L.toISOString=function(){return this.$d.toISOString()},L.toString=function(){return this.$d.toUTCString()},F}(),G=V.prototype;return O.prototype=G,[["$ms",s],["$s",i],["$m",a],["$H",l],["$W",c],["$M",d],["$y",f],["$D",g]].forEach(function(F){G[F[1]]=function(L){return this.$g(L,F[0],F[1])}}),O.extend=function(F,L){return F.$i||(F(L,V,O),F.$i=!0),O},O.locale=P,O.isDayjs=M,O.unix=function(F){return O(1e3*F)},O.en=D[x],O.Ls=D,O.p={},O})}(_o)),_o.exports}var ny=ty();const gc=Jv(ny),Pe=600,ko=15,mf="00:00",Vn=["Janeiro","Fevereiro","Março","Abril","Maio","Junho","Julho","Agosto","Setembro","Outubro","Novembro","Dezembro"],vf=-Math.abs(1.98),zn=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],ry=["Domingo","Segunda","Terça","Quarta","Quinta","Sexta","Sábado"],J={findIndexToStart(e=new Date){const t=zn[e.getDay()];return this.findActualDayIndex(t)},findActualDayIndex(e){return zn.indexOf(e)},generateWeekDays(e){const t=this.findIndexToStart(e);return{week:new Array(7).fill(0).map((o,s)=>{const i=e||new Date,a=s-t;return new Date(i.getFullYear(),i.getMonth(),i.getDate()+a)})}},generateDays(e,t){const n=[],r=new Date(e.getFullYear(),e.getMonth(),e.getDate()+t);return n.push(r),n},addDay(e,t){return new Date(e.getFullYear(),e.getMonth(),e.getDate()+t)},formatDate(e){return e.split(" ").slice(2,3).join(",").replace(","," | ")},dateTimeAsString(e){const t=String(e.getHours()).padStart(2,"0"),n=String(e.getMinutes()).padStart(2,"0");return`${t}:${n}`},getTimeDiff(e,t){const n=Number(new Date(t))-Number(new Date(e)),r=Math.floor(n/1e3/60),o=Math.floor(r/60),s=r%60;return`${o}:${s.toString().padStart(2,"0")}`},buildFutureDateList(e,t,n=1){const r=(o,s)=>{const i=new Date(o),a=i.getDate()+s+n;return i.setDate(a),i};return Array.from({length:t},(o,s)=>r(e.startAt,s))},bookingTimeRange:(e,t)=>{const n=J.getTimeDiff(e.startAt,e.finishAt),r=J.getNewFinishAt(t,n);return{id:e.id,startAt:new Date(t),finishAt:r}},getNewFinishAt(e,t){const n=new Date(e),r=t.split(":"),o=Number(r[0]),s=Number(r[1]);return n.setHours(n.getHours()+o),n.setMinutes(n.getMinutes()+s),n},minuteDifference(e,t){return Kv(e,t)},calculateDaysDifference(e,t){return e.getDate()-t.getDate()},dateAndHourDateToString(e){const t=new Date(e);return`${t.getHours().toLocaleString().padStart(2,"0")}:${t.getMinutes().toLocaleString().padStart(2,"0")}`},shortMonthDescription(...e){return`${Vn[e[0].getMonth()].slice(0,3)} - ${Vn[e[1].getMonth()].slice(0,3)}`},timeDiffInMinutes(e,t){const n=gc(e),r=gc(t);return n.diff(r)/6e4},subtractMinutes(e,t){return Zv(e,t)},addMinuteToHour(e,t){return`${e.split(":")[0]}:${t}`},dateToString(e){return new Date(e).toTimeString()},dateToStringSelected(e){return new Date(e).toDateString()},roundMinutes(e){return e>=15&&e<30?15:e>=30&&e<45?30:e>=45&&e<60?45:0},hourMinutesStringToDate(e){const t=new Date,[n,r]=e.split(":");return t.setHours(Number(n),Number(r)),t},addMinutesToDate(e,t){const n=new Date(e);return n.setHours(n.getHours(),n.getMinutes()+t,n.getMinutes()),n},newDateKey(e,t){const n=new Date(e);return n.setHours(Number(t.split(":")[0])),n.setMinutes(Number(t.split(":")[1])),n.toString()},addMinutesToHour(e,t){const n=J.hourMinutesStringToDate(e),r=J.addMinutesToDate(n,t);return J.dateAndHourDateToString(r)},convertStringTimeToDateFormat(e){const t=new Date,[n,r]=e.split(":");return t.setHours(Number(n),Number(r),0,0),t},isTodayDate(e){const t=new Date,n=e.getDate()===t.getDate(),r=e.getMonth()===t.getMonth(),o=e.getFullYear()===t.getFullYear();return n&&r&&o},firstAndLastWeekDays(e){return{firstDayOfWeek:e[0],lastDayOfWeek:e[e.length-1]}},generateWeekMonthLabel(e){const{firstDayOfWeek:t,lastDayOfWeek:n}=J.firstAndLastWeekDays(e),r=t.getMonth();return r!==n.getMonth()?J.shortMonthDescription(t,n):Vn[r]},isFinishDateAnotherDay(e,t){return e.getDate()>t.getDate()},compareSameDate(e,t){const n=e.getMonth()===t.getMonth(),r=e.getDate()===t.getDate(),o=e.getFullYear()===t.getFullYear();return n&&o&&r},isMidnight(e){return e.getHours()===0&&e.getMinutes()===0}},mc=(e,t)=>{const r=Xv({start:new Date(2014,9,6,e),end:new Date(2014,9,6,t)}).sort((o,s)=>{const i=new Date(o).getHours(),a=new Date(s).getHours();return i-a});return Object.values(r).map(o=>`${String(o.getHours()).padStart(2,"0")}:00`)},oy={capitalize(e){return`${this.returnFirstChar(e)}${e.slice(1,e.length)}`},returnFirstChar(e){return e.charAt(0).toUpperCase()}},Ys=1,Ks=24,sy=J.generateWeekDays(),iy=(e,t)=>({hours:mc(Ys,Ks),daysOfWeek:sy.week,operationalStartTime:Ys,operationalEndTime:Ks,configure:n=>{const r=n.startTime??Ys,o=n.endTime??Ks;e(s=>({...s,hours:mc(r,o),operationalStartTime:r,operationalEndTime:o}))},setTodayDay:n=>{const r=J.generateDays(n,0);return e(o=>({...o,daysOfWeek:r,lastDayOfWeek:r[0]||new Date})),r[0]},todayWeek:n=>{let r=[];return e(o=>{const{week:s}=J.generateWeekDays(n);return r=s,{...o,daysOfWeek:s}}),r},nextWeek:()=>{const n=J.addDay(t().getWeek().lastDayOfWeek,1);let r=[];const{week:o}=J.generateWeekDays(n);return r=o,e(s=>({...s,daysOfWeek:o})),r},previousWeek:()=>{const n=J.addDay(t().getWeek().firstDayOfWeek,-1);let r=[];const{week:o}=J.generateWeekDays(n);return r=o,e(s=>({...s,daysOfWeek:o})),r},setDays:n=>{const r=t().daysOfWeek[0];if(!r)return[];const o=J.generateDays(r,n);return e(s=>({...s,daysOfWeek:o})),o},getWeek:()=>{const n=t().daysOfWeek[0],r=t().daysOfWeek[t().daysOfWeek.length-1];return{firstDayOfWeek:n,lastDayOfWeek:r}}}),ay=(e,t)=>({setWeekAndViewType:n=>{const r=t().todayWeek(n);return t().setBookingViewType(ie.WEEK),J.firstAndLastWeekDays(r)},setTodayDayAndViewType:n=>{const r=t().setTodayDay(n);return t().setBookingViewType(ie.DAY),r}}),pe=cs()((...e)=>({...iy(...e),...zv(...e),...ay(...e)})),yf=()=>{const{setBookingViewType:e,todayWeek:t,setTodayDay:n,daysOfWeek:r,getWeek:o}=pe();return{onViewTypeChange:i=>{switch(i){case ie.DAY:{e(ie.DAY),n(r[0]);break}case ie.WEEK:{e(ie.WEEK),t(o().firstDayOfWeek);break}case ie.TABLE:{e(ie.TABLE),n(o().firstDayOfWeek);break}}}}},wf=R.createContext(null),Ho=e=>{const t=R.use(wf);if(!t)throw new Error("useConfig must be used within a ConfigContext");return Kr(t,e)},xf=R.createContext(null),Wo=e=>{const t=R.use(xf);if(!t)throw new Error("Missing useMonthDescription must be within a MonthDescriptionProvider");return Kr(t,e)},$i={date:"",startAt:"",finishAt:"",slotStartAt:""},ly=e=>Kn((t,n)=>({...$i,...e,updateForm:r=>t(o=>({...o,...r})),updateDynamicForm:(r,o)=>t(s=>({...s,[r]:o})),updateStartAt:r=>t(o=>({...o,startAt:r})),updateFinishAt:r=>t(o=>({...o,finishAt:r})),updateFinishAtWithOffset:(r,o=15)=>{const s=J.addMinutesToHour(r,o);return n().updateFinishAt(s),s},updateClient:(r,o)=>t(s=>({...s,client:{id:r,name:o}})),updateDate:r=>t(o=>({...o,date:r})),updatePrevStartAt:r=>t(o=>({...o,slotStartAt:r})),resetForm:()=>t($i)})),bf=R.createContext(null),cy=({children:e,ref:t,...n})=>{const r=R.useRef(null);r.current||(r.current=ly(n));const o=s=>{var i;(i=r.current)==null||i.getState().updateFinishAt(s)};return R.useImperativeHandle(t,()=>({updateFinishAt:o})),y.jsx(bf,{value:r.current,children:e})},Et=e=>{const t=R.use(bf);if(!t)throw new Error("Missing useNewEventContextProvider must be within a NewEventProvider");return Kr(t,e)},Sf=R.createContext(null),us=e=>{const t=R.use(Sf);if(!t)throw new Error("Missing useUserInfoStore must be within a UsersInfoProvider");return Kr(t,e)},Cf={selectedDate:new Date,isBookingLoading:!1,bookingModalState:!1,selectedHour:"",cardsRef:new Map},uy=e=>Kn(t=>({...Cf,...e,clearDraggingBookings:()=>t(n=>({...n,draggingBooking:null})),changeNewBookingStateModal:()=>t({bookingModalState:!0}),openNewBookingModal:(n,r)=>{n&&t({selectedDate:n}),r&&t({selectedHour:r})},setIsBookingLoading:()=>t({isBookingLoading:!0}),setSelectedDate:n=>t(r=>({...r,selectedDate:n})),setSelectedHour:n=>t(r=>({...r,selectedHour:n})),setCardRef:(n,r)=>t(o=>({...o,cardsRef:o.cardsRef.set(n,r)}))})),dy=({children:e,...t})=>{const n=R.useRef(null);return n.current||(n.current=uy(t)),y.jsx(Bv,{value:n.current,children:e})},fy=({children:e,...t})=>y.jsx(ff,{value:{...t},children:e}),py={isDragging:!1},bt=cs(e=>({...py,updateIsDragging:t=>e(n=>({...n,isDragging:t}))})),_r=cs(e=>({startAt:"",booking:null,slotData:null,updateStartAt:t=>e(n=>({...n,startAt:t})),updateBooking:t=>{e(n=>{var r;return(t==null?void 0:t.startAt)!==((r=n.booking)==null?void 0:r.startAt)?{...n,booking:t}:n})},updateSlotData:t=>{e(n=>({...n,slotData:t}))}})),He=cs((e,t)=>({emptySlotNodes:new Map,selectedNode:"",setEmptySlotNode:(n,r,o)=>{e(s=>{const i=new Map(s.emptySlotNodes),p=(Gv(new Date(`1970/01/01 ${o.endTime}`),new Date(2014,6,0,Number(o.startTime),0))+2)*4*7-1;i.size>p&&i.clear();const g=qn(r);return i.set(g,n),{...s,emptySlotNodes:i}})},setSelectedNode:n=>{const r=new Map(t().emptySlotNodes),o=t().selectedNode;e(s=>{if(o.length){const i=r.get(o);i&&i.closeEvent()}return{...s,selectedNode:n}})},resetSelectedNode:()=>e(n=>({...n,selectedNode:""})),resetNodes:()=>{e(n=>{const r=new Map(n.emptySlotNodes);return r.clear(),{...n,emptySlotNodes:r}})}})),hy={systemColor:"#059669",isTimeInfoVisible:!0},gy=e=>Kn(t=>({...hy,...e,updateSystemColor:n=>{t(r=>({...r,systemColor:n}))},changeTimeInfoVisibility:n=>{t(r=>({...r,isTimeInfoVisible:n}))}})),my=({children:e,...t})=>{const n=R.useRef(null);return n.current||(n.current=gy(t)),y.jsx(wf,{value:n.current,children:e})},Rf={month:new Date().getMonth(),fullYear:new Date().getFullYear(),monthMessage:""},vy=e=>Kn((t,n)=>({...e,...Rf,updateMonthMessage:r=>{t(o=>({...o,...r}))},updateHeaderDateLabel:r=>{n().updateMonthMessage({month:r.getMonth(),fullYear:r.getFullYear(),monthMessage:Vn[r.getMonth()]})}})),yy=({children:e,...t})=>{const n=R.useRef(null);return n.current||(n.current=vy(t)),y.jsx(xf,{value:n.current,children:e})},wy={users:[]},xy=e=>Kn(t=>({...wy,...e,updateUsers:n=>t(r=>({...r,users:n})),updateUsersDisabled:(n,r)=>t(o=>{const i=o.users.map(a=>a.id===n?{...a,status:r}:a);return{...o,users:i}})})),by=({children:e,ref:t,...n})=>{const r=R.useRef(null);r.current||(r.current=xy(n));const o=(s,i)=>{var a;(a=r.current)==null||a.getState().updateUsersDisabled(s,i)};return R.useImperativeHandle(t,()=>({updateDisabledUser:o})),y.jsx(Sf,{value:r.current,children:e})},ds=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Xn(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function Ia(e){return"nodeType"in e}function Le(e){var t,n;return e?Xn(e)?e:Ia(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function Na(e){const{Document:t}=Le(e);return e instanceof t}function qr(e){return Xn(e)?!1:e instanceof Le(e).HTMLElement}function Tf(e){return e instanceof Le(e).SVGElement}function Zn(e){return e?Xn(e)?e.document:Ia(e)?Na(e)?e:qr(e)||Tf(e)?e.ownerDocument:document:document:document}const At=ds?R.useLayoutEffect:R.useEffect;function fs(e){const t=R.useRef(e);return At(()=>{t.current=e}),R.useCallback(function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return t.current==null?void 0:t.current(...r)},[])}function Sy(){const e=R.useRef(null),t=R.useCallback((r,o)=>{e.current=setInterval(r,o)},[]),n=R.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,n]}function kr(e,t){t===void 0&&(t=[e]);const n=R.useRef(e);return At(()=>{n.current!==e&&(n.current=e)},t),n}function Xr(e,t){const n=R.useRef();return R.useMemo(()=>{const r=e(n.current);return n.current=r,r},[...t])}function Uo(e){const t=fs(e),n=R.useRef(null),r=R.useCallback(o=>{o!==n.current&&(t==null||t(o,n.current)),n.current=o},[]);return[n,r]}function Go(e){const t=R.useRef();return R.useEffect(()=>{t.current=e},[e]),t.current}let qs={};function ps(e,t){return R.useMemo(()=>{if(t)return t;const n=qs[e]==null?0:qs[e]+1;return qs[e]=n,e+"-"+n},[e,t])}function Df(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return r.reduce((s,i)=>{const a=Object.entries(i);for(const[l,c]of a){const u=s[l];u!=null&&(s[l]=u+e*c)}return s},{...t})}}const Ln=Df(1),Yo=Df(-1);function Cy(e){return"clientX"in e&&"clientY"in e}function ja(e){if(!e)return!1;const{KeyboardEvent:t}=Le(e.target);return t&&e instanceof t}function Ry(e){if(!e)return!1;const{TouchEvent:t}=Le(e.target);return t&&e instanceof t}function Ir(e){if(Ry(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return Cy(e)?{x:e.clientX,y:e.clientY}:null}const Nr=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:n}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:n}=e;return"scaleX("+t+") scaleY("+n+")"}},Transform:{toString(e){if(e)return[Nr.Translate.toString(e),Nr.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),vc="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function Ty(e){return e.matches(vc)?e:e.querySelector(vc)}const Dy={display:"none"};function My(e){let{id:t,value:n}=e;return R.createElement("div",{id:t,style:Dy},n)}function Ey(e){let{id:t,announcement:n,ariaLiveType:r="assertive"}=e;const o={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return R.createElement("div",{id:t,style:o,role:"status","aria-live":r,"aria-atomic":!0},n)}function Py(){const[e,t]=R.useState("");return{announce:R.useCallback(r=>{r!=null&&t(r)},[]),announcement:e}}const Mf=R.createContext(null);function Zr(e){const t=R.useContext(Mf);R.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function Ay(){const[e]=R.useState(()=>new Set),t=R.useCallback(r=>(e.add(r),()=>e.delete(r)),[e]);return[R.useCallback(r=>{let{type:o,event:s}=r;e.forEach(i=>{var a;return(a=i[o])==null?void 0:a.call(i,s)})},[e]),t]}const Oy={draggable:`
|
|
6
6
|
To pick up a draggable item, press the space bar.
|
|
7
7
|
While dragging, use the arrow keys to move the item.
|
|
8
8
|
Press space again to drop the item in its new position, or press escape to cancel.
|
|
9
|
-
`},Py={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was moved over droppable area "+n.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was dropped over droppable area "+n.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function Ey(e){let{announcements:t=Py,container:n,hiddenTextDescribedById:r,screenReaderInstructions:o=My}=e;const{announce:s,announcement:i}=Dy(),a=ds("DndLiveRegion"),[l,c]=T.useState(!1);if(T.useEffect(()=>{c(!0)},[]),Gr(T.useMemo(()=>({onDragStart(d){let{active:f}=d;s(t.onDragStart({active:f}))},onDragMove(d){let{active:f,over:h}=d;t.onDragMove&&s(t.onDragMove({active:f,over:h}))},onDragOver(d){let{active:f,over:h}=d;s(t.onDragOver({active:f,over:h}))},onDragEnd(d){let{active:f,over:h}=d;s(t.onDragEnd({active:f,over:h}))},onDragCancel(d){let{active:f,over:h}=d;s(t.onDragCancel({active:f,over:h}))}}),[s,t])),!l)return null;const u=T.createElement(T.Fragment,null,T.createElement(Cy,{id:r,value:o.draggable}),T.createElement(Ry,{id:a,announcement:i}));return n?Ct.createPortal(u,n):u}var De;(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})(De||(De={}));function Go(){}function mc(e,t){return T.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function Ay(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return T.useMemo(()=>[...t].filter(r=>r!=null),[...t])}const it=Object.freeze({x:0,y:0});function Oy(e,t){const n=Uo(e);if(!n)return"0 0";const r={x:(n.x-t.left)/t.width*100,y:(n.y-t.top)/t.height*100};return r.x+"% "+r.y+"%"}function _y(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function ky(e,t){if(!e||e.length===0)return null;const[n]=e;return n[t]}function Iy(e,t){const n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),o=Math.min(t.left+t.width,e.left+e.width),s=Math.min(t.top+t.height,e.top+e.height),i=o-r,a=s-n;if(r<o&&n<s){const l=t.width*t.height,c=e.width*e.height,u=i*a,d=u/(l+c-u);return Number(d.toFixed(4))}return 0}const Ny=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=[];for(const s of r){const{id:i}=s,a=n.get(i);if(a){const l=Iy(a,t);l>0&&o.push({id:i,data:{droppableContainer:s,value:l}})}}return o.sort(_y)};function jy(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function Df(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:it}function Fy(e){return function(n){for(var r=arguments.length,o=new Array(r>1?r-1:0),s=1;s<r;s++)o[s-1]=arguments[s];return o.reduce((i,a)=>({...i,top:i.top+e*a.y,bottom:i.bottom+e*a.y,left:i.left+e*a.x,right:i.right+e*a.x}),{...n})}}const Vy=Fy(1);function Tf(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function Ly(e,t,n){const r=Tf(t);if(!r)return e;const{scaleX:o,scaleY:s,x:i,y:a}=r,l=e.left-i-(1-o)*parseFloat(n),c=e.top-a-(1-s)*parseFloat(n.slice(n.indexOf(" ")+1)),u=o?e.width/o:e.width,d=s?e.height/s:e.height;return{width:u,height:d,top:c,right:l+u,bottom:c+d,left:l}}const $y={ignoreTransform:!1};function Kr(e,t){t===void 0&&(t=$y);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:c,transformOrigin:u}=Fe(e).getComputedStyle(e);c&&(n=Ly(n,c,u))}const{top:r,left:o,width:s,height:i,bottom:a,right:l}=n;return{top:r,left:o,width:s,height:i,bottom:a,right:l}}function vc(e){return Kr(e,{ignoreTransform:!0})}function By(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function zy(e,t){return t===void 0&&(t=Fe(e).getComputedStyle(e)),t.position==="fixed"}function Hy(e,t){t===void 0&&(t=Fe(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(o=>{const s=t[o];return typeof s=="string"?n.test(s):!1})}function _a(e,t){const n=[];function r(o){if(t!=null&&n.length>=t||!o)return n;if(Aa(o)&&o.scrollingElement!=null&&!n.includes(o.scrollingElement))return n.push(o.scrollingElement),n;if(!Wr(o)||Sf(o)||n.includes(o))return n;const s=Fe(e).getComputedStyle(o);return o!==e&&Hy(o,s)&&n.push(o),zy(o,s)?n:r(o.parentNode)}return e?r(e):n}function Mf(e){const[t]=_a(e,1);return t??null}function Us(e){return!cs||!e?null:Un(e)?e:Ea(e)?Aa(e)||e===Gn(e).scrollingElement?window:Wr(e)?e:null:null}function Pf(e){return Un(e)?e.scrollX:e.scrollLeft}function Ef(e){return Un(e)?e.scrollY:e.scrollTop}function ji(e){return{x:Pf(e),y:Ef(e)}}var Te;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(Te||(Te={}));function Af(e){return!cs||!e?!1:e===document.scrollingElement}function Of(e){const t={x:0,y:0},n=Af(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height},o=e.scrollTop<=t.y,s=e.scrollLeft<=t.x,i=e.scrollTop>=r.y,a=e.scrollLeft>=r.x;return{isTop:o,isLeft:s,isBottom:i,isRight:a,maxScroll:r,minScroll:t}}const Wy={x:.2,y:.2};function Uy(e,t,n,r,o){let{top:s,left:i,right:a,bottom:l}=n;r===void 0&&(r=10),o===void 0&&(o=Wy);const{isTop:c,isBottom:u,isLeft:d,isRight:f}=Of(e),h={x:0,y:0},m={x:0,y:0},p={height:t.height*o.y,width:t.width*o.x};return!c&&s<=t.top+p.height?(h.y=Te.Backward,m.y=r*Math.abs((t.top+p.height-s)/p.height)):!u&&l>=t.bottom-p.height&&(h.y=Te.Forward,m.y=r*Math.abs((t.bottom-p.height-l)/p.height)),!f&&a>=t.right-p.width?(h.x=Te.Forward,m.x=r*Math.abs((t.right-p.width-a)/p.width)):!d&&i<=t.left+p.width&&(h.x=Te.Backward,m.x=r*Math.abs((t.left+p.width-i)/p.width)),{direction:h,speed:m}}function Gy(e){if(e===document.scrollingElement){const{innerWidth:s,innerHeight:i}=window;return{top:0,left:0,right:s,bottom:i,width:s,height:i}}const{top:t,left:n,right:r,bottom:o}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:o,width:e.clientWidth,height:e.clientHeight}}function _f(e){return e.reduce((t,n)=>jn(t,ji(n)),it)}function Ky(e){return e.reduce((t,n)=>t+Pf(n),0)}function Yy(e){return e.reduce((t,n)=>t+Ef(n),0)}function kf(e,t){if(t===void 0&&(t=Kr),!e)return;const{top:n,left:r,bottom:o,right:s}=t(e);Mf(e)&&(o<=0||s<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const qy=[["x",["left","right"],Ky],["y",["top","bottom"],Yy]];class ka{constructor(t,n){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const r=_a(n),o=_f(r);this.rect={...t},this.width=t.width,this.height=t.height;for(const[s,i,a]of qy)for(const l of i)Object.defineProperty(this,l,{get:()=>{const c=a(r),u=o[s]-c;return this.rect[l]+u},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class xr{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(n=>{var r;return(r=this.target)==null?void 0:r.removeEventListener(...n)})},this.target=t}add(t,n,r){var o;(o=this.target)==null||o.addEventListener(t,n,r),this.listeners.push([t,n,r])}}function Xy(e){const{EventTarget:t}=Fe(e);return e instanceof t?e:Gn(e)}function Gs(e,t){const n=Math.abs(e.x),r=Math.abs(e.y);return typeof t=="number"?Math.sqrt(n**2+r**2)>t:"x"in t&&"y"in t?n>t.x&&r>t.y:"x"in t?n>t.x:"y"in t?r>t.y:!1}var Ze;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(Ze||(Ze={}));function yc(e){e.preventDefault()}function Zy(e){e.stopPropagation()}var ge;(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"})(ge||(ge={}));const If={start:[ge.Space,ge.Enter],cancel:[ge.Esc],end:[ge.Space,ge.Enter,ge.Tab]},Jy=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case ge.Right:return{...n,x:n.x+25};case ge.Left:return{...n,x:n.x-25};case ge.Down:return{...n,y:n.y+25};case ge.Up:return{...n,y:n.y-25}}};class Nf{constructor(t){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=t;const{event:{target:n}}=t;this.props=t,this.listeners=new xr(Gn(n)),this.windowListeners=new xr(Fe(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Ze.Resize,this.handleCancel),this.windowListeners.add(Ze.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Ze.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,r=t.node.current;r&&kf(r),n(it)}handleKeyDown(t){if(Oa(t)){const{active:n,context:r,options:o}=this.props,{keyboardCodes:s=If,coordinateGetter:i=Jy,scrollBehavior:a="smooth"}=o,{code:l}=t;if(s.end.includes(l)){this.handleEnd(t);return}if(s.cancel.includes(l)){this.handleCancel(t);return}const{collisionRect:c}=r.current,u=c?{x:c.left,y:c.top}:it;this.referenceCoordinates||(this.referenceCoordinates=u);const d=i(t,{active:n,context:r.current,currentCoordinates:u});if(d){const f=Wo(d,u),h={x:0,y:0},{scrollableAncestors:m}=r.current;for(const p of m){const b=t.code,{isTop:y,isRight:g,isLeft:w,isBottom:C,maxScroll:x,minScroll:M}=Of(p),S=Gy(p),D={x:Math.min(b===ge.Right?S.right-S.width/2:S.right,Math.max(b===ge.Right?S.left:S.left+S.width/2,d.x)),y:Math.min(b===ge.Down?S.bottom-S.height/2:S.bottom,Math.max(b===ge.Down?S.top:S.top+S.height/2,d.y))},P=b===ge.Right&&!g||b===ge.Left&&!w,E=b===ge.Down&&!C||b===ge.Up&&!y;if(P&&D.x!==d.x){const A=p.scrollLeft+f.x,F=b===ge.Right&&A<=x.x||b===ge.Left&&A>=M.x;if(F&&!f.y){p.scrollTo({left:A,behavior:a});return}F?h.x=p.scrollLeft-A:h.x=b===ge.Right?p.scrollLeft-x.x:p.scrollLeft-M.x,h.x&&p.scrollBy({left:-h.x,behavior:a});break}else if(E&&D.y!==d.y){const A=p.scrollTop+f.y,F=b===ge.Down&&A<=x.y||b===ge.Up&&A>=M.y;if(F&&!f.x){p.scrollTo({top:A,behavior:a});return}F?h.y=p.scrollTop-A:h.y=b===ge.Down?p.scrollTop-x.y:p.scrollTop-M.y,h.y&&p.scrollBy({top:-h.y,behavior:a});break}}this.handleMove(t,jn(Wo(d,this.referenceCoordinates),h))}}}handleMove(t,n){const{onMove:r}=this.props;t.preventDefault(),r(n)}handleEnd(t){const{onEnd:n}=this.props;t.preventDefault(),this.detach(),n()}handleCancel(t){const{onCancel:n}=this.props;t.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}Nf.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=If,onActivation:o}=t,{active:s}=n;const{code:i}=e.nativeEvent;if(r.start.includes(i)){const a=s.activatorNode.current;return a&&e.target!==a?!1:(e.preventDefault(),o==null||o({event:e.nativeEvent}),!0)}return!1}}];function wc(e){return!!(e&&"distance"in e)}function xc(e){return!!(e&&"delay"in e)}class Ia{constructor(t,n,r){var o;r===void 0&&(r=Xy(t.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=t,this.events=n;const{event:s}=t,{target:i}=s;this.props=t,this.events=n,this.document=Gn(i),this.documentListeners=new xr(this.document),this.listeners=new xr(r),this.windowListeners=new xr(Fe(i)),this.initialCoordinates=(o=Uo(s))!=null?o:it,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:t,props:{options:{activationConstraint:n,bypassActivationConstraint:r}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),t.cancel&&this.listeners.add(t.cancel.name,this.handleCancel),this.windowListeners.add(Ze.Resize,this.handleCancel),this.windowListeners.add(Ze.DragStart,yc),this.windowListeners.add(Ze.VisibilityChange,this.handleCancel),this.windowListeners.add(Ze.ContextMenu,yc),this.documentListeners.add(Ze.Keydown,this.handleKeydown),n){if(r!=null&&r({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(xc(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(wc(n)){this.handlePending(n);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(t,n){const{active:r,onPending:o}=this.props;o(r,t,this.initialCoordinates,n)}handleStart(){const{initialCoordinates:t}=this,{onStart:n}=this.props;t&&(this.activated=!0,this.documentListeners.add(Ze.Click,Zy,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Ze.SelectionChange,this.removeTextSelection),n(t))}handleMove(t){var n;const{activated:r,initialCoordinates:o,props:s}=this,{onMove:i,options:{activationConstraint:a}}=s;if(!o)return;const l=(n=Uo(t))!=null?n:it,c=Wo(o,l);if(!r&&a){if(wc(a)){if(a.tolerance!=null&&Gs(c,a.tolerance))return this.handleCancel();if(Gs(c,a.distance))return this.handleStart()}if(xc(a)&&Gs(c,a.tolerance))return this.handleCancel();this.handlePending(a,c);return}t.cancelable&&t.preventDefault(),i(l)}handleEnd(){const{onAbort:t,onEnd:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleCancel(){const{onAbort:t,onCancel:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleKeydown(t){t.code===ge.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const Qy={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class jf extends Ia{constructor(t){const{event:n}=t,r=Gn(n.target);super(t,Qy,r)}}jf.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!n.isPrimary||n.button!==0?!1:(r==null||r({event:n}),!0)}}];const ew={move:{name:"mousemove"},end:{name:"mouseup"}};var Fi;(function(e){e[e.RightClick=2]="RightClick"})(Fi||(Fi={}));class Ff extends Ia{constructor(t){super(t,ew,Gn(t.event.target))}}Ff.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button===Fi.RightClick?!1:(r==null||r({event:n}),!0)}}];const Ks={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class Vf extends Ia{constructor(t){super(t,Ks)}static setup(){return window.addEventListener(Ks.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(Ks.move.name,t)};function t(){}}}Vf.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;const{touches:o}=n;return o.length>1?!1:(r==null||r({event:n}),!0)}}];var br;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(br||(br={}));var Ko;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(Ko||(Ko={}));function tw(e){let{acceleration:t,activator:n=br.Pointer,canScroll:r,draggingRect:o,enabled:s,interval:i=5,order:a=Ko.TreeOrder,pointerCoordinates:l,scrollableAncestors:c,scrollableAncestorRects:u,delta:d,threshold:f}=e;const h=rw({delta:d,disabled:!s}),[m,p]=yy(),b=T.useRef({x:0,y:0}),y=T.useRef({x:0,y:0}),g=T.useMemo(()=>{switch(n){case br.Pointer:return l?{top:l.y,bottom:l.y,left:l.x,right:l.x}:null;case br.DraggableRect:return o}},[n,o,l]),w=T.useRef(null),C=T.useCallback(()=>{const M=w.current;if(!M)return;const S=b.current.x*y.current.x,D=b.current.y*y.current.y;M.scrollBy(S,D)},[]),x=T.useMemo(()=>a===Ko.TreeOrder?[...c].reverse():c,[a,c]);T.useEffect(()=>{if(!s||!c.length||!g){p();return}for(const M of x){if((r==null?void 0:r(M))===!1)continue;const S=c.indexOf(M),D=u[S];if(!D)continue;const{direction:P,speed:E}=Uy(M,D,g,t,f);for(const A of["x","y"])h[A][P[A]]||(E[A]=0,P[A]=0);if(E.x>0||E.y>0){p(),w.current=M,m(C,i),b.current=E,y.current=P;return}}b.current={x:0,y:0},y.current={x:0,y:0},p()},[t,C,r,p,s,i,JSON.stringify(g),JSON.stringify(h),m,c,x,u,JSON.stringify(f)])}const nw={x:{[Te.Backward]:!1,[Te.Forward]:!1},y:{[Te.Backward]:!1,[Te.Forward]:!1}};function rw(e){let{delta:t,disabled:n}=e;const r=Ho(t);return Ur(o=>{if(n||!r||!o)return nw;const s={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[Te.Backward]:o.x[Te.Backward]||s.x===-1,[Te.Forward]:o.x[Te.Forward]||s.x===1},y:{[Te.Backward]:o.y[Te.Backward]||s.y===-1,[Te.Forward]:o.y[Te.Forward]||s.y===1}}},[n,t,r])}function ow(e,t){const n=t!=null?e.get(t):void 0,r=n?n.node.current:null;return Ur(o=>{var s;return t==null?null:(s=r??o)!=null?s:null},[r,t])}function sw(e,t){return T.useMemo(()=>e.reduce((n,r)=>{const{sensor:o}=r,s=o.activators.map(i=>({eventName:i.eventName,handler:t(i.handler,r)}));return[...n,...s]},[]),[e,t])}var Ar;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(Ar||(Ar={}));var Vi;(function(e){e.Optimized="optimized"})(Vi||(Vi={}));const bc=new Map;function iw(e,t){let{dragging:n,dependencies:r,config:o}=t;const[s,i]=T.useState(null),{frequency:a,measure:l,strategy:c}=o,u=T.useRef(e),d=b(),f=Pr(d),h=T.useCallback(function(y){y===void 0&&(y=[]),!f.current&&i(g=>g===null?y:g.concat(y.filter(w=>!g.includes(w))))},[f]),m=T.useRef(null),p=Ur(y=>{if(d&&!n)return bc;if(!y||y===bc||u.current!==e||s!=null){const g=new Map;for(let w of e){if(!w)continue;if(s&&s.length>0&&!s.includes(w.id)&&w.rect.current){g.set(w.id,w.rect.current);continue}const C=w.node.current,x=C?new ka(l(C),C):null;w.rect.current=x,x&&g.set(w.id,x)}return g}return y},[e,s,n,d,l]);return T.useEffect(()=>{u.current=e},[e]),T.useEffect(()=>{d||h()},[n,d]),T.useEffect(()=>{s&&s.length>0&&i(null)},[JSON.stringify(s)]),T.useEffect(()=>{d||typeof a!="number"||m.current!==null||(m.current=setTimeout(()=>{h(),m.current=null},a))},[a,d,h,...r]),{droppableRects:p,measureDroppableContainers:h,measuringScheduled:s!=null};function b(){switch(c){case Ar.Always:return!1;case Ar.BeforeDragging:return n;default:return!n}}}function Na(e,t){return Ur(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function aw(e,t){return Na(e,t)}function lw(e){let{callback:t,disabled:n}=e;const r=us(t),o=T.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:s}=window;return new s(r)},[r,n]);return T.useEffect(()=>()=>o==null?void 0:o.disconnect(),[o]),o}function fs(e){let{callback:t,disabled:n}=e;const r=us(t),o=T.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:s}=window;return new s(r)},[n]);return T.useEffect(()=>()=>o==null?void 0:o.disconnect(),[o]),o}function cw(e){return new ka(Kr(e),e)}function Sc(e,t,n){t===void 0&&(t=cw);const[r,o]=T.useState(null);function s(){o(l=>{if(!e)return null;if(e.isConnected===!1){var c;return(c=l??n)!=null?c:null}const u=t(e);return JSON.stringify(l)===JSON.stringify(u)?l:u})}const i=lw({callback(l){if(e)for(const c of l){const{type:u,target:d}=c;if(u==="childList"&&d instanceof HTMLElement&&d.contains(e)){s();break}}}}),a=fs({callback:s});return Dt(()=>{s(),e?(a==null||a.observe(e),i==null||i.observe(document.body,{childList:!0,subtree:!0})):(a==null||a.disconnect(),i==null||i.disconnect())},[e]),r}function uw(e){const t=Na(e);return Df(e,t)}const Cc=[];function dw(e){const t=T.useRef(e),n=Ur(r=>e?r&&r!==Cc&&e&&t.current&&e.parentNode===t.current.parentNode?r:_a(e):Cc,[e]);return T.useEffect(()=>{t.current=e},[e]),n}function fw(e){const[t,n]=T.useState(null),r=T.useRef(e),o=T.useCallback(s=>{const i=Us(s.target);i&&n(a=>a?(a.set(i,ji(i)),new Map(a)):null)},[]);return T.useEffect(()=>{const s=r.current;if(e!==s){i(s);const a=e.map(l=>{const c=Us(l);return c?(c.addEventListener("scroll",o,{passive:!0}),[c,ji(c)]):null}).filter(l=>l!=null);n(a.length?new Map(a):null),r.current=e}return()=>{i(e),i(s)};function i(a){a.forEach(l=>{const c=Us(l);c==null||c.removeEventListener("scroll",o)})}},[o,e]),T.useMemo(()=>e.length?t?Array.from(t.values()).reduce((s,i)=>jn(s,i),it):_f(e):it,[e,t])}function Rc(e,t){t===void 0&&(t=[]);const n=T.useRef(null);return T.useEffect(()=>{n.current=null},t),T.useEffect(()=>{const r=e!==it;r&&!n.current&&(n.current=e),!r&&n.current&&(n.current=null)},[e]),n.current?Wo(e,n.current):it}function hw(e){T.useEffect(()=>{if(!cs)return;const t=e.map(n=>{let{sensor:r}=n;return r.setup==null?void 0:r.setup()});return()=>{for(const n of t)n==null||n()}},e.map(t=>{let{sensor:n}=t;return n}))}function pw(e,t){return T.useMemo(()=>e.reduce((n,r)=>{let{eventName:o,handler:s}=r;return n[o]=i=>{s(i,t)},n},{}),[e,t])}function Lf(e){return T.useMemo(()=>e?By(e):null,[e])}const Dc=[];function gw(e,t){t===void 0&&(t=Kr);const[n]=e,r=Lf(n?Fe(n):null),[o,s]=T.useState(Dc);function i(){s(()=>e.length?e.map(l=>Af(l)?r:new ka(t(l),l)):Dc)}const a=fs({callback:i});return Dt(()=>{a==null||a.disconnect(),i(),e.forEach(l=>a==null?void 0:a.observe(l))},[e]),o}function $f(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return Wr(t)?t:e}function mw(e){let{measure:t}=e;const[n,r]=T.useState(null),o=T.useCallback(c=>{for(const{target:u}of c)if(Wr(u)){r(d=>{const f=t(u);return d?{...d,width:f.width,height:f.height}:f});break}},[t]),s=fs({callback:o}),i=T.useCallback(c=>{const u=$f(c);s==null||s.disconnect(),u&&(s==null||s.observe(u)),r(u?t(u):null)},[t,s]),[a,l]=zo(i);return T.useMemo(()=>({nodeRef:a,rect:n,setRef:l}),[n,a,l])}const vw=[{sensor:jf,options:{}},{sensor:Nf,options:{}}],yw={current:{}},_o={draggable:{measure:vc},droppable:{measure:vc,strategy:Ar.WhileDragging,frequency:Vi.Optimized},dragOverlay:{measure:Kr}};class Sr extends Map{get(t){var n;return t!=null&&(n=super.get(t))!=null?n:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:n}=t;return!n})}getNodeFor(t){var n,r;return(n=(r=this.get(t))==null?void 0:r.node.current)!=null?n:void 0}}const ww={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Sr,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Go},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:_o,measureDroppableContainers:Go,windowRect:null,measuringScheduled:!1},Bf={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Go,draggableNodes:new Map,over:null,measureDroppableContainers:Go},Yr=T.createContext(Bf),zf=T.createContext(ww);function xw(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Sr}}}function bw(e,t){switch(t.type){case De.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case De.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case De.DragEnd:case De.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case De.RegisterDroppable:{const{element:n}=t,{id:r}=n,o=new Sr(e.droppable.containers);return o.set(r,n),{...e,droppable:{...e.droppable,containers:o}}}case De.SetDroppableDisabled:{const{id:n,key:r,disabled:o}=t,s=e.droppable.containers.get(n);if(!s||r!==s.key)return e;const i=new Sr(e.droppable.containers);return i.set(n,{...s,disabled:o}),{...e,droppable:{...e.droppable,containers:i}}}case De.UnregisterDroppable:{const{id:n,key:r}=t,o=e.droppable.containers.get(n);if(!o||r!==o.key)return e;const s=new Sr(e.droppable.containers);return s.delete(n),{...e,droppable:{...e.droppable,containers:s}}}default:return e}}function Sw(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:o}=T.useContext(Yr),s=Ho(r),i=Ho(n==null?void 0:n.id);return T.useEffect(()=>{if(!t&&!r&&s&&i!=null){if(!Oa(s)||document.activeElement===s.target)return;const a=o.get(i);if(!a)return;const{activatorNode:l,node:c}=a;if(!l.current&&!c.current)return;requestAnimationFrame(()=>{for(const u of[l.current,c.current]){if(!u)continue;const d=by(u);if(d){d.focus();break}}})}},[r,t,o,i,s]),null}function Hf(e,t){let{transform:n,...r}=t;return e!=null&&e.length?e.reduce((o,s)=>s({transform:o,...r}),n):n}function Cw(e){return T.useMemo(()=>({draggable:{..._o.draggable,...e==null?void 0:e.draggable},droppable:{..._o.droppable,...e==null?void 0:e.droppable},dragOverlay:{..._o.dragOverlay,...e==null?void 0:e.dragOverlay}}),[e==null?void 0:e.draggable,e==null?void 0:e.droppable,e==null?void 0:e.dragOverlay])}function Rw(e){let{activeNode:t,measure:n,initialRect:r,config:o=!0}=e;const s=T.useRef(!1),{x:i,y:a}=typeof o=="boolean"?{x:o,y:o}:o;Dt(()=>{if(!i&&!a||!t){s.current=!1;return}if(s.current||!r)return;const c=t==null?void 0:t.node.current;if(!c||c.isConnected===!1)return;const u=n(c),d=Df(u,r);if(i||(d.x=0),a||(d.y=0),s.current=!0,Math.abs(d.x)>0||Math.abs(d.y)>0){const f=Mf(c);f&&f.scrollBy({top:d.y,left:d.x})}},[t,i,a,r,n])}const hs=T.createContext({...it,scaleX:1,scaleY:1});var zt;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(zt||(zt={}));const ja=T.memo(function(t){var n,r,o,s;let{id:i,accessibility:a,autoScroll:l=!0,children:c,sensors:u=vw,collisionDetection:d=Ny,measuring:f,modifiers:h,...m}=t;const p=T.useReducer(bw,void 0,xw),[b,y]=p,[g,w]=Ty(),[C,x]=T.useState(zt.Uninitialized),M=C===zt.Initialized,{draggable:{active:S,nodes:D,translate:P},droppable:{containers:E}}=b,A=S!=null?D.get(S):null,F=T.useRef({initial:null,translated:null}),W=T.useMemo(()=>{var Ae;return S!=null?{id:S,data:(Ae=A==null?void 0:A.data)!=null?Ae:yw,rect:F}:null},[S,A]),L=T.useRef(null),[j,_]=T.useState(null),[N,O]=T.useState(null),V=Pr(m,Object.values(m)),k=ds("DndDescribedBy",i),I=T.useMemo(()=>E.getEnabled(),[E]),$=Cw(f),{droppableRects:H,measureDroppableContainers:U,measuringScheduled:Z}=iw(I,{dragging:M,dependencies:[P.x,P.y],config:$.droppable}),q=ow(D,S),B=T.useMemo(()=>N?Uo(N):null,[N]),K=Pv(),X=aw(q,$.draggable.measure);Rw({activeNode:S!=null?D.get(S):null,config:K.layoutShiftCompensation,initialRect:X,measure:$.draggable.measure});const G=Sc(q,$.draggable.measure,X),ne=Sc(q?q.parentElement:null),z=T.useRef({activatorEvent:null,active:null,activeNode:q,collisionRect:null,collisions:null,droppableRects:H,draggableNodes:D,draggingNode:null,draggingNodeRect:null,droppableContainers:E,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),le=E.getNodeFor((n=z.current.over)==null?void 0:n.id),me=mw({measure:$.dragOverlay.measure}),Ie=(r=me.nodeRef.current)!=null?r:q,Ee=M?(o=me.rect)!=null?o:G:null,ct=!!(me.nodeRef.current&&me.rect),J=uw(ct?null:G),ue=Lf(Ie?Fe(Ie):null),xe=dw(M?le??q:null),Be=gw(xe),tt=Hf(h,{transform:{x:P.x-J.x,y:P.y-J.y,scaleX:1,scaleY:1},activatorEvent:N,active:W,activeNodeRect:G,containerNodeRect:ne,draggingNodeRect:Ee,over:z.current.over,overlayNodeRect:me.rect,scrollableAncestors:xe,scrollableAncestorRects:Be,windowRect:ue}),nr=B?jn(B,P):null,rr=fw(xe),rc=Rc(rr),oc=Rc(rr,[G]),_t=jn(tt,rc),Cn=Ee?Vy(Ee,tt):null,or=W&&Cn?d({active:W,collisionRect:Cn,droppableRects:H,droppableContainers:I,pointerCoordinates:nr}):null,sc=ky(or,"id"),[kt,ic]=T.useState(null),Cv=ct?tt:jn(tt,oc),Rv=jy(Cv,(s=kt==null?void 0:kt.rect)!=null?s:null,G),Ls=T.useRef(null),ac=T.useCallback((Ae,ze)=>{let{sensor:He,options:It}=ze;if(L.current==null)return;const Ye=D.get(L.current);if(!Ye)return;const We=Ae.nativeEvent,ut=new He({active:L.current,activeNode:Ye,event:We,options:It,context:z,onAbort(Me){if(!D.get(Me))return;const{onDragAbort:dt}=V.current,wt={id:Me};dt==null||dt(wt),g({type:"onDragAbort",event:wt})},onPending(Me,Nt,dt,wt){if(!D.get(Me))return;const{onDragPending:ir}=V.current,jt={id:Me,constraint:Nt,initialCoordinates:dt,offset:wt};ir==null||ir(jt),g({type:"onDragPending",event:jt})},onStart(Me){const Nt=L.current;if(Nt==null)return;const dt=D.get(Nt);if(!dt)return;const{onDragStart:wt}=V.current,sr={activatorEvent:We,active:{id:Nt,data:dt.data,rect:F}};Ct.unstable_batchedUpdates(()=>{wt==null||wt(sr),x(zt.Initializing),y({type:De.DragStart,initialCoordinates:Me,active:Nt}),g({type:"onDragStart",event:sr}),_(Ls.current),O(We)})},onMove(Me){y({type:De.DragMove,coordinates:Me})},onEnd:Rn(De.DragEnd),onCancel:Rn(De.DragCancel)});Ls.current=ut;function Rn(Me){return async function(){const{active:dt,collisions:wt,over:sr,scrollAdjustedTranslate:ir}=z.current;let jt=null;if(dt&&ir){const{cancelDrop:ar}=V.current;jt={activatorEvent:We,active:dt,collisions:wt,delta:ir,over:sr},Me===De.DragEnd&&typeof ar=="function"&&await Promise.resolve(ar(jt))&&(Me=De.DragCancel)}L.current=null,Ct.unstable_batchedUpdates(()=>{y({type:Me}),x(zt.Uninitialized),ic(null),_(null),O(null),Ls.current=null;const ar=Me===De.DragEnd?"onDragEnd":"onDragCancel";if(jt){const $s=V.current[ar];$s==null||$s(jt),g({type:ar,event:jt})}})}}},[D]),Dv=T.useCallback((Ae,ze)=>(He,It)=>{const Ye=He.nativeEvent,We=D.get(It);if(L.current!==null||!We||Ye.dndKit||Ye.defaultPrevented)return;const ut={active:We};Ae(He,ze.options,ut)===!0&&(Ye.dndKit={capturedBy:ze.sensor},L.current=It,ac(He,ze))},[D,ac]),lc=sw(u,Dv);hw(u),Dt(()=>{G&&C===zt.Initializing&&x(zt.Initialized)},[G,C]),T.useEffect(()=>{const{onDragMove:Ae}=V.current,{active:ze,activatorEvent:He,collisions:It,over:Ye}=z.current;if(!ze||!He)return;const We={active:ze,activatorEvent:He,collisions:It,delta:{x:_t.x,y:_t.y},over:Ye};Ct.unstable_batchedUpdates(()=>{Ae==null||Ae(We),g({type:"onDragMove",event:We})})},[_t.x,_t.y]),T.useEffect(()=>{const{active:Ae,activatorEvent:ze,collisions:He,droppableContainers:It,scrollAdjustedTranslate:Ye}=z.current;if(!Ae||L.current==null||!ze||!Ye)return;const{onDragOver:We}=V.current,ut=It.get(sc),Rn=ut&&ut.rect.current?{id:ut.id,rect:ut.rect.current,data:ut.data,disabled:ut.disabled}:null,Me={active:Ae,activatorEvent:ze,collisions:He,delta:{x:Ye.x,y:Ye.y},over:Rn};Ct.unstable_batchedUpdates(()=>{ic(Rn),We==null||We(Me),g({type:"onDragOver",event:Me})})},[sc]),Dt(()=>{z.current={activatorEvent:N,active:W,activeNode:q,collisionRect:Cn,collisions:or,droppableRects:H,draggableNodes:D,draggingNode:Ie,draggingNodeRect:Ee,droppableContainers:E,over:kt,scrollableAncestors:xe,scrollAdjustedTranslate:_t},F.current={initial:Ee,translated:Cn}},[W,q,or,Cn,D,Ie,Ee,H,E,kt,xe,_t]),tw({...K,delta:P,draggingRect:Cn,pointerCoordinates:nr,scrollableAncestors:xe,scrollableAncestorRects:Be});const Tv=T.useMemo(()=>({active:W,activeNode:q,activeNodeRect:G,activatorEvent:N,collisions:or,containerNodeRect:ne,dragOverlay:me,draggableNodes:D,droppableContainers:E,droppableRects:H,over:kt,measureDroppableContainers:U,scrollableAncestors:xe,scrollableAncestorRects:Be,measuringConfiguration:$,measuringScheduled:Z,windowRect:ue}),[W,q,G,N,or,ne,me,D,E,H,kt,U,xe,Be,$,Z,ue]),Mv=T.useMemo(()=>({activatorEvent:N,activators:lc,active:W,activeNodeRect:G,ariaDescribedById:{draggable:k},dispatch:y,draggableNodes:D,over:kt,measureDroppableContainers:U}),[N,lc,W,G,y,k,D,kt,U]);return T.createElement(Rf.Provider,{value:w},T.createElement(Yr.Provider,{value:Mv},T.createElement(zf.Provider,{value:Tv},T.createElement(hs.Provider,{value:Rv},c)),T.createElement(Sw,{disabled:(a==null?void 0:a.restoreFocus)===!1})),T.createElement(Ey,{...a,hiddenTextDescribedById:k}));function Pv(){const Ae=(j==null?void 0:j.autoScrollEnabled)===!1,ze=typeof l=="object"?l.enabled===!1:l===!1,He=M&&!Ae&&!ze;return typeof l=="object"?{...l,enabled:He}:{enabled:He}}}),Dw=T.createContext(null),Tc="button",Tw="Draggable";function Fa(e){let{id:t,data:n,disabled:r=!1,attributes:o}=e;const s=ds(Tw),{activators:i,activatorEvent:a,active:l,activeNodeRect:c,ariaDescribedById:u,draggableNodes:d,over:f}=T.useContext(Yr),{role:h=Tc,roleDescription:m="draggable",tabIndex:p=0}=o??{},b=(l==null?void 0:l.id)===t,y=T.useContext(b?hs:Dw),[g,w]=zo(),[C,x]=zo(),M=pw(i,t),S=Pr(n);Dt(()=>(d.set(t,{id:t,key:s,node:g,activatorNode:C,data:S}),()=>{const P=d.get(t);P&&P.key===s&&d.delete(t)}),[d,t]);const D=T.useMemo(()=>({role:h,tabIndex:p,"aria-disabled":r,"aria-pressed":b&&h===Tc?!0:void 0,"aria-roledescription":m,"aria-describedby":u.draggable}),[r,h,p,b,m,u.draggable]);return{active:l,activatorEvent:a,activeNodeRect:c,attributes:D,isDragging:b,listeners:r?void 0:M,node:g,over:f,setNodeRef:w,setActivatorNodeRef:x,transform:y}}function Mw(){return T.useContext(zf)}const Pw="Droppable",Ew={timeout:25};function lo(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:o}=e;const s=ds(Pw),{active:i,dispatch:a,over:l,measureDroppableContainers:c}=T.useContext(Yr),u=T.useRef({disabled:n}),d=T.useRef(!1),f=T.useRef(null),h=T.useRef(null),{disabled:m,updateMeasurementsFor:p,timeout:b}={...Ew,...o},y=Pr(p??r),g=T.useCallback(()=>{if(!d.current){d.current=!0;return}h.current!=null&&clearTimeout(h.current),h.current=setTimeout(()=>{c(Array.isArray(y.current)?y.current:[y.current]),h.current=null},b)},[b]),w=fs({callback:g,disabled:m||!i}),C=T.useCallback((D,P)=>{w&&(P&&(w.unobserve(P),d.current=!1),D&&w.observe(D))},[w]),[x,M]=zo(C),S=Pr(t);return T.useEffect(()=>{!w||!x.current||(w.disconnect(),d.current=!1,w.observe(x.current))},[x,w]),T.useEffect(()=>(a({type:De.RegisterDroppable,element:{id:r,key:s,disabled:n,node:x,rect:f,data:S}}),()=>a({type:De.UnregisterDroppable,key:s,id:r})),[r]),T.useEffect(()=>{n!==u.current.disabled&&(a({type:De.SetDroppableDisabled,id:r,key:s,disabled:n}),u.current.disabled=n)},[r,s,n,a]),{active:i,rect:f,isOver:(l==null?void 0:l.id)===r,node:x,over:l,setNodeRef:M}}function Aw(e){let{animation:t,children:n}=e;const[r,o]=T.useState(null),[s,i]=T.useState(null),a=Ho(n);return!n&&!r&&a&&o(a),Dt(()=>{if(!s)return;const l=r==null?void 0:r.key,c=r==null?void 0:r.props.id;if(l==null||c==null){o(null);return}Promise.resolve(t(c,s)).then(()=>{o(null)})},[t,r,s]),T.createElement(T.Fragment,null,n,r?T.cloneElement(r,{ref:i}):null)}const Ow={x:0,y:0,scaleX:1,scaleY:1};function _w(e){let{children:t}=e;return T.createElement(Yr.Provider,{value:Bf},T.createElement(hs.Provider,{value:Ow},t))}const kw={position:"fixed",touchAction:"none"},Iw=e=>Oa(e)?"transform 250ms ease":void 0,Nw=T.forwardRef((e,t)=>{let{as:n,activatorEvent:r,adjustScale:o,children:s,className:i,rect:a,style:l,transform:c,transition:u=Iw}=e;if(!a)return null;const d=o?c:{...c,scaleX:1,scaleY:1},f={...kw,width:a.width,height:a.height,top:a.top,left:a.left,transform:Er.Transform.toString(d),transformOrigin:o&&r?Oy(r,a):void 0,transition:typeof u=="function"?u(r):u,...l};return T.createElement(n,{className:i,style:f,ref:t},s)}),jw=e=>t=>{let{active:n,dragOverlay:r}=t;const o={},{styles:s,className:i}=e;if(s!=null&&s.active)for(const[a,l]of Object.entries(s.active))l!==void 0&&(o[a]=n.node.style.getPropertyValue(a),n.node.style.setProperty(a,l));if(s!=null&&s.dragOverlay)for(const[a,l]of Object.entries(s.dragOverlay))l!==void 0&&r.node.style.setProperty(a,l);return i!=null&&i.active&&n.node.classList.add(i.active),i!=null&&i.dragOverlay&&r.node.classList.add(i.dragOverlay),function(){for(const[l,c]of Object.entries(o))n.node.style.setProperty(l,c);i!=null&&i.active&&n.node.classList.remove(i.active)}},Fw=e=>{let{transform:{initial:t,final:n}}=e;return[{transform:Er.Transform.toString(t)},{transform:Er.Transform.toString(n)}]},Vw={duration:250,easing:"ease",keyframes:Fw,sideEffects:jw({styles:{active:{opacity:"0"}}})};function Lw(e){let{config:t,draggableNodes:n,droppableContainers:r,measuringConfiguration:o}=e;return us((s,i)=>{if(t===null)return;const a=n.get(s);if(!a)return;const l=a.node.current;if(!l)return;const c=$f(i);if(!c)return;const{transform:u}=Fe(i).getComputedStyle(i),d=Tf(u);if(!d)return;const f=typeof t=="function"?t:$w(t);return kf(l,o.draggable.measure),f({active:{id:s,data:a.data,node:l,rect:o.draggable.measure(l)},draggableNodes:n,dragOverlay:{node:i,rect:o.dragOverlay.measure(c)},droppableContainers:r,measuringConfiguration:o,transform:d})})}function $w(e){const{duration:t,easing:n,sideEffects:r,keyframes:o}={...Vw,...e};return s=>{let{active:i,dragOverlay:a,transform:l,...c}=s;if(!t)return;const u={x:a.rect.left-i.rect.left,y:a.rect.top-i.rect.top},d={scaleX:l.scaleX!==1?i.rect.width*l.scaleX/a.rect.width:1,scaleY:l.scaleY!==1?i.rect.height*l.scaleY/a.rect.height:1},f={x:l.x-u.x,y:l.y-u.y,...d},h=o({...c,active:i,dragOverlay:a,transform:{initial:l,final:f}}),[m]=h,p=h[h.length-1];if(JSON.stringify(m)===JSON.stringify(p))return;const b=r==null?void 0:r({active:i,dragOverlay:a,...c}),y=a.node.animate(h,{duration:t,easing:n,fill:"forwards"});return new Promise(g=>{y.onfinish=()=>{b==null||b(),g()}})}}let Mc=0;function Bw(e){return T.useMemo(()=>{if(e!=null)return Mc++,Mc},[e])}const zw=T.memo(e=>{let{adjustScale:t=!1,children:n,dropAnimation:r,style:o,transition:s,modifiers:i,wrapperElement:a="div",className:l,zIndex:c=999}=e;const{activatorEvent:u,active:d,activeNodeRect:f,containerNodeRect:h,draggableNodes:m,droppableContainers:p,dragOverlay:b,over:y,measuringConfiguration:g,scrollableAncestors:w,scrollableAncestorRects:C,windowRect:x}=Mw(),M=T.useContext(hs),S=Bw(d==null?void 0:d.id),D=Hf(i,{activatorEvent:u,active:d,activeNodeRect:f,containerNodeRect:h,draggingNodeRect:b.rect,over:y,overlayNodeRect:b.rect,scrollableAncestors:w,scrollableAncestorRects:C,transform:M,windowRect:x}),P=Na(f),E=Lw({config:r,draggableNodes:m,droppableContainers:p,measuringConfiguration:g}),A=P?b.setRef:void 0;return T.createElement(_w,null,T.createElement(Aw,{animation:E},d&&S?T.createElement(Nw,{key:S,id:d.id,ref:A,as:a,activatorEvent:u,adjustScale:t,className:l,transition:s,rect:P,style:{zIndex:c,...o},transform:D},n):null))});/**
|
|
9
|
+
`},_y={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was moved over droppable area "+n.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was dropped over droppable area "+n.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function ky(e){let{announcements:t=_y,container:n,hiddenTextDescribedById:r,screenReaderInstructions:o=Oy}=e;const{announce:s,announcement:i}=Py(),a=ps("DndLiveRegion"),[l,c]=R.useState(!1);if(R.useEffect(()=>{c(!0)},[]),Zr(R.useMemo(()=>({onDragStart(d){let{active:p}=d;s(t.onDragStart({active:p}))},onDragMove(d){let{active:p,over:f}=d;t.onDragMove&&s(t.onDragMove({active:p,over:f}))},onDragOver(d){let{active:p,over:f}=d;s(t.onDragOver({active:p,over:f}))},onDragEnd(d){let{active:p,over:f}=d;s(t.onDragEnd({active:p,over:f}))},onDragCancel(d){let{active:p,over:f}=d;s(t.onDragCancel({active:p,over:f}))}}),[s,t])),!l)return null;const u=R.createElement(R.Fragment,null,R.createElement(My,{id:r,value:o.draggable}),R.createElement(Ey,{id:a,announcement:i}));return n?Pt.createPortal(u,n):u}var Te;(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})(Te||(Te={}));function Ko(){}function yc(e,t){return R.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function Iy(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return R.useMemo(()=>[...t].filter(r=>r!=null),[...t])}const ct=Object.freeze({x:0,y:0});function Ny(e,t){const n=Ir(e);if(!n)return"0 0";const r={x:(n.x-t.left)/t.width*100,y:(n.y-t.top)/t.height*100};return r.x+"% "+r.y+"%"}function jy(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function Fy(e,t){if(!e||e.length===0)return null;const[n]=e;return n[t]}function Vy(e,t){const n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),o=Math.min(t.left+t.width,e.left+e.width),s=Math.min(t.top+t.height,e.top+e.height),i=o-r,a=s-n;if(r<o&&n<s){const l=t.width*t.height,c=e.width*e.height,u=i*a,d=u/(l+c-u);return Number(d.toFixed(4))}return 0}const Ly=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=[];for(const s of r){const{id:i}=s,a=n.get(i);if(a){const l=Vy(a,t);l>0&&o.push({id:i,data:{droppableContainer:s,value:l}})}}return o.sort(jy)};function $y(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function Ef(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:ct}function By(e){return function(n){for(var r=arguments.length,o=new Array(r>1?r-1:0),s=1;s<r;s++)o[s-1]=arguments[s];return o.reduce((i,a)=>({...i,top:i.top+e*a.y,bottom:i.bottom+e*a.y,left:i.left+e*a.x,right:i.right+e*a.x}),{...n})}}const zy=By(1);function Pf(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function Hy(e,t,n){const r=Pf(t);if(!r)return e;const{scaleX:o,scaleY:s,x:i,y:a}=r,l=e.left-i-(1-o)*parseFloat(n),c=e.top-a-(1-s)*parseFloat(n.slice(n.indexOf(" ")+1)),u=o?e.width/o:e.width,d=s?e.height/s:e.height;return{width:u,height:d,top:c,right:l+u,bottom:c+d,left:l}}const Wy={ignoreTransform:!1};function Jr(e,t){t===void 0&&(t=Wy);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:c,transformOrigin:u}=Le(e).getComputedStyle(e);c&&(n=Hy(n,c,u))}const{top:r,left:o,width:s,height:i,bottom:a,right:l}=n;return{top:r,left:o,width:s,height:i,bottom:a,right:l}}function wc(e){return Jr(e,{ignoreTransform:!0})}function Uy(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function Gy(e,t){return t===void 0&&(t=Le(e).getComputedStyle(e)),t.position==="fixed"}function Yy(e,t){t===void 0&&(t=Le(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(o=>{const s=t[o];return typeof s=="string"?n.test(s):!1})}function Fa(e,t){const n=[];function r(o){if(t!=null&&n.length>=t||!o)return n;if(Na(o)&&o.scrollingElement!=null&&!n.includes(o.scrollingElement))return n.push(o.scrollingElement),n;if(!qr(o)||Tf(o)||n.includes(o))return n;const s=Le(e).getComputedStyle(o);return o!==e&&Yy(o,s)&&n.push(o),Gy(o,s)?n:r(o.parentNode)}return e?r(e):n}function Af(e){const[t]=Fa(e,1);return t??null}function Xs(e){return!ds||!e?null:Xn(e)?e:Ia(e)?Na(e)||e===Zn(e).scrollingElement?window:qr(e)?e:null:null}function Of(e){return Xn(e)?e.scrollX:e.scrollLeft}function _f(e){return Xn(e)?e.scrollY:e.scrollTop}function Bi(e){return{x:Of(e),y:_f(e)}}var Me;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(Me||(Me={}));function kf(e){return!ds||!e?!1:e===document.scrollingElement}function If(e){const t={x:0,y:0},n=kf(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height},o=e.scrollTop<=t.y,s=e.scrollLeft<=t.x,i=e.scrollTop>=r.y,a=e.scrollLeft>=r.x;return{isTop:o,isLeft:s,isBottom:i,isRight:a,maxScroll:r,minScroll:t}}const Ky={x:.2,y:.2};function qy(e,t,n,r,o){let{top:s,left:i,right:a,bottom:l}=n;r===void 0&&(r=10),o===void 0&&(o=Ky);const{isTop:c,isBottom:u,isLeft:d,isRight:p}=If(e),f={x:0,y:0},g={x:0,y:0},h={height:t.height*o.y,width:t.width*o.x};return!c&&s<=t.top+h.height?(f.y=Me.Backward,g.y=r*Math.abs((t.top+h.height-s)/h.height)):!u&&l>=t.bottom-h.height&&(f.y=Me.Forward,g.y=r*Math.abs((t.bottom-h.height-l)/h.height)),!p&&a>=t.right-h.width?(f.x=Me.Forward,g.x=r*Math.abs((t.right-h.width-a)/h.width)):!d&&i<=t.left+h.width&&(f.x=Me.Backward,g.x=r*Math.abs((t.left+h.width-i)/h.width)),{direction:f,speed:g}}function Xy(e){if(e===document.scrollingElement){const{innerWidth:s,innerHeight:i}=window;return{top:0,left:0,right:s,bottom:i,width:s,height:i}}const{top:t,left:n,right:r,bottom:o}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:o,width:e.clientWidth,height:e.clientHeight}}function Nf(e){return e.reduce((t,n)=>Ln(t,Bi(n)),ct)}function Zy(e){return e.reduce((t,n)=>t+Of(n),0)}function Jy(e){return e.reduce((t,n)=>t+_f(n),0)}function jf(e,t){if(t===void 0&&(t=Jr),!e)return;const{top:n,left:r,bottom:o,right:s}=t(e);Af(e)&&(o<=0||s<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const Qy=[["x",["left","right"],Zy],["y",["top","bottom"],Jy]];class Va{constructor(t,n){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const r=Fa(n),o=Nf(r);this.rect={...t},this.width=t.width,this.height=t.height;for(const[s,i,a]of Qy)for(const l of i)Object.defineProperty(this,l,{get:()=>{const c=a(r),u=o[s]-c;return this.rect[l]+u},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class Rr{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(n=>{var r;return(r=this.target)==null?void 0:r.removeEventListener(...n)})},this.target=t}add(t,n,r){var o;(o=this.target)==null||o.addEventListener(t,n,r),this.listeners.push([t,n,r])}}function ew(e){const{EventTarget:t}=Le(e);return e instanceof t?e:Zn(e)}function Zs(e,t){const n=Math.abs(e.x),r=Math.abs(e.y);return typeof t=="number"?Math.sqrt(n**2+r**2)>t:"x"in t&&"y"in t?n>t.x&&r>t.y:"x"in t?n>t.x:"y"in t?r>t.y:!1}var et;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(et||(et={}));function xc(e){e.preventDefault()}function tw(e){e.stopPropagation()}var me;(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"})(me||(me={}));const Ff={start:[me.Space,me.Enter],cancel:[me.Esc],end:[me.Space,me.Enter,me.Tab]},nw=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case me.Right:return{...n,x:n.x+25};case me.Left:return{...n,x:n.x-25};case me.Down:return{...n,y:n.y+25};case me.Up:return{...n,y:n.y-25}}};class Vf{constructor(t){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=t;const{event:{target:n}}=t;this.props=t,this.listeners=new Rr(Zn(n)),this.windowListeners=new Rr(Le(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(et.Resize,this.handleCancel),this.windowListeners.add(et.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(et.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,r=t.node.current;r&&jf(r),n(ct)}handleKeyDown(t){if(ja(t)){const{active:n,context:r,options:o}=this.props,{keyboardCodes:s=Ff,coordinateGetter:i=nw,scrollBehavior:a="smooth"}=o,{code:l}=t;if(s.end.includes(l)){this.handleEnd(t);return}if(s.cancel.includes(l)){this.handleCancel(t);return}const{collisionRect:c}=r.current,u=c?{x:c.left,y:c.top}:ct;this.referenceCoordinates||(this.referenceCoordinates=u);const d=i(t,{active:n,context:r.current,currentCoordinates:u});if(d){const p=Yo(d,u),f={x:0,y:0},{scrollableAncestors:g}=r.current;for(const h of g){const b=t.code,{isTop:w,isRight:v,isLeft:m,isBottom:C,maxScroll:x,minScroll:D}=If(h),S=Xy(h),M={x:Math.min(b===me.Right?S.right-S.width/2:S.right,Math.max(b===me.Right?S.left:S.left+S.width/2,d.x)),y:Math.min(b===me.Down?S.bottom-S.height/2:S.bottom,Math.max(b===me.Down?S.top:S.top+S.height/2,d.y))},P=b===me.Right&&!v||b===me.Left&&!m,O=b===me.Down&&!C||b===me.Up&&!w;if(P&&M.x!==d.x){const _=h.scrollLeft+p.x,V=b===me.Right&&_<=x.x||b===me.Left&&_>=D.x;if(V&&!p.y){h.scrollTo({left:_,behavior:a});return}V?f.x=h.scrollLeft-_:f.x=b===me.Right?h.scrollLeft-x.x:h.scrollLeft-D.x,f.x&&h.scrollBy({left:-f.x,behavior:a});break}else if(O&&M.y!==d.y){const _=h.scrollTop+p.y,V=b===me.Down&&_<=x.y||b===me.Up&&_>=D.y;if(V&&!p.x){h.scrollTo({top:_,behavior:a});return}V?f.y=h.scrollTop-_:f.y=b===me.Down?h.scrollTop-x.y:h.scrollTop-D.y,f.y&&h.scrollBy({top:-f.y,behavior:a});break}}this.handleMove(t,Ln(Yo(d,this.referenceCoordinates),f))}}}handleMove(t,n){const{onMove:r}=this.props;t.preventDefault(),r(n)}handleEnd(t){const{onEnd:n}=this.props;t.preventDefault(),this.detach(),n()}handleCancel(t){const{onCancel:n}=this.props;t.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}Vf.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=Ff,onActivation:o}=t,{active:s}=n;const{code:i}=e.nativeEvent;if(r.start.includes(i)){const a=s.activatorNode.current;return a&&e.target!==a?!1:(e.preventDefault(),o==null||o({event:e.nativeEvent}),!0)}return!1}}];function bc(e){return!!(e&&"distance"in e)}function Sc(e){return!!(e&&"delay"in e)}class La{constructor(t,n,r){var o;r===void 0&&(r=ew(t.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=t,this.events=n;const{event:s}=t,{target:i}=s;this.props=t,this.events=n,this.document=Zn(i),this.documentListeners=new Rr(this.document),this.listeners=new Rr(r),this.windowListeners=new Rr(Le(i)),this.initialCoordinates=(o=Ir(s))!=null?o:ct,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:t,props:{options:{activationConstraint:n,bypassActivationConstraint:r}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),t.cancel&&this.listeners.add(t.cancel.name,this.handleCancel),this.windowListeners.add(et.Resize,this.handleCancel),this.windowListeners.add(et.DragStart,xc),this.windowListeners.add(et.VisibilityChange,this.handleCancel),this.windowListeners.add(et.ContextMenu,xc),this.documentListeners.add(et.Keydown,this.handleKeydown),n){if(r!=null&&r({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(Sc(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(bc(n)){this.handlePending(n);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(t,n){const{active:r,onPending:o}=this.props;o(r,t,this.initialCoordinates,n)}handleStart(){const{initialCoordinates:t}=this,{onStart:n}=this.props;t&&(this.activated=!0,this.documentListeners.add(et.Click,tw,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(et.SelectionChange,this.removeTextSelection),n(t))}handleMove(t){var n;const{activated:r,initialCoordinates:o,props:s}=this,{onMove:i,options:{activationConstraint:a}}=s;if(!o)return;const l=(n=Ir(t))!=null?n:ct,c=Yo(o,l);if(!r&&a){if(bc(a)){if(a.tolerance!=null&&Zs(c,a.tolerance))return this.handleCancel();if(Zs(c,a.distance))return this.handleStart()}if(Sc(a)&&Zs(c,a.tolerance))return this.handleCancel();this.handlePending(a,c);return}t.cancelable&&t.preventDefault(),i(l)}handleEnd(){const{onAbort:t,onEnd:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleCancel(){const{onAbort:t,onCancel:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleKeydown(t){t.code===me.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const rw={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class Lf extends La{constructor(t){const{event:n}=t,r=Zn(n.target);super(t,rw,r)}}Lf.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!n.isPrimary||n.button!==0?!1:(r==null||r({event:n}),!0)}}];const ow={move:{name:"mousemove"},end:{name:"mouseup"}};var zi;(function(e){e[e.RightClick=2]="RightClick"})(zi||(zi={}));class $f extends La{constructor(t){super(t,ow,Zn(t.event.target))}}$f.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button===zi.RightClick?!1:(r==null||r({event:n}),!0)}}];const Js={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class Bf extends La{constructor(t){super(t,Js)}static setup(){return window.addEventListener(Js.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(Js.move.name,t)};function t(){}}}Bf.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;const{touches:o}=n;return o.length>1?!1:(r==null||r({event:n}),!0)}}];var Tr;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(Tr||(Tr={}));var qo;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(qo||(qo={}));function sw(e){let{acceleration:t,activator:n=Tr.Pointer,canScroll:r,draggingRect:o,enabled:s,interval:i=5,order:a=qo.TreeOrder,pointerCoordinates:l,scrollableAncestors:c,scrollableAncestorRects:u,delta:d,threshold:p}=e;const f=aw({delta:d,disabled:!s}),[g,h]=Sy(),b=R.useRef({x:0,y:0}),w=R.useRef({x:0,y:0}),v=R.useMemo(()=>{switch(n){case Tr.Pointer:return l?{top:l.y,bottom:l.y,left:l.x,right:l.x}:null;case Tr.DraggableRect:return o}},[n,o,l]),m=R.useRef(null),C=R.useCallback(()=>{const D=m.current;if(!D)return;const S=b.current.x*w.current.x,M=b.current.y*w.current.y;D.scrollBy(S,M)},[]),x=R.useMemo(()=>a===qo.TreeOrder?[...c].reverse():c,[a,c]);R.useEffect(()=>{if(!s||!c.length||!v){h();return}for(const D of x){if((r==null?void 0:r(D))===!1)continue;const S=c.indexOf(D),M=u[S];if(!M)continue;const{direction:P,speed:O}=qy(D,M,v,t,p);for(const _ of["x","y"])f[_][P[_]]||(O[_]=0,P[_]=0);if(O.x>0||O.y>0){h(),m.current=D,g(C,i),b.current=O,w.current=P;return}}b.current={x:0,y:0},w.current={x:0,y:0},h()},[t,C,r,h,s,i,JSON.stringify(v),JSON.stringify(f),g,c,x,u,JSON.stringify(p)])}const iw={x:{[Me.Backward]:!1,[Me.Forward]:!1},y:{[Me.Backward]:!1,[Me.Forward]:!1}};function aw(e){let{delta:t,disabled:n}=e;const r=Go(t);return Xr(o=>{if(n||!r||!o)return iw;const s={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[Me.Backward]:o.x[Me.Backward]||s.x===-1,[Me.Forward]:o.x[Me.Forward]||s.x===1},y:{[Me.Backward]:o.y[Me.Backward]||s.y===-1,[Me.Forward]:o.y[Me.Forward]||s.y===1}}},[n,t,r])}function lw(e,t){const n=t!=null?e.get(t):void 0,r=n?n.node.current:null;return Xr(o=>{var s;return t==null?null:(s=r??o)!=null?s:null},[r,t])}function cw(e,t){return R.useMemo(()=>e.reduce((n,r)=>{const{sensor:o}=r,s=o.activators.map(i=>({eventName:i.eventName,handler:t(i.handler,r)}));return[...n,...s]},[]),[e,t])}var jr;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(jr||(jr={}));var Hi;(function(e){e.Optimized="optimized"})(Hi||(Hi={}));const Cc=new Map;function uw(e,t){let{dragging:n,dependencies:r,config:o}=t;const[s,i]=R.useState(null),{frequency:a,measure:l,strategy:c}=o,u=R.useRef(e),d=b(),p=kr(d),f=R.useCallback(function(w){w===void 0&&(w=[]),!p.current&&i(v=>v===null?w:v.concat(w.filter(m=>!v.includes(m))))},[p]),g=R.useRef(null),h=Xr(w=>{if(d&&!n)return Cc;if(!w||w===Cc||u.current!==e||s!=null){const v=new Map;for(let m of e){if(!m)continue;if(s&&s.length>0&&!s.includes(m.id)&&m.rect.current){v.set(m.id,m.rect.current);continue}const C=m.node.current,x=C?new Va(l(C),C):null;m.rect.current=x,x&&v.set(m.id,x)}return v}return w},[e,s,n,d,l]);return R.useEffect(()=>{u.current=e},[e]),R.useEffect(()=>{d||f()},[n,d]),R.useEffect(()=>{s&&s.length>0&&i(null)},[JSON.stringify(s)]),R.useEffect(()=>{d||typeof a!="number"||g.current!==null||(g.current=setTimeout(()=>{f(),g.current=null},a))},[a,d,f,...r]),{droppableRects:h,measureDroppableContainers:f,measuringScheduled:s!=null};function b(){switch(c){case jr.Always:return!1;case jr.BeforeDragging:return n;default:return!n}}}function $a(e,t){return Xr(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function dw(e,t){return $a(e,t)}function fw(e){let{callback:t,disabled:n}=e;const r=fs(t),o=R.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:s}=window;return new s(r)},[r,n]);return R.useEffect(()=>()=>o==null?void 0:o.disconnect(),[o]),o}function hs(e){let{callback:t,disabled:n}=e;const r=fs(t),o=R.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:s}=window;return new s(r)},[n]);return R.useEffect(()=>()=>o==null?void 0:o.disconnect(),[o]),o}function pw(e){return new Va(Jr(e),e)}function Rc(e,t,n){t===void 0&&(t=pw);const[r,o]=R.useState(null);function s(){o(l=>{if(!e)return null;if(e.isConnected===!1){var c;return(c=l??n)!=null?c:null}const u=t(e);return JSON.stringify(l)===JSON.stringify(u)?l:u})}const i=fw({callback(l){if(e)for(const c of l){const{type:u,target:d}=c;if(u==="childList"&&d instanceof HTMLElement&&d.contains(e)){s();break}}}}),a=hs({callback:s});return At(()=>{s(),e?(a==null||a.observe(e),i==null||i.observe(document.body,{childList:!0,subtree:!0})):(a==null||a.disconnect(),i==null||i.disconnect())},[e]),r}function hw(e){const t=$a(e);return Ef(e,t)}const Tc=[];function gw(e){const t=R.useRef(e),n=Xr(r=>e?r&&r!==Tc&&e&&t.current&&e.parentNode===t.current.parentNode?r:Fa(e):Tc,[e]);return R.useEffect(()=>{t.current=e},[e]),n}function mw(e){const[t,n]=R.useState(null),r=R.useRef(e),o=R.useCallback(s=>{const i=Xs(s.target);i&&n(a=>a?(a.set(i,Bi(i)),new Map(a)):null)},[]);return R.useEffect(()=>{const s=r.current;if(e!==s){i(s);const a=e.map(l=>{const c=Xs(l);return c?(c.addEventListener("scroll",o,{passive:!0}),[c,Bi(c)]):null}).filter(l=>l!=null);n(a.length?new Map(a):null),r.current=e}return()=>{i(e),i(s)};function i(a){a.forEach(l=>{const c=Xs(l);c==null||c.removeEventListener("scroll",o)})}},[o,e]),R.useMemo(()=>e.length?t?Array.from(t.values()).reduce((s,i)=>Ln(s,i),ct):Nf(e):ct,[e,t])}function Dc(e,t){t===void 0&&(t=[]);const n=R.useRef(null);return R.useEffect(()=>{n.current=null},t),R.useEffect(()=>{const r=e!==ct;r&&!n.current&&(n.current=e),!r&&n.current&&(n.current=null)},[e]),n.current?Yo(e,n.current):ct}function vw(e){R.useEffect(()=>{if(!ds)return;const t=e.map(n=>{let{sensor:r}=n;return r.setup==null?void 0:r.setup()});return()=>{for(const n of t)n==null||n()}},e.map(t=>{let{sensor:n}=t;return n}))}function yw(e,t){return R.useMemo(()=>e.reduce((n,r)=>{let{eventName:o,handler:s}=r;return n[o]=i=>{s(i,t)},n},{}),[e,t])}function zf(e){return R.useMemo(()=>e?Uy(e):null,[e])}const Mc=[];function ww(e,t){t===void 0&&(t=Jr);const[n]=e,r=zf(n?Le(n):null),[o,s]=R.useState(Mc);function i(){s(()=>e.length?e.map(l=>kf(l)?r:new Va(t(l),l)):Mc)}const a=hs({callback:i});return At(()=>{a==null||a.disconnect(),i(),e.forEach(l=>a==null?void 0:a.observe(l))},[e]),o}function Hf(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return qr(t)?t:e}function xw(e){let{measure:t}=e;const[n,r]=R.useState(null),o=R.useCallback(c=>{for(const{target:u}of c)if(qr(u)){r(d=>{const p=t(u);return d?{...d,width:p.width,height:p.height}:p});break}},[t]),s=hs({callback:o}),i=R.useCallback(c=>{const u=Hf(c);s==null||s.disconnect(),u&&(s==null||s.observe(u)),r(u?t(u):null)},[t,s]),[a,l]=Uo(i);return R.useMemo(()=>({nodeRef:a,rect:n,setRef:l}),[n,a,l])}const bw=[{sensor:Lf,options:{}},{sensor:Vf,options:{}}],Sw={current:{}},Io={draggable:{measure:wc},droppable:{measure:wc,strategy:jr.WhileDragging,frequency:Hi.Optimized},dragOverlay:{measure:Jr}};class Dr extends Map{get(t){var n;return t!=null&&(n=super.get(t))!=null?n:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:n}=t;return!n})}getNodeFor(t){var n,r;return(n=(r=this.get(t))==null?void 0:r.node.current)!=null?n:void 0}}const Cw={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Dr,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Ko},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Io,measureDroppableContainers:Ko,windowRect:null,measuringScheduled:!1},Wf={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Ko,draggableNodes:new Map,over:null,measureDroppableContainers:Ko},Qr=R.createContext(Wf),Uf=R.createContext(Cw);function Rw(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Dr}}}function Tw(e,t){switch(t.type){case Te.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case Te.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case Te.DragEnd:case Te.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Te.RegisterDroppable:{const{element:n}=t,{id:r}=n,o=new Dr(e.droppable.containers);return o.set(r,n),{...e,droppable:{...e.droppable,containers:o}}}case Te.SetDroppableDisabled:{const{id:n,key:r,disabled:o}=t,s=e.droppable.containers.get(n);if(!s||r!==s.key)return e;const i=new Dr(e.droppable.containers);return i.set(n,{...s,disabled:o}),{...e,droppable:{...e.droppable,containers:i}}}case Te.UnregisterDroppable:{const{id:n,key:r}=t,o=e.droppable.containers.get(n);if(!o||r!==o.key)return e;const s=new Dr(e.droppable.containers);return s.delete(n),{...e,droppable:{...e.droppable,containers:s}}}default:return e}}function Dw(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:o}=R.useContext(Qr),s=Go(r),i=Go(n==null?void 0:n.id);return R.useEffect(()=>{if(!t&&!r&&s&&i!=null){if(!ja(s)||document.activeElement===s.target)return;const a=o.get(i);if(!a)return;const{activatorNode:l,node:c}=a;if(!l.current&&!c.current)return;requestAnimationFrame(()=>{for(const u of[l.current,c.current]){if(!u)continue;const d=Ty(u);if(d){d.focus();break}}})}},[r,t,o,i,s]),null}function Gf(e,t){let{transform:n,...r}=t;return e!=null&&e.length?e.reduce((o,s)=>s({transform:o,...r}),n):n}function Mw(e){return R.useMemo(()=>({draggable:{...Io.draggable,...e==null?void 0:e.draggable},droppable:{...Io.droppable,...e==null?void 0:e.droppable},dragOverlay:{...Io.dragOverlay,...e==null?void 0:e.dragOverlay}}),[e==null?void 0:e.draggable,e==null?void 0:e.droppable,e==null?void 0:e.dragOverlay])}function Ew(e){let{activeNode:t,measure:n,initialRect:r,config:o=!0}=e;const s=R.useRef(!1),{x:i,y:a}=typeof o=="boolean"?{x:o,y:o}:o;At(()=>{if(!i&&!a||!t){s.current=!1;return}if(s.current||!r)return;const c=t==null?void 0:t.node.current;if(!c||c.isConnected===!1)return;const u=n(c),d=Ef(u,r);if(i||(d.x=0),a||(d.y=0),s.current=!0,Math.abs(d.x)>0||Math.abs(d.y)>0){const p=Af(c);p&&p.scrollBy({top:d.y,left:d.x})}},[t,i,a,r,n])}const gs=R.createContext({...ct,scaleX:1,scaleY:1});var Gt;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(Gt||(Gt={}));const Ba=R.memo(function(t){var n,r,o,s;let{id:i,accessibility:a,autoScroll:l=!0,children:c,sensors:u=bw,collisionDetection:d=Ly,measuring:p,modifiers:f,...g}=t;const h=R.useReducer(Tw,void 0,Rw),[b,w]=h,[v,m]=Ay(),[C,x]=R.useState(Gt.Uninitialized),D=C===Gt.Initialized,{draggable:{active:S,nodes:M,translate:P},droppable:{containers:O}}=b,_=S!=null?M.get(S):null,V=R.useRef({initial:null,translated:null}),G=R.useMemo(()=>{var ke;return S!=null?{id:S,data:(ke=_==null?void 0:_.data)!=null?ke:Sw,rect:V}:null},[S,_]),F=R.useRef(null),[L,k]=R.useState(null),[j,E]=R.useState(null),N=kr(g,Object.values(g)),A=ps("DndDescribedBy",i),I=R.useMemo(()=>O.getEnabled(),[O]),B=Mw(p),{droppableRects:H,measureDroppableContainers:W,measuringScheduled:Z}=uw(I,{dragging:D,dependencies:[P.x,P.y],config:B.droppable}),K=lw(M,S),$=R.useMemo(()=>j?Ir(j):null,[j]),q=Ov(),X=dw(K,B.draggable.measure);Ew({activeNode:S!=null?M.get(S):null,config:q.layoutShiftCompensation,initialRect:X,measure:B.draggable.measure});const U=Rc(K,B.draggable.measure,X),te=Rc(K?K.parentElement:null),z=R.useRef({activatorEvent:null,active:null,activeNode:K,collisionRect:null,collisions:null,droppableRects:H,draggableNodes:M,draggingNode:null,draggingNodeRect:null,droppableContainers:O,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),le=O.getNodeFor((n=z.current.over)==null?void 0:n.id),ve=xw({measure:B.dragOverlay.measure}),Oe=(r=ve.nodeRef.current)!=null?r:K,Be=D?(o=ve.rect)!=null?o:U:null,ft=!!(ve.nodeRef.current&&ve.rect),Rn=hw(ft?null:U),ot=zf(Oe?Le(Oe):null),pt=gw(D?le??K:null),Tn=ww(pt),Dn=Gf(f,{transform:{x:P.x-Rn.x,y:P.y-Rn.y,scaleX:1,scaleY:1},activatorEvent:j,active:G,activeNodeRect:U,containerNodeRect:te,draggingNodeRect:Be,over:z.current.over,overlayNodeRect:ve.rect,scrollableAncestors:pt,scrollableAncestorRects:Tn,windowRect:ot}),ar=$?Ln($,P):null,lr=mw(pt),zs=Dc(lr),Hs=Dc(lr,[U]),Y=Ln(Dn,zs),fe=Be?zy(Be,Dn):null,_e=G&&fe?d({active:G,collisionRect:fe,droppableRects:H,droppableContainers:I,pointerCoordinates:ar}):null,Ft=Fy(_e,"id"),[We,lc]=R.useState(null),Dv=ft?Dn:Ln(Dn,Hs),Mv=$y(Dv,(s=We==null?void 0:We.rect)!=null?s:null,U),Ws=R.useRef(null),cc=R.useCallback((ke,Ue)=>{let{sensor:Ge,options:Vt}=Ue;if(F.current==null)return;const Ze=M.get(F.current);if(!Ze)return;const Ye=ke.nativeEvent,ht=new Ge({active:F.current,activeNode:Ze,event:Ye,options:Vt,context:z,onAbort(Ee){if(!M.get(Ee))return;const{onDragAbort:gt}=N.current,Rt={id:Ee};gt==null||gt(Rt),v({type:"onDragAbort",event:Rt})},onPending(Ee,Lt,gt,Rt){if(!M.get(Ee))return;const{onDragPending:ur}=N.current,$t={id:Ee,constraint:Lt,initialCoordinates:gt,offset:Rt};ur==null||ur($t),v({type:"onDragPending",event:$t})},onStart(Ee){const Lt=F.current;if(Lt==null)return;const gt=M.get(Lt);if(!gt)return;const{onDragStart:Rt}=N.current,cr={activatorEvent:Ye,active:{id:Lt,data:gt.data,rect:V}};Pt.unstable_batchedUpdates(()=>{Rt==null||Rt(cr),x(Gt.Initializing),w({type:Te.DragStart,initialCoordinates:Ee,active:Lt}),v({type:"onDragStart",event:cr}),k(Ws.current),E(Ye)})},onMove(Ee){w({type:Te.DragMove,coordinates:Ee})},onEnd:Mn(Te.DragEnd),onCancel:Mn(Te.DragCancel)});Ws.current=ht;function Mn(Ee){return async function(){const{active:gt,collisions:Rt,over:cr,scrollAdjustedTranslate:ur}=z.current;let $t=null;if(gt&&ur){const{cancelDrop:dr}=N.current;$t={activatorEvent:Ye,active:gt,collisions:Rt,delta:ur,over:cr},Ee===Te.DragEnd&&typeof dr=="function"&&await Promise.resolve(dr($t))&&(Ee=Te.DragCancel)}F.current=null,Pt.unstable_batchedUpdates(()=>{w({type:Ee}),x(Gt.Uninitialized),lc(null),k(null),E(null),Ws.current=null;const dr=Ee===Te.DragEnd?"onDragEnd":"onDragCancel";if($t){const Us=N.current[dr];Us==null||Us($t),v({type:dr,event:$t})}})}}},[M]),Ev=R.useCallback((ke,Ue)=>(Ge,Vt)=>{const Ze=Ge.nativeEvent,Ye=M.get(Vt);if(F.current!==null||!Ye||Ze.dndKit||Ze.defaultPrevented)return;const ht={active:Ye};ke(Ge,Ue.options,ht)===!0&&(Ze.dndKit={capturedBy:Ue.sensor},F.current=Vt,cc(Ge,Ue))},[M,cc]),uc=cw(u,Ev);vw(u),At(()=>{U&&C===Gt.Initializing&&x(Gt.Initialized)},[U,C]),R.useEffect(()=>{const{onDragMove:ke}=N.current,{active:Ue,activatorEvent:Ge,collisions:Vt,over:Ze}=z.current;if(!Ue||!Ge)return;const Ye={active:Ue,activatorEvent:Ge,collisions:Vt,delta:{x:Y.x,y:Y.y},over:Ze};Pt.unstable_batchedUpdates(()=>{ke==null||ke(Ye),v({type:"onDragMove",event:Ye})})},[Y.x,Y.y]),R.useEffect(()=>{const{active:ke,activatorEvent:Ue,collisions:Ge,droppableContainers:Vt,scrollAdjustedTranslate:Ze}=z.current;if(!ke||F.current==null||!Ue||!Ze)return;const{onDragOver:Ye}=N.current,ht=Vt.get(Ft),Mn=ht&&ht.rect.current?{id:ht.id,rect:ht.rect.current,data:ht.data,disabled:ht.disabled}:null,Ee={active:ke,activatorEvent:Ue,collisions:Ge,delta:{x:Ze.x,y:Ze.y},over:Mn};Pt.unstable_batchedUpdates(()=>{lc(Mn),Ye==null||Ye(Ee),v({type:"onDragOver",event:Ee})})},[Ft]),At(()=>{z.current={activatorEvent:j,active:G,activeNode:K,collisionRect:fe,collisions:_e,droppableRects:H,draggableNodes:M,draggingNode:Oe,draggingNodeRect:Be,droppableContainers:O,over:We,scrollableAncestors:pt,scrollAdjustedTranslate:Y},V.current={initial:Be,translated:fe}},[G,K,_e,fe,M,Oe,Be,H,O,We,pt,Y]),sw({...q,delta:P,draggingRect:fe,pointerCoordinates:ar,scrollableAncestors:pt,scrollableAncestorRects:Tn});const Pv=R.useMemo(()=>({active:G,activeNode:K,activeNodeRect:U,activatorEvent:j,collisions:_e,containerNodeRect:te,dragOverlay:ve,draggableNodes:M,droppableContainers:O,droppableRects:H,over:We,measureDroppableContainers:W,scrollableAncestors:pt,scrollableAncestorRects:Tn,measuringConfiguration:B,measuringScheduled:Z,windowRect:ot}),[G,K,U,j,_e,te,ve,M,O,H,We,W,pt,Tn,B,Z,ot]),Av=R.useMemo(()=>({activatorEvent:j,activators:uc,active:G,activeNodeRect:U,ariaDescribedById:{draggable:A},dispatch:w,draggableNodes:M,over:We,measureDroppableContainers:W}),[j,uc,G,U,w,A,M,We,W]);return R.createElement(Mf.Provider,{value:m},R.createElement(Qr.Provider,{value:Av},R.createElement(Uf.Provider,{value:Pv},R.createElement(gs.Provider,{value:Mv},c)),R.createElement(Dw,{disabled:(a==null?void 0:a.restoreFocus)===!1})),R.createElement(ky,{...a,hiddenTextDescribedById:A}));function Ov(){const ke=(L==null?void 0:L.autoScrollEnabled)===!1,Ue=typeof l=="object"?l.enabled===!1:l===!1,Ge=D&&!ke&&!Ue;return typeof l=="object"?{...l,enabled:Ge}:{enabled:Ge}}}),Pw=R.createContext(null),Ec="button",Aw="Draggable";function za(e){let{id:t,data:n,disabled:r=!1,attributes:o}=e;const s=ps(Aw),{activators:i,activatorEvent:a,active:l,activeNodeRect:c,ariaDescribedById:u,draggableNodes:d,over:p}=R.useContext(Qr),{role:f=Ec,roleDescription:g="draggable",tabIndex:h=0}=o??{},b=(l==null?void 0:l.id)===t,w=R.useContext(b?gs:Pw),[v,m]=Uo(),[C,x]=Uo(),D=yw(i,t),S=kr(n);At(()=>(d.set(t,{id:t,key:s,node:v,activatorNode:C,data:S}),()=>{const P=d.get(t);P&&P.key===s&&d.delete(t)}),[d,t]);const M=R.useMemo(()=>({role:f,tabIndex:h,"aria-disabled":r,"aria-pressed":b&&f===Ec?!0:void 0,"aria-roledescription":g,"aria-describedby":u.draggable}),[r,f,h,b,g,u.draggable]);return{active:l,activatorEvent:a,activeNodeRect:c,attributes:M,isDragging:b,listeners:r?void 0:D,node:v,over:p,setNodeRef:m,setActivatorNodeRef:x,transform:w}}function Ow(){return R.useContext(Uf)}const _w="Droppable",kw={timeout:25};function Iw(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:o}=e;const s=ps(_w),{active:i,dispatch:a,over:l,measureDroppableContainers:c}=R.useContext(Qr),u=R.useRef({disabled:n}),d=R.useRef(!1),p=R.useRef(null),f=R.useRef(null),{disabled:g,updateMeasurementsFor:h,timeout:b}={...kw,...o},w=kr(h??r),v=R.useCallback(()=>{if(!d.current){d.current=!0;return}f.current!=null&&clearTimeout(f.current),f.current=setTimeout(()=>{c(Array.isArray(w.current)?w.current:[w.current]),f.current=null},b)},[b]),m=hs({callback:v,disabled:g||!i}),C=R.useCallback((M,P)=>{m&&(P&&(m.unobserve(P),d.current=!1),M&&m.observe(M))},[m]),[x,D]=Uo(C),S=kr(t);return R.useEffect(()=>{!m||!x.current||(m.disconnect(),d.current=!1,m.observe(x.current))},[x,m]),R.useEffect(()=>(a({type:Te.RegisterDroppable,element:{id:r,key:s,disabled:n,node:x,rect:p,data:S}}),()=>a({type:Te.UnregisterDroppable,key:s,id:r})),[r]),R.useEffect(()=>{n!==u.current.disabled&&(a({type:Te.SetDroppableDisabled,id:r,key:s,disabled:n}),u.current.disabled=n)},[r,s,n,a]),{active:i,rect:p,isOver:(l==null?void 0:l.id)===r,node:x,over:l,setNodeRef:D}}function Nw(e){let{animation:t,children:n}=e;const[r,o]=R.useState(null),[s,i]=R.useState(null),a=Go(n);return!n&&!r&&a&&o(a),At(()=>{if(!s)return;const l=r==null?void 0:r.key,c=r==null?void 0:r.props.id;if(l==null||c==null){o(null);return}Promise.resolve(t(c,s)).then(()=>{o(null)})},[t,r,s]),R.createElement(R.Fragment,null,n,r?R.cloneElement(r,{ref:i}):null)}const jw={x:0,y:0,scaleX:1,scaleY:1};function Fw(e){let{children:t}=e;return R.createElement(Qr.Provider,{value:Wf},R.createElement(gs.Provider,{value:jw},t))}const Vw={position:"fixed",touchAction:"none"},Lw=e=>ja(e)?"transform 250ms ease":void 0,$w=R.forwardRef((e,t)=>{let{as:n,activatorEvent:r,adjustScale:o,children:s,className:i,rect:a,style:l,transform:c,transition:u=Lw}=e;if(!a)return null;const d=o?c:{...c,scaleX:1,scaleY:1},p={...Vw,width:a.width,height:a.height,top:a.top,left:a.left,transform:Nr.Transform.toString(d),transformOrigin:o&&r?Ny(r,a):void 0,transition:typeof u=="function"?u(r):u,...l};return R.createElement(n,{className:i,style:p,ref:t},s)}),Bw=e=>t=>{let{active:n,dragOverlay:r}=t;const o={},{styles:s,className:i}=e;if(s!=null&&s.active)for(const[a,l]of Object.entries(s.active))l!==void 0&&(o[a]=n.node.style.getPropertyValue(a),n.node.style.setProperty(a,l));if(s!=null&&s.dragOverlay)for(const[a,l]of Object.entries(s.dragOverlay))l!==void 0&&r.node.style.setProperty(a,l);return i!=null&&i.active&&n.node.classList.add(i.active),i!=null&&i.dragOverlay&&r.node.classList.add(i.dragOverlay),function(){for(const[l,c]of Object.entries(o))n.node.style.setProperty(l,c);i!=null&&i.active&&n.node.classList.remove(i.active)}},zw=e=>{let{transform:{initial:t,final:n}}=e;return[{transform:Nr.Transform.toString(t)},{transform:Nr.Transform.toString(n)}]},Hw={duration:250,easing:"ease",keyframes:zw,sideEffects:Bw({styles:{active:{opacity:"0"}}})};function Ww(e){let{config:t,draggableNodes:n,droppableContainers:r,measuringConfiguration:o}=e;return fs((s,i)=>{if(t===null)return;const a=n.get(s);if(!a)return;const l=a.node.current;if(!l)return;const c=Hf(i);if(!c)return;const{transform:u}=Le(i).getComputedStyle(i),d=Pf(u);if(!d)return;const p=typeof t=="function"?t:Uw(t);return jf(l,o.draggable.measure),p({active:{id:s,data:a.data,node:l,rect:o.draggable.measure(l)},draggableNodes:n,dragOverlay:{node:i,rect:o.dragOverlay.measure(c)},droppableContainers:r,measuringConfiguration:o,transform:d})})}function Uw(e){const{duration:t,easing:n,sideEffects:r,keyframes:o}={...Hw,...e};return s=>{let{active:i,dragOverlay:a,transform:l,...c}=s;if(!t)return;const u={x:a.rect.left-i.rect.left,y:a.rect.top-i.rect.top},d={scaleX:l.scaleX!==1?i.rect.width*l.scaleX/a.rect.width:1,scaleY:l.scaleY!==1?i.rect.height*l.scaleY/a.rect.height:1},p={x:l.x-u.x,y:l.y-u.y,...d},f=o({...c,active:i,dragOverlay:a,transform:{initial:l,final:p}}),[g]=f,h=f[f.length-1];if(JSON.stringify(g)===JSON.stringify(h))return;const b=r==null?void 0:r({active:i,dragOverlay:a,...c}),w=a.node.animate(f,{duration:t,easing:n,fill:"forwards"});return new Promise(v=>{w.onfinish=()=>{b==null||b(),v()}})}}let Pc=0;function Gw(e){return R.useMemo(()=>{if(e!=null)return Pc++,Pc},[e])}const Yw=R.memo(e=>{let{adjustScale:t=!1,children:n,dropAnimation:r,style:o,transition:s,modifiers:i,wrapperElement:a="div",className:l,zIndex:c=999}=e;const{activatorEvent:u,active:d,activeNodeRect:p,containerNodeRect:f,draggableNodes:g,droppableContainers:h,dragOverlay:b,over:w,measuringConfiguration:v,scrollableAncestors:m,scrollableAncestorRects:C,windowRect:x}=Ow(),D=R.useContext(gs),S=Gw(d==null?void 0:d.id),M=Gf(i,{activatorEvent:u,active:d,activeNodeRect:p,containerNodeRect:f,draggingNodeRect:b.rect,over:w,overlayNodeRect:b.rect,scrollableAncestors:m,scrollableAncestorRects:C,transform:D,windowRect:x}),P=$a(p),O=Ww({config:r,draggableNodes:g,droppableContainers:h,measuringConfiguration:v}),_=P?b.setRef:void 0;return R.createElement(Fw,null,R.createElement(Nw,{animation:O},d&&S?R.createElement($w,{key:S,id:d.id,ref:_,as:a,activatorEvent:u,adjustScale:t,className:l,transition:s,rect:P,style:{zIndex:c,...o},transform:M},n):null))});/**
|
|
10
10
|
* @license lucide-react v0.483.0 - ISC
|
|
11
11
|
*
|
|
12
12
|
* This source code is licensed under the ISC license.
|
|
13
13
|
* See the LICENSE file in the root directory of this source tree.
|
|
14
|
-
*/const
|
|
14
|
+
*/const Kw=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Yf=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();/**
|
|
15
15
|
* @license lucide-react v0.483.0 - ISC
|
|
16
16
|
*
|
|
17
17
|
* This source code is licensed under the ISC license.
|
|
18
18
|
* See the LICENSE file in the root directory of this source tree.
|
|
19
|
-
*/var
|
|
19
|
+
*/var qw={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
|
|
20
20
|
* @license lucide-react v0.483.0 - ISC
|
|
21
21
|
*
|
|
22
22
|
* This source code is licensed under the ISC license.
|
|
23
23
|
* See the LICENSE file in the root directory of this source tree.
|
|
24
|
-
*/const
|
|
24
|
+
*/const Xw=R.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:s,iconNode:i,...a},l)=>R.createElement("svg",{ref:l,...qw,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:Yf("lucide",o),...a},[...i.map(([c,u])=>R.createElement(c,u)),...Array.isArray(s)?s:[s]]));/**
|
|
25
25
|
* @license lucide-react v0.483.0 - ISC
|
|
26
26
|
*
|
|
27
27
|
* This source code is licensed under the ISC license.
|
|
28
28
|
* See the LICENSE file in the root directory of this source tree.
|
|
29
|
-
*/const Ce=(e,t)=>{const n=
|
|
29
|
+
*/const Ce=(e,t)=>{const n=R.forwardRef(({className:r,...o},s)=>R.createElement(Xw,{ref:s,iconNode:t,className:Yf(`lucide-${Kw(e)}`,r),...o}));return n.displayName=`${e}`,n};/**
|
|
30
30
|
* @license lucide-react v0.483.0 - ISC
|
|
31
31
|
*
|
|
32
32
|
* This source code is licensed under the ISC license.
|
|
33
33
|
* See the LICENSE file in the root directory of this source tree.
|
|
34
|
-
*/const
|
|
34
|
+
*/const Zw=[["path",{d:"m19 21-7-4-7 4V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v16z",key:"1fy3hk"}]],Jw=Ce("Bookmark",Zw);/**
|
|
35
35
|
* @license lucide-react v0.483.0 - ISC
|
|
36
36
|
*
|
|
37
37
|
* This source code is licensed under the ISC license.
|
|
38
38
|
* See the LICENSE file in the root directory of this source tree.
|
|
39
|
-
*/const
|
|
39
|
+
*/const Qw=[["path",{d:"m15.2 16.9-.9-.4",key:"1r0w5f"}],["path",{d:"m15.2 19.1-.9.4",key:"j188fs"}],["path",{d:"M16 2v4",key:"4m81vk"}],["path",{d:"m16.9 15.2-.4-.9",key:"699xu"}],["path",{d:"m16.9 20.8-.4.9",key:"dfjc4z"}],["path",{d:"m19.5 14.3-.4.9",key:"1eb35c"}],["path",{d:"m19.5 21.7-.4-.9",key:"1tonu5"}],["path",{d:"M21 10.5V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h6",key:"11kmuh"}],["path",{d:"m21.7 16.5-.9.4",key:"1knoei"}],["path",{d:"m21.7 19.5-.9-.4",key:"q4dx6b"}],["path",{d:"M3 10h18",key:"8toen8"}],["path",{d:"M8 2v4",key:"1cmpym"}],["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}]],ex=Ce("CalendarCog",Qw);/**
|
|
40
40
|
* @license lucide-react v0.483.0 - ISC
|
|
41
41
|
*
|
|
42
42
|
* This source code is licensed under the ISC license.
|
|
43
43
|
* See the LICENSE file in the root directory of this source tree.
|
|
44
|
-
*/const
|
|
44
|
+
*/const tx=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}],["path",{d:"M8 14h.01",key:"6423bh"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M16 14h.01",key:"1gbofw"}],["path",{d:"M8 18h.01",key:"lrp35t"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M16 18h.01",key:"kzsmim"}]],nx=Ce("CalendarDays",tx);/**
|
|
45
45
|
* @license lucide-react v0.483.0 - ISC
|
|
46
46
|
*
|
|
47
47
|
* This source code is licensed under the ISC license.
|
|
48
48
|
* See the LICENSE file in the root directory of this source tree.
|
|
49
|
-
*/const
|
|
49
|
+
*/const rx=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]],Ha=Ce("Calendar",rx);/**
|
|
50
50
|
* @license lucide-react v0.483.0 - ISC
|
|
51
51
|
*
|
|
52
52
|
* This source code is licensed under the ISC license.
|
|
53
53
|
* See the LICENSE file in the root directory of this source tree.
|
|
54
|
-
*/const
|
|
54
|
+
*/const ox=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Kf=Ce("Check",ox);/**
|
|
55
55
|
* @license lucide-react v0.483.0 - ISC
|
|
56
56
|
*
|
|
57
57
|
* This source code is licensed under the ISC license.
|
|
58
58
|
* See the LICENSE file in the root directory of this source tree.
|
|
59
|
-
*/const
|
|
59
|
+
*/const sx=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],qf=Ce("ChevronDown",sx);/**
|
|
60
60
|
* @license lucide-react v0.483.0 - ISC
|
|
61
61
|
*
|
|
62
62
|
* This source code is licensed under the ISC license.
|
|
63
63
|
* See the LICENSE file in the root directory of this source tree.
|
|
64
|
-
*/const
|
|
64
|
+
*/const ix=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],ax=Ce("ChevronLeft",ix);/**
|
|
65
65
|
* @license lucide-react v0.483.0 - ISC
|
|
66
66
|
*
|
|
67
67
|
* This source code is licensed under the ISC license.
|
|
68
68
|
* See the LICENSE file in the root directory of this source tree.
|
|
69
|
-
*/const
|
|
69
|
+
*/const lx=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],cx=Ce("ChevronRight",lx);/**
|
|
70
70
|
* @license lucide-react v0.483.0 - ISC
|
|
71
71
|
*
|
|
72
72
|
* This source code is licensed under the ISC license.
|
|
73
73
|
* See the LICENSE file in the root directory of this source tree.
|
|
74
|
-
*/const
|
|
74
|
+
*/const ux=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],dx=Ce("ChevronUp",ux);/**
|
|
75
75
|
* @license lucide-react v0.483.0 - ISC
|
|
76
76
|
*
|
|
77
77
|
* This source code is licensed under the ISC license.
|
|
78
78
|
* See the LICENSE file in the root directory of this source tree.
|
|
79
|
-
*/const
|
|
79
|
+
*/const fx=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}],["path",{d:"M12 8v8",key:"napkw2"}]],px=Ce("CirclePlus",fx);/**
|
|
80
80
|
* @license lucide-react v0.483.0 - ISC
|
|
81
81
|
*
|
|
82
82
|
* This source code is licensed under the ISC license.
|
|
83
83
|
* See the LICENSE file in the root directory of this source tree.
|
|
84
|
-
*/const
|
|
84
|
+
*/const hx=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]],Xf=Ce("Clock",hx);/**
|
|
85
85
|
* @license lucide-react v0.483.0 - ISC
|
|
86
86
|
*
|
|
87
87
|
* This source code is licensed under the ISC license.
|
|
88
88
|
* See the LICENSE file in the root directory of this source tree.
|
|
89
|
-
*/const
|
|
89
|
+
*/const gx=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M7.5 3v18",key:"w0wo6v"}],["path",{d:"M12 3v18",key:"108xh3"}],["path",{d:"M16.5 3v18",key:"10tjh1"}]],mx=Ce("Columns4",gx);/**
|
|
90
90
|
* @license lucide-react v0.483.0 - ISC
|
|
91
91
|
*
|
|
92
92
|
* This source code is licensed under the ISC license.
|
|
93
93
|
* See the LICENSE file in the root directory of this source tree.
|
|
94
|
-
*/const
|
|
94
|
+
*/const vx=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],yx=Ce("FileText",vx);/**
|
|
95
95
|
* @license lucide-react v0.483.0 - ISC
|
|
96
96
|
*
|
|
97
97
|
* This source code is licensed under the ISC license.
|
|
98
98
|
* See the LICENSE file in the root directory of this source tree.
|
|
99
|
-
*/const
|
|
99
|
+
*/const wx=[["path",{d:"M3 2h18",key:"15qxfx"}],["rect",{width:"18",height:"12",x:"3",y:"6",rx:"2",key:"1439r6"}],["path",{d:"M3 22h18",key:"8prr45"}]],xx=Ce("GalleryVertical",wx);/**
|
|
100
100
|
* @license lucide-react v0.483.0 - ISC
|
|
101
101
|
*
|
|
102
102
|
* This source code is licensed under the ISC license.
|
|
103
103
|
* See the LICENSE file in the root directory of this source tree.
|
|
104
|
-
*/const
|
|
104
|
+
*/const bx=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M3 15h18",key:"5xshup"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"M15 3v18",key:"14nvp0"}]],Sx=Ce("Grid3x3",bx);/**
|
|
105
105
|
* @license lucide-react v0.483.0 - ISC
|
|
106
106
|
*
|
|
107
107
|
* This source code is licensed under the ISC license.
|
|
108
108
|
* See the LICENSE file in the root directory of this source tree.
|
|
109
|
-
*/const
|
|
109
|
+
*/const Cx=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],Rx=Ce("Pencil",Cx);/**
|
|
110
110
|
* @license lucide-react v0.483.0 - ISC
|
|
111
111
|
*
|
|
112
112
|
* This source code is licensed under the ISC license.
|
|
113
113
|
* See the LICENSE file in the root directory of this source tree.
|
|
114
|
-
*/const
|
|
114
|
+
*/const Tx=[["path",{d:"M12.034 12.681a.498.498 0 0 1 .647-.647l9 3.5a.5.5 0 0 1-.033.943l-3.444 1.068a1 1 0 0 0-.66.66l-1.067 3.443a.5.5 0 0 1-.943.033z",key:"xwnzip"}],["path",{d:"M21 11V5a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h6",key:"14rsvq"}]],Dx=Ce("SquareMousePointer",Tx);/**
|
|
115
115
|
* @license lucide-react v0.483.0 - ISC
|
|
116
116
|
*
|
|
117
117
|
* This source code is licensed under the ISC license.
|
|
118
118
|
* See the LICENSE file in the root directory of this source tree.
|
|
119
|
-
*/const
|
|
119
|
+
*/const Mx=[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]],Ex=Ce("Trash2",Mx);/**
|
|
120
120
|
* @license lucide-react v0.483.0 - ISC
|
|
121
121
|
*
|
|
122
122
|
* This source code is licensed under the ISC license.
|
|
123
123
|
* See the LICENSE file in the root directory of this source tree.
|
|
124
|
-
*/const
|
|
124
|
+
*/const Px=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],Zf=Ce("User",Px);/**
|
|
125
125
|
* @license lucide-react v0.483.0 - ISC
|
|
126
126
|
*
|
|
127
127
|
* This source code is licensed under the ISC license.
|
|
128
128
|
* See the LICENSE file in the root directory of this source tree.
|
|
129
|
-
*/const Dx=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Tx=Ce("X",Dx);function qf(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=qf(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Xf(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=qf(e))&&(r&&(r+=" "),r+=t);return r}const Va="-",Mx=e=>{const t=Ex(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:i=>{const a=i.split(Va);return a[0]===""&&a.length!==1&&a.shift(),Zf(a,t)||Px(i)},getConflictingClassGroupIds:(i,a)=>{const l=n[i]||[];return a&&r[i]?[...l,...r[i]]:l}}},Zf=(e,t)=>{var i;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),o=r?Zf(e.slice(1),r):void 0;if(o)return o;if(t.validators.length===0)return;const s=e.join(Va);return(i=t.validators.find(({validator:a})=>a(s)))==null?void 0:i.classGroupId},Pc=/^\[(.+)\]$/,Px=e=>{if(Pc.test(e)){const t=Pc.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},Ex=e=>{const{theme:t,classGroups:n}=e,r={nextPart:new Map,validators:[]};for(const o in n)Li(n[o],r,o,t);return r},Li=(e,t,n,r)=>{e.forEach(o=>{if(typeof o=="string"){const s=o===""?t:Ec(t,o);s.classGroupId=n;return}if(typeof o=="function"){if(Ax(o)){Li(o(r),t,n,r);return}t.validators.push({validator:o,classGroupId:n});return}Object.entries(o).forEach(([s,i])=>{Li(i,Ec(t,s),n,r)})})},Ec=(e,t)=>{let n=e;return t.split(Va).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},Ax=e=>e.isThemeGetter,Ox=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const o=(s,i)=>{n.set(s,i),t++,t>e&&(t=0,r=n,n=new Map)};return{get(s){let i=n.get(s);if(i!==void 0)return i;if((i=r.get(s))!==void 0)return o(s,i),i},set(s,i){n.has(s)?n.set(s,i):o(s,i)}}},$i="!",Bi=":",_x=Bi.length,kx=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=o=>{const s=[];let i=0,a=0,l=0,c;for(let m=0;m<o.length;m++){let p=o[m];if(i===0&&a===0){if(p===Bi){s.push(o.slice(l,m)),l=m+_x;continue}if(p==="/"){c=m;continue}}p==="["?i++:p==="]"?i--:p==="("?a++:p===")"&&a--}const u=s.length===0?o:o.substring(l),d=Ix(u),f=d!==u,h=c&&c>l?c-l:void 0;return{modifiers:s,hasImportantModifier:f,baseClassName:d,maybePostfixModifierPosition:h}};if(t){const o=t+Bi,s=r;r=i=>i.startsWith(o)?s(i.substring(o.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:i,maybePostfixModifierPosition:void 0}}if(n){const o=r;r=s=>n({className:s,parseClassName:o})}return r},Ix=e=>e.endsWith($i)?e.substring(0,e.length-1):e.startsWith($i)?e.substring(1):e,Nx=e=>{const t=Object.fromEntries(e.orderSensitiveModifiers.map(r=>[r,!0]));return r=>{if(r.length<=1)return r;const o=[];let s=[];return r.forEach(i=>{i[0]==="["||t[i]?(o.push(...s.sort(),i),s=[]):s.push(i)}),o.push(...s.sort()),o}},jx=e=>({cache:Ox(e.cacheSize),parseClassName:kx(e),sortModifiers:Nx(e),...Mx(e)}),Fx=/\s+/,Vx=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o,sortModifiers:s}=t,i=[],a=e.trim().split(Fx);let l="";for(let c=a.length-1;c>=0;c-=1){const u=a[c],{isExternal:d,modifiers:f,hasImportantModifier:h,baseClassName:m,maybePostfixModifierPosition:p}=n(u);if(d){l=u+(l.length>0?" "+l:l);continue}let b=!!p,y=r(b?m.substring(0,p):m);if(!y){if(!b){l=u+(l.length>0?" "+l:l);continue}if(y=r(m),!y){l=u+(l.length>0?" "+l:l);continue}b=!1}const g=s(f).join(":"),w=h?g+$i:g,C=w+y;if(i.includes(C))continue;i.push(C);const x=o(y,b);for(let M=0;M<x.length;++M){const S=x[M];i.push(w+S)}l=u+(l.length>0?" "+l:l)}return l};function Lx(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=Jf(t))&&(r&&(r+=" "),r+=n);return r}const Jf=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=Jf(e[r]))&&(n&&(n+=" "),n+=t);return n};function $x(e,...t){let n,r,o,s=i;function i(l){const c=t.reduce((u,d)=>d(u),e());return n=jx(c),r=n.cache.get,o=n.cache.set,s=a,a(l)}function a(l){const c=r(l);if(c)return c;const u=Vx(l,n);return o(l,u),u}return function(){return s(Lx.apply(null,arguments))}}const Re=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},Qf=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,eh=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Bx=/^\d+\/\d+$/,zx=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Hx=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Wx=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,Ux=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Gx=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Dn=e=>Bx.test(e),ie=e=>!!e&&!Number.isNaN(Number(e)),Ft=e=>!!e&&Number.isInteger(Number(e)),Ys=e=>e.endsWith("%")&&ie(e.slice(0,-1)),bt=e=>zx.test(e),Kx=()=>!0,Yx=e=>Hx.test(e)&&!Wx.test(e),th=()=>!1,qx=e=>Ux.test(e),Xx=e=>Gx.test(e),Zx=e=>!Q(e)&&!ee(e),Jx=e=>Kn(e,oh,th),Q=e=>Qf.test(e),an=e=>Kn(e,sh,Yx),qs=e=>Kn(e,rb,ie),Ac=e=>Kn(e,nh,th),Qx=e=>Kn(e,rh,Xx),co=e=>Kn(e,ih,qx),ee=e=>eh.test(e),lr=e=>Yn(e,sh),eb=e=>Yn(e,ob),Oc=e=>Yn(e,nh),tb=e=>Yn(e,oh),nb=e=>Yn(e,rh),uo=e=>Yn(e,ih,!0),Kn=(e,t,n)=>{const r=Qf.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},Yn=(e,t,n=!1)=>{const r=eh.exec(e);return r?r[1]?t(r[1]):n:!1},nh=e=>e==="position"||e==="percentage",rh=e=>e==="image"||e==="url",oh=e=>e==="length"||e==="size"||e==="bg-size",sh=e=>e==="length",rb=e=>e==="number",ob=e=>e==="family-name",ih=e=>e==="shadow",sb=()=>{const e=Re("color"),t=Re("font"),n=Re("text"),r=Re("font-weight"),o=Re("tracking"),s=Re("leading"),i=Re("breakpoint"),a=Re("container"),l=Re("spacing"),c=Re("radius"),u=Re("shadow"),d=Re("inset-shadow"),f=Re("text-shadow"),h=Re("drop-shadow"),m=Re("blur"),p=Re("perspective"),b=Re("aspect"),y=Re("ease"),g=Re("animate"),w=()=>["auto","avoid","all","avoid-page","page","left","right","column"],C=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],x=()=>[...C(),ee,Q],M=()=>["auto","hidden","clip","visible","scroll"],S=()=>["auto","contain","none"],D=()=>[ee,Q,l],P=()=>[Dn,"full","auto",...D()],E=()=>[Ft,"none","subgrid",ee,Q],A=()=>["auto",{span:["full",Ft,ee,Q]},Ft,ee,Q],F=()=>[Ft,"auto",ee,Q],W=()=>["auto","min","max","fr",ee,Q],L=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],j=()=>["start","end","center","stretch","center-safe","end-safe"],_=()=>["auto",...D()],N=()=>[Dn,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...D()],O=()=>[e,ee,Q],V=()=>[...C(),Oc,Ac,{position:[ee,Q]}],k=()=>["no-repeat",{repeat:["","x","y","space","round"]}],I=()=>["auto","cover","contain",tb,Jx,{size:[ee,Q]}],$=()=>[Ys,lr,an],H=()=>["","none","full",c,ee,Q],U=()=>["",ie,lr,an],Z=()=>["solid","dashed","dotted","double"],q=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],B=()=>[ie,Ys,Oc,Ac],K=()=>["","none",m,ee,Q],X=()=>["none",ie,ee,Q],G=()=>["none",ie,ee,Q],ne=()=>[ie,ee,Q],z=()=>[Dn,"full",...D()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[bt],breakpoint:[bt],color:[Kx],container:[bt],"drop-shadow":[bt],ease:["in","out","in-out"],font:[Zx],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[bt],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[bt],shadow:[bt],spacing:["px",ie],text:[bt],"text-shadow":[bt],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Dn,Q,ee,b]}],container:["container"],columns:[{columns:[ie,Q,ee,a]}],"break-after":[{"break-after":w()}],"break-before":[{"break-before":w()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:x()}],overflow:[{overflow:M()}],"overflow-x":[{"overflow-x":M()}],"overflow-y":[{"overflow-y":M()}],overscroll:[{overscroll:S()}],"overscroll-x":[{"overscroll-x":S()}],"overscroll-y":[{"overscroll-y":S()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:P()}],"inset-x":[{"inset-x":P()}],"inset-y":[{"inset-y":P()}],start:[{start:P()}],end:[{end:P()}],top:[{top:P()}],right:[{right:P()}],bottom:[{bottom:P()}],left:[{left:P()}],visibility:["visible","invisible","collapse"],z:[{z:[Ft,"auto",ee,Q]}],basis:[{basis:[Dn,"full","auto",a,...D()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[ie,Dn,"auto","initial","none",Q]}],grow:[{grow:["",ie,ee,Q]}],shrink:[{shrink:["",ie,ee,Q]}],order:[{order:[Ft,"first","last","none",ee,Q]}],"grid-cols":[{"grid-cols":E()}],"col-start-end":[{col:A()}],"col-start":[{"col-start":F()}],"col-end":[{"col-end":F()}],"grid-rows":[{"grid-rows":E()}],"row-start-end":[{row:A()}],"row-start":[{"row-start":F()}],"row-end":[{"row-end":F()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":W()}],"auto-rows":[{"auto-rows":W()}],gap:[{gap:D()}],"gap-x":[{"gap-x":D()}],"gap-y":[{"gap-y":D()}],"justify-content":[{justify:[...L(),"normal"]}],"justify-items":[{"justify-items":[...j(),"normal"]}],"justify-self":[{"justify-self":["auto",...j()]}],"align-content":[{content:["normal",...L()]}],"align-items":[{items:[...j(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...j(),{baseline:["","last"]}]}],"place-content":[{"place-content":L()}],"place-items":[{"place-items":[...j(),"baseline"]}],"place-self":[{"place-self":["auto",...j()]}],p:[{p:D()}],px:[{px:D()}],py:[{py:D()}],ps:[{ps:D()}],pe:[{pe:D()}],pt:[{pt:D()}],pr:[{pr:D()}],pb:[{pb:D()}],pl:[{pl:D()}],m:[{m:_()}],mx:[{mx:_()}],my:[{my:_()}],ms:[{ms:_()}],me:[{me:_()}],mt:[{mt:_()}],mr:[{mr:_()}],mb:[{mb:_()}],ml:[{ml:_()}],"space-x":[{"space-x":D()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":D()}],"space-y-reverse":["space-y-reverse"],size:[{size:N()}],w:[{w:[a,"screen",...N()]}],"min-w":[{"min-w":[a,"screen","none",...N()]}],"max-w":[{"max-w":[a,"screen","none","prose",{screen:[i]},...N()]}],h:[{h:["screen",...N()]}],"min-h":[{"min-h":["screen","none",...N()]}],"max-h":[{"max-h":["screen",...N()]}],"font-size":[{text:["base",n,lr,an]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,ee,qs]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Ys,Q]}],"font-family":[{font:[eb,Q,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[o,ee,Q]}],"line-clamp":[{"line-clamp":[ie,"none",ee,qs]}],leading:[{leading:[s,...D()]}],"list-image":[{"list-image":["none",ee,Q]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",ee,Q]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:O()}],"text-color":[{text:O()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Z(),"wavy"]}],"text-decoration-thickness":[{decoration:[ie,"from-font","auto",ee,an]}],"text-decoration-color":[{decoration:O()}],"underline-offset":[{"underline-offset":[ie,"auto",ee,Q]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:D()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ee,Q]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",ee,Q]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:V()}],"bg-repeat":[{bg:k()}],"bg-size":[{bg:I()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Ft,ee,Q],radial:["",ee,Q],conic:[Ft,ee,Q]},nb,Qx]}],"bg-color":[{bg:O()}],"gradient-from-pos":[{from:$()}],"gradient-via-pos":[{via:$()}],"gradient-to-pos":[{to:$()}],"gradient-from":[{from:O()}],"gradient-via":[{via:O()}],"gradient-to":[{to:O()}],rounded:[{rounded:H()}],"rounded-s":[{"rounded-s":H()}],"rounded-e":[{"rounded-e":H()}],"rounded-t":[{"rounded-t":H()}],"rounded-r":[{"rounded-r":H()}],"rounded-b":[{"rounded-b":H()}],"rounded-l":[{"rounded-l":H()}],"rounded-ss":[{"rounded-ss":H()}],"rounded-se":[{"rounded-se":H()}],"rounded-ee":[{"rounded-ee":H()}],"rounded-es":[{"rounded-es":H()}],"rounded-tl":[{"rounded-tl":H()}],"rounded-tr":[{"rounded-tr":H()}],"rounded-br":[{"rounded-br":H()}],"rounded-bl":[{"rounded-bl":H()}],"border-w":[{border:U()}],"border-w-x":[{"border-x":U()}],"border-w-y":[{"border-y":U()}],"border-w-s":[{"border-s":U()}],"border-w-e":[{"border-e":U()}],"border-w-t":[{"border-t":U()}],"border-w-r":[{"border-r":U()}],"border-w-b":[{"border-b":U()}],"border-w-l":[{"border-l":U()}],"divide-x":[{"divide-x":U()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":U()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...Z(),"hidden","none"]}],"divide-style":[{divide:[...Z(),"hidden","none"]}],"border-color":[{border:O()}],"border-color-x":[{"border-x":O()}],"border-color-y":[{"border-y":O()}],"border-color-s":[{"border-s":O()}],"border-color-e":[{"border-e":O()}],"border-color-t":[{"border-t":O()}],"border-color-r":[{"border-r":O()}],"border-color-b":[{"border-b":O()}],"border-color-l":[{"border-l":O()}],"divide-color":[{divide:O()}],"outline-style":[{outline:[...Z(),"none","hidden"]}],"outline-offset":[{"outline-offset":[ie,ee,Q]}],"outline-w":[{outline:["",ie,lr,an]}],"outline-color":[{outline:O()}],shadow:[{shadow:["","none",u,uo,co]}],"shadow-color":[{shadow:O()}],"inset-shadow":[{"inset-shadow":["none",d,uo,co]}],"inset-shadow-color":[{"inset-shadow":O()}],"ring-w":[{ring:U()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:O()}],"ring-offset-w":[{"ring-offset":[ie,an]}],"ring-offset-color":[{"ring-offset":O()}],"inset-ring-w":[{"inset-ring":U()}],"inset-ring-color":[{"inset-ring":O()}],"text-shadow":[{"text-shadow":["none",f,uo,co]}],"text-shadow-color":[{"text-shadow":O()}],opacity:[{opacity:[ie,ee,Q]}],"mix-blend":[{"mix-blend":[...q(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":q()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[ie]}],"mask-image-linear-from-pos":[{"mask-linear-from":B()}],"mask-image-linear-to-pos":[{"mask-linear-to":B()}],"mask-image-linear-from-color":[{"mask-linear-from":O()}],"mask-image-linear-to-color":[{"mask-linear-to":O()}],"mask-image-t-from-pos":[{"mask-t-from":B()}],"mask-image-t-to-pos":[{"mask-t-to":B()}],"mask-image-t-from-color":[{"mask-t-from":O()}],"mask-image-t-to-color":[{"mask-t-to":O()}],"mask-image-r-from-pos":[{"mask-r-from":B()}],"mask-image-r-to-pos":[{"mask-r-to":B()}],"mask-image-r-from-color":[{"mask-r-from":O()}],"mask-image-r-to-color":[{"mask-r-to":O()}],"mask-image-b-from-pos":[{"mask-b-from":B()}],"mask-image-b-to-pos":[{"mask-b-to":B()}],"mask-image-b-from-color":[{"mask-b-from":O()}],"mask-image-b-to-color":[{"mask-b-to":O()}],"mask-image-l-from-pos":[{"mask-l-from":B()}],"mask-image-l-to-pos":[{"mask-l-to":B()}],"mask-image-l-from-color":[{"mask-l-from":O()}],"mask-image-l-to-color":[{"mask-l-to":O()}],"mask-image-x-from-pos":[{"mask-x-from":B()}],"mask-image-x-to-pos":[{"mask-x-to":B()}],"mask-image-x-from-color":[{"mask-x-from":O()}],"mask-image-x-to-color":[{"mask-x-to":O()}],"mask-image-y-from-pos":[{"mask-y-from":B()}],"mask-image-y-to-pos":[{"mask-y-to":B()}],"mask-image-y-from-color":[{"mask-y-from":O()}],"mask-image-y-to-color":[{"mask-y-to":O()}],"mask-image-radial":[{"mask-radial":[ee,Q]}],"mask-image-radial-from-pos":[{"mask-radial-from":B()}],"mask-image-radial-to-pos":[{"mask-radial-to":B()}],"mask-image-radial-from-color":[{"mask-radial-from":O()}],"mask-image-radial-to-color":[{"mask-radial-to":O()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":C()}],"mask-image-conic-pos":[{"mask-conic":[ie]}],"mask-image-conic-from-pos":[{"mask-conic-from":B()}],"mask-image-conic-to-pos":[{"mask-conic-to":B()}],"mask-image-conic-from-color":[{"mask-conic-from":O()}],"mask-image-conic-to-color":[{"mask-conic-to":O()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:V()}],"mask-repeat":[{mask:k()}],"mask-size":[{mask:I()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",ee,Q]}],filter:[{filter:["","none",ee,Q]}],blur:[{blur:K()}],brightness:[{brightness:[ie,ee,Q]}],contrast:[{contrast:[ie,ee,Q]}],"drop-shadow":[{"drop-shadow":["","none",h,uo,co]}],"drop-shadow-color":[{"drop-shadow":O()}],grayscale:[{grayscale:["",ie,ee,Q]}],"hue-rotate":[{"hue-rotate":[ie,ee,Q]}],invert:[{invert:["",ie,ee,Q]}],saturate:[{saturate:[ie,ee,Q]}],sepia:[{sepia:["",ie,ee,Q]}],"backdrop-filter":[{"backdrop-filter":["","none",ee,Q]}],"backdrop-blur":[{"backdrop-blur":K()}],"backdrop-brightness":[{"backdrop-brightness":[ie,ee,Q]}],"backdrop-contrast":[{"backdrop-contrast":[ie,ee,Q]}],"backdrop-grayscale":[{"backdrop-grayscale":["",ie,ee,Q]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[ie,ee,Q]}],"backdrop-invert":[{"backdrop-invert":["",ie,ee,Q]}],"backdrop-opacity":[{"backdrop-opacity":[ie,ee,Q]}],"backdrop-saturate":[{"backdrop-saturate":[ie,ee,Q]}],"backdrop-sepia":[{"backdrop-sepia":["",ie,ee,Q]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":D()}],"border-spacing-x":[{"border-spacing-x":D()}],"border-spacing-y":[{"border-spacing-y":D()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",ee,Q]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[ie,"initial",ee,Q]}],ease:[{ease:["linear","initial",y,ee,Q]}],delay:[{delay:[ie,ee,Q]}],animate:[{animate:["none",g,ee,Q]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[p,ee,Q]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:X()}],"rotate-x":[{"rotate-x":X()}],"rotate-y":[{"rotate-y":X()}],"rotate-z":[{"rotate-z":X()}],scale:[{scale:G()}],"scale-x":[{"scale-x":G()}],"scale-y":[{"scale-y":G()}],"scale-z":[{"scale-z":G()}],"scale-3d":["scale-3d"],skew:[{skew:ne()}],"skew-x":[{"skew-x":ne()}],"skew-y":[{"skew-y":ne()}],transform:[{transform:[ee,Q,"","none","gpu","cpu"]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:z()}],"translate-x":[{"translate-x":z()}],"translate-y":[{"translate-y":z()}],"translate-z":[{"translate-z":z()}],"translate-none":["translate-none"],accent:[{accent:O()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:O()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",ee,Q]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":D()}],"scroll-mx":[{"scroll-mx":D()}],"scroll-my":[{"scroll-my":D()}],"scroll-ms":[{"scroll-ms":D()}],"scroll-me":[{"scroll-me":D()}],"scroll-mt":[{"scroll-mt":D()}],"scroll-mr":[{"scroll-mr":D()}],"scroll-mb":[{"scroll-mb":D()}],"scroll-ml":[{"scroll-ml":D()}],"scroll-p":[{"scroll-p":D()}],"scroll-px":[{"scroll-px":D()}],"scroll-py":[{"scroll-py":D()}],"scroll-ps":[{"scroll-ps":D()}],"scroll-pe":[{"scroll-pe":D()}],"scroll-pt":[{"scroll-pt":D()}],"scroll-pr":[{"scroll-pr":D()}],"scroll-pb":[{"scroll-pb":D()}],"scroll-pl":[{"scroll-pl":D()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",ee,Q]}],fill:[{fill:["none",...O()]}],"stroke-w":[{stroke:[ie,lr,an,qs]}],stroke:[{stroke:["none",...O()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},ib=$x(sb);function he(...e){return ib(Xf(e))}function _c(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function ps(...e){return t=>{let n=!1;const r=e.map(o=>{const s=_c(o,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let o=0;o<r.length;o++){const s=r[o];typeof s=="function"?s():_c(e[o],null)}}}}function pe(...e){return R.useCallback(ps(...e),e)}function gn(e){const t=lb(e),n=R.forwardRef((r,o)=>{const{children:s,...i}=r,a=R.Children.toArray(s),l=a.find(ub);if(l){const c=l.props.children,u=a.map(d=>d===l?R.Children.count(c)>1?R.Children.only(null):R.isValidElement(c)?c.props.children:null:d);return v.jsx(t,{...i,ref:o,children:R.isValidElement(c)?R.cloneElement(c,void 0,u):null})}return v.jsx(t,{...i,ref:o,children:s})});return n.displayName=`${e}.Slot`,n}var ab=gn("Slot");function lb(e){const t=R.forwardRef((n,r)=>{const{children:o,...s}=n;if(R.isValidElement(o)){const i=fb(o),a=db(s,o.props);return o.type!==R.Fragment&&(a.ref=r?ps(r,i):i),R.cloneElement(o,a)}return R.Children.count(o)>1?R.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var ah=Symbol("radix.slottable");function cb(e){const t=({children:n})=>v.jsx(v.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=ah,t}function ub(e){return R.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===ah}function db(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...a)=>{s(...a),o(...a)}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function fb(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}const kc=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Ic=Xf,La=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return Ic(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:o,defaultVariants:s}=t,i=Object.keys(o).map(c=>{const u=n==null?void 0:n[c],d=s==null?void 0:s[c];if(u===null)return null;const f=kc(u)||kc(d);return o[c][f]}),a=n&&Object.entries(n).reduce((c,u)=>{let[d,f]=u;return f===void 0||(c[d]=f),c},{}),l=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((c,u)=>{let{class:d,className:f,...h}=u;return Object.entries(h).every(m=>{let[p,b]=m;return Array.isArray(b)?b.includes({...s,...a}[p]):{...s,...a}[p]===b})?[...c,d,f]:c},[]);return Ic(e,i,l,n==null?void 0:n.class,n==null?void 0:n.className)},hb=La("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive cursor-pointer",{variants:{variant:{default:"bg-primary cursor-pointer text-primary-foreground shadow-xs hover:bg-primary/90",destructive:"bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50 hover:bg-accent",secondary:"bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9"}},defaultVariants:{variant:"default",size:"default"}});function Rt({className:e,variant:t,size:n,asChild:r=!1,...o}){const s=r?ab:"button";return v.jsx(s,{"data-slot":"button",className:he(hb({variant:t,size:n,className:e})),...o})}function te(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e==null||e(o),n===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function Qt(e,t=[]){let n=[];function r(s,i){const a=R.createContext(i),l=n.length;n=[...n,i];const c=d=>{var y;const{scope:f,children:h,...m}=d,p=((y=f==null?void 0:f[e])==null?void 0:y[l])||a,b=R.useMemo(()=>m,Object.values(m));return v.jsx(p.Provider,{value:b,children:h})};c.displayName=s+"Provider";function u(d,f){var p;const h=((p=f==null?void 0:f[e])==null?void 0:p[l])||a,m=R.useContext(h);if(m)return m;if(i!==void 0)return i;throw new Error(`\`${d}\` must be used within \`${s}\``)}return[c,u]}const o=()=>{const s=n.map(i=>R.createContext(i));return function(a){const l=(a==null?void 0:a[e])||s;return R.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return o.scopeName=e,[r,pb(o,...t)]}function pb(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(s){const i=r.reduce((a,{useScope:l,scopeName:c})=>{const d=l(s)[`__scope${c}`];return{...a,...d}},{});return R.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return n.scopeName=t.scopeName,n}var gb=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],ce=gb.reduce((e,t)=>{const n=gn(`Primitive.${t}`),r=R.forwardRef((o,s)=>{const{asChild:i,...a}=o,l=i?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),v.jsx(l,{...a,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function lh(e,t){e&&as.flushSync(()=>e.dispatchEvent(t))}function et(e){const t=R.useRef(e);return R.useEffect(()=>{t.current=e}),R.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function mb(e,t=globalThis==null?void 0:globalThis.document){const n=et(e);R.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var vb="DismissableLayer",zi="dismissableLayer.update",yb="dismissableLayer.pointerDownOutside",wb="dismissableLayer.focusOutside",Nc,ch=R.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),qr=R.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:s,onInteractOutside:i,onDismiss:a,...l}=e,c=R.useContext(ch),[u,d]=R.useState(null),f=(u==null?void 0:u.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,h]=R.useState({}),m=pe(t,S=>d(S)),p=Array.from(c.layers),[b]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),y=p.indexOf(b),g=u?p.indexOf(u):-1,w=c.layersWithOutsidePointerEventsDisabled.size>0,C=g>=y,x=Sb(S=>{const D=S.target,P=[...c.branches].some(E=>E.contains(D));!C||P||(o==null||o(S),i==null||i(S),S.defaultPrevented||a==null||a())},f),M=Cb(S=>{const D=S.target;[...c.branches].some(E=>E.contains(D))||(s==null||s(S),i==null||i(S),S.defaultPrevented||a==null||a())},f);return mb(S=>{g===c.layers.size-1&&(r==null||r(S),!S.defaultPrevented&&a&&(S.preventDefault(),a()))},f),R.useEffect(()=>{if(u)return n&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(Nc=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(u)),c.layers.add(u),jc(),()=>{n&&c.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=Nc)}},[u,f,n,c]),R.useEffect(()=>()=>{u&&(c.layers.delete(u),c.layersWithOutsidePointerEventsDisabled.delete(u),jc())},[u,c]),R.useEffect(()=>{const S=()=>h({});return document.addEventListener(zi,S),()=>document.removeEventListener(zi,S)},[]),v.jsx(ce.div,{...l,ref:m,style:{pointerEvents:w?C?"auto":"none":void 0,...e.style},onFocusCapture:te(e.onFocusCapture,M.onFocusCapture),onBlurCapture:te(e.onBlurCapture,M.onBlurCapture),onPointerDownCapture:te(e.onPointerDownCapture,x.onPointerDownCapture)})});qr.displayName=vb;var xb="DismissableLayerBranch",bb=R.forwardRef((e,t)=>{const n=R.useContext(ch),r=R.useRef(null),o=pe(t,r);return R.useEffect(()=>{const s=r.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),v.jsx(ce.div,{...e,ref:o})});bb.displayName=xb;function Sb(e,t=globalThis==null?void 0:globalThis.document){const n=et(e),r=R.useRef(!1),o=R.useRef(()=>{});return R.useEffect(()=>{const s=a=>{if(a.target&&!r.current){let l=function(){uh(yb,n,c,{discrete:!0})};const c={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=l,t.addEventListener("click",o.current,{once:!0})):l()}else t.removeEventListener("click",o.current);r.current=!1},i=window.setTimeout(()=>{t.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",s),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function Cb(e,t=globalThis==null?void 0:globalThis.document){const n=et(e),r=R.useRef(!1);return R.useEffect(()=>{const o=s=>{s.target&&!r.current&&uh(wb,n,{originalEvent:s},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function jc(){const e=new CustomEvent(zi);document.dispatchEvent(e)}function uh(e,t,n,{discrete:r}){const o=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?lh(o,s):o.dispatchEvent(s)}var je=globalThis!=null&&globalThis.document?R.useLayoutEffect:()=>{},Rb=R[" useId ".trim().toString()]||(()=>{}),Db=0;function Ut(e){const[t,n]=R.useState(Rb());return je(()=>{n(r=>r??String(Db++))},[e]),e||(t?`radix-${t}`:"")}const Tb=["top","right","bottom","left"],Gt=Math.min,Ue=Math.max,qo=Math.round,fo=Math.floor,pt=e=>({x:e,y:e}),Mb={left:"right",right:"left",bottom:"top",top:"bottom"},Pb={start:"end",end:"start"};function Hi(e,t,n){return Ue(e,Gt(t,n))}function Tt(e,t){return typeof e=="function"?e(t):e}function Mt(e){return e.split("-")[0]}function qn(e){return e.split("-")[1]}function $a(e){return e==="x"?"y":"x"}function Ba(e){return e==="y"?"height":"width"}function Kt(e){return["top","bottom"].includes(Mt(e))?"y":"x"}function za(e){return $a(Kt(e))}function Eb(e,t,n){n===void 0&&(n=!1);const r=qn(e),o=za(e),s=Ba(o);let i=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=Xo(i)),[i,Xo(i)]}function Ab(e){const t=Xo(e);return[Wi(e),t,Wi(t)]}function Wi(e){return e.replace(/start|end/g,t=>Pb[t])}function Ob(e,t,n){const r=["left","right"],o=["right","left"],s=["top","bottom"],i=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?s:i;default:return[]}}function _b(e,t,n,r){const o=qn(e);let s=Ob(Mt(e),n==="start",r);return o&&(s=s.map(i=>i+"-"+o),t&&(s=s.concat(s.map(Wi)))),s}function Xo(e){return e.replace(/left|right|bottom|top/g,t=>Mb[t])}function kb(e){return{top:0,right:0,bottom:0,left:0,...e}}function dh(e){return typeof e!="number"?kb(e):{top:e,right:e,bottom:e,left:e}}function Zo(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function Fc(e,t,n){let{reference:r,floating:o}=e;const s=Kt(t),i=za(t),a=Ba(i),l=Mt(t),c=s==="y",u=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,f=r[a]/2-o[a]/2;let h;switch(l){case"top":h={x:u,y:r.y-o.height};break;case"bottom":h={x:u,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:d};break;case"left":h={x:r.x-o.width,y:d};break;default:h={x:r.x,y:r.y}}switch(qn(t)){case"start":h[i]-=f*(n&&c?-1:1);break;case"end":h[i]+=f*(n&&c?-1:1);break}return h}const Ib=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:s=[],platform:i}=n,a=s.filter(Boolean),l=await(i.isRTL==null?void 0:i.isRTL(t));let c=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:d}=Fc(c,r,l),f=r,h={},m=0;for(let p=0;p<a.length;p++){const{name:b,fn:y}=a[p],{x:g,y:w,data:C,reset:x}=await y({x:u,y:d,initialPlacement:r,placement:f,strategy:o,middlewareData:h,rects:c,platform:i,elements:{reference:e,floating:t}});u=g??u,d=w??d,h={...h,[b]:{...h[b],...C}},x&&m<=50&&(m++,typeof x=="object"&&(x.placement&&(f=x.placement),x.rects&&(c=x.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:o}):x.rects),{x:u,y:d}=Fc(c,f,l)),p=-1)}return{x:u,y:d,placement:f,strategy:o,middlewareData:h}};async function Or(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:s,rects:i,elements:a,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:f=!1,padding:h=0}=Tt(t,e),m=dh(h),b=a[f?d==="floating"?"reference":"floating":d],y=Zo(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(b)))==null||n?b:b.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:c,rootBoundary:u,strategy:l})),g=d==="floating"?{x:r,y:o,width:i.floating.width,height:i.floating.height}:i.reference,w=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),C=await(s.isElement==null?void 0:s.isElement(w))?await(s.getScale==null?void 0:s.getScale(w))||{x:1,y:1}:{x:1,y:1},x=Zo(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:g,offsetParent:w,strategy:l}):g);return{top:(y.top-x.top+m.top)/C.y,bottom:(x.bottom-y.bottom+m.bottom)/C.y,left:(y.left-x.left+m.left)/C.x,right:(x.right-y.right+m.right)/C.x}}const Nb=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:s,platform:i,elements:a,middlewareData:l}=t,{element:c,padding:u=0}=Tt(e,t)||{};if(c==null)return{};const d=dh(u),f={x:n,y:r},h=za(o),m=Ba(h),p=await i.getDimensions(c),b=h==="y",y=b?"top":"left",g=b?"bottom":"right",w=b?"clientHeight":"clientWidth",C=s.reference[m]+s.reference[h]-f[h]-s.floating[m],x=f[h]-s.reference[h],M=await(i.getOffsetParent==null?void 0:i.getOffsetParent(c));let S=M?M[w]:0;(!S||!await(i.isElement==null?void 0:i.isElement(M)))&&(S=a.floating[w]||s.floating[m]);const D=C/2-x/2,P=S/2-p[m]/2-1,E=Gt(d[y],P),A=Gt(d[g],P),F=E,W=S-p[m]-A,L=S/2-p[m]/2+D,j=Hi(F,L,W),_=!l.arrow&&qn(o)!=null&&L!==j&&s.reference[m]/2-(L<F?E:A)-p[m]/2<0,N=_?L<F?L-F:L-W:0;return{[h]:f[h]+N,data:{[h]:j,centerOffset:L-j-N,..._&&{alignmentOffset:N}},reset:_}}}),jb=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:s,rects:i,initialPlacement:a,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:p=!0,...b}=Tt(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const y=Mt(o),g=Kt(a),w=Mt(a)===a,C=await(l.isRTL==null?void 0:l.isRTL(c.floating)),x=f||(w||!p?[Xo(a)]:Ab(a)),M=m!=="none";!f&&M&&x.push(..._b(a,p,m,C));const S=[a,...x],D=await Or(t,b),P=[];let E=((r=s.flip)==null?void 0:r.overflows)||[];if(u&&P.push(D[y]),d){const L=Eb(o,i,C);P.push(D[L[0]],D[L[1]])}if(E=[...E,{placement:o,overflows:P}],!P.every(L=>L<=0)){var A,F;const L=(((A=s.flip)==null?void 0:A.index)||0)+1,j=S[L];if(j)return{data:{index:L,overflows:E},reset:{placement:j}};let _=(F=E.filter(N=>N.overflows[0]<=0).sort((N,O)=>N.overflows[1]-O.overflows[1])[0])==null?void 0:F.placement;if(!_)switch(h){case"bestFit":{var W;const N=(W=E.filter(O=>{if(M){const V=Kt(O.placement);return V===g||V==="y"}return!0}).map(O=>[O.placement,O.overflows.filter(V=>V>0).reduce((V,k)=>V+k,0)]).sort((O,V)=>O[1]-V[1])[0])==null?void 0:W[0];N&&(_=N);break}case"initialPlacement":_=a;break}if(o!==_)return{reset:{placement:_}}}return{}}}};function Vc(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Lc(e){return Tb.some(t=>e[t]>=0)}const Fb=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=Tt(e,t);switch(r){case"referenceHidden":{const s=await Or(t,{...o,elementContext:"reference"}),i=Vc(s,n.reference);return{data:{referenceHiddenOffsets:i,referenceHidden:Lc(i)}}}case"escaped":{const s=await Or(t,{...o,altBoundary:!0}),i=Vc(s,n.floating);return{data:{escapedOffsets:i,escaped:Lc(i)}}}default:return{}}}}};async function Vb(e,t){const{placement:n,platform:r,elements:o}=e,s=await(r.isRTL==null?void 0:r.isRTL(o.floating)),i=Mt(n),a=qn(n),l=Kt(n)==="y",c=["left","top"].includes(i)?-1:1,u=s&&l?-1:1,d=Tt(t,e);let{mainAxis:f,crossAxis:h,alignmentAxis:m}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&typeof m=="number"&&(h=a==="end"?m*-1:m),l?{x:h*u,y:f*c}:{x:f*c,y:h*u}}const Lb=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:s,placement:i,middlewareData:a}=t,l=await Vb(t,e);return i===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:o+l.x,y:s+l.y,data:{...l,placement:i}}}}},$b=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:s=!0,crossAxis:i=!1,limiter:a={fn:b=>{let{x:y,y:g}=b;return{x:y,y:g}}},...l}=Tt(e,t),c={x:n,y:r},u=await Or(t,l),d=Kt(Mt(o)),f=$a(d);let h=c[f],m=c[d];if(s){const b=f==="y"?"top":"left",y=f==="y"?"bottom":"right",g=h+u[b],w=h-u[y];h=Hi(g,h,w)}if(i){const b=d==="y"?"top":"left",y=d==="y"?"bottom":"right",g=m+u[b],w=m-u[y];m=Hi(g,m,w)}const p=a.fn({...t,[f]:h,[d]:m});return{...p,data:{x:p.x-n,y:p.y-r,enabled:{[f]:s,[d]:i}}}}}},Bb=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:s,middlewareData:i}=t,{offset:a=0,mainAxis:l=!0,crossAxis:c=!0}=Tt(e,t),u={x:n,y:r},d=Kt(o),f=$a(d);let h=u[f],m=u[d];const p=Tt(a,t),b=typeof p=="number"?{mainAxis:p,crossAxis:0}:{mainAxis:0,crossAxis:0,...p};if(l){const w=f==="y"?"height":"width",C=s.reference[f]-s.floating[w]+b.mainAxis,x=s.reference[f]+s.reference[w]-b.mainAxis;h<C?h=C:h>x&&(h=x)}if(c){var y,g;const w=f==="y"?"width":"height",C=["top","left"].includes(Mt(o)),x=s.reference[d]-s.floating[w]+(C&&((y=i.offset)==null?void 0:y[d])||0)+(C?0:b.crossAxis),M=s.reference[d]+s.reference[w]+(C?0:((g=i.offset)==null?void 0:g[d])||0)-(C?b.crossAxis:0);m<x?m=x:m>M&&(m=M)}return{[f]:h,[d]:m}}}},zb=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:s,platform:i,elements:a}=t,{apply:l=()=>{},...c}=Tt(e,t),u=await Or(t,c),d=Mt(o),f=qn(o),h=Kt(o)==="y",{width:m,height:p}=s.floating;let b,y;d==="top"||d==="bottom"?(b=d,y=f===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?"start":"end")?"left":"right"):(y=d,b=f==="end"?"top":"bottom");const g=p-u.top-u.bottom,w=m-u.left-u.right,C=Gt(p-u[b],g),x=Gt(m-u[y],w),M=!t.middlewareData.shift;let S=C,D=x;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(D=w),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(S=g),M&&!f){const E=Ue(u.left,0),A=Ue(u.right,0),F=Ue(u.top,0),W=Ue(u.bottom,0);h?D=m-2*(E!==0||A!==0?E+A:Ue(u.left,u.right)):S=p-2*(F!==0||W!==0?F+W:Ue(u.top,u.bottom))}await l({...t,availableWidth:D,availableHeight:S});const P=await i.getDimensions(a.floating);return m!==P.width||p!==P.height?{reset:{rects:!0}}:{}}}};function gs(){return typeof window<"u"}function Xn(e){return fh(e)?(e.nodeName||"").toLowerCase():"#document"}function Ge(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function yt(e){var t;return(t=(fh(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function fh(e){return gs()?e instanceof Node||e instanceof Ge(e).Node:!1}function at(e){return gs()?e instanceof Element||e instanceof Ge(e).Element:!1}function vt(e){return gs()?e instanceof HTMLElement||e instanceof Ge(e).HTMLElement:!1}function $c(e){return!gs()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Ge(e).ShadowRoot}function Xr(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=lt(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function Hb(e){return["table","td","th"].includes(Xn(e))}function ms(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function Ha(e){const t=Wa(),n=at(e)?lt(e):e;return["transform","translate","scale","rotate","perspective"].some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(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 Wb(e){let t=Yt(e);for(;vt(t)&&!Ln(t);){if(Ha(t))return t;if(ms(t))return null;t=Yt(t)}return null}function Wa(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Ln(e){return["html","body","#document"].includes(Xn(e))}function lt(e){return Ge(e).getComputedStyle(e)}function vs(e){return at(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Yt(e){if(Xn(e)==="html")return e;const t=e.assignedSlot||e.parentNode||$c(e)&&e.host||yt(e);return $c(t)?t.host:t}function hh(e){const t=Yt(e);return Ln(t)?e.ownerDocument?e.ownerDocument.body:e.body:vt(t)&&Xr(t)?t:hh(t)}function _r(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=hh(e),s=o===((r=e.ownerDocument)==null?void 0:r.body),i=Ge(o);if(s){const a=Ui(i);return t.concat(i,i.visualViewport||[],Xr(o)?o:[],a&&n?_r(a):[])}return t.concat(o,_r(o,[],n))}function Ui(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function ph(e){const t=lt(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=vt(e),s=o?e.offsetWidth:n,i=o?e.offsetHeight:r,a=qo(n)!==s||qo(r)!==i;return a&&(n=s,r=i),{width:n,height:r,$:a}}function Ua(e){return at(e)?e:e.contextElement}function Fn(e){const t=Ua(e);if(!vt(t))return pt(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:s}=ph(t);let i=(s?qo(n.width):n.width)/r,a=(s?qo(n.height):n.height)/o;return(!i||!Number.isFinite(i))&&(i=1),(!a||!Number.isFinite(a))&&(a=1),{x:i,y:a}}const Ub=pt(0);function gh(e){const t=Ge(e);return!Wa()||!t.visualViewport?Ub:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Gb(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Ge(e)?!1:t}function mn(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),s=Ua(e);let i=pt(1);t&&(r?at(r)&&(i=Fn(r)):i=Fn(e));const a=Gb(s,n,r)?gh(s):pt(0);let l=(o.left+a.x)/i.x,c=(o.top+a.y)/i.y,u=o.width/i.x,d=o.height/i.y;if(s){const f=Ge(s),h=r&&at(r)?Ge(r):r;let m=f,p=Ui(m);for(;p&&r&&h!==m;){const b=Fn(p),y=p.getBoundingClientRect(),g=lt(p),w=y.left+(p.clientLeft+parseFloat(g.paddingLeft))*b.x,C=y.top+(p.clientTop+parseFloat(g.paddingTop))*b.y;l*=b.x,c*=b.y,u*=b.x,d*=b.y,l+=w,c+=C,m=Ge(p),p=Ui(m)}}return Zo({width:u,height:d,x:l,y:c})}function Ga(e,t){const n=vs(e).scrollLeft;return t?t.left+n:mn(yt(e)).left+n}function mh(e,t,n){n===void 0&&(n=!1);const r=e.getBoundingClientRect(),o=r.left+t.scrollLeft-(n?0:Ga(e,r)),s=r.top+t.scrollTop;return{x:o,y:s}}function Kb(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const s=o==="fixed",i=yt(r),a=t?ms(t.floating):!1;if(r===i||a&&s)return n;let l={scrollLeft:0,scrollTop:0},c=pt(1);const u=pt(0),d=vt(r);if((d||!d&&!s)&&((Xn(r)!=="body"||Xr(i))&&(l=vs(r)),vt(r))){const h=mn(r);c=Fn(r),u.x=h.x+r.clientLeft,u.y=h.y+r.clientTop}const f=i&&!d&&!s?mh(i,l,!0):pt(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x+f.x,y:n.y*c.y-l.scrollTop*c.y+u.y+f.y}}function Yb(e){return Array.from(e.getClientRects())}function qb(e){const t=yt(e),n=vs(e),r=e.ownerDocument.body,o=Ue(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=Ue(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let i=-n.scrollLeft+Ga(e);const a=-n.scrollTop;return lt(r).direction==="rtl"&&(i+=Ue(t.clientWidth,r.clientWidth)-o),{width:o,height:s,x:i,y:a}}function Xb(e,t){const n=Ge(e),r=yt(e),o=n.visualViewport;let s=r.clientWidth,i=r.clientHeight,a=0,l=0;if(o){s=o.width,i=o.height;const c=Wa();(!c||c&&t==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}return{width:s,height:i,x:a,y:l}}function Zb(e,t){const n=mn(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,s=vt(e)?Fn(e):pt(1),i=e.clientWidth*s.x,a=e.clientHeight*s.y,l=o*s.x,c=r*s.y;return{width:i,height:a,x:l,y:c}}function Bc(e,t,n){let r;if(t==="viewport")r=Xb(e,n);else if(t==="document")r=qb(yt(e));else if(at(t))r=Zb(t,n);else{const o=gh(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return Zo(r)}function vh(e,t){const n=Yt(e);return n===t||!at(n)||Ln(n)?!1:lt(n).position==="fixed"||vh(n,t)}function Jb(e,t){const n=t.get(e);if(n)return n;let r=_r(e,[],!1).filter(a=>at(a)&&Xn(a)!=="body"),o=null;const s=lt(e).position==="fixed";let i=s?Yt(e):e;for(;at(i)&&!Ln(i);){const a=lt(i),l=Ha(i);!l&&a.position==="fixed"&&(o=null),(s?!l&&!o:!l&&a.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||Xr(i)&&!l&&vh(e,i))?r=r.filter(u=>u!==i):o=a,i=Yt(i)}return t.set(e,r),r}function Qb(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[...n==="clippingAncestors"?ms(t)?[]:Jb(t,this._c):[].concat(n),r],a=i[0],l=i.reduce((c,u)=>{const d=Bc(t,u,o);return c.top=Ue(d.top,c.top),c.right=Gt(d.right,c.right),c.bottom=Gt(d.bottom,c.bottom),c.left=Ue(d.left,c.left),c},Bc(t,a,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function eS(e){const{width:t,height:n}=ph(e);return{width:t,height:n}}function tS(e,t,n){const r=vt(t),o=yt(t),s=n==="fixed",i=mn(e,!0,s,t);let a={scrollLeft:0,scrollTop:0};const l=pt(0);if(r||!r&&!s)if((Xn(t)!=="body"||Xr(o))&&(a=vs(t)),r){const f=mn(t,!0,s,t);l.x=f.x+t.clientLeft,l.y=f.y+t.clientTop}else o&&(l.x=Ga(o));const c=o&&!r&&!s?mh(o,a):pt(0),u=i.left+a.scrollLeft-l.x-c.x,d=i.top+a.scrollTop-l.y-c.y;return{x:u,y:d,width:i.width,height:i.height}}function Xs(e){return lt(e).position==="static"}function zc(e,t){if(!vt(e)||lt(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return yt(e)===n&&(n=n.ownerDocument.body),n}function yh(e,t){const n=Ge(e);if(ms(e))return n;if(!vt(e)){let o=Yt(e);for(;o&&!Ln(o);){if(at(o)&&!Xs(o))return o;o=Yt(o)}return n}let r=zc(e,t);for(;r&&Hb(r)&&Xs(r);)r=zc(r,t);return r&&Ln(r)&&Xs(r)&&!Ha(r)?n:r||Wb(e)||n}const nS=async function(e){const t=this.getOffsetParent||yh,n=this.getDimensions,r=await n(e.floating);return{reference:tS(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function rS(e){return lt(e).direction==="rtl"}const oS={convertOffsetParentRelativeRectToViewportRelativeRect:Kb,getDocumentElement:yt,getClippingRect:Qb,getOffsetParent:yh,getElementRects:nS,getClientRects:Yb,getDimensions:eS,getScale:Fn,isElement:at,isRTL:rS};function wh(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function sS(e,t){let n=null,r;const o=yt(e);function s(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function i(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),s();const c=e.getBoundingClientRect(),{left:u,top:d,width:f,height:h}=c;if(a||t(),!f||!h)return;const m=fo(d),p=fo(o.clientWidth-(u+f)),b=fo(o.clientHeight-(d+h)),y=fo(u),w={rootMargin:-m+"px "+-p+"px "+-b+"px "+-y+"px",threshold:Ue(0,Gt(1,l))||1};let C=!0;function x(M){const S=M[0].intersectionRatio;if(S!==l){if(!C)return i();S?i(!1,S):r=setTimeout(()=>{i(!1,1e-7)},1e3)}S===1&&!wh(c,e.getBoundingClientRect())&&i(),C=!1}try{n=new IntersectionObserver(x,{...w,root:o.ownerDocument})}catch{n=new IntersectionObserver(x,w)}n.observe(e)}return i(!0),s}function iS(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,c=Ua(e),u=o||s?[...c?_r(c):[],..._r(t)]:[];u.forEach(y=>{o&&y.addEventListener("scroll",n,{passive:!0}),s&&y.addEventListener("resize",n)});const d=c&&a?sS(c,n):null;let f=-1,h=null;i&&(h=new ResizeObserver(y=>{let[g]=y;g&&g.target===c&&h&&(h.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var w;(w=h)==null||w.observe(t)})),n()}),c&&!l&&h.observe(c),h.observe(t));let m,p=l?mn(e):null;l&&b();function b(){const y=mn(e);p&&!wh(p,y)&&n(),p=y,m=requestAnimationFrame(b)}return n(),()=>{var y;u.forEach(g=>{o&&g.removeEventListener("scroll",n),s&&g.removeEventListener("resize",n)}),d==null||d(),(y=h)==null||y.disconnect(),h=null,l&&cancelAnimationFrame(m)}}const aS=Lb,lS=$b,cS=jb,uS=zb,dS=Fb,Hc=Nb,fS=Bb,hS=(e,t,n)=>{const r=new Map,o={platform:oS,...n},s={...o.platform,_c:r};return Ib(e,t,{...o,platform:s})};var ko=typeof document<"u"?T.useLayoutEffect:T.useEffect;function Jo(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Jo(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const s=o[r];if(!(s==="_owner"&&e.$$typeof)&&!Jo(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function xh(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Wc(e,t){const n=xh(e);return Math.round(t*n)/n}function Zs(e){const t=R.useRef(e);return ko(()=>{t.current=e}),t}function pS(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:s,floating:i}={},transform:a=!0,whileElementsMounted:l,open:c}=e,[u,d]=R.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,h]=R.useState(r);Jo(f,r)||h(r);const[m,p]=R.useState(null),[b,y]=R.useState(null),g=R.useCallback(O=>{O!==M.current&&(M.current=O,p(O))},[]),w=R.useCallback(O=>{O!==S.current&&(S.current=O,y(O))},[]),C=s||m,x=i||b,M=R.useRef(null),S=R.useRef(null),D=R.useRef(u),P=l!=null,E=Zs(l),A=Zs(o),F=Zs(c),W=R.useCallback(()=>{if(!M.current||!S.current)return;const O={placement:t,strategy:n,middleware:f};A.current&&(O.platform=A.current),hS(M.current,S.current,O).then(V=>{const k={...V,isPositioned:F.current!==!1};L.current&&!Jo(D.current,k)&&(D.current=k,as.flushSync(()=>{d(k)}))})},[f,t,n,A,F]);ko(()=>{c===!1&&D.current.isPositioned&&(D.current.isPositioned=!1,d(O=>({...O,isPositioned:!1})))},[c]);const L=R.useRef(!1);ko(()=>(L.current=!0,()=>{L.current=!1}),[]),ko(()=>{if(C&&(M.current=C),x&&(S.current=x),C&&x){if(E.current)return E.current(C,x,W);W()}},[C,x,W,E,P]);const j=R.useMemo(()=>({reference:M,floating:S,setReference:g,setFloating:w}),[g,w]),_=R.useMemo(()=>({reference:C,floating:x}),[C,x]),N=R.useMemo(()=>{const O={position:n,left:0,top:0};if(!_.floating)return O;const V=Wc(_.floating,u.x),k=Wc(_.floating,u.y);return a?{...O,transform:"translate("+V+"px, "+k+"px)",...xh(_.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:V,top:k}},[n,a,_.floating,u.x,u.y]);return R.useMemo(()=>({...u,update:W,refs:j,elements:_,floatingStyles:N}),[u,W,j,_,N])}const gS=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:o}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?Hc({element:r.current,padding:o}).fn(n):{}:r?Hc({element:r,padding:o}).fn(n):{}}}},mS=(e,t)=>({...aS(e),options:[e,t]}),vS=(e,t)=>({...lS(e),options:[e,t]}),yS=(e,t)=>({...fS(e),options:[e,t]}),wS=(e,t)=>({...cS(e),options:[e,t]}),xS=(e,t)=>({...uS(e),options:[e,t]}),bS=(e,t)=>({...dS(e),options:[e,t]}),SS=(e,t)=>({...gS(e),options:[e,t]});var CS="Arrow",bh=R.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...s}=e;return v.jsx(ce.svg,{...s,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:v.jsx("polygon",{points:"0,0 30,0 15,10"})})});bh.displayName=CS;var RS=bh;function DS(e){const[t,n]=R.useState(void 0);return je(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const s=o[0];let i,a;if("borderBoxSize"in s){const l=s.borderBoxSize,c=Array.isArray(l)?l[0]:l;i=c.inlineSize,a=c.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var Ka="Popper",[Sh,en]=Qt(Ka),[TS,Ch]=Sh(Ka),Rh=e=>{const{__scopePopper:t,children:n}=e,[r,o]=R.useState(null);return v.jsx(TS,{scope:t,anchor:r,onAnchorChange:o,children:n})};Rh.displayName=Ka;var Dh="PopperAnchor",Th=R.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,s=Ch(Dh,n),i=R.useRef(null),a=pe(t,i);return R.useEffect(()=>{s.onAnchorChange((r==null?void 0:r.current)||i.current)}),r?null:v.jsx(ce.div,{...o,ref:a})});Th.displayName=Dh;var Ya="PopperContent",[MS,PS]=Sh(Ya),Mh=R.forwardRef((e,t)=>{var B,K,X,G,ne,z;const{__scopePopper:n,side:r="bottom",sideOffset:o=0,align:s="center",alignOffset:i=0,arrowPadding:a=0,avoidCollisions:l=!0,collisionBoundary:c=[],collisionPadding:u=0,sticky:d="partial",hideWhenDetached:f=!1,updatePositionStrategy:h="optimized",onPlaced:m,...p}=e,b=Ch(Ya,n),[y,g]=R.useState(null),w=pe(t,le=>g(le)),[C,x]=R.useState(null),M=DS(C),S=(M==null?void 0:M.width)??0,D=(M==null?void 0:M.height)??0,P=r+(s!=="center"?"-"+s:""),E=typeof u=="number"?u:{top:0,right:0,bottom:0,left:0,...u},A=Array.isArray(c)?c:[c],F=A.length>0,W={padding:E,boundary:A.filter(AS),altBoundary:F},{refs:L,floatingStyles:j,placement:_,isPositioned:N,middlewareData:O}=pS({strategy:"fixed",placement:P,whileElementsMounted:(...le)=>iS(...le,{animationFrame:h==="always"}),elements:{reference:b.anchor},middleware:[mS({mainAxis:o+D,alignmentAxis:i}),l&&vS({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?yS():void 0,...W}),l&&wS({...W}),xS({...W,apply:({elements:le,rects:me,availableWidth:Ie,availableHeight:Ee})=>{const{width:ct,height:J}=me.reference,ue=le.floating.style;ue.setProperty("--radix-popper-available-width",`${Ie}px`),ue.setProperty("--radix-popper-available-height",`${Ee}px`),ue.setProperty("--radix-popper-anchor-width",`${ct}px`),ue.setProperty("--radix-popper-anchor-height",`${J}px`)}}),C&&SS({element:C,padding:a}),OS({arrowWidth:S,arrowHeight:D}),f&&bS({strategy:"referenceHidden",...W})]}),[V,k]=Ah(_),I=et(m);je(()=>{N&&(I==null||I())},[N,I]);const $=(B=O.arrow)==null?void 0:B.x,H=(K=O.arrow)==null?void 0:K.y,U=((X=O.arrow)==null?void 0:X.centerOffset)!==0,[Z,q]=R.useState();return je(()=>{y&&q(window.getComputedStyle(y).zIndex)},[y]),v.jsx("div",{ref:L.setFloating,"data-radix-popper-content-wrapper":"",style:{...j,transform:N?j.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Z,"--radix-popper-transform-origin":[(G=O.transformOrigin)==null?void 0:G.x,(ne=O.transformOrigin)==null?void 0:ne.y].join(" "),...((z=O.hide)==null?void 0:z.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:v.jsx(MS,{scope:n,placedSide:V,onArrowChange:x,arrowX:$,arrowY:H,shouldHideArrow:U,children:v.jsx(ce.div,{"data-side":V,"data-align":k,...p,ref:w,style:{...p.style,animation:N?void 0:"none"}})})})});Mh.displayName=Ya;var Ph="PopperArrow",ES={top:"bottom",right:"left",bottom:"top",left:"right"},Eh=R.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,s=PS(Ph,r),i=ES[s.placedSide];return v.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:v.jsx(RS,{...o,ref:n,style:{...o.style,display:"block"}})})});Eh.displayName=Ph;function AS(e){return e!==null}var OS=e=>({name:"transformOrigin",options:e,fn(t){var b,y,g;const{placement:n,rects:r,middlewareData:o}=t,i=((b=o.arrow)==null?void 0:b.centerOffset)!==0,a=i?0:e.arrowWidth,l=i?0:e.arrowHeight,[c,u]=Ah(n),d={start:"0%",center:"50%",end:"100%"}[u],f=(((y=o.arrow)==null?void 0:y.x)??0)+a/2,h=(((g=o.arrow)==null?void 0:g.y)??0)+l/2;let m="",p="";return c==="bottom"?(m=i?d:`${f}px`,p=`${-l}px`):c==="top"?(m=i?d:`${f}px`,p=`${r.floating.height+l}px`):c==="right"?(m=`${-l}px`,p=i?d:`${h}px`):c==="left"&&(m=`${r.floating.width+l}px`,p=i?d:`${h}px`),{data:{x:m,y:p}}}});function Ah(e){const[t,n="center"]=e.split("-");return[t,n]}var ys=Rh,Zr=Th,ws=Mh,xs=Eh,_S="Portal",Jr=R.forwardRef((e,t)=>{var a;const{container:n,...r}=e,[o,s]=R.useState(!1);je(()=>s(!0),[]);const i=n||o&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return i?Ct.createPortal(v.jsx(ce.div,{...r,ref:t}),i):null});Jr.displayName=_S;function kS(e,t){return R.useReducer((n,r)=>t[n][r]??n,e)}var Ot=e=>{const{present:t,children:n}=e,r=IS(t),o=typeof n=="function"?n({present:r.isPresent}):R.Children.only(n),s=pe(r.ref,NS(o));return typeof n=="function"||r.isPresent?R.cloneElement(o,{ref:s}):null};Ot.displayName="Presence";function IS(e){const[t,n]=R.useState(),r=R.useRef({}),o=R.useRef(e),s=R.useRef("none"),i=e?"mounted":"unmounted",[a,l]=kS(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return R.useEffect(()=>{const c=ho(r.current);s.current=a==="mounted"?c:"none"},[a]),je(()=>{const c=r.current,u=o.current;if(u!==e){const f=s.current,h=ho(c);e?l("MOUNT"):h==="none"||(c==null?void 0:c.display)==="none"?l("UNMOUNT"):l(u&&f!==h?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,l]),je(()=>{if(t){let c;const u=t.ownerDocument.defaultView??window,d=h=>{const p=ho(r.current).includes(h.animationName);if(h.target===t&&p&&(l("ANIMATION_END"),!o.current)){const b=t.style.animationFillMode;t.style.animationFillMode="forwards",c=u.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=b)})}},f=h=>{h.target===t&&(s.current=ho(r.current))};return t.addEventListener("animationstart",f),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{u.clearTimeout(c),t.removeEventListener("animationstart",f),t.removeEventListener("animationcancel",d),t.removeEventListener("animationend",d)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:R.useCallback(c=>{c&&(r.current=getComputedStyle(c)),n(c)},[])}}function ho(e){return(e==null?void 0:e.animationName)||"none"}function NS(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function vn({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,o]=jS({defaultProp:t,onChange:n}),s=e!==void 0,i=s?e:r,a=et(n),l=R.useCallback(c=>{if(s){const d=typeof c=="function"?c(e):c;d!==e&&a(d)}else o(c)},[s,e,o,a]);return[i,l]}function jS({defaultProp:e,onChange:t}){const n=R.useState(e),[r]=n,o=R.useRef(r),s=et(t);return R.useEffect(()=>{o.current!==r&&(s(r),o.current=r)},[r,o,s]),n}var FS="VisuallyHidden",qa=R.forwardRef((e,t)=>v.jsx(ce.span,{...e,ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}}));qa.displayName=FS;var VS=qa,[bs,b_]=Qt("Tooltip",[en]),Ss=en(),Oh="TooltipProvider",LS=700,Gi="tooltip.open",[$S,Xa]=bs(Oh),_h=e=>{const{__scopeTooltip:t,delayDuration:n=LS,skipDelayDuration:r=300,disableHoverableContent:o=!1,children:s}=e,i=R.useRef(!0),a=R.useRef(!1),l=R.useRef(0);return R.useEffect(()=>{const c=l.current;return()=>window.clearTimeout(c)},[]),v.jsx($S,{scope:t,isOpenDelayedRef:i,delayDuration:n,onOpen:R.useCallback(()=>{window.clearTimeout(l.current),i.current=!1},[]),onClose:R.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(()=>i.current=!0,r)},[r]),isPointerInTransitRef:a,onPointerInTransitChange:R.useCallback(c=>{a.current=c},[]),disableHoverableContent:o,children:s})};_h.displayName=Oh;var Cs="Tooltip",[BS,Qr]=bs(Cs),kh=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:o=!1,onOpenChange:s,disableHoverableContent:i,delayDuration:a}=e,l=Xa(Cs,e.__scopeTooltip),c=Ss(t),[u,d]=R.useState(null),f=Ut(),h=R.useRef(0),m=i??l.disableHoverableContent,p=a??l.delayDuration,b=R.useRef(!1),[y=!1,g]=vn({prop:r,defaultProp:o,onChange:S=>{S?(l.onOpen(),document.dispatchEvent(new CustomEvent(Gi))):l.onClose(),s==null||s(S)}}),w=R.useMemo(()=>y?b.current?"delayed-open":"instant-open":"closed",[y]),C=R.useCallback(()=>{window.clearTimeout(h.current),h.current=0,b.current=!1,g(!0)},[g]),x=R.useCallback(()=>{window.clearTimeout(h.current),h.current=0,g(!1)},[g]),M=R.useCallback(()=>{window.clearTimeout(h.current),h.current=window.setTimeout(()=>{b.current=!0,g(!0),h.current=0},p)},[p,g]);return R.useEffect(()=>()=>{h.current&&(window.clearTimeout(h.current),h.current=0)},[]),v.jsx(ys,{...c,children:v.jsx(BS,{scope:t,contentId:f,open:y,stateAttribute:w,trigger:u,onTriggerChange:d,onTriggerEnter:R.useCallback(()=>{l.isOpenDelayedRef.current?M():C()},[l.isOpenDelayedRef,M,C]),onTriggerLeave:R.useCallback(()=>{m?x():(window.clearTimeout(h.current),h.current=0)},[x,m]),onOpen:C,onClose:x,disableHoverableContent:m,children:n})})};kh.displayName=Cs;var Ki="TooltipTrigger",Ih=R.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=Qr(Ki,n),s=Xa(Ki,n),i=Ss(n),a=R.useRef(null),l=pe(t,a,o.onTriggerChange),c=R.useRef(!1),u=R.useRef(!1),d=R.useCallback(()=>c.current=!1,[]);return R.useEffect(()=>()=>document.removeEventListener("pointerup",d),[d]),v.jsx(Zr,{asChild:!0,...i,children:v.jsx(ce.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...r,ref:l,onPointerMove:te(e.onPointerMove,f=>{f.pointerType!=="touch"&&!u.current&&!s.isPointerInTransitRef.current&&(o.onTriggerEnter(),u.current=!0)}),onPointerLeave:te(e.onPointerLeave,()=>{o.onTriggerLeave(),u.current=!1}),onPointerDown:te(e.onPointerDown,()=>{o.open&&o.onClose(),c.current=!0,document.addEventListener("pointerup",d,{once:!0})}),onFocus:te(e.onFocus,()=>{c.current||o.onOpen()}),onBlur:te(e.onBlur,o.onClose),onClick:te(e.onClick,o.onClose)})})});Ih.displayName=Ki;var Za="TooltipPortal",[zS,HS]=bs(Za,{forceMount:void 0}),Nh=e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:o}=e,s=Qr(Za,t);return v.jsx(zS,{scope:t,forceMount:n,children:v.jsx(Ot,{present:n||s.open,children:v.jsx(Jr,{asChild:!0,container:o,children:r})})})};Nh.displayName=Za;var $n="TooltipContent",jh=R.forwardRef((e,t)=>{const n=HS($n,e.__scopeTooltip),{forceMount:r=n.forceMount,side:o="top",...s}=e,i=Qr($n,e.__scopeTooltip);return v.jsx(Ot,{present:r||i.open,children:i.disableHoverableContent?v.jsx(Fh,{side:o,...s,ref:t}):v.jsx(WS,{side:o,...s,ref:t})})}),WS=R.forwardRef((e,t)=>{const n=Qr($n,e.__scopeTooltip),r=Xa($n,e.__scopeTooltip),o=R.useRef(null),s=pe(t,o),[i,a]=R.useState(null),{trigger:l,onClose:c}=n,u=o.current,{onPointerInTransitChange:d}=r,f=R.useCallback(()=>{a(null),d(!1)},[d]),h=R.useCallback((m,p)=>{const b=m.currentTarget,y={x:m.clientX,y:m.clientY},g=qS(y,b.getBoundingClientRect()),w=XS(y,g),C=ZS(p.getBoundingClientRect()),x=QS([...w,...C]);a(x),d(!0)},[d]);return R.useEffect(()=>()=>f(),[f]),R.useEffect(()=>{if(l&&u){const m=b=>h(b,u),p=b=>h(b,l);return l.addEventListener("pointerleave",m),u.addEventListener("pointerleave",p),()=>{l.removeEventListener("pointerleave",m),u.removeEventListener("pointerleave",p)}}},[l,u,h,f]),R.useEffect(()=>{if(i){const m=p=>{const b=p.target,y={x:p.clientX,y:p.clientY},g=(l==null?void 0:l.contains(b))||(u==null?void 0:u.contains(b)),w=!JS(y,i);g?f():w&&(f(),c())};return document.addEventListener("pointermove",m),()=>document.removeEventListener("pointermove",m)}},[l,u,i,c,f]),v.jsx(Fh,{...e,ref:s})}),[US,GS]=bs(Cs,{isInside:!1}),KS=cb("TooltipContent"),Fh=R.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":o,onEscapeKeyDown:s,onPointerDownOutside:i,...a}=e,l=Qr($n,n),c=Ss(n),{onClose:u}=l;return R.useEffect(()=>(document.addEventListener(Gi,u),()=>document.removeEventListener(Gi,u)),[u]),R.useEffect(()=>{if(l.trigger){const d=f=>{const h=f.target;h!=null&&h.contains(l.trigger)&&u()};return window.addEventListener("scroll",d,{capture:!0}),()=>window.removeEventListener("scroll",d,{capture:!0})}},[l.trigger,u]),v.jsx(qr,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:d=>d.preventDefault(),onDismiss:u,children:v.jsxs(ws,{"data-state":l.stateAttribute,...c,...a,ref:t,style:{...a.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[v.jsx(KS,{children:r}),v.jsx(US,{scope:n,isInside:!0,children:v.jsx(VS,{id:l.contentId,role:"tooltip",children:o||r})})]})})});jh.displayName=$n;var Vh="TooltipArrow",YS=R.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=Ss(n);return GS(Vh,n).isInside?null:v.jsx(xs,{...o,...r,ref:t})});YS.displayName=Vh;function qS(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),s=Math.abs(t.left-e.x);switch(Math.min(n,r,o,s)){case s:return"left";case o:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function XS(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function ZS(e){const{top:t,right:n,bottom:r,left:o}=e;return[{x:o,y:t},{x:n,y:t},{x:n,y:r},{x:o,y:r}]}function JS(e,t){const{x:n,y:r}=e;let o=!1;for(let s=0,i=t.length-1;s<t.length;i=s++){const a=t[s].x,l=t[s].y,c=t[i].x,u=t[i].y;l>r!=u>r&&n<(c-a)*(r-l)/(u-l)+a&&(o=!o)}return o}function QS(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),e0(t)}function e0(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const o=e[r];for(;t.length>=2;){const s=t[t.length-1],i=t[t.length-2];if((s.x-i.x)*(o.y-i.y)>=(s.y-i.y)*(o.x-i.x))t.pop();else break}t.push(o)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const o=e[r];for(;n.length>=2;){const s=n[n.length-1],i=n[n.length-2];if((s.x-i.x)*(o.y-i.y)>=(s.y-i.y)*(o.x-i.x))n.pop();else break}n.push(o)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var t0=_h,n0=kh,r0=Ih,o0=Nh,s0=jh;function Ja({delayDuration:e=0,...t}){return v.jsx(t0,{"data-slot":"tooltip-provider",delayDuration:e,...t})}function Lh({...e}){return v.jsx(Ja,{children:v.jsx(n0,{"data-slot":"tooltip",...e})})}function $h({...e}){return v.jsx(r0,{"data-slot":"tooltip-trigger",...e})}function Bh({className:e,sideOffset:t=0,children:n,...r}){return v.jsx(o0,{children:v.jsx(s0,{"data-slot":"tooltip-content",sideOffset:t,className:he("bg-primary text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",e),...r,children:n})})}const Qa=({children:e,content:t})=>v.jsx(Ja,{children:v.jsxs(Lh,{children:[v.jsx($h,{asChild:!0,children:e}),v.jsx(Bh,{sideOffset:3,side:"bottom",className:"border border-input bg-popover px-2 py-1 text-xs text-muted-foreground z-100",children:t})]})}),Uc=e=>Symbol.iterator in e,Gc=e=>"entries"in e,Kc=(e,t)=>{const n=e instanceof Map?e:new Map(e.entries()),r=t instanceof Map?t:new Map(t.entries());if(n.size!==r.size)return!1;for(const[o,s]of n)if(!Object.is(s,r.get(o)))return!1;return!0},i0=(e,t)=>{const n=e[Symbol.iterator](),r=t[Symbol.iterator]();let o=n.next(),s=r.next();for(;!o.done&&!s.done;){if(!Object.is(o.value,s.value))return!1;o=n.next(),s=r.next()}return!!o.done&&!!s.done};function a0(e,t){return Object.is(e,t)?!0:typeof e!="object"||e===null||typeof t!="object"||t===null?!1:!Uc(e)||!Uc(t)?Kc({entries:()=>Object.entries(e)},{entries:()=>Object.entries(t)}):Gc(e)&&Gc(t)?Kc(e,t):i0(e,t)}function el(e){const t=T.useRef(void 0);return n=>{const r=e(n);return a0(t.current,r)?t.current:t.current=r}}function tl(e){const t=e+"CollectionProvider",[n,r]=Qt(t),[o,s]=n(t,{collectionRef:{current:null},itemMap:new Map}),i=p=>{const{scope:b,children:y}=p,g=T.useRef(null),w=T.useRef(new Map).current;return v.jsx(o,{scope:b,itemMap:w,collectionRef:g,children:y})};i.displayName=t;const a=e+"CollectionSlot",l=gn(a),c=T.forwardRef((p,b)=>{const{scope:y,children:g}=p,w=s(a,y),C=pe(b,w.collectionRef);return v.jsx(l,{ref:C,children:g})});c.displayName=a;const u=e+"CollectionItemSlot",d="data-radix-collection-item",f=gn(u),h=T.forwardRef((p,b)=>{const{scope:y,children:g,...w}=p,C=T.useRef(null),x=pe(b,C),M=s(u,y);return T.useEffect(()=>(M.itemMap.set(C,{ref:C,...w}),()=>void M.itemMap.delete(C))),v.jsx(f,{[d]:"",ref:x,children:g})});h.displayName=u;function m(p){const b=s(e+"CollectionConsumer",p);return T.useCallback(()=>{const g=b.collectionRef.current;if(!g)return[];const w=Array.from(g.querySelectorAll(`[${d}]`));return Array.from(b.itemMap.values()).sort((M,S)=>w.indexOf(M.ref.current)-w.indexOf(S.ref.current))},[b.collectionRef,b.itemMap])}return[{Provider:i,Slot:c,ItemSlot:h},m,r]}var l0=R.createContext(void 0);function nl(e){const t=R.useContext(l0);return e||t||"ltr"}var Js=0;function rl(){R.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Yc()),document.body.insertAdjacentElement("beforeend",e[1]??Yc()),Js++,()=>{Js===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Js--}},[])}function Yc(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Qs="focusScope.autoFocusOnMount",ei="focusScope.autoFocusOnUnmount",qc={bubbles:!1,cancelable:!0},c0="FocusScope",Rs=R.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:s,...i}=e,[a,l]=R.useState(null),c=et(o),u=et(s),d=R.useRef(null),f=pe(t,p=>l(p)),h=R.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;R.useEffect(()=>{if(r){let p=function(w){if(h.paused||!a)return;const C=w.target;a.contains(C)?d.current=C:$t(d.current,{select:!0})},b=function(w){if(h.paused||!a)return;const C=w.relatedTarget;C!==null&&(a.contains(C)||$t(d.current,{select:!0}))},y=function(w){if(document.activeElement===document.body)for(const x of w)x.removedNodes.length>0&&$t(a)};document.addEventListener("focusin",p),document.addEventListener("focusout",b);const g=new MutationObserver(y);return a&&g.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",p),document.removeEventListener("focusout",b),g.disconnect()}}},[r,a,h.paused]),R.useEffect(()=>{if(a){Zc.add(h);const p=document.activeElement;if(!a.contains(p)){const y=new CustomEvent(Qs,qc);a.addEventListener(Qs,c),a.dispatchEvent(y),y.defaultPrevented||(u0(g0(zh(a)),{select:!0}),document.activeElement===p&&$t(a))}return()=>{a.removeEventListener(Qs,c),setTimeout(()=>{const y=new CustomEvent(ei,qc);a.addEventListener(ei,u),a.dispatchEvent(y),y.defaultPrevented||$t(p??document.body,{select:!0}),a.removeEventListener(ei,u),Zc.remove(h)},0)}}},[a,c,u,h]);const m=R.useCallback(p=>{if(!n&&!r||h.paused)return;const b=p.key==="Tab"&&!p.altKey&&!p.ctrlKey&&!p.metaKey,y=document.activeElement;if(b&&y){const g=p.currentTarget,[w,C]=d0(g);w&&C?!p.shiftKey&&y===C?(p.preventDefault(),n&&$t(w,{select:!0})):p.shiftKey&&y===w&&(p.preventDefault(),n&&$t(C,{select:!0})):y===g&&p.preventDefault()}},[n,r,h.paused]);return v.jsx(ce.div,{tabIndex:-1,...i,ref:f,onKeyDown:m})});Rs.displayName=c0;function u0(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if($t(r,{select:t}),document.activeElement!==n)return}function d0(e){const t=zh(e),n=Xc(t,e),r=Xc(t.reverse(),e);return[n,r]}function zh(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Xc(e,t){for(const n of e)if(!f0(n,{upTo:t}))return n}function f0(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function h0(e){return e instanceof HTMLInputElement&&"select"in e}function $t(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&h0(e)&&t&&e.select()}}var Zc=p0();function p0(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=Jc(e,t),e.unshift(t)},remove(t){var n;e=Jc(e,t),(n=e[0])==null||n.resume()}}}function Jc(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function g0(e){return e.filter(t=>t.tagName!=="A")}var ti="rovingFocusGroup.onEntryFocus",m0={bubbles:!1,cancelable:!0},Ds="RovingFocusGroup",[Yi,Hh,v0]=tl(Ds),[y0,Wh]=Qt(Ds,[v0]),[w0,x0]=y0(Ds),Uh=R.forwardRef((e,t)=>v.jsx(Yi.Provider,{scope:e.__scopeRovingFocusGroup,children:v.jsx(Yi.Slot,{scope:e.__scopeRovingFocusGroup,children:v.jsx(b0,{...e,ref:t})})}));Uh.displayName=Ds;var b0=R.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:s,currentTabStopId:i,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:l,onEntryFocus:c,preventScrollOnEntryFocus:u=!1,...d}=e,f=R.useRef(null),h=pe(t,f),m=nl(s),[p=null,b]=vn({prop:i,defaultProp:a,onChange:l}),[y,g]=R.useState(!1),w=et(c),C=Hh(n),x=R.useRef(!1),[M,S]=R.useState(0);return R.useEffect(()=>{const D=f.current;if(D)return D.addEventListener(ti,w),()=>D.removeEventListener(ti,w)},[w]),v.jsx(w0,{scope:n,orientation:r,dir:m,loop:o,currentTabStopId:p,onItemFocus:R.useCallback(D=>b(D),[b]),onItemShiftTab:R.useCallback(()=>g(!0),[]),onFocusableItemAdd:R.useCallback(()=>S(D=>D+1),[]),onFocusableItemRemove:R.useCallback(()=>S(D=>D-1),[]),children:v.jsx(ce.div,{tabIndex:y||M===0?-1:0,"data-orientation":r,...d,ref:h,style:{outline:"none",...e.style},onMouseDown:te(e.onMouseDown,()=>{x.current=!0}),onFocus:te(e.onFocus,D=>{const P=!x.current;if(D.target===D.currentTarget&&P&&!y){const E=new CustomEvent(ti,m0);if(D.currentTarget.dispatchEvent(E),!E.defaultPrevented){const A=C().filter(_=>_.focusable),F=A.find(_=>_.active),W=A.find(_=>_.id===p),j=[F,W,...A].filter(Boolean).map(_=>_.ref.current);Yh(j,u)}}x.current=!1}),onBlur:te(e.onBlur,()=>g(!1))})})}),Gh="RovingFocusGroupItem",Kh=R.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:s,...i}=e,a=Ut(),l=s||a,c=x0(Gh,n),u=c.currentTabStopId===l,d=Hh(n),{onFocusableItemAdd:f,onFocusableItemRemove:h}=c;return R.useEffect(()=>{if(r)return f(),()=>h()},[r,f,h]),v.jsx(Yi.ItemSlot,{scope:n,id:l,focusable:r,active:o,children:v.jsx(ce.span,{tabIndex:u?0:-1,"data-orientation":c.orientation,...i,ref:t,onMouseDown:te(e.onMouseDown,m=>{r?c.onItemFocus(l):m.preventDefault()}),onFocus:te(e.onFocus,()=>c.onItemFocus(l)),onKeyDown:te(e.onKeyDown,m=>{if(m.key==="Tab"&&m.shiftKey){c.onItemShiftTab();return}if(m.target!==m.currentTarget)return;const p=R0(m,c.orientation,c.dir);if(p!==void 0){if(m.metaKey||m.ctrlKey||m.altKey||m.shiftKey)return;m.preventDefault();let y=d().filter(g=>g.focusable).map(g=>g.ref.current);if(p==="last")y.reverse();else if(p==="prev"||p==="next"){p==="prev"&&y.reverse();const g=y.indexOf(m.currentTarget);y=c.loop?D0(y,g+1):y.slice(g+1)}setTimeout(()=>Yh(y))}})})})});Kh.displayName=Gh;var S0={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function C0(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function R0(e,t,n){const r=C0(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return S0[r]}function Yh(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function D0(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var T0=Uh,M0=Kh,P0=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Tn=new WeakMap,po=new WeakMap,go={},ni=0,qh=function(e){return e&&(e.host||qh(e.parentNode))},E0=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=qh(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},A0=function(e,t,n,r){var o=E0(t,Array.isArray(e)?e:[e]);go[n]||(go[n]=new WeakMap);var s=go[n],i=[],a=new Set,l=new Set(o),c=function(d){!d||a.has(d)||(a.add(d),c(d.parentNode))};o.forEach(c);var u=function(d){!d||l.has(d)||Array.prototype.forEach.call(d.children,function(f){if(a.has(f))u(f);else try{var h=f.getAttribute(r),m=h!==null&&h!=="false",p=(Tn.get(f)||0)+1,b=(s.get(f)||0)+1;Tn.set(f,p),s.set(f,b),i.push(f),p===1&&m&&po.set(f,!0),b===1&&f.setAttribute(n,"true"),m||f.setAttribute(r,"true")}catch(y){console.error("aria-hidden: cannot operate on ",f,y)}})};return u(t),a.clear(),ni++,function(){i.forEach(function(d){var f=Tn.get(d)-1,h=s.get(d)-1;Tn.set(d,f),s.set(d,h),f||(po.has(d)||d.removeAttribute(r),po.delete(d)),h||d.removeAttribute(n)}),ni--,ni||(Tn=new WeakMap,Tn=new WeakMap,po=new WeakMap,go={})}},ol=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=P0(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live]"))),A0(r,o,n,"aria-hidden")):function(){return null}},ht=function(){return ht=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(t[s]=n[s])}return t},ht.apply(this,arguments)};function Xh(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function O0(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,s;r<o;r++)(s||!(r in t))&&(s||(s=Array.prototype.slice.call(t,0,r)),s[r]=t[r]);return e.concat(s||Array.prototype.slice.call(t))}var Io="right-scroll-bar-position",No="width-before-scroll-bar",_0="with-scroll-bars-hidden",k0="--removed-body-scroll-bar-size";function ri(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function I0(e,t){var n=T.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=t,n.facade}var N0=typeof window<"u"?R.useLayoutEffect:R.useEffect,Qc=new WeakMap;function j0(e,t){var n=I0(null,function(r){return e.forEach(function(o){return ri(o,r)})});return N0(function(){var r=Qc.get(n);if(r){var o=new Set(r),s=new Set(e),i=n.current;o.forEach(function(a){s.has(a)||ri(a,null)}),s.forEach(function(a){o.has(a)||ri(a,i)})}Qc.set(n,e)},[e]),n}function F0(e){return e}function V0(e,t){t===void 0&&(t=F0);var n=[],r=!1,o={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(s){var i=t(s,r);return n.push(i),function(){n=n.filter(function(a){return a!==i})}},assignSyncMedium:function(s){for(r=!0;n.length;){var i=n;n=[],i.forEach(s)}n={push:function(a){return s(a)},filter:function(){return n}}},assignMedium:function(s){r=!0;var i=[];if(n.length){var a=n;n=[],a.forEach(s),i=n}var l=function(){var u=i;i=[],u.forEach(s)},c=function(){return Promise.resolve().then(l)};c(),n={push:function(u){i.push(u),c()},filter:function(u){return i=i.filter(u),n}}}};return o}function L0(e){e===void 0&&(e={});var t=V0(null);return t.options=ht({async:!0,ssr:!1},e),t}var Zh=function(e){var t=e.sideCar,n=Xh(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return R.createElement(r,ht({},n))};Zh.isSideCarExport=!0;function $0(e,t){return e.useMedium(t),Zh}var Jh=L0(),oi=function(){},Ts=R.forwardRef(function(e,t){var n=R.useRef(null),r=R.useState({onScrollCapture:oi,onWheelCapture:oi,onTouchMoveCapture:oi}),o=r[0],s=r[1],i=e.forwardProps,a=e.children,l=e.className,c=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,h=e.noIsolation,m=e.inert,p=e.allowPinchZoom,b=e.as,y=b===void 0?"div":b,g=e.gapMode,w=Xh(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),C=f,x=j0([n,t]),M=ht(ht({},w),o);return R.createElement(R.Fragment,null,u&&R.createElement(C,{sideCar:Jh,removeScrollBar:c,shards:d,noIsolation:h,inert:m,setCallbacks:s,allowPinchZoom:!!p,lockRef:n,gapMode:g}),i?R.cloneElement(R.Children.only(a),ht(ht({},M),{ref:x})):R.createElement(y,ht({},M,{className:l,ref:x}),a))});Ts.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Ts.classNames={fullWidth:No,zeroRight:Io};var B0=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function z0(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=B0();return t&&e.setAttribute("nonce",t),e}function H0(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function W0(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var U0=function(){var e=0,t=null;return{add:function(n){e==0&&(t=z0())&&(H0(t,n),W0(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},G0=function(){var e=U0();return function(t,n){R.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Qh=function(){var e=G0(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},K0={left:0,top:0,right:0,gap:0},si=function(e){return parseInt(e||"",10)||0},Y0=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[si(n),si(r),si(o)]},q0=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return K0;var t=Y0(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},X0=Qh(),Vn="data-scroll-locked",Z0=function(e,t,n,r){var o=e.left,s=e.top,i=e.right,a=e.gap;return n===void 0&&(n="margin"),`
|
|
130
|
-
.`.concat(
|
|
129
|
+
*/const Ax=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Ox=Ce("X",Ax),Ac=e=>Symbol.iterator in e,Oc=e=>"entries"in e,_c=(e,t)=>{const n=e instanceof Map?e:new Map(e.entries()),r=t instanceof Map?t:new Map(t.entries());if(n.size!==r.size)return!1;for(const[o,s]of n)if(!Object.is(s,r.get(o)))return!1;return!0},_x=(e,t)=>{const n=e[Symbol.iterator](),r=t[Symbol.iterator]();let o=n.next(),s=r.next();for(;!o.done&&!s.done;){if(!Object.is(o.value,s.value))return!1;o=n.next(),s=r.next()}return!!o.done&&!!s.done};function kx(e,t){return Object.is(e,t)?!0:typeof e!="object"||e===null||typeof t!="object"||t===null?!1:!Ac(e)||!Ac(t)?_c({entries:()=>Object.entries(e)},{entries:()=>Object.entries(t)}):Oc(e)&&Oc(t)?_c(e,t):_x(e,t)}function ms(e){const t=R.useRef(void 0);return n=>{const r=e(n);return kx(t.current,r)?t.current:t.current=r}}function ne(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e==null||e(o),n===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function kc(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function vs(...e){return t=>{let n=!1;const r=e.map(o=>{const s=kc(o,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let o=0;o<r.length;o++){const s=r[o];typeof s=="function"?s():kc(e[o],null)}}}}function ge(...e){return T.useCallback(vs(...e),e)}function rn(e,t=[]){let n=[];function r(s,i){const a=T.createContext(i),l=n.length;n=[...n,i];const c=d=>{var w;const{scope:p,children:f,...g}=d,h=((w=p==null?void 0:p[e])==null?void 0:w[l])||a,b=T.useMemo(()=>g,Object.values(g));return y.jsx(h.Provider,{value:b,children:f})};c.displayName=s+"Provider";function u(d,p){var h;const f=((h=p==null?void 0:p[e])==null?void 0:h[l])||a,g=T.useContext(f);if(g)return g;if(i!==void 0)return i;throw new Error(`\`${d}\` must be used within \`${s}\``)}return[c,u]}const o=()=>{const s=n.map(i=>T.createContext(i));return function(a){const l=(a==null?void 0:a[e])||s;return T.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return o.scopeName=e,[r,Ix(o,...t)]}function Ix(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(s){const i=r.reduce((a,{useScope:l,scopeName:c})=>{const d=l(s)[`__scope${c}`];return{...a,...d}},{});return T.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return n.scopeName=t.scopeName,n}function rt(e){const t=T.useRef(e);return T.useEffect(()=>{t.current=e}),T.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function yn({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,o]=Nx({defaultProp:t,onChange:n}),s=e!==void 0,i=s?e:r,a=rt(n),l=T.useCallback(c=>{if(s){const d=typeof c=="function"?c(e):c;d!==e&&a(d)}else o(c)},[s,e,o,a]);return[i,l]}function Nx({defaultProp:e,onChange:t}){const n=T.useState(e),[r]=n,o=T.useRef(r),s=rt(t);return T.useEffect(()=>{o.current!==r&&(s(r),o.current=r)},[r,o,s]),n}function wn(e){const t=Fx(e),n=T.forwardRef((r,o)=>{const{children:s,...i}=r,a=T.Children.toArray(s),l=a.find(Lx);if(l){const c=l.props.children,u=a.map(d=>d===l?T.Children.count(c)>1?T.Children.only(null):T.isValidElement(c)?c.props.children:null:d);return y.jsx(t,{...i,ref:o,children:T.isValidElement(c)?T.cloneElement(c,void 0,u):null})}return y.jsx(t,{...i,ref:o,children:s})});return n.displayName=`${e}.Slot`,n}var jx=wn("Slot");function Fx(e){const t=T.forwardRef((n,r)=>{const{children:o,...s}=n;if(T.isValidElement(o)){const i=Bx(o),a=$x(s,o.props);return o.type!==T.Fragment&&(a.ref=r?vs(r,i):i),T.cloneElement(o,a)}return T.Children.count(o)>1?T.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Jf=Symbol("radix.slottable");function Vx(e){const t=({children:n})=>y.jsx(y.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=Jf,t}function Lx(e){return T.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Jf}function $x(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...a)=>{s(...a),o(...a)}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function Bx(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var zx=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],ce=zx.reduce((e,t)=>{const n=wn(`Primitive.${t}`),r=T.forwardRef((o,s)=>{const{asChild:i,...a}=o,l=i?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),y.jsx(l,{...a,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Qf(e,t){e&&ls.flushSync(()=>e.dispatchEvent(t))}function Wa(e){const t=e+"CollectionProvider",[n,r]=rn(t),[o,s]=n(t,{collectionRef:{current:null},itemMap:new Map}),i=h=>{const{scope:b,children:w}=h,v=R.useRef(null),m=R.useRef(new Map).current;return y.jsx(o,{scope:b,itemMap:m,collectionRef:v,children:w})};i.displayName=t;const a=e+"CollectionSlot",l=wn(a),c=R.forwardRef((h,b)=>{const{scope:w,children:v}=h,m=s(a,w),C=ge(b,m.collectionRef);return y.jsx(l,{ref:C,children:v})});c.displayName=a;const u=e+"CollectionItemSlot",d="data-radix-collection-item",p=wn(u),f=R.forwardRef((h,b)=>{const{scope:w,children:v,...m}=h,C=R.useRef(null),x=ge(b,C),D=s(u,w);return R.useEffect(()=>(D.itemMap.set(C,{ref:C,...m}),()=>void D.itemMap.delete(C))),y.jsx(p,{[d]:"",ref:x,children:v})});f.displayName=u;function g(h){const b=s(e+"CollectionConsumer",h);return R.useCallback(()=>{const v=b.collectionRef.current;if(!v)return[];const m=Array.from(v.querySelectorAll(`[${d}]`));return Array.from(b.itemMap.values()).sort((D,S)=>m.indexOf(D.ref.current)-m.indexOf(S.ref.current))},[b.collectionRef,b.itemMap])}return[{Provider:i,Slot:c,ItemSlot:f},g,r]}var Hx=T.createContext(void 0);function Ua(e){const t=T.useContext(Hx);return e||t||"ltr"}function Wx(e,t=globalThis==null?void 0:globalThis.document){const n=rt(e);T.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var Ux="DismissableLayer",Wi="dismissableLayer.update",Gx="dismissableLayer.pointerDownOutside",Yx="dismissableLayer.focusOutside",Ic,ep=T.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),eo=T.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:s,onInteractOutside:i,onDismiss:a,...l}=e,c=T.useContext(ep),[u,d]=T.useState(null),p=(u==null?void 0:u.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,f]=T.useState({}),g=ge(t,S=>d(S)),h=Array.from(c.layers),[b]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),w=h.indexOf(b),v=u?h.indexOf(u):-1,m=c.layersWithOutsidePointerEventsDisabled.size>0,C=v>=w,x=Xx(S=>{const M=S.target,P=[...c.branches].some(O=>O.contains(M));!C||P||(o==null||o(S),i==null||i(S),S.defaultPrevented||a==null||a())},p),D=Zx(S=>{const M=S.target;[...c.branches].some(O=>O.contains(M))||(s==null||s(S),i==null||i(S),S.defaultPrevented||a==null||a())},p);return Wx(S=>{v===c.layers.size-1&&(r==null||r(S),!S.defaultPrevented&&a&&(S.preventDefault(),a()))},p),T.useEffect(()=>{if(u)return n&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(Ic=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(u)),c.layers.add(u),Nc(),()=>{n&&c.layersWithOutsidePointerEventsDisabled.size===1&&(p.body.style.pointerEvents=Ic)}},[u,p,n,c]),T.useEffect(()=>()=>{u&&(c.layers.delete(u),c.layersWithOutsidePointerEventsDisabled.delete(u),Nc())},[u,c]),T.useEffect(()=>{const S=()=>f({});return document.addEventListener(Wi,S),()=>document.removeEventListener(Wi,S)},[]),y.jsx(ce.div,{...l,ref:g,style:{pointerEvents:m?C?"auto":"none":void 0,...e.style},onFocusCapture:ne(e.onFocusCapture,D.onFocusCapture),onBlurCapture:ne(e.onBlurCapture,D.onBlurCapture),onPointerDownCapture:ne(e.onPointerDownCapture,x.onPointerDownCapture)})});eo.displayName=Ux;var Kx="DismissableLayerBranch",qx=T.forwardRef((e,t)=>{const n=T.useContext(ep),r=T.useRef(null),o=ge(t,r);return T.useEffect(()=>{const s=r.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),y.jsx(ce.div,{...e,ref:o})});qx.displayName=Kx;function Xx(e,t=globalThis==null?void 0:globalThis.document){const n=rt(e),r=T.useRef(!1),o=T.useRef(()=>{});return T.useEffect(()=>{const s=a=>{if(a.target&&!r.current){let l=function(){tp(Gx,n,c,{discrete:!0})};const c={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=l,t.addEventListener("click",o.current,{once:!0})):l()}else t.removeEventListener("click",o.current);r.current=!1},i=window.setTimeout(()=>{t.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",s),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function Zx(e,t=globalThis==null?void 0:globalThis.document){const n=rt(e),r=T.useRef(!1);return T.useEffect(()=>{const o=s=>{s.target&&!r.current&&tp(Yx,n,{originalEvent:s},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function Nc(){const e=new CustomEvent(Wi);document.dispatchEvent(e)}function tp(e,t,n,{discrete:r}){const o=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?Qf(o,s):o.dispatchEvent(s)}var Qs=0;function Ga(){T.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??jc()),document.body.insertAdjacentElement("beforeend",e[1]??jc()),Qs++,()=>{Qs===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Qs--}},[])}function jc(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var ei="focusScope.autoFocusOnMount",ti="focusScope.autoFocusOnUnmount",Fc={bubbles:!1,cancelable:!0},Jx="FocusScope",ys=T.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:s,...i}=e,[a,l]=T.useState(null),c=rt(o),u=rt(s),d=T.useRef(null),p=ge(t,h=>l(h)),f=T.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;T.useEffect(()=>{if(r){let h=function(m){if(f.paused||!a)return;const C=m.target;a.contains(C)?d.current=C:Wt(d.current,{select:!0})},b=function(m){if(f.paused||!a)return;const C=m.relatedTarget;C!==null&&(a.contains(C)||Wt(d.current,{select:!0}))},w=function(m){if(document.activeElement===document.body)for(const x of m)x.removedNodes.length>0&&Wt(a)};document.addEventListener("focusin",h),document.addEventListener("focusout",b);const v=new MutationObserver(w);return a&&v.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",h),document.removeEventListener("focusout",b),v.disconnect()}}},[r,a,f.paused]),T.useEffect(()=>{if(a){Lc.add(f);const h=document.activeElement;if(!a.contains(h)){const w=new CustomEvent(ei,Fc);a.addEventListener(ei,c),a.dispatchEvent(w),w.defaultPrevented||(Qx(ob(np(a)),{select:!0}),document.activeElement===h&&Wt(a))}return()=>{a.removeEventListener(ei,c),setTimeout(()=>{const w=new CustomEvent(ti,Fc);a.addEventListener(ti,u),a.dispatchEvent(w),w.defaultPrevented||Wt(h??document.body,{select:!0}),a.removeEventListener(ti,u),Lc.remove(f)},0)}}},[a,c,u,f]);const g=T.useCallback(h=>{if(!n&&!r||f.paused)return;const b=h.key==="Tab"&&!h.altKey&&!h.ctrlKey&&!h.metaKey,w=document.activeElement;if(b&&w){const v=h.currentTarget,[m,C]=eb(v);m&&C?!h.shiftKey&&w===C?(h.preventDefault(),n&&Wt(m,{select:!0})):h.shiftKey&&w===m&&(h.preventDefault(),n&&Wt(C,{select:!0})):w===v&&h.preventDefault()}},[n,r,f.paused]);return y.jsx(ce.div,{tabIndex:-1,...i,ref:p,onKeyDown:g})});ys.displayName=Jx;function Qx(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Wt(r,{select:t}),document.activeElement!==n)return}function eb(e){const t=np(e),n=Vc(t,e),r=Vc(t.reverse(),e);return[n,r]}function np(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Vc(e,t){for(const n of e)if(!tb(n,{upTo:t}))return n}function tb(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function nb(e){return e instanceof HTMLInputElement&&"select"in e}function Wt(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&nb(e)&&t&&e.select()}}var Lc=rb();function rb(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=$c(e,t),e.unshift(t)},remove(t){var n;e=$c(e,t),(n=e[0])==null||n.resume()}}}function $c(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function ob(e){return e.filter(t=>t.tagName!=="A")}var Ve=globalThis!=null&&globalThis.document?T.useLayoutEffect:()=>{},sb=T[" useId ".trim().toString()]||(()=>{}),ib=0;function Kt(e){const[t,n]=T.useState(sb());return Ve(()=>{n(r=>r??String(ib++))},[e]),e||(t?`radix-${t}`:"")}const ab=["top","right","bottom","left"],qt=Math.min,Ke=Math.max,Xo=Math.round,ho=Math.floor,yt=e=>({x:e,y:e}),lb={left:"right",right:"left",bottom:"top",top:"bottom"},cb={start:"end",end:"start"};function Ui(e,t,n){return Ke(e,qt(t,n))}function Ot(e,t){return typeof e=="function"?e(t):e}function _t(e){return e.split("-")[0]}function Jn(e){return e.split("-")[1]}function Ya(e){return e==="x"?"y":"x"}function Ka(e){return e==="y"?"height":"width"}function Xt(e){return["top","bottom"].includes(_t(e))?"y":"x"}function qa(e){return Ya(Xt(e))}function ub(e,t,n){n===void 0&&(n=!1);const r=Jn(e),o=qa(e),s=Ka(o);let i=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=Zo(i)),[i,Zo(i)]}function db(e){const t=Zo(e);return[Gi(e),t,Gi(t)]}function Gi(e){return e.replace(/start|end/g,t=>cb[t])}function fb(e,t,n){const r=["left","right"],o=["right","left"],s=["top","bottom"],i=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?s:i;default:return[]}}function pb(e,t,n,r){const o=Jn(e);let s=fb(_t(e),n==="start",r);return o&&(s=s.map(i=>i+"-"+o),t&&(s=s.concat(s.map(Gi)))),s}function Zo(e){return e.replace(/left|right|bottom|top/g,t=>lb[t])}function hb(e){return{top:0,right:0,bottom:0,left:0,...e}}function rp(e){return typeof e!="number"?hb(e):{top:e,right:e,bottom:e,left:e}}function Jo(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function Bc(e,t,n){let{reference:r,floating:o}=e;const s=Xt(t),i=qa(t),a=Ka(i),l=_t(t),c=s==="y",u=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,p=r[a]/2-o[a]/2;let f;switch(l){case"top":f={x:u,y:r.y-o.height};break;case"bottom":f={x:u,y:r.y+r.height};break;case"right":f={x:r.x+r.width,y:d};break;case"left":f={x:r.x-o.width,y:d};break;default:f={x:r.x,y:r.y}}switch(Jn(t)){case"start":f[i]-=p*(n&&c?-1:1);break;case"end":f[i]+=p*(n&&c?-1:1);break}return f}const gb=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:s=[],platform:i}=n,a=s.filter(Boolean),l=await(i.isRTL==null?void 0:i.isRTL(t));let c=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:d}=Bc(c,r,l),p=r,f={},g=0;for(let h=0;h<a.length;h++){const{name:b,fn:w}=a[h],{x:v,y:m,data:C,reset:x}=await w({x:u,y:d,initialPlacement:r,placement:p,strategy:o,middlewareData:f,rects:c,platform:i,elements:{reference:e,floating:t}});u=v??u,d=m??d,f={...f,[b]:{...f[b],...C}},x&&g<=50&&(g++,typeof x=="object"&&(x.placement&&(p=x.placement),x.rects&&(c=x.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:o}):x.rects),{x:u,y:d}=Bc(c,p,l)),h=-1)}return{x:u,y:d,placement:p,strategy:o,middlewareData:f}};async function Fr(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:s,rects:i,elements:a,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:p=!1,padding:f=0}=Ot(t,e),g=rp(f),b=a[p?d==="floating"?"reference":"floating":d],w=Jo(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(b)))==null||n?b:b.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:c,rootBoundary:u,strategy:l})),v=d==="floating"?{x:r,y:o,width:i.floating.width,height:i.floating.height}:i.reference,m=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),C=await(s.isElement==null?void 0:s.isElement(m))?await(s.getScale==null?void 0:s.getScale(m))||{x:1,y:1}:{x:1,y:1},x=Jo(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:v,offsetParent:m,strategy:l}):v);return{top:(w.top-x.top+g.top)/C.y,bottom:(x.bottom-w.bottom+g.bottom)/C.y,left:(w.left-x.left+g.left)/C.x,right:(x.right-w.right+g.right)/C.x}}const mb=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:s,platform:i,elements:a,middlewareData:l}=t,{element:c,padding:u=0}=Ot(e,t)||{};if(c==null)return{};const d=rp(u),p={x:n,y:r},f=qa(o),g=Ka(f),h=await i.getDimensions(c),b=f==="y",w=b?"top":"left",v=b?"bottom":"right",m=b?"clientHeight":"clientWidth",C=s.reference[g]+s.reference[f]-p[f]-s.floating[g],x=p[f]-s.reference[f],D=await(i.getOffsetParent==null?void 0:i.getOffsetParent(c));let S=D?D[m]:0;(!S||!await(i.isElement==null?void 0:i.isElement(D)))&&(S=a.floating[m]||s.floating[g]);const M=C/2-x/2,P=S/2-h[g]/2-1,O=qt(d[w],P),_=qt(d[v],P),V=O,G=S-h[g]-_,F=S/2-h[g]/2+M,L=Ui(V,F,G),k=!l.arrow&&Jn(o)!=null&&F!==L&&s.reference[g]/2-(F<V?O:_)-h[g]/2<0,j=k?F<V?F-V:F-G:0;return{[f]:p[f]+j,data:{[f]:L,centerOffset:F-L-j,...k&&{alignmentOffset:j}},reset:k}}}),vb=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:s,rects:i,initialPlacement:a,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:p,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:h=!0,...b}=Ot(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const w=_t(o),v=Xt(a),m=_t(a)===a,C=await(l.isRTL==null?void 0:l.isRTL(c.floating)),x=p||(m||!h?[Zo(a)]:db(a)),D=g!=="none";!p&&D&&x.push(...pb(a,h,g,C));const S=[a,...x],M=await Fr(t,b),P=[];let O=((r=s.flip)==null?void 0:r.overflows)||[];if(u&&P.push(M[w]),d){const F=ub(o,i,C);P.push(M[F[0]],M[F[1]])}if(O=[...O,{placement:o,overflows:P}],!P.every(F=>F<=0)){var _,V;const F=(((_=s.flip)==null?void 0:_.index)||0)+1,L=S[F];if(L)return{data:{index:F,overflows:O},reset:{placement:L}};let k=(V=O.filter(j=>j.overflows[0]<=0).sort((j,E)=>j.overflows[1]-E.overflows[1])[0])==null?void 0:V.placement;if(!k)switch(f){case"bestFit":{var G;const j=(G=O.filter(E=>{if(D){const N=Xt(E.placement);return N===v||N==="y"}return!0}).map(E=>[E.placement,E.overflows.filter(N=>N>0).reduce((N,A)=>N+A,0)]).sort((E,N)=>E[1]-N[1])[0])==null?void 0:G[0];j&&(k=j);break}case"initialPlacement":k=a;break}if(o!==k)return{reset:{placement:k}}}return{}}}};function zc(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Hc(e){return ab.some(t=>e[t]>=0)}const yb=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=Ot(e,t);switch(r){case"referenceHidden":{const s=await Fr(t,{...o,elementContext:"reference"}),i=zc(s,n.reference);return{data:{referenceHiddenOffsets:i,referenceHidden:Hc(i)}}}case"escaped":{const s=await Fr(t,{...o,altBoundary:!0}),i=zc(s,n.floating);return{data:{escapedOffsets:i,escaped:Hc(i)}}}default:return{}}}}};async function wb(e,t){const{placement:n,platform:r,elements:o}=e,s=await(r.isRTL==null?void 0:r.isRTL(o.floating)),i=_t(n),a=Jn(n),l=Xt(n)==="y",c=["left","top"].includes(i)?-1:1,u=s&&l?-1:1,d=Ot(t,e);let{mainAxis:p,crossAxis:f,alignmentAxis:g}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&typeof g=="number"&&(f=a==="end"?g*-1:g),l?{x:f*u,y:p*c}:{x:p*c,y:f*u}}const xb=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:s,placement:i,middlewareData:a}=t,l=await wb(t,e);return i===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:o+l.x,y:s+l.y,data:{...l,placement:i}}}}},bb=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:s=!0,crossAxis:i=!1,limiter:a={fn:b=>{let{x:w,y:v}=b;return{x:w,y:v}}},...l}=Ot(e,t),c={x:n,y:r},u=await Fr(t,l),d=Xt(_t(o)),p=Ya(d);let f=c[p],g=c[d];if(s){const b=p==="y"?"top":"left",w=p==="y"?"bottom":"right",v=f+u[b],m=f-u[w];f=Ui(v,f,m)}if(i){const b=d==="y"?"top":"left",w=d==="y"?"bottom":"right",v=g+u[b],m=g-u[w];g=Ui(v,g,m)}const h=a.fn({...t,[p]:f,[d]:g});return{...h,data:{x:h.x-n,y:h.y-r,enabled:{[p]:s,[d]:i}}}}}},Sb=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:s,middlewareData:i}=t,{offset:a=0,mainAxis:l=!0,crossAxis:c=!0}=Ot(e,t),u={x:n,y:r},d=Xt(o),p=Ya(d);let f=u[p],g=u[d];const h=Ot(a,t),b=typeof h=="number"?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(l){const m=p==="y"?"height":"width",C=s.reference[p]-s.floating[m]+b.mainAxis,x=s.reference[p]+s.reference[m]-b.mainAxis;f<C?f=C:f>x&&(f=x)}if(c){var w,v;const m=p==="y"?"width":"height",C=["top","left"].includes(_t(o)),x=s.reference[d]-s.floating[m]+(C&&((w=i.offset)==null?void 0:w[d])||0)+(C?0:b.crossAxis),D=s.reference[d]+s.reference[m]+(C?0:((v=i.offset)==null?void 0:v[d])||0)-(C?b.crossAxis:0);g<x?g=x:g>D&&(g=D)}return{[p]:f,[d]:g}}}},Cb=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:s,platform:i,elements:a}=t,{apply:l=()=>{},...c}=Ot(e,t),u=await Fr(t,c),d=_t(o),p=Jn(o),f=Xt(o)==="y",{width:g,height:h}=s.floating;let b,w;d==="top"||d==="bottom"?(b=d,w=p===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?"start":"end")?"left":"right"):(w=d,b=p==="end"?"top":"bottom");const v=h-u.top-u.bottom,m=g-u.left-u.right,C=qt(h-u[b],v),x=qt(g-u[w],m),D=!t.middlewareData.shift;let S=C,M=x;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(M=m),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(S=v),D&&!p){const O=Ke(u.left,0),_=Ke(u.right,0),V=Ke(u.top,0),G=Ke(u.bottom,0);f?M=g-2*(O!==0||_!==0?O+_:Ke(u.left,u.right)):S=h-2*(V!==0||G!==0?V+G:Ke(u.top,u.bottom))}await l({...t,availableWidth:M,availableHeight:S});const P=await i.getDimensions(a.floating);return g!==P.width||h!==P.height?{reset:{rects:!0}}:{}}}};function ws(){return typeof window<"u"}function Qn(e){return op(e)?(e.nodeName||"").toLowerCase():"#document"}function qe(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ct(e){var t;return(t=(op(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function op(e){return ws()?e instanceof Node||e instanceof qe(e).Node:!1}function ut(e){return ws()?e instanceof Element||e instanceof qe(e).Element:!1}function St(e){return ws()?e instanceof HTMLElement||e instanceof qe(e).HTMLElement:!1}function Wc(e){return!ws()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof qe(e).ShadowRoot}function to(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=dt(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function Rb(e){return["table","td","th"].includes(Qn(e))}function xs(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function Xa(e){const t=Za(),n=ut(e)?dt(e):e;return["transform","translate","scale","rotate","perspective"].some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(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 Tb(e){let t=Zt(e);for(;St(t)&&!Hn(t);){if(Xa(t))return t;if(xs(t))return null;t=Zt(t)}return null}function Za(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Hn(e){return["html","body","#document"].includes(Qn(e))}function dt(e){return qe(e).getComputedStyle(e)}function bs(e){return ut(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Zt(e){if(Qn(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Wc(e)&&e.host||Ct(e);return Wc(t)?t.host:t}function sp(e){const t=Zt(e);return Hn(t)?e.ownerDocument?e.ownerDocument.body:e.body:St(t)&&to(t)?t:sp(t)}function Vr(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=sp(e),s=o===((r=e.ownerDocument)==null?void 0:r.body),i=qe(o);if(s){const a=Yi(i);return t.concat(i,i.visualViewport||[],to(o)?o:[],a&&n?Vr(a):[])}return t.concat(o,Vr(o,[],n))}function Yi(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function ip(e){const t=dt(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=St(e),s=o?e.offsetWidth:n,i=o?e.offsetHeight:r,a=Xo(n)!==s||Xo(r)!==i;return a&&(n=s,r=i),{width:n,height:r,$:a}}function Ja(e){return ut(e)?e:e.contextElement}function $n(e){const t=Ja(e);if(!St(t))return yt(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:s}=ip(t);let i=(s?Xo(n.width):n.width)/r,a=(s?Xo(n.height):n.height)/o;return(!i||!Number.isFinite(i))&&(i=1),(!a||!Number.isFinite(a))&&(a=1),{x:i,y:a}}const Db=yt(0);function ap(e){const t=qe(e);return!Za()||!t.visualViewport?Db:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Mb(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==qe(e)?!1:t}function xn(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),s=Ja(e);let i=yt(1);t&&(r?ut(r)&&(i=$n(r)):i=$n(e));const a=Mb(s,n,r)?ap(s):yt(0);let l=(o.left+a.x)/i.x,c=(o.top+a.y)/i.y,u=o.width/i.x,d=o.height/i.y;if(s){const p=qe(s),f=r&&ut(r)?qe(r):r;let g=p,h=Yi(g);for(;h&&r&&f!==g;){const b=$n(h),w=h.getBoundingClientRect(),v=dt(h),m=w.left+(h.clientLeft+parseFloat(v.paddingLeft))*b.x,C=w.top+(h.clientTop+parseFloat(v.paddingTop))*b.y;l*=b.x,c*=b.y,u*=b.x,d*=b.y,l+=m,c+=C,g=qe(h),h=Yi(g)}}return Jo({width:u,height:d,x:l,y:c})}function Qa(e,t){const n=bs(e).scrollLeft;return t?t.left+n:xn(Ct(e)).left+n}function lp(e,t,n){n===void 0&&(n=!1);const r=e.getBoundingClientRect(),o=r.left+t.scrollLeft-(n?0:Qa(e,r)),s=r.top+t.scrollTop;return{x:o,y:s}}function Eb(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const s=o==="fixed",i=Ct(r),a=t?xs(t.floating):!1;if(r===i||a&&s)return n;let l={scrollLeft:0,scrollTop:0},c=yt(1);const u=yt(0),d=St(r);if((d||!d&&!s)&&((Qn(r)!=="body"||to(i))&&(l=bs(r)),St(r))){const f=xn(r);c=$n(r),u.x=f.x+r.clientLeft,u.y=f.y+r.clientTop}const p=i&&!d&&!s?lp(i,l,!0):yt(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x+p.x,y:n.y*c.y-l.scrollTop*c.y+u.y+p.y}}function Pb(e){return Array.from(e.getClientRects())}function Ab(e){const t=Ct(e),n=bs(e),r=e.ownerDocument.body,o=Ke(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=Ke(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let i=-n.scrollLeft+Qa(e);const a=-n.scrollTop;return dt(r).direction==="rtl"&&(i+=Ke(t.clientWidth,r.clientWidth)-o),{width:o,height:s,x:i,y:a}}function Ob(e,t){const n=qe(e),r=Ct(e),o=n.visualViewport;let s=r.clientWidth,i=r.clientHeight,a=0,l=0;if(o){s=o.width,i=o.height;const c=Za();(!c||c&&t==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}return{width:s,height:i,x:a,y:l}}function _b(e,t){const n=xn(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,s=St(e)?$n(e):yt(1),i=e.clientWidth*s.x,a=e.clientHeight*s.y,l=o*s.x,c=r*s.y;return{width:i,height:a,x:l,y:c}}function Uc(e,t,n){let r;if(t==="viewport")r=Ob(e,n);else if(t==="document")r=Ab(Ct(e));else if(ut(t))r=_b(t,n);else{const o=ap(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return Jo(r)}function cp(e,t){const n=Zt(e);return n===t||!ut(n)||Hn(n)?!1:dt(n).position==="fixed"||cp(n,t)}function kb(e,t){const n=t.get(e);if(n)return n;let r=Vr(e,[],!1).filter(a=>ut(a)&&Qn(a)!=="body"),o=null;const s=dt(e).position==="fixed";let i=s?Zt(e):e;for(;ut(i)&&!Hn(i);){const a=dt(i),l=Xa(i);!l&&a.position==="fixed"&&(o=null),(s?!l&&!o:!l&&a.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||to(i)&&!l&&cp(e,i))?r=r.filter(u=>u!==i):o=a,i=Zt(i)}return t.set(e,r),r}function Ib(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[...n==="clippingAncestors"?xs(t)?[]:kb(t,this._c):[].concat(n),r],a=i[0],l=i.reduce((c,u)=>{const d=Uc(t,u,o);return c.top=Ke(d.top,c.top),c.right=qt(d.right,c.right),c.bottom=qt(d.bottom,c.bottom),c.left=Ke(d.left,c.left),c},Uc(t,a,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function Nb(e){const{width:t,height:n}=ip(e);return{width:t,height:n}}function jb(e,t,n){const r=St(t),o=Ct(t),s=n==="fixed",i=xn(e,!0,s,t);let a={scrollLeft:0,scrollTop:0};const l=yt(0);if(r||!r&&!s)if((Qn(t)!=="body"||to(o))&&(a=bs(t)),r){const p=xn(t,!0,s,t);l.x=p.x+t.clientLeft,l.y=p.y+t.clientTop}else o&&(l.x=Qa(o));const c=o&&!r&&!s?lp(o,a):yt(0),u=i.left+a.scrollLeft-l.x-c.x,d=i.top+a.scrollTop-l.y-c.y;return{x:u,y:d,width:i.width,height:i.height}}function ni(e){return dt(e).position==="static"}function Gc(e,t){if(!St(e)||dt(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Ct(e)===n&&(n=n.ownerDocument.body),n}function up(e,t){const n=qe(e);if(xs(e))return n;if(!St(e)){let o=Zt(e);for(;o&&!Hn(o);){if(ut(o)&&!ni(o))return o;o=Zt(o)}return n}let r=Gc(e,t);for(;r&&Rb(r)&&ni(r);)r=Gc(r,t);return r&&Hn(r)&&ni(r)&&!Xa(r)?n:r||Tb(e)||n}const Fb=async function(e){const t=this.getOffsetParent||up,n=this.getDimensions,r=await n(e.floating);return{reference:jb(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Vb(e){return dt(e).direction==="rtl"}const Lb={convertOffsetParentRelativeRectToViewportRelativeRect:Eb,getDocumentElement:Ct,getClippingRect:Ib,getOffsetParent:up,getElementRects:Fb,getClientRects:Pb,getDimensions:Nb,getScale:$n,isElement:ut,isRTL:Vb};function dp(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function $b(e,t){let n=null,r;const o=Ct(e);function s(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function i(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),s();const c=e.getBoundingClientRect(),{left:u,top:d,width:p,height:f}=c;if(a||t(),!p||!f)return;const g=ho(d),h=ho(o.clientWidth-(u+p)),b=ho(o.clientHeight-(d+f)),w=ho(u),m={rootMargin:-g+"px "+-h+"px "+-b+"px "+-w+"px",threshold:Ke(0,qt(1,l))||1};let C=!0;function x(D){const S=D[0].intersectionRatio;if(S!==l){if(!C)return i();S?i(!1,S):r=setTimeout(()=>{i(!1,1e-7)},1e3)}S===1&&!dp(c,e.getBoundingClientRect())&&i(),C=!1}try{n=new IntersectionObserver(x,{...m,root:o.ownerDocument})}catch{n=new IntersectionObserver(x,m)}n.observe(e)}return i(!0),s}function Bb(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,c=Ja(e),u=o||s?[...c?Vr(c):[],...Vr(t)]:[];u.forEach(w=>{o&&w.addEventListener("scroll",n,{passive:!0}),s&&w.addEventListener("resize",n)});const d=c&&a?$b(c,n):null;let p=-1,f=null;i&&(f=new ResizeObserver(w=>{let[v]=w;v&&v.target===c&&f&&(f.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var m;(m=f)==null||m.observe(t)})),n()}),c&&!l&&f.observe(c),f.observe(t));let g,h=l?xn(e):null;l&&b();function b(){const w=xn(e);h&&!dp(h,w)&&n(),h=w,g=requestAnimationFrame(b)}return n(),()=>{var w;u.forEach(v=>{o&&v.removeEventListener("scroll",n),s&&v.removeEventListener("resize",n)}),d==null||d(),(w=f)==null||w.disconnect(),f=null,l&&cancelAnimationFrame(g)}}const zb=xb,Hb=bb,Wb=vb,Ub=Cb,Gb=yb,Yc=mb,Yb=Sb,Kb=(e,t,n)=>{const r=new Map,o={platform:Lb,...n},s={...o.platform,_c:r};return gb(e,t,{...o,platform:s})};var No=typeof document<"u"?R.useLayoutEffect:R.useEffect;function Qo(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Qo(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const s=o[r];if(!(s==="_owner"&&e.$$typeof)&&!Qo(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function fp(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Kc(e,t){const n=fp(e);return Math.round(t*n)/n}function ri(e){const t=T.useRef(e);return No(()=>{t.current=e}),t}function qb(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:s,floating:i}={},transform:a=!0,whileElementsMounted:l,open:c}=e,[u,d]=T.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,f]=T.useState(r);Qo(p,r)||f(r);const[g,h]=T.useState(null),[b,w]=T.useState(null),v=T.useCallback(E=>{E!==D.current&&(D.current=E,h(E))},[]),m=T.useCallback(E=>{E!==S.current&&(S.current=E,w(E))},[]),C=s||g,x=i||b,D=T.useRef(null),S=T.useRef(null),M=T.useRef(u),P=l!=null,O=ri(l),_=ri(o),V=ri(c),G=T.useCallback(()=>{if(!D.current||!S.current)return;const E={placement:t,strategy:n,middleware:p};_.current&&(E.platform=_.current),Kb(D.current,S.current,E).then(N=>{const A={...N,isPositioned:V.current!==!1};F.current&&!Qo(M.current,A)&&(M.current=A,ls.flushSync(()=>{d(A)}))})},[p,t,n,_,V]);No(()=>{c===!1&&M.current.isPositioned&&(M.current.isPositioned=!1,d(E=>({...E,isPositioned:!1})))},[c]);const F=T.useRef(!1);No(()=>(F.current=!0,()=>{F.current=!1}),[]),No(()=>{if(C&&(D.current=C),x&&(S.current=x),C&&x){if(O.current)return O.current(C,x,G);G()}},[C,x,G,O,P]);const L=T.useMemo(()=>({reference:D,floating:S,setReference:v,setFloating:m}),[v,m]),k=T.useMemo(()=>({reference:C,floating:x}),[C,x]),j=T.useMemo(()=>{const E={position:n,left:0,top:0};if(!k.floating)return E;const N=Kc(k.floating,u.x),A=Kc(k.floating,u.y);return a?{...E,transform:"translate("+N+"px, "+A+"px)",...fp(k.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:N,top:A}},[n,a,k.floating,u.x,u.y]);return T.useMemo(()=>({...u,update:G,refs:L,elements:k,floatingStyles:j}),[u,G,L,k,j])}const Xb=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:o}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?Yc({element:r.current,padding:o}).fn(n):{}:r?Yc({element:r,padding:o}).fn(n):{}}}},Zb=(e,t)=>({...zb(e),options:[e,t]}),Jb=(e,t)=>({...Hb(e),options:[e,t]}),Qb=(e,t)=>({...Yb(e),options:[e,t]}),eS=(e,t)=>({...Wb(e),options:[e,t]}),tS=(e,t)=>({...Ub(e),options:[e,t]}),nS=(e,t)=>({...Gb(e),options:[e,t]}),rS=(e,t)=>({...Xb(e),options:[e,t]});var oS="Arrow",pp=T.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...s}=e;return y.jsx(ce.svg,{...s,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:y.jsx("polygon",{points:"0,0 30,0 15,10"})})});pp.displayName=oS;var sS=pp;function iS(e){const[t,n]=T.useState(void 0);return Ve(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const s=o[0];let i,a;if("borderBoxSize"in s){const l=s.borderBoxSize,c=Array.isArray(l)?l[0]:l;i=c.inlineSize,a=c.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var el="Popper",[hp,on]=rn(el),[aS,gp]=hp(el),mp=e=>{const{__scopePopper:t,children:n}=e,[r,o]=T.useState(null);return y.jsx(aS,{scope:t,anchor:r,onAnchorChange:o,children:n})};mp.displayName=el;var vp="PopperAnchor",yp=T.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,s=gp(vp,n),i=T.useRef(null),a=ge(t,i);return T.useEffect(()=>{s.onAnchorChange((r==null?void 0:r.current)||i.current)}),r?null:y.jsx(ce.div,{...o,ref:a})});yp.displayName=vp;var tl="PopperContent",[lS,cS]=hp(tl),wp=T.forwardRef((e,t)=>{var $,q,X,U,te,z;const{__scopePopper:n,side:r="bottom",sideOffset:o=0,align:s="center",alignOffset:i=0,arrowPadding:a=0,avoidCollisions:l=!0,collisionBoundary:c=[],collisionPadding:u=0,sticky:d="partial",hideWhenDetached:p=!1,updatePositionStrategy:f="optimized",onPlaced:g,...h}=e,b=gp(tl,n),[w,v]=T.useState(null),m=ge(t,le=>v(le)),[C,x]=T.useState(null),D=iS(C),S=(D==null?void 0:D.width)??0,M=(D==null?void 0:D.height)??0,P=r+(s!=="center"?"-"+s:""),O=typeof u=="number"?u:{top:0,right:0,bottom:0,left:0,...u},_=Array.isArray(c)?c:[c],V=_.length>0,G={padding:O,boundary:_.filter(dS),altBoundary:V},{refs:F,floatingStyles:L,placement:k,isPositioned:j,middlewareData:E}=qb({strategy:"fixed",placement:P,whileElementsMounted:(...le)=>Bb(...le,{animationFrame:f==="always"}),elements:{reference:b.anchor},middleware:[Zb({mainAxis:o+M,alignmentAxis:i}),l&&Jb({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?Qb():void 0,...G}),l&&eS({...G}),tS({...G,apply:({elements:le,rects:ve,availableWidth:Oe,availableHeight:Be})=>{const{width:ft,height:Rn}=ve.reference,ot=le.floating.style;ot.setProperty("--radix-popper-available-width",`${Oe}px`),ot.setProperty("--radix-popper-available-height",`${Be}px`),ot.setProperty("--radix-popper-anchor-width",`${ft}px`),ot.setProperty("--radix-popper-anchor-height",`${Rn}px`)}}),C&&rS({element:C,padding:a}),fS({arrowWidth:S,arrowHeight:M}),p&&nS({strategy:"referenceHidden",...G})]}),[N,A]=Sp(k),I=rt(g);Ve(()=>{j&&(I==null||I())},[j,I]);const B=($=E.arrow)==null?void 0:$.x,H=(q=E.arrow)==null?void 0:q.y,W=((X=E.arrow)==null?void 0:X.centerOffset)!==0,[Z,K]=T.useState();return Ve(()=>{w&&K(window.getComputedStyle(w).zIndex)},[w]),y.jsx("div",{ref:F.setFloating,"data-radix-popper-content-wrapper":"",style:{...L,transform:j?L.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Z,"--radix-popper-transform-origin":[(U=E.transformOrigin)==null?void 0:U.x,(te=E.transformOrigin)==null?void 0:te.y].join(" "),...((z=E.hide)==null?void 0:z.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:y.jsx(lS,{scope:n,placedSide:N,onArrowChange:x,arrowX:B,arrowY:H,shouldHideArrow:W,children:y.jsx(ce.div,{"data-side":N,"data-align":A,...h,ref:m,style:{...h.style,animation:j?void 0:"none"}})})})});wp.displayName=tl;var xp="PopperArrow",uS={top:"bottom",right:"left",bottom:"top",left:"right"},bp=T.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,s=cS(xp,r),i=uS[s.placedSide];return y.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:y.jsx(sS,{...o,ref:n,style:{...o.style,display:"block"}})})});bp.displayName=xp;function dS(e){return e!==null}var fS=e=>({name:"transformOrigin",options:e,fn(t){var b,w,v;const{placement:n,rects:r,middlewareData:o}=t,i=((b=o.arrow)==null?void 0:b.centerOffset)!==0,a=i?0:e.arrowWidth,l=i?0:e.arrowHeight,[c,u]=Sp(n),d={start:"0%",center:"50%",end:"100%"}[u],p=(((w=o.arrow)==null?void 0:w.x)??0)+a/2,f=(((v=o.arrow)==null?void 0:v.y)??0)+l/2;let g="",h="";return c==="bottom"?(g=i?d:`${p}px`,h=`${-l}px`):c==="top"?(g=i?d:`${p}px`,h=`${r.floating.height+l}px`):c==="right"?(g=`${-l}px`,h=i?d:`${f}px`):c==="left"&&(g=`${r.floating.width+l}px`,h=i?d:`${f}px`),{data:{x:g,y:h}}}});function Sp(e){const[t,n="center"]=e.split("-");return[t,n]}var Ss=mp,no=yp,Cs=wp,Rs=bp,pS="Portal",ro=T.forwardRef((e,t)=>{var a;const{container:n,...r}=e,[o,s]=T.useState(!1);Ve(()=>s(!0),[]);const i=n||o&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return i?Pt.createPortal(y.jsx(ce.div,{...r,ref:t}),i):null});ro.displayName=pS;function hS(e,t){return T.useReducer((n,r)=>t[n][r]??n,e)}var jt=e=>{const{present:t,children:n}=e,r=gS(t),o=typeof n=="function"?n({present:r.isPresent}):T.Children.only(n),s=ge(r.ref,mS(o));return typeof n=="function"||r.isPresent?T.cloneElement(o,{ref:s}):null};jt.displayName="Presence";function gS(e){const[t,n]=T.useState(),r=T.useRef({}),o=T.useRef(e),s=T.useRef("none"),i=e?"mounted":"unmounted",[a,l]=hS(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return T.useEffect(()=>{const c=go(r.current);s.current=a==="mounted"?c:"none"},[a]),Ve(()=>{const c=r.current,u=o.current;if(u!==e){const p=s.current,f=go(c);e?l("MOUNT"):f==="none"||(c==null?void 0:c.display)==="none"?l("UNMOUNT"):l(u&&p!==f?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,l]),Ve(()=>{if(t){let c;const u=t.ownerDocument.defaultView??window,d=f=>{const h=go(r.current).includes(f.animationName);if(f.target===t&&h&&(l("ANIMATION_END"),!o.current)){const b=t.style.animationFillMode;t.style.animationFillMode="forwards",c=u.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=b)})}},p=f=>{f.target===t&&(s.current=go(r.current))};return t.addEventListener("animationstart",p),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{u.clearTimeout(c),t.removeEventListener("animationstart",p),t.removeEventListener("animationcancel",d),t.removeEventListener("animationend",d)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:T.useCallback(c=>{c&&(r.current=getComputedStyle(c)),n(c)},[])}}function go(e){return(e==null?void 0:e.animationName)||"none"}function mS(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var oi="rovingFocusGroup.onEntryFocus",vS={bubbles:!1,cancelable:!0},Ts="RovingFocusGroup",[Ki,Cp,yS]=Wa(Ts),[wS,Rp]=rn(Ts,[yS]),[xS,bS]=wS(Ts),Tp=T.forwardRef((e,t)=>y.jsx(Ki.Provider,{scope:e.__scopeRovingFocusGroup,children:y.jsx(Ki.Slot,{scope:e.__scopeRovingFocusGroup,children:y.jsx(SS,{...e,ref:t})})}));Tp.displayName=Ts;var SS=T.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:s,currentTabStopId:i,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:l,onEntryFocus:c,preventScrollOnEntryFocus:u=!1,...d}=e,p=T.useRef(null),f=ge(t,p),g=Ua(s),[h=null,b]=yn({prop:i,defaultProp:a,onChange:l}),[w,v]=T.useState(!1),m=rt(c),C=Cp(n),x=T.useRef(!1),[D,S]=T.useState(0);return T.useEffect(()=>{const M=p.current;if(M)return M.addEventListener(oi,m),()=>M.removeEventListener(oi,m)},[m]),y.jsx(xS,{scope:n,orientation:r,dir:g,loop:o,currentTabStopId:h,onItemFocus:T.useCallback(M=>b(M),[b]),onItemShiftTab:T.useCallback(()=>v(!0),[]),onFocusableItemAdd:T.useCallback(()=>S(M=>M+1),[]),onFocusableItemRemove:T.useCallback(()=>S(M=>M-1),[]),children:y.jsx(ce.div,{tabIndex:w||D===0?-1:0,"data-orientation":r,...d,ref:f,style:{outline:"none",...e.style},onMouseDown:ne(e.onMouseDown,()=>{x.current=!0}),onFocus:ne(e.onFocus,M=>{const P=!x.current;if(M.target===M.currentTarget&&P&&!w){const O=new CustomEvent(oi,vS);if(M.currentTarget.dispatchEvent(O),!O.defaultPrevented){const _=C().filter(k=>k.focusable),V=_.find(k=>k.active),G=_.find(k=>k.id===h),L=[V,G,..._].filter(Boolean).map(k=>k.ref.current);Ep(L,u)}}x.current=!1}),onBlur:ne(e.onBlur,()=>v(!1))})})}),Dp="RovingFocusGroupItem",Mp=T.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:s,...i}=e,a=Kt(),l=s||a,c=bS(Dp,n),u=c.currentTabStopId===l,d=Cp(n),{onFocusableItemAdd:p,onFocusableItemRemove:f}=c;return T.useEffect(()=>{if(r)return p(),()=>f()},[r,p,f]),y.jsx(Ki.ItemSlot,{scope:n,id:l,focusable:r,active:o,children:y.jsx(ce.span,{tabIndex:u?0:-1,"data-orientation":c.orientation,...i,ref:t,onMouseDown:ne(e.onMouseDown,g=>{r?c.onItemFocus(l):g.preventDefault()}),onFocus:ne(e.onFocus,()=>c.onItemFocus(l)),onKeyDown:ne(e.onKeyDown,g=>{if(g.key==="Tab"&&g.shiftKey){c.onItemShiftTab();return}if(g.target!==g.currentTarget)return;const h=TS(g,c.orientation,c.dir);if(h!==void 0){if(g.metaKey||g.ctrlKey||g.altKey||g.shiftKey)return;g.preventDefault();let w=d().filter(v=>v.focusable).map(v=>v.ref.current);if(h==="last")w.reverse();else if(h==="prev"||h==="next"){h==="prev"&&w.reverse();const v=w.indexOf(g.currentTarget);w=c.loop?DS(w,v+1):w.slice(v+1)}setTimeout(()=>Ep(w))}})})})});Mp.displayName=Dp;var CS={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function RS(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function TS(e,t,n){const r=RS(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return CS[r]}function Ep(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function DS(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var MS=Tp,ES=Mp,PS=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},En=new WeakMap,mo=new WeakMap,vo={},si=0,Pp=function(e){return e&&(e.host||Pp(e.parentNode))},AS=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=Pp(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},OS=function(e,t,n,r){var o=AS(t,Array.isArray(e)?e:[e]);vo[n]||(vo[n]=new WeakMap);var s=vo[n],i=[],a=new Set,l=new Set(o),c=function(d){!d||a.has(d)||(a.add(d),c(d.parentNode))};o.forEach(c);var u=function(d){!d||l.has(d)||Array.prototype.forEach.call(d.children,function(p){if(a.has(p))u(p);else try{var f=p.getAttribute(r),g=f!==null&&f!=="false",h=(En.get(p)||0)+1,b=(s.get(p)||0)+1;En.set(p,h),s.set(p,b),i.push(p),h===1&&g&&mo.set(p,!0),b===1&&p.setAttribute(n,"true"),g||p.setAttribute(r,"true")}catch(w){console.error("aria-hidden: cannot operate on ",p,w)}})};return u(t),a.clear(),si++,function(){i.forEach(function(d){var p=En.get(d)-1,f=s.get(d)-1;En.set(d,p),s.set(d,f),p||(mo.has(d)||d.removeAttribute(r),mo.delete(d)),f||d.removeAttribute(n)}),si--,si||(En=new WeakMap,En=new WeakMap,mo=new WeakMap,vo={})}},nl=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=PS(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live]"))),OS(r,o,n,"aria-hidden")):function(){return null}},vt=function(){return vt=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(t[s]=n[s])}return t},vt.apply(this,arguments)};function Ap(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function _S(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,s;r<o;r++)(s||!(r in t))&&(s||(s=Array.prototype.slice.call(t,0,r)),s[r]=t[r]);return e.concat(s||Array.prototype.slice.call(t))}var jo="right-scroll-bar-position",Fo="width-before-scroll-bar",kS="with-scroll-bars-hidden",IS="--removed-body-scroll-bar-size";function ii(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function NS(e,t){var n=R.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=t,n.facade}var jS=typeof window<"u"?T.useLayoutEffect:T.useEffect,qc=new WeakMap;function FS(e,t){var n=NS(null,function(r){return e.forEach(function(o){return ii(o,r)})});return jS(function(){var r=qc.get(n);if(r){var o=new Set(r),s=new Set(e),i=n.current;o.forEach(function(a){s.has(a)||ii(a,null)}),s.forEach(function(a){o.has(a)||ii(a,i)})}qc.set(n,e)},[e]),n}function VS(e){return e}function LS(e,t){t===void 0&&(t=VS);var n=[],r=!1,o={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(s){var i=t(s,r);return n.push(i),function(){n=n.filter(function(a){return a!==i})}},assignSyncMedium:function(s){for(r=!0;n.length;){var i=n;n=[],i.forEach(s)}n={push:function(a){return s(a)},filter:function(){return n}}},assignMedium:function(s){r=!0;var i=[];if(n.length){var a=n;n=[],a.forEach(s),i=n}var l=function(){var u=i;i=[],u.forEach(s)},c=function(){return Promise.resolve().then(l)};c(),n={push:function(u){i.push(u),c()},filter:function(u){return i=i.filter(u),n}}}};return o}function $S(e){e===void 0&&(e={});var t=LS(null);return t.options=vt({async:!0,ssr:!1},e),t}var Op=function(e){var t=e.sideCar,n=Ap(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return T.createElement(r,vt({},n))};Op.isSideCarExport=!0;function BS(e,t){return e.useMedium(t),Op}var _p=$S(),ai=function(){},Ds=T.forwardRef(function(e,t){var n=T.useRef(null),r=T.useState({onScrollCapture:ai,onWheelCapture:ai,onTouchMoveCapture:ai}),o=r[0],s=r[1],i=e.forwardProps,a=e.children,l=e.className,c=e.removeScrollBar,u=e.enabled,d=e.shards,p=e.sideCar,f=e.noIsolation,g=e.inert,h=e.allowPinchZoom,b=e.as,w=b===void 0?"div":b,v=e.gapMode,m=Ap(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),C=p,x=FS([n,t]),D=vt(vt({},m),o);return T.createElement(T.Fragment,null,u&&T.createElement(C,{sideCar:_p,removeScrollBar:c,shards:d,noIsolation:f,inert:g,setCallbacks:s,allowPinchZoom:!!h,lockRef:n,gapMode:v}),i?T.cloneElement(T.Children.only(a),vt(vt({},D),{ref:x})):T.createElement(w,vt({},D,{className:l,ref:x}),a))});Ds.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Ds.classNames={fullWidth:Fo,zeroRight:jo};var zS=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function HS(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=zS();return t&&e.setAttribute("nonce",t),e}function WS(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function US(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var GS=function(){var e=0,t=null;return{add:function(n){e==0&&(t=HS())&&(WS(t,n),US(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},YS=function(){var e=GS();return function(t,n){T.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},kp=function(){var e=YS(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},KS={left:0,top:0,right:0,gap:0},li=function(e){return parseInt(e||"",10)||0},qS=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[li(n),li(r),li(o)]},XS=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return KS;var t=qS(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},ZS=kp(),Bn="data-scroll-locked",JS=function(e,t,n,r){var o=e.left,s=e.top,i=e.right,a=e.gap;return n===void 0&&(n="margin"),`
|
|
130
|
+
.`.concat(kS,` {
|
|
131
131
|
overflow: hidden `).concat(r,`;
|
|
132
132
|
padding-right: `).concat(a,"px ").concat(r,`;
|
|
133
133
|
}
|
|
134
|
-
body[`).concat(
|
|
134
|
+
body[`).concat(Bn,`] {
|
|
135
135
|
overflow: hidden `).concat(r,`;
|
|
136
136
|
overscroll-behavior: contain;
|
|
137
137
|
`).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
|
|
@@ -144,50 +144,29 @@
|
|
|
144
144
|
`),n==="padding"&&"padding-right: ".concat(a,"px ").concat(r,";")].filter(Boolean).join(""),`
|
|
145
145
|
}
|
|
146
146
|
|
|
147
|
-
.`).concat(
|
|
147
|
+
.`).concat(jo,` {
|
|
148
148
|
right: `).concat(a,"px ").concat(r,`;
|
|
149
149
|
}
|
|
150
150
|
|
|
151
|
-
.`).concat(
|
|
151
|
+
.`).concat(Fo,` {
|
|
152
152
|
margin-right: `).concat(a,"px ").concat(r,`;
|
|
153
153
|
}
|
|
154
154
|
|
|
155
|
-
.`).concat(
|
|
155
|
+
.`).concat(jo," .").concat(jo,` {
|
|
156
156
|
right: 0 `).concat(r,`;
|
|
157
157
|
}
|
|
158
158
|
|
|
159
|
-
.`).concat(
|
|
159
|
+
.`).concat(Fo," .").concat(Fo,` {
|
|
160
160
|
margin-right: 0 `).concat(r,`;
|
|
161
161
|
}
|
|
162
162
|
|
|
163
|
-
body[`).concat(
|
|
164
|
-
`).concat(
|
|
163
|
+
body[`).concat(Bn,`] {
|
|
164
|
+
`).concat(IS,": ").concat(a,`px;
|
|
165
165
|
}
|
|
166
|
-
`)},
|
|
166
|
+
`)},Xc=function(){var e=parseInt(document.body.getAttribute(Bn)||"0",10);return isFinite(e)?e:0},QS=function(){T.useEffect(function(){return document.body.setAttribute(Bn,(Xc()+1).toString()),function(){var e=Xc()-1;e<=0?document.body.removeAttribute(Bn):document.body.setAttribute(Bn,e.toString())}},[])},e0=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r;QS();var s=T.useMemo(function(){return XS(o)},[o]);return T.createElement(ZS,{styles:JS(s,!t,o,n?"":"!important")})},qi=!1;if(typeof window<"u")try{var yo=Object.defineProperty({},"passive",{get:function(){return qi=!0,!0}});window.addEventListener("test",yo,yo),window.removeEventListener("test",yo,yo)}catch{qi=!1}var Pn=qi?{passive:!1}:!1,t0=function(e){return e.tagName==="TEXTAREA"},Ip=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!t0(e)&&n[t]==="visible")},n0=function(e){return Ip(e,"overflowY")},r0=function(e){return Ip(e,"overflowX")},Zc=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=Np(e,r);if(o){var s=jp(e,r),i=s[1],a=s[2];if(i>a)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},o0=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},s0=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},Np=function(e,t){return e==="v"?n0(t):r0(t)},jp=function(e,t){return e==="v"?o0(t):s0(t)},i0=function(e,t){return e==="h"&&t==="rtl"?-1:1},a0=function(e,t,n,r,o){var s=i0(e,window.getComputedStyle(t).direction),i=s*r,a=n.target,l=t.contains(a),c=!1,u=i>0,d=0,p=0;do{var f=jp(e,a),g=f[0],h=f[1],b=f[2],w=h-b-s*g;(g||w)&&Np(e,a)&&(d+=w,p+=g),a instanceof ShadowRoot?a=a.host:a=a.parentNode}while(!l&&a!==document.body||l&&(t.contains(a)||t===a));return(u&&Math.abs(d)<1||!u&&Math.abs(p)<1)&&(c=!0),c},wo=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Jc=function(e){return[e.deltaX,e.deltaY]},Qc=function(e){return e&&"current"in e?e.current:e},l0=function(e,t){return e[0]===t[0]&&e[1]===t[1]},c0=function(e){return`
|
|
167
167
|
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
168
168
|
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
169
|
-
`)},cC=0,Pn=[];function uC(e){var t=R.useRef([]),n=R.useRef([0,0]),r=R.useRef(),o=R.useState(cC++)[0],s=R.useState(Qh)[0],i=R.useRef(e);R.useEffect(function(){i.current=e},[e]),R.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var p=O0([e.lockRef.current],(e.shards||[]).map(ru),!0).filter(Boolean);return p.forEach(function(b){return b.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),p.forEach(function(b){return b.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var a=R.useCallback(function(p,b){if("touches"in p&&p.touches.length===2||p.type==="wheel"&&p.ctrlKey)return!i.current.allowPinchZoom;var y=vo(p),g=n.current,w="deltaX"in p?p.deltaX:g[0]-y[0],C="deltaY"in p?p.deltaY:g[1]-y[1],x,M=p.target,S=Math.abs(w)>Math.abs(C)?"h":"v";if("touches"in p&&S==="h"&&M.type==="range")return!1;var D=tu(S,M);if(!D)return!0;if(D?x=S:(x=S==="v"?"h":"v",D=tu(S,M)),!D)return!1;if(!r.current&&"changedTouches"in p&&(w||C)&&(r.current=x),!x)return!0;var P=r.current||x;return iC(P,b,p,P==="h"?w:C)},[]),l=R.useCallback(function(p){var b=p;if(!(!Pn.length||Pn[Pn.length-1]!==s)){var y="deltaY"in b?nu(b):vo(b),g=t.current.filter(function(x){return x.name===b.type&&(x.target===b.target||b.target===x.shadowParent)&&aC(x.delta,y)})[0];if(g&&g.should){b.cancelable&&b.preventDefault();return}if(!g){var w=(i.current.shards||[]).map(ru).filter(Boolean).filter(function(x){return x.contains(b.target)}),C=w.length>0?a(b,w[0]):!i.current.noIsolation;C&&b.cancelable&&b.preventDefault()}}},[]),c=R.useCallback(function(p,b,y,g){var w={name:p,delta:b,target:y,should:g,shadowParent:dC(y)};t.current.push(w),setTimeout(function(){t.current=t.current.filter(function(C){return C!==w})},1)},[]),u=R.useCallback(function(p){n.current=vo(p),r.current=void 0},[]),d=R.useCallback(function(p){c(p.type,nu(p),p.target,a(p,e.lockRef.current))},[]),f=R.useCallback(function(p){c(p.type,vo(p),p.target,a(p,e.lockRef.current))},[]);R.useEffect(function(){return Pn.push(s),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener("wheel",l,Mn),document.addEventListener("touchmove",l,Mn),document.addEventListener("touchstart",u,Mn),function(){Pn=Pn.filter(function(p){return p!==s}),document.removeEventListener("wheel",l,Mn),document.removeEventListener("touchmove",l,Mn),document.removeEventListener("touchstart",u,Mn)}},[]);var h=e.removeScrollBar,m=e.inert;return R.createElement(R.Fragment,null,m?R.createElement(s,{styles:lC(o)}):null,h?R.createElement(Q0,{gapMode:e.gapMode}):null)}function dC(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const fC=$0(Jh,uC);var Ms=R.forwardRef(function(e,t){return R.createElement(Ts,ht({},e,{ref:t,sideCar:fC}))});Ms.classNames=Ts.classNames;var Xi=["Enter"," "],hC=["ArrowDown","PageUp","Home"],rp=["ArrowUp","PageDown","End"],pC=[...hC,...rp],gC={ltr:[...Xi,"ArrowRight"],rtl:[...Xi,"ArrowLeft"]},mC={ltr:["ArrowLeft"],rtl:["ArrowRight"]},eo="Menu",[kr,vC,yC]=tl(eo),[bn,op]=Qt(eo,[yC,en,Wh]),Ps=en(),sp=Wh(),[wC,Sn]=bn(eo),[xC,to]=bn(eo),ip=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:o,onOpenChange:s,modal:i=!0}=e,a=Ps(t),[l,c]=R.useState(null),u=R.useRef(!1),d=et(s),f=nl(o);return R.useEffect(()=>{const h=()=>{u.current=!0,document.addEventListener("pointerdown",m,{capture:!0,once:!0}),document.addEventListener("pointermove",m,{capture:!0,once:!0})},m=()=>u.current=!1;return document.addEventListener("keydown",h,{capture:!0}),()=>{document.removeEventListener("keydown",h,{capture:!0}),document.removeEventListener("pointerdown",m,{capture:!0}),document.removeEventListener("pointermove",m,{capture:!0})}},[]),v.jsx(ys,{...a,children:v.jsx(wC,{scope:t,open:n,onOpenChange:d,content:l,onContentChange:c,children:v.jsx(xC,{scope:t,onClose:R.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:u,dir:f,modal:i,children:r})})})};ip.displayName=eo;var bC="MenuAnchor",sl=R.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=Ps(n);return v.jsx(Zr,{...o,...r,ref:t})});sl.displayName=bC;var il="MenuPortal",[SC,ap]=bn(il,{forceMount:void 0}),lp=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:o}=e,s=Sn(il,t);return v.jsx(SC,{scope:t,forceMount:n,children:v.jsx(Ot,{present:n||s.open,children:v.jsx(Jr,{asChild:!0,container:o,children:r})})})};lp.displayName=il;var Je="MenuContent",[CC,al]=bn(Je),cp=R.forwardRef((e,t)=>{const n=ap(Je,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,s=Sn(Je,e.__scopeMenu),i=to(Je,e.__scopeMenu);return v.jsx(kr.Provider,{scope:e.__scopeMenu,children:v.jsx(Ot,{present:r||s.open,children:v.jsx(kr.Slot,{scope:e.__scopeMenu,children:i.modal?v.jsx(RC,{...o,ref:t}):v.jsx(DC,{...o,ref:t})})})})}),RC=R.forwardRef((e,t)=>{const n=Sn(Je,e.__scopeMenu),r=R.useRef(null),o=pe(t,r);return R.useEffect(()=>{const s=r.current;if(s)return ol(s)},[]),v.jsx(ll,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:te(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),DC=R.forwardRef((e,t)=>{const n=Sn(Je,e.__scopeMenu);return v.jsx(ll,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),TC=gn("MenuContent.ScrollLock"),ll=R.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:o,onOpenAutoFocus:s,onCloseAutoFocus:i,disableOutsidePointerEvents:a,onEntryFocus:l,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:h,disableOutsideScroll:m,...p}=e,b=Sn(Je,n),y=to(Je,n),g=Ps(n),w=sp(n),C=vC(n),[x,M]=R.useState(null),S=R.useRef(null),D=pe(t,S,b.onContentChange),P=R.useRef(0),E=R.useRef(""),A=R.useRef(0),F=R.useRef(null),W=R.useRef("right"),L=R.useRef(0),j=m?Ms:R.Fragment,_=m?{as:TC,allowPinchZoom:!0}:void 0,N=V=>{var B,K;const k=E.current+V,I=C().filter(X=>!X.disabled),$=document.activeElement,H=(B=I.find(X=>X.ref.current===$))==null?void 0:B.textValue,U=I.map(X=>X.textValue),Z=VC(U,k,H),q=(K=I.find(X=>X.textValue===Z))==null?void 0:K.ref.current;(function X(G){E.current=G,window.clearTimeout(P.current),G!==""&&(P.current=window.setTimeout(()=>X(""),1e3))})(k),q&&setTimeout(()=>q.focus())};R.useEffect(()=>()=>window.clearTimeout(P.current),[]),rl();const O=R.useCallback(V=>{var I,$;return W.current===((I=F.current)==null?void 0:I.side)&&$C(V,($=F.current)==null?void 0:$.area)},[]);return v.jsx(CC,{scope:n,searchRef:E,onItemEnter:R.useCallback(V=>{O(V)&&V.preventDefault()},[O]),onItemLeave:R.useCallback(V=>{var k;O(V)||((k=S.current)==null||k.focus(),M(null))},[O]),onTriggerLeave:R.useCallback(V=>{O(V)&&V.preventDefault()},[O]),pointerGraceTimerRef:A,onPointerGraceIntentChange:R.useCallback(V=>{F.current=V},[]),children:v.jsx(j,{..._,children:v.jsx(Rs,{asChild:!0,trapped:o,onMountAutoFocus:te(s,V=>{var k;V.preventDefault(),(k=S.current)==null||k.focus({preventScroll:!0})}),onUnmountAutoFocus:i,children:v.jsx(qr,{asChild:!0,disableOutsidePointerEvents:a,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:h,children:v.jsx(T0,{asChild:!0,...w,dir:y.dir,orientation:"vertical",loop:r,currentTabStopId:x,onCurrentTabStopIdChange:M,onEntryFocus:te(l,V=>{y.isUsingKeyboardRef.current||V.preventDefault()}),preventScrollOnEntryFocus:!0,children:v.jsx(ws,{role:"menu","aria-orientation":"vertical","data-state":Dp(b.open),"data-radix-menu-content":"",dir:y.dir,...g,...p,ref:D,style:{outline:"none",...p.style},onKeyDown:te(p.onKeyDown,V=>{const I=V.target.closest("[data-radix-menu-content]")===V.currentTarget,$=V.ctrlKey||V.altKey||V.metaKey,H=V.key.length===1;I&&(V.key==="Tab"&&V.preventDefault(),!$&&H&&N(V.key));const U=S.current;if(V.target!==U||!pC.includes(V.key))return;V.preventDefault();const q=C().filter(B=>!B.disabled).map(B=>B.ref.current);rp.includes(V.key)&&q.reverse(),jC(q)}),onBlur:te(e.onBlur,V=>{V.currentTarget.contains(V.target)||(window.clearTimeout(P.current),E.current="")}),onPointerMove:te(e.onPointerMove,Ir(V=>{const k=V.target,I=L.current!==V.clientX;if(V.currentTarget.contains(k)&&I){const $=V.clientX>L.current?"right":"left";W.current=$,L.current=V.clientX}}))})})})})})})});cp.displayName=Je;var MC="MenuGroup",cl=R.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return v.jsx(ce.div,{role:"group",...r,ref:t})});cl.displayName=MC;var PC="MenuLabel",up=R.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return v.jsx(ce.div,{...r,ref:t})});up.displayName=PC;var Qo="MenuItem",ou="menu.itemSelect",Es=R.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...o}=e,s=R.useRef(null),i=to(Qo,e.__scopeMenu),a=al(Qo,e.__scopeMenu),l=pe(t,s),c=R.useRef(!1),u=()=>{const d=s.current;if(!n&&d){const f=new CustomEvent(ou,{bubbles:!0,cancelable:!0});d.addEventListener(ou,h=>r==null?void 0:r(h),{once:!0}),lh(d,f),f.defaultPrevented?c.current=!1:i.onClose()}};return v.jsx(dp,{...o,ref:l,disabled:n,onClick:te(e.onClick,u),onPointerDown:d=>{var f;(f=e.onPointerDown)==null||f.call(e,d),c.current=!0},onPointerUp:te(e.onPointerUp,d=>{var f;c.current||(f=d.currentTarget)==null||f.click()}),onKeyDown:te(e.onKeyDown,d=>{const f=a.searchRef.current!=="";n||f&&d.key===" "||Xi.includes(d.key)&&(d.currentTarget.click(),d.preventDefault())})})});Es.displayName=Qo;var dp=R.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:o,...s}=e,i=al(Qo,n),a=sp(n),l=R.useRef(null),c=pe(t,l),[u,d]=R.useState(!1),[f,h]=R.useState("");return R.useEffect(()=>{const m=l.current;m&&h((m.textContent??"").trim())},[s.children]),v.jsx(kr.ItemSlot,{scope:n,disabled:r,textValue:o??f,children:v.jsx(M0,{asChild:!0,...a,focusable:!r,children:v.jsx(ce.div,{role:"menuitem","data-highlighted":u?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...s,ref:c,onPointerMove:te(e.onPointerMove,Ir(m=>{r?i.onItemLeave(m):(i.onItemEnter(m),m.defaultPrevented||m.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:te(e.onPointerLeave,Ir(m=>i.onItemLeave(m))),onFocus:te(e.onFocus,()=>d(!0)),onBlur:te(e.onBlur,()=>d(!1))})})})}),EC="MenuCheckboxItem",fp=R.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...o}=e;return v.jsx(vp,{scope:e.__scopeMenu,checked:n,children:v.jsx(Es,{role:"menuitemcheckbox","aria-checked":es(n)?"mixed":n,...o,ref:t,"data-state":dl(n),onSelect:te(o.onSelect,()=>r==null?void 0:r(es(n)?!0:!n),{checkForDefaultPrevented:!1})})})});fp.displayName=EC;var hp="MenuRadioGroup",[AC,OC]=bn(hp,{value:void 0,onValueChange:()=>{}}),pp=R.forwardRef((e,t)=>{const{value:n,onValueChange:r,...o}=e,s=et(r);return v.jsx(AC,{scope:e.__scopeMenu,value:n,onValueChange:s,children:v.jsx(cl,{...o,ref:t})})});pp.displayName=hp;var gp="MenuRadioItem",mp=R.forwardRef((e,t)=>{const{value:n,...r}=e,o=OC(gp,e.__scopeMenu),s=n===o.value;return v.jsx(vp,{scope:e.__scopeMenu,checked:s,children:v.jsx(Es,{role:"menuitemradio","aria-checked":s,...r,ref:t,"data-state":dl(s),onSelect:te(r.onSelect,()=>{var i;return(i=o.onValueChange)==null?void 0:i.call(o,n)},{checkForDefaultPrevented:!1})})})});mp.displayName=gp;var ul="MenuItemIndicator",[vp,_C]=bn(ul,{checked:!1}),yp=R.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...o}=e,s=_C(ul,n);return v.jsx(Ot,{present:r||es(s.checked)||s.checked===!0,children:v.jsx(ce.span,{...o,ref:t,"data-state":dl(s.checked)})})});yp.displayName=ul;var kC="MenuSeparator",wp=R.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return v.jsx(ce.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});wp.displayName=kC;var IC="MenuArrow",xp=R.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=Ps(n);return v.jsx(xs,{...o,...r,ref:t})});xp.displayName=IC;var NC="MenuSub",[S_,bp]=bn(NC),vr="MenuSubTrigger",Sp=R.forwardRef((e,t)=>{const n=Sn(vr,e.__scopeMenu),r=to(vr,e.__scopeMenu),o=bp(vr,e.__scopeMenu),s=al(vr,e.__scopeMenu),i=R.useRef(null),{pointerGraceTimerRef:a,onPointerGraceIntentChange:l}=s,c={__scopeMenu:e.__scopeMenu},u=R.useCallback(()=>{i.current&&window.clearTimeout(i.current),i.current=null},[]);return R.useEffect(()=>u,[u]),R.useEffect(()=>{const d=a.current;return()=>{window.clearTimeout(d),l(null)}},[a,l]),v.jsx(sl,{asChild:!0,...c,children:v.jsx(dp,{id:o.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":o.contentId,"data-state":Dp(n.open),...e,ref:ps(t,o.onTriggerChange),onClick:d=>{var f;(f=e.onClick)==null||f.call(e,d),!(e.disabled||d.defaultPrevented)&&(d.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:te(e.onPointerMove,Ir(d=>{s.onItemEnter(d),!d.defaultPrevented&&!e.disabled&&!n.open&&!i.current&&(s.onPointerGraceIntentChange(null),i.current=window.setTimeout(()=>{n.onOpenChange(!0),u()},100))})),onPointerLeave:te(e.onPointerLeave,Ir(d=>{var h,m;u();const f=(h=n.content)==null?void 0:h.getBoundingClientRect();if(f){const p=(m=n.content)==null?void 0:m.dataset.side,b=p==="right",y=b?-5:5,g=f[b?"left":"right"],w=f[b?"right":"left"];s.onPointerGraceIntentChange({area:[{x:d.clientX+y,y:d.clientY},{x:g,y:f.top},{x:w,y:f.top},{x:w,y:f.bottom},{x:g,y:f.bottom}],side:p}),window.clearTimeout(a.current),a.current=window.setTimeout(()=>s.onPointerGraceIntentChange(null),300)}else{if(s.onTriggerLeave(d),d.defaultPrevented)return;s.onPointerGraceIntentChange(null)}})),onKeyDown:te(e.onKeyDown,d=>{var h;const f=s.searchRef.current!=="";e.disabled||f&&d.key===" "||gC[r.dir].includes(d.key)&&(n.onOpenChange(!0),(h=n.content)==null||h.focus(),d.preventDefault())})})})});Sp.displayName=vr;var Cp="MenuSubContent",Rp=R.forwardRef((e,t)=>{const n=ap(Je,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,s=Sn(Je,e.__scopeMenu),i=to(Je,e.__scopeMenu),a=bp(Cp,e.__scopeMenu),l=R.useRef(null),c=pe(t,l);return v.jsx(kr.Provider,{scope:e.__scopeMenu,children:v.jsx(Ot,{present:r||s.open,children:v.jsx(kr.Slot,{scope:e.__scopeMenu,children:v.jsx(ll,{id:a.contentId,"aria-labelledby":a.triggerId,...o,ref:c,align:"start",side:i.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:u=>{var d;i.isUsingKeyboardRef.current&&((d=l.current)==null||d.focus()),u.preventDefault()},onCloseAutoFocus:u=>u.preventDefault(),onFocusOutside:te(e.onFocusOutside,u=>{u.target!==a.trigger&&s.onOpenChange(!1)}),onEscapeKeyDown:te(e.onEscapeKeyDown,u=>{i.onClose(),u.preventDefault()}),onKeyDown:te(e.onKeyDown,u=>{var h;const d=u.currentTarget.contains(u.target),f=mC[i.dir].includes(u.key);d&&f&&(s.onOpenChange(!1),(h=a.trigger)==null||h.focus(),u.preventDefault())})})})})})});Rp.displayName=Cp;function Dp(e){return e?"open":"closed"}function es(e){return e==="indeterminate"}function dl(e){return es(e)?"indeterminate":e?"checked":"unchecked"}function jC(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function FC(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function VC(e,t,n){const o=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let i=FC(e,Math.max(s,0));o.length===1&&(i=i.filter(c=>c!==n));const l=i.find(c=>c.toLowerCase().startsWith(o.toLowerCase()));return l!==n?l:void 0}function LC(e,t){const{x:n,y:r}=e;let o=!1;for(let s=0,i=t.length-1;s<t.length;i=s++){const a=t[s].x,l=t[s].y,c=t[i].x,u=t[i].y;l>r!=u>r&&n<(c-a)*(r-l)/(u-l)+a&&(o=!o)}return o}function $C(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return LC(n,t)}function Ir(e){return t=>t.pointerType==="mouse"?e(t):void 0}var BC=ip,zC=sl,HC=lp,WC=cp,UC=cl,GC=up,KC=Es,YC=fp,qC=pp,XC=mp,ZC=yp,JC=wp,QC=xp,eR=Sp,tR=Rp,fl="DropdownMenu",[nR,C_]=Qt(fl,[op]),Ve=op(),[rR,Tp]=nR(fl),Mp=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:o,defaultOpen:s,onOpenChange:i,modal:a=!0}=e,l=Ve(t),c=R.useRef(null),[u=!1,d]=vn({prop:o,defaultProp:s,onChange:i});return v.jsx(rR,{scope:t,triggerId:Ut(),triggerRef:c,contentId:Ut(),open:u,onOpenChange:d,onOpenToggle:R.useCallback(()=>d(f=>!f),[d]),modal:a,children:v.jsx(BC,{...l,open:u,onOpenChange:d,dir:r,modal:a,children:n})})};Mp.displayName=fl;var Pp="DropdownMenuTrigger",Ep=R.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...o}=e,s=Tp(Pp,n),i=Ve(n);return v.jsx(zC,{asChild:!0,...i,children:v.jsx(ce.button,{type:"button",id:s.triggerId,"aria-haspopup":"menu","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":s.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...o,ref:ps(t,s.triggerRef),onPointerDown:te(e.onPointerDown,a=>{!r&&a.button===0&&a.ctrlKey===!1&&(s.onOpenToggle(),s.open||a.preventDefault())}),onKeyDown:te(e.onKeyDown,a=>{r||(["Enter"," "].includes(a.key)&&s.onOpenToggle(),a.key==="ArrowDown"&&s.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(a.key)&&a.preventDefault())})})})});Ep.displayName=Pp;var oR="DropdownMenuPortal",Ap=e=>{const{__scopeDropdownMenu:t,...n}=e,r=Ve(t);return v.jsx(HC,{...r,...n})};Ap.displayName=oR;var Op="DropdownMenuContent",_p=R.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Tp(Op,n),s=Ve(n),i=R.useRef(!1);return v.jsx(WC,{id:o.contentId,"aria-labelledby":o.triggerId,...s,...r,ref:t,onCloseAutoFocus:te(e.onCloseAutoFocus,a=>{var l;i.current||(l=o.triggerRef.current)==null||l.focus(),i.current=!1,a.preventDefault()}),onInteractOutside:te(e.onInteractOutside,a=>{const l=a.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0,u=l.button===2||c;(!o.modal||u)&&(i.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});_p.displayName=Op;var sR="DropdownMenuGroup",iR=R.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ve(n);return v.jsx(UC,{...o,...r,ref:t})});iR.displayName=sR;var aR="DropdownMenuLabel",kp=R.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ve(n);return v.jsx(GC,{...o,...r,ref:t})});kp.displayName=aR;var lR="DropdownMenuItem",Ip=R.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ve(n);return v.jsx(KC,{...o,...r,ref:t})});Ip.displayName=lR;var cR="DropdownMenuCheckboxItem",Np=R.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ve(n);return v.jsx(YC,{...o,...r,ref:t})});Np.displayName=cR;var uR="DropdownMenuRadioGroup",dR=R.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ve(n);return v.jsx(qC,{...o,...r,ref:t})});dR.displayName=uR;var fR="DropdownMenuRadioItem",hR=R.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ve(n);return v.jsx(XC,{...o,...r,ref:t})});hR.displayName=fR;var pR="DropdownMenuItemIndicator",jp=R.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ve(n);return v.jsx(ZC,{...o,...r,ref:t})});jp.displayName=pR;var gR="DropdownMenuSeparator",Fp=R.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ve(n);return v.jsx(JC,{...o,...r,ref:t})});Fp.displayName=gR;var mR="DropdownMenuArrow",vR=R.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ve(n);return v.jsx(QC,{...o,...r,ref:t})});vR.displayName=mR;var yR="DropdownMenuSubTrigger",wR=R.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ve(n);return v.jsx(eR,{...o,...r,ref:t})});wR.displayName=yR;var xR="DropdownMenuSubContent",bR=R.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ve(n);return v.jsx(tR,{...o,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});bR.displayName=xR;var SR=Mp,CR=Ep,RR=Ap,DR=_p,TR=kp,MR=Ip,PR=Np,ER=jp,AR=Fp;function hl({...e}){return v.jsx(SR,{"data-slot":"dropdown-menu",...e})}function pl({...e}){return v.jsx(CR,{"data-slot":"dropdown-menu-trigger",...e})}function gl({className:e,sideOffset:t=4,...n}){return v.jsx(RR,{children:v.jsx(DR,{"data-slot":"dropdown-menu-content",sideOffset:t,style:{zIndex:100},className:he("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",e),...n})})}function su({className:e,inset:t,variant:n="default",...r}){return v.jsx(MR,{"data-slot":"dropdown-menu-item","data-inset":t,"data-variant":n,className:he("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...r})}function OR({className:e,children:t,checked:n,...r}){return v.jsxs(PR,{"data-slot":"dropdown-menu-checkbox-item",className:he("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),checked:n,...r,children:[v.jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:v.jsx(ER,{children:v.jsx(Uf,{className:"size-4"})})}),t]})}function _R({className:e,inset:t,...n}){return v.jsx(TR,{"data-slot":"dropdown-menu-label","data-inset":t,className:he("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",e),...n})}function kR({className:e,...t}){return v.jsx(AR,{"data-slot":"dropdown-menu-separator",className:he("bg-border -mx-1 my-1 h-px",e),...t})}var IR="Label",Vp=R.forwardRef((e,t)=>v.jsx(ce.label,{...e,ref:t,onMouseDown:n=>{var o;n.target.closest("button, input, select, textarea")||((o=e.onMouseDown)==null||o.call(e,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));Vp.displayName=IR;var NR=Vp;function jR({className:e,...t}){return v.jsx(NR,{"data-slot":"label",className:he("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...t})}const FR=({onClose:e,side:t,onOpenChange:n,buttonTrigger:r,modal:o=!1,children:s})=>{const[i,a]=T.useState({x:0,y:0}),l=xn(el(p=>p.updateIsDragging)),{attributes:c,listeners:u,setNodeRef:d,transform:f,setActivatorNodeRef:h}=Fa({id:"booking_info",data:{type:"another"}}),m={transform:`translate3d(${i.x+((f==null?void 0:f.x)||0)}px, ${i.y+((f==null?void 0:f.y)||0)}px, 0)`};return Gr({onDragStart(){l(!0)},onDragEnd(p){if(p.active.id){const{y:b,x:y}=i;a({x:y+((f==null?void 0:f.x)||0),y:b+((f==null?void 0:f.y)||0)}),l(!1)}}}),v.jsxs(hl,{dir:"ltr",modal:o,open:!0,onOpenChange:n,children:[v.jsx(pl,{asChild:!0,children:r||v.jsx("div",{})}),v.jsxs(gl,{ref:d,style:{...m,zIndex:100,width:"25rem"},forceMount:!0,avoidCollisions:!0,side:t,sticky:"always",updatePositionStrategy:"always",...c,children:[v.jsxs("div",{className:"dropdownLabelContent",children:[v.jsx(jR,{ref:h,className:"dropdownLabelContent_dropdownLabel",...u,children:"Appointment"}),v.jsx(Tx,{className:"dropdownLabelContent_close",onClick:e})]}),s]})]})},Lp=({modal:e=!1,side:t,onClose:n,onOpenChange:r,buttonTrigger:o,ref:s})=>{const[i,a]=T.useState(!1),{createBookingModal:l}=wn(),c=()=>{a(!1),n==null||n()},u=d=>{a(d),r==null||r(d)};return T.useImperativeHandle(s,()=>({showCreationModal:()=>a(!0),closeModal:()=>a(!1),isModalOpen:()=>i})),v.jsx(v.Fragment,{children:i&&v.jsx(ja,{children:v.jsx(FR,{modal:e,side:t,onClose:c,onOpenChange:u,buttonTrigger:o,children:l})})})},VR=({children:e})=>{const{setTodayDay:t,setBookingViewType:n,bookingViewType:r,daysOfWeek:o}=$e(),{users:s}=Hr(C=>C),{updateMonthMessage:i,updateHeaderDateLabel:a}=hf(C=>C),{onViewTypeChange:l}=df(),{onHeaderDayClick:c}=wn(),{resetSelectedNode:u,resetNodes:d}=Jt(C=>C),{systemColor:f}=yf(C=>C),h=T.useRef(null),m=()=>h.current,p=()=>{var C;(C=m())==null||C.showCreationModal()},b=T.useCallback(C=>{const x=()=>{n(ae.WEEK),l(ae.WEEK)},M=()=>r===ae.DAY;if(c==null||c(C,r),M())return x();const S=t(C);if(!S)return;const D={month:S.getMonth(),fullYear:S.getFullYear(),monthMessage:Nn[S.getMonth()]};i(D),n(ae.DAY)},[r,t,i,n]),y=r===ae.TABLE?{justifySelf:"start"}:{},g=T.useMemo(()=>{if(r===ae.DAY){const C=[],x=s.filter(M=>M.status);for(let M=0;M<x.length;M++)C.push(o[0]);return C.map((M,S)=>({day:M,user:x[S]}))}return o},[r,o,s]),w=T.useMemo(()=>{const C=x=>new Date(x).toDateString()===new Date().toDateString();return r===ae.DAY?g.map(x=>{var P;if(x instanceof Date)return;const{day:M,user:S}=x,D=Bo[new Date(M).getDay()];return v.jsx("th",{style:{borderBottom:"1px solid #8080807a"},className:"daysOfWeek",children:v.jsxs("div",{style:{...y},className:"daysOfWeek_parent",children:[v.jsx("span",{style:{color:C(M)?f:void 0},children:D}),v.jsx("div",{style:{width:"100%"},children:v.jsx(Rt,{type:"button",style:{backgroundColor:C(M)?f:void 0},className:he("daysOfWeek_indicator",C(M)?"daysOfWeek_day_today":void 0),variant:"secondary",onClick:()=>b(M),children:Y.formatDate(M.toDateString())})}),(P=S==null?void 0:S.profile)==null?void 0:P.name]})},`${D}-${S.id}`)}):o.map(x=>{const M=Bo[new Date(x).getDay()];return v.jsx("th",{style:{borderBottom:r!=="table"?"1px solid #8080807a":""},className:he("daysOfWeek"),children:v.jsxs("div",{style:{...y},className:"daysOfWeek_parent",children:[v.jsx("span",{style:{color:C(x)?f:void 0},children:M}),v.jsx("div",{style:{width:"100%"},children:v.jsx(Rt,{type:"button",style:{backgroundColor:C(x)?f:void 0},className:he("daysOfWeek_indicator",C(x)?"daysOfWeek_day_today":void 0),variant:"secondary",onClick:()=>b(x),children:Y.formatDate(x.toDateString())})}),v.jsx("div",{style:{height:"1.5rem"}})]})},M)})},[o,b,r,g]);return T.useEffect(()=>{switch(r){case ae.DAY:{d(),u(),a(o[0]);break}case ae.WEEK:{const C=Y.generateWeekMonthLabel(o);i({monthMessage:C})}}},[o,r]),v.jsxs(v.Fragment,{children:[v.jsxs("table",{className:"daysOfWeek_table",children:[v.jsx("thead",{children:v.jsxs("tr",{children:[v.jsx("th",{style:{...y,zIndex:101},className:"time-col",children:v.jsx("div",{className:"daysOfWeek_emptySlot",children:v.jsx(Qa,{content:"createNewBookingLabel",children:v.jsx(Rt,{variant:"ghost",onClick:p,children:v.jsx(lx,{})})})})},"emptyBlocks"),w]})}),e]}),v.jsx(Lp,{modal:!0,ref:h})]})},$p=({booking:e,onAddTime:t,onAddStartTime:n,onSubTime:r,starter:o=!1})=>{const[s,i]=T.useState({height:Ht,width:Ht}),[a,l]=T.useState(0),c=P=>{const E=new Date(P);return E.setHours(24,0,0),Y.timeDiffInMinutes(E,P)},u=P=>P.getHours()===0&&P.getMinutes()===0,d=(P,E)=>{const A=new Date(P);return u(P)&&P.getTime()<=E.getTime()&&A.setDate(A.getDate()+1),A},f=(P,E)=>{const A=d(P,E);if(A.getTime()<=E.getTime())return console.error("Invalid booking: finish time must be after start time",{start:E.toISOString(),finish:A.toISOString()}),-Math.abs(1*2);if(Y.isFinishDateAnotherDay(A,E)){const j=c(E),_=Math.ceil(j/Oo);return-Math.abs((_-1)*2)}const W=Y.timeDiffInMinutes(A,E);if(W<=0)return console.warn("Calculated negative or zero duration",{start:E.toISOString(),finish:A.toISOString(),diffInMinutes:W}),-Math.abs(1*2);const L=Math.ceil(W/Oo);return-Math.abs((L-1)*2)},[h,m]=T.useState(o?f(e.finishAt,e.startAt):0),p=P=>P===-Math.abs(0)||P===0,b=()=>Y.timeDiffInMinutes(e.finishAt,e.startAt)===Oo,y=async P=>{if(P.includes("n")){const E=C(e.startAt,"add");if(b())return;l(A=>A+2),n&&n(E)}else{const E=w(e.finishAt,"add");m(A=>p(A)?uf:A-2),t&&t(E)}},g=async P=>{if(P.includes("n")){const A=C(e.startAt,"remove");l(F=>F-2),n&&n(A);return}const E=w(e.finishAt,"remove");b()||(m(A=>A+2),r&&r(E))},w=(P,E)=>{const A=new Date(P),F=A.getMinutes();return E==="add"&&A.setMinutes(F+15),E==="remove"&&A.setMinutes(F-15),A},C=(P,E)=>{const A=new Date(P),F=A.getMinutes();return E==="add"&&A.setMinutes(F+15),E==="remove"&&A.setMinutes(F-15),A};return{state:s,setState:i,resetState:()=>{i({height:Ht,width:Ht})},resetHeightStyle:()=>{m(0)},heightStyle:h,topHeightIncrement:a,onResize:(P,{size:E,handle:A})=>{switch(P.stopPropagation(),P.preventDefault(),A){case"se":case"s":{i(F=>(Number(F.height)<Number(E.height)&&y(["s","se"]),Number(F.height)>Number(E.height)&&g(["s","se"]),{...F,height:E.height}));break}case"n":{i(F=>Math.abs(Number(E.height-Number(F.height)))<10?{...F,height:E.height}:(+(F.height<Number(E.height))&&g(["n"]),+(F.height>Number(E.height))&&y(["n"]),{...F,height:E.height}));break}}},updateHeightStyle:(P,E)=>{m(f(P,E))}}};var ml="Popover",[Bp,R_]=Qt(ml,[en]),no=en(),[LR,tn]=Bp(ml),zp=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:o,onOpenChange:s,modal:i=!1}=e,a=no(t),l=R.useRef(null),[c,u]=R.useState(!1),[d=!1,f]=vn({prop:r,defaultProp:o,onChange:s});return v.jsx(ys,{...a,children:v.jsx(LR,{scope:t,contentId:Ut(),triggerRef:l,open:d,onOpenChange:f,onOpenToggle:R.useCallback(()=>f(h=>!h),[f]),hasCustomAnchor:c,onCustomAnchorAdd:R.useCallback(()=>u(!0),[]),onCustomAnchorRemove:R.useCallback(()=>u(!1),[]),modal:i,children:n})})};zp.displayName=ml;var Hp="PopoverAnchor",Wp=R.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=tn(Hp,n),s=no(n),{onCustomAnchorAdd:i,onCustomAnchorRemove:a}=o;return R.useEffect(()=>(i(),()=>a()),[i,a]),v.jsx(Zr,{...s,...r,ref:t})});Wp.displayName=Hp;var Up="PopoverTrigger",Gp=R.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=tn(Up,n),s=no(n),i=pe(t,o.triggerRef),a=v.jsx(ce.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":Zp(o.open),...r,ref:i,onClick:te(e.onClick,o.onOpenToggle)});return o.hasCustomAnchor?a:v.jsx(Zr,{asChild:!0,...s,children:a})});Gp.displayName=Up;var vl="PopoverPortal",[$R,BR]=Bp(vl,{forceMount:void 0}),Kp=e=>{const{__scopePopover:t,forceMount:n,children:r,container:o}=e,s=tn(vl,t);return v.jsx($R,{scope:t,forceMount:n,children:v.jsx(Ot,{present:n||s.open,children:v.jsx(Jr,{asChild:!0,container:o,children:r})})})};Kp.displayName=vl;var Bn="PopoverContent",Yp=R.forwardRef((e,t)=>{const n=BR(Bn,e.__scopePopover),{forceMount:r=n.forceMount,...o}=e,s=tn(Bn,e.__scopePopover);return v.jsx(Ot,{present:r||s.open,children:s.modal?v.jsx(HR,{...o,ref:t}):v.jsx(WR,{...o,ref:t})})});Yp.displayName=Bn;var zR=gn("PopoverContent.RemoveScroll"),HR=R.forwardRef((e,t)=>{const n=tn(Bn,e.__scopePopover),r=R.useRef(null),o=pe(t,r),s=R.useRef(!1);return R.useEffect(()=>{const i=r.current;if(i)return ol(i)},[]),v.jsx(Ms,{as:zR,allowPinchZoom:!0,children:v.jsx(qp,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:te(e.onCloseAutoFocus,i=>{var a;i.preventDefault(),s.current||(a=n.triggerRef.current)==null||a.focus()}),onPointerDownOutside:te(e.onPointerDownOutside,i=>{const a=i.detail.originalEvent,l=a.button===0&&a.ctrlKey===!0,c=a.button===2||l;s.current=c},{checkForDefaultPrevented:!1}),onFocusOutside:te(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1})})})}),WR=R.forwardRef((e,t)=>{const n=tn(Bn,e.__scopePopover),r=R.useRef(!1),o=R.useRef(!1);return v.jsx(qp,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{var i,a;(i=e.onCloseAutoFocus)==null||i.call(e,s),s.defaultPrevented||(r.current||(a=n.triggerRef.current)==null||a.focus(),s.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:s=>{var l,c;(l=e.onInteractOutside)==null||l.call(e,s),s.defaultPrevented||(r.current=!0,s.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const i=s.target;((c=n.triggerRef.current)==null?void 0:c.contains(i))&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&o.current&&s.preventDefault()}})}),qp=R.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:s,disableOutsidePointerEvents:i,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:c,onInteractOutside:u,...d}=e,f=tn(Bn,n),h=no(n);return rl(),v.jsx(Rs,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:s,children:v.jsx(qr,{asChild:!0,disableOutsidePointerEvents:i,onInteractOutside:u,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:c,onDismiss:()=>f.onOpenChange(!1),children:v.jsx(ws,{"data-state":Zp(f.open),role:"dialog",id:f.contentId,...h,...d,ref:t,style:{...d.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),Xp="PopoverClose",UR=R.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=tn(Xp,n);return v.jsx(ce.button,{type:"button",...r,ref:t,onClick:te(e.onClick,()=>o.onOpenChange(!1))})});UR.displayName=Xp;var GR="PopoverArrow",KR=R.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=no(n);return v.jsx(xs,{...o,...r,ref:t})});KR.displayName=GR;function Zp(e){return e?"open":"closed"}var YR=zp,qR=Wp,XR=Gp,ZR=Kp,JR=Yp;function QR({...e}){return v.jsx(YR,{"data-slot":"popover",...e})}function eD({...e}){return v.jsx(XR,{"data-slot":"popover-trigger",...e})}function tD({className:e,align:t="center",sideOffset:n=4,...r}){return v.jsx(ZR,{children:v.jsx(JR,{"data-slot":"popover-content",align:t,sideOffset:n,className:he("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",e),...r})})}function nD({...e}){return v.jsx(qR,{"data-slot":"popover-anchor",...e})}var rD="Toggle",Jp=R.forwardRef((e,t)=>{const{pressed:n,defaultPressed:r=!1,onPressedChange:o,...s}=e,[i=!1,a]=vn({prop:n,onChange:o,defaultProp:r});return v.jsx(ce.button,{type:"button","aria-pressed":i,"data-state":i?"on":"off","data-disabled":e.disabled?"":void 0,...s,ref:t,onClick:te(e.onClick,()=>{e.disabled||a(!i)})})});Jp.displayName=rD;var oD=Jp;const sD=La("inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium hover:bg-muted hover:text-muted-foreground disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [&_svg]:shrink-0 focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] outline-none transition-[color,box-shadow] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive whitespace-nowrap",{variants:{variant:{default:"bg-transparent",outline:"border border-input bg-transparent shadow-xs hover:bg-accent hover:text-accent-foreground"},size:{default:"h-9 px-2 min-w-9",sm:"h-8 px-1.5 min-w-8",lg:"h-10 px-2.5 min-w-10"}},defaultVariants:{variant:"default",size:"default"}});function iD({className:e,variant:t,size:n,...r}){return v.jsx(oD,{"data-slot":"toggle",className:he(sD({variant:t,size:n,className:e})),...r})}const aD=()=>{const[e,t]=T.useState(!1);return v.jsx(Ja,{children:v.jsxs(Lh,{children:[v.jsx($h,{asChild:!0,children:v.jsx("div",{children:v.jsx(iD,{className:"group size-10 p-0 hover:bg-indigo-50 hover:text-indigo-500 data-[state=on]:bg-indigo-50 data-[state=on]:text-indigo-500","aria-label":"Bookmark this",variant:e?"default":"outline",pressed:e,onPressedChange:t,children:v.jsx(Kw,{size:16,strokeWidth:2,"aria-hidden":"true"})})})}),v.jsx(Bh,{className:"border border-input bg-popover px-2 py-1 text-xs text-muted-foreground",children:v.jsx("p",{children:e?"Remove bookmark":"Bookmark this"})})]})})};function iu(e,[t,n]){return Math.min(n,Math.max(t,e))}function lD(e){const t=R.useRef({value:e,previous:e});return R.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var cD=[" ","Enter","ArrowUp","ArrowDown"],uD=[" ","Enter"],ro="Select",[As,Os,dD]=tl(ro),[Zn,D_]=Qt(ro,[dD,en]),_s=en(),[fD,nn]=Zn(ro),[hD,pD]=Zn(ro),Qp=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:o,onOpenChange:s,value:i,defaultValue:a,onValueChange:l,dir:c,name:u,autoComplete:d,disabled:f,required:h,form:m}=e,p=_s(t),[b,y]=R.useState(null),[g,w]=R.useState(null),[C,x]=R.useState(!1),M=nl(c),[S=!1,D]=vn({prop:r,defaultProp:o,onChange:s}),[P,E]=vn({prop:i,defaultProp:a,onChange:l}),A=R.useRef(null),F=b?m||!!b.closest("form"):!0,[W,L]=R.useState(new Set),j=Array.from(W).map(_=>_.props.value).join(";");return v.jsx(ys,{...p,children:v.jsxs(fD,{required:h,scope:t,trigger:b,onTriggerChange:y,valueNode:g,onValueNodeChange:w,valueNodeHasChildren:C,onValueNodeHasChildrenChange:x,contentId:Ut(),value:P,onValueChange:E,open:S,onOpenChange:D,dir:M,triggerPointerDownPosRef:A,disabled:f,children:[v.jsx(As.Provider,{scope:t,children:v.jsx(hD,{scope:e.__scopeSelect,onNativeOptionAdd:R.useCallback(_=>{L(N=>new Set(N).add(_))},[]),onNativeOptionRemove:R.useCallback(_=>{L(N=>{const O=new Set(N);return O.delete(_),O})},[]),children:n})}),F?v.jsxs(Sg,{"aria-hidden":!0,required:h,tabIndex:-1,name:u,autoComplete:d,value:P,onChange:_=>E(_.target.value),disabled:f,form:m,children:[P===void 0?v.jsx("option",{value:""}):null,Array.from(W)]},j):null]})})};Qp.displayName=ro;var eg="SelectTrigger",tg=R.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...o}=e,s=_s(n),i=nn(eg,n),a=i.disabled||r,l=pe(t,i.onTriggerChange),c=Os(n),u=R.useRef("touch"),[d,f,h]=Cg(p=>{const b=c().filter(w=>!w.disabled),y=b.find(w=>w.value===i.value),g=Rg(b,p,y);g!==void 0&&i.onValueChange(g.value)}),m=p=>{a||(i.onOpenChange(!0),h()),p&&(i.triggerPointerDownPosRef.current={x:Math.round(p.pageX),y:Math.round(p.pageY)})};return v.jsx(Zr,{asChild:!0,...s,children:v.jsx(ce.button,{type:"button",role:"combobox","aria-controls":i.contentId,"aria-expanded":i.open,"aria-required":i.required,"aria-autocomplete":"none",dir:i.dir,"data-state":i.open?"open":"closed",disabled:a,"data-disabled":a?"":void 0,"data-placeholder":bg(i.value)?"":void 0,...o,ref:l,onClick:te(o.onClick,p=>{p.currentTarget.focus(),u.current!=="mouse"&&m(p)}),onPointerDown:te(o.onPointerDown,p=>{u.current=p.pointerType;const b=p.target;b.hasPointerCapture(p.pointerId)&&b.releasePointerCapture(p.pointerId),p.button===0&&p.ctrlKey===!1&&p.pointerType==="mouse"&&(m(p),p.preventDefault())}),onKeyDown:te(o.onKeyDown,p=>{const b=d.current!=="";!(p.ctrlKey||p.altKey||p.metaKey)&&p.key.length===1&&f(p.key),!(b&&p.key===" ")&&cD.includes(p.key)&&(m(),p.preventDefault())})})})});tg.displayName=eg;var ng="SelectValue",rg=R.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,children:s,placeholder:i="",...a}=e,l=nn(ng,n),{onValueNodeHasChildrenChange:c}=l,u=s!==void 0,d=pe(t,l.onValueNodeChange);return je(()=>{c(u)},[c,u]),v.jsx(ce.span,{...a,ref:d,style:{pointerEvents:"none"},children:bg(l.value)?v.jsx(v.Fragment,{children:i}):s})});rg.displayName=ng;var gD="SelectIcon",og=R.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...o}=e;return v.jsx(ce.span,{"aria-hidden":!0,...o,ref:t,children:r||"▼"})});og.displayName=gD;var mD="SelectPortal",sg=e=>v.jsx(Jr,{asChild:!0,...e});sg.displayName=mD;var yn="SelectContent",ig=R.forwardRef((e,t)=>{const n=nn(yn,e.__scopeSelect),[r,o]=R.useState();if(je(()=>{o(new DocumentFragment)},[]),!n.open){const s=r;return s?as.createPortal(v.jsx(ag,{scope:e.__scopeSelect,children:v.jsx(As.Slot,{scope:e.__scopeSelect,children:v.jsx("div",{children:e.children})})}),s):null}return v.jsx(lg,{...e,ref:t})});ig.displayName=yn;var nt=10,[ag,rn]=Zn(yn),vD="SelectContentImpl",yD=gn("SelectContent.RemoveScroll"),lg=R.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:s,onPointerDownOutside:i,side:a,sideOffset:l,align:c,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:h,sticky:m,hideWhenDetached:p,avoidCollisions:b,...y}=e,g=nn(yn,n),[w,C]=R.useState(null),[x,M]=R.useState(null),S=pe(t,B=>C(B)),[D,P]=R.useState(null),[E,A]=R.useState(null),F=Os(n),[W,L]=R.useState(!1),j=R.useRef(!1);R.useEffect(()=>{if(w)return ol(w)},[w]),rl();const _=R.useCallback(B=>{const[K,...X]=F().map(z=>z.ref.current),[G]=X.slice(-1),ne=document.activeElement;for(const z of B)if(z===ne||(z==null||z.scrollIntoView({block:"nearest"}),z===K&&x&&(x.scrollTop=0),z===G&&x&&(x.scrollTop=x.scrollHeight),z==null||z.focus(),document.activeElement!==ne))return},[F,x]),N=R.useCallback(()=>_([D,w]),[_,D,w]);R.useEffect(()=>{W&&N()},[W,N]);const{onOpenChange:O,triggerPointerDownPosRef:V}=g;R.useEffect(()=>{if(w){let B={x:0,y:0};const K=G=>{var ne,z;B={x:Math.abs(Math.round(G.pageX)-(((ne=V.current)==null?void 0:ne.x)??0)),y:Math.abs(Math.round(G.pageY)-(((z=V.current)==null?void 0:z.y)??0))}},X=G=>{B.x<=10&&B.y<=10?G.preventDefault():w.contains(G.target)||O(!1),document.removeEventListener("pointermove",K),V.current=null};return V.current!==null&&(document.addEventListener("pointermove",K),document.addEventListener("pointerup",X,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",K),document.removeEventListener("pointerup",X,{capture:!0})}}},[w,O,V]),R.useEffect(()=>{const B=()=>O(!1);return window.addEventListener("blur",B),window.addEventListener("resize",B),()=>{window.removeEventListener("blur",B),window.removeEventListener("resize",B)}},[O]);const[k,I]=Cg(B=>{const K=F().filter(ne=>!ne.disabled),X=K.find(ne=>ne.ref.current===document.activeElement),G=Rg(K,B,X);G&&setTimeout(()=>G.ref.current.focus())}),$=R.useCallback((B,K,X)=>{const G=!j.current&&!X;(g.value!==void 0&&g.value===K||G)&&(P(B),G&&(j.current=!0))},[g.value]),H=R.useCallback(()=>w==null?void 0:w.focus(),[w]),U=R.useCallback((B,K,X)=>{const G=!j.current&&!X;(g.value!==void 0&&g.value===K||G)&&A(B)},[g.value]),Z=r==="popper"?Zi:cg,q=Z===Zi?{side:a,sideOffset:l,align:c,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:h,sticky:m,hideWhenDetached:p,avoidCollisions:b}:{};return v.jsx(ag,{scope:n,content:w,viewport:x,onViewportChange:M,itemRefCallback:$,selectedItem:D,onItemLeave:H,itemTextRefCallback:U,focusSelectedItem:N,selectedItemText:E,position:r,isPositioned:W,searchRef:k,children:v.jsx(Ms,{as:yD,allowPinchZoom:!0,children:v.jsx(Rs,{asChild:!0,trapped:g.open,onMountAutoFocus:B=>{B.preventDefault()},onUnmountAutoFocus:te(o,B=>{var K;(K=g.trigger)==null||K.focus({preventScroll:!0}),B.preventDefault()}),children:v.jsx(qr,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:B=>B.preventDefault(),onDismiss:()=>g.onOpenChange(!1),children:v.jsx(Z,{role:"listbox",id:g.contentId,"data-state":g.open?"open":"closed",dir:g.dir,onContextMenu:B=>B.preventDefault(),...y,...q,onPlaced:()=>L(!0),ref:S,style:{display:"flex",flexDirection:"column",outline:"none",...y.style},onKeyDown:te(y.onKeyDown,B=>{const K=B.ctrlKey||B.altKey||B.metaKey;if(B.key==="Tab"&&B.preventDefault(),!K&&B.key.length===1&&I(B.key),["ArrowUp","ArrowDown","Home","End"].includes(B.key)){let G=F().filter(ne=>!ne.disabled).map(ne=>ne.ref.current);if(["ArrowUp","End"].includes(B.key)&&(G=G.slice().reverse()),["ArrowUp","ArrowDown"].includes(B.key)){const ne=B.target,z=G.indexOf(ne);G=G.slice(z+1)}setTimeout(()=>_(G)),B.preventDefault()}})})})})})})});lg.displayName=vD;var wD="SelectItemAlignedPosition",cg=R.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...o}=e,s=nn(yn,n),i=rn(yn,n),[a,l]=R.useState(null),[c,u]=R.useState(null),d=pe(t,S=>u(S)),f=Os(n),h=R.useRef(!1),m=R.useRef(!0),{viewport:p,selectedItem:b,selectedItemText:y,focusSelectedItem:g}=i,w=R.useCallback(()=>{if(s.trigger&&s.valueNode&&a&&c&&p&&b&&y){const S=s.trigger.getBoundingClientRect(),D=c.getBoundingClientRect(),P=s.valueNode.getBoundingClientRect(),E=y.getBoundingClientRect();if(s.dir!=="rtl"){const ne=E.left-D.left,z=P.left-ne,le=S.left-z,me=S.width+le,Ie=Math.max(me,D.width),Ee=window.innerWidth-nt,ct=iu(z,[nt,Math.max(nt,Ee-Ie)]);a.style.minWidth=me+"px",a.style.left=ct+"px"}else{const ne=D.right-E.right,z=window.innerWidth-P.right-ne,le=window.innerWidth-S.right-z,me=S.width+le,Ie=Math.max(me,D.width),Ee=window.innerWidth-nt,ct=iu(z,[nt,Math.max(nt,Ee-Ie)]);a.style.minWidth=me+"px",a.style.right=ct+"px"}const A=f(),F=window.innerHeight-nt*2,W=p.scrollHeight,L=window.getComputedStyle(c),j=parseInt(L.borderTopWidth,10),_=parseInt(L.paddingTop,10),N=parseInt(L.borderBottomWidth,10),O=parseInt(L.paddingBottom,10),V=j+_+W+O+N,k=Math.min(b.offsetHeight*5,V),I=window.getComputedStyle(p),$=parseInt(I.paddingTop,10),H=parseInt(I.paddingBottom,10),U=S.top+S.height/2-nt,Z=F-U,q=b.offsetHeight/2,B=b.offsetTop+q,K=j+_+B,X=V-K;if(K<=U){const ne=A.length>0&&b===A[A.length-1].ref.current;a.style.bottom="0px";const z=c.clientHeight-p.offsetTop-p.offsetHeight,le=Math.max(Z,q+(ne?H:0)+z+N),me=K+le;a.style.height=me+"px"}else{const ne=A.length>0&&b===A[0].ref.current;a.style.top="0px";const le=Math.max(U,j+p.offsetTop+(ne?$:0)+q)+X;a.style.height=le+"px",p.scrollTop=K-U+p.offsetTop}a.style.margin=`${nt}px 0`,a.style.minHeight=k+"px",a.style.maxHeight=F+"px",r==null||r(),requestAnimationFrame(()=>h.current=!0)}},[f,s.trigger,s.valueNode,a,c,p,b,y,s.dir,r]);je(()=>w(),[w]);const[C,x]=R.useState();je(()=>{c&&x(window.getComputedStyle(c).zIndex)},[c]);const M=R.useCallback(S=>{S&&m.current===!0&&(w(),g==null||g(),m.current=!1)},[w,g]);return v.jsx(bD,{scope:n,contentWrapper:a,shouldExpandOnScrollRef:h,onScrollButtonChange:M,children:v.jsx("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:C},children:v.jsx(ce.div,{...o,ref:d,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});cg.displayName=wD;var xD="SelectPopperPosition",Zi=R.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:o=nt,...s}=e,i=_s(n);return v.jsx(ws,{...i,...s,ref:t,align:r,collisionPadding:o,style:{boxSizing:"border-box",...s.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Zi.displayName=xD;var[bD,yl]=Zn(yn,{}),Ji="SelectViewport",ug=R.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...o}=e,s=rn(Ji,n),i=yl(Ji,n),a=pe(t,s.onViewportChange),l=R.useRef(0);return v.jsxs(v.Fragment,{children:[v.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),v.jsx(As.Slot,{scope:n,children:v.jsx(ce.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:a,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:te(o.onScroll,c=>{const u=c.currentTarget,{contentWrapper:d,shouldExpandOnScrollRef:f}=i;if(f!=null&&f.current&&d){const h=Math.abs(l.current-u.scrollTop);if(h>0){const m=window.innerHeight-nt*2,p=parseFloat(d.style.minHeight),b=parseFloat(d.style.height),y=Math.max(p,b);if(y<m){const g=y+h,w=Math.min(m,g),C=g-w;d.style.height=w+"px",d.style.bottom==="0px"&&(u.scrollTop=C>0?C:0,d.style.justifyContent="flex-end")}}}l.current=u.scrollTop})})})]})});ug.displayName=Ji;var dg="SelectGroup",[SD,CD]=Zn(dg),RD=R.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Ut();return v.jsx(SD,{scope:n,id:o,children:v.jsx(ce.div,{role:"group","aria-labelledby":o,...r,ref:t})})});RD.displayName=dg;var fg="SelectLabel",DD=R.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=CD(fg,n);return v.jsx(ce.div,{id:o.id,...r,ref:t})});DD.displayName=fg;var ts="SelectItem",[TD,hg]=Zn(ts),pg=R.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:o=!1,textValue:s,...i}=e,a=nn(ts,n),l=rn(ts,n),c=a.value===r,[u,d]=R.useState(s??""),[f,h]=R.useState(!1),m=pe(t,g=>{var w;return(w=l.itemRefCallback)==null?void 0:w.call(l,g,r,o)}),p=Ut(),b=R.useRef("touch"),y=()=>{o||(a.onValueChange(r),a.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return v.jsx(TD,{scope:n,value:r,disabled:o,textId:p,isSelected:c,onItemTextChange:R.useCallback(g=>{d(w=>w||((g==null?void 0:g.textContent)??"").trim())},[]),children:v.jsx(As.ItemSlot,{scope:n,value:r,disabled:o,textValue:u,children:v.jsx(ce.div,{role:"option","aria-labelledby":p,"data-highlighted":f?"":void 0,"aria-selected":c&&f,"data-state":c?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...i,ref:m,onFocus:te(i.onFocus,()=>h(!0)),onBlur:te(i.onBlur,()=>h(!1)),onClick:te(i.onClick,()=>{b.current!=="mouse"&&y()}),onPointerUp:te(i.onPointerUp,()=>{b.current==="mouse"&&y()}),onPointerDown:te(i.onPointerDown,g=>{b.current=g.pointerType}),onPointerMove:te(i.onPointerMove,g=>{var w;b.current=g.pointerType,o?(w=l.onItemLeave)==null||w.call(l):b.current==="mouse"&&g.currentTarget.focus({preventScroll:!0})}),onPointerLeave:te(i.onPointerLeave,g=>{var w;g.currentTarget===document.activeElement&&((w=l.onItemLeave)==null||w.call(l))}),onKeyDown:te(i.onKeyDown,g=>{var C;((C=l.searchRef)==null?void 0:C.current)!==""&&g.key===" "||(uD.includes(g.key)&&y(),g.key===" "&&g.preventDefault())})})})})});pg.displayName=ts;var yr="SelectItemText",gg=R.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,...s}=e,i=nn(yr,n),a=rn(yr,n),l=hg(yr,n),c=pD(yr,n),[u,d]=R.useState(null),f=pe(t,y=>d(y),l.onItemTextChange,y=>{var g;return(g=a.itemTextRefCallback)==null?void 0:g.call(a,y,l.value,l.disabled)}),h=u==null?void 0:u.textContent,m=R.useMemo(()=>v.jsx("option",{value:l.value,disabled:l.disabled,children:h},l.value),[l.disabled,l.value,h]),{onNativeOptionAdd:p,onNativeOptionRemove:b}=c;return je(()=>(p(m),()=>b(m)),[p,b,m]),v.jsxs(v.Fragment,{children:[v.jsx(ce.span,{id:l.textId,...s,ref:f}),l.isSelected&&i.valueNode&&!i.valueNodeHasChildren?as.createPortal(s.children,i.valueNode):null]})});gg.displayName=yr;var mg="SelectItemIndicator",vg=R.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return hg(mg,n).isSelected?v.jsx(ce.span,{"aria-hidden":!0,...r,ref:t}):null});vg.displayName=mg;var Qi="SelectScrollUpButton",yg=R.forwardRef((e,t)=>{const n=rn(Qi,e.__scopeSelect),r=yl(Qi,e.__scopeSelect),[o,s]=R.useState(!1),i=pe(t,r.onScrollButtonChange);return je(()=>{if(n.viewport&&n.isPositioned){let a=function(){const c=l.scrollTop>0;s(c)};const l=n.viewport;return a(),l.addEventListener("scroll",a),()=>l.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),o?v.jsx(xg,{...e,ref:i,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=n;a&&l&&(a.scrollTop=a.scrollTop-l.offsetHeight)}}):null});yg.displayName=Qi;var ea="SelectScrollDownButton",wg=R.forwardRef((e,t)=>{const n=rn(ea,e.__scopeSelect),r=yl(ea,e.__scopeSelect),[o,s]=R.useState(!1),i=pe(t,r.onScrollButtonChange);return je(()=>{if(n.viewport&&n.isPositioned){let a=function(){const c=l.scrollHeight-l.clientHeight,u=Math.ceil(l.scrollTop)<c;s(u)};const l=n.viewport;return a(),l.addEventListener("scroll",a),()=>l.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),o?v.jsx(xg,{...e,ref:i,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=n;a&&l&&(a.scrollTop=a.scrollTop+l.offsetHeight)}}):null});wg.displayName=ea;var xg=R.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...o}=e,s=rn("SelectScrollButton",n),i=R.useRef(null),a=Os(n),l=R.useCallback(()=>{i.current!==null&&(window.clearInterval(i.current),i.current=null)},[]);return R.useEffect(()=>()=>l(),[l]),je(()=>{var u;const c=a().find(d=>d.ref.current===document.activeElement);(u=c==null?void 0:c.ref.current)==null||u.scrollIntoView({block:"nearest"})},[a]),v.jsx(ce.div,{"aria-hidden":!0,...o,ref:t,style:{flexShrink:0,...o.style},onPointerDown:te(o.onPointerDown,()=>{i.current===null&&(i.current=window.setInterval(r,50))}),onPointerMove:te(o.onPointerMove,()=>{var c;(c=s.onItemLeave)==null||c.call(s),i.current===null&&(i.current=window.setInterval(r,50))}),onPointerLeave:te(o.onPointerLeave,()=>{l()})})}),MD="SelectSeparator",PD=R.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return v.jsx(ce.div,{"aria-hidden":!0,...r,ref:t})});PD.displayName=MD;var ta="SelectArrow",ED=R.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=_s(n),s=nn(ta,n),i=rn(ta,n);return s.open&&i.position==="popper"?v.jsx(xs,{...o,...r,ref:t}):null});ED.displayName=ta;function bg(e){return e===""||e===void 0}var Sg=R.forwardRef((e,t)=>{const{value:n,...r}=e,o=R.useRef(null),s=pe(t,o),i=lD(n);return R.useEffect(()=>{const a=o.current,l=window.HTMLSelectElement.prototype,u=Object.getOwnPropertyDescriptor(l,"value").set;if(i!==n&&u){const d=new Event("change",{bubbles:!0});u.call(a,n),a.dispatchEvent(d)}},[i,n]),v.jsx(qa,{asChild:!0,children:v.jsx("select",{...r,ref:s,defaultValue:n})})});Sg.displayName="BubbleSelect";function Cg(e){const t=et(e),n=R.useRef(""),r=R.useRef(0),o=R.useCallback(i=>{const a=n.current+i;t(a),function l(c){n.current=c,window.clearTimeout(r.current),c!==""&&(r.current=window.setTimeout(()=>l(""),1e3))}(a)},[t]),s=R.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return R.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,o,s]}function Rg(e,t,n){const o=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let i=AD(e,Math.max(s,0));o.length===1&&(i=i.filter(c=>c!==n));const l=i.find(c=>c.textValue.toLowerCase().startsWith(o.toLowerCase()));return l!==n?l:void 0}function AD(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var OD=Qp,_D=tg,kD=rg,ID=og,ND=sg,jD=ig,FD=ug,VD=pg,LD=gg,$D=vg,BD=yg,zD=wg;function HD({...e}){return v.jsx(OD,{"data-slot":"select",...e})}function WD({...e}){return v.jsx(kD,{"data-slot":"select-value",...e})}function UD({className:e,size:t="default",children:n,...r}){return v.jsxs(_D,{"data-slot":"select-trigger","data-size":t,className:he("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...r,children:[n,v.jsx(ID,{asChild:!0,children:v.jsx(Gf,{className:"size-4 opacity-50"})})]})}function GD({className:e,children:t,position:n="popper",...r}){return v.jsx(ND,{children:v.jsxs(jD,{"data-slot":"select-content",className:he("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...r,children:[v.jsx(YD,{}),v.jsx(FD,{className:he("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:t}),v.jsx(qD,{})]})})}function KD({className:e,children:t,...n}){return v.jsxs(VD,{"data-slot":"select-item",className:he("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",e),...n,children:[v.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:v.jsx($D,{children:v.jsx(Uf,{className:"size-4"})})}),v.jsx(LD,{children:t})]})}function YD({className:e,...t}){return v.jsx(BD,{"data-slot":"select-scroll-up-button",className:he("flex cursor-default items-center justify-center py-1",e),...t,children:v.jsx(ix,{className:"size-4"})})}function qD({className:e,...t}){return v.jsx(zD,{"data-slot":"select-scroll-down-button",className:he("flex cursor-default items-center justify-center py-1",e),...t,children:v.jsx(Gf,{className:"size-4"})})}const XD=({options:e,onChange:t})=>v.jsxs(HD,{onValueChange:n=>t(n),defaultValue:e[1].text,children:[v.jsx(UD,{className:"w-[180px]",children:v.jsx(WD,{placeholder:"view"})}),v.jsx(GD,{children:e.map(n=>v.jsx(KD,{value:n.text,children:n.text},n.text))})]}),ZD=[{text:"teste1",onClick:()=>console.log("teste1")},{text:"teste2",onClick:()=>console.log("teste2")}],JD=5,QD=0,eT=({side:e,xAxis:t,yAxis:n,updatePosition:r,children:o})=>{const{attributes:s,listeners:i,setNodeRef:a,transform:l,setActivatorNodeRef:c}=Fa({id:"booking-info-id",data:{type:"booking-info-options"}}),u=xn(f=>f.updateIsDragging),d={transform:`translate3d(${t+((l==null?void 0:l.x)||0)}px, ${n+((l==null?void 0:l.y)||0)}px, 0)`};return Gr({onDragStart(){u(!0)},onDragEnd(f){f.active.id&&r(l)}}),v.jsx(tD,{ref:a,updatePositionStrategy:"optimized",side:e,align:"start",sticky:"always",sideOffset:JD,alignOffset:QD,style:{...d,width:"25rem",zIndex:100},children:v.jsxs("div",{className:"grid gap-3",children:[v.jsx("input",{type:"text",style:{position:"absolute",opacity:0,height:0,width:0}}),v.jsxs("div",{className:"flex justify-end gap-1",children:[v.jsx("div",{ref:c,className:"w-full cursor-move",...s,...i}),v.jsx(aD,{}),v.jsx(Rt,{type:"button",variant:"outline",size:"icon",children:v.jsx(wx,{className:"h-3 w-3"})}),v.jsx(Rt,{type:"button",variant:"outline",size:"icon",onClick:()=>{},children:v.jsx(Cx,{className:"h-3 w-3"})}),v.jsx(XD,{options:ZD,onChange:()=>{}})]}),o]})})},au={xAxis:0,yAxis:0},Dg=({isEditingOpen:e,side:t,booking:n,onOpenChange:r,children:o})=>{const[s,i]=T.useState({...au}),a=xn(h=>h.updateIsDragging),l=T.useMemo(()=>`${Y.dateAndHourDateToString(n.startAt)} - ${Y.dateAndHourDateToString(n.finishAt)}`,[n.startAt,n.finishAt]),c=T.useMemo(()=>{const h=new Date(n.startAt),m=h.getDate(),p=h.getDay(),b=Nn[h.getMonth()];return v.jsx("span",{children:`${Qv[p]}, ${m} ${b}`})},[n.startAt]),u=()=>({backgroundColor:""}),d=h=>{h||console.info("No transform info to show "),i({xAxis:s.xAxis+((h==null?void 0:h.x)||0),yAxis:s.yAxis+((h==null?void 0:h.y)||0)})};Gr({onDragStart(h){const m=h.active.data.current,p=h.active.id,b=m.type==="booking-info-options";p&&b&&a(!0)}});const f=h=>{h===!1&&i({...au}),r(h)};return v.jsxs(QR,{open:e,onOpenChange:f,defaultOpen:!1,children:[v.jsx(nD,{style:{width:"100%"},children:v.jsx(eD,{asChild:!0,children:o})}),v.jsx(ja,{children:v.jsx(eT,{side:t,xAxis:s.xAxis,yAxis:s.yAxis,updatePosition:d,children:v.jsxs("div",{className:"bookingCard_content",children:[v.jsx("span",{style:u(),className:"flex h-4 w-4 translate-y-0 rounded-sm"}),v.jsx("div",{className:"space-y-1",children:v.jsxs("p",{className:"text-sm text-muted-foreground",children:[c," | ",l]})})]})})})]})};Dg.displayName="BookingInfoOptions";var cr={exports:{}},ur={},dr={exports:{}},ii={},yo={exports:{}},wo={exports:{}},de={};/** @license React v16.13.1
|
|
170
|
-
* react-is.production.min.js
|
|
171
|
-
*
|
|
172
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
173
|
-
*
|
|
174
|
-
* This source code is licensed under the MIT license found in the
|
|
175
|
-
* LICENSE file in the root directory of this source tree.
|
|
176
|
-
*/var lu;function tT(){if(lu)return de;lu=1;var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,o=e?Symbol.for("react.strict_mode"):60108,s=e?Symbol.for("react.profiler"):60114,i=e?Symbol.for("react.provider"):60109,a=e?Symbol.for("react.context"):60110,l=e?Symbol.for("react.async_mode"):60111,c=e?Symbol.for("react.concurrent_mode"):60111,u=e?Symbol.for("react.forward_ref"):60112,d=e?Symbol.for("react.suspense"):60113,f=e?Symbol.for("react.suspense_list"):60120,h=e?Symbol.for("react.memo"):60115,m=e?Symbol.for("react.lazy"):60116,p=e?Symbol.for("react.block"):60121,b=e?Symbol.for("react.fundamental"):60117,y=e?Symbol.for("react.responder"):60118,g=e?Symbol.for("react.scope"):60119;function w(x){if(typeof x=="object"&&x!==null){var M=x.$$typeof;switch(M){case t:switch(x=x.type,x){case l:case c:case r:case s:case o:case d:return x;default:switch(x=x&&x.$$typeof,x){case a:case u:case m:case h:case i:return x;default:return M}}case n:return M}}}function C(x){return w(x)===c}return de.AsyncMode=l,de.ConcurrentMode=c,de.ContextConsumer=a,de.ContextProvider=i,de.Element=t,de.ForwardRef=u,de.Fragment=r,de.Lazy=m,de.Memo=h,de.Portal=n,de.Profiler=s,de.StrictMode=o,de.Suspense=d,de.isAsyncMode=function(x){return C(x)||w(x)===l},de.isConcurrentMode=C,de.isContextConsumer=function(x){return w(x)===a},de.isContextProvider=function(x){return w(x)===i},de.isElement=function(x){return typeof x=="object"&&x!==null&&x.$$typeof===t},de.isForwardRef=function(x){return w(x)===u},de.isFragment=function(x){return w(x)===r},de.isLazy=function(x){return w(x)===m},de.isMemo=function(x){return w(x)===h},de.isPortal=function(x){return w(x)===n},de.isProfiler=function(x){return w(x)===s},de.isStrictMode=function(x){return w(x)===o},de.isSuspense=function(x){return w(x)===d},de.isValidElementType=function(x){return typeof x=="string"||typeof x=="function"||x===r||x===c||x===s||x===o||x===d||x===f||typeof x=="object"&&x!==null&&(x.$$typeof===m||x.$$typeof===h||x.$$typeof===i||x.$$typeof===a||x.$$typeof===u||x.$$typeof===b||x.$$typeof===y||x.$$typeof===g||x.$$typeof===p)},de.typeOf=w,de}var fe={};/** @license React v16.13.1
|
|
177
|
-
* react-is.development.js
|
|
178
|
-
*
|
|
179
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
180
|
-
*
|
|
181
|
-
* This source code is licensed under the MIT license found in the
|
|
182
|
-
* LICENSE file in the root directory of this source tree.
|
|
183
|
-
*/var cu;function nT(){return cu||(cu=1,process.env.NODE_ENV!=="production"&&function(){var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,o=e?Symbol.for("react.strict_mode"):60108,s=e?Symbol.for("react.profiler"):60114,i=e?Symbol.for("react.provider"):60109,a=e?Symbol.for("react.context"):60110,l=e?Symbol.for("react.async_mode"):60111,c=e?Symbol.for("react.concurrent_mode"):60111,u=e?Symbol.for("react.forward_ref"):60112,d=e?Symbol.for("react.suspense"):60113,f=e?Symbol.for("react.suspense_list"):60120,h=e?Symbol.for("react.memo"):60115,m=e?Symbol.for("react.lazy"):60116,p=e?Symbol.for("react.block"):60121,b=e?Symbol.for("react.fundamental"):60117,y=e?Symbol.for("react.responder"):60118,g=e?Symbol.for("react.scope"):60119;function w(z){return typeof z=="string"||typeof z=="function"||z===r||z===c||z===s||z===o||z===d||z===f||typeof z=="object"&&z!==null&&(z.$$typeof===m||z.$$typeof===h||z.$$typeof===i||z.$$typeof===a||z.$$typeof===u||z.$$typeof===b||z.$$typeof===y||z.$$typeof===g||z.$$typeof===p)}function C(z){if(typeof z=="object"&&z!==null){var le=z.$$typeof;switch(le){case t:var me=z.type;switch(me){case l:case c:case r:case s:case o:case d:return me;default:var Ie=me&&me.$$typeof;switch(Ie){case a:case u:case m:case h:case i:return Ie;default:return le}}case n:return le}}}var x=l,M=c,S=a,D=i,P=t,E=u,A=r,F=m,W=h,L=n,j=s,_=o,N=d,O=!1;function V(z){return O||(O=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),k(z)||C(z)===l}function k(z){return C(z)===c}function I(z){return C(z)===a}function $(z){return C(z)===i}function H(z){return typeof z=="object"&&z!==null&&z.$$typeof===t}function U(z){return C(z)===u}function Z(z){return C(z)===r}function q(z){return C(z)===m}function B(z){return C(z)===h}function K(z){return C(z)===n}function X(z){return C(z)===s}function G(z){return C(z)===o}function ne(z){return C(z)===d}fe.AsyncMode=x,fe.ConcurrentMode=M,fe.ContextConsumer=S,fe.ContextProvider=D,fe.Element=P,fe.ForwardRef=E,fe.Fragment=A,fe.Lazy=F,fe.Memo=W,fe.Portal=L,fe.Profiler=j,fe.StrictMode=_,fe.Suspense=N,fe.isAsyncMode=V,fe.isConcurrentMode=k,fe.isContextConsumer=I,fe.isContextProvider=$,fe.isElement=H,fe.isForwardRef=U,fe.isFragment=Z,fe.isLazy=q,fe.isMemo=B,fe.isPortal=K,fe.isProfiler=X,fe.isStrictMode=G,fe.isSuspense=ne,fe.isValidElementType=w,fe.typeOf=C}()),fe}var uu;function Tg(){return uu||(uu=1,process.env.NODE_ENV==="production"?wo.exports=tT():wo.exports=nT()),wo.exports}/*
|
|
184
|
-
object-assign
|
|
185
|
-
(c) Sindre Sorhus
|
|
186
|
-
@license MIT
|
|
187
|
-
*/var ai,du;function rT(){if(du)return ai;du=1;var e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;function r(s){if(s==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(s)}function o(){try{if(!Object.assign)return!1;var s=new String("abc");if(s[5]="de",Object.getOwnPropertyNames(s)[0]==="5")return!1;for(var i={},a=0;a<10;a++)i["_"+String.fromCharCode(a)]=a;var l=Object.getOwnPropertyNames(i).map(function(u){return i[u]});if(l.join("")!=="0123456789")return!1;var c={};return"abcdefghijklmnopqrst".split("").forEach(function(u){c[u]=u}),Object.keys(Object.assign({},c)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return ai=o()?Object.assign:function(s,i){for(var a,l=r(s),c,u=1;u<arguments.length;u++){a=Object(arguments[u]);for(var d in a)t.call(a,d)&&(l[d]=a[d]);if(e){c=e(a);for(var f=0;f<c.length;f++)n.call(a,c[f])&&(l[c[f]]=a[c[f]])}}return l},ai}var li,fu;function wl(){if(fu)return li;fu=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return li=e,li}var ci,hu;function Mg(){return hu||(hu=1,ci=Function.call.bind(Object.prototype.hasOwnProperty)),ci}var ui,pu;function oT(){if(pu)return ui;pu=1;var e=function(){};if(process.env.NODE_ENV!=="production"){var t=wl(),n={},r=Mg();e=function(s){var i="Warning: "+s;typeof console<"u"&&console.error(i);try{throw new Error(i)}catch{}}}function o(s,i,a,l,c){if(process.env.NODE_ENV!=="production"){for(var u in s)if(r(s,u)){var d;try{if(typeof s[u]!="function"){var f=Error((l||"React class")+": "+a+" type `"+u+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof s[u]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw f.name="Invariant Violation",f}d=s[u](i,u,l,a,null,t)}catch(m){d=m}if(d&&!(d instanceof Error)&&e((l||"React class")+": type specification of "+a+" `"+u+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof d+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),d instanceof Error&&!(d.message in n)){n[d.message]=!0;var h=c?c():"";e("Failed "+a+" type: "+d.message+(h??""))}}}}return o.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(n={})},ui=o,ui}var di,gu;function sT(){if(gu)return di;gu=1;var e=Tg(),t=rT(),n=wl(),r=Mg(),o=oT(),s=function(){};process.env.NODE_ENV!=="production"&&(s=function(a){var l="Warning: "+a;typeof console<"u"&&console.error(l);try{throw new Error(l)}catch{}});function i(){return null}return di=function(a,l){var c=typeof Symbol=="function"&&Symbol.iterator,u="@@iterator";function d(k){var I=k&&(c&&k[c]||k[u]);if(typeof I=="function")return I}var f="<<anonymous>>",h={array:y("array"),bigint:y("bigint"),bool:y("boolean"),func:y("function"),number:y("number"),object:y("object"),string:y("string"),symbol:y("symbol"),any:g(),arrayOf:w,element:C(),elementType:x(),instanceOf:M,node:E(),objectOf:D,oneOf:S,oneOfType:P,shape:F,exact:W};function m(k,I){return k===I?k!==0||1/k===1/I:k!==k&&I!==I}function p(k,I){this.message=k,this.data=I&&typeof I=="object"?I:{},this.stack=""}p.prototype=Error.prototype;function b(k){if(process.env.NODE_ENV!=="production")var I={},$=0;function H(Z,q,B,K,X,G,ne){if(K=K||f,G=G||B,ne!==n){if(l){var z=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw z.name="Invariant Violation",z}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var le=K+":"+B;!I[le]&&$<3&&(s("You are manually calling a React.PropTypes validation function for the `"+G+"` prop on `"+K+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),I[le]=!0,$++)}}return q[B]==null?Z?q[B]===null?new p("The "+X+" `"+G+"` is marked as required "+("in `"+K+"`, but its value is `null`.")):new p("The "+X+" `"+G+"` is marked as required in "+("`"+K+"`, but its value is `undefined`.")):null:k(q,B,K,X,G)}var U=H.bind(null,!1);return U.isRequired=H.bind(null,!0),U}function y(k){function I($,H,U,Z,q,B){var K=$[H],X=_(K);if(X!==k){var G=N(K);return new p("Invalid "+Z+" `"+q+"` of type "+("`"+G+"` supplied to `"+U+"`, expected ")+("`"+k+"`."),{expectedType:k})}return null}return b(I)}function g(){return b(i)}function w(k){function I($,H,U,Z,q){if(typeof k!="function")return new p("Property `"+q+"` of component `"+U+"` has invalid PropType notation inside arrayOf.");var B=$[H];if(!Array.isArray(B)){var K=_(B);return new p("Invalid "+Z+" `"+q+"` of type "+("`"+K+"` supplied to `"+U+"`, expected an array."))}for(var X=0;X<B.length;X++){var G=k(B,X,U,Z,q+"["+X+"]",n);if(G instanceof Error)return G}return null}return b(I)}function C(){function k(I,$,H,U,Z){var q=I[$];if(!a(q)){var B=_(q);return new p("Invalid "+U+" `"+Z+"` of type "+("`"+B+"` supplied to `"+H+"`, expected a single ReactElement."))}return null}return b(k)}function x(){function k(I,$,H,U,Z){var q=I[$];if(!e.isValidElementType(q)){var B=_(q);return new p("Invalid "+U+" `"+Z+"` of type "+("`"+B+"` supplied to `"+H+"`, expected a single ReactElement type."))}return null}return b(k)}function M(k){function I($,H,U,Z,q){if(!($[H]instanceof k)){var B=k.name||f,K=V($[H]);return new p("Invalid "+Z+" `"+q+"` of type "+("`"+K+"` supplied to `"+U+"`, expected ")+("instance of `"+B+"`."))}return null}return b(I)}function S(k){if(!Array.isArray(k))return process.env.NODE_ENV!=="production"&&(arguments.length>1?s("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):s("Invalid argument supplied to oneOf, expected an array.")),i;function I($,H,U,Z,q){for(var B=$[H],K=0;K<k.length;K++)if(m(B,k[K]))return null;var X=JSON.stringify(k,function(ne,z){var le=N(z);return le==="symbol"?String(z):z});return new p("Invalid "+Z+" `"+q+"` of value `"+String(B)+"` "+("supplied to `"+U+"`, expected one of "+X+"."))}return b(I)}function D(k){function I($,H,U,Z,q){if(typeof k!="function")return new p("Property `"+q+"` of component `"+U+"` has invalid PropType notation inside objectOf.");var B=$[H],K=_(B);if(K!=="object")return new p("Invalid "+Z+" `"+q+"` of type "+("`"+K+"` supplied to `"+U+"`, expected an object."));for(var X in B)if(r(B,X)){var G=k(B,X,U,Z,q+"."+X,n);if(G instanceof Error)return G}return null}return b(I)}function P(k){if(!Array.isArray(k))return process.env.NODE_ENV!=="production"&&s("Invalid argument supplied to oneOfType, expected an instance of array."),i;for(var I=0;I<k.length;I++){var $=k[I];if(typeof $!="function")return s("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+O($)+" at index "+I+"."),i}function H(U,Z,q,B,K){for(var X=[],G=0;G<k.length;G++){var ne=k[G],z=ne(U,Z,q,B,K,n);if(z==null)return null;z.data&&r(z.data,"expectedType")&&X.push(z.data.expectedType)}var le=X.length>0?", expected one of type ["+X.join(", ")+"]":"";return new p("Invalid "+B+" `"+K+"` supplied to "+("`"+q+"`"+le+"."))}return b(H)}function E(){function k(I,$,H,U,Z){return L(I[$])?null:new p("Invalid "+U+" `"+Z+"` supplied to "+("`"+H+"`, expected a ReactNode."))}return b(k)}function A(k,I,$,H,U){return new p((k||"React class")+": "+I+" type `"+$+"."+H+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+U+"`.")}function F(k){function I($,H,U,Z,q){var B=$[H],K=_(B);if(K!=="object")return new p("Invalid "+Z+" `"+q+"` of type `"+K+"` "+("supplied to `"+U+"`, expected `object`."));for(var X in k){var G=k[X];if(typeof G!="function")return A(U,Z,q,X,N(G));var ne=G(B,X,U,Z,q+"."+X,n);if(ne)return ne}return null}return b(I)}function W(k){function I($,H,U,Z,q){var B=$[H],K=_(B);if(K!=="object")return new p("Invalid "+Z+" `"+q+"` of type `"+K+"` "+("supplied to `"+U+"`, expected `object`."));var X=t({},$[H],k);for(var G in X){var ne=k[G];if(r(k,G)&&typeof ne!="function")return A(U,Z,q,G,N(ne));if(!ne)return new p("Invalid "+Z+" `"+q+"` key `"+G+"` supplied to `"+U+"`.\nBad object: "+JSON.stringify($[H],null," ")+`
|
|
188
|
-
Valid keys: `+JSON.stringify(Object.keys(k),null," "));var z=ne(B,G,U,Z,q+"."+G,n);if(z)return z}return null}return b(I)}function L(k){switch(typeof k){case"number":case"string":case"undefined":return!0;case"boolean":return!k;case"object":if(Array.isArray(k))return k.every(L);if(k===null||a(k))return!0;var I=d(k);if(I){var $=I.call(k),H;if(I!==k.entries){for(;!(H=$.next()).done;)if(!L(H.value))return!1}else for(;!(H=$.next()).done;){var U=H.value;if(U&&!L(U[1]))return!1}}else return!1;return!0;default:return!1}}function j(k,I){return k==="symbol"?!0:I?I["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&I instanceof Symbol:!1}function _(k){var I=typeof k;return Array.isArray(k)?"array":k instanceof RegExp?"object":j(I,k)?"symbol":I}function N(k){if(typeof k>"u"||k===null)return""+k;var I=_(k);if(I==="object"){if(k instanceof Date)return"date";if(k instanceof RegExp)return"regexp"}return I}function O(k){var I=N(k);switch(I){case"array":case"object":return"an "+I;case"boolean":case"date":case"regexp":return"a "+I;default:return I}}function V(k){return!k.constructor||!k.constructor.name?f:k.constructor.name}return h.checkPropTypes=o,h.resetWarningCache=o.resetWarningCache,h.PropTypes=h,h},di}var fi,mu;function iT(){if(mu)return fi;mu=1;var e=wl();function t(){}function n(){}return n.resetWarningCache=t,fi=function(){function r(i,a,l,c,u,d){if(d!==e){var f=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw f.name="Invariant Violation",f}}r.isRequired=r;function o(){return r}var s={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:o,element:r,elementType:r,instanceOf:o,node:r,objectOf:o,oneOf:o,oneOfType:o,shape:o,exact:o,checkPropTypes:n,resetWarningCache:t};return s.PropTypes=s,s},fi}var vu;function ks(){if(vu)return yo.exports;if(vu=1,process.env.NODE_ENV!=="production"){var e=Tg(),t=!0;yo.exports=sT()(e.isElement,t)}else yo.exports=iT()();return yo.exports}function Pg(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=Pg(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function yu(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=Pg(e))&&(r&&(r+=" "),r+=t);return r}const aT=Object.freeze(Object.defineProperty({__proto__:null,clsx:yu,default:yu},Symbol.toStringTag,{value:"Module"})),lT=qv(aT);var be={},Vt={},wu;function Is(){if(wu)return Vt;wu=1,Object.defineProperty(Vt,"__esModule",{value:!0}),Vt.dontSetMe=o,Vt.findInArray=e,Vt.int=r,Vt.isFunction=t,Vt.isNum=n;function e(s,i){for(let a=0,l=s.length;a<l;a++)if(i.apply(i,[s[a],a,s]))return s[a]}function t(s){return typeof s=="function"||Object.prototype.toString.call(s)==="[object Function]"}function n(s){return typeof s=="number"&&!isNaN(s)}function r(s){return parseInt(s,10)}function o(s,i,a){if(s[i])return new Error("Invalid prop ".concat(i," passed to ").concat(a," - do not set this, set it on the child."))}return Vt}var Lt={},xu;function cT(){if(xu)return Lt;xu=1,Object.defineProperty(Lt,"__esModule",{value:!0}),Lt.browserPrefixToKey=n,Lt.browserPrefixToStyle=r,Lt.default=void 0,Lt.getPrefix=t;const e=["Moz","Webkit","O","ms"];function t(){var s;let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"transform";if(typeof window>"u")return"";const a=(s=window.document)===null||s===void 0||(s=s.documentElement)===null||s===void 0?void 0:s.style;if(!a||i in a)return"";for(let l=0;l<e.length;l++)if(n(i,e[l])in a)return e[l];return""}function n(s,i){return i?"".concat(i).concat(o(s)):s}function r(s,i){return i?"-".concat(i.toLowerCase(),"-").concat(s):s}function o(s){let i="",a=!0;for(let l=0;l<s.length;l++)a?(i+=s[l].toUpperCase(),a=!1):s[l]==="-"?a=!0:i+=s[l];return i}return Lt.default=t(),Lt}var bu;function xl(){if(bu)return be;bu=1,Object.defineProperty(be,"__esModule",{value:!0}),be.addClassName=x,be.addEvent=a,be.addUserSelectStyles=w,be.createCSSTransform=m,be.createSVGTransform=p,be.getTouch=y,be.getTouchIdentifier=g,be.getTranslation=b,be.innerHeight=d,be.innerWidth=f,be.matchesSelector=s,be.matchesSelectorAndParentsTo=i,be.offsetXYFromParent=h,be.outerHeight=c,be.outerWidth=u,be.removeClassName=M,be.removeEvent=l,be.removeUserSelectStyles=C;var e=Is(),t=r(cT());function n(S){if(typeof WeakMap!="function")return null;var D=new WeakMap,P=new WeakMap;return(n=function(E){return E?P:D})(S)}function r(S,D){if(S&&S.__esModule)return S;if(S===null||typeof S!="object"&&typeof S!="function")return{default:S};var P=n(D);if(P&&P.has(S))return P.get(S);var E={},A=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var F in S)if(F!=="default"&&Object.prototype.hasOwnProperty.call(S,F)){var W=A?Object.getOwnPropertyDescriptor(S,F):null;W&&(W.get||W.set)?Object.defineProperty(E,F,W):E[F]=S[F]}return E.default=S,P&&P.set(S,E),E}let o="";function s(S,D){return o||(o=(0,e.findInArray)(["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"],function(P){return(0,e.isFunction)(S[P])})),(0,e.isFunction)(S[o])?S[o](D):!1}function i(S,D,P){let E=S;do{if(s(E,D))return!0;if(E===P)return!1;E=E.parentNode}while(E);return!1}function a(S,D,P,E){if(!S)return;const A={capture:!0,...E};S.addEventListener?S.addEventListener(D,P,A):S.attachEvent?S.attachEvent("on"+D,P):S["on"+D]=P}function l(S,D,P,E){if(!S)return;const A={capture:!0,...E};S.removeEventListener?S.removeEventListener(D,P,A):S.detachEvent?S.detachEvent("on"+D,P):S["on"+D]=null}function c(S){let D=S.clientHeight;const P=S.ownerDocument.defaultView.getComputedStyle(S);return D+=(0,e.int)(P.borderTopWidth),D+=(0,e.int)(P.borderBottomWidth),D}function u(S){let D=S.clientWidth;const P=S.ownerDocument.defaultView.getComputedStyle(S);return D+=(0,e.int)(P.borderLeftWidth),D+=(0,e.int)(P.borderRightWidth),D}function d(S){let D=S.clientHeight;const P=S.ownerDocument.defaultView.getComputedStyle(S);return D-=(0,e.int)(P.paddingTop),D-=(0,e.int)(P.paddingBottom),D}function f(S){let D=S.clientWidth;const P=S.ownerDocument.defaultView.getComputedStyle(S);return D-=(0,e.int)(P.paddingLeft),D-=(0,e.int)(P.paddingRight),D}function h(S,D,P){const A=D===D.ownerDocument.body?{left:0,top:0}:D.getBoundingClientRect(),F=(S.clientX+D.scrollLeft-A.left)/P,W=(S.clientY+D.scrollTop-A.top)/P;return{x:F,y:W}}function m(S,D){const P=b(S,D,"px");return{[(0,t.browserPrefixToKey)("transform",t.default)]:P}}function p(S,D){return b(S,D,"")}function b(S,D,P){let{x:E,y:A}=S,F="translate(".concat(E).concat(P,",").concat(A).concat(P,")");if(D){const W="".concat(typeof D.x=="string"?D.x:D.x+P),L="".concat(typeof D.y=="string"?D.y:D.y+P);F="translate(".concat(W,", ").concat(L,")")+F}return F}function y(S,D){return S.targetTouches&&(0,e.findInArray)(S.targetTouches,P=>D===P.identifier)||S.changedTouches&&(0,e.findInArray)(S.changedTouches,P=>D===P.identifier)}function g(S){if(S.targetTouches&&S.targetTouches[0])return S.targetTouches[0].identifier;if(S.changedTouches&&S.changedTouches[0])return S.changedTouches[0].identifier}function w(S){if(!S)return;let D=S.getElementById("react-draggable-style-el");D||(D=S.createElement("style"),D.type="text/css",D.id="react-draggable-style-el",D.innerHTML=`.react-draggable-transparent-selection *::-moz-selection {all: inherit;}
|
|
189
|
-
`,D.innerHTML+=`.react-draggable-transparent-selection *::selection {all: inherit;}
|
|
190
|
-
`,S.getElementsByTagName("head")[0].appendChild(D)),S.body&&x(S.body,"react-draggable-transparent-selection")}function C(S){if(S)try{if(S.body&&M(S.body,"react-draggable-transparent-selection"),S.selection)S.selection.empty();else{const D=(S.defaultView||window).getSelection();D&&D.type!=="Caret"&&D.removeAllRanges()}}catch{}}function x(S,D){S.classList?S.classList.add(D):S.className.match(new RegExp("(?:^|\\s)".concat(D,"(?!\\S)")))||(S.className+=" ".concat(D))}function M(S,D){S.classList?S.classList.remove(D):S.className=S.className.replace(new RegExp("(?:^|\\s)".concat(D,"(?!\\S)"),"g"),"")}return be}var ft={},Su;function Eg(){if(Su)return ft;Su=1,Object.defineProperty(ft,"__esModule",{value:!0}),ft.canDragX=o,ft.canDragY=s,ft.createCoreData=a,ft.createDraggableData=l,ft.getBoundPosition=n,ft.getControlPosition=i,ft.snapToGrid=r;var e=Is(),t=xl();function n(d,f,h){if(!d.props.bounds)return[f,h];let{bounds:m}=d.props;m=typeof m=="string"?m:c(m);const p=u(d);if(typeof m=="string"){const{ownerDocument:b}=p,y=b.defaultView;let g;if(m==="parent"?g=p.parentNode:g=b.querySelector(m),!(g instanceof y.HTMLElement))throw new Error('Bounds selector "'+m+'" could not find an element.');const w=g,C=y.getComputedStyle(p),x=y.getComputedStyle(w);m={left:-p.offsetLeft+(0,e.int)(x.paddingLeft)+(0,e.int)(C.marginLeft),top:-p.offsetTop+(0,e.int)(x.paddingTop)+(0,e.int)(C.marginTop),right:(0,t.innerWidth)(w)-(0,t.outerWidth)(p)-p.offsetLeft+(0,e.int)(x.paddingRight)-(0,e.int)(C.marginRight),bottom:(0,t.innerHeight)(w)-(0,t.outerHeight)(p)-p.offsetTop+(0,e.int)(x.paddingBottom)-(0,e.int)(C.marginBottom)}}return(0,e.isNum)(m.right)&&(f=Math.min(f,m.right)),(0,e.isNum)(m.bottom)&&(h=Math.min(h,m.bottom)),(0,e.isNum)(m.left)&&(f=Math.max(f,m.left)),(0,e.isNum)(m.top)&&(h=Math.max(h,m.top)),[f,h]}function r(d,f,h){const m=Math.round(f/d[0])*d[0],p=Math.round(h/d[1])*d[1];return[m,p]}function o(d){return d.props.axis==="both"||d.props.axis==="x"}function s(d){return d.props.axis==="both"||d.props.axis==="y"}function i(d,f,h){const m=typeof f=="number"?(0,t.getTouch)(d,f):null;if(typeof f=="number"&&!m)return null;const p=u(h),b=h.props.offsetParent||p.offsetParent||p.ownerDocument.body;return(0,t.offsetXYFromParent)(m||d,b,h.props.scale)}function a(d,f,h){const m=!(0,e.isNum)(d.lastX),p=u(d);return m?{node:p,deltaX:0,deltaY:0,lastX:f,lastY:h,x:f,y:h}:{node:p,deltaX:f-d.lastX,deltaY:h-d.lastY,lastX:d.lastX,lastY:d.lastY,x:f,y:h}}function l(d,f){const h=d.props.scale;return{node:f.node,x:d.state.x+f.deltaX/h,y:d.state.y+f.deltaY/h,deltaX:f.deltaX/h,deltaY:f.deltaY/h,lastX:d.state.x,lastY:d.state.y}}function c(d){return{left:d.left,top:d.top,right:d.right,bottom:d.bottom}}function u(d){const f=d.findDOMNode();if(!f)throw new Error("<DraggableCore>: Unmounted during event!");return f}return ft}var fr={},xo={},Cu;function Ag(){if(Cu)return xo;Cu=1,Object.defineProperty(xo,"__esModule",{value:!0}),xo.default=e;function e(){}return xo}var Ru;function uT(){if(Ru)return fr;Ru=1,Object.defineProperty(fr,"__esModule",{value:!0}),fr.default=void 0;var e=c(T),t=a(ks()),n=a(Ct),r=xl(),o=Eg(),s=Is(),i=a(Ag());function a(b){return b&&b.__esModule?b:{default:b}}function l(b){if(typeof WeakMap!="function")return null;var y=new WeakMap,g=new WeakMap;return(l=function(w){return w?g:y})(b)}function c(b,y){if(b&&b.__esModule)return b;if(b===null||typeof b!="object"&&typeof b!="function")return{default:b};var g=l(y);if(g&&g.has(b))return g.get(b);var w={},C=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var x in b)if(x!=="default"&&Object.prototype.hasOwnProperty.call(b,x)){var M=C?Object.getOwnPropertyDescriptor(b,x):null;M&&(M.get||M.set)?Object.defineProperty(w,x,M):w[x]=b[x]}return w.default=b,g&&g.set(b,w),w}function u(b,y,g){return y=d(y),y in b?Object.defineProperty(b,y,{value:g,enumerable:!0,configurable:!0,writable:!0}):b[y]=g,b}function d(b){var y=f(b,"string");return typeof y=="symbol"?y:String(y)}function f(b,y){if(typeof b!="object"||b===null)return b;var g=b[Symbol.toPrimitive];if(g!==void 0){var w=g.call(b,y);if(typeof w!="object")return w;throw new TypeError("@@toPrimitive must return a primitive value.")}return(y==="string"?String:Number)(b)}const h={touch:{start:"touchstart",move:"touchmove",stop:"touchend"},mouse:{start:"mousedown",move:"mousemove",stop:"mouseup"}};let m=h.mouse,p=class extends e.Component{constructor(){super(...arguments),u(this,"dragging",!1),u(this,"lastX",NaN),u(this,"lastY",NaN),u(this,"touchIdentifier",null),u(this,"mounted",!1),u(this,"handleDragStart",y=>{if(this.props.onMouseDown(y),!this.props.allowAnyClick&&typeof y.button=="number"&&y.button!==0)return!1;const g=this.findDOMNode();if(!g||!g.ownerDocument||!g.ownerDocument.body)throw new Error("<DraggableCore> not mounted on DragStart!");const{ownerDocument:w}=g;if(this.props.disabled||!(y.target instanceof w.defaultView.Node)||this.props.handle&&!(0,r.matchesSelectorAndParentsTo)(y.target,this.props.handle,g)||this.props.cancel&&(0,r.matchesSelectorAndParentsTo)(y.target,this.props.cancel,g))return;y.type==="touchstart"&&y.preventDefault();const C=(0,r.getTouchIdentifier)(y);this.touchIdentifier=C;const x=(0,o.getControlPosition)(y,C,this);if(x==null)return;const{x:M,y:S}=x,D=(0,o.createCoreData)(this,M,S);(0,i.default)("DraggableCore: handleDragStart: %j",D),(0,i.default)("calling",this.props.onStart),!(this.props.onStart(y,D)===!1||this.mounted===!1)&&(this.props.enableUserSelectHack&&(0,r.addUserSelectStyles)(w),this.dragging=!0,this.lastX=M,this.lastY=S,(0,r.addEvent)(w,m.move,this.handleDrag),(0,r.addEvent)(w,m.stop,this.handleDragStop))}),u(this,"handleDrag",y=>{const g=(0,o.getControlPosition)(y,this.touchIdentifier,this);if(g==null)return;let{x:w,y:C}=g;if(Array.isArray(this.props.grid)){let S=w-this.lastX,D=C-this.lastY;if([S,D]=(0,o.snapToGrid)(this.props.grid,S,D),!S&&!D)return;w=this.lastX+S,C=this.lastY+D}const x=(0,o.createCoreData)(this,w,C);if((0,i.default)("DraggableCore: handleDrag: %j",x),this.props.onDrag(y,x)===!1||this.mounted===!1){try{this.handleDragStop(new MouseEvent("mouseup"))}catch{const D=document.createEvent("MouseEvents");D.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(D)}return}this.lastX=w,this.lastY=C}),u(this,"handleDragStop",y=>{if(!this.dragging)return;const g=(0,o.getControlPosition)(y,this.touchIdentifier,this);if(g==null)return;let{x:w,y:C}=g;if(Array.isArray(this.props.grid)){let D=w-this.lastX||0,P=C-this.lastY||0;[D,P]=(0,o.snapToGrid)(this.props.grid,D,P),w=this.lastX+D,C=this.lastY+P}const x=(0,o.createCoreData)(this,w,C);if(this.props.onStop(y,x)===!1||this.mounted===!1)return!1;const S=this.findDOMNode();S&&this.props.enableUserSelectHack&&(0,r.removeUserSelectStyles)(S.ownerDocument),(0,i.default)("DraggableCore: handleDragStop: %j",x),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,S&&((0,i.default)("DraggableCore: Removing handlers"),(0,r.removeEvent)(S.ownerDocument,m.move,this.handleDrag),(0,r.removeEvent)(S.ownerDocument,m.stop,this.handleDragStop))}),u(this,"onMouseDown",y=>(m=h.mouse,this.handleDragStart(y))),u(this,"onMouseUp",y=>(m=h.mouse,this.handleDragStop(y))),u(this,"onTouchStart",y=>(m=h.touch,this.handleDragStart(y))),u(this,"onTouchEnd",y=>(m=h.touch,this.handleDragStop(y)))}componentDidMount(){this.mounted=!0;const y=this.findDOMNode();y&&(0,r.addEvent)(y,h.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;const y=this.findDOMNode();if(y){const{ownerDocument:g}=y;(0,r.removeEvent)(g,h.mouse.move,this.handleDrag),(0,r.removeEvent)(g,h.touch.move,this.handleDrag),(0,r.removeEvent)(g,h.mouse.stop,this.handleDragStop),(0,r.removeEvent)(g,h.touch.stop,this.handleDragStop),(0,r.removeEvent)(y,h.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&(0,r.removeUserSelectStyles)(g)}}findDOMNode(){var y,g;return(y=this.props)!==null&&y!==void 0&&y.nodeRef?(g=this.props)===null||g===void 0||(g=g.nodeRef)===null||g===void 0?void 0:g.current:n.default.findDOMNode(this)}render(){return e.cloneElement(e.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};return fr.default=p,u(p,"displayName","DraggableCore"),u(p,"propTypes",{allowAnyClick:t.default.bool,children:t.default.node.isRequired,disabled:t.default.bool,enableUserSelectHack:t.default.bool,offsetParent:function(b,y){if(b[y]&&b[y].nodeType!==1)throw new Error("Draggable's offsetParent must be a DOM Node.")},grid:t.default.arrayOf(t.default.number),handle:t.default.string,cancel:t.default.string,nodeRef:t.default.object,onStart:t.default.func,onDrag:t.default.func,onStop:t.default.func,onMouseDown:t.default.func,scale:t.default.number,className:s.dontSetMe,style:s.dontSetMe,transform:s.dontSetMe}),u(p,"defaultProps",{allowAnyClick:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1}),fr}var Du;function dT(){return Du||(Du=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"DraggableCore",{enumerable:!0,get:function(){return l.default}}),e.default=void 0;var t=f(T),n=u(ks()),r=u(Ct),o=u(lT),s=xl(),i=Eg(),a=Is(),l=u(uT()),c=u(Ag());function u(g){return g&&g.__esModule?g:{default:g}}function d(g){if(typeof WeakMap!="function")return null;var w=new WeakMap,C=new WeakMap;return(d=function(x){return x?C:w})(g)}function f(g,w){if(g&&g.__esModule)return g;if(g===null||typeof g!="object"&&typeof g!="function")return{default:g};var C=d(w);if(C&&C.has(g))return C.get(g);var x={},M=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var S in g)if(S!=="default"&&Object.prototype.hasOwnProperty.call(g,S)){var D=M?Object.getOwnPropertyDescriptor(g,S):null;D&&(D.get||D.set)?Object.defineProperty(x,S,D):x[S]=g[S]}return x.default=g,C&&C.set(g,x),x}function h(){return h=Object.assign?Object.assign.bind():function(g){for(var w=1;w<arguments.length;w++){var C=arguments[w];for(var x in C)Object.prototype.hasOwnProperty.call(C,x)&&(g[x]=C[x])}return g},h.apply(this,arguments)}function m(g,w,C){return w=p(w),w in g?Object.defineProperty(g,w,{value:C,enumerable:!0,configurable:!0,writable:!0}):g[w]=C,g}function p(g){var w=b(g,"string");return typeof w=="symbol"?w:String(w)}function b(g,w){if(typeof g!="object"||g===null)return g;var C=g[Symbol.toPrimitive];if(C!==void 0){var x=C.call(g,w);if(typeof x!="object")return x;throw new TypeError("@@toPrimitive must return a primitive value.")}return(w==="string"?String:Number)(g)}class y extends t.Component{static getDerivedStateFromProps(w,C){let{position:x}=w,{prevPropsPosition:M}=C;return x&&(!M||x.x!==M.x||x.y!==M.y)?((0,c.default)("Draggable: getDerivedStateFromProps %j",{position:x,prevPropsPosition:M}),{x:x.x,y:x.y,prevPropsPosition:{...x}}):null}constructor(w){super(w),m(this,"onDragStart",(C,x)=>{if((0,c.default)("Draggable: onDragStart: %j",x),this.props.onStart(C,(0,i.createDraggableData)(this,x))===!1)return!1;this.setState({dragging:!0,dragged:!0})}),m(this,"onDrag",(C,x)=>{if(!this.state.dragging)return!1;(0,c.default)("Draggable: onDrag: %j",x);const M=(0,i.createDraggableData)(this,x),S={x:M.x,y:M.y,slackX:0,slackY:0};if(this.props.bounds){const{x:P,y:E}=S;S.x+=this.state.slackX,S.y+=this.state.slackY;const[A,F]=(0,i.getBoundPosition)(this,S.x,S.y);S.x=A,S.y=F,S.slackX=this.state.slackX+(P-S.x),S.slackY=this.state.slackY+(E-S.y),M.x=S.x,M.y=S.y,M.deltaX=S.x-this.state.x,M.deltaY=S.y-this.state.y}if(this.props.onDrag(C,M)===!1)return!1;this.setState(S)}),m(this,"onDragStop",(C,x)=>{if(!this.state.dragging||this.props.onStop(C,(0,i.createDraggableData)(this,x))===!1)return!1;(0,c.default)("Draggable: onDragStop: %j",x);const S={dragging:!1,slackX:0,slackY:0};if(!!this.props.position){const{x:P,y:E}=this.props.position;S.x=P,S.y=E}this.setState(S)}),this.state={dragging:!1,dragged:!1,x:w.position?w.position.x:w.defaultPosition.x,y:w.position?w.position.y:w.defaultPosition.y,prevPropsPosition:{...w.position},slackX:0,slackY:0,isElementSVG:!1},w.position&&!(w.onDrag||w.onStop)&&console.warn("A `position` was applied to this <Draggable>, without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element.")}componentDidMount(){typeof window.SVGElement<"u"&&this.findDOMNode()instanceof window.SVGElement&&this.setState({isElementSVG:!0})}componentWillUnmount(){this.setState({dragging:!1})}findDOMNode(){var w,C;return(w=(C=this.props)===null||C===void 0||(C=C.nodeRef)===null||C===void 0?void 0:C.current)!==null&&w!==void 0?w:r.default.findDOMNode(this)}render(){const{axis:w,bounds:C,children:x,defaultPosition:M,defaultClassName:S,defaultClassNameDragging:D,defaultClassNameDragged:P,position:E,positionOffset:A,scale:F,...W}=this.props;let L={},j=null;const N=!!!E||this.state.dragging,O=E||M,V={x:(0,i.canDragX)(this)&&N?this.state.x:O.x,y:(0,i.canDragY)(this)&&N?this.state.y:O.y};this.state.isElementSVG?j=(0,s.createSVGTransform)(V,A):L=(0,s.createCSSTransform)(V,A);const k=(0,o.default)(x.props.className||"",S,{[D]:this.state.dragging,[P]:this.state.dragged});return t.createElement(l.default,h({},W,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),t.cloneElement(t.Children.only(x),{className:k,style:{...x.props.style,...L},transform:j}))}}e.default=y,m(y,"displayName","Draggable"),m(y,"propTypes",{...l.default.propTypes,axis:n.default.oneOf(["both","x","y","none"]),bounds:n.default.oneOfType([n.default.shape({left:n.default.number,right:n.default.number,top:n.default.number,bottom:n.default.number}),n.default.string,n.default.oneOf([!1])]),defaultClassName:n.default.string,defaultClassNameDragging:n.default.string,defaultClassNameDragged:n.default.string,defaultPosition:n.default.shape({x:n.default.number,y:n.default.number}),positionOffset:n.default.shape({x:n.default.oneOfType([n.default.number,n.default.string]),y:n.default.oneOfType([n.default.number,n.default.string])}),position:n.default.shape({x:n.default.number,y:n.default.number}),className:a.dontSetMe,style:a.dontSetMe,transform:a.dontSetMe}),m(y,"defaultProps",{...l.default.defaultProps,axis:"both",bounds:!1,defaultClassName:"react-draggable",defaultClassNameDragging:"react-draggable-dragging",defaultClassNameDragged:"react-draggable-dragged",defaultPosition:{x:0,y:0},scale:1})}(ii)),ii}var Tu;function Og(){if(Tu)return dr.exports;Tu=1;const{default:e,DraggableCore:t}=dT();return dr.exports=e,dr.exports.default=e,dr.exports.DraggableCore=t,dr.exports}var bo={},Mu;function fT(){if(Mu)return bo;Mu=1,bo.__esModule=!0,bo.cloneElement=a;var e=t(T);function t(l){return l&&l.__esModule?l:{default:l}}function n(l,c){var u=Object.keys(l);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(l);c&&(d=d.filter(function(f){return Object.getOwnPropertyDescriptor(l,f).enumerable})),u.push.apply(u,d)}return u}function r(l){for(var c=1;c<arguments.length;c++){var u=arguments[c]!=null?arguments[c]:{};c%2?n(Object(u),!0).forEach(function(d){o(l,d,u[d])}):Object.getOwnPropertyDescriptors?Object.defineProperties(l,Object.getOwnPropertyDescriptors(u)):n(Object(u)).forEach(function(d){Object.defineProperty(l,d,Object.getOwnPropertyDescriptor(u,d))})}return l}function o(l,c,u){return c=s(c),c in l?Object.defineProperty(l,c,{value:u,enumerable:!0,configurable:!0,writable:!0}):l[c]=u,l}function s(l){var c=i(l,"string");return typeof c=="symbol"?c:String(c)}function i(l,c){if(typeof l!="object"||l===null)return l;var u=l[Symbol.toPrimitive];if(u!==void 0){var d=u.call(l,c);if(typeof d!="object")return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return(c==="string"?String:Number)(l)}function a(l,c){return c.style&&l.props.style&&(c.style=r(r({},l.props.style),c.style)),c.className&&l.props.className&&(c.className=l.props.className+" "+c.className),e.default.cloneElement(l,c)}return bo}var hr={},Pu;function _g(){if(Pu)return hr;Pu=1,hr.__esModule=!0,hr.resizableProps=void 0;var e=t(ks());Og();function t(r){return r&&r.__esModule?r:{default:r}}var n={axis:e.default.oneOf(["both","x","y","none"]),className:e.default.string,children:e.default.element.isRequired,draggableOpts:e.default.shape({allowAnyClick:e.default.bool,cancel:e.default.string,children:e.default.node,disabled:e.default.bool,enableUserSelectHack:e.default.bool,offsetParent:e.default.node,grid:e.default.arrayOf(e.default.number),handle:e.default.string,nodeRef:e.default.object,onStart:e.default.func,onDrag:e.default.func,onStop:e.default.func,onMouseDown:e.default.func,scale:e.default.number}),height:function(){for(var o=arguments.length,s=new Array(o),i=0;i<o;i++)s[i]=arguments[i];var a=s[0];if(a.axis==="both"||a.axis==="y"){var l;return(l=e.default.number).isRequired.apply(l,s)}return e.default.number.apply(e.default,s)},handle:e.default.oneOfType([e.default.node,e.default.func]),handleSize:e.default.arrayOf(e.default.number),lockAspectRatio:e.default.bool,maxConstraints:e.default.arrayOf(e.default.number),minConstraints:e.default.arrayOf(e.default.number),onResizeStop:e.default.func,onResizeStart:e.default.func,onResize:e.default.func,resizeHandles:e.default.arrayOf(e.default.oneOf(["s","w","e","n","sw","nw","se","ne"])),transformScale:e.default.number,width:function(){for(var o=arguments.length,s=new Array(o),i=0;i<o;i++)s[i]=arguments[i];var a=s[0];if(a.axis==="both"||a.axis==="x"){var l;return(l=e.default.number).isRequired.apply(l,s)}return e.default.number.apply(e.default,s)}};return hr.resizableProps=n,hr}var Eu;function kg(){if(Eu)return ur;Eu=1,ur.__esModule=!0,ur.default=void 0;var e=i(T),t=Og(),n=fT(),r=_g(),o=["children","className","draggableOpts","width","height","handle","handleSize","lockAspectRatio","axis","minConstraints","maxConstraints","onResize","onResizeStop","onResizeStart","resizeHandles","transformScale"];function s(y){if(typeof WeakMap!="function")return null;var g=new WeakMap,w=new WeakMap;return(s=function(x){return x?w:g})(y)}function i(y,g){if(y&&y.__esModule)return y;if(y===null||typeof y!="object"&&typeof y!="function")return{default:y};var w=s(g);if(w&&w.has(y))return w.get(y);var C={},x=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var M in y)if(M!=="default"&&Object.prototype.hasOwnProperty.call(y,M)){var S=x?Object.getOwnPropertyDescriptor(y,M):null;S&&(S.get||S.set)?Object.defineProperty(C,M,S):C[M]=y[M]}return C.default=y,w&&w.set(y,C),C}function a(){return a=Object.assign?Object.assign.bind():function(y){for(var g=1;g<arguments.length;g++){var w=arguments[g];for(var C in w)Object.prototype.hasOwnProperty.call(w,C)&&(y[C]=w[C])}return y},a.apply(this,arguments)}function l(y,g){if(y==null)return{};var w={},C=Object.keys(y),x,M;for(M=0;M<C.length;M++)x=C[M],!(g.indexOf(x)>=0)&&(w[x]=y[x]);return w}function c(y,g){var w=Object.keys(y);if(Object.getOwnPropertySymbols){var C=Object.getOwnPropertySymbols(y);g&&(C=C.filter(function(x){return Object.getOwnPropertyDescriptor(y,x).enumerable})),w.push.apply(w,C)}return w}function u(y){for(var g=1;g<arguments.length;g++){var w=arguments[g]!=null?arguments[g]:{};g%2?c(Object(w),!0).forEach(function(C){d(y,C,w[C])}):Object.getOwnPropertyDescriptors?Object.defineProperties(y,Object.getOwnPropertyDescriptors(w)):c(Object(w)).forEach(function(C){Object.defineProperty(y,C,Object.getOwnPropertyDescriptor(w,C))})}return y}function d(y,g,w){return g=f(g),g in y?Object.defineProperty(y,g,{value:w,enumerable:!0,configurable:!0,writable:!0}):y[g]=w,y}function f(y){var g=h(y,"string");return typeof g=="symbol"?g:String(g)}function h(y,g){if(typeof y!="object"||y===null)return y;var w=y[Symbol.toPrimitive];if(w!==void 0){var C=w.call(y,g);if(typeof C!="object")return C;throw new TypeError("@@toPrimitive must return a primitive value.")}return(g==="string"?String:Number)(y)}function m(y,g){y.prototype=Object.create(g.prototype),y.prototype.constructor=y,p(y,g)}function p(y,g){return p=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(C,x){return C.__proto__=x,C},p(y,g)}var b=function(y){m(g,y);function g(){for(var C,x=arguments.length,M=new Array(x),S=0;S<x;S++)M[S]=arguments[S];return C=y.call.apply(y,[this].concat(M))||this,C.handleRefs={},C.lastHandleRect=null,C.slack=null,C}var w=g.prototype;return w.componentWillUnmount=function(){this.resetData()},w.resetData=function(){this.lastHandleRect=this.slack=null},w.runConstraints=function(x,M){var S=this.props,D=S.minConstraints,P=S.maxConstraints,E=S.lockAspectRatio;if(!D&&!P&&!E)return[x,M];if(E){var A=this.props.width/this.props.height,F=x-this.props.width,W=M-this.props.height;Math.abs(F)>Math.abs(W*A)?M=x/A:x=M*A}var L=x,j=M,_=this.slack||[0,0],N=_[0],O=_[1];return x+=N,M+=O,D&&(x=Math.max(D[0],x),M=Math.max(D[1],M)),P&&(x=Math.min(P[0],x),M=Math.min(P[1],M)),this.slack=[N+(L-x),O+(j-M)],[x,M]},w.resizeHandler=function(x,M){var S=this;return function(D,P){var E=P.node,A=P.deltaX,F=P.deltaY;x==="onResizeStart"&&S.resetData();var W=(S.props.axis==="both"||S.props.axis==="x")&&M!=="n"&&M!=="s",L=(S.props.axis==="both"||S.props.axis==="y")&&M!=="e"&&M!=="w";if(!(!W&&!L)){var j=M[0],_=M[M.length-1],N=E.getBoundingClientRect();if(S.lastHandleRect!=null){if(_==="w"){var O=N.left-S.lastHandleRect.left;A+=O}if(j==="n"){var V=N.top-S.lastHandleRect.top;F+=V}}S.lastHandleRect=N,_==="w"&&(A=-A),j==="n"&&(F=-F);var k=S.props.width+(W?A/S.props.transformScale:0),I=S.props.height+(L?F/S.props.transformScale:0),$=S.runConstraints(k,I);k=$[0],I=$[1];var H=k!==S.props.width||I!==S.props.height,U=typeof S.props[x]=="function"?S.props[x]:null,Z=x==="onResize"&&!H;U&&!Z&&(D.persist==null||D.persist(),U(D,{node:E,size:{width:k,height:I},handle:M})),x==="onResizeStop"&&S.resetData()}}},w.renderResizeHandle=function(x,M){var S=this.props.handle;if(!S)return e.createElement("span",{className:"react-resizable-handle react-resizable-handle-"+x,ref:M});if(typeof S=="function")return S(x,M);var D=typeof S.type=="string",P=u({ref:M},D?{}:{handleAxis:x});return e.cloneElement(S,P)},w.render=function(){var x=this,M=this.props,S=M.children,D=M.className,P=M.draggableOpts;M.width,M.height,M.handle,M.handleSize,M.lockAspectRatio,M.axis,M.minConstraints,M.maxConstraints,M.onResize,M.onResizeStop,M.onResizeStart;var E=M.resizeHandles;M.transformScale;var A=l(M,o);return(0,n.cloneElement)(S,u(u({},A),{},{className:(D?D+" ":"")+"react-resizable",children:[].concat(S.props.children,E.map(function(F){var W,L=(W=x.handleRefs[F])!=null?W:x.handleRefs[F]=e.createRef();return e.createElement(t.DraggableCore,a({},P,{nodeRef:L,key:"resizableHandle-"+F,onStop:x.resizeHandler("onResizeStop",F),onStart:x.resizeHandler("onResizeStart",F),onDrag:x.resizeHandler("onResize",F)}),x.renderResizeHandle(F,L))}))}))},g}(e.Component);return ur.default=b,b.propTypes=r.resizableProps,b.defaultProps={axis:"both",handleSize:[20,20],lockAspectRatio:!1,minConstraints:[20,20],maxConstraints:[1/0,1/0],resizeHandles:["se"],transformScale:1},ur}var pr={},Au;function hT(){if(Au)return pr;Au=1,pr.__esModule=!0,pr.default=void 0;var e=a(T),t=s(ks()),n=s(kg()),r=_g(),o=["handle","handleSize","onResize","onResizeStart","onResizeStop","draggableOpts","minConstraints","maxConstraints","lockAspectRatio","axis","width","height","resizeHandles","style","transformScale"];function s(g){return g&&g.__esModule?g:{default:g}}function i(g){if(typeof WeakMap!="function")return null;var w=new WeakMap,C=new WeakMap;return(i=function(M){return M?C:w})(g)}function a(g,w){if(g&&g.__esModule)return g;if(g===null||typeof g!="object"&&typeof g!="function")return{default:g};var C=i(w);if(C&&C.has(g))return C.get(g);var x={},M=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var S in g)if(S!=="default"&&Object.prototype.hasOwnProperty.call(g,S)){var D=M?Object.getOwnPropertyDescriptor(g,S):null;D&&(D.get||D.set)?Object.defineProperty(x,S,D):x[S]=g[S]}return x.default=g,C&&C.set(g,x),x}function l(){return l=Object.assign?Object.assign.bind():function(g){for(var w=1;w<arguments.length;w++){var C=arguments[w];for(var x in C)Object.prototype.hasOwnProperty.call(C,x)&&(g[x]=C[x])}return g},l.apply(this,arguments)}function c(g,w){var C=Object.keys(g);if(Object.getOwnPropertySymbols){var x=Object.getOwnPropertySymbols(g);w&&(x=x.filter(function(M){return Object.getOwnPropertyDescriptor(g,M).enumerable})),C.push.apply(C,x)}return C}function u(g){for(var w=1;w<arguments.length;w++){var C=arguments[w]!=null?arguments[w]:{};w%2?c(Object(C),!0).forEach(function(x){d(g,x,C[x])}):Object.getOwnPropertyDescriptors?Object.defineProperties(g,Object.getOwnPropertyDescriptors(C)):c(Object(C)).forEach(function(x){Object.defineProperty(g,x,Object.getOwnPropertyDescriptor(C,x))})}return g}function d(g,w,C){return w=f(w),w in g?Object.defineProperty(g,w,{value:C,enumerable:!0,configurable:!0,writable:!0}):g[w]=C,g}function f(g){var w=h(g,"string");return typeof w=="symbol"?w:String(w)}function h(g,w){if(typeof g!="object"||g===null)return g;var C=g[Symbol.toPrimitive];if(C!==void 0){var x=C.call(g,w);if(typeof x!="object")return x;throw new TypeError("@@toPrimitive must return a primitive value.")}return(w==="string"?String:Number)(g)}function m(g,w){if(g==null)return{};var C={},x=Object.keys(g),M,S;for(S=0;S<x.length;S++)M=x[S],!(w.indexOf(M)>=0)&&(C[M]=g[M]);return C}function p(g,w){g.prototype=Object.create(w.prototype),g.prototype.constructor=g,b(g,w)}function b(g,w){return b=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(x,M){return x.__proto__=M,x},b(g,w)}var y=function(g){p(w,g);function w(){for(var x,M=arguments.length,S=new Array(M),D=0;D<M;D++)S[D]=arguments[D];return x=g.call.apply(g,[this].concat(S))||this,x.state={width:x.props.width,height:x.props.height,propsWidth:x.props.width,propsHeight:x.props.height},x.onResize=function(P,E){var A=E.size;x.props.onResize?(P.persist==null||P.persist(),x.setState(A,function(){return x.props.onResize&&x.props.onResize(P,E)})):x.setState(A)},x}w.getDerivedStateFromProps=function(M,S){return S.propsWidth!==M.width||S.propsHeight!==M.height?{width:M.width,height:M.height,propsWidth:M.width,propsHeight:M.height}:null};var C=w.prototype;return C.render=function(){var M=this.props,S=M.handle,D=M.handleSize;M.onResize;var P=M.onResizeStart,E=M.onResizeStop,A=M.draggableOpts,F=M.minConstraints,W=M.maxConstraints,L=M.lockAspectRatio,j=M.axis;M.width,M.height;var _=M.resizeHandles,N=M.style,O=M.transformScale,V=m(M,o);return e.createElement(n.default,{axis:j,draggableOpts:A,handle:S,handleSize:D,height:this.state.height,lockAspectRatio:L,maxConstraints:W,minConstraints:F,onResizeStart:P,onResize:this.onResize,onResizeStop:E,resizeHandles:_,transformScale:O,width:this.state.width},e.createElement("div",l({},V,{style:u(u({},N),{},{width:this.state.width+"px",height:this.state.height+"px"})})))},w}(e.Component);return pr.default=y,y.propTypes=u(u({},r.resizableProps),{},{children:t.default.element}),pr}var Ou;function pT(){return Ou||(Ou=1,cr.exports=function(){throw new Error("Don't instantiate Resizable directly! Use require('react-resizable').Resizable")},cr.exports.Resizable=kg().default,cr.exports.ResizableBox=hT().default),cr.exports}var Ig=pT();const _u=({booking:e,slotData:t,customClasses:n,hoveringAdditionalCardId:r="",children:o,ref:s})=>{const[i,a]=T.useState(!1),{updateIsDragging:l,isDragging:c}=xn(C=>C),{attributes:u,listeners:d,setNodeRef:f,isDragging:h,transform:m}=Fa({id:e.id,data:{type:"booking-slots",booking:e,slotData:t},disabled:e.disabledResize==="full"||e.disabledResize==="half"}),p=m?{transform:`translate3d(${m.x}px, ${m.y}px, 0)`}:void 0;Gr({onDragStart:()=>b(),onDragAbort:()=>y(),onDragCancel:()=>y(),onDragEnd:()=>y()});const b=T.useCallback(()=>{l(!0)},[]),y=T.useCallback(()=>{l(!1)},[]),g=T.useMemo(()=>({cursor:c?"ns-resize":"pointer",width:"100%"}),[c]),w=(C,x)=>r!=null&&r.length?C===x:!1;if(T.useImperativeHandle(s,()=>({changeCurrentCardResize:()=>a(C=>!C)})),!h)return v.jsx("div",{ref:f,className:he("cardContent_render",(i||w(r,e.id))&&"cardContent_render_dragging",n),style:{...p,...g},...d,...u,children:o},e.id)},Ng=({booking:e,slotData:t,events:n,style:r,ref:o})=>{if(!e||!t)return null;const{day:s,hour:i}=t,{users:a}=Hr(m=>m),[l,c]=T.useState(e),u=T.useMemo(()=>a.find(m=>m.id===l.userId),[a,l.userId]),d=T.useMemo(()=>{const m=Y.timeDiffInMinutes(l.finishAt,l.startAt),p=Math.floor(m/60),b=m%60;return p>0?b>0?`${p}h ${b}m`:`${p}h`:`${b}m`},[l.startAt,l.finishAt]),f=T.useMemo(()=>{const m=new Date,p=new Date(l.startAt),b=new Date(l.finishAt);return m>b?"past":m>=p&&m<=b?"current":"future"},[l.startAt,l.finishAt]),h=T.useCallback(()=>{const m=(u==null?void 0:u.profile.color)||"#3b82f6";switch(f){case"past":return{backgroundColor:`${m}60`};case"current":return{backgroundColor:m,boxShadow:`0 0 0 2px ${m}, 0 0 8px ${m}40`};default:return{backgroundColor:`${m}e6`}}},[u==null?void 0:u.profile.color,f]);return T.useEffect(()=>{e&&c(e)},[e]),T.useImperativeHandle(o,()=>({updateBooking:m=>c(m)})),v.jsx("div",{className:he("booking_card_content_container","overflow-hidden transition-all duration-200 hover:shadow-lg","min-h-[3rem] p-1 cursor-pointer relative"),style:{...r,...h()},onPointerUp:n==null?void 0:n.onClick,children:v.jsxs("div",{className:"booking_card_content text-white h-full flex flex-col justify-between",children:[v.jsxs("div",{className:"flex items-center gap-1 mb-1",children:[v.jsx(Yf,{className:"w-3 h-3 opacity-80"}),v.jsx("span",{className:"text-xs font-medium truncate",children:(u==null?void 0:u.profile.name)||`User ${l.userId}`})]}),v.jsxs("div",{className:"flex items-center gap-1 mb-1",children:[v.jsx(Kf,{className:"w-3 h-3 opacity-80"}),v.jsxs("span",{className:"text-xs",children:[Y.dateAndHourDateToString(l.startAt)," -",Y.dateAndHourDateToString(l.finishAt)]})]}),v.jsxs("div",{className:"flex items-center justify-between gap-1",children:[v.jsxs("div",{className:"flex items-center gap-1",children:[v.jsx(Yo,{className:"w-3 h-3 opacity-80"}),v.jsx("span",{className:"text-xs opacity-90",children:d})]}),f!=="future"&&v.jsx("span",{className:he("text-xs px-1 py-0.5 rounded-full text-white font-medium",f==="current"?"bg-white/20":"bg-black/20"),children:f==="current"?"LIVE":"FEITO"})]})]})},`${s}-${i}`)},ku=({afterResize:e=!1,booking:t,slotData:n,events:r,style:o})=>{if(!t||!n)return null;const{day:s,hour:i}=n,a=T.useMemo(()=>{const l=Y.timeDiffInMinutes(t.finishAt,t.startAt),c=Math.floor(l/60),u=l%60;return c>0?u>0?`${c}h ${u}m`:`${c}h`:u===15?"":`${u}m`},[t.startAt,t.finishAt]);return v.jsxs("div",{className:he("booking_card_content_container","overflow-hidden","min-h-[3rem] p-1 relative"),style:{...o,backgroundColor:"#000456c0"},onPointerUp:r==null?void 0:r.onClick,children:[!e&&v.jsx("div",{className:"absolute top-1 right-1",children:v.jsx("div",{className:"w-2 h-2 bg-white rounded-full animate-ping"})}),v.jsxs("div",{className:"booking_card_content text-white h-full flex flex-col justify-between",children:[v.jsxs("div",{className:"flex items-center gap-1 mb-1",children:[v.jsx(Kf,{className:"w-3 h-3 opacity-80"}),v.jsxs("span",{className:"text-xs",children:[Y.dateAndHourDateToString(t.startAt),"-",Y.dateAndHourDateToString(t.finishAt)]})]}),a.length&&v.jsx("div",{className:"flex items-center justify-between gap-1",children:v.jsxs("div",{className:"flex items-center gap-1",children:[v.jsx(Yo,{className:"w-3 h-3 opacity-80"}),v.jsx("span",{className:"text-xs opacity-90",children:a})]})})]})]},`${s}-${i}`)};function gT(e,t){const n=e>new Date(t.startAt),r=e<new Date(t.finishAt);return n&&r}const mT={calculateOverlappingBookings:(e,t)=>{const n=t.filter(o=>{const s=new Date(o.startAt).getDate(),i=e.startAt.getDate();return s===i&&o.id!==e.id});let r=0;for(const o of n)gT(e.startAt,o)&&r++;return r}},bl=({resize:e=!1,bookingInit:t,slotData:n,heightStyle:r,topHeightIncrement:o=0,customClasses:s,resizableParam:i,events:a,open:l=!0,lastCard:c,half:u,cardContentRef:d,cardsQuantity:f,cardIndex:h,hoveringAdditionalCardId:m,ref:p})=>{var k;const b=xn(el(I=>I.updateIsDragging)),{emptySlotNodes:y}=Jt(),{bookings:g,onCardResizeEnd:w}=wn(),[C,x]=T.useState(""),M=T.useRef(null),S=(I,$)=>{var H;D("show-handle",!0),i!=null&&i.onResizeStart&&i.onResizeStart(I,$),(H=M.current)==null||H.changeCurrentCardResize()},D=(I="",$=!1)=>{x(I),b($)},P=(I,$)=>{var H;(H=M.current)==null||H.changeCurrentCardResize(),D(),$.handle.includes("n")&&w(ki.resizeBookingNorthId(t)),$.handle.includes("s")&&w(ki.resizeBookingSouthId(t)),i!=null&&i.onResizeStop&&i.onResizeStop(I,$)},E=T.useMemo(()=>mT.calculateOverlappingBookings(t,g),[t,g]),A=I=>I===0?"8rem":"4rem",F=T.useMemo(()=>u&&f===3&&(h===0||h===1)?A(h):E===2?"0.8rem":c&&E===1?"0.2rem":c&&E?"1rem":E===1?"0.4rem":0,[E,h,f]),W=T.useMemo(()=>{const I=`${o}rem`,$=`${r}rem`;if(!u)return{inset:`${I} ${F} ${$}`};if(f===2&&h===1)return{inset:`${I} 0% ${$} 50%`};const H=()=>{const B=100/(f||0),K=(h||0)*B,X=100-K-B;return{cardWidth:B,leftPercent:K,rightPercent:X}},{cardWidth:U,leftPercent:Z,rightPercent:q}=H();return c?{inset:`${I} 0 ${$} ${100-U}%`}:{inset:`${I} ${q}% ${$} ${Z}%`}},[r,o,h,f,F,u,c]),L=(I,$)=>{const H=y.get($);H==null||H.hoveringAdditionalCard(I.id)},j=I=>{const $=y.get(I);$==null||$.clearHoveringCard()},_=(I,$)=>{({mouseenter:()=>L(t,I),mouseleave:()=>j(I)}[$]||(()=>console.warn(`Unhandled event type: ${$}`)))()},N=I=>{const $=I.toDateString();return pn({key:$,time:Pa})},O=I=>{const $=Y.calculateDaysDifference(t.finishAt,t.startAt);if($===1){_(N(t.finishAt),I);return}const H=Y.buildFutureDateList(t,$);for(const U of H)_(N(U),I)},V=I=>{const $=I.type;if(t!=null&&t.nodes)for(const H of t.nodes)_(H,$);O($)};if(T.useEffect(()=>()=>{a!=null&&a.onUnmount&&a.onUnmount()},[]),T.useImperativeHandle(d,()=>({changeCurrentCardResize:()=>{var I;(I=M.current)==null||I.changeCurrentCardResize()}})),!l&&!t.finishAt)return null;if((k=i==null?void 0:i.state)!=null&&k.height){const{state:I,onResize:$,resizeHandle:H=["s","n"]}=i,Z=(()=>{switch(t==null?void 0:t.disabledResize){case"full":return[];case"half":return["s"];default:return H}})();return v.jsx(Ig.Resizable,{className:he(i==null?void 0:i.customClass,C),height:I==null?void 0:I.height,width:I==null?void 0:I.width,onResize:$,onResizeStart:S,onResizeStop:P,resizeHandles:Z,draggableOpts:{grid:[35,35]},handleSize:[20,20],maxConstraints:[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY],transformScale:1,children:v.jsx("div",{className:"card_content_core",style:W,onMouseEnter:V,onMouseLeave:V,onBlur:()=>{},children:v.jsx(_u,{ref:M,booking:t,slotData:n,hoveringAdditionalCardId:m,children:e?v.jsx(ku,{booking:t,slotData:n,events:{onClick:a==null?void 0:a.onClick}}):v.jsx(Ng,{booking:t,slotData:n,events:{onClick:a==null?void 0:a.onClick}})},t.id)})})}return v.jsx("div",{ref:p,className:"card_content_core",style:W,children:v.jsx(_u,{customClasses:s,booking:t,slotData:n,children:v.jsx(ku,{booking:t,slotData:n,afterResize:!0,events:{onClick:a==null?void 0:a.onClick}})})})},Iu=({booking:e,slotData:t,cardsQuantity:n=1,cardIndex:r=0,lastCard:o=!1,half:s=!1,hoveringAdditionalCardId:i,ref:a})=>{const{bookingViewType:l}=$e(),[c,u]=T.useState({...e});T.useEffect(()=>{e&&u(e)},[e]);const[d,f]=T.useState(!1),h=T.useRef("left"),m=()=>{const M=t.day.split(":")[0].trim();if(l===ae.DAY)h.current="top";else switch(M){case"Mon":case"Sun":h.current="right";break;default:h.current="left";break}f(!0)},p=async M=>{try{u(S=>({...S,finishAt:M}))}catch(S){console.log(S)}},b=async M=>{u(S=>({...S,startAt:M}))},y=async M=>{try{u(S=>({...S,finishAt:M}))}catch(S){console.log(S)}},{state:g,heightStyle:w,topHeightIncrement:C,onResize:x}=$p({booking:c,onAddTime:p,onAddStartTime:b,onSubTime:y,starter:!0});return T.useImperativeHandle(a,()=>({bookingId:e.id}),[e.id]),v.jsx(Dg,{booking:c,onOpenChange:f,side:l===ae.DAY?"top":"left",isEditingOpen:d,children:v.jsx(bl,{resizableParam:{state:g,onResize:x,resizeHandle:["s","n"]},customClasses:"Draggable",bookingInit:c,slotData:t,topHeightIncrement:C,heightStyle:w,events:{onClick:m},half:s,lastCard:o,cardsQuantity:n,cardIndex:r,hoveringAdditionalCardId:i})})},Nu=({bookings:e,blockTimeString:t,slotData:n,hoveringAdditionalCardId:r})=>{if(!e||!(n!=null&&n.day)&&!(n!=null&&n.hour)||!t||!e.length)return null;const o=T.useMemo(()=>e.filter(s=>{const i=Y.dateAndHourDateToString(new Date(s.startAt));return Y.compareSameDate(new Date(n.day),new Date(s.startAt))&&i.split(":")[1]===t}),[e,t]);if(!(!o||!(o!=null&&o.length)))return o.length===1?v.jsx(Iu,{booking:o[0],slotData:n,hoveringAdditionalCardId:r}):v.jsx(v.Fragment,{children:o.map((s,i)=>v.jsx(Iu,{booking:s,half:!0,slotData:n,lastCard:o.length-1===i,cardsQuantity:o.length,cardIndex:i,hoveringAdditionalCardId:r},s.id))})},vT=({booking:e,onAddTime:t,onStartAtChange:n,onSubTime:r,operationalHours:o,starter:s=!1})=>{const[i,a]=T.useState({height:Ht,width:Ht}),[l,c]=T.useState(0),u=(P,E)=>{const A=Y.timeDiffInMinutes(P,E),F=Math.ceil(A/Oo);return-Math.abs((F-1)*2)},[d,f]=T.useState(s?u(e.finishAt,e.startAt):0),h=P=>P===-Math.abs(0)||P===0,m=P=>{const E=((o==null?void 0:o.startTime)||24)-1;return P.getHours()===E&&P.getMinutes()===45},p=P=>{const E=o!=null&&o.endTime?o.endTime+1:0;return P.getHours()===E&&P.getMinutes()===15},b=()=>{const P=C(e.finishAt,"add");return p(P)?!0:(f(E=>h(E)?uf:E-2),t&&t(P),!1)},y=async()=>{const P=C(e.finishAt,"remove");f(E=>E+2),r&&r(P)},g=()=>{const P=x(e.startAt,"remove");return m(P)?!0:(c(E=>E-2),n&&n(P),!1)},w=async()=>{const P=x(e.startAt,"add");c(E=>E+2),n&&n(P)},C=(P,E)=>{const A=new Date(P),F=A.getMinutes();return E==="add"&&A.setMinutes(F+15),E==="remove"&&A.setMinutes(F-15),A},x=(P,E)=>{const A=new Date(P),F=A.getMinutes();return E==="add"&&A.setMinutes(F+15),E==="remove"&&A.setMinutes(F-15),A};return{state:i,setState:a,resetState:()=>{a({height:Ht,width:Ht})},resetHeightStyle:()=>{f(0)},heightStyle:d,topHeightIncrement:l,onResize:(P,{size:E})=>{P.stopPropagation(),P.preventDefault();const A=E.height;a(F=>{let W=!1;return F.height<A&&(l!==0?w():W=b()),F.height>A&&(A<600?W=g():y()),W?{...F}:{...F,height:A}})}}},yT=T.forwardRef(({slotData:e,events:{onClick:t,renderPreviewCard:n}},r)=>{const[o,s]=T.useState(!1),[i,a]=T.useState(e.time),[l,c]=T.useState(Y.addMinutesToHour(i,15)),[u,d]=T.useState(!1),{isDragging:f}=xn(j=>j),{systemColor:h,isTimeInfoVisible:m}=yf(j=>j),{operationalStartTime:p,operationalEndTime:b}=$e(),y=T.useRef(null),g=u?{backgroundColor:"white",border:"none"}:{},w=T.useMemo(()=>({id:"dragging_booking_preview",startAt:Y.convertStringTimeToDateFormat(i),finishAt:Y.convertStringTimeToDateFormat(l)}),[l,i]),C=()=>{var j;(j=y.current)==null||j.changeCurrentCardResize(),d(!0),n()},x=()=>{t(l,i)},{state:M,resetState:S,resetHeightStyle:D,heightStyle:P,onResize:E,topHeightIncrement:A}=vT({booking:w,operationalHours:{startTime:p,endTime:b},onAddTime:j=>{console.log("onAddTime date time",j),c(Y.dateTimeAsString(j))},onStartAtChange:j=>{console.log("onStartAtChange date time",j),a(Y.dateTimeAsString(j))},onSubTime:j=>{console.log("onSubTime date time",j),c(Y.dateTimeAsString(j))}}),F=()=>{},W=()=>{c(Y.addMinutesToHour(e.time,15))},L=()=>{d(!1),W(),S(),D()};if(T.useImperativeHandle(r,()=>({show:()=>s(!0),hide:()=>{s(!1)},changeIsOpen:j=>s(j),reset:L}),[]),!!o)return v.jsx("div",{style:{...g,border:m&&!f?`1.5px solid ${h}`:"none"},className:he("timeInfo_core",g),children:v.jsx(Ig.Resizable,{className:"slot-resizable",height:M.height,width:M.width,onResizeStart:C,onResizeStop:x,onResize:E,resizeHandles:["se"],draggableOpts:{grid:[35,35]},handleSize:[30,30],maxConstraints:[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY],transformScale:1,children:u?v.jsx("div",{className:"timeInfo_core_dragging",children:v.jsx(bl,{resize:!0,bookingInit:w,slotData:{day:e.key,hour:"09:00"},topHeightIncrement:A,heightStyle:P,cardContentRef:y,resizableParam:{state:M,onResize:E,customClass:"show-handle"},events:{onUnmount:F}})}):v.jsx("div",{className:"timeInfo_core_timeParent",children:!f&&v.jsx("span",{className:"timeInfo_core_timeParent_time",style:{color:h,display:m?"initial":"none"},children:e.time})})})})}),So=({slotData:e,blockTimeString:t,dayHour:n,slotPosition:r,disabledCss:o,events:s,bookings:i,children:a,ref:l})=>{const{isDragging:c,updateIsDragging:u}=xn(J=>J),{emptySlotNodes:d,setSelectedNode:f}=Jt(),{onModalClose:h,onSlotClick:m}=wn(),{startAt:p,finishAt:b,updateDate:y,updateStartAt:g,updateFinishAtWithOffset:w}=gf(J=>J),C=$e(J=>J.bookingViewType),[x,M]=T.useState(!1),[S,D]=T.useState(!1),[P,E]=T.useState([]),[A,F]=T.useState(""),W=T.useRef(null),L=T.useRef(null),j=T.useRef(null),_=J=>{E(ue=>ue.filter(xe=>xe.id!==J.id))},N=(J,ue,xe=!1)=>{const Be=new Date(J.finishAt);Be.setHours(24,0);const tt=[{id:J.id,userId:J.userId,finishAt:xe?Be:J.finishAt,overflow:!0,startAt:ki.resetToFirstHourNextDay(J),disabledResize:xe?"full":"half",nodes:ue}];E(tt)},O=()=>j.current,V=()=>{var J;(J=j.current)==null||J.isModalOpen()},k=()=>{var J;(J=O())==null||J.showCreationModal()},I=()=>{var J;(J=L.current)==null||J.show()},$=()=>{var J;(J=L.current)==null||J.hide()},H=J=>{var ue;(ue=L.current)==null||ue.changeIsOpen(J)},U=T.useMemo(()=>({id:"dragging_booking_preview",startAt:Y.convertStringTimeToDateFormat(p),finishAt:Y.convertStringTimeToDateFormat(b)}),[b,p]),{updateHeightStyle:Z,heightStyle:q}=$p({booking:U}),B=(J,ue)=>!ue||!(ue!=null&&ue.length)?!1:!!ue.find(xe=>Y.dateTimeAsString(xe.startAt)===J),K=T.useCallback(()=>{if(B(e.time,i)||c||V()||x)return;s.onMouseEnterEvent()===r&&I()},[r,c,x,s,P,i]),X=J=>{var Be,tt;console.log("onCloseCreationModal"),(Be=L.current)==null||Be.reset();const ue=pn(e),xe=d==null?void 0:d.get(ue);xe&&xe.closeEvent(),h==null||h(),J==null||J.stopPropagation(),J==null||J.preventDefault(),(tt=O())==null||tt.closeModal()},G=J=>{J||X(),M(J),H(J)},ne=T.useCallback((J,ue)=>{if(c&&!J)return;u(!1);const{time:xe,key:Be,userId:tt}=e,nr=pn({key:Be,time:ue||xe,userId:tt}),rr=d==null?void 0:d.get(nr);f(nr),rr&&rr.showEvent(ue||xe),y(Be);const _t=w(J||xe,J?0:15);m({slotData:e,finishTime:_t}),k()},[e,d,c,m,w]),z=()=>{c||V()||$()},le=o.length||S?o:"hovering_slotTrigger_core",me=T.useCallback(()=>{const{time:J,key:ue}=e;u(!0),D(!0),y(ue),g(J),w(J)},[w,e,y,u,g]),Ie=()=>{k()},Ee=T.useCallback(()=>{D(!1)},[]),ct=()=>{setTimeout(()=>{$(),k(),M(!0)},0)};return T.useEffect(()=>{c?document.body.style.cursor="ns-resize":document.body.style.cursor="default"},[c]),T.useEffect(()=>{if(!b||!p)return;const J=Y.convertStringTimeToDateFormat(b),ue=Y.convertStringTimeToDateFormat(p);Number.isNaN(J)||Number.isNaN(ue)||!(J instanceof Date)||!(ue instanceof Date)||Z(J,ue)},[b,p]),T.useEffect(()=>{if(!x){$();return}W!=null&&W.current&&W.current.scrollIntoView({behavior:"smooth",block:"center"})},[x]),T.useEffect(()=>{i!=null&&i.length&&$(),S&&I()},[i,S]),T.useEffect(()=>{S&&I()},[S]),T.useImperativeHandle(l,()=>({showEvent:J=>{g(J),ct()},closeEvent:()=>{var J;(J=O())==null||J.closeModal(),M(!1),$(),Ee()},onOpenCloseChange:J=>{H(J),M(J),Ee()},addAdditionalBooking:N,removeFromAdditionalBooking:_,hoveringAdditionalCard:J=>{F(J)},clearHoveringCard:()=>{F("")}})),v.jsxs(v.Fragment,{children:[v.jsxs("div",{ref:e.ref,style:{borderBottom:r==="fourth"?"1px solid #8080807a":"",...e.style},className:he("slotTrigger_core",C===ae.DAY&&"slotTrigger_core_day",le),onMouseOver:K,onMouseLeave:z,onFocus:()=>{},children:[v.jsx(yT,{ref:L,slotData:e,events:{onClick:ne,openOptions:Ie,renderPreviewCard:me,resetPrevView:Ee}}),a,x&&v.jsx(bl,{ref:W,bookingInit:U,slotData:{day:new Date().toISOString(),hour:"09:00"},hoveringAdditionalCardId:A,heightStyle:q}),v.jsx(Nu,{hoveringAdditionalCardId:A,bookings:P,blockTimeString:"00",slotData:n}),v.jsx(Nu,{hoveringAdditionalCardId:A,bookings:i,blockTimeString:t,slotData:n})]},e.key),v.jsx(Lp,{ref:j,onClose:X,onOpenChange:G,buttonTrigger:v.jsx("div",{},e.key),side:"right"})]})};var wT="Separator",ju="horizontal",xT=["horizontal","vertical"],jg=R.forwardRef((e,t)=>{const{decorative:n,orientation:r=ju,...o}=e,s=bT(r)?r:ju,a=n?{role:"none"}:{"aria-orientation":s==="vertical"?s:void 0,role:"separator"};return v.jsx(ce.div,{"data-orientation":s,...a,...o,ref:t})});jg.displayName=wT;function bT(e){return xT.includes(e)}var ST=jg;function CT({className:e,orientation:t="horizontal",decorative:n=!0,...r}){return v.jsx(ST,{"data-slot":"separator-root",decorative:n,orientation:t,className:he("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",e),...r})}const RT=La("inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function DT({className:e,variant:t,...n}){return v.jsx("div",{className:he(RT({variant:t}),e),...n})}const TT=({dateToRender:e,isFirstDay:t})=>v.jsx("div",{style:{left:t?"3px":"10px"},className:"first_day_slot",children:v.jsx("span",{children:v.jsx(DT,{children:e})})});class MT{constructor(){sn(this,"positionBasedOnSeconds",t=>{const[,n]=t.split(":");if(!t.length)return-3;const r=Number(n);return this.normalizingMinutes(r)});sn(this,"normalizingMinutes",t=>t>=0&&t<=15?t*2:t>15&&t<30?(t-15)*2:t>=30&&t<=59?t-30:-3);sn(this,"isInitialMinute",t=>t>=0&&t<=8);sn(this,"isSameHour",(t,n)=>n.split(":")[0]===t)}}class PT{constructor(){sn(this,"is15MinLess",t=>{const n=new Date,[r,o]=t.split(":"),s=new Date(n.getFullYear(),n.getMonth(),n.getDate(),Number(r),Number(o),0),i=new Date(n),a=Y.roundMinutes(n.getMinutes());i.setHours(n.getHours(),a,0,0);const l=Y.minuteDifference(s,i);return l>30||l<-30});sn(this,"normalizeDateNow",t=>{const n=t.getHours(),r=Y.roundMinutes(t.getMinutes());return`${n.toString().padStart(2,"0")}:${r.toString().padStart(2,"0")}`})}}const Co=({color:e="#000",isFirstDay:t,slotData:n})=>{const{bookingViewType:r}=$e(),[o,s]=T.useState(""),[i,a]=T.useState(!1),[l,c]=T.useState(!1),u=T.useMemo(()=>{const y=new Date,g=new Date(n.key);return g.getDay()===y.getDay()&&g.getDate()===y.getDate()},[n.key]),d=y=>{s(y)},f=()=>{a(!0)},h=()=>{a(!1)},m=T.useMemo(()=>new MT().positionBasedOnSeconds(o),[n.time,o]),p=T.useMemo(()=>t?"101%":r===ae.DAY?"102%":"100%",[t,r]),b=T.useMemo(()=>u?{top:`${m-2}px`,left:"0px",width:"100%"}:{top:`${m-1}px`,left:"0px",width:"100%"},[u,t,p,m]);if(T.useEffect(()=>{const y=n.time,g=new PT,w=()=>{const x=new Date,M=g.normalizeDateNow(x),S=Y.dateAndHourDateToString(x);o!==S&&d(S),c(M===y)};let C;return g.is15MinLess(y)||(C=setInterval(()=>w(),1e3)),()=>clearInterval(C)},[n.time,o]),!!l)return v.jsxs("div",{style:{...b},className:he("timeIndicator_today",u&&p,u&&r===ae.WEEK&&"timeIndicator_today_circle"),onMouseEnter:f,onMouseOut:h,onBlur:()=>{},children:[v.jsx(CT,{className:"focus-effect",style:{height:u&&r===ae.WEEK?"4px":"2px",backgroundColor:e}}),i&&v.jsx(TT,{isFirstDay:t,dateToRender:o})]})},Fu=({bookings:e,first:t,second:n,third:r,fourth:o,disabledCss:s,firstDay:i,userId:a,dayHour:l})=>{const{operationalStartTime:c,operationalEndTime:u}=$e(),{setEmptySlotNode:d,emptySlotNodes:f}=Jt(),h=T.useCallback((g,w)=>{if(!g)return;const C=pn(w);f.get(C)||d(g,w,{startTime:c,endTime:u})},[d,f]),m=(g,w)=>{const C=g.toDateString();return pn({key:C,time:w?Y.dateTimeAsString(w):Pa})},p=T.useCallback(g=>{const w=m(g);return f.get(w)},[f]),b=(g,w,C)=>{const x=Y.buildFutureDateList(g,w);for(let M=0;M<x.length;M++){const S=p(x[M]);if(!S)return;S.addAdditionalBooking(g,C,M!==x.length-1)}},y=T.useCallback(()=>{if(e!=null&&e.length)for(const g of e){const w=Y.calculateDaysDifference(g.finishAt,g.startAt),x=Y.buildFutureDateList(g,w+1,0).map((M,S)=>m(M,S===0?g.startAt:void 0)).filter(M=>M!==void 0);if(w===1){const M=p(g.finishAt);if(!M)return;M.addAdditionalBooking(g,x);return}b(g,w,x)}},[e,p,b]);return T.useEffect(()=>{e!=null&&e.length&&y()},[e,f,y]),v.jsxs(v.Fragment,{children:[v.jsx(So,{ref:g=>h(g,{key:t.key,time:t.time,userId:a}),slotData:t,disabledCss:s,events:{onMouseEnterEvent:()=>"first"},slotPosition:"first",dayHour:l,bookings:e,blockTimeString:"00",children:v.jsx(Co,{isFirstDay:i,slotData:t})}),v.jsx(So,{ref:g=>h(g,{key:n.key,time:n.time,userId:a}),slotData:n,disabledCss:s,events:{onMouseEnterEvent:()=>"second"},slotPosition:"second",dayHour:l,bookings:e,blockTimeString:"15",children:v.jsx(Co,{isFirstDay:i,slotData:n})}),v.jsx(So,{ref:g=>h(g,{key:r.key,time:r.time,userId:a}),slotData:r,disabledCss:s,events:{onMouseEnterEvent:()=>"third"},slotPosition:"third",dayHour:l,bookings:e,blockTimeString:"30",children:v.jsx(Co,{isFirstDay:i,slotData:r})}),v.jsx(So,{ref:g=>h(g,{key:o.key,time:o.time,userId:a}),slotData:o,disabledCss:s,events:{onMouseEnterEvent:()=>"fourth"},slotPosition:"fourth",dayHour:l,bookings:e,blockTimeString:"45",children:v.jsx(Co,{isFirstDay:i,slotData:o})})]})},ET=T.memo(({firstDay:e,booking:t,dayHour:n,disabledCss:r,user:o,firstBlockTimeData:s,secondBlockTimeData:i,thirdBlockTimeData:a,fourthBlockTimeData:l})=>{const{day:c,hour:u}=n,d=Hr(h=>h.users),f=T.useMemo(()=>t.filter(h=>{const m=Y.dateAndHourDateToString(h.startAt),p=new Date(h.startAt).getDate(),b=new Date(c).getDate(),y=u.split(":")[0],w=m.split(":")[0]===y,C=p===b;if(!(o!=null&&o.id)){const M=d.find(S=>S.id===h.userId);return w&&C&&(M==null?void 0:M.status)}const x=h.userId===o.id;return w&&C&&x}),[t,n,d,o]);return f.length?v.jsx(Fu,{dayHour:n,bookings:f,first:s,second:i,third:a,fourth:l,disabledCss:r,firstDay:e}):v.jsx(Fu,{dayHour:n,first:s,second:i,third:a,fourth:l,disabledCss:r,firstDay:e,userId:o==null?void 0:o.id})}),Vu=({dayHour:e,firstDay:t,user:n,bookingBulk:r})=>{const o=T.useRef(""),s=bf(M=>M.updateStartAt),i=T.useMemo(()=>Y.addMinuteToHour(e.hour,15),[e.hour]),a=T.useMemo(()=>Y.addMinuteToHour(e.hour,30),[e.hour]),l=T.useMemo(()=>Y.addMinuteToHour(e.hour,45),[e.hour]),c=(M,S)=>S?`${M};${S}`:`${M}`,{isOver:u,setNodeRef:d}=lo({id:c(Y.newDateKey(e.day,e.hour),n==null?void 0:n.id),data:{accepts:["booking-slots"]}}),{isOver:f,setNodeRef:h}=lo({id:c(Y.newDateKey(e.day,i),n==null?void 0:n.id),data:{accepts:["booking-slots"]}}),{isOver:m,setNodeRef:p}=lo({id:c(Y.newDateKey(e.day,a),n==null?void 0:n.id),data:{accepts:["booking-slots"]}}),{isOver:b,setNodeRef:y}=lo({id:c(Y.newDateKey(e.day,l),n==null?void 0:n.id),data:{accepts:["booking-slots"]}});T.useEffect(()=>{u&&s(c(Y.newDateKey(e.day,e.hour),n==null?void 0:n.id)),f&&s(c(Y.newDateKey(e.day,i),n==null?void 0:n.id)),m&&s(c(Y.newDateKey(e.day,a),n==null?void 0:n.id)),b&&s(c(Y.newDateKey(e.day,l),n==null?void 0:n.id))},[u,f,m,b]);const g=T.useMemo(()=>({ref:d,style:{backgroundColor:u?"#0066ff":""},key:Y.newDateKey(e.day,e.hour),time:e.hour,userId:n==null?void 0:n.id}),[e.day,u,e.hour,d]),w=T.useMemo(()=>({ref:h,style:{backgroundColor:f?"#0066ff":""},key:Y.newDateKey(e.day,i),time:i,userId:n==null?void 0:n.id}),[e.day,f,i,h]),C=T.useMemo(()=>({ref:p,style:{backgroundColor:m?"#0066ff":""},key:Y.newDateKey(e.day,a),time:a,userId:n==null?void 0:n.id}),[e.day,m,a,p]),x=T.useMemo(()=>({ref:y,style:{backgroundColor:b?"#0066ff":""},key:Y.newDateKey(e.day,l),time:l,userId:n==null?void 0:n.id}),[e.day,l,b,y]);return v.jsx("td",{className:"slot",children:v.jsx(ET,{booking:r,dayHour:e,firstDay:t,user:n,disabledCss:o.current,firstBlockTimeData:g,secondBlockTimeData:w,thirdBlockTimeData:C,fourthBlockTimeData:x})},`${e.day}-${e.hour}-slot`)},AT=({hour:e})=>v.jsxs(hl,{children:[v.jsx(pl,{children:v.jsx("span",{className:"border-solid hover:border-b-2 hover:border-b-purple-600 border-b-white cursor-pointer",children:e})}),v.jsxs(gl,{children:[v.jsx(_R,{children:"Hour options"}),v.jsx(kR,{}),v.jsx(su,{children:"Set lunch interval"}),v.jsx(su,{children:"Remove lunch interval"})]})]}),OT=()=>{const{hours:e,daysOfWeek:t,bookingViewType:n,bookingBulkData:r}=$e(el(b=>({bookingBulkData:b.bookingBulkData,bookingViewType:b.bookingViewType,daysOfWeek:b.daysOfWeek,hours:b.hours}))),{selectedNode:o,emptySlotNodes:s}=Jt(),{users:i}=Hr(b=>b),{finishAt:a,updateFinishAtWithOffset:l}=gf(b=>b),[c]=T.useState({startAt:"12:00",finishAt:"12:30"}),u=T.useMemo(()=>n===ae.DAY?{maxWidth:"5rem",padding:0,minWidth:"4rem"}:{},[n]),d=T.useMemo(()=>({borderLeft:"none",backgroundColor:"white"}),[]),f=T.useMemo(()=>o.split(";")[1],[o]),h=T.useMemo(()=>{const b=[];if(n===ae.DAY)for(let y=0;y<i.length;y++)b.push(t[0]);return b},[n,t,i]);T.useEffect(()=>{if(o){const b=s.get(o);b==null||b.showEvent(f)}},[o,s]),T.useEffect(()=>{f===a&&l(f)},[o,a]);const m=T.useCallback(b=>{const y=g=>g===0;return n===ae.DAY?i.filter(g=>g.status).map((g,w)=>v.jsx(Vu,{dayHour:{day:String(h[w]),hour:b},user:g,lunchTimeBlock:c,firstDay:y(w),bookingBulk:r.booking},`${h[w]}-${b}-slot-content-{${g.id}}`)):t.map((g,w)=>v.jsx(Vu,{dayHour:{day:String(g),hour:b},lunchTimeBlock:c,firstDay:y(w),bookingBulk:r.booking},`${g}-${b}-slot-content`))},[n,i,t,h,r.booking]);return T.useMemo(()=>v.jsx("tbody",{children:e.map(b=>v.jsxs("tr",{children:[v.jsx("td",{style:{...d,...u},className:"time-col",children:v.jsx("div",{className:"calendarCore_actions",children:v.jsx(AT,{hour:b})})},`${b}-hour`),m(b)]},`${b}-content`))}),[u,e,d,r.booking,n,t,m,t.length])},_T={id:"user-123",profile:{id:"profile-123",name:"Diego",color:"#14b8a6",email:"jane.smith@example.com"},createdAt:new Date,updatedAt:new Date};function kT(e,t,n){const r={...e};return t.top+e.y<=n.top?r.y=n.top-t.top:t.bottom+e.y>=n.top+n.height&&(r.y=n.top+n.height-t.bottom),t.left+e.x<=n.left?r.x=n.left-t.left:t.right+e.x>=n.left+n.width&&(r.x=n.left+n.width-t.right),r}const IT=e=>{let{transform:t,draggingNodeRect:n,windowRect:r}=e;return!n||!r?t:kT(t,n,r)},Fg=T.createContext({});function NT(e){const t=T.useRef(null);return t.current===null&&(t.current=e()),t.current}const Sl=typeof window<"u",jT=Sl?T.useLayoutEffect:T.useEffect,Cl=T.createContext(null);function Rl(e,t){e.indexOf(t)===-1&&e.push(t)}function Dl(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}const Pt=(e,t,n)=>n>t?t:n<e?e:n;let Jn=()=>{},Et=()=>{};process.env.NODE_ENV!=="production"&&(Jn=(e,t)=>{!e&&typeof console<"u"&&console.warn(t)},Et=(e,t)=>{if(!e)throw new Error(t)});const At={},Vg=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function Lg(e){return typeof e=="object"&&e!==null}const $g=e=>/^0[^.\s]+$/u.test(e);function Tl(e){let t;return()=>(t===void 0&&(t=e()),t)}const Qe=e=>e,FT=(e,t)=>n=>t(e(n)),oo=(...e)=>e.reduce(FT),Nr=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r};class Ml{constructor(){this.subscriptions=[]}add(t){return Rl(this.subscriptions,t),()=>Dl(this.subscriptions,t)}notify(t,n,r){const o=this.subscriptions.length;if(o)if(o===1)this.subscriptions[0](t,n,r);else for(let s=0;s<o;s++){const i=this.subscriptions[s];i&&i(t,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const ot=e=>e*1e3,gt=e=>e/1e3;function Bg(e,t){return t?e*(1e3/t):0}const Lu=new Set;function Pl(e,t,n){e||Lu.has(t)||(console.warn(t),Lu.add(t))}const zg=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,VT=1e-7,LT=12;function $T(e,t,n,r,o){let s,i,a=0;do i=t+(n-t)/2,s=zg(i,r,o)-e,s>0?n=i:t=i;while(Math.abs(s)>VT&&++a<LT);return i}function so(e,t,n,r){if(e===t&&n===r)return Qe;const o=s=>$T(s,0,1,e,n);return s=>s===0||s===1?s:zg(o(s),t,r)}const Hg=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,Wg=e=>t=>1-e(1-t),Ug=so(.33,1.53,.69,.99),El=Wg(Ug),Gg=Hg(El),Kg=e=>(e*=2)<1?.5*El(e):.5*(2-Math.pow(2,-10*(e-1))),Al=e=>1-Math.sin(Math.acos(e)),Yg=Wg(Al),qg=Hg(Al),BT=so(.42,0,1,1),zT=so(0,0,.58,1),Xg=so(.42,0,.58,1),HT=e=>Array.isArray(e)&&typeof e[0]!="number",Zg=e=>Array.isArray(e)&&typeof e[0]=="number",$u={linear:Qe,easeIn:BT,easeInOut:Xg,easeOut:zT,circIn:Al,circInOut:qg,circOut:Yg,backIn:El,backInOut:Gg,backOut:Ug,anticipate:Kg},WT=e=>typeof e=="string",Bu=e=>{if(Zg(e)){Et(e.length===4,"Cubic bezier arrays must contain four numerical values.");const[t,n,r,o]=e;return so(t,n,r,o)}else if(WT(e))return Et($u[e]!==void 0,`Invalid easing type '${e}'`),$u[e];return e},Ro=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"],zu={value:null};function UT(e,t){let n=new Set,r=new Set,o=!1,s=!1;const i=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1},l=0;function c(d){i.has(d)&&(u.schedule(d),e()),l++,d(a)}const u={schedule:(d,f=!1,h=!1)=>{const p=h&&o?n:r;return f&&i.add(d),p.has(d)||p.add(d),d},cancel:d=>{r.delete(d),i.delete(d)},process:d=>{if(a=d,o){s=!0;return}o=!0,[n,r]=[r,n],n.forEach(c),t&&zu.value&&zu.value.frameloop[t].push(l),l=0,n.clear(),o=!1,s&&(s=!1,u.process(d))}};return u}const GT=40;function Jg(e,t){let n=!1,r=!0;const o={delta:0,timestamp:0,isProcessing:!1},s=()=>n=!0,i=Ro.reduce((w,C)=>(w[C]=UT(s,t?C:void 0),w),{}),{setup:a,read:l,resolveKeyframes:c,preUpdate:u,update:d,preRender:f,render:h,postRender:m}=i,p=()=>{const w=At.useManualTiming?o.timestamp:performance.now();n=!1,At.useManualTiming||(o.delta=r?1e3/60:Math.max(Math.min(w-o.timestamp,GT),1)),o.timestamp=w,o.isProcessing=!0,a.process(o),l.process(o),c.process(o),u.process(o),d.process(o),f.process(o),h.process(o),m.process(o),o.isProcessing=!1,n&&t&&(r=!1,e(p))},b=()=>{n=!0,r=!0,o.isProcessing||e(p)};return{schedule:Ro.reduce((w,C)=>{const x=i[C];return w[C]=(M,S=!1,D=!1)=>(n||b(),x.schedule(M,S,D)),w},{}),cancel:w=>{for(let C=0;C<Ro.length;C++)i[Ro[C]].cancel(w)},state:o,steps:i}}const{schedule:we,cancel:qt,state:Pe,steps:hi}=Jg(typeof requestAnimationFrame<"u"?requestAnimationFrame:Qe,!0);let jo;function KT(){jo=void 0}const Le={now:()=>(jo===void 0&&Le.set(Pe.isProcessing||At.useManualTiming?Pe.timestamp:performance.now()),jo),set:e=>{jo=e,queueMicrotask(KT)}},Qg=e=>t=>typeof t=="string"&&t.startsWith(e),Ol=Qg("--"),YT=Qg("var(--"),_l=e=>YT(e)?qT.test(e.split("/*")[0].trim()):!1,qT=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,Qn={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},jr={...Qn,transform:e=>Pt(0,1,e)},Do={...Qn,default:1},Cr=e=>Math.round(e*1e5)/1e5,kl=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function XT(e){return e==null}const ZT=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Il=(e,t)=>n=>!!(typeof n=="string"&&ZT.test(n)&&n.startsWith(e)||t&&!XT(n)&&Object.prototype.hasOwnProperty.call(n,t)),em=(e,t,n)=>r=>{if(typeof r!="string")return r;const[o,s,i,a]=r.match(kl);return{[e]:parseFloat(o),[t]:parseFloat(s),[n]:parseFloat(i),alpha:a!==void 0?parseFloat(a):1}},JT=e=>Pt(0,255,e),pi={...Qn,transform:e=>Math.round(JT(e))},un={test:Il("rgb","red"),parse:em("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+pi.transform(e)+", "+pi.transform(t)+", "+pi.transform(n)+", "+Cr(jr.transform(r))+")"};function QT(e){let t="",n="",r="",o="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),o=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),o=e.substring(4,5),t+=t,n+=n,r+=r,o+=o),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:o?parseInt(o,16)/255:1}}const na={test:Il("#"),parse:QT,transform:un.transform},io=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Bt=io("deg"),mt=io("%"),re=io("px"),eM=io("vh"),tM=io("vw"),Hu={...mt,parse:e=>mt.parse(e)/100,transform:e=>mt.transform(e*100)},En={test:Il("hsl","hue"),parse:em("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+mt.transform(Cr(t))+", "+mt.transform(Cr(n))+", "+Cr(jr.transform(r))+")"},_e={test:e=>un.test(e)||na.test(e)||En.test(e),parse:e=>un.test(e)?un.parse(e):En.test(e)?En.parse(e):na.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?un.transform(e):En.transform(e)},nM=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function rM(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(kl))==null?void 0:t.length)||0)+(((n=e.match(nM))==null?void 0:n.length)||0)>0}const tm="number",nm="color",oM="var",sM="var(",Wu="${}",iM=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Fr(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},o=[];let s=0;const a=t.replace(iM,l=>(_e.test(l)?(r.color.push(s),o.push(nm),n.push(_e.parse(l))):l.startsWith(sM)?(r.var.push(s),o.push(oM),n.push(l)):(r.number.push(s),o.push(tm),n.push(parseFloat(l))),++s,Wu)).split(Wu);return{values:n,split:a,indexes:r,types:o}}function rm(e){return Fr(e).values}function om(e){const{split:t,types:n}=Fr(e),r=t.length;return o=>{let s="";for(let i=0;i<r;i++)if(s+=t[i],o[i]!==void 0){const a=n[i];a===tm?s+=Cr(o[i]):a===nm?s+=_e.transform(o[i]):s+=o[i]}return s}}const aM=e=>typeof e=="number"?0:e;function lM(e){const t=rm(e);return om(e)(t.map(aM))}const Xt={test:rM,parse:rm,createTransformer:om,getAnimatableNone:lM};function gi(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function cM({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let o=0,s=0,i=0;if(!t)o=s=i=n;else{const a=n<.5?n*(1+t):n+t-n*t,l=2*n-a;o=gi(l,a,e+1/3),s=gi(l,a,e),i=gi(l,a,e-1/3)}return{red:Math.round(o*255),green:Math.round(s*255),blue:Math.round(i*255),alpha:r}}function ns(e,t){return n=>n>0?t:e}const ye=(e,t,n)=>e+(t-e)*n,mi=(e,t,n)=>{const r=e*e,o=n*(t*t-r)+r;return o<0?0:Math.sqrt(o)},uM=[na,un,En],dM=e=>uM.find(t=>t.test(e));function Uu(e){const t=dM(e);if(Jn(!!t,`'${e}' is not an animatable color. Use the equivalent color code instead.`),!t)return!1;let n=t.parse(e);return t===En&&(n=cM(n)),n}const Gu=(e,t)=>{const n=Uu(e),r=Uu(t);if(!n||!r)return ns(e,t);const o={...n};return s=>(o.red=mi(n.red,r.red,s),o.green=mi(n.green,r.green,s),o.blue=mi(n.blue,r.blue,s),o.alpha=ye(n.alpha,r.alpha,s),un.transform(o))},ra=new Set(["none","hidden"]);function fM(e,t){return ra.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function hM(e,t){return n=>ye(e,t,n)}function Nl(e){return typeof e=="number"?hM:typeof e=="string"?_l(e)?ns:_e.test(e)?Gu:mM:Array.isArray(e)?sm:typeof e=="object"?_e.test(e)?Gu:pM:ns}function sm(e,t){const n=[...e],r=n.length,o=e.map((s,i)=>Nl(s)(s,t[i]));return s=>{for(let i=0;i<r;i++)n[i]=o[i](s);return n}}function pM(e,t){const n={...e,...t},r={};for(const o in n)e[o]!==void 0&&t[o]!==void 0&&(r[o]=Nl(e[o])(e[o],t[o]));return o=>{for(const s in r)n[s]=r[s](o);return n}}function gM(e,t){const n=[],r={color:0,var:0,number:0};for(let o=0;o<t.values.length;o++){const s=t.types[o],i=e.indexes[s][r[s]],a=e.values[i]??0;n[o]=a,r[s]++}return n}const mM=(e,t)=>{const n=Xt.createTransformer(t),r=Fr(e),o=Fr(t);return r.indexes.var.length===o.indexes.var.length&&r.indexes.color.length===o.indexes.color.length&&r.indexes.number.length>=o.indexes.number.length?ra.has(e)&&!o.values.length||ra.has(t)&&!r.values.length?fM(e,t):oo(sm(gM(r,o),o.values),n):(Jn(!0,`Complex values '${e}' and '${t}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`),ns(e,t))};function im(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?ye(e,t,n):Nl(e)(e,t)}const vM=e=>{const t=({timestamp:n})=>e(n);return{start:(n=!0)=>we.update(t,n),stop:()=>qt(t),now:()=>Pe.isProcessing?Pe.timestamp:Le.now()}},am=(e,t,n=10)=>{let r="";const o=Math.max(Math.round(t/n),2);for(let s=0;s<o;s++)r+=e(s/(o-1))+", ";return`linear(${r.substring(0,r.length-2)})`},rs=2e4;function jl(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<rs;)t+=n,r=e.next(t);return t>=rs?1/0:t}function yM(e,t=100,n){const r=n({...e,keyframes:[0,t]}),o=Math.min(jl(r),rs);return{type:"keyframes",ease:s=>r.next(o*s).value/t,duration:gt(o)}}const wM=5;function lm(e,t,n){const r=Math.max(t-wM,0);return Bg(n-e(r),t-r)}const ve={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},Ku=.001;function xM({duration:e=ve.duration,bounce:t=ve.bounce,velocity:n=ve.velocity,mass:r=ve.mass}){let o,s;Jn(e<=ot(ve.maxDuration),"Spring duration must be 10 seconds or less");let i=1-t;i=Pt(ve.minDamping,ve.maxDamping,i),e=Pt(ve.minDuration,ve.maxDuration,gt(e)),i<1?(o=c=>{const u=c*i,d=u*e,f=u-n,h=oa(c,i),m=Math.exp(-d);return Ku-f/h*m},s=c=>{const d=c*i*e,f=d*n+n,h=Math.pow(i,2)*Math.pow(c,2)*e,m=Math.exp(-d),p=oa(Math.pow(c,2),i);return(-o(c)+Ku>0?-1:1)*((f-h)*m)/p}):(o=c=>{const u=Math.exp(-c*e),d=(c-n)*e+1;return-.001+u*d},s=c=>{const u=Math.exp(-c*e),d=(n-c)*(e*e);return u*d});const a=5/e,l=SM(o,s,a);if(e=ot(e),isNaN(l))return{stiffness:ve.stiffness,damping:ve.damping,duration:e};{const c=Math.pow(l,2)*r;return{stiffness:c,damping:i*2*Math.sqrt(r*c),duration:e}}}const bM=12;function SM(e,t,n){let r=n;for(let o=1;o<bM;o++)r=r-e(r)/t(r);return r}function oa(e,t){return e*Math.sqrt(1-t*t)}const CM=["duration","bounce"],RM=["stiffness","damping","mass"];function Yu(e,t){return t.some(n=>e[n]!==void 0)}function DM(e){let t={velocity:ve.velocity,stiffness:ve.stiffness,damping:ve.damping,mass:ve.mass,isResolvedFromDuration:!1,...e};if(!Yu(e,RM)&&Yu(e,CM))if(e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),o=r*r,s=2*Pt(.05,1,1-(e.bounce||0))*Math.sqrt(o);t={...t,mass:ve.mass,stiffness:o,damping:s}}else{const n=xM(e);t={...t,...n,mass:ve.mass},t.isResolvedFromDuration=!0}return t}function os(e=ve.visualDuration,t=ve.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:o}=n;const s=n.keyframes[0],i=n.keyframes[n.keyframes.length-1],a={done:!1,value:s},{stiffness:l,damping:c,mass:u,duration:d,velocity:f,isResolvedFromDuration:h}=DM({...n,velocity:-gt(n.velocity||0)}),m=f||0,p=c/(2*Math.sqrt(l*u)),b=i-s,y=gt(Math.sqrt(l/u)),g=Math.abs(b)<5;r||(r=g?ve.restSpeed.granular:ve.restSpeed.default),o||(o=g?ve.restDelta.granular:ve.restDelta.default);let w;if(p<1){const x=oa(y,p);w=M=>{const S=Math.exp(-p*y*M);return i-S*((m+p*y*b)/x*Math.sin(x*M)+b*Math.cos(x*M))}}else if(p===1)w=x=>i-Math.exp(-y*x)*(b+(m+y*b)*x);else{const x=y*Math.sqrt(p*p-1);w=M=>{const S=Math.exp(-p*y*M),D=Math.min(x*M,300);return i-S*((m+p*y*b)*Math.sinh(D)+x*b*Math.cosh(D))/x}}const C={calculatedDuration:h&&d||null,next:x=>{const M=w(x);if(h)a.done=x>=d;else{let S=x===0?m:0;p<1&&(S=x===0?ot(m):lm(w,x,M));const D=Math.abs(S)<=r,P=Math.abs(i-M)<=o;a.done=D&&P}return a.value=a.done?i:M,a},toString:()=>{const x=Math.min(jl(C),rs),M=am(S=>C.next(x*S).value,x,30);return x+"ms "+M},toTransition:()=>{}};return C}os.applyToOptions=e=>{const t=yM(e,100,os);return e.ease=t.ease,e.duration=ot(t.duration),e.type="keyframes",e};function sa({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:o=10,bounceStiffness:s=500,modifyTarget:i,min:a,max:l,restDelta:c=.5,restSpeed:u}){const d=e[0],f={done:!1,value:d},h=D=>a!==void 0&&D<a||l!==void 0&&D>l,m=D=>a===void 0?l:l===void 0||Math.abs(a-D)<Math.abs(l-D)?a:l;let p=n*t;const b=d+p,y=i===void 0?b:i(b);y!==b&&(p=y-d);const g=D=>-p*Math.exp(-D/r),w=D=>y+g(D),C=D=>{const P=g(D),E=w(D);f.done=Math.abs(P)<=c,f.value=f.done?y:E};let x,M;const S=D=>{h(f.value)&&(x=D,M=os({keyframes:[f.value,m(f.value)],velocity:lm(w,D,f.value),damping:o,stiffness:s,restDelta:c,restSpeed:u}))};return S(0),{calculatedDuration:null,next:D=>{let P=!1;return!M&&x===void 0&&(P=!0,C(D),S(D)),x!==void 0&&D>=x?M.next(D-x):(!P&&C(D),f)}}}function TM(e,t,n){const r=[],o=n||At.mix||im,s=e.length-1;for(let i=0;i<s;i++){let a=o(e[i],e[i+1]);if(t){const l=Array.isArray(t)?t[i]||Qe:t;a=oo(l,a)}r.push(a)}return r}function MM(e,t,{clamp:n=!0,ease:r,mixer:o}={}){const s=e.length;if(Et(s===t.length,"Both input and output ranges must be the same length"),s===1)return()=>t[0];if(s===2&&t[0]===t[1])return()=>t[1];const i=e[0]===e[1];e[0]>e[s-1]&&(e=[...e].reverse(),t=[...t].reverse());const a=TM(t,r,o),l=a.length,c=u=>{if(i&&u<e[0])return t[0];let d=0;if(l>1)for(;d<e.length-2&&!(u<e[d+1]);d++);const f=Nr(e[d],e[d+1],u);return a[d](f)};return n?u=>c(Pt(e[0],e[s-1],u)):c}function PM(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const o=Nr(0,t,r);e.push(ye(n,1,o))}}function EM(e){const t=[0];return PM(t,e.length-1),t}function AM(e,t){return e.map(n=>n*t)}function OM(e,t){return e.map(()=>t||Xg).splice(0,e.length-1)}function An({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const o=HT(r)?r.map(Bu):Bu(r),s={done:!1,value:t[0]},i=AM(n&&n.length===t.length?n:EM(t),e),a=MM(i,t,{ease:Array.isArray(o)?o:OM(t,o)});return{calculatedDuration:e,next:l=>(s.value=a(l),s.done=l>=e,s)}}const _M=e=>e!==null;function Fl(e,{repeat:t,repeatType:n="loop"},r,o=1){const s=e.filter(_M),a=o<0||t&&n!=="loop"&&t%2===1?0:s.length-1;return!a||r===void 0?s[a]:r}const kM={decay:sa,inertia:sa,tween:An,keyframes:An,spring:os};function cm(e){typeof e.type=="string"&&(e.type=kM[e.type])}class Vl{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,n){return this.finished.then(t,n)}}const IM=e=>e/100;class Ll extends Vl{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=(n=!0)=>{var r,o;if(n){const{motionValue:s}=this.options;s&&s.updatedAt!==Le.now()&&this.tick(Le.now())}this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(o=(r=this.options).onStop)==null||o.call(r))},this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause()}initAnimation(){const{options:t}=this;cm(t);const{type:n=An,repeat:r=0,repeatDelay:o=0,repeatType:s,velocity:i=0}=t;let{keyframes:a}=t;const l=n||An;process.env.NODE_ENV!=="production"&&l!==An&&Et(a.length<=2,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${a}`),l!==An&&typeof a[0]!="number"&&(this.mixKeyframes=oo(IM,im(a[0],a[1])),a=[0,100]);const c=l({...t,keyframes:a});s==="mirror"&&(this.mirroredGenerator=l({...t,keyframes:[...a].reverse(),velocity:-i})),c.calculatedDuration===null&&(c.calculatedDuration=jl(c));const{calculatedDuration:u}=c;this.calculatedDuration=u,this.resolvedDuration=u+o,this.totalDuration=this.resolvedDuration*(r+1)-o,this.generator=c}updateTime(t){const n=Math.round(t-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(t,n=!1){const{generator:r,totalDuration:o,mixKeyframes:s,mirroredGenerator:i,resolvedDuration:a,calculatedDuration:l}=this;if(this.startTime===null)return r.next(0);const{delay:c=0,keyframes:u,repeat:d,repeatType:f,repeatDelay:h,type:m,onUpdate:p,finalKeyframe:b}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-o/this.speed,this.startTime)),n?this.currentTime=t:this.updateTime(t);const y=this.currentTime-c*(this.playbackSpeed>=0?1:-1),g=this.playbackSpeed>=0?y<0:y>o;this.currentTime=Math.max(y,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=o);let w=this.currentTime,C=r;if(d){const D=Math.min(this.currentTime,o)/a;let P=Math.floor(D),E=D%1;!E&&D>=1&&(E=1),E===1&&P--,P=Math.min(P,d+1),!!(P%2)&&(f==="reverse"?(E=1-E,h&&(E-=h/a)):f==="mirror"&&(C=i)),w=Pt(0,1,E)*a}const x=g?{done:!1,value:u[0]}:C.next(w);s&&(x.value=s(x.value));let{done:M}=x;!g&&l!==null&&(M=this.playbackSpeed>=0?this.currentTime>=o:this.currentTime<=0);const S=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&M);return S&&m!==sa&&(x.value=Fl(u,this.options,b,this.speed)),p&&p(x.value),S&&this.finish(),x}then(t,n){return this.finished.then(t,n)}get duration(){return gt(this.calculatedDuration)}get time(){return gt(this.currentTime)}set time(t){var n;t=ot(t),this.currentTime=t,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),(n=this.driver)==null||n.start(!1)}get speed(){return this.playbackSpeed}set speed(t){this.updateTime(Le.now());const n=this.playbackSpeed!==t;this.playbackSpeed=t,n&&(this.time=gt(this.currentTime))}play(){var o,s;if(this.isStopped)return;const{driver:t=vM,startTime:n}=this.options;this.driver||(this.driver=t(i=>this.tick(i))),(s=(o=this.options).onPlay)==null||s.call(o);const r=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=r):this.holdTime!==null?this.startTime=r-this.holdTime:this.startTime||(this.startTime=n??r),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(Le.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){var t,n;this.notifyFinished(),this.teardown(),this.state="finished",(n=(t=this.options).onComplete)==null||n.call(t)}cancel(){var t,n;this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),(n=(t=this.options).onCancel)==null||n.call(t)}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){var n;return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),(n=this.driver)==null||n.stop(),t.observe(this)}}function NM(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const dn=e=>e*180/Math.PI,ia=e=>{const t=dn(Math.atan2(e[1],e[0]));return aa(t)},jM={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:ia,rotateZ:ia,skewX:e=>dn(Math.atan(e[1])),skewY:e=>dn(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},aa=e=>(e=e%360,e<0&&(e+=360),e),qu=ia,Xu=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),Zu=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),FM={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Xu,scaleY:Zu,scale:e=>(Xu(e)+Zu(e))/2,rotateX:e=>aa(dn(Math.atan2(e[6],e[5]))),rotateY:e=>aa(dn(Math.atan2(-e[2],e[0]))),rotateZ:qu,rotate:qu,skewX:e=>dn(Math.atan(e[4])),skewY:e=>dn(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function la(e){return e.includes("scale")?1:0}function ca(e,t){if(!e||e==="none")return la(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,o;if(n)r=FM,o=n;else{const a=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=jM,o=a}if(!o)return la(t);const s=r[t],i=o[1].split(",").map(LM);return typeof s=="function"?s(i):i[s]}const VM=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return ca(n,t)};function LM(e){return parseFloat(e.trim())}const er=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],tr=new Set(er),Ju=e=>e===Qn||e===re,$M=new Set(["x","y","z"]),BM=er.filter(e=>!$M.has(e));function zM(e){const t=[];return BM.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const fn={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>ca(t,"x"),y:(e,{transform:t})=>ca(t,"y")};fn.translateX=fn.x;fn.translateY=fn.y;const hn=new Set;let ua=!1,da=!1,fa=!1;function um(){if(da){const e=Array.from(hn).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const o=zM(r);o.length&&(n.set(r,o),r.render())}),e.forEach(r=>r.measureInitialState()),t.forEach(r=>{r.render();const o=n.get(r);o&&o.forEach(([s,i])=>{var a;(a=r.getValue(s))==null||a.set(i)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}da=!1,ua=!1,hn.forEach(e=>e.complete(fa)),hn.clear()}function dm(){hn.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(da=!0)})}function HM(){fa=!0,dm(),um(),fa=!1}class $l{constructor(t,n,r,o,s,i=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=r,this.motionValue=o,this.element=s,this.isAsync=i}scheduleResolve(){this.state="scheduled",this.isAsync?(hn.add(this),ua||(ua=!0,we.read(dm),we.resolveKeyframes(um))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:r,motionValue:o}=this;if(t[0]===null){const s=o==null?void 0:o.get(),i=t[t.length-1];if(s!==void 0)t[0]=s;else if(r&&n){const a=r.readValue(n,i);a!=null&&(t[0]=a)}t[0]===void 0&&(t[0]=i),o&&s===void 0&&o.set(t[0])}NM(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),hn.delete(this)}cancel(){this.state==="scheduled"&&(hn.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const WM=e=>e.startsWith("--");function UM(e,t,n){WM(t)?e.style.setProperty(t,n):e.style[t]=n}const GM=Tl(()=>window.ScrollTimeline!==void 0),KM={};function YM(e,t){const n=Tl(e);return()=>KM[t]??n()}const fm=YM(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),wr=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,Qu={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:wr([0,.65,.55,1]),circOut:wr([.55,0,1,.45]),backIn:wr([.31,.01,.66,-.59]),backOut:wr([.33,1.53,.69,.99])};function hm(e,t){if(e)return typeof e=="function"?fm()?am(e,t):"ease-out":Zg(e)?wr(e):Array.isArray(e)?e.map(n=>hm(n,t)||Qu.easeOut):Qu[e]}function qM(e,t,n,{delay:r=0,duration:o=300,repeat:s=0,repeatType:i="loop",ease:a="easeOut",times:l}={},c=void 0){const u={[t]:n};l&&(u.offset=l);const d=hm(a,o);Array.isArray(d)&&(u.easing=d);const f={delay:r,duration:o,easing:Array.isArray(d)?"linear":d,fill:"both",iterations:s+1,direction:i==="reverse"?"alternate":"normal"};return c&&(f.pseudoElement=c),e.animate(u,f)}function pm(e){return typeof e=="function"&&"applyToOptions"in e}function XM({type:e,...t}){return pm(e)&&fm()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class ZM extends Vl{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,!t)return;const{element:n,name:r,keyframes:o,pseudoElement:s,allowFlatten:i=!1,finalKeyframe:a,onComplete:l}=t;this.isPseudoElement=!!s,this.allowFlatten=i,this.options=t,Et(typeof t.type!="string",`animateMini doesn't support "type" as a string. Did you mean to import { spring } from "motion"?`);const c=XM(t);this.animation=qM(n,r,o,c,s),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!s){const u=Fl(o,this.options,a,this.speed);this.updateMotionValue?this.updateMotionValue(u):UM(n,r,u),this.animation.cancel()}l==null||l(),this.notifyFinished()}}play(){this.isStopped||(this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){var t,n;(n=(t=this.animation).finish)==null||n.call(t)}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;t==="idle"||t==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){var t,n;this.isPseudoElement||(n=(t=this.animation).commitStyles)==null||n.call(t)}get duration(){var n,r;const t=((r=(n=this.animation.effect)==null?void 0:n.getComputedTiming)==null?void 0:r.call(n).duration)||0;return gt(Number(t))}get time(){return gt(Number(this.animation.currentTime)||0)}set time(t){this.finishedTime=null,this.animation.currentTime=ot(t)}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return Number(this.animation.startTime)}set startTime(t){this.animation.startTime=t}attachTimeline({timeline:t,observe:n}){var r;return this.allowFlatten&&((r=this.animation.effect)==null||r.updateTiming({easing:"linear"})),this.animation.onfinish=null,t&&GM()?(this.animation.timeline=t,Qe):n(this)}}const gm={anticipate:Kg,backInOut:Gg,circInOut:qg};function JM(e){return e in gm}function QM(e){typeof e.ease=="string"&&JM(e.ease)&&(e.ease=gm[e.ease])}const ed=10;class eP extends ZM{constructor(t){QM(t),cm(t),super(t),t.startTime&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:n,onUpdate:r,onComplete:o,element:s,...i}=this.options;if(!n)return;if(t!==void 0){n.set(t);return}const a=new Ll({...i,autoplay:!1}),l=ot(this.finishedTime??this.time);n.setWithVelocity(a.sample(l-ed).value,a.sample(l).value,ed),a.stop()}}const td=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(Xt.test(e)||e==="0")&&!e.startsWith("url("));function tP(e){const t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function nP(e,t,n,r){const o=e[0];if(o===null)return!1;if(t==="display"||t==="visibility")return!0;const s=e[e.length-1],i=td(o,t),a=td(s,t);return Jn(i===a,`You are trying to animate ${t} from "${o}" to "${s}". ${o} is not an animatable value - to enable this animation set ${o} to a value animatable to ${s} via the \`style\` property.`),!i||!a?!1:tP(e)||(n==="spring"||pm(n))&&r}function mm(e){return Lg(e)&&"offsetHeight"in e}const rP=new Set(["opacity","clipPath","filter","transform"]),oP=Tl(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function sP(e){var c;const{motionValue:t,name:n,repeatDelay:r,repeatType:o,damping:s,type:i}=e;if(!mm((c=t==null?void 0:t.owner)==null?void 0:c.current))return!1;const{onUpdate:a,transformTemplate:l}=t.owner.getProps();return oP()&&n&&rP.has(n)&&(n!=="transform"||!l)&&!a&&!r&&o!=="mirror"&&s!==0&&i!=="inertia"}const iP=40;class aP extends Vl{constructor({autoplay:t=!0,delay:n=0,type:r="keyframes",repeat:o=0,repeatDelay:s=0,repeatType:i="loop",keyframes:a,name:l,motionValue:c,element:u,...d}){var m;super(),this.stop=()=>{var p,b;this._animation&&(this._animation.stop(),(p=this.stopTimeline)==null||p.call(this)),(b=this.keyframeResolver)==null||b.cancel()},this.createdAt=Le.now();const f={autoplay:t,delay:n,type:r,repeat:o,repeatDelay:s,repeatType:i,name:l,motionValue:c,element:u,...d},h=(u==null?void 0:u.KeyframeResolver)||$l;this.keyframeResolver=new h(a,(p,b,y)=>this.onKeyframesResolved(p,b,f,!y),l,c,u),(m=this.keyframeResolver)==null||m.scheduleResolve()}onKeyframesResolved(t,n,r,o){this.keyframeResolver=void 0;const{name:s,type:i,velocity:a,delay:l,isHandoff:c,onUpdate:u}=r;this.resolvedAt=Le.now(),nP(t,s,i,a)||((At.instantAnimations||!l)&&(u==null||u(Fl(t,r,n))),t[0]=t[t.length-1],r.duration=0,r.repeat=0);const f={startTime:o?this.resolvedAt?this.resolvedAt-this.createdAt>iP?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...r,keyframes:t},h=!c&&sP(f)?new eP({...f,element:f.motionValue.owner.current}):new Ll(f);h.finished.then(()=>this.notifyFinished()).catch(Qe),this.pendingTimeline&&(this.stopTimeline=h.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=h}get finished(){return this._animation?this.animation.finished:this._finished}then(t,n){return this.finished.finally(t).then(()=>{})}get animation(){var t;return this._animation||((t=this.keyframeResolver)==null||t.resume(),HM()),this._animation}get duration(){return this.animation.duration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){var t;this._animation&&this.animation.cancel(),(t=this.keyframeResolver)==null||t.cancel()}}const lP=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function cP(e){const t=lP.exec(e);if(!t)return[,];const[,n,r,o]=t;return[`--${n??r}`,o]}const uP=4;function vm(e,t,n=1){Et(n<=uP,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`);const[r,o]=cP(e);if(!r)return;const s=window.getComputedStyle(t).getPropertyValue(r);if(s){const i=s.trim();return Vg(i)?parseFloat(i):i}return _l(o)?vm(o,t,n+1):o}function Bl(e,t){return(e==null?void 0:e[t])??(e==null?void 0:e.default)??e}const ym=new Set(["width","height","top","left","right","bottom",...er]),dP={test:e=>e==="auto",parse:e=>e},wm=e=>t=>t.test(e),xm=[Qn,re,mt,Bt,tM,eM,dP],nd=e=>xm.find(wm(e));function fP(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||$g(e):!0}const hP=new Set(["brightness","contrast","saturate","opacity"]);function pP(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(kl)||[];if(!r)return e;const o=n.replace(r,"");let s=hP.has(t)?1:0;return r!==n&&(s*=100),t+"("+s+o+")"}const gP=/\b([a-z-]*)\(.*?\)/gu,ha={...Xt,getAnimatableNone:e=>{const t=e.match(gP);return t?t.map(pP).join(" "):e}},rd={...Qn,transform:Math.round},mP={rotate:Bt,rotateX:Bt,rotateY:Bt,rotateZ:Bt,scale:Do,scaleX:Do,scaleY:Do,scaleZ:Do,skew:Bt,skewX:Bt,skewY:Bt,distance:re,translateX:re,translateY:re,translateZ:re,x:re,y:re,z:re,perspective:re,transformPerspective:re,opacity:jr,originX:Hu,originY:Hu,originZ:re},zl={borderWidth:re,borderTopWidth:re,borderRightWidth:re,borderBottomWidth:re,borderLeftWidth:re,borderRadius:re,radius:re,borderTopLeftRadius:re,borderTopRightRadius:re,borderBottomRightRadius:re,borderBottomLeftRadius:re,width:re,maxWidth:re,height:re,maxHeight:re,top:re,right:re,bottom:re,left:re,padding:re,paddingTop:re,paddingRight:re,paddingBottom:re,paddingLeft:re,margin:re,marginTop:re,marginRight:re,marginBottom:re,marginLeft:re,backgroundPositionX:re,backgroundPositionY:re,...mP,zIndex:rd,fillOpacity:jr,strokeOpacity:jr,numOctaves:rd},vP={...zl,color:_e,backgroundColor:_e,outlineColor:_e,fill:_e,stroke:_e,borderColor:_e,borderTopColor:_e,borderRightColor:_e,borderBottomColor:_e,borderLeftColor:_e,filter:ha,WebkitFilter:ha},bm=e=>vP[e];function Sm(e,t){let n=bm(e);return n!==ha&&(n=Xt),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const yP=new Set(["auto","none","0"]);function wP(e,t,n){let r=0,o;for(;r<e.length&&!o;){const s=e[r];typeof s=="string"&&!yP.has(s)&&Fr(s).values.length&&(o=e[r]),r++}if(o&&n)for(const s of t)e[s]=Sm(n,o)}class xP extends $l{constructor(t,n,r,o,s){super(t,n,r,o,s,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let l=0;l<t.length;l++){let c=t[l];if(typeof c=="string"&&(c=c.trim(),_l(c))){const u=vm(c,n.current);u!==void 0&&(t[l]=u),l===t.length-1&&(this.finalKeyframe=c)}}if(this.resolveNoneKeyframes(),!ym.has(r)||t.length!==2)return;const[o,s]=t,i=nd(o),a=nd(s);if(i!==a)if(Ju(i)&&Ju(a))for(let l=0;l<t.length;l++){const c=t[l];typeof c=="string"&&(t[l]=parseFloat(c))}else fn[r]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,r=[];for(let o=0;o<t.length;o++)(t[o]===null||fP(t[o]))&&r.push(o);r.length&&wP(t,r,n)}measureInitialState(){const{element:t,unresolvedKeyframes:n,name:r}=this;if(!t||!t.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=fn[r](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const o=n[n.length-1];o!==void 0&&t.getValue(r,o).jump(o,!1)}measureEndState(){var a;const{element:t,name:n,unresolvedKeyframes:r}=this;if(!t||!t.current)return;const o=t.getValue(n);o&&o.jump(this.measuredOrigin,!1);const s=r.length-1,i=r[s];r[s]=fn[n](t.measureViewportBox(),window.getComputedStyle(t.current)),i!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=i),(a=this.removedTransforms)!=null&&a.length&&this.removedTransforms.forEach(([l,c])=>{t.getValue(l).set(c)}),this.resolveNoneKeyframes()}}function bP(e,t,n){if(e instanceof EventTarget)return[e];if(typeof e=="string"){let r=document;const o=(n==null?void 0:n[e])??r.querySelectorAll(e);return o?Array.from(o):[]}return Array.from(e)}const od=30,SP=e=>!isNaN(parseFloat(e));class CP{constructor(t,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=(r,o=!0)=>{var i,a;const s=Le.now();if(this.updatedAt!==s&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&((i=this.events.change)==null||i.notify(this.current),this.dependents))for(const l of this.dependents)l.dirty();o&&((a=this.events.renderRequest)==null||a.notify(this.current))},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=Le.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=SP(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return process.env.NODE_ENV!=="production"&&Pl(!1,'value.onChange(callback) is deprecated. Switch to value.on("change", callback).'),this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new Ml);const r=this.events[t].add(n);return t==="change"?()=>{r(),we.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t,n=!0){!n||!this.passiveEffect?this.updateAndNotify(t,n):this.passiveEffect(t,this.updateAndNotify)}setWithVelocity(t,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-r}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){var t;(t=this.events.change)==null||t.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=Le.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>od)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,od);return Bg(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){var t,n;(t=this.dependents)==null||t.clear(),(n=this.events.destroy)==null||n.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function zn(e,t){return new CP(e,t)}const Cm=(e,t)=>t&&typeof e=="number"?t.transform(e):e,{schedule:Hl}=Jg(queueMicrotask,!1),rt={x:!1,y:!1};function Rm(){return rt.x||rt.y}function RP(e){return e==="x"||e==="y"?rt[e]?null:(rt[e]=!0,()=>{rt[e]=!1}):rt.x||rt.y?null:(rt.x=rt.y=!0,()=>{rt.x=rt.y=!1})}function Dm(e,t){const n=bP(e),r=new AbortController,o={passive:!0,...t,signal:r.signal};return[n,o,()=>r.abort()]}function sd(e){return!(e.pointerType==="touch"||Rm())}function DP(e,t,n={}){const[r,o,s]=Dm(e,n),i=a=>{if(!sd(a))return;const{target:l}=a,c=t(l,a);if(typeof c!="function"||!l)return;const u=d=>{sd(d)&&(c(d),l.removeEventListener("pointerleave",u))};l.addEventListener("pointerleave",u,o)};return r.forEach(a=>{a.addEventListener("pointerenter",i,o)}),s}const Tm=(e,t)=>t?e===t?!0:Tm(e,t.parentElement):!1,Wl=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,TP=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function MP(e){return TP.has(e.tagName)||e.tabIndex!==-1}const Fo=new WeakSet;function id(e){return t=>{t.key==="Enter"&&e(t)}}function vi(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const PP=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=id(()=>{if(Fo.has(n))return;vi(n,"down");const o=id(()=>{vi(n,"up")}),s=()=>vi(n,"cancel");n.addEventListener("keyup",o,t),n.addEventListener("blur",s,t)});n.addEventListener("keydown",r,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),t)};function ad(e){return Wl(e)&&!Rm()}function EP(e,t,n={}){const[r,o,s]=Dm(e,n),i=a=>{const l=a.currentTarget;if(!ad(a))return;Fo.add(l);const c=t(l,a),u=(h,m)=>{window.removeEventListener("pointerup",d),window.removeEventListener("pointercancel",f),Fo.has(l)&&Fo.delete(l),ad(h)&&typeof c=="function"&&c(h,{success:m})},d=h=>{u(h,l===window||l===document||n.useGlobalTarget||Tm(l,h.target))},f=h=>{u(h,!1)};window.addEventListener("pointerup",d,o),window.addEventListener("pointercancel",f,o)};return r.forEach(a=>{(n.useGlobalTarget?window:a).addEventListener("pointerdown",i,o),mm(a)&&(a.addEventListener("focus",c=>PP(c,o)),!MP(a)&&!a.hasAttribute("tabindex")&&(a.tabIndex=0))}),s}function Mm(e){return Lg(e)&&"ownerSVGElement"in e}function AP(e){return Mm(e)&&e.tagName==="svg"}const ke=e=>!!(e&&e.getVelocity),OP=[...xm,_e,Xt],_P=e=>OP.find(wm(e)),Pm=T.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function kP(e=!0){const t=T.useContext(Cl);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:o}=t,s=T.useId();T.useEffect(()=>{if(e)return o(s)},[e]);const i=T.useCallback(()=>e&&r&&r(s),[s,r,e]);return!n&&r?[!1,i]:[!0]}const Em=T.createContext({strict:!1}),ld={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},Hn={};for(const e in ld)Hn[e]={isEnabled:t=>ld[e].some(n=>!!t[n])};function IP(e){for(const t in e)Hn[t]={...Hn[t],...e[t]}}const NP=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function ss(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||NP.has(e)}let Am=e=>!ss(e);function jP(e){e&&(Am=t=>t.startsWith("on")?!ss(t):e(t))}try{jP(require("@emotion/is-prop-valid").default)}catch{}function FP(e,t,n){const r={};for(const o in e)o==="values"&&typeof e.values=="object"||(Am(o)||n===!0&&ss(o)||!t&&!ss(o)||e.draggable&&o.startsWith("onDrag"))&&(r[o]=e[o]);return r}function VP(e){if(typeof Proxy>"u")return e;const t=new Map,n=(...r)=>(process.env.NODE_ENV!=="production"&&Pl(!1,"motion() is deprecated. Use motion.create() instead."),e(...r));return new Proxy(n,{get:(r,o)=>o==="create"?e:(t.has(o)||t.set(o,e(o)),t.get(o))})}const Ns=T.createContext({});function js(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function Vr(e){return typeof e=="string"||Array.isArray(e)}const Ul=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Gl=["initial",...Ul];function Fs(e){return js(e.animate)||Gl.some(t=>Vr(e[t]))}function Om(e){return!!(Fs(e)||e.variants)}function LP(e,t){if(Fs(e)){const{initial:n,animate:r}=e;return{initial:n===!1||Vr(n)?n:void 0,animate:Vr(r)?r:void 0}}return e.inherit!==!1?t:{}}function $P(e){const{initial:t,animate:n}=LP(e,T.useContext(Ns));return T.useMemo(()=>({initial:t,animate:n}),[cd(t),cd(n)])}function cd(e){return Array.isArray(e)?e.join(" "):e}const BP=Symbol.for("motionComponentSymbol");function On(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function zP(e,t,n){return T.useCallback(r=>{r&&e.onMount&&e.onMount(r),t&&(r?t.mount(r):t.unmount()),n&&(typeof n=="function"?n(r):On(n)&&(n.current=r))},[t])}const Kl=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),HP="framerAppearId",_m="data-"+Kl(HP),km=T.createContext({});function WP(e,t,n,r,o){var p,b;const{visualElement:s}=T.useContext(Ns),i=T.useContext(Em),a=T.useContext(Cl),l=T.useContext(Pm).reducedMotion,c=T.useRef(null);r=r||i.renderer,!c.current&&r&&(c.current=r(e,{visualState:t,parent:s,props:n,presenceContext:a,blockInitialAnimation:a?a.initial===!1:!1,reducedMotionConfig:l}));const u=c.current,d=T.useContext(km);u&&!u.projection&&o&&(u.type==="html"||u.type==="svg")&&UP(c.current,n,o,d);const f=T.useRef(!1);T.useInsertionEffect(()=>{u&&f.current&&u.update(n,a)});const h=n[_m],m=T.useRef(!!h&&!((p=window.MotionHandoffIsComplete)!=null&&p.call(window,h))&&((b=window.MotionHasOptimisedAnimation)==null?void 0:b.call(window,h)));return jT(()=>{u&&(f.current=!0,window.MotionIsMounted=!0,u.updateFeatures(),Hl.render(u.render),m.current&&u.animationState&&u.animationState.animateChanges())}),T.useEffect(()=>{u&&(!m.current&&u.animationState&&u.animationState.animateChanges(),m.current&&(queueMicrotask(()=>{var y;(y=window.MotionHandoffMarkAsComplete)==null||y.call(window,h)}),m.current=!1))}),u}function UP(e,t,n,r){const{layoutId:o,layout:s,drag:i,dragConstraints:a,layoutScroll:l,layoutRoot:c,layoutCrossfade:u}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:Im(e.parent)),e.projection.setOptions({layoutId:o,layout:s,alwaysMeasureLayout:!!i||a&&On(a),visualElement:e,animationType:typeof s=="string"?s:"both",initialPromotionConfig:r,crossfade:u,layoutScroll:l,layoutRoot:c})}function Im(e){if(e)return e.options.allowProjection!==!1?e.projection:Im(e.parent)}function GP({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:r,Component:o}){e&&IP(e);function s(a,l){let c;const u={...T.useContext(Pm),...a,layoutId:KP(a)},{isStatic:d}=u,f=$P(a),h=r(a,d);if(!d&&Sl){YP(u,e);const m=qP(u);c=m.MeasureLayout,f.visualElement=WP(o,h,u,t,m.ProjectionNode)}return v.jsxs(Ns.Provider,{value:f,children:[c&&f.visualElement?v.jsx(c,{visualElement:f.visualElement,...u}):null,n(o,a,zP(h,f.visualElement,l),h,d,f.visualElement)]})}s.displayName=`motion.${typeof o=="string"?o:`create(${o.displayName??o.name??""})`}`;const i=T.forwardRef(s);return i[BP]=o,i}function KP({layoutId:e}){const t=T.useContext(Fg).id;return t&&e!==void 0?t+"-"+e:e}function YP(e,t){const n=T.useContext(Em).strict;if(process.env.NODE_ENV!=="production"&&t&&n){const r="You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.";e.ignoreStrict?Jn(!1,r):Et(!1,r)}}function qP(e){const{drag:t,layout:n}=Hn;if(!t&&!n)return{};const r={...t,...n};return{MeasureLayout:t!=null&&t.isEnabled(e)||n!=null&&n.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}const Lr={};function XP(e){for(const t in e)Lr[t]=e[t],Ol(t)&&(Lr[t].isCSSVariable=!0)}function Nm(e,{layout:t,layoutId:n}){return tr.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!Lr[e]||e==="opacity")}const ZP={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},JP=er.length;function QP(e,t,n){let r="",o=!0;for(let s=0;s<JP;s++){const i=er[s],a=e[i];if(a===void 0)continue;let l=!0;if(typeof a=="number"?l=a===(i.startsWith("scale")?1:0):l=parseFloat(a)===0,!l||n){const c=Cm(a,zl[i]);if(!l){o=!1;const u=ZP[i]||i;r+=`${u}(${c}) `}n&&(t[i]=c)}}return r=r.trim(),n?r=n(t,o?"":r):o&&(r="none"),r}function Yl(e,t,n){const{style:r,vars:o,transformOrigin:s}=e;let i=!1,a=!1;for(const l in t){const c=t[l];if(tr.has(l)){i=!0;continue}else if(Ol(l)){o[l]=c;continue}else{const u=Cm(c,zl[l]);l.startsWith("origin")?(a=!0,s[l]=u):r[l]=u}}if(t.transform||(i||n?r.transform=QP(t,e.transform,n):r.transform&&(r.transform="none")),a){const{originX:l="50%",originY:c="50%",originZ:u=0}=s;r.transformOrigin=`${l} ${c} ${u}`}}const ql=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function jm(e,t,n){for(const r in t)!ke(t[r])&&!Nm(r,n)&&(e[r]=t[r])}function eE({transformTemplate:e},t){return T.useMemo(()=>{const n=ql();return Yl(n,t,e),Object.assign({},n.vars,n.style)},[t])}function tE(e,t){const n=e.style||{},r={};return jm(r,n,e),Object.assign(r,eE(e,t)),r}function nE(e,t){const n={},r=tE(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}const rE={offset:"stroke-dashoffset",array:"stroke-dasharray"},oE={offset:"strokeDashoffset",array:"strokeDasharray"};function sE(e,t,n=1,r=0,o=!0){e.pathLength=1;const s=o?rE:oE;e[s.offset]=re.transform(-r);const i=re.transform(t),a=re.transform(n);e[s.array]=`${i} ${a}`}function Fm(e,{attrX:t,attrY:n,attrScale:r,pathLength:o,pathSpacing:s=1,pathOffset:i=0,...a},l,c,u){if(Yl(e,a,c),l){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:d,style:f}=e;d.transform&&(f.transform=d.transform,delete d.transform),(f.transform||d.transformOrigin)&&(f.transformOrigin=d.transformOrigin??"50% 50%",delete d.transformOrigin),f.transform&&(f.transformBox=(u==null?void 0:u.transformBox)??"fill-box",delete d.transformBox),t!==void 0&&(d.x=t),n!==void 0&&(d.y=n),r!==void 0&&(d.scale=r),o!==void 0&&sE(d,o,s,i,!1)}const Vm=()=>({...ql(),attrs:{}}),Lm=e=>typeof e=="string"&&e.toLowerCase()==="svg";function iE(e,t,n,r){const o=T.useMemo(()=>{const s=Vm();return Fm(s,t,Lm(r),e.transformTemplate,e.style),{...s.attrs,style:{...s.style}}},[t]);if(e.style){const s={};jm(s,e.style,e),o.style={...s,...o.style}}return o}const aE=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function Xl(e){return typeof e!="string"||e.includes("-")?!1:!!(aE.indexOf(e)>-1||/[A-Z]/u.test(e))}function lE(e=!1){return(n,r,o,{latestValues:s},i)=>{const l=(Xl(n)?iE:nE)(r,s,i,n),c=FP(r,typeof n=="string",e),u=n!==T.Fragment?{...c,...l,ref:o}:{},{children:d}=r,f=T.useMemo(()=>ke(d)?d.get():d,[d]);return T.createElement(n,{...u,children:f})}}function ud(e){const t=[{},{}];return e==null||e.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function Zl(e,t,n,r){if(typeof t=="function"){const[o,s]=ud(r);t=t(n!==void 0?n:e.custom,o,s)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[o,s]=ud(r);t=t(n!==void 0?n:e.custom,o,s)}return t}function Vo(e){return ke(e)?e.get():e}function cE({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,o){return{latestValues:uE(n,r,o,e),renderState:t()}}const $m=e=>(t,n)=>{const r=T.useContext(Ns),o=T.useContext(Cl),s=()=>cE(e,t,r,o);return n?s():NT(s)};function uE(e,t,n,r){const o={},s=r(e,{});for(const f in s)o[f]=Vo(s[f]);let{initial:i,animate:a}=e;const l=Fs(e),c=Om(e);t&&c&&!l&&e.inherit!==!1&&(i===void 0&&(i=t.initial),a===void 0&&(a=t.animate));let u=n?n.initial===!1:!1;u=u||i===!1;const d=u?a:i;if(d&&typeof d!="boolean"&&!js(d)){const f=Array.isArray(d)?d:[d];for(let h=0;h<f.length;h++){const m=Zl(e,f[h]);if(m){const{transitionEnd:p,transition:b,...y}=m;for(const g in y){let w=y[g];if(Array.isArray(w)){const C=u?w.length-1:0;w=w[C]}w!==null&&(o[g]=w)}for(const g in p)o[g]=p[g]}}}return o}function Jl(e,t,n){var s;const{style:r}=e,o={};for(const i in r)(ke(r[i])||t.style&&ke(t.style[i])||Nm(i,e)||((s=n==null?void 0:n.getValue(i))==null?void 0:s.liveStyle)!==void 0)&&(o[i]=r[i]);return o}const dE={useVisualState:$m({scrapeMotionValuesFromProps:Jl,createRenderState:ql})};function Bm(e,t,n){const r=Jl(e,t,n);for(const o in e)if(ke(e[o])||ke(t[o])){const s=er.indexOf(o)!==-1?"attr"+o.charAt(0).toUpperCase()+o.substring(1):o;r[s]=e[o]}return r}const fE={useVisualState:$m({scrapeMotionValuesFromProps:Bm,createRenderState:Vm})};function hE(e,t){return function(r,{forwardMotionProps:o}={forwardMotionProps:!1}){const i={...Xl(r)?fE:dE,preloadedFeatures:e,useRender:lE(o),createVisualElement:t,Component:r};return GP(i)}}function $r(e,t,n){const r=e.getProps();return Zl(r,t,n!==void 0?n:r.custom,e)}const pa=e=>Array.isArray(e);function pE(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,zn(n))}function gE(e){return pa(e)?e[e.length-1]||0:e}function mE(e,t){const n=$r(e,t);let{transitionEnd:r={},transition:o={},...s}=n||{};s={...s,...r};for(const i in s){const a=gE(s[i]);pE(e,i,a)}}function vE(e){return!!(ke(e)&&e.add)}function ga(e,t){const n=e.getValue("willChange");if(vE(n))return n.add(t);if(!n&&At.WillChange){const r=new At.WillChange("auto");e.addValue("willChange",r),r.add(t)}}function zm(e){return e.props[_m]}const yE=e=>e!==null;function wE(e,{repeat:t,repeatType:n="loop"},r){const o=e.filter(yE),s=t&&n!=="loop"&&t%2===1?0:o.length-1;return o[s]}const xE={type:"spring",stiffness:500,damping:25,restSpeed:10},bE=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),SE={type:"keyframes",duration:.8},CE={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},RE=(e,{keyframes:t})=>t.length>2?SE:tr.has(e)?e.startsWith("scale")?bE(t[1]):xE:CE;function DE({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:o,repeat:s,repeatType:i,repeatDelay:a,from:l,elapsed:c,...u}){return!!Object.keys(u).length}const Ql=(e,t,n,r={},o,s)=>i=>{const a=Bl(r,e)||{},l=a.delay||r.delay||0;let{elapsed:c=0}=r;c=c-ot(l);const u={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...a,delay:-c,onUpdate:f=>{t.set(f),a.onUpdate&&a.onUpdate(f)},onComplete:()=>{i(),a.onComplete&&a.onComplete()},name:e,motionValue:t,element:s?void 0:o};DE(a)||Object.assign(u,RE(e,u)),u.duration&&(u.duration=ot(u.duration)),u.repeatDelay&&(u.repeatDelay=ot(u.repeatDelay)),u.from!==void 0&&(u.keyframes[0]=u.from);let d=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(u.duration=0,u.delay===0&&(d=!0)),(At.instantAnimations||At.skipAnimations)&&(d=!0,u.duration=0,u.delay=0),u.allowFlatten=!a.type&&!a.ease,d&&!s&&t.get()!==void 0){const f=wE(u.keyframes,a);if(f!==void 0){we.update(()=>{u.onUpdate(f),u.onComplete()});return}}return a.isSync?new Ll(u):new aP(u)};function TE({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function Hm(e,t,{delay:n=0,transitionOverride:r,type:o}={}){let{transition:s=e.getDefaultTransition(),transitionEnd:i,...a}=t;r&&(s=r);const l=[],c=o&&e.animationState&&e.animationState.getState()[o];for(const u in a){const d=e.getValue(u,e.latestValues[u]??null),f=a[u];if(f===void 0||c&&TE(c,u))continue;const h={delay:n,...Bl(s||{},u)},m=d.get();if(m!==void 0&&!d.isAnimating&&!Array.isArray(f)&&f===m&&!h.velocity)continue;let p=!1;if(window.MotionHandoffAnimation){const y=zm(e);if(y){const g=window.MotionHandoffAnimation(y,u,we);g!==null&&(h.startTime=g,p=!0)}}ga(e,u),d.start(Ql(u,d,f,e.shouldReduceMotion&&ym.has(u)?{type:!1}:h,e,p));const b=d.animation;b&&l.push(b)}return i&&Promise.all(l).then(()=>{we.update(()=>{i&&mE(e,i)})}),l}function ma(e,t,n={}){var l;const r=$r(e,t,n.type==="exit"?(l=e.presenceContext)==null?void 0:l.custom:void 0);let{transition:o=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(o=n.transitionOverride);const s=r?()=>Promise.all(Hm(e,r,n)):()=>Promise.resolve(),i=e.variantChildren&&e.variantChildren.size?(c=0)=>{const{delayChildren:u=0,staggerChildren:d,staggerDirection:f}=o;return ME(e,t,u+c,d,f,n)}:()=>Promise.resolve(),{when:a}=o;if(a){const[c,u]=a==="beforeChildren"?[s,i]:[i,s];return c().then(()=>u())}else return Promise.all([s(),i(n.delay)])}function ME(e,t,n=0,r=0,o=1,s){const i=[],a=(e.variantChildren.size-1)*r,l=o===1?(c=0)=>c*r:(c=0)=>a-c*r;return Array.from(e.variantChildren).sort(PE).forEach((c,u)=>{c.notify("AnimationStart",t),i.push(ma(c,t,{...s,delay:n+l(u)}).then(()=>c.notify("AnimationComplete",t)))}),Promise.all(i)}function PE(e,t){return e.sortNodePosition(t)}function EE(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const o=t.map(s=>ma(e,s,n));r=Promise.all(o)}else if(typeof t=="string")r=ma(e,t,n);else{const o=typeof t=="function"?$r(e,t,n.custom):t;r=Promise.all(Hm(e,o,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}function Wm(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}const AE=Gl.length;function Um(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?Um(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<AE;n++){const r=Gl[n],o=e.props[r];(Vr(o)||o===!1)&&(t[r]=o)}return t}const OE=[...Ul].reverse(),_E=Ul.length;function kE(e){return t=>Promise.all(t.map(({animation:n,options:r})=>EE(e,n,r)))}function IE(e){let t=kE(e),n=dd(),r=!0;const o=l=>(c,u)=>{var f;const d=$r(e,u,l==="exit"?(f=e.presenceContext)==null?void 0:f.custom:void 0);if(d){const{transition:h,transitionEnd:m,...p}=d;c={...c,...p,...m}}return c};function s(l){t=l(e)}function i(l){const{props:c}=e,u=Um(e.parent)||{},d=[],f=new Set;let h={},m=1/0;for(let b=0;b<_E;b++){const y=OE[b],g=n[y],w=c[y]!==void 0?c[y]:u[y],C=Vr(w),x=y===l?g.isActive:null;x===!1&&(m=b);let M=w===u[y]&&w!==c[y]&&C;if(M&&r&&e.manuallyAnimateOnMount&&(M=!1),g.protectedKeys={...h},!g.isActive&&x===null||!w&&!g.prevProp||js(w)||typeof w=="boolean")continue;const S=NE(g.prevProp,w);let D=S||y===l&&g.isActive&&!M&&C||b>m&&C,P=!1;const E=Array.isArray(w)?w:[w];let A=E.reduce(o(y),{});x===!1&&(A={});const{prevResolvedValues:F={}}=g,W={...F,...A},L=N=>{D=!0,f.has(N)&&(P=!0,f.delete(N)),g.needsAnimating[N]=!0;const O=e.getValue(N);O&&(O.liveStyle=!1)};for(const N in W){const O=A[N],V=F[N];if(h.hasOwnProperty(N))continue;let k=!1;pa(O)&&pa(V)?k=!Wm(O,V):k=O!==V,k?O!=null?L(N):f.add(N):O!==void 0&&f.has(N)?L(N):g.protectedKeys[N]=!0}g.prevProp=w,g.prevResolvedValues=A,g.isActive&&(h={...h,...A}),r&&e.blockInitialAnimation&&(D=!1),D&&(!(M&&S)||P)&&d.push(...E.map(N=>({animation:N,options:{type:y}})))}if(f.size){const b={};if(typeof c.initial!="boolean"){const y=$r(e,Array.isArray(c.initial)?c.initial[0]:c.initial);y&&y.transition&&(b.transition=y.transition)}f.forEach(y=>{const g=e.getBaseTarget(y),w=e.getValue(y);w&&(w.liveStyle=!0),b[y]=g??null}),d.push({animation:b})}let p=!!d.length;return r&&(c.initial===!1||c.initial===c.animate)&&!e.manuallyAnimateOnMount&&(p=!1),r=!1,p?t(d):Promise.resolve()}function a(l,c){var d;if(n[l].isActive===c)return Promise.resolve();(d=e.variantChildren)==null||d.forEach(f=>{var h;return(h=f.animationState)==null?void 0:h.setActive(l,c)}),n[l].isActive=c;const u=i(l);for(const f in n)n[f].protectedKeys={};return u}return{animateChanges:i,setActive:a,setAnimateFunction:s,getState:()=>n,reset:()=>{n=dd(),r=!0}}}function NE(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!Wm(t,e):!1}function ln(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function dd(){return{animate:ln(!0),whileInView:ln(),whileHover:ln(),whileTap:ln(),whileDrag:ln(),whileFocus:ln(),exit:ln()}}class on{constructor(t){this.isMounted=!1,this.node=t}update(){}}class jE extends on{constructor(t){super(t),t.animationState||(t.animationState=IE(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();js(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)==null||t.call(this)}}let FE=0;class VE extends on{constructor(){super(...arguments),this.id=FE++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===r)return;const o=this.node.animationState.setActive("exit",!t);n&&!t&&o.then(()=>{n(this.id)})}mount(){const{register:t,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const LE={animation:{Feature:jE},exit:{Feature:VE}};function Br(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function ao(e){return{point:{x:e.pageX,y:e.pageY}}}const $E=e=>t=>Wl(t)&&e(t,ao(t));function Rr(e,t,n,r){return Br(e,t,$E(n),r)}function Gm({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function BE({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function zE(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}const Km=1e-4,HE=1-Km,WE=1+Km,Ym=.01,UE=0-Ym,GE=0+Ym;function Ne(e){return e.max-e.min}function KE(e,t,n){return Math.abs(e-t)<=n}function fd(e,t,n,r=.5){e.origin=r,e.originPoint=ye(t.min,t.max,e.origin),e.scale=Ne(n)/Ne(t),e.translate=ye(n.min,n.max,e.origin)-e.originPoint,(e.scale>=HE&&e.scale<=WE||isNaN(e.scale))&&(e.scale=1),(e.translate>=UE&&e.translate<=GE||isNaN(e.translate))&&(e.translate=0)}function Dr(e,t,n,r){fd(e.x,t.x,n.x,r?r.originX:void 0),fd(e.y,t.y,n.y,r?r.originY:void 0)}function hd(e,t,n){e.min=n.min+t.min,e.max=e.min+Ne(t)}function YE(e,t,n){hd(e.x,t.x,n.x),hd(e.y,t.y,n.y)}function pd(e,t,n){e.min=t.min-n.min,e.max=e.min+Ne(t)}function Tr(e,t,n){pd(e.x,t.x,n.x),pd(e.y,t.y,n.y)}const gd=()=>({translate:0,scale:1,origin:0,originPoint:0}),_n=()=>({x:gd(),y:gd()}),md=()=>({min:0,max:0}),Se=()=>({x:md(),y:md()});function Xe(e){return[e("x"),e("y")]}function yi(e){return e===void 0||e===1}function va({scale:e,scaleX:t,scaleY:n}){return!yi(e)||!yi(t)||!yi(n)}function cn(e){return va(e)||qm(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function qm(e){return vd(e.x)||vd(e.y)}function vd(e){return e&&e!=="0%"}function is(e,t,n){const r=e-n,o=t*r;return n+o}function yd(e,t,n,r,o){return o!==void 0&&(e=is(e,o,r)),is(e,n,r)+t}function ya(e,t=0,n=1,r,o){e.min=yd(e.min,t,n,r,o),e.max=yd(e.max,t,n,r,o)}function Xm(e,{x:t,y:n}){ya(e.x,t.translate,t.scale,t.originPoint),ya(e.y,n.translate,n.scale,n.originPoint)}const wd=.999999999999,xd=1.0000000000001;function qE(e,t,n,r=!1){const o=n.length;if(!o)return;t.x=t.y=1;let s,i;for(let a=0;a<o;a++){s=n[a],i=s.projectionDelta;const{visualElement:l}=s.options;l&&l.props.style&&l.props.style.display==="contents"||(r&&s.options.layoutScroll&&s.scroll&&s!==s.root&&In(e,{x:-s.scroll.offset.x,y:-s.scroll.offset.y}),i&&(t.x*=i.x.scale,t.y*=i.y.scale,Xm(e,i)),r&&cn(s.latestValues)&&In(e,s.latestValues))}t.x<xd&&t.x>wd&&(t.x=1),t.y<xd&&t.y>wd&&(t.y=1)}function kn(e,t){e.min=e.min+t,e.max=e.max+t}function bd(e,t,n,r,o=.5){const s=ye(e.min,e.max,o);ya(e,t,n,s,r)}function In(e,t){bd(e.x,t.x,t.scaleX,t.scale,t.originX),bd(e.y,t.y,t.scaleY,t.scale,t.originY)}function Zm(e,t){return Gm(zE(e.getBoundingClientRect(),t))}function XE(e,t,n){const r=Zm(e,n),{scroll:o}=t;return o&&(kn(r.x,o.offset.x),kn(r.y,o.offset.y)),r}const Jm=({current:e})=>e?e.ownerDocument.defaultView:null,Sd=(e,t)=>Math.abs(e-t);function ZE(e,t){const n=Sd(e.x,t.x),r=Sd(e.y,t.y);return Math.sqrt(n**2+r**2)}class Qm{constructor(t,n,{transformPagePoint:r,contextWindow:o,dragSnapToOrigin:s=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const d=xi(this.lastMoveEventInfo,this.history),f=this.startEvent!==null,h=ZE(d.offset,{x:0,y:0})>=3;if(!f&&!h)return;const{point:m}=d,{timestamp:p}=Pe;this.history.push({...m,timestamp:p});const{onStart:b,onMove:y}=this.handlers;f||(b&&b(this.lastMoveEvent,d),this.startEvent=this.lastMoveEvent),y&&y(this.lastMoveEvent,d)},this.handlePointerMove=(d,f)=>{this.lastMoveEvent=d,this.lastMoveEventInfo=wi(f,this.transformPagePoint),we.update(this.updatePoint,!0)},this.handlePointerUp=(d,f)=>{this.end();const{onEnd:h,onSessionEnd:m,resumeAnimation:p}=this.handlers;if(this.dragSnapToOrigin&&p&&p(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const b=xi(d.type==="pointercancel"?this.lastMoveEventInfo:wi(f,this.transformPagePoint),this.history);this.startEvent&&h&&h(d,b),m&&m(d,b)},!Wl(t))return;this.dragSnapToOrigin=s,this.handlers=n,this.transformPagePoint=r,this.contextWindow=o||window;const i=ao(t),a=wi(i,this.transformPagePoint),{point:l}=a,{timestamp:c}=Pe;this.history=[{...l,timestamp:c}];const{onSessionStart:u}=n;u&&u(t,xi(a,this.history)),this.removeListeners=oo(Rr(this.contextWindow,"pointermove",this.handlePointerMove),Rr(this.contextWindow,"pointerup",this.handlePointerUp),Rr(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),qt(this.updatePoint)}}function wi(e,t){return t?{point:t(e.point)}:e}function Cd(e,t){return{x:e.x-t.x,y:e.y-t.y}}function xi({point:e},t){return{point:e,delta:Cd(e,ev(t)),offset:Cd(e,JE(t)),velocity:QE(t,.1)}}function JE(e){return e[0]}function ev(e){return e[e.length-1]}function QE(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const o=ev(e);for(;n>=0&&(r=e[n],!(o.timestamp-r.timestamp>ot(t)));)n--;if(!r)return{x:0,y:0};const s=gt(o.timestamp-r.timestamp);if(s===0)return{x:0,y:0};const i={x:(o.x-r.x)/s,y:(o.y-r.y)/s};return i.x===1/0&&(i.x=0),i.y===1/0&&(i.y=0),i}function eA(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?ye(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?ye(n,e,r.max):Math.min(e,n)),e}function Rd(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function tA(e,{top:t,left:n,bottom:r,right:o}){return{x:Rd(e.x,n,o),y:Rd(e.y,t,r)}}function Dd(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function nA(e,t){return{x:Dd(e.x,t.x),y:Dd(e.y,t.y)}}function rA(e,t){let n=.5;const r=Ne(e),o=Ne(t);return o>r?n=Nr(t.min,t.max-r,e.min):r>o&&(n=Nr(e.min,e.max-o,t.min)),Pt(0,1,n)}function oA(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const wa=.35;function sA(e=wa){return e===!1?e=0:e===!0&&(e=wa),{x:Td(e,"left","right"),y:Td(e,"top","bottom")}}function Td(e,t,n){return{min:Md(e,t),max:Md(e,n)}}function Md(e,t){return typeof e=="number"?e:e[t]||0}const iA=new WeakMap;class aA{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Se(),this.visualElement=t}start(t,{snapToCursor:n=!1}={}){const{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;const o=u=>{const{dragSnapToOrigin:d}=this.getProps();d?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(ao(u).point)},s=(u,d)=>{const{drag:f,dragPropagation:h,onDragStart:m}=this.getProps();if(f&&!h&&(this.openDragLock&&this.openDragLock(),this.openDragLock=RP(f),!this.openDragLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Xe(b=>{let y=this.getAxisMotionValue(b).get()||0;if(mt.test(y)){const{projection:g}=this.visualElement;if(g&&g.layout){const w=g.layout.layoutBox[b];w&&(y=Ne(w)*(parseFloat(y)/100))}}this.originPoint[b]=y}),m&&we.postRender(()=>m(u,d)),ga(this.visualElement,"transform");const{animationState:p}=this.visualElement;p&&p.setActive("whileDrag",!0)},i=(u,d)=>{const{dragPropagation:f,dragDirectionLock:h,onDirectionLock:m,onDrag:p}=this.getProps();if(!f&&!this.openDragLock)return;const{offset:b}=d;if(h&&this.currentDirection===null){this.currentDirection=lA(b),this.currentDirection!==null&&m&&m(this.currentDirection);return}this.updateAxis("x",d.point,b),this.updateAxis("y",d.point,b),this.visualElement.render(),p&&p(u,d)},a=(u,d)=>this.stop(u,d),l=()=>Xe(u=>{var d;return this.getAnimationState(u)==="paused"&&((d=this.getAxisMotionValue(u).animation)==null?void 0:d.play())}),{dragSnapToOrigin:c}=this.getProps();this.panSession=new Qm(t,{onSessionStart:o,onStart:s,onMove:i,onSessionEnd:a,resumeAnimation:l},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:c,contextWindow:Jm(this.visualElement)})}stop(t,n){const r=this.isDragging;if(this.cancel(),!r)return;const{velocity:o}=n;this.startAnimation(o);const{onDragEnd:s}=this.getProps();s&&we.postRender(()=>s(t,n))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(t,n,r){const{drag:o}=this.getProps();if(!r||!To(t,o,this.currentDirection))return;const s=this.getAxisMotionValue(t);let i=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(i=eA(i,this.constraints[t],this.elastic[t])),s.set(i)}resolveConstraints(){var s;const{dragConstraints:t,dragElastic:n}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(s=this.visualElement.projection)==null?void 0:s.layout,o=this.constraints;t&&On(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=tA(r.layoutBox,t):this.constraints=!1,this.elastic=sA(n),o!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&Xe(i=>{this.constraints!==!1&&this.getAxisMotionValue(i)&&(this.constraints[i]=oA(r.layoutBox[i],this.constraints[i]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!On(t))return!1;const r=t.current;Et(r!==null,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.");const{projection:o}=this.visualElement;if(!o||!o.layout)return!1;const s=XE(r,o.root,this.visualElement.getTransformPagePoint());let i=nA(o.layout.layoutBox,s);if(n){const a=n(BE(i));this.hasMutatedConstraints=!!a,a&&(i=Gm(a))}return i}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:o,dragTransition:s,dragSnapToOrigin:i,onDragTransitionEnd:a}=this.getProps(),l=this.constraints||{},c=Xe(u=>{if(!To(u,n,this.currentDirection))return;let d=l&&l[u]||{};i&&(d={min:0,max:0});const f=o?200:1e6,h=o?40:1e7,m={type:"inertia",velocity:r?t[u]:0,bounceStiffness:f,bounceDamping:h,timeConstant:750,restDelta:1,restSpeed:10,...s,...d};return this.startAxisValueAnimation(u,m)});return Promise.all(c).then(a)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return ga(this.visualElement,t),r.start(Ql(t,r,0,n,this.visualElement,!1))}stopAnimation(){Xe(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){Xe(t=>{var n;return(n=this.getAxisMotionValue(t).animation)==null?void 0:n.pause()})}getAnimationState(t){var n;return(n=this.getAxisMotionValue(t).animation)==null?void 0:n.state}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,r=this.visualElement.getProps(),o=r[n];return o||this.visualElement.getValue(t,(r.initial?r.initial[t]:void 0)||0)}snapToCursor(t){Xe(n=>{const{drag:r}=this.getProps();if(!To(n,r,this.currentDirection))return;const{projection:o}=this.visualElement,s=this.getAxisMotionValue(n);if(o&&o.layout){const{min:i,max:a}=o.layout.layoutBox[n];s.set(t[n]-ye(i,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!On(n)||!r||!this.constraints)return;this.stopAnimation();const o={x:0,y:0};Xe(i=>{const a=this.getAxisMotionValue(i);if(a&&this.constraints!==!1){const l=a.get();o[i]=rA({min:l,max:l},this.constraints[i])}});const{transformTemplate:s}=this.visualElement.getProps();this.visualElement.current.style.transform=s?s({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),Xe(i=>{if(!To(i,t,null))return;const a=this.getAxisMotionValue(i),{min:l,max:c}=this.constraints[i];a.set(ye(l,c,o[i]))})}addListeners(){if(!this.visualElement.current)return;iA.set(this.visualElement,this);const t=this.visualElement.current,n=Rr(t,"pointerdown",l=>{const{drag:c,dragListener:u=!0}=this.getProps();c&&u&&this.start(l)}),r=()=>{const{dragConstraints:l}=this.getProps();On(l)&&l.current&&(this.constraints=this.resolveRefConstraints())},{projection:o}=this.visualElement,s=o.addEventListener("measure",r);o&&!o.layout&&(o.root&&o.root.updateScroll(),o.updateLayout()),we.read(r);const i=Br(window,"resize",()=>this.scalePositionWithinConstraints()),a=o.addEventListener("didUpdate",({delta:l,hasLayoutChanged:c})=>{this.isDragging&&c&&(Xe(u=>{const d=this.getAxisMotionValue(u);d&&(this.originPoint[u]+=l[u].translate,d.set(d.get()+l[u].translate))}),this.visualElement.render())});return()=>{i(),n(),s(),a&&a()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:o=!1,dragConstraints:s=!1,dragElastic:i=wa,dragMomentum:a=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:o,dragConstraints:s,dragElastic:i,dragMomentum:a}}}function To(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function lA(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class cA extends on{constructor(t){super(t),this.removeGroupControls=Qe,this.removeListeners=Qe,this.controls=new aA(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Qe}unmount(){this.removeGroupControls(),this.removeListeners()}}const Pd=e=>(t,n)=>{e&&we.postRender(()=>e(t,n))};class uA extends on{constructor(){super(...arguments),this.removePointerDownListener=Qe}onPointerDown(t){this.session=new Qm(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Jm(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:o}=this.node.getProps();return{onSessionStart:Pd(t),onStart:Pd(n),onMove:r,onEnd:(s,i)=>{delete this.session,o&&we.postRender(()=>o(s,i))}}}mount(){this.removePointerDownListener=Rr(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const Lo={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function Ed(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const gr={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(re.test(e))e=parseFloat(e);else return e;const n=Ed(e,t.target.x),r=Ed(e,t.target.y);return`${n}% ${r}%`}},dA={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,o=Xt.parse(e);if(o.length>5)return r;const s=Xt.createTransformer(e),i=typeof o[0]!="number"?1:0,a=n.x.scale*t.x,l=n.y.scale*t.y;o[0+i]/=a,o[1+i]/=l;const c=ye(a,l,.5);return typeof o[2+i]=="number"&&(o[2+i]/=c),typeof o[3+i]=="number"&&(o[3+i]/=c),s(o)}};class fA extends T.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:o}=this.props,{projection:s}=t;XP(hA),s&&(n.group&&n.group.add(s),r&&r.register&&o&&r.register(s),s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions({...s.options,onExitComplete:()=>this.safeToRemove()})),Lo.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:o,isPresent:s}=this.props,{projection:i}=r;return i&&(i.isPresent=s,o||t.layoutDependency!==n||n===void 0||t.isPresent!==s?i.willUpdate():this.safeToRemove(),t.isPresent!==s&&(s?i.promote():i.relegate()||we.postRender(()=>{const a=i.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),Hl.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:o}=t;o&&(o.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(o),r&&r.deregister&&r.deregister(o))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function tv(e){const[t,n]=kP(),r=T.useContext(Fg);return v.jsx(fA,{...e,layoutGroup:r,switchLayoutGroup:T.useContext(km),isPresent:t,safeToRemove:n})}const hA={borderRadius:{...gr,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:gr,borderTopRightRadius:gr,borderBottomLeftRadius:gr,borderBottomRightRadius:gr,boxShadow:dA};function pA(e,t,n){const r=ke(e)?e:zn(e);return r.start(Ql("",r,t,n)),r.animation}const gA=(e,t)=>e.depth-t.depth;class mA{constructor(){this.children=[],this.isDirty=!1}add(t){Rl(this.children,t),this.isDirty=!0}remove(t){Dl(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(gA),this.isDirty=!1,this.children.forEach(t)}}function vA(e,t){const n=Le.now(),r=({timestamp:o})=>{const s=o-n;s>=t&&(qt(r),e(s-t))};return we.setup(r,!0),()=>qt(r)}const nv=["TopLeft","TopRight","BottomLeft","BottomRight"],yA=nv.length,Ad=e=>typeof e=="string"?parseFloat(e):e,Od=e=>typeof e=="number"||re.test(e);function wA(e,t,n,r,o,s){o?(e.opacity=ye(0,n.opacity??1,xA(r)),e.opacityExit=ye(t.opacity??1,0,bA(r))):s&&(e.opacity=ye(t.opacity??1,n.opacity??1,r));for(let i=0;i<yA;i++){const a=`border${nv[i]}Radius`;let l=_d(t,a),c=_d(n,a);if(l===void 0&&c===void 0)continue;l||(l=0),c||(c=0),l===0||c===0||Od(l)===Od(c)?(e[a]=Math.max(ye(Ad(l),Ad(c),r),0),(mt.test(c)||mt.test(l))&&(e[a]+="%")):e[a]=c}(t.rotate||n.rotate)&&(e.rotate=ye(t.rotate||0,n.rotate||0,r))}function _d(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const xA=rv(0,.5,Yg),bA=rv(.5,.95,Qe);function rv(e,t,n){return r=>r<e?0:r>t?1:n(Nr(e,t,r))}function kd(e,t){e.min=t.min,e.max=t.max}function qe(e,t){kd(e.x,t.x),kd(e.y,t.y)}function Id(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function Nd(e,t,n,r,o){return e-=t,e=is(e,1/n,r),o!==void 0&&(e=is(e,1/o,r)),e}function SA(e,t=0,n=1,r=.5,o,s=e,i=e){if(mt.test(t)&&(t=parseFloat(t),t=ye(i.min,i.max,t/100)-i.min),typeof t!="number")return;let a=ye(s.min,s.max,r);e===s&&(a-=t),e.min=Nd(e.min,t,n,a,o),e.max=Nd(e.max,t,n,a,o)}function jd(e,t,[n,r,o],s,i){SA(e,t[n],t[r],t[o],t.scale,s,i)}const CA=["x","scaleX","originX"],RA=["y","scaleY","originY"];function Fd(e,t,n,r){jd(e.x,t,CA,n?n.x:void 0,r?r.x:void 0),jd(e.y,t,RA,n?n.y:void 0,r?r.y:void 0)}function Vd(e){return e.translate===0&&e.scale===1}function ov(e){return Vd(e.x)&&Vd(e.y)}function Ld(e,t){return e.min===t.min&&e.max===t.max}function DA(e,t){return Ld(e.x,t.x)&&Ld(e.y,t.y)}function $d(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function sv(e,t){return $d(e.x,t.x)&&$d(e.y,t.y)}function Bd(e){return Ne(e.x)/Ne(e.y)}function zd(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class TA{constructor(){this.members=[]}add(t){Rl(this.members,t),t.scheduleRender()}remove(t){if(Dl(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(o=>t===o);if(n===0)return!1;let r;for(let o=n;o>=0;o--){const s=this.members[o];if(s.isPresent!==!1){r=s;break}}return r?(this.promote(r),!0):!1}promote(t,n){const r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.instance&&r.scheduleRender(),t.scheduleRender(),t.resumeFrom=r,n&&(t.resumeFrom.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:o}=t.options;o===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:r}=t;n.onExitComplete&&n.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function MA(e,t,n){let r="";const o=e.x.translate/t.x,s=e.y.translate/t.y,i=(n==null?void 0:n.z)||0;if((o||s||i)&&(r=`translate3d(${o}px, ${s}px, ${i}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:c,rotate:u,rotateX:d,rotateY:f,skewX:h,skewY:m}=n;c&&(r=`perspective(${c}px) ${r}`),u&&(r+=`rotate(${u}deg) `),d&&(r+=`rotateX(${d}deg) `),f&&(r+=`rotateY(${f}deg) `),h&&(r+=`skewX(${h}deg) `),m&&(r+=`skewY(${m}deg) `)}const a=e.x.scale*t.x,l=e.y.scale*t.y;return(a!==1||l!==1)&&(r+=`scale(${a}, ${l})`),r||"none"}const bi=["","X","Y","Z"],PA={visibility:"hidden"},EA=1e3;let AA=0;function Si(e,t,n,r){const{latestValues:o}=t;o[e]&&(n[e]=o[e],t.setStaticValue(e,0),r&&(r[e]=0))}function iv(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=zm(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:o,layoutId:s}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",we,!(o||s))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&iv(r)}function av({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:o}){return class{constructor(i={},a=t==null?void 0:t()){this.id=AA++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(kA),this.nodes.forEach(VA),this.nodes.forEach(LA),this.nodes.forEach(IA)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=i,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let l=0;l<this.path.length;l++)this.path[l].shouldResetTransform=!0;this.root===this&&(this.nodes=new mA)}addEventListener(i,a){return this.eventHandlers.has(i)||this.eventHandlers.set(i,new Ml),this.eventHandlers.get(i).add(a)}notifyListeners(i,...a){const l=this.eventHandlers.get(i);l&&l.notify(...a)}hasListeners(i){return this.eventHandlers.has(i)}mount(i){if(this.instance)return;this.isSVG=Mm(i)&&!AP(i),this.instance=i;const{layoutId:a,layout:l,visualElement:c}=this.options;if(c&&!c.current&&c.mount(i),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(l||a)&&(this.isLayoutDirty=!0),e){let u;const d=()=>this.root.updateBlockedByResize=!1;e(i,()=>{this.root.updateBlockedByResize=!0,u&&u(),u=vA(d,250),Lo.hasAnimatedSinceResize&&(Lo.hasAnimatedSinceResize=!1,this.nodes.forEach(Wd))})}a&&this.root.registerSharedNode(a,this),this.options.animate!==!1&&c&&(a||l)&&this.addEventListener("didUpdate",({delta:u,hasLayoutChanged:d,hasRelativeLayoutChanged:f,layout:h})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const m=this.options.transition||c.getDefaultTransition()||WA,{onLayoutAnimationStart:p,onLayoutAnimationComplete:b}=c.getProps(),y=!this.targetLayout||!sv(this.targetLayout,h),g=!d&&f;if(this.options.layoutRoot||this.resumeFrom||g||d&&(y||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(u,g);const w={...Bl(m,"layout"),onPlay:p,onComplete:b};(c.shouldReduceMotion||this.options.layoutRoot)&&(w.delay=0,w.type=!1),this.startAnimation(w)}else d||Wd(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=h})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const i=this.getStack();i&&i.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),qt(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach($A),this.animationId++)}getTransformTemplate(){const{visualElement:i}=this.options;return i&&i.getProps().transformTemplate}willUpdate(i=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&iv(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let u=0;u<this.path.length;u++){const d=this.path[u];d.shouldResetTransform=!0,d.updateScroll("snapshot"),d.options.layoutRoot&&d.willUpdate(!1)}const{layoutId:a,layout:l}=this.options;if(a===void 0&&!l)return;const c=this.getTransformTemplate();this.prevTransformTemplateValue=c?c(this.latestValues,""):void 0,this.updateSnapshot(),i&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(Hd);return}this.isUpdating||this.nodes.forEach(jA),this.isUpdating=!1,this.nodes.forEach(FA),this.nodes.forEach(OA),this.nodes.forEach(_A),this.clearAllSnapshots();const a=Le.now();Pe.delta=Pt(0,1e3/60,a-Pe.timestamp),Pe.timestamp=a,Pe.isProcessing=!0,hi.update.process(Pe),hi.preRender.process(Pe),hi.render.process(Pe),Pe.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Hl.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(NA),this.sharedNodes.forEach(BA)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,we.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){we.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!Ne(this.snapshot.measuredBox.x)&&!Ne(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let l=0;l<this.path.length;l++)this.path[l].updateScroll();const i=this.layout;this.layout=this.measure(!1),this.layoutCorrected=Se(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:a}=this.options;a&&a.notify("LayoutMeasure",this.layout.layoutBox,i?i.layoutBox:void 0)}updateScroll(i="measure"){let a=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===i&&(a=!1),a&&this.instance){const l=r(this.instance);this.scroll={animationId:this.root.animationId,phase:i,isRoot:l,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:l}}}resetTransform(){if(!o)return;const i=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,a=this.projectionDelta&&!ov(this.projectionDelta),l=this.getTransformTemplate(),c=l?l(this.latestValues,""):void 0,u=c!==this.prevTransformTemplateValue;i&&this.instance&&(a||cn(this.latestValues)||u)&&(o(this.instance,c),this.shouldResetTransform=!1,this.scheduleRender())}measure(i=!0){const a=this.measurePageBox();let l=this.removeElementScroll(a);return i&&(l=this.removeTransform(l)),UA(l),{animationId:this.root.animationId,measuredBox:a,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){var c;const{visualElement:i}=this.options;if(!i)return Se();const a=i.measureViewportBox();if(!(((c=this.scroll)==null?void 0:c.wasRoot)||this.path.some(GA))){const{scroll:u}=this.root;u&&(kn(a.x,u.offset.x),kn(a.y,u.offset.y))}return a}removeElementScroll(i){var l;const a=Se();if(qe(a,i),(l=this.scroll)!=null&&l.wasRoot)return a;for(let c=0;c<this.path.length;c++){const u=this.path[c],{scroll:d,options:f}=u;u!==this.root&&d&&f.layoutScroll&&(d.wasRoot&&qe(a,i),kn(a.x,d.offset.x),kn(a.y,d.offset.y))}return a}applyTransform(i,a=!1){const l=Se();qe(l,i);for(let c=0;c<this.path.length;c++){const u=this.path[c];!a&&u.options.layoutScroll&&u.scroll&&u!==u.root&&In(l,{x:-u.scroll.offset.x,y:-u.scroll.offset.y}),cn(u.latestValues)&&In(l,u.latestValues)}return cn(this.latestValues)&&In(l,this.latestValues),l}removeTransform(i){const a=Se();qe(a,i);for(let l=0;l<this.path.length;l++){const c=this.path[l];if(!c.instance||!cn(c.latestValues))continue;va(c.latestValues)&&c.updateSnapshot();const u=Se(),d=c.measurePageBox();qe(u,d),Fd(a,c.latestValues,c.snapshot?c.snapshot.layoutBox:void 0,u)}return cn(this.latestValues)&&Fd(a,this.latestValues),a}setTargetDelta(i){this.targetDelta=i,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(i){this.options={...this.options,...i,crossfade:i.crossfade!==void 0?i.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==Pe.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(i=!1){var f;const a=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=a.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=a.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=a.isSharedProjectionDirty);const l=!!this.resumingFrom||this!==a;if(!(i||l&&this.isSharedProjectionDirty||this.isProjectionDirty||(f=this.parent)!=null&&f.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:u,layoutId:d}=this.options;if(!(!this.layout||!(u||d))){if(this.resolvedRelativeTargetAt=Pe.timestamp,!this.targetDelta&&!this.relativeTarget){const h=this.getClosestProjectingParent();h&&h.layout&&this.animationProgress!==1?(this.relativeParent=h,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Se(),this.relativeTargetOrigin=Se(),Tr(this.relativeTargetOrigin,this.layout.layoutBox,h.layout.layoutBox),qe(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=Se(),this.targetWithTransforms=Se()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),YE(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):qe(this.target,this.layout.layoutBox),Xm(this.target,this.targetDelta)):qe(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget)){this.attemptToResolveRelativeTarget=!1;const h=this.getClosestProjectingParent();h&&!!h.resumingFrom==!!this.resumingFrom&&!h.options.layoutScroll&&h.target&&this.animationProgress!==1?(this.relativeParent=h,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Se(),this.relativeTargetOrigin=Se(),Tr(this.relativeTargetOrigin,this.target,h.target),qe(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}}}getClosestProjectingParent(){if(!(!this.parent||va(this.parent.latestValues)||qm(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var m;const i=this.getLead(),a=!!this.resumingFrom||this!==i;let l=!0;if((this.isProjectionDirty||(m=this.parent)!=null&&m.isProjectionDirty)&&(l=!1),a&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(l=!1),this.resolvedRelativeTargetAt===Pe.timestamp&&(l=!1),l)return;const{layout:c,layoutId:u}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(c||u))return;qe(this.layoutCorrected,this.layout.layoutBox);const d=this.treeScale.x,f=this.treeScale.y;qE(this.layoutCorrected,this.treeScale,this.path,a),i.layout&&!i.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(i.target=i.layout.layoutBox,i.targetWithTransforms=Se());const{target:h}=i;if(!h){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(Id(this.prevProjectionDelta.x,this.projectionDelta.x),Id(this.prevProjectionDelta.y,this.projectionDelta.y)),Dr(this.projectionDelta,this.layoutCorrected,h,this.latestValues),(this.treeScale.x!==d||this.treeScale.y!==f||!zd(this.projectionDelta.x,this.prevProjectionDelta.x)||!zd(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",h))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(i=!0){var a;if((a=this.options.visualElement)==null||a.scheduleRender(),i){const l=this.getStack();l&&l.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=_n(),this.projectionDelta=_n(),this.projectionDeltaWithTransform=_n()}setAnimationOrigin(i,a=!1){const l=this.snapshot,c=l?l.latestValues:{},u={...this.latestValues},d=_n();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const f=Se(),h=l?l.source:void 0,m=this.layout?this.layout.source:void 0,p=h!==m,b=this.getStack(),y=!b||b.members.length<=1,g=!!(p&&!y&&this.options.crossfade===!0&&!this.path.some(HA));this.animationProgress=0;let w;this.mixTargetDelta=C=>{const x=C/1e3;Ud(d.x,i.x,x),Ud(d.y,i.y,x),this.setTargetDelta(d),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Tr(f,this.layout.layoutBox,this.relativeParent.layout.layoutBox),zA(this.relativeTarget,this.relativeTargetOrigin,f,x),w&&DA(this.relativeTarget,w)&&(this.isProjectionDirty=!1),w||(w=Se()),qe(w,this.relativeTarget)),p&&(this.animationValues=u,wA(u,c,this.latestValues,x,g,y)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=x},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(i){var a,l,c;this.notifyListeners("animationStart"),(a=this.currentAnimation)==null||a.stop(!1),(c=(l=this.resumingFrom)==null?void 0:l.currentAnimation)==null||c.stop(!1),this.pendingAnimation&&(qt(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=we.update(()=>{Lo.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=zn(0)),this.currentAnimation=pA(this.motionValue,[0,1e3],{...i,isSync:!0,onUpdate:u=>{this.mixTargetDelta(u),i.onUpdate&&i.onUpdate(u)},onStop:()=>{},onComplete:()=>{i.onComplete&&i.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const i=this.getStack();i&&i.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(EA),this.currentAnimation.stop(!1)),this.completeAnimation()}applyTransformsToTarget(){const i=this.getLead();let{targetWithTransforms:a,target:l,layout:c,latestValues:u}=i;if(!(!a||!l||!c)){if(this!==i&&this.layout&&c&&lv(this.options.animationType,this.layout.layoutBox,c.layoutBox)){l=this.target||Se();const d=Ne(this.layout.layoutBox.x);l.x.min=i.target.x.min,l.x.max=l.x.min+d;const f=Ne(this.layout.layoutBox.y);l.y.min=i.target.y.min,l.y.max=l.y.min+f}qe(a,l),In(a,u),Dr(this.projectionDeltaWithTransform,this.layoutCorrected,a,u)}}registerSharedNode(i,a){this.sharedNodes.has(i)||this.sharedNodes.set(i,new TA),this.sharedNodes.get(i).add(a);const c=a.options.initialPromotionConfig;a.promote({transition:c?c.transition:void 0,preserveFollowOpacity:c&&c.shouldPreserveFollowOpacity?c.shouldPreserveFollowOpacity(a):void 0})}isLead(){const i=this.getStack();return i?i.lead===this:!0}getLead(){var a;const{layoutId:i}=this.options;return i?((a=this.getStack())==null?void 0:a.lead)||this:this}getPrevLead(){var a;const{layoutId:i}=this.options;return i?(a=this.getStack())==null?void 0:a.prevLead:void 0}getStack(){const{layoutId:i}=this.options;if(i)return this.root.sharedNodes.get(i)}promote({needsReset:i,transition:a,preserveFollowOpacity:l}={}){const c=this.getStack();c&&c.promote(this,l),i&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const i=this.getStack();return i?i.relegate(this):!1}resetSkewAndRotation(){const{visualElement:i}=this.options;if(!i)return;let a=!1;const{latestValues:l}=i;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(a=!0),!a)return;const c={};l.z&&Si("z",i,c,this.animationValues);for(let u=0;u<bi.length;u++)Si(`rotate${bi[u]}`,i,c,this.animationValues),Si(`skew${bi[u]}`,i,c,this.animationValues);i.render();for(const u in c)i.setStaticValue(u,c[u]),this.animationValues&&(this.animationValues[u]=c[u]);i.scheduleRender()}getProjectionStyles(i){if(!this.instance||this.isSVG)return;if(!this.isVisible)return PA;const a={visibility:""},l=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,a.opacity="",a.pointerEvents=Vo(i==null?void 0:i.pointerEvents)||"",a.transform=l?l(this.latestValues,""):"none",a;const c=this.getLead();if(!this.projectionDelta||!this.layout||!c.target){const h={};return this.options.layoutId&&(h.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,h.pointerEvents=Vo(i==null?void 0:i.pointerEvents)||""),this.hasProjected&&!cn(this.latestValues)&&(h.transform=l?l({},""):"none",this.hasProjected=!1),h}const u=c.animationValues||c.latestValues;this.applyTransformsToTarget(),a.transform=MA(this.projectionDeltaWithTransform,this.treeScale,u),l&&(a.transform=l(u,a.transform));const{x:d,y:f}=this.projectionDelta;a.transformOrigin=`${d.origin*100}% ${f.origin*100}% 0`,c.animationValues?a.opacity=c===this?u.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:u.opacityExit:a.opacity=c===this?u.opacity!==void 0?u.opacity:"":u.opacityExit!==void 0?u.opacityExit:0;for(const h in Lr){if(u[h]===void 0)continue;const{correct:m,applyTo:p,isCSSVariable:b}=Lr[h],y=a.transform==="none"?u[h]:m(u[h],c);if(p){const g=p.length;for(let w=0;w<g;w++)a[p[w]]=y}else b?this.options.visualElement.renderState.vars[h]=y:a[h]=y}return this.options.layoutId&&(a.pointerEvents=c===this?Vo(i==null?void 0:i.pointerEvents)||"":"none"),a}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(i=>{var a;return(a=i.currentAnimation)==null?void 0:a.stop(!1)}),this.root.nodes.forEach(Hd),this.root.sharedNodes.clear()}}}function OA(e){e.updateLayout()}function _A(e){var n;const t=((n=e.resumeFrom)==null?void 0:n.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:o}=e.layout,{animationType:s}=e.options,i=t.source!==e.layout.source;s==="size"?Xe(d=>{const f=i?t.measuredBox[d]:t.layoutBox[d],h=Ne(f);f.min=r[d].min,f.max=f.min+h}):lv(s,t.layoutBox,r)&&Xe(d=>{const f=i?t.measuredBox[d]:t.layoutBox[d],h=Ne(r[d]);f.max=f.min+h,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[d].max=e.relativeTarget[d].min+h)});const a=_n();Dr(a,r,t.layoutBox);const l=_n();i?Dr(l,e.applyTransform(o,!0),t.measuredBox):Dr(l,r,t.layoutBox);const c=!ov(a);let u=!1;if(!e.resumeFrom){const d=e.getClosestProjectingParent();if(d&&!d.resumeFrom){const{snapshot:f,layout:h}=d;if(f&&h){const m=Se();Tr(m,t.layoutBox,f.layoutBox);const p=Se();Tr(p,r,h.layoutBox),sv(m,p)||(u=!0),d.options.layoutRoot&&(e.relativeTarget=p,e.relativeTargetOrigin=m,e.relativeParent=d)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:t,delta:l,layoutDelta:a,hasLayoutChanged:c,hasRelativeLayoutChanged:u})}else if(e.isLead()){const{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function kA(e){e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function IA(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function NA(e){e.clearSnapshot()}function Hd(e){e.clearMeasurements()}function jA(e){e.isLayoutDirty=!1}function FA(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function Wd(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function VA(e){e.resolveTargetDelta()}function LA(e){e.calcProjection()}function $A(e){e.resetSkewAndRotation()}function BA(e){e.removeLeadSnapshot()}function Ud(e,t,n){e.translate=ye(t.translate,0,n),e.scale=ye(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function Gd(e,t,n,r){e.min=ye(t.min,n.min,r),e.max=ye(t.max,n.max,r)}function zA(e,t,n,r){Gd(e.x,t.x,n.x,r),Gd(e.y,t.y,n.y,r)}function HA(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const WA={duration:.45,ease:[.4,0,.1,1]},Kd=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),Yd=Kd("applewebkit/")&&!Kd("chrome/")?Math.round:Qe;function qd(e){e.min=Yd(e.min),e.max=Yd(e.max)}function UA(e){qd(e.x),qd(e.y)}function lv(e,t,n){return e==="position"||e==="preserve-aspect"&&!KE(Bd(t),Bd(n),.2)}function GA(e){var t;return e!==e.root&&((t=e.scroll)==null?void 0:t.wasRoot)}const KA=av({attachResizeListener:(e,t)=>Br(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),Ci={current:void 0},cv=av({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Ci.current){const e=new KA({});e.mount(window),e.setOptions({layoutScroll:!0}),Ci.current=e}return Ci.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),YA={pan:{Feature:uA},drag:{Feature:cA,ProjectionNode:cv,MeasureLayout:tv}};function Xd(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",n==="Start");const o="onHover"+n,s=r[o];s&&we.postRender(()=>s(t,ao(t)))}class qA extends on{mount(){const{current:t}=this.node;t&&(this.unmount=DP(t,(n,r)=>(Xd(this.node,r,"Start"),o=>Xd(this.node,o,"End"))))}unmount(){}}class XA extends on{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=oo(Br(this.node.current,"focus",()=>this.onFocus()),Br(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function Zd(e,t,n){const{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap",n==="Start");const o="onTap"+(n==="End"?"":n),s=r[o];s&&we.postRender(()=>s(t,ao(t)))}class ZA extends on{mount(){const{current:t}=this.node;t&&(this.unmount=EP(t,(n,r)=>(Zd(this.node,r,"Start"),(o,{success:s})=>Zd(this.node,o,s?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const xa=new WeakMap,Ri=new WeakMap,JA=e=>{const t=xa.get(e.target);t&&t(e)},QA=e=>{e.forEach(JA)};function eO({root:e,...t}){const n=e||document;Ri.has(n)||Ri.set(n,{});const r=Ri.get(n),o=JSON.stringify(t);return r[o]||(r[o]=new IntersectionObserver(QA,{root:e,...t})),r[o]}function tO(e,t,n){const r=eO(t);return xa.set(e,n),r.observe(e),()=>{xa.delete(e),r.unobserve(e)}}const nO={some:0,all:1};class rO extends on{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:o="some",once:s}=t,i={root:n?n.current:void 0,rootMargin:r,threshold:typeof o=="number"?o:nO[o]},a=l=>{const{isIntersecting:c}=l;if(this.isInView===c||(this.isInView=c,s&&!c&&this.hasEnteredView))return;c&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",c);const{onViewportEnter:u,onViewportLeave:d}=this.node.getProps(),f=c?u:d;f&&f(l)};return tO(this.node.current,i,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(oO(t,n))&&this.startObserver()}unmount(){}}function oO({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const sO={inView:{Feature:rO},tap:{Feature:ZA},focus:{Feature:XA},hover:{Feature:qA}},iO={layout:{ProjectionNode:cv,MeasureLayout:tv}},ba={current:null},uv={current:!1};function aO(){if(uv.current=!0,!!Sl)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>ba.current=e.matches;e.addListener(t),t()}else ba.current=!1}const lO=new WeakMap;function cO(e,t,n){for(const r in t){const o=t[r],s=n[r];if(ke(o))e.addValue(r,o);else if(ke(s))e.addValue(r,zn(o,{owner:e}));else if(s!==o)if(e.hasValue(r)){const i=e.getValue(r);i.liveStyle===!0?i.jump(o):i.hasAnimated||i.set(o)}else{const i=e.getStaticValue(r);e.addValue(r,zn(i!==void 0?i:o,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const Jd=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class uO{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:o,blockInitialAnimation:s,visualState:i},a={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=$l,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const f=Le.now();this.renderScheduledAt<f&&(this.renderScheduledAt=f,we.render(this.render,!1,!0))};const{latestValues:l,renderState:c}=i;this.latestValues=l,this.baseTarget={...l},this.initialValues=n.initial?{...l}:{},this.renderState=c,this.parent=t,this.props=n,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=o,this.options=a,this.blockInitialAnimation=!!s,this.isControllingVariants=Fs(n),this.isVariantNode=Om(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:u,...d}=this.scrapeMotionValuesFromProps(n,{},this);for(const f in d){const h=d[f];l[f]!==void 0&&ke(h)&&h.set(l[f],!1)}}mount(t){this.current=t,lO.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,r)=>this.bindToMotionValue(r,n)),uv.current||aO(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:ba.current,process.env.NODE_ENV!=="production"&&Pl(this.shouldReduceMotion!==!0,"You have Reduced Motion enabled on your device. Animations may not appear as expected."),this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),qt(this.notifyUpdate),qt(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const n=this.features[t];n&&(n.unmount(),n.isMounted=!1)}this.current=null}bindToMotionValue(t,n){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const r=tr.has(t);r&&this.onBindTransform&&this.onBindTransform();const o=n.on("change",a=>{this.latestValues[t]=a,this.props.onUpdate&&we.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0)}),s=n.on("renderRequest",this.scheduleRender);let i;window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{o(),s(),i&&i(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in Hn){const n=Hn[t];if(!n)continue;const{isEnabled:r,Feature:o}=n;if(!this.features[t]&&o&&r(this.props)&&(this.features[t]=new o(this)),this.features[t]){const s=this.features[t];s.isMounted?s.update():(s.mount(),s.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Se()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;r<Jd.length;r++){const o=Jd[r];this.propEventSubscriptions[o]&&(this.propEventSubscriptions[o](),delete this.propEventSubscriptions[o]);const s="on"+o,i=t[s];i&&(this.propEventSubscriptions[o]=this.on(o,i))}this.prevMotionValues=cO(this,this.scrapeMotionValuesFromProps(t,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(t),()=>n.variantChildren.delete(t)}addValue(t,n){const r=this.values.get(t);n!==r&&(r&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&n!==void 0&&(r=zn(n===null?void 0:n,{owner:this}),this.addValue(t,r)),r}readValue(t,n){let r=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return r!=null&&(typeof r=="string"&&(Vg(r)||$g(r))?r=parseFloat(r):!_P(r)&&Xt.test(n)&&(r=Sm(t,n)),this.setBaseTarget(t,ke(r)?r.get():r)),ke(r)?r.get():r}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var s;const{initial:n}=this.props;let r;if(typeof n=="string"||typeof n=="object"){const i=Zl(this.props,n,(s=this.presenceContext)==null?void 0:s.custom);i&&(r=i[t])}if(n&&r!==void 0)return r;const o=this.getBaseTargetFromProps(this.props,t);return o!==void 0&&!ke(o)?o:this.initialValues[t]!==void 0&&r===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new Ml),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}}class dv extends uO{constructor(){super(...arguments),this.KeyframeResolver=xP}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){return t.style?t.style[n]:void 0}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;ke(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function fv(e,{style:t,vars:n},r,o){Object.assign(e.style,t,o&&o.getProjectionStyles(r));for(const s in n)e.style.setProperty(s,n[s])}function dO(e){return window.getComputedStyle(e)}class fO extends dv{constructor(){super(...arguments),this.type="html",this.renderInstance=fv}readValueFromInstance(t,n){var r;if(tr.has(n))return(r=this.projection)!=null&&r.isProjecting?la(n):VM(t,n);{const o=dO(t),s=(Ol(n)?o.getPropertyValue(n):o[n])||0;return typeof s=="string"?s.trim():s}}measureInstanceViewportBox(t,{transformPagePoint:n}){return Zm(t,n)}build(t,n,r){Yl(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return Jl(t,n,r)}}const hv=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function hO(e,t,n,r){fv(e,t,void 0,r);for(const o in t.attrs)e.setAttribute(hv.has(o)?o:Kl(o),t.attrs[o])}class pO extends dv{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Se}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(tr.has(n)){const r=bm(n);return r&&r.default||0}return n=hv.has(n)?n:Kl(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return Bm(t,n,r)}build(t,n,r){Fm(t,n,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(t,n,r,o){hO(t,n,r,o)}mount(t){this.isSVGTag=Lm(t.tagName),super.mount(t)}}const gO=(e,t)=>Xl(e)?new pO(t):new fO(t,{allowProjection:e!==T.Fragment}),mO=hE({...LE,...sO,...YA,...iO},gO),vO=VP(mO),yO=({children:e})=>v.jsx(zw,{modifiers:[IT],dropAnimation:{duration:500,easing:"cubic-bezier(0.18, 0.67, 0.6, 1.22)"},className:"Draggable dragging",children:v.jsx(vO.div,{style:{height:"100%",width:"100%",border:"2px solid #f6543b",borderRadius:"8px",boxShadow:"0 0 0 4px rgba(246, 140, 59, 0.2), 0 4px 12px rgba(228, 3, 3, 0.15)"},initial:{scale:.7,opacity:0},animate:{scale:1,opacity:1},transition:{duration:.4,ease:[.22,1,.36,1],mass:.5},children:e})});/**
|
|
169
|
+
`)},u0=0,An=[];function d0(e){var t=T.useRef([]),n=T.useRef([0,0]),r=T.useRef(),o=T.useState(u0++)[0],s=T.useState(kp)[0],i=T.useRef(e);T.useEffect(function(){i.current=e},[e]),T.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var h=_S([e.lockRef.current],(e.shards||[]).map(Qc),!0).filter(Boolean);return h.forEach(function(b){return b.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),h.forEach(function(b){return b.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var a=T.useCallback(function(h,b){if("touches"in h&&h.touches.length===2||h.type==="wheel"&&h.ctrlKey)return!i.current.allowPinchZoom;var w=wo(h),v=n.current,m="deltaX"in h?h.deltaX:v[0]-w[0],C="deltaY"in h?h.deltaY:v[1]-w[1],x,D=h.target,S=Math.abs(m)>Math.abs(C)?"h":"v";if("touches"in h&&S==="h"&&D.type==="range")return!1;var M=Zc(S,D);if(!M)return!0;if(M?x=S:(x=S==="v"?"h":"v",M=Zc(S,D)),!M)return!1;if(!r.current&&"changedTouches"in h&&(m||C)&&(r.current=x),!x)return!0;var P=r.current||x;return a0(P,b,h,P==="h"?m:C)},[]),l=T.useCallback(function(h){var b=h;if(!(!An.length||An[An.length-1]!==s)){var w="deltaY"in b?Jc(b):wo(b),v=t.current.filter(function(x){return x.name===b.type&&(x.target===b.target||b.target===x.shadowParent)&&l0(x.delta,w)})[0];if(v&&v.should){b.cancelable&&b.preventDefault();return}if(!v){var m=(i.current.shards||[]).map(Qc).filter(Boolean).filter(function(x){return x.contains(b.target)}),C=m.length>0?a(b,m[0]):!i.current.noIsolation;C&&b.cancelable&&b.preventDefault()}}},[]),c=T.useCallback(function(h,b,w,v){var m={name:h,delta:b,target:w,should:v,shadowParent:f0(w)};t.current.push(m),setTimeout(function(){t.current=t.current.filter(function(C){return C!==m})},1)},[]),u=T.useCallback(function(h){n.current=wo(h),r.current=void 0},[]),d=T.useCallback(function(h){c(h.type,Jc(h),h.target,a(h,e.lockRef.current))},[]),p=T.useCallback(function(h){c(h.type,wo(h),h.target,a(h,e.lockRef.current))},[]);T.useEffect(function(){return An.push(s),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:p}),document.addEventListener("wheel",l,Pn),document.addEventListener("touchmove",l,Pn),document.addEventListener("touchstart",u,Pn),function(){An=An.filter(function(h){return h!==s}),document.removeEventListener("wheel",l,Pn),document.removeEventListener("touchmove",l,Pn),document.removeEventListener("touchstart",u,Pn)}},[]);var f=e.removeScrollBar,g=e.inert;return T.createElement(T.Fragment,null,g?T.createElement(s,{styles:c0(o)}):null,f?T.createElement(e0,{gapMode:e.gapMode}):null)}function f0(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const p0=BS(_p,d0);var Ms=T.forwardRef(function(e,t){return T.createElement(Ds,vt({},e,{ref:t,sideCar:p0}))});Ms.classNames=Ds.classNames;var Xi=["Enter"," "],h0=["ArrowDown","PageUp","Home"],Fp=["ArrowUp","PageDown","End"],g0=[...h0,...Fp],m0={ltr:[...Xi,"ArrowRight"],rtl:[...Xi,"ArrowLeft"]},v0={ltr:["ArrowLeft"],rtl:["ArrowRight"]},oo="Menu",[Lr,y0,w0]=Wa(oo),[Sn,Vp]=rn(oo,[w0,on,Rp]),Es=on(),Lp=Rp(),[x0,Cn]=Sn(oo),[b0,so]=Sn(oo),$p=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:o,onOpenChange:s,modal:i=!0}=e,a=Es(t),[l,c]=T.useState(null),u=T.useRef(!1),d=rt(s),p=Ua(o);return T.useEffect(()=>{const f=()=>{u.current=!0,document.addEventListener("pointerdown",g,{capture:!0,once:!0}),document.addEventListener("pointermove",g,{capture:!0,once:!0})},g=()=>u.current=!1;return document.addEventListener("keydown",f,{capture:!0}),()=>{document.removeEventListener("keydown",f,{capture:!0}),document.removeEventListener("pointerdown",g,{capture:!0}),document.removeEventListener("pointermove",g,{capture:!0})}},[]),y.jsx(Ss,{...a,children:y.jsx(x0,{scope:t,open:n,onOpenChange:d,content:l,onContentChange:c,children:y.jsx(b0,{scope:t,onClose:T.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:u,dir:p,modal:i,children:r})})})};$p.displayName=oo;var S0="MenuAnchor",rl=T.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=Es(n);return y.jsx(no,{...o,...r,ref:t})});rl.displayName=S0;var ol="MenuPortal",[C0,Bp]=Sn(ol,{forceMount:void 0}),zp=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:o}=e,s=Cn(ol,t);return y.jsx(C0,{scope:t,forceMount:n,children:y.jsx(jt,{present:n||s.open,children:y.jsx(ro,{asChild:!0,container:o,children:r})})})};zp.displayName=ol;var tt="MenuContent",[R0,sl]=Sn(tt),Hp=T.forwardRef((e,t)=>{const n=Bp(tt,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,s=Cn(tt,e.__scopeMenu),i=so(tt,e.__scopeMenu);return y.jsx(Lr.Provider,{scope:e.__scopeMenu,children:y.jsx(jt,{present:r||s.open,children:y.jsx(Lr.Slot,{scope:e.__scopeMenu,children:i.modal?y.jsx(T0,{...o,ref:t}):y.jsx(D0,{...o,ref:t})})})})}),T0=T.forwardRef((e,t)=>{const n=Cn(tt,e.__scopeMenu),r=T.useRef(null),o=ge(t,r);return T.useEffect(()=>{const s=r.current;if(s)return nl(s)},[]),y.jsx(il,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:ne(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),D0=T.forwardRef((e,t)=>{const n=Cn(tt,e.__scopeMenu);return y.jsx(il,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),M0=wn("MenuContent.ScrollLock"),il=T.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:o,onOpenAutoFocus:s,onCloseAutoFocus:i,disableOutsidePointerEvents:a,onEntryFocus:l,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:p,onDismiss:f,disableOutsideScroll:g,...h}=e,b=Cn(tt,n),w=so(tt,n),v=Es(n),m=Lp(n),C=y0(n),[x,D]=T.useState(null),S=T.useRef(null),M=ge(t,S,b.onContentChange),P=T.useRef(0),O=T.useRef(""),_=T.useRef(0),V=T.useRef(null),G=T.useRef("right"),F=T.useRef(0),L=g?Ms:T.Fragment,k=g?{as:M0,allowPinchZoom:!0}:void 0,j=N=>{var $,q;const A=O.current+N,I=C().filter(X=>!X.disabled),B=document.activeElement,H=($=I.find(X=>X.ref.current===B))==null?void 0:$.textValue,W=I.map(X=>X.textValue),Z=L0(W,A,H),K=(q=I.find(X=>X.textValue===Z))==null?void 0:q.ref.current;(function X(U){O.current=U,window.clearTimeout(P.current),U!==""&&(P.current=window.setTimeout(()=>X(""),1e3))})(A),K&&setTimeout(()=>K.focus())};T.useEffect(()=>()=>window.clearTimeout(P.current),[]),Ga();const E=T.useCallback(N=>{var I,B;return G.current===((I=V.current)==null?void 0:I.side)&&B0(N,(B=V.current)==null?void 0:B.area)},[]);return y.jsx(R0,{scope:n,searchRef:O,onItemEnter:T.useCallback(N=>{E(N)&&N.preventDefault()},[E]),onItemLeave:T.useCallback(N=>{var A;E(N)||((A=S.current)==null||A.focus(),D(null))},[E]),onTriggerLeave:T.useCallback(N=>{E(N)&&N.preventDefault()},[E]),pointerGraceTimerRef:_,onPointerGraceIntentChange:T.useCallback(N=>{V.current=N},[]),children:y.jsx(L,{...k,children:y.jsx(ys,{asChild:!0,trapped:o,onMountAutoFocus:ne(s,N=>{var A;N.preventDefault(),(A=S.current)==null||A.focus({preventScroll:!0})}),onUnmountAutoFocus:i,children:y.jsx(eo,{asChild:!0,disableOutsidePointerEvents:a,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:p,onDismiss:f,children:y.jsx(MS,{asChild:!0,...m,dir:w.dir,orientation:"vertical",loop:r,currentTabStopId:x,onCurrentTabStopIdChange:D,onEntryFocus:ne(l,N=>{w.isUsingKeyboardRef.current||N.preventDefault()}),preventScrollOnEntryFocus:!0,children:y.jsx(Cs,{role:"menu","aria-orientation":"vertical","data-state":sh(b.open),"data-radix-menu-content":"",dir:w.dir,...v,...h,ref:M,style:{outline:"none",...h.style},onKeyDown:ne(h.onKeyDown,N=>{const I=N.target.closest("[data-radix-menu-content]")===N.currentTarget,B=N.ctrlKey||N.altKey||N.metaKey,H=N.key.length===1;I&&(N.key==="Tab"&&N.preventDefault(),!B&&H&&j(N.key));const W=S.current;if(N.target!==W||!g0.includes(N.key))return;N.preventDefault();const K=C().filter($=>!$.disabled).map($=>$.ref.current);Fp.includes(N.key)&&K.reverse(),F0(K)}),onBlur:ne(e.onBlur,N=>{N.currentTarget.contains(N.target)||(window.clearTimeout(P.current),O.current="")}),onPointerMove:ne(e.onPointerMove,$r(N=>{const A=N.target,I=F.current!==N.clientX;if(N.currentTarget.contains(A)&&I){const B=N.clientX>F.current?"right":"left";G.current=B,F.current=N.clientX}}))})})})})})})});Hp.displayName=tt;var E0="MenuGroup",al=T.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return y.jsx(ce.div,{role:"group",...r,ref:t})});al.displayName=E0;var P0="MenuLabel",Wp=T.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return y.jsx(ce.div,{...r,ref:t})});Wp.displayName=P0;var es="MenuItem",eu="menu.itemSelect",Ps=T.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...o}=e,s=T.useRef(null),i=so(es,e.__scopeMenu),a=sl(es,e.__scopeMenu),l=ge(t,s),c=T.useRef(!1),u=()=>{const d=s.current;if(!n&&d){const p=new CustomEvent(eu,{bubbles:!0,cancelable:!0});d.addEventListener(eu,f=>r==null?void 0:r(f),{once:!0}),Qf(d,p),p.defaultPrevented?c.current=!1:i.onClose()}};return y.jsx(Up,{...o,ref:l,disabled:n,onClick:ne(e.onClick,u),onPointerDown:d=>{var p;(p=e.onPointerDown)==null||p.call(e,d),c.current=!0},onPointerUp:ne(e.onPointerUp,d=>{var p;c.current||(p=d.currentTarget)==null||p.click()}),onKeyDown:ne(e.onKeyDown,d=>{const p=a.searchRef.current!=="";n||p&&d.key===" "||Xi.includes(d.key)&&(d.currentTarget.click(),d.preventDefault())})})});Ps.displayName=es;var Up=T.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:o,...s}=e,i=sl(es,n),a=Lp(n),l=T.useRef(null),c=ge(t,l),[u,d]=T.useState(!1),[p,f]=T.useState("");return T.useEffect(()=>{const g=l.current;g&&f((g.textContent??"").trim())},[s.children]),y.jsx(Lr.ItemSlot,{scope:n,disabled:r,textValue:o??p,children:y.jsx(ES,{asChild:!0,...a,focusable:!r,children:y.jsx(ce.div,{role:"menuitem","data-highlighted":u?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...s,ref:c,onPointerMove:ne(e.onPointerMove,$r(g=>{r?i.onItemLeave(g):(i.onItemEnter(g),g.defaultPrevented||g.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:ne(e.onPointerLeave,$r(g=>i.onItemLeave(g))),onFocus:ne(e.onFocus,()=>d(!0)),onBlur:ne(e.onBlur,()=>d(!1))})})})}),A0="MenuCheckboxItem",Gp=T.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...o}=e;return y.jsx(Zp,{scope:e.__scopeMenu,checked:n,children:y.jsx(Ps,{role:"menuitemcheckbox","aria-checked":ts(n)?"mixed":n,...o,ref:t,"data-state":cl(n),onSelect:ne(o.onSelect,()=>r==null?void 0:r(ts(n)?!0:!n),{checkForDefaultPrevented:!1})})})});Gp.displayName=A0;var Yp="MenuRadioGroup",[O0,_0]=Sn(Yp,{value:void 0,onValueChange:()=>{}}),Kp=T.forwardRef((e,t)=>{const{value:n,onValueChange:r,...o}=e,s=rt(r);return y.jsx(O0,{scope:e.__scopeMenu,value:n,onValueChange:s,children:y.jsx(al,{...o,ref:t})})});Kp.displayName=Yp;var qp="MenuRadioItem",Xp=T.forwardRef((e,t)=>{const{value:n,...r}=e,o=_0(qp,e.__scopeMenu),s=n===o.value;return y.jsx(Zp,{scope:e.__scopeMenu,checked:s,children:y.jsx(Ps,{role:"menuitemradio","aria-checked":s,...r,ref:t,"data-state":cl(s),onSelect:ne(r.onSelect,()=>{var i;return(i=o.onValueChange)==null?void 0:i.call(o,n)},{checkForDefaultPrevented:!1})})})});Xp.displayName=qp;var ll="MenuItemIndicator",[Zp,k0]=Sn(ll,{checked:!1}),Jp=T.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...o}=e,s=k0(ll,n);return y.jsx(jt,{present:r||ts(s.checked)||s.checked===!0,children:y.jsx(ce.span,{...o,ref:t,"data-state":cl(s.checked)})})});Jp.displayName=ll;var I0="MenuSeparator",Qp=T.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return y.jsx(ce.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});Qp.displayName=I0;var N0="MenuArrow",eh=T.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=Es(n);return y.jsx(Rs,{...o,...r,ref:t})});eh.displayName=N0;var j0="MenuSub",[k_,th]=Sn(j0),br="MenuSubTrigger",nh=T.forwardRef((e,t)=>{const n=Cn(br,e.__scopeMenu),r=so(br,e.__scopeMenu),o=th(br,e.__scopeMenu),s=sl(br,e.__scopeMenu),i=T.useRef(null),{pointerGraceTimerRef:a,onPointerGraceIntentChange:l}=s,c={__scopeMenu:e.__scopeMenu},u=T.useCallback(()=>{i.current&&window.clearTimeout(i.current),i.current=null},[]);return T.useEffect(()=>u,[u]),T.useEffect(()=>{const d=a.current;return()=>{window.clearTimeout(d),l(null)}},[a,l]),y.jsx(rl,{asChild:!0,...c,children:y.jsx(Up,{id:o.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":o.contentId,"data-state":sh(n.open),...e,ref:vs(t,o.onTriggerChange),onClick:d=>{var p;(p=e.onClick)==null||p.call(e,d),!(e.disabled||d.defaultPrevented)&&(d.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:ne(e.onPointerMove,$r(d=>{s.onItemEnter(d),!d.defaultPrevented&&!e.disabled&&!n.open&&!i.current&&(s.onPointerGraceIntentChange(null),i.current=window.setTimeout(()=>{n.onOpenChange(!0),u()},100))})),onPointerLeave:ne(e.onPointerLeave,$r(d=>{var f,g;u();const p=(f=n.content)==null?void 0:f.getBoundingClientRect();if(p){const h=(g=n.content)==null?void 0:g.dataset.side,b=h==="right",w=b?-5:5,v=p[b?"left":"right"],m=p[b?"right":"left"];s.onPointerGraceIntentChange({area:[{x:d.clientX+w,y:d.clientY},{x:v,y:p.top},{x:m,y:p.top},{x:m,y:p.bottom},{x:v,y:p.bottom}],side:h}),window.clearTimeout(a.current),a.current=window.setTimeout(()=>s.onPointerGraceIntentChange(null),300)}else{if(s.onTriggerLeave(d),d.defaultPrevented)return;s.onPointerGraceIntentChange(null)}})),onKeyDown:ne(e.onKeyDown,d=>{var f;const p=s.searchRef.current!=="";e.disabled||p&&d.key===" "||m0[r.dir].includes(d.key)&&(n.onOpenChange(!0),(f=n.content)==null||f.focus(),d.preventDefault())})})})});nh.displayName=br;var rh="MenuSubContent",oh=T.forwardRef((e,t)=>{const n=Bp(tt,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,s=Cn(tt,e.__scopeMenu),i=so(tt,e.__scopeMenu),a=th(rh,e.__scopeMenu),l=T.useRef(null),c=ge(t,l);return y.jsx(Lr.Provider,{scope:e.__scopeMenu,children:y.jsx(jt,{present:r||s.open,children:y.jsx(Lr.Slot,{scope:e.__scopeMenu,children:y.jsx(il,{id:a.contentId,"aria-labelledby":a.triggerId,...o,ref:c,align:"start",side:i.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:u=>{var d;i.isUsingKeyboardRef.current&&((d=l.current)==null||d.focus()),u.preventDefault()},onCloseAutoFocus:u=>u.preventDefault(),onFocusOutside:ne(e.onFocusOutside,u=>{u.target!==a.trigger&&s.onOpenChange(!1)}),onEscapeKeyDown:ne(e.onEscapeKeyDown,u=>{i.onClose(),u.preventDefault()}),onKeyDown:ne(e.onKeyDown,u=>{var f;const d=u.currentTarget.contains(u.target),p=v0[i.dir].includes(u.key);d&&p&&(s.onOpenChange(!1),(f=a.trigger)==null||f.focus(),u.preventDefault())})})})})})});oh.displayName=rh;function sh(e){return e?"open":"closed"}function ts(e){return e==="indeterminate"}function cl(e){return ts(e)?"indeterminate":e?"checked":"unchecked"}function F0(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function V0(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function L0(e,t,n){const o=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let i=V0(e,Math.max(s,0));o.length===1&&(i=i.filter(c=>c!==n));const l=i.find(c=>c.toLowerCase().startsWith(o.toLowerCase()));return l!==n?l:void 0}function $0(e,t){const{x:n,y:r}=e;let o=!1;for(let s=0,i=t.length-1;s<t.length;i=s++){const a=t[s].x,l=t[s].y,c=t[i].x,u=t[i].y;l>r!=u>r&&n<(c-a)*(r-l)/(u-l)+a&&(o=!o)}return o}function B0(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return $0(n,t)}function $r(e){return t=>t.pointerType==="mouse"?e(t):void 0}var z0=$p,H0=rl,W0=zp,U0=Hp,G0=al,Y0=Wp,K0=Ps,q0=Gp,X0=Kp,Z0=Xp,J0=Jp,Q0=Qp,eC=eh,tC=nh,nC=oh,ul="DropdownMenu",[rC,I_]=rn(ul,[Vp]),$e=Vp(),[oC,ih]=rC(ul),ah=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:o,defaultOpen:s,onOpenChange:i,modal:a=!0}=e,l=$e(t),c=T.useRef(null),[u=!1,d]=yn({prop:o,defaultProp:s,onChange:i});return y.jsx(oC,{scope:t,triggerId:Kt(),triggerRef:c,contentId:Kt(),open:u,onOpenChange:d,onOpenToggle:T.useCallback(()=>d(p=>!p),[d]),modal:a,children:y.jsx(z0,{...l,open:u,onOpenChange:d,dir:r,modal:a,children:n})})};ah.displayName=ul;var lh="DropdownMenuTrigger",ch=T.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...o}=e,s=ih(lh,n),i=$e(n);return y.jsx(H0,{asChild:!0,...i,children:y.jsx(ce.button,{type:"button",id:s.triggerId,"aria-haspopup":"menu","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":s.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...o,ref:vs(t,s.triggerRef),onPointerDown:ne(e.onPointerDown,a=>{!r&&a.button===0&&a.ctrlKey===!1&&(s.onOpenToggle(),s.open||a.preventDefault())}),onKeyDown:ne(e.onKeyDown,a=>{r||(["Enter"," "].includes(a.key)&&s.onOpenToggle(),a.key==="ArrowDown"&&s.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(a.key)&&a.preventDefault())})})})});ch.displayName=lh;var sC="DropdownMenuPortal",uh=e=>{const{__scopeDropdownMenu:t,...n}=e,r=$e(t);return y.jsx(W0,{...r,...n})};uh.displayName=sC;var dh="DropdownMenuContent",fh=T.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ih(dh,n),s=$e(n),i=T.useRef(!1);return y.jsx(U0,{id:o.contentId,"aria-labelledby":o.triggerId,...s,...r,ref:t,onCloseAutoFocus:ne(e.onCloseAutoFocus,a=>{var l;i.current||(l=o.triggerRef.current)==null||l.focus(),i.current=!1,a.preventDefault()}),onInteractOutside:ne(e.onInteractOutside,a=>{const l=a.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0,u=l.button===2||c;(!o.modal||u)&&(i.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});fh.displayName=dh;var iC="DropdownMenuGroup",aC=T.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=$e(n);return y.jsx(G0,{...o,...r,ref:t})});aC.displayName=iC;var lC="DropdownMenuLabel",ph=T.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=$e(n);return y.jsx(Y0,{...o,...r,ref:t})});ph.displayName=lC;var cC="DropdownMenuItem",hh=T.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=$e(n);return y.jsx(K0,{...o,...r,ref:t})});hh.displayName=cC;var uC="DropdownMenuCheckboxItem",gh=T.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=$e(n);return y.jsx(q0,{...o,...r,ref:t})});gh.displayName=uC;var dC="DropdownMenuRadioGroup",fC=T.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=$e(n);return y.jsx(X0,{...o,...r,ref:t})});fC.displayName=dC;var pC="DropdownMenuRadioItem",hC=T.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=$e(n);return y.jsx(Z0,{...o,...r,ref:t})});hC.displayName=pC;var gC="DropdownMenuItemIndicator",mh=T.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=$e(n);return y.jsx(J0,{...o,...r,ref:t})});mh.displayName=gC;var mC="DropdownMenuSeparator",vh=T.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=$e(n);return y.jsx(Q0,{...o,...r,ref:t})});vh.displayName=mC;var vC="DropdownMenuArrow",yC=T.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=$e(n);return y.jsx(eC,{...o,...r,ref:t})});yC.displayName=vC;var wC="DropdownMenuSubTrigger",xC=T.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=$e(n);return y.jsx(tC,{...o,...r,ref:t})});xC.displayName=wC;var bC="DropdownMenuSubContent",SC=T.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=$e(n);return y.jsx(nC,{...o,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});SC.displayName=bC;var CC=ah,RC=ch,TC=uh,DC=fh,MC=ph,EC=hh,PC=gh,AC=mh,OC=vh;function yh(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=yh(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function wh(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=yh(e))&&(r&&(r+=" "),r+=t);return r}const dl="-",_C=e=>{const t=IC(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:i=>{const a=i.split(dl);return a[0]===""&&a.length!==1&&a.shift(),xh(a,t)||kC(i)},getConflictingClassGroupIds:(i,a)=>{const l=n[i]||[];return a&&r[i]?[...l,...r[i]]:l}}},xh=(e,t)=>{var i;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),o=r?xh(e.slice(1),r):void 0;if(o)return o;if(t.validators.length===0)return;const s=e.join(dl);return(i=t.validators.find(({validator:a})=>a(s)))==null?void 0:i.classGroupId},tu=/^\[(.+)\]$/,kC=e=>{if(tu.test(e)){const t=tu.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},IC=e=>{const{theme:t,classGroups:n}=e,r={nextPart:new Map,validators:[]};for(const o in n)Zi(n[o],r,o,t);return r},Zi=(e,t,n,r)=>{e.forEach(o=>{if(typeof o=="string"){const s=o===""?t:nu(t,o);s.classGroupId=n;return}if(typeof o=="function"){if(NC(o)){Zi(o(r),t,n,r);return}t.validators.push({validator:o,classGroupId:n});return}Object.entries(o).forEach(([s,i])=>{Zi(i,nu(t,s),n,r)})})},nu=(e,t)=>{let n=e;return t.split(dl).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},NC=e=>e.isThemeGetter,jC=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const o=(s,i)=>{n.set(s,i),t++,t>e&&(t=0,r=n,n=new Map)};return{get(s){let i=n.get(s);if(i!==void 0)return i;if((i=r.get(s))!==void 0)return o(s,i),i},set(s,i){n.has(s)?n.set(s,i):o(s,i)}}},Ji="!",Qi=":",FC=Qi.length,VC=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=o=>{const s=[];let i=0,a=0,l=0,c;for(let g=0;g<o.length;g++){let h=o[g];if(i===0&&a===0){if(h===Qi){s.push(o.slice(l,g)),l=g+FC;continue}if(h==="/"){c=g;continue}}h==="["?i++:h==="]"?i--:h==="("?a++:h===")"&&a--}const u=s.length===0?o:o.substring(l),d=LC(u),p=d!==u,f=c&&c>l?c-l:void 0;return{modifiers:s,hasImportantModifier:p,baseClassName:d,maybePostfixModifierPosition:f}};if(t){const o=t+Qi,s=r;r=i=>i.startsWith(o)?s(i.substring(o.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:i,maybePostfixModifierPosition:void 0}}if(n){const o=r;r=s=>n({className:s,parseClassName:o})}return r},LC=e=>e.endsWith(Ji)?e.substring(0,e.length-1):e.startsWith(Ji)?e.substring(1):e,$C=e=>{const t=Object.fromEntries(e.orderSensitiveModifiers.map(r=>[r,!0]));return r=>{if(r.length<=1)return r;const o=[];let s=[];return r.forEach(i=>{i[0]==="["||t[i]?(o.push(...s.sort(),i),s=[]):s.push(i)}),o.push(...s.sort()),o}},BC=e=>({cache:jC(e.cacheSize),parseClassName:VC(e),sortModifiers:$C(e),..._C(e)}),zC=/\s+/,HC=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o,sortModifiers:s}=t,i=[],a=e.trim().split(zC);let l="";for(let c=a.length-1;c>=0;c-=1){const u=a[c],{isExternal:d,modifiers:p,hasImportantModifier:f,baseClassName:g,maybePostfixModifierPosition:h}=n(u);if(d){l=u+(l.length>0?" "+l:l);continue}let b=!!h,w=r(b?g.substring(0,h):g);if(!w){if(!b){l=u+(l.length>0?" "+l:l);continue}if(w=r(g),!w){l=u+(l.length>0?" "+l:l);continue}b=!1}const v=s(p).join(":"),m=f?v+Ji:v,C=m+w;if(i.includes(C))continue;i.push(C);const x=o(w,b);for(let D=0;D<x.length;++D){const S=x[D];i.push(m+S)}l=u+(l.length>0?" "+l:l)}return l};function WC(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=bh(t))&&(r&&(r+=" "),r+=n);return r}const bh=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=bh(e[r]))&&(n&&(n+=" "),n+=t);return n};function UC(e,...t){let n,r,o,s=i;function i(l){const c=t.reduce((u,d)=>d(u),e());return n=BC(c),r=n.cache.get,o=n.cache.set,s=a,a(l)}function a(l){const c=r(l);if(c)return c;const u=HC(l,n);return o(l,u),u}return function(){return s(WC.apply(null,arguments))}}const Re=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},Sh=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Ch=/^\((?:(\w[\w-]*):)?(.+)\)$/i,GC=/^\d+\/\d+$/,YC=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,KC=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,qC=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,XC=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,ZC=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,On=e=>GC.test(e),ae=e=>!!e&&!Number.isNaN(Number(e)),Bt=e=>!!e&&Number.isInteger(Number(e)),ci=e=>e.endsWith("%")&&ae(e.slice(0,-1)),Dt=e=>YC.test(e),JC=()=>!0,QC=e=>KC.test(e)&&!qC.test(e),Rh=()=>!1,eR=e=>XC.test(e),tR=e=>ZC.test(e),nR=e=>!Q(e)&&!ee(e),rR=e=>er(e,Mh,Rh),Q=e=>Sh.test(e),dn=e=>er(e,Eh,QC),ui=e=>er(e,lR,ae),ru=e=>er(e,Th,Rh),oR=e=>er(e,Dh,tR),xo=e=>er(e,Ph,eR),ee=e=>Ch.test(e),fr=e=>tr(e,Eh),sR=e=>tr(e,cR),ou=e=>tr(e,Th),iR=e=>tr(e,Mh),aR=e=>tr(e,Dh),bo=e=>tr(e,Ph,!0),er=(e,t,n)=>{const r=Sh.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},tr=(e,t,n=!1)=>{const r=Ch.exec(e);return r?r[1]?t(r[1]):n:!1},Th=e=>e==="position"||e==="percentage",Dh=e=>e==="image"||e==="url",Mh=e=>e==="length"||e==="size"||e==="bg-size",Eh=e=>e==="length",lR=e=>e==="number",cR=e=>e==="family-name",Ph=e=>e==="shadow",uR=()=>{const e=Re("color"),t=Re("font"),n=Re("text"),r=Re("font-weight"),o=Re("tracking"),s=Re("leading"),i=Re("breakpoint"),a=Re("container"),l=Re("spacing"),c=Re("radius"),u=Re("shadow"),d=Re("inset-shadow"),p=Re("text-shadow"),f=Re("drop-shadow"),g=Re("blur"),h=Re("perspective"),b=Re("aspect"),w=Re("ease"),v=Re("animate"),m=()=>["auto","avoid","all","avoid-page","page","left","right","column"],C=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],x=()=>[...C(),ee,Q],D=()=>["auto","hidden","clip","visible","scroll"],S=()=>["auto","contain","none"],M=()=>[ee,Q,l],P=()=>[On,"full","auto",...M()],O=()=>[Bt,"none","subgrid",ee,Q],_=()=>["auto",{span:["full",Bt,ee,Q]},Bt,ee,Q],V=()=>[Bt,"auto",ee,Q],G=()=>["auto","min","max","fr",ee,Q],F=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],L=()=>["start","end","center","stretch","center-safe","end-safe"],k=()=>["auto",...M()],j=()=>[On,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...M()],E=()=>[e,ee,Q],N=()=>[...C(),ou,ru,{position:[ee,Q]}],A=()=>["no-repeat",{repeat:["","x","y","space","round"]}],I=()=>["auto","cover","contain",iR,rR,{size:[ee,Q]}],B=()=>[ci,fr,dn],H=()=>["","none","full",c,ee,Q],W=()=>["",ae,fr,dn],Z=()=>["solid","dashed","dotted","double"],K=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],$=()=>[ae,ci,ou,ru],q=()=>["","none",g,ee,Q],X=()=>["none",ae,ee,Q],U=()=>["none",ae,ee,Q],te=()=>[ae,ee,Q],z=()=>[On,"full",...M()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Dt],breakpoint:[Dt],color:[JC],container:[Dt],"drop-shadow":[Dt],ease:["in","out","in-out"],font:[nR],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Dt],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Dt],shadow:[Dt],spacing:["px",ae],text:[Dt],"text-shadow":[Dt],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",On,Q,ee,b]}],container:["container"],columns:[{columns:[ae,Q,ee,a]}],"break-after":[{"break-after":m()}],"break-before":[{"break-before":m()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:x()}],overflow:[{overflow:D()}],"overflow-x":[{"overflow-x":D()}],"overflow-y":[{"overflow-y":D()}],overscroll:[{overscroll:S()}],"overscroll-x":[{"overscroll-x":S()}],"overscroll-y":[{"overscroll-y":S()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:P()}],"inset-x":[{"inset-x":P()}],"inset-y":[{"inset-y":P()}],start:[{start:P()}],end:[{end:P()}],top:[{top:P()}],right:[{right:P()}],bottom:[{bottom:P()}],left:[{left:P()}],visibility:["visible","invisible","collapse"],z:[{z:[Bt,"auto",ee,Q]}],basis:[{basis:[On,"full","auto",a,...M()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[ae,On,"auto","initial","none",Q]}],grow:[{grow:["",ae,ee,Q]}],shrink:[{shrink:["",ae,ee,Q]}],order:[{order:[Bt,"first","last","none",ee,Q]}],"grid-cols":[{"grid-cols":O()}],"col-start-end":[{col:_()}],"col-start":[{"col-start":V()}],"col-end":[{"col-end":V()}],"grid-rows":[{"grid-rows":O()}],"row-start-end":[{row:_()}],"row-start":[{"row-start":V()}],"row-end":[{"row-end":V()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":G()}],"auto-rows":[{"auto-rows":G()}],gap:[{gap:M()}],"gap-x":[{"gap-x":M()}],"gap-y":[{"gap-y":M()}],"justify-content":[{justify:[...F(),"normal"]}],"justify-items":[{"justify-items":[...L(),"normal"]}],"justify-self":[{"justify-self":["auto",...L()]}],"align-content":[{content:["normal",...F()]}],"align-items":[{items:[...L(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...L(),{baseline:["","last"]}]}],"place-content":[{"place-content":F()}],"place-items":[{"place-items":[...L(),"baseline"]}],"place-self":[{"place-self":["auto",...L()]}],p:[{p:M()}],px:[{px:M()}],py:[{py:M()}],ps:[{ps:M()}],pe:[{pe:M()}],pt:[{pt:M()}],pr:[{pr:M()}],pb:[{pb:M()}],pl:[{pl:M()}],m:[{m:k()}],mx:[{mx:k()}],my:[{my:k()}],ms:[{ms:k()}],me:[{me:k()}],mt:[{mt:k()}],mr:[{mr:k()}],mb:[{mb:k()}],ml:[{ml:k()}],"space-x":[{"space-x":M()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":M()}],"space-y-reverse":["space-y-reverse"],size:[{size:j()}],w:[{w:[a,"screen",...j()]}],"min-w":[{"min-w":[a,"screen","none",...j()]}],"max-w":[{"max-w":[a,"screen","none","prose",{screen:[i]},...j()]}],h:[{h:["screen",...j()]}],"min-h":[{"min-h":["screen","none",...j()]}],"max-h":[{"max-h":["screen",...j()]}],"font-size":[{text:["base",n,fr,dn]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,ee,ui]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",ci,Q]}],"font-family":[{font:[sR,Q,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[o,ee,Q]}],"line-clamp":[{"line-clamp":[ae,"none",ee,ui]}],leading:[{leading:[s,...M()]}],"list-image":[{"list-image":["none",ee,Q]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",ee,Q]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:E()}],"text-color":[{text:E()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Z(),"wavy"]}],"text-decoration-thickness":[{decoration:[ae,"from-font","auto",ee,dn]}],"text-decoration-color":[{decoration:E()}],"underline-offset":[{"underline-offset":[ae,"auto",ee,Q]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:M()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ee,Q]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",ee,Q]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:N()}],"bg-repeat":[{bg:A()}],"bg-size":[{bg:I()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Bt,ee,Q],radial:["",ee,Q],conic:[Bt,ee,Q]},aR,oR]}],"bg-color":[{bg:E()}],"gradient-from-pos":[{from:B()}],"gradient-via-pos":[{via:B()}],"gradient-to-pos":[{to:B()}],"gradient-from":[{from:E()}],"gradient-via":[{via:E()}],"gradient-to":[{to:E()}],rounded:[{rounded:H()}],"rounded-s":[{"rounded-s":H()}],"rounded-e":[{"rounded-e":H()}],"rounded-t":[{"rounded-t":H()}],"rounded-r":[{"rounded-r":H()}],"rounded-b":[{"rounded-b":H()}],"rounded-l":[{"rounded-l":H()}],"rounded-ss":[{"rounded-ss":H()}],"rounded-se":[{"rounded-se":H()}],"rounded-ee":[{"rounded-ee":H()}],"rounded-es":[{"rounded-es":H()}],"rounded-tl":[{"rounded-tl":H()}],"rounded-tr":[{"rounded-tr":H()}],"rounded-br":[{"rounded-br":H()}],"rounded-bl":[{"rounded-bl":H()}],"border-w":[{border:W()}],"border-w-x":[{"border-x":W()}],"border-w-y":[{"border-y":W()}],"border-w-s":[{"border-s":W()}],"border-w-e":[{"border-e":W()}],"border-w-t":[{"border-t":W()}],"border-w-r":[{"border-r":W()}],"border-w-b":[{"border-b":W()}],"border-w-l":[{"border-l":W()}],"divide-x":[{"divide-x":W()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":W()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...Z(),"hidden","none"]}],"divide-style":[{divide:[...Z(),"hidden","none"]}],"border-color":[{border:E()}],"border-color-x":[{"border-x":E()}],"border-color-y":[{"border-y":E()}],"border-color-s":[{"border-s":E()}],"border-color-e":[{"border-e":E()}],"border-color-t":[{"border-t":E()}],"border-color-r":[{"border-r":E()}],"border-color-b":[{"border-b":E()}],"border-color-l":[{"border-l":E()}],"divide-color":[{divide:E()}],"outline-style":[{outline:[...Z(),"none","hidden"]}],"outline-offset":[{"outline-offset":[ae,ee,Q]}],"outline-w":[{outline:["",ae,fr,dn]}],"outline-color":[{outline:E()}],shadow:[{shadow:["","none",u,bo,xo]}],"shadow-color":[{shadow:E()}],"inset-shadow":[{"inset-shadow":["none",d,bo,xo]}],"inset-shadow-color":[{"inset-shadow":E()}],"ring-w":[{ring:W()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:E()}],"ring-offset-w":[{"ring-offset":[ae,dn]}],"ring-offset-color":[{"ring-offset":E()}],"inset-ring-w":[{"inset-ring":W()}],"inset-ring-color":[{"inset-ring":E()}],"text-shadow":[{"text-shadow":["none",p,bo,xo]}],"text-shadow-color":[{"text-shadow":E()}],opacity:[{opacity:[ae,ee,Q]}],"mix-blend":[{"mix-blend":[...K(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":K()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[ae]}],"mask-image-linear-from-pos":[{"mask-linear-from":$()}],"mask-image-linear-to-pos":[{"mask-linear-to":$()}],"mask-image-linear-from-color":[{"mask-linear-from":E()}],"mask-image-linear-to-color":[{"mask-linear-to":E()}],"mask-image-t-from-pos":[{"mask-t-from":$()}],"mask-image-t-to-pos":[{"mask-t-to":$()}],"mask-image-t-from-color":[{"mask-t-from":E()}],"mask-image-t-to-color":[{"mask-t-to":E()}],"mask-image-r-from-pos":[{"mask-r-from":$()}],"mask-image-r-to-pos":[{"mask-r-to":$()}],"mask-image-r-from-color":[{"mask-r-from":E()}],"mask-image-r-to-color":[{"mask-r-to":E()}],"mask-image-b-from-pos":[{"mask-b-from":$()}],"mask-image-b-to-pos":[{"mask-b-to":$()}],"mask-image-b-from-color":[{"mask-b-from":E()}],"mask-image-b-to-color":[{"mask-b-to":E()}],"mask-image-l-from-pos":[{"mask-l-from":$()}],"mask-image-l-to-pos":[{"mask-l-to":$()}],"mask-image-l-from-color":[{"mask-l-from":E()}],"mask-image-l-to-color":[{"mask-l-to":E()}],"mask-image-x-from-pos":[{"mask-x-from":$()}],"mask-image-x-to-pos":[{"mask-x-to":$()}],"mask-image-x-from-color":[{"mask-x-from":E()}],"mask-image-x-to-color":[{"mask-x-to":E()}],"mask-image-y-from-pos":[{"mask-y-from":$()}],"mask-image-y-to-pos":[{"mask-y-to":$()}],"mask-image-y-from-color":[{"mask-y-from":E()}],"mask-image-y-to-color":[{"mask-y-to":E()}],"mask-image-radial":[{"mask-radial":[ee,Q]}],"mask-image-radial-from-pos":[{"mask-radial-from":$()}],"mask-image-radial-to-pos":[{"mask-radial-to":$()}],"mask-image-radial-from-color":[{"mask-radial-from":E()}],"mask-image-radial-to-color":[{"mask-radial-to":E()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":C()}],"mask-image-conic-pos":[{"mask-conic":[ae]}],"mask-image-conic-from-pos":[{"mask-conic-from":$()}],"mask-image-conic-to-pos":[{"mask-conic-to":$()}],"mask-image-conic-from-color":[{"mask-conic-from":E()}],"mask-image-conic-to-color":[{"mask-conic-to":E()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:N()}],"mask-repeat":[{mask:A()}],"mask-size":[{mask:I()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",ee,Q]}],filter:[{filter:["","none",ee,Q]}],blur:[{blur:q()}],brightness:[{brightness:[ae,ee,Q]}],contrast:[{contrast:[ae,ee,Q]}],"drop-shadow":[{"drop-shadow":["","none",f,bo,xo]}],"drop-shadow-color":[{"drop-shadow":E()}],grayscale:[{grayscale:["",ae,ee,Q]}],"hue-rotate":[{"hue-rotate":[ae,ee,Q]}],invert:[{invert:["",ae,ee,Q]}],saturate:[{saturate:[ae,ee,Q]}],sepia:[{sepia:["",ae,ee,Q]}],"backdrop-filter":[{"backdrop-filter":["","none",ee,Q]}],"backdrop-blur":[{"backdrop-blur":q()}],"backdrop-brightness":[{"backdrop-brightness":[ae,ee,Q]}],"backdrop-contrast":[{"backdrop-contrast":[ae,ee,Q]}],"backdrop-grayscale":[{"backdrop-grayscale":["",ae,ee,Q]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[ae,ee,Q]}],"backdrop-invert":[{"backdrop-invert":["",ae,ee,Q]}],"backdrop-opacity":[{"backdrop-opacity":[ae,ee,Q]}],"backdrop-saturate":[{"backdrop-saturate":[ae,ee,Q]}],"backdrop-sepia":[{"backdrop-sepia":["",ae,ee,Q]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":M()}],"border-spacing-x":[{"border-spacing-x":M()}],"border-spacing-y":[{"border-spacing-y":M()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",ee,Q]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[ae,"initial",ee,Q]}],ease:[{ease:["linear","initial",w,ee,Q]}],delay:[{delay:[ae,ee,Q]}],animate:[{animate:["none",v,ee,Q]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[h,ee,Q]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:X()}],"rotate-x":[{"rotate-x":X()}],"rotate-y":[{"rotate-y":X()}],"rotate-z":[{"rotate-z":X()}],scale:[{scale:U()}],"scale-x":[{"scale-x":U()}],"scale-y":[{"scale-y":U()}],"scale-z":[{"scale-z":U()}],"scale-3d":["scale-3d"],skew:[{skew:te()}],"skew-x":[{"skew-x":te()}],"skew-y":[{"skew-y":te()}],transform:[{transform:[ee,Q,"","none","gpu","cpu"]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:z()}],"translate-x":[{"translate-x":z()}],"translate-y":[{"translate-y":z()}],"translate-z":[{"translate-z":z()}],"translate-none":["translate-none"],accent:[{accent:E()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:E()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",ee,Q]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":M()}],"scroll-mx":[{"scroll-mx":M()}],"scroll-my":[{"scroll-my":M()}],"scroll-ms":[{"scroll-ms":M()}],"scroll-me":[{"scroll-me":M()}],"scroll-mt":[{"scroll-mt":M()}],"scroll-mr":[{"scroll-mr":M()}],"scroll-mb":[{"scroll-mb":M()}],"scroll-ml":[{"scroll-ml":M()}],"scroll-p":[{"scroll-p":M()}],"scroll-px":[{"scroll-px":M()}],"scroll-py":[{"scroll-py":M()}],"scroll-ps":[{"scroll-ps":M()}],"scroll-pe":[{"scroll-pe":M()}],"scroll-pt":[{"scroll-pt":M()}],"scroll-pr":[{"scroll-pr":M()}],"scroll-pb":[{"scroll-pb":M()}],"scroll-pl":[{"scroll-pl":M()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",ee,Q]}],fill:[{fill:["none",...E()]}],"stroke-w":[{stroke:[ae,fr,dn,ui]}],stroke:[{stroke:["none",...E()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},dR=UC(uR);function he(...e){return dR(wh(e))}function fl({...e}){return y.jsx(CC,{"data-slot":"dropdown-menu",...e})}function pl({...e}){return y.jsx(RC,{"data-slot":"dropdown-menu-trigger",...e})}function hl({className:e,sideOffset:t=4,...n}){return y.jsx(TC,{children:y.jsx(DC,{"data-slot":"dropdown-menu-content",sideOffset:t,style:{zIndex:100},className:he("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",e),...n})})}function su({className:e,inset:t,variant:n="default",...r}){return y.jsx(EC,{"data-slot":"dropdown-menu-item","data-inset":t,"data-variant":n,className:he("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...r})}function fR({className:e,children:t,checked:n,...r}){return y.jsxs(PC,{"data-slot":"dropdown-menu-checkbox-item",className:he("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),checked:n,...r,children:[y.jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:y.jsx(AC,{children:y.jsx(Kf,{className:"size-4"})})}),t]})}function pR({className:e,inset:t,...n}){return y.jsx(MC,{"data-slot":"dropdown-menu-label","data-inset":t,className:he("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",e),...n})}function hR({className:e,...t}){return y.jsx(OC,{"data-slot":"dropdown-menu-separator",className:he("bg-border -mx-1 my-1 h-px",e),...t})}var gR="Label",Ah=T.forwardRef((e,t)=>y.jsx(ce.label,{...e,ref:t,onMouseDown:n=>{var o;n.target.closest("button, input, select, textarea")||((o=e.onMouseDown)==null||o.call(e,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));Ah.displayName=gR;var mR=Ah;function vR({className:e,...t}){return y.jsx(mR,{"data-slot":"label",className:he("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...t})}const yR=({onClose:e,side:t,onOpenChange:n,buttonTrigger:r,modal:o,children:s})=>{const[i,a]=R.useState({x:0,y:0}),l=bt(ms(h=>h.updateIsDragging)),{attributes:c,listeners:u,setNodeRef:d,transform:p,setActivatorNodeRef:f}=za({id:"booking_info",data:{type:"another"}}),g={transform:`translate3d(${i.x+((p==null?void 0:p.x)||0)}px, ${i.y+((p==null?void 0:p.y)||0)}px, 0)`};return Zr({onDragStart(){l(!0)},onDragEnd(h){if(h.active.id){const{y:b,x:w}=i;a({x:w+((p==null?void 0:p.x)||0),y:b+((p==null?void 0:p.y)||0)}),l(!1)}}}),y.jsxs(fl,{dir:"ltr",modal:o,open:!0,onOpenChange:n,children:[y.jsx(pl,{asChild:!0,children:r||y.jsx("div",{})}),y.jsxs(hl,{ref:d,style:{...g,zIndex:100,width:"25rem"},forceMount:!0,avoidCollisions:!0,side:t,sticky:"always",updatePositionStrategy:"always",...c,children:[y.jsxs("div",{className:"dropdownLabelContent",children:[y.jsx(vR,{ref:f,className:"dropdownLabelContent_dropdownLabel",...u,children:"Agendamento"}),y.jsx(Ox,{className:"dropdownLabelContent_close",onClick:e})]}),s]})]})},Oh=({modal:e=!1,side:t,onClose:n,slotTrigger:r,onOpenChange:o,buttonTrigger:s,ref:i})=>{const[a,l]=R.useState(!1),{createBookingModal:c}=nn(),u=()=>{var p;l(!1),(p=r==null?void 0:r())==null||p.closeEvent(),n==null||n()},d=p=>{var f;l(p),(f=r==null?void 0:r())==null||f.onOpenChange(p),o==null||o(p)};return R.useImperativeHandle(i,()=>({showCreationModal:()=>l(!0),closeModal:()=>l(!1),isModalOpen:()=>a})),y.jsx(y.Fragment,{children:a&&y.jsx(Ba,{children:y.jsx(yR,{modal:e,side:t,onClose:u,onOpenChange:d,buttonTrigger:s,children:c})})})};function wR(e,t,n){const r={...e};return t.top+e.y<=n.top?r.y=n.top-t.top:t.bottom+e.y>=n.top+n.height&&(r.y=n.top+n.height-t.bottom),t.left+e.x<=n.left?r.x=n.left-t.left:t.right+e.x>=n.left+n.width&&(r.x=n.left+n.width-t.right),r}const xR=e=>{let{transform:t,draggingNodeRect:n,windowRect:r}=e;return!n||!r?t:wR(t,n,r)},bR=e=>{let{activatorEvent:t,draggingNodeRect:n,transform:r}=e;if(n&&t){const o=Ir(t);if(!o)return r;const s=o.x-n.left,i=o.y-n.top;return{...r,x:r.x+s-n.width/2,y:r.y+i-n.height/2}}return r},SR={id:"user-123",profile:{id:"profile-123",name:"Diego",color:"#14b8a6",email:"jane.smith@example.com"},createdAt:new Date,updatedAt:new Date},_h=R.createContext({});function CR(e){const t=R.useRef(null);return t.current===null&&(t.current=e()),t.current}const gl=typeof window<"u",RR=gl?R.useLayoutEffect:R.useEffect,ml=R.createContext(null);function vl(e,t){e.indexOf(t)===-1&&e.push(t)}function yl(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}const kt=(e,t,n)=>n>t?t:n<e?e:n;let nr=()=>{},It=()=>{};process.env.NODE_ENV!=="production"&&(nr=(e,t)=>{!e&&typeof console<"u"&&console.warn(t)},It=(e,t)=>{if(!e)throw new Error(t)});const Nt={},kh=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function Ih(e){return typeof e=="object"&&e!==null}const Nh=e=>/^0[^.\s]+$/u.test(e);function wl(e){let t;return()=>(t===void 0&&(t=e()),t)}const nt=e=>e,TR=(e,t)=>n=>t(e(n)),io=(...e)=>e.reduce(TR),Br=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r};class xl{constructor(){this.subscriptions=[]}add(t){return vl(this.subscriptions,t),()=>yl(this.subscriptions,t)}notify(t,n,r){const o=this.subscriptions.length;if(o)if(o===1)this.subscriptions[0](t,n,r);else for(let s=0;s<o;s++){const i=this.subscriptions[s];i&&i(t,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const at=e=>e*1e3,wt=e=>e/1e3;function jh(e,t){return t?e*(1e3/t):0}const iu=new Set;function bl(e,t,n){e||iu.has(t)||(console.warn(t),iu.add(t))}const Fh=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,DR=1e-7,MR=12;function ER(e,t,n,r,o){let s,i,a=0;do i=t+(n-t)/2,s=Fh(i,r,o)-e,s>0?n=i:t=i;while(Math.abs(s)>DR&&++a<MR);return i}function ao(e,t,n,r){if(e===t&&n===r)return nt;const o=s=>ER(s,0,1,e,n);return s=>s===0||s===1?s:Fh(o(s),t,r)}const Vh=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,Lh=e=>t=>1-e(1-t),$h=ao(.33,1.53,.69,.99),Sl=Lh($h),Bh=Vh(Sl),zh=e=>(e*=2)<1?.5*Sl(e):.5*(2-Math.pow(2,-10*(e-1))),Cl=e=>1-Math.sin(Math.acos(e)),Hh=Lh(Cl),Wh=Vh(Cl),PR=ao(.42,0,1,1),AR=ao(0,0,.58,1),Uh=ao(.42,0,.58,1),OR=e=>Array.isArray(e)&&typeof e[0]!="number",Gh=e=>Array.isArray(e)&&typeof e[0]=="number",au={linear:nt,easeIn:PR,easeInOut:Uh,easeOut:AR,circIn:Cl,circInOut:Wh,circOut:Hh,backIn:Sl,backInOut:Bh,backOut:$h,anticipate:zh},_R=e=>typeof e=="string",lu=e=>{if(Gh(e)){It(e.length===4,"Cubic bezier arrays must contain four numerical values.");const[t,n,r,o]=e;return ao(t,n,r,o)}else if(_R(e))return It(au[e]!==void 0,`Invalid easing type '${e}'`),au[e];return e},So=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"],cu={value:null};function kR(e,t){let n=new Set,r=new Set,o=!1,s=!1;const i=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1},l=0;function c(d){i.has(d)&&(u.schedule(d),e()),l++,d(a)}const u={schedule:(d,p=!1,f=!1)=>{const h=f&&o?n:r;return p&&i.add(d),h.has(d)||h.add(d),d},cancel:d=>{r.delete(d),i.delete(d)},process:d=>{if(a=d,o){s=!0;return}o=!0,[n,r]=[r,n],n.forEach(c),t&&cu.value&&cu.value.frameloop[t].push(l),l=0,n.clear(),o=!1,s&&(s=!1,u.process(d))}};return u}const IR=40;function Yh(e,t){let n=!1,r=!0;const o={delta:0,timestamp:0,isProcessing:!1},s=()=>n=!0,i=So.reduce((m,C)=>(m[C]=kR(s,t?C:void 0),m),{}),{setup:a,read:l,resolveKeyframes:c,preUpdate:u,update:d,preRender:p,render:f,postRender:g}=i,h=()=>{const m=Nt.useManualTiming?o.timestamp:performance.now();n=!1,Nt.useManualTiming||(o.delta=r?1e3/60:Math.max(Math.min(m-o.timestamp,IR),1)),o.timestamp=m,o.isProcessing=!0,a.process(o),l.process(o),c.process(o),u.process(o),d.process(o),p.process(o),f.process(o),g.process(o),o.isProcessing=!1,n&&t&&(r=!1,e(h))},b=()=>{n=!0,r=!0,o.isProcessing||e(h)};return{schedule:So.reduce((m,C)=>{const x=i[C];return m[C]=(D,S=!1,M=!1)=>(n||b(),x.schedule(D,S,M)),m},{}),cancel:m=>{for(let C=0;C<So.length;C++)i[So[C]].cancel(m)},state:o,steps:i}}const{schedule:xe,cancel:Jt,state:Ae,steps:di}=Yh(typeof requestAnimationFrame<"u"?requestAnimationFrame:nt,!0);let Vo;function NR(){Vo=void 0}const ze={now:()=>(Vo===void 0&&ze.set(Ae.isProcessing||Nt.useManualTiming?Ae.timestamp:performance.now()),Vo),set:e=>{Vo=e,queueMicrotask(NR)}},Kh=e=>t=>typeof t=="string"&&t.startsWith(e),Rl=Kh("--"),jR=Kh("var(--"),Tl=e=>jR(e)?FR.test(e.split("/*")[0].trim()):!1,FR=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,rr={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},zr={...rr,transform:e=>kt(0,1,e)},Co={...rr,default:1},Mr=e=>Math.round(e*1e5)/1e5,Dl=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function VR(e){return e==null}const LR=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Ml=(e,t)=>n=>!!(typeof n=="string"&&LR.test(n)&&n.startsWith(e)||t&&!VR(n)&&Object.prototype.hasOwnProperty.call(n,t)),qh=(e,t,n)=>r=>{if(typeof r!="string")return r;const[o,s,i,a]=r.match(Dl);return{[e]:parseFloat(o),[t]:parseFloat(s),[n]:parseFloat(i),alpha:a!==void 0?parseFloat(a):1}},$R=e=>kt(0,255,e),fi={...rr,transform:e=>Math.round($R(e))},hn={test:Ml("rgb","red"),parse:qh("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+fi.transform(e)+", "+fi.transform(t)+", "+fi.transform(n)+", "+Mr(zr.transform(r))+")"};function BR(e){let t="",n="",r="",o="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),o=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),o=e.substring(4,5),t+=t,n+=n,r+=r,o+=o),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:o?parseInt(o,16)/255:1}}const ea={test:Ml("#"),parse:BR,transform:hn.transform},lo=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Ut=lo("deg"),xt=lo("%"),re=lo("px"),zR=lo("vh"),HR=lo("vw"),uu={...xt,parse:e=>xt.parse(e)/100,transform:e=>xt.transform(e*100)},_n={test:Ml("hsl","hue"),parse:qh("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+xt.transform(Mr(t))+", "+xt.transform(Mr(n))+", "+Mr(zr.transform(r))+")"},Ne={test:e=>hn.test(e)||ea.test(e)||_n.test(e),parse:e=>hn.test(e)?hn.parse(e):_n.test(e)?_n.parse(e):ea.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?hn.transform(e):_n.transform(e)},WR=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function UR(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(Dl))==null?void 0:t.length)||0)+(((n=e.match(WR))==null?void 0:n.length)||0)>0}const Xh="number",Zh="color",GR="var",YR="var(",du="${}",KR=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Hr(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},o=[];let s=0;const a=t.replace(KR,l=>(Ne.test(l)?(r.color.push(s),o.push(Zh),n.push(Ne.parse(l))):l.startsWith(YR)?(r.var.push(s),o.push(GR),n.push(l)):(r.number.push(s),o.push(Xh),n.push(parseFloat(l))),++s,du)).split(du);return{values:n,split:a,indexes:r,types:o}}function Jh(e){return Hr(e).values}function Qh(e){const{split:t,types:n}=Hr(e),r=t.length;return o=>{let s="";for(let i=0;i<r;i++)if(s+=t[i],o[i]!==void 0){const a=n[i];a===Xh?s+=Mr(o[i]):a===Zh?s+=Ne.transform(o[i]):s+=o[i]}return s}}const qR=e=>typeof e=="number"?0:e;function XR(e){const t=Jh(e);return Qh(e)(t.map(qR))}const Qt={test:UR,parse:Jh,createTransformer:Qh,getAnimatableNone:XR};function pi(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function ZR({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let o=0,s=0,i=0;if(!t)o=s=i=n;else{const a=n<.5?n*(1+t):n+t-n*t,l=2*n-a;o=pi(l,a,e+1/3),s=pi(l,a,e),i=pi(l,a,e-1/3)}return{red:Math.round(o*255),green:Math.round(s*255),blue:Math.round(i*255),alpha:r}}function ns(e,t){return n=>n>0?t:e}const we=(e,t,n)=>e+(t-e)*n,hi=(e,t,n)=>{const r=e*e,o=n*(t*t-r)+r;return o<0?0:Math.sqrt(o)},JR=[ea,hn,_n],QR=e=>JR.find(t=>t.test(e));function fu(e){const t=QR(e);if(nr(!!t,`'${e}' is not an animatable color. Use the equivalent color code instead.`),!t)return!1;let n=t.parse(e);return t===_n&&(n=ZR(n)),n}const pu=(e,t)=>{const n=fu(e),r=fu(t);if(!n||!r)return ns(e,t);const o={...n};return s=>(o.red=hi(n.red,r.red,s),o.green=hi(n.green,r.green,s),o.blue=hi(n.blue,r.blue,s),o.alpha=we(n.alpha,r.alpha,s),hn.transform(o))},ta=new Set(["none","hidden"]);function eT(e,t){return ta.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function tT(e,t){return n=>we(e,t,n)}function El(e){return typeof e=="number"?tT:typeof e=="string"?Tl(e)?ns:Ne.test(e)?pu:oT:Array.isArray(e)?eg:typeof e=="object"?Ne.test(e)?pu:nT:ns}function eg(e,t){const n=[...e],r=n.length,o=e.map((s,i)=>El(s)(s,t[i]));return s=>{for(let i=0;i<r;i++)n[i]=o[i](s);return n}}function nT(e,t){const n={...e,...t},r={};for(const o in n)e[o]!==void 0&&t[o]!==void 0&&(r[o]=El(e[o])(e[o],t[o]));return o=>{for(const s in r)n[s]=r[s](o);return n}}function rT(e,t){const n=[],r={color:0,var:0,number:0};for(let o=0;o<t.values.length;o++){const s=t.types[o],i=e.indexes[s][r[s]],a=e.values[i]??0;n[o]=a,r[s]++}return n}const oT=(e,t)=>{const n=Qt.createTransformer(t),r=Hr(e),o=Hr(t);return r.indexes.var.length===o.indexes.var.length&&r.indexes.color.length===o.indexes.color.length&&r.indexes.number.length>=o.indexes.number.length?ta.has(e)&&!o.values.length||ta.has(t)&&!r.values.length?eT(e,t):io(eg(rT(r,o),o.values),n):(nr(!0,`Complex values '${e}' and '${t}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`),ns(e,t))};function tg(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?we(e,t,n):El(e)(e,t)}const sT=e=>{const t=({timestamp:n})=>e(n);return{start:(n=!0)=>xe.update(t,n),stop:()=>Jt(t),now:()=>Ae.isProcessing?Ae.timestamp:ze.now()}},ng=(e,t,n=10)=>{let r="";const o=Math.max(Math.round(t/n),2);for(let s=0;s<o;s++)r+=e(s/(o-1))+", ";return`linear(${r.substring(0,r.length-2)})`},rs=2e4;function Pl(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<rs;)t+=n,r=e.next(t);return t>=rs?1/0:t}function iT(e,t=100,n){const r=n({...e,keyframes:[0,t]}),o=Math.min(Pl(r),rs);return{type:"keyframes",ease:s=>r.next(o*s).value/t,duration:wt(o)}}const aT=5;function rg(e,t,n){const r=Math.max(t-aT,0);return jh(n-e(r),t-r)}const ye={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},hu=.001;function lT({duration:e=ye.duration,bounce:t=ye.bounce,velocity:n=ye.velocity,mass:r=ye.mass}){let o,s;nr(e<=at(ye.maxDuration),"Spring duration must be 10 seconds or less");let i=1-t;i=kt(ye.minDamping,ye.maxDamping,i),e=kt(ye.minDuration,ye.maxDuration,wt(e)),i<1?(o=c=>{const u=c*i,d=u*e,p=u-n,f=na(c,i),g=Math.exp(-d);return hu-p/f*g},s=c=>{const d=c*i*e,p=d*n+n,f=Math.pow(i,2)*Math.pow(c,2)*e,g=Math.exp(-d),h=na(Math.pow(c,2),i);return(-o(c)+hu>0?-1:1)*((p-f)*g)/h}):(o=c=>{const u=Math.exp(-c*e),d=(c-n)*e+1;return-.001+u*d},s=c=>{const u=Math.exp(-c*e),d=(n-c)*(e*e);return u*d});const a=5/e,l=uT(o,s,a);if(e=at(e),isNaN(l))return{stiffness:ye.stiffness,damping:ye.damping,duration:e};{const c=Math.pow(l,2)*r;return{stiffness:c,damping:i*2*Math.sqrt(r*c),duration:e}}}const cT=12;function uT(e,t,n){let r=n;for(let o=1;o<cT;o++)r=r-e(r)/t(r);return r}function na(e,t){return e*Math.sqrt(1-t*t)}const dT=["duration","bounce"],fT=["stiffness","damping","mass"];function gu(e,t){return t.some(n=>e[n]!==void 0)}function pT(e){let t={velocity:ye.velocity,stiffness:ye.stiffness,damping:ye.damping,mass:ye.mass,isResolvedFromDuration:!1,...e};if(!gu(e,fT)&&gu(e,dT))if(e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),o=r*r,s=2*kt(.05,1,1-(e.bounce||0))*Math.sqrt(o);t={...t,mass:ye.mass,stiffness:o,damping:s}}else{const n=lT(e);t={...t,...n,mass:ye.mass},t.isResolvedFromDuration=!0}return t}function os(e=ye.visualDuration,t=ye.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:o}=n;const s=n.keyframes[0],i=n.keyframes[n.keyframes.length-1],a={done:!1,value:s},{stiffness:l,damping:c,mass:u,duration:d,velocity:p,isResolvedFromDuration:f}=pT({...n,velocity:-wt(n.velocity||0)}),g=p||0,h=c/(2*Math.sqrt(l*u)),b=i-s,w=wt(Math.sqrt(l/u)),v=Math.abs(b)<5;r||(r=v?ye.restSpeed.granular:ye.restSpeed.default),o||(o=v?ye.restDelta.granular:ye.restDelta.default);let m;if(h<1){const x=na(w,h);m=D=>{const S=Math.exp(-h*w*D);return i-S*((g+h*w*b)/x*Math.sin(x*D)+b*Math.cos(x*D))}}else if(h===1)m=x=>i-Math.exp(-w*x)*(b+(g+w*b)*x);else{const x=w*Math.sqrt(h*h-1);m=D=>{const S=Math.exp(-h*w*D),M=Math.min(x*D,300);return i-S*((g+h*w*b)*Math.sinh(M)+x*b*Math.cosh(M))/x}}const C={calculatedDuration:f&&d||null,next:x=>{const D=m(x);if(f)a.done=x>=d;else{let S=x===0?g:0;h<1&&(S=x===0?at(g):rg(m,x,D));const M=Math.abs(S)<=r,P=Math.abs(i-D)<=o;a.done=M&&P}return a.value=a.done?i:D,a},toString:()=>{const x=Math.min(Pl(C),rs),D=ng(S=>C.next(x*S).value,x,30);return x+"ms "+D},toTransition:()=>{}};return C}os.applyToOptions=e=>{const t=iT(e,100,os);return e.ease=t.ease,e.duration=at(t.duration),e.type="keyframes",e};function ra({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:o=10,bounceStiffness:s=500,modifyTarget:i,min:a,max:l,restDelta:c=.5,restSpeed:u}){const d=e[0],p={done:!1,value:d},f=M=>a!==void 0&&M<a||l!==void 0&&M>l,g=M=>a===void 0?l:l===void 0||Math.abs(a-M)<Math.abs(l-M)?a:l;let h=n*t;const b=d+h,w=i===void 0?b:i(b);w!==b&&(h=w-d);const v=M=>-h*Math.exp(-M/r),m=M=>w+v(M),C=M=>{const P=v(M),O=m(M);p.done=Math.abs(P)<=c,p.value=p.done?w:O};let x,D;const S=M=>{f(p.value)&&(x=M,D=os({keyframes:[p.value,g(p.value)],velocity:rg(m,M,p.value),damping:o,stiffness:s,restDelta:c,restSpeed:u}))};return S(0),{calculatedDuration:null,next:M=>{let P=!1;return!D&&x===void 0&&(P=!0,C(M),S(M)),x!==void 0&&M>=x?D.next(M-x):(!P&&C(M),p)}}}function hT(e,t,n){const r=[],o=n||Nt.mix||tg,s=e.length-1;for(let i=0;i<s;i++){let a=o(e[i],e[i+1]);if(t){const l=Array.isArray(t)?t[i]||nt:t;a=io(l,a)}r.push(a)}return r}function gT(e,t,{clamp:n=!0,ease:r,mixer:o}={}){const s=e.length;if(It(s===t.length,"Both input and output ranges must be the same length"),s===1)return()=>t[0];if(s===2&&t[0]===t[1])return()=>t[1];const i=e[0]===e[1];e[0]>e[s-1]&&(e=[...e].reverse(),t=[...t].reverse());const a=hT(t,r,o),l=a.length,c=u=>{if(i&&u<e[0])return t[0];let d=0;if(l>1)for(;d<e.length-2&&!(u<e[d+1]);d++);const p=Br(e[d],e[d+1],u);return a[d](p)};return n?u=>c(kt(e[0],e[s-1],u)):c}function mT(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const o=Br(0,t,r);e.push(we(n,1,o))}}function vT(e){const t=[0];return mT(t,e.length-1),t}function yT(e,t){return e.map(n=>n*t)}function wT(e,t){return e.map(()=>t||Uh).splice(0,e.length-1)}function kn({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const o=OR(r)?r.map(lu):lu(r),s={done:!1,value:t[0]},i=yT(n&&n.length===t.length?n:vT(t),e),a=gT(i,t,{ease:Array.isArray(o)?o:wT(t,o)});return{calculatedDuration:e,next:l=>(s.value=a(l),s.done=l>=e,s)}}const xT=e=>e!==null;function Al(e,{repeat:t,repeatType:n="loop"},r,o=1){const s=e.filter(xT),a=o<0||t&&n!=="loop"&&t%2===1?0:s.length-1;return!a||r===void 0?s[a]:r}const bT={decay:ra,inertia:ra,tween:kn,keyframes:kn,spring:os};function og(e){typeof e.type=="string"&&(e.type=bT[e.type])}class Ol{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,n){return this.finished.then(t,n)}}const ST=e=>e/100;class _l extends Ol{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=(n=!0)=>{var r,o;if(n){const{motionValue:s}=this.options;s&&s.updatedAt!==ze.now()&&this.tick(ze.now())}this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(o=(r=this.options).onStop)==null||o.call(r))},this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause()}initAnimation(){const{options:t}=this;og(t);const{type:n=kn,repeat:r=0,repeatDelay:o=0,repeatType:s,velocity:i=0}=t;let{keyframes:a}=t;const l=n||kn;process.env.NODE_ENV!=="production"&&l!==kn&&It(a.length<=2,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${a}`),l!==kn&&typeof a[0]!="number"&&(this.mixKeyframes=io(ST,tg(a[0],a[1])),a=[0,100]);const c=l({...t,keyframes:a});s==="mirror"&&(this.mirroredGenerator=l({...t,keyframes:[...a].reverse(),velocity:-i})),c.calculatedDuration===null&&(c.calculatedDuration=Pl(c));const{calculatedDuration:u}=c;this.calculatedDuration=u,this.resolvedDuration=u+o,this.totalDuration=this.resolvedDuration*(r+1)-o,this.generator=c}updateTime(t){const n=Math.round(t-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(t,n=!1){const{generator:r,totalDuration:o,mixKeyframes:s,mirroredGenerator:i,resolvedDuration:a,calculatedDuration:l}=this;if(this.startTime===null)return r.next(0);const{delay:c=0,keyframes:u,repeat:d,repeatType:p,repeatDelay:f,type:g,onUpdate:h,finalKeyframe:b}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-o/this.speed,this.startTime)),n?this.currentTime=t:this.updateTime(t);const w=this.currentTime-c*(this.playbackSpeed>=0?1:-1),v=this.playbackSpeed>=0?w<0:w>o;this.currentTime=Math.max(w,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=o);let m=this.currentTime,C=r;if(d){const M=Math.min(this.currentTime,o)/a;let P=Math.floor(M),O=M%1;!O&&M>=1&&(O=1),O===1&&P--,P=Math.min(P,d+1),!!(P%2)&&(p==="reverse"?(O=1-O,f&&(O-=f/a)):p==="mirror"&&(C=i)),m=kt(0,1,O)*a}const x=v?{done:!1,value:u[0]}:C.next(m);s&&(x.value=s(x.value));let{done:D}=x;!v&&l!==null&&(D=this.playbackSpeed>=0?this.currentTime>=o:this.currentTime<=0);const S=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&D);return S&&g!==ra&&(x.value=Al(u,this.options,b,this.speed)),h&&h(x.value),S&&this.finish(),x}then(t,n){return this.finished.then(t,n)}get duration(){return wt(this.calculatedDuration)}get time(){return wt(this.currentTime)}set time(t){var n;t=at(t),this.currentTime=t,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),(n=this.driver)==null||n.start(!1)}get speed(){return this.playbackSpeed}set speed(t){this.updateTime(ze.now());const n=this.playbackSpeed!==t;this.playbackSpeed=t,n&&(this.time=wt(this.currentTime))}play(){var o,s;if(this.isStopped)return;const{driver:t=sT,startTime:n}=this.options;this.driver||(this.driver=t(i=>this.tick(i))),(s=(o=this.options).onPlay)==null||s.call(o);const r=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=r):this.holdTime!==null?this.startTime=r-this.holdTime:this.startTime||(this.startTime=n??r),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(ze.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){var t,n;this.notifyFinished(),this.teardown(),this.state="finished",(n=(t=this.options).onComplete)==null||n.call(t)}cancel(){var t,n;this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),(n=(t=this.options).onCancel)==null||n.call(t)}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){var n;return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),(n=this.driver)==null||n.stop(),t.observe(this)}}function CT(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const gn=e=>e*180/Math.PI,oa=e=>{const t=gn(Math.atan2(e[1],e[0]));return sa(t)},RT={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:oa,rotateZ:oa,skewX:e=>gn(Math.atan(e[1])),skewY:e=>gn(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},sa=e=>(e=e%360,e<0&&(e+=360),e),mu=oa,vu=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),yu=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),TT={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:vu,scaleY:yu,scale:e=>(vu(e)+yu(e))/2,rotateX:e=>sa(gn(Math.atan2(e[6],e[5]))),rotateY:e=>sa(gn(Math.atan2(-e[2],e[0]))),rotateZ:mu,rotate:mu,skewX:e=>gn(Math.atan(e[4])),skewY:e=>gn(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function ia(e){return e.includes("scale")?1:0}function aa(e,t){if(!e||e==="none")return ia(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,o;if(n)r=TT,o=n;else{const a=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=RT,o=a}if(!o)return ia(t);const s=r[t],i=o[1].split(",").map(MT);return typeof s=="function"?s(i):i[s]}const DT=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return aa(n,t)};function MT(e){return parseFloat(e.trim())}const or=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],sr=new Set(or),wu=e=>e===rr||e===re,ET=new Set(["x","y","z"]),PT=or.filter(e=>!ET.has(e));function AT(e){const t=[];return PT.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const mn={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>aa(t,"x"),y:(e,{transform:t})=>aa(t,"y")};mn.translateX=mn.x;mn.translateY=mn.y;const vn=new Set;let la=!1,ca=!1,ua=!1;function sg(){if(ca){const e=Array.from(vn).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const o=AT(r);o.length&&(n.set(r,o),r.render())}),e.forEach(r=>r.measureInitialState()),t.forEach(r=>{r.render();const o=n.get(r);o&&o.forEach(([s,i])=>{var a;(a=r.getValue(s))==null||a.set(i)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}ca=!1,la=!1,vn.forEach(e=>e.complete(ua)),vn.clear()}function ig(){vn.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(ca=!0)})}function OT(){ua=!0,ig(),sg(),ua=!1}class kl{constructor(t,n,r,o,s,i=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=r,this.motionValue=o,this.element=s,this.isAsync=i}scheduleResolve(){this.state="scheduled",this.isAsync?(vn.add(this),la||(la=!0,xe.read(ig),xe.resolveKeyframes(sg))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:r,motionValue:o}=this;if(t[0]===null){const s=o==null?void 0:o.get(),i=t[t.length-1];if(s!==void 0)t[0]=s;else if(r&&n){const a=r.readValue(n,i);a!=null&&(t[0]=a)}t[0]===void 0&&(t[0]=i),o&&s===void 0&&o.set(t[0])}CT(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),vn.delete(this)}cancel(){this.state==="scheduled"&&(vn.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const _T=e=>e.startsWith("--");function kT(e,t,n){_T(t)?e.style.setProperty(t,n):e.style[t]=n}const IT=wl(()=>window.ScrollTimeline!==void 0),NT={};function jT(e,t){const n=wl(e);return()=>NT[t]??n()}const ag=jT(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Sr=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,xu={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Sr([0,.65,.55,1]),circOut:Sr([.55,0,1,.45]),backIn:Sr([.31,.01,.66,-.59]),backOut:Sr([.33,1.53,.69,.99])};function lg(e,t){if(e)return typeof e=="function"?ag()?ng(e,t):"ease-out":Gh(e)?Sr(e):Array.isArray(e)?e.map(n=>lg(n,t)||xu.easeOut):xu[e]}function FT(e,t,n,{delay:r=0,duration:o=300,repeat:s=0,repeatType:i="loop",ease:a="easeOut",times:l}={},c=void 0){const u={[t]:n};l&&(u.offset=l);const d=lg(a,o);Array.isArray(d)&&(u.easing=d);const p={delay:r,duration:o,easing:Array.isArray(d)?"linear":d,fill:"both",iterations:s+1,direction:i==="reverse"?"alternate":"normal"};return c&&(p.pseudoElement=c),e.animate(u,p)}function cg(e){return typeof e=="function"&&"applyToOptions"in e}function VT({type:e,...t}){return cg(e)&&ag()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class LT extends Ol{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,!t)return;const{element:n,name:r,keyframes:o,pseudoElement:s,allowFlatten:i=!1,finalKeyframe:a,onComplete:l}=t;this.isPseudoElement=!!s,this.allowFlatten=i,this.options=t,It(typeof t.type!="string",`animateMini doesn't support "type" as a string. Did you mean to import { spring } from "motion"?`);const c=VT(t);this.animation=FT(n,r,o,c,s),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!s){const u=Al(o,this.options,a,this.speed);this.updateMotionValue?this.updateMotionValue(u):kT(n,r,u),this.animation.cancel()}l==null||l(),this.notifyFinished()}}play(){this.isStopped||(this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){var t,n;(n=(t=this.animation).finish)==null||n.call(t)}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;t==="idle"||t==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){var t,n;this.isPseudoElement||(n=(t=this.animation).commitStyles)==null||n.call(t)}get duration(){var n,r;const t=((r=(n=this.animation.effect)==null?void 0:n.getComputedTiming)==null?void 0:r.call(n).duration)||0;return wt(Number(t))}get time(){return wt(Number(this.animation.currentTime)||0)}set time(t){this.finishedTime=null,this.animation.currentTime=at(t)}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return Number(this.animation.startTime)}set startTime(t){this.animation.startTime=t}attachTimeline({timeline:t,observe:n}){var r;return this.allowFlatten&&((r=this.animation.effect)==null||r.updateTiming({easing:"linear"})),this.animation.onfinish=null,t&&IT()?(this.animation.timeline=t,nt):n(this)}}const ug={anticipate:zh,backInOut:Bh,circInOut:Wh};function $T(e){return e in ug}function BT(e){typeof e.ease=="string"&&$T(e.ease)&&(e.ease=ug[e.ease])}const bu=10;class zT extends LT{constructor(t){BT(t),og(t),super(t),t.startTime&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:n,onUpdate:r,onComplete:o,element:s,...i}=this.options;if(!n)return;if(t!==void 0){n.set(t);return}const a=new _l({...i,autoplay:!1}),l=at(this.finishedTime??this.time);n.setWithVelocity(a.sample(l-bu).value,a.sample(l).value,bu),a.stop()}}const Su=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(Qt.test(e)||e==="0")&&!e.startsWith("url("));function HT(e){const t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function WT(e,t,n,r){const o=e[0];if(o===null)return!1;if(t==="display"||t==="visibility")return!0;const s=e[e.length-1],i=Su(o,t),a=Su(s,t);return nr(i===a,`You are trying to animate ${t} from "${o}" to "${s}". ${o} is not an animatable value - to enable this animation set ${o} to a value animatable to ${s} via the \`style\` property.`),!i||!a?!1:HT(e)||(n==="spring"||cg(n))&&r}function dg(e){return Ih(e)&&"offsetHeight"in e}const UT=new Set(["opacity","clipPath","filter","transform"]),GT=wl(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function YT(e){var c;const{motionValue:t,name:n,repeatDelay:r,repeatType:o,damping:s,type:i}=e;if(!dg((c=t==null?void 0:t.owner)==null?void 0:c.current))return!1;const{onUpdate:a,transformTemplate:l}=t.owner.getProps();return GT()&&n&&UT.has(n)&&(n!=="transform"||!l)&&!a&&!r&&o!=="mirror"&&s!==0&&i!=="inertia"}const KT=40;class qT extends Ol{constructor({autoplay:t=!0,delay:n=0,type:r="keyframes",repeat:o=0,repeatDelay:s=0,repeatType:i="loop",keyframes:a,name:l,motionValue:c,element:u,...d}){var g;super(),this.stop=()=>{var h,b;this._animation&&(this._animation.stop(),(h=this.stopTimeline)==null||h.call(this)),(b=this.keyframeResolver)==null||b.cancel()},this.createdAt=ze.now();const p={autoplay:t,delay:n,type:r,repeat:o,repeatDelay:s,repeatType:i,name:l,motionValue:c,element:u,...d},f=(u==null?void 0:u.KeyframeResolver)||kl;this.keyframeResolver=new f(a,(h,b,w)=>this.onKeyframesResolved(h,b,p,!w),l,c,u),(g=this.keyframeResolver)==null||g.scheduleResolve()}onKeyframesResolved(t,n,r,o){this.keyframeResolver=void 0;const{name:s,type:i,velocity:a,delay:l,isHandoff:c,onUpdate:u}=r;this.resolvedAt=ze.now(),WT(t,s,i,a)||((Nt.instantAnimations||!l)&&(u==null||u(Al(t,r,n))),t[0]=t[t.length-1],r.duration=0,r.repeat=0);const p={startTime:o?this.resolvedAt?this.resolvedAt-this.createdAt>KT?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...r,keyframes:t},f=!c&&YT(p)?new zT({...p,element:p.motionValue.owner.current}):new _l(p);f.finished.then(()=>this.notifyFinished()).catch(nt),this.pendingTimeline&&(this.stopTimeline=f.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=f}get finished(){return this._animation?this.animation.finished:this._finished}then(t,n){return this.finished.finally(t).then(()=>{})}get animation(){var t;return this._animation||((t=this.keyframeResolver)==null||t.resume(),OT()),this._animation}get duration(){return this.animation.duration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){var t;this._animation&&this.animation.cancel(),(t=this.keyframeResolver)==null||t.cancel()}}const XT=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function ZT(e){const t=XT.exec(e);if(!t)return[,];const[,n,r,o]=t;return[`--${n??r}`,o]}const JT=4;function fg(e,t,n=1){It(n<=JT,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`);const[r,o]=ZT(e);if(!r)return;const s=window.getComputedStyle(t).getPropertyValue(r);if(s){const i=s.trim();return kh(i)?parseFloat(i):i}return Tl(o)?fg(o,t,n+1):o}function Il(e,t){return(e==null?void 0:e[t])??(e==null?void 0:e.default)??e}const pg=new Set(["width","height","top","left","right","bottom",...or]),QT={test:e=>e==="auto",parse:e=>e},hg=e=>t=>t.test(e),gg=[rr,re,xt,Ut,HR,zR,QT],Cu=e=>gg.find(hg(e));function eD(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||Nh(e):!0}const tD=new Set(["brightness","contrast","saturate","opacity"]);function nD(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(Dl)||[];if(!r)return e;const o=n.replace(r,"");let s=tD.has(t)?1:0;return r!==n&&(s*=100),t+"("+s+o+")"}const rD=/\b([a-z-]*)\(.*?\)/gu,da={...Qt,getAnimatableNone:e=>{const t=e.match(rD);return t?t.map(nD).join(" "):e}},Ru={...rr,transform:Math.round},oD={rotate:Ut,rotateX:Ut,rotateY:Ut,rotateZ:Ut,scale:Co,scaleX:Co,scaleY:Co,scaleZ:Co,skew:Ut,skewX:Ut,skewY:Ut,distance:re,translateX:re,translateY:re,translateZ:re,x:re,y:re,z:re,perspective:re,transformPerspective:re,opacity:zr,originX:uu,originY:uu,originZ:re},Nl={borderWidth:re,borderTopWidth:re,borderRightWidth:re,borderBottomWidth:re,borderLeftWidth:re,borderRadius:re,radius:re,borderTopLeftRadius:re,borderTopRightRadius:re,borderBottomRightRadius:re,borderBottomLeftRadius:re,width:re,maxWidth:re,height:re,maxHeight:re,top:re,right:re,bottom:re,left:re,padding:re,paddingTop:re,paddingRight:re,paddingBottom:re,paddingLeft:re,margin:re,marginTop:re,marginRight:re,marginBottom:re,marginLeft:re,backgroundPositionX:re,backgroundPositionY:re,...oD,zIndex:Ru,fillOpacity:zr,strokeOpacity:zr,numOctaves:Ru},sD={...Nl,color:Ne,backgroundColor:Ne,outlineColor:Ne,fill:Ne,stroke:Ne,borderColor:Ne,borderTopColor:Ne,borderRightColor:Ne,borderBottomColor:Ne,borderLeftColor:Ne,filter:da,WebkitFilter:da},mg=e=>sD[e];function vg(e,t){let n=mg(e);return n!==da&&(n=Qt),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const iD=new Set(["auto","none","0"]);function aD(e,t,n){let r=0,o;for(;r<e.length&&!o;){const s=e[r];typeof s=="string"&&!iD.has(s)&&Hr(s).values.length&&(o=e[r]),r++}if(o&&n)for(const s of t)e[s]=vg(n,o)}class lD extends kl{constructor(t,n,r,o,s){super(t,n,r,o,s,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let l=0;l<t.length;l++){let c=t[l];if(typeof c=="string"&&(c=c.trim(),Tl(c))){const u=fg(c,n.current);u!==void 0&&(t[l]=u),l===t.length-1&&(this.finalKeyframe=c)}}if(this.resolveNoneKeyframes(),!pg.has(r)||t.length!==2)return;const[o,s]=t,i=Cu(o),a=Cu(s);if(i!==a)if(wu(i)&&wu(a))for(let l=0;l<t.length;l++){const c=t[l];typeof c=="string"&&(t[l]=parseFloat(c))}else mn[r]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,r=[];for(let o=0;o<t.length;o++)(t[o]===null||eD(t[o]))&&r.push(o);r.length&&aD(t,r,n)}measureInitialState(){const{element:t,unresolvedKeyframes:n,name:r}=this;if(!t||!t.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=mn[r](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const o=n[n.length-1];o!==void 0&&t.getValue(r,o).jump(o,!1)}measureEndState(){var a;const{element:t,name:n,unresolvedKeyframes:r}=this;if(!t||!t.current)return;const o=t.getValue(n);o&&o.jump(this.measuredOrigin,!1);const s=r.length-1,i=r[s];r[s]=mn[n](t.measureViewportBox(),window.getComputedStyle(t.current)),i!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=i),(a=this.removedTransforms)!=null&&a.length&&this.removedTransforms.forEach(([l,c])=>{t.getValue(l).set(c)}),this.resolveNoneKeyframes()}}function cD(e,t,n){if(e instanceof EventTarget)return[e];if(typeof e=="string"){let r=document;const o=(n==null?void 0:n[e])??r.querySelectorAll(e);return o?Array.from(o):[]}return Array.from(e)}const Tu=30,uD=e=>!isNaN(parseFloat(e));class dD{constructor(t,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=(r,o=!0)=>{var i,a;const s=ze.now();if(this.updatedAt!==s&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&((i=this.events.change)==null||i.notify(this.current),this.dependents))for(const l of this.dependents)l.dirty();o&&((a=this.events.renderRequest)==null||a.notify(this.current))},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=ze.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=uD(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return process.env.NODE_ENV!=="production"&&bl(!1,'value.onChange(callback) is deprecated. Switch to value.on("change", callback).'),this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new xl);const r=this.events[t].add(n);return t==="change"?()=>{r(),xe.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t,n=!0){!n||!this.passiveEffect?this.updateAndNotify(t,n):this.passiveEffect(t,this.updateAndNotify)}setWithVelocity(t,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-r}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){var t;(t=this.events.change)==null||t.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=ze.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>Tu)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,Tu);return jh(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){var t,n;(t=this.dependents)==null||t.clear(),(n=this.events.destroy)==null||n.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Wn(e,t){return new dD(e,t)}const yg=(e,t)=>t&&typeof e=="number"?t.transform(e):e,{schedule:jl}=Yh(queueMicrotask,!1),st={x:!1,y:!1};function wg(){return st.x||st.y}function fD(e){return e==="x"||e==="y"?st[e]?null:(st[e]=!0,()=>{st[e]=!1}):st.x||st.y?null:(st.x=st.y=!0,()=>{st.x=st.y=!1})}function xg(e,t){const n=cD(e),r=new AbortController,o={passive:!0,...t,signal:r.signal};return[n,o,()=>r.abort()]}function Du(e){return!(e.pointerType==="touch"||wg())}function pD(e,t,n={}){const[r,o,s]=xg(e,n),i=a=>{if(!Du(a))return;const{target:l}=a,c=t(l,a);if(typeof c!="function"||!l)return;const u=d=>{Du(d)&&(c(d),l.removeEventListener("pointerleave",u))};l.addEventListener("pointerleave",u,o)};return r.forEach(a=>{a.addEventListener("pointerenter",i,o)}),s}const bg=(e,t)=>t?e===t?!0:bg(e,t.parentElement):!1,Fl=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,hD=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function gD(e){return hD.has(e.tagName)||e.tabIndex!==-1}const Lo=new WeakSet;function Mu(e){return t=>{t.key==="Enter"&&e(t)}}function gi(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const mD=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=Mu(()=>{if(Lo.has(n))return;gi(n,"down");const o=Mu(()=>{gi(n,"up")}),s=()=>gi(n,"cancel");n.addEventListener("keyup",o,t),n.addEventListener("blur",s,t)});n.addEventListener("keydown",r,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),t)};function Eu(e){return Fl(e)&&!wg()}function vD(e,t,n={}){const[r,o,s]=xg(e,n),i=a=>{const l=a.currentTarget;if(!Eu(a))return;Lo.add(l);const c=t(l,a),u=(f,g)=>{window.removeEventListener("pointerup",d),window.removeEventListener("pointercancel",p),Lo.has(l)&&Lo.delete(l),Eu(f)&&typeof c=="function"&&c(f,{success:g})},d=f=>{u(f,l===window||l===document||n.useGlobalTarget||bg(l,f.target))},p=f=>{u(f,!1)};window.addEventListener("pointerup",d,o),window.addEventListener("pointercancel",p,o)};return r.forEach(a=>{(n.useGlobalTarget?window:a).addEventListener("pointerdown",i,o),dg(a)&&(a.addEventListener("focus",c=>mD(c,o)),!gD(a)&&!a.hasAttribute("tabindex")&&(a.tabIndex=0))}),s}function Sg(e){return Ih(e)&&"ownerSVGElement"in e}function yD(e){return Sg(e)&&e.tagName==="svg"}const je=e=>!!(e&&e.getVelocity),wD=[...gg,Ne,Qt],xD=e=>wD.find(hg(e)),Cg=R.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function bD(e=!0){const t=R.useContext(ml);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:o}=t,s=R.useId();R.useEffect(()=>{if(e)return o(s)},[e]);const i=R.useCallback(()=>e&&r&&r(s),[s,r,e]);return!n&&r?[!1,i]:[!0]}const Rg=R.createContext({strict:!1}),Pu={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},Un={};for(const e in Pu)Un[e]={isEnabled:t=>Pu[e].some(n=>!!t[n])};function SD(e){for(const t in e)Un[t]={...Un[t],...e[t]}}const CD=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function ss(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||CD.has(e)}let Tg=e=>!ss(e);function RD(e){e&&(Tg=t=>t.startsWith("on")?!ss(t):e(t))}try{RD(require("@emotion/is-prop-valid").default)}catch{}function TD(e,t,n){const r={};for(const o in e)o==="values"&&typeof e.values=="object"||(Tg(o)||n===!0&&ss(o)||!t&&!ss(o)||e.draggable&&o.startsWith("onDrag"))&&(r[o]=e[o]);return r}function DD(e){if(typeof Proxy>"u")return e;const t=new Map,n=(...r)=>(process.env.NODE_ENV!=="production"&&bl(!1,"motion() is deprecated. Use motion.create() instead."),e(...r));return new Proxy(n,{get:(r,o)=>o==="create"?e:(t.has(o)||t.set(o,e(o)),t.get(o))})}const As=R.createContext({});function Os(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function Wr(e){return typeof e=="string"||Array.isArray(e)}const Vl=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Ll=["initial",...Vl];function _s(e){return Os(e.animate)||Ll.some(t=>Wr(e[t]))}function Dg(e){return!!(_s(e)||e.variants)}function MD(e,t){if(_s(e)){const{initial:n,animate:r}=e;return{initial:n===!1||Wr(n)?n:void 0,animate:Wr(r)?r:void 0}}return e.inherit!==!1?t:{}}function ED(e){const{initial:t,animate:n}=MD(e,R.useContext(As));return R.useMemo(()=>({initial:t,animate:n}),[Au(t),Au(n)])}function Au(e){return Array.isArray(e)?e.join(" "):e}const PD=Symbol.for("motionComponentSymbol");function In(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function AD(e,t,n){return R.useCallback(r=>{r&&e.onMount&&e.onMount(r),t&&(r?t.mount(r):t.unmount()),n&&(typeof n=="function"?n(r):In(n)&&(n.current=r))},[t])}const $l=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),OD="framerAppearId",Mg="data-"+$l(OD),Eg=R.createContext({});function _D(e,t,n,r,o){var h,b;const{visualElement:s}=R.useContext(As),i=R.useContext(Rg),a=R.useContext(ml),l=R.useContext(Cg).reducedMotion,c=R.useRef(null);r=r||i.renderer,!c.current&&r&&(c.current=r(e,{visualState:t,parent:s,props:n,presenceContext:a,blockInitialAnimation:a?a.initial===!1:!1,reducedMotionConfig:l}));const u=c.current,d=R.useContext(Eg);u&&!u.projection&&o&&(u.type==="html"||u.type==="svg")&&kD(c.current,n,o,d);const p=R.useRef(!1);R.useInsertionEffect(()=>{u&&p.current&&u.update(n,a)});const f=n[Mg],g=R.useRef(!!f&&!((h=window.MotionHandoffIsComplete)!=null&&h.call(window,f))&&((b=window.MotionHasOptimisedAnimation)==null?void 0:b.call(window,f)));return RR(()=>{u&&(p.current=!0,window.MotionIsMounted=!0,u.updateFeatures(),jl.render(u.render),g.current&&u.animationState&&u.animationState.animateChanges())}),R.useEffect(()=>{u&&(!g.current&&u.animationState&&u.animationState.animateChanges(),g.current&&(queueMicrotask(()=>{var w;(w=window.MotionHandoffMarkAsComplete)==null||w.call(window,f)}),g.current=!1))}),u}function kD(e,t,n,r){const{layoutId:o,layout:s,drag:i,dragConstraints:a,layoutScroll:l,layoutRoot:c,layoutCrossfade:u}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:Pg(e.parent)),e.projection.setOptions({layoutId:o,layout:s,alwaysMeasureLayout:!!i||a&&In(a),visualElement:e,animationType:typeof s=="string"?s:"both",initialPromotionConfig:r,crossfade:u,layoutScroll:l,layoutRoot:c})}function Pg(e){if(e)return e.options.allowProjection!==!1?e.projection:Pg(e.parent)}function ID({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:r,Component:o}){e&&SD(e);function s(a,l){let c;const u={...R.useContext(Cg),...a,layoutId:ND(a)},{isStatic:d}=u,p=ED(a),f=r(a,d);if(!d&&gl){jD(u,e);const g=FD(u);c=g.MeasureLayout,p.visualElement=_D(o,f,u,t,g.ProjectionNode)}return y.jsxs(As.Provider,{value:p,children:[c&&p.visualElement?y.jsx(c,{visualElement:p.visualElement,...u}):null,n(o,a,AD(f,p.visualElement,l),f,d,p.visualElement)]})}s.displayName=`motion.${typeof o=="string"?o:`create(${o.displayName??o.name??""})`}`;const i=R.forwardRef(s);return i[PD]=o,i}function ND({layoutId:e}){const t=R.useContext(_h).id;return t&&e!==void 0?t+"-"+e:e}function jD(e,t){const n=R.useContext(Rg).strict;if(process.env.NODE_ENV!=="production"&&t&&n){const r="You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.";e.ignoreStrict?nr(!1,r):It(!1,r)}}function FD(e){const{drag:t,layout:n}=Un;if(!t&&!n)return{};const r={...t,...n};return{MeasureLayout:t!=null&&t.isEnabled(e)||n!=null&&n.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}const Ur={};function VD(e){for(const t in e)Ur[t]=e[t],Rl(t)&&(Ur[t].isCSSVariable=!0)}function Ag(e,{layout:t,layoutId:n}){return sr.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!Ur[e]||e==="opacity")}const LD={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},$D=or.length;function BD(e,t,n){let r="",o=!0;for(let s=0;s<$D;s++){const i=or[s],a=e[i];if(a===void 0)continue;let l=!0;if(typeof a=="number"?l=a===(i.startsWith("scale")?1:0):l=parseFloat(a)===0,!l||n){const c=yg(a,Nl[i]);if(!l){o=!1;const u=LD[i]||i;r+=`${u}(${c}) `}n&&(t[i]=c)}}return r=r.trim(),n?r=n(t,o?"":r):o&&(r="none"),r}function Bl(e,t,n){const{style:r,vars:o,transformOrigin:s}=e;let i=!1,a=!1;for(const l in t){const c=t[l];if(sr.has(l)){i=!0;continue}else if(Rl(l)){o[l]=c;continue}else{const u=yg(c,Nl[l]);l.startsWith("origin")?(a=!0,s[l]=u):r[l]=u}}if(t.transform||(i||n?r.transform=BD(t,e.transform,n):r.transform&&(r.transform="none")),a){const{originX:l="50%",originY:c="50%",originZ:u=0}=s;r.transformOrigin=`${l} ${c} ${u}`}}const zl=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Og(e,t,n){for(const r in t)!je(t[r])&&!Ag(r,n)&&(e[r]=t[r])}function zD({transformTemplate:e},t){return R.useMemo(()=>{const n=zl();return Bl(n,t,e),Object.assign({},n.vars,n.style)},[t])}function HD(e,t){const n=e.style||{},r={};return Og(r,n,e),Object.assign(r,zD(e,t)),r}function WD(e,t){const n={},r=HD(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}const UD={offset:"stroke-dashoffset",array:"stroke-dasharray"},GD={offset:"strokeDashoffset",array:"strokeDasharray"};function YD(e,t,n=1,r=0,o=!0){e.pathLength=1;const s=o?UD:GD;e[s.offset]=re.transform(-r);const i=re.transform(t),a=re.transform(n);e[s.array]=`${i} ${a}`}function _g(e,{attrX:t,attrY:n,attrScale:r,pathLength:o,pathSpacing:s=1,pathOffset:i=0,...a},l,c,u){if(Bl(e,a,c),l){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:d,style:p}=e;d.transform&&(p.transform=d.transform,delete d.transform),(p.transform||d.transformOrigin)&&(p.transformOrigin=d.transformOrigin??"50% 50%",delete d.transformOrigin),p.transform&&(p.transformBox=(u==null?void 0:u.transformBox)??"fill-box",delete d.transformBox),t!==void 0&&(d.x=t),n!==void 0&&(d.y=n),r!==void 0&&(d.scale=r),o!==void 0&&YD(d,o,s,i,!1)}const kg=()=>({...zl(),attrs:{}}),Ig=e=>typeof e=="string"&&e.toLowerCase()==="svg";function KD(e,t,n,r){const o=R.useMemo(()=>{const s=kg();return _g(s,t,Ig(r),e.transformTemplate,e.style),{...s.attrs,style:{...s.style}}},[t]);if(e.style){const s={};Og(s,e.style,e),o.style={...s,...o.style}}return o}const qD=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function Hl(e){return typeof e!="string"||e.includes("-")?!1:!!(qD.indexOf(e)>-1||/[A-Z]/u.test(e))}function XD(e=!1){return(n,r,o,{latestValues:s},i)=>{const l=(Hl(n)?KD:WD)(r,s,i,n),c=TD(r,typeof n=="string",e),u=n!==R.Fragment?{...c,...l,ref:o}:{},{children:d}=r,p=R.useMemo(()=>je(d)?d.get():d,[d]);return R.createElement(n,{...u,children:p})}}function Ou(e){const t=[{},{}];return e==null||e.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function Wl(e,t,n,r){if(typeof t=="function"){const[o,s]=Ou(r);t=t(n!==void 0?n:e.custom,o,s)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[o,s]=Ou(r);t=t(n!==void 0?n:e.custom,o,s)}return t}function $o(e){return je(e)?e.get():e}function ZD({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,o){return{latestValues:JD(n,r,o,e),renderState:t()}}const Ng=e=>(t,n)=>{const r=R.useContext(As),o=R.useContext(ml),s=()=>ZD(e,t,r,o);return n?s():CR(s)};function JD(e,t,n,r){const o={},s=r(e,{});for(const p in s)o[p]=$o(s[p]);let{initial:i,animate:a}=e;const l=_s(e),c=Dg(e);t&&c&&!l&&e.inherit!==!1&&(i===void 0&&(i=t.initial),a===void 0&&(a=t.animate));let u=n?n.initial===!1:!1;u=u||i===!1;const d=u?a:i;if(d&&typeof d!="boolean"&&!Os(d)){const p=Array.isArray(d)?d:[d];for(let f=0;f<p.length;f++){const g=Wl(e,p[f]);if(g){const{transitionEnd:h,transition:b,...w}=g;for(const v in w){let m=w[v];if(Array.isArray(m)){const C=u?m.length-1:0;m=m[C]}m!==null&&(o[v]=m)}for(const v in h)o[v]=h[v]}}}return o}function Ul(e,t,n){var s;const{style:r}=e,o={};for(const i in r)(je(r[i])||t.style&&je(t.style[i])||Ag(i,e)||((s=n==null?void 0:n.getValue(i))==null?void 0:s.liveStyle)!==void 0)&&(o[i]=r[i]);return o}const QD={useVisualState:Ng({scrapeMotionValuesFromProps:Ul,createRenderState:zl})};function jg(e,t,n){const r=Ul(e,t,n);for(const o in e)if(je(e[o])||je(t[o])){const s=or.indexOf(o)!==-1?"attr"+o.charAt(0).toUpperCase()+o.substring(1):o;r[s]=e[o]}return r}const eM={useVisualState:Ng({scrapeMotionValuesFromProps:jg,createRenderState:kg})};function tM(e,t){return function(r,{forwardMotionProps:o}={forwardMotionProps:!1}){const i={...Hl(r)?eM:QD,preloadedFeatures:e,useRender:XD(o),createVisualElement:t,Component:r};return ID(i)}}function Gr(e,t,n){const r=e.getProps();return Wl(r,t,n!==void 0?n:r.custom,e)}const fa=e=>Array.isArray(e);function nM(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Wn(n))}function rM(e){return fa(e)?e[e.length-1]||0:e}function oM(e,t){const n=Gr(e,t);let{transitionEnd:r={},transition:o={},...s}=n||{};s={...s,...r};for(const i in s){const a=rM(s[i]);nM(e,i,a)}}function sM(e){return!!(je(e)&&e.add)}function pa(e,t){const n=e.getValue("willChange");if(sM(n))return n.add(t);if(!n&&Nt.WillChange){const r=new Nt.WillChange("auto");e.addValue("willChange",r),r.add(t)}}function Fg(e){return e.props[Mg]}const iM=e=>e!==null;function aM(e,{repeat:t,repeatType:n="loop"},r){const o=e.filter(iM),s=t&&n!=="loop"&&t%2===1?0:o.length-1;return o[s]}const lM={type:"spring",stiffness:500,damping:25,restSpeed:10},cM=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),uM={type:"keyframes",duration:.8},dM={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},fM=(e,{keyframes:t})=>t.length>2?uM:sr.has(e)?e.startsWith("scale")?cM(t[1]):lM:dM;function pM({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:o,repeat:s,repeatType:i,repeatDelay:a,from:l,elapsed:c,...u}){return!!Object.keys(u).length}const Gl=(e,t,n,r={},o,s)=>i=>{const a=Il(r,e)||{},l=a.delay||r.delay||0;let{elapsed:c=0}=r;c=c-at(l);const u={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...a,delay:-c,onUpdate:p=>{t.set(p),a.onUpdate&&a.onUpdate(p)},onComplete:()=>{i(),a.onComplete&&a.onComplete()},name:e,motionValue:t,element:s?void 0:o};pM(a)||Object.assign(u,fM(e,u)),u.duration&&(u.duration=at(u.duration)),u.repeatDelay&&(u.repeatDelay=at(u.repeatDelay)),u.from!==void 0&&(u.keyframes[0]=u.from);let d=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(u.duration=0,u.delay===0&&(d=!0)),(Nt.instantAnimations||Nt.skipAnimations)&&(d=!0,u.duration=0,u.delay=0),u.allowFlatten=!a.type&&!a.ease,d&&!s&&t.get()!==void 0){const p=aM(u.keyframes,a);if(p!==void 0){xe.update(()=>{u.onUpdate(p),u.onComplete()});return}}return a.isSync?new _l(u):new qT(u)};function hM({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function Vg(e,t,{delay:n=0,transitionOverride:r,type:o}={}){let{transition:s=e.getDefaultTransition(),transitionEnd:i,...a}=t;r&&(s=r);const l=[],c=o&&e.animationState&&e.animationState.getState()[o];for(const u in a){const d=e.getValue(u,e.latestValues[u]??null),p=a[u];if(p===void 0||c&&hM(c,u))continue;const f={delay:n,...Il(s||{},u)},g=d.get();if(g!==void 0&&!d.isAnimating&&!Array.isArray(p)&&p===g&&!f.velocity)continue;let h=!1;if(window.MotionHandoffAnimation){const w=Fg(e);if(w){const v=window.MotionHandoffAnimation(w,u,xe);v!==null&&(f.startTime=v,h=!0)}}pa(e,u),d.start(Gl(u,d,p,e.shouldReduceMotion&&pg.has(u)?{type:!1}:f,e,h));const b=d.animation;b&&l.push(b)}return i&&Promise.all(l).then(()=>{xe.update(()=>{i&&oM(e,i)})}),l}function ha(e,t,n={}){var l;const r=Gr(e,t,n.type==="exit"?(l=e.presenceContext)==null?void 0:l.custom:void 0);let{transition:o=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(o=n.transitionOverride);const s=r?()=>Promise.all(Vg(e,r,n)):()=>Promise.resolve(),i=e.variantChildren&&e.variantChildren.size?(c=0)=>{const{delayChildren:u=0,staggerChildren:d,staggerDirection:p}=o;return gM(e,t,u+c,d,p,n)}:()=>Promise.resolve(),{when:a}=o;if(a){const[c,u]=a==="beforeChildren"?[s,i]:[i,s];return c().then(()=>u())}else return Promise.all([s(),i(n.delay)])}function gM(e,t,n=0,r=0,o=1,s){const i=[],a=(e.variantChildren.size-1)*r,l=o===1?(c=0)=>c*r:(c=0)=>a-c*r;return Array.from(e.variantChildren).sort(mM).forEach((c,u)=>{c.notify("AnimationStart",t),i.push(ha(c,t,{...s,delay:n+l(u)}).then(()=>c.notify("AnimationComplete",t)))}),Promise.all(i)}function mM(e,t){return e.sortNodePosition(t)}function vM(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const o=t.map(s=>ha(e,s,n));r=Promise.all(o)}else if(typeof t=="string")r=ha(e,t,n);else{const o=typeof t=="function"?Gr(e,t,n.custom):t;r=Promise.all(Vg(e,o,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}function Lg(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}const yM=Ll.length;function $g(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?$g(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<yM;n++){const r=Ll[n],o=e.props[r];(Wr(o)||o===!1)&&(t[r]=o)}return t}const wM=[...Vl].reverse(),xM=Vl.length;function bM(e){return t=>Promise.all(t.map(({animation:n,options:r})=>vM(e,n,r)))}function SM(e){let t=bM(e),n=_u(),r=!0;const o=l=>(c,u)=>{var p;const d=Gr(e,u,l==="exit"?(p=e.presenceContext)==null?void 0:p.custom:void 0);if(d){const{transition:f,transitionEnd:g,...h}=d;c={...c,...h,...g}}return c};function s(l){t=l(e)}function i(l){const{props:c}=e,u=$g(e.parent)||{},d=[],p=new Set;let f={},g=1/0;for(let b=0;b<xM;b++){const w=wM[b],v=n[w],m=c[w]!==void 0?c[w]:u[w],C=Wr(m),x=w===l?v.isActive:null;x===!1&&(g=b);let D=m===u[w]&&m!==c[w]&&C;if(D&&r&&e.manuallyAnimateOnMount&&(D=!1),v.protectedKeys={...f},!v.isActive&&x===null||!m&&!v.prevProp||Os(m)||typeof m=="boolean")continue;const S=CM(v.prevProp,m);let M=S||w===l&&v.isActive&&!D&&C||b>g&&C,P=!1;const O=Array.isArray(m)?m:[m];let _=O.reduce(o(w),{});x===!1&&(_={});const{prevResolvedValues:V={}}=v,G={...V,..._},F=j=>{M=!0,p.has(j)&&(P=!0,p.delete(j)),v.needsAnimating[j]=!0;const E=e.getValue(j);E&&(E.liveStyle=!1)};for(const j in G){const E=_[j],N=V[j];if(f.hasOwnProperty(j))continue;let A=!1;fa(E)&&fa(N)?A=!Lg(E,N):A=E!==N,A?E!=null?F(j):p.add(j):E!==void 0&&p.has(j)?F(j):v.protectedKeys[j]=!0}v.prevProp=m,v.prevResolvedValues=_,v.isActive&&(f={...f,..._}),r&&e.blockInitialAnimation&&(M=!1),M&&(!(D&&S)||P)&&d.push(...O.map(j=>({animation:j,options:{type:w}})))}if(p.size){const b={};if(typeof c.initial!="boolean"){const w=Gr(e,Array.isArray(c.initial)?c.initial[0]:c.initial);w&&w.transition&&(b.transition=w.transition)}p.forEach(w=>{const v=e.getBaseTarget(w),m=e.getValue(w);m&&(m.liveStyle=!0),b[w]=v??null}),d.push({animation:b})}let h=!!d.length;return r&&(c.initial===!1||c.initial===c.animate)&&!e.manuallyAnimateOnMount&&(h=!1),r=!1,h?t(d):Promise.resolve()}function a(l,c){var d;if(n[l].isActive===c)return Promise.resolve();(d=e.variantChildren)==null||d.forEach(p=>{var f;return(f=p.animationState)==null?void 0:f.setActive(l,c)}),n[l].isActive=c;const u=i(l);for(const p in n)n[p].protectedKeys={};return u}return{animateChanges:i,setActive:a,setAnimateFunction:s,getState:()=>n,reset:()=>{n=_u(),r=!0}}}function CM(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!Lg(t,e):!1}function fn(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function _u(){return{animate:fn(!0),whileInView:fn(),whileHover:fn(),whileTap:fn(),whileDrag:fn(),whileFocus:fn(),exit:fn()}}class sn{constructor(t){this.isMounted=!1,this.node=t}update(){}}class RM extends sn{constructor(t){super(t),t.animationState||(t.animationState=SM(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();Os(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)==null||t.call(this)}}let TM=0;class DM extends sn{constructor(){super(...arguments),this.id=TM++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===r)return;const o=this.node.animationState.setActive("exit",!t);n&&!t&&o.then(()=>{n(this.id)})}mount(){const{register:t,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const MM={animation:{Feature:RM},exit:{Feature:DM}};function Yr(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function co(e){return{point:{x:e.pageX,y:e.pageY}}}const EM=e=>t=>Fl(t)&&e(t,co(t));function Er(e,t,n,r){return Yr(e,t,EM(n),r)}function Bg({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function PM({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function AM(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}const zg=1e-4,OM=1-zg,_M=1+zg,Hg=.01,kM=0-Hg,IM=0+Hg;function Fe(e){return e.max-e.min}function NM(e,t,n){return Math.abs(e-t)<=n}function ku(e,t,n,r=.5){e.origin=r,e.originPoint=we(t.min,t.max,e.origin),e.scale=Fe(n)/Fe(t),e.translate=we(n.min,n.max,e.origin)-e.originPoint,(e.scale>=OM&&e.scale<=_M||isNaN(e.scale))&&(e.scale=1),(e.translate>=kM&&e.translate<=IM||isNaN(e.translate))&&(e.translate=0)}function Pr(e,t,n,r){ku(e.x,t.x,n.x,r?r.originX:void 0),ku(e.y,t.y,n.y,r?r.originY:void 0)}function Iu(e,t,n){e.min=n.min+t.min,e.max=e.min+Fe(t)}function jM(e,t,n){Iu(e.x,t.x,n.x),Iu(e.y,t.y,n.y)}function Nu(e,t,n){e.min=t.min-n.min,e.max=e.min+Fe(t)}function Ar(e,t,n){Nu(e.x,t.x,n.x),Nu(e.y,t.y,n.y)}const ju=()=>({translate:0,scale:1,origin:0,originPoint:0}),Nn=()=>({x:ju(),y:ju()}),Fu=()=>({min:0,max:0}),Se=()=>({x:Fu(),y:Fu()});function Qe(e){return[e("x"),e("y")]}function mi(e){return e===void 0||e===1}function ga({scale:e,scaleX:t,scaleY:n}){return!mi(e)||!mi(t)||!mi(n)}function pn(e){return ga(e)||Wg(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function Wg(e){return Vu(e.x)||Vu(e.y)}function Vu(e){return e&&e!=="0%"}function is(e,t,n){const r=e-n,o=t*r;return n+o}function Lu(e,t,n,r,o){return o!==void 0&&(e=is(e,o,r)),is(e,n,r)+t}function ma(e,t=0,n=1,r,o){e.min=Lu(e.min,t,n,r,o),e.max=Lu(e.max,t,n,r,o)}function Ug(e,{x:t,y:n}){ma(e.x,t.translate,t.scale,t.originPoint),ma(e.y,n.translate,n.scale,n.originPoint)}const $u=.999999999999,Bu=1.0000000000001;function FM(e,t,n,r=!1){const o=n.length;if(!o)return;t.x=t.y=1;let s,i;for(let a=0;a<o;a++){s=n[a],i=s.projectionDelta;const{visualElement:l}=s.options;l&&l.props.style&&l.props.style.display==="contents"||(r&&s.options.layoutScroll&&s.scroll&&s!==s.root&&Fn(e,{x:-s.scroll.offset.x,y:-s.scroll.offset.y}),i&&(t.x*=i.x.scale,t.y*=i.y.scale,Ug(e,i)),r&&pn(s.latestValues)&&Fn(e,s.latestValues))}t.x<Bu&&t.x>$u&&(t.x=1),t.y<Bu&&t.y>$u&&(t.y=1)}function jn(e,t){e.min=e.min+t,e.max=e.max+t}function zu(e,t,n,r,o=.5){const s=we(e.min,e.max,o);ma(e,t,n,s,r)}function Fn(e,t){zu(e.x,t.x,t.scaleX,t.scale,t.originX),zu(e.y,t.y,t.scaleY,t.scale,t.originY)}function Gg(e,t){return Bg(AM(e.getBoundingClientRect(),t))}function VM(e,t,n){const r=Gg(e,n),{scroll:o}=t;return o&&(jn(r.x,o.offset.x),jn(r.y,o.offset.y)),r}const Yg=({current:e})=>e?e.ownerDocument.defaultView:null,Hu=(e,t)=>Math.abs(e-t);function LM(e,t){const n=Hu(e.x,t.x),r=Hu(e.y,t.y);return Math.sqrt(n**2+r**2)}class Kg{constructor(t,n,{transformPagePoint:r,contextWindow:o,dragSnapToOrigin:s=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const d=yi(this.lastMoveEventInfo,this.history),p=this.startEvent!==null,f=LM(d.offset,{x:0,y:0})>=3;if(!p&&!f)return;const{point:g}=d,{timestamp:h}=Ae;this.history.push({...g,timestamp:h});const{onStart:b,onMove:w}=this.handlers;p||(b&&b(this.lastMoveEvent,d),this.startEvent=this.lastMoveEvent),w&&w(this.lastMoveEvent,d)},this.handlePointerMove=(d,p)=>{this.lastMoveEvent=d,this.lastMoveEventInfo=vi(p,this.transformPagePoint),xe.update(this.updatePoint,!0)},this.handlePointerUp=(d,p)=>{this.end();const{onEnd:f,onSessionEnd:g,resumeAnimation:h}=this.handlers;if(this.dragSnapToOrigin&&h&&h(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const b=yi(d.type==="pointercancel"?this.lastMoveEventInfo:vi(p,this.transformPagePoint),this.history);this.startEvent&&f&&f(d,b),g&&g(d,b)},!Fl(t))return;this.dragSnapToOrigin=s,this.handlers=n,this.transformPagePoint=r,this.contextWindow=o||window;const i=co(t),a=vi(i,this.transformPagePoint),{point:l}=a,{timestamp:c}=Ae;this.history=[{...l,timestamp:c}];const{onSessionStart:u}=n;u&&u(t,yi(a,this.history)),this.removeListeners=io(Er(this.contextWindow,"pointermove",this.handlePointerMove),Er(this.contextWindow,"pointerup",this.handlePointerUp),Er(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),Jt(this.updatePoint)}}function vi(e,t){return t?{point:t(e.point)}:e}function Wu(e,t){return{x:e.x-t.x,y:e.y-t.y}}function yi({point:e},t){return{point:e,delta:Wu(e,qg(t)),offset:Wu(e,$M(t)),velocity:BM(t,.1)}}function $M(e){return e[0]}function qg(e){return e[e.length-1]}function BM(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const o=qg(e);for(;n>=0&&(r=e[n],!(o.timestamp-r.timestamp>at(t)));)n--;if(!r)return{x:0,y:0};const s=wt(o.timestamp-r.timestamp);if(s===0)return{x:0,y:0};const i={x:(o.x-r.x)/s,y:(o.y-r.y)/s};return i.x===1/0&&(i.x=0),i.y===1/0&&(i.y=0),i}function zM(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?we(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?we(n,e,r.max):Math.min(e,n)),e}function Uu(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function HM(e,{top:t,left:n,bottom:r,right:o}){return{x:Uu(e.x,n,o),y:Uu(e.y,t,r)}}function Gu(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function WM(e,t){return{x:Gu(e.x,t.x),y:Gu(e.y,t.y)}}function UM(e,t){let n=.5;const r=Fe(e),o=Fe(t);return o>r?n=Br(t.min,t.max-r,e.min):r>o&&(n=Br(e.min,e.max-o,t.min)),kt(0,1,n)}function GM(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const va=.35;function YM(e=va){return e===!1?e=0:e===!0&&(e=va),{x:Yu(e,"left","right"),y:Yu(e,"top","bottom")}}function Yu(e,t,n){return{min:Ku(e,t),max:Ku(e,n)}}function Ku(e,t){return typeof e=="number"?e:e[t]||0}const KM=new WeakMap;class qM{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Se(),this.visualElement=t}start(t,{snapToCursor:n=!1}={}){const{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;const o=u=>{const{dragSnapToOrigin:d}=this.getProps();d?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(co(u).point)},s=(u,d)=>{const{drag:p,dragPropagation:f,onDragStart:g}=this.getProps();if(p&&!f&&(this.openDragLock&&this.openDragLock(),this.openDragLock=fD(p),!this.openDragLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Qe(b=>{let w=this.getAxisMotionValue(b).get()||0;if(xt.test(w)){const{projection:v}=this.visualElement;if(v&&v.layout){const m=v.layout.layoutBox[b];m&&(w=Fe(m)*(parseFloat(w)/100))}}this.originPoint[b]=w}),g&&xe.postRender(()=>g(u,d)),pa(this.visualElement,"transform");const{animationState:h}=this.visualElement;h&&h.setActive("whileDrag",!0)},i=(u,d)=>{const{dragPropagation:p,dragDirectionLock:f,onDirectionLock:g,onDrag:h}=this.getProps();if(!p&&!this.openDragLock)return;const{offset:b}=d;if(f&&this.currentDirection===null){this.currentDirection=XM(b),this.currentDirection!==null&&g&&g(this.currentDirection);return}this.updateAxis("x",d.point,b),this.updateAxis("y",d.point,b),this.visualElement.render(),h&&h(u,d)},a=(u,d)=>this.stop(u,d),l=()=>Qe(u=>{var d;return this.getAnimationState(u)==="paused"&&((d=this.getAxisMotionValue(u).animation)==null?void 0:d.play())}),{dragSnapToOrigin:c}=this.getProps();this.panSession=new Kg(t,{onSessionStart:o,onStart:s,onMove:i,onSessionEnd:a,resumeAnimation:l},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:c,contextWindow:Yg(this.visualElement)})}stop(t,n){const r=this.isDragging;if(this.cancel(),!r)return;const{velocity:o}=n;this.startAnimation(o);const{onDragEnd:s}=this.getProps();s&&xe.postRender(()=>s(t,n))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(t,n,r){const{drag:o}=this.getProps();if(!r||!Ro(t,o,this.currentDirection))return;const s=this.getAxisMotionValue(t);let i=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(i=zM(i,this.constraints[t],this.elastic[t])),s.set(i)}resolveConstraints(){var s;const{dragConstraints:t,dragElastic:n}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(s=this.visualElement.projection)==null?void 0:s.layout,o=this.constraints;t&&In(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=HM(r.layoutBox,t):this.constraints=!1,this.elastic=YM(n),o!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&Qe(i=>{this.constraints!==!1&&this.getAxisMotionValue(i)&&(this.constraints[i]=GM(r.layoutBox[i],this.constraints[i]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!In(t))return!1;const r=t.current;It(r!==null,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.");const{projection:o}=this.visualElement;if(!o||!o.layout)return!1;const s=VM(r,o.root,this.visualElement.getTransformPagePoint());let i=WM(o.layout.layoutBox,s);if(n){const a=n(PM(i));this.hasMutatedConstraints=!!a,a&&(i=Bg(a))}return i}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:o,dragTransition:s,dragSnapToOrigin:i,onDragTransitionEnd:a}=this.getProps(),l=this.constraints||{},c=Qe(u=>{if(!Ro(u,n,this.currentDirection))return;let d=l&&l[u]||{};i&&(d={min:0,max:0});const p=o?200:1e6,f=o?40:1e7,g={type:"inertia",velocity:r?t[u]:0,bounceStiffness:p,bounceDamping:f,timeConstant:750,restDelta:1,restSpeed:10,...s,...d};return this.startAxisValueAnimation(u,g)});return Promise.all(c).then(a)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return pa(this.visualElement,t),r.start(Gl(t,r,0,n,this.visualElement,!1))}stopAnimation(){Qe(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){Qe(t=>{var n;return(n=this.getAxisMotionValue(t).animation)==null?void 0:n.pause()})}getAnimationState(t){var n;return(n=this.getAxisMotionValue(t).animation)==null?void 0:n.state}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,r=this.visualElement.getProps(),o=r[n];return o||this.visualElement.getValue(t,(r.initial?r.initial[t]:void 0)||0)}snapToCursor(t){Qe(n=>{const{drag:r}=this.getProps();if(!Ro(n,r,this.currentDirection))return;const{projection:o}=this.visualElement,s=this.getAxisMotionValue(n);if(o&&o.layout){const{min:i,max:a}=o.layout.layoutBox[n];s.set(t[n]-we(i,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!In(n)||!r||!this.constraints)return;this.stopAnimation();const o={x:0,y:0};Qe(i=>{const a=this.getAxisMotionValue(i);if(a&&this.constraints!==!1){const l=a.get();o[i]=UM({min:l,max:l},this.constraints[i])}});const{transformTemplate:s}=this.visualElement.getProps();this.visualElement.current.style.transform=s?s({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),Qe(i=>{if(!Ro(i,t,null))return;const a=this.getAxisMotionValue(i),{min:l,max:c}=this.constraints[i];a.set(we(l,c,o[i]))})}addListeners(){if(!this.visualElement.current)return;KM.set(this.visualElement,this);const t=this.visualElement.current,n=Er(t,"pointerdown",l=>{const{drag:c,dragListener:u=!0}=this.getProps();c&&u&&this.start(l)}),r=()=>{const{dragConstraints:l}=this.getProps();In(l)&&l.current&&(this.constraints=this.resolveRefConstraints())},{projection:o}=this.visualElement,s=o.addEventListener("measure",r);o&&!o.layout&&(o.root&&o.root.updateScroll(),o.updateLayout()),xe.read(r);const i=Yr(window,"resize",()=>this.scalePositionWithinConstraints()),a=o.addEventListener("didUpdate",({delta:l,hasLayoutChanged:c})=>{this.isDragging&&c&&(Qe(u=>{const d=this.getAxisMotionValue(u);d&&(this.originPoint[u]+=l[u].translate,d.set(d.get()+l[u].translate))}),this.visualElement.render())});return()=>{i(),n(),s(),a&&a()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:o=!1,dragConstraints:s=!1,dragElastic:i=va,dragMomentum:a=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:o,dragConstraints:s,dragElastic:i,dragMomentum:a}}}function Ro(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function XM(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class ZM extends sn{constructor(t){super(t),this.removeGroupControls=nt,this.removeListeners=nt,this.controls=new qM(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||nt}unmount(){this.removeGroupControls(),this.removeListeners()}}const qu=e=>(t,n)=>{e&&xe.postRender(()=>e(t,n))};class JM extends sn{constructor(){super(...arguments),this.removePointerDownListener=nt}onPointerDown(t){this.session=new Kg(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Yg(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:o}=this.node.getProps();return{onSessionStart:qu(t),onStart:qu(n),onMove:r,onEnd:(s,i)=>{delete this.session,o&&xe.postRender(()=>o(s,i))}}}mount(){this.removePointerDownListener=Er(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const Bo={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function Xu(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const pr={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(re.test(e))e=parseFloat(e);else return e;const n=Xu(e,t.target.x),r=Xu(e,t.target.y);return`${n}% ${r}%`}},QM={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,o=Qt.parse(e);if(o.length>5)return r;const s=Qt.createTransformer(e),i=typeof o[0]!="number"?1:0,a=n.x.scale*t.x,l=n.y.scale*t.y;o[0+i]/=a,o[1+i]/=l;const c=we(a,l,.5);return typeof o[2+i]=="number"&&(o[2+i]/=c),typeof o[3+i]=="number"&&(o[3+i]/=c),s(o)}};class eE extends R.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:o}=this.props,{projection:s}=t;VD(tE),s&&(n.group&&n.group.add(s),r&&r.register&&o&&r.register(s),s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions({...s.options,onExitComplete:()=>this.safeToRemove()})),Bo.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:o,isPresent:s}=this.props,{projection:i}=r;return i&&(i.isPresent=s,o||t.layoutDependency!==n||n===void 0||t.isPresent!==s?i.willUpdate():this.safeToRemove(),t.isPresent!==s&&(s?i.promote():i.relegate()||xe.postRender(()=>{const a=i.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),jl.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:o}=t;o&&(o.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(o),r&&r.deregister&&r.deregister(o))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function Xg(e){const[t,n]=bD(),r=R.useContext(_h);return y.jsx(eE,{...e,layoutGroup:r,switchLayoutGroup:R.useContext(Eg),isPresent:t,safeToRemove:n})}const tE={borderRadius:{...pr,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:pr,borderTopRightRadius:pr,borderBottomLeftRadius:pr,borderBottomRightRadius:pr,boxShadow:QM};function nE(e,t,n){const r=je(e)?e:Wn(e);return r.start(Gl("",r,t,n)),r.animation}const rE=(e,t)=>e.depth-t.depth;class oE{constructor(){this.children=[],this.isDirty=!1}add(t){vl(this.children,t),this.isDirty=!0}remove(t){yl(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(rE),this.isDirty=!1,this.children.forEach(t)}}function sE(e,t){const n=ze.now(),r=({timestamp:o})=>{const s=o-n;s>=t&&(Jt(r),e(s-t))};return xe.setup(r,!0),()=>Jt(r)}const Zg=["TopLeft","TopRight","BottomLeft","BottomRight"],iE=Zg.length,Zu=e=>typeof e=="string"?parseFloat(e):e,Ju=e=>typeof e=="number"||re.test(e);function aE(e,t,n,r,o,s){o?(e.opacity=we(0,n.opacity??1,lE(r)),e.opacityExit=we(t.opacity??1,0,cE(r))):s&&(e.opacity=we(t.opacity??1,n.opacity??1,r));for(let i=0;i<iE;i++){const a=`border${Zg[i]}Radius`;let l=Qu(t,a),c=Qu(n,a);if(l===void 0&&c===void 0)continue;l||(l=0),c||(c=0),l===0||c===0||Ju(l)===Ju(c)?(e[a]=Math.max(we(Zu(l),Zu(c),r),0),(xt.test(c)||xt.test(l))&&(e[a]+="%")):e[a]=c}(t.rotate||n.rotate)&&(e.rotate=we(t.rotate||0,n.rotate||0,r))}function Qu(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const lE=Jg(0,.5,Hh),cE=Jg(.5,.95,nt);function Jg(e,t,n){return r=>r<e?0:r>t?1:n(Br(e,t,r))}function ed(e,t){e.min=t.min,e.max=t.max}function Je(e,t){ed(e.x,t.x),ed(e.y,t.y)}function td(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function nd(e,t,n,r,o){return e-=t,e=is(e,1/n,r),o!==void 0&&(e=is(e,1/o,r)),e}function uE(e,t=0,n=1,r=.5,o,s=e,i=e){if(xt.test(t)&&(t=parseFloat(t),t=we(i.min,i.max,t/100)-i.min),typeof t!="number")return;let a=we(s.min,s.max,r);e===s&&(a-=t),e.min=nd(e.min,t,n,a,o),e.max=nd(e.max,t,n,a,o)}function rd(e,t,[n,r,o],s,i){uE(e,t[n],t[r],t[o],t.scale,s,i)}const dE=["x","scaleX","originX"],fE=["y","scaleY","originY"];function od(e,t,n,r){rd(e.x,t,dE,n?n.x:void 0,r?r.x:void 0),rd(e.y,t,fE,n?n.y:void 0,r?r.y:void 0)}function sd(e){return e.translate===0&&e.scale===1}function Qg(e){return sd(e.x)&&sd(e.y)}function id(e,t){return e.min===t.min&&e.max===t.max}function pE(e,t){return id(e.x,t.x)&&id(e.y,t.y)}function ad(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function em(e,t){return ad(e.x,t.x)&&ad(e.y,t.y)}function ld(e){return Fe(e.x)/Fe(e.y)}function cd(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class hE{constructor(){this.members=[]}add(t){vl(this.members,t),t.scheduleRender()}remove(t){if(yl(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(o=>t===o);if(n===0)return!1;let r;for(let o=n;o>=0;o--){const s=this.members[o];if(s.isPresent!==!1){r=s;break}}return r?(this.promote(r),!0):!1}promote(t,n){const r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.instance&&r.scheduleRender(),t.scheduleRender(),t.resumeFrom=r,n&&(t.resumeFrom.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:o}=t.options;o===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:r}=t;n.onExitComplete&&n.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function gE(e,t,n){let r="";const o=e.x.translate/t.x,s=e.y.translate/t.y,i=(n==null?void 0:n.z)||0;if((o||s||i)&&(r=`translate3d(${o}px, ${s}px, ${i}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:c,rotate:u,rotateX:d,rotateY:p,skewX:f,skewY:g}=n;c&&(r=`perspective(${c}px) ${r}`),u&&(r+=`rotate(${u}deg) `),d&&(r+=`rotateX(${d}deg) `),p&&(r+=`rotateY(${p}deg) `),f&&(r+=`skewX(${f}deg) `),g&&(r+=`skewY(${g}deg) `)}const a=e.x.scale*t.x,l=e.y.scale*t.y;return(a!==1||l!==1)&&(r+=`scale(${a}, ${l})`),r||"none"}const wi=["","X","Y","Z"],mE={visibility:"hidden"},vE=1e3;let yE=0;function xi(e,t,n,r){const{latestValues:o}=t;o[e]&&(n[e]=o[e],t.setStaticValue(e,0),r&&(r[e]=0))}function tm(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=Fg(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:o,layoutId:s}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",xe,!(o||s))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&tm(r)}function nm({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:o}){return class{constructor(i={},a=t==null?void 0:t()){this.id=yE++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(bE),this.nodes.forEach(DE),this.nodes.forEach(ME),this.nodes.forEach(SE)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=i,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let l=0;l<this.path.length;l++)this.path[l].shouldResetTransform=!0;this.root===this&&(this.nodes=new oE)}addEventListener(i,a){return this.eventHandlers.has(i)||this.eventHandlers.set(i,new xl),this.eventHandlers.get(i).add(a)}notifyListeners(i,...a){const l=this.eventHandlers.get(i);l&&l.notify(...a)}hasListeners(i){return this.eventHandlers.has(i)}mount(i){if(this.instance)return;this.isSVG=Sg(i)&&!yD(i),this.instance=i;const{layoutId:a,layout:l,visualElement:c}=this.options;if(c&&!c.current&&c.mount(i),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(l||a)&&(this.isLayoutDirty=!0),e){let u;const d=()=>this.root.updateBlockedByResize=!1;e(i,()=>{this.root.updateBlockedByResize=!0,u&&u(),u=sE(d,250),Bo.hasAnimatedSinceResize&&(Bo.hasAnimatedSinceResize=!1,this.nodes.forEach(dd))})}a&&this.root.registerSharedNode(a,this),this.options.animate!==!1&&c&&(a||l)&&this.addEventListener("didUpdate",({delta:u,hasLayoutChanged:d,hasRelativeLayoutChanged:p,layout:f})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const g=this.options.transition||c.getDefaultTransition()||_E,{onLayoutAnimationStart:h,onLayoutAnimationComplete:b}=c.getProps(),w=!this.targetLayout||!em(this.targetLayout,f),v=!d&&p;if(this.options.layoutRoot||this.resumeFrom||v||d&&(w||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(u,v);const m={...Il(g,"layout"),onPlay:h,onComplete:b};(c.shouldReduceMotion||this.options.layoutRoot)&&(m.delay=0,m.type=!1),this.startAnimation(m)}else d||dd(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=f})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const i=this.getStack();i&&i.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),Jt(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(EE),this.animationId++)}getTransformTemplate(){const{visualElement:i}=this.options;return i&&i.getProps().transformTemplate}willUpdate(i=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&tm(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let u=0;u<this.path.length;u++){const d=this.path[u];d.shouldResetTransform=!0,d.updateScroll("snapshot"),d.options.layoutRoot&&d.willUpdate(!1)}const{layoutId:a,layout:l}=this.options;if(a===void 0&&!l)return;const c=this.getTransformTemplate();this.prevTransformTemplateValue=c?c(this.latestValues,""):void 0,this.updateSnapshot(),i&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(ud);return}this.isUpdating||this.nodes.forEach(RE),this.isUpdating=!1,this.nodes.forEach(TE),this.nodes.forEach(wE),this.nodes.forEach(xE),this.clearAllSnapshots();const a=ze.now();Ae.delta=kt(0,1e3/60,a-Ae.timestamp),Ae.timestamp=a,Ae.isProcessing=!0,di.update.process(Ae),di.preRender.process(Ae),di.render.process(Ae),Ae.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,jl.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(CE),this.sharedNodes.forEach(PE)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,xe.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){xe.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!Fe(this.snapshot.measuredBox.x)&&!Fe(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let l=0;l<this.path.length;l++)this.path[l].updateScroll();const i=this.layout;this.layout=this.measure(!1),this.layoutCorrected=Se(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:a}=this.options;a&&a.notify("LayoutMeasure",this.layout.layoutBox,i?i.layoutBox:void 0)}updateScroll(i="measure"){let a=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===i&&(a=!1),a&&this.instance){const l=r(this.instance);this.scroll={animationId:this.root.animationId,phase:i,isRoot:l,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:l}}}resetTransform(){if(!o)return;const i=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,a=this.projectionDelta&&!Qg(this.projectionDelta),l=this.getTransformTemplate(),c=l?l(this.latestValues,""):void 0,u=c!==this.prevTransformTemplateValue;i&&this.instance&&(a||pn(this.latestValues)||u)&&(o(this.instance,c),this.shouldResetTransform=!1,this.scheduleRender())}measure(i=!0){const a=this.measurePageBox();let l=this.removeElementScroll(a);return i&&(l=this.removeTransform(l)),kE(l),{animationId:this.root.animationId,measuredBox:a,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){var c;const{visualElement:i}=this.options;if(!i)return Se();const a=i.measureViewportBox();if(!(((c=this.scroll)==null?void 0:c.wasRoot)||this.path.some(IE))){const{scroll:u}=this.root;u&&(jn(a.x,u.offset.x),jn(a.y,u.offset.y))}return a}removeElementScroll(i){var l;const a=Se();if(Je(a,i),(l=this.scroll)!=null&&l.wasRoot)return a;for(let c=0;c<this.path.length;c++){const u=this.path[c],{scroll:d,options:p}=u;u!==this.root&&d&&p.layoutScroll&&(d.wasRoot&&Je(a,i),jn(a.x,d.offset.x),jn(a.y,d.offset.y))}return a}applyTransform(i,a=!1){const l=Se();Je(l,i);for(let c=0;c<this.path.length;c++){const u=this.path[c];!a&&u.options.layoutScroll&&u.scroll&&u!==u.root&&Fn(l,{x:-u.scroll.offset.x,y:-u.scroll.offset.y}),pn(u.latestValues)&&Fn(l,u.latestValues)}return pn(this.latestValues)&&Fn(l,this.latestValues),l}removeTransform(i){const a=Se();Je(a,i);for(let l=0;l<this.path.length;l++){const c=this.path[l];if(!c.instance||!pn(c.latestValues))continue;ga(c.latestValues)&&c.updateSnapshot();const u=Se(),d=c.measurePageBox();Je(u,d),od(a,c.latestValues,c.snapshot?c.snapshot.layoutBox:void 0,u)}return pn(this.latestValues)&&od(a,this.latestValues),a}setTargetDelta(i){this.targetDelta=i,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(i){this.options={...this.options,...i,crossfade:i.crossfade!==void 0?i.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==Ae.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(i=!1){var p;const a=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=a.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=a.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=a.isSharedProjectionDirty);const l=!!this.resumingFrom||this!==a;if(!(i||l&&this.isSharedProjectionDirty||this.isProjectionDirty||(p=this.parent)!=null&&p.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:u,layoutId:d}=this.options;if(!(!this.layout||!(u||d))){if(this.resolvedRelativeTargetAt=Ae.timestamp,!this.targetDelta&&!this.relativeTarget){const f=this.getClosestProjectingParent();f&&f.layout&&this.animationProgress!==1?(this.relativeParent=f,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Se(),this.relativeTargetOrigin=Se(),Ar(this.relativeTargetOrigin,this.layout.layoutBox,f.layout.layoutBox),Je(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=Se(),this.targetWithTransforms=Se()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),jM(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):Je(this.target,this.layout.layoutBox),Ug(this.target,this.targetDelta)):Je(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget)){this.attemptToResolveRelativeTarget=!1;const f=this.getClosestProjectingParent();f&&!!f.resumingFrom==!!this.resumingFrom&&!f.options.layoutScroll&&f.target&&this.animationProgress!==1?(this.relativeParent=f,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Se(),this.relativeTargetOrigin=Se(),Ar(this.relativeTargetOrigin,this.target,f.target),Je(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}}}getClosestProjectingParent(){if(!(!this.parent||ga(this.parent.latestValues)||Wg(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var g;const i=this.getLead(),a=!!this.resumingFrom||this!==i;let l=!0;if((this.isProjectionDirty||(g=this.parent)!=null&&g.isProjectionDirty)&&(l=!1),a&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(l=!1),this.resolvedRelativeTargetAt===Ae.timestamp&&(l=!1),l)return;const{layout:c,layoutId:u}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(c||u))return;Je(this.layoutCorrected,this.layout.layoutBox);const d=this.treeScale.x,p=this.treeScale.y;FM(this.layoutCorrected,this.treeScale,this.path,a),i.layout&&!i.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(i.target=i.layout.layoutBox,i.targetWithTransforms=Se());const{target:f}=i;if(!f){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(td(this.prevProjectionDelta.x,this.projectionDelta.x),td(this.prevProjectionDelta.y,this.projectionDelta.y)),Pr(this.projectionDelta,this.layoutCorrected,f,this.latestValues),(this.treeScale.x!==d||this.treeScale.y!==p||!cd(this.projectionDelta.x,this.prevProjectionDelta.x)||!cd(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",f))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(i=!0){var a;if((a=this.options.visualElement)==null||a.scheduleRender(),i){const l=this.getStack();l&&l.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Nn(),this.projectionDelta=Nn(),this.projectionDeltaWithTransform=Nn()}setAnimationOrigin(i,a=!1){const l=this.snapshot,c=l?l.latestValues:{},u={...this.latestValues},d=Nn();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const p=Se(),f=l?l.source:void 0,g=this.layout?this.layout.source:void 0,h=f!==g,b=this.getStack(),w=!b||b.members.length<=1,v=!!(h&&!w&&this.options.crossfade===!0&&!this.path.some(OE));this.animationProgress=0;let m;this.mixTargetDelta=C=>{const x=C/1e3;fd(d.x,i.x,x),fd(d.y,i.y,x),this.setTargetDelta(d),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Ar(p,this.layout.layoutBox,this.relativeParent.layout.layoutBox),AE(this.relativeTarget,this.relativeTargetOrigin,p,x),m&&pE(this.relativeTarget,m)&&(this.isProjectionDirty=!1),m||(m=Se()),Je(m,this.relativeTarget)),h&&(this.animationValues=u,aE(u,c,this.latestValues,x,v,w)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=x},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(i){var a,l,c;this.notifyListeners("animationStart"),(a=this.currentAnimation)==null||a.stop(!1),(c=(l=this.resumingFrom)==null?void 0:l.currentAnimation)==null||c.stop(!1),this.pendingAnimation&&(Jt(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=xe.update(()=>{Bo.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Wn(0)),this.currentAnimation=nE(this.motionValue,[0,1e3],{...i,isSync:!0,onUpdate:u=>{this.mixTargetDelta(u),i.onUpdate&&i.onUpdate(u)},onStop:()=>{},onComplete:()=>{i.onComplete&&i.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const i=this.getStack();i&&i.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(vE),this.currentAnimation.stop(!1)),this.completeAnimation()}applyTransformsToTarget(){const i=this.getLead();let{targetWithTransforms:a,target:l,layout:c,latestValues:u}=i;if(!(!a||!l||!c)){if(this!==i&&this.layout&&c&&rm(this.options.animationType,this.layout.layoutBox,c.layoutBox)){l=this.target||Se();const d=Fe(this.layout.layoutBox.x);l.x.min=i.target.x.min,l.x.max=l.x.min+d;const p=Fe(this.layout.layoutBox.y);l.y.min=i.target.y.min,l.y.max=l.y.min+p}Je(a,l),Fn(a,u),Pr(this.projectionDeltaWithTransform,this.layoutCorrected,a,u)}}registerSharedNode(i,a){this.sharedNodes.has(i)||this.sharedNodes.set(i,new hE),this.sharedNodes.get(i).add(a);const c=a.options.initialPromotionConfig;a.promote({transition:c?c.transition:void 0,preserveFollowOpacity:c&&c.shouldPreserveFollowOpacity?c.shouldPreserveFollowOpacity(a):void 0})}isLead(){const i=this.getStack();return i?i.lead===this:!0}getLead(){var a;const{layoutId:i}=this.options;return i?((a=this.getStack())==null?void 0:a.lead)||this:this}getPrevLead(){var a;const{layoutId:i}=this.options;return i?(a=this.getStack())==null?void 0:a.prevLead:void 0}getStack(){const{layoutId:i}=this.options;if(i)return this.root.sharedNodes.get(i)}promote({needsReset:i,transition:a,preserveFollowOpacity:l}={}){const c=this.getStack();c&&c.promote(this,l),i&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const i=this.getStack();return i?i.relegate(this):!1}resetSkewAndRotation(){const{visualElement:i}=this.options;if(!i)return;let a=!1;const{latestValues:l}=i;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(a=!0),!a)return;const c={};l.z&&xi("z",i,c,this.animationValues);for(let u=0;u<wi.length;u++)xi(`rotate${wi[u]}`,i,c,this.animationValues),xi(`skew${wi[u]}`,i,c,this.animationValues);i.render();for(const u in c)i.setStaticValue(u,c[u]),this.animationValues&&(this.animationValues[u]=c[u]);i.scheduleRender()}getProjectionStyles(i){if(!this.instance||this.isSVG)return;if(!this.isVisible)return mE;const a={visibility:""},l=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,a.opacity="",a.pointerEvents=$o(i==null?void 0:i.pointerEvents)||"",a.transform=l?l(this.latestValues,""):"none",a;const c=this.getLead();if(!this.projectionDelta||!this.layout||!c.target){const f={};return this.options.layoutId&&(f.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,f.pointerEvents=$o(i==null?void 0:i.pointerEvents)||""),this.hasProjected&&!pn(this.latestValues)&&(f.transform=l?l({},""):"none",this.hasProjected=!1),f}const u=c.animationValues||c.latestValues;this.applyTransformsToTarget(),a.transform=gE(this.projectionDeltaWithTransform,this.treeScale,u),l&&(a.transform=l(u,a.transform));const{x:d,y:p}=this.projectionDelta;a.transformOrigin=`${d.origin*100}% ${p.origin*100}% 0`,c.animationValues?a.opacity=c===this?u.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:u.opacityExit:a.opacity=c===this?u.opacity!==void 0?u.opacity:"":u.opacityExit!==void 0?u.opacityExit:0;for(const f in Ur){if(u[f]===void 0)continue;const{correct:g,applyTo:h,isCSSVariable:b}=Ur[f],w=a.transform==="none"?u[f]:g(u[f],c);if(h){const v=h.length;for(let m=0;m<v;m++)a[h[m]]=w}else b?this.options.visualElement.renderState.vars[f]=w:a[f]=w}return this.options.layoutId&&(a.pointerEvents=c===this?$o(i==null?void 0:i.pointerEvents)||"":"none"),a}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(i=>{var a;return(a=i.currentAnimation)==null?void 0:a.stop(!1)}),this.root.nodes.forEach(ud),this.root.sharedNodes.clear()}}}function wE(e){e.updateLayout()}function xE(e){var n;const t=((n=e.resumeFrom)==null?void 0:n.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:o}=e.layout,{animationType:s}=e.options,i=t.source!==e.layout.source;s==="size"?Qe(d=>{const p=i?t.measuredBox[d]:t.layoutBox[d],f=Fe(p);p.min=r[d].min,p.max=p.min+f}):rm(s,t.layoutBox,r)&&Qe(d=>{const p=i?t.measuredBox[d]:t.layoutBox[d],f=Fe(r[d]);p.max=p.min+f,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[d].max=e.relativeTarget[d].min+f)});const a=Nn();Pr(a,r,t.layoutBox);const l=Nn();i?Pr(l,e.applyTransform(o,!0),t.measuredBox):Pr(l,r,t.layoutBox);const c=!Qg(a);let u=!1;if(!e.resumeFrom){const d=e.getClosestProjectingParent();if(d&&!d.resumeFrom){const{snapshot:p,layout:f}=d;if(p&&f){const g=Se();Ar(g,t.layoutBox,p.layoutBox);const h=Se();Ar(h,r,f.layoutBox),em(g,h)||(u=!0),d.options.layoutRoot&&(e.relativeTarget=h,e.relativeTargetOrigin=g,e.relativeParent=d)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:t,delta:l,layoutDelta:a,hasLayoutChanged:c,hasRelativeLayoutChanged:u})}else if(e.isLead()){const{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function bE(e){e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function SE(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function CE(e){e.clearSnapshot()}function ud(e){e.clearMeasurements()}function RE(e){e.isLayoutDirty=!1}function TE(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function dd(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function DE(e){e.resolveTargetDelta()}function ME(e){e.calcProjection()}function EE(e){e.resetSkewAndRotation()}function PE(e){e.removeLeadSnapshot()}function fd(e,t,n){e.translate=we(t.translate,0,n),e.scale=we(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function pd(e,t,n,r){e.min=we(t.min,n.min,r),e.max=we(t.max,n.max,r)}function AE(e,t,n,r){pd(e.x,t.x,n.x,r),pd(e.y,t.y,n.y,r)}function OE(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const _E={duration:.45,ease:[.4,0,.1,1]},hd=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),gd=hd("applewebkit/")&&!hd("chrome/")?Math.round:nt;function md(e){e.min=gd(e.min),e.max=gd(e.max)}function kE(e){md(e.x),md(e.y)}function rm(e,t,n){return e==="position"||e==="preserve-aspect"&&!NM(ld(t),ld(n),.2)}function IE(e){var t;return e!==e.root&&((t=e.scroll)==null?void 0:t.wasRoot)}const NE=nm({attachResizeListener:(e,t)=>Yr(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),bi={current:void 0},om=nm({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!bi.current){const e=new NE({});e.mount(window),e.setOptions({layoutScroll:!0}),bi.current=e}return bi.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),jE={pan:{Feature:JM},drag:{Feature:ZM,ProjectionNode:om,MeasureLayout:Xg}};function vd(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",n==="Start");const o="onHover"+n,s=r[o];s&&xe.postRender(()=>s(t,co(t)))}class FE extends sn{mount(){const{current:t}=this.node;t&&(this.unmount=pD(t,(n,r)=>(vd(this.node,r,"Start"),o=>vd(this.node,o,"End"))))}unmount(){}}class VE extends sn{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=io(Yr(this.node.current,"focus",()=>this.onFocus()),Yr(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function yd(e,t,n){const{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap",n==="Start");const o="onTap"+(n==="End"?"":n),s=r[o];s&&xe.postRender(()=>s(t,co(t)))}class LE extends sn{mount(){const{current:t}=this.node;t&&(this.unmount=vD(t,(n,r)=>(yd(this.node,r,"Start"),(o,{success:s})=>yd(this.node,o,s?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const ya=new WeakMap,Si=new WeakMap,$E=e=>{const t=ya.get(e.target);t&&t(e)},BE=e=>{e.forEach($E)};function zE({root:e,...t}){const n=e||document;Si.has(n)||Si.set(n,{});const r=Si.get(n),o=JSON.stringify(t);return r[o]||(r[o]=new IntersectionObserver(BE,{root:e,...t})),r[o]}function HE(e,t,n){const r=zE(t);return ya.set(e,n),r.observe(e),()=>{ya.delete(e),r.unobserve(e)}}const WE={some:0,all:1};class UE extends sn{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:o="some",once:s}=t,i={root:n?n.current:void 0,rootMargin:r,threshold:typeof o=="number"?o:WE[o]},a=l=>{const{isIntersecting:c}=l;if(this.isInView===c||(this.isInView=c,s&&!c&&this.hasEnteredView))return;c&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",c);const{onViewportEnter:u,onViewportLeave:d}=this.node.getProps(),p=c?u:d;p&&p(l)};return HE(this.node.current,i,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(GE(t,n))&&this.startObserver()}unmount(){}}function GE({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const YE={inView:{Feature:UE},tap:{Feature:LE},focus:{Feature:VE},hover:{Feature:FE}},KE={layout:{ProjectionNode:om,MeasureLayout:Xg}},wa={current:null},sm={current:!1};function qE(){if(sm.current=!0,!!gl)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>wa.current=e.matches;e.addListener(t),t()}else wa.current=!1}const XE=new WeakMap;function ZE(e,t,n){for(const r in t){const o=t[r],s=n[r];if(je(o))e.addValue(r,o);else if(je(s))e.addValue(r,Wn(o,{owner:e}));else if(s!==o)if(e.hasValue(r)){const i=e.getValue(r);i.liveStyle===!0?i.jump(o):i.hasAnimated||i.set(o)}else{const i=e.getStaticValue(r);e.addValue(r,Wn(i!==void 0?i:o,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const wd=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class JE{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:o,blockInitialAnimation:s,visualState:i},a={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=kl,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const p=ze.now();this.renderScheduledAt<p&&(this.renderScheduledAt=p,xe.render(this.render,!1,!0))};const{latestValues:l,renderState:c}=i;this.latestValues=l,this.baseTarget={...l},this.initialValues=n.initial?{...l}:{},this.renderState=c,this.parent=t,this.props=n,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=o,this.options=a,this.blockInitialAnimation=!!s,this.isControllingVariants=_s(n),this.isVariantNode=Dg(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:u,...d}=this.scrapeMotionValuesFromProps(n,{},this);for(const p in d){const f=d[p];l[p]!==void 0&&je(f)&&f.set(l[p],!1)}}mount(t){this.current=t,XE.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,r)=>this.bindToMotionValue(r,n)),sm.current||qE(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:wa.current,process.env.NODE_ENV!=="production"&&bl(this.shouldReduceMotion!==!0,"You have Reduced Motion enabled on your device. Animations may not appear as expected."),this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),Jt(this.notifyUpdate),Jt(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const n=this.features[t];n&&(n.unmount(),n.isMounted=!1)}this.current=null}bindToMotionValue(t,n){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const r=sr.has(t);r&&this.onBindTransform&&this.onBindTransform();const o=n.on("change",a=>{this.latestValues[t]=a,this.props.onUpdate&&xe.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0)}),s=n.on("renderRequest",this.scheduleRender);let i;window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{o(),s(),i&&i(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in Un){const n=Un[t];if(!n)continue;const{isEnabled:r,Feature:o}=n;if(!this.features[t]&&o&&r(this.props)&&(this.features[t]=new o(this)),this.features[t]){const s=this.features[t];s.isMounted?s.update():(s.mount(),s.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Se()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;r<wd.length;r++){const o=wd[r];this.propEventSubscriptions[o]&&(this.propEventSubscriptions[o](),delete this.propEventSubscriptions[o]);const s="on"+o,i=t[s];i&&(this.propEventSubscriptions[o]=this.on(o,i))}this.prevMotionValues=ZE(this,this.scrapeMotionValuesFromProps(t,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(t),()=>n.variantChildren.delete(t)}addValue(t,n){const r=this.values.get(t);n!==r&&(r&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&n!==void 0&&(r=Wn(n===null?void 0:n,{owner:this}),this.addValue(t,r)),r}readValue(t,n){let r=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return r!=null&&(typeof r=="string"&&(kh(r)||Nh(r))?r=parseFloat(r):!xD(r)&&Qt.test(n)&&(r=vg(t,n)),this.setBaseTarget(t,je(r)?r.get():r)),je(r)?r.get():r}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var s;const{initial:n}=this.props;let r;if(typeof n=="string"||typeof n=="object"){const i=Wl(this.props,n,(s=this.presenceContext)==null?void 0:s.custom);i&&(r=i[t])}if(n&&r!==void 0)return r;const o=this.getBaseTargetFromProps(this.props,t);return o!==void 0&&!je(o)?o:this.initialValues[t]!==void 0&&r===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new xl),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}}class im extends JE{constructor(){super(...arguments),this.KeyframeResolver=lD}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){return t.style?t.style[n]:void 0}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;je(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function am(e,{style:t,vars:n},r,o){Object.assign(e.style,t,o&&o.getProjectionStyles(r));for(const s in n)e.style.setProperty(s,n[s])}function QE(e){return window.getComputedStyle(e)}class eP extends im{constructor(){super(...arguments),this.type="html",this.renderInstance=am}readValueFromInstance(t,n){var r;if(sr.has(n))return(r=this.projection)!=null&&r.isProjecting?ia(n):DT(t,n);{const o=QE(t),s=(Rl(n)?o.getPropertyValue(n):o[n])||0;return typeof s=="string"?s.trim():s}}measureInstanceViewportBox(t,{transformPagePoint:n}){return Gg(t,n)}build(t,n,r){Bl(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return Ul(t,n,r)}}const lm=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function tP(e,t,n,r){am(e,t,void 0,r);for(const o in t.attrs)e.setAttribute(lm.has(o)?o:$l(o),t.attrs[o])}class nP extends im{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Se}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(sr.has(n)){const r=mg(n);return r&&r.default||0}return n=lm.has(n)?n:$l(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return jg(t,n,r)}build(t,n,r){_g(t,n,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(t,n,r,o){tP(t,n,r,o)}mount(t){this.isSVGTag=Ig(t.tagName),super.mount(t)}}const rP=(e,t)=>Hl(e)?new nP(t):new eP(t,{allowProjection:e!==R.Fragment}),oP=tM({...MM,...YE,...jE,...KE},rP),sP=DD(oP),cm=({booking:e,slotData:t,events:n,style:r,ref:o})=>{if(!e||!t)return null;const{day:s,hour:i}=t,{users:a}=us(g=>g),[l,c]=R.useState(e),u=R.useMemo(()=>a.find(g=>g.id===l.userId),[a,l]),d=R.useMemo(()=>{const g=J.timeDiffInMinutes(l.finishAt,l.startAt),h=Math.floor(g/60),b=g%60;return h>0?b>0?`${h}h ${b}m`:`${h}h`:`${b}m`},[l.startAt,l.finishAt]),p=R.useMemo(()=>{const g=new Date,h=new Date(l.startAt),b=new Date(l.finishAt);return g>b?"past":g>=h&&g<=b?"current":"future"},[l.startAt,l.finishAt]),f=R.useCallback(()=>{const g=(u==null?void 0:u.profile.color)||"#3b82f6";switch(p){case"past":return{backgroundColor:`${g}60`};case"current":return{backgroundColor:g,boxShadow:`0 0 0 2px ${g}, 0 0 8px ${g}40`};default:return{backgroundColor:`${g}e6`}}},[u==null?void 0:u.profile.color,p]);return R.useEffect(()=>{e&&c(e)},[e]),R.useImperativeHandle(o,()=>({updateBooking:g=>c(g)})),y.jsx("div",{className:he("booking_card_content_container","overflow-hidden transition-all duration-200 hover:shadow-lg","min-h-[3rem] p-1 cursor-pointer relative"),style:{...r,...f()},onPointerUp:n==null?void 0:n.onClick,children:y.jsxs("div",{className:"booking_card_content text-white h-full flex flex-col justify-between",children:[y.jsxs("div",{className:"flex items-center gap-1 mb-1",children:[y.jsx(Zf,{className:"w-3 h-3 opacity-80"}),y.jsx("span",{className:"text-xs font-medium truncate",children:(u==null?void 0:u.profile.name)||l.userId&&`User ${l.userId}`})]}),y.jsxs("div",{className:"flex items-center gap-1 mb-1",children:[y.jsx(Xf,{className:"w-3 h-3 opacity-80"}),y.jsxs("span",{className:"text-xs",children:[J.dateAndHourDateToString(l.startAt)," ","-"," ",J.dateAndHourDateToString(l.finishAt)]})]}),y.jsx("div",{className:"flex items-center justify-between gap-1",children:y.jsxs("div",{className:"flex items-center gap-1",children:[y.jsx(Ha,{className:"w-3 h-3 opacity-80"}),y.jsx("span",{className:"text-xs opacity-90",children:d})]})})]})},`${s}-${i}`)},iP=()=>{const{booking:e,slotData:t,startAt:n}=_r(s=>s),r=R.useRef(null),o=R.useMemo(()=>{if(e&&t)return y.jsx(cm,{ref:r,style:{borderRadius:"0.25rem"},booking:e,slotData:t})},[e,t]);return R.useEffect(()=>{if(e&&n&&(r!=null&&r.current)){const s=J.bookingTimeRange(e,n);r.current.updateBooking(s)}},[e,n]),y.jsx(Yw,{modifiers:[xR],dropAnimation:{duration:500,easing:"cubic-bezier(0.18, 0.67, 0.6, 1.22)"},className:"Draggable dragging",children:y.jsx(sP.div,{style:{height:"100%",maxHeight:"5rem",width:"100%",border:"2px solid #f6543b",borderRadius:"8px",boxShadow:"0 0 0 4px rgba(246, 140, 59, 0.2), 0 4px 12px rgba(228, 3, 3, 0.15)"},initial:{scale:.7,opacity:0},animate:{scale:1,opacity:1},transition:{duration:.4,ease:[.22,1,.36,1],mass:.5},children:o})})};/**
|
|
191
170
|
* table-core
|
|
192
171
|
*
|
|
193
172
|
* Copyright (c) TanStack
|
|
@@ -196,10 +175,10 @@ Valid keys: `+JSON.stringify(Object.keys(k),null," "));var z=ne(B,G,U,Z,q+"."+G
|
|
|
196
175
|
* LICENSE.md file in the root directory of this source tree.
|
|
197
176
|
*
|
|
198
177
|
* @license MIT
|
|
199
|
-
*/function
|
|
178
|
+
*/function Yt(e,t){return typeof e=="function"?e(t):e}function Xe(e,t){return n=>{t.setState(r=>({...r,[e]:Yt(n,r[e])}))}}function ks(e){return e instanceof Function}function aP(e){return Array.isArray(e)&&e.every(t=>typeof t=="number")}function lP(e,t){const n=[],r=o=>{o.forEach(s=>{n.push(s);const i=t(s);i!=null&&i.length&&r(i)})};return r(e),n}function oe(e,t,n){let r=[],o;return s=>{let i;n.key&&n.debug&&(i=Date.now());const a=e(s);if(!(a.length!==r.length||a.some((u,d)=>r[d]!==u)))return o;r=a;let c;if(n.key&&n.debug&&(c=Date.now()),o=t(...a),n==null||n.onChange==null||n.onChange(o),n.key&&n.debug&&n!=null&&n.debug()){const u=Math.round((Date.now()-i)*100)/100,d=Math.round((Date.now()-c)*100)/100,p=d/16,f=(g,h)=>{for(g=String(g);g.length<h;)g=" "+g;return g};console.info(`%c⏱ ${f(d,5)} /${f(u,5)} ms`,`
|
|
200
179
|
font-size: .6rem;
|
|
201
180
|
font-weight: bold;
|
|
202
|
-
color: hsl(${Math.max(0,Math.min(120-120*f,120))}deg 100% 31%);`,n==null?void 0:n.key)}return o}}function se(e,t,n,r){return{debug:()=>{var o;return(o=e==null?void 0:e.debugAll)!=null?o:e[t]},key:process.env.NODE_ENV==="development"&&n,onChange:r}}function bO(e,t,n,r){const o=()=>{var i;return(i=s.getValue())!=null?i:e.options.renderFallbackValue},s={id:`${t.id}_${n.id}`,row:t,column:n,getValue:()=>t.getValue(r),renderValue:o,getContext:oe(()=>[e,n,t,s],(i,a,l,c)=>({table:i,column:a,row:l,cell:c,getValue:c.getValue,renderValue:c.renderValue}),se(e.options,"debugCells","cell.getContext"))};return e._features.forEach(i=>{i.createCell==null||i.createCell(s,n,t,e)},{}),s}function SO(e,t,n,r){var o,s;const a={...e._getDefaultColumnDef(),...t},l=a.accessorKey;let c=(o=(s=a.id)!=null?s:l?typeof String.prototype.replaceAll=="function"?l.replaceAll(".","_"):l.replace(/\./g,"_"):void 0)!=null?o:typeof a.header=="string"?a.header:void 0,u;if(a.accessorFn?u=a.accessorFn:l&&(l.includes(".")?u=f=>{let h=f;for(const p of l.split(".")){var m;h=(m=h)==null?void 0:m[p],process.env.NODE_ENV!=="production"&&h===void 0&&console.warn(`"${p}" in deeply nested key "${l}" returned undefined.`)}return h}:u=f=>f[a.accessorKey]),!c)throw process.env.NODE_ENV!=="production"?new Error(a.accessorFn?"Columns require an id when using an accessorFn":"Columns require an id when using a non-string header"):new Error;let d={id:`${String(c)}`,accessorFn:u,parent:r,depth:n,columnDef:a,columns:[],getFlatColumns:oe(()=>[!0],()=>{var f;return[d,...(f=d.columns)==null?void 0:f.flatMap(h=>h.getFlatColumns())]},se(e.options,"debugColumns","column.getFlatColumns")),getLeafColumns:oe(()=>[e._getOrderColumnsFn()],f=>{var h;if((h=d.columns)!=null&&h.length){let m=d.columns.flatMap(p=>p.getLeafColumns());return f(m)}return[d]},se(e.options,"debugColumns","column.getLeafColumns"))};for(const f of e._features)f.createColumn==null||f.createColumn(d,e);return d}const Oe="debugHeaders";function Qd(e,t,n){var r;let s={id:(r=n.id)!=null?r:t.id,column:t,index:n.index,isPlaceholder:!!n.isPlaceholder,placeholderId:n.placeholderId,depth:n.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{const i=[],a=l=>{l.subHeaders&&l.subHeaders.length&&l.subHeaders.map(a),i.push(l)};return a(s),i},getContext:()=>({table:e,header:s,column:t})};return e._features.forEach(i=>{i.createHeader==null||i.createHeader(s,e)}),s}const CO={createTable:e=>{e.getHeaderGroups=oe(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,o)=>{var s,i;const a=(s=r==null?void 0:r.map(d=>n.find(f=>f.id===d)).filter(Boolean))!=null?s:[],l=(i=o==null?void 0:o.map(d=>n.find(f=>f.id===d)).filter(Boolean))!=null?i:[],c=n.filter(d=>!(r!=null&&r.includes(d.id))&&!(o!=null&&o.includes(d.id)));return Mo(t,[...a,...c,...l],e)},se(e.options,Oe,"getHeaderGroups")),e.getCenterHeaderGroups=oe(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,o)=>(n=n.filter(s=>!(r!=null&&r.includes(s.id))&&!(o!=null&&o.includes(s.id))),Mo(t,n,e,"center")),se(e.options,Oe,"getCenterHeaderGroups")),e.getLeftHeaderGroups=oe(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left],(t,n,r)=>{var o;const s=(o=r==null?void 0:r.map(i=>n.find(a=>a.id===i)).filter(Boolean))!=null?o:[];return Mo(t,s,e,"left")},se(e.options,Oe,"getLeftHeaderGroups")),e.getRightHeaderGroups=oe(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right],(t,n,r)=>{var o;const s=(o=r==null?void 0:r.map(i=>n.find(a=>a.id===i)).filter(Boolean))!=null?o:[];return Mo(t,s,e,"right")},se(e.options,Oe,"getRightHeaderGroups")),e.getFooterGroups=oe(()=>[e.getHeaderGroups()],t=>[...t].reverse(),se(e.options,Oe,"getFooterGroups")),e.getLeftFooterGroups=oe(()=>[e.getLeftHeaderGroups()],t=>[...t].reverse(),se(e.options,Oe,"getLeftFooterGroups")),e.getCenterFooterGroups=oe(()=>[e.getCenterHeaderGroups()],t=>[...t].reverse(),se(e.options,Oe,"getCenterFooterGroups")),e.getRightFooterGroups=oe(()=>[e.getRightHeaderGroups()],t=>[...t].reverse(),se(e.options,Oe,"getRightFooterGroups")),e.getFlatHeaders=oe(()=>[e.getHeaderGroups()],t=>t.map(n=>n.headers).flat(),se(e.options,Oe,"getFlatHeaders")),e.getLeftFlatHeaders=oe(()=>[e.getLeftHeaderGroups()],t=>t.map(n=>n.headers).flat(),se(e.options,Oe,"getLeftFlatHeaders")),e.getCenterFlatHeaders=oe(()=>[e.getCenterHeaderGroups()],t=>t.map(n=>n.headers).flat(),se(e.options,Oe,"getCenterFlatHeaders")),e.getRightFlatHeaders=oe(()=>[e.getRightHeaderGroups()],t=>t.map(n=>n.headers).flat(),se(e.options,Oe,"getRightFlatHeaders")),e.getCenterLeafHeaders=oe(()=>[e.getCenterFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),se(e.options,Oe,"getCenterLeafHeaders")),e.getLeftLeafHeaders=oe(()=>[e.getLeftFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),se(e.options,Oe,"getLeftLeafHeaders")),e.getRightLeafHeaders=oe(()=>[e.getRightFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),se(e.options,Oe,"getRightLeafHeaders")),e.getLeafHeaders=oe(()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()],(t,n,r)=>{var o,s,i,a,l,c;return[...(o=(s=t[0])==null?void 0:s.headers)!=null?o:[],...(i=(a=n[0])==null?void 0:a.headers)!=null?i:[],...(l=(c=r[0])==null?void 0:c.headers)!=null?l:[]].map(u=>u.getLeafHeaders()).flat()},se(e.options,Oe,"getLeafHeaders"))}};function Mo(e,t,n,r){var o,s;let i=0;const a=function(f,h){h===void 0&&(h=1),i=Math.max(i,h),f.filter(m=>m.getIsVisible()).forEach(m=>{var p;(p=m.columns)!=null&&p.length&&a(m.columns,h+1)},0)};a(e);let l=[];const c=(f,h)=>{const m={depth:h,id:[r,`${h}`].filter(Boolean).join("_"),headers:[]},p=[];f.forEach(b=>{const y=[...p].reverse()[0],g=b.column.depth===m.depth;let w,C=!1;if(g&&b.column.parent?w=b.column.parent:(w=b.column,C=!0),y&&(y==null?void 0:y.column)===w)y.subHeaders.push(b);else{const x=Qd(n,w,{id:[r,h,w.id,b==null?void 0:b.id].filter(Boolean).join("_"),isPlaceholder:C,placeholderId:C?`${p.filter(M=>M.column===w).length}`:void 0,depth:h,index:p.length});x.subHeaders.push(b),p.push(x)}m.headers.push(b),b.headerGroup=m}),l.push(m),h>0&&c(p,h-1)},u=t.map((f,h)=>Qd(n,f,{depth:i,index:h}));c(u,i-1),l.reverse();const d=f=>f.filter(m=>m.column.getIsVisible()).map(m=>{let p=0,b=0,y=[0];m.subHeaders&&m.subHeaders.length?(y=[],d(m.subHeaders).forEach(w=>{let{colSpan:C,rowSpan:x}=w;p+=C,y.push(x)})):p=1;const g=Math.min(...y);return b=b+g,m.colSpan=p,m.rowSpan=b,{colSpan:p,rowSpan:b}});return d((o=(s=l[0])==null?void 0:s.headers)!=null?o:[]),l}const RO=(e,t,n,r,o,s,i)=>{let a={id:t,index:r,original:n,depth:o,parentId:i,_valuesCache:{},_uniqueValuesCache:{},getValue:l=>{if(a._valuesCache.hasOwnProperty(l))return a._valuesCache[l];const c=e.getColumn(l);if(c!=null&&c.accessorFn)return a._valuesCache[l]=c.accessorFn(a.original,r),a._valuesCache[l]},getUniqueValues:l=>{if(a._uniqueValuesCache.hasOwnProperty(l))return a._uniqueValuesCache[l];const c=e.getColumn(l);if(c!=null&&c.accessorFn)return c.columnDef.getUniqueValues?(a._uniqueValuesCache[l]=c.columnDef.getUniqueValues(a.original,r),a._uniqueValuesCache[l]):(a._uniqueValuesCache[l]=[a.getValue(l)],a._uniqueValuesCache[l])},renderValue:l=>{var c;return(c=a.getValue(l))!=null?c:e.options.renderFallbackValue},subRows:[],getLeafRows:()=>xO(a.subRows,l=>l.subRows),getParentRow:()=>a.parentId?e.getRow(a.parentId,!0):void 0,getParentRows:()=>{let l=[],c=a;for(;;){const u=c.getParentRow();if(!u)break;l.push(u),c=u}return l.reverse()},getAllCells:oe(()=>[e.getAllLeafColumns()],l=>l.map(c=>bO(e,a,c,c.id)),se(e.options,"debugRows","getAllCells")),_getAllCellsByColumnId:oe(()=>[a.getAllCells()],l=>l.reduce((c,u)=>(c[u.column.id]=u,c),{}),se(e.options,"debugRows","getAllCellsByColumnId"))};for(let l=0;l<e._features.length;l++){const c=e._features[l];c==null||c.createRow==null||c.createRow(a,e)}return a},DO={createColumn:(e,t)=>{e._getFacetedRowModel=t.options.getFacetedRowModel&&t.options.getFacetedRowModel(t,e.id),e.getFacetedRowModel=()=>e._getFacetedRowModel?e._getFacetedRowModel():t.getPreFilteredRowModel(),e._getFacetedUniqueValues=t.options.getFacetedUniqueValues&&t.options.getFacetedUniqueValues(t,e.id),e.getFacetedUniqueValues=()=>e._getFacetedUniqueValues?e._getFacetedUniqueValues():new Map,e._getFacetedMinMaxValues=t.options.getFacetedMinMaxValues&&t.options.getFacetedMinMaxValues(t,e.id),e.getFacetedMinMaxValues=()=>{if(e._getFacetedMinMaxValues)return e._getFacetedMinMaxValues()}}},pv=(e,t,n)=>{var r,o;const s=n==null||(r=n.toString())==null?void 0:r.toLowerCase();return!!(!((o=e.getValue(t))==null||(o=o.toString())==null||(o=o.toLowerCase())==null)&&o.includes(s))};pv.autoRemove=e=>st(e);const gv=(e,t,n)=>{var r;return!!(!((r=e.getValue(t))==null||(r=r.toString())==null)&&r.includes(n))};gv.autoRemove=e=>st(e);const mv=(e,t,n)=>{var r;return((r=e.getValue(t))==null||(r=r.toString())==null?void 0:r.toLowerCase())===(n==null?void 0:n.toLowerCase())};mv.autoRemove=e=>st(e);const vv=(e,t,n)=>{var r;return(r=e.getValue(t))==null?void 0:r.includes(n)};vv.autoRemove=e=>st(e);const yv=(e,t,n)=>!n.some(r=>{var o;return!((o=e.getValue(t))!=null&&o.includes(r))});yv.autoRemove=e=>st(e)||!(e!=null&&e.length);const wv=(e,t,n)=>n.some(r=>{var o;return(o=e.getValue(t))==null?void 0:o.includes(r)});wv.autoRemove=e=>st(e)||!(e!=null&&e.length);const xv=(e,t,n)=>e.getValue(t)===n;xv.autoRemove=e=>st(e);const bv=(e,t,n)=>e.getValue(t)==n;bv.autoRemove=e=>st(e);const ec=(e,t,n)=>{let[r,o]=n;const s=e.getValue(t);return s>=r&&s<=o};ec.resolveFilterValue=e=>{let[t,n]=e,r=typeof t!="number"?parseFloat(t):t,o=typeof n!="number"?parseFloat(n):n,s=t===null||Number.isNaN(r)?-1/0:r,i=n===null||Number.isNaN(o)?1/0:o;if(s>i){const a=s;s=i,i=a}return[s,i]};ec.autoRemove=e=>st(e)||st(e[0])&&st(e[1]);const St={includesString:pv,includesStringSensitive:gv,equalsString:mv,arrIncludes:vv,arrIncludesAll:yv,arrIncludesSome:wv,equals:xv,weakEquals:bv,inNumberRange:ec};function st(e){return e==null||e===""}const TO={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],...e}),getDefaultOptions:e=>({onColumnFiltersChange:Ke("columnFilters",e),filterFromLeafRows:!1,maxLeafRowFilterDepth:100}),createColumn:(e,t)=>{e.getAutoFilterFn=()=>{const n=t.getCoreRowModel().flatRows[0],r=n==null?void 0:n.getValue(e.id);return typeof r=="string"?St.includesString:typeof r=="number"?St.inNumberRange:typeof r=="boolean"||r!==null&&typeof r=="object"?St.equals:Array.isArray(r)?St.arrIncludes:St.weakEquals},e.getFilterFn=()=>{var n,r;return Vs(e.columnDef.filterFn)?e.columnDef.filterFn:e.columnDef.filterFn==="auto"?e.getAutoFilterFn():(n=(r=t.options.filterFns)==null?void 0:r[e.columnDef.filterFn])!=null?n:St[e.columnDef.filterFn]},e.getCanFilter=()=>{var n,r,o;return((n=e.columnDef.enableColumnFilter)!=null?n:!0)&&((r=t.options.enableColumnFilters)!=null?r:!0)&&((o=t.options.enableFilters)!=null?o:!0)&&!!e.accessorFn},e.getIsFiltered=()=>e.getFilterIndex()>-1,e.getFilterValue=()=>{var n;return(n=t.getState().columnFilters)==null||(n=n.find(r=>r.id===e.id))==null?void 0:n.value},e.getFilterIndex=()=>{var n,r;return(n=(r=t.getState().columnFilters)==null?void 0:r.findIndex(o=>o.id===e.id))!=null?n:-1},e.setFilterValue=n=>{t.setColumnFilters(r=>{const o=e.getFilterFn(),s=r==null?void 0:r.find(u=>u.id===e.id),i=Wt(n,s?s.value:void 0);if(ef(o,i,e)){var a;return(a=r==null?void 0:r.filter(u=>u.id!==e.id))!=null?a:[]}const l={id:e.id,value:i};if(s){var c;return(c=r==null?void 0:r.map(u=>u.id===e.id?l:u))!=null?c:[]}return r!=null&&r.length?[...r,l]:[l]})}},createRow:(e,t)=>{e.columnFilters={},e.columnFiltersMeta={}},createTable:e=>{e.setColumnFilters=t=>{const n=e.getAllLeafColumns(),r=o=>{var s;return(s=Wt(t,o))==null?void 0:s.filter(i=>{const a=n.find(l=>l.id===i.id);if(a){const l=a.getFilterFn();if(ef(l,i.value,a))return!1}return!0})};e.options.onColumnFiltersChange==null||e.options.onColumnFiltersChange(r)},e.resetColumnFilters=t=>{var n,r;e.setColumnFilters(t?[]:(n=(r=e.initialState)==null?void 0:r.columnFilters)!=null?n:[])},e.getPreFilteredRowModel=()=>e.getCoreRowModel(),e.getFilteredRowModel=()=>(!e._getFilteredRowModel&&e.options.getFilteredRowModel&&(e._getFilteredRowModel=e.options.getFilteredRowModel(e)),e.options.manualFiltering||!e._getFilteredRowModel?e.getPreFilteredRowModel():e._getFilteredRowModel())}};function ef(e,t,n){return(e&&e.autoRemove?e.autoRemove(t,n):!1)||typeof t>"u"||typeof t=="string"&&!t}const MO=(e,t,n)=>n.reduce((r,o)=>{const s=o.getValue(e);return r+(typeof s=="number"?s:0)},0),PO=(e,t,n)=>{let r;return n.forEach(o=>{const s=o.getValue(e);s!=null&&(r>s||r===void 0&&s>=s)&&(r=s)}),r},EO=(e,t,n)=>{let r;return n.forEach(o=>{const s=o.getValue(e);s!=null&&(r<s||r===void 0&&s>=s)&&(r=s)}),r},AO=(e,t,n)=>{let r,o;return n.forEach(s=>{const i=s.getValue(e);i!=null&&(r===void 0?i>=i&&(r=o=i):(r>i&&(r=i),o<i&&(o=i)))}),[r,o]},OO=(e,t)=>{let n=0,r=0;if(t.forEach(o=>{let s=o.getValue(e);s!=null&&(s=+s)>=s&&(++n,r+=s)}),n)return r/n},_O=(e,t)=>{if(!t.length)return;const n=t.map(s=>s.getValue(e));if(!wO(n))return;if(n.length===1)return n[0];const r=Math.floor(n.length/2),o=n.sort((s,i)=>s-i);return n.length%2!==0?o[r]:(o[r-1]+o[r])/2},kO=(e,t)=>Array.from(new Set(t.map(n=>n.getValue(e))).values()),IO=(e,t)=>new Set(t.map(n=>n.getValue(e))).size,NO=(e,t)=>t.length,Di={sum:MO,min:PO,max:EO,extent:AO,mean:OO,median:_O,unique:kO,uniqueCount:IO,count:NO},jO={getDefaultColumnDef:()=>({aggregatedCell:e=>{var t,n;return(t=(n=e.getValue())==null||n.toString==null?void 0:n.toString())!=null?t:null},aggregationFn:"auto"}),getInitialState:e=>({grouping:[],...e}),getDefaultOptions:e=>({onGroupingChange:Ke("grouping",e),groupedColumnMode:"reorder"}),createColumn:(e,t)=>{e.toggleGrouping=()=>{t.setGrouping(n=>n!=null&&n.includes(e.id)?n.filter(r=>r!==e.id):[...n??[],e.id])},e.getCanGroup=()=>{var n,r;return((n=e.columnDef.enableGrouping)!=null?n:!0)&&((r=t.options.enableGrouping)!=null?r:!0)&&(!!e.accessorFn||!!e.columnDef.getGroupingValue)},e.getIsGrouped=()=>{var n;return(n=t.getState().grouping)==null?void 0:n.includes(e.id)},e.getGroupedIndex=()=>{var n;return(n=t.getState().grouping)==null?void 0:n.indexOf(e.id)},e.getToggleGroupingHandler=()=>{const n=e.getCanGroup();return()=>{n&&e.toggleGrouping()}},e.getAutoAggregationFn=()=>{const n=t.getCoreRowModel().flatRows[0],r=n==null?void 0:n.getValue(e.id);if(typeof r=="number")return Di.sum;if(Object.prototype.toString.call(r)==="[object Date]")return Di.extent},e.getAggregationFn=()=>{var n,r;if(!e)throw new Error;return Vs(e.columnDef.aggregationFn)?e.columnDef.aggregationFn:e.columnDef.aggregationFn==="auto"?e.getAutoAggregationFn():(n=(r=t.options.aggregationFns)==null?void 0:r[e.columnDef.aggregationFn])!=null?n:Di[e.columnDef.aggregationFn]}},createTable:e=>{e.setGrouping=t=>e.options.onGroupingChange==null?void 0:e.options.onGroupingChange(t),e.resetGrouping=t=>{var n,r;e.setGrouping(t?[]:(n=(r=e.initialState)==null?void 0:r.grouping)!=null?n:[])},e.getPreGroupedRowModel=()=>e.getFilteredRowModel(),e.getGroupedRowModel=()=>(!e._getGroupedRowModel&&e.options.getGroupedRowModel&&(e._getGroupedRowModel=e.options.getGroupedRowModel(e)),e.options.manualGrouping||!e._getGroupedRowModel?e.getPreGroupedRowModel():e._getGroupedRowModel())},createRow:(e,t)=>{e.getIsGrouped=()=>!!e.groupingColumnId,e.getGroupingValue=n=>{if(e._groupingValuesCache.hasOwnProperty(n))return e._groupingValuesCache[n];const r=t.getColumn(n);return r!=null&&r.columnDef.getGroupingValue?(e._groupingValuesCache[n]=r.columnDef.getGroupingValue(e.original),e._groupingValuesCache[n]):e.getValue(n)},e._groupingValuesCache={}},createCell:(e,t,n,r)=>{e.getIsGrouped=()=>t.getIsGrouped()&&t.id===n.groupingColumnId,e.getIsPlaceholder=()=>!e.getIsGrouped()&&t.getIsGrouped(),e.getIsAggregated=()=>{var o;return!e.getIsGrouped()&&!e.getIsPlaceholder()&&!!((o=n.subRows)!=null&&o.length)}}};function FO(e,t,n){if(!(t!=null&&t.length)||!n)return e;const r=e.filter(s=>!t.includes(s.id));return n==="remove"?r:[...t.map(s=>e.find(i=>i.id===s)).filter(Boolean),...r]}const VO={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:Ke("columnOrder",e)}),createColumn:(e,t)=>{e.getIndex=oe(n=>[Mr(t,n)],n=>n.findIndex(r=>r.id===e.id),se(t.options,"debugColumns","getIndex")),e.getIsFirstColumn=n=>{var r;return((r=Mr(t,n)[0])==null?void 0:r.id)===e.id},e.getIsLastColumn=n=>{var r;const o=Mr(t,n);return((r=o[o.length-1])==null?void 0:r.id)===e.id}},createTable:e=>{e.setColumnOrder=t=>e.options.onColumnOrderChange==null?void 0:e.options.onColumnOrderChange(t),e.resetColumnOrder=t=>{var n;e.setColumnOrder(t?[]:(n=e.initialState.columnOrder)!=null?n:[])},e._getOrderColumnsFn=oe(()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode],(t,n,r)=>o=>{let s=[];if(!(t!=null&&t.length))s=o;else{const i=[...t],a=[...o];for(;a.length&&i.length;){const l=i.shift(),c=a.findIndex(u=>u.id===l);c>-1&&s.push(a.splice(c,1)[0])}s=[...s,...a]}return FO(s,n,r)},se(e.options,"debugTable","_getOrderColumnsFn"))}},Ti=()=>({left:[],right:[]}),LO={getInitialState:e=>({columnPinning:Ti(),...e}),getDefaultOptions:e=>({onColumnPinningChange:Ke("columnPinning",e)}),createColumn:(e,t)=>{e.pin=n=>{const r=e.getLeafColumns().map(o=>o.id).filter(Boolean);t.setColumnPinning(o=>{var s,i;if(n==="right"){var a,l;return{left:((a=o==null?void 0:o.left)!=null?a:[]).filter(d=>!(r!=null&&r.includes(d))),right:[...((l=o==null?void 0:o.right)!=null?l:[]).filter(d=>!(r!=null&&r.includes(d))),...r]}}if(n==="left"){var c,u;return{left:[...((c=o==null?void 0:o.left)!=null?c:[]).filter(d=>!(r!=null&&r.includes(d))),...r],right:((u=o==null?void 0:o.right)!=null?u:[]).filter(d=>!(r!=null&&r.includes(d)))}}return{left:((s=o==null?void 0:o.left)!=null?s:[]).filter(d=>!(r!=null&&r.includes(d))),right:((i=o==null?void 0:o.right)!=null?i:[]).filter(d=>!(r!=null&&r.includes(d)))}})},e.getCanPin=()=>e.getLeafColumns().some(r=>{var o,s,i;return((o=r.columnDef.enablePinning)!=null?o:!0)&&((s=(i=t.options.enableColumnPinning)!=null?i:t.options.enablePinning)!=null?s:!0)}),e.getIsPinned=()=>{const n=e.getLeafColumns().map(a=>a.id),{left:r,right:o}=t.getState().columnPinning,s=n.some(a=>r==null?void 0:r.includes(a)),i=n.some(a=>o==null?void 0:o.includes(a));return s?"left":i?"right":!1},e.getPinnedIndex=()=>{var n,r;const o=e.getIsPinned();return o?(n=(r=t.getState().columnPinning)==null||(r=r[o])==null?void 0:r.indexOf(e.id))!=null?n:-1:0}},createRow:(e,t)=>{e.getCenterVisibleCells=oe(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left,t.getState().columnPinning.right],(n,r,o)=>{const s=[...r??[],...o??[]];return n.filter(i=>!s.includes(i.column.id))},se(t.options,"debugRows","getCenterVisibleCells")),e.getLeftVisibleCells=oe(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left],(n,r)=>(r??[]).map(s=>n.find(i=>i.column.id===s)).filter(Boolean).map(s=>({...s,position:"left"})),se(t.options,"debugRows","getLeftVisibleCells")),e.getRightVisibleCells=oe(()=>[e._getAllVisibleCells(),t.getState().columnPinning.right],(n,r)=>(r??[]).map(s=>n.find(i=>i.column.id===s)).filter(Boolean).map(s=>({...s,position:"right"})),se(t.options,"debugRows","getRightVisibleCells"))},createTable:e=>{e.setColumnPinning=t=>e.options.onColumnPinningChange==null?void 0:e.options.onColumnPinningChange(t),e.resetColumnPinning=t=>{var n,r;return e.setColumnPinning(t?Ti():(n=(r=e.initialState)==null?void 0:r.columnPinning)!=null?n:Ti())},e.getIsSomeColumnsPinned=t=>{var n;const r=e.getState().columnPinning;if(!t){var o,s;return!!((o=r.left)!=null&&o.length||(s=r.right)!=null&&s.length)}return!!((n=r[t])!=null&&n.length)},e.getLeftLeafColumns=oe(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left],(t,n)=>(n??[]).map(r=>t.find(o=>o.id===r)).filter(Boolean),se(e.options,"debugColumns","getLeftLeafColumns")),e.getRightLeafColumns=oe(()=>[e.getAllLeafColumns(),e.getState().columnPinning.right],(t,n)=>(n??[]).map(r=>t.find(o=>o.id===r)).filter(Boolean),se(e.options,"debugColumns","getRightLeafColumns")),e.getCenterLeafColumns=oe(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r)=>{const o=[...n??[],...r??[]];return t.filter(s=>!o.includes(s.id))},se(e.options,"debugColumns","getCenterLeafColumns"))}},Po={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},Mi=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),$O={getDefaultColumnDef:()=>Po,getInitialState:e=>({columnSizing:{},columnSizingInfo:Mi(),...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:Ke("columnSizing",e),onColumnSizingInfoChange:Ke("columnSizingInfo",e)}),createColumn:(e,t)=>{e.getSize=()=>{var n,r,o;const s=t.getState().columnSizing[e.id];return Math.min(Math.max((n=e.columnDef.minSize)!=null?n:Po.minSize,(r=s??e.columnDef.size)!=null?r:Po.size),(o=e.columnDef.maxSize)!=null?o:Po.maxSize)},e.getStart=oe(n=>[n,Mr(t,n),t.getState().columnSizing],(n,r)=>r.slice(0,e.getIndex(n)).reduce((o,s)=>o+s.getSize(),0),se(t.options,"debugColumns","getStart")),e.getAfter=oe(n=>[n,Mr(t,n),t.getState().columnSizing],(n,r)=>r.slice(e.getIndex(n)+1).reduce((o,s)=>o+s.getSize(),0),se(t.options,"debugColumns","getAfter")),e.resetSize=()=>{t.setColumnSizing(n=>{let{[e.id]:r,...o}=n;return o})},e.getCanResize=()=>{var n,r;return((n=e.columnDef.enableResizing)!=null?n:!0)&&((r=t.options.enableColumnResizing)!=null?r:!0)},e.getIsResizing=()=>t.getState().columnSizingInfo.isResizingColumn===e.id},createHeader:(e,t)=>{e.getSize=()=>{let n=0;const r=o=>{if(o.subHeaders.length)o.subHeaders.forEach(r);else{var s;n+=(s=o.column.getSize())!=null?s:0}};return r(e),n},e.getStart=()=>{if(e.index>0){const n=e.headerGroup.headers[e.index-1];return n.getStart()+n.getSize()}return 0},e.getResizeHandler=n=>{const r=t.getColumn(e.column.id),o=r==null?void 0:r.getCanResize();return s=>{if(!r||!o||(s.persist==null||s.persist(),Pi(s)&&s.touches&&s.touches.length>1))return;const i=e.getSize(),a=e?e.getLeafHeaders().map(y=>[y.column.id,y.column.getSize()]):[[r.id,r.getSize()]],l=Pi(s)?Math.round(s.touches[0].clientX):s.clientX,c={},u=(y,g)=>{typeof g=="number"&&(t.setColumnSizingInfo(w=>{var C,x;const M=t.options.columnResizeDirection==="rtl"?-1:1,S=(g-((C=w==null?void 0:w.startOffset)!=null?C:0))*M,D=Math.max(S/((x=w==null?void 0:w.startSize)!=null?x:0),-.999999);return w.columnSizingStart.forEach(P=>{let[E,A]=P;c[E]=Math.round(Math.max(A+A*D,0)*100)/100}),{...w,deltaOffset:S,deltaPercentage:D}}),(t.options.columnResizeMode==="onChange"||y==="end")&&t.setColumnSizing(w=>({...w,...c})))},d=y=>u("move",y),f=y=>{u("end",y),t.setColumnSizingInfo(g=>({...g,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},h=n||typeof document<"u"?document:null,m={moveHandler:y=>d(y.clientX),upHandler:y=>{h==null||h.removeEventListener("mousemove",m.moveHandler),h==null||h.removeEventListener("mouseup",m.upHandler),f(y.clientX)}},p={moveHandler:y=>(y.cancelable&&(y.preventDefault(),y.stopPropagation()),d(y.touches[0].clientX),!1),upHandler:y=>{var g;h==null||h.removeEventListener("touchmove",p.moveHandler),h==null||h.removeEventListener("touchend",p.upHandler),y.cancelable&&(y.preventDefault(),y.stopPropagation()),f((g=y.touches[0])==null?void 0:g.clientX)}},b=BO()?{passive:!1}:!1;Pi(s)?(h==null||h.addEventListener("touchmove",p.moveHandler,b),h==null||h.addEventListener("touchend",p.upHandler,b)):(h==null||h.addEventListener("mousemove",m.moveHandler,b),h==null||h.addEventListener("mouseup",m.upHandler,b)),t.setColumnSizingInfo(y=>({...y,startOffset:l,startSize:i,deltaOffset:0,deltaPercentage:0,columnSizingStart:a,isResizingColumn:r.id}))}}},createTable:e=>{e.setColumnSizing=t=>e.options.onColumnSizingChange==null?void 0:e.options.onColumnSizingChange(t),e.setColumnSizingInfo=t=>e.options.onColumnSizingInfoChange==null?void 0:e.options.onColumnSizingInfoChange(t),e.resetColumnSizing=t=>{var n;e.setColumnSizing(t?{}:(n=e.initialState.columnSizing)!=null?n:{})},e.resetHeaderSizeInfo=t=>{var n;e.setColumnSizingInfo(t?Mi():(n=e.initialState.columnSizingInfo)!=null?n:Mi())},e.getTotalSize=()=>{var t,n;return(t=(n=e.getHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?t:0},e.getLeftTotalSize=()=>{var t,n;return(t=(n=e.getLeftHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?t:0},e.getCenterTotalSize=()=>{var t,n;return(t=(n=e.getCenterHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?t:0},e.getRightTotalSize=()=>{var t,n;return(t=(n=e.getRightHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?t:0}}};let Eo=null;function BO(){if(typeof Eo=="boolean")return Eo;let e=!1;try{const t={get passive(){return e=!0,!1}},n=()=>{};window.addEventListener("test",n,t),window.removeEventListener("test",n)}catch{e=!1}return Eo=e,Eo}function Pi(e){return e.type==="touchstart"}const zO={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:Ke("columnVisibility",e)}),createColumn:(e,t)=>{e.toggleVisibility=n=>{e.getCanHide()&&t.setColumnVisibility(r=>({...r,[e.id]:n??!e.getIsVisible()}))},e.getIsVisible=()=>{var n,r;const o=e.columns;return(n=o.length?o.some(s=>s.getIsVisible()):(r=t.getState().columnVisibility)==null?void 0:r[e.id])!=null?n:!0},e.getCanHide=()=>{var n,r;return((n=e.columnDef.enableHiding)!=null?n:!0)&&((r=t.options.enableHiding)!=null?r:!0)},e.getToggleVisibilityHandler=()=>n=>{e.toggleVisibility==null||e.toggleVisibility(n.target.checked)}},createRow:(e,t)=>{e._getAllVisibleCells=oe(()=>[e.getAllCells(),t.getState().columnVisibility],n=>n.filter(r=>r.column.getIsVisible()),se(t.options,"debugRows","_getAllVisibleCells")),e.getVisibleCells=oe(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(n,r,o)=>[...n,...r,...o],se(t.options,"debugRows","getVisibleCells"))},createTable:e=>{const t=(n,r)=>oe(()=>[r(),r().filter(o=>o.getIsVisible()).map(o=>o.id).join("_")],o=>o.filter(s=>s.getIsVisible==null?void 0:s.getIsVisible()),se(e.options,"debugColumns",n));e.getVisibleFlatColumns=t("getVisibleFlatColumns",()=>e.getAllFlatColumns()),e.getVisibleLeafColumns=t("getVisibleLeafColumns",()=>e.getAllLeafColumns()),e.getLeftVisibleLeafColumns=t("getLeftVisibleLeafColumns",()=>e.getLeftLeafColumns()),e.getRightVisibleLeafColumns=t("getRightVisibleLeafColumns",()=>e.getRightLeafColumns()),e.getCenterVisibleLeafColumns=t("getCenterVisibleLeafColumns",()=>e.getCenterLeafColumns()),e.setColumnVisibility=n=>e.options.onColumnVisibilityChange==null?void 0:e.options.onColumnVisibilityChange(n),e.resetColumnVisibility=n=>{var r;e.setColumnVisibility(n?{}:(r=e.initialState.columnVisibility)!=null?r:{})},e.toggleAllColumnsVisible=n=>{var r;n=(r=n)!=null?r:!e.getIsAllColumnsVisible(),e.setColumnVisibility(e.getAllLeafColumns().reduce((o,s)=>({...o,[s.id]:n||!(s.getCanHide!=null&&s.getCanHide())}),{}))},e.getIsAllColumnsVisible=()=>!e.getAllLeafColumns().some(n=>!(n.getIsVisible!=null&&n.getIsVisible())),e.getIsSomeColumnsVisible=()=>e.getAllLeafColumns().some(n=>n.getIsVisible==null?void 0:n.getIsVisible()),e.getToggleAllColumnsVisibilityHandler=()=>n=>{var r;e.toggleAllColumnsVisible((r=n.target)==null?void 0:r.checked)}}};function Mr(e,t){return t?t==="center"?e.getCenterVisibleLeafColumns():t==="left"?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}const HO={createTable:e=>{e._getGlobalFacetedRowModel=e.options.getFacetedRowModel&&e.options.getFacetedRowModel(e,"__global__"),e.getGlobalFacetedRowModel=()=>e.options.manualFiltering||!e._getGlobalFacetedRowModel?e.getPreFilteredRowModel():e._getGlobalFacetedRowModel(),e._getGlobalFacetedUniqueValues=e.options.getFacetedUniqueValues&&e.options.getFacetedUniqueValues(e,"__global__"),e.getGlobalFacetedUniqueValues=()=>e._getGlobalFacetedUniqueValues?e._getGlobalFacetedUniqueValues():new Map,e._getGlobalFacetedMinMaxValues=e.options.getFacetedMinMaxValues&&e.options.getFacetedMinMaxValues(e,"__global__"),e.getGlobalFacetedMinMaxValues=()=>{if(e._getGlobalFacetedMinMaxValues)return e._getGlobalFacetedMinMaxValues()}}},WO={getInitialState:e=>({globalFilter:void 0,...e}),getDefaultOptions:e=>({onGlobalFilterChange:Ke("globalFilter",e),globalFilterFn:"auto",getColumnCanGlobalFilter:t=>{var n;const r=(n=e.getCoreRowModel().flatRows[0])==null||(n=n._getAllCellsByColumnId()[t.id])==null?void 0:n.getValue();return typeof r=="string"||typeof r=="number"}}),createColumn:(e,t)=>{e.getCanGlobalFilter=()=>{var n,r,o,s;return((n=e.columnDef.enableGlobalFilter)!=null?n:!0)&&((r=t.options.enableGlobalFilter)!=null?r:!0)&&((o=t.options.enableFilters)!=null?o:!0)&&((s=t.options.getColumnCanGlobalFilter==null?void 0:t.options.getColumnCanGlobalFilter(e))!=null?s:!0)&&!!e.accessorFn}},createTable:e=>{e.getGlobalAutoFilterFn=()=>St.includesString,e.getGlobalFilterFn=()=>{var t,n;const{globalFilterFn:r}=e.options;return Vs(r)?r:r==="auto"?e.getGlobalAutoFilterFn():(t=(n=e.options.filterFns)==null?void 0:n[r])!=null?t:St[r]},e.setGlobalFilter=t=>{e.options.onGlobalFilterChange==null||e.options.onGlobalFilterChange(t)},e.resetGlobalFilter=t=>{e.setGlobalFilter(t?void 0:e.initialState.globalFilter)}}},UO={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:Ke("expanded",e),paginateExpandedRows:!0}),createTable:e=>{let t=!1,n=!1;e._autoResetExpanded=()=>{var r,o;if(!t){e._queue(()=>{t=!0});return}if((r=(o=e.options.autoResetAll)!=null?o:e.options.autoResetExpanded)!=null?r:!e.options.manualExpanding){if(n)return;n=!0,e._queue(()=>{e.resetExpanded(),n=!1})}},e.setExpanded=r=>e.options.onExpandedChange==null?void 0:e.options.onExpandedChange(r),e.toggleAllRowsExpanded=r=>{r??!e.getIsAllRowsExpanded()?e.setExpanded(!0):e.setExpanded({})},e.resetExpanded=r=>{var o,s;e.setExpanded(r?{}:(o=(s=e.initialState)==null?void 0:s.expanded)!=null?o:{})},e.getCanSomeRowsExpand=()=>e.getPrePaginationRowModel().flatRows.some(r=>r.getCanExpand()),e.getToggleAllRowsExpandedHandler=()=>r=>{r.persist==null||r.persist(),e.toggleAllRowsExpanded()},e.getIsSomeRowsExpanded=()=>{const r=e.getState().expanded;return r===!0||Object.values(r).some(Boolean)},e.getIsAllRowsExpanded=()=>{const r=e.getState().expanded;return typeof r=="boolean"?r===!0:!(!Object.keys(r).length||e.getRowModel().flatRows.some(o=>!o.getIsExpanded()))},e.getExpandedDepth=()=>{let r=0;return(e.getState().expanded===!0?Object.keys(e.getRowModel().rowsById):Object.keys(e.getState().expanded)).forEach(s=>{const i=s.split(".");r=Math.max(r,i.length)}),r},e.getPreExpandedRowModel=()=>e.getSortedRowModel(),e.getExpandedRowModel=()=>(!e._getExpandedRowModel&&e.options.getExpandedRowModel&&(e._getExpandedRowModel=e.options.getExpandedRowModel(e)),e.options.manualExpanding||!e._getExpandedRowModel?e.getPreExpandedRowModel():e._getExpandedRowModel())},createRow:(e,t)=>{e.toggleExpanded=n=>{t.setExpanded(r=>{var o;const s=r===!0?!0:!!(r!=null&&r[e.id]);let i={};if(r===!0?Object.keys(t.getRowModel().rowsById).forEach(a=>{i[a]=!0}):i=r,n=(o=n)!=null?o:!s,!s&&n)return{...i,[e.id]:!0};if(s&&!n){const{[e.id]:a,...l}=i;return l}return r})},e.getIsExpanded=()=>{var n;const r=t.getState().expanded;return!!((n=t.options.getIsRowExpanded==null?void 0:t.options.getIsRowExpanded(e))!=null?n:r===!0||r!=null&&r[e.id])},e.getCanExpand=()=>{var n,r,o;return(n=t.options.getRowCanExpand==null?void 0:t.options.getRowCanExpand(e))!=null?n:((r=t.options.enableExpanding)!=null?r:!0)&&!!((o=e.subRows)!=null&&o.length)},e.getIsAllParentsExpanded=()=>{let n=!0,r=e;for(;n&&r.parentId;)r=t.getRow(r.parentId,!0),n=r.getIsExpanded();return n},e.getToggleExpandedHandler=()=>{const n=e.getCanExpand();return()=>{n&&e.toggleExpanded()}}}},Sa=0,Ca=10,Ei=()=>({pageIndex:Sa,pageSize:Ca}),GO={getInitialState:e=>({...e,pagination:{...Ei(),...e==null?void 0:e.pagination}}),getDefaultOptions:e=>({onPaginationChange:Ke("pagination",e)}),createTable:e=>{let t=!1,n=!1;e._autoResetPageIndex=()=>{var r,o;if(!t){e._queue(()=>{t=!0});return}if((r=(o=e.options.autoResetAll)!=null?o:e.options.autoResetPageIndex)!=null?r:!e.options.manualPagination){if(n)return;n=!0,e._queue(()=>{e.resetPageIndex(),n=!1})}},e.setPagination=r=>{const o=s=>Wt(r,s);return e.options.onPaginationChange==null?void 0:e.options.onPaginationChange(o)},e.resetPagination=r=>{var o;e.setPagination(r?Ei():(o=e.initialState.pagination)!=null?o:Ei())},e.setPageIndex=r=>{e.setPagination(o=>{let s=Wt(r,o.pageIndex);const i=typeof e.options.pageCount>"u"||e.options.pageCount===-1?Number.MAX_SAFE_INTEGER:e.options.pageCount-1;return s=Math.max(0,Math.min(s,i)),{...o,pageIndex:s}})},e.resetPageIndex=r=>{var o,s;e.setPageIndex(r?Sa:(o=(s=e.initialState)==null||(s=s.pagination)==null?void 0:s.pageIndex)!=null?o:Sa)},e.resetPageSize=r=>{var o,s;e.setPageSize(r?Ca:(o=(s=e.initialState)==null||(s=s.pagination)==null?void 0:s.pageSize)!=null?o:Ca)},e.setPageSize=r=>{e.setPagination(o=>{const s=Math.max(1,Wt(r,o.pageSize)),i=o.pageSize*o.pageIndex,a=Math.floor(i/s);return{...o,pageIndex:a,pageSize:s}})},e.setPageCount=r=>e.setPagination(o=>{var s;let i=Wt(r,(s=e.options.pageCount)!=null?s:-1);return typeof i=="number"&&(i=Math.max(-1,i)),{...o,pageCount:i}}),e.getPageOptions=oe(()=>[e.getPageCount()],r=>{let o=[];return r&&r>0&&(o=[...new Array(r)].fill(null).map((s,i)=>i)),o},se(e.options,"debugTable","getPageOptions")),e.getCanPreviousPage=()=>e.getState().pagination.pageIndex>0,e.getCanNextPage=()=>{const{pageIndex:r}=e.getState().pagination,o=e.getPageCount();return o===-1?!0:o===0?!1:r<o-1},e.previousPage=()=>e.setPageIndex(r=>r-1),e.nextPage=()=>e.setPageIndex(r=>r+1),e.firstPage=()=>e.setPageIndex(0),e.lastPage=()=>e.setPageIndex(e.getPageCount()-1),e.getPrePaginationRowModel=()=>e.getExpandedRowModel(),e.getPaginationRowModel=()=>(!e._getPaginationRowModel&&e.options.getPaginationRowModel&&(e._getPaginationRowModel=e.options.getPaginationRowModel(e)),e.options.manualPagination||!e._getPaginationRowModel?e.getPrePaginationRowModel():e._getPaginationRowModel()),e.getPageCount=()=>{var r;return(r=e.options.pageCount)!=null?r:Math.ceil(e.getRowCount()/e.getState().pagination.pageSize)},e.getRowCount=()=>{var r;return(r=e.options.rowCount)!=null?r:e.getPrePaginationRowModel().rows.length}}},Ai=()=>({top:[],bottom:[]}),KO={getInitialState:e=>({rowPinning:Ai(),...e}),getDefaultOptions:e=>({onRowPinningChange:Ke("rowPinning",e)}),createRow:(e,t)=>{e.pin=(n,r,o)=>{const s=r?e.getLeafRows().map(l=>{let{id:c}=l;return c}):[],i=o?e.getParentRows().map(l=>{let{id:c}=l;return c}):[],a=new Set([...i,e.id,...s]);t.setRowPinning(l=>{var c,u;if(n==="bottom"){var d,f;return{top:((d=l==null?void 0:l.top)!=null?d:[]).filter(p=>!(a!=null&&a.has(p))),bottom:[...((f=l==null?void 0:l.bottom)!=null?f:[]).filter(p=>!(a!=null&&a.has(p))),...Array.from(a)]}}if(n==="top"){var h,m;return{top:[...((h=l==null?void 0:l.top)!=null?h:[]).filter(p=>!(a!=null&&a.has(p))),...Array.from(a)],bottom:((m=l==null?void 0:l.bottom)!=null?m:[]).filter(p=>!(a!=null&&a.has(p)))}}return{top:((c=l==null?void 0:l.top)!=null?c:[]).filter(p=>!(a!=null&&a.has(p))),bottom:((u=l==null?void 0:l.bottom)!=null?u:[]).filter(p=>!(a!=null&&a.has(p)))}})},e.getCanPin=()=>{var n;const{enableRowPinning:r,enablePinning:o}=t.options;return typeof r=="function"?r(e):(n=r??o)!=null?n:!0},e.getIsPinned=()=>{const n=[e.id],{top:r,bottom:o}=t.getState().rowPinning,s=n.some(a=>r==null?void 0:r.includes(a)),i=n.some(a=>o==null?void 0:o.includes(a));return s?"top":i?"bottom":!1},e.getPinnedIndex=()=>{var n,r;const o=e.getIsPinned();if(!o)return-1;const s=(n=o==="top"?t.getTopRows():t.getBottomRows())==null?void 0:n.map(i=>{let{id:a}=i;return a});return(r=s==null?void 0:s.indexOf(e.id))!=null?r:-1}},createTable:e=>{e.setRowPinning=t=>e.options.onRowPinningChange==null?void 0:e.options.onRowPinningChange(t),e.resetRowPinning=t=>{var n,r;return e.setRowPinning(t?Ai():(n=(r=e.initialState)==null?void 0:r.rowPinning)!=null?n:Ai())},e.getIsSomeRowsPinned=t=>{var n;const r=e.getState().rowPinning;if(!t){var o,s;return!!((o=r.top)!=null&&o.length||(s=r.bottom)!=null&&s.length)}return!!((n=r[t])!=null&&n.length)},e._getPinnedRows=(t,n,r)=>{var o;return((o=e.options.keepPinnedRows)==null||o?(n??[]).map(i=>{const a=e.getRow(i,!0);return a.getIsAllParentsExpanded()?a:null}):(n??[]).map(i=>t.find(a=>a.id===i))).filter(Boolean).map(i=>({...i,position:r}))},e.getTopRows=oe(()=>[e.getRowModel().rows,e.getState().rowPinning.top],(t,n)=>e._getPinnedRows(t,n,"top"),se(e.options,"debugRows","getTopRows")),e.getBottomRows=oe(()=>[e.getRowModel().rows,e.getState().rowPinning.bottom],(t,n)=>e._getPinnedRows(t,n,"bottom"),se(e.options,"debugRows","getBottomRows")),e.getCenterRows=oe(()=>[e.getRowModel().rows,e.getState().rowPinning.top,e.getState().rowPinning.bottom],(t,n,r)=>{const o=new Set([...n??[],...r??[]]);return t.filter(s=>!o.has(s.id))},se(e.options,"debugRows","getCenterRows"))}},YO={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:Ke("rowSelection",e),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:e=>{e.setRowSelection=t=>e.options.onRowSelectionChange==null?void 0:e.options.onRowSelectionChange(t),e.resetRowSelection=t=>{var n;return e.setRowSelection(t?{}:(n=e.initialState.rowSelection)!=null?n:{})},e.toggleAllRowsSelected=t=>{e.setRowSelection(n=>{t=typeof t<"u"?t:!e.getIsAllRowsSelected();const r={...n},o=e.getPreGroupedRowModel().flatRows;return t?o.forEach(s=>{s.getCanSelect()&&(r[s.id]=!0)}):o.forEach(s=>{delete r[s.id]}),r})},e.toggleAllPageRowsSelected=t=>e.setRowSelection(n=>{const r=typeof t<"u"?t:!e.getIsAllPageRowsSelected(),o={...n};return e.getRowModel().rows.forEach(s=>{Ra(o,s.id,r,!0,e)}),o}),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=oe(()=>[e.getState().rowSelection,e.getCoreRowModel()],(t,n)=>Object.keys(t).length?Oi(e,n):{rows:[],flatRows:[],rowsById:{}},se(e.options,"debugTable","getSelectedRowModel")),e.getFilteredSelectedRowModel=oe(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(t,n)=>Object.keys(t).length?Oi(e,n):{rows:[],flatRows:[],rowsById:{}},se(e.options,"debugTable","getFilteredSelectedRowModel")),e.getGroupedSelectedRowModel=oe(()=>[e.getState().rowSelection,e.getSortedRowModel()],(t,n)=>Object.keys(t).length?Oi(e,n):{rows:[],flatRows:[],rowsById:{}},se(e.options,"debugTable","getGroupedSelectedRowModel")),e.getIsAllRowsSelected=()=>{const t=e.getFilteredRowModel().flatRows,{rowSelection:n}=e.getState();let r=!!(t.length&&Object.keys(n).length);return r&&t.some(o=>o.getCanSelect()&&!n[o.id])&&(r=!1),r},e.getIsAllPageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows.filter(o=>o.getCanSelect()),{rowSelection:n}=e.getState();let r=!!t.length;return r&&t.some(o=>!n[o.id])&&(r=!1),r},e.getIsSomeRowsSelected=()=>{var t;const n=Object.keys((t=e.getState().rowSelection)!=null?t:{}).length;return n>0&&n<e.getFilteredRowModel().flatRows.length},e.getIsSomePageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows;return e.getIsAllPageRowsSelected()?!1:t.filter(n=>n.getCanSelect()).some(n=>n.getIsSelected()||n.getIsSomeSelected())},e.getToggleAllRowsSelectedHandler=()=>t=>{e.toggleAllRowsSelected(t.target.checked)},e.getToggleAllPageRowsSelectedHandler=()=>t=>{e.toggleAllPageRowsSelected(t.target.checked)}},createRow:(e,t)=>{e.toggleSelected=(n,r)=>{const o=e.getIsSelected();t.setRowSelection(s=>{var i;if(n=typeof n<"u"?n:!o,e.getCanSelect()&&o===n)return s;const a={...s};return Ra(a,e.id,n,(i=r==null?void 0:r.selectChildren)!=null?i:!0,t),a})},e.getIsSelected=()=>{const{rowSelection:n}=t.getState();return tc(e,n)},e.getIsSomeSelected=()=>{const{rowSelection:n}=t.getState();return Da(e,n)==="some"},e.getIsAllSubRowsSelected=()=>{const{rowSelection:n}=t.getState();return Da(e,n)==="all"},e.getCanSelect=()=>{var n;return typeof t.options.enableRowSelection=="function"?t.options.enableRowSelection(e):(n=t.options.enableRowSelection)!=null?n:!0},e.getCanSelectSubRows=()=>{var n;return typeof t.options.enableSubRowSelection=="function"?t.options.enableSubRowSelection(e):(n=t.options.enableSubRowSelection)!=null?n:!0},e.getCanMultiSelect=()=>{var n;return typeof t.options.enableMultiRowSelection=="function"?t.options.enableMultiRowSelection(e):(n=t.options.enableMultiRowSelection)!=null?n:!0},e.getToggleSelectedHandler=()=>{const n=e.getCanSelect();return r=>{var o;n&&e.toggleSelected((o=r.target)==null?void 0:o.checked)}}}},Ra=(e,t,n,r,o)=>{var s;const i=o.getRow(t,!0);n?(i.getCanMultiSelect()||Object.keys(e).forEach(a=>delete e[a]),i.getCanSelect()&&(e[t]=!0)):delete e[t],r&&(s=i.subRows)!=null&&s.length&&i.getCanSelectSubRows()&&i.subRows.forEach(a=>Ra(e,a.id,n,r,o))};function Oi(e,t){const n=e.getState().rowSelection,r=[],o={},s=function(i,a){return i.map(l=>{var c;const u=tc(l,n);if(u&&(r.push(l),o[l.id]=l),(c=l.subRows)!=null&&c.length&&(l={...l,subRows:s(l.subRows)}),u)return l}).filter(Boolean)};return{rows:s(t.rows),flatRows:r,rowsById:o}}function tc(e,t){var n;return(n=t[e.id])!=null?n:!1}function Da(e,t,n){var r;if(!((r=e.subRows)!=null&&r.length))return!1;let o=!0,s=!1;return e.subRows.forEach(i=>{if(!(s&&!o)&&(i.getCanSelect()&&(tc(i,t)?s=!0:o=!1),i.subRows&&i.subRows.length)){const a=Da(i,t);a==="all"?s=!0:(a==="some"&&(s=!0),o=!1)}}),o?"all":s?"some":!1}const Ta=/([0-9]+)/gm,qO=(e,t,n)=>Sv(Zt(e.getValue(n)).toLowerCase(),Zt(t.getValue(n)).toLowerCase()),XO=(e,t,n)=>Sv(Zt(e.getValue(n)),Zt(t.getValue(n))),ZO=(e,t,n)=>nc(Zt(e.getValue(n)).toLowerCase(),Zt(t.getValue(n)).toLowerCase()),JO=(e,t,n)=>nc(Zt(e.getValue(n)),Zt(t.getValue(n))),QO=(e,t,n)=>{const r=e.getValue(n),o=t.getValue(n);return r>o?1:r<o?-1:0},e_=(e,t,n)=>nc(e.getValue(n),t.getValue(n));function nc(e,t){return e===t?0:e>t?1:-1}function Zt(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}function Sv(e,t){const n=e.split(Ta).filter(Boolean),r=t.split(Ta).filter(Boolean);for(;n.length&&r.length;){const o=n.shift(),s=r.shift(),i=parseInt(o,10),a=parseInt(s,10),l=[i,a].sort();if(isNaN(l[0])){if(o>s)return 1;if(s>o)return-1;continue}if(isNaN(l[1]))return isNaN(i)?-1:1;if(i>a)return 1;if(a>i)return-1}return n.length-r.length}const mr={alphanumeric:qO,alphanumericCaseSensitive:XO,text:ZO,textCaseSensitive:JO,datetime:QO,basic:e_},t_={getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:Ke("sorting",e),isMultiSortEvent:t=>t.shiftKey}),createColumn:(e,t)=>{e.getAutoSortingFn=()=>{const n=t.getFilteredRowModel().flatRows.slice(10);let r=!1;for(const o of n){const s=o==null?void 0:o.getValue(e.id);if(Object.prototype.toString.call(s)==="[object Date]")return mr.datetime;if(typeof s=="string"&&(r=!0,s.split(Ta).length>1))return mr.alphanumeric}return r?mr.text:mr.basic},e.getAutoSortDir=()=>{const n=t.getFilteredRowModel().flatRows[0];return typeof(n==null?void 0:n.getValue(e.id))=="string"?"asc":"desc"},e.getSortingFn=()=>{var n,r;if(!e)throw new Error;return Vs(e.columnDef.sortingFn)?e.columnDef.sortingFn:e.columnDef.sortingFn==="auto"?e.getAutoSortingFn():(n=(r=t.options.sortingFns)==null?void 0:r[e.columnDef.sortingFn])!=null?n:mr[e.columnDef.sortingFn]},e.toggleSorting=(n,r)=>{const o=e.getNextSortingOrder(),s=typeof n<"u"&&n!==null;t.setSorting(i=>{const a=i==null?void 0:i.find(h=>h.id===e.id),l=i==null?void 0:i.findIndex(h=>h.id===e.id);let c=[],u,d=s?n:o==="desc";if(i!=null&&i.length&&e.getCanMultiSort()&&r?a?u="toggle":u="add":i!=null&&i.length&&l!==i.length-1?u="replace":a?u="toggle":u="replace",u==="toggle"&&(s||o||(u="remove")),u==="add"){var f;c=[...i,{id:e.id,desc:d}],c.splice(0,c.length-((f=t.options.maxMultiSortColCount)!=null?f:Number.MAX_SAFE_INTEGER))}else u==="toggle"?c=i.map(h=>h.id===e.id?{...h,desc:d}:h):u==="remove"?c=i.filter(h=>h.id!==e.id):c=[{id:e.id,desc:d}];return c})},e.getFirstSortDir=()=>{var n,r;return((n=(r=e.columnDef.sortDescFirst)!=null?r:t.options.sortDescFirst)!=null?n:e.getAutoSortDir()==="desc")?"desc":"asc"},e.getNextSortingOrder=n=>{var r,o;const s=e.getFirstSortDir(),i=e.getIsSorted();return i?i!==s&&((r=t.options.enableSortingRemoval)==null||r)&&(!(n&&(o=t.options.enableMultiRemove)!=null)||o)?!1:i==="desc"?"asc":"desc":s},e.getCanSort=()=>{var n,r;return((n=e.columnDef.enableSorting)!=null?n:!0)&&((r=t.options.enableSorting)!=null?r:!0)&&!!e.accessorFn},e.getCanMultiSort=()=>{var n,r;return(n=(r=e.columnDef.enableMultiSort)!=null?r:t.options.enableMultiSort)!=null?n:!!e.accessorFn},e.getIsSorted=()=>{var n;const r=(n=t.getState().sorting)==null?void 0:n.find(o=>o.id===e.id);return r?r.desc?"desc":"asc":!1},e.getSortIndex=()=>{var n,r;return(n=(r=t.getState().sorting)==null?void 0:r.findIndex(o=>o.id===e.id))!=null?n:-1},e.clearSorting=()=>{t.setSorting(n=>n!=null&&n.length?n.filter(r=>r.id!==e.id):[])},e.getToggleSortingHandler=()=>{const n=e.getCanSort();return r=>{n&&(r.persist==null||r.persist(),e.toggleSorting==null||e.toggleSorting(void 0,e.getCanMultiSort()?t.options.isMultiSortEvent==null?void 0:t.options.isMultiSortEvent(r):!1))}}},createTable:e=>{e.setSorting=t=>e.options.onSortingChange==null?void 0:e.options.onSortingChange(t),e.resetSorting=t=>{var n,r;e.setSorting(t?[]:(n=(r=e.initialState)==null?void 0:r.sorting)!=null?n:[])},e.getPreSortedRowModel=()=>e.getGroupedRowModel(),e.getSortedRowModel=()=>(!e._getSortedRowModel&&e.options.getSortedRowModel&&(e._getSortedRowModel=e.options.getSortedRowModel(e)),e.options.manualSorting||!e._getSortedRowModel?e.getPreSortedRowModel():e._getSortedRowModel())}},n_=[CO,zO,VO,LO,DO,TO,HO,WO,t_,jO,UO,GO,KO,YO,$O];function r_(e){var t,n;process.env.NODE_ENV!=="production"&&(e.debugAll||e.debugTable)&&console.info("Creating Table Instance...");const r=[...n_,...(t=e._features)!=null?t:[]];let o={_features:r};const s=o._features.reduce((f,h)=>Object.assign(f,h.getDefaultOptions==null?void 0:h.getDefaultOptions(o)),{}),i=f=>o.options.mergeOptions?o.options.mergeOptions(s,f):{...s,...f};let l={...{},...(n=e.initialState)!=null?n:{}};o._features.forEach(f=>{var h;l=(h=f.getInitialState==null?void 0:f.getInitialState(l))!=null?h:l});const c=[];let u=!1;const d={_features:r,options:{...s,...e},initialState:l,_queue:f=>{c.push(f),u||(u=!0,Promise.resolve().then(()=>{for(;c.length;)c.shift()();u=!1}).catch(h=>setTimeout(()=>{throw h})))},reset:()=>{o.setState(o.initialState)},setOptions:f=>{const h=Wt(f,o.options);o.options=i(h)},getState:()=>o.options.state,setState:f=>{o.options.onStateChange==null||o.options.onStateChange(f)},_getRowId:(f,h,m)=>{var p;return(p=o.options.getRowId==null?void 0:o.options.getRowId(f,h,m))!=null?p:`${m?[m.id,h].join("."):h}`},getCoreRowModel:()=>(o._getCoreRowModel||(o._getCoreRowModel=o.options.getCoreRowModel(o)),o._getCoreRowModel()),getRowModel:()=>o.getPaginationRowModel(),getRow:(f,h)=>{let m=(h?o.getPrePaginationRowModel():o.getRowModel()).rowsById[f];if(!m&&(m=o.getCoreRowModel().rowsById[f],!m))throw process.env.NODE_ENV!=="production"?new Error(`getRow could not find row with ID: ${f}`):new Error;return m},_getDefaultColumnDef:oe(()=>[o.options.defaultColumn],f=>{var h;return f=(h=f)!=null?h:{},{header:m=>{const p=m.header.column.columnDef;return p.accessorKey?p.accessorKey:p.accessorFn?p.id:null},cell:m=>{var p,b;return(p=(b=m.renderValue())==null||b.toString==null?void 0:b.toString())!=null?p:null},...o._features.reduce((m,p)=>Object.assign(m,p.getDefaultColumnDef==null?void 0:p.getDefaultColumnDef()),{}),...f}},se(e,"debugColumns","_getDefaultColumnDef")),_getColumnDefs:()=>o.options.columns,getAllColumns:oe(()=>[o._getColumnDefs()],f=>{const h=function(m,p,b){return b===void 0&&(b=0),m.map(y=>{const g=SO(o,y,b,p),w=y;return g.columns=w.columns?h(w.columns,g,b+1):[],g})};return h(f)},se(e,"debugColumns","getAllColumns")),getAllFlatColumns:oe(()=>[o.getAllColumns()],f=>f.flatMap(h=>h.getFlatColumns()),se(e,"debugColumns","getAllFlatColumns")),_getAllFlatColumnsById:oe(()=>[o.getAllFlatColumns()],f=>f.reduce((h,m)=>(h[m.id]=m,h),{}),se(e,"debugColumns","getAllFlatColumnsById")),getAllLeafColumns:oe(()=>[o.getAllColumns(),o._getOrderColumnsFn()],(f,h)=>{let m=f.flatMap(p=>p.getLeafColumns());return h(m)},se(e,"debugColumns","getAllLeafColumns")),getColumn:f=>{const h=o._getAllFlatColumnsById()[f];return process.env.NODE_ENV!=="production"&&!h&&console.error(`[Table] Column with id '${f}' does not exist.`),h}};Object.assign(o,d);for(let f=0;f<o._features.length;f++){const h=o._features[f];h==null||h.createTable==null||h.createTable(o)}return o}function o_(){return e=>oe(()=>[e.options.data],t=>{const n={rows:[],flatRows:[],rowsById:{}},r=function(o,s,i){s===void 0&&(s=0);const a=[];for(let c=0;c<o.length;c++){const u=RO(e,e._getRowId(o[c],c,i),o[c],c,s,void 0,i==null?void 0:i.id);if(n.flatRows.push(u),n.rowsById[u.id]=u,a.push(u),e.options.getSubRows){var l;u.originalSubRows=e.options.getSubRows(o[c],c),(l=u.originalSubRows)!=null&&l.length&&(u.subRows=r(u.originalSubRows,s+1,u))}}return a};return n.rows=r(t),n},se(e.options,"debugTable","getRowModel",()=>e._autoResetPageIndex()))}function s_(){return e=>oe(()=>[e.getState().sorting,e.getPreSortedRowModel()],(t,n)=>{if(!n.rows.length||!(t!=null&&t.length))return n;const r=e.getState().sorting,o=[],s=r.filter(l=>{var c;return(c=e.getColumn(l.id))==null?void 0:c.getCanSort()}),i={};s.forEach(l=>{const c=e.getColumn(l.id);c&&(i[l.id]={sortUndefined:c.columnDef.sortUndefined,invertSorting:c.columnDef.invertSorting,sortingFn:c.getSortingFn()})});const a=l=>{const c=l.map(u=>({...u}));return c.sort((u,d)=>{for(let h=0;h<s.length;h+=1){var f;const m=s[h],p=i[m.id],b=p.sortUndefined,y=(f=m==null?void 0:m.desc)!=null?f:!1;let g=0;if(b){const w=u.getValue(m.id),C=d.getValue(m.id),x=w===void 0,M=C===void 0;if(x||M){if(b==="first")return x?-1:1;if(b==="last")return x?1:-1;g=x&&M?0:x?b:-b}}if(g===0&&(g=p.sortingFn(u,d,m.id)),g!==0)return y&&(g*=-1),p.invertSorting&&(g*=-1),g}return u.index-d.index}),c.forEach(u=>{var d;o.push(u),(d=u.subRows)!=null&&d.length&&(u.subRows=a(u.subRows))}),c};return{rows:a(n.rows),flatRows:o,rowsById:n.rowsById}},se(e.options,"debugTable","getSortedRowModel",()=>e._autoResetPageIndex()))}/**
|
|
181
|
+
color: hsl(${Math.max(0,Math.min(120-120*p,120))}deg 100% 31%);`,n==null?void 0:n.key)}return o}}function se(e,t,n,r){return{debug:()=>{var o;return(o=e==null?void 0:e.debugAll)!=null?o:e[t]},key:process.env.NODE_ENV==="development"&&n,onChange:r}}function cP(e,t,n,r){const o=()=>{var i;return(i=s.getValue())!=null?i:e.options.renderFallbackValue},s={id:`${t.id}_${n.id}`,row:t,column:n,getValue:()=>t.getValue(r),renderValue:o,getContext:oe(()=>[e,n,t,s],(i,a,l,c)=>({table:i,column:a,row:l,cell:c,getValue:c.getValue,renderValue:c.renderValue}),se(e.options,"debugCells","cell.getContext"))};return e._features.forEach(i=>{i.createCell==null||i.createCell(s,n,t,e)},{}),s}function uP(e,t,n,r){var o,s;const a={...e._getDefaultColumnDef(),...t},l=a.accessorKey;let c=(o=(s=a.id)!=null?s:l?typeof String.prototype.replaceAll=="function"?l.replaceAll(".","_"):l.replace(/\./g,"_"):void 0)!=null?o:typeof a.header=="string"?a.header:void 0,u;if(a.accessorFn?u=a.accessorFn:l&&(l.includes(".")?u=p=>{let f=p;for(const h of l.split(".")){var g;f=(g=f)==null?void 0:g[h],process.env.NODE_ENV!=="production"&&f===void 0&&console.warn(`"${h}" in deeply nested key "${l}" returned undefined.`)}return f}:u=p=>p[a.accessorKey]),!c)throw process.env.NODE_ENV!=="production"?new Error(a.accessorFn?"Columns require an id when using an accessorFn":"Columns require an id when using a non-string header"):new Error;let d={id:`${String(c)}`,accessorFn:u,parent:r,depth:n,columnDef:a,columns:[],getFlatColumns:oe(()=>[!0],()=>{var p;return[d,...(p=d.columns)==null?void 0:p.flatMap(f=>f.getFlatColumns())]},se(e.options,"debugColumns","column.getFlatColumns")),getLeafColumns:oe(()=>[e._getOrderColumnsFn()],p=>{var f;if((f=d.columns)!=null&&f.length){let g=d.columns.flatMap(h=>h.getLeafColumns());return p(g)}return[d]},se(e.options,"debugColumns","column.getLeafColumns"))};for(const p of e._features)p.createColumn==null||p.createColumn(d,e);return d}const Ie="debugHeaders";function xd(e,t,n){var r;let s={id:(r=n.id)!=null?r:t.id,column:t,index:n.index,isPlaceholder:!!n.isPlaceholder,placeholderId:n.placeholderId,depth:n.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{const i=[],a=l=>{l.subHeaders&&l.subHeaders.length&&l.subHeaders.map(a),i.push(l)};return a(s),i},getContext:()=>({table:e,header:s,column:t})};return e._features.forEach(i=>{i.createHeader==null||i.createHeader(s,e)}),s}const dP={createTable:e=>{e.getHeaderGroups=oe(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,o)=>{var s,i;const a=(s=r==null?void 0:r.map(d=>n.find(p=>p.id===d)).filter(Boolean))!=null?s:[],l=(i=o==null?void 0:o.map(d=>n.find(p=>p.id===d)).filter(Boolean))!=null?i:[],c=n.filter(d=>!(r!=null&&r.includes(d.id))&&!(o!=null&&o.includes(d.id)));return To(t,[...a,...c,...l],e)},se(e.options,Ie,"getHeaderGroups")),e.getCenterHeaderGroups=oe(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,o)=>(n=n.filter(s=>!(r!=null&&r.includes(s.id))&&!(o!=null&&o.includes(s.id))),To(t,n,e,"center")),se(e.options,Ie,"getCenterHeaderGroups")),e.getLeftHeaderGroups=oe(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left],(t,n,r)=>{var o;const s=(o=r==null?void 0:r.map(i=>n.find(a=>a.id===i)).filter(Boolean))!=null?o:[];return To(t,s,e,"left")},se(e.options,Ie,"getLeftHeaderGroups")),e.getRightHeaderGroups=oe(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right],(t,n,r)=>{var o;const s=(o=r==null?void 0:r.map(i=>n.find(a=>a.id===i)).filter(Boolean))!=null?o:[];return To(t,s,e,"right")},se(e.options,Ie,"getRightHeaderGroups")),e.getFooterGroups=oe(()=>[e.getHeaderGroups()],t=>[...t].reverse(),se(e.options,Ie,"getFooterGroups")),e.getLeftFooterGroups=oe(()=>[e.getLeftHeaderGroups()],t=>[...t].reverse(),se(e.options,Ie,"getLeftFooterGroups")),e.getCenterFooterGroups=oe(()=>[e.getCenterHeaderGroups()],t=>[...t].reverse(),se(e.options,Ie,"getCenterFooterGroups")),e.getRightFooterGroups=oe(()=>[e.getRightHeaderGroups()],t=>[...t].reverse(),se(e.options,Ie,"getRightFooterGroups")),e.getFlatHeaders=oe(()=>[e.getHeaderGroups()],t=>t.map(n=>n.headers).flat(),se(e.options,Ie,"getFlatHeaders")),e.getLeftFlatHeaders=oe(()=>[e.getLeftHeaderGroups()],t=>t.map(n=>n.headers).flat(),se(e.options,Ie,"getLeftFlatHeaders")),e.getCenterFlatHeaders=oe(()=>[e.getCenterHeaderGroups()],t=>t.map(n=>n.headers).flat(),se(e.options,Ie,"getCenterFlatHeaders")),e.getRightFlatHeaders=oe(()=>[e.getRightHeaderGroups()],t=>t.map(n=>n.headers).flat(),se(e.options,Ie,"getRightFlatHeaders")),e.getCenterLeafHeaders=oe(()=>[e.getCenterFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),se(e.options,Ie,"getCenterLeafHeaders")),e.getLeftLeafHeaders=oe(()=>[e.getLeftFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),se(e.options,Ie,"getLeftLeafHeaders")),e.getRightLeafHeaders=oe(()=>[e.getRightFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),se(e.options,Ie,"getRightLeafHeaders")),e.getLeafHeaders=oe(()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()],(t,n,r)=>{var o,s,i,a,l,c;return[...(o=(s=t[0])==null?void 0:s.headers)!=null?o:[],...(i=(a=n[0])==null?void 0:a.headers)!=null?i:[],...(l=(c=r[0])==null?void 0:c.headers)!=null?l:[]].map(u=>u.getLeafHeaders()).flat()},se(e.options,Ie,"getLeafHeaders"))}};function To(e,t,n,r){var o,s;let i=0;const a=function(p,f){f===void 0&&(f=1),i=Math.max(i,f),p.filter(g=>g.getIsVisible()).forEach(g=>{var h;(h=g.columns)!=null&&h.length&&a(g.columns,f+1)},0)};a(e);let l=[];const c=(p,f)=>{const g={depth:f,id:[r,`${f}`].filter(Boolean).join("_"),headers:[]},h=[];p.forEach(b=>{const w=[...h].reverse()[0],v=b.column.depth===g.depth;let m,C=!1;if(v&&b.column.parent?m=b.column.parent:(m=b.column,C=!0),w&&(w==null?void 0:w.column)===m)w.subHeaders.push(b);else{const x=xd(n,m,{id:[r,f,m.id,b==null?void 0:b.id].filter(Boolean).join("_"),isPlaceholder:C,placeholderId:C?`${h.filter(D=>D.column===m).length}`:void 0,depth:f,index:h.length});x.subHeaders.push(b),h.push(x)}g.headers.push(b),b.headerGroup=g}),l.push(g),f>0&&c(h,f-1)},u=t.map((p,f)=>xd(n,p,{depth:i,index:f}));c(u,i-1),l.reverse();const d=p=>p.filter(g=>g.column.getIsVisible()).map(g=>{let h=0,b=0,w=[0];g.subHeaders&&g.subHeaders.length?(w=[],d(g.subHeaders).forEach(m=>{let{colSpan:C,rowSpan:x}=m;h+=C,w.push(x)})):h=1;const v=Math.min(...w);return b=b+v,g.colSpan=h,g.rowSpan=b,{colSpan:h,rowSpan:b}});return d((o=(s=l[0])==null?void 0:s.headers)!=null?o:[]),l}const fP=(e,t,n,r,o,s,i)=>{let a={id:t,index:r,original:n,depth:o,parentId:i,_valuesCache:{},_uniqueValuesCache:{},getValue:l=>{if(a._valuesCache.hasOwnProperty(l))return a._valuesCache[l];const c=e.getColumn(l);if(c!=null&&c.accessorFn)return a._valuesCache[l]=c.accessorFn(a.original,r),a._valuesCache[l]},getUniqueValues:l=>{if(a._uniqueValuesCache.hasOwnProperty(l))return a._uniqueValuesCache[l];const c=e.getColumn(l);if(c!=null&&c.accessorFn)return c.columnDef.getUniqueValues?(a._uniqueValuesCache[l]=c.columnDef.getUniqueValues(a.original,r),a._uniqueValuesCache[l]):(a._uniqueValuesCache[l]=[a.getValue(l)],a._uniqueValuesCache[l])},renderValue:l=>{var c;return(c=a.getValue(l))!=null?c:e.options.renderFallbackValue},subRows:[],getLeafRows:()=>lP(a.subRows,l=>l.subRows),getParentRow:()=>a.parentId?e.getRow(a.parentId,!0):void 0,getParentRows:()=>{let l=[],c=a;for(;;){const u=c.getParentRow();if(!u)break;l.push(u),c=u}return l.reverse()},getAllCells:oe(()=>[e.getAllLeafColumns()],l=>l.map(c=>cP(e,a,c,c.id)),se(e.options,"debugRows","getAllCells")),_getAllCellsByColumnId:oe(()=>[a.getAllCells()],l=>l.reduce((c,u)=>(c[u.column.id]=u,c),{}),se(e.options,"debugRows","getAllCellsByColumnId"))};for(let l=0;l<e._features.length;l++){const c=e._features[l];c==null||c.createRow==null||c.createRow(a,e)}return a},pP={createColumn:(e,t)=>{e._getFacetedRowModel=t.options.getFacetedRowModel&&t.options.getFacetedRowModel(t,e.id),e.getFacetedRowModel=()=>e._getFacetedRowModel?e._getFacetedRowModel():t.getPreFilteredRowModel(),e._getFacetedUniqueValues=t.options.getFacetedUniqueValues&&t.options.getFacetedUniqueValues(t,e.id),e.getFacetedUniqueValues=()=>e._getFacetedUniqueValues?e._getFacetedUniqueValues():new Map,e._getFacetedMinMaxValues=t.options.getFacetedMinMaxValues&&t.options.getFacetedMinMaxValues(t,e.id),e.getFacetedMinMaxValues=()=>{if(e._getFacetedMinMaxValues)return e._getFacetedMinMaxValues()}}},um=(e,t,n)=>{var r,o;const s=n==null||(r=n.toString())==null?void 0:r.toLowerCase();return!!(!((o=e.getValue(t))==null||(o=o.toString())==null||(o=o.toLowerCase())==null)&&o.includes(s))};um.autoRemove=e=>lt(e);const dm=(e,t,n)=>{var r;return!!(!((r=e.getValue(t))==null||(r=r.toString())==null)&&r.includes(n))};dm.autoRemove=e=>lt(e);const fm=(e,t,n)=>{var r;return((r=e.getValue(t))==null||(r=r.toString())==null?void 0:r.toLowerCase())===(n==null?void 0:n.toLowerCase())};fm.autoRemove=e=>lt(e);const pm=(e,t,n)=>{var r;return(r=e.getValue(t))==null?void 0:r.includes(n)};pm.autoRemove=e=>lt(e);const hm=(e,t,n)=>!n.some(r=>{var o;return!((o=e.getValue(t))!=null&&o.includes(r))});hm.autoRemove=e=>lt(e)||!(e!=null&&e.length);const gm=(e,t,n)=>n.some(r=>{var o;return(o=e.getValue(t))==null?void 0:o.includes(r)});gm.autoRemove=e=>lt(e)||!(e!=null&&e.length);const mm=(e,t,n)=>e.getValue(t)===n;mm.autoRemove=e=>lt(e);const vm=(e,t,n)=>e.getValue(t)==n;vm.autoRemove=e=>lt(e);const Yl=(e,t,n)=>{let[r,o]=n;const s=e.getValue(t);return s>=r&&s<=o};Yl.resolveFilterValue=e=>{let[t,n]=e,r=typeof t!="number"?parseFloat(t):t,o=typeof n!="number"?parseFloat(n):n,s=t===null||Number.isNaN(r)?-1/0:r,i=n===null||Number.isNaN(o)?1/0:o;if(s>i){const a=s;s=i,i=a}return[s,i]};Yl.autoRemove=e=>lt(e)||lt(e[0])&<(e[1]);const Mt={includesString:um,includesStringSensitive:dm,equalsString:fm,arrIncludes:pm,arrIncludesAll:hm,arrIncludesSome:gm,equals:mm,weakEquals:vm,inNumberRange:Yl};function lt(e){return e==null||e===""}const hP={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],...e}),getDefaultOptions:e=>({onColumnFiltersChange:Xe("columnFilters",e),filterFromLeafRows:!1,maxLeafRowFilterDepth:100}),createColumn:(e,t)=>{e.getAutoFilterFn=()=>{const n=t.getCoreRowModel().flatRows[0],r=n==null?void 0:n.getValue(e.id);return typeof r=="string"?Mt.includesString:typeof r=="number"?Mt.inNumberRange:typeof r=="boolean"||r!==null&&typeof r=="object"?Mt.equals:Array.isArray(r)?Mt.arrIncludes:Mt.weakEquals},e.getFilterFn=()=>{var n,r;return ks(e.columnDef.filterFn)?e.columnDef.filterFn:e.columnDef.filterFn==="auto"?e.getAutoFilterFn():(n=(r=t.options.filterFns)==null?void 0:r[e.columnDef.filterFn])!=null?n:Mt[e.columnDef.filterFn]},e.getCanFilter=()=>{var n,r,o;return((n=e.columnDef.enableColumnFilter)!=null?n:!0)&&((r=t.options.enableColumnFilters)!=null?r:!0)&&((o=t.options.enableFilters)!=null?o:!0)&&!!e.accessorFn},e.getIsFiltered=()=>e.getFilterIndex()>-1,e.getFilterValue=()=>{var n;return(n=t.getState().columnFilters)==null||(n=n.find(r=>r.id===e.id))==null?void 0:n.value},e.getFilterIndex=()=>{var n,r;return(n=(r=t.getState().columnFilters)==null?void 0:r.findIndex(o=>o.id===e.id))!=null?n:-1},e.setFilterValue=n=>{t.setColumnFilters(r=>{const o=e.getFilterFn(),s=r==null?void 0:r.find(u=>u.id===e.id),i=Yt(n,s?s.value:void 0);if(bd(o,i,e)){var a;return(a=r==null?void 0:r.filter(u=>u.id!==e.id))!=null?a:[]}const l={id:e.id,value:i};if(s){var c;return(c=r==null?void 0:r.map(u=>u.id===e.id?l:u))!=null?c:[]}return r!=null&&r.length?[...r,l]:[l]})}},createRow:(e,t)=>{e.columnFilters={},e.columnFiltersMeta={}},createTable:e=>{e.setColumnFilters=t=>{const n=e.getAllLeafColumns(),r=o=>{var s;return(s=Yt(t,o))==null?void 0:s.filter(i=>{const a=n.find(l=>l.id===i.id);if(a){const l=a.getFilterFn();if(bd(l,i.value,a))return!1}return!0})};e.options.onColumnFiltersChange==null||e.options.onColumnFiltersChange(r)},e.resetColumnFilters=t=>{var n,r;e.setColumnFilters(t?[]:(n=(r=e.initialState)==null?void 0:r.columnFilters)!=null?n:[])},e.getPreFilteredRowModel=()=>e.getCoreRowModel(),e.getFilteredRowModel=()=>(!e._getFilteredRowModel&&e.options.getFilteredRowModel&&(e._getFilteredRowModel=e.options.getFilteredRowModel(e)),e.options.manualFiltering||!e._getFilteredRowModel?e.getPreFilteredRowModel():e._getFilteredRowModel())}};function bd(e,t,n){return(e&&e.autoRemove?e.autoRemove(t,n):!1)||typeof t>"u"||typeof t=="string"&&!t}const gP=(e,t,n)=>n.reduce((r,o)=>{const s=o.getValue(e);return r+(typeof s=="number"?s:0)},0),mP=(e,t,n)=>{let r;return n.forEach(o=>{const s=o.getValue(e);s!=null&&(r>s||r===void 0&&s>=s)&&(r=s)}),r},vP=(e,t,n)=>{let r;return n.forEach(o=>{const s=o.getValue(e);s!=null&&(r<s||r===void 0&&s>=s)&&(r=s)}),r},yP=(e,t,n)=>{let r,o;return n.forEach(s=>{const i=s.getValue(e);i!=null&&(r===void 0?i>=i&&(r=o=i):(r>i&&(r=i),o<i&&(o=i)))}),[r,o]},wP=(e,t)=>{let n=0,r=0;if(t.forEach(o=>{let s=o.getValue(e);s!=null&&(s=+s)>=s&&(++n,r+=s)}),n)return r/n},xP=(e,t)=>{if(!t.length)return;const n=t.map(s=>s.getValue(e));if(!aP(n))return;if(n.length===1)return n[0];const r=Math.floor(n.length/2),o=n.sort((s,i)=>s-i);return n.length%2!==0?o[r]:(o[r-1]+o[r])/2},bP=(e,t)=>Array.from(new Set(t.map(n=>n.getValue(e))).values()),SP=(e,t)=>new Set(t.map(n=>n.getValue(e))).size,CP=(e,t)=>t.length,Ci={sum:gP,min:mP,max:vP,extent:yP,mean:wP,median:xP,unique:bP,uniqueCount:SP,count:CP},RP={getDefaultColumnDef:()=>({aggregatedCell:e=>{var t,n;return(t=(n=e.getValue())==null||n.toString==null?void 0:n.toString())!=null?t:null},aggregationFn:"auto"}),getInitialState:e=>({grouping:[],...e}),getDefaultOptions:e=>({onGroupingChange:Xe("grouping",e),groupedColumnMode:"reorder"}),createColumn:(e,t)=>{e.toggleGrouping=()=>{t.setGrouping(n=>n!=null&&n.includes(e.id)?n.filter(r=>r!==e.id):[...n??[],e.id])},e.getCanGroup=()=>{var n,r;return((n=e.columnDef.enableGrouping)!=null?n:!0)&&((r=t.options.enableGrouping)!=null?r:!0)&&(!!e.accessorFn||!!e.columnDef.getGroupingValue)},e.getIsGrouped=()=>{var n;return(n=t.getState().grouping)==null?void 0:n.includes(e.id)},e.getGroupedIndex=()=>{var n;return(n=t.getState().grouping)==null?void 0:n.indexOf(e.id)},e.getToggleGroupingHandler=()=>{const n=e.getCanGroup();return()=>{n&&e.toggleGrouping()}},e.getAutoAggregationFn=()=>{const n=t.getCoreRowModel().flatRows[0],r=n==null?void 0:n.getValue(e.id);if(typeof r=="number")return Ci.sum;if(Object.prototype.toString.call(r)==="[object Date]")return Ci.extent},e.getAggregationFn=()=>{var n,r;if(!e)throw new Error;return ks(e.columnDef.aggregationFn)?e.columnDef.aggregationFn:e.columnDef.aggregationFn==="auto"?e.getAutoAggregationFn():(n=(r=t.options.aggregationFns)==null?void 0:r[e.columnDef.aggregationFn])!=null?n:Ci[e.columnDef.aggregationFn]}},createTable:e=>{e.setGrouping=t=>e.options.onGroupingChange==null?void 0:e.options.onGroupingChange(t),e.resetGrouping=t=>{var n,r;e.setGrouping(t?[]:(n=(r=e.initialState)==null?void 0:r.grouping)!=null?n:[])},e.getPreGroupedRowModel=()=>e.getFilteredRowModel(),e.getGroupedRowModel=()=>(!e._getGroupedRowModel&&e.options.getGroupedRowModel&&(e._getGroupedRowModel=e.options.getGroupedRowModel(e)),e.options.manualGrouping||!e._getGroupedRowModel?e.getPreGroupedRowModel():e._getGroupedRowModel())},createRow:(e,t)=>{e.getIsGrouped=()=>!!e.groupingColumnId,e.getGroupingValue=n=>{if(e._groupingValuesCache.hasOwnProperty(n))return e._groupingValuesCache[n];const r=t.getColumn(n);return r!=null&&r.columnDef.getGroupingValue?(e._groupingValuesCache[n]=r.columnDef.getGroupingValue(e.original),e._groupingValuesCache[n]):e.getValue(n)},e._groupingValuesCache={}},createCell:(e,t,n,r)=>{e.getIsGrouped=()=>t.getIsGrouped()&&t.id===n.groupingColumnId,e.getIsPlaceholder=()=>!e.getIsGrouped()&&t.getIsGrouped(),e.getIsAggregated=()=>{var o;return!e.getIsGrouped()&&!e.getIsPlaceholder()&&!!((o=n.subRows)!=null&&o.length)}}};function TP(e,t,n){if(!(t!=null&&t.length)||!n)return e;const r=e.filter(s=>!t.includes(s.id));return n==="remove"?r:[...t.map(s=>e.find(i=>i.id===s)).filter(Boolean),...r]}const DP={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:Xe("columnOrder",e)}),createColumn:(e,t)=>{e.getIndex=oe(n=>[Or(t,n)],n=>n.findIndex(r=>r.id===e.id),se(t.options,"debugColumns","getIndex")),e.getIsFirstColumn=n=>{var r;return((r=Or(t,n)[0])==null?void 0:r.id)===e.id},e.getIsLastColumn=n=>{var r;const o=Or(t,n);return((r=o[o.length-1])==null?void 0:r.id)===e.id}},createTable:e=>{e.setColumnOrder=t=>e.options.onColumnOrderChange==null?void 0:e.options.onColumnOrderChange(t),e.resetColumnOrder=t=>{var n;e.setColumnOrder(t?[]:(n=e.initialState.columnOrder)!=null?n:[])},e._getOrderColumnsFn=oe(()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode],(t,n,r)=>o=>{let s=[];if(!(t!=null&&t.length))s=o;else{const i=[...t],a=[...o];for(;a.length&&i.length;){const l=i.shift(),c=a.findIndex(u=>u.id===l);c>-1&&s.push(a.splice(c,1)[0])}s=[...s,...a]}return TP(s,n,r)},se(e.options,"debugTable","_getOrderColumnsFn"))}},Ri=()=>({left:[],right:[]}),MP={getInitialState:e=>({columnPinning:Ri(),...e}),getDefaultOptions:e=>({onColumnPinningChange:Xe("columnPinning",e)}),createColumn:(e,t)=>{e.pin=n=>{const r=e.getLeafColumns().map(o=>o.id).filter(Boolean);t.setColumnPinning(o=>{var s,i;if(n==="right"){var a,l;return{left:((a=o==null?void 0:o.left)!=null?a:[]).filter(d=>!(r!=null&&r.includes(d))),right:[...((l=o==null?void 0:o.right)!=null?l:[]).filter(d=>!(r!=null&&r.includes(d))),...r]}}if(n==="left"){var c,u;return{left:[...((c=o==null?void 0:o.left)!=null?c:[]).filter(d=>!(r!=null&&r.includes(d))),...r],right:((u=o==null?void 0:o.right)!=null?u:[]).filter(d=>!(r!=null&&r.includes(d)))}}return{left:((s=o==null?void 0:o.left)!=null?s:[]).filter(d=>!(r!=null&&r.includes(d))),right:((i=o==null?void 0:o.right)!=null?i:[]).filter(d=>!(r!=null&&r.includes(d)))}})},e.getCanPin=()=>e.getLeafColumns().some(r=>{var o,s,i;return((o=r.columnDef.enablePinning)!=null?o:!0)&&((s=(i=t.options.enableColumnPinning)!=null?i:t.options.enablePinning)!=null?s:!0)}),e.getIsPinned=()=>{const n=e.getLeafColumns().map(a=>a.id),{left:r,right:o}=t.getState().columnPinning,s=n.some(a=>r==null?void 0:r.includes(a)),i=n.some(a=>o==null?void 0:o.includes(a));return s?"left":i?"right":!1},e.getPinnedIndex=()=>{var n,r;const o=e.getIsPinned();return o?(n=(r=t.getState().columnPinning)==null||(r=r[o])==null?void 0:r.indexOf(e.id))!=null?n:-1:0}},createRow:(e,t)=>{e.getCenterVisibleCells=oe(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left,t.getState().columnPinning.right],(n,r,o)=>{const s=[...r??[],...o??[]];return n.filter(i=>!s.includes(i.column.id))},se(t.options,"debugRows","getCenterVisibleCells")),e.getLeftVisibleCells=oe(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left],(n,r)=>(r??[]).map(s=>n.find(i=>i.column.id===s)).filter(Boolean).map(s=>({...s,position:"left"})),se(t.options,"debugRows","getLeftVisibleCells")),e.getRightVisibleCells=oe(()=>[e._getAllVisibleCells(),t.getState().columnPinning.right],(n,r)=>(r??[]).map(s=>n.find(i=>i.column.id===s)).filter(Boolean).map(s=>({...s,position:"right"})),se(t.options,"debugRows","getRightVisibleCells"))},createTable:e=>{e.setColumnPinning=t=>e.options.onColumnPinningChange==null?void 0:e.options.onColumnPinningChange(t),e.resetColumnPinning=t=>{var n,r;return e.setColumnPinning(t?Ri():(n=(r=e.initialState)==null?void 0:r.columnPinning)!=null?n:Ri())},e.getIsSomeColumnsPinned=t=>{var n;const r=e.getState().columnPinning;if(!t){var o,s;return!!((o=r.left)!=null&&o.length||(s=r.right)!=null&&s.length)}return!!((n=r[t])!=null&&n.length)},e.getLeftLeafColumns=oe(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left],(t,n)=>(n??[]).map(r=>t.find(o=>o.id===r)).filter(Boolean),se(e.options,"debugColumns","getLeftLeafColumns")),e.getRightLeafColumns=oe(()=>[e.getAllLeafColumns(),e.getState().columnPinning.right],(t,n)=>(n??[]).map(r=>t.find(o=>o.id===r)).filter(Boolean),se(e.options,"debugColumns","getRightLeafColumns")),e.getCenterLeafColumns=oe(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r)=>{const o=[...n??[],...r??[]];return t.filter(s=>!o.includes(s.id))},se(e.options,"debugColumns","getCenterLeafColumns"))}},Do={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},Ti=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),EP={getDefaultColumnDef:()=>Do,getInitialState:e=>({columnSizing:{},columnSizingInfo:Ti(),...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:Xe("columnSizing",e),onColumnSizingInfoChange:Xe("columnSizingInfo",e)}),createColumn:(e,t)=>{e.getSize=()=>{var n,r,o;const s=t.getState().columnSizing[e.id];return Math.min(Math.max((n=e.columnDef.minSize)!=null?n:Do.minSize,(r=s??e.columnDef.size)!=null?r:Do.size),(o=e.columnDef.maxSize)!=null?o:Do.maxSize)},e.getStart=oe(n=>[n,Or(t,n),t.getState().columnSizing],(n,r)=>r.slice(0,e.getIndex(n)).reduce((o,s)=>o+s.getSize(),0),se(t.options,"debugColumns","getStart")),e.getAfter=oe(n=>[n,Or(t,n),t.getState().columnSizing],(n,r)=>r.slice(e.getIndex(n)+1).reduce((o,s)=>o+s.getSize(),0),se(t.options,"debugColumns","getAfter")),e.resetSize=()=>{t.setColumnSizing(n=>{let{[e.id]:r,...o}=n;return o})},e.getCanResize=()=>{var n,r;return((n=e.columnDef.enableResizing)!=null?n:!0)&&((r=t.options.enableColumnResizing)!=null?r:!0)},e.getIsResizing=()=>t.getState().columnSizingInfo.isResizingColumn===e.id},createHeader:(e,t)=>{e.getSize=()=>{let n=0;const r=o=>{if(o.subHeaders.length)o.subHeaders.forEach(r);else{var s;n+=(s=o.column.getSize())!=null?s:0}};return r(e),n},e.getStart=()=>{if(e.index>0){const n=e.headerGroup.headers[e.index-1];return n.getStart()+n.getSize()}return 0},e.getResizeHandler=n=>{const r=t.getColumn(e.column.id),o=r==null?void 0:r.getCanResize();return s=>{if(!r||!o||(s.persist==null||s.persist(),Di(s)&&s.touches&&s.touches.length>1))return;const i=e.getSize(),a=e?e.getLeafHeaders().map(w=>[w.column.id,w.column.getSize()]):[[r.id,r.getSize()]],l=Di(s)?Math.round(s.touches[0].clientX):s.clientX,c={},u=(w,v)=>{typeof v=="number"&&(t.setColumnSizingInfo(m=>{var C,x;const D=t.options.columnResizeDirection==="rtl"?-1:1,S=(v-((C=m==null?void 0:m.startOffset)!=null?C:0))*D,M=Math.max(S/((x=m==null?void 0:m.startSize)!=null?x:0),-.999999);return m.columnSizingStart.forEach(P=>{let[O,_]=P;c[O]=Math.round(Math.max(_+_*M,0)*100)/100}),{...m,deltaOffset:S,deltaPercentage:M}}),(t.options.columnResizeMode==="onChange"||w==="end")&&t.setColumnSizing(m=>({...m,...c})))},d=w=>u("move",w),p=w=>{u("end",w),t.setColumnSizingInfo(v=>({...v,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},f=n||typeof document<"u"?document:null,g={moveHandler:w=>d(w.clientX),upHandler:w=>{f==null||f.removeEventListener("mousemove",g.moveHandler),f==null||f.removeEventListener("mouseup",g.upHandler),p(w.clientX)}},h={moveHandler:w=>(w.cancelable&&(w.preventDefault(),w.stopPropagation()),d(w.touches[0].clientX),!1),upHandler:w=>{var v;f==null||f.removeEventListener("touchmove",h.moveHandler),f==null||f.removeEventListener("touchend",h.upHandler),w.cancelable&&(w.preventDefault(),w.stopPropagation()),p((v=w.touches[0])==null?void 0:v.clientX)}},b=PP()?{passive:!1}:!1;Di(s)?(f==null||f.addEventListener("touchmove",h.moveHandler,b),f==null||f.addEventListener("touchend",h.upHandler,b)):(f==null||f.addEventListener("mousemove",g.moveHandler,b),f==null||f.addEventListener("mouseup",g.upHandler,b)),t.setColumnSizingInfo(w=>({...w,startOffset:l,startSize:i,deltaOffset:0,deltaPercentage:0,columnSizingStart:a,isResizingColumn:r.id}))}}},createTable:e=>{e.setColumnSizing=t=>e.options.onColumnSizingChange==null?void 0:e.options.onColumnSizingChange(t),e.setColumnSizingInfo=t=>e.options.onColumnSizingInfoChange==null?void 0:e.options.onColumnSizingInfoChange(t),e.resetColumnSizing=t=>{var n;e.setColumnSizing(t?{}:(n=e.initialState.columnSizing)!=null?n:{})},e.resetHeaderSizeInfo=t=>{var n;e.setColumnSizingInfo(t?Ti():(n=e.initialState.columnSizingInfo)!=null?n:Ti())},e.getTotalSize=()=>{var t,n;return(t=(n=e.getHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?t:0},e.getLeftTotalSize=()=>{var t,n;return(t=(n=e.getLeftHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?t:0},e.getCenterTotalSize=()=>{var t,n;return(t=(n=e.getCenterHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?t:0},e.getRightTotalSize=()=>{var t,n;return(t=(n=e.getRightHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?t:0}}};let Mo=null;function PP(){if(typeof Mo=="boolean")return Mo;let e=!1;try{const t={get passive(){return e=!0,!1}},n=()=>{};window.addEventListener("test",n,t),window.removeEventListener("test",n)}catch{e=!1}return Mo=e,Mo}function Di(e){return e.type==="touchstart"}const AP={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:Xe("columnVisibility",e)}),createColumn:(e,t)=>{e.toggleVisibility=n=>{e.getCanHide()&&t.setColumnVisibility(r=>({...r,[e.id]:n??!e.getIsVisible()}))},e.getIsVisible=()=>{var n,r;const o=e.columns;return(n=o.length?o.some(s=>s.getIsVisible()):(r=t.getState().columnVisibility)==null?void 0:r[e.id])!=null?n:!0},e.getCanHide=()=>{var n,r;return((n=e.columnDef.enableHiding)!=null?n:!0)&&((r=t.options.enableHiding)!=null?r:!0)},e.getToggleVisibilityHandler=()=>n=>{e.toggleVisibility==null||e.toggleVisibility(n.target.checked)}},createRow:(e,t)=>{e._getAllVisibleCells=oe(()=>[e.getAllCells(),t.getState().columnVisibility],n=>n.filter(r=>r.column.getIsVisible()),se(t.options,"debugRows","_getAllVisibleCells")),e.getVisibleCells=oe(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(n,r,o)=>[...n,...r,...o],se(t.options,"debugRows","getVisibleCells"))},createTable:e=>{const t=(n,r)=>oe(()=>[r(),r().filter(o=>o.getIsVisible()).map(o=>o.id).join("_")],o=>o.filter(s=>s.getIsVisible==null?void 0:s.getIsVisible()),se(e.options,"debugColumns",n));e.getVisibleFlatColumns=t("getVisibleFlatColumns",()=>e.getAllFlatColumns()),e.getVisibleLeafColumns=t("getVisibleLeafColumns",()=>e.getAllLeafColumns()),e.getLeftVisibleLeafColumns=t("getLeftVisibleLeafColumns",()=>e.getLeftLeafColumns()),e.getRightVisibleLeafColumns=t("getRightVisibleLeafColumns",()=>e.getRightLeafColumns()),e.getCenterVisibleLeafColumns=t("getCenterVisibleLeafColumns",()=>e.getCenterLeafColumns()),e.setColumnVisibility=n=>e.options.onColumnVisibilityChange==null?void 0:e.options.onColumnVisibilityChange(n),e.resetColumnVisibility=n=>{var r;e.setColumnVisibility(n?{}:(r=e.initialState.columnVisibility)!=null?r:{})},e.toggleAllColumnsVisible=n=>{var r;n=(r=n)!=null?r:!e.getIsAllColumnsVisible(),e.setColumnVisibility(e.getAllLeafColumns().reduce((o,s)=>({...o,[s.id]:n||!(s.getCanHide!=null&&s.getCanHide())}),{}))},e.getIsAllColumnsVisible=()=>!e.getAllLeafColumns().some(n=>!(n.getIsVisible!=null&&n.getIsVisible())),e.getIsSomeColumnsVisible=()=>e.getAllLeafColumns().some(n=>n.getIsVisible==null?void 0:n.getIsVisible()),e.getToggleAllColumnsVisibilityHandler=()=>n=>{var r;e.toggleAllColumnsVisible((r=n.target)==null?void 0:r.checked)}}};function Or(e,t){return t?t==="center"?e.getCenterVisibleLeafColumns():t==="left"?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}const OP={createTable:e=>{e._getGlobalFacetedRowModel=e.options.getFacetedRowModel&&e.options.getFacetedRowModel(e,"__global__"),e.getGlobalFacetedRowModel=()=>e.options.manualFiltering||!e._getGlobalFacetedRowModel?e.getPreFilteredRowModel():e._getGlobalFacetedRowModel(),e._getGlobalFacetedUniqueValues=e.options.getFacetedUniqueValues&&e.options.getFacetedUniqueValues(e,"__global__"),e.getGlobalFacetedUniqueValues=()=>e._getGlobalFacetedUniqueValues?e._getGlobalFacetedUniqueValues():new Map,e._getGlobalFacetedMinMaxValues=e.options.getFacetedMinMaxValues&&e.options.getFacetedMinMaxValues(e,"__global__"),e.getGlobalFacetedMinMaxValues=()=>{if(e._getGlobalFacetedMinMaxValues)return e._getGlobalFacetedMinMaxValues()}}},_P={getInitialState:e=>({globalFilter:void 0,...e}),getDefaultOptions:e=>({onGlobalFilterChange:Xe("globalFilter",e),globalFilterFn:"auto",getColumnCanGlobalFilter:t=>{var n;const r=(n=e.getCoreRowModel().flatRows[0])==null||(n=n._getAllCellsByColumnId()[t.id])==null?void 0:n.getValue();return typeof r=="string"||typeof r=="number"}}),createColumn:(e,t)=>{e.getCanGlobalFilter=()=>{var n,r,o,s;return((n=e.columnDef.enableGlobalFilter)!=null?n:!0)&&((r=t.options.enableGlobalFilter)!=null?r:!0)&&((o=t.options.enableFilters)!=null?o:!0)&&((s=t.options.getColumnCanGlobalFilter==null?void 0:t.options.getColumnCanGlobalFilter(e))!=null?s:!0)&&!!e.accessorFn}},createTable:e=>{e.getGlobalAutoFilterFn=()=>Mt.includesString,e.getGlobalFilterFn=()=>{var t,n;const{globalFilterFn:r}=e.options;return ks(r)?r:r==="auto"?e.getGlobalAutoFilterFn():(t=(n=e.options.filterFns)==null?void 0:n[r])!=null?t:Mt[r]},e.setGlobalFilter=t=>{e.options.onGlobalFilterChange==null||e.options.onGlobalFilterChange(t)},e.resetGlobalFilter=t=>{e.setGlobalFilter(t?void 0:e.initialState.globalFilter)}}},kP={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:Xe("expanded",e),paginateExpandedRows:!0}),createTable:e=>{let t=!1,n=!1;e._autoResetExpanded=()=>{var r,o;if(!t){e._queue(()=>{t=!0});return}if((r=(o=e.options.autoResetAll)!=null?o:e.options.autoResetExpanded)!=null?r:!e.options.manualExpanding){if(n)return;n=!0,e._queue(()=>{e.resetExpanded(),n=!1})}},e.setExpanded=r=>e.options.onExpandedChange==null?void 0:e.options.onExpandedChange(r),e.toggleAllRowsExpanded=r=>{r??!e.getIsAllRowsExpanded()?e.setExpanded(!0):e.setExpanded({})},e.resetExpanded=r=>{var o,s;e.setExpanded(r?{}:(o=(s=e.initialState)==null?void 0:s.expanded)!=null?o:{})},e.getCanSomeRowsExpand=()=>e.getPrePaginationRowModel().flatRows.some(r=>r.getCanExpand()),e.getToggleAllRowsExpandedHandler=()=>r=>{r.persist==null||r.persist(),e.toggleAllRowsExpanded()},e.getIsSomeRowsExpanded=()=>{const r=e.getState().expanded;return r===!0||Object.values(r).some(Boolean)},e.getIsAllRowsExpanded=()=>{const r=e.getState().expanded;return typeof r=="boolean"?r===!0:!(!Object.keys(r).length||e.getRowModel().flatRows.some(o=>!o.getIsExpanded()))},e.getExpandedDepth=()=>{let r=0;return(e.getState().expanded===!0?Object.keys(e.getRowModel().rowsById):Object.keys(e.getState().expanded)).forEach(s=>{const i=s.split(".");r=Math.max(r,i.length)}),r},e.getPreExpandedRowModel=()=>e.getSortedRowModel(),e.getExpandedRowModel=()=>(!e._getExpandedRowModel&&e.options.getExpandedRowModel&&(e._getExpandedRowModel=e.options.getExpandedRowModel(e)),e.options.manualExpanding||!e._getExpandedRowModel?e.getPreExpandedRowModel():e._getExpandedRowModel())},createRow:(e,t)=>{e.toggleExpanded=n=>{t.setExpanded(r=>{var o;const s=r===!0?!0:!!(r!=null&&r[e.id]);let i={};if(r===!0?Object.keys(t.getRowModel().rowsById).forEach(a=>{i[a]=!0}):i=r,n=(o=n)!=null?o:!s,!s&&n)return{...i,[e.id]:!0};if(s&&!n){const{[e.id]:a,...l}=i;return l}return r})},e.getIsExpanded=()=>{var n;const r=t.getState().expanded;return!!((n=t.options.getIsRowExpanded==null?void 0:t.options.getIsRowExpanded(e))!=null?n:r===!0||r!=null&&r[e.id])},e.getCanExpand=()=>{var n,r,o;return(n=t.options.getRowCanExpand==null?void 0:t.options.getRowCanExpand(e))!=null?n:((r=t.options.enableExpanding)!=null?r:!0)&&!!((o=e.subRows)!=null&&o.length)},e.getIsAllParentsExpanded=()=>{let n=!0,r=e;for(;n&&r.parentId;)r=t.getRow(r.parentId,!0),n=r.getIsExpanded();return n},e.getToggleExpandedHandler=()=>{const n=e.getCanExpand();return()=>{n&&e.toggleExpanded()}}}},xa=0,ba=10,Mi=()=>({pageIndex:xa,pageSize:ba}),IP={getInitialState:e=>({...e,pagination:{...Mi(),...e==null?void 0:e.pagination}}),getDefaultOptions:e=>({onPaginationChange:Xe("pagination",e)}),createTable:e=>{let t=!1,n=!1;e._autoResetPageIndex=()=>{var r,o;if(!t){e._queue(()=>{t=!0});return}if((r=(o=e.options.autoResetAll)!=null?o:e.options.autoResetPageIndex)!=null?r:!e.options.manualPagination){if(n)return;n=!0,e._queue(()=>{e.resetPageIndex(),n=!1})}},e.setPagination=r=>{const o=s=>Yt(r,s);return e.options.onPaginationChange==null?void 0:e.options.onPaginationChange(o)},e.resetPagination=r=>{var o;e.setPagination(r?Mi():(o=e.initialState.pagination)!=null?o:Mi())},e.setPageIndex=r=>{e.setPagination(o=>{let s=Yt(r,o.pageIndex);const i=typeof e.options.pageCount>"u"||e.options.pageCount===-1?Number.MAX_SAFE_INTEGER:e.options.pageCount-1;return s=Math.max(0,Math.min(s,i)),{...o,pageIndex:s}})},e.resetPageIndex=r=>{var o,s;e.setPageIndex(r?xa:(o=(s=e.initialState)==null||(s=s.pagination)==null?void 0:s.pageIndex)!=null?o:xa)},e.resetPageSize=r=>{var o,s;e.setPageSize(r?ba:(o=(s=e.initialState)==null||(s=s.pagination)==null?void 0:s.pageSize)!=null?o:ba)},e.setPageSize=r=>{e.setPagination(o=>{const s=Math.max(1,Yt(r,o.pageSize)),i=o.pageSize*o.pageIndex,a=Math.floor(i/s);return{...o,pageIndex:a,pageSize:s}})},e.setPageCount=r=>e.setPagination(o=>{var s;let i=Yt(r,(s=e.options.pageCount)!=null?s:-1);return typeof i=="number"&&(i=Math.max(-1,i)),{...o,pageCount:i}}),e.getPageOptions=oe(()=>[e.getPageCount()],r=>{let o=[];return r&&r>0&&(o=[...new Array(r)].fill(null).map((s,i)=>i)),o},se(e.options,"debugTable","getPageOptions")),e.getCanPreviousPage=()=>e.getState().pagination.pageIndex>0,e.getCanNextPage=()=>{const{pageIndex:r}=e.getState().pagination,o=e.getPageCount();return o===-1?!0:o===0?!1:r<o-1},e.previousPage=()=>e.setPageIndex(r=>r-1),e.nextPage=()=>e.setPageIndex(r=>r+1),e.firstPage=()=>e.setPageIndex(0),e.lastPage=()=>e.setPageIndex(e.getPageCount()-1),e.getPrePaginationRowModel=()=>e.getExpandedRowModel(),e.getPaginationRowModel=()=>(!e._getPaginationRowModel&&e.options.getPaginationRowModel&&(e._getPaginationRowModel=e.options.getPaginationRowModel(e)),e.options.manualPagination||!e._getPaginationRowModel?e.getPrePaginationRowModel():e._getPaginationRowModel()),e.getPageCount=()=>{var r;return(r=e.options.pageCount)!=null?r:Math.ceil(e.getRowCount()/e.getState().pagination.pageSize)},e.getRowCount=()=>{var r;return(r=e.options.rowCount)!=null?r:e.getPrePaginationRowModel().rows.length}}},Ei=()=>({top:[],bottom:[]}),NP={getInitialState:e=>({rowPinning:Ei(),...e}),getDefaultOptions:e=>({onRowPinningChange:Xe("rowPinning",e)}),createRow:(e,t)=>{e.pin=(n,r,o)=>{const s=r?e.getLeafRows().map(l=>{let{id:c}=l;return c}):[],i=o?e.getParentRows().map(l=>{let{id:c}=l;return c}):[],a=new Set([...i,e.id,...s]);t.setRowPinning(l=>{var c,u;if(n==="bottom"){var d,p;return{top:((d=l==null?void 0:l.top)!=null?d:[]).filter(h=>!(a!=null&&a.has(h))),bottom:[...((p=l==null?void 0:l.bottom)!=null?p:[]).filter(h=>!(a!=null&&a.has(h))),...Array.from(a)]}}if(n==="top"){var f,g;return{top:[...((f=l==null?void 0:l.top)!=null?f:[]).filter(h=>!(a!=null&&a.has(h))),...Array.from(a)],bottom:((g=l==null?void 0:l.bottom)!=null?g:[]).filter(h=>!(a!=null&&a.has(h)))}}return{top:((c=l==null?void 0:l.top)!=null?c:[]).filter(h=>!(a!=null&&a.has(h))),bottom:((u=l==null?void 0:l.bottom)!=null?u:[]).filter(h=>!(a!=null&&a.has(h)))}})},e.getCanPin=()=>{var n;const{enableRowPinning:r,enablePinning:o}=t.options;return typeof r=="function"?r(e):(n=r??o)!=null?n:!0},e.getIsPinned=()=>{const n=[e.id],{top:r,bottom:o}=t.getState().rowPinning,s=n.some(a=>r==null?void 0:r.includes(a)),i=n.some(a=>o==null?void 0:o.includes(a));return s?"top":i?"bottom":!1},e.getPinnedIndex=()=>{var n,r;const o=e.getIsPinned();if(!o)return-1;const s=(n=o==="top"?t.getTopRows():t.getBottomRows())==null?void 0:n.map(i=>{let{id:a}=i;return a});return(r=s==null?void 0:s.indexOf(e.id))!=null?r:-1}},createTable:e=>{e.setRowPinning=t=>e.options.onRowPinningChange==null?void 0:e.options.onRowPinningChange(t),e.resetRowPinning=t=>{var n,r;return e.setRowPinning(t?Ei():(n=(r=e.initialState)==null?void 0:r.rowPinning)!=null?n:Ei())},e.getIsSomeRowsPinned=t=>{var n;const r=e.getState().rowPinning;if(!t){var o,s;return!!((o=r.top)!=null&&o.length||(s=r.bottom)!=null&&s.length)}return!!((n=r[t])!=null&&n.length)},e._getPinnedRows=(t,n,r)=>{var o;return((o=e.options.keepPinnedRows)==null||o?(n??[]).map(i=>{const a=e.getRow(i,!0);return a.getIsAllParentsExpanded()?a:null}):(n??[]).map(i=>t.find(a=>a.id===i))).filter(Boolean).map(i=>({...i,position:r}))},e.getTopRows=oe(()=>[e.getRowModel().rows,e.getState().rowPinning.top],(t,n)=>e._getPinnedRows(t,n,"top"),se(e.options,"debugRows","getTopRows")),e.getBottomRows=oe(()=>[e.getRowModel().rows,e.getState().rowPinning.bottom],(t,n)=>e._getPinnedRows(t,n,"bottom"),se(e.options,"debugRows","getBottomRows")),e.getCenterRows=oe(()=>[e.getRowModel().rows,e.getState().rowPinning.top,e.getState().rowPinning.bottom],(t,n,r)=>{const o=new Set([...n??[],...r??[]]);return t.filter(s=>!o.has(s.id))},se(e.options,"debugRows","getCenterRows"))}},jP={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:Xe("rowSelection",e),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:e=>{e.setRowSelection=t=>e.options.onRowSelectionChange==null?void 0:e.options.onRowSelectionChange(t),e.resetRowSelection=t=>{var n;return e.setRowSelection(t?{}:(n=e.initialState.rowSelection)!=null?n:{})},e.toggleAllRowsSelected=t=>{e.setRowSelection(n=>{t=typeof t<"u"?t:!e.getIsAllRowsSelected();const r={...n},o=e.getPreGroupedRowModel().flatRows;return t?o.forEach(s=>{s.getCanSelect()&&(r[s.id]=!0)}):o.forEach(s=>{delete r[s.id]}),r})},e.toggleAllPageRowsSelected=t=>e.setRowSelection(n=>{const r=typeof t<"u"?t:!e.getIsAllPageRowsSelected(),o={...n};return e.getRowModel().rows.forEach(s=>{Sa(o,s.id,r,!0,e)}),o}),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=oe(()=>[e.getState().rowSelection,e.getCoreRowModel()],(t,n)=>Object.keys(t).length?Pi(e,n):{rows:[],flatRows:[],rowsById:{}},se(e.options,"debugTable","getSelectedRowModel")),e.getFilteredSelectedRowModel=oe(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(t,n)=>Object.keys(t).length?Pi(e,n):{rows:[],flatRows:[],rowsById:{}},se(e.options,"debugTable","getFilteredSelectedRowModel")),e.getGroupedSelectedRowModel=oe(()=>[e.getState().rowSelection,e.getSortedRowModel()],(t,n)=>Object.keys(t).length?Pi(e,n):{rows:[],flatRows:[],rowsById:{}},se(e.options,"debugTable","getGroupedSelectedRowModel")),e.getIsAllRowsSelected=()=>{const t=e.getFilteredRowModel().flatRows,{rowSelection:n}=e.getState();let r=!!(t.length&&Object.keys(n).length);return r&&t.some(o=>o.getCanSelect()&&!n[o.id])&&(r=!1),r},e.getIsAllPageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows.filter(o=>o.getCanSelect()),{rowSelection:n}=e.getState();let r=!!t.length;return r&&t.some(o=>!n[o.id])&&(r=!1),r},e.getIsSomeRowsSelected=()=>{var t;const n=Object.keys((t=e.getState().rowSelection)!=null?t:{}).length;return n>0&&n<e.getFilteredRowModel().flatRows.length},e.getIsSomePageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows;return e.getIsAllPageRowsSelected()?!1:t.filter(n=>n.getCanSelect()).some(n=>n.getIsSelected()||n.getIsSomeSelected())},e.getToggleAllRowsSelectedHandler=()=>t=>{e.toggleAllRowsSelected(t.target.checked)},e.getToggleAllPageRowsSelectedHandler=()=>t=>{e.toggleAllPageRowsSelected(t.target.checked)}},createRow:(e,t)=>{e.toggleSelected=(n,r)=>{const o=e.getIsSelected();t.setRowSelection(s=>{var i;if(n=typeof n<"u"?n:!o,e.getCanSelect()&&o===n)return s;const a={...s};return Sa(a,e.id,n,(i=r==null?void 0:r.selectChildren)!=null?i:!0,t),a})},e.getIsSelected=()=>{const{rowSelection:n}=t.getState();return Kl(e,n)},e.getIsSomeSelected=()=>{const{rowSelection:n}=t.getState();return Ca(e,n)==="some"},e.getIsAllSubRowsSelected=()=>{const{rowSelection:n}=t.getState();return Ca(e,n)==="all"},e.getCanSelect=()=>{var n;return typeof t.options.enableRowSelection=="function"?t.options.enableRowSelection(e):(n=t.options.enableRowSelection)!=null?n:!0},e.getCanSelectSubRows=()=>{var n;return typeof t.options.enableSubRowSelection=="function"?t.options.enableSubRowSelection(e):(n=t.options.enableSubRowSelection)!=null?n:!0},e.getCanMultiSelect=()=>{var n;return typeof t.options.enableMultiRowSelection=="function"?t.options.enableMultiRowSelection(e):(n=t.options.enableMultiRowSelection)!=null?n:!0},e.getToggleSelectedHandler=()=>{const n=e.getCanSelect();return r=>{var o;n&&e.toggleSelected((o=r.target)==null?void 0:o.checked)}}}},Sa=(e,t,n,r,o)=>{var s;const i=o.getRow(t,!0);n?(i.getCanMultiSelect()||Object.keys(e).forEach(a=>delete e[a]),i.getCanSelect()&&(e[t]=!0)):delete e[t],r&&(s=i.subRows)!=null&&s.length&&i.getCanSelectSubRows()&&i.subRows.forEach(a=>Sa(e,a.id,n,r,o))};function Pi(e,t){const n=e.getState().rowSelection,r=[],o={},s=function(i,a){return i.map(l=>{var c;const u=Kl(l,n);if(u&&(r.push(l),o[l.id]=l),(c=l.subRows)!=null&&c.length&&(l={...l,subRows:s(l.subRows)}),u)return l}).filter(Boolean)};return{rows:s(t.rows),flatRows:r,rowsById:o}}function Kl(e,t){var n;return(n=t[e.id])!=null?n:!1}function Ca(e,t,n){var r;if(!((r=e.subRows)!=null&&r.length))return!1;let o=!0,s=!1;return e.subRows.forEach(i=>{if(!(s&&!o)&&(i.getCanSelect()&&(Kl(i,t)?s=!0:o=!1),i.subRows&&i.subRows.length)){const a=Ca(i,t);a==="all"?s=!0:(a==="some"&&(s=!0),o=!1)}}),o?"all":s?"some":!1}const Ra=/([0-9]+)/gm,FP=(e,t,n)=>ym(en(e.getValue(n)).toLowerCase(),en(t.getValue(n)).toLowerCase()),VP=(e,t,n)=>ym(en(e.getValue(n)),en(t.getValue(n))),LP=(e,t,n)=>ql(en(e.getValue(n)).toLowerCase(),en(t.getValue(n)).toLowerCase()),$P=(e,t,n)=>ql(en(e.getValue(n)),en(t.getValue(n))),BP=(e,t,n)=>{const r=e.getValue(n),o=t.getValue(n);return r>o?1:r<o?-1:0},zP=(e,t,n)=>ql(e.getValue(n),t.getValue(n));function ql(e,t){return e===t?0:e>t?1:-1}function en(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}function ym(e,t){const n=e.split(Ra).filter(Boolean),r=t.split(Ra).filter(Boolean);for(;n.length&&r.length;){const o=n.shift(),s=r.shift(),i=parseInt(o,10),a=parseInt(s,10),l=[i,a].sort();if(isNaN(l[0])){if(o>s)return 1;if(s>o)return-1;continue}if(isNaN(l[1]))return isNaN(i)?-1:1;if(i>a)return 1;if(a>i)return-1}return n.length-r.length}const hr={alphanumeric:FP,alphanumericCaseSensitive:VP,text:LP,textCaseSensitive:$P,datetime:BP,basic:zP},HP={getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:Xe("sorting",e),isMultiSortEvent:t=>t.shiftKey}),createColumn:(e,t)=>{e.getAutoSortingFn=()=>{const n=t.getFilteredRowModel().flatRows.slice(10);let r=!1;for(const o of n){const s=o==null?void 0:o.getValue(e.id);if(Object.prototype.toString.call(s)==="[object Date]")return hr.datetime;if(typeof s=="string"&&(r=!0,s.split(Ra).length>1))return hr.alphanumeric}return r?hr.text:hr.basic},e.getAutoSortDir=()=>{const n=t.getFilteredRowModel().flatRows[0];return typeof(n==null?void 0:n.getValue(e.id))=="string"?"asc":"desc"},e.getSortingFn=()=>{var n,r;if(!e)throw new Error;return ks(e.columnDef.sortingFn)?e.columnDef.sortingFn:e.columnDef.sortingFn==="auto"?e.getAutoSortingFn():(n=(r=t.options.sortingFns)==null?void 0:r[e.columnDef.sortingFn])!=null?n:hr[e.columnDef.sortingFn]},e.toggleSorting=(n,r)=>{const o=e.getNextSortingOrder(),s=typeof n<"u"&&n!==null;t.setSorting(i=>{const a=i==null?void 0:i.find(f=>f.id===e.id),l=i==null?void 0:i.findIndex(f=>f.id===e.id);let c=[],u,d=s?n:o==="desc";if(i!=null&&i.length&&e.getCanMultiSort()&&r?a?u="toggle":u="add":i!=null&&i.length&&l!==i.length-1?u="replace":a?u="toggle":u="replace",u==="toggle"&&(s||o||(u="remove")),u==="add"){var p;c=[...i,{id:e.id,desc:d}],c.splice(0,c.length-((p=t.options.maxMultiSortColCount)!=null?p:Number.MAX_SAFE_INTEGER))}else u==="toggle"?c=i.map(f=>f.id===e.id?{...f,desc:d}:f):u==="remove"?c=i.filter(f=>f.id!==e.id):c=[{id:e.id,desc:d}];return c})},e.getFirstSortDir=()=>{var n,r;return((n=(r=e.columnDef.sortDescFirst)!=null?r:t.options.sortDescFirst)!=null?n:e.getAutoSortDir()==="desc")?"desc":"asc"},e.getNextSortingOrder=n=>{var r,o;const s=e.getFirstSortDir(),i=e.getIsSorted();return i?i!==s&&((r=t.options.enableSortingRemoval)==null||r)&&(!(n&&(o=t.options.enableMultiRemove)!=null)||o)?!1:i==="desc"?"asc":"desc":s},e.getCanSort=()=>{var n,r;return((n=e.columnDef.enableSorting)!=null?n:!0)&&((r=t.options.enableSorting)!=null?r:!0)&&!!e.accessorFn},e.getCanMultiSort=()=>{var n,r;return(n=(r=e.columnDef.enableMultiSort)!=null?r:t.options.enableMultiSort)!=null?n:!!e.accessorFn},e.getIsSorted=()=>{var n;const r=(n=t.getState().sorting)==null?void 0:n.find(o=>o.id===e.id);return r?r.desc?"desc":"asc":!1},e.getSortIndex=()=>{var n,r;return(n=(r=t.getState().sorting)==null?void 0:r.findIndex(o=>o.id===e.id))!=null?n:-1},e.clearSorting=()=>{t.setSorting(n=>n!=null&&n.length?n.filter(r=>r.id!==e.id):[])},e.getToggleSortingHandler=()=>{const n=e.getCanSort();return r=>{n&&(r.persist==null||r.persist(),e.toggleSorting==null||e.toggleSorting(void 0,e.getCanMultiSort()?t.options.isMultiSortEvent==null?void 0:t.options.isMultiSortEvent(r):!1))}}},createTable:e=>{e.setSorting=t=>e.options.onSortingChange==null?void 0:e.options.onSortingChange(t),e.resetSorting=t=>{var n,r;e.setSorting(t?[]:(n=(r=e.initialState)==null?void 0:r.sorting)!=null?n:[])},e.getPreSortedRowModel=()=>e.getGroupedRowModel(),e.getSortedRowModel=()=>(!e._getSortedRowModel&&e.options.getSortedRowModel&&(e._getSortedRowModel=e.options.getSortedRowModel(e)),e.options.manualSorting||!e._getSortedRowModel?e.getPreSortedRowModel():e._getSortedRowModel())}},WP=[dP,AP,DP,MP,pP,hP,OP,_P,HP,RP,kP,IP,NP,jP,EP];function UP(e){var t,n;process.env.NODE_ENV!=="production"&&(e.debugAll||e.debugTable)&&console.info("Creating Table Instance...");const r=[...WP,...(t=e._features)!=null?t:[]];let o={_features:r};const s=o._features.reduce((p,f)=>Object.assign(p,f.getDefaultOptions==null?void 0:f.getDefaultOptions(o)),{}),i=p=>o.options.mergeOptions?o.options.mergeOptions(s,p):{...s,...p};let l={...{},...(n=e.initialState)!=null?n:{}};o._features.forEach(p=>{var f;l=(f=p.getInitialState==null?void 0:p.getInitialState(l))!=null?f:l});const c=[];let u=!1;const d={_features:r,options:{...s,...e},initialState:l,_queue:p=>{c.push(p),u||(u=!0,Promise.resolve().then(()=>{for(;c.length;)c.shift()();u=!1}).catch(f=>setTimeout(()=>{throw f})))},reset:()=>{o.setState(o.initialState)},setOptions:p=>{const f=Yt(p,o.options);o.options=i(f)},getState:()=>o.options.state,setState:p=>{o.options.onStateChange==null||o.options.onStateChange(p)},_getRowId:(p,f,g)=>{var h;return(h=o.options.getRowId==null?void 0:o.options.getRowId(p,f,g))!=null?h:`${g?[g.id,f].join("."):f}`},getCoreRowModel:()=>(o._getCoreRowModel||(o._getCoreRowModel=o.options.getCoreRowModel(o)),o._getCoreRowModel()),getRowModel:()=>o.getPaginationRowModel(),getRow:(p,f)=>{let g=(f?o.getPrePaginationRowModel():o.getRowModel()).rowsById[p];if(!g&&(g=o.getCoreRowModel().rowsById[p],!g))throw process.env.NODE_ENV!=="production"?new Error(`getRow could not find row with ID: ${p}`):new Error;return g},_getDefaultColumnDef:oe(()=>[o.options.defaultColumn],p=>{var f;return p=(f=p)!=null?f:{},{header:g=>{const h=g.header.column.columnDef;return h.accessorKey?h.accessorKey:h.accessorFn?h.id:null},cell:g=>{var h,b;return(h=(b=g.renderValue())==null||b.toString==null?void 0:b.toString())!=null?h:null},...o._features.reduce((g,h)=>Object.assign(g,h.getDefaultColumnDef==null?void 0:h.getDefaultColumnDef()),{}),...p}},se(e,"debugColumns","_getDefaultColumnDef")),_getColumnDefs:()=>o.options.columns,getAllColumns:oe(()=>[o._getColumnDefs()],p=>{const f=function(g,h,b){return b===void 0&&(b=0),g.map(w=>{const v=uP(o,w,b,h),m=w;return v.columns=m.columns?f(m.columns,v,b+1):[],v})};return f(p)},se(e,"debugColumns","getAllColumns")),getAllFlatColumns:oe(()=>[o.getAllColumns()],p=>p.flatMap(f=>f.getFlatColumns()),se(e,"debugColumns","getAllFlatColumns")),_getAllFlatColumnsById:oe(()=>[o.getAllFlatColumns()],p=>p.reduce((f,g)=>(f[g.id]=g,f),{}),se(e,"debugColumns","getAllFlatColumnsById")),getAllLeafColumns:oe(()=>[o.getAllColumns(),o._getOrderColumnsFn()],(p,f)=>{let g=p.flatMap(h=>h.getLeafColumns());return f(g)},se(e,"debugColumns","getAllLeafColumns")),getColumn:p=>{const f=o._getAllFlatColumnsById()[p];return process.env.NODE_ENV!=="production"&&!f&&console.error(`[Table] Column with id '${p}' does not exist.`),f}};Object.assign(o,d);for(let p=0;p<o._features.length;p++){const f=o._features[p];f==null||f.createTable==null||f.createTable(o)}return o}function GP(){return e=>oe(()=>[e.options.data],t=>{const n={rows:[],flatRows:[],rowsById:{}},r=function(o,s,i){s===void 0&&(s=0);const a=[];for(let c=0;c<o.length;c++){const u=fP(e,e._getRowId(o[c],c,i),o[c],c,s,void 0,i==null?void 0:i.id);if(n.flatRows.push(u),n.rowsById[u.id]=u,a.push(u),e.options.getSubRows){var l;u.originalSubRows=e.options.getSubRows(o[c],c),(l=u.originalSubRows)!=null&&l.length&&(u.subRows=r(u.originalSubRows,s+1,u))}}return a};return n.rows=r(t),n},se(e.options,"debugTable","getRowModel",()=>e._autoResetPageIndex()))}function YP(){return e=>oe(()=>[e.getState().sorting,e.getPreSortedRowModel()],(t,n)=>{if(!n.rows.length||!(t!=null&&t.length))return n;const r=e.getState().sorting,o=[],s=r.filter(l=>{var c;return(c=e.getColumn(l.id))==null?void 0:c.getCanSort()}),i={};s.forEach(l=>{const c=e.getColumn(l.id);c&&(i[l.id]={sortUndefined:c.columnDef.sortUndefined,invertSorting:c.columnDef.invertSorting,sortingFn:c.getSortingFn()})});const a=l=>{const c=l.map(u=>({...u}));return c.sort((u,d)=>{for(let f=0;f<s.length;f+=1){var p;const g=s[f],h=i[g.id],b=h.sortUndefined,w=(p=g==null?void 0:g.desc)!=null?p:!1;let v=0;if(b){const m=u.getValue(g.id),C=d.getValue(g.id),x=m===void 0,D=C===void 0;if(x||D){if(b==="first")return x?-1:1;if(b==="last")return x?1:-1;v=x&&D?0:x?b:-b}}if(v===0&&(v=h.sortingFn(u,d,g.id)),v!==0)return w&&(v*=-1),h.invertSorting&&(v*=-1),v}return u.index-d.index}),c.forEach(u=>{var d;o.push(u),(d=u.subRows)!=null&&d.length&&(u.subRows=a(u.subRows))}),c};return{rows:a(n.rows),flatRows:o,rowsById:n.rowsById}},se(e.options,"debugTable","getSortedRowModel",()=>e._autoResetPageIndex()))}/**
|
|
203
182
|
* react-table
|
|
204
183
|
*
|
|
205
184
|
* Copyright (c) TanStack
|
|
@@ -208,4 +187,25 @@ Valid keys: `+JSON.stringify(Object.keys(k),null," "));var z=ne(B,G,U,Z,q+"."+G
|
|
|
208
187
|
* LICENSE.md file in the root directory of this source tree.
|
|
209
188
|
*
|
|
210
189
|
* @license MIT
|
|
211
|
-
*/function tf(e,t){return e?i_(e)?R.createElement(e,t):e:null}function i_(e){return a_(e)||typeof e=="function"||l_(e)}function a_(e){return typeof e=="function"&&(()=>{const t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}function l_(e){return typeof e=="object"&&typeof e.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}function c_(e){const t={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[n]=R.useState(()=>({current:r_(t)})),[r,o]=R.useState(()=>n.current.initialState);return n.current.setOptions(s=>({...s,...e,state:{...r,...e.state},onStateChange:i=>{o(i),e.onStateChange==null||e.onStateChange(i)}})),n.current}const u_=({user:e,bookings:t,tableAccessors:n})=>{var h;const{daysOfWeek:r}=$e(),[o,s]=T.useState([]),[i,a]=T.useState([]),[l,c]=T.useState([]),[u,d]=T.useState({pageIndex:0,pageSize:5}),f=c_({data:o,columns:n,enableSorting:!0,onSortingChange:a,onColumnFiltersChange:c,onPaginationChange:d,getCoreRowModel:o_(),getSortedRowModel:s_(),state:{sorting:i,columnFilters:l,pagination:u}});return T.useEffect(()=>{s(t.filter(p=>{const b=r[0].getDay()===p.startAt.getDay(),y=r[0].getMonth()===p.startAt.getMonth();return b&&y}))},[r,t]),t.length===0?v.jsx("div",{className:"rounded-lg border border-gray-200 bg-white shadow-sm",children:v.jsxs("div",{className:"flex flex-col items-center justify-center py-12 px-6",children:[v.jsx("div",{className:"w-16 h-16 bg-gray-100 rounded-full flex items-center justify-center mb-4",children:v.jsx(Yo,{className:"w-8 h-8 text-gray-400"})}),v.jsx("h3",{className:"text-lg font-medium text-gray-900 mb-2",children:"No bookings found"}),v.jsx("p",{className:"text-gray-500 text-center",children:"There are no bookings to display at the moment."})]})}):v.jsxs("div",{className:"bg-white rounded-lg shadow-sm border border-gray-200 overflow-hidden",children:[v.jsx("div",{className:"px-3 py-2 border-b border-gray-200 bg-gray-50",children:v.jsxs("div",{className:"flex items-center gap-3",children:[v.jsx("div",{className:"w-10 h-10 bg-blue-100 rounded-full flex items-center justify-center",children:v.jsx(Yf,{className:"w-5 h-5 text-blue-600"})}),v.jsxs("div",{children:[v.jsx("h3",{className:"text-lg font-semibold text-gray-900",children:e.profile.name}),v.jsxs("p",{className:"text-sm text-gray-500",children:["ID: ",e.id]})]}),v.jsx("div",{className:"ml-auto",children:v.jsxs("div",{className:"flex items-center gap-2 text-sm text-gray-600",children:[v.jsx(hx,{className:"w-4 h-4"}),v.jsxs("span",{children:[o.length," booking",o.length!==1?"s":""]})]})})]})}),v.jsx("div",{className:"overflow-x-auto",children:v.jsxs("table",{className:"w-full",children:[v.jsx("thead",{className:"bg-gray-50 border-b border-gray-200",children:f.getHeaderGroups().map(m=>v.jsx("tr",{children:m.headers.map(p=>v.jsx("th",{className:"px-3 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:p.isPlaceholder?null:tf(p.column.columnDef.header,p.getContext())},p.id))},m.id))}),v.jsx("tbody",{className:"bg-white divide-y divide-gray-200",children:(h=f.getRowModel().rows)!=null&&h.length?f.getRowModel().rows.map((m,p)=>v.jsx("tr",{className:he("hover:bg-gray-50 transition-colors duration-150",m.getIsSelected()&&"bg-blue-50",p%2===0?"bg-white":"bg-gray-25"),"data-state":m.getIsSelected()&&"selected",children:m.getVisibleCells().map(b=>v.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-900",children:tf(b.column.columnDef.cell,b.getContext())},b.id))},m.id)):v.jsx("tr",{children:v.jsx("td",{colSpan:n.length,className:"px-6 py-12 text-center",children:v.jsxs("div",{className:"flex flex-col items-center",children:[v.jsx("div",{className:"w-12 h-12 bg-gray-100 rounded-full flex items-center justify-center mb-3",children:v.jsx(Yo,{className:"w-6 h-6 text-gray-400"})}),v.jsx("h4",{className:"text-sm font-medium text-gray-900 mb-1",children:"No appointments for this day"}),v.jsx("p",{className:"text-sm text-gray-500",children:"There are no scheduled appointments for the selected date."})]})})})})]})}),o.length>0&&v.jsx("div",{className:"px-6 py-3 bg-gray-50 border-t border-gray-200",children:v.jsxs("div",{className:"flex items-center justify-between text-sm text-gray-700",children:[v.jsxs("span",{children:["Showing ",f.getRowModel().rows.length," of ",o.length," bookings"]}),f.getPageCount()>1&&v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx("button",{onClick:()=>f.previousPage(),disabled:!f.getCanPreviousPage(),className:"px-3 py-1 text-sm font-medium text-gray-500 bg-white border border-gray-300 rounded-md hover:bg-gray-50 disabled:opacity-50 disabled:cursor-not-allowed",children:"Previous"}),v.jsxs("span",{className:"text-sm text-gray-700",children:["Page ",f.getState().pagination.pageIndex+1," of ",f.getPageCount()]}),v.jsx("button",{onClick:()=>f.nextPage(),disabled:!f.getCanNextPage(),className:"px-3 py-1 text-sm font-medium text-gray-500 bg-white border border-gray-300 rounded-md hover:bg-gray-50 disabled:opacity-50 disabled:cursor-not-allowed"})]})]})})]})},nf={distance:5},d_=({tableAccessors:e})=>{const t=Ay(mc(Ff,{activationConstraint:nf}),mc(Vf,{activationConstraint:nf})),{bookingBulkData:n,bookingViewType:r}=$e(D=>D),{users:o}=Hr(D=>D),{setBookingBulkData:s,optimisticCardUpdate:i}=$e(),{bookings:a,onCardDropCallback:l}=wn(),{emptySlotNodes:c,resetSelectedNode:u,resetNodes:d}=Jt(),{booking:f,slotData:h,updateBooking:m,updateSlotData:p,startAt:b}=bf(D=>D),y=T.useRef(null),g=T.useCallback(D=>{const{active:P}=D;P.data.current&&(m(P.data.current.booking),p(P.data.current.slotData)),P.id},[m,p]),w=T.useCallback((D,P)=>{const E=pn({key:P.toDateString(),time:Pa}),A=c.get(E);if(!A){console.warn("SlotNode not found:",E);return}A.removeFromAdditionalBooking(D)},[c]),C=D=>{const P=Y.calculateDaysDifference(D.finishAt,D.startAt),E=Y.buildFutureDateList(D,P);for(const A of E)w(D,A)},x=async(D,P,E)=>{try{const{startAt:A,finishAt:F}=Y.bookingTimeRange(D,P);i(D,A,F,E),await l(D,P,E,{id:D.id,startAt:A,finishAt:F}),C(D)}catch(A){console.warn(A)}},M=D=>{const{over:P,active:E}=D;if(P&&E){const A=P.data.current,F=E.data.current;if(F&&A&&A.accepts.includes(F.type)&&F.booking.id&&P.id){const W=a.find(j=>j.id===F.booking.id);if(!W)return;const[L]=String(P.id).split(";");x(W,L,F.slotData),p(null),m(null)}}},S=T.useMemo(()=>{if(f&&h)return v.jsx(Ng,{ref:y,style:{borderRadius:"0.25rem"},booking:f,slotData:h})},[f,h]);return T.useEffect(()=>{if(f&&b&&(y!=null&&y.current)){const D=Y.bookingTimeRange(f,b);y.current.updateBooking(D)}},[f,b]),T.useEffect(()=>{s({user:_T,booking:a})},[a,s]),T.useEffect(()=>{(r===ae.DAY||r===ae.WEEK)&&(u(),d())},[r,d,u]),v.jsxs("div",{className:"calendar-wrapper",children:[v.jsx(VR,{children:(r===ae.DAY||r===ae.WEEK)&&v.jsxs(ja,{onDragEnd:M,onDragStart:g,sensors:t,children:[v.jsx(OT,{}),v.jsx(yO,{children:S})]})}),r==="table"&&v.jsx("div",{style:{display:"flex",flexDirection:"column",rowGap:"1rem",margin:"1rem"},children:o.map(D=>v.jsx(u_,{user:D,bookings:n.booking,tableAccessors:e}))})]})},f_=({handleWeekChange:e})=>v.jsxs("div",{className:"header_day_actions",children:[v.jsx(Rt,{className:"header_day_actions_button",variant:"ghost",size:"lg",onClick:()=>e("previous"),children:v.jsx(nx,{className:"header_day_actions_button_icon"})}),v.jsx(Rt,{className:"header_day_actions_button",variant:"ghost",size:"lg",onClick:()=>e("next"),children:v.jsx(ox,{className:"header_day_actions_button_icon"})})]}),h_=({onClick:e})=>v.jsx(Qa,{content:"Today",children:v.jsx(Rt,{variant:"ghost",onClick:e,children:v.jsx(bx,{style:{paddingTop:"0.8px"}})})}),p_=({code:e})=>v.jsx("p",{className:"text-sm text-muted-foreground",children:v.jsxs("kbd",{className:"pointer-events-none inline-flex h-5 select-none items-center gap-1 rounded border bg-muted px-1.5 font-mono text-[10px] font-medium text-muted-foreground opacity-100",children:[v.jsx("span",{className:"text-xs",children:"⌘"}),e]})}),g_={[ae.DAY]:v.jsx(gx,{width:"90%"}),[ae.WEEK]:v.jsx(dx,{width:"90%"}),[ae.TABLE]:v.jsx(Zw,{width:"90%"}),[ae.MONTH]:v.jsx(vx,{width:"90%"})},rf=()=>{const{bookingViewType:e}=$e(),{onViewTypeChange:t}=df(),{viewModes:n}=wn(),r=T.useCallback(a=>a===e?"custom":"outline",[e]),o=T.useCallback(a=>{a!==e&&t(a)},[t]),s=T.useMemo(()=>n.map(a=>({variant:r(a),icon:g_[a],events:l=>o(l),label:a})),[n,o,r]),i=T.useMemo(()=>{const a=s.find(l=>l.label===e);if(a)return a.icon},[e,s]);return v.jsxs(hl,{children:[v.jsx(pl,{children:v.jsx(Qa,{content:"Calendar Modes",children:v.jsx(Rt,{variant:"ghost",asChild:!0,children:i||v.jsx(qw,{className:"w-full h-full"})})})}),v.jsx(gl,{children:s.map(a=>v.jsxs(OR,{checked:a.label===e,onCheckedChange:()=>a.events(a.label),className:"flex flex-row justify-between gap-6",children:[v.jsxs("div",{className:"flex flex-row gap-4",children:[a.icon,v.jsx("div",{children:ey.capitalize(a.label)})]}),v.jsx(p_,{code:"o"})]},a.label))})]})},m_=566,v_=()=>{const{todayWeek:e,bookingViewType:t,setTodayDay:n,nextWeek:r,previousWeek:o,setDays:s}=$e(),{resetSelectedNode:i,resetNodes:a}=Jt(x=>x),{onTodayClick:l,onDayChange:c}=wn(),{fullYear:u,monthMessage:d}=hf(x=>x),[f,h]=T.useState(!1),m=()=>{const x=new Date;switch(l(x),t){case ae.TABLE:case ae.DAY:{n(x);break}default:{e();break}}},p=()=>s(1),b=()=>s(-1),y=x=>x==="next"?r():o(),g=x=>x==="next"?p():b(),w=x=>{switch(a(),i(),t){case ae.TABLE:case ae.DAY:{const M=g(x);c(M,x);break}case ae.WEEK:{const M=y(x),{firstDayOfWeek:S,lastDayOfWeek:D}=Y.firstAndLastWeekDays(M);c([S,D],x);break}}};T.useEffect(()=>{e()},[e]),T.useEffect(()=>{const x=()=>{if(typeof window>"u")return!1;window.innerWidth<=m_?h(!0):h(!1)};return x(),window.addEventListener("resize",x),()=>window.removeEventListener("resize",x)},[]);const C=v.jsxs("div",{className:"header_actions",children:[v.jsx(f_,{handleWeekChange:w}),v.jsx(h_,{onClick:m})]});return v.jsx(v.Fragment,{children:f?v.jsxs("div",{className:"headerCalendar_mobile",children:[v.jsx("div",{className:"headerCalendar_mobile_month",children:v.jsxs("span",{className:"headerCalendar_mobile_month_span",children:[d," ",u]})}),v.jsxs("div",{className:"headerCalendar_mobile_actions",children:[C,v.jsx(rf,{})]})]}):v.jsxs("div",{className:"headerCalendar",children:[v.jsx("div",{className:"headerCalendar_actions",children:C}),v.jsx("div",{className:"headerCalendar_month",children:v.jsxs("span",{className:"headerCalendar_month_span",children:[d," ",u]})}),v.jsx(rf,{})]})})},y_=({viewModes:e,createBookingModal:t,onChangeViewType:n,onCardDropCallback:r,onCardResizeEnd:o,onDayChange:s,onHeaderDayClick:i,onTodayClick:a,onSlotClick:l,onModalClose:c,bookings:u,isTimeInfoVisible:d,systemColor:f,tableAccessors:h,users:m=[],operationalHours:p,ref:b})=>{const[y,g]=T.useState(!1),w=T.useRef(null),C=T.useRef(null),{setBookingViewType:x,setWeekAndViewType:M,setTodayDayAndViewType:S,bookingViewType:D,setTodayDay:P,todayWeek:E,configure:A}=$e(),{setSelectedNode:F}=Jt(_=>_),W=_=>{var N;(N=w==null?void 0:w.current)==null||N.updateFinishAt(_)},L=_=>{P(new Date(_))},j=_=>{E(new Date(_))};return T.useEffect(()=>{A({startTime:p.start,endTime:p.finish})},[p]),T.useEffect(()=>{n(D)},[D]),T.useImperativeHandle(b,()=>({updateViewType:_=>x(_),updateWeekAndViewType:_=>M(_),updateTodayDayAndViewType:_=>S(_),updateSelectedNode:_=>{setTimeout(()=>{F(_)},10)},updateFinishAt:_=>W(_),changeLoading:_=>g(_),goToDay:_=>L(_),goToWeek:_=>j(_),toggleUserVisibility:(_,N)=>{var O;(O=C.current)==null||O.updateDisabledUser(_,N)}})),v.jsx(dy,{isTimeInfoVisible:d,systemColor:f,children:v.jsx(ay,{...wf,children:v.jsx(ly,{createBookingModal:t,viewModes:e,onHeaderDayClick:i,onTodayClick:a,onCardDropCallback:r,onCardResizeEnd:o,onDayChange:s,onSlotClick:l,onModalClose:c,bookings:u,children:v.jsx(sy,{ref:w,...Ni,children:v.jsx(hy,{...xf,children:v.jsxs(vy,{ref:C,users:m,children:[v.jsx(v_,{}),v.jsx(d_,{tableAccessors:h}),v.jsx(jv,{color:"#000000aa",loading:y,cssOverride:{position:"absolute",top:"50%",left:"50%",transform:"translate('-50%', '-50%')",zIndex:100},size:15,"aria-label":"Loading Spinner","data-testid":"GridLoader"})]})})})})})})},w_=e=>{const t=T.useRef(null),n=()=>{if(!(t!=null&&t.current))throw new Ov};return{getCalendar:()=>v.jsx(y_,{ref:t,...e}),updateViewType:h=>{var m;n(),(m=t.current)==null||m.updateViewType(h)},updateWeekAndViewType:h=>{var m;return n(),(m=t.current)==null?void 0:m.updateWeekAndViewType(h)},updateTodayDayAndViewType:h=>{var m;return n(),(m=t.current)==null?void 0:m.updateTodayDayAndViewType(h)},updateSelectedNode:h=>{var m;n(),(m=t.current)==null||m.updateSelectedNode(h)},updateFinishAt:h=>{var m;n(),(m=t.current)==null||m.updateFinishAt(h)},changeLoading:h=>{var m;n(),(m=t.current)==null||m.changeLoading(h)},goToDay:h=>{var m;n(),(m=t.current)==null||m.goToDay(h)},goToWeek:h=>{var m;n(),(m=t.current)==null||m.goToWeek(h)},toggleUserVisibility:(h,m)=>{var p;n(),(p=t.current)==null||p.toggleUserVisibility(h,m)}}};exports.useCalendarInstance=w_;
|
|
190
|
+
*/function Sd(e,t){return e?KP(e)?T.createElement(e,t):e:null}function KP(e){return qP(e)||typeof e=="function"||XP(e)}function qP(e){return typeof e=="function"&&(()=>{const t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}function XP(e){return typeof e=="object"&&typeof e.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}function ZP(e){const t={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[n]=T.useState(()=>({current:UP(t)})),[r,o]=T.useState(()=>n.current.initialState);return n.current.setOptions(s=>({...s,...e,state:{...r,...e.state},onStateChange:i=>{o(i),e.onStateChange==null||e.onStateChange(i)}})),n.current}const JP=({user:e,bookings:t,tableAccessors:n})=>{var f;const{daysOfWeek:r}=pe(),[o,s]=R.useState([]),[i,a]=R.useState([]),[l,c]=R.useState([]),[u,d]=R.useState({pageIndex:0,pageSize:5}),p=ZP({data:o,columns:n,enableSorting:!0,onSortingChange:a,onColumnFiltersChange:c,onPaginationChange:d,getCoreRowModel:GP(),getSortedRowModel:YP(),state:{sorting:i,columnFilters:l,pagination:u}});return R.useEffect(()=>{s(t.filter(h=>{const b=r[0].getDay()===h.startAt.getDay(),w=r[0].getMonth()===h.startAt.getMonth(),v=e.id===h.userId;return b&&w&&v}))},[r,t]),t.length,y.jsxs("div",{className:"bg-white rounded-lg shadow-sm border border-gray-200 overflow-hidden",children:[y.jsx("div",{className:"px-3 py-2 border-b border-gray-200 bg-gray-50",children:y.jsxs("div",{className:"flex items-center gap-3",children:[y.jsx("div",{className:"w-10 h-10 bg-blue-100 rounded-full flex items-center justify-center",children:y.jsx(Zf,{className:"w-5 h-5 text-blue-600"})}),y.jsx("div",{children:y.jsxs("h3",{className:"text-lg font-semibold text-gray-900",children:[e.profile.name,y.jsxs("p",{className:"text-sm text-gray-500",children:["ID: ",e.id]})]})}),y.jsx("div",{className:"ml-auto",children:y.jsxs("div",{className:"flex items-center gap-2 text-sm text-gray-600",children:[y.jsx(yx,{className:"w-4 h-4"}),y.jsxs("span",{children:[o.length," agendamento",o.length!==1?"s":""]})]})})]})}),y.jsx("div",{className:"overflow-x-auto",children:y.jsxs("table",{className:"w-full",children:[y.jsx("thead",{className:"bg-gray-50 border-b border-gray-200",children:p.getHeaderGroups().map(g=>y.jsx("tr",{children:g.headers.map(h=>y.jsx("th",{className:"px-3 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:h.isPlaceholder?null:Sd(h.column.columnDef.header,h.getContext())},h.id))},g.id))}),y.jsx("tbody",{className:"bg-white divide-y divide-gray-200",children:(f=p.getRowModel().rows)!=null&&f.length?p.getRowModel().rows.map((g,h)=>y.jsx("tr",{className:he("hover:bg-gray-50 transition-colors duration-150",g.getIsSelected()&&"bg-blue-50",h%2===0?"bg-white":"bg-gray-25"),"data-state":g.getIsSelected()&&"selected",children:g.getVisibleCells().map(b=>y.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-900",children:Sd(b.column.columnDef.cell,b.getContext())},b.id))},g.id)):y.jsx("tr",{children:y.jsx("td",{colSpan:n.length,className:"px-6 py-2 text-center",children:y.jsxs("div",{className:"flex flex-col items-center",children:[y.jsx("div",{className:"w-12 h-12 bg-gray-100 rounded-full flex items-center justify-center mb-3",children:y.jsx(Ha,{className:"w-6 h-6 text-gray-400"})}),y.jsx("h4",{className:"text-sm font-medium text-gray-900 mb-1",children:"No appointments for this day"}),y.jsx("p",{className:"text-sm text-gray-500",children:"There are no scheduled appointments for the selected date."})]})})})})]})}),o.length>0&&y.jsx("div",{className:"px-6 py-3 bg-gray-50 border-t border-gray-200",children:y.jsxs("div",{className:"flex items-center justify-between text-sm text-gray-700",children:[y.jsxs("span",{children:["Mostrando ",p.getRowModel().rows.length," de"," ",o.length," agendamento",o.length!==1?"s":""]}),p.getPageCount()>1&&y.jsxs("div",{className:"flex items-center gap-2",children:[y.jsx("button",{type:"button",onClick:()=>p.previousPage(),disabled:!p.getCanPreviousPage(),className:"px-3 py-1 text-sm font-medium text-gray-500 bg-white border border-gray-300 rounded-md hover:bg-gray-50 disabled:opacity-50 disabled:cursor-not-allowed",children:"Previous"}),y.jsxs("span",{className:"text-sm text-gray-700",children:["Page"," ",p.getState().pagination.pageIndex+1," ","of ",p.getPageCount()]}),y.jsx("button",{type:"button",onClick:()=>p.nextPage(),disabled:!p.getCanNextPage(),className:"px-3 py-1 text-sm font-medium text-gray-500 bg-white border border-gray-300 rounded-md hover:bg-gray-50 disabled:opacity-50 disabled:cursor-not-allowed"})]})]})})]})},QP=({hour:e})=>{const t="Set lunch interval",n="Remove lunch interval",r="Hour options",{bookingViewType:o}=pe(ms(a=>({bookingViewType:a.bookingViewType}))),s=R.useMemo(()=>({borderLeft:"none",backgroundColor:"white"}),[]),i=R.useMemo(()=>o===ie.DAY?{maxWidth:"5rem",padding:0,minWidth:"4rem"}:{},[o]);return y.jsx("td",{style:{...s,...i},className:"time-col",children:y.jsx("div",{className:"calendarCore_actions",children:y.jsxs(fl,{children:[y.jsx(pl,{children:y.jsx("span",{className:"border-solid hover:border-b-2 hover:border-b-purple-600 border-b-white cursor-pointer",children:e})}),y.jsxs(hl,{children:[y.jsx(pR,{children:r}),y.jsx(hR,{}),y.jsx(su,{children:t}),y.jsx(su,{children:n})]})]})})},`${e}-hour`)};var gr={exports:{}},mr={},vr={exports:{}},Ai={},Eo={exports:{}},Po={exports:{}},ue={};/** @license React v16.13.1
|
|
191
|
+
* react-is.production.min.js
|
|
192
|
+
*
|
|
193
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
194
|
+
*
|
|
195
|
+
* This source code is licensed under the MIT license found in the
|
|
196
|
+
* LICENSE file in the root directory of this source tree.
|
|
197
|
+
*/var Cd;function eA(){if(Cd)return ue;Cd=1;var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,o=e?Symbol.for("react.strict_mode"):60108,s=e?Symbol.for("react.profiler"):60114,i=e?Symbol.for("react.provider"):60109,a=e?Symbol.for("react.context"):60110,l=e?Symbol.for("react.async_mode"):60111,c=e?Symbol.for("react.concurrent_mode"):60111,u=e?Symbol.for("react.forward_ref"):60112,d=e?Symbol.for("react.suspense"):60113,p=e?Symbol.for("react.suspense_list"):60120,f=e?Symbol.for("react.memo"):60115,g=e?Symbol.for("react.lazy"):60116,h=e?Symbol.for("react.block"):60121,b=e?Symbol.for("react.fundamental"):60117,w=e?Symbol.for("react.responder"):60118,v=e?Symbol.for("react.scope"):60119;function m(x){if(typeof x=="object"&&x!==null){var D=x.$$typeof;switch(D){case t:switch(x=x.type,x){case l:case c:case r:case s:case o:case d:return x;default:switch(x=x&&x.$$typeof,x){case a:case u:case g:case f:case i:return x;default:return D}}case n:return D}}}function C(x){return m(x)===c}return ue.AsyncMode=l,ue.ConcurrentMode=c,ue.ContextConsumer=a,ue.ContextProvider=i,ue.Element=t,ue.ForwardRef=u,ue.Fragment=r,ue.Lazy=g,ue.Memo=f,ue.Portal=n,ue.Profiler=s,ue.StrictMode=o,ue.Suspense=d,ue.isAsyncMode=function(x){return C(x)||m(x)===l},ue.isConcurrentMode=C,ue.isContextConsumer=function(x){return m(x)===a},ue.isContextProvider=function(x){return m(x)===i},ue.isElement=function(x){return typeof x=="object"&&x!==null&&x.$$typeof===t},ue.isForwardRef=function(x){return m(x)===u},ue.isFragment=function(x){return m(x)===r},ue.isLazy=function(x){return m(x)===g},ue.isMemo=function(x){return m(x)===f},ue.isPortal=function(x){return m(x)===n},ue.isProfiler=function(x){return m(x)===s},ue.isStrictMode=function(x){return m(x)===o},ue.isSuspense=function(x){return m(x)===d},ue.isValidElementType=function(x){return typeof x=="string"||typeof x=="function"||x===r||x===c||x===s||x===o||x===d||x===p||typeof x=="object"&&x!==null&&(x.$$typeof===g||x.$$typeof===f||x.$$typeof===i||x.$$typeof===a||x.$$typeof===u||x.$$typeof===b||x.$$typeof===w||x.$$typeof===v||x.$$typeof===h)},ue.typeOf=m,ue}var de={};/** @license React v16.13.1
|
|
198
|
+
* react-is.development.js
|
|
199
|
+
*
|
|
200
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
201
|
+
*
|
|
202
|
+
* This source code is licensed under the MIT license found in the
|
|
203
|
+
* LICENSE file in the root directory of this source tree.
|
|
204
|
+
*/var Rd;function tA(){return Rd||(Rd=1,process.env.NODE_ENV!=="production"&&function(){var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,o=e?Symbol.for("react.strict_mode"):60108,s=e?Symbol.for("react.profiler"):60114,i=e?Symbol.for("react.provider"):60109,a=e?Symbol.for("react.context"):60110,l=e?Symbol.for("react.async_mode"):60111,c=e?Symbol.for("react.concurrent_mode"):60111,u=e?Symbol.for("react.forward_ref"):60112,d=e?Symbol.for("react.suspense"):60113,p=e?Symbol.for("react.suspense_list"):60120,f=e?Symbol.for("react.memo"):60115,g=e?Symbol.for("react.lazy"):60116,h=e?Symbol.for("react.block"):60121,b=e?Symbol.for("react.fundamental"):60117,w=e?Symbol.for("react.responder"):60118,v=e?Symbol.for("react.scope"):60119;function m(z){return typeof z=="string"||typeof z=="function"||z===r||z===c||z===s||z===o||z===d||z===p||typeof z=="object"&&z!==null&&(z.$$typeof===g||z.$$typeof===f||z.$$typeof===i||z.$$typeof===a||z.$$typeof===u||z.$$typeof===b||z.$$typeof===w||z.$$typeof===v||z.$$typeof===h)}function C(z){if(typeof z=="object"&&z!==null){var le=z.$$typeof;switch(le){case t:var ve=z.type;switch(ve){case l:case c:case r:case s:case o:case d:return ve;default:var Oe=ve&&ve.$$typeof;switch(Oe){case a:case u:case g:case f:case i:return Oe;default:return le}}case n:return le}}}var x=l,D=c,S=a,M=i,P=t,O=u,_=r,V=g,G=f,F=n,L=s,k=o,j=d,E=!1;function N(z){return E||(E=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),A(z)||C(z)===l}function A(z){return C(z)===c}function I(z){return C(z)===a}function B(z){return C(z)===i}function H(z){return typeof z=="object"&&z!==null&&z.$$typeof===t}function W(z){return C(z)===u}function Z(z){return C(z)===r}function K(z){return C(z)===g}function $(z){return C(z)===f}function q(z){return C(z)===n}function X(z){return C(z)===s}function U(z){return C(z)===o}function te(z){return C(z)===d}de.AsyncMode=x,de.ConcurrentMode=D,de.ContextConsumer=S,de.ContextProvider=M,de.Element=P,de.ForwardRef=O,de.Fragment=_,de.Lazy=V,de.Memo=G,de.Portal=F,de.Profiler=L,de.StrictMode=k,de.Suspense=j,de.isAsyncMode=N,de.isConcurrentMode=A,de.isContextConsumer=I,de.isContextProvider=B,de.isElement=H,de.isForwardRef=W,de.isFragment=Z,de.isLazy=K,de.isMemo=$,de.isPortal=q,de.isProfiler=X,de.isStrictMode=U,de.isSuspense=te,de.isValidElementType=m,de.typeOf=C}()),de}var Td;function wm(){return Td||(Td=1,process.env.NODE_ENV==="production"?Po.exports=eA():Po.exports=tA()),Po.exports}/*
|
|
205
|
+
object-assign
|
|
206
|
+
(c) Sindre Sorhus
|
|
207
|
+
@license MIT
|
|
208
|
+
*/var Oi,Dd;function nA(){if(Dd)return Oi;Dd=1;var e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;function r(s){if(s==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(s)}function o(){try{if(!Object.assign)return!1;var s=new String("abc");if(s[5]="de",Object.getOwnPropertyNames(s)[0]==="5")return!1;for(var i={},a=0;a<10;a++)i["_"+String.fromCharCode(a)]=a;var l=Object.getOwnPropertyNames(i).map(function(u){return i[u]});if(l.join("")!=="0123456789")return!1;var c={};return"abcdefghijklmnopqrst".split("").forEach(function(u){c[u]=u}),Object.keys(Object.assign({},c)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return Oi=o()?Object.assign:function(s,i){for(var a,l=r(s),c,u=1;u<arguments.length;u++){a=Object(arguments[u]);for(var d in a)t.call(a,d)&&(l[d]=a[d]);if(e){c=e(a);for(var p=0;p<c.length;p++)n.call(a,c[p])&&(l[c[p]]=a[c[p]])}}return l},Oi}var _i,Md;function Xl(){if(Md)return _i;Md=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return _i=e,_i}var ki,Ed;function xm(){return Ed||(Ed=1,ki=Function.call.bind(Object.prototype.hasOwnProperty)),ki}var Ii,Pd;function rA(){if(Pd)return Ii;Pd=1;var e=function(){};if(process.env.NODE_ENV!=="production"){var t=Xl(),n={},r=xm();e=function(s){var i="Warning: "+s;typeof console<"u"&&console.error(i);try{throw new Error(i)}catch{}}}function o(s,i,a,l,c){if(process.env.NODE_ENV!=="production"){for(var u in s)if(r(s,u)){var d;try{if(typeof s[u]!="function"){var p=Error((l||"React class")+": "+a+" type `"+u+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof s[u]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw p.name="Invariant Violation",p}d=s[u](i,u,l,a,null,t)}catch(g){d=g}if(d&&!(d instanceof Error)&&e((l||"React class")+": type specification of "+a+" `"+u+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof d+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),d instanceof Error&&!(d.message in n)){n[d.message]=!0;var f=c?c():"";e("Failed "+a+" type: "+d.message+(f??""))}}}}return o.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(n={})},Ii=o,Ii}var Ni,Ad;function oA(){if(Ad)return Ni;Ad=1;var e=wm(),t=nA(),n=Xl(),r=xm(),o=rA(),s=function(){};process.env.NODE_ENV!=="production"&&(s=function(a){var l="Warning: "+a;typeof console<"u"&&console.error(l);try{throw new Error(l)}catch{}});function i(){return null}return Ni=function(a,l){var c=typeof Symbol=="function"&&Symbol.iterator,u="@@iterator";function d(A){var I=A&&(c&&A[c]||A[u]);if(typeof I=="function")return I}var p="<<anonymous>>",f={array:w("array"),bigint:w("bigint"),bool:w("boolean"),func:w("function"),number:w("number"),object:w("object"),string:w("string"),symbol:w("symbol"),any:v(),arrayOf:m,element:C(),elementType:x(),instanceOf:D,node:O(),objectOf:M,oneOf:S,oneOfType:P,shape:V,exact:G};function g(A,I){return A===I?A!==0||1/A===1/I:A!==A&&I!==I}function h(A,I){this.message=A,this.data=I&&typeof I=="object"?I:{},this.stack=""}h.prototype=Error.prototype;function b(A){if(process.env.NODE_ENV!=="production")var I={},B=0;function H(Z,K,$,q,X,U,te){if(q=q||p,U=U||$,te!==n){if(l){var z=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw z.name="Invariant Violation",z}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var le=q+":"+$;!I[le]&&B<3&&(s("You are manually calling a React.PropTypes validation function for the `"+U+"` prop on `"+q+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),I[le]=!0,B++)}}return K[$]==null?Z?K[$]===null?new h("The "+X+" `"+U+"` is marked as required "+("in `"+q+"`, but its value is `null`.")):new h("The "+X+" `"+U+"` is marked as required in "+("`"+q+"`, but its value is `undefined`.")):null:A(K,$,q,X,U)}var W=H.bind(null,!1);return W.isRequired=H.bind(null,!0),W}function w(A){function I(B,H,W,Z,K,$){var q=B[H],X=k(q);if(X!==A){var U=j(q);return new h("Invalid "+Z+" `"+K+"` of type "+("`"+U+"` supplied to `"+W+"`, expected ")+("`"+A+"`."),{expectedType:A})}return null}return b(I)}function v(){return b(i)}function m(A){function I(B,H,W,Z,K){if(typeof A!="function")return new h("Property `"+K+"` of component `"+W+"` has invalid PropType notation inside arrayOf.");var $=B[H];if(!Array.isArray($)){var q=k($);return new h("Invalid "+Z+" `"+K+"` of type "+("`"+q+"` supplied to `"+W+"`, expected an array."))}for(var X=0;X<$.length;X++){var U=A($,X,W,Z,K+"["+X+"]",n);if(U instanceof Error)return U}return null}return b(I)}function C(){function A(I,B,H,W,Z){var K=I[B];if(!a(K)){var $=k(K);return new h("Invalid "+W+" `"+Z+"` of type "+("`"+$+"` supplied to `"+H+"`, expected a single ReactElement."))}return null}return b(A)}function x(){function A(I,B,H,W,Z){var K=I[B];if(!e.isValidElementType(K)){var $=k(K);return new h("Invalid "+W+" `"+Z+"` of type "+("`"+$+"` supplied to `"+H+"`, expected a single ReactElement type."))}return null}return b(A)}function D(A){function I(B,H,W,Z,K){if(!(B[H]instanceof A)){var $=A.name||p,q=N(B[H]);return new h("Invalid "+Z+" `"+K+"` of type "+("`"+q+"` supplied to `"+W+"`, expected ")+("instance of `"+$+"`."))}return null}return b(I)}function S(A){if(!Array.isArray(A))return process.env.NODE_ENV!=="production"&&(arguments.length>1?s("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):s("Invalid argument supplied to oneOf, expected an array.")),i;function I(B,H,W,Z,K){for(var $=B[H],q=0;q<A.length;q++)if(g($,A[q]))return null;var X=JSON.stringify(A,function(te,z){var le=j(z);return le==="symbol"?String(z):z});return new h("Invalid "+Z+" `"+K+"` of value `"+String($)+"` "+("supplied to `"+W+"`, expected one of "+X+"."))}return b(I)}function M(A){function I(B,H,W,Z,K){if(typeof A!="function")return new h("Property `"+K+"` of component `"+W+"` has invalid PropType notation inside objectOf.");var $=B[H],q=k($);if(q!=="object")return new h("Invalid "+Z+" `"+K+"` of type "+("`"+q+"` supplied to `"+W+"`, expected an object."));for(var X in $)if(r($,X)){var U=A($,X,W,Z,K+"."+X,n);if(U instanceof Error)return U}return null}return b(I)}function P(A){if(!Array.isArray(A))return process.env.NODE_ENV!=="production"&&s("Invalid argument supplied to oneOfType, expected an instance of array."),i;for(var I=0;I<A.length;I++){var B=A[I];if(typeof B!="function")return s("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+E(B)+" at index "+I+"."),i}function H(W,Z,K,$,q){for(var X=[],U=0;U<A.length;U++){var te=A[U],z=te(W,Z,K,$,q,n);if(z==null)return null;z.data&&r(z.data,"expectedType")&&X.push(z.data.expectedType)}var le=X.length>0?", expected one of type ["+X.join(", ")+"]":"";return new h("Invalid "+$+" `"+q+"` supplied to "+("`"+K+"`"+le+"."))}return b(H)}function O(){function A(I,B,H,W,Z){return F(I[B])?null:new h("Invalid "+W+" `"+Z+"` supplied to "+("`"+H+"`, expected a ReactNode."))}return b(A)}function _(A,I,B,H,W){return new h((A||"React class")+": "+I+" type `"+B+"."+H+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+W+"`.")}function V(A){function I(B,H,W,Z,K){var $=B[H],q=k($);if(q!=="object")return new h("Invalid "+Z+" `"+K+"` of type `"+q+"` "+("supplied to `"+W+"`, expected `object`."));for(var X in A){var U=A[X];if(typeof U!="function")return _(W,Z,K,X,j(U));var te=U($,X,W,Z,K+"."+X,n);if(te)return te}return null}return b(I)}function G(A){function I(B,H,W,Z,K){var $=B[H],q=k($);if(q!=="object")return new h("Invalid "+Z+" `"+K+"` of type `"+q+"` "+("supplied to `"+W+"`, expected `object`."));var X=t({},B[H],A);for(var U in X){var te=A[U];if(r(A,U)&&typeof te!="function")return _(W,Z,K,U,j(te));if(!te)return new h("Invalid "+Z+" `"+K+"` key `"+U+"` supplied to `"+W+"`.\nBad object: "+JSON.stringify(B[H],null," ")+`
|
|
209
|
+
Valid keys: `+JSON.stringify(Object.keys(A),null," "));var z=te($,U,W,Z,K+"."+U,n);if(z)return z}return null}return b(I)}function F(A){switch(typeof A){case"number":case"string":case"undefined":return!0;case"boolean":return!A;case"object":if(Array.isArray(A))return A.every(F);if(A===null||a(A))return!0;var I=d(A);if(I){var B=I.call(A),H;if(I!==A.entries){for(;!(H=B.next()).done;)if(!F(H.value))return!1}else for(;!(H=B.next()).done;){var W=H.value;if(W&&!F(W[1]))return!1}}else return!1;return!0;default:return!1}}function L(A,I){return A==="symbol"?!0:I?I["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&I instanceof Symbol:!1}function k(A){var I=typeof A;return Array.isArray(A)?"array":A instanceof RegExp?"object":L(I,A)?"symbol":I}function j(A){if(typeof A>"u"||A===null)return""+A;var I=k(A);if(I==="object"){if(A instanceof Date)return"date";if(A instanceof RegExp)return"regexp"}return I}function E(A){var I=j(A);switch(I){case"array":case"object":return"an "+I;case"boolean":case"date":case"regexp":return"a "+I;default:return I}}function N(A){return!A.constructor||!A.constructor.name?p:A.constructor.name}return f.checkPropTypes=o,f.resetWarningCache=o.resetWarningCache,f.PropTypes=f,f},Ni}var ji,Od;function sA(){if(Od)return ji;Od=1;var e=Xl();function t(){}function n(){}return n.resetWarningCache=t,ji=function(){function r(i,a,l,c,u,d){if(d!==e){var p=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw p.name="Invariant Violation",p}}r.isRequired=r;function o(){return r}var s={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:o,element:r,elementType:r,instanceOf:o,node:r,objectOf:o,oneOf:o,oneOfType:o,shape:o,exact:o,checkPropTypes:n,resetWarningCache:t};return s.PropTypes=s,s},ji}var _d;function Is(){if(_d)return Eo.exports;if(_d=1,process.env.NODE_ENV!=="production"){var e=wm(),t=!0;Eo.exports=oA()(e.isElement,t)}else Eo.exports=sA()();return Eo.exports}function bm(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=bm(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function kd(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=bm(e))&&(r&&(r+=" "),r+=t);return r}const iA=Object.freeze(Object.defineProperty({__proto__:null,clsx:kd,default:kd},Symbol.toStringTag,{value:"Module"})),aA=Qv(iA);var be={},zt={},Id;function Ns(){if(Id)return zt;Id=1,Object.defineProperty(zt,"__esModule",{value:!0}),zt.dontSetMe=o,zt.findInArray=e,zt.int=r,zt.isFunction=t,zt.isNum=n;function e(s,i){for(let a=0,l=s.length;a<l;a++)if(i.apply(i,[s[a],a,s]))return s[a]}function t(s){return typeof s=="function"||Object.prototype.toString.call(s)==="[object Function]"}function n(s){return typeof s=="number"&&!isNaN(s)}function r(s){return parseInt(s,10)}function o(s,i,a){if(s[i])return new Error("Invalid prop ".concat(i," passed to ").concat(a," - do not set this, set it on the child."))}return zt}var Ht={},Nd;function lA(){if(Nd)return Ht;Nd=1,Object.defineProperty(Ht,"__esModule",{value:!0}),Ht.browserPrefixToKey=n,Ht.browserPrefixToStyle=r,Ht.default=void 0,Ht.getPrefix=t;const e=["Moz","Webkit","O","ms"];function t(){var s;let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"transform";if(typeof window>"u")return"";const a=(s=window.document)===null||s===void 0||(s=s.documentElement)===null||s===void 0?void 0:s.style;if(!a||i in a)return"";for(let l=0;l<e.length;l++)if(n(i,e[l])in a)return e[l];return""}function n(s,i){return i?"".concat(i).concat(o(s)):s}function r(s,i){return i?"-".concat(i.toLowerCase(),"-").concat(s):s}function o(s){let i="",a=!0;for(let l=0;l<s.length;l++)a?(i+=s[l].toUpperCase(),a=!1):s[l]==="-"?a=!0:i+=s[l];return i}return Ht.default=t(),Ht}var jd;function Zl(){if(jd)return be;jd=1,Object.defineProperty(be,"__esModule",{value:!0}),be.addClassName=x,be.addEvent=a,be.addUserSelectStyles=m,be.createCSSTransform=g,be.createSVGTransform=h,be.getTouch=w,be.getTouchIdentifier=v,be.getTranslation=b,be.innerHeight=d,be.innerWidth=p,be.matchesSelector=s,be.matchesSelectorAndParentsTo=i,be.offsetXYFromParent=f,be.outerHeight=c,be.outerWidth=u,be.removeClassName=D,be.removeEvent=l,be.removeUserSelectStyles=C;var e=Ns(),t=r(lA());function n(S){if(typeof WeakMap!="function")return null;var M=new WeakMap,P=new WeakMap;return(n=function(O){return O?P:M})(S)}function r(S,M){if(S&&S.__esModule)return S;if(S===null||typeof S!="object"&&typeof S!="function")return{default:S};var P=n(M);if(P&&P.has(S))return P.get(S);var O={},_=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var V in S)if(V!=="default"&&Object.prototype.hasOwnProperty.call(S,V)){var G=_?Object.getOwnPropertyDescriptor(S,V):null;G&&(G.get||G.set)?Object.defineProperty(O,V,G):O[V]=S[V]}return O.default=S,P&&P.set(S,O),O}let o="";function s(S,M){return o||(o=(0,e.findInArray)(["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"],function(P){return(0,e.isFunction)(S[P])})),(0,e.isFunction)(S[o])?S[o](M):!1}function i(S,M,P){let O=S;do{if(s(O,M))return!0;if(O===P)return!1;O=O.parentNode}while(O);return!1}function a(S,M,P,O){if(!S)return;const _={capture:!0,...O};S.addEventListener?S.addEventListener(M,P,_):S.attachEvent?S.attachEvent("on"+M,P):S["on"+M]=P}function l(S,M,P,O){if(!S)return;const _={capture:!0,...O};S.removeEventListener?S.removeEventListener(M,P,_):S.detachEvent?S.detachEvent("on"+M,P):S["on"+M]=null}function c(S){let M=S.clientHeight;const P=S.ownerDocument.defaultView.getComputedStyle(S);return M+=(0,e.int)(P.borderTopWidth),M+=(0,e.int)(P.borderBottomWidth),M}function u(S){let M=S.clientWidth;const P=S.ownerDocument.defaultView.getComputedStyle(S);return M+=(0,e.int)(P.borderLeftWidth),M+=(0,e.int)(P.borderRightWidth),M}function d(S){let M=S.clientHeight;const P=S.ownerDocument.defaultView.getComputedStyle(S);return M-=(0,e.int)(P.paddingTop),M-=(0,e.int)(P.paddingBottom),M}function p(S){let M=S.clientWidth;const P=S.ownerDocument.defaultView.getComputedStyle(S);return M-=(0,e.int)(P.paddingLeft),M-=(0,e.int)(P.paddingRight),M}function f(S,M,P){const _=M===M.ownerDocument.body?{left:0,top:0}:M.getBoundingClientRect(),V=(S.clientX+M.scrollLeft-_.left)/P,G=(S.clientY+M.scrollTop-_.top)/P;return{x:V,y:G}}function g(S,M){const P=b(S,M,"px");return{[(0,t.browserPrefixToKey)("transform",t.default)]:P}}function h(S,M){return b(S,M,"")}function b(S,M,P){let{x:O,y:_}=S,V="translate(".concat(O).concat(P,",").concat(_).concat(P,")");if(M){const G="".concat(typeof M.x=="string"?M.x:M.x+P),F="".concat(typeof M.y=="string"?M.y:M.y+P);V="translate(".concat(G,", ").concat(F,")")+V}return V}function w(S,M){return S.targetTouches&&(0,e.findInArray)(S.targetTouches,P=>M===P.identifier)||S.changedTouches&&(0,e.findInArray)(S.changedTouches,P=>M===P.identifier)}function v(S){if(S.targetTouches&&S.targetTouches[0])return S.targetTouches[0].identifier;if(S.changedTouches&&S.changedTouches[0])return S.changedTouches[0].identifier}function m(S){if(!S)return;let M=S.getElementById("react-draggable-style-el");M||(M=S.createElement("style"),M.type="text/css",M.id="react-draggable-style-el",M.innerHTML=`.react-draggable-transparent-selection *::-moz-selection {all: inherit;}
|
|
210
|
+
`,M.innerHTML+=`.react-draggable-transparent-selection *::selection {all: inherit;}
|
|
211
|
+
`,S.getElementsByTagName("head")[0].appendChild(M)),S.body&&x(S.body,"react-draggable-transparent-selection")}function C(S){if(S)try{if(S.body&&D(S.body,"react-draggable-transparent-selection"),S.selection)S.selection.empty();else{const M=(S.defaultView||window).getSelection();M&&M.type!=="Caret"&&M.removeAllRanges()}}catch{}}function x(S,M){S.classList?S.classList.add(M):S.className.match(new RegExp("(?:^|\\s)".concat(M,"(?!\\S)")))||(S.className+=" ".concat(M))}function D(S,M){S.classList?S.classList.remove(M):S.className=S.className.replace(new RegExp("(?:^|\\s)".concat(M,"(?!\\S)"),"g"),"")}return be}var mt={},Fd;function Sm(){if(Fd)return mt;Fd=1,Object.defineProperty(mt,"__esModule",{value:!0}),mt.canDragX=o,mt.canDragY=s,mt.createCoreData=a,mt.createDraggableData=l,mt.getBoundPosition=n,mt.getControlPosition=i,mt.snapToGrid=r;var e=Ns(),t=Zl();function n(d,p,f){if(!d.props.bounds)return[p,f];let{bounds:g}=d.props;g=typeof g=="string"?g:c(g);const h=u(d);if(typeof g=="string"){const{ownerDocument:b}=h,w=b.defaultView;let v;if(g==="parent"?v=h.parentNode:v=b.querySelector(g),!(v instanceof w.HTMLElement))throw new Error('Bounds selector "'+g+'" could not find an element.');const m=v,C=w.getComputedStyle(h),x=w.getComputedStyle(m);g={left:-h.offsetLeft+(0,e.int)(x.paddingLeft)+(0,e.int)(C.marginLeft),top:-h.offsetTop+(0,e.int)(x.paddingTop)+(0,e.int)(C.marginTop),right:(0,t.innerWidth)(m)-(0,t.outerWidth)(h)-h.offsetLeft+(0,e.int)(x.paddingRight)-(0,e.int)(C.marginRight),bottom:(0,t.innerHeight)(m)-(0,t.outerHeight)(h)-h.offsetTop+(0,e.int)(x.paddingBottom)-(0,e.int)(C.marginBottom)}}return(0,e.isNum)(g.right)&&(p=Math.min(p,g.right)),(0,e.isNum)(g.bottom)&&(f=Math.min(f,g.bottom)),(0,e.isNum)(g.left)&&(p=Math.max(p,g.left)),(0,e.isNum)(g.top)&&(f=Math.max(f,g.top)),[p,f]}function r(d,p,f){const g=Math.round(p/d[0])*d[0],h=Math.round(f/d[1])*d[1];return[g,h]}function o(d){return d.props.axis==="both"||d.props.axis==="x"}function s(d){return d.props.axis==="both"||d.props.axis==="y"}function i(d,p,f){const g=typeof p=="number"?(0,t.getTouch)(d,p):null;if(typeof p=="number"&&!g)return null;const h=u(f),b=f.props.offsetParent||h.offsetParent||h.ownerDocument.body;return(0,t.offsetXYFromParent)(g||d,b,f.props.scale)}function a(d,p,f){const g=!(0,e.isNum)(d.lastX),h=u(d);return g?{node:h,deltaX:0,deltaY:0,lastX:p,lastY:f,x:p,y:f}:{node:h,deltaX:p-d.lastX,deltaY:f-d.lastY,lastX:d.lastX,lastY:d.lastY,x:p,y:f}}function l(d,p){const f=d.props.scale;return{node:p.node,x:d.state.x+p.deltaX/f,y:d.state.y+p.deltaY/f,deltaX:p.deltaX/f,deltaY:p.deltaY/f,lastX:d.state.x,lastY:d.state.y}}function c(d){return{left:d.left,top:d.top,right:d.right,bottom:d.bottom}}function u(d){const p=d.findDOMNode();if(!p)throw new Error("<DraggableCore>: Unmounted during event!");return p}return mt}var yr={},Ao={},Vd;function Cm(){if(Vd)return Ao;Vd=1,Object.defineProperty(Ao,"__esModule",{value:!0}),Ao.default=e;function e(){}return Ao}var Ld;function cA(){if(Ld)return yr;Ld=1,Object.defineProperty(yr,"__esModule",{value:!0}),yr.default=void 0;var e=c(R),t=a(Is()),n=a(Pt),r=Zl(),o=Sm(),s=Ns(),i=a(Cm());function a(b){return b&&b.__esModule?b:{default:b}}function l(b){if(typeof WeakMap!="function")return null;var w=new WeakMap,v=new WeakMap;return(l=function(m){return m?v:w})(b)}function c(b,w){if(b&&b.__esModule)return b;if(b===null||typeof b!="object"&&typeof b!="function")return{default:b};var v=l(w);if(v&&v.has(b))return v.get(b);var m={},C=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var x in b)if(x!=="default"&&Object.prototype.hasOwnProperty.call(b,x)){var D=C?Object.getOwnPropertyDescriptor(b,x):null;D&&(D.get||D.set)?Object.defineProperty(m,x,D):m[x]=b[x]}return m.default=b,v&&v.set(b,m),m}function u(b,w,v){return w=d(w),w in b?Object.defineProperty(b,w,{value:v,enumerable:!0,configurable:!0,writable:!0}):b[w]=v,b}function d(b){var w=p(b,"string");return typeof w=="symbol"?w:String(w)}function p(b,w){if(typeof b!="object"||b===null)return b;var v=b[Symbol.toPrimitive];if(v!==void 0){var m=v.call(b,w);if(typeof m!="object")return m;throw new TypeError("@@toPrimitive must return a primitive value.")}return(w==="string"?String:Number)(b)}const f={touch:{start:"touchstart",move:"touchmove",stop:"touchend"},mouse:{start:"mousedown",move:"mousemove",stop:"mouseup"}};let g=f.mouse,h=class extends e.Component{constructor(){super(...arguments),u(this,"dragging",!1),u(this,"lastX",NaN),u(this,"lastY",NaN),u(this,"touchIdentifier",null),u(this,"mounted",!1),u(this,"handleDragStart",w=>{if(this.props.onMouseDown(w),!this.props.allowAnyClick&&typeof w.button=="number"&&w.button!==0)return!1;const v=this.findDOMNode();if(!v||!v.ownerDocument||!v.ownerDocument.body)throw new Error("<DraggableCore> not mounted on DragStart!");const{ownerDocument:m}=v;if(this.props.disabled||!(w.target instanceof m.defaultView.Node)||this.props.handle&&!(0,r.matchesSelectorAndParentsTo)(w.target,this.props.handle,v)||this.props.cancel&&(0,r.matchesSelectorAndParentsTo)(w.target,this.props.cancel,v))return;w.type==="touchstart"&&w.preventDefault();const C=(0,r.getTouchIdentifier)(w);this.touchIdentifier=C;const x=(0,o.getControlPosition)(w,C,this);if(x==null)return;const{x:D,y:S}=x,M=(0,o.createCoreData)(this,D,S);(0,i.default)("DraggableCore: handleDragStart: %j",M),(0,i.default)("calling",this.props.onStart),!(this.props.onStart(w,M)===!1||this.mounted===!1)&&(this.props.enableUserSelectHack&&(0,r.addUserSelectStyles)(m),this.dragging=!0,this.lastX=D,this.lastY=S,(0,r.addEvent)(m,g.move,this.handleDrag),(0,r.addEvent)(m,g.stop,this.handleDragStop))}),u(this,"handleDrag",w=>{const v=(0,o.getControlPosition)(w,this.touchIdentifier,this);if(v==null)return;let{x:m,y:C}=v;if(Array.isArray(this.props.grid)){let S=m-this.lastX,M=C-this.lastY;if([S,M]=(0,o.snapToGrid)(this.props.grid,S,M),!S&&!M)return;m=this.lastX+S,C=this.lastY+M}const x=(0,o.createCoreData)(this,m,C);if((0,i.default)("DraggableCore: handleDrag: %j",x),this.props.onDrag(w,x)===!1||this.mounted===!1){try{this.handleDragStop(new MouseEvent("mouseup"))}catch{const M=document.createEvent("MouseEvents");M.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(M)}return}this.lastX=m,this.lastY=C}),u(this,"handleDragStop",w=>{if(!this.dragging)return;const v=(0,o.getControlPosition)(w,this.touchIdentifier,this);if(v==null)return;let{x:m,y:C}=v;if(Array.isArray(this.props.grid)){let M=m-this.lastX||0,P=C-this.lastY||0;[M,P]=(0,o.snapToGrid)(this.props.grid,M,P),m=this.lastX+M,C=this.lastY+P}const x=(0,o.createCoreData)(this,m,C);if(this.props.onStop(w,x)===!1||this.mounted===!1)return!1;const S=this.findDOMNode();S&&this.props.enableUserSelectHack&&(0,r.removeUserSelectStyles)(S.ownerDocument),(0,i.default)("DraggableCore: handleDragStop: %j",x),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,S&&((0,i.default)("DraggableCore: Removing handlers"),(0,r.removeEvent)(S.ownerDocument,g.move,this.handleDrag),(0,r.removeEvent)(S.ownerDocument,g.stop,this.handleDragStop))}),u(this,"onMouseDown",w=>(g=f.mouse,this.handleDragStart(w))),u(this,"onMouseUp",w=>(g=f.mouse,this.handleDragStop(w))),u(this,"onTouchStart",w=>(g=f.touch,this.handleDragStart(w))),u(this,"onTouchEnd",w=>(g=f.touch,this.handleDragStop(w)))}componentDidMount(){this.mounted=!0;const w=this.findDOMNode();w&&(0,r.addEvent)(w,f.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;const w=this.findDOMNode();if(w){const{ownerDocument:v}=w;(0,r.removeEvent)(v,f.mouse.move,this.handleDrag),(0,r.removeEvent)(v,f.touch.move,this.handleDrag),(0,r.removeEvent)(v,f.mouse.stop,this.handleDragStop),(0,r.removeEvent)(v,f.touch.stop,this.handleDragStop),(0,r.removeEvent)(w,f.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&(0,r.removeUserSelectStyles)(v)}}findDOMNode(){var w,v;return(w=this.props)!==null&&w!==void 0&&w.nodeRef?(v=this.props)===null||v===void 0||(v=v.nodeRef)===null||v===void 0?void 0:v.current:n.default.findDOMNode(this)}render(){return e.cloneElement(e.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};return yr.default=h,u(h,"displayName","DraggableCore"),u(h,"propTypes",{allowAnyClick:t.default.bool,children:t.default.node.isRequired,disabled:t.default.bool,enableUserSelectHack:t.default.bool,offsetParent:function(b,w){if(b[w]&&b[w].nodeType!==1)throw new Error("Draggable's offsetParent must be a DOM Node.")},grid:t.default.arrayOf(t.default.number),handle:t.default.string,cancel:t.default.string,nodeRef:t.default.object,onStart:t.default.func,onDrag:t.default.func,onStop:t.default.func,onMouseDown:t.default.func,scale:t.default.number,className:s.dontSetMe,style:s.dontSetMe,transform:s.dontSetMe}),u(h,"defaultProps",{allowAnyClick:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1}),yr}var $d;function uA(){return $d||($d=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"DraggableCore",{enumerable:!0,get:function(){return l.default}}),e.default=void 0;var t=p(R),n=u(Is()),r=u(Pt),o=u(aA),s=Zl(),i=Sm(),a=Ns(),l=u(cA()),c=u(Cm());function u(v){return v&&v.__esModule?v:{default:v}}function d(v){if(typeof WeakMap!="function")return null;var m=new WeakMap,C=new WeakMap;return(d=function(x){return x?C:m})(v)}function p(v,m){if(v&&v.__esModule)return v;if(v===null||typeof v!="object"&&typeof v!="function")return{default:v};var C=d(m);if(C&&C.has(v))return C.get(v);var x={},D=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var S in v)if(S!=="default"&&Object.prototype.hasOwnProperty.call(v,S)){var M=D?Object.getOwnPropertyDescriptor(v,S):null;M&&(M.get||M.set)?Object.defineProperty(x,S,M):x[S]=v[S]}return x.default=v,C&&C.set(v,x),x}function f(){return f=Object.assign?Object.assign.bind():function(v){for(var m=1;m<arguments.length;m++){var C=arguments[m];for(var x in C)Object.prototype.hasOwnProperty.call(C,x)&&(v[x]=C[x])}return v},f.apply(this,arguments)}function g(v,m,C){return m=h(m),m in v?Object.defineProperty(v,m,{value:C,enumerable:!0,configurable:!0,writable:!0}):v[m]=C,v}function h(v){var m=b(v,"string");return typeof m=="symbol"?m:String(m)}function b(v,m){if(typeof v!="object"||v===null)return v;var C=v[Symbol.toPrimitive];if(C!==void 0){var x=C.call(v,m);if(typeof x!="object")return x;throw new TypeError("@@toPrimitive must return a primitive value.")}return(m==="string"?String:Number)(v)}class w extends t.Component{static getDerivedStateFromProps(m,C){let{position:x}=m,{prevPropsPosition:D}=C;return x&&(!D||x.x!==D.x||x.y!==D.y)?((0,c.default)("Draggable: getDerivedStateFromProps %j",{position:x,prevPropsPosition:D}),{x:x.x,y:x.y,prevPropsPosition:{...x}}):null}constructor(m){super(m),g(this,"onDragStart",(C,x)=>{if((0,c.default)("Draggable: onDragStart: %j",x),this.props.onStart(C,(0,i.createDraggableData)(this,x))===!1)return!1;this.setState({dragging:!0,dragged:!0})}),g(this,"onDrag",(C,x)=>{if(!this.state.dragging)return!1;(0,c.default)("Draggable: onDrag: %j",x);const D=(0,i.createDraggableData)(this,x),S={x:D.x,y:D.y,slackX:0,slackY:0};if(this.props.bounds){const{x:P,y:O}=S;S.x+=this.state.slackX,S.y+=this.state.slackY;const[_,V]=(0,i.getBoundPosition)(this,S.x,S.y);S.x=_,S.y=V,S.slackX=this.state.slackX+(P-S.x),S.slackY=this.state.slackY+(O-S.y),D.x=S.x,D.y=S.y,D.deltaX=S.x-this.state.x,D.deltaY=S.y-this.state.y}if(this.props.onDrag(C,D)===!1)return!1;this.setState(S)}),g(this,"onDragStop",(C,x)=>{if(!this.state.dragging||this.props.onStop(C,(0,i.createDraggableData)(this,x))===!1)return!1;(0,c.default)("Draggable: onDragStop: %j",x);const S={dragging:!1,slackX:0,slackY:0};if(!!this.props.position){const{x:P,y:O}=this.props.position;S.x=P,S.y=O}this.setState(S)}),this.state={dragging:!1,dragged:!1,x:m.position?m.position.x:m.defaultPosition.x,y:m.position?m.position.y:m.defaultPosition.y,prevPropsPosition:{...m.position},slackX:0,slackY:0,isElementSVG:!1},m.position&&!(m.onDrag||m.onStop)&&console.warn("A `position` was applied to this <Draggable>, without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element.")}componentDidMount(){typeof window.SVGElement<"u"&&this.findDOMNode()instanceof window.SVGElement&&this.setState({isElementSVG:!0})}componentWillUnmount(){this.setState({dragging:!1})}findDOMNode(){var m,C;return(m=(C=this.props)===null||C===void 0||(C=C.nodeRef)===null||C===void 0?void 0:C.current)!==null&&m!==void 0?m:r.default.findDOMNode(this)}render(){const{axis:m,bounds:C,children:x,defaultPosition:D,defaultClassName:S,defaultClassNameDragging:M,defaultClassNameDragged:P,position:O,positionOffset:_,scale:V,...G}=this.props;let F={},L=null;const j=!!!O||this.state.dragging,E=O||D,N={x:(0,i.canDragX)(this)&&j?this.state.x:E.x,y:(0,i.canDragY)(this)&&j?this.state.y:E.y};this.state.isElementSVG?L=(0,s.createSVGTransform)(N,_):F=(0,s.createCSSTransform)(N,_);const A=(0,o.default)(x.props.className||"",S,{[M]:this.state.dragging,[P]:this.state.dragged});return t.createElement(l.default,f({},G,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),t.cloneElement(t.Children.only(x),{className:A,style:{...x.props.style,...F},transform:L}))}}e.default=w,g(w,"displayName","Draggable"),g(w,"propTypes",{...l.default.propTypes,axis:n.default.oneOf(["both","x","y","none"]),bounds:n.default.oneOfType([n.default.shape({left:n.default.number,right:n.default.number,top:n.default.number,bottom:n.default.number}),n.default.string,n.default.oneOf([!1])]),defaultClassName:n.default.string,defaultClassNameDragging:n.default.string,defaultClassNameDragged:n.default.string,defaultPosition:n.default.shape({x:n.default.number,y:n.default.number}),positionOffset:n.default.shape({x:n.default.oneOfType([n.default.number,n.default.string]),y:n.default.oneOfType([n.default.number,n.default.string])}),position:n.default.shape({x:n.default.number,y:n.default.number}),className:a.dontSetMe,style:a.dontSetMe,transform:a.dontSetMe}),g(w,"defaultProps",{...l.default.defaultProps,axis:"both",bounds:!1,defaultClassName:"react-draggable",defaultClassNameDragging:"react-draggable-dragging",defaultClassNameDragged:"react-draggable-dragged",defaultPosition:{x:0,y:0},scale:1})}(Ai)),Ai}var Bd;function Rm(){if(Bd)return vr.exports;Bd=1;const{default:e,DraggableCore:t}=uA();return vr.exports=e,vr.exports.default=e,vr.exports.DraggableCore=t,vr.exports}var Oo={},zd;function dA(){if(zd)return Oo;zd=1,Oo.__esModule=!0,Oo.cloneElement=a;var e=t(R);function t(l){return l&&l.__esModule?l:{default:l}}function n(l,c){var u=Object.keys(l);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(l);c&&(d=d.filter(function(p){return Object.getOwnPropertyDescriptor(l,p).enumerable})),u.push.apply(u,d)}return u}function r(l){for(var c=1;c<arguments.length;c++){var u=arguments[c]!=null?arguments[c]:{};c%2?n(Object(u),!0).forEach(function(d){o(l,d,u[d])}):Object.getOwnPropertyDescriptors?Object.defineProperties(l,Object.getOwnPropertyDescriptors(u)):n(Object(u)).forEach(function(d){Object.defineProperty(l,d,Object.getOwnPropertyDescriptor(u,d))})}return l}function o(l,c,u){return c=s(c),c in l?Object.defineProperty(l,c,{value:u,enumerable:!0,configurable:!0,writable:!0}):l[c]=u,l}function s(l){var c=i(l,"string");return typeof c=="symbol"?c:String(c)}function i(l,c){if(typeof l!="object"||l===null)return l;var u=l[Symbol.toPrimitive];if(u!==void 0){var d=u.call(l,c);if(typeof d!="object")return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return(c==="string"?String:Number)(l)}function a(l,c){return c.style&&l.props.style&&(c.style=r(r({},l.props.style),c.style)),c.className&&l.props.className&&(c.className=l.props.className+" "+c.className),e.default.cloneElement(l,c)}return Oo}var wr={},Hd;function Tm(){if(Hd)return wr;Hd=1,wr.__esModule=!0,wr.resizableProps=void 0;var e=t(Is());Rm();function t(r){return r&&r.__esModule?r:{default:r}}var n={axis:e.default.oneOf(["both","x","y","none"]),className:e.default.string,children:e.default.element.isRequired,draggableOpts:e.default.shape({allowAnyClick:e.default.bool,cancel:e.default.string,children:e.default.node,disabled:e.default.bool,enableUserSelectHack:e.default.bool,offsetParent:e.default.node,grid:e.default.arrayOf(e.default.number),handle:e.default.string,nodeRef:e.default.object,onStart:e.default.func,onDrag:e.default.func,onStop:e.default.func,onMouseDown:e.default.func,scale:e.default.number}),height:function(){for(var o=arguments.length,s=new Array(o),i=0;i<o;i++)s[i]=arguments[i];var a=s[0];if(a.axis==="both"||a.axis==="y"){var l;return(l=e.default.number).isRequired.apply(l,s)}return e.default.number.apply(e.default,s)},handle:e.default.oneOfType([e.default.node,e.default.func]),handleSize:e.default.arrayOf(e.default.number),lockAspectRatio:e.default.bool,maxConstraints:e.default.arrayOf(e.default.number),minConstraints:e.default.arrayOf(e.default.number),onResizeStop:e.default.func,onResizeStart:e.default.func,onResize:e.default.func,resizeHandles:e.default.arrayOf(e.default.oneOf(["s","w","e","n","sw","nw","se","ne"])),transformScale:e.default.number,width:function(){for(var o=arguments.length,s=new Array(o),i=0;i<o;i++)s[i]=arguments[i];var a=s[0];if(a.axis==="both"||a.axis==="x"){var l;return(l=e.default.number).isRequired.apply(l,s)}return e.default.number.apply(e.default,s)}};return wr.resizableProps=n,wr}var Wd;function Dm(){if(Wd)return mr;Wd=1,mr.__esModule=!0,mr.default=void 0;var e=i(R),t=Rm(),n=dA(),r=Tm(),o=["children","className","draggableOpts","width","height","handle","handleSize","lockAspectRatio","axis","minConstraints","maxConstraints","onResize","onResizeStop","onResizeStart","resizeHandles","transformScale"];function s(w){if(typeof WeakMap!="function")return null;var v=new WeakMap,m=new WeakMap;return(s=function(x){return x?m:v})(w)}function i(w,v){if(w&&w.__esModule)return w;if(w===null||typeof w!="object"&&typeof w!="function")return{default:w};var m=s(v);if(m&&m.has(w))return m.get(w);var C={},x=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var D in w)if(D!=="default"&&Object.prototype.hasOwnProperty.call(w,D)){var S=x?Object.getOwnPropertyDescriptor(w,D):null;S&&(S.get||S.set)?Object.defineProperty(C,D,S):C[D]=w[D]}return C.default=w,m&&m.set(w,C),C}function a(){return a=Object.assign?Object.assign.bind():function(w){for(var v=1;v<arguments.length;v++){var m=arguments[v];for(var C in m)Object.prototype.hasOwnProperty.call(m,C)&&(w[C]=m[C])}return w},a.apply(this,arguments)}function l(w,v){if(w==null)return{};var m={},C=Object.keys(w),x,D;for(D=0;D<C.length;D++)x=C[D],!(v.indexOf(x)>=0)&&(m[x]=w[x]);return m}function c(w,v){var m=Object.keys(w);if(Object.getOwnPropertySymbols){var C=Object.getOwnPropertySymbols(w);v&&(C=C.filter(function(x){return Object.getOwnPropertyDescriptor(w,x).enumerable})),m.push.apply(m,C)}return m}function u(w){for(var v=1;v<arguments.length;v++){var m=arguments[v]!=null?arguments[v]:{};v%2?c(Object(m),!0).forEach(function(C){d(w,C,m[C])}):Object.getOwnPropertyDescriptors?Object.defineProperties(w,Object.getOwnPropertyDescriptors(m)):c(Object(m)).forEach(function(C){Object.defineProperty(w,C,Object.getOwnPropertyDescriptor(m,C))})}return w}function d(w,v,m){return v=p(v),v in w?Object.defineProperty(w,v,{value:m,enumerable:!0,configurable:!0,writable:!0}):w[v]=m,w}function p(w){var v=f(w,"string");return typeof v=="symbol"?v:String(v)}function f(w,v){if(typeof w!="object"||w===null)return w;var m=w[Symbol.toPrimitive];if(m!==void 0){var C=m.call(w,v);if(typeof C!="object")return C;throw new TypeError("@@toPrimitive must return a primitive value.")}return(v==="string"?String:Number)(w)}function g(w,v){w.prototype=Object.create(v.prototype),w.prototype.constructor=w,h(w,v)}function h(w,v){return h=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(C,x){return C.__proto__=x,C},h(w,v)}var b=function(w){g(v,w);function v(){for(var C,x=arguments.length,D=new Array(x),S=0;S<x;S++)D[S]=arguments[S];return C=w.call.apply(w,[this].concat(D))||this,C.handleRefs={},C.lastHandleRect=null,C.slack=null,C}var m=v.prototype;return m.componentWillUnmount=function(){this.resetData()},m.resetData=function(){this.lastHandleRect=this.slack=null},m.runConstraints=function(x,D){var S=this.props,M=S.minConstraints,P=S.maxConstraints,O=S.lockAspectRatio;if(!M&&!P&&!O)return[x,D];if(O){var _=this.props.width/this.props.height,V=x-this.props.width,G=D-this.props.height;Math.abs(V)>Math.abs(G*_)?D=x/_:x=D*_}var F=x,L=D,k=this.slack||[0,0],j=k[0],E=k[1];return x+=j,D+=E,M&&(x=Math.max(M[0],x),D=Math.max(M[1],D)),P&&(x=Math.min(P[0],x),D=Math.min(P[1],D)),this.slack=[j+(F-x),E+(L-D)],[x,D]},m.resizeHandler=function(x,D){var S=this;return function(M,P){var O=P.node,_=P.deltaX,V=P.deltaY;x==="onResizeStart"&&S.resetData();var G=(S.props.axis==="both"||S.props.axis==="x")&&D!=="n"&&D!=="s",F=(S.props.axis==="both"||S.props.axis==="y")&&D!=="e"&&D!=="w";if(!(!G&&!F)){var L=D[0],k=D[D.length-1],j=O.getBoundingClientRect();if(S.lastHandleRect!=null){if(k==="w"){var E=j.left-S.lastHandleRect.left;_+=E}if(L==="n"){var N=j.top-S.lastHandleRect.top;V+=N}}S.lastHandleRect=j,k==="w"&&(_=-_),L==="n"&&(V=-V);var A=S.props.width+(G?_/S.props.transformScale:0),I=S.props.height+(F?V/S.props.transformScale:0),B=S.runConstraints(A,I);A=B[0],I=B[1];var H=A!==S.props.width||I!==S.props.height,W=typeof S.props[x]=="function"?S.props[x]:null,Z=x==="onResize"&&!H;W&&!Z&&(M.persist==null||M.persist(),W(M,{node:O,size:{width:A,height:I},handle:D})),x==="onResizeStop"&&S.resetData()}}},m.renderResizeHandle=function(x,D){var S=this.props.handle;if(!S)return e.createElement("span",{className:"react-resizable-handle react-resizable-handle-"+x,ref:D});if(typeof S=="function")return S(x,D);var M=typeof S.type=="string",P=u({ref:D},M?{}:{handleAxis:x});return e.cloneElement(S,P)},m.render=function(){var x=this,D=this.props,S=D.children,M=D.className,P=D.draggableOpts;D.width,D.height,D.handle,D.handleSize,D.lockAspectRatio,D.axis,D.minConstraints,D.maxConstraints,D.onResize,D.onResizeStop,D.onResizeStart;var O=D.resizeHandles;D.transformScale;var _=l(D,o);return(0,n.cloneElement)(S,u(u({},_),{},{className:(M?M+" ":"")+"react-resizable",children:[].concat(S.props.children,O.map(function(V){var G,F=(G=x.handleRefs[V])!=null?G:x.handleRefs[V]=e.createRef();return e.createElement(t.DraggableCore,a({},P,{nodeRef:F,key:"resizableHandle-"+V,onStop:x.resizeHandler("onResizeStop",V),onStart:x.resizeHandler("onResizeStart",V),onDrag:x.resizeHandler("onResize",V)}),x.renderResizeHandle(V,F))}))}))},v}(e.Component);return mr.default=b,b.propTypes=r.resizableProps,b.defaultProps={axis:"both",handleSize:[20,20],lockAspectRatio:!1,minConstraints:[20,20],maxConstraints:[1/0,1/0],resizeHandles:["se"],transformScale:1},mr}var xr={},Ud;function fA(){if(Ud)return xr;Ud=1,xr.__esModule=!0,xr.default=void 0;var e=a(R),t=s(Is()),n=s(Dm()),r=Tm(),o=["handle","handleSize","onResize","onResizeStart","onResizeStop","draggableOpts","minConstraints","maxConstraints","lockAspectRatio","axis","width","height","resizeHandles","style","transformScale"];function s(v){return v&&v.__esModule?v:{default:v}}function i(v){if(typeof WeakMap!="function")return null;var m=new WeakMap,C=new WeakMap;return(i=function(D){return D?C:m})(v)}function a(v,m){if(v&&v.__esModule)return v;if(v===null||typeof v!="object"&&typeof v!="function")return{default:v};var C=i(m);if(C&&C.has(v))return C.get(v);var x={},D=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var S in v)if(S!=="default"&&Object.prototype.hasOwnProperty.call(v,S)){var M=D?Object.getOwnPropertyDescriptor(v,S):null;M&&(M.get||M.set)?Object.defineProperty(x,S,M):x[S]=v[S]}return x.default=v,C&&C.set(v,x),x}function l(){return l=Object.assign?Object.assign.bind():function(v){for(var m=1;m<arguments.length;m++){var C=arguments[m];for(var x in C)Object.prototype.hasOwnProperty.call(C,x)&&(v[x]=C[x])}return v},l.apply(this,arguments)}function c(v,m){var C=Object.keys(v);if(Object.getOwnPropertySymbols){var x=Object.getOwnPropertySymbols(v);m&&(x=x.filter(function(D){return Object.getOwnPropertyDescriptor(v,D).enumerable})),C.push.apply(C,x)}return C}function u(v){for(var m=1;m<arguments.length;m++){var C=arguments[m]!=null?arguments[m]:{};m%2?c(Object(C),!0).forEach(function(x){d(v,x,C[x])}):Object.getOwnPropertyDescriptors?Object.defineProperties(v,Object.getOwnPropertyDescriptors(C)):c(Object(C)).forEach(function(x){Object.defineProperty(v,x,Object.getOwnPropertyDescriptor(C,x))})}return v}function d(v,m,C){return m=p(m),m in v?Object.defineProperty(v,m,{value:C,enumerable:!0,configurable:!0,writable:!0}):v[m]=C,v}function p(v){var m=f(v,"string");return typeof m=="symbol"?m:String(m)}function f(v,m){if(typeof v!="object"||v===null)return v;var C=v[Symbol.toPrimitive];if(C!==void 0){var x=C.call(v,m);if(typeof x!="object")return x;throw new TypeError("@@toPrimitive must return a primitive value.")}return(m==="string"?String:Number)(v)}function g(v,m){if(v==null)return{};var C={},x=Object.keys(v),D,S;for(S=0;S<x.length;S++)D=x[S],!(m.indexOf(D)>=0)&&(C[D]=v[D]);return C}function h(v,m){v.prototype=Object.create(m.prototype),v.prototype.constructor=v,b(v,m)}function b(v,m){return b=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(x,D){return x.__proto__=D,x},b(v,m)}var w=function(v){h(m,v);function m(){for(var x,D=arguments.length,S=new Array(D),M=0;M<D;M++)S[M]=arguments[M];return x=v.call.apply(v,[this].concat(S))||this,x.state={width:x.props.width,height:x.props.height,propsWidth:x.props.width,propsHeight:x.props.height},x.onResize=function(P,O){var _=O.size;x.props.onResize?(P.persist==null||P.persist(),x.setState(_,function(){return x.props.onResize&&x.props.onResize(P,O)})):x.setState(_)},x}m.getDerivedStateFromProps=function(D,S){return S.propsWidth!==D.width||S.propsHeight!==D.height?{width:D.width,height:D.height,propsWidth:D.width,propsHeight:D.height}:null};var C=m.prototype;return C.render=function(){var D=this.props,S=D.handle,M=D.handleSize;D.onResize;var P=D.onResizeStart,O=D.onResizeStop,_=D.draggableOpts,V=D.minConstraints,G=D.maxConstraints,F=D.lockAspectRatio,L=D.axis;D.width,D.height;var k=D.resizeHandles,j=D.style,E=D.transformScale,N=g(D,o);return e.createElement(n.default,{axis:L,draggableOpts:_,handle:S,handleSize:M,height:this.state.height,lockAspectRatio:F,maxConstraints:G,minConstraints:V,onResizeStart:P,onResize:this.onResize,onResizeStop:O,resizeHandles:k,transformScale:E,width:this.state.width},e.createElement("div",l({},N,{style:u(u({},j),{},{width:this.state.width+"px",height:this.state.height+"px"})})))},m}(e.Component);return xr.default=w,w.propTypes=u(u({},r.resizableProps),{},{children:t.default.element}),xr}var Gd;function pA(){return Gd||(Gd=1,gr.exports=function(){throw new Error("Don't instantiate Resizable directly! Use require('react-resizable').Resizable")},gr.exports.Resizable=Dm().default,gr.exports.ResizableBox=fA().default),gr.exports}var Mm=pA();const Yd=({booking:e,slotData:t,customClasses:n,hoveringAdditionalCardId:r="",children:o,ref:s})=>{const[i,a]=R.useState(!1),{updateIsDragging:l,isDragging:c}=bt(C=>C),{attributes:u,listeners:d,setNodeRef:p,isDragging:f,transform:g}=za({id:e.id,data:{type:"booking-slots",booking:e,slotData:t},disabled:e.disabledResize==="full"||e.disabledResize==="half"}),h=g?{transform:`translate3d(${g.x}px, ${g.y}px, 0)`}:void 0;Zr({onDragStart:()=>b(),onDragAbort:()=>w(),onDragCancel:()=>w(),onDragEnd:()=>w()});const b=R.useCallback(()=>{l(!0)},[]),w=R.useCallback(()=>{l(!1)},[]),v=R.useMemo(()=>({cursor:c?"ns-resize":"pointer",width:"100%"}),[c]),m=(C,x)=>r!=null&&r.length?C===x:!1;if(R.useImperativeHandle(s,()=>({changeCurrentCardResize:()=>a(C=>!C)})),!f)return y.jsx("div",{ref:p,className:he("cardContent_render",(i||m(r,e.id))&&"cardContent_render_dragging",n),style:{...h,...v},...d,...u,children:o},e.id)},Kd=({afterResize:e=!1,booking:t,slotData:n,events:r})=>{if(!t||!n)return null;const o=R.useMemo(()=>{const s=J.timeDiffInMinutes(t.finishAt,t.startAt),i=Math.floor(s/60),a=s%60;return i>0?a>0?`${i}h ${a}m`:`${i}h`:a===15?"":`${a}m`},[t.startAt,t.finishAt]);return y.jsxs("div",{className:he("booking_card_content_container","overflow-hidden","min-h-[3rem] p-1 relative"),style:{backgroundColor:"#000456c0"},onPointerUp:r==null?void 0:r.onClick,children:[!e&&y.jsx("div",{className:"absolute top-1 right-1",children:y.jsx("div",{className:"w-2 h-2 bg-white rounded-full animate-ping"})}),y.jsxs("div",{className:"booking_card_content text-white h-full flex flex-col justify-between",children:[y.jsxs("div",{className:"flex items-center gap-1 mb-1",children:[y.jsx(Xf,{className:"w-3 h-3 opacity-80"}),y.jsxs("span",{className:"text-xs",children:[J.dateAndHourDateToString(t.startAt),"-",J.dateAndHourDateToString(t.finishAt)]})]}),o.length&&y.jsx("div",{className:"flex items-center justify-between gap-1",children:y.jsxs("div",{className:"flex items-center gap-1",children:[y.jsx(Ha,{className:"w-3 h-3 opacity-80"}),y.jsx("span",{className:"text-xs opacity-90",children:o})]})})]})]},`${n.day}-${n.hour}`)};function hA(e,t){const n=e>new Date(t.startAt),r=e<new Date(t.finishAt);return n&&r}const gA={calculateOverlappingBookings:(e,t)=>{const n=t.filter(o=>{const s=new Date(o.startAt).getDate(),i=e.startAt.getDate();return s===i&&o.id!==e.id});let r=0;for(const o of n)hA(e.startAt,o)&&r++;return r}},Jl=({resize:e=!1,bookingInit:t,slotData:n,heightStyle:r,topHeightIncrement:o=0,customClasses:s,resizableParam:i,events:a,open:l=!0,lastCard:c,half:u,cardsQuantity:d,cardIndex:p,hoveringAdditionalCardId:f,cardContentRef:g,ref:h})=>{var A;const b=bt(ms(I=>I.updateIsDragging)),{emptySlotNodes:w}=He(),{bookings:v,onCardResizeEnd:m}=nn(),[C,x]=R.useState(""),D=R.useRef(null),S=(I,B)=>{var H;M("show-handle",!0),i!=null&&i.onResizeStart&&i.onResizeStart(I,B),(H=D.current)==null||H.changeCurrentCardResize()},M=(I="",B=!1)=>{x(I),b(B)},P=(I,B)=>{var H;(H=D.current)==null||H.changeCurrentCardResize(),M(),B.handle.includes("n")&&m(Vi.resizeBookingNorthId(t)),B.handle.includes("s")&&m(Vi.resizeBookingSouthId(t)),i!=null&&i.onResizeStop&&i.onResizeStop(I,B)},O=R.useMemo(()=>gA.calculateOverlappingBookings(t,v),[t,v]),_=I=>I===0?"8rem":"4rem",V=R.useMemo(()=>u&&d===3&&(p===0||p===1)?_(p):O===2?"0.8rem":c&&O===1?"0.2rem":c&&O?"1rem":O===1?"0.4rem":0,[O,p,d]),G=R.useMemo(()=>{const I=`${o}rem`,B=`${r}rem`;if(!u)return{inset:`${I} ${V} ${B}`};if(d===2&&p===1)return{inset:`${I} 0% ${B} 50%`};const H=()=>{const $=100/(d||0),q=(p||0)*$,X=100-q-$;return{cardWidth:$,leftPercent:q,rightPercent:X}},{cardWidth:W,leftPercent:Z,rightPercent:K}=H();return c?{inset:`${I} 0 ${B} ${100-W}%`}:{inset:`${I} ${K}% ${B} ${Z}%`}},[r,o,p,d,V,u,c]),F=(I,B)=>{const H=w.get(B);H==null||H.hoveringAdditionalCard(I.id)},L=I=>{const B=w.get(I);B==null||B.clearHoveringCard()},k=(I,B)=>{({mouseenter:()=>F(t,I),mouseleave:()=>L(I)}[B]||(()=>console.warn(`Unhandled event type: ${B}`)))()},j=I=>{const B=I.toDateString();return qn({key:B,time:mf})},E=I=>{const B=J.calculateDaysDifference(t.finishAt,t.startAt);if(B===1){k(j(t.finishAt),I);return}const H=J.buildFutureDateList(t,B);for(const W of H)k(j(W),I)},N=I=>{const B=I.type;if(t!=null&&t.nodes)for(const H of t.nodes)k(H,B);E(B)};if(R.useEffect(()=>()=>{a!=null&&a.onUnmount&&a.onUnmount()},[]),R.useImperativeHandle(g,()=>({changeCurrentCardResize:()=>{var I;(I=D.current)==null||I.changeCurrentCardResize()}})),!l&&!t.finishAt)return null;if((A=i==null?void 0:i.state)!=null&&A.height){const{state:I,onResize:B,resizeHandle:H=["s","n"]}=i,Z=(()=>{switch(t==null?void 0:t.disabledResize){case"full":return[];case"half":return["s"];default:return H}})();return y.jsx(Mm.Resizable,{className:he(i==null?void 0:i.customClass,C),height:I==null?void 0:I.height,width:I==null?void 0:I.width,onResize:B,onResizeStart:S,onResizeStop:P,resizeHandles:Z,draggableOpts:{grid:[35,35]},handleSize:[20,20],maxConstraints:[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY],transformScale:1,children:y.jsx("div",{className:"card_content_core",style:G,onMouseEnter:N,onMouseLeave:N,onBlur:()=>{},children:y.jsx(Yd,{ref:D,booking:t,slotData:n,hoveringAdditionalCardId:f,children:e?y.jsx(Kd,{booking:t,slotData:n,events:{onClick:a==null?void 0:a.onClick}}):y.jsx(cm,{booking:t,slotData:n,events:{onClick:a==null?void 0:a.onClick}})},t.id)})})}return y.jsx("div",{ref:h,className:"card_content_core",style:G,children:y.jsx(Yd,{customClasses:s,booking:t,slotData:n,children:y.jsx(Kd,{afterResize:!0,booking:t,slotData:n,events:{onClick:a==null?void 0:a.onClick}})})})},Em=({booking:e,onAddTime:t,onAddStartTime:n,onSubTime:r,starter:o=!1})=>{const[s,i]=R.useState({height:Pe,width:Pe}),[a,l]=R.useState(0),{operationalStartTime:c,operationalEndTime:u}=pe(),d=R.useRef({s:Pe,se:Pe,n:Pe}),p=O=>{const _=new Date(O);return _.setHours(24,0,0),J.timeDiffInMinutes(_,O)},f=(O,_)=>{const V=new Date(O);return J.isMidnight(O)&&O.getTime()<=_.getTime()&&V.setDate(V.getDate()+1),V},g=(O,_)=>{const V=f(O,_);if(V.getTime()<=_.getTime())return console.error("Invalid booking: finish time must be after start time",{start:_.toISOString(),finish:V.toISOString()}),-Math.abs(1*2);if(J.isFinishDateAnotherDay(V,_)){const k=p(_),j=Math.ceil(k/ko);return-Math.abs((j-1)*2)}const F=J.timeDiffInMinutes(V,_);if(F<=0)return console.warn("Calculated negative or zero duration",{start:_.toISOString(),finish:V.toISOString(),diffInMinutes:F}),-Math.abs(1*2);const L=Math.ceil(F/ko);return-Math.abs((L-1)*2)},[h,b]=R.useState(o?g(e.finishAt,e.startAt):0),w=R.useCallback(()=>J.timeDiffInMinutes(e.finishAt,e.startAt)===ko,[e.finishAt,e.startAt]),v=R.useCallback(async()=>{const O=De.adjustedDateMinutes(e.startAt,"add");De.isUpperBoundReached(c,O)||w()||(l(_=>_+2),n&&n(O))},[e.startAt,c,n,w]),m=R.useCallback(()=>{const O=De.adjustedDateMinutes(e.finishAt,"add");De.isLowerBoundReached(u,O)||(b(_=>De.baseValueLimitMin(_)?vf:_-2),t&&t(O))},[e.finishAt,u,t]),C=R.useCallback(()=>{const O=De.adjustedDateMinutes(e.startAt,"remove");De.isUpperBoundReached(c,O)||(l(_=>_-2),n&&n(O))},[e.startAt,c,n]),x=R.useCallback(async()=>{const O=De.adjustedDateMinutes(e.finishAt,"remove");De.isLowerBoundReached(u,O)||w()||(b(_=>_+2),r&&r(O))},[e.finishAt,u,r,w]),D=R.useCallback((O,{size:_,handle:V})=>{O.stopPropagation(),O.preventDefault();const G=_.height,F=d.current[V]||Pe,L=G-F;if(!(Math.abs(L)<10)){switch(V){case"se":case"s":{L>0?m():x();break}case"n":{L>0?C():v();break}}i(j=>({...j,height:G})),d.current[V]=G}},[m,x,C,v]),S=R.useCallback((O,_)=>{b(g(O,_))},[]),M=R.useCallback(()=>{i({height:Pe,width:Pe}),d.current={s:Pe,se:Pe,n:Pe}},[]),P=R.useCallback(()=>{b(0),l(0)},[]);return{state:s,setState:i,resetState:M,resetHeightStyle:P,heightStyle:h,topHeightIncrement:a,onResize:D,updateHeightStyle:S}};var Ql="Popover",[Pm,F_]=rn(Ql,[on]),uo=on(),[mA,an]=Pm(Ql),Am=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:o,onOpenChange:s,modal:i=!1}=e,a=uo(t),l=T.useRef(null),[c,u]=T.useState(!1),[d=!1,p]=yn({prop:r,defaultProp:o,onChange:s});return y.jsx(Ss,{...a,children:y.jsx(mA,{scope:t,contentId:Kt(),triggerRef:l,open:d,onOpenChange:p,onOpenToggle:T.useCallback(()=>p(f=>!f),[p]),hasCustomAnchor:c,onCustomAnchorAdd:T.useCallback(()=>u(!0),[]),onCustomAnchorRemove:T.useCallback(()=>u(!1),[]),modal:i,children:n})})};Am.displayName=Ql;var Om="PopoverAnchor",_m=T.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=an(Om,n),s=uo(n),{onCustomAnchorAdd:i,onCustomAnchorRemove:a}=o;return T.useEffect(()=>(i(),()=>a()),[i,a]),y.jsx(no,{...s,...r,ref:t})});_m.displayName=Om;var km="PopoverTrigger",Im=T.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=an(km,n),s=uo(n),i=ge(t,o.triggerRef),a=y.jsx(ce.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":Lm(o.open),...r,ref:i,onClick:ne(e.onClick,o.onOpenToggle)});return o.hasCustomAnchor?a:y.jsx(no,{asChild:!0,...s,children:a})});Im.displayName=km;var ec="PopoverPortal",[vA,yA]=Pm(ec,{forceMount:void 0}),Nm=e=>{const{__scopePopover:t,forceMount:n,children:r,container:o}=e,s=an(ec,t);return y.jsx(vA,{scope:t,forceMount:n,children:y.jsx(jt,{present:n||s.open,children:y.jsx(ro,{asChild:!0,container:o,children:r})})})};Nm.displayName=ec;var Gn="PopoverContent",jm=T.forwardRef((e,t)=>{const n=yA(Gn,e.__scopePopover),{forceMount:r=n.forceMount,...o}=e,s=an(Gn,e.__scopePopover);return y.jsx(jt,{present:r||s.open,children:s.modal?y.jsx(xA,{...o,ref:t}):y.jsx(bA,{...o,ref:t})})});jm.displayName=Gn;var wA=wn("PopoverContent.RemoveScroll"),xA=T.forwardRef((e,t)=>{const n=an(Gn,e.__scopePopover),r=T.useRef(null),o=ge(t,r),s=T.useRef(!1);return T.useEffect(()=>{const i=r.current;if(i)return nl(i)},[]),y.jsx(Ms,{as:wA,allowPinchZoom:!0,children:y.jsx(Fm,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ne(e.onCloseAutoFocus,i=>{var a;i.preventDefault(),s.current||(a=n.triggerRef.current)==null||a.focus()}),onPointerDownOutside:ne(e.onPointerDownOutside,i=>{const a=i.detail.originalEvent,l=a.button===0&&a.ctrlKey===!0,c=a.button===2||l;s.current=c},{checkForDefaultPrevented:!1}),onFocusOutside:ne(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1})})})}),bA=T.forwardRef((e,t)=>{const n=an(Gn,e.__scopePopover),r=T.useRef(!1),o=T.useRef(!1);return y.jsx(Fm,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{var i,a;(i=e.onCloseAutoFocus)==null||i.call(e,s),s.defaultPrevented||(r.current||(a=n.triggerRef.current)==null||a.focus(),s.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:s=>{var l,c;(l=e.onInteractOutside)==null||l.call(e,s),s.defaultPrevented||(r.current=!0,s.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const i=s.target;((c=n.triggerRef.current)==null?void 0:c.contains(i))&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&o.current&&s.preventDefault()}})}),Fm=T.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:s,disableOutsidePointerEvents:i,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:c,onInteractOutside:u,...d}=e,p=an(Gn,n),f=uo(n);return Ga(),y.jsx(ys,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:s,children:y.jsx(eo,{asChild:!0,disableOutsidePointerEvents:i,onInteractOutside:u,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:c,onDismiss:()=>p.onOpenChange(!1),children:y.jsx(Cs,{"data-state":Lm(p.open),role:"dialog",id:p.contentId,...f,...d,ref:t,style:{...d.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),Vm="PopoverClose",SA=T.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=an(Vm,n);return y.jsx(ce.button,{type:"button",...r,ref:t,onClick:ne(e.onClick,()=>o.onOpenChange(!1))})});SA.displayName=Vm;var CA="PopoverArrow",RA=T.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=uo(n);return y.jsx(Rs,{...o,...r,ref:t})});RA.displayName=CA;function Lm(e){return e?"open":"closed"}var TA=Am,DA=_m,MA=Im,EA=Nm,PA=jm;function AA({...e}){return y.jsx(TA,{"data-slot":"popover",...e})}function OA({...e}){return y.jsx(MA,{"data-slot":"popover-trigger",...e})}function _A({className:e,align:t="center",sideOffset:n=4,...r}){return y.jsx(EA,{children:y.jsx(PA,{"data-slot":"popover-content",align:t,sideOffset:n,className:he("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",e),...r})})}function kA({...e}){return y.jsx(DA,{"data-slot":"popover-anchor",...e})}const qd=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Xd=wh,tc=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return Xd(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:o,defaultVariants:s}=t,i=Object.keys(o).map(c=>{const u=n==null?void 0:n[c],d=s==null?void 0:s[c];if(u===null)return null;const p=qd(u)||qd(d);return o[c][p]}),a=n&&Object.entries(n).reduce((c,u)=>{let[d,p]=u;return p===void 0||(c[d]=p),c},{}),l=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((c,u)=>{let{class:d,className:p,...f}=u;return Object.entries(f).every(g=>{let[h,b]=g;return Array.isArray(b)?b.includes({...s,...a}[h]):{...s,...a}[h]===b})?[...c,d,p]:c},[]);return Xd(e,i,l,n==null?void 0:n.class,n==null?void 0:n.className)},IA=tc("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive cursor-pointer",{variants:{variant:{default:"bg-primary cursor-pointer text-primary-foreground shadow-xs hover:bg-primary/90",destructive:"bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50 hover:bg-accent",secondary:"bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9"}},defaultVariants:{variant:"default",size:"default"}});function tn({className:e,variant:t,size:n,asChild:r=!1,...o}){const s=r?jx:"button";return y.jsx(s,{"data-slot":"button",className:he(IA({variant:t,size:n,className:e})),...o})}var NA="Toggle",$m=T.forwardRef((e,t)=>{const{pressed:n,defaultPressed:r=!1,onPressedChange:o,...s}=e,[i=!1,a]=yn({prop:n,onChange:o,defaultProp:r});return y.jsx(ce.button,{type:"button","aria-pressed":i,"data-state":i?"on":"off","data-disabled":e.disabled?"":void 0,...s,ref:t,onClick:ne(e.onClick,()=>{e.disabled||a(!i)})})});$m.displayName=NA;var jA=$m;const FA=tc("inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium hover:bg-muted hover:text-muted-foreground disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [&_svg]:shrink-0 focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] outline-none transition-[color,box-shadow] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive whitespace-nowrap",{variants:{variant:{default:"bg-transparent",outline:"border border-input bg-transparent shadow-xs hover:bg-accent hover:text-accent-foreground"},size:{default:"h-9 px-2 min-w-9",sm:"h-8 px-1.5 min-w-8",lg:"h-10 px-2.5 min-w-10"}},defaultVariants:{variant:"default",size:"default"}});function VA({className:e,variant:t,size:n,...r}){return y.jsx(jA,{"data-slot":"toggle",className:he(FA({variant:t,size:n,className:e})),...r})}var LA="VisuallyHidden",nc=T.forwardRef((e,t)=>y.jsx(ce.span,{...e,ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}}));nc.displayName=LA;var $A=nc,[js,V_]=rn("Tooltip",[on]),Fs=on(),Bm="TooltipProvider",BA=700,Ta="tooltip.open",[zA,rc]=js(Bm),zm=e=>{const{__scopeTooltip:t,delayDuration:n=BA,skipDelayDuration:r=300,disableHoverableContent:o=!1,children:s}=e,i=T.useRef(!0),a=T.useRef(!1),l=T.useRef(0);return T.useEffect(()=>{const c=l.current;return()=>window.clearTimeout(c)},[]),y.jsx(zA,{scope:t,isOpenDelayedRef:i,delayDuration:n,onOpen:T.useCallback(()=>{window.clearTimeout(l.current),i.current=!1},[]),onClose:T.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(()=>i.current=!0,r)},[r]),isPointerInTransitRef:a,onPointerInTransitChange:T.useCallback(c=>{a.current=c},[]),disableHoverableContent:o,children:s})};zm.displayName=Bm;var Vs="Tooltip",[HA,fo]=js(Vs),Hm=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:o=!1,onOpenChange:s,disableHoverableContent:i,delayDuration:a}=e,l=rc(Vs,e.__scopeTooltip),c=Fs(t),[u,d]=T.useState(null),p=Kt(),f=T.useRef(0),g=i??l.disableHoverableContent,h=a??l.delayDuration,b=T.useRef(!1),[w=!1,v]=yn({prop:r,defaultProp:o,onChange:S=>{S?(l.onOpen(),document.dispatchEvent(new CustomEvent(Ta))):l.onClose(),s==null||s(S)}}),m=T.useMemo(()=>w?b.current?"delayed-open":"instant-open":"closed",[w]),C=T.useCallback(()=>{window.clearTimeout(f.current),f.current=0,b.current=!1,v(!0)},[v]),x=T.useCallback(()=>{window.clearTimeout(f.current),f.current=0,v(!1)},[v]),D=T.useCallback(()=>{window.clearTimeout(f.current),f.current=window.setTimeout(()=>{b.current=!0,v(!0),f.current=0},h)},[h,v]);return T.useEffect(()=>()=>{f.current&&(window.clearTimeout(f.current),f.current=0)},[]),y.jsx(Ss,{...c,children:y.jsx(HA,{scope:t,contentId:p,open:w,stateAttribute:m,trigger:u,onTriggerChange:d,onTriggerEnter:T.useCallback(()=>{l.isOpenDelayedRef.current?D():C()},[l.isOpenDelayedRef,D,C]),onTriggerLeave:T.useCallback(()=>{g?x():(window.clearTimeout(f.current),f.current=0)},[x,g]),onOpen:C,onClose:x,disableHoverableContent:g,children:n})})};Hm.displayName=Vs;var Da="TooltipTrigger",Wm=T.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=fo(Da,n),s=rc(Da,n),i=Fs(n),a=T.useRef(null),l=ge(t,a,o.onTriggerChange),c=T.useRef(!1),u=T.useRef(!1),d=T.useCallback(()=>c.current=!1,[]);return T.useEffect(()=>()=>document.removeEventListener("pointerup",d),[d]),y.jsx(no,{asChild:!0,...i,children:y.jsx(ce.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...r,ref:l,onPointerMove:ne(e.onPointerMove,p=>{p.pointerType!=="touch"&&!u.current&&!s.isPointerInTransitRef.current&&(o.onTriggerEnter(),u.current=!0)}),onPointerLeave:ne(e.onPointerLeave,()=>{o.onTriggerLeave(),u.current=!1}),onPointerDown:ne(e.onPointerDown,()=>{o.open&&o.onClose(),c.current=!0,document.addEventListener("pointerup",d,{once:!0})}),onFocus:ne(e.onFocus,()=>{c.current||o.onOpen()}),onBlur:ne(e.onBlur,o.onClose),onClick:ne(e.onClick,o.onClose)})})});Wm.displayName=Da;var oc="TooltipPortal",[WA,UA]=js(oc,{forceMount:void 0}),Um=e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:o}=e,s=fo(oc,t);return y.jsx(WA,{scope:t,forceMount:n,children:y.jsx(jt,{present:n||s.open,children:y.jsx(ro,{asChild:!0,container:o,children:r})})})};Um.displayName=oc;var Yn="TooltipContent",Gm=T.forwardRef((e,t)=>{const n=UA(Yn,e.__scopeTooltip),{forceMount:r=n.forceMount,side:o="top",...s}=e,i=fo(Yn,e.__scopeTooltip);return y.jsx(jt,{present:r||i.open,children:i.disableHoverableContent?y.jsx(Ym,{side:o,...s,ref:t}):y.jsx(GA,{side:o,...s,ref:t})})}),GA=T.forwardRef((e,t)=>{const n=fo(Yn,e.__scopeTooltip),r=rc(Yn,e.__scopeTooltip),o=T.useRef(null),s=ge(t,o),[i,a]=T.useState(null),{trigger:l,onClose:c}=n,u=o.current,{onPointerInTransitChange:d}=r,p=T.useCallback(()=>{a(null),d(!1)},[d]),f=T.useCallback((g,h)=>{const b=g.currentTarget,w={x:g.clientX,y:g.clientY},v=ZA(w,b.getBoundingClientRect()),m=JA(w,v),C=QA(h.getBoundingClientRect()),x=tO([...m,...C]);a(x),d(!0)},[d]);return T.useEffect(()=>()=>p(),[p]),T.useEffect(()=>{if(l&&u){const g=b=>f(b,u),h=b=>f(b,l);return l.addEventListener("pointerleave",g),u.addEventListener("pointerleave",h),()=>{l.removeEventListener("pointerleave",g),u.removeEventListener("pointerleave",h)}}},[l,u,f,p]),T.useEffect(()=>{if(i){const g=h=>{const b=h.target,w={x:h.clientX,y:h.clientY},v=(l==null?void 0:l.contains(b))||(u==null?void 0:u.contains(b)),m=!eO(w,i);v?p():m&&(p(),c())};return document.addEventListener("pointermove",g),()=>document.removeEventListener("pointermove",g)}},[l,u,i,c,p]),y.jsx(Ym,{...e,ref:s})}),[YA,KA]=js(Vs,{isInside:!1}),qA=Vx("TooltipContent"),Ym=T.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":o,onEscapeKeyDown:s,onPointerDownOutside:i,...a}=e,l=fo(Yn,n),c=Fs(n),{onClose:u}=l;return T.useEffect(()=>(document.addEventListener(Ta,u),()=>document.removeEventListener(Ta,u)),[u]),T.useEffect(()=>{if(l.trigger){const d=p=>{const f=p.target;f!=null&&f.contains(l.trigger)&&u()};return window.addEventListener("scroll",d,{capture:!0}),()=>window.removeEventListener("scroll",d,{capture:!0})}},[l.trigger,u]),y.jsx(eo,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:d=>d.preventDefault(),onDismiss:u,children:y.jsxs(Cs,{"data-state":l.stateAttribute,...c,...a,ref:t,style:{...a.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[y.jsx(qA,{children:r}),y.jsx(YA,{scope:n,isInside:!0,children:y.jsx($A,{id:l.contentId,role:"tooltip",children:o||r})})]})})});Gm.displayName=Yn;var Km="TooltipArrow",XA=T.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=Fs(n);return KA(Km,n).isInside?null:y.jsx(Rs,{...o,...r,ref:t})});XA.displayName=Km;function ZA(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),s=Math.abs(t.left-e.x);switch(Math.min(n,r,o,s)){case s:return"left";case o:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function JA(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function QA(e){const{top:t,right:n,bottom:r,left:o}=e;return[{x:o,y:t},{x:n,y:t},{x:n,y:r},{x:o,y:r}]}function eO(e,t){const{x:n,y:r}=e;let o=!1;for(let s=0,i=t.length-1;s<t.length;i=s++){const a=t[s].x,l=t[s].y,c=t[i].x,u=t[i].y;l>r!=u>r&&n<(c-a)*(r-l)/(u-l)+a&&(o=!o)}return o}function tO(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),nO(t)}function nO(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const o=e[r];for(;t.length>=2;){const s=t[t.length-1],i=t[t.length-2];if((s.x-i.x)*(o.y-i.y)>=(s.y-i.y)*(o.x-i.x))t.pop();else break}t.push(o)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const o=e[r];for(;n.length>=2;){const s=n[n.length-1],i=n[n.length-2];if((s.x-i.x)*(o.y-i.y)>=(s.y-i.y)*(o.x-i.x))n.pop();else break}n.push(o)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var rO=zm,oO=Hm,sO=Wm,iO=Um,aO=Gm;function sc({delayDuration:e=0,...t}){return y.jsx(rO,{"data-slot":"tooltip-provider",delayDuration:e,...t})}function qm({...e}){return y.jsx(sc,{children:y.jsx(oO,{"data-slot":"tooltip",...e})})}function Xm({...e}){return y.jsx(sO,{"data-slot":"tooltip-trigger",...e})}function Zm({className:e,sideOffset:t=0,children:n,...r}){return y.jsx(iO,{children:y.jsx(aO,{"data-slot":"tooltip-content",sideOffset:t,className:he("bg-primary text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",e),...r,children:n})})}const lO=()=>{const[e,t]=R.useState(!1);return y.jsx(sc,{children:y.jsxs(qm,{children:[y.jsx(Xm,{asChild:!0,children:y.jsx("div",{children:y.jsx(VA,{className:"group size-10 p-0 hover:bg-indigo-50 hover:text-indigo-500 data-[state=on]:bg-indigo-50 data-[state=on]:text-indigo-500","aria-label":"Bookmark this",variant:e?"default":"outline",pressed:e,onPressedChange:t,children:y.jsx(Jw,{size:16,strokeWidth:2,"aria-hidden":"true"})})})}),y.jsx(Zm,{className:"border border-input bg-popover px-2 py-1 text-xs text-muted-foreground",children:y.jsx("p",{children:e?"Remove bookmark":"Bookmark this"})})]})})};function Zd(e,[t,n]){return Math.min(n,Math.max(t,e))}function cO(e){const t=T.useRef({value:e,previous:e});return T.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var uO=[" ","Enter","ArrowUp","ArrowDown"],dO=[" ","Enter"],po="Select",[Ls,$s,fO]=Wa(po),[ir,L_]=rn(po,[fO,on]),Bs=on(),[pO,ln]=ir(po),[hO,gO]=ir(po),Jm=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:o,onOpenChange:s,value:i,defaultValue:a,onValueChange:l,dir:c,name:u,autoComplete:d,disabled:p,required:f,form:g}=e,h=Bs(t),[b,w]=T.useState(null),[v,m]=T.useState(null),[C,x]=T.useState(!1),D=Ua(c),[S=!1,M]=yn({prop:r,defaultProp:o,onChange:s}),[P,O]=yn({prop:i,defaultProp:a,onChange:l}),_=T.useRef(null),V=b?g||!!b.closest("form"):!0,[G,F]=T.useState(new Set),L=Array.from(G).map(k=>k.props.value).join(";");return y.jsx(Ss,{...h,children:y.jsxs(pO,{required:f,scope:t,trigger:b,onTriggerChange:w,valueNode:v,onValueNodeChange:m,valueNodeHasChildren:C,onValueNodeHasChildrenChange:x,contentId:Kt(),value:P,onValueChange:O,open:S,onOpenChange:M,dir:D,triggerPointerDownPosRef:_,disabled:p,children:[y.jsx(Ls.Provider,{scope:t,children:y.jsx(hO,{scope:e.__scopeSelect,onNativeOptionAdd:T.useCallback(k=>{F(j=>new Set(j).add(k))},[]),onNativeOptionRemove:T.useCallback(k=>{F(j=>{const E=new Set(j);return E.delete(k),E})},[]),children:n})}),V?y.jsxs(bv,{"aria-hidden":!0,required:f,tabIndex:-1,name:u,autoComplete:d,value:P,onChange:k=>O(k.target.value),disabled:p,form:g,children:[P===void 0?y.jsx("option",{value:""}):null,Array.from(G)]},L):null]})})};Jm.displayName=po;var Qm="SelectTrigger",ev=T.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...o}=e,s=Bs(n),i=ln(Qm,n),a=i.disabled||r,l=ge(t,i.onTriggerChange),c=$s(n),u=T.useRef("touch"),[d,p,f]=Sv(h=>{const b=c().filter(m=>!m.disabled),w=b.find(m=>m.value===i.value),v=Cv(b,h,w);v!==void 0&&i.onValueChange(v.value)}),g=h=>{a||(i.onOpenChange(!0),f()),h&&(i.triggerPointerDownPosRef.current={x:Math.round(h.pageX),y:Math.round(h.pageY)})};return y.jsx(no,{asChild:!0,...s,children:y.jsx(ce.button,{type:"button",role:"combobox","aria-controls":i.contentId,"aria-expanded":i.open,"aria-required":i.required,"aria-autocomplete":"none",dir:i.dir,"data-state":i.open?"open":"closed",disabled:a,"data-disabled":a?"":void 0,"data-placeholder":xv(i.value)?"":void 0,...o,ref:l,onClick:ne(o.onClick,h=>{h.currentTarget.focus(),u.current!=="mouse"&&g(h)}),onPointerDown:ne(o.onPointerDown,h=>{u.current=h.pointerType;const b=h.target;b.hasPointerCapture(h.pointerId)&&b.releasePointerCapture(h.pointerId),h.button===0&&h.ctrlKey===!1&&h.pointerType==="mouse"&&(g(h),h.preventDefault())}),onKeyDown:ne(o.onKeyDown,h=>{const b=d.current!=="";!(h.ctrlKey||h.altKey||h.metaKey)&&h.key.length===1&&p(h.key),!(b&&h.key===" ")&&uO.includes(h.key)&&(g(),h.preventDefault())})})})});ev.displayName=Qm;var tv="SelectValue",nv=T.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,children:s,placeholder:i="",...a}=e,l=ln(tv,n),{onValueNodeHasChildrenChange:c}=l,u=s!==void 0,d=ge(t,l.onValueNodeChange);return Ve(()=>{c(u)},[c,u]),y.jsx(ce.span,{...a,ref:d,style:{pointerEvents:"none"},children:xv(l.value)?y.jsx(y.Fragment,{children:i}):s})});nv.displayName=tv;var mO="SelectIcon",rv=T.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...o}=e;return y.jsx(ce.span,{"aria-hidden":!0,...o,ref:t,children:r||"▼"})});rv.displayName=mO;var vO="SelectPortal",ov=e=>y.jsx(ro,{asChild:!0,...e});ov.displayName=vO;var bn="SelectContent",sv=T.forwardRef((e,t)=>{const n=ln(bn,e.__scopeSelect),[r,o]=T.useState();if(Ve(()=>{o(new DocumentFragment)},[]),!n.open){const s=r;return s?ls.createPortal(y.jsx(iv,{scope:e.__scopeSelect,children:y.jsx(Ls.Slot,{scope:e.__scopeSelect,children:y.jsx("div",{children:e.children})})}),s):null}return y.jsx(av,{...e,ref:t})});sv.displayName=bn;var it=10,[iv,cn]=ir(bn),yO="SelectContentImpl",wO=wn("SelectContent.RemoveScroll"),av=T.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:s,onPointerDownOutside:i,side:a,sideOffset:l,align:c,alignOffset:u,arrowPadding:d,collisionBoundary:p,collisionPadding:f,sticky:g,hideWhenDetached:h,avoidCollisions:b,...w}=e,v=ln(bn,n),[m,C]=T.useState(null),[x,D]=T.useState(null),S=ge(t,$=>C($)),[M,P]=T.useState(null),[O,_]=T.useState(null),V=$s(n),[G,F]=T.useState(!1),L=T.useRef(!1);T.useEffect(()=>{if(m)return nl(m)},[m]),Ga();const k=T.useCallback($=>{const[q,...X]=V().map(z=>z.ref.current),[U]=X.slice(-1),te=document.activeElement;for(const z of $)if(z===te||(z==null||z.scrollIntoView({block:"nearest"}),z===q&&x&&(x.scrollTop=0),z===U&&x&&(x.scrollTop=x.scrollHeight),z==null||z.focus(),document.activeElement!==te))return},[V,x]),j=T.useCallback(()=>k([M,m]),[k,M,m]);T.useEffect(()=>{G&&j()},[G,j]);const{onOpenChange:E,triggerPointerDownPosRef:N}=v;T.useEffect(()=>{if(m){let $={x:0,y:0};const q=U=>{var te,z;$={x:Math.abs(Math.round(U.pageX)-(((te=N.current)==null?void 0:te.x)??0)),y:Math.abs(Math.round(U.pageY)-(((z=N.current)==null?void 0:z.y)??0))}},X=U=>{$.x<=10&&$.y<=10?U.preventDefault():m.contains(U.target)||E(!1),document.removeEventListener("pointermove",q),N.current=null};return N.current!==null&&(document.addEventListener("pointermove",q),document.addEventListener("pointerup",X,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",q),document.removeEventListener("pointerup",X,{capture:!0})}}},[m,E,N]),T.useEffect(()=>{const $=()=>E(!1);return window.addEventListener("blur",$),window.addEventListener("resize",$),()=>{window.removeEventListener("blur",$),window.removeEventListener("resize",$)}},[E]);const[A,I]=Sv($=>{const q=V().filter(te=>!te.disabled),X=q.find(te=>te.ref.current===document.activeElement),U=Cv(q,$,X);U&&setTimeout(()=>U.ref.current.focus())}),B=T.useCallback(($,q,X)=>{const U=!L.current&&!X;(v.value!==void 0&&v.value===q||U)&&(P($),U&&(L.current=!0))},[v.value]),H=T.useCallback(()=>m==null?void 0:m.focus(),[m]),W=T.useCallback(($,q,X)=>{const U=!L.current&&!X;(v.value!==void 0&&v.value===q||U)&&_($)},[v.value]),Z=r==="popper"?Ma:lv,K=Z===Ma?{side:a,sideOffset:l,align:c,alignOffset:u,arrowPadding:d,collisionBoundary:p,collisionPadding:f,sticky:g,hideWhenDetached:h,avoidCollisions:b}:{};return y.jsx(iv,{scope:n,content:m,viewport:x,onViewportChange:D,itemRefCallback:B,selectedItem:M,onItemLeave:H,itemTextRefCallback:W,focusSelectedItem:j,selectedItemText:O,position:r,isPositioned:G,searchRef:A,children:y.jsx(Ms,{as:wO,allowPinchZoom:!0,children:y.jsx(ys,{asChild:!0,trapped:v.open,onMountAutoFocus:$=>{$.preventDefault()},onUnmountAutoFocus:ne(o,$=>{var q;(q=v.trigger)==null||q.focus({preventScroll:!0}),$.preventDefault()}),children:y.jsx(eo,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:$=>$.preventDefault(),onDismiss:()=>v.onOpenChange(!1),children:y.jsx(Z,{role:"listbox",id:v.contentId,"data-state":v.open?"open":"closed",dir:v.dir,onContextMenu:$=>$.preventDefault(),...w,...K,onPlaced:()=>F(!0),ref:S,style:{display:"flex",flexDirection:"column",outline:"none",...w.style},onKeyDown:ne(w.onKeyDown,$=>{const q=$.ctrlKey||$.altKey||$.metaKey;if($.key==="Tab"&&$.preventDefault(),!q&&$.key.length===1&&I($.key),["ArrowUp","ArrowDown","Home","End"].includes($.key)){let U=V().filter(te=>!te.disabled).map(te=>te.ref.current);if(["ArrowUp","End"].includes($.key)&&(U=U.slice().reverse()),["ArrowUp","ArrowDown"].includes($.key)){const te=$.target,z=U.indexOf(te);U=U.slice(z+1)}setTimeout(()=>k(U)),$.preventDefault()}})})})})})})});av.displayName=yO;var xO="SelectItemAlignedPosition",lv=T.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...o}=e,s=ln(bn,n),i=cn(bn,n),[a,l]=T.useState(null),[c,u]=T.useState(null),d=ge(t,S=>u(S)),p=$s(n),f=T.useRef(!1),g=T.useRef(!0),{viewport:h,selectedItem:b,selectedItemText:w,focusSelectedItem:v}=i,m=T.useCallback(()=>{if(s.trigger&&s.valueNode&&a&&c&&h&&b&&w){const S=s.trigger.getBoundingClientRect(),M=c.getBoundingClientRect(),P=s.valueNode.getBoundingClientRect(),O=w.getBoundingClientRect();if(s.dir!=="rtl"){const te=O.left-M.left,z=P.left-te,le=S.left-z,ve=S.width+le,Oe=Math.max(ve,M.width),Be=window.innerWidth-it,ft=Zd(z,[it,Math.max(it,Be-Oe)]);a.style.minWidth=ve+"px",a.style.left=ft+"px"}else{const te=M.right-O.right,z=window.innerWidth-P.right-te,le=window.innerWidth-S.right-z,ve=S.width+le,Oe=Math.max(ve,M.width),Be=window.innerWidth-it,ft=Zd(z,[it,Math.max(it,Be-Oe)]);a.style.minWidth=ve+"px",a.style.right=ft+"px"}const _=p(),V=window.innerHeight-it*2,G=h.scrollHeight,F=window.getComputedStyle(c),L=parseInt(F.borderTopWidth,10),k=parseInt(F.paddingTop,10),j=parseInt(F.borderBottomWidth,10),E=parseInt(F.paddingBottom,10),N=L+k+G+E+j,A=Math.min(b.offsetHeight*5,N),I=window.getComputedStyle(h),B=parseInt(I.paddingTop,10),H=parseInt(I.paddingBottom,10),W=S.top+S.height/2-it,Z=V-W,K=b.offsetHeight/2,$=b.offsetTop+K,q=L+k+$,X=N-q;if(q<=W){const te=_.length>0&&b===_[_.length-1].ref.current;a.style.bottom="0px";const z=c.clientHeight-h.offsetTop-h.offsetHeight,le=Math.max(Z,K+(te?H:0)+z+j),ve=q+le;a.style.height=ve+"px"}else{const te=_.length>0&&b===_[0].ref.current;a.style.top="0px";const le=Math.max(W,L+h.offsetTop+(te?B:0)+K)+X;a.style.height=le+"px",h.scrollTop=q-W+h.offsetTop}a.style.margin=`${it}px 0`,a.style.minHeight=A+"px",a.style.maxHeight=V+"px",r==null||r(),requestAnimationFrame(()=>f.current=!0)}},[p,s.trigger,s.valueNode,a,c,h,b,w,s.dir,r]);Ve(()=>m(),[m]);const[C,x]=T.useState();Ve(()=>{c&&x(window.getComputedStyle(c).zIndex)},[c]);const D=T.useCallback(S=>{S&&g.current===!0&&(m(),v==null||v(),g.current=!1)},[m,v]);return y.jsx(SO,{scope:n,contentWrapper:a,shouldExpandOnScrollRef:f,onScrollButtonChange:D,children:y.jsx("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:C},children:y.jsx(ce.div,{...o,ref:d,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});lv.displayName=xO;var bO="SelectPopperPosition",Ma=T.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:o=it,...s}=e,i=Bs(n);return y.jsx(Cs,{...i,...s,ref:t,align:r,collisionPadding:o,style:{boxSizing:"border-box",...s.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Ma.displayName=bO;var[SO,ic]=ir(bn,{}),Ea="SelectViewport",cv=T.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...o}=e,s=cn(Ea,n),i=ic(Ea,n),a=ge(t,s.onViewportChange),l=T.useRef(0);return y.jsxs(y.Fragment,{children:[y.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),y.jsx(Ls.Slot,{scope:n,children:y.jsx(ce.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:a,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:ne(o.onScroll,c=>{const u=c.currentTarget,{contentWrapper:d,shouldExpandOnScrollRef:p}=i;if(p!=null&&p.current&&d){const f=Math.abs(l.current-u.scrollTop);if(f>0){const g=window.innerHeight-it*2,h=parseFloat(d.style.minHeight),b=parseFloat(d.style.height),w=Math.max(h,b);if(w<g){const v=w+f,m=Math.min(g,v),C=v-m;d.style.height=m+"px",d.style.bottom==="0px"&&(u.scrollTop=C>0?C:0,d.style.justifyContent="flex-end")}}}l.current=u.scrollTop})})})]})});cv.displayName=Ea;var uv="SelectGroup",[CO,RO]=ir(uv),TO=T.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Kt();return y.jsx(CO,{scope:n,id:o,children:y.jsx(ce.div,{role:"group","aria-labelledby":o,...r,ref:t})})});TO.displayName=uv;var dv="SelectLabel",DO=T.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=RO(dv,n);return y.jsx(ce.div,{id:o.id,...r,ref:t})});DO.displayName=dv;var as="SelectItem",[MO,fv]=ir(as),pv=T.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:o=!1,textValue:s,...i}=e,a=ln(as,n),l=cn(as,n),c=a.value===r,[u,d]=T.useState(s??""),[p,f]=T.useState(!1),g=ge(t,v=>{var m;return(m=l.itemRefCallback)==null?void 0:m.call(l,v,r,o)}),h=Kt(),b=T.useRef("touch"),w=()=>{o||(a.onValueChange(r),a.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return y.jsx(MO,{scope:n,value:r,disabled:o,textId:h,isSelected:c,onItemTextChange:T.useCallback(v=>{d(m=>m||((v==null?void 0:v.textContent)??"").trim())},[]),children:y.jsx(Ls.ItemSlot,{scope:n,value:r,disabled:o,textValue:u,children:y.jsx(ce.div,{role:"option","aria-labelledby":h,"data-highlighted":p?"":void 0,"aria-selected":c&&p,"data-state":c?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...i,ref:g,onFocus:ne(i.onFocus,()=>f(!0)),onBlur:ne(i.onBlur,()=>f(!1)),onClick:ne(i.onClick,()=>{b.current!=="mouse"&&w()}),onPointerUp:ne(i.onPointerUp,()=>{b.current==="mouse"&&w()}),onPointerDown:ne(i.onPointerDown,v=>{b.current=v.pointerType}),onPointerMove:ne(i.onPointerMove,v=>{var m;b.current=v.pointerType,o?(m=l.onItemLeave)==null||m.call(l):b.current==="mouse"&&v.currentTarget.focus({preventScroll:!0})}),onPointerLeave:ne(i.onPointerLeave,v=>{var m;v.currentTarget===document.activeElement&&((m=l.onItemLeave)==null||m.call(l))}),onKeyDown:ne(i.onKeyDown,v=>{var C;((C=l.searchRef)==null?void 0:C.current)!==""&&v.key===" "||(dO.includes(v.key)&&w(),v.key===" "&&v.preventDefault())})})})})});pv.displayName=as;var Cr="SelectItemText",hv=T.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,...s}=e,i=ln(Cr,n),a=cn(Cr,n),l=fv(Cr,n),c=gO(Cr,n),[u,d]=T.useState(null),p=ge(t,w=>d(w),l.onItemTextChange,w=>{var v;return(v=a.itemTextRefCallback)==null?void 0:v.call(a,w,l.value,l.disabled)}),f=u==null?void 0:u.textContent,g=T.useMemo(()=>y.jsx("option",{value:l.value,disabled:l.disabled,children:f},l.value),[l.disabled,l.value,f]),{onNativeOptionAdd:h,onNativeOptionRemove:b}=c;return Ve(()=>(h(g),()=>b(g)),[h,b,g]),y.jsxs(y.Fragment,{children:[y.jsx(ce.span,{id:l.textId,...s,ref:p}),l.isSelected&&i.valueNode&&!i.valueNodeHasChildren?ls.createPortal(s.children,i.valueNode):null]})});hv.displayName=Cr;var gv="SelectItemIndicator",mv=T.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return fv(gv,n).isSelected?y.jsx(ce.span,{"aria-hidden":!0,...r,ref:t}):null});mv.displayName=gv;var Pa="SelectScrollUpButton",vv=T.forwardRef((e,t)=>{const n=cn(Pa,e.__scopeSelect),r=ic(Pa,e.__scopeSelect),[o,s]=T.useState(!1),i=ge(t,r.onScrollButtonChange);return Ve(()=>{if(n.viewport&&n.isPositioned){let a=function(){const c=l.scrollTop>0;s(c)};const l=n.viewport;return a(),l.addEventListener("scroll",a),()=>l.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),o?y.jsx(wv,{...e,ref:i,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=n;a&&l&&(a.scrollTop=a.scrollTop-l.offsetHeight)}}):null});vv.displayName=Pa;var Aa="SelectScrollDownButton",yv=T.forwardRef((e,t)=>{const n=cn(Aa,e.__scopeSelect),r=ic(Aa,e.__scopeSelect),[o,s]=T.useState(!1),i=ge(t,r.onScrollButtonChange);return Ve(()=>{if(n.viewport&&n.isPositioned){let a=function(){const c=l.scrollHeight-l.clientHeight,u=Math.ceil(l.scrollTop)<c;s(u)};const l=n.viewport;return a(),l.addEventListener("scroll",a),()=>l.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),o?y.jsx(wv,{...e,ref:i,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=n;a&&l&&(a.scrollTop=a.scrollTop+l.offsetHeight)}}):null});yv.displayName=Aa;var wv=T.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...o}=e,s=cn("SelectScrollButton",n),i=T.useRef(null),a=$s(n),l=T.useCallback(()=>{i.current!==null&&(window.clearInterval(i.current),i.current=null)},[]);return T.useEffect(()=>()=>l(),[l]),Ve(()=>{var u;const c=a().find(d=>d.ref.current===document.activeElement);(u=c==null?void 0:c.ref.current)==null||u.scrollIntoView({block:"nearest"})},[a]),y.jsx(ce.div,{"aria-hidden":!0,...o,ref:t,style:{flexShrink:0,...o.style},onPointerDown:ne(o.onPointerDown,()=>{i.current===null&&(i.current=window.setInterval(r,50))}),onPointerMove:ne(o.onPointerMove,()=>{var c;(c=s.onItemLeave)==null||c.call(s),i.current===null&&(i.current=window.setInterval(r,50))}),onPointerLeave:ne(o.onPointerLeave,()=>{l()})})}),EO="SelectSeparator",PO=T.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return y.jsx(ce.div,{"aria-hidden":!0,...r,ref:t})});PO.displayName=EO;var Oa="SelectArrow",AO=T.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Bs(n),s=ln(Oa,n),i=cn(Oa,n);return s.open&&i.position==="popper"?y.jsx(Rs,{...o,...r,ref:t}):null});AO.displayName=Oa;function xv(e){return e===""||e===void 0}var bv=T.forwardRef((e,t)=>{const{value:n,...r}=e,o=T.useRef(null),s=ge(t,o),i=cO(n);return T.useEffect(()=>{const a=o.current,l=window.HTMLSelectElement.prototype,u=Object.getOwnPropertyDescriptor(l,"value").set;if(i!==n&&u){const d=new Event("change",{bubbles:!0});u.call(a,n),a.dispatchEvent(d)}},[i,n]),y.jsx(nc,{asChild:!0,children:y.jsx("select",{...r,ref:s,defaultValue:n})})});bv.displayName="BubbleSelect";function Sv(e){const t=rt(e),n=T.useRef(""),r=T.useRef(0),o=T.useCallback(i=>{const a=n.current+i;t(a),function l(c){n.current=c,window.clearTimeout(r.current),c!==""&&(r.current=window.setTimeout(()=>l(""),1e3))}(a)},[t]),s=T.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return T.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,o,s]}function Cv(e,t,n){const o=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let i=OO(e,Math.max(s,0));o.length===1&&(i=i.filter(c=>c!==n));const l=i.find(c=>c.textValue.toLowerCase().startsWith(o.toLowerCase()));return l!==n?l:void 0}function OO(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var _O=Jm,kO=ev,IO=nv,NO=rv,jO=ov,FO=sv,VO=cv,LO=pv,$O=hv,BO=mv,zO=vv,HO=yv;function WO({...e}){return y.jsx(_O,{"data-slot":"select",...e})}function UO({...e}){return y.jsx(IO,{"data-slot":"select-value",...e})}function GO({className:e,size:t="default",children:n,...r}){return y.jsxs(kO,{"data-slot":"select-trigger","data-size":t,className:he("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...r,children:[n,y.jsx(NO,{asChild:!0,children:y.jsx(qf,{className:"size-4 opacity-50"})})]})}function YO({className:e,children:t,position:n="popper",...r}){return y.jsx(jO,{children:y.jsxs(FO,{"data-slot":"select-content",className:he("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...r,children:[y.jsx(qO,{}),y.jsx(VO,{className:he("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:t}),y.jsx(XO,{})]})})}function KO({className:e,children:t,...n}){return y.jsxs(LO,{"data-slot":"select-item",className:he("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",e),...n,children:[y.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:y.jsx(BO,{children:y.jsx(Kf,{className:"size-4"})})}),y.jsx($O,{children:t})]})}function qO({className:e,...t}){return y.jsx(zO,{"data-slot":"select-scroll-up-button",className:he("flex cursor-default items-center justify-center py-1",e),...t,children:y.jsx(dx,{className:"size-4"})})}function XO({className:e,...t}){return y.jsx(HO,{"data-slot":"select-scroll-down-button",className:he("flex cursor-default items-center justify-center py-1",e),...t,children:y.jsx(qf,{className:"size-4"})})}const ZO=({options:e,onChange:t})=>y.jsxs(WO,{onValueChange:n=>t(n),defaultValue:e[1].text,children:[y.jsx(GO,{className:"w-[180px]",children:y.jsx(UO,{placeholder:"view"})}),y.jsx(YO,{children:e.map(n=>y.jsx(KO,{value:n.text,children:n.text},n.text))})]}),JO=[{text:"teste1",onClick:()=>console.log("teste1")},{text:"teste2",onClick:()=>console.log("teste2")}],QO=5,e_=0,t_=({side:e,xAxis:t,yAxis:n,updatePosition:r,children:o})=>{const{attributes:s,listeners:i,setNodeRef:a,transform:l,setActivatorNodeRef:c}=za({id:"booking-info-id",data:{type:"booking-info-options"}}),u=bt(p=>p.updateIsDragging),d={transform:`translate3d(${t+((l==null?void 0:l.x)||0)}px, ${n+((l==null?void 0:l.y)||0)}px, 0)`};return Zr({onDragStart(){u(!0)},onDragEnd(p){p.active.id&&r(l)}}),y.jsx(_A,{ref:a,updatePositionStrategy:"optimized",side:e,align:"start",sticky:"always",sideOffset:QO,alignOffset:e_,style:{...d,width:"25rem",zIndex:100},children:y.jsxs("div",{className:"grid gap-3",children:[y.jsx("input",{type:"text",style:{position:"absolute",opacity:0,height:0,width:0}}),y.jsxs("div",{className:"flex justify-end gap-1",children:[y.jsx("div",{ref:c,className:"w-full cursor-move",...s,...i}),y.jsx(lO,{}),y.jsx(tn,{type:"button",variant:"outline",size:"icon",children:y.jsx(Rx,{className:"h-3 w-3"})}),y.jsx(tn,{type:"button",variant:"outline",size:"icon",onClick:()=>{},children:y.jsx(Ex,{className:"h-3 w-3"})}),y.jsx(ZO,{options:JO,onChange:()=>{}})]}),o]})})},Jd={xAxis:0,yAxis:0},Rv=({isEditingOpen:e,side:t,booking:n,onOpenChange:r,children:o})=>{const[s,i]=R.useState({...Jd}),a=bt(f=>f.updateIsDragging),l=R.useMemo(()=>`${J.dateAndHourDateToString(n.startAt)} - ${J.dateAndHourDateToString(n.finishAt)}`,[n.startAt,n.finishAt]),c=R.useMemo(()=>{const f=new Date(n.startAt),g=f.getDate(),h=f.getDay(),b=Vn[f.getMonth()];return y.jsx("span",{children:`${ry[h]}, ${g} ${b}`})},[n.startAt]),u=()=>({backgroundColor:""}),d=f=>{f||console.info("No transform info to show "),i({xAxis:s.xAxis+((f==null?void 0:f.x)||0),yAxis:s.yAxis+((f==null?void 0:f.y)||0)})};Zr({onDragStart(f){const g=f.active.data.current,h=f.active.id,b=g.type==="booking-info-options";h&&b&&a(!0)}});const p=f=>{f===!1&&i({...Jd}),r(f)};return y.jsxs(AA,{open:e,onOpenChange:p,defaultOpen:!1,children:[y.jsx(kA,{style:{width:"100%"},children:y.jsx(OA,{asChild:!0,children:o})}),y.jsx(Ba,{children:y.jsx(t_,{side:t,xAxis:s.xAxis,yAxis:s.yAxis,updatePosition:d,children:y.jsxs("div",{className:"bookingCard_content",children:[y.jsx("span",{style:u(),className:"flex h-4 w-4 translate-y-0 rounded-sm"}),y.jsx("div",{className:"space-y-1",children:y.jsxs("p",{className:"text-sm text-muted-foreground",children:[c," | ",l]})})]})})})]})};Rv.displayName="BookingInfoOptions";const Qd=({booking:e,slotData:t,cardsQuantity:n=1,cardIndex:r=0,lastCard:o=!1,half:s=!1,hoveringAdditionalCardId:i,ref:a})=>{const{bookingViewType:l}=pe(),[c,u]=R.useState({...e});R.useEffect(()=>{e&&u(e)},[e]);const[d,p]=R.useState(!1),f=R.useRef("left"),g=()=>{const D=t.day.split(":")[0].trim();if(l===ie.DAY)f.current="top";else switch(D){case"Mon":case"Sun":f.current="right";break;default:f.current="left";break}p(!0)},h=async D=>{try{u(S=>({...S,finishAt:D}))}catch(S){console.log(S)}},b=async D=>{u(S=>({...S,startAt:D}))},w=async D=>{try{u(S=>({...S,finishAt:D}))}catch(S){console.log(S)}},{state:v,heightStyle:m,topHeightIncrement:C,onResize:x}=Em({booking:c,onAddTime:h,onAddStartTime:b,onSubTime:w,starter:!0});return R.useImperativeHandle(a,()=>({bookingId:e.id}),[e.id]),y.jsx(Rv,{booking:c,onOpenChange:p,side:l===ie.DAY?"top":"left",isEditingOpen:d,children:y.jsx(Jl,{resizableParam:{state:v,onResize:x,resizeHandle:["s","n"]},customClasses:"Draggable",bookingInit:c,slotData:t,topHeightIncrement:C,heightStyle:m,events:{onClick:g},half:s,lastCard:o,cardsQuantity:n,cardIndex:r,hoveringAdditionalCardId:i})})},ef=({bookings:e,blockTimeString:t,slotData:n,hoveringAdditionalCardId:r})=>{if(!e||!(n!=null&&n.day)&&!(n!=null&&n.hour)||!t||!e.length)return null;const o=R.useMemo(()=>e.filter(s=>{const i=J.dateAndHourDateToString(new Date(s.startAt));return J.compareSameDate(new Date(n.day),new Date(s.startAt))&&i.split(":")[1]===t}),[e,t]);if(!(!o||!(o!=null&&o.length)))return o.length===1?y.jsx(Qd,{booking:o[0],slotData:n,hoveringAdditionalCardId:r}):y.jsx(y.Fragment,{children:o.map((s,i)=>y.jsx(Qd,{booking:s,half:!0,slotData:n,lastCard:o.length-1===i,cardsQuantity:o.length,cardIndex:i,hoveringAdditionalCardId:r},s.id))})},n_=({booking:e,onAddTime:t,onStartAtChange:n,onSubTime:r,starter:o=!1})=>{const[s,i]=R.useState({height:Pe,width:Pe}),[a,l]=R.useState(0),c=pe(D=>D.operationalStartTime),u=pe(D=>D.operationalEndTime),d=R.useRef(Pe),p=(D,S)=>{const M=J.timeDiffInMinutes(D,S),P=Math.ceil(M/ko);return-Math.abs((P-1)*2)},[f,g]=R.useState(o?p(e.finishAt,e.startAt):0),h=R.useCallback(()=>{const D=De.adjustedDateMinutes(e.finishAt,"add");return De.isLowerBoundReached(u,D)?!0:(g(S=>De.baseValueLimitMin(S)?vf:S-2),t&&t(D),!1)},[e.finishAt,u,t]),b=R.useCallback(async()=>{const D=De.adjustedDateMinutes(e.finishAt,"remove");g(S=>S+2),r&&r(D)},[e.finishAt,r]),w=R.useCallback(()=>{const D=De.adjustedDateMinutes(e.startAt,"remove");return De.isUpperBoundReached(c,D)?!0:(l(S=>S-2),n&&n(D),!1)},[e.startAt,c,n]),v=R.useCallback(async()=>{const D=De.adjustedDateMinutes(e.startAt,"add");l(S=>S+2),n&&n(D)},[e.startAt,n]),m=R.useCallback((D,{size:S})=>{D.stopPropagation(),D.preventDefault();const M=S.height,P=d.current,O=M-P;Math.abs(O)<10||i(V=>{let G=!1;return O>0?a!==0?v():G=h():f<0?b():G=w(),d.current=M,G?V:{...V,height:M}})},[f,a,h,b,w,v]),C=R.useCallback(()=>{i({height:Pe,width:Pe}),d.current=Pe},[]),x=R.useCallback(()=>{l(0),g(0)},[]);return{state:s,setState:i,resetState:C,resetHeightStyle:x,heightStyle:f,topHeightIncrement:a,onResize:m}},r_=({isDraggingOnClick:e,slotData:t,startAtBoth:n,finishAtBoth:r,onStartAtChange:o,onAddTime:s,onSubTime:i,startCounter:a,showBookingCreationModal:l,ref:c})=>{const u=bt(V=>V.isDragging),d=Ho(V=>V.systemColor),p=Ho(V=>V.isTimeInfoVisible),f=bt(V=>V.updateIsDragging),g=Et(V=>V.updateDate),h=Et(V=>V.updateFinishAtWithOffset),b=He(V=>V.setSelectedNode),{onSlotClick:w}=nn(),v=R.useRef(null),m=R.useMemo(()=>({id:"dragging_booking_preview",startAt:J.convertStringTimeToDateFormat(n),finishAt:J.convertStringTimeToDateFormat(r)}),[n,r]),{state:C,resetState:x,resetHeightStyle:D,heightStyle:S,onResize:M,topHeightIncrement:P}=n_({booking:m,onStartAtChange:o,onAddTime:s,onSubTime:i}),O=()=>{_(r,n)},_=R.useCallback((V,G)=>{var B;if(u&&!V)return;f(!1);const{time:F,key:L,userId:k}=t,j=qn({key:L,time:G||F,userId:k}),E=(B=He.getState().emptySlotNodes)==null?void 0:B.get(j);b(j),E&&E.showEvent(G||F),g(L);const I=h(V||F,V?0:15);w({slotData:t,finishTime:I}),l()},[t,u,w,h]);return R.useImperativeHandle(c,()=>({resetState:x,resetHeightStyle:D})),y.jsx(Mm.Resizable,{className:"slot-resizable",height:C.height,width:C.width,onResizeStart:a,onResizeStop:O,onResize:M,resizeHandles:["se"],draggableOpts:{grid:[35,35]},handleSize:[30,30],maxConstraints:[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY],transformScale:1,children:e?y.jsx("div",{className:"timeInfo_core_dragging",children:y.jsx(Jl,{resize:!0,bookingInit:m,slotData:{day:t.key,hour:"09:00"},topHeightIncrement:P,heightStyle:S,cardContentRef:v,resizableParam:{state:C,onResize:M,customClass:"show-handle"},events:{onUnmount:()=>{}}})}):y.jsx("div",{className:"timeInfo_core_timeParent",children:!u&&y.jsx("span",{className:"timeInfo_core_timeParent_time",style:{color:d,display:p?"initial":"none"},children:t.time})})})},o_=R.forwardRef(({isDraggingOnClick:e,children:t},n)=>{const[r,o]=R.useState(!1),{isDragging:s}=bt(c=>c),{systemColor:i,isTimeInfoVisible:a}=Ho(c=>c),l=e?{backgroundColor:"white",border:"none"}:{};if(R.useImperativeHandle(n,()=>({show:()=>o(!0),hide:()=>o(!1),changeIsOpen:c=>o(c)}),[]),!!r)return y.jsx("div",{style:{...l,border:a&&!s?`1.5px solid ${i}`:"none"},className:he("timeInfo_core",l),children:t})}),s_=({slotData:e,blockTimeString:t,dayHour:n,lastPosition:r,disabledCss:o,events:s,bookings:i,getCreationDialogRef:a,children:l,ref:c})=>{const u=bt(Y=>Y.isDragging),d=bt(Y=>Y.updateIsDragging),{onModalClose:p}=nn(),f=Et(Y=>Y.startAt),g=Et(Y=>Y.finishAt),h=Et(Y=>Y.updateDate),b=Et(Y=>Y.updateStartAt),w=Et(Y=>Y.updateFinishAtWithOffset),v=pe(Y=>Y.bookingViewType),[m,C]=R.useState(!1),[x,D]=R.useState(!1),[S,M]=R.useState([]),[P,O]=R.useState(""),[_,V]=R.useState(e.time),[G,F]=R.useState(J.addMinutesToHour(_,15)),L=R.useRef(null),k=R.useRef(null),j=R.useRef(null),E=R.useRef(null),N=R.useRef(null),A=()=>L.current,I=Y=>{V(J.dateTimeAsString(Y))},B=Y=>{F(J.dateTimeAsString(Y))},H=Y=>{F(J.dateTimeAsString(Y))},W=Y=>{M(fe=>fe.filter(_e=>_e.id!==Y.id))},Z=(Y,fe,_e=!1)=>{const Ft=new Date(Y.finishAt);Ft.setHours(24,0);const We=[{id:Y.id,userId:Y.userId,finishAt:_e?Ft:Y.finishAt,overflow:!0,startAt:Vi.resetToFirstHourNextDay(Y),disabledResize:_e?"full":"half",nodes:fe}];M(We)},K=()=>a(),$=()=>{var Y;(Y=E.current)==null||Y.isModalOpen()},q=()=>{var Y;(Y=K())==null||Y.showCreationModal()},X=()=>{var Y;(Y=j.current)==null||Y.show()},U=()=>{var Y;(Y=j.current)==null||Y.hide()},te=Y=>{var fe;(fe=j.current)==null||fe.changeIsOpen(Y)},z=R.useMemo(()=>({id:"dragging_booking_preview",startAt:J.convertStringTimeToDateFormat(f),finishAt:J.convertStringTimeToDateFormat(g)}),[g,f]),{updateHeightStyle:le,heightStyle:ve}=Em({booking:z}),Oe=(Y,fe)=>!(fe!=null&&fe.length)||!Y?!1:!!fe.find(_e=>J.dateTimeAsString(_e.startAt)===Y.time&&J.compareSameDate(new Date(Y.key),_e.startAt)),Be=R.useCallback(()=>{if(Oe(e,i)||u||$()||m)return;s.onMouseEnterEvent()>=0&&X()},[u,m,s,S,i,Oe]),ft=()=>{F(J.addMinutesToHour(e.time,15))},Rn=()=>{var Y,fe;D(!1),ft(),V(e.time),(Y=A())==null||Y.resetState(),(fe=A())==null||fe.resetHeightStyle()},ot=Y=>{var Ft,We;Rn();const fe=qn(e),_e=(Ft=He.getState().emptySlotNodes)==null?void 0:Ft.get(fe);_e&&_e.closeEvent(),p==null||p(),Y==null||Y.stopPropagation(),Y==null||Y.preventDefault(),(We=K())==null||We.closeModal()},pt=Y=>{Y||ot(),C(Y),te(Y)},Tn=()=>{u||$()||U()},Dn=o!=null&&o.length||x?o:"hovering_slotTrigger_core",ar=R.useCallback(()=>{const{time:Y,key:fe}=e;d(!0),D(!0),h(fe),b(Y),w(Y)},[w,e,h,d,b]),lr=R.useCallback(()=>{D(!1)},[]),zs=()=>{setTimeout(()=>{U(),q(),C(!0)},0)},Hs=R.useCallback(()=>{D(!0),ar()},[ar]);return R.useEffect(()=>{var Y;x&&((Y=N.current)==null||Y.changeCurrentCardResize())},[x]),R.useEffect(()=>{u?document.body.style.cursor="ns-resize":document.body.style.cursor="default"},[u]),R.useEffect(()=>{if(!g||!f)return;const Y=J.convertStringTimeToDateFormat(g),fe=J.convertStringTimeToDateFormat(f);Number.isNaN(Y)||Number.isNaN(fe)||!(Y instanceof Date)||!(fe instanceof Date)||le(Y,fe)},[g,f]),R.useEffect(()=>{if(!m){U();return}k!=null&&k.current&&k.current.scrollIntoView({behavior:"smooth",block:"center"})},[m]),R.useEffect(()=>{i!=null&&i.length&&U(),x&&X()},[i,x]),R.useEffect(()=>{x&&X()},[x]),R.useImperativeHandle(c,()=>({showEvent:Y=>{b(Y),zs()},closeEvent:()=>{var Y;(Y=K())==null||Y.closeModal(),C(!1),U(),lr()},onOpenCloseChange:Y=>{te(Y),C(Y),lr()},addAdditionalBooking:Z,removeFromAdditionalBooking:W,hoveringAdditionalCard:Y=>{O(Y)},clearHoveringCard:()=>{O("")},onCloseCreationModal:ot,onOpenChange:pt})),y.jsxs("div",{ref:e.ref,style:{borderBottom:r?"1px solid #8080807a":"",...e.style},className:he("slotTrigger_core",v===ie.DAY&&"slotTrigger_core_day",Dn),onMouseEnter:Be,onMouseLeave:Tn,children:[y.jsx(o_,{ref:j,isDraggingOnClick:x,children:y.jsx(r_,{ref:L,isDraggingOnClick:x,slotData:e,startAtBoth:_,finishAtBoth:G,onStartAtChange:I,onAddTime:B,onSubTime:H,startCounter:Hs,showBookingCreationModal:q})}),l,m&&y.jsx(Jl,{ref:k,bookingInit:z,slotData:{day:new Date().toISOString(),hour:"09:00"},hoveringAdditionalCardId:P,heightStyle:ve}),y.jsx(ef,{hoveringAdditionalCardId:P,bookings:S,blockTimeString:"00",slotData:n}),y.jsx(ef,{hoveringAdditionalCardId:P,bookings:i,blockTimeString:t,slotData:n})]},e.key)};var i_="Separator",tf="horizontal",a_=["horizontal","vertical"],Tv=T.forwardRef((e,t)=>{const{decorative:n,orientation:r=tf,...o}=e,s=l_(r)?r:tf,a=n?{role:"none"}:{"aria-orientation":s==="vertical"?s:void 0,role:"separator"};return y.jsx(ce.div,{"data-orientation":s,...a,...o,ref:t})});Tv.displayName=i_;function l_(e){return a_.includes(e)}var c_=Tv;function u_({className:e,orientation:t="horizontal",decorative:n=!0,...r}){return y.jsx(c_,{"data-slot":"separator-root",decorative:n,orientation:t,className:he("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",e),...r})}const d_=tc("inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function f_({className:e,variant:t,...n}){return y.jsx("div",{className:he(d_({variant:t}),e),...n})}const p_=({dateToRender:e,isFirstDay:t})=>y.jsx("div",{style:{left:t?"3px":"10px"},className:"first_day_slot",children:y.jsx("span",{children:y.jsx(f_,{children:e})})});class h_{constructor(){un(this,"positionBasedOnSeconds",t=>{const[,n]=t.split(":");if(!t.length)return-3;const r=Number(n);return this.normalizingMinutes(r)});un(this,"normalizingMinutes",t=>t>=0&&t<=15?t*2:t>15&&t<30?(t-15)*2:t>=30&&t<=59?t-30:-3);un(this,"isInitialMinute",t=>t>=0&&t<=8);un(this,"isSameHour",(t,n)=>n.split(":")[0]===t)}}class g_{constructor(){un(this,"is15MinLess",t=>{const n=new Date,[r,o]=t.split(":"),s=new Date(n.getFullYear(),n.getMonth(),n.getDate(),Number(r),Number(o),0),i=new Date(n),a=J.roundMinutes(n.getMinutes());i.setHours(n.getHours(),a,0,0);const l=J.minuteDifference(s,i);return l>30||l<-30});un(this,"normalizeDateNow",t=>{const n=t.getHours(),r=J.roundMinutes(t.getMinutes());return`${n.toString().padStart(2,"0")}:${r.toString().padStart(2,"0")}`})}}const m_=({color:e="#000",isFirstDay:t,slotData:n})=>{const{bookingViewType:r}=pe(),[o,s]=R.useState(""),[i,a]=R.useState(!1),[l,c]=R.useState(!1),u=R.useMemo(()=>{const w=new Date,v=new Date(n.key);return v.getDay()===w.getDay()&&v.getDate()===w.getDate()},[n.key]),d=w=>{s(w)},p=()=>{a(!0)},f=()=>{a(!1)},g=R.useMemo(()=>new h_().positionBasedOnSeconds(o),[n.time,o]),h=R.useMemo(()=>t?"101%":r===ie.DAY?"102%":"100%",[t,r]),b=R.useMemo(()=>u?{top:`${g-2}px`,left:"0px",width:"100%"}:{top:`${g-1}px`,left:"0px",width:"100%"},[u,t,h,g]);if(R.useEffect(()=>{const w=n.time,v=new g_,m=()=>{const x=new Date,D=v.normalizeDateNow(x),S=J.dateAndHourDateToString(x);o!==S&&d(S),c(D===w)};let C;return v.is15MinLess(w)||(C=setInterval(()=>m(),1e3)),()=>clearInterval(C)},[n.time,o]),!!l)return y.jsxs("div",{style:{...b},className:he("timeIndicator_today",u&&h,u&&r===ie.WEEK&&"timeIndicator_today_circle"),onMouseEnter:p,onMouseOut:f,onBlur:()=>{},children:[y.jsx(u_,{className:"focus-effect",style:{height:u&&r===ie.WEEK?"4px":"2px",backgroundColor:e}}),i&&y.jsx(p_,{isFirstDay:t,dateToRender:o})]})},nf={0:0,1:15,2:30,3:45},v_=R.memo(({dayHour:e,userId:t,slotPosition:n,firstDay:r,bookings:o,lastPosition:s})=>{const i=He(D=>D.setEmptySlotNode),a=pe(D=>D.operationalStartTime),l=pe(D=>D.operationalEndTime);_r(D=>D);const c=Et(D=>D.updateStartAt),u=R.useRef(null),d=R.useRef(null),p=()=>u.current,f=R.useMemo(()=>n===0?e.hour:J.addMinuteToHour(e.hour,nf[n]),[n,e.hour]),g=(D,S)=>S?`${D};${S}`:`${D}`,{isOver:h,setNodeRef:b}=Iw({id:g(J.newDateKey(e.day,f),t),data:{accepts:["booking-slots"]}}),w=R.useCallback(D=>{var M;if(!D)return"";const S=t===((M=_r.getState().booking)==null?void 0:M.userId);if(!t||S)return"#0066ff"},[t]),v=R.useMemo(()=>({ref:b,style:{backgroundColor:w(h)},key:J.newDateKey(e.day,f),time:f,userId:t}),[e.day,f,h,w,b]),m=R.useCallback((D,S)=>{if(!D)return;d.current=D;const{emptySlotNodes:M}=He.getState(),P=qn(S);M.get(P)||i(D,S,{startTime:a,endTime:l})},[i,a,l]);R.useEffect(()=>{h&&c(g(J.newDateKey(e.day,f),t))},[h]);const C=()=>d.current,x=R.useCallback(D=>{m(D,{key:v.key,time:v.time,userId:t})},[v,t]);return y.jsxs(y.Fragment,{children:[y.jsx(s_,{ref:x,slotData:v,events:{onMouseEnterEvent:()=>n},lastPosition:s,dayHour:e,bookings:o,blockTimeString:String(nf[n]).padStart(2,"0"),getCreationDialogRef:p,children:y.jsx(m_,{isFirstDay:r,slotData:v})}),y.jsx(Oh,{ref:u,slotTrigger:C,buttonTrigger:y.jsx("div",{},v.key),side:"right"})]})}),y_=4,rf=R.memo(({bookings:e,dayHour:t,user:n,firstDay:r})=>y.jsx("td",{className:"slot",children:new Array(y_).fill(null).map((o,s)=>y.jsx(v_,{slotPosition:s,dayHour:t,userId:n==null?void 0:n.id,firstDay:r,bookings:e,lastPosition:s===3},`${t.day}-${t.hour}-slot-${s}`))},`${t.day}-${t.hour}-slotRow`)),w_=({bookingViewType:e,lunchTimeBlock:t,daysOfWeek:n,users:r,dayViewModeWithUsers:o,hour:s})=>{const i=f=>f===0,{booking:a}=pe(f=>f.bookingBulkData),l=He(f=>f.selectedNode),c=He(f=>f.emptySlotNodes),{finishAt:u,updateFinishAtWithOffset:d}=Et(f=>f),p=R.useCallback((f,g)=>a.filter(h=>{const b=J.dateAndHourDateToString(h.startAt),w=new Date(h.startAt).getDate(),v=new Date(f.day).getDate(),m=f.hour.split(":")[0],x=b.split(":")[0]===m,D=w===v;if(!g){const M=r.find(P=>P.id===h.userId);return x&&D&&(M==null?void 0:M.status)}const S=h.userId===g;return x&&D&&S}),[a,r]);return R.useEffect(()=>{l&&l.split(";")[1]===u&&d(l.split(";")[1])},[l,u]),R.useEffect(()=>{if(l){const f=c.get(l);f==null||f.showEvent(l.split(";")[1])}},[l,c]),e===ie.DAY?r.filter(f=>f.status).map((f,g)=>y.jsx(rf,{dayHour:{day:String(o[g]),hour:s},lunchTimeBlock:t,firstDay:i(g),bookings:p({day:String(o[g]),hour:s},f.id),user:f},`${o[g]}-${s}-slot-content-{${f.id}}`)):n.map((f,g)=>y.jsx(rf,{dayHour:{day:String(f),hour:s},lunchTimeBlock:t,firstDay:i(g),bookings:p({day:String(f),hour:s})},`${f}-${s}-slot-content`))},x_=()=>{const{hours:e,daysOfWeek:t,bookingViewType:n}=pe(ms(i=>({bookingViewType:i.bookingViewType,daysOfWeek:i.daysOfWeek,hours:i.hours}))),r=us(i=>i.users),[o]=R.useState({startAt:"12:00",finishAt:"12:30"}),s=R.useMemo(()=>{const i=[];if(n===ie.DAY)for(let a=0;a<r.length;a++)i.push(t[0]);return i},[n,t,r]);return y.jsx("tbody",{children:e.map(i=>y.jsxs("tr",{children:[y.jsx(QP,{hour:i}),y.jsx(w_,{bookingViewType:n,daysOfWeek:t,hour:i,dayViewModeWithUsers:s,users:r,lunchTimeBlock:o})]},`${i}-content`))})},ac=({day:e,dayOfWeek:t,handleClickDay:n})=>{const r=Ho(o=>o.systemColor);return y.jsxs("div",{style:{width:"100%"},children:[y.jsx("span",{style:{color:J.isTodayDate(e)?r:void 0},children:t}),y.jsx("div",{style:{width:"100%"},children:y.jsx(tn,{type:"button",style:{backgroundColor:J.isTodayDate(e)?r:void 0},className:he("daysOfWeek_indicator",J.isTodayDate(e)?"daysOfWeek_day_today":void 0),variant:"secondary",onClick:()=>n(e),children:J.formatDate(e.toDateString())})})]})},of=({handleClickDay:e})=>{const{bookingViewType:t,daysOfWeek:n}=pe(),r=n[0];if(t!==ie.DAY)return null;const o=zn[new Date(r).getDay()];return y.jsx(ac,{day:r,dayOfWeek:o,handleClickDay:e})},b_=({handleClickDay:e,children:t})=>{const{daysOfWeek:n}=pe();return n.map(r=>{const o=zn[new Date(r).getDay()];return y.jsxs("div",{style:{padding:"0 1rem 0 1.9rem"},className:he("daysOfWeek"),children:[y.jsx("div",{style:{justifySelf:"start",padding:"0 1rem 0 0"},className:"daysOfWeek_parent",children:y.jsx(ac,{day:r,dayOfWeek:o,handleClickDay:e})}),t]},o)})},sf=({handleClickDay:e})=>{const t=pe(o=>o.bookingViewType),n=R.useMemo(()=>t===ie.TABLE?{justifySelf:"start",position:"fixed"}:{},[t]),r=R.useMemo(()=>t===ie.TABLE?"div":"th",[t]);return y.jsxs(r,{style:{...n,justifyItems:t!==ie.TABLE?"center":"start",zIndex:101},className:"time-col",children:[y.jsx(of,{handleClickDay:e}),t!==ie.TABLE&&y.jsx("div",{style:{height:"1.5rem"}}),t===ie.TABLE&&y.jsx(b_,{handleClickDay:e,children:y.jsx(of,{handleClickDay:e})})]},"emptyBlocks")},S_=R.memo(({handleClickDay:e})=>{const t=pe(l=>l.bookingViewType),n=pe(l=>l.daysOfWeek),r=us(l=>l.users),{resetSelectedNode:o,resetNodes:s}=He(l=>l),{updateMonthMessage:i,updateHeaderDateLabel:a}=Wo(l=>l);if(R.useEffect(()=>{switch(t){case ie.DAY:{s(),o(),a(n[0]);break}case ie.WEEK:{const l=J.generateWeekMonthLabel(n);i({monthMessage:l})}}},[n,t]),t===ie.DAY){const l=r.filter(d=>d.status);return new Array(l.length).fill("").map(()=>n[0]).map((d,p)=>({day:d,user:l[p]})).map(d=>{var h;if(d instanceof Date)return;const{day:p,user:f}=d,g=zn[new Date(p).getDay()];return y.jsx("th",{style:{borderBottom:"1px solid #8080807a"},className:"daysOfWeek",children:y.jsx("div",{className:"daysOfWeek_parent",children:(h=f==null?void 0:f.profile)==null?void 0:h.name})},`${g}-${f.id}`)})}if(t===ie.WEEK)return n.map(l=>{const c=zn[new Date(l).getDay()];return y.jsx("th",{style:{borderBottom:"1px solid #8080807a"},className:he("daysOfWeek"),children:y.jsxs("div",{className:"daysOfWeek_parent",children:[y.jsx(ac,{day:l,dayOfWeek:c,handleClickDay:e}),y.jsx("div",{style:{height:"1.6rem"}})]})},c)})}),af=({children:e})=>{const t=pe(l=>l.setTodayDay),n=pe(l=>l.setBookingViewType),r=pe(l=>l.bookingViewType),o=Wo(l=>l.updateMonthMessage),{onViewTypeChange:s}=yf(),{onHeaderDayClick:i}=nn(),a=R.useCallback(l=>{const c=()=>{n(ie.WEEK),s(ie.WEEK)},u=()=>r===ie.DAY;if(i==null||i(l,r),u())return c();const d=t(l);if(!d)return;const p={month:d.getMonth(),fullYear:d.getFullYear(),monthMessage:Vn[d.getMonth()]};o(p),n(ie.DAY)},[r,t,o,n]);return r===ie.TABLE?y.jsxs(y.Fragment,{children:[y.jsx(sf,{handleClickDay:a}),e]}):y.jsxs("table",{className:"daysOfWeek_table",children:[y.jsx("thead",{children:y.jsxs("tr",{children:[y.jsx(sf,{handleClickDay:a}),y.jsx(S_,{handleClickDay:a})]})}),e]})},lf={distance:5},C_=({tableAccessors:e})=>{const t=Iy(yc($f,{activationConstraint:lf}),yc(Bf,{activationConstraint:lf})),n=pe(m=>m.bookingBulkData),r=pe(m=>m.bookingViewType),o=pe(m=>m.setBookingBulkData),s=pe(m=>m.optimisticCardUpdate),i=us(m=>m.users),a=_r(m=>m.updateBooking),l=_r(m=>m.updateSlotData),c=He(m=>m.resetNodes),u=He(m=>m.resetSelectedNode),d=He(m=>m.emptySlotNodes),{bookings:p,onCardDropCallback:f}=nn(),g=R.useCallback((m,C)=>{const x=qn({key:C.toDateString(),time:mf}),D=d.get(x);if(!D){console.warn("SlotNode not found:",x);return}D.removeFromAdditionalBooking(m)},[d]),h=m=>{const C=J.calculateDaysDifference(m.finishAt,m.startAt),x=J.buildFutureDateList(m,C);for(const D of x)g(m,D)},b=async(m,C,x)=>{try{const{startAt:D,finishAt:S}=J.bookingTimeRange(m,C);s(m,D,S,x),await f(m,C,x,{id:m.id,startAt:D,finishAt:S}),h(m)}catch(D){console.warn(D)}},w=m=>{const{over:C,active:x}=m;if(C&&x){const D=C.data.current,S=x.data.current;if(S&&D&&D.accepts.includes(S.type)&&S.booking.id&&C.id){const M=p.find(O=>O.id===S.booking.id);if(!M)return;const[P]=String(C.id).split(";");b(M,P,S.slotData),l(null),a(null)}}},v=R.useCallback(m=>{const{active:C}=m;C.data.current&&(a(C.data.current.booking),l(C.data.current.slotData)),C.id},[a,l]);return R.useEffect(()=>{o({user:SR,booking:p})},[p,o]),R.useEffect(()=>{(r===ie.DAY||r===ie.WEEK)&&(u(),c())},[r,c,u]),r===ie.DAY||r===ie.WEEK?y.jsx(Ba,{onDragEnd:w,onDragStart:v,sensors:t,modifiers:[bR],children:y.jsxs(af,{children:[y.jsx(x_,{}),y.jsx(iP,{})]})}):y.jsx(af,{children:y.jsx("div",{style:{display:"flex",flexDirection:"column",rowGap:"1rem",margin:"1rem",marginTop:"5rem"},children:i.filter(m=>m.status).map(m=>y.jsx(JP,{user:m,bookings:n.booking,tableAccessors:e},m.id))})})},R_=({handleWeekChange:e})=>y.jsxs("div",{className:"header_day_actions",children:[y.jsx(tn,{className:"header_day_actions_button",variant:"ghost",size:"lg",onClick:()=>e("previous"),children:y.jsx(ax,{className:"header_day_actions_button_icon"})}),y.jsx(tn,{className:"header_day_actions_button",variant:"ghost",size:"lg",onClick:()=>e("next"),children:y.jsx(cx,{className:"header_day_actions_button_icon"})})]}),_a=({children:e,content:t})=>y.jsx(sc,{children:y.jsxs(qm,{children:[y.jsx(Xm,{asChild:!0,children:e}),y.jsx(Zm,{sideOffset:3,side:"bottom",className:"border border-input bg-popover px-2 py-1 text-xs text-muted-foreground z-100",children:t})]})}),T_=({onClick:e,showCreationModal:t})=>y.jsxs(y.Fragment,{children:[y.jsx("div",{className:"daysOfWeek_emptySlot",children:y.jsx(_a,{content:"Criar novo agendamento",children:y.jsx(tn,{variant:"ghost",onClick:t,children:y.jsx(px,{})})})}),y.jsx(_a,{content:"Ir para hoje",children:y.jsx(tn,{variant:"ghost",onClick:e,children:y.jsx(Dx,{style:{paddingTop:"0.8px"}})})})]}),cf=({handleShowCreationModal:e})=>{const{todayWeek:t,bookingViewType:n,setTodayDay:r,nextWeek:o,previousWeek:s,setDays:i}=pe(),{onTodayClick:a,onDayChange:l}=nn(),{resetSelectedNode:c,resetNodes:u}=He(w=>w),d=()=>i(1),p=()=>i(-1),f=w=>w==="next"?o():s(),g=w=>w==="next"?d():p(),h=w=>{switch(u(),c(),n){case ie.TABLE:case ie.DAY:{const v=g(w);l(v,w);break}case ie.WEEK:{const v=f(w),{firstDayOfWeek:m,lastDayOfWeek:C}=J.firstAndLastWeekDays(v);l([m,C],w);break}}},b=()=>{const w=new Date;switch(a(w),n){case ie.TABLE:case ie.DAY:{r(w);break}default:{t();break}}};return y.jsxs("div",{className:"header_actions",children:[y.jsx(R_,{handleWeekChange:h}),y.jsx(T_,{onClick:b,showCreationModal:e})]})},D_=({code:e})=>y.jsx("p",{className:"text-sm text-muted-foreground",children:y.jsxs("kbd",{className:"pointer-events-none inline-flex h-5 select-none items-center gap-1 rounded border bg-muted px-1.5 font-mono text-[10px] font-medium text-muted-foreground opacity-100",children:[y.jsx("span",{className:"text-xs",children:"⌘"}),e]})}),M_={[ie.DAY]:y.jsx(xx,{width:"90%"}),[ie.WEEK]:y.jsx(mx,{width:"90%"}),[ie.TABLE]:y.jsx(nx,{width:"90%"}),[ie.MONTH]:y.jsx(Sx,{width:"90%"})},uf=()=>{const{bookingViewType:e}=pe(),{onViewTypeChange:t}=yf(),{viewModes:n}=nn(),r=R.useCallback(a=>a===e?"custom":"outline",[e]),o=R.useCallback(a=>{a!==e&&t(a)},[t]),s=R.useMemo(()=>n.map(a=>({variant:r(a),icon:M_[a],events:l=>o(l),label:a})),[n,o,r]),i=R.useMemo(()=>{const a=s.find(l=>l.label===e);if(a)return a.icon},[e,s]);return y.jsxs(fl,{children:[y.jsx(pl,{children:y.jsx(_a,{content:"Mudar visualização",children:y.jsx(tn,{variant:"ghost",asChild:!0,children:i||y.jsx(ex,{className:"w-full h-full"})})})}),y.jsx(hl,{children:s.map(a=>y.jsxs(fR,{checked:a.label===e,onCheckedChange:()=>a.events(a.label),className:"flex flex-row justify-between gap-6",children:[y.jsxs("div",{className:"flex flex-row gap-4",children:[a.icon,y.jsx("div",{children:oy.capitalize(a.label)})]}),y.jsx(D_,{code:"o"})]},a.label))})]})},E_=566,P_=({getBookingModalCreateRef:e})=>{const t=pe(a=>a.todayWeek),n=Wo(a=>a.fullYear),r=Wo(a=>a.monthMessage),[o,s]=R.useState(!1),i=()=>{var a;(a=e())==null||a.showCreationModal()};return R.useEffect(()=>{t()},[t]),R.useEffect(()=>{const a=()=>{if(typeof window>"u")return!1;window.innerWidth<=E_?s(!0):s(!1)};return a(),window.addEventListener("resize",a),()=>window.removeEventListener("resize",a)},[]),y.jsx(y.Fragment,{children:o?y.jsxs("div",{className:"headerCalendar_mobile",children:[y.jsx("div",{className:"headerCalendar_mobile_month",children:y.jsxs("span",{className:"headerCalendar_mobile_month_span",children:[r," ",n]})}),y.jsxs("div",{className:"headerCalendar_mobile_actions",children:[y.jsx(cf,{handleShowCreationModal:i}),y.jsx(uf,{})]})]}):y.jsxs("div",{className:"headerCalendar",children:[y.jsx("div",{className:"headerCalendar_actions",children:y.jsx(cf,{handleShowCreationModal:i})}),y.jsx("div",{className:"headerCalendar_month",children:y.jsxs("span",{className:"headerCalendar_month_span",children:[r," ",n]})}),y.jsx(uf,{})]})})},A_=({viewModes:e,startView:t,createBookingModal:n,onChangeViewType:r,onCardDropCallback:o,onCardResizeEnd:s,onDayChange:i,onHeaderDayClick:a,onTodayClick:l,onSlotClick:c,onModalClose:u,bookings:d,isTimeInfoVisible:p,systemColor:f,tableAccessors:g,users:h=[],operationalHours:b,ref:w})=>{const[v,m]=R.useState(!1),C=R.useRef(null),x=R.useRef(null),D=R.useRef(null),{setBookingViewType:S,setWeekAndViewType:M,setTodayDayAndViewType:P,bookingViewType:O,setTodayDay:_,todayWeek:V,configure:G}=pe(),{setSelectedNode:F}=He(N=>N),L=()=>D.current,k=N=>{var A;(A=C==null?void 0:C.current)==null||A.updateFinishAt(N)},j=N=>{_(new Date(N))},E=N=>{V(new Date(N))};return R.useEffect(()=>{G({startTime:b.start,endTime:b.finish})},[b]),R.useEffect(()=>{r(O)},[O]),R.useEffect(()=>{t&&S(t)},[t]),R.useImperativeHandle(w,()=>({updateViewType:N=>S(N),updateWeekAndViewType:N=>M(N),updateTodayDayAndViewType:N=>P(N),updateSelectedNode:N=>{setTimeout(()=>{F(N)},10)},updateFinishAt:N=>k(N),changeLoading:N=>m(N),goToDay:N=>j(N),goToWeek:N=>E(N),toggleUserVisibility:(N,A)=>{var I;(I=x.current)==null||I.updateDisabledUser(N,A)}})),y.jsx(my,{isTimeInfoVisible:p,systemColor:f,children:y.jsx(dy,{...Cf,children:y.jsx(fy,{createBookingModal:n,viewModes:e,onHeaderDayClick:a,onTodayClick:l,onCardDropCallback:o,onCardResizeEnd:s,onDayChange:i,onSlotClick:c,onModalClose:u,bookings:d,children:y.jsx(cy,{ref:C,...$i,children:y.jsx(yy,{...Rf,children:y.jsxs(by,{ref:x,users:h,children:[y.jsx(P_,{getBookingModalCreateRef:L}),y.jsx(Oh,{ref:D}),y.jsx("div",{className:"calendar-wrapper",children:y.jsx(C_,{tableAccessors:g})}),y.jsx(Lv,{color:"#000000aa",loading:v,cssOverride:{position:"absolute",top:"50%",left:"50%",transform:"translate('-50%', '-50%')",zIndex:100},size:15,"aria-label":"Loading Spinner","data-testid":"GridLoader"})]})})})})})})},O_=e=>{const t=R.useRef(null),n=()=>{if(!(t!=null&&t.current))throw new Iv};return{getCalendar:()=>y.jsx(A_,{ref:t,...e}),updateViewType:f=>{var g;n(),(g=t.current)==null||g.updateViewType(f)},updateWeekAndViewType:f=>{var g;return n(),(g=t.current)==null?void 0:g.updateWeekAndViewType(f)},updateTodayDayAndViewType:f=>{var g;return n(),(g=t.current)==null?void 0:g.updateTodayDayAndViewType(f)},updateSelectedNode:f=>{var g;n(),(g=t.current)==null||g.updateSelectedNode(f)},updateFinishAt:f=>{var g;n(),(g=t.current)==null||g.updateFinishAt(f)},changeLoading:f=>{var g;n(),(g=t.current)==null||g.changeLoading(f)},goToDay:f=>{var g;n(),(g=t.current)==null||g.goToDay(f)},goToWeek:f=>{var g;n(),(g=t.current)==null||g.goToWeek(f)},toggleUserVisibility:(f,g)=>{var h;n(),(h=t.current)==null||h.toggleUserVisibility(f,g)}}};exports.useCalendarInstance=O_;
|