sonamu 0.10.4 → 0.10.5
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.
|
@@ -44,7 +44,7 @@ If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHid
|
|
|
44
44
|
|
|
45
45
|
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return m.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},Ni=`DialogDescriptionWarning`,Pi=({contentRef:e,descriptionId:t})=>{let n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${ji(Ni).contentName}}.`;return m.useEffect(()=>{let r=e.current?.getAttribute(`aria-describedby`);t&&r&&(document.getElementById(t)||console.warn(n))},[n,e,t]),null},Fi=oi,Ii=fi,Li=mi,Ri=vi,zi=Ci,Bi=Ti,Vi=Di,Hi=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=Kt(`Primitive.${t}`),r=m.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,z.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),Ui=s((e=>{var t=p();function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useState,a=t.useEffect,o=t.useLayoutEffect,s=t.useDebugValue;function c(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),c=r[0].inst,u=r[1];return o(function(){c.value=n,c.getSnapshot=t,l(c)&&u({inst:c})},[e,n,t]),a(function(){return l(c)&&u({inst:c}),e(function(){l(c)&&u({inst:c})})},[e]),s(n),n}function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch{return!0}}function u(e,t){return t()}var d=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?u:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?d:t.useSyncExternalStore})),Wi=s(((e,t)=>{t.exports=Ui()})),Gi=Bt(`inline-flex items-center justify-center rounded-md border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-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 transition-[color,box-shadow] overflow-hidden`,{variants:{variant:{default:`border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90`,secondary:`border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90`,destructive:`border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60`,outline:`text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground`}},defaultVariants:{variant:`default`}});function Ki({className:e,variant:t,asChild:n=!1,...r}){return(0,z.jsx)(n?qt:`span`,{"data-slot":`badge`,className:et(Gi({variant:t}),e),...r})}var qi=e=>(0,z.jsx)(`svg`,{viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`,...e,children:(0,z.jsx)(`path`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`m9 18l6-6l-6-6`})}),Ji=e=>(0,z.jsx)(`svg`,{viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`,...e,children:(0,z.jsx)(`path`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`m15 18l-6-6l6-6`})}),Yi=365.2425,Xi=6048e5,Zi=864e5,Qi=3600*24;Qi*7,Qi*Yi/12*3;var $i=Symbol.for(`constructDateFrom`);function ea(e,t){return typeof e==`function`?e(t):e&&typeof e==`object`&&$i in e?e[$i](t):e instanceof Date?new e.constructor(t):new Date(t)}function ta(e,t){return ea(t||e,e)}function na(e,t,n){let r=ta(e,n?.in);return isNaN(t)?ea(n?.in||e,NaN):(t&&r.setDate(r.getDate()+t),r)}function ra(e,t,n){let r=ta(e,n?.in);if(isNaN(t))return ea(n?.in||e,NaN);if(!t)return r;let i=r.getDate(),a=ea(n?.in||e,r.getTime());return a.setMonth(r.getMonth()+t+1,0),i>=a.getDate()?a:(r.setFullYear(a.getFullYear(),a.getMonth(),i),r)}var ia={};function aa(){return ia}function oa(e,t){let n=aa(),r=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,i=ta(e,t?.in),a=i.getDay(),o=(a<r?7:0)+a-r;return i.setDate(i.getDate()-o),i.setHours(0,0,0,0),i}function sa(e,t){return oa(e,{...t,weekStartsOn:1})}function ca(e,t){let n=ta(e,t?.in),r=n.getFullYear(),i=ea(n,0);i.setFullYear(r+1,0,4),i.setHours(0,0,0,0);let a=sa(i),o=ea(n,0);o.setFullYear(r,0,4),o.setHours(0,0,0,0);let s=sa(o);return n.getTime()>=a.getTime()?r+1:n.getTime()>=s.getTime()?r:r-1}function la(e){let t=ta(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),e-+n}function ua(e,...t){let n=ea.bind(null,e||t.find(e=>typeof e==`object`));return t.map(n)}function da(e,t){let n=ta(e,t?.in);return n.setHours(0,0,0,0),n}function fa(e,t,n){let[r,i]=ua(n?.in,e,t),a=da(r),o=da(i),s=+a-la(a),c=+o-la(o);return Math.round((s-c)/Zi)}function pa(e,t){let n=ca(e,t),r=ea(t?.in||e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),sa(r)}function ma(e,t,n){return na(e,t*7,n)}function ha(e,t,n){return ra(e,t*12,n)}function ga(e,t){let n,r=t?.in;return e.forEach(e=>{!r&&typeof e==`object`&&(r=ea.bind(null,e));let t=ta(e,r);(!n||n<t||isNaN(+t))&&(n=t)}),ea(r,n||NaN)}function _a(e,t){let n,r=t?.in;return e.forEach(e=>{!r&&typeof e==`object`&&(r=ea.bind(null,e));let t=ta(e,r);(!n||n>t||isNaN(+t))&&(n=t)}),ea(r,n||NaN)}function va(e,t,n){let[r,i]=ua(n?.in,e,t);return+da(r)==+da(i)}function ya(e){return e instanceof Date||typeof e==`object`&&Object.prototype.toString.call(e)===`[object Date]`}function ba(e){return!(!ya(e)&&typeof e!=`number`||isNaN(+ta(e)))}function xa(e,t,n){let[r,i]=ua(n?.in,e,t),a=r.getFullYear()-i.getFullYear(),o=r.getMonth()-i.getMonth();return a*12+o}function Sa(e,t,n){let[r,i]=ua(n?.in,e,t),a=oa(r,n),o=oa(i,n),s=+a-la(a),c=+o-la(o);return Math.round((s-c)/Xi)}function Ca(e,t){let n=ta(e,t?.in),r=n.getMonth();return n.setFullYear(n.getFullYear(),r+1,0),n.setHours(23,59,59,999),n}function wa(e,t){let n=ta(e,t?.in);return n.setDate(1),n.setHours(0,0,0,0),n}function Ta(e,t){let n=ta(e,t?.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}function Ea(e,t){let n=aa(),r=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,i=ta(e,t?.in),a=i.getDay(),o=(a<r?-7:0)+6-(a-r);return i.setDate(i.getDate()+o),i.setHours(23,59,59,999),i}function Da(e,t){return Ea(e,{...t,weekStartsOn:1})}var Oa={lessThanXSeconds:{one:`less than a second`,other:`less than {{count}} seconds`},xSeconds:{one:`1 second`,other:`{{count}} seconds`},halfAMinute:`half a minute`,lessThanXMinutes:{one:`less than a minute`,other:`less than {{count}} minutes`},xMinutes:{one:`1 minute`,other:`{{count}} minutes`},aboutXHours:{one:`about 1 hour`,other:`about {{count}} hours`},xHours:{one:`1 hour`,other:`{{count}} hours`},xDays:{one:`1 day`,other:`{{count}} days`},aboutXWeeks:{one:`about 1 week`,other:`about {{count}} weeks`},xWeeks:{one:`1 week`,other:`{{count}} weeks`},aboutXMonths:{one:`about 1 month`,other:`about {{count}} months`},xMonths:{one:`1 month`,other:`{{count}} months`},aboutXYears:{one:`about 1 year`,other:`about {{count}} years`},xYears:{one:`1 year`,other:`{{count}} years`},overXYears:{one:`over 1 year`,other:`over {{count}} years`},almostXYears:{one:`almost 1 year`,other:`almost {{count}} years`}},ka=(e,t,n)=>{let r,i=Oa[e];return r=typeof i==`string`?i:t===1?i.one:i.other.replace(`{{count}}`,t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?`in `+r:r+` ago`:r};function Aa(e){return(t={})=>{let n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}var ja={date:Aa({formats:{full:`EEEE, MMMM do, y`,long:`MMMM do, y`,medium:`MMM d, y`,short:`MM/dd/yyyy`},defaultWidth:`full`}),time:Aa({formats:{full:`h:mm:ss a zzzz`,long:`h:mm:ss a z`,medium:`h:mm:ss a`,short:`h:mm a`},defaultWidth:`full`}),dateTime:Aa({formats:{full:`{{date}} 'at' {{time}}`,long:`{{date}} 'at' {{time}}`,medium:`{{date}}, {{time}}`,short:`{{date}}, {{time}}`},defaultWidth:`full`})},Ma={lastWeek:`'last' eeee 'at' p`,yesterday:`'yesterday at' p`,today:`'today at' p`,tomorrow:`'tomorrow at' p`,nextWeek:`eeee 'at' p`,other:`P`},Na=(e,t,n,r)=>Ma[e];function Pa(e){return(t,n)=>{let r=n?.context?String(n.context):`standalone`,i;if(r===`formatting`&&e.formattingValues){let t=e.defaultFormattingWidth||e.defaultWidth,r=n?.width?String(n.width):t;i=e.formattingValues[r]||e.formattingValues[t]}else{let t=e.defaultWidth,r=n?.width?String(n.width):e.defaultWidth;i=e.values[r]||e.values[t]}let a=e.argumentCallback?e.argumentCallback(t):t;return i[a]}}var Fa={ordinalNumber:(e,t)=>{let n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+`st`;case 2:return n+`nd`;case 3:return n+`rd`}return n+`th`},era:Pa({values:{narrow:[`B`,`A`],abbreviated:[`BC`,`AD`],wide:[`Before Christ`,`Anno Domini`]},defaultWidth:`wide`}),quarter:Pa({values:{narrow:[`1`,`2`,`3`,`4`],abbreviated:[`Q1`,`Q2`,`Q3`,`Q4`],wide:[`1st quarter`,`2nd quarter`,`3rd quarter`,`4th quarter`]},defaultWidth:`wide`,argumentCallback:e=>e-1}),month:Pa({values:{narrow:[`J`,`F`,`M`,`A`,`M`,`J`,`J`,`A`,`S`,`O`,`N`,`D`],abbreviated:[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`],wide:[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`]},defaultWidth:`wide`}),day:Pa({values:{narrow:[`S`,`M`,`T`,`W`,`T`,`F`,`S`],short:[`Su`,`Mo`,`Tu`,`We`,`Th`,`Fr`,`Sa`],abbreviated:[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`],wide:[`Sunday`,`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`]},defaultWidth:`wide`}),dayPeriod:Pa({values:{narrow:{am:`a`,pm:`p`,midnight:`mi`,noon:`n`,morning:`morning`,afternoon:`afternoon`,evening:`evening`,night:`night`},abbreviated:{am:`AM`,pm:`PM`,midnight:`midnight`,noon:`noon`,morning:`morning`,afternoon:`afternoon`,evening:`evening`,night:`night`},wide:{am:`a.m.`,pm:`p.m.`,midnight:`midnight`,noon:`noon`,morning:`morning`,afternoon:`afternoon`,evening:`evening`,night:`night`}},defaultWidth:`wide`,formattingValues:{narrow:{am:`a`,pm:`p`,midnight:`mi`,noon:`n`,morning:`in the morning`,afternoon:`in the afternoon`,evening:`in the evening`,night:`at night`},abbreviated:{am:`AM`,pm:`PM`,midnight:`midnight`,noon:`noon`,morning:`in the morning`,afternoon:`in the afternoon`,evening:`in the evening`,night:`at night`},wide:{am:`a.m.`,pm:`p.m.`,midnight:`midnight`,noon:`noon`,morning:`in the morning`,afternoon:`in the afternoon`,evening:`in the evening`,night:`at night`}},defaultFormattingWidth:`wide`})};function Ia(e){return(t,n={})=>{let r=n.width,i=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],a=t.match(i);if(!a)return null;let o=a[0],s=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(s)?Ra(s,e=>e.test(o)):La(s,e=>e.test(o)),l;l=e.valueCallback?e.valueCallback(c):c,l=n.valueCallback?n.valueCallback(l):l;let u=t.slice(o.length);return{value:l,rest:u}}}function La(e,t){for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function Ra(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function za(e){return(t,n={})=>{let r=t.match(e.matchPattern);if(!r)return null;let i=r[0],a=t.match(e.parsePattern);if(!a)return null;let o=e.valueCallback?e.valueCallback(a[0]):a[0];o=n.valueCallback?n.valueCallback(o):o;let s=t.slice(i.length);return{value:o,rest:s}}}var Ba={code:`en-US`,formatDistance:ka,formatLong:ja,formatRelative:Na,localize:Fa,match:{ordinalNumber:za({matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:e=>parseInt(e,10)}),era:Ia({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:`wide`,parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:`any`}),quarter:Ia({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:`wide`,parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:`any`,valueCallback:e=>e+1}),month:Ia({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:`wide`,parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:`any`}),day:Ia({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:`wide`,parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:`any`}),dayPeriod:Ia({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:`any`,parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:`any`})},options:{weekStartsOn:0,firstWeekContainsDate:1}};function Va(e,t){let n=ta(e,t?.in);return fa(n,Ta(n))+1}function Ha(e,t){let n=ta(e,t?.in),r=sa(n)-+pa(n);return Math.round(r/Xi)+1}function Ua(e,t){let n=ta(e,t?.in),r=n.getFullYear(),i=aa(),a=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,o=ea(t?.in||e,0);o.setFullYear(r+1,0,a),o.setHours(0,0,0,0);let s=oa(o,t),c=ea(t?.in||e,0);c.setFullYear(r,0,a),c.setHours(0,0,0,0);let l=oa(c,t);return+n>=+s?r+1:+n>=+l?r:r-1}function Wa(e,t){let n=aa(),r=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,i=Ua(e,t),a=ea(t?.in||e,0);return a.setFullYear(i,0,r),a.setHours(0,0,0,0),oa(a,t)}function Ga(e,t){let n=ta(e,t?.in),r=oa(n,t)-+Wa(n,t);return Math.round(r/Xi)+1}function Ka(e,t){return(e<0?`-`:``)+Math.abs(e).toString().padStart(t,`0`)}var qa={y(e,t){let n=e.getFullYear(),r=n>0?n:1-n;return Ka(t===`yy`?r%100:r,t.length)},M(e,t){let n=e.getMonth();return t===`M`?String(n+1):Ka(n+1,2)},d(e,t){return Ka(e.getDate(),t.length)},a(e,t){let n=e.getHours()/12>=1?`pm`:`am`;switch(t){case`a`:case`aa`:return n.toUpperCase();case`aaa`:return n;case`aaaaa`:return n[0];default:return n===`am`?`a.m.`:`p.m.`}},h(e,t){return Ka(e.getHours()%12||12,t.length)},H(e,t){return Ka(e.getHours(),t.length)},m(e,t){return Ka(e.getMinutes(),t.length)},s(e,t){return Ka(e.getSeconds(),t.length)},S(e,t){let n=t.length,r=e.getMilliseconds();return Ka(Math.trunc(r*10**(n-3)),t.length)}},Ja={am:`am`,pm:`pm`,midnight:`midnight`,noon:`noon`,morning:`morning`,afternoon:`afternoon`,evening:`evening`,night:`night`},Ya={G:function(e,t,n){let r=+(e.getFullYear()>0);switch(t){case`G`:case`GG`:case`GGG`:return n.era(r,{width:`abbreviated`});case`GGGGG`:return n.era(r,{width:`narrow`});default:return n.era(r,{width:`wide`})}},y:function(e,t,n){if(t===`yo`){let t=e.getFullYear(),r=t>0?t:1-t;return n.ordinalNumber(r,{unit:`year`})}return qa.y(e,t)},Y:function(e,t,n,r){let i=Ua(e,r),a=i>0?i:1-i;return t===`YY`?Ka(a%100,2):t===`Yo`?n.ordinalNumber(a,{unit:`year`}):Ka(a,t.length)},R:function(e,t){return Ka(ca(e),t.length)},u:function(e,t){return Ka(e.getFullYear(),t.length)},Q:function(e,t,n){let r=Math.ceil((e.getMonth()+1)/3);switch(t){case`Q`:return String(r);case`QQ`:return Ka(r,2);case`Qo`:return n.ordinalNumber(r,{unit:`quarter`});case`QQQ`:return n.quarter(r,{width:`abbreviated`,context:`formatting`});case`QQQQQ`:return n.quarter(r,{width:`narrow`,context:`formatting`});default:return n.quarter(r,{width:`wide`,context:`formatting`})}},q:function(e,t,n){let r=Math.ceil((e.getMonth()+1)/3);switch(t){case`q`:return String(r);case`qq`:return Ka(r,2);case`qo`:return n.ordinalNumber(r,{unit:`quarter`});case`qqq`:return n.quarter(r,{width:`abbreviated`,context:`standalone`});case`qqqqq`:return n.quarter(r,{width:`narrow`,context:`standalone`});default:return n.quarter(r,{width:`wide`,context:`standalone`})}},M:function(e,t,n){let r=e.getMonth();switch(t){case`M`:case`MM`:return qa.M(e,t);case`Mo`:return n.ordinalNumber(r+1,{unit:`month`});case`MMM`:return n.month(r,{width:`abbreviated`,context:`formatting`});case`MMMMM`:return n.month(r,{width:`narrow`,context:`formatting`});default:return n.month(r,{width:`wide`,context:`formatting`})}},L:function(e,t,n){let r=e.getMonth();switch(t){case`L`:return String(r+1);case`LL`:return Ka(r+1,2);case`Lo`:return n.ordinalNumber(r+1,{unit:`month`});case`LLL`:return n.month(r,{width:`abbreviated`,context:`standalone`});case`LLLLL`:return n.month(r,{width:`narrow`,context:`standalone`});default:return n.month(r,{width:`wide`,context:`standalone`})}},w:function(e,t,n,r){let i=Ga(e,r);return t===`wo`?n.ordinalNumber(i,{unit:`week`}):Ka(i,t.length)},I:function(e,t,n){let r=Ha(e);return t===`Io`?n.ordinalNumber(r,{unit:`week`}):Ka(r,t.length)},d:function(e,t,n){return t===`do`?n.ordinalNumber(e.getDate(),{unit:`date`}):qa.d(e,t)},D:function(e,t,n){let r=Va(e);return t===`Do`?n.ordinalNumber(r,{unit:`dayOfYear`}):Ka(r,t.length)},E:function(e,t,n){let r=e.getDay();switch(t){case`E`:case`EE`:case`EEE`:return n.day(r,{width:`abbreviated`,context:`formatting`});case`EEEEE`:return n.day(r,{width:`narrow`,context:`formatting`});case`EEEEEE`:return n.day(r,{width:`short`,context:`formatting`});default:return n.day(r,{width:`wide`,context:`formatting`})}},e:function(e,t,n,r){let i=e.getDay(),a=(i-r.weekStartsOn+8)%7||7;switch(t){case`e`:return String(a);case`ee`:return Ka(a,2);case`eo`:return n.ordinalNumber(a,{unit:`day`});case`eee`:return n.day(i,{width:`abbreviated`,context:`formatting`});case`eeeee`:return n.day(i,{width:`narrow`,context:`formatting`});case`eeeeee`:return n.day(i,{width:`short`,context:`formatting`});default:return n.day(i,{width:`wide`,context:`formatting`})}},c:function(e,t,n,r){let i=e.getDay(),a=(i-r.weekStartsOn+8)%7||7;switch(t){case`c`:return String(a);case`cc`:return Ka(a,t.length);case`co`:return n.ordinalNumber(a,{unit:`day`});case`ccc`:return n.day(i,{width:`abbreviated`,context:`standalone`});case`ccccc`:return n.day(i,{width:`narrow`,context:`standalone`});case`cccccc`:return n.day(i,{width:`short`,context:`standalone`});default:return n.day(i,{width:`wide`,context:`standalone`})}},i:function(e,t,n){let r=e.getDay(),i=r===0?7:r;switch(t){case`i`:return String(i);case`ii`:return Ka(i,t.length);case`io`:return n.ordinalNumber(i,{unit:`day`});case`iii`:return n.day(r,{width:`abbreviated`,context:`formatting`});case`iiiii`:return n.day(r,{width:`narrow`,context:`formatting`});case`iiiiii`:return n.day(r,{width:`short`,context:`formatting`});default:return n.day(r,{width:`wide`,context:`formatting`})}},a:function(e,t,n){let r=e.getHours()/12>=1?`pm`:`am`;switch(t){case`a`:case`aa`:return n.dayPeriod(r,{width:`abbreviated`,context:`formatting`});case`aaa`:return n.dayPeriod(r,{width:`abbreviated`,context:`formatting`}).toLowerCase();case`aaaaa`:return n.dayPeriod(r,{width:`narrow`,context:`formatting`});default:return n.dayPeriod(r,{width:`wide`,context:`formatting`})}},b:function(e,t,n){let r=e.getHours(),i;switch(i=r===12?Ja.noon:r===0?Ja.midnight:r/12>=1?`pm`:`am`,t){case`b`:case`bb`:return n.dayPeriod(i,{width:`abbreviated`,context:`formatting`});case`bbb`:return n.dayPeriod(i,{width:`abbreviated`,context:`formatting`}).toLowerCase();case`bbbbb`:return n.dayPeriod(i,{width:`narrow`,context:`formatting`});default:return n.dayPeriod(i,{width:`wide`,context:`formatting`})}},B:function(e,t,n){let r=e.getHours(),i;switch(i=r>=17?Ja.evening:r>=12?Ja.afternoon:r>=4?Ja.morning:Ja.night,t){case`B`:case`BB`:case`BBB`:return n.dayPeriod(i,{width:`abbreviated`,context:`formatting`});case`BBBBB`:return n.dayPeriod(i,{width:`narrow`,context:`formatting`});default:return n.dayPeriod(i,{width:`wide`,context:`formatting`})}},h:function(e,t,n){if(t===`ho`){let t=e.getHours()%12;return t===0&&(t=12),n.ordinalNumber(t,{unit:`hour`})}return qa.h(e,t)},H:function(e,t,n){return t===`Ho`?n.ordinalNumber(e.getHours(),{unit:`hour`}):qa.H(e,t)},K:function(e,t,n){let r=e.getHours()%12;return t===`Ko`?n.ordinalNumber(r,{unit:`hour`}):Ka(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t===`ko`?n.ordinalNumber(r,{unit:`hour`}):Ka(r,t.length)},m:function(e,t,n){return t===`mo`?n.ordinalNumber(e.getMinutes(),{unit:`minute`}):qa.m(e,t)},s:function(e,t,n){return t===`so`?n.ordinalNumber(e.getSeconds(),{unit:`second`}):qa.s(e,t)},S:function(e,t){return qa.S(e,t)},X:function(e,t,n){let r=e.getTimezoneOffset();if(r===0)return`Z`;switch(t){case`X`:return Za(r);case`XXXX`:case`XX`:return Qa(r);default:return Qa(r,`:`)}},x:function(e,t,n){let r=e.getTimezoneOffset();switch(t){case`x`:return Za(r);case`xxxx`:case`xx`:return Qa(r);default:return Qa(r,`:`)}},O:function(e,t,n){let r=e.getTimezoneOffset();switch(t){case`O`:case`OO`:case`OOO`:return`GMT`+Xa(r,`:`);default:return`GMT`+Qa(r,`:`)}},z:function(e,t,n){let r=e.getTimezoneOffset();switch(t){case`z`:case`zz`:case`zzz`:return`GMT`+Xa(r,`:`);default:return`GMT`+Qa(r,`:`)}},t:function(e,t,n){return Ka(Math.trunc(e/1e3),t.length)},T:function(e,t,n){return Ka(+e,t.length)}};function Xa(e,t=``){let n=e>0?`-`:`+`,r=Math.abs(e),i=Math.trunc(r/60),a=r%60;return a===0?n+String(i):n+String(i)+t+Ka(a,2)}function Za(e,t){return e%60==0?(e>0?`-`:`+`)+Ka(Math.abs(e)/60,2):Qa(e,t)}function Qa(e,t=``){let n=e>0?`-`:`+`,r=Math.abs(e),i=Ka(Math.trunc(r/60),2),a=Ka(r%60,2);return n+i+t+a}var $a=(e,t)=>{switch(e){case`P`:return t.date({width:`short`});case`PP`:return t.date({width:`medium`});case`PPP`:return t.date({width:`long`});default:return t.date({width:`full`})}},eo=(e,t)=>{switch(e){case`p`:return t.time({width:`short`});case`pp`:return t.time({width:`medium`});case`ppp`:return t.time({width:`long`});default:return t.time({width:`full`})}},to={p:eo,P:(e,t)=>{let n=e.match(/(P+)(p+)?/)||[],r=n[1],i=n[2];if(!i)return $a(e,t);let a;switch(r){case`P`:a=t.dateTime({width:`short`});break;case`PP`:a=t.dateTime({width:`medium`});break;case`PPP`:a=t.dateTime({width:`long`});break;default:a=t.dateTime({width:`full`});break}return a.replace(`{{date}}`,$a(r,t)).replace(`{{time}}`,eo(i,t))}},no=/^D+$/,ro=/^Y+$/,io=[`D`,`DD`,`YY`,`YYYY`];function ao(e){return no.test(e)}function oo(e){return ro.test(e)}function so(e,t,n){let r=co(e,t,n);if(console.warn(r),io.includes(e))throw RangeError(r)}function co(e,t,n){let r=e[0]===`Y`?`years`:`days of the month`;return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}var lo=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,uo=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,fo=/^'([^]*?)'?$/,po=/''/g,mo=/[a-zA-Z]/;function ho(e,t,n){let r=aa(),i=n?.locale??r.locale??Ba,a=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,o=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,s=ta(e,n?.in);if(!ba(s))throw RangeError(`Invalid time value`);let c=t.match(uo).map(e=>{let t=e[0];if(t===`p`||t===`P`){let n=to[t];return n(e,i.formatLong)}return e}).join(``).match(lo).map(e=>{if(e===`''`)return{isToken:!1,value:`'`};let t=e[0];if(t===`'`)return{isToken:!1,value:go(e)};if(Ya[t])return{isToken:!0,value:e};if(t.match(mo))throw RangeError("Format string contains an unescaped latin alphabet character `"+t+"`");return{isToken:!1,value:e}});i.localize.preprocessor&&(c=i.localize.preprocessor(s,c));let l={firstWeekContainsDate:a,weekStartsOn:o,locale:i};return c.map(r=>{if(!r.isToken)return r.value;let a=r.value;(!n?.useAdditionalWeekYearTokens&&oo(a)||!n?.useAdditionalDayOfYearTokens&&ao(a))&&so(a,t,String(e));let o=Ya[a[0]];return o(s,a,i.localize,l)}).join(``)}function go(e){let t=e.match(fo);return t?t[1].replace(po,`'`):e}function _o(e,t){let n=ta(e,t?.in),r=n.getFullYear(),i=n.getMonth(),a=ea(n,0);return a.setFullYear(r,i+1,0),a.setHours(0,0,0,0),a.getDate()}function vo(e){return Math.trunc(ta(e)/1e3)}function yo(e,t){let n=ta(e,t?.in),r=n.getMonth();return n.setFullYear(n.getFullYear(),r+1,0),n.setHours(0,0,0,0),ta(n,t?.in)}function bo(e,t){let n=ta(e,t?.in);return Sa(yo(n,t),wa(n,t),t)+1}function xo(e,t){return+ta(e)>+ta(t)}function So(e,t){return+ta(e)<+ta(t)}function Co(e,t,n){let[r,i]=ua(n?.in,e,t);return r.getFullYear()===i.getFullYear()&&r.getMonth()===i.getMonth()}function wo(e,t,n){let[r,i]=ua(n?.in,e,t);return r.getFullYear()===i.getFullYear()}function To(e,t,n){return na(e,-t,n)}function Eo(e,t,n){let r=ta(e,n?.in),i=r.getFullYear(),a=r.getDate(),o=ea(n?.in||e,0);o.setFullYear(i,t,15),o.setHours(0,0,0,0);let s=_o(o);return r.setMonth(t,Math.min(a,s)),r}function Do(e,t,n){let r=ta(e,n?.in);return isNaN(+r)?ea(n?.in||e,NaN):(r.setFullYear(t),r)}var Oo=function(){return Oo=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Oo.apply(this,arguments)};function ko(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 i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function Ao(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}function jo(e){return e.mode===`multiple`}function Mo(e){return e.mode===`range`}function No(e){return e.mode===`single`}var Po={root:`rdp`,multiple_months:`rdp-multiple_months`,with_weeknumber:`rdp-with_weeknumber`,vhidden:`rdp-vhidden`,button_reset:`rdp-button_reset`,button:`rdp-button`,caption:`rdp-caption`,caption_start:`rdp-caption_start`,caption_end:`rdp-caption_end`,caption_between:`rdp-caption_between`,caption_label:`rdp-caption_label`,caption_dropdowns:`rdp-caption_dropdowns`,dropdown:`rdp-dropdown`,dropdown_month:`rdp-dropdown_month`,dropdown_year:`rdp-dropdown_year`,dropdown_icon:`rdp-dropdown_icon`,months:`rdp-months`,month:`rdp-month`,table:`rdp-table`,tbody:`rdp-tbody`,tfoot:`rdp-tfoot`,head:`rdp-head`,head_row:`rdp-head_row`,head_cell:`rdp-head_cell`,nav:`rdp-nav`,nav_button:`rdp-nav_button`,nav_button_previous:`rdp-nav_button_previous`,nav_button_next:`rdp-nav_button_next`,nav_icon:`rdp-nav_icon`,row:`rdp-row`,weeknumber:`rdp-weeknumber`,cell:`rdp-cell`,day:`rdp-day`,day_today:`rdp-day_today`,day_outside:`rdp-day_outside`,day_selected:`rdp-day_selected`,day_disabled:`rdp-day_disabled`,day_hidden:`rdp-day_hidden`,day_range_start:`rdp-day_range_start`,day_range_end:`rdp-day_range_end`,day_range_middle:`rdp-day_range_middle`};function Fo(e,t){return ho(e,`LLLL y`,t)}function Io(e,t){return ho(e,`d`,t)}function Lo(e,t){return ho(e,`LLLL`,t)}function Ro(e){return`${e}`}function zo(e,t){return ho(e,`cccccc`,t)}function Bo(e,t){return ho(e,`yyyy`,t)}var Vo=Object.freeze({__proto__:null,formatCaption:Fo,formatDay:Io,formatMonthCaption:Lo,formatWeekNumber:Ro,formatWeekdayName:zo,formatYearCaption:Bo}),Ho=Object.freeze({__proto__:null,labelDay:function(e,t,n){return ho(e,`do MMMM (EEEE)`,n)},labelMonthDropdown:function(){return`Month: `},labelNext:function(){return`Go to next month`},labelPrevious:function(){return`Go to previous month`},labelWeekNumber:function(e){return`Week n. ${e}`},labelWeekday:function(e,t){return ho(e,`cccc`,t)},labelYearDropdown:function(){return`Year: `}});function Uo(){return{captionLayout:`buttons`,classNames:Po,formatters:Vo,labels:Ho,locale:Ba,modifiersClassNames:{},modifiers:{},numberOfMonths:1,styles:{},today:new Date,mode:`default`}}function Wo(e){var t=e.fromYear,n=e.toYear,r=e.fromMonth,i=e.toMonth,a=e.fromDate,o=e.toDate;return r?a=wa(r):t&&(a=new Date(t,0,1)),i?o=Ca(i):n&&(o=new Date(n,11,31)),{fromDate:a?da(a):void 0,toDate:o?da(o):void 0}}var Go=(0,m.createContext)(void 0);function Ko(e){var t=e.initialProps,n=Uo(),r=Wo(t),i=r.fromDate,a=r.toDate,o=t.captionLayout??n.captionLayout;o!==`buttons`&&(!i||!a)&&(o=`buttons`);var s;(No(t)||jo(t)||Mo(t))&&(s=t.onSelect);var c=Oo(Oo(Oo({},n),t),{captionLayout:o,classNames:Oo(Oo({},n.classNames),t.classNames),components:Oo({},t.components),formatters:Oo(Oo({},n.formatters),t.formatters),fromDate:i,labels:Oo(Oo({},n.labels),t.labels),mode:t.mode||n.mode,modifiers:Oo(Oo({},n.modifiers),t.modifiers),modifiersClassNames:Oo(Oo({},n.modifiersClassNames),t.modifiersClassNames),onSelect:s,styles:Oo(Oo({},n.styles),t.styles),toDate:a});return(0,z.jsx)(Go.Provider,{value:c,children:e.children})}function qo(){var e=(0,m.useContext)(Go);if(!e)throw Error(`useDayPicker must be used within a DayPickerProvider.`);return e}function Jo(e){var t=qo(),n=t.locale,r=t.classNames,i=t.styles,a=t.formatters.formatCaption;return(0,z.jsx)(`div`,{className:r.caption_label,style:i.caption_label,"aria-live":`polite`,role:`presentation`,id:e.id,children:a(e.displayMonth,{locale:n})})}function Yo(e){return(0,z.jsx)(`svg`,Oo({width:`8px`,height:`8px`,viewBox:`0 0 120 120`,"data-testid":`iconDropdown`},e,{children:(0,z.jsx)(`path`,{d:`M4.22182541,48.2218254 C8.44222828,44.0014225 15.2388494,43.9273804 19.5496459,47.9996989 L19.7781746,48.2218254 L60,88.443 L100.221825,48.2218254 C104.442228,44.0014225 111.238849,43.9273804 115.549646,47.9996989 L115.778175,48.2218254 C119.998577,52.4422283 120.07262,59.2388494 116.000301,63.5496459 L115.778175,63.7781746 L67.7781746,111.778175 C63.5577717,115.998577 56.7611506,116.07262 52.4503541,112.000301 L52.2218254,111.778175 L4.22182541,63.7781746 C-0.0739418023,59.4824074 -0.0739418023,52.5175926 4.22182541,48.2218254 Z`,fill:`currentColor`,fillRule:`nonzero`})}))}function Xo(e){var t=e.onChange,n=e.value,r=e.children,i=e.caption,a=e.className,o=e.style,s=qo(),c=s.components?.IconDropdown??Yo;return(0,z.jsxs)(`div`,{className:a,style:o,children:[(0,z.jsx)(`span`,{className:s.classNames.vhidden,children:e[`aria-label`]}),(0,z.jsx)(`select`,{name:e.name,"aria-label":e[`aria-label`],className:s.classNames.dropdown,style:s.styles.dropdown,value:n,onChange:t,children:r}),(0,z.jsxs)(`div`,{className:s.classNames.caption_label,style:s.styles.caption_label,"aria-hidden":`true`,children:[i,(0,z.jsx)(c,{className:s.classNames.dropdown_icon,style:s.styles.dropdown_icon})]})]})}function Zo(e){var t=qo(),n=t.fromDate,r=t.toDate,i=t.styles,a=t.locale,o=t.formatters.formatMonthCaption,s=t.classNames,c=t.components,l=t.labels.labelMonthDropdown;if(!n||!r)return(0,z.jsx)(z.Fragment,{});var u=[];if(wo(n,r))for(var d=wa(n),f=n.getMonth();f<=r.getMonth();f++)u.push(Eo(d,f));else for(var d=wa(new Date),f=0;f<=11;f++)u.push(Eo(d,f));return(0,z.jsx)(c?.Dropdown??Xo,{name:`months`,"aria-label":l(),className:s.dropdown_month,style:i.dropdown_month,onChange:function(t){var n=Number(t.target.value),r=Eo(wa(e.displayMonth),n);e.onChange(r)},value:e.displayMonth.getMonth(),caption:o(e.displayMonth,{locale:a}),children:u.map(function(e){return(0,z.jsx)(`option`,{value:e.getMonth(),children:o(e,{locale:a})},e.getMonth())})})}function Qo(e){var t=e.displayMonth,n=qo(),r=n.fromDate,i=n.toDate,a=n.locale,o=n.styles,s=n.classNames,c=n.components,l=n.formatters.formatYearCaption,u=n.labels.labelYearDropdown,d=[];if(!r||!i)return(0,z.jsx)(z.Fragment,{});for(var f=r.getFullYear(),p=i.getFullYear(),m=f;m<=p;m++)d.push(Do(Ta(new Date),m));return(0,z.jsx)(c?.Dropdown??Xo,{name:`years`,"aria-label":u(),className:s.dropdown_year,style:o.dropdown_year,onChange:function(n){var r=Do(wa(t),Number(n.target.value));e.onChange(r)},value:t.getFullYear(),caption:l(t,{locale:a}),children:d.map(function(e){return(0,z.jsx)(`option`,{value:e.getFullYear(),children:l(e,{locale:a})},e.getFullYear())})})}function $o(e,t){var n=(0,m.useState)(e),r=n[0],i=n[1];return[t===void 0?r:t,i]}function es(e){var t=e.month,n=e.defaultMonth,r=e.today,i=t||n||r||new Date,a=e.toDate,o=e.fromDate,s=e.numberOfMonths,c=s===void 0?1:s;return a&&xa(a,i)<0&&(i=ra(a,-1*(c-1))),o&&xa(i,o)<0&&(i=o),wa(i)}function ts(){var e=qo(),t=$o(es(e),e.month),n=t[0],r=t[1];return[n,function(t){var n;if(!e.disableNavigation){var i=wa(t);r(i),(n=e.onMonthChange)==null||n.call(e,i)}}]}function ns(e,t){for(var n=t.reverseMonths,r=t.numberOfMonths,i=wa(e),a=xa(wa(ra(i,r)),i),o=[],s=0;s<a;s++){var c=ra(i,s);o.push(c)}return n&&(o=o.reverse()),o}function rs(e,t){if(!t.disableNavigation){var n=t.toDate,r=t.pagedNavigation,i=t.numberOfMonths,a=i===void 0?1:i,o=r?a:1,s=wa(e);if(!n||!(xa(n,e)<a))return ra(s,o)}}function is(e,t){if(!t.disableNavigation){var n=t.fromDate,r=t.pagedNavigation,i=t.numberOfMonths,a=r?i===void 0?1:i:1,o=wa(e);if(!n||!(xa(o,n)<=0))return ra(o,-a)}}var as=(0,m.createContext)(void 0);function os(e){var t=qo(),n=ts(),r=n[0],i=n[1],a=ns(r,t),o=rs(r,t),s=is(r,t),c=function(e){return a.some(function(t){return Co(e,t)})},l={currentMonth:r,displayMonths:a,goToMonth:i,goToDate:function(e,n){c(e)||(n&&So(e,n)?i(ra(e,1+t.numberOfMonths*-1)):i(e))},previousMonth:s,nextMonth:o,isDateDisplayed:c};return(0,z.jsx)(as.Provider,{value:l,children:e.children})}function ss(){var e=(0,m.useContext)(as);if(!e)throw Error(`useNavigation must be used within a NavigationProvider`);return e}function cs(e){var t=qo(),n=t.classNames,r=t.styles,i=t.components,a=ss().goToMonth,o=function(t){a(ra(t,e.displayIndex?-e.displayIndex:0))},s=(0,z.jsx)(i?.CaptionLabel??Jo,{id:e.id,displayMonth:e.displayMonth});return(0,z.jsxs)(`div`,{className:n.caption_dropdowns,style:r.caption_dropdowns,children:[(0,z.jsx)(`div`,{className:n.vhidden,children:s}),(0,z.jsx)(Zo,{onChange:o,displayMonth:e.displayMonth}),(0,z.jsx)(Qo,{onChange:o,displayMonth:e.displayMonth})]})}function ls(e){return(0,z.jsx)(`svg`,Oo({width:`16px`,height:`16px`,viewBox:`0 0 120 120`},e,{children:(0,z.jsx)(`path`,{d:`M69.490332,3.34314575 C72.6145263,0.218951416 77.6798462,0.218951416 80.8040405,3.34314575 C83.8617626,6.40086786 83.9268205,11.3179931 80.9992143,14.4548388 L80.8040405,14.6568542 L35.461,60 L80.8040405,105.343146 C83.8617626,108.400868 83.9268205,113.317993 80.9992143,116.454839 L80.8040405,116.656854 C77.7463184,119.714576 72.8291931,119.779634 69.6923475,116.852028 L69.490332,116.656854 L18.490332,65.6568542 C15.4326099,62.5991321 15.367552,57.6820069 18.2951583,54.5451612 L18.490332,54.3431458 L69.490332,3.34314575 Z`,fill:`currentColor`,fillRule:`nonzero`})}))}function us(e){return(0,z.jsx)(`svg`,Oo({width:`16px`,height:`16px`,viewBox:`0 0 120 120`},e,{children:(0,z.jsx)(`path`,{d:`M49.8040405,3.34314575 C46.6798462,0.218951416 41.6145263,0.218951416 38.490332,3.34314575 C35.4326099,6.40086786 35.367552,11.3179931 38.2951583,14.4548388 L38.490332,14.6568542 L83.8333725,60 L38.490332,105.343146 C35.4326099,108.400868 35.367552,113.317993 38.2951583,116.454839 L38.490332,116.656854 C41.5480541,119.714576 46.4651794,119.779634 49.602025,116.852028 L49.8040405,116.656854 L100.804041,65.6568542 C103.861763,62.5991321 103.926821,57.6820069 100.999214,54.5451612 L100.804041,54.3431458 L49.8040405,3.34314575 Z`,fill:`currentColor`})}))}var ds=(0,m.forwardRef)(function(e,t){var n=qo(),r=n.classNames,i=n.styles,a=[r.button_reset,r.button];e.className&&a.push(e.className);var o=a.join(` `),s=Oo(Oo({},i.button_reset),i.button);return e.style&&Object.assign(s,e.style),(0,z.jsx)(`button`,Oo({},e,{ref:t,type:`button`,className:o,style:s}))});function fs(e){var t=qo(),n=t.dir,r=t.locale,i=t.classNames,a=t.styles,o=t.labels,s=o.labelPrevious,c=o.labelNext,l=t.components;if(!e.nextMonth&&!e.previousMonth)return(0,z.jsx)(z.Fragment,{});var u=s(e.previousMonth,{locale:r}),d=[i.nav_button,i.nav_button_previous].join(` `),f=c(e.nextMonth,{locale:r}),p=[i.nav_button,i.nav_button_next].join(` `),m=l?.IconRight??us,h=l?.IconLeft??ls;return(0,z.jsxs)(`div`,{className:i.nav,style:a.nav,children:[!e.hidePrevious&&(0,z.jsx)(ds,{name:`previous-month`,"aria-label":u,className:d,style:a.nav_button_previous,disabled:!e.previousMonth,onClick:e.onPreviousClick,children:n===`rtl`?(0,z.jsx)(m,{className:i.nav_icon,style:a.nav_icon}):(0,z.jsx)(h,{className:i.nav_icon,style:a.nav_icon})}),!e.hideNext&&(0,z.jsx)(ds,{name:`next-month`,"aria-label":f,className:p,style:a.nav_button_next,disabled:!e.nextMonth,onClick:e.onNextClick,children:n===`rtl`?(0,z.jsx)(h,{className:i.nav_icon,style:a.nav_icon}):(0,z.jsx)(m,{className:i.nav_icon,style:a.nav_icon})})]})}function ps(e){var t=qo().numberOfMonths,n=ss(),r=n.previousMonth,i=n.nextMonth,a=n.goToMonth,o=n.displayMonths,s=o.findIndex(function(t){return Co(e.displayMonth,t)}),c=s===0,l=s===o.length-1,u=t>1&&(c||!l),d=t>1&&(l||!c);return(0,z.jsx)(fs,{displayMonth:e.displayMonth,hideNext:u,hidePrevious:d,nextMonth:i,previousMonth:r,onPreviousClick:function(){r&&a(r)},onNextClick:function(){i&&a(i)}})}function ms(e){var t=qo(),n=t.classNames,r=t.disableNavigation,i=t.styles,a=t.captionLayout,o=t.components?.CaptionLabel??Jo,s=r?(0,z.jsx)(o,{id:e.id,displayMonth:e.displayMonth}):a===`dropdown`?(0,z.jsx)(cs,{displayMonth:e.displayMonth,id:e.id}):a===`dropdown-buttons`?(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(cs,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id}),(0,z.jsx)(ps,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id})]}):(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(o,{id:e.id,displayMonth:e.displayMonth,displayIndex:e.displayIndex}),(0,z.jsx)(ps,{displayMonth:e.displayMonth,id:e.id})]});return(0,z.jsx)(`div`,{className:n.caption,style:i.caption,children:s})}function hs(e){var t=qo(),n=t.footer,r=t.styles,i=t.classNames.tfoot;return n?(0,z.jsx)(`tfoot`,{className:i,style:r.tfoot,children:(0,z.jsx)(`tr`,{children:(0,z.jsx)(`td`,{colSpan:8,children:n})})}):(0,z.jsx)(z.Fragment,{})}function gs(e,t,n){for(var r=n?sa(new Date):oa(new Date,{locale:e,weekStartsOn:t}),i=[],a=0;a<7;a++){var o=na(r,a);i.push(o)}return i}function _s(){var e=qo(),t=e.classNames,n=e.styles,r=e.showWeekNumber,i=e.locale,a=e.weekStartsOn,o=e.ISOWeek,s=e.formatters.formatWeekdayName,c=e.labels.labelWeekday,l=gs(i,a,o);return(0,z.jsxs)(`tr`,{style:n.head_row,className:t.head_row,children:[r&&(0,z.jsx)(`td`,{style:n.head_cell,className:t.head_cell}),l.map(function(e,r){return(0,z.jsx)(`th`,{scope:`col`,className:t.head_cell,style:n.head_cell,"aria-label":c(e,{locale:i}),children:s(e,{locale:i})},r)})]})}function vs(){var e=qo(),t=e.classNames,n=e.styles,r=e.components?.HeadRow??_s;return(0,z.jsx)(`thead`,{style:n.head,className:t.head,children:(0,z.jsx)(r,{})})}function ys(e){var t=qo(),n=t.locale,r=t.formatters.formatDay;return(0,z.jsx)(z.Fragment,{children:r(e.date,{locale:n})})}var bs=(0,m.createContext)(void 0);function xs(e){return jo(e.initialProps)?(0,z.jsx)(Ss,{initialProps:e.initialProps,children:e.children}):(0,z.jsx)(bs.Provider,{value:{selected:void 0,modifiers:{disabled:[]}},children:e.children})}function Ss(e){var t=e.initialProps,n=e.children,r=t.selected,i=t.min,a=t.max,o=function(e,n,o){var s,c;if((s=t.onDayClick)==null||s.call(t,e,n,o),!(n.selected&&i&&r?.length===i)&&!(!n.selected&&a&&r?.length===a)){var l=r?Ao([],r,!0):[];if(n.selected){var u=l.findIndex(function(t){return va(e,t)});l.splice(u,1)}else l.push(e);(c=t.onSelect)==null||c.call(t,l,e,n,o)}},s={disabled:[]};r&&s.disabled.push(function(e){var t=a&&r.length>a-1,n=r.some(function(t){return va(t,e)});return!!(t&&!n)});var c={selected:r,onDayClick:o,modifiers:s};return(0,z.jsx)(bs.Provider,{value:c,children:n})}function Cs(){var e=(0,m.useContext)(bs);if(!e)throw Error(`useSelectMultiple must be used within a SelectMultipleProvider`);return e}function ws(e,t){var n=t||{},r=n.from,i=n.to;return r&&i?va(i,e)&&va(r,e)?void 0:va(i,e)?{from:i,to:void 0}:va(r,e)?void 0:xo(r,e)?{from:e,to:i}:{from:r,to:e}:i?xo(e,i)?{from:i,to:e}:{from:e,to:i}:r?So(e,r)?{from:e,to:r}:{from:r,to:e}:{from:e,to:void 0}}var Ts=(0,m.createContext)(void 0);function Es(e){return Mo(e.initialProps)?(0,z.jsx)(Ds,{initialProps:e.initialProps,children:e.children}):(0,z.jsx)(Ts.Provider,{value:{selected:void 0,modifiers:{range_start:[],range_end:[],range_middle:[],disabled:[]}},children:e.children})}function Ds(e){var t=e.initialProps,n=e.children,r=t.selected,i=r||{},a=i.from,o=i.to,s=t.min,c=t.max,l=function(e,n,i){var a,o;(a=t.onDayClick)==null||a.call(t,e,n,i);var s=ws(e,r);(o=t.onSelect)==null||o.call(t,s,e,n,i)},u={range_start:[],range_end:[],range_middle:[],disabled:[]};if(a?(u.range_start=[a],o?(u.range_end=[o],va(a,o)||(u.range_middle=[{after:a,before:o}])):u.range_end=[a]):o&&(u.range_start=[o],u.range_end=[o]),s&&(a&&!o&&u.disabled.push({after:To(a,s-1),before:na(a,s-1)}),a&&o&&u.disabled.push({after:a,before:na(a,s-1)}),!a&&o&&u.disabled.push({after:To(o,s-1),before:na(o,s-1)})),c){if(a&&!o&&(u.disabled.push({before:na(a,-c+1)}),u.disabled.push({after:na(a,c-1)})),a&&o){var d=c-(fa(o,a)+1);u.disabled.push({before:To(a,d)}),u.disabled.push({after:na(o,d)})}!a&&o&&(u.disabled.push({before:na(o,-c+1)}),u.disabled.push({after:na(o,c-1)}))}return(0,z.jsx)(Ts.Provider,{value:{selected:r,onDayClick:l,modifiers:u},children:n})}function Os(){var e=(0,m.useContext)(Ts);if(!e)throw Error(`useSelectRange must be used within a SelectRangeProvider`);return e}function ks(e){return Array.isArray(e)?Ao([],e,!0):e===void 0?[]:[e]}function As(e){var t={};return Object.entries(e).forEach(function(e){var n=e[0],r=e[1];t[n]=ks(r)}),t}var js;(function(e){e.Outside=`outside`,e.Disabled=`disabled`,e.Selected=`selected`,e.Hidden=`hidden`,e.Today=`today`,e.RangeStart=`range_start`,e.RangeEnd=`range_end`,e.RangeMiddle=`range_middle`})(js||={});var Ms=js.Selected,Ns=js.Disabled,Ps=js.Hidden,Fs=js.Today,Is=js.RangeEnd,Ls=js.RangeMiddle,Rs=js.RangeStart,zs=js.Outside;function Bs(e,t,n){var r,i=(r={},r[Ms]=ks(e.selected),r[Ns]=ks(e.disabled),r[Ps]=ks(e.hidden),r[Fs]=[e.today],r[Is]=[],r[Ls]=[],r[Rs]=[],r[zs]=[],r);return e.fromDate&&i[Ns].push({before:e.fromDate}),e.toDate&&i[Ns].push({after:e.toDate}),jo(e)?i[Ns]=i[Ns].concat(t.modifiers[Ns]):Mo(e)&&(i[Ns]=i[Ns].concat(n.modifiers[Ns]),i[Rs]=n.modifiers[Rs],i[Ls]=n.modifiers[Ls],i[Is]=n.modifiers[Is]),i}var Vs=(0,m.createContext)(void 0);function Hs(e){var t=qo(),n=Bs(t,Cs(),Os()),r=As(t.modifiers),i=Oo(Oo({},n),r);return(0,z.jsx)(Vs.Provider,{value:i,children:e.children})}function Us(){var e=(0,m.useContext)(Vs);if(!e)throw Error(`useModifiers must be used within a ModifiersProvider`);return e}function Ws(e){return!!(e&&typeof e==`object`&&`before`in e&&`after`in e)}function Gs(e){return!!(e&&typeof e==`object`&&`from`in e)}function Ks(e){return!!(e&&typeof e==`object`&&`after`in e)}function qs(e){return!!(e&&typeof e==`object`&&`before`in e)}function Js(e){return!!(e&&typeof e==`object`&&`dayOfWeek`in e)}function Ys(e,t){var n,r=t.from,i=t.to;return r&&i?(fa(i,r)<0&&(n=[i,r],r=n[0],i=n[1]),fa(e,r)>=0&&fa(i,e)>=0):i?va(i,e):r?va(r,e):!1}function Xs(e){return ya(e)}function Zs(e){return Array.isArray(e)&&e.every(ya)}function Qs(e,t){return t.some(function(t){if(typeof t==`boolean`)return t;if(Xs(t))return va(e,t);if(Zs(t))return t.includes(e);if(Gs(t))return Ys(e,t);if(Js(t))return t.dayOfWeek.includes(e.getDay());if(Ws(t)){var n=fa(t.before,e),r=fa(t.after,e),i=n>0,a=r<0;return xo(t.before,t.after)?a&&i:i||a}return Ks(t)?fa(e,t.after)>0:qs(t)?fa(t.before,e)>0:typeof t==`function`?t(e):!1})}function $s(e,t,n){var r=Object.keys(t).reduce(function(n,r){var i=t[r];return Qs(e,i)&&n.push(r),n},[]),i={};return r.forEach(function(e){return i[e]=!0}),n&&!Co(e,n)&&(i.outside=!0),i}function ec(e,t){for(var n=wa(e[0]),r=Ca(e[e.length-1]),i,a,o=n;o<=r;){var s=$s(o,t);if(!(!s.disabled&&!s.hidden)){o=na(o,1);continue}if(s.selected)return o;s.today&&!a&&(a=o),i||=o,o=na(o,1)}return a||i}var tc=365;function nc(e,t){var n=t.moveBy,r=t.direction,i=t.context,a=t.modifiers,o=t.retry,s=o===void 0?{count:0,lastFocused:e}:o,c=i.weekStartsOn,l=i.fromDate,u=i.toDate,d=i.locale,f={day:na,week:ma,month:ra,year:ha,startOfWeek:function(e){return i.ISOWeek?sa(e):oa(e,{locale:d,weekStartsOn:c})},endOfWeek:function(e){return i.ISOWeek?Da(e):Ea(e,{locale:d,weekStartsOn:c})}}[n](e,r===`after`?1:-1);r===`before`&&l?f=ga([l,f]):r===`after`&&u&&(f=_a([u,f]));var p=!0;if(a){var m=$s(f,a);p=!m.disabled&&!m.hidden}return p?f:s.count>tc?s.lastFocused:nc(f,{moveBy:n,direction:r,context:i,modifiers:a,retry:Oo(Oo({},s),{count:s.count+1})})}var rc=(0,m.createContext)(void 0);function ic(e){var t=ss(),n=Us(),r=(0,m.useState)(),i=r[0],a=r[1],o=(0,m.useState)(),s=o[0],c=o[1],l=ec(t.displayMonths,n),u=i??(s&&t.isDateDisplayed(s))?s:l,d=function(){c(i),a(void 0)},f=function(e){a(e)},p=qo(),h=function(e,r){if(i){var a=nc(i,{moveBy:e,direction:r,context:p,modifiers:n});va(i,a)||(t.goToDate(a,i),f(a))}},g={focusedDay:i,focusTarget:u,blur:d,focus:f,focusDayAfter:function(){return h(`day`,`after`)},focusDayBefore:function(){return h(`day`,`before`)},focusWeekAfter:function(){return h(`week`,`after`)},focusWeekBefore:function(){return h(`week`,`before`)},focusMonthBefore:function(){return h(`month`,`before`)},focusMonthAfter:function(){return h(`month`,`after`)},focusYearBefore:function(){return h(`year`,`before`)},focusYearAfter:function(){return h(`year`,`after`)},focusStartOfWeek:function(){return h(`startOfWeek`,`before`)},focusEndOfWeek:function(){return h(`endOfWeek`,`after`)}};return(0,z.jsx)(rc.Provider,{value:g,children:e.children})}function ac(){var e=(0,m.useContext)(rc);if(!e)throw Error(`useFocusContext must be used within a FocusProvider`);return e}function oc(e,t){return $s(e,Us(),t)}var sc=(0,m.createContext)(void 0);function cc(e){return No(e.initialProps)?(0,z.jsx)(lc,{initialProps:e.initialProps,children:e.children}):(0,z.jsx)(sc.Provider,{value:{selected:void 0},children:e.children})}function lc(e){var t=e.initialProps,n=e.children,r={selected:t.selected,onDayClick:function(e,n,r){var i,a,o;if((i=t.onDayClick)==null||i.call(t,e,n,r),n.selected&&!t.required){(a=t.onSelect)==null||a.call(t,void 0,e,n,r);return}(o=t.onSelect)==null||o.call(t,e,e,n,r)}};return(0,z.jsx)(sc.Provider,{value:r,children:n})}function uc(){var e=(0,m.useContext)(sc);if(!e)throw Error(`useSelectSingle must be used within a SelectSingleProvider`);return e}function dc(e,t){var n=qo(),r=uc(),i=Cs(),a=Os(),o=ac(),s=o.focusDayAfter,c=o.focusDayBefore,l=o.focusWeekAfter,u=o.focusWeekBefore,d=o.blur,f=o.focus,p=o.focusMonthBefore,m=o.focusMonthAfter,h=o.focusYearBefore,g=o.focusYearAfter,_=o.focusStartOfWeek,v=o.focusEndOfWeek;return{onClick:function(o){var s,c,l,u;No(n)?(s=r.onDayClick)==null||s.call(r,e,t,o):jo(n)?(c=i.onDayClick)==null||c.call(i,e,t,o):Mo(n)?(l=a.onDayClick)==null||l.call(a,e,t,o):(u=n.onDayClick)==null||u.call(n,e,t,o)},onFocus:function(r){var i;f(e),(i=n.onDayFocus)==null||i.call(n,e,t,r)},onBlur:function(r){var i;d(),(i=n.onDayBlur)==null||i.call(n,e,t,r)},onKeyDown:function(r){var i;switch(r.key){case`ArrowLeft`:r.preventDefault(),r.stopPropagation(),n.dir===`rtl`?s():c();break;case`ArrowRight`:r.preventDefault(),r.stopPropagation(),n.dir===`rtl`?c():s();break;case`ArrowDown`:r.preventDefault(),r.stopPropagation(),l();break;case`ArrowUp`:r.preventDefault(),r.stopPropagation(),u();break;case`PageUp`:r.preventDefault(),r.stopPropagation(),r.shiftKey?h():p();break;case`PageDown`:r.preventDefault(),r.stopPropagation(),r.shiftKey?g():m();break;case`Home`:r.preventDefault(),r.stopPropagation(),_();break;case`End`:r.preventDefault(),r.stopPropagation(),v();break}(i=n.onDayKeyDown)==null||i.call(n,e,t,r)},onKeyUp:function(r){var i;(i=n.onDayKeyUp)==null||i.call(n,e,t,r)},onMouseEnter:function(r){var i;(i=n.onDayMouseEnter)==null||i.call(n,e,t,r)},onMouseLeave:function(r){var i;(i=n.onDayMouseLeave)==null||i.call(n,e,t,r)},onPointerEnter:function(r){var i;(i=n.onDayPointerEnter)==null||i.call(n,e,t,r)},onPointerLeave:function(r){var i;(i=n.onDayPointerLeave)==null||i.call(n,e,t,r)},onTouchCancel:function(r){var i;(i=n.onDayTouchCancel)==null||i.call(n,e,t,r)},onTouchEnd:function(r){var i;(i=n.onDayTouchEnd)==null||i.call(n,e,t,r)},onTouchMove:function(r){var i;(i=n.onDayTouchMove)==null||i.call(n,e,t,r)},onTouchStart:function(r){var i;(i=n.onDayTouchStart)==null||i.call(n,e,t,r)}}}function fc(){var e=qo(),t=uc(),n=Cs(),r=Os();return No(e)?t.selected:jo(e)?n.selected:Mo(e)?r.selected:void 0}function pc(e){return Object.values(js).includes(e)}function mc(e,t){var n=[e.classNames.day];return Object.keys(t).forEach(function(t){var r=e.modifiersClassNames[t];if(r)n.push(r);else if(pc(t)){var i=e.classNames[`day_${t}`];i&&n.push(i)}}),n}function hc(e,t){var n=Oo({},e.styles.day);return Object.keys(t).forEach(function(t){n=Oo(Oo({},n),e.modifiersStyles?.[t])}),n}function gc(e,t,n){var r,i=qo(),a=ac(),o=oc(e,t),s=dc(e,o),c=fc(),l=!!(i.onDayClick||i.mode!=="default");(0,m.useEffect)(function(){var t;o.outside||a.focusedDay&&l&&va(a.focusedDay,e)&&((t=n.current)==null||t.focus())},[a.focusedDay,e,n,l,o.outside]);var u=mc(i,o).join(` `),d=hc(i,o),f=!!(o.outside&&!i.showOutsideDays||o.hidden),p={style:d,className:u,children:(0,z.jsx)(i.components?.DayContent??ys,{date:e,displayMonth:t,activeModifiers:o}),role:`gridcell`},h=a.focusTarget&&va(a.focusTarget,e)&&!o.outside,g=a.focusedDay&&va(a.focusedDay,e);return{isButton:l,isHidden:f,activeModifiers:o,selectedDays:c,buttonProps:Oo(Oo(Oo({},p),(r={disabled:o.disabled,role:`gridcell`},r[`aria-selected`]=o.selected,r.tabIndex=g||h?0:-1,r)),s),divProps:p}}function _c(e){var t=(0,m.useRef)(null),n=gc(e.date,e.displayMonth,t);return n.isHidden?(0,z.jsx)(`div`,{role:`gridcell`}):n.isButton?(0,z.jsx)(ds,Oo({name:`day`,ref:t},n.buttonProps)):(0,z.jsx)(`div`,Oo({},n.divProps))}function vc(e){var t=e.number,n=e.dates,r=qo(),i=r.onWeekNumberClick,a=r.styles,o=r.classNames,s=r.locale,c=r.labels.labelWeekNumber,l=r.formatters.formatWeekNumber,u=l(Number(t),{locale:s});if(!i)return(0,z.jsx)(`span`,{className:o.weeknumber,style:a.weeknumber,children:u});var d=c(Number(t),{locale:s});return(0,z.jsx)(ds,{name:`week-number`,"aria-label":d,className:o.weeknumber,style:a.weeknumber,onClick:function(e){i(t,n,e)},children:u})}function yc(e){var t=qo(),n=t.styles,r=t.classNames,i=t.showWeekNumber,a=t.components,o=a?.Day??_c,s=a?.WeekNumber??vc,c;return i&&(c=(0,z.jsx)(`td`,{className:r.cell,style:n.cell,children:(0,z.jsx)(s,{number:e.weekNumber,dates:e.dates})})),(0,z.jsxs)(`tr`,{className:r.row,style:n.row,children:[c,e.dates.map(function(t){return(0,z.jsx)(`td`,{className:r.cell,style:n.cell,role:`presentation`,children:(0,z.jsx)(o,{displayMonth:e.displayMonth,date:t})},vo(t))})]})}function bc(e,t,n){for(var r=n?.ISOWeek?Da(t):Ea(t,n),i=n?.ISOWeek?sa(e):oa(e,n),a=fa(r,i),o=[],s=0;s<=a;s++)o.push(na(i,s));return o.reduce(function(e,t){var r=n?.ISOWeek?Ha(t):Ga(t,n),i=e.find(function(e){return e.weekNumber===r});return i?(i.dates.push(t),e):(e.push({weekNumber:r,dates:[t]}),e)},[])}function xc(e,t){var n=bc(wa(e),Ca(e),t);if(t?.useFixedWeeks){var r=bo(e,t);if(r<6){var i=n[n.length-1],a=i.dates[i.dates.length-1],o=ma(a,6-r),s=bc(ma(a,1),o,t);n.push.apply(n,s)}}return n}function Sc(e){var t=qo(),n=t.locale,r=t.classNames,i=t.styles,a=t.hideHead,o=t.fixedWeeks,s=t.components,c=t.weekStartsOn,l=t.firstWeekContainsDate,u=t.ISOWeek,d=xc(e.displayMonth,{useFixedWeeks:!!o,ISOWeek:u,locale:n,weekStartsOn:c,firstWeekContainsDate:l}),f=s?.Head??vs,p=s?.Row??yc,m=s?.Footer??hs;return(0,z.jsxs)(`table`,{id:e.id,className:r.table,style:i.table,role:`grid`,"aria-labelledby":e[`aria-labelledby`],children:[!a&&(0,z.jsx)(f,{}),(0,z.jsx)(`tbody`,{className:r.tbody,style:i.tbody,children:d.map(function(t){return(0,z.jsx)(p,{displayMonth:e.displayMonth,dates:t.dates,weekNumber:t.weekNumber},t.weekNumber)})}),(0,z.jsx)(m,{displayMonth:e.displayMonth})]})}function Cc(){return!!(typeof window<`u`&&window.document&&window.document.createElement)}var wc=Cc()?m.useLayoutEffect:m.useEffect,Tc=!1,Ec=0;function Dc(){return`react-day-picker-${++Ec}`}function Oc(e){var t=(0,m.useState)(e??(Tc?Dc():null)),n=t[0],r=t[1];return wc(function(){n===null&&r(Dc())},[]),(0,m.useEffect)(function(){Tc===!1&&(Tc=!0)},[]),e??n??void 0}function kc(e){var t,n=qo(),r=n.dir,i=n.classNames,a=n.styles,o=n.components,s=ss().displayMonths,c=Oc(n.id?`${n.id}-${e.displayIndex}`:void 0),l=n.id?`${n.id}-grid-${e.displayIndex}`:void 0,u=[i.month],d=a.month,f=e.displayIndex===0,p=e.displayIndex===s.length-1,m=!f&&!p;r===`rtl`&&(t=[f,p],p=t[0],f=t[1]),f&&(u.push(i.caption_start),d=Oo(Oo({},d),a.caption_start)),p&&(u.push(i.caption_end),d=Oo(Oo({},d),a.caption_end)),m&&(u.push(i.caption_between),d=Oo(Oo({},d),a.caption_between));var h=o?.Caption??ms;return(0,z.jsxs)(`div`,{className:u.join(` `),style:d,children:[(0,z.jsx)(h,{id:c,displayMonth:e.displayMonth,displayIndex:e.displayIndex}),(0,z.jsx)(Sc,{id:l,"aria-labelledby":c,displayMonth:e.displayMonth})]},e.displayIndex)}function Ac(e){var t=qo(),n=t.classNames,r=t.styles;return(0,z.jsx)(`div`,{className:n.months,style:r.months,children:e.children})}function jc(e){var t=e.initialProps,n=qo(),r=ac(),i=ss(),a=(0,m.useState)(!1),o=a[0],s=a[1];(0,m.useEffect)(function(){n.initialFocus&&r.focusTarget&&(o||(r.focus(r.focusTarget),s(!0)))},[n.initialFocus,o,r.focus,r.focusTarget,r]);var c=[n.classNames.root,n.className];n.numberOfMonths>1&&c.push(n.classNames.multiple_months),n.showWeekNumber&&c.push(n.classNames.with_weeknumber);var l=Oo(Oo({},n.styles.root),n.style),u=Object.keys(t).filter(function(e){return e.startsWith(`data-`)}).reduce(function(e,n){var r;return Oo(Oo({},e),(r={},r[n]=t[n],r))},{}),d=t.components?.Months??Ac;return(0,z.jsx)(`div`,Oo({className:c.join(` `),style:l,dir:n.dir,id:n.id,nonce:t.nonce,title:t.title,lang:t.lang},u,{children:(0,z.jsx)(d,{children:i.displayMonths.map(function(e,t){return(0,z.jsx)(kc,{displayIndex:t,displayMonth:e},t)})})}))}function Mc(e){var t=e.children,n=ko(e,[`children`]);return(0,z.jsx)(Ko,{initialProps:n,children:(0,z.jsx)(os,{children:(0,z.jsx)(cc,{initialProps:n,children:(0,z.jsx)(xs,{initialProps:n,children:(0,z.jsx)(Es,{initialProps:n,children:(0,z.jsx)(Hs,{children:(0,z.jsx)(ic,{children:t})})})})})})})}function Nc(e){return(0,z.jsx)(Mc,Oo({},e,{children:(0,z.jsx)(jc,{initialProps:e})}))}function Pc({className:e,classNames:t,showOutsideDays:n=!0,...r}){return(0,z.jsx)(Nc,{showOutsideDays:n,className:et(`p-3`,e),classNames:{months:`flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0`,month:`space-y-4`,caption:`flex justify-center pt-1 relative items-center w-full`,caption_label:`text-sm font-medium`,nav:`space-x-1 flex items-center`,nav_button:et($t({variant:`outline`}),`h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100`),nav_button_previous:`absolute left-1`,nav_button_next:`absolute right-1`,table:`w-full border-collapse space-y-1`,head_row:`flex`,head_cell:`text-muted-foreground rounded-md w-9 font-normal text-[0.8rem]`,row:`flex w-full mt-2`,cell:et(`h-9 w-9 text-center text-sm p-0 relative focus-within:relative focus-within:z-20 [&:has([aria-selected])]:bg-accent/10`,r.mode===`range`?`[&:has(>.day-range-end)]:rounded-r-md [&:has(>.day-range-start)]:rounded-l-md first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md`:`[&:has([aria-selected])]:rounded-md`),day:et($t({variant:`ghost`}),`h-9 w-9 p-0 font-normal aria-selected:opacity-100`),day_range_start:`day-range-start`,day_range_end:`day-range-end`,day_selected:`bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground`,day_today:`bg-accent/10 text-foreground`,day_outside:`day-outside text-muted-foreground opacity-50 aria-selected:bg-transparent aria-selected:opacity-100 aria-selected:text-foreground`,day_disabled:`text-muted-foreground opacity-50`,day_range_middle:`aria-selected:bg-transparent aria-selected:text-foreground`,day_hidden:`invisible`,...t},components:{IconLeft:()=>(0,z.jsx)(Ji,{className:`h-4 w-4`}),IconRight:()=>(0,z.jsx)(qi,{className:`h-4 w-4`})},...r})}var Fc=e=>(0,z.jsx)(`svg`,{viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`,...e,children:(0,z.jsx)(`path`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M20 6L9 17l-5-5`})});function Ic(e){let t=m.useRef({value:e,previous:e});return m.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}function Lc(e){let[t,n]=m.useState(void 0);return vt(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{if(!Array.isArray(t)||!t.length)return;let r=t[0],i,a;if(`borderBoxSize`in r){let e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;i=t.inlineSize,a=t.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return t.observe(e,{box:`border-box`}),()=>t.unobserve(e)}else n(void 0)},[e]),t}var Rc=`Checkbox`,[zc,Bc]=it(Rc),[Vc,Hc]=zc(Rc);function Uc(e){let{__scopeCheckbox:t,checked:n,children:r,defaultChecked:i,disabled:a,form:o,name:s,onCheckedChange:c,required:l,value:u=`on`,internal_do_not_use_render:d}=e,[f,p]=bt({prop:n,defaultProp:i??!1,onChange:c,caller:Rc}),[h,g]=m.useState(null),[_,v]=m.useState(null),y=m.useRef(!1),b=h?!!o||!!h.closest(`form`):!0,x={checked:f,disabled:a,setChecked:p,control:h,setControl:g,name:s,form:o,value:u,hasConsumerStoppedPropagationRef:y,required:l,defaultChecked:Qc(i)?!1:i,isFormControl:b,bubbleInput:_,setBubbleInput:v};return(0,z.jsx)(Vc,{scope:t,...x,children:Zc(d)?d(x):r})}var Wc=`CheckboxTrigger`,Gc=m.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:n,...r},i)=>{let{control:a,value:o,disabled:s,checked:c,required:l,setControl:u,setChecked:d,hasConsumerStoppedPropagationRef:f,isFormControl:p,bubbleInput:h}=Hc(Wc,e),g=ct(i,u),_=m.useRef(c);return m.useEffect(()=>{let e=a?.form;if(e){let t=()=>d(_.current);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[a,d]),(0,z.jsx)(Et.button,{type:`button`,role:`checkbox`,"aria-checked":Qc(c)?`mixed`:c,"aria-required":l,"data-state":$c(c),"data-disabled":s?``:void 0,disabled:s,value:o,...r,ref:g,onKeyDown:_t(t,e=>{e.key===`Enter`&&e.preventDefault()}),onClick:_t(n,e=>{d(e=>Qc(e)?!0:!e),h&&p&&(f.current=e.isPropagationStopped(),f.current||e.stopPropagation())})})});Gc.displayName=Wc;var Kc=m.forwardRef((e,t)=>{let{__scopeCheckbox:n,name:r,checked:i,defaultChecked:a,required:o,disabled:s,value:c,onCheckedChange:l,form:u,...d}=e;return(0,z.jsx)(Uc,{__scopeCheckbox:n,checked:i,defaultChecked:a,disabled:s,required:o,onCheckedChange:l,name:r,form:u,value:c,internal_do_not_use_render:({isFormControl:e})=>(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(Gc,{...d,ref:t,__scopeCheckbox:n}),e&&(0,z.jsx)(Xc,{__scopeCheckbox:n})]})})});Kc.displayName=Rc;var qc=`CheckboxIndicator`,Jc=m.forwardRef((e,t)=>{let{__scopeCheckbox:n,forceMount:r,...i}=e,a=Hc(qc,n);return(0,z.jsx)(kt,{present:r||Qc(a.checked)||a.checked===!0,children:(0,z.jsx)(Et.span,{"data-state":$c(a.checked),"data-disabled":a.disabled?``:void 0,...i,ref:t,style:{pointerEvents:`none`,...e.style}})})});Jc.displayName=qc;var Yc=`CheckboxBubbleInput`,Xc=m.forwardRef(({__scopeCheckbox:e,...t},n)=>{let{control:r,hasConsumerStoppedPropagationRef:i,checked:a,defaultChecked:o,required:s,disabled:c,name:l,value:u,form:d,bubbleInput:f,setBubbleInput:p}=Hc(Yc,e),h=ct(n,p),g=Ic(a),_=Lc(r);m.useEffect(()=>{let e=f;if(!e)return;let t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,`checked`).set,r=!i.current;if(g!==a&&n){let t=new Event(`click`,{bubbles:r});e.indeterminate=Qc(a),n.call(e,Qc(a)?!1:a),e.dispatchEvent(t)}},[f,g,a,i]);let v=m.useRef(Qc(a)?!1:a);return(0,z.jsx)(Et.input,{type:`checkbox`,"aria-hidden":!0,defaultChecked:o??v.current,required:s,disabled:c,name:l,value:u,form:d,...t,tabIndex:-1,ref:h,style:{...t.style,..._,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0,transform:`translateX(-100%)`}})});Xc.displayName=Yc;function Zc(e){return typeof e==`function`}function Qc(e){return e===`indeterminate`}function $c(e){return Qc(e)?`indeterminate`:e?`checked`:`unchecked`}var el=m.forwardRef(({className:e,name:t,checked:n,value:r,defaultChecked:i,onValueChange:a,onBlur:o,label:s,labelClassName:c,disabled:l,...u},d)=>{let f=r===void 0?n:r,p=m.useRef(null),h=m.useRef(null),g=m.useId();m.useImperativeHandle(d,()=>p.current);let _=e=>{a?.(e===`indeterminate`?!1:e)},v=e=>{e.preventDefault(),!l&&h.current?.click()},y=(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(`input`,{type:`checkbox`,ref:p,name:t,defaultChecked:i===!0,onBlur:o,className:`sr-only`,tabIndex:-1,"aria-hidden":`true`}),(0,z.jsx)(Kc,{ref:h,"data-slot":`checkbox`,checked:f,defaultChecked:i,onCheckedChange:_,disabled:l,"aria-labelledby":s?g:void 0,className:et(`peer border border-muted-foreground/30 bg-input-background dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50`,e),...u,children:(0,z.jsx)(Jc,{"data-slot":`checkbox-indicator`,className:`flex items-center justify-center text-current transition-none`,children:(0,z.jsx)(Fc,{className:`size-3.5`})})})]});return s?(0,z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[y,(0,z.jsx)(`button`,{type:`button`,id:g,className:et(`text-sm cursor-pointer select-none border-0 bg-transparent p-0 text-left font-[inherit] text-inherit`,l&&`cursor-not-allowed opacity-50`,c),onClick:v,disabled:l,children:s})]}):y});el.displayName=`Checkbox`;var tl={"rc.asyncSelect.loading":`Loading...`,"rc.asyncSelect.noOptions":`No options`,"rc.asyncSelect.noResults":`No results`,"rc.asyncSelect.selectPlaceholder":`Select...`,"rc.combobox.noResults":`No results`,"rc.combobox.selectPlaceholder":`Select...`,"rc.datePicker.pickDate":`Pick date`,"rc.datePicker.placeholder":`Pick date`,"rc.datePicker.selectDate":`Select date`,"rc.dateSelectorMultiple.addDate":`Add date`,"rc.dateSelectorMultiple.dateRange":`Range`,"rc.dateSelectorMultiple.placeholder":`Pick date`,"rc.dateSelectorMultiple.singleDate":`Single`,"rc.fileInput.browseFiles":`Browse files`,"rc.fileInput.dropZone":`Drag files here or click to upload`,"rc.fileInput.filePlaceholder":`File`,"rc.fileInput.imagePlaceholder":`Image`,"rc.fileInput.maxFilesExceeded":e=>`Maximum ${e} files allowed`,"rc.fileInput.pending":`Pending`,"rc.fileInput.remove":`Remove`,"rc.fileInput.uploadFailed":`Upload failed`,"rc.fileInput.uploading":`Uploading...`,"rc.monthPickerMultiple.addMonth":`Add month`,"rc.monthPickerMultiple.dateRange":`Range`,"rc.monthPickerMultiple.endDate":`End date`,"rc.monthPickerMultiple.placeholder":`Pick month`,"rc.monthPickerMultiple.singleDate":`Single`,"rc.monthPickerMultiple.startDate":`Start date`,"rc.multiSelect.clear":`Clear all`,"rc.multiSelect.close":`Close`,"rc.multiSelect.moreItems":e=>`+${e} more`,"rc.multiSelect.noOptions":`No options`,"rc.multiSelect.noOptionsSelected":`No options selected`,"rc.multiSelect.noResults":`No results`,"rc.multiSelect.optionsCount":e=>`${e} options`,"rc.multiSelect.selectAll":`Select all`,"rc.multiSelect.selectPlaceholder":`Select...`,"rc.pagination.next":`Next`,"rc.pagination.previous":`Previous`,"rc.pagination.showing":(e,t,n)=>`Showing ${e}-${t} of ${n}`,"rc.calendar.month.0":`January`,"rc.calendar.month.1":`February`,"rc.calendar.month.2":`March`,"rc.calendar.month.3":`April`,"rc.calendar.month.4":`May`,"rc.calendar.month.5":`June`,"rc.calendar.month.6":`July`,"rc.calendar.month.7":`August`,"rc.calendar.month.8":`September`,"rc.calendar.month.9":`October`,"rc.calendar.month.10":`November`,"rc.calendar.month.11":`December`,"rc.sonamuFilter.title":`Sonamu Filter`,"rc.sonamuFilter.apply":`Apply`,"rc.sonamuFilter.reset":`Reset`,"rc.sonamuFilter.addRule":`Add Rule`,"rc.sonamuFilter.noRulesYet":`No rules yet. Click "+ Add Rule" to start.`,"rc.sonamuFilter.selectField":`Select field`,"rc.sonamuFilter.selectOperator":`Operator`,"rc.sonamuFilter.selectOperatorFirst":`Select operator first`,"rc.sonamuFilter.enterValue":`Enter value`,"rc.sonamuFilter.enterNumber":`Enter number`,"rc.sonamuFilter.notSupported":`Not supported`,"rc.sonamuFilter.startDate":`Start date`,"rc.sonamuFilter.endDate":`End date`,"rc.sonamuFilter.appliedFilters":`🌲 Applied SonamuFilters`,"rc.common.cancel":`Cancel`,"rc.common.save":`Save`},nl=Object.create(null),rl=e=>({}),il=new Proxy(nl,{get(e,t){return rl()[t]??nl[t]},has(e,t){return t in rl()||t in nl},set(e,t,n){let r=rl(!0);return r[t]=n,!0},deleteProperty(e,t){if(!t)return!1;let n=rl(!0);return delete n[t],!0},ownKeys(){let e=rl(!0);return Object.keys(e)}});function al(e,t){return typeof process<`u`?{}[e]??t:typeof Deno<`u`?Deno.env.get(e)??t:typeof Bun<`u`?Bun.env[e]??t:t}Object.freeze({get BETTER_AUTH_SECRET(){return al(`BETTER_AUTH_SECRET`)},get AUTH_SECRET(){return al(`AUTH_SECRET`)},get BETTER_AUTH_TELEMETRY(){return al(`BETTER_AUTH_TELEMETRY`)},get BETTER_AUTH_TELEMETRY_ID(){return al(`BETTER_AUTH_TELEMETRY_ID`)},get NODE_ENV(){return al(`NODE_ENV`,`development`)},get PACKAGE_VERSION(){return al(`PACKAGE_VERSION`,`0.0.0`)},get BETTER_AUTH_TELEMETRY_ENDPOINT(){return al(`BETTER_AUTH_TELEMETRY_ENDPOINT`,``)}});function ol(){let e=Object.getOwnPropertyDescriptor(Error,`stackTraceLimit`);return e===void 0?Object.isExtensible(Error):Object.prototype.hasOwnProperty.call(e,`writable`)?e.writable:e.set!==void 0}function sl(e){let t=e.split(`
|
|
46
46
|
at `);return t.length<=1?e:(t.splice(1,1),t.join(`
|
|
47
|
-
at `))}function cl(e,t){class n extends e{#e;constructor(...e){if(ol()){let t=Error.stackTraceLimit;Error.stackTraceLimit=0,super(...e),Error.stackTraceLimit=t}else super(...e);let t=Error().stack;t&&(this.#e=sl(t.replace(/^Error/,this.name)))}get errorStack(){return this.#e}}return Object.defineProperty(n.prototype,"constructor",{get(){return t},enumerable:!1,configurable:!0}),n}var ll={OK:200,CREATED:201,ACCEPTED:202,NO_CONTENT:204,MULTIPLE_CHOICES:300,MOVED_PERMANENTLY:301,FOUND:302,SEE_OTHER:303,NOT_MODIFIED:304,TEMPORARY_REDIRECT:307,BAD_REQUEST:400,UNAUTHORIZED:401,PAYMENT_REQUIRED:402,FORBIDDEN:403,NOT_FOUND:404,METHOD_NOT_ALLOWED:405,NOT_ACCEPTABLE:406,PROXY_AUTHENTICATION_REQUIRED:407,REQUEST_TIMEOUT:408,CONFLICT:409,GONE:410,LENGTH_REQUIRED:411,PRECONDITION_FAILED:412,PAYLOAD_TOO_LARGE:413,URI_TOO_LONG:414,UNSUPPORTED_MEDIA_TYPE:415,RANGE_NOT_SATISFIABLE:416,EXPECTATION_FAILED:417,"I'M_A_TEAPOT":418,MISDIRECTED_REQUEST:421,UNPROCESSABLE_ENTITY:422,LOCKED:423,FAILED_DEPENDENCY:424,TOO_EARLY:425,UPGRADE_REQUIRED:426,PRECONDITION_REQUIRED:428,TOO_MANY_REQUESTS:429,REQUEST_HEADER_FIELDS_TOO_LARGE:431,UNAVAILABLE_FOR_LEGAL_REASONS:451,INTERNAL_SERVER_ERROR:500,NOT_IMPLEMENTED:501,BAD_GATEWAY:502,SERVICE_UNAVAILABLE:503,GATEWAY_TIMEOUT:504,HTTP_VERSION_NOT_SUPPORTED:505,VARIANT_ALSO_NEGOTIATES:506,INSUFFICIENT_STORAGE:507,LOOP_DETECTED:508,NOT_EXTENDED:510,NETWORK_AUTHENTICATION_REQUIRED:511};cl(class extends Error{constructor(e=`INTERNAL_SERVER_ERROR`,t=void 0,n={},r=typeof e==`number`?e:ll[e]){super(t?.message,t?.cause?{cause:t.cause}:void 0),this.status=e,this.body=t,this.headers=n,this.statusCode=r,this.name=`APIError`,this.status=e,this.headers=n,this.statusCode=r,this.body=t}},Error);var ul=class extends Error{constructor(e,t){super(e,t),this.name=`BetterAuthError`,this.message=e,this.stack=``}};function dl(e){try{return(new URL(e).pathname.replace(/\/+$/,``)||`/`)!==`/`}catch{throw new ul(`Invalid base URL: ${e}. Please provide a valid base URL.`)}}function fl(e){try{let t=new URL(e);if(t.protocol!==`http:`&&t.protocol!==`https:`)throw new ul(`Invalid base URL: ${e}. URL must include 'http://' or 'https://'`)}catch(t){throw t instanceof ul?t:new ul(`Invalid base URL: ${e}. Please provide a valid base URL.`,{cause:t})}}function pl(e,t=`/api/auth`){if(fl(e),dl(e))return e;let n=e.replace(/\/+$/,``);return!t||t===`/`?n:(t=t.startsWith(`/`)?t:`/${t}`,`${n}${t}`)}function ml(e,t){return!e||e.trim()===``?!1:t===`proto`?e===`http`||e===`https`:t===`host`?[/\.\./,/\0/,/[\s]/,/^[.]/,/[<>'"]/,/javascript:/i,/file:/i,/data:/i].some(t=>t.test(e))?!1:/^[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(\.[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*(:[0-9]{1,5})?$/.test(e)||/^(\d{1,3}\.){3}\d{1,3}(:[0-9]{1,5})?$/.test(e)||/^\[[0-9a-fA-F:]+\](:[0-9]{1,5})?$/.test(e)||/^localhost(:[0-9]{1,5})?$/i.test(e):!1}function hl(e,t,n,r,i){if(e)return pl(e,t);if(r!==!1){let e=il.BETTER_AUTH_URL||il.NEXT_PUBLIC_BETTER_AUTH_URL||il.PUBLIC_BETTER_AUTH_URL||il.NUXT_PUBLIC_BETTER_AUTH_URL||il.NUXT_PUBLIC_AUTH_URL||(il.BASE_URL===`/`?void 0:il.BASE_URL);if(e)return pl(e,t)}let a=n?.headers.get(`x-forwarded-host`),o=n?.headers.get(`x-forwarded-proto`);if(a&&o&&i&&ml(o,`proto`)&&ml(a,`host`))try{return pl(`${o}://${a}`,t)}catch{}if(n){let e=gl(n.url);if(!e)throw new ul(`Could not get origin from request. Please provide a valid base URL.`);return pl(e,t)}if(typeof window<`u`&&window.location)return pl(window.location.origin,t)}function gl(e){try{let t=new URL(e);return t.origin===`null`?null:t.origin}catch{return null}}var _l={proto:/"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/,constructor:/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/,protoShort:/"__proto__"\s*:/,constructorShort:/"constructor"\s*:/},vl=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/,yl={true:!0,false:!1,null:null,undefined:void 0,nan:NaN,infinity:1/0,"-infinity":-1/0},bl=/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})(?:\.(\d{1,7}))?(?:Z|([+-])(\d{2}):(\d{2}))$/;function xl(e){return e instanceof Date&&!isNaN(e.getTime())}function Sl(e){let t=bl.exec(e);if(!t)return null;let[,n,r,i,a,o,s,c,l,u,d]=t,f=new Date(Date.UTC(parseInt(n,10),parseInt(r,10)-1,parseInt(i,10),parseInt(a,10),parseInt(o,10),parseInt(s,10),c?parseInt(c.padEnd(3,`0`),10):0));if(l){let e=(parseInt(u,10)*60+parseInt(d,10))*(l===`+`?-1:1);f.setUTCMinutes(f.getUTCMinutes()+e)}return xl(f)?f:null}function Cl(e,t={}){let{strict:n=!1,warnings:r=!1,reviver:i,parseDates:a=!0}=t;if(typeof e!=`string`)return e;let o=e.trim();if(o.length>0&&o[0]===`"`&&o.endsWith(`"`)&&!o.slice(1,-1).includes(`"`))return o.slice(1,-1);let s=o.toLowerCase();if(s.length<=9&&s in yl)return yl[s];if(!vl.test(o)){if(n)throw SyntaxError(`[better-json] Invalid JSON`);return e}if(Object.entries(_l).some(([e,t])=>{let n=t.test(o);return n&&r&&console.warn(`[better-json] Detected potential prototype pollution attempt using ${e} pattern`),n})&&n)throw Error(`[better-json] Potential prototype pollution attempt detected`);try{return JSON.parse(o,(e,t)=>{if(e===`__proto__`||e===`constructor`&&t&&typeof t==`object`&&`prototype`in t){r&&console.warn(`[better-json] Dropping "${e}" key to prevent prototype pollution`);return}if(a&&typeof t==`string`){let e=Sl(t);if(e)return e}return i?i(e,t):t})}catch(t){if(n)throw t;return e}}function wl(e,t={strict:!0}){return Cl(e,t)}var Tl={id:`redirect`,name:`Redirect`,hooks:{onSuccess(e){if(e.data?.url&&e.data?.redirect&&typeof window<`u`&&window.location&&window.location)try{window.location.href=e.data.url}catch{}}}},El=[],Dl=0,Ol=4,kl=0,Al=e=>{let t=[],n={get(){return n.lc||n.listen(()=>{})(),n.value},init:e,lc:0,listen(e){return n.lc=t.push(e),()=>{for(let t=Dl+Ol;t<El.length;)El[t]===e?El.splice(t,Ol):t+=Ol;let r=t.indexOf(e);~r&&(t.splice(r,1),--n.lc||n.off())}},notify(e,r){kl++;let i=!El.length;for(let i of t)El.push(i,n.value,e,r);if(i){for(Dl=0;Dl<El.length;Dl+=Ol)El[Dl](El[Dl+1],El[Dl+2],El[Dl+3]);El.length=0}},off(){},set(e){let t=n.value;t!==e&&(n.value=e,n.notify(t))},subscribe(e){let t=n.listen(e);return e(n.value),t},value:e};return n},jl=5,Ml=6,Nl=10,Pl=(e,t,n,r)=>(e.events=e.events||{},e.events[n+Nl]||(e.events[n+Nl]=r(t=>{e.events[n].reduceRight((e,t)=>(t(e),e),{shared:{},...t})})),e.events[n]=e.events[n]||[],e.events[n].push(t),()=>{let r=e.events[n],i=r.indexOf(t);r.splice(i,1),r.length||(delete e.events[n],e.events[n+Nl](),delete e.events[n+Nl])}),Fl=1e3,Il=(e,t)=>Pl(e,n=>{let r=t(n);r&&e.events[Ml].push(r)},jl,t=>{let n=e.listen;e.listen=(...r)=>(!e.lc&&!e.active&&(e.active=!0,t()),n(...r));let r=e.off;return e.events[Ml]=[],e.off=()=>{r(),setTimeout(()=>{if(e.active&&!e.lc){e.active=!1;for(let t of e.events[Ml])t();e.events[Ml]=[]}},Fl)},()=>{e.listen=n,e.off=r}});function Ll(e,t,n){let r=new Set(t).add(void 0);return e.listen((e,t,i)=>{r.has(i)&&n(e,t,i)})}var Rl=()=>typeof window>`u`,zl=(e,t,n,r)=>{let i=Al({data:null,error:null,isPending:!0,isRefetching:!1,refetch:e=>a(e)}),a=async e=>new Promise(a=>{let o=typeof r==`function`?r({data:i.get().data,error:i.get().error,isPending:i.get().isPending}):r;n(t,{...o,query:{...o?.query,...e?.query},async onSuccess(e){i.set({data:e.data,error:null,isPending:!1,isRefetching:!1,refetch:i.value.refetch}),await o?.onSuccess?.(e)},async onError(e){let{request:t}=e,n=typeof t.retry==`number`?t.retry:t.retry?.attempts,r=t.retryAttempt||0;if(n&&r<n)return;let a=e.error.status===401;i.set({error:e.error,data:a?null:i.get().data,isPending:!1,isRefetching:!1,refetch:i.value.refetch}),await o?.onError?.(e)},async onRequest(e){let t=i.get();i.set({isPending:t.data===null,data:t.data,error:null,isRefetching:!0,refetch:i.value.refetch}),await o?.onRequest?.(e)}}).catch(e=>{i.set({error:e,data:i.get().data,isPending:!1,isRefetching:!1,refetch:i.value.refetch})}).finally(()=>{a(void 0)})});e=Array.isArray(e)?e:[e];let o=!1;for(let t of e)t.subscribe(async()=>{Rl()||(o?await a():Il(i,()=>{let e=setTimeout(async()=>{o||=(await a(),!0)},0);return()=>{i.off(),t.off(),clearTimeout(e)}}))});return i},Bl=Symbol.for(`better-auth:broadcast-channel`),Vl=()=>Math.floor(Date.now()/1e3),Hl=class{listeners=new Set;name;constructor(e=`better-auth.message`){this.name=e}subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}post(e){if(!(typeof window>`u`))try{localStorage.setItem(this.name,JSON.stringify({...e,timestamp:Vl()}))}catch{}}setup(){if(typeof window>`u`||window.addEventListener===void 0)return()=>{};let e=e=>{if(e.key!==this.name)return;let t=JSON.parse(e.newValue??`{}`);t?.event!==`session`||!t?.data||this.listeners.forEach(e=>e(t))};return window.addEventListener(`storage`,e),()=>{window.removeEventListener(`storage`,e)}}};function Ul(e=`better-auth.message`){return globalThis[Bl]||(globalThis[Bl]=new Hl(e)),globalThis[Bl]}var Wl=Symbol.for(`better-auth:focus-manager`),Gl=class{listeners=new Set;subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}setFocused(e){this.listeners.forEach(t=>t(e))}setup(){if(typeof window>`u`||typeof document>`u`||window.addEventListener===void 0)return()=>{};let e=()=>{document.visibilityState===`visible`&&this.setFocused(!0)};return document.addEventListener(`visibilitychange`,e,!1),()=>{document.removeEventListener(`visibilitychange`,e,!1)}}};function Kl(){return globalThis[Wl]||(globalThis[Wl]=new Gl),globalThis[Wl]}var ql=Symbol.for(`better-auth:online-manager`),Jl=class{listeners=new Set;isOnline=typeof navigator<`u`?navigator.onLine:!0;subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}setOnline(e){this.isOnline=e,this.listeners.forEach(t=>t(e))}setup(){if(typeof window>`u`||window.addEventListener===void 0)return()=>{};let e=()=>this.setOnline(!0),t=()=>this.setOnline(!1);return window.addEventListener(`online`,e,!1),window.addEventListener(`offline`,t,!1),()=>{window.removeEventListener(`online`,e,!1),window.removeEventListener(`offline`,t,!1)}}};function Yl(){return globalThis[ql]||(globalThis[ql]=new Jl),globalThis[ql]}var Xl=()=>Math.floor(Date.now()/1e3);function Zl(e){return typeof e==`object`&&e&&`data`in e&&`error`in e?e:{data:e,error:null}}var Ql=5;function $l(e){let{sessionAtom:t,sessionSignal:n,$fetch:r,options:i={}}=e,a=i.sessionOptions?.refetchInterval??0,o=i.sessionOptions?.refetchOnWindowFocus??!0,s=i.sessionOptions?.refetchWhenOffline??!1,c={lastSync:0,lastSessionRequest:0,cachedSession:void 0},l=()=>s||Yl().isOnline,u=e=>{if(!l())return;if(e?.event===`storage`){c.lastSync=Xl(),n.set(!n.get());return}let i=t.get(),a=()=>{c.lastSessionRequest=Xl(),r(`/get-session`).then(async e=>{let{data:a,error:o}=Zl(e);if(a?.needsRefresh)try{let e=await r(`/get-session`,{method:`POST`});({data:a,error:o}=Zl(e))}catch{}let s=a?.session&&a?.user?a:null;t.set({...i,data:s,error:o}),c.lastSync=Xl(),n.set(!n.get())}).catch(()=>{})};if(e?.event===`poll`){a();return}if(e?.event===`visibilitychange`){if(Xl()-c.lastSessionRequest<Ql)return;c.lastSessionRequest=Xl()}if(e?.event===`visibilitychange`){a();return}(i?.data===null||i?.data===void 0)&&(c.lastSync=Xl(),n.set(!n.get()))},d=e=>{Ul().post({event:`session`,data:{trigger:e},clientId:Math.random().toString(36).substring(7)})},f=()=>{a&&a>0&&(c.pollInterval=setInterval(()=>{t.get()?.data&&u({event:`poll`})},a*1e3))},p=()=>{c.unsubscribeBroadcast=Ul().subscribe(()=>{u({event:`storage`})})},m=()=>{o&&(c.unsubscribeFocus=Kl().subscribe(()=>{u({event:`visibilitychange`})}))},h=()=>{c.unsubscribeOnline=Yl().subscribe(e=>{e&&u({event:`visibilitychange`})})};return{init:()=>{f(),p(),m(),h(),Ul().setup(),Kl().setup(),Yl().setup()},cleanup:()=>{c.pollInterval&&=(clearInterval(c.pollInterval),void 0),c.unsubscribeBroadcast&&=(c.unsubscribeBroadcast(),void 0),c.unsubscribeFocus&&=(c.unsubscribeFocus(),void 0),c.unsubscribeOnline&&=(c.unsubscribeOnline(),void 0),c.lastSync=0,c.lastSessionRequest=0,c.cachedSession=void 0},triggerRefetch:u,broadcastSessionUpdate:d}}function eu(e,t){let n=Al(!1),r=zl(n,`/get-session`,e,{method:`GET`}),i=()=>{};return Il(r,()=>{let a=$l({sessionAtom:r,sessionSignal:n,$fetch:e,options:t});return a.init(),i=a.broadcastSessionUpdate,()=>{a.cleanup()}}),{session:r,$sessionSignal:n,broadcastSessionUpdate:e=>i(e)}}function tu(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return t!==null&&t!==Object.prototype&&Object.getPrototypeOf(t)!==null||Symbol.iterator in e?!1:Symbol.toStringTag in e?Object.prototype.toString.call(e)===`[object Module]`:!0}function nu(e,t,n=`.`,r){if(!tu(t))return nu(e,{},n,r);let i={...t};for(let t of Object.keys(e)){if(t===`__proto__`||t===`constructor`)continue;let a=e[t];a!=null&&(r&&r(i,t,a,n)||(Array.isArray(a)&&Array.isArray(i[t])?i[t]=[...a,...i[t]]:tu(a)&&tu(i[t])?i[t]=nu(a,i[t],(n?`${n}.`:``)+t.toString(),r):i[t]=a))}return i}function ru(e){return(...t)=>t.reduce((t,n)=>nu(t,n,``,e),{})}var iu=ru(),au=Object.defineProperty,ou=Object.defineProperties,su=Object.getOwnPropertyDescriptors,cu=Object.getOwnPropertySymbols,lu=Object.prototype.hasOwnProperty,uu=Object.prototype.propertyIsEnumerable,du=(e,t,n)=>t in e?au(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,fu=(e,t)=>{for(var n in t||={})lu.call(t,n)&&du(e,n,t[n]);if(cu)for(var n of cu(t))uu.call(t,n)&&du(e,n,t[n]);return e},pu=(e,t)=>ou(e,su(t)),mu=class extends Error{constructor(e,t,n){super(t||e.toString(),{cause:n}),this.status=e,this.statusText=t,this.error=n,Error.captureStackTrace(this,this.constructor)}},hu=async(e,t)=>{let n=t||{},r={onRequest:[t?.onRequest],onResponse:[t?.onResponse],onSuccess:[t?.onSuccess],onError:[t?.onError],onRetry:[t?.onRetry]};if(!t||!t?.plugins)return{url:e,options:n,hooks:r};for(let i of t?.plugins||[]){if(i.init){let r=await i.init?.call(i,e.toString(),t);n=r.options||n,e=r.url}r.onRequest.push(i.hooks?.onRequest),r.onResponse.push(i.hooks?.onResponse),r.onSuccess.push(i.hooks?.onSuccess),r.onError.push(i.hooks?.onError),r.onRetry.push(i.hooks?.onRetry)}return{url:e,options:n,hooks:r}},gu=class{constructor(e){this.options=e}shouldAttemptRetry(e,t){return this.options.shouldRetry?Promise.resolve(e<this.options.attempts&&this.options.shouldRetry(t)):Promise.resolve(e<this.options.attempts)}getDelay(){return this.options.delay}},_u=class{constructor(e){this.options=e}shouldAttemptRetry(e,t){return this.options.shouldRetry?Promise.resolve(e<this.options.attempts&&this.options.shouldRetry(t)):Promise.resolve(e<this.options.attempts)}getDelay(e){return Math.min(this.options.maxDelay,this.options.baseDelay*2**e)}};function vu(e){if(typeof e==`number`)return new gu({type:`linear`,attempts:e,delay:1e3});switch(e.type){case`linear`:return new gu(e);case`exponential`:return new _u(e);default:throw Error(`Invalid retry strategy`)}}var yu=async e=>{let t={},n=async e=>typeof e==`function`?await e():e;if(e?.auth){if(e.auth.type===`Bearer`){let r=await n(e.auth.token);if(!r)return t;t.authorization=`Bearer ${r}`}else if(e.auth.type===`Basic`){let[r,i]=await Promise.all([n(e.auth.username),n(e.auth.password)]);if(!r||!i)return t;t.authorization=`Basic ${btoa(`${r}:${i}`)}`}else if(e.auth.type===`Custom`){let[r,i]=await Promise.all([n(e.auth.prefix),n(e.auth.value)]);if(!i)return t;t.authorization=`${r??``} ${i}`}}return t},bu=/^application\/(?:[\w!#$%&*.^`~-]*\+)?json(;.+)?$/i;function xu(e){let t=e.headers.get(`content-type`),n=new Set([`image/svg`,`application/xml`,`application/xhtml`,`application/html`]);if(!t)return`json`;let r=t.split(`;`).shift()||``;return bu.test(r)?`json`:n.has(r)||r.startsWith(`text/`)?`text`:`blob`}function Su(e){try{return JSON.parse(e),!0}catch{return!1}}function Cu(e){if(e===void 0)return!1;let t=typeof e;return t===`string`||t===`number`||t===`boolean`||t===null?!0:t===`object`?Array.isArray(e)?!0:e.buffer?!1:e.constructor&&e.constructor.name===`Object`||typeof e.toJSON==`function`:!1}function wu(e){try{return JSON.parse(e)}catch{return e}}function Tu(e){return typeof e==`function`}function Eu(e){if(e?.customFetchImpl)return e.customFetchImpl;if(typeof globalThis<`u`&&Tu(globalThis.fetch))return globalThis.fetch;if(typeof window<`u`&&Tu(window.fetch))return window.fetch;throw Error(`No fetch implementation found`)}async function Du(e){let t=new Headers(e?.headers),n=await yu(e);for(let[e,r]of Object.entries(n||{}))t.set(e,r);if(!t.has(`content-type`)){let n=Ou(e?.body);n&&t.set(`content-type`,n)}return t}function Ou(e){return Cu(e)?`application/json`:null}function ku(e){if(!e?.body)return null;let t=new Headers(e?.headers);if(Cu(e.body)&&!t.has(`content-type`)){for(let[t,n]of Object.entries(e?.body))n instanceof Date&&(e.body[t]=n.toISOString());return JSON.stringify(e.body)}return t.has(`content-type`)&&t.get(`content-type`)===`application/x-www-form-urlencoded`&&Cu(e.body)?new URLSearchParams(e.body).toString():e.body}function Au(e,t){if(t?.method)return t.method.toUpperCase();if(e.startsWith(`@`)){let n=e.split(`@`)[1]?.split(`/`)[0];return Pu.includes(n)?n.toUpperCase():t?.body?`POST`:`GET`}return t?.body?`POST`:`GET`}function ju(e,t){let n;return!e?.signal&&e?.timeout&&(n=setTimeout(()=>t?.abort(),e?.timeout)),{abortTimeout:n,clearTimeout:()=>{n&&clearTimeout(n)}}}var Mu=class e extends Error{constructor(t,n){super(n||JSON.stringify(t,null,2)),this.issues=t,Object.setPrototypeOf(this,e.prototype)}};async function Nu(e,t){let n=await e[`~standard`].validate(t);if(n.issues)throw new Mu(n.issues);return n.value}var Pu=[`get`,`post`,`put`,`patch`,`delete`],Fu=e=>({id:`apply-schema`,name:`Apply Schema`,version:`1.0.0`,async init(t,n){let r=e.plugins?.find(e=>e.schema?.config?t.startsWith(e.schema.config.baseURL||``)||t.startsWith(e.schema.config.prefix||``):!1)?.schema||e.schema;if(r){let e=t;r.config?.prefix&&e.startsWith(r.config.prefix)&&(e=e.replace(r.config.prefix,``),r.config.baseURL&&(t=t.replace(r.config.prefix,r.config.baseURL))),r.config?.baseURL&&e.startsWith(r.config.baseURL)&&(e=e.replace(r.config.baseURL,``));let i=r.schema[e];if(i){let e=pu(fu({},n),{method:i.method,output:i.output});return n?.disableValidation||(e=pu(fu({},e),{body:i.input?await Nu(i.input,n?.body):n?.body,params:i.params?await Nu(i.params,n?.params):n?.params,query:i.query?await Nu(i.query,n?.query):n?.query})),{url:t,options:e}}}return{url:t,options:n}}}),Iu=e=>{async function t(t,n){let r=pu(fu(fu({},e),n),{plugins:[...e?.plugins||[],Fu(e||{}),...n?.plugins||[]]});if(e?.catchAllError)try{return await Ru(t,r)}catch(e){return{data:null,error:{status:500,statusText:`Fetch Error`,message:`Fetch related error. Captured by catchAllError option. See error property for more details.`,error:e}}}return await Ru(t,r)}return t};function Lu(e,t){let{baseURL:n,params:r,query:i}=t||{query:{},params:{},baseURL:``},a=e.startsWith(`http`)?e.split(`/`).slice(0,3).join(`/`):n||``;if(e.startsWith(`@`)){let t=e.toString().split(`@`)[1].split(`/`)[0];Pu.includes(t)&&(e=e.replace(`@${t}/`,`/`))}a.endsWith(`/`)||(a+=`/`);let[o,s]=e.replace(a,``).split(`?`),c=new URLSearchParams(s);for(let[e,t]of Object.entries(i||{})){if(t==null)continue;let n;if(typeof t==`string`)n=t;else if(Array.isArray(t)){for(let n of t)c.append(e,n);continue}else n=JSON.stringify(t);c.set(e,n)}if(r)if(Array.isArray(r)){let e=o.split(`/`).filter(e=>e.startsWith(`:`));for(let[t,n]of e.entries()){let e=r[t];o=o.replace(n,e)}}else for(let[e,t]of Object.entries(r))o=o.replace(`:${e}`,String(t));o=o.split(`/`).map(encodeURIComponent).join(`/`),o.startsWith(`/`)&&(o=o.slice(1));let l=c.toString();return l=l.length>0?`?${l}`.replace(/\+/g,`%20`):``,a.startsWith(`http`)?new URL(`${o}${l}`,a):`${a}${o}${l}`}var Ru=async(e,t)=>{let{hooks:n,url:r,options:i}=await hu(e,t),a=Eu(i),o=new AbortController,s=i.signal??o.signal,c=Lu(r,i),l=ku(i),u=await Du(i),d=Au(r,i),f=pu(fu({},i),{url:c,headers:u,body:l,method:d,signal:s});for(let e of n.onRequest)if(e){let t=await e(f);typeof t==`object`&&t&&(f=t)}(`pipeTo`in f&&typeof f.pipeTo==`function`||typeof t?.body?.pipe==`function`)&&(`duplex`in f||(f.duplex=`half`));let{clearTimeout:p}=ju(i,o),m=await a(f.url,f);p();let h={response:m,request:f};for(let e of n.onResponse)if(e){let n=await e(pu(fu({},h),{response:t?.hookOptions?.cloneResponse?m.clone():m}));n instanceof Response?m=n:typeof n==`object`&&n&&(m=n.response)}if(m.ok){if(f.method===`HEAD`)return{data:``,error:null};let e=xu(m),r={data:null,response:m,request:f};if(e===`json`||e===`text`){let e=await m.text();r.data=await(f.jsonParser??wu)(e)}else r.data=await m[e]();f?.output&&f.output&&!f.disableValidation&&(r.data=await Nu(f.output,r.data));for(let e of n.onSuccess)e&&await e(pu(fu({},r),{response:t?.hookOptions?.cloneResponse?m.clone():m}));return t?.throw?r.data:{data:r.data,error:null}}let g=t?.jsonParser??wu,_=await m.text(),v=Su(_),y=v?await g(_):null,b={response:m,responseText:_,request:f,error:pu(fu({},y),{status:m.status,statusText:m.statusText})};for(let e of n.onError)e&&await e(pu(fu({},b),{response:t?.hookOptions?.cloneResponse?m.clone():m}));if(t?.retry){let r=vu(t.retry),i=t.retryAttempt??0;if(await r.shouldAttemptRetry(i,m)){for(let e of n.onRetry)e&&await e(h);let a=r.getDelay(i);return await new Promise(e=>setTimeout(e,a)),await Ru(e,pu(fu({},t),{retryAttempt:i+1}))}}if(t?.throw)throw new mu(m.status,m.statusText,v?y:_);return{data:null,error:pu(fu({},y),{status:m.status,statusText:m.statusText})}},zu=e=>{if(typeof process>`u`)return;let t=e??`/api/auth`;if({}.NEXT_PUBLIC_AUTH_URL)return{}.NEXT_PUBLIC_AUTH_URL;if(typeof window>`u`){if({}.NEXTAUTH_URL)try{return{}.NEXTAUTH_URL}catch{}if({}.VERCEL_URL)try{let e={}.VERCEL_URL.startsWith(`http`)?``:`https://`;return`${new URL(`${e}${{}.VERCEL_URL}`).origin}${t}`}catch{}}},Bu=(e,t)=>{let n=`credentials`in Request.prototype,r=hl(e?.baseURL,e?.basePath,void 0,t)??zu(e?.basePath)??`/api/auth`,i=e?.plugins?.flatMap(e=>e.fetchPlugins).filter(e=>e!==void 0)||[],a={id:`lifecycle-hooks`,name:`lifecycle-hooks`,hooks:{onSuccess:e?.fetchOptions?.onSuccess,onError:e?.fetchOptions?.onError,onRequest:e?.fetchOptions?.onRequest,onResponse:e?.fetchOptions?.onResponse}},{onSuccess:o,onError:s,onRequest:c,onResponse:l,...u}=e?.fetchOptions||{},d=Iu({baseURL:r,...n?{credentials:`include`}:{},method:`GET`,jsonParser(e){return e?wl(e,{strict:!1}):null},customFetchImpl:fetch,...u,plugins:[a,...u.plugins||[],...e?.disableDefaultFetchPlugins?[]:[Tl],...i]}),{$sessionSignal:f,session:p,broadcastSessionUpdate:m}=eu(d,e),h=e?.plugins||[],g={},_={$sessionSignal:f,session:p},v={"/sign-out":`POST`,"/revoke-sessions":`POST`,"/revoke-other-sessions":`POST`,"/delete-user":`POST`},y=[{signal:`$sessionSignal`,matcher(e){return e===`/sign-out`||e===`/update-user`||e===`/update-session`||e===`/sign-up/email`||e===`/sign-in/email`||e===`/delete-user`||e===`/verify-email`||e===`/revoke-sessions`||e===`/revoke-session`||e===`/change-email`},callback(e){e===`/sign-out`?m(`signout`):(e===`/update-user`||e===`/update-session`)&&m(`updateUser`)}}];for(let e of h)e.getAtoms&&Object.assign(_,e.getAtoms?.(d)),e.pathMethods&&Object.assign(v,e.pathMethods),e.atomListeners&&y.push(...e.atomListeners);let b={notify:e=>{_[e].set(!_[e].get())},listen:(e,t)=>{_[e].subscribe(t)},atoms:_};for(let t of h)t.getActions&&(g=iu(t.getActions?.(d,b,e)??{},g));return{get baseURL(){return r},pluginsActions:g,pluginsAtoms:_,pluginPathMethods:v,atomListeners:y,$fetch:d,$store:b}};function Vu(e){return typeof e==`object`&&!!e&&`get`in e&&typeof e.get==`function`&&`lc`in e&&typeof e.lc==`number`}function Hu(e,t,n){let r=t[e],{fetchOptions:i,query:a,...o}=n||{};return r||(i?.method?i.method:o&&Object.keys(o).length>0?`POST`:`GET`)}function Uu(e,t,n,r,i){function a(o=[]){return new Proxy(function(){},{get(t,n){if(typeof n!=`string`||n===`then`||n===`catch`||n===`finally`)return;let r=[...o,n],i=e;for(let e of r)if(i&&typeof i==`object`&&e in i)i=i[e];else{i=void 0;break}return typeof i==`function`||Vu(i)?i:a(r)},apply:async(e,a,s)=>{let c=`/`+o.map(e=>e.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)).join(`/`),l=s[0]||{},u=s[1]||{},{query:d,fetchOptions:f,...p}=l,m={...u,...f},h=Hu(c,n,l);return await t(c,{...m,body:h===`GET`?void 0:{...p,...m?.body||{}},query:d||m?.query,method:h,async onSuccess(e){if(await m?.onSuccess?.(e),!i||m.disableSignal)return;let t=i.filter(e=>e.matcher(c));if(!t.length)return;let n=new Set;for(let e of t){let t=r[e.signal];if(!t)return;if(n.has(e.signal))continue;n.add(e.signal);let i=t.get();setTimeout(()=>{t.set(!i)},10),e.callback?.(c)}}})}})}return a()}function Wu(e,t={}){let n=(0,m.useRef)(e.get()),{keys:r,deps:i=[e,r]}=t,a=(0,m.useCallback)(t=>{let i=e=>{n.current!==e&&(n.current=e,t())};return i(e.value),r?.length?Ll(e,r,i):e.listen(i)},i),o=()=>n.current;return(0,m.useSyncExternalStore)(a,o,o)}function Gu(e){return e.charAt(0).toUpperCase()+e.slice(1)}function Ku(e){return`use${Gu(e)}`}function qu(e){let{pluginPathMethods:t,pluginsActions:n,pluginsAtoms:r,$fetch:i,$store:a,atomListeners:o}=Bu(e),s={};for(let[e,t]of Object.entries(r))s[Ku(e)]=()=>Wu(t);return Uu({...n,...s,$fetch:i,$store:a},i,t,r,o)}var Ju=e=>`[SonamuProvider] ${e} is not configured. Please provide ${e} configuration to SonamuProvider.`,Yu=()=>()=>{throw Error(Ju(`uploader`))},Xu=()=>e=>tl[e],Zu=(0,m.createContext)({});function Qu({children:e,authOptions:t,...n}){let r=(0,m.useRef)(void 0);t&&!r.current&&(r.current=qu(t));let i={uploader:n.uploader??Yu(),auth:n.auth??r.current,SD:n.SD??Xu()};return(0,z.jsx)(Zu.Provider,{value:i,children:e})}function $u(){return(0,m.useContext)(Zu)}var ed=e=>(0,z.jsx)(`svg`,{viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`,...e,children:(0,z.jsx)(`path`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M18 6L6 18M6 6l12 12`})}),td=Fi,nd=Ii,rd=m.forwardRef(({className:e,...t},n)=>(0,z.jsx)(Li,{ref:n,className:et(`fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0`,e),...t}));rd.displayName=Li.displayName;var id=m.forwardRef(({className:e,children:t,...n},r)=>(0,z.jsxs)(nd,{children:[(0,z.jsx)(rd,{}),(0,z.jsxs)(Ri,{ref:r,className:et(`fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 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-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg`,e),...n,children:[t,(0,z.jsxs)(Vi,{className:`absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground`,children:[(0,z.jsx)(ed,{className:`h-4 w-4`}),(0,z.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]}));id.displayName=Ri.displayName;var ad=({className:e,...t})=>(0,z.jsx)(`div`,{className:et(`flex flex-col space-y-1.5 text-center sm:text-left`,e),...t});ad.displayName=`DialogHeader`;var od=({className:e,...t})=>(0,z.jsx)(`div`,{className:et(`flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2`,e),...t});od.displayName=`DialogFooter`;var sd=m.forwardRef(({className:e,...t},n)=>(0,z.jsx)(zi,{ref:n,className:et(`text-lg font-semibold leading-none tracking-tight`,e),...t}));sd.displayName=zi.displayName;var cd=m.forwardRef(({className:e,...t},n)=>(0,z.jsx)(Bi,{ref:n,className:et(`text-sm text-muted-foreground`,e),...t}));cd.displayName=Bi.displayName;var ld=e=>(0,z.jsx)(`svg`,{viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`,...e,children:(0,z.jsxs)(`g`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,children:[(0,z.jsx)(`path`,{d:`m21 21l-4.34-4.34`}),(0,z.jsx)(`circle`,{cx:11,cy:11,r:8})]})}),ud=1,dd=.9,fd=.8,pd=.17,md=.1,hd=.999,gd=.9999,_d=.99,vd=/[\\\/_+.#"@\[\(\{&]/,yd=/[\\\/_+.#"@\[\(\{&]/g,bd=/[\s-]/,xd=/[\s-]/g;function Sd(e,t,n,r,i,a,o){if(a===t.length)return i===e.length?ud:_d;var s=`${i},${a}`;if(o[s]!==void 0)return o[s];for(var c=r.charAt(a),l=n.indexOf(c,i),u=0,d,f,p,m;l>=0;)d=Sd(e,t,n,r,l+1,a+1,o),d>u&&(l===i?d*=ud:vd.test(e.charAt(l-1))?(d*=fd,p=e.slice(i,l-1).match(yd),p&&i>0&&(d*=hd**+p.length)):bd.test(e.charAt(l-1))?(d*=dd,m=e.slice(i,l-1).match(xd),m&&i>0&&(d*=hd**+m.length)):(d*=pd,i>0&&(d*=hd**+(l-i))),e.charAt(l)!==t.charAt(a)&&(d*=gd)),(d<md&&n.charAt(l-1)===r.charAt(a+1)||r.charAt(a+1)===r.charAt(a)&&n.charAt(l-1)!==r.charAt(a))&&(f=Sd(e,t,n,r,l+1,a+2,o),f*md>d&&(d=f*md)),d>u&&(u=d),l=n.indexOf(c,l+1);return o[s]=u,u}function Cd(e){return e.toLowerCase().replace(xd,` `)}function wd(e,t,n){return e=n&&n.length>0?`${e+` `+n.join(` `)}`:e,Sd(e,t,Cd(e),Cd(t),0,0,{})}var Td=`[cmdk-group=""]`,Ed=`[cmdk-group-items=""]`,Dd=`[cmdk-group-heading=""]`,Od=`[cmdk-item=""]`,kd=`${Od}:not([aria-disabled="true"])`,Ad=`cmdk-item-select`,jd=`data-value`,Md=(e,t,n)=>wd(e,t,n),Nd=m.createContext(void 0),Pd=()=>m.useContext(Nd),Fd=m.createContext(void 0),Id=()=>m.useContext(Fd),Ld=m.createContext(void 0),Rd=m.forwardRef((e,t)=>{let n=Qd(()=>({search:``,value:e.value??e.defaultValue??``,selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}})),r=Qd(()=>new Set),i=Qd(()=>new Map),a=Qd(()=>new Map),o=Qd(()=>new Set),s=Xd(e),{label:c,children:l,value:u,onValueChange:d,filter:f,shouldFilter:p,loop:h,disablePointerSelection:g=!1,vimBindings:_=!0,...v}=e,y=Ft(),b=Ft(),x=Ft(),S=m.useRef(null),C=tf();Zd(()=>{if(u!==void 0){let e=u.trim();n.current.value=e,w.emit()}},[u]),Zd(()=>{C(6,A)},[]);let w=m.useMemo(()=>({subscribe:e=>(o.current.add(e),()=>o.current.delete(e)),snapshot:()=>n.current,setState:(e,t,r)=>{var i,a,o;if(!Object.is(n.current[e],t)){if(n.current[e]=t,e===`search`)k(),D(),C(1,O);else if(e===`value`){if(document.activeElement.hasAttribute(`cmdk-input`)||document.activeElement.hasAttribute(`cmdk-root`)){let e=document.getElementById(x);e?e.focus():(i=document.getElementById(y))==null||i.focus()}if(C(7,()=>{n.current.selectedItemId=j()?.id,w.emit()}),r||C(5,A),s.current?.value!==void 0){let e=t??``;(o=(a=s.current).onValueChange)==null||o.call(a,e);return}}w.emit()}},emit:()=>{o.current.forEach(e=>e())}}),[]),T=m.useMemo(()=>({value:(e,t,r)=>{t!==a.current.get(e)?.value&&(a.current.set(e,{value:t,keywords:r}),n.current.filtered.items.set(e,E(t,r)),C(2,()=>{D(),w.emit()}))},item:(e,t)=>(r.current.add(e),t&&(i.current.has(t)?i.current.get(t).add(e):i.current.set(t,new Set([e]))),C(3,()=>{k(),D(),n.current.value||O(),w.emit()}),()=>{a.current.delete(e),r.current.delete(e),n.current.filtered.items.delete(e);let t=j();C(4,()=>{k(),t?.getAttribute(`id`)===e&&O(),w.emit()})}),group:e=>(i.current.has(e)||i.current.set(e,new Set),()=>{a.current.delete(e),i.current.delete(e)}),filter:()=>s.current.shouldFilter,label:c||e[`aria-label`],getDisablePointerSelection:()=>s.current.disablePointerSelection,listId:y,inputId:x,labelId:b,listInnerRef:S}),[]);function E(e,t){let r=s.current?.filter??Md;return e?r(e,n.current.search,t):0}function D(){if(!n.current.search||s.current.shouldFilter===!1)return;let e=n.current.filtered.items,t=[];n.current.filtered.groups.forEach(n=>{let r=i.current.get(n),a=0;r.forEach(t=>{let n=e.get(t);a=Math.max(n,a)}),t.push([n,a])});let r=S.current;M().sort((t,n)=>{let r=t.getAttribute(`id`),i=n.getAttribute(`id`);return(e.get(i)??0)-(e.get(r)??0)}).forEach(e=>{let t=e.closest(Ed);t?t.appendChild(e.parentElement===t?e:e.closest(`${Ed} > *`)):r.appendChild(e.parentElement===r?e:e.closest(`${Ed} > *`))}),t.sort((e,t)=>t[1]-e[1]).forEach(e=>{let t=S.current?.querySelector(`${Td}[${jd}="${encodeURIComponent(e[0])}"]`);t?.parentElement.appendChild(t)})}function O(){let e=M().find(e=>e.getAttribute(`aria-disabled`)!==`true`)?.getAttribute(jd);w.setState(`value`,e||void 0)}function k(){if(!n.current.search||s.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let e=0;for(let t of r.current){let r=E(a.current.get(t)?.value??``,a.current.get(t)?.keywords??[]);n.current.filtered.items.set(t,r),r>0&&e++}for(let[e,t]of i.current)for(let r of t)if(n.current.filtered.items.get(r)>0){n.current.filtered.groups.add(e);break}n.current.filtered.count=e}function A(){var e;let t=j();t&&(t.parentElement?.firstChild===t&&((e=t.closest(Td)?.querySelector(Dd))==null||e.scrollIntoView({block:`nearest`})),t.scrollIntoView({block:`nearest`}))}function j(){return S.current?.querySelector(`${Od}[aria-selected="true"]`)}function M(){return Array.from(S.current?.querySelectorAll(kd)||[])}function N(e){let t=M()[e];t&&w.setState(`value`,t.getAttribute(jd))}function P(e){var t;let n=j(),r=M(),i=r.findIndex(e=>e===n),a=r[i+e];(t=s.current)!=null&&t.loop&&(a=i+e<0?r[r.length-1]:i+e===r.length?r[0]:r[i+e]),a&&w.setState(`value`,a.getAttribute(jd))}function F(e){let t=j()?.closest(Td),n;for(;t&&!n;)t=e>0?Jd(t,Td):Yd(t,Td),n=t?.querySelector(kd);n?w.setState(`value`,n.getAttribute(jd)):P(e)}let ee=()=>N(M().length-1),te=e=>{e.preventDefault(),e.metaKey?ee():e.altKey?F(1):P(1)},ne=e=>{e.preventDefault(),e.metaKey?N(0):e.altKey?F(-1):P(-1)};return m.createElement(Hi.div,{ref:t,tabIndex:-1,...v,"cmdk-root":``,onKeyDown:e=>{var t;(t=v.onKeyDown)==null||t.call(v,e);let n=e.nativeEvent.isComposing||e.keyCode===229;if(!(e.defaultPrevented||n))switch(e.key){case`n`:case`j`:_&&e.ctrlKey&&te(e);break;case`ArrowDown`:te(e);break;case`p`:case`k`:_&&e.ctrlKey&&ne(e);break;case`ArrowUp`:ne(e);break;case`Home`:e.preventDefault(),N(0);break;case`End`:e.preventDefault(),ee();break;case`Enter`:{e.preventDefault();let t=j();if(t){let e=new Event(Ad);t.dispatchEvent(e)}}}}},m.createElement(`label`,{"cmdk-label":``,htmlFor:T.inputId,id:T.labelId,style:af},c),rf(e,e=>m.createElement(Fd.Provider,{value:w},m.createElement(Nd.Provider,{value:T},e))))}),zd=m.forwardRef((e,t)=>{let n=Ft(),r=m.useRef(null),i=m.useContext(Ld),a=Pd(),o=Xd(e),s=o.current?.forceMount??i?.forceMount;Zd(()=>{if(!s)return a.item(n,i?.id)},[s]);let c=ef(n,r,[e.value,e.children,r],e.keywords),l=Id(),u=$d(e=>e.value&&e.value===c.current),d=$d(e=>s||a.filter()===!1?!0:e.search?e.filtered.items.get(n)>0:!0);m.useEffect(()=>{let t=r.current;if(!(!t||e.disabled))return t.addEventListener(Ad,f),()=>t.removeEventListener(Ad,f)},[d,e.onSelect,e.disabled]);function f(){var e,t;p(),(t=(e=o.current).onSelect)==null||t.call(e,c.current)}function p(){l.setState(`value`,c.current,!0)}if(!d)return null;let{disabled:h,value:g,onSelect:_,forceMount:v,keywords:y,...b}=e;return m.createElement(Hi.div,{ref:st(r,t),...b,id:n,"cmdk-item":``,role:`option`,"aria-disabled":!!h,"aria-selected":!!u,"data-disabled":!!h,"data-selected":!!u,onPointerMove:h||a.getDisablePointerSelection()?void 0:p,onClick:h?void 0:f},e.children)}),Bd=m.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:i,...a}=e,o=Ft(),s=m.useRef(null),c=m.useRef(null),l=Ft(),u=Pd(),d=$d(e=>i||u.filter()===!1?!0:e.search?e.filtered.groups.has(o):!0);Zd(()=>u.group(o),[]),ef(o,s,[e.value,e.heading,c]);let f=m.useMemo(()=>({id:o,forceMount:i}),[i]);return m.createElement(Hi.div,{ref:st(s,t),...a,"cmdk-group":``,role:`presentation`,hidden:d?void 0:!0},n&&m.createElement(`div`,{ref:c,"cmdk-group-heading":``,"aria-hidden":!0,id:l},n),rf(e,e=>m.createElement(`div`,{"cmdk-group-items":``,role:`group`,"aria-labelledby":n?l:void 0},m.createElement(Ld.Provider,{value:f},e))))}),Vd=m.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,i=m.useRef(null),a=$d(e=>!e.search);return!n&&!a?null:m.createElement(Hi.div,{ref:st(i,t),...r,"cmdk-separator":``,role:`separator`})}),Hd=m.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,i=e.value!=null,a=Id(),o=$d(e=>e.search),s=$d(e=>e.selectedItemId),c=Pd();return m.useEffect(()=>{e.value!=null&&a.setState(`search`,e.value)},[e.value]),m.createElement(Hi.input,{ref:t,...r,"cmdk-input":``,autoComplete:`off`,autoCorrect:`off`,spellCheck:!1,"aria-autocomplete":`list`,role:`combobox`,"aria-expanded":!0,"aria-controls":c.listId,"aria-labelledby":c.labelId,"aria-activedescendant":s,id:c.inputId,type:`text`,value:i?e.value:o,onChange:e=>{i||a.setState(`search`,e.target.value),n?.(e.target.value)}})}),Ud=m.forwardRef((e,t)=>{let{children:n,label:r=`Suggestions`,...i}=e,a=m.useRef(null),o=m.useRef(null),s=$d(e=>e.selectedItemId),c=Pd();return m.useEffect(()=>{if(o.current&&a.current){let e=o.current,t=a.current,n,r=new ResizeObserver(()=>{n=requestAnimationFrame(()=>{let n=e.offsetHeight;t.style.setProperty(`--cmdk-list-height`,n.toFixed(1)+`px`)})});return r.observe(e),()=>{cancelAnimationFrame(n),r.unobserve(e)}}},[]),m.createElement(Hi.div,{ref:st(a,t),...i,"cmdk-list":``,role:`listbox`,tabIndex:-1,"aria-activedescendant":s,"aria-label":r,id:c.listId},rf(e,e=>m.createElement(`div`,{ref:st(o,c.listInnerRef),"cmdk-list-sizer":``},e)))}),Wd=m.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:i,contentClassName:a,container:o,...s}=e;return m.createElement(Fi,{open:n,onOpenChange:r},m.createElement(Ii,{container:o},m.createElement(Li,{"cmdk-overlay":``,className:i}),m.createElement(Ri,{"aria-label":e.label,"cmdk-dialog":``,className:a},m.createElement(Rd,{ref:t,...s}))))}),Gd=m.forwardRef((e,t)=>$d(e=>e.filtered.count===0)?m.createElement(Hi.div,{ref:t,...e,"cmdk-empty":``,role:`presentation`}):null),Kd=m.forwardRef((e,t)=>{let{progress:n,children:r,label:i=`Loading...`,...a}=e;return m.createElement(Hi.div,{ref:t,...a,"cmdk-loading":``,role:`progressbar`,"aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":i},rf(e,e=>m.createElement(`div`,{"aria-hidden":!0},e)))}),qd=Object.assign(Rd,{List:Ud,Item:zd,Input:Hd,Group:Bd,Separator:Vd,Dialog:Wd,Empty:Gd,Loading:Kd});function Jd(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function Yd(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function Xd(e){let t=m.useRef(e);return Zd(()=>{t.current=e}),t}var Zd=typeof window>`u`?m.useEffect:m.useLayoutEffect;function Qd(e){let t=m.useRef();return t.current===void 0&&(t.current=e()),t}function $d(e){let t=Id(),n=()=>e(t.snapshot());return m.useSyncExternalStore(t.subscribe,n,n)}function ef(e,t,n,r=[]){let i=m.useRef(),a=Pd();return Zd(()=>{var o;let s=(()=>{for(let e of n){if(typeof e==`string`)return e.trim();if(typeof e==`object`&&`current`in e)return e.current?e.current.textContent?.trim():i.current}})(),c=r.map(e=>e.trim());a.value(e,s,c),(o=t.current)==null||o.setAttribute(jd,s),i.current=s}),i}var tf=()=>{let[e,t]=m.useState(),n=Qd(()=>new Map);return Zd(()=>{n.current.forEach(e=>e()),n.current=new Map},[e]),(e,r)=>{n.current.set(e,r),t({})}};function nf(e){let t=e.type;return typeof t==`function`?t(e.props):`render`in t?t.render(e.props):e}function rf({asChild:e,children:t},n){return e&&m.isValidElement(t)?m.cloneElement(nf(t),{ref:t.ref},n(t.props.children)):n(t)}var af={position:`absolute`,width:`1px`,height:`1px`,padding:`0`,margin:`-1px`,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,borderWidth:`0`},of=m.forwardRef(({className:e,...t},n)=>(0,z.jsx)(qd,{ref:n,className:et(`flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground`,e),...t}));of.displayName=qd.displayName;var sf=({children:e,commandProps:t,...n})=>{let{className:r,...i}=t??{};return(0,z.jsx)(td,{...n,children:(0,z.jsx)(id,{className:`overflow-hidden p-0 shadow-lg`,children:(0,z.jsx)(of,{className:et(`**:[[cmdk-group-heading]]:px-2 **:[[cmdk-group-heading]]:font-medium **:[[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 **:[[cmdk-group]]:px-2 **:[[cmdk-input-wrapper]_svg]:size-5 **:[[cmdk-input]]:h-12 **:[[cmdk-item]]:px-2 **:[[cmdk-item]]:py-3 **:[[cmdk-item]_svg]:size-5`,r),...i,children:e})})})},cf=m.forwardRef(({className:e,...t},n)=>(0,z.jsxs)(`div`,{className:`flex items-center border-b px-3`,"cmdk-input-wrapper":``,children:[(0,z.jsx)(ld,{className:`mr-2 h-4 w-4 shrink-0 opacity-50`}),(0,z.jsx)(qd.Input,{ref:n,className:et(`flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50`,e),...t})]}));cf.displayName=qd.Input.displayName;var lf=m.forwardRef(({className:e,...t},n)=>(0,z.jsx)(qd.List,{ref:n,className:et(`max-h-[300px] overflow-y-auto overflow-x-hidden`,e),...t}));lf.displayName=qd.List.displayName;var uf=m.forwardRef((e,t)=>(0,z.jsx)(qd.Empty,{ref:t,className:`py-6 text-center text-sm`,...e}));uf.displayName=qd.Empty.displayName;var df=m.forwardRef(({className:e,...t},n)=>(0,z.jsx)(qd.Group,{ref:n,className:et(`overflow-hidden p-1 text-foreground **:[[cmdk-group-heading]]:px-2 **:[[cmdk-group-heading]]:py-1.5 **:[[cmdk-group-heading]]:text-xs **:[[cmdk-group-heading]]:font-medium **:[[cmdk-group-heading]]:text-muted-foreground`,e),...t}));df.displayName=qd.Group.displayName;var ff=m.forwardRef(({className:e,...t},n)=>(0,z.jsx)(qd.Separator,{ref:n,className:et(`-mx-1 h-px bg-border`,e),...t}));ff.displayName=qd.Separator.displayName;var pf=m.forwardRef(({className:e,...t},n)=>(0,z.jsx)(qd.Item,{ref:n,className:et(`relative flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected='true']:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50 **:[svg]:pointer-events-none **:[svg]:size-4 **:[svg]:shrink-0`,e),...t}));pf.displayName=qd.Item.displayName;var mf=({className:e,...t})=>(0,z.jsx)(`span`,{className:et(`ml-auto text-xs tracking-widest text-muted-foreground`,e),...t});mf.displayName=`CommandShortcut`;var hf=[`top`,`right`,`bottom`,`left`],gf=Math.min,_f=Math.max,vf=Math.round,yf=Math.floor,bf=e=>({x:e,y:e}),xf={left:`right`,right:`left`,bottom:`top`,top:`bottom`},Sf={start:`end`,end:`start`};function Cf(e,t,n){return _f(e,gf(t,n))}function wf(e,t){return typeof e==`function`?e(t):e}function Tf(e){return e.split(`-`)[0]}function Ef(e){return e.split(`-`)[1]}function Df(e){return e===`x`?`y`:`x`}function Of(e){return e===`y`?`height`:`width`}var kf=new Set([`top`,`bottom`]);function Af(e){return kf.has(Tf(e))?`y`:`x`}function jf(e){return Df(Af(e))}function Mf(e,t,n){n===void 0&&(n=!1);let r=Ef(e),i=jf(e),a=Of(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=Vf(o)),[o,Vf(o)]}function Nf(e){let t=Vf(e);return[Pf(e),t,Pf(t)]}function Pf(e){return e.replace(/start|end/g,e=>Sf[e])}var Ff=[`left`,`right`],If=[`right`,`left`],Lf=[`top`,`bottom`],Rf=[`bottom`,`top`];function zf(e,t,n){switch(e){case`top`:case`bottom`:return n?t?If:Ff:t?Ff:If;case`left`:case`right`:return t?Lf:Rf;default:return[]}}function Bf(e,t,n,r){let i=Ef(e),a=zf(Tf(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(Pf)))),a}function Vf(e){return e.replace(/left|right|bottom|top/g,e=>xf[e])}function Hf(e){return{top:0,right:0,bottom:0,left:0,...e}}function Uf(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:Hf(e)}function Wf(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function Gf(e,t,n){let{reference:r,floating:i}=e,a=Af(t),o=jf(t),s=Of(o),c=Tf(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}switch(Ef(t)){case`start`:p[o]-=f*(n&&l?-1:1);break;case`end`:p[o]+=f*(n&&l?-1:1);break}return p}var Kf=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=a.filter(Boolean),c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=Gf(l,r,c),f=r,p={},m=0;for(let n=0;n<s.length;n++){let{name:a,fn:h}=s[n],{x:g,y:_,data:v,reset:y}=await h({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:p,rects:l,platform:o,elements:{reference:e,floating:t}});u=g??u,d=_??d,p={...p,[a]:{...p[a],...v}},y&&m<=50&&(m++,typeof y==`object`&&(y.placement&&(f=y.placement),y.rects&&(l=y.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):y.rects),{x:u,y:d}=Gf(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:p}};async function qf(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=wf(t,e),p=Uf(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=Wf(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=Wf(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var Jf=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=wf(e,t)||{};if(l==null)return{};let d=Uf(u),f={x:n,y:r},p=jf(i),m=Of(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,E=gf(d[_],T),D=gf(d[v],T),O=E,k=C-h[m]-D,A=C/2-h[m]/2+w,j=Cf(O,A,k),M=!c.arrow&&Ef(i)!=null&&A!==j&&a.reference[m]/2-(A<O?E:D)-h[m]/2<0,N=M?A<O?A-O:A-k:0;return{[p]:f[p]+N,data:{[p]:j,centerOffset:A-j-N,...M&&{alignmentOffset:N}},reset:M}}}),Yf=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=wf(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=Tf(r),_=Af(o),v=Tf(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[Vf(o)]:Nf(o)),x=p!==`none`;!d&&x&&b.push(...Bf(o,m,p,y));let S=[o,...b],C=await qf(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=Mf(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(!(u===`alignment`&&_!==Af(t))||T.every(e=>Af(e.placement)===_?e.overflows[0]>0:!0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=Af(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o;break}if(r!==n)return{reset:{placement:n}}}return{}}}};function Xf(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Zf(e){return hf.some(t=>e[t]>=0)}var Qf=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n}=t,{strategy:r=`referenceHidden`,...i}=wf(e,t);switch(r){case`referenceHidden`:{let e=Xf(await qf(t,{...i,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:Zf(e)}}}case`escaped`:{let e=Xf(await qf(t,{...i,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:Zf(e)}}}default:return{}}}}},$f=new Set([`left`,`top`]);async function ep(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=Tf(n),s=Ef(n),c=Af(n)===`y`,l=$f.has(o)?-1:1,u=a&&c?-1:1,d=wf(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var tp=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await ep(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},np=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i}=t,{mainAxis:a=!0,crossAxis:o=!1,limiter:s={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...c}=wf(e,t),l={x:n,y:r},u=await qf(t,c),d=Af(Tf(i)),f=Df(d),p=l[f],m=l[d];if(a){let e=f===`y`?`top`:`left`,t=f===`y`?`bottom`:`right`,n=p+u[e],r=p-u[t];p=Cf(n,p,r)}if(o){let e=d===`y`?`top`:`left`,t=d===`y`?`bottom`:`right`,n=m+u[e],r=m-u[t];m=Cf(n,m,r)}let h=s.fn({...t,[f]:p,[d]:m});return{...h,data:{x:h.x-n,y:h.y-r,enabled:{[f]:a,[d]:o}}}}}},rp=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=wf(e,t),u={x:n,y:r},d=Af(i),f=Df(d),p=u[f],m=u[d],h=wf(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=$f.has(Tf(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},ip=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){var n,r;let{placement:i,rects:a,platform:o,elements:s}=t,{apply:c=()=>{},...l}=wf(e,t),u=await qf(t,l),d=Tf(i),f=Ef(i),p=Af(i)===`y`,{width:m,height:h}=a.floating,g,_;d===`top`||d===`bottom`?(g=d,_=f===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?`start`:`end`)?`left`:`right`):(_=d,g=f===`end`?`top`:`bottom`);let v=h-u.top-u.bottom,y=m-u.left-u.right,b=gf(h-u[g],v),x=gf(m-u[_],y),S=!t.middlewareData.shift,C=b,w=x;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(w=y),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(C=v),S&&!f){let e=_f(u.left,0),t=_f(u.right,0),n=_f(u.top,0),r=_f(u.bottom,0);p?w=m-2*(e!==0||t!==0?e+t:_f(u.left,u.right)):C=h-2*(n!==0||r!==0?n+r:_f(u.top,u.bottom))}await c({...t,availableWidth:w,availableHeight:C});let T=await o.getDimensions(s.floating);return m!==T.width||h!==T.height?{reset:{rects:!0}}:{}}}};function ap(){return typeof window<`u`}function op(e){return lp(e)?(e.nodeName||``).toLowerCase():`#document`}function sp(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function cp(e){return((lp(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function lp(e){return ap()?e instanceof Node||e instanceof sp(e).Node:!1}function up(e){return ap()?e instanceof Element||e instanceof sp(e).Element:!1}function dp(e){return ap()?e instanceof HTMLElement||e instanceof sp(e).HTMLElement:!1}function fp(e){return!ap()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof sp(e).ShadowRoot}var pp=new Set([`inline`,`contents`]);function mp(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=Dp(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!pp.has(i)}var hp=new Set([`table`,`td`,`th`]);function gp(e){return hp.has(op(e))}var _p=[`:popover-open`,`:modal`];function vp(e){return _p.some(t=>{try{return e.matches(t)}catch{return!1}})}var yp=[`transform`,`translate`,`scale`,`rotate`,`perspective`],bp=[`transform`,`translate`,`scale`,`rotate`,`perspective`,`filter`],xp=[`paint`,`layout`,`strict`,`content`];function Sp(e){let t=wp(),n=up(e)?Dp(e):e;return yp.some(e=>n[e]?n[e]!==`none`:!1)||(n.containerType?n.containerType!==`normal`:!1)||!t&&(n.backdropFilter?n.backdropFilter!==`none`:!1)||!t&&(n.filter?n.filter!==`none`:!1)||bp.some(e=>(n.willChange||``).includes(e))||xp.some(e=>(n.contain||``).includes(e))}function Cp(e){let t=kp(e);for(;dp(t)&&!Ep(t);){if(Sp(t))return t;if(vp(t))return null;t=kp(t)}return null}function wp(){return typeof CSS>`u`||!CSS.supports?!1:CSS.supports(`-webkit-backdrop-filter`,`none`)}var Tp=new Set([`html`,`body`,`#document`]);function Ep(e){return Tp.has(op(e))}function Dp(e){return sp(e).getComputedStyle(e)}function Op(e){return up(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function kp(e){if(op(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||fp(e)&&e.host||cp(e);return fp(t)?t.host:t}function Ap(e){let t=kp(e);return Ep(t)?e.ownerDocument?e.ownerDocument.body:e.body:dp(t)&&mp(t)?t:Ap(t)}function jp(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=Ap(e),i=r===e.ownerDocument?.body,a=sp(r);if(i){let e=Mp(a);return t.concat(a,a.visualViewport||[],mp(r)?r:[],e&&n?jp(e):[])}return t.concat(r,jp(r,[],n))}function Mp(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Np(e){let t=Dp(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=dp(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=vf(n)!==a||vf(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function Pp(e){return up(e)?e:e.contextElement}function Fp(e){let t=Pp(e);if(!dp(t))return bf(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=Np(t),o=(a?vf(n.width):n.width)/r,s=(a?vf(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var Ip=bf(0);function Lp(e){let t=sp(e);return!wp()||!t.visualViewport?Ip:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Rp(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==sp(e)?!1:t}function zp(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=Pp(e),o=bf(1);t&&(r?up(r)&&(o=Fp(r)):o=Fp(e));let s=Rp(a,n,r)?Lp(a):bf(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a){let e=sp(a),t=r&&up(r)?sp(r):r,n=e,i=Mp(n);for(;i&&r&&t!==n;){let e=Fp(i),t=i.getBoundingClientRect(),r=Dp(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=sp(i),i=Mp(n)}}return Wf({width:u,height:d,x:c,y:l})}function Bp(e,t){let n=Op(e).scrollLeft;return t?t.left+n:zp(cp(e)).left+n}function Vp(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Bp(e,n),y:n.top+t.scrollTop}}function Hp(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=cp(r),s=t?vp(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=bf(1),u=bf(0),d=dp(r);if((d||!d&&!a)&&((op(r)!==`body`||mp(o))&&(c=Op(r)),dp(r))){let e=zp(r);l=Fp(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?Vp(o,c):bf(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 Up(e){return Array.from(e.getClientRects())}function Wp(e){let t=cp(e),n=Op(e),r=e.ownerDocument.body,i=_f(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=_f(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+Bp(e),s=-n.scrollTop;return Dp(r).direction===`rtl`&&(o+=_f(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}var Gp=25;function Kp(e,t){let n=sp(e),r=cp(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=wp();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=Bp(r);if(l<=0){let e=r.ownerDocument,t=e.body,n=getComputedStyle(t),i=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,o=Math.abs(r.clientWidth-t.clientWidth-i);o<=Gp&&(a-=o)}else l<=Gp&&(a+=l);return{width:a,height:o,x:s,y:c}}var qp=new Set([`absolute`,`fixed`]);function Jp(e,t){let n=zp(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=dp(e)?Fp(e):bf(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function Yp(e,t,n){let r;if(t===`viewport`)r=Kp(e,n);else if(t===`document`)r=Wp(cp(e));else if(up(t))r=Jp(t,n);else{let n=Lp(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return Wf(r)}function Xp(e,t){let n=kp(e);return n===t||!up(n)||Ep(n)?!1:Dp(n).position===`fixed`||Xp(n,t)}function Zp(e,t){let n=t.get(e);if(n)return n;let r=jp(e,[],!1).filter(e=>up(e)&&op(e)!==`body`),i=null,a=Dp(e).position===`fixed`,o=a?kp(e):e;for(;up(o)&&!Ep(o);){let t=Dp(o),n=Sp(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&qp.has(i.position)||mp(o)&&!n&&Xp(e,o))?r=r.filter(e=>e!==o):i=t,o=kp(o)}return t.set(e,r),r}function Qp(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?vp(t)?[]:Zp(t,this._c):[].concat(n),r],o=a[0],s=a.reduce((e,n)=>{let r=Yp(t,n,i);return e.top=_f(r.top,e.top),e.right=gf(r.right,e.right),e.bottom=gf(r.bottom,e.bottom),e.left=_f(r.left,e.left),e},Yp(t,o,i));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}}function $p(e){let{width:t,height:n}=Np(e);return{width:t,height:n}}function em(e,t,n){let r=dp(t),i=cp(t),a=n===`fixed`,o=zp(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=bf(0);function l(){c.x=Bp(i)}if(r||!r&&!a)if((op(t)!==`body`||mp(i))&&(s=Op(t)),r){let e=zp(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else i&&l();a&&!r&&i&&l();let u=i&&!r&&!a?Vp(i,s):bf(0);return{x:o.left+s.scrollLeft-c.x-u.x,y:o.top+s.scrollTop-c.y-u.y,width:o.width,height:o.height}}function tm(e){return Dp(e).position===`static`}function nm(e,t){if(!dp(e)||Dp(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return cp(e)===n&&(n=n.ownerDocument.body),n}function rm(e,t){let n=sp(e);if(vp(e))return n;if(!dp(e)){let t=kp(e);for(;t&&!Ep(t);){if(up(t)&&!tm(t))return t;t=kp(t)}return n}let r=nm(e,t);for(;r&&gp(r)&&tm(r);)r=nm(r,t);return r&&Ep(r)&&tm(r)&&!Sp(r)?n:r||Cp(e)||n}var im=async function(e){let t=this.getOffsetParent||rm,n=this.getDimensions,r=await n(e.floating);return{reference:em(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function am(e){return Dp(e).direction===`rtl`}var om={convertOffsetParentRelativeRectToViewportRelativeRect:Hp,getDocumentElement:cp,getClippingRect:Qp,getOffsetParent:rm,getElementRects:im,getClientRects:Up,getDimensions:$p,getScale:Fp,isElement:up,isRTL:am};function sm(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function cm(e,t){let n=null,r,i=cp(e);function a(){var e;clearTimeout(r),(e=n)==null||e.disconnect(),n=null}function o(s,c){s===void 0&&(s=!1),c===void 0&&(c=1),a();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(s||t(),!f||!p)return;let m=yf(d),h=yf(i.clientWidth-(u+f)),g=yf(i.clientHeight-(d+p)),_=yf(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:_f(0,gf(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(n!==c){if(!y)return o();n?o(!1,n):r=setTimeout(()=>{o(!1,1e-7)},1e3)}n===1&&!sm(l,e.getBoundingClientRect())&&o(),y=!1}try{n=new IntersectionObserver(b,{...v,root:i.ownerDocument})}catch{n=new IntersectionObserver(b,v)}n.observe(e)}return o(!0),a}function lm(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=Pp(e),u=i||a?[...l?jp(l):[],...jp(t)]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n,{passive:!0}),a&&e.addEventListener(`resize`,n)});let d=l&&s?cm(l,n):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),p.observe(t));let m,h=c?zp(e):null;c&&g();function g(){let t=zp(e);h&&!sm(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var um=tp,eee=np,tee=Yf,nee=ip,ree=Qf,dm=Jf,iee=rp,aee=(e,t,n)=>{let r=new Map,i={platform:om,...n},a={...i.platform,_c:r};return Kf(e,t,{...i,platform:a})},fm=typeof document<`u`?m.useLayoutEffect:function(){};function pm(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!pm(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!pm(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function mm(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function hm(e,t){let n=mm(e);return Math.round(t*n)/n}function gm(e){let t=m.useRef(e);return fm(()=>{t.current=e}),t}function oee(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=m.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=m.useState(r);pm(f,r)||p(r);let[h,g]=m.useState(null),[_,v]=m.useState(null),y=m.useCallback(e=>{e!==C.current&&(C.current=e,g(e))},[]),b=m.useCallback(e=>{e!==w.current&&(w.current=e,v(e))},[]),x=a||h,S=o||_,C=m.useRef(null),w=m.useRef(null),T=m.useRef(u),E=c!=null,D=gm(c),O=gm(i),k=gm(l),A=m.useCallback(()=>{if(!C.current||!w.current)return;let e={placement:t,strategy:n,middleware:f};O.current&&(e.platform=O.current),aee(C.current,w.current,e).then(e=>{let t={...e,isPositioned:k.current!==!1};j.current&&!pm(T.current,t)&&(T.current=t,Tt.flushSync(()=>{d(t)}))})},[f,t,n,O,k]);fm(()=>{l===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let j=m.useRef(!1);fm(()=>(j.current=!0,()=>{j.current=!1}),[]),fm(()=>{if(x&&(C.current=x),S&&(w.current=S),x&&S){if(D.current)return D.current(x,S,A);A()}},[x,S,A,D,E]);let M=m.useMemo(()=>({reference:C,floating:w,setReference:y,setFloating:b}),[y,b]),N=m.useMemo(()=>({reference:x,floating:S}),[x,S]),P=m.useMemo(()=>{let e={position:n,left:0,top:0};if(!N.floating)return e;let t=hm(N.floating,u.x),r=hm(N.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...mm(N.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,N.floating,u.x,u.y]);return m.useMemo(()=>({...u,update:A,refs:M,elements:N,floatingStyles:P}),[u,A,M,N,P])}var see=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:dm({element:r.current,padding:i}).fn(n):r?dm({element:r,padding:i}).fn(n):{}}}},cee=(e,t)=>({...um(e),options:[e,t]}),lee=(e,t)=>({...eee(e),options:[e,t]}),uee=(e,t)=>({...iee(e),options:[e,t]}),dee=(e,t)=>({...tee(e),options:[e,t]}),fee=(e,t)=>({...nee(e),options:[e,t]}),_m=(e,t)=>({...ree(e),options:[e,t]}),vm=(e,t)=>({...see(e),options:[e,t]}),ym=`Arrow`,bm=m.forwardRef((e,t)=>{let{children:n,width:r=10,height:i=5,...a}=e;return(0,z.jsx)(Et.svg,{...a,ref:t,width:r,height:i,viewBox:`0 0 30 10`,preserveAspectRatio:`none`,children:e.asChild?n:(0,z.jsx)(`polygon`,{points:`0,0 30,0 15,10`})})});bm.displayName=ym;var xm=bm,Sm=`Popper`,[Cm,wm]=it(Sm),[Tm,Em]=Cm(Sm),Dm=e=>{let{__scopePopper:t,children:n}=e,[r,i]=m.useState(null);return(0,z.jsx)(Tm,{scope:t,anchor:r,onAnchorChange:i,children:n})};Dm.displayName=Sm;var Om=`PopperAnchor`,km=m.forwardRef((e,t)=>{let{__scopePopper:n,virtualRef:r,...i}=e,a=Em(Om,n),o=m.useRef(null),s=ct(t,o),c=m.useRef(null);return m.useEffect(()=>{let e=c.current;c.current=r?.current||o.current,e!==c.current&&a.onAnchorChange(c.current)}),r?null:(0,z.jsx)(Et.div,{...i,ref:s})});km.displayName=Om;var Am=`PopperContent`,[jm,Mm]=Cm(Am),Nm=m.forwardRef((e,t)=>{let{__scopePopper:n,side:r=`bottom`,sideOffset:i=0,align:a=`center`,alignOffset:o=0,arrowPadding:s=0,avoidCollisions:c=!0,collisionBoundary:l=[],collisionPadding:u=0,sticky:d=`partial`,hideWhenDetached:f=!1,updatePositionStrategy:p=`optimized`,onPlaced:h,...g}=e,_=Em(Am,n),[v,y]=m.useState(null),b=ct(t,e=>y(e)),[x,S]=m.useState(null),C=Lc(x),w=C?.width??0,T=C?.height??0,E=r+(a===`center`?``:`-`+a),D=typeof u==`number`?u:{top:0,right:0,bottom:0,left:0,...u},O=Array.isArray(l)?l:[l],k=O.length>0,A={padding:D,boundary:O.filter(Lm),altBoundary:k},{refs:j,floatingStyles:M,placement:N,isPositioned:P,middlewareData:F}=oee({strategy:`fixed`,placement:E,whileElementsMounted:(...e)=>lm(...e,{animationFrame:p===`always`}),elements:{reference:_.anchor},middleware:[cee({mainAxis:i+T,alignmentAxis:o}),c&&lee({mainAxis:!0,crossAxis:!1,limiter:d===`partial`?uee():void 0,...A}),c&&dee({...A}),fee({...A,apply:({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)}}),x&&vm({element:x,padding:s}),Rm({arrowWidth:w,arrowHeight:T}),f&&_m({strategy:`referenceHidden`,...A})]}),[ee,te]=zm(N),ne=en(h);vt(()=>{P&&ne?.()},[P,ne]);let I=F.arrow?.x,re=F.arrow?.y,ie=F.arrow?.centerOffset!==0,[ae,oe]=m.useState();return vt(()=>{v&&oe(window.getComputedStyle(v).zIndex)},[v]),(0,z.jsx)(`div`,{ref:j.setFloating,"data-radix-popper-content-wrapper":``,style:{...M,transform:P?M.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:ae,"--radix-popper-transform-origin":[F.transformOrigin?.x,F.transformOrigin?.y].join(` `),...F.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,z.jsx)(jm,{scope:n,placedSide:ee,onArrowChange:S,arrowX:I,arrowY:re,shouldHideArrow:ie,children:(0,z.jsx)(Et.div,{"data-side":ee,"data-align":te,...g,ref:b,style:{...g.style,animation:P?void 0:`none`}})})})});Nm.displayName=Am;var Pm=`PopperArrow`,Fm={top:`bottom`,right:`left`,bottom:`top`,left:`right`},Im=m.forwardRef(function(e,t){let{__scopePopper:n,...r}=e,i=Mm(Pm,n),a=Fm[i.placedSide];return(0,z.jsx)(`span`,{ref:i.onArrowChange,style:{position:`absolute`,left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:``,right:`0 0`,bottom:`center 0`,left:`100% 0`}[i.placedSide],transform:{top:`translateY(100%)`,right:`translateY(50%) rotate(90deg) translateX(-50%)`,bottom:`rotate(180deg)`,left:`translateY(50%) rotate(-90deg) translateX(50%)`}[i.placedSide],visibility:i.shouldHideArrow?`hidden`:void 0},children:(0,z.jsx)(xm,{...r,ref:t,style:{...r.style,display:`block`}})})});Im.displayName=Pm;function Lm(e){return e!==null}var Rm=e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=zm(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}});function zm(e){let[t,n=`center`]=e.split(`-`);return[t,n]}var Bm=Dm,Vm=km,Hm=Nm,Um=Im,Wm=`Popover`,[Gm,pee]=it(Wm,[wm]),Km=wm(),[mee,qm]=Gm(Wm),Jm=e=>{let{__scopePopover:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!1}=e,s=Km(t),c=m.useRef(null),[l,u]=m.useState(!1),[d,f]=bt({prop:r,defaultProp:i??!1,onChange:a,caller:Wm});return(0,z.jsx)(Bm,{...s,children:(0,z.jsx)(mee,{scope:t,contentId:Ft(),triggerRef:c,open:d,onOpenChange:f,onOpenToggle:m.useCallback(()=>f(e=>!e),[f]),hasCustomAnchor:l,onCustomAnchorAdd:m.useCallback(()=>u(!0),[]),onCustomAnchorRemove:m.useCallback(()=>u(!1),[]),modal:o,children:n})})};Jm.displayName=Wm;var Ym=`PopoverAnchor`,hee=m.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=qm(Ym,n),a=Km(n),{onCustomAnchorAdd:o,onCustomAnchorRemove:s}=i;return m.useEffect(()=>(o(),()=>s()),[o,s]),(0,z.jsx)(Vm,{...a,...r,ref:t})});hee.displayName=Ym;var Xm=`PopoverTrigger`,Zm=m.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=qm(Xm,n),a=Km(n),o=ct(t,i.triggerRef),s=(0,z.jsx)(Et.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.contentId,"data-state":fh(i.open),...r,ref:o,onClick:_t(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?s:(0,z.jsx)(Vm,{asChild:!0,...a,children:s})});Zm.displayName=Xm;var Qm=`PopoverPortal`,[$m,eh]=Gm(Qm,{forceMount:void 0}),th=e=>{let{__scopePopover:t,forceMount:n,children:r,container:i}=e,a=qm(Qm,t);return(0,z.jsx)($m,{scope:t,forceMount:n,children:(0,z.jsx)(kt,{present:n||a.open,children:(0,z.jsx)(Nn,{asChild:!0,container:i,children:r})})})};th.displayName=Qm;var nh=`PopoverContent`,rh=m.forwardRef((e,t)=>{let n=eh(nh,e.__scopePopover),{forceMount:r=n.forceMount,...i}=e,a=qm(nh,e.__scopePopover);return(0,z.jsx)(kt,{present:r||a.open,children:a.modal?(0,z.jsx)(ah,{...i,ref:t}):(0,z.jsx)(oh,{...i,ref:t})})});rh.displayName=nh;var ih=lt(`PopoverContent.RemoveScroll`),ah=m.forwardRef((e,t)=>{let n=qm(nh,e.__scopePopover),r=m.useRef(null),i=ct(t,r),a=m.useRef(!1);return m.useEffect(()=>{let e=r.current;if(e)return ei(e)},[]),(0,z.jsx)(Gr,{as:ih,allowPinchZoom:!0,children:(0,z.jsx)(sh,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:_t(e.onCloseAutoFocus,e=>{e.preventDefault(),a.current||n.triggerRef.current?.focus()}),onPointerDownOutside:_t(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;a.current=t.button===2||n},{checkForDefaultPrevented:!1}),onFocusOutside:_t(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})}),oh=m.forwardRef((e,t)=>{let n=qm(nh,e.__scopePopover),r=m.useRef(!1),i=m.useRef(!1);return(0,z.jsx)(sh,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})}),sh=m.forwardRef((e,t)=>{let{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:o,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onInteractOutside:u,...d}=e,f=qm(nh,n),p=Km(n);return Fn(),(0,z.jsx)(bn,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,z.jsx)(ln,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:u,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onDismiss:()=>f.onOpenChange(!1),children:(0,z.jsx)(Hm,{"data-state":fh(f.open),role:`dialog`,id:f.contentId,...p,...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)`}})})})}),ch=`PopoverClose`,lh=m.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=qm(ch,n);return(0,z.jsx)(Et.button,{type:`button`,...r,ref:t,onClick:_t(e.onClick,()=>i.onOpenChange(!1))})});lh.displayName=ch;var uh=`PopoverArrow`,dh=m.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=Km(n);return(0,z.jsx)(Um,{...i,...r,ref:t})});dh.displayName=uh;function fh(e){return e?`open`:`closed`}var ph=Jm,mh=Zm,gee=th,_ee=rh;function hh({...e}){return(0,z.jsx)(ph,{"data-slot":`popover`,...e})}function gh({...e}){return(0,z.jsx)(mh,{"data-slot":`popover-trigger`,...e})}function _h({className:e,align:t=`center`,sideOffset:n=4,...r}){return(0,z.jsx)(gee,{children:(0,z.jsx)(_ee,{"data-slot":`popover-content`,align:t,sideOffset:n,className:et(`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})})}var vh=e=>(0,z.jsx)(`svg`,{viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`,...e,children:(0,z.jsxs)(`g`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,children:[(0,z.jsx)(`circle`,{cx:12,cy:12,r:10}),(0,z.jsx)(`path`,{d:`m15 9l-6 6m0-6l6 6`})]})});function yh(e){return`init`in e}function bh(e){return!!e.write}function xh(e){return`v`in e||`e`in e}function Sh(e){if(`e`in e)throw e.e;return e.v}var Ch=new WeakMap;function wh(e){return Eh(e)&&!!Ch.get(e)?.[0]}function vee(e){let t=Ch.get(e);t?.[0]&&(t[0]=!1,t[1].forEach(e=>e()))}function Th(e,t){let n=Ch.get(e);if(!n){n=[!0,new Set],Ch.set(e,n);let t=()=>{n[0]=!1};e.then(t,t)}n[1].add(t)}function Eh(e){return typeof e?.then==`function`}function Dh(e,t,n){if(!n.p.has(e)){n.p.add(e);let r=()=>n.p.delete(e);t.then(r,r)}}function Oh(e,t,n){let r=new Set;for(let t of n.get(e)?.t||[])r.add(t);for(let e of t.p)r.add(e);return r}var yee=(e,t,...n)=>t.read(...n),bee=(e,t,...n)=>t.write(...n),xee=(e,t)=>{if(t.INTERNAL_onInit)return t.INTERNAL_onInit(e);if(t.unstable_onInit)return console.warn(`[DEPRECATED] atom.unstable_onInit is renamed to atom.INTERNAL_onInit.`),t.unstable_onInit(e)},See=(e,t,n)=>t.onMount?.call(t,n),Cee=(e,t)=>{var n;let r=Ah(e),i=r[0],a=r[6],o=r[9],s=i.get(t);return s||(s={d:new Map,p:new Set,n:0},i.set(t,s),(n=a.i)==null||n.call(a,t),o?.(e,t)),s},wee=e=>{let t=Ah(e),n=t[1],r=t[3],i=t[4],a=t[5],o=t[6],s=t[13],c=[],l=e=>{try{e()}catch(e){c.push(e)}};do{o.f&&l(o.f);let t=new Set,c=t.add.bind(t);r.forEach(e=>n.get(e)?.l.forEach(c)),r.clear(),a.forEach(c),a.clear(),i.forEach(c),i.clear(),t.forEach(l),r.size&&s(e)}while(r.size||a.size||i.size);if(c.length)throw AggregateError(c)},Tee=e=>{let t=Ah(e),n=t[1],r=t[2],i=t[3],a=t[11],o=t[14],s=t[17],c=[],l=new WeakSet,u=new WeakSet,d=Array.from(i);for(;d.length;){let t=d[d.length-1],i=a(e,t);if(u.has(t)){d.pop();continue}if(l.has(t)){r.get(t)===i.n&&c.push([t,i]),u.add(t),d.pop();continue}l.add(t);for(let e of Oh(t,i,n))l.has(e)||d.push(e)}for(let t=c.length-1;t>=0;--t){let[n,a]=c[t],l=!1;for(let e of a.d.keys())if(e!==n&&i.has(e)){l=!0;break}l&&(o(e,n),s(e,n)),r.delete(n)}},Eee=(e,t)=>{var n,r;let i=Ah(e),a=i[1],o=i[2],s=i[3],c=i[6],l=i[7],u=i[11],d=i[12],f=i[13],p=i[14],m=i[16],h=i[17],g=i[20],_=u(e,t);if(xh(_)){if(a.has(t)&&o.get(t)!==_.n)return _;let n=!1;for(let[t,r]of _.d)if(p(e,t).n!==r){n=!0;break}if(!n)return _}_.d.clear();let v=!0;function y(){a.has(t)&&(h(e,t),f(e),d(e))}function b(n){var r;if(n===t){let t=u(e,n);if(!xh(t))if(yh(n))g(e,n,n.init);else throw Error(`no atom init`);return Sh(t)}let i=p(e,n);try{return Sh(i)}finally{_.d.set(n,i.n),wh(_.v)&&Dh(t,_.v,i),a.has(t)&&((r=a.get(n))==null||r.t.add(t)),v||y()}}let x,S,C={get signal(){return x||=new AbortController,x.signal},get setSelf(){return!S&&bh(t)&&(S=(...n)=>{if(!v)try{return m(e,t,...n)}finally{f(e),d(e)}}),S}},w=_.n;try{let r=l(e,t,b,C);return g(e,t,r),Eh(r)&&(Th(r,()=>x?.abort()),r.then(y,y)),(n=c.r)==null||n.call(c,t),_}catch(e){return delete _.v,_.e=e,++_.n,_}finally{v=!1,w!==_.n&&o.get(t)===w&&(o.set(t,_.n),s.add(t),(r=c.c)==null||r.call(c,t))}},Dee=(e,t)=>{let n=Ah(e),r=n[1],i=n[2],a=n[11],o=[t];for(;o.length;){let t=o.pop(),n=a(e,t);for(let s of Oh(t,n,r)){let t=a(e,s);i.set(s,t.n),o.push(s)}}},Oee=(e,t,...n)=>{let r=Ah(e),i=r[3],a=r[6],o=r[8],s=r[11],c=r[12],l=r[13],u=r[14],d=r[15],f=r[16],p=r[17],m=r[20],h=!0,g=t=>Sh(u(e,t)),_=(n,...r)=>{var o;let u=s(e,n);try{if(n===t){if(!yh(n))throw Error(`atom not writable`);let t=u.n,s=r[0];m(e,n,s),p(e,n),t!==u.n&&(i.add(n),d(e,n),(o=a.c)==null||o.call(a,n));return}else return f(e,n,...r)}finally{h||(l(e),c(e))}};try{return o(e,t,g,_,...n)}finally{h=!1}},kee=(e,t)=>{var n;let r=Ah(e),i=r[1],a=r[3],o=r[6],s=r[11],c=r[15],l=r[18],u=r[19],d=s(e,t),f=i.get(t);if(f&&!wh(d.v)){for(let[r,i]of d.d)if(!f.d.has(r)){let u=s(e,r);l(e,r).t.add(t),f.d.add(r),i!==u.n&&(a.add(r),c(e,r),(n=o.c)==null||n.call(o,r))}for(let n of f.d)d.d.has(n)||(f.d.delete(n),u(e,n)?.t.delete(t))}},Aee=(e,t)=>{var n;let r=Ah(e),i=r[1],a=r[4],o=r[6],s=r[10],c=r[11],l=r[12],u=r[13],d=r[14],f=r[16],p=r[18],m=c(e,t),h=i.get(t);if(!h){d(e,t);for(let n of m.d.keys())p(e,n).t.add(t);h={l:new Set,d:new Set(m.d.keys()),t:new Set},i.set(t,h),bh(t)&&a.add(()=>{let n=!0,r=(...r)=>{try{return f(e,t,...r)}finally{n||(u(e),l(e))}};try{let i=s(e,t,r);i&&(h.u=()=>{n=!0;try{i()}finally{n=!1}})}finally{n=!1}}),(n=o.m)==null||n.call(o,t)}return h},jee=(e,t)=>{var n;let r=Ah(e),i=r[1],a=r[5],o=r[6],s=r[11],c=r[19],l=s(e,t),u=i.get(t);if(!u||u.l.size)return u;let d=!1;for(let e of u.t)if(i.get(e)?.d.has(t)){d=!0;break}if(!d){u.u&&a.add(u.u),u=void 0,i.delete(t);for(let n of l.d.keys())c(e,n)?.t.delete(t);(n=o.u)==null||n.call(o,t);return}return u},Mee=(e,t,n)=>{let r=Ah(e)[11],i=r(e,t),a=`v`in i,o=i.v;if(Eh(n))for(let a of i.d.keys())Dh(t,n,r(e,a));i.v=n,delete i.e,(!a||!Object.is(o,i.v))&&(++i.n,Eh(o)&&vee(o))},Nee=(e,t)=>{let n=Ah(e)[14];return Sh(n(e,t))},Pee=(e,t,...n)=>{let r=Ah(e),i=r[12],a=r[13],o=r[16];try{return o(e,t,...n)}finally{a(e),i(e)}},Fee=(e,t,n)=>{let r=Ah(e),i=r[12],a=r[18],o=r[19],s=a(e,t).l;return s.add(n),i(e),()=>{s.delete(n),o(e,t),i(e)}},kh=new WeakMap,Ah=e=>kh.get(e);function Iee(...e){let t={get(e){let n=Ah(t)[21];return n(t,e)},set(e,...n){let r=Ah(t)[22];return r(t,e,...n)},sub(e,n){let r=Ah(t)[23];return r(t,e,n)}},n=[new WeakMap,new WeakMap,new WeakMap,new Set,new Set,new Set,{},yee,bee,xee,See,Cee,wee,Tee,Eee,Dee,Oee,kee,Aee,jee,Mee,Nee,Pee,Fee,void 0].map((t,n)=>e[n]||t);return kh.set(t,Object.freeze(n)),t}var Lee=0;function jh(e,t){let n=`atom${++Lee}`,r={toString(){return n}};return typeof e==`function`?r.read=e:(r.init=e,r.read=Ree,r.write=zee),t&&(r.write=t),r}function Ree(e){return e(this)}function zee(e,t,n){return t(this,typeof n==`function`?n(e(this)):n)}var Mh;function Bee(){return Mh?Mh():Iee()}var Nh;function Vee(){return Nh||=Bee(),Nh}var Hee=(0,m.createContext)(void 0);function Ph(e){let t=(0,m.useContext)(Hee);return e?.store||t||Vee()}var Fh=e=>typeof e?.then==`function`,Ih=e=>{e.status||(e.status=`pending`,e.then(t=>{e.status=`fulfilled`,e.value=t},t=>{e.status=`rejected`,e.reason=t}))},Uee=m.use||(e=>{if(e.status===`pending`)throw e;if(e.status===`fulfilled`)return e.value;throw e.status===`rejected`?e.reason:(Ih(e),e)}),Lh=new WeakMap,Rh=(e,t)=>{let n=Lh.get(e);return n||(n=new Promise((r,i)=>{let a=e,o=e=>t=>{a===e&&r(t)},s=e=>t=>{a===e&&i(t)},c=()=>{try{let e=t();Fh(e)?(Lh.set(e,n),a=e,e.then(o(e),s(e)),Th(e,c)):r(e)}catch(e){i(e)}};e.then(o(e),s(e)),Th(e,c)}),Lh.set(e,n)),n};function zh(e,t){let{delay:n,unstable_promiseStatus:r=!m.use}=t||{},i=Ph(t),[[a,o,s],c]=(0,m.useReducer)(t=>{let n=i.get(e);return Object.is(t[0],n)&&t[1]===i&&t[2]===e?t:[n,i,e]},void 0,()=>[i.get(e),i,e]),l=a;if((o!==i||s!==e)&&(c(),l=i.get(e)),(0,m.useEffect)(()=>{let t=i.sub(e,()=>{if(r)try{let t=i.get(e);Fh(t)&&Ih(Rh(t,()=>i.get(e)))}catch{}if(typeof n==`number`){setTimeout(c,n);return}c()});return c(),t},[i,e,n,r]),(0,m.useDebugValue)(l),Fh(l)){let t=Rh(l,()=>i.get(e));return r&&Ih(t),Uee(t)}return l}function Bh(e,t){let n=Ph(t);return(0,m.useCallback)((...t)=>n.set(e,...t),[n,e])}function Wee(e,t){return[zh(e,t),Bh(e,t)]}var Gee=jh({open:!1,reactNode:null});function Kee({className:e}){let[t,n]=Wee(Gee),{open:r,reactNode:i,title:a,description:o,className:s,onControlledOpen:c,onControlledClose:l}=t,u=()=>{l&&l(),n({open:!1,reactNode:null})};return(0,m.useEffect)(()=>{r&&c&&c()},[r]),(0,z.jsx)(td,{open:r,onOpenChange:e=>{e||u()},children:(0,z.jsxs)(id,{className:et(`max-w-4xl`,s,e),children:[(0,z.jsxs)(ad,{children:[(0,z.jsx)(sd,{className:a?void 0:`sr-only`,children:a||`Modal`}),(0,z.jsx)(cd,{className:o?void 0:`sr-only`,children:o||`Modal content`})]}),i]})})}var Vh=`rovingFocusGroup.onEntryFocus`,qee={bubbles:!1,cancelable:!0},Hh=`RovingFocusGroup`,[Uh,Wh,Gh]=gt(Hh),[Kh,qh]=it(Hh,[Gh]),[Jh,Jee]=Kh(Hh),Yh=m.forwardRef((e,t)=>(0,z.jsx)(Uh.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,z.jsx)(Uh.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,z.jsx)(Xh,{...e,ref:t})})}));Yh.displayName=Hh;var Xh=m.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:a,currentTabStopId:o,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:c,onEntryFocus:l,preventScrollOnEntryFocus:u=!1,...d}=e,f=m.useRef(null),p=ct(t,f),h=Lt(a),[g,_]=bt({prop:o,defaultProp:s??null,onChange:c,caller:Hh}),[v,y]=m.useState(!1),b=en(l),x=Wh(n),S=m.useRef(!1),[C,w]=m.useState(0);return m.useEffect(()=>{let e=f.current;if(e)return e.addEventListener(Vh,b),()=>e.removeEventListener(Vh,b)},[b]),(0,z.jsx)(Jh,{scope:n,orientation:r,dir:h,loop:i,currentTabStopId:g,onItemFocus:m.useCallback(e=>_(e),[_]),onItemShiftTab:m.useCallback(()=>y(!0),[]),onFocusableItemAdd:m.useCallback(()=>w(e=>e+1),[]),onFocusableItemRemove:m.useCallback(()=>w(e=>e-1),[]),children:(0,z.jsx)(Et.div,{tabIndex:v||C===0?-1:0,"data-orientation":r,...d,ref:p,style:{outline:`none`,...e.style},onMouseDown:_t(e.onMouseDown,()=>{S.current=!0}),onFocus:_t(e.onFocus,e=>{let t=!S.current;if(e.target===e.currentTarget&&t&&!v){let t=new CustomEvent(Vh,qee);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=x().filter(e=>e.focusable);$h([e.find(e=>e.active),e.find(e=>e.id===g),...e].filter(Boolean).map(e=>e.ref.current),u)}}S.current=!1}),onBlur:_t(e.onBlur,()=>y(!1))})})}),Zh=`RovingFocusGroupItem`,Qh=m.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:a,children:o,...s}=e,c=Ft(),l=a||c,u=Jee(Zh,n),d=u.currentTabStopId===l,f=Wh(n),{onFocusableItemAdd:p,onFocusableItemRemove:h,currentTabStopId:g}=u;return m.useEffect(()=>{if(r)return p(),()=>h()},[r,p,h]),(0,z.jsx)(Uh.ItemSlot,{scope:n,id:l,focusable:r,active:i,children:(0,z.jsx)(Et.span,{tabIndex:d?0:-1,"data-orientation":u.orientation,...s,ref:t,onMouseDown:_t(e.onMouseDown,e=>{r?u.onItemFocus(l):e.preventDefault()}),onFocus:_t(e.onFocus,()=>u.onItemFocus(l)),onKeyDown:_t(e.onKeyDown,e=>{if(e.key===`Tab`&&e.shiftKey){u.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=Zee(e,u.orientation,u.dir);if(t!==void 0){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let n=f().filter(e=>e.focusable).map(e=>e.ref.current);if(t===`last`)n.reverse();else if(t===`prev`||t===`next`){t===`prev`&&n.reverse();let r=n.indexOf(e.currentTarget);n=u.loop?eg(n,r+1):n.slice(r+1)}setTimeout(()=>$h(n))}}),children:typeof o==`function`?o({isCurrentTabStop:d,hasTabStop:g!=null}):o})})});Qh.displayName=Zh;var Yee={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function Xee(e,t){return t===`rtl`?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}function Zee(e,t,n){let r=Xee(e.key,n);if(!(t===`vertical`&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===`horizontal`&&[`ArrowUp`,`ArrowDown`].includes(r)))return Yee[r]}function $h(e,t=!1){let n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function eg(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var tg=Yh,ng=Qh,rg=m.forwardRef(({className:e,type:t,onValueChange:n,onChange:r,...i},a)=>{let o=e=>{n?.(e.target.value),r?.(e)};return(0,z.jsx)(`input`,{type:t,"data-slot":`input`,className:et(`file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex h-9 w-full min-w-0 rounded-md border px-3 py-1 text-base bg-input-background transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm`,`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`,e),ref:a,...i,onChange:o})});rg.displayName=`Input`;var ig=e=>(0,z.jsx)(`svg`,{viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`,...e,children:(0,z.jsxs)(`g`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,children:[(0,z.jsx)(`path`,{d:`M8 2v4m8-4v4`}),(0,z.jsx)(`rect`,{width:18,height:18,x:3,y:4,rx:2}),(0,z.jsx)(`path`,{d:`M3 10h18`})]})});function ag({value:e,onValueChange:t,placeholder:n,disabled:r=!1,className:i}){let{SD:a}=$u(),o=n??a(`rc.datePicker.pickDate`);return(0,z.jsxs)(hh,{children:[(0,z.jsx)(gh,{asChild:!0,children:(0,z.jsxs)(B,{variant:`outline`,disabled:r,"data-empty":!e,className:et(`w-full justify-start text-left font-normal`,`data-[empty=true]:text-muted-foreground`,i),children:[(0,z.jsx)(ig,{}),e?ho(e,`PPP`):(0,z.jsx)(`span`,{children:o})]})}),(0,z.jsx)(_h,{className:`w-auto p-0`,align:`start`,children:(0,z.jsx)(Pc,{mode:`single`,selected:e,onSelect:e=>{t?.(e)},initialFocus:!0})})]})}var og=e=>(0,z.jsx)(`svg`,{viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`,...e,children:(0,z.jsx)(`path`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M21 12a9 9 0 1 1-6.219-8.56`})}),sg=`Separator`,cg=`horizontal`,lg=[`horizontal`,`vertical`],ug=m.forwardRef((e,t)=>{let{decorative:n,orientation:r=cg,...i}=e,a=dg(r)?r:cg,o=n?{role:`none`}:{"aria-orientation":a===`vertical`?a:void 0,role:`separator`};return(0,z.jsx)(Hi.div,{"data-orientation":a,...o,...i,ref:t})});ug.displayName=sg;function dg(e){return lg.includes(e)}var fg=ug,pg=m.forwardRef(({className:e,orientation:t=`horizontal`,decorative:n=!0,...r},i)=>(0,z.jsx)(fg,{ref:i,decorative:n,orientation:t,className:et(`shrink-0 bg-border`,t===`horizontal`?`h-px w-full`:`h-full w-px`,e),...r}));pg.displayName=fg.displayName;function Qee(e){return typeof e==`object`&&!!e&&`value`in e}function $ee(e,t){let n=e.multiple===!0,r=e.async===!0,i=(0,m.useRef)(null);(0,m.useImperativeHandle)(t,()=>i.current);let[a,o]=(0,m.useState)(!1),[s,c]=(0,m.useState)(``),[l,u]=(0,m.useState)(new Map),d=r&&`onOpenChange`in e?e.onOpenChange:void 0,f=(0,m.useRef)(a);(0,m.useEffect)(()=>{f.current!==a&&(d&&d(a),f.current=a)},[a,d]);let p=(0,m.useCallback)(t=>t==null?``:e.valueKey?e.valueKey(t):String(t),[e.valueKey]),h=(0,m.useMemo)(()=>e.items.map(e=>Qee(e)?e:{value:e}),[e.items]),g=(0,m.useMemo)(()=>{let e=new Map;for(let t of h)e.set(p(t.value),t.value);return e},[h,p]),_=(0,m.useCallback)(t=>{if(e.renderItem)return e.renderItem(t);let n=h.find(e=>e.value===t);if(n?.label!==void 0)return n.label;if(r){let e=l.get(p(t));if(e?.label!==void 0)return e.label}return String(t)},[e.renderItem,h,r,l,p]);(0,m.useEffect)(()=>{if(!r)return;let t=n?e.value:[e.value].filter(Boolean),i=new Map;for(let e of t){let t=p(e),n=h.find(t=>t.value===e);n&&i.set(t,n)}u(i)},[r,n,e,h,p]);let v=(0,m.useCallback)(e=>{c(e)},[]),y=r&&`onSearch`in e?e.onSearch:void 0,b=r&&`searchDebounce`in e&&e.searchDebounce!==void 0?e.searchDebounce:300;(0,m.useEffect)(()=>{if(!y)return;let e=setTimeout(()=>{y(s)},s===``?0:b);return()=>clearTimeout(e)},[s,y,b]);let x=(0,m.useMemo)(()=>{if(r){let e=new Map;for(let[t,n]of l)e.set(t,n);for(let t of h)e.set(p(t.value),t);return Array.from(e.values())}else return s?h.filter(e=>{let t=_(e.value);return String(t).toLowerCase().includes(s.toLowerCase())}):h},[r,h,l,s,p,_]);return(0,m.useEffect)(()=>{a||c(``)},[a]),{isMultiple:n,isAsync:r,selectRef:i,isPopoverOpen:a,setIsPopoverOpen:o,searchValue:s,handleSearchChange:v,filteredOptions:x,normalizedItems:h,getKeyForValue:p,valueByKey:g,getItemLabel:_}}function ete(e,t){if(!t||typeof e!=`string`)return e;let n=e.toLowerCase(),r=t.toLowerCase(),i=n.indexOf(r);if(i===-1)return e;let a=e.slice(0,i),o=e.slice(i,i+t.length),s=e.slice(i+t.length);return(0,z.jsxs)(z.Fragment,{children:[a,(0,z.jsx)(`strong`,{className:`font-bold`,children:o}),s]})}function tte({props:e,isMultiple:t,isAsync:n,isPopoverOpen:r,setIsPopoverOpen:i,searchValue:a,handleSearchChange:o,filteredOptions:s,getKeyForValue:c,getItemLabel:l}){let{SD:u}=$u(),[d,f]=(0,m.useState)(null),p=(0,m.useCallback)(e=>{f(e)},[]),[h,g]=(0,m.useState)(null),_=(0,m.useCallback)(e=>{g(e)},[]),v=n&&`onLoadMore`in e?e.onLoadMore:void 0,y=n&&`hasMore`in e?e.hasMore??!1:!1,b=n&&`isLoadingMore`in e?e.isLoadingMore??!1:!1,x=n&&v!==void 0;(0,m.useEffect)(()=>{if(!v||!y||b||!h||!d)return;let e=new IntersectionObserver(e=>{for(let t of e)t.isIntersecting&&v()},{root:d,threshold:0});return e.observe(h),()=>e.disconnect()},[h,d,v,y,b]);let S=e.searchable??n,C=(0,m.useCallback)(e=>{let t=d;if(!t)return;let n=t.scrollTop<t.scrollHeight-t.clientHeight,r=t.scrollTop>0;(e.deltaY>0&&n||e.deltaY<0&&r)&&e.stopPropagation()},[d]),w=(0,m.useCallback)(n=>{if(!e.disabled)if(t){let t=e.value,r=t.includes(n)?t.filter(e=>e!==n):[...t,n];e.onValueChange(r)}else e.onValueChange?.(n),i(!1)},[t,e,i]),T=(0,m.useCallback)(()=>{if(!t||e.disabled)return;let n=s.filter(e=>!e.disabled);if(e.value.length===n.length)e.onValueChange([]);else{let t=n.map(e=>e.value);e.onValueChange(t)}},[t,e,s]),E=(0,m.useCallback)(()=>{e.disabled||(t?e.onValueChange([]):e.onValueChange?.(void 0))},[t,e]),D=(0,m.useCallback)(n=>t?e.value.includes(n):e.value===n,[t,e]),O=n&&`loading`in e?e.loading:!1,k=n&&`error`in e?e.error:void 0,A=t?e.value.length>0:e.value!==void 0&&e.value!==null&&e.value!==``;return(0,z.jsxs)(hh,{open:r,onOpenChange:i,children:[(0,z.jsx)(gh,{asChild:!0,children:(0,z.jsx)(B,{variant:`outline`,role:`combobox`,"aria-expanded":r,disabled:e.disabled||O,className:et(`flex p-1 rounded-md border border-input min-h-10 h-auto items-center justify-between bg-white hover:bg-white hover:text-inherit [&_svg]:pointer-events-auto w-full`,e.className),children:t&&A?(0,z.jsxs)(`div`,{className:`flex justify-between items-center w-full`,children:[(0,z.jsx)(`div`,{className:`flex items-center gap-1 flex-wrap`,children:(()=>{if(!t)return null;let n=e.value;return(0,z.jsx)(z.Fragment,{children:n.map(e=>{let t=c(e);return(0,z.jsxs)(Ki,{variant:`outline`,className:`m-1 transition-all duration-300 ease-in-out`,children:[l(e),(0,z.jsx)(vh,{className:`ml-2 h-3 w-3 cursor-pointer !pointer-events-auto`,onPointerDownCapture:e=>{e.stopPropagation()},onMouseDownCapture:e=>{e.stopPropagation()},onClick:t=>{t.stopPropagation(),w(e)}})]},t)})})})()}),(0,z.jsxs)(`div`,{className:`flex items-center justify-between`,children:[e.clearable&&(0,z.jsx)(`div`,{role:`button`,tabIndex:0,onPointerDownCapture:e=>{e.stopPropagation()},onMouseDownCapture:e=>{e.stopPropagation()},onClick:e=>{e.stopPropagation(),E()},className:`flex items-center justify-center h-4 w-4 mx-2 cursor-pointer text-muted-foreground hover:text-foreground`,children:(0,z.jsx)(ed,{className:`h-4 w-4`})}),(0,z.jsx)(pg,{orientation:`vertical`,className:`flex min-h-6 h-full`}),(0,z.jsx)(nt,{className:`h-4 mx-2 cursor-pointer text-muted-foreground`})]})]}):!t&&A?(0,z.jsxs)(`div`,{className:`flex justify-between items-center w-full px-2 py-1`,children:[(()=>{let t=e.value;return t==null?null:(0,z.jsx)(`span`,{className:`flex-1 truncate text-left text-sm`,children:l(t)})})(),(0,z.jsxs)(`div`,{className:`flex items-center gap-1 shrink-0`,children:[e.clearable&&A&&(0,z.jsx)(vh,{className:`h-4 w-4 cursor-pointer opacity-50 hover:opacity-100 transition-opacity`,onPointerDownCapture:E,onMouseDownCapture:E}),(0,z.jsx)(nt,{className:`h-4 w-4 opacity-50`})]})]}):(0,z.jsxs)(`div`,{className:`flex items-center justify-between w-full px-2 py-1`,children:[(0,z.jsx)(`span`,{className:`text-sm text-muted-foreground flex-1 truncate text-left`,children:e.placeholder}),(0,z.jsx)(nt,{className:`h-4 cursor-pointer text-muted-foreground`})]})})}),(0,z.jsx)(_h,{className:`min-w-40 p-0`,align:`start`,style:{width:`var(--radix-popover-trigger-width)`},children:(0,z.jsxs)(of,{shouldFilter:!1,children:[S&&(0,z.jsx)(cf,{placeholder:u(`common.searchPlaceholder`),value:a,onValueChange:o}),(0,z.jsx)(lf,{ref:p,onWheel:C,children:O?(0,z.jsx)(uf,{children:(0,z.jsx)(`div`,{className:`flex items-center justify-center`,children:(0,z.jsx)(og,{className:`h-4 w-4 animate-spin mr-2`})})}):k?(0,z.jsxs)(uf,{children:[`Error: `,k.message]}):s.length===0?(0,z.jsx)(uf,{children:u(`rc.multiSelect.noResults`)}):(0,z.jsxs)(z.Fragment,{children:[t&&!(`hideSelectAll`in e&&e.hideSelectAll)&&(0,z.jsx)(df,{children:(0,z.jsxs)(pf,{onSelect:T,className:`cursor-pointer`,children:[(0,z.jsx)(`div`,{className:et(`mr-2 flex h-4 w-4 items-center justify-center rounded-sm border border-primary`,e.value.length===s.filter(e=>!e.disabled).length?`bg-primary text-primary-foreground`:`opacity-50 [&_svg]:invisible`),children:(0,z.jsx)(Fc,{className:`h-4 w-4`})}),(0,z.jsxs)(`span`,{children:[`(`,u(`rc.multiSelect.selectAll`),`)`]})]})}),(0,z.jsx)(df,{children:s.map(e=>{let n=c(e.value),r=D(e.value);return(0,z.jsxs)(pf,{onSelect:()=>w(e.value),disabled:e.disabled,className:et(`cursor-pointer`,e.disabled&&`opacity-50 cursor-not-allowed`),children:[t&&(0,z.jsx)(`div`,{className:et(`mr-2 flex h-4 w-4 items-center justify-center rounded-sm border border-primary`,r?`bg-primary text-primary-foreground`:`opacity-50 [&_svg]:invisible`),children:(0,z.jsx)(Fc,{className:`h-4 w-4`})}),!t&&(0,z.jsx)(Fc,{className:et(`mr-2 h-4 w-4`,r?`opacity-100`:`opacity-0`)}),(0,z.jsx)(`span`,{children:ete(l(e.value),a)})]},n)})}),x&&(0,z.jsx)(`div`,{ref:_,className:`flex items-center justify-center py-2 text-xs text-muted-foreground`,children:b?(0,z.jsx)(og,{className:`h-3 w-3 animate-spin`}):null})]})})]})})]})}var mg=m.forwardRef(function(e,t){let n=$ee(e,t);return(0,z.jsx)(tte,{props:e,isMultiple:n.isMultiple,isAsync:n.isAsync,isPopoverOpen:n.isPopoverOpen,setIsPopoverOpen:n.setIsPopoverOpen,searchValue:n.searchValue,handleSearchChange:n.handleSearchChange,filteredOptions:n.filteredOptions,getKeyForValue:n.getKeyForValue,getItemLabel:n.getItemLabel})}),hg=Object.freeze({position:`absolute`,border:0,width:1,height:1,padding:0,margin:-1,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,wordWrap:`normal`}),gg=`VisuallyHidden`,_g=m.forwardRef((e,t)=>(0,z.jsx)(Et.span,{...e,ref:t,style:{...hg,...e.style}}));_g.displayName=gg;var vg=_g;function yg({enum:e,labels:t,value:n,onValueChange:r,placeholder:i,textPrefix:a=``,clearable:o=!1,disabled:s=!1,className:c,multiple:l=!1}){let u=m.useMemo(()=>e.options.filter(e=>e!==``),[e]),d=m.useMemo(()=>u.map(e=>({value:e,label:a+t[e]})),[u,t,a]);return l?(0,z.jsx)(mg,{items:d,value:n??[],onValueChange:e=>{r?.(e)},placeholder:i,clearable:o,disabled:s,className:c,multiple:!0,async:!1}):(0,z.jsx)(mg,{items:d,value:n??``,onValueChange:e=>{r?.(e)},placeholder:i,clearable:o,disabled:s,className:c,multiple:!1,async:!1})}var bg=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},xg={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},Sg=new class{#e=xg;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function nte(e){setTimeout(e,0)}var Cg=typeof window>`u`||`Deno`in globalThis;function wg(){}function rte(e,t){return typeof e==`function`?e(t):e}function Tg(e){return typeof e==`number`&&e>=0&&e!==1/0}function Eg(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Dg(e,t){return typeof e==`function`?e(t):e}function Og(e,t){return typeof e==`function`?e(t):e}function kg(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==jg(o,t.options))return!1}else if(!Ng(t.queryKey,o))return!1}if(n!==`all`){let e=t.isActive();if(n===`active`&&!e||n===`inactive`&&e)return!1}return!(typeof s==`boolean`&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function Ag(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(Mg(t.options.mutationKey)!==Mg(a))return!1}else if(!Ng(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function jg(e,t){return(t?.queryKeyHashFn||Mg)(e)}function Mg(e){return JSON.stringify(e,(e,t)=>Rg(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function Ng(e,t){return e===t?!0:typeof e==typeof t&&e&&t&&typeof e==`object`&&typeof t==`object`?Object.keys(t).every(n=>Ng(e[n],t[n])):!1}var Pg=Object.prototype.hasOwnProperty;function Fg(e,t){if(e===t)return e;let n=Lg(e)&&Lg(t);if(!n&&!(Rg(e)&&Rg(t)))return t;let r=(n?e:Object.keys(e)).length,i=n?t:Object.keys(t),a=i.length,o=n?Array(a):{},s=0;for(let c=0;c<a;c++){let a=n?c:i[c],l=e[a],u=t[a];if(l===u){o[a]=l,(n?c<r:Pg.call(e,a))&&s++;continue}if(l===null||u===null||typeof l!=`object`||typeof u!=`object`){o[a]=u;continue}let d=Fg(l,u);o[a]=d,d===l&&s++}return r===a&&s===r?e:o}function Ig(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function Lg(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Rg(e){if(!zg(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!zg(n)||!n.hasOwnProperty(`isPrototypeOf`)||Object.getPrototypeOf(e)!==Object.prototype)}function zg(e){return Object.prototype.toString.call(e)===`[object Object]`}function Bg(e){return new Promise(t=>{Sg.setTimeout(t,e)})}function Vg(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:Fg(e,t)}function Hg(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function Ug(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var Wg=Symbol();function Gg(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===Wg?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function ite(e,t){return typeof e==`function`?e(...t):!!e}var Kg=new class extends bg{#e;#t;#n;constructor(){super(),this.#n=e=>{if(!Cg&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}};function qg(){let e,t,n=new Promise((n,r)=>{e=n,t=r});n.status=`pending`,n.catch(()=>{});function r(e){Object.assign(n,e),delete n.resolve,delete n.reject}return n.resolve=t=>{r({status:`fulfilled`,value:t}),e(t)},n.reject=e=>{r({status:`rejected`,reason:e}),t(e)},n}var ate=nte;function ote(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=ate,a=r=>{t?e.push(r):i(()=>{n(r)})},o=()=>{let t=e;e=[],t.length&&i(()=>{r(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||o()}return n},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}var Jg=ote(),Yg=new class extends bg{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(!Cg&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener(`online`,t,!1),window.addEventListener(`offline`,n,!1),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};function ste(e){return Math.min(1e3*2**e,3e4)}function Xg(e){return(e??`online`)===`online`?Yg.isOnline():!0}var Zg=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function Qg(e){let t=!1,n=0,r,i=qg(),a=()=>i.status!==`pending`,o=t=>{if(!a()){let n=new Zg(t);f(n),e.onCancel?.(n)}},s=()=>{t=!0},c=()=>{t=!1},l=()=>Kg.isFocused()&&(e.networkMode===`always`||Yg.isOnline())&&e.canRun(),u=()=>Xg(e.networkMode)&&e.canRun(),d=e=>{a()||(r?.(),i.resolve(e))},f=e=>{a()||(r?.(),i.reject(e))},p=()=>new Promise(t=>{r=e=>{(a()||l())&&t(e)},e.onPause?.()}).then(()=>{r=void 0,a()||e.onContinue?.()}),m=()=>{if(a())return;let r,i=n===0?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(d).catch(r=>{if(a())return;let i=e.retry??(Cg?0:3),o=e.retryDelay??ste,s=typeof o==`function`?o(n,r):o,c=i===!0||typeof i==`number`&&n<i||typeof i==`function`&&i(n,r);if(t||!c){f(r);return}n++,e.onFail?.(n,r),Bg(s).then(()=>l()?void 0:p()).then(()=>{t?f(r):m()})})};return{promise:i,status:()=>i.status,cancel:o,continue:()=>(r?.(),i),cancelRetry:s,continueRetry:c,canStart:u,start:()=>(u()?m():p().then(m),i)}}var $g=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Tg(this.gcTime)&&(this.#e=Sg.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Cg?1/0:300*1e3))}clearGcTimeout(){this.#e&&=(Sg.clearTimeout(this.#e),void 0)}},e_=class extends $g{#e;#t;#n;#r;#i;#a;#o;constructor(e){super(),this.#o=!1,this.#a=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#r=e.client,this.#n=this.#r.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#e=r_(this.options),this.state=e.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#i?.promise}setOptions(e){if(this.options={...this.#a,...e},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=r_(this.options);e.data!==void 0&&(this.setState(n_(e.data,e.dataUpdatedAt)),this.#e=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#n.remove(this)}setData(e,t){let n=Vg(this.state.data,e,this.options);return this.#s({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e,t){this.#s({type:`setState`,state:e,setStateOptions:t})}cancel(e){let t=this.#i?.promise;return this.#i?.cancel(e),t?t.then(wg).catch(wg):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#e)}isActive(){return this.observers.some(e=>Og(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Wg||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>Dg(e.options.staleTime,this)===`static`):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e===`static`?!1:this.state.isInvalidated?!0:!Eg(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#i?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#i?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#i&&(this.#o?this.#i.cancel({revert:!0}):this.#i.cancelRetry()),this.scheduleGc()),this.#n.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#s({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#i?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#i)return this.#i.continueRetry(),this.#i.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,r=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#o=!0,n.signal)})},i=()=>{let e=Gg(this.options,t),n=(()=>{let e={client:this.#r,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#o=!1,this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#r,state:this.state,fetchFn:i};return r(e),e})();this.options.behavior?.onFetch(a,this),this.#t=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#s({type:`fetch`,meta:a.fetchOptions?.meta}),this.#i=Qg({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof Zg&&e.revert&&this.setState({...this.#t,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#s({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#s({type:`pause`})},onContinue:()=>{this.#s({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{let e=await this.#i.start();if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#n.config.onSuccess?.(e,this),this.#n.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof Zg){if(e.silent)return this.#i.promise;if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#s({type:`error`,error:e}),this.#n.config.onError?.(e,this),this.#n.config.onSettled?.(this.state.data,e,this),e}finally{this.scheduleGc()}}#s(e){let t=t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:return{...t,...t_(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...n_(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#t=e.manual?n:void 0,n;case`error`:let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:`idle`,status:`error`};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}};this.state=t(this.state),Jg.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#n.notify({query:this,type:`updated`,action:e})})}};function t_(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Xg(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function n_(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function r_(e){let t=typeof e.initialData==`function`?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt==`function`?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?`success`:`pending`,fetchStatus:`idle`}}var i_=class extends bg{constructor(e,t){super(),this.options=t,this.#e=e,this.#s=null,this.#o=qg(),this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p;#m=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),o_(this.#t,this.options)?this.#h():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return s_(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return s_(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(e){let t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!=`boolean`&&typeof this.options.enabled!=`function`&&typeof Og(this.options.enabled,this.#t)!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#S(),this.#t.setOptions(this.options),t._defaulted&&!Ig(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&c_(this.#t,n,this.options,t)&&this.#h(),this.updateResult(),r&&(this.#t!==n||Og(this.options.enabled,this.#t)!==Og(t.enabled,this.#t)||Dg(this.options.staleTime,this.#t)!==Dg(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||Og(this.options.enabled,this.#t)!==Og(t.enabled,this.#t)||i!==this.#p)&&this.#v(i)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return u_(this,n)&&(this.#r=n,this.#a=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),n===`promise`&&(this.trackProp(`data`),!this.options.experimental_prefetchInRender&&this.#o.status===`pending`&&this.#o.reject(Error(`experimental_prefetchInRender feature flag is not enabled`))),Reflect.get(e,n))})}trackProp(e){this.#m.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#h({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#h(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(wg)),t}#g(){this.#b();let e=Dg(this.options.staleTime,this.#t);if(Cg||this.#r.isStale||!Tg(e))return;let t=Eg(this.#r.dataUpdatedAt,e)+1;this.#d=Sg.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return(typeof this.options.refetchInterval==`function`?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(e){this.#x(),this.#p=e,!(Cg||Og(this.options.enabled,this.#t)===!1||!Tg(this.#p)||this.#p===0)&&(this.#f=Sg.setInterval(()=>{(this.options.refetchIntervalInBackground||Kg.isFocused())&&this.#h()},this.#p))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#d&&=(Sg.clearTimeout(this.#d),void 0)}#x(){this.#f&&=(Sg.clearInterval(this.#f),void 0)}createResult(e,t){let n=this.#t,r=this.options,i=this.#r,a=this.#i,o=this.#a,s=e===n?this.#n:e.state,{state:c}=e,l={...c},u=!1,d;if(t._optimisticResults){let i=this.hasListeners(),a=!i&&o_(e,t),o=i&&c_(e,n,t,r);(a||o)&&(l={...l,...t_(c.data,e.options)}),t._optimisticResults===`isRestoring`&&(l.fetchStatus=`idle`)}let{error:f,errorUpdatedAt:p,status:m}=l;d=l.data;let h=!1;if(t.placeholderData!==void 0&&d===void 0&&m===`pending`){let e;i?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(e=i.data,h=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#u?.state.data,this.#u):t.placeholderData,e!==void 0&&(m=`success`,d=Vg(i?.data,e,t),u=!0)}if(t.select&&d!==void 0&&!h)if(i&&d===a?.data&&t.select===this.#c)d=this.#l;else try{this.#c=t.select,d=t.select(d),d=Vg(i?.data,d,t),this.#l=d,this.#s=null}catch(e){this.#s=e}this.#s&&(f=this.#s,d=this.#l,p=Date.now(),m=`error`);let g=l.fetchStatus===`fetching`,_=m===`pending`,v=m===`error`,y=_&&g,b=d!==void 0,x={status:m,fetchStatus:l.fetchStatus,isPending:_,isSuccess:m===`success`,isError:v,isInitialLoading:y,isLoading:y,data:d,dataUpdatedAt:l.dataUpdatedAt,error:f,errorUpdatedAt:p,failureCount:l.fetchFailureCount,failureReason:l.fetchFailureReason,errorUpdateCount:l.errorUpdateCount,isFetched:l.dataUpdateCount>0||l.errorUpdateCount>0,isFetchedAfterMount:l.dataUpdateCount>s.dataUpdateCount||l.errorUpdateCount>s.errorUpdateCount,isFetching:g,isRefetching:g&&!_,isLoadingError:v&&!b,isPaused:l.fetchStatus===`paused`,isPlaceholderData:u,isRefetchError:v&&b,isStale:l_(e,t),refetch:this.refetch,promise:this.#o,isEnabled:Og(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){let t=e=>{x.status===`error`?e.reject(x.error):x.data!==void 0&&e.resolve(x.data)},r=()=>{t(this.#o=x.promise=qg())},i=this.#o;switch(i.status){case`pending`:e.queryHash===n.queryHash&&t(i);break;case`fulfilled`:(x.status===`error`||x.data!==i.value)&&r();break;case`rejected`:(x.status!==`error`||x.error!==i.reason)&&r();break}}return x}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#u=this.#t),!Ig(t,e)&&(this.#r=t,this.#C({listeners:(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#m.size)return!0;let r=new Set(n??this.#m);return this.options.throwOnError&&r.add(`error`),Object.keys(this.#r).some(t=>{let n=t;return this.#r[n]!==e[n]&&r.has(n)})})()}))}#S(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;let t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}#C(e){Jg.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}};function a_(e,t){return Og(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status===`error`&&t.retryOnMount===!1)}function o_(e,t){return a_(e,t)||e.state.data!==void 0&&s_(e,t,t.refetchOnMount)}function s_(e,t,n){if(Og(t.enabled,e)!==!1&&Dg(t.staleTime,e)!==`static`){let r=typeof n==`function`?n(e):n;return r===`always`||r!==!1&&l_(e,t)}return!1}function c_(e,t,n,r){return(e!==t||Og(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&l_(e,n)}function l_(e,t){return Og(t.enabled,e)!==!1&&e.isStaleByTime(Dg(t.staleTime,e))}function u_(e,t){return!Ig(e.getCurrentResult(),t)}function d_(e){return{onFetch:(t,n)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,l=async()=>{let n=!1,l=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(t.signal.aborted?n=!0:t.signal.addEventListener(`abort`,()=>{n=!0}),t.signal)})},u=Gg(t.options,t.fetchOptions),d=async(e,r,i)=>{if(n)return Promise.reject();if(r==null&&e.pages.length)return Promise.resolve(e);let a=await u((()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return l(e),e})()),{maxPages:o}=t.options,s=i?Ug:Hg;return{pages:s(e.pages,a,o),pageParams:s(e.pageParams,r,o)}};if(i&&a.length){let e=i===`backward`,t=e?p_:f_,n={pages:a,pageParams:o};s=await d(n,t(r,n),e)}else{let t=e??a.length;do{let e=c===0?o[0]??r.initialPageParam:f_(r,s);if(c>0&&e==null)break;s=await d(s,e),c++}while(c<t)}return s};t.options.persister?t.fetchFn=()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=l}}}function f_(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function p_(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var m_=class extends $g{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||h_(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??this.execute(this.state.variables)}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#r=Qg({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});let r=this.state.status===`pending`,i=!this.#r.canStart();try{if(r)t();else{this.#i({type:`pending`,variables:e,isPaused:i}),await this.#n.config.onMutate?.(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:i})}let a=await this.#r.start();return await this.#n.config.onSuccess?.(a,e,this.state.context,this,n),await this.options.onSuccess?.(a,e,this.state.context,n),await this.#n.config.onSettled?.(a,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(a,null,e,this.state.context,n),this.#i({type:`success`,data:a}),a}catch(t){try{throw await this.#n.config.onError?.(t,e,this.state.context,this,n),await this.options.onError?.(t,e,this.state.context,n),await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(void 0,t,e,this.state.context,n),t}finally{this.#i({type:`error`,error:t})}}finally{this.#n.runNext(this)}}#i(e){let t=t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:`pending`,variables:e.variables,submittedAt:Date.now()};case`success`:return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}};this.state=t(this.state),Jg.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function h_(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var g_=class extends bg{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,t,n){let r=new m_({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);let t=__(e);if(typeof t==`string`){let n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:`added`,mutation:e})}remove(e){if(this.#e.delete(e)){let t=__(e);if(typeof t==`string`){let n=this.#t.get(t);if(n)if(n.length>1){let t=n.indexOf(e);t!==-1&&n.splice(t,1)}else n[0]===e&&this.#t.delete(t)}}this.notify({type:`removed`,mutation:e})}canRun(e){let t=__(e);if(typeof t==`string`){let n=this.#t.get(t)?.find(e=>e.state.status===`pending`);return!n||n===e}else return!0}runNext(e){let t=__(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){Jg.batch(()=>{this.#e.forEach(e=>{this.notify({type:`removed`,mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>Ag(t,e))}findAll(e={}){return this.getAll().filter(t=>Ag(e,t))}notify(e){Jg.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return Jg.batch(()=>Promise.all(e.map(e=>e.continue().catch(wg))))}};function __(e){return e.options.scope?.id}var v_=class extends bg{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){let r=t.queryKey,i=t.queryHash??jg(r,t),a=this.get(i);return a||(a=new e_({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:`added`,query:e}))}remove(e){let t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:`removed`,query:e}))}clear(){Jg.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>kg(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>kg(e,t)):t}notify(e){Jg.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){Jg.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Jg.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},y_=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new v_,this.#t=e.mutationCache||new g_,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=Kg.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=Yg.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:`fetching`}).length}isMutating(e){return this.#t.findAll({...e,status:`pending`}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(Dg(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){let r=this.defaultQueryOptions({queryKey:e}),i=this.#e.get(r.queryHash)?.state.data,a=rte(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return Jg.batch(()=>this.#e.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){let t=this.#e;Jg.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return Jg.batch(()=>(n.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,...e},t)))}cancelQueries(e,t={}){let n={revert:!0,...t},r=Jg.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(wg).catch(wg)}invalidateQueries(e,t={}){return Jg.batch(()=>(this.#e.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType===`none`?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??`active`},t)))}refetchQueries(e,t={}){let n={...t,cancelRefetch:t.cancelRefetch??!0},r=Jg.batch(()=>this.#e.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,n);return n.throwOnError||(t=t.catch(wg)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(r).then(wg)}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t);return n.isStaleByTime(Dg(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(wg).catch(wg)}fetchInfiniteQuery(e){return e.behavior=d_(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(wg).catch(wg)}ensureInfiniteQueryData(e){return e.behavior=d_(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Yg.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(Mg(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{Ng(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(Mg(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{Ng(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||=jg(t.queryKey,t),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!==`always`),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode=`offlineFirst`),t.queryFn===Wg&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},b_=m.createContext(void 0),x_=e=>{let t=m.useContext(b_);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},S_=({client:e,children:t})=>(m.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,z.jsx)(b_.Provider,{value:e,children:t})),C_=m.createContext(!1),w_=()=>m.useContext(C_);C_.Provider;function T_(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var E_=m.createContext(T_()),D_=()=>m.useContext(E_),O_=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},k_=e=>{m.useEffect(()=>{e.clearReset()},[e])},A_=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||ite(n,[e.error,r])),j_=e=>{if(e.suspense){let t=1e3,n=e=>e===`static`?e:Math.max(e??t,t),r=e.staleTime;e.staleTime=typeof r==`function`?(...e)=>n(r(...e)):n(r),typeof e.gcTime==`number`&&(e.gcTime=Math.max(e.gcTime,t))}},cte=(e,t)=>e.isLoading&&e.isFetching&&!t,lte=(e,t)=>e?.suspense&&t.isPending,M_=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function ute(e,t,n){let r=w_(),i=D_(),a=x_(n),o=a.defaultQueryOptions(e);a.getDefaultOptions().queries?._experimental_beforeQuery?.(o),o._optimisticResults=r?`isRestoring`:`optimistic`,j_(o),O_(o,i),k_(i);let s=!a.getQueryCache().get(o.queryHash),[c]=m.useState(()=>new t(a,o)),l=c.getOptimisticResult(o),u=!r&&e.subscribed!==!1;if(m.useSyncExternalStore(m.useCallback(e=>{let t=u?c.subscribe(Jg.batchCalls(e)):wg;return c.updateResult(),t},[c,u]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),m.useEffect(()=>{c.setOptions(o)},[o,c]),lte(o,l))throw M_(o,c,i);if(A_({result:l,errorResetBoundary:i,throwOnError:o.throwOnError,query:a.getQueryCache().get(o.queryHash),suspense:o.suspense}))throw l.error;return a.getDefaultOptions().queries?._experimental_afterQuery?.(o,l),o.experimental_prefetchInRender&&!Cg&&cte(l,r)&&(s?M_(o,c,i):a.getQueryCache().get(o.queryHash)?.promise)?.catch(wg).finally(()=>{c.updateResult()}),o.notifyOnChangeProps?l:c.trackResult(l)}function N_(e,t){return ute(e,i_,t)}var[P_,dte]=it(`Tooltip`,[wm]),F_=wm(),I_=`TooltipProvider`,L_=700,R_=`tooltip.open`,[z_,B_]=P_(I_),V_=e=>{let{__scopeTooltip:t,delayDuration:n=L_,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:a}=e,o=m.useRef(!0),s=m.useRef(!1),c=m.useRef(0);return m.useEffect(()=>{let e=c.current;return()=>window.clearTimeout(e)},[]),(0,z.jsx)(z_,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:m.useCallback(()=>{window.clearTimeout(c.current),o.current=!1},[]),onClose:m.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.current=!0,r)},[r]),isPointerInTransitRef:s,onPointerInTransitChange:m.useCallback(e=>{s.current=e},[]),disableHoverableContent:i,children:a})};V_.displayName=I_;var H_=`Tooltip`,[U_,W_]=P_(H_),G_=e=>{let{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:a,disableHoverableContent:o,delayDuration:s}=e,c=B_(H_,e.__scopeTooltip),l=F_(t),[u,d]=m.useState(null),f=Ft(),p=m.useRef(0),h=o??c.disableHoverableContent,g=s??c.delayDuration,_=m.useRef(!1),[v,y]=bt({prop:r,defaultProp:i??!1,onChange:e=>{e?(c.onOpen(),document.dispatchEvent(new CustomEvent(R_))):c.onClose(),a?.(e)},caller:H_}),b=m.useMemo(()=>v?_.current?`delayed-open`:`instant-open`:`closed`,[v]),x=m.useCallback(()=>{window.clearTimeout(p.current),p.current=0,_.current=!1,y(!0)},[y]),S=m.useCallback(()=>{window.clearTimeout(p.current),p.current=0,y(!1)},[y]),C=m.useCallback(()=>{window.clearTimeout(p.current),p.current=window.setTimeout(()=>{_.current=!0,y(!0),p.current=0},g)},[g,y]);return m.useEffect(()=>()=>{p.current&&=(window.clearTimeout(p.current),0)},[]),(0,z.jsx)(Bm,{...l,children:(0,z.jsx)(U_,{scope:t,contentId:f,open:v,stateAttribute:b,trigger:u,onTriggerChange:d,onTriggerEnter:m.useCallback(()=>{c.isOpenDelayedRef.current?C():x()},[c.isOpenDelayedRef,C,x]),onTriggerLeave:m.useCallback(()=>{h?S():(window.clearTimeout(p.current),p.current=0)},[S,h]),onOpen:x,onClose:S,disableHoverableContent:h,children:n})})};G_.displayName=H_;var K_=`TooltipTrigger`,q_=m.forwardRef((e,t)=>{let{__scopeTooltip:n,...r}=e,i=W_(K_,n),a=B_(K_,n),o=F_(n),s=ct(t,m.useRef(null),i.onTriggerChange),c=m.useRef(!1),l=m.useRef(!1),u=m.useCallback(()=>c.current=!1,[]);return m.useEffect(()=>()=>document.removeEventListener(`pointerup`,u),[u]),(0,z.jsx)(Vm,{asChild:!0,...o,children:(0,z.jsx)(Et.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:s,onPointerMove:_t(e.onPointerMove,e=>{e.pointerType!==`touch`&&!l.current&&!a.isPointerInTransitRef.current&&(i.onTriggerEnter(),l.current=!0)}),onPointerLeave:_t(e.onPointerLeave,()=>{i.onTriggerLeave(),l.current=!1}),onPointerDown:_t(e.onPointerDown,()=>{i.open&&i.onClose(),c.current=!0,document.addEventListener(`pointerup`,u,{once:!0})}),onFocus:_t(e.onFocus,()=>{c.current||i.onOpen()}),onBlur:_t(e.onBlur,i.onClose),onClick:_t(e.onClick,i.onClose)})})});q_.displayName=K_;var J_=`TooltipPortal`,[Y_,X_]=P_(J_,{forceMount:void 0}),Z_=e=>{let{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,a=W_(J_,t);return(0,z.jsx)(Y_,{scope:t,forceMount:n,children:(0,z.jsx)(kt,{present:n||a.open,children:(0,z.jsx)(Nn,{asChild:!0,container:i,children:r})})})};Z_.displayName=J_;var Q_=`TooltipContent`,$_=m.forwardRef((e,t)=>{let n=X_(Q_,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i=`top`,...a}=e,o=W_(Q_,e.__scopeTooltip);return(0,z.jsx)(kt,{present:r||o.open,children:o.disableHoverableContent?(0,z.jsx)(iv,{side:i,...a,ref:t}):(0,z.jsx)(ev,{side:i,...a,ref:t})})}),ev=m.forwardRef((e,t)=>{let n=W_(Q_,e.__scopeTooltip),r=B_(Q_,e.__scopeTooltip),i=m.useRef(null),a=ct(t,i),[o,s]=m.useState(null),{trigger:c,onClose:l}=n,u=i.current,{onPointerInTransitChange:d}=r,f=m.useCallback(()=>{s(null),d(!1)},[d]),p=m.useCallback((e,t)=>{let n=e.currentTarget,r={x:e.clientX,y:e.clientY},i=cv(r,sv(r,n.getBoundingClientRect())),a=lv(t.getBoundingClientRect());s(dv([...i,...a])),d(!0)},[d]);return m.useEffect(()=>()=>f(),[f]),m.useEffect(()=>{if(c&&u){let e=e=>p(e,u),t=e=>p(e,c);return c.addEventListener(`pointerleave`,e),u.addEventListener(`pointerleave`,t),()=>{c.removeEventListener(`pointerleave`,e),u.removeEventListener(`pointerleave`,t)}}},[c,u,p,f]),m.useEffect(()=>{if(o){let e=e=>{let t=e.target,n={x:e.clientX,y:e.clientY},r=c?.contains(t)||u?.contains(t),i=!uv(n,o);r?f():i&&(f(),l())};return document.addEventListener(`pointermove`,e),()=>document.removeEventListener(`pointermove`,e)}},[c,u,o,l,f]),(0,z.jsx)(iv,{...e,ref:a})}),[tv,nv]=P_(H_,{isInside:!1}),rv=ft(`TooltipContent`),iv=m.forwardRef((e,t)=>{let{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:a,onPointerDownOutside:o,...s}=e,c=W_(Q_,n),l=F_(n),{onClose:u}=c;return m.useEffect(()=>(document.addEventListener(R_,u),()=>document.removeEventListener(R_,u)),[u]),m.useEffect(()=>{if(c.trigger){let e=e=>{e.target?.contains(c.trigger)&&u()};return window.addEventListener(`scroll`,e,{capture:!0}),()=>window.removeEventListener(`scroll`,e,{capture:!0})}},[c.trigger,u]),(0,z.jsx)(ln,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:e=>e.preventDefault(),onDismiss:u,children:(0,z.jsxs)(Hm,{"data-state":c.stateAttribute,...l,...s,ref:t,style:{...s.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:[(0,z.jsx)(rv,{children:r}),(0,z.jsx)(tv,{scope:n,isInside:!0,children:(0,z.jsx)(vg,{id:c.contentId,role:`tooltip`,children:i||r})})]})})});$_.displayName=Q_;var av=`TooltipArrow`,ov=m.forwardRef((e,t)=>{let{__scopeTooltip:n,...r}=e,i=F_(n);return nv(av,n).isInside?null:(0,z.jsx)(Um,{...i,...r,ref:t})});ov.displayName=av;function sv(e,t){let n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,i,a)){case a:return`left`;case i:return`right`;case n:return`top`;case r:return`bottom`;default:throw Error(`unreachable`)}}function cv(e,t,n=5){let 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 lv(e){let{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}function uv(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}function dv(e){let t=e.slice();return t.sort((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:+(e.y>t.y)),fv(t)}function fv(e){if(e.length<=1)return e.slice();let t=[];for(let n=0;n<e.length;n++){let r=e[n];for(;t.length>=2;){let e=t[t.length-1],n=t[t.length-2];if((e.x-n.x)*(r.y-n.y)>=(e.y-n.y)*(r.x-n.x))t.pop();else break}t.push(r)}t.pop();let n=[];for(let t=e.length-1;t>=0;t--){let r=e[t];for(;n.length>=2;){let e=n[n.length-1],t=n[n.length-2];if((e.x-t.x)*(r.y-t.y)>=(e.y-t.y)*(r.x-t.x))n.pop();else break}n.push(r)}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 pv=V_,mv=G_,hv=q_,gv=$_,_v=pv,vv=mv,yv=hv,bv=m.forwardRef(({className:e,sideOffset:t=4,...n},r)=>(0,z.jsx)(gv,{ref:r,sideOffset:t,className:et(`z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md 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 origin-[--radix-tooltip-content-transform-origin]`,e),...n}));bv.displayName=gv.displayName;var xv=Object.freeze({status:`aborted`});function V(e,t,n){function r(n,r){if(n._zod||Object.defineProperty(n,"_zod",{value:{def:r,constr:o,traits:new Set},enumerable:!1}),n._zod.traits.has(e))return;n._zod.traits.add(e),t(n,r);let i=o.prototype,a=Object.keys(i);for(let e=0;e<a.length;e++){let t=a[e];t in n||(n[t]=i[t].bind(n))}}let i=n?.Parent??Object;class a extends i{}Object.defineProperty(a,"name",{value:e});function o(e){var t;let i=n?.Parent?new a:this;r(i,e),(t=i._zod).deferred??(t.deferred=[]);for(let e of i._zod.deferred)e();return i}return Object.defineProperty(o,"init",{value:r}),Object.defineProperty(o,Symbol.hasInstance,{value:t=>n?.Parent&&t instanceof n.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(o,"name",{value:e}),o}var Sv=Symbol(`zod_brand`),Cv=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},wv=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}},Tv={};function Ev(e){return e&&Object.assign(Tv,e),Tv}var Dv=c({BIGINT_FORMAT_RANGES:()=>Qv,Class:()=>xy,NUMBER_FORMAT_RANGES:()=>Zv,aborted:()=>oy,allowsEval:()=>Hv,assert:()=>gte,assertEqual:()=>fte,assertIs:()=>mte,assertNever:()=>hte,assertNotEqual:()=>pte,assignProp:()=>Iv,base64ToUint8Array:()=>hy,base64urlToUint8Array:()=>_y,cached:()=>Av,captureStackTrace:()=>Bv,cleanEnum:()=>my,cleanRegex:()=>Mv,clone:()=>Jv,cloneDef:()=>vte,createTransparentProxy:()=>wte,defineLazy:()=>Fv,esc:()=>Rv,escapeRegex:()=>qv,extend:()=>ty,finalizeIssue:()=>ly,floatSafeRemainder:()=>Nv,getElementAtPath:()=>yte,getEnumValues:()=>Ov,getLengthableOrigin:()=>dy,getParsedType:()=>Cte,getSizableOrigin:()=>uy,hexToUint8Array:()=>yy,isObject:()=>Vv,isPlainObject:()=>Uv,issue:()=>py,joinValues:()=>H,jsonStringifyReplacer:()=>kv,merge:()=>ry,mergeDefs:()=>Lv,normalizeParams:()=>U,nullish:()=>jv,numKeys:()=>Ste,objectClone:()=>_te,omit:()=>ey,optionalKeys:()=>Xv,parsedType:()=>fy,partial:()=>iy,pick:()=>$v,prefixIssues:()=>sy,primitiveTypes:()=>Kv,promiseAllObject:()=>bte,propertyKeyTypes:()=>Gv,randomString:()=>xte,required:()=>ay,safeExtend:()=>ny,shallowClone:()=>Wv,slugify:()=>zv,stringifyPrimitive:()=>Yv,uint8ArrayToBase64:()=>gy,uint8ArrayToBase64url:()=>vy,uint8ArrayToHex:()=>by,unwrapMessage:()=>cy});function fte(e){return e}function pte(e){return e}function mte(e){}function hte(e){throw Error(`Unexpected value in exhaustive check`)}function gte(e){}function Ov(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function H(e,t=`|`){return e.map(e=>Yv(e)).join(t)}function kv(e,t){return typeof t==`bigint`?t.toString():t}function Av(e){return{get value(){{let t=e();return Object.defineProperty(this,"value",{value:t}),t}throw Error(`cached value already set`)}}}function jv(e){return e==null}function Mv(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function Nv(e,t){let n=(e.toString().split(`.`)[1]||``).length,r=t.toString(),i=(r.split(`.`)[1]||``).length;if(i===0&&/\d?e-\d?/.test(r)){let e=r.match(/\d?e-(\d?)/);e?.[1]&&(i=Number.parseInt(e[1]))}let a=n>i?n:i;return Number.parseInt(e.toFixed(a).replace(`.`,``))%Number.parseInt(t.toFixed(a).replace(`.`,``))/10**a}var Pv=Symbol(`evaluating`);function Fv(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==Pv)return r===void 0&&(r=Pv,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function _te(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function Iv(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Lv(...e){let t={};for(let n of e)Object.assign(t,Object.getOwnPropertyDescriptors(n));return Object.defineProperties({},t)}function vte(e){return Lv(e._zod.def)}function yte(e,t){return t?t.reduce((e,t)=>e?.[t],e):e}function bte(e){let t=Object.keys(e),n=t.map(t=>e[t]);return Promise.all(n).then(e=>{let n={};for(let r=0;r<t.length;r++)n[t[r]]=e[r];return n})}function xte(e=10){let t=``;for(let n=0;n<e;n++)t+=`abcdefghijklmnopqrstuvwxyz`[Math.floor(Math.random()*26)];return t}function Rv(e){return JSON.stringify(e)}function zv(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}var Bv=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function Vv(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var Hv=Av(()=>{if(typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function Uv(e){if(Vv(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return!(Vv(n)===!1||Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)===!1)}function Wv(e){return Uv(e)?{...e}:Array.isArray(e)?[...e]:e}function Ste(e){let t=0;for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&t++;return t}var Cte=e=>{let t=typeof e;switch(t){case`undefined`:return`undefined`;case`string`:return`string`;case`number`:return Number.isNaN(e)?`nan`:`number`;case`boolean`:return`boolean`;case`function`:return`function`;case`bigint`:return`bigint`;case`symbol`:return`symbol`;case`object`:return Array.isArray(e)?`array`:e===null?`null`:e.then&&typeof e.then==`function`&&e.catch&&typeof e.catch==`function`?`promise`:typeof Map<`u`&&e instanceof Map?`map`:typeof Set<`u`&&e instanceof Set?`set`:typeof Date<`u`&&e instanceof Date?`date`:typeof File<`u`&&e instanceof File?`file`:`object`;default:throw Error(`Unknown data type: ${t}`)}},Gv=new Set([`string`,`number`,`symbol`]),Kv=new Set([`string`,`number`,`bigint`,`boolean`,`symbol`,`undefined`]);function qv(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function Jv(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function U(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error==`string`?{...t,error:()=>t.error}:t}function wte(e){let t;return new Proxy({},{get(n,r,i){return t??=e(),Reflect.get(t,r,i)},set(n,r,i,a){return t??=e(),Reflect.set(t,r,i,a)},has(n,r){return t??=e(),Reflect.has(t,r)},deleteProperty(n,r){return t??=e(),Reflect.deleteProperty(t,r)},ownKeys(n){return t??=e(),Reflect.ownKeys(t)},getOwnPropertyDescriptor(n,r){return t??=e(),Reflect.getOwnPropertyDescriptor(t,r)},defineProperty(n,r,i){return t??=e(),Reflect.defineProperty(t,r,i)}})}function Yv(e){return typeof e==`bigint`?e.toString()+`n`:typeof e==`string`?`"${e}"`:`${e}`}function Xv(e){return Object.keys(e).filter(t=>e[t]._zod.optin===`optional`&&e[t]._zod.optout===`optional`)}var Zv={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},Qv={int64:[BigInt(`-9223372036854775808`),BigInt(`9223372036854775807`)],uint64:[BigInt(0),BigInt(`18446744073709551615`)]};function $v(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.pick() cannot be used on object schemas containing refinements`);return Jv(e,Lv(e._zod.def,{get shape(){let e={};for(let r in t){if(!(r in n.shape))throw Error(`Unrecognized key: "${r}"`);t[r]&&(e[r]=n.shape[r])}return Iv(this,`shape`,e),e},checks:[]}))}function ey(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.omit() cannot be used on object schemas containing refinements`);return Jv(e,Lv(e._zod.def,{get shape(){let r={...e._zod.def.shape};for(let e in t){if(!(e in n.shape))throw Error(`Unrecognized key: "${e}"`);t[e]&&delete r[e]}return Iv(this,`shape`,r),r},checks:[]}))}function ty(e,t){if(!Uv(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=e._zod.def.shape;for(let e in t)if(Object.getOwnPropertyDescriptor(n,e)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return Jv(e,Lv(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return Iv(this,`shape`,n),n}}))}function ny(e,t){if(!Uv(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return Jv(e,Lv(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return Iv(this,`shape`,n),n}}))}function ry(e,t){return Jv(e,Lv(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t._zod.def.shape};return Iv(this,`shape`,n),n},get catchall(){return t._zod.def.catchall},checks:[]}))}function iy(e,t,n){let r=t._zod.def.checks;if(r&&r.length>0)throw Error(`.partial() cannot be used on object schemas containing refinements`);return Jv(t,Lv(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in r))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t])}else for(let t in r)i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t];return Iv(this,`shape`,i),i},checks:[]}))}function ay(e,t,n){return Jv(t,Lv(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in i))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=new e({type:`nonoptional`,innerType:r[t]}))}else for(let t in r)i[t]=new e({type:`nonoptional`,innerType:r[t]});return Iv(this,`shape`,i),i}}))}function oy(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function sy(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function cy(e){return typeof e==`string`?e:e?.message}function ly(e,t,n){let r={...e,path:e.path??[]};return e.message||(r.message=cy(e.inst?._zod.def?.error?.(e))??cy(t?.error?.(e))??cy(n.customError?.(e))??cy(n.localeError?.(e))??`Invalid input`),delete r.inst,delete r.continue,t?.reportInput||delete r.input,r}function uy(e){return e instanceof Set?`set`:e instanceof Map?`map`:e instanceof File?`file`:`unknown`}function dy(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function fy(e){let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`nan`:`number`;case`object`:{if(e===null)return`null`;if(Array.isArray(e))return`array`;let t=e;if(t&&Object.getPrototypeOf(t)!==Object.prototype&&`constructor`in t&&t.constructor)return t.constructor.name}}return t}function py(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}function my(e){return Object.entries(e).filter(([e,t])=>Number.isNaN(Number.parseInt(e,10))).map(e=>e[1])}function hy(e){let t=atob(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;e++)n[e]=t.charCodeAt(e);return n}function gy(e){let t=``;for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return btoa(t)}function _y(e){let t=e.replace(/-/g,`+`).replace(/_/g,`/`);return hy(t+`=`.repeat((4-t.length%4)%4))}function vy(e){return gy(e).replace(/\+/g,`-`).replace(/\//g,`_`).replace(/=/g,``)}function yy(e){let t=e.replace(/^0x/,``);if(t.length%2!=0)throw Error(`Invalid hex string length`);let n=new Uint8Array(t.length/2);for(let e=0;e<t.length;e+=2)n[e/2]=Number.parseInt(t.slice(e,e+2),16);return n}function by(e){return Array.from(e).map(e=>e.toString(16).padStart(2,`0`)).join(``)}var xy=class{constructor(...e){}},Sy=(e,t)=>{e.name=`$ZodError`,Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,kv,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Cy=V(`$ZodError`,Sy),wy=V(`$ZodError`,Sy,{Parent:Error});function Ty(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}function Ey(e,t=e=>e.message){let n={_errors:[]},r=e=>{for(let i of e.issues)if(i.code===`invalid_union`&&i.errors.length)i.errors.map(e=>r({issues:e}));else if(i.code===`invalid_key`)r({issues:i.issues});else if(i.code===`invalid_element`)r({issues:i.issues});else if(i.path.length===0)n._errors.push(t(i));else{let e=n,r=0;for(;r<i.path.length;){let n=i.path[r];r===i.path.length-1?(e[n]=e[n]||{_errors:[]},e[n]._errors.push(t(i))):e[n]=e[n]||{_errors:[]},e=e[n],r++}}};return r(e),n}function Dy(e,t=e=>e.message){let n={errors:[]},r=(e,i=[])=>{var a,o;for(let s of e.issues)if(s.code===`invalid_union`&&s.errors.length)s.errors.map(e=>r({issues:e},s.path));else if(s.code===`invalid_key`)r({issues:s.issues},s.path);else if(s.code===`invalid_element`)r({issues:s.issues},s.path);else{let e=[...i,...s.path];if(e.length===0){n.errors.push(t(s));continue}let r=n,c=0;for(;c<e.length;){let n=e[c],i=c===e.length-1;typeof n==`string`?(r.properties??={},(a=r.properties)[n]??(a[n]={errors:[]}),r=r.properties[n]):(r.items??=[],(o=r.items)[n]??(o[n]={errors:[]}),r=r.items[n]),i&&r.errors.push(t(s)),c++}}};return r(e),n}function Oy(e){let t=[],n=e.map(e=>typeof e==`object`?e.key:e);for(let e of n)typeof e==`number`?t.push(`[${e}]`):typeof e==`symbol`?t.push(`[${JSON.stringify(String(e))}]`):/[^\w$]/.test(e)?t.push(`[${JSON.stringify(e)}]`):(t.length&&t.push(`.`),t.push(e));return t.join(``)}function ky(e){let t=[],n=[...e.issues].sort((e,t)=>(e.path??[]).length-(t.path??[]).length);for(let e of n)t.push(`✖ ${e.message}`),e.path?.length&&t.push(` → at ${Oy(e.path)}`);return t.join(`
|
|
47
|
+
at `))}function cl(e,t){class n extends e{#e;constructor(...e){if(ol()){let t=Error.stackTraceLimit;Error.stackTraceLimit=0,super(...e),Error.stackTraceLimit=t}else super(...e);let t=Error().stack;t&&(this.#e=sl(t.replace(/^Error/,this.name)))}get errorStack(){return this.#e}}return Object.defineProperty(n.prototype,"constructor",{get(){return t},enumerable:!1,configurable:!0}),n}var ll={OK:200,CREATED:201,ACCEPTED:202,NO_CONTENT:204,MULTIPLE_CHOICES:300,MOVED_PERMANENTLY:301,FOUND:302,SEE_OTHER:303,NOT_MODIFIED:304,TEMPORARY_REDIRECT:307,BAD_REQUEST:400,UNAUTHORIZED:401,PAYMENT_REQUIRED:402,FORBIDDEN:403,NOT_FOUND:404,METHOD_NOT_ALLOWED:405,NOT_ACCEPTABLE:406,PROXY_AUTHENTICATION_REQUIRED:407,REQUEST_TIMEOUT:408,CONFLICT:409,GONE:410,LENGTH_REQUIRED:411,PRECONDITION_FAILED:412,PAYLOAD_TOO_LARGE:413,URI_TOO_LONG:414,UNSUPPORTED_MEDIA_TYPE:415,RANGE_NOT_SATISFIABLE:416,EXPECTATION_FAILED:417,"I'M_A_TEAPOT":418,MISDIRECTED_REQUEST:421,UNPROCESSABLE_ENTITY:422,LOCKED:423,FAILED_DEPENDENCY:424,TOO_EARLY:425,UPGRADE_REQUIRED:426,PRECONDITION_REQUIRED:428,TOO_MANY_REQUESTS:429,REQUEST_HEADER_FIELDS_TOO_LARGE:431,UNAVAILABLE_FOR_LEGAL_REASONS:451,INTERNAL_SERVER_ERROR:500,NOT_IMPLEMENTED:501,BAD_GATEWAY:502,SERVICE_UNAVAILABLE:503,GATEWAY_TIMEOUT:504,HTTP_VERSION_NOT_SUPPORTED:505,VARIANT_ALSO_NEGOTIATES:506,INSUFFICIENT_STORAGE:507,LOOP_DETECTED:508,NOT_EXTENDED:510,NETWORK_AUTHENTICATION_REQUIRED:511};cl(class extends Error{constructor(e=`INTERNAL_SERVER_ERROR`,t=void 0,n={},r=typeof e==`number`?e:ll[e]){super(t?.message,t?.cause?{cause:t.cause}:void 0),this.status=e,this.body=t,this.headers=n,this.statusCode=r,this.name=`APIError`,this.status=e,this.headers=n,this.statusCode=r,this.body=t}},Error);var ul=class extends Error{constructor(e,t){super(e,t),this.name=`BetterAuthError`,this.message=e,this.stack=``}};function dl(e){try{return(new URL(e).pathname.replace(/\/+$/,``)||`/`)!==`/`}catch{throw new ul(`Invalid base URL: ${e}. Please provide a valid base URL.`)}}function fl(e){try{let t=new URL(e);if(t.protocol!==`http:`&&t.protocol!==`https:`)throw new ul(`Invalid base URL: ${e}. URL must include 'http://' or 'https://'`)}catch(t){throw t instanceof ul?t:new ul(`Invalid base URL: ${e}. Please provide a valid base URL.`,{cause:t})}}function pl(e,t=`/api/auth`){if(fl(e),dl(e))return e;let n=e.replace(/\/+$/,``);return!t||t===`/`?n:(t=t.startsWith(`/`)?t:`/${t}`,`${n}${t}`)}function ml(e,t){return!e||e.trim()===``?!1:t===`proto`?e===`http`||e===`https`:t===`host`?[/\.\./,/\0/,/[\s]/,/^[.]/,/[<>'"]/,/javascript:/i,/file:/i,/data:/i].some(t=>t.test(e))?!1:/^[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(\.[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*(:[0-9]{1,5})?$/.test(e)||/^(\d{1,3}\.){3}\d{1,3}(:[0-9]{1,5})?$/.test(e)||/^\[[0-9a-fA-F:]+\](:[0-9]{1,5})?$/.test(e)||/^localhost(:[0-9]{1,5})?$/i.test(e):!1}function hl(e,t,n,r,i){if(e)return pl(e,t);if(r!==!1){let e=il.BETTER_AUTH_URL||il.NEXT_PUBLIC_BETTER_AUTH_URL||il.PUBLIC_BETTER_AUTH_URL||il.NUXT_PUBLIC_BETTER_AUTH_URL||il.NUXT_PUBLIC_AUTH_URL||(il.BASE_URL===`/`?void 0:il.BASE_URL);if(e)return pl(e,t)}let a=n?.headers.get(`x-forwarded-host`),o=n?.headers.get(`x-forwarded-proto`);if(a&&o&&i&&ml(o,`proto`)&&ml(a,`host`))try{return pl(`${o}://${a}`,t)}catch{}if(n){let e=gl(n.url);if(!e)throw new ul(`Could not get origin from request. Please provide a valid base URL.`);return pl(e,t)}if(typeof window<`u`&&window.location)return pl(window.location.origin,t)}function gl(e){try{let t=new URL(e);return t.origin===`null`?null:t.origin}catch{return null}}var _l={proto:/"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/,constructor:/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/,protoShort:/"__proto__"\s*:/,constructorShort:/"constructor"\s*:/},vl=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/,yl={true:!0,false:!1,null:null,undefined:void 0,nan:NaN,infinity:1/0,"-infinity":-1/0},bl=/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})(?:\.(\d{1,7}))?(?:Z|([+-])(\d{2}):(\d{2}))$/;function xl(e){return e instanceof Date&&!isNaN(e.getTime())}function Sl(e){let t=bl.exec(e);if(!t)return null;let[,n,r,i,a,o,s,c,l,u,d]=t,f=new Date(Date.UTC(parseInt(n,10),parseInt(r,10)-1,parseInt(i,10),parseInt(a,10),parseInt(o,10),parseInt(s,10),c?parseInt(c.padEnd(3,`0`),10):0));if(l){let e=(parseInt(u,10)*60+parseInt(d,10))*(l===`+`?-1:1);f.setUTCMinutes(f.getUTCMinutes()+e)}return xl(f)?f:null}function Cl(e,t={}){let{strict:n=!1,warnings:r=!1,reviver:i,parseDates:a=!0}=t;if(typeof e!=`string`)return e;let o=e.trim();if(o.length>0&&o[0]===`"`&&o.endsWith(`"`)&&!o.slice(1,-1).includes(`"`))return o.slice(1,-1);let s=o.toLowerCase();if(s.length<=9&&s in yl)return yl[s];if(!vl.test(o)){if(n)throw SyntaxError(`[better-json] Invalid JSON`);return e}if(Object.entries(_l).some(([e,t])=>{let n=t.test(o);return n&&r&&console.warn(`[better-json] Detected potential prototype pollution attempt using ${e} pattern`),n})&&n)throw Error(`[better-json] Potential prototype pollution attempt detected`);try{return JSON.parse(o,(e,t)=>{if(e===`__proto__`||e===`constructor`&&t&&typeof t==`object`&&`prototype`in t){r&&console.warn(`[better-json] Dropping "${e}" key to prevent prototype pollution`);return}if(a&&typeof t==`string`){let e=Sl(t);if(e)return e}return i?i(e,t):t})}catch(t){if(n)throw t;return e}}function wl(e,t={strict:!0}){return Cl(e,t)}var Tl={id:`redirect`,name:`Redirect`,hooks:{onSuccess(e){if(e.data?.url&&e.data?.redirect&&typeof window<`u`&&window.location&&window.location)try{window.location.href=e.data.url}catch{}}}},El=[],Dl=0,Ol=4,kl=0,Al=e=>{let t=[],n={get(){return n.lc||n.listen(()=>{})(),n.value},init:e,lc:0,listen(e){return n.lc=t.push(e),()=>{for(let t=Dl+Ol;t<El.length;)El[t]===e?El.splice(t,Ol):t+=Ol;let r=t.indexOf(e);~r&&(t.splice(r,1),--n.lc||n.off())}},notify(e,r){kl++;let i=!El.length;for(let i of t)El.push(i,n.value,e,r);if(i){for(Dl=0;Dl<El.length;Dl+=Ol)El[Dl](El[Dl+1],El[Dl+2],El[Dl+3]);El.length=0}},off(){},set(e){let t=n.value;t!==e&&(n.value=e,n.notify(t))},subscribe(e){let t=n.listen(e);return e(n.value),t},value:e};return n},jl=5,Ml=6,Nl=10,Pl=(e,t,n,r)=>(e.events=e.events||{},e.events[n+Nl]||(e.events[n+Nl]=r(t=>{e.events[n].reduceRight((e,t)=>(t(e),e),{shared:{},...t})})),e.events[n]=e.events[n]||[],e.events[n].push(t),()=>{let r=e.events[n],i=r.indexOf(t);r.splice(i,1),r.length||(delete e.events[n],e.events[n+Nl](),delete e.events[n+Nl])}),Fl=1e3,Il=(e,t)=>Pl(e,n=>{let r=t(n);r&&e.events[Ml].push(r)},jl,t=>{let n=e.listen;e.listen=(...r)=>(!e.lc&&!e.active&&(e.active=!0,t()),n(...r));let r=e.off;return e.events[Ml]=[],e.off=()=>{r(),setTimeout(()=>{if(e.active&&!e.lc){e.active=!1;for(let t of e.events[Ml])t();e.events[Ml]=[]}},Fl)},()=>{e.listen=n,e.off=r}});function Ll(e,t,n){let r=new Set(t).add(void 0);return e.listen((e,t,i)=>{r.has(i)&&n(e,t,i)})}var Rl=()=>typeof window>`u`,zl=(e,t,n,r)=>{let i=Al({data:null,error:null,isPending:!0,isRefetching:!1,refetch:e=>a(e)}),a=async e=>new Promise(a=>{let o=typeof r==`function`?r({data:i.get().data,error:i.get().error,isPending:i.get().isPending}):r;n(t,{...o,query:{...o?.query,...e?.query},async onSuccess(e){i.set({data:e.data,error:null,isPending:!1,isRefetching:!1,refetch:i.value.refetch}),await o?.onSuccess?.(e)},async onError(e){let{request:t}=e,n=typeof t.retry==`number`?t.retry:t.retry?.attempts,r=t.retryAttempt||0;if(n&&r<n)return;let a=e.error.status===401;i.set({error:e.error,data:a?null:i.get().data,isPending:!1,isRefetching:!1,refetch:i.value.refetch}),await o?.onError?.(e)},async onRequest(e){let t=i.get();i.set({isPending:t.data===null,data:t.data,error:null,isRefetching:!0,refetch:i.value.refetch}),await o?.onRequest?.(e)}}).catch(e=>{i.set({error:e,data:i.get().data,isPending:!1,isRefetching:!1,refetch:i.value.refetch})}).finally(()=>{a(void 0)})});e=Array.isArray(e)?e:[e];let o=!1;for(let t of e)t.subscribe(async()=>{Rl()||(o?await a():Il(i,()=>{let e=setTimeout(async()=>{o||=(await a(),!0)},0);return()=>{i.off(),t.off(),clearTimeout(e)}}))});return i},Bl=Symbol.for(`better-auth:broadcast-channel`),Vl=()=>Math.floor(Date.now()/1e3),Hl=class{listeners=new Set;name;constructor(e=`better-auth.message`){this.name=e}subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}post(e){if(!(typeof window>`u`))try{localStorage.setItem(this.name,JSON.stringify({...e,timestamp:Vl()}))}catch{}}setup(){if(typeof window>`u`||window.addEventListener===void 0)return()=>{};let e=e=>{if(e.key!==this.name)return;let t=JSON.parse(e.newValue??`{}`);t?.event!==`session`||!t?.data||this.listeners.forEach(e=>e(t))};return window.addEventListener(`storage`,e),()=>{window.removeEventListener(`storage`,e)}}};function Ul(e=`better-auth.message`){return globalThis[Bl]||(globalThis[Bl]=new Hl(e)),globalThis[Bl]}var Wl=Symbol.for(`better-auth:focus-manager`),Gl=class{listeners=new Set;subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}setFocused(e){this.listeners.forEach(t=>t(e))}setup(){if(typeof window>`u`||typeof document>`u`||window.addEventListener===void 0)return()=>{};let e=()=>{document.visibilityState===`visible`&&this.setFocused(!0)};return document.addEventListener(`visibilitychange`,e,!1),()=>{document.removeEventListener(`visibilitychange`,e,!1)}}};function Kl(){return globalThis[Wl]||(globalThis[Wl]=new Gl),globalThis[Wl]}var ql=Symbol.for(`better-auth:online-manager`),Jl=class{listeners=new Set;isOnline=typeof navigator<`u`?navigator.onLine:!0;subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}setOnline(e){this.isOnline=e,this.listeners.forEach(t=>t(e))}setup(){if(typeof window>`u`||window.addEventListener===void 0)return()=>{};let e=()=>this.setOnline(!0),t=()=>this.setOnline(!1);return window.addEventListener(`online`,e,!1),window.addEventListener(`offline`,t,!1),()=>{window.removeEventListener(`online`,e,!1),window.removeEventListener(`offline`,t,!1)}}};function Yl(){return globalThis[ql]||(globalThis[ql]=new Jl),globalThis[ql]}var Xl=()=>Math.floor(Date.now()/1e3);function Zl(e){return typeof e==`object`&&e&&`data`in e&&`error`in e?e:{data:e,error:null}}var Ql=5;function $l(e){let{sessionAtom:t,sessionSignal:n,$fetch:r,options:i={}}=e,a=i.sessionOptions?.refetchInterval??0,o=i.sessionOptions?.refetchOnWindowFocus??!0,s=i.sessionOptions?.refetchWhenOffline??!1,c={lastSync:0,lastSessionRequest:0,cachedSession:void 0},l=()=>s||Yl().isOnline,u=e=>{if(!l())return;if(e?.event===`storage`){c.lastSync=Xl(),n.set(!n.get());return}let i=t.get(),a=()=>{c.lastSessionRequest=Xl(),r(`/get-session`).then(async e=>{let{data:a,error:o}=Zl(e);if(a?.needsRefresh)try{let e=await r(`/get-session`,{method:`POST`});({data:a,error:o}=Zl(e))}catch{}let s=a?.session&&a?.user?a:null;t.set({...i,data:s,error:o}),c.lastSync=Xl(),n.set(!n.get())}).catch(()=>{})};if(e?.event===`poll`){a();return}if(e?.event===`visibilitychange`){if(Xl()-c.lastSessionRequest<Ql)return;c.lastSessionRequest=Xl()}if(e?.event===`visibilitychange`){a();return}(i?.data===null||i?.data===void 0)&&(c.lastSync=Xl(),n.set(!n.get()))},d=e=>{Ul().post({event:`session`,data:{trigger:e},clientId:Math.random().toString(36).substring(7)})},f=()=>{a&&a>0&&(c.pollInterval=setInterval(()=>{t.get()?.data&&u({event:`poll`})},a*1e3))},p=()=>{c.unsubscribeBroadcast=Ul().subscribe(()=>{u({event:`storage`})})},m=()=>{o&&(c.unsubscribeFocus=Kl().subscribe(()=>{u({event:`visibilitychange`})}))},h=()=>{c.unsubscribeOnline=Yl().subscribe(e=>{e&&u({event:`visibilitychange`})})};return{init:()=>{f(),p(),m(),h(),Ul().setup(),Kl().setup(),Yl().setup()},cleanup:()=>{c.pollInterval&&=(clearInterval(c.pollInterval),void 0),c.unsubscribeBroadcast&&=(c.unsubscribeBroadcast(),void 0),c.unsubscribeFocus&&=(c.unsubscribeFocus(),void 0),c.unsubscribeOnline&&=(c.unsubscribeOnline(),void 0),c.lastSync=0,c.lastSessionRequest=0,c.cachedSession=void 0},triggerRefetch:u,broadcastSessionUpdate:d}}function eu(e,t){let n=Al(!1),r=zl(n,`/get-session`,e,{method:`GET`}),i=()=>{};return Il(r,()=>{let a=$l({sessionAtom:r,sessionSignal:n,$fetch:e,options:t});return a.init(),i=a.broadcastSessionUpdate,()=>{a.cleanup()}}),{session:r,$sessionSignal:n,broadcastSessionUpdate:e=>i(e)}}function tu(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return t!==null&&t!==Object.prototype&&Object.getPrototypeOf(t)!==null||Symbol.iterator in e?!1:Symbol.toStringTag in e?Object.prototype.toString.call(e)===`[object Module]`:!0}function nu(e,t,n=`.`,r){if(!tu(t))return nu(e,{},n,r);let i={...t};for(let t of Object.keys(e)){if(t===`__proto__`||t===`constructor`)continue;let a=e[t];a!=null&&(r&&r(i,t,a,n)||(Array.isArray(a)&&Array.isArray(i[t])?i[t]=[...a,...i[t]]:tu(a)&&tu(i[t])?i[t]=nu(a,i[t],(n?`${n}.`:``)+t.toString(),r):i[t]=a))}return i}function ru(e){return(...t)=>t.reduce((t,n)=>nu(t,n,``,e),{})}var iu=ru(),au=Object.defineProperty,ou=Object.defineProperties,su=Object.getOwnPropertyDescriptors,cu=Object.getOwnPropertySymbols,lu=Object.prototype.hasOwnProperty,uu=Object.prototype.propertyIsEnumerable,du=(e,t,n)=>t in e?au(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,fu=(e,t)=>{for(var n in t||={})lu.call(t,n)&&du(e,n,t[n]);if(cu)for(var n of cu(t))uu.call(t,n)&&du(e,n,t[n]);return e},pu=(e,t)=>ou(e,su(t)),mu=class extends Error{constructor(e,t,n){super(t||e.toString(),{cause:n}),this.status=e,this.statusText=t,this.error=n,Error.captureStackTrace(this,this.constructor)}},hu=async(e,t)=>{let n=t||{},r={onRequest:[t?.onRequest],onResponse:[t?.onResponse],onSuccess:[t?.onSuccess],onError:[t?.onError],onRetry:[t?.onRetry]};if(!t||!t?.plugins)return{url:e,options:n,hooks:r};for(let i of t?.plugins||[]){if(i.init){let r=await i.init?.call(i,e.toString(),t);n=r.options||n,e=r.url}r.onRequest.push(i.hooks?.onRequest),r.onResponse.push(i.hooks?.onResponse),r.onSuccess.push(i.hooks?.onSuccess),r.onError.push(i.hooks?.onError),r.onRetry.push(i.hooks?.onRetry)}return{url:e,options:n,hooks:r}},gu=class{constructor(e){this.options=e}shouldAttemptRetry(e,t){return this.options.shouldRetry?Promise.resolve(e<this.options.attempts&&this.options.shouldRetry(t)):Promise.resolve(e<this.options.attempts)}getDelay(){return this.options.delay}},_u=class{constructor(e){this.options=e}shouldAttemptRetry(e,t){return this.options.shouldRetry?Promise.resolve(e<this.options.attempts&&this.options.shouldRetry(t)):Promise.resolve(e<this.options.attempts)}getDelay(e){return Math.min(this.options.maxDelay,this.options.baseDelay*2**e)}};function vu(e){if(typeof e==`number`)return new gu({type:`linear`,attempts:e,delay:1e3});switch(e.type){case`linear`:return new gu(e);case`exponential`:return new _u(e);default:throw Error(`Invalid retry strategy`)}}var yu=async e=>{let t={},n=async e=>typeof e==`function`?await e():e;if(e?.auth){if(e.auth.type===`Bearer`){let r=await n(e.auth.token);if(!r)return t;t.authorization=`Bearer ${r}`}else if(e.auth.type===`Basic`){let[r,i]=await Promise.all([n(e.auth.username),n(e.auth.password)]);if(!r||!i)return t;t.authorization=`Basic ${btoa(`${r}:${i}`)}`}else if(e.auth.type===`Custom`){let[r,i]=await Promise.all([n(e.auth.prefix),n(e.auth.value)]);if(!i)return t;t.authorization=`${r??``} ${i}`}}return t},bu=/^application\/(?:[\w!#$%&*.^`~-]*\+)?json(;.+)?$/i;function xu(e){let t=e.headers.get(`content-type`),n=new Set([`image/svg`,`application/xml`,`application/xhtml`,`application/html`]);if(!t)return`json`;let r=t.split(`;`).shift()||``;return bu.test(r)?`json`:n.has(r)||r.startsWith(`text/`)?`text`:`blob`}function Su(e){try{return JSON.parse(e),!0}catch{return!1}}function Cu(e){if(e===void 0)return!1;let t=typeof e;return t===`string`||t===`number`||t===`boolean`||t===null?!0:t===`object`?Array.isArray(e)?!0:e.buffer?!1:e.constructor&&e.constructor.name===`Object`||typeof e.toJSON==`function`:!1}function wu(e){try{return JSON.parse(e)}catch{return e}}function Tu(e){return typeof e==`function`}function Eu(e){if(e?.customFetchImpl)return e.customFetchImpl;if(typeof globalThis<`u`&&Tu(globalThis.fetch))return globalThis.fetch;if(typeof window<`u`&&Tu(window.fetch))return window.fetch;throw Error(`No fetch implementation found`)}async function Du(e){let t=new Headers(e?.headers),n=await yu(e);for(let[e,r]of Object.entries(n||{}))t.set(e,r);if(!t.has(`content-type`)){let n=Ou(e?.body);n&&t.set(`content-type`,n)}return t}function Ou(e){return Cu(e)?`application/json`:null}function ku(e){if(!e?.body)return null;let t=new Headers(e?.headers);if(Cu(e.body)&&!t.has(`content-type`)){for(let[t,n]of Object.entries(e?.body))n instanceof Date&&(e.body[t]=n.toISOString());return JSON.stringify(e.body)}return t.has(`content-type`)&&t.get(`content-type`)===`application/x-www-form-urlencoded`&&Cu(e.body)?new URLSearchParams(e.body).toString():e.body}function Au(e,t){if(t?.method)return t.method.toUpperCase();if(e.startsWith(`@`)){let n=e.split(`@`)[1]?.split(`/`)[0];return Pu.includes(n)?n.toUpperCase():t?.body?`POST`:`GET`}return t?.body?`POST`:`GET`}function ju(e,t){let n;return!e?.signal&&e?.timeout&&(n=setTimeout(()=>t?.abort(),e?.timeout)),{abortTimeout:n,clearTimeout:()=>{n&&clearTimeout(n)}}}var Mu=class e extends Error{constructor(t,n){super(n||JSON.stringify(t,null,2)),this.issues=t,Object.setPrototypeOf(this,e.prototype)}};async function Nu(e,t){let n=await e[`~standard`].validate(t);if(n.issues)throw new Mu(n.issues);return n.value}var Pu=[`get`,`post`,`put`,`patch`,`delete`],Fu=e=>({id:`apply-schema`,name:`Apply Schema`,version:`1.0.0`,async init(t,n){let r=e.plugins?.find(e=>e.schema?.config?t.startsWith(e.schema.config.baseURL||``)||t.startsWith(e.schema.config.prefix||``):!1)?.schema||e.schema;if(r){let e=t;r.config?.prefix&&e.startsWith(r.config.prefix)&&(e=e.replace(r.config.prefix,``),r.config.baseURL&&(t=t.replace(r.config.prefix,r.config.baseURL))),r.config?.baseURL&&e.startsWith(r.config.baseURL)&&(e=e.replace(r.config.baseURL,``));let i=r.schema[e];if(i){let e=pu(fu({},n),{method:i.method,output:i.output});return n?.disableValidation||(e=pu(fu({},e),{body:i.input?await Nu(i.input,n?.body):n?.body,params:i.params?await Nu(i.params,n?.params):n?.params,query:i.query?await Nu(i.query,n?.query):n?.query})),{url:t,options:e}}}return{url:t,options:n}}}),Iu=e=>{async function t(t,n){let r=pu(fu(fu({},e),n),{plugins:[...e?.plugins||[],Fu(e||{}),...n?.plugins||[]]});if(e?.catchAllError)try{return await Ru(t,r)}catch(e){return{data:null,error:{status:500,statusText:`Fetch Error`,message:`Fetch related error. Captured by catchAllError option. See error property for more details.`,error:e}}}return await Ru(t,r)}return t};function Lu(e,t){let{baseURL:n,params:r,query:i}=t||{query:{},params:{},baseURL:``},a=e.startsWith(`http`)?e.split(`/`).slice(0,3).join(`/`):n||``;if(e.startsWith(`@`)){let t=e.toString().split(`@`)[1].split(`/`)[0];Pu.includes(t)&&(e=e.replace(`@${t}/`,`/`))}a.endsWith(`/`)||(a+=`/`);let[o,s]=e.replace(a,``).split(`?`),c=new URLSearchParams(s);for(let[e,t]of Object.entries(i||{})){if(t==null)continue;let n;if(typeof t==`string`)n=t;else if(Array.isArray(t)){for(let n of t)c.append(e,n);continue}else n=JSON.stringify(t);c.set(e,n)}if(r)if(Array.isArray(r)){let e=o.split(`/`).filter(e=>e.startsWith(`:`));for(let[t,n]of e.entries()){let e=r[t];o=o.replace(n,e)}}else for(let[e,t]of Object.entries(r))o=o.replace(`:${e}`,String(t));o=o.split(`/`).map(encodeURIComponent).join(`/`),o.startsWith(`/`)&&(o=o.slice(1));let l=c.toString();return l=l.length>0?`?${l}`.replace(/\+/g,`%20`):``,a.startsWith(`http`)?new URL(`${o}${l}`,a):`${a}${o}${l}`}var Ru=async(e,t)=>{let{hooks:n,url:r,options:i}=await hu(e,t),a=Eu(i),o=new AbortController,s=i.signal??o.signal,c=Lu(r,i),l=ku(i),u=await Du(i),d=Au(r,i),f=pu(fu({},i),{url:c,headers:u,body:l,method:d,signal:s});for(let e of n.onRequest)if(e){let t=await e(f);typeof t==`object`&&t&&(f=t)}(`pipeTo`in f&&typeof f.pipeTo==`function`||typeof t?.body?.pipe==`function`)&&(`duplex`in f||(f.duplex=`half`));let{clearTimeout:p}=ju(i,o),m=await a(f.url,f);p();let h={response:m,request:f};for(let e of n.onResponse)if(e){let n=await e(pu(fu({},h),{response:t?.hookOptions?.cloneResponse?m.clone():m}));n instanceof Response?m=n:typeof n==`object`&&n&&(m=n.response)}if(m.ok){if(f.method===`HEAD`)return{data:``,error:null};let e=xu(m),r={data:null,response:m,request:f};if(e===`json`||e===`text`){let e=await m.text();r.data=await(f.jsonParser??wu)(e)}else r.data=await m[e]();f?.output&&f.output&&!f.disableValidation&&(r.data=await Nu(f.output,r.data));for(let e of n.onSuccess)e&&await e(pu(fu({},r),{response:t?.hookOptions?.cloneResponse?m.clone():m}));return t?.throw?r.data:{data:r.data,error:null}}let g=t?.jsonParser??wu,_=await m.text(),v=Su(_),y=v?await g(_):null,b={response:m,responseText:_,request:f,error:pu(fu({},y),{status:m.status,statusText:m.statusText})};for(let e of n.onError)e&&await e(pu(fu({},b),{response:t?.hookOptions?.cloneResponse?m.clone():m}));if(t?.retry){let r=vu(t.retry),i=t.retryAttempt??0;if(await r.shouldAttemptRetry(i,m)){for(let e of n.onRetry)e&&await e(h);let a=r.getDelay(i);return await new Promise(e=>setTimeout(e,a)),await Ru(e,pu(fu({},t),{retryAttempt:i+1}))}}if(t?.throw)throw new mu(m.status,m.statusText,v?y:_);return{data:null,error:pu(fu({},y),{status:m.status,statusText:m.statusText})}},zu=e=>{if(typeof process>`u`)return;let t=e??`/api/auth`;if({}.NEXT_PUBLIC_AUTH_URL)return{}.NEXT_PUBLIC_AUTH_URL;if(typeof window>`u`){if({}.NEXTAUTH_URL)try{return{}.NEXTAUTH_URL}catch{}if({}.VERCEL_URL)try{let e={}.VERCEL_URL.startsWith(`http`)?``:`https://`;return`${new URL(`${e}${{}.VERCEL_URL}`).origin}${t}`}catch{}}},Bu=(e,t)=>{let n=`credentials`in Request.prototype,r=hl(e?.baseURL,e?.basePath,void 0,t)??zu(e?.basePath)??`/api/auth`,i=e?.plugins?.flatMap(e=>e.fetchPlugins).filter(e=>e!==void 0)||[],a={id:`lifecycle-hooks`,name:`lifecycle-hooks`,hooks:{onSuccess:e?.fetchOptions?.onSuccess,onError:e?.fetchOptions?.onError,onRequest:e?.fetchOptions?.onRequest,onResponse:e?.fetchOptions?.onResponse}},{onSuccess:o,onError:s,onRequest:c,onResponse:l,...u}=e?.fetchOptions||{},d=Iu({baseURL:r,...n?{credentials:`include`}:{},method:`GET`,jsonParser(e){return e?wl(e,{strict:!1}):null},customFetchImpl:fetch,...u,plugins:[a,...u.plugins||[],...e?.disableDefaultFetchPlugins?[]:[Tl],...i]}),{$sessionSignal:f,session:p,broadcastSessionUpdate:m}=eu(d,e),h=e?.plugins||[],g={},_={$sessionSignal:f,session:p},v={"/sign-out":`POST`,"/revoke-sessions":`POST`,"/revoke-other-sessions":`POST`,"/delete-user":`POST`},y=[{signal:`$sessionSignal`,matcher(e){return e===`/sign-out`||e===`/update-user`||e===`/update-session`||e===`/sign-up/email`||e===`/sign-in/email`||e===`/delete-user`||e===`/verify-email`||e===`/revoke-sessions`||e===`/revoke-session`||e===`/change-email`},callback(e){e===`/sign-out`?m(`signout`):(e===`/update-user`||e===`/update-session`)&&m(`updateUser`)}}];for(let e of h)e.getAtoms&&Object.assign(_,e.getAtoms?.(d)),e.pathMethods&&Object.assign(v,e.pathMethods),e.atomListeners&&y.push(...e.atomListeners);let b={notify:e=>{_[e].set(!_[e].get())},listen:(e,t)=>{_[e].subscribe(t)},atoms:_};for(let t of h)t.getActions&&(g=iu(t.getActions?.(d,b,e)??{},g));return{get baseURL(){return r},pluginsActions:g,pluginsAtoms:_,pluginPathMethods:v,atomListeners:y,$fetch:d,$store:b}};function Vu(e){return typeof e==`object`&&!!e&&`get`in e&&typeof e.get==`function`&&`lc`in e&&typeof e.lc==`number`}function Hu(e,t,n){let r=t[e],{fetchOptions:i,query:a,...o}=n||{};return r||(i?.method?i.method:o&&Object.keys(o).length>0?`POST`:`GET`)}function Uu(e,t,n,r,i){function a(o=[]){return new Proxy(function(){},{get(t,n){if(typeof n!=`string`||n===`then`||n===`catch`||n===`finally`)return;let r=[...o,n],i=e;for(let e of r)if(i&&typeof i==`object`&&e in i)i=i[e];else{i=void 0;break}return typeof i==`function`||Vu(i)?i:a(r)},apply:async(e,a,s)=>{let c=`/`+o.map(e=>e.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)).join(`/`),l=s[0]||{},u=s[1]||{},{query:d,fetchOptions:f,...p}=l,m={...u,...f},h=Hu(c,n,l);return await t(c,{...m,body:h===`GET`?void 0:{...p,...m?.body||{}},query:d||m?.query,method:h,async onSuccess(e){if(await m?.onSuccess?.(e),!i||m.disableSignal)return;let t=i.filter(e=>e.matcher(c));if(!t.length)return;let n=new Set;for(let e of t){let t=r[e.signal];if(!t)return;if(n.has(e.signal))continue;n.add(e.signal);let i=t.get();setTimeout(()=>{t.set(!i)},10),e.callback?.(c)}}})}})}return a()}function Wu(e,t={}){let n=(0,m.useRef)(e.get()),{keys:r,deps:i=[e,r]}=t,a=(0,m.useCallback)(t=>{let i=e=>{n.current!==e&&(n.current=e,t())};return i(e.value),r?.length?Ll(e,r,i):e.listen(i)},i),o=()=>n.current;return(0,m.useSyncExternalStore)(a,o,o)}function Gu(e){return e.charAt(0).toUpperCase()+e.slice(1)}function Ku(e){return`use${Gu(e)}`}function qu(e){let{pluginPathMethods:t,pluginsActions:n,pluginsAtoms:r,$fetch:i,$store:a,atomListeners:o}=Bu(e),s={};for(let[e,t]of Object.entries(r))s[Ku(e)]=()=>Wu(t);return Uu({...n,...s,$fetch:i,$store:a},i,t,r,o)}var Ju=e=>`[SonamuProvider] ${e} is not configured. Please provide ${e} configuration to SonamuProvider.`,Yu=()=>()=>{throw Error(Ju(`uploader`))},Xu=()=>e=>tl[e],Zu=(0,m.createContext)({});function Qu({children:e,authOptions:t,...n}){let r=(0,m.useRef)(void 0);t&&!r.current&&(r.current=qu(t));let i={uploader:n.uploader??Yu(),auth:n.auth??r.current,SD:n.SD??Xu()};return(0,z.jsx)(Zu.Provider,{value:i,children:e})}function $u(){return(0,m.useContext)(Zu)}var ed=e=>(0,z.jsx)(`svg`,{viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`,...e,children:(0,z.jsx)(`path`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M18 6L6 18M6 6l12 12`})}),td=Fi,nd=Ii,rd=m.forwardRef(({className:e,...t},n)=>(0,z.jsx)(Li,{ref:n,className:et(`fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0`,e),...t}));rd.displayName=Li.displayName;var id=m.forwardRef(({className:e,children:t,...n},r)=>(0,z.jsxs)(nd,{children:[(0,z.jsx)(rd,{}),(0,z.jsxs)(Ri,{ref:r,className:et(`fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 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-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg`,e),...n,children:[t,(0,z.jsxs)(Vi,{className:`absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground`,children:[(0,z.jsx)(ed,{className:`h-4 w-4`}),(0,z.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]}));id.displayName=Ri.displayName;var ad=({className:e,...t})=>(0,z.jsx)(`div`,{className:et(`flex flex-col space-y-1.5 text-center sm:text-left`,e),...t});ad.displayName=`DialogHeader`;var od=({className:e,...t})=>(0,z.jsx)(`div`,{className:et(`flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2`,e),...t});od.displayName=`DialogFooter`;var sd=m.forwardRef(({className:e,...t},n)=>(0,z.jsx)(zi,{ref:n,className:et(`text-lg font-semibold leading-none tracking-tight`,e),...t}));sd.displayName=zi.displayName;var cd=m.forwardRef(({className:e,...t},n)=>(0,z.jsx)(Bi,{ref:n,className:et(`text-sm text-muted-foreground`,e),...t}));cd.displayName=Bi.displayName;var ld=e=>(0,z.jsx)(`svg`,{viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`,...e,children:(0,z.jsxs)(`g`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,children:[(0,z.jsx)(`path`,{d:`m21 21l-4.34-4.34`}),(0,z.jsx)(`circle`,{cx:11,cy:11,r:8})]})}),ud=1,dd=.9,fd=.8,pd=.17,md=.1,hd=.999,gd=.9999,_d=.99,vd=/[\\\/_+.#"@\[\(\{&]/,yd=/[\\\/_+.#"@\[\(\{&]/g,bd=/[\s-]/,xd=/[\s-]/g;function Sd(e,t,n,r,i,a,o){if(a===t.length)return i===e.length?ud:_d;var s=`${i},${a}`;if(o[s]!==void 0)return o[s];for(var c=r.charAt(a),l=n.indexOf(c,i),u=0,d,f,p,m;l>=0;)d=Sd(e,t,n,r,l+1,a+1,o),d>u&&(l===i?d*=ud:vd.test(e.charAt(l-1))?(d*=fd,p=e.slice(i,l-1).match(yd),p&&i>0&&(d*=hd**+p.length)):bd.test(e.charAt(l-1))?(d*=dd,m=e.slice(i,l-1).match(xd),m&&i>0&&(d*=hd**+m.length)):(d*=pd,i>0&&(d*=hd**+(l-i))),e.charAt(l)!==t.charAt(a)&&(d*=gd)),(d<md&&n.charAt(l-1)===r.charAt(a+1)||r.charAt(a+1)===r.charAt(a)&&n.charAt(l-1)!==r.charAt(a))&&(f=Sd(e,t,n,r,l+1,a+2,o),f*md>d&&(d=f*md)),d>u&&(u=d),l=n.indexOf(c,l+1);return o[s]=u,u}function Cd(e){return e.toLowerCase().replace(xd,` `)}function wd(e,t,n){return e=n&&n.length>0?`${e+` `+n.join(` `)}`:e,Sd(e,t,Cd(e),Cd(t),0,0,{})}var Td=`[cmdk-group=""]`,Ed=`[cmdk-group-items=""]`,Dd=`[cmdk-group-heading=""]`,Od=`[cmdk-item=""]`,kd=`${Od}:not([aria-disabled="true"])`,Ad=`cmdk-item-select`,jd=`data-value`,Md=(e,t,n)=>wd(e,t,n),Nd=m.createContext(void 0),Pd=()=>m.useContext(Nd),Fd=m.createContext(void 0),Id=()=>m.useContext(Fd),Ld=m.createContext(void 0),Rd=m.forwardRef((e,t)=>{let n=Qd(()=>({search:``,value:e.value??e.defaultValue??``,selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}})),r=Qd(()=>new Set),i=Qd(()=>new Map),a=Qd(()=>new Map),o=Qd(()=>new Set),s=Xd(e),{label:c,children:l,value:u,onValueChange:d,filter:f,shouldFilter:p,loop:h,disablePointerSelection:g=!1,vimBindings:_=!0,...v}=e,y=Ft(),b=Ft(),x=Ft(),S=m.useRef(null),C=tf();Zd(()=>{if(u!==void 0){let e=u.trim();n.current.value=e,w.emit()}},[u]),Zd(()=>{C(6,A)},[]);let w=m.useMemo(()=>({subscribe:e=>(o.current.add(e),()=>o.current.delete(e)),snapshot:()=>n.current,setState:(e,t,r)=>{var i,a,o;if(!Object.is(n.current[e],t)){if(n.current[e]=t,e===`search`)k(),D(),C(1,O);else if(e===`value`){if(document.activeElement.hasAttribute(`cmdk-input`)||document.activeElement.hasAttribute(`cmdk-root`)){let e=document.getElementById(x);e?e.focus():(i=document.getElementById(y))==null||i.focus()}if(C(7,()=>{n.current.selectedItemId=j()?.id,w.emit()}),r||C(5,A),s.current?.value!==void 0){let e=t??``;(o=(a=s.current).onValueChange)==null||o.call(a,e);return}}w.emit()}},emit:()=>{o.current.forEach(e=>e())}}),[]),T=m.useMemo(()=>({value:(e,t,r)=>{t!==a.current.get(e)?.value&&(a.current.set(e,{value:t,keywords:r}),n.current.filtered.items.set(e,E(t,r)),C(2,()=>{D(),w.emit()}))},item:(e,t)=>(r.current.add(e),t&&(i.current.has(t)?i.current.get(t).add(e):i.current.set(t,new Set([e]))),C(3,()=>{k(),D(),n.current.value||O(),w.emit()}),()=>{a.current.delete(e),r.current.delete(e),n.current.filtered.items.delete(e);let t=j();C(4,()=>{k(),t?.getAttribute(`id`)===e&&O(),w.emit()})}),group:e=>(i.current.has(e)||i.current.set(e,new Set),()=>{a.current.delete(e),i.current.delete(e)}),filter:()=>s.current.shouldFilter,label:c||e[`aria-label`],getDisablePointerSelection:()=>s.current.disablePointerSelection,listId:y,inputId:x,labelId:b,listInnerRef:S}),[]);function E(e,t){let r=s.current?.filter??Md;return e?r(e,n.current.search,t):0}function D(){if(!n.current.search||s.current.shouldFilter===!1)return;let e=n.current.filtered.items,t=[];n.current.filtered.groups.forEach(n=>{let r=i.current.get(n),a=0;r.forEach(t=>{let n=e.get(t);a=Math.max(n,a)}),t.push([n,a])});let r=S.current;M().sort((t,n)=>{let r=t.getAttribute(`id`),i=n.getAttribute(`id`);return(e.get(i)??0)-(e.get(r)??0)}).forEach(e=>{let t=e.closest(Ed);t?t.appendChild(e.parentElement===t?e:e.closest(`${Ed} > *`)):r.appendChild(e.parentElement===r?e:e.closest(`${Ed} > *`))}),t.sort((e,t)=>t[1]-e[1]).forEach(e=>{let t=S.current?.querySelector(`${Td}[${jd}="${encodeURIComponent(e[0])}"]`);t?.parentElement.appendChild(t)})}function O(){let e=M().find(e=>e.getAttribute(`aria-disabled`)!==`true`)?.getAttribute(jd);w.setState(`value`,e||void 0)}function k(){if(!n.current.search||s.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let e=0;for(let t of r.current){let r=E(a.current.get(t)?.value??``,a.current.get(t)?.keywords??[]);n.current.filtered.items.set(t,r),r>0&&e++}for(let[e,t]of i.current)for(let r of t)if(n.current.filtered.items.get(r)>0){n.current.filtered.groups.add(e);break}n.current.filtered.count=e}function A(){var e;let t=j();t&&(t.parentElement?.firstChild===t&&((e=t.closest(Td)?.querySelector(Dd))==null||e.scrollIntoView({block:`nearest`})),t.scrollIntoView({block:`nearest`}))}function j(){return S.current?.querySelector(`${Od}[aria-selected="true"]`)}function M(){return Array.from(S.current?.querySelectorAll(kd)||[])}function N(e){let t=M()[e];t&&w.setState(`value`,t.getAttribute(jd))}function P(e){var t;let n=j(),r=M(),i=r.findIndex(e=>e===n),a=r[i+e];(t=s.current)!=null&&t.loop&&(a=i+e<0?r[r.length-1]:i+e===r.length?r[0]:r[i+e]),a&&w.setState(`value`,a.getAttribute(jd))}function F(e){let t=j()?.closest(Td),n;for(;t&&!n;)t=e>0?Jd(t,Td):Yd(t,Td),n=t?.querySelector(kd);n?w.setState(`value`,n.getAttribute(jd)):P(e)}let ee=()=>N(M().length-1),te=e=>{e.preventDefault(),e.metaKey?ee():e.altKey?F(1):P(1)},ne=e=>{e.preventDefault(),e.metaKey?N(0):e.altKey?F(-1):P(-1)};return m.createElement(Hi.div,{ref:t,tabIndex:-1,...v,"cmdk-root":``,onKeyDown:e=>{var t;(t=v.onKeyDown)==null||t.call(v,e);let n=e.nativeEvent.isComposing||e.keyCode===229;if(!(e.defaultPrevented||n))switch(e.key){case`n`:case`j`:_&&e.ctrlKey&&te(e);break;case`ArrowDown`:te(e);break;case`p`:case`k`:_&&e.ctrlKey&&ne(e);break;case`ArrowUp`:ne(e);break;case`Home`:e.preventDefault(),N(0);break;case`End`:e.preventDefault(),ee();break;case`Enter`:{e.preventDefault();let t=j();if(t){let e=new Event(Ad);t.dispatchEvent(e)}}}}},m.createElement(`label`,{"cmdk-label":``,htmlFor:T.inputId,id:T.labelId,style:af},c),rf(e,e=>m.createElement(Fd.Provider,{value:w},m.createElement(Nd.Provider,{value:T},e))))}),zd=m.forwardRef((e,t)=>{let n=Ft(),r=m.useRef(null),i=m.useContext(Ld),a=Pd(),o=Xd(e),s=o.current?.forceMount??i?.forceMount;Zd(()=>{if(!s)return a.item(n,i?.id)},[s]);let c=ef(n,r,[e.value,e.children,r],e.keywords),l=Id(),u=$d(e=>e.value&&e.value===c.current),d=$d(e=>s||a.filter()===!1?!0:e.search?e.filtered.items.get(n)>0:!0);m.useEffect(()=>{let t=r.current;if(!(!t||e.disabled))return t.addEventListener(Ad,f),()=>t.removeEventListener(Ad,f)},[d,e.onSelect,e.disabled]);function f(){var e,t;p(),(t=(e=o.current).onSelect)==null||t.call(e,c.current)}function p(){l.setState(`value`,c.current,!0)}if(!d)return null;let{disabled:h,value:g,onSelect:_,forceMount:v,keywords:y,...b}=e;return m.createElement(Hi.div,{ref:st(r,t),...b,id:n,"cmdk-item":``,role:`option`,"aria-disabled":!!h,"aria-selected":!!u,"data-disabled":!!h,"data-selected":!!u,onPointerMove:h||a.getDisablePointerSelection()?void 0:p,onClick:h?void 0:f},e.children)}),Bd=m.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:i,...a}=e,o=Ft(),s=m.useRef(null),c=m.useRef(null),l=Ft(),u=Pd(),d=$d(e=>i||u.filter()===!1?!0:e.search?e.filtered.groups.has(o):!0);Zd(()=>u.group(o),[]),ef(o,s,[e.value,e.heading,c]);let f=m.useMemo(()=>({id:o,forceMount:i}),[i]);return m.createElement(Hi.div,{ref:st(s,t),...a,"cmdk-group":``,role:`presentation`,hidden:d?void 0:!0},n&&m.createElement(`div`,{ref:c,"cmdk-group-heading":``,"aria-hidden":!0,id:l},n),rf(e,e=>m.createElement(`div`,{"cmdk-group-items":``,role:`group`,"aria-labelledby":n?l:void 0},m.createElement(Ld.Provider,{value:f},e))))}),Vd=m.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,i=m.useRef(null),a=$d(e=>!e.search);return!n&&!a?null:m.createElement(Hi.div,{ref:st(i,t),...r,"cmdk-separator":``,role:`separator`})}),Hd=m.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,i=e.value!=null,a=Id(),o=$d(e=>e.search),s=$d(e=>e.selectedItemId),c=Pd();return m.useEffect(()=>{e.value!=null&&a.setState(`search`,e.value)},[e.value]),m.createElement(Hi.input,{ref:t,...r,"cmdk-input":``,autoComplete:`off`,autoCorrect:`off`,spellCheck:!1,"aria-autocomplete":`list`,role:`combobox`,"aria-expanded":!0,"aria-controls":c.listId,"aria-labelledby":c.labelId,"aria-activedescendant":s,id:c.inputId,type:`text`,value:i?e.value:o,onChange:e=>{i||a.setState(`search`,e.target.value),n?.(e.target.value)}})}),Ud=m.forwardRef((e,t)=>{let{children:n,label:r=`Suggestions`,...i}=e,a=m.useRef(null),o=m.useRef(null),s=$d(e=>e.selectedItemId),c=Pd();return m.useEffect(()=>{if(o.current&&a.current){let e=o.current,t=a.current,n,r=new ResizeObserver(()=>{n=requestAnimationFrame(()=>{let n=e.offsetHeight;t.style.setProperty(`--cmdk-list-height`,n.toFixed(1)+`px`)})});return r.observe(e),()=>{cancelAnimationFrame(n),r.unobserve(e)}}},[]),m.createElement(Hi.div,{ref:st(a,t),...i,"cmdk-list":``,role:`listbox`,tabIndex:-1,"aria-activedescendant":s,"aria-label":r,id:c.listId},rf(e,e=>m.createElement(`div`,{ref:st(o,c.listInnerRef),"cmdk-list-sizer":``},e)))}),Wd=m.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:i,contentClassName:a,container:o,...s}=e;return m.createElement(Fi,{open:n,onOpenChange:r},m.createElement(Ii,{container:o},m.createElement(Li,{"cmdk-overlay":``,className:i}),m.createElement(Ri,{"aria-label":e.label,"cmdk-dialog":``,className:a},m.createElement(Rd,{ref:t,...s}))))}),Gd=m.forwardRef((e,t)=>$d(e=>e.filtered.count===0)?m.createElement(Hi.div,{ref:t,...e,"cmdk-empty":``,role:`presentation`}):null),Kd=m.forwardRef((e,t)=>{let{progress:n,children:r,label:i=`Loading...`,...a}=e;return m.createElement(Hi.div,{ref:t,...a,"cmdk-loading":``,role:`progressbar`,"aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":i},rf(e,e=>m.createElement(`div`,{"aria-hidden":!0},e)))}),qd=Object.assign(Rd,{List:Ud,Item:zd,Input:Hd,Group:Bd,Separator:Vd,Dialog:Wd,Empty:Gd,Loading:Kd});function Jd(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function Yd(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function Xd(e){let t=m.useRef(e);return Zd(()=>{t.current=e}),t}var Zd=typeof window>`u`?m.useEffect:m.useLayoutEffect;function Qd(e){let t=m.useRef();return t.current===void 0&&(t.current=e()),t}function $d(e){let t=Id(),n=()=>e(t.snapshot());return m.useSyncExternalStore(t.subscribe,n,n)}function ef(e,t,n,r=[]){let i=m.useRef(),a=Pd();return Zd(()=>{var o;let s=(()=>{for(let e of n){if(typeof e==`string`)return e.trim();if(typeof e==`object`&&`current`in e)return e.current?e.current.textContent?.trim():i.current}})(),c=r.map(e=>e.trim());a.value(e,s,c),(o=t.current)==null||o.setAttribute(jd,s),i.current=s}),i}var tf=()=>{let[e,t]=m.useState(),n=Qd(()=>new Map);return Zd(()=>{n.current.forEach(e=>e()),n.current=new Map},[e]),(e,r)=>{n.current.set(e,r),t({})}};function nf(e){let t=e.type;return typeof t==`function`?t(e.props):`render`in t?t.render(e.props):e}function rf({asChild:e,children:t},n){return e&&m.isValidElement(t)?m.cloneElement(nf(t),{ref:t.ref},n(t.props.children)):n(t)}var af={position:`absolute`,width:`1px`,height:`1px`,padding:`0`,margin:`-1px`,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,borderWidth:`0`},of=m.forwardRef(({className:e,...t},n)=>(0,z.jsx)(qd,{ref:n,className:et(`flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground`,e),...t}));of.displayName=qd.displayName;var sf=({children:e,commandProps:t,...n})=>{let{className:r,...i}=t??{};return(0,z.jsx)(td,{...n,children:(0,z.jsx)(id,{className:`overflow-hidden p-0 shadow-lg`,children:(0,z.jsx)(of,{className:et(`**:[[cmdk-group-heading]]:px-2 **:[[cmdk-group-heading]]:font-medium **:[[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 **:[[cmdk-group]]:px-2 **:[[cmdk-input-wrapper]_svg]:size-5 **:[[cmdk-input]]:h-12 **:[[cmdk-item]]:px-2 **:[[cmdk-item]]:py-3 **:[[cmdk-item]_svg]:size-5`,r),...i,children:e})})})},cf=m.forwardRef(({className:e,...t},n)=>(0,z.jsxs)(`div`,{className:`flex items-center border-b px-3`,"cmdk-input-wrapper":``,children:[(0,z.jsx)(ld,{className:`mr-2 h-4 w-4 shrink-0 opacity-50`}),(0,z.jsx)(qd.Input,{ref:n,className:et(`flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50`,e),...t})]}));cf.displayName=qd.Input.displayName;var lf=m.forwardRef(({className:e,...t},n)=>(0,z.jsx)(qd.List,{ref:n,className:et(`max-h-[300px] overflow-y-auto overflow-x-hidden`,e),...t}));lf.displayName=qd.List.displayName;var uf=m.forwardRef((e,t)=>(0,z.jsx)(qd.Empty,{ref:t,className:`py-6 text-center text-sm`,...e}));uf.displayName=qd.Empty.displayName;var df=m.forwardRef(({className:e,...t},n)=>(0,z.jsx)(qd.Group,{ref:n,className:et(`overflow-hidden p-1 text-foreground **:[[cmdk-group-heading]]:px-2 **:[[cmdk-group-heading]]:py-1.5 **:[[cmdk-group-heading]]:text-xs **:[[cmdk-group-heading]]:font-medium **:[[cmdk-group-heading]]:text-muted-foreground`,e),...t}));df.displayName=qd.Group.displayName;var ff=m.forwardRef(({className:e,...t},n)=>(0,z.jsx)(qd.Separator,{ref:n,className:et(`-mx-1 h-px bg-border`,e),...t}));ff.displayName=qd.Separator.displayName;var pf=m.forwardRef(({className:e,...t},n)=>(0,z.jsx)(qd.Item,{ref:n,className:et(`relative flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected='true']:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50 **:[svg]:pointer-events-none **:[svg]:size-4 **:[svg]:shrink-0`,e),...t}));pf.displayName=qd.Item.displayName;var mf=({className:e,...t})=>(0,z.jsx)(`span`,{className:et(`ml-auto text-xs tracking-widest text-muted-foreground`,e),...t});mf.displayName=`CommandShortcut`;var hf=[`top`,`right`,`bottom`,`left`],gf=Math.min,_f=Math.max,vf=Math.round,yf=Math.floor,bf=e=>({x:e,y:e}),xf={left:`right`,right:`left`,bottom:`top`,top:`bottom`},Sf={start:`end`,end:`start`};function Cf(e,t,n){return _f(e,gf(t,n))}function wf(e,t){return typeof e==`function`?e(t):e}function Tf(e){return e.split(`-`)[0]}function Ef(e){return e.split(`-`)[1]}function Df(e){return e===`x`?`y`:`x`}function Of(e){return e===`y`?`height`:`width`}var kf=new Set([`top`,`bottom`]);function Af(e){return kf.has(Tf(e))?`y`:`x`}function jf(e){return Df(Af(e))}function Mf(e,t,n){n===void 0&&(n=!1);let r=Ef(e),i=jf(e),a=Of(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=Vf(o)),[o,Vf(o)]}function Nf(e){let t=Vf(e);return[Pf(e),t,Pf(t)]}function Pf(e){return e.replace(/start|end/g,e=>Sf[e])}var Ff=[`left`,`right`],If=[`right`,`left`],Lf=[`top`,`bottom`],Rf=[`bottom`,`top`];function zf(e,t,n){switch(e){case`top`:case`bottom`:return n?t?If:Ff:t?Ff:If;case`left`:case`right`:return t?Lf:Rf;default:return[]}}function Bf(e,t,n,r){let i=Ef(e),a=zf(Tf(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(Pf)))),a}function Vf(e){return e.replace(/left|right|bottom|top/g,e=>xf[e])}function Hf(e){return{top:0,right:0,bottom:0,left:0,...e}}function Uf(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:Hf(e)}function Wf(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function Gf(e,t,n){let{reference:r,floating:i}=e,a=Af(t),o=jf(t),s=Of(o),c=Tf(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}switch(Ef(t)){case`start`:p[o]-=f*(n&&l?-1:1);break;case`end`:p[o]+=f*(n&&l?-1:1);break}return p}var Kf=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=a.filter(Boolean),c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=Gf(l,r,c),f=r,p={},m=0;for(let n=0;n<s.length;n++){let{name:a,fn:h}=s[n],{x:g,y:_,data:v,reset:y}=await h({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:p,rects:l,platform:o,elements:{reference:e,floating:t}});u=g??u,d=_??d,p={...p,[a]:{...p[a],...v}},y&&m<=50&&(m++,typeof y==`object`&&(y.placement&&(f=y.placement),y.rects&&(l=y.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):y.rects),{x:u,y:d}=Gf(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:p}};async function qf(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=wf(t,e),p=Uf(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=Wf(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=Wf(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var Jf=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=wf(e,t)||{};if(l==null)return{};let d=Uf(u),f={x:n,y:r},p=jf(i),m=Of(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,E=gf(d[_],T),D=gf(d[v],T),O=E,k=C-h[m]-D,A=C/2-h[m]/2+w,j=Cf(O,A,k),M=!c.arrow&&Ef(i)!=null&&A!==j&&a.reference[m]/2-(A<O?E:D)-h[m]/2<0,N=M?A<O?A-O:A-k:0;return{[p]:f[p]+N,data:{[p]:j,centerOffset:A-j-N,...M&&{alignmentOffset:N}},reset:M}}}),Yf=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=wf(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=Tf(r),_=Af(o),v=Tf(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[Vf(o)]:Nf(o)),x=p!==`none`;!d&&x&&b.push(...Bf(o,m,p,y));let S=[o,...b],C=await qf(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=Mf(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(!(u===`alignment`&&_!==Af(t))||T.every(e=>Af(e.placement)===_?e.overflows[0]>0:!0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=Af(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o;break}if(r!==n)return{reset:{placement:n}}}return{}}}};function Xf(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Zf(e){return hf.some(t=>e[t]>=0)}var Qf=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n}=t,{strategy:r=`referenceHidden`,...i}=wf(e,t);switch(r){case`referenceHidden`:{let e=Xf(await qf(t,{...i,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:Zf(e)}}}case`escaped`:{let e=Xf(await qf(t,{...i,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:Zf(e)}}}default:return{}}}}},$f=new Set([`left`,`top`]);async function ep(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=Tf(n),s=Ef(n),c=Af(n)===`y`,l=$f.has(o)?-1:1,u=a&&c?-1:1,d=wf(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var tp=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await ep(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},np=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i}=t,{mainAxis:a=!0,crossAxis:o=!1,limiter:s={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...c}=wf(e,t),l={x:n,y:r},u=await qf(t,c),d=Af(Tf(i)),f=Df(d),p=l[f],m=l[d];if(a){let e=f===`y`?`top`:`left`,t=f===`y`?`bottom`:`right`,n=p+u[e],r=p-u[t];p=Cf(n,p,r)}if(o){let e=d===`y`?`top`:`left`,t=d===`y`?`bottom`:`right`,n=m+u[e],r=m-u[t];m=Cf(n,m,r)}let h=s.fn({...t,[f]:p,[d]:m});return{...h,data:{x:h.x-n,y:h.y-r,enabled:{[f]:a,[d]:o}}}}}},rp=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=wf(e,t),u={x:n,y:r},d=Af(i),f=Df(d),p=u[f],m=u[d],h=wf(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=$f.has(Tf(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},ip=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){var n,r;let{placement:i,rects:a,platform:o,elements:s}=t,{apply:c=()=>{},...l}=wf(e,t),u=await qf(t,l),d=Tf(i),f=Ef(i),p=Af(i)===`y`,{width:m,height:h}=a.floating,g,_;d===`top`||d===`bottom`?(g=d,_=f===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?`start`:`end`)?`left`:`right`):(_=d,g=f===`end`?`top`:`bottom`);let v=h-u.top-u.bottom,y=m-u.left-u.right,b=gf(h-u[g],v),x=gf(m-u[_],y),S=!t.middlewareData.shift,C=b,w=x;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(w=y),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(C=v),S&&!f){let e=_f(u.left,0),t=_f(u.right,0),n=_f(u.top,0),r=_f(u.bottom,0);p?w=m-2*(e!==0||t!==0?e+t:_f(u.left,u.right)):C=h-2*(n!==0||r!==0?n+r:_f(u.top,u.bottom))}await c({...t,availableWidth:w,availableHeight:C});let T=await o.getDimensions(s.floating);return m!==T.width||h!==T.height?{reset:{rects:!0}}:{}}}};function ap(){return typeof window<`u`}function op(e){return lp(e)?(e.nodeName||``).toLowerCase():`#document`}function sp(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function cp(e){return((lp(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function lp(e){return ap()?e instanceof Node||e instanceof sp(e).Node:!1}function up(e){return ap()?e instanceof Element||e instanceof sp(e).Element:!1}function dp(e){return ap()?e instanceof HTMLElement||e instanceof sp(e).HTMLElement:!1}function fp(e){return!ap()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof sp(e).ShadowRoot}var pp=new Set([`inline`,`contents`]);function mp(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=Dp(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!pp.has(i)}var hp=new Set([`table`,`td`,`th`]);function gp(e){return hp.has(op(e))}var _p=[`:popover-open`,`:modal`];function vp(e){return _p.some(t=>{try{return e.matches(t)}catch{return!1}})}var yp=[`transform`,`translate`,`scale`,`rotate`,`perspective`],bp=[`transform`,`translate`,`scale`,`rotate`,`perspective`,`filter`],xp=[`paint`,`layout`,`strict`,`content`];function Sp(e){let t=wp(),n=up(e)?Dp(e):e;return yp.some(e=>n[e]?n[e]!==`none`:!1)||(n.containerType?n.containerType!==`normal`:!1)||!t&&(n.backdropFilter?n.backdropFilter!==`none`:!1)||!t&&(n.filter?n.filter!==`none`:!1)||bp.some(e=>(n.willChange||``).includes(e))||xp.some(e=>(n.contain||``).includes(e))}function Cp(e){let t=kp(e);for(;dp(t)&&!Ep(t);){if(Sp(t))return t;if(vp(t))return null;t=kp(t)}return null}function wp(){return typeof CSS>`u`||!CSS.supports?!1:CSS.supports(`-webkit-backdrop-filter`,`none`)}var Tp=new Set([`html`,`body`,`#document`]);function Ep(e){return Tp.has(op(e))}function Dp(e){return sp(e).getComputedStyle(e)}function Op(e){return up(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function kp(e){if(op(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||fp(e)&&e.host||cp(e);return fp(t)?t.host:t}function Ap(e){let t=kp(e);return Ep(t)?e.ownerDocument?e.ownerDocument.body:e.body:dp(t)&&mp(t)?t:Ap(t)}function jp(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=Ap(e),i=r===e.ownerDocument?.body,a=sp(r);if(i){let e=Mp(a);return t.concat(a,a.visualViewport||[],mp(r)?r:[],e&&n?jp(e):[])}return t.concat(r,jp(r,[],n))}function Mp(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Np(e){let t=Dp(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=dp(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=vf(n)!==a||vf(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function Pp(e){return up(e)?e:e.contextElement}function Fp(e){let t=Pp(e);if(!dp(t))return bf(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=Np(t),o=(a?vf(n.width):n.width)/r,s=(a?vf(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var Ip=bf(0);function Lp(e){let t=sp(e);return!wp()||!t.visualViewport?Ip:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Rp(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==sp(e)?!1:t}function zp(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=Pp(e),o=bf(1);t&&(r?up(r)&&(o=Fp(r)):o=Fp(e));let s=Rp(a,n,r)?Lp(a):bf(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a){let e=sp(a),t=r&&up(r)?sp(r):r,n=e,i=Mp(n);for(;i&&r&&t!==n;){let e=Fp(i),t=i.getBoundingClientRect(),r=Dp(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=sp(i),i=Mp(n)}}return Wf({width:u,height:d,x:c,y:l})}function Bp(e,t){let n=Op(e).scrollLeft;return t?t.left+n:zp(cp(e)).left+n}function Vp(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Bp(e,n),y:n.top+t.scrollTop}}function Hp(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=cp(r),s=t?vp(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=bf(1),u=bf(0),d=dp(r);if((d||!d&&!a)&&((op(r)!==`body`||mp(o))&&(c=Op(r)),dp(r))){let e=zp(r);l=Fp(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?Vp(o,c):bf(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 Up(e){return Array.from(e.getClientRects())}function Wp(e){let t=cp(e),n=Op(e),r=e.ownerDocument.body,i=_f(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=_f(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+Bp(e),s=-n.scrollTop;return Dp(r).direction===`rtl`&&(o+=_f(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}var Gp=25;function Kp(e,t){let n=sp(e),r=cp(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=wp();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=Bp(r);if(l<=0){let e=r.ownerDocument,t=e.body,n=getComputedStyle(t),i=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,o=Math.abs(r.clientWidth-t.clientWidth-i);o<=Gp&&(a-=o)}else l<=Gp&&(a+=l);return{width:a,height:o,x:s,y:c}}var qp=new Set([`absolute`,`fixed`]);function Jp(e,t){let n=zp(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=dp(e)?Fp(e):bf(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function Yp(e,t,n){let r;if(t===`viewport`)r=Kp(e,n);else if(t===`document`)r=Wp(cp(e));else if(up(t))r=Jp(t,n);else{let n=Lp(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return Wf(r)}function Xp(e,t){let n=kp(e);return n===t||!up(n)||Ep(n)?!1:Dp(n).position===`fixed`||Xp(n,t)}function Zp(e,t){let n=t.get(e);if(n)return n;let r=jp(e,[],!1).filter(e=>up(e)&&op(e)!==`body`),i=null,a=Dp(e).position===`fixed`,o=a?kp(e):e;for(;up(o)&&!Ep(o);){let t=Dp(o),n=Sp(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&qp.has(i.position)||mp(o)&&!n&&Xp(e,o))?r=r.filter(e=>e!==o):i=t,o=kp(o)}return t.set(e,r),r}function Qp(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?vp(t)?[]:Zp(t,this._c):[].concat(n),r],o=a[0],s=a.reduce((e,n)=>{let r=Yp(t,n,i);return e.top=_f(r.top,e.top),e.right=gf(r.right,e.right),e.bottom=gf(r.bottom,e.bottom),e.left=_f(r.left,e.left),e},Yp(t,o,i));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}}function $p(e){let{width:t,height:n}=Np(e);return{width:t,height:n}}function em(e,t,n){let r=dp(t),i=cp(t),a=n===`fixed`,o=zp(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=bf(0);function l(){c.x=Bp(i)}if(r||!r&&!a)if((op(t)!==`body`||mp(i))&&(s=Op(t)),r){let e=zp(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else i&&l();a&&!r&&i&&l();let u=i&&!r&&!a?Vp(i,s):bf(0);return{x:o.left+s.scrollLeft-c.x-u.x,y:o.top+s.scrollTop-c.y-u.y,width:o.width,height:o.height}}function tm(e){return Dp(e).position===`static`}function nm(e,t){if(!dp(e)||Dp(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return cp(e)===n&&(n=n.ownerDocument.body),n}function rm(e,t){let n=sp(e);if(vp(e))return n;if(!dp(e)){let t=kp(e);for(;t&&!Ep(t);){if(up(t)&&!tm(t))return t;t=kp(t)}return n}let r=nm(e,t);for(;r&&gp(r)&&tm(r);)r=nm(r,t);return r&&Ep(r)&&tm(r)&&!Sp(r)?n:r||Cp(e)||n}var im=async function(e){let t=this.getOffsetParent||rm,n=this.getDimensions,r=await n(e.floating);return{reference:em(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function am(e){return Dp(e).direction===`rtl`}var om={convertOffsetParentRelativeRectToViewportRelativeRect:Hp,getDocumentElement:cp,getClippingRect:Qp,getOffsetParent:rm,getElementRects:im,getClientRects:Up,getDimensions:$p,getScale:Fp,isElement:up,isRTL:am};function sm(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function cm(e,t){let n=null,r,i=cp(e);function a(){var e;clearTimeout(r),(e=n)==null||e.disconnect(),n=null}function o(s,c){s===void 0&&(s=!1),c===void 0&&(c=1),a();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(s||t(),!f||!p)return;let m=yf(d),h=yf(i.clientWidth-(u+f)),g=yf(i.clientHeight-(d+p)),_=yf(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:_f(0,gf(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(n!==c){if(!y)return o();n?o(!1,n):r=setTimeout(()=>{o(!1,1e-7)},1e3)}n===1&&!sm(l,e.getBoundingClientRect())&&o(),y=!1}try{n=new IntersectionObserver(b,{...v,root:i.ownerDocument})}catch{n=new IntersectionObserver(b,v)}n.observe(e)}return o(!0),a}function lm(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=Pp(e),u=i||a?[...l?jp(l):[],...jp(t)]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n,{passive:!0}),a&&e.addEventListener(`resize`,n)});let d=l&&s?cm(l,n):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),p.observe(t));let m,h=c?zp(e):null;c&&g();function g(){let t=zp(e);h&&!sm(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var um=tp,eee=np,tee=Yf,nee=ip,ree=Qf,dm=Jf,iee=rp,aee=(e,t,n)=>{let r=new Map,i={platform:om,...n},a={...i.platform,_c:r};return Kf(e,t,{...i,platform:a})},fm=typeof document<`u`?m.useLayoutEffect:function(){};function pm(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!pm(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!pm(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function mm(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function hm(e,t){let n=mm(e);return Math.round(t*n)/n}function gm(e){let t=m.useRef(e);return fm(()=>{t.current=e}),t}function oee(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=m.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=m.useState(r);pm(f,r)||p(r);let[h,g]=m.useState(null),[_,v]=m.useState(null),y=m.useCallback(e=>{e!==C.current&&(C.current=e,g(e))},[]),b=m.useCallback(e=>{e!==w.current&&(w.current=e,v(e))},[]),x=a||h,S=o||_,C=m.useRef(null),w=m.useRef(null),T=m.useRef(u),E=c!=null,D=gm(c),O=gm(i),k=gm(l),A=m.useCallback(()=>{if(!C.current||!w.current)return;let e={placement:t,strategy:n,middleware:f};O.current&&(e.platform=O.current),aee(C.current,w.current,e).then(e=>{let t={...e,isPositioned:k.current!==!1};j.current&&!pm(T.current,t)&&(T.current=t,Tt.flushSync(()=>{d(t)}))})},[f,t,n,O,k]);fm(()=>{l===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let j=m.useRef(!1);fm(()=>(j.current=!0,()=>{j.current=!1}),[]),fm(()=>{if(x&&(C.current=x),S&&(w.current=S),x&&S){if(D.current)return D.current(x,S,A);A()}},[x,S,A,D,E]);let M=m.useMemo(()=>({reference:C,floating:w,setReference:y,setFloating:b}),[y,b]),N=m.useMemo(()=>({reference:x,floating:S}),[x,S]),P=m.useMemo(()=>{let e={position:n,left:0,top:0};if(!N.floating)return e;let t=hm(N.floating,u.x),r=hm(N.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...mm(N.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,N.floating,u.x,u.y]);return m.useMemo(()=>({...u,update:A,refs:M,elements:N,floatingStyles:P}),[u,A,M,N,P])}var see=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:dm({element:r.current,padding:i}).fn(n):r?dm({element:r,padding:i}).fn(n):{}}}},cee=(e,t)=>({...um(e),options:[e,t]}),lee=(e,t)=>({...eee(e),options:[e,t]}),uee=(e,t)=>({...iee(e),options:[e,t]}),dee=(e,t)=>({...tee(e),options:[e,t]}),fee=(e,t)=>({...nee(e),options:[e,t]}),_m=(e,t)=>({...ree(e),options:[e,t]}),vm=(e,t)=>({...see(e),options:[e,t]}),ym=`Arrow`,bm=m.forwardRef((e,t)=>{let{children:n,width:r=10,height:i=5,...a}=e;return(0,z.jsx)(Et.svg,{...a,ref:t,width:r,height:i,viewBox:`0 0 30 10`,preserveAspectRatio:`none`,children:e.asChild?n:(0,z.jsx)(`polygon`,{points:`0,0 30,0 15,10`})})});bm.displayName=ym;var xm=bm,Sm=`Popper`,[Cm,wm]=it(Sm),[Tm,Em]=Cm(Sm),Dm=e=>{let{__scopePopper:t,children:n}=e,[r,i]=m.useState(null);return(0,z.jsx)(Tm,{scope:t,anchor:r,onAnchorChange:i,children:n})};Dm.displayName=Sm;var Om=`PopperAnchor`,km=m.forwardRef((e,t)=>{let{__scopePopper:n,virtualRef:r,...i}=e,a=Em(Om,n),o=m.useRef(null),s=ct(t,o),c=m.useRef(null);return m.useEffect(()=>{let e=c.current;c.current=r?.current||o.current,e!==c.current&&a.onAnchorChange(c.current)}),r?null:(0,z.jsx)(Et.div,{...i,ref:s})});km.displayName=Om;var Am=`PopperContent`,[jm,Mm]=Cm(Am),Nm=m.forwardRef((e,t)=>{let{__scopePopper:n,side:r=`bottom`,sideOffset:i=0,align:a=`center`,alignOffset:o=0,arrowPadding:s=0,avoidCollisions:c=!0,collisionBoundary:l=[],collisionPadding:u=0,sticky:d=`partial`,hideWhenDetached:f=!1,updatePositionStrategy:p=`optimized`,onPlaced:h,...g}=e,_=Em(Am,n),[v,y]=m.useState(null),b=ct(t,e=>y(e)),[x,S]=m.useState(null),C=Lc(x),w=C?.width??0,T=C?.height??0,E=r+(a===`center`?``:`-`+a),D=typeof u==`number`?u:{top:0,right:0,bottom:0,left:0,...u},O=Array.isArray(l)?l:[l],k=O.length>0,A={padding:D,boundary:O.filter(Lm),altBoundary:k},{refs:j,floatingStyles:M,placement:N,isPositioned:P,middlewareData:F}=oee({strategy:`fixed`,placement:E,whileElementsMounted:(...e)=>lm(...e,{animationFrame:p===`always`}),elements:{reference:_.anchor},middleware:[cee({mainAxis:i+T,alignmentAxis:o}),c&&lee({mainAxis:!0,crossAxis:!1,limiter:d===`partial`?uee():void 0,...A}),c&&dee({...A}),fee({...A,apply:({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)}}),x&&vm({element:x,padding:s}),Rm({arrowWidth:w,arrowHeight:T}),f&&_m({strategy:`referenceHidden`,...A})]}),[ee,te]=zm(N),ne=en(h);vt(()=>{P&&ne?.()},[P,ne]);let I=F.arrow?.x,re=F.arrow?.y,ie=F.arrow?.centerOffset!==0,[ae,oe]=m.useState();return vt(()=>{v&&oe(window.getComputedStyle(v).zIndex)},[v]),(0,z.jsx)(`div`,{ref:j.setFloating,"data-radix-popper-content-wrapper":``,style:{...M,transform:P?M.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:ae,"--radix-popper-transform-origin":[F.transformOrigin?.x,F.transformOrigin?.y].join(` `),...F.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,z.jsx)(jm,{scope:n,placedSide:ee,onArrowChange:S,arrowX:I,arrowY:re,shouldHideArrow:ie,children:(0,z.jsx)(Et.div,{"data-side":ee,"data-align":te,...g,ref:b,style:{...g.style,animation:P?void 0:`none`}})})})});Nm.displayName=Am;var Pm=`PopperArrow`,Fm={top:`bottom`,right:`left`,bottom:`top`,left:`right`},Im=m.forwardRef(function(e,t){let{__scopePopper:n,...r}=e,i=Mm(Pm,n),a=Fm[i.placedSide];return(0,z.jsx)(`span`,{ref:i.onArrowChange,style:{position:`absolute`,left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:``,right:`0 0`,bottom:`center 0`,left:`100% 0`}[i.placedSide],transform:{top:`translateY(100%)`,right:`translateY(50%) rotate(90deg) translateX(-50%)`,bottom:`rotate(180deg)`,left:`translateY(50%) rotate(-90deg) translateX(50%)`}[i.placedSide],visibility:i.shouldHideArrow?`hidden`:void 0},children:(0,z.jsx)(xm,{...r,ref:t,style:{...r.style,display:`block`}})})});Im.displayName=Pm;function Lm(e){return e!==null}var Rm=e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=zm(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}});function zm(e){let[t,n=`center`]=e.split(`-`);return[t,n]}var Bm=Dm,Vm=km,Hm=Nm,Um=Im,Wm=`Popover`,[Gm,pee]=it(Wm,[wm]),Km=wm(),[mee,qm]=Gm(Wm),Jm=e=>{let{__scopePopover:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!1}=e,s=Km(t),c=m.useRef(null),[l,u]=m.useState(!1),[d,f]=bt({prop:r,defaultProp:i??!1,onChange:a,caller:Wm});return(0,z.jsx)(Bm,{...s,children:(0,z.jsx)(mee,{scope:t,contentId:Ft(),triggerRef:c,open:d,onOpenChange:f,onOpenToggle:m.useCallback(()=>f(e=>!e),[f]),hasCustomAnchor:l,onCustomAnchorAdd:m.useCallback(()=>u(!0),[]),onCustomAnchorRemove:m.useCallback(()=>u(!1),[]),modal:o,children:n})})};Jm.displayName=Wm;var Ym=`PopoverAnchor`,hee=m.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=qm(Ym,n),a=Km(n),{onCustomAnchorAdd:o,onCustomAnchorRemove:s}=i;return m.useEffect(()=>(o(),()=>s()),[o,s]),(0,z.jsx)(Vm,{...a,...r,ref:t})});hee.displayName=Ym;var Xm=`PopoverTrigger`,Zm=m.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=qm(Xm,n),a=Km(n),o=ct(t,i.triggerRef),s=(0,z.jsx)(Et.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.contentId,"data-state":fh(i.open),...r,ref:o,onClick:_t(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?s:(0,z.jsx)(Vm,{asChild:!0,...a,children:s})});Zm.displayName=Xm;var Qm=`PopoverPortal`,[$m,eh]=Gm(Qm,{forceMount:void 0}),th=e=>{let{__scopePopover:t,forceMount:n,children:r,container:i}=e,a=qm(Qm,t);return(0,z.jsx)($m,{scope:t,forceMount:n,children:(0,z.jsx)(kt,{present:n||a.open,children:(0,z.jsx)(Nn,{asChild:!0,container:i,children:r})})})};th.displayName=Qm;var nh=`PopoverContent`,rh=m.forwardRef((e,t)=>{let n=eh(nh,e.__scopePopover),{forceMount:r=n.forceMount,...i}=e,a=qm(nh,e.__scopePopover);return(0,z.jsx)(kt,{present:r||a.open,children:a.modal?(0,z.jsx)(ah,{...i,ref:t}):(0,z.jsx)(oh,{...i,ref:t})})});rh.displayName=nh;var ih=lt(`PopoverContent.RemoveScroll`),ah=m.forwardRef((e,t)=>{let n=qm(nh,e.__scopePopover),r=m.useRef(null),i=ct(t,r),a=m.useRef(!1);return m.useEffect(()=>{let e=r.current;if(e)return ei(e)},[]),(0,z.jsx)(Gr,{as:ih,allowPinchZoom:!0,children:(0,z.jsx)(sh,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:_t(e.onCloseAutoFocus,e=>{e.preventDefault(),a.current||n.triggerRef.current?.focus()}),onPointerDownOutside:_t(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;a.current=t.button===2||n},{checkForDefaultPrevented:!1}),onFocusOutside:_t(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})}),oh=m.forwardRef((e,t)=>{let n=qm(nh,e.__scopePopover),r=m.useRef(!1),i=m.useRef(!1);return(0,z.jsx)(sh,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})}),sh=m.forwardRef((e,t)=>{let{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:o,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onInteractOutside:u,...d}=e,f=qm(nh,n),p=Km(n);return Fn(),(0,z.jsx)(bn,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,z.jsx)(ln,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:u,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onDismiss:()=>f.onOpenChange(!1),children:(0,z.jsx)(Hm,{"data-state":fh(f.open),role:`dialog`,id:f.contentId,...p,...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)`}})})})}),ch=`PopoverClose`,lh=m.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=qm(ch,n);return(0,z.jsx)(Et.button,{type:`button`,...r,ref:t,onClick:_t(e.onClick,()=>i.onOpenChange(!1))})});lh.displayName=ch;var uh=`PopoverArrow`,dh=m.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=Km(n);return(0,z.jsx)(Um,{...i,...r,ref:t})});dh.displayName=uh;function fh(e){return e?`open`:`closed`}var ph=Jm,mh=Zm,gee=th,_ee=rh;function hh({...e}){return(0,z.jsx)(ph,{"data-slot":`popover`,...e})}function gh({...e}){return(0,z.jsx)(mh,{"data-slot":`popover-trigger`,...e})}function _h({className:e,align:t=`center`,sideOffset:n=4,...r}){return(0,z.jsx)(gee,{children:(0,z.jsx)(_ee,{"data-slot":`popover-content`,align:t,sideOffset:n,className:et(`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})})}var vh=e=>(0,z.jsx)(`svg`,{viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`,...e,children:(0,z.jsxs)(`g`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,children:[(0,z.jsx)(`circle`,{cx:12,cy:12,r:10}),(0,z.jsx)(`path`,{d:`m15 9l-6 6m0-6l6 6`})]})});function yh(e){return`init`in e}function bh(e){return!!e.write}function xh(e){return`v`in e||`e`in e}function Sh(e){if(`e`in e)throw e.e;return e.v}var Ch=new WeakMap;function wh(e){return Eh(e)&&!!Ch.get(e)?.[0]}function vee(e){let t=Ch.get(e);t?.[0]&&(t[0]=!1,t[1].forEach(e=>e()))}function Th(e,t){let n=Ch.get(e);if(!n){n=[!0,new Set],Ch.set(e,n);let t=()=>{n[0]=!1};e.then(t,t)}n[1].add(t)}function Eh(e){return typeof e?.then==`function`}function Dh(e,t,n){if(!n.p.has(e)){n.p.add(e);let r=()=>n.p.delete(e);t.then(r,r)}}function Oh(e,t,n){let r=new Set;for(let t of n.get(e)?.t||[])r.add(t);for(let e of t.p)r.add(e);return r}var yee=(e,t,...n)=>t.read(...n),bee=(e,t,...n)=>t.write(...n),xee=(e,t)=>{if(t.INTERNAL_onInit)return t.INTERNAL_onInit(e);if(t.unstable_onInit)return console.warn(`[DEPRECATED] atom.unstable_onInit is renamed to atom.INTERNAL_onInit.`),t.unstable_onInit(e)},See=(e,t,n)=>t.onMount?.call(t,n),Cee=(e,t)=>{var n;let r=Ah(e),i=r[0],a=r[6],o=r[9],s=i.get(t);return s||(s={d:new Map,p:new Set,n:0},i.set(t,s),(n=a.i)==null||n.call(a,t),o?.(e,t)),s},wee=e=>{let t=Ah(e),n=t[1],r=t[3],i=t[4],a=t[5],o=t[6],s=t[13],c=[],l=e=>{try{e()}catch(e){c.push(e)}};do{o.f&&l(o.f);let t=new Set,c=t.add.bind(t);r.forEach(e=>n.get(e)?.l.forEach(c)),r.clear(),a.forEach(c),a.clear(),i.forEach(c),i.clear(),t.forEach(l),r.size&&s(e)}while(r.size||a.size||i.size);if(c.length)throw AggregateError(c)},Tee=e=>{let t=Ah(e),n=t[1],r=t[2],i=t[3],a=t[11],o=t[14],s=t[17],c=[],l=new WeakSet,u=new WeakSet,d=Array.from(i);for(;d.length;){let t=d[d.length-1],i=a(e,t);if(u.has(t)){d.pop();continue}if(l.has(t)){r.get(t)===i.n&&c.push([t,i]),u.add(t),d.pop();continue}l.add(t);for(let e of Oh(t,i,n))l.has(e)||d.push(e)}for(let t=c.length-1;t>=0;--t){let[n,a]=c[t],l=!1;for(let e of a.d.keys())if(e!==n&&i.has(e)){l=!0;break}l&&(o(e,n),s(e,n)),r.delete(n)}},Eee=(e,t)=>{var n,r;let i=Ah(e),a=i[1],o=i[2],s=i[3],c=i[6],l=i[7],u=i[11],d=i[12],f=i[13],p=i[14],m=i[16],h=i[17],g=i[20],_=u(e,t);if(xh(_)){if(a.has(t)&&o.get(t)!==_.n)return _;let n=!1;for(let[t,r]of _.d)if(p(e,t).n!==r){n=!0;break}if(!n)return _}_.d.clear();let v=!0;function y(){a.has(t)&&(h(e,t),f(e),d(e))}function b(n){var r;if(n===t){let t=u(e,n);if(!xh(t))if(yh(n))g(e,n,n.init);else throw Error(`no atom init`);return Sh(t)}let i=p(e,n);try{return Sh(i)}finally{_.d.set(n,i.n),wh(_.v)&&Dh(t,_.v,i),a.has(t)&&((r=a.get(n))==null||r.t.add(t)),v||y()}}let x,S,C={get signal(){return x||=new AbortController,x.signal},get setSelf(){return!S&&bh(t)&&(S=(...n)=>{if(!v)try{return m(e,t,...n)}finally{f(e),d(e)}}),S}},w=_.n;try{let r=l(e,t,b,C);return g(e,t,r),Eh(r)&&(Th(r,()=>x?.abort()),r.then(y,y)),(n=c.r)==null||n.call(c,t),_}catch(e){return delete _.v,_.e=e,++_.n,_}finally{v=!1,w!==_.n&&o.get(t)===w&&(o.set(t,_.n),s.add(t),(r=c.c)==null||r.call(c,t))}},Dee=(e,t)=>{let n=Ah(e),r=n[1],i=n[2],a=n[11],o=[t];for(;o.length;){let t=o.pop(),n=a(e,t);for(let s of Oh(t,n,r)){let t=a(e,s);i.set(s,t.n),o.push(s)}}},Oee=(e,t,...n)=>{let r=Ah(e),i=r[3],a=r[6],o=r[8],s=r[11],c=r[12],l=r[13],u=r[14],d=r[15],f=r[16],p=r[17],m=r[20],h=!0,g=t=>Sh(u(e,t)),_=(n,...r)=>{var o;let u=s(e,n);try{if(n===t){if(!yh(n))throw Error(`atom not writable`);let t=u.n,s=r[0];m(e,n,s),p(e,n),t!==u.n&&(i.add(n),d(e,n),(o=a.c)==null||o.call(a,n));return}else return f(e,n,...r)}finally{h||(l(e),c(e))}};try{return o(e,t,g,_,...n)}finally{h=!1}},kee=(e,t)=>{var n;let r=Ah(e),i=r[1],a=r[3],o=r[6],s=r[11],c=r[15],l=r[18],u=r[19],d=s(e,t),f=i.get(t);if(f&&!wh(d.v)){for(let[r,i]of d.d)if(!f.d.has(r)){let u=s(e,r);l(e,r).t.add(t),f.d.add(r),i!==u.n&&(a.add(r),c(e,r),(n=o.c)==null||n.call(o,r))}for(let n of f.d)d.d.has(n)||(f.d.delete(n),u(e,n)?.t.delete(t))}},Aee=(e,t)=>{var n;let r=Ah(e),i=r[1],a=r[4],o=r[6],s=r[10],c=r[11],l=r[12],u=r[13],d=r[14],f=r[16],p=r[18],m=c(e,t),h=i.get(t);if(!h){d(e,t);for(let n of m.d.keys())p(e,n).t.add(t);h={l:new Set,d:new Set(m.d.keys()),t:new Set},i.set(t,h),bh(t)&&a.add(()=>{let n=!0,r=(...r)=>{try{return f(e,t,...r)}finally{n||(u(e),l(e))}};try{let i=s(e,t,r);i&&(h.u=()=>{n=!0;try{i()}finally{n=!1}})}finally{n=!1}}),(n=o.m)==null||n.call(o,t)}return h},jee=(e,t)=>{var n;let r=Ah(e),i=r[1],a=r[5],o=r[6],s=r[11],c=r[19],l=s(e,t),u=i.get(t);if(!u||u.l.size)return u;let d=!1;for(let e of u.t)if(i.get(e)?.d.has(t)){d=!0;break}if(!d){u.u&&a.add(u.u),u=void 0,i.delete(t);for(let n of l.d.keys())c(e,n)?.t.delete(t);(n=o.u)==null||n.call(o,t);return}return u},Mee=(e,t,n)=>{let r=Ah(e)[11],i=r(e,t),a=`v`in i,o=i.v;if(Eh(n))for(let a of i.d.keys())Dh(t,n,r(e,a));i.v=n,delete i.e,(!a||!Object.is(o,i.v))&&(++i.n,Eh(o)&&vee(o))},Nee=(e,t)=>{let n=Ah(e)[14];return Sh(n(e,t))},Pee=(e,t,...n)=>{let r=Ah(e),i=r[12],a=r[13],o=r[16];try{return o(e,t,...n)}finally{a(e),i(e)}},Fee=(e,t,n)=>{let r=Ah(e),i=r[12],a=r[18],o=r[19],s=a(e,t).l;return s.add(n),i(e),()=>{s.delete(n),o(e,t),i(e)}},kh=new WeakMap,Ah=e=>kh.get(e);function Iee(...e){let t={get(e){let n=Ah(t)[21];return n(t,e)},set(e,...n){let r=Ah(t)[22];return r(t,e,...n)},sub(e,n){let r=Ah(t)[23];return r(t,e,n)}},n=[new WeakMap,new WeakMap,new WeakMap,new Set,new Set,new Set,{},yee,bee,xee,See,Cee,wee,Tee,Eee,Dee,Oee,kee,Aee,jee,Mee,Nee,Pee,Fee,void 0].map((t,n)=>e[n]||t);return kh.set(t,Object.freeze(n)),t}var Lee=0;function jh(e,t){let n=`atom${++Lee}`,r={toString(){return n}};return typeof e==`function`?r.read=e:(r.init=e,r.read=Ree,r.write=zee),t&&(r.write=t),r}function Ree(e){return e(this)}function zee(e,t,n){return t(this,typeof n==`function`?n(e(this)):n)}var Mh;function Bee(){return Mh?Mh():Iee()}var Nh;function Vee(){return Nh||=Bee(),Nh}var Hee=(0,m.createContext)(void 0);function Ph(e){let t=(0,m.useContext)(Hee);return e?.store||t||Vee()}var Fh=e=>typeof e?.then==`function`,Ih=e=>{e.status||(e.status=`pending`,e.then(t=>{e.status=`fulfilled`,e.value=t},t=>{e.status=`rejected`,e.reason=t}))},Uee=m.use||(e=>{if(e.status===`pending`)throw e;if(e.status===`fulfilled`)return e.value;throw e.status===`rejected`?e.reason:(Ih(e),e)}),Lh=new WeakMap,Rh=(e,t)=>{let n=Lh.get(e);return n||(n=new Promise((r,i)=>{let a=e,o=e=>t=>{a===e&&r(t)},s=e=>t=>{a===e&&i(t)},c=()=>{try{let e=t();Fh(e)?(Lh.set(e,n),a=e,e.then(o(e),s(e)),Th(e,c)):r(e)}catch(e){i(e)}};e.then(o(e),s(e)),Th(e,c)}),Lh.set(e,n)),n};function zh(e,t){let{delay:n,unstable_promiseStatus:r=!m.use}=t||{},i=Ph(t),[[a,o,s],c]=(0,m.useReducer)(t=>{let n=i.get(e);return Object.is(t[0],n)&&t[1]===i&&t[2]===e?t:[n,i,e]},void 0,()=>[i.get(e),i,e]),l=a;if((o!==i||s!==e)&&(c(),l=i.get(e)),(0,m.useEffect)(()=>{let t=i.sub(e,()=>{if(r)try{let t=i.get(e);Fh(t)&&Ih(Rh(t,()=>i.get(e)))}catch{}if(typeof n==`number`){setTimeout(c,n);return}c()});return c(),t},[i,e,n,r]),(0,m.useDebugValue)(l),Fh(l)){let t=Rh(l,()=>i.get(e));return r&&Ih(t),Uee(t)}return l}function Bh(e,t){let n=Ph(t);return(0,m.useCallback)((...t)=>n.set(e,...t),[n,e])}function Wee(e,t){return[zh(e,t),Bh(e,t)]}var Gee=jh({open:!1,reactNode:null});function Kee({className:e}){let[t,n]=Wee(Gee),{open:r,reactNode:i,title:a,description:o,className:s,onControlledOpen:c,onControlledClose:l}=t,u=()=>{l&&l(),n({open:!1,reactNode:null})};return(0,m.useEffect)(()=>{r&&c&&c()},[r]),(0,z.jsx)(td,{open:r,onOpenChange:e=>{e||u()},children:(0,z.jsxs)(id,{className:et(`max-w-4xl`,s,e),children:[(0,z.jsxs)(ad,{children:[(0,z.jsx)(sd,{className:a?void 0:`sr-only`,children:a||`Modal`}),(0,z.jsx)(cd,{className:o?void 0:`sr-only`,children:o||`Modal content`})]}),i]})})}var Vh=`rovingFocusGroup.onEntryFocus`,qee={bubbles:!1,cancelable:!0},Hh=`RovingFocusGroup`,[Uh,Wh,Gh]=gt(Hh),[Kh,qh]=it(Hh,[Gh]),[Jh,Jee]=Kh(Hh),Yh=m.forwardRef((e,t)=>(0,z.jsx)(Uh.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,z.jsx)(Uh.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,z.jsx)(Xh,{...e,ref:t})})}));Yh.displayName=Hh;var Xh=m.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:a,currentTabStopId:o,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:c,onEntryFocus:l,preventScrollOnEntryFocus:u=!1,...d}=e,f=m.useRef(null),p=ct(t,f),h=Lt(a),[g,_]=bt({prop:o,defaultProp:s??null,onChange:c,caller:Hh}),[v,y]=m.useState(!1),b=en(l),x=Wh(n),S=m.useRef(!1),[C,w]=m.useState(0);return m.useEffect(()=>{let e=f.current;if(e)return e.addEventListener(Vh,b),()=>e.removeEventListener(Vh,b)},[b]),(0,z.jsx)(Jh,{scope:n,orientation:r,dir:h,loop:i,currentTabStopId:g,onItemFocus:m.useCallback(e=>_(e),[_]),onItemShiftTab:m.useCallback(()=>y(!0),[]),onFocusableItemAdd:m.useCallback(()=>w(e=>e+1),[]),onFocusableItemRemove:m.useCallback(()=>w(e=>e-1),[]),children:(0,z.jsx)(Et.div,{tabIndex:v||C===0?-1:0,"data-orientation":r,...d,ref:p,style:{outline:`none`,...e.style},onMouseDown:_t(e.onMouseDown,()=>{S.current=!0}),onFocus:_t(e.onFocus,e=>{let t=!S.current;if(e.target===e.currentTarget&&t&&!v){let t=new CustomEvent(Vh,qee);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=x().filter(e=>e.focusable);$h([e.find(e=>e.active),e.find(e=>e.id===g),...e].filter(Boolean).map(e=>e.ref.current),u)}}S.current=!1}),onBlur:_t(e.onBlur,()=>y(!1))})})}),Zh=`RovingFocusGroupItem`,Qh=m.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:a,children:o,...s}=e,c=Ft(),l=a||c,u=Jee(Zh,n),d=u.currentTabStopId===l,f=Wh(n),{onFocusableItemAdd:p,onFocusableItemRemove:h,currentTabStopId:g}=u;return m.useEffect(()=>{if(r)return p(),()=>h()},[r,p,h]),(0,z.jsx)(Uh.ItemSlot,{scope:n,id:l,focusable:r,active:i,children:(0,z.jsx)(Et.span,{tabIndex:d?0:-1,"data-orientation":u.orientation,...s,ref:t,onMouseDown:_t(e.onMouseDown,e=>{r?u.onItemFocus(l):e.preventDefault()}),onFocus:_t(e.onFocus,()=>u.onItemFocus(l)),onKeyDown:_t(e.onKeyDown,e=>{if(e.key===`Tab`&&e.shiftKey){u.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=Zee(e,u.orientation,u.dir);if(t!==void 0){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let n=f().filter(e=>e.focusable).map(e=>e.ref.current);if(t===`last`)n.reverse();else if(t===`prev`||t===`next`){t===`prev`&&n.reverse();let r=n.indexOf(e.currentTarget);n=u.loop?eg(n,r+1):n.slice(r+1)}setTimeout(()=>$h(n))}}),children:typeof o==`function`?o({isCurrentTabStop:d,hasTabStop:g!=null}):o})})});Qh.displayName=Zh;var Yee={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function Xee(e,t){return t===`rtl`?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}function Zee(e,t,n){let r=Xee(e.key,n);if(!(t===`vertical`&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===`horizontal`&&[`ArrowUp`,`ArrowDown`].includes(r)))return Yee[r]}function $h(e,t=!1){let n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function eg(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var tg=Yh,ng=Qh,rg=m.forwardRef(({className:e,type:t,onValueChange:n,onChange:r,clearable:i=!1,...a},o)=>{let s=m.useRef(null),c=m.useCallback(e=>{s.current=e,typeof o==`function`?o(e):o&&(o.current=e)},[o]),l=a.value!==void 0,[u,d]=m.useState(()=>String(a.defaultValue??``).length>0),f=l?String(a.value??``).length>0:u,p=e=>{l||d(e.target.value.length>0),n?.(e.target.value),r?.(e)},h=()=>{let e=s.current;e&&((Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,`value`)?.set)?.call(e,``),e.dispatchEvent(new Event(`input`,{bubbles:!0})),e.focus()),l||d(!1)},g=i&&f&&!a.disabled&&!a.readOnly,_=(0,z.jsx)(`input`,{type:t,"data-slot":`input`,className:et(`file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex h-9 w-full min-w-0 rounded-md border px-3 py-1 text-base bg-input-background transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm`,`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`,i&&`pr-8`,e),ref:c,...a,onChange:p});return i?(0,z.jsxs)(`div`,{className:`relative w-full`,children:[_,g&&(0,z.jsx)(`button`,{type:`button`,tabIndex:-1,"aria-label":`Clear`,onMouseDown:e=>e.preventDefault(),onClick:h,className:`absolute right-2 top-1/2 -translate-y-1/2 flex items-center justify-center text-muted-foreground opacity-60 hover:opacity-100 transition-opacity cursor-pointer`,children:(0,z.jsx)(ed,{className:`h-4 w-4`})})]}):_});rg.displayName=`Input`;var ig=e=>(0,z.jsx)(`svg`,{viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`,...e,children:(0,z.jsxs)(`g`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,children:[(0,z.jsx)(`path`,{d:`M8 2v4m8-4v4`}),(0,z.jsx)(`rect`,{width:18,height:18,x:3,y:4,rx:2}),(0,z.jsx)(`path`,{d:`M3 10h18`})]})});function ag({value:e,onValueChange:t,placeholder:n,disabled:r=!1,className:i}){let{SD:a}=$u(),o=n??a(`rc.datePicker.pickDate`);return(0,z.jsxs)(hh,{children:[(0,z.jsx)(gh,{asChild:!0,children:(0,z.jsxs)(B,{variant:`outline`,disabled:r,"data-empty":!e,className:et(`w-full justify-start text-left font-normal`,`data-[empty=true]:text-muted-foreground`,i),children:[(0,z.jsx)(ig,{}),e?ho(e,`PPP`):(0,z.jsx)(`span`,{children:o})]})}),(0,z.jsx)(_h,{className:`w-auto p-0`,align:`start`,children:(0,z.jsx)(Pc,{mode:`single`,selected:e,onSelect:e=>{t?.(e)},initialFocus:!0})})]})}var og=e=>(0,z.jsx)(`svg`,{viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`,...e,children:(0,z.jsx)(`path`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M21 12a9 9 0 1 1-6.219-8.56`})}),sg=`Separator`,cg=`horizontal`,lg=[`horizontal`,`vertical`],ug=m.forwardRef((e,t)=>{let{decorative:n,orientation:r=cg,...i}=e,a=dg(r)?r:cg,o=n?{role:`none`}:{"aria-orientation":a===`vertical`?a:void 0,role:`separator`};return(0,z.jsx)(Hi.div,{"data-orientation":a,...o,...i,ref:t})});ug.displayName=sg;function dg(e){return lg.includes(e)}var fg=ug,pg=m.forwardRef(({className:e,orientation:t=`horizontal`,decorative:n=!0,...r},i)=>(0,z.jsx)(fg,{ref:i,decorative:n,orientation:t,className:et(`shrink-0 bg-border`,t===`horizontal`?`h-px w-full`:`h-full w-px`,e),...r}));pg.displayName=fg.displayName;function Qee(e){return typeof e==`object`&&!!e&&`value`in e}function $ee(e,t){let n=e.multiple===!0,r=e.async===!0,i=(0,m.useRef)(null);(0,m.useImperativeHandle)(t,()=>i.current);let[a,o]=(0,m.useState)(!1),[s,c]=(0,m.useState)(``),[l,u]=(0,m.useState)(new Map),d=r&&`onOpenChange`in e?e.onOpenChange:void 0,f=(0,m.useRef)(a);(0,m.useEffect)(()=>{f.current!==a&&(d&&d(a),f.current=a)},[a,d]);let p=(0,m.useCallback)(t=>t==null?``:e.valueKey?e.valueKey(t):String(t),[e.valueKey]),h=(0,m.useMemo)(()=>e.items.map(e=>Qee(e)?e:{value:e}),[e.items]),g=(0,m.useMemo)(()=>{let e=new Map;for(let t of h)e.set(p(t.value),t.value);return e},[h,p]),_=(0,m.useCallback)(t=>{if(e.renderItem)return e.renderItem(t);let n=h.find(e=>e.value===t);if(n?.label!==void 0)return n.label;if(r){let e=l.get(p(t));if(e?.label!==void 0)return e.label}return String(t)},[e.renderItem,h,r,l,p]);(0,m.useEffect)(()=>{if(!r)return;let t=n?e.value:[e.value].filter(Boolean),i=new Map;for(let e of t){let t=p(e),n=h.find(t=>t.value===e);n&&i.set(t,n)}u(i)},[r,n,e,h,p]);let v=(0,m.useCallback)(e=>{c(e)},[]),y=r&&`onSearch`in e?e.onSearch:void 0,b=r&&`searchDebounce`in e&&e.searchDebounce!==void 0?e.searchDebounce:300;(0,m.useEffect)(()=>{if(!y)return;let e=setTimeout(()=>{y(s)},s===``?0:b);return()=>clearTimeout(e)},[s,y,b]);let x=(0,m.useMemo)(()=>{if(r){let e=new Map;for(let[t,n]of l)e.set(t,n);for(let t of h)e.set(p(t.value),t);return Array.from(e.values())}else return s?h.filter(e=>{let t=_(e.value);return String(t).toLowerCase().includes(s.toLowerCase())}):h},[r,h,l,s,p,_]);return(0,m.useEffect)(()=>{a||c(``)},[a]),{isMultiple:n,isAsync:r,selectRef:i,isPopoverOpen:a,setIsPopoverOpen:o,searchValue:s,handleSearchChange:v,filteredOptions:x,normalizedItems:h,getKeyForValue:p,valueByKey:g,getItemLabel:_}}function ete(e,t){if(!t||typeof e!=`string`)return e;let n=e.toLowerCase(),r=t.toLowerCase(),i=n.indexOf(r);if(i===-1)return e;let a=e.slice(0,i),o=e.slice(i,i+t.length),s=e.slice(i+t.length);return(0,z.jsxs)(z.Fragment,{children:[a,(0,z.jsx)(`strong`,{className:`font-bold`,children:o}),s]})}function tte({props:e,isMultiple:t,isAsync:n,isPopoverOpen:r,setIsPopoverOpen:i,searchValue:a,handleSearchChange:o,filteredOptions:s,getKeyForValue:c,getItemLabel:l}){let{SD:u}=$u(),[d,f]=(0,m.useState)(null),p=(0,m.useCallback)(e=>{f(e)},[]),[h,g]=(0,m.useState)(null),_=(0,m.useCallback)(e=>{g(e)},[]),v=n&&`onLoadMore`in e?e.onLoadMore:void 0,y=n&&`hasMore`in e?e.hasMore??!1:!1,b=n&&`isLoadingMore`in e?e.isLoadingMore??!1:!1,x=n&&v!==void 0;(0,m.useEffect)(()=>{if(!v||!y||b||!h||!d)return;let e=new IntersectionObserver(e=>{for(let t of e)t.isIntersecting&&v()},{root:d,threshold:0});return e.observe(h),()=>e.disconnect()},[h,d,v,y,b]);let S=e.searchable??n,C=(0,m.useCallback)(e=>{let t=d;if(!t)return;let n=t.scrollTop<t.scrollHeight-t.clientHeight,r=t.scrollTop>0;(e.deltaY>0&&n||e.deltaY<0&&r)&&e.stopPropagation()},[d]),w=(0,m.useCallback)(n=>{if(!e.disabled)if(t){let t=e.value,r=t.includes(n)?t.filter(e=>e!==n):[...t,n];e.onValueChange(r)}else e.onValueChange?.(n),i(!1)},[t,e,i]),T=(0,m.useCallback)(()=>{if(!t||e.disabled)return;let n=s.filter(e=>!e.disabled);if(e.value.length===n.length)e.onValueChange([]);else{let t=n.map(e=>e.value);e.onValueChange(t)}},[t,e,s]),E=(0,m.useCallback)(()=>{e.disabled||(t?e.onValueChange([]):e.onValueChange?.(void 0))},[t,e]),D=(0,m.useCallback)(n=>t?e.value.includes(n):e.value===n,[t,e]),O=n&&`loading`in e?e.loading:!1,k=n&&`error`in e?e.error:void 0,A=t?e.value.length>0:e.value!==void 0&&e.value!==null&&e.value!==``;return(0,z.jsxs)(hh,{open:r,onOpenChange:i,children:[(0,z.jsx)(gh,{asChild:!0,children:(0,z.jsx)(B,{variant:`outline`,role:`combobox`,"aria-expanded":r,disabled:e.disabled||O,className:et(`flex p-1 rounded-md border border-input min-h-10 h-auto items-center justify-between bg-white hover:bg-white hover:text-inherit [&_svg]:pointer-events-auto w-full`,e.className),children:t&&A?(0,z.jsxs)(`div`,{className:`flex justify-between items-center w-full`,children:[(0,z.jsx)(`div`,{className:`flex items-center gap-1 flex-wrap`,children:(()=>{if(!t)return null;let n=e.value;return(0,z.jsx)(z.Fragment,{children:n.map(e=>{let t=c(e);return(0,z.jsxs)(Ki,{variant:`outline`,className:`m-1 transition-all duration-300 ease-in-out`,children:[l(e),(0,z.jsx)(vh,{className:`ml-2 h-3 w-3 cursor-pointer !pointer-events-auto`,onPointerDownCapture:e=>{e.stopPropagation()},onMouseDownCapture:e=>{e.stopPropagation()},onClick:t=>{t.stopPropagation(),w(e)}})]},t)})})})()}),(0,z.jsxs)(`div`,{className:`flex items-center justify-between`,children:[e.clearable&&(0,z.jsx)(`div`,{role:`button`,tabIndex:0,onPointerDownCapture:e=>{e.stopPropagation()},onMouseDownCapture:e=>{e.stopPropagation()},onClick:e=>{e.stopPropagation(),E()},className:`flex items-center justify-center h-4 w-4 mx-2 cursor-pointer text-muted-foreground hover:text-foreground`,children:(0,z.jsx)(ed,{className:`h-4 w-4`})}),(0,z.jsx)(pg,{orientation:`vertical`,className:`flex min-h-6 h-full`}),(0,z.jsx)(nt,{className:`h-4 mx-2 cursor-pointer text-muted-foreground`})]})]}):!t&&A?(0,z.jsxs)(`div`,{className:`flex justify-between items-center w-full px-2 py-1`,children:[(()=>{let t=e.value;return t==null?null:(0,z.jsx)(`span`,{className:`flex-1 truncate text-left text-sm`,children:l(t)})})(),(0,z.jsxs)(`div`,{className:`flex items-center gap-1 shrink-0`,children:[e.clearable&&A&&(0,z.jsx)(vh,{className:`h-4 w-4 cursor-pointer opacity-50 hover:opacity-100 transition-opacity`,onPointerDownCapture:E,onMouseDownCapture:E}),(0,z.jsx)(nt,{className:`h-4 w-4 opacity-50`})]})]}):(0,z.jsxs)(`div`,{className:`flex items-center justify-between w-full px-2 py-1`,children:[(0,z.jsx)(`span`,{className:`text-sm text-muted-foreground flex-1 truncate text-left`,children:e.placeholder}),(0,z.jsx)(nt,{className:`h-4 cursor-pointer text-muted-foreground`})]})})}),(0,z.jsx)(_h,{className:`min-w-40 p-0`,align:`start`,style:{width:`var(--radix-popover-trigger-width)`},children:(0,z.jsxs)(of,{shouldFilter:!1,children:[S&&(0,z.jsx)(cf,{placeholder:u(`common.searchPlaceholder`),value:a,onValueChange:o}),(0,z.jsx)(lf,{ref:p,onWheel:C,children:O?(0,z.jsx)(uf,{children:(0,z.jsx)(`div`,{className:`flex items-center justify-center`,children:(0,z.jsx)(og,{className:`h-4 w-4 animate-spin mr-2`})})}):k?(0,z.jsxs)(uf,{children:[`Error: `,k.message]}):s.length===0?(0,z.jsx)(uf,{children:u(`rc.multiSelect.noResults`)}):(0,z.jsxs)(z.Fragment,{children:[t&&!(`hideSelectAll`in e&&e.hideSelectAll)&&(0,z.jsx)(df,{children:(0,z.jsxs)(pf,{onSelect:T,className:`cursor-pointer`,children:[(0,z.jsx)(`div`,{className:et(`mr-2 flex h-4 w-4 items-center justify-center rounded-sm border border-primary`,e.value.length===s.filter(e=>!e.disabled).length?`bg-primary text-primary-foreground`:`opacity-50 [&_svg]:invisible`),children:(0,z.jsx)(Fc,{className:`h-4 w-4`})}),(0,z.jsxs)(`span`,{children:[`(`,u(`rc.multiSelect.selectAll`),`)`]})]})}),(0,z.jsx)(df,{children:s.map(e=>{let n=c(e.value),r=D(e.value);return(0,z.jsxs)(pf,{onSelect:()=>w(e.value),disabled:e.disabled,className:et(`cursor-pointer`,e.disabled&&`opacity-50 cursor-not-allowed`),children:[t&&(0,z.jsx)(`div`,{className:et(`mr-2 flex h-4 w-4 items-center justify-center rounded-sm border border-primary`,r?`bg-primary text-primary-foreground`:`opacity-50 [&_svg]:invisible`),children:(0,z.jsx)(Fc,{className:`h-4 w-4`})}),!t&&(0,z.jsx)(Fc,{className:et(`mr-2 h-4 w-4`,r?`opacity-100`:`opacity-0`)}),(0,z.jsx)(`span`,{children:ete(l(e.value),a)})]},n)})}),x&&(0,z.jsx)(`div`,{ref:_,className:`flex items-center justify-center py-2 text-xs text-muted-foreground`,children:b?(0,z.jsx)(og,{className:`h-3 w-3 animate-spin`}):null})]})})]})})]})}var mg=m.forwardRef(function(e,t){let n=$ee(e,t);return(0,z.jsx)(tte,{props:e,isMultiple:n.isMultiple,isAsync:n.isAsync,isPopoverOpen:n.isPopoverOpen,setIsPopoverOpen:n.setIsPopoverOpen,searchValue:n.searchValue,handleSearchChange:n.handleSearchChange,filteredOptions:n.filteredOptions,getKeyForValue:n.getKeyForValue,getItemLabel:n.getItemLabel})}),hg=Object.freeze({position:`absolute`,border:0,width:1,height:1,padding:0,margin:-1,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,wordWrap:`normal`}),gg=`VisuallyHidden`,_g=m.forwardRef((e,t)=>(0,z.jsx)(Et.span,{...e,ref:t,style:{...hg,...e.style}}));_g.displayName=gg;var vg=_g;function yg({enum:e,labels:t,value:n,onValueChange:r,placeholder:i,textPrefix:a=``,clearable:o=!1,disabled:s=!1,className:c,multiple:l=!1}){let u=m.useMemo(()=>e.options.filter(e=>e!==``),[e]),d=m.useMemo(()=>u.map(e=>({value:e,label:a+t[e]})),[u,t,a]);return l?(0,z.jsx)(mg,{items:d,value:n??[],onValueChange:e=>{r?.(e)},placeholder:i,clearable:o,disabled:s,className:c,multiple:!0,async:!1}):(0,z.jsx)(mg,{items:d,value:n??``,onValueChange:e=>{r?.(e)},placeholder:i,clearable:o,disabled:s,className:c,multiple:!1,async:!1})}var bg=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},xg={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},Sg=new class{#e=xg;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function nte(e){setTimeout(e,0)}var Cg=typeof window>`u`||`Deno`in globalThis;function wg(){}function rte(e,t){return typeof e==`function`?e(t):e}function Tg(e){return typeof e==`number`&&e>=0&&e!==1/0}function Eg(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Dg(e,t){return typeof e==`function`?e(t):e}function Og(e,t){return typeof e==`function`?e(t):e}function kg(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==jg(o,t.options))return!1}else if(!Ng(t.queryKey,o))return!1}if(n!==`all`){let e=t.isActive();if(n===`active`&&!e||n===`inactive`&&e)return!1}return!(typeof s==`boolean`&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function Ag(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(Mg(t.options.mutationKey)!==Mg(a))return!1}else if(!Ng(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function jg(e,t){return(t?.queryKeyHashFn||Mg)(e)}function Mg(e){return JSON.stringify(e,(e,t)=>Rg(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function Ng(e,t){return e===t?!0:typeof e==typeof t&&e&&t&&typeof e==`object`&&typeof t==`object`?Object.keys(t).every(n=>Ng(e[n],t[n])):!1}var Pg=Object.prototype.hasOwnProperty;function Fg(e,t){if(e===t)return e;let n=Lg(e)&&Lg(t);if(!n&&!(Rg(e)&&Rg(t)))return t;let r=(n?e:Object.keys(e)).length,i=n?t:Object.keys(t),a=i.length,o=n?Array(a):{},s=0;for(let c=0;c<a;c++){let a=n?c:i[c],l=e[a],u=t[a];if(l===u){o[a]=l,(n?c<r:Pg.call(e,a))&&s++;continue}if(l===null||u===null||typeof l!=`object`||typeof u!=`object`){o[a]=u;continue}let d=Fg(l,u);o[a]=d,d===l&&s++}return r===a&&s===r?e:o}function Ig(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function Lg(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Rg(e){if(!zg(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!zg(n)||!n.hasOwnProperty(`isPrototypeOf`)||Object.getPrototypeOf(e)!==Object.prototype)}function zg(e){return Object.prototype.toString.call(e)===`[object Object]`}function Bg(e){return new Promise(t=>{Sg.setTimeout(t,e)})}function Vg(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:Fg(e,t)}function Hg(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function Ug(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var Wg=Symbol();function Gg(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===Wg?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function ite(e,t){return typeof e==`function`?e(...t):!!e}var Kg=new class extends bg{#e;#t;#n;constructor(){super(),this.#n=e=>{if(!Cg&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}};function qg(){let e,t,n=new Promise((n,r)=>{e=n,t=r});n.status=`pending`,n.catch(()=>{});function r(e){Object.assign(n,e),delete n.resolve,delete n.reject}return n.resolve=t=>{r({status:`fulfilled`,value:t}),e(t)},n.reject=e=>{r({status:`rejected`,reason:e}),t(e)},n}var ate=nte;function ote(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=ate,a=r=>{t?e.push(r):i(()=>{n(r)})},o=()=>{let t=e;e=[],t.length&&i(()=>{r(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||o()}return n},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}var Jg=ote(),Yg=new class extends bg{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(!Cg&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener(`online`,t,!1),window.addEventListener(`offline`,n,!1),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};function ste(e){return Math.min(1e3*2**e,3e4)}function Xg(e){return(e??`online`)===`online`?Yg.isOnline():!0}var Zg=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function Qg(e){let t=!1,n=0,r,i=qg(),a=()=>i.status!==`pending`,o=t=>{if(!a()){let n=new Zg(t);f(n),e.onCancel?.(n)}},s=()=>{t=!0},c=()=>{t=!1},l=()=>Kg.isFocused()&&(e.networkMode===`always`||Yg.isOnline())&&e.canRun(),u=()=>Xg(e.networkMode)&&e.canRun(),d=e=>{a()||(r?.(),i.resolve(e))},f=e=>{a()||(r?.(),i.reject(e))},p=()=>new Promise(t=>{r=e=>{(a()||l())&&t(e)},e.onPause?.()}).then(()=>{r=void 0,a()||e.onContinue?.()}),m=()=>{if(a())return;let r,i=n===0?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(d).catch(r=>{if(a())return;let i=e.retry??(Cg?0:3),o=e.retryDelay??ste,s=typeof o==`function`?o(n,r):o,c=i===!0||typeof i==`number`&&n<i||typeof i==`function`&&i(n,r);if(t||!c){f(r);return}n++,e.onFail?.(n,r),Bg(s).then(()=>l()?void 0:p()).then(()=>{t?f(r):m()})})};return{promise:i,status:()=>i.status,cancel:o,continue:()=>(r?.(),i),cancelRetry:s,continueRetry:c,canStart:u,start:()=>(u()?m():p().then(m),i)}}var $g=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Tg(this.gcTime)&&(this.#e=Sg.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Cg?1/0:300*1e3))}clearGcTimeout(){this.#e&&=(Sg.clearTimeout(this.#e),void 0)}},e_=class extends $g{#e;#t;#n;#r;#i;#a;#o;constructor(e){super(),this.#o=!1,this.#a=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#r=e.client,this.#n=this.#r.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#e=r_(this.options),this.state=e.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#i?.promise}setOptions(e){if(this.options={...this.#a,...e},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=r_(this.options);e.data!==void 0&&(this.setState(n_(e.data,e.dataUpdatedAt)),this.#e=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#n.remove(this)}setData(e,t){let n=Vg(this.state.data,e,this.options);return this.#s({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e,t){this.#s({type:`setState`,state:e,setStateOptions:t})}cancel(e){let t=this.#i?.promise;return this.#i?.cancel(e),t?t.then(wg).catch(wg):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#e)}isActive(){return this.observers.some(e=>Og(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Wg||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>Dg(e.options.staleTime,this)===`static`):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e===`static`?!1:this.state.isInvalidated?!0:!Eg(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#i?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#i?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#i&&(this.#o?this.#i.cancel({revert:!0}):this.#i.cancelRetry()),this.scheduleGc()),this.#n.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#s({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#i?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#i)return this.#i.continueRetry(),this.#i.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,r=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#o=!0,n.signal)})},i=()=>{let e=Gg(this.options,t),n=(()=>{let e={client:this.#r,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#o=!1,this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#r,state:this.state,fetchFn:i};return r(e),e})();this.options.behavior?.onFetch(a,this),this.#t=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#s({type:`fetch`,meta:a.fetchOptions?.meta}),this.#i=Qg({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof Zg&&e.revert&&this.setState({...this.#t,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#s({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#s({type:`pause`})},onContinue:()=>{this.#s({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{let e=await this.#i.start();if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#n.config.onSuccess?.(e,this),this.#n.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof Zg){if(e.silent)return this.#i.promise;if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#s({type:`error`,error:e}),this.#n.config.onError?.(e,this),this.#n.config.onSettled?.(this.state.data,e,this),e}finally{this.scheduleGc()}}#s(e){let t=t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:return{...t,...t_(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...n_(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#t=e.manual?n:void 0,n;case`error`:let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:`idle`,status:`error`};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}};this.state=t(this.state),Jg.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#n.notify({query:this,type:`updated`,action:e})})}};function t_(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Xg(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function n_(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function r_(e){let t=typeof e.initialData==`function`?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt==`function`?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?`success`:`pending`,fetchStatus:`idle`}}var i_=class extends bg{constructor(e,t){super(),this.options=t,this.#e=e,this.#s=null,this.#o=qg(),this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p;#m=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),o_(this.#t,this.options)?this.#h():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return s_(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return s_(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(e){let t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!=`boolean`&&typeof this.options.enabled!=`function`&&typeof Og(this.options.enabled,this.#t)!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#S(),this.#t.setOptions(this.options),t._defaulted&&!Ig(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&c_(this.#t,n,this.options,t)&&this.#h(),this.updateResult(),r&&(this.#t!==n||Og(this.options.enabled,this.#t)!==Og(t.enabled,this.#t)||Dg(this.options.staleTime,this.#t)!==Dg(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||Og(this.options.enabled,this.#t)!==Og(t.enabled,this.#t)||i!==this.#p)&&this.#v(i)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return u_(this,n)&&(this.#r=n,this.#a=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),n===`promise`&&(this.trackProp(`data`),!this.options.experimental_prefetchInRender&&this.#o.status===`pending`&&this.#o.reject(Error(`experimental_prefetchInRender feature flag is not enabled`))),Reflect.get(e,n))})}trackProp(e){this.#m.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#h({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#h(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(wg)),t}#g(){this.#b();let e=Dg(this.options.staleTime,this.#t);if(Cg||this.#r.isStale||!Tg(e))return;let t=Eg(this.#r.dataUpdatedAt,e)+1;this.#d=Sg.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return(typeof this.options.refetchInterval==`function`?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(e){this.#x(),this.#p=e,!(Cg||Og(this.options.enabled,this.#t)===!1||!Tg(this.#p)||this.#p===0)&&(this.#f=Sg.setInterval(()=>{(this.options.refetchIntervalInBackground||Kg.isFocused())&&this.#h()},this.#p))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#d&&=(Sg.clearTimeout(this.#d),void 0)}#x(){this.#f&&=(Sg.clearInterval(this.#f),void 0)}createResult(e,t){let n=this.#t,r=this.options,i=this.#r,a=this.#i,o=this.#a,s=e===n?this.#n:e.state,{state:c}=e,l={...c},u=!1,d;if(t._optimisticResults){let i=this.hasListeners(),a=!i&&o_(e,t),o=i&&c_(e,n,t,r);(a||o)&&(l={...l,...t_(c.data,e.options)}),t._optimisticResults===`isRestoring`&&(l.fetchStatus=`idle`)}let{error:f,errorUpdatedAt:p,status:m}=l;d=l.data;let h=!1;if(t.placeholderData!==void 0&&d===void 0&&m===`pending`){let e;i?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(e=i.data,h=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#u?.state.data,this.#u):t.placeholderData,e!==void 0&&(m=`success`,d=Vg(i?.data,e,t),u=!0)}if(t.select&&d!==void 0&&!h)if(i&&d===a?.data&&t.select===this.#c)d=this.#l;else try{this.#c=t.select,d=t.select(d),d=Vg(i?.data,d,t),this.#l=d,this.#s=null}catch(e){this.#s=e}this.#s&&(f=this.#s,d=this.#l,p=Date.now(),m=`error`);let g=l.fetchStatus===`fetching`,_=m===`pending`,v=m===`error`,y=_&&g,b=d!==void 0,x={status:m,fetchStatus:l.fetchStatus,isPending:_,isSuccess:m===`success`,isError:v,isInitialLoading:y,isLoading:y,data:d,dataUpdatedAt:l.dataUpdatedAt,error:f,errorUpdatedAt:p,failureCount:l.fetchFailureCount,failureReason:l.fetchFailureReason,errorUpdateCount:l.errorUpdateCount,isFetched:l.dataUpdateCount>0||l.errorUpdateCount>0,isFetchedAfterMount:l.dataUpdateCount>s.dataUpdateCount||l.errorUpdateCount>s.errorUpdateCount,isFetching:g,isRefetching:g&&!_,isLoadingError:v&&!b,isPaused:l.fetchStatus===`paused`,isPlaceholderData:u,isRefetchError:v&&b,isStale:l_(e,t),refetch:this.refetch,promise:this.#o,isEnabled:Og(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){let t=e=>{x.status===`error`?e.reject(x.error):x.data!==void 0&&e.resolve(x.data)},r=()=>{t(this.#o=x.promise=qg())},i=this.#o;switch(i.status){case`pending`:e.queryHash===n.queryHash&&t(i);break;case`fulfilled`:(x.status===`error`||x.data!==i.value)&&r();break;case`rejected`:(x.status!==`error`||x.error!==i.reason)&&r();break}}return x}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#u=this.#t),!Ig(t,e)&&(this.#r=t,this.#C({listeners:(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#m.size)return!0;let r=new Set(n??this.#m);return this.options.throwOnError&&r.add(`error`),Object.keys(this.#r).some(t=>{let n=t;return this.#r[n]!==e[n]&&r.has(n)})})()}))}#S(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;let t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}#C(e){Jg.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}};function a_(e,t){return Og(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status===`error`&&t.retryOnMount===!1)}function o_(e,t){return a_(e,t)||e.state.data!==void 0&&s_(e,t,t.refetchOnMount)}function s_(e,t,n){if(Og(t.enabled,e)!==!1&&Dg(t.staleTime,e)!==`static`){let r=typeof n==`function`?n(e):n;return r===`always`||r!==!1&&l_(e,t)}return!1}function c_(e,t,n,r){return(e!==t||Og(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&l_(e,n)}function l_(e,t){return Og(t.enabled,e)!==!1&&e.isStaleByTime(Dg(t.staleTime,e))}function u_(e,t){return!Ig(e.getCurrentResult(),t)}function d_(e){return{onFetch:(t,n)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,l=async()=>{let n=!1,l=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(t.signal.aborted?n=!0:t.signal.addEventListener(`abort`,()=>{n=!0}),t.signal)})},u=Gg(t.options,t.fetchOptions),d=async(e,r,i)=>{if(n)return Promise.reject();if(r==null&&e.pages.length)return Promise.resolve(e);let a=await u((()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return l(e),e})()),{maxPages:o}=t.options,s=i?Ug:Hg;return{pages:s(e.pages,a,o),pageParams:s(e.pageParams,r,o)}};if(i&&a.length){let e=i===`backward`,t=e?p_:f_,n={pages:a,pageParams:o};s=await d(n,t(r,n),e)}else{let t=e??a.length;do{let e=c===0?o[0]??r.initialPageParam:f_(r,s);if(c>0&&e==null)break;s=await d(s,e),c++}while(c<t)}return s};t.options.persister?t.fetchFn=()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=l}}}function f_(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function p_(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var m_=class extends $g{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||h_(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??this.execute(this.state.variables)}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#r=Qg({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});let r=this.state.status===`pending`,i=!this.#r.canStart();try{if(r)t();else{this.#i({type:`pending`,variables:e,isPaused:i}),await this.#n.config.onMutate?.(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:i})}let a=await this.#r.start();return await this.#n.config.onSuccess?.(a,e,this.state.context,this,n),await this.options.onSuccess?.(a,e,this.state.context,n),await this.#n.config.onSettled?.(a,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(a,null,e,this.state.context,n),this.#i({type:`success`,data:a}),a}catch(t){try{throw await this.#n.config.onError?.(t,e,this.state.context,this,n),await this.options.onError?.(t,e,this.state.context,n),await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(void 0,t,e,this.state.context,n),t}finally{this.#i({type:`error`,error:t})}}finally{this.#n.runNext(this)}}#i(e){let t=t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:`pending`,variables:e.variables,submittedAt:Date.now()};case`success`:return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}};this.state=t(this.state),Jg.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function h_(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var g_=class extends bg{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,t,n){let r=new m_({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);let t=__(e);if(typeof t==`string`){let n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:`added`,mutation:e})}remove(e){if(this.#e.delete(e)){let t=__(e);if(typeof t==`string`){let n=this.#t.get(t);if(n)if(n.length>1){let t=n.indexOf(e);t!==-1&&n.splice(t,1)}else n[0]===e&&this.#t.delete(t)}}this.notify({type:`removed`,mutation:e})}canRun(e){let t=__(e);if(typeof t==`string`){let n=this.#t.get(t)?.find(e=>e.state.status===`pending`);return!n||n===e}else return!0}runNext(e){let t=__(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){Jg.batch(()=>{this.#e.forEach(e=>{this.notify({type:`removed`,mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>Ag(t,e))}findAll(e={}){return this.getAll().filter(t=>Ag(e,t))}notify(e){Jg.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return Jg.batch(()=>Promise.all(e.map(e=>e.continue().catch(wg))))}};function __(e){return e.options.scope?.id}var v_=class extends bg{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){let r=t.queryKey,i=t.queryHash??jg(r,t),a=this.get(i);return a||(a=new e_({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:`added`,query:e}))}remove(e){let t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:`removed`,query:e}))}clear(){Jg.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>kg(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>kg(e,t)):t}notify(e){Jg.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){Jg.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Jg.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},y_=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new v_,this.#t=e.mutationCache||new g_,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=Kg.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=Yg.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:`fetching`}).length}isMutating(e){return this.#t.findAll({...e,status:`pending`}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(Dg(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){let r=this.defaultQueryOptions({queryKey:e}),i=this.#e.get(r.queryHash)?.state.data,a=rte(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return Jg.batch(()=>this.#e.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){let t=this.#e;Jg.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return Jg.batch(()=>(n.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,...e},t)))}cancelQueries(e,t={}){let n={revert:!0,...t},r=Jg.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(wg).catch(wg)}invalidateQueries(e,t={}){return Jg.batch(()=>(this.#e.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType===`none`?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??`active`},t)))}refetchQueries(e,t={}){let n={...t,cancelRefetch:t.cancelRefetch??!0},r=Jg.batch(()=>this.#e.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,n);return n.throwOnError||(t=t.catch(wg)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(r).then(wg)}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t);return n.isStaleByTime(Dg(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(wg).catch(wg)}fetchInfiniteQuery(e){return e.behavior=d_(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(wg).catch(wg)}ensureInfiniteQueryData(e){return e.behavior=d_(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Yg.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(Mg(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{Ng(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(Mg(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{Ng(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||=jg(t.queryKey,t),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!==`always`),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode=`offlineFirst`),t.queryFn===Wg&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},b_=m.createContext(void 0),x_=e=>{let t=m.useContext(b_);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},S_=({client:e,children:t})=>(m.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,z.jsx)(b_.Provider,{value:e,children:t})),C_=m.createContext(!1),w_=()=>m.useContext(C_);C_.Provider;function T_(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var E_=m.createContext(T_()),D_=()=>m.useContext(E_),O_=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},k_=e=>{m.useEffect(()=>{e.clearReset()},[e])},A_=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||ite(n,[e.error,r])),j_=e=>{if(e.suspense){let t=1e3,n=e=>e===`static`?e:Math.max(e??t,t),r=e.staleTime;e.staleTime=typeof r==`function`?(...e)=>n(r(...e)):n(r),typeof e.gcTime==`number`&&(e.gcTime=Math.max(e.gcTime,t))}},cte=(e,t)=>e.isLoading&&e.isFetching&&!t,lte=(e,t)=>e?.suspense&&t.isPending,M_=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function ute(e,t,n){let r=w_(),i=D_(),a=x_(n),o=a.defaultQueryOptions(e);a.getDefaultOptions().queries?._experimental_beforeQuery?.(o),o._optimisticResults=r?`isRestoring`:`optimistic`,j_(o),O_(o,i),k_(i);let s=!a.getQueryCache().get(o.queryHash),[c]=m.useState(()=>new t(a,o)),l=c.getOptimisticResult(o),u=!r&&e.subscribed!==!1;if(m.useSyncExternalStore(m.useCallback(e=>{let t=u?c.subscribe(Jg.batchCalls(e)):wg;return c.updateResult(),t},[c,u]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),m.useEffect(()=>{c.setOptions(o)},[o,c]),lte(o,l))throw M_(o,c,i);if(A_({result:l,errorResetBoundary:i,throwOnError:o.throwOnError,query:a.getQueryCache().get(o.queryHash),suspense:o.suspense}))throw l.error;return a.getDefaultOptions().queries?._experimental_afterQuery?.(o,l),o.experimental_prefetchInRender&&!Cg&&cte(l,r)&&(s?M_(o,c,i):a.getQueryCache().get(o.queryHash)?.promise)?.catch(wg).finally(()=>{c.updateResult()}),o.notifyOnChangeProps?l:c.trackResult(l)}function N_(e,t){return ute(e,i_,t)}var[P_,dte]=it(`Tooltip`,[wm]),F_=wm(),I_=`TooltipProvider`,L_=700,R_=`tooltip.open`,[z_,B_]=P_(I_),V_=e=>{let{__scopeTooltip:t,delayDuration:n=L_,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:a}=e,o=m.useRef(!0),s=m.useRef(!1),c=m.useRef(0);return m.useEffect(()=>{let e=c.current;return()=>window.clearTimeout(e)},[]),(0,z.jsx)(z_,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:m.useCallback(()=>{window.clearTimeout(c.current),o.current=!1},[]),onClose:m.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.current=!0,r)},[r]),isPointerInTransitRef:s,onPointerInTransitChange:m.useCallback(e=>{s.current=e},[]),disableHoverableContent:i,children:a})};V_.displayName=I_;var H_=`Tooltip`,[U_,W_]=P_(H_),G_=e=>{let{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:a,disableHoverableContent:o,delayDuration:s}=e,c=B_(H_,e.__scopeTooltip),l=F_(t),[u,d]=m.useState(null),f=Ft(),p=m.useRef(0),h=o??c.disableHoverableContent,g=s??c.delayDuration,_=m.useRef(!1),[v,y]=bt({prop:r,defaultProp:i??!1,onChange:e=>{e?(c.onOpen(),document.dispatchEvent(new CustomEvent(R_))):c.onClose(),a?.(e)},caller:H_}),b=m.useMemo(()=>v?_.current?`delayed-open`:`instant-open`:`closed`,[v]),x=m.useCallback(()=>{window.clearTimeout(p.current),p.current=0,_.current=!1,y(!0)},[y]),S=m.useCallback(()=>{window.clearTimeout(p.current),p.current=0,y(!1)},[y]),C=m.useCallback(()=>{window.clearTimeout(p.current),p.current=window.setTimeout(()=>{_.current=!0,y(!0),p.current=0},g)},[g,y]);return m.useEffect(()=>()=>{p.current&&=(window.clearTimeout(p.current),0)},[]),(0,z.jsx)(Bm,{...l,children:(0,z.jsx)(U_,{scope:t,contentId:f,open:v,stateAttribute:b,trigger:u,onTriggerChange:d,onTriggerEnter:m.useCallback(()=>{c.isOpenDelayedRef.current?C():x()},[c.isOpenDelayedRef,C,x]),onTriggerLeave:m.useCallback(()=>{h?S():(window.clearTimeout(p.current),p.current=0)},[S,h]),onOpen:x,onClose:S,disableHoverableContent:h,children:n})})};G_.displayName=H_;var K_=`TooltipTrigger`,q_=m.forwardRef((e,t)=>{let{__scopeTooltip:n,...r}=e,i=W_(K_,n),a=B_(K_,n),o=F_(n),s=ct(t,m.useRef(null),i.onTriggerChange),c=m.useRef(!1),l=m.useRef(!1),u=m.useCallback(()=>c.current=!1,[]);return m.useEffect(()=>()=>document.removeEventListener(`pointerup`,u),[u]),(0,z.jsx)(Vm,{asChild:!0,...o,children:(0,z.jsx)(Et.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:s,onPointerMove:_t(e.onPointerMove,e=>{e.pointerType!==`touch`&&!l.current&&!a.isPointerInTransitRef.current&&(i.onTriggerEnter(),l.current=!0)}),onPointerLeave:_t(e.onPointerLeave,()=>{i.onTriggerLeave(),l.current=!1}),onPointerDown:_t(e.onPointerDown,()=>{i.open&&i.onClose(),c.current=!0,document.addEventListener(`pointerup`,u,{once:!0})}),onFocus:_t(e.onFocus,()=>{c.current||i.onOpen()}),onBlur:_t(e.onBlur,i.onClose),onClick:_t(e.onClick,i.onClose)})})});q_.displayName=K_;var J_=`TooltipPortal`,[Y_,X_]=P_(J_,{forceMount:void 0}),Z_=e=>{let{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,a=W_(J_,t);return(0,z.jsx)(Y_,{scope:t,forceMount:n,children:(0,z.jsx)(kt,{present:n||a.open,children:(0,z.jsx)(Nn,{asChild:!0,container:i,children:r})})})};Z_.displayName=J_;var Q_=`TooltipContent`,$_=m.forwardRef((e,t)=>{let n=X_(Q_,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i=`top`,...a}=e,o=W_(Q_,e.__scopeTooltip);return(0,z.jsx)(kt,{present:r||o.open,children:o.disableHoverableContent?(0,z.jsx)(iv,{side:i,...a,ref:t}):(0,z.jsx)(ev,{side:i,...a,ref:t})})}),ev=m.forwardRef((e,t)=>{let n=W_(Q_,e.__scopeTooltip),r=B_(Q_,e.__scopeTooltip),i=m.useRef(null),a=ct(t,i),[o,s]=m.useState(null),{trigger:c,onClose:l}=n,u=i.current,{onPointerInTransitChange:d}=r,f=m.useCallback(()=>{s(null),d(!1)},[d]),p=m.useCallback((e,t)=>{let n=e.currentTarget,r={x:e.clientX,y:e.clientY},i=cv(r,sv(r,n.getBoundingClientRect())),a=lv(t.getBoundingClientRect());s(dv([...i,...a])),d(!0)},[d]);return m.useEffect(()=>()=>f(),[f]),m.useEffect(()=>{if(c&&u){let e=e=>p(e,u),t=e=>p(e,c);return c.addEventListener(`pointerleave`,e),u.addEventListener(`pointerleave`,t),()=>{c.removeEventListener(`pointerleave`,e),u.removeEventListener(`pointerleave`,t)}}},[c,u,p,f]),m.useEffect(()=>{if(o){let e=e=>{let t=e.target,n={x:e.clientX,y:e.clientY},r=c?.contains(t)||u?.contains(t),i=!uv(n,o);r?f():i&&(f(),l())};return document.addEventListener(`pointermove`,e),()=>document.removeEventListener(`pointermove`,e)}},[c,u,o,l,f]),(0,z.jsx)(iv,{...e,ref:a})}),[tv,nv]=P_(H_,{isInside:!1}),rv=ft(`TooltipContent`),iv=m.forwardRef((e,t)=>{let{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:a,onPointerDownOutside:o,...s}=e,c=W_(Q_,n),l=F_(n),{onClose:u}=c;return m.useEffect(()=>(document.addEventListener(R_,u),()=>document.removeEventListener(R_,u)),[u]),m.useEffect(()=>{if(c.trigger){let e=e=>{e.target?.contains(c.trigger)&&u()};return window.addEventListener(`scroll`,e,{capture:!0}),()=>window.removeEventListener(`scroll`,e,{capture:!0})}},[c.trigger,u]),(0,z.jsx)(ln,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:e=>e.preventDefault(),onDismiss:u,children:(0,z.jsxs)(Hm,{"data-state":c.stateAttribute,...l,...s,ref:t,style:{...s.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:[(0,z.jsx)(rv,{children:r}),(0,z.jsx)(tv,{scope:n,isInside:!0,children:(0,z.jsx)(vg,{id:c.contentId,role:`tooltip`,children:i||r})})]})})});$_.displayName=Q_;var av=`TooltipArrow`,ov=m.forwardRef((e,t)=>{let{__scopeTooltip:n,...r}=e,i=F_(n);return nv(av,n).isInside?null:(0,z.jsx)(Um,{...i,...r,ref:t})});ov.displayName=av;function sv(e,t){let n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,i,a)){case a:return`left`;case i:return`right`;case n:return`top`;case r:return`bottom`;default:throw Error(`unreachable`)}}function cv(e,t,n=5){let 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 lv(e){let{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}function uv(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}function dv(e){let t=e.slice();return t.sort((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:+(e.y>t.y)),fv(t)}function fv(e){if(e.length<=1)return e.slice();let t=[];for(let n=0;n<e.length;n++){let r=e[n];for(;t.length>=2;){let e=t[t.length-1],n=t[t.length-2];if((e.x-n.x)*(r.y-n.y)>=(e.y-n.y)*(r.x-n.x))t.pop();else break}t.push(r)}t.pop();let n=[];for(let t=e.length-1;t>=0;t--){let r=e[t];for(;n.length>=2;){let e=n[n.length-1],t=n[n.length-2];if((e.x-t.x)*(r.y-t.y)>=(e.y-t.y)*(r.x-t.x))n.pop();else break}n.push(r)}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 pv=V_,mv=G_,hv=q_,gv=$_,_v=pv,vv=mv,yv=hv,bv=m.forwardRef(({className:e,sideOffset:t=4,...n},r)=>(0,z.jsx)(gv,{ref:r,sideOffset:t,className:et(`z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md 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 origin-[--radix-tooltip-content-transform-origin]`,e),...n}));bv.displayName=gv.displayName;var xv=Object.freeze({status:`aborted`});function V(e,t,n){function r(n,r){if(n._zod||Object.defineProperty(n,"_zod",{value:{def:r,constr:o,traits:new Set},enumerable:!1}),n._zod.traits.has(e))return;n._zod.traits.add(e),t(n,r);let i=o.prototype,a=Object.keys(i);for(let e=0;e<a.length;e++){let t=a[e];t in n||(n[t]=i[t].bind(n))}}let i=n?.Parent??Object;class a extends i{}Object.defineProperty(a,"name",{value:e});function o(e){var t;let i=n?.Parent?new a:this;r(i,e),(t=i._zod).deferred??(t.deferred=[]);for(let e of i._zod.deferred)e();return i}return Object.defineProperty(o,"init",{value:r}),Object.defineProperty(o,Symbol.hasInstance,{value:t=>n?.Parent&&t instanceof n.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(o,"name",{value:e}),o}var Sv=Symbol(`zod_brand`),Cv=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},wv=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}},Tv={};function Ev(e){return e&&Object.assign(Tv,e),Tv}var Dv=c({BIGINT_FORMAT_RANGES:()=>Qv,Class:()=>xy,NUMBER_FORMAT_RANGES:()=>Zv,aborted:()=>oy,allowsEval:()=>Hv,assert:()=>gte,assertEqual:()=>fte,assertIs:()=>mte,assertNever:()=>hte,assertNotEqual:()=>pte,assignProp:()=>Iv,base64ToUint8Array:()=>hy,base64urlToUint8Array:()=>_y,cached:()=>Av,captureStackTrace:()=>Bv,cleanEnum:()=>my,cleanRegex:()=>Mv,clone:()=>Jv,cloneDef:()=>vte,createTransparentProxy:()=>wte,defineLazy:()=>Fv,esc:()=>Rv,escapeRegex:()=>qv,extend:()=>ty,finalizeIssue:()=>ly,floatSafeRemainder:()=>Nv,getElementAtPath:()=>yte,getEnumValues:()=>Ov,getLengthableOrigin:()=>dy,getParsedType:()=>Cte,getSizableOrigin:()=>uy,hexToUint8Array:()=>yy,isObject:()=>Vv,isPlainObject:()=>Uv,issue:()=>py,joinValues:()=>H,jsonStringifyReplacer:()=>kv,merge:()=>ry,mergeDefs:()=>Lv,normalizeParams:()=>U,nullish:()=>jv,numKeys:()=>Ste,objectClone:()=>_te,omit:()=>ey,optionalKeys:()=>Xv,parsedType:()=>fy,partial:()=>iy,pick:()=>$v,prefixIssues:()=>sy,primitiveTypes:()=>Kv,promiseAllObject:()=>bte,propertyKeyTypes:()=>Gv,randomString:()=>xte,required:()=>ay,safeExtend:()=>ny,shallowClone:()=>Wv,slugify:()=>zv,stringifyPrimitive:()=>Yv,uint8ArrayToBase64:()=>gy,uint8ArrayToBase64url:()=>vy,uint8ArrayToHex:()=>by,unwrapMessage:()=>cy});function fte(e){return e}function pte(e){return e}function mte(e){}function hte(e){throw Error(`Unexpected value in exhaustive check`)}function gte(e){}function Ov(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function H(e,t=`|`){return e.map(e=>Yv(e)).join(t)}function kv(e,t){return typeof t==`bigint`?t.toString():t}function Av(e){return{get value(){{let t=e();return Object.defineProperty(this,"value",{value:t}),t}throw Error(`cached value already set`)}}}function jv(e){return e==null}function Mv(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function Nv(e,t){let n=(e.toString().split(`.`)[1]||``).length,r=t.toString(),i=(r.split(`.`)[1]||``).length;if(i===0&&/\d?e-\d?/.test(r)){let e=r.match(/\d?e-(\d?)/);e?.[1]&&(i=Number.parseInt(e[1]))}let a=n>i?n:i;return Number.parseInt(e.toFixed(a).replace(`.`,``))%Number.parseInt(t.toFixed(a).replace(`.`,``))/10**a}var Pv=Symbol(`evaluating`);function Fv(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==Pv)return r===void 0&&(r=Pv,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function _te(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function Iv(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Lv(...e){let t={};for(let n of e)Object.assign(t,Object.getOwnPropertyDescriptors(n));return Object.defineProperties({},t)}function vte(e){return Lv(e._zod.def)}function yte(e,t){return t?t.reduce((e,t)=>e?.[t],e):e}function bte(e){let t=Object.keys(e),n=t.map(t=>e[t]);return Promise.all(n).then(e=>{let n={};for(let r=0;r<t.length;r++)n[t[r]]=e[r];return n})}function xte(e=10){let t=``;for(let n=0;n<e;n++)t+=`abcdefghijklmnopqrstuvwxyz`[Math.floor(Math.random()*26)];return t}function Rv(e){return JSON.stringify(e)}function zv(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}var Bv=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function Vv(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var Hv=Av(()=>{if(typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function Uv(e){if(Vv(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return!(Vv(n)===!1||Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)===!1)}function Wv(e){return Uv(e)?{...e}:Array.isArray(e)?[...e]:e}function Ste(e){let t=0;for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&t++;return t}var Cte=e=>{let t=typeof e;switch(t){case`undefined`:return`undefined`;case`string`:return`string`;case`number`:return Number.isNaN(e)?`nan`:`number`;case`boolean`:return`boolean`;case`function`:return`function`;case`bigint`:return`bigint`;case`symbol`:return`symbol`;case`object`:return Array.isArray(e)?`array`:e===null?`null`:e.then&&typeof e.then==`function`&&e.catch&&typeof e.catch==`function`?`promise`:typeof Map<`u`&&e instanceof Map?`map`:typeof Set<`u`&&e instanceof Set?`set`:typeof Date<`u`&&e instanceof Date?`date`:typeof File<`u`&&e instanceof File?`file`:`object`;default:throw Error(`Unknown data type: ${t}`)}},Gv=new Set([`string`,`number`,`symbol`]),Kv=new Set([`string`,`number`,`bigint`,`boolean`,`symbol`,`undefined`]);function qv(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function Jv(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function U(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error==`string`?{...t,error:()=>t.error}:t}function wte(e){let t;return new Proxy({},{get(n,r,i){return t??=e(),Reflect.get(t,r,i)},set(n,r,i,a){return t??=e(),Reflect.set(t,r,i,a)},has(n,r){return t??=e(),Reflect.has(t,r)},deleteProperty(n,r){return t??=e(),Reflect.deleteProperty(t,r)},ownKeys(n){return t??=e(),Reflect.ownKeys(t)},getOwnPropertyDescriptor(n,r){return t??=e(),Reflect.getOwnPropertyDescriptor(t,r)},defineProperty(n,r,i){return t??=e(),Reflect.defineProperty(t,r,i)}})}function Yv(e){return typeof e==`bigint`?e.toString()+`n`:typeof e==`string`?`"${e}"`:`${e}`}function Xv(e){return Object.keys(e).filter(t=>e[t]._zod.optin===`optional`&&e[t]._zod.optout===`optional`)}var Zv={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},Qv={int64:[BigInt(`-9223372036854775808`),BigInt(`9223372036854775807`)],uint64:[BigInt(0),BigInt(`18446744073709551615`)]};function $v(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.pick() cannot be used on object schemas containing refinements`);return Jv(e,Lv(e._zod.def,{get shape(){let e={};for(let r in t){if(!(r in n.shape))throw Error(`Unrecognized key: "${r}"`);t[r]&&(e[r]=n.shape[r])}return Iv(this,`shape`,e),e},checks:[]}))}function ey(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.omit() cannot be used on object schemas containing refinements`);return Jv(e,Lv(e._zod.def,{get shape(){let r={...e._zod.def.shape};for(let e in t){if(!(e in n.shape))throw Error(`Unrecognized key: "${e}"`);t[e]&&delete r[e]}return Iv(this,`shape`,r),r},checks:[]}))}function ty(e,t){if(!Uv(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=e._zod.def.shape;for(let e in t)if(Object.getOwnPropertyDescriptor(n,e)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return Jv(e,Lv(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return Iv(this,`shape`,n),n}}))}function ny(e,t){if(!Uv(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return Jv(e,Lv(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return Iv(this,`shape`,n),n}}))}function ry(e,t){return Jv(e,Lv(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t._zod.def.shape};return Iv(this,`shape`,n),n},get catchall(){return t._zod.def.catchall},checks:[]}))}function iy(e,t,n){let r=t._zod.def.checks;if(r&&r.length>0)throw Error(`.partial() cannot be used on object schemas containing refinements`);return Jv(t,Lv(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in r))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t])}else for(let t in r)i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t];return Iv(this,`shape`,i),i},checks:[]}))}function ay(e,t,n){return Jv(t,Lv(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in i))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=new e({type:`nonoptional`,innerType:r[t]}))}else for(let t in r)i[t]=new e({type:`nonoptional`,innerType:r[t]});return Iv(this,`shape`,i),i}}))}function oy(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function sy(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function cy(e){return typeof e==`string`?e:e?.message}function ly(e,t,n){let r={...e,path:e.path??[]};return e.message||(r.message=cy(e.inst?._zod.def?.error?.(e))??cy(t?.error?.(e))??cy(n.customError?.(e))??cy(n.localeError?.(e))??`Invalid input`),delete r.inst,delete r.continue,t?.reportInput||delete r.input,r}function uy(e){return e instanceof Set?`set`:e instanceof Map?`map`:e instanceof File?`file`:`unknown`}function dy(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function fy(e){let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`nan`:`number`;case`object`:{if(e===null)return`null`;if(Array.isArray(e))return`array`;let t=e;if(t&&Object.getPrototypeOf(t)!==Object.prototype&&`constructor`in t&&t.constructor)return t.constructor.name}}return t}function py(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}function my(e){return Object.entries(e).filter(([e,t])=>Number.isNaN(Number.parseInt(e,10))).map(e=>e[1])}function hy(e){let t=atob(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;e++)n[e]=t.charCodeAt(e);return n}function gy(e){let t=``;for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return btoa(t)}function _y(e){let t=e.replace(/-/g,`+`).replace(/_/g,`/`);return hy(t+`=`.repeat((4-t.length%4)%4))}function vy(e){return gy(e).replace(/\+/g,`-`).replace(/\//g,`_`).replace(/=/g,``)}function yy(e){let t=e.replace(/^0x/,``);if(t.length%2!=0)throw Error(`Invalid hex string length`);let n=new Uint8Array(t.length/2);for(let e=0;e<t.length;e+=2)n[e/2]=Number.parseInt(t.slice(e,e+2),16);return n}function by(e){return Array.from(e).map(e=>e.toString(16).padStart(2,`0`)).join(``)}var xy=class{constructor(...e){}},Sy=(e,t)=>{e.name=`$ZodError`,Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,kv,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Cy=V(`$ZodError`,Sy),wy=V(`$ZodError`,Sy,{Parent:Error});function Ty(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}function Ey(e,t=e=>e.message){let n={_errors:[]},r=e=>{for(let i of e.issues)if(i.code===`invalid_union`&&i.errors.length)i.errors.map(e=>r({issues:e}));else if(i.code===`invalid_key`)r({issues:i.issues});else if(i.code===`invalid_element`)r({issues:i.issues});else if(i.path.length===0)n._errors.push(t(i));else{let e=n,r=0;for(;r<i.path.length;){let n=i.path[r];r===i.path.length-1?(e[n]=e[n]||{_errors:[]},e[n]._errors.push(t(i))):e[n]=e[n]||{_errors:[]},e=e[n],r++}}};return r(e),n}function Dy(e,t=e=>e.message){let n={errors:[]},r=(e,i=[])=>{var a,o;for(let s of e.issues)if(s.code===`invalid_union`&&s.errors.length)s.errors.map(e=>r({issues:e},s.path));else if(s.code===`invalid_key`)r({issues:s.issues},s.path);else if(s.code===`invalid_element`)r({issues:s.issues},s.path);else{let e=[...i,...s.path];if(e.length===0){n.errors.push(t(s));continue}let r=n,c=0;for(;c<e.length;){let n=e[c],i=c===e.length-1;typeof n==`string`?(r.properties??={},(a=r.properties)[n]??(a[n]={errors:[]}),r=r.properties[n]):(r.items??=[],(o=r.items)[n]??(o[n]={errors:[]}),r=r.items[n]),i&&r.errors.push(t(s)),c++}}};return r(e),n}function Oy(e){let t=[],n=e.map(e=>typeof e==`object`?e.key:e);for(let e of n)typeof e==`number`?t.push(`[${e}]`):typeof e==`symbol`?t.push(`[${JSON.stringify(String(e))}]`):/[^\w$]/.test(e)?t.push(`[${JSON.stringify(e)}]`):(t.length&&t.push(`.`),t.push(e));return t.join(``)}function ky(e){let t=[],n=[...e.issues].sort((e,t)=>(e.path??[]).length-(t.path??[]).length);for(let e of n)t.push(`✖ ${e.message}`),e.path?.length&&t.push(` → at ${Oy(e.path)}`);return t.join(`
|
|
48
48
|
`)}var Ay=e=>(t,n,r,i)=>{let a=r?Object.assign(r,{async:!1}):{async:!1},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise)throw new Cv;if(o.issues.length){let t=new(i?.Err??e)(o.issues.map(e=>ly(e,a,Ev())));throw Bv(t,i?.callee),t}return o.value},jy=Ay(wy),My=e=>async(t,n,r,i)=>{let a=r?Object.assign(r,{async:!0}):{async:!0},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise&&(o=await o),o.issues.length){let t=new(i?.Err??e)(o.issues.map(e=>ly(e,a,Ev())));throw Bv(t,i?.callee),t}return o.value},Ny=My(wy),Py=e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new Cv;return a.issues.length?{success:!1,error:new(e??Cy)(a.issues.map(e=>ly(e,i,Ev())))}:{success:!0,data:a.value}},Fy=Py(wy),Iy=e=>async(t,n,r)=>{let i=r?Object.assign(r,{async:!0}):{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(e=>ly(e,i,Ev())))}:{success:!0,data:a.value}},Ly=Iy(wy),Ry=e=>(t,n,r)=>{let i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return Ay(e)(t,n,i)},zy=Ry(wy),By=e=>(t,n,r)=>Ay(e)(t,n,r),Vy=By(wy),Hy=e=>async(t,n,r)=>{let i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return My(e)(t,n,i)},Uy=Hy(wy),Wy=e=>async(t,n,r)=>My(e)(t,n,r),Gy=Wy(wy),Ky=e=>(t,n,r)=>{let i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return Py(e)(t,n,i)},qy=Ky(wy),Jy=e=>(t,n,r)=>Py(e)(t,n,r),Yy=Jy(wy),Xy=e=>async(t,n,r)=>{let i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return Iy(e)(t,n,i)},Zy=Xy(wy),Qy=e=>async(t,n,r)=>Iy(e)(t,n,r),$y=Qy(wy),eb=c({base64:()=>wb,base64url:()=>Tb,bigint:()=>Fb,boolean:()=>Rb,browserEmail:()=>Ete,cidrv4:()=>Sb,cidrv6:()=>Cb,cuid:()=>tb,cuid2:()=>nb,date:()=>Ab,datetime:()=>Nb,domain:()=>Db,duration:()=>sb,e164:()=>Ob,email:()=>mb,emoji:()=>vb,extendedDuration:()=>cb,guid:()=>lb,hex:()=>Ub,hostname:()=>Eb,html5Email:()=>hb,idnEmail:()=>Tte,integer:()=>Ib,ipv4:()=>yb,ipv6:()=>bb,ksuid:()=>ab,lowercase:()=>Vb,mac:()=>xb,md5_base64:()=>kte,md5_base64url:()=>Ate,md5_hex:()=>Ote,nanoid:()=>ob,null:()=>zb,number:()=>Lb,rfc5322Email:()=>gb,sha1_base64:()=>Mte,sha1_base64url:()=>Nte,sha1_hex:()=>jte,sha256_base64:()=>Fte,sha256_base64url:()=>Ite,sha256_hex:()=>Pte,sha384_base64:()=>Rte,sha384_base64url:()=>zte,sha384_hex:()=>Lte,sha512_base64:()=>Vte,sha512_base64url:()=>Hte,sha512_hex:()=>Bte,string:()=>Pb,time:()=>Mb,ulid:()=>rb,undefined:()=>Bb,unicodeEmail:()=>_b,uppercase:()=>Hb,uuid:()=>ub,uuid4:()=>db,uuid6:()=>fb,uuid7:()=>pb,xid:()=>ib}),tb=/^[cC][^\s-]{8,}$/,nb=/^[0-9a-z]+$/,rb=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,ib=/^[0-9a-vA-V]{20}$/,ab=/^[A-Za-z0-9]{27}$/,ob=/^[a-zA-Z0-9_-]{21}$/,sb=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,cb=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,lb=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,ub=e=>e?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,db=ub(4),fb=ub(6),pb=ub(7),mb=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,hb=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,gb=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,_b=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,Tte=_b,Ete=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,Dte=`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`;function vb(){return new RegExp(Dte,`u`)}var yb=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,bb=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,xb=e=>{let t=qv(e??`:`);return RegExp(`^(?:[0-9A-F]{2}${t}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${t}){5}[0-9a-f]{2}$`)},Sb=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Cb=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,wb=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Tb=/^[A-Za-z0-9_-]*$/,Eb=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,Db=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,Ob=/^\+[1-9]\d{6,14}$/,kb=`(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`,Ab=RegExp(`^${kb}$`);function jb(e){let t=`(?:[01]\\d|2[0-3]):[0-5]\\d`;return typeof e.precision==`number`?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Mb(e){return RegExp(`^${jb(e)}$`)}function Nb(e){let t=jb({precision:e.precision}),n=[`Z`];e.local&&n.push(``),e.offset&&n.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let r=`${t}(?:${n.join(`|`)})`;return RegExp(`^${kb}T(?:${r})$`)}var Pb=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??``}}`:`[\\s\\S]*`;return RegExp(`^${t}$`)},Fb=/^-?\d+n?$/,Ib=/^-?\d+$/,Lb=/^-?\d+(?:\.\d+)?$/,Rb=/^(?:true|false)$/i,zb=/^null$/i,Bb=/^undefined$/i,Vb=/^[^A-Z]*$/,Hb=/^[^a-z]*$/,Ub=/^[0-9a-fA-F]*$/;function Wb(e,t){return RegExp(`^[A-Za-z0-9+/]{${e}}${t}$`)}function Gb(e){return RegExp(`^[A-Za-z0-9_-]{${e}}$`)}var Ote=/^[0-9a-fA-F]{32}$/,kte=Wb(22,`==`),Ate=Gb(22),jte=/^[0-9a-fA-F]{40}$/,Mte=Wb(27,`=`),Nte=Gb(27),Pte=/^[0-9a-fA-F]{64}$/,Fte=Wb(43,`=`),Ite=Gb(43),Lte=/^[0-9a-fA-F]{96}$/,Rte=Wb(64,``),zte=Gb(64),Bte=/^[0-9a-fA-F]{128}$/,Vte=Wb(86,`==`),Hte=Gb(86),Kb=V(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),qb={number:`number`,bigint:`bigint`,object:`date`},Jb=V(`$ZodCheckLessThan`,(e,t)=>{Kb.init(e,t);let n=qb[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.maximum:n.exclusiveMaximum)??1/0;t.value<r&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:`too_big`,maximum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Yb=V(`$ZodCheckGreaterThan`,(e,t)=>{Kb.init(e,t);let n=qb[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.minimum:n.exclusiveMinimum)??-1/0;t.value>r&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:`too_small`,minimum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Xb=V(`$ZodCheckMultipleOf`,(e,t)=>{Kb.init(e,t),e._zod.onattach.push(e=>{var n;(n=e._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw Error(`Cannot mix number and bigint in multiple_of check.`);(typeof n.value==`bigint`?n.value%t.value===BigInt(0):Nv(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:`not_multiple_of`,divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),Zb=V(`$ZodCheckNumberFormat`,(e,t)=>{Kb.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=Zv[t.format];e._zod.onattach.push(e=>{let r=e._zod.bag;r.format=t.format,r.minimum=i,r.maximum=a,n&&(r.pattern=Ib)}),e._zod.check=o=>{let s=o.value;if(n){if(!Number.isInteger(s)){o.issues.push({expected:r,format:t.format,code:`invalid_type`,continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?o.issues.push({input:s,code:`too_big`,maximum:2**53-1,note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort}):o.issues.push({input:s,code:`too_small`,minimum:-(2**53-1),note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}s<i&&o.issues.push({origin:`number`,input:s,code:`too_small`,minimum:i,inclusive:!0,inst:e,continue:!t.abort}),s>a&&o.issues.push({origin:`number`,input:s,code:`too_big`,maximum:a,inclusive:!0,inst:e,continue:!t.abort})}}),Qb=V(`$ZodCheckBigIntFormat`,(e,t)=>{Kb.init(e,t);let[n,r]=Qv[t.format];e._zod.onattach.push(e=>{let i=e._zod.bag;i.format=t.format,i.minimum=n,i.maximum=r}),e._zod.check=i=>{let a=i.value;a<n&&i.issues.push({origin:`bigint`,input:a,code:`too_small`,minimum:n,inclusive:!0,inst:e,continue:!t.abort}),a>r&&i.issues.push({origin:`bigint`,input:a,code:`too_big`,maximum:r,inclusive:!0,inst:e,continue:!t.abort})}}),$b=V(`$ZodCheckMaxSize`,(e,t)=>{var n;Kb.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!jv(t)&&t.size!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.maximum??1/0;t.maximum<n&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{let r=n.value;r.size<=t.maximum||n.issues.push({origin:uy(r),code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),ex=V(`$ZodCheckMinSize`,(e,t)=>{var n;Kb.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!jv(t)&&t.size!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.minimum??-1/0;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let r=n.value;r.size>=t.minimum||n.issues.push({origin:uy(r),code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),tx=V(`$ZodCheckSizeEquals`,(e,t)=>{var n;Kb.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!jv(t)&&t.size!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag;n.minimum=t.size,n.maximum=t.size,n.size=t.size}),e._zod.check=n=>{let r=n.value,i=r.size;if(i===t.size)return;let a=i>t.size;n.issues.push({origin:uy(r),...a?{code:`too_big`,maximum:t.size}:{code:`too_small`,minimum:t.size},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),nx=V(`$ZodCheckMaxLength`,(e,t)=>{var n;Kb.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!jv(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.maximum??1/0;t.maximum<n&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{let r=n.value;if(r.length<=t.maximum)return;let i=dy(r);n.issues.push({origin:i,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),rx=V(`$ZodCheckMinLength`,(e,t)=>{var n;Kb.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!jv(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.minimum??-1/0;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let r=n.value;if(r.length>=t.minimum)return;let i=dy(r);n.issues.push({origin:i,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),ix=V(`$ZodCheckLengthEquals`,(e,t)=>{var n;Kb.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!jv(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=n=>{let r=n.value,i=r.length;if(i===t.length)return;let a=dy(r),o=i>t.length;n.issues.push({origin:a,...o?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),ax=V(`$ZodCheckStringFormat`,(e,t)=>{var n,r;Kb.init(e,t),e._zod.onattach.push(e=>{let n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??=new Set,n.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),ox=V(`$ZodCheckRegex`,(e,t)=>{ax.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:`regex`,input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),sx=V(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=Vb,ax.init(e,t)}),cx=V(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=Hb,ax.init(e,t)}),lx=V(`$ZodCheckIncludes`,(e,t)=>{Kb.init(e,t);let n=qv(t.includes),r=new RegExp(typeof t.position==`number`?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(r)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:`string`,code:`invalid_format`,format:`includes`,includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),ux=V(`$ZodCheckStartsWith`,(e,t)=>{Kb.init(e,t);let n=RegExp(`^${qv(t.prefix)}.*`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`starts_with`,prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),dx=V(`$ZodCheckEndsWith`,(e,t)=>{Kb.init(e,t);let n=RegExp(`.*${qv(t.suffix)}$`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`ends_with`,suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}});function fx(e,t,n){e.issues.length&&t.issues.push(...sy(n,e.issues))}var px=V(`$ZodCheckProperty`,(e,t)=>{Kb.init(e,t),e._zod.check=e=>{let n=t.schema._zod.run({value:e.value[t.property],issues:[]},{});if(n instanceof Promise)return n.then(n=>fx(n,e,t.property));fx(n,e,t.property)}}),mx=V(`$ZodCheckMimeType`,(e,t)=>{Kb.init(e,t);let n=new Set(t.mime);e._zod.onattach.push(e=>{e._zod.bag.mime=t.mime}),e._zod.check=r=>{n.has(r.value.type)||r.issues.push({code:`invalid_value`,values:t.mime,input:r.value.type,inst:e,continue:!t.abort})}}),hx=V(`$ZodCheckOverwrite`,(e,t)=>{Kb.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}),gx=class{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),--this.indent}write(e){if(typeof e==`function`){e(this,{execution:`sync`}),e(this,{execution:`async`});return}let t=e.split(`
|
|
49
49
|
`).filter(e=>e),n=Math.min(...t.map(e=>e.length-e.trimStart().length)),r=t.map(e=>e.slice(n)).map(e=>` `.repeat(this.indent*2)+e);for(let e of r)this.content.push(e)}compile(){let e=Function,t=this?.args,n=[...(this?.content??[``]).map(e=>` ${e}`)];return new e(...t,n.join(`
|
|
50
50
|
`))}},_x={major:4,minor:3,patch:6},vx=V(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=_x;let r=[...e._zod.def.checks??[]];e._zod.traits.has(`$ZodCheck`)&&r.unshift(e);for(let t of r)for(let n of t._zod.onattach)n(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(e,t,n)=>{let r=oy(e),i;for(let a of t){if(a._zod.def.when){if(!a._zod.def.when(e))continue}else if(r)continue;let t=e.issues.length,o=a._zod.check(e);if(o instanceof Promise&&n?.async===!1)throw new Cv;if(i||o instanceof Promise)i=(i??Promise.resolve()).then(async()=>{await o,e.issues.length!==t&&(r||=oy(e,t))});else{if(e.issues.length===t)continue;r||=oy(e,t)}}return i?i.then(()=>e):e},n=(n,i,a)=>{if(oy(n))return n.aborted=!0,n;let o=t(i,r,a);if(o instanceof Promise){if(a.async===!1)throw new Cv;return o.then(t=>e._zod.parse(t,a))}return e._zod.parse(o,a)};e._zod.run=(i,a)=>{if(a.skipChecks)return e._zod.parse(i,a);if(a.direction===`backward`){let t=e._zod.parse({value:i.value,issues:[]},{...a,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,i,a)):n(t,i,a)}let o=e._zod.parse(i,a);if(o instanceof Promise){if(a.async===!1)throw new Cv;return o.then(e=>t(e,r,a))}return t(o,r,a)}}Fv(e,`~standard`,()=>({validate:t=>{try{let n=Fy(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch{return Ly(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:`zod`,version:1}))}),yx=V(`$ZodString`,(e,t)=>{vx.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??Pb(e._zod.bag),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value==`string`||n.issues.push({expected:`string`,code:`invalid_type`,input:n.value,inst:e}),n}}),bx=V(`$ZodStringFormat`,(e,t)=>{ax.init(e,t),yx.init(e,t)}),xx=V(`$ZodGUID`,(e,t)=>{t.pattern??=lb,bx.init(e,t)}),Sx=V(`$ZodUUID`,(e,t)=>{if(t.version){let e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(e===void 0)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??=ub(e)}else t.pattern??=ub();bx.init(e,t)}),Cx=V(`$ZodEmail`,(e,t)=>{t.pattern??=mb,bx.init(e,t)}),wx=V(`$ZodURL`,(e,t)=>{bx.init(e,t),e._zod.check=n=>{try{let r=n.value.trim(),i=new URL(r);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.hostname)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid hostname`,pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(`:`)?i.protocol.slice(0,-1):i.protocol)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid protocol`,pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=i.href:n.value=r;return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),Tx=V(`$ZodEmoji`,(e,t)=>{t.pattern??=vb(),bx.init(e,t)}),Ex=V(`$ZodNanoID`,(e,t)=>{t.pattern??=ob,bx.init(e,t)}),Dx=V(`$ZodCUID`,(e,t)=>{t.pattern??=tb,bx.init(e,t)}),Ox=V(`$ZodCUID2`,(e,t)=>{t.pattern??=nb,bx.init(e,t)}),kx=V(`$ZodULID`,(e,t)=>{t.pattern??=rb,bx.init(e,t)}),Ax=V(`$ZodXID`,(e,t)=>{t.pattern??=ib,bx.init(e,t)}),jx=V(`$ZodKSUID`,(e,t)=>{t.pattern??=ab,bx.init(e,t)}),Mx=V(`$ZodISODateTime`,(e,t)=>{t.pattern??=Nb(t),bx.init(e,t)}),Nx=V(`$ZodISODate`,(e,t)=>{t.pattern??=Ab,bx.init(e,t)}),Px=V(`$ZodISOTime`,(e,t)=>{t.pattern??=Mb(t),bx.init(e,t)}),Fx=V(`$ZodISODuration`,(e,t)=>{t.pattern??=sb,bx.init(e,t)}),Ix=V(`$ZodIPv4`,(e,t)=>{t.pattern??=yb,bx.init(e,t),e._zod.bag.format=`ipv4`}),Lx=V(`$ZodIPv6`,(e,t)=>{t.pattern??=bb,bx.init(e,t),e._zod.bag.format=`ipv6`,e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:`invalid_format`,format:`ipv6`,input:n.value,inst:e,continue:!t.abort})}}}),Rx=V(`$ZodMAC`,(e,t)=>{t.pattern??=xb(t.delimiter),bx.init(e,t),e._zod.bag.format=`mac`}),zx=V(`$ZodCIDRv4`,(e,t)=>{t.pattern??=Sb,bx.init(e,t)}),Bx=V(`$ZodCIDRv6`,(e,t)=>{t.pattern??=Cb,bx.init(e,t),e._zod.check=n=>{let r=n.value.split(`/`);try{if(r.length!==2)throw Error();let[e,t]=r;if(!t)throw Error();let n=Number(t);if(`${n}`!==t||n<0||n>128)throw Error();new URL(`http://[${e}]`)}catch{n.issues.push({code:`invalid_format`,format:`cidrv6`,input:n.value,inst:e,continue:!t.abort})}}});function Vx(e){if(e===``)return!0;if(e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}var Hx=V(`$ZodBase64`,(e,t)=>{t.pattern??=wb,bx.init(e,t),e._zod.bag.contentEncoding=`base64`,e._zod.check=n=>{Vx(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}});function Ux(e){if(!Tb.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return Vx(t.padEnd(Math.ceil(t.length/4)*4,`=`))}var Wx=V(`$ZodBase64URL`,(e,t)=>{t.pattern??=Tb,bx.init(e,t),e._zod.bag.contentEncoding=`base64url`,e._zod.check=n=>{Ux(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),Gx=V(`$ZodE164`,(e,t)=>{t.pattern??=Ob,bx.init(e,t)});function Kx(e,t=null){try{let n=e.split(`.`);if(n.length!==3)return!1;let[r]=n;if(!r)return!1;let i=JSON.parse(atob(r));return!(`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&(!(`alg`in i)||i.alg!==t))}catch{return!1}}var qx=V(`$ZodJWT`,(e,t)=>{bx.init(e,t),e._zod.check=n=>{Kx(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),Jx=V(`$ZodCustomStringFormat`,(e,t)=>{bx.init(e,t),e._zod.check=n=>{t.fn(n.value)||n.issues.push({code:`invalid_format`,format:t.format,input:n.value,inst:e,continue:!t.abort})}}),Yx=V(`$ZodNumber`,(e,t)=>{vx.init(e,t),e._zod.pattern=e._zod.bag.pattern??Lb,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}let i=n.value;if(typeof i==`number`&&!Number.isNaN(i)&&Number.isFinite(i))return n;let a=typeof i==`number`?Number.isNaN(i)?`NaN`:Number.isFinite(i)?void 0:`Infinity`:void 0;return n.issues.push({expected:`number`,code:`invalid_type`,input:i,inst:e,...a?{received:a}:{}}),n}}),Xx=V(`$ZodNumberFormat`,(e,t)=>{Zb.init(e,t),Yx.init(e,t)}),Zx=V(`$ZodBoolean`,(e,t)=>{vx.init(e,t),e._zod.pattern=Rb,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}let i=n.value;return typeof i==`boolean`||n.issues.push({expected:`boolean`,code:`invalid_type`,input:i,inst:e}),n}}),Qx=V(`$ZodBigInt`,(e,t)=>{vx.init(e,t),e._zod.pattern=Fb,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=BigInt(n.value)}catch{}return typeof n.value==`bigint`||n.issues.push({expected:`bigint`,code:`invalid_type`,input:n.value,inst:e}),n}}),$x=V(`$ZodBigIntFormat`,(e,t)=>{Qb.init(e,t),Qx.init(e,t)}),eS=V(`$ZodSymbol`,(e,t)=>{vx.init(e,t),e._zod.parse=(t,n)=>{let r=t.value;return typeof r==`symbol`||t.issues.push({expected:`symbol`,code:`invalid_type`,input:r,inst:e}),t}}),tS=V(`$ZodUndefined`,(e,t)=>{vx.init(e,t),e._zod.pattern=Bb,e._zod.values=new Set([void 0]),e._zod.optin=`optional`,e._zod.optout=`optional`,e._zod.parse=(t,n)=>{let r=t.value;return r===void 0||t.issues.push({expected:`undefined`,code:`invalid_type`,input:r,inst:e}),t}}),nS=V(`$ZodNull`,(e,t)=>{vx.init(e,t),e._zod.pattern=zb,e._zod.values=new Set([null]),e._zod.parse=(t,n)=>{let r=t.value;return r===null||t.issues.push({expected:`null`,code:`invalid_type`,input:r,inst:e}),t}}),rS=V(`$ZodAny`,(e,t)=>{vx.init(e,t),e._zod.parse=e=>e}),iS=V(`$ZodUnknown`,(e,t)=>{vx.init(e,t),e._zod.parse=e=>e}),aS=V(`$ZodNever`,(e,t)=>{vx.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)}),oS=V(`$ZodVoid`,(e,t)=>{vx.init(e,t),e._zod.parse=(t,n)=>{let r=t.value;return r===void 0||t.issues.push({expected:`void`,code:`invalid_type`,input:r,inst:e}),t}}),sS=V(`$ZodDate`,(e,t)=>{vx.init(e,t),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=new Date(n.value)}catch{}let i=n.value,a=i instanceof Date;return a&&!Number.isNaN(i.getTime())||n.issues.push({expected:`date`,code:`invalid_type`,input:i,...a?{received:`Invalid Date`}:{},inst:e}),n}});function cS(e,t,n){e.issues.length&&t.issues.push(...sy(n,e.issues)),t.value[n]=e.value}var lS=V(`$ZodArray`,(e,t)=>{vx.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!Array.isArray(i))return n.issues.push({expected:`array`,code:`invalid_type`,input:i,inst:e}),n;n.value=Array(i.length);let a=[];for(let e=0;e<i.length;e++){let o=i[e],s=t.element._zod.run({value:o,issues:[]},r);s instanceof Promise?a.push(s.then(t=>cS(t,n,e))):cS(s,n,e)}return a.length?Promise.all(a).then(()=>n):n}});function uS(e,t,n,r,i){if(e.issues.length){if(i&&!(n in r))return;t.issues.push(...sy(n,e.issues))}e.value===void 0?n in r&&(t.value[n]=void 0):t.value[n]=e.value}function dS(e){let t=Object.keys(e.shape);for(let n of t)if(!e.shape?.[n]?._zod?.traits?.has(`$ZodType`))throw Error(`Invalid element at key "${n}": expected a Zod schema`);let n=Xv(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function fS(e,t,n,r,i,a){let o=[],s=i.keySet,c=i.catchall._zod,l=c.def.type,u=c.optout===`optional`;for(let i in t){if(s.has(i))continue;if(l===`never`){o.push(i);continue}let a=c.run({value:t[i],issues:[]},r);a instanceof Promise?e.push(a.then(e=>uS(e,n,i,t,u))):uS(a,n,i,t,u)}return o.length&&n.issues.push({code:`unrecognized_keys`,keys:o,input:t,inst:a}),e.length?Promise.all(e).then(()=>n):n}var pS=V(`$ZodObject`,(e,t)=>{if(vx.init(e,t),!Object.getOwnPropertyDescriptor(t,`shape`)?.get){let e=t.shape;Object.defineProperty(t,"shape",{get:()=>{let n={...e};return Object.defineProperty(t,"shape",{value:n}),n}})}let n=Av(()=>dS(t));Fv(e._zod,`propValues`,()=>{let e=t.shape,n={};for(let t in e){let r=e[t]._zod;if(r.values){n[t]??(n[t]=new Set);for(let e of r.values)n[t].add(e)}}return n});let r=Vv,i=t.catchall,a;e._zod.parse=(t,o)=>{a??=n.value;let s=t.value;if(!r(s))return t.issues.push({expected:`object`,code:`invalid_type`,input:s,inst:e}),t;t.value={};let c=[],l=a.shape;for(let e of a.keys){let n=l[e],r=n._zod.optout===`optional`,i=n._zod.run({value:s[e],issues:[]},o);i instanceof Promise?c.push(i.then(n=>uS(n,t,e,s,r))):uS(i,t,e,s,r)}return i?fS(c,s,t,o,n.value,e):c.length?Promise.all(c).then(()=>t):t}}),mS=V(`$ZodObjectJIT`,(e,t)=>{pS.init(e,t);let n=e._zod.parse,r=Av(()=>dS(t)),i=e=>{let t=new gx([`shape`,`payload`,`ctx`]),n=r.value,i=e=>{let t=Rv(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write(`const input = payload.value;`);let a=Object.create(null),o=0;for(let e of n.keys)a[e]=`key_${o++}`;t.write(`const newResult = {};`);for(let r of n.keys){let n=a[r],o=Rv(r),s=e[r]?._zod?.optout===`optional`;t.write(`const ${n} = ${i(r)};`),s?t.write(`
|