react-beauty-calendar 1.2.9 → 1.3.0
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 +1 -1
- package/dist/build/assets/main.css +1 -1
- package/dist/build/main.cjs.js +39 -39
- package/dist/build/main.es.js +5831 -6044
- package/dist/context/global/language/useLanguage.d.ts +1 -2
- package/dist/core/calendar/CalendarHolder.d.ts +1 -4
- package/dist/core/header-calendar/DaysOfWeek.d.ts +3 -6
- package/dist/core/slots/actualTimeIndicator/ActualTimeIndicator.d.ts +1 -6
- package/dist/utils/props.d.ts +5 -1
- package/package.json +1 -3
- package/dist/context/i18n/I18n.d.ts +0 -3
- package/dist/locales/en_US.json.d.ts +0 -6
- package/dist/locales/pt_BR.json.d.ts +0 -6
package/dist/build/main.cjs.js
CHANGED
|
@@ -1,113 +1,113 @@
|
|
|
1
|
-
"use strict";require('./assets/main.css');var Bg=Object.defineProperty;var zg=(e,t,n)=>t in e?Bg(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Xt=(e,t,n)=>zg(e,typeof t!="symbol"?t+"":t,n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const x=require("react/jsx-runtime"),E=require("react"),vt=require("react-dom");function Md(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 D=Md(E),Ho=Md(vt);class Wg extends ReferenceError{constructor(t="Calendar instance is not initialized. Ensure the calendar is rendered before calling this method."){super(t),this.name="ReferenceErrorCustom"}}const jc=e=>{let t;const n=new Set,r=(l,u)=>{const d=typeof l=="function"?l(t):l;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:()=>c,subscribe:l=>(n.add(l),()=>n.delete(l))},c=t=e(r,o,a);return a},Or=e=>e?jc(e):jc,Hg=e=>e;function Uo(e,t=Hg){const n=E.useSyncExternalStore(e.subscribe,()=>t(e.getState()),()=>t(e.getInitialState()));return E.useDebugValue(n),n}const Lc=e=>{const t=Or(e),n=r=>Uo(t,r);return Object.assign(n,t),n},Yo=e=>e?Lc(e):Lc,Rd={selectedDate:new Date,isBookingLoading:!1,bookingModalState:!1,selectedHour:"",cardsRef:new Map},Ug=e=>Or(t=>({...Rd,...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)}))})),Pd=6e4,Yg=36e5,Vc=Symbol.for("constructDateFrom");function ra(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&Vc in e?e[Vc](t):e instanceof Date?new e.constructor(t):new Date(t)}function ci(e,t){return ra(e,e)}function Ad(e,...t){const n=ra.bind(null,t.find(r=>typeof r=="object"));return t.map(n)}function Kg(e,t,n){const r=ci(e);return r.setTime(r.getTime()+t*Pd),r}function Od(e){return t=>{const r=(e?Math[e]:Math.trunc)(t);return r===0?0:r}}function Gg(e,t,n){const[r,o]=Ad(n==null?void 0:n.in,e,t),s=(+r-+o)/Yg;return Od(n==null?void 0:n.roundingMethod)(s)}function qg(e,t){return+ci(e)-+ci(t)}function Xg(e,t,n){const r=qg(e,t)/Pd;return Od(n==null?void 0:n.roundingMethod)(r)}function Zg(e,t){const[n,r]=Ad(e,t.start,t.end);return{start:n,end:r}}function Jg(e,t){const{start:n,end:r}=Zg(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 c=[];for(;+i<=s;)c.push(ra(n,i)),i.setHours(i.getHours()+a);return o?c.reverse():c}function Qg(e,t,n){return Kg(e,-t)}function ev(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function tv(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 go={exports:{}},nv=go.exports,Fc;function rv(){return Fc||(Fc=1,function(e,t){(function(n,r){e.exports=r()})(nv,function(){var n=1e3,r=6e4,o=36e5,s="millisecond",i="second",a="minute",c="hour",l="day",u="week",d="month",f="quarter",h="year",S="date",m="Invalid Date",w=/^(\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,p={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(j){var F=["th","st","nd","rd"],_=j%100;return"["+j+(F[(_-20)%10]||F[_]||F[0])+"]"}},g=function(j,F,_){var N=String(j);return!N||N.length>=F?j:""+Array(F+1-N.length).join(_)+j},C={s:g,z:function(j){var F=-j.utcOffset(),_=Math.abs(F),N=Math.floor(_/60),P=_%60;return(F<=0?"+":"-")+g(N,2,"0")+":"+g(P,2,"0")},m:function j(F,_){if(F.date()<_.date())return-j(_,F);var N=12*(_.year()-F.year())+(_.month()-F.month()),P=F.clone().add(N,d),I=_-P<0,O=F.clone().add(N+(I?-1:1),d);return+(-(N+(_-P)/(I?P-O:O-P))||0)},a:function(j){return j<0?Math.ceil(j)||0:Math.floor(j)},p:function(j){return{M:d,y:h,w:u,d:l,D:S,h:c,m:a,s:i,ms:s,Q:f}[j]||String(j||"").toLowerCase().replace(/s$/,"")},u:function(j){return j===void 0}},v="en",M={};M[v]=p;var b="$isDayjsObject",T=function(j){return j instanceof z||!(!j||!j[b])},R=function j(F,_,N){var P;if(!F)return v;if(typeof F=="string"){var I=F.toLowerCase();M[I]&&(P=I),_&&(M[I]=_,P=I);var O=F.split("-");if(!P&&O.length>1)return j(O[0])}else{var V=F.name;M[V]=F,P=V}return!N&&P&&(v=P),P||!N&&v},k=function(j,F){if(T(j))return j.clone();var _=typeof F=="object"?F:{};return _.date=j,_.args=arguments,new z(_)},A=C;A.l=R,A.i=T,A.w=function(j,F){return k(j,{locale:F.$L,utc:F.$u,x:F.$x,$offset:F.$offset})};var z=function(){function j(_){this.$L=R(_.locale,null,!0),this.parse(_),this.$x=this.$x||_.x||{},this[b]=!0}var F=j.prototype;return F.parse=function(_){this.$d=function(N){var P=N.date,I=N.utc;if(P===null)return new Date(NaN);if(A.u(P))return new Date;if(P instanceof Date)return new Date(P);if(typeof P=="string"&&!/Z$/i.test(P)){var O=P.match(w);if(O){var V=O[2]-1||0,W=(O[7]||"0").substring(0,3);return I?new Date(Date.UTC(O[1],V,O[3]||1,O[4]||0,O[5]||0,O[6]||0,W)):new Date(O[1],V,O[3]||1,O[4]||0,O[5]||0,O[6]||0,W)}}return new Date(P)}(_),this.init()},F.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()},F.$utils=function(){return A},F.isValid=function(){return this.$d.toString()!==m},F.isSame=function(_,N){var P=k(_);return this.startOf(N)<=P&&P<=this.endOf(N)},F.isAfter=function(_,N){return k(_)<this.startOf(N)},F.isBefore=function(_,N){return this.endOf(N)<k(_)},F.$g=function(_,N,P){return A.u(_)?this[N]:this.set(P,_)},F.unix=function(){return Math.floor(this.valueOf()/1e3)},F.valueOf=function(){return this.$d.getTime()},F.startOf=function(_,N){var P=this,I=!!A.u(N)||N,O=A.p(_),V=function(X,U){var ne=A.w(P.$u?Date.UTC(P.$y,U,X):new Date(P.$y,U,X),P);return I?ne:ne.endOf(l)},W=function(X,U){return A.w(P.toDate()[X].apply(P.toDate("s"),(I?[0,0,0,0]:[23,59,59,999]).slice(U)),P)},H=this.$W,L=this.$M,Y=this.$D,K="set"+(this.$u?"UTC":"");switch(O){case h:return I?V(1,0):V(31,11);case d:return I?V(1,L):V(0,L+1);case u:var $=this.$locale().weekStart||0,q=(H<$?H+7:H)-$;return V(I?Y-q:Y+(6-q),L);case l:case S:return W(K+"Hours",0);case c:return W(K+"Minutes",1);case a:return W(K+"Seconds",2);case i:return W(K+"Milliseconds",3);default:return this.clone()}},F.endOf=function(_){return this.startOf(_,!1)},F.$set=function(_,N){var P,I=A.p(_),O="set"+(this.$u?"UTC":""),V=(P={},P[l]=O+"Date",P[S]=O+"Date",P[d]=O+"Month",P[h]=O+"FullYear",P[c]=O+"Hours",P[a]=O+"Minutes",P[i]=O+"Seconds",P[s]=O+"Milliseconds",P)[I],W=I===l?this.$D+(N-this.$W):N;if(I===d||I===h){var H=this.clone().set(S,1);H.$d[V](W),H.init(),this.$d=H.set(S,Math.min(this.$D,H.daysInMonth())).$d}else V&&this.$d[V](W);return this.init(),this},F.set=function(_,N){return this.clone().$set(_,N)},F.get=function(_){return this[A.p(_)]()},F.add=function(_,N){var P,I=this;_=Number(_);var O=A.p(N),V=function(L){var Y=k(I);return A.w(Y.date(Y.date()+Math.round(L*_)),I)};if(O===d)return this.set(d,this.$M+_);if(O===h)return this.set(h,this.$y+_);if(O===l)return V(1);if(O===u)return V(7);var W=(P={},P[a]=r,P[c]=o,P[i]=n,P)[O]||1,H=this.$d.getTime()+_*W;return A.w(H,this)},F.subtract=function(_,N){return this.add(-1*_,N)},F.format=function(_){var N=this,P=this.$locale();if(!this.isValid())return P.invalidDate||m;var I=_||"YYYY-MM-DDTHH:mm:ssZ",O=A.z(this),V=this.$H,W=this.$m,H=this.$M,L=P.weekdays,Y=P.months,K=P.meridiem,$=function(U,ne,B,ie){return U&&(U[ne]||U(N,I))||B[ne].slice(0,ie)},q=function(U){return A.s(V%12||12,U,"0")},X=K||function(U,ne,B){var ie=U<12?"AM":"PM";return B?ie.toLowerCase():ie};return I.replace(y,function(U,ne){return ne||function(B){switch(B){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 $(P.monthsShort,H,Y,3);case"MMMM":return $(Y,H);case"D":return N.$D;case"DD":return A.s(N.$D,2,"0");case"d":return String(N.$W);case"dd":return $(P.weekdaysMin,N.$W,L,2);case"ddd":return $(P.weekdaysShort,N.$W,L,3);case"dddd":return L[N.$W];case"H":return String(V);case"HH":return A.s(V,2,"0");case"h":return q(1);case"hh":return q(2);case"a":return X(V,W,!0);case"A":return X(V,W,!1);case"m":return String(W);case"mm":return A.s(W,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 O}return null}(U)||O.replace(":","")})},F.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},F.diff=function(_,N,P){var I,O=this,V=A.p(N),W=k(_),H=(W.utcOffset()-this.utcOffset())*r,L=this-W,Y=function(){return A.m(O,W)};switch(V){case h:I=Y()/12;break;case d:I=Y();break;case f:I=Y()/3;break;case u:I=(L-H)/6048e5;break;case l:I=(L-H)/864e5;break;case c:I=L/o;break;case a:I=L/r;break;case i:I=L/n;break;default:I=L}return P?I:A.a(I)},F.daysInMonth=function(){return this.endOf(d).$D},F.$locale=function(){return M[this.$L]},F.locale=function(_,N){if(!_)return this.$L;var P=this.clone(),I=R(_,N,!0);return I&&(P.$L=I),P},F.clone=function(){return A.w(this.$d,this)},F.toDate=function(){return new Date(this.valueOf())},F.toJSON=function(){return this.isValid()?this.toISOString():null},F.toISOString=function(){return this.$d.toISOString()},F.toString=function(){return this.$d.toUTCString()},j}(),G=z.prototype;return k.prototype=G,[["$ms",s],["$s",i],["$m",a],["$H",c],["$W",l],["$M",d],["$y",h],["$D",S]].forEach(function(j){G[j[1]]=function(F){return this.$g(F,j[0],j[1])}}),k.extend=function(j,F){return j.$i||(j(F,z,k),j.$i=!0),k},k.locale=R,k.isDayjs=T,k.unix=function(j){return k(1e3*j)},k.en=M[v],k.Ls=M,k.p={},k})}(go)),go.exports}var ov=rv();const $c=ev(ov),oe={DAY:"day",WEEK:"week",TABLE:"table",MONTH:"month"},jt=600,li=15,oa="00:00",Mn=["Janeiro","Fevereiro","Março","Abril","Maio","Junho","Julho","Agosto","Setembro","Outubro","Novembro","Dezembro"],ui=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],sv=["Domingo","Segunda","Terça","Quarta","Quinta","Sexta","Sábado"],Z={findIndexToStart(e=new Date){const t=ui[e.getDay()];return this.findActualDayIndex(t)},findActualDayIndex(e){return ui.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=Z.getTimeDiff(e.startAt,e.finishAt),r=Z.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 Xg(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`${Mn[e[0].getMonth()].slice(0,3)} - ${Mn[e[1].getMonth()].slice(0,3)}`},timeDiffInSeconds(e,t){const n=$c(e),r=$c(t);return n.diff(r)/6e4},subtractMinutes(e,t){return Qg(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=Z.hourMinutesStringToDate(e),r=Z.addMinutesToDate(n,t);return Z.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}=Z.firstAndLastWeekDays(e),r=t.getMonth();return r!==n.getMonth()?Z.shortMonthDescription(t,n):Mn[r]}},iv=(e,t)=>{const r=Jg({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`)},kd=1,_d=24,av=Z.generateWeekDays(),cv=(e,t)=>({hours:iv(kd,_d),daysOfWeek:av.week,timesRendered:new Map,setTodayDay:n=>{const r=Z.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}=Z.generateWeekDays(n);return r=s,{...o,daysOfWeek:s}}),r},nextWeek:()=>{const n=Z.addDay(t().getWeek().lastDayOfWeek,1);let r=[];const{week:o}=Z.generateWeekDays(n);return r=o,e(s=>({...s,daysOfWeek:o})),r},previousWeek:()=>{const n=Z.addDay(t().getWeek().firstDayOfWeek,-1);let r=[];const{week:o}=Z.generateWeekDays(n);return r=o,e(s=>({...s,daysOfWeek:o})),r},setDays:n=>{const r=t().daysOfWeek[0];if(!r)return[];const o=Z.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}},addTimesRendered:(n,r)=>{e(o=>{const s=o.timesRendered;return s.get(r)?{...o}:(s.set(r,n),{...o,timeRenderedPrev:s})})}}),sn=e=>{const t=new Date(e.key),n=t.getDate().toString().padStart(2,"0"),r=(t.getMonth()+1).toString().padStart(2,"0");return`${`${t.getFullYear()}-${r}-${n}`};${e.time}`},Tt=Yo((e,t)=>({emptySlotNodes:new Map,selectedNode:"",setEmptySlotNode:(n,r)=>{e(o=>{const s=new Map(o.emptySlotNodes),d=(Gg(new Date(`1970/01/01 ${_d}`),new Date(2014,6,0,Number(kd),0))+2)*4*7-1;s.size>d&&s.clear();const h=sn(r);return s.set(h,n),{...o,emptySlotNodes:s}})},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}})},resetNodes:()=>{e(n=>{const r=new Map(n.emptySlotNodes);return r.clear(),{...n,emptySlotNodes:r}})},resetSelectedNode:()=>e(n=>({...n,selectedNode:""}))})),di={date:"",startAt:"",finishAt:"",slotStartAt:""},lv=e=>Or((t,n)=>({...di,...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=Z.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(di)})),uv=E.createContext(null),Nd=E.createContext(void 0),Lt=()=>{const e=E.use(Nd);if(!e)throw new Error("useBookingModal must be used within a BookingModalProvider");return e},dv=(e,t)=>({users:[],bookingViewType:"week",bookingBulkData:{user:{id:"",profile:{id:"",name:""}},booking:[]},updateUsers:n=>e(r=>({...r,users:n})),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)}}),fv=(e,t)=>({setWeekAndViewType:n=>{const r=t().todayWeek(n);return t().setBookingViewType(oe.WEEK),Z.firstAndLastWeekDays(r)},setTodayDayAndViewType:n=>{const r=t().setTodayDay(n);return t().setBookingViewType(oe.DAY),r}}),Le=Yo()((...e)=>({...cv(...e),...dv(...e),...fv(...e)})),Id=()=>{const{setBookingViewType:e,todayWeek:t,setTodayDay:n,daysOfWeek:r,getWeek:o}=Le();return{onViewTypeChange:i=>{switch(i){case oe.DAY:{e(oe.DAY),n(r[0]);break}case oe.WEEK:{e(oe.WEEK),t(o().firstDayOfWeek);break}case oe.TABLE:{e(oe.TABLE),n(o().firstDayOfWeek);break}}}}},jd=E.createContext(null),Ld=e=>{const t=E.use(jd);if(!t)throw new Error("Missing useMonthDescription must be within a MonthDescriptionProvider");return Uo(t,e)},Vd=E.createContext(null),hv=({children:e,ref:t,...n})=>{const r=E.useRef(null);r.current||(r.current=lv(n));const o=s=>{var i;(i=r.current)==null||i.getState().updateFinishAt(s)};return E.useImperativeHandle(t,()=>({updateFinishAt:o})),x.jsx(Vd,{value:r.current,children:e})},Fd=e=>{const t=E.use(Vd);if(!t)throw new Error("Missing useNewEventContextProvider must be within a NewEventProvider");return Uo(t,e)},Ko=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function jn(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function sa(e){return"nodeType"in e}function Ne(e){var t,n;return e?jn(e)?e:sa(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function ia(e){const{Document:t}=Ne(e);return e instanceof t}function kr(e){return jn(e)?!1:e instanceof Ne(e).HTMLElement}function $d(e){return e instanceof Ne(e).SVGElement}function Ln(e){return e?jn(e)?e.document:sa(e)?ia(e)?e:kr(e)||$d(e)?e.ownerDocument:document:document:document}const yt=Ko?E.useLayoutEffect:E.useEffect;function Go(e){const t=E.useRef(e);return yt(()=>{t.current=e}),E.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 pv(){const e=E.useRef(null),t=E.useCallback((r,o)=>{e.current=setInterval(r,o)},[]),n=E.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,n]}function vr(e,t){t===void 0&&(t=[e]);const n=E.useRef(e);return yt(()=>{n.current!==e&&(n.current=e)},t),n}function _r(e,t){const n=E.useRef();return E.useMemo(()=>{const r=e(n.current);return n.current=r,r},[...t])}function Do(e){const t=Go(e),n=E.useRef(null),r=E.useCallback(o=>{o!==n.current&&(t==null||t(o,n.current)),n.current=o},[]);return[n,r]}function Eo(e){const t=E.useRef();return E.useEffect(()=>{t.current=e},[e]),t.current}let Es={};function qo(e,t){return E.useMemo(()=>{if(t)return t;const n=Es[e]==null?0:Es[e]+1;return Es[e]=n,e+"-"+n},[e,t])}function Bd(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[c,l]of a){const u=s[c];u!=null&&(s[c]=u+e*l)}return s},{...t})}}const Rn=Bd(1),Mo=Bd(-1);function mv(e){return"clientX"in e&&"clientY"in e}function aa(e){if(!e)return!1;const{KeyboardEvent:t}=Ne(e.target);return t&&e instanceof t}function gv(e){if(!e)return!1;const{TouchEvent:t}=Ne(e.target);return t&&e instanceof t}function Ro(e){if(gv(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 mv(e)?{x:e.clientX,y:e.clientY}:null}const yr=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[yr.Translate.toString(e),yr.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),Bc="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function vv(e){return e.matches(Bc)?e:e.querySelector(Bc)}const yv={display:"none"};function bv(e){let{id:t,value:n}=e;return E.createElement("div",{id:t,style:yv},n)}function xv(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 E.createElement("div",{id:t,style:o,role:"status","aria-live":r,"aria-atomic":!0},n)}function wv(){const[e,t]=E.useState("");return{announce:E.useCallback(r=>{r!=null&&t(r)},[]),announcement:e}}const zd=E.createContext(null);function Nr(e){const t=E.useContext(zd);E.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function Sv(){const[e]=E.useState(()=>new Set),t=E.useCallback(r=>(e.add(r),()=>e.delete(r)),[e]);return[E.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 Cv={draggable:`
|
|
2
|
-
To pick up a draggable item, press the space bar.
|
|
3
|
-
While dragging, use the arrow keys to move the item.
|
|
4
|
-
Press space again to drop the item in its new position, or press escape to cancel.
|
|
5
|
-
`},Tv={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 Dv(e){let{announcements:t=Tv,container:n,hiddenTextDescribedById:r,screenReaderInstructions:o=Cv}=e;const{announce:s,announcement:i}=wv(),a=qo("DndLiveRegion"),[c,l]=E.useState(!1);if(E.useEffect(()=>{l(!0)},[]),Nr(E.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])),!c)return null;const u=E.createElement(E.Fragment,null,E.createElement(bv,{id:r,value:o.draggable}),E.createElement(xv,{id:a,announcement:i}));return n?vt.createPortal(u,n):u}var Se;(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"})(Se||(Se={}));function Po(){}function zc(e,t){return E.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function Ev(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return E.useMemo(()=>[...t].filter(r=>r!=null),[...t])}const tt=Object.freeze({x:0,y:0});function Mv(e,t){const n=Ro(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 Rv(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function Pv(e,t){if(!e||e.length===0)return null;const[n]=e;return n[t]}function Av(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 c=t.width*t.height,l=e.width*e.height,u=i*a,d=u/(c+l-u);return Number(d.toFixed(4))}return 0}const Ov=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 c=Av(a,t);c>0&&o.push({id:i,data:{droppableContainer:s,value:c}})}}return o.sort(Rv)};function kv(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function Wd(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:tt}function _v(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 Nv=_v(1);function Hd(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 Iv(e,t,n){const r=Hd(t);if(!r)return e;const{scaleX:o,scaleY:s,x:i,y:a}=r,c=e.left-i-(1-o)*parseFloat(n),l=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:l,right:c+u,bottom:l+d,left:c}}const jv={ignoreTransform:!1};function Ir(e,t){t===void 0&&(t=jv);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:l,transformOrigin:u}=Ne(e).getComputedStyle(e);l&&(n=Iv(n,l,u))}const{top:r,left:o,width:s,height:i,bottom:a,right:c}=n;return{top:r,left:o,width:s,height:i,bottom:a,right:c}}function Wc(e){return Ir(e,{ignoreTransform:!0})}function Lv(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function Vv(e,t){return t===void 0&&(t=Ne(e).getComputedStyle(e)),t.position==="fixed"}function Fv(e,t){t===void 0&&(t=Ne(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 ca(e,t){const n=[];function r(o){if(t!=null&&n.length>=t||!o)return n;if(ia(o)&&o.scrollingElement!=null&&!n.includes(o.scrollingElement))return n.push(o.scrollingElement),n;if(!kr(o)||$d(o)||n.includes(o))return n;const s=Ne(e).getComputedStyle(o);return o!==e&&Fv(o,s)&&n.push(o),Vv(o,s)?n:r(o.parentNode)}return e?r(e):n}function Ud(e){const[t]=ca(e,1);return t??null}function Ms(e){return!Ko||!e?null:jn(e)?e:sa(e)?ia(e)||e===Ln(e).scrollingElement?window:kr(e)?e:null:null}function Yd(e){return jn(e)?e.scrollX:e.scrollLeft}function Kd(e){return jn(e)?e.scrollY:e.scrollTop}function fi(e){return{x:Yd(e),y:Kd(e)}}var Ce;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(Ce||(Ce={}));function Gd(e){return!Ko||!e?!1:e===document.scrollingElement}function qd(e){const t={x:0,y:0},n=Gd(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 $v={x:.2,y:.2};function Bv(e,t,n,r,o){let{top:s,left:i,right:a,bottom:c}=n;r===void 0&&(r=10),o===void 0&&(o=$v);const{isTop:l,isBottom:u,isLeft:d,isRight:f}=qd(e),h={x:0,y:0},S={x:0,y:0},m={height:t.height*o.y,width:t.width*o.x};return!l&&s<=t.top+m.height?(h.y=Ce.Backward,S.y=r*Math.abs((t.top+m.height-s)/m.height)):!u&&c>=t.bottom-m.height&&(h.y=Ce.Forward,S.y=r*Math.abs((t.bottom-m.height-c)/m.height)),!f&&a>=t.right-m.width?(h.x=Ce.Forward,S.x=r*Math.abs((t.right-m.width-a)/m.width)):!d&&i<=t.left+m.width&&(h.x=Ce.Backward,S.x=r*Math.abs((t.left+m.width-i)/m.width)),{direction:h,speed:S}}function zv(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 Xd(e){return e.reduce((t,n)=>Rn(t,fi(n)),tt)}function Wv(e){return e.reduce((t,n)=>t+Yd(n),0)}function Hv(e){return e.reduce((t,n)=>t+Kd(n),0)}function Zd(e,t){if(t===void 0&&(t=Ir),!e)return;const{top:n,left:r,bottom:o,right:s}=t(e);Ud(e)&&(o<=0||s<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const Uv=[["x",["left","right"],Wv],["y",["top","bottom"],Hv]];class la{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=ca(n),o=Xd(r);this.rect={...t},this.width=t.width,this.height=t.height;for(const[s,i,a]of Uv)for(const c of i)Object.defineProperty(this,c,{get:()=>{const l=a(r),u=o[s]-l;return this.rect[c]+u},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class ur{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 Yv(e){const{EventTarget:t}=Ne(e);return e instanceof t?e:Ln(e)}function Rs(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 Ge;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(Ge||(Ge={}));function Hc(e){e.preventDefault()}function Kv(e){e.stopPropagation()}var he;(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"})(he||(he={}));const Jd={start:[he.Space,he.Enter],cancel:[he.Esc],end:[he.Space,he.Enter,he.Tab]},Gv=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case he.Right:return{...n,x:n.x+25};case he.Left:return{...n,x:n.x-25};case he.Down:return{...n,y:n.y+25};case he.Up:return{...n,y:n.y-25}}};class Qd{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 ur(Ln(n)),this.windowListeners=new ur(Ne(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Ge.Resize,this.handleCancel),this.windowListeners.add(Ge.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Ge.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,r=t.node.current;r&&Zd(r),n(tt)}handleKeyDown(t){if(aa(t)){const{active:n,context:r,options:o}=this.props,{keyboardCodes:s=Jd,coordinateGetter:i=Gv,scrollBehavior:a="smooth"}=o,{code:c}=t;if(s.end.includes(c)){this.handleEnd(t);return}if(s.cancel.includes(c)){this.handleCancel(t);return}const{collisionRect:l}=r.current,u=l?{x:l.left,y:l.top}:tt;this.referenceCoordinates||(this.referenceCoordinates=u);const d=i(t,{active:n,context:r.current,currentCoordinates:u});if(d){const f=Mo(d,u),h={x:0,y:0},{scrollableAncestors:S}=r.current;for(const m of S){const w=t.code,{isTop:y,isRight:p,isLeft:g,isBottom:C,maxScroll:v,minScroll:M}=qd(m),b=zv(m),T={x:Math.min(w===he.Right?b.right-b.width/2:b.right,Math.max(w===he.Right?b.left:b.left+b.width/2,d.x)),y:Math.min(w===he.Down?b.bottom-b.height/2:b.bottom,Math.max(w===he.Down?b.top:b.top+b.height/2,d.y))},R=w===he.Right&&!p||w===he.Left&&!g,k=w===he.Down&&!C||w===he.Up&&!y;if(R&&T.x!==d.x){const A=m.scrollLeft+f.x,z=w===he.Right&&A<=v.x||w===he.Left&&A>=M.x;if(z&&!f.y){m.scrollTo({left:A,behavior:a});return}z?h.x=m.scrollLeft-A:h.x=w===he.Right?m.scrollLeft-v.x:m.scrollLeft-M.x,h.x&&m.scrollBy({left:-h.x,behavior:a});break}else if(k&&T.y!==d.y){const A=m.scrollTop+f.y,z=w===he.Down&&A<=v.y||w===he.Up&&A>=M.y;if(z&&!f.x){m.scrollTo({top:A,behavior:a});return}z?h.y=m.scrollTop-A:h.y=w===he.Down?m.scrollTop-v.y:m.scrollTop-M.y,h.y&&m.scrollBy({top:-h.y,behavior:a});break}}this.handleMove(t,Rn(Mo(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()}}Qd.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=Jd,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 Uc(e){return!!(e&&"distance"in e)}function Yc(e){return!!(e&&"delay"in e)}class ua{constructor(t,n,r){var o;r===void 0&&(r=Yv(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=Ln(i),this.documentListeners=new ur(this.document),this.listeners=new ur(r),this.windowListeners=new ur(Ne(i)),this.initialCoordinates=(o=Ro(s))!=null?o:tt,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(Ge.Resize,this.handleCancel),this.windowListeners.add(Ge.DragStart,Hc),this.windowListeners.add(Ge.VisibilityChange,this.handleCancel),this.windowListeners.add(Ge.ContextMenu,Hc),this.documentListeners.add(Ge.Keydown,this.handleKeydown),n){if(r!=null&&r({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(Yc(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(Uc(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(Ge.Click,Kv,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Ge.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 c=(n=Ro(t))!=null?n:tt,l=Mo(o,c);if(!r&&a){if(Uc(a)){if(a.tolerance!=null&&Rs(l,a.tolerance))return this.handleCancel();if(Rs(l,a.distance))return this.handleStart()}if(Yc(a)&&Rs(l,a.tolerance))return this.handleCancel();this.handlePending(a,l);return}t.cancelable&&t.preventDefault(),i(c)}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===he.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const qv={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class ef extends ua{constructor(t){const{event:n}=t,r=Ln(n.target);super(t,qv,r)}}ef.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 Xv={move:{name:"mousemove"},end:{name:"mouseup"}};var hi;(function(e){e[e.RightClick=2]="RightClick"})(hi||(hi={}));class tf extends ua{constructor(t){super(t,Xv,Ln(t.event.target))}}tf.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button===hi.RightClick?!1:(r==null||r({event:n}),!0)}}];const Ps={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class nf extends ua{constructor(t){super(t,Ps)}static setup(){return window.addEventListener(Ps.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(Ps.move.name,t)};function t(){}}}nf.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 dr;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(dr||(dr={}));var Ao;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(Ao||(Ao={}));function Zv(e){let{acceleration:t,activator:n=dr.Pointer,canScroll:r,draggingRect:o,enabled:s,interval:i=5,order:a=Ao.TreeOrder,pointerCoordinates:c,scrollableAncestors:l,scrollableAncestorRects:u,delta:d,threshold:f}=e;const h=Qv({delta:d,disabled:!s}),[S,m]=pv(),w=E.useRef({x:0,y:0}),y=E.useRef({x:0,y:0}),p=E.useMemo(()=>{switch(n){case dr.Pointer:return c?{top:c.y,bottom:c.y,left:c.x,right:c.x}:null;case dr.DraggableRect:return o}},[n,o,c]),g=E.useRef(null),C=E.useCallback(()=>{const M=g.current;if(!M)return;const b=w.current.x*y.current.x,T=w.current.y*y.current.y;M.scrollBy(b,T)},[]),v=E.useMemo(()=>a===Ao.TreeOrder?[...l].reverse():l,[a,l]);E.useEffect(()=>{if(!s||!l.length||!p){m();return}for(const M of v){if((r==null?void 0:r(M))===!1)continue;const b=l.indexOf(M),T=u[b];if(!T)continue;const{direction:R,speed:k}=Bv(M,T,p,t,f);for(const A of["x","y"])h[A][R[A]]||(k[A]=0,R[A]=0);if(k.x>0||k.y>0){m(),g.current=M,S(C,i),w.current=k,y.current=R;return}}w.current={x:0,y:0},y.current={x:0,y:0},m()},[t,C,r,m,s,i,JSON.stringify(p),JSON.stringify(h),S,l,v,u,JSON.stringify(f)])}const Jv={x:{[Ce.Backward]:!1,[Ce.Forward]:!1},y:{[Ce.Backward]:!1,[Ce.Forward]:!1}};function Qv(e){let{delta:t,disabled:n}=e;const r=Eo(t);return _r(o=>{if(n||!r||!o)return Jv;const s={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[Ce.Backward]:o.x[Ce.Backward]||s.x===-1,[Ce.Forward]:o.x[Ce.Forward]||s.x===1},y:{[Ce.Backward]:o.y[Ce.Backward]||s.y===-1,[Ce.Forward]:o.y[Ce.Forward]||s.y===1}}},[n,t,r])}function ey(e,t){const n=t!=null?e.get(t):void 0,r=n?n.node.current:null;return _r(o=>{var s;return t==null?null:(s=r??o)!=null?s:null},[r,t])}function ty(e,t){return E.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 br;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(br||(br={}));var pi;(function(e){e.Optimized="optimized"})(pi||(pi={}));const Kc=new Map;function ny(e,t){let{dragging:n,dependencies:r,config:o}=t;const[s,i]=E.useState(null),{frequency:a,measure:c,strategy:l}=o,u=E.useRef(e),d=w(),f=vr(d),h=E.useCallback(function(y){y===void 0&&(y=[]),!f.current&&i(p=>p===null?y:p.concat(y.filter(g=>!p.includes(g))))},[f]),S=E.useRef(null),m=_r(y=>{if(d&&!n)return Kc;if(!y||y===Kc||u.current!==e||s!=null){const p=new Map;for(let g of e){if(!g)continue;if(s&&s.length>0&&!s.includes(g.id)&&g.rect.current){p.set(g.id,g.rect.current);continue}const C=g.node.current,v=C?new la(c(C),C):null;g.rect.current=v,v&&p.set(g.id,v)}return p}return y},[e,s,n,d,c]);return E.useEffect(()=>{u.current=e},[e]),E.useEffect(()=>{d||h()},[n,d]),E.useEffect(()=>{s&&s.length>0&&i(null)},[JSON.stringify(s)]),E.useEffect(()=>{d||typeof a!="number"||S.current!==null||(S.current=setTimeout(()=>{h(),S.current=null},a))},[a,d,h,...r]),{droppableRects:m,measureDroppableContainers:h,measuringScheduled:s!=null};function w(){switch(l){case br.Always:return!1;case br.BeforeDragging:return n;default:return!n}}}function da(e,t){return _r(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function ry(e,t){return da(e,t)}function oy(e){let{callback:t,disabled:n}=e;const r=Go(t),o=E.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:s}=window;return new s(r)},[r,n]);return E.useEffect(()=>()=>o==null?void 0:o.disconnect(),[o]),o}function Xo(e){let{callback:t,disabled:n}=e;const r=Go(t),o=E.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:s}=window;return new s(r)},[n]);return E.useEffect(()=>()=>o==null?void 0:o.disconnect(),[o]),o}function sy(e){return new la(Ir(e),e)}function Gc(e,t,n){t===void 0&&(t=sy);const[r,o]=E.useState(null);function s(){o(c=>{if(!e)return null;if(e.isConnected===!1){var l;return(l=c??n)!=null?l:null}const u=t(e);return JSON.stringify(c)===JSON.stringify(u)?c:u})}const i=oy({callback(c){if(e)for(const l of c){const{type:u,target:d}=l;if(u==="childList"&&d instanceof HTMLElement&&d.contains(e)){s();break}}}}),a=Xo({callback:s});return yt(()=>{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 iy(e){const t=da(e);return Wd(e,t)}const qc=[];function ay(e){const t=E.useRef(e),n=_r(r=>e?r&&r!==qc&&e&&t.current&&e.parentNode===t.current.parentNode?r:ca(e):qc,[e]);return E.useEffect(()=>{t.current=e},[e]),n}function cy(e){const[t,n]=E.useState(null),r=E.useRef(e),o=E.useCallback(s=>{const i=Ms(s.target);i&&n(a=>a?(a.set(i,fi(i)),new Map(a)):null)},[]);return E.useEffect(()=>{const s=r.current;if(e!==s){i(s);const a=e.map(c=>{const l=Ms(c);return l?(l.addEventListener("scroll",o,{passive:!0}),[l,fi(l)]):null}).filter(c=>c!=null);n(a.length?new Map(a):null),r.current=e}return()=>{i(e),i(s)};function i(a){a.forEach(c=>{const l=Ms(c);l==null||l.removeEventListener("scroll",o)})}},[o,e]),E.useMemo(()=>e.length?t?Array.from(t.values()).reduce((s,i)=>Rn(s,i),tt):Xd(e):tt,[e,t])}function Xc(e,t){t===void 0&&(t=[]);const n=E.useRef(null);return E.useEffect(()=>{n.current=null},t),E.useEffect(()=>{const r=e!==tt;r&&!n.current&&(n.current=e),!r&&n.current&&(n.current=null)},[e]),n.current?Mo(e,n.current):tt}function ly(e){E.useEffect(()=>{if(!Ko)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 uy(e,t){return E.useMemo(()=>e.reduce((n,r)=>{let{eventName:o,handler:s}=r;return n[o]=i=>{s(i,t)},n},{}),[e,t])}function rf(e){return E.useMemo(()=>e?Lv(e):null,[e])}const Zc=[];function dy(e,t){t===void 0&&(t=Ir);const[n]=e,r=rf(n?Ne(n):null),[o,s]=E.useState(Zc);function i(){s(()=>e.length?e.map(c=>Gd(c)?r:new la(t(c),c)):Zc)}const a=Xo({callback:i});return yt(()=>{a==null||a.disconnect(),i(),e.forEach(c=>a==null?void 0:a.observe(c))},[e]),o}function of(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return kr(t)?t:e}function fy(e){let{measure:t}=e;const[n,r]=E.useState(null),o=E.useCallback(l=>{for(const{target:u}of l)if(kr(u)){r(d=>{const f=t(u);return d?{...d,width:f.width,height:f.height}:f});break}},[t]),s=Xo({callback:o}),i=E.useCallback(l=>{const u=of(l);s==null||s.disconnect(),u&&(s==null||s.observe(u)),r(u?t(u):null)},[t,s]),[a,c]=Do(i);return E.useMemo(()=>({nodeRef:a,rect:n,setRef:c}),[n,a,c])}const hy=[{sensor:ef,options:{}},{sensor:Qd,options:{}}],py={current:{}},vo={draggable:{measure:Wc},droppable:{measure:Wc,strategy:br.WhileDragging,frequency:pi.Optimized},dragOverlay:{measure:Ir}};class fr 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 my={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new fr,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Po},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:vo,measureDroppableContainers:Po,windowRect:null,measuringScheduled:!1},sf={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Po,draggableNodes:new Map,over:null,measureDroppableContainers:Po},jr=E.createContext(sf),af=E.createContext(my);function gy(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new fr}}}function vy(e,t){switch(t.type){case Se.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case Se.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 Se.DragEnd:case Se.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Se.RegisterDroppable:{const{element:n}=t,{id:r}=n,o=new fr(e.droppable.containers);return o.set(r,n),{...e,droppable:{...e.droppable,containers:o}}}case Se.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 fr(e.droppable.containers);return i.set(n,{...s,disabled:o}),{...e,droppable:{...e.droppable,containers:i}}}case Se.UnregisterDroppable:{const{id:n,key:r}=t,o=e.droppable.containers.get(n);if(!o||r!==o.key)return e;const s=new fr(e.droppable.containers);return s.delete(n),{...e,droppable:{...e.droppable,containers:s}}}default:return e}}function yy(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:o}=E.useContext(jr),s=Eo(r),i=Eo(n==null?void 0:n.id);return E.useEffect(()=>{if(!t&&!r&&s&&i!=null){if(!aa(s)||document.activeElement===s.target)return;const a=o.get(i);if(!a)return;const{activatorNode:c,node:l}=a;if(!c.current&&!l.current)return;requestAnimationFrame(()=>{for(const u of[c.current,l.current]){if(!u)continue;const d=vv(u);if(d){d.focus();break}}})}},[r,t,o,i,s]),null}function cf(e,t){let{transform:n,...r}=t;return e!=null&&e.length?e.reduce((o,s)=>s({transform:o,...r}),n):n}function by(e){return E.useMemo(()=>({draggable:{...vo.draggable,...e==null?void 0:e.draggable},droppable:{...vo.droppable,...e==null?void 0:e.droppable},dragOverlay:{...vo.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 xy(e){let{activeNode:t,measure:n,initialRect:r,config:o=!0}=e;const s=E.useRef(!1),{x:i,y:a}=typeof o=="boolean"?{x:o,y:o}:o;yt(()=>{if(!i&&!a||!t){s.current=!1;return}if(s.current||!r)return;const l=t==null?void 0:t.node.current;if(!l||l.isConnected===!1)return;const u=n(l),d=Wd(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=Ud(l);f&&f.scrollBy({top:d.y,left:d.x})}},[t,i,a,r,n])}const Zo=E.createContext({...tt,scaleX:1,scaleY:1});var It;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(It||(It={}));const fa=E.memo(function(t){var n,r,o,s;let{id:i,accessibility:a,autoScroll:c=!0,children:l,sensors:u=hy,collisionDetection:d=Ov,measuring:f,modifiers:h,...S}=t;const m=E.useReducer(vy,void 0,gy),[w,y]=m,[p,g]=Sv(),[C,v]=E.useState(It.Uninitialized),M=C===It.Initialized,{draggable:{active:b,nodes:T,translate:R},droppable:{containers:k}}=w,A=b!=null?T.get(b):null,z=E.useRef({initial:null,translated:null}),G=E.useMemo(()=>{var Me;return b!=null?{id:b,data:(Me=A==null?void 0:A.data)!=null?Me:py,rect:z}:null},[b,A]),j=E.useRef(null),[F,_]=E.useState(null),[N,P]=E.useState(null),I=vr(S,Object.values(S)),O=qo("DndDescribedBy",i),V=E.useMemo(()=>k.getEnabled(),[k]),W=by(f),{droppableRects:H,measureDroppableContainers:L,measuringScheduled:Y}=ny(V,{dragging:M,dependencies:[R.x,R.y],config:W.droppable}),K=ey(T,b),$=E.useMemo(()=>N?Ro(N):null,[N]),q=$g(),X=ry(K,W.draggable.measure);xy({activeNode:b!=null?T.get(b):null,config:q.layoutShiftCompensation,initialRect:X,measure:W.draggable.measure});const U=Gc(K,W.draggable.measure,X),ne=Gc(K?K.parentElement:null),B=E.useRef({activatorEvent:null,active:null,activeNode:K,collisionRect:null,collisions:null,droppableRects:H,draggableNodes:T,draggingNode:null,draggingNodeRect:null,droppableContainers:k,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),ie=k.getNodeFor((n=B.current.over)==null?void 0:n.id),pe=fy({measure:W.dragOverlay.measure}),Oe=(r=pe.nodeRef.current)!=null?r:K,Ee=M?(o=pe.rect)!=null?o:U:null,ot=!!(pe.nodeRef.current&&pe.rect),J=iy(ot?null:U),le=rf(Oe?Ne(Oe):null),ye=ay(M?ie??K:null),Ve=dy(ye),He=cf(h,{transform:{x:R.x-J.x,y:R.y-J.y,scaleX:1,scaleY:1},activatorEvent:N,active:G,activeNodeRect:U,containerNodeRect:ne,draggingNodeRect:Ee,over:B.current.over,overlayNodeRect:pe.rect,scrollableAncestors:ye,scrollableAncestorRects:Ve,windowRect:le}),Gn=$?Rn($,R):null,Ss=cy(ye),Oc=Xc(Ss),Cs=Xc(Ss,[U]),pn=Rn(He,Oc),mn=Ee?Nv(Ee,He):null,qn=G&&mn?d({active:G,collisionRect:mn,droppableRects:H,droppableContainers:V,pointerCoordinates:Gn}):null,kc=Pv(qn,"id"),[Et,_c]=E.useState(null),Ig=ot?He:Rn(He,Cs),jg=kv(Ig,(s=Et==null?void 0:Et.rect)!=null?s:null,U),Ts=E.useRef(null),Nc=E.useCallback((Me,Fe)=>{let{sensor:$e,options:Mt}=Fe;if(j.current==null)return;const Ue=T.get(j.current);if(!Ue)return;const Be=Me.nativeEvent,st=new $e({active:j.current,activeNode:Ue,event:Be,options:Mt,context:B,onAbort(Te){if(!T.get(Te))return;const{onDragAbort:it}=I.current,pt={id:Te};it==null||it(pt),p({type:"onDragAbort",event:pt})},onPending(Te,Rt,it,pt){if(!T.get(Te))return;const{onDragPending:Zn}=I.current,Pt={id:Te,constraint:Rt,initialCoordinates:it,offset:pt};Zn==null||Zn(Pt),p({type:"onDragPending",event:Pt})},onStart(Te){const Rt=j.current;if(Rt==null)return;const it=T.get(Rt);if(!it)return;const{onDragStart:pt}=I.current,Xn={activatorEvent:Be,active:{id:Rt,data:it.data,rect:z}};vt.unstable_batchedUpdates(()=>{pt==null||pt(Xn),v(It.Initializing),y({type:Se.DragStart,initialCoordinates:Te,active:Rt}),p({type:"onDragStart",event:Xn}),_(Ts.current),P(Be)})},onMove(Te){y({type:Se.DragMove,coordinates:Te})},onEnd:gn(Se.DragEnd),onCancel:gn(Se.DragCancel)});Ts.current=st;function gn(Te){return async function(){const{active:it,collisions:pt,over:Xn,scrollAdjustedTranslate:Zn}=B.current;let Pt=null;if(it&&Zn){const{cancelDrop:Jn}=I.current;Pt={activatorEvent:Be,active:it,collisions:pt,delta:Zn,over:Xn},Te===Se.DragEnd&&typeof Jn=="function"&&await Promise.resolve(Jn(Pt))&&(Te=Se.DragCancel)}j.current=null,vt.unstable_batchedUpdates(()=>{y({type:Te}),v(It.Uninitialized),_c(null),_(null),P(null),Ts.current=null;const Jn=Te===Se.DragEnd?"onDragEnd":"onDragCancel";if(Pt){const Ds=I.current[Jn];Ds==null||Ds(Pt),p({type:Jn,event:Pt})}})}}},[T]),Lg=E.useCallback((Me,Fe)=>($e,Mt)=>{const Ue=$e.nativeEvent,Be=T.get(Mt);if(j.current!==null||!Be||Ue.dndKit||Ue.defaultPrevented)return;const st={active:Be};Me($e,Fe.options,st)===!0&&(Ue.dndKit={capturedBy:Fe.sensor},j.current=Mt,Nc($e,Fe))},[T,Nc]),Ic=ty(u,Lg);ly(u),yt(()=>{U&&C===It.Initializing&&v(It.Initialized)},[U,C]),E.useEffect(()=>{const{onDragMove:Me}=I.current,{active:Fe,activatorEvent:$e,collisions:Mt,over:Ue}=B.current;if(!Fe||!$e)return;const Be={active:Fe,activatorEvent:$e,collisions:Mt,delta:{x:pn.x,y:pn.y},over:Ue};vt.unstable_batchedUpdates(()=>{Me==null||Me(Be),p({type:"onDragMove",event:Be})})},[pn.x,pn.y]),E.useEffect(()=>{const{active:Me,activatorEvent:Fe,collisions:$e,droppableContainers:Mt,scrollAdjustedTranslate:Ue}=B.current;if(!Me||j.current==null||!Fe||!Ue)return;const{onDragOver:Be}=I.current,st=Mt.get(kc),gn=st&&st.rect.current?{id:st.id,rect:st.rect.current,data:st.data,disabled:st.disabled}:null,Te={active:Me,activatorEvent:Fe,collisions:$e,delta:{x:Ue.x,y:Ue.y},over:gn};vt.unstable_batchedUpdates(()=>{_c(gn),Be==null||Be(Te),p({type:"onDragOver",event:Te})})},[kc]),yt(()=>{B.current={activatorEvent:N,active:G,activeNode:K,collisionRect:mn,collisions:qn,droppableRects:H,draggableNodes:T,draggingNode:Oe,draggingNodeRect:Ee,droppableContainers:k,over:Et,scrollableAncestors:ye,scrollAdjustedTranslate:pn},z.current={initial:Ee,translated:mn}},[G,K,qn,mn,T,Oe,Ee,H,k,Et,ye,pn]),Zv({...q,delta:R,draggingRect:mn,pointerCoordinates:Gn,scrollableAncestors:ye,scrollableAncestorRects:Ve});const Vg=E.useMemo(()=>({active:G,activeNode:K,activeNodeRect:U,activatorEvent:N,collisions:qn,containerNodeRect:ne,dragOverlay:pe,draggableNodes:T,droppableContainers:k,droppableRects:H,over:Et,measureDroppableContainers:L,scrollableAncestors:ye,scrollableAncestorRects:Ve,measuringConfiguration:W,measuringScheduled:Y,windowRect:le}),[G,K,U,N,qn,ne,pe,T,k,H,Et,L,ye,Ve,W,Y,le]),Fg=E.useMemo(()=>({activatorEvent:N,activators:Ic,active:G,activeNodeRect:U,ariaDescribedById:{draggable:O},dispatch:y,draggableNodes:T,over:Et,measureDroppableContainers:L}),[N,Ic,G,U,y,O,T,Et,L]);return E.createElement(zd.Provider,{value:g},E.createElement(jr.Provider,{value:Fg},E.createElement(af.Provider,{value:Vg},E.createElement(Zo.Provider,{value:jg},l)),E.createElement(yy,{disabled:(a==null?void 0:a.restoreFocus)===!1})),E.createElement(Dv,{...a,hiddenTextDescribedById:O}));function $g(){const Me=(F==null?void 0:F.autoScrollEnabled)===!1,Fe=typeof c=="object"?c.enabled===!1:c===!1,$e=M&&!Me&&!Fe;return typeof c=="object"?{...c,enabled:$e}:{enabled:$e}}}),wy=E.createContext(null),Jc="button",Sy="Draggable";function ha(e){let{id:t,data:n,disabled:r=!1,attributes:o}=e;const s=qo(Sy),{activators:i,activatorEvent:a,active:c,activeNodeRect:l,ariaDescribedById:u,draggableNodes:d,over:f}=E.useContext(jr),{role:h=Jc,roleDescription:S="draggable",tabIndex:m=0}=o??{},w=(c==null?void 0:c.id)===t,y=E.useContext(w?Zo:wy),[p,g]=Do(),[C,v]=Do(),M=uy(i,t),b=vr(n);yt(()=>(d.set(t,{id:t,key:s,node:p,activatorNode:C,data:b}),()=>{const R=d.get(t);R&&R.key===s&&d.delete(t)}),[d,t]);const T=E.useMemo(()=>({role:h,tabIndex:m,"aria-disabled":r,"aria-pressed":w&&h===Jc?!0:void 0,"aria-roledescription":S,"aria-describedby":u.draggable}),[r,h,m,w,S,u.draggable]);return{active:c,activatorEvent:a,activeNodeRect:l,attributes:T,isDragging:w,listeners:r?void 0:M,node:p,over:f,setNodeRef:g,setActivatorNodeRef:v,transform:y}}function Cy(){return E.useContext(af)}const Ty="Droppable",Dy={timeout:25};function Zr(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:o}=e;const s=qo(Ty),{active:i,dispatch:a,over:c,measureDroppableContainers:l}=E.useContext(jr),u=E.useRef({disabled:n}),d=E.useRef(!1),f=E.useRef(null),h=E.useRef(null),{disabled:S,updateMeasurementsFor:m,timeout:w}={...Dy,...o},y=vr(m??r),p=E.useCallback(()=>{if(!d.current){d.current=!0;return}h.current!=null&&clearTimeout(h.current),h.current=setTimeout(()=>{l(Array.isArray(y.current)?y.current:[y.current]),h.current=null},w)},[w]),g=Xo({callback:p,disabled:S||!i}),C=E.useCallback((T,R)=>{g&&(R&&(g.unobserve(R),d.current=!1),T&&g.observe(T))},[g]),[v,M]=Do(C),b=vr(t);return E.useEffect(()=>{!g||!v.current||(g.disconnect(),d.current=!1,g.observe(v.current))},[v,g]),E.useEffect(()=>(a({type:Se.RegisterDroppable,element:{id:r,key:s,disabled:n,node:v,rect:f,data:b}}),()=>a({type:Se.UnregisterDroppable,key:s,id:r})),[r]),E.useEffect(()=>{n!==u.current.disabled&&(a({type:Se.SetDroppableDisabled,id:r,key:s,disabled:n}),u.current.disabled=n)},[r,s,n,a]),{active:i,rect:f,isOver:(c==null?void 0:c.id)===r,node:v,over:c,setNodeRef:M}}function Ey(e){let{animation:t,children:n}=e;const[r,o]=E.useState(null),[s,i]=E.useState(null),a=Eo(n);return!n&&!r&&a&&o(a),yt(()=>{if(!s)return;const c=r==null?void 0:r.key,l=r==null?void 0:r.props.id;if(c==null||l==null){o(null);return}Promise.resolve(t(l,s)).then(()=>{o(null)})},[t,r,s]),E.createElement(E.Fragment,null,n,r?E.cloneElement(r,{ref:i}):null)}const My={x:0,y:0,scaleX:1,scaleY:1};function Ry(e){let{children:t}=e;return E.createElement(jr.Provider,{value:sf},E.createElement(Zo.Provider,{value:My},t))}const Py={position:"fixed",touchAction:"none"},Ay=e=>aa(e)?"transform 250ms ease":void 0,Oy=E.forwardRef((e,t)=>{let{as:n,activatorEvent:r,adjustScale:o,children:s,className:i,rect:a,style:c,transform:l,transition:u=Ay}=e;if(!a)return null;const d=o?l:{...l,scaleX:1,scaleY:1},f={...Py,width:a.width,height:a.height,top:a.top,left:a.left,transform:yr.Transform.toString(d),transformOrigin:o&&r?Mv(r,a):void 0,transition:typeof u=="function"?u(r):u,...c};return E.createElement(n,{className:i,style:f,ref:t},s)}),ky=e=>t=>{let{active:n,dragOverlay:r}=t;const o={},{styles:s,className:i}=e;if(s!=null&&s.active)for(const[a,c]of Object.entries(s.active))c!==void 0&&(o[a]=n.node.style.getPropertyValue(a),n.node.style.setProperty(a,c));if(s!=null&&s.dragOverlay)for(const[a,c]of Object.entries(s.dragOverlay))c!==void 0&&r.node.style.setProperty(a,c);return i!=null&&i.active&&n.node.classList.add(i.active),i!=null&&i.dragOverlay&&r.node.classList.add(i.dragOverlay),function(){for(const[c,l]of Object.entries(o))n.node.style.setProperty(c,l);i!=null&&i.active&&n.node.classList.remove(i.active)}},_y=e=>{let{transform:{initial:t,final:n}}=e;return[{transform:yr.Transform.toString(t)},{transform:yr.Transform.toString(n)}]},Ny={duration:250,easing:"ease",keyframes:_y,sideEffects:ky({styles:{active:{opacity:"0"}}})};function Iy(e){let{config:t,draggableNodes:n,droppableContainers:r,measuringConfiguration:o}=e;return Go((s,i)=>{if(t===null)return;const a=n.get(s);if(!a)return;const c=a.node.current;if(!c)return;const l=of(i);if(!l)return;const{transform:u}=Ne(i).getComputedStyle(i),d=Hd(u);if(!d)return;const f=typeof t=="function"?t:jy(t);return Zd(c,o.draggable.measure),f({active:{id:s,data:a.data,node:c,rect:o.draggable.measure(c)},draggableNodes:n,dragOverlay:{node:i,rect:o.dragOverlay.measure(l)},droppableContainers:r,measuringConfiguration:o,transform:d})})}function jy(e){const{duration:t,easing:n,sideEffects:r,keyframes:o}={...Ny,...e};return s=>{let{active:i,dragOverlay:a,transform:c,...l}=s;if(!t)return;const u={x:a.rect.left-i.rect.left,y:a.rect.top-i.rect.top},d={scaleX:c.scaleX!==1?i.rect.width*c.scaleX/a.rect.width:1,scaleY:c.scaleY!==1?i.rect.height*c.scaleY/a.rect.height:1},f={x:c.x-u.x,y:c.y-u.y,...d},h=o({...l,active:i,dragOverlay:a,transform:{initial:c,final:f}}),[S]=h,m=h[h.length-1];if(JSON.stringify(S)===JSON.stringify(m))return;const w=r==null?void 0:r({active:i,dragOverlay:a,...l}),y=a.node.animate(h,{duration:t,easing:n,fill:"forwards"});return new Promise(p=>{y.onfinish=()=>{w==null||w(),p()}})}}let Qc=0;function Ly(e){return E.useMemo(()=>{if(e!=null)return Qc++,Qc},[e])}const Vy=E.memo(e=>{let{adjustScale:t=!1,children:n,dropAnimation:r,style:o,transition:s,modifiers:i,wrapperElement:a="div",className:c,zIndex:l=999}=e;const{activatorEvent:u,active:d,activeNodeRect:f,containerNodeRect:h,draggableNodes:S,droppableContainers:m,dragOverlay:w,over:y,measuringConfiguration:p,scrollableAncestors:g,scrollableAncestorRects:C,windowRect:v}=Cy(),M=E.useContext(Zo),b=Ly(d==null?void 0:d.id),T=cf(i,{activatorEvent:u,active:d,activeNodeRect:f,containerNodeRect:h,draggingNodeRect:w.rect,over:y,overlayNodeRect:w.rect,scrollableAncestors:g,scrollableAncestorRects:C,transform:M,windowRect:v}),R=da(f),k=Iy({config:r,draggableNodes:S,droppableContainers:m,measuringConfiguration:p}),A=R?w.setRef:void 0;return E.createElement(Ry,null,E.createElement(Ey,{animation:k},d&&b?E.createElement(Oy,{key:b,id:d.id,ref:A,as:a,activatorEvent:u,adjustScale:t,className:c,transition:s,rect:R,style:{zIndex:l,...o},transform:T},n):null))});var Fy={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 mi(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 Fy[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 As(e){var t=mi(e);return"".concat(t.value).concat(t.unit)}var $y=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=`
|
|
1
|
+
"use strict";require('./assets/main.css');var kg=Object.defineProperty;var _g=(e,t,n)=>t in e?kg(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Xt=(e,t,n)=>_g(e,typeof t!="symbol"?t+"":t,n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const x=require("react/jsx-runtime"),E=require("react"),vt=require("react-dom");function wd(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 D=wd(E),zo=wd(vt);class Ng extends ReferenceError{constructor(t="Calendar instance is not initialized. Ensure the calendar is rendered before calling this method."){super(t),this.name="ReferenceErrorCustom"}}var Ig={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 ai(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 Ig[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 Ds(e){var t=ai(e);return"".concat(t.value).concat(t.unit)}var jg=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=`
|
|
6
2
|
@keyframes `.concat(r,` {
|
|
7
3
|
`).concat(t,`
|
|
8
4
|
}
|
|
9
|
-
`);return s&&s.insertRule(i,0),r},Oo=function(){return Oo=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},Oo.apply(this,arguments)},By=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},zy=$y("GridLoader","0% {transform: scale(1)} 50% {transform: scale(0.5); opacity: 0.7} 100% {transform: scale(1); opacity: 1}","grid"),mt=function(e){return Math.random()*e};function Wy(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,c=a===void 0?{}:a,l=e.size,u=l===void 0?15:l,d=e.margin,f=d===void 0?2:d,h=By(e,["loading","color","speedMultiplier","cssOverride","size","margin"]),S=mi(u),m=mi(f),w=parseFloat(S.value.toString())*3+parseFloat(m.value.toString())*6,y=Oo({width:"".concat(w).concat(S.unit),fontSize:0,display:"inline-block"},c),p=function(g){return{display:"inline-block",backgroundColor:o,width:"".concat(As(u)),height:"".concat(As(u)),margin:As(f),borderRadius:"100%",animationFillMode:"both",animation:"".concat(zy," ").concat((g/100+.6)/i,"s ").concat(g/100-.2,"s infinite ease")}};return n?D.createElement("span",Oo({style:y},h,{ref:function(g){g&&g.style.setProperty("width","".concat(w).concat(S.unit),"important")}}),D.createElement("span",{style:p(mt(100))}),D.createElement("span",{style:p(mt(100))}),D.createElement("span",{style:p(mt(100))}),D.createElement("span",{style:p(mt(100))}),D.createElement("span",{style:p(mt(100))}),D.createElement("span",{style:p(mt(100))}),D.createElement("span",{style:p(mt(100))}),D.createElement("span",{style:p(mt(100))}),D.createElement("span",{style:p(mt(100))})):null}/**
|
|
5
|
+
`);return s&&s.insertRule(i,0),r},Co=function(){return Co=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},Co.apply(this,arguments)},Lg=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},Vg=jg("GridLoader","0% {transform: scale(1)} 50% {transform: scale(0.5); opacity: 0.7} 100% {transform: scale(1); opacity: 1}","grid"),mt=function(e){return Math.random()*e};function Fg(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,c=a===void 0?{}:a,l=e.size,u=l===void 0?15:l,d=e.margin,h=d===void 0?2:d,f=Lg(e,["loading","color","speedMultiplier","cssOverride","size","margin"]),S=ai(u),m=ai(h),w=parseFloat(S.value.toString())*3+parseFloat(m.value.toString())*6,g=Co({width:"".concat(w).concat(S.unit),fontSize:0,display:"inline-block"},c),p=function(v){return{display:"inline-block",backgroundColor:o,width:"".concat(Ds(u)),height:"".concat(Ds(u)),margin:Ds(h),borderRadius:"100%",animationFillMode:"both",animation:"".concat(Vg," ").concat((v/100+.6)/i,"s ").concat(v/100-.2,"s infinite ease")}};return n?D.createElement("span",Co({style:g},f,{ref:function(v){v&&v.style.setProperty("width","".concat(w).concat(S.unit),"important")}}),D.createElement("span",{style:p(mt(100))}),D.createElement("span",{style:p(mt(100))}),D.createElement("span",{style:p(mt(100))}),D.createElement("span",{style:p(mt(100))}),D.createElement("span",{style:p(mt(100))}),D.createElement("span",{style:p(mt(100))}),D.createElement("span",{style:p(mt(100))}),D.createElement("span",{style:p(mt(100))}),D.createElement("span",{style:p(mt(100))})):null}const kc=e=>{let t;const n=new Set,r=(l,u)=>{const d=typeof l=="function"?l(t):l;if(!Object.is(d,t)){const h=t;t=u??(typeof d!="object"||d===null)?d:Object.assign({},t,d),n.forEach(f=>f(t,h))}},o=()=>t,a={setState:r,getState:o,getInitialState:()=>c,subscribe:l=>(n.add(l),()=>n.delete(l))},c=t=e(r,o,a);return a},Ar=e=>e?kc(e):kc,$g=e=>e;function Wo(e,t=$g){const n=E.useSyncExternalStore(e.subscribe,()=>t(e.getState()),()=>t(e.getInitialState()));return E.useDebugValue(n),n}const _c=e=>{const t=Ar(e),n=r=>Wo(t,r);return Object.assign(n,t),n},Ho=e=>e?_c(e):_c,Bg=E.createContext(null),Sd=E.createContext(void 0),Lt=()=>{const e=E.use(Sd);if(!e)throw new Error("useBookingModal must be used within a BookingModalProvider");return e},se={DAY:"day",WEEK:"week",TABLE:"table",MONTH:"month"},zg=(e,t)=>({users:[],bookingViewType:"week",bookingBulkData:{user:{id:"",profile:{id:"",name:""}},booking:[]},updateUsers:n=>e(r=>({...r,users:n})),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)}}),Cd=6e4,Wg=36e5,Nc=Symbol.for("constructDateFrom");function ea(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&Nc in e?e[Nc](t):e instanceof Date?new e.constructor(t):new Date(t)}function ci(e,t){return ea(e,e)}function Td(e,...t){const n=ea.bind(null,t.find(r=>typeof r=="object"));return t.map(n)}function Hg(e,t,n){const r=ci(e);return r.setTime(r.getTime()+t*Cd),r}function Dd(e){return t=>{const r=(e?Math[e]:Math.trunc)(t);return r===0?0:r}}function Ug(e,t,n){const[r,o]=Td(n==null?void 0:n.in,e,t),s=(+r-+o)/Wg;return Dd(n==null?void 0:n.roundingMethod)(s)}function Yg(e,t){return+ci(e)-+ci(t)}function Kg(e,t,n){const r=Yg(e,t)/Cd;return Dd(n==null?void 0:n.roundingMethod)(r)}function Gg(e,t){const[n,r]=Td(e,t.start,t.end);return{start:n,end:r}}function qg(e,t){const{start:n,end:r}=Gg(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 c=[];for(;+i<=s;)c.push(ea(n,i)),i.setHours(i.getHours()+a);return o?c.reverse():c}function Xg(e,t,n){return Hg(e,-t)}function Zg(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Jg(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 po={exports:{}},Qg=po.exports,Ic;function ev(){return Ic||(Ic=1,function(e,t){(function(n,r){e.exports=r()})(Qg,function(){var n=1e3,r=6e4,o=36e5,s="millisecond",i="second",a="minute",c="hour",l="day",u="week",d="month",h="quarter",f="year",S="date",m="Invalid Date",w=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,g=/\[([^\]]+)]|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,p={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(j){var F=["th","st","nd","rd"],N=j%100;return"["+j+(F[(N-20)%10]||F[N]||F[0])+"]"}},v=function(j,F,N){var k=String(j);return!k||k.length>=F?j:""+Array(F+1-k.length).join(N)+j},C={s:v,z:function(j){var F=-j.utcOffset(),N=Math.abs(F),k=Math.floor(N/60),P=N%60;return(F<=0?"+":"-")+v(k,2,"0")+":"+v(P,2,"0")},m:function j(F,N){if(F.date()<N.date())return-j(N,F);var k=12*(N.year()-F.year())+(N.month()-F.month()),P=F.clone().add(k,d),I=N-P<0,A=F.clone().add(k+(I?-1:1),d);return+(-(k+(N-P)/(I?P-A:A-P))||0)},a:function(j){return j<0?Math.ceil(j)||0:Math.floor(j)},p:function(j){return{M:d,y:f,w:u,d:l,D:S,h:c,m:a,s:i,ms:s,Q:h}[j]||String(j||"").toLowerCase().replace(/s$/,"")},u:function(j){return j===void 0}},y="en",M={};M[y]=p;var b="$isDayjsObject",T=function(j){return j instanceof z||!(!j||!j[b])},R=function j(F,N,k){var P;if(!F)return y;if(typeof F=="string"){var I=F.toLowerCase();M[I]&&(P=I),N&&(M[I]=N,P=I);var A=F.split("-");if(!P&&A.length>1)return j(A[0])}else{var V=F.name;M[V]=F,P=V}return!k&&P&&(y=P),P||!k&&y},_=function(j,F){if(T(j))return j.clone();var N=typeof F=="object"?F:{};return N.date=j,N.args=arguments,new z(N)},O=C;O.l=R,O.i=T,O.w=function(j,F){return _(j,{locale:F.$L,utc:F.$u,x:F.$x,$offset:F.$offset})};var z=function(){function j(N){this.$L=R(N.locale,null,!0),this.parse(N),this.$x=this.$x||N.x||{},this[b]=!0}var F=j.prototype;return F.parse=function(N){this.$d=function(k){var P=k.date,I=k.utc;if(P===null)return new Date(NaN);if(O.u(P))return new Date;if(P instanceof Date)return new Date(P);if(typeof P=="string"&&!/Z$/i.test(P)){var A=P.match(w);if(A){var V=A[2]-1||0,W=(A[7]||"0").substring(0,3);return I?new Date(Date.UTC(A[1],V,A[3]||1,A[4]||0,A[5]||0,A[6]||0,W)):new Date(A[1],V,A[3]||1,A[4]||0,A[5]||0,A[6]||0,W)}}return new Date(P)}(N),this.init()},F.init=function(){var N=this.$d;this.$y=N.getFullYear(),this.$M=N.getMonth(),this.$D=N.getDate(),this.$W=N.getDay(),this.$H=N.getHours(),this.$m=N.getMinutes(),this.$s=N.getSeconds(),this.$ms=N.getMilliseconds()},F.$utils=function(){return O},F.isValid=function(){return this.$d.toString()!==m},F.isSame=function(N,k){var P=_(N);return this.startOf(k)<=P&&P<=this.endOf(k)},F.isAfter=function(N,k){return _(N)<this.startOf(k)},F.isBefore=function(N,k){return this.endOf(k)<_(N)},F.$g=function(N,k,P){return O.u(N)?this[k]:this.set(P,N)},F.unix=function(){return Math.floor(this.valueOf()/1e3)},F.valueOf=function(){return this.$d.getTime()},F.startOf=function(N,k){var P=this,I=!!O.u(k)||k,A=O.p(N),V=function(X,U){var ne=O.w(P.$u?Date.UTC(P.$y,U,X):new Date(P.$y,U,X),P);return I?ne:ne.endOf(l)},W=function(X,U){return O.w(P.toDate()[X].apply(P.toDate("s"),(I?[0,0,0,0]:[23,59,59,999]).slice(U)),P)},H=this.$W,L=this.$M,Y=this.$D,K="set"+(this.$u?"UTC":"");switch(A){case f:return I?V(1,0):V(31,11);case d:return I?V(1,L):V(0,L+1);case u:var $=this.$locale().weekStart||0,q=(H<$?H+7:H)-$;return V(I?Y-q:Y+(6-q),L);case l:case S:return W(K+"Hours",0);case c:return W(K+"Minutes",1);case a:return W(K+"Seconds",2);case i:return W(K+"Milliseconds",3);default:return this.clone()}},F.endOf=function(N){return this.startOf(N,!1)},F.$set=function(N,k){var P,I=O.p(N),A="set"+(this.$u?"UTC":""),V=(P={},P[l]=A+"Date",P[S]=A+"Date",P[d]=A+"Month",P[f]=A+"FullYear",P[c]=A+"Hours",P[a]=A+"Minutes",P[i]=A+"Seconds",P[s]=A+"Milliseconds",P)[I],W=I===l?this.$D+(k-this.$W):k;if(I===d||I===f){var H=this.clone().set(S,1);H.$d[V](W),H.init(),this.$d=H.set(S,Math.min(this.$D,H.daysInMonth())).$d}else V&&this.$d[V](W);return this.init(),this},F.set=function(N,k){return this.clone().$set(N,k)},F.get=function(N){return this[O.p(N)]()},F.add=function(N,k){var P,I=this;N=Number(N);var A=O.p(k),V=function(L){var Y=_(I);return O.w(Y.date(Y.date()+Math.round(L*N)),I)};if(A===d)return this.set(d,this.$M+N);if(A===f)return this.set(f,this.$y+N);if(A===l)return V(1);if(A===u)return V(7);var W=(P={},P[a]=r,P[c]=o,P[i]=n,P)[A]||1,H=this.$d.getTime()+N*W;return O.w(H,this)},F.subtract=function(N,k){return this.add(-1*N,k)},F.format=function(N){var k=this,P=this.$locale();if(!this.isValid())return P.invalidDate||m;var I=N||"YYYY-MM-DDTHH:mm:ssZ",A=O.z(this),V=this.$H,W=this.$m,H=this.$M,L=P.weekdays,Y=P.months,K=P.meridiem,$=function(U,ne,B,ie){return U&&(U[ne]||U(k,I))||B[ne].slice(0,ie)},q=function(U){return O.s(V%12||12,U,"0")},X=K||function(U,ne,B){var ie=U<12?"AM":"PM";return B?ie.toLowerCase():ie};return I.replace(g,function(U,ne){return ne||function(B){switch(B){case"YY":return String(k.$y).slice(-2);case"YYYY":return O.s(k.$y,4,"0");case"M":return H+1;case"MM":return O.s(H+1,2,"0");case"MMM":return $(P.monthsShort,H,Y,3);case"MMMM":return $(Y,H);case"D":return k.$D;case"DD":return O.s(k.$D,2,"0");case"d":return String(k.$W);case"dd":return $(P.weekdaysMin,k.$W,L,2);case"ddd":return $(P.weekdaysShort,k.$W,L,3);case"dddd":return L[k.$W];case"H":return String(V);case"HH":return O.s(V,2,"0");case"h":return q(1);case"hh":return q(2);case"a":return X(V,W,!0);case"A":return X(V,W,!1);case"m":return String(W);case"mm":return O.s(W,2,"0");case"s":return String(k.$s);case"ss":return O.s(k.$s,2,"0");case"SSS":return O.s(k.$ms,3,"0");case"Z":return A}return null}(U)||A.replace(":","")})},F.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},F.diff=function(N,k,P){var I,A=this,V=O.p(k),W=_(N),H=(W.utcOffset()-this.utcOffset())*r,L=this-W,Y=function(){return O.m(A,W)};switch(V){case f:I=Y()/12;break;case d:I=Y();break;case h:I=Y()/3;break;case u:I=(L-H)/6048e5;break;case l:I=(L-H)/864e5;break;case c:I=L/o;break;case a:I=L/r;break;case i:I=L/n;break;default:I=L}return P?I:O.a(I)},F.daysInMonth=function(){return this.endOf(d).$D},F.$locale=function(){return M[this.$L]},F.locale=function(N,k){if(!N)return this.$L;var P=this.clone(),I=R(N,k,!0);return I&&(P.$L=I),P},F.clone=function(){return O.w(this.$d,this)},F.toDate=function(){return new Date(this.valueOf())},F.toJSON=function(){return this.isValid()?this.toISOString():null},F.toISOString=function(){return this.$d.toISOString()},F.toString=function(){return this.$d.toUTCString()},j}(),G=z.prototype;return _.prototype=G,[["$ms",s],["$s",i],["$m",a],["$H",c],["$W",l],["$M",d],["$y",f],["$D",S]].forEach(function(j){G[j[1]]=function(F){return this.$g(F,j[0],j[1])}}),_.extend=function(j,F){return j.$i||(j(F,z,_),j.$i=!0),_},_.locale=R,_.isDayjs=T,_.unix=function(j){return _(1e3*j)},_.en=M[y],_.Ls=M,_.p={},_})}(po)),po.exports}var tv=ev();const jc=Zg(tv),jt=600,li=15,ta="00:00",Mn=["Janeiro","Fevereiro","Março","Abril","Maio","Junho","Julho","Agosto","Setembro","Outubro","Novembro","Dezembro"],ui=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],nv=["Domingo","Segunda","Terça","Quarta","Quinta","Sexta","Sábado"],Z={findIndexToStart(e=new Date){const t=ui[e.getDay()];return this.findActualDayIndex(t)},findActualDayIndex(e){return ui.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=Z.getTimeDiff(e.startAt,e.finishAt),r=Z.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 Kg(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`${Mn[e[0].getMonth()].slice(0,3)} - ${Mn[e[1].getMonth()].slice(0,3)}`},timeDiffInSeconds(e,t){const n=jc(e),r=jc(t);return n.diff(r)/6e4},subtractMinutes(e,t){return Xg(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=Z.hourMinutesStringToDate(e),r=Z.addMinutesToDate(n,t);return Z.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}=Z.firstAndLastWeekDays(e),r=t.getMonth();return r!==n.getMonth()?Z.shortMonthDescription(t,n):Mn[r]}},rv=(e,t)=>{const r=qg({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`)},Ed=1,Md=24,ov=Z.generateWeekDays(),sv=(e,t)=>({hours:rv(Ed,Md),daysOfWeek:ov.week,timesRendered:new Map,setTodayDay:n=>{const r=Z.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}=Z.generateWeekDays(n);return r=s,{...o,daysOfWeek:s}}),r},nextWeek:()=>{const n=Z.addDay(t().getWeek().lastDayOfWeek,1);let r=[];const{week:o}=Z.generateWeekDays(n);return r=o,e(s=>({...s,daysOfWeek:o})),r},previousWeek:()=>{const n=Z.addDay(t().getWeek().firstDayOfWeek,-1);let r=[];const{week:o}=Z.generateWeekDays(n);return r=o,e(s=>({...s,daysOfWeek:o})),r},setDays:n=>{const r=t().daysOfWeek[0];if(!r)return[];const o=Z.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}},addTimesRendered:(n,r)=>{e(o=>{const s=o.timesRendered;return s.get(r)?{...o}:(s.set(r,n),{...o,timeRenderedPrev:s})})}}),iv=(e,t)=>({setWeekAndViewType:n=>{const r=t().todayWeek(n);return t().setBookingViewType(se.WEEK),Z.firstAndLastWeekDays(r)},setTodayDayAndViewType:n=>{const r=t().setTodayDay(n);return t().setBookingViewType(se.DAY),r}}),Le=Ho()((...e)=>({...sv(...e),...zg(...e),...iv(...e)})),Rd=()=>{const{setBookingViewType:e,todayWeek:t,setTodayDay:n,daysOfWeek:r,getWeek:o}=Le();return{onViewTypeChange:i=>{switch(i){case se.DAY:{e(se.DAY),n(r[0]);break}case se.WEEK:{e(se.WEEK),t(o().firstDayOfWeek);break}case se.TABLE:{e(se.TABLE),n(o().firstDayOfWeek);break}}}}},Pd=E.createContext(null),Ad=e=>{const t=E.use(Pd);if(!t)throw new Error("Missing useMonthDescription must be within a MonthDescriptionProvider");return Wo(t,e)},di={date:"",startAt:"",finishAt:"",slotStartAt:""},av=e=>Ar((t,n)=>({...di,...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=Z.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(di)})),Od=E.createContext(null),cv=({children:e,ref:t,...n})=>{const r=E.useRef(null);r.current||(r.current=av(n));const o=s=>{var i;(i=r.current)==null||i.getState().updateFinishAt(s)};return E.useImperativeHandle(t,()=>({updateFinishAt:o})),x.jsx(Od,{value:r.current,children:e})},kd=e=>{const t=E.use(Od);if(!t)throw new Error("Missing useNewEventContextProvider must be within a NewEventProvider");return Wo(t,e)},_d={selectedDate:new Date,isBookingLoading:!1,bookingModalState:!1,selectedHour:"",cardsRef:new Map},lv=e=>Ar(t=>({..._d,...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)}))})),uv=({children:e,...t})=>{const n=E.useRef(null);return n.current||(n.current=lv(t)),x.jsx(Bg,{value:n.current,children:e})},dv=({children:e,...t})=>x.jsx(Sd,{value:{...t},children:e}),Nd=E.createContext(null),fv={systemColor:"#000000",isTimeInfoVisible:!0},hv=e=>Ar(t=>({...fv,...e,updateSystemColor:n=>{t(r=>({...r,systemColor:n}))},changeTimeInfoVisibility:n=>{t(r=>({...r,isTimeInfoVisible:n}))}})),pv=({children:e,...t})=>{const n=E.useRef(null);return n.current||(n.current=hv(t)),x.jsx(Nd,{value:n.current,children:e})},Id={month:new Date().getMonth(),fullYear:new Date().getFullYear(),monthMessage:""},mv=e=>Ar((t,n)=>({...e,...Id,updateMonthMessage:r=>{t(o=>({...o,...r}))},updateHeaderDateLabel:r=>{n().updateMonthMessage({month:r.getMonth(),fullYear:r.getFullYear(),monthMessage:Mn[r.getMonth()]})}})),gv=({children:e,...t})=>{const n=E.useRef(null);return n.current||(n.current=mv(t)),x.jsx(Pd,{value:n.current,children:e})},on=e=>{const t=new Date(e.key),n=t.getDate().toString().padStart(2,"0"),r=(t.getMonth()+1).toString().padStart(2,"0");return`${`${t.getFullYear()}-${r}-${n}`};${e.time}`},Tt=Ho((e,t)=>({emptySlotNodes:new Map,selectedNode:"",setEmptySlotNode:(n,r)=>{e(o=>{const s=new Map(o.emptySlotNodes),d=(Ug(new Date(`1970/01/01 ${Md}`),new Date(2014,6,0,Number(Ed),0))+2)*4*7-1;s.size>d&&s.clear();const f=on(r);return s.set(f,n),{...o,emptySlotNodes:s}})},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}})},resetNodes:()=>{e(n=>{const r=new Map(n.emptySlotNodes);return r.clear(),{...n,emptySlotNodes:r}})},resetSelectedNode:()=>e(n=>({...n,selectedNode:""}))})),Uo=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function jn(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function na(e){return"nodeType"in e}function Ne(e){var t,n;return e?jn(e)?e:na(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function ra(e){const{Document:t}=Ne(e);return e instanceof t}function Or(e){return jn(e)?!1:e instanceof Ne(e).HTMLElement}function jd(e){return e instanceof Ne(e).SVGElement}function Ln(e){return e?jn(e)?e.document:na(e)?ra(e)?e:Or(e)||jd(e)?e.ownerDocument:document:document:document}const yt=Uo?E.useLayoutEffect:E.useEffect;function Yo(e){const t=E.useRef(e);return yt(()=>{t.current=e}),E.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 vv(){const e=E.useRef(null),t=E.useCallback((r,o)=>{e.current=setInterval(r,o)},[]),n=E.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,n]}function gr(e,t){t===void 0&&(t=[e]);const n=E.useRef(e);return yt(()=>{n.current!==e&&(n.current=e)},t),n}function kr(e,t){const n=E.useRef();return E.useMemo(()=>{const r=e(n.current);return n.current=r,r},[...t])}function To(e){const t=Yo(e),n=E.useRef(null),r=E.useCallback(o=>{o!==n.current&&(t==null||t(o,n.current)),n.current=o},[]);return[n,r]}function Do(e){const t=E.useRef();return E.useEffect(()=>{t.current=e},[e]),t.current}let Es={};function Ko(e,t){return E.useMemo(()=>{if(t)return t;const n=Es[e]==null?0:Es[e]+1;return Es[e]=n,e+"-"+n},[e,t])}function Ld(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[c,l]of a){const u=s[c];u!=null&&(s[c]=u+e*l)}return s},{...t})}}const Rn=Ld(1),Eo=Ld(-1);function yv(e){return"clientX"in e&&"clientY"in e}function oa(e){if(!e)return!1;const{KeyboardEvent:t}=Ne(e.target);return t&&e instanceof t}function bv(e){if(!e)return!1;const{TouchEvent:t}=Ne(e.target);return t&&e instanceof t}function Mo(e){if(bv(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 yv(e)?{x:e.clientX,y:e.clientY}:null}const vr=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[vr.Translate.toString(e),vr.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),Lc="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function xv(e){return e.matches(Lc)?e:e.querySelector(Lc)}const wv={display:"none"};function Sv(e){let{id:t,value:n}=e;return E.createElement("div",{id:t,style:wv},n)}function Cv(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 E.createElement("div",{id:t,style:o,role:"status","aria-live":r,"aria-atomic":!0},n)}function Tv(){const[e,t]=E.useState("");return{announce:E.useCallback(r=>{r!=null&&t(r)},[]),announcement:e}}const Vd=E.createContext(null);function _r(e){const t=E.useContext(Vd);E.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function Dv(){const[e]=E.useState(()=>new Set),t=E.useCallback(r=>(e.add(r),()=>e.delete(r)),[e]);return[E.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 Ev={draggable:`
|
|
6
|
+
To pick up a draggable item, press the space bar.
|
|
7
|
+
While dragging, use the arrow keys to move the item.
|
|
8
|
+
Press space again to drop the item in its new position, or press escape to cancel.
|
|
9
|
+
`},Mv={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 Rv(e){let{announcements:t=Mv,container:n,hiddenTextDescribedById:r,screenReaderInstructions:o=Ev}=e;const{announce:s,announcement:i}=Tv(),a=Ko("DndLiveRegion"),[c,l]=E.useState(!1);if(E.useEffect(()=>{l(!0)},[]),_r(E.useMemo(()=>({onDragStart(d){let{active:h}=d;s(t.onDragStart({active:h}))},onDragMove(d){let{active:h,over:f}=d;t.onDragMove&&s(t.onDragMove({active:h,over:f}))},onDragOver(d){let{active:h,over:f}=d;s(t.onDragOver({active:h,over:f}))},onDragEnd(d){let{active:h,over:f}=d;s(t.onDragEnd({active:h,over:f}))},onDragCancel(d){let{active:h,over:f}=d;s(t.onDragCancel({active:h,over:f}))}}),[s,t])),!c)return null;const u=E.createElement(E.Fragment,null,E.createElement(Sv,{id:r,value:o.draggable}),E.createElement(Cv,{id:a,announcement:i}));return n?vt.createPortal(u,n):u}var Se;(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"})(Se||(Se={}));function Ro(){}function Vc(e,t){return E.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function Pv(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return E.useMemo(()=>[...t].filter(r=>r!=null),[...t])}const tt=Object.freeze({x:0,y:0});function Av(e,t){const n=Mo(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 Ov(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function kv(e,t){if(!e||e.length===0)return null;const[n]=e;return n[t]}function _v(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 c=t.width*t.height,l=e.width*e.height,u=i*a,d=u/(c+l-u);return Number(d.toFixed(4))}return 0}const Nv=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 c=_v(a,t);c>0&&o.push({id:i,data:{droppableContainer:s,value:c}})}}return o.sort(Ov)};function Iv(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function Fd(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:tt}function jv(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 Lv=jv(1);function $d(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 Vv(e,t,n){const r=$d(t);if(!r)return e;const{scaleX:o,scaleY:s,x:i,y:a}=r,c=e.left-i-(1-o)*parseFloat(n),l=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:l,right:c+u,bottom:l+d,left:c}}const Fv={ignoreTransform:!1};function Nr(e,t){t===void 0&&(t=Fv);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:l,transformOrigin:u}=Ne(e).getComputedStyle(e);l&&(n=Vv(n,l,u))}const{top:r,left:o,width:s,height:i,bottom:a,right:c}=n;return{top:r,left:o,width:s,height:i,bottom:a,right:c}}function Fc(e){return Nr(e,{ignoreTransform:!0})}function $v(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function Bv(e,t){return t===void 0&&(t=Ne(e).getComputedStyle(e)),t.position==="fixed"}function zv(e,t){t===void 0&&(t=Ne(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 sa(e,t){const n=[];function r(o){if(t!=null&&n.length>=t||!o)return n;if(ra(o)&&o.scrollingElement!=null&&!n.includes(o.scrollingElement))return n.push(o.scrollingElement),n;if(!Or(o)||jd(o)||n.includes(o))return n;const s=Ne(e).getComputedStyle(o);return o!==e&&zv(o,s)&&n.push(o),Bv(o,s)?n:r(o.parentNode)}return e?r(e):n}function Bd(e){const[t]=sa(e,1);return t??null}function Ms(e){return!Uo||!e?null:jn(e)?e:na(e)?ra(e)||e===Ln(e).scrollingElement?window:Or(e)?e:null:null}function zd(e){return jn(e)?e.scrollX:e.scrollLeft}function Wd(e){return jn(e)?e.scrollY:e.scrollTop}function fi(e){return{x:zd(e),y:Wd(e)}}var Ce;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(Ce||(Ce={}));function Hd(e){return!Uo||!e?!1:e===document.scrollingElement}function Ud(e){const t={x:0,y:0},n=Hd(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 Wv={x:.2,y:.2};function Hv(e,t,n,r,o){let{top:s,left:i,right:a,bottom:c}=n;r===void 0&&(r=10),o===void 0&&(o=Wv);const{isTop:l,isBottom:u,isLeft:d,isRight:h}=Ud(e),f={x:0,y:0},S={x:0,y:0},m={height:t.height*o.y,width:t.width*o.x};return!l&&s<=t.top+m.height?(f.y=Ce.Backward,S.y=r*Math.abs((t.top+m.height-s)/m.height)):!u&&c>=t.bottom-m.height&&(f.y=Ce.Forward,S.y=r*Math.abs((t.bottom-m.height-c)/m.height)),!h&&a>=t.right-m.width?(f.x=Ce.Forward,S.x=r*Math.abs((t.right-m.width-a)/m.width)):!d&&i<=t.left+m.width&&(f.x=Ce.Backward,S.x=r*Math.abs((t.left+m.width-i)/m.width)),{direction:f,speed:S}}function Uv(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 Yd(e){return e.reduce((t,n)=>Rn(t,fi(n)),tt)}function Yv(e){return e.reduce((t,n)=>t+zd(n),0)}function Kv(e){return e.reduce((t,n)=>t+Wd(n),0)}function Kd(e,t){if(t===void 0&&(t=Nr),!e)return;const{top:n,left:r,bottom:o,right:s}=t(e);Bd(e)&&(o<=0||s<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const Gv=[["x",["left","right"],Yv],["y",["top","bottom"],Kv]];class ia{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=sa(n),o=Yd(r);this.rect={...t},this.width=t.width,this.height=t.height;for(const[s,i,a]of Gv)for(const c of i)Object.defineProperty(this,c,{get:()=>{const l=a(r),u=o[s]-l;return this.rect[c]+u},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class lr{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 qv(e){const{EventTarget:t}=Ne(e);return e instanceof t?e:Ln(e)}function Rs(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 Ge;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(Ge||(Ge={}));function $c(e){e.preventDefault()}function Xv(e){e.stopPropagation()}var he;(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"})(he||(he={}));const Gd={start:[he.Space,he.Enter],cancel:[he.Esc],end:[he.Space,he.Enter,he.Tab]},Zv=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case he.Right:return{...n,x:n.x+25};case he.Left:return{...n,x:n.x-25};case he.Down:return{...n,y:n.y+25};case he.Up:return{...n,y:n.y-25}}};class qd{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 lr(Ln(n)),this.windowListeners=new lr(Ne(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Ge.Resize,this.handleCancel),this.windowListeners.add(Ge.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Ge.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,r=t.node.current;r&&Kd(r),n(tt)}handleKeyDown(t){if(oa(t)){const{active:n,context:r,options:o}=this.props,{keyboardCodes:s=Gd,coordinateGetter:i=Zv,scrollBehavior:a="smooth"}=o,{code:c}=t;if(s.end.includes(c)){this.handleEnd(t);return}if(s.cancel.includes(c)){this.handleCancel(t);return}const{collisionRect:l}=r.current,u=l?{x:l.left,y:l.top}:tt;this.referenceCoordinates||(this.referenceCoordinates=u);const d=i(t,{active:n,context:r.current,currentCoordinates:u});if(d){const h=Eo(d,u),f={x:0,y:0},{scrollableAncestors:S}=r.current;for(const m of S){const w=t.code,{isTop:g,isRight:p,isLeft:v,isBottom:C,maxScroll:y,minScroll:M}=Ud(m),b=Uv(m),T={x:Math.min(w===he.Right?b.right-b.width/2:b.right,Math.max(w===he.Right?b.left:b.left+b.width/2,d.x)),y:Math.min(w===he.Down?b.bottom-b.height/2:b.bottom,Math.max(w===he.Down?b.top:b.top+b.height/2,d.y))},R=w===he.Right&&!p||w===he.Left&&!v,_=w===he.Down&&!C||w===he.Up&&!g;if(R&&T.x!==d.x){const O=m.scrollLeft+h.x,z=w===he.Right&&O<=y.x||w===he.Left&&O>=M.x;if(z&&!h.y){m.scrollTo({left:O,behavior:a});return}z?f.x=m.scrollLeft-O:f.x=w===he.Right?m.scrollLeft-y.x:m.scrollLeft-M.x,f.x&&m.scrollBy({left:-f.x,behavior:a});break}else if(_&&T.y!==d.y){const O=m.scrollTop+h.y,z=w===he.Down&&O<=y.y||w===he.Up&&O>=M.y;if(z&&!h.x){m.scrollTo({top:O,behavior:a});return}z?f.y=m.scrollTop-O:f.y=w===he.Down?m.scrollTop-y.y:m.scrollTop-M.y,f.y&&m.scrollBy({top:-f.y,behavior:a});break}}this.handleMove(t,Rn(Eo(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()}}qd.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=Gd,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 zc(e){return!!(e&&"delay"in e)}class aa{constructor(t,n,r){var o;r===void 0&&(r=qv(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=Ln(i),this.documentListeners=new lr(this.document),this.listeners=new lr(r),this.windowListeners=new lr(Ne(i)),this.initialCoordinates=(o=Mo(s))!=null?o:tt,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(Ge.Resize,this.handleCancel),this.windowListeners.add(Ge.DragStart,$c),this.windowListeners.add(Ge.VisibilityChange,this.handleCancel),this.windowListeners.add(Ge.ContextMenu,$c),this.documentListeners.add(Ge.Keydown,this.handleKeydown),n){if(r!=null&&r({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(zc(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(Ge.Click,Xv,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Ge.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 c=(n=Mo(t))!=null?n:tt,l=Eo(o,c);if(!r&&a){if(Bc(a)){if(a.tolerance!=null&&Rs(l,a.tolerance))return this.handleCancel();if(Rs(l,a.distance))return this.handleStart()}if(zc(a)&&Rs(l,a.tolerance))return this.handleCancel();this.handlePending(a,l);return}t.cancelable&&t.preventDefault(),i(c)}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===he.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const Jv={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class Xd extends aa{constructor(t){const{event:n}=t,r=Ln(n.target);super(t,Jv,r)}}Xd.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 Qv={move:{name:"mousemove"},end:{name:"mouseup"}};var hi;(function(e){e[e.RightClick=2]="RightClick"})(hi||(hi={}));class Zd extends aa{constructor(t){super(t,Qv,Ln(t.event.target))}}Zd.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button===hi.RightClick?!1:(r==null||r({event:n}),!0)}}];const Ps={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class Jd extends aa{constructor(t){super(t,Ps)}static setup(){return window.addEventListener(Ps.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(Ps.move.name,t)};function t(){}}}Jd.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 ur;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(ur||(ur={}));var Po;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(Po||(Po={}));function ey(e){let{acceleration:t,activator:n=ur.Pointer,canScroll:r,draggingRect:o,enabled:s,interval:i=5,order:a=Po.TreeOrder,pointerCoordinates:c,scrollableAncestors:l,scrollableAncestorRects:u,delta:d,threshold:h}=e;const f=ny({delta:d,disabled:!s}),[S,m]=vv(),w=E.useRef({x:0,y:0}),g=E.useRef({x:0,y:0}),p=E.useMemo(()=>{switch(n){case ur.Pointer:return c?{top:c.y,bottom:c.y,left:c.x,right:c.x}:null;case ur.DraggableRect:return o}},[n,o,c]),v=E.useRef(null),C=E.useCallback(()=>{const M=v.current;if(!M)return;const b=w.current.x*g.current.x,T=w.current.y*g.current.y;M.scrollBy(b,T)},[]),y=E.useMemo(()=>a===Po.TreeOrder?[...l].reverse():l,[a,l]);E.useEffect(()=>{if(!s||!l.length||!p){m();return}for(const M of y){if((r==null?void 0:r(M))===!1)continue;const b=l.indexOf(M),T=u[b];if(!T)continue;const{direction:R,speed:_}=Hv(M,T,p,t,h);for(const O of["x","y"])f[O][R[O]]||(_[O]=0,R[O]=0);if(_.x>0||_.y>0){m(),v.current=M,S(C,i),w.current=_,g.current=R;return}}w.current={x:0,y:0},g.current={x:0,y:0},m()},[t,C,r,m,s,i,JSON.stringify(p),JSON.stringify(f),S,l,y,u,JSON.stringify(h)])}const ty={x:{[Ce.Backward]:!1,[Ce.Forward]:!1},y:{[Ce.Backward]:!1,[Ce.Forward]:!1}};function ny(e){let{delta:t,disabled:n}=e;const r=Do(t);return kr(o=>{if(n||!r||!o)return ty;const s={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[Ce.Backward]:o.x[Ce.Backward]||s.x===-1,[Ce.Forward]:o.x[Ce.Forward]||s.x===1},y:{[Ce.Backward]:o.y[Ce.Backward]||s.y===-1,[Ce.Forward]:o.y[Ce.Forward]||s.y===1}}},[n,t,r])}function ry(e,t){const n=t!=null?e.get(t):void 0,r=n?n.node.current:null;return kr(o=>{var s;return t==null?null:(s=r??o)!=null?s:null},[r,t])}function oy(e,t){return E.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 yr;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(yr||(yr={}));var pi;(function(e){e.Optimized="optimized"})(pi||(pi={}));const Wc=new Map;function sy(e,t){let{dragging:n,dependencies:r,config:o}=t;const[s,i]=E.useState(null),{frequency:a,measure:c,strategy:l}=o,u=E.useRef(e),d=w(),h=gr(d),f=E.useCallback(function(g){g===void 0&&(g=[]),!h.current&&i(p=>p===null?g:p.concat(g.filter(v=>!p.includes(v))))},[h]),S=E.useRef(null),m=kr(g=>{if(d&&!n)return Wc;if(!g||g===Wc||u.current!==e||s!=null){const p=new Map;for(let v of e){if(!v)continue;if(s&&s.length>0&&!s.includes(v.id)&&v.rect.current){p.set(v.id,v.rect.current);continue}const C=v.node.current,y=C?new ia(c(C),C):null;v.rect.current=y,y&&p.set(v.id,y)}return p}return g},[e,s,n,d,c]);return E.useEffect(()=>{u.current=e},[e]),E.useEffect(()=>{d||f()},[n,d]),E.useEffect(()=>{s&&s.length>0&&i(null)},[JSON.stringify(s)]),E.useEffect(()=>{d||typeof a!="number"||S.current!==null||(S.current=setTimeout(()=>{f(),S.current=null},a))},[a,d,f,...r]),{droppableRects:m,measureDroppableContainers:f,measuringScheduled:s!=null};function w(){switch(l){case yr.Always:return!1;case yr.BeforeDragging:return n;default:return!n}}}function ca(e,t){return kr(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function iy(e,t){return ca(e,t)}function ay(e){let{callback:t,disabled:n}=e;const r=Yo(t),o=E.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:s}=window;return new s(r)},[r,n]);return E.useEffect(()=>()=>o==null?void 0:o.disconnect(),[o]),o}function Go(e){let{callback:t,disabled:n}=e;const r=Yo(t),o=E.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:s}=window;return new s(r)},[n]);return E.useEffect(()=>()=>o==null?void 0:o.disconnect(),[o]),o}function cy(e){return new ia(Nr(e),e)}function Hc(e,t,n){t===void 0&&(t=cy);const[r,o]=E.useState(null);function s(){o(c=>{if(!e)return null;if(e.isConnected===!1){var l;return(l=c??n)!=null?l:null}const u=t(e);return JSON.stringify(c)===JSON.stringify(u)?c:u})}const i=ay({callback(c){if(e)for(const l of c){const{type:u,target:d}=l;if(u==="childList"&&d instanceof HTMLElement&&d.contains(e)){s();break}}}}),a=Go({callback:s});return yt(()=>{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 ly(e){const t=ca(e);return Fd(e,t)}const Uc=[];function uy(e){const t=E.useRef(e),n=kr(r=>e?r&&r!==Uc&&e&&t.current&&e.parentNode===t.current.parentNode?r:sa(e):Uc,[e]);return E.useEffect(()=>{t.current=e},[e]),n}function dy(e){const[t,n]=E.useState(null),r=E.useRef(e),o=E.useCallback(s=>{const i=Ms(s.target);i&&n(a=>a?(a.set(i,fi(i)),new Map(a)):null)},[]);return E.useEffect(()=>{const s=r.current;if(e!==s){i(s);const a=e.map(c=>{const l=Ms(c);return l?(l.addEventListener("scroll",o,{passive:!0}),[l,fi(l)]):null}).filter(c=>c!=null);n(a.length?new Map(a):null),r.current=e}return()=>{i(e),i(s)};function i(a){a.forEach(c=>{const l=Ms(c);l==null||l.removeEventListener("scroll",o)})}},[o,e]),E.useMemo(()=>e.length?t?Array.from(t.values()).reduce((s,i)=>Rn(s,i),tt):Yd(e):tt,[e,t])}function Yc(e,t){t===void 0&&(t=[]);const n=E.useRef(null);return E.useEffect(()=>{n.current=null},t),E.useEffect(()=>{const r=e!==tt;r&&!n.current&&(n.current=e),!r&&n.current&&(n.current=null)},[e]),n.current?Eo(e,n.current):tt}function fy(e){E.useEffect(()=>{if(!Uo)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 hy(e,t){return E.useMemo(()=>e.reduce((n,r)=>{let{eventName:o,handler:s}=r;return n[o]=i=>{s(i,t)},n},{}),[e,t])}function Qd(e){return E.useMemo(()=>e?$v(e):null,[e])}const Kc=[];function py(e,t){t===void 0&&(t=Nr);const[n]=e,r=Qd(n?Ne(n):null),[o,s]=E.useState(Kc);function i(){s(()=>e.length?e.map(c=>Hd(c)?r:new ia(t(c),c)):Kc)}const a=Go({callback:i});return yt(()=>{a==null||a.disconnect(),i(),e.forEach(c=>a==null?void 0:a.observe(c))},[e]),o}function ef(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return Or(t)?t:e}function my(e){let{measure:t}=e;const[n,r]=E.useState(null),o=E.useCallback(l=>{for(const{target:u}of l)if(Or(u)){r(d=>{const h=t(u);return d?{...d,width:h.width,height:h.height}:h});break}},[t]),s=Go({callback:o}),i=E.useCallback(l=>{const u=ef(l);s==null||s.disconnect(),u&&(s==null||s.observe(u)),r(u?t(u):null)},[t,s]),[a,c]=To(i);return E.useMemo(()=>({nodeRef:a,rect:n,setRef:c}),[n,a,c])}const gy=[{sensor:Xd,options:{}},{sensor:qd,options:{}}],vy={current:{}},mo={draggable:{measure:Fc},droppable:{measure:Fc,strategy:yr.WhileDragging,frequency:pi.Optimized},dragOverlay:{measure:Nr}};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 yy={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:Ro},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:mo,measureDroppableContainers:Ro,windowRect:null,measuringScheduled:!1},tf={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Ro,draggableNodes:new Map,over:null,measureDroppableContainers:Ro},Ir=E.createContext(tf),nf=E.createContext(yy);function by(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new dr}}}function xy(e,t){switch(t.type){case Se.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case Se.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 Se.DragEnd:case Se.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Se.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 Se.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 Se.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 wy(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:o}=E.useContext(Ir),s=Do(r),i=Do(n==null?void 0:n.id);return E.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:c,node:l}=a;if(!c.current&&!l.current)return;requestAnimationFrame(()=>{for(const u of[c.current,l.current]){if(!u)continue;const d=xv(u);if(d){d.focus();break}}})}},[r,t,o,i,s]),null}function rf(e,t){let{transform:n,...r}=t;return e!=null&&e.length?e.reduce((o,s)=>s({transform:o,...r}),n):n}function Sy(e){return E.useMemo(()=>({draggable:{...mo.draggable,...e==null?void 0:e.draggable},droppable:{...mo.droppable,...e==null?void 0:e.droppable},dragOverlay:{...mo.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 Cy(e){let{activeNode:t,measure:n,initialRect:r,config:o=!0}=e;const s=E.useRef(!1),{x:i,y:a}=typeof o=="boolean"?{x:o,y:o}:o;yt(()=>{if(!i&&!a||!t){s.current=!1;return}if(s.current||!r)return;const l=t==null?void 0:t.node.current;if(!l||l.isConnected===!1)return;const u=n(l),d=Fd(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 h=Bd(l);h&&h.scrollBy({top:d.y,left:d.x})}},[t,i,a,r,n])}const qo=E.createContext({...tt,scaleX:1,scaleY:1});var It;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(It||(It={}));const la=E.memo(function(t){var n,r,o,s;let{id:i,accessibility:a,autoScroll:c=!0,children:l,sensors:u=gy,collisionDetection:d=Nv,measuring:h,modifiers:f,...S}=t;const m=E.useReducer(xy,void 0,by),[w,g]=m,[p,v]=Dv(),[C,y]=E.useState(It.Uninitialized),M=C===It.Initialized,{draggable:{active:b,nodes:T,translate:R},droppable:{containers:_}}=w,O=b!=null?T.get(b):null,z=E.useRef({initial:null,translated:null}),G=E.useMemo(()=>{var Me;return b!=null?{id:b,data:(Me=O==null?void 0:O.data)!=null?Me:vy,rect:z}:null},[b,O]),j=E.useRef(null),[F,N]=E.useState(null),[k,P]=E.useState(null),I=gr(S,Object.values(S)),A=Ko("DndDescribedBy",i),V=E.useMemo(()=>_.getEnabled(),[_]),W=Sy(h),{droppableRects:H,measureDroppableContainers:L,measuringScheduled:Y}=sy(V,{dragging:M,dependencies:[R.x,R.y],config:W.droppable}),K=ry(T,b),$=E.useMemo(()=>k?Mo(k):null,[k]),q=Og(),X=iy(K,W.draggable.measure);Cy({activeNode:b!=null?T.get(b):null,config:q.layoutShiftCompensation,initialRect:X,measure:W.draggable.measure});const U=Hc(K,W.draggable.measure,X),ne=Hc(K?K.parentElement:null),B=E.useRef({activatorEvent:null,active:null,activeNode:K,collisionRect:null,collisions:null,droppableRects:H,draggableNodes:T,draggingNode:null,draggingNodeRect:null,droppableContainers:_,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),ie=_.getNodeFor((n=B.current.over)==null?void 0:n.id),pe=my({measure:W.dragOverlay.measure}),Oe=(r=pe.nodeRef.current)!=null?r:K,Ee=M?(o=pe.rect)!=null?o:U:null,ot=!!(pe.nodeRef.current&&pe.rect),J=ly(ot?null:U),ce=Qd(Oe?Ne(Oe):null),ye=uy(M?ie??K:null),Ve=py(ye),He=rf(f,{transform:{x:R.x-J.x,y:R.y-J.y,scaleX:1,scaleY:1},activatorEvent:k,active:G,activeNodeRect:U,containerNodeRect:ne,draggingNodeRect:Ee,over:B.current.over,overlayNodeRect:pe.rect,scrollableAncestors:ye,scrollableAncestorRects:Ve,windowRect:ce}),Kn=$?Rn($,R):null,ws=dy(ye),Mc=Yc(ws),Ss=Yc(ws,[U]),pn=Rn(He,Mc),mn=Ee?Lv(Ee,He):null,Gn=G&&mn?d({active:G,collisionRect:mn,droppableRects:H,droppableContainers:V,pointerCoordinates:Kn}):null,Rc=kv(Gn,"id"),[Et,Pc]=E.useState(null),Eg=ot?He:Rn(He,Ss),Mg=Iv(Eg,(s=Et==null?void 0:Et.rect)!=null?s:null,U),Cs=E.useRef(null),Ac=E.useCallback((Me,Fe)=>{let{sensor:$e,options:Mt}=Fe;if(j.current==null)return;const Ue=T.get(j.current);if(!Ue)return;const Be=Me.nativeEvent,st=new $e({active:j.current,activeNode:Ue,event:Be,options:Mt,context:B,onAbort(Te){if(!T.get(Te))return;const{onDragAbort:it}=I.current,pt={id:Te};it==null||it(pt),p({type:"onDragAbort",event:pt})},onPending(Te,Rt,it,pt){if(!T.get(Te))return;const{onDragPending:Xn}=I.current,Pt={id:Te,constraint:Rt,initialCoordinates:it,offset:pt};Xn==null||Xn(Pt),p({type:"onDragPending",event:Pt})},onStart(Te){const Rt=j.current;if(Rt==null)return;const it=T.get(Rt);if(!it)return;const{onDragStart:pt}=I.current,qn={activatorEvent:Be,active:{id:Rt,data:it.data,rect:z}};vt.unstable_batchedUpdates(()=>{pt==null||pt(qn),y(It.Initializing),g({type:Se.DragStart,initialCoordinates:Te,active:Rt}),p({type:"onDragStart",event:qn}),N(Cs.current),P(Be)})},onMove(Te){g({type:Se.DragMove,coordinates:Te})},onEnd:gn(Se.DragEnd),onCancel:gn(Se.DragCancel)});Cs.current=st;function gn(Te){return async function(){const{active:it,collisions:pt,over:qn,scrollAdjustedTranslate:Xn}=B.current;let Pt=null;if(it&&Xn){const{cancelDrop:Zn}=I.current;Pt={activatorEvent:Be,active:it,collisions:pt,delta:Xn,over:qn},Te===Se.DragEnd&&typeof Zn=="function"&&await Promise.resolve(Zn(Pt))&&(Te=Se.DragCancel)}j.current=null,vt.unstable_batchedUpdates(()=>{g({type:Te}),y(It.Uninitialized),Pc(null),N(null),P(null),Cs.current=null;const Zn=Te===Se.DragEnd?"onDragEnd":"onDragCancel";if(Pt){const Ts=I.current[Zn];Ts==null||Ts(Pt),p({type:Zn,event:Pt})}})}}},[T]),Rg=E.useCallback((Me,Fe)=>($e,Mt)=>{const Ue=$e.nativeEvent,Be=T.get(Mt);if(j.current!==null||!Be||Ue.dndKit||Ue.defaultPrevented)return;const st={active:Be};Me($e,Fe.options,st)===!0&&(Ue.dndKit={capturedBy:Fe.sensor},j.current=Mt,Ac($e,Fe))},[T,Ac]),Oc=oy(u,Rg);fy(u),yt(()=>{U&&C===It.Initializing&&y(It.Initialized)},[U,C]),E.useEffect(()=>{const{onDragMove:Me}=I.current,{active:Fe,activatorEvent:$e,collisions:Mt,over:Ue}=B.current;if(!Fe||!$e)return;const Be={active:Fe,activatorEvent:$e,collisions:Mt,delta:{x:pn.x,y:pn.y},over:Ue};vt.unstable_batchedUpdates(()=>{Me==null||Me(Be),p({type:"onDragMove",event:Be})})},[pn.x,pn.y]),E.useEffect(()=>{const{active:Me,activatorEvent:Fe,collisions:$e,droppableContainers:Mt,scrollAdjustedTranslate:Ue}=B.current;if(!Me||j.current==null||!Fe||!Ue)return;const{onDragOver:Be}=I.current,st=Mt.get(Rc),gn=st&&st.rect.current?{id:st.id,rect:st.rect.current,data:st.data,disabled:st.disabled}:null,Te={active:Me,activatorEvent:Fe,collisions:$e,delta:{x:Ue.x,y:Ue.y},over:gn};vt.unstable_batchedUpdates(()=>{Pc(gn),Be==null||Be(Te),p({type:"onDragOver",event:Te})})},[Rc]),yt(()=>{B.current={activatorEvent:k,active:G,activeNode:K,collisionRect:mn,collisions:Gn,droppableRects:H,draggableNodes:T,draggingNode:Oe,draggingNodeRect:Ee,droppableContainers:_,over:Et,scrollableAncestors:ye,scrollAdjustedTranslate:pn},z.current={initial:Ee,translated:mn}},[G,K,Gn,mn,T,Oe,Ee,H,_,Et,ye,pn]),ey({...q,delta:R,draggingRect:mn,pointerCoordinates:Kn,scrollableAncestors:ye,scrollableAncestorRects:Ve});const Pg=E.useMemo(()=>({active:G,activeNode:K,activeNodeRect:U,activatorEvent:k,collisions:Gn,containerNodeRect:ne,dragOverlay:pe,draggableNodes:T,droppableContainers:_,droppableRects:H,over:Et,measureDroppableContainers:L,scrollableAncestors:ye,scrollableAncestorRects:Ve,measuringConfiguration:W,measuringScheduled:Y,windowRect:ce}),[G,K,U,k,Gn,ne,pe,T,_,H,Et,L,ye,Ve,W,Y,ce]),Ag=E.useMemo(()=>({activatorEvent:k,activators:Oc,active:G,activeNodeRect:U,ariaDescribedById:{draggable:A},dispatch:g,draggableNodes:T,over:Et,measureDroppableContainers:L}),[k,Oc,G,U,g,A,T,Et,L]);return E.createElement(Vd.Provider,{value:v},E.createElement(Ir.Provider,{value:Ag},E.createElement(nf.Provider,{value:Pg},E.createElement(qo.Provider,{value:Mg},l)),E.createElement(wy,{disabled:(a==null?void 0:a.restoreFocus)===!1})),E.createElement(Rv,{...a,hiddenTextDescribedById:A}));function Og(){const Me=(F==null?void 0:F.autoScrollEnabled)===!1,Fe=typeof c=="object"?c.enabled===!1:c===!1,$e=M&&!Me&&!Fe;return typeof c=="object"?{...c,enabled:$e}:{enabled:$e}}}),Ty=E.createContext(null),Gc="button",Dy="Draggable";function ua(e){let{id:t,data:n,disabled:r=!1,attributes:o}=e;const s=Ko(Dy),{activators:i,activatorEvent:a,active:c,activeNodeRect:l,ariaDescribedById:u,draggableNodes:d,over:h}=E.useContext(Ir),{role:f=Gc,roleDescription:S="draggable",tabIndex:m=0}=o??{},w=(c==null?void 0:c.id)===t,g=E.useContext(w?qo:Ty),[p,v]=To(),[C,y]=To(),M=hy(i,t),b=gr(n);yt(()=>(d.set(t,{id:t,key:s,node:p,activatorNode:C,data:b}),()=>{const R=d.get(t);R&&R.key===s&&d.delete(t)}),[d,t]);const T=E.useMemo(()=>({role:f,tabIndex:m,"aria-disabled":r,"aria-pressed":w&&f===Gc?!0:void 0,"aria-roledescription":S,"aria-describedby":u.draggable}),[r,f,m,w,S,u.draggable]);return{active:c,activatorEvent:a,activeNodeRect:l,attributes:T,isDragging:w,listeners:r?void 0:M,node:p,over:h,setNodeRef:v,setActivatorNodeRef:y,transform:g}}function Ey(){return E.useContext(nf)}const My="Droppable",Ry={timeout:25};function qr(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:o}=e;const s=Ko(My),{active:i,dispatch:a,over:c,measureDroppableContainers:l}=E.useContext(Ir),u=E.useRef({disabled:n}),d=E.useRef(!1),h=E.useRef(null),f=E.useRef(null),{disabled:S,updateMeasurementsFor:m,timeout:w}={...Ry,...o},g=gr(m??r),p=E.useCallback(()=>{if(!d.current){d.current=!0;return}f.current!=null&&clearTimeout(f.current),f.current=setTimeout(()=>{l(Array.isArray(g.current)?g.current:[g.current]),f.current=null},w)},[w]),v=Go({callback:p,disabled:S||!i}),C=E.useCallback((T,R)=>{v&&(R&&(v.unobserve(R),d.current=!1),T&&v.observe(T))},[v]),[y,M]=To(C),b=gr(t);return E.useEffect(()=>{!v||!y.current||(v.disconnect(),d.current=!1,v.observe(y.current))},[y,v]),E.useEffect(()=>(a({type:Se.RegisterDroppable,element:{id:r,key:s,disabled:n,node:y,rect:h,data:b}}),()=>a({type:Se.UnregisterDroppable,key:s,id:r})),[r]),E.useEffect(()=>{n!==u.current.disabled&&(a({type:Se.SetDroppableDisabled,id:r,key:s,disabled:n}),u.current.disabled=n)},[r,s,n,a]),{active:i,rect:h,isOver:(c==null?void 0:c.id)===r,node:y,over:c,setNodeRef:M}}function Py(e){let{animation:t,children:n}=e;const[r,o]=E.useState(null),[s,i]=E.useState(null),a=Do(n);return!n&&!r&&a&&o(a),yt(()=>{if(!s)return;const c=r==null?void 0:r.key,l=r==null?void 0:r.props.id;if(c==null||l==null){o(null);return}Promise.resolve(t(l,s)).then(()=>{o(null)})},[t,r,s]),E.createElement(E.Fragment,null,n,r?E.cloneElement(r,{ref:i}):null)}const Ay={x:0,y:0,scaleX:1,scaleY:1};function Oy(e){let{children:t}=e;return E.createElement(Ir.Provider,{value:tf},E.createElement(qo.Provider,{value:Ay},t))}const ky={position:"fixed",touchAction:"none"},_y=e=>oa(e)?"transform 250ms ease":void 0,Ny=E.forwardRef((e,t)=>{let{as:n,activatorEvent:r,adjustScale:o,children:s,className:i,rect:a,style:c,transform:l,transition:u=_y}=e;if(!a)return null;const d=o?l:{...l,scaleX:1,scaleY:1},h={...ky,width:a.width,height:a.height,top:a.top,left:a.left,transform:vr.Transform.toString(d),transformOrigin:o&&r?Av(r,a):void 0,transition:typeof u=="function"?u(r):u,...c};return E.createElement(n,{className:i,style:h,ref:t},s)}),Iy=e=>t=>{let{active:n,dragOverlay:r}=t;const o={},{styles:s,className:i}=e;if(s!=null&&s.active)for(const[a,c]of Object.entries(s.active))c!==void 0&&(o[a]=n.node.style.getPropertyValue(a),n.node.style.setProperty(a,c));if(s!=null&&s.dragOverlay)for(const[a,c]of Object.entries(s.dragOverlay))c!==void 0&&r.node.style.setProperty(a,c);return i!=null&&i.active&&n.node.classList.add(i.active),i!=null&&i.dragOverlay&&r.node.classList.add(i.dragOverlay),function(){for(const[c,l]of Object.entries(o))n.node.style.setProperty(c,l);i!=null&&i.active&&n.node.classList.remove(i.active)}},jy=e=>{let{transform:{initial:t,final:n}}=e;return[{transform:vr.Transform.toString(t)},{transform:vr.Transform.toString(n)}]},Ly={duration:250,easing:"ease",keyframes:jy,sideEffects:Iy({styles:{active:{opacity:"0"}}})};function Vy(e){let{config:t,draggableNodes:n,droppableContainers:r,measuringConfiguration:o}=e;return Yo((s,i)=>{if(t===null)return;const a=n.get(s);if(!a)return;const c=a.node.current;if(!c)return;const l=ef(i);if(!l)return;const{transform:u}=Ne(i).getComputedStyle(i),d=$d(u);if(!d)return;const h=typeof t=="function"?t:Fy(t);return Kd(c,o.draggable.measure),h({active:{id:s,data:a.data,node:c,rect:o.draggable.measure(c)},draggableNodes:n,dragOverlay:{node:i,rect:o.dragOverlay.measure(l)},droppableContainers:r,measuringConfiguration:o,transform:d})})}function Fy(e){const{duration:t,easing:n,sideEffects:r,keyframes:o}={...Ly,...e};return s=>{let{active:i,dragOverlay:a,transform:c,...l}=s;if(!t)return;const u={x:a.rect.left-i.rect.left,y:a.rect.top-i.rect.top},d={scaleX:c.scaleX!==1?i.rect.width*c.scaleX/a.rect.width:1,scaleY:c.scaleY!==1?i.rect.height*c.scaleY/a.rect.height:1},h={x:c.x-u.x,y:c.y-u.y,...d},f=o({...l,active:i,dragOverlay:a,transform:{initial:c,final:h}}),[S]=f,m=f[f.length-1];if(JSON.stringify(S)===JSON.stringify(m))return;const w=r==null?void 0:r({active:i,dragOverlay:a,...l}),g=a.node.animate(f,{duration:t,easing:n,fill:"forwards"});return new Promise(p=>{g.onfinish=()=>{w==null||w(),p()}})}}let qc=0;function $y(e){return E.useMemo(()=>{if(e!=null)return qc++,qc},[e])}const By=E.memo(e=>{let{adjustScale:t=!1,children:n,dropAnimation:r,style:o,transition:s,modifiers:i,wrapperElement:a="div",className:c,zIndex:l=999}=e;const{activatorEvent:u,active:d,activeNodeRect:h,containerNodeRect:f,draggableNodes:S,droppableContainers:m,dragOverlay:w,over:g,measuringConfiguration:p,scrollableAncestors:v,scrollableAncestorRects:C,windowRect:y}=Ey(),M=E.useContext(qo),b=$y(d==null?void 0:d.id),T=rf(i,{activatorEvent:u,active:d,activeNodeRect:h,containerNodeRect:f,draggingNodeRect:w.rect,over:g,overlayNodeRect:w.rect,scrollableAncestors:v,scrollableAncestorRects:C,transform:M,windowRect:y}),R=ca(h),_=Vy({config:r,draggableNodes:S,droppableContainers:m,measuringConfiguration:p}),O=R?w.setRef:void 0;return E.createElement(Oy,null,E.createElement(Py,{animation:_},d&&b?E.createElement(Ny,{key:b,id:d.id,ref:O,as:a,activatorEvent:u,adjustScale:t,className:c,transition:s,rect:R,style:{zIndex:l,...o},transform:T},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 zy=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),of=(...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 Wy={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 Hy=E.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:s,iconNode:i,...a},c)=>E.createElement("svg",{ref:c,...Wy,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:of("lucide",o),...a},[...i.map(([l,u])=>E.createElement(l,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 Ae=(e,t)=>{const n=E.forwardRef(({className:r,...o},s)=>E.createElement(
|
|
29
|
+
*/const Ae=(e,t)=>{const n=E.forwardRef(({className:r,...o},s)=>E.createElement(Hy,{ref:s,iconNode:t,className:of(`lucide-${zy(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 Uy=[["path",{d:"m19 21-7-4-7 4V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v16z",key:"1fy3hk"}]],Yy=Ae("Bookmark",Uy);/**
|
|
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 Ky=[["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"}]],Gy=Ae("CalendarCog",Ky);/**
|
|
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 qy=[["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"}]],Xy=Ae("CalendarDays",qy);/**
|
|
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 Zy=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],sf=Ae("Check",Zy);/**
|
|
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 Jy=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],af=Ae("ChevronDown",Jy);/**
|
|
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 Qy=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],eb=Ae("ChevronLeft",Qy);/**
|
|
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 tb=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],nb=Ae("ChevronRight",tb);/**
|
|
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 rb=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],ob=Ae("ChevronUp",rb);/**
|
|
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 sb=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}],["path",{d:"M12 8v8",key:"napkw2"}]],ib=Ae("CirclePlus",sb);/**
|
|
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 ab=[["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"}]],cb=Ae("Columns4",ab);/**
|
|
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 lb=[["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"}]],ub=Ae("GalleryVertical",lb);/**
|
|
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 db=[["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"}]],fb=Ae("Grid3x3",db);/**
|
|
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 hb=[["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"}]],pb=Ae("Pencil",hb);/**
|
|
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 mb=[["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"}]],gb=Ae("SquareMousePointer",mb);/**
|
|
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 vb=[["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"}]],yb=Ae("Trash2",vb);/**
|
|
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 wb=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Sb=Ae("X",wb);function ff(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=ff(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function hf(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=ff(e))&&(r&&(r+=" "),r+=t);return r}const pa="-",Cb=e=>{const t=Db(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:i=>{const a=i.split(pa);return a[0]===""&&a.length!==1&&a.shift(),pf(a,t)||Tb(i)},getConflictingClassGroupIds:(i,a)=>{const c=n[i]||[];return a&&r[i]?[...c,...r[i]]:c}}},pf=(e,t)=>{var i;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),o=r?pf(e.slice(1),r):void 0;if(o)return o;if(t.validators.length===0)return;const s=e.join(pa);return(i=t.validators.find(({validator:a})=>a(s)))==null?void 0:i.classGroupId},el=/^\[(.+)\]$/,Tb=e=>{if(el.test(e)){const t=el.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},Db=e=>{const{theme:t,classGroups:n}=e,r={nextPart:new Map,validators:[]};for(const o in n)gi(n[o],r,o,t);return r},gi=(e,t,n,r)=>{e.forEach(o=>{if(typeof o=="string"){const s=o===""?t:tl(t,o);s.classGroupId=n;return}if(typeof o=="function"){if(Eb(o)){gi(o(r),t,n,r);return}t.validators.push({validator:o,classGroupId:n});return}Object.entries(o).forEach(([s,i])=>{gi(i,tl(t,s),n,r)})})},tl=(e,t)=>{let n=e;return t.split(pa).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},Eb=e=>e.isThemeGetter,Mb=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)}}},vi="!",yi=":",Rb=yi.length,Pb=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=o=>{const s=[];let i=0,a=0,c=0,l;for(let S=0;S<o.length;S++){let m=o[S];if(i===0&&a===0){if(m===yi){s.push(o.slice(c,S)),c=S+Rb;continue}if(m==="/"){l=S;continue}}m==="["?i++:m==="]"?i--:m==="("?a++:m===")"&&a--}const u=s.length===0?o:o.substring(c),d=Ab(u),f=d!==u,h=l&&l>c?l-c:void 0;return{modifiers:s,hasImportantModifier:f,baseClassName:d,maybePostfixModifierPosition:h}};if(t){const o=t+yi,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},Ab=e=>e.endsWith(vi)?e.substring(0,e.length-1):e.startsWith(vi)?e.substring(1):e,Ob=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}},kb=e=>({cache:Mb(e.cacheSize),parseClassName:Pb(e),sortModifiers:Ob(e),...Cb(e)}),_b=/\s+/,Nb=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o,sortModifiers:s}=t,i=[],a=e.trim().split(_b);let c="";for(let l=a.length-1;l>=0;l-=1){const u=a[l],{isExternal:d,modifiers:f,hasImportantModifier:h,baseClassName:S,maybePostfixModifierPosition:m}=n(u);if(d){c=u+(c.length>0?" "+c:c);continue}let w=!!m,y=r(w?S.substring(0,m):S);if(!y){if(!w){c=u+(c.length>0?" "+c:c);continue}if(y=r(S),!y){c=u+(c.length>0?" "+c:c);continue}w=!1}const p=s(f).join(":"),g=h?p+vi:p,C=g+y;if(i.includes(C))continue;i.push(C);const v=o(y,w);for(let M=0;M<v.length;++M){const b=v[M];i.push(g+b)}c=u+(c.length>0?" "+c:c)}return c};function Ib(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=mf(t))&&(r&&(r+=" "),r+=n);return r}const mf=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=mf(e[r]))&&(n&&(n+=" "),n+=t);return n};function jb(e,...t){let n,r,o,s=i;function i(c){const l=t.reduce((u,d)=>d(u),e());return n=kb(l),r=n.cache.get,o=n.cache.set,s=a,a(c)}function a(c){const l=r(c);if(l)return l;const u=Nb(c,n);return o(c,u),u}return function(){return s(Ib.apply(null,arguments))}}const we=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},gf=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,vf=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Lb=/^\d+\/\d+$/,Vb=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Fb=/\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$/,$b=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,Bb=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,zb=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,vn=e=>Lb.test(e),se=e=>!!e&&!Number.isNaN(Number(e)),At=e=>!!e&&Number.isInteger(Number(e)),Os=e=>e.endsWith("%")&&se(e.slice(0,-1)),gt=e=>Vb.test(e),Wb=()=>!0,Hb=e=>Fb.test(e)&&!$b.test(e),yf=()=>!1,Ub=e=>Bb.test(e),Yb=e=>zb.test(e),Kb=e=>!Q(e)&&!ee(e),Gb=e=>Vn(e,wf,yf),Q=e=>gf.test(e),Zt=e=>Vn(e,Sf,Hb),ks=e=>Vn(e,Qb,se),nl=e=>Vn(e,bf,yf),qb=e=>Vn(e,xf,Yb),Jr=e=>Vn(e,Cf,Ub),ee=e=>vf.test(e),Qn=e=>Fn(e,Sf),Xb=e=>Fn(e,ex),rl=e=>Fn(e,bf),Zb=e=>Fn(e,wf),Jb=e=>Fn(e,xf),Qr=e=>Fn(e,Cf,!0),Vn=(e,t,n)=>{const r=gf.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},Fn=(e,t,n=!1)=>{const r=vf.exec(e);return r?r[1]?t(r[1]):n:!1},bf=e=>e==="position"||e==="percentage",xf=e=>e==="image"||e==="url",wf=e=>e==="length"||e==="size"||e==="bg-size",Sf=e=>e==="length",Qb=e=>e==="number",ex=e=>e==="family-name",Cf=e=>e==="shadow",tx=()=>{const e=we("color"),t=we("font"),n=we("text"),r=we("font-weight"),o=we("tracking"),s=we("leading"),i=we("breakpoint"),a=we("container"),c=we("spacing"),l=we("radius"),u=we("shadow"),d=we("inset-shadow"),f=we("text-shadow"),h=we("drop-shadow"),S=we("blur"),m=we("perspective"),w=we("aspect"),y=we("ease"),p=we("animate"),g=()=>["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"],v=()=>[...C(),ee,Q],M=()=>["auto","hidden","clip","visible","scroll"],b=()=>["auto","contain","none"],T=()=>[ee,Q,c],R=()=>[vn,"full","auto",...T()],k=()=>[At,"none","subgrid",ee,Q],A=()=>["auto",{span:["full",At,ee,Q]},At,ee,Q],z=()=>[At,"auto",ee,Q],G=()=>["auto","min","max","fr",ee,Q],j=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],F=()=>["start","end","center","stretch","center-safe","end-safe"],_=()=>["auto",...T()],N=()=>[vn,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...T()],P=()=>[e,ee,Q],I=()=>[...C(),rl,nl,{position:[ee,Q]}],O=()=>["no-repeat",{repeat:["","x","y","space","round"]}],V=()=>["auto","cover","contain",Zb,Gb,{size:[ee,Q]}],W=()=>[Os,Qn,Zt],H=()=>["","none","full",l,ee,Q],L=()=>["",se,Qn,Zt],Y=()=>["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"],$=()=>[se,Os,rl,nl],q=()=>["","none",S,ee,Q],X=()=>["none",se,ee,Q],U=()=>["none",se,ee,Q],ne=()=>[se,ee,Q],B=()=>[vn,"full",...T()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[gt],breakpoint:[gt],color:[Wb],container:[gt],"drop-shadow":[gt],ease:["in","out","in-out"],font:[Kb],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[gt],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[gt],shadow:[gt],spacing:["px",se],text:[gt],"text-shadow":[gt],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",vn,Q,ee,w]}],container:["container"],columns:[{columns:[se,Q,ee,a]}],"break-after":[{"break-after":g()}],"break-before":[{"break-before":g()}],"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:v()}],overflow:[{overflow:M()}],"overflow-x":[{"overflow-x":M()}],"overflow-y":[{"overflow-y":M()}],overscroll:[{overscroll:b()}],"overscroll-x":[{"overscroll-x":b()}],"overscroll-y":[{"overscroll-y":b()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:R()}],"inset-x":[{"inset-x":R()}],"inset-y":[{"inset-y":R()}],start:[{start:R()}],end:[{end:R()}],top:[{top:R()}],right:[{right:R()}],bottom:[{bottom:R()}],left:[{left:R()}],visibility:["visible","invisible","collapse"],z:[{z:[At,"auto",ee,Q]}],basis:[{basis:[vn,"full","auto",a,...T()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[se,vn,"auto","initial","none",Q]}],grow:[{grow:["",se,ee,Q]}],shrink:[{shrink:["",se,ee,Q]}],order:[{order:[At,"first","last","none",ee,Q]}],"grid-cols":[{"grid-cols":k()}],"col-start-end":[{col:A()}],"col-start":[{"col-start":z()}],"col-end":[{"col-end":z()}],"grid-rows":[{"grid-rows":k()}],"row-start-end":[{row:A()}],"row-start":[{"row-start":z()}],"row-end":[{"row-end":z()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":G()}],"auto-rows":[{"auto-rows":G()}],gap:[{gap:T()}],"gap-x":[{"gap-x":T()}],"gap-y":[{"gap-y":T()}],"justify-content":[{justify:[...j(),"normal"]}],"justify-items":[{"justify-items":[...F(),"normal"]}],"justify-self":[{"justify-self":["auto",...F()]}],"align-content":[{content:["normal",...j()]}],"align-items":[{items:[...F(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...F(),{baseline:["","last"]}]}],"place-content":[{"place-content":j()}],"place-items":[{"place-items":[...F(),"baseline"]}],"place-self":[{"place-self":["auto",...F()]}],p:[{p:T()}],px:[{px:T()}],py:[{py:T()}],ps:[{ps:T()}],pe:[{pe:T()}],pt:[{pt:T()}],pr:[{pr:T()}],pb:[{pb:T()}],pl:[{pl:T()}],m:[{m:_()}],mx:[{mx:_()}],my:[{my:_()}],ms:[{ms:_()}],me:[{me:_()}],mt:[{mt:_()}],mr:[{mr:_()}],mb:[{mb:_()}],ml:[{ml:_()}],"space-x":[{"space-x":T()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":T()}],"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,Qn,Zt]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,ee,ks]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Os,Q]}],"font-family":[{font:[Xb,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":[se,"none",ee,ks]}],leading:[{leading:[s,...T()]}],"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:P()}],"text-color":[{text:P()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Y(),"wavy"]}],"text-decoration-thickness":[{decoration:[se,"from-font","auto",ee,Zt]}],"text-decoration-color":[{decoration:P()}],"underline-offset":[{"underline-offset":[se,"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:T()}],"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:I()}],"bg-repeat":[{bg:O()}],"bg-size":[{bg:V()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},At,ee,Q],radial:["",ee,Q],conic:[At,ee,Q]},Jb,qb]}],"bg-color":[{bg:P()}],"gradient-from-pos":[{from:W()}],"gradient-via-pos":[{via:W()}],"gradient-to-pos":[{to:W()}],"gradient-from":[{from:P()}],"gradient-via":[{via:P()}],"gradient-to":[{to:P()}],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:L()}],"border-w-x":[{"border-x":L()}],"border-w-y":[{"border-y":L()}],"border-w-s":[{"border-s":L()}],"border-w-e":[{"border-e":L()}],"border-w-t":[{"border-t":L()}],"border-w-r":[{"border-r":L()}],"border-w-b":[{"border-b":L()}],"border-w-l":[{"border-l":L()}],"divide-x":[{"divide-x":L()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":L()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...Y(),"hidden","none"]}],"divide-style":[{divide:[...Y(),"hidden","none"]}],"border-color":[{border:P()}],"border-color-x":[{"border-x":P()}],"border-color-y":[{"border-y":P()}],"border-color-s":[{"border-s":P()}],"border-color-e":[{"border-e":P()}],"border-color-t":[{"border-t":P()}],"border-color-r":[{"border-r":P()}],"border-color-b":[{"border-b":P()}],"border-color-l":[{"border-l":P()}],"divide-color":[{divide:P()}],"outline-style":[{outline:[...Y(),"none","hidden"]}],"outline-offset":[{"outline-offset":[se,ee,Q]}],"outline-w":[{outline:["",se,Qn,Zt]}],"outline-color":[{outline:P()}],shadow:[{shadow:["","none",u,Qr,Jr]}],"shadow-color":[{shadow:P()}],"inset-shadow":[{"inset-shadow":["none",d,Qr,Jr]}],"inset-shadow-color":[{"inset-shadow":P()}],"ring-w":[{ring:L()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:P()}],"ring-offset-w":[{"ring-offset":[se,Zt]}],"ring-offset-color":[{"ring-offset":P()}],"inset-ring-w":[{"inset-ring":L()}],"inset-ring-color":[{"inset-ring":P()}],"text-shadow":[{"text-shadow":["none",f,Qr,Jr]}],"text-shadow-color":[{"text-shadow":P()}],opacity:[{opacity:[se,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":[se]}],"mask-image-linear-from-pos":[{"mask-linear-from":$()}],"mask-image-linear-to-pos":[{"mask-linear-to":$()}],"mask-image-linear-from-color":[{"mask-linear-from":P()}],"mask-image-linear-to-color":[{"mask-linear-to":P()}],"mask-image-t-from-pos":[{"mask-t-from":$()}],"mask-image-t-to-pos":[{"mask-t-to":$()}],"mask-image-t-from-color":[{"mask-t-from":P()}],"mask-image-t-to-color":[{"mask-t-to":P()}],"mask-image-r-from-pos":[{"mask-r-from":$()}],"mask-image-r-to-pos":[{"mask-r-to":$()}],"mask-image-r-from-color":[{"mask-r-from":P()}],"mask-image-r-to-color":[{"mask-r-to":P()}],"mask-image-b-from-pos":[{"mask-b-from":$()}],"mask-image-b-to-pos":[{"mask-b-to":$()}],"mask-image-b-from-color":[{"mask-b-from":P()}],"mask-image-b-to-color":[{"mask-b-to":P()}],"mask-image-l-from-pos":[{"mask-l-from":$()}],"mask-image-l-to-pos":[{"mask-l-to":$()}],"mask-image-l-from-color":[{"mask-l-from":P()}],"mask-image-l-to-color":[{"mask-l-to":P()}],"mask-image-x-from-pos":[{"mask-x-from":$()}],"mask-image-x-to-pos":[{"mask-x-to":$()}],"mask-image-x-from-color":[{"mask-x-from":P()}],"mask-image-x-to-color":[{"mask-x-to":P()}],"mask-image-y-from-pos":[{"mask-y-from":$()}],"mask-image-y-to-pos":[{"mask-y-to":$()}],"mask-image-y-from-color":[{"mask-y-from":P()}],"mask-image-y-to-color":[{"mask-y-to":P()}],"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":P()}],"mask-image-radial-to-color":[{"mask-radial-to":P()}],"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":[se]}],"mask-image-conic-from-pos":[{"mask-conic-from":$()}],"mask-image-conic-to-pos":[{"mask-conic-to":$()}],"mask-image-conic-from-color":[{"mask-conic-from":P()}],"mask-image-conic-to-color":[{"mask-conic-to":P()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:I()}],"mask-repeat":[{mask:O()}],"mask-size":[{mask:V()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",ee,Q]}],filter:[{filter:["","none",ee,Q]}],blur:[{blur:q()}],brightness:[{brightness:[se,ee,Q]}],contrast:[{contrast:[se,ee,Q]}],"drop-shadow":[{"drop-shadow":["","none",h,Qr,Jr]}],"drop-shadow-color":[{"drop-shadow":P()}],grayscale:[{grayscale:["",se,ee,Q]}],"hue-rotate":[{"hue-rotate":[se,ee,Q]}],invert:[{invert:["",se,ee,Q]}],saturate:[{saturate:[se,ee,Q]}],sepia:[{sepia:["",se,ee,Q]}],"backdrop-filter":[{"backdrop-filter":["","none",ee,Q]}],"backdrop-blur":[{"backdrop-blur":q()}],"backdrop-brightness":[{"backdrop-brightness":[se,ee,Q]}],"backdrop-contrast":[{"backdrop-contrast":[se,ee,Q]}],"backdrop-grayscale":[{"backdrop-grayscale":["",se,ee,Q]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[se,ee,Q]}],"backdrop-invert":[{"backdrop-invert":["",se,ee,Q]}],"backdrop-opacity":[{"backdrop-opacity":[se,ee,Q]}],"backdrop-saturate":[{"backdrop-saturate":[se,ee,Q]}],"backdrop-sepia":[{"backdrop-sepia":["",se,ee,Q]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":T()}],"border-spacing-x":[{"border-spacing-x":T()}],"border-spacing-y":[{"border-spacing-y":T()}],"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:[se,"initial",ee,Q]}],ease:[{ease:["linear","initial",y,ee,Q]}],delay:[{delay:[se,ee,Q]}],animate:[{animate:["none",p,ee,Q]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[m,ee,Q]}],"perspective-origin":[{"perspective-origin":v()}],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:ne()}],"skew-x":[{"skew-x":ne()}],"skew-y":[{"skew-y":ne()}],transform:[{transform:[ee,Q,"","none","gpu","cpu"]}],"transform-origin":[{origin:v()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:B()}],"translate-x":[{"translate-x":B()}],"translate-y":[{"translate-y":B()}],"translate-z":[{"translate-z":B()}],"translate-none":["translate-none"],accent:[{accent:P()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:P()}],"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":T()}],"scroll-mx":[{"scroll-mx":T()}],"scroll-my":[{"scroll-my":T()}],"scroll-ms":[{"scroll-ms":T()}],"scroll-me":[{"scroll-me":T()}],"scroll-mt":[{"scroll-mt":T()}],"scroll-mr":[{"scroll-mr":T()}],"scroll-mb":[{"scroll-mb":T()}],"scroll-ml":[{"scroll-ml":T()}],"scroll-p":[{"scroll-p":T()}],"scroll-px":[{"scroll-px":T()}],"scroll-py":[{"scroll-py":T()}],"scroll-ps":[{"scroll-ps":T()}],"scroll-pe":[{"scroll-pe":T()}],"scroll-pt":[{"scroll-pt":T()}],"scroll-pr":[{"scroll-pr":T()}],"scroll-pb":[{"scroll-pb":T()}],"scroll-pl":[{"scroll-pl":T()}],"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",...P()]}],"stroke-w":[{stroke:[se,Qn,Zt,ks]}],stroke:[{stroke:["none",...P()]}],"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"]}},nx=jb(tx);function ce(...e){return nx(hf(e))}function ol(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Jo(...e){return t=>{let n=!1;const r=e.map(o=>{const s=ol(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():ol(e[o],null)}}}}function fe(...e){return D.useCallback(Jo(...e),e)}function an(e){const t=ox(e),n=D.forwardRef((r,o)=>{const{children:s,...i}=r,a=D.Children.toArray(s),c=a.find(ix);if(c){const l=c.props.children,u=a.map(d=>d===c?D.Children.count(l)>1?D.Children.only(null):D.isValidElement(l)?l.props.children:null:d);return x.jsx(t,{...i,ref:o,children:D.isValidElement(l)?D.cloneElement(l,void 0,u):null})}return x.jsx(t,{...i,ref:o,children:s})});return n.displayName=`${e}.Slot`,n}var rx=an("Slot");function ox(e){const t=D.forwardRef((n,r)=>{const{children:o,...s}=n;if(D.isValidElement(o)){const i=cx(o),a=ax(s,o.props);return o.type!==D.Fragment&&(a.ref=r?Jo(r,i):i),D.cloneElement(o,a)}return D.Children.count(o)>1?D.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Tf=Symbol("radix.slottable");function sx(e){const t=({children:n})=>x.jsx(x.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=Tf,t}function ix(e){return D.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Tf}function ax(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 cx(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 sl=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,il=hf,ma=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return il(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:o,defaultVariants:s}=t,i=Object.keys(o).map(l=>{const u=n==null?void 0:n[l],d=s==null?void 0:s[l];if(u===null)return null;const f=sl(u)||sl(d);return o[l][f]}),a=n&&Object.entries(n).reduce((l,u)=>{let[d,f]=u;return f===void 0||(l[d]=f),l},{}),c=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((l,u)=>{let{class:d,className:f,...h}=u;return Object.entries(h).every(S=>{let[m,w]=S;return Array.isArray(w)?w.includes({...s,...a}[m]):{...s,...a}[m]===w})?[...l,d,f]:l},[]);return il(e,i,c,n==null?void 0:n.class,n==null?void 0:n.className)},lx=ma("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 cn({className:e,variant:t,size:n,asChild:r=!1,...o}){const s=r?rx:"button";return x.jsx(s,{"data-slot":"button",className:ce(lx({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 Ht(e,t=[]){let n=[];function r(s,i){const a=D.createContext(i),c=n.length;n=[...n,i];const l=d=>{var y;const{scope:f,children:h,...S}=d,m=((y=f==null?void 0:f[e])==null?void 0:y[c])||a,w=D.useMemo(()=>S,Object.values(S));return x.jsx(m.Provider,{value:w,children:h})};l.displayName=s+"Provider";function u(d,f){var m;const h=((m=f==null?void 0:f[e])==null?void 0:m[c])||a,S=D.useContext(h);if(S)return S;if(i!==void 0)return i;throw new Error(`\`${d}\` must be used within \`${s}\``)}return[l,u]}const o=()=>{const s=n.map(i=>D.createContext(i));return function(a){const c=(a==null?void 0:a[e])||s;return D.useMemo(()=>({[`__scope${e}`]:{...a,[e]:c}}),[a,c])}};return o.scopeName=e,[r,ux(o,...t)]}function ux(...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:c,scopeName:l})=>{const d=c(s)[`__scope${l}`];return{...a,...d}},{});return D.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return n.scopeName=t.scopeName,n}var dx=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],ae=dx.reduce((e,t)=>{const n=an(`Primitive.${t}`),r=D.forwardRef((o,s)=>{const{asChild:i,...a}=o,c=i?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),x.jsx(c,{...a,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Df(e,t){e&&Ho.flushSync(()=>e.dispatchEvent(t))}function Ze(e){const t=D.useRef(e);return D.useEffect(()=>{t.current=e}),D.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function fx(e,t=globalThis==null?void 0:globalThis.document){const n=Ze(e);D.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 hx="DismissableLayer",bi="dismissableLayer.update",px="dismissableLayer.pointerDownOutside",mx="dismissableLayer.focusOutside",al,Ef=D.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Lr=D.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:s,onInteractOutside:i,onDismiss:a,...c}=e,l=D.useContext(Ef),[u,d]=D.useState(null),f=(u==null?void 0:u.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,h]=D.useState({}),S=fe(t,b=>d(b)),m=Array.from(l.layers),[w]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),y=m.indexOf(w),p=u?m.indexOf(u):-1,g=l.layersWithOutsidePointerEventsDisabled.size>0,C=p>=y,v=yx(b=>{const T=b.target,R=[...l.branches].some(k=>k.contains(T));!C||R||(o==null||o(b),i==null||i(b),b.defaultPrevented||a==null||a())},f),M=bx(b=>{const T=b.target;[...l.branches].some(k=>k.contains(T))||(s==null||s(b),i==null||i(b),b.defaultPrevented||a==null||a())},f);return fx(b=>{p===l.layers.size-1&&(r==null||r(b),!b.defaultPrevented&&a&&(b.preventDefault(),a()))},f),D.useEffect(()=>{if(u)return n&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(al=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),l.layersWithOutsidePointerEventsDisabled.add(u)),l.layers.add(u),cl(),()=>{n&&l.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=al)}},[u,f,n,l]),D.useEffect(()=>()=>{u&&(l.layers.delete(u),l.layersWithOutsidePointerEventsDisabled.delete(u),cl())},[u,l]),D.useEffect(()=>{const b=()=>h({});return document.addEventListener(bi,b),()=>document.removeEventListener(bi,b)},[]),x.jsx(ae.div,{...c,ref:S,style:{pointerEvents:g?C?"auto":"none":void 0,...e.style},onFocusCapture:te(e.onFocusCapture,M.onFocusCapture),onBlurCapture:te(e.onBlurCapture,M.onBlurCapture),onPointerDownCapture:te(e.onPointerDownCapture,v.onPointerDownCapture)})});Lr.displayName=hx;var gx="DismissableLayerBranch",vx=D.forwardRef((e,t)=>{const n=D.useContext(Ef),r=D.useRef(null),o=fe(t,r);return D.useEffect(()=>{const s=r.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),x.jsx(ae.div,{...e,ref:o})});vx.displayName=gx;function yx(e,t=globalThis==null?void 0:globalThis.document){const n=Ze(e),r=D.useRef(!1),o=D.useRef(()=>{});return D.useEffect(()=>{const s=a=>{if(a.target&&!r.current){let c=function(){Mf(px,n,l,{discrete:!0})};const l={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=c,t.addEventListener("click",o.current,{once:!0})):c()}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 bx(e,t=globalThis==null?void 0:globalThis.document){const n=Ze(e),r=D.useRef(!1);return D.useEffect(()=>{const o=s=>{s.target&&!r.current&&Mf(mx,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 cl(){const e=new CustomEvent(bi);document.dispatchEvent(e)}function Mf(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?Df(o,s):o.dispatchEvent(s)}var _e=globalThis!=null&&globalThis.document?D.useLayoutEffect:()=>{},xx=D[" useId ".trim().toString()]||(()=>{}),wx=0;function Vt(e){const[t,n]=D.useState(xx());return _e(()=>{n(r=>r??String(wx++))},[e]),e||(t?`radix-${t}`:"")}const Sx=["top","right","bottom","left"],Ft=Math.min,ze=Math.max,ko=Math.round,eo=Math.floor,lt=e=>({x:e,y:e}),Cx={left:"right",right:"left",bottom:"top",top:"bottom"},Tx={start:"end",end:"start"};function xi(e,t,n){return ze(e,Ft(t,n))}function bt(e,t){return typeof e=="function"?e(t):e}function xt(e){return e.split("-")[0]}function $n(e){return e.split("-")[1]}function ga(e){return e==="x"?"y":"x"}function va(e){return e==="y"?"height":"width"}function $t(e){return["top","bottom"].includes(xt(e))?"y":"x"}function ya(e){return ga($t(e))}function Dx(e,t,n){n===void 0&&(n=!1);const r=$n(e),o=ya(e),s=va(o);let i=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=_o(i)),[i,_o(i)]}function Ex(e){const t=_o(e);return[wi(e),t,wi(t)]}function wi(e){return e.replace(/start|end/g,t=>Tx[t])}function Mx(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 Rx(e,t,n,r){const o=$n(e);let s=Mx(xt(e),n==="start",r);return o&&(s=s.map(i=>i+"-"+o),t&&(s=s.concat(s.map(wi)))),s}function _o(e){return e.replace(/left|right|bottom|top/g,t=>Cx[t])}function Px(e){return{top:0,right:0,bottom:0,left:0,...e}}function Rf(e){return typeof e!="number"?Px(e):{top:e,right:e,bottom:e,left:e}}function No(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 ll(e,t,n){let{reference:r,floating:o}=e;const s=$t(t),i=ya(t),a=va(i),c=xt(t),l=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(c){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($n(t)){case"start":h[i]-=f*(n&&l?-1:1);break;case"end":h[i]+=f*(n&&l?-1:1);break}return h}const Ax=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:s=[],platform:i}=n,a=s.filter(Boolean),c=await(i.isRTL==null?void 0:i.isRTL(t));let l=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:d}=ll(l,r,c),f=r,h={},S=0;for(let m=0;m<a.length;m++){const{name:w,fn:y}=a[m],{x:p,y:g,data:C,reset:v}=await y({x:u,y:d,initialPlacement:r,placement:f,strategy:o,middlewareData:h,rects:l,platform:i,elements:{reference:e,floating:t}});u=p??u,d=g??d,h={...h,[w]:{...h[w],...C}},v&&S<=50&&(S++,typeof v=="object"&&(v.placement&&(f=v.placement),v.rects&&(l=v.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:o}):v.rects),{x:u,y:d}=ll(l,f,c)),m=-1)}return{x:u,y:d,placement:f,strategy:o,middlewareData:h}};async function xr(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:s,rects:i,elements:a,strategy:c}=e,{boundary:l="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:f=!1,padding:h=0}=bt(t,e),S=Rf(h),w=a[f?d==="floating"?"reference":"floating":d],y=No(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(w)))==null||n?w:w.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:l,rootBoundary:u,strategy:c})),p=d==="floating"?{x:r,y:o,width:i.floating.width,height:i.floating.height}:i.reference,g=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),C=await(s.isElement==null?void 0:s.isElement(g))?await(s.getScale==null?void 0:s.getScale(g))||{x:1,y:1}:{x:1,y:1},v=No(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:p,offsetParent:g,strategy:c}):p);return{top:(y.top-v.top+S.top)/C.y,bottom:(v.bottom-y.bottom+S.bottom)/C.y,left:(y.left-v.left+S.left)/C.x,right:(v.right-y.right+S.right)/C.x}}const Ox=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:s,platform:i,elements:a,middlewareData:c}=t,{element:l,padding:u=0}=bt(e,t)||{};if(l==null)return{};const d=Rf(u),f={x:n,y:r},h=ya(o),S=va(h),m=await i.getDimensions(l),w=h==="y",y=w?"top":"left",p=w?"bottom":"right",g=w?"clientHeight":"clientWidth",C=s.reference[S]+s.reference[h]-f[h]-s.floating[S],v=f[h]-s.reference[h],M=await(i.getOffsetParent==null?void 0:i.getOffsetParent(l));let b=M?M[g]:0;(!b||!await(i.isElement==null?void 0:i.isElement(M)))&&(b=a.floating[g]||s.floating[S]);const T=C/2-v/2,R=b/2-m[S]/2-1,k=Ft(d[y],R),A=Ft(d[p],R),z=k,G=b-m[S]-A,j=b/2-m[S]/2+T,F=xi(z,j,G),_=!c.arrow&&$n(o)!=null&&j!==F&&s.reference[S]/2-(j<z?k:A)-m[S]/2<0,N=_?j<z?j-z:j-G:0;return{[h]:f[h]+N,data:{[h]:F,centerOffset:j-F-N,..._&&{alignmentOffset:N}},reset:_}}}),kx=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:c,elements:l}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:S="none",flipAlignment:m=!0,...w}=bt(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const y=xt(o),p=$t(a),g=xt(a)===a,C=await(c.isRTL==null?void 0:c.isRTL(l.floating)),v=f||(g||!m?[_o(a)]:Ex(a)),M=S!=="none";!f&&M&&v.push(...Rx(a,m,S,C));const b=[a,...v],T=await xr(t,w),R=[];let k=((r=s.flip)==null?void 0:r.overflows)||[];if(u&&R.push(T[y]),d){const j=Dx(o,i,C);R.push(T[j[0]],T[j[1]])}if(k=[...k,{placement:o,overflows:R}],!R.every(j=>j<=0)){var A,z;const j=(((A=s.flip)==null?void 0:A.index)||0)+1,F=b[j];if(F)return{data:{index:j,overflows:k},reset:{placement:F}};let _=(z=k.filter(N=>N.overflows[0]<=0).sort((N,P)=>N.overflows[1]-P.overflows[1])[0])==null?void 0:z.placement;if(!_)switch(h){case"bestFit":{var G;const N=(G=k.filter(P=>{if(M){const I=$t(P.placement);return I===p||I==="y"}return!0}).map(P=>[P.placement,P.overflows.filter(I=>I>0).reduce((I,O)=>I+O,0)]).sort((P,I)=>P[1]-I[1])[0])==null?void 0:G[0];N&&(_=N);break}case"initialPlacement":_=a;break}if(o!==_)return{reset:{placement:_}}}return{}}}};function ul(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function dl(e){return Sx.some(t=>e[t]>=0)}const _x=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=bt(e,t);switch(r){case"referenceHidden":{const s=await xr(t,{...o,elementContext:"reference"}),i=ul(s,n.reference);return{data:{referenceHiddenOffsets:i,referenceHidden:dl(i)}}}case"escaped":{const s=await xr(t,{...o,altBoundary:!0}),i=ul(s,n.floating);return{data:{escapedOffsets:i,escaped:dl(i)}}}default:return{}}}}};async function Nx(e,t){const{placement:n,platform:r,elements:o}=e,s=await(r.isRTL==null?void 0:r.isRTL(o.floating)),i=xt(n),a=$n(n),c=$t(n)==="y",l=["left","top"].includes(i)?-1:1,u=s&&c?-1:1,d=bt(t,e);let{mainAxis:f,crossAxis:h,alignmentAxis:S}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&typeof S=="number"&&(h=a==="end"?S*-1:S),c?{x:h*u,y:f*l}:{x:f*l,y:h*u}}const Ix=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,c=await Nx(t,e);return i===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:o+c.x,y:s+c.y,data:{...c,placement:i}}}}},jx=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:w=>{let{x:y,y:p}=w;return{x:y,y:p}}},...c}=bt(e,t),l={x:n,y:r},u=await xr(t,c),d=$t(xt(o)),f=ga(d);let h=l[f],S=l[d];if(s){const w=f==="y"?"top":"left",y=f==="y"?"bottom":"right",p=h+u[w],g=h-u[y];h=xi(p,h,g)}if(i){const w=d==="y"?"top":"left",y=d==="y"?"bottom":"right",p=S+u[w],g=S-u[y];S=xi(p,S,g)}const m=a.fn({...t,[f]:h,[d]:S});return{...m,data:{x:m.x-n,y:m.y-r,enabled:{[f]:s,[d]:i}}}}}},Lx=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:c=!0,crossAxis:l=!0}=bt(e,t),u={x:n,y:r},d=$t(o),f=ga(d);let h=u[f],S=u[d];const m=bt(a,t),w=typeof m=="number"?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(c){const g=f==="y"?"height":"width",C=s.reference[f]-s.floating[g]+w.mainAxis,v=s.reference[f]+s.reference[g]-w.mainAxis;h<C?h=C:h>v&&(h=v)}if(l){var y,p;const g=f==="y"?"width":"height",C=["top","left"].includes(xt(o)),v=s.reference[d]-s.floating[g]+(C&&((y=i.offset)==null?void 0:y[d])||0)+(C?0:w.crossAxis),M=s.reference[d]+s.reference[g]+(C?0:((p=i.offset)==null?void 0:p[d])||0)-(C?w.crossAxis:0);S<v?S=v:S>M&&(S=M)}return{[f]:h,[d]:S}}}},Vx=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:c=()=>{},...l}=bt(e,t),u=await xr(t,l),d=xt(o),f=$n(o),h=$t(o)==="y",{width:S,height:m}=s.floating;let w,y;d==="top"||d==="bottom"?(w=d,y=f===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?"start":"end")?"left":"right"):(y=d,w=f==="end"?"top":"bottom");const p=m-u.top-u.bottom,g=S-u.left-u.right,C=Ft(m-u[w],p),v=Ft(S-u[y],g),M=!t.middlewareData.shift;let b=C,T=v;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(T=g),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(b=p),M&&!f){const k=ze(u.left,0),A=ze(u.right,0),z=ze(u.top,0),G=ze(u.bottom,0);h?T=S-2*(k!==0||A!==0?k+A:ze(u.left,u.right)):b=m-2*(z!==0||G!==0?z+G:ze(u.top,u.bottom))}await c({...t,availableWidth:T,availableHeight:b});const R=await i.getDimensions(a.floating);return S!==R.width||m!==R.height?{reset:{rects:!0}}:{}}}};function Qo(){return typeof window<"u"}function Bn(e){return Pf(e)?(e.nodeName||"").toLowerCase():"#document"}function We(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ht(e){var t;return(t=(Pf(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Pf(e){return Qo()?e instanceof Node||e instanceof We(e).Node:!1}function nt(e){return Qo()?e instanceof Element||e instanceof We(e).Element:!1}function ft(e){return Qo()?e instanceof HTMLElement||e instanceof We(e).HTMLElement:!1}function fl(e){return!Qo()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof We(e).ShadowRoot}function Vr(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=rt(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function Fx(e){return["table","td","th"].includes(Bn(e))}function es(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function ba(e){const t=xa(),n=nt(e)?rt(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 $x(e){let t=Bt(e);for(;ft(t)&&!On(t);){if(ba(t))return t;if(es(t))return null;t=Bt(t)}return null}function xa(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function On(e){return["html","body","#document"].includes(Bn(e))}function rt(e){return We(e).getComputedStyle(e)}function ts(e){return nt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Bt(e){if(Bn(e)==="html")return e;const t=e.assignedSlot||e.parentNode||fl(e)&&e.host||ht(e);return fl(t)?t.host:t}function Af(e){const t=Bt(e);return On(t)?e.ownerDocument?e.ownerDocument.body:e.body:ft(t)&&Vr(t)?t:Af(t)}function wr(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=Af(e),s=o===((r=e.ownerDocument)==null?void 0:r.body),i=We(o);if(s){const a=Si(i);return t.concat(i,i.visualViewport||[],Vr(o)?o:[],a&&n?wr(a):[])}return t.concat(o,wr(o,[],n))}function Si(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Of(e){const t=rt(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=ft(e),s=o?e.offsetWidth:n,i=o?e.offsetHeight:r,a=ko(n)!==s||ko(r)!==i;return a&&(n=s,r=i),{width:n,height:r,$:a}}function wa(e){return nt(e)?e:e.contextElement}function Pn(e){const t=wa(e);if(!ft(t))return lt(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:s}=Of(t);let i=(s?ko(n.width):n.width)/r,a=(s?ko(n.height):n.height)/o;return(!i||!Number.isFinite(i))&&(i=1),(!a||!Number.isFinite(a))&&(a=1),{x:i,y:a}}const Bx=lt(0);function kf(e){const t=We(e);return!xa()||!t.visualViewport?Bx:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function zx(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==We(e)?!1:t}function ln(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),s=wa(e);let i=lt(1);t&&(r?nt(r)&&(i=Pn(r)):i=Pn(e));const a=zx(s,n,r)?kf(s):lt(0);let c=(o.left+a.x)/i.x,l=(o.top+a.y)/i.y,u=o.width/i.x,d=o.height/i.y;if(s){const f=We(s),h=r&&nt(r)?We(r):r;let S=f,m=Si(S);for(;m&&r&&h!==S;){const w=Pn(m),y=m.getBoundingClientRect(),p=rt(m),g=y.left+(m.clientLeft+parseFloat(p.paddingLeft))*w.x,C=y.top+(m.clientTop+parseFloat(p.paddingTop))*w.y;c*=w.x,l*=w.y,u*=w.x,d*=w.y,c+=g,l+=C,S=We(m),m=Si(S)}}return No({width:u,height:d,x:c,y:l})}function Sa(e,t){const n=ts(e).scrollLeft;return t?t.left+n:ln(ht(e)).left+n}function _f(e,t,n){n===void 0&&(n=!1);const r=e.getBoundingClientRect(),o=r.left+t.scrollLeft-(n?0:Sa(e,r)),s=r.top+t.scrollTop;return{x:o,y:s}}function Wx(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const s=o==="fixed",i=ht(r),a=t?es(t.floating):!1;if(r===i||a&&s)return n;let c={scrollLeft:0,scrollTop:0},l=lt(1);const u=lt(0),d=ft(r);if((d||!d&&!s)&&((Bn(r)!=="body"||Vr(i))&&(c=ts(r)),ft(r))){const h=ln(r);l=Pn(r),u.x=h.x+r.clientLeft,u.y=h.y+r.clientTop}const f=i&&!d&&!s?_f(i,c,!0):lt(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function Hx(e){return Array.from(e.getClientRects())}function Ux(e){const t=ht(e),n=ts(e),r=e.ownerDocument.body,o=ze(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=ze(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let i=-n.scrollLeft+Sa(e);const a=-n.scrollTop;return rt(r).direction==="rtl"&&(i+=ze(t.clientWidth,r.clientWidth)-o),{width:o,height:s,x:i,y:a}}function Yx(e,t){const n=We(e),r=ht(e),o=n.visualViewport;let s=r.clientWidth,i=r.clientHeight,a=0,c=0;if(o){s=o.width,i=o.height;const l=xa();(!l||l&&t==="fixed")&&(a=o.offsetLeft,c=o.offsetTop)}return{width:s,height:i,x:a,y:c}}function Kx(e,t){const n=ln(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,s=ft(e)?Pn(e):lt(1),i=e.clientWidth*s.x,a=e.clientHeight*s.y,c=o*s.x,l=r*s.y;return{width:i,height:a,x:c,y:l}}function hl(e,t,n){let r;if(t==="viewport")r=Yx(e,n);else if(t==="document")r=Ux(ht(e));else if(nt(t))r=Kx(t,n);else{const o=kf(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return No(r)}function Nf(e,t){const n=Bt(e);return n===t||!nt(n)||On(n)?!1:rt(n).position==="fixed"||Nf(n,t)}function Gx(e,t){const n=t.get(e);if(n)return n;let r=wr(e,[],!1).filter(a=>nt(a)&&Bn(a)!=="body"),o=null;const s=rt(e).position==="fixed";let i=s?Bt(e):e;for(;nt(i)&&!On(i);){const a=rt(i),c=ba(i);!c&&a.position==="fixed"&&(o=null),(s?!c&&!o:!c&&a.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||Vr(i)&&!c&&Nf(e,i))?r=r.filter(u=>u!==i):o=a,i=Bt(i)}return t.set(e,r),r}function qx(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[...n==="clippingAncestors"?es(t)?[]:Gx(t,this._c):[].concat(n),r],a=i[0],c=i.reduce((l,u)=>{const d=hl(t,u,o);return l.top=ze(d.top,l.top),l.right=Ft(d.right,l.right),l.bottom=Ft(d.bottom,l.bottom),l.left=ze(d.left,l.left),l},hl(t,a,o));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function Xx(e){const{width:t,height:n}=Of(e);return{width:t,height:n}}function Zx(e,t,n){const r=ft(t),o=ht(t),s=n==="fixed",i=ln(e,!0,s,t);let a={scrollLeft:0,scrollTop:0};const c=lt(0);if(r||!r&&!s)if((Bn(t)!=="body"||Vr(o))&&(a=ts(t)),r){const f=ln(t,!0,s,t);c.x=f.x+t.clientLeft,c.y=f.y+t.clientTop}else o&&(c.x=Sa(o));const l=o&&!r&&!s?_f(o,a):lt(0),u=i.left+a.scrollLeft-c.x-l.x,d=i.top+a.scrollTop-c.y-l.y;return{x:u,y:d,width:i.width,height:i.height}}function _s(e){return rt(e).position==="static"}function pl(e,t){if(!ft(e)||rt(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return ht(e)===n&&(n=n.ownerDocument.body),n}function If(e,t){const n=We(e);if(es(e))return n;if(!ft(e)){let o=Bt(e);for(;o&&!On(o);){if(nt(o)&&!_s(o))return o;o=Bt(o)}return n}let r=pl(e,t);for(;r&&Fx(r)&&_s(r);)r=pl(r,t);return r&&On(r)&&_s(r)&&!ba(r)?n:r||$x(e)||n}const Jx=async function(e){const t=this.getOffsetParent||If,n=this.getDimensions,r=await n(e.floating);return{reference:Zx(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Qx(e){return rt(e).direction==="rtl"}const ew={convertOffsetParentRelativeRectToViewportRelativeRect:Wx,getDocumentElement:ht,getClippingRect:qx,getOffsetParent:If,getElementRects:Jx,getClientRects:Hx,getDimensions:Xx,getScale:Pn,isElement:nt,isRTL:Qx};function jf(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function tw(e,t){let n=null,r;const o=ht(e);function s(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function i(a,c){a===void 0&&(a=!1),c===void 0&&(c=1),s();const l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:h}=l;if(a||t(),!f||!h)return;const S=eo(d),m=eo(o.clientWidth-(u+f)),w=eo(o.clientHeight-(d+h)),y=eo(u),g={rootMargin:-S+"px "+-m+"px "+-w+"px "+-y+"px",threshold:ze(0,Ft(1,c))||1};let C=!0;function v(M){const b=M[0].intersectionRatio;if(b!==c){if(!C)return i();b?i(!1,b):r=setTimeout(()=>{i(!1,1e-7)},1e3)}b===1&&!jf(l,e.getBoundingClientRect())&&i(),C=!1}try{n=new IntersectionObserver(v,{...g,root:o.ownerDocument})}catch{n=new IntersectionObserver(v,g)}n.observe(e)}return i(!0),s}function nw(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:c=!1}=r,l=wa(e),u=o||s?[...l?wr(l):[],...wr(t)]:[];u.forEach(y=>{o&&y.addEventListener("scroll",n,{passive:!0}),s&&y.addEventListener("resize",n)});const d=l&&a?tw(l,n):null;let f=-1,h=null;i&&(h=new ResizeObserver(y=>{let[p]=y;p&&p.target===l&&h&&(h.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var g;(g=h)==null||g.observe(t)})),n()}),l&&!c&&h.observe(l),h.observe(t));let S,m=c?ln(e):null;c&&w();function w(){const y=ln(e);m&&!jf(m,y)&&n(),m=y,S=requestAnimationFrame(w)}return n(),()=>{var y;u.forEach(p=>{o&&p.removeEventListener("scroll",n),s&&p.removeEventListener("resize",n)}),d==null||d(),(y=h)==null||y.disconnect(),h=null,c&&cancelAnimationFrame(S)}}const rw=Ix,ow=jx,sw=kx,iw=Vx,aw=_x,ml=Ox,cw=Lx,lw=(e,t,n)=>{const r=new Map,o={platform:ew,...n},s={...o.platform,_c:r};return Ax(e,t,{...o,platform:s})};var yo=typeof document<"u"?E.useLayoutEffect:E.useEffect;function Io(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(!Io(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)&&!Io(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function Lf(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function gl(e,t){const n=Lf(e);return Math.round(t*n)/n}function Ns(e){const t=D.useRef(e);return yo(()=>{t.current=e}),t}function uw(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:c,open:l}=e,[u,d]=D.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,h]=D.useState(r);Io(f,r)||h(r);const[S,m]=D.useState(null),[w,y]=D.useState(null),p=D.useCallback(P=>{P!==M.current&&(M.current=P,m(P))},[]),g=D.useCallback(P=>{P!==b.current&&(b.current=P,y(P))},[]),C=s||S,v=i||w,M=D.useRef(null),b=D.useRef(null),T=D.useRef(u),R=c!=null,k=Ns(c),A=Ns(o),z=Ns(l),G=D.useCallback(()=>{if(!M.current||!b.current)return;const P={placement:t,strategy:n,middleware:f};A.current&&(P.platform=A.current),lw(M.current,b.current,P).then(I=>{const O={...I,isPositioned:z.current!==!1};j.current&&!Io(T.current,O)&&(T.current=O,Ho.flushSync(()=>{d(O)}))})},[f,t,n,A,z]);yo(()=>{l===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,d(P=>({...P,isPositioned:!1})))},[l]);const j=D.useRef(!1);yo(()=>(j.current=!0,()=>{j.current=!1}),[]),yo(()=>{if(C&&(M.current=C),v&&(b.current=v),C&&v){if(k.current)return k.current(C,v,G);G()}},[C,v,G,k,R]);const F=D.useMemo(()=>({reference:M,floating:b,setReference:p,setFloating:g}),[p,g]),_=D.useMemo(()=>({reference:C,floating:v}),[C,v]),N=D.useMemo(()=>{const P={position:n,left:0,top:0};if(!_.floating)return P;const I=gl(_.floating,u.x),O=gl(_.floating,u.y);return a?{...P,transform:"translate("+I+"px, "+O+"px)",...Lf(_.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:I,top:O}},[n,a,_.floating,u.x,u.y]);return D.useMemo(()=>({...u,update:G,refs:F,elements:_,floatingStyles:N}),[u,G,F,_,N])}const dw=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?ml({element:r.current,padding:o}).fn(n):{}:r?ml({element:r,padding:o}).fn(n):{}}}},fw=(e,t)=>({...rw(e),options:[e,t]}),hw=(e,t)=>({...ow(e),options:[e,t]}),pw=(e,t)=>({...cw(e),options:[e,t]}),mw=(e,t)=>({...sw(e),options:[e,t]}),gw=(e,t)=>({...iw(e),options:[e,t]}),vw=(e,t)=>({...aw(e),options:[e,t]}),yw=(e,t)=>({...dw(e),options:[e,t]});var bw="Arrow",Vf=D.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...s}=e;return x.jsx(ae.svg,{...s,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:x.jsx("polygon",{points:"0,0 30,0 15,10"})})});Vf.displayName=bw;var xw=Vf;function ww(e){const[t,n]=D.useState(void 0);return _e(()=>{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 c=s.borderBoxSize,l=Array.isArray(c)?c[0]:c;i=l.inlineSize,a=l.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 Ca="Popper",[Ff,Ut]=Ht(Ca),[Sw,$f]=Ff(Ca),Bf=e=>{const{__scopePopper:t,children:n}=e,[r,o]=D.useState(null);return x.jsx(Sw,{scope:t,anchor:r,onAnchorChange:o,children:n})};Bf.displayName=Ca;var zf="PopperAnchor",Wf=D.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,s=$f(zf,n),i=D.useRef(null),a=fe(t,i);return D.useEffect(()=>{s.onAnchorChange((r==null?void 0:r.current)||i.current)}),r?null:x.jsx(ae.div,{...o,ref:a})});Wf.displayName=zf;var Ta="PopperContent",[Cw,Tw]=Ff(Ta),Hf=D.forwardRef((e,t)=>{var $,q,X,U,ne,B;const{__scopePopper:n,side:r="bottom",sideOffset:o=0,align:s="center",alignOffset:i=0,arrowPadding:a=0,avoidCollisions:c=!0,collisionBoundary:l=[],collisionPadding:u=0,sticky:d="partial",hideWhenDetached:f=!1,updatePositionStrategy:h="optimized",onPlaced:S,...m}=e,w=$f(Ta,n),[y,p]=D.useState(null),g=fe(t,ie=>p(ie)),[C,v]=D.useState(null),M=ww(C),b=(M==null?void 0:M.width)??0,T=(M==null?void 0:M.height)??0,R=r+(s!=="center"?"-"+s:""),k=typeof u=="number"?u:{top:0,right:0,bottom:0,left:0,...u},A=Array.isArray(l)?l:[l],z=A.length>0,G={padding:k,boundary:A.filter(Ew),altBoundary:z},{refs:j,floatingStyles:F,placement:_,isPositioned:N,middlewareData:P}=uw({strategy:"fixed",placement:R,whileElementsMounted:(...ie)=>nw(...ie,{animationFrame:h==="always"}),elements:{reference:w.anchor},middleware:[fw({mainAxis:o+T,alignmentAxis:i}),c&&hw({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?pw():void 0,...G}),c&&mw({...G}),gw({...G,apply:({elements:ie,rects:pe,availableWidth:Oe,availableHeight:Ee})=>{const{width:ot,height:J}=pe.reference,le=ie.floating.style;le.setProperty("--radix-popper-available-width",`${Oe}px`),le.setProperty("--radix-popper-available-height",`${Ee}px`),le.setProperty("--radix-popper-anchor-width",`${ot}px`),le.setProperty("--radix-popper-anchor-height",`${J}px`)}}),C&&yw({element:C,padding:a}),Mw({arrowWidth:b,arrowHeight:T}),f&&vw({strategy:"referenceHidden",...G})]}),[I,O]=Kf(_),V=Ze(S);_e(()=>{N&&(V==null||V())},[N,V]);const W=($=P.arrow)==null?void 0:$.x,H=(q=P.arrow)==null?void 0:q.y,L=((X=P.arrow)==null?void 0:X.centerOffset)!==0,[Y,K]=D.useState();return _e(()=>{y&&K(window.getComputedStyle(y).zIndex)},[y]),x.jsx("div",{ref:j.setFloating,"data-radix-popper-content-wrapper":"",style:{...F,transform:N?F.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Y,"--radix-popper-transform-origin":[(U=P.transformOrigin)==null?void 0:U.x,(ne=P.transformOrigin)==null?void 0:ne.y].join(" "),...((B=P.hide)==null?void 0:B.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:x.jsx(Cw,{scope:n,placedSide:I,onArrowChange:v,arrowX:W,arrowY:H,shouldHideArrow:L,children:x.jsx(ae.div,{"data-side":I,"data-align":O,...m,ref:g,style:{...m.style,animation:N?void 0:"none"}})})})});Hf.displayName=Ta;var Uf="PopperArrow",Dw={top:"bottom",right:"left",bottom:"top",left:"right"},Yf=D.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,s=Tw(Uf,r),i=Dw[s.placedSide];return x.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:x.jsx(xw,{...o,ref:n,style:{...o.style,display:"block"}})})});Yf.displayName=Uf;function Ew(e){return e!==null}var Mw=e=>({name:"transformOrigin",options:e,fn(t){var w,y,p;const{placement:n,rects:r,middlewareData:o}=t,i=((w=o.arrow)==null?void 0:w.centerOffset)!==0,a=i?0:e.arrowWidth,c=i?0:e.arrowHeight,[l,u]=Kf(n),d={start:"0%",center:"50%",end:"100%"}[u],f=(((y=o.arrow)==null?void 0:y.x)??0)+a/2,h=(((p=o.arrow)==null?void 0:p.y)??0)+c/2;let S="",m="";return l==="bottom"?(S=i?d:`${f}px`,m=`${-c}px`):l==="top"?(S=i?d:`${f}px`,m=`${r.floating.height+c}px`):l==="right"?(S=`${-c}px`,m=i?d:`${h}px`):l==="left"&&(S=`${r.floating.width+c}px`,m=i?d:`${h}px`),{data:{x:S,y:m}}}});function Kf(e){const[t,n="center"]=e.split("-");return[t,n]}var ns=Bf,Fr=Wf,rs=Hf,os=Yf,Rw="Portal",$r=D.forwardRef((e,t)=>{var a;const{container:n,...r}=e,[o,s]=D.useState(!1);_e(()=>s(!0),[]);const i=n||o&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return i?vt.createPortal(x.jsx(ae.div,{...r,ref:t}),i):null});$r.displayName=Rw;function Pw(e,t){return D.useReducer((n,r)=>t[n][r]??n,e)}var Dt=e=>{const{present:t,children:n}=e,r=Aw(t),o=typeof n=="function"?n({present:r.isPresent}):D.Children.only(n),s=fe(r.ref,Ow(o));return typeof n=="function"||r.isPresent?D.cloneElement(o,{ref:s}):null};Dt.displayName="Presence";function Aw(e){const[t,n]=D.useState(),r=D.useRef({}),o=D.useRef(e),s=D.useRef("none"),i=e?"mounted":"unmounted",[a,c]=Pw(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return D.useEffect(()=>{const l=to(r.current);s.current=a==="mounted"?l:"none"},[a]),_e(()=>{const l=r.current,u=o.current;if(u!==e){const f=s.current,h=to(l);e?c("MOUNT"):h==="none"||(l==null?void 0:l.display)==="none"?c("UNMOUNT"):c(u&&f!==h?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,c]),_e(()=>{if(t){let l;const u=t.ownerDocument.defaultView??window,d=h=>{const m=to(r.current).includes(h.animationName);if(h.target===t&&m&&(c("ANIMATION_END"),!o.current)){const w=t.style.animationFillMode;t.style.animationFillMode="forwards",l=u.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=w)})}},f=h=>{h.target===t&&(s.current=to(r.current))};return t.addEventListener("animationstart",f),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{u.clearTimeout(l),t.removeEventListener("animationstart",f),t.removeEventListener("animationcancel",d),t.removeEventListener("animationend",d)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:D.useCallback(l=>{l&&(r.current=getComputedStyle(l)),n(l)},[])}}function to(e){return(e==null?void 0:e.animationName)||"none"}function Ow(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 un({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,o]=kw({defaultProp:t,onChange:n}),s=e!==void 0,i=s?e:r,a=Ze(n),c=D.useCallback(l=>{if(s){const d=typeof l=="function"?l(e):l;d!==e&&a(d)}else o(l)},[s,e,o,a]);return[i,c]}function kw({defaultProp:e,onChange:t}){const n=D.useState(e),[r]=n,o=D.useRef(r),s=Ze(t);return D.useEffect(()=>{o.current!==r&&(s(r),o.current=r)},[r,o,s]),n}var _w="VisuallyHidden",Da=D.forwardRef((e,t)=>x.jsx(ae.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}}));Da.displayName=_w;var Nw=Da,[ss,lO]=Ht("Tooltip",[Ut]),is=Ut(),Gf="TooltipProvider",Iw=700,Ci="tooltip.open",[jw,Ea]=ss(Gf),qf=e=>{const{__scopeTooltip:t,delayDuration:n=Iw,skipDelayDuration:r=300,disableHoverableContent:o=!1,children:s}=e,i=D.useRef(!0),a=D.useRef(!1),c=D.useRef(0);return D.useEffect(()=>{const l=c.current;return()=>window.clearTimeout(l)},[]),x.jsx(jw,{scope:t,isOpenDelayedRef:i,delayDuration:n,onOpen:D.useCallback(()=>{window.clearTimeout(c.current),i.current=!1},[]),onClose:D.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>i.current=!0,r)},[r]),isPointerInTransitRef:a,onPointerInTransitChange:D.useCallback(l=>{a.current=l},[]),disableHoverableContent:o,children:s})};qf.displayName=Gf;var as="Tooltip",[Lw,Br]=ss(as),Xf=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:o=!1,onOpenChange:s,disableHoverableContent:i,delayDuration:a}=e,c=Ea(as,e.__scopeTooltip),l=is(t),[u,d]=D.useState(null),f=Vt(),h=D.useRef(0),S=i??c.disableHoverableContent,m=a??c.delayDuration,w=D.useRef(!1),[y=!1,p]=un({prop:r,defaultProp:o,onChange:b=>{b?(c.onOpen(),document.dispatchEvent(new CustomEvent(Ci))):c.onClose(),s==null||s(b)}}),g=D.useMemo(()=>y?w.current?"delayed-open":"instant-open":"closed",[y]),C=D.useCallback(()=>{window.clearTimeout(h.current),h.current=0,w.current=!1,p(!0)},[p]),v=D.useCallback(()=>{window.clearTimeout(h.current),h.current=0,p(!1)},[p]),M=D.useCallback(()=>{window.clearTimeout(h.current),h.current=window.setTimeout(()=>{w.current=!0,p(!0),h.current=0},m)},[m,p]);return D.useEffect(()=>()=>{h.current&&(window.clearTimeout(h.current),h.current=0)},[]),x.jsx(ns,{...l,children:x.jsx(Lw,{scope:t,contentId:f,open:y,stateAttribute:g,trigger:u,onTriggerChange:d,onTriggerEnter:D.useCallback(()=>{c.isOpenDelayedRef.current?M():C()},[c.isOpenDelayedRef,M,C]),onTriggerLeave:D.useCallback(()=>{S?v():(window.clearTimeout(h.current),h.current=0)},[v,S]),onOpen:C,onClose:v,disableHoverableContent:S,children:n})})};Xf.displayName=as;var Ti="TooltipTrigger",Zf=D.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=Br(Ti,n),s=Ea(Ti,n),i=is(n),a=D.useRef(null),c=fe(t,a,o.onTriggerChange),l=D.useRef(!1),u=D.useRef(!1),d=D.useCallback(()=>l.current=!1,[]);return D.useEffect(()=>()=>document.removeEventListener("pointerup",d),[d]),x.jsx(Fr,{asChild:!0,...i,children:x.jsx(ae.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...r,ref:c,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(),l.current=!0,document.addEventListener("pointerup",d,{once:!0})}),onFocus:te(e.onFocus,()=>{l.current||o.onOpen()}),onBlur:te(e.onBlur,o.onClose),onClick:te(e.onClick,o.onClose)})})});Zf.displayName=Ti;var Ma="TooltipPortal",[Vw,Fw]=ss(Ma,{forceMount:void 0}),Jf=e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:o}=e,s=Br(Ma,t);return x.jsx(Vw,{scope:t,forceMount:n,children:x.jsx(Dt,{present:n||s.open,children:x.jsx($r,{asChild:!0,container:o,children:r})})})};Jf.displayName=Ma;var kn="TooltipContent",Qf=D.forwardRef((e,t)=>{const n=Fw(kn,e.__scopeTooltip),{forceMount:r=n.forceMount,side:o="top",...s}=e,i=Br(kn,e.__scopeTooltip);return x.jsx(Dt,{present:r||i.open,children:i.disableHoverableContent?x.jsx(eh,{side:o,...s,ref:t}):x.jsx($w,{side:o,...s,ref:t})})}),$w=D.forwardRef((e,t)=>{const n=Br(kn,e.__scopeTooltip),r=Ea(kn,e.__scopeTooltip),o=D.useRef(null),s=fe(t,o),[i,a]=D.useState(null),{trigger:c,onClose:l}=n,u=o.current,{onPointerInTransitChange:d}=r,f=D.useCallback(()=>{a(null),d(!1)},[d]),h=D.useCallback((S,m)=>{const w=S.currentTarget,y={x:S.clientX,y:S.clientY},p=Uw(y,w.getBoundingClientRect()),g=Yw(y,p),C=Kw(m.getBoundingClientRect()),v=qw([...g,...C]);a(v),d(!0)},[d]);return D.useEffect(()=>()=>f(),[f]),D.useEffect(()=>{if(c&&u){const S=w=>h(w,u),m=w=>h(w,c);return c.addEventListener("pointerleave",S),u.addEventListener("pointerleave",m),()=>{c.removeEventListener("pointerleave",S),u.removeEventListener("pointerleave",m)}}},[c,u,h,f]),D.useEffect(()=>{if(i){const S=m=>{const w=m.target,y={x:m.clientX,y:m.clientY},p=(c==null?void 0:c.contains(w))||(u==null?void 0:u.contains(w)),g=!Gw(y,i);p?f():g&&(f(),l())};return document.addEventListener("pointermove",S),()=>document.removeEventListener("pointermove",S)}},[c,u,i,l,f]),x.jsx(eh,{...e,ref:s})}),[Bw,zw]=ss(as,{isInside:!1}),Ww=sx("TooltipContent"),eh=D.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":o,onEscapeKeyDown:s,onPointerDownOutside:i,...a}=e,c=Br(kn,n),l=is(n),{onClose:u}=c;return D.useEffect(()=>(document.addEventListener(Ci,u),()=>document.removeEventListener(Ci,u)),[u]),D.useEffect(()=>{if(c.trigger){const d=f=>{const h=f.target;h!=null&&h.contains(c.trigger)&&u()};return window.addEventListener("scroll",d,{capture:!0}),()=>window.removeEventListener("scroll",d,{capture:!0})}},[c.trigger,u]),x.jsx(Lr,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:d=>d.preventDefault(),onDismiss:u,children:x.jsxs(rs,{"data-state":c.stateAttribute,...l,...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:[x.jsx(Ww,{children:r}),x.jsx(Bw,{scope:n,isInside:!0,children:x.jsx(Nw,{id:c.contentId,role:"tooltip",children:o||r})})]})})});Qf.displayName=kn;var th="TooltipArrow",Hw=D.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=is(n);return zw(th,n).isInside?null:x.jsx(os,{...o,...r,ref:t})});Hw.displayName=th;function Uw(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 Yw(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 Kw(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 Gw(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,c=t[s].y,l=t[i].x,u=t[i].y;c>r!=u>r&&n<(l-a)*(r-c)/(u-c)+a&&(o=!o)}return o}function qw(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),Xw(t)}function Xw(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 Zw=qf,Jw=Xf,Qw=Zf,eS=Jf,tS=Qf;function Ra({delayDuration:e=0,...t}){return x.jsx(Zw,{"data-slot":"tooltip-provider",delayDuration:e,...t})}function nh({...e}){return x.jsx(Ra,{children:x.jsx(Jw,{"data-slot":"tooltip",...e})})}function rh({...e}){return x.jsx(Qw,{"data-slot":"tooltip-trigger",...e})}function oh({className:e,sideOffset:t=0,children:n,...r}){return x.jsx(eS,{children:x.jsx(tS,{"data-slot":"tooltip-content",sideOffset:t,className:ce("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 Pa=({children:e,content:t})=>x.jsx(Ra,{children:x.jsxs(nh,{children:[x.jsx(rh,{asChild:!0,children:e}),x.jsx(oh,{sideOffset:3,side:"bottom",className:"border border-input bg-popover px-2 py-1 text-xs text-muted-foreground",children:t})]})}),nS=(e,t,n,r)=>{var s,i,a,c;const o=[n,{code:t,...r||{}}];if((i=(s=e==null?void 0:e.services)==null?void 0:s.logger)!=null&&i.forward)return e.services.logger.forward(o,"warn","react-i18next::",!0);nn(o[0])&&(o[0]=`react-i18next:: ${o[0]}`),(c=(a=e==null?void 0:e.services)==null?void 0:a.logger)!=null&&c.warn?e.services.logger.warn(...o):console!=null&&console.warn&&console.warn(...o)},vl={},Di=(e,t,n,r)=>{nn(n)&&vl[n]||(nn(n)&&(vl[n]=new Date),nS(e,t,n,r))},sh=(e,t)=>()=>{if(e.isInitialized)t();else{const n=()=>{setTimeout(()=>{e.off("initialized",n)},0),t()};e.on("initialized",n)}},Ei=(e,t,n)=>{e.loadNamespaces(t,sh(e,n))},yl=(e,t,n,r)=>{if(nn(n)&&(n=[n]),e.options.preload&&e.options.preload.indexOf(t)>-1)return Ei(e,n,r);n.forEach(o=>{e.options.ns.indexOf(o)<0&&e.options.ns.push(o)}),e.loadLanguages(t,sh(e,r))},rS=(e,t,n={})=>!t.languages||!t.languages.length?(Di(t,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:t.languages}),!0):t.hasLoadedNamespace(e,{lng:n.lng,precheck:(r,o)=>{var s;if(((s=n.bindI18n)==null?void 0:s.indexOf("languageChanging"))>-1&&r.services.backendConnector.backend&&r.isLanguageChangingTo&&!o(r.isLanguageChangingTo,e))return!1}}),nn=e=>typeof e=="string",oS=e=>typeof e=="object"&&e!==null,sS=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,iS={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},aS=e=>iS[e],cS=e=>e.replace(sS,aS);let lS={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:cS};const uS=()=>lS;let dS;const fS=()=>dS,Aa=E.createContext();class hS{constructor(){this.usedNamespaces={}}addUsedNamespaces(t){t.forEach(n=>{this.usedNamespaces[n]||(this.usedNamespaces[n]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}const pS=(e,t)=>{const n=E.useRef();return E.useEffect(()=>{n.current=e},[e,t]),n.current},ih=(e,t,n,r)=>e.getFixedT(t,n,r),mS=(e,t,n,r)=>E.useCallback(ih(e,t,n,r),[e,t,n,r]),ah=(e,t={})=>{var C,v,M,b;const{i18n:n}=t,{i18n:r,defaultNS:o}=E.useContext(Aa)||{},s=n||r||fS();if(s&&!s.reportNamespaces&&(s.reportNamespaces=new hS),!s){Di(s,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next");const T=(k,A)=>nn(A)?A:oS(A)&&nn(A.defaultValue)?A.defaultValue:Array.isArray(k)?k[k.length-1]:k,R=[T,{},!1];return R.t=T,R.i18n={},R.ready=!1,R}(C=s.options.react)!=null&&C.wait&&Di(s,"DEPRECATED_OPTION","useTranslation: It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");const i={...uS(),...s.options.react,...t},{useSuspense:a,keyPrefix:c}=i;let l=o||((v=s.options)==null?void 0:v.defaultNS);l=nn(l)?[l]:l||["translation"],(b=(M=s.reportNamespaces).addUsedNamespaces)==null||b.call(M,l);const u=(s.isInitialized||s.initializedStoreOnce)&&l.every(T=>rS(T,s,i)),d=mS(s,t.lng||null,i.nsMode==="fallback"?l:l[0],c),f=()=>d,h=()=>ih(s,t.lng||null,i.nsMode==="fallback"?l:l[0],c),[S,m]=E.useState(f);let w=l.join();t.lng&&(w=`${t.lng}${w}`);const y=pS(w),p=E.useRef(!0);E.useEffect(()=>{const{bindI18n:T,bindI18nStore:R}=i;p.current=!0,!u&&!a&&(t.lng?yl(s,t.lng,l,()=>{p.current&&m(h)}):Ei(s,l,()=>{p.current&&m(h)})),u&&y&&y!==w&&p.current&&m(h);const k=()=>{p.current&&m(h)};return T&&(s==null||s.on(T,k)),R&&(s==null||s.store.on(R,k)),()=>{p.current=!1,s&&(T==null||T.split(" ").forEach(A=>s.off(A,k))),R&&s&&R.split(" ").forEach(A=>s.store.off(A,k))}},[s,w]),E.useEffect(()=>{p.current&&u&&m(f)},[s,c,u]);const g=[S,s,u];if(g.t=S,g.i18n=s,g.ready=u,u||!u&&!a)return g;throw new Promise(T=>{t.lng?yl(s,t.lng,l,()=>T()):Ei(s,l,()=>T())})};function gS({i18n:e,defaultNS:t,children:n}){const r=E.useMemo(()=>({i18n:e,defaultNS:t}),[e,t]);return E.createElement(Aa.Provider,{value:r},n)}const vS=()=>{const[e]=ah(),{i18n:{language:t}}=E.useContext(Aa);return[t,e]},bl=e=>Symbol.iterator in e,xl=e=>"entries"in e,wl=(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},yS=(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 bS(e,t){return Object.is(e,t)?!0:typeof e!="object"||e===null||typeof t!="object"||t===null?!1:!bl(e)||!bl(t)?wl({entries:()=>Object.entries(e)},{entries:()=>Object.entries(t)}):xl(e)&&xl(t)?wl(e,t):yS(e,t)}function zr(e){const t=E.useRef(void 0);return n=>{const r=e(n);return bS(t.current,r)?t.current:t.current=r}}function Oa(e){const t=e+"CollectionProvider",[n,r]=Ht(t),[o,s]=n(t,{collectionRef:{current:null},itemMap:new Map}),i=m=>{const{scope:w,children:y}=m,p=E.useRef(null),g=E.useRef(new Map).current;return x.jsx(o,{scope:w,itemMap:g,collectionRef:p,children:y})};i.displayName=t;const a=e+"CollectionSlot",c=an(a),l=E.forwardRef((m,w)=>{const{scope:y,children:p}=m,g=s(a,y),C=fe(w,g.collectionRef);return x.jsx(c,{ref:C,children:p})});l.displayName=a;const u=e+"CollectionItemSlot",d="data-radix-collection-item",f=an(u),h=E.forwardRef((m,w)=>{const{scope:y,children:p,...g}=m,C=E.useRef(null),v=fe(w,C),M=s(u,y);return E.useEffect(()=>(M.itemMap.set(C,{ref:C,...g}),()=>void M.itemMap.delete(C))),x.jsx(f,{[d]:"",ref:v,children:p})});h.displayName=u;function S(m){const w=s(e+"CollectionConsumer",m);return E.useCallback(()=>{const p=w.collectionRef.current;if(!p)return[];const g=Array.from(p.querySelectorAll(`[${d}]`));return Array.from(w.itemMap.values()).sort((M,b)=>g.indexOf(M.ref.current)-g.indexOf(b.ref.current))},[w.collectionRef,w.itemMap])}return[{Provider:i,Slot:l,ItemSlot:h},S,r]}var xS=D.createContext(void 0);function ka(e){const t=D.useContext(xS);return e||t||"ltr"}var Is=0;function _a(){D.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Sl()),document.body.insertAdjacentElement("beforeend",e[1]??Sl()),Is++,()=>{Is===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Is--}},[])}function Sl(){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 js="focusScope.autoFocusOnMount",Ls="focusScope.autoFocusOnUnmount",Cl={bubbles:!1,cancelable:!0},wS="FocusScope",cs=D.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:s,...i}=e,[a,c]=D.useState(null),l=Ze(o),u=Ze(s),d=D.useRef(null),f=fe(t,m=>c(m)),h=D.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;D.useEffect(()=>{if(r){let m=function(g){if(h.paused||!a)return;const C=g.target;a.contains(C)?d.current=C:_t(d.current,{select:!0})},w=function(g){if(h.paused||!a)return;const C=g.relatedTarget;C!==null&&(a.contains(C)||_t(d.current,{select:!0}))},y=function(g){if(document.activeElement===document.body)for(const v of g)v.removedNodes.length>0&&_t(a)};document.addEventListener("focusin",m),document.addEventListener("focusout",w);const p=new MutationObserver(y);return a&&p.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",m),document.removeEventListener("focusout",w),p.disconnect()}}},[r,a,h.paused]),D.useEffect(()=>{if(a){Dl.add(h);const m=document.activeElement;if(!a.contains(m)){const y=new CustomEvent(js,Cl);a.addEventListener(js,l),a.dispatchEvent(y),y.defaultPrevented||(SS(MS(ch(a)),{select:!0}),document.activeElement===m&&_t(a))}return()=>{a.removeEventListener(js,l),setTimeout(()=>{const y=new CustomEvent(Ls,Cl);a.addEventListener(Ls,u),a.dispatchEvent(y),y.defaultPrevented||_t(m??document.body,{select:!0}),a.removeEventListener(Ls,u),Dl.remove(h)},0)}}},[a,l,u,h]);const S=D.useCallback(m=>{if(!n&&!r||h.paused)return;const w=m.key==="Tab"&&!m.altKey&&!m.ctrlKey&&!m.metaKey,y=document.activeElement;if(w&&y){const p=m.currentTarget,[g,C]=CS(p);g&&C?!m.shiftKey&&y===C?(m.preventDefault(),n&&_t(g,{select:!0})):m.shiftKey&&y===g&&(m.preventDefault(),n&&_t(C,{select:!0})):y===p&&m.preventDefault()}},[n,r,h.paused]);return x.jsx(ae.div,{tabIndex:-1,...i,ref:f,onKeyDown:S})});cs.displayName=wS;function SS(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(_t(r,{select:t}),document.activeElement!==n)return}function CS(e){const t=ch(e),n=Tl(t,e),r=Tl(t.reverse(),e);return[n,r]}function ch(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 Tl(e,t){for(const n of e)if(!TS(n,{upTo:t}))return n}function TS(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 DS(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&&DS(e)&&t&&e.select()}}var Dl=ES();function ES(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=El(e,t),e.unshift(t)},remove(t){var n;e=El(e,t),(n=e[0])==null||n.resume()}}}function El(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function MS(e){return e.filter(t=>t.tagName!=="A")}var Vs="rovingFocusGroup.onEntryFocus",RS={bubbles:!1,cancelable:!0},ls="RovingFocusGroup",[Mi,lh,PS]=Oa(ls),[AS,uh]=Ht(ls,[PS]),[OS,kS]=AS(ls),dh=D.forwardRef((e,t)=>x.jsx(Mi.Provider,{scope:e.__scopeRovingFocusGroup,children:x.jsx(Mi.Slot,{scope:e.__scopeRovingFocusGroup,children:x.jsx(_S,{...e,ref:t})})}));dh.displayName=ls;var _S=D.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:s,currentTabStopId:i,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:c,onEntryFocus:l,preventScrollOnEntryFocus:u=!1,...d}=e,f=D.useRef(null),h=fe(t,f),S=ka(s),[m=null,w]=un({prop:i,defaultProp:a,onChange:c}),[y,p]=D.useState(!1),g=Ze(l),C=lh(n),v=D.useRef(!1),[M,b]=D.useState(0);return D.useEffect(()=>{const T=f.current;if(T)return T.addEventListener(Vs,g),()=>T.removeEventListener(Vs,g)},[g]),x.jsx(OS,{scope:n,orientation:r,dir:S,loop:o,currentTabStopId:m,onItemFocus:D.useCallback(T=>w(T),[w]),onItemShiftTab:D.useCallback(()=>p(!0),[]),onFocusableItemAdd:D.useCallback(()=>b(T=>T+1),[]),onFocusableItemRemove:D.useCallback(()=>b(T=>T-1),[]),children:x.jsx(ae.div,{tabIndex:y||M===0?-1:0,"data-orientation":r,...d,ref:h,style:{outline:"none",...e.style},onMouseDown:te(e.onMouseDown,()=>{v.current=!0}),onFocus:te(e.onFocus,T=>{const R=!v.current;if(T.target===T.currentTarget&&R&&!y){const k=new CustomEvent(Vs,RS);if(T.currentTarget.dispatchEvent(k),!k.defaultPrevented){const A=C().filter(_=>_.focusable),z=A.find(_=>_.active),G=A.find(_=>_.id===m),F=[z,G,...A].filter(Boolean).map(_=>_.ref.current);ph(F,u)}}v.current=!1}),onBlur:te(e.onBlur,()=>p(!1))})})}),fh="RovingFocusGroupItem",hh=D.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:s,...i}=e,a=Vt(),c=s||a,l=kS(fh,n),u=l.currentTabStopId===c,d=lh(n),{onFocusableItemAdd:f,onFocusableItemRemove:h}=l;return D.useEffect(()=>{if(r)return f(),()=>h()},[r,f,h]),x.jsx(Mi.ItemSlot,{scope:n,id:c,focusable:r,active:o,children:x.jsx(ae.span,{tabIndex:u?0:-1,"data-orientation":l.orientation,...i,ref:t,onMouseDown:te(e.onMouseDown,S=>{r?l.onItemFocus(c):S.preventDefault()}),onFocus:te(e.onFocus,()=>l.onItemFocus(c)),onKeyDown:te(e.onKeyDown,S=>{if(S.key==="Tab"&&S.shiftKey){l.onItemShiftTab();return}if(S.target!==S.currentTarget)return;const m=jS(S,l.orientation,l.dir);if(m!==void 0){if(S.metaKey||S.ctrlKey||S.altKey||S.shiftKey)return;S.preventDefault();let y=d().filter(p=>p.focusable).map(p=>p.ref.current);if(m==="last")y.reverse();else if(m==="prev"||m==="next"){m==="prev"&&y.reverse();const p=y.indexOf(S.currentTarget);y=l.loop?LS(y,p+1):y.slice(p+1)}setTimeout(()=>ph(y))}})})})});hh.displayName=fh;var NS={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function IS(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function jS(e,t,n){const r=IS(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return NS[r]}function ph(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function LS(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var VS=dh,FS=hh,$S=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},yn=new WeakMap,no=new WeakMap,ro={},Fs=0,mh=function(e){return e&&(e.host||mh(e.parentNode))},BS=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=mh(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})},zS=function(e,t,n,r){var o=BS(t,Array.isArray(e)?e:[e]);ro[n]||(ro[n]=new WeakMap);var s=ro[n],i=[],a=new Set,c=new Set(o),l=function(d){!d||a.has(d)||(a.add(d),l(d.parentNode))};o.forEach(l);var u=function(d){!d||c.has(d)||Array.prototype.forEach.call(d.children,function(f){if(a.has(f))u(f);else try{var h=f.getAttribute(r),S=h!==null&&h!=="false",m=(yn.get(f)||0)+1,w=(s.get(f)||0)+1;yn.set(f,m),s.set(f,w),i.push(f),m===1&&S&&no.set(f,!0),w===1&&f.setAttribute(n,"true"),S||f.setAttribute(r,"true")}catch(y){console.error("aria-hidden: cannot operate on ",f,y)}})};return u(t),a.clear(),Fs++,function(){i.forEach(function(d){var f=yn.get(d)-1,h=s.get(d)-1;yn.set(d,f),s.set(d,h),f||(no.has(d)||d.removeAttribute(r),no.delete(d)),h||d.removeAttribute(n)}),Fs--,Fs||(yn=new WeakMap,yn=new WeakMap,no=new WeakMap,ro={})}},Na=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=$S(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live]"))),zS(r,o,n,"aria-hidden")):function(){return null}},ct=function(){return ct=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},ct.apply(this,arguments)};function gh(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 WS(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 bo="right-scroll-bar-position",xo="width-before-scroll-bar",HS="with-scroll-bars-hidden",US="--removed-body-scroll-bar-size";function $s(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function YS(e,t){var n=E.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 KS=typeof window<"u"?D.useLayoutEffect:D.useEffect,Ml=new WeakMap;function GS(e,t){var n=YS(null,function(r){return e.forEach(function(o){return $s(o,r)})});return KS(function(){var r=Ml.get(n);if(r){var o=new Set(r),s=new Set(e),i=n.current;o.forEach(function(a){s.has(a)||$s(a,null)}),s.forEach(function(a){o.has(a)||$s(a,i)})}Ml.set(n,e)},[e]),n}function qS(e){return e}function XS(e,t){t===void 0&&(t=qS);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 c=function(){var u=i;i=[],u.forEach(s)},l=function(){return Promise.resolve().then(c)};l(),n={push:function(u){i.push(u),l()},filter:function(u){return i=i.filter(u),n}}}};return o}function ZS(e){e===void 0&&(e={});var t=XS(null);return t.options=ct({async:!0,ssr:!1},e),t}var vh=function(e){var t=e.sideCar,n=gh(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 D.createElement(r,ct({},n))};vh.isSideCarExport=!0;function JS(e,t){return e.useMedium(t),vh}var yh=ZS(),Bs=function(){},us=D.forwardRef(function(e,t){var n=D.useRef(null),r=D.useState({onScrollCapture:Bs,onWheelCapture:Bs,onTouchMoveCapture:Bs}),o=r[0],s=r[1],i=e.forwardProps,a=e.children,c=e.className,l=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,h=e.noIsolation,S=e.inert,m=e.allowPinchZoom,w=e.as,y=w===void 0?"div":w,p=e.gapMode,g=gh(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),C=f,v=GS([n,t]),M=ct(ct({},g),o);return D.createElement(D.Fragment,null,u&&D.createElement(C,{sideCar:yh,removeScrollBar:l,shards:d,noIsolation:h,inert:S,setCallbacks:s,allowPinchZoom:!!m,lockRef:n,gapMode:p}),i?D.cloneElement(D.Children.only(a),ct(ct({},M),{ref:v})):D.createElement(y,ct({},M,{className:c,ref:v}),a))});us.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};us.classNames={fullWidth:xo,zeroRight:bo};var QS=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function e0(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=QS();return t&&e.setAttribute("nonce",t),e}function t0(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function n0(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var r0=function(){var e=0,t=null;return{add:function(n){e==0&&(t=e0())&&(t0(t,n),n0(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},o0=function(){var e=r0();return function(t,n){D.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},bh=function(){var e=o0(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},s0={left:0,top:0,right:0,gap:0},zs=function(e){return parseInt(e||"",10)||0},i0=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[zs(n),zs(r),zs(o)]},a0=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return s0;var t=i0(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])}},c0=bh(),An="data-scroll-locked",l0=function(e,t,n,r){var o=e.left,s=e.top,i=e.right,a=e.gap;return n===void 0&&(n="margin"),`
|
|
110
|
-
.`.concat(
|
|
109
|
+
*/const bb=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],xb=Ae("X",bb);function cf(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=cf(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function lf(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=cf(e))&&(r&&(r+=" "),r+=t);return r}const da="-",wb=e=>{const t=Cb(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:i=>{const a=i.split(da);return a[0]===""&&a.length!==1&&a.shift(),uf(a,t)||Sb(i)},getConflictingClassGroupIds:(i,a)=>{const c=n[i]||[];return a&&r[i]?[...c,...r[i]]:c}}},uf=(e,t)=>{var i;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),o=r?uf(e.slice(1),r):void 0;if(o)return o;if(t.validators.length===0)return;const s=e.join(da);return(i=t.validators.find(({validator:a})=>a(s)))==null?void 0:i.classGroupId},Xc=/^\[(.+)\]$/,Sb=e=>{if(Xc.test(e)){const t=Xc.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},Cb=e=>{const{theme:t,classGroups:n}=e,r={nextPart:new Map,validators:[]};for(const o in n)mi(n[o],r,o,t);return r},mi=(e,t,n,r)=>{e.forEach(o=>{if(typeof o=="string"){const s=o===""?t:Zc(t,o);s.classGroupId=n;return}if(typeof o=="function"){if(Tb(o)){mi(o(r),t,n,r);return}t.validators.push({validator:o,classGroupId:n});return}Object.entries(o).forEach(([s,i])=>{mi(i,Zc(t,s),n,r)})})},Zc=(e,t)=>{let n=e;return t.split(da).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},Tb=e=>e.isThemeGetter,Db=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)}}},gi="!",vi=":",Eb=vi.length,Mb=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=o=>{const s=[];let i=0,a=0,c=0,l;for(let S=0;S<o.length;S++){let m=o[S];if(i===0&&a===0){if(m===vi){s.push(o.slice(c,S)),c=S+Eb;continue}if(m==="/"){l=S;continue}}m==="["?i++:m==="]"?i--:m==="("?a++:m===")"&&a--}const u=s.length===0?o:o.substring(c),d=Rb(u),h=d!==u,f=l&&l>c?l-c:void 0;return{modifiers:s,hasImportantModifier:h,baseClassName:d,maybePostfixModifierPosition:f}};if(t){const o=t+vi,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},Rb=e=>e.endsWith(gi)?e.substring(0,e.length-1):e.startsWith(gi)?e.substring(1):e,Pb=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}},Ab=e=>({cache:Db(e.cacheSize),parseClassName:Mb(e),sortModifiers:Pb(e),...wb(e)}),Ob=/\s+/,kb=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o,sortModifiers:s}=t,i=[],a=e.trim().split(Ob);let c="";for(let l=a.length-1;l>=0;l-=1){const u=a[l],{isExternal:d,modifiers:h,hasImportantModifier:f,baseClassName:S,maybePostfixModifierPosition:m}=n(u);if(d){c=u+(c.length>0?" "+c:c);continue}let w=!!m,g=r(w?S.substring(0,m):S);if(!g){if(!w){c=u+(c.length>0?" "+c:c);continue}if(g=r(S),!g){c=u+(c.length>0?" "+c:c);continue}w=!1}const p=s(h).join(":"),v=f?p+gi:p,C=v+g;if(i.includes(C))continue;i.push(C);const y=o(g,w);for(let M=0;M<y.length;++M){const b=y[M];i.push(v+b)}c=u+(c.length>0?" "+c:c)}return c};function _b(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=df(t))&&(r&&(r+=" "),r+=n);return r}const df=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=df(e[r]))&&(n&&(n+=" "),n+=t);return n};function Nb(e,...t){let n,r,o,s=i;function i(c){const l=t.reduce((u,d)=>d(u),e());return n=Ab(l),r=n.cache.get,o=n.cache.set,s=a,a(c)}function a(c){const l=r(c);if(l)return l;const u=kb(c,n);return o(c,u),u}return function(){return s(_b.apply(null,arguments))}}const we=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},ff=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,hf=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Ib=/^\d+\/\d+$/,jb=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Lb=/\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$/,Vb=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,Fb=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,$b=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,vn=e=>Ib.test(e),oe=e=>!!e&&!Number.isNaN(Number(e)),At=e=>!!e&&Number.isInteger(Number(e)),As=e=>e.endsWith("%")&&oe(e.slice(0,-1)),gt=e=>jb.test(e),Bb=()=>!0,zb=e=>Lb.test(e)&&!Vb.test(e),pf=()=>!1,Wb=e=>Fb.test(e),Hb=e=>$b.test(e),Ub=e=>!Q(e)&&!ee(e),Yb=e=>Vn(e,vf,pf),Q=e=>ff.test(e),Zt=e=>Vn(e,yf,zb),Os=e=>Vn(e,Zb,oe),Jc=e=>Vn(e,mf,pf),Kb=e=>Vn(e,gf,Hb),Xr=e=>Vn(e,bf,Wb),ee=e=>hf.test(e),Jn=e=>Fn(e,yf),Gb=e=>Fn(e,Jb),Qc=e=>Fn(e,mf),qb=e=>Fn(e,vf),Xb=e=>Fn(e,gf),Zr=e=>Fn(e,bf,!0),Vn=(e,t,n)=>{const r=ff.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},Fn=(e,t,n=!1)=>{const r=hf.exec(e);return r?r[1]?t(r[1]):n:!1},mf=e=>e==="position"||e==="percentage",gf=e=>e==="image"||e==="url",vf=e=>e==="length"||e==="size"||e==="bg-size",yf=e=>e==="length",Zb=e=>e==="number",Jb=e=>e==="family-name",bf=e=>e==="shadow",Qb=()=>{const e=we("color"),t=we("font"),n=we("text"),r=we("font-weight"),o=we("tracking"),s=we("leading"),i=we("breakpoint"),a=we("container"),c=we("spacing"),l=we("radius"),u=we("shadow"),d=we("inset-shadow"),h=we("text-shadow"),f=we("drop-shadow"),S=we("blur"),m=we("perspective"),w=we("aspect"),g=we("ease"),p=we("animate"),v=()=>["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"],y=()=>[...C(),ee,Q],M=()=>["auto","hidden","clip","visible","scroll"],b=()=>["auto","contain","none"],T=()=>[ee,Q,c],R=()=>[vn,"full","auto",...T()],_=()=>[At,"none","subgrid",ee,Q],O=()=>["auto",{span:["full",At,ee,Q]},At,ee,Q],z=()=>[At,"auto",ee,Q],G=()=>["auto","min","max","fr",ee,Q],j=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],F=()=>["start","end","center","stretch","center-safe","end-safe"],N=()=>["auto",...T()],k=()=>[vn,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...T()],P=()=>[e,ee,Q],I=()=>[...C(),Qc,Jc,{position:[ee,Q]}],A=()=>["no-repeat",{repeat:["","x","y","space","round"]}],V=()=>["auto","cover","contain",qb,Yb,{size:[ee,Q]}],W=()=>[As,Jn,Zt],H=()=>["","none","full",l,ee,Q],L=()=>["",oe,Jn,Zt],Y=()=>["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"],$=()=>[oe,As,Qc,Jc],q=()=>["","none",S,ee,Q],X=()=>["none",oe,ee,Q],U=()=>["none",oe,ee,Q],ne=()=>[oe,ee,Q],B=()=>[vn,"full",...T()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[gt],breakpoint:[gt],color:[Bb],container:[gt],"drop-shadow":[gt],ease:["in","out","in-out"],font:[Ub],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[gt],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[gt],shadow:[gt],spacing:["px",oe],text:[gt],"text-shadow":[gt],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",vn,Q,ee,w]}],container:["container"],columns:[{columns:[oe,Q,ee,a]}],"break-after":[{"break-after":v()}],"break-before":[{"break-before":v()}],"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:y()}],overflow:[{overflow:M()}],"overflow-x":[{"overflow-x":M()}],"overflow-y":[{"overflow-y":M()}],overscroll:[{overscroll:b()}],"overscroll-x":[{"overscroll-x":b()}],"overscroll-y":[{"overscroll-y":b()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:R()}],"inset-x":[{"inset-x":R()}],"inset-y":[{"inset-y":R()}],start:[{start:R()}],end:[{end:R()}],top:[{top:R()}],right:[{right:R()}],bottom:[{bottom:R()}],left:[{left:R()}],visibility:["visible","invisible","collapse"],z:[{z:[At,"auto",ee,Q]}],basis:[{basis:[vn,"full","auto",a,...T()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[oe,vn,"auto","initial","none",Q]}],grow:[{grow:["",oe,ee,Q]}],shrink:[{shrink:["",oe,ee,Q]}],order:[{order:[At,"first","last","none",ee,Q]}],"grid-cols":[{"grid-cols":_()}],"col-start-end":[{col:O()}],"col-start":[{"col-start":z()}],"col-end":[{"col-end":z()}],"grid-rows":[{"grid-rows":_()}],"row-start-end":[{row:O()}],"row-start":[{"row-start":z()}],"row-end":[{"row-end":z()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":G()}],"auto-rows":[{"auto-rows":G()}],gap:[{gap:T()}],"gap-x":[{"gap-x":T()}],"gap-y":[{"gap-y":T()}],"justify-content":[{justify:[...j(),"normal"]}],"justify-items":[{"justify-items":[...F(),"normal"]}],"justify-self":[{"justify-self":["auto",...F()]}],"align-content":[{content:["normal",...j()]}],"align-items":[{items:[...F(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...F(),{baseline:["","last"]}]}],"place-content":[{"place-content":j()}],"place-items":[{"place-items":[...F(),"baseline"]}],"place-self":[{"place-self":["auto",...F()]}],p:[{p:T()}],px:[{px:T()}],py:[{py:T()}],ps:[{ps:T()}],pe:[{pe:T()}],pt:[{pt:T()}],pr:[{pr:T()}],pb:[{pb:T()}],pl:[{pl:T()}],m:[{m:N()}],mx:[{mx:N()}],my:[{my:N()}],ms:[{ms:N()}],me:[{me:N()}],mt:[{mt:N()}],mr:[{mr:N()}],mb:[{mb:N()}],ml:[{ml:N()}],"space-x":[{"space-x":T()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":T()}],"space-y-reverse":["space-y-reverse"],size:[{size:k()}],w:[{w:[a,"screen",...k()]}],"min-w":[{"min-w":[a,"screen","none",...k()]}],"max-w":[{"max-w":[a,"screen","none","prose",{screen:[i]},...k()]}],h:[{h:["screen",...k()]}],"min-h":[{"min-h":["screen","none",...k()]}],"max-h":[{"max-h":["screen",...k()]}],"font-size":[{text:["base",n,Jn,Zt]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,ee,Os]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",As,Q]}],"font-family":[{font:[Gb,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":[oe,"none",ee,Os]}],leading:[{leading:[s,...T()]}],"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:P()}],"text-color":[{text:P()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Y(),"wavy"]}],"text-decoration-thickness":[{decoration:[oe,"from-font","auto",ee,Zt]}],"text-decoration-color":[{decoration:P()}],"underline-offset":[{"underline-offset":[oe,"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:T()}],"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:I()}],"bg-repeat":[{bg:A()}],"bg-size":[{bg:V()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},At,ee,Q],radial:["",ee,Q],conic:[At,ee,Q]},Xb,Kb]}],"bg-color":[{bg:P()}],"gradient-from-pos":[{from:W()}],"gradient-via-pos":[{via:W()}],"gradient-to-pos":[{to:W()}],"gradient-from":[{from:P()}],"gradient-via":[{via:P()}],"gradient-to":[{to:P()}],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:L()}],"border-w-x":[{"border-x":L()}],"border-w-y":[{"border-y":L()}],"border-w-s":[{"border-s":L()}],"border-w-e":[{"border-e":L()}],"border-w-t":[{"border-t":L()}],"border-w-r":[{"border-r":L()}],"border-w-b":[{"border-b":L()}],"border-w-l":[{"border-l":L()}],"divide-x":[{"divide-x":L()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":L()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...Y(),"hidden","none"]}],"divide-style":[{divide:[...Y(),"hidden","none"]}],"border-color":[{border:P()}],"border-color-x":[{"border-x":P()}],"border-color-y":[{"border-y":P()}],"border-color-s":[{"border-s":P()}],"border-color-e":[{"border-e":P()}],"border-color-t":[{"border-t":P()}],"border-color-r":[{"border-r":P()}],"border-color-b":[{"border-b":P()}],"border-color-l":[{"border-l":P()}],"divide-color":[{divide:P()}],"outline-style":[{outline:[...Y(),"none","hidden"]}],"outline-offset":[{"outline-offset":[oe,ee,Q]}],"outline-w":[{outline:["",oe,Jn,Zt]}],"outline-color":[{outline:P()}],shadow:[{shadow:["","none",u,Zr,Xr]}],"shadow-color":[{shadow:P()}],"inset-shadow":[{"inset-shadow":["none",d,Zr,Xr]}],"inset-shadow-color":[{"inset-shadow":P()}],"ring-w":[{ring:L()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:P()}],"ring-offset-w":[{"ring-offset":[oe,Zt]}],"ring-offset-color":[{"ring-offset":P()}],"inset-ring-w":[{"inset-ring":L()}],"inset-ring-color":[{"inset-ring":P()}],"text-shadow":[{"text-shadow":["none",h,Zr,Xr]}],"text-shadow-color":[{"text-shadow":P()}],opacity:[{opacity:[oe,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":[oe]}],"mask-image-linear-from-pos":[{"mask-linear-from":$()}],"mask-image-linear-to-pos":[{"mask-linear-to":$()}],"mask-image-linear-from-color":[{"mask-linear-from":P()}],"mask-image-linear-to-color":[{"mask-linear-to":P()}],"mask-image-t-from-pos":[{"mask-t-from":$()}],"mask-image-t-to-pos":[{"mask-t-to":$()}],"mask-image-t-from-color":[{"mask-t-from":P()}],"mask-image-t-to-color":[{"mask-t-to":P()}],"mask-image-r-from-pos":[{"mask-r-from":$()}],"mask-image-r-to-pos":[{"mask-r-to":$()}],"mask-image-r-from-color":[{"mask-r-from":P()}],"mask-image-r-to-color":[{"mask-r-to":P()}],"mask-image-b-from-pos":[{"mask-b-from":$()}],"mask-image-b-to-pos":[{"mask-b-to":$()}],"mask-image-b-from-color":[{"mask-b-from":P()}],"mask-image-b-to-color":[{"mask-b-to":P()}],"mask-image-l-from-pos":[{"mask-l-from":$()}],"mask-image-l-to-pos":[{"mask-l-to":$()}],"mask-image-l-from-color":[{"mask-l-from":P()}],"mask-image-l-to-color":[{"mask-l-to":P()}],"mask-image-x-from-pos":[{"mask-x-from":$()}],"mask-image-x-to-pos":[{"mask-x-to":$()}],"mask-image-x-from-color":[{"mask-x-from":P()}],"mask-image-x-to-color":[{"mask-x-to":P()}],"mask-image-y-from-pos":[{"mask-y-from":$()}],"mask-image-y-to-pos":[{"mask-y-to":$()}],"mask-image-y-from-color":[{"mask-y-from":P()}],"mask-image-y-to-color":[{"mask-y-to":P()}],"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":P()}],"mask-image-radial-to-color":[{"mask-radial-to":P()}],"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":[oe]}],"mask-image-conic-from-pos":[{"mask-conic-from":$()}],"mask-image-conic-to-pos":[{"mask-conic-to":$()}],"mask-image-conic-from-color":[{"mask-conic-from":P()}],"mask-image-conic-to-color":[{"mask-conic-to":P()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:I()}],"mask-repeat":[{mask:A()}],"mask-size":[{mask:V()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",ee,Q]}],filter:[{filter:["","none",ee,Q]}],blur:[{blur:q()}],brightness:[{brightness:[oe,ee,Q]}],contrast:[{contrast:[oe,ee,Q]}],"drop-shadow":[{"drop-shadow":["","none",f,Zr,Xr]}],"drop-shadow-color":[{"drop-shadow":P()}],grayscale:[{grayscale:["",oe,ee,Q]}],"hue-rotate":[{"hue-rotate":[oe,ee,Q]}],invert:[{invert:["",oe,ee,Q]}],saturate:[{saturate:[oe,ee,Q]}],sepia:[{sepia:["",oe,ee,Q]}],"backdrop-filter":[{"backdrop-filter":["","none",ee,Q]}],"backdrop-blur":[{"backdrop-blur":q()}],"backdrop-brightness":[{"backdrop-brightness":[oe,ee,Q]}],"backdrop-contrast":[{"backdrop-contrast":[oe,ee,Q]}],"backdrop-grayscale":[{"backdrop-grayscale":["",oe,ee,Q]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[oe,ee,Q]}],"backdrop-invert":[{"backdrop-invert":["",oe,ee,Q]}],"backdrop-opacity":[{"backdrop-opacity":[oe,ee,Q]}],"backdrop-saturate":[{"backdrop-saturate":[oe,ee,Q]}],"backdrop-sepia":[{"backdrop-sepia":["",oe,ee,Q]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":T()}],"border-spacing-x":[{"border-spacing-x":T()}],"border-spacing-y":[{"border-spacing-y":T()}],"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:[oe,"initial",ee,Q]}],ease:[{ease:["linear","initial",g,ee,Q]}],delay:[{delay:[oe,ee,Q]}],animate:[{animate:["none",p,ee,Q]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[m,ee,Q]}],"perspective-origin":[{"perspective-origin":y()}],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:ne()}],"skew-x":[{"skew-x":ne()}],"skew-y":[{"skew-y":ne()}],transform:[{transform:[ee,Q,"","none","gpu","cpu"]}],"transform-origin":[{origin:y()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:B()}],"translate-x":[{"translate-x":B()}],"translate-y":[{"translate-y":B()}],"translate-z":[{"translate-z":B()}],"translate-none":["translate-none"],accent:[{accent:P()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:P()}],"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":T()}],"scroll-mx":[{"scroll-mx":T()}],"scroll-my":[{"scroll-my":T()}],"scroll-ms":[{"scroll-ms":T()}],"scroll-me":[{"scroll-me":T()}],"scroll-mt":[{"scroll-mt":T()}],"scroll-mr":[{"scroll-mr":T()}],"scroll-mb":[{"scroll-mb":T()}],"scroll-ml":[{"scroll-ml":T()}],"scroll-p":[{"scroll-p":T()}],"scroll-px":[{"scroll-px":T()}],"scroll-py":[{"scroll-py":T()}],"scroll-ps":[{"scroll-ps":T()}],"scroll-pe":[{"scroll-pe":T()}],"scroll-pt":[{"scroll-pt":T()}],"scroll-pr":[{"scroll-pr":T()}],"scroll-pb":[{"scroll-pb":T()}],"scroll-pl":[{"scroll-pl":T()}],"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",...P()]}],"stroke-w":[{stroke:[oe,Jn,Zt,Os]}],stroke:[{stroke:["none",...P()]}],"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"]}},ex=Nb(Qb);function de(...e){return ex(lf(e))}function el(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Xo(...e){return t=>{let n=!1;const r=e.map(o=>{const s=el(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():el(e[o],null)}}}}function fe(...e){return D.useCallback(Xo(...e),e)}function sn(e){const t=nx(e),n=D.forwardRef((r,o)=>{const{children:s,...i}=r,a=D.Children.toArray(s),c=a.find(ox);if(c){const l=c.props.children,u=a.map(d=>d===c?D.Children.count(l)>1?D.Children.only(null):D.isValidElement(l)?l.props.children:null:d);return x.jsx(t,{...i,ref:o,children:D.isValidElement(l)?D.cloneElement(l,void 0,u):null})}return x.jsx(t,{...i,ref:o,children:s})});return n.displayName=`${e}.Slot`,n}var tx=sn("Slot");function nx(e){const t=D.forwardRef((n,r)=>{const{children:o,...s}=n;if(D.isValidElement(o)){const i=ix(o),a=sx(s,o.props);return o.type!==D.Fragment&&(a.ref=r?Xo(r,i):i),D.cloneElement(o,a)}return D.Children.count(o)>1?D.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var xf=Symbol("radix.slottable");function rx(e){const t=({children:n})=>x.jsx(x.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=xf,t}function ox(e){return D.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===xf}function sx(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 ix(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 tl=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,nl=lf,fa=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return nl(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:o,defaultVariants:s}=t,i=Object.keys(o).map(l=>{const u=n==null?void 0:n[l],d=s==null?void 0:s[l];if(u===null)return null;const h=tl(u)||tl(d);return o[l][h]}),a=n&&Object.entries(n).reduce((l,u)=>{let[d,h]=u;return h===void 0||(l[d]=h),l},{}),c=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((l,u)=>{let{class:d,className:h,...f}=u;return Object.entries(f).every(S=>{let[m,w]=S;return Array.isArray(w)?w.includes({...s,...a}[m]):{...s,...a}[m]===w})?[...l,d,h]:l},[]);return nl(e,i,c,n==null?void 0:n.class,n==null?void 0:n.className)},ax=fa("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 an({className:e,variant:t,size:n,asChild:r=!1,...o}){const s=r?tx:"button";return x.jsx(s,{"data-slot":"button",className:de(ax({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 Ht(e,t=[]){let n=[];function r(s,i){const a=D.createContext(i),c=n.length;n=[...n,i];const l=d=>{var g;const{scope:h,children:f,...S}=d,m=((g=h==null?void 0:h[e])==null?void 0:g[c])||a,w=D.useMemo(()=>S,Object.values(S));return x.jsx(m.Provider,{value:w,children:f})};l.displayName=s+"Provider";function u(d,h){var m;const f=((m=h==null?void 0:h[e])==null?void 0:m[c])||a,S=D.useContext(f);if(S)return S;if(i!==void 0)return i;throw new Error(`\`${d}\` must be used within \`${s}\``)}return[l,u]}const o=()=>{const s=n.map(i=>D.createContext(i));return function(a){const c=(a==null?void 0:a[e])||s;return D.useMemo(()=>({[`__scope${e}`]:{...a,[e]:c}}),[a,c])}};return o.scopeName=e,[r,cx(o,...t)]}function cx(...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:c,scopeName:l})=>{const d=c(s)[`__scope${l}`];return{...a,...d}},{});return D.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return n.scopeName=t.scopeName,n}var lx=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],ae=lx.reduce((e,t)=>{const n=sn(`Primitive.${t}`),r=D.forwardRef((o,s)=>{const{asChild:i,...a}=o,c=i?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),x.jsx(c,{...a,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function wf(e,t){e&&zo.flushSync(()=>e.dispatchEvent(t))}function Ze(e){const t=D.useRef(e);return D.useEffect(()=>{t.current=e}),D.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function ux(e,t=globalThis==null?void 0:globalThis.document){const n=Ze(e);D.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 dx="DismissableLayer",yi="dismissableLayer.update",fx="dismissableLayer.pointerDownOutside",hx="dismissableLayer.focusOutside",rl,Sf=D.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),jr=D.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:s,onInteractOutside:i,onDismiss:a,...c}=e,l=D.useContext(Sf),[u,d]=D.useState(null),h=(u==null?void 0:u.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,f]=D.useState({}),S=fe(t,b=>d(b)),m=Array.from(l.layers),[w]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),g=m.indexOf(w),p=u?m.indexOf(u):-1,v=l.layersWithOutsidePointerEventsDisabled.size>0,C=p>=g,y=gx(b=>{const T=b.target,R=[...l.branches].some(_=>_.contains(T));!C||R||(o==null||o(b),i==null||i(b),b.defaultPrevented||a==null||a())},h),M=vx(b=>{const T=b.target;[...l.branches].some(_=>_.contains(T))||(s==null||s(b),i==null||i(b),b.defaultPrevented||a==null||a())},h);return ux(b=>{p===l.layers.size-1&&(r==null||r(b),!b.defaultPrevented&&a&&(b.preventDefault(),a()))},h),D.useEffect(()=>{if(u)return n&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(rl=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),l.layersWithOutsidePointerEventsDisabled.add(u)),l.layers.add(u),ol(),()=>{n&&l.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=rl)}},[u,h,n,l]),D.useEffect(()=>()=>{u&&(l.layers.delete(u),l.layersWithOutsidePointerEventsDisabled.delete(u),ol())},[u,l]),D.useEffect(()=>{const b=()=>f({});return document.addEventListener(yi,b),()=>document.removeEventListener(yi,b)},[]),x.jsx(ae.div,{...c,ref:S,style:{pointerEvents:v?C?"auto":"none":void 0,...e.style},onFocusCapture:te(e.onFocusCapture,M.onFocusCapture),onBlurCapture:te(e.onBlurCapture,M.onBlurCapture),onPointerDownCapture:te(e.onPointerDownCapture,y.onPointerDownCapture)})});jr.displayName=dx;var px="DismissableLayerBranch",mx=D.forwardRef((e,t)=>{const n=D.useContext(Sf),r=D.useRef(null),o=fe(t,r);return D.useEffect(()=>{const s=r.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),x.jsx(ae.div,{...e,ref:o})});mx.displayName=px;function gx(e,t=globalThis==null?void 0:globalThis.document){const n=Ze(e),r=D.useRef(!1),o=D.useRef(()=>{});return D.useEffect(()=>{const s=a=>{if(a.target&&!r.current){let c=function(){Cf(fx,n,l,{discrete:!0})};const l={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=c,t.addEventListener("click",o.current,{once:!0})):c()}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 vx(e,t=globalThis==null?void 0:globalThis.document){const n=Ze(e),r=D.useRef(!1);return D.useEffect(()=>{const o=s=>{s.target&&!r.current&&Cf(hx,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 ol(){const e=new CustomEvent(yi);document.dispatchEvent(e)}function Cf(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?wf(o,s):o.dispatchEvent(s)}var _e=globalThis!=null&&globalThis.document?D.useLayoutEffect:()=>{},yx=D[" useId ".trim().toString()]||(()=>{}),bx=0;function Vt(e){const[t,n]=D.useState(yx());return _e(()=>{n(r=>r??String(bx++))},[e]),e||(t?`radix-${t}`:"")}const xx=["top","right","bottom","left"],Ft=Math.min,ze=Math.max,Ao=Math.round,Jr=Math.floor,lt=e=>({x:e,y:e}),wx={left:"right",right:"left",bottom:"top",top:"bottom"},Sx={start:"end",end:"start"};function bi(e,t,n){return ze(e,Ft(t,n))}function bt(e,t){return typeof e=="function"?e(t):e}function xt(e){return e.split("-")[0]}function $n(e){return e.split("-")[1]}function ha(e){return e==="x"?"y":"x"}function pa(e){return e==="y"?"height":"width"}function $t(e){return["top","bottom"].includes(xt(e))?"y":"x"}function ma(e){return ha($t(e))}function Cx(e,t,n){n===void 0&&(n=!1);const r=$n(e),o=ma(e),s=pa(o);let i=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=Oo(i)),[i,Oo(i)]}function Tx(e){const t=Oo(e);return[xi(e),t,xi(t)]}function xi(e){return e.replace(/start|end/g,t=>Sx[t])}function Dx(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 Ex(e,t,n,r){const o=$n(e);let s=Dx(xt(e),n==="start",r);return o&&(s=s.map(i=>i+"-"+o),t&&(s=s.concat(s.map(xi)))),s}function Oo(e){return e.replace(/left|right|bottom|top/g,t=>wx[t])}function Mx(e){return{top:0,right:0,bottom:0,left:0,...e}}function Tf(e){return typeof e!="number"?Mx(e):{top:e,right:e,bottom:e,left:e}}function ko(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 sl(e,t,n){let{reference:r,floating:o}=e;const s=$t(t),i=ma(t),a=pa(i),c=xt(t),l=s==="y",u=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,h=r[a]/2-o[a]/2;let f;switch(c){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($n(t)){case"start":f[i]-=h*(n&&l?-1:1);break;case"end":f[i]+=h*(n&&l?-1:1);break}return f}const Rx=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:s=[],platform:i}=n,a=s.filter(Boolean),c=await(i.isRTL==null?void 0:i.isRTL(t));let l=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:d}=sl(l,r,c),h=r,f={},S=0;for(let m=0;m<a.length;m++){const{name:w,fn:g}=a[m],{x:p,y:v,data:C,reset:y}=await g({x:u,y:d,initialPlacement:r,placement:h,strategy:o,middlewareData:f,rects:l,platform:i,elements:{reference:e,floating:t}});u=p??u,d=v??d,f={...f,[w]:{...f[w],...C}},y&&S<=50&&(S++,typeof y=="object"&&(y.placement&&(h=y.placement),y.rects&&(l=y.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:o}):y.rects),{x:u,y:d}=sl(l,h,c)),m=-1)}return{x:u,y:d,placement:h,strategy:o,middlewareData:f}};async function br(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:s,rects:i,elements:a,strategy:c}=e,{boundary:l="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:h=!1,padding:f=0}=bt(t,e),S=Tf(f),w=a[h?d==="floating"?"reference":"floating":d],g=ko(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(w)))==null||n?w:w.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:l,rootBoundary:u,strategy:c})),p=d==="floating"?{x:r,y:o,width:i.floating.width,height:i.floating.height}:i.reference,v=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),C=await(s.isElement==null?void 0:s.isElement(v))?await(s.getScale==null?void 0:s.getScale(v))||{x:1,y:1}:{x:1,y:1},y=ko(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:p,offsetParent:v,strategy:c}):p);return{top:(g.top-y.top+S.top)/C.y,bottom:(y.bottom-g.bottom+S.bottom)/C.y,left:(g.left-y.left+S.left)/C.x,right:(y.right-g.right+S.right)/C.x}}const Px=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:s,platform:i,elements:a,middlewareData:c}=t,{element:l,padding:u=0}=bt(e,t)||{};if(l==null)return{};const d=Tf(u),h={x:n,y:r},f=ma(o),S=pa(f),m=await i.getDimensions(l),w=f==="y",g=w?"top":"left",p=w?"bottom":"right",v=w?"clientHeight":"clientWidth",C=s.reference[S]+s.reference[f]-h[f]-s.floating[S],y=h[f]-s.reference[f],M=await(i.getOffsetParent==null?void 0:i.getOffsetParent(l));let b=M?M[v]:0;(!b||!await(i.isElement==null?void 0:i.isElement(M)))&&(b=a.floating[v]||s.floating[S]);const T=C/2-y/2,R=b/2-m[S]/2-1,_=Ft(d[g],R),O=Ft(d[p],R),z=_,G=b-m[S]-O,j=b/2-m[S]/2+T,F=bi(z,j,G),N=!c.arrow&&$n(o)!=null&&j!==F&&s.reference[S]/2-(j<z?_:O)-m[S]/2<0,k=N?j<z?j-z:j-G:0;return{[f]:h[f]+k,data:{[f]:F,centerOffset:j-F-k,...N&&{alignmentOffset:k}},reset:N}}}),Ax=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:c,elements:l}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:h,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:S="none",flipAlignment:m=!0,...w}=bt(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const g=xt(o),p=$t(a),v=xt(a)===a,C=await(c.isRTL==null?void 0:c.isRTL(l.floating)),y=h||(v||!m?[Oo(a)]:Tx(a)),M=S!=="none";!h&&M&&y.push(...Ex(a,m,S,C));const b=[a,...y],T=await br(t,w),R=[];let _=((r=s.flip)==null?void 0:r.overflows)||[];if(u&&R.push(T[g]),d){const j=Cx(o,i,C);R.push(T[j[0]],T[j[1]])}if(_=[..._,{placement:o,overflows:R}],!R.every(j=>j<=0)){var O,z;const j=(((O=s.flip)==null?void 0:O.index)||0)+1,F=b[j];if(F)return{data:{index:j,overflows:_},reset:{placement:F}};let N=(z=_.filter(k=>k.overflows[0]<=0).sort((k,P)=>k.overflows[1]-P.overflows[1])[0])==null?void 0:z.placement;if(!N)switch(f){case"bestFit":{var G;const k=(G=_.filter(P=>{if(M){const I=$t(P.placement);return I===p||I==="y"}return!0}).map(P=>[P.placement,P.overflows.filter(I=>I>0).reduce((I,A)=>I+A,0)]).sort((P,I)=>P[1]-I[1])[0])==null?void 0:G[0];k&&(N=k);break}case"initialPlacement":N=a;break}if(o!==N)return{reset:{placement:N}}}return{}}}};function il(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function al(e){return xx.some(t=>e[t]>=0)}const Ox=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=bt(e,t);switch(r){case"referenceHidden":{const s=await br(t,{...o,elementContext:"reference"}),i=il(s,n.reference);return{data:{referenceHiddenOffsets:i,referenceHidden:al(i)}}}case"escaped":{const s=await br(t,{...o,altBoundary:!0}),i=il(s,n.floating);return{data:{escapedOffsets:i,escaped:al(i)}}}default:return{}}}}};async function kx(e,t){const{placement:n,platform:r,elements:o}=e,s=await(r.isRTL==null?void 0:r.isRTL(o.floating)),i=xt(n),a=$n(n),c=$t(n)==="y",l=["left","top"].includes(i)?-1:1,u=s&&c?-1:1,d=bt(t,e);let{mainAxis:h,crossAxis:f,alignmentAxis:S}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&typeof S=="number"&&(f=a==="end"?S*-1:S),c?{x:f*u,y:h*l}:{x:h*l,y:f*u}}const _x=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,c=await kx(t,e);return i===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:o+c.x,y:s+c.y,data:{...c,placement:i}}}}},Nx=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:w=>{let{x:g,y:p}=w;return{x:g,y:p}}},...c}=bt(e,t),l={x:n,y:r},u=await br(t,c),d=$t(xt(o)),h=ha(d);let f=l[h],S=l[d];if(s){const w=h==="y"?"top":"left",g=h==="y"?"bottom":"right",p=f+u[w],v=f-u[g];f=bi(p,f,v)}if(i){const w=d==="y"?"top":"left",g=d==="y"?"bottom":"right",p=S+u[w],v=S-u[g];S=bi(p,S,v)}const m=a.fn({...t,[h]:f,[d]:S});return{...m,data:{x:m.x-n,y:m.y-r,enabled:{[h]:s,[d]:i}}}}}},Ix=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:c=!0,crossAxis:l=!0}=bt(e,t),u={x:n,y:r},d=$t(o),h=ha(d);let f=u[h],S=u[d];const m=bt(a,t),w=typeof m=="number"?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(c){const v=h==="y"?"height":"width",C=s.reference[h]-s.floating[v]+w.mainAxis,y=s.reference[h]+s.reference[v]-w.mainAxis;f<C?f=C:f>y&&(f=y)}if(l){var g,p;const v=h==="y"?"width":"height",C=["top","left"].includes(xt(o)),y=s.reference[d]-s.floating[v]+(C&&((g=i.offset)==null?void 0:g[d])||0)+(C?0:w.crossAxis),M=s.reference[d]+s.reference[v]+(C?0:((p=i.offset)==null?void 0:p[d])||0)-(C?w.crossAxis:0);S<y?S=y:S>M&&(S=M)}return{[h]:f,[d]:S}}}},jx=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:c=()=>{},...l}=bt(e,t),u=await br(t,l),d=xt(o),h=$n(o),f=$t(o)==="y",{width:S,height:m}=s.floating;let w,g;d==="top"||d==="bottom"?(w=d,g=h===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?"start":"end")?"left":"right"):(g=d,w=h==="end"?"top":"bottom");const p=m-u.top-u.bottom,v=S-u.left-u.right,C=Ft(m-u[w],p),y=Ft(S-u[g],v),M=!t.middlewareData.shift;let b=C,T=y;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(T=v),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(b=p),M&&!h){const _=ze(u.left,0),O=ze(u.right,0),z=ze(u.top,0),G=ze(u.bottom,0);f?T=S-2*(_!==0||O!==0?_+O:ze(u.left,u.right)):b=m-2*(z!==0||G!==0?z+G:ze(u.top,u.bottom))}await c({...t,availableWidth:T,availableHeight:b});const R=await i.getDimensions(a.floating);return S!==R.width||m!==R.height?{reset:{rects:!0}}:{}}}};function Zo(){return typeof window<"u"}function Bn(e){return Df(e)?(e.nodeName||"").toLowerCase():"#document"}function We(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ht(e){var t;return(t=(Df(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Df(e){return Zo()?e instanceof Node||e instanceof We(e).Node:!1}function nt(e){return Zo()?e instanceof Element||e instanceof We(e).Element:!1}function ft(e){return Zo()?e instanceof HTMLElement||e instanceof We(e).HTMLElement:!1}function cl(e){return!Zo()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof We(e).ShadowRoot}function Lr(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=rt(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function Lx(e){return["table","td","th"].includes(Bn(e))}function Jo(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function ga(e){const t=va(),n=nt(e)?rt(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 Vx(e){let t=Bt(e);for(;ft(t)&&!On(t);){if(ga(t))return t;if(Jo(t))return null;t=Bt(t)}return null}function va(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function On(e){return["html","body","#document"].includes(Bn(e))}function rt(e){return We(e).getComputedStyle(e)}function Qo(e){return nt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Bt(e){if(Bn(e)==="html")return e;const t=e.assignedSlot||e.parentNode||cl(e)&&e.host||ht(e);return cl(t)?t.host:t}function Ef(e){const t=Bt(e);return On(t)?e.ownerDocument?e.ownerDocument.body:e.body:ft(t)&&Lr(t)?t:Ef(t)}function xr(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=Ef(e),s=o===((r=e.ownerDocument)==null?void 0:r.body),i=We(o);if(s){const a=wi(i);return t.concat(i,i.visualViewport||[],Lr(o)?o:[],a&&n?xr(a):[])}return t.concat(o,xr(o,[],n))}function wi(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Mf(e){const t=rt(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=ft(e),s=o?e.offsetWidth:n,i=o?e.offsetHeight:r,a=Ao(n)!==s||Ao(r)!==i;return a&&(n=s,r=i),{width:n,height:r,$:a}}function ya(e){return nt(e)?e:e.contextElement}function Pn(e){const t=ya(e);if(!ft(t))return lt(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:s}=Mf(t);let i=(s?Ao(n.width):n.width)/r,a=(s?Ao(n.height):n.height)/o;return(!i||!Number.isFinite(i))&&(i=1),(!a||!Number.isFinite(a))&&(a=1),{x:i,y:a}}const Fx=lt(0);function Rf(e){const t=We(e);return!va()||!t.visualViewport?Fx:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function $x(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==We(e)?!1:t}function cn(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),s=ya(e);let i=lt(1);t&&(r?nt(r)&&(i=Pn(r)):i=Pn(e));const a=$x(s,n,r)?Rf(s):lt(0);let c=(o.left+a.x)/i.x,l=(o.top+a.y)/i.y,u=o.width/i.x,d=o.height/i.y;if(s){const h=We(s),f=r&&nt(r)?We(r):r;let S=h,m=wi(S);for(;m&&r&&f!==S;){const w=Pn(m),g=m.getBoundingClientRect(),p=rt(m),v=g.left+(m.clientLeft+parseFloat(p.paddingLeft))*w.x,C=g.top+(m.clientTop+parseFloat(p.paddingTop))*w.y;c*=w.x,l*=w.y,u*=w.x,d*=w.y,c+=v,l+=C,S=We(m),m=wi(S)}}return ko({width:u,height:d,x:c,y:l})}function ba(e,t){const n=Qo(e).scrollLeft;return t?t.left+n:cn(ht(e)).left+n}function Pf(e,t,n){n===void 0&&(n=!1);const r=e.getBoundingClientRect(),o=r.left+t.scrollLeft-(n?0:ba(e,r)),s=r.top+t.scrollTop;return{x:o,y:s}}function Bx(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const s=o==="fixed",i=ht(r),a=t?Jo(t.floating):!1;if(r===i||a&&s)return n;let c={scrollLeft:0,scrollTop:0},l=lt(1);const u=lt(0),d=ft(r);if((d||!d&&!s)&&((Bn(r)!=="body"||Lr(i))&&(c=Qo(r)),ft(r))){const f=cn(r);l=Pn(r),u.x=f.x+r.clientLeft,u.y=f.y+r.clientTop}const h=i&&!d&&!s?Pf(i,c,!0):lt(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+h.x,y:n.y*l.y-c.scrollTop*l.y+u.y+h.y}}function zx(e){return Array.from(e.getClientRects())}function Wx(e){const t=ht(e),n=Qo(e),r=e.ownerDocument.body,o=ze(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=ze(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let i=-n.scrollLeft+ba(e);const a=-n.scrollTop;return rt(r).direction==="rtl"&&(i+=ze(t.clientWidth,r.clientWidth)-o),{width:o,height:s,x:i,y:a}}function Hx(e,t){const n=We(e),r=ht(e),o=n.visualViewport;let s=r.clientWidth,i=r.clientHeight,a=0,c=0;if(o){s=o.width,i=o.height;const l=va();(!l||l&&t==="fixed")&&(a=o.offsetLeft,c=o.offsetTop)}return{width:s,height:i,x:a,y:c}}function Ux(e,t){const n=cn(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,s=ft(e)?Pn(e):lt(1),i=e.clientWidth*s.x,a=e.clientHeight*s.y,c=o*s.x,l=r*s.y;return{width:i,height:a,x:c,y:l}}function ll(e,t,n){let r;if(t==="viewport")r=Hx(e,n);else if(t==="document")r=Wx(ht(e));else if(nt(t))r=Ux(t,n);else{const o=Rf(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return ko(r)}function Af(e,t){const n=Bt(e);return n===t||!nt(n)||On(n)?!1:rt(n).position==="fixed"||Af(n,t)}function Yx(e,t){const n=t.get(e);if(n)return n;let r=xr(e,[],!1).filter(a=>nt(a)&&Bn(a)!=="body"),o=null;const s=rt(e).position==="fixed";let i=s?Bt(e):e;for(;nt(i)&&!On(i);){const a=rt(i),c=ga(i);!c&&a.position==="fixed"&&(o=null),(s?!c&&!o:!c&&a.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||Lr(i)&&!c&&Af(e,i))?r=r.filter(u=>u!==i):o=a,i=Bt(i)}return t.set(e,r),r}function Kx(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[...n==="clippingAncestors"?Jo(t)?[]:Yx(t,this._c):[].concat(n),r],a=i[0],c=i.reduce((l,u)=>{const d=ll(t,u,o);return l.top=ze(d.top,l.top),l.right=Ft(d.right,l.right),l.bottom=Ft(d.bottom,l.bottom),l.left=ze(d.left,l.left),l},ll(t,a,o));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function Gx(e){const{width:t,height:n}=Mf(e);return{width:t,height:n}}function qx(e,t,n){const r=ft(t),o=ht(t),s=n==="fixed",i=cn(e,!0,s,t);let a={scrollLeft:0,scrollTop:0};const c=lt(0);if(r||!r&&!s)if((Bn(t)!=="body"||Lr(o))&&(a=Qo(t)),r){const h=cn(t,!0,s,t);c.x=h.x+t.clientLeft,c.y=h.y+t.clientTop}else o&&(c.x=ba(o));const l=o&&!r&&!s?Pf(o,a):lt(0),u=i.left+a.scrollLeft-c.x-l.x,d=i.top+a.scrollTop-c.y-l.y;return{x:u,y:d,width:i.width,height:i.height}}function ks(e){return rt(e).position==="static"}function ul(e,t){if(!ft(e)||rt(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return ht(e)===n&&(n=n.ownerDocument.body),n}function Of(e,t){const n=We(e);if(Jo(e))return n;if(!ft(e)){let o=Bt(e);for(;o&&!On(o);){if(nt(o)&&!ks(o))return o;o=Bt(o)}return n}let r=ul(e,t);for(;r&&Lx(r)&&ks(r);)r=ul(r,t);return r&&On(r)&&ks(r)&&!ga(r)?n:r||Vx(e)||n}const Xx=async function(e){const t=this.getOffsetParent||Of,n=this.getDimensions,r=await n(e.floating);return{reference:qx(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Zx(e){return rt(e).direction==="rtl"}const Jx={convertOffsetParentRelativeRectToViewportRelativeRect:Bx,getDocumentElement:ht,getClippingRect:Kx,getOffsetParent:Of,getElementRects:Xx,getClientRects:zx,getDimensions:Gx,getScale:Pn,isElement:nt,isRTL:Zx};function kf(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Qx(e,t){let n=null,r;const o=ht(e);function s(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function i(a,c){a===void 0&&(a=!1),c===void 0&&(c=1),s();const l=e.getBoundingClientRect(),{left:u,top:d,width:h,height:f}=l;if(a||t(),!h||!f)return;const S=Jr(d),m=Jr(o.clientWidth-(u+h)),w=Jr(o.clientHeight-(d+f)),g=Jr(u),v={rootMargin:-S+"px "+-m+"px "+-w+"px "+-g+"px",threshold:ze(0,Ft(1,c))||1};let C=!0;function y(M){const b=M[0].intersectionRatio;if(b!==c){if(!C)return i();b?i(!1,b):r=setTimeout(()=>{i(!1,1e-7)},1e3)}b===1&&!kf(l,e.getBoundingClientRect())&&i(),C=!1}try{n=new IntersectionObserver(y,{...v,root:o.ownerDocument})}catch{n=new IntersectionObserver(y,v)}n.observe(e)}return i(!0),s}function ew(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:c=!1}=r,l=ya(e),u=o||s?[...l?xr(l):[],...xr(t)]:[];u.forEach(g=>{o&&g.addEventListener("scroll",n,{passive:!0}),s&&g.addEventListener("resize",n)});const d=l&&a?Qx(l,n):null;let h=-1,f=null;i&&(f=new ResizeObserver(g=>{let[p]=g;p&&p.target===l&&f&&(f.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var v;(v=f)==null||v.observe(t)})),n()}),l&&!c&&f.observe(l),f.observe(t));let S,m=c?cn(e):null;c&&w();function w(){const g=cn(e);m&&!kf(m,g)&&n(),m=g,S=requestAnimationFrame(w)}return n(),()=>{var g;u.forEach(p=>{o&&p.removeEventListener("scroll",n),s&&p.removeEventListener("resize",n)}),d==null||d(),(g=f)==null||g.disconnect(),f=null,c&&cancelAnimationFrame(S)}}const tw=_x,nw=Nx,rw=Ax,ow=jx,sw=Ox,dl=Px,iw=Ix,aw=(e,t,n)=>{const r=new Map,o={platform:Jx,...n},s={...o.platform,_c:r};return Rx(e,t,{...o,platform:s})};var go=typeof document<"u"?E.useLayoutEffect:E.useEffect;function _o(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(!_o(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)&&!_o(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function _f(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function fl(e,t){const n=_f(e);return Math.round(t*n)/n}function _s(e){const t=D.useRef(e);return go(()=>{t.current=e}),t}function cw(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:c,open:l}=e,[u,d]=D.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,f]=D.useState(r);_o(h,r)||f(r);const[S,m]=D.useState(null),[w,g]=D.useState(null),p=D.useCallback(P=>{P!==M.current&&(M.current=P,m(P))},[]),v=D.useCallback(P=>{P!==b.current&&(b.current=P,g(P))},[]),C=s||S,y=i||w,M=D.useRef(null),b=D.useRef(null),T=D.useRef(u),R=c!=null,_=_s(c),O=_s(o),z=_s(l),G=D.useCallback(()=>{if(!M.current||!b.current)return;const P={placement:t,strategy:n,middleware:h};O.current&&(P.platform=O.current),aw(M.current,b.current,P).then(I=>{const A={...I,isPositioned:z.current!==!1};j.current&&!_o(T.current,A)&&(T.current=A,zo.flushSync(()=>{d(A)}))})},[h,t,n,O,z]);go(()=>{l===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,d(P=>({...P,isPositioned:!1})))},[l]);const j=D.useRef(!1);go(()=>(j.current=!0,()=>{j.current=!1}),[]),go(()=>{if(C&&(M.current=C),y&&(b.current=y),C&&y){if(_.current)return _.current(C,y,G);G()}},[C,y,G,_,R]);const F=D.useMemo(()=>({reference:M,floating:b,setReference:p,setFloating:v}),[p,v]),N=D.useMemo(()=>({reference:C,floating:y}),[C,y]),k=D.useMemo(()=>{const P={position:n,left:0,top:0};if(!N.floating)return P;const I=fl(N.floating,u.x),A=fl(N.floating,u.y);return a?{...P,transform:"translate("+I+"px, "+A+"px)",..._f(N.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:I,top:A}},[n,a,N.floating,u.x,u.y]);return D.useMemo(()=>({...u,update:G,refs:F,elements:N,floatingStyles:k}),[u,G,F,N,k])}const lw=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?dl({element:r.current,padding:o}).fn(n):{}:r?dl({element:r,padding:o}).fn(n):{}}}},uw=(e,t)=>({...tw(e),options:[e,t]}),dw=(e,t)=>({...nw(e),options:[e,t]}),fw=(e,t)=>({...iw(e),options:[e,t]}),hw=(e,t)=>({...rw(e),options:[e,t]}),pw=(e,t)=>({...ow(e),options:[e,t]}),mw=(e,t)=>({...sw(e),options:[e,t]}),gw=(e,t)=>({...lw(e),options:[e,t]});var vw="Arrow",Nf=D.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...s}=e;return x.jsx(ae.svg,{...s,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:x.jsx("polygon",{points:"0,0 30,0 15,10"})})});Nf.displayName=vw;var yw=Nf;function bw(e){const[t,n]=D.useState(void 0);return _e(()=>{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 c=s.borderBoxSize,l=Array.isArray(c)?c[0]:c;i=l.inlineSize,a=l.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 xa="Popper",[If,Ut]=Ht(xa),[xw,jf]=If(xa),Lf=e=>{const{__scopePopper:t,children:n}=e,[r,o]=D.useState(null);return x.jsx(xw,{scope:t,anchor:r,onAnchorChange:o,children:n})};Lf.displayName=xa;var Vf="PopperAnchor",Ff=D.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,s=jf(Vf,n),i=D.useRef(null),a=fe(t,i);return D.useEffect(()=>{s.onAnchorChange((r==null?void 0:r.current)||i.current)}),r?null:x.jsx(ae.div,{...o,ref:a})});Ff.displayName=Vf;var wa="PopperContent",[ww,Sw]=If(wa),$f=D.forwardRef((e,t)=>{var $,q,X,U,ne,B;const{__scopePopper:n,side:r="bottom",sideOffset:o=0,align:s="center",alignOffset:i=0,arrowPadding:a=0,avoidCollisions:c=!0,collisionBoundary:l=[],collisionPadding:u=0,sticky:d="partial",hideWhenDetached:h=!1,updatePositionStrategy:f="optimized",onPlaced:S,...m}=e,w=jf(wa,n),[g,p]=D.useState(null),v=fe(t,ie=>p(ie)),[C,y]=D.useState(null),M=bw(C),b=(M==null?void 0:M.width)??0,T=(M==null?void 0:M.height)??0,R=r+(s!=="center"?"-"+s:""),_=typeof u=="number"?u:{top:0,right:0,bottom:0,left:0,...u},O=Array.isArray(l)?l:[l],z=O.length>0,G={padding:_,boundary:O.filter(Tw),altBoundary:z},{refs:j,floatingStyles:F,placement:N,isPositioned:k,middlewareData:P}=cw({strategy:"fixed",placement:R,whileElementsMounted:(...ie)=>ew(...ie,{animationFrame:f==="always"}),elements:{reference:w.anchor},middleware:[uw({mainAxis:o+T,alignmentAxis:i}),c&&dw({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?fw():void 0,...G}),c&&hw({...G}),pw({...G,apply:({elements:ie,rects:pe,availableWidth:Oe,availableHeight:Ee})=>{const{width:ot,height:J}=pe.reference,ce=ie.floating.style;ce.setProperty("--radix-popper-available-width",`${Oe}px`),ce.setProperty("--radix-popper-available-height",`${Ee}px`),ce.setProperty("--radix-popper-anchor-width",`${ot}px`),ce.setProperty("--radix-popper-anchor-height",`${J}px`)}}),C&&gw({element:C,padding:a}),Dw({arrowWidth:b,arrowHeight:T}),h&&mw({strategy:"referenceHidden",...G})]}),[I,A]=Wf(N),V=Ze(S);_e(()=>{k&&(V==null||V())},[k,V]);const W=($=P.arrow)==null?void 0:$.x,H=(q=P.arrow)==null?void 0:q.y,L=((X=P.arrow)==null?void 0:X.centerOffset)!==0,[Y,K]=D.useState();return _e(()=>{g&&K(window.getComputedStyle(g).zIndex)},[g]),x.jsx("div",{ref:j.setFloating,"data-radix-popper-content-wrapper":"",style:{...F,transform:k?F.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Y,"--radix-popper-transform-origin":[(U=P.transformOrigin)==null?void 0:U.x,(ne=P.transformOrigin)==null?void 0:ne.y].join(" "),...((B=P.hide)==null?void 0:B.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:x.jsx(ww,{scope:n,placedSide:I,onArrowChange:y,arrowX:W,arrowY:H,shouldHideArrow:L,children:x.jsx(ae.div,{"data-side":I,"data-align":A,...m,ref:v,style:{...m.style,animation:k?void 0:"none"}})})})});$f.displayName=wa;var Bf="PopperArrow",Cw={top:"bottom",right:"left",bottom:"top",left:"right"},zf=D.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,s=Sw(Bf,r),i=Cw[s.placedSide];return x.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:x.jsx(yw,{...o,ref:n,style:{...o.style,display:"block"}})})});zf.displayName=Bf;function Tw(e){return e!==null}var Dw=e=>({name:"transformOrigin",options:e,fn(t){var w,g,p;const{placement:n,rects:r,middlewareData:o}=t,i=((w=o.arrow)==null?void 0:w.centerOffset)!==0,a=i?0:e.arrowWidth,c=i?0:e.arrowHeight,[l,u]=Wf(n),d={start:"0%",center:"50%",end:"100%"}[u],h=(((g=o.arrow)==null?void 0:g.x)??0)+a/2,f=(((p=o.arrow)==null?void 0:p.y)??0)+c/2;let S="",m="";return l==="bottom"?(S=i?d:`${h}px`,m=`${-c}px`):l==="top"?(S=i?d:`${h}px`,m=`${r.floating.height+c}px`):l==="right"?(S=`${-c}px`,m=i?d:`${f}px`):l==="left"&&(S=`${r.floating.width+c}px`,m=i?d:`${f}px`),{data:{x:S,y:m}}}});function Wf(e){const[t,n="center"]=e.split("-");return[t,n]}var es=Lf,Vr=Ff,ts=$f,ns=zf,Ew="Portal",Fr=D.forwardRef((e,t)=>{var a;const{container:n,...r}=e,[o,s]=D.useState(!1);_e(()=>s(!0),[]);const i=n||o&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return i?vt.createPortal(x.jsx(ae.div,{...r,ref:t}),i):null});Fr.displayName=Ew;function Mw(e,t){return D.useReducer((n,r)=>t[n][r]??n,e)}var Dt=e=>{const{present:t,children:n}=e,r=Rw(t),o=typeof n=="function"?n({present:r.isPresent}):D.Children.only(n),s=fe(r.ref,Pw(o));return typeof n=="function"||r.isPresent?D.cloneElement(o,{ref:s}):null};Dt.displayName="Presence";function Rw(e){const[t,n]=D.useState(),r=D.useRef({}),o=D.useRef(e),s=D.useRef("none"),i=e?"mounted":"unmounted",[a,c]=Mw(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return D.useEffect(()=>{const l=Qr(r.current);s.current=a==="mounted"?l:"none"},[a]),_e(()=>{const l=r.current,u=o.current;if(u!==e){const h=s.current,f=Qr(l);e?c("MOUNT"):f==="none"||(l==null?void 0:l.display)==="none"?c("UNMOUNT"):c(u&&h!==f?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,c]),_e(()=>{if(t){let l;const u=t.ownerDocument.defaultView??window,d=f=>{const m=Qr(r.current).includes(f.animationName);if(f.target===t&&m&&(c("ANIMATION_END"),!o.current)){const w=t.style.animationFillMode;t.style.animationFillMode="forwards",l=u.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=w)})}},h=f=>{f.target===t&&(s.current=Qr(r.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{u.clearTimeout(l),t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",d),t.removeEventListener("animationend",d)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:D.useCallback(l=>{l&&(r.current=getComputedStyle(l)),n(l)},[])}}function Qr(e){return(e==null?void 0:e.animationName)||"none"}function Pw(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 ln({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,o]=Aw({defaultProp:t,onChange:n}),s=e!==void 0,i=s?e:r,a=Ze(n),c=D.useCallback(l=>{if(s){const d=typeof l=="function"?l(e):l;d!==e&&a(d)}else o(l)},[s,e,o,a]);return[i,c]}function Aw({defaultProp:e,onChange:t}){const n=D.useState(e),[r]=n,o=D.useRef(r),s=Ze(t);return D.useEffect(()=>{o.current!==r&&(s(r),o.current=r)},[r,o,s]),n}var Ow="VisuallyHidden",Sa=D.forwardRef((e,t)=>x.jsx(ae.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}}));Sa.displayName=Ow;var kw=Sa,[rs,kA]=Ht("Tooltip",[Ut]),os=Ut(),Hf="TooltipProvider",_w=700,Si="tooltip.open",[Nw,Ca]=rs(Hf),Uf=e=>{const{__scopeTooltip:t,delayDuration:n=_w,skipDelayDuration:r=300,disableHoverableContent:o=!1,children:s}=e,i=D.useRef(!0),a=D.useRef(!1),c=D.useRef(0);return D.useEffect(()=>{const l=c.current;return()=>window.clearTimeout(l)},[]),x.jsx(Nw,{scope:t,isOpenDelayedRef:i,delayDuration:n,onOpen:D.useCallback(()=>{window.clearTimeout(c.current),i.current=!1},[]),onClose:D.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>i.current=!0,r)},[r]),isPointerInTransitRef:a,onPointerInTransitChange:D.useCallback(l=>{a.current=l},[]),disableHoverableContent:o,children:s})};Uf.displayName=Hf;var ss="Tooltip",[Iw,$r]=rs(ss),Yf=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:o=!1,onOpenChange:s,disableHoverableContent:i,delayDuration:a}=e,c=Ca(ss,e.__scopeTooltip),l=os(t),[u,d]=D.useState(null),h=Vt(),f=D.useRef(0),S=i??c.disableHoverableContent,m=a??c.delayDuration,w=D.useRef(!1),[g=!1,p]=ln({prop:r,defaultProp:o,onChange:b=>{b?(c.onOpen(),document.dispatchEvent(new CustomEvent(Si))):c.onClose(),s==null||s(b)}}),v=D.useMemo(()=>g?w.current?"delayed-open":"instant-open":"closed",[g]),C=D.useCallback(()=>{window.clearTimeout(f.current),f.current=0,w.current=!1,p(!0)},[p]),y=D.useCallback(()=>{window.clearTimeout(f.current),f.current=0,p(!1)},[p]),M=D.useCallback(()=>{window.clearTimeout(f.current),f.current=window.setTimeout(()=>{w.current=!0,p(!0),f.current=0},m)},[m,p]);return D.useEffect(()=>()=>{f.current&&(window.clearTimeout(f.current),f.current=0)},[]),x.jsx(es,{...l,children:x.jsx(Iw,{scope:t,contentId:h,open:g,stateAttribute:v,trigger:u,onTriggerChange:d,onTriggerEnter:D.useCallback(()=>{c.isOpenDelayedRef.current?M():C()},[c.isOpenDelayedRef,M,C]),onTriggerLeave:D.useCallback(()=>{S?y():(window.clearTimeout(f.current),f.current=0)},[y,S]),onOpen:C,onClose:y,disableHoverableContent:S,children:n})})};Yf.displayName=ss;var Ci="TooltipTrigger",Kf=D.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=$r(Ci,n),s=Ca(Ci,n),i=os(n),a=D.useRef(null),c=fe(t,a,o.onTriggerChange),l=D.useRef(!1),u=D.useRef(!1),d=D.useCallback(()=>l.current=!1,[]);return D.useEffect(()=>()=>document.removeEventListener("pointerup",d),[d]),x.jsx(Vr,{asChild:!0,...i,children:x.jsx(ae.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...r,ref:c,onPointerMove:te(e.onPointerMove,h=>{h.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(),l.current=!0,document.addEventListener("pointerup",d,{once:!0})}),onFocus:te(e.onFocus,()=>{l.current||o.onOpen()}),onBlur:te(e.onBlur,o.onClose),onClick:te(e.onClick,o.onClose)})})});Kf.displayName=Ci;var Ta="TooltipPortal",[jw,Lw]=rs(Ta,{forceMount:void 0}),Gf=e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:o}=e,s=$r(Ta,t);return x.jsx(jw,{scope:t,forceMount:n,children:x.jsx(Dt,{present:n||s.open,children:x.jsx(Fr,{asChild:!0,container:o,children:r})})})};Gf.displayName=Ta;var kn="TooltipContent",qf=D.forwardRef((e,t)=>{const n=Lw(kn,e.__scopeTooltip),{forceMount:r=n.forceMount,side:o="top",...s}=e,i=$r(kn,e.__scopeTooltip);return x.jsx(Dt,{present:r||i.open,children:i.disableHoverableContent?x.jsx(Xf,{side:o,...s,ref:t}):x.jsx(Vw,{side:o,...s,ref:t})})}),Vw=D.forwardRef((e,t)=>{const n=$r(kn,e.__scopeTooltip),r=Ca(kn,e.__scopeTooltip),o=D.useRef(null),s=fe(t,o),[i,a]=D.useState(null),{trigger:c,onClose:l}=n,u=o.current,{onPointerInTransitChange:d}=r,h=D.useCallback(()=>{a(null),d(!1)},[d]),f=D.useCallback((S,m)=>{const w=S.currentTarget,g={x:S.clientX,y:S.clientY},p=Ww(g,w.getBoundingClientRect()),v=Hw(g,p),C=Uw(m.getBoundingClientRect()),y=Kw([...v,...C]);a(y),d(!0)},[d]);return D.useEffect(()=>()=>h(),[h]),D.useEffect(()=>{if(c&&u){const S=w=>f(w,u),m=w=>f(w,c);return c.addEventListener("pointerleave",S),u.addEventListener("pointerleave",m),()=>{c.removeEventListener("pointerleave",S),u.removeEventListener("pointerleave",m)}}},[c,u,f,h]),D.useEffect(()=>{if(i){const S=m=>{const w=m.target,g={x:m.clientX,y:m.clientY},p=(c==null?void 0:c.contains(w))||(u==null?void 0:u.contains(w)),v=!Yw(g,i);p?h():v&&(h(),l())};return document.addEventListener("pointermove",S),()=>document.removeEventListener("pointermove",S)}},[c,u,i,l,h]),x.jsx(Xf,{...e,ref:s})}),[Fw,$w]=rs(ss,{isInside:!1}),Bw=rx("TooltipContent"),Xf=D.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":o,onEscapeKeyDown:s,onPointerDownOutside:i,...a}=e,c=$r(kn,n),l=os(n),{onClose:u}=c;return D.useEffect(()=>(document.addEventListener(Si,u),()=>document.removeEventListener(Si,u)),[u]),D.useEffect(()=>{if(c.trigger){const d=h=>{const f=h.target;f!=null&&f.contains(c.trigger)&&u()};return window.addEventListener("scroll",d,{capture:!0}),()=>window.removeEventListener("scroll",d,{capture:!0})}},[c.trigger,u]),x.jsx(jr,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:d=>d.preventDefault(),onDismiss:u,children:x.jsxs(ts,{"data-state":c.stateAttribute,...l,...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:[x.jsx(Bw,{children:r}),x.jsx(Fw,{scope:n,isInside:!0,children:x.jsx(kw,{id:c.contentId,role:"tooltip",children:o||r})})]})})});qf.displayName=kn;var Zf="TooltipArrow",zw=D.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=os(n);return $w(Zf,n).isInside?null:x.jsx(ns,{...o,...r,ref:t})});zw.displayName=Zf;function Ww(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 Hw(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 Uw(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 Yw(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,c=t[s].y,l=t[i].x,u=t[i].y;c>r!=u>r&&n<(l-a)*(r-c)/(u-c)+a&&(o=!o)}return o}function Kw(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),Gw(t)}function Gw(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 qw=Uf,Xw=Yf,Zw=Kf,Jw=Gf,Qw=qf;function Da({delayDuration:e=0,...t}){return x.jsx(qw,{"data-slot":"tooltip-provider",delayDuration:e,...t})}function Jf({...e}){return x.jsx(Da,{children:x.jsx(Xw,{"data-slot":"tooltip",...e})})}function Qf({...e}){return x.jsx(Zw,{"data-slot":"tooltip-trigger",...e})}function eh({className:e,sideOffset:t=0,children:n,...r}){return x.jsx(Jw,{children:x.jsx(Qw,{"data-slot":"tooltip-content",sideOffset:t,className:de("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 Ea=({children:e,content:t})=>x.jsx(Da,{children:x.jsxs(Jf,{children:[x.jsx(Qf,{asChild:!0,children:e}),x.jsx(eh,{sideOffset:3,side:"bottom",className:"border border-input bg-popover px-2 py-1 text-xs text-muted-foreground",children:t})]})}),hl=e=>Symbol.iterator in e,pl=e=>"entries"in e,ml=(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},eS=(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 tS(e,t){return Object.is(e,t)?!0:typeof e!="object"||e===null||typeof t!="object"||t===null?!1:!hl(e)||!hl(t)?ml({entries:()=>Object.entries(e)},{entries:()=>Object.entries(t)}):pl(e)&&pl(t)?ml(e,t):eS(e,t)}function is(e){const t=E.useRef(void 0);return n=>{const r=e(n);return tS(t.current,r)?t.current:t.current=r}}function Ma(e){const t=e+"CollectionProvider",[n,r]=Ht(t),[o,s]=n(t,{collectionRef:{current:null},itemMap:new Map}),i=m=>{const{scope:w,children:g}=m,p=E.useRef(null),v=E.useRef(new Map).current;return x.jsx(o,{scope:w,itemMap:v,collectionRef:p,children:g})};i.displayName=t;const a=e+"CollectionSlot",c=sn(a),l=E.forwardRef((m,w)=>{const{scope:g,children:p}=m,v=s(a,g),C=fe(w,v.collectionRef);return x.jsx(c,{ref:C,children:p})});l.displayName=a;const u=e+"CollectionItemSlot",d="data-radix-collection-item",h=sn(u),f=E.forwardRef((m,w)=>{const{scope:g,children:p,...v}=m,C=E.useRef(null),y=fe(w,C),M=s(u,g);return E.useEffect(()=>(M.itemMap.set(C,{ref:C,...v}),()=>void M.itemMap.delete(C))),x.jsx(h,{[d]:"",ref:y,children:p})});f.displayName=u;function S(m){const w=s(e+"CollectionConsumer",m);return E.useCallback(()=>{const p=w.collectionRef.current;if(!p)return[];const v=Array.from(p.querySelectorAll(`[${d}]`));return Array.from(w.itemMap.values()).sort((M,b)=>v.indexOf(M.ref.current)-v.indexOf(b.ref.current))},[w.collectionRef,w.itemMap])}return[{Provider:i,Slot:l,ItemSlot:f},S,r]}var nS=D.createContext(void 0);function Ra(e){const t=D.useContext(nS);return e||t||"ltr"}var Ns=0;function Pa(){D.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??gl()),document.body.insertAdjacentElement("beforeend",e[1]??gl()),Ns++,()=>{Ns===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Ns--}},[])}function gl(){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 Is="focusScope.autoFocusOnMount",js="focusScope.autoFocusOnUnmount",vl={bubbles:!1,cancelable:!0},rS="FocusScope",as=D.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:s,...i}=e,[a,c]=D.useState(null),l=Ze(o),u=Ze(s),d=D.useRef(null),h=fe(t,m=>c(m)),f=D.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;D.useEffect(()=>{if(r){let m=function(v){if(f.paused||!a)return;const C=v.target;a.contains(C)?d.current=C:_t(d.current,{select:!0})},w=function(v){if(f.paused||!a)return;const C=v.relatedTarget;C!==null&&(a.contains(C)||_t(d.current,{select:!0}))},g=function(v){if(document.activeElement===document.body)for(const y of v)y.removedNodes.length>0&&_t(a)};document.addEventListener("focusin",m),document.addEventListener("focusout",w);const p=new MutationObserver(g);return a&&p.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",m),document.removeEventListener("focusout",w),p.disconnect()}}},[r,a,f.paused]),D.useEffect(()=>{if(a){bl.add(f);const m=document.activeElement;if(!a.contains(m)){const g=new CustomEvent(Is,vl);a.addEventListener(Is,l),a.dispatchEvent(g),g.defaultPrevented||(oS(lS(th(a)),{select:!0}),document.activeElement===m&&_t(a))}return()=>{a.removeEventListener(Is,l),setTimeout(()=>{const g=new CustomEvent(js,vl);a.addEventListener(js,u),a.dispatchEvent(g),g.defaultPrevented||_t(m??document.body,{select:!0}),a.removeEventListener(js,u),bl.remove(f)},0)}}},[a,l,u,f]);const S=D.useCallback(m=>{if(!n&&!r||f.paused)return;const w=m.key==="Tab"&&!m.altKey&&!m.ctrlKey&&!m.metaKey,g=document.activeElement;if(w&&g){const p=m.currentTarget,[v,C]=sS(p);v&&C?!m.shiftKey&&g===C?(m.preventDefault(),n&&_t(v,{select:!0})):m.shiftKey&&g===v&&(m.preventDefault(),n&&_t(C,{select:!0})):g===p&&m.preventDefault()}},[n,r,f.paused]);return x.jsx(ae.div,{tabIndex:-1,...i,ref:h,onKeyDown:S})});as.displayName=rS;function oS(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(_t(r,{select:t}),document.activeElement!==n)return}function sS(e){const t=th(e),n=yl(t,e),r=yl(t.reverse(),e);return[n,r]}function th(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 yl(e,t){for(const n of e)if(!iS(n,{upTo:t}))return n}function iS(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 aS(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&&aS(e)&&t&&e.select()}}var bl=cS();function cS(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=xl(e,t),e.unshift(t)},remove(t){var n;e=xl(e,t),(n=e[0])==null||n.resume()}}}function xl(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function lS(e){return e.filter(t=>t.tagName!=="A")}var Ls="rovingFocusGroup.onEntryFocus",uS={bubbles:!1,cancelable:!0},cs="RovingFocusGroup",[Ti,nh,dS]=Ma(cs),[fS,rh]=Ht(cs,[dS]),[hS,pS]=fS(cs),oh=D.forwardRef((e,t)=>x.jsx(Ti.Provider,{scope:e.__scopeRovingFocusGroup,children:x.jsx(Ti.Slot,{scope:e.__scopeRovingFocusGroup,children:x.jsx(mS,{...e,ref:t})})}));oh.displayName=cs;var mS=D.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:s,currentTabStopId:i,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:c,onEntryFocus:l,preventScrollOnEntryFocus:u=!1,...d}=e,h=D.useRef(null),f=fe(t,h),S=Ra(s),[m=null,w]=ln({prop:i,defaultProp:a,onChange:c}),[g,p]=D.useState(!1),v=Ze(l),C=nh(n),y=D.useRef(!1),[M,b]=D.useState(0);return D.useEffect(()=>{const T=h.current;if(T)return T.addEventListener(Ls,v),()=>T.removeEventListener(Ls,v)},[v]),x.jsx(hS,{scope:n,orientation:r,dir:S,loop:o,currentTabStopId:m,onItemFocus:D.useCallback(T=>w(T),[w]),onItemShiftTab:D.useCallback(()=>p(!0),[]),onFocusableItemAdd:D.useCallback(()=>b(T=>T+1),[]),onFocusableItemRemove:D.useCallback(()=>b(T=>T-1),[]),children:x.jsx(ae.div,{tabIndex:g||M===0?-1:0,"data-orientation":r,...d,ref:f,style:{outline:"none",...e.style},onMouseDown:te(e.onMouseDown,()=>{y.current=!0}),onFocus:te(e.onFocus,T=>{const R=!y.current;if(T.target===T.currentTarget&&R&&!g){const _=new CustomEvent(Ls,uS);if(T.currentTarget.dispatchEvent(_),!_.defaultPrevented){const O=C().filter(N=>N.focusable),z=O.find(N=>N.active),G=O.find(N=>N.id===m),F=[z,G,...O].filter(Boolean).map(N=>N.ref.current);ah(F,u)}}y.current=!1}),onBlur:te(e.onBlur,()=>p(!1))})})}),sh="RovingFocusGroupItem",ih=D.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:s,...i}=e,a=Vt(),c=s||a,l=pS(sh,n),u=l.currentTabStopId===c,d=nh(n),{onFocusableItemAdd:h,onFocusableItemRemove:f}=l;return D.useEffect(()=>{if(r)return h(),()=>f()},[r,h,f]),x.jsx(Ti.ItemSlot,{scope:n,id:c,focusable:r,active:o,children:x.jsx(ae.span,{tabIndex:u?0:-1,"data-orientation":l.orientation,...i,ref:t,onMouseDown:te(e.onMouseDown,S=>{r?l.onItemFocus(c):S.preventDefault()}),onFocus:te(e.onFocus,()=>l.onItemFocus(c)),onKeyDown:te(e.onKeyDown,S=>{if(S.key==="Tab"&&S.shiftKey){l.onItemShiftTab();return}if(S.target!==S.currentTarget)return;const m=yS(S,l.orientation,l.dir);if(m!==void 0){if(S.metaKey||S.ctrlKey||S.altKey||S.shiftKey)return;S.preventDefault();let g=d().filter(p=>p.focusable).map(p=>p.ref.current);if(m==="last")g.reverse();else if(m==="prev"||m==="next"){m==="prev"&&g.reverse();const p=g.indexOf(S.currentTarget);g=l.loop?bS(g,p+1):g.slice(p+1)}setTimeout(()=>ah(g))}})})})});ih.displayName=sh;var gS={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function vS(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function yS(e,t,n){const r=vS(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return gS[r]}function ah(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function bS(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var xS=oh,wS=ih,SS=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},yn=new WeakMap,eo=new WeakMap,to={},Vs=0,ch=function(e){return e&&(e.host||ch(e.parentNode))},CS=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=ch(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})},TS=function(e,t,n,r){var o=CS(t,Array.isArray(e)?e:[e]);to[n]||(to[n]=new WeakMap);var s=to[n],i=[],a=new Set,c=new Set(o),l=function(d){!d||a.has(d)||(a.add(d),l(d.parentNode))};o.forEach(l);var u=function(d){!d||c.has(d)||Array.prototype.forEach.call(d.children,function(h){if(a.has(h))u(h);else try{var f=h.getAttribute(r),S=f!==null&&f!=="false",m=(yn.get(h)||0)+1,w=(s.get(h)||0)+1;yn.set(h,m),s.set(h,w),i.push(h),m===1&&S&&eo.set(h,!0),w===1&&h.setAttribute(n,"true"),S||h.setAttribute(r,"true")}catch(g){console.error("aria-hidden: cannot operate on ",h,g)}})};return u(t),a.clear(),Vs++,function(){i.forEach(function(d){var h=yn.get(d)-1,f=s.get(d)-1;yn.set(d,h),s.set(d,f),h||(eo.has(d)||d.removeAttribute(r),eo.delete(d)),f||d.removeAttribute(n)}),Vs--,Vs||(yn=new WeakMap,yn=new WeakMap,eo=new WeakMap,to={})}},Aa=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=SS(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live]"))),TS(r,o,n,"aria-hidden")):function(){return null}},ct=function(){return ct=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},ct.apply(this,arguments)};function lh(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 DS(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 vo="right-scroll-bar-position",yo="width-before-scroll-bar",ES="with-scroll-bars-hidden",MS="--removed-body-scroll-bar-size";function Fs(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function RS(e,t){var n=E.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 PS=typeof window<"u"?D.useLayoutEffect:D.useEffect,wl=new WeakMap;function AS(e,t){var n=RS(null,function(r){return e.forEach(function(o){return Fs(o,r)})});return PS(function(){var r=wl.get(n);if(r){var o=new Set(r),s=new Set(e),i=n.current;o.forEach(function(a){s.has(a)||Fs(a,null)}),s.forEach(function(a){o.has(a)||Fs(a,i)})}wl.set(n,e)},[e]),n}function OS(e){return e}function kS(e,t){t===void 0&&(t=OS);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 c=function(){var u=i;i=[],u.forEach(s)},l=function(){return Promise.resolve().then(c)};l(),n={push:function(u){i.push(u),l()},filter:function(u){return i=i.filter(u),n}}}};return o}function _S(e){e===void 0&&(e={});var t=kS(null);return t.options=ct({async:!0,ssr:!1},e),t}var uh=function(e){var t=e.sideCar,n=lh(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 D.createElement(r,ct({},n))};uh.isSideCarExport=!0;function NS(e,t){return e.useMedium(t),uh}var dh=_S(),$s=function(){},ls=D.forwardRef(function(e,t){var n=D.useRef(null),r=D.useState({onScrollCapture:$s,onWheelCapture:$s,onTouchMoveCapture:$s}),o=r[0],s=r[1],i=e.forwardProps,a=e.children,c=e.className,l=e.removeScrollBar,u=e.enabled,d=e.shards,h=e.sideCar,f=e.noIsolation,S=e.inert,m=e.allowPinchZoom,w=e.as,g=w===void 0?"div":w,p=e.gapMode,v=lh(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),C=h,y=AS([n,t]),M=ct(ct({},v),o);return D.createElement(D.Fragment,null,u&&D.createElement(C,{sideCar:dh,removeScrollBar:l,shards:d,noIsolation:f,inert:S,setCallbacks:s,allowPinchZoom:!!m,lockRef:n,gapMode:p}),i?D.cloneElement(D.Children.only(a),ct(ct({},M),{ref:y})):D.createElement(g,ct({},M,{className:c,ref:y}),a))});ls.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};ls.classNames={fullWidth:yo,zeroRight:vo};var IS=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function jS(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=IS();return t&&e.setAttribute("nonce",t),e}function LS(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function VS(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var FS=function(){var e=0,t=null;return{add:function(n){e==0&&(t=jS())&&(LS(t,n),VS(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},$S=function(){var e=FS();return function(t,n){D.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},fh=function(){var e=$S(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},BS={left:0,top:0,right:0,gap:0},Bs=function(e){return parseInt(e||"",10)||0},zS=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[Bs(n),Bs(r),Bs(o)]},WS=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return BS;var t=zS(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])}},HS=fh(),An="data-scroll-locked",US=function(e,t,n,r){var o=e.left,s=e.top,i=e.right,a=e.gap;return n===void 0&&(n="margin"),`
|
|
110
|
+
.`.concat(ES,` {
|
|
111
111
|
overflow: hidden `).concat(r,`;
|
|
112
112
|
padding-right: `).concat(a,"px ").concat(r,`;
|
|
113
113
|
}
|
|
@@ -124,47 +124,47 @@
|
|
|
124
124
|
`),n==="padding"&&"padding-right: ".concat(a,"px ").concat(r,";")].filter(Boolean).join(""),`
|
|
125
125
|
}
|
|
126
126
|
|
|
127
|
-
.`).concat(
|
|
127
|
+
.`).concat(vo,` {
|
|
128
128
|
right: `).concat(a,"px ").concat(r,`;
|
|
129
129
|
}
|
|
130
130
|
|
|
131
|
-
.`).concat(
|
|
131
|
+
.`).concat(yo,` {
|
|
132
132
|
margin-right: `).concat(a,"px ").concat(r,`;
|
|
133
133
|
}
|
|
134
134
|
|
|
135
|
-
.`).concat(
|
|
135
|
+
.`).concat(vo," .").concat(vo,` {
|
|
136
136
|
right: 0 `).concat(r,`;
|
|
137
137
|
}
|
|
138
138
|
|
|
139
|
-
.`).concat(
|
|
139
|
+
.`).concat(yo," .").concat(yo,` {
|
|
140
140
|
margin-right: 0 `).concat(r,`;
|
|
141
141
|
}
|
|
142
142
|
|
|
143
143
|
body[`).concat(An,`] {
|
|
144
|
-
`).concat(
|
|
144
|
+
`).concat(MS,": ").concat(a,`px;
|
|
145
145
|
}
|
|
146
|
-
`)},
|
|
146
|
+
`)},Sl=function(){var e=parseInt(document.body.getAttribute(An)||"0",10);return isFinite(e)?e:0},YS=function(){D.useEffect(function(){return document.body.setAttribute(An,(Sl()+1).toString()),function(){var e=Sl()-1;e<=0?document.body.removeAttribute(An):document.body.setAttribute(An,e.toString())}},[])},KS=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r;YS();var s=D.useMemo(function(){return WS(o)},[o]);return D.createElement(HS,{styles:US(s,!t,o,n?"":"!important")})},Di=!1;if(typeof window<"u")try{var no=Object.defineProperty({},"passive",{get:function(){return Di=!0,!0}});window.addEventListener("test",no,no),window.removeEventListener("test",no,no)}catch{Di=!1}var bn=Di?{passive:!1}:!1,GS=function(e){return e.tagName==="TEXTAREA"},hh=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!GS(e)&&n[t]==="visible")},qS=function(e){return hh(e,"overflowY")},XS=function(e){return hh(e,"overflowX")},Cl=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=ph(e,r);if(o){var s=mh(e,r),i=s[1],a=s[2];if(i>a)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},ZS=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},JS=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},ph=function(e,t){return e==="v"?qS(t):XS(t)},mh=function(e,t){return e==="v"?ZS(t):JS(t)},QS=function(e,t){return e==="h"&&t==="rtl"?-1:1},e0=function(e,t,n,r,o){var s=QS(e,window.getComputedStyle(t).direction),i=s*r,a=n.target,c=t.contains(a),l=!1,u=i>0,d=0,h=0;do{var f=mh(e,a),S=f[0],m=f[1],w=f[2],g=m-w-s*S;(S||g)&&ph(e,a)&&(d+=g,h+=S),a instanceof ShadowRoot?a=a.host:a=a.parentNode}while(!c&&a!==document.body||c&&(t.contains(a)||t===a));return(u&&Math.abs(d)<1||!u&&Math.abs(h)<1)&&(l=!0),l},ro=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Tl=function(e){return[e.deltaX,e.deltaY]},Dl=function(e){return e&&"current"in e?e.current:e},t0=function(e,t){return e[0]===t[0]&&e[1]===t[1]},n0=function(e){return`
|
|
147
147
|
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
148
148
|
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
149
|
-
`)},w0=0,xn=[];function S0(e){var t=D.useRef([]),n=D.useRef([0,0]),r=D.useRef(),o=D.useState(w0++)[0],s=D.useState(bh)[0],i=D.useRef(e);D.useEffect(function(){i.current=e},[e]),D.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var m=WS([e.lockRef.current],(e.shards||[]).map(Ol),!0).filter(Boolean);return m.forEach(function(w){return w.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),m.forEach(function(w){return w.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var a=D.useCallback(function(m,w){if("touches"in m&&m.touches.length===2||m.type==="wheel"&&m.ctrlKey)return!i.current.allowPinchZoom;var y=so(m),p=n.current,g="deltaX"in m?m.deltaX:p[0]-y[0],C="deltaY"in m?m.deltaY:p[1]-y[1],v,M=m.target,b=Math.abs(g)>Math.abs(C)?"h":"v";if("touches"in m&&b==="h"&&M.type==="range")return!1;var T=Pl(b,M);if(!T)return!0;if(T?v=b:(v=b==="v"?"h":"v",T=Pl(b,M)),!T)return!1;if(!r.current&&"changedTouches"in m&&(g||C)&&(r.current=v),!v)return!0;var R=r.current||v;return y0(R,w,m,R==="h"?g:C)},[]),c=D.useCallback(function(m){var w=m;if(!(!xn.length||xn[xn.length-1]!==s)){var y="deltaY"in w?Al(w):so(w),p=t.current.filter(function(v){return v.name===w.type&&(v.target===w.target||w.target===v.shadowParent)&&b0(v.delta,y)})[0];if(p&&p.should){w.cancelable&&w.preventDefault();return}if(!p){var g=(i.current.shards||[]).map(Ol).filter(Boolean).filter(function(v){return v.contains(w.target)}),C=g.length>0?a(w,g[0]):!i.current.noIsolation;C&&w.cancelable&&w.preventDefault()}}},[]),l=D.useCallback(function(m,w,y,p){var g={name:m,delta:w,target:y,should:p,shadowParent:C0(y)};t.current.push(g),setTimeout(function(){t.current=t.current.filter(function(C){return C!==g})},1)},[]),u=D.useCallback(function(m){n.current=so(m),r.current=void 0},[]),d=D.useCallback(function(m){l(m.type,Al(m),m.target,a(m,e.lockRef.current))},[]),f=D.useCallback(function(m){l(m.type,so(m),m.target,a(m,e.lockRef.current))},[]);D.useEffect(function(){return xn.push(s),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener("wheel",c,bn),document.addEventListener("touchmove",c,bn),document.addEventListener("touchstart",u,bn),function(){xn=xn.filter(function(m){return m!==s}),document.removeEventListener("wheel",c,bn),document.removeEventListener("touchmove",c,bn),document.removeEventListener("touchstart",u,bn)}},[]);var h=e.removeScrollBar,S=e.inert;return D.createElement(D.Fragment,null,S?D.createElement(s,{styles:x0(o)}):null,h?D.createElement(d0,{gapMode:e.gapMode}):null)}function C0(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const T0=JS(yh,S0);var ds=D.forwardRef(function(e,t){return D.createElement(us,ct({},e,{ref:t,sideCar:T0}))});ds.classNames=us.classNames;var Pi=["Enter"," "],D0=["ArrowDown","PageUp","Home"],Ch=["ArrowUp","PageDown","End"],E0=[...D0,...Ch],M0={ltr:[...Pi,"ArrowRight"],rtl:[...Pi,"ArrowLeft"]},R0={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Wr="Menu",[Sr,P0,A0]=Oa(Wr),[fn,Th]=Ht(Wr,[A0,Ut,uh]),fs=Ut(),Dh=uh(),[O0,hn]=fn(Wr),[k0,Hr]=fn(Wr),Eh=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:o,onOpenChange:s,modal:i=!0}=e,a=fs(t),[c,l]=D.useState(null),u=D.useRef(!1),d=Ze(s),f=ka(o);return D.useEffect(()=>{const h=()=>{u.current=!0,document.addEventListener("pointerdown",S,{capture:!0,once:!0}),document.addEventListener("pointermove",S,{capture:!0,once:!0})},S=()=>u.current=!1;return document.addEventListener("keydown",h,{capture:!0}),()=>{document.removeEventListener("keydown",h,{capture:!0}),document.removeEventListener("pointerdown",S,{capture:!0}),document.removeEventListener("pointermove",S,{capture:!0})}},[]),x.jsx(ns,{...a,children:x.jsx(O0,{scope:t,open:n,onOpenChange:d,content:c,onContentChange:l,children:x.jsx(k0,{scope:t,onClose:D.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:u,dir:f,modal:i,children:r})})})};Eh.displayName=Wr;var _0="MenuAnchor",Ia=D.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=fs(n);return x.jsx(Fr,{...o,...r,ref:t})});Ia.displayName=_0;var ja="MenuPortal",[N0,Mh]=fn(ja,{forceMount:void 0}),Rh=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:o}=e,s=hn(ja,t);return x.jsx(N0,{scope:t,forceMount:n,children:x.jsx(Dt,{present:n||s.open,children:x.jsx($r,{asChild:!0,container:o,children:r})})})};Rh.displayName=ja;var qe="MenuContent",[I0,La]=fn(qe),Ph=D.forwardRef((e,t)=>{const n=Mh(qe,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,s=hn(qe,e.__scopeMenu),i=Hr(qe,e.__scopeMenu);return x.jsx(Sr.Provider,{scope:e.__scopeMenu,children:x.jsx(Dt,{present:r||s.open,children:x.jsx(Sr.Slot,{scope:e.__scopeMenu,children:i.modal?x.jsx(j0,{...o,ref:t}):x.jsx(L0,{...o,ref:t})})})})}),j0=D.forwardRef((e,t)=>{const n=hn(qe,e.__scopeMenu),r=D.useRef(null),o=fe(t,r);return D.useEffect(()=>{const s=r.current;if(s)return Na(s)},[]),x.jsx(Va,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:te(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),L0=D.forwardRef((e,t)=>{const n=hn(qe,e.__scopeMenu);return x.jsx(Va,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),V0=an("MenuContent.ScrollLock"),Va=D.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:o,onOpenAutoFocus:s,onCloseAutoFocus:i,disableOutsidePointerEvents:a,onEntryFocus:c,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:h,disableOutsideScroll:S,...m}=e,w=hn(qe,n),y=Hr(qe,n),p=fs(n),g=Dh(n),C=P0(n),[v,M]=D.useState(null),b=D.useRef(null),T=fe(t,b,w.onContentChange),R=D.useRef(0),k=D.useRef(""),A=D.useRef(0),z=D.useRef(null),G=D.useRef("right"),j=D.useRef(0),F=S?ds:D.Fragment,_=S?{as:V0,allowPinchZoom:!0}:void 0,N=I=>{var $,q;const O=k.current+I,V=C().filter(X=>!X.disabled),W=document.activeElement,H=($=V.find(X=>X.ref.current===W))==null?void 0:$.textValue,L=V.map(X=>X.textValue),Y=X0(L,O,H),K=(q=V.find(X=>X.textValue===Y))==null?void 0:q.ref.current;(function X(U){k.current=U,window.clearTimeout(R.current),U!==""&&(R.current=window.setTimeout(()=>X(""),1e3))})(O),K&&setTimeout(()=>K.focus())};D.useEffect(()=>()=>window.clearTimeout(R.current),[]),_a();const P=D.useCallback(I=>{var V,W;return G.current===((V=z.current)==null?void 0:V.side)&&J0(I,(W=z.current)==null?void 0:W.area)},[]);return x.jsx(I0,{scope:n,searchRef:k,onItemEnter:D.useCallback(I=>{P(I)&&I.preventDefault()},[P]),onItemLeave:D.useCallback(I=>{var O;P(I)||((O=b.current)==null||O.focus(),M(null))},[P]),onTriggerLeave:D.useCallback(I=>{P(I)&&I.preventDefault()},[P]),pointerGraceTimerRef:A,onPointerGraceIntentChange:D.useCallback(I=>{z.current=I},[]),children:x.jsx(F,{..._,children:x.jsx(cs,{asChild:!0,trapped:o,onMountAutoFocus:te(s,I=>{var O;I.preventDefault(),(O=b.current)==null||O.focus({preventScroll:!0})}),onUnmountAutoFocus:i,children:x.jsx(Lr,{asChild:!0,disableOutsidePointerEvents:a,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:h,children:x.jsx(VS,{asChild:!0,...g,dir:y.dir,orientation:"vertical",loop:r,currentTabStopId:v,onCurrentTabStopIdChange:M,onEntryFocus:te(c,I=>{y.isUsingKeyboardRef.current||I.preventDefault()}),preventScrollOnEntryFocus:!0,children:x.jsx(rs,{role:"menu","aria-orientation":"vertical","data-state":Uh(w.open),"data-radix-menu-content":"",dir:y.dir,...p,...m,ref:T,style:{outline:"none",...m.style},onKeyDown:te(m.onKeyDown,I=>{const V=I.target.closest("[data-radix-menu-content]")===I.currentTarget,W=I.ctrlKey||I.altKey||I.metaKey,H=I.key.length===1;V&&(I.key==="Tab"&&I.preventDefault(),!W&&H&&N(I.key));const L=b.current;if(I.target!==L||!E0.includes(I.key))return;I.preventDefault();const K=C().filter($=>!$.disabled).map($=>$.ref.current);Ch.includes(I.key)&&K.reverse(),G0(K)}),onBlur:te(e.onBlur,I=>{I.currentTarget.contains(I.target)||(window.clearTimeout(R.current),k.current="")}),onPointerMove:te(e.onPointerMove,Cr(I=>{const O=I.target,V=j.current!==I.clientX;if(I.currentTarget.contains(O)&&V){const W=I.clientX>j.current?"right":"left";G.current=W,j.current=I.clientX}}))})})})})})})});Ph.displayName=qe;var F0="MenuGroup",Fa=D.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return x.jsx(ae.div,{role:"group",...r,ref:t})});Fa.displayName=F0;var $0="MenuLabel",Ah=D.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return x.jsx(ae.div,{...r,ref:t})});Ah.displayName=$0;var jo="MenuItem",kl="menu.itemSelect",hs=D.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...o}=e,s=D.useRef(null),i=Hr(jo,e.__scopeMenu),a=La(jo,e.__scopeMenu),c=fe(t,s),l=D.useRef(!1),u=()=>{const d=s.current;if(!n&&d){const f=new CustomEvent(kl,{bubbles:!0,cancelable:!0});d.addEventListener(kl,h=>r==null?void 0:r(h),{once:!0}),Df(d,f),f.defaultPrevented?l.current=!1:i.onClose()}};return x.jsx(Oh,{...o,ref:c,disabled:n,onClick:te(e.onClick,u),onPointerDown:d=>{var f;(f=e.onPointerDown)==null||f.call(e,d),l.current=!0},onPointerUp:te(e.onPointerUp,d=>{var f;l.current||(f=d.currentTarget)==null||f.click()}),onKeyDown:te(e.onKeyDown,d=>{const f=a.searchRef.current!=="";n||f&&d.key===" "||Pi.includes(d.key)&&(d.currentTarget.click(),d.preventDefault())})})});hs.displayName=jo;var Oh=D.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:o,...s}=e,i=La(jo,n),a=Dh(n),c=D.useRef(null),l=fe(t,c),[u,d]=D.useState(!1),[f,h]=D.useState("");return D.useEffect(()=>{const S=c.current;S&&h((S.textContent??"").trim())},[s.children]),x.jsx(Sr.ItemSlot,{scope:n,disabled:r,textValue:o??f,children:x.jsx(FS,{asChild:!0,...a,focusable:!r,children:x.jsx(ae.div,{role:"menuitem","data-highlighted":u?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...s,ref:l,onPointerMove:te(e.onPointerMove,Cr(S=>{r?i.onItemLeave(S):(i.onItemEnter(S),S.defaultPrevented||S.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:te(e.onPointerLeave,Cr(S=>i.onItemLeave(S))),onFocus:te(e.onFocus,()=>d(!0)),onBlur:te(e.onBlur,()=>d(!1))})})})}),B0="MenuCheckboxItem",kh=D.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...o}=e;return x.jsx(Lh,{scope:e.__scopeMenu,checked:n,children:x.jsx(hs,{role:"menuitemcheckbox","aria-checked":Lo(n)?"mixed":n,...o,ref:t,"data-state":Ba(n),onSelect:te(o.onSelect,()=>r==null?void 0:r(Lo(n)?!0:!n),{checkForDefaultPrevented:!1})})})});kh.displayName=B0;var _h="MenuRadioGroup",[z0,W0]=fn(_h,{value:void 0,onValueChange:()=>{}}),Nh=D.forwardRef((e,t)=>{const{value:n,onValueChange:r,...o}=e,s=Ze(r);return x.jsx(z0,{scope:e.__scopeMenu,value:n,onValueChange:s,children:x.jsx(Fa,{...o,ref:t})})});Nh.displayName=_h;var Ih="MenuRadioItem",jh=D.forwardRef((e,t)=>{const{value:n,...r}=e,o=W0(Ih,e.__scopeMenu),s=n===o.value;return x.jsx(Lh,{scope:e.__scopeMenu,checked:s,children:x.jsx(hs,{role:"menuitemradio","aria-checked":s,...r,ref:t,"data-state":Ba(s),onSelect:te(r.onSelect,()=>{var i;return(i=o.onValueChange)==null?void 0:i.call(o,n)},{checkForDefaultPrevented:!1})})})});jh.displayName=Ih;var $a="MenuItemIndicator",[Lh,H0]=fn($a,{checked:!1}),Vh=D.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...o}=e,s=H0($a,n);return x.jsx(Dt,{present:r||Lo(s.checked)||s.checked===!0,children:x.jsx(ae.span,{...o,ref:t,"data-state":Ba(s.checked)})})});Vh.displayName=$a;var U0="MenuSeparator",Fh=D.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return x.jsx(ae.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});Fh.displayName=U0;var Y0="MenuArrow",$h=D.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=fs(n);return x.jsx(os,{...o,...r,ref:t})});$h.displayName=Y0;var K0="MenuSub",[uO,Bh]=fn(K0),ar="MenuSubTrigger",zh=D.forwardRef((e,t)=>{const n=hn(ar,e.__scopeMenu),r=Hr(ar,e.__scopeMenu),o=Bh(ar,e.__scopeMenu),s=La(ar,e.__scopeMenu),i=D.useRef(null),{pointerGraceTimerRef:a,onPointerGraceIntentChange:c}=s,l={__scopeMenu:e.__scopeMenu},u=D.useCallback(()=>{i.current&&window.clearTimeout(i.current),i.current=null},[]);return D.useEffect(()=>u,[u]),D.useEffect(()=>{const d=a.current;return()=>{window.clearTimeout(d),c(null)}},[a,c]),x.jsx(Ia,{asChild:!0,...l,children:x.jsx(Oh,{id:o.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":o.contentId,"data-state":Uh(n.open),...e,ref:Jo(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,Cr(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,Cr(d=>{var h,S;u();const f=(h=n.content)==null?void 0:h.getBoundingClientRect();if(f){const m=(S=n.content)==null?void 0:S.dataset.side,w=m==="right",y=w?-5:5,p=f[w?"left":"right"],g=f[w?"right":"left"];s.onPointerGraceIntentChange({area:[{x:d.clientX+y,y:d.clientY},{x:p,y:f.top},{x:g,y:f.top},{x:g,y:f.bottom},{x:p,y:f.bottom}],side:m}),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===" "||M0[r.dir].includes(d.key)&&(n.onOpenChange(!0),(h=n.content)==null||h.focus(),d.preventDefault())})})})});zh.displayName=ar;var Wh="MenuSubContent",Hh=D.forwardRef((e,t)=>{const n=Mh(qe,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,s=hn(qe,e.__scopeMenu),i=Hr(qe,e.__scopeMenu),a=Bh(Wh,e.__scopeMenu),c=D.useRef(null),l=fe(t,c);return x.jsx(Sr.Provider,{scope:e.__scopeMenu,children:x.jsx(Dt,{present:r||s.open,children:x.jsx(Sr.Slot,{scope:e.__scopeMenu,children:x.jsx(Va,{id:a.contentId,"aria-labelledby":a.triggerId,...o,ref:l,align:"start",side:i.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:u=>{var d;i.isUsingKeyboardRef.current&&((d=c.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=R0[i.dir].includes(u.key);d&&f&&(s.onOpenChange(!1),(h=a.trigger)==null||h.focus(),u.preventDefault())})})})})})});Hh.displayName=Wh;function Uh(e){return e?"open":"closed"}function Lo(e){return e==="indeterminate"}function Ba(e){return Lo(e)?"indeterminate":e?"checked":"unchecked"}function G0(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function q0(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function X0(e,t,n){const o=t.length>1&&Array.from(t).every(l=>l===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let i=q0(e,Math.max(s,0));o.length===1&&(i=i.filter(l=>l!==n));const c=i.find(l=>l.toLowerCase().startsWith(o.toLowerCase()));return c!==n?c:void 0}function Z0(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,c=t[s].y,l=t[i].x,u=t[i].y;c>r!=u>r&&n<(l-a)*(r-c)/(u-c)+a&&(o=!o)}return o}function J0(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return Z0(n,t)}function Cr(e){return t=>t.pointerType==="mouse"?e(t):void 0}var Q0=Eh,eC=Ia,tC=Rh,nC=Ph,rC=Fa,oC=Ah,sC=hs,iC=kh,aC=Nh,cC=jh,lC=Vh,uC=Fh,dC=$h,fC=zh,hC=Hh,za="DropdownMenu",[pC,dO]=Ht(za,[Th]),Ie=Th(),[mC,Yh]=pC(za),Kh=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:o,defaultOpen:s,onOpenChange:i,modal:a=!0}=e,c=Ie(t),l=D.useRef(null),[u=!1,d]=un({prop:o,defaultProp:s,onChange:i});return x.jsx(mC,{scope:t,triggerId:Vt(),triggerRef:l,contentId:Vt(),open:u,onOpenChange:d,onOpenToggle:D.useCallback(()=>d(f=>!f),[d]),modal:a,children:x.jsx(Q0,{...c,open:u,onOpenChange:d,dir:r,modal:a,children:n})})};Kh.displayName=za;var Gh="DropdownMenuTrigger",qh=D.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...o}=e,s=Yh(Gh,n),i=Ie(n);return x.jsx(eC,{asChild:!0,...i,children:x.jsx(ae.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:Jo(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())})})})});qh.displayName=Gh;var gC="DropdownMenuPortal",Xh=e=>{const{__scopeDropdownMenu:t,...n}=e,r=Ie(t);return x.jsx(tC,{...r,...n})};Xh.displayName=gC;var Zh="DropdownMenuContent",Jh=D.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Yh(Zh,n),s=Ie(n),i=D.useRef(!1);return x.jsx(nC,{id:o.contentId,"aria-labelledby":o.triggerId,...s,...r,ref:t,onCloseAutoFocus:te(e.onCloseAutoFocus,a=>{var c;i.current||(c=o.triggerRef.current)==null||c.focus(),i.current=!1,a.preventDefault()}),onInteractOutside:te(e.onInteractOutside,a=>{const c=a.detail.originalEvent,l=c.button===0&&c.ctrlKey===!0,u=c.button===2||l;(!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)"}})});Jh.displayName=Zh;var vC="DropdownMenuGroup",yC=D.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ie(n);return x.jsx(rC,{...o,...r,ref:t})});yC.displayName=vC;var bC="DropdownMenuLabel",Qh=D.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ie(n);return x.jsx(oC,{...o,...r,ref:t})});Qh.displayName=bC;var xC="DropdownMenuItem",ep=D.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ie(n);return x.jsx(sC,{...o,...r,ref:t})});ep.displayName=xC;var wC="DropdownMenuCheckboxItem",tp=D.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ie(n);return x.jsx(iC,{...o,...r,ref:t})});tp.displayName=wC;var SC="DropdownMenuRadioGroup",CC=D.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ie(n);return x.jsx(aC,{...o,...r,ref:t})});CC.displayName=SC;var TC="DropdownMenuRadioItem",DC=D.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ie(n);return x.jsx(cC,{...o,...r,ref:t})});DC.displayName=TC;var EC="DropdownMenuItemIndicator",np=D.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ie(n);return x.jsx(lC,{...o,...r,ref:t})});np.displayName=EC;var MC="DropdownMenuSeparator",rp=D.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ie(n);return x.jsx(uC,{...o,...r,ref:t})});rp.displayName=MC;var RC="DropdownMenuArrow",PC=D.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ie(n);return x.jsx(dC,{...o,...r,ref:t})});PC.displayName=RC;var AC="DropdownMenuSubTrigger",OC=D.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ie(n);return x.jsx(fC,{...o,...r,ref:t})});OC.displayName=AC;var kC="DropdownMenuSubContent",_C=D.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ie(n);return x.jsx(hC,{...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)"}})});_C.displayName=kC;var NC=Kh,IC=qh,jC=Xh,LC=Jh,VC=Qh,FC=ep,$C=tp,BC=np,zC=rp;function Wa({...e}){return x.jsx(NC,{"data-slot":"dropdown-menu",...e})}function Ha({...e}){return x.jsx(IC,{"data-slot":"dropdown-menu-trigger",...e})}function Ua({className:e,sideOffset:t=4,...n}){return x.jsx(jC,{children:x.jsx(LC,{"data-slot":"dropdown-menu-content",sideOffset:t,style:{zIndex:100},className:ce("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 _l({className:e,inset:t,variant:n="default",...r}){return x.jsx(FC,{"data-slot":"dropdown-menu-item","data-inset":t,"data-variant":n,className:ce("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 WC({className:e,children:t,checked:n,...r}){return x.jsxs($C,{"data-slot":"dropdown-menu-checkbox-item",className:ce("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:[x.jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:x.jsx(BC,{children:x.jsx(uf,{className:"size-4"})})}),t]})}function HC({className:e,inset:t,...n}){return x.jsx(VC,{"data-slot":"dropdown-menu-label","data-inset":t,className:ce("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",e),...n})}function UC({className:e,...t}){return x.jsx(zC,{"data-slot":"dropdown-menu-separator",className:ce("bg-border -mx-1 my-1 h-px",e),...t})}var YC="Label",op=D.forwardRef((e,t)=>x.jsx(ae.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())}}));op.displayName=YC;var KC=op;function GC({className:e,...t}){return x.jsx(KC,{"data-slot":"label",className:ce("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 qC={isDragging:!1},zn=Yo(e=>({...qC,updateIsDragging:t=>e(n=>({...n,isDragging:t}))})),XC=({onClose:e,side:t,onOpenChange:n,buttonTrigger:r,modal:o=!1,children:s})=>{const[i,a]=E.useState({x:0,y:0}),c=zn(zr(m=>m.updateIsDragging)),{attributes:l,listeners:u,setNodeRef:d,transform:f,setActivatorNodeRef:h}=ha({id:"booking_info",data:{type:"another"}}),S={transform:`translate3d(${i.x+((f==null?void 0:f.x)||0)}px, ${i.y+((f==null?void 0:f.y)||0)}px, 0)`};return Nr({onDragStart(){c(!0)},onDragEnd(m){if(m.active.id){const{y:w,x:y}=i;a({x:y+((f==null?void 0:f.x)||0),y:w+((f==null?void 0:f.y)||0)}),c(!1)}}}),x.jsxs(Wa,{dir:"ltr",modal:o,open:!0,onOpenChange:n,children:[x.jsx(Ha,{asChild:!0,children:r||x.jsx("div",{})}),x.jsxs(Ua,{ref:d,style:{...S,zIndex:50,width:"25rem"},forceMount:!0,avoidCollisions:!0,side:t,sticky:"always",updatePositionStrategy:"always",...l,children:[x.jsxs("div",{className:"dropdownLabelContent",children:[x.jsx(GC,{ref:h,className:"dropdownLabelContent_dropdownLabel",...u,children:"Appointment"}),x.jsx(Sb,{className:"dropdownLabelContent_close",onClick:e})]}),s]})]})},sp=({modal:e=!1,side:t,onClose:n,onOpenChange:r,buttonTrigger:o,ref:s})=>{const[i,a]=E.useState(!1),{createBookingModal:c}=Lt(),l=()=>{a(!1),n==null||n()},u=d=>{a(d),r==null||r(d)};return E.useImperativeHandle(s,()=>({showCreationModal:()=>a(!0),closeModal:()=>a(!1),isModalOpen:()=>i})),x.jsx(x.Fragment,{children:i&&x.jsx(fa,{children:x.jsx(XC,{onClose:l,onOpenChange:u,modal:e,side:t,buttonTrigger:o,children:c})})})},ZC=({daysOfWeek:e,bookingViewType:t})=>{const[n,r]=vS(),o=E.useMemo(()=>r("create_new_booking"),[n]),{setTodayDay:s,setBookingViewType:i}=Le(),{updateMonthMessage:a,updateHeaderDateLabel:c}=Ld(g=>g),{onViewTypeChange:l}=Id(),{onHeaderDayClick:u}=Lt(),{resetSelectedNode:d,resetNodes:f}=Tt(g=>g),h=E.useRef(null),S=()=>h.current,m=()=>{var g;(g=S())==null||g.showCreationModal()},w=E.useCallback(g=>{const C=()=>{i(oe.WEEK),l(oe.WEEK)},v=()=>t===oe.DAY;if(u==null||u(g,t),v())return C();const M=s(g);if(!M)return;const b={month:M.getMonth(),fullYear:M.getFullYear(),monthMessage:Mn[M.getMonth()]};a(b),i(oe.DAY)},[t,s,a,i]),y=t===oe.TABLE?{justifySelf:"start"}:{},p=E.useMemo(()=>{const g=C=>new Date(C).toDateString()===new Date().toDateString();return e.map(C=>{const v=ui[new Date(C).getDay()];return x.jsx("th",{className:ce("daysOfWeek",t!==oe.DAY&&"daysOfWeek_day"),children:x.jsxs("div",{style:{...y,maxWidth:t===oe.DAY?"11rem":void 0},className:"daysOfWeek_parent",children:[x.jsx("span",{className:ce(g(C)&&"daysOfWeek_day_today_title"),children:v}),x.jsx("div",{style:{width:"100%"},children:x.jsx("button",{type:"button",className:ce("daysOfWeek_day",g(C)?"daysOfWeek_day_today":"daysOfWeek_day_rest"),onClick:()=>w(C),children:Z.formatDate(C.toDateString())})})]})},v)})},[e,w,t]);return E.useEffect(()=>{switch(t){case oe.DAY:{f(),d(),c(e[0]);break}case oe.WEEK:{const g=Z.generateWeekMonthLabel(e);a({monthMessage:g})}}},[e]),x.jsxs(x.Fragment,{children:[x.jsx("table",{className:"daysOfWeek_emptySlot_table",children:x.jsx("tbody",{children:x.jsxs("tr",{children:[x.jsx("th",{style:y,className:"calendarHeader",children:x.jsx("div",{className:"daysOfWeek_emptySlot",children:x.jsx(Pa,{content:o,children:x.jsx(cn,{variant:"ghost",onClick:m,children:x.jsx(cb,{})})})})},"emptyBlocks"),p]})})}),x.jsx(sp,{modal:!0,ref:h})]})},JC=({handleWeekChange:e})=>x.jsxs("div",{className:"header_day_actions",children:[x.jsx(cn,{className:"header_day_actions_button",variant:"ghost",size:"lg",onClick:()=>e("previous"),children:x.jsx(nb,{className:"header_day_actions_button_icon"})}),x.jsx(cn,{className:"header_day_actions_button",variant:"ghost",size:"lg",onClick:()=>e("next"),children:x.jsx(ob,{className:"header_day_actions_button_icon"})})]}),QC=({onClick:e})=>x.jsx(Pa,{content:"Today",children:x.jsx(cn,{variant:"ghost",onClick:e,children:x.jsx(yb,{style:{paddingTop:"0.8px"}})})}),eT={capitalize(e){return`${this.returnFirstChar(e)}${e.slice(1,e.length)}`},returnFirstChar(e){return e.charAt(0).toUpperCase()}},tT=({code:e})=>x.jsx("p",{className:"text-sm text-muted-foreground",children:x.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:[x.jsx("span",{className:"text-xs",children:"⌘"}),e]})}),nT={[oe.DAY]:x.jsx(fb,{width:"90%"}),[oe.WEEK]:x.jsx(ub,{width:"90%"}),[oe.TABLE]:x.jsx(Jy,{width:"90%"}),[oe.MONTH]:x.jsx(pb,{width:"90%"})},Nl=()=>{const{bookingViewType:e}=Le(),{onViewTypeChange:t}=Id(),{viewModes:n}=Lt(),r=E.useCallback(a=>a===e?"custom":"outline",[e]),o=E.useCallback(a=>{a!==e&&t(a)},[t]),s=E.useMemo(()=>n.map(a=>({variant:r(a),icon:nT[a],events:c=>o(c),label:a})),[n,o,r]),i=E.useMemo(()=>{const a=s.find(c=>c.label===e);if(a)return a.icon},[e,s]);return x.jsxs(Wa,{children:[x.jsx(Ha,{children:x.jsx(Pa,{content:"Calendar Modes",children:x.jsx(cn,{variant:"ghost",asChild:!0,children:i||x.jsx(Xy,{className:"w-full h-full"})})})}),x.jsx(Ua,{children:s.map(a=>x.jsxs(WC,{checked:a.label===e,onCheckedChange:()=>a.events(a.label),className:"flex flex-row justify-between gap-6",children:[x.jsxs("div",{className:"flex flex-row gap-4",children:[a.icon,x.jsx("div",{children:eT.capitalize(a.label)})]}),x.jsx(tT,{code:"o"})]},a.label))})]})},rT=566,oT=()=>{const{todayWeek:e,bookingViewType:t,setTodayDay:n,nextWeek:r,previousWeek:o,setDays:s}=Le(),{resetSelectedNode:i,resetNodes:a}=Tt(v=>v),{onTodayClick:c,onDayChange:l}=Lt(),{fullYear:u,monthMessage:d}=Ld(v=>v),[f,h]=E.useState(!1),S=()=>{const v=new Date;switch(c(v),t){case oe.TABLE:case oe.DAY:{n(v);break}default:{e();break}}},m=()=>s(1),w=()=>s(-1),y=v=>v==="next"?r():o(),p=v=>v==="next"?m():w(),g=v=>{switch(a(),i(),t){case oe.TABLE:case oe.DAY:{const M=p(v);l(M,v);break}case oe.WEEK:{const M=y(v),{firstDayOfWeek:b,lastDayOfWeek:T}=Z.firstAndLastWeekDays(M);l([b,T],v);break}}};E.useEffect(()=>{e()},[e]),E.useEffect(()=>{const v=()=>{if(typeof window>"u")return!1;window.innerWidth<=rT?h(!0):h(!1)};return v(),window.addEventListener("resize",v),()=>window.removeEventListener("resize",v)},[]);const C=x.jsxs("div",{className:"header_actions",children:[x.jsx(JC,{handleWeekChange:g}),x.jsx(QC,{onClick:S})]});return x.jsx(x.Fragment,{children:f?x.jsxs("div",{className:"headerCalendar_mobile",children:[x.jsx("div",{className:"headerCalendar_mobile_month",children:x.jsxs("span",{className:"headerCalendar_mobile_month_span",children:[d," ",u]})}),x.jsxs("div",{className:"headerCalendar_mobile_actions",children:[C,x.jsx(Nl,{})]})]}):x.jsxs("div",{className:"headerCalendar",children:[x.jsx("div",{className:"headerCalendar_actions",children:C}),x.jsx("div",{className:"headerCalendar_month",children:x.jsxs("span",{className:"headerCalendar_month_span",children:[d," ",u]})}),x.jsx(Nl,{})]})})};function sT({className:e,...t}){return x.jsx("div",{"data-slot":"table-container",className:"relative w-full z-10 overflow-hidden",children:x.jsx("table",{"data-slot":"table",className:ce("w-full caption-bottom text-sm",e),...t})})}function iT({className:e,...t}){return x.jsx("td",{"data-slot":"table-cell",className:ce("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t})}const Ai={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}},Oi=({booking:e,slotData:t,events:n,style:r,ref:o})=>{if(!e||!t||!t)return;const{day:s,hour:i}=t,[a,c]=E.useState(e),l=d=>d<="11:30",u=(d,f)=>{const h=Z.dateAndHourDateToString(new Date(d.finishAt));return Z.isTodayDate(f)&&l(h)?{backgroundColor:"#000000c0"}:{backgroundColor:"#000456c0"}};return E.useEffect(()=>{e&&c(e)},[e]),E.useImperativeHandle(o,()=>({updateBooking:d=>c(d)})),x.jsx("div",{className:"booking_card_content_container",style:{...u(a,new Date(s.split(":")[1])),...r},onPointerUp:n==null?void 0:n.onClick,children:x.jsx("div",{className:"booking_card_content",children:x.jsx("p",{className:"booking_info",children:`${Z.dateAndHourDateToString(a.startAt)} - ${Z.dateAndHourDateToString(a.finishAt)}`})})},`${s}-${i}`)};function aT(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 cT=e=>{let{transform:t,draggingNodeRect:n,windowRect:r}=e;return!n||!r?t:aT(t,n,r)},ip=E.createContext({});function lT(e){const t=E.useRef(null);return t.current===null&&(t.current=e()),t.current}const Ya=typeof window<"u",uT=Ya?E.useLayoutEffect:E.useEffect,Ka=E.createContext(null);function Ga(e,t){e.indexOf(t)===-1&&e.push(t)}function qa(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}const wt=(e,t,n)=>n>t?t:n<e?e:n;let Wn=()=>{},St=()=>{};process.env.NODE_ENV!=="production"&&(Wn=(e,t)=>{!e&&typeof console<"u"&&console.warn(t)},St=(e,t)=>{if(!e)throw new Error(t)});const Ct={},ap=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function cp(e){return typeof e=="object"&&e!==null}const lp=e=>/^0[^.\s]+$/u.test(e);function Xa(e){let t;return()=>(t===void 0&&(t=e()),t)}const Xe=e=>e,dT=(e,t)=>n=>t(e(n)),Ur=(...e)=>e.reduce(dT),Tr=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r};class Za{constructor(){this.subscriptions=[]}add(t){return Ga(this.subscriptions,t),()=>qa(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 et=e=>e*1e3,ut=e=>e/1e3;function up(e,t){return t?e*(1e3/t):0}const Il=new Set;function Ja(e,t,n){e||Il.has(t)||(console.warn(t),Il.add(t))}const dp=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,fT=1e-7,hT=12;function pT(e,t,n,r,o){let s,i,a=0;do i=t+(n-t)/2,s=dp(i,r,o)-e,s>0?n=i:t=i;while(Math.abs(s)>fT&&++a<hT);return i}function Yr(e,t,n,r){if(e===t&&n===r)return Xe;const o=s=>pT(s,0,1,e,n);return s=>s===0||s===1?s:dp(o(s),t,r)}const fp=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,hp=e=>t=>1-e(1-t),pp=Yr(.33,1.53,.69,.99),Qa=hp(pp),mp=fp(Qa),gp=e=>(e*=2)<1?.5*Qa(e):.5*(2-Math.pow(2,-10*(e-1))),ec=e=>1-Math.sin(Math.acos(e)),vp=hp(ec),yp=fp(ec),mT=Yr(.42,0,1,1),gT=Yr(0,0,.58,1),bp=Yr(.42,0,.58,1),vT=e=>Array.isArray(e)&&typeof e[0]!="number",xp=e=>Array.isArray(e)&&typeof e[0]=="number",jl={linear:Xe,easeIn:mT,easeInOut:bp,easeOut:gT,circIn:ec,circInOut:yp,circOut:vp,backIn:Qa,backInOut:mp,backOut:pp,anticipate:gp},yT=e=>typeof e=="string",Ll=e=>{if(xp(e)){St(e.length===4,"Cubic bezier arrays must contain four numerical values.");const[t,n,r,o]=e;return Yr(t,n,r,o)}else if(yT(e))return St(jl[e]!==void 0,`Invalid easing type '${e}'`),jl[e];return e},io=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"],Vl={value:null};function bT(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},c=0;function l(d){i.has(d)&&(u.schedule(d),e()),c++,d(a)}const u={schedule:(d,f=!1,h=!1)=>{const m=h&&o?n:r;return f&&i.add(d),m.has(d)||m.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(l),t&&Vl.value&&Vl.value.frameloop[t].push(c),c=0,n.clear(),o=!1,s&&(s=!1,u.process(d))}};return u}const xT=40;function wp(e,t){let n=!1,r=!0;const o={delta:0,timestamp:0,isProcessing:!1},s=()=>n=!0,i=io.reduce((g,C)=>(g[C]=bT(s,t?C:void 0),g),{}),{setup:a,read:c,resolveKeyframes:l,preUpdate:u,update:d,preRender:f,render:h,postRender:S}=i,m=()=>{const g=Ct.useManualTiming?o.timestamp:performance.now();n=!1,Ct.useManualTiming||(o.delta=r?1e3/60:Math.max(Math.min(g-o.timestamp,xT),1)),o.timestamp=g,o.isProcessing=!0,a.process(o),c.process(o),l.process(o),u.process(o),d.process(o),f.process(o),h.process(o),S.process(o),o.isProcessing=!1,n&&t&&(r=!1,e(m))},w=()=>{n=!0,r=!0,o.isProcessing||e(m)};return{schedule:io.reduce((g,C)=>{const v=i[C];return g[C]=(M,b=!1,T=!1)=>(n||w(),v.schedule(M,b,T)),g},{}),cancel:g=>{for(let C=0;C<io.length;C++)i[io[C]].cancel(g)},state:o,steps:i}}const{schedule:ve,cancel:zt,state:De,steps:Ws}=wp(typeof requestAnimationFrame<"u"?requestAnimationFrame:Xe,!0);let wo;function wT(){wo=void 0}const je={now:()=>(wo===void 0&&je.set(De.isProcessing||Ct.useManualTiming?De.timestamp:performance.now()),wo),set:e=>{wo=e,queueMicrotask(wT)}},Sp=e=>t=>typeof t=="string"&&t.startsWith(e),tc=Sp("--"),ST=Sp("var(--"),nc=e=>ST(e)?CT.test(e.split("/*")[0].trim()):!1,CT=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,Hn={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},Dr={...Hn,transform:e=>wt(0,1,e)},ao={...Hn,default:1},hr=e=>Math.round(e*1e5)/1e5,rc=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function TT(e){return e==null}const DT=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,oc=(e,t)=>n=>!!(typeof n=="string"&&DT.test(n)&&n.startsWith(e)||t&&!TT(n)&&Object.prototype.hasOwnProperty.call(n,t)),Cp=(e,t,n)=>r=>{if(typeof r!="string")return r;const[o,s,i,a]=r.match(rc);return{[e]:parseFloat(o),[t]:parseFloat(s),[n]:parseFloat(i),alpha:a!==void 0?parseFloat(a):1}},ET=e=>wt(0,255,e),Hs={...Hn,transform:e=>Math.round(ET(e))},en={test:oc("rgb","red"),parse:Cp("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+Hs.transform(e)+", "+Hs.transform(t)+", "+Hs.transform(n)+", "+hr(Dr.transform(r))+")"};function MT(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 ki={test:oc("#"),parse:MT,transform:en.transform},Kr=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Nt=Kr("deg"),dt=Kr("%"),re=Kr("px"),RT=Kr("vh"),PT=Kr("vw"),Fl={...dt,parse:e=>dt.parse(e)/100,transform:e=>dt.transform(e*100)},wn={test:oc("hsl","hue"),parse:Cp("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+dt.transform(hr(t))+", "+dt.transform(hr(n))+", "+hr(Dr.transform(r))+")"},Re={test:e=>en.test(e)||ki.test(e)||wn.test(e),parse:e=>en.test(e)?en.parse(e):wn.test(e)?wn.parse(e):ki.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?en.transform(e):wn.transform(e)},AT=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function OT(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(rc))==null?void 0:t.length)||0)+(((n=e.match(AT))==null?void 0:n.length)||0)>0}const Tp="number",Dp="color",kT="var",_T="var(",$l="${}",NT=/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 Er(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},o=[];let s=0;const a=t.replace(NT,c=>(Re.test(c)?(r.color.push(s),o.push(Dp),n.push(Re.parse(c))):c.startsWith(_T)?(r.var.push(s),o.push(kT),n.push(c)):(r.number.push(s),o.push(Tp),n.push(parseFloat(c))),++s,$l)).split($l);return{values:n,split:a,indexes:r,types:o}}function Ep(e){return Er(e).values}function Mp(e){const{split:t,types:n}=Er(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===Tp?s+=hr(o[i]):a===Dp?s+=Re.transform(o[i]):s+=o[i]}return s}}const IT=e=>typeof e=="number"?0:e;function jT(e){const t=Ep(e);return Mp(e)(t.map(IT))}const Wt={test:OT,parse:Ep,createTransformer:Mp,getAnimatableNone:jT};function Us(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 LT({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,c=2*n-a;o=Us(c,a,e+1/3),s=Us(c,a,e),i=Us(c,a,e-1/3)}return{red:Math.round(o*255),green:Math.round(s*255),blue:Math.round(i*255),alpha:r}}function Vo(e,t){return n=>n>0?t:e}const ge=(e,t,n)=>e+(t-e)*n,Ys=(e,t,n)=>{const r=e*e,o=n*(t*t-r)+r;return o<0?0:Math.sqrt(o)},VT=[ki,en,wn],FT=e=>VT.find(t=>t.test(e));function Bl(e){const t=FT(e);if(Wn(!!t,`'${e}' is not an animatable color. Use the equivalent color code instead.`),!t)return!1;let n=t.parse(e);return t===wn&&(n=LT(n)),n}const zl=(e,t)=>{const n=Bl(e),r=Bl(t);if(!n||!r)return Vo(e,t);const o={...n};return s=>(o.red=Ys(n.red,r.red,s),o.green=Ys(n.green,r.green,s),o.blue=Ys(n.blue,r.blue,s),o.alpha=ge(n.alpha,r.alpha,s),en.transform(o))},_i=new Set(["none","hidden"]);function $T(e,t){return _i.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function BT(e,t){return n=>ge(e,t,n)}function sc(e){return typeof e=="number"?BT:typeof e=="string"?nc(e)?Vo:Re.test(e)?zl:HT:Array.isArray(e)?Rp:typeof e=="object"?Re.test(e)?zl:zT:Vo}function Rp(e,t){const n=[...e],r=n.length,o=e.map((s,i)=>sc(s)(s,t[i]));return s=>{for(let i=0;i<r;i++)n[i]=o[i](s);return n}}function zT(e,t){const n={...e,...t},r={};for(const o in n)e[o]!==void 0&&t[o]!==void 0&&(r[o]=sc(e[o])(e[o],t[o]));return o=>{for(const s in r)n[s]=r[s](o);return n}}function WT(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 HT=(e,t)=>{const n=Wt.createTransformer(t),r=Er(e),o=Er(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?_i.has(e)&&!o.values.length||_i.has(t)&&!r.values.length?$T(e,t):Ur(Rp(WT(r,o),o.values),n):(Wn(!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.`),Vo(e,t))};function Pp(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?ge(e,t,n):sc(e)(e,t)}const UT=e=>{const t=({timestamp:n})=>e(n);return{start:(n=!0)=>ve.update(t,n),stop:()=>zt(t),now:()=>De.isProcessing?De.timestamp:je.now()}},Ap=(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)})`},Fo=2e4;function ic(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<Fo;)t+=n,r=e.next(t);return t>=Fo?1/0:t}function YT(e,t=100,n){const r=n({...e,keyframes:[0,t]}),o=Math.min(ic(r),Fo);return{type:"keyframes",ease:s=>r.next(o*s).value/t,duration:ut(o)}}const KT=5;function Op(e,t,n){const r=Math.max(t-KT,0);return up(n-e(r),t-r)}const me={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},Wl=.001;function GT({duration:e=me.duration,bounce:t=me.bounce,velocity:n=me.velocity,mass:r=me.mass}){let o,s;Wn(e<=et(me.maxDuration),"Spring duration must be 10 seconds or less");let i=1-t;i=wt(me.minDamping,me.maxDamping,i),e=wt(me.minDuration,me.maxDuration,ut(e)),i<1?(o=l=>{const u=l*i,d=u*e,f=u-n,h=Ni(l,i),S=Math.exp(-d);return Wl-f/h*S},s=l=>{const d=l*i*e,f=d*n+n,h=Math.pow(i,2)*Math.pow(l,2)*e,S=Math.exp(-d),m=Ni(Math.pow(l,2),i);return(-o(l)+Wl>0?-1:1)*((f-h)*S)/m}):(o=l=>{const u=Math.exp(-l*e),d=(l-n)*e+1;return-.001+u*d},s=l=>{const u=Math.exp(-l*e),d=(n-l)*(e*e);return u*d});const a=5/e,c=XT(o,s,a);if(e=et(e),isNaN(c))return{stiffness:me.stiffness,damping:me.damping,duration:e};{const l=Math.pow(c,2)*r;return{stiffness:l,damping:i*2*Math.sqrt(r*l),duration:e}}}const qT=12;function XT(e,t,n){let r=n;for(let o=1;o<qT;o++)r=r-e(r)/t(r);return r}function Ni(e,t){return e*Math.sqrt(1-t*t)}const ZT=["duration","bounce"],JT=["stiffness","damping","mass"];function Hl(e,t){return t.some(n=>e[n]!==void 0)}function QT(e){let t={velocity:me.velocity,stiffness:me.stiffness,damping:me.damping,mass:me.mass,isResolvedFromDuration:!1,...e};if(!Hl(e,JT)&&Hl(e,ZT))if(e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),o=r*r,s=2*wt(.05,1,1-(e.bounce||0))*Math.sqrt(o);t={...t,mass:me.mass,stiffness:o,damping:s}}else{const n=GT(e);t={...t,...n,mass:me.mass},t.isResolvedFromDuration=!0}return t}function $o(e=me.visualDuration,t=me.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:c,damping:l,mass:u,duration:d,velocity:f,isResolvedFromDuration:h}=QT({...n,velocity:-ut(n.velocity||0)}),S=f||0,m=l/(2*Math.sqrt(c*u)),w=i-s,y=ut(Math.sqrt(c/u)),p=Math.abs(w)<5;r||(r=p?me.restSpeed.granular:me.restSpeed.default),o||(o=p?me.restDelta.granular:me.restDelta.default);let g;if(m<1){const v=Ni(y,m);g=M=>{const b=Math.exp(-m*y*M);return i-b*((S+m*y*w)/v*Math.sin(v*M)+w*Math.cos(v*M))}}else if(m===1)g=v=>i-Math.exp(-y*v)*(w+(S+y*w)*v);else{const v=y*Math.sqrt(m*m-1);g=M=>{const b=Math.exp(-m*y*M),T=Math.min(v*M,300);return i-b*((S+m*y*w)*Math.sinh(T)+v*w*Math.cosh(T))/v}}const C={calculatedDuration:h&&d||null,next:v=>{const M=g(v);if(h)a.done=v>=d;else{let b=v===0?S:0;m<1&&(b=v===0?et(S):Op(g,v,M));const T=Math.abs(b)<=r,R=Math.abs(i-M)<=o;a.done=T&&R}return a.value=a.done?i:M,a},toString:()=>{const v=Math.min(ic(C),Fo),M=Ap(b=>C.next(v*b).value,v,30);return v+"ms "+M},toTransition:()=>{}};return C}$o.applyToOptions=e=>{const t=YT(e,100,$o);return e.ease=t.ease,e.duration=et(t.duration),e.type="keyframes",e};function Ii({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:o=10,bounceStiffness:s=500,modifyTarget:i,min:a,max:c,restDelta:l=.5,restSpeed:u}){const d=e[0],f={done:!1,value:d},h=T=>a!==void 0&&T<a||c!==void 0&&T>c,S=T=>a===void 0?c:c===void 0||Math.abs(a-T)<Math.abs(c-T)?a:c;let m=n*t;const w=d+m,y=i===void 0?w:i(w);y!==w&&(m=y-d);const p=T=>-m*Math.exp(-T/r),g=T=>y+p(T),C=T=>{const R=p(T),k=g(T);f.done=Math.abs(R)<=l,f.value=f.done?y:k};let v,M;const b=T=>{h(f.value)&&(v=T,M=$o({keyframes:[f.value,S(f.value)],velocity:Op(g,T,f.value),damping:o,stiffness:s,restDelta:l,restSpeed:u}))};return b(0),{calculatedDuration:null,next:T=>{let R=!1;return!M&&v===void 0&&(R=!0,C(T),b(T)),v!==void 0&&T>=v?M.next(T-v):(!R&&C(T),f)}}}function eD(e,t,n){const r=[],o=n||Ct.mix||Pp,s=e.length-1;for(let i=0;i<s;i++){let a=o(e[i],e[i+1]);if(t){const c=Array.isArray(t)?t[i]||Xe:t;a=Ur(c,a)}r.push(a)}return r}function tD(e,t,{clamp:n=!0,ease:r,mixer:o}={}){const s=e.length;if(St(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=eD(t,r,o),c=a.length,l=u=>{if(i&&u<e[0])return t[0];let d=0;if(c>1)for(;d<e.length-2&&!(u<e[d+1]);d++);const f=Tr(e[d],e[d+1],u);return a[d](f)};return n?u=>l(wt(e[0],e[s-1],u)):l}function nD(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const o=Tr(0,t,r);e.push(ge(n,1,o))}}function rD(e){const t=[0];return nD(t,e.length-1),t}function oD(e,t){return e.map(n=>n*t)}function sD(e,t){return e.map(()=>t||bp).splice(0,e.length-1)}function Sn({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const o=vT(r)?r.map(Ll):Ll(r),s={done:!1,value:t[0]},i=oD(n&&n.length===t.length?n:rD(t),e),a=tD(i,t,{ease:Array.isArray(o)?o:sD(t,o)});return{calculatedDuration:e,next:c=>(s.value=a(c),s.done=c>=e,s)}}const iD=e=>e!==null;function ac(e,{repeat:t,repeatType:n="loop"},r,o=1){const s=e.filter(iD),a=o<0||t&&n!=="loop"&&t%2===1?0:s.length-1;return!a||r===void 0?s[a]:r}const aD={decay:Ii,inertia:Ii,tween:Sn,keyframes:Sn,spring:$o};function kp(e){typeof e.type=="string"&&(e.type=aD[e.type])}class cc{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 cD=e=>e/100;class lc extends cc{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!==je.now()&&this.tick(je.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;kp(t);const{type:n=Sn,repeat:r=0,repeatDelay:o=0,repeatType:s,velocity:i=0}=t;let{keyframes:a}=t;const c=n||Sn;process.env.NODE_ENV!=="production"&&c!==Sn&&St(a.length<=2,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${a}`),c!==Sn&&typeof a[0]!="number"&&(this.mixKeyframes=Ur(cD,Pp(a[0],a[1])),a=[0,100]);const l=c({...t,keyframes:a});s==="mirror"&&(this.mirroredGenerator=c({...t,keyframes:[...a].reverse(),velocity:-i})),l.calculatedDuration===null&&(l.calculatedDuration=ic(l));const{calculatedDuration:u}=l;this.calculatedDuration=u,this.resolvedDuration=u+o,this.totalDuration=this.resolvedDuration*(r+1)-o,this.generator=l}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:c}=this;if(this.startTime===null)return r.next(0);const{delay:l=0,keyframes:u,repeat:d,repeatType:f,repeatDelay:h,type:S,onUpdate:m,finalKeyframe:w}=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-l*(this.playbackSpeed>=0?1:-1),p=this.playbackSpeed>=0?y<0:y>o;this.currentTime=Math.max(y,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=o);let g=this.currentTime,C=r;if(d){const T=Math.min(this.currentTime,o)/a;let R=Math.floor(T),k=T%1;!k&&T>=1&&(k=1),k===1&&R--,R=Math.min(R,d+1),!!(R%2)&&(f==="reverse"?(k=1-k,h&&(k-=h/a)):f==="mirror"&&(C=i)),g=wt(0,1,k)*a}const v=p?{done:!1,value:u[0]}:C.next(g);s&&(v.value=s(v.value));let{done:M}=v;!p&&c!==null&&(M=this.playbackSpeed>=0?this.currentTime>=o:this.currentTime<=0);const b=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&M);return b&&S!==Ii&&(v.value=ac(u,this.options,w,this.speed)),m&&m(v.value),b&&this.finish(),v}then(t,n){return this.finished.then(t,n)}get duration(){return ut(this.calculatedDuration)}get time(){return ut(this.currentTime)}set time(t){var n;t=et(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(je.now());const n=this.playbackSpeed!==t;this.playbackSpeed=t,n&&(this.time=ut(this.currentTime))}play(){var o,s;if(this.isStopped)return;const{driver:t=UT,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(je.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 lD(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const tn=e=>e*180/Math.PI,ji=e=>{const t=tn(Math.atan2(e[1],e[0]));return Li(t)},uD={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:ji,rotateZ:ji,skewX:e=>tn(Math.atan(e[1])),skewY:e=>tn(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},Li=e=>(e=e%360,e<0&&(e+=360),e),Ul=ji,Yl=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),Kl=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),dD={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Yl,scaleY:Kl,scale:e=>(Yl(e)+Kl(e))/2,rotateX:e=>Li(tn(Math.atan2(e[6],e[5]))),rotateY:e=>Li(tn(Math.atan2(-e[2],e[0]))),rotateZ:Ul,rotate:Ul,skewX:e=>tn(Math.atan(e[4])),skewY:e=>tn(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function Vi(e){return e.includes("scale")?1:0}function Fi(e,t){if(!e||e==="none")return Vi(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,o;if(n)r=dD,o=n;else{const a=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=uD,o=a}if(!o)return Vi(t);const s=r[t],i=o[1].split(",").map(hD);return typeof s=="function"?s(i):i[s]}const fD=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return Fi(n,t)};function hD(e){return parseFloat(e.trim())}const Un=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Yn=new Set(Un),Gl=e=>e===Hn||e===re,pD=new Set(["x","y","z"]),mD=Un.filter(e=>!pD.has(e));function gD(e){const t=[];return mD.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const rn={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})=>Fi(t,"x"),y:(e,{transform:t})=>Fi(t,"y")};rn.translateX=rn.x;rn.translateY=rn.y;const on=new Set;let $i=!1,Bi=!1,zi=!1;function _p(){if(Bi){const e=Array.from(on).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const o=gD(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)})}Bi=!1,$i=!1,on.forEach(e=>e.complete(zi)),on.clear()}function Np(){on.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Bi=!0)})}function vD(){zi=!0,Np(),_p(),zi=!1}class uc{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?(on.add(this),$i||($i=!0,ve.read(Np),ve.resolveKeyframes(_p))):(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])}lD(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),on.delete(this)}cancel(){this.state==="scheduled"&&(on.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const yD=e=>e.startsWith("--");function bD(e,t,n){yD(t)?e.style.setProperty(t,n):e.style[t]=n}const xD=Xa(()=>window.ScrollTimeline!==void 0),wD={};function SD(e,t){const n=Xa(e);return()=>wD[t]??n()}const Ip=SD(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),cr=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,ql={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:cr([0,.65,.55,1]),circOut:cr([.55,0,1,.45]),backIn:cr([.31,.01,.66,-.59]),backOut:cr([.33,1.53,.69,.99])};function jp(e,t){if(e)return typeof e=="function"?Ip()?Ap(e,t):"ease-out":xp(e)?cr(e):Array.isArray(e)?e.map(n=>jp(n,t)||ql.easeOut):ql[e]}function CD(e,t,n,{delay:r=0,duration:o=300,repeat:s=0,repeatType:i="loop",ease:a="easeOut",times:c}={},l=void 0){const u={[t]:n};c&&(u.offset=c);const d=jp(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 l&&(f.pseudoElement=l),e.animate(u,f)}function Lp(e){return typeof e=="function"&&"applyToOptions"in e}function TD({type:e,...t}){return Lp(e)&&Ip()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class DD extends cc{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:c}=t;this.isPseudoElement=!!s,this.allowFlatten=i,this.options=t,St(typeof t.type!="string",`animateMini doesn't support "type" as a string. Did you mean to import { spring } from "motion"?`);const l=TD(t);this.animation=CD(n,r,o,l,s),l.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!s){const u=ac(o,this.options,a,this.speed);this.updateMotionValue?this.updateMotionValue(u):bD(n,r,u),this.animation.cancel()}c==null||c(),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 ut(Number(t))}get time(){return ut(Number(this.animation.currentTime)||0)}set time(t){this.finishedTime=null,this.animation.currentTime=et(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&&xD()?(this.animation.timeline=t,Xe):n(this)}}const Vp={anticipate:gp,backInOut:mp,circInOut:yp};function ED(e){return e in Vp}function MD(e){typeof e.ease=="string"&&ED(e.ease)&&(e.ease=Vp[e.ease])}const Xl=10;class RD extends DD{constructor(t){MD(t),kp(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 lc({...i,autoplay:!1}),c=et(this.finishedTime??this.time);n.setWithVelocity(a.sample(c-Xl).value,a.sample(c).value,Xl),a.stop()}}const Zl=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(Wt.test(e)||e==="0")&&!e.startsWith("url("));function PD(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 AD(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=Zl(o,t),a=Zl(s,t);return Wn(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:PD(e)||(n==="spring"||Lp(n))&&r}function Fp(e){return cp(e)&&"offsetHeight"in e}const OD=new Set(["opacity","clipPath","filter","transform"]),kD=Xa(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function _D(e){var l;const{motionValue:t,name:n,repeatDelay:r,repeatType:o,damping:s,type:i}=e;if(!Fp((l=t==null?void 0:t.owner)==null?void 0:l.current))return!1;const{onUpdate:a,transformTemplate:c}=t.owner.getProps();return kD()&&n&&OD.has(n)&&(n!=="transform"||!c)&&!a&&!r&&o!=="mirror"&&s!==0&&i!=="inertia"}const ND=40;class ID extends cc{constructor({autoplay:t=!0,delay:n=0,type:r="keyframes",repeat:o=0,repeatDelay:s=0,repeatType:i="loop",keyframes:a,name:c,motionValue:l,element:u,...d}){var S;super(),this.stop=()=>{var m,w;this._animation&&(this._animation.stop(),(m=this.stopTimeline)==null||m.call(this)),(w=this.keyframeResolver)==null||w.cancel()},this.createdAt=je.now();const f={autoplay:t,delay:n,type:r,repeat:o,repeatDelay:s,repeatType:i,name:c,motionValue:l,element:u,...d},h=(u==null?void 0:u.KeyframeResolver)||uc;this.keyframeResolver=new h(a,(m,w,y)=>this.onKeyframesResolved(m,w,f,!y),c,l,u),(S=this.keyframeResolver)==null||S.scheduleResolve()}onKeyframesResolved(t,n,r,o){this.keyframeResolver=void 0;const{name:s,type:i,velocity:a,delay:c,isHandoff:l,onUpdate:u}=r;this.resolvedAt=je.now(),AD(t,s,i,a)||((Ct.instantAnimations||!c)&&(u==null||u(ac(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>ND?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...r,keyframes:t},h=!l&&_D(f)?new RD({...f,element:f.motionValue.owner.current}):new lc(f);h.finished.then(()=>this.notifyFinished()).catch(Xe),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(),vD()),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 jD=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function LD(e){const t=jD.exec(e);if(!t)return[,];const[,n,r,o]=t;return[`--${n??r}`,o]}const VD=4;function $p(e,t,n=1){St(n<=VD,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`);const[r,o]=LD(e);if(!r)return;const s=window.getComputedStyle(t).getPropertyValue(r);if(s){const i=s.trim();return ap(i)?parseFloat(i):i}return nc(o)?$p(o,t,n+1):o}function dc(e,t){return(e==null?void 0:e[t])??(e==null?void 0:e.default)??e}const Bp=new Set(["width","height","top","left","right","bottom",...Un]),FD={test:e=>e==="auto",parse:e=>e},zp=e=>t=>t.test(e),Wp=[Hn,re,dt,Nt,PT,RT,FD],Jl=e=>Wp.find(zp(e));function $D(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||lp(e):!0}const BD=new Set(["brightness","contrast","saturate","opacity"]);function zD(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(rc)||[];if(!r)return e;const o=n.replace(r,"");let s=BD.has(t)?1:0;return r!==n&&(s*=100),t+"("+s+o+")"}const WD=/\b([a-z-]*)\(.*?\)/gu,Wi={...Wt,getAnimatableNone:e=>{const t=e.match(WD);return t?t.map(zD).join(" "):e}},Ql={...Hn,transform:Math.round},HD={rotate:Nt,rotateX:Nt,rotateY:Nt,rotateZ:Nt,scale:ao,scaleX:ao,scaleY:ao,scaleZ:ao,skew:Nt,skewX:Nt,skewY:Nt,distance:re,translateX:re,translateY:re,translateZ:re,x:re,y:re,z:re,perspective:re,transformPerspective:re,opacity:Dr,originX:Fl,originY:Fl,originZ:re},fc={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,...HD,zIndex:Ql,fillOpacity:Dr,strokeOpacity:Dr,numOctaves:Ql},UD={...fc,color:Re,backgroundColor:Re,outlineColor:Re,fill:Re,stroke:Re,borderColor:Re,borderTopColor:Re,borderRightColor:Re,borderBottomColor:Re,borderLeftColor:Re,filter:Wi,WebkitFilter:Wi},Hp=e=>UD[e];function Up(e,t){let n=Hp(e);return n!==Wi&&(n=Wt),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const YD=new Set(["auto","none","0"]);function KD(e,t,n){let r=0,o;for(;r<e.length&&!o;){const s=e[r];typeof s=="string"&&!YD.has(s)&&Er(s).values.length&&(o=e[r]),r++}if(o&&n)for(const s of t)e[s]=Up(n,o)}class GD extends uc{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 c=0;c<t.length;c++){let l=t[c];if(typeof l=="string"&&(l=l.trim(),nc(l))){const u=$p(l,n.current);u!==void 0&&(t[c]=u),c===t.length-1&&(this.finalKeyframe=l)}}if(this.resolveNoneKeyframes(),!Bp.has(r)||t.length!==2)return;const[o,s]=t,i=Jl(o),a=Jl(s);if(i!==a)if(Gl(i)&&Gl(a))for(let c=0;c<t.length;c++){const l=t[c];typeof l=="string"&&(t[c]=parseFloat(l))}else rn[r]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,r=[];for(let o=0;o<t.length;o++)(t[o]===null||$D(t[o]))&&r.push(o);r.length&&KD(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=rn[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]=rn[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(([c,l])=>{t.getValue(c).set(l)}),this.resolveNoneKeyframes()}}function qD(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 eu=30,XD=e=>!isNaN(parseFloat(e));class ZD{constructor(t,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=(r,o=!0)=>{var i,a;const s=je.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 c of this.dependents)c.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=je.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=XD(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return process.env.NODE_ENV!=="production"&&Ja(!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 Za);const r=this.events[t].add(n);return t==="change"?()=>{r(),ve.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=je.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>eu)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,eu);return up(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 _n(e,t){return new ZD(e,t)}const Yp=(e,t)=>t&&typeof e=="number"?t.transform(e):e,{schedule:hc}=wp(queueMicrotask,!1),Je={x:!1,y:!1};function Kp(){return Je.x||Je.y}function JD(e){return e==="x"||e==="y"?Je[e]?null:(Je[e]=!0,()=>{Je[e]=!1}):Je.x||Je.y?null:(Je.x=Je.y=!0,()=>{Je.x=Je.y=!1})}function Gp(e,t){const n=qD(e),r=new AbortController,o={passive:!0,...t,signal:r.signal};return[n,o,()=>r.abort()]}function tu(e){return!(e.pointerType==="touch"||Kp())}function QD(e,t,n={}){const[r,o,s]=Gp(e,n),i=a=>{if(!tu(a))return;const{target:c}=a,l=t(c,a);if(typeof l!="function"||!c)return;const u=d=>{tu(d)&&(l(d),c.removeEventListener("pointerleave",u))};c.addEventListener("pointerleave",u,o)};return r.forEach(a=>{a.addEventListener("pointerenter",i,o)}),s}const qp=(e,t)=>t?e===t?!0:qp(e,t.parentElement):!1,pc=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,eE=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function tE(e){return eE.has(e.tagName)||e.tabIndex!==-1}const So=new WeakSet;function nu(e){return t=>{t.key==="Enter"&&e(t)}}function Ks(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const nE=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=nu(()=>{if(So.has(n))return;Ks(n,"down");const o=nu(()=>{Ks(n,"up")}),s=()=>Ks(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 ru(e){return pc(e)&&!Kp()}function rE(e,t,n={}){const[r,o,s]=Gp(e,n),i=a=>{const c=a.currentTarget;if(!ru(a))return;So.add(c);const l=t(c,a),u=(h,S)=>{window.removeEventListener("pointerup",d),window.removeEventListener("pointercancel",f),So.has(c)&&So.delete(c),ru(h)&&typeof l=="function"&&l(h,{success:S})},d=h=>{u(h,c===window||c===document||n.useGlobalTarget||qp(c,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),Fp(a)&&(a.addEventListener("focus",l=>nE(l,o)),!tE(a)&&!a.hasAttribute("tabindex")&&(a.tabIndex=0))}),s}function Xp(e){return cp(e)&&"ownerSVGElement"in e}function oE(e){return Xp(e)&&e.tagName==="svg"}const Pe=e=>!!(e&&e.getVelocity),sE=[...Wp,Re,Wt],iE=e=>sE.find(zp(e)),Zp=E.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function aE(e=!0){const t=E.useContext(Ka);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:o}=t,s=E.useId();E.useEffect(()=>{if(e)return o(s)},[e]);const i=E.useCallback(()=>e&&r&&r(s),[s,r,e]);return!n&&r?[!1,i]:[!0]}const Jp=E.createContext({strict:!1}),ou={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"]},Nn={};for(const e in ou)Nn[e]={isEnabled:t=>ou[e].some(n=>!!t[n])};function cE(e){for(const t in e)Nn[t]={...Nn[t],...e[t]}}const lE=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 Bo(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||lE.has(e)}let Qp=e=>!Bo(e);function uE(e){e&&(Qp=t=>t.startsWith("on")?!Bo(t):e(t))}try{uE(require("@emotion/is-prop-valid").default)}catch{}function dE(e,t,n){const r={};for(const o in e)o==="values"&&typeof e.values=="object"||(Qp(o)||n===!0&&Bo(o)||!t&&!Bo(o)||e.draggable&&o.startsWith("onDrag"))&&(r[o]=e[o]);return r}function fE(e){if(typeof Proxy>"u")return e;const t=new Map,n=(...r)=>(process.env.NODE_ENV!=="production"&&Ja(!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 ps=E.createContext({});function ms(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function Mr(e){return typeof e=="string"||Array.isArray(e)}const mc=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],gc=["initial",...mc];function gs(e){return ms(e.animate)||gc.some(t=>Mr(e[t]))}function em(e){return!!(gs(e)||e.variants)}function hE(e,t){if(gs(e)){const{initial:n,animate:r}=e;return{initial:n===!1||Mr(n)?n:void 0,animate:Mr(r)?r:void 0}}return e.inherit!==!1?t:{}}function pE(e){const{initial:t,animate:n}=hE(e,E.useContext(ps));return E.useMemo(()=>({initial:t,animate:n}),[su(t),su(n)])}function su(e){return Array.isArray(e)?e.join(" "):e}const mE=Symbol.for("motionComponentSymbol");function Cn(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function gE(e,t,n){return E.useCallback(r=>{r&&e.onMount&&e.onMount(r),t&&(r?t.mount(r):t.unmount()),n&&(typeof n=="function"?n(r):Cn(n)&&(n.current=r))},[t])}const vc=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),vE="framerAppearId",tm="data-"+vc(vE),nm=E.createContext({});function yE(e,t,n,r,o){var m,w;const{visualElement:s}=E.useContext(ps),i=E.useContext(Jp),a=E.useContext(Ka),c=E.useContext(Zp).reducedMotion,l=E.useRef(null);r=r||i.renderer,!l.current&&r&&(l.current=r(e,{visualState:t,parent:s,props:n,presenceContext:a,blockInitialAnimation:a?a.initial===!1:!1,reducedMotionConfig:c}));const u=l.current,d=E.useContext(nm);u&&!u.projection&&o&&(u.type==="html"||u.type==="svg")&&bE(l.current,n,o,d);const f=E.useRef(!1);E.useInsertionEffect(()=>{u&&f.current&&u.update(n,a)});const h=n[tm],S=E.useRef(!!h&&!((m=window.MotionHandoffIsComplete)!=null&&m.call(window,h))&&((w=window.MotionHasOptimisedAnimation)==null?void 0:w.call(window,h)));return uT(()=>{u&&(f.current=!0,window.MotionIsMounted=!0,u.updateFeatures(),hc.render(u.render),S.current&&u.animationState&&u.animationState.animateChanges())}),E.useEffect(()=>{u&&(!S.current&&u.animationState&&u.animationState.animateChanges(),S.current&&(queueMicrotask(()=>{var y;(y=window.MotionHandoffMarkAsComplete)==null||y.call(window,h)}),S.current=!1))}),u}function bE(e,t,n,r){const{layoutId:o,layout:s,drag:i,dragConstraints:a,layoutScroll:c,layoutRoot:l,layoutCrossfade:u}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:rm(e.parent)),e.projection.setOptions({layoutId:o,layout:s,alwaysMeasureLayout:!!i||a&&Cn(a),visualElement:e,animationType:typeof s=="string"?s:"both",initialPromotionConfig:r,crossfade:u,layoutScroll:c,layoutRoot:l})}function rm(e){if(e)return e.options.allowProjection!==!1?e.projection:rm(e.parent)}function xE({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:r,Component:o}){e&&cE(e);function s(a,c){let l;const u={...E.useContext(Zp),...a,layoutId:wE(a)},{isStatic:d}=u,f=pE(a),h=r(a,d);if(!d&&Ya){SE(u,e);const S=CE(u);l=S.MeasureLayout,f.visualElement=yE(o,h,u,t,S.ProjectionNode)}return x.jsxs(ps.Provider,{value:f,children:[l&&f.visualElement?x.jsx(l,{visualElement:f.visualElement,...u}):null,n(o,a,gE(h,f.visualElement,c),h,d,f.visualElement)]})}s.displayName=`motion.${typeof o=="string"?o:`create(${o.displayName??o.name??""})`}`;const i=E.forwardRef(s);return i[mE]=o,i}function wE({layoutId:e}){const t=E.useContext(ip).id;return t&&e!==void 0?t+"-"+e:e}function SE(e,t){const n=E.useContext(Jp).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?Wn(!1,r):St(!1,r)}}function CE(e){const{drag:t,layout:n}=Nn;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 Rr={};function TE(e){for(const t in e)Rr[t]=e[t],tc(t)&&(Rr[t].isCSSVariable=!0)}function om(e,{layout:t,layoutId:n}){return Yn.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!Rr[e]||e==="opacity")}const DE={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},EE=Un.length;function ME(e,t,n){let r="",o=!0;for(let s=0;s<EE;s++){const i=Un[s],a=e[i];if(a===void 0)continue;let c=!0;if(typeof a=="number"?c=a===(i.startsWith("scale")?1:0):c=parseFloat(a)===0,!c||n){const l=Yp(a,fc[i]);if(!c){o=!1;const u=DE[i]||i;r+=`${u}(${l}) `}n&&(t[i]=l)}}return r=r.trim(),n?r=n(t,o?"":r):o&&(r="none"),r}function yc(e,t,n){const{style:r,vars:o,transformOrigin:s}=e;let i=!1,a=!1;for(const c in t){const l=t[c];if(Yn.has(c)){i=!0;continue}else if(tc(c)){o[c]=l;continue}else{const u=Yp(l,fc[c]);c.startsWith("origin")?(a=!0,s[c]=u):r[c]=u}}if(t.transform||(i||n?r.transform=ME(t,e.transform,n):r.transform&&(r.transform="none")),a){const{originX:c="50%",originY:l="50%",originZ:u=0}=s;r.transformOrigin=`${c} ${l} ${u}`}}const bc=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function sm(e,t,n){for(const r in t)!Pe(t[r])&&!om(r,n)&&(e[r]=t[r])}function RE({transformTemplate:e},t){return E.useMemo(()=>{const n=bc();return yc(n,t,e),Object.assign({},n.vars,n.style)},[t])}function PE(e,t){const n=e.style||{},r={};return sm(r,n,e),Object.assign(r,RE(e,t)),r}function AE(e,t){const n={},r=PE(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 OE={offset:"stroke-dashoffset",array:"stroke-dasharray"},kE={offset:"strokeDashoffset",array:"strokeDasharray"};function _E(e,t,n=1,r=0,o=!0){e.pathLength=1;const s=o?OE:kE;e[s.offset]=re.transform(-r);const i=re.transform(t),a=re.transform(n);e[s.array]=`${i} ${a}`}function im(e,{attrX:t,attrY:n,attrScale:r,pathLength:o,pathSpacing:s=1,pathOffset:i=0,...a},c,l,u){if(yc(e,a,l),c){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&&_E(d,o,s,i,!1)}const am=()=>({...bc(),attrs:{}}),cm=e=>typeof e=="string"&&e.toLowerCase()==="svg";function NE(e,t,n,r){const o=E.useMemo(()=>{const s=am();return im(s,t,cm(r),e.transformTemplate,e.style),{...s.attrs,style:{...s.style}}},[t]);if(e.style){const s={};sm(s,e.style,e),o.style={...s,...o.style}}return o}const IE=["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 xc(e){return typeof e!="string"||e.includes("-")?!1:!!(IE.indexOf(e)>-1||/[A-Z]/u.test(e))}function jE(e=!1){return(n,r,o,{latestValues:s},i)=>{const c=(xc(n)?NE:AE)(r,s,i,n),l=dE(r,typeof n=="string",e),u=n!==E.Fragment?{...l,...c,ref:o}:{},{children:d}=r,f=E.useMemo(()=>Pe(d)?d.get():d,[d]);return E.createElement(n,{...u,children:f})}}function iu(e){const t=[{},{}];return e==null||e.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function wc(e,t,n,r){if(typeof t=="function"){const[o,s]=iu(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]=iu(r);t=t(n!==void 0?n:e.custom,o,s)}return t}function Co(e){return Pe(e)?e.get():e}function LE({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,o){return{latestValues:VE(n,r,o,e),renderState:t()}}const lm=e=>(t,n)=>{const r=E.useContext(ps),o=E.useContext(Ka),s=()=>LE(e,t,r,o);return n?s():lT(s)};function VE(e,t,n,r){const o={},s=r(e,{});for(const f in s)o[f]=Co(s[f]);let{initial:i,animate:a}=e;const c=gs(e),l=em(e);t&&l&&!c&&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"&&!ms(d)){const f=Array.isArray(d)?d:[d];for(let h=0;h<f.length;h++){const S=wc(e,f[h]);if(S){const{transitionEnd:m,transition:w,...y}=S;for(const p in y){let g=y[p];if(Array.isArray(g)){const C=u?g.length-1:0;g=g[C]}g!==null&&(o[p]=g)}for(const p in m)o[p]=m[p]}}}return o}function Sc(e,t,n){var s;const{style:r}=e,o={};for(const i in r)(Pe(r[i])||t.style&&Pe(t.style[i])||om(i,e)||((s=n==null?void 0:n.getValue(i))==null?void 0:s.liveStyle)!==void 0)&&(o[i]=r[i]);return o}const FE={useVisualState:lm({scrapeMotionValuesFromProps:Sc,createRenderState:bc})};function um(e,t,n){const r=Sc(e,t,n);for(const o in e)if(Pe(e[o])||Pe(t[o])){const s=Un.indexOf(o)!==-1?"attr"+o.charAt(0).toUpperCase()+o.substring(1):o;r[s]=e[o]}return r}const $E={useVisualState:lm({scrapeMotionValuesFromProps:um,createRenderState:am})};function BE(e,t){return function(r,{forwardMotionProps:o}={forwardMotionProps:!1}){const i={...xc(r)?$E:FE,preloadedFeatures:e,useRender:jE(o),createVisualElement:t,Component:r};return xE(i)}}function Pr(e,t,n){const r=e.getProps();return wc(r,t,n!==void 0?n:r.custom,e)}const Hi=e=>Array.isArray(e);function zE(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,_n(n))}function WE(e){return Hi(e)?e[e.length-1]||0:e}function HE(e,t){const n=Pr(e,t);let{transitionEnd:r={},transition:o={},...s}=n||{};s={...s,...r};for(const i in s){const a=WE(s[i]);zE(e,i,a)}}function UE(e){return!!(Pe(e)&&e.add)}function Ui(e,t){const n=e.getValue("willChange");if(UE(n))return n.add(t);if(!n&&Ct.WillChange){const r=new Ct.WillChange("auto");e.addValue("willChange",r),r.add(t)}}function dm(e){return e.props[tm]}const YE=e=>e!==null;function KE(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 GE={type:"spring",stiffness:500,damping:25,restSpeed:10},qE=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),XE={type:"keyframes",duration:.8},ZE={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},JE=(e,{keyframes:t})=>t.length>2?XE:Yn.has(e)?e.startsWith("scale")?qE(t[1]):GE:ZE;function QE({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:o,repeat:s,repeatType:i,repeatDelay:a,from:c,elapsed:l,...u}){return!!Object.keys(u).length}const Cc=(e,t,n,r={},o,s)=>i=>{const a=dc(r,e)||{},c=a.delay||r.delay||0;let{elapsed:l=0}=r;l=l-et(c);const u={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...a,delay:-l,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};QE(a)||Object.assign(u,JE(e,u)),u.duration&&(u.duration=et(u.duration)),u.repeatDelay&&(u.repeatDelay=et(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)),(Ct.instantAnimations||Ct.skipAnimations)&&(d=!0,u.duration=0,u.delay=0),u.allowFlatten=!a.type&&!a.ease,d&&!s&&t.get()!==void 0){const f=KE(u.keyframes,a);if(f!==void 0){ve.update(()=>{u.onUpdate(f),u.onComplete()});return}}return a.isSync?new lc(u):new ID(u)};function eM({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function fm(e,t,{delay:n=0,transitionOverride:r,type:o}={}){let{transition:s=e.getDefaultTransition(),transitionEnd:i,...a}=t;r&&(s=r);const c=[],l=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||l&&eM(l,u))continue;const h={delay:n,...dc(s||{},u)},S=d.get();if(S!==void 0&&!d.isAnimating&&!Array.isArray(f)&&f===S&&!h.velocity)continue;let m=!1;if(window.MotionHandoffAnimation){const y=dm(e);if(y){const p=window.MotionHandoffAnimation(y,u,ve);p!==null&&(h.startTime=p,m=!0)}}Ui(e,u),d.start(Cc(u,d,f,e.shouldReduceMotion&&Bp.has(u)?{type:!1}:h,e,m));const w=d.animation;w&&c.push(w)}return i&&Promise.all(c).then(()=>{ve.update(()=>{i&&HE(e,i)})}),c}function Yi(e,t,n={}){var c;const r=Pr(e,t,n.type==="exit"?(c=e.presenceContext)==null?void 0:c.custom:void 0);let{transition:o=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(o=n.transitionOverride);const s=r?()=>Promise.all(fm(e,r,n)):()=>Promise.resolve(),i=e.variantChildren&&e.variantChildren.size?(l=0)=>{const{delayChildren:u=0,staggerChildren:d,staggerDirection:f}=o;return tM(e,t,u+l,d,f,n)}:()=>Promise.resolve(),{when:a}=o;if(a){const[l,u]=a==="beforeChildren"?[s,i]:[i,s];return l().then(()=>u())}else return Promise.all([s(),i(n.delay)])}function tM(e,t,n=0,r=0,o=1,s){const i=[],a=(e.variantChildren.size-1)*r,c=o===1?(l=0)=>l*r:(l=0)=>a-l*r;return Array.from(e.variantChildren).sort(nM).forEach((l,u)=>{l.notify("AnimationStart",t),i.push(Yi(l,t,{...s,delay:n+c(u)}).then(()=>l.notify("AnimationComplete",t)))}),Promise.all(i)}function nM(e,t){return e.sortNodePosition(t)}function rM(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const o=t.map(s=>Yi(e,s,n));r=Promise.all(o)}else if(typeof t=="string")r=Yi(e,t,n);else{const o=typeof t=="function"?Pr(e,t,n.custom):t;r=Promise.all(fm(e,o,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}function hm(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 oM=gc.length;function pm(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?pm(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<oM;n++){const r=gc[n],o=e.props[r];(Mr(o)||o===!1)&&(t[r]=o)}return t}const sM=[...mc].reverse(),iM=mc.length;function aM(e){return t=>Promise.all(t.map(({animation:n,options:r})=>rM(e,n,r)))}function cM(e){let t=aM(e),n=au(),r=!0;const o=c=>(l,u)=>{var f;const d=Pr(e,u,c==="exit"?(f=e.presenceContext)==null?void 0:f.custom:void 0);if(d){const{transition:h,transitionEnd:S,...m}=d;l={...l,...m,...S}}return l};function s(c){t=c(e)}function i(c){const{props:l}=e,u=pm(e.parent)||{},d=[],f=new Set;let h={},S=1/0;for(let w=0;w<iM;w++){const y=sM[w],p=n[y],g=l[y]!==void 0?l[y]:u[y],C=Mr(g),v=y===c?p.isActive:null;v===!1&&(S=w);let M=g===u[y]&&g!==l[y]&&C;if(M&&r&&e.manuallyAnimateOnMount&&(M=!1),p.protectedKeys={...h},!p.isActive&&v===null||!g&&!p.prevProp||ms(g)||typeof g=="boolean")continue;const b=lM(p.prevProp,g);let T=b||y===c&&p.isActive&&!M&&C||w>S&&C,R=!1;const k=Array.isArray(g)?g:[g];let A=k.reduce(o(y),{});v===!1&&(A={});const{prevResolvedValues:z={}}=p,G={...z,...A},j=N=>{T=!0,f.has(N)&&(R=!0,f.delete(N)),p.needsAnimating[N]=!0;const P=e.getValue(N);P&&(P.liveStyle=!1)};for(const N in G){const P=A[N],I=z[N];if(h.hasOwnProperty(N))continue;let O=!1;Hi(P)&&Hi(I)?O=!hm(P,I):O=P!==I,O?P!=null?j(N):f.add(N):P!==void 0&&f.has(N)?j(N):p.protectedKeys[N]=!0}p.prevProp=g,p.prevResolvedValues=A,p.isActive&&(h={...h,...A}),r&&e.blockInitialAnimation&&(T=!1),T&&(!(M&&b)||R)&&d.push(...k.map(N=>({animation:N,options:{type:y}})))}if(f.size){const w={};if(typeof l.initial!="boolean"){const y=Pr(e,Array.isArray(l.initial)?l.initial[0]:l.initial);y&&y.transition&&(w.transition=y.transition)}f.forEach(y=>{const p=e.getBaseTarget(y),g=e.getValue(y);g&&(g.liveStyle=!0),w[y]=p??null}),d.push({animation:w})}let m=!!d.length;return r&&(l.initial===!1||l.initial===l.animate)&&!e.manuallyAnimateOnMount&&(m=!1),r=!1,m?t(d):Promise.resolve()}function a(c,l){var d;if(n[c].isActive===l)return Promise.resolve();(d=e.variantChildren)==null||d.forEach(f=>{var h;return(h=f.animationState)==null?void 0:h.setActive(c,l)}),n[c].isActive=l;const u=i(c);for(const f in n)n[f].protectedKeys={};return u}return{animateChanges:i,setActive:a,setAnimateFunction:s,getState:()=>n,reset:()=>{n=au(),r=!0}}}function lM(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!hm(t,e):!1}function Jt(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function au(){return{animate:Jt(!0),whileInView:Jt(),whileHover:Jt(),whileTap:Jt(),whileDrag:Jt(),whileFocus:Jt(),exit:Jt()}}class Yt{constructor(t){this.isMounted=!1,this.node=t}update(){}}class uM extends Yt{constructor(t){super(t),t.animationState||(t.animationState=cM(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();ms(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 dM=0;class fM extends Yt{constructor(){super(...arguments),this.id=dM++}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 hM={animation:{Feature:uM},exit:{Feature:fM}};function Ar(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function Gr(e){return{point:{x:e.pageX,y:e.pageY}}}const pM=e=>t=>pc(t)&&e(t,Gr(t));function pr(e,t,n,r){return Ar(e,t,pM(n),r)}function mm({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function mM({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function gM(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 gm=1e-4,vM=1-gm,yM=1+gm,vm=.01,bM=0-vm,xM=0+vm;function ke(e){return e.max-e.min}function wM(e,t,n){return Math.abs(e-t)<=n}function cu(e,t,n,r=.5){e.origin=r,e.originPoint=ge(t.min,t.max,e.origin),e.scale=ke(n)/ke(t),e.translate=ge(n.min,n.max,e.origin)-e.originPoint,(e.scale>=vM&&e.scale<=yM||isNaN(e.scale))&&(e.scale=1),(e.translate>=bM&&e.translate<=xM||isNaN(e.translate))&&(e.translate=0)}function mr(e,t,n,r){cu(e.x,t.x,n.x,r?r.originX:void 0),cu(e.y,t.y,n.y,r?r.originY:void 0)}function lu(e,t,n){e.min=n.min+t.min,e.max=e.min+ke(t)}function SM(e,t,n){lu(e.x,t.x,n.x),lu(e.y,t.y,n.y)}function uu(e,t,n){e.min=t.min-n.min,e.max=e.min+ke(t)}function gr(e,t,n){uu(e.x,t.x,n.x),uu(e.y,t.y,n.y)}const du=()=>({translate:0,scale:1,origin:0,originPoint:0}),Tn=()=>({x:du(),y:du()}),fu=()=>({min:0,max:0}),xe=()=>({x:fu(),y:fu()});function Ke(e){return[e("x"),e("y")]}function Gs(e){return e===void 0||e===1}function Ki({scale:e,scaleX:t,scaleY:n}){return!Gs(e)||!Gs(t)||!Gs(n)}function Qt(e){return Ki(e)||ym(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function ym(e){return hu(e.x)||hu(e.y)}function hu(e){return e&&e!=="0%"}function zo(e,t,n){const r=e-n,o=t*r;return n+o}function pu(e,t,n,r,o){return o!==void 0&&(e=zo(e,o,r)),zo(e,n,r)+t}function Gi(e,t=0,n=1,r,o){e.min=pu(e.min,t,n,r,o),e.max=pu(e.max,t,n,r,o)}function bm(e,{x:t,y:n}){Gi(e.x,t.translate,t.scale,t.originPoint),Gi(e.y,n.translate,n.scale,n.originPoint)}const mu=.999999999999,gu=1.0000000000001;function CM(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:c}=s.options;c&&c.props.style&&c.props.style.display==="contents"||(r&&s.options.layoutScroll&&s.scroll&&s!==s.root&&En(e,{x:-s.scroll.offset.x,y:-s.scroll.offset.y}),i&&(t.x*=i.x.scale,t.y*=i.y.scale,bm(e,i)),r&&Qt(s.latestValues)&&En(e,s.latestValues))}t.x<gu&&t.x>mu&&(t.x=1),t.y<gu&&t.y>mu&&(t.y=1)}function Dn(e,t){e.min=e.min+t,e.max=e.max+t}function vu(e,t,n,r,o=.5){const s=ge(e.min,e.max,o);Gi(e,t,n,s,r)}function En(e,t){vu(e.x,t.x,t.scaleX,t.scale,t.originX),vu(e.y,t.y,t.scaleY,t.scale,t.originY)}function xm(e,t){return mm(gM(e.getBoundingClientRect(),t))}function TM(e,t,n){const r=xm(e,n),{scroll:o}=t;return o&&(Dn(r.x,o.offset.x),Dn(r.y,o.offset.y)),r}const wm=({current:e})=>e?e.ownerDocument.defaultView:null,yu=(e,t)=>Math.abs(e-t);function DM(e,t){const n=yu(e.x,t.x),r=yu(e.y,t.y);return Math.sqrt(n**2+r**2)}class Sm{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=Xs(this.lastMoveEventInfo,this.history),f=this.startEvent!==null,h=DM(d.offset,{x:0,y:0})>=3;if(!f&&!h)return;const{point:S}=d,{timestamp:m}=De;this.history.push({...S,timestamp:m});const{onStart:w,onMove:y}=this.handlers;f||(w&&w(this.lastMoveEvent,d),this.startEvent=this.lastMoveEvent),y&&y(this.lastMoveEvent,d)},this.handlePointerMove=(d,f)=>{this.lastMoveEvent=d,this.lastMoveEventInfo=qs(f,this.transformPagePoint),ve.update(this.updatePoint,!0)},this.handlePointerUp=(d,f)=>{this.end();const{onEnd:h,onSessionEnd:S,resumeAnimation:m}=this.handlers;if(this.dragSnapToOrigin&&m&&m(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const w=Xs(d.type==="pointercancel"?this.lastMoveEventInfo:qs(f,this.transformPagePoint),this.history);this.startEvent&&h&&h(d,w),S&&S(d,w)},!pc(t))return;this.dragSnapToOrigin=s,this.handlers=n,this.transformPagePoint=r,this.contextWindow=o||window;const i=Gr(t),a=qs(i,this.transformPagePoint),{point:c}=a,{timestamp:l}=De;this.history=[{...c,timestamp:l}];const{onSessionStart:u}=n;u&&u(t,Xs(a,this.history)),this.removeListeners=Ur(pr(this.contextWindow,"pointermove",this.handlePointerMove),pr(this.contextWindow,"pointerup",this.handlePointerUp),pr(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),zt(this.updatePoint)}}function qs(e,t){return t?{point:t(e.point)}:e}function bu(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Xs({point:e},t){return{point:e,delta:bu(e,Cm(t)),offset:bu(e,EM(t)),velocity:MM(t,.1)}}function EM(e){return e[0]}function Cm(e){return e[e.length-1]}function MM(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const o=Cm(e);for(;n>=0&&(r=e[n],!(o.timestamp-r.timestamp>et(t)));)n--;if(!r)return{x:0,y:0};const s=ut(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 RM(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?ge(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?ge(n,e,r.max):Math.min(e,n)),e}function xu(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 PM(e,{top:t,left:n,bottom:r,right:o}){return{x:xu(e.x,n,o),y:xu(e.y,t,r)}}function wu(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 AM(e,t){return{x:wu(e.x,t.x),y:wu(e.y,t.y)}}function OM(e,t){let n=.5;const r=ke(e),o=ke(t);return o>r?n=Tr(t.min,t.max-r,e.min):r>o&&(n=Tr(e.min,e.max-o,t.min)),wt(0,1,n)}function kM(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 qi=.35;function _M(e=qi){return e===!1?e=0:e===!0&&(e=qi),{x:Su(e,"left","right"),y:Su(e,"top","bottom")}}function Su(e,t,n){return{min:Cu(e,t),max:Cu(e,n)}}function Cu(e,t){return typeof e=="number"?e:e[t]||0}const NM=new WeakMap;class IM{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=xe(),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(Gr(u).point)},s=(u,d)=>{const{drag:f,dragPropagation:h,onDragStart:S}=this.getProps();if(f&&!h&&(this.openDragLock&&this.openDragLock(),this.openDragLock=JD(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),Ke(w=>{let y=this.getAxisMotionValue(w).get()||0;if(dt.test(y)){const{projection:p}=this.visualElement;if(p&&p.layout){const g=p.layout.layoutBox[w];g&&(y=ke(g)*(parseFloat(y)/100))}}this.originPoint[w]=y}),S&&ve.postRender(()=>S(u,d)),Ui(this.visualElement,"transform");const{animationState:m}=this.visualElement;m&&m.setActive("whileDrag",!0)},i=(u,d)=>{const{dragPropagation:f,dragDirectionLock:h,onDirectionLock:S,onDrag:m}=this.getProps();if(!f&&!this.openDragLock)return;const{offset:w}=d;if(h&&this.currentDirection===null){this.currentDirection=jM(w),this.currentDirection!==null&&S&&S(this.currentDirection);return}this.updateAxis("x",d.point,w),this.updateAxis("y",d.point,w),this.visualElement.render(),m&&m(u,d)},a=(u,d)=>this.stop(u,d),c=()=>Ke(u=>{var d;return this.getAnimationState(u)==="paused"&&((d=this.getAxisMotionValue(u).animation)==null?void 0:d.play())}),{dragSnapToOrigin:l}=this.getProps();this.panSession=new Sm(t,{onSessionStart:o,onStart:s,onMove:i,onSessionEnd:a,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:l,contextWindow:wm(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&&ve.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||!co(t,o,this.currentDirection))return;const s=this.getAxisMotionValue(t);let i=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(i=RM(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&&Cn(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=PM(r.layoutBox,t):this.constraints=!1,this.elastic=_M(n),o!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&Ke(i=>{this.constraints!==!1&&this.getAxisMotionValue(i)&&(this.constraints[i]=kM(r.layoutBox[i],this.constraints[i]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!Cn(t))return!1;const r=t.current;St(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=TM(r,o.root,this.visualElement.getTransformPagePoint());let i=AM(o.layout.layoutBox,s);if(n){const a=n(mM(i));this.hasMutatedConstraints=!!a,a&&(i=mm(a))}return i}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:o,dragTransition:s,dragSnapToOrigin:i,onDragTransitionEnd:a}=this.getProps(),c=this.constraints||{},l=Ke(u=>{if(!co(u,n,this.currentDirection))return;let d=c&&c[u]||{};i&&(d={min:0,max:0});const f=o?200:1e6,h=o?40:1e7,S={type:"inertia",velocity:r?t[u]:0,bounceStiffness:f,bounceDamping:h,timeConstant:750,restDelta:1,restSpeed:10,...s,...d};return this.startAxisValueAnimation(u,S)});return Promise.all(l).then(a)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return Ui(this.visualElement,t),r.start(Cc(t,r,0,n,this.visualElement,!1))}stopAnimation(){Ke(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){Ke(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){Ke(n=>{const{drag:r}=this.getProps();if(!co(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]-ge(i,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!Cn(n)||!r||!this.constraints)return;this.stopAnimation();const o={x:0,y:0};Ke(i=>{const a=this.getAxisMotionValue(i);if(a&&this.constraints!==!1){const c=a.get();o[i]=OM({min:c,max:c},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(),Ke(i=>{if(!co(i,t,null))return;const a=this.getAxisMotionValue(i),{min:c,max:l}=this.constraints[i];a.set(ge(c,l,o[i]))})}addListeners(){if(!this.visualElement.current)return;NM.set(this.visualElement,this);const t=this.visualElement.current,n=pr(t,"pointerdown",c=>{const{drag:l,dragListener:u=!0}=this.getProps();l&&u&&this.start(c)}),r=()=>{const{dragConstraints:c}=this.getProps();Cn(c)&&c.current&&(this.constraints=this.resolveRefConstraints())},{projection:o}=this.visualElement,s=o.addEventListener("measure",r);o&&!o.layout&&(o.root&&o.root.updateScroll(),o.updateLayout()),ve.read(r);const i=Ar(window,"resize",()=>this.scalePositionWithinConstraints()),a=o.addEventListener("didUpdate",({delta:c,hasLayoutChanged:l})=>{this.isDragging&&l&&(Ke(u=>{const d=this.getAxisMotionValue(u);d&&(this.originPoint[u]+=c[u].translate,d.set(d.get()+c[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=qi,dragMomentum:a=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:o,dragConstraints:s,dragElastic:i,dragMomentum:a}}}function co(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function jM(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class LM extends Yt{constructor(t){super(t),this.removeGroupControls=Xe,this.removeListeners=Xe,this.controls=new IM(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Xe}unmount(){this.removeGroupControls(),this.removeListeners()}}const Tu=e=>(t,n)=>{e&&ve.postRender(()=>e(t,n))};class VM extends Yt{constructor(){super(...arguments),this.removePointerDownListener=Xe}onPointerDown(t){this.session=new Sm(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:wm(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:o}=this.node.getProps();return{onSessionStart:Tu(t),onStart:Tu(n),onMove:r,onEnd:(s,i)=>{delete this.session,o&&ve.postRender(()=>o(s,i))}}}mount(){this.removePointerDownListener=pr(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 To={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function Du(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const er={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(re.test(e))e=parseFloat(e);else return e;const n=Du(e,t.target.x),r=Du(e,t.target.y);return`${n}% ${r}%`}},FM={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,o=Wt.parse(e);if(o.length>5)return r;const s=Wt.createTransformer(e),i=typeof o[0]!="number"?1:0,a=n.x.scale*t.x,c=n.y.scale*t.y;o[0+i]/=a,o[1+i]/=c;const l=ge(a,c,.5);return typeof o[2+i]=="number"&&(o[2+i]/=l),typeof o[3+i]=="number"&&(o[3+i]/=l),s(o)}};class $M extends E.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:o}=this.props,{projection:s}=t;TE(BM),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()})),To.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()||ve.postRender(()=>{const a=i.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),hc.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 Tm(e){const[t,n]=aE(),r=E.useContext(ip);return x.jsx($M,{...e,layoutGroup:r,switchLayoutGroup:E.useContext(nm),isPresent:t,safeToRemove:n})}const BM={borderRadius:{...er,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:er,borderTopRightRadius:er,borderBottomLeftRadius:er,borderBottomRightRadius:er,boxShadow:FM};function zM(e,t,n){const r=Pe(e)?e:_n(e);return r.start(Cc("",r,t,n)),r.animation}const WM=(e,t)=>e.depth-t.depth;class HM{constructor(){this.children=[],this.isDirty=!1}add(t){Ga(this.children,t),this.isDirty=!0}remove(t){qa(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(WM),this.isDirty=!1,this.children.forEach(t)}}function UM(e,t){const n=je.now(),r=({timestamp:o})=>{const s=o-n;s>=t&&(zt(r),e(s-t))};return ve.setup(r,!0),()=>zt(r)}const Dm=["TopLeft","TopRight","BottomLeft","BottomRight"],YM=Dm.length,Eu=e=>typeof e=="string"?parseFloat(e):e,Mu=e=>typeof e=="number"||re.test(e);function KM(e,t,n,r,o,s){o?(e.opacity=ge(0,n.opacity??1,GM(r)),e.opacityExit=ge(t.opacity??1,0,qM(r))):s&&(e.opacity=ge(t.opacity??1,n.opacity??1,r));for(let i=0;i<YM;i++){const a=`border${Dm[i]}Radius`;let c=Ru(t,a),l=Ru(n,a);if(c===void 0&&l===void 0)continue;c||(c=0),l||(l=0),c===0||l===0||Mu(c)===Mu(l)?(e[a]=Math.max(ge(Eu(c),Eu(l),r),0),(dt.test(l)||dt.test(c))&&(e[a]+="%")):e[a]=l}(t.rotate||n.rotate)&&(e.rotate=ge(t.rotate||0,n.rotate||0,r))}function Ru(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const GM=Em(0,.5,vp),qM=Em(.5,.95,Xe);function Em(e,t,n){return r=>r<e?0:r>t?1:n(Tr(e,t,r))}function Pu(e,t){e.min=t.min,e.max=t.max}function Ye(e,t){Pu(e.x,t.x),Pu(e.y,t.y)}function Au(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function Ou(e,t,n,r,o){return e-=t,e=zo(e,1/n,r),o!==void 0&&(e=zo(e,1/o,r)),e}function XM(e,t=0,n=1,r=.5,o,s=e,i=e){if(dt.test(t)&&(t=parseFloat(t),t=ge(i.min,i.max,t/100)-i.min),typeof t!="number")return;let a=ge(s.min,s.max,r);e===s&&(a-=t),e.min=Ou(e.min,t,n,a,o),e.max=Ou(e.max,t,n,a,o)}function ku(e,t,[n,r,o],s,i){XM(e,t[n],t[r],t[o],t.scale,s,i)}const ZM=["x","scaleX","originX"],JM=["y","scaleY","originY"];function _u(e,t,n,r){ku(e.x,t,ZM,n?n.x:void 0,r?r.x:void 0),ku(e.y,t,JM,n?n.y:void 0,r?r.y:void 0)}function Nu(e){return e.translate===0&&e.scale===1}function Mm(e){return Nu(e.x)&&Nu(e.y)}function Iu(e,t){return e.min===t.min&&e.max===t.max}function QM(e,t){return Iu(e.x,t.x)&&Iu(e.y,t.y)}function ju(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function Rm(e,t){return ju(e.x,t.x)&&ju(e.y,t.y)}function Lu(e){return ke(e.x)/ke(e.y)}function Vu(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class eR{constructor(){this.members=[]}add(t){Ga(this.members,t),t.scheduleRender()}remove(t){if(qa(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 tR(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:l,rotate:u,rotateX:d,rotateY:f,skewX:h,skewY:S}=n;l&&(r=`perspective(${l}px) ${r}`),u&&(r+=`rotate(${u}deg) `),d&&(r+=`rotateX(${d}deg) `),f&&(r+=`rotateY(${f}deg) `),h&&(r+=`skewX(${h}deg) `),S&&(r+=`skewY(${S}deg) `)}const a=e.x.scale*t.x,c=e.y.scale*t.y;return(a!==1||c!==1)&&(r+=`scale(${a}, ${c})`),r||"none"}const Zs=["","X","Y","Z"],nR={visibility:"hidden"},rR=1e3;let oR=0;function Js(e,t,n,r){const{latestValues:o}=t;o[e]&&(n[e]=o[e],t.setStaticValue(e,0),r&&(r[e]=0))}function Pm(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=dm(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:o,layoutId:s}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",ve,!(o||s))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&Pm(r)}function Am({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:o}){return class{constructor(i={},a=t==null?void 0:t()){this.id=oR++,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(aR),this.nodes.forEach(fR),this.nodes.forEach(hR),this.nodes.forEach(cR)},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 c=0;c<this.path.length;c++)this.path[c].shouldResetTransform=!0;this.root===this&&(this.nodes=new HM)}addEventListener(i,a){return this.eventHandlers.has(i)||this.eventHandlers.set(i,new Za),this.eventHandlers.get(i).add(a)}notifyListeners(i,...a){const c=this.eventHandlers.get(i);c&&c.notify(...a)}hasListeners(i){return this.eventHandlers.has(i)}mount(i){if(this.instance)return;this.isSVG=Xp(i)&&!oE(i),this.instance=i;const{layoutId:a,layout:c,visualElement:l}=this.options;if(l&&!l.current&&l.mount(i),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(c||a)&&(this.isLayoutDirty=!0),e){let u;const d=()=>this.root.updateBlockedByResize=!1;e(i,()=>{this.root.updateBlockedByResize=!0,u&&u(),u=UM(d,250),To.hasAnimatedSinceResize&&(To.hasAnimatedSinceResize=!1,this.nodes.forEach($u))})}a&&this.root.registerSharedNode(a,this),this.options.animate!==!1&&l&&(a||c)&&this.addEventListener("didUpdate",({delta:u,hasLayoutChanged:d,hasRelativeLayoutChanged:f,layout:h})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const S=this.options.transition||l.getDefaultTransition()||yR,{onLayoutAnimationStart:m,onLayoutAnimationComplete:w}=l.getProps(),y=!this.targetLayout||!Rm(this.targetLayout,h),p=!d&&f;if(this.options.layoutRoot||this.resumeFrom||p||d&&(y||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(u,p);const g={...dc(S,"layout"),onPlay:m,onComplete:w};(l.shouldReduceMotion||this.options.layoutRoot)&&(g.delay=0,g.type=!1),this.startAnimation(g)}else d||$u(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(),zt(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(pR),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&&Pm(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:c}=this.options;if(a===void 0&&!c)return;const l=this.getTransformTemplate();this.prevTransformTemplateValue=l?l(this.latestValues,""):void 0,this.updateSnapshot(),i&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(Fu);return}this.isUpdating||this.nodes.forEach(uR),this.isUpdating=!1,this.nodes.forEach(dR),this.nodes.forEach(sR),this.nodes.forEach(iR),this.clearAllSnapshots();const a=je.now();De.delta=wt(0,1e3/60,a-De.timestamp),De.timestamp=a,De.isProcessing=!0,Ws.update.process(De),Ws.preRender.process(De),Ws.render.process(De),De.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,hc.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(lR),this.sharedNodes.forEach(mR)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,ve.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){ve.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!ke(this.snapshot.measuredBox.x)&&!ke(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 c=0;c<this.path.length;c++)this.path[c].updateScroll();const i=this.layout;this.layout=this.measure(!1),this.layoutCorrected=xe(),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 c=r(this.instance);this.scroll={animationId:this.root.animationId,phase:i,isRoot:c,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:c}}}resetTransform(){if(!o)return;const i=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,a=this.projectionDelta&&!Mm(this.projectionDelta),c=this.getTransformTemplate(),l=c?c(this.latestValues,""):void 0,u=l!==this.prevTransformTemplateValue;i&&this.instance&&(a||Qt(this.latestValues)||u)&&(o(this.instance,l),this.shouldResetTransform=!1,this.scheduleRender())}measure(i=!0){const a=this.measurePageBox();let c=this.removeElementScroll(a);return i&&(c=this.removeTransform(c)),bR(c),{animationId:this.root.animationId,measuredBox:a,layoutBox:c,latestValues:{},source:this.id}}measurePageBox(){var l;const{visualElement:i}=this.options;if(!i)return xe();const a=i.measureViewportBox();if(!(((l=this.scroll)==null?void 0:l.wasRoot)||this.path.some(xR))){const{scroll:u}=this.root;u&&(Dn(a.x,u.offset.x),Dn(a.y,u.offset.y))}return a}removeElementScroll(i){var c;const a=xe();if(Ye(a,i),(c=this.scroll)!=null&&c.wasRoot)return a;for(let l=0;l<this.path.length;l++){const u=this.path[l],{scroll:d,options:f}=u;u!==this.root&&d&&f.layoutScroll&&(d.wasRoot&&Ye(a,i),Dn(a.x,d.offset.x),Dn(a.y,d.offset.y))}return a}applyTransform(i,a=!1){const c=xe();Ye(c,i);for(let l=0;l<this.path.length;l++){const u=this.path[l];!a&&u.options.layoutScroll&&u.scroll&&u!==u.root&&En(c,{x:-u.scroll.offset.x,y:-u.scroll.offset.y}),Qt(u.latestValues)&&En(c,u.latestValues)}return Qt(this.latestValues)&&En(c,this.latestValues),c}removeTransform(i){const a=xe();Ye(a,i);for(let c=0;c<this.path.length;c++){const l=this.path[c];if(!l.instance||!Qt(l.latestValues))continue;Ki(l.latestValues)&&l.updateSnapshot();const u=xe(),d=l.measurePageBox();Ye(u,d),_u(a,l.latestValues,l.snapshot?l.snapshot.layoutBox:void 0,u)}return Qt(this.latestValues)&&_u(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!==De.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 c=!!this.resumingFrom||this!==a;if(!(i||c&&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=De.timestamp,!this.targetDelta&&!this.relativeTarget){const h=this.getClosestProjectingParent();h&&h.layout&&this.animationProgress!==1?(this.relativeParent=h,this.forceRelativeParentToResolveTarget(),this.relativeTarget=xe(),this.relativeTargetOrigin=xe(),gr(this.relativeTargetOrigin,this.layout.layoutBox,h.layout.layoutBox),Ye(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=xe(),this.targetWithTransforms=xe()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),SM(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):Ye(this.target,this.layout.layoutBox),bm(this.target,this.targetDelta)):Ye(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=xe(),this.relativeTargetOrigin=xe(),gr(this.relativeTargetOrigin,this.target,h.target),Ye(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}}}getClosestProjectingParent(){if(!(!this.parent||Ki(this.parent.latestValues)||ym(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 S;const i=this.getLead(),a=!!this.resumingFrom||this!==i;let c=!0;if((this.isProjectionDirty||(S=this.parent)!=null&&S.isProjectionDirty)&&(c=!1),a&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(c=!1),this.resolvedRelativeTargetAt===De.timestamp&&(c=!1),c)return;const{layout:l,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||!(l||u))return;Ye(this.layoutCorrected,this.layout.layoutBox);const d=this.treeScale.x,f=this.treeScale.y;CM(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=xe());const{target:h}=i;if(!h){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(Au(this.prevProjectionDelta.x,this.projectionDelta.x),Au(this.prevProjectionDelta.y,this.projectionDelta.y)),mr(this.projectionDelta,this.layoutCorrected,h,this.latestValues),(this.treeScale.x!==d||this.treeScale.y!==f||!Vu(this.projectionDelta.x,this.prevProjectionDelta.x)||!Vu(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 c=this.getStack();c&&c.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Tn(),this.projectionDelta=Tn(),this.projectionDeltaWithTransform=Tn()}setAnimationOrigin(i,a=!1){const c=this.snapshot,l=c?c.latestValues:{},u={...this.latestValues},d=Tn();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const f=xe(),h=c?c.source:void 0,S=this.layout?this.layout.source:void 0,m=h!==S,w=this.getStack(),y=!w||w.members.length<=1,p=!!(m&&!y&&this.options.crossfade===!0&&!this.path.some(vR));this.animationProgress=0;let g;this.mixTargetDelta=C=>{const v=C/1e3;Bu(d.x,i.x,v),Bu(d.y,i.y,v),this.setTargetDelta(d),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(gr(f,this.layout.layoutBox,this.relativeParent.layout.layoutBox),gR(this.relativeTarget,this.relativeTargetOrigin,f,v),g&&QM(this.relativeTarget,g)&&(this.isProjectionDirty=!1),g||(g=xe()),Ye(g,this.relativeTarget)),m&&(this.animationValues=u,KM(u,l,this.latestValues,v,p,y)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=v},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(i){var a,c,l;this.notifyListeners("animationStart"),(a=this.currentAnimation)==null||a.stop(!1),(l=(c=this.resumingFrom)==null?void 0:c.currentAnimation)==null||l.stop(!1),this.pendingAnimation&&(zt(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=ve.update(()=>{To.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=_n(0)),this.currentAnimation=zM(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(rR),this.currentAnimation.stop(!1)),this.completeAnimation()}applyTransformsToTarget(){const i=this.getLead();let{targetWithTransforms:a,target:c,layout:l,latestValues:u}=i;if(!(!a||!c||!l)){if(this!==i&&this.layout&&l&&Om(this.options.animationType,this.layout.layoutBox,l.layoutBox)){c=this.target||xe();const d=ke(this.layout.layoutBox.x);c.x.min=i.target.x.min,c.x.max=c.x.min+d;const f=ke(this.layout.layoutBox.y);c.y.min=i.target.y.min,c.y.max=c.y.min+f}Ye(a,c),En(a,u),mr(this.projectionDeltaWithTransform,this.layoutCorrected,a,u)}}registerSharedNode(i,a){this.sharedNodes.has(i)||this.sharedNodes.set(i,new eR),this.sharedNodes.get(i).add(a);const l=a.options.initialPromotionConfig;a.promote({transition:l?l.transition:void 0,preserveFollowOpacity:l&&l.shouldPreserveFollowOpacity?l.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:c}={}){const l=this.getStack();l&&l.promote(this,c),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:c}=i;if((c.z||c.rotate||c.rotateX||c.rotateY||c.rotateZ||c.skewX||c.skewY)&&(a=!0),!a)return;const l={};c.z&&Js("z",i,l,this.animationValues);for(let u=0;u<Zs.length;u++)Js(`rotate${Zs[u]}`,i,l,this.animationValues),Js(`skew${Zs[u]}`,i,l,this.animationValues);i.render();for(const u in l)i.setStaticValue(u,l[u]),this.animationValues&&(this.animationValues[u]=l[u]);i.scheduleRender()}getProjectionStyles(i){if(!this.instance||this.isSVG)return;if(!this.isVisible)return nR;const a={visibility:""},c=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,a.opacity="",a.pointerEvents=Co(i==null?void 0:i.pointerEvents)||"",a.transform=c?c(this.latestValues,""):"none",a;const l=this.getLead();if(!this.projectionDelta||!this.layout||!l.target){const h={};return this.options.layoutId&&(h.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,h.pointerEvents=Co(i==null?void 0:i.pointerEvents)||""),this.hasProjected&&!Qt(this.latestValues)&&(h.transform=c?c({},""):"none",this.hasProjected=!1),h}const u=l.animationValues||l.latestValues;this.applyTransformsToTarget(),a.transform=tR(this.projectionDeltaWithTransform,this.treeScale,u),c&&(a.transform=c(u,a.transform));const{x:d,y:f}=this.projectionDelta;a.transformOrigin=`${d.origin*100}% ${f.origin*100}% 0`,l.animationValues?a.opacity=l===this?u.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:u.opacityExit:a.opacity=l===this?u.opacity!==void 0?u.opacity:"":u.opacityExit!==void 0?u.opacityExit:0;for(const h in Rr){if(u[h]===void 0)continue;const{correct:S,applyTo:m,isCSSVariable:w}=Rr[h],y=a.transform==="none"?u[h]:S(u[h],l);if(m){const p=m.length;for(let g=0;g<p;g++)a[m[g]]=y}else w?this.options.visualElement.renderState.vars[h]=y:a[h]=y}return this.options.layoutId&&(a.pointerEvents=l===this?Co(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(Fu),this.root.sharedNodes.clear()}}}function sR(e){e.updateLayout()}function iR(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"?Ke(d=>{const f=i?t.measuredBox[d]:t.layoutBox[d],h=ke(f);f.min=r[d].min,f.max=f.min+h}):Om(s,t.layoutBox,r)&&Ke(d=>{const f=i?t.measuredBox[d]:t.layoutBox[d],h=ke(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=Tn();mr(a,r,t.layoutBox);const c=Tn();i?mr(c,e.applyTransform(o,!0),t.measuredBox):mr(c,r,t.layoutBox);const l=!Mm(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 S=xe();gr(S,t.layoutBox,f.layoutBox);const m=xe();gr(m,r,h.layoutBox),Rm(S,m)||(u=!0),d.options.layoutRoot&&(e.relativeTarget=m,e.relativeTargetOrigin=S,e.relativeParent=d)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:t,delta:c,layoutDelta:a,hasLayoutChanged:l,hasRelativeLayoutChanged:u})}else if(e.isLead()){const{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function aR(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 cR(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function lR(e){e.clearSnapshot()}function Fu(e){e.clearMeasurements()}function uR(e){e.isLayoutDirty=!1}function dR(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function $u(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function fR(e){e.resolveTargetDelta()}function hR(e){e.calcProjection()}function pR(e){e.resetSkewAndRotation()}function mR(e){e.removeLeadSnapshot()}function Bu(e,t,n){e.translate=ge(t.translate,0,n),e.scale=ge(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function zu(e,t,n,r){e.min=ge(t.min,n.min,r),e.max=ge(t.max,n.max,r)}function gR(e,t,n,r){zu(e.x,t.x,n.x,r),zu(e.y,t.y,n.y,r)}function vR(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const yR={duration:.45,ease:[.4,0,.1,1]},Wu=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),Hu=Wu("applewebkit/")&&!Wu("chrome/")?Math.round:Xe;function Uu(e){e.min=Hu(e.min),e.max=Hu(e.max)}function bR(e){Uu(e.x),Uu(e.y)}function Om(e,t,n){return e==="position"||e==="preserve-aspect"&&!wM(Lu(t),Lu(n),.2)}function xR(e){var t;return e!==e.root&&((t=e.scroll)==null?void 0:t.wasRoot)}const wR=Am({attachResizeListener:(e,t)=>Ar(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),Qs={current:void 0},km=Am({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Qs.current){const e=new wR({});e.mount(window),e.setOptions({layoutScroll:!0}),Qs.current=e}return Qs.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),SR={pan:{Feature:VM},drag:{Feature:LM,ProjectionNode:km,MeasureLayout:Tm}};function Yu(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&&ve.postRender(()=>s(t,Gr(t)))}class CR extends Yt{mount(){const{current:t}=this.node;t&&(this.unmount=QD(t,(n,r)=>(Yu(this.node,r,"Start"),o=>Yu(this.node,o,"End"))))}unmount(){}}class TR extends Yt{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=Ur(Ar(this.node.current,"focus",()=>this.onFocus()),Ar(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function Ku(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&&ve.postRender(()=>s(t,Gr(t)))}class DR extends Yt{mount(){const{current:t}=this.node;t&&(this.unmount=rE(t,(n,r)=>(Ku(this.node,r,"Start"),(o,{success:s})=>Ku(this.node,o,s?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const Xi=new WeakMap,ei=new WeakMap,ER=e=>{const t=Xi.get(e.target);t&&t(e)},MR=e=>{e.forEach(ER)};function RR({root:e,...t}){const n=e||document;ei.has(n)||ei.set(n,{});const r=ei.get(n),o=JSON.stringify(t);return r[o]||(r[o]=new IntersectionObserver(MR,{root:e,...t})),r[o]}function PR(e,t,n){const r=RR(t);return Xi.set(e,n),r.observe(e),()=>{Xi.delete(e),r.unobserve(e)}}const AR={some:0,all:1};class OR extends Yt{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:AR[o]},a=c=>{const{isIntersecting:l}=c;if(this.isInView===l||(this.isInView=l,s&&!l&&this.hasEnteredView))return;l&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",l);const{onViewportEnter:u,onViewportLeave:d}=this.node.getProps(),f=l?u:d;f&&f(c)};return PR(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(kR(t,n))&&this.startObserver()}unmount(){}}function kR({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const _R={inView:{Feature:OR},tap:{Feature:DR},focus:{Feature:TR},hover:{Feature:CR}},NR={layout:{ProjectionNode:km,MeasureLayout:Tm}},Zi={current:null},_m={current:!1};function IR(){if(_m.current=!0,!!Ya)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>Zi.current=e.matches;e.addListener(t),t()}else Zi.current=!1}const jR=new WeakMap;function LR(e,t,n){for(const r in t){const o=t[r],s=n[r];if(Pe(o))e.addValue(r,o);else if(Pe(s))e.addValue(r,_n(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,_n(i!==void 0?i:o,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const Gu=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class VR{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=uc,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=je.now();this.renderScheduledAt<f&&(this.renderScheduledAt=f,ve.render(this.render,!1,!0))};const{latestValues:c,renderState:l}=i;this.latestValues=c,this.baseTarget={...c},this.initialValues=n.initial?{...c}:{},this.renderState=l,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=gs(n),this.isVariantNode=em(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];c[f]!==void 0&&Pe(h)&&h.set(c[f],!1)}}mount(t){this.current=t,jR.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)),_m.current||IR(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:Zi.current,process.env.NODE_ENV!=="production"&&Ja(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(),zt(this.notifyUpdate),zt(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=Yn.has(t);r&&this.onBindTransform&&this.onBindTransform();const o=n.on("change",a=>{this.latestValues[t]=a,this.props.onUpdate&&ve.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 Nn){const n=Nn[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):xe()}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<Gu.length;r++){const o=Gu[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=LR(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=_n(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"&&(ap(r)||lp(r))?r=parseFloat(r):!iE(r)&&Wt.test(n)&&(r=Up(t,n)),this.setBaseTarget(t,Pe(r)?r.get():r)),Pe(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=wc(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&&!Pe(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 Za),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}}class Nm extends VR{constructor(){super(...arguments),this.KeyframeResolver=GD}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;Pe(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function Im(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 FR(e){return window.getComputedStyle(e)}class $R extends Nm{constructor(){super(...arguments),this.type="html",this.renderInstance=Im}readValueFromInstance(t,n){var r;if(Yn.has(n))return(r=this.projection)!=null&&r.isProjecting?Vi(n):fD(t,n);{const o=FR(t),s=(tc(n)?o.getPropertyValue(n):o[n])||0;return typeof s=="string"?s.trim():s}}measureInstanceViewportBox(t,{transformPagePoint:n}){return xm(t,n)}build(t,n,r){yc(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return Sc(t,n,r)}}const jm=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 BR(e,t,n,r){Im(e,t,void 0,r);for(const o in t.attrs)e.setAttribute(jm.has(o)?o:vc(o),t.attrs[o])}class zR extends Nm{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=xe}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(Yn.has(n)){const r=Hp(n);return r&&r.default||0}return n=jm.has(n)?n:vc(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return um(t,n,r)}build(t,n,r){im(t,n,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(t,n,r,o){BR(t,n,r,o)}mount(t){this.isSVGTag=cm(t.tagName),super.mount(t)}}const WR=(e,t)=>xc(e)?new zR(t):new $R(t,{allowProjection:e!==E.Fragment}),HR=BE({...hM,..._R,...SR,...NR},WR),UR=fE(HR),YR=({children:e})=>x.jsx(Vy,{modifiers:[cT],dropAnimation:{duration:500,easing:"cubic-bezier(0.18, 0.67, 0.6, 1.22)"},className:"Draggable dragging",children:x.jsx(UR.div,{style:{height:"100%",width:"100%"},initial:{scale:.7,opacity:0},animate:{scale:1,opacity:1},transition:{duration:.4,ease:[.22,1,.36,1],mass:.5},children:e})}),Tc=Yo(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}))}})),KR=-Math.abs(1.98),Lm=({booking:e,onAddTime:t,onAddStartTime:n,onSubTime:r,starter:o=!1})=>{const[s,i]=E.useState({height:jt,width:jt}),[a,c]=E.useState(0),l=(M,b)=>{const T=Z.timeDiffInSeconds(M,b),R=Math.ceil(T/li);return-Math.abs((R-1)*2)},[u,d]=E.useState(o?l(e.finishAt,e.startAt):0),f=M=>M===-Math.abs(0)||M===0,h=()=>Z.timeDiffInSeconds(e.finishAt,e.startAt)===li,S=async M=>{if(M.includes("n")){const b=y(e.startAt,"add");if(h())return;c(T=>T+2),n&&n(b)}else{const b=w(e.finishAt,"add");d(T=>f(T)?KR:T-2),t&&t(b)}},m=async M=>{if(M.includes("n")){const T=y(e.startAt,"remove");c(R=>R-2),n&&n(T);return}const b=w(e.finishAt,"remove");h()||(d(T=>T+2),r&&r(b))},w=(M,b)=>{const T=new Date(M),R=T.getMinutes();return b==="add"&&T.setMinutes(R+15),b==="remove"&&T.setMinutes(R-15),T},y=(M,b)=>{const T=new Date(M),R=T.getMinutes();return b==="add"&&T.setMinutes(R+15),b==="remove"&&T.setMinutes(R-15),T};return{state:s,setState:i,resetState:()=>{i({height:jt,width:jt})},resetHeightStyle:()=>{d(0)},heightStyle:u,topHeightIncrement:a,onResize:(M,{size:b,handle:T})=>{switch(M.stopPropagation(),M.preventDefault(),T){case"se":case"s":{i(R=>(Number(R.height)<Number(b.height)&&S(["s","se"]),Number(R.height)>Number(b.height)&&m(["s","se"]),{...R,height:b.height}));break}case"n":{i(R=>Math.abs(Number(b.height-Number(R.height)))<10?{...R,height:b.height}:(+(R.height<Number(b.height))&&m(["n"]),+(R.height>Number(b.height))&&S(["n"]),{...R,height:b.height}));break}}},updateHeightStyle:(M,b)=>{d(l(M,b))}}};var Dc="Popover",[Vm,hO]=Ht(Dc,[Ut]),qr=Ut(),[GR,Kt]=Vm(Dc),Fm=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:o,onOpenChange:s,modal:i=!1}=e,a=qr(t),c=D.useRef(null),[l,u]=D.useState(!1),[d=!1,f]=un({prop:r,defaultProp:o,onChange:s});return x.jsx(ns,{...a,children:x.jsx(GR,{scope:t,contentId:Vt(),triggerRef:c,open:d,onOpenChange:f,onOpenToggle:D.useCallback(()=>f(h=>!h),[f]),hasCustomAnchor:l,onCustomAnchorAdd:D.useCallback(()=>u(!0),[]),onCustomAnchorRemove:D.useCallback(()=>u(!1),[]),modal:i,children:n})})};Fm.displayName=Dc;var $m="PopoverAnchor",Bm=D.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=Kt($m,n),s=qr(n),{onCustomAnchorAdd:i,onCustomAnchorRemove:a}=o;return D.useEffect(()=>(i(),()=>a()),[i,a]),x.jsx(Fr,{...s,...r,ref:t})});Bm.displayName=$m;var zm="PopoverTrigger",Wm=D.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=Kt(zm,n),s=qr(n),i=fe(t,o.triggerRef),a=x.jsx(ae.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":Gm(o.open),...r,ref:i,onClick:te(e.onClick,o.onOpenToggle)});return o.hasCustomAnchor?a:x.jsx(Fr,{asChild:!0,...s,children:a})});Wm.displayName=zm;var Ec="PopoverPortal",[qR,XR]=Vm(Ec,{forceMount:void 0}),Hm=e=>{const{__scopePopover:t,forceMount:n,children:r,container:o}=e,s=Kt(Ec,t);return x.jsx(qR,{scope:t,forceMount:n,children:x.jsx(Dt,{present:n||s.open,children:x.jsx($r,{asChild:!0,container:o,children:r})})})};Hm.displayName=Ec;var In="PopoverContent",Um=D.forwardRef((e,t)=>{const n=XR(In,e.__scopePopover),{forceMount:r=n.forceMount,...o}=e,s=Kt(In,e.__scopePopover);return x.jsx(Dt,{present:r||s.open,children:s.modal?x.jsx(JR,{...o,ref:t}):x.jsx(QR,{...o,ref:t})})});Um.displayName=In;var ZR=an("PopoverContent.RemoveScroll"),JR=D.forwardRef((e,t)=>{const n=Kt(In,e.__scopePopover),r=D.useRef(null),o=fe(t,r),s=D.useRef(!1);return D.useEffect(()=>{const i=r.current;if(i)return Na(i)},[]),x.jsx(ds,{as:ZR,allowPinchZoom:!0,children:x.jsx(Ym,{...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,c=a.button===0&&a.ctrlKey===!0,l=a.button===2||c;s.current=l},{checkForDefaultPrevented:!1}),onFocusOutside:te(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1})})})}),QR=D.forwardRef((e,t)=>{const n=Kt(In,e.__scopePopover),r=D.useRef(!1),o=D.useRef(!1);return x.jsx(Ym,{...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 c,l;(c=e.onInteractOutside)==null||c.call(e,s),s.defaultPrevented||(r.current=!0,s.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const i=s.target;((l=n.triggerRef.current)==null?void 0:l.contains(i))&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&o.current&&s.preventDefault()}})}),Ym=D.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:s,disableOutsidePointerEvents:i,onEscapeKeyDown:a,onPointerDownOutside:c,onFocusOutside:l,onInteractOutside:u,...d}=e,f=Kt(In,n),h=qr(n);return _a(),x.jsx(cs,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:s,children:x.jsx(Lr,{asChild:!0,disableOutsidePointerEvents:i,onInteractOutside:u,onEscapeKeyDown:a,onPointerDownOutside:c,onFocusOutside:l,onDismiss:()=>f.onOpenChange(!1),children:x.jsx(rs,{"data-state":Gm(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)"}})})})}),Km="PopoverClose",eP=D.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=Kt(Km,n);return x.jsx(ae.button,{type:"button",...r,ref:t,onClick:te(e.onClick,()=>o.onOpenChange(!1))})});eP.displayName=Km;var tP="PopoverArrow",nP=D.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=qr(n);return x.jsx(os,{...o,...r,ref:t})});nP.displayName=tP;function Gm(e){return e?"open":"closed"}var rP=Fm,oP=Bm,sP=Wm,iP=Hm,aP=Um;function cP({...e}){return x.jsx(rP,{"data-slot":"popover",...e})}function lP({...e}){return x.jsx(sP,{"data-slot":"popover-trigger",...e})}function uP({className:e,align:t="center",sideOffset:n=4,...r}){return x.jsx(iP,{children:x.jsx(aP,{"data-slot":"popover-content",align:t,sideOffset:n,className:ce("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 dP({...e}){return x.jsx(oP,{"data-slot":"popover-anchor",...e})}var fP="Toggle",qm=D.forwardRef((e,t)=>{const{pressed:n,defaultPressed:r=!1,onPressedChange:o,...s}=e,[i=!1,a]=un({prop:n,onChange:o,defaultProp:r});return x.jsx(ae.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)})})});qm.displayName=fP;var hP=qm;const pP=ma("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 mP({className:e,variant:t,size:n,...r}){return x.jsx(hP,{"data-slot":"toggle",className:ce(pP({variant:t,size:n,className:e})),...r})}const gP=()=>{const[e,t]=E.useState(!1);return x.jsx(Ra,{children:x.jsxs(nh,{children:[x.jsx(rh,{asChild:!0,children:x.jsx("div",{children:x.jsx(mP,{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:x.jsx(Gy,{size:16,strokeWidth:2,"aria-hidden":"true"})})})}),x.jsx(oh,{className:"border border-input bg-popover px-2 py-1 text-xs text-muted-foreground",children:x.jsx("p",{children:e?"Remove bookmark":"Bookmark this"})})]})})};function qu(e,[t,n]){return Math.min(n,Math.max(t,e))}function vP(e){const t=D.useRef({value:e,previous:e});return D.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var yP=[" ","Enter","ArrowUp","ArrowDown"],bP=[" ","Enter"],Xr="Select",[vs,ys,xP]=Oa(Xr),[Kn,pO]=Ht(Xr,[xP,Ut]),bs=Ut(),[wP,Gt]=Kn(Xr),[SP,CP]=Kn(Xr),Xm=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:o,onOpenChange:s,value:i,defaultValue:a,onValueChange:c,dir:l,name:u,autoComplete:d,disabled:f,required:h,form:S}=e,m=bs(t),[w,y]=D.useState(null),[p,g]=D.useState(null),[C,v]=D.useState(!1),M=ka(l),[b=!1,T]=un({prop:r,defaultProp:o,onChange:s}),[R,k]=un({prop:i,defaultProp:a,onChange:c}),A=D.useRef(null),z=w?S||!!w.closest("form"):!0,[G,j]=D.useState(new Set),F=Array.from(G).map(_=>_.props.value).join(";");return x.jsx(ns,{...m,children:x.jsxs(wP,{required:h,scope:t,trigger:w,onTriggerChange:y,valueNode:p,onValueNodeChange:g,valueNodeHasChildren:C,onValueNodeHasChildrenChange:v,contentId:Vt(),value:R,onValueChange:k,open:b,onOpenChange:T,dir:M,triggerPointerDownPosRef:A,disabled:f,children:[x.jsx(vs.Provider,{scope:t,children:x.jsx(SP,{scope:e.__scopeSelect,onNativeOptionAdd:D.useCallback(_=>{j(N=>new Set(N).add(_))},[]),onNativeOptionRemove:D.useCallback(_=>{j(N=>{const P=new Set(N);return P.delete(_),P})},[]),children:n})}),z?x.jsxs(bg,{"aria-hidden":!0,required:h,tabIndex:-1,name:u,autoComplete:d,value:R,onChange:_=>k(_.target.value),disabled:f,form:S,children:[R===void 0?x.jsx("option",{value:""}):null,Array.from(G)]},F):null]})})};Xm.displayName=Xr;var Zm="SelectTrigger",Jm=D.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...o}=e,s=bs(n),i=Gt(Zm,n),a=i.disabled||r,c=fe(t,i.onTriggerChange),l=ys(n),u=D.useRef("touch"),[d,f,h]=xg(m=>{const w=l().filter(g=>!g.disabled),y=w.find(g=>g.value===i.value),p=wg(w,m,y);p!==void 0&&i.onValueChange(p.value)}),S=m=>{a||(i.onOpenChange(!0),h()),m&&(i.triggerPointerDownPosRef.current={x:Math.round(m.pageX),y:Math.round(m.pageY)})};return x.jsx(Fr,{asChild:!0,...s,children:x.jsx(ae.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":yg(i.value)?"":void 0,...o,ref:c,onClick:te(o.onClick,m=>{m.currentTarget.focus(),u.current!=="mouse"&&S(m)}),onPointerDown:te(o.onPointerDown,m=>{u.current=m.pointerType;const w=m.target;w.hasPointerCapture(m.pointerId)&&w.releasePointerCapture(m.pointerId),m.button===0&&m.ctrlKey===!1&&m.pointerType==="mouse"&&(S(m),m.preventDefault())}),onKeyDown:te(o.onKeyDown,m=>{const w=d.current!=="";!(m.ctrlKey||m.altKey||m.metaKey)&&m.key.length===1&&f(m.key),!(w&&m.key===" ")&&yP.includes(m.key)&&(S(),m.preventDefault())})})})});Jm.displayName=Zm;var Qm="SelectValue",eg=D.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,children:s,placeholder:i="",...a}=e,c=Gt(Qm,n),{onValueNodeHasChildrenChange:l}=c,u=s!==void 0,d=fe(t,c.onValueNodeChange);return _e(()=>{l(u)},[l,u]),x.jsx(ae.span,{...a,ref:d,style:{pointerEvents:"none"},children:yg(c.value)?x.jsx(x.Fragment,{children:i}):s})});eg.displayName=Qm;var TP="SelectIcon",tg=D.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...o}=e;return x.jsx(ae.span,{"aria-hidden":!0,...o,ref:t,children:r||"▼"})});tg.displayName=TP;var DP="SelectPortal",ng=e=>x.jsx($r,{asChild:!0,...e});ng.displayName=DP;var dn="SelectContent",rg=D.forwardRef((e,t)=>{const n=Gt(dn,e.__scopeSelect),[r,o]=D.useState();if(_e(()=>{o(new DocumentFragment)},[]),!n.open){const s=r;return s?Ho.createPortal(x.jsx(og,{scope:e.__scopeSelect,children:x.jsx(vs.Slot,{scope:e.__scopeSelect,children:x.jsx("div",{children:e.children})})}),s):null}return x.jsx(sg,{...e,ref:t})});rg.displayName=dn;var Qe=10,[og,qt]=Kn(dn),EP="SelectContentImpl",MP=an("SelectContent.RemoveScroll"),sg=D.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:s,onPointerDownOutside:i,side:a,sideOffset:c,align:l,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:h,sticky:S,hideWhenDetached:m,avoidCollisions:w,...y}=e,p=Gt(dn,n),[g,C]=D.useState(null),[v,M]=D.useState(null),b=fe(t,$=>C($)),[T,R]=D.useState(null),[k,A]=D.useState(null),z=ys(n),[G,j]=D.useState(!1),F=D.useRef(!1);D.useEffect(()=>{if(g)return Na(g)},[g]),_a();const _=D.useCallback($=>{const[q,...X]=z().map(B=>B.ref.current),[U]=X.slice(-1),ne=document.activeElement;for(const B of $)if(B===ne||(B==null||B.scrollIntoView({block:"nearest"}),B===q&&v&&(v.scrollTop=0),B===U&&v&&(v.scrollTop=v.scrollHeight),B==null||B.focus(),document.activeElement!==ne))return},[z,v]),N=D.useCallback(()=>_([T,g]),[_,T,g]);D.useEffect(()=>{G&&N()},[G,N]);const{onOpenChange:P,triggerPointerDownPosRef:I}=p;D.useEffect(()=>{if(g){let $={x:0,y:0};const q=U=>{var ne,B;$={x:Math.abs(Math.round(U.pageX)-(((ne=I.current)==null?void 0:ne.x)??0)),y:Math.abs(Math.round(U.pageY)-(((B=I.current)==null?void 0:B.y)??0))}},X=U=>{$.x<=10&&$.y<=10?U.preventDefault():g.contains(U.target)||P(!1),document.removeEventListener("pointermove",q),I.current=null};return I.current!==null&&(document.addEventListener("pointermove",q),document.addEventListener("pointerup",X,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",q),document.removeEventListener("pointerup",X,{capture:!0})}}},[g,P,I]),D.useEffect(()=>{const $=()=>P(!1);return window.addEventListener("blur",$),window.addEventListener("resize",$),()=>{window.removeEventListener("blur",$),window.removeEventListener("resize",$)}},[P]);const[O,V]=xg($=>{const q=z().filter(ne=>!ne.disabled),X=q.find(ne=>ne.ref.current===document.activeElement),U=wg(q,$,X);U&&setTimeout(()=>U.ref.current.focus())}),W=D.useCallback(($,q,X)=>{const U=!F.current&&!X;(p.value!==void 0&&p.value===q||U)&&(R($),U&&(F.current=!0))},[p.value]),H=D.useCallback(()=>g==null?void 0:g.focus(),[g]),L=D.useCallback(($,q,X)=>{const U=!F.current&&!X;(p.value!==void 0&&p.value===q||U)&&A($)},[p.value]),Y=r==="popper"?Ji:ig,K=Y===Ji?{side:a,sideOffset:c,align:l,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:h,sticky:S,hideWhenDetached:m,avoidCollisions:w}:{};return x.jsx(og,{scope:n,content:g,viewport:v,onViewportChange:M,itemRefCallback:W,selectedItem:T,onItemLeave:H,itemTextRefCallback:L,focusSelectedItem:N,selectedItemText:k,position:r,isPositioned:G,searchRef:O,children:x.jsx(ds,{as:MP,allowPinchZoom:!0,children:x.jsx(cs,{asChild:!0,trapped:p.open,onMountAutoFocus:$=>{$.preventDefault()},onUnmountAutoFocus:te(o,$=>{var q;(q=p.trigger)==null||q.focus({preventScroll:!0}),$.preventDefault()}),children:x.jsx(Lr,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:$=>$.preventDefault(),onDismiss:()=>p.onOpenChange(!1),children:x.jsx(Y,{role:"listbox",id:p.contentId,"data-state":p.open?"open":"closed",dir:p.dir,onContextMenu:$=>$.preventDefault(),...y,...K,onPlaced:()=>j(!0),ref:b,style:{display:"flex",flexDirection:"column",outline:"none",...y.style},onKeyDown:te(y.onKeyDown,$=>{const q=$.ctrlKey||$.altKey||$.metaKey;if($.key==="Tab"&&$.preventDefault(),!q&&$.key.length===1&&V($.key),["ArrowUp","ArrowDown","Home","End"].includes($.key)){let U=z().filter(ne=>!ne.disabled).map(ne=>ne.ref.current);if(["ArrowUp","End"].includes($.key)&&(U=U.slice().reverse()),["ArrowUp","ArrowDown"].includes($.key)){const ne=$.target,B=U.indexOf(ne);U=U.slice(B+1)}setTimeout(()=>_(U)),$.preventDefault()}})})})})})})});sg.displayName=EP;var RP="SelectItemAlignedPosition",ig=D.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...o}=e,s=Gt(dn,n),i=qt(dn,n),[a,c]=D.useState(null),[l,u]=D.useState(null),d=fe(t,b=>u(b)),f=ys(n),h=D.useRef(!1),S=D.useRef(!0),{viewport:m,selectedItem:w,selectedItemText:y,focusSelectedItem:p}=i,g=D.useCallback(()=>{if(s.trigger&&s.valueNode&&a&&l&&m&&w&&y){const b=s.trigger.getBoundingClientRect(),T=l.getBoundingClientRect(),R=s.valueNode.getBoundingClientRect(),k=y.getBoundingClientRect();if(s.dir!=="rtl"){const ne=k.left-T.left,B=R.left-ne,ie=b.left-B,pe=b.width+ie,Oe=Math.max(pe,T.width),Ee=window.innerWidth-Qe,ot=qu(B,[Qe,Math.max(Qe,Ee-Oe)]);a.style.minWidth=pe+"px",a.style.left=ot+"px"}else{const ne=T.right-k.right,B=window.innerWidth-R.right-ne,ie=window.innerWidth-b.right-B,pe=b.width+ie,Oe=Math.max(pe,T.width),Ee=window.innerWidth-Qe,ot=qu(B,[Qe,Math.max(Qe,Ee-Oe)]);a.style.minWidth=pe+"px",a.style.right=ot+"px"}const A=f(),z=window.innerHeight-Qe*2,G=m.scrollHeight,j=window.getComputedStyle(l),F=parseInt(j.borderTopWidth,10),_=parseInt(j.paddingTop,10),N=parseInt(j.borderBottomWidth,10),P=parseInt(j.paddingBottom,10),I=F+_+G+P+N,O=Math.min(w.offsetHeight*5,I),V=window.getComputedStyle(m),W=parseInt(V.paddingTop,10),H=parseInt(V.paddingBottom,10),L=b.top+b.height/2-Qe,Y=z-L,K=w.offsetHeight/2,$=w.offsetTop+K,q=F+_+$,X=I-q;if(q<=L){const ne=A.length>0&&w===A[A.length-1].ref.current;a.style.bottom="0px";const B=l.clientHeight-m.offsetTop-m.offsetHeight,ie=Math.max(Y,K+(ne?H:0)+B+N),pe=q+ie;a.style.height=pe+"px"}else{const ne=A.length>0&&w===A[0].ref.current;a.style.top="0px";const ie=Math.max(L,F+m.offsetTop+(ne?W:0)+K)+X;a.style.height=ie+"px",m.scrollTop=q-L+m.offsetTop}a.style.margin=`${Qe}px 0`,a.style.minHeight=O+"px",a.style.maxHeight=z+"px",r==null||r(),requestAnimationFrame(()=>h.current=!0)}},[f,s.trigger,s.valueNode,a,l,m,w,y,s.dir,r]);_e(()=>g(),[g]);const[C,v]=D.useState();_e(()=>{l&&v(window.getComputedStyle(l).zIndex)},[l]);const M=D.useCallback(b=>{b&&S.current===!0&&(g(),p==null||p(),S.current=!1)},[g,p]);return x.jsx(AP,{scope:n,contentWrapper:a,shouldExpandOnScrollRef:h,onScrollButtonChange:M,children:x.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:C},children:x.jsx(ae.div,{...o,ref:d,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});ig.displayName=RP;var PP="SelectPopperPosition",Ji=D.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:o=Qe,...s}=e,i=bs(n);return x.jsx(rs,{...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)"}})});Ji.displayName=PP;var[AP,Mc]=Kn(dn,{}),Qi="SelectViewport",ag=D.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...o}=e,s=qt(Qi,n),i=Mc(Qi,n),a=fe(t,s.onViewportChange),c=D.useRef(0);return x.jsxs(x.Fragment,{children:[x.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}),x.jsx(vs.Slot,{scope:n,children:x.jsx(ae.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:a,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:te(o.onScroll,l=>{const u=l.currentTarget,{contentWrapper:d,shouldExpandOnScrollRef:f}=i;if(f!=null&&f.current&&d){const h=Math.abs(c.current-u.scrollTop);if(h>0){const S=window.innerHeight-Qe*2,m=parseFloat(d.style.minHeight),w=parseFloat(d.style.height),y=Math.max(m,w);if(y<S){const p=y+h,g=Math.min(S,p),C=p-g;d.style.height=g+"px",d.style.bottom==="0px"&&(u.scrollTop=C>0?C:0,d.style.justifyContent="flex-end")}}}c.current=u.scrollTop})})})]})});ag.displayName=Qi;var cg="SelectGroup",[OP,kP]=Kn(cg),_P=D.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Vt();return x.jsx(OP,{scope:n,id:o,children:x.jsx(ae.div,{role:"group","aria-labelledby":o,...r,ref:t})})});_P.displayName=cg;var lg="SelectLabel",NP=D.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=kP(lg,n);return x.jsx(ae.div,{id:o.id,...r,ref:t})});NP.displayName=lg;var Wo="SelectItem",[IP,ug]=Kn(Wo),dg=D.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:o=!1,textValue:s,...i}=e,a=Gt(Wo,n),c=qt(Wo,n),l=a.value===r,[u,d]=D.useState(s??""),[f,h]=D.useState(!1),S=fe(t,p=>{var g;return(g=c.itemRefCallback)==null?void 0:g.call(c,p,r,o)}),m=Vt(),w=D.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 x.jsx(IP,{scope:n,value:r,disabled:o,textId:m,isSelected:l,onItemTextChange:D.useCallback(p=>{d(g=>g||((p==null?void 0:p.textContent)??"").trim())},[]),children:x.jsx(vs.ItemSlot,{scope:n,value:r,disabled:o,textValue:u,children:x.jsx(ae.div,{role:"option","aria-labelledby":m,"data-highlighted":f?"":void 0,"aria-selected":l&&f,"data-state":l?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...i,ref:S,onFocus:te(i.onFocus,()=>h(!0)),onBlur:te(i.onBlur,()=>h(!1)),onClick:te(i.onClick,()=>{w.current!=="mouse"&&y()}),onPointerUp:te(i.onPointerUp,()=>{w.current==="mouse"&&y()}),onPointerDown:te(i.onPointerDown,p=>{w.current=p.pointerType}),onPointerMove:te(i.onPointerMove,p=>{var g;w.current=p.pointerType,o?(g=c.onItemLeave)==null||g.call(c):w.current==="mouse"&&p.currentTarget.focus({preventScroll:!0})}),onPointerLeave:te(i.onPointerLeave,p=>{var g;p.currentTarget===document.activeElement&&((g=c.onItemLeave)==null||g.call(c))}),onKeyDown:te(i.onKeyDown,p=>{var C;((C=c.searchRef)==null?void 0:C.current)!==""&&p.key===" "||(bP.includes(p.key)&&y(),p.key===" "&&p.preventDefault())})})})})});dg.displayName=Wo;var lr="SelectItemText",fg=D.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,...s}=e,i=Gt(lr,n),a=qt(lr,n),c=ug(lr,n),l=CP(lr,n),[u,d]=D.useState(null),f=fe(t,y=>d(y),c.onItemTextChange,y=>{var p;return(p=a.itemTextRefCallback)==null?void 0:p.call(a,y,c.value,c.disabled)}),h=u==null?void 0:u.textContent,S=D.useMemo(()=>x.jsx("option",{value:c.value,disabled:c.disabled,children:h},c.value),[c.disabled,c.value,h]),{onNativeOptionAdd:m,onNativeOptionRemove:w}=l;return _e(()=>(m(S),()=>w(S)),[m,w,S]),x.jsxs(x.Fragment,{children:[x.jsx(ae.span,{id:c.textId,...s,ref:f}),c.isSelected&&i.valueNode&&!i.valueNodeHasChildren?Ho.createPortal(s.children,i.valueNode):null]})});fg.displayName=lr;var hg="SelectItemIndicator",pg=D.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return ug(hg,n).isSelected?x.jsx(ae.span,{"aria-hidden":!0,...r,ref:t}):null});pg.displayName=hg;var ea="SelectScrollUpButton",mg=D.forwardRef((e,t)=>{const n=qt(ea,e.__scopeSelect),r=Mc(ea,e.__scopeSelect),[o,s]=D.useState(!1),i=fe(t,r.onScrollButtonChange);return _e(()=>{if(n.viewport&&n.isPositioned){let a=function(){const l=c.scrollTop>0;s(l)};const c=n.viewport;return a(),c.addEventListener("scroll",a),()=>c.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),o?x.jsx(vg,{...e,ref:i,onAutoScroll:()=>{const{viewport:a,selectedItem:c}=n;a&&c&&(a.scrollTop=a.scrollTop-c.offsetHeight)}}):null});mg.displayName=ea;var ta="SelectScrollDownButton",gg=D.forwardRef((e,t)=>{const n=qt(ta,e.__scopeSelect),r=Mc(ta,e.__scopeSelect),[o,s]=D.useState(!1),i=fe(t,r.onScrollButtonChange);return _e(()=>{if(n.viewport&&n.isPositioned){let a=function(){const l=c.scrollHeight-c.clientHeight,u=Math.ceil(c.scrollTop)<l;s(u)};const c=n.viewport;return a(),c.addEventListener("scroll",a),()=>c.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),o?x.jsx(vg,{...e,ref:i,onAutoScroll:()=>{const{viewport:a,selectedItem:c}=n;a&&c&&(a.scrollTop=a.scrollTop+c.offsetHeight)}}):null});gg.displayName=ta;var vg=D.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...o}=e,s=qt("SelectScrollButton",n),i=D.useRef(null),a=ys(n),c=D.useCallback(()=>{i.current!==null&&(window.clearInterval(i.current),i.current=null)},[]);return D.useEffect(()=>()=>c(),[c]),_e(()=>{var u;const l=a().find(d=>d.ref.current===document.activeElement);(u=l==null?void 0:l.ref.current)==null||u.scrollIntoView({block:"nearest"})},[a]),x.jsx(ae.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 l;(l=s.onItemLeave)==null||l.call(s),i.current===null&&(i.current=window.setInterval(r,50))}),onPointerLeave:te(o.onPointerLeave,()=>{c()})})}),jP="SelectSeparator",LP=D.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return x.jsx(ae.div,{"aria-hidden":!0,...r,ref:t})});LP.displayName=jP;var na="SelectArrow",VP=D.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=bs(n),s=Gt(na,n),i=qt(na,n);return s.open&&i.position==="popper"?x.jsx(os,{...o,...r,ref:t}):null});VP.displayName=na;function yg(e){return e===""||e===void 0}var bg=D.forwardRef((e,t)=>{const{value:n,...r}=e,o=D.useRef(null),s=fe(t,o),i=vP(n);return D.useEffect(()=>{const a=o.current,c=window.HTMLSelectElement.prototype,u=Object.getOwnPropertyDescriptor(c,"value").set;if(i!==n&&u){const d=new Event("change",{bubbles:!0});u.call(a,n),a.dispatchEvent(d)}},[i,n]),x.jsx(Da,{asChild:!0,children:x.jsx("select",{...r,ref:s,defaultValue:n})})});bg.displayName="BubbleSelect";function xg(e){const t=Ze(e),n=D.useRef(""),r=D.useRef(0),o=D.useCallback(i=>{const a=n.current+i;t(a),function c(l){n.current=l,window.clearTimeout(r.current),l!==""&&(r.current=window.setTimeout(()=>c(""),1e3))}(a)},[t]),s=D.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return D.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,o,s]}function wg(e,t,n){const o=t.length>1&&Array.from(t).every(l=>l===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let i=FP(e,Math.max(s,0));o.length===1&&(i=i.filter(l=>l!==n));const c=i.find(l=>l.textValue.toLowerCase().startsWith(o.toLowerCase()));return c!==n?c:void 0}function FP(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var $P=Xm,BP=Jm,zP=eg,WP=tg,HP=ng,UP=rg,YP=ag,KP=dg,GP=fg,qP=pg,XP=mg,ZP=gg;function JP({...e}){return x.jsx($P,{"data-slot":"select",...e})}function QP({...e}){return x.jsx(zP,{"data-slot":"select-value",...e})}function eA({className:e,size:t="default",children:n,...r}){return x.jsxs(BP,{"data-slot":"select-trigger","data-size":t,className:ce("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,x.jsx(WP,{asChild:!0,children:x.jsx(df,{className:"size-4 opacity-50"})})]})}function tA({className:e,children:t,position:n="popper",...r}){return x.jsx(HP,{children:x.jsxs(UP,{"data-slot":"select-content",className:ce("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:[x.jsx(rA,{}),x.jsx(YP,{className:ce("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:t}),x.jsx(oA,{})]})})}function nA({className:e,children:t,...n}){return x.jsxs(KP,{"data-slot":"select-item",className:ce("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:[x.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:x.jsx(qP,{children:x.jsx(uf,{className:"size-4"})})}),x.jsx(GP,{children:t})]})}function rA({className:e,...t}){return x.jsx(XP,{"data-slot":"select-scroll-up-button",className:ce("flex cursor-default items-center justify-center py-1",e),...t,children:x.jsx(ib,{className:"size-4"})})}function oA({className:e,...t}){return x.jsx(ZP,{"data-slot":"select-scroll-down-button",className:ce("flex cursor-default items-center justify-center py-1",e),...t,children:x.jsx(df,{className:"size-4"})})}const sA=({options:e,onChange:t})=>x.jsxs(JP,{onValueChange:n=>t(n),defaultValue:e[1].text,children:[x.jsx(eA,{className:"w-[180px]",children:x.jsx(QP,{placeholder:"view"})}),x.jsx(tA,{children:e.map(n=>x.jsx(nA,{value:n.text,children:n.text},n.text))})]}),iA=[{text:"teste1",onClick:()=>console.log("teste1")},{text:"teste2",onClick:()=>console.log("teste2")}],aA=5,cA=0,lA=({side:e,xAxis:t,yAxis:n,updatePosition:r,children:o})=>{const{attributes:s,listeners:i,setNodeRef:a,transform:c,setActivatorNodeRef:l}=ha({id:"booking-info-id",data:{type:"booking-info-options"}}),u=zn(f=>f.updateIsDragging),d={transform:`translate3d(${t+((c==null?void 0:c.x)||0)}px, ${n+((c==null?void 0:c.y)||0)}px, 0)`};return Nr({onDragStart(){u(!0)},onDragEnd(f){f.active.id&&r(c)}}),x.jsx(uP,{ref:a,updatePositionStrategy:"optimized",side:e,align:"start",sticky:"always",sideOffset:aA,alignOffset:cA,style:{...d,width:"25rem"},children:x.jsxs("div",{className:"grid gap-3",children:[x.jsx("input",{type:"text",style:{position:"absolute",opacity:0,height:0,width:0}}),x.jsxs("div",{className:"flex justify-end gap-1",children:[x.jsx("div",{ref:l,className:"w-full cursor-move",...s,...i}),x.jsx(gP,{}),x.jsx(cn,{type:"button",variant:"outline",size:"icon",children:x.jsx(gb,{className:"h-3 w-3"})}),x.jsx(cn,{type:"button",variant:"outline",size:"icon",onClick:()=>{},children:x.jsx(xb,{className:"h-3 w-3"})}),x.jsx(sA,{options:iA,onChange:()=>{}})]}),o]})})},Xu={xAxis:0,yAxis:0},Sg=({isEditingOpen:e,side:t,booking:n,onOpenChange:r,children:o})=>{const[s,i]=E.useState({...Xu}),a=zn(h=>h.updateIsDragging),c=E.useMemo(()=>`${Z.dateAndHourDateToString(n.startAt)} - ${Z.dateAndHourDateToString(n.finishAt)}`,[n.startAt,n.finishAt]),l=E.useMemo(()=>{const h=new Date(n.startAt),S=h.getDate(),m=h.getDay(),w=Mn[h.getMonth()];return x.jsx("span",{children:`${sv[m]}, ${S} ${w}`})},[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)})};Nr({onDragStart(h){const S=h.active.data.current,m=h.active.id,w=S.type==="booking-info-options";m&&w&&a(!0)}});const f=h=>{h===!1&&i({...Xu}),r(h)};return x.jsxs(cP,{open:e,onOpenChange:f,defaultOpen:!1,children:[x.jsx(dP,{style:{width:"100%"},children:x.jsx(lP,{asChild:!0,children:o})}),x.jsx(fa,{children:x.jsx(lA,{side:t,xAxis:s.xAxis,yAxis:s.yAxis,updatePosition:d,children:x.jsxs("div",{className:"bookingCard_content",children:[x.jsx("span",{style:u(),className:"flex h-4 w-4 translate-y-0 rounded-sm"}),x.jsx("div",{className:"space-y-1",children:x.jsxs("p",{className:"text-sm text-muted-foreground",children:[l," | ",c]})})]})})})]})};Sg.displayName="BookingInfoOptions";var tr={exports:{}},nr={},rr={exports:{}},ti={},lo={exports:{}},uo={exports:{}},ue={};/** @license React v16.13.1
|
|
149
|
+
`)},r0=0,xn=[];function o0(e){var t=D.useRef([]),n=D.useRef([0,0]),r=D.useRef(),o=D.useState(r0++)[0],s=D.useState(fh)[0],i=D.useRef(e);D.useEffect(function(){i.current=e},[e]),D.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var m=DS([e.lockRef.current],(e.shards||[]).map(Dl),!0).filter(Boolean);return m.forEach(function(w){return w.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),m.forEach(function(w){return w.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var a=D.useCallback(function(m,w){if("touches"in m&&m.touches.length===2||m.type==="wheel"&&m.ctrlKey)return!i.current.allowPinchZoom;var g=ro(m),p=n.current,v="deltaX"in m?m.deltaX:p[0]-g[0],C="deltaY"in m?m.deltaY:p[1]-g[1],y,M=m.target,b=Math.abs(v)>Math.abs(C)?"h":"v";if("touches"in m&&b==="h"&&M.type==="range")return!1;var T=Cl(b,M);if(!T)return!0;if(T?y=b:(y=b==="v"?"h":"v",T=Cl(b,M)),!T)return!1;if(!r.current&&"changedTouches"in m&&(v||C)&&(r.current=y),!y)return!0;var R=r.current||y;return e0(R,w,m,R==="h"?v:C)},[]),c=D.useCallback(function(m){var w=m;if(!(!xn.length||xn[xn.length-1]!==s)){var g="deltaY"in w?Tl(w):ro(w),p=t.current.filter(function(y){return y.name===w.type&&(y.target===w.target||w.target===y.shadowParent)&&t0(y.delta,g)})[0];if(p&&p.should){w.cancelable&&w.preventDefault();return}if(!p){var v=(i.current.shards||[]).map(Dl).filter(Boolean).filter(function(y){return y.contains(w.target)}),C=v.length>0?a(w,v[0]):!i.current.noIsolation;C&&w.cancelable&&w.preventDefault()}}},[]),l=D.useCallback(function(m,w,g,p){var v={name:m,delta:w,target:g,should:p,shadowParent:s0(g)};t.current.push(v),setTimeout(function(){t.current=t.current.filter(function(C){return C!==v})},1)},[]),u=D.useCallback(function(m){n.current=ro(m),r.current=void 0},[]),d=D.useCallback(function(m){l(m.type,Tl(m),m.target,a(m,e.lockRef.current))},[]),h=D.useCallback(function(m){l(m.type,ro(m),m.target,a(m,e.lockRef.current))},[]);D.useEffect(function(){return xn.push(s),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:h}),document.addEventListener("wheel",c,bn),document.addEventListener("touchmove",c,bn),document.addEventListener("touchstart",u,bn),function(){xn=xn.filter(function(m){return m!==s}),document.removeEventListener("wheel",c,bn),document.removeEventListener("touchmove",c,bn),document.removeEventListener("touchstart",u,bn)}},[]);var f=e.removeScrollBar,S=e.inert;return D.createElement(D.Fragment,null,S?D.createElement(s,{styles:n0(o)}):null,f?D.createElement(KS,{gapMode:e.gapMode}):null)}function s0(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const i0=NS(dh,o0);var us=D.forwardRef(function(e,t){return D.createElement(ls,ct({},e,{ref:t,sideCar:i0}))});us.classNames=ls.classNames;var Ei=["Enter"," "],a0=["ArrowDown","PageUp","Home"],gh=["ArrowUp","PageDown","End"],c0=[...a0,...gh],l0={ltr:[...Ei,"ArrowRight"],rtl:[...Ei,"ArrowLeft"]},u0={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Br="Menu",[wr,d0,f0]=Ma(Br),[dn,vh]=Ht(Br,[f0,Ut,rh]),ds=Ut(),yh=rh(),[h0,fn]=dn(Br),[p0,zr]=dn(Br),bh=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:o,onOpenChange:s,modal:i=!0}=e,a=ds(t),[c,l]=D.useState(null),u=D.useRef(!1),d=Ze(s),h=Ra(o);return D.useEffect(()=>{const f=()=>{u.current=!0,document.addEventListener("pointerdown",S,{capture:!0,once:!0}),document.addEventListener("pointermove",S,{capture:!0,once:!0})},S=()=>u.current=!1;return document.addEventListener("keydown",f,{capture:!0}),()=>{document.removeEventListener("keydown",f,{capture:!0}),document.removeEventListener("pointerdown",S,{capture:!0}),document.removeEventListener("pointermove",S,{capture:!0})}},[]),x.jsx(es,{...a,children:x.jsx(h0,{scope:t,open:n,onOpenChange:d,content:c,onContentChange:l,children:x.jsx(p0,{scope:t,onClose:D.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:u,dir:h,modal:i,children:r})})})};bh.displayName=Br;var m0="MenuAnchor",Oa=D.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=ds(n);return x.jsx(Vr,{...o,...r,ref:t})});Oa.displayName=m0;var ka="MenuPortal",[g0,xh]=dn(ka,{forceMount:void 0}),wh=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:o}=e,s=fn(ka,t);return x.jsx(g0,{scope:t,forceMount:n,children:x.jsx(Dt,{present:n||s.open,children:x.jsx(Fr,{asChild:!0,container:o,children:r})})})};wh.displayName=ka;var qe="MenuContent",[v0,_a]=dn(qe),Sh=D.forwardRef((e,t)=>{const n=xh(qe,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,s=fn(qe,e.__scopeMenu),i=zr(qe,e.__scopeMenu);return x.jsx(wr.Provider,{scope:e.__scopeMenu,children:x.jsx(Dt,{present:r||s.open,children:x.jsx(wr.Slot,{scope:e.__scopeMenu,children:i.modal?x.jsx(y0,{...o,ref:t}):x.jsx(b0,{...o,ref:t})})})})}),y0=D.forwardRef((e,t)=>{const n=fn(qe,e.__scopeMenu),r=D.useRef(null),o=fe(t,r);return D.useEffect(()=>{const s=r.current;if(s)return Aa(s)},[]),x.jsx(Na,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:te(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),b0=D.forwardRef((e,t)=>{const n=fn(qe,e.__scopeMenu);return x.jsx(Na,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),x0=sn("MenuContent.ScrollLock"),Na=D.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:o,onOpenAutoFocus:s,onCloseAutoFocus:i,disableOutsidePointerEvents:a,onEntryFocus:c,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:h,onDismiss:f,disableOutsideScroll:S,...m}=e,w=fn(qe,n),g=zr(qe,n),p=ds(n),v=yh(n),C=d0(n),[y,M]=D.useState(null),b=D.useRef(null),T=fe(t,b,w.onContentChange),R=D.useRef(0),_=D.useRef(""),O=D.useRef(0),z=D.useRef(null),G=D.useRef("right"),j=D.useRef(0),F=S?us:D.Fragment,N=S?{as:x0,allowPinchZoom:!0}:void 0,k=I=>{var $,q;const A=_.current+I,V=C().filter(X=>!X.disabled),W=document.activeElement,H=($=V.find(X=>X.ref.current===W))==null?void 0:$.textValue,L=V.map(X=>X.textValue),Y=k0(L,A,H),K=(q=V.find(X=>X.textValue===Y))==null?void 0:q.ref.current;(function X(U){_.current=U,window.clearTimeout(R.current),U!==""&&(R.current=window.setTimeout(()=>X(""),1e3))})(A),K&&setTimeout(()=>K.focus())};D.useEffect(()=>()=>window.clearTimeout(R.current),[]),Pa();const P=D.useCallback(I=>{var V,W;return G.current===((V=z.current)==null?void 0:V.side)&&N0(I,(W=z.current)==null?void 0:W.area)},[]);return x.jsx(v0,{scope:n,searchRef:_,onItemEnter:D.useCallback(I=>{P(I)&&I.preventDefault()},[P]),onItemLeave:D.useCallback(I=>{var A;P(I)||((A=b.current)==null||A.focus(),M(null))},[P]),onTriggerLeave:D.useCallback(I=>{P(I)&&I.preventDefault()},[P]),pointerGraceTimerRef:O,onPointerGraceIntentChange:D.useCallback(I=>{z.current=I},[]),children:x.jsx(F,{...N,children:x.jsx(as,{asChild:!0,trapped:o,onMountAutoFocus:te(s,I=>{var A;I.preventDefault(),(A=b.current)==null||A.focus({preventScroll:!0})}),onUnmountAutoFocus:i,children:x.jsx(jr,{asChild:!0,disableOutsidePointerEvents:a,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:h,onDismiss:f,children:x.jsx(xS,{asChild:!0,...v,dir:g.dir,orientation:"vertical",loop:r,currentTabStopId:y,onCurrentTabStopIdChange:M,onEntryFocus:te(c,I=>{g.isUsingKeyboardRef.current||I.preventDefault()}),preventScrollOnEntryFocus:!0,children:x.jsx(ts,{role:"menu","aria-orientation":"vertical","data-state":Vh(w.open),"data-radix-menu-content":"",dir:g.dir,...p,...m,ref:T,style:{outline:"none",...m.style},onKeyDown:te(m.onKeyDown,I=>{const V=I.target.closest("[data-radix-menu-content]")===I.currentTarget,W=I.ctrlKey||I.altKey||I.metaKey,H=I.key.length===1;V&&(I.key==="Tab"&&I.preventDefault(),!W&&H&&k(I.key));const L=b.current;if(I.target!==L||!c0.includes(I.key))return;I.preventDefault();const K=C().filter($=>!$.disabled).map($=>$.ref.current);gh.includes(I.key)&&K.reverse(),A0(K)}),onBlur:te(e.onBlur,I=>{I.currentTarget.contains(I.target)||(window.clearTimeout(R.current),_.current="")}),onPointerMove:te(e.onPointerMove,Sr(I=>{const A=I.target,V=j.current!==I.clientX;if(I.currentTarget.contains(A)&&V){const W=I.clientX>j.current?"right":"left";G.current=W,j.current=I.clientX}}))})})})})})})});Sh.displayName=qe;var w0="MenuGroup",Ia=D.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return x.jsx(ae.div,{role:"group",...r,ref:t})});Ia.displayName=w0;var S0="MenuLabel",Ch=D.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return x.jsx(ae.div,{...r,ref:t})});Ch.displayName=S0;var No="MenuItem",El="menu.itemSelect",fs=D.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...o}=e,s=D.useRef(null),i=zr(No,e.__scopeMenu),a=_a(No,e.__scopeMenu),c=fe(t,s),l=D.useRef(!1),u=()=>{const d=s.current;if(!n&&d){const h=new CustomEvent(El,{bubbles:!0,cancelable:!0});d.addEventListener(El,f=>r==null?void 0:r(f),{once:!0}),wf(d,h),h.defaultPrevented?l.current=!1:i.onClose()}};return x.jsx(Th,{...o,ref:c,disabled:n,onClick:te(e.onClick,u),onPointerDown:d=>{var h;(h=e.onPointerDown)==null||h.call(e,d),l.current=!0},onPointerUp:te(e.onPointerUp,d=>{var h;l.current||(h=d.currentTarget)==null||h.click()}),onKeyDown:te(e.onKeyDown,d=>{const h=a.searchRef.current!=="";n||h&&d.key===" "||Ei.includes(d.key)&&(d.currentTarget.click(),d.preventDefault())})})});fs.displayName=No;var Th=D.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:o,...s}=e,i=_a(No,n),a=yh(n),c=D.useRef(null),l=fe(t,c),[u,d]=D.useState(!1),[h,f]=D.useState("");return D.useEffect(()=>{const S=c.current;S&&f((S.textContent??"").trim())},[s.children]),x.jsx(wr.ItemSlot,{scope:n,disabled:r,textValue:o??h,children:x.jsx(wS,{asChild:!0,...a,focusable:!r,children:x.jsx(ae.div,{role:"menuitem","data-highlighted":u?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...s,ref:l,onPointerMove:te(e.onPointerMove,Sr(S=>{r?i.onItemLeave(S):(i.onItemEnter(S),S.defaultPrevented||S.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:te(e.onPointerLeave,Sr(S=>i.onItemLeave(S))),onFocus:te(e.onFocus,()=>d(!0)),onBlur:te(e.onBlur,()=>d(!1))})})})}),C0="MenuCheckboxItem",Dh=D.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...o}=e;return x.jsx(Ah,{scope:e.__scopeMenu,checked:n,children:x.jsx(fs,{role:"menuitemcheckbox","aria-checked":Io(n)?"mixed":n,...o,ref:t,"data-state":La(n),onSelect:te(o.onSelect,()=>r==null?void 0:r(Io(n)?!0:!n),{checkForDefaultPrevented:!1})})})});Dh.displayName=C0;var Eh="MenuRadioGroup",[T0,D0]=dn(Eh,{value:void 0,onValueChange:()=>{}}),Mh=D.forwardRef((e,t)=>{const{value:n,onValueChange:r,...o}=e,s=Ze(r);return x.jsx(T0,{scope:e.__scopeMenu,value:n,onValueChange:s,children:x.jsx(Ia,{...o,ref:t})})});Mh.displayName=Eh;var Rh="MenuRadioItem",Ph=D.forwardRef((e,t)=>{const{value:n,...r}=e,o=D0(Rh,e.__scopeMenu),s=n===o.value;return x.jsx(Ah,{scope:e.__scopeMenu,checked:s,children:x.jsx(fs,{role:"menuitemradio","aria-checked":s,...r,ref:t,"data-state":La(s),onSelect:te(r.onSelect,()=>{var i;return(i=o.onValueChange)==null?void 0:i.call(o,n)},{checkForDefaultPrevented:!1})})})});Ph.displayName=Rh;var ja="MenuItemIndicator",[Ah,E0]=dn(ja,{checked:!1}),Oh=D.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...o}=e,s=E0(ja,n);return x.jsx(Dt,{present:r||Io(s.checked)||s.checked===!0,children:x.jsx(ae.span,{...o,ref:t,"data-state":La(s.checked)})})});Oh.displayName=ja;var M0="MenuSeparator",kh=D.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return x.jsx(ae.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});kh.displayName=M0;var R0="MenuArrow",_h=D.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=ds(n);return x.jsx(ns,{...o,...r,ref:t})});_h.displayName=R0;var P0="MenuSub",[_A,Nh]=dn(P0),ir="MenuSubTrigger",Ih=D.forwardRef((e,t)=>{const n=fn(ir,e.__scopeMenu),r=zr(ir,e.__scopeMenu),o=Nh(ir,e.__scopeMenu),s=_a(ir,e.__scopeMenu),i=D.useRef(null),{pointerGraceTimerRef:a,onPointerGraceIntentChange:c}=s,l={__scopeMenu:e.__scopeMenu},u=D.useCallback(()=>{i.current&&window.clearTimeout(i.current),i.current=null},[]);return D.useEffect(()=>u,[u]),D.useEffect(()=>{const d=a.current;return()=>{window.clearTimeout(d),c(null)}},[a,c]),x.jsx(Oa,{asChild:!0,...l,children:x.jsx(Th,{id:o.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":o.contentId,"data-state":Vh(n.open),...e,ref:Xo(t,o.onTriggerChange),onClick:d=>{var h;(h=e.onClick)==null||h.call(e,d),!(e.disabled||d.defaultPrevented)&&(d.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:te(e.onPointerMove,Sr(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,Sr(d=>{var f,S;u();const h=(f=n.content)==null?void 0:f.getBoundingClientRect();if(h){const m=(S=n.content)==null?void 0:S.dataset.side,w=m==="right",g=w?-5:5,p=h[w?"left":"right"],v=h[w?"right":"left"];s.onPointerGraceIntentChange({area:[{x:d.clientX+g,y:d.clientY},{x:p,y:h.top},{x:v,y:h.top},{x:v,y:h.bottom},{x:p,y:h.bottom}],side:m}),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 f;const h=s.searchRef.current!=="";e.disabled||h&&d.key===" "||l0[r.dir].includes(d.key)&&(n.onOpenChange(!0),(f=n.content)==null||f.focus(),d.preventDefault())})})})});Ih.displayName=ir;var jh="MenuSubContent",Lh=D.forwardRef((e,t)=>{const n=xh(qe,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,s=fn(qe,e.__scopeMenu),i=zr(qe,e.__scopeMenu),a=Nh(jh,e.__scopeMenu),c=D.useRef(null),l=fe(t,c);return x.jsx(wr.Provider,{scope:e.__scopeMenu,children:x.jsx(Dt,{present:r||s.open,children:x.jsx(wr.Slot,{scope:e.__scopeMenu,children:x.jsx(Na,{id:a.contentId,"aria-labelledby":a.triggerId,...o,ref:l,align:"start",side:i.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:u=>{var d;i.isUsingKeyboardRef.current&&((d=c.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 f;const d=u.currentTarget.contains(u.target),h=u0[i.dir].includes(u.key);d&&h&&(s.onOpenChange(!1),(f=a.trigger)==null||f.focus(),u.preventDefault())})})})})})});Lh.displayName=jh;function Vh(e){return e?"open":"closed"}function Io(e){return e==="indeterminate"}function La(e){return Io(e)?"indeterminate":e?"checked":"unchecked"}function A0(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function O0(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function k0(e,t,n){const o=t.length>1&&Array.from(t).every(l=>l===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let i=O0(e,Math.max(s,0));o.length===1&&(i=i.filter(l=>l!==n));const c=i.find(l=>l.toLowerCase().startsWith(o.toLowerCase()));return c!==n?c: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,c=t[s].y,l=t[i].x,u=t[i].y;c>r!=u>r&&n<(l-a)*(r-c)/(u-c)+a&&(o=!o)}return o}function N0(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return _0(n,t)}function Sr(e){return t=>t.pointerType==="mouse"?e(t):void 0}var I0=bh,j0=Oa,L0=wh,V0=Sh,F0=Ia,$0=Ch,B0=fs,z0=Dh,W0=Mh,H0=Ph,U0=Oh,Y0=kh,K0=_h,G0=Ih,q0=Lh,Va="DropdownMenu",[X0,NA]=Ht(Va,[vh]),Ie=vh(),[Z0,Fh]=X0(Va),$h=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:o,defaultOpen:s,onOpenChange:i,modal:a=!0}=e,c=Ie(t),l=D.useRef(null),[u=!1,d]=ln({prop:o,defaultProp:s,onChange:i});return x.jsx(Z0,{scope:t,triggerId:Vt(),triggerRef:l,contentId:Vt(),open:u,onOpenChange:d,onOpenToggle:D.useCallback(()=>d(h=>!h),[d]),modal:a,children:x.jsx(I0,{...c,open:u,onOpenChange:d,dir:r,modal:a,children:n})})};$h.displayName=Va;var Bh="DropdownMenuTrigger",zh=D.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...o}=e,s=Fh(Bh,n),i=Ie(n);return x.jsx(j0,{asChild:!0,...i,children:x.jsx(ae.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:Xo(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())})})})});zh.displayName=Bh;var J0="DropdownMenuPortal",Wh=e=>{const{__scopeDropdownMenu:t,...n}=e,r=Ie(t);return x.jsx(L0,{...r,...n})};Wh.displayName=J0;var Hh="DropdownMenuContent",Uh=D.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Fh(Hh,n),s=Ie(n),i=D.useRef(!1);return x.jsx(V0,{id:o.contentId,"aria-labelledby":o.triggerId,...s,...r,ref:t,onCloseAutoFocus:te(e.onCloseAutoFocus,a=>{var c;i.current||(c=o.triggerRef.current)==null||c.focus(),i.current=!1,a.preventDefault()}),onInteractOutside:te(e.onInteractOutside,a=>{const c=a.detail.originalEvent,l=c.button===0&&c.ctrlKey===!0,u=c.button===2||l;(!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)"}})});Uh.displayName=Hh;var Q0="DropdownMenuGroup",eC=D.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ie(n);return x.jsx(F0,{...o,...r,ref:t})});eC.displayName=Q0;var tC="DropdownMenuLabel",Yh=D.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ie(n);return x.jsx($0,{...o,...r,ref:t})});Yh.displayName=tC;var nC="DropdownMenuItem",Kh=D.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ie(n);return x.jsx(B0,{...o,...r,ref:t})});Kh.displayName=nC;var rC="DropdownMenuCheckboxItem",Gh=D.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ie(n);return x.jsx(z0,{...o,...r,ref:t})});Gh.displayName=rC;var oC="DropdownMenuRadioGroup",sC=D.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ie(n);return x.jsx(W0,{...o,...r,ref:t})});sC.displayName=oC;var iC="DropdownMenuRadioItem",aC=D.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ie(n);return x.jsx(H0,{...o,...r,ref:t})});aC.displayName=iC;var cC="DropdownMenuItemIndicator",qh=D.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ie(n);return x.jsx(U0,{...o,...r,ref:t})});qh.displayName=cC;var lC="DropdownMenuSeparator",Xh=D.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ie(n);return x.jsx(Y0,{...o,...r,ref:t})});Xh.displayName=lC;var uC="DropdownMenuArrow",dC=D.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ie(n);return x.jsx(K0,{...o,...r,ref:t})});dC.displayName=uC;var fC="DropdownMenuSubTrigger",hC=D.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ie(n);return x.jsx(G0,{...o,...r,ref:t})});hC.displayName=fC;var pC="DropdownMenuSubContent",mC=D.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ie(n);return x.jsx(q0,{...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)"}})});mC.displayName=pC;var gC=$h,vC=zh,yC=Wh,bC=Uh,xC=Yh,wC=Kh,SC=Gh,CC=qh,TC=Xh;function Fa({...e}){return x.jsx(gC,{"data-slot":"dropdown-menu",...e})}function $a({...e}){return x.jsx(vC,{"data-slot":"dropdown-menu-trigger",...e})}function Ba({className:e,sideOffset:t=4,...n}){return x.jsx(yC,{children:x.jsx(bC,{"data-slot":"dropdown-menu-content",sideOffset:t,style:{zIndex:100},className:de("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 Ml({className:e,inset:t,variant:n="default",...r}){return x.jsx(wC,{"data-slot":"dropdown-menu-item","data-inset":t,"data-variant":n,className:de("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 DC({className:e,children:t,checked:n,...r}){return x.jsxs(SC,{"data-slot":"dropdown-menu-checkbox-item",className:de("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:[x.jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:x.jsx(CC,{children:x.jsx(sf,{className:"size-4"})})}),t]})}function EC({className:e,inset:t,...n}){return x.jsx(xC,{"data-slot":"dropdown-menu-label","data-inset":t,className:de("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",e),...n})}function MC({className:e,...t}){return x.jsx(TC,{"data-slot":"dropdown-menu-separator",className:de("bg-border -mx-1 my-1 h-px",e),...t})}var RC="Label",Zh=D.forwardRef((e,t)=>x.jsx(ae.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())}}));Zh.displayName=RC;var PC=Zh;function AC({className:e,...t}){return x.jsx(PC,{"data-slot":"label",className:de("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 OC={isDragging:!1},hn=Ho(e=>({...OC,updateIsDragging:t=>e(n=>({...n,isDragging:t}))})),kC=({onClose:e,side:t,onOpenChange:n,buttonTrigger:r,modal:o=!1,children:s})=>{const[i,a]=E.useState({x:0,y:0}),c=hn(is(m=>m.updateIsDragging)),{attributes:l,listeners:u,setNodeRef:d,transform:h,setActivatorNodeRef:f}=ua({id:"booking_info",data:{type:"another"}}),S={transform:`translate3d(${i.x+((h==null?void 0:h.x)||0)}px, ${i.y+((h==null?void 0:h.y)||0)}px, 0)`};return _r({onDragStart(){c(!0)},onDragEnd(m){if(m.active.id){const{y:w,x:g}=i;a({x:g+((h==null?void 0:h.x)||0),y:w+((h==null?void 0:h.y)||0)}),c(!1)}}}),x.jsxs(Fa,{dir:"ltr",modal:o,open:!0,onOpenChange:n,children:[x.jsx($a,{asChild:!0,children:r||x.jsx("div",{})}),x.jsxs(Ba,{ref:d,style:{...S,zIndex:100,width:"25rem"},forceMount:!0,avoidCollisions:!0,side:t,sticky:"always",updatePositionStrategy:"always",...l,children:[x.jsxs("div",{className:"dropdownLabelContent",children:[x.jsx(AC,{ref:f,className:"dropdownLabelContent_dropdownLabel",...u,children:"Appointment"}),x.jsx(xb,{className:"dropdownLabelContent_close",onClick:e})]}),s]})]})},Jh=({modal:e=!1,side:t,onClose:n,onOpenChange:r,buttonTrigger:o,ref:s})=>{const[i,a]=E.useState(!1),{createBookingModal:c}=Lt(),l=()=>{a(!1),n==null||n()},u=d=>{a(d),r==null||r(d)};return E.useImperativeHandle(s,()=>({showCreationModal:()=>a(!0),closeModal:()=>a(!1),isModalOpen:()=>i})),x.jsx(x.Fragment,{children:i&&x.jsx(la,{children:x.jsx(kC,{onClose:l,onOpenChange:u,modal:e,side:t,buttonTrigger:o,children:c})})})},_C=({children:e})=>{const{bookingViewType:t,daysOfWeek:n}=Le(),{setTodayDay:r,setBookingViewType:o}=Le(),{updateMonthMessage:s,updateHeaderDateLabel:i}=Ad(g=>g),{onViewTypeChange:a}=Rd(),{onHeaderDayClick:c}=Lt(),{resetSelectedNode:l,resetNodes:u}=Tt(g=>g),d=E.useRef(null),h=()=>d.current,f=()=>{var g;(g=h())==null||g.showCreationModal()},S=E.useCallback(g=>{const p=()=>{o(se.WEEK),a(se.WEEK)},v=()=>t===se.DAY;if(c==null||c(g,t),v())return p();const C=r(g);if(!C)return;const y={month:C.getMonth(),fullYear:C.getFullYear(),monthMessage:Mn[C.getMonth()]};s(y),o(se.DAY)},[t,r,s,o]),m=t===se.TABLE?{justifySelf:"start"}:{},w=E.useMemo(()=>{const g=p=>new Date(p).toDateString()===new Date().toDateString();return n.map(p=>{const v=ui[new Date(p).getDay()];return x.jsx("th",{className:de("daysOfWeek"),children:x.jsxs("div",{style:{...m,maxWidth:t===se.DAY?"11rem":void 0},className:"daysOfWeek_parent",children:[x.jsx("span",{className:de(g(p)&&"daysOfWeek_day_today_title"),children:v}),x.jsx("div",{style:{width:"100%"},children:x.jsx("button",{type:"button",className:de(g(p)?"daysOfWeek_day_today":"daysOfWeek_day_rest"),onClick:()=>S(p),children:Z.formatDate(p.toDateString())})})]})},v)})},[n,S,t]);return E.useEffect(()=>{switch(t){case se.DAY:{u(),l(),i(n[0]);break}case se.WEEK:{const g=Z.generateWeekMonthLabel(n);s({monthMessage:g})}}},[n]),x.jsxs(x.Fragment,{children:[x.jsxs("table",{className:"daysOfWeek_table",children:[x.jsx("thead",{children:x.jsxs("tr",{children:[x.jsx("th",{style:{...m,zIndex:100},className:"time-col",children:x.jsx("div",{className:"daysOfWeek_emptySlot",children:x.jsx(Ea,{content:"createNewBookingLabel",children:x.jsx(an,{variant:"ghost",onClick:f,children:x.jsx(ib,{})})})})},"emptyBlocks"),w]})}),e]}),x.jsx(Jh,{modal:!0,ref:d})]})};function NC({className:e,...t}){return x.jsx("td",{"data-slot":"table-cell",className:de("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t})}const Mi={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}},IC={capitalize(e){return`${this.returnFirstChar(e)}${e.slice(1,e.length)}`},returnFirstChar(e){return e.charAt(0).toUpperCase()}},Ri=({booking:e,slotData:t,events:n,style:r,ref:o})=>{if(!e||!t||!t)return;const{day:s,hour:i}=t,[a,c]=E.useState(e),l=d=>d<="11:30",u=(d,h)=>{const f=Z.dateAndHourDateToString(new Date(d.finishAt));return Z.isTodayDate(h)&&l(f)?{backgroundColor:"#000000c0"}:{backgroundColor:"#000456c0"}};return E.useEffect(()=>{e&&c(e)},[e]),E.useImperativeHandle(o,()=>({updateBooking:d=>c(d)})),x.jsx("div",{className:"booking_card_content_container",style:{...u(a,new Date(s.split(":")[1])),...r},onPointerUp:n==null?void 0:n.onClick,children:x.jsx("div",{className:"booking_card_content",children:x.jsx("p",{className:"booking_info",children:`${Z.dateAndHourDateToString(a.startAt)} - ${Z.dateAndHourDateToString(a.finishAt)}`})})},`${s}-${i}`)};function jC(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 LC=e=>{let{transform:t,draggingNodeRect:n,windowRect:r}=e;return!n||!r?t:jC(t,n,r)},Qh=E.createContext({});function VC(e){const t=E.useRef(null);return t.current===null&&(t.current=e()),t.current}const za=typeof window<"u",FC=za?E.useLayoutEffect:E.useEffect,Wa=E.createContext(null);function Ha(e,t){e.indexOf(t)===-1&&e.push(t)}function Ua(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}const wt=(e,t,n)=>n>t?t:n<e?e:n;let zn=()=>{},St=()=>{};process.env.NODE_ENV!=="production"&&(zn=(e,t)=>{!e&&typeof console<"u"&&console.warn(t)},St=(e,t)=>{if(!e)throw new Error(t)});const Ct={},ep=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function tp(e){return typeof e=="object"&&e!==null}const np=e=>/^0[^.\s]+$/u.test(e);function Ya(e){let t;return()=>(t===void 0&&(t=e()),t)}const Xe=e=>e,$C=(e,t)=>n=>t(e(n)),Wr=(...e)=>e.reduce($C),Cr=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r};class Ka{constructor(){this.subscriptions=[]}add(t){return Ha(this.subscriptions,t),()=>Ua(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 et=e=>e*1e3,ut=e=>e/1e3;function rp(e,t){return t?e*(1e3/t):0}const Rl=new Set;function Ga(e,t,n){e||Rl.has(t)||(console.warn(t),Rl.add(t))}const op=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,BC=1e-7,zC=12;function WC(e,t,n,r,o){let s,i,a=0;do i=t+(n-t)/2,s=op(i,r,o)-e,s>0?n=i:t=i;while(Math.abs(s)>BC&&++a<zC);return i}function Hr(e,t,n,r){if(e===t&&n===r)return Xe;const o=s=>WC(s,0,1,e,n);return s=>s===0||s===1?s:op(o(s),t,r)}const sp=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,ip=e=>t=>1-e(1-t),ap=Hr(.33,1.53,.69,.99),qa=ip(ap),cp=sp(qa),lp=e=>(e*=2)<1?.5*qa(e):.5*(2-Math.pow(2,-10*(e-1))),Xa=e=>1-Math.sin(Math.acos(e)),up=ip(Xa),dp=sp(Xa),HC=Hr(.42,0,1,1),UC=Hr(0,0,.58,1),fp=Hr(.42,0,.58,1),YC=e=>Array.isArray(e)&&typeof e[0]!="number",hp=e=>Array.isArray(e)&&typeof e[0]=="number",Pl={linear:Xe,easeIn:HC,easeInOut:fp,easeOut:UC,circIn:Xa,circInOut:dp,circOut:up,backIn:qa,backInOut:cp,backOut:ap,anticipate:lp},KC=e=>typeof e=="string",Al=e=>{if(hp(e)){St(e.length===4,"Cubic bezier arrays must contain four numerical values.");const[t,n,r,o]=e;return Hr(t,n,r,o)}else if(KC(e))return St(Pl[e]!==void 0,`Invalid easing type '${e}'`),Pl[e];return e},oo=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"],Ol={value:null};function GC(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},c=0;function l(d){i.has(d)&&(u.schedule(d),e()),c++,d(a)}const u={schedule:(d,h=!1,f=!1)=>{const m=f&&o?n:r;return h&&i.add(d),m.has(d)||m.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(l),t&&Ol.value&&Ol.value.frameloop[t].push(c),c=0,n.clear(),o=!1,s&&(s=!1,u.process(d))}};return u}const qC=40;function pp(e,t){let n=!1,r=!0;const o={delta:0,timestamp:0,isProcessing:!1},s=()=>n=!0,i=oo.reduce((v,C)=>(v[C]=GC(s,t?C:void 0),v),{}),{setup:a,read:c,resolveKeyframes:l,preUpdate:u,update:d,preRender:h,render:f,postRender:S}=i,m=()=>{const v=Ct.useManualTiming?o.timestamp:performance.now();n=!1,Ct.useManualTiming||(o.delta=r?1e3/60:Math.max(Math.min(v-o.timestamp,qC),1)),o.timestamp=v,o.isProcessing=!0,a.process(o),c.process(o),l.process(o),u.process(o),d.process(o),h.process(o),f.process(o),S.process(o),o.isProcessing=!1,n&&t&&(r=!1,e(m))},w=()=>{n=!0,r=!0,o.isProcessing||e(m)};return{schedule:oo.reduce((v,C)=>{const y=i[C];return v[C]=(M,b=!1,T=!1)=>(n||w(),y.schedule(M,b,T)),v},{}),cancel:v=>{for(let C=0;C<oo.length;C++)i[oo[C]].cancel(v)},state:o,steps:i}}const{schedule:ve,cancel:zt,state:De,steps:zs}=pp(typeof requestAnimationFrame<"u"?requestAnimationFrame:Xe,!0);let bo;function XC(){bo=void 0}const je={now:()=>(bo===void 0&&je.set(De.isProcessing||Ct.useManualTiming?De.timestamp:performance.now()),bo),set:e=>{bo=e,queueMicrotask(XC)}},mp=e=>t=>typeof t=="string"&&t.startsWith(e),Za=mp("--"),ZC=mp("var(--"),Ja=e=>ZC(e)?JC.test(e.split("/*")[0].trim()):!1,JC=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,Wn={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},Tr={...Wn,transform:e=>wt(0,1,e)},so={...Wn,default:1},fr=e=>Math.round(e*1e5)/1e5,Qa=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function QC(e){return e==null}const eT=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,ec=(e,t)=>n=>!!(typeof n=="string"&&eT.test(n)&&n.startsWith(e)||t&&!QC(n)&&Object.prototype.hasOwnProperty.call(n,t)),gp=(e,t,n)=>r=>{if(typeof r!="string")return r;const[o,s,i,a]=r.match(Qa);return{[e]:parseFloat(o),[t]:parseFloat(s),[n]:parseFloat(i),alpha:a!==void 0?parseFloat(a):1}},tT=e=>wt(0,255,e),Ws={...Wn,transform:e=>Math.round(tT(e))},en={test:ec("rgb","red"),parse:gp("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+Ws.transform(e)+", "+Ws.transform(t)+", "+Ws.transform(n)+", "+fr(Tr.transform(r))+")"};function nT(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 Pi={test:ec("#"),parse:nT,transform:en.transform},Ur=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Nt=Ur("deg"),dt=Ur("%"),re=Ur("px"),rT=Ur("vh"),oT=Ur("vw"),kl={...dt,parse:e=>dt.parse(e)/100,transform:e=>dt.transform(e*100)},wn={test:ec("hsl","hue"),parse:gp("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+dt.transform(fr(t))+", "+dt.transform(fr(n))+", "+fr(Tr.transform(r))+")"},Re={test:e=>en.test(e)||Pi.test(e)||wn.test(e),parse:e=>en.test(e)?en.parse(e):wn.test(e)?wn.parse(e):Pi.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?en.transform(e):wn.transform(e)},sT=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function iT(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(Qa))==null?void 0:t.length)||0)+(((n=e.match(sT))==null?void 0:n.length)||0)>0}const vp="number",yp="color",aT="var",cT="var(",_l="${}",lT=/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 Dr(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},o=[];let s=0;const a=t.replace(lT,c=>(Re.test(c)?(r.color.push(s),o.push(yp),n.push(Re.parse(c))):c.startsWith(cT)?(r.var.push(s),o.push(aT),n.push(c)):(r.number.push(s),o.push(vp),n.push(parseFloat(c))),++s,_l)).split(_l);return{values:n,split:a,indexes:r,types:o}}function bp(e){return Dr(e).values}function xp(e){const{split:t,types:n}=Dr(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===vp?s+=fr(o[i]):a===yp?s+=Re.transform(o[i]):s+=o[i]}return s}}const uT=e=>typeof e=="number"?0:e;function dT(e){const t=bp(e);return xp(e)(t.map(uT))}const Wt={test:iT,parse:bp,createTransformer:xp,getAnimatableNone:dT};function Hs(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 fT({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,c=2*n-a;o=Hs(c,a,e+1/3),s=Hs(c,a,e),i=Hs(c,a,e-1/3)}return{red:Math.round(o*255),green:Math.round(s*255),blue:Math.round(i*255),alpha:r}}function jo(e,t){return n=>n>0?t:e}const ge=(e,t,n)=>e+(t-e)*n,Us=(e,t,n)=>{const r=e*e,o=n*(t*t-r)+r;return o<0?0:Math.sqrt(o)},hT=[Pi,en,wn],pT=e=>hT.find(t=>t.test(e));function Nl(e){const t=pT(e);if(zn(!!t,`'${e}' is not an animatable color. Use the equivalent color code instead.`),!t)return!1;let n=t.parse(e);return t===wn&&(n=fT(n)),n}const Il=(e,t)=>{const n=Nl(e),r=Nl(t);if(!n||!r)return jo(e,t);const o={...n};return s=>(o.red=Us(n.red,r.red,s),o.green=Us(n.green,r.green,s),o.blue=Us(n.blue,r.blue,s),o.alpha=ge(n.alpha,r.alpha,s),en.transform(o))},Ai=new Set(["none","hidden"]);function mT(e,t){return Ai.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function gT(e,t){return n=>ge(e,t,n)}function tc(e){return typeof e=="number"?gT:typeof e=="string"?Ja(e)?jo:Re.test(e)?Il:bT:Array.isArray(e)?wp:typeof e=="object"?Re.test(e)?Il:vT:jo}function wp(e,t){const n=[...e],r=n.length,o=e.map((s,i)=>tc(s)(s,t[i]));return s=>{for(let i=0;i<r;i++)n[i]=o[i](s);return n}}function vT(e,t){const n={...e,...t},r={};for(const o in n)e[o]!==void 0&&t[o]!==void 0&&(r[o]=tc(e[o])(e[o],t[o]));return o=>{for(const s in r)n[s]=r[s](o);return n}}function yT(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 bT=(e,t)=>{const n=Wt.createTransformer(t),r=Dr(e),o=Dr(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?Ai.has(e)&&!o.values.length||Ai.has(t)&&!r.values.length?mT(e,t):Wr(wp(yT(r,o),o.values),n):(zn(!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.`),jo(e,t))};function Sp(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?ge(e,t,n):tc(e)(e,t)}const xT=e=>{const t=({timestamp:n})=>e(n);return{start:(n=!0)=>ve.update(t,n),stop:()=>zt(t),now:()=>De.isProcessing?De.timestamp:je.now()}},Cp=(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)})`},Lo=2e4;function nc(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<Lo;)t+=n,r=e.next(t);return t>=Lo?1/0:t}function wT(e,t=100,n){const r=n({...e,keyframes:[0,t]}),o=Math.min(nc(r),Lo);return{type:"keyframes",ease:s=>r.next(o*s).value/t,duration:ut(o)}}const ST=5;function Tp(e,t,n){const r=Math.max(t-ST,0);return rp(n-e(r),t-r)}const me={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},jl=.001;function CT({duration:e=me.duration,bounce:t=me.bounce,velocity:n=me.velocity,mass:r=me.mass}){let o,s;zn(e<=et(me.maxDuration),"Spring duration must be 10 seconds or less");let i=1-t;i=wt(me.minDamping,me.maxDamping,i),e=wt(me.minDuration,me.maxDuration,ut(e)),i<1?(o=l=>{const u=l*i,d=u*e,h=u-n,f=Oi(l,i),S=Math.exp(-d);return jl-h/f*S},s=l=>{const d=l*i*e,h=d*n+n,f=Math.pow(i,2)*Math.pow(l,2)*e,S=Math.exp(-d),m=Oi(Math.pow(l,2),i);return(-o(l)+jl>0?-1:1)*((h-f)*S)/m}):(o=l=>{const u=Math.exp(-l*e),d=(l-n)*e+1;return-.001+u*d},s=l=>{const u=Math.exp(-l*e),d=(n-l)*(e*e);return u*d});const a=5/e,c=DT(o,s,a);if(e=et(e),isNaN(c))return{stiffness:me.stiffness,damping:me.damping,duration:e};{const l=Math.pow(c,2)*r;return{stiffness:l,damping:i*2*Math.sqrt(r*l),duration:e}}}const TT=12;function DT(e,t,n){let r=n;for(let o=1;o<TT;o++)r=r-e(r)/t(r);return r}function Oi(e,t){return e*Math.sqrt(1-t*t)}const ET=["duration","bounce"],MT=["stiffness","damping","mass"];function Ll(e,t){return t.some(n=>e[n]!==void 0)}function RT(e){let t={velocity:me.velocity,stiffness:me.stiffness,damping:me.damping,mass:me.mass,isResolvedFromDuration:!1,...e};if(!Ll(e,MT)&&Ll(e,ET))if(e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),o=r*r,s=2*wt(.05,1,1-(e.bounce||0))*Math.sqrt(o);t={...t,mass:me.mass,stiffness:o,damping:s}}else{const n=CT(e);t={...t,...n,mass:me.mass},t.isResolvedFromDuration=!0}return t}function Vo(e=me.visualDuration,t=me.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:c,damping:l,mass:u,duration:d,velocity:h,isResolvedFromDuration:f}=RT({...n,velocity:-ut(n.velocity||0)}),S=h||0,m=l/(2*Math.sqrt(c*u)),w=i-s,g=ut(Math.sqrt(c/u)),p=Math.abs(w)<5;r||(r=p?me.restSpeed.granular:me.restSpeed.default),o||(o=p?me.restDelta.granular:me.restDelta.default);let v;if(m<1){const y=Oi(g,m);v=M=>{const b=Math.exp(-m*g*M);return i-b*((S+m*g*w)/y*Math.sin(y*M)+w*Math.cos(y*M))}}else if(m===1)v=y=>i-Math.exp(-g*y)*(w+(S+g*w)*y);else{const y=g*Math.sqrt(m*m-1);v=M=>{const b=Math.exp(-m*g*M),T=Math.min(y*M,300);return i-b*((S+m*g*w)*Math.sinh(T)+y*w*Math.cosh(T))/y}}const C={calculatedDuration:f&&d||null,next:y=>{const M=v(y);if(f)a.done=y>=d;else{let b=y===0?S:0;m<1&&(b=y===0?et(S):Tp(v,y,M));const T=Math.abs(b)<=r,R=Math.abs(i-M)<=o;a.done=T&&R}return a.value=a.done?i:M,a},toString:()=>{const y=Math.min(nc(C),Lo),M=Cp(b=>C.next(y*b).value,y,30);return y+"ms "+M},toTransition:()=>{}};return C}Vo.applyToOptions=e=>{const t=wT(e,100,Vo);return e.ease=t.ease,e.duration=et(t.duration),e.type="keyframes",e};function ki({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:o=10,bounceStiffness:s=500,modifyTarget:i,min:a,max:c,restDelta:l=.5,restSpeed:u}){const d=e[0],h={done:!1,value:d},f=T=>a!==void 0&&T<a||c!==void 0&&T>c,S=T=>a===void 0?c:c===void 0||Math.abs(a-T)<Math.abs(c-T)?a:c;let m=n*t;const w=d+m,g=i===void 0?w:i(w);g!==w&&(m=g-d);const p=T=>-m*Math.exp(-T/r),v=T=>g+p(T),C=T=>{const R=p(T),_=v(T);h.done=Math.abs(R)<=l,h.value=h.done?g:_};let y,M;const b=T=>{f(h.value)&&(y=T,M=Vo({keyframes:[h.value,S(h.value)],velocity:Tp(v,T,h.value),damping:o,stiffness:s,restDelta:l,restSpeed:u}))};return b(0),{calculatedDuration:null,next:T=>{let R=!1;return!M&&y===void 0&&(R=!0,C(T),b(T)),y!==void 0&&T>=y?M.next(T-y):(!R&&C(T),h)}}}function PT(e,t,n){const r=[],o=n||Ct.mix||Sp,s=e.length-1;for(let i=0;i<s;i++){let a=o(e[i],e[i+1]);if(t){const c=Array.isArray(t)?t[i]||Xe:t;a=Wr(c,a)}r.push(a)}return r}function AT(e,t,{clamp:n=!0,ease:r,mixer:o}={}){const s=e.length;if(St(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=PT(t,r,o),c=a.length,l=u=>{if(i&&u<e[0])return t[0];let d=0;if(c>1)for(;d<e.length-2&&!(u<e[d+1]);d++);const h=Cr(e[d],e[d+1],u);return a[d](h)};return n?u=>l(wt(e[0],e[s-1],u)):l}function OT(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const o=Cr(0,t,r);e.push(ge(n,1,o))}}function kT(e){const t=[0];return OT(t,e.length-1),t}function _T(e,t){return e.map(n=>n*t)}function NT(e,t){return e.map(()=>t||fp).splice(0,e.length-1)}function Sn({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const o=YC(r)?r.map(Al):Al(r),s={done:!1,value:t[0]},i=_T(n&&n.length===t.length?n:kT(t),e),a=AT(i,t,{ease:Array.isArray(o)?o:NT(t,o)});return{calculatedDuration:e,next:c=>(s.value=a(c),s.done=c>=e,s)}}const IT=e=>e!==null;function rc(e,{repeat:t,repeatType:n="loop"},r,o=1){const s=e.filter(IT),a=o<0||t&&n!=="loop"&&t%2===1?0:s.length-1;return!a||r===void 0?s[a]:r}const jT={decay:ki,inertia:ki,tween:Sn,keyframes:Sn,spring:Vo};function Dp(e){typeof e.type=="string"&&(e.type=jT[e.type])}class oc{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 LT=e=>e/100;class sc extends oc{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!==je.now()&&this.tick(je.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;Dp(t);const{type:n=Sn,repeat:r=0,repeatDelay:o=0,repeatType:s,velocity:i=0}=t;let{keyframes:a}=t;const c=n||Sn;process.env.NODE_ENV!=="production"&&c!==Sn&&St(a.length<=2,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${a}`),c!==Sn&&typeof a[0]!="number"&&(this.mixKeyframes=Wr(LT,Sp(a[0],a[1])),a=[0,100]);const l=c({...t,keyframes:a});s==="mirror"&&(this.mirroredGenerator=c({...t,keyframes:[...a].reverse(),velocity:-i})),l.calculatedDuration===null&&(l.calculatedDuration=nc(l));const{calculatedDuration:u}=l;this.calculatedDuration=u,this.resolvedDuration=u+o,this.totalDuration=this.resolvedDuration*(r+1)-o,this.generator=l}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:c}=this;if(this.startTime===null)return r.next(0);const{delay:l=0,keyframes:u,repeat:d,repeatType:h,repeatDelay:f,type:S,onUpdate:m,finalKeyframe:w}=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 g=this.currentTime-l*(this.playbackSpeed>=0?1:-1),p=this.playbackSpeed>=0?g<0:g>o;this.currentTime=Math.max(g,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=o);let v=this.currentTime,C=r;if(d){const T=Math.min(this.currentTime,o)/a;let R=Math.floor(T),_=T%1;!_&&T>=1&&(_=1),_===1&&R--,R=Math.min(R,d+1),!!(R%2)&&(h==="reverse"?(_=1-_,f&&(_-=f/a)):h==="mirror"&&(C=i)),v=wt(0,1,_)*a}const y=p?{done:!1,value:u[0]}:C.next(v);s&&(y.value=s(y.value));let{done:M}=y;!p&&c!==null&&(M=this.playbackSpeed>=0?this.currentTime>=o:this.currentTime<=0);const b=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&M);return b&&S!==ki&&(y.value=rc(u,this.options,w,this.speed)),m&&m(y.value),b&&this.finish(),y}then(t,n){return this.finished.then(t,n)}get duration(){return ut(this.calculatedDuration)}get time(){return ut(this.currentTime)}set time(t){var n;t=et(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(je.now());const n=this.playbackSpeed!==t;this.playbackSpeed=t,n&&(this.time=ut(this.currentTime))}play(){var o,s;if(this.isStopped)return;const{driver:t=xT,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(je.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 VT(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const tn=e=>e*180/Math.PI,_i=e=>{const t=tn(Math.atan2(e[1],e[0]));return Ni(t)},FT={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:_i,rotateZ:_i,skewX:e=>tn(Math.atan(e[1])),skewY:e=>tn(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},Ni=e=>(e=e%360,e<0&&(e+=360),e),Vl=_i,Fl=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),$l=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),$T={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Fl,scaleY:$l,scale:e=>(Fl(e)+$l(e))/2,rotateX:e=>Ni(tn(Math.atan2(e[6],e[5]))),rotateY:e=>Ni(tn(Math.atan2(-e[2],e[0]))),rotateZ:Vl,rotate:Vl,skewX:e=>tn(Math.atan(e[4])),skewY:e=>tn(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function Ii(e){return e.includes("scale")?1:0}function ji(e,t){if(!e||e==="none")return Ii(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,o;if(n)r=$T,o=n;else{const a=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=FT,o=a}if(!o)return Ii(t);const s=r[t],i=o[1].split(",").map(zT);return typeof s=="function"?s(i):i[s]}const BT=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return ji(n,t)};function zT(e){return parseFloat(e.trim())}const Hn=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Un=new Set(Hn),Bl=e=>e===Wn||e===re,WT=new Set(["x","y","z"]),HT=Hn.filter(e=>!WT.has(e));function UT(e){const t=[];return HT.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const nn={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})=>ji(t,"x"),y:(e,{transform:t})=>ji(t,"y")};nn.translateX=nn.x;nn.translateY=nn.y;const rn=new Set;let Li=!1,Vi=!1,Fi=!1;function Ep(){if(Vi){const e=Array.from(rn).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const o=UT(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)})}Vi=!1,Li=!1,rn.forEach(e=>e.complete(Fi)),rn.clear()}function Mp(){rn.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Vi=!0)})}function YT(){Fi=!0,Mp(),Ep(),Fi=!1}class ic{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?(rn.add(this),Li||(Li=!0,ve.read(Mp),ve.resolveKeyframes(Ep))):(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])}VT(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),rn.delete(this)}cancel(){this.state==="scheduled"&&(rn.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const KT=e=>e.startsWith("--");function GT(e,t,n){KT(t)?e.style.setProperty(t,n):e.style[t]=n}const qT=Ya(()=>window.ScrollTimeline!==void 0),XT={};function ZT(e,t){const n=Ya(e);return()=>XT[t]??n()}const Rp=ZT(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),ar=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,zl={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:ar([0,.65,.55,1]),circOut:ar([.55,0,1,.45]),backIn:ar([.31,.01,.66,-.59]),backOut:ar([.33,1.53,.69,.99])};function Pp(e,t){if(e)return typeof e=="function"?Rp()?Cp(e,t):"ease-out":hp(e)?ar(e):Array.isArray(e)?e.map(n=>Pp(n,t)||zl.easeOut):zl[e]}function JT(e,t,n,{delay:r=0,duration:o=300,repeat:s=0,repeatType:i="loop",ease:a="easeOut",times:c}={},l=void 0){const u={[t]:n};c&&(u.offset=c);const d=Pp(a,o);Array.isArray(d)&&(u.easing=d);const h={delay:r,duration:o,easing:Array.isArray(d)?"linear":d,fill:"both",iterations:s+1,direction:i==="reverse"?"alternate":"normal"};return l&&(h.pseudoElement=l),e.animate(u,h)}function Ap(e){return typeof e=="function"&&"applyToOptions"in e}function QT({type:e,...t}){return Ap(e)&&Rp()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class eD extends oc{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:c}=t;this.isPseudoElement=!!s,this.allowFlatten=i,this.options=t,St(typeof t.type!="string",`animateMini doesn't support "type" as a string. Did you mean to import { spring } from "motion"?`);const l=QT(t);this.animation=JT(n,r,o,l,s),l.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!s){const u=rc(o,this.options,a,this.speed);this.updateMotionValue?this.updateMotionValue(u):GT(n,r,u),this.animation.cancel()}c==null||c(),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 ut(Number(t))}get time(){return ut(Number(this.animation.currentTime)||0)}set time(t){this.finishedTime=null,this.animation.currentTime=et(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&&qT()?(this.animation.timeline=t,Xe):n(this)}}const Op={anticipate:lp,backInOut:cp,circInOut:dp};function tD(e){return e in Op}function nD(e){typeof e.ease=="string"&&tD(e.ease)&&(e.ease=Op[e.ease])}const Wl=10;class rD extends eD{constructor(t){nD(t),Dp(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 sc({...i,autoplay:!1}),c=et(this.finishedTime??this.time);n.setWithVelocity(a.sample(c-Wl).value,a.sample(c).value,Wl),a.stop()}}const Hl=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(Wt.test(e)||e==="0")&&!e.startsWith("url("));function oD(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 sD(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=Hl(o,t),a=Hl(s,t);return zn(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:oD(e)||(n==="spring"||Ap(n))&&r}function kp(e){return tp(e)&&"offsetHeight"in e}const iD=new Set(["opacity","clipPath","filter","transform"]),aD=Ya(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function cD(e){var l;const{motionValue:t,name:n,repeatDelay:r,repeatType:o,damping:s,type:i}=e;if(!kp((l=t==null?void 0:t.owner)==null?void 0:l.current))return!1;const{onUpdate:a,transformTemplate:c}=t.owner.getProps();return aD()&&n&&iD.has(n)&&(n!=="transform"||!c)&&!a&&!r&&o!=="mirror"&&s!==0&&i!=="inertia"}const lD=40;class uD extends oc{constructor({autoplay:t=!0,delay:n=0,type:r="keyframes",repeat:o=0,repeatDelay:s=0,repeatType:i="loop",keyframes:a,name:c,motionValue:l,element:u,...d}){var S;super(),this.stop=()=>{var m,w;this._animation&&(this._animation.stop(),(m=this.stopTimeline)==null||m.call(this)),(w=this.keyframeResolver)==null||w.cancel()},this.createdAt=je.now();const h={autoplay:t,delay:n,type:r,repeat:o,repeatDelay:s,repeatType:i,name:c,motionValue:l,element:u,...d},f=(u==null?void 0:u.KeyframeResolver)||ic;this.keyframeResolver=new f(a,(m,w,g)=>this.onKeyframesResolved(m,w,h,!g),c,l,u),(S=this.keyframeResolver)==null||S.scheduleResolve()}onKeyframesResolved(t,n,r,o){this.keyframeResolver=void 0;const{name:s,type:i,velocity:a,delay:c,isHandoff:l,onUpdate:u}=r;this.resolvedAt=je.now(),sD(t,s,i,a)||((Ct.instantAnimations||!c)&&(u==null||u(rc(t,r,n))),t[0]=t[t.length-1],r.duration=0,r.repeat=0);const h={startTime:o?this.resolvedAt?this.resolvedAt-this.createdAt>lD?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...r,keyframes:t},f=!l&&cD(h)?new rD({...h,element:h.motionValue.owner.current}):new sc(h);f.finished.then(()=>this.notifyFinished()).catch(Xe),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(),YT()),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 dD=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function fD(e){const t=dD.exec(e);if(!t)return[,];const[,n,r,o]=t;return[`--${n??r}`,o]}const hD=4;function _p(e,t,n=1){St(n<=hD,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`);const[r,o]=fD(e);if(!r)return;const s=window.getComputedStyle(t).getPropertyValue(r);if(s){const i=s.trim();return ep(i)?parseFloat(i):i}return Ja(o)?_p(o,t,n+1):o}function ac(e,t){return(e==null?void 0:e[t])??(e==null?void 0:e.default)??e}const Np=new Set(["width","height","top","left","right","bottom",...Hn]),pD={test:e=>e==="auto",parse:e=>e},Ip=e=>t=>t.test(e),jp=[Wn,re,dt,Nt,oT,rT,pD],Ul=e=>jp.find(Ip(e));function mD(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||np(e):!0}const gD=new Set(["brightness","contrast","saturate","opacity"]);function vD(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(Qa)||[];if(!r)return e;const o=n.replace(r,"");let s=gD.has(t)?1:0;return r!==n&&(s*=100),t+"("+s+o+")"}const yD=/\b([a-z-]*)\(.*?\)/gu,$i={...Wt,getAnimatableNone:e=>{const t=e.match(yD);return t?t.map(vD).join(" "):e}},Yl={...Wn,transform:Math.round},bD={rotate:Nt,rotateX:Nt,rotateY:Nt,rotateZ:Nt,scale:so,scaleX:so,scaleY:so,scaleZ:so,skew:Nt,skewX:Nt,skewY:Nt,distance:re,translateX:re,translateY:re,translateZ:re,x:re,y:re,z:re,perspective:re,transformPerspective:re,opacity:Tr,originX:kl,originY:kl,originZ:re},cc={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,...bD,zIndex:Yl,fillOpacity:Tr,strokeOpacity:Tr,numOctaves:Yl},xD={...cc,color:Re,backgroundColor:Re,outlineColor:Re,fill:Re,stroke:Re,borderColor:Re,borderTopColor:Re,borderRightColor:Re,borderBottomColor:Re,borderLeftColor:Re,filter:$i,WebkitFilter:$i},Lp=e=>xD[e];function Vp(e,t){let n=Lp(e);return n!==$i&&(n=Wt),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const wD=new Set(["auto","none","0"]);function SD(e,t,n){let r=0,o;for(;r<e.length&&!o;){const s=e[r];typeof s=="string"&&!wD.has(s)&&Dr(s).values.length&&(o=e[r]),r++}if(o&&n)for(const s of t)e[s]=Vp(n,o)}class CD extends ic{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 c=0;c<t.length;c++){let l=t[c];if(typeof l=="string"&&(l=l.trim(),Ja(l))){const u=_p(l,n.current);u!==void 0&&(t[c]=u),c===t.length-1&&(this.finalKeyframe=l)}}if(this.resolveNoneKeyframes(),!Np.has(r)||t.length!==2)return;const[o,s]=t,i=Ul(o),a=Ul(s);if(i!==a)if(Bl(i)&&Bl(a))for(let c=0;c<t.length;c++){const l=t[c];typeof l=="string"&&(t[c]=parseFloat(l))}else nn[r]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,r=[];for(let o=0;o<t.length;o++)(t[o]===null||mD(t[o]))&&r.push(o);r.length&&SD(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=nn[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]=nn[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(([c,l])=>{t.getValue(c).set(l)}),this.resolveNoneKeyframes()}}function TD(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 Kl=30,DD=e=>!isNaN(parseFloat(e));class ED{constructor(t,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=(r,o=!0)=>{var i,a;const s=je.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 c of this.dependents)c.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=je.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=DD(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return process.env.NODE_ENV!=="production"&&Ga(!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 Ka);const r=this.events[t].add(n);return t==="change"?()=>{r(),ve.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=je.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>Kl)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,Kl);return rp(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 _n(e,t){return new ED(e,t)}const Fp=(e,t)=>t&&typeof e=="number"?t.transform(e):e,{schedule:lc}=pp(queueMicrotask,!1),Je={x:!1,y:!1};function $p(){return Je.x||Je.y}function MD(e){return e==="x"||e==="y"?Je[e]?null:(Je[e]=!0,()=>{Je[e]=!1}):Je.x||Je.y?null:(Je.x=Je.y=!0,()=>{Je.x=Je.y=!1})}function Bp(e,t){const n=TD(e),r=new AbortController,o={passive:!0,...t,signal:r.signal};return[n,o,()=>r.abort()]}function Gl(e){return!(e.pointerType==="touch"||$p())}function RD(e,t,n={}){const[r,o,s]=Bp(e,n),i=a=>{if(!Gl(a))return;const{target:c}=a,l=t(c,a);if(typeof l!="function"||!c)return;const u=d=>{Gl(d)&&(l(d),c.removeEventListener("pointerleave",u))};c.addEventListener("pointerleave",u,o)};return r.forEach(a=>{a.addEventListener("pointerenter",i,o)}),s}const zp=(e,t)=>t?e===t?!0:zp(e,t.parentElement):!1,uc=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,PD=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function AD(e){return PD.has(e.tagName)||e.tabIndex!==-1}const xo=new WeakSet;function ql(e){return t=>{t.key==="Enter"&&e(t)}}function Ys(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const OD=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=ql(()=>{if(xo.has(n))return;Ys(n,"down");const o=ql(()=>{Ys(n,"up")}),s=()=>Ys(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 Xl(e){return uc(e)&&!$p()}function kD(e,t,n={}){const[r,o,s]=Bp(e,n),i=a=>{const c=a.currentTarget;if(!Xl(a))return;xo.add(c);const l=t(c,a),u=(f,S)=>{window.removeEventListener("pointerup",d),window.removeEventListener("pointercancel",h),xo.has(c)&&xo.delete(c),Xl(f)&&typeof l=="function"&&l(f,{success:S})},d=f=>{u(f,c===window||c===document||n.useGlobalTarget||zp(c,f.target))},h=f=>{u(f,!1)};window.addEventListener("pointerup",d,o),window.addEventListener("pointercancel",h,o)};return r.forEach(a=>{(n.useGlobalTarget?window:a).addEventListener("pointerdown",i,o),kp(a)&&(a.addEventListener("focus",l=>OD(l,o)),!AD(a)&&!a.hasAttribute("tabindex")&&(a.tabIndex=0))}),s}function Wp(e){return tp(e)&&"ownerSVGElement"in e}function _D(e){return Wp(e)&&e.tagName==="svg"}const Pe=e=>!!(e&&e.getVelocity),ND=[...jp,Re,Wt],ID=e=>ND.find(Ip(e)),Hp=E.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function jD(e=!0){const t=E.useContext(Wa);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:o}=t,s=E.useId();E.useEffect(()=>{if(e)return o(s)},[e]);const i=E.useCallback(()=>e&&r&&r(s),[s,r,e]);return!n&&r?[!1,i]:[!0]}const Up=E.createContext({strict:!1}),Zl={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"]},Nn={};for(const e in Zl)Nn[e]={isEnabled:t=>Zl[e].some(n=>!!t[n])};function LD(e){for(const t in e)Nn[t]={...Nn[t],...e[t]}}const VD=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 Fo(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||VD.has(e)}let Yp=e=>!Fo(e);function FD(e){e&&(Yp=t=>t.startsWith("on")?!Fo(t):e(t))}try{FD(require("@emotion/is-prop-valid").default)}catch{}function $D(e,t,n){const r={};for(const o in e)o==="values"&&typeof e.values=="object"||(Yp(o)||n===!0&&Fo(o)||!t&&!Fo(o)||e.draggable&&o.startsWith("onDrag"))&&(r[o]=e[o]);return r}function BD(e){if(typeof Proxy>"u")return e;const t=new Map,n=(...r)=>(process.env.NODE_ENV!=="production"&&Ga(!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 hs=E.createContext({});function ps(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function Er(e){return typeof e=="string"||Array.isArray(e)}const dc=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],fc=["initial",...dc];function ms(e){return ps(e.animate)||fc.some(t=>Er(e[t]))}function Kp(e){return!!(ms(e)||e.variants)}function zD(e,t){if(ms(e)){const{initial:n,animate:r}=e;return{initial:n===!1||Er(n)?n:void 0,animate:Er(r)?r:void 0}}return e.inherit!==!1?t:{}}function WD(e){const{initial:t,animate:n}=zD(e,E.useContext(hs));return E.useMemo(()=>({initial:t,animate:n}),[Jl(t),Jl(n)])}function Jl(e){return Array.isArray(e)?e.join(" "):e}const HD=Symbol.for("motionComponentSymbol");function Cn(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function UD(e,t,n){return E.useCallback(r=>{r&&e.onMount&&e.onMount(r),t&&(r?t.mount(r):t.unmount()),n&&(typeof n=="function"?n(r):Cn(n)&&(n.current=r))},[t])}const hc=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),YD="framerAppearId",Gp="data-"+hc(YD),qp=E.createContext({});function KD(e,t,n,r,o){var m,w;const{visualElement:s}=E.useContext(hs),i=E.useContext(Up),a=E.useContext(Wa),c=E.useContext(Hp).reducedMotion,l=E.useRef(null);r=r||i.renderer,!l.current&&r&&(l.current=r(e,{visualState:t,parent:s,props:n,presenceContext:a,blockInitialAnimation:a?a.initial===!1:!1,reducedMotionConfig:c}));const u=l.current,d=E.useContext(qp);u&&!u.projection&&o&&(u.type==="html"||u.type==="svg")&&GD(l.current,n,o,d);const h=E.useRef(!1);E.useInsertionEffect(()=>{u&&h.current&&u.update(n,a)});const f=n[Gp],S=E.useRef(!!f&&!((m=window.MotionHandoffIsComplete)!=null&&m.call(window,f))&&((w=window.MotionHasOptimisedAnimation)==null?void 0:w.call(window,f)));return FC(()=>{u&&(h.current=!0,window.MotionIsMounted=!0,u.updateFeatures(),lc.render(u.render),S.current&&u.animationState&&u.animationState.animateChanges())}),E.useEffect(()=>{u&&(!S.current&&u.animationState&&u.animationState.animateChanges(),S.current&&(queueMicrotask(()=>{var g;(g=window.MotionHandoffMarkAsComplete)==null||g.call(window,f)}),S.current=!1))}),u}function GD(e,t,n,r){const{layoutId:o,layout:s,drag:i,dragConstraints:a,layoutScroll:c,layoutRoot:l,layoutCrossfade:u}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:Xp(e.parent)),e.projection.setOptions({layoutId:o,layout:s,alwaysMeasureLayout:!!i||a&&Cn(a),visualElement:e,animationType:typeof s=="string"?s:"both",initialPromotionConfig:r,crossfade:u,layoutScroll:c,layoutRoot:l})}function Xp(e){if(e)return e.options.allowProjection!==!1?e.projection:Xp(e.parent)}function qD({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:r,Component:o}){e&&LD(e);function s(a,c){let l;const u={...E.useContext(Hp),...a,layoutId:XD(a)},{isStatic:d}=u,h=WD(a),f=r(a,d);if(!d&&za){ZD(u,e);const S=JD(u);l=S.MeasureLayout,h.visualElement=KD(o,f,u,t,S.ProjectionNode)}return x.jsxs(hs.Provider,{value:h,children:[l&&h.visualElement?x.jsx(l,{visualElement:h.visualElement,...u}):null,n(o,a,UD(f,h.visualElement,c),f,d,h.visualElement)]})}s.displayName=`motion.${typeof o=="string"?o:`create(${o.displayName??o.name??""})`}`;const i=E.forwardRef(s);return i[HD]=o,i}function XD({layoutId:e}){const t=E.useContext(Qh).id;return t&&e!==void 0?t+"-"+e:e}function ZD(e,t){const n=E.useContext(Up).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?zn(!1,r):St(!1,r)}}function JD(e){const{drag:t,layout:n}=Nn;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 Mr={};function QD(e){for(const t in e)Mr[t]=e[t],Za(t)&&(Mr[t].isCSSVariable=!0)}function Zp(e,{layout:t,layoutId:n}){return Un.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!Mr[e]||e==="opacity")}const eE={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},tE=Hn.length;function nE(e,t,n){let r="",o=!0;for(let s=0;s<tE;s++){const i=Hn[s],a=e[i];if(a===void 0)continue;let c=!0;if(typeof a=="number"?c=a===(i.startsWith("scale")?1:0):c=parseFloat(a)===0,!c||n){const l=Fp(a,cc[i]);if(!c){o=!1;const u=eE[i]||i;r+=`${u}(${l}) `}n&&(t[i]=l)}}return r=r.trim(),n?r=n(t,o?"":r):o&&(r="none"),r}function pc(e,t,n){const{style:r,vars:o,transformOrigin:s}=e;let i=!1,a=!1;for(const c in t){const l=t[c];if(Un.has(c)){i=!0;continue}else if(Za(c)){o[c]=l;continue}else{const u=Fp(l,cc[c]);c.startsWith("origin")?(a=!0,s[c]=u):r[c]=u}}if(t.transform||(i||n?r.transform=nE(t,e.transform,n):r.transform&&(r.transform="none")),a){const{originX:c="50%",originY:l="50%",originZ:u=0}=s;r.transformOrigin=`${c} ${l} ${u}`}}const mc=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Jp(e,t,n){for(const r in t)!Pe(t[r])&&!Zp(r,n)&&(e[r]=t[r])}function rE({transformTemplate:e},t){return E.useMemo(()=>{const n=mc();return pc(n,t,e),Object.assign({},n.vars,n.style)},[t])}function oE(e,t){const n=e.style||{},r={};return Jp(r,n,e),Object.assign(r,rE(e,t)),r}function sE(e,t){const n={},r=oE(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 iE={offset:"stroke-dashoffset",array:"stroke-dasharray"},aE={offset:"strokeDashoffset",array:"strokeDasharray"};function cE(e,t,n=1,r=0,o=!0){e.pathLength=1;const s=o?iE:aE;e[s.offset]=re.transform(-r);const i=re.transform(t),a=re.transform(n);e[s.array]=`${i} ${a}`}function Qp(e,{attrX:t,attrY:n,attrScale:r,pathLength:o,pathSpacing:s=1,pathOffset:i=0,...a},c,l,u){if(pc(e,a,l),c){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:d,style:h}=e;d.transform&&(h.transform=d.transform,delete d.transform),(h.transform||d.transformOrigin)&&(h.transformOrigin=d.transformOrigin??"50% 50%",delete d.transformOrigin),h.transform&&(h.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&&cE(d,o,s,i,!1)}const em=()=>({...mc(),attrs:{}}),tm=e=>typeof e=="string"&&e.toLowerCase()==="svg";function lE(e,t,n,r){const o=E.useMemo(()=>{const s=em();return Qp(s,t,tm(r),e.transformTemplate,e.style),{...s.attrs,style:{...s.style}}},[t]);if(e.style){const s={};Jp(s,e.style,e),o.style={...s,...o.style}}return o}const uE=["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 gc(e){return typeof e!="string"||e.includes("-")?!1:!!(uE.indexOf(e)>-1||/[A-Z]/u.test(e))}function dE(e=!1){return(n,r,o,{latestValues:s},i)=>{const c=(gc(n)?lE:sE)(r,s,i,n),l=$D(r,typeof n=="string",e),u=n!==E.Fragment?{...l,...c,ref:o}:{},{children:d}=r,h=E.useMemo(()=>Pe(d)?d.get():d,[d]);return E.createElement(n,{...u,children:h})}}function Ql(e){const t=[{},{}];return e==null||e.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function vc(e,t,n,r){if(typeof t=="function"){const[o,s]=Ql(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]=Ql(r);t=t(n!==void 0?n:e.custom,o,s)}return t}function wo(e){return Pe(e)?e.get():e}function fE({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,o){return{latestValues:hE(n,r,o,e),renderState:t()}}const nm=e=>(t,n)=>{const r=E.useContext(hs),o=E.useContext(Wa),s=()=>fE(e,t,r,o);return n?s():VC(s)};function hE(e,t,n,r){const o={},s=r(e,{});for(const h in s)o[h]=wo(s[h]);let{initial:i,animate:a}=e;const c=ms(e),l=Kp(e);t&&l&&!c&&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"&&!ps(d)){const h=Array.isArray(d)?d:[d];for(let f=0;f<h.length;f++){const S=vc(e,h[f]);if(S){const{transitionEnd:m,transition:w,...g}=S;for(const p in g){let v=g[p];if(Array.isArray(v)){const C=u?v.length-1:0;v=v[C]}v!==null&&(o[p]=v)}for(const p in m)o[p]=m[p]}}}return o}function yc(e,t,n){var s;const{style:r}=e,o={};for(const i in r)(Pe(r[i])||t.style&&Pe(t.style[i])||Zp(i,e)||((s=n==null?void 0:n.getValue(i))==null?void 0:s.liveStyle)!==void 0)&&(o[i]=r[i]);return o}const pE={useVisualState:nm({scrapeMotionValuesFromProps:yc,createRenderState:mc})};function rm(e,t,n){const r=yc(e,t,n);for(const o in e)if(Pe(e[o])||Pe(t[o])){const s=Hn.indexOf(o)!==-1?"attr"+o.charAt(0).toUpperCase()+o.substring(1):o;r[s]=e[o]}return r}const mE={useVisualState:nm({scrapeMotionValuesFromProps:rm,createRenderState:em})};function gE(e,t){return function(r,{forwardMotionProps:o}={forwardMotionProps:!1}){const i={...gc(r)?mE:pE,preloadedFeatures:e,useRender:dE(o),createVisualElement:t,Component:r};return qD(i)}}function Rr(e,t,n){const r=e.getProps();return vc(r,t,n!==void 0?n:r.custom,e)}const Bi=e=>Array.isArray(e);function vE(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,_n(n))}function yE(e){return Bi(e)?e[e.length-1]||0:e}function bE(e,t){const n=Rr(e,t);let{transitionEnd:r={},transition:o={},...s}=n||{};s={...s,...r};for(const i in s){const a=yE(s[i]);vE(e,i,a)}}function xE(e){return!!(Pe(e)&&e.add)}function zi(e,t){const n=e.getValue("willChange");if(xE(n))return n.add(t);if(!n&&Ct.WillChange){const r=new Ct.WillChange("auto");e.addValue("willChange",r),r.add(t)}}function om(e){return e.props[Gp]}const wE=e=>e!==null;function SE(e,{repeat:t,repeatType:n="loop"},r){const o=e.filter(wE),s=t&&n!=="loop"&&t%2===1?0:o.length-1;return o[s]}const CE={type:"spring",stiffness:500,damping:25,restSpeed:10},TE=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),DE={type:"keyframes",duration:.8},EE={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},ME=(e,{keyframes:t})=>t.length>2?DE:Un.has(e)?e.startsWith("scale")?TE(t[1]):CE:EE;function RE({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:o,repeat:s,repeatType:i,repeatDelay:a,from:c,elapsed:l,...u}){return!!Object.keys(u).length}const bc=(e,t,n,r={},o,s)=>i=>{const a=ac(r,e)||{},c=a.delay||r.delay||0;let{elapsed:l=0}=r;l=l-et(c);const u={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...a,delay:-l,onUpdate:h=>{t.set(h),a.onUpdate&&a.onUpdate(h)},onComplete:()=>{i(),a.onComplete&&a.onComplete()},name:e,motionValue:t,element:s?void 0:o};RE(a)||Object.assign(u,ME(e,u)),u.duration&&(u.duration=et(u.duration)),u.repeatDelay&&(u.repeatDelay=et(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)),(Ct.instantAnimations||Ct.skipAnimations)&&(d=!0,u.duration=0,u.delay=0),u.allowFlatten=!a.type&&!a.ease,d&&!s&&t.get()!==void 0){const h=SE(u.keyframes,a);if(h!==void 0){ve.update(()=>{u.onUpdate(h),u.onComplete()});return}}return a.isSync?new sc(u):new uD(u)};function PE({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function sm(e,t,{delay:n=0,transitionOverride:r,type:o}={}){let{transition:s=e.getDefaultTransition(),transitionEnd:i,...a}=t;r&&(s=r);const c=[],l=o&&e.animationState&&e.animationState.getState()[o];for(const u in a){const d=e.getValue(u,e.latestValues[u]??null),h=a[u];if(h===void 0||l&&PE(l,u))continue;const f={delay:n,...ac(s||{},u)},S=d.get();if(S!==void 0&&!d.isAnimating&&!Array.isArray(h)&&h===S&&!f.velocity)continue;let m=!1;if(window.MotionHandoffAnimation){const g=om(e);if(g){const p=window.MotionHandoffAnimation(g,u,ve);p!==null&&(f.startTime=p,m=!0)}}zi(e,u),d.start(bc(u,d,h,e.shouldReduceMotion&&Np.has(u)?{type:!1}:f,e,m));const w=d.animation;w&&c.push(w)}return i&&Promise.all(c).then(()=>{ve.update(()=>{i&&bE(e,i)})}),c}function Wi(e,t,n={}){var c;const r=Rr(e,t,n.type==="exit"?(c=e.presenceContext)==null?void 0:c.custom:void 0);let{transition:o=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(o=n.transitionOverride);const s=r?()=>Promise.all(sm(e,r,n)):()=>Promise.resolve(),i=e.variantChildren&&e.variantChildren.size?(l=0)=>{const{delayChildren:u=0,staggerChildren:d,staggerDirection:h}=o;return AE(e,t,u+l,d,h,n)}:()=>Promise.resolve(),{when:a}=o;if(a){const[l,u]=a==="beforeChildren"?[s,i]:[i,s];return l().then(()=>u())}else return Promise.all([s(),i(n.delay)])}function AE(e,t,n=0,r=0,o=1,s){const i=[],a=(e.variantChildren.size-1)*r,c=o===1?(l=0)=>l*r:(l=0)=>a-l*r;return Array.from(e.variantChildren).sort(OE).forEach((l,u)=>{l.notify("AnimationStart",t),i.push(Wi(l,t,{...s,delay:n+c(u)}).then(()=>l.notify("AnimationComplete",t)))}),Promise.all(i)}function OE(e,t){return e.sortNodePosition(t)}function kE(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const o=t.map(s=>Wi(e,s,n));r=Promise.all(o)}else if(typeof t=="string")r=Wi(e,t,n);else{const o=typeof t=="function"?Rr(e,t,n.custom):t;r=Promise.all(sm(e,o,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}function im(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 _E=fc.length;function am(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?am(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<_E;n++){const r=fc[n],o=e.props[r];(Er(o)||o===!1)&&(t[r]=o)}return t}const NE=[...dc].reverse(),IE=dc.length;function jE(e){return t=>Promise.all(t.map(({animation:n,options:r})=>kE(e,n,r)))}function LE(e){let t=jE(e),n=eu(),r=!0;const o=c=>(l,u)=>{var h;const d=Rr(e,u,c==="exit"?(h=e.presenceContext)==null?void 0:h.custom:void 0);if(d){const{transition:f,transitionEnd:S,...m}=d;l={...l,...m,...S}}return l};function s(c){t=c(e)}function i(c){const{props:l}=e,u=am(e.parent)||{},d=[],h=new Set;let f={},S=1/0;for(let w=0;w<IE;w++){const g=NE[w],p=n[g],v=l[g]!==void 0?l[g]:u[g],C=Er(v),y=g===c?p.isActive:null;y===!1&&(S=w);let M=v===u[g]&&v!==l[g]&&C;if(M&&r&&e.manuallyAnimateOnMount&&(M=!1),p.protectedKeys={...f},!p.isActive&&y===null||!v&&!p.prevProp||ps(v)||typeof v=="boolean")continue;const b=VE(p.prevProp,v);let T=b||g===c&&p.isActive&&!M&&C||w>S&&C,R=!1;const _=Array.isArray(v)?v:[v];let O=_.reduce(o(g),{});y===!1&&(O={});const{prevResolvedValues:z={}}=p,G={...z,...O},j=k=>{T=!0,h.has(k)&&(R=!0,h.delete(k)),p.needsAnimating[k]=!0;const P=e.getValue(k);P&&(P.liveStyle=!1)};for(const k in G){const P=O[k],I=z[k];if(f.hasOwnProperty(k))continue;let A=!1;Bi(P)&&Bi(I)?A=!im(P,I):A=P!==I,A?P!=null?j(k):h.add(k):P!==void 0&&h.has(k)?j(k):p.protectedKeys[k]=!0}p.prevProp=v,p.prevResolvedValues=O,p.isActive&&(f={...f,...O}),r&&e.blockInitialAnimation&&(T=!1),T&&(!(M&&b)||R)&&d.push(..._.map(k=>({animation:k,options:{type:g}})))}if(h.size){const w={};if(typeof l.initial!="boolean"){const g=Rr(e,Array.isArray(l.initial)?l.initial[0]:l.initial);g&&g.transition&&(w.transition=g.transition)}h.forEach(g=>{const p=e.getBaseTarget(g),v=e.getValue(g);v&&(v.liveStyle=!0),w[g]=p??null}),d.push({animation:w})}let m=!!d.length;return r&&(l.initial===!1||l.initial===l.animate)&&!e.manuallyAnimateOnMount&&(m=!1),r=!1,m?t(d):Promise.resolve()}function a(c,l){var d;if(n[c].isActive===l)return Promise.resolve();(d=e.variantChildren)==null||d.forEach(h=>{var f;return(f=h.animationState)==null?void 0:f.setActive(c,l)}),n[c].isActive=l;const u=i(c);for(const h in n)n[h].protectedKeys={};return u}return{animateChanges:i,setActive:a,setAnimateFunction:s,getState:()=>n,reset:()=>{n=eu(),r=!0}}}function VE(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!im(t,e):!1}function Jt(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function eu(){return{animate:Jt(!0),whileInView:Jt(),whileHover:Jt(),whileTap:Jt(),whileDrag:Jt(),whileFocus:Jt(),exit:Jt()}}class Yt{constructor(t){this.isMounted=!1,this.node=t}update(){}}class FE extends Yt{constructor(t){super(t),t.animationState||(t.animationState=LE(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();ps(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 $E=0;class BE extends Yt{constructor(){super(...arguments),this.id=$E++}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 zE={animation:{Feature:FE},exit:{Feature:BE}};function Pr(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function Yr(e){return{point:{x:e.pageX,y:e.pageY}}}const WE=e=>t=>uc(t)&&e(t,Yr(t));function hr(e,t,n,r){return Pr(e,t,WE(n),r)}function cm({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function HE({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function UE(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 lm=1e-4,YE=1-lm,KE=1+lm,um=.01,GE=0-um,qE=0+um;function ke(e){return e.max-e.min}function XE(e,t,n){return Math.abs(e-t)<=n}function tu(e,t,n,r=.5){e.origin=r,e.originPoint=ge(t.min,t.max,e.origin),e.scale=ke(n)/ke(t),e.translate=ge(n.min,n.max,e.origin)-e.originPoint,(e.scale>=YE&&e.scale<=KE||isNaN(e.scale))&&(e.scale=1),(e.translate>=GE&&e.translate<=qE||isNaN(e.translate))&&(e.translate=0)}function pr(e,t,n,r){tu(e.x,t.x,n.x,r?r.originX:void 0),tu(e.y,t.y,n.y,r?r.originY:void 0)}function nu(e,t,n){e.min=n.min+t.min,e.max=e.min+ke(t)}function ZE(e,t,n){nu(e.x,t.x,n.x),nu(e.y,t.y,n.y)}function ru(e,t,n){e.min=t.min-n.min,e.max=e.min+ke(t)}function mr(e,t,n){ru(e.x,t.x,n.x),ru(e.y,t.y,n.y)}const ou=()=>({translate:0,scale:1,origin:0,originPoint:0}),Tn=()=>({x:ou(),y:ou()}),su=()=>({min:0,max:0}),xe=()=>({x:su(),y:su()});function Ke(e){return[e("x"),e("y")]}function Ks(e){return e===void 0||e===1}function Hi({scale:e,scaleX:t,scaleY:n}){return!Ks(e)||!Ks(t)||!Ks(n)}function Qt(e){return Hi(e)||dm(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function dm(e){return iu(e.x)||iu(e.y)}function iu(e){return e&&e!=="0%"}function $o(e,t,n){const r=e-n,o=t*r;return n+o}function au(e,t,n,r,o){return o!==void 0&&(e=$o(e,o,r)),$o(e,n,r)+t}function Ui(e,t=0,n=1,r,o){e.min=au(e.min,t,n,r,o),e.max=au(e.max,t,n,r,o)}function fm(e,{x:t,y:n}){Ui(e.x,t.translate,t.scale,t.originPoint),Ui(e.y,n.translate,n.scale,n.originPoint)}const cu=.999999999999,lu=1.0000000000001;function JE(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:c}=s.options;c&&c.props.style&&c.props.style.display==="contents"||(r&&s.options.layoutScroll&&s.scroll&&s!==s.root&&En(e,{x:-s.scroll.offset.x,y:-s.scroll.offset.y}),i&&(t.x*=i.x.scale,t.y*=i.y.scale,fm(e,i)),r&&Qt(s.latestValues)&&En(e,s.latestValues))}t.x<lu&&t.x>cu&&(t.x=1),t.y<lu&&t.y>cu&&(t.y=1)}function Dn(e,t){e.min=e.min+t,e.max=e.max+t}function uu(e,t,n,r,o=.5){const s=ge(e.min,e.max,o);Ui(e,t,n,s,r)}function En(e,t){uu(e.x,t.x,t.scaleX,t.scale,t.originX),uu(e.y,t.y,t.scaleY,t.scale,t.originY)}function hm(e,t){return cm(UE(e.getBoundingClientRect(),t))}function QE(e,t,n){const r=hm(e,n),{scroll:o}=t;return o&&(Dn(r.x,o.offset.x),Dn(r.y,o.offset.y)),r}const pm=({current:e})=>e?e.ownerDocument.defaultView:null,du=(e,t)=>Math.abs(e-t);function eM(e,t){const n=du(e.x,t.x),r=du(e.y,t.y);return Math.sqrt(n**2+r**2)}class mm{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=qs(this.lastMoveEventInfo,this.history),h=this.startEvent!==null,f=eM(d.offset,{x:0,y:0})>=3;if(!h&&!f)return;const{point:S}=d,{timestamp:m}=De;this.history.push({...S,timestamp:m});const{onStart:w,onMove:g}=this.handlers;h||(w&&w(this.lastMoveEvent,d),this.startEvent=this.lastMoveEvent),g&&g(this.lastMoveEvent,d)},this.handlePointerMove=(d,h)=>{this.lastMoveEvent=d,this.lastMoveEventInfo=Gs(h,this.transformPagePoint),ve.update(this.updatePoint,!0)},this.handlePointerUp=(d,h)=>{this.end();const{onEnd:f,onSessionEnd:S,resumeAnimation:m}=this.handlers;if(this.dragSnapToOrigin&&m&&m(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const w=qs(d.type==="pointercancel"?this.lastMoveEventInfo:Gs(h,this.transformPagePoint),this.history);this.startEvent&&f&&f(d,w),S&&S(d,w)},!uc(t))return;this.dragSnapToOrigin=s,this.handlers=n,this.transformPagePoint=r,this.contextWindow=o||window;const i=Yr(t),a=Gs(i,this.transformPagePoint),{point:c}=a,{timestamp:l}=De;this.history=[{...c,timestamp:l}];const{onSessionStart:u}=n;u&&u(t,qs(a,this.history)),this.removeListeners=Wr(hr(this.contextWindow,"pointermove",this.handlePointerMove),hr(this.contextWindow,"pointerup",this.handlePointerUp),hr(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),zt(this.updatePoint)}}function Gs(e,t){return t?{point:t(e.point)}:e}function fu(e,t){return{x:e.x-t.x,y:e.y-t.y}}function qs({point:e},t){return{point:e,delta:fu(e,gm(t)),offset:fu(e,tM(t)),velocity:nM(t,.1)}}function tM(e){return e[0]}function gm(e){return e[e.length-1]}function nM(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const o=gm(e);for(;n>=0&&(r=e[n],!(o.timestamp-r.timestamp>et(t)));)n--;if(!r)return{x:0,y:0};const s=ut(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 rM(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?ge(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?ge(n,e,r.max):Math.min(e,n)),e}function hu(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 oM(e,{top:t,left:n,bottom:r,right:o}){return{x:hu(e.x,n,o),y:hu(e.y,t,r)}}function pu(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 sM(e,t){return{x:pu(e.x,t.x),y:pu(e.y,t.y)}}function iM(e,t){let n=.5;const r=ke(e),o=ke(t);return o>r?n=Cr(t.min,t.max-r,e.min):r>o&&(n=Cr(e.min,e.max-o,t.min)),wt(0,1,n)}function aM(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 Yi=.35;function cM(e=Yi){return e===!1?e=0:e===!0&&(e=Yi),{x:mu(e,"left","right"),y:mu(e,"top","bottom")}}function mu(e,t,n){return{min:gu(e,t),max:gu(e,n)}}function gu(e,t){return typeof e=="number"?e:e[t]||0}const lM=new WeakMap;class uM{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=xe(),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(Yr(u).point)},s=(u,d)=>{const{drag:h,dragPropagation:f,onDragStart:S}=this.getProps();if(h&&!f&&(this.openDragLock&&this.openDragLock(),this.openDragLock=MD(h),!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),Ke(w=>{let g=this.getAxisMotionValue(w).get()||0;if(dt.test(g)){const{projection:p}=this.visualElement;if(p&&p.layout){const v=p.layout.layoutBox[w];v&&(g=ke(v)*(parseFloat(g)/100))}}this.originPoint[w]=g}),S&&ve.postRender(()=>S(u,d)),zi(this.visualElement,"transform");const{animationState:m}=this.visualElement;m&&m.setActive("whileDrag",!0)},i=(u,d)=>{const{dragPropagation:h,dragDirectionLock:f,onDirectionLock:S,onDrag:m}=this.getProps();if(!h&&!this.openDragLock)return;const{offset:w}=d;if(f&&this.currentDirection===null){this.currentDirection=dM(w),this.currentDirection!==null&&S&&S(this.currentDirection);return}this.updateAxis("x",d.point,w),this.updateAxis("y",d.point,w),this.visualElement.render(),m&&m(u,d)},a=(u,d)=>this.stop(u,d),c=()=>Ke(u=>{var d;return this.getAnimationState(u)==="paused"&&((d=this.getAxisMotionValue(u).animation)==null?void 0:d.play())}),{dragSnapToOrigin:l}=this.getProps();this.panSession=new mm(t,{onSessionStart:o,onStart:s,onMove:i,onSessionEnd:a,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:l,contextWindow:pm(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&&ve.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||!io(t,o,this.currentDirection))return;const s=this.getAxisMotionValue(t);let i=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(i=rM(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&&Cn(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=oM(r.layoutBox,t):this.constraints=!1,this.elastic=cM(n),o!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&Ke(i=>{this.constraints!==!1&&this.getAxisMotionValue(i)&&(this.constraints[i]=aM(r.layoutBox[i],this.constraints[i]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!Cn(t))return!1;const r=t.current;St(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=QE(r,o.root,this.visualElement.getTransformPagePoint());let i=sM(o.layout.layoutBox,s);if(n){const a=n(HE(i));this.hasMutatedConstraints=!!a,a&&(i=cm(a))}return i}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:o,dragTransition:s,dragSnapToOrigin:i,onDragTransitionEnd:a}=this.getProps(),c=this.constraints||{},l=Ke(u=>{if(!io(u,n,this.currentDirection))return;let d=c&&c[u]||{};i&&(d={min:0,max:0});const h=o?200:1e6,f=o?40:1e7,S={type:"inertia",velocity:r?t[u]:0,bounceStiffness:h,bounceDamping:f,timeConstant:750,restDelta:1,restSpeed:10,...s,...d};return this.startAxisValueAnimation(u,S)});return Promise.all(l).then(a)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return zi(this.visualElement,t),r.start(bc(t,r,0,n,this.visualElement,!1))}stopAnimation(){Ke(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){Ke(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){Ke(n=>{const{drag:r}=this.getProps();if(!io(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]-ge(i,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!Cn(n)||!r||!this.constraints)return;this.stopAnimation();const o={x:0,y:0};Ke(i=>{const a=this.getAxisMotionValue(i);if(a&&this.constraints!==!1){const c=a.get();o[i]=iM({min:c,max:c},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(),Ke(i=>{if(!io(i,t,null))return;const a=this.getAxisMotionValue(i),{min:c,max:l}=this.constraints[i];a.set(ge(c,l,o[i]))})}addListeners(){if(!this.visualElement.current)return;lM.set(this.visualElement,this);const t=this.visualElement.current,n=hr(t,"pointerdown",c=>{const{drag:l,dragListener:u=!0}=this.getProps();l&&u&&this.start(c)}),r=()=>{const{dragConstraints:c}=this.getProps();Cn(c)&&c.current&&(this.constraints=this.resolveRefConstraints())},{projection:o}=this.visualElement,s=o.addEventListener("measure",r);o&&!o.layout&&(o.root&&o.root.updateScroll(),o.updateLayout()),ve.read(r);const i=Pr(window,"resize",()=>this.scalePositionWithinConstraints()),a=o.addEventListener("didUpdate",({delta:c,hasLayoutChanged:l})=>{this.isDragging&&l&&(Ke(u=>{const d=this.getAxisMotionValue(u);d&&(this.originPoint[u]+=c[u].translate,d.set(d.get()+c[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=Yi,dragMomentum:a=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:o,dragConstraints:s,dragElastic:i,dragMomentum:a}}}function io(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function dM(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class fM extends Yt{constructor(t){super(t),this.removeGroupControls=Xe,this.removeListeners=Xe,this.controls=new uM(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Xe}unmount(){this.removeGroupControls(),this.removeListeners()}}const vu=e=>(t,n)=>{e&&ve.postRender(()=>e(t,n))};class hM extends Yt{constructor(){super(...arguments),this.removePointerDownListener=Xe}onPointerDown(t){this.session=new mm(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:pm(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:o}=this.node.getProps();return{onSessionStart:vu(t),onStart:vu(n),onMove:r,onEnd:(s,i)=>{delete this.session,o&&ve.postRender(()=>o(s,i))}}}mount(){this.removePointerDownListener=hr(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 So={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function yu(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Qn={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(re.test(e))e=parseFloat(e);else return e;const n=yu(e,t.target.x),r=yu(e,t.target.y);return`${n}% ${r}%`}},pM={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,o=Wt.parse(e);if(o.length>5)return r;const s=Wt.createTransformer(e),i=typeof o[0]!="number"?1:0,a=n.x.scale*t.x,c=n.y.scale*t.y;o[0+i]/=a,o[1+i]/=c;const l=ge(a,c,.5);return typeof o[2+i]=="number"&&(o[2+i]/=l),typeof o[3+i]=="number"&&(o[3+i]/=l),s(o)}};class mM extends E.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:o}=this.props,{projection:s}=t;QD(gM),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()})),So.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()||ve.postRender(()=>{const a=i.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),lc.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 vm(e){const[t,n]=jD(),r=E.useContext(Qh);return x.jsx(mM,{...e,layoutGroup:r,switchLayoutGroup:E.useContext(qp),isPresent:t,safeToRemove:n})}const gM={borderRadius:{...Qn,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Qn,borderTopRightRadius:Qn,borderBottomLeftRadius:Qn,borderBottomRightRadius:Qn,boxShadow:pM};function vM(e,t,n){const r=Pe(e)?e:_n(e);return r.start(bc("",r,t,n)),r.animation}const yM=(e,t)=>e.depth-t.depth;class bM{constructor(){this.children=[],this.isDirty=!1}add(t){Ha(this.children,t),this.isDirty=!0}remove(t){Ua(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(yM),this.isDirty=!1,this.children.forEach(t)}}function xM(e,t){const n=je.now(),r=({timestamp:o})=>{const s=o-n;s>=t&&(zt(r),e(s-t))};return ve.setup(r,!0),()=>zt(r)}const ym=["TopLeft","TopRight","BottomLeft","BottomRight"],wM=ym.length,bu=e=>typeof e=="string"?parseFloat(e):e,xu=e=>typeof e=="number"||re.test(e);function SM(e,t,n,r,o,s){o?(e.opacity=ge(0,n.opacity??1,CM(r)),e.opacityExit=ge(t.opacity??1,0,TM(r))):s&&(e.opacity=ge(t.opacity??1,n.opacity??1,r));for(let i=0;i<wM;i++){const a=`border${ym[i]}Radius`;let c=wu(t,a),l=wu(n,a);if(c===void 0&&l===void 0)continue;c||(c=0),l||(l=0),c===0||l===0||xu(c)===xu(l)?(e[a]=Math.max(ge(bu(c),bu(l),r),0),(dt.test(l)||dt.test(c))&&(e[a]+="%")):e[a]=l}(t.rotate||n.rotate)&&(e.rotate=ge(t.rotate||0,n.rotate||0,r))}function wu(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const CM=bm(0,.5,up),TM=bm(.5,.95,Xe);function bm(e,t,n){return r=>r<e?0:r>t?1:n(Cr(e,t,r))}function Su(e,t){e.min=t.min,e.max=t.max}function Ye(e,t){Su(e.x,t.x),Su(e.y,t.y)}function Cu(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function Tu(e,t,n,r,o){return e-=t,e=$o(e,1/n,r),o!==void 0&&(e=$o(e,1/o,r)),e}function DM(e,t=0,n=1,r=.5,o,s=e,i=e){if(dt.test(t)&&(t=parseFloat(t),t=ge(i.min,i.max,t/100)-i.min),typeof t!="number")return;let a=ge(s.min,s.max,r);e===s&&(a-=t),e.min=Tu(e.min,t,n,a,o),e.max=Tu(e.max,t,n,a,o)}function Du(e,t,[n,r,o],s,i){DM(e,t[n],t[r],t[o],t.scale,s,i)}const EM=["x","scaleX","originX"],MM=["y","scaleY","originY"];function Eu(e,t,n,r){Du(e.x,t,EM,n?n.x:void 0,r?r.x:void 0),Du(e.y,t,MM,n?n.y:void 0,r?r.y:void 0)}function Mu(e){return e.translate===0&&e.scale===1}function xm(e){return Mu(e.x)&&Mu(e.y)}function Ru(e,t){return e.min===t.min&&e.max===t.max}function RM(e,t){return Ru(e.x,t.x)&&Ru(e.y,t.y)}function Pu(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function wm(e,t){return Pu(e.x,t.x)&&Pu(e.y,t.y)}function Au(e){return ke(e.x)/ke(e.y)}function Ou(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class PM{constructor(){this.members=[]}add(t){Ha(this.members,t),t.scheduleRender()}remove(t){if(Ua(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 AM(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:l,rotate:u,rotateX:d,rotateY:h,skewX:f,skewY:S}=n;l&&(r=`perspective(${l}px) ${r}`),u&&(r+=`rotate(${u}deg) `),d&&(r+=`rotateX(${d}deg) `),h&&(r+=`rotateY(${h}deg) `),f&&(r+=`skewX(${f}deg) `),S&&(r+=`skewY(${S}deg) `)}const a=e.x.scale*t.x,c=e.y.scale*t.y;return(a!==1||c!==1)&&(r+=`scale(${a}, ${c})`),r||"none"}const Xs=["","X","Y","Z"],OM={visibility:"hidden"},kM=1e3;let _M=0;function Zs(e,t,n,r){const{latestValues:o}=t;o[e]&&(n[e]=o[e],t.setStaticValue(e,0),r&&(r[e]=0))}function Sm(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=om(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:o,layoutId:s}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",ve,!(o||s))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&Sm(r)}function Cm({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:o}){return class{constructor(i={},a=t==null?void 0:t()){this.id=_M++,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(jM),this.nodes.forEach(BM),this.nodes.forEach(zM),this.nodes.forEach(LM)},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 c=0;c<this.path.length;c++)this.path[c].shouldResetTransform=!0;this.root===this&&(this.nodes=new bM)}addEventListener(i,a){return this.eventHandlers.has(i)||this.eventHandlers.set(i,new Ka),this.eventHandlers.get(i).add(a)}notifyListeners(i,...a){const c=this.eventHandlers.get(i);c&&c.notify(...a)}hasListeners(i){return this.eventHandlers.has(i)}mount(i){if(this.instance)return;this.isSVG=Wp(i)&&!_D(i),this.instance=i;const{layoutId:a,layout:c,visualElement:l}=this.options;if(l&&!l.current&&l.mount(i),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(c||a)&&(this.isLayoutDirty=!0),e){let u;const d=()=>this.root.updateBlockedByResize=!1;e(i,()=>{this.root.updateBlockedByResize=!0,u&&u(),u=xM(d,250),So.hasAnimatedSinceResize&&(So.hasAnimatedSinceResize=!1,this.nodes.forEach(_u))})}a&&this.root.registerSharedNode(a,this),this.options.animate!==!1&&l&&(a||c)&&this.addEventListener("didUpdate",({delta:u,hasLayoutChanged:d,hasRelativeLayoutChanged:h,layout:f})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const S=this.options.transition||l.getDefaultTransition()||KM,{onLayoutAnimationStart:m,onLayoutAnimationComplete:w}=l.getProps(),g=!this.targetLayout||!wm(this.targetLayout,f),p=!d&&h;if(this.options.layoutRoot||this.resumeFrom||p||d&&(g||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(u,p);const v={...ac(S,"layout"),onPlay:m,onComplete:w};(l.shouldReduceMotion||this.options.layoutRoot)&&(v.delay=0,v.type=!1),this.startAnimation(v)}else d||_u(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(),zt(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(WM),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&&Sm(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:c}=this.options;if(a===void 0&&!c)return;const l=this.getTransformTemplate();this.prevTransformTemplateValue=l?l(this.latestValues,""):void 0,this.updateSnapshot(),i&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(ku);return}this.isUpdating||this.nodes.forEach(FM),this.isUpdating=!1,this.nodes.forEach($M),this.nodes.forEach(NM),this.nodes.forEach(IM),this.clearAllSnapshots();const a=je.now();De.delta=wt(0,1e3/60,a-De.timestamp),De.timestamp=a,De.isProcessing=!0,zs.update.process(De),zs.preRender.process(De),zs.render.process(De),De.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,lc.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(VM),this.sharedNodes.forEach(HM)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,ve.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){ve.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!ke(this.snapshot.measuredBox.x)&&!ke(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 c=0;c<this.path.length;c++)this.path[c].updateScroll();const i=this.layout;this.layout=this.measure(!1),this.layoutCorrected=xe(),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 c=r(this.instance);this.scroll={animationId:this.root.animationId,phase:i,isRoot:c,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:c}}}resetTransform(){if(!o)return;const i=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,a=this.projectionDelta&&!xm(this.projectionDelta),c=this.getTransformTemplate(),l=c?c(this.latestValues,""):void 0,u=l!==this.prevTransformTemplateValue;i&&this.instance&&(a||Qt(this.latestValues)||u)&&(o(this.instance,l),this.shouldResetTransform=!1,this.scheduleRender())}measure(i=!0){const a=this.measurePageBox();let c=this.removeElementScroll(a);return i&&(c=this.removeTransform(c)),GM(c),{animationId:this.root.animationId,measuredBox:a,layoutBox:c,latestValues:{},source:this.id}}measurePageBox(){var l;const{visualElement:i}=this.options;if(!i)return xe();const a=i.measureViewportBox();if(!(((l=this.scroll)==null?void 0:l.wasRoot)||this.path.some(qM))){const{scroll:u}=this.root;u&&(Dn(a.x,u.offset.x),Dn(a.y,u.offset.y))}return a}removeElementScroll(i){var c;const a=xe();if(Ye(a,i),(c=this.scroll)!=null&&c.wasRoot)return a;for(let l=0;l<this.path.length;l++){const u=this.path[l],{scroll:d,options:h}=u;u!==this.root&&d&&h.layoutScroll&&(d.wasRoot&&Ye(a,i),Dn(a.x,d.offset.x),Dn(a.y,d.offset.y))}return a}applyTransform(i,a=!1){const c=xe();Ye(c,i);for(let l=0;l<this.path.length;l++){const u=this.path[l];!a&&u.options.layoutScroll&&u.scroll&&u!==u.root&&En(c,{x:-u.scroll.offset.x,y:-u.scroll.offset.y}),Qt(u.latestValues)&&En(c,u.latestValues)}return Qt(this.latestValues)&&En(c,this.latestValues),c}removeTransform(i){const a=xe();Ye(a,i);for(let c=0;c<this.path.length;c++){const l=this.path[c];if(!l.instance||!Qt(l.latestValues))continue;Hi(l.latestValues)&&l.updateSnapshot();const u=xe(),d=l.measurePageBox();Ye(u,d),Eu(a,l.latestValues,l.snapshot?l.snapshot.layoutBox:void 0,u)}return Qt(this.latestValues)&&Eu(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!==De.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(i=!1){var h;const a=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=a.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=a.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=a.isSharedProjectionDirty);const c=!!this.resumingFrom||this!==a;if(!(i||c&&this.isSharedProjectionDirty||this.isProjectionDirty||(h=this.parent)!=null&&h.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:u,layoutId:d}=this.options;if(!(!this.layout||!(u||d))){if(this.resolvedRelativeTargetAt=De.timestamp,!this.targetDelta&&!this.relativeTarget){const f=this.getClosestProjectingParent();f&&f.layout&&this.animationProgress!==1?(this.relativeParent=f,this.forceRelativeParentToResolveTarget(),this.relativeTarget=xe(),this.relativeTargetOrigin=xe(),mr(this.relativeTargetOrigin,this.layout.layoutBox,f.layout.layoutBox),Ye(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=xe(),this.targetWithTransforms=xe()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),ZE(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):Ye(this.target,this.layout.layoutBox),fm(this.target,this.targetDelta)):Ye(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=xe(),this.relativeTargetOrigin=xe(),mr(this.relativeTargetOrigin,this.target,f.target),Ye(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}}}getClosestProjectingParent(){if(!(!this.parent||Hi(this.parent.latestValues)||dm(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 S;const i=this.getLead(),a=!!this.resumingFrom||this!==i;let c=!0;if((this.isProjectionDirty||(S=this.parent)!=null&&S.isProjectionDirty)&&(c=!1),a&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(c=!1),this.resolvedRelativeTargetAt===De.timestamp&&(c=!1),c)return;const{layout:l,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||!(l||u))return;Ye(this.layoutCorrected,this.layout.layoutBox);const d=this.treeScale.x,h=this.treeScale.y;JE(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=xe());const{target:f}=i;if(!f){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(Cu(this.prevProjectionDelta.x,this.projectionDelta.x),Cu(this.prevProjectionDelta.y,this.projectionDelta.y)),pr(this.projectionDelta,this.layoutCorrected,f,this.latestValues),(this.treeScale.x!==d||this.treeScale.y!==h||!Ou(this.projectionDelta.x,this.prevProjectionDelta.x)||!Ou(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 c=this.getStack();c&&c.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Tn(),this.projectionDelta=Tn(),this.projectionDeltaWithTransform=Tn()}setAnimationOrigin(i,a=!1){const c=this.snapshot,l=c?c.latestValues:{},u={...this.latestValues},d=Tn();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const h=xe(),f=c?c.source:void 0,S=this.layout?this.layout.source:void 0,m=f!==S,w=this.getStack(),g=!w||w.members.length<=1,p=!!(m&&!g&&this.options.crossfade===!0&&!this.path.some(YM));this.animationProgress=0;let v;this.mixTargetDelta=C=>{const y=C/1e3;Nu(d.x,i.x,y),Nu(d.y,i.y,y),this.setTargetDelta(d),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(mr(h,this.layout.layoutBox,this.relativeParent.layout.layoutBox),UM(this.relativeTarget,this.relativeTargetOrigin,h,y),v&&RM(this.relativeTarget,v)&&(this.isProjectionDirty=!1),v||(v=xe()),Ye(v,this.relativeTarget)),m&&(this.animationValues=u,SM(u,l,this.latestValues,y,p,g)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=y},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(i){var a,c,l;this.notifyListeners("animationStart"),(a=this.currentAnimation)==null||a.stop(!1),(l=(c=this.resumingFrom)==null?void 0:c.currentAnimation)==null||l.stop(!1),this.pendingAnimation&&(zt(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=ve.update(()=>{So.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=_n(0)),this.currentAnimation=vM(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(kM),this.currentAnimation.stop(!1)),this.completeAnimation()}applyTransformsToTarget(){const i=this.getLead();let{targetWithTransforms:a,target:c,layout:l,latestValues:u}=i;if(!(!a||!c||!l)){if(this!==i&&this.layout&&l&&Tm(this.options.animationType,this.layout.layoutBox,l.layoutBox)){c=this.target||xe();const d=ke(this.layout.layoutBox.x);c.x.min=i.target.x.min,c.x.max=c.x.min+d;const h=ke(this.layout.layoutBox.y);c.y.min=i.target.y.min,c.y.max=c.y.min+h}Ye(a,c),En(a,u),pr(this.projectionDeltaWithTransform,this.layoutCorrected,a,u)}}registerSharedNode(i,a){this.sharedNodes.has(i)||this.sharedNodes.set(i,new PM),this.sharedNodes.get(i).add(a);const l=a.options.initialPromotionConfig;a.promote({transition:l?l.transition:void 0,preserveFollowOpacity:l&&l.shouldPreserveFollowOpacity?l.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:c}={}){const l=this.getStack();l&&l.promote(this,c),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:c}=i;if((c.z||c.rotate||c.rotateX||c.rotateY||c.rotateZ||c.skewX||c.skewY)&&(a=!0),!a)return;const l={};c.z&&Zs("z",i,l,this.animationValues);for(let u=0;u<Xs.length;u++)Zs(`rotate${Xs[u]}`,i,l,this.animationValues),Zs(`skew${Xs[u]}`,i,l,this.animationValues);i.render();for(const u in l)i.setStaticValue(u,l[u]),this.animationValues&&(this.animationValues[u]=l[u]);i.scheduleRender()}getProjectionStyles(i){if(!this.instance||this.isSVG)return;if(!this.isVisible)return OM;const a={visibility:""},c=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,a.opacity="",a.pointerEvents=wo(i==null?void 0:i.pointerEvents)||"",a.transform=c?c(this.latestValues,""):"none",a;const l=this.getLead();if(!this.projectionDelta||!this.layout||!l.target){const f={};return this.options.layoutId&&(f.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,f.pointerEvents=wo(i==null?void 0:i.pointerEvents)||""),this.hasProjected&&!Qt(this.latestValues)&&(f.transform=c?c({},""):"none",this.hasProjected=!1),f}const u=l.animationValues||l.latestValues;this.applyTransformsToTarget(),a.transform=AM(this.projectionDeltaWithTransform,this.treeScale,u),c&&(a.transform=c(u,a.transform));const{x:d,y:h}=this.projectionDelta;a.transformOrigin=`${d.origin*100}% ${h.origin*100}% 0`,l.animationValues?a.opacity=l===this?u.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:u.opacityExit:a.opacity=l===this?u.opacity!==void 0?u.opacity:"":u.opacityExit!==void 0?u.opacityExit:0;for(const f in Mr){if(u[f]===void 0)continue;const{correct:S,applyTo:m,isCSSVariable:w}=Mr[f],g=a.transform==="none"?u[f]:S(u[f],l);if(m){const p=m.length;for(let v=0;v<p;v++)a[m[v]]=g}else w?this.options.visualElement.renderState.vars[f]=g:a[f]=g}return this.options.layoutId&&(a.pointerEvents=l===this?wo(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(ku),this.root.sharedNodes.clear()}}}function NM(e){e.updateLayout()}function IM(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"?Ke(d=>{const h=i?t.measuredBox[d]:t.layoutBox[d],f=ke(h);h.min=r[d].min,h.max=h.min+f}):Tm(s,t.layoutBox,r)&&Ke(d=>{const h=i?t.measuredBox[d]:t.layoutBox[d],f=ke(r[d]);h.max=h.min+f,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[d].max=e.relativeTarget[d].min+f)});const a=Tn();pr(a,r,t.layoutBox);const c=Tn();i?pr(c,e.applyTransform(o,!0),t.measuredBox):pr(c,r,t.layoutBox);const l=!xm(a);let u=!1;if(!e.resumeFrom){const d=e.getClosestProjectingParent();if(d&&!d.resumeFrom){const{snapshot:h,layout:f}=d;if(h&&f){const S=xe();mr(S,t.layoutBox,h.layoutBox);const m=xe();mr(m,r,f.layoutBox),wm(S,m)||(u=!0),d.options.layoutRoot&&(e.relativeTarget=m,e.relativeTargetOrigin=S,e.relativeParent=d)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:t,delta:c,layoutDelta:a,hasLayoutChanged:l,hasRelativeLayoutChanged:u})}else if(e.isLead()){const{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function jM(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 LM(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function VM(e){e.clearSnapshot()}function ku(e){e.clearMeasurements()}function FM(e){e.isLayoutDirty=!1}function $M(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function _u(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function BM(e){e.resolveTargetDelta()}function zM(e){e.calcProjection()}function WM(e){e.resetSkewAndRotation()}function HM(e){e.removeLeadSnapshot()}function Nu(e,t,n){e.translate=ge(t.translate,0,n),e.scale=ge(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function Iu(e,t,n,r){e.min=ge(t.min,n.min,r),e.max=ge(t.max,n.max,r)}function UM(e,t,n,r){Iu(e.x,t.x,n.x,r),Iu(e.y,t.y,n.y,r)}function YM(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const KM={duration:.45,ease:[.4,0,.1,1]},ju=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),Lu=ju("applewebkit/")&&!ju("chrome/")?Math.round:Xe;function Vu(e){e.min=Lu(e.min),e.max=Lu(e.max)}function GM(e){Vu(e.x),Vu(e.y)}function Tm(e,t,n){return e==="position"||e==="preserve-aspect"&&!XE(Au(t),Au(n),.2)}function qM(e){var t;return e!==e.root&&((t=e.scroll)==null?void 0:t.wasRoot)}const XM=Cm({attachResizeListener:(e,t)=>Pr(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),Js={current:void 0},Dm=Cm({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Js.current){const e=new XM({});e.mount(window),e.setOptions({layoutScroll:!0}),Js.current=e}return Js.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),ZM={pan:{Feature:hM},drag:{Feature:fM,ProjectionNode:Dm,MeasureLayout:vm}};function Fu(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&&ve.postRender(()=>s(t,Yr(t)))}class JM extends Yt{mount(){const{current:t}=this.node;t&&(this.unmount=RD(t,(n,r)=>(Fu(this.node,r,"Start"),o=>Fu(this.node,o,"End"))))}unmount(){}}class QM extends Yt{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=Wr(Pr(this.node.current,"focus",()=>this.onFocus()),Pr(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function $u(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&&ve.postRender(()=>s(t,Yr(t)))}class eR extends Yt{mount(){const{current:t}=this.node;t&&(this.unmount=kD(t,(n,r)=>($u(this.node,r,"Start"),(o,{success:s})=>$u(this.node,o,s?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const Ki=new WeakMap,Qs=new WeakMap,tR=e=>{const t=Ki.get(e.target);t&&t(e)},nR=e=>{e.forEach(tR)};function rR({root:e,...t}){const n=e||document;Qs.has(n)||Qs.set(n,{});const r=Qs.get(n),o=JSON.stringify(t);return r[o]||(r[o]=new IntersectionObserver(nR,{root:e,...t})),r[o]}function oR(e,t,n){const r=rR(t);return Ki.set(e,n),r.observe(e),()=>{Ki.delete(e),r.unobserve(e)}}const sR={some:0,all:1};class iR extends Yt{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:sR[o]},a=c=>{const{isIntersecting:l}=c;if(this.isInView===l||(this.isInView=l,s&&!l&&this.hasEnteredView))return;l&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",l);const{onViewportEnter:u,onViewportLeave:d}=this.node.getProps(),h=l?u:d;h&&h(c)};return oR(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(aR(t,n))&&this.startObserver()}unmount(){}}function aR({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const cR={inView:{Feature:iR},tap:{Feature:eR},focus:{Feature:QM},hover:{Feature:JM}},lR={layout:{ProjectionNode:Dm,MeasureLayout:vm}},Gi={current:null},Em={current:!1};function uR(){if(Em.current=!0,!!za)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>Gi.current=e.matches;e.addListener(t),t()}else Gi.current=!1}const dR=new WeakMap;function fR(e,t,n){for(const r in t){const o=t[r],s=n[r];if(Pe(o))e.addValue(r,o);else if(Pe(s))e.addValue(r,_n(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,_n(i!==void 0?i:o,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const Bu=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class hR{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=ic,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 h=je.now();this.renderScheduledAt<h&&(this.renderScheduledAt=h,ve.render(this.render,!1,!0))};const{latestValues:c,renderState:l}=i;this.latestValues=c,this.baseTarget={...c},this.initialValues=n.initial?{...c}:{},this.renderState=l,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=ms(n),this.isVariantNode=Kp(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:u,...d}=this.scrapeMotionValuesFromProps(n,{},this);for(const h in d){const f=d[h];c[h]!==void 0&&Pe(f)&&f.set(c[h],!1)}}mount(t){this.current=t,dR.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)),Em.current||uR(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:Gi.current,process.env.NODE_ENV!=="production"&&Ga(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(),zt(this.notifyUpdate),zt(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=Un.has(t);r&&this.onBindTransform&&this.onBindTransform();const o=n.on("change",a=>{this.latestValues[t]=a,this.props.onUpdate&&ve.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 Nn){const n=Nn[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):xe()}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<Bu.length;r++){const o=Bu[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=fR(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=_n(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"&&(ep(r)||np(r))?r=parseFloat(r):!ID(r)&&Wt.test(n)&&(r=Vp(t,n)),this.setBaseTarget(t,Pe(r)?r.get():r)),Pe(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=vc(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&&!Pe(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 Ka),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}}class Mm extends hR{constructor(){super(...arguments),this.KeyframeResolver=CD}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;Pe(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function Rm(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 pR(e){return window.getComputedStyle(e)}class mR extends Mm{constructor(){super(...arguments),this.type="html",this.renderInstance=Rm}readValueFromInstance(t,n){var r;if(Un.has(n))return(r=this.projection)!=null&&r.isProjecting?Ii(n):BT(t,n);{const o=pR(t),s=(Za(n)?o.getPropertyValue(n):o[n])||0;return typeof s=="string"?s.trim():s}}measureInstanceViewportBox(t,{transformPagePoint:n}){return hm(t,n)}build(t,n,r){pc(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return yc(t,n,r)}}const Pm=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 gR(e,t,n,r){Rm(e,t,void 0,r);for(const o in t.attrs)e.setAttribute(Pm.has(o)?o:hc(o),t.attrs[o])}class vR extends Mm{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=xe}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(Un.has(n)){const r=Lp(n);return r&&r.default||0}return n=Pm.has(n)?n:hc(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return rm(t,n,r)}build(t,n,r){Qp(t,n,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(t,n,r,o){gR(t,n,r,o)}mount(t){this.isSVGTag=tm(t.tagName),super.mount(t)}}const yR=(e,t)=>gc(e)?new vR(t):new mR(t,{allowProjection:e!==E.Fragment}),bR=gE({...zE,...cR,...ZM,...lR},yR),xR=BD(bR),wR=({children:e})=>x.jsx(By,{modifiers:[LC],dropAnimation:{duration:500,easing:"cubic-bezier(0.18, 0.67, 0.6, 1.22)"},className:"Draggable dragging",children:x.jsx(xR.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})}),xc=Ho(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}))}})),SR=-Math.abs(1.98),Am=({booking:e,onAddTime:t,onAddStartTime:n,onSubTime:r,starter:o=!1})=>{const[s,i]=E.useState({height:jt,width:jt}),[a,c]=E.useState(0),l=(M,b)=>{const T=Z.timeDiffInSeconds(M,b),R=Math.ceil(T/li);return-Math.abs((R-1)*2)},[u,d]=E.useState(o?l(e.finishAt,e.startAt):0),h=M=>M===-Math.abs(0)||M===0,f=()=>Z.timeDiffInSeconds(e.finishAt,e.startAt)===li,S=async M=>{if(M.includes("n")){const b=g(e.startAt,"add");if(f())return;c(T=>T+2),n&&n(b)}else{const b=w(e.finishAt,"add");d(T=>h(T)?SR:T-2),t&&t(b)}},m=async M=>{if(M.includes("n")){const T=g(e.startAt,"remove");c(R=>R-2),n&&n(T);return}const b=w(e.finishAt,"remove");f()||(d(T=>T+2),r&&r(b))},w=(M,b)=>{const T=new Date(M),R=T.getMinutes();return b==="add"&&T.setMinutes(R+15),b==="remove"&&T.setMinutes(R-15),T},g=(M,b)=>{const T=new Date(M),R=T.getMinutes();return b==="add"&&T.setMinutes(R+15),b==="remove"&&T.setMinutes(R-15),T};return{state:s,setState:i,resetState:()=>{i({height:jt,width:jt})},resetHeightStyle:()=>{d(0)},heightStyle:u,topHeightIncrement:a,onResize:(M,{size:b,handle:T})=>{switch(M.stopPropagation(),M.preventDefault(),T){case"se":case"s":{i(R=>(Number(R.height)<Number(b.height)&&S(["s","se"]),Number(R.height)>Number(b.height)&&m(["s","se"]),{...R,height:b.height}));break}case"n":{i(R=>Math.abs(Number(b.height-Number(R.height)))<10?{...R,height:b.height}:(+(R.height<Number(b.height))&&m(["n"]),+(R.height>Number(b.height))&&S(["n"]),{...R,height:b.height}));break}}},updateHeightStyle:(M,b)=>{d(l(M,b))}}};var wc="Popover",[Om,jA]=Ht(wc,[Ut]),Kr=Ut(),[CR,Kt]=Om(wc),km=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:o,onOpenChange:s,modal:i=!1}=e,a=Kr(t),c=D.useRef(null),[l,u]=D.useState(!1),[d=!1,h]=ln({prop:r,defaultProp:o,onChange:s});return x.jsx(es,{...a,children:x.jsx(CR,{scope:t,contentId:Vt(),triggerRef:c,open:d,onOpenChange:h,onOpenToggle:D.useCallback(()=>h(f=>!f),[h]),hasCustomAnchor:l,onCustomAnchorAdd:D.useCallback(()=>u(!0),[]),onCustomAnchorRemove:D.useCallback(()=>u(!1),[]),modal:i,children:n})})};km.displayName=wc;var _m="PopoverAnchor",Nm=D.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=Kt(_m,n),s=Kr(n),{onCustomAnchorAdd:i,onCustomAnchorRemove:a}=o;return D.useEffect(()=>(i(),()=>a()),[i,a]),x.jsx(Vr,{...s,...r,ref:t})});Nm.displayName=_m;var Im="PopoverTrigger",jm=D.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=Kt(Im,n),s=Kr(n),i=fe(t,o.triggerRef),a=x.jsx(ae.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":Bm(o.open),...r,ref:i,onClick:te(e.onClick,o.onOpenToggle)});return o.hasCustomAnchor?a:x.jsx(Vr,{asChild:!0,...s,children:a})});jm.displayName=Im;var Sc="PopoverPortal",[TR,DR]=Om(Sc,{forceMount:void 0}),Lm=e=>{const{__scopePopover:t,forceMount:n,children:r,container:o}=e,s=Kt(Sc,t);return x.jsx(TR,{scope:t,forceMount:n,children:x.jsx(Dt,{present:n||s.open,children:x.jsx(Fr,{asChild:!0,container:o,children:r})})})};Lm.displayName=Sc;var In="PopoverContent",Vm=D.forwardRef((e,t)=>{const n=DR(In,e.__scopePopover),{forceMount:r=n.forceMount,...o}=e,s=Kt(In,e.__scopePopover);return x.jsx(Dt,{present:r||s.open,children:s.modal?x.jsx(MR,{...o,ref:t}):x.jsx(RR,{...o,ref:t})})});Vm.displayName=In;var ER=sn("PopoverContent.RemoveScroll"),MR=D.forwardRef((e,t)=>{const n=Kt(In,e.__scopePopover),r=D.useRef(null),o=fe(t,r),s=D.useRef(!1);return D.useEffect(()=>{const i=r.current;if(i)return Aa(i)},[]),x.jsx(us,{as:ER,allowPinchZoom:!0,children:x.jsx(Fm,{...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,c=a.button===0&&a.ctrlKey===!0,l=a.button===2||c;s.current=l},{checkForDefaultPrevented:!1}),onFocusOutside:te(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1})})})}),RR=D.forwardRef((e,t)=>{const n=Kt(In,e.__scopePopover),r=D.useRef(!1),o=D.useRef(!1);return x.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 c,l;(c=e.onInteractOutside)==null||c.call(e,s),s.defaultPrevented||(r.current=!0,s.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const i=s.target;((l=n.triggerRef.current)==null?void 0:l.contains(i))&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&o.current&&s.preventDefault()}})}),Fm=D.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:s,disableOutsidePointerEvents:i,onEscapeKeyDown:a,onPointerDownOutside:c,onFocusOutside:l,onInteractOutside:u,...d}=e,h=Kt(In,n),f=Kr(n);return Pa(),x.jsx(as,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:s,children:x.jsx(jr,{asChild:!0,disableOutsidePointerEvents:i,onInteractOutside:u,onEscapeKeyDown:a,onPointerDownOutside:c,onFocusOutside:l,onDismiss:()=>h.onOpenChange(!1),children:x.jsx(ts,{"data-state":Bm(h.open),role:"dialog",id:h.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)"}})})})}),$m="PopoverClose",PR=D.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=Kt($m,n);return x.jsx(ae.button,{type:"button",...r,ref:t,onClick:te(e.onClick,()=>o.onOpenChange(!1))})});PR.displayName=$m;var AR="PopoverArrow",OR=D.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=Kr(n);return x.jsx(ns,{...o,...r,ref:t})});OR.displayName=AR;function Bm(e){return e?"open":"closed"}var kR=km,_R=Nm,NR=jm,IR=Lm,jR=Vm;function LR({...e}){return x.jsx(kR,{"data-slot":"popover",...e})}function VR({...e}){return x.jsx(NR,{"data-slot":"popover-trigger",...e})}function FR({className:e,align:t="center",sideOffset:n=4,...r}){return x.jsx(IR,{children:x.jsx(jR,{"data-slot":"popover-content",align:t,sideOffset:n,className:de("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 $R({...e}){return x.jsx(_R,{"data-slot":"popover-anchor",...e})}var BR="Toggle",zm=D.forwardRef((e,t)=>{const{pressed:n,defaultPressed:r=!1,onPressedChange:o,...s}=e,[i=!1,a]=ln({prop:n,onChange:o,defaultProp:r});return x.jsx(ae.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)})})});zm.displayName=BR;var zR=zm;const WR=fa("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 HR({className:e,variant:t,size:n,...r}){return x.jsx(zR,{"data-slot":"toggle",className:de(WR({variant:t,size:n,className:e})),...r})}const UR=()=>{const[e,t]=E.useState(!1);return x.jsx(Da,{children:x.jsxs(Jf,{children:[x.jsx(Qf,{asChild:!0,children:x.jsx("div",{children:x.jsx(HR,{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:x.jsx(Yy,{size:16,strokeWidth:2,"aria-hidden":"true"})})})}),x.jsx(eh,{className:"border border-input bg-popover px-2 py-1 text-xs text-muted-foreground",children:x.jsx("p",{children:e?"Remove bookmark":"Bookmark this"})})]})})};function zu(e,[t,n]){return Math.min(n,Math.max(t,e))}function YR(e){const t=D.useRef({value:e,previous:e});return D.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var KR=[" ","Enter","ArrowUp","ArrowDown"],GR=[" ","Enter"],Gr="Select",[gs,vs,qR]=Ma(Gr),[Yn,LA]=Ht(Gr,[qR,Ut]),ys=Ut(),[XR,Gt]=Yn(Gr),[ZR,JR]=Yn(Gr),Wm=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:o,onOpenChange:s,value:i,defaultValue:a,onValueChange:c,dir:l,name:u,autoComplete:d,disabled:h,required:f,form:S}=e,m=ys(t),[w,g]=D.useState(null),[p,v]=D.useState(null),[C,y]=D.useState(!1),M=Ra(l),[b=!1,T]=ln({prop:r,defaultProp:o,onChange:s}),[R,_]=ln({prop:i,defaultProp:a,onChange:c}),O=D.useRef(null),z=w?S||!!w.closest("form"):!0,[G,j]=D.useState(new Set),F=Array.from(G).map(N=>N.props.value).join(";");return x.jsx(es,{...m,children:x.jsxs(XR,{required:f,scope:t,trigger:w,onTriggerChange:g,valueNode:p,onValueNodeChange:v,valueNodeHasChildren:C,onValueNodeHasChildrenChange:y,contentId:Vt(),value:R,onValueChange:_,open:b,onOpenChange:T,dir:M,triggerPointerDownPosRef:O,disabled:h,children:[x.jsx(gs.Provider,{scope:t,children:x.jsx(ZR,{scope:e.__scopeSelect,onNativeOptionAdd:D.useCallback(N=>{j(k=>new Set(k).add(N))},[]),onNativeOptionRemove:D.useCallback(N=>{j(k=>{const P=new Set(k);return P.delete(N),P})},[]),children:n})}),z?x.jsxs(fg,{"aria-hidden":!0,required:f,tabIndex:-1,name:u,autoComplete:d,value:R,onChange:N=>_(N.target.value),disabled:h,form:S,children:[R===void 0?x.jsx("option",{value:""}):null,Array.from(G)]},F):null]})})};Wm.displayName=Gr;var Hm="SelectTrigger",Um=D.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...o}=e,s=ys(n),i=Gt(Hm,n),a=i.disabled||r,c=fe(t,i.onTriggerChange),l=vs(n),u=D.useRef("touch"),[d,h,f]=hg(m=>{const w=l().filter(v=>!v.disabled),g=w.find(v=>v.value===i.value),p=pg(w,m,g);p!==void 0&&i.onValueChange(p.value)}),S=m=>{a||(i.onOpenChange(!0),f()),m&&(i.triggerPointerDownPosRef.current={x:Math.round(m.pageX),y:Math.round(m.pageY)})};return x.jsx(Vr,{asChild:!0,...s,children:x.jsx(ae.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":dg(i.value)?"":void 0,...o,ref:c,onClick:te(o.onClick,m=>{m.currentTarget.focus(),u.current!=="mouse"&&S(m)}),onPointerDown:te(o.onPointerDown,m=>{u.current=m.pointerType;const w=m.target;w.hasPointerCapture(m.pointerId)&&w.releasePointerCapture(m.pointerId),m.button===0&&m.ctrlKey===!1&&m.pointerType==="mouse"&&(S(m),m.preventDefault())}),onKeyDown:te(o.onKeyDown,m=>{const w=d.current!=="";!(m.ctrlKey||m.altKey||m.metaKey)&&m.key.length===1&&h(m.key),!(w&&m.key===" ")&&KR.includes(m.key)&&(S(),m.preventDefault())})})})});Um.displayName=Hm;var Ym="SelectValue",Km=D.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,children:s,placeholder:i="",...a}=e,c=Gt(Ym,n),{onValueNodeHasChildrenChange:l}=c,u=s!==void 0,d=fe(t,c.onValueNodeChange);return _e(()=>{l(u)},[l,u]),x.jsx(ae.span,{...a,ref:d,style:{pointerEvents:"none"},children:dg(c.value)?x.jsx(x.Fragment,{children:i}):s})});Km.displayName=Ym;var QR="SelectIcon",Gm=D.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...o}=e;return x.jsx(ae.span,{"aria-hidden":!0,...o,ref:t,children:r||"▼"})});Gm.displayName=QR;var eP="SelectPortal",qm=e=>x.jsx(Fr,{asChild:!0,...e});qm.displayName=eP;var un="SelectContent",Xm=D.forwardRef((e,t)=>{const n=Gt(un,e.__scopeSelect),[r,o]=D.useState();if(_e(()=>{o(new DocumentFragment)},[]),!n.open){const s=r;return s?zo.createPortal(x.jsx(Zm,{scope:e.__scopeSelect,children:x.jsx(gs.Slot,{scope:e.__scopeSelect,children:x.jsx("div",{children:e.children})})}),s):null}return x.jsx(Jm,{...e,ref:t})});Xm.displayName=un;var Qe=10,[Zm,qt]=Yn(un),tP="SelectContentImpl",nP=sn("SelectContent.RemoveScroll"),Jm=D.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:s,onPointerDownOutside:i,side:a,sideOffset:c,align:l,alignOffset:u,arrowPadding:d,collisionBoundary:h,collisionPadding:f,sticky:S,hideWhenDetached:m,avoidCollisions:w,...g}=e,p=Gt(un,n),[v,C]=D.useState(null),[y,M]=D.useState(null),b=fe(t,$=>C($)),[T,R]=D.useState(null),[_,O]=D.useState(null),z=vs(n),[G,j]=D.useState(!1),F=D.useRef(!1);D.useEffect(()=>{if(v)return Aa(v)},[v]),Pa();const N=D.useCallback($=>{const[q,...X]=z().map(B=>B.ref.current),[U]=X.slice(-1),ne=document.activeElement;for(const B of $)if(B===ne||(B==null||B.scrollIntoView({block:"nearest"}),B===q&&y&&(y.scrollTop=0),B===U&&y&&(y.scrollTop=y.scrollHeight),B==null||B.focus(),document.activeElement!==ne))return},[z,y]),k=D.useCallback(()=>N([T,v]),[N,T,v]);D.useEffect(()=>{G&&k()},[G,k]);const{onOpenChange:P,triggerPointerDownPosRef:I}=p;D.useEffect(()=>{if(v){let $={x:0,y:0};const q=U=>{var ne,B;$={x:Math.abs(Math.round(U.pageX)-(((ne=I.current)==null?void 0:ne.x)??0)),y:Math.abs(Math.round(U.pageY)-(((B=I.current)==null?void 0:B.y)??0))}},X=U=>{$.x<=10&&$.y<=10?U.preventDefault():v.contains(U.target)||P(!1),document.removeEventListener("pointermove",q),I.current=null};return I.current!==null&&(document.addEventListener("pointermove",q),document.addEventListener("pointerup",X,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",q),document.removeEventListener("pointerup",X,{capture:!0})}}},[v,P,I]),D.useEffect(()=>{const $=()=>P(!1);return window.addEventListener("blur",$),window.addEventListener("resize",$),()=>{window.removeEventListener("blur",$),window.removeEventListener("resize",$)}},[P]);const[A,V]=hg($=>{const q=z().filter(ne=>!ne.disabled),X=q.find(ne=>ne.ref.current===document.activeElement),U=pg(q,$,X);U&&setTimeout(()=>U.ref.current.focus())}),W=D.useCallback(($,q,X)=>{const U=!F.current&&!X;(p.value!==void 0&&p.value===q||U)&&(R($),U&&(F.current=!0))},[p.value]),H=D.useCallback(()=>v==null?void 0:v.focus(),[v]),L=D.useCallback(($,q,X)=>{const U=!F.current&&!X;(p.value!==void 0&&p.value===q||U)&&O($)},[p.value]),Y=r==="popper"?qi:Qm,K=Y===qi?{side:a,sideOffset:c,align:l,alignOffset:u,arrowPadding:d,collisionBoundary:h,collisionPadding:f,sticky:S,hideWhenDetached:m,avoidCollisions:w}:{};return x.jsx(Zm,{scope:n,content:v,viewport:y,onViewportChange:M,itemRefCallback:W,selectedItem:T,onItemLeave:H,itemTextRefCallback:L,focusSelectedItem:k,selectedItemText:_,position:r,isPositioned:G,searchRef:A,children:x.jsx(us,{as:nP,allowPinchZoom:!0,children:x.jsx(as,{asChild:!0,trapped:p.open,onMountAutoFocus:$=>{$.preventDefault()},onUnmountAutoFocus:te(o,$=>{var q;(q=p.trigger)==null||q.focus({preventScroll:!0}),$.preventDefault()}),children:x.jsx(jr,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:$=>$.preventDefault(),onDismiss:()=>p.onOpenChange(!1),children:x.jsx(Y,{role:"listbox",id:p.contentId,"data-state":p.open?"open":"closed",dir:p.dir,onContextMenu:$=>$.preventDefault(),...g,...K,onPlaced:()=>j(!0),ref:b,style:{display:"flex",flexDirection:"column",outline:"none",...g.style},onKeyDown:te(g.onKeyDown,$=>{const q=$.ctrlKey||$.altKey||$.metaKey;if($.key==="Tab"&&$.preventDefault(),!q&&$.key.length===1&&V($.key),["ArrowUp","ArrowDown","Home","End"].includes($.key)){let U=z().filter(ne=>!ne.disabled).map(ne=>ne.ref.current);if(["ArrowUp","End"].includes($.key)&&(U=U.slice().reverse()),["ArrowUp","ArrowDown"].includes($.key)){const ne=$.target,B=U.indexOf(ne);U=U.slice(B+1)}setTimeout(()=>N(U)),$.preventDefault()}})})})})})})});Jm.displayName=tP;var rP="SelectItemAlignedPosition",Qm=D.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...o}=e,s=Gt(un,n),i=qt(un,n),[a,c]=D.useState(null),[l,u]=D.useState(null),d=fe(t,b=>u(b)),h=vs(n),f=D.useRef(!1),S=D.useRef(!0),{viewport:m,selectedItem:w,selectedItemText:g,focusSelectedItem:p}=i,v=D.useCallback(()=>{if(s.trigger&&s.valueNode&&a&&l&&m&&w&&g){const b=s.trigger.getBoundingClientRect(),T=l.getBoundingClientRect(),R=s.valueNode.getBoundingClientRect(),_=g.getBoundingClientRect();if(s.dir!=="rtl"){const ne=_.left-T.left,B=R.left-ne,ie=b.left-B,pe=b.width+ie,Oe=Math.max(pe,T.width),Ee=window.innerWidth-Qe,ot=zu(B,[Qe,Math.max(Qe,Ee-Oe)]);a.style.minWidth=pe+"px",a.style.left=ot+"px"}else{const ne=T.right-_.right,B=window.innerWidth-R.right-ne,ie=window.innerWidth-b.right-B,pe=b.width+ie,Oe=Math.max(pe,T.width),Ee=window.innerWidth-Qe,ot=zu(B,[Qe,Math.max(Qe,Ee-Oe)]);a.style.minWidth=pe+"px",a.style.right=ot+"px"}const O=h(),z=window.innerHeight-Qe*2,G=m.scrollHeight,j=window.getComputedStyle(l),F=parseInt(j.borderTopWidth,10),N=parseInt(j.paddingTop,10),k=parseInt(j.borderBottomWidth,10),P=parseInt(j.paddingBottom,10),I=F+N+G+P+k,A=Math.min(w.offsetHeight*5,I),V=window.getComputedStyle(m),W=parseInt(V.paddingTop,10),H=parseInt(V.paddingBottom,10),L=b.top+b.height/2-Qe,Y=z-L,K=w.offsetHeight/2,$=w.offsetTop+K,q=F+N+$,X=I-q;if(q<=L){const ne=O.length>0&&w===O[O.length-1].ref.current;a.style.bottom="0px";const B=l.clientHeight-m.offsetTop-m.offsetHeight,ie=Math.max(Y,K+(ne?H:0)+B+k),pe=q+ie;a.style.height=pe+"px"}else{const ne=O.length>0&&w===O[0].ref.current;a.style.top="0px";const ie=Math.max(L,F+m.offsetTop+(ne?W:0)+K)+X;a.style.height=ie+"px",m.scrollTop=q-L+m.offsetTop}a.style.margin=`${Qe}px 0`,a.style.minHeight=A+"px",a.style.maxHeight=z+"px",r==null||r(),requestAnimationFrame(()=>f.current=!0)}},[h,s.trigger,s.valueNode,a,l,m,w,g,s.dir,r]);_e(()=>v(),[v]);const[C,y]=D.useState();_e(()=>{l&&y(window.getComputedStyle(l).zIndex)},[l]);const M=D.useCallback(b=>{b&&S.current===!0&&(v(),p==null||p(),S.current=!1)},[v,p]);return x.jsx(sP,{scope:n,contentWrapper:a,shouldExpandOnScrollRef:f,onScrollButtonChange:M,children:x.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:C},children:x.jsx(ae.div,{...o,ref:d,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});Qm.displayName=rP;var oP="SelectPopperPosition",qi=D.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:o=Qe,...s}=e,i=ys(n);return x.jsx(ts,{...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)"}})});qi.displayName=oP;var[sP,Cc]=Yn(un,{}),Xi="SelectViewport",eg=D.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...o}=e,s=qt(Xi,n),i=Cc(Xi,n),a=fe(t,s.onViewportChange),c=D.useRef(0);return x.jsxs(x.Fragment,{children:[x.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}),x.jsx(gs.Slot,{scope:n,children:x.jsx(ae.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:a,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:te(o.onScroll,l=>{const u=l.currentTarget,{contentWrapper:d,shouldExpandOnScrollRef:h}=i;if(h!=null&&h.current&&d){const f=Math.abs(c.current-u.scrollTop);if(f>0){const S=window.innerHeight-Qe*2,m=parseFloat(d.style.minHeight),w=parseFloat(d.style.height),g=Math.max(m,w);if(g<S){const p=g+f,v=Math.min(S,p),C=p-v;d.style.height=v+"px",d.style.bottom==="0px"&&(u.scrollTop=C>0?C:0,d.style.justifyContent="flex-end")}}}c.current=u.scrollTop})})})]})});eg.displayName=Xi;var tg="SelectGroup",[iP,aP]=Yn(tg),cP=D.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Vt();return x.jsx(iP,{scope:n,id:o,children:x.jsx(ae.div,{role:"group","aria-labelledby":o,...r,ref:t})})});cP.displayName=tg;var ng="SelectLabel",lP=D.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=aP(ng,n);return x.jsx(ae.div,{id:o.id,...r,ref:t})});lP.displayName=ng;var Bo="SelectItem",[uP,rg]=Yn(Bo),og=D.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:o=!1,textValue:s,...i}=e,a=Gt(Bo,n),c=qt(Bo,n),l=a.value===r,[u,d]=D.useState(s??""),[h,f]=D.useState(!1),S=fe(t,p=>{var v;return(v=c.itemRefCallback)==null?void 0:v.call(c,p,r,o)}),m=Vt(),w=D.useRef("touch"),g=()=>{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 x.jsx(uP,{scope:n,value:r,disabled:o,textId:m,isSelected:l,onItemTextChange:D.useCallback(p=>{d(v=>v||((p==null?void 0:p.textContent)??"").trim())},[]),children:x.jsx(gs.ItemSlot,{scope:n,value:r,disabled:o,textValue:u,children:x.jsx(ae.div,{role:"option","aria-labelledby":m,"data-highlighted":h?"":void 0,"aria-selected":l&&h,"data-state":l?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...i,ref:S,onFocus:te(i.onFocus,()=>f(!0)),onBlur:te(i.onBlur,()=>f(!1)),onClick:te(i.onClick,()=>{w.current!=="mouse"&&g()}),onPointerUp:te(i.onPointerUp,()=>{w.current==="mouse"&&g()}),onPointerDown:te(i.onPointerDown,p=>{w.current=p.pointerType}),onPointerMove:te(i.onPointerMove,p=>{var v;w.current=p.pointerType,o?(v=c.onItemLeave)==null||v.call(c):w.current==="mouse"&&p.currentTarget.focus({preventScroll:!0})}),onPointerLeave:te(i.onPointerLeave,p=>{var v;p.currentTarget===document.activeElement&&((v=c.onItemLeave)==null||v.call(c))}),onKeyDown:te(i.onKeyDown,p=>{var C;((C=c.searchRef)==null?void 0:C.current)!==""&&p.key===" "||(GR.includes(p.key)&&g(),p.key===" "&&p.preventDefault())})})})})});og.displayName=Bo;var cr="SelectItemText",sg=D.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,...s}=e,i=Gt(cr,n),a=qt(cr,n),c=rg(cr,n),l=JR(cr,n),[u,d]=D.useState(null),h=fe(t,g=>d(g),c.onItemTextChange,g=>{var p;return(p=a.itemTextRefCallback)==null?void 0:p.call(a,g,c.value,c.disabled)}),f=u==null?void 0:u.textContent,S=D.useMemo(()=>x.jsx("option",{value:c.value,disabled:c.disabled,children:f},c.value),[c.disabled,c.value,f]),{onNativeOptionAdd:m,onNativeOptionRemove:w}=l;return _e(()=>(m(S),()=>w(S)),[m,w,S]),x.jsxs(x.Fragment,{children:[x.jsx(ae.span,{id:c.textId,...s,ref:h}),c.isSelected&&i.valueNode&&!i.valueNodeHasChildren?zo.createPortal(s.children,i.valueNode):null]})});sg.displayName=cr;var ig="SelectItemIndicator",ag=D.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return rg(ig,n).isSelected?x.jsx(ae.span,{"aria-hidden":!0,...r,ref:t}):null});ag.displayName=ig;var Zi="SelectScrollUpButton",cg=D.forwardRef((e,t)=>{const n=qt(Zi,e.__scopeSelect),r=Cc(Zi,e.__scopeSelect),[o,s]=D.useState(!1),i=fe(t,r.onScrollButtonChange);return _e(()=>{if(n.viewport&&n.isPositioned){let a=function(){const l=c.scrollTop>0;s(l)};const c=n.viewport;return a(),c.addEventListener("scroll",a),()=>c.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),o?x.jsx(ug,{...e,ref:i,onAutoScroll:()=>{const{viewport:a,selectedItem:c}=n;a&&c&&(a.scrollTop=a.scrollTop-c.offsetHeight)}}):null});cg.displayName=Zi;var Ji="SelectScrollDownButton",lg=D.forwardRef((e,t)=>{const n=qt(Ji,e.__scopeSelect),r=Cc(Ji,e.__scopeSelect),[o,s]=D.useState(!1),i=fe(t,r.onScrollButtonChange);return _e(()=>{if(n.viewport&&n.isPositioned){let a=function(){const l=c.scrollHeight-c.clientHeight,u=Math.ceil(c.scrollTop)<l;s(u)};const c=n.viewport;return a(),c.addEventListener("scroll",a),()=>c.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),o?x.jsx(ug,{...e,ref:i,onAutoScroll:()=>{const{viewport:a,selectedItem:c}=n;a&&c&&(a.scrollTop=a.scrollTop+c.offsetHeight)}}):null});lg.displayName=Ji;var ug=D.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...o}=e,s=qt("SelectScrollButton",n),i=D.useRef(null),a=vs(n),c=D.useCallback(()=>{i.current!==null&&(window.clearInterval(i.current),i.current=null)},[]);return D.useEffect(()=>()=>c(),[c]),_e(()=>{var u;const l=a().find(d=>d.ref.current===document.activeElement);(u=l==null?void 0:l.ref.current)==null||u.scrollIntoView({block:"nearest"})},[a]),x.jsx(ae.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 l;(l=s.onItemLeave)==null||l.call(s),i.current===null&&(i.current=window.setInterval(r,50))}),onPointerLeave:te(o.onPointerLeave,()=>{c()})})}),dP="SelectSeparator",fP=D.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return x.jsx(ae.div,{"aria-hidden":!0,...r,ref:t})});fP.displayName=dP;var Qi="SelectArrow",hP=D.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=ys(n),s=Gt(Qi,n),i=qt(Qi,n);return s.open&&i.position==="popper"?x.jsx(ns,{...o,...r,ref:t}):null});hP.displayName=Qi;function dg(e){return e===""||e===void 0}var fg=D.forwardRef((e,t)=>{const{value:n,...r}=e,o=D.useRef(null),s=fe(t,o),i=YR(n);return D.useEffect(()=>{const a=o.current,c=window.HTMLSelectElement.prototype,u=Object.getOwnPropertyDescriptor(c,"value").set;if(i!==n&&u){const d=new Event("change",{bubbles:!0});u.call(a,n),a.dispatchEvent(d)}},[i,n]),x.jsx(Sa,{asChild:!0,children:x.jsx("select",{...r,ref:s,defaultValue:n})})});fg.displayName="BubbleSelect";function hg(e){const t=Ze(e),n=D.useRef(""),r=D.useRef(0),o=D.useCallback(i=>{const a=n.current+i;t(a),function c(l){n.current=l,window.clearTimeout(r.current),l!==""&&(r.current=window.setTimeout(()=>c(""),1e3))}(a)},[t]),s=D.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return D.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,o,s]}function pg(e,t,n){const o=t.length>1&&Array.from(t).every(l=>l===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let i=pP(e,Math.max(s,0));o.length===1&&(i=i.filter(l=>l!==n));const c=i.find(l=>l.textValue.toLowerCase().startsWith(o.toLowerCase()));return c!==n?c:void 0}function pP(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var mP=Wm,gP=Um,vP=Km,yP=Gm,bP=qm,xP=Xm,wP=eg,SP=og,CP=sg,TP=ag,DP=cg,EP=lg;function MP({...e}){return x.jsx(mP,{"data-slot":"select",...e})}function RP({...e}){return x.jsx(vP,{"data-slot":"select-value",...e})}function PP({className:e,size:t="default",children:n,...r}){return x.jsxs(gP,{"data-slot":"select-trigger","data-size":t,className:de("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,x.jsx(yP,{asChild:!0,children:x.jsx(af,{className:"size-4 opacity-50"})})]})}function AP({className:e,children:t,position:n="popper",...r}){return x.jsx(bP,{children:x.jsxs(xP,{"data-slot":"select-content",className:de("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:[x.jsx(kP,{}),x.jsx(wP,{className:de("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:t}),x.jsx(_P,{})]})})}function OP({className:e,children:t,...n}){return x.jsxs(SP,{"data-slot":"select-item",className:de("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:[x.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:x.jsx(TP,{children:x.jsx(sf,{className:"size-4"})})}),x.jsx(CP,{children:t})]})}function kP({className:e,...t}){return x.jsx(DP,{"data-slot":"select-scroll-up-button",className:de("flex cursor-default items-center justify-center py-1",e),...t,children:x.jsx(ob,{className:"size-4"})})}function _P({className:e,...t}){return x.jsx(EP,{"data-slot":"select-scroll-down-button",className:de("flex cursor-default items-center justify-center py-1",e),...t,children:x.jsx(af,{className:"size-4"})})}const NP=({options:e,onChange:t})=>x.jsxs(MP,{onValueChange:n=>t(n),defaultValue:e[1].text,children:[x.jsx(PP,{className:"w-[180px]",children:x.jsx(RP,{placeholder:"view"})}),x.jsx(AP,{children:e.map(n=>x.jsx(OP,{value:n.text,children:n.text},n.text))})]}),IP=[{text:"teste1",onClick:()=>console.log("teste1")},{text:"teste2",onClick:()=>console.log("teste2")}],jP=5,LP=0,VP=({side:e,xAxis:t,yAxis:n,updatePosition:r,children:o})=>{const{attributes:s,listeners:i,setNodeRef:a,transform:c,setActivatorNodeRef:l}=ua({id:"booking-info-id",data:{type:"booking-info-options"}}),u=hn(h=>h.updateIsDragging),d={transform:`translate3d(${t+((c==null?void 0:c.x)||0)}px, ${n+((c==null?void 0:c.y)||0)}px, 0)`};return _r({onDragStart(){u(!0)},onDragEnd(h){h.active.id&&r(c)}}),x.jsx(FR,{ref:a,updatePositionStrategy:"optimized",side:e,align:"start",sticky:"always",sideOffset:jP,alignOffset:LP,style:{...d,width:"25rem"},children:x.jsxs("div",{className:"grid gap-3",children:[x.jsx("input",{type:"text",style:{position:"absolute",opacity:0,height:0,width:0}}),x.jsxs("div",{className:"flex justify-end gap-1",children:[x.jsx("div",{ref:l,className:"w-full cursor-move",...s,...i}),x.jsx(UR,{}),x.jsx(an,{type:"button",variant:"outline",size:"icon",children:x.jsx(pb,{className:"h-3 w-3"})}),x.jsx(an,{type:"button",variant:"outline",size:"icon",onClick:()=>{},children:x.jsx(yb,{className:"h-3 w-3"})}),x.jsx(NP,{options:IP,onChange:()=>{}})]}),o]})})},Wu={xAxis:0,yAxis:0},mg=({isEditingOpen:e,side:t,booking:n,onOpenChange:r,children:o})=>{const[s,i]=E.useState({...Wu}),a=hn(f=>f.updateIsDragging),c=E.useMemo(()=>`${Z.dateAndHourDateToString(n.startAt)} - ${Z.dateAndHourDateToString(n.finishAt)}`,[n.startAt,n.finishAt]),l=E.useMemo(()=>{const f=new Date(n.startAt),S=f.getDate(),m=f.getDay(),w=Mn[f.getMonth()];return x.jsx("span",{children:`${nv[m]}, ${S} ${w}`})},[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)})};_r({onDragStart(f){const S=f.active.data.current,m=f.active.id,w=S.type==="booking-info-options";m&&w&&a(!0)}});const h=f=>{f===!1&&i({...Wu}),r(f)};return x.jsxs(LR,{open:e,onOpenChange:h,defaultOpen:!1,children:[x.jsx($R,{style:{width:"100%"},children:x.jsx(VR,{asChild:!0,children:o})}),x.jsx(la,{children:x.jsx(VP,{side:t,xAxis:s.xAxis,yAxis:s.yAxis,updatePosition:d,children:x.jsxs("div",{className:"bookingCard_content",children:[x.jsx("span",{style:u(),className:"flex h-4 w-4 translate-y-0 rounded-sm"}),x.jsx("div",{className:"space-y-1",children:x.jsxs("p",{className:"text-sm text-muted-foreground",children:[l," | ",c]})})]})})})]})};mg.displayName="BookingInfoOptions";var er={exports:{}},tr={},nr={exports:{}},ei={},ao={exports:{}},co={exports:{}},le={};/** @license React v16.13.1
|
|
150
150
|
* react-is.production.min.js
|
|
151
151
|
*
|
|
152
152
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
153
153
|
*
|
|
154
154
|
* This source code is licensed under the MIT license found in the
|
|
155
155
|
* LICENSE file in the root directory of this source tree.
|
|
156
|
-
*/var
|
|
156
|
+
*/var Hu;function FP(){if(Hu)return le;Hu=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,c=e?Symbol.for("react.async_mode"):60111,l=e?Symbol.for("react.concurrent_mode"):60111,u=e?Symbol.for("react.forward_ref"):60112,d=e?Symbol.for("react.suspense"):60113,h=e?Symbol.for("react.suspense_list"):60120,f=e?Symbol.for("react.memo"):60115,S=e?Symbol.for("react.lazy"):60116,m=e?Symbol.for("react.block"):60121,w=e?Symbol.for("react.fundamental"):60117,g=e?Symbol.for("react.responder"):60118,p=e?Symbol.for("react.scope"):60119;function v(y){if(typeof y=="object"&&y!==null){var M=y.$$typeof;switch(M){case t:switch(y=y.type,y){case c:case l:case r:case s:case o:case d:return y;default:switch(y=y&&y.$$typeof,y){case a:case u:case S:case f:case i:return y;default:return M}}case n:return M}}}function C(y){return v(y)===l}return le.AsyncMode=c,le.ConcurrentMode=l,le.ContextConsumer=a,le.ContextProvider=i,le.Element=t,le.ForwardRef=u,le.Fragment=r,le.Lazy=S,le.Memo=f,le.Portal=n,le.Profiler=s,le.StrictMode=o,le.Suspense=d,le.isAsyncMode=function(y){return C(y)||v(y)===c},le.isConcurrentMode=C,le.isContextConsumer=function(y){return v(y)===a},le.isContextProvider=function(y){return v(y)===i},le.isElement=function(y){return typeof y=="object"&&y!==null&&y.$$typeof===t},le.isForwardRef=function(y){return v(y)===u},le.isFragment=function(y){return v(y)===r},le.isLazy=function(y){return v(y)===S},le.isMemo=function(y){return v(y)===f},le.isPortal=function(y){return v(y)===n},le.isProfiler=function(y){return v(y)===s},le.isStrictMode=function(y){return v(y)===o},le.isSuspense=function(y){return v(y)===d},le.isValidElementType=function(y){return typeof y=="string"||typeof y=="function"||y===r||y===l||y===s||y===o||y===d||y===h||typeof y=="object"&&y!==null&&(y.$$typeof===S||y.$$typeof===f||y.$$typeof===i||y.$$typeof===a||y.$$typeof===u||y.$$typeof===w||y.$$typeof===g||y.$$typeof===p||y.$$typeof===m)},le.typeOf=v,le}var ue={};/** @license React v16.13.1
|
|
157
157
|
* react-is.development.js
|
|
158
158
|
*
|
|
159
159
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
160
160
|
*
|
|
161
161
|
* This source code is licensed under the MIT license found in the
|
|
162
162
|
* LICENSE file in the root directory of this source tree.
|
|
163
|
-
*/var
|
|
163
|
+
*/var Uu;function $P(){return Uu||(Uu=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,c=e?Symbol.for("react.async_mode"):60111,l=e?Symbol.for("react.concurrent_mode"):60111,u=e?Symbol.for("react.forward_ref"):60112,d=e?Symbol.for("react.suspense"):60113,h=e?Symbol.for("react.suspense_list"):60120,f=e?Symbol.for("react.memo"):60115,S=e?Symbol.for("react.lazy"):60116,m=e?Symbol.for("react.block"):60121,w=e?Symbol.for("react.fundamental"):60117,g=e?Symbol.for("react.responder"):60118,p=e?Symbol.for("react.scope"):60119;function v(B){return typeof B=="string"||typeof B=="function"||B===r||B===l||B===s||B===o||B===d||B===h||typeof B=="object"&&B!==null&&(B.$$typeof===S||B.$$typeof===f||B.$$typeof===i||B.$$typeof===a||B.$$typeof===u||B.$$typeof===w||B.$$typeof===g||B.$$typeof===p||B.$$typeof===m)}function C(B){if(typeof B=="object"&&B!==null){var ie=B.$$typeof;switch(ie){case t:var pe=B.type;switch(pe){case c:case l:case r:case s:case o:case d:return pe;default:var Oe=pe&&pe.$$typeof;switch(Oe){case a:case u:case S:case f:case i:return Oe;default:return ie}}case n:return ie}}}var y=c,M=l,b=a,T=i,R=t,_=u,O=r,z=S,G=f,j=n,F=s,N=o,k=d,P=!1;function I(B){return P||(P=!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(B)||C(B)===c}function A(B){return C(B)===l}function V(B){return C(B)===a}function W(B){return C(B)===i}function H(B){return typeof B=="object"&&B!==null&&B.$$typeof===t}function L(B){return C(B)===u}function Y(B){return C(B)===r}function K(B){return C(B)===S}function $(B){return C(B)===f}function q(B){return C(B)===n}function X(B){return C(B)===s}function U(B){return C(B)===o}function ne(B){return C(B)===d}ue.AsyncMode=y,ue.ConcurrentMode=M,ue.ContextConsumer=b,ue.ContextProvider=T,ue.Element=R,ue.ForwardRef=_,ue.Fragment=O,ue.Lazy=z,ue.Memo=G,ue.Portal=j,ue.Profiler=F,ue.StrictMode=N,ue.Suspense=k,ue.isAsyncMode=I,ue.isConcurrentMode=A,ue.isContextConsumer=V,ue.isContextProvider=W,ue.isElement=H,ue.isForwardRef=L,ue.isFragment=Y,ue.isLazy=K,ue.isMemo=$,ue.isPortal=q,ue.isProfiler=X,ue.isStrictMode=U,ue.isSuspense=ne,ue.isValidElementType=v,ue.typeOf=C}()),ue}var Yu;function gg(){return Yu||(Yu=1,process.env.NODE_ENV==="production"?co.exports=FP():co.exports=$P()),co.exports}/*
|
|
164
164
|
object-assign
|
|
165
165
|
(c) Sindre Sorhus
|
|
166
166
|
@license MIT
|
|
167
|
-
*/var
|
|
168
|
-
Valid keys: `+JSON.stringify(Object.keys(
|
|
167
|
+
*/var ti,Ku;function BP(){if(Ku)return ti;Ku=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 c=Object.getOwnPropertyNames(i).map(function(u){return i[u]});if(c.join("")!=="0123456789")return!1;var l={};return"abcdefghijklmnopqrst".split("").forEach(function(u){l[u]=u}),Object.keys(Object.assign({},l)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return ti=o()?Object.assign:function(s,i){for(var a,c=r(s),l,u=1;u<arguments.length;u++){a=Object(arguments[u]);for(var d in a)t.call(a,d)&&(c[d]=a[d]);if(e){l=e(a);for(var h=0;h<l.length;h++)n.call(a,l[h])&&(c[l[h]]=a[l[h]])}}return c},ti}var ni,Gu;function Tc(){if(Gu)return ni;Gu=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return ni=e,ni}var ri,qu;function vg(){return qu||(qu=1,ri=Function.call.bind(Object.prototype.hasOwnProperty)),ri}var oi,Xu;function zP(){if(Xu)return oi;Xu=1;var e=function(){};if(process.env.NODE_ENV!=="production"){var t=Tc(),n={},r=vg();e=function(s){var i="Warning: "+s;typeof console<"u"&&console.error(i);try{throw new Error(i)}catch{}}}function o(s,i,a,c,l){if(process.env.NODE_ENV!=="production"){for(var u in s)if(r(s,u)){var d;try{if(typeof s[u]!="function"){var h=Error((c||"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 h.name="Invariant Violation",h}d=s[u](i,u,c,a,null,t)}catch(S){d=S}if(d&&!(d instanceof Error)&&e((c||"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=l?l():"";e("Failed "+a+" type: "+d.message+(f??""))}}}}return o.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(n={})},oi=o,oi}var si,Zu;function WP(){if(Zu)return si;Zu=1;var e=gg(),t=BP(),n=Tc(),r=vg(),o=zP(),s=function(){};process.env.NODE_ENV!=="production"&&(s=function(a){var c="Warning: "+a;typeof console<"u"&&console.error(c);try{throw new Error(c)}catch{}});function i(){return null}return si=function(a,c){var l=typeof Symbol=="function"&&Symbol.iterator,u="@@iterator";function d(A){var V=A&&(l&&A[l]||A[u]);if(typeof V=="function")return V}var h="<<anonymous>>",f={array:g("array"),bigint:g("bigint"),bool:g("boolean"),func:g("function"),number:g("number"),object:g("object"),string:g("string"),symbol:g("symbol"),any:p(),arrayOf:v,element:C(),elementType:y(),instanceOf:M,node:_(),objectOf:T,oneOf:b,oneOfType:R,shape:z,exact:G};function S(A,V){return A===V?A!==0||1/A===1/V:A!==A&&V!==V}function m(A,V){this.message=A,this.data=V&&typeof V=="object"?V:{},this.stack=""}m.prototype=Error.prototype;function w(A){if(process.env.NODE_ENV!=="production")var V={},W=0;function H(Y,K,$,q,X,U,ne){if(q=q||h,U=U||$,ne!==n){if(c){var B=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 B.name="Invariant Violation",B}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var ie=q+":"+$;!V[ie]&&W<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."),V[ie]=!0,W++)}}return K[$]==null?Y?K[$]===null?new m("The "+X+" `"+U+"` is marked as required "+("in `"+q+"`, but its value is `null`.")):new m("The "+X+" `"+U+"` is marked as required in "+("`"+q+"`, but its value is `undefined`.")):null:A(K,$,q,X,U)}var L=H.bind(null,!1);return L.isRequired=H.bind(null,!0),L}function g(A){function V(W,H,L,Y,K,$){var q=W[H],X=N(q);if(X!==A){var U=k(q);return new m("Invalid "+Y+" `"+K+"` of type "+("`"+U+"` supplied to `"+L+"`, expected ")+("`"+A+"`."),{expectedType:A})}return null}return w(V)}function p(){return w(i)}function v(A){function V(W,H,L,Y,K){if(typeof A!="function")return new m("Property `"+K+"` of component `"+L+"` has invalid PropType notation inside arrayOf.");var $=W[H];if(!Array.isArray($)){var q=N($);return new m("Invalid "+Y+" `"+K+"` of type "+("`"+q+"` supplied to `"+L+"`, expected an array."))}for(var X=0;X<$.length;X++){var U=A($,X,L,Y,K+"["+X+"]",n);if(U instanceof Error)return U}return null}return w(V)}function C(){function A(V,W,H,L,Y){var K=V[W];if(!a(K)){var $=N(K);return new m("Invalid "+L+" `"+Y+"` of type "+("`"+$+"` supplied to `"+H+"`, expected a single ReactElement."))}return null}return w(A)}function y(){function A(V,W,H,L,Y){var K=V[W];if(!e.isValidElementType(K)){var $=N(K);return new m("Invalid "+L+" `"+Y+"` of type "+("`"+$+"` supplied to `"+H+"`, expected a single ReactElement type."))}return null}return w(A)}function M(A){function V(W,H,L,Y,K){if(!(W[H]instanceof A)){var $=A.name||h,q=I(W[H]);return new m("Invalid "+Y+" `"+K+"` of type "+("`"+q+"` supplied to `"+L+"`, expected ")+("instance of `"+$+"`."))}return null}return w(V)}function b(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 V(W,H,L,Y,K){for(var $=W[H],q=0;q<A.length;q++)if(S($,A[q]))return null;var X=JSON.stringify(A,function(ne,B){var ie=k(B);return ie==="symbol"?String(B):B});return new m("Invalid "+Y+" `"+K+"` of value `"+String($)+"` "+("supplied to `"+L+"`, expected one of "+X+"."))}return w(V)}function T(A){function V(W,H,L,Y,K){if(typeof A!="function")return new m("Property `"+K+"` of component `"+L+"` has invalid PropType notation inside objectOf.");var $=W[H],q=N($);if(q!=="object")return new m("Invalid "+Y+" `"+K+"` of type "+("`"+q+"` supplied to `"+L+"`, expected an object."));for(var X in $)if(r($,X)){var U=A($,X,L,Y,K+"."+X,n);if(U instanceof Error)return U}return null}return w(V)}function R(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 V=0;V<A.length;V++){var W=A[V];if(typeof W!="function")return s("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+P(W)+" at index "+V+"."),i}function H(L,Y,K,$,q){for(var X=[],U=0;U<A.length;U++){var ne=A[U],B=ne(L,Y,K,$,q,n);if(B==null)return null;B.data&&r(B.data,"expectedType")&&X.push(B.data.expectedType)}var ie=X.length>0?", expected one of type ["+X.join(", ")+"]":"";return new m("Invalid "+$+" `"+q+"` supplied to "+("`"+K+"`"+ie+"."))}return w(H)}function _(){function A(V,W,H,L,Y){return j(V[W])?null:new m("Invalid "+L+" `"+Y+"` supplied to "+("`"+H+"`, expected a ReactNode."))}return w(A)}function O(A,V,W,H,L){return new m((A||"React class")+": "+V+" type `"+W+"."+H+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+L+"`.")}function z(A){function V(W,H,L,Y,K){var $=W[H],q=N($);if(q!=="object")return new m("Invalid "+Y+" `"+K+"` of type `"+q+"` "+("supplied to `"+L+"`, expected `object`."));for(var X in A){var U=A[X];if(typeof U!="function")return O(L,Y,K,X,k(U));var ne=U($,X,L,Y,K+"."+X,n);if(ne)return ne}return null}return w(V)}function G(A){function V(W,H,L,Y,K){var $=W[H],q=N($);if(q!=="object")return new m("Invalid "+Y+" `"+K+"` of type `"+q+"` "+("supplied to `"+L+"`, expected `object`."));var X=t({},W[H],A);for(var U in X){var ne=A[U];if(r(A,U)&&typeof ne!="function")return O(L,Y,K,U,k(ne));if(!ne)return new m("Invalid "+Y+" `"+K+"` key `"+U+"` supplied to `"+L+"`.\nBad object: "+JSON.stringify(W[H],null," ")+`
|
|
168
|
+
Valid keys: `+JSON.stringify(Object.keys(A),null," "));var B=ne($,U,L,Y,K+"."+U,n);if(B)return B}return null}return w(V)}function j(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(j);if(A===null||a(A))return!0;var V=d(A);if(V){var W=V.call(A),H;if(V!==A.entries){for(;!(H=W.next()).done;)if(!j(H.value))return!1}else for(;!(H=W.next()).done;){var L=H.value;if(L&&!j(L[1]))return!1}}else return!1;return!0;default:return!1}}function F(A,V){return A==="symbol"?!0:V?V["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&V instanceof Symbol:!1}function N(A){var V=typeof A;return Array.isArray(A)?"array":A instanceof RegExp?"object":F(V,A)?"symbol":V}function k(A){if(typeof A>"u"||A===null)return""+A;var V=N(A);if(V==="object"){if(A instanceof Date)return"date";if(A instanceof RegExp)return"regexp"}return V}function P(A){var V=k(A);switch(V){case"array":case"object":return"an "+V;case"boolean":case"date":case"regexp":return"a "+V;default:return V}}function I(A){return!A.constructor||!A.constructor.name?h:A.constructor.name}return f.checkPropTypes=o,f.resetWarningCache=o.resetWarningCache,f.PropTypes=f,f},si}var ii,Ju;function HP(){if(Ju)return ii;Ju=1;var e=Tc();function t(){}function n(){}return n.resetWarningCache=t,ii=function(){function r(i,a,c,l,u,d){if(d!==e){var h=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 h.name="Invariant Violation",h}}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},ii}var Qu;function bs(){if(Qu)return ao.exports;if(Qu=1,process.env.NODE_ENV!=="production"){var e=gg(),t=!0;ao.exports=WP()(e.isElement,t)}else ao.exports=HP()();return ao.exports}function yg(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=yg(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function ed(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=yg(e))&&(r&&(r+=" "),r+=t);return r}const UP=Object.freeze(Object.defineProperty({__proto__:null,clsx:ed,default:ed},Symbol.toStringTag,{value:"Module"})),YP=Jg(UP);var be={},Ot={},td;function xs(){if(td)return Ot;td=1,Object.defineProperty(Ot,"__esModule",{value:!0}),Ot.dontSetMe=o,Ot.findInArray=e,Ot.int=r,Ot.isFunction=t,Ot.isNum=n;function e(s,i){for(let a=0,c=s.length;a<c;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 Ot}var kt={},nd;function KP(){if(nd)return kt;nd=1,Object.defineProperty(kt,"__esModule",{value:!0}),kt.browserPrefixToKey=n,kt.browserPrefixToStyle=r,kt.default=void 0,kt.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 c=0;c<e.length;c++)if(n(i,e[c])in a)return e[c];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 c=0;c<s.length;c++)a?(i+=s[c].toUpperCase(),a=!1):s[c]==="-"?a=!0:i+=s[c];return i}return kt.default=t(),kt}var rd;function Dc(){if(rd)return be;rd=1,Object.defineProperty(be,"__esModule",{value:!0}),be.addClassName=y,be.addEvent=a,be.addUserSelectStyles=v,be.createCSSTransform=S,be.createSVGTransform=m,be.getTouch=g,be.getTouchIdentifier=p,be.getTranslation=w,be.innerHeight=d,be.innerWidth=h,be.matchesSelector=s,be.matchesSelectorAndParentsTo=i,be.offsetXYFromParent=f,be.outerHeight=l,be.outerWidth=u,be.removeClassName=M,be.removeEvent=c,be.removeUserSelectStyles=C;var e=xs(),t=r(KP());function n(b){if(typeof WeakMap!="function")return null;var T=new WeakMap,R=new WeakMap;return(n=function(_){return _?R:T})(b)}function r(b,T){if(b&&b.__esModule)return b;if(b===null||typeof b!="object"&&typeof b!="function")return{default:b};var R=n(T);if(R&&R.has(b))return R.get(b);var _={},O=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var z in b)if(z!=="default"&&Object.prototype.hasOwnProperty.call(b,z)){var G=O?Object.getOwnPropertyDescriptor(b,z):null;G&&(G.get||G.set)?Object.defineProperty(_,z,G):_[z]=b[z]}return _.default=b,R&&R.set(b,_),_}let o="";function s(b,T){return o||(o=(0,e.findInArray)(["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"],function(R){return(0,e.isFunction)(b[R])})),(0,e.isFunction)(b[o])?b[o](T):!1}function i(b,T,R){let _=b;do{if(s(_,T))return!0;if(_===R)return!1;_=_.parentNode}while(_);return!1}function a(b,T,R,_){if(!b)return;const O={capture:!0,..._};b.addEventListener?b.addEventListener(T,R,O):b.attachEvent?b.attachEvent("on"+T,R):b["on"+T]=R}function c(b,T,R,_){if(!b)return;const O={capture:!0,..._};b.removeEventListener?b.removeEventListener(T,R,O):b.detachEvent?b.detachEvent("on"+T,R):b["on"+T]=null}function l(b){let T=b.clientHeight;const R=b.ownerDocument.defaultView.getComputedStyle(b);return T+=(0,e.int)(R.borderTopWidth),T+=(0,e.int)(R.borderBottomWidth),T}function u(b){let T=b.clientWidth;const R=b.ownerDocument.defaultView.getComputedStyle(b);return T+=(0,e.int)(R.borderLeftWidth),T+=(0,e.int)(R.borderRightWidth),T}function d(b){let T=b.clientHeight;const R=b.ownerDocument.defaultView.getComputedStyle(b);return T-=(0,e.int)(R.paddingTop),T-=(0,e.int)(R.paddingBottom),T}function h(b){let T=b.clientWidth;const R=b.ownerDocument.defaultView.getComputedStyle(b);return T-=(0,e.int)(R.paddingLeft),T-=(0,e.int)(R.paddingRight),T}function f(b,T,R){const O=T===T.ownerDocument.body?{left:0,top:0}:T.getBoundingClientRect(),z=(b.clientX+T.scrollLeft-O.left)/R,G=(b.clientY+T.scrollTop-O.top)/R;return{x:z,y:G}}function S(b,T){const R=w(b,T,"px");return{[(0,t.browserPrefixToKey)("transform",t.default)]:R}}function m(b,T){return w(b,T,"")}function w(b,T,R){let{x:_,y:O}=b,z="translate(".concat(_).concat(R,",").concat(O).concat(R,")");if(T){const G="".concat(typeof T.x=="string"?T.x:T.x+R),j="".concat(typeof T.y=="string"?T.y:T.y+R);z="translate(".concat(G,", ").concat(j,")")+z}return z}function g(b,T){return b.targetTouches&&(0,e.findInArray)(b.targetTouches,R=>T===R.identifier)||b.changedTouches&&(0,e.findInArray)(b.changedTouches,R=>T===R.identifier)}function p(b){if(b.targetTouches&&b.targetTouches[0])return b.targetTouches[0].identifier;if(b.changedTouches&&b.changedTouches[0])return b.changedTouches[0].identifier}function v(b){if(!b)return;let T=b.getElementById("react-draggable-style-el");T||(T=b.createElement("style"),T.type="text/css",T.id="react-draggable-style-el",T.innerHTML=`.react-draggable-transparent-selection *::-moz-selection {all: inherit;}
|
|
169
169
|
`,T.innerHTML+=`.react-draggable-transparent-selection *::selection {all: inherit;}
|
|
170
|
-
`,b.getElementsByTagName("head")[0].appendChild(T)),b.body&&v(b.body,"react-draggable-transparent-selection")}function C(b){if(b)try{if(b.body&&M(b.body,"react-draggable-transparent-selection"),b.selection)b.selection.empty();else{const T=(b.defaultView||window).getSelection();T&&T.type!=="Caret"&&T.removeAllRanges()}}catch{}}function v(b,T){b.classList?b.classList.add(T):b.className.match(new RegExp("(?:^|\\s)".concat(T,"(?!\\S)")))||(b.className+=" ".concat(T))}function M(b,T){b.classList?b.classList.remove(T):b.className=b.className.replace(new RegExp("(?:^|\\s)".concat(T,"(?!\\S)"),"g"),"")}return be}var at={},dd;function Eg(){if(dd)return at;dd=1,Object.defineProperty(at,"__esModule",{value:!0}),at.canDragX=o,at.canDragY=s,at.createCoreData=a,at.createDraggableData=c,at.getBoundPosition=n,at.getControlPosition=i,at.snapToGrid=r;var e=ws(),t=Pc();function n(d,f,h){if(!d.props.bounds)return[f,h];let{bounds:S}=d.props;S=typeof S=="string"?S:l(S);const m=u(d);if(typeof S=="string"){const{ownerDocument:w}=m,y=w.defaultView;let p;if(S==="parent"?p=m.parentNode:p=w.querySelector(S),!(p instanceof y.HTMLElement))throw new Error('Bounds selector "'+S+'" could not find an element.');const g=p,C=y.getComputedStyle(m),v=y.getComputedStyle(g);S={left:-m.offsetLeft+(0,e.int)(v.paddingLeft)+(0,e.int)(C.marginLeft),top:-m.offsetTop+(0,e.int)(v.paddingTop)+(0,e.int)(C.marginTop),right:(0,t.innerWidth)(g)-(0,t.outerWidth)(m)-m.offsetLeft+(0,e.int)(v.paddingRight)-(0,e.int)(C.marginRight),bottom:(0,t.innerHeight)(g)-(0,t.outerHeight)(m)-m.offsetTop+(0,e.int)(v.paddingBottom)-(0,e.int)(C.marginBottom)}}return(0,e.isNum)(S.right)&&(f=Math.min(f,S.right)),(0,e.isNum)(S.bottom)&&(h=Math.min(h,S.bottom)),(0,e.isNum)(S.left)&&(f=Math.max(f,S.left)),(0,e.isNum)(S.top)&&(h=Math.max(h,S.top)),[f,h]}function r(d,f,h){const S=Math.round(f/d[0])*d[0],m=Math.round(h/d[1])*d[1];return[S,m]}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 S=typeof f=="number"?(0,t.getTouch)(d,f):null;if(typeof f=="number"&&!S)return null;const m=u(h),w=h.props.offsetParent||m.offsetParent||m.ownerDocument.body;return(0,t.offsetXYFromParent)(S||d,w,h.props.scale)}function a(d,f,h){const S=!(0,e.isNum)(d.lastX),m=u(d);return S?{node:m,deltaX:0,deltaY:0,lastX:f,lastY:h,x:f,y:h}:{node:m,deltaX:f-d.lastX,deltaY:h-d.lastY,lastX:d.lastX,lastY:d.lastY,x:f,y:h}}function c(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 l(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 at}var or={},fo={},fd;function Mg(){if(fd)return fo;fd=1,Object.defineProperty(fo,"__esModule",{value:!0}),fo.default=e;function e(){}return fo}var hd;function bA(){if(hd)return or;hd=1,Object.defineProperty(or,"__esModule",{value:!0}),or.default=void 0;var e=l(E),t=a(xs()),n=a(vt),r=Pc(),o=Eg(),s=ws(),i=a(Mg());function a(w){return w&&w.__esModule?w:{default:w}}function c(w){if(typeof WeakMap!="function")return null;var y=new WeakMap,p=new WeakMap;return(c=function(g){return g?p:y})(w)}function l(w,y){if(w&&w.__esModule)return w;if(w===null||typeof w!="object"&&typeof w!="function")return{default:w};var p=c(y);if(p&&p.has(w))return p.get(w);var g={},C=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var v in w)if(v!=="default"&&Object.prototype.hasOwnProperty.call(w,v)){var M=C?Object.getOwnPropertyDescriptor(w,v):null;M&&(M.get||M.set)?Object.defineProperty(g,v,M):g[v]=w[v]}return g.default=w,p&&p.set(w,g),g}function u(w,y,p){return y=d(y),y in w?Object.defineProperty(w,y,{value:p,enumerable:!0,configurable:!0,writable:!0}):w[y]=p,w}function d(w){var y=f(w,"string");return typeof y=="symbol"?y:String(y)}function f(w,y){if(typeof w!="object"||w===null)return w;var p=w[Symbol.toPrimitive];if(p!==void 0){var g=p.call(w,y);if(typeof g!="object")return g;throw new TypeError("@@toPrimitive must return a primitive value.")}return(y==="string"?String:Number)(w)}const h={touch:{start:"touchstart",move:"touchmove",stop:"touchend"},mouse:{start:"mousedown",move:"mousemove",stop:"mouseup"}};let S=h.mouse,m=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 p=this.findDOMNode();if(!p||!p.ownerDocument||!p.ownerDocument.body)throw new Error("<DraggableCore> not mounted on DragStart!");const{ownerDocument:g}=p;if(this.props.disabled||!(y.target instanceof g.defaultView.Node)||this.props.handle&&!(0,r.matchesSelectorAndParentsTo)(y.target,this.props.handle,p)||this.props.cancel&&(0,r.matchesSelectorAndParentsTo)(y.target,this.props.cancel,p))return;y.type==="touchstart"&&y.preventDefault();const C=(0,r.getTouchIdentifier)(y);this.touchIdentifier=C;const v=(0,o.getControlPosition)(y,C,this);if(v==null)return;const{x:M,y:b}=v,T=(0,o.createCoreData)(this,M,b);(0,i.default)("DraggableCore: handleDragStart: %j",T),(0,i.default)("calling",this.props.onStart),!(this.props.onStart(y,T)===!1||this.mounted===!1)&&(this.props.enableUserSelectHack&&(0,r.addUserSelectStyles)(g),this.dragging=!0,this.lastX=M,this.lastY=b,(0,r.addEvent)(g,S.move,this.handleDrag),(0,r.addEvent)(g,S.stop,this.handleDragStop))}),u(this,"handleDrag",y=>{const p=(0,o.getControlPosition)(y,this.touchIdentifier,this);if(p==null)return;let{x:g,y:C}=p;if(Array.isArray(this.props.grid)){let b=g-this.lastX,T=C-this.lastY;if([b,T]=(0,o.snapToGrid)(this.props.grid,b,T),!b&&!T)return;g=this.lastX+b,C=this.lastY+T}const v=(0,o.createCoreData)(this,g,C);if((0,i.default)("DraggableCore: handleDrag: %j",v),this.props.onDrag(y,v)===!1||this.mounted===!1){try{this.handleDragStop(new MouseEvent("mouseup"))}catch{const T=document.createEvent("MouseEvents");T.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(T)}return}this.lastX=g,this.lastY=C}),u(this,"handleDragStop",y=>{if(!this.dragging)return;const p=(0,o.getControlPosition)(y,this.touchIdentifier,this);if(p==null)return;let{x:g,y:C}=p;if(Array.isArray(this.props.grid)){let T=g-this.lastX||0,R=C-this.lastY||0;[T,R]=(0,o.snapToGrid)(this.props.grid,T,R),g=this.lastX+T,C=this.lastY+R}const v=(0,o.createCoreData)(this,g,C);if(this.props.onStop(y,v)===!1||this.mounted===!1)return!1;const b=this.findDOMNode();b&&this.props.enableUserSelectHack&&(0,r.removeUserSelectStyles)(b.ownerDocument),(0,i.default)("DraggableCore: handleDragStop: %j",v),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,b&&((0,i.default)("DraggableCore: Removing handlers"),(0,r.removeEvent)(b.ownerDocument,S.move,this.handleDrag),(0,r.removeEvent)(b.ownerDocument,S.stop,this.handleDragStop))}),u(this,"onMouseDown",y=>(S=h.mouse,this.handleDragStart(y))),u(this,"onMouseUp",y=>(S=h.mouse,this.handleDragStop(y))),u(this,"onTouchStart",y=>(S=h.touch,this.handleDragStart(y))),u(this,"onTouchEnd",y=>(S=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:p}=y;(0,r.removeEvent)(p,h.mouse.move,this.handleDrag),(0,r.removeEvent)(p,h.touch.move,this.handleDrag),(0,r.removeEvent)(p,h.mouse.stop,this.handleDragStop),(0,r.removeEvent)(p,h.touch.stop,this.handleDragStop),(0,r.removeEvent)(y,h.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&(0,r.removeUserSelectStyles)(p)}}findDOMNode(){var y,p;return(y=this.props)!==null&&y!==void 0&&y.nodeRef?(p=this.props)===null||p===void 0||(p=p.nodeRef)===null||p===void 0?void 0:p.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 or.default=m,u(m,"displayName","DraggableCore"),u(m,"propTypes",{allowAnyClick:t.default.bool,children:t.default.node.isRequired,disabled:t.default.bool,enableUserSelectHack:t.default.bool,offsetParent:function(w,y){if(w[y]&&w[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(m,"defaultProps",{allowAnyClick:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1}),or}var pd;function xA(){return pd||(pd=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"DraggableCore",{enumerable:!0,get:function(){return c.default}}),e.default=void 0;var t=f(E),n=u(xs()),r=u(vt),o=u(vA),s=Pc(),i=Eg(),a=ws(),c=u(bA()),l=u(Mg());function u(p){return p&&p.__esModule?p:{default:p}}function d(p){if(typeof WeakMap!="function")return null;var g=new WeakMap,C=new WeakMap;return(d=function(v){return v?C:g})(p)}function f(p,g){if(p&&p.__esModule)return p;if(p===null||typeof p!="object"&&typeof p!="function")return{default:p};var C=d(g);if(C&&C.has(p))return C.get(p);var v={},M=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var b in p)if(b!=="default"&&Object.prototype.hasOwnProperty.call(p,b)){var T=M?Object.getOwnPropertyDescriptor(p,b):null;T&&(T.get||T.set)?Object.defineProperty(v,b,T):v[b]=p[b]}return v.default=p,C&&C.set(p,v),v}function h(){return h=Object.assign?Object.assign.bind():function(p){for(var g=1;g<arguments.length;g++){var C=arguments[g];for(var v in C)Object.prototype.hasOwnProperty.call(C,v)&&(p[v]=C[v])}return p},h.apply(this,arguments)}function S(p,g,C){return g=m(g),g in p?Object.defineProperty(p,g,{value:C,enumerable:!0,configurable:!0,writable:!0}):p[g]=C,p}function m(p){var g=w(p,"string");return typeof g=="symbol"?g:String(g)}function w(p,g){if(typeof p!="object"||p===null)return p;var C=p[Symbol.toPrimitive];if(C!==void 0){var v=C.call(p,g);if(typeof v!="object")return v;throw new TypeError("@@toPrimitive must return a primitive value.")}return(g==="string"?String:Number)(p)}class y extends t.Component{static getDerivedStateFromProps(g,C){let{position:v}=g,{prevPropsPosition:M}=C;return v&&(!M||v.x!==M.x||v.y!==M.y)?((0,l.default)("Draggable: getDerivedStateFromProps %j",{position:v,prevPropsPosition:M}),{x:v.x,y:v.y,prevPropsPosition:{...v}}):null}constructor(g){super(g),S(this,"onDragStart",(C,v)=>{if((0,l.default)("Draggable: onDragStart: %j",v),this.props.onStart(C,(0,i.createDraggableData)(this,v))===!1)return!1;this.setState({dragging:!0,dragged:!0})}),S(this,"onDrag",(C,v)=>{if(!this.state.dragging)return!1;(0,l.default)("Draggable: onDrag: %j",v);const M=(0,i.createDraggableData)(this,v),b={x:M.x,y:M.y,slackX:0,slackY:0};if(this.props.bounds){const{x:R,y:k}=b;b.x+=this.state.slackX,b.y+=this.state.slackY;const[A,z]=(0,i.getBoundPosition)(this,b.x,b.y);b.x=A,b.y=z,b.slackX=this.state.slackX+(R-b.x),b.slackY=this.state.slackY+(k-b.y),M.x=b.x,M.y=b.y,M.deltaX=b.x-this.state.x,M.deltaY=b.y-this.state.y}if(this.props.onDrag(C,M)===!1)return!1;this.setState(b)}),S(this,"onDragStop",(C,v)=>{if(!this.state.dragging||this.props.onStop(C,(0,i.createDraggableData)(this,v))===!1)return!1;(0,l.default)("Draggable: onDragStop: %j",v);const b={dragging:!1,slackX:0,slackY:0};if(!!this.props.position){const{x:R,y:k}=this.props.position;b.x=R,b.y=k}this.setState(b)}),this.state={dragging:!1,dragged:!1,x:g.position?g.position.x:g.defaultPosition.x,y:g.position?g.position.y:g.defaultPosition.y,prevPropsPosition:{...g.position},slackX:0,slackY:0,isElementSVG:!1},g.position&&!(g.onDrag||g.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 g,C;return(g=(C=this.props)===null||C===void 0||(C=C.nodeRef)===null||C===void 0?void 0:C.current)!==null&&g!==void 0?g:r.default.findDOMNode(this)}render(){const{axis:g,bounds:C,children:v,defaultPosition:M,defaultClassName:b,defaultClassNameDragging:T,defaultClassNameDragged:R,position:k,positionOffset:A,scale:z,...G}=this.props;let j={},F=null;const N=!!!k||this.state.dragging,P=k||M,I={x:(0,i.canDragX)(this)&&N?this.state.x:P.x,y:(0,i.canDragY)(this)&&N?this.state.y:P.y};this.state.isElementSVG?F=(0,s.createSVGTransform)(I,A):j=(0,s.createCSSTransform)(I,A);const O=(0,o.default)(v.props.className||"",b,{[T]:this.state.dragging,[R]:this.state.dragged});return t.createElement(c.default,h({},G,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),t.cloneElement(t.Children.only(v),{className:O,style:{...v.props.style,...j},transform:F}))}}e.default=y,S(y,"displayName","Draggable"),S(y,"propTypes",{...c.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}),S(y,"defaultProps",{...c.default.defaultProps,axis:"both",bounds:!1,defaultClassName:"react-draggable",defaultClassNameDragging:"react-draggable-dragging",defaultClassNameDragged:"react-draggable-dragged",defaultPosition:{x:0,y:0},scale:1})}(ti)),ti}var md;function Rg(){if(md)return rr.exports;md=1;const{default:e,DraggableCore:t}=xA();return rr.exports=e,rr.exports.default=e,rr.exports.DraggableCore=t,rr.exports}var ho={},gd;function wA(){if(gd)return ho;gd=1,ho.__esModule=!0,ho.cloneElement=a;var e=t(E);function t(c){return c&&c.__esModule?c:{default:c}}function n(c,l){var u=Object.keys(c);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(c);l&&(d=d.filter(function(f){return Object.getOwnPropertyDescriptor(c,f).enumerable})),u.push.apply(u,d)}return u}function r(c){for(var l=1;l<arguments.length;l++){var u=arguments[l]!=null?arguments[l]:{};l%2?n(Object(u),!0).forEach(function(d){o(c,d,u[d])}):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(u)):n(Object(u)).forEach(function(d){Object.defineProperty(c,d,Object.getOwnPropertyDescriptor(u,d))})}return c}function o(c,l,u){return l=s(l),l in c?Object.defineProperty(c,l,{value:u,enumerable:!0,configurable:!0,writable:!0}):c[l]=u,c}function s(c){var l=i(c,"string");return typeof l=="symbol"?l:String(l)}function i(c,l){if(typeof c!="object"||c===null)return c;var u=c[Symbol.toPrimitive];if(u!==void 0){var d=u.call(c,l);if(typeof d!="object")return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return(l==="string"?String:Number)(c)}function a(c,l){return l.style&&c.props.style&&(l.style=r(r({},c.props.style),l.style)),l.className&&c.props.className&&(l.className=c.props.className+" "+l.className),e.default.cloneElement(c,l)}return ho}var sr={},vd;function Pg(){if(vd)return sr;vd=1,sr.__esModule=!0,sr.resizableProps=void 0;var e=t(xs());Rg();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 c;return(c=e.default.number).isRequired.apply(c,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 c;return(c=e.default.number).isRequired.apply(c,s)}return e.default.number.apply(e.default,s)}};return sr.resizableProps=n,sr}var yd;function Ag(){if(yd)return nr;yd=1,nr.__esModule=!0,nr.default=void 0;var e=i(E),t=Rg(),n=wA(),r=Pg(),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 p=new WeakMap,g=new WeakMap;return(s=function(v){return v?g:p})(y)}function i(y,p){if(y&&y.__esModule)return y;if(y===null||typeof y!="object"&&typeof y!="function")return{default:y};var g=s(p);if(g&&g.has(y))return g.get(y);var C={},v=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var M in y)if(M!=="default"&&Object.prototype.hasOwnProperty.call(y,M)){var b=v?Object.getOwnPropertyDescriptor(y,M):null;b&&(b.get||b.set)?Object.defineProperty(C,M,b):C[M]=y[M]}return C.default=y,g&&g.set(y,C),C}function a(){return a=Object.assign?Object.assign.bind():function(y){for(var p=1;p<arguments.length;p++){var g=arguments[p];for(var C in g)Object.prototype.hasOwnProperty.call(g,C)&&(y[C]=g[C])}return y},a.apply(this,arguments)}function c(y,p){if(y==null)return{};var g={},C=Object.keys(y),v,M;for(M=0;M<C.length;M++)v=C[M],!(p.indexOf(v)>=0)&&(g[v]=y[v]);return g}function l(y,p){var g=Object.keys(y);if(Object.getOwnPropertySymbols){var C=Object.getOwnPropertySymbols(y);p&&(C=C.filter(function(v){return Object.getOwnPropertyDescriptor(y,v).enumerable})),g.push.apply(g,C)}return g}function u(y){for(var p=1;p<arguments.length;p++){var g=arguments[p]!=null?arguments[p]:{};p%2?l(Object(g),!0).forEach(function(C){d(y,C,g[C])}):Object.getOwnPropertyDescriptors?Object.defineProperties(y,Object.getOwnPropertyDescriptors(g)):l(Object(g)).forEach(function(C){Object.defineProperty(y,C,Object.getOwnPropertyDescriptor(g,C))})}return y}function d(y,p,g){return p=f(p),p in y?Object.defineProperty(y,p,{value:g,enumerable:!0,configurable:!0,writable:!0}):y[p]=g,y}function f(y){var p=h(y,"string");return typeof p=="symbol"?p:String(p)}function h(y,p){if(typeof y!="object"||y===null)return y;var g=y[Symbol.toPrimitive];if(g!==void 0){var C=g.call(y,p);if(typeof C!="object")return C;throw new TypeError("@@toPrimitive must return a primitive value.")}return(p==="string"?String:Number)(y)}function S(y,p){y.prototype=Object.create(p.prototype),y.prototype.constructor=y,m(y,p)}function m(y,p){return m=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(C,v){return C.__proto__=v,C},m(y,p)}var w=function(y){S(p,y);function p(){for(var C,v=arguments.length,M=new Array(v),b=0;b<v;b++)M[b]=arguments[b];return C=y.call.apply(y,[this].concat(M))||this,C.handleRefs={},C.lastHandleRect=null,C.slack=null,C}var g=p.prototype;return g.componentWillUnmount=function(){this.resetData()},g.resetData=function(){this.lastHandleRect=this.slack=null},g.runConstraints=function(v,M){var b=this.props,T=b.minConstraints,R=b.maxConstraints,k=b.lockAspectRatio;if(!T&&!R&&!k)return[v,M];if(k){var A=this.props.width/this.props.height,z=v-this.props.width,G=M-this.props.height;Math.abs(z)>Math.abs(G*A)?M=v/A:v=M*A}var j=v,F=M,_=this.slack||[0,0],N=_[0],P=_[1];return v+=N,M+=P,T&&(v=Math.max(T[0],v),M=Math.max(T[1],M)),R&&(v=Math.min(R[0],v),M=Math.min(R[1],M)),this.slack=[N+(j-v),P+(F-M)],[v,M]},g.resizeHandler=function(v,M){var b=this;return function(T,R){var k=R.node,A=R.deltaX,z=R.deltaY;v==="onResizeStart"&&b.resetData();var G=(b.props.axis==="both"||b.props.axis==="x")&&M!=="n"&&M!=="s",j=(b.props.axis==="both"||b.props.axis==="y")&&M!=="e"&&M!=="w";if(!(!G&&!j)){var F=M[0],_=M[M.length-1],N=k.getBoundingClientRect();if(b.lastHandleRect!=null){if(_==="w"){var P=N.left-b.lastHandleRect.left;A+=P}if(F==="n"){var I=N.top-b.lastHandleRect.top;z+=I}}b.lastHandleRect=N,_==="w"&&(A=-A),F==="n"&&(z=-z);var O=b.props.width+(G?A/b.props.transformScale:0),V=b.props.height+(j?z/b.props.transformScale:0),W=b.runConstraints(O,V);O=W[0],V=W[1];var H=O!==b.props.width||V!==b.props.height,L=typeof b.props[v]=="function"?b.props[v]:null,Y=v==="onResize"&&!H;L&&!Y&&(T.persist==null||T.persist(),L(T,{node:k,size:{width:O,height:V},handle:M})),v==="onResizeStop"&&b.resetData()}}},g.renderResizeHandle=function(v,M){var b=this.props.handle;if(!b)return e.createElement("span",{className:"react-resizable-handle react-resizable-handle-"+v,ref:M});if(typeof b=="function")return b(v,M);var T=typeof b.type=="string",R=u({ref:M},T?{}:{handleAxis:v});return e.cloneElement(b,R)},g.render=function(){var v=this,M=this.props,b=M.children,T=M.className,R=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 k=M.resizeHandles;M.transformScale;var A=c(M,o);return(0,n.cloneElement)(b,u(u({},A),{},{className:(T?T+" ":"")+"react-resizable",children:[].concat(b.props.children,k.map(function(z){var G,j=(G=v.handleRefs[z])!=null?G:v.handleRefs[z]=e.createRef();return e.createElement(t.DraggableCore,a({},R,{nodeRef:j,key:"resizableHandle-"+z,onStop:v.resizeHandler("onResizeStop",z),onStart:v.resizeHandler("onResizeStart",z),onDrag:v.resizeHandler("onResize",z)}),v.renderResizeHandle(z,j))}))}))},p}(e.Component);return nr.default=w,w.propTypes=r.resizableProps,w.defaultProps={axis:"both",handleSize:[20,20],lockAspectRatio:!1,minConstraints:[20,20],maxConstraints:[1/0,1/0],resizeHandles:["se"],transformScale:1},nr}var ir={},bd;function SA(){if(bd)return ir;bd=1,ir.__esModule=!0,ir.default=void 0;var e=a(E),t=s(xs()),n=s(Ag()),r=Pg(),o=["handle","handleSize","onResize","onResizeStart","onResizeStop","draggableOpts","minConstraints","maxConstraints","lockAspectRatio","axis","width","height","resizeHandles","style","transformScale"];function s(p){return p&&p.__esModule?p:{default:p}}function i(p){if(typeof WeakMap!="function")return null;var g=new WeakMap,C=new WeakMap;return(i=function(M){return M?C:g})(p)}function a(p,g){if(p&&p.__esModule)return p;if(p===null||typeof p!="object"&&typeof p!="function")return{default:p};var C=i(g);if(C&&C.has(p))return C.get(p);var v={},M=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var b in p)if(b!=="default"&&Object.prototype.hasOwnProperty.call(p,b)){var T=M?Object.getOwnPropertyDescriptor(p,b):null;T&&(T.get||T.set)?Object.defineProperty(v,b,T):v[b]=p[b]}return v.default=p,C&&C.set(p,v),v}function c(){return c=Object.assign?Object.assign.bind():function(p){for(var g=1;g<arguments.length;g++){var C=arguments[g];for(var v in C)Object.prototype.hasOwnProperty.call(C,v)&&(p[v]=C[v])}return p},c.apply(this,arguments)}function l(p,g){var C=Object.keys(p);if(Object.getOwnPropertySymbols){var v=Object.getOwnPropertySymbols(p);g&&(v=v.filter(function(M){return Object.getOwnPropertyDescriptor(p,M).enumerable})),C.push.apply(C,v)}return C}function u(p){for(var g=1;g<arguments.length;g++){var C=arguments[g]!=null?arguments[g]:{};g%2?l(Object(C),!0).forEach(function(v){d(p,v,C[v])}):Object.getOwnPropertyDescriptors?Object.defineProperties(p,Object.getOwnPropertyDescriptors(C)):l(Object(C)).forEach(function(v){Object.defineProperty(p,v,Object.getOwnPropertyDescriptor(C,v))})}return p}function d(p,g,C){return g=f(g),g in p?Object.defineProperty(p,g,{value:C,enumerable:!0,configurable:!0,writable:!0}):p[g]=C,p}function f(p){var g=h(p,"string");return typeof g=="symbol"?g:String(g)}function h(p,g){if(typeof p!="object"||p===null)return p;var C=p[Symbol.toPrimitive];if(C!==void 0){var v=C.call(p,g);if(typeof v!="object")return v;throw new TypeError("@@toPrimitive must return a primitive value.")}return(g==="string"?String:Number)(p)}function S(p,g){if(p==null)return{};var C={},v=Object.keys(p),M,b;for(b=0;b<v.length;b++)M=v[b],!(g.indexOf(M)>=0)&&(C[M]=p[M]);return C}function m(p,g){p.prototype=Object.create(g.prototype),p.prototype.constructor=p,w(p,g)}function w(p,g){return w=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(v,M){return v.__proto__=M,v},w(p,g)}var y=function(p){m(g,p);function g(){for(var v,M=arguments.length,b=new Array(M),T=0;T<M;T++)b[T]=arguments[T];return v=p.call.apply(p,[this].concat(b))||this,v.state={width:v.props.width,height:v.props.height,propsWidth:v.props.width,propsHeight:v.props.height},v.onResize=function(R,k){var A=k.size;v.props.onResize?(R.persist==null||R.persist(),v.setState(A,function(){return v.props.onResize&&v.props.onResize(R,k)})):v.setState(A)},v}g.getDerivedStateFromProps=function(M,b){return b.propsWidth!==M.width||b.propsHeight!==M.height?{width:M.width,height:M.height,propsWidth:M.width,propsHeight:M.height}:null};var C=g.prototype;return C.render=function(){var M=this.props,b=M.handle,T=M.handleSize;M.onResize;var R=M.onResizeStart,k=M.onResizeStop,A=M.draggableOpts,z=M.minConstraints,G=M.maxConstraints,j=M.lockAspectRatio,F=M.axis;M.width,M.height;var _=M.resizeHandles,N=M.style,P=M.transformScale,I=S(M,o);return e.createElement(n.default,{axis:F,draggableOpts:A,handle:b,handleSize:T,height:this.state.height,lockAspectRatio:j,maxConstraints:G,minConstraints:z,onResizeStart:R,onResize:this.onResize,onResizeStop:k,resizeHandles:_,transformScale:P,width:this.state.width},e.createElement("div",c({},I,{style:u(u({},N),{},{width:this.state.width+"px",height:this.state.height+"px"})})))},g}(e.Component);return ir.default=y,y.propTypes=u(u({},r.resizableProps),{},{children:t.default.element}),ir}var xd;function CA(){return xd||(xd=1,tr.exports=function(){throw new Error("Don't instantiate Resizable directly! Use require('react-resizable').Resizable")},tr.exports.Resizable=Ag().default,tr.exports.ResizableBox=SA().default),tr.exports}var Og=CA();const wd=({booking:e,slotData:t,customClasses:n,hoveringAdditionalCardId:r="",children:o,ref:s})=>{const[i,a]=E.useState(!1),c=Le(zr(v=>v.bookingViewType)),{updateIsDragging:l,isDragging:u}=zn(v=>v),{attributes:d,listeners:f,setNodeRef:h,isDragging:S,transform:m}=ha({id:e.id,data:{type:"booking-slots",booking:e,slotData:t},disabled:e.disabledResize==="full"||e.disabledResize==="half"||e.startAt.getDate()!==e.finishAt.getDate()}),w=m?{transform:`translate3d(${m.x}px, ${m.y}px, 0)`}:void 0;Nr({onDragStart:()=>y(),onDragAbort:()=>p(),onDragCancel:()=>p(),onDragEnd:()=>p()});const y=E.useCallback(()=>{l(!0)},[]),p=E.useCallback(()=>{l(!1)},[]),g=E.useMemo(()=>({cursor:u?"ns-resize":"pointer",width:c===oe.DAY?"99%":"100%"}),[u,c]),C=(v,M)=>r!=null&&r.length?v===M:!1;if(E.useImperativeHandle(s,()=>({changeCurrentCardResize:()=>a(v=>!v)})),!S)return x.jsx("div",{ref:h,className:ce("cardContent_render",(i||C(r,e.id))&&"cardContent_render_dragging",n),style:{...w,...g},...f,...d,children:o},e.id)};function TA(e,t){const n=e>new Date(t.startAt),r=e<new Date(t.finishAt);return n&&r}const DA={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)TA(e.startAt,o)&&r++;return r}},Ac=({bookingInit:e,slotData:t,heightStyle:n,topHeightIncrement:r,customClasses:o,bookingViewType:s,resizableParam:i,events:a,open:c=!0,lastCard:l,half:u,cardContentRef:d,cardsQuantity:f,cardIndex:h,hoveringAdditionalCardId:S,ref:m})=>{var H;const w=zn(zr(L=>L.updateIsDragging)),{emptySlotNodes:y}=Tt(),{bookings:p,onCardResizeEnd:g}=Lt(),[C,v]=E.useState(""),M=E.useRef(null),b=E.useMemo(()=>s===oe.DAY?{width:"99%"}:{width:"100%"},[s]),T=(L,Y)=>{var K;R("show-handle",!0),i!=null&&i.onResizeStart&&i.onResizeStart(L,Y),(K=M.current)==null||K.changeCurrentCardResize()},R=(L="",Y=!1)=>{v(L),w(Y)},k=(L,Y)=>{var K;(K=M.current)==null||K.changeCurrentCardResize(),R(),Y.handle.includes("n")&&g(Ai.resizeBookingNorthId(e)),Y.handle.includes("s")&&g(Ai.resizeBookingSouthId(e)),i!=null&&i.onResizeStop&&i.onResizeStop(L,Y)},A=E.useMemo(()=>DA.calculateOverlappingBookings(e,p),[e,p]),z=E.useMemo(()=>ce(i==null?void 0:i.customClass,C,u&&A>0&&"",u?"":A>0&&"inner_cards_parent",l&&A&&u&&"inner_cards_parent_last_card_disable",l&&A&&"inner_cards_parent_last_card",l&&A===2&&"inner_cards_parent_last_card_layer_2",A===1&&!u&&"inner_cards_parent_1_layer",A===2&&"inner_cards_parent_2_layer",u&&A===3&&"inner_cards_parent_resizable_layer_3_half inner_cards_parent_3_layer_half",A===3&&"inner_cards_parent_resizable_layer_3 inner_cards_parent_3_layer"),[i,C,u,A,l]),G=L=>L===0?"8rem":"4rem",j=E.useMemo(()=>u&&h===0&&f===3||u&&h===1&&f===3?G(h):A===2?"0.8rem":l&&A===1?"0.2rem":l&&A?"1rem":A===1?"0.4rem":0,[u,l,A,h,f]),F=E.useMemo(()=>u&&h===0&&f===3&&!A?"0rem":u&&h===0&&f===3?"0.4rem":u&&h===1&&f===3?"5rem":l&&f===3?"9rem":l?"6.5rem":0,[u,l,h,A,f]),_=E.useMemo(()=>u&&f===3&&(u&&h===0||u&&h===1)||u&&l&&f===3||u&&l?{inset:`${r}rem ${j} ${n}rem ${F}`}:u&&f===3||u?{inset:`${r}rem 6.5rem ${n}rem ${j}`}:{inset:`${r||0}rem ${j} ${n}rem`},[u,A,n,r,h,f,j,F]),N=(L,Y)=>{const K=y.get(Y);K==null||K.hoveringAdditionalCard(L.id)},P=L=>{const Y=y.get(L);Y==null||Y.clearHoveringCard()},I=(L,Y)=>{({mouseenter:()=>N(e,L),mouseleave:()=>P(L)}[Y]||(()=>console.warn(`Unhandled event type: ${Y}`)))()},O=L=>{const Y=L.toDateString();return sn({key:Y,time:oa})},V=L=>{const Y=Z.calculateDaysDifference(e.finishAt,e.startAt);if(Y===1){I(O(e.finishAt),L);return}const K=Z.buildFutureDateList(e,Y);for(const $ of K)I(O($),L)},W=L=>{const Y=L.type;if(e!=null&&e.nodes)for(const K of e.nodes)I(K,Y);V(Y)};if(E.useEffect(()=>()=>{a!=null&&a.onUnmount&&a.onUnmount()},[]),E.useImperativeHandle(d,()=>({changeCurrentCardResize:()=>{var L;(L=M.current)==null||L.changeCurrentCardResize()}})),!c&&!e.finishAt)return null;if((H=i==null?void 0:i.state)!=null&&H.height){const{state:L,onResize:Y,resizeHandle:K=["s","n"]}=i,$=()=>{switch(e==null?void 0:e.disabledResize){case"full":return[];case"half":return["s"];default:return K}};return x.jsx(Og.Resizable,{className:ce(z),height:L==null?void 0:L.height,width:L==null?void 0:L.width,onResize:Y,onResizeStart:T,onResizeStop:k,resizeHandles:$(),draggableOpts:{grid:[35,35]},handleSize:[20,20],maxConstraints:[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY],transformScale:1,children:x.jsx("div",{className:"card_content_core",style:{..._},onMouseEnter:W,onMouseLeave:W,onBlur:()=>{},children:x.jsx(wd,{ref:M,booking:e,slotData:t,layerCount:A,half:u,hoveringAdditionalCardId:S,children:x.jsx(Oi,{booking:e,slotData:t,events:{onClick:a==null?void 0:a.onClick}})},e.id)})})}return x.jsx("div",{ref:m,className:"card_content_core",style:{...b,..._},children:x.jsx(wd,{customClasses:o,booking:e,slotData:t,children:x.jsx(Oi,{booking:e,slotData:t,events:{onClick:a==null?void 0:a.onClick}})})})},Sd=({booking:e,slotData:t,cardsQuantity:n=1,cardIndex:r=0,lastCard:o=!1,half:s=!1,hoveringAdditionalCardId:i,ref:a})=>{const{bookingViewType:c}=Le(),[l,u]=E.useState({...e});E.useEffect(()=>{e&&u(e)},[e]);const[d,f]=E.useState(!1),h=E.useRef("left"),S=()=>{const M=t.day.split(":")[0].trim();if(c===oe.DAY)h.current="top";else switch(M){case"Mon":case"Sun":h.current="right";break;default:h.current="left";break}f(!0)},m=async M=>{try{u(b=>({...b,finishAt:M}))}catch(b){console.log(b)}},w=async M=>{u(b=>({...b,startAt:M}))},y=async M=>{try{u(b=>({...b,finishAt:M}))}catch(b){console.log(b)}},{state:p,heightStyle:g,topHeightIncrement:C,onResize:v}=Lm({booking:l,onAddTime:m,onAddStartTime:w,onSubTime:y,starter:!0});return E.useImperativeHandle(a,()=>({bookingId:e.id}),[e.id]),x.jsx(Sg,{booking:l,onOpenChange:f,side:c===oe.DAY?"top":"left",isEditingOpen:d,children:x.jsx(Ac,{resizableParam:{state:p,onResize:v,resizeHandle:["s","n"]},customClasses:"Draggable",bookingInit:l,bookingViewType:c,slotData:t,topHeightIncrement:C,heightStyle:g,events:{onClick:S},half:s,lastCard:o,cardsQuantity:n,cardIndex:r,hoveringAdditionalCardId:i})})},Cd=({bookings:e,blockTimeString:t,slotData:n,hoveringAdditionalCardId:r})=>{if(!e||!(n!=null&&n.day)&&!(n!=null&&n.hour)||!t)return null;const o=E.useMemo(()=>e.filter(s=>Z.dateAndHourDateToString(new Date(s.startAt)).split(":")[1]===t),[e,t]);if(!(!o||!(o!=null&&o.length)))return o.length===1?x.jsx(Sd,{booking:o[0],slotData:n,hoveringAdditionalCardId:r}):x.jsx(x.Fragment,{children:o.map((s,i)=>x.jsx(Sd,{booking:s,half:!0,slotData:n,lastCard:o.length-1===i,cardsQuantity:o.length,cardIndex:i,hoveringAdditionalCardId:r},s.id))})},kg=E.createContext(null),EA=e=>{const t=E.use(kg);if(!t)throw new Error("useConfig must be used within a ConfigContext");return Uo(t,e)},MA=-Math.abs(1.98),RA={DOWN:"DOWN"},PA=({booking:e,onAddTime:t,onStartAtChange:n,onSubTime:r,starter:o=!1})=>{const[s,i]=E.useState({height:jt,width:jt}),[a,c]=E.useState(0),l=(b,T)=>{const R=Z.timeDiffInSeconds(b,T),k=Math.ceil(R/li);return-Math.abs((k-1)*2)},[u,d]=E.useState(o?l(e.finishAt,e.startAt):0),f=b=>b===-Math.abs(0)||b===0,h=async b=>{console.log("addTime"),console.log("direction",b);const T=y(e.finishAt,"add");d(R=>f(R)?MA:R-2),t&&t(T)},S=async()=>{const b=y(e.finishAt,"remove");d(T=>T+2),r&&r(b)},m=async()=>{const b=p(e.startAt,"remove");c(T=>T-2),n&&n(b)},w=async()=>{const b=p(e.startAt,"add");c(T=>T+2),n&&n(b)},y=(b,T)=>{const R=new Date(b),k=R.getMinutes();return T==="add"&&R.setMinutes(k+15),T==="remove"&&R.setMinutes(k-15),R},p=(b,T)=>{const R=new Date(b),k=R.getMinutes();return T==="add"&&R.setMinutes(k+15),T==="remove"&&R.setMinutes(k-15),R};return{state:s,setState:i,resetState:()=>{i({height:jt,width:jt})},resetHeightStyle:()=>{d(0)},heightStyle:u,topHeightIncrement:a,onResize:(b,{size:T})=>{b.stopPropagation(),b.preventDefault();const R=T.height;i(k=>(k.height<R&&(a!==0?w():h(RA.DOWN)),k.height>R&&(R<600?m():S()),{...k,height:R}))},updateHeightStyle:(b,T)=>{d(l(b,T))}}},AA=E.forwardRef(({isDragging:e,slotData:t,events:{onClick:n,renderPreviewCard:r,resetPrevView:o}},s)=>{const[i,a]=E.useState(!1),[c,l]=E.useState(t.time),[u,d]=E.useState(Z.addMinutesToHour(c,15)),f=Le(P=>P.bookingViewType),{systemColor:h,isTimeInfoVisible:S}=EA(P=>P),[m,w]=E.useState(!1),[y,p]=E.useState(!1),g=E.useRef(null),C=y?{backgroundColor:"white",border:"none"}:{},v=E.useMemo(()=>({id:"dragging_booking_preview",startAt:Z.convertStringTimeToDateFormat(c),finishAt:Z.convertStringTimeToDateFormat(u)}),[u,c]),M=()=>{w(!0),p(!0),r()},b=()=>{w(!1),n(u,c)};E.useEffect(()=>{var P;m&&((P=g.current)==null||P.changeCurrentCardResize())},[m]);const{state:T,resetState:R,resetHeightStyle:k,heightStyle:A,onResize:z,updateHeightStyle:G,topHeightIncrement:j}=PA({booking:v,onAddTime:P=>{console.log("onAddTime date time",P),d(Z.dateTimeAsString(P))},onStartAtChange:P=>{console.log("onStartAtChange date time",P),l(Z.dateTimeAsString(P))},onSubTime:P=>{console.log("onSubTime date time",P),d(Z.dateTimeAsString(P))}}),F=()=>{},_=()=>{d(Z.addMinutesToHour(t.time,15))},N=()=>{p(!1),_(),R(),k()};if(E.useEffect(()=>{if(!u||!c)return;const P=Z.convertStringTimeToDateFormat(u),I=Z.convertStringTimeToDateFormat(t.time);Number.isNaN(P)||Number.isNaN(I)||!(P instanceof Date)||!(I instanceof Date)||G(P,I)},[u,c]),E.useImperativeHandle(s,()=>({show:()=>a(!0),hide:()=>a(!1),changeIsOpen:P=>a(P),reset:N}),[]),!!i)return x.jsx("div",{style:{...C,border:S&&!e?`1.5px solid ${h}`:"none"},className:ce("timeInfo_core",C),children:x.jsx(Og.Resizable,{className:"slot-resizable",height:T.height,width:T.width,onResizeStart:M,onResizeStop:b,onResize:z,resizeHandles:["se"],draggableOpts:{grid:[35,35]},handleSize:[30,30],maxConstraints:[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY],transformScale:1,children:y?x.jsx("div",{className:"timeInfo_core_dragging",children:x.jsx(Ac,{bookingInit:v,bookingViewType:f,slotData:{day:new Date().toISOString(),hour:"09:00"},topHeightIncrement:j,heightStyle:A,cardContentRef:g,resizableParam:{state:T,onResize:z,customClass:"show-handle"},events:{onUnmount:F}})}):x.jsx("div",{className:"timeInfo_core_timeParent",children:!e&&x.jsx("span",{className:"timeInfo_core_timeParent_time",style:{color:h,display:S?"initial":"none"},children:t.time})})})})}),po=({slotData:e,blockTimeString:t,dayHour:n,slotPosition:r,disabledCss:o,events:s,bookings:i,children:a,ref:c})=>{const{isDragging:l,updateIsDragging:u}=zn(J=>J),{emptySlotNodes:d,setSelectedNode:f}=Tt(),{onModalClose:h,onSlotClick:S}=Lt(),{startAt:m,finishAt:w,updateDate:y,updateStartAt:p,updateFinishAtWithOffset:g}=Fd(J=>J),C=Le(J=>J.bookingViewType),[v,M]=E.useState(!1),[b,T]=E.useState(!1),[R,k]=E.useState([]),[A,z]=E.useState(""),G=E.useRef(null),j=E.useRef(null),F=E.useRef(null),_=J=>{k(le=>le.filter(ye=>ye.id!==J.id))},N=(J,le,ye=!1)=>{const Ve=new Date(J.finishAt);Ve.setHours(24,0);const He=[{id:J.id,finishAt:ye?Ve:J.finishAt,overflow:!0,startAt:Ai.resetToFirstHourNextDay(J),disabledResize:ye?"full":"half",nodes:le}];k(He)},P=()=>F.current,I=()=>{var J;(J=F.current)==null||J.isModalOpen()},O=()=>{var J;(J=P())==null||J.showCreationModal()},V=()=>{var J;(J=j.current)==null||J.show()},W=()=>{var J;(J=j.current)==null||J.hide()},H=J=>{var le;(le=j.current)==null||le.changeIsOpen(J)},L=E.useMemo(()=>({id:"dragging_booking_preview",startAt:Z.convertStringTimeToDateFormat(m),finishAt:Z.convertStringTimeToDateFormat(w)}),[w,m]),{updateHeightStyle:Y,heightStyle:K}=Lm({booking:L}),$=(J,le)=>!le||!(le!=null&&le.length)?!1:!!le.find(ye=>Z.dateTimeAsString(ye.startAt)===J),q=E.useCallback(()=>{if($(e.time,i)||l||I()||v)return;s.onMouseEnterEvent()===r&&V()},[r,l,v,s,R,i]),X=J=>{var Ve,He;console.log("onCloseCreationModal"),(Ve=j.current)==null||Ve.reset();const le=sn(e),ye=d==null?void 0:d.get(le);ye&&ye.closeEvent(),h==null||h(),J==null||J.stopPropagation(),J==null||J.preventDefault(),(He=P())==null||He.closeModal()},U=J=>{J||X(),M(J),H(J)},ne=E.useCallback((J,le)=>{if(l&&!J)return;u(!1);const{time:ye,key:Ve}=e,He=sn({key:Ve,time:le||ye}),Gn=d==null?void 0:d.get(He);f(He),Gn&&Gn.showEvent(le||ye),y(Ve);const Cs=g(J||ye,J?0:15);S({slotData:e,finishTime:Cs}),O()},[e,d,l,f,S,y,p,u,g]),B=()=>{l||I()||W()},ie=o.length||b?o:"hovering_slotTrigger_core",pe=E.useCallback(()=>{const{time:J,key:le}=e;u(!0),T(!0),y(le),p(J),g(J)},[g,e,y,u,p]),Oe=()=>{O()},Ee=E.useCallback(()=>{T(!1)},[]),ot=()=>{setTimeout(()=>{W(),O(),M(!0)},0)};return E.useEffect(()=>{l?document.body.style.cursor="ns-resize":document.body.style.cursor="default"},[l]),E.useEffect(()=>{if(!w||!m)return;const J=Z.convertStringTimeToDateFormat(w),le=Z.convertStringTimeToDateFormat(m);Number.isNaN(J)||Number.isNaN(le)||!(J instanceof Date)||!(le instanceof Date)||Y(J,le)},[w,m]),E.useEffect(()=>{if(!v){W();return}G!=null&&G.current&&G.current.scrollIntoView({behavior:"smooth",block:"center"})},[v]),E.useEffect(()=>{i!=null&&i.length&&W(),b&&V()},[i,b]),E.useEffect(()=>{b&&V()},[b]),E.useImperativeHandle(c,()=>({showEvent:J=>{p(J),ot()},closeEvent:()=>{var J;(J=P())==null||J.closeModal(),M(!1),W(),Ee()},onOpenCloseChange:J=>{H(J),M(J),Ee()},addAdditionalBooking:N,removeFromAdditionalBooking:_,hoveringAdditionalCard:J=>{z(J)},clearHoveringCard:()=>{z("")}})),x.jsxs(x.Fragment,{children:[x.jsxs("div",{ref:e.ref,style:{borderBottom:r==="fourth"?"1px solid #8080807a":"",...e.style},className:ce("slotTrigger_core",C===oe.DAY&&"slotTrigger_core_day",ie),onMouseOver:q,onMouseLeave:B,onFocus:()=>{},children:[x.jsx(AA,{ref:j,isDragging:l,slotData:e,events:{onClick:ne,openOptions:Oe,renderPreviewCard:pe,resetPrevView:Ee}}),a,v&&x.jsx(Ac,{ref:G,bookingInit:L,bookingViewType:C,slotData:{day:new Date().toISOString(),hour:"09:00"},hoveringAdditionalCardId:A,heightStyle:K}),x.jsx(Cd,{hoveringAdditionalCardId:A,bookings:R,blockTimeString:"00",slotData:n}),x.jsx(Cd,{hoveringAdditionalCardId:A,bookings:i,blockTimeString:t,slotData:n})]},e.key),x.jsx(sp,{ref:F,onClose:X,onOpenChange:U,buttonTrigger:x.jsx("div",{},e.key),side:C===oe.DAY?"top":"right"})]})};var OA="Separator",Td="horizontal",kA=["horizontal","vertical"],_g=D.forwardRef((e,t)=>{const{decorative:n,orientation:r=Td,...o}=e,s=_A(r)?r:Td,a=n?{role:"none"}:{"aria-orientation":s==="vertical"?s:void 0,role:"separator"};return x.jsx(ae.div,{"data-orientation":s,...a,...o,ref:t})});_g.displayName=OA;function _A(e){return kA.includes(e)}var NA=_g;function IA({className:e,orientation:t="horizontal",decorative:n=!0,...r}){return x.jsx(NA,{"data-slot":"separator-root",decorative:n,orientation:t,className:ce("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 jA=ma("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 LA({className:e,variant:t,...n}){return x.jsx("div",{className:ce(jA({variant:t}),e),...n})}const VA=({dateToRender:e,isFirstDay:t})=>x.jsx("div",{style:{left:t?"3px":"10px"},className:"first_day_slot",children:x.jsx("span",{children:x.jsx(LA,{children:e})})});class FA{constructor(){Xt(this,"positionBasedOnSeconds",t=>{const[,n]=t.split(":");if(!t.length)return-3;const r=Number(n);return this.normalizingMinutes(r)});Xt(this,"normalizingMinutes",t=>t>=0&&t<=15?t*2:t>15&&t<30?(t-15)*2:t>=30&&t<=59?t-30:-3);Xt(this,"isInitialMinute",t=>t>=0&&t<=8);Xt(this,"isSameHour",(t,n)=>n.split(":")[0]===t)}}class $A{constructor(){Xt(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=Z.roundMinutes(n.getMinutes());i.setHours(n.getHours(),a,0,0);const c=Z.minuteDifference(s,i);return c>30||c<-30});Xt(this,"normalizeDateNow",t=>{const n=t.getHours(),r=Z.roundMinutes(t.getMinutes());return`${n.toString().padStart(2,"0")}:${r.toString().padStart(2,"0")}`})}}const mo=({color:e="#000",isFirstDay:t,slotData:n})=>{const{timesRendered:r,bookingViewType:o}=Le(),[s,i]=E.useState(""),[a,c]=E.useState(!1),[l,u]=E.useState(!1),d=E.useMemo(()=>{const p=new Date,g=new Date(n.key);return g.getDay()===p.getDay()&&g.getDate()===p.getDate()},[n.key]),f=p=>{i(p)},h=()=>{c(!0)},S=()=>{c(!1)},m=E.useMemo(()=>new FA().positionBasedOnSeconds(s),[n.time,s,r]),w=E.useMemo(()=>t?"101%":o===oe.DAY?"102%":"104%",[t,o]),y=E.useMemo(()=>d?{top:`${m-2}px`,left:t?"-1px":"-3px",width:t?"101%":"104%"}:{top:`${m-1}px`,left:t?"-1px":"0px",width:w},[d,t,w,m]);if(E.useEffect(()=>{const p=n.time,g=new $A,C=()=>{const M=new Date,b=g.normalizeDateNow(M),T=Z.dateAndHourDateToString(M);s!==T&&f(T),u(b===p)};let v;return g.is15MinLess(p)||(v=setInterval(()=>C(),1e3)),()=>clearInterval(v)},[n.time,s]),!!l)return x.jsxs("div",{style:{...y},className:ce("timeIndicator_today",d&&w,d&&"timeIndicator_today_circle"),onMouseEnter:h,onMouseOut:S,onBlur:()=>{},children:[x.jsx(IA,{className:"focus-effect",style:{height:d?"4px":"2px",backgroundColor:e}}),a&&x.jsx(VA,{isFirstDay:t,dateToRender:s})]})},Dd=({bookings:e,first:t,second:n,third:r,fourth:o,disabledCss:s,firstDay:i,dayHour:a})=>{const{setEmptySlotNode:c,emptySlotNodes:l}=Tt(),u=E.useCallback((m,w)=>{if(!m)return;const y=sn(w);l.get(y)||c(m,w)},[c,l]),d=(m,w)=>{const y=m.toDateString();return sn({key:y,time:w?Z.dateTimeAsString(w):oa})},f=E.useCallback(m=>{const w=d(m);return l.get(w)},[l]),h=(m,w,y)=>{const p=Z.buildFutureDateList(m,w);for(let g=0;g<p.length;g++){const C=f(p[g]);if(!C)return;C.addAdditionalBooking(m,y,g!==p.length-1)}},S=E.useCallback(()=>{if(e!=null&&e.length)for(const m of e){const w=Z.calculateDaysDifference(m.finishAt,m.startAt),p=Z.buildFutureDateList(m,w+1,0).map((g,C)=>d(g,C===0?m.startAt:void 0)).filter(g=>g!==void 0);if(w===1){const g=f(m.finishAt);if(!g)return;g.addAdditionalBooking(m,p);return}h(m,w,p)}},[e,f,h]);return E.useEffect(()=>{e!=null&&e.length&&S()},[e,l,S]),x.jsxs(x.Fragment,{children:[x.jsx(po,{ref:m=>u(m,{key:t.key,time:t.time}),slotData:t,disabledCss:s,events:{onMouseEnterEvent:()=>"first"},slotPosition:"first",dayHour:a,bookings:e,blockTimeString:"00",children:x.jsx(mo,{isFirstDay:i,slotData:t})}),x.jsx(po,{ref:m=>u(m,{key:n.key,time:n.time}),slotData:n,disabledCss:s,events:{onMouseEnterEvent:()=>"second"},slotPosition:"second",dayHour:a,bookings:e,blockTimeString:"15",children:x.jsx(mo,{isFirstDay:i,slotData:n})}),x.jsx(po,{ref:m=>u(m,{key:r.key,time:r.time}),slotData:r,disabledCss:s,events:{onMouseEnterEvent:()=>"third"},slotPosition:"third",dayHour:a,bookings:e,blockTimeString:"30",children:x.jsx(mo,{isFirstDay:i,slotData:r})}),x.jsx(po,{ref:m=>u(m,{key:o.key,time:o.time}),slotData:o,disabledCss:s,events:{onMouseEnterEvent:()=>"fourth"},slotPosition:"fourth",dayHour:a,bookings:e,blockTimeString:"45",children:x.jsx(mo,{isFirstDay:i,slotData:o})})]})},BA=E.memo(({firstDay:e,booking:t,dayHour:n,disabledCss:r,firstBlockTimeData:o,secondBlockTimeData:s,thirdBlockTimeData:i,fourthBlockTimeData:a})=>{const{day:c,hour:l}=n,u=E.useMemo(()=>t.filter(d=>{const f=Z.dateAndHourDateToString(d.startAt),h=new Date(d.startAt).getDate(),S=new Date(c).getDate(),m=l.split(":")[0];return f.split(":")[0]===m&&h===S}),[t,n]);return u.length?x.jsx(Dd,{dayHour:n,bookings:u,first:o,second:s,third:i,fourth:a,disabledCss:r,firstDay:e}):x.jsx(Dd,{dayHour:n,first:o,second:s,third:i,fourth:a,disabledCss:r,firstDay:e})}),zA=({dayHour:e,firstDay:t,bookingBulk:n})=>{const r=E.useRef(""),o=Tc(v=>v.updateStartAt),{bookingViewType:s}=Le(zr(v=>({bookingViewType:v.bookingViewType}))),i=E.useMemo(()=>Z.addMinuteToHour(e.hour,15),[e.hour]),a=E.useMemo(()=>Z.addMinuteToHour(e.hour,30),[e.hour]),c=E.useMemo(()=>Z.addMinuteToHour(e.hour,45),[e.hour]),{isOver:l,setNodeRef:u}=Zr({id:`${Z.newDateKey(e.day,e.hour)}`,data:{accepts:["booking-slots"]}}),{isOver:d,setNodeRef:f}=Zr({id:`${Z.newDateKey(e.day,i)}`,data:{accepts:["booking-slots"]}}),{isOver:h,setNodeRef:S}=Zr({id:`${Z.newDateKey(e.day,a)}`,data:{accepts:["booking-slots"]}}),{isOver:m,setNodeRef:w}=Zr({id:`${Z.newDateKey(e.day,c)}`,data:{accepts:["booking-slots"]}});E.useEffect(()=>{l&&o(`${Z.newDateKey(e.day,e.hour)}`),d&&o(`${Z.newDateKey(e.day,i)}`),h&&o(`${Z.newDateKey(e.day,a)}`),m&&o(`${Z.newDateKey(e.day,c)}`)},[l,d,h,m]);const y=E.useMemo(()=>({ref:u,style:{backgroundColor:l?"#0066ff":""},key:Z.newDateKey(e.day,e.hour),time:e.hour}),[e.day,l,e.hour,u]),p=E.useMemo(()=>({ref:f,style:{backgroundColor:d?"#0066ff":""},key:Z.newDateKey(e.day,i),time:i}),[e.day,d,i,f]),g=E.useMemo(()=>({ref:S,style:{backgroundColor:h?"#0066ff":""},key:Z.newDateKey(e.day,a),time:a}),[e.day,h,a,S]),C=E.useMemo(()=>({ref:w,style:{backgroundColor:m?"#0066ff":""},key:Z.newDateKey(e.day,c),time:c}),[e.day,c,m,w]);return x.jsx("td",{className:ce("slot",s===oe.WEEK&&"slotWeek"),children:x.jsx(BA,{booking:n,dayHour:e,firstDay:t,disabledCss:r.current,firstBlockTimeData:y,secondBlockTimeData:p,thirdBlockTimeData:g,fourthBlockTimeData:C})},`${e.day}-${e.hour}-slot`)},WA=({hour:e,ref:t})=>{const n="Set lunch interval",r="Remove lunch interval",o="Hour options",s=E.useRef(null),i="border-solid hover:border-b-2 hover:border-b-purple-600 border-b-white",a=()=>{s!=null&&s.current&&s.current.setAttribute("class",ce("activateVisibilityTime",i))};return E.useImperativeHandle(t,()=>({setActivateHour:a})),x.jsxs(Wa,{children:[x.jsx(Ha,{children:x.jsx("span",{ref:s,className:ce(i),children:e})}),x.jsxs(Ua,{children:[x.jsx(HC,{children:o}),x.jsx(UC,{}),x.jsx(_l,{children:n}),x.jsx(_l,{children:r})]})]})},HA=()=>{const{hours:e,daysOfWeek:t,bookingViewType:n,bookingBulkData:r,addTimesRendered:o}=Le(zr(C=>({addTimesRendered:C.addTimesRendered,bookingBulkData:C.bookingBulkData,bookingViewType:C.bookingViewType,daysOfWeek:C.daysOfWeek,hours:C.hours}))),{selectedNode:s,emptySlotNodes:i}=Tt(),{finishAt:a,updateFinishAtWithOffset:c}=Fd(C=>C),{booking:l,slotData:u,startAt:d}=Tc(C=>C),[f]=E.useState({startAt:"12:00",finishAt:"12:30"}),h=E.useRef(null),S=E.useCallback((C,v)=>{C&&o(C,v)},[o]),m=E.useMemo(()=>n===oe.DAY?{maxWidth:"5rem",padding:0,minWidth:"4rem"}:{},[n]),w=E.useMemo(()=>({borderLeft:"none",backgroundColor:"white"}),[]),y=E.useMemo(()=>s.split(";")[1],[s]),p=E.useMemo(()=>{if(l&&u)return x.jsx(Oi,{ref:h,style:{borderRadius:"0.25rem"},booking:l,slotData:u})},[l,u]);return E.useEffect(()=>{if(s){const C=i.get(s);C==null||C.showEvent(y)}},[s,i]),E.useEffect(()=>{y===a&&c(y)},[s,a]),E.useEffect(()=>{if(l&&d&&(h!=null&&h.current)){const C=Z.bookingTimeRange(l,d);h.current.updateBooking(C)}},[l,d]),E.useMemo(()=>{const C=v=>v===0;return x.jsxs("div",{className:ce("calendarCore",n===oe.WEEK&&"calendarCore_max"),children:[x.jsx(sT,{children:x.jsx("tbody",{children:e.map(v=>x.jsxs("tr",{children:[x.jsx(iT,{style:{...w,...m,padding:0,position:"relative"},className:"calendarCore_cell",children:x.jsx("div",{className:"calendarCore_actions",children:x.jsx(WA,{ref:M=>S(M,v),hour:v})})},`${v}-hour`),t.map((M,b)=>x.jsx(zA,{dayHour:{day:String(M),hour:v},lunchTimeBlock:f,firstDay:C(b),bookingBulk:r.booking},`${M}-${v}-slot-content`))]},`${v}-content`))})}),x.jsx(YR,{children:p})]})},[m,e,w,r.booking,S,n,t,t.length,p])},UA=({children:e})=>{const{resetSelectedNode:t,resetNodes:n}=Tt(o=>o),r=Le(o=>o.bookingViewType);switch(E.useEffect(()=>{(r===oe.DAY||r===oe.WEEK)&&(t(),n())},[r,n,t]),r){case oe.DAY:case oe.WEEK:return e;default:return null}},YA=({children:e,...t})=>{const n=E.useRef(null);return n.current||(n.current=Ug(t)),x.jsx(uv,{value:n.current,children:e})},KA=({children:e,...t})=>x.jsx(Nd,{value:{...t},children:e}),GA={systemColor:"#000000",isTimeInfoVisible:!0},qA=e=>Or(t=>({...GA,...e,updateSystemColor:n=>{t(r=>({...r,systemColor:n}))},changeTimeInfoVisibility:n=>{t(r=>({...r,isTimeInfoVisible:n}))}})),XA=({children:e,...t})=>{const n=E.useRef(null);return n.current||(n.current=qA(t)),x.jsx(kg,{value:n.current,children:e})},Ng={month:new Date().getMonth(),fullYear:new Date().getFullYear(),monthMessage:""},ZA=e=>Or((t,n)=>({...e,...Ng,updateMonthMessage:r=>{t(o=>({...o,...r}))},updateHeaderDateLabel:r=>{n().updateMonthMessage({month:r.getMonth(),fullYear:r.getFullYear(),monthMessage:Mn[r.getMonth()]})}})),JA=({children:e,...t})=>{const n=E.useRef(null);return n.current||(n.current=ZA(t)),x.jsx(jd,{value:n.current,children:e})},QA={id:"user-123",profile:{id:"profile-123",name:"Diego",email:"jane.smith@example.com"},createdAt:new Date,updatedAt:new Date},Ed={distance:5},eO=({isLoading:e})=>{const{bookings:t}=Lt(),n=Ev(zc(tf,{activationConstraint:Ed}),zc(nf,{activationConstraint:Ed})),{setBookingBulkData:r,optimisticCardUpdate:o,bookingViewType:s,daysOfWeek:i}=Le(),{onCardDropCallback:a}=Lt(),{emptySlotNodes:c}=Tt(),{updateBooking:l,updateSlotData:u}=Tc(y=>y),d=E.useCallback(y=>{const{active:p}=y;p.data.current&&(l(p.data.current.booking),u(p.data.current.slotData)),p.id},[l,u]),f=E.useCallback((y,p)=>{const g=sn({key:p.toDateString(),time:oa}),C=c.get(g);if(!C){console.warn("SlotNode not found:",g);return}C.removeFromAdditionalBooking(y)},[c]),h=y=>{const p=Z.calculateDaysDifference(y.finishAt,y.startAt),g=Z.buildFutureDateList(y,p);for(const C of g)f(y,C)},S=async(y,p,g)=>{try{const{startAt:C,finishAt:v}=Z.bookingTimeRange(y,p);o(y,C,v,g),await a(y,p,g,{id:y.id,startAt:C,finishAt:v}),h(y)}catch(C){console.warn(C)}},m=y=>{const{over:p,active:g}=y;if(p&&g){const C=p.data.current,v=g.data.current;if(v&&C&&C.accepts.includes(v.type)&&v.booking.id&&p.id){const M=t.find(b=>b.id===v.booking.id);if(!M)return;S(M,String(p.id),v.slotData),u(null),l(null)}}},w={position:"absolute",top:"50%",left:"50%",transform:"translate('-50%', '-50%')",zIndex:100};return E.useEffect(()=>{r({user:QA,booking:t})},[t,r]),x.jsxs("div",{className:"calendarHolder",children:[x.jsx(JA,{...Ng,children:x.jsxs("div",{className:"calendarHolder_parent",children:[x.jsx(oT,{}),x.jsxs("div",{className:"calendarHolder_parent_content",children:[x.jsx(ZC,{daysOfWeek:i,bookingViewType:s}),x.jsx(UA,{children:x.jsx(fa,{onDragEnd:m,onDragStart:d,sensors:n,children:x.jsx(HA,{})})})]})]})}),x.jsx(Wy,{color:"#000000aa",loading:e,cssOverride:w,size:15,"aria-label":"Loading Spinner","data-testid":"GridLoader"})]})},tO="Create new booking",nO={create_new_booking:tO},rO="Criar novo agendamento",oO={create_new_booking:rO},sO=({children:e})=>{const[t,n]=E.useState(!0),{i18n:r}=ah();return E.useEffect(()=>{r.addResourceBundle("en_US","translation",nO,!0,!0),r.addResourceBundle("pt_BR","translation",oO,!0,!0),n(!1)},[r]),t?null:x.jsx(gS,{i18n:r,defaultNS:"translation",children:e})},iO=({viewModes:e,createBookingModal:t,onChangeViewType:n,onCardDropCallback:r,onCardResizeEnd:o,onDayChange:s,onHeaderDayClick:i,onTodayClick:a,onSlotClick:c,onModalClose:l,bookings:u,isTimeInfoVisible:d,systemColor:f,ref:h})=>{const[S,m]=E.useState(!1),w=E.useRef(null),{setBookingViewType:y,setWeekAndViewType:p,setTodayDayAndViewType:g,bookingViewType:C,setTodayDay:v,todayWeek:M}=Le(),{setSelectedNode:b}=Tt(A=>A),T=A=>{var z;(z=w==null?void 0:w.current)==null||z.updateFinishAt(A)},R=A=>{v(new Date(A))},k=A=>{M(new Date(A))};return E.useImperativeHandle(h,()=>({updateViewType:A=>y(A),updateWeekAndViewType:A=>p(A),updateTodayDayAndViewType:A=>g(A),updateSelectedNode:A=>{setTimeout(()=>{b(A)},10)},updateFinishAt:A=>T(A),changeLoading:A=>m(A),goToDay:A=>R(A),goToWeek:A=>k(A)})),E.useEffect(()=>{n(C)},[C]),x.jsx(XA,{isTimeInfoVisible:d,systemColor:f,children:x.jsx(YA,{...Rd,children:x.jsx(KA,{createBookingModal:t,viewModes:e,onHeaderDayClick:i,onTodayClick:a,onCardDropCallback:r,onCardResizeEnd:o,onDayChange:s,onSlotClick:c,onModalClose:l,bookings:u,children:x.jsx(hv,{ref:w,...di,children:x.jsx(sO,{children:x.jsx(eO,{isLoading:S})})})})})})},aO=e=>{const t=E.useRef(null),n=()=>{if(!(t!=null&&t.current))throw new Wg};return{getCalendar:()=>x.jsx(iO,{ref:t,...e}),updateViewType:f=>{var h;n(),(h=t.current)==null||h.updateViewType(f)},updateWeekAndViewType:f=>{var h;return n(),(h=t.current)==null?void 0:h.updateWeekAndViewType(f)},updateTodayDayAndViewType:f=>{var h;return n(),(h=t.current)==null?void 0:h.updateTodayDayAndViewType(f)},updateSelectedNode:f=>{var h;n(),(h=t.current)==null||h.updateSelectedNode(f)},updateFinishAt:f=>{var h;n(),(h=t.current)==null||h.updateFinishAt(f)},changeLoading:f=>{var h;n(),(h=t.current)==null||h.changeLoading(f)},goToDay:f=>{var h;n(),(h=t.current)==null||h.goToDay(f)},goToWeek:f=>{var h;n(),(h=t.current)==null||h.goToWeek(f)}}};exports.useCalendarInstance=aO;
|
|
170
|
+
`,b.getElementsByTagName("head")[0].appendChild(T)),b.body&&y(b.body,"react-draggable-transparent-selection")}function C(b){if(b)try{if(b.body&&M(b.body,"react-draggable-transparent-selection"),b.selection)b.selection.empty();else{const T=(b.defaultView||window).getSelection();T&&T.type!=="Caret"&&T.removeAllRanges()}}catch{}}function y(b,T){b.classList?b.classList.add(T):b.className.match(new RegExp("(?:^|\\s)".concat(T,"(?!\\S)")))||(b.className+=" ".concat(T))}function M(b,T){b.classList?b.classList.remove(T):b.className=b.className.replace(new RegExp("(?:^|\\s)".concat(T,"(?!\\S)"),"g"),"")}return be}var at={},od;function bg(){if(od)return at;od=1,Object.defineProperty(at,"__esModule",{value:!0}),at.canDragX=o,at.canDragY=s,at.createCoreData=a,at.createDraggableData=c,at.getBoundPosition=n,at.getControlPosition=i,at.snapToGrid=r;var e=xs(),t=Dc();function n(d,h,f){if(!d.props.bounds)return[h,f];let{bounds:S}=d.props;S=typeof S=="string"?S:l(S);const m=u(d);if(typeof S=="string"){const{ownerDocument:w}=m,g=w.defaultView;let p;if(S==="parent"?p=m.parentNode:p=w.querySelector(S),!(p instanceof g.HTMLElement))throw new Error('Bounds selector "'+S+'" could not find an element.');const v=p,C=g.getComputedStyle(m),y=g.getComputedStyle(v);S={left:-m.offsetLeft+(0,e.int)(y.paddingLeft)+(0,e.int)(C.marginLeft),top:-m.offsetTop+(0,e.int)(y.paddingTop)+(0,e.int)(C.marginTop),right:(0,t.innerWidth)(v)-(0,t.outerWidth)(m)-m.offsetLeft+(0,e.int)(y.paddingRight)-(0,e.int)(C.marginRight),bottom:(0,t.innerHeight)(v)-(0,t.outerHeight)(m)-m.offsetTop+(0,e.int)(y.paddingBottom)-(0,e.int)(C.marginBottom)}}return(0,e.isNum)(S.right)&&(h=Math.min(h,S.right)),(0,e.isNum)(S.bottom)&&(f=Math.min(f,S.bottom)),(0,e.isNum)(S.left)&&(h=Math.max(h,S.left)),(0,e.isNum)(S.top)&&(f=Math.max(f,S.top)),[h,f]}function r(d,h,f){const S=Math.round(h/d[0])*d[0],m=Math.round(f/d[1])*d[1];return[S,m]}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,h,f){const S=typeof h=="number"?(0,t.getTouch)(d,h):null;if(typeof h=="number"&&!S)return null;const m=u(f),w=f.props.offsetParent||m.offsetParent||m.ownerDocument.body;return(0,t.offsetXYFromParent)(S||d,w,f.props.scale)}function a(d,h,f){const S=!(0,e.isNum)(d.lastX),m=u(d);return S?{node:m,deltaX:0,deltaY:0,lastX:h,lastY:f,x:h,y:f}:{node:m,deltaX:h-d.lastX,deltaY:f-d.lastY,lastX:d.lastX,lastY:d.lastY,x:h,y:f}}function c(d,h){const f=d.props.scale;return{node:h.node,x:d.state.x+h.deltaX/f,y:d.state.y+h.deltaY/f,deltaX:h.deltaX/f,deltaY:h.deltaY/f,lastX:d.state.x,lastY:d.state.y}}function l(d){return{left:d.left,top:d.top,right:d.right,bottom:d.bottom}}function u(d){const h=d.findDOMNode();if(!h)throw new Error("<DraggableCore>: Unmounted during event!");return h}return at}var rr={},lo={},sd;function xg(){if(sd)return lo;sd=1,Object.defineProperty(lo,"__esModule",{value:!0}),lo.default=e;function e(){}return lo}var id;function GP(){if(id)return rr;id=1,Object.defineProperty(rr,"__esModule",{value:!0}),rr.default=void 0;var e=l(E),t=a(bs()),n=a(vt),r=Dc(),o=bg(),s=xs(),i=a(xg());function a(w){return w&&w.__esModule?w:{default:w}}function c(w){if(typeof WeakMap!="function")return null;var g=new WeakMap,p=new WeakMap;return(c=function(v){return v?p:g})(w)}function l(w,g){if(w&&w.__esModule)return w;if(w===null||typeof w!="object"&&typeof w!="function")return{default:w};var p=c(g);if(p&&p.has(w))return p.get(w);var v={},C=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var y in w)if(y!=="default"&&Object.prototype.hasOwnProperty.call(w,y)){var M=C?Object.getOwnPropertyDescriptor(w,y):null;M&&(M.get||M.set)?Object.defineProperty(v,y,M):v[y]=w[y]}return v.default=w,p&&p.set(w,v),v}function u(w,g,p){return g=d(g),g in w?Object.defineProperty(w,g,{value:p,enumerable:!0,configurable:!0,writable:!0}):w[g]=p,w}function d(w){var g=h(w,"string");return typeof g=="symbol"?g:String(g)}function h(w,g){if(typeof w!="object"||w===null)return w;var p=w[Symbol.toPrimitive];if(p!==void 0){var v=p.call(w,g);if(typeof v!="object")return v;throw new TypeError("@@toPrimitive must return a primitive value.")}return(g==="string"?String:Number)(w)}const f={touch:{start:"touchstart",move:"touchmove",stop:"touchend"},mouse:{start:"mousedown",move:"mousemove",stop:"mouseup"}};let S=f.mouse,m=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",g=>{if(this.props.onMouseDown(g),!this.props.allowAnyClick&&typeof g.button=="number"&&g.button!==0)return!1;const p=this.findDOMNode();if(!p||!p.ownerDocument||!p.ownerDocument.body)throw new Error("<DraggableCore> not mounted on DragStart!");const{ownerDocument:v}=p;if(this.props.disabled||!(g.target instanceof v.defaultView.Node)||this.props.handle&&!(0,r.matchesSelectorAndParentsTo)(g.target,this.props.handle,p)||this.props.cancel&&(0,r.matchesSelectorAndParentsTo)(g.target,this.props.cancel,p))return;g.type==="touchstart"&&g.preventDefault();const C=(0,r.getTouchIdentifier)(g);this.touchIdentifier=C;const y=(0,o.getControlPosition)(g,C,this);if(y==null)return;const{x:M,y:b}=y,T=(0,o.createCoreData)(this,M,b);(0,i.default)("DraggableCore: handleDragStart: %j",T),(0,i.default)("calling",this.props.onStart),!(this.props.onStart(g,T)===!1||this.mounted===!1)&&(this.props.enableUserSelectHack&&(0,r.addUserSelectStyles)(v),this.dragging=!0,this.lastX=M,this.lastY=b,(0,r.addEvent)(v,S.move,this.handleDrag),(0,r.addEvent)(v,S.stop,this.handleDragStop))}),u(this,"handleDrag",g=>{const p=(0,o.getControlPosition)(g,this.touchIdentifier,this);if(p==null)return;let{x:v,y:C}=p;if(Array.isArray(this.props.grid)){let b=v-this.lastX,T=C-this.lastY;if([b,T]=(0,o.snapToGrid)(this.props.grid,b,T),!b&&!T)return;v=this.lastX+b,C=this.lastY+T}const y=(0,o.createCoreData)(this,v,C);if((0,i.default)("DraggableCore: handleDrag: %j",y),this.props.onDrag(g,y)===!1||this.mounted===!1){try{this.handleDragStop(new MouseEvent("mouseup"))}catch{const T=document.createEvent("MouseEvents");T.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(T)}return}this.lastX=v,this.lastY=C}),u(this,"handleDragStop",g=>{if(!this.dragging)return;const p=(0,o.getControlPosition)(g,this.touchIdentifier,this);if(p==null)return;let{x:v,y:C}=p;if(Array.isArray(this.props.grid)){let T=v-this.lastX||0,R=C-this.lastY||0;[T,R]=(0,o.snapToGrid)(this.props.grid,T,R),v=this.lastX+T,C=this.lastY+R}const y=(0,o.createCoreData)(this,v,C);if(this.props.onStop(g,y)===!1||this.mounted===!1)return!1;const b=this.findDOMNode();b&&this.props.enableUserSelectHack&&(0,r.removeUserSelectStyles)(b.ownerDocument),(0,i.default)("DraggableCore: handleDragStop: %j",y),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,b&&((0,i.default)("DraggableCore: Removing handlers"),(0,r.removeEvent)(b.ownerDocument,S.move,this.handleDrag),(0,r.removeEvent)(b.ownerDocument,S.stop,this.handleDragStop))}),u(this,"onMouseDown",g=>(S=f.mouse,this.handleDragStart(g))),u(this,"onMouseUp",g=>(S=f.mouse,this.handleDragStop(g))),u(this,"onTouchStart",g=>(S=f.touch,this.handleDragStart(g))),u(this,"onTouchEnd",g=>(S=f.touch,this.handleDragStop(g)))}componentDidMount(){this.mounted=!0;const g=this.findDOMNode();g&&(0,r.addEvent)(g,f.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;const g=this.findDOMNode();if(g){const{ownerDocument:p}=g;(0,r.removeEvent)(p,f.mouse.move,this.handleDrag),(0,r.removeEvent)(p,f.touch.move,this.handleDrag),(0,r.removeEvent)(p,f.mouse.stop,this.handleDragStop),(0,r.removeEvent)(p,f.touch.stop,this.handleDragStop),(0,r.removeEvent)(g,f.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&(0,r.removeUserSelectStyles)(p)}}findDOMNode(){var g,p;return(g=this.props)!==null&&g!==void 0&&g.nodeRef?(p=this.props)===null||p===void 0||(p=p.nodeRef)===null||p===void 0?void 0:p.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 rr.default=m,u(m,"displayName","DraggableCore"),u(m,"propTypes",{allowAnyClick:t.default.bool,children:t.default.node.isRequired,disabled:t.default.bool,enableUserSelectHack:t.default.bool,offsetParent:function(w,g){if(w[g]&&w[g].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(m,"defaultProps",{allowAnyClick:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1}),rr}var ad;function qP(){return ad||(ad=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"DraggableCore",{enumerable:!0,get:function(){return c.default}}),e.default=void 0;var t=h(E),n=u(bs()),r=u(vt),o=u(YP),s=Dc(),i=bg(),a=xs(),c=u(GP()),l=u(xg());function u(p){return p&&p.__esModule?p:{default:p}}function d(p){if(typeof WeakMap!="function")return null;var v=new WeakMap,C=new WeakMap;return(d=function(y){return y?C:v})(p)}function h(p,v){if(p&&p.__esModule)return p;if(p===null||typeof p!="object"&&typeof p!="function")return{default:p};var C=d(v);if(C&&C.has(p))return C.get(p);var y={},M=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var b in p)if(b!=="default"&&Object.prototype.hasOwnProperty.call(p,b)){var T=M?Object.getOwnPropertyDescriptor(p,b):null;T&&(T.get||T.set)?Object.defineProperty(y,b,T):y[b]=p[b]}return y.default=p,C&&C.set(p,y),y}function f(){return f=Object.assign?Object.assign.bind():function(p){for(var v=1;v<arguments.length;v++){var C=arguments[v];for(var y in C)Object.prototype.hasOwnProperty.call(C,y)&&(p[y]=C[y])}return p},f.apply(this,arguments)}function S(p,v,C){return v=m(v),v in p?Object.defineProperty(p,v,{value:C,enumerable:!0,configurable:!0,writable:!0}):p[v]=C,p}function m(p){var v=w(p,"string");return typeof v=="symbol"?v:String(v)}function w(p,v){if(typeof p!="object"||p===null)return p;var C=p[Symbol.toPrimitive];if(C!==void 0){var y=C.call(p,v);if(typeof y!="object")return y;throw new TypeError("@@toPrimitive must return a primitive value.")}return(v==="string"?String:Number)(p)}class g extends t.Component{static getDerivedStateFromProps(v,C){let{position:y}=v,{prevPropsPosition:M}=C;return y&&(!M||y.x!==M.x||y.y!==M.y)?((0,l.default)("Draggable: getDerivedStateFromProps %j",{position:y,prevPropsPosition:M}),{x:y.x,y:y.y,prevPropsPosition:{...y}}):null}constructor(v){super(v),S(this,"onDragStart",(C,y)=>{if((0,l.default)("Draggable: onDragStart: %j",y),this.props.onStart(C,(0,i.createDraggableData)(this,y))===!1)return!1;this.setState({dragging:!0,dragged:!0})}),S(this,"onDrag",(C,y)=>{if(!this.state.dragging)return!1;(0,l.default)("Draggable: onDrag: %j",y);const M=(0,i.createDraggableData)(this,y),b={x:M.x,y:M.y,slackX:0,slackY:0};if(this.props.bounds){const{x:R,y:_}=b;b.x+=this.state.slackX,b.y+=this.state.slackY;const[O,z]=(0,i.getBoundPosition)(this,b.x,b.y);b.x=O,b.y=z,b.slackX=this.state.slackX+(R-b.x),b.slackY=this.state.slackY+(_-b.y),M.x=b.x,M.y=b.y,M.deltaX=b.x-this.state.x,M.deltaY=b.y-this.state.y}if(this.props.onDrag(C,M)===!1)return!1;this.setState(b)}),S(this,"onDragStop",(C,y)=>{if(!this.state.dragging||this.props.onStop(C,(0,i.createDraggableData)(this,y))===!1)return!1;(0,l.default)("Draggable: onDragStop: %j",y);const b={dragging:!1,slackX:0,slackY:0};if(!!this.props.position){const{x:R,y:_}=this.props.position;b.x=R,b.y=_}this.setState(b)}),this.state={dragging:!1,dragged:!1,x:v.position?v.position.x:v.defaultPosition.x,y:v.position?v.position.y:v.defaultPosition.y,prevPropsPosition:{...v.position},slackX:0,slackY:0,isElementSVG:!1},v.position&&!(v.onDrag||v.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 v,C;return(v=(C=this.props)===null||C===void 0||(C=C.nodeRef)===null||C===void 0?void 0:C.current)!==null&&v!==void 0?v:r.default.findDOMNode(this)}render(){const{axis:v,bounds:C,children:y,defaultPosition:M,defaultClassName:b,defaultClassNameDragging:T,defaultClassNameDragged:R,position:_,positionOffset:O,scale:z,...G}=this.props;let j={},F=null;const k=!!!_||this.state.dragging,P=_||M,I={x:(0,i.canDragX)(this)&&k?this.state.x:P.x,y:(0,i.canDragY)(this)&&k?this.state.y:P.y};this.state.isElementSVG?F=(0,s.createSVGTransform)(I,O):j=(0,s.createCSSTransform)(I,O);const A=(0,o.default)(y.props.className||"",b,{[T]:this.state.dragging,[R]:this.state.dragged});return t.createElement(c.default,f({},G,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),t.cloneElement(t.Children.only(y),{className:A,style:{...y.props.style,...j},transform:F}))}}e.default=g,S(g,"displayName","Draggable"),S(g,"propTypes",{...c.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}),S(g,"defaultProps",{...c.default.defaultProps,axis:"both",bounds:!1,defaultClassName:"react-draggable",defaultClassNameDragging:"react-draggable-dragging",defaultClassNameDragged:"react-draggable-dragged",defaultPosition:{x:0,y:0},scale:1})}(ei)),ei}var cd;function wg(){if(cd)return nr.exports;cd=1;const{default:e,DraggableCore:t}=qP();return nr.exports=e,nr.exports.default=e,nr.exports.DraggableCore=t,nr.exports}var uo={},ld;function XP(){if(ld)return uo;ld=1,uo.__esModule=!0,uo.cloneElement=a;var e=t(E);function t(c){return c&&c.__esModule?c:{default:c}}function n(c,l){var u=Object.keys(c);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(c);l&&(d=d.filter(function(h){return Object.getOwnPropertyDescriptor(c,h).enumerable})),u.push.apply(u,d)}return u}function r(c){for(var l=1;l<arguments.length;l++){var u=arguments[l]!=null?arguments[l]:{};l%2?n(Object(u),!0).forEach(function(d){o(c,d,u[d])}):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(u)):n(Object(u)).forEach(function(d){Object.defineProperty(c,d,Object.getOwnPropertyDescriptor(u,d))})}return c}function o(c,l,u){return l=s(l),l in c?Object.defineProperty(c,l,{value:u,enumerable:!0,configurable:!0,writable:!0}):c[l]=u,c}function s(c){var l=i(c,"string");return typeof l=="symbol"?l:String(l)}function i(c,l){if(typeof c!="object"||c===null)return c;var u=c[Symbol.toPrimitive];if(u!==void 0){var d=u.call(c,l);if(typeof d!="object")return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return(l==="string"?String:Number)(c)}function a(c,l){return l.style&&c.props.style&&(l.style=r(r({},c.props.style),l.style)),l.className&&c.props.className&&(l.className=c.props.className+" "+l.className),e.default.cloneElement(c,l)}return uo}var or={},ud;function Sg(){if(ud)return or;ud=1,or.__esModule=!0,or.resizableProps=void 0;var e=t(bs());wg();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 c;return(c=e.default.number).isRequired.apply(c,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 c;return(c=e.default.number).isRequired.apply(c,s)}return e.default.number.apply(e.default,s)}};return or.resizableProps=n,or}var dd;function Cg(){if(dd)return tr;dd=1,tr.__esModule=!0,tr.default=void 0;var e=i(E),t=wg(),n=XP(),r=Sg(),o=["children","className","draggableOpts","width","height","handle","handleSize","lockAspectRatio","axis","minConstraints","maxConstraints","onResize","onResizeStop","onResizeStart","resizeHandles","transformScale"];function s(g){if(typeof WeakMap!="function")return null;var p=new WeakMap,v=new WeakMap;return(s=function(y){return y?v:p})(g)}function i(g,p){if(g&&g.__esModule)return g;if(g===null||typeof g!="object"&&typeof g!="function")return{default:g};var v=s(p);if(v&&v.has(g))return v.get(g);var C={},y=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var M in g)if(M!=="default"&&Object.prototype.hasOwnProperty.call(g,M)){var b=y?Object.getOwnPropertyDescriptor(g,M):null;b&&(b.get||b.set)?Object.defineProperty(C,M,b):C[M]=g[M]}return C.default=g,v&&v.set(g,C),C}function a(){return a=Object.assign?Object.assign.bind():function(g){for(var p=1;p<arguments.length;p++){var v=arguments[p];for(var C in v)Object.prototype.hasOwnProperty.call(v,C)&&(g[C]=v[C])}return g},a.apply(this,arguments)}function c(g,p){if(g==null)return{};var v={},C=Object.keys(g),y,M;for(M=0;M<C.length;M++)y=C[M],!(p.indexOf(y)>=0)&&(v[y]=g[y]);return v}function l(g,p){var v=Object.keys(g);if(Object.getOwnPropertySymbols){var C=Object.getOwnPropertySymbols(g);p&&(C=C.filter(function(y){return Object.getOwnPropertyDescriptor(g,y).enumerable})),v.push.apply(v,C)}return v}function u(g){for(var p=1;p<arguments.length;p++){var v=arguments[p]!=null?arguments[p]:{};p%2?l(Object(v),!0).forEach(function(C){d(g,C,v[C])}):Object.getOwnPropertyDescriptors?Object.defineProperties(g,Object.getOwnPropertyDescriptors(v)):l(Object(v)).forEach(function(C){Object.defineProperty(g,C,Object.getOwnPropertyDescriptor(v,C))})}return g}function d(g,p,v){return p=h(p),p in g?Object.defineProperty(g,p,{value:v,enumerable:!0,configurable:!0,writable:!0}):g[p]=v,g}function h(g){var p=f(g,"string");return typeof p=="symbol"?p:String(p)}function f(g,p){if(typeof g!="object"||g===null)return g;var v=g[Symbol.toPrimitive];if(v!==void 0){var C=v.call(g,p);if(typeof C!="object")return C;throw new TypeError("@@toPrimitive must return a primitive value.")}return(p==="string"?String:Number)(g)}function S(g,p){g.prototype=Object.create(p.prototype),g.prototype.constructor=g,m(g,p)}function m(g,p){return m=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(C,y){return C.__proto__=y,C},m(g,p)}var w=function(g){S(p,g);function p(){for(var C,y=arguments.length,M=new Array(y),b=0;b<y;b++)M[b]=arguments[b];return C=g.call.apply(g,[this].concat(M))||this,C.handleRefs={},C.lastHandleRect=null,C.slack=null,C}var v=p.prototype;return v.componentWillUnmount=function(){this.resetData()},v.resetData=function(){this.lastHandleRect=this.slack=null},v.runConstraints=function(y,M){var b=this.props,T=b.minConstraints,R=b.maxConstraints,_=b.lockAspectRatio;if(!T&&!R&&!_)return[y,M];if(_){var O=this.props.width/this.props.height,z=y-this.props.width,G=M-this.props.height;Math.abs(z)>Math.abs(G*O)?M=y/O:y=M*O}var j=y,F=M,N=this.slack||[0,0],k=N[0],P=N[1];return y+=k,M+=P,T&&(y=Math.max(T[0],y),M=Math.max(T[1],M)),R&&(y=Math.min(R[0],y),M=Math.min(R[1],M)),this.slack=[k+(j-y),P+(F-M)],[y,M]},v.resizeHandler=function(y,M){var b=this;return function(T,R){var _=R.node,O=R.deltaX,z=R.deltaY;y==="onResizeStart"&&b.resetData();var G=(b.props.axis==="both"||b.props.axis==="x")&&M!=="n"&&M!=="s",j=(b.props.axis==="both"||b.props.axis==="y")&&M!=="e"&&M!=="w";if(!(!G&&!j)){var F=M[0],N=M[M.length-1],k=_.getBoundingClientRect();if(b.lastHandleRect!=null){if(N==="w"){var P=k.left-b.lastHandleRect.left;O+=P}if(F==="n"){var I=k.top-b.lastHandleRect.top;z+=I}}b.lastHandleRect=k,N==="w"&&(O=-O),F==="n"&&(z=-z);var A=b.props.width+(G?O/b.props.transformScale:0),V=b.props.height+(j?z/b.props.transformScale:0),W=b.runConstraints(A,V);A=W[0],V=W[1];var H=A!==b.props.width||V!==b.props.height,L=typeof b.props[y]=="function"?b.props[y]:null,Y=y==="onResize"&&!H;L&&!Y&&(T.persist==null||T.persist(),L(T,{node:_,size:{width:A,height:V},handle:M})),y==="onResizeStop"&&b.resetData()}}},v.renderResizeHandle=function(y,M){var b=this.props.handle;if(!b)return e.createElement("span",{className:"react-resizable-handle react-resizable-handle-"+y,ref:M});if(typeof b=="function")return b(y,M);var T=typeof b.type=="string",R=u({ref:M},T?{}:{handleAxis:y});return e.cloneElement(b,R)},v.render=function(){var y=this,M=this.props,b=M.children,T=M.className,R=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 _=M.resizeHandles;M.transformScale;var O=c(M,o);return(0,n.cloneElement)(b,u(u({},O),{},{className:(T?T+" ":"")+"react-resizable",children:[].concat(b.props.children,_.map(function(z){var G,j=(G=y.handleRefs[z])!=null?G:y.handleRefs[z]=e.createRef();return e.createElement(t.DraggableCore,a({},R,{nodeRef:j,key:"resizableHandle-"+z,onStop:y.resizeHandler("onResizeStop",z),onStart:y.resizeHandler("onResizeStart",z),onDrag:y.resizeHandler("onResize",z)}),y.renderResizeHandle(z,j))}))}))},p}(e.Component);return tr.default=w,w.propTypes=r.resizableProps,w.defaultProps={axis:"both",handleSize:[20,20],lockAspectRatio:!1,minConstraints:[20,20],maxConstraints:[1/0,1/0],resizeHandles:["se"],transformScale:1},tr}var sr={},fd;function ZP(){if(fd)return sr;fd=1,sr.__esModule=!0,sr.default=void 0;var e=a(E),t=s(bs()),n=s(Cg()),r=Sg(),o=["handle","handleSize","onResize","onResizeStart","onResizeStop","draggableOpts","minConstraints","maxConstraints","lockAspectRatio","axis","width","height","resizeHandles","style","transformScale"];function s(p){return p&&p.__esModule?p:{default:p}}function i(p){if(typeof WeakMap!="function")return null;var v=new WeakMap,C=new WeakMap;return(i=function(M){return M?C:v})(p)}function a(p,v){if(p&&p.__esModule)return p;if(p===null||typeof p!="object"&&typeof p!="function")return{default:p};var C=i(v);if(C&&C.has(p))return C.get(p);var y={},M=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var b in p)if(b!=="default"&&Object.prototype.hasOwnProperty.call(p,b)){var T=M?Object.getOwnPropertyDescriptor(p,b):null;T&&(T.get||T.set)?Object.defineProperty(y,b,T):y[b]=p[b]}return y.default=p,C&&C.set(p,y),y}function c(){return c=Object.assign?Object.assign.bind():function(p){for(var v=1;v<arguments.length;v++){var C=arguments[v];for(var y in C)Object.prototype.hasOwnProperty.call(C,y)&&(p[y]=C[y])}return p},c.apply(this,arguments)}function l(p,v){var C=Object.keys(p);if(Object.getOwnPropertySymbols){var y=Object.getOwnPropertySymbols(p);v&&(y=y.filter(function(M){return Object.getOwnPropertyDescriptor(p,M).enumerable})),C.push.apply(C,y)}return C}function u(p){for(var v=1;v<arguments.length;v++){var C=arguments[v]!=null?arguments[v]:{};v%2?l(Object(C),!0).forEach(function(y){d(p,y,C[y])}):Object.getOwnPropertyDescriptors?Object.defineProperties(p,Object.getOwnPropertyDescriptors(C)):l(Object(C)).forEach(function(y){Object.defineProperty(p,y,Object.getOwnPropertyDescriptor(C,y))})}return p}function d(p,v,C){return v=h(v),v in p?Object.defineProperty(p,v,{value:C,enumerable:!0,configurable:!0,writable:!0}):p[v]=C,p}function h(p){var v=f(p,"string");return typeof v=="symbol"?v:String(v)}function f(p,v){if(typeof p!="object"||p===null)return p;var C=p[Symbol.toPrimitive];if(C!==void 0){var y=C.call(p,v);if(typeof y!="object")return y;throw new TypeError("@@toPrimitive must return a primitive value.")}return(v==="string"?String:Number)(p)}function S(p,v){if(p==null)return{};var C={},y=Object.keys(p),M,b;for(b=0;b<y.length;b++)M=y[b],!(v.indexOf(M)>=0)&&(C[M]=p[M]);return C}function m(p,v){p.prototype=Object.create(v.prototype),p.prototype.constructor=p,w(p,v)}function w(p,v){return w=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(y,M){return y.__proto__=M,y},w(p,v)}var g=function(p){m(v,p);function v(){for(var y,M=arguments.length,b=new Array(M),T=0;T<M;T++)b[T]=arguments[T];return y=p.call.apply(p,[this].concat(b))||this,y.state={width:y.props.width,height:y.props.height,propsWidth:y.props.width,propsHeight:y.props.height},y.onResize=function(R,_){var O=_.size;y.props.onResize?(R.persist==null||R.persist(),y.setState(O,function(){return y.props.onResize&&y.props.onResize(R,_)})):y.setState(O)},y}v.getDerivedStateFromProps=function(M,b){return b.propsWidth!==M.width||b.propsHeight!==M.height?{width:M.width,height:M.height,propsWidth:M.width,propsHeight:M.height}:null};var C=v.prototype;return C.render=function(){var M=this.props,b=M.handle,T=M.handleSize;M.onResize;var R=M.onResizeStart,_=M.onResizeStop,O=M.draggableOpts,z=M.minConstraints,G=M.maxConstraints,j=M.lockAspectRatio,F=M.axis;M.width,M.height;var N=M.resizeHandles,k=M.style,P=M.transformScale,I=S(M,o);return e.createElement(n.default,{axis:F,draggableOpts:O,handle:b,handleSize:T,height:this.state.height,lockAspectRatio:j,maxConstraints:G,minConstraints:z,onResizeStart:R,onResize:this.onResize,onResizeStop:_,resizeHandles:N,transformScale:P,width:this.state.width},e.createElement("div",c({},I,{style:u(u({},k),{},{width:this.state.width+"px",height:this.state.height+"px"})})))},v}(e.Component);return sr.default=g,g.propTypes=u(u({},r.resizableProps),{},{children:t.default.element}),sr}var hd;function JP(){return hd||(hd=1,er.exports=function(){throw new Error("Don't instantiate Resizable directly! Use require('react-resizable').Resizable")},er.exports.Resizable=Cg().default,er.exports.ResizableBox=ZP().default),er.exports}var Tg=JP();const pd=({booking:e,slotData:t,customClasses:n,hoveringAdditionalCardId:r="",children:o,ref:s})=>{const[i,a]=E.useState(!1),c=Le(is(y=>y.bookingViewType)),{updateIsDragging:l,isDragging:u}=hn(y=>y),{attributes:d,listeners:h,setNodeRef:f,isDragging:S,transform:m}=ua({id:e.id,data:{type:"booking-slots",booking:e,slotData:t},disabled:e.disabledResize==="full"||e.disabledResize==="half"||e.startAt.getDate()!==e.finishAt.getDate()}),w=m?{transform:`translate3d(${m.x}px, ${m.y}px, 0)`}:void 0;_r({onDragStart:()=>g(),onDragAbort:()=>p(),onDragCancel:()=>p(),onDragEnd:()=>p()});const g=E.useCallback(()=>{l(!0)},[]),p=E.useCallback(()=>{l(!1)},[]),v=E.useMemo(()=>({cursor:u?"ns-resize":"pointer",width:c===se.DAY?"99%":"100%"}),[u,c]),C=(y,M)=>r!=null&&r.length?y===M:!1;if(E.useImperativeHandle(s,()=>({changeCurrentCardResize:()=>a(y=>!y)})),!S)return x.jsx("div",{ref:f,className:de("cardContent_render",(i||C(r,e.id))&&"cardContent_render_dragging",n),style:{...w,...v},...h,...d,children:o},e.id)};function QP(e,t){const n=e>new Date(t.startAt),r=e<new Date(t.finishAt);return n&&r}const eA={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)QP(e.startAt,o)&&r++;return r}},Ec=({bookingInit:e,slotData:t,heightStyle:n,topHeightIncrement:r,customClasses:o,bookingViewType:s,resizableParam:i,events:a,open:c=!0,lastCard:l,half:u,cardContentRef:d,cardsQuantity:h,cardIndex:f,hoveringAdditionalCardId:S,ref:m})=>{var H;const w=hn(is(L=>L.updateIsDragging)),{emptySlotNodes:g}=Tt(),{bookings:p,onCardResizeEnd:v}=Lt(),[C,y]=E.useState(""),M=E.useRef(null),b=E.useMemo(()=>s===se.DAY?{width:"99%"}:{width:"100%"},[s]),T=(L,Y)=>{var K;R("show-handle",!0),i!=null&&i.onResizeStart&&i.onResizeStart(L,Y),(K=M.current)==null||K.changeCurrentCardResize()},R=(L="",Y=!1)=>{y(L),w(Y)},_=(L,Y)=>{var K;(K=M.current)==null||K.changeCurrentCardResize(),R(),Y.handle.includes("n")&&v(Mi.resizeBookingNorthId(e)),Y.handle.includes("s")&&v(Mi.resizeBookingSouthId(e)),i!=null&&i.onResizeStop&&i.onResizeStop(L,Y)},O=E.useMemo(()=>eA.calculateOverlappingBookings(e,p),[e,p]),z=E.useMemo(()=>de(i==null?void 0:i.customClass,C,u&&O>0&&"",u?"":O>0&&"inner_cards_parent",l&&O&&u&&"inner_cards_parent_last_card_disable",l&&O&&"inner_cards_parent_last_card",l&&O===2&&"inner_cards_parent_last_card_layer_2",O===1&&!u&&"inner_cards_parent_1_layer",O===2&&"inner_cards_parent_2_layer",u&&O===3&&"inner_cards_parent_resizable_layer_3_half inner_cards_parent_3_layer_half",O===3&&"inner_cards_parent_resizable_layer_3 inner_cards_parent_3_layer"),[i,C,u,O,l]),G=L=>L===0?"8rem":"4rem",j=E.useMemo(()=>u&&f===0&&h===3||u&&f===1&&h===3?G(f):O===2?"0.8rem":l&&O===1?"0.2rem":l&&O?"1rem":O===1?"0.4rem":0,[u,l,O,f,h]),F=E.useMemo(()=>u&&f===0&&h===3&&!O?"0rem":u&&f===0&&h===3?"0.4rem":u&&f===1&&h===3?"5rem":l&&h===3?"9rem":l?"6.5rem":0,[u,l,f,O,h]),N=E.useMemo(()=>u&&h===3&&(u&&f===0||u&&f===1)||u&&l&&h===3||u&&l?{inset:`${r}rem ${j} ${n}rem ${F}`}:u&&h===3||u?{inset:`${r}rem 6.5rem ${n}rem ${j}`}:{inset:`${r||0}rem ${j} ${n}rem`},[u,O,n,r,f,h,j,F]),k=(L,Y)=>{const K=g.get(Y);K==null||K.hoveringAdditionalCard(L.id)},P=L=>{const Y=g.get(L);Y==null||Y.clearHoveringCard()},I=(L,Y)=>{({mouseenter:()=>k(e,L),mouseleave:()=>P(L)}[Y]||(()=>console.warn(`Unhandled event type: ${Y}`)))()},A=L=>{const Y=L.toDateString();return on({key:Y,time:ta})},V=L=>{const Y=Z.calculateDaysDifference(e.finishAt,e.startAt);if(Y===1){I(A(e.finishAt),L);return}const K=Z.buildFutureDateList(e,Y);for(const $ of K)I(A($),L)},W=L=>{const Y=L.type;if(e!=null&&e.nodes)for(const K of e.nodes)I(K,Y);V(Y)};if(E.useEffect(()=>()=>{a!=null&&a.onUnmount&&a.onUnmount()},[]),E.useImperativeHandle(d,()=>({changeCurrentCardResize:()=>{var L;(L=M.current)==null||L.changeCurrentCardResize()}})),!c&&!e.finishAt)return null;if((H=i==null?void 0:i.state)!=null&&H.height){const{state:L,onResize:Y,resizeHandle:K=["s","n"]}=i,$=()=>{switch(e==null?void 0:e.disabledResize){case"full":return[];case"half":return["s"];default:return K}};return x.jsx(Tg.Resizable,{className:de(z),height:L==null?void 0:L.height,width:L==null?void 0:L.width,onResize:Y,onResizeStart:T,onResizeStop:_,resizeHandles:$(),draggableOpts:{grid:[35,35]},handleSize:[20,20],maxConstraints:[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY],transformScale:1,children:x.jsx("div",{className:"card_content_core",style:{...N},onMouseEnter:W,onMouseLeave:W,onBlur:()=>{},children:x.jsx(pd,{ref:M,booking:e,slotData:t,layerCount:O,half:u,hoveringAdditionalCardId:S,children:x.jsx(Ri,{booking:e,slotData:t,events:{onClick:a==null?void 0:a.onClick}})},e.id)})})}return x.jsx("div",{ref:m,className:"card_content_core",style:{...b,...N},children:x.jsx(pd,{customClasses:o,booking:e,slotData:t,children:x.jsx(Ri,{booking:e,slotData:t,events:{onClick:a==null?void 0:a.onClick}})})})},md=({booking:e,slotData:t,cardsQuantity:n=1,cardIndex:r=0,lastCard:o=!1,half:s=!1,hoveringAdditionalCardId:i,ref:a})=>{const{bookingViewType:c}=Le(),[l,u]=E.useState({...e});E.useEffect(()=>{e&&u(e)},[e]);const[d,h]=E.useState(!1),f=E.useRef("left"),S=()=>{const M=t.day.split(":")[0].trim();if(c===se.DAY)f.current="top";else switch(M){case"Mon":case"Sun":f.current="right";break;default:f.current="left";break}h(!0)},m=async M=>{try{u(b=>({...b,finishAt:M}))}catch(b){console.log(b)}},w=async M=>{u(b=>({...b,startAt:M}))},g=async M=>{try{u(b=>({...b,finishAt:M}))}catch(b){console.log(b)}},{state:p,heightStyle:v,topHeightIncrement:C,onResize:y}=Am({booking:l,onAddTime:m,onAddStartTime:w,onSubTime:g,starter:!0});return E.useImperativeHandle(a,()=>({bookingId:e.id}),[e.id]),x.jsx(mg,{booking:l,onOpenChange:h,side:c===se.DAY?"top":"left",isEditingOpen:d,children:x.jsx(Ec,{resizableParam:{state:p,onResize:y,resizeHandle:["s","n"]},customClasses:"Draggable",bookingInit:l,bookingViewType:c,slotData:t,topHeightIncrement:C,heightStyle:v,events:{onClick:S},half:s,lastCard:o,cardsQuantity:n,cardIndex:r,hoveringAdditionalCardId:i})})},gd=({bookings:e,blockTimeString:t,slotData:n,hoveringAdditionalCardId:r})=>{if(!e||!(n!=null&&n.day)&&!(n!=null&&n.hour)||!t)return null;const o=E.useMemo(()=>e.filter(s=>Z.dateAndHourDateToString(new Date(s.startAt)).split(":")[1]===t),[e,t]);if(!(!o||!(o!=null&&o.length)))return o.length===1?x.jsx(md,{booking:o[0],slotData:n,hoveringAdditionalCardId:r}):x.jsx(x.Fragment,{children:o.map((s,i)=>x.jsx(md,{booking:s,half:!0,slotData:n,lastCard:o.length-1===i,cardsQuantity:o.length,cardIndex:i,hoveringAdditionalCardId:r},s.id))})},tA=e=>{const t=E.use(Nd);if(!t)throw new Error("useConfig must be used within a ConfigContext");return Wo(t,e)},nA=-Math.abs(1.98),rA={DOWN:"DOWN"},oA=({booking:e,onAddTime:t,onStartAtChange:n,onSubTime:r,starter:o=!1})=>{const[s,i]=E.useState({height:jt,width:jt}),[a,c]=E.useState(0),l=(b,T)=>{const R=Z.timeDiffInSeconds(b,T),_=Math.ceil(R/li);return-Math.abs((_-1)*2)},[u,d]=E.useState(o?l(e.finishAt,e.startAt):0),h=b=>b===-Math.abs(0)||b===0,f=async b=>{console.log("addTime"),console.log("direction",b);const T=g(e.finishAt,"add");d(R=>h(R)?nA:R-2),t&&t(T)},S=async()=>{const b=g(e.finishAt,"remove");d(T=>T+2),r&&r(b)},m=async()=>{const b=p(e.startAt,"remove");c(T=>T-2),n&&n(b)},w=async()=>{const b=p(e.startAt,"add");c(T=>T+2),n&&n(b)},g=(b,T)=>{const R=new Date(b),_=R.getMinutes();return T==="add"&&R.setMinutes(_+15),T==="remove"&&R.setMinutes(_-15),R},p=(b,T)=>{const R=new Date(b),_=R.getMinutes();return T==="add"&&R.setMinutes(_+15),T==="remove"&&R.setMinutes(_-15),R};return{state:s,setState:i,resetState:()=>{i({height:jt,width:jt})},resetHeightStyle:()=>{d(0)},heightStyle:u,topHeightIncrement:a,onResize:(b,{size:T})=>{b.stopPropagation(),b.preventDefault();const R=T.height;i(_=>(_.height<R&&(a!==0?w():f(rA.DOWN)),_.height>R&&(R<600?m():S()),{..._,height:R}))},updateHeightStyle:(b,T)=>{d(l(b,T))}}},sA=E.forwardRef(({slotData:e,events:{onClick:t,renderPreviewCard:n}},r)=>{const[o,s]=E.useState(!1),[i,a]=E.useState(e.time),[c,l]=E.useState(Z.addMinutesToHour(i,15)),{isDragging:u}=hn(k=>k),d=Le(k=>k.bookingViewType),{systemColor:h,isTimeInfoVisible:f}=tA(k=>k),[S,m]=E.useState(!1),[w,g]=E.useState(!1),p=E.useRef(null),v=w?{backgroundColor:"white",border:"none"}:{},C=E.useMemo(()=>({id:"dragging_booking_preview",startAt:Z.convertStringTimeToDateFormat(i),finishAt:Z.convertStringTimeToDateFormat(c)}),[c,i]),y=()=>{m(!0),g(!0),n()},M=()=>{m(!1),t(c,i)};E.useEffect(()=>{var k;S&&((k=p.current)==null||k.changeCurrentCardResize())},[S]);const{state:b,resetState:T,resetHeightStyle:R,heightStyle:_,onResize:O,updateHeightStyle:z,topHeightIncrement:G}=oA({booking:C,onAddTime:k=>{console.log("onAddTime date time",k),l(Z.dateTimeAsString(k))},onStartAtChange:k=>{console.log("onStartAtChange date time",k),a(Z.dateTimeAsString(k))},onSubTime:k=>{console.log("onSubTime date time",k),l(Z.dateTimeAsString(k))}}),j=()=>{},F=()=>{l(Z.addMinutesToHour(e.time,15))},N=()=>{g(!1),F(),T(),R()};if(E.useEffect(()=>{if(!c||!i)return;const k=Z.convertStringTimeToDateFormat(c),P=Z.convertStringTimeToDateFormat(e.time);Number.isNaN(k)||Number.isNaN(P)||!(k instanceof Date)||!(P instanceof Date)||z(k,P)},[c,i]),E.useImperativeHandle(r,()=>({show:()=>s(!0),hide:()=>s(!1),changeIsOpen:k=>s(k),reset:N}),[]),!!o)return x.jsx("div",{style:{...v,border:f&&!u?`1.5px solid ${h}`:"none"},className:de("timeInfo_core",v),children:x.jsx(Tg.Resizable,{className:"slot-resizable",height:b.height,width:b.width,onResizeStart:y,onResizeStop:M,onResize:O,resizeHandles:["se"],draggableOpts:{grid:[35,35]},handleSize:[30,30],maxConstraints:[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY],transformScale:1,children:w?x.jsx("div",{className:"timeInfo_core_dragging",children:x.jsx(Ec,{bookingInit:C,bookingViewType:d,slotData:{day:new Date().toISOString(),hour:"09:00"},topHeightIncrement:G,heightStyle:_,cardContentRef:p,resizableParam:{state:b,onResize:O,customClass:"show-handle"},events:{onUnmount:j}})}):x.jsx("div",{className:"timeInfo_core_timeParent",children:!u&&x.jsx("span",{className:"timeInfo_core_timeParent_time",style:{color:h,display:f?"initial":"none"},children:e.time})})})})}),fo=({slotData:e,blockTimeString:t,dayHour:n,slotPosition:r,disabledCss:o,events:s,bookings:i,children:a,ref:c})=>{const{isDragging:l,updateIsDragging:u}=hn(J=>J),{emptySlotNodes:d,setSelectedNode:h}=Tt(),{onModalClose:f,onSlotClick:S}=Lt(),{startAt:m,finishAt:w,updateDate:g,updateStartAt:p,updateFinishAtWithOffset:v}=kd(J=>J),C=Le(J=>J.bookingViewType),[y,M]=E.useState(!1),[b,T]=E.useState(!1),[R,_]=E.useState([]),[O,z]=E.useState(""),G=E.useRef(null),j=E.useRef(null),F=E.useRef(null),N=J=>{_(ce=>ce.filter(ye=>ye.id!==J.id))},k=(J,ce,ye=!1)=>{const Ve=new Date(J.finishAt);Ve.setHours(24,0);const He=[{id:J.id,finishAt:ye?Ve:J.finishAt,overflow:!0,startAt:Mi.resetToFirstHourNextDay(J),disabledResize:ye?"full":"half",nodes:ce}];_(He)},P=()=>F.current,I=()=>{var J;(J=F.current)==null||J.isModalOpen()},A=()=>{var J;(J=P())==null||J.showCreationModal()},V=()=>{var J;(J=j.current)==null||J.show()},W=()=>{var J;(J=j.current)==null||J.hide()},H=J=>{var ce;(ce=j.current)==null||ce.changeIsOpen(J)},L=E.useMemo(()=>({id:"dragging_booking_preview",startAt:Z.convertStringTimeToDateFormat(m),finishAt:Z.convertStringTimeToDateFormat(w)}),[w,m]),{updateHeightStyle:Y,heightStyle:K}=Am({booking:L}),$=(J,ce)=>!ce||!(ce!=null&&ce.length)?!1:!!ce.find(ye=>Z.dateTimeAsString(ye.startAt)===J),q=E.useCallback(()=>{if($(e.time,i)||l||I()||y)return;s.onMouseEnterEvent()===r&&V()},[r,l,y,s,R,i]),X=J=>{var Ve,He;console.log("onCloseCreationModal"),(Ve=j.current)==null||Ve.reset();const ce=on(e),ye=d==null?void 0:d.get(ce);ye&&ye.closeEvent(),f==null||f(),J==null||J.stopPropagation(),J==null||J.preventDefault(),(He=P())==null||He.closeModal()},U=J=>{J||X(),M(J),H(J)},ne=E.useCallback((J,ce)=>{if(l&&!J)return;u(!1);const{time:ye,key:Ve}=e,He=on({key:Ve,time:ce||ye}),Kn=d==null?void 0:d.get(He);h(He),Kn&&Kn.showEvent(ce||ye),g(Ve);const Ss=v(J||ye,J?0:15);S({slotData:e,finishTime:Ss}),A()},[e,d,l,S,v]),B=()=>{l||I()||W()},ie=o.length||b?o:"hovering_slotTrigger_core",pe=E.useCallback(()=>{const{time:J,key:ce}=e;u(!0),T(!0),g(ce),p(J),v(J)},[v,e,g,u,p]),Oe=()=>{A()},Ee=E.useCallback(()=>{T(!1)},[]),ot=()=>{setTimeout(()=>{W(),A(),M(!0)},0)};return E.useEffect(()=>{l?document.body.style.cursor="ns-resize":document.body.style.cursor="default"},[l]),E.useEffect(()=>{if(!w||!m)return;const J=Z.convertStringTimeToDateFormat(w),ce=Z.convertStringTimeToDateFormat(m);Number.isNaN(J)||Number.isNaN(ce)||!(J instanceof Date)||!(ce instanceof Date)||Y(J,ce)},[w,m]),E.useEffect(()=>{if(!y){W();return}G!=null&&G.current&&G.current.scrollIntoView({behavior:"smooth",block:"center"})},[y]),E.useEffect(()=>{i!=null&&i.length&&W(),b&&V()},[i,b]),E.useEffect(()=>{b&&V()},[b]),E.useImperativeHandle(c,()=>({showEvent:J=>{p(J),ot()},closeEvent:()=>{var J;(J=P())==null||J.closeModal(),M(!1),W(),Ee()},onOpenCloseChange:J=>{H(J),M(J),Ee()},addAdditionalBooking:k,removeFromAdditionalBooking:N,hoveringAdditionalCard:J=>{z(J)},clearHoveringCard:()=>{z("")}})),x.jsxs(x.Fragment,{children:[x.jsxs("div",{ref:e.ref,style:{borderBottom:r==="fourth"?"1px solid #8080807a":"",...e.style},className:de("slotTrigger_core",C===se.DAY&&"slotTrigger_core_day",ie),onMouseOver:q,onMouseLeave:B,onFocus:()=>{},children:[x.jsx(sA,{ref:j,slotData:e,events:{onClick:ne,openOptions:Oe,renderPreviewCard:pe,resetPrevView:Ee}}),a,y&&x.jsx(Ec,{ref:G,bookingInit:L,bookingViewType:C,slotData:{day:new Date().toISOString(),hour:"09:00"},hoveringAdditionalCardId:O,heightStyle:K}),x.jsx(gd,{hoveringAdditionalCardId:O,bookings:R,blockTimeString:"00",slotData:n}),x.jsx(gd,{hoveringAdditionalCardId:O,bookings:i,blockTimeString:t,slotData:n})]},e.key),x.jsx(Jh,{ref:F,onClose:X,onOpenChange:U,buttonTrigger:x.jsx("div",{},e.key),side:C===se.DAY?"top":"right"})]})};var iA="Separator",vd="horizontal",aA=["horizontal","vertical"],Dg=D.forwardRef((e,t)=>{const{decorative:n,orientation:r=vd,...o}=e,s=cA(r)?r:vd,a=n?{role:"none"}:{"aria-orientation":s==="vertical"?s:void 0,role:"separator"};return x.jsx(ae.div,{"data-orientation":s,...a,...o,ref:t})});Dg.displayName=iA;function cA(e){return aA.includes(e)}var lA=Dg;function uA({className:e,orientation:t="horizontal",decorative:n=!0,...r}){return x.jsx(lA,{"data-slot":"separator-root",decorative:n,orientation:t,className:de("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 dA=fa("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 fA({className:e,variant:t,...n}){return x.jsx("div",{className:de(dA({variant:t}),e),...n})}const hA=({dateToRender:e,isFirstDay:t})=>x.jsx("div",{style:{left:t?"3px":"10px"},className:"first_day_slot",children:x.jsx("span",{children:x.jsx(fA,{children:e})})});class pA{constructor(){Xt(this,"positionBasedOnSeconds",t=>{const[,n]=t.split(":");if(!t.length)return-3;const r=Number(n);return this.normalizingMinutes(r)});Xt(this,"normalizingMinutes",t=>t>=0&&t<=15?t*2:t>15&&t<30?(t-15)*2:t>=30&&t<=59?t-30:-3);Xt(this,"isInitialMinute",t=>t>=0&&t<=8);Xt(this,"isSameHour",(t,n)=>n.split(":")[0]===t)}}class mA{constructor(){Xt(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=Z.roundMinutes(n.getMinutes());i.setHours(n.getHours(),a,0,0);const c=Z.minuteDifference(s,i);return c>30||c<-30});Xt(this,"normalizeDateNow",t=>{const n=t.getHours(),r=Z.roundMinutes(t.getMinutes());return`${n.toString().padStart(2,"0")}:${r.toString().padStart(2,"0")}`})}}const ho=({color:e="#000",isFirstDay:t,slotData:n})=>{const{timesRendered:r,bookingViewType:o}=Le(),[s,i]=E.useState(""),[a,c]=E.useState(!1),[l,u]=E.useState(!1),d=E.useMemo(()=>{const p=new Date,v=new Date(n.key);return v.getDay()===p.getDay()&&v.getDate()===p.getDate()},[n.key]),h=p=>{i(p)},f=()=>{c(!0)},S=()=>{c(!1)},m=E.useMemo(()=>new pA().positionBasedOnSeconds(s),[n.time,s,r]),w=E.useMemo(()=>t?"101%":o===se.DAY?"102%":"100%",[t,o]),g=E.useMemo(()=>d?{top:`${m-2}px`,left:t?"-1px":"-3px",width:"101%"}:{top:`${m-1}px`,left:t?"-1px":"0px",width:w},[d,t,w,m]);if(E.useEffect(()=>{const p=n.time,v=new mA,C=()=>{const M=new Date,b=v.normalizeDateNow(M),T=Z.dateAndHourDateToString(M);s!==T&&h(T),u(b===p)};let y;return v.is15MinLess(p)||(y=setInterval(()=>C(),1e3)),()=>clearInterval(y)},[n.time,s]),!!l)return x.jsxs("div",{style:{...g},className:de("timeIndicator_today",d&&w,d&&"timeIndicator_today_circle"),onMouseEnter:f,onMouseOut:S,onBlur:()=>{},children:[x.jsx(uA,{className:"focus-effect",style:{height:d?"4px":"2px",backgroundColor:e}}),a&&x.jsx(hA,{isFirstDay:t,dateToRender:s})]})},yd=({bookings:e,first:t,second:n,third:r,fourth:o,disabledCss:s,firstDay:i,dayHour:a})=>{const{setEmptySlotNode:c,emptySlotNodes:l}=Tt(),u=E.useCallback((m,w)=>{if(!m)return;const g=on(w);l.get(g)||c(m,w)},[c,l]),d=(m,w)=>{const g=m.toDateString();return on({key:g,time:w?Z.dateTimeAsString(w):ta})},h=E.useCallback(m=>{const w=d(m);return l.get(w)},[l]),f=(m,w,g)=>{const p=Z.buildFutureDateList(m,w);for(let v=0;v<p.length;v++){const C=h(p[v]);if(!C)return;C.addAdditionalBooking(m,g,v!==p.length-1)}},S=E.useCallback(()=>{if(e!=null&&e.length)for(const m of e){const w=Z.calculateDaysDifference(m.finishAt,m.startAt),p=Z.buildFutureDateList(m,w+1,0).map((v,C)=>d(v,C===0?m.startAt:void 0)).filter(v=>v!==void 0);if(w===1){const v=h(m.finishAt);if(!v)return;v.addAdditionalBooking(m,p);return}f(m,w,p)}},[e,h,f]);return E.useEffect(()=>{e!=null&&e.length&&S()},[e,l,S]),x.jsxs(x.Fragment,{children:[x.jsx(fo,{ref:m=>u(m,{key:t.key,time:t.time}),slotData:t,disabledCss:s,events:{onMouseEnterEvent:()=>"first"},slotPosition:"first",dayHour:a,bookings:e,blockTimeString:"00",children:x.jsx(ho,{isFirstDay:i,slotData:t})}),x.jsx(fo,{ref:m=>u(m,{key:n.key,time:n.time}),slotData:n,disabledCss:s,events:{onMouseEnterEvent:()=>"second"},slotPosition:"second",dayHour:a,bookings:e,blockTimeString:"15",children:x.jsx(ho,{isFirstDay:i,slotData:n})}),x.jsx(fo,{ref:m=>u(m,{key:r.key,time:r.time}),slotData:r,disabledCss:s,events:{onMouseEnterEvent:()=>"third"},slotPosition:"third",dayHour:a,bookings:e,blockTimeString:"30",children:x.jsx(ho,{isFirstDay:i,slotData:r})}),x.jsx(fo,{ref:m=>u(m,{key:o.key,time:o.time}),slotData:o,disabledCss:s,events:{onMouseEnterEvent:()=>"fourth"},slotPosition:"fourth",dayHour:a,bookings:e,blockTimeString:"45",children:x.jsx(ho,{isFirstDay:i,slotData:o})})]})},gA=E.memo(({firstDay:e,booking:t,dayHour:n,disabledCss:r,firstBlockTimeData:o,secondBlockTimeData:s,thirdBlockTimeData:i,fourthBlockTimeData:a})=>{const{day:c,hour:l}=n,u=E.useMemo(()=>t.filter(d=>{const h=Z.dateAndHourDateToString(d.startAt),f=new Date(d.startAt).getDate(),S=new Date(c).getDate(),m=l.split(":")[0];return h.split(":")[0]===m&&f===S}),[t,n]);return u.length?x.jsx(yd,{dayHour:n,bookings:u,first:o,second:s,third:i,fourth:a,disabledCss:r,firstDay:e}):x.jsx(yd,{dayHour:n,first:o,second:s,third:i,fourth:a,disabledCss:r,firstDay:e})}),vA=({dayHour:e,firstDay:t,bookingBulk:n})=>{const r=E.useRef(""),o=xc(C=>C.updateStartAt),s=E.useMemo(()=>Z.addMinuteToHour(e.hour,15),[e.hour]),i=E.useMemo(()=>Z.addMinuteToHour(e.hour,30),[e.hour]),a=E.useMemo(()=>Z.addMinuteToHour(e.hour,45),[e.hour]),{isOver:c,setNodeRef:l}=qr({id:`${Z.newDateKey(e.day,e.hour)}`,data:{accepts:["booking-slots"]}}),{isOver:u,setNodeRef:d}=qr({id:`${Z.newDateKey(e.day,s)}`,data:{accepts:["booking-slots"]}}),{isOver:h,setNodeRef:f}=qr({id:`${Z.newDateKey(e.day,i)}`,data:{accepts:["booking-slots"]}}),{isOver:S,setNodeRef:m}=qr({id:`${Z.newDateKey(e.day,a)}`,data:{accepts:["booking-slots"]}});E.useEffect(()=>{c&&o(`${Z.newDateKey(e.day,e.hour)}`),u&&o(`${Z.newDateKey(e.day,s)}`),h&&o(`${Z.newDateKey(e.day,i)}`),S&&o(`${Z.newDateKey(e.day,a)}`)},[c,u,h,S]);const w=E.useMemo(()=>({ref:l,style:{backgroundColor:c?"#0066ff":""},key:Z.newDateKey(e.day,e.hour),time:e.hour}),[e.day,c,e.hour,l]),g=E.useMemo(()=>({ref:d,style:{backgroundColor:u?"#0066ff":""},key:Z.newDateKey(e.day,s),time:s}),[e.day,u,s,d]),p=E.useMemo(()=>({ref:f,style:{backgroundColor:h?"#0066ff":""},key:Z.newDateKey(e.day,i),time:i}),[e.day,h,i,f]),v=E.useMemo(()=>({ref:m,style:{backgroundColor:S?"#0066ff":""},key:Z.newDateKey(e.day,a),time:a}),[e.day,a,S,m]);return x.jsx("td",{className:"slot",children:x.jsx(gA,{booking:n,dayHour:e,firstDay:t,disabledCss:r.current,firstBlockTimeData:w,secondBlockTimeData:g,thirdBlockTimeData:p,fourthBlockTimeData:v})},`${e.day}-${e.hour}-slot`)},yA=({hour:e,ref:t})=>{const n="Set lunch interval",r="Remove lunch interval",o="Hour options",s=E.useRef(null),i="border-solid hover:border-b-2 hover:border-b-purple-600 border-b-white",a=()=>{s!=null&&s.current&&s.current.setAttribute("class",de("activateVisibilityTime",i))};return E.useImperativeHandle(t,()=>({setActivateHour:a})),x.jsxs(Fa,{children:[x.jsx($a,{children:x.jsx("span",{ref:s,className:de(i),children:e})}),x.jsxs(Ba,{children:[x.jsx(EC,{children:o}),x.jsx(MC,{}),x.jsx(Ml,{children:n}),x.jsx(Ml,{children:r})]})]})},bA=()=>{const{hours:e,daysOfWeek:t,bookingViewType:n,bookingBulkData:r,addTimesRendered:o}=Le(is(C=>({addTimesRendered:C.addTimesRendered,bookingBulkData:C.bookingBulkData,bookingViewType:C.bookingViewType,daysOfWeek:C.daysOfWeek,hours:C.hours}))),{selectedNode:s,emptySlotNodes:i}=Tt(),{finishAt:a,updateFinishAtWithOffset:c}=kd(C=>C),{booking:l,slotData:u,startAt:d}=xc(C=>C),[h]=E.useState({startAt:"12:00",finishAt:"12:30"}),f=E.useRef(null),S=E.useCallback((C,y)=>{C&&o(C,y)},[o]),m=E.useMemo(()=>n===se.DAY?{maxWidth:"5rem",padding:0,minWidth:"4rem"}:{},[n]),w=E.useMemo(()=>({borderLeft:"none",backgroundColor:"white"}),[]),g=E.useMemo(()=>s.split(";")[1],[s]),p=E.useMemo(()=>{if(l&&u)return x.jsx(Ri,{ref:f,style:{borderRadius:"0.25rem"},booking:l,slotData:u})},[l,u]);return E.useEffect(()=>{if(s){const C=i.get(s);C==null||C.showEvent(g)}},[s,i]),E.useEffect(()=>{g===a&&c(g)},[s,a]),E.useEffect(()=>{if(l&&d&&(f!=null&&f.current)){const C=Z.bookingTimeRange(l,d);f.current.updateBooking(C)}},[l,d]),E.useMemo(()=>{const C=y=>y===0;return x.jsxs(x.Fragment,{children:[x.jsx("tbody",{children:e.map(y=>x.jsxs("tr",{children:[x.jsx(NC,{style:{...w,...m},className:"time-col",children:x.jsx("div",{className:"calendarCore_actions",children:x.jsx(yA,{ref:M=>S(M,y),hour:y})})},`${y}-hour`),t.map((M,b)=>x.jsx(vA,{dayHour:{day:String(M),hour:y},lunchTimeBlock:h,firstDay:C(b),bookingBulk:r.booking},`${M}-${y}-slot-content`))]},`${y}-content`))}),x.jsx(wR,{children:p})]})},[m,e,w,r.booking,S,n,t,t.length,p])},xA=({children:e})=>{const{resetSelectedNode:t,resetNodes:n}=Tt(o=>o),r=Le(o=>o.bookingViewType);switch(E.useEffect(()=>{(r===se.DAY||r===se.WEEK)&&(t(),n())},[r,n,t]),r){case se.DAY:case se.WEEK:return e;default:return null}},wA={id:"user-123",profile:{id:"profile-123",name:"Diego",email:"jane.smith@example.com"},createdAt:new Date,updatedAt:new Date},bd={distance:5},SA=()=>{const{bookings:e}=Lt(),t=Pv(Vc(Zd,{activationConstraint:bd}),Vc(Jd,{activationConstraint:bd})),{setBookingBulkData:n,optimisticCardUpdate:r}=Le(),{onCardDropCallback:o}=Lt(),{emptySlotNodes:s}=Tt(),{updateBooking:i,updateSlotData:a}=xc(f=>f),c=E.useCallback(f=>{const{active:S}=f;S.data.current&&(i(S.data.current.booking),a(S.data.current.slotData)),S.id},[i,a]),l=E.useCallback((f,S)=>{const m=on({key:S.toDateString(),time:ta}),w=s.get(m);if(!w){console.warn("SlotNode not found:",m);return}w.removeFromAdditionalBooking(f)},[s]),u=f=>{const S=Z.calculateDaysDifference(f.finishAt,f.startAt),m=Z.buildFutureDateList(f,S);for(const w of m)l(f,w)},d=async(f,S,m)=>{try{const{startAt:w,finishAt:g}=Z.bookingTimeRange(f,S);r(f,w,g,m),await o(f,S,m,{id:f.id,startAt:w,finishAt:g}),u(f)}catch(w){console.warn(w)}},h=f=>{const{over:S,active:m}=f;if(S&&m){const w=S.data.current,g=m.data.current;if(g&&w&&w.accepts.includes(g.type)&&g.booking.id&&S.id){const p=e.find(v=>v.id===g.booking.id);if(!p)return;d(p,String(S.id),g.slotData),a(null),i(null)}}};return E.useEffect(()=>{n({user:wA,booking:e})},[e,n]),x.jsx("div",{className:"calendar-wrapper",children:x.jsx(_C,{children:x.jsx(xA,{children:x.jsx(la,{onDragEnd:h,onDragStart:c,sensors:t,children:x.jsx(bA,{})})})})})},CA=({handleWeekChange:e})=>x.jsxs("div",{className:"header_day_actions",children:[x.jsx(an,{className:"header_day_actions_button",variant:"ghost",size:"lg",onClick:()=>e("previous"),children:x.jsx(eb,{className:"header_day_actions_button_icon"})}),x.jsx(an,{className:"header_day_actions_button",variant:"ghost",size:"lg",onClick:()=>e("next"),children:x.jsx(nb,{className:"header_day_actions_button_icon"})})]}),TA=({onClick:e})=>x.jsx(Ea,{content:"Today",children:x.jsx(an,{variant:"ghost",onClick:e,children:x.jsx(gb,{style:{paddingTop:"0.8px"}})})}),DA=({code:e})=>x.jsx("p",{className:"text-sm text-muted-foreground",children:x.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:[x.jsx("span",{className:"text-xs",children:"⌘"}),e]})}),EA={[se.DAY]:x.jsx(ub,{width:"90%"}),[se.WEEK]:x.jsx(cb,{width:"90%"}),[se.TABLE]:x.jsx(Xy,{width:"90%"}),[se.MONTH]:x.jsx(fb,{width:"90%"})},xd=()=>{const{bookingViewType:e}=Le(),{onViewTypeChange:t}=Rd(),{viewModes:n}=Lt(),r=E.useCallback(a=>a===e?"custom":"outline",[e]),o=E.useCallback(a=>{a!==e&&t(a)},[t]),s=E.useMemo(()=>n.map(a=>({variant:r(a),icon:EA[a],events:c=>o(c),label:a})),[n,o,r]),i=E.useMemo(()=>{const a=s.find(c=>c.label===e);if(a)return a.icon},[e,s]);return x.jsxs(Fa,{children:[x.jsx($a,{children:x.jsx(Ea,{content:"Calendar Modes",children:x.jsx(an,{variant:"ghost",asChild:!0,children:i||x.jsx(Gy,{className:"w-full h-full"})})})}),x.jsx(Ba,{children:s.map(a=>x.jsxs(DC,{checked:a.label===e,onCheckedChange:()=>a.events(a.label),className:"flex flex-row justify-between gap-6",children:[x.jsxs("div",{className:"flex flex-row gap-4",children:[a.icon,x.jsx("div",{children:IC.capitalize(a.label)})]}),x.jsx(DA,{code:"o"})]},a.label))})]})},MA=566,RA=()=>{const{todayWeek:e,bookingViewType:t,setTodayDay:n,nextWeek:r,previousWeek:o,setDays:s}=Le(),{resetSelectedNode:i,resetNodes:a}=Tt(y=>y),{onTodayClick:c,onDayChange:l}=Lt(),{fullYear:u,monthMessage:d}=Ad(y=>y),[h,f]=E.useState(!1),S=()=>{const y=new Date;switch(c(y),t){case se.TABLE:case se.DAY:{n(y);break}default:{e();break}}},m=()=>s(1),w=()=>s(-1),g=y=>y==="next"?r():o(),p=y=>y==="next"?m():w(),v=y=>{switch(a(),i(),t){case se.TABLE:case se.DAY:{const M=p(y);l(M,y);break}case se.WEEK:{const M=g(y),{firstDayOfWeek:b,lastDayOfWeek:T}=Z.firstAndLastWeekDays(M);l([b,T],y);break}}};E.useEffect(()=>{e()},[e]),E.useEffect(()=>{const y=()=>{if(typeof window>"u")return!1;window.innerWidth<=MA?f(!0):f(!1)};return y(),window.addEventListener("resize",y),()=>window.removeEventListener("resize",y)},[]);const C=x.jsxs("div",{className:"header_actions",children:[x.jsx(CA,{handleWeekChange:v}),x.jsx(TA,{onClick:S})]});return x.jsx(x.Fragment,{children:h?x.jsxs("div",{className:"headerCalendar_mobile",children:[x.jsx("div",{className:"headerCalendar_mobile_month",children:x.jsxs("span",{className:"headerCalendar_mobile_month_span",children:[d," ",u]})}),x.jsxs("div",{className:"headerCalendar_mobile_actions",children:[C,x.jsx(xd,{})]})]}):x.jsxs("div",{className:"headerCalendar",children:[x.jsx("div",{className:"headerCalendar_actions",children:C}),x.jsx("div",{className:"headerCalendar_month",children:x.jsxs("span",{className:"headerCalendar_month_span",children:[d," ",u]})}),x.jsx(xd,{})]})})},PA=({viewModes:e,createBookingModal:t,onChangeViewType:n,onCardDropCallback:r,onCardResizeEnd:o,onDayChange:s,onHeaderDayClick:i,onTodayClick:a,onSlotClick:c,onModalClose:l,bookings:u,isTimeInfoVisible:d,systemColor:h,ref:f})=>{const[S,m]=E.useState(!1),w=E.useRef(null),{setBookingViewType:g,setWeekAndViewType:p,setTodayDayAndViewType:v,bookingViewType:C,setTodayDay:y,todayWeek:M}=Le(),{setSelectedNode:b}=Tt(O=>O),T=O=>{var z;(z=w==null?void 0:w.current)==null||z.updateFinishAt(O)},R=O=>{y(new Date(O))},_=O=>{M(new Date(O))};return E.useImperativeHandle(f,()=>({updateViewType:O=>g(O),updateWeekAndViewType:O=>p(O),updateTodayDayAndViewType:O=>v(O),updateSelectedNode:O=>{setTimeout(()=>{b(O)},10)},updateFinishAt:O=>T(O),changeLoading:O=>m(O),goToDay:O=>R(O),goToWeek:O=>_(O)})),E.useEffect(()=>{n(C)},[C]),x.jsx(pv,{isTimeInfoVisible:d,systemColor:h,children:x.jsx(uv,{..._d,children:x.jsx(dv,{createBookingModal:t,viewModes:e,onHeaderDayClick:i,onTodayClick:a,onCardDropCallback:r,onCardResizeEnd:o,onDayChange:s,onSlotClick:c,onModalClose:l,bookings:u,children:x.jsx(cv,{ref:w,...di,children:x.jsxs(gv,{...Id,children:[x.jsx(RA,{}),x.jsx(SA,{}),x.jsx(Fg,{color:"#000000aa",loading:S,cssOverride:{position:"absolute",top:"50%",left:"50%",transform:"translate('-50%', '-50%')",zIndex:100},size:15,"aria-label":"Loading Spinner","data-testid":"GridLoader"})]})})})})})},AA=e=>{const t=E.useRef(null),n=()=>{if(!(t!=null&&t.current))throw new Ng};return{getCalendar:()=>x.jsx(PA,{ref:t,...e}),updateViewType:h=>{var f;n(),(f=t.current)==null||f.updateViewType(h)},updateWeekAndViewType:h=>{var f;return n(),(f=t.current)==null?void 0:f.updateWeekAndViewType(h)},updateTodayDayAndViewType:h=>{var f;return n(),(f=t.current)==null?void 0:f.updateTodayDayAndViewType(h)},updateSelectedNode:h=>{var f;n(),(f=t.current)==null||f.updateSelectedNode(h)},updateFinishAt:h=>{var f;n(),(f=t.current)==null||f.updateFinishAt(h)},changeLoading:h=>{var f;n(),(f=t.current)==null||f.changeLoading(h)},goToDay:h=>{var f;n(),(f=t.current)==null||f.goToDay(h)},goToWeek:h=>{var f;n(),(f=t.current)==null||f.goToWeek(h)}}};exports.useCalendarInstance=AA;
|