sonamu 0.10.4 → 0.10.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin/cli.js +206 -187
- package/dist/cone/cone-generator.js +3 -9
- package/dist/database/knex.d.ts.map +1 -1
- package/dist/database/knex.js +2 -2
- package/dist/database/puri.d.ts +17 -0
- package/dist/database/puri.d.ts.map +1 -1
- package/dist/database/puri.js +102 -3
- package/dist/migration/code-generation.js +6 -6
- package/dist/migration/migrator.d.ts.map +1 -1
- package/dist/migration/migrator.js +51 -6
- package/dist/ui-web/assets/{index-CDd6xT-F.js → index-D0MHYbxl.js} +2 -2
- package/dist/ui-web/assets/index-Dx_JX4aQ.css +1 -0
- package/dist/ui-web/index.html +2 -2
- package/package.json +2 -2
- package/src/bin/cli.ts +283 -282
- package/src/cone/cone-generator.ts +2 -18
- package/src/database/__tests__/puri.test.ts +183 -0
- package/src/database/knex.ts +4 -1
- package/src/database/puri.ts +229 -2
- package/src/database/puri.types.test-d.ts +56 -0
- package/src/migration/code-generation.ts +5 -5
- package/src/migration/migrator.ts +81 -7
- package/src/skills/AGENTS.md +76 -50
- package/src/skills/sonamu/SKILL.md +46 -227
- package/src/skills/{sonamu/ai-agents.md → sonamu-ai-agents/SKILL.md} +3 -3
- package/src/skills/{sonamu/api.md → sonamu-api/SKILL.md} +3 -2
- package/src/skills/{sonamu/auth.md → sonamu-auth/SKILL.md} +9 -4
- package/src/skills/{sonamu/auth-plugins.md → sonamu-auth/references/plugins.md} +2 -7
- package/src/skills/sonamu-auth/references/user-id-migration-followups.md +192 -0
- package/src/skills/{sonamu/auth-migration.md → sonamu-auth/references/user-id-migration.md} +1 -195
- package/src/skills/sonamu-config/SKILL.md +203 -0
- package/src/skills/{sonamu → sonamu-config/references}/database.md +3 -8
- package/src/skills/sonamu-config/references/environments.md +178 -0
- package/src/skills/sonamu-config/references/server-options.md +400 -0
- package/src/skills/sonamu-entity/SKILL.md +180 -0
- package/src/skills/{sonamu/entity-validation-checklist.md → sonamu-entity/references/creation-workflow.md} +117 -8
- package/src/skills/sonamu-entity/references/design-guides.md +243 -0
- package/src/skills/sonamu-entity/references/field-types.md +170 -0
- package/src/skills/sonamu-entity/references/relations-detail.md +245 -0
- package/src/skills/{sonamu/entity-relations.md → sonamu-entity/references/relations.md} +1 -258
- package/src/skills/{sonamu → sonamu-entity/references}/subset.md +1 -11
- package/src/skills/sonamu-fixture/SKILL.md +180 -0
- package/src/skills/{sonamu/fixture-cli.md → sonamu-fixture/references/cli-usage.md} +5 -176
- package/src/skills/{sonamu → sonamu-fixture/references}/cone.md +4 -14
- package/src/skills/sonamu-frontend/SKILL.md +142 -0
- package/src/skills/sonamu-frontend/references/components.md +323 -0
- package/src/skills/sonamu-frontend/references/examples.md +64 -0
- package/src/skills/sonamu-frontend/references/hooks.md +273 -0
- package/src/skills/sonamu-frontend/references/runtime.md +165 -0
- package/src/skills/{sonamu → sonamu-frontend/references}/scaffolding.md +3 -8
- package/src/skills/{sonamu/i18n.md → sonamu-i18n/SKILL.md} +2 -2
- package/src/skills/{sonamu/migration.md → sonamu-migration/SKILL.md} +1 -1
- package/src/skills/{sonamu/naite.md → sonamu-naite/SKILL.md} +5 -5
- package/src/skills/sonamu-query/SKILL.md +48 -0
- package/src/skills/sonamu-query/references/model-patterns.md +390 -0
- package/src/skills/{sonamu → sonamu-query/references}/model.md +1 -401
- package/src/skills/{sonamu → sonamu-query/references}/puri.md +31 -243
- package/src/skills/sonamu-query/references/search.md +238 -0
- package/src/skills/{sonamu → sonamu-query/references}/upsert.md +1 -6
- package/src/skills/{sonamu/tasks.md → sonamu-tasks/SKILL.md} +1 -1
- package/src/skills/sonamu-testing/SKILL.md +251 -0
- package/src/skills/{sonamu/testing-devrunner.md → sonamu-testing/references/devrunner.md} +4 -9
- package/src/skills/sonamu-testing/references/helpers.md +185 -0
- package/src/skills/sonamu-testing/references/patterns.md +263 -0
- package/src/skills/sonamu-testing/references/pitfalls.md +588 -0
- package/src/skills/sonamu-testing/references/quick-start.md +285 -0
- package/src/skills/sonamu-testing/references/type-safety.md +172 -0
- package/src/skills/sonamu-testing/references/writing-plan.md +375 -0
- package/src/skills/{sonamu/vector.md → sonamu-vector/SKILL.md} +1 -1
- package/dist/ui-web/assets/index-Dx4ap5i4.css +0 -1
- package/src/skills/commands/sonamu-skills.md +0 -20
- package/src/skills/project/README.md +0 -19
- package/src/skills/project/architecture.md +0 -373
- package/src/skills/sonamu/cdd.md +0 -129
- package/src/skills/sonamu/config.md +0 -772
- package/src/skills/sonamu/create-sonamu.md +0 -208
- package/src/skills/sonamu/entity-basic.md +0 -678
- package/src/skills/sonamu/framework-change.md +0 -96
- package/src/skills/sonamu/frontend.md +0 -915
- package/src/skills/sonamu/project-init.md +0 -477
- package/src/skills/sonamu/skill-contribution.md +0 -247
- package/src/skills/sonamu/testing.md +0 -2163
|
@@ -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(`
|
|
@@ -99,7 +99,7 @@ Error generating stack: `+e.message+`
|
|
|
99
99
|
`);return e===-1?``:t.stack.slice(e+1)})();try{if(!e.stack)e.stack=n;else if(n){let t=n.indexOf(`
|
|
100
100
|
`),r=t===-1?-1:n.indexOf(`
|
|
101
101
|
`,t+1),i=r===-1?``:n.slice(r+1);String(e.stack).endsWith(i)||(e.stack+=`
|
|
102
|
-
`+n)}}catch{}}throw e}}_request(e,t){typeof e==`string`?(t||={},t.url=e):t=e||{},t=KI(this.defaults,t);let{transitional:n,paramsSerializer:r,headers:i}=t;n!==void 0&&bL.assertOptions(n,{silentJSONParsing:xL.transitional(xL.boolean),forcedJSONParsing:xL.transitional(xL.boolean),clarifyTimeoutError:xL.transitional(xL.boolean),legacyInterceptorReqResOrdering:xL.transitional(xL.boolean)},!1),r!=null&&(q.isFunction(r)?t.paramsSerializer={serialize:r}:bL.assertOptions(r,{encode:xL.function,serialize:xL.function},!0)),t.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls===void 0?t.allowAbsoluteUrls=!0:t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls),bL.assertOptions(t,{baseUrl:xL.spelling(`baseURL`),withXsrfToken:xL.spelling(`withXSRFToken`)},!0),t.method=(t.method||this.defaults.method||`get`).toLowerCase();let a=i&&q.merge(i.common,i[t.method]);i&&q.forEach([`delete`,`get`,`head`,`post`,`put`,`patch`,`common`],e=>{delete i[e]}),t.headers=kI.concat(a,i);let o=[],s=!0;this.interceptors.request.forEach(function(e){if(typeof e.runWhen==`function`&&e.runWhen(t)===!1)return;s&&=e.synchronous;let n=t.transitional||tI;n&&n.legacyInterceptorReqResOrdering?o.unshift(e.fulfilled,e.rejected):o.push(e.fulfilled,e.rejected)});let c=[];this.interceptors.response.forEach(function(e){c.push(e.fulfilled,e.rejected)});let l,u=0,d;if(!s){let e=[hL.bind(this),void 0];for(e.unshift(...o),e.push(...c),d=e.length,l=Promise.resolve(t);u<d;)l=l.then(e[u++],e[u++]);return l}d=o.length;let f=t;for(;u<d;){let e=o[u++],t=o[u++];try{f=e(f)}catch(e){t.call(this,e);break}}try{l=hL.call(this,f)}catch(e){return Promise.reject(e)}for(u=0,d=c.length;u<d;)l=l.then(c[u++],c[u++]);return l}getUri(e){return e=KI(this.defaults,e),$F(WI(e.baseURL,e.url,e.allowAbsoluteUrls),e.params,e.paramsSerializer)}};q.forEach([`delete`,`get`,`head`,`options`],function(e){SL.prototype[e]=function(t,n){return this.request(KI(n||{},{method:e,url:t,data:(n||{}).data}))}}),q.forEach([`post`,`put`,`patch`],function(e){function t(t){return function(n,r,i){return this.request(KI(i||{},{method:e,headers:t?{"Content-Type":`multipart/form-data`}:{},url:n,data:r}))}}SL.prototype[e]=t(),SL.prototype[e+`Form`]=t(!0)});var CL=class e{constructor(e){if(typeof e!=`function`)throw TypeError(`executor must be a function.`);let t;this.promise=new Promise(function(e){t=e});let n=this;this.promise.then(e=>{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null}),this.promise.then=e=>{let t,r=new Promise(e=>{n.subscribe(e),t=e}).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e(function(e,r,i){n.reason||(n.reason=new MI(e,r,i),t(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;let t=this._listeners.indexOf(e);t!==-1&&this._listeners.splice(t,1)}toAbortSignal(){let e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let t;return{token:new e(function(e){t=e}),cancel:t}}};function wL(e){return function(t){return e.apply(null,t)}}function TL(e){return q.isObject(e)&&e.isAxiosError===!0}var EL={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(EL).forEach(([e,t])=>{EL[t]=e});function DL(e){let t=new SL(e),n=jP(SL.prototype.request,t);return q.extend(n,SL.prototype,t,{allOwnKeys:!0}),q.extend(n,t,null,{allOwnKeys:!0}),n.create=function(t){return DL(KI(e,t))},n}var OL=DL(hI);OL.Axios=SL,OL.CanceledError=MI,OL.CancelToken=CL,OL.isCancel=jI,OL.VERSION=gL,OL.toFormData=JF,OL.AxiosError=HF,OL.Cancel=OL.CanceledError,OL.all=function(e){return Promise.all(e)},OL.spread=wL,OL.isAxiosError=TL,OL.mergeConfig=KI,OL.AxiosHeaders=kI,OL.formToJSON=e=>pI(q.isHTMLForm(e)?new FormData(e):e),OL.getAdapter=pL.getAdapter,OL.HttpStatusCode=EL,OL.default=OL;var kL=u(AP(),1),AL=``;async function jL(e){try{return(await OL({baseURL:AL,...e})).data}catch(e){if(OL.isAxiosError(e)&&e.response&&e.response.data){let t=e.response.data;throw new ML(e.response.status,t.message,t.issues)}throw e}}var ML=class extends Error{code;message;issues;isSonamuError;constructor(e,t,n){super(t),this.code=e,this.message=t,this.issues=n,this.isSonamuError=!0}};function NL(e){return e&&e.isSonamuError===!0}function PL(e){NL(e)?alert(e.message):alert(`에러 발생`)}var J;(function(e){function t(){return jL({method:`GET`,url:`/sonamu-ui/api/sonamu/config`})}e.getSonamuConfig=t;function n(){return N_({queryKey:[`entities`,`findMany`],queryFn:()=>jL({method:`GET`,url:`/sonamu-ui/api/entity/findMany`})})}e.useEntities=n;function r(e){return N_({queryKey:[`entity`,`typeIds`,e],queryFn:()=>jL({method:`GET`,url:`/sonamu-ui/api/entity/typeIds`,params:{filter:e,reload:`1`}})})}e.useTypeIds=r;function i(e){return jL({method:`POST`,url:`/sonamu-ui/api/entity/create`,data:{form:e}})}e.createEntity=i;function a(e){return jL({method:`POST`,url:`/sonamu-ui/api/entity/del`,data:{entityId:e}})}e.delEntity=a;function o(e,t){return jL({method:`POST`,url:`/sonamu-ui/api/entity/modifyEntityBase`,data:{entityId:e,newValues:t}})}e.modifyEntityBase=o;function s(e,t,n,r){return jL({method:`POST`,url:`/sonamu-ui/api/entity/modifySubset`,data:{entityId:e,subsetKey:t,fields:n,fieldsInternal:r}})}e.modifySubset=s;function c(e,t){return jL({method:`POST`,url:`/sonamu-ui/api/entity/delSubset`,data:{entityId:e,subsetKey:t}})}e.delSubset=c;function l(e,t,n){return jL({method:`POST`,url:`/sonamu-ui/api/entity/createProp`,data:{entityId:e,at:n,newProp:t}})}e.createProp=l;function u(e,t,n){return jL({method:`POST`,url:`/sonamu-ui/api/entity/modifyProp`,data:{entityId:e,at:n,newProp:t}})}e.modifyProp=u;function d(e,t){return jL({method:`POST`,url:`/sonamu-ui/api/entity/delProp`,data:{entityId:e,at:t}})}e.delProp=d;function f(e,t,n){return jL({method:`POST`,url:`/sonamu-ui/api/entity/moveProp`,data:{entityId:e,at:t,to:n}})}e.moveProp=f;function p(e,t){return jL({method:`POST`,url:`/sonamu-ui/api/entity/modifyIndexes`,data:{entityId:e,indexes:t}})}e.modifyIndexes=p;function m(e,t){return jL({method:`POST`,url:`/sonamu-ui/api/entity/modifyEnumLabels`,data:{entityId:e,enumLabels:t}})}e.modifyEnumLabels=m;function h(e){return jL({method:`POST`,url:`/sonamu-ui/api/entity/createEnumId`,data:e})}e.createEnumId=h;function g(e,t){return jL({method:`POST`,url:`/sonamu-ui/api/entity/modifyEnumId`,data:{entityId:e,enumId:t}})}e.modifyEnumId=g;function _(e){return jL({method:`POST`,url:`/sonamu-ui/api/entity/deleteEnumId`,data:e})}e.deleteEnumId=_;function v(e){return jL({method:`GET`,url:`/sonamu-ui/api/entity/getTableColumns`,params:{entityId:e}})}e.getTableColumns=v;function y(){return N_({queryKey:[`migrations`,`status`],queryFn:()=>jL({method:`GET`,url:`/sonamu-ui/api/migrations/status`})})}e.useMigrationStatus=y;function b(e,t,n){return jL({method:`POST`,url:`/sonamu-ui/api/migrations/runAction`,data:{action:e,targets:t,...n}})}e.migrationsRunAction=b;function x(e,t){return jL({method:`POST`,url:`/sonamu-ui/api/migrations/checkApproval`,data:{channel:e,ts:t}})}e.migrationsCheckApproval=x;function S(e,t,n,r){return jL({method:`POST`,url:`/sonamu-ui/api/migrations/forceApproval`,data:{channel:e,ts:t,reason:n,requestor:r}})}e.migrationsForceApproval=S;function C(e){return jL({method:`POST`,url:`/sonamu-ui/api/migrations/delCodes`,data:{codeNames:e}})}e.migrationsDelCodes=C;function w(){return jL({method:`POST`,url:`/sonamu-ui/api/migrations/generatePreparedCodes`,data:{}})}e.migrationsGeneratePreparedCodes=w;function T(e){return jL({method:`GET`,url:`/sonamu-ui/api/tools/openVscode`,params:e})}e.openVscode=T;function E(e){return jL({method:`GET`,url:`/sonamu-ui/api/tools/getSuggestion`,params:e})}e.getSuggestion=E;function D(e){let t=e.entityIds.length>0&&e.templateKeys.length>0;return N_({queryKey:[`scaffolding`,`getStatus`,e],queryFn:()=>jL({method:`POST`,url:`/sonamu-ui/api/scaffolding/getStatus`,data:e}),enabled:t})}e.useScaffoldingStatus=D;function O(e){return jL({method:`POST`,url:`/sonamu-ui/api/scaffolding/generate`,data:{options:e}})}e.scaffoldingGenerate=O;function k(e){return jL({method:`POST`,url:`/sonamu-ui/api/scaffolding/preview`,data:{option:e}})}e.scaffoldingPreview=k;function A(e){return jL({method:`GET`,url:`/sonamu-ui/api/openai/messages`,params:{id:e}})}e.getMessages=A;function j(e){return jL({method:`POST`,url:`/sonamu-ui/api/openai/chat`,data:{message:e}})}e.chat=j;function M(){return jL({method:`POST`,url:`/sonamu-ui/api/openai/clearThread`})}e.clearThread=M;function N(e,t,n,r){return jL({method:`POST`,url:`/sonamu-ui/api/fixture`,data:{sourceDB:e,targetDB:t,search:n,duplicateCheck:r}})}e.getFixtures=N;function P(e,t){return jL({method:`POST`,url:`/sonamu-ui/api/fixture/import`,data:{db:e,fixtures:t}})}e.importFixtures=P;function F(){return N_({queryKey:[`i18n`,`dictionary`],queryFn:()=>jL({method:`GET`,url:`/sonamu-ui/api/i18n/dictionary`})})}e.useI18nDictionary=F;function ee(e){let t=new FormData;return t.append(`file`,e),jL({method:`POST`,url:`/sonamu-ui/api/i18n/import`,data:t,headers:{"Content-Type":`multipart/form-data`}})}e.importI18n=ee;function te(e){return jL({method:`POST`,url:`/sonamu-ui/api/i18n/update`,data:e})}e.updateI18n=te;function ne(e){return jL({method:`POST`,url:`/sonamu-ui/api/i18n/create`,data:e})}e.createI18n=ne;function I(e){return jL({method:`POST`,url:`/sonamu-ui/api/i18n/delete`,data:{key:e}})}e.deleteI18n=I;function re(e){return jL({method:`POST`,url:`/sonamu-ui/api/i18n/checkUsage`,data:{keys:e}})}e.checkI18nUsage=re;function ie(){return N_({queryKey:[`test`,`status`],queryFn:()=>jL({method:`GET`,url:`/__test__/status`})})}e.useTestStatus=ie;function ae(e){return N_({queryKey:[`tasks`,`workflowRuns`,e],queryFn:()=>jL({method:`GET`,url:`/sonamu-ui/api/tasks/workflowRuns`,params:{...e?.limit?{limit:String(e.limit)}:{},...e?.after?{after:e.after}:{},...e?.before?{before:e.before}:{},...e?.status?.length?{status:e.status.join(`,`)}:{},...e?.workflowName?{workflowName:e.workflowName}:{},...e?.createdAfter?{createdAfter:e.createdAfter}:{},...e?.createdBefore?{createdBefore:e.createdBefore}:{},order:`desc`}}),refetchInterval:5e3})}e.useWorkflowRuns=ae;function oe(e){return N_({queryKey:[`tasks`,`workflowRun`,e],queryFn:()=>jL({method:`GET`,url:`/sonamu-ui/api/tasks/workflowRuns/${e}`}),refetchInterval:5e3})}e.useWorkflowRun=oe;function se(e){return N_({queryKey:[`tasks`,`stepAttempts`,e],queryFn:()=>jL({method:`GET`,url:`/sonamu-ui/api/tasks/workflowRuns/${e}/steps`}),refetchInterval:5e3})}e.useStepAttempts=se;function ce(){return N_({queryKey:[`tasks`,`workflowDefinitions`],queryFn:()=>jL({method:`GET`,url:`/sonamu-ui/api/tasks/workflowDefinitions`})})}e.useWorkflowDefinitions=ce;function le(e){return jL({method:`POST`,url:`/sonamu-ui/api/tasks/workflowRuns/${e}/cancel`})}e.cancelWorkflowRun=le;function ue(e){return jL({method:`POST`,url:`/sonamu-ui/api/tasks/workflowRuns/${e}/pause`})}e.pauseWorkflowRun=ue;function de(e){return jL({method:`POST`,url:`/sonamu-ui/api/tasks/workflowRuns/${e}/resume`})}e.resumeWorkflowRun=de;function fe(e,t){return jL({method:`POST`,url:`/sonamu-ui/api/entity/updateCone`,data:{entityId:e,target:`entity`,cone:t}})}e.updateEntityCone=fe;function pe(e,t,n){return jL({method:`POST`,url:`/sonamu-ui/api/entity/updateCone`,data:{entityId:e,target:`prop`,propName:t,cone:n}})}e.updatePropCone=pe;function me(e,t,n){return jL({method:`POST`,url:`/sonamu-ui/api/entity/updateCone`,data:{entityId:e,target:`enum`,enumId:t,cone:n}})}e.updateEnumCone=me;function he(e,t,n){return jL({method:`POST`,url:`/sonamu-ui/api/entity/updateCone`,data:{entityId:e,target:`subset`,subsetKey:t,cone:n}})}e.updateSubsetCone=he;function ge(e,t){return jL({method:`POST`,url:`/sonamu-ui/api/entity/generateCones`,data:{entityId:e,...t}})}e.generateCones=ge})(J||={});var FL=.3,IL=`bg-amber-200/60 text-amber-900 rounded-sm`;function LL(e,t){let n=e.toLowerCase(),r=t.toLowerCase();if(r.length===0||r.length>n.length)return null;let i=n.indexOf(r);if(i!==-1)return{score:1,indices:Array.from({length:r.length},(e,t)=>i+t)};let a=[],o=0;for(let e=0;e<n.length&&o<r.length;e++)n[e]===r[o]&&(a.push(e),o++);if(o<r.length)return null;let s=0;for(let t=0;t<a.length;t++){let n=a[t];t>0&&n===a[t-1]+1?s+=1:n===0||RL(e,n)?s+=.8:s+=.1}return{score:s/a.length,indices:a}}function RL(e,t){if(t===0)return!0;let n=e[t-1],r=e[t];return n===`_`||n===` `||n===`-`||n===`.`||n===n.toLowerCase()&&r===r.toUpperCase()&&r!==r.toLowerCase()}function zL({text:e,search:t,indices:n}){if(!t)return(0,z.jsx)(`span`,{children:e});let r=n??LL(e,t)?.indices;if(!r||r.length===0)return(0,z.jsx)(`span`,{children:e});if(r.every((e,t)=>t===0||e===r[t-1]+1)){let t=r[0],n=r[r.length-1]+1;return(0,z.jsxs)(`span`,{children:[e.slice(0,t),(0,z.jsx)(`span`,{className:IL,children:e.slice(t,n)}),e.slice(n)]})}let i=[],a=0;for(let t of r)t>a&&i.push(e.slice(a,t)),i.push((0,z.jsx)(`span`,{className:IL,children:e[t]},t)),a=t+1;return a<e.length&&i.push(e.slice(a)),(0,z.jsx)(`span`,{children:i})}function BL({open:e,onClose:t}){let[n,r]=(0,m.useState)(``),i=uP(),{data:a}=J.useEntities(),{entities:o}=a??{},s=(0,m.useMemo)(()=>!o||!n?[]:o.map(e=>{let t=LL(`${e.id} ${e.title}`,n),r=t!==null&&t.score>=FL,i=e.props.filter(e=>{let t=LL(`${e.name} ${e.desc??``}`,n);return t!==null&&t.score>=FL}),a=Object.entries(e.subsets).flatMap(([e,t])=>t.filter(t=>{let r=LL(`${e} ${t}`,n);return r!==null&&r.score>=FL}).map(t=>({subsetKey:e,field:t}))),o=Object.keys(e.enumLabels).filter(e=>{let t=LL(e,n);return t!==null&&t.score>=FL});return r||i.length>0||a.length>0||o.length>0?{entity:e,entityMatch:r,matchedProps:i,matchedSubsets:a,matchedEnums:o,bestScore:Math.max(t?.score??0,...i.map(e=>LL(`${e.name} ${e.desc??``}`,n)?.score??0),...a.map(({subsetKey:e,field:t})=>LL(`${e} ${t}`,n)?.score??0),...o.map(e=>LL(e,n)?.score??0))}:null}).filter(Boolean).toSorted((e,t)=>(t?.bestScore??0)-(e?.bestScore??0)),[o,n]),c=(e,n)=>{r(``),t(),i({to:e}),n&&l(n)},l=e=>{let t=0,n=setInterval(()=>{t++;let r=document.getElementById(e);r?(clearInterval(n),r.scrollIntoView({behavior:`instant`,block:`center`}),r.style.backgroundColor=`#fef3c7`,r.style.boxShadow=`0 0 0 2px #fbbf24`,setTimeout(()=>{r.style.backgroundColor=``,r.style.boxShadow=``,r.style.transition=`background-color 1s, box-shadow 1s`},1e3)):t>=50&&clearInterval(n)},100)};return(0,z.jsxs)(sf,{open:e,onOpenChange:e=>{e||(r(``),t())},commandProps:{shouldFilter:!1},children:[(0,z.jsx)(cf,{placeholder:`Search entities...`,value:n,onValueChange:r}),(0,z.jsxs)(lf,{className:`max-h-[60vh]`,children:[n&&s.length===0&&(0,z.jsx)(uf,{children:`검색 결과가 없습니다.`}),s.map(e=>{if(!e)return null;let{entity:t,entityMatch:r,matchedProps:i,matchedSubsets:a,matchedEnums:o}=e;return(0,z.jsxs)(df,{heading:(0,z.jsx)(zL,{text:`${t.id} ${t.title}`,search:n}),children:[r&&(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(pf,{value:`entity:${t.id} ${t.title}`,onSelect:()=>c(`/entities/${t.id}`),children:(0,z.jsx)(zL,{text:`${t.id} (${t.title})`,search:n})}),(0,z.jsxs)(pf,{value:`scaffolding:${t.id} ${t.title}`,onSelect:()=>c(`/scaffolding`,t.id),children:[`Scaffolding >`,` `,(0,z.jsx)(zL,{text:`${t.id}(${t.title})`,search:n})]})]}),i.map(e=>(0,z.jsxs)(pf,{value:`prop:${e.name} ${e.desc??``} ${t.id}`,onSelect:()=>c(`/entities/${t.id}`,`prop-${e.name}`),children:[`prop > `,(0,z.jsx)(zL,{text:e.name,search:n}),e.desc?(0,z.jsxs)(`span`,{children:[` (`,(0,z.jsx)(zL,{text:e.desc,search:n}),`)`]}):null]},`prop-${e.name}`)),a.map(({subsetKey:e,field:r})=>(0,z.jsxs)(pf,{value:`subset:${e} ${r} ${t.id}`,onSelect:()=>c(`/entities/${t.id}`,r),children:[`Subset`,e,` > `,(0,z.jsx)(zL,{text:r,search:n})]},`subset-${e}-${r}`)),o.map(e=>(0,z.jsxs)(pf,{value:`enum:${e} ${t.id}`,onSelect:()=>c(`/entities/${t.id}`,`enum-${e}`),children:[`enum > `,(0,z.jsx)(zL,{text:e,search:n})]},`enum-${e}`))]},t.id)})]})]})}function VL({children:e}){let{SD:t}=kP(),n=DP(),r=uie(),i=[{name:t(`nav.entities`),path:`/entities`},{name:t(`nav.migration`),path:`/migrations`},{name:t(`nav.scaffolding`),path:`/scaffolding`},{name:t(`nav.fixture`),path:`/fixture`},{name:t(`nav.i18n`),path:`/i18n`},{name:t(`nav.tasks`),path:`/tasks`},{name:t(`nav.testResults`),path:`/test-results`},{name:t(`nav.cdd`),path:`/cdd`}],a=rie(),[o,s]=(0,m.useState)(!1),[c,l]=(0,m.useState)(null),u=e=>{(e.metaKey||e.ctrlKey)&&e.key===`k`&&(e.preventDefault(),s(!0))};return(0,m.useEffect)(()=>(document.addEventListener(`keydown`,u),()=>{document.removeEventListener(`keydown`,u)}),[]),(0,m.useEffect)(()=>{J.getSonamuConfig().then(e=>{e.projectName&&(l(e.projectName),document.title=`${e.projectName}: Sonamu UI`)})},[]),(0,z.jsxs)(z.Fragment,{children:[(0,z.jsxs)(`div`,{className:`app`,children:[(0,z.jsxs)(`div`,{className:`w-full h-gnb bg-sidebar-bg text-white sticky top-0 left-0 flex items-center z-100 border-b border-white/10 justify-between`,children:[(0,z.jsxs)(`div`,{className:`flex`,children:[(0,z.jsxs)(`div`,{className:`p-4 font-bold w-sidemenu tracking-[-0.5px]`,children:[(0,z.jsx)(`span`,{children:`🌲 \xA0 Sonamu UI`}),(0,z.jsxs)(`span`,{className:`font-normal text-text-muted text-[0.9em] ml-2`,children:[`\xA0 `,c]})]}),(0,z.jsx)(`div`,{className:`flex gap-[0.3em] text-[0.9em]`,children:i.map((e,t)=>(0,z.jsx)(mP,{className:(0,kL.default)(`self-center px-6 py-[0.8em] cursor-pointer text-center text-text-light! no-underline rounded-md transition-all duration-200`,`hover:bg-white/10 hover:text-white!`,{"bg-white/15! font-semibold text-white!":a.pathname.includes(e.path)}),to:e.path,children:(0,z.jsx)(`div`,{children:e.name})},t))})]}),(0,z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,z.jsx)(`select`,{value:n,onChange:e=>r(e.target.value),className:`px-2 py-[0.4em] rounded-md border border-white/10 bg-black/20 cursor-pointer text-text-muted text-[0.85em] transition-all duration-200 hover:border-accent hover:text-white`,children:OP.map(e=>(0,z.jsx)(`option`,{value:e.value,children:e.label},e.value))}),(0,z.jsxs)(`button`,{type:`button`,className:`mr-4 px-4 py-[0.4em] rounded-[20px] border border-white/10 bg-black/20 cursor-pointer text-text-muted text-[0.9em] transition-all duration-200 hover:border-accent hover:text-white *:mr-2`,onClick:()=>s(!0),children:[(0,z.jsx)(`span`,{children:`🔍`}),(0,z.jsx)(`span`,{children:t(`nav.search`)}),(0,z.jsx)(`kbd`,{className:`keycap`,children:`⌘`}),(0,z.jsx)(`kbd`,{className:`keycap`,children:`K`})]})]})]}),(0,z.jsx)(`div`,{className:`content`,children:e})]}),(0,z.jsx)(BL,{open:o,onClose:()=>s(!1)}),(0,z.jsx)(Kee,{})]})}var HL=Vre()({component:UL});function UL(){return(0,z.jsx)(VL,{children:(0,z.jsx)(CP,{})})}function Y(){return Y=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Y.apply(null,arguments)}function WL(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var GL={},KL=(0,m.createContext)(GL),qL=(e,t)=>Y({},e,t),JL=()=>(0,m.useContext)(KL),YL=(0,m.createContext)(()=>{});YL.displayName=`JVR.DispatchShowTools`;function XL(){return(0,m.useReducer)(qL,GL)}function ZL(){return(0,m.useContext)(YL)}var QL=e=>{var{initial:t,dispatch:n,children:r}=e;return(0,z.jsx)(KL.Provider,{value:t,children:(0,z.jsx)(YL.Provider,{value:n,children:r})})};QL.displayName=`JVR.ShowTools`;var $L={},eR=(0,m.createContext)($L),tR=(e,t)=>Y({},e,t),nR=()=>(0,m.useContext)(eR),rR=(0,m.createContext)(()=>{});rR.displayName=`JVR.DispatchExpands`;function iR(){return(0,m.useReducer)(tR,$L)}function aR(){return(0,m.useContext)(rR)}var oR=e=>{var{initial:t,dispatch:n,children:r}=e;return(0,z.jsx)(eR.Provider,{value:t,children:(0,z.jsx)(rR.Provider,{value:n,children:r})})};oR.displayName=`JVR.Expands`;var sR={Str:{as:`span`,"data-type":`string`,style:{color:`var(--w-rjv-type-string-color, #cb4b16)`},className:`w-rjv-type`,children:`string`},Url:{as:`a`,style:{color:`var(--w-rjv-type-url-color, #0969da)`},"data-type":`url`,className:`w-rjv-type`,children:`url`},Undefined:{style:{color:`var(--w-rjv-type-undefined-color, #586e75)`},as:`span`,"data-type":`undefined`,className:`w-rjv-type`,children:`undefined`},Null:{style:{color:`var(--w-rjv-type-null-color, #d33682)`},as:`span`,"data-type":`null`,className:`w-rjv-type`,children:`null`},Map:{style:{color:`var(--w-rjv-type-map-color, #268bd2)`,marginRight:3},as:`span`,"data-type":`map`,className:`w-rjv-type`,children:`Map`},Nan:{style:{color:`var(--w-rjv-type-nan-color, #859900)`},as:`span`,"data-type":`nan`,className:`w-rjv-type`,children:`NaN`},Bigint:{style:{color:`var(--w-rjv-type-bigint-color, #268bd2)`},as:`span`,"data-type":`bigint`,className:`w-rjv-type`,children:`bigint`},Int:{style:{color:`var(--w-rjv-type-int-color, #268bd2)`},as:`span`,"data-type":`int`,className:`w-rjv-type`,children:`int`},Set:{style:{color:`var(--w-rjv-type-set-color, #268bd2)`,marginRight:3},as:`span`,"data-type":`set`,className:`w-rjv-type`,children:`Set`},Float:{style:{color:`var(--w-rjv-type-float-color, #859900)`},as:`span`,"data-type":`float`,className:`w-rjv-type`,children:`float`},True:{style:{color:`var(--w-rjv-type-boolean-color, #2aa198)`},as:`span`,"data-type":`bool`,className:`w-rjv-type`,children:`bool`},False:{style:{color:`var(--w-rjv-type-boolean-color, #2aa198)`},as:`span`,"data-type":`bool`,className:`w-rjv-type`,children:`bool`},Date:{style:{color:`var(--w-rjv-type-date-color, #268bd2)`},as:`span`,"data-type":`date`,className:`w-rjv-type`,children:`date`}},cR=(0,m.createContext)(sR),lR=(e,t)=>Y({},e,t),uR=()=>(0,m.useContext)(cR),dR=(0,m.createContext)(()=>{});dR.displayName=`JVR.DispatchTypes`;function fR(){return(0,m.useReducer)(lR,sR)}function pR(){return(0,m.useContext)(dR)}function mR(e){var{initial:t,dispatch:n,children:r}=e;return(0,z.jsx)(cR.Provider,{value:t,children:(0,z.jsx)(dR.Provider,{value:n,children:r})})}mR.displayName=`JVR.Types`;var hR=[`style`];function gR(e){var{style:t}=e,n=WL(e,hR);return(0,z.jsx)(`svg`,Y({viewBox:`0 0 24 24`,fill:`var(--w-rjv-arrow-color, currentColor)`,style:Y({cursor:`pointer`,height:`1em`,width:`1em`,userSelect:`none`,display:`inline-flex`},t)},n,{children:(0,z.jsx)(`path`,{d:`M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z`})}))}gR.displayName=`JVR.TriangleArrow`;var _R={Arrow:{as:`span`,className:`w-rjv-arrow`,style:{transform:`rotate(0deg)`,transition:`all 0.3s`},children:(0,z.jsx)(gR,{})},Colon:{as:`span`,style:{color:`var(--w-rjv-colon-color, var(--w-rjv-color))`,marginLeft:0,marginRight:2},className:`w-rjv-colon`,children:`:`},Quote:{as:`span`,style:{color:`var(--w-rjv-quotes-color, #236a7c)`},className:`w-rjv-quotes`,children:`"`},ValueQuote:{as:`span`,style:{color:`var(--w-rjv-quotes-string-color, #cb4b16)`},className:`w-rjv-quotes`,children:`"`},BracketsLeft:{as:`span`,style:{color:`var(--w-rjv-brackets-color, #236a7c)`},className:`w-rjv-brackets-start`,children:`[`},BracketsRight:{as:`span`,style:{color:`var(--w-rjv-brackets-color, #236a7c)`},className:`w-rjv-brackets-end`,children:`]`},BraceLeft:{as:`span`,style:{color:`var(--w-rjv-curlybraces-color, #236a7c)`},className:`w-rjv-curlybraces-start`,children:`{`},BraceRight:{as:`span`,style:{color:`var(--w-rjv-curlybraces-color, #236a7c)`},className:`w-rjv-curlybraces-end`,children:`}`}},vR=(0,m.createContext)(_R),yR=(e,t)=>Y({},e,t),bR=()=>(0,m.useContext)(vR),xR=(0,m.createContext)(()=>{});xR.displayName=`JVR.DispatchSymbols`;function SR(){return(0,m.useReducer)(yR,_R)}function CR(){return(0,m.useContext)(xR)}var wR=e=>{var{initial:t,dispatch:n,children:r}=e;return(0,z.jsx)(vR.Provider,{value:t,children:(0,z.jsx)(xR.Provider,{value:n,children:r})})};wR.displayName=`JVR.Symbols`;var TR={Copied:{className:`w-rjv-copied`,style:{height:`1em`,width:`1em`,cursor:`pointer`,verticalAlign:`middle`,marginLeft:5}},CountInfo:{as:`span`,className:`w-rjv-object-size`,style:{color:`var(--w-rjv-info-color, #0000004d)`,paddingLeft:8,fontStyle:`italic`}},CountInfoExtra:{as:`span`,className:`w-rjv-object-extra`,style:{paddingLeft:8}},Ellipsis:{as:`span`,style:{cursor:`pointer`,color:`var(--w-rjv-ellipsis-color, #cb4b16)`,userSelect:`none`},className:`w-rjv-ellipsis`,children:`...`},Row:{as:`div`,className:`w-rjv-line`},KeyName:{as:`span`,className:`w-rjv-object-key`}},ER=(0,m.createContext)(TR),DR=(e,t)=>Y({},e,t),OR=()=>(0,m.useContext)(ER),kR=(0,m.createContext)(()=>{});kR.displayName=`JVR.DispatchSection`;function AR(){return(0,m.useReducer)(DR,TR)}function jR(){return(0,m.useContext)(kR)}var MR=e=>{var{initial:t,dispatch:n,children:r}=e;return(0,z.jsx)(ER.Provider,{value:t,children:(0,z.jsx)(kR.Provider,{value:n,children:r})})};MR.displayName=`JVR.Section`;var NR={objectSortKeys:!1,indentWidth:15},PR=(0,m.createContext)(NR);PR.displayName=`JVR.Context`;var FR=(0,m.createContext)(()=>{});FR.displayName=`JVR.DispatchContext`;function IR(e,t){return Y({},e,t)}var LR=()=>(0,m.useContext)(PR),RR=e=>{var{children:t,initialState:n,initialTypes:r}=e,[i,a]=(0,m.useReducer)(IR,Object.assign({},NR,n)),[o,s]=XL(),[c,l]=iR(),[u,d]=fR(),[f,p]=SR(),[h,g]=AR();return(0,m.useEffect)(()=>a(Y({},n)),[n]),(0,z.jsx)(PR.Provider,{value:i,children:(0,z.jsx)(FR.Provider,{value:a,children:(0,z.jsx)(QL,{initial:o,dispatch:s,children:(0,z.jsx)(oR,{initial:c,dispatch:l,children:(0,z.jsx)(mR,{initial:Y({},u,r),dispatch:d,children:(0,z.jsx)(wR,{initial:f,dispatch:p,children:(0,z.jsx)(MR,{initial:h,dispatch:g,children:t})})})})})})})};RR.displayName=`JVR.Provider`;function zR(e){if(e==null)throw TypeError(`Cannot destructure `+e)}var BR=[`isNumber`,`value`,`parentValue`,`keyName`,`keys`],VR=[`as`,`render`],HR=[`as`,`render`],UR=[`as`,`render`],WR=[`as`,`style`,`render`],GR=[`as`,`render`],KR=[`as`,`render`],qR=[`as`,`render`],JR=[`as`,`render`],YR=e=>{var{Quote:t={}}=bR(),{isNumber:n,value:r,parentValue:i,keyName:a,keys:o}=e,s=WL(e,BR);if(n)return null;var{as:c,render:l}=t,u=WL(t,VR),d=c||`span`,f=Y({},s,u);return typeof f.children==`string`&&(f.children=f.children.trim()||void 0),l&&typeof l==`function`&&l(f,{value:r,parentValue:i,keyName:a,keys:o||(a?[a]:[])})||(0,z.jsx)(d,Y({},f))};YR.displayName=`JVR.Quote`;var XR=e=>{var{ValueQuote:t={}}=bR(),n=Y({},(zR(e),e)),{as:r,render:i}=t,a=WL(t,HR),o=r||`span`,s=Y({},n,a);return i&&typeof i==`function`&&i(s,{})||(0,z.jsx)(o,Y({},s))};XR.displayName=`JVR.ValueQuote`;var ZR=e=>{var{value:t,parentValue:n,keyName:r,keys:i}=e,{Colon:a={}}=bR(),{as:o,render:s}=a,c=WL(a,UR),l=o||`span`;return s&&typeof s==`function`&&s(c,{value:t,parentValue:n,keyName:r,keys:i||(r?[r]:[])})||(0,z.jsx)(l,Y({},c))};ZR.displayName=`JVR.Colon`;var QR=e=>{var{Arrow:t={}}=bR(),n=nR(),{expandKey:r,style:i,value:a,parentValue:o,keyName:s,keys:c}=e,l=!!n[r],{as:u,style:d,render:f}=t,p=WL(t,WR),m=u||`span`,h=f&&typeof f==`function`,g=Y({},p,{"data-expanded":l,style:Y({},d,i)});return h&&f(g,{value:a,parentValue:o,keyName:s,keys:c||(s?[s]:[])})||(0,z.jsx)(m,Y({},p,{style:Y({},d,i)}))};QR.displayName=`JVR.Arrow`;var $R=e=>{var{isBrackets:t,value:n,parentValue:r,keyName:i,keys:a}=e,{BracketsLeft:o={},BraceLeft:s={}}=bR(),c={value:n,parentValue:r,keyName:i,keys:a||(i?[i]:[])};if(t){var{as:l,render:u}=o,d=WL(o,GR),f=l||`span`;return u&&typeof u==`function`&&u(d,c)||(0,z.jsx)(f,Y({},d))}var{as:p,render:m}=s,h=WL(s,KR),g=p||`span`;return m&&typeof m==`function`&&m(h,c)||(0,z.jsx)(g,Y({},h))};$R.displayName=`JVR.BracketsOpen`;var ez=e=>{var{isBrackets:t,isVisiable:n,value:r,parentValue:i,keyName:a,keys:o}=e,s={value:r,parentValue:i,keyName:a,keys:o||(a?[a]:[])};if(!n)return null;var{BracketsRight:c={},BraceRight:l={}}=bR();if(t){var{as:u,render:d}=c,f=WL(c,qR),p=u||`span`;return d&&typeof d==`function`&&d(f,s)||(0,z.jsx)(p,Y({},f))}var{as:m,render:h}=l,g=WL(l,JR),_=m||`span`;return h&&typeof h==`function`&&h(g,s)||(0,z.jsx)(_,Y({},g))};ez.displayName=`JVR.BracketsClose`;var tz=e=>{var{keyName:t,value:n,expandKey:r,parentValue:i,level:a,keys:o=[]}=e,s=nR(),{collapsed:c,shouldExpandNodeInitially:l}=LR(),u=typeof c==`boolean`?c:typeof c==`number`?a>c:!1,d=s[r]??(l?!1:u),f=l&&l(!d,{value:n,keys:o,level:a,keyName:t,parentValue:i});if(l&&c===!1){if(s[r]===void 0&&!f)return null}else if(s[r]===void 0&&f)return null;var p=Object.keys(n).length;if(d||p===0)return null;var m={paddingLeft:4},h={keyName:t,value:n,keys:o,parentValue:i},g=Array.isArray(n),_=n instanceof Set;return(0,z.jsx)(`div`,{style:m,children:(0,z.jsx)(ez,Y({isBrackets:g||_},h,{isVisiable:!0}))})};tz.displayName=`JVR.NestedClose`;var nz=[`as`,`render`],rz=[`as`,`render`],iz=[`as`,`render`],az=[`as`,`render`],oz=[`as`,`render`],sz=[`as`,`render`],cz=[`as`,`render`],lz=[`as`,`render`],uz=[`as`,`render`],dz=[`as`,`render`],fz=[`as`,`render`],pz=[`as`,`render`],mz=[`as`,`render`],hz=e=>{if(e===void 0)return`0n`;if(typeof e==`string`)try{e=BigInt(e)}catch{return`0n`}return e?e.toString()+`n`:`0n`},gz=e=>{var{value:t,keyName:n}=e,{Set:r={},displayDataTypes:i}=uR();if(!(t instanceof Set)||!i)return null;var{as:a,render:o}=r,s=WL(r,nz);return o&&typeof o==`function`&&o(s,{type:`type`,value:t,keyName:n})||(0,z.jsx)(a||`span`,Y({},s))};gz.displayName=`JVR.SetComp`;var _z=e=>{var{value:t,keyName:n}=e,{Map:r={},displayDataTypes:i}=uR();if(!(t instanceof Map)||!i)return null;var{as:a,render:o}=r,s=WL(r,rz);return o&&typeof o==`function`&&o(s,{type:`type`,value:t,keyName:n})||(0,z.jsx)(a||`span`,Y({},s))};_z.displayName=`JVR.MapComp`;var vz={opacity:.75,paddingRight:4},yz=e=>{var{children:t=``,keyName:n,keys:r}=e,{Str:i={},displayDataTypes:a}=uR(),{shortenTextAfterLength:o=30,stringEllipsis:s=`...`}=LR(),{as:c,render:l}=i,u=WL(i,iz),d=t,[f,p]=(0,m.useState)(o&&d.length>o);(0,m.useEffect)(()=>p(o&&d.length>o),[o]);var h=c||`span`,g=Y({},vz,i.style||{});o>0&&(u.style=Y({},u.style,{cursor:d.length<=o?`initial`:`pointer`}),d.length>o&&(u.onClick=()=>{p(!f)}));var _=f?``+d.slice(0,o)+s:d,v=l&&typeof l==`function`,y=v&&l(Y({},u,{style:g}),{type:`type`,value:t,keyName:n,keys:r}),b=f?`w-rjv-value w-rjv-value-short`:`w-rjv-value`,x=v&&l(Y({},u,{children:_,className:b}),{type:`value`,value:t,keyName:n,keys:r});return(0,z.jsxs)(m.Fragment,{children:[a&&(y||(0,z.jsx)(h,Y({},u,{style:g}))),x||(0,z.jsxs)(m.Fragment,{children:[(0,z.jsx)(XR,{}),(0,z.jsx)(h,Y({},u,{className:b,children:_})),(0,z.jsx)(XR,{})]})]})};yz.displayName=`JVR.TypeString`;var bz=e=>{var{children:t,keyName:n,keys:r}=e,{True:i={},displayDataTypes:a}=uR(),{as:o,render:s}=i,c=WL(i,az),l=o||`span`,u=Y({},vz,i.style||{}),d=s&&typeof s==`function`,f=d&&s(Y({},c,{style:u}),{type:`type`,value:t,keyName:n,keys:r}),p=d&&s(Y({},c,{children:t,className:`w-rjv-value`}),{type:`value`,value:t,keyName:n,keys:r});return(0,z.jsxs)(m.Fragment,{children:[a&&(f||(0,z.jsx)(l,Y({},c,{style:u}))),p||(0,z.jsx)(l,Y({},c,{className:`w-rjv-value`,children:t?.toString()}))]})};bz.displayName=`JVR.TypeTrue`;var xz=e=>{var{children:t,keyName:n,keys:r}=e,{False:i={},displayDataTypes:a}=uR(),{as:o,render:s}=i,c=WL(i,oz),l=o||`span`,u=Y({},vz,i.style||{}),d=s&&typeof s==`function`,f=d&&s(Y({},c,{style:u}),{type:`type`,value:t,keyName:n,keys:r}),p=d&&s(Y({},c,{children:t,className:`w-rjv-value`}),{type:`value`,value:t,keyName:n,keys:r});return(0,z.jsxs)(m.Fragment,{children:[a&&(f||(0,z.jsx)(l,Y({},c,{style:u}))),p||(0,z.jsx)(l,Y({},c,{className:`w-rjv-value`,children:t?.toString()}))]})};xz.displayName=`JVR.TypeFalse`;var Sz=e=>{var{children:t,keyName:n,keys:r}=e,{Float:i={},displayDataTypes:a}=uR(),{as:o,render:s}=i,c=WL(i,sz),l=o||`span`,u=Y({},vz,i.style||{}),d=s&&typeof s==`function`,f=d&&s(Y({},c,{style:u}),{type:`type`,value:t,keyName:n,keys:r}),p=d&&s(Y({},c,{children:t,className:`w-rjv-value`}),{type:`value`,value:t,keyName:n,keys:r});return(0,z.jsxs)(m.Fragment,{children:[a&&(f||(0,z.jsx)(l,Y({},c,{style:u}))),p||(0,z.jsx)(l,Y({},c,{className:`w-rjv-value`,children:t?.toString()}))]})};Sz.displayName=`JVR.TypeFloat`;var Cz=e=>{var{children:t,keyName:n,keys:r}=e,{Int:i={},displayDataTypes:a}=uR(),{as:o,render:s}=i,c=WL(i,cz),l=o||`span`,u=Y({},vz,i.style||{}),d=s&&typeof s==`function`,f=d&&s(Y({},c,{style:u}),{type:`type`,value:t,keyName:n,keys:r}),p=d&&s(Y({},c,{children:t,className:`w-rjv-value`}),{type:`value`,value:t,keyName:n,keys:r});return(0,z.jsxs)(m.Fragment,{children:[a&&(f||(0,z.jsx)(l,Y({},c,{style:u}))),p||(0,z.jsx)(l,Y({},c,{className:`w-rjv-value`,children:t?.toString()}))]})};Cz.displayName=`JVR.TypeInt`;var wz=e=>{var{children:t,keyName:n,keys:r}=e,{Bigint:i={},displayDataTypes:a}=uR(),{as:o,render:s}=i,c=WL(i,lz),l=o||`span`,u=Y({},vz,i.style||{}),d=s&&typeof s==`function`,f=d&&s(Y({},c,{style:u}),{type:`type`,value:t,keyName:n,keys:r}),p=d&&s(Y({},c,{children:t,className:`w-rjv-value`}),{type:`value`,value:t,keyName:n,keys:r});return(0,z.jsxs)(m.Fragment,{children:[a&&(f||(0,z.jsx)(l,Y({},c,{style:u}))),p||(0,z.jsx)(l,Y({},c,{className:`w-rjv-value`,children:hz(t?.toString())}))]})};wz.displayName=`JVR.TypeFloat`;var Tz=e=>{var{children:t,keyName:n,keys:r}=e,{Url:i={},displayDataTypes:a}=uR(),{as:o,render:s}=i,c=WL(i,uz),l=o||`span`,u=Y({},vz,i.style),d=s&&typeof s==`function`,f=d&&s(Y({},c,{style:u}),{type:`type`,value:t,keyName:n,keys:r}),p=d&&s(Y({},c,{children:t?.href,className:`w-rjv-value`}),{type:`value`,value:t,keyName:n,keys:r});return(0,z.jsxs)(m.Fragment,{children:[a&&(f||(0,z.jsx)(l,Y({},c,{style:u}))),p||(0,z.jsxs)(`a`,Y({href:t?.href,target:`_blank`},c,{className:`w-rjv-value`,children:[(0,z.jsx)(XR,{}),t?.href,(0,z.jsx)(XR,{})]}))]})};Tz.displayName=`JVR.TypeUrl`;var Ez=e=>{var{children:t,keyName:n,keys:r}=e,{Date:i={},displayDataTypes:a}=uR(),{as:o,render:s}=i,c=WL(i,dz),l=o||`span`,u=Y({},vz,i.style||{}),d=s&&typeof s==`function`,f=d&&s(Y({},c,{style:u}),{type:`type`,value:t,keyName:n,keys:r}),p=t instanceof Date?t.toLocaleString():t,h=d&&s(Y({},c,{children:p,className:`w-rjv-value`}),{type:`value`,value:t,keyName:n,keys:r});return(0,z.jsxs)(m.Fragment,{children:[a&&(f||(0,z.jsx)(l,Y({},c,{style:u}))),h||(0,z.jsx)(l,Y({},c,{className:`w-rjv-value`,children:p}))]})};Ez.displayName=`JVR.TypeDate`;var Dz=e=>{var{children:t,keyName:n,keys:r}=e,{Undefined:i={},displayDataTypes:a}=uR(),{as:o,render:s}=i,c=WL(i,fz),l=o||`span`,u=Y({},vz,i.style||{}),d=s&&typeof s==`function`,f=d&&s(Y({},c,{style:u}),{type:`type`,value:t,keyName:n,keys:r}),p=d&&s(Y({},c,{children:t,className:`w-rjv-value`}),{type:`value`,value:t,keyName:n,keys:r});return(0,z.jsxs)(m.Fragment,{children:[a&&(f||(0,z.jsx)(l,Y({},c,{style:u}))),p]})};Dz.displayName=`JVR.TypeUndefined`;var Oz=e=>{var{children:t,keyName:n,keys:r}=e,{Null:i={},displayDataTypes:a}=uR(),{as:o,render:s}=i,c=WL(i,pz),l=o||`span`,u=Y({},vz,i.style||{}),d=s&&typeof s==`function`,f=d&&s(Y({},c,{style:u}),{type:`type`,value:t,keyName:n,keys:r}),p=d&&s(Y({},c,{children:t,className:`w-rjv-value`}),{type:`value`,value:t,keyName:n,keys:r});return(0,z.jsxs)(m.Fragment,{children:[a&&(f||(0,z.jsx)(l,Y({},c,{style:u}))),p]})};Oz.displayName=`JVR.TypeNull`;var kz=e=>{var{children:t,keyName:n,keys:r}=e,{Nan:i={},displayDataTypes:a}=uR(),{as:o,render:s}=i,c=WL(i,mz),l=o||`span`,u=Y({},vz,i.style||{}),d=s&&typeof s==`function`,f=d&&s(Y({},c,{style:u}),{type:`type`,value:t,keyName:n,keys:r}),p=d&&s(Y({},c,{children:t?.toString(),className:`w-rjv-value`}),{type:`value`,value:t,keyName:n,keys:r});return(0,z.jsxs)(m.Fragment,{children:[a&&(f||(0,z.jsx)(l,Y({},c,{style:u}))),p]})};kz.displayName=`JVR.TypeNan`;var mie=e=>Number(e)===e&&e%1!=0||isNaN(e),Az=e=>{var{value:t,keyName:n,keys:r}=e,i={keyName:n,keys:r};return t instanceof URL?(0,z.jsx)(Tz,Y({},i,{children:t})):typeof t==`string`?(0,z.jsx)(yz,Y({},i,{children:t})):t===!0?(0,z.jsx)(bz,Y({},i,{children:t})):t===!1?(0,z.jsx)(xz,Y({},i,{children:t})):t===null?(0,z.jsx)(Oz,Y({},i,{children:t})):t===void 0?(0,z.jsx)(Dz,Y({},i,{children:t})):t instanceof Date?(0,z.jsx)(Ez,Y({},i,{children:t})):typeof t==`number`&&isNaN(t)?(0,z.jsx)(kz,Y({},i,{children:t})):typeof t==`number`&&mie(t)?(0,z.jsx)(Sz,Y({},i,{children:t})):typeof t==`bigint`?(0,z.jsx)(wz,Y({},i,{children:t})):typeof t==`number`?(0,z.jsx)(Cz,Y({},i,{children:t})):null};Az.displayName=`JVR.Value`;function jz(e,t,n){var r=CR(),i=Y({},e,t,{className:[e.className,t.className].filter(Boolean).join(` `),style:Y({},e.style,t.style),children:t.children||e.children});(0,m.useEffect)(()=>r({[n]:i}),[t])}function Mz(e,t,n){var r=pR(),i=Y({},e,t,{className:[e.className,t.className].filter(Boolean).join(` `),style:Y({},e.style,t.style),children:t.children||e.children});(0,m.useEffect)(()=>r({[n]:i}),[t])}function Nz(e,t,n){var r=jR(),i=Y({},e,t,{className:[e.className,t.className].filter(Boolean).join(` `),style:Y({},e.style,t.style),children:t.children||e.children});(0,m.useEffect)(()=>r({[n]:i}),[t])}var hie=[`as`,`render`],Pz=e=>{var{KeyName:t={}}=OR();return Nz(t,e,`KeyName`),null};Pz.displayName=`JVR.KeyName`;var Fz=e=>{var{children:t,value:n,parentValue:r,keyName:i,keys:a}=e,o={color:typeof t==`number`?`var(--w-rjv-key-number, #268bd2)`:`var(--w-rjv-key-string, #002b36)`},{KeyName:s={}}=OR(),{as:c,render:l}=s,u=WL(s,hie);u.style=Y({},u.style,o);var d=c||`span`;return l&&typeof l==`function`&&l(Y({},u,{children:t}),{value:n,parentValue:r,keyName:i,keys:a||(i?[i]:[])})||(0,z.jsx)(d,Y({},u,{children:t}))};Fz.displayName=`JVR.KeyNameComp`;var gie=[`children`,`value`,`parentValue`,`keyName`,`keys`],_ie=[`as`,`render`,`children`],Iz=e=>{var{Row:t={}}=OR();return Nz(t,e,`Row`),null};Iz.displayName=`JVR.Row`;var Lz=e=>{var{children:t,value:n,parentValue:r,keyName:i,keys:a}=e,o=WL(e,gie),{Row:s={}}=OR(),{as:c,render:l}=s,u=WL(s,_ie),d=c||`div`;return l&&typeof l==`function`&&l(Y({},o,u,{children:t}),{value:n,keyName:i,parentValue:r,keys:a})||(0,z.jsx)(d,Y({},o,u,{children:t}))};Lz.displayName=`JVR.RowComp`;function vie(e){var t=(0,m.useRef)();return(0,m.useEffect)(()=>{t.current=e}),t.current}function yie(e){var{value:t,highlightUpdates:n,highlightContainer:r}=e,i=vie(t),a=(0,m.useMemo)(()=>{if(!n||i===void 0)return!1;if(typeof t!=typeof i)return!0;if(typeof t==`number`)return isNaN(t)&&isNaN(i)?!1:t!==i;if(Array.isArray(t)!==Array.isArray(i))return!0;if(typeof t==`object`||typeof t==`function`)return!1;if(t!==i)return!0},[n,t]);(0,m.useEffect)(()=>{r&&r.current&&a&&`animate`in r.current&&r.current.animate([{backgroundColor:`var(--w-rjv-update-color, #ebcb8b)`},{backgroundColor:``}],{duration:1e3,easing:`ease-in`})},[a,t,r])}var bie=[`keyName`,`value`,`parentValue`,`expandKey`,`keys`,`beforeCopy`],xie=[`as`,`render`],Rz=e=>{var{keyName:t,value:n,parentValue:r,expandKey:i,keys:a,beforeCopy:o}=e,s=WL(e,bie),{onCopied:c,enableClipboard:l,beforeCopy:u}=LR(),d=JL()[i],[f,p]=(0,m.useState)(!1),{Copied:h={}}=OR(),g=h?.beforeCopy;if(l===!1||!d)return null;var _={style:{display:`inline-flex`},fill:f?`var(--w-rjv-copied-success-color, #28a745)`:`var(--w-rjv-copied-color, currentColor)`,onClick:e=>{e.stopPropagation();var s=``;s=typeof n==`number`&&n===1/0?`Infinity`:typeof n==`number`&&isNaN(n)?`NaN`:typeof n==`bigint`?hz(n):n instanceof Date?n.toLocaleString():JSON.stringify(n,(e,t)=>typeof t==`bigint`?hz(t):t,2);var l=o||g||u;l&&typeof l==`function`&&(s=l(s,t,n,r,i,a)),c&&c(s,n),p(!0),(navigator.clipboard||{writeText(e){return new Promise((t,n)=>{var r=document.createElement(`textarea`);r.style.position=`absolute`,r.style.opacity=`0`,r.style.left=`-99999999px`,r.value=e,document.body.appendChild(r),r.select(),document.execCommand(`copy`)?t():n(),r.remove()})}}).writeText(s).then(()=>{var e=setTimeout(()=>{p(!1),clearTimeout(e)},3e3)}).catch(e=>{})}},{render:v}=h,y=WL(h,xie),b=Y({},y,s,_,{style:Y({},y.style,s.style,_.style)});return v&&typeof v==`function`&&v(Y({},b,{"data-copied":f}),{value:n,keyName:t,keys:a,parentValue:r})||(f?(0,z.jsx)(`svg`,Y({viewBox:`0 0 32 36`},b,{children:(0,z.jsx)(`path`,{d:`M27.5,33 L2.5,33 L2.5,12.5 L27.5,12.5 L27.5,15.2249049 C29.1403264,13.8627542 29.9736597,13.1778155 30,13.1700887 C30,11.9705278 30,10.0804982 30,7.5 C30,6.1 28.9,5 27.5,5 L20,5 C20,2.2 17.8,0 15,0 C12.2,0 10,2.2 10,5 L2.5,5 C1.1,5 0,6.1 0,7.5 L0,33 C0,34.4 1.1,36 2.5,36 L27.5,36 C28.9,36 30,34.4 30,33 L30,26.1114493 L27.5,28.4926435 L27.5,33 Z M7.5,7.5 L10,7.5 C10,7.5 12.5,6.4 12.5,5 C12.5,3.6 13.6,2.5 15,2.5 C16.4,2.5 17.5,3.6 17.5,5 C17.5,6.4 18.8,7.5 20,7.5 L22.5,7.5 C22.5,7.5 25,8.6 25,10 L5,10 C5,8.5 6.1,7.5 7.5,7.5 Z M5,27.5 L10,27.5 L10,25 L5,25 L5,27.5 Z M28.5589286,16 L32,19.6 L21.0160714,30.5382252 L13.5303571,24.2571429 L17.1303571,20.6571429 L21.0160714,24.5428571 L28.5589286,16 Z M17.5,15 L5,15 L5,17.5 L17.5,17.5 L17.5,15 Z M10,20 L5,20 L5,22.5 L10,22.5 L10,20 Z`})})):(0,z.jsx)(`svg`,Y({viewBox:`0 0 32 36`},b,{children:(0,z.jsx)(`path`,{d:`M27.5,33 L2.5,33 L2.5,12.5 L27.5,12.5 L27.5,20 L30,20 L30,7.5 C30,6.1 28.9,5 27.5,5 L20,5 C20,2.2 17.8,0 15,0 C12.2,0 10,2.2 10,5 L2.5,5 C1.1,5 0,6.1 0,7.5 L0,33 C0,34.4 1.1,36 2.5,36 L27.5,36 C28.9,36 30,34.4 30,33 L30,29 L27.5,29 L27.5,33 Z M7.5,7.5 L10,7.5 C10,7.5 12.5,6.4 12.5,5 C12.5,3.6 13.6,2.5 15,2.5 C16.4,2.5 17.5,3.6 17.5,5 C17.5,6.4 18.8,7.5 20,7.5 L22.5,7.5 C22.5,7.5 25,8.6 25,10 L5,10 C5,8.5 6.1,7.5 7.5,7.5 Z M5,27.5 L10,27.5 L10,25 L5,25 L5,27.5 Z M22.5,21.5 L22.5,16.5 L12.5,24 L22.5,31.5 L22.5,26.5 L32,26.5 L32,21.5 L22.5,21.5 Z M17.5,15 L5,15 L5,17.5 L17.5,17.5 L17.5,15 Z M10,20 L5,20 L5,22.5 L10,22.5 L10,20 Z`})})))};Rz.displayName=`JVR.Copied`;function zz(){var e=(0,m.useRef)(null);return e.current===null&&(e.current=`custom-id-`+Math.random().toString(36).substr(2,9)),e.current}var Bz=e=>{var{keyName:t,value:n,expandKey:r=``,level:i,keys:a=[],parentValue:o}=e,s=nR(),{objectSortKeys:c,indentWidth:l,collapsed:u,shouldExpandNodeInitially:d}=LR(),f=typeof u==`boolean`?u:typeof u==`number`?i>u:!1,p=s[r]??(d?!1:f),m=d&&d(!p,{value:n,keys:a,level:i,keyName:t,parentValue:o});if(d&&u===!1){if(s[r]===void 0&&!m)return null}else if(s[r]===void 0&&m)return null;if(p)return null;var h=Array.isArray(n)?Object.entries(n).map(e=>[Number(e[0]),e[1]]):Object.entries(n);return c&&(h=c===!0?h.sort((e,t)=>{var[n]=e,[r]=t;return typeof n==`string`&&typeof r==`string`?n.localeCompare(r):0}):h.sort((e,t)=>{var[n,r]=e,[i,a]=t;return typeof n==`string`&&typeof i==`string`?c(n,i,r,a):0})),(0,z.jsx)(`div`,{className:`w-rjv-wrap`,style:{borderLeft:`var(--w-rjv-border-left-width, 1px) var(--w-rjv-line-style, solid) var(--w-rjv-line-color, #ebebeb)`,paddingLeft:l,marginLeft:6},children:h.map((e,t)=>{var[r,o]=e;return(0,z.jsx)(Hz,{parentValue:n,keyName:r,keys:[...a,r],value:o,level:i},t)})})};Bz.displayName=`JVR.KeyValues`;var Vz=e=>{var{keyName:t,parentValue:n,keys:r,value:i}=e,{highlightUpdates:a}=LR(),o=typeof t==`number`,s=(0,m.useRef)(null);yie({value:i,highlightUpdates:a,highlightContainer:s});var c={keyName:t,value:i,keys:r,parentValue:n};return(0,z.jsxs)(m.Fragment,{children:[(0,z.jsxs)(`span`,{ref:s,children:[(0,z.jsx)(YR,Y({isNumber:o,"data-placement":`left`},c)),(0,z.jsx)(Fz,Y({},c,{children:t})),(0,z.jsx)(YR,Y({isNumber:o,"data-placement":`right`},c))]}),(0,z.jsx)(ZR,Y({},c))]})};Vz.displayName=`JVR.KayName`;var Hz=e=>{var{keyName:t,value:n,parentValue:r,level:i=0,keys:a=[]}=e,o=ZL(),s=zz(),c=Array.isArray(n),l=n instanceof Set,u=n instanceof Map,d=n instanceof Date,f=n instanceof URL;return n&&typeof n==`object`&&!c&&!l&&!u&&!d&&!f||c||l||u?(0,z.jsx)(Xz,{keyName:t,value:l?Array.from(n):u?Object.fromEntries(n):n,parentValue:r,initialValue:n,keys:a,level:i+1}):(0,z.jsxs)(Lz,Y({className:`w-rjv-line`,value:n,keyName:t,keys:a,parentValue:r},{onMouseEnter:()=>o({[s]:!0}),onMouseLeave:()=>o({[s]:!1})},{children:[(0,z.jsx)(Vz,{keyName:t,value:n,keys:a,parentValue:r}),(0,z.jsx)(Az,{keyName:t,value:n,keys:a}),(0,z.jsx)(Rz,{keyName:t,value:n,keys:a,parentValue:r,expandKey:s})]}))};Hz.displayName=`JVR.KeyValuesItem`;var Sie=[`value`,`keyName`],Cie=[`as`,`render`],Uz=e=>{var{CountInfoExtra:t={}}=OR();return Nz(t,e,`CountInfoExtra`),null};Uz.displayName=`JVR.CountInfoExtra`;var Wz=e=>{var{value:t={},keyName:n}=e,r=WL(e,Sie),{CountInfoExtra:i={}}=OR(),{as:a,render:o}=i,s=WL(i,Cie);if(!o&&!s.children)return null;var c=a||`span`,l=o&&typeof o==`function`,u=Y({},s,r);return l&&o(u,{value:t,keyName:n})||(0,z.jsx)(c,Y({},u))};Wz.displayName=`JVR.CountInfoExtraComps`;var wie=[`value`,`keyName`],Tie=[`as`,`render`],Gz=e=>{var{CountInfo:t={}}=OR();return Nz(t,e,`CountInfo`),null};Gz.displayName=`JVR.CountInfo`;var Kz=e=>{var{value:t={},keyName:n}=e,r=WL(e,wie),{displayObjectSize:i}=LR(),{CountInfo:a={}}=OR();if(!i)return null;var{as:o,render:s}=a,c=WL(a,Tie),l=o||`span`;c.style=Y({},c.style,e.style);var u=Object.keys(t).length;c.children||=u+` item`+(u===1?``:`s`);var d=Y({},c,r);return s&&typeof s==`function`&&s(Y({},d,{"data-length":u}),{value:t,keyName:n})||(0,z.jsx)(l,Y({},d))};Kz.displayName=`JVR.CountInfoComp`;var Eie=[`as`,`render`],qz=e=>{var{Ellipsis:t={}}=OR();return Nz(t,e,`Ellipsis`),null};qz.displayName=`JVR.Ellipsis`;var Jz=e=>{var{isExpanded:t,value:n,keyName:r}=e,{Ellipsis:i={}}=OR(),{as:a,render:o}=i,s=WL(i,Eie),c=a||`span`;return o&&typeof o==`function`&&o(Y({},s,{"data-expanded":t}),{value:n,keyName:r})||(!t||typeof n==`object`&&Object.keys(n).length==0?null:(0,z.jsx)(c,Y({},s)))};Jz.displayName=`JVR.EllipsisComp`;var Yz=e=>{var{keyName:t,expandKey:n,keys:r=[],initialValue:i,value:a,parentValue:o,level:s}=e,c=nR(),l=aR(),{onExpand:u,collapsed:d,shouldExpandNodeInitially:f}=LR(),p=typeof d==`boolean`?d:typeof d==`number`?s>d:!1,m=c[n]??(f?!1:p),h=f&&f(!m,{value:a,keys:r,level:s,keyName:t,parentValue:o});c[n]===void 0&&f&&(m=!h);var g=()=>{var e={expand:!m,value:a,keyid:n,keyName:t};u&&u(e),l({[n]:e.expand})},_={display:`inline-flex`,alignItems:`center`},v={transform:`rotate(`+(m?`-90`:`0`)+`deg)`,transition:`all 0.3s`},y=Object.keys(a).length,b=typeof a==`object`,x=Array.isArray(a),S=a instanceof Set,C=y!==0&&(x||S||b),w={style:_};C&&(w.onClick=g);var T={keyName:t,value:a,keys:r,parentValue:o};return(0,z.jsxs)(`span`,Y({},w,{children:[C&&(0,z.jsx)(QR,Y({style:v,expandKey:n},T)),(t||typeof t==`number`)&&(0,z.jsx)(Vz,Y({},T)),(0,z.jsx)(gz,{value:i,keyName:t}),(0,z.jsx)(_z,{value:i,keyName:t}),(0,z.jsx)($R,Y({isBrackets:x||S},T)),(0,z.jsx)(Jz,{keyName:t,value:a,isExpanded:m}),(0,z.jsx)(ez,Y({isVisiable:m||!C,isBrackets:x||S},T)),(0,z.jsx)(Kz,{value:a,keyName:t}),(0,z.jsx)(Wz,{value:a,keyName:t}),(0,z.jsx)(Rz,{keyName:t,value:a,expandKey:n,parentValue:o,keys:r})]}))};Yz.displayName=`JVR.NestedOpen`;var Die=[`className`,`children`,`parentValue`,`keyid`,`level`,`value`,`initialValue`,`keys`,`keyName`],Xz=(0,m.forwardRef)((e,t)=>{var{className:n=``,parentValue:r,level:i=1,value:a,initialValue:o,keys:s,keyName:c}=e,l=WL(e,Die),u=ZL(),d=zz();return(0,z.jsxs)(`div`,Y({className:[n,`w-rjv-inner`].filter(Boolean).join(` `),ref:t},l,{onMouseEnter:()=>u({[d]:!0}),onMouseLeave:()=>u({[d]:!1})},{children:[(0,z.jsx)(Yz,{expandKey:d,value:a,level:i,keys:s,parentValue:r,keyName:c,initialValue:o}),(0,z.jsx)(Bz,{expandKey:d,value:a,level:i,keys:s,parentValue:r,keyName:c}),(0,z.jsx)(tz,{expandKey:d,value:a,level:i,keys:s,parentValue:r,keyName:c})]}))});Xz.displayName=`JVR.Container`;var Zz=e=>{var{BraceLeft:t={}}=bR();return jz(t,e,`BraceLeft`),null};Zz.displayName=`JVR.BraceLeft`;var Qz=e=>{var{BraceRight:t={}}=bR();return jz(t,e,`BraceRight`),null};Qz.displayName=`JVR.BraceRight`;var $z=e=>{var{BracketsLeft:t={}}=bR();return jz(t,e,`BracketsLeft`),null};$z.displayName=`JVR.BracketsLeft`;var eB=e=>{var{BracketsRight:t={}}=bR();return jz(t,e,`BracketsRight`),null};eB.displayName=`JVR.BracketsRight`;var tB=e=>{var{Arrow:t={}}=bR();return jz(t,e,`Arrow`),null};tB.displayName=`JVR.Arrow`;var nB=e=>{var{Colon:t={}}=bR();return jz(t,e,`Colon`),null};nB.displayName=`JVR.Colon`;var rB=e=>{var{Quote:t={}}=bR();return jz(t,e,`Quote`),null};rB.displayName=`JVR.Quote`;var iB=e=>{var{ValueQuote:t={}}=bR();return jz(t,e,`ValueQuote`),null};iB.displayName=`JVR.ValueQuote`;var aB=e=>{var{Bigint:t={}}=uR();return Mz(t,e,`Bigint`),null};aB.displayName=`JVR.Bigint`;var oB=e=>{var{Date:t={}}=uR();return Mz(t,e,`Date`),null};oB.displayName=`JVR.Date`;var sB=e=>{var{False:t={}}=uR();return Mz(t,e,`False`),null};sB.displayName=`JVR.False`;var cB=e=>{var{Float:t={}}=uR();return Mz(t,e,`Float`),null};cB.displayName=`JVR.Float`;var lB=e=>{var{Int:t={}}=uR();return Mz(t,e,`Int`),null};lB.displayName=`JVR.Int`;var uB=e=>{var{Map:t={}}=uR();return Mz(t,e,`Map`),null};uB.displayName=`JVR.Map`;var dB=e=>{var{Nan:t={}}=uR();return Mz(t,e,`Nan`),null};dB.displayName=`JVR.Nan`;var fB=e=>{var{Null:t={}}=uR();return Mz(t,e,`Null`),null};fB.displayName=`JVR.Null`;var pB=e=>{var{Set:t={}}=uR();return Mz(t,e,`Set`),null};pB.displayName=`JVR.Set`;var mB=e=>{var{Str:t={}}=uR();return Mz(t,e,`Str`),null};mB.displayName=`JVR.StringText`;var hB=e=>{var{True:t={}}=uR();return Mz(t,e,`True`),null};hB.displayName=`JVR.True`;var gB=e=>{var{Undefined:t={}}=uR();return Mz(t,e,`Undefined`),null};gB.displayName=`JVR.Undefined`;var _B=e=>{var{Url:t={}}=uR();return Mz(t,e,`Url`),null};_B.displayName=`JVR.Url`;var vB=e=>{var{Copied:t={}}=OR();return Nz(t,e,`Copied`),null};vB.displayName=`JVR.Copied`;var Oie=[`className`,`style`,`value`,`children`,`collapsed`,`shouldExpandNodeInitially`,`indentWidth`,`displayObjectSize`,`shortenTextAfterLength`,`stringEllipsis`,`highlightUpdates`,`enableClipboard`,`displayDataTypes`,`objectSortKeys`,`onExpand`,`onCopied`,`beforeCopy`],yB=(0,m.forwardRef)((e,t)=>{var{className:n=``,style:r,value:i,children:a,collapsed:o=!1,shouldExpandNodeInitially:s,indentWidth:c=15,displayObjectSize:l=!0,shortenTextAfterLength:u=30,stringEllipsis:d,highlightUpdates:f=!0,enableClipboard:p=!0,displayDataTypes:m=!0,objectSortKeys:h=!1,onExpand:g,onCopied:_,beforeCopy:v}=e,y=WL(e,Oie),b=Y({lineHeight:1.4,fontFamily:`var(--w-rjv-font-family, Menlo, monospace)`,color:`var(--w-rjv-color, #002b36)`,backgroundColor:`var(--w-rjv-background-color, #00000000)`,fontSize:13},r),x=[`w-json-view-container`,`w-rjv`,n].filter(Boolean).join(` `);return(0,z.jsxs)(RR,{initialState:{value:i,objectSortKeys:h,indentWidth:c,shouldExpandNodeInitially:o===!1?s:void 0,displayObjectSize:l,collapsed:o,enableClipboard:p,shortenTextAfterLength:u,stringEllipsis:d,highlightUpdates:f,onCopied:_,onExpand:g,beforeCopy:v},initialTypes:{displayDataTypes:m},children:[(0,z.jsx)(Xz,Y({value:i},y,{ref:t,className:x,style:b})),a]})});yB.Bigint=aB,yB.Date=oB,yB.False=sB,yB.Float=cB,yB.Int=lB,yB.Map=uB,yB.Nan=dB,yB.Null=fB,yB.Set=pB,yB.String=mB,yB.True=hB,yB.Undefined=gB,yB.Url=_B,yB.ValueQuote=iB,yB.Arrow=tB,yB.Colon=nB,yB.Quote=rB,yB.Ellipsis=qz,yB.BraceLeft=Zz,yB.BraceRight=Qz,yB.BracketsLeft=$z,yB.BracketsRight=eB,yB.Copied=vB,yB.CountInfo=Gz,yB.CountInfoExtra=Uz,yB.KeyName=Pz,yB.Row=Iz,yB.displayName=`JVR.JsonView`;var kie=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:`m9 12l2 2l4-4`})]})}),bB=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:`m6 9l6 6l6-6`})}),xB=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`})}),SB=e=>(0,z.jsx)(`svg`,{viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`,...e,children:(0,z.jsx)(`circle`,{cx:12,cy:12,r:10,fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2})}),CB=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:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`}),(0,z.jsx)(`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5M10 9H8m8 4H8m8 4H8`})]})}),wB=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 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`})}),Aie=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:`M8 12h8`})]})}),TB=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:`M10 11v6m4-6v6m5-11v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6M3 6h18M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`})}),EB=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`})]})}),DB=`sonamu.ui.test-result-viewer.v1`,jie=100,OB=5*1024*1024;function Mie(){try{let e=sessionStorage.getItem(DB);if(e===null)return{runs:[]};let t=JSON.parse(e);return Pie(t)?t:{runs:[]}}catch{return{runs:[]}}}function Nie(e){return new TextEncoder().encode(e).length}function kB(e){let t=JSON.stringify(e),n=Nie(t);try{return sessionStorage.setItem(DB,t),{ok:!0}}catch(t){if(AB(t)&&e.runs.length>1){let t={runs:e.runs.slice(0,Math.ceil(e.runs.length/2))};try{return sessionStorage.setItem(DB,JSON.stringify(t)),{ok:!0}}catch{return{ok:!1,reason:`quota-exceeded`,payloadBytes:n,quotaHintBytes:OB}}}return AB(t)?{ok:!1,reason:`quota-exceeded`,payloadBytes:n,quotaHintBytes:OB}:(console.warn(`[sonamu] sessionStorage write failed:`,t),{ok:!0})}}function AB(e){return e instanceof DOMException?e.name===`QuotaExceededError`||e.code===22:!1}function Pie(e){if(typeof e!=`object`||!e)return!1;let t=e;return Array.isArray(t.runs)}function Fie(e){let t=new Date(e);return`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,`0`)}-${String(t.getDate()).padStart(2,`0`)}`}function Iie(){let[e,t]=(0,m.useState)(Mie),[n,r]=(0,m.useState)(null),i=(0,m.useRef)(new Set);return{history:e,storageWarning:n,addRun:(0,m.useCallback)(e=>{t(t=>{let n={...e,dateKey:Fie(e.finishedAt)},a=[n,...t.runs];a.sort((e,t)=>new Date(t.finishedAt).getTime()-new Date(e.finishedAt).getTime());let o=a.slice(0,jie),s={runs:o},c=o.filter(e=>!i.current.has(e.runId)),l=kB({runs:c});return!l.ok&&l.reason===`quota-exceeded`?(i.current.add(n.runId),kB({runs:c.filter(e=>e.runId!==n.runId)}),r({runId:n.runId,reason:`quota-exceeded`,payloadBytes:l.payloadBytes,quotaHintBytes:l.quotaHintBytes})):r(null),s})},[]),clearHistory:(0,m.useCallback)(()=>{t({runs:[]}),r(null),i.current.clear();try{sessionStorage.removeItem(DB)}catch{}},[])}}function jB(e){return typeof e==`object`&&!!e}function MB(e){return e.schemaVersion===1}function Lie(e){return jB(e)?typeof e.ready==`boolean`&&typeof e.running==`boolean`&&(e.lastRunAt===null||typeof e.lastRunAt==`string`):!1}function Rie(e){return!jB(e)||!MB(e)?!1:typeof e.serverTime==`string`&&Lie(e.status)}function zie(e){return!jB(e)||!MB(e)?!1:typeof e.runId==`string`&&typeof e.queuedAt==`string`&&jB(e.request)}function Bie(e){return!jB(e)||!MB(e)?!1:typeof e.runId==`string`&&typeof e.startedAt==`string`}function Vie(e){if(!jB(e)||!MB(e)||typeof e.runId!=`string`||typeof e.startedAt!=`string`||typeof e.finishedAt!=`string`||!jB(e.result))return!1;let t=e.result;return typeof t.ok==`boolean`&&jB(t.summary)&&Array.isArray(t.results)}function Hie(e){return!jB(e)||!MB(e)?!1:typeof e.runId==`string`&&typeof e.finishedAt==`string`&&jB(e.error)&&typeof e.error.message==`string`}function Uie(e){return!jB(e)||!MB(e)?!1:typeof e.runId==`string`&&typeof e.startedAt==`string`&&typeof e.at==`string`&&(e.kind===`file`||e.kind===`suite`||e.kind===`test`)&&(e.phase===`ready`||e.phase===`result`)&&typeof e.fileId==`string`&&typeof e.nodeId==`string`&&(e.parentId===null||typeof e.parentId==`string`)&&jB(e.node)}function Wie(e){return!jB(e)||!MB(e)?!1:typeof e.at==`string`}var Gie={snapshot:Rie,runQueued:zie,runStarted:Bie,runCompleted:Vie,runErrored:Hie,runNodeProgress:Uie,heartbeat:Wie},Kie=`/__test__/events`,qie=3e4;function Jie(e){let t=e?.enabled??!0,[n,r]=(0,m.useState)(!1),i=(0,m.useRef)(null),a=(0,m.useRef)(new Map),o=(0,m.useRef)(0),s=(0,m.useRef)(null),c=(0,m.useRef)(!1),l=(0,m.useCallback)(()=>{if(c.current)return;let e=new EventSource(Kie);i.current=e,e.onopen=()=>{c.current||(o.current=0,r(!0))},e.onerror=()=>{c.current||(e.close(),i.current=null,r(!1),u())};for(let t of[`snapshot`,`runQueued`,`runStarted`,`runCompleted`,`runErrored`,`runNodeProgress`,`heartbeat`])e.addEventListener(t,e=>{if(!c.current)try{let n=JSON.parse(e.data),r=Gie[t];if(r(n)){let e=a.current.get(t);if(e)for(let t of e)t(n)}}catch{}})},[]),u=(0,m.useCallback)(()=>{if(c.current)return;let e=Math.min(1e3*2**o.current,qie);o.current+=1,s.current=setTimeout(()=>{s.current=null,l()},e)},[l]);return(0,m.useEffect)(()=>{if(c.current=!1,t)return l(),()=>{c.current=!0,s.current!==null&&(clearTimeout(s.current),s.current=null),i.current&&=(i.current.close(),null)}},[l,t]),{connected:n,on:(0,m.useCallback)((e,t)=>{let n=a.current.get(e);n||(n=new Set,a.current.set(e,n));let r=t;return n.add(r),()=>{n.delete(r)}},[])}}var Yie=hP(`/test-results`)({component:Zie});function NB(e){let t=0,n=0,r=0,i=0;for(let a of e)t+=a.counts.total,n+=a.counts.passed,r+=a.counts.failed,i+=a.counts.skipped;return{total:t,passed:n,failed:r,skipped:i}}function PB(e,t){return t.some(e=>e.state===`running`)?`running`:t.some(e=>e.state===`failed`)?`failed`:t.every(e=>e.state===`passed`||e.state===`skipped`||e.state===`todo`)?t.some(e=>e.state===`passed`)?`passed`:`skipped`:e.state}function FB(e,t,n,r){if(e.id===t){let t=e.children.findIndex(e=>e.id===n.id),i;if(t>=0){if(r===`ready`&&e.children[t].state!==`running`)return e;i=[...e.children],i[t]=n}else i=[...e.children,n];let a=NB(i),o=PB(e,i);return{...e,children:i,counts:a,state:o}}let i=!1,a=e.children.map(e=>{if(i)return e;let a=FB(e,t,n,r);return a!==e&&(i=!0),a});if(!i)return e;let o=NB(a),s=PB(e,a);return{...e,children:a,counts:o,state:s}}function Xie(e,t){if(!e||t.runId!==e.runId)return e;let n=new Map(e.fileResults);if(t.kind===`file`||t.parentId===null)t.phase===`ready`&&n.has(t.fileId)||n.set(t.fileId,t.node);else{let r=n.get(t.fileId);if(!r)return e;let i=FB(r,t.parentId,t.node,t.phase);n.set(t.fileId,i)}return{...e,fileResults:n}}function Zie(){let{SD:e}=kP(),t=J.useTestStatus(),n=t.data?.sseAvailable??!1,{connected:r,on:i}=Jie({enabled:n}),{history:a,storageWarning:o,addRun:s,clearHistory:c}=Iie(),[l,u]=(0,m.useState)(null),[d,f]=(0,m.useState)(!0),[p,h]=(0,m.useState)(null),[g,_]=(0,m.useState)(null),[v,y]=(0,m.useState)(null),b=(0,m.useRef)([]),x=(0,m.useRef)(null),S=(0,m.useCallback)(()=>(x.current!==null&&(cancelAnimationFrame(x.current),x.current=null),b.current.splice(0)),[]),C=(0,m.useCallback)(()=>{x.current===null&&(x.current=requestAnimationFrame(()=>{x.current=null;let e=b.current.splice(0);e.length!==0&&y(t=>{let n=t;for(let t of e)n=Xie(n,t);return n})}))},[]);(0,m.useEffect)(()=>{f(!r)},[r]),(0,m.useEffect)(()=>{let e=[];return e.push(i(`snapshot`,e=>{u(e.status)})),e.push(i(`runStarted`,e=>{b.current.length=0,x.current!==null&&(cancelAnimationFrame(x.current),x.current=null),u(e=>e&&{...e,running:!0}),y({runId:e.runId,startedAt:e.startedAt,fileResults:new Map}),h(null)})),e.push(i(`runNodeProgress`,e=>{b.current.push(e),C()})),e.push(i(`runCompleted`,e=>{S(),u(t=>t&&{...t,running:!1,lastRunAt:e.finishedAt}),s({runId:e.runId,startedAt:e.startedAt,finishedAt:e.finishedAt,result:e.result}),y(null),h(e.runId)})),e.push(i(`runErrored`,e=>{S(),u(t=>t&&{...t,running:!1,lastRunAt:e.finishedAt}),y(null)})),()=>{for(let t of e)t();x.current!==null&&(cancelAnimationFrame(x.current),x.current=null),b.current.length=0}},[i,s,S,C]);let w=(0,m.useMemo)(()=>p?a.runs.find(e=>e.runId===p)??null:null,[p,a.runs]),T=(0,m.useMemo)(()=>!w||!o||o.runId!==w.runId?null:o,[w,o]),E=(0,m.useMemo)(()=>v?Array.from(v.fileResults.values()):null,[v]),D=(0,m.useMemo)(()=>{if(!E)return null;let e=0,t=0,n=0,r=0,i=0;for(let a of E)e+=a.counts.total,t+=a.counts.passed,n+=a.counts.failed,r+=a.counts.skipped,a.durationMs&&(i+=a.durationMs);return{total:e,passed:t,failed:n,skipped:r,durationMs:i}},[E]),O=!p&&v!==null,k=(0,m.useMemo)(()=>O&&E?E:w?w.result.results:null,[O,E,w]),A=(0,m.useMemo)(()=>{if(!k)return new Map;let e=new Map,t=n=>{for(let r of n)e.set(r.id,r),r.children.length>0&&t(r.children)};return t(k),e},[k]),j=(0,m.useMemo)(()=>g?A.get(g)??null:null,[A,g]),M=(0,m.useCallback)(e=>{h(e),_(null)},[]),N=(0,m.useCallback)(()=>{h(null),_(null)},[]);return t.isSuccess&&!n?(0,z.jsx)(`div`,{className:`flex items-center justify-center h-[calc(100vh-var(--gnb-height,48px))]`,children:(0,z.jsx)(`div`,{className:`text-center`,children:(0,z.jsx)(`p`,{className:`text-gray-600 text-sm`,children:e(`testResults.sseNotAvailable`)})})}):(0,z.jsxs)(`div`,{className:`flex flex-col h-[calc(100vh-var(--gnb-height,48px))]`,children:[(0,z.jsx)(Qie,{connected:r,connecting:d,managerStatus:l}),(0,z.jsxs)(`div`,{className:`flex flex-1 overflow-hidden`,children:[(0,z.jsx)($ie,{runs:a.runs,selectedRunId:p,onSelectRun:M,onClearHistory:c,liveRun:v,showLiveRun:O,onSelectLiveRun:N}),(0,z.jsx)(`div`,{className:`flex-1 overflow-auto`,children:O&&E&&D?(0,z.jsx)(rae,{results:E,summary:D,selectedNodeId:g,selectedNode:j,onSelectNode:_}):w?(0,z.jsx)(nae,{run:w,storageWarning:T,selectedNodeId:g,selectedNode:j,onSelectNode:_}):(0,z.jsx)(`div`,{className:`flex items-center justify-center h-full text-gray-400`,children:e(`testResults.noHistory`)})})]})]})}function Qie({connected:e,connecting:t,managerStatus:n}){let{SD:r}=kP();return(0,z.jsxs)(`div`,{className:`flex items-center gap-3 px-4 py-2 bg-gray-50 border-b border-gray-200 text-sm shrink-0`,children:[(0,z.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,z.jsx)(`span`,{className:(0,kL.default)(`inline-block w-2.5 h-2.5 rounded-full`,{"bg-green-500":e,"bg-yellow-400 animate-pulse":t&&!e,"bg-gray-400":!e&&!t})}),(0,z.jsx)(`span`,{className:`text-gray-600`,children:r(e?`testResults.connected`:t?`testResults.connecting`:`testResults.disconnected`)})]}),n?.running&&(0,z.jsx)(`span`,{className:`inline-flex items-center gap-1 px-2 py-0.5 bg-blue-100 text-blue-700 text-xs font-medium rounded-full animate-pulse`,children:`Running`})]})}function $ie({runs:e,selectedRunId:t,onSelectRun:n,onClearHistory:r,liveRun:i,showLiveRun:a,onSelectLiveRun:o}){let{SD:s}=kP(),c=(0,m.useMemo)(()=>{let t=new Map;for(let n of e){let e=t.get(n.dateKey);e?e.push(n):t.set(n.dateKey,[n])}let n=Array.from(t.entries());return n.sort((e,t)=>t[0].localeCompare(e[0])),n},[e]);return(0,z.jsxs)(`div`,{className:`w-60 shrink-0 flex flex-col border-r border-gray-200 bg-gray-50 overflow-hidden`,children:[(0,z.jsxs)(`div`,{className:`flex-1 overflow-y-auto p-2`,children:[i&&(0,z.jsx)(`button`,{type:`button`,"aria-label":s(`testResults.liveRunning`),className:(0,kL.default)(`w-full text-left px-2 py-1.5 rounded text-sm cursor-pointer transition-colors mb-2`,{"bg-blue-100 text-blue-900":a,"hover:bg-gray-200":!a}),onClick:o,children:(0,z.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,z.jsx)(`span`,{className:`inline-block w-2 h-2 rounded-full bg-blue-500 animate-pulse`}),(0,z.jsx)(`span`,{className:`text-xs font-semibold text-blue-700`,children:s(`testResults.liveRunning`)})]})}),e.length===0&&!i?(0,z.jsx)(`div`,{className:`text-center text-gray-400 text-sm py-8`,children:s(`testResults.noHistory`)}):c.map(([e,r])=>(0,z.jsxs)(`div`,{className:`mb-3`,children:[(0,z.jsx)(`div`,{className:`text-xs font-semibold text-gray-500 px-2 py-1`,children:e}),r.map(e=>(0,z.jsx)(`button`,{type:`button`,className:(0,kL.default)(`w-full text-left px-2 py-1.5 rounded text-sm cursor-pointer transition-colors`,{"bg-blue-100 text-blue-900":t===e.runId,"hover:bg-gray-200":t!==e.runId}),onClick:()=>n(e.runId),children:(0,z.jsxs)(`div`,{className:`flex items-center gap-1.5 flex-wrap`,children:[(0,z.jsx)(eae,{summary:e.result.summary}),(0,z.jsx)(`span`,{className:`text-xs text-gray-400 ml-auto`,children:tae(e.finishedAt)})]})},e.runId))]},e))]}),e.length>0&&(0,z.jsx)(`div`,{className:`p-2 border-t border-gray-200`,children:(0,z.jsx)(B,{size:`xs`,variant:`outline`,icon:(0,z.jsx)(TB,{}),onClick:r,className:`w-full`,children:s(`testResults.clearHistory`)})})]})}function eae({summary:e}){return(0,z.jsxs)(`div`,{className:`flex items-center gap-1`,children:[e.passed>0&&(0,z.jsx)(`span`,{className:`inline-block px-1.5 py-0.5 text-[10px] font-bold rounded bg-green-100 text-green-700`,children:e.passed}),e.failed>0&&(0,z.jsx)(`span`,{className:`inline-block px-1.5 py-0.5 text-[10px] font-bold rounded bg-red-100 text-red-700`,children:e.failed}),e.skipped>0&&(0,z.jsx)(`span`,{className:`inline-block px-1.5 py-0.5 text-[10px] font-bold rounded bg-gray-100 text-gray-500`,children:e.skipped})]})}function tae(e){let t=new Date(e);return`${String(t.getHours()).padStart(2,`0`)}:${String(t.getMinutes()).padStart(2,`0`)}:${String(t.getSeconds()).padStart(2,`0`)}`}function nae({run:e,storageWarning:t,selectedNodeId:n,selectedNode:r,onSelectNode:i}){return(0,z.jsxs)(`div`,{className:`flex flex-col h-full`,children:[(0,z.jsx)(IB,{summary:e.result.summary,storageWarning:t}),(0,z.jsxs)(`div`,{className:`flex flex-1 overflow-hidden`,children:[(0,z.jsx)(zB,{results:e.result.results,selectedNodeId:n,onSelectNode:i}),(0,z.jsx)(VB,{node:r})]})]})}function rae({results:e,summary:t,selectedNodeId:n,selectedNode:r,onSelectNode:i}){return(0,z.jsxs)(`div`,{className:`flex flex-col h-full`,children:[(0,z.jsx)(IB,{summary:t}),(0,z.jsxs)(`div`,{className:`flex flex-1 overflow-hidden`,children:[(0,z.jsx)(zB,{results:e,selectedNodeId:n,onSelectNode:i}),(0,z.jsx)(VB,{node:r})]})]})}function IB({summary:e,storageWarning:t=null}){let{SD:n}=kP();return(0,z.jsxs)(`div`,{className:`flex items-center gap-4 px-4 py-3 bg-white border-b border-gray-200 text-sm shrink-0`,children:[(0,z.jsxs)(`span`,{className:`text-gray-600`,children:[n(`testResults.summary.total`),`: `,(0,z.jsx)(`span`,{className:`font-semibold`,children:e.total})]}),(0,z.jsxs)(`span`,{className:`text-green-600`,children:[n(`testResults.summary.passed`),`: `,(0,z.jsx)(`span`,{className:`font-semibold`,children:e.passed})]}),(0,z.jsxs)(`span`,{className:`text-red-600`,children:[n(`testResults.summary.failed`),`: `,(0,z.jsx)(`span`,{className:`font-semibold`,children:e.failed})]}),(0,z.jsxs)(`span`,{className:`text-gray-500`,children:[n(`testResults.summary.skipped`),`:`,` `,(0,z.jsx)(`span`,{className:`font-semibold`,children:e.skipped})]}),(0,z.jsxs)(`span`,{className:`text-gray-500`,children:[n(`testResults.summary.duration`),`:`,` `,(0,z.jsx)(`span`,{className:`font-mono`,children:LB(e.durationMs)})]}),t?.reason===`quota-exceeded`&&(0,z.jsxs)(`span`,{className:`text-amber-700 text-xs`,children:[n(`testResults.storageWarning.quotaExceeded`),` (`,n(`testResults.storageWarning.limit`),`: `,RB(t.quotaHintBytes),`,`,n(`testResults.storageWarning.resultSize`),`:`,` `,RB(t.payloadBytes),`)`]})]})}function LB(e){return e>=6e4?`${(e/6e4).toFixed(1)}m`:e>=1e3?`${(e/1e3).toFixed(1)}s`:`${e.toFixed(2)}ms`}function RB(e){return e>=1024*1024?`${(e/(1024*1024)).toFixed(2)}MB`:e>=1024?`${(e/1024).toFixed(1)}KB`:`${e}B`}function iae(e){let t=new Set,n=e=>{if(e.children.length===0)return e.state===`failed`;let r=!1;for(let t of e.children)n(t)&&(r=!0);return r&&t.add(e.id),r};for(let r of e)t.add(r.id),n(r);return t}function aae(e,t){let n=e=>{if(e.name.toLowerCase().includes(t))return e;let r=e.children.flatMap(e=>{let t=n(e);return t?[t]:[]});return r.length>0?{...e,children:r}:null};return e.flatMap(e=>{let t=n(e);return t?[t]:[]})}function oae(e){let t=new Set,n=e=>{t.add(e.id);for(let t of e.children)n(t)};for(let t of e)n(t);return t}function sae(e,t){let n=[],r=(e,i)=>{let a=e.children.length>0;if(n.push({node:e,depth:i,hasChildren:a}),a&&t.has(e.id))for(let t of e.children)r(t,i+1)};for(let t of e)r(t,0);return n}function zB({results:e,selectedNodeId:t,onSelectNode:n}){let{SD:r}=kP(),[i,a]=(0,m.useState)(()=>iae(e)),[o,s]=(0,m.useState)(``),[c,l]=(0,m.useState)(``),u=(0,m.useRef)(null);(0,m.useEffect)(()=>{let e=setTimeout(()=>l(o),300);return()=>clearTimeout(e)},[o]);let d=(0,m.useMemo)(()=>{let t=c.toLowerCase();return t?aae(e,t):e},[e,c]);(0,m.useEffect)(()=>{c?(u.current===null&&(u.current=new Set(i)),a(oae(d))):u.current!==null&&(a(u.current),u.current=null)},[c,d]);let f=(0,m.useRef)(e);(0,m.useEffect)(()=>{if(f.current!==e){if(f.current=e,u.current!==null)return;a(t=>{let n=new Set(t),r=e=>{if(e.children.length===0)return e.state===`failed`;let t=!1;for(let n of e.children)r(n)&&(t=!0);return t&&n.add(e.id),t};for(let t of e)n.has(t.id)||n.add(t.id),r(t);return n})}},[e]);let p=(0,m.useMemo)(()=>sae(d,i),[d,i]),h=(0,m.useCallback)(e=>{a(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]);return(0,z.jsxs)(`div`,{className:`w-120 shrink-0 border-r border-gray-200 overflow-y-auto p-2`,children:[(0,z.jsxs)(`div`,{className:`relative mb-2`,children:[(0,z.jsx)(`input`,{type:`text`,value:o,onChange:e=>s(e.target.value),placeholder:r(`testResults.tree.searchPlaceholder`),className:`w-full text-xs px-2 py-1 pr-6 border border-gray-200 rounded outline-none focus:border-blue-400`}),o&&(0,z.jsx)(`button`,{type:`button`,"aria-label":r(`testResults.tree.clearSearch`),className:`absolute right-1.5 top-1/2 -translate-y-1/2 text-gray-400 hover:text-gray-600`,onClick:()=>{s(``),l(``)},children:(0,z.jsx)(EB,{className:`w-3.5 h-3.5`})})]}),p.map(e=>(0,z.jsx)(cae,{row:e,isSelected:t===e.node.id,expanded:i.has(e.node.id),onSelectNode:n,onToggleExpand:h},e.node.id)),c&&p.length===0&&(0,z.jsx)(`div`,{className:`text-xs text-gray-400 px-2 py-1`,children:r(`testResults.tree.noMatches`)})]})}var cae=(0,m.memo)(function({row:e,isSelected:t,expanded:n,onSelectNode:r,onToggleExpand:i}){return(0,z.jsxs)(`button`,{type:`button`,className:(0,kL.default)(`w-full flex items-center gap-1.5 px-2 py-1 rounded text-sm cursor-pointer transition-colors text-left`,{"bg-blue-100":t,"hover:bg-gray-100":!t}),style:{paddingLeft:`${e.depth*16+8}px`},onClick:()=>{r(e.node.id),e.hasChildren&&i(e.node.id)},children:[e.hasChildren?n?(0,z.jsx)(bB,{className:`w-3.5 h-3.5 text-gray-400 shrink-0`}):(0,z.jsx)(xB,{className:`w-3.5 h-3.5 text-gray-400 shrink-0`}):(0,z.jsx)(`span`,{className:`w-3.5 shrink-0`}),(0,z.jsx)(BB,{state:e.node.state,kind:e.node.kind}),(0,z.jsx)(`span`,{className:(0,kL.default)(`truncate`,{"text-red-600":e.node.state===`failed`,"text-green-700":e.node.state===`passed`,"text-gray-400":e.node.state===`skipped`||e.node.state===`todo`}),children:e.node.name}),e.node.durationMs!==null&&(0,z.jsx)(`span`,{className:`ml-auto text-xs text-gray-400 font-mono shrink-0`,children:LB(e.node.durationMs)})]})});function BB({state:e,kind:t}){return t===`file`?(0,z.jsx)(CB,{className:(0,kL.default)(`w-4 h-4 shrink-0`,{"text-green-600":e===`passed`,"text-red-500":e===`failed`,"text-gray-400":e===`skipped`||e===`todo`||e===`unknown`,"text-blue-500":e===`running`})}):t===`suite`?(0,z.jsx)(wB,{className:(0,kL.default)(`w-4 h-4 shrink-0`,{"text-green-600":e===`passed`,"text-red-500":e===`failed`,"text-gray-400":e===`skipped`||e===`todo`||e===`unknown`,"text-blue-500":e===`running`})}):e===`passed`?(0,z.jsx)(kie,{className:`w-4 h-4 text-green-600 shrink-0`}):e===`failed`?(0,z.jsx)(EB,{className:`w-4 h-4 text-red-500 shrink-0`}):e===`skipped`||e===`todo`?(0,z.jsx)(Aie,{className:`w-4 h-4 text-gray-400 shrink-0`}):(0,z.jsx)(SB,{className:`w-4 h-4 text-gray-400 shrink-0`})}var VB=(0,m.memo)(function({node:e}){return e?(0,z.jsxs)(`div`,{className:`flex-1 overflow-y-auto p-4 space-y-4`,children:[(0,z.jsxs)(`div`,{className:`flex items-center gap-2 text-sm`,children:[(0,z.jsx)(BB,{state:e.state,kind:e.kind}),(0,z.jsx)(`span`,{className:`font-semibold`,children:e.fullName}),e.durationMs!==null&&(0,z.jsx)(`span`,{className:`text-gray-400 font-mono text-xs`,children:LB(e.durationMs)})]}),e.error&&(0,z.jsx)(lae,{error:e.error}),(0,z.jsx)(dae,{traces:e.traces})]}):(0,z.jsx)(`div`,{className:`flex-1`})});function lae({error:e}){let{SD:t}=kP();return(0,z.jsxs)(`div`,{className:`border border-red-200 rounded-md overflow-hidden`,children:[(0,z.jsx)(`div`,{className:`px-3 py-1.5 bg-red-50 text-red-700 text-xs font-semibold border-b border-red-200`,children:t(`testResults.detail.error`)}),(0,z.jsxs)(`pre`,{className:`p-3 text-xs text-red-800 bg-red-50/50 overflow-x-auto whitespace-pre-wrap`,children:[e.message,e.stack&&`\n\n${e.stack}`]})]})}function uae(e){if(typeof e==`string`)try{return JSON.parse(e)}catch{return e}return e}function HB(e,t){if(!t)return e;let n=e.toLowerCase(),r=t.toLowerCase(),i=[],a=0,o=n.indexOf(r,a);for(;o!==-1;)o>a&&i.push(e.slice(a,o)),i.push((0,z.jsx)(`mark`,{className:`bg-yellow-200 text-yellow-900`,children:e.slice(o,o+r.length)},o)),a=o+r.length,o=n.indexOf(r,a);return a<e.length&&i.push(e.slice(a)),i.length>0?i:e}function dae({traces:e}){let{SD:t}=kP(),[n,r]=(0,m.useState)(()=>new Set),[i,a]=(0,m.useState)(``),[o,s]=(0,m.useState)(``),c=(0,m.useRef)(new Map),l=(0,m.useRef)(e);l.current!==e&&(l.current=e,c.current.clear()),(0,m.useEffect)(()=>{let e=setTimeout(()=>s(i),300);return()=>clearTimeout(e)},[i]);let u=(0,m.useMemo)(()=>{let t=o.toLowerCase();return e.reduce((e,n,r)=>{let i=`${n.key}-${n.at}-${r}`,a=c.current.get(i);return a===void 0&&(a=`${n.key} ${JSON.stringify(n.value)}`.toLowerCase(),c.current.set(i,a)),(!o||a.includes(t))&&e.push({trace:n,originalIndex:r}),e},[])},[e,o]),d=(0,m.useCallback)(e=>{r(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),f=(0,m.useCallback)(()=>{r(new Set(e.map((e,t)=>`${e.key}-${e.at}-${t}`)))},[e]),p=(0,m.useCallback)(()=>{r(new Set)},[]);return(0,z.jsxs)(`div`,{children:[(0,z.jsxs)(`div`,{className:`flex items-center gap-2 text-xs font-semibold text-gray-600 mb-1`,children:[t(`testResults.detail.traces`),(0,z.jsxs)(`span`,{className:`flex gap-1 font-normal`,children:[(0,z.jsx)(`button`,{type:`button`,className:`text-blue-500 hover:text-blue-700`,onClick:f,children:t(`testResults.detail.expandAll`)}),(0,z.jsx)(`span`,{className:`text-gray-300`,children:`/`}),(0,z.jsx)(`button`,{type:`button`,className:`text-blue-500 hover:text-blue-700`,onClick:p,children:t(`testResults.detail.collapseAll`)})]})]}),(0,z.jsxs)(`div`,{className:`relative mb-1.5`,children:[(0,z.jsx)(`input`,{type:`text`,value:i,onChange:e=>a(e.target.value),placeholder:t(`testResults.detail.searchPlaceholder`),className:`w-full text-xs px-2 py-1 pr-6 border border-gray-200 rounded outline-none focus:border-blue-400`}),i&&(0,z.jsx)(`button`,{type:`button`,"aria-label":t(`testResults.detail.clearSearch`),className:`absolute right-1.5 top-1/2 -translate-y-1/2 text-gray-400 hover:text-gray-600`,onClick:()=>{a(``),s(``)},children:(0,z.jsx)(EB,{className:`w-3.5 h-3.5`})})]}),u.length===0&&e.length===0?(0,z.jsx)(`div`,{className:`text-xs text-gray-400`,children:t(`testResults.detail.noTraces`)}):u.length===0?(0,z.jsx)(`div`,{className:`text-xs text-gray-400`,children:t(`testResults.detail.noTraceMatches`)}):(0,z.jsx)(`div`,{className:`space-y-1.5`,children:u.map(({trace:e,originalIndex:t})=>{let r=`${e.key}-${e.at}-${t}`,i=n.has(r),a=uae(e.value),s=typeof a==`object`&&a?a:{value:a};return(0,z.jsxs)(`div`,{className:`text-xs border border-gray-100 rounded overflow-hidden`,children:[(0,z.jsxs)(`button`,{type:`button`,className:`flex items-center w-full px-2 py-1 bg-gray-50 cursor-pointer text-left`,onClick:()=>d(r),children:[i?(0,z.jsx)(bB,{className:`w-3 h-3 text-gray-400 mr-1 shrink-0`}):(0,z.jsx)(xB,{className:`w-3 h-3 text-gray-400 mr-1 shrink-0`}),(0,z.jsx)(`span`,{className:`font-mono font-semibold text-blue-700`,children:e.key}),(0,z.jsxs)(`span`,{className:`ml-3 text-gray-400 text-[11px]`,children:[e.filePath,`:`,e.lineNumber]})]}),i&&(0,z.jsx)(`div`,{className:`px-2 py-1.5 overflow-x-auto`,children:(0,z.jsx)(yB,{value:s,collapsed:!1,displayDataTypes:!1,indentWidth:12,enableClipboard:!1,style:{fontSize:`12px`},children:o&&(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(yB.KeyName,{render:(e,{keyName:t})=>{let n=String(t);return(0,z.jsx)(`span`,{...e,children:HB(n,o)})}}),(0,z.jsx)(yB.String,{render:(e,{value:t})=>{let n=String(t);return(0,z.jsx)(`span`,{...e,children:HB(n,o)})}})]})})})]},r)})})]})}var fae=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`})}),UB=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:`M10 15V9m4 6V9`})]})}),WB=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:`M9 9.003a1 1 0 0 1 1.517-.859l4.997 2.997a1 1 0 0 1 0 1.718l-4.997 2.997A1 1 0 0 1 9 14.996z`}),(0,z.jsx)(`circle`,{cx:12,cy:12,r:10})]})}),GB=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:`M3 12a9 9 0 0 1 9-9a9.75 9.75 0 0 1 6.74 2.74L21 8`}),(0,z.jsx)(`path`,{d:`M21 3v5h-5m5 4a9 9 0 0 1-9 9a9.75 9.75 0 0 1-6.74-2.74L3 16`}),(0,z.jsx)(`path`,{d:`M8 16H3v5`})]})}),pae=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:`M3 12a9 9 0 1 0 9-9a9.75 9.75 0 0 0-6.74 2.74L3 8`}),(0,z.jsx)(`path`,{d:`M3 3v5h5`})]})}),KB={pending:`bg-yellow-100 text-yellow-800 border-yellow-200`,running:`bg-blue-100 text-blue-800 border-blue-200`,sleeping:`bg-purple-100 text-purple-800 border-purple-200`,succeeded:`bg-green-100 text-green-800 border-green-200`,completed:`bg-green-100 text-green-800 border-green-200`,failed:`bg-red-100 text-red-800 border-red-200`,paused:`bg-orange-100 text-orange-800 border-orange-200`,canceled:`bg-gray-100 text-gray-800 border-gray-200`};function qB(e,t){return e?new Date(e).toLocaleString(t??`ko`,{year:`numeric`,month:`2-digit`,day:`2-digit`,hour:`2-digit`,minute:`2-digit`,second:`2-digit`}):`-`}function JB(e,t){if(!e)return`-`;let n=new Date(e).getTime(),r=(t?new Date(t).getTime():Date.now())-n;return r<1e3?`${r}ms`:r<6e4?`${(r/1e3).toFixed(1)}s`:r<36e5?`${Math.floor(r/6e4)}m ${Math.floor(r%6e4/1e3)}s`:`${Math.floor(r/36e5)}h ${Math.floor(r%36e5/6e4)}m`}var mae={options:[`pending`,`running`,`sleeping`,`paused`,`completed`,`failed`,`canceled`]},hae={pending:`PENDING`,running:`RUNNING`,sleeping:`SLEEPING`,paused:`PAUSED`,completed:`COMPLETED`,failed:`FAILED`,canceled:`CANCELED`};function YB(e){return e>=6e4?`${e/6e4}m`:e>=1e3?`${e/1e3}s`:`${e}ms`}function gae(e){if(!e)return`-`;let t=[];return e.maxAttempts&&t.push(`최대 ${e.maxAttempts}회`),e.initialIntervalMs&&t.push(`초기 ${YB(e.initialIntervalMs)}`),e.backoffCoefficient&&t.push(`배수 ${e.backoffCoefficient}x`),e.maximumIntervalMs&&t.push(`최대간격 ${YB(e.maximumIntervalMs)}`),e.hasDynamicPolicy&&t.push(`(+ dynamic)`),t.length>0?t.join(` · `):`-`}function _ae({startedAt:e}){let[,t]=(0,m.useState)(0);return(0,m.useEffect)(()=>{if(!e)return;let n=setInterval(()=>t(e=>e+1),1e3);return()=>clearInterval(n)},[e]),(0,z.jsx)(`span`,{className:`font-mono text-sm`,children:JB(e,null)})}var vae={succeeded:`bg-green-100 text-green-700 border-green-200`,completed:`bg-green-100 text-green-700 border-green-200`,running:`bg-blue-100 text-blue-700 border-blue-200 animate-pulse`,failed:`bg-red-100 text-red-700 border-red-200`};function yae({steps:e}){return e.length===0?null:(0,z.jsxs)(`div`,{className:`flex items-center gap-1 flex-wrap`,children:[e.map((e,t)=>(0,z.jsxs)(`div`,{className:`flex items-center gap-1`,children:[t>0&&(0,z.jsx)(`span`,{className:`text-gray-300 text-xs`,children:`→`}),(0,z.jsx)(`span`,{className:(0,kL.default)(`inline-block px-1.5 py-0.5 text-[11px] font-mono rounded border`,vae[e.status]??`bg-gray-100 text-gray-600 border-gray-200`),children:e.stepName})]},e.id)),(0,z.jsx)(`span`,{className:`text-gray-300 text-xs ml-0.5`,children:`→ ···`})]})}function bae({run:e}){let{SD:t}=kP(),[n,r]=(0,m.useState)(!1),[i,a]=(0,m.useState)(!1),[o,s]=(0,m.useState)(!1),{data:c}=J.useStepAttempts(e.id),l=c?.data??[],u=[`pending`,`running`,`sleeping`].includes(e.status),d=e.status===`paused`;return(0,z.jsxs)(`div`,{className:`flex items-center gap-4 p-3 bg-white border border-blue-200 rounded-md`,children:[(0,z.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,z.jsxs)(`div`,{className:`flex items-center gap-2 mb-1`,children:[(0,z.jsx)(mP,{to:`/tasks/$workflowRunId`,params:{workflowRunId:e.id},className:`text-blue-600 hover:underline no-underline font-medium text-sm truncate`,children:e.workflowName}),(0,z.jsx)(`span`,{className:(0,kL.default)(`inline-block px-1.5 py-0.5 text-[10px] font-bold rounded border shrink-0`,KB[e.status]??`bg-gray-100 text-gray-800`),children:e.status.toUpperCase()})]}),l.length>0?(0,z.jsx)(yae,{steps:l}):(0,z.jsx)(`span`,{className:`text-xs text-gray-400`,children:t(`tasks.active.noStepsYet`)})]}),(0,z.jsxs)(`div`,{className:`flex items-center gap-3 shrink-0`,children:[(0,z.jsxs)(`div`,{className:`text-xs text-gray-500`,children:[(0,z.jsxs)(`span`,{className:`mr-1`,children:[t(`tasks.active.elapsed`),`:`]}),(0,z.jsx)(_ae,{startedAt:e.startedAt})]}),u&&(0,z.jsx)(B,{size:`xs`,variant:`outline`,icon:(0,z.jsx)(UB,{}),disabled:i,onClick:()=>{confirm(t(`tasks.pauseConfirm`))&&(a(!0),J.pauseWorkflowRun(e.id).catch(PL).finally(()=>a(!1)))},children:t(`tasks.pause`)}),d&&(0,z.jsx)(B,{size:`xs`,variant:`outline`,icon:(0,z.jsx)(WB,{}),disabled:o,onClick:()=>{s(!0),J.resumeWorkflowRun(e.id).catch(PL).finally(()=>s(!1))},children:t(`tasks.resume`)}),(0,z.jsx)(B,{size:`xs`,variant:`destructive`,icon:(0,z.jsx)(EB,{}),disabled:n,onClick:()=>{confirm(t(`tasks.cancelConfirm`))&&(r(!0),J.cancelWorkflowRun(e.id).catch(PL).finally(()=>r(!1)))},children:t(`tasks.cancel`)})]})]})}function xae(){let{SD:e}=kP(),{data:t}=J.useWorkflowRuns({status:[`pending`,`running`,`sleeping`,`paused`]}),n=t?.data??[];return n.length===0?null:(0,z.jsxs)(`div`,{className:`block p-4 bg-blue-50 border-2 border-blue-300 rounded-md shadow-sm mb-4`,children:[(0,z.jsx)(`h3`,{className:`text-lg font-semibold mb-3 text-blue-900`,children:e(`tasks.active.title`)}),(0,z.jsx)(`div`,{className:`flex flex-col gap-2`,children:n.map(e=>(0,z.jsx)(bae,{run:e},e.id))})]})}var Sae=hP(`/tasks`)({component:Cae});function Cae(){let{SD:e}=kP(),t=DP(),[n,r]=(0,m.useState)({}),[i,a]=(0,m.useState)([]),[o,s]=(0,m.useState)(``),[c,l]=(0,m.useState)(),[u,d]=(0,m.useState)(),{data:f}=J.useWorkflowDefinitions(),p=f?.definitions??[],h=(0,m.useMemo)(()=>({options:p.map(e=>e.name)}),[p]),g=(0,m.useMemo)(()=>Object.fromEntries(p.map(e=>[e.name,e.name])),[p]),_=i.length>0||o!==``||c||u,{data:v,error:y,refetch:b,isLoading:x}=J.useWorkflowRuns({limit:50,...n,...i.length>0?{status:i}:{},...o?{workflowName:o}:{},...c?{createdAfter:c.toISOString()}:{},...u?{createdBefore:u.toISOString()}:{}}),S=v?.data??[],C=v?.pagination;return y?(0,z.jsx)(`div`,{className:`p-8`,children:(0,z.jsx)(`div`,{className:`max-w-2xl mx-auto my-[30vh] p-8 bg-white border-2 border-red-500 rounded-md whitespace-pre-line leading-8`,children:y.message})}):(0,z.jsxs)(`div`,{className:`p-8`,children:[(0,z.jsx)(xae,{}),(0,z.jsxs)(`div`,{className:`block p-4 bg-white border border-gray-200 rounded-md shadow-sm mb-4`,children:[(0,z.jsx)(`h3`,{className:`text-xl font-semibold mb-4`,children:e(`tasks.definitions`)}),p.length===0?(0,z.jsx)(`div`,{className:`text-center py-8 text-gray-400`,children:e(`tasks.noDefinitions`)}):(0,z.jsxs)(wj,{className:`text-[0.9em]`,children:[(0,z.jsx)(Tj,{children:(0,z.jsxs)(Dj,{className:`hover:bg-transparent bg-gray-100`,children:[(0,z.jsx)(Oj,{children:e(`tasks.workflowName`)}),(0,z.jsx)(Oj,{children:e(`tasks.version`)}),(0,z.jsx)(Oj,{children:e(`tasks.schedule`)}),(0,z.jsx)(Oj,{children:e(`tasks.retryPolicy`)})]})}),(0,z.jsx)(Ej,{children:p.map(e=>(0,z.jsxs)(Dj,{className:`hover:bg-gray-50`,children:[(0,z.jsx)(kj,{className:`font-medium`,children:e.name}),(0,z.jsx)(kj,{className:`text-gray-500 text-xs`,children:e.version??(0,z.jsx)(`span`,{className:`italic text-gray-400`,children:`(unversioned)`})}),(0,z.jsx)(kj,{className:`text-gray-500 text-xs`,children:e.schedules.length>0?e.schedules.map(e=>(0,z.jsxs)(`div`,{className:`mb-1 last:mb-0`,children:[(0,z.jsx)(`span`,{className:`font-medium`,children:e.name}),(0,z.jsx)(`span`,{className:`ml-1 font-mono text-gray-400`,children:e.expression})]},e.name)):`-`}),(0,z.jsx)(kj,{className:`text-gray-500 text-xs`,children:gae(e.retryPolicy)})]},e.id))})]})]}),(0,z.jsxs)(`div`,{className:`block p-4 bg-white border border-gray-200 rounded-md shadow-sm`,children:[(0,z.jsxs)(`div`,{className:`flex items-center justify-between mb-4`,children:[(0,z.jsx)(`h3`,{className:`text-xl font-semibold`,children:e(`tasks.title`)}),(0,z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,z.jsxs)(`span`,{className:`text-xs text-gray-400`,children:[e(`tasks.autoRefresh`),`: 5s`]}),(0,z.jsx)(B,{size:`xs`,icon:(0,z.jsx)(GB,{}),onClick:()=>b(),children:e(`common.refresh`)})]})]}),(0,z.jsxs)(`div`,{className:`flex items-center gap-3 mb-4 flex-wrap`,children:[(0,z.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,z.jsx)(`label`,{className:`text-xs text-gray-500 shrink-0`,children:e(`tasks.filter.status`)}),(0,z.jsx)(yg,{enum:mae,labels:hae,value:i,onValueChange:e=>{a(e??[]),r({})},multiple:!0,placeholder:e(`common.all`),className:`w-[200px]`})]}),h.options.length>0&&(0,z.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,z.jsx)(`label`,{className:`text-xs text-gray-500 shrink-0`,children:e(`tasks.filter.workflowName`)}),(0,z.jsx)(yg,{enum:h,labels:g,value:o,onValueChange:e=>{s(e??``),r({})},clearable:!0,placeholder:e(`common.all`),className:`w-[200px]`})]}),(0,z.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,z.jsx)(`label`,{className:`text-xs text-gray-500 shrink-0`,children:e(`tasks.filter.createdAfter`)}),(0,z.jsx)(ag,{value:c,onValueChange:e=>{l(e),r({})},className:`w-[180px]`})]}),(0,z.jsx)(`span`,{className:`text-gray-400`,children:`~`}),(0,z.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,z.jsx)(`label`,{className:`text-xs text-gray-500 shrink-0`,children:e(`tasks.filter.createdBefore`)}),(0,z.jsx)(ag,{value:u,onValueChange:e=>{d(e),r({})},className:`w-[180px]`})]}),_&&(0,z.jsx)(B,{size:`xs`,variant:`outline`,icon:(0,z.jsx)(pae,{}),onClick:()=>{a([]),s(``),l(void 0),d(void 0),r({})},children:e(`tasks.filter.reset`)})]}),x&&(0,z.jsx)(`div`,{className:`text-center py-8`,children:e(`common.loading`)}),!x&&(0,z.jsxs)(wj,{className:`text-[0.9em]`,children:[(0,z.jsx)(Tj,{children:(0,z.jsxs)(Dj,{className:`hover:bg-transparent bg-gray-100`,children:[(0,z.jsx)(Oj,{children:e(`tasks.workflowName`)}),(0,z.jsx)(Oj,{children:e(`tasks.version`)}),(0,z.jsx)(Oj,{children:e(`tasks.status`)}),(0,z.jsx)(Oj,{children:e(`tasks.attempts`)}),(0,z.jsx)(Oj,{children:e(`tasks.createdAt`)}),(0,z.jsx)(Oj,{children:e(`tasks.startedAt`)}),(0,z.jsx)(Oj,{children:e(`tasks.finishedAt`)}),(0,z.jsx)(Oj,{children:e(`tasks.duration`)})]})}),(0,z.jsxs)(Ej,{children:[S.length===0&&(0,z.jsx)(Dj,{children:(0,z.jsx)(kj,{colSpan:8,className:`text-center py-8 text-gray-400`,children:e(`tasks.noData`)})}),S.map(e=>(0,z.jsxs)(Dj,{className:`hover:bg-gray-50`,children:[(0,z.jsx)(kj,{children:(0,z.jsx)(mP,{to:`/tasks/$workflowRunId`,params:{workflowRunId:e.id},className:`text-blue-600 hover:underline no-underline`,children:e.workflowName})}),(0,z.jsx)(kj,{className:`text-gray-500`,children:e.version??`-`}),(0,z.jsx)(kj,{children:(0,z.jsx)(`span`,{className:(0,kL.default)(`inline-block px-2 py-0.5 text-xs font-bold rounded border`,KB[e.status]??`bg-gray-100 text-gray-800`),children:e.status.toUpperCase()})}),(0,z.jsx)(kj,{className:`text-center`,children:e.attempts}),(0,z.jsx)(kj,{className:`text-gray-500 text-xs`,children:qB(e.createdAt,t)}),(0,z.jsx)(kj,{className:`text-gray-500 text-xs`,children:qB(e.startedAt,t)}),(0,z.jsx)(kj,{className:`text-gray-500 text-xs`,children:qB(e.finishedAt,t)}),(0,z.jsx)(kj,{className:`text-gray-500 text-xs font-mono`,children:JB(e.startedAt,e.finishedAt)})]},e.id))]})]}),C&&(C.prev||C.next)&&(0,z.jsxs)(`div`,{className:`flex justify-center gap-2 mt-4`,children:[(0,z.jsx)(B,{size:`sm`,variant:`outline`,icon:(0,z.jsx)(fae,{}),disabled:!C.prev,onClick:()=>{C.prev&&r({before:C.prev})},children:e(`tasks.prev`)}),(0,z.jsxs)(B,{size:`sm`,variant:`outline`,disabled:!C.next,onClick:()=>{C.next&&r({after:C.next})},children:[e(`tasks.next`),(0,z.jsx)(`span`,{children:(0,z.jsx)(xB,{className:`w-4 h-4`})})]})]})]})]})}var XB=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`})}),ZB=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:`m16 18l6-6l-6-6M8 6l-6 6l6 6`})}),QB=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:`M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z`})}),$B=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`})}),wae=hP(`/scaffolding`)({component:Tae});function Tae({}){let{SD:e}=kP(),{data:t}=J.useEntities(),{entities:n}=t??{},[r,i]=(0,m.useState)({entityIds:[],templateKeys:[]}),[a,o]=(0,m.useState)({open:!1,pathAndCodes:null}),[s,c]=(0,m.useState)({}),l=(n??[]).filter(e=>!e.parentId),u=[`model`,`model_test`,`view_list`,`view_search_input`,`view_form`],d=e=>{i({...r,entityIds:e})},f=e=>{i({...r,templateKeys:u.filter(t=>e.includes(t))})},{data:p,isLoading:h,refetch:g}=J.useScaffoldingStatus(r),{statuses:_}=p??{},v=e=>[e.entityId,e.templateKey].join(`///`),y=[{label:`Entity`,tc:e=>(0,z.jsx)(z.Fragment,{children:e.entityId}),fit:!0},{label:`TemplateKey`,tc:e=>(0,z.jsx)(z.Fragment,{children:e.templateKey}),fit:!0},{label:e(`common.path`),tc:e=>(0,z.jsx)(z.Fragment,{children:e.subPath})},{label:e(`scaffolding.isExists`),tc:e=>(0,z.jsx)(z.Fragment,{children:e.isExists?(0,z.jsx)(B,{icon:(0,z.jsx)(ZB,{}),size:`xs`,variant:`yellow`,onClick:t=>{t.stopPropagation(),J.openVscode({absPath:e.fullPath})}}):(0,z.jsx)($B,{})}),fit:!0},{label:(0,z.jsx)(B,{size:`xs`,variant:`destructive`,icon:(0,z.jsx)(XB,{}),onClick:e=>{e.stopPropagation(),b()},children:e(`common.overwrite`)}),tc:e=>(0,z.jsx)(z.Fragment,{children:e.isExists&&(0,z.jsx)(el,{checked:s[v(e)]?.overwrite??!1,onCheckedChange:t=>{c({...s,[v(e)]:{overwrite:t??!1}})}})}),fit:!0},{label:e(`common.preview`),tc:t=>(0,z.jsx)(B,{size:`xs`,variant:`green`,onClick:e=>{e.stopPropagation(),S(t)},children:e(`common.preview`)}),fit:!0}],b=()=>{if(!_)return;let e=_.filter(e=>e.isExists);e.every(e=>s[v(e)]?.overwrite??!1)?c({}):c(e.reduce((e,t)=>(e[v(t)]={overwrite:!0},e),{}))},x=()=>{if(!_)return;let e=_.map(e=>({entityId:e.entityId,templateKey:e.templateKey,overwrite:s[v(e)]?.overwrite??!1}));J.scaffoldingGenerate(e).then(()=>{g()}).catch(PL)},S=e=>{J.scaffoldingPreview(e).then(({pathAndCodes:e})=>{o({open:!0,pathAndCodes:e})}).catch(PL)};return(0,z.jsxs)(`div`,{className:`flex justify-start min-h-[calc(100vh-50px)]`,children:[(0,z.jsxs)(`div`,{className:`bg-sidebar-bg text-white pl-4 pr-0 h-[calc(100vh-var(--spacing-gnb))] sticky left-0 top-gnb w-[250px] overflow-y-auto`,children:[(0,z.jsx)(`h3`,{children:e(`scaffolding.entities`)}),(0,z.jsx)(`div`,{className:`py-3 text-center`,children:r.entityIds.length===l.length?(0,z.jsx)(B,{icon:(0,z.jsx)(XB,{}),onClick:()=>d([]),children:e(`scaffolding.uncheckAllEntities`)}):(0,z.jsx)(B,{icon:(0,z.jsx)(XB,{}),onClick:()=>d(l.map(e=>e.id)),children:e(`scaffolding.checkAllEntities`)})}),l.map(e=>(0,z.jsx)(`div`,{className:`flex items-center pb-2`,id:e.id,children:(0,z.jsx)(el,{checked:r.entityIds.includes(e.id),label:e.id,onCheckedChange:t=>{d(t?[...r.entityIds,e.id]:r.entityIds.filter(t=>t!==e.id))}})},e.id))]}),(0,z.jsx)(`div`,{className:`bg-sidebar-bg pl-8 border-l border-[#85aa8a] h-[calc(100vh-var(--spacing-gnb))] sticky left-0 top-gnb text-white w-[250px] overflow-y-auto`,children:(0,z.jsxs)(`div`,{className:`pb-4`,children:[(0,z.jsx)(`h4`,{className:`mb-1`,children:e(`scaffolding.template`).replace(`{name}`,`Entity`)}),(0,z.jsx)(`div`,{className:`py-3 text-center`,children:r.templateKeys.length===u.length?(0,z.jsx)(B,{icon:(0,z.jsx)(XB,{}),onClick:()=>f([]),children:e(`scaffolding.uncheckAll`)}):(0,z.jsx)(B,{icon:(0,z.jsx)(XB,{}),onClick:()=>f(u),children:e(`scaffolding.checkAll`)})}),u.map(e=>(0,z.jsx)(`div`,{className:`flex items-center pb-2`,children:(0,z.jsx)(el,{checked:r.templateKeys.includes(e),label:e,onCheckedChange:t=>{f(t?[...r.templateKeys,e]:r.templateKeys.filter(t=>t!==e))}})},e))]})}),(0,z.jsx)(`div`,{className:`flex-1 p-4`,children:(0,z.jsxs)(`div`,{children:[!_&&!h&&(0,z.jsx)(`div`,{className:`w-[50em] my-[30vh] mx-auto whitespace-pre-line p-[3em] bg-white leading-[2em] border-2 border-orange-500`,children:e(`scaffolding.selectPrompt`)}),_&&(0,z.jsxs)(`div`,{children:[_.length>0&&(0,z.jsx)(B,{size:`sm`,variant:`default`,icon:(0,z.jsx)(QB,{}),onClick:()=>x(),children:e(`scaffolding.generateTemplates`).replace(`{count}`,String(_.length)).replace(`{overwriteCount}`,String(Object.keys(s).length))}),(0,z.jsxs)(wj,{className:`mt-4 text-[0.9em]`,children:[(0,z.jsx)(Tj,{children:(0,z.jsx)(Dj,{className:`hover:bg-transparent bg-gray-100`,children:y.map((e,t)=>(0,z.jsx)(Oj,{fit:e.fit,className:`py-2 px-3`,children:e.label},t))})}),(0,z.jsx)(Ej,{children:_.map((e,t)=>(0,z.jsx)(m.Fragment,{children:(0,z.jsx)(Dj,{className:e.isExists?`bg-red-50`:`bg-green-50`,children:y.map((t,n)=>(0,z.jsx)(kj,{fit:t.fit,className:`py-2 px-3`,children:t.tc(e)},n))})},t))})]})]})]})}),(0,z.jsx)(td,{open:a.open,onOpenChange:e=>{e||o({open:!1,pathAndCodes:null})},children:(0,z.jsxs)(id,{className:`max-w-4xl max-h-[80vh] overflow-y-auto`,children:[(0,z.jsxs)(ad,{children:[(0,z.jsx)(sd,{children:e(`scaffolding.previewTitle`)}),(0,z.jsx)(cd,{children:e(`scaffolding.previewDesc`)})]}),(0,z.jsx)(`div`,{className:`space-y-4`,children:a.pathAndCodes?.map(e=>(0,z.jsxs)(`div`,{children:[(0,z.jsx)(`div`,{className:`mb-2 text-lg font-bold text-gray-700`,children:e.path}),(0,z.jsx)(`pre`,{className:`bg-green-50 text-gray-900 p-4 rounded-lg overflow-x-auto text-sm font-mono leading-relaxed`,children:(0,z.jsx)(`code`,{children:e.code})})]},e.path))??(0,z.jsx)(`p`,{children:e(`scaffolding.noPreviewData`)})})]})})]})}var Eae=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:9,cy:12,r:3}),(0,z.jsx)(`rect`,{width:20,height:14,x:2,y:5,rx:7})]})}),Dae=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:15,cy:12,r:3}),(0,z.jsx)(`rect`,{width:20,height:14,x:2,y:5,rx:7})]})}),eV=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:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6M3 6h18M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`})}),tV=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`})});function Oae({action:e,targets:t,conns:n,open:r,onOpenChange:i,onCompleted:a}){let[o,s]=(0,m.useState)(!1),{form:c,register:l}=eM(Uk({doShadowDbTesting:_k()}),{doShadowDbTesting:e===`apply`}),[u,d]=(0,m.useState)({status:`idle`}),[f,p]=(0,m.useState)(!1),[h,g]=(0,m.useState)(``),_=(0,m.useRef)(null),v=(n,r)=>{_.current=setInterval(async()=>{try{let{approved:o,rejected:s}=await J.migrationsCheckApproval(n,r);o?(y(),`type`in await J.migrationsRunAction(e,t)||(i(!1),a?.())):s&&(y(),d({status:`rejected`}))}catch(e){console.error(`Polling error:`,e)}},2e3)},y=()=>{_.current&&=(clearInterval(_.current),null)};(0,m.useEffect)(()=>{r||(y(),d({status:`idle`}),g(``))},[r]),(0,m.useEffect)(()=>()=>y(),[]);let b=async()=>{s(!0);try{c.doShadowDbTesting&&await J.migrationsRunAction(`shadow`,t);let n=await J.migrationsRunAction(e,t);`type`in n&&n.type===`pending`?(d({status:`pending`,channel:n.channel,ts:n.ts}),v(n.channel,n.ts)):(i(!1),a?.())}catch(e){PL(e)}finally{s(!1)}},x=async()=>{if(!(!u.channel||!u.ts)){s(!0);try{await J.migrationsForceApproval(u.channel,u.ts,h),`type`in await J.migrationsRunAction(e,t,{force:!0,forceReason:h})||(i(!1),a?.())}catch(e){PL(e)}finally{s(!1),p(!1)}}};return(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(td,{open:r,onOpenChange:i,children:(0,z.jsxs)(id,{className:`max-w-4xl max-h-[90vh] flex flex-col`,children:[(0,z.jsxs)(ad,{children:[(0,z.jsx)(sd,{children:`Migrations Action Form`}),(0,z.jsxs)(cd,{children:[`Execute migration action: `,e.toUpperCase()]})]}),(0,z.jsx)(`div`,{className:`overflow-y-auto flex-1 p-4`,children:(0,z.jsx)(`div`,{className:`form ${o?`loading`:``}`,children:(0,z.jsxs)(`div`,{className:`ui basic segment`,children:[(0,z.jsxs)(`div`,{children:[(0,z.jsxs)(`h4`,{children:[`Action: `,e.toUpperCase()]}),(0,z.jsx)(`p`,{children:`\xA0`})]}),(0,z.jsxs)(`div`,{className:`targets`,children:[(0,z.jsx)(`h4`,{children:`Targets`}),(0,z.jsx)(`div`,{className:`flex w-full gap-2 my-4`,children:n.map(e=>(0,z.jsxs)(`div`,{className:(0,kL.default)(`flex-1 text-center p-4 bg-[#f1fff5] border border-[#b1f3c4] rounded-[0.3em] opacity-30`,{"bg-[#b1f3c4] text-green-600 font-bold opacity-100":t.includes(e.connKey)}),children:[t.includes(e.connKey)&&(0,z.jsx)(XB,{className:`h-4 w-4 inline-block mr-1`}),e.name]},e.name))})]}),e===`apply`&&(0,z.jsxs)(`div`,{className:`shadow-db-testing`,children:[(0,z.jsx)(`h4`,{children:`Shadow DB Testing`}),(0,z.jsx)(Cj,{...l(`doShadowDbTesting`)})]}),u.status===`pending`&&(0,z.jsxs)(`div`,{className:`p-4 bg-yellow-50 border border-yellow-200 rounded mt-4`,children:[(0,z.jsxs)(`div`,{className:`flex items-center gap-2 mb-2`,children:[(0,z.jsx)(tV,{className:`h-4 w-4 animate-spin`}),(0,z.jsx)(`span`,{className:`font-medium`,children:`승인 대기중...`})]}),(0,z.jsx)(`p`,{className:`text-sm text-gray-600 mb-4`,children:`슬랙에서 ✅ 이모지를 눌러 승인해주세요.`}),(0,z.jsx)(B,{variant:`outline`,onClick:()=>p(!0),children:`Force 진행`})]}),u.status===`rejected`&&(0,z.jsx)(`div`,{className:`p-4 bg-red-50 border border-red-200 rounded mt-4`,children:(0,z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,z.jsx)($B,{className:`h-4 w-4 text-red-600`}),(0,z.jsx)(`span`,{className:`font-medium text-red-600`,children:`마이그레이션이 거절되었습니다.`})]})})]})})}),(0,z.jsx)(od,{children:(0,z.jsx)(B,{onClick:b,icon:(0,z.jsx)(QB,{}),disabled:o||u.status===`pending`,children:`Commit`})})]})}),(0,z.jsx)(td,{open:f,onOpenChange:p,children:(0,z.jsxs)(id,{children:[(0,z.jsxs)(ad,{children:[(0,z.jsx)(sd,{children:`Force 진행`}),(0,z.jsx)(cd,{children:`승인 없이 진행합니다. 사유를 입력해주세요.`})]}),(0,z.jsx)(Qj,{placeholder:`사유 입력...`,value:h,onChange:e=>g(e.target.value)}),(0,z.jsxs)(od,{children:[(0,z.jsx)(B,{variant:`outline`,onClick:()=>p(!1),children:`취소`}),(0,z.jsx)(B,{onClick:x,disabled:!h.trim()||o,children:`진행`})]})]})})]})}var kae=hP(`/migrations`)({component:Aae});function Aae(e){let{SD:t}=kP(),{data:n,error:r,refetch:i}=J.useMigrationStatus(),{status:a}=n??{},{preparedCodes:o,conns:s,codes:c}=a??{},l=a?.error,u=!r&&!n,[d,f]=(0,m.useState)(!1),[p,h]=(0,m.useState)([]),[g,_]=(0,m.useState)([]),[v,y]=(0,m.useState)(!1),[b,x]=(0,m.useState)(null),[S,C]=(0,m.useState)(!1),w=e=>{let t=new Set((s??[]).map(e=>e.connKey)),n=(()=>{switch(e){case`ALL`:return[`test`,`fixture`,`development`,`staging`,`production`];case`LOCAL`:return[`test`];case`REMOTE`:return[`development`,`staging`,`production`];case`TESTING`:return[`test`,`fixture`];case`FIXTURE`:return[`fixture`]}})().filter(e=>t.has(e));n.length!==0&&(n.filter(e=>p.includes(e)).length===n.length?h(p.filter(e=>!n.includes(e))):jne(n,p).length>0?h(n):h(pj([...p,...n])))},T=()=>{g.length!==0&&confirm(t(`migration.confirm.deleteCodes`).replace(`{count}`,String(g.length)))&&(f(!0),J.migrationsDelCodes(g).then(()=>{i()}).catch(PL).finally(()=>{f(!1)}))},E=()=>{f(!0),J.migrationsGeneratePreparedCodes().then(()=>{setTimeout(()=>{i()},500)}).catch(PL).finally(()=>{f(!1)})},D=(e,t)=>{s&&(x({action:e,targets:t??p}),y(!0))},O=()=>{i()},k=()=>{c&&(g.length===0?_(c.map(e=>e.name)):_([]))};return r?(0,z.jsx)(`div`,{className:`p-8`,children:(0,z.jsx)(`div`,{className:`w-[50em] my-[30vh] mx-auto whitespace-pre-line p-[3em] bg-white leading-[2em] border-2 border-red-500`,children:r.message})}):(0,z.jsxs)(`div`,{className:`p-8`,children:[(0,z.jsxs)(`div`,{className:`block p-4 bg-white border border-gray-200 rounded-md shadow-sm ${d||u?`opacity-50 pointer-events-none`:``}`,children:[o&&(0,z.jsxs)(`div`,{className:`p-4`,children:[(0,z.jsxs)(`h3`,{className:`relative `,children:[t(`migration.preparedCodes`),` `,(0,z.jsxs)(`div`,{className:`absolute right-0 top-0 flex gap-2`,children:[(0,z.jsx)(B,{icon:S?(0,z.jsx)(Dae,{}):(0,z.jsx)(Eae,{}),size:`xs`,onClick:()=>C(!S),children:t(`migration.toggleCodes`)}),(0,z.jsx)(B,{size:`xs`,icon:(0,z.jsx)(QB,{}),onClick:()=>E(),children:t(`migration.generate`)})]})]}),(0,z.jsxs)(wj,{children:[(0,z.jsx)(Tj,{children:(0,z.jsxs)(Dj,{className:`hover:bg-transparent bg-gray-100`,children:[(0,z.jsx)(Oj,{children:t(`common.type`)}),(0,z.jsx)(Oj,{children:t(`common.table`)}),(0,z.jsx)(Oj,{children:t(`common.name`)}),(0,z.jsx)(Oj,{children:t(`common.code`)})]})}),(0,z.jsxs)(Ej,{children:[l&&(0,z.jsx)(Dj,{children:(0,z.jsx)(kj,{colSpan:6,children:l})}),!l&&o.length===0&&(0,z.jsx)(Dj,{children:(0,z.jsx)(kj,{colSpan:6,className:`text-center`,children:t(`migration.noPreparedCodes`)})}),o.map((e,n)=>(0,z.jsxs)(Dj,{children:[(0,z.jsx)(kj,{children:e.type}),(0,z.jsx)(kj,{children:e.table}),(0,z.jsx)(kj,{children:e.title}),(0,z.jsx)(kj,{style:{padding:0,width:700,textAlign:`center`},children:(0,z.jsx)(jae,{code:e.formatted??``,open:S,collapsedText:t(`migration.codeCollapsed`)})})]},n))]})]}),(0,z.jsx)(`div`,{className:`border-b border-gray-200`})]}),(0,z.jsxs)(`div`,{className:`p-4`,children:[(0,z.jsx)(`h3`,{children:t(`migration.codeFiles`)}),(0,z.jsxs)(`div`,{className:`flex gap-8`,children:[(0,z.jsx)(`div`,{className:`flex-1`,children:(0,z.jsx)(B,{variant:`destructive`,icon:(0,z.jsx)(eV,{}),disabled:g.length===0,onClick:()=>T(),children:t(`migration.deleteCodes`)})}),(0,z.jsx)(`div`,{className:`flex gap-2 justify-end`,children:[`ALL`,`LOCAL`,`REMOTE`,`TESTING`,`FIXTURE`].map(e=>(0,z.jsx)(B,{variant:`yellow`,onClick:()=>w(e),children:e},e))}),(0,z.jsxs)(`div`,{className:`flex gap-2 justify-end`,children:[(0,z.jsx)(B,{variant:`default`,icon:(0,z.jsx)(QB,{}),disabled:p.length===0||!!l,onClick:()=>D(`apply`),children:t(`migration.applyToLatest`)}),(0,z.jsx)(B,{variant:`destructive`,icon:(0,z.jsx)(GB,{}),disabled:p.length===0||!!l,onClick:()=>D(`rollback`),children:t(`migration.rollback`)})]})]}),s&&c&&(0,z.jsxs)(wj,{className:`mt-4 text-[0.9em]`,children:[(0,z.jsx)(Tj,{children:(0,z.jsxs)(Dj,{className:`hover:bg-transparent bg-gray-100`,children:[(0,z.jsxs)(Oj,{className:`flex items-center gap-1`,children:[`Name`,` `,(0,z.jsx)(B,{icon:(0,z.jsx)(XB,{}),size:`xs`,variant:`blue`,onClick:()=>k()})]}),s.map((e,t)=>(0,z.jsx)(Oj,{style:{width:`150px`},className:(0,kL.default)(`py-2 px-3`,{"bg-[#dafde6]":p.includes(e.connKey)}),children:(0,z.jsx)(el,{disabled:e.status===`error`||!!l,checked:p.includes(e.connKey),label:(0,z.jsxs)(vv,{children:[(0,z.jsx)(yv,{children:`${e.name} / ${e.status}`}),(0,z.jsx)(bv,{children:(0,z.jsx)(`p`,{children:e.connString})})]}),onCheckedChange:t=>{h(t?pj([...p,e.connKey]):p.filter(t=>t!==e.connKey))}})},t))]})}),(0,z.jsxs)(Ej,{children:[s.some(e=>e.status===`error`||!!l)&&(0,z.jsx)(Dj,{children:(0,z.jsx)(kj,{colSpan:6,children:(0,z.jsx)(`b`,{children:t(`migration.error.connections`)})})}),c.length===0&&(0,z.jsx)(Dj,{children:(0,z.jsx)(kj,{colSpan:6,children:t(`migration.noCodeFiles`)})}),c.map((e,t)=>(0,z.jsx)(m.Fragment,{children:(0,z.jsxs)(Dj,{children:[(0,z.jsxs)(kj,{className:`flex items-center gap-1`,children:[(0,z.jsx)(el,{checked:g.includes(e.name),label:e.name,onCheckedChange:t=>{_(t?pj([...g,e.name]):g.filter(t=>t!==e.name))}}),`\xA0`,` `,(0,z.jsx)(B,{size:`xs`,variant:`secondary`,icon:(0,z.jsx)(ZB,{}),onClick:()=>{J.openVscode({absPath:e.path})}})]}),s.map((t,n)=>(0,z.jsx)(kj,{className:(0,kL.default)(`text-center py-2 px-3`,{"bg-[#dafde6]":p.includes(t.connKey)}),children:t.pending.includes(e.name)?(0,z.jsx)(`span`,{className:`inline-block px-2 py-1 text-xs font-bold rounded bg-yellow-500 text-white`,children:`PENDING`}):t.status===`error`||l?(0,z.jsx)(`span`,{className:`inline-block px-2 py-1 text-xs font-bold rounded bg-red-500 text-white`,children:`ERROR`}):(0,z.jsx)(`span`,{className:`inline-block px-2 py-1 text-xs font-bold rounded bg-green-500 text-white`,children:`APPLIED`})},n))]})},t))]})]})]})]}),s&&b&&(0,z.jsx)(Oae,{action:b.action,targets:b.targets,conns:s,open:v,onOpenChange:y,onCompleted:O})]})}function jae({code:e,open:t,collapsedText:n}){return(0,z.jsx)(`div`,{className:`flex items-start`,children:t?(0,z.jsx)(`pre`,{className:`bg-green-50 text-gray-900 p-4 rounded-lg overflow-x-auto text-sm font-mono leading-relaxed text-left`,children:(0,z.jsx)(`code`,{children:e})}):(0,z.jsx)(`div`,{className:`m-auto`,children:n})})}var Mae=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:`M12 15V3m9 12v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`}),(0,z.jsx)(`path`,{d:`m7 10l5 5l5-5`})]})}),nV=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:`M5 12h14m-7-7v14`})}),Nae=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:`M12 3v12m5-7l-5-5l-5 5m14 7v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`})}),Pae=hP(`/i18n`)({component:Fae});function Fae(){let{SD:e}=kP(),{data:t,error:n,refetch:r}=J.useI18nDictionary(),{rows:i,locales:a,defaultLocale:o,stats:s}=t??{},c=!n&&!t,[l,u]=(0,m.useState)(!1),d=(0,m.useRef)(null),[f,p]=(0,m.useState)(null),[h,g]=(0,m.useState)(``),_=(0,m.useRef)(null),[v,y]=(0,m.useState)(new Set),[b,x]=(0,m.useState)(null),[S,C]=(0,m.useState)(!1),[w,T]=(0,m.useState)(``),[E,D]=(0,m.useState)({});(0,m.useEffect)(()=>{f&&_.current&&(_.current.focus(),_.current.select())},[f]),(0,m.useEffect)(()=>{!i||i.length===0||(async()=>{let e=i.filter(e=>e.source===`project`).map(e=>e.key);if(e.length!==0)try{let t=await J.checkI18nUsage(e);if(t.error){x(t.error);return}y(new Set(t.unusedKeys)),x(null)}catch{}})()},[i]);let O=()=>{window.location.href=`/sonamu-ui/api/i18n/export`},k=()=>{d.current?.click()},A=async e=>{let t=e.target.files?.[0];if(t){u(!0);try{await J.importI18n(t),await r(),alert(`Import completed successfully!`)}catch(e){PL(e)}finally{u(!1),d.current&&(d.current.value=``)}}},j=(e,t)=>{if(e.source===`sonamu`)return;let n=t===`key`?e.key:e[t]??``;p({key:e.key,field:t}),g(n)},M=async e=>{if(!f||!a)return;let{field:t}=f,n=e.key;if(h===(t===`key`?e.key:e[t]??``)){p(null);return}u(!0);try{if(t===`key`){let t={};for(let n of a)e[n]&&(t[n]=e[n]);await J.updateI18n({oldKey:n,newKey:h,source:e.source,values:t})}else await J.updateI18n({oldKey:n,newKey:n,source:e.source,values:{[t]:h}});await r()}catch(e){PL(e)}finally{u(!1),p(null)}},N=()=>{p(null),g(``)},P=()=>{T(``),D({}),C(!0)},F=async()=>{if(!w.trim()){alert(`키를 입력해주세요`);return}u(!0);try{await J.createI18n({key:w.trim(),values:E}),C(!1),await r()}catch(e){PL(e)}finally{u(!1)}},ee=async t=>{if(confirm(e(`i18n.confirm.delete`).replace(`{key}`,t))){u(!0);try{await J.deleteI18n(t),await r()}catch(e){PL(e)}finally{u(!1)}}},te=(e,t)=>{e.key===`Enter`?(e.preventDefault(),M(t)):e.key===`Escape`&&(e.preventDefault(),N())},ne=(e,t,n,r)=>{let i=f?.key===e.key&&f?.field===t,a=e.source!==`sonamu`;return i?(0,z.jsx)(kj,{className:r,children:(0,z.jsx)(`input`,{ref:_,type:`text`,value:h,onChange:e=>g(e.target.value),onBlur:()=>M(e),onKeyDown:t=>te(t,e),className:`w-full px-2 py-1 text-sm border border-blue-400 rounded outline-none focus:ring-2 focus:ring-blue-200`})}):(0,z.jsx)(kj,{className:`${r} ${a?`cursor-pointer hover:bg-blue-50`:``}`,onDoubleClick:()=>a&&j(e,t),children:n})};return(0,z.jsxs)(`div`,{className:`p-8`,children:[(0,z.jsx)(`div`,{className:`block p-4 bg-white border border-gray-200 rounded-md shadow-sm ${l||c?`opacity-50 pointer-events-none`:``}`,children:(0,z.jsxs)(`div`,{className:`p-4`,children:[(0,z.jsxs)(`div`,{className:`flex items-center gap-2 mb-4`,style:{display:`flex`,alignItems:`baseline`},children:[(0,z.jsx)(`h3`,{children:e(`i18n.title`)}),(0,z.jsx)(B,{variant:`outline`,size:`sm`,onClick:()=>r(),disabled:l,icon:(0,z.jsx)(GB,{className:`w-4 h-4`})})]}),(0,z.jsxs)(`div`,{className:`flex gap-2 mb-4`,children:[(0,z.jsx)(B,{onClick:P,disabled:l,icon:(0,z.jsx)(nV,{className:`w-4 h-4`}),children:e(`i18n.addKey`)}),(0,z.jsx)(B,{onClick:O,disabled:l,icon:(0,z.jsx)(Nae,{className:`w-4 h-4`}),children:e(`i18n.exportExcel`)}),(0,z.jsx)(B,{onClick:k,disabled:l,icon:(0,z.jsx)(Mae,{className:`w-4 h-4`}),children:e(`i18n.importExcel`)}),(0,z.jsx)(`input`,{type:`file`,ref:d,onChange:A,accept:`.xlsx,.xls`,className:`hidden`})]}),(0,z.jsx)(`p`,{className:`text-sm text-gray-500 mb-4`,children:e(`i18n.editHint`)}),b&&(0,z.jsxs)(`p`,{className:`text-sm text-yellow-600 mb-4 p-2 bg-yellow-50 rounded`,children:[`⚠ `,b]}),c&&(0,z.jsx)(`div`,{className:`text-gray-500`,children:e(`common.loading`)}),n&&(0,z.jsxs)(`div`,{className:`text-red-500`,children:[e(`common.error`),`: `,String(n)]}),i&&a&&(0,z.jsxs)(wj,{containerClassName:`border rounded-lg overflow-auto max-h-[calc(100vh-250px)]`,children:[(0,z.jsx)(Tj,{children:(0,z.jsxs)(Dj,{children:[(0,z.jsx)(Oj,{className:`sticky top-0 z-10 min-w-[300px] bg-gray-100`,children:e(`i18n.key`)}),(0,z.jsx)(Oj,{className:`sticky top-0 z-10 min-w-[100px] bg-gray-100`,children:e(`i18n.source`)}),a.map(e=>(0,z.jsxs)(Oj,{className:`sticky top-0 z-10 min-w-[200px] bg-gray-100`,children:[e,e===o&&` (default)`,s?.[e]&&(0,z.jsxs)(`span`,{className:`ml-2 text-xs ${s[e].percent===100?`text-green-600`:s[e].percent>=80?`text-yellow-600`:`text-red-600`}`,children:[s[e].percent,`%`]})]},e)),(0,z.jsx)(Oj,{className:`sticky top-0 z-10 w-[60px] bg-gray-100`})]})}),(0,z.jsx)(Ej,{children:i.map(e=>(0,z.jsxs)(Dj,{className:e.source===`sonamu`?`bg-gray-50 text-gray-500`:void 0,children:[ne(e,`key`,(0,z.jsxs)(z.Fragment,{children:[!b&&v.has(e.key)&&(0,z.jsx)(`span`,{className:`text-red-500 mr-1`,title:`미사용 키`,children:`❗`}),e.key]}),`font-mono text-sm`),(0,z.jsx)(kj,{children:(0,z.jsx)(`span`,{className:`text-xs px-2 py-0.5 rounded ${e.source===`entity`?`bg-blue-100 text-blue-700`:e.source===`sonamu`?`bg-gray-200 text-gray-600`:`bg-green-100 text-green-700`}`,children:e.source})}),a.map(t=>{let n=!e[t];return ne(e,t,n?(0,z.jsx)(`span`,{className:`text-yellow-600`,children:`⚠ -`}):e[t],`text-sm ${n?`bg-yellow-50`:``}`)}),(0,z.jsx)(kj,{children:e.source===`project`&&(0,z.jsx)(`button`,{type:`button`,onClick:()=>ee(e.key),className:`p-1 text-gray-400 hover:text-red-500 transition-colors`,title:`Delete key`,children:(0,z.jsx)(TB,{className:`w-4 h-4`})})})]},e.key))})]}),(0,z.jsx)(`div`,{className:`mt-4 text-sm text-gray-500`,children:i&&(0,z.jsx)(`span`,{children:e(`i18n.totalKeys`).replace(`{count}`,String(i.length))})})]})}),S&&a&&(0,z.jsx)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center bg-black/50`,children:(0,z.jsxs)(`div`,{className:`bg-white rounded-lg shadow-xl w-full max-w-md p-6`,children:[(0,z.jsx)(`h3`,{className:`text-lg font-semibold mb-4`,children:e(`i18n.modal.addNewKey`)}),(0,z.jsxs)(`div`,{className:`space-y-4`,children:[(0,z.jsxs)(`div`,{children:[(0,z.jsx)(`label`,{className:`block text-sm font-medium text-gray-700 mb-1`,children:e(`i18n.key`)}),(0,z.jsx)(`input`,{type:`text`,value:w,onChange:e=>T(e.target.value),placeholder:`e.g. common.myNewKey`,className:`w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500`})]}),a.map(t=>(0,z.jsxs)(`div`,{children:[(0,z.jsxs)(`label`,{className:`block text-sm font-medium text-gray-700 mb-1`,children:[t,t===o&&` (default)`]}),(0,z.jsx)(`input`,{type:`text`,value:E[t]??``,onChange:e=>D(n=>({...n,[t]:e.target.value})),placeholder:e(`i18n.modal.valueFor`).replace(`{locale}`,t),className:`w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500`})]},t))]}),(0,z.jsxs)(`div`,{className:`flex justify-end gap-2 mt-6`,children:[(0,z.jsx)(B,{variant:`outline`,onClick:()=>C(!1),disabled:l,children:e(`common.cancel`)}),(0,z.jsx)(B,{onClick:F,disabled:l,children:e(l?`i18n.creating`:`common.create`)})]})]})})]})}var Iae=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)(`ellipse`,{cx:12,cy:5,rx:9,ry:3}),(0,z.jsx)(`path`,{d:`M3 5v14a9 3 0 0 0 18 0V5`}),(0,z.jsx)(`path`,{d:`M3 12a9 3 0 0 0 18 0`})]})}),Lae=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)(`rect`,{width:18,height:18,x:3,y:3,rx:2}),(0,z.jsx)(`path`,{d:`M3 9h18M3 15h18M9 3v18m6-18v18`})]})}),rV=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})]})}),Rae=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:`M12 3v18`}),(0,z.jsx)(`rect`,{width:18,height:18,x:3,y:3,rx:2}),(0,z.jsx)(`path`,{d:`M3 9h18M3 15h18`})]})}),iV=`vercel.ai.error`,zae=Symbol.for(iV),aV,Bae=class e extends Error{constructor({name:e,message:t,cause:n}){super(t),this[aV]=!0,this.name=e,this.cause=n}static isInstance(t){return e.hasMarker(t,iV)}static hasMarker(e,t){let n=Symbol.for(t);return typeof e==`object`&&!!e&&n in e&&typeof e[n]==`boolean`&&e[n]===!0}};aV=zae;var oV=Bae;function sV(e){return e==null?`unknown error`:typeof e==`string`?e:e instanceof Error?e.message:JSON.stringify(e)}var cV=`AI_InvalidArgumentError`,lV=`vercel.ai.error.${cV}`,Vae=Symbol.for(lV),uV,Hae=class extends oV{constructor({message:e,cause:t,argument:n}){super({name:cV,message:e,cause:t}),this[uV]=!0,this.argument=n}static isInstance(e){return oV.hasMarker(e,lV)}};uV=Vae;var dV=`AI_JSONParseError`,fV=`vercel.ai.error.${dV}`,Uae=Symbol.for(fV),pV,mV=class extends oV{constructor({text:e,cause:t}){super({name:dV,message:`JSON parsing failed: Text: ${e}.
|
|
102
|
+
`+n)}}catch{}}throw e}}_request(e,t){typeof e==`string`?(t||={},t.url=e):t=e||{},t=KI(this.defaults,t);let{transitional:n,paramsSerializer:r,headers:i}=t;n!==void 0&&bL.assertOptions(n,{silentJSONParsing:xL.transitional(xL.boolean),forcedJSONParsing:xL.transitional(xL.boolean),clarifyTimeoutError:xL.transitional(xL.boolean),legacyInterceptorReqResOrdering:xL.transitional(xL.boolean)},!1),r!=null&&(q.isFunction(r)?t.paramsSerializer={serialize:r}:bL.assertOptions(r,{encode:xL.function,serialize:xL.function},!0)),t.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls===void 0?t.allowAbsoluteUrls=!0:t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls),bL.assertOptions(t,{baseUrl:xL.spelling(`baseURL`),withXsrfToken:xL.spelling(`withXSRFToken`)},!0),t.method=(t.method||this.defaults.method||`get`).toLowerCase();let a=i&&q.merge(i.common,i[t.method]);i&&q.forEach([`delete`,`get`,`head`,`post`,`put`,`patch`,`common`],e=>{delete i[e]}),t.headers=kI.concat(a,i);let o=[],s=!0;this.interceptors.request.forEach(function(e){if(typeof e.runWhen==`function`&&e.runWhen(t)===!1)return;s&&=e.synchronous;let n=t.transitional||tI;n&&n.legacyInterceptorReqResOrdering?o.unshift(e.fulfilled,e.rejected):o.push(e.fulfilled,e.rejected)});let c=[];this.interceptors.response.forEach(function(e){c.push(e.fulfilled,e.rejected)});let l,u=0,d;if(!s){let e=[hL.bind(this),void 0];for(e.unshift(...o),e.push(...c),d=e.length,l=Promise.resolve(t);u<d;)l=l.then(e[u++],e[u++]);return l}d=o.length;let f=t;for(;u<d;){let e=o[u++],t=o[u++];try{f=e(f)}catch(e){t.call(this,e);break}}try{l=hL.call(this,f)}catch(e){return Promise.reject(e)}for(u=0,d=c.length;u<d;)l=l.then(c[u++],c[u++]);return l}getUri(e){return e=KI(this.defaults,e),$F(WI(e.baseURL,e.url,e.allowAbsoluteUrls),e.params,e.paramsSerializer)}};q.forEach([`delete`,`get`,`head`,`options`],function(e){SL.prototype[e]=function(t,n){return this.request(KI(n||{},{method:e,url:t,data:(n||{}).data}))}}),q.forEach([`post`,`put`,`patch`],function(e){function t(t){return function(n,r,i){return this.request(KI(i||{},{method:e,headers:t?{"Content-Type":`multipart/form-data`}:{},url:n,data:r}))}}SL.prototype[e]=t(),SL.prototype[e+`Form`]=t(!0)});var CL=class e{constructor(e){if(typeof e!=`function`)throw TypeError(`executor must be a function.`);let t;this.promise=new Promise(function(e){t=e});let n=this;this.promise.then(e=>{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null}),this.promise.then=e=>{let t,r=new Promise(e=>{n.subscribe(e),t=e}).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e(function(e,r,i){n.reason||(n.reason=new MI(e,r,i),t(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;let t=this._listeners.indexOf(e);t!==-1&&this._listeners.splice(t,1)}toAbortSignal(){let e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let t;return{token:new e(function(e){t=e}),cancel:t}}};function wL(e){return function(t){return e.apply(null,t)}}function TL(e){return q.isObject(e)&&e.isAxiosError===!0}var EL={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(EL).forEach(([e,t])=>{EL[t]=e});function DL(e){let t=new SL(e),n=jP(SL.prototype.request,t);return q.extend(n,SL.prototype,t,{allOwnKeys:!0}),q.extend(n,t,null,{allOwnKeys:!0}),n.create=function(t){return DL(KI(e,t))},n}var OL=DL(hI);OL.Axios=SL,OL.CanceledError=MI,OL.CancelToken=CL,OL.isCancel=jI,OL.VERSION=gL,OL.toFormData=JF,OL.AxiosError=HF,OL.Cancel=OL.CanceledError,OL.all=function(e){return Promise.all(e)},OL.spread=wL,OL.isAxiosError=TL,OL.mergeConfig=KI,OL.AxiosHeaders=kI,OL.formToJSON=e=>pI(q.isHTMLForm(e)?new FormData(e):e),OL.getAdapter=pL.getAdapter,OL.HttpStatusCode=EL,OL.default=OL;var kL=u(AP(),1),AL=``;async function jL(e){try{return(await OL({baseURL:AL,...e})).data}catch(e){if(OL.isAxiosError(e)&&e.response&&e.response.data){let t=e.response.data;throw new ML(e.response.status,t.message,t.issues)}throw e}}var ML=class extends Error{code;message;issues;isSonamuError;constructor(e,t,n){super(t),this.code=e,this.message=t,this.issues=n,this.isSonamuError=!0}};function NL(e){return e&&e.isSonamuError===!0}function PL(e){NL(e)?alert(e.message):alert(`에러 발생`)}var J;(function(e){function t(){return jL({method:`GET`,url:`/sonamu-ui/api/sonamu/config`})}e.getSonamuConfig=t;function n(){return N_({queryKey:[`entities`,`findMany`],queryFn:()=>jL({method:`GET`,url:`/sonamu-ui/api/entity/findMany`})})}e.useEntities=n;function r(e){return N_({queryKey:[`entity`,`typeIds`,e],queryFn:()=>jL({method:`GET`,url:`/sonamu-ui/api/entity/typeIds`,params:{filter:e,reload:`1`}})})}e.useTypeIds=r;function i(e){return jL({method:`POST`,url:`/sonamu-ui/api/entity/create`,data:{form:e}})}e.createEntity=i;function a(e){return jL({method:`POST`,url:`/sonamu-ui/api/entity/del`,data:{entityId:e}})}e.delEntity=a;function o(e,t){return jL({method:`POST`,url:`/sonamu-ui/api/entity/modifyEntityBase`,data:{entityId:e,newValues:t}})}e.modifyEntityBase=o;function s(e,t,n,r){return jL({method:`POST`,url:`/sonamu-ui/api/entity/modifySubset`,data:{entityId:e,subsetKey:t,fields:n,fieldsInternal:r}})}e.modifySubset=s;function c(e,t){return jL({method:`POST`,url:`/sonamu-ui/api/entity/delSubset`,data:{entityId:e,subsetKey:t}})}e.delSubset=c;function l(e,t,n){return jL({method:`POST`,url:`/sonamu-ui/api/entity/createProp`,data:{entityId:e,at:n,newProp:t}})}e.createProp=l;function u(e,t,n){return jL({method:`POST`,url:`/sonamu-ui/api/entity/modifyProp`,data:{entityId:e,at:n,newProp:t}})}e.modifyProp=u;function d(e,t){return jL({method:`POST`,url:`/sonamu-ui/api/entity/delProp`,data:{entityId:e,at:t}})}e.delProp=d;function f(e,t,n){return jL({method:`POST`,url:`/sonamu-ui/api/entity/moveProp`,data:{entityId:e,at:t,to:n}})}e.moveProp=f;function p(e,t){return jL({method:`POST`,url:`/sonamu-ui/api/entity/modifyIndexes`,data:{entityId:e,indexes:t}})}e.modifyIndexes=p;function m(e,t){return jL({method:`POST`,url:`/sonamu-ui/api/entity/modifyEnumLabels`,data:{entityId:e,enumLabels:t}})}e.modifyEnumLabels=m;function h(e){return jL({method:`POST`,url:`/sonamu-ui/api/entity/createEnumId`,data:e})}e.createEnumId=h;function g(e,t){return jL({method:`POST`,url:`/sonamu-ui/api/entity/modifyEnumId`,data:{entityId:e,enumId:t}})}e.modifyEnumId=g;function _(e){return jL({method:`POST`,url:`/sonamu-ui/api/entity/deleteEnumId`,data:e})}e.deleteEnumId=_;function v(e){return jL({method:`GET`,url:`/sonamu-ui/api/entity/getTableColumns`,params:{entityId:e}})}e.getTableColumns=v;function y(){return N_({queryKey:[`migrations`,`status`],queryFn:()=>jL({method:`GET`,url:`/sonamu-ui/api/migrations/status`})})}e.useMigrationStatus=y;function b(e,t,n){return jL({method:`POST`,url:`/sonamu-ui/api/migrations/runAction`,data:{action:e,targets:t,...n}})}e.migrationsRunAction=b;function x(e,t){return jL({method:`POST`,url:`/sonamu-ui/api/migrations/checkApproval`,data:{channel:e,ts:t}})}e.migrationsCheckApproval=x;function S(e,t,n,r){return jL({method:`POST`,url:`/sonamu-ui/api/migrations/forceApproval`,data:{channel:e,ts:t,reason:n,requestor:r}})}e.migrationsForceApproval=S;function C(e){return jL({method:`POST`,url:`/sonamu-ui/api/migrations/delCodes`,data:{codeNames:e}})}e.migrationsDelCodes=C;function w(){return jL({method:`POST`,url:`/sonamu-ui/api/migrations/generatePreparedCodes`,data:{}})}e.migrationsGeneratePreparedCodes=w;function T(e){return jL({method:`GET`,url:`/sonamu-ui/api/tools/openVscode`,params:e})}e.openVscode=T;function E(e){return jL({method:`GET`,url:`/sonamu-ui/api/tools/getSuggestion`,params:e})}e.getSuggestion=E;function D(e){let t=e.entityIds.length>0&&e.templateKeys.length>0;return N_({queryKey:[`scaffolding`,`getStatus`,e],queryFn:()=>jL({method:`POST`,url:`/sonamu-ui/api/scaffolding/getStatus`,data:e}),enabled:t})}e.useScaffoldingStatus=D;function O(e){return jL({method:`POST`,url:`/sonamu-ui/api/scaffolding/generate`,data:{options:e}})}e.scaffoldingGenerate=O;function k(e){return jL({method:`POST`,url:`/sonamu-ui/api/scaffolding/preview`,data:{option:e}})}e.scaffoldingPreview=k;function A(e){return jL({method:`GET`,url:`/sonamu-ui/api/openai/messages`,params:{id:e}})}e.getMessages=A;function j(e){return jL({method:`POST`,url:`/sonamu-ui/api/openai/chat`,data:{message:e}})}e.chat=j;function M(){return jL({method:`POST`,url:`/sonamu-ui/api/openai/clearThread`})}e.clearThread=M;function N(e,t,n,r){return jL({method:`POST`,url:`/sonamu-ui/api/fixture`,data:{sourceDB:e,targetDB:t,search:n,duplicateCheck:r}})}e.getFixtures=N;function P(e,t){return jL({method:`POST`,url:`/sonamu-ui/api/fixture/import`,data:{db:e,fixtures:t}})}e.importFixtures=P;function F(){return N_({queryKey:[`i18n`,`dictionary`],queryFn:()=>jL({method:`GET`,url:`/sonamu-ui/api/i18n/dictionary`})})}e.useI18nDictionary=F;function ee(e){let t=new FormData;return t.append(`file`,e),jL({method:`POST`,url:`/sonamu-ui/api/i18n/import`,data:t,headers:{"Content-Type":`multipart/form-data`}})}e.importI18n=ee;function te(e){return jL({method:`POST`,url:`/sonamu-ui/api/i18n/update`,data:e})}e.updateI18n=te;function ne(e){return jL({method:`POST`,url:`/sonamu-ui/api/i18n/create`,data:e})}e.createI18n=ne;function I(e){return jL({method:`POST`,url:`/sonamu-ui/api/i18n/delete`,data:{key:e}})}e.deleteI18n=I;function re(e){return jL({method:`POST`,url:`/sonamu-ui/api/i18n/checkUsage`,data:{keys:e}})}e.checkI18nUsage=re;function ie(){return N_({queryKey:[`test`,`status`],queryFn:()=>jL({method:`GET`,url:`/__test__/status`})})}e.useTestStatus=ie;function ae(e){return N_({queryKey:[`tasks`,`workflowRuns`,e],queryFn:()=>jL({method:`GET`,url:`/sonamu-ui/api/tasks/workflowRuns`,params:{...e?.limit?{limit:String(e.limit)}:{},...e?.after?{after:e.after}:{},...e?.before?{before:e.before}:{},...e?.status?.length?{status:e.status.join(`,`)}:{},...e?.workflowName?{workflowName:e.workflowName}:{},...e?.createdAfter?{createdAfter:e.createdAfter}:{},...e?.createdBefore?{createdBefore:e.createdBefore}:{},order:`desc`}}),refetchInterval:5e3})}e.useWorkflowRuns=ae;function oe(e){return N_({queryKey:[`tasks`,`workflowRun`,e],queryFn:()=>jL({method:`GET`,url:`/sonamu-ui/api/tasks/workflowRuns/${e}`}),refetchInterval:5e3})}e.useWorkflowRun=oe;function se(e){return N_({queryKey:[`tasks`,`stepAttempts`,e],queryFn:()=>jL({method:`GET`,url:`/sonamu-ui/api/tasks/workflowRuns/${e}/steps`}),refetchInterval:5e3})}e.useStepAttempts=se;function ce(){return N_({queryKey:[`tasks`,`workflowDefinitions`],queryFn:()=>jL({method:`GET`,url:`/sonamu-ui/api/tasks/workflowDefinitions`})})}e.useWorkflowDefinitions=ce;function le(e){return jL({method:`POST`,url:`/sonamu-ui/api/tasks/workflowRuns/${e}/cancel`})}e.cancelWorkflowRun=le;function ue(e){return jL({method:`POST`,url:`/sonamu-ui/api/tasks/workflowRuns/${e}/pause`})}e.pauseWorkflowRun=ue;function de(e){return jL({method:`POST`,url:`/sonamu-ui/api/tasks/workflowRuns/${e}/resume`})}e.resumeWorkflowRun=de;function fe(e,t){return jL({method:`POST`,url:`/sonamu-ui/api/entity/updateCone`,data:{entityId:e,target:`entity`,cone:t}})}e.updateEntityCone=fe;function pe(e,t,n){return jL({method:`POST`,url:`/sonamu-ui/api/entity/updateCone`,data:{entityId:e,target:`prop`,propName:t,cone:n}})}e.updatePropCone=pe;function me(e,t,n){return jL({method:`POST`,url:`/sonamu-ui/api/entity/updateCone`,data:{entityId:e,target:`enum`,enumId:t,cone:n}})}e.updateEnumCone=me;function he(e,t,n){return jL({method:`POST`,url:`/sonamu-ui/api/entity/updateCone`,data:{entityId:e,target:`subset`,subsetKey:t,cone:n}})}e.updateSubsetCone=he;function ge(e,t){return jL({method:`POST`,url:`/sonamu-ui/api/entity/generateCones`,data:{entityId:e,...t}})}e.generateCones=ge})(J||={});var FL=.3,IL=`bg-amber-200/60 text-amber-900 rounded-sm`;function LL(e,t){let n=e.toLowerCase(),r=t.toLowerCase();if(r.length===0||r.length>n.length)return null;let i=n.indexOf(r);if(i!==-1)return{score:1,indices:Array.from({length:r.length},(e,t)=>i+t)};let a=[],o=0;for(let e=0;e<n.length&&o<r.length;e++)n[e]===r[o]&&(a.push(e),o++);if(o<r.length)return null;let s=0;for(let t=0;t<a.length;t++){let n=a[t];t>0&&n===a[t-1]+1?s+=1:n===0||RL(e,n)?s+=.8:s+=.1}return{score:s/a.length,indices:a}}function RL(e,t){if(t===0)return!0;let n=e[t-1],r=e[t];return n===`_`||n===` `||n===`-`||n===`.`||n===n.toLowerCase()&&r===r.toUpperCase()&&r!==r.toLowerCase()}function zL({text:e,search:t,indices:n}){if(!t)return(0,z.jsx)(`span`,{children:e});let r=n??LL(e,t)?.indices;if(!r||r.length===0)return(0,z.jsx)(`span`,{children:e});if(r.every((e,t)=>t===0||e===r[t-1]+1)){let t=r[0],n=r[r.length-1]+1;return(0,z.jsxs)(`span`,{children:[e.slice(0,t),(0,z.jsx)(`span`,{className:IL,children:e.slice(t,n)}),e.slice(n)]})}let i=[],a=0;for(let t of r)t>a&&i.push(e.slice(a,t)),i.push((0,z.jsx)(`span`,{className:IL,children:e[t]},t)),a=t+1;return a<e.length&&i.push(e.slice(a)),(0,z.jsx)(`span`,{children:i})}function BL({open:e,onClose:t}){let[n,r]=(0,m.useState)(``),i=uP(),{data:a}=J.useEntities(),{entities:o}=a??{},s=(0,m.useMemo)(()=>!o||!n?[]:o.map(e=>{let t=LL(`${e.id} ${e.title}`,n),r=t!==null&&t.score>=FL,i=e.props.filter(e=>{let t=LL(`${e.name} ${e.desc??``}`,n);return t!==null&&t.score>=FL}),a=Object.entries(e.subsets).flatMap(([e,t])=>t.filter(t=>{let r=LL(`${e} ${t}`,n);return r!==null&&r.score>=FL}).map(t=>({subsetKey:e,field:t}))),o=Object.keys(e.enumLabels).filter(e=>{let t=LL(e,n);return t!==null&&t.score>=FL});return r||i.length>0||a.length>0||o.length>0?{entity:e,entityMatch:r,matchedProps:i,matchedSubsets:a,matchedEnums:o,bestScore:Math.max(t?.score??0,...i.map(e=>LL(`${e.name} ${e.desc??``}`,n)?.score??0),...a.map(({subsetKey:e,field:t})=>LL(`${e} ${t}`,n)?.score??0),...o.map(e=>LL(e,n)?.score??0))}:null}).filter(Boolean).toSorted((e,t)=>(t?.bestScore??0)-(e?.bestScore??0)),[o,n]),c=(e,n)=>{r(``),t(),i({to:e}),n&&l(n)},l=e=>{let t=0,n=setInterval(()=>{t++;let r=document.getElementById(e);r?(clearInterval(n),r.scrollIntoView({behavior:`instant`,block:`center`}),r.style.backgroundColor=`#fef3c7`,r.style.boxShadow=`0 0 0 2px #fbbf24`,setTimeout(()=>{r.style.backgroundColor=``,r.style.boxShadow=``,r.style.transition=`background-color 1s, box-shadow 1s`},1e3)):t>=50&&clearInterval(n)},100)};return(0,z.jsxs)(sf,{open:e,onOpenChange:e=>{e||(r(``),t())},commandProps:{shouldFilter:!1},children:[(0,z.jsx)(cf,{placeholder:`Search entities...`,value:n,onValueChange:r}),(0,z.jsxs)(lf,{className:`max-h-[60vh]`,children:[n&&s.length===0&&(0,z.jsx)(uf,{children:`검색 결과가 없습니다.`}),s.map(e=>{if(!e)return null;let{entity:t,entityMatch:r,matchedProps:i,matchedSubsets:a,matchedEnums:o}=e;return(0,z.jsxs)(df,{heading:(0,z.jsx)(zL,{text:`${t.id} ${t.title}`,search:n}),children:[r&&(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(pf,{value:`entity:${t.id} ${t.title}`,onSelect:()=>c(`/entities/${t.id}`),children:(0,z.jsx)(zL,{text:`${t.id} (${t.title})`,search:n})}),(0,z.jsxs)(pf,{value:`scaffolding:${t.id} ${t.title}`,onSelect:()=>c(`/scaffolding`,t.id),children:[`Scaffolding >`,` `,(0,z.jsx)(zL,{text:`${t.id}(${t.title})`,search:n})]})]}),i.map(e=>(0,z.jsxs)(pf,{value:`prop:${e.name} ${e.desc??``} ${t.id}`,onSelect:()=>c(`/entities/${t.id}`,`prop-${e.name}`),children:[`prop > `,(0,z.jsx)(zL,{text:e.name,search:n}),e.desc?(0,z.jsxs)(`span`,{children:[` (`,(0,z.jsx)(zL,{text:e.desc,search:n}),`)`]}):null]},`prop-${e.name}`)),a.map(({subsetKey:e,field:r})=>(0,z.jsxs)(pf,{value:`subset:${e} ${r} ${t.id}`,onSelect:()=>c(`/entities/${t.id}`,r),children:[`Subset`,e,` > `,(0,z.jsx)(zL,{text:r,search:n})]},`subset-${e}-${r}`)),o.map(e=>(0,z.jsxs)(pf,{value:`enum:${e} ${t.id}`,onSelect:()=>c(`/entities/${t.id}`,`enum-${e}`),children:[`enum > `,(0,z.jsx)(zL,{text:e,search:n})]},`enum-${e}`))]},t.id)})]})]})}function VL({children:e}){let{SD:t}=kP(),n=DP(),r=uie(),i=[{name:t(`nav.entities`),path:`/entities`},{name:t(`nav.migration`),path:`/migrations`},{name:t(`nav.scaffolding`),path:`/scaffolding`},{name:t(`nav.fixture`),path:`/fixture`},{name:t(`nav.i18n`),path:`/i18n`},{name:t(`nav.tasks`),path:`/tasks`},{name:t(`nav.testResults`),path:`/test-results`},{name:t(`nav.cdd`),path:`/cdd`}],a=rie(),[o,s]=(0,m.useState)(!1),[c,l]=(0,m.useState)(null),u=e=>{(e.metaKey||e.ctrlKey)&&e.key===`k`&&(e.preventDefault(),s(!0))};return(0,m.useEffect)(()=>(document.addEventListener(`keydown`,u),()=>{document.removeEventListener(`keydown`,u)}),[]),(0,m.useEffect)(()=>{J.getSonamuConfig().then(e=>{e.projectName&&(l(e.projectName),document.title=`${e.projectName}: Sonamu UI`)})},[]),(0,z.jsxs)(z.Fragment,{children:[(0,z.jsxs)(`div`,{className:`app`,children:[(0,z.jsxs)(`div`,{className:`w-full h-gnb bg-sidebar-bg text-white sticky top-0 left-0 flex items-center z-100 border-b border-white/10 justify-between`,children:[(0,z.jsxs)(`div`,{className:`flex`,children:[(0,z.jsxs)(`div`,{className:`p-4 font-bold w-sidemenu tracking-[-0.5px]`,children:[(0,z.jsx)(`span`,{children:`🌲 \xA0 Sonamu UI`}),(0,z.jsxs)(`span`,{className:`font-normal text-text-muted text-[0.9em] ml-2`,children:[`\xA0 `,c]})]}),(0,z.jsx)(`div`,{className:`flex gap-[0.3em] text-[0.9em]`,children:i.map((e,t)=>(0,z.jsx)(mP,{className:(0,kL.default)(`self-center px-6 py-[0.8em] cursor-pointer text-center text-text-light! no-underline rounded-md transition-all duration-200`,`hover:bg-white/10 hover:text-white!`,{"bg-white/15! font-semibold text-white!":a.pathname.includes(e.path)}),to:e.path,children:(0,z.jsx)(`div`,{children:e.name})},t))})]}),(0,z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,z.jsx)(`select`,{value:n,onChange:e=>r(e.target.value),className:`px-2 py-[0.4em] rounded-md border border-white/10 bg-black/20 cursor-pointer text-text-muted text-[0.85em] transition-all duration-200 hover:border-accent hover:text-white`,children:OP.map(e=>(0,z.jsx)(`option`,{value:e.value,children:e.label},e.value))}),(0,z.jsxs)(`button`,{type:`button`,className:`mr-4 px-4 py-[0.4em] rounded-[20px] border border-white/10 bg-black/20 cursor-pointer text-text-muted text-[0.9em] transition-all duration-200 hover:border-accent hover:text-white *:mr-2`,onClick:()=>s(!0),children:[(0,z.jsx)(`span`,{children:`🔍`}),(0,z.jsx)(`span`,{children:t(`nav.search`)}),(0,z.jsx)(`kbd`,{className:`keycap`,children:`⌘`}),(0,z.jsx)(`kbd`,{className:`keycap`,children:`K`})]})]})]}),(0,z.jsx)(`div`,{className:`content`,children:e})]}),(0,z.jsx)(BL,{open:o,onClose:()=>s(!1)}),(0,z.jsx)(Kee,{})]})}var HL=Vre()({component:UL});function UL(){return(0,z.jsx)(VL,{children:(0,z.jsx)(CP,{})})}function Y(){return Y=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Y.apply(null,arguments)}function WL(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var GL={},KL=(0,m.createContext)(GL),qL=(e,t)=>Y({},e,t),JL=()=>(0,m.useContext)(KL),YL=(0,m.createContext)(()=>{});YL.displayName=`JVR.DispatchShowTools`;function XL(){return(0,m.useReducer)(qL,GL)}function ZL(){return(0,m.useContext)(YL)}var QL=e=>{var{initial:t,dispatch:n,children:r}=e;return(0,z.jsx)(KL.Provider,{value:t,children:(0,z.jsx)(YL.Provider,{value:n,children:r})})};QL.displayName=`JVR.ShowTools`;var $L={},eR=(0,m.createContext)($L),tR=(e,t)=>Y({},e,t),nR=()=>(0,m.useContext)(eR),rR=(0,m.createContext)(()=>{});rR.displayName=`JVR.DispatchExpands`;function iR(){return(0,m.useReducer)(tR,$L)}function aR(){return(0,m.useContext)(rR)}var oR=e=>{var{initial:t,dispatch:n,children:r}=e;return(0,z.jsx)(eR.Provider,{value:t,children:(0,z.jsx)(rR.Provider,{value:n,children:r})})};oR.displayName=`JVR.Expands`;var sR={Str:{as:`span`,"data-type":`string`,style:{color:`var(--w-rjv-type-string-color, #cb4b16)`},className:`w-rjv-type`,children:`string`},Url:{as:`a`,style:{color:`var(--w-rjv-type-url-color, #0969da)`},"data-type":`url`,className:`w-rjv-type`,children:`url`},Undefined:{style:{color:`var(--w-rjv-type-undefined-color, #586e75)`},as:`span`,"data-type":`undefined`,className:`w-rjv-type`,children:`undefined`},Null:{style:{color:`var(--w-rjv-type-null-color, #d33682)`},as:`span`,"data-type":`null`,className:`w-rjv-type`,children:`null`},Map:{style:{color:`var(--w-rjv-type-map-color, #268bd2)`,marginRight:3},as:`span`,"data-type":`map`,className:`w-rjv-type`,children:`Map`},Nan:{style:{color:`var(--w-rjv-type-nan-color, #859900)`},as:`span`,"data-type":`nan`,className:`w-rjv-type`,children:`NaN`},Bigint:{style:{color:`var(--w-rjv-type-bigint-color, #268bd2)`},as:`span`,"data-type":`bigint`,className:`w-rjv-type`,children:`bigint`},Int:{style:{color:`var(--w-rjv-type-int-color, #268bd2)`},as:`span`,"data-type":`int`,className:`w-rjv-type`,children:`int`},Set:{style:{color:`var(--w-rjv-type-set-color, #268bd2)`,marginRight:3},as:`span`,"data-type":`set`,className:`w-rjv-type`,children:`Set`},Float:{style:{color:`var(--w-rjv-type-float-color, #859900)`},as:`span`,"data-type":`float`,className:`w-rjv-type`,children:`float`},True:{style:{color:`var(--w-rjv-type-boolean-color, #2aa198)`},as:`span`,"data-type":`bool`,className:`w-rjv-type`,children:`bool`},False:{style:{color:`var(--w-rjv-type-boolean-color, #2aa198)`},as:`span`,"data-type":`bool`,className:`w-rjv-type`,children:`bool`},Date:{style:{color:`var(--w-rjv-type-date-color, #268bd2)`},as:`span`,"data-type":`date`,className:`w-rjv-type`,children:`date`}},cR=(0,m.createContext)(sR),lR=(e,t)=>Y({},e,t),uR=()=>(0,m.useContext)(cR),dR=(0,m.createContext)(()=>{});dR.displayName=`JVR.DispatchTypes`;function fR(){return(0,m.useReducer)(lR,sR)}function pR(){return(0,m.useContext)(dR)}function mR(e){var{initial:t,dispatch:n,children:r}=e;return(0,z.jsx)(cR.Provider,{value:t,children:(0,z.jsx)(dR.Provider,{value:n,children:r})})}mR.displayName=`JVR.Types`;var hR=[`style`];function gR(e){var{style:t}=e,n=WL(e,hR);return(0,z.jsx)(`svg`,Y({viewBox:`0 0 24 24`,fill:`var(--w-rjv-arrow-color, currentColor)`,style:Y({cursor:`pointer`,height:`1em`,width:`1em`,userSelect:`none`,display:`inline-flex`},t)},n,{children:(0,z.jsx)(`path`,{d:`M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z`})}))}gR.displayName=`JVR.TriangleArrow`;var _R={Arrow:{as:`span`,className:`w-rjv-arrow`,style:{transform:`rotate(0deg)`,transition:`all 0.3s`},children:(0,z.jsx)(gR,{})},Colon:{as:`span`,style:{color:`var(--w-rjv-colon-color, var(--w-rjv-color))`,marginLeft:0,marginRight:2},className:`w-rjv-colon`,children:`:`},Quote:{as:`span`,style:{color:`var(--w-rjv-quotes-color, #236a7c)`},className:`w-rjv-quotes`,children:`"`},ValueQuote:{as:`span`,style:{color:`var(--w-rjv-quotes-string-color, #cb4b16)`},className:`w-rjv-quotes`,children:`"`},BracketsLeft:{as:`span`,style:{color:`var(--w-rjv-brackets-color, #236a7c)`},className:`w-rjv-brackets-start`,children:`[`},BracketsRight:{as:`span`,style:{color:`var(--w-rjv-brackets-color, #236a7c)`},className:`w-rjv-brackets-end`,children:`]`},BraceLeft:{as:`span`,style:{color:`var(--w-rjv-curlybraces-color, #236a7c)`},className:`w-rjv-curlybraces-start`,children:`{`},BraceRight:{as:`span`,style:{color:`var(--w-rjv-curlybraces-color, #236a7c)`},className:`w-rjv-curlybraces-end`,children:`}`}},vR=(0,m.createContext)(_R),yR=(e,t)=>Y({},e,t),bR=()=>(0,m.useContext)(vR),xR=(0,m.createContext)(()=>{});xR.displayName=`JVR.DispatchSymbols`;function SR(){return(0,m.useReducer)(yR,_R)}function CR(){return(0,m.useContext)(xR)}var wR=e=>{var{initial:t,dispatch:n,children:r}=e;return(0,z.jsx)(vR.Provider,{value:t,children:(0,z.jsx)(xR.Provider,{value:n,children:r})})};wR.displayName=`JVR.Symbols`;var TR={Copied:{className:`w-rjv-copied`,style:{height:`1em`,width:`1em`,cursor:`pointer`,verticalAlign:`middle`,marginLeft:5}},CountInfo:{as:`span`,className:`w-rjv-object-size`,style:{color:`var(--w-rjv-info-color, #0000004d)`,paddingLeft:8,fontStyle:`italic`}},CountInfoExtra:{as:`span`,className:`w-rjv-object-extra`,style:{paddingLeft:8}},Ellipsis:{as:`span`,style:{cursor:`pointer`,color:`var(--w-rjv-ellipsis-color, #cb4b16)`,userSelect:`none`},className:`w-rjv-ellipsis`,children:`...`},Row:{as:`div`,className:`w-rjv-line`},KeyName:{as:`span`,className:`w-rjv-object-key`}},ER=(0,m.createContext)(TR),DR=(e,t)=>Y({},e,t),OR=()=>(0,m.useContext)(ER),kR=(0,m.createContext)(()=>{});kR.displayName=`JVR.DispatchSection`;function AR(){return(0,m.useReducer)(DR,TR)}function jR(){return(0,m.useContext)(kR)}var MR=e=>{var{initial:t,dispatch:n,children:r}=e;return(0,z.jsx)(ER.Provider,{value:t,children:(0,z.jsx)(kR.Provider,{value:n,children:r})})};MR.displayName=`JVR.Section`;var NR={objectSortKeys:!1,indentWidth:15},PR=(0,m.createContext)(NR);PR.displayName=`JVR.Context`;var FR=(0,m.createContext)(()=>{});FR.displayName=`JVR.DispatchContext`;function IR(e,t){return Y({},e,t)}var LR=()=>(0,m.useContext)(PR),RR=e=>{var{children:t,initialState:n,initialTypes:r}=e,[i,a]=(0,m.useReducer)(IR,Object.assign({},NR,n)),[o,s]=XL(),[c,l]=iR(),[u,d]=fR(),[f,p]=SR(),[h,g]=AR();return(0,m.useEffect)(()=>a(Y({},n)),[n]),(0,z.jsx)(PR.Provider,{value:i,children:(0,z.jsx)(FR.Provider,{value:a,children:(0,z.jsx)(QL,{initial:o,dispatch:s,children:(0,z.jsx)(oR,{initial:c,dispatch:l,children:(0,z.jsx)(mR,{initial:Y({},u,r),dispatch:d,children:(0,z.jsx)(wR,{initial:f,dispatch:p,children:(0,z.jsx)(MR,{initial:h,dispatch:g,children:t})})})})})})})};RR.displayName=`JVR.Provider`;function zR(e){if(e==null)throw TypeError(`Cannot destructure `+e)}var BR=[`isNumber`,`value`,`parentValue`,`keyName`,`keys`],VR=[`as`,`render`],HR=[`as`,`render`],UR=[`as`,`render`],WR=[`as`,`style`,`render`],GR=[`as`,`render`],KR=[`as`,`render`],qR=[`as`,`render`],JR=[`as`,`render`],YR=e=>{var{Quote:t={}}=bR(),{isNumber:n,value:r,parentValue:i,keyName:a,keys:o}=e,s=WL(e,BR);if(n)return null;var{as:c,render:l}=t,u=WL(t,VR),d=c||`span`,f=Y({},s,u);return typeof f.children==`string`&&(f.children=f.children.trim()||void 0),l&&typeof l==`function`&&l(f,{value:r,parentValue:i,keyName:a,keys:o||(a?[a]:[])})||(0,z.jsx)(d,Y({},f))};YR.displayName=`JVR.Quote`;var XR=e=>{var{ValueQuote:t={}}=bR(),n=Y({},(zR(e),e)),{as:r,render:i}=t,a=WL(t,HR),o=r||`span`,s=Y({},n,a);return i&&typeof i==`function`&&i(s,{})||(0,z.jsx)(o,Y({},s))};XR.displayName=`JVR.ValueQuote`;var ZR=e=>{var{value:t,parentValue:n,keyName:r,keys:i}=e,{Colon:a={}}=bR(),{as:o,render:s}=a,c=WL(a,UR),l=o||`span`;return s&&typeof s==`function`&&s(c,{value:t,parentValue:n,keyName:r,keys:i||(r?[r]:[])})||(0,z.jsx)(l,Y({},c))};ZR.displayName=`JVR.Colon`;var QR=e=>{var{Arrow:t={}}=bR(),n=nR(),{expandKey:r,style:i,value:a,parentValue:o,keyName:s,keys:c}=e,l=!!n[r],{as:u,style:d,render:f}=t,p=WL(t,WR),m=u||`span`,h=f&&typeof f==`function`,g=Y({},p,{"data-expanded":l,style:Y({},d,i)});return h&&f(g,{value:a,parentValue:o,keyName:s,keys:c||(s?[s]:[])})||(0,z.jsx)(m,Y({},p,{style:Y({},d,i)}))};QR.displayName=`JVR.Arrow`;var $R=e=>{var{isBrackets:t,value:n,parentValue:r,keyName:i,keys:a}=e,{BracketsLeft:o={},BraceLeft:s={}}=bR(),c={value:n,parentValue:r,keyName:i,keys:a||(i?[i]:[])};if(t){var{as:l,render:u}=o,d=WL(o,GR),f=l||`span`;return u&&typeof u==`function`&&u(d,c)||(0,z.jsx)(f,Y({},d))}var{as:p,render:m}=s,h=WL(s,KR),g=p||`span`;return m&&typeof m==`function`&&m(h,c)||(0,z.jsx)(g,Y({},h))};$R.displayName=`JVR.BracketsOpen`;var ez=e=>{var{isBrackets:t,isVisiable:n,value:r,parentValue:i,keyName:a,keys:o}=e,s={value:r,parentValue:i,keyName:a,keys:o||(a?[a]:[])};if(!n)return null;var{BracketsRight:c={},BraceRight:l={}}=bR();if(t){var{as:u,render:d}=c,f=WL(c,qR),p=u||`span`;return d&&typeof d==`function`&&d(f,s)||(0,z.jsx)(p,Y({},f))}var{as:m,render:h}=l,g=WL(l,JR),_=m||`span`;return h&&typeof h==`function`&&h(g,s)||(0,z.jsx)(_,Y({},g))};ez.displayName=`JVR.BracketsClose`;var tz=e=>{var{keyName:t,value:n,expandKey:r,parentValue:i,level:a,keys:o=[]}=e,s=nR(),{collapsed:c,shouldExpandNodeInitially:l}=LR(),u=typeof c==`boolean`?c:typeof c==`number`?a>c:!1,d=s[r]??(l?!1:u),f=l&&l(!d,{value:n,keys:o,level:a,keyName:t,parentValue:i});if(l&&c===!1){if(s[r]===void 0&&!f)return null}else if(s[r]===void 0&&f)return null;var p=Object.keys(n).length;if(d||p===0)return null;var m={paddingLeft:4},h={keyName:t,value:n,keys:o,parentValue:i},g=Array.isArray(n),_=n instanceof Set;return(0,z.jsx)(`div`,{style:m,children:(0,z.jsx)(ez,Y({isBrackets:g||_},h,{isVisiable:!0}))})};tz.displayName=`JVR.NestedClose`;var nz=[`as`,`render`],rz=[`as`,`render`],iz=[`as`,`render`],az=[`as`,`render`],oz=[`as`,`render`],sz=[`as`,`render`],cz=[`as`,`render`],lz=[`as`,`render`],uz=[`as`,`render`],dz=[`as`,`render`],fz=[`as`,`render`],pz=[`as`,`render`],mz=[`as`,`render`],hz=e=>{if(e===void 0)return`0n`;if(typeof e==`string`)try{e=BigInt(e)}catch{return`0n`}return e?e.toString()+`n`:`0n`},gz=e=>{var{value:t,keyName:n}=e,{Set:r={},displayDataTypes:i}=uR();if(!(t instanceof Set)||!i)return null;var{as:a,render:o}=r,s=WL(r,nz);return o&&typeof o==`function`&&o(s,{type:`type`,value:t,keyName:n})||(0,z.jsx)(a||`span`,Y({},s))};gz.displayName=`JVR.SetComp`;var _z=e=>{var{value:t,keyName:n}=e,{Map:r={},displayDataTypes:i}=uR();if(!(t instanceof Map)||!i)return null;var{as:a,render:o}=r,s=WL(r,rz);return o&&typeof o==`function`&&o(s,{type:`type`,value:t,keyName:n})||(0,z.jsx)(a||`span`,Y({},s))};_z.displayName=`JVR.MapComp`;var vz={opacity:.75,paddingRight:4},yz=e=>{var{children:t=``,keyName:n,keys:r}=e,{Str:i={},displayDataTypes:a}=uR(),{shortenTextAfterLength:o=30,stringEllipsis:s=`...`}=LR(),{as:c,render:l}=i,u=WL(i,iz),d=t,[f,p]=(0,m.useState)(o&&d.length>o);(0,m.useEffect)(()=>p(o&&d.length>o),[o]);var h=c||`span`,g=Y({},vz,i.style||{});o>0&&(u.style=Y({},u.style,{cursor:d.length<=o?`initial`:`pointer`}),d.length>o&&(u.onClick=()=>{p(!f)}));var _=f?``+d.slice(0,o)+s:d,v=l&&typeof l==`function`,y=v&&l(Y({},u,{style:g}),{type:`type`,value:t,keyName:n,keys:r}),b=f?`w-rjv-value w-rjv-value-short`:`w-rjv-value`,x=v&&l(Y({},u,{children:_,className:b}),{type:`value`,value:t,keyName:n,keys:r});return(0,z.jsxs)(m.Fragment,{children:[a&&(y||(0,z.jsx)(h,Y({},u,{style:g}))),x||(0,z.jsxs)(m.Fragment,{children:[(0,z.jsx)(XR,{}),(0,z.jsx)(h,Y({},u,{className:b,children:_})),(0,z.jsx)(XR,{})]})]})};yz.displayName=`JVR.TypeString`;var bz=e=>{var{children:t,keyName:n,keys:r}=e,{True:i={},displayDataTypes:a}=uR(),{as:o,render:s}=i,c=WL(i,az),l=o||`span`,u=Y({},vz,i.style||{}),d=s&&typeof s==`function`,f=d&&s(Y({},c,{style:u}),{type:`type`,value:t,keyName:n,keys:r}),p=d&&s(Y({},c,{children:t,className:`w-rjv-value`}),{type:`value`,value:t,keyName:n,keys:r});return(0,z.jsxs)(m.Fragment,{children:[a&&(f||(0,z.jsx)(l,Y({},c,{style:u}))),p||(0,z.jsx)(l,Y({},c,{className:`w-rjv-value`,children:t?.toString()}))]})};bz.displayName=`JVR.TypeTrue`;var xz=e=>{var{children:t,keyName:n,keys:r}=e,{False:i={},displayDataTypes:a}=uR(),{as:o,render:s}=i,c=WL(i,oz),l=o||`span`,u=Y({},vz,i.style||{}),d=s&&typeof s==`function`,f=d&&s(Y({},c,{style:u}),{type:`type`,value:t,keyName:n,keys:r}),p=d&&s(Y({},c,{children:t,className:`w-rjv-value`}),{type:`value`,value:t,keyName:n,keys:r});return(0,z.jsxs)(m.Fragment,{children:[a&&(f||(0,z.jsx)(l,Y({},c,{style:u}))),p||(0,z.jsx)(l,Y({},c,{className:`w-rjv-value`,children:t?.toString()}))]})};xz.displayName=`JVR.TypeFalse`;var Sz=e=>{var{children:t,keyName:n,keys:r}=e,{Float:i={},displayDataTypes:a}=uR(),{as:o,render:s}=i,c=WL(i,sz),l=o||`span`,u=Y({},vz,i.style||{}),d=s&&typeof s==`function`,f=d&&s(Y({},c,{style:u}),{type:`type`,value:t,keyName:n,keys:r}),p=d&&s(Y({},c,{children:t,className:`w-rjv-value`}),{type:`value`,value:t,keyName:n,keys:r});return(0,z.jsxs)(m.Fragment,{children:[a&&(f||(0,z.jsx)(l,Y({},c,{style:u}))),p||(0,z.jsx)(l,Y({},c,{className:`w-rjv-value`,children:t?.toString()}))]})};Sz.displayName=`JVR.TypeFloat`;var Cz=e=>{var{children:t,keyName:n,keys:r}=e,{Int:i={},displayDataTypes:a}=uR(),{as:o,render:s}=i,c=WL(i,cz),l=o||`span`,u=Y({},vz,i.style||{}),d=s&&typeof s==`function`,f=d&&s(Y({},c,{style:u}),{type:`type`,value:t,keyName:n,keys:r}),p=d&&s(Y({},c,{children:t,className:`w-rjv-value`}),{type:`value`,value:t,keyName:n,keys:r});return(0,z.jsxs)(m.Fragment,{children:[a&&(f||(0,z.jsx)(l,Y({},c,{style:u}))),p||(0,z.jsx)(l,Y({},c,{className:`w-rjv-value`,children:t?.toString()}))]})};Cz.displayName=`JVR.TypeInt`;var wz=e=>{var{children:t,keyName:n,keys:r}=e,{Bigint:i={},displayDataTypes:a}=uR(),{as:o,render:s}=i,c=WL(i,lz),l=o||`span`,u=Y({},vz,i.style||{}),d=s&&typeof s==`function`,f=d&&s(Y({},c,{style:u}),{type:`type`,value:t,keyName:n,keys:r}),p=d&&s(Y({},c,{children:t,className:`w-rjv-value`}),{type:`value`,value:t,keyName:n,keys:r});return(0,z.jsxs)(m.Fragment,{children:[a&&(f||(0,z.jsx)(l,Y({},c,{style:u}))),p||(0,z.jsx)(l,Y({},c,{className:`w-rjv-value`,children:hz(t?.toString())}))]})};wz.displayName=`JVR.TypeFloat`;var Tz=e=>{var{children:t,keyName:n,keys:r}=e,{Url:i={},displayDataTypes:a}=uR(),{as:o,render:s}=i,c=WL(i,uz),l=o||`span`,u=Y({},vz,i.style),d=s&&typeof s==`function`,f=d&&s(Y({},c,{style:u}),{type:`type`,value:t,keyName:n,keys:r}),p=d&&s(Y({},c,{children:t?.href,className:`w-rjv-value`}),{type:`value`,value:t,keyName:n,keys:r});return(0,z.jsxs)(m.Fragment,{children:[a&&(f||(0,z.jsx)(l,Y({},c,{style:u}))),p||(0,z.jsxs)(`a`,Y({href:t?.href,target:`_blank`},c,{className:`w-rjv-value`,children:[(0,z.jsx)(XR,{}),t?.href,(0,z.jsx)(XR,{})]}))]})};Tz.displayName=`JVR.TypeUrl`;var Ez=e=>{var{children:t,keyName:n,keys:r}=e,{Date:i={},displayDataTypes:a}=uR(),{as:o,render:s}=i,c=WL(i,dz),l=o||`span`,u=Y({},vz,i.style||{}),d=s&&typeof s==`function`,f=d&&s(Y({},c,{style:u}),{type:`type`,value:t,keyName:n,keys:r}),p=t instanceof Date?t.toLocaleString():t,h=d&&s(Y({},c,{children:p,className:`w-rjv-value`}),{type:`value`,value:t,keyName:n,keys:r});return(0,z.jsxs)(m.Fragment,{children:[a&&(f||(0,z.jsx)(l,Y({},c,{style:u}))),h||(0,z.jsx)(l,Y({},c,{className:`w-rjv-value`,children:p}))]})};Ez.displayName=`JVR.TypeDate`;var Dz=e=>{var{children:t,keyName:n,keys:r}=e,{Undefined:i={},displayDataTypes:a}=uR(),{as:o,render:s}=i,c=WL(i,fz),l=o||`span`,u=Y({},vz,i.style||{}),d=s&&typeof s==`function`,f=d&&s(Y({},c,{style:u}),{type:`type`,value:t,keyName:n,keys:r}),p=d&&s(Y({},c,{children:t,className:`w-rjv-value`}),{type:`value`,value:t,keyName:n,keys:r});return(0,z.jsxs)(m.Fragment,{children:[a&&(f||(0,z.jsx)(l,Y({},c,{style:u}))),p]})};Dz.displayName=`JVR.TypeUndefined`;var Oz=e=>{var{children:t,keyName:n,keys:r}=e,{Null:i={},displayDataTypes:a}=uR(),{as:o,render:s}=i,c=WL(i,pz),l=o||`span`,u=Y({},vz,i.style||{}),d=s&&typeof s==`function`,f=d&&s(Y({},c,{style:u}),{type:`type`,value:t,keyName:n,keys:r}),p=d&&s(Y({},c,{children:t,className:`w-rjv-value`}),{type:`value`,value:t,keyName:n,keys:r});return(0,z.jsxs)(m.Fragment,{children:[a&&(f||(0,z.jsx)(l,Y({},c,{style:u}))),p]})};Oz.displayName=`JVR.TypeNull`;var kz=e=>{var{children:t,keyName:n,keys:r}=e,{Nan:i={},displayDataTypes:a}=uR(),{as:o,render:s}=i,c=WL(i,mz),l=o||`span`,u=Y({},vz,i.style||{}),d=s&&typeof s==`function`,f=d&&s(Y({},c,{style:u}),{type:`type`,value:t,keyName:n,keys:r}),p=d&&s(Y({},c,{children:t?.toString(),className:`w-rjv-value`}),{type:`value`,value:t,keyName:n,keys:r});return(0,z.jsxs)(m.Fragment,{children:[a&&(f||(0,z.jsx)(l,Y({},c,{style:u}))),p]})};kz.displayName=`JVR.TypeNan`;var mie=e=>Number(e)===e&&e%1!=0||isNaN(e),Az=e=>{var{value:t,keyName:n,keys:r}=e,i={keyName:n,keys:r};return t instanceof URL?(0,z.jsx)(Tz,Y({},i,{children:t})):typeof t==`string`?(0,z.jsx)(yz,Y({},i,{children:t})):t===!0?(0,z.jsx)(bz,Y({},i,{children:t})):t===!1?(0,z.jsx)(xz,Y({},i,{children:t})):t===null?(0,z.jsx)(Oz,Y({},i,{children:t})):t===void 0?(0,z.jsx)(Dz,Y({},i,{children:t})):t instanceof Date?(0,z.jsx)(Ez,Y({},i,{children:t})):typeof t==`number`&&isNaN(t)?(0,z.jsx)(kz,Y({},i,{children:t})):typeof t==`number`&&mie(t)?(0,z.jsx)(Sz,Y({},i,{children:t})):typeof t==`bigint`?(0,z.jsx)(wz,Y({},i,{children:t})):typeof t==`number`?(0,z.jsx)(Cz,Y({},i,{children:t})):null};Az.displayName=`JVR.Value`;function jz(e,t,n){var r=CR(),i=Y({},e,t,{className:[e.className,t.className].filter(Boolean).join(` `),style:Y({},e.style,t.style),children:t.children||e.children});(0,m.useEffect)(()=>r({[n]:i}),[t])}function Mz(e,t,n){var r=pR(),i=Y({},e,t,{className:[e.className,t.className].filter(Boolean).join(` `),style:Y({},e.style,t.style),children:t.children||e.children});(0,m.useEffect)(()=>r({[n]:i}),[t])}function Nz(e,t,n){var r=jR(),i=Y({},e,t,{className:[e.className,t.className].filter(Boolean).join(` `),style:Y({},e.style,t.style),children:t.children||e.children});(0,m.useEffect)(()=>r({[n]:i}),[t])}var hie=[`as`,`render`],Pz=e=>{var{KeyName:t={}}=OR();return Nz(t,e,`KeyName`),null};Pz.displayName=`JVR.KeyName`;var Fz=e=>{var{children:t,value:n,parentValue:r,keyName:i,keys:a}=e,o={color:typeof t==`number`?`var(--w-rjv-key-number, #268bd2)`:`var(--w-rjv-key-string, #002b36)`},{KeyName:s={}}=OR(),{as:c,render:l}=s,u=WL(s,hie);u.style=Y({},u.style,o);var d=c||`span`;return l&&typeof l==`function`&&l(Y({},u,{children:t}),{value:n,parentValue:r,keyName:i,keys:a||(i?[i]:[])})||(0,z.jsx)(d,Y({},u,{children:t}))};Fz.displayName=`JVR.KeyNameComp`;var gie=[`children`,`value`,`parentValue`,`keyName`,`keys`],_ie=[`as`,`render`,`children`],Iz=e=>{var{Row:t={}}=OR();return Nz(t,e,`Row`),null};Iz.displayName=`JVR.Row`;var Lz=e=>{var{children:t,value:n,parentValue:r,keyName:i,keys:a}=e,o=WL(e,gie),{Row:s={}}=OR(),{as:c,render:l}=s,u=WL(s,_ie),d=c||`div`;return l&&typeof l==`function`&&l(Y({},o,u,{children:t}),{value:n,keyName:i,parentValue:r,keys:a})||(0,z.jsx)(d,Y({},o,u,{children:t}))};Lz.displayName=`JVR.RowComp`;function vie(e){var t=(0,m.useRef)();return(0,m.useEffect)(()=>{t.current=e}),t.current}function yie(e){var{value:t,highlightUpdates:n,highlightContainer:r}=e,i=vie(t),a=(0,m.useMemo)(()=>{if(!n||i===void 0)return!1;if(typeof t!=typeof i)return!0;if(typeof t==`number`)return isNaN(t)&&isNaN(i)?!1:t!==i;if(Array.isArray(t)!==Array.isArray(i))return!0;if(typeof t==`object`||typeof t==`function`)return!1;if(t!==i)return!0},[n,t]);(0,m.useEffect)(()=>{r&&r.current&&a&&`animate`in r.current&&r.current.animate([{backgroundColor:`var(--w-rjv-update-color, #ebcb8b)`},{backgroundColor:``}],{duration:1e3,easing:`ease-in`})},[a,t,r])}var bie=[`keyName`,`value`,`parentValue`,`expandKey`,`keys`,`beforeCopy`],xie=[`as`,`render`],Rz=e=>{var{keyName:t,value:n,parentValue:r,expandKey:i,keys:a,beforeCopy:o}=e,s=WL(e,bie),{onCopied:c,enableClipboard:l,beforeCopy:u}=LR(),d=JL()[i],[f,p]=(0,m.useState)(!1),{Copied:h={}}=OR(),g=h?.beforeCopy;if(l===!1||!d)return null;var _={style:{display:`inline-flex`},fill:f?`var(--w-rjv-copied-success-color, #28a745)`:`var(--w-rjv-copied-color, currentColor)`,onClick:e=>{e.stopPropagation();var s=``;s=typeof n==`number`&&n===1/0?`Infinity`:typeof n==`number`&&isNaN(n)?`NaN`:typeof n==`bigint`?hz(n):n instanceof Date?n.toLocaleString():JSON.stringify(n,(e,t)=>typeof t==`bigint`?hz(t):t,2);var l=o||g||u;l&&typeof l==`function`&&(s=l(s,t,n,r,i,a)),c&&c(s,n),p(!0),(navigator.clipboard||{writeText(e){return new Promise((t,n)=>{var r=document.createElement(`textarea`);r.style.position=`absolute`,r.style.opacity=`0`,r.style.left=`-99999999px`,r.value=e,document.body.appendChild(r),r.select(),document.execCommand(`copy`)?t():n(),r.remove()})}}).writeText(s).then(()=>{var e=setTimeout(()=>{p(!1),clearTimeout(e)},3e3)}).catch(e=>{})}},{render:v}=h,y=WL(h,xie),b=Y({},y,s,_,{style:Y({},y.style,s.style,_.style)});return v&&typeof v==`function`&&v(Y({},b,{"data-copied":f}),{value:n,keyName:t,keys:a,parentValue:r})||(f?(0,z.jsx)(`svg`,Y({viewBox:`0 0 32 36`},b,{children:(0,z.jsx)(`path`,{d:`M27.5,33 L2.5,33 L2.5,12.5 L27.5,12.5 L27.5,15.2249049 C29.1403264,13.8627542 29.9736597,13.1778155 30,13.1700887 C30,11.9705278 30,10.0804982 30,7.5 C30,6.1 28.9,5 27.5,5 L20,5 C20,2.2 17.8,0 15,0 C12.2,0 10,2.2 10,5 L2.5,5 C1.1,5 0,6.1 0,7.5 L0,33 C0,34.4 1.1,36 2.5,36 L27.5,36 C28.9,36 30,34.4 30,33 L30,26.1114493 L27.5,28.4926435 L27.5,33 Z M7.5,7.5 L10,7.5 C10,7.5 12.5,6.4 12.5,5 C12.5,3.6 13.6,2.5 15,2.5 C16.4,2.5 17.5,3.6 17.5,5 C17.5,6.4 18.8,7.5 20,7.5 L22.5,7.5 C22.5,7.5 25,8.6 25,10 L5,10 C5,8.5 6.1,7.5 7.5,7.5 Z M5,27.5 L10,27.5 L10,25 L5,25 L5,27.5 Z M28.5589286,16 L32,19.6 L21.0160714,30.5382252 L13.5303571,24.2571429 L17.1303571,20.6571429 L21.0160714,24.5428571 L28.5589286,16 Z M17.5,15 L5,15 L5,17.5 L17.5,17.5 L17.5,15 Z M10,20 L5,20 L5,22.5 L10,22.5 L10,20 Z`})})):(0,z.jsx)(`svg`,Y({viewBox:`0 0 32 36`},b,{children:(0,z.jsx)(`path`,{d:`M27.5,33 L2.5,33 L2.5,12.5 L27.5,12.5 L27.5,20 L30,20 L30,7.5 C30,6.1 28.9,5 27.5,5 L20,5 C20,2.2 17.8,0 15,0 C12.2,0 10,2.2 10,5 L2.5,5 C1.1,5 0,6.1 0,7.5 L0,33 C0,34.4 1.1,36 2.5,36 L27.5,36 C28.9,36 30,34.4 30,33 L30,29 L27.5,29 L27.5,33 Z M7.5,7.5 L10,7.5 C10,7.5 12.5,6.4 12.5,5 C12.5,3.6 13.6,2.5 15,2.5 C16.4,2.5 17.5,3.6 17.5,5 C17.5,6.4 18.8,7.5 20,7.5 L22.5,7.5 C22.5,7.5 25,8.6 25,10 L5,10 C5,8.5 6.1,7.5 7.5,7.5 Z M5,27.5 L10,27.5 L10,25 L5,25 L5,27.5 Z M22.5,21.5 L22.5,16.5 L12.5,24 L22.5,31.5 L22.5,26.5 L32,26.5 L32,21.5 L22.5,21.5 Z M17.5,15 L5,15 L5,17.5 L17.5,17.5 L17.5,15 Z M10,20 L5,20 L5,22.5 L10,22.5 L10,20 Z`})})))};Rz.displayName=`JVR.Copied`;function zz(){var e=(0,m.useRef)(null);return e.current===null&&(e.current=`custom-id-`+Math.random().toString(36).substr(2,9)),e.current}var Bz=e=>{var{keyName:t,value:n,expandKey:r=``,level:i,keys:a=[],parentValue:o}=e,s=nR(),{objectSortKeys:c,indentWidth:l,collapsed:u,shouldExpandNodeInitially:d}=LR(),f=typeof u==`boolean`?u:typeof u==`number`?i>u:!1,p=s[r]??(d?!1:f),m=d&&d(!p,{value:n,keys:a,level:i,keyName:t,parentValue:o});if(d&&u===!1){if(s[r]===void 0&&!m)return null}else if(s[r]===void 0&&m)return null;if(p)return null;var h=Array.isArray(n)?Object.entries(n).map(e=>[Number(e[0]),e[1]]):Object.entries(n);return c&&(h=c===!0?h.sort((e,t)=>{var[n]=e,[r]=t;return typeof n==`string`&&typeof r==`string`?n.localeCompare(r):0}):h.sort((e,t)=>{var[n,r]=e,[i,a]=t;return typeof n==`string`&&typeof i==`string`?c(n,i,r,a):0})),(0,z.jsx)(`div`,{className:`w-rjv-wrap`,style:{borderLeft:`var(--w-rjv-border-left-width, 1px) var(--w-rjv-line-style, solid) var(--w-rjv-line-color, #ebebeb)`,paddingLeft:l,marginLeft:6},children:h.map((e,t)=>{var[r,o]=e;return(0,z.jsx)(Hz,{parentValue:n,keyName:r,keys:[...a,r],value:o,level:i},t)})})};Bz.displayName=`JVR.KeyValues`;var Vz=e=>{var{keyName:t,parentValue:n,keys:r,value:i}=e,{highlightUpdates:a}=LR(),o=typeof t==`number`,s=(0,m.useRef)(null);yie({value:i,highlightUpdates:a,highlightContainer:s});var c={keyName:t,value:i,keys:r,parentValue:n};return(0,z.jsxs)(m.Fragment,{children:[(0,z.jsxs)(`span`,{ref:s,children:[(0,z.jsx)(YR,Y({isNumber:o,"data-placement":`left`},c)),(0,z.jsx)(Fz,Y({},c,{children:t})),(0,z.jsx)(YR,Y({isNumber:o,"data-placement":`right`},c))]}),(0,z.jsx)(ZR,Y({},c))]})};Vz.displayName=`JVR.KayName`;var Hz=e=>{var{keyName:t,value:n,parentValue:r,level:i=0,keys:a=[]}=e,o=ZL(),s=zz(),c=Array.isArray(n),l=n instanceof Set,u=n instanceof Map,d=n instanceof Date,f=n instanceof URL;return n&&typeof n==`object`&&!c&&!l&&!u&&!d&&!f||c||l||u?(0,z.jsx)(Xz,{keyName:t,value:l?Array.from(n):u?Object.fromEntries(n):n,parentValue:r,initialValue:n,keys:a,level:i+1}):(0,z.jsxs)(Lz,Y({className:`w-rjv-line`,value:n,keyName:t,keys:a,parentValue:r},{onMouseEnter:()=>o({[s]:!0}),onMouseLeave:()=>o({[s]:!1})},{children:[(0,z.jsx)(Vz,{keyName:t,value:n,keys:a,parentValue:r}),(0,z.jsx)(Az,{keyName:t,value:n,keys:a}),(0,z.jsx)(Rz,{keyName:t,value:n,keys:a,parentValue:r,expandKey:s})]}))};Hz.displayName=`JVR.KeyValuesItem`;var Sie=[`value`,`keyName`],Cie=[`as`,`render`],Uz=e=>{var{CountInfoExtra:t={}}=OR();return Nz(t,e,`CountInfoExtra`),null};Uz.displayName=`JVR.CountInfoExtra`;var Wz=e=>{var{value:t={},keyName:n}=e,r=WL(e,Sie),{CountInfoExtra:i={}}=OR(),{as:a,render:o}=i,s=WL(i,Cie);if(!o&&!s.children)return null;var c=a||`span`,l=o&&typeof o==`function`,u=Y({},s,r);return l&&o(u,{value:t,keyName:n})||(0,z.jsx)(c,Y({},u))};Wz.displayName=`JVR.CountInfoExtraComps`;var wie=[`value`,`keyName`],Tie=[`as`,`render`],Gz=e=>{var{CountInfo:t={}}=OR();return Nz(t,e,`CountInfo`),null};Gz.displayName=`JVR.CountInfo`;var Kz=e=>{var{value:t={},keyName:n}=e,r=WL(e,wie),{displayObjectSize:i}=LR(),{CountInfo:a={}}=OR();if(!i)return null;var{as:o,render:s}=a,c=WL(a,Tie),l=o||`span`;c.style=Y({},c.style,e.style);var u=Object.keys(t).length;c.children||=u+` item`+(u===1?``:`s`);var d=Y({},c,r);return s&&typeof s==`function`&&s(Y({},d,{"data-length":u}),{value:t,keyName:n})||(0,z.jsx)(l,Y({},d))};Kz.displayName=`JVR.CountInfoComp`;var Eie=[`as`,`render`],qz=e=>{var{Ellipsis:t={}}=OR();return Nz(t,e,`Ellipsis`),null};qz.displayName=`JVR.Ellipsis`;var Jz=e=>{var{isExpanded:t,value:n,keyName:r}=e,{Ellipsis:i={}}=OR(),{as:a,render:o}=i,s=WL(i,Eie),c=a||`span`;return o&&typeof o==`function`&&o(Y({},s,{"data-expanded":t}),{value:n,keyName:r})||(!t||typeof n==`object`&&Object.keys(n).length==0?null:(0,z.jsx)(c,Y({},s)))};Jz.displayName=`JVR.EllipsisComp`;var Yz=e=>{var{keyName:t,expandKey:n,keys:r=[],initialValue:i,value:a,parentValue:o,level:s}=e,c=nR(),l=aR(),{onExpand:u,collapsed:d,shouldExpandNodeInitially:f}=LR(),p=typeof d==`boolean`?d:typeof d==`number`?s>d:!1,m=c[n]??(f?!1:p),h=f&&f(!m,{value:a,keys:r,level:s,keyName:t,parentValue:o});c[n]===void 0&&f&&(m=!h);var g=()=>{var e={expand:!m,value:a,keyid:n,keyName:t};u&&u(e),l({[n]:e.expand})},_={display:`inline-flex`,alignItems:`center`},v={transform:`rotate(`+(m?`-90`:`0`)+`deg)`,transition:`all 0.3s`},y=Object.keys(a).length,b=typeof a==`object`,x=Array.isArray(a),S=a instanceof Set,C=y!==0&&(x||S||b),w={style:_};C&&(w.onClick=g);var T={keyName:t,value:a,keys:r,parentValue:o};return(0,z.jsxs)(`span`,Y({},w,{children:[C&&(0,z.jsx)(QR,Y({style:v,expandKey:n},T)),(t||typeof t==`number`)&&(0,z.jsx)(Vz,Y({},T)),(0,z.jsx)(gz,{value:i,keyName:t}),(0,z.jsx)(_z,{value:i,keyName:t}),(0,z.jsx)($R,Y({isBrackets:x||S},T)),(0,z.jsx)(Jz,{keyName:t,value:a,isExpanded:m}),(0,z.jsx)(ez,Y({isVisiable:m||!C,isBrackets:x||S},T)),(0,z.jsx)(Kz,{value:a,keyName:t}),(0,z.jsx)(Wz,{value:a,keyName:t}),(0,z.jsx)(Rz,{keyName:t,value:a,expandKey:n,parentValue:o,keys:r})]}))};Yz.displayName=`JVR.NestedOpen`;var Die=[`className`,`children`,`parentValue`,`keyid`,`level`,`value`,`initialValue`,`keys`,`keyName`],Xz=(0,m.forwardRef)((e,t)=>{var{className:n=``,parentValue:r,level:i=1,value:a,initialValue:o,keys:s,keyName:c}=e,l=WL(e,Die),u=ZL(),d=zz();return(0,z.jsxs)(`div`,Y({className:[n,`w-rjv-inner`].filter(Boolean).join(` `),ref:t},l,{onMouseEnter:()=>u({[d]:!0}),onMouseLeave:()=>u({[d]:!1})},{children:[(0,z.jsx)(Yz,{expandKey:d,value:a,level:i,keys:s,parentValue:r,keyName:c,initialValue:o}),(0,z.jsx)(Bz,{expandKey:d,value:a,level:i,keys:s,parentValue:r,keyName:c}),(0,z.jsx)(tz,{expandKey:d,value:a,level:i,keys:s,parentValue:r,keyName:c})]}))});Xz.displayName=`JVR.Container`;var Zz=e=>{var{BraceLeft:t={}}=bR();return jz(t,e,`BraceLeft`),null};Zz.displayName=`JVR.BraceLeft`;var Qz=e=>{var{BraceRight:t={}}=bR();return jz(t,e,`BraceRight`),null};Qz.displayName=`JVR.BraceRight`;var $z=e=>{var{BracketsLeft:t={}}=bR();return jz(t,e,`BracketsLeft`),null};$z.displayName=`JVR.BracketsLeft`;var eB=e=>{var{BracketsRight:t={}}=bR();return jz(t,e,`BracketsRight`),null};eB.displayName=`JVR.BracketsRight`;var tB=e=>{var{Arrow:t={}}=bR();return jz(t,e,`Arrow`),null};tB.displayName=`JVR.Arrow`;var nB=e=>{var{Colon:t={}}=bR();return jz(t,e,`Colon`),null};nB.displayName=`JVR.Colon`;var rB=e=>{var{Quote:t={}}=bR();return jz(t,e,`Quote`),null};rB.displayName=`JVR.Quote`;var iB=e=>{var{ValueQuote:t={}}=bR();return jz(t,e,`ValueQuote`),null};iB.displayName=`JVR.ValueQuote`;var aB=e=>{var{Bigint:t={}}=uR();return Mz(t,e,`Bigint`),null};aB.displayName=`JVR.Bigint`;var oB=e=>{var{Date:t={}}=uR();return Mz(t,e,`Date`),null};oB.displayName=`JVR.Date`;var sB=e=>{var{False:t={}}=uR();return Mz(t,e,`False`),null};sB.displayName=`JVR.False`;var cB=e=>{var{Float:t={}}=uR();return Mz(t,e,`Float`),null};cB.displayName=`JVR.Float`;var lB=e=>{var{Int:t={}}=uR();return Mz(t,e,`Int`),null};lB.displayName=`JVR.Int`;var uB=e=>{var{Map:t={}}=uR();return Mz(t,e,`Map`),null};uB.displayName=`JVR.Map`;var dB=e=>{var{Nan:t={}}=uR();return Mz(t,e,`Nan`),null};dB.displayName=`JVR.Nan`;var fB=e=>{var{Null:t={}}=uR();return Mz(t,e,`Null`),null};fB.displayName=`JVR.Null`;var pB=e=>{var{Set:t={}}=uR();return Mz(t,e,`Set`),null};pB.displayName=`JVR.Set`;var mB=e=>{var{Str:t={}}=uR();return Mz(t,e,`Str`),null};mB.displayName=`JVR.StringText`;var hB=e=>{var{True:t={}}=uR();return Mz(t,e,`True`),null};hB.displayName=`JVR.True`;var gB=e=>{var{Undefined:t={}}=uR();return Mz(t,e,`Undefined`),null};gB.displayName=`JVR.Undefined`;var _B=e=>{var{Url:t={}}=uR();return Mz(t,e,`Url`),null};_B.displayName=`JVR.Url`;var vB=e=>{var{Copied:t={}}=OR();return Nz(t,e,`Copied`),null};vB.displayName=`JVR.Copied`;var Oie=[`className`,`style`,`value`,`children`,`collapsed`,`shouldExpandNodeInitially`,`indentWidth`,`displayObjectSize`,`shortenTextAfterLength`,`stringEllipsis`,`highlightUpdates`,`enableClipboard`,`displayDataTypes`,`objectSortKeys`,`onExpand`,`onCopied`,`beforeCopy`],yB=(0,m.forwardRef)((e,t)=>{var{className:n=``,style:r,value:i,children:a,collapsed:o=!1,shouldExpandNodeInitially:s,indentWidth:c=15,displayObjectSize:l=!0,shortenTextAfterLength:u=30,stringEllipsis:d,highlightUpdates:f=!0,enableClipboard:p=!0,displayDataTypes:m=!0,objectSortKeys:h=!1,onExpand:g,onCopied:_,beforeCopy:v}=e,y=WL(e,Oie),b=Y({lineHeight:1.4,fontFamily:`var(--w-rjv-font-family, Menlo, monospace)`,color:`var(--w-rjv-color, #002b36)`,backgroundColor:`var(--w-rjv-background-color, #00000000)`,fontSize:13},r),x=[`w-json-view-container`,`w-rjv`,n].filter(Boolean).join(` `);return(0,z.jsxs)(RR,{initialState:{value:i,objectSortKeys:h,indentWidth:c,shouldExpandNodeInitially:o===!1?s:void 0,displayObjectSize:l,collapsed:o,enableClipboard:p,shortenTextAfterLength:u,stringEllipsis:d,highlightUpdates:f,onCopied:_,onExpand:g,beforeCopy:v},initialTypes:{displayDataTypes:m},children:[(0,z.jsx)(Xz,Y({value:i},y,{ref:t,className:x,style:b})),a]})});yB.Bigint=aB,yB.Date=oB,yB.False=sB,yB.Float=cB,yB.Int=lB,yB.Map=uB,yB.Nan=dB,yB.Null=fB,yB.Set=pB,yB.String=mB,yB.True=hB,yB.Undefined=gB,yB.Url=_B,yB.ValueQuote=iB,yB.Arrow=tB,yB.Colon=nB,yB.Quote=rB,yB.Ellipsis=qz,yB.BraceLeft=Zz,yB.BraceRight=Qz,yB.BracketsLeft=$z,yB.BracketsRight=eB,yB.Copied=vB,yB.CountInfo=Gz,yB.CountInfoExtra=Uz,yB.KeyName=Pz,yB.Row=Iz,yB.displayName=`JVR.JsonView`;var kie=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:`m9 12l2 2l4-4`})]})}),bB=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:`m6 9l6 6l6-6`})}),xB=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`})}),SB=e=>(0,z.jsx)(`svg`,{viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`,...e,children:(0,z.jsx)(`circle`,{cx:12,cy:12,r:10,fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2})}),CB=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:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`}),(0,z.jsx)(`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5M10 9H8m8 4H8m8 4H8`})]})}),wB=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 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`})}),Aie=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:`M8 12h8`})]})}),TB=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:`M10 11v6m4-6v6m5-11v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6M3 6h18M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`})}),EB=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`})]})}),DB=`sonamu.ui.test-result-viewer.v1`,jie=100,OB=5*1024*1024;function Mie(){try{let e=sessionStorage.getItem(DB);if(e===null)return{runs:[]};let t=JSON.parse(e);return Pie(t)?t:{runs:[]}}catch{return{runs:[]}}}function Nie(e){return new TextEncoder().encode(e).length}function kB(e){let t=JSON.stringify(e),n=Nie(t);try{return sessionStorage.setItem(DB,t),{ok:!0}}catch(t){if(AB(t)&&e.runs.length>1){let t={runs:e.runs.slice(0,Math.ceil(e.runs.length/2))};try{return sessionStorage.setItem(DB,JSON.stringify(t)),{ok:!0}}catch{return{ok:!1,reason:`quota-exceeded`,payloadBytes:n,quotaHintBytes:OB}}}return AB(t)?{ok:!1,reason:`quota-exceeded`,payloadBytes:n,quotaHintBytes:OB}:(console.warn(`[sonamu] sessionStorage write failed:`,t),{ok:!0})}}function AB(e){return e instanceof DOMException?e.name===`QuotaExceededError`||e.code===22:!1}function Pie(e){if(typeof e!=`object`||!e)return!1;let t=e;return Array.isArray(t.runs)}function Fie(e){let t=new Date(e);return`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,`0`)}-${String(t.getDate()).padStart(2,`0`)}`}function Iie(){let[e,t]=(0,m.useState)(Mie),[n,r]=(0,m.useState)(null),i=(0,m.useRef)(new Set);return{history:e,storageWarning:n,addRun:(0,m.useCallback)(e=>{t(t=>{let n={...e,dateKey:Fie(e.finishedAt)},a=[n,...t.runs];a.sort((e,t)=>new Date(t.finishedAt).getTime()-new Date(e.finishedAt).getTime());let o=a.slice(0,jie),s={runs:o},c=o.filter(e=>!i.current.has(e.runId)),l=kB({runs:c});return!l.ok&&l.reason===`quota-exceeded`?(i.current.add(n.runId),kB({runs:c.filter(e=>e.runId!==n.runId)}),r({runId:n.runId,reason:`quota-exceeded`,payloadBytes:l.payloadBytes,quotaHintBytes:l.quotaHintBytes})):r(null),s})},[]),clearHistory:(0,m.useCallback)(()=>{t({runs:[]}),r(null),i.current.clear();try{sessionStorage.removeItem(DB)}catch{}},[])}}function jB(e){return typeof e==`object`&&!!e}function MB(e){return e.schemaVersion===1}function Lie(e){return jB(e)?typeof e.ready==`boolean`&&typeof e.running==`boolean`&&(e.lastRunAt===null||typeof e.lastRunAt==`string`):!1}function Rie(e){return!jB(e)||!MB(e)?!1:typeof e.serverTime==`string`&&Lie(e.status)}function zie(e){return!jB(e)||!MB(e)?!1:typeof e.runId==`string`&&typeof e.queuedAt==`string`&&jB(e.request)}function Bie(e){return!jB(e)||!MB(e)?!1:typeof e.runId==`string`&&typeof e.startedAt==`string`}function Vie(e){if(!jB(e)||!MB(e)||typeof e.runId!=`string`||typeof e.startedAt!=`string`||typeof e.finishedAt!=`string`||!jB(e.result))return!1;let t=e.result;return typeof t.ok==`boolean`&&jB(t.summary)&&Array.isArray(t.results)}function Hie(e){return!jB(e)||!MB(e)?!1:typeof e.runId==`string`&&typeof e.finishedAt==`string`&&jB(e.error)&&typeof e.error.message==`string`}function Uie(e){return!jB(e)||!MB(e)?!1:typeof e.runId==`string`&&typeof e.startedAt==`string`&&typeof e.at==`string`&&(e.kind===`file`||e.kind===`suite`||e.kind===`test`)&&(e.phase===`ready`||e.phase===`result`)&&typeof e.fileId==`string`&&typeof e.nodeId==`string`&&(e.parentId===null||typeof e.parentId==`string`)&&jB(e.node)}function Wie(e){return!jB(e)||!MB(e)?!1:typeof e.at==`string`}var Gie={snapshot:Rie,runQueued:zie,runStarted:Bie,runCompleted:Vie,runErrored:Hie,runNodeProgress:Uie,heartbeat:Wie},Kie=`/__test__/events`,qie=3e4;function Jie(e){let t=e?.enabled??!0,[n,r]=(0,m.useState)(!1),i=(0,m.useRef)(null),a=(0,m.useRef)(new Map),o=(0,m.useRef)(0),s=(0,m.useRef)(null),c=(0,m.useRef)(!1),l=(0,m.useCallback)(()=>{if(c.current)return;let e=new EventSource(Kie);i.current=e,e.onopen=()=>{c.current||(o.current=0,r(!0))},e.onerror=()=>{c.current||(e.close(),i.current=null,r(!1),u())};for(let t of[`snapshot`,`runQueued`,`runStarted`,`runCompleted`,`runErrored`,`runNodeProgress`,`heartbeat`])e.addEventListener(t,e=>{if(!c.current)try{let n=JSON.parse(e.data),r=Gie[t];if(r(n)){let e=a.current.get(t);if(e)for(let t of e)t(n)}}catch{}})},[]),u=(0,m.useCallback)(()=>{if(c.current)return;let e=Math.min(1e3*2**o.current,qie);o.current+=1,s.current=setTimeout(()=>{s.current=null,l()},e)},[l]);return(0,m.useEffect)(()=>{if(c.current=!1,t)return l(),()=>{c.current=!0,s.current!==null&&(clearTimeout(s.current),s.current=null),i.current&&=(i.current.close(),null)}},[l,t]),{connected:n,on:(0,m.useCallback)((e,t)=>{let n=a.current.get(e);n||(n=new Set,a.current.set(e,n));let r=t;return n.add(r),()=>{n.delete(r)}},[])}}var Yie=hP(`/test-results`)({component:Zie});function NB(e){let t=0,n=0,r=0,i=0;for(let a of e)t+=a.counts.total,n+=a.counts.passed,r+=a.counts.failed,i+=a.counts.skipped;return{total:t,passed:n,failed:r,skipped:i}}function PB(e,t){return t.some(e=>e.state===`running`)?`running`:t.some(e=>e.state===`failed`)?`failed`:t.every(e=>e.state===`passed`||e.state===`skipped`||e.state===`todo`)?t.some(e=>e.state===`passed`)?`passed`:`skipped`:e.state}function FB(e,t,n,r){if(e.id===t){let t=e.children.findIndex(e=>e.id===n.id),i;if(t>=0){if(r===`ready`&&e.children[t].state!==`running`)return e;i=[...e.children],i[t]=n}else i=[...e.children,n];let a=NB(i),o=PB(e,i);return{...e,children:i,counts:a,state:o}}let i=!1,a=e.children.map(e=>{if(i)return e;let a=FB(e,t,n,r);return a!==e&&(i=!0),a});if(!i)return e;let o=NB(a),s=PB(e,a);return{...e,children:a,counts:o,state:s}}function Xie(e,t){if(!e||t.runId!==e.runId)return e;let n=new Map(e.fileResults);if(t.kind===`file`||t.parentId===null)t.phase===`ready`&&n.has(t.fileId)||n.set(t.fileId,t.node);else{let r=n.get(t.fileId);if(!r)return e;let i=FB(r,t.parentId,t.node,t.phase);n.set(t.fileId,i)}return{...e,fileResults:n}}function Zie(){let{SD:e}=kP(),t=J.useTestStatus(),n=t.data?.sseAvailable??!1,{connected:r,on:i}=Jie({enabled:n}),{history:a,storageWarning:o,addRun:s,clearHistory:c}=Iie(),[l,u]=(0,m.useState)(null),[d,f]=(0,m.useState)(!0),[p,h]=(0,m.useState)(null),[g,_]=(0,m.useState)(null),[v,y]=(0,m.useState)(null),b=(0,m.useRef)([]),x=(0,m.useRef)(null),S=(0,m.useCallback)(()=>(x.current!==null&&(cancelAnimationFrame(x.current),x.current=null),b.current.splice(0)),[]),C=(0,m.useCallback)(()=>{x.current===null&&(x.current=requestAnimationFrame(()=>{x.current=null;let e=b.current.splice(0);e.length!==0&&y(t=>{let n=t;for(let t of e)n=Xie(n,t);return n})}))},[]);(0,m.useEffect)(()=>{f(!r)},[r]),(0,m.useEffect)(()=>{let e=[];return e.push(i(`snapshot`,e=>{u(e.status)})),e.push(i(`runStarted`,e=>{b.current.length=0,x.current!==null&&(cancelAnimationFrame(x.current),x.current=null),u(e=>e&&{...e,running:!0}),y({runId:e.runId,startedAt:e.startedAt,fileResults:new Map}),h(null)})),e.push(i(`runNodeProgress`,e=>{b.current.push(e),C()})),e.push(i(`runCompleted`,e=>{S(),u(t=>t&&{...t,running:!1,lastRunAt:e.finishedAt}),s({runId:e.runId,startedAt:e.startedAt,finishedAt:e.finishedAt,result:e.result}),y(null),h(e.runId)})),e.push(i(`runErrored`,e=>{S(),u(t=>t&&{...t,running:!1,lastRunAt:e.finishedAt}),y(null)})),()=>{for(let t of e)t();x.current!==null&&(cancelAnimationFrame(x.current),x.current=null),b.current.length=0}},[i,s,S,C]);let w=(0,m.useMemo)(()=>p?a.runs.find(e=>e.runId===p)??null:null,[p,a.runs]),T=(0,m.useMemo)(()=>!w||!o||o.runId!==w.runId?null:o,[w,o]),E=(0,m.useMemo)(()=>v?Array.from(v.fileResults.values()):null,[v]),D=(0,m.useMemo)(()=>{if(!E)return null;let e=0,t=0,n=0,r=0,i=0;for(let a of E)e+=a.counts.total,t+=a.counts.passed,n+=a.counts.failed,r+=a.counts.skipped,a.durationMs&&(i+=a.durationMs);return{total:e,passed:t,failed:n,skipped:r,durationMs:i}},[E]),O=!p&&v!==null,k=(0,m.useMemo)(()=>O&&E?E:w?w.result.results:null,[O,E,w]),A=(0,m.useMemo)(()=>{if(!k)return new Map;let e=new Map,t=n=>{for(let r of n)e.set(r.id,r),r.children.length>0&&t(r.children)};return t(k),e},[k]),j=(0,m.useMemo)(()=>g?A.get(g)??null:null,[A,g]),M=(0,m.useCallback)(e=>{h(e),_(null)},[]),N=(0,m.useCallback)(()=>{h(null),_(null)},[]);return t.isSuccess&&!n?(0,z.jsx)(`div`,{className:`flex items-center justify-center h-[calc(100vh-var(--gnb-height,48px))]`,children:(0,z.jsx)(`div`,{className:`text-center`,children:(0,z.jsx)(`p`,{className:`text-gray-600 text-sm`,children:e(`testResults.sseNotAvailable`)})})}):(0,z.jsxs)(`div`,{className:`flex flex-col h-[calc(100vh-var(--gnb-height,48px))]`,children:[(0,z.jsx)(Qie,{connected:r,connecting:d,managerStatus:l}),(0,z.jsxs)(`div`,{className:`flex flex-1 overflow-hidden`,children:[(0,z.jsx)($ie,{runs:a.runs,selectedRunId:p,onSelectRun:M,onClearHistory:c,liveRun:v,showLiveRun:O,onSelectLiveRun:N}),(0,z.jsx)(`div`,{className:`flex-1 overflow-auto`,children:O&&E&&D?(0,z.jsx)(rae,{results:E,summary:D,selectedNodeId:g,selectedNode:j,onSelectNode:_}):w?(0,z.jsx)(nae,{run:w,storageWarning:T,selectedNodeId:g,selectedNode:j,onSelectNode:_}):(0,z.jsx)(`div`,{className:`flex items-center justify-center h-full text-gray-400`,children:e(`testResults.noHistory`)})})]})]})}function Qie({connected:e,connecting:t,managerStatus:n}){let{SD:r}=kP();return(0,z.jsxs)(`div`,{className:`flex items-center gap-3 px-4 py-2 bg-gray-50 border-b border-gray-200 text-sm shrink-0`,children:[(0,z.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,z.jsx)(`span`,{className:(0,kL.default)(`inline-block w-2.5 h-2.5 rounded-full`,{"bg-green-500":e,"bg-yellow-400 animate-pulse":t&&!e,"bg-gray-400":!e&&!t})}),(0,z.jsx)(`span`,{className:`text-gray-600`,children:r(e?`testResults.connected`:t?`testResults.connecting`:`testResults.disconnected`)})]}),n?.running&&(0,z.jsx)(`span`,{className:`inline-flex items-center gap-1 px-2 py-0.5 bg-blue-100 text-blue-700 text-xs font-medium rounded-full animate-pulse`,children:`Running`})]})}function $ie({runs:e,selectedRunId:t,onSelectRun:n,onClearHistory:r,liveRun:i,showLiveRun:a,onSelectLiveRun:o}){let{SD:s}=kP(),c=(0,m.useMemo)(()=>{let t=new Map;for(let n of e){let e=t.get(n.dateKey);e?e.push(n):t.set(n.dateKey,[n])}let n=Array.from(t.entries());return n.sort((e,t)=>t[0].localeCompare(e[0])),n},[e]);return(0,z.jsxs)(`div`,{className:`w-60 shrink-0 flex flex-col border-r border-gray-200 bg-gray-50 overflow-hidden`,children:[(0,z.jsxs)(`div`,{className:`flex-1 overflow-y-auto p-2`,children:[i&&(0,z.jsx)(`button`,{type:`button`,"aria-label":s(`testResults.liveRunning`),className:(0,kL.default)(`w-full text-left px-2 py-1.5 rounded text-sm cursor-pointer transition-colors mb-2`,{"bg-blue-100 text-blue-900":a,"hover:bg-gray-200":!a}),onClick:o,children:(0,z.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,z.jsx)(`span`,{className:`inline-block w-2 h-2 rounded-full bg-blue-500 animate-pulse`}),(0,z.jsx)(`span`,{className:`text-xs font-semibold text-blue-700`,children:s(`testResults.liveRunning`)})]})}),e.length===0&&!i?(0,z.jsx)(`div`,{className:`text-center text-gray-400 text-sm py-8`,children:s(`testResults.noHistory`)}):c.map(([e,r])=>(0,z.jsxs)(`div`,{className:`mb-3`,children:[(0,z.jsx)(`div`,{className:`text-xs font-semibold text-gray-500 px-2 py-1`,children:e}),r.map(e=>(0,z.jsx)(`button`,{type:`button`,className:(0,kL.default)(`w-full text-left px-2 py-1.5 rounded text-sm cursor-pointer transition-colors`,{"bg-blue-100 text-blue-900":t===e.runId,"hover:bg-gray-200":t!==e.runId}),onClick:()=>n(e.runId),children:(0,z.jsxs)(`div`,{className:`flex items-center gap-1.5 flex-wrap`,children:[(0,z.jsx)(eae,{summary:e.result.summary}),(0,z.jsx)(`span`,{className:`text-xs text-gray-400 ml-auto`,children:tae(e.finishedAt)})]})},e.runId))]},e))]}),e.length>0&&(0,z.jsx)(`div`,{className:`p-2 border-t border-gray-200`,children:(0,z.jsx)(B,{size:`xs`,variant:`outline`,icon:(0,z.jsx)(TB,{}),onClick:r,className:`w-full`,children:s(`testResults.clearHistory`)})})]})}function eae({summary:e}){return(0,z.jsxs)(`div`,{className:`flex items-center gap-1`,children:[e.passed>0&&(0,z.jsx)(`span`,{className:`inline-block px-1.5 py-0.5 text-[10px] font-bold rounded bg-green-100 text-green-700`,children:e.passed}),e.failed>0&&(0,z.jsx)(`span`,{className:`inline-block px-1.5 py-0.5 text-[10px] font-bold rounded bg-red-100 text-red-700`,children:e.failed}),e.skipped>0&&(0,z.jsx)(`span`,{className:`inline-block px-1.5 py-0.5 text-[10px] font-bold rounded bg-gray-100 text-gray-500`,children:e.skipped})]})}function tae(e){let t=new Date(e);return`${String(t.getHours()).padStart(2,`0`)}:${String(t.getMinutes()).padStart(2,`0`)}:${String(t.getSeconds()).padStart(2,`0`)}`}function nae({run:e,storageWarning:t,selectedNodeId:n,selectedNode:r,onSelectNode:i}){return(0,z.jsxs)(`div`,{className:`flex flex-col h-full`,children:[(0,z.jsx)(IB,{summary:e.result.summary,storageWarning:t}),(0,z.jsxs)(`div`,{className:`flex flex-1 overflow-hidden`,children:[(0,z.jsx)(zB,{results:e.result.results,selectedNodeId:n,onSelectNode:i}),(0,z.jsx)(VB,{node:r})]})]})}function rae({results:e,summary:t,selectedNodeId:n,selectedNode:r,onSelectNode:i}){return(0,z.jsxs)(`div`,{className:`flex flex-col h-full`,children:[(0,z.jsx)(IB,{summary:t}),(0,z.jsxs)(`div`,{className:`flex flex-1 overflow-hidden`,children:[(0,z.jsx)(zB,{results:e,selectedNodeId:n,onSelectNode:i}),(0,z.jsx)(VB,{node:r})]})]})}function IB({summary:e,storageWarning:t=null}){let{SD:n}=kP();return(0,z.jsxs)(`div`,{className:`flex items-center gap-4 px-4 py-3 bg-white border-b border-gray-200 text-sm shrink-0`,children:[(0,z.jsxs)(`span`,{className:`text-gray-600`,children:[n(`testResults.summary.total`),`: `,(0,z.jsx)(`span`,{className:`font-semibold`,children:e.total})]}),(0,z.jsxs)(`span`,{className:`text-green-600`,children:[n(`testResults.summary.passed`),`: `,(0,z.jsx)(`span`,{className:`font-semibold`,children:e.passed})]}),(0,z.jsxs)(`span`,{className:`text-red-600`,children:[n(`testResults.summary.failed`),`: `,(0,z.jsx)(`span`,{className:`font-semibold`,children:e.failed})]}),(0,z.jsxs)(`span`,{className:`text-gray-500`,children:[n(`testResults.summary.skipped`),`:`,` `,(0,z.jsx)(`span`,{className:`font-semibold`,children:e.skipped})]}),(0,z.jsxs)(`span`,{className:`text-gray-500`,children:[n(`testResults.summary.duration`),`:`,` `,(0,z.jsx)(`span`,{className:`font-mono`,children:LB(e.durationMs)})]}),t?.reason===`quota-exceeded`&&(0,z.jsxs)(`span`,{className:`text-amber-700 text-xs`,children:[n(`testResults.storageWarning.quotaExceeded`),` (`,n(`testResults.storageWarning.limit`),`: `,RB(t.quotaHintBytes),`,`,n(`testResults.storageWarning.resultSize`),`:`,` `,RB(t.payloadBytes),`)`]})]})}function LB(e){return e>=6e4?`${(e/6e4).toFixed(1)}m`:e>=1e3?`${(e/1e3).toFixed(1)}s`:`${e.toFixed(2)}ms`}function RB(e){return e>=1024*1024?`${(e/(1024*1024)).toFixed(2)}MB`:e>=1024?`${(e/1024).toFixed(1)}KB`:`${e}B`}function iae(e){let t=new Set,n=e=>{if(e.children.length===0)return e.state===`failed`;let r=!1;for(let t of e.children)n(t)&&(r=!0);return r&&t.add(e.id),r};for(let r of e)t.add(r.id),n(r);return t}function aae(e,t){let n=e=>{if(e.name.toLowerCase().includes(t))return e;let r=e.children.flatMap(e=>{let t=n(e);return t?[t]:[]});return r.length>0?{...e,children:r}:null};return e.flatMap(e=>{let t=n(e);return t?[t]:[]})}function oae(e){let t=new Set,n=e=>{t.add(e.id);for(let t of e.children)n(t)};for(let t of e)n(t);return t}function sae(e,t){let n=[],r=(e,i)=>{let a=e.children.length>0;if(n.push({node:e,depth:i,hasChildren:a}),a&&t.has(e.id))for(let t of e.children)r(t,i+1)};for(let t of e)r(t,0);return n}function zB({results:e,selectedNodeId:t,onSelectNode:n}){let{SD:r}=kP(),[i,a]=(0,m.useState)(()=>iae(e)),[o,s]=(0,m.useState)(``),[c,l]=(0,m.useState)(``),u=(0,m.useRef)(null);(0,m.useEffect)(()=>{let e=setTimeout(()=>l(o),300);return()=>clearTimeout(e)},[o]);let d=(0,m.useMemo)(()=>{let t=c.toLowerCase();return t?aae(e,t):e},[e,c]);(0,m.useEffect)(()=>{c?(u.current===null&&(u.current=new Set(i)),a(oae(d))):u.current!==null&&(a(u.current),u.current=null)},[c,d]);let f=(0,m.useRef)(e);(0,m.useEffect)(()=>{if(f.current!==e){if(f.current=e,u.current!==null)return;a(t=>{let n=new Set(t),r=e=>{if(e.children.length===0)return e.state===`failed`;let t=!1;for(let n of e.children)r(n)&&(t=!0);return t&&n.add(e.id),t};for(let t of e)n.has(t.id)||n.add(t.id),r(t);return n})}},[e]);let p=(0,m.useMemo)(()=>sae(d,i),[d,i]),h=(0,m.useCallback)(e=>{a(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]);return(0,z.jsxs)(`div`,{className:`w-120 shrink-0 border-r border-gray-200 overflow-y-auto p-2`,children:[(0,z.jsxs)(`div`,{className:`relative mb-2`,children:[(0,z.jsx)(`input`,{type:`text`,value:o,onChange:e=>s(e.target.value),placeholder:r(`testResults.tree.searchPlaceholder`),className:`w-full text-xs px-2 py-1 pr-6 border border-gray-200 rounded outline-none focus:border-blue-400`}),o&&(0,z.jsx)(`button`,{type:`button`,"aria-label":r(`testResults.tree.clearSearch`),className:`absolute right-1.5 top-1/2 -translate-y-1/2 text-gray-400 hover:text-gray-600`,onClick:()=>{s(``),l(``)},children:(0,z.jsx)(EB,{className:`w-3.5 h-3.5`})})]}),p.map(e=>(0,z.jsx)(cae,{row:e,isSelected:t===e.node.id,expanded:i.has(e.node.id),onSelectNode:n,onToggleExpand:h},e.node.id)),c&&p.length===0&&(0,z.jsx)(`div`,{className:`text-xs text-gray-400 px-2 py-1`,children:r(`testResults.tree.noMatches`)})]})}var cae=(0,m.memo)(function({row:e,isSelected:t,expanded:n,onSelectNode:r,onToggleExpand:i}){return(0,z.jsxs)(`button`,{type:`button`,className:(0,kL.default)(`w-full flex items-center gap-1.5 px-2 py-1 rounded text-sm cursor-pointer transition-colors text-left`,{"bg-blue-100":t,"hover:bg-gray-100":!t}),style:{paddingLeft:`${e.depth*16+8}px`},onClick:()=>{r(e.node.id),e.hasChildren&&i(e.node.id)},children:[e.hasChildren?n?(0,z.jsx)(bB,{className:`w-3.5 h-3.5 text-gray-400 shrink-0`}):(0,z.jsx)(xB,{className:`w-3.5 h-3.5 text-gray-400 shrink-0`}):(0,z.jsx)(`span`,{className:`w-3.5 shrink-0`}),(0,z.jsx)(BB,{state:e.node.state,kind:e.node.kind}),(0,z.jsx)(`span`,{className:(0,kL.default)(`truncate`,{"text-red-600":e.node.state===`failed`,"text-green-700":e.node.state===`passed`,"text-gray-400":e.node.state===`skipped`||e.node.state===`todo`}),children:e.node.name}),e.node.durationMs!==null&&(0,z.jsx)(`span`,{className:`ml-auto text-xs text-gray-400 font-mono shrink-0`,children:LB(e.node.durationMs)})]})});function BB({state:e,kind:t}){return t===`file`?(0,z.jsx)(CB,{className:(0,kL.default)(`w-4 h-4 shrink-0`,{"text-green-600":e===`passed`,"text-red-500":e===`failed`,"text-gray-400":e===`skipped`||e===`todo`||e===`unknown`,"text-blue-500":e===`running`})}):t===`suite`?(0,z.jsx)(wB,{className:(0,kL.default)(`w-4 h-4 shrink-0`,{"text-green-600":e===`passed`,"text-red-500":e===`failed`,"text-gray-400":e===`skipped`||e===`todo`||e===`unknown`,"text-blue-500":e===`running`})}):e===`passed`?(0,z.jsx)(kie,{className:`w-4 h-4 text-green-600 shrink-0`}):e===`failed`?(0,z.jsx)(EB,{className:`w-4 h-4 text-red-500 shrink-0`}):e===`skipped`||e===`todo`?(0,z.jsx)(Aie,{className:`w-4 h-4 text-gray-400 shrink-0`}):(0,z.jsx)(SB,{className:`w-4 h-4 text-gray-400 shrink-0`})}var VB=(0,m.memo)(function({node:e}){return e?(0,z.jsxs)(`div`,{className:`flex-1 overflow-y-auto p-4 space-y-4`,children:[(0,z.jsxs)(`div`,{className:`flex items-center gap-2 text-sm`,children:[(0,z.jsx)(BB,{state:e.state,kind:e.kind}),(0,z.jsx)(`span`,{className:`font-semibold`,children:e.fullName}),e.durationMs!==null&&(0,z.jsx)(`span`,{className:`text-gray-400 font-mono text-xs`,children:LB(e.durationMs)})]}),e.error&&(0,z.jsx)(lae,{error:e.error}),(0,z.jsx)(dae,{traces:e.traces})]}):(0,z.jsx)(`div`,{className:`flex-1`})});function lae({error:e}){let{SD:t}=kP();return(0,z.jsxs)(`div`,{className:`border border-red-200 rounded-md overflow-hidden`,children:[(0,z.jsx)(`div`,{className:`px-3 py-1.5 bg-red-50 text-red-700 text-xs font-semibold border-b border-red-200`,children:t(`testResults.detail.error`)}),(0,z.jsxs)(`pre`,{className:`p-3 text-xs text-red-800 bg-red-50/50 overflow-x-auto whitespace-pre-wrap`,children:[e.message,e.stack&&`\n\n${e.stack}`]})]})}function uae(e){if(typeof e==`string`)try{return JSON.parse(e)}catch{return e}return e}function HB(e,t){if(!t)return e;let n=e.toLowerCase(),r=t.toLowerCase(),i=[],a=0,o=n.indexOf(r,a);for(;o!==-1;)o>a&&i.push(e.slice(a,o)),i.push((0,z.jsx)(`mark`,{className:`bg-yellow-200 text-yellow-900`,children:e.slice(o,o+r.length)},o)),a=o+r.length,o=n.indexOf(r,a);return a<e.length&&i.push(e.slice(a)),i.length>0?i:e}function dae({traces:e}){let{SD:t}=kP(),[n,r]=(0,m.useState)(()=>new Set),[i,a]=(0,m.useState)(``),[o,s]=(0,m.useState)(``),c=(0,m.useRef)(new Map),l=(0,m.useRef)(e);l.current!==e&&(l.current=e,c.current.clear()),(0,m.useEffect)(()=>{let e=setTimeout(()=>s(i),300);return()=>clearTimeout(e)},[i]);let u=(0,m.useMemo)(()=>{let t=o.toLowerCase();return e.reduce((e,n,r)=>{let i=`${n.key}-${n.at}-${r}`,a=c.current.get(i);return a===void 0&&(a=`${n.key} ${JSON.stringify(n.value)}`.toLowerCase(),c.current.set(i,a)),(!o||a.includes(t))&&e.push({trace:n,originalIndex:r}),e},[])},[e,o]),d=(0,m.useCallback)(e=>{r(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),f=(0,m.useCallback)(()=>{r(new Set(e.map((e,t)=>`${e.key}-${e.at}-${t}`)))},[e]),p=(0,m.useCallback)(()=>{r(new Set)},[]);return(0,z.jsxs)(`div`,{children:[(0,z.jsxs)(`div`,{className:`flex items-center gap-2 text-xs font-semibold text-gray-600 mb-1`,children:[t(`testResults.detail.traces`),(0,z.jsxs)(`span`,{className:`flex gap-1 font-normal`,children:[(0,z.jsx)(`button`,{type:`button`,className:`text-blue-500 hover:text-blue-700`,onClick:f,children:t(`testResults.detail.expandAll`)}),(0,z.jsx)(`span`,{className:`text-gray-300`,children:`/`}),(0,z.jsx)(`button`,{type:`button`,className:`text-blue-500 hover:text-blue-700`,onClick:p,children:t(`testResults.detail.collapseAll`)})]})]}),(0,z.jsxs)(`div`,{className:`relative mb-1.5`,children:[(0,z.jsx)(`input`,{type:`text`,value:i,onChange:e=>a(e.target.value),placeholder:t(`testResults.detail.searchPlaceholder`),className:`w-full text-xs px-2 py-1 pr-6 border border-gray-200 rounded outline-none focus:border-blue-400`}),i&&(0,z.jsx)(`button`,{type:`button`,"aria-label":t(`testResults.detail.clearSearch`),className:`absolute right-1.5 top-1/2 -translate-y-1/2 text-gray-400 hover:text-gray-600`,onClick:()=>{a(``),s(``)},children:(0,z.jsx)(EB,{className:`w-3.5 h-3.5`})})]}),u.length===0&&e.length===0?(0,z.jsx)(`div`,{className:`text-xs text-gray-400`,children:t(`testResults.detail.noTraces`)}):u.length===0?(0,z.jsx)(`div`,{className:`text-xs text-gray-400`,children:t(`testResults.detail.noTraceMatches`)}):(0,z.jsx)(`div`,{className:`space-y-1.5`,children:u.map(({trace:e,originalIndex:t})=>{let r=`${e.key}-${e.at}-${t}`,i=n.has(r),a=uae(e.value),s=typeof a==`object`&&a?a:{value:a};return(0,z.jsxs)(`div`,{className:`text-xs border border-gray-100 rounded overflow-hidden`,children:[(0,z.jsxs)(`button`,{type:`button`,className:`flex items-center w-full px-2 py-1 bg-gray-50 cursor-pointer text-left`,onClick:()=>d(r),children:[i?(0,z.jsx)(bB,{className:`w-3 h-3 text-gray-400 mr-1 shrink-0`}):(0,z.jsx)(xB,{className:`w-3 h-3 text-gray-400 mr-1 shrink-0`}),(0,z.jsx)(`span`,{className:`font-mono font-semibold text-blue-700`,children:e.key}),(0,z.jsxs)(`span`,{className:`ml-3 text-gray-400 text-[11px]`,children:[e.filePath,`:`,e.lineNumber]})]}),i&&(0,z.jsx)(`div`,{className:`px-2 py-1.5 overflow-x-auto`,children:(0,z.jsx)(yB,{value:s,collapsed:!1,displayDataTypes:!1,indentWidth:12,enableClipboard:!1,style:{fontSize:`12px`},children:o&&(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(yB.KeyName,{render:(e,{keyName:t})=>{let n=String(t);return(0,z.jsx)(`span`,{...e,children:HB(n,o)})}}),(0,z.jsx)(yB.String,{render:(e,{value:t})=>{let n=String(t);return(0,z.jsx)(`span`,{...e,children:HB(n,o)})}})]})})})]},r)})})]})}var fae=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`})}),UB=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:`M10 15V9m4 6V9`})]})}),WB=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:`M9 9.003a1 1 0 0 1 1.517-.859l4.997 2.997a1 1 0 0 1 0 1.718l-4.997 2.997A1 1 0 0 1 9 14.996z`}),(0,z.jsx)(`circle`,{cx:12,cy:12,r:10})]})}),GB=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:`M3 12a9 9 0 0 1 9-9a9.75 9.75 0 0 1 6.74 2.74L21 8`}),(0,z.jsx)(`path`,{d:`M21 3v5h-5m5 4a9 9 0 0 1-9 9a9.75 9.75 0 0 1-6.74-2.74L3 16`}),(0,z.jsx)(`path`,{d:`M8 16H3v5`})]})}),pae=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:`M3 12a9 9 0 1 0 9-9a9.75 9.75 0 0 0-6.74 2.74L3 8`}),(0,z.jsx)(`path`,{d:`M3 3v5h5`})]})}),KB={pending:`bg-yellow-100 text-yellow-800 border-yellow-200`,running:`bg-blue-100 text-blue-800 border-blue-200`,sleeping:`bg-purple-100 text-purple-800 border-purple-200`,succeeded:`bg-green-100 text-green-800 border-green-200`,completed:`bg-green-100 text-green-800 border-green-200`,failed:`bg-red-100 text-red-800 border-red-200`,paused:`bg-orange-100 text-orange-800 border-orange-200`,canceled:`bg-gray-100 text-gray-800 border-gray-200`};function qB(e,t){return e?new Date(e).toLocaleString(t??`ko`,{year:`numeric`,month:`2-digit`,day:`2-digit`,hour:`2-digit`,minute:`2-digit`,second:`2-digit`}):`-`}function JB(e,t){if(!e)return`-`;let n=new Date(e).getTime(),r=(t?new Date(t).getTime():Date.now())-n;return r<1e3?`${r}ms`:r<6e4?`${(r/1e3).toFixed(1)}s`:r<36e5?`${Math.floor(r/6e4)}m ${Math.floor(r%6e4/1e3)}s`:`${Math.floor(r/36e5)}h ${Math.floor(r%36e5/6e4)}m`}var mae={options:[`pending`,`running`,`sleeping`,`paused`,`completed`,`failed`,`canceled`]},hae={pending:`PENDING`,running:`RUNNING`,sleeping:`SLEEPING`,paused:`PAUSED`,completed:`COMPLETED`,failed:`FAILED`,canceled:`CANCELED`};function YB(e){return e>=6e4?`${e/6e4}m`:e>=1e3?`${e/1e3}s`:`${e}ms`}function gae(e){if(!e)return`-`;let t=[];return e.maxAttempts&&t.push(`최대 ${e.maxAttempts}회`),e.initialIntervalMs&&t.push(`초기 ${YB(e.initialIntervalMs)}`),e.backoffCoefficient&&t.push(`배수 ${e.backoffCoefficient}x`),e.maximumIntervalMs&&t.push(`최대간격 ${YB(e.maximumIntervalMs)}`),e.hasDynamicPolicy&&t.push(`(+ dynamic)`),t.length>0?t.join(` · `):`-`}function _ae({startedAt:e}){let[,t]=(0,m.useState)(0);return(0,m.useEffect)(()=>{if(!e)return;let n=setInterval(()=>t(e=>e+1),1e3);return()=>clearInterval(n)},[e]),(0,z.jsx)(`span`,{className:`font-mono text-sm`,children:JB(e,null)})}var vae={succeeded:`bg-green-100 text-green-700 border-green-200`,completed:`bg-green-100 text-green-700 border-green-200`,running:`bg-blue-100 text-blue-700 border-blue-200 animate-pulse`,failed:`bg-red-100 text-red-700 border-red-200`};function yae({steps:e}){return e.length===0?null:(0,z.jsxs)(`div`,{className:`flex items-center gap-1 flex-wrap`,children:[e.map((e,t)=>(0,z.jsxs)(`div`,{className:`flex items-center gap-1`,children:[t>0&&(0,z.jsx)(`span`,{className:`text-gray-300 text-xs`,children:`→`}),(0,z.jsx)(`span`,{className:(0,kL.default)(`inline-block px-1.5 py-0.5 text-[11px] font-mono rounded border`,vae[e.status]??`bg-gray-100 text-gray-600 border-gray-200`),children:e.stepName})]},e.id)),(0,z.jsx)(`span`,{className:`text-gray-300 text-xs ml-0.5`,children:`→ ···`})]})}function bae({run:e}){let{SD:t}=kP(),[n,r]=(0,m.useState)(!1),[i,a]=(0,m.useState)(!1),[o,s]=(0,m.useState)(!1),{data:c}=J.useStepAttempts(e.id),l=c?.data??[],u=[`pending`,`running`,`sleeping`].includes(e.status),d=e.status===`paused`;return(0,z.jsxs)(`div`,{className:`flex items-center gap-4 p-3 bg-white border border-blue-200 rounded-md`,children:[(0,z.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,z.jsxs)(`div`,{className:`flex items-center gap-2 mb-1`,children:[(0,z.jsx)(mP,{to:`/tasks/$workflowRunId`,params:{workflowRunId:e.id},className:`text-blue-600 hover:underline no-underline font-medium text-sm truncate`,children:e.workflowName}),(0,z.jsx)(`span`,{className:(0,kL.default)(`inline-block px-1.5 py-0.5 text-[10px] font-bold rounded border shrink-0`,KB[e.status]??`bg-gray-100 text-gray-800`),children:e.status.toUpperCase()})]}),l.length>0?(0,z.jsx)(yae,{steps:l}):(0,z.jsx)(`span`,{className:`text-xs text-gray-400`,children:t(`tasks.active.noStepsYet`)})]}),(0,z.jsxs)(`div`,{className:`flex items-center gap-3 shrink-0`,children:[(0,z.jsxs)(`div`,{className:`text-xs text-gray-500`,children:[(0,z.jsxs)(`span`,{className:`mr-1`,children:[t(`tasks.active.elapsed`),`:`]}),(0,z.jsx)(_ae,{startedAt:e.startedAt})]}),u&&(0,z.jsx)(B,{size:`xs`,variant:`outline`,icon:(0,z.jsx)(UB,{}),disabled:i,onClick:()=>{confirm(t(`tasks.pauseConfirm`))&&(a(!0),J.pauseWorkflowRun(e.id).catch(PL).finally(()=>a(!1)))},children:t(`tasks.pause`)}),d&&(0,z.jsx)(B,{size:`xs`,variant:`outline`,icon:(0,z.jsx)(WB,{}),disabled:o,onClick:()=>{s(!0),J.resumeWorkflowRun(e.id).catch(PL).finally(()=>s(!1))},children:t(`tasks.resume`)}),(0,z.jsx)(B,{size:`xs`,variant:`destructive`,icon:(0,z.jsx)(EB,{}),disabled:n,onClick:()=>{confirm(t(`tasks.cancelConfirm`))&&(r(!0),J.cancelWorkflowRun(e.id).catch(PL).finally(()=>r(!1)))},children:t(`tasks.cancel`)})]})]})}function xae(){let{SD:e}=kP(),{data:t}=J.useWorkflowRuns({status:[`pending`,`running`,`sleeping`,`paused`]}),n=t?.data??[];return n.length===0?null:(0,z.jsxs)(`div`,{className:`block p-4 bg-blue-50 border-2 border-blue-300 rounded-md shadow-sm mb-4`,children:[(0,z.jsx)(`h3`,{className:`text-lg font-semibold mb-3 text-blue-900`,children:e(`tasks.active.title`)}),(0,z.jsx)(`div`,{className:`flex flex-col gap-2`,children:n.map(e=>(0,z.jsx)(bae,{run:e},e.id))})]})}var Sae=hP(`/tasks`)({component:Cae});function Cae(){let{SD:e}=kP(),t=DP(),[n,r]=(0,m.useState)({}),[i,a]=(0,m.useState)([]),[o,s]=(0,m.useState)(``),[c,l]=(0,m.useState)(),[u,d]=(0,m.useState)(),{data:f}=J.useWorkflowDefinitions(),p=f?.definitions??[],h=(0,m.useMemo)(()=>({options:p.map(e=>e.name)}),[p]),g=(0,m.useMemo)(()=>Object.fromEntries(p.map(e=>[e.name,e.name])),[p]),_=i.length>0||o!==``||c||u,{data:v,error:y,refetch:b,isLoading:x}=J.useWorkflowRuns({limit:50,...n,...i.length>0?{status:i}:{},...o?{workflowName:o}:{},...c?{createdAfter:c.toISOString()}:{},...u?{createdBefore:u.toISOString()}:{}}),S=v?.data??[],C=v?.pagination;return y?(0,z.jsx)(`div`,{className:`p-8`,children:(0,z.jsx)(`div`,{className:`max-w-2xl mx-auto my-[30vh] p-8 bg-white border-2 border-red-500 rounded-md whitespace-pre-line leading-8`,children:y.message})}):(0,z.jsxs)(`div`,{className:`p-8`,children:[(0,z.jsx)(xae,{}),(0,z.jsxs)(`div`,{className:`block p-4 bg-white border border-gray-200 rounded-md shadow-sm mb-4`,children:[(0,z.jsx)(`h3`,{className:`text-xl font-semibold mb-4`,children:e(`tasks.definitions`)}),p.length===0?(0,z.jsx)(`div`,{className:`text-center py-8 text-gray-400`,children:e(`tasks.noDefinitions`)}):(0,z.jsxs)(wj,{className:`text-[0.9em]`,children:[(0,z.jsx)(Tj,{children:(0,z.jsxs)(Dj,{className:`hover:bg-transparent bg-gray-100`,children:[(0,z.jsx)(Oj,{children:e(`tasks.workflowName`)}),(0,z.jsx)(Oj,{children:e(`tasks.version`)}),(0,z.jsx)(Oj,{children:e(`tasks.schedule`)}),(0,z.jsx)(Oj,{children:e(`tasks.retryPolicy`)})]})}),(0,z.jsx)(Ej,{children:p.map(e=>(0,z.jsxs)(Dj,{className:`hover:bg-gray-50`,children:[(0,z.jsx)(kj,{className:`font-medium`,children:e.name}),(0,z.jsx)(kj,{className:`text-gray-500 text-xs`,children:e.version??(0,z.jsx)(`span`,{className:`italic text-gray-400`,children:`(unversioned)`})}),(0,z.jsx)(kj,{className:`text-gray-500 text-xs`,children:e.schedules.length>0?e.schedules.map(e=>(0,z.jsxs)(`div`,{className:`mb-1 last:mb-0`,children:[(0,z.jsx)(`span`,{className:`font-medium`,children:e.name}),(0,z.jsx)(`span`,{className:`ml-1 font-mono text-gray-400`,children:e.expression})]},e.name)):`-`}),(0,z.jsx)(kj,{className:`text-gray-500 text-xs`,children:gae(e.retryPolicy)})]},e.id))})]})]}),(0,z.jsxs)(`div`,{className:`block p-4 bg-white border border-gray-200 rounded-md shadow-sm`,children:[(0,z.jsxs)(`div`,{className:`flex items-center justify-between mb-4`,children:[(0,z.jsx)(`h3`,{className:`text-xl font-semibold`,children:e(`tasks.title`)}),(0,z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,z.jsxs)(`span`,{className:`text-xs text-gray-400`,children:[e(`tasks.autoRefresh`),`: 5s`]}),(0,z.jsx)(B,{size:`xs`,icon:(0,z.jsx)(GB,{}),onClick:()=>b(),children:e(`common.refresh`)})]})]}),(0,z.jsxs)(`div`,{className:`flex items-center gap-3 mb-4 flex-wrap`,children:[(0,z.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,z.jsx)(`label`,{className:`text-xs text-gray-500 shrink-0`,children:e(`tasks.filter.status`)}),(0,z.jsx)(yg,{enum:mae,labels:hae,value:i,onValueChange:e=>{a(e??[]),r({})},multiple:!0,placeholder:e(`common.all`),className:`w-[200px]`})]}),h.options.length>0&&(0,z.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,z.jsx)(`label`,{className:`text-xs text-gray-500 shrink-0`,children:e(`tasks.filter.workflowName`)}),(0,z.jsx)(yg,{enum:h,labels:g,value:o,onValueChange:e=>{s(e??``),r({})},clearable:!0,placeholder:e(`common.all`),className:`w-[200px]`})]}),(0,z.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,z.jsx)(`label`,{className:`text-xs text-gray-500 shrink-0`,children:e(`tasks.filter.createdAfter`)}),(0,z.jsx)(ag,{value:c,onValueChange:e=>{l(e),r({})},className:`w-[180px]`})]}),(0,z.jsx)(`span`,{className:`text-gray-400`,children:`~`}),(0,z.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,z.jsx)(`label`,{className:`text-xs text-gray-500 shrink-0`,children:e(`tasks.filter.createdBefore`)}),(0,z.jsx)(ag,{value:u,onValueChange:e=>{d(e),r({})},className:`w-[180px]`})]}),_&&(0,z.jsx)(B,{size:`xs`,variant:`outline`,icon:(0,z.jsx)(pae,{}),onClick:()=>{a([]),s(``),l(void 0),d(void 0),r({})},children:e(`tasks.filter.reset`)})]}),x&&(0,z.jsx)(`div`,{className:`text-center py-8`,children:e(`common.loading`)}),!x&&(0,z.jsxs)(wj,{className:`text-[0.9em]`,children:[(0,z.jsx)(Tj,{children:(0,z.jsxs)(Dj,{className:`hover:bg-transparent bg-gray-100`,children:[(0,z.jsx)(Oj,{children:e(`tasks.workflowName`)}),(0,z.jsx)(Oj,{children:e(`tasks.version`)}),(0,z.jsx)(Oj,{children:e(`tasks.status`)}),(0,z.jsx)(Oj,{children:e(`tasks.attempts`)}),(0,z.jsx)(Oj,{children:e(`tasks.createdAt`)}),(0,z.jsx)(Oj,{children:e(`tasks.startedAt`)}),(0,z.jsx)(Oj,{children:e(`tasks.finishedAt`)}),(0,z.jsx)(Oj,{children:e(`tasks.duration`)})]})}),(0,z.jsxs)(Ej,{children:[S.length===0&&(0,z.jsx)(Dj,{children:(0,z.jsx)(kj,{colSpan:8,className:`text-center py-8 text-gray-400`,children:e(`tasks.noData`)})}),S.map(e=>(0,z.jsxs)(Dj,{className:`hover:bg-gray-50`,children:[(0,z.jsx)(kj,{children:(0,z.jsx)(mP,{to:`/tasks/$workflowRunId`,params:{workflowRunId:e.id},className:`text-blue-600 hover:underline no-underline`,children:e.workflowName})}),(0,z.jsx)(kj,{className:`text-gray-500`,children:e.version??`-`}),(0,z.jsx)(kj,{children:(0,z.jsx)(`span`,{className:(0,kL.default)(`inline-block px-2 py-0.5 text-xs font-bold rounded border`,KB[e.status]??`bg-gray-100 text-gray-800`),children:e.status.toUpperCase()})}),(0,z.jsx)(kj,{className:`text-center`,children:e.attempts}),(0,z.jsx)(kj,{className:`text-gray-500 text-xs`,children:qB(e.createdAt,t)}),(0,z.jsx)(kj,{className:`text-gray-500 text-xs`,children:qB(e.startedAt,t)}),(0,z.jsx)(kj,{className:`text-gray-500 text-xs`,children:qB(e.finishedAt,t)}),(0,z.jsx)(kj,{className:`text-gray-500 text-xs font-mono`,children:JB(e.startedAt,e.finishedAt)})]},e.id))]})]}),C&&(C.prev||C.next)&&(0,z.jsxs)(`div`,{className:`flex justify-center gap-2 mt-4`,children:[(0,z.jsx)(B,{size:`sm`,variant:`outline`,icon:(0,z.jsx)(fae,{}),disabled:!C.prev,onClick:()=>{C.prev&&r({before:C.prev})},children:e(`tasks.prev`)}),(0,z.jsxs)(B,{size:`sm`,variant:`outline`,disabled:!C.next,onClick:()=>{C.next&&r({after:C.next})},children:[e(`tasks.next`),(0,z.jsx)(`span`,{children:(0,z.jsx)(xB,{className:`w-4 h-4`})})]})]})]})]})}var XB=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`})}),ZB=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:`m16 18l6-6l-6-6M8 6l-6 6l6 6`})}),QB=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:`M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z`})}),$B=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`})}),wae=hP(`/scaffolding`)({component:Tae});function Tae({}){let{SD:e}=kP(),{data:t}=J.useEntities(),{entities:n}=t??{},[r,i]=(0,m.useState)({entityIds:[],templateKeys:[]}),[a,o]=(0,m.useState)({open:!1,pathAndCodes:null}),[s,c]=(0,m.useState)({}),l=(n??[]).filter(e=>!e.parentId),u=[`model`,`model_test`,`view_list`,`view_search_input`,`view_form`],d=e=>{i({...r,entityIds:e})},f=e=>{i({...r,templateKeys:u.filter(t=>e.includes(t))})},{data:p,isLoading:h,refetch:g}=J.useScaffoldingStatus(r),{statuses:_}=p??{},v=e=>[e.entityId,e.templateKey].join(`///`),y=[{label:`Entity`,tc:e=>(0,z.jsx)(z.Fragment,{children:e.entityId}),fit:!0},{label:`TemplateKey`,tc:e=>(0,z.jsx)(z.Fragment,{children:e.templateKey}),fit:!0},{label:e(`common.path`),tc:e=>(0,z.jsx)(z.Fragment,{children:e.subPath})},{label:e(`scaffolding.isExists`),tc:e=>(0,z.jsx)(z.Fragment,{children:e.isExists?(0,z.jsx)(B,{icon:(0,z.jsx)(ZB,{}),size:`xs`,variant:`yellow`,onClick:t=>{t.stopPropagation(),J.openVscode({absPath:e.fullPath})}}):(0,z.jsx)($B,{})}),fit:!0},{label:(0,z.jsx)(B,{size:`xs`,variant:`destructive`,icon:(0,z.jsx)(XB,{}),onClick:e=>{e.stopPropagation(),b()},children:e(`common.overwrite`)}),tc:e=>(0,z.jsx)(z.Fragment,{children:e.isExists&&(0,z.jsx)(el,{checked:s[v(e)]?.overwrite??!1,onCheckedChange:t=>{c({...s,[v(e)]:{overwrite:t??!1}})}})}),fit:!0},{label:e(`common.preview`),tc:t=>(0,z.jsx)(B,{size:`xs`,variant:`green`,onClick:e=>{e.stopPropagation(),S(t)},children:e(`common.preview`)}),fit:!0}],b=()=>{if(!_)return;let e=_.filter(e=>e.isExists);e.every(e=>s[v(e)]?.overwrite??!1)?c({}):c(e.reduce((e,t)=>(e[v(t)]={overwrite:!0},e),{}))},x=()=>{if(!_)return;let e=_.map(e=>({entityId:e.entityId,templateKey:e.templateKey,overwrite:s[v(e)]?.overwrite??!1}));J.scaffoldingGenerate(e).then(()=>{g()}).catch(PL)},S=e=>{J.scaffoldingPreview(e).then(({pathAndCodes:e})=>{o({open:!0,pathAndCodes:e})}).catch(PL)};return(0,z.jsxs)(`div`,{className:`flex justify-start min-h-[calc(100vh-50px)]`,children:[(0,z.jsxs)(`div`,{className:`bg-sidebar-bg text-white pl-4 pr-0 h-[calc(100vh-var(--spacing-gnb))] sticky left-0 top-gnb w-[250px] overflow-y-auto`,children:[(0,z.jsx)(`h3`,{children:e(`scaffolding.entities`)}),(0,z.jsx)(`div`,{className:`py-3 text-center`,children:r.entityIds.length===l.length?(0,z.jsx)(B,{icon:(0,z.jsx)(XB,{}),onClick:()=>d([]),children:e(`scaffolding.uncheckAllEntities`)}):(0,z.jsx)(B,{icon:(0,z.jsx)(XB,{}),onClick:()=>d(l.map(e=>e.id)),children:e(`scaffolding.checkAllEntities`)})}),l.map(e=>(0,z.jsx)(`div`,{className:`flex items-center pb-2`,id:e.id,children:(0,z.jsx)(el,{checked:r.entityIds.includes(e.id),label:e.id,onCheckedChange:t=>{d(t?[...r.entityIds,e.id]:r.entityIds.filter(t=>t!==e.id))}})},e.id))]}),(0,z.jsx)(`div`,{className:`bg-sidebar-bg pl-8 border-l border-[#85aa8a] h-[calc(100vh-var(--spacing-gnb))] sticky left-0 top-gnb text-white w-[250px] overflow-y-auto`,children:(0,z.jsxs)(`div`,{className:`pb-4`,children:[(0,z.jsx)(`h4`,{className:`mb-1`,children:e(`scaffolding.template`).replace(`{name}`,`Entity`)}),(0,z.jsx)(`div`,{className:`py-3 text-center`,children:r.templateKeys.length===u.length?(0,z.jsx)(B,{icon:(0,z.jsx)(XB,{}),onClick:()=>f([]),children:e(`scaffolding.uncheckAll`)}):(0,z.jsx)(B,{icon:(0,z.jsx)(XB,{}),onClick:()=>f(u),children:e(`scaffolding.checkAll`)})}),u.map(e=>(0,z.jsx)(`div`,{className:`flex items-center pb-2`,children:(0,z.jsx)(el,{checked:r.templateKeys.includes(e),label:e,onCheckedChange:t=>{f(t?[...r.templateKeys,e]:r.templateKeys.filter(t=>t!==e))}})},e))]})}),(0,z.jsx)(`div`,{className:`flex-1 p-4`,children:(0,z.jsxs)(`div`,{children:[!_&&!h&&(0,z.jsx)(`div`,{className:`w-[50em] my-[30vh] mx-auto whitespace-pre-line p-[3em] bg-white leading-[2em] border-2 border-orange-500`,children:e(`scaffolding.selectPrompt`)}),_&&(0,z.jsxs)(`div`,{children:[_.length>0&&(0,z.jsx)(B,{size:`sm`,variant:`default`,icon:(0,z.jsx)(QB,{}),onClick:()=>x(),children:e(`scaffolding.generateTemplates`).replace(`{count}`,String(_.length)).replace(`{overwriteCount}`,String(Object.keys(s).length))}),(0,z.jsxs)(wj,{className:`mt-4 text-[0.9em]`,children:[(0,z.jsx)(Tj,{children:(0,z.jsx)(Dj,{className:`hover:bg-transparent bg-gray-100`,children:y.map((e,t)=>(0,z.jsx)(Oj,{fit:e.fit,className:`py-2 px-3`,children:e.label},t))})}),(0,z.jsx)(Ej,{children:_.map((e,t)=>(0,z.jsx)(m.Fragment,{children:(0,z.jsx)(Dj,{className:e.isExists?`bg-red-50`:`bg-green-50`,children:y.map((t,n)=>(0,z.jsx)(kj,{fit:t.fit,className:`py-2 px-3`,children:t.tc(e)},n))})},t))})]})]})]})}),(0,z.jsx)(td,{open:a.open,onOpenChange:e=>{e||o({open:!1,pathAndCodes:null})},children:(0,z.jsxs)(id,{className:`max-w-4xl max-h-[80vh] overflow-y-auto`,children:[(0,z.jsxs)(ad,{children:[(0,z.jsx)(sd,{children:e(`scaffolding.previewTitle`)}),(0,z.jsx)(cd,{children:e(`scaffolding.previewDesc`)})]}),(0,z.jsx)(`div`,{className:`space-y-4`,children:a.pathAndCodes?.map(e=>(0,z.jsxs)(`div`,{children:[(0,z.jsx)(`div`,{className:`mb-2 text-lg font-bold text-gray-700`,children:e.path}),(0,z.jsx)(`pre`,{className:`bg-green-50 text-gray-900 p-4 rounded-lg overflow-x-auto text-sm font-mono leading-relaxed`,children:(0,z.jsx)(`code`,{children:e.code})})]},e.path))??(0,z.jsx)(`p`,{children:e(`scaffolding.noPreviewData`)})})]})})]})}var Eae=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:9,cy:12,r:3}),(0,z.jsx)(`rect`,{width:20,height:14,x:2,y:5,rx:7})]})}),Dae=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:15,cy:12,r:3}),(0,z.jsx)(`rect`,{width:20,height:14,x:2,y:5,rx:7})]})}),eV=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:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6M3 6h18M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`})}),tV=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`})});function Oae({action:e,targets:t,conns:n,open:r,onOpenChange:i,onCompleted:a}){let[o,s]=(0,m.useState)(!1),{form:c,register:l}=eM(Uk({doShadowDbTesting:_k()}),{doShadowDbTesting:e===`apply`}),[u,d]=(0,m.useState)({status:`idle`}),[f,p]=(0,m.useState)(!1),[h,g]=(0,m.useState)(``),_=(0,m.useRef)(null),v=(n,r)=>{_.current=setInterval(async()=>{try{let{approved:o,rejected:s}=await J.migrationsCheckApproval(n,r);o?(y(),`type`in await J.migrationsRunAction(e,t)||(i(!1),a?.())):s&&(y(),d({status:`rejected`}))}catch(e){console.error(`Polling error:`,e)}},2e3)},y=()=>{_.current&&=(clearInterval(_.current),null)};(0,m.useEffect)(()=>{r||(y(),d({status:`idle`}),g(``))},[r]),(0,m.useEffect)(()=>()=>y(),[]);let b=async()=>{s(!0);try{c.doShadowDbTesting&&await J.migrationsRunAction(`shadow`,t);let n=await J.migrationsRunAction(e,t);`type`in n&&n.type===`pending`?(d({status:`pending`,channel:n.channel,ts:n.ts}),v(n.channel,n.ts)):(i(!1),a?.())}catch(e){PL(e)}finally{s(!1)}},x=async()=>{if(!(!u.channel||!u.ts)){s(!0);try{await J.migrationsForceApproval(u.channel,u.ts,h),`type`in await J.migrationsRunAction(e,t,{force:!0,forceReason:h})||(i(!1),a?.())}catch(e){PL(e)}finally{s(!1),p(!1)}}};return(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(td,{open:r,onOpenChange:i,children:(0,z.jsxs)(id,{className:`max-w-4xl max-h-[90vh] flex flex-col`,children:[(0,z.jsxs)(ad,{children:[(0,z.jsx)(sd,{children:`Migrations Action Form`}),(0,z.jsxs)(cd,{children:[`Execute migration action: `,e.toUpperCase()]})]}),(0,z.jsx)(`div`,{className:`overflow-y-auto flex-1 p-4`,children:(0,z.jsx)(`div`,{className:`form ${o?`loading`:``}`,children:(0,z.jsxs)(`div`,{className:`ui basic segment`,children:[(0,z.jsxs)(`div`,{children:[(0,z.jsxs)(`h4`,{children:[`Action: `,e.toUpperCase()]}),(0,z.jsx)(`p`,{children:`\xA0`})]}),(0,z.jsxs)(`div`,{className:`targets`,children:[(0,z.jsx)(`h4`,{children:`Targets`}),(0,z.jsx)(`div`,{className:`flex w-full gap-2 my-4`,children:n.map(e=>(0,z.jsxs)(`div`,{className:(0,kL.default)(`flex-1 text-center p-4 bg-[#f1fff5] border border-[#b1f3c4] rounded-[0.3em] opacity-30`,{"bg-[#b1f3c4] text-green-600 font-bold opacity-100":t.includes(e.connKey)}),children:[t.includes(e.connKey)&&(0,z.jsx)(XB,{className:`h-4 w-4 inline-block mr-1`}),e.name]},e.name))})]}),e===`apply`&&(0,z.jsxs)(`div`,{className:`shadow-db-testing`,children:[(0,z.jsx)(`h4`,{children:`Shadow DB Testing`}),(0,z.jsx)(Cj,{...l(`doShadowDbTesting`)})]}),u.status===`pending`&&(0,z.jsxs)(`div`,{className:`p-4 bg-yellow-50 border border-yellow-200 rounded mt-4`,children:[(0,z.jsxs)(`div`,{className:`flex items-center gap-2 mb-2`,children:[(0,z.jsx)(tV,{className:`h-4 w-4 animate-spin`}),(0,z.jsx)(`span`,{className:`font-medium`,children:`승인 대기중...`})]}),(0,z.jsx)(`p`,{className:`text-sm text-gray-600 mb-4`,children:`슬랙에서 ✅ 이모지를 눌러 승인해주세요.`}),(0,z.jsx)(B,{variant:`outline`,onClick:()=>p(!0),children:`Force 진행`})]}),u.status===`rejected`&&(0,z.jsx)(`div`,{className:`p-4 bg-red-50 border border-red-200 rounded mt-4`,children:(0,z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,z.jsx)($B,{className:`h-4 w-4 text-red-600`}),(0,z.jsx)(`span`,{className:`font-medium text-red-600`,children:`마이그레이션이 거절되었습니다.`})]})})]})})}),(0,z.jsx)(od,{children:(0,z.jsx)(B,{onClick:b,icon:(0,z.jsx)(QB,{}),disabled:o||u.status===`pending`,children:`Commit`})})]})}),(0,z.jsx)(td,{open:f,onOpenChange:p,children:(0,z.jsxs)(id,{children:[(0,z.jsxs)(ad,{children:[(0,z.jsx)(sd,{children:`Force 진행`}),(0,z.jsx)(cd,{children:`승인 없이 진행합니다. 사유를 입력해주세요.`})]}),(0,z.jsx)(Qj,{placeholder:`사유 입력...`,value:h,onChange:e=>g(e.target.value)}),(0,z.jsxs)(od,{children:[(0,z.jsx)(B,{variant:`outline`,onClick:()=>p(!1),children:`취소`}),(0,z.jsx)(B,{onClick:x,disabled:!h.trim()||o,children:`진행`})]})]})})]})}var kae=hP(`/migrations`)({component:Aae});function Aae(e){let{SD:t}=kP(),{data:n,error:r,refetch:i}=J.useMigrationStatus(),{status:a}=n??{},{preparedCodes:o,conns:s,codes:c}=a??{},l=a?.error,u=!r&&!n,[d,f]=(0,m.useState)(!1),[p,h]=(0,m.useState)([]),[g,_]=(0,m.useState)([]),[v,y]=(0,m.useState)(!1),[b,x]=(0,m.useState)(null),[S,C]=(0,m.useState)(!1),w=e=>{let t=new Set((s??[]).map(e=>e.connKey)),n=(()=>{switch(e){case`ALL`:return[`test`,`fixture`,`development`,`staging`,`production`];case`LOCAL`:return[`test`];case`REMOTE`:return[`development`,`staging`,`production`];case`TESTING`:return[`test`,`fixture`];case`FIXTURE`:return[`fixture`]}})().filter(e=>t.has(e));n.length!==0&&(n.filter(e=>p.includes(e)).length===n.length?h(p.filter(e=>!n.includes(e))):jne(n,p).length>0?h(n):h(pj([...p,...n])))},T=()=>{g.length!==0&&confirm(t(`migration.confirm.deleteCodes`).replace(`{count}`,String(g.length)))&&(f(!0),J.migrationsDelCodes(g).then(()=>{i()}).catch(PL).finally(()=>{f(!1)}))},E=()=>{f(!0),J.migrationsGeneratePreparedCodes().then(()=>{setTimeout(()=>{i()},500)}).catch(PL).finally(()=>{f(!1)})},D=(e,t)=>{s&&(x({action:e,targets:t??p}),y(!0))},O=()=>{i()},k=()=>{c&&(g.length===0?_(c.map(e=>e.name)):_([]))};return r?(0,z.jsx)(`div`,{className:`p-8`,children:(0,z.jsx)(`div`,{className:`w-[50em] my-[30vh] mx-auto whitespace-pre-line p-[3em] bg-white leading-[2em] border-2 border-red-500`,children:r.message})}):(0,z.jsxs)(`div`,{className:`p-8`,children:[(0,z.jsxs)(`div`,{className:`block p-4 bg-white border border-gray-200 rounded-md shadow-sm ${d||u?`opacity-50 pointer-events-none`:``}`,children:[o&&(0,z.jsxs)(`div`,{className:`p-4`,children:[(0,z.jsxs)(`h3`,{className:`relative `,children:[t(`migration.preparedCodes`),` `,(0,z.jsxs)(`div`,{className:`absolute right-0 top-0 flex gap-2`,children:[(0,z.jsx)(B,{icon:S?(0,z.jsx)(Dae,{}):(0,z.jsx)(Eae,{}),size:`xs`,onClick:()=>C(!S),children:t(`migration.toggleCodes`)}),(0,z.jsx)(B,{size:`xs`,icon:(0,z.jsx)(QB,{}),onClick:()=>E(),children:t(`migration.generate`)})]})]}),(0,z.jsxs)(wj,{children:[(0,z.jsx)(Tj,{children:(0,z.jsxs)(Dj,{className:`hover:bg-transparent bg-gray-100`,children:[(0,z.jsx)(Oj,{children:t(`common.type`)}),(0,z.jsx)(Oj,{children:t(`common.table`)}),(0,z.jsx)(Oj,{children:t(`common.name`)}),(0,z.jsx)(Oj,{children:t(`common.code`)})]})}),(0,z.jsxs)(Ej,{children:[l&&(0,z.jsx)(Dj,{children:(0,z.jsx)(kj,{colSpan:6,children:l})}),!l&&o.length===0&&(0,z.jsx)(Dj,{children:(0,z.jsx)(kj,{colSpan:6,className:`text-center`,children:t(`migration.noPreparedCodes`)})}),o.map((e,n)=>(0,z.jsxs)(Dj,{children:[(0,z.jsx)(kj,{children:e.type}),(0,z.jsx)(kj,{children:e.table}),(0,z.jsx)(kj,{children:e.title}),(0,z.jsx)(kj,{style:{padding:0,width:700,textAlign:`center`},children:(0,z.jsx)(jae,{code:e.formatted??``,open:S,collapsedText:t(`migration.codeCollapsed`)})})]},n))]})]}),(0,z.jsx)(`div`,{className:`border-b border-gray-200`})]}),(0,z.jsxs)(`div`,{className:`p-4`,children:[(0,z.jsx)(`h3`,{children:t(`migration.codeFiles`)}),(0,z.jsxs)(`div`,{className:`flex gap-8`,children:[(0,z.jsx)(`div`,{className:`flex-1`,children:(0,z.jsx)(B,{variant:`destructive`,icon:(0,z.jsx)(eV,{}),disabled:g.length===0,onClick:()=>T(),children:t(`migration.deleteCodes`)})}),(0,z.jsx)(`div`,{className:`flex gap-2 justify-end`,children:[`ALL`,`LOCAL`,`REMOTE`,`TESTING`,`FIXTURE`].map(e=>(0,z.jsx)(B,{variant:`yellow`,onClick:()=>w(e),children:e},e))}),(0,z.jsxs)(`div`,{className:`flex gap-2 justify-end`,children:[(0,z.jsx)(B,{variant:`default`,icon:(0,z.jsx)(QB,{}),disabled:p.length===0||!!l,onClick:()=>D(`apply`),children:t(`migration.applyToLatest`)}),(0,z.jsx)(B,{variant:`destructive`,icon:(0,z.jsx)(GB,{}),disabled:p.length===0||!!l,onClick:()=>D(`rollback`),children:t(`migration.rollback`)})]})]}),s&&c&&(0,z.jsxs)(wj,{className:`mt-4 text-[0.9em]`,children:[(0,z.jsx)(Tj,{children:(0,z.jsxs)(Dj,{className:`hover:bg-transparent bg-gray-100`,children:[(0,z.jsxs)(Oj,{className:`flex items-center gap-1`,children:[`Name`,` `,(0,z.jsx)(B,{icon:(0,z.jsx)(XB,{}),size:`xs`,variant:`blue`,onClick:()=>k()})]}),s.map((e,t)=>(0,z.jsx)(Oj,{style:{width:`150px`},className:(0,kL.default)(`py-2 px-3`,{"bg-[#dafde6]":p.includes(e.connKey)}),children:(0,z.jsx)(el,{disabled:e.status===`error`||!!l,checked:p.includes(e.connKey),label:(0,z.jsxs)(vv,{children:[(0,z.jsx)(yv,{children:`${e.name} / ${e.status}`}),(0,z.jsx)(bv,{children:(0,z.jsx)(`p`,{children:e.connString})})]}),onCheckedChange:t=>{h(t?pj([...p,e.connKey]):p.filter(t=>t!==e.connKey))}})},t))]})}),(0,z.jsxs)(Ej,{children:[(s.some(e=>e.status===`error`)||!!l)&&(0,z.jsx)(Dj,{children:(0,z.jsxs)(kj,{colSpan:6,children:[(0,z.jsx)(`b`,{className:`text-destructive`,children:t(`migration.error.connections`)}),l&&(0,z.jsx)(`pre`,{className:`mt-1 text-xs text-destructive whitespace-pre-wrap break-all`,children:l})]})}),c.length===0&&(0,z.jsx)(Dj,{children:(0,z.jsx)(kj,{colSpan:6,children:t(`migration.noCodeFiles`)})}),c.map((e,t)=>(0,z.jsx)(m.Fragment,{children:(0,z.jsxs)(Dj,{children:[(0,z.jsxs)(kj,{className:`flex items-center gap-1`,children:[(0,z.jsx)(el,{checked:g.includes(e.name),label:e.name,onCheckedChange:t=>{_(t?pj([...g,e.name]):g.filter(t=>t!==e.name))}}),`\xA0`,` `,(0,z.jsx)(B,{size:`xs`,variant:`secondary`,icon:(0,z.jsx)(ZB,{}),onClick:()=>{J.openVscode({absPath:e.path})}})]}),s.map((t,n)=>(0,z.jsx)(kj,{className:(0,kL.default)(`text-center py-2 px-3`,{"bg-[#dafde6]":p.includes(t.connKey)}),children:t.pending.includes(e.name)?(0,z.jsx)(`span`,{className:`inline-block px-2 py-1 text-xs font-bold rounded bg-yellow-500 text-white`,children:`PENDING`}):t.status===`error`||l?(0,z.jsx)(`span`,{className:`inline-block px-2 py-1 text-xs font-bold rounded bg-red-500 text-white`,children:`ERROR`}):(0,z.jsx)(`span`,{className:`inline-block px-2 py-1 text-xs font-bold rounded bg-green-500 text-white`,children:`APPLIED`})},n))]})},t))]})]})]})]}),s&&b&&(0,z.jsx)(Oae,{action:b.action,targets:b.targets,conns:s,open:v,onOpenChange:y,onCompleted:O})]})}function jae({code:e,open:t,collapsedText:n}){return(0,z.jsx)(`div`,{className:`flex items-start`,children:t?(0,z.jsx)(`pre`,{className:`bg-green-50 text-gray-900 p-4 rounded-lg overflow-x-auto text-sm font-mono leading-relaxed text-left`,children:(0,z.jsx)(`code`,{children:e})}):(0,z.jsx)(`div`,{className:`m-auto`,children:n})})}var Mae=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:`M12 15V3m9 12v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`}),(0,z.jsx)(`path`,{d:`m7 10l5 5l5-5`})]})}),nV=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:`M5 12h14m-7-7v14`})}),Nae=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:`M12 3v12m5-7l-5-5l-5 5m14 7v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`})}),Pae=hP(`/i18n`)({component:Fae});function Fae(){let{SD:e}=kP(),{data:t,error:n,refetch:r}=J.useI18nDictionary(),{rows:i,locales:a,defaultLocale:o,stats:s}=t??{},c=!n&&!t,[l,u]=(0,m.useState)(!1),d=(0,m.useRef)(null),[f,p]=(0,m.useState)(null),[h,g]=(0,m.useState)(``),_=(0,m.useRef)(null),[v,y]=(0,m.useState)(new Set),[b,x]=(0,m.useState)(null),[S,C]=(0,m.useState)(!1),[w,T]=(0,m.useState)(``),[E,D]=(0,m.useState)({});(0,m.useEffect)(()=>{f&&_.current&&(_.current.focus(),_.current.select())},[f]),(0,m.useEffect)(()=>{!i||i.length===0||(async()=>{let e=i.filter(e=>e.source===`project`).map(e=>e.key);if(e.length!==0)try{let t=await J.checkI18nUsage(e);if(t.error){x(t.error);return}y(new Set(t.unusedKeys)),x(null)}catch{}})()},[i]);let O=()=>{window.location.href=`/sonamu-ui/api/i18n/export`},k=()=>{d.current?.click()},A=async e=>{let t=e.target.files?.[0];if(t){u(!0);try{await J.importI18n(t),await r(),alert(`Import completed successfully!`)}catch(e){PL(e)}finally{u(!1),d.current&&(d.current.value=``)}}},j=(e,t)=>{if(e.source===`sonamu`)return;let n=t===`key`?e.key:e[t]??``;p({key:e.key,field:t}),g(n)},M=async e=>{if(!f||!a)return;let{field:t}=f,n=e.key;if(h===(t===`key`?e.key:e[t]??``)){p(null);return}u(!0);try{if(t===`key`){let t={};for(let n of a)e[n]&&(t[n]=e[n]);await J.updateI18n({oldKey:n,newKey:h,source:e.source,values:t})}else await J.updateI18n({oldKey:n,newKey:n,source:e.source,values:{[t]:h}});await r()}catch(e){PL(e)}finally{u(!1),p(null)}},N=()=>{p(null),g(``)},P=()=>{T(``),D({}),C(!0)},F=async()=>{if(!w.trim()){alert(`키를 입력해주세요`);return}u(!0);try{await J.createI18n({key:w.trim(),values:E}),C(!1),await r()}catch(e){PL(e)}finally{u(!1)}},ee=async t=>{if(confirm(e(`i18n.confirm.delete`).replace(`{key}`,t))){u(!0);try{await J.deleteI18n(t),await r()}catch(e){PL(e)}finally{u(!1)}}},te=(e,t)=>{e.key===`Enter`?(e.preventDefault(),M(t)):e.key===`Escape`&&(e.preventDefault(),N())},ne=(e,t,n,r)=>{let i=f?.key===e.key&&f?.field===t,a=e.source!==`sonamu`;return i?(0,z.jsx)(kj,{className:r,children:(0,z.jsx)(`input`,{ref:_,type:`text`,value:h,onChange:e=>g(e.target.value),onBlur:()=>M(e),onKeyDown:t=>te(t,e),className:`w-full px-2 py-1 text-sm border border-blue-400 rounded outline-none focus:ring-2 focus:ring-blue-200`})}):(0,z.jsx)(kj,{className:`${r} ${a?`cursor-pointer hover:bg-blue-50`:``}`,onDoubleClick:()=>a&&j(e,t),children:n})};return(0,z.jsxs)(`div`,{className:`p-8`,children:[(0,z.jsx)(`div`,{className:`block p-4 bg-white border border-gray-200 rounded-md shadow-sm ${l||c?`opacity-50 pointer-events-none`:``}`,children:(0,z.jsxs)(`div`,{className:`p-4`,children:[(0,z.jsxs)(`div`,{className:`flex items-center gap-2 mb-4`,style:{display:`flex`,alignItems:`baseline`},children:[(0,z.jsx)(`h3`,{children:e(`i18n.title`)}),(0,z.jsx)(B,{variant:`outline`,size:`sm`,onClick:()=>r(),disabled:l,icon:(0,z.jsx)(GB,{className:`w-4 h-4`})})]}),(0,z.jsxs)(`div`,{className:`flex gap-2 mb-4`,children:[(0,z.jsx)(B,{onClick:P,disabled:l,icon:(0,z.jsx)(nV,{className:`w-4 h-4`}),children:e(`i18n.addKey`)}),(0,z.jsx)(B,{onClick:O,disabled:l,icon:(0,z.jsx)(Nae,{className:`w-4 h-4`}),children:e(`i18n.exportExcel`)}),(0,z.jsx)(B,{onClick:k,disabled:l,icon:(0,z.jsx)(Mae,{className:`w-4 h-4`}),children:e(`i18n.importExcel`)}),(0,z.jsx)(`input`,{type:`file`,ref:d,onChange:A,accept:`.xlsx,.xls`,className:`hidden`})]}),(0,z.jsx)(`p`,{className:`text-sm text-gray-500 mb-4`,children:e(`i18n.editHint`)}),b&&(0,z.jsxs)(`p`,{className:`text-sm text-yellow-600 mb-4 p-2 bg-yellow-50 rounded`,children:[`⚠ `,b]}),c&&(0,z.jsx)(`div`,{className:`text-gray-500`,children:e(`common.loading`)}),n&&(0,z.jsxs)(`div`,{className:`text-red-500`,children:[e(`common.error`),`: `,String(n)]}),i&&a&&(0,z.jsxs)(wj,{containerClassName:`border rounded-lg overflow-auto max-h-[calc(100vh-250px)]`,children:[(0,z.jsx)(Tj,{children:(0,z.jsxs)(Dj,{children:[(0,z.jsx)(Oj,{className:`sticky top-0 z-10 min-w-[300px] bg-gray-100`,children:e(`i18n.key`)}),(0,z.jsx)(Oj,{className:`sticky top-0 z-10 min-w-[100px] bg-gray-100`,children:e(`i18n.source`)}),a.map(e=>(0,z.jsxs)(Oj,{className:`sticky top-0 z-10 min-w-[200px] bg-gray-100`,children:[e,e===o&&` (default)`,s?.[e]&&(0,z.jsxs)(`span`,{className:`ml-2 text-xs ${s[e].percent===100?`text-green-600`:s[e].percent>=80?`text-yellow-600`:`text-red-600`}`,children:[s[e].percent,`%`]})]},e)),(0,z.jsx)(Oj,{className:`sticky top-0 z-10 w-[60px] bg-gray-100`})]})}),(0,z.jsx)(Ej,{children:i.map(e=>(0,z.jsxs)(Dj,{className:e.source===`sonamu`?`bg-gray-50 text-gray-500`:void 0,children:[ne(e,`key`,(0,z.jsxs)(z.Fragment,{children:[!b&&v.has(e.key)&&(0,z.jsx)(`span`,{className:`text-red-500 mr-1`,title:`미사용 키`,children:`❗`}),e.key]}),`font-mono text-sm`),(0,z.jsx)(kj,{children:(0,z.jsx)(`span`,{className:`text-xs px-2 py-0.5 rounded ${e.source===`entity`?`bg-blue-100 text-blue-700`:e.source===`sonamu`?`bg-gray-200 text-gray-600`:`bg-green-100 text-green-700`}`,children:e.source})}),a.map(t=>{let n=!e[t];return ne(e,t,n?(0,z.jsx)(`span`,{className:`text-yellow-600`,children:`⚠ -`}):e[t],`text-sm ${n?`bg-yellow-50`:``}`)}),(0,z.jsx)(kj,{children:e.source===`project`&&(0,z.jsx)(`button`,{type:`button`,onClick:()=>ee(e.key),className:`p-1 text-gray-400 hover:text-red-500 transition-colors`,title:`Delete key`,children:(0,z.jsx)(TB,{className:`w-4 h-4`})})})]},e.key))})]}),(0,z.jsx)(`div`,{className:`mt-4 text-sm text-gray-500`,children:i&&(0,z.jsx)(`span`,{children:e(`i18n.totalKeys`).replace(`{count}`,String(i.length))})})]})}),S&&a&&(0,z.jsx)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center bg-black/50`,children:(0,z.jsxs)(`div`,{className:`bg-white rounded-lg shadow-xl w-full max-w-md p-6`,children:[(0,z.jsx)(`h3`,{className:`text-lg font-semibold mb-4`,children:e(`i18n.modal.addNewKey`)}),(0,z.jsxs)(`div`,{className:`space-y-4`,children:[(0,z.jsxs)(`div`,{children:[(0,z.jsx)(`label`,{className:`block text-sm font-medium text-gray-700 mb-1`,children:e(`i18n.key`)}),(0,z.jsx)(`input`,{type:`text`,value:w,onChange:e=>T(e.target.value),placeholder:`e.g. common.myNewKey`,className:`w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500`})]}),a.map(t=>(0,z.jsxs)(`div`,{children:[(0,z.jsxs)(`label`,{className:`block text-sm font-medium text-gray-700 mb-1`,children:[t,t===o&&` (default)`]}),(0,z.jsx)(`input`,{type:`text`,value:E[t]??``,onChange:e=>D(n=>({...n,[t]:e.target.value})),placeholder:e(`i18n.modal.valueFor`).replace(`{locale}`,t),className:`w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500`})]},t))]}),(0,z.jsxs)(`div`,{className:`flex justify-end gap-2 mt-6`,children:[(0,z.jsx)(B,{variant:`outline`,onClick:()=>C(!1),disabled:l,children:e(`common.cancel`)}),(0,z.jsx)(B,{onClick:F,disabled:l,children:e(l?`i18n.creating`:`common.create`)})]})]})})]})}var Iae=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)(`ellipse`,{cx:12,cy:5,rx:9,ry:3}),(0,z.jsx)(`path`,{d:`M3 5v14a9 3 0 0 0 18 0V5`}),(0,z.jsx)(`path`,{d:`M3 12a9 3 0 0 0 18 0`})]})}),Lae=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)(`rect`,{width:18,height:18,x:3,y:3,rx:2}),(0,z.jsx)(`path`,{d:`M3 9h18M3 15h18M9 3v18m6-18v18`})]})}),rV=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})]})}),Rae=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:`M12 3v18`}),(0,z.jsx)(`rect`,{width:18,height:18,x:3,y:3,rx:2}),(0,z.jsx)(`path`,{d:`M3 9h18M3 15h18`})]})}),iV=`vercel.ai.error`,zae=Symbol.for(iV),aV,Bae=class e extends Error{constructor({name:e,message:t,cause:n}){super(t),this[aV]=!0,this.name=e,this.cause=n}static isInstance(t){return e.hasMarker(t,iV)}static hasMarker(e,t){let n=Symbol.for(t);return typeof e==`object`&&!!e&&n in e&&typeof e[n]==`boolean`&&e[n]===!0}};aV=zae;var oV=Bae;function sV(e){return e==null?`unknown error`:typeof e==`string`?e:e instanceof Error?e.message:JSON.stringify(e)}var cV=`AI_InvalidArgumentError`,lV=`vercel.ai.error.${cV}`,Vae=Symbol.for(lV),uV,Hae=class extends oV{constructor({message:e,cause:t,argument:n}){super({name:cV,message:e,cause:t}),this[uV]=!0,this.argument=n}static isInstance(e){return oV.hasMarker(e,lV)}};uV=Vae;var dV=`AI_JSONParseError`,fV=`vercel.ai.error.${dV}`,Uae=Symbol.for(fV),pV,mV=class extends oV{constructor({text:e,cause:t}){super({name:dV,message:`JSON parsing failed: Text: ${e}.
|
|
103
103
|
Error message: ${sV(t)}`,cause:t}),this[pV]=!0,this.text=e}static isInstance(e){return oV.hasMarker(e,fV)}};pV=Uae;var hV=`AI_TypeValidationError`,gV=`vercel.ai.error.${hV}`,Wae=Symbol.for(gV),_V,Gae=class e extends oV{constructor({value:e,cause:t}){super({name:hV,message:`Type validation failed: Value: ${JSON.stringify(e)}.
|
|
104
104
|
Error message: ${sV(t)}`,cause:t}),this[_V]=!0,this.value=e}static isInstance(e){return oV.hasMarker(e,gV)}static wrap({value:t,cause:n}){return e.isInstance(n)&&n.value===t?n:new e({value:t,cause:n})}};_V=Wae;var vV=Gae,yV=class extends Error{constructor(e,t){super(e),this.name=`ParseError`,this.type=t.type,this.field=t.field,this.value=t.value,this.line=t.line}};function bV(e){}function Kae(e){if(typeof e==`function`)throw TypeError("`callbacks` must be an object, got a function instead. Did you mean `{onEvent: fn}`?");let{onEvent:t=bV,onError:n=bV,onRetry:r=bV,onComment:i}=e,a=``,o=!0,s,c=``,l=``;function u(e){let t=o?e.replace(/^\xEF\xBB\xBF/,``):e,[n,r]=qae(`${a}${t}`);for(let e of n)d(e);a=r,o=!1}function d(e){if(e===``){p();return}if(e.startsWith(`:`)){i&&i(e.slice(e.startsWith(`: `)?2:1));return}let t=e.indexOf(`:`);if(t!==-1){let n=e.slice(0,t),r=e[t+1]===` `?2:1;f(n,e.slice(t+r),e);return}f(e,``,e)}function f(e,t,i){switch(e){case`event`:l=t;break;case`data`:c=`${c}${t}
|
|
105
105
|
`;break;case`id`:s=t.includes(`\0`)?void 0:t;break;case`retry`:/^\d+$/.test(t)?r(parseInt(t,10)):n(new yV(`Invalid \`retry\` value: "${t}"`,{type:`invalid-retry`,value:t,line:i}));break;default:n(new yV(`Unknown field "${e.length>20?`${e.slice(0,20)}\u2026`:e}"`,{type:`unknown-field`,field:e,value:t,line:i}));break}}function p(){c.length>0&&t({id:s,event:l||void 0,data:c.endsWith(`
|