@vireo-ai/trellis-ui 0.1.57 → 0.1.59
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/package.json +2 -1
- package/packages/client/src/components/keybinding/styles.css +15 -5
- package/packages/client/src/components/tabs/styles.css +9 -1
- package/packages/client/src/components/tooltip/styles.css +2 -2
- package/packages/client/src/directives/sortable.css +8 -0
- package/packages/client/src/runtime/drag-and-drop/resize-handle.css +50 -0
- package/packages/client/src/styles/generated/theme-fonts.css +1 -1
- package/packages/client/src/styles/generated/theme-palette.css +1 -1
- package/packages/client/src/styles/generated/theme-runtime.css +3 -3
- package/packages/client/src/styles/generated-sources.css +1 -1
- package/packages/client/types/components/keybinding/contract.d.ts +5 -5
- package/packages/client/types/components/modal/contract.d.ts +9 -3
- package/packages/client/types/motion/recipe.d.ts +2 -2
- package/packages/client/types/runtime/drag-and-drop/pdd.d.ts +2 -2
- package/packages/server/trellis_ui/static/trellis_ui/assets/css/trellis.css +45 -13
- package/packages/server/trellis_ui/static/trellis_ui/assets/css/trellis.min.css +1 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/build-metadata.json +277 -277
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/capabilities/motion.js +1 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/capabilities/sortable.js +1 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{capability-motion-BGVnZE_T.js → capability-motion-D_BJBnwB.js} +2 -2
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{capability-motion-BGVnZE_T.js.map → capability-motion-D_BJBnwB.js.map} +1 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/capability-sortable-BDbURlVO.js +5 -0
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/capability-sortable-BDbURlVO.js.map +1 -0
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/controller-C8xqwkr0.js +2 -0
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/controller-C8xqwkr0.js.map +1 -0
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{entry.generated-DYQxGle9.js → entry.generated-18lXAVBg.js} +2 -2
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{entry.generated-DYQxGle9.js.map → entry.generated-18lXAVBg.js.map} +1 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{entry.generated-C_ObpRjR.js → entry.generated-2YvnuzOD.js} +2 -2
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{entry.generated-C_ObpRjR.js.map → entry.generated-2YvnuzOD.js.map} +1 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{entry.generated-z3EbXrD0.js → entry.generated-BITa8xFV.js} +2 -2
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{entry.generated-z3EbXrD0.js.map → entry.generated-BITa8xFV.js.map} +1 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{entry.generated-D_jeOgRf.js → entry.generated-BSVJpGWu.js} +2 -2
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{entry.generated-D_jeOgRf.js.map → entry.generated-BSVJpGWu.js.map} +1 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-BgGSoQFS.js +2 -0
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-BgGSoQFS.js.map +1 -0
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{entry.generated-COp9wMCd.js → entry.generated-Bp3Npe3t.js} +2 -2
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{entry.generated-COp9wMCd.js.map → entry.generated-Bp3Npe3t.js.map} +1 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{entry.generated-CVOYoh61.js → entry.generated-Ce_fpT15.js} +2 -2
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{entry.generated-CVOYoh61.js.map → entry.generated-Ce_fpT15.js.map} +1 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{entry.generated-Cb-VMAE1.js → entry.generated-DDrayI_M.js} +2 -2
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{entry.generated-Cb-VMAE1.js.map → entry.generated-DDrayI_M.js.map} +1 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{entry.generated-DaXIKPN9.js → entry.generated-HqE8R7N1.js} +2 -2
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{entry.generated-DaXIKPN9.js.map → entry.generated-HqE8R7N1.js.map} +1 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{entry.generated-BREj4oHG.js → entry.generated-OT_bt7F2.js} +2 -2
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{entry.generated-BREj4oHG.js.map → entry.generated-OT_bt7F2.js.map} +1 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{entry.generated-BAghaHV-.js → entry.generated-WRveW7p9.js} +2 -2
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{entry.generated-BAghaHV-.js.map → entry.generated-WRveW7p9.js.map} +1 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{entry.generated-D6ai6meC.js → entry.generated-dcqwycC7.js} +2 -2
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{entry.generated-D6ai6meC.js.map → entry.generated-dcqwycC7.js.map} +1 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{flip-Bzn312Nc.js → flip-crNQSZEa.js} +2 -2
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{flip-Bzn312Nc.js.map → flip-crNQSZEa.js.map} +1 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{motion-DI5H1Js0.js → motion-B90yNOaV.js} +2 -2
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/motion-B90yNOaV.js.map +1 -0
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/pdd-BG5sXFGF.js.map +1 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/accordion.js +1 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/data-grid.js +1 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/date-picker.js +1 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/dropdown.js +1 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/index.js +1 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/keybinding.js +1 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/modal.js +1 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/panels.js +1 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/select.js +1 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/sidebar.js +1 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/tabs.js +1 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/toast.js +1 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/tooltip.js +1 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/index.js +1 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/logical-entry-manifest.json +77 -77
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/trellis.js +7 -7
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/trellis.min.js +7 -7
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/capability-sortable-ehmPfdn1.js +0 -5
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/capability-sortable-ehmPfdn1.js.map +0 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/controller-CalXJ5hB.js +0 -2
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/controller-CalXJ5hB.js.map +0 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-DqL-zI7j.js +0 -2
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-DqL-zI7j.js.map +0 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/motion-DI5H1Js0.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entry.generated-D6ai6meC.js","names":[],"sources":["../../../../../../../../client/src/components/accordion/contract.ts","../../../../../../../../client/src/components/accordion/machine.ts","../../../../../../../../client/src/components/accordion/styles.ts","../../../../../../../../client/src/components/accordion/index.ts","../../../../../../../../client/src/components/accordion/entry.generated.ts"],"sourcesContent":["import {bool, oneOf, string, type SchemaToProps} from '../../runtime';\nimport {HEADING_LEVELS, ORIENTATIONS, type HeadingLevel, type Orientation} from '../common';\n\nconst ACCORDION_MODES = ['single', 'multiple'] as const;\nconst ACCORDION_ORIENTATIONS = ORIENTATIONS;\nconst ACCORDION_ICON_POSITIONS = ['trailing', 'leading'] as const;\nconst ACCORDION_ITEM_ICON_POSITIONS = ['inherit', ...ACCORDION_ICON_POSITIONS] as const;\nconst ACCORDION_HEADING_AS = HEADING_LEVELS;\nconst ACCORDION_ITEM_HEADING_AS = ['inherit', ...ACCORDION_HEADING_AS] as const;\n\nconst accordionSchema = {\n mode: oneOf(ACCORDION_MODES, 'single'),\n animate: bool,\n collapsible: bool,\n disabled: bool,\n orientation: oneOf(ACCORDION_ORIENTATIONS, 'vertical'),\n defaultValue: string,\n defaultValues: string,\n value: string,\n values: string,\n loop: bool.default(true),\n iconPosition: oneOf(ACCORDION_ICON_POSITIONS, 'trailing'),\n headingAs: oneOf(ACCORDION_HEADING_AS, 'h3'),\n class: string,\n};\n\ntype AccordionMode = typeof ACCORDION_MODES[number];\ntype AccordionOrientation = Orientation;\ntype AccordionIconPosition = typeof ACCORDION_ICON_POSITIONS[number];\ntype AccordionItemIconPosition = typeof ACCORDION_ITEM_ICON_POSITIONS[number];\ntype AccordionHeadingAs = HeadingLevel;\ntype AccordionItemHeadingAs = typeof ACCORDION_ITEM_HEADING_AS[number];\ntype AccordionProps = SchemaToProps<typeof accordionSchema>;\n\nexport {\n ACCORDION_HEADING_AS,\n ACCORDION_ICON_POSITIONS,\n ACCORDION_ITEM_HEADING_AS,\n ACCORDION_ITEM_ICON_POSITIONS,\n ACCORDION_ORIENTATIONS,\n ACCORDION_MODES,\n accordionSchema,\n};\nexport type {\n AccordionHeadingAs,\n AccordionIconPosition,\n AccordionItemHeadingAs,\n AccordionItemIconPosition,\n AccordionOrientation,\n AccordionProps,\n AccordionMode,\n};\n","import {\n createMachine,\n propsChanged,\n propsChangedEvent,\n type Machine,\n type MachineEventObject,\n type MachineScope,\n} from '../../runtime/state-machine';\nimport {defineHook, type TransitionHookDefinition} from '../../runtime/transition-coordinator';\nimport type {AccordionProps} from './contract';\n\ntype AccordionContext = {\n selection: {values: string[]};\n change: {openingValues: string[]; closingValues: string[]};\n collection: {values: string[]; disabledValues: string[]};\n};\n\ntype AccordionMachineProps = AccordionProps & {selectionControlled: boolean};\ntype AccordionTransitionData = {value: string};\n\ntype AccordionMachineEffects = {\n prepareChange(scope: MachineScope<AccordionContext, AccordionMachineProps>): void;\n finishChange(scope: MachineScope<AccordionContext, AccordionMachineProps>): void;\n syncDom(scope: MachineScope<AccordionContext, AccordionMachineProps>): void;\n syncProps(scope: MachineScope<AccordionContext, AccordionMachineProps>): void;\n syncItems(scope: MachineScope<AccordionContext, AccordionMachineProps>): void;\n};\n\ntype CreateAccordionMachineOptions = {\n props: AccordionMachineProps;\n context: AccordionContext;\n effects: AccordionMachineEffects;\n};\n\nconst openingHook = defineHook({\n name: 'opening',\n state: 'changing',\n projectEach: (snapshot) => snapshot.context.change.openingValues.map((value) => ({value})),\n onDone: 'CHANGE_DONE',\n onError: 'CHANGE_ERROR',\n sends: {\n open: (value: string) => ({type: 'OPEN', value}),\n close: (value: string) => ({type: 'CLOSE', value}),\n toggle: (value: string) => ({type: 'TOGGLE', value}),\n setValues: (values: string[]) => ({type: 'SET_VALUES', values}),\n },\n} satisfies TransitionHookDefinition<AccordionContext, AccordionProps, AccordionTransitionData, 'opening'>);\n\nconst closingHook = defineHook({\n name: 'closing',\n state: 'changing',\n projectEach: (snapshot) => snapshot.context.change.closingValues.map((value) => ({value})),\n onDone: 'CHANGE_DONE',\n onError: 'CHANGE_ERROR',\n sends: {\n open: (value: string) => ({type: 'OPEN', value}),\n close: (value: string) => ({type: 'CLOSE', value}),\n toggle: (value: string) => ({type: 'TOGGLE', value}),\n setValues: (values: string[]) => ({type: 'SET_VALUES', values}),\n },\n} satisfies TransitionHookDefinition<AccordionContext, AccordionProps, AccordionTransitionData, 'closing'>);\n\nconst accordionHooks = [openingHook, closingHook] as const;\n\nconst stringValue = (value: unknown): string => typeof value === 'string' ? value : '';\nconst stringValues = (value: unknown): string[] => Array.isArray(value)\n ? value.filter((item): item is string => typeof item === 'string')\n : [];\nconst splitValues = (value: string): string[] => value.split(',').map((item) => item.trim()).filter(Boolean);\nconst sameValues = (left: readonly string[], right: readonly string[]): boolean => (\n left.length === right.length && left.every((value, index) => value === right[index])\n);\n\nconst normalizeValues = (\n values: readonly string[],\n props: AccordionProps,\n collection: AccordionContext['collection'],\n): string[] => {\n const requested = new Set(values.filter((value) => collection.values.includes(value)));\n const ordered = collection.values.filter((value) => requested.has(value));\n return props.mode === 'single' ? ordered.slice(0, 1) : ordered;\n};\n\nconst controlledValues = (props: AccordionProps): string[] => (\n props.mode === 'multiple' ? splitValues(props.values || props.value) : props.value ? [props.value] : []\n);\n\nconst nextProps = (scope: MachineScope<AccordionContext, AccordionMachineProps>): AccordionMachineProps => (\n propsChangedEvent<AccordionMachineProps>(scope.event)?.props ?? scope.props\n);\n\nconst nextCollection = (\n scope: MachineScope<AccordionContext, AccordionMachineProps>,\n): AccordionContext['collection'] => {\n if (scope.event.type !== 'ITEMS_CHANGED') return scope.context.collection;\n return {\n values: stringValues(scope.event.values),\n disabledValues: stringValues(scope.event.disabledValues),\n };\n};\n\nconst requestedValues = (\n scope: MachineScope<AccordionContext, AccordionMachineProps>,\n props: AccordionMachineProps,\n collection: AccordionContext['collection'],\n): string[] => {\n const current = scope.context.selection.values;\n const value = stringValue(scope.event.value);\n switch (scope.event.type) {\n case 'OPEN':\n if (!value || collection.disabledValues.includes(value)) return current;\n return props.mode === 'single' ? [value] : [...current, value];\n case 'CLOSE':\n if (\n !value\n || collection.disabledValues.includes(value)\n || (props.mode === 'single' && !props.collapsible && current.includes(value))\n ) return current;\n return current.filter((item) => item !== value);\n case 'TOGGLE':\n if (!value || collection.disabledValues.includes(value)) return current;\n if (!current.includes(value)) return props.mode === 'single' ? [value] : [...current, value];\n if (props.mode === 'single' && !props.collapsible) return current;\n return current.filter((item) => item !== value);\n case 'SET_VALUES':\n return stringValues(scope.event.values);\n case 'PROPS_CHANGED':\n if (\n props.selectionControlled\n && propsChanged<AccordionMachineProps>(scope.event, 'value', 'values')\n ) return controlledValues(props);\n return current;\n case 'ITEMS_CHANGED':\n return current;\n default:\n return current;\n }\n};\n\nconst nextValues = (scope: MachineScope<AccordionContext, AccordionMachineProps>): string[] => {\n const props = nextProps(scope);\n const collection = nextCollection(scope);\n return normalizeValues(requestedValues(scope, props, collection), props, collection);\n};\n\nconst selectionChanges = (scope: MachineScope<AccordionContext, AccordionMachineProps>): boolean => (\n !(\n ['OPEN', 'CLOSE', 'TOGGLE', 'SET_VALUES'].includes(scope.event.type)\n && scope.props.disabled\n ) && !sameValues(scope.context.selection.values, nextValues(scope))\n);\n\nconst createAccordionMachine = ({\n props,\n context,\n effects,\n}: CreateAccordionMachineOptions): Machine<AccordionContext, AccordionMachineProps> => createMachine<AccordionContext, AccordionMachineProps>({\n initial: 'stable',\n on: {\n DOM_INVALIDATED: {effects: 'syncDom'},\n },\n states: {\n stable: {\n tags: ['stable'],\n on: {\n OPEN: {target: 'changing', guard: selectionChanges, reduce: 'applyChange', effects: 'prepareChange'},\n CLOSE: {target: 'changing', guard: selectionChanges, reduce: 'applyChange', effects: 'prepareChange'},\n TOGGLE: {target: 'changing', guard: selectionChanges, reduce: 'applyChange', effects: 'prepareChange'},\n SET_VALUES: {target: 'changing', guard: selectionChanges, reduce: 'applyChange', effects: 'prepareChange'},\n PROPS_CHANGED: [\n {target: 'changing', guard: selectionChanges, reduce: 'applyChange', effects: 'prepareChange'},\n {reduce: 'reconcile', effects: 'syncProps'},\n ],\n ITEMS_CHANGED: [\n {target: 'changing', guard: selectionChanges, reduce: 'applyChange', effects: 'prepareChange'},\n {reduce: 'reconcile', effects: 'syncItems'},\n ],\n },\n },\n changing: {\n tags: ['changing', 'transitioning'],\n on: {\n CHANGE_DONE: {target: 'stable', effects: 'finishChange'},\n CHANGE_ERROR: {target: 'stable', effects: 'finishChange'},\n OPEN: {target: 'changing', guard: selectionChanges, reduce: 'applyChange', effects: 'prepareChange'},\n CLOSE: {target: 'changing', guard: selectionChanges, reduce: 'applyChange', effects: 'prepareChange'},\n TOGGLE: {target: 'changing', guard: selectionChanges, reduce: 'applyChange', effects: 'prepareChange'},\n SET_VALUES: {target: 'changing', guard: selectionChanges, reduce: 'applyChange', effects: 'prepareChange'},\n PROPS_CHANGED: [\n {target: 'changing', guard: selectionChanges, reduce: 'applyChange', effects: 'prepareChange'},\n {reduce: 'reconcile', effects: 'syncProps'},\n ],\n ITEMS_CHANGED: [\n {target: 'changing', guard: selectionChanges, reduce: 'applyChange', effects: 'prepareChange'},\n {reduce: 'reconcile', effects: 'syncItems'},\n ],\n },\n },\n },\n}, {\n context,\n props,\n reducers: {\n applyChange: (scope) => {\n const values = nextValues(scope);\n const previous = scope.context.selection.values;\n return {\n props: nextProps(scope),\n context: {\n ...scope.context,\n selection: {values},\n change: {\n openingValues: values.filter((value) => !previous.includes(value)),\n closingValues: previous.filter((value) => !values.includes(value)),\n },\n collection: nextCollection(scope),\n },\n };\n },\n reconcile: (scope) => ({\n props: nextProps(scope),\n context: {\n ...scope.context,\n collection: nextCollection(scope),\n selection: {values: nextValues(scope)},\n },\n }),\n },\n effects: {\n prepareChange: effects.prepareChange,\n finishChange: effects.finishChange,\n syncDom: effects.syncDom,\n syncProps: effects.syncProps,\n syncItems: effects.syncItems,\n },\n});\n\nexport {accordionHooks, createAccordionMachine};\nexport type {\n AccordionContext,\n AccordionMachineProps,\n AccordionMachineEffects,\n AccordionTransitionData,\n CreateAccordionMachineOptions,\n};\n","import {defineStyles} from '../../runtime';\n\nconst accordionStyles = defineStyles({definition: {\n component: 'ui.accordion',\n parts: {\n root: {\n base: 'grid w-full min-w-0 gap-0',\n variants: {\n orientation: {\n vertical: '',\n horizontal: 'gap-2 md:grid-flow-col md:auto-cols-fr',\n },\n },\n defaults: {\n orientation: 'vertical',\n },\n },\n item: {\n base: 'min-w-0 border-b-edge-separator border-separator last:border-b-0 data-disabled:opacity-50',\n },\n heading: {\n base: 'block text-surface-ink',\n },\n trigger: {\n base: [\n 'flex min-h-control-xlg w-full min-w-0 items-center gap-2 rounded-control-sm border border-transparent px-3 py-2',\n 'text-left text-sm font-medium text-surface-ink outline-none',\n 'focus-visible:ui-focus-ring',\n 'data-disabled:pointer-events-none data-disabled:opacity-50',\n ],\n },\n triggerLabel: {\n base: 'min-w-0 flex-1',\n },\n icon: {\n base: 'size-icon shrink-0 fill-current text-icon',\n },\n content: {\n base: 'overflow-hidden text-sm text-surface-ink-muted',\n },\n contentInner: {\n base: 'min-w-0 px-3 pb-3 pt-1',\n },\n },\n}});\n\nexport {accordionStyles};\n","import type Alpine from 'alpinejs';\n\nimport {\n attribute,\n bool,\n type AlpineMachine,\n createAlpineMachine,\n type BindingObject,\n createCollectionNavigation,\n type CollectionNavigation,\n defineAlpineData,\n mergeBindings,\n type MachineSnapshot,\n observeSemanticChanges,\n reflectSchemaProp,\n resolveStyle,\n type TransitionForHook,\n type TrellisAlpineComponent,\n} from '@client/runtime';\nimport {asBool, dispatch, isRtl} from '@client/utils';\nimport {accordionSchema, type AccordionMode, type AccordionProps} from './contract';\nimport {\n accordionHooks,\n createAccordionMachine,\n type AccordionContext,\n type AccordionMachineProps,\n type AccordionTransitionData,\n} from './machine';\nimport {accordionStyles} from './styles';\n\ntype AccordionTransitionName = (typeof accordionHooks)[number]['name'];\ntype AccordionTransition<TName extends AccordionTransitionName = AccordionTransitionName> = TransitionForHook<\n Extract<(typeof accordionHooks)[number], {name: TName}>,\n HTMLElement\n>;\n\ntype AccordionItemRecord = {\n item: HTMLElement;\n heading: HTMLElement | null;\n trigger: HTMLButtonElement;\n content: HTMLElement;\n value: string;\n disabled: boolean;\n};\n\n/**\n * Public Alpine API for `ui.accordion`.\n *\n * @public\n */\ninterface UiAccordionApi {\n /** Open value in single mode, otherwise an empty string. */\n readonly value: string;\n\n /** Open values in document order. */\n readonly values: readonly string[];\n\n /** Opens an enabled item. In single mode it replaces the current value. */\n open(value: string): void;\n\n /** Closes an item when the current mode permits it. */\n close(value: string): void;\n\n /** Reverses an item's current disclosure state. */\n toggle(value: string, event?: Event): void;\n\n /** Whether an item belongs to the current open-value set. */\n isOpen(value: string): boolean;\n}\n\ntype AccordionData = AlpineMachine<AccordionContext, AccordionMachineProps, typeof accordionHooks> & UiAccordionApi & {\n readonly root: BindingObject;\n init(): void;\n destroy(): void;\n};\n\nconst accordionRuntimeSchema = {\n ...accordionSchema,\n selectionControlled: attribute(bool, 'ui-accordion-controlled'),\n};\n\nconst splitValues = (value: string): string[] => value.split(',').map((item) => item.trim()).filter(Boolean);\nconst stateFor = (open: boolean): 'open' | 'closed' => open ? 'open' : 'closed';\nconst safeIdPart = (value: string): string => value.trim().replace(/[^a-zA-Z0-9_-]+/g, '-') || 'item';\n\nconst UiAccordion = (): TrellisAlpineComponent<AccordionData> => {\n let rootEl: (HTMLElement & Alpine.ElementWithXAttributes) | null = null;\n let collection: CollectionNavigation | null = null;\n let disconnectObserver: (() => void) | null = null;\n let idFor = (key: string): string => key;\n\n const root = (): HTMLElement & Alpine.ElementWithXAttributes => {\n if (!rootEl) throw new Error('Accordion has not been initialized.');\n return rootEl;\n };\n\n const owns = (element: Element): boolean => element.closest('[data-ui-accordion]') === root();\n\n const items = (): AccordionItemRecord[] => Array.from(\n root().querySelectorAll<HTMLElement>('[data-ui-accordion-item]'),\n ).filter(owns).map((item, index) => {\n const trigger = item.querySelector<HTMLElement>('[data-ui-accordion-trigger]');\n const content = item.querySelector<HTMLElement>('[data-ui-accordion-content]');\n if (!(trigger instanceof HTMLButtonElement) || !content || !owns(trigger) || !owns(content)) return null;\n item.dataset.value ||= `item-${index + 1}`;\n return {\n item,\n heading: item.querySelector<HTMLElement>('[data-ui-accordion-heading]'),\n trigger,\n content,\n value: item.dataset.value,\n disabled: asBool({value: item.dataset.itemDisabled}),\n } satisfies AccordionItemRecord;\n }).filter((item): item is AccordionItemRecord => item !== null);\n\n const itemForValue = (value: string): AccordionItemRecord | null => (\n items().find((item) => item.value === value) ?? null\n );\n\n const itemFrom = (target: EventTarget | null): AccordionItemRecord | null => {\n if (!(target instanceof Element)) return null;\n const itemEl = target.closest<HTMLElement>('[data-ui-accordion-item]');\n return itemEl && owns(itemEl) ? items().find((item) => item.item === itemEl) ?? null : null;\n };\n\n const collectionContext = (): AccordionContext['collection'] => {\n const records = items();\n return {\n values: records.map((item) => item.value),\n disabledValues: records.filter((item) => item.disabled).map((item) => item.value),\n };\n };\n\n const normalize = (\n values: readonly string[],\n props: AccordionProps,\n itemValues: readonly string[],\n ): string[] => {\n const requested = new Set(values);\n const ordered = itemValues.filter((value) => requested.has(value));\n return props.mode === 'single' ? ordered.slice(0, 1) : ordered;\n };\n\n const initialContext = (props: AccordionMachineProps): AccordionContext => {\n const collectionState = collectionContext();\n const controlled = props.mode === 'multiple'\n ? splitValues(props.values || props.value)\n : props.value ? [props.value] : [];\n const defaults = props.mode === 'multiple'\n ? splitValues(props.defaultValues)\n : props.defaultValue ? [props.defaultValue] : [];\n const authored = items().filter((item) => asBool({value: item.item.dataset.open})).map((item) => item.value);\n const requested = props.selectionControlled\n ? controlled\n : defaults.length > 0 ? defaults : authored;\n return {\n selection: {values: normalize(requested, props, collectionState.values)},\n change: {openingValues: [], closingValues: []},\n collection: collectionState,\n };\n };\n\n const currentProps = (): Readonly<AccordionMachineProps> => bridge.getCommittedSnapshot().props;\n const currentContext = (): Readonly<AccordionContext> => bridge.getCommittedSnapshot().context;\n\n const itemIsOpen = (item: AccordionItemRecord): boolean => currentContext().selection.values.includes(item.value);\n const itemIsDisabled = (item: AccordionItemRecord): boolean => currentProps().disabled || item.disabled;\n const canCollapse = (item: AccordionItemRecord): boolean => (\n currentProps().mode === 'multiple' || currentProps().collapsible || !itemIsOpen(item)\n );\n\n const syncRoot = (): void => {\n const props = currentProps();\n const values = currentContext().selection.values;\n reflectSchemaProp({\n el: root(),\n schema: accordionSchema,\n key: 'value',\n value: props.mode === 'single' ? values[0] ?? '' : '',\n });\n reflectSchemaProp({\n el: root(),\n schema: accordionSchema,\n key: 'values',\n value: props.mode === 'multiple' ? values.join(',') : '',\n });\n root().dataset.orientation = props.orientation;\n root().dataset.iconPosition = props.iconPosition;\n root().dataset.mode = props.mode;\n if (props.disabled) root().setAttribute('data-disabled', '');\n else root().removeAttribute('data-disabled');\n };\n\n let component!: TrellisAlpineComponent<AccordionData>;\n\n const syncItem = (item: AccordionItemRecord): void => {\n const props = currentProps();\n const open = itemIsOpen(item);\n const state = stateFor(open);\n const disabled = itemIsDisabled(item);\n const closing = bridge.hasTag('changing') && currentContext().change.closingValues.includes(item.value);\n\n item.item.dataset.state = state;\n item.item.dataset.orientation = props.orientation;\n item.item.className = resolveStyle({\n part: accordionStyles.parts.item,\n props,\n className: item.item.dataset.class ?? '',\n });\n item.heading?.setAttribute('data-state', state);\n item.heading?.setAttribute('data-orientation', props.orientation);\n\n const idPart = safeIdPart(item.value);\n item.trigger.id ||= idFor(`accordion-trigger-${idPart}`);\n item.content.id ||= idFor(`accordion-content-${idPart}`);\n item.trigger.type = 'button';\n item.trigger.dataset.state = state;\n item.trigger.dataset.orientation = props.orientation;\n item.trigger.className = resolveStyle({\n part: accordionStyles.parts.trigger,\n props,\n className: item.trigger.dataset.class ?? '',\n });\n item.trigger.setAttribute('aria-expanded', open ? 'true' : 'false');\n item.trigger.setAttribute('aria-controls', item.content.id);\n item.content.dataset.state = state;\n item.content.dataset.orientation = props.orientation;\n item.content.setAttribute('aria-labelledby', item.trigger.id);\n item.content.hidden = !open && !closing;\n\n [item.item, item.heading, item.trigger, item.content].forEach((element) => {\n if (!element) return;\n if (disabled) element.setAttribute('data-disabled', '');\n else element.removeAttribute('data-disabled');\n });\n item.trigger.disabled = disabled;\n if (disabled || (open && !canCollapse(item))) item.trigger.setAttribute('aria-disabled', 'true');\n else item.trigger.removeAttribute('aria-disabled');\n };\n\n const syncAll = (): void => {\n syncRoot();\n items().forEach(syncItem);\n };\n\n const emitChange = (): void => {\n const values = [...currentContext().selection.values];\n dispatch({el: root(), name: 'ui:change', detail: {\n value: currentProps().mode === 'single' ? values[0] ?? '' : '',\n values,\n }});\n };\n\n const bridge = createAlpineMachine({\n schema: accordionRuntimeSchema,\n hooks: accordionHooks,\n resolveTransitionElement: ({data}) => {\n const value = (data as AccordionTransitionData).value;\n return itemForValue(value)?.content ?? null;\n },\n createMachine: ({props}) => createAccordionMachine({\n props,\n context: initialContext(props),\n effects: {\n prepareChange: () => {\n syncAll();\n emitChange();\n },\n finishChange: () => {\n syncAll();\n },\n syncDom: syncAll,\n syncProps: syncAll,\n syncItems: syncAll,\n },\n }),\n });\n\n const collectionNav = (): CollectionNavigation => {\n if (!collection) throw new Error('Accordion navigation has not been initialized.');\n return collection;\n };\n\n const sendItemsChanged = (): void => {\n const next = collectionContext();\n bridge.send({type: 'ITEMS_CHANGED', ...next});\n };\n\n const handleToggle = (item: AccordionItemRecord, event?: Event): void => {\n event?.preventDefault();\n if (itemIsDisabled(item)) return;\n bridge.send({type: 'TOGGLE', value: item.value, motion: !(event instanceof KeyboardEvent)});\n };\n\n const handleClick = (event: Event): void => {\n const item = itemFrom(event.target);\n if (!item || !(event.target instanceof Node) || !item.trigger.contains(event.target)) return;\n handleToggle(item, event);\n };\n\n const handleKeydown = (event: KeyboardEvent): void => {\n const item = itemFrom(event.target);\n if (!item || event.target !== item.trigger) return;\n if (event.key === 'Enter' || event.key === ' ') {\n handleToggle(item, event);\n return;\n }\n if (event.key === 'Home') {\n event.preventDefault();\n collectionNav().focusFirst();\n return;\n }\n if (event.key === 'End') {\n event.preventDefault();\n collectionNav().focusLast();\n return;\n }\n if (currentProps().orientation === 'vertical') {\n if (event.key === 'ArrowDown') {\n event.preventDefault();\n collectionNav().focusNext();\n } else if (event.key === 'ArrowUp') {\n event.preventDefault();\n collectionNav().focusPrevious();\n }\n return;\n }\n if (event.key === 'ArrowRight') {\n event.preventDefault();\n if (isRtl({el: root()})) collectionNav().focusPrevious();\n else collectionNav().focusNext();\n } else if (event.key === 'ArrowLeft') {\n event.preventDefault();\n if (isRtl({el: root()})) collectionNav().focusNext();\n else collectionNav().focusPrevious();\n }\n };\n\n const handleFocus = (event: Event): void => {\n const item = itemFrom(event.target);\n if (item && event.target === item.trigger && !itemIsDisabled(item)) {\n collectionNav().activateItem({el: item.trigger});\n }\n };\n\n const setupObserver = (): void => {\n disconnectObserver = observeSemanticChanges({\n targets: root(),\n read: collectionContext,\n onChange: sendItemsChanged,\n observer: {\n childList: true,\n subtree: true,\n attributes: true,\n attributeFilter: ['data-value', 'data-item-disabled'],\n },\n });\n };\n\n component = {\n ...bridge,\n get value(): string {\n return currentProps().mode === 'single' ? this.snapshot.current?.context.selection.values[0] ?? '' : '';\n },\n get values(): readonly string[] {\n return [...this.snapshot.current?.context.selection.values ?? []];\n },\n init(): void {\n rootEl = this.$el;\n idFor = this.$id.bind(this);\n bridge.connect(this.$el, this.snapshot);\n collection = createCollectionNavigation({\n root,\n itemSelector: '[data-ui-accordion-trigger]',\n isDisabled: (el) => el.hasAttribute('disabled'),\n loop: () => currentProps().loop,\n });\n syncAll();\n setupObserver();\n },\n destroy(): void {\n disconnectObserver?.();\n disconnectObserver = null;\n bridge.disconnect();\n collection = null;\n rootEl = null;\n },\n get root(): BindingObject {\n const props = this.snapshot.current?.props ?? currentProps();\n return mergeBindings({inputs: [\n resolveStyle({part: accordionStyles.parts.root, props, className: props.class}),\n {\n 'data-ui-accordion': '',\n ':data-orientation': () => currentProps().orientation,\n ':data-disabled': () => currentProps().disabled ? '' : undefined,\n '@click': handleClick,\n '@keydown': (event: Event) => {\n if (event instanceof KeyboardEvent) handleKeydown(event);\n },\n '@focusin': handleFocus,\n },\n ]});\n },\n open(value: string): void {\n bridge.send({type: 'OPEN', value});\n },\n close(value: string): void {\n bridge.send({type: 'CLOSE', value});\n },\n toggle(value: string, event?: Event): void {\n const item = itemForValue(value);\n if (item) handleToggle(item, event);\n },\n isOpen(value: string): boolean {\n return this.snapshot.current?.context.selection.values.includes(value) ?? false;\n },\n };\n\n return component;\n};\n\nconst registerAccordion = defineAlpineData('UiAccordion', UiAccordion);\n\nexport {registerAccordion, UiAccordion};\nexport type {AccordionData, AccordionMode, AccordionTransition, UiAccordionApi};\n","// Generated by scripts/generate_component_entries.mjs from packages/client/component-entries.json.\n// Do not edit by hand.\nimport type {Alpine as AlpineType} from 'alpinejs';\nimport {registerMotionCapability} from '../../capabilities/motion';\nimport {registerAccordion as registerComponent} from './index';\n\nconst registered = new WeakSet<AlpineType>();\n\nconst registerAccordion = (AlpineInstance: AlpineType): void => {\n if (registered.has(AlpineInstance)) return;\n registered.add(AlpineInstance);\n registerMotionCapability(AlpineInstance);\n registerComponent(AlpineInstance);\n};\n\nexport {registerAccordion};\nexport default registerAccordion;\nexport * from './index';\n"],"mappings":"gnBAGA,IAAM,EAAkB,CAAC,SAAU,UAAU,EACv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C,CACtC,EACA,OAAO,EAAe,EAAqB,CACvC,IAAM,EAAO,EAAa,CAAK,EAC3B,GAAM,EAAa,EAAM,CAAK,CACtC,EACA,OAAO,EAAwB,CAC3B,OAAO,KAAK,SAAS,SAAS,QAAQ,UAAU,OAAO,SAAS,CAAK,GAAK,EAC9E,CACJ,EAEO,CACX,EAEM,EAAoB,EAAiB,cAAe,CAAW,EC/Z/D,EAAa,IAAI,QAEjB,EAAqB,GAAqC,CACxD,EAAW,IAAI,CAAc,IACjC,EAAW,IAAI,CAAc,EAC7B,EAAyB,CAAc,EACvC,EAAkB,CAAc,EACpC"}
|
|
1
|
+
{"version":3,"file":"entry.generated-dcqwycC7.js","names":[],"sources":["../../../../../../../../client/src/components/accordion/contract.ts","../../../../../../../../client/src/components/accordion/machine.ts","../../../../../../../../client/src/components/accordion/styles.ts","../../../../../../../../client/src/components/accordion/index.ts","../../../../../../../../client/src/components/accordion/entry.generated.ts"],"sourcesContent":["import {bool, oneOf, string, type SchemaToProps} from '../../runtime';\nimport {HEADING_LEVELS, ORIENTATIONS, type HeadingLevel, type Orientation} from '../common';\n\nconst ACCORDION_MODES = ['single', 'multiple'] as const;\nconst ACCORDION_ORIENTATIONS = ORIENTATIONS;\nconst ACCORDION_ICON_POSITIONS = ['trailing', 'leading'] as const;\nconst ACCORDION_ITEM_ICON_POSITIONS = ['inherit', ...ACCORDION_ICON_POSITIONS] as const;\nconst ACCORDION_HEADING_AS = HEADING_LEVELS;\nconst ACCORDION_ITEM_HEADING_AS = ['inherit', ...ACCORDION_HEADING_AS] as const;\n\nconst accordionSchema = {\n mode: oneOf(ACCORDION_MODES, 'single'),\n animate: bool,\n collapsible: bool,\n disabled: bool,\n orientation: oneOf(ACCORDION_ORIENTATIONS, 'vertical'),\n defaultValue: string,\n defaultValues: string,\n value: string,\n values: string,\n loop: bool.default(true),\n iconPosition: oneOf(ACCORDION_ICON_POSITIONS, 'trailing'),\n headingAs: oneOf(ACCORDION_HEADING_AS, 'h3'),\n class: string,\n};\n\ntype AccordionMode = typeof ACCORDION_MODES[number];\ntype AccordionOrientation = Orientation;\ntype AccordionIconPosition = typeof ACCORDION_ICON_POSITIONS[number];\ntype AccordionItemIconPosition = typeof ACCORDION_ITEM_ICON_POSITIONS[number];\ntype AccordionHeadingAs = HeadingLevel;\ntype AccordionItemHeadingAs = typeof ACCORDION_ITEM_HEADING_AS[number];\ntype AccordionProps = SchemaToProps<typeof accordionSchema>;\n\nexport {\n ACCORDION_HEADING_AS,\n ACCORDION_ICON_POSITIONS,\n ACCORDION_ITEM_HEADING_AS,\n ACCORDION_ITEM_ICON_POSITIONS,\n ACCORDION_ORIENTATIONS,\n ACCORDION_MODES,\n accordionSchema,\n};\nexport type {\n AccordionHeadingAs,\n AccordionIconPosition,\n AccordionItemHeadingAs,\n AccordionItemIconPosition,\n AccordionOrientation,\n AccordionProps,\n AccordionMode,\n};\n","import {\n createMachine,\n propsChanged,\n propsChangedEvent,\n type Machine,\n type MachineEventObject,\n type MachineScope,\n} from '../../runtime/state-machine';\nimport {defineHook, type TransitionHookDefinition} from '../../runtime/transition-coordinator';\nimport type {AccordionProps} from './contract';\n\ntype AccordionContext = {\n selection: {values: string[]};\n change: {openingValues: string[]; closingValues: string[]};\n collection: {values: string[]; disabledValues: string[]};\n};\n\ntype AccordionMachineProps = AccordionProps & {selectionControlled: boolean};\ntype AccordionTransitionData = {value: string};\n\ntype AccordionMachineEffects = {\n prepareChange(scope: MachineScope<AccordionContext, AccordionMachineProps>): void;\n finishChange(scope: MachineScope<AccordionContext, AccordionMachineProps>): void;\n syncDom(scope: MachineScope<AccordionContext, AccordionMachineProps>): void;\n syncProps(scope: MachineScope<AccordionContext, AccordionMachineProps>): void;\n syncItems(scope: MachineScope<AccordionContext, AccordionMachineProps>): void;\n};\n\ntype CreateAccordionMachineOptions = {\n props: AccordionMachineProps;\n context: AccordionContext;\n effects: AccordionMachineEffects;\n};\n\nconst openingHook = defineHook({\n name: 'opening',\n state: 'changing',\n projectEach: (snapshot) => snapshot.context.change.openingValues.map((value) => ({value})),\n onDone: 'CHANGE_DONE',\n onError: 'CHANGE_ERROR',\n sends: {\n open: (value: string) => ({type: 'OPEN', value}),\n close: (value: string) => ({type: 'CLOSE', value}),\n toggle: (value: string) => ({type: 'TOGGLE', value}),\n setValues: (values: string[]) => ({type: 'SET_VALUES', values}),\n },\n} satisfies TransitionHookDefinition<AccordionContext, AccordionProps, AccordionTransitionData, 'opening'>);\n\nconst closingHook = defineHook({\n name: 'closing',\n state: 'changing',\n projectEach: (snapshot) => snapshot.context.change.closingValues.map((value) => ({value})),\n onDone: 'CHANGE_DONE',\n onError: 'CHANGE_ERROR',\n sends: {\n open: (value: string) => ({type: 'OPEN', value}),\n close: (value: string) => ({type: 'CLOSE', value}),\n toggle: (value: string) => ({type: 'TOGGLE', value}),\n setValues: (values: string[]) => ({type: 'SET_VALUES', values}),\n },\n} satisfies TransitionHookDefinition<AccordionContext, AccordionProps, AccordionTransitionData, 'closing'>);\n\nconst accordionHooks = [openingHook, closingHook] as const;\n\nconst stringValue = (value: unknown): string => typeof value === 'string' ? value : '';\nconst stringValues = (value: unknown): string[] => Array.isArray(value)\n ? value.filter((item): item is string => typeof item === 'string')\n : [];\nconst splitValues = (value: string): string[] => value.split(',').map((item) => item.trim()).filter(Boolean);\nconst sameValues = (left: readonly string[], right: readonly string[]): boolean => (\n left.length === right.length && left.every((value, index) => value === right[index])\n);\n\nconst normalizeValues = (\n values: readonly string[],\n props: AccordionProps,\n collection: AccordionContext['collection'],\n): string[] => {\n const requested = new Set(values.filter((value) => collection.values.includes(value)));\n const ordered = collection.values.filter((value) => requested.has(value));\n return props.mode === 'single' ? ordered.slice(0, 1) : ordered;\n};\n\nconst controlledValues = (props: AccordionProps): string[] => (\n props.mode === 'multiple' ? splitValues(props.values || props.value) : props.value ? [props.value] : []\n);\n\nconst nextProps = (scope: MachineScope<AccordionContext, AccordionMachineProps>): AccordionMachineProps => (\n propsChangedEvent<AccordionMachineProps>(scope.event)?.props ?? scope.props\n);\n\nconst nextCollection = (\n scope: MachineScope<AccordionContext, AccordionMachineProps>,\n): AccordionContext['collection'] => {\n if (scope.event.type !== 'ITEMS_CHANGED') return scope.context.collection;\n return {\n values: stringValues(scope.event.values),\n disabledValues: stringValues(scope.event.disabledValues),\n };\n};\n\nconst requestedValues = (\n scope: MachineScope<AccordionContext, AccordionMachineProps>,\n props: AccordionMachineProps,\n collection: AccordionContext['collection'],\n): string[] => {\n const current = scope.context.selection.values;\n const value = stringValue(scope.event.value);\n switch (scope.event.type) {\n case 'OPEN':\n if (!value || collection.disabledValues.includes(value)) return current;\n return props.mode === 'single' ? [value] : [...current, value];\n case 'CLOSE':\n if (\n !value\n || collection.disabledValues.includes(value)\n || (props.mode === 'single' && !props.collapsible && current.includes(value))\n ) return current;\n return current.filter((item) => item !== value);\n case 'TOGGLE':\n if (!value || collection.disabledValues.includes(value)) return current;\n if (!current.includes(value)) return props.mode === 'single' ? [value] : [...current, value];\n if (props.mode === 'single' && !props.collapsible) return current;\n return current.filter((item) => item !== value);\n case 'SET_VALUES':\n return stringValues(scope.event.values);\n case 'PROPS_CHANGED':\n if (\n props.selectionControlled\n && propsChanged<AccordionMachineProps>(scope.event, 'value', 'values')\n ) return controlledValues(props);\n return current;\n case 'ITEMS_CHANGED':\n return current;\n default:\n return current;\n }\n};\n\nconst nextValues = (scope: MachineScope<AccordionContext, AccordionMachineProps>): string[] => {\n const props = nextProps(scope);\n const collection = nextCollection(scope);\n return normalizeValues(requestedValues(scope, props, collection), props, collection);\n};\n\nconst selectionChanges = (scope: MachineScope<AccordionContext, AccordionMachineProps>): boolean => (\n !(\n ['OPEN', 'CLOSE', 'TOGGLE', 'SET_VALUES'].includes(scope.event.type)\n && scope.props.disabled\n ) && !sameValues(scope.context.selection.values, nextValues(scope))\n);\n\nconst createAccordionMachine = ({\n props,\n context,\n effects,\n}: CreateAccordionMachineOptions): Machine<AccordionContext, AccordionMachineProps> => createMachine<AccordionContext, AccordionMachineProps>({\n initial: 'stable',\n on: {\n DOM_INVALIDATED: {effects: 'syncDom'},\n },\n states: {\n stable: {\n tags: ['stable'],\n on: {\n OPEN: {target: 'changing', guard: selectionChanges, reduce: 'applyChange', effects: 'prepareChange'},\n CLOSE: {target: 'changing', guard: selectionChanges, reduce: 'applyChange', effects: 'prepareChange'},\n TOGGLE: {target: 'changing', guard: selectionChanges, reduce: 'applyChange', effects: 'prepareChange'},\n SET_VALUES: {target: 'changing', guard: selectionChanges, reduce: 'applyChange', effects: 'prepareChange'},\n PROPS_CHANGED: [\n {target: 'changing', guard: selectionChanges, reduce: 'applyChange', effects: 'prepareChange'},\n {reduce: 'reconcile', effects: 'syncProps'},\n ],\n ITEMS_CHANGED: [\n {target: 'changing', guard: selectionChanges, reduce: 'applyChange', effects: 'prepareChange'},\n {reduce: 'reconcile', effects: 'syncItems'},\n ],\n },\n },\n changing: {\n tags: ['changing', 'transitioning'],\n on: {\n CHANGE_DONE: {target: 'stable', effects: 'finishChange'},\n CHANGE_ERROR: {target: 'stable', effects: 'finishChange'},\n OPEN: {target: 'changing', guard: selectionChanges, reduce: 'applyChange', effects: 'prepareChange'},\n CLOSE: {target: 'changing', guard: selectionChanges, reduce: 'applyChange', effects: 'prepareChange'},\n TOGGLE: {target: 'changing', guard: selectionChanges, reduce: 'applyChange', effects: 'prepareChange'},\n SET_VALUES: {target: 'changing', guard: selectionChanges, reduce: 'applyChange', effects: 'prepareChange'},\n PROPS_CHANGED: [\n {target: 'changing', guard: selectionChanges, reduce: 'applyChange', effects: 'prepareChange'},\n {reduce: 'reconcile', effects: 'syncProps'},\n ],\n ITEMS_CHANGED: [\n {target: 'changing', guard: selectionChanges, reduce: 'applyChange', effects: 'prepareChange'},\n {reduce: 'reconcile', effects: 'syncItems'},\n ],\n },\n },\n },\n}, {\n context,\n props,\n reducers: {\n applyChange: (scope) => {\n const values = nextValues(scope);\n const previous = scope.context.selection.values;\n return {\n props: nextProps(scope),\n context: {\n ...scope.context,\n selection: {values},\n change: {\n openingValues: values.filter((value) => !previous.includes(value)),\n closingValues: previous.filter((value) => !values.includes(value)),\n },\n collection: nextCollection(scope),\n },\n };\n },\n reconcile: (scope) => ({\n props: nextProps(scope),\n context: {\n ...scope.context,\n collection: nextCollection(scope),\n selection: {values: nextValues(scope)},\n },\n }),\n },\n effects: {\n prepareChange: effects.prepareChange,\n finishChange: effects.finishChange,\n syncDom: effects.syncDom,\n syncProps: effects.syncProps,\n syncItems: effects.syncItems,\n },\n});\n\nexport {accordionHooks, createAccordionMachine};\nexport type {\n AccordionContext,\n AccordionMachineProps,\n AccordionMachineEffects,\n AccordionTransitionData,\n CreateAccordionMachineOptions,\n};\n","import {defineStyles} from '../../runtime';\n\nconst accordionStyles = defineStyles({definition: {\n component: 'ui.accordion',\n parts: {\n root: {\n base: 'grid w-full min-w-0 gap-0',\n variants: {\n orientation: {\n vertical: '',\n horizontal: 'gap-2 md:grid-flow-col md:auto-cols-fr',\n },\n },\n defaults: {\n orientation: 'vertical',\n },\n },\n item: {\n base: 'min-w-0 border-b-edge-separator border-separator last:border-b-0 data-disabled:opacity-50',\n },\n heading: {\n base: 'block text-surface-ink',\n },\n trigger: {\n base: [\n 'flex min-h-control-xlg w-full min-w-0 items-center gap-2 rounded-control-sm border border-transparent px-3 py-2',\n 'text-left text-sm font-medium text-surface-ink outline-none',\n 'focus-visible:ui-focus-ring',\n 'data-disabled:pointer-events-none data-disabled:opacity-50',\n ],\n },\n triggerLabel: {\n base: 'min-w-0 flex-1',\n },\n icon: {\n base: 'size-icon shrink-0 fill-current text-icon',\n },\n content: {\n base: 'overflow-hidden text-sm text-surface-ink-muted',\n },\n contentInner: {\n base: 'min-w-0 px-3 pb-3 pt-1',\n },\n },\n}});\n\nexport {accordionStyles};\n","import type Alpine from 'alpinejs';\n\nimport {\n attribute,\n bool,\n type AlpineMachine,\n createAlpineMachine,\n type BindingObject,\n createCollectionNavigation,\n type CollectionNavigation,\n defineAlpineData,\n mergeBindings,\n type MachineSnapshot,\n observeSemanticChanges,\n reflectSchemaProp,\n resolveStyle,\n type TransitionForHook,\n type TrellisAlpineComponent,\n} from '@client/runtime';\nimport {asBool, dispatch, isRtl} from '@client/utils';\nimport {accordionSchema, type AccordionMode, type AccordionProps} from './contract';\nimport {\n accordionHooks,\n createAccordionMachine,\n type AccordionContext,\n type AccordionMachineProps,\n type AccordionTransitionData,\n} from './machine';\nimport {accordionStyles} from './styles';\n\ntype AccordionTransitionName = (typeof accordionHooks)[number]['name'];\ntype AccordionTransition<TName extends AccordionTransitionName = AccordionTransitionName> = TransitionForHook<\n Extract<(typeof accordionHooks)[number], {name: TName}>,\n HTMLElement\n>;\n\ntype AccordionItemRecord = {\n item: HTMLElement;\n heading: HTMLElement | null;\n trigger: HTMLButtonElement;\n content: HTMLElement;\n value: string;\n disabled: boolean;\n};\n\n/**\n * Public Alpine API for `ui.accordion`.\n *\n * @public\n */\ninterface UiAccordionApi {\n /** Open value in single mode, otherwise an empty string. */\n readonly value: string;\n\n /** Open values in document order. */\n readonly values: readonly string[];\n\n /** Opens an enabled item. In single mode it replaces the current value. */\n open(value: string): void;\n\n /** Closes an item when the current mode permits it. */\n close(value: string): void;\n\n /** Reverses an item's current disclosure state. */\n toggle(value: string, event?: Event): void;\n\n /** Whether an item belongs to the current open-value set. */\n isOpen(value: string): boolean;\n}\n\ntype AccordionData = AlpineMachine<AccordionContext, AccordionMachineProps, typeof accordionHooks> & UiAccordionApi & {\n readonly root: BindingObject;\n init(): void;\n destroy(): void;\n};\n\nconst accordionRuntimeSchema = {\n ...accordionSchema,\n selectionControlled: attribute(bool, 'ui-accordion-controlled'),\n};\n\nconst splitValues = (value: string): string[] => value.split(',').map((item) => item.trim()).filter(Boolean);\nconst stateFor = (open: boolean): 'open' | 'closed' => open ? 'open' : 'closed';\nconst safeIdPart = (value: string): string => value.trim().replace(/[^a-zA-Z0-9_-]+/g, '-') || 'item';\n\nconst UiAccordion = (): TrellisAlpineComponent<AccordionData> => {\n let rootEl: (HTMLElement & Alpine.ElementWithXAttributes) | null = null;\n let collection: CollectionNavigation | null = null;\n let disconnectObserver: (() => void) | null = null;\n let idFor = (key: string): string => key;\n\n const root = (): HTMLElement & Alpine.ElementWithXAttributes => {\n if (!rootEl) throw new Error('Accordion has not been initialized.');\n return rootEl;\n };\n\n const owns = (element: Element): boolean => element.closest('[data-ui-accordion]') === root();\n\n const items = (): AccordionItemRecord[] => Array.from(\n root().querySelectorAll<HTMLElement>('[data-ui-accordion-item]'),\n ).filter(owns).map((item, index) => {\n const trigger = item.querySelector<HTMLElement>('[data-ui-accordion-trigger]');\n const content = item.querySelector<HTMLElement>('[data-ui-accordion-content]');\n if (!(trigger instanceof HTMLButtonElement) || !content || !owns(trigger) || !owns(content)) return null;\n item.dataset.value ||= `item-${index + 1}`;\n return {\n item,\n heading: item.querySelector<HTMLElement>('[data-ui-accordion-heading]'),\n trigger,\n content,\n value: item.dataset.value,\n disabled: asBool({value: item.dataset.itemDisabled}),\n } satisfies AccordionItemRecord;\n }).filter((item): item is AccordionItemRecord => item !== null);\n\n const itemForValue = (value: string): AccordionItemRecord | null => (\n items().find((item) => item.value === value) ?? null\n );\n\n const itemFrom = (target: EventTarget | null): AccordionItemRecord | null => {\n if (!(target instanceof Element)) return null;\n const itemEl = target.closest<HTMLElement>('[data-ui-accordion-item]');\n return itemEl && owns(itemEl) ? items().find((item) => item.item === itemEl) ?? null : null;\n };\n\n const collectionContext = (): AccordionContext['collection'] => {\n const records = items();\n return {\n values: records.map((item) => item.value),\n disabledValues: records.filter((item) => item.disabled).map((item) => item.value),\n };\n };\n\n const normalize = (\n values: readonly string[],\n props: AccordionProps,\n itemValues: readonly string[],\n ): string[] => {\n const requested = new Set(values);\n const ordered = itemValues.filter((value) => requested.has(value));\n return props.mode === 'single' ? ordered.slice(0, 1) : ordered;\n };\n\n const initialContext = (props: AccordionMachineProps): AccordionContext => {\n const collectionState = collectionContext();\n const controlled = props.mode === 'multiple'\n ? splitValues(props.values || props.value)\n : props.value ? [props.value] : [];\n const defaults = props.mode === 'multiple'\n ? splitValues(props.defaultValues)\n : props.defaultValue ? [props.defaultValue] : [];\n const authored = items().filter((item) => asBool({value: item.item.dataset.open})).map((item) => item.value);\n const requested = props.selectionControlled\n ? controlled\n : defaults.length > 0 ? defaults : authored;\n return {\n selection: {values: normalize(requested, props, collectionState.values)},\n change: {openingValues: [], closingValues: []},\n collection: collectionState,\n };\n };\n\n const currentProps = (): Readonly<AccordionMachineProps> => bridge.getCommittedSnapshot().props;\n const currentContext = (): Readonly<AccordionContext> => bridge.getCommittedSnapshot().context;\n\n const itemIsOpen = (item: AccordionItemRecord): boolean => currentContext().selection.values.includes(item.value);\n const itemIsDisabled = (item: AccordionItemRecord): boolean => currentProps().disabled || item.disabled;\n const canCollapse = (item: AccordionItemRecord): boolean => (\n currentProps().mode === 'multiple' || currentProps().collapsible || !itemIsOpen(item)\n );\n\n const syncRoot = (): void => {\n const props = currentProps();\n const values = currentContext().selection.values;\n reflectSchemaProp({\n el: root(),\n schema: accordionSchema,\n key: 'value',\n value: props.mode === 'single' ? values[0] ?? '' : '',\n });\n reflectSchemaProp({\n el: root(),\n schema: accordionSchema,\n key: 'values',\n value: props.mode === 'multiple' ? values.join(',') : '',\n });\n root().dataset.orientation = props.orientation;\n root().dataset.iconPosition = props.iconPosition;\n root().dataset.mode = props.mode;\n if (props.disabled) root().setAttribute('data-disabled', '');\n else root().removeAttribute('data-disabled');\n };\n\n let component!: TrellisAlpineComponent<AccordionData>;\n\n const syncItem = (item: AccordionItemRecord): void => {\n const props = currentProps();\n const open = itemIsOpen(item);\n const state = stateFor(open);\n const disabled = itemIsDisabled(item);\n const closing = bridge.hasTag('changing') && currentContext().change.closingValues.includes(item.value);\n\n item.item.dataset.state = state;\n item.item.dataset.orientation = props.orientation;\n item.item.className = resolveStyle({\n part: accordionStyles.parts.item,\n props,\n className: item.item.dataset.class ?? '',\n });\n item.heading?.setAttribute('data-state', state);\n item.heading?.setAttribute('data-orientation', props.orientation);\n\n const idPart = safeIdPart(item.value);\n item.trigger.id ||= idFor(`accordion-trigger-${idPart}`);\n item.content.id ||= idFor(`accordion-content-${idPart}`);\n item.trigger.type = 'button';\n item.trigger.dataset.state = state;\n item.trigger.dataset.orientation = props.orientation;\n item.trigger.className = resolveStyle({\n part: accordionStyles.parts.trigger,\n props,\n className: item.trigger.dataset.class ?? '',\n });\n item.trigger.setAttribute('aria-expanded', open ? 'true' : 'false');\n item.trigger.setAttribute('aria-controls', item.content.id);\n item.content.dataset.state = state;\n item.content.dataset.orientation = props.orientation;\n item.content.setAttribute('aria-labelledby', item.trigger.id);\n item.content.hidden = !open && !closing;\n\n [item.item, item.heading, item.trigger, item.content].forEach((element) => {\n if (!element) return;\n if (disabled) element.setAttribute('data-disabled', '');\n else element.removeAttribute('data-disabled');\n });\n item.trigger.disabled = disabled;\n if (disabled || (open && !canCollapse(item))) item.trigger.setAttribute('aria-disabled', 'true');\n else item.trigger.removeAttribute('aria-disabled');\n };\n\n const syncAll = (): void => {\n syncRoot();\n items().forEach(syncItem);\n };\n\n const emitChange = (): void => {\n const values = [...currentContext().selection.values];\n dispatch({el: root(), name: 'ui:change', detail: {\n value: currentProps().mode === 'single' ? values[0] ?? '' : '',\n values,\n }});\n };\n\n const bridge = createAlpineMachine({\n schema: accordionRuntimeSchema,\n hooks: accordionHooks,\n resolveTransitionElement: ({data}) => {\n const value = (data as AccordionTransitionData).value;\n return itemForValue(value)?.content ?? null;\n },\n createMachine: ({props}) => createAccordionMachine({\n props,\n context: initialContext(props),\n effects: {\n prepareChange: () => {\n syncAll();\n emitChange();\n },\n finishChange: () => {\n syncAll();\n },\n syncDom: syncAll,\n syncProps: syncAll,\n syncItems: syncAll,\n },\n }),\n });\n\n const collectionNav = (): CollectionNavigation => {\n if (!collection) throw new Error('Accordion navigation has not been initialized.');\n return collection;\n };\n\n const sendItemsChanged = (): void => {\n const next = collectionContext();\n bridge.send({type: 'ITEMS_CHANGED', ...next});\n };\n\n const handleToggle = (item: AccordionItemRecord, event?: Event): void => {\n event?.preventDefault();\n if (itemIsDisabled(item)) return;\n bridge.send({type: 'TOGGLE', value: item.value, motion: !(event instanceof KeyboardEvent)});\n };\n\n const handleClick = (event: Event): void => {\n const item = itemFrom(event.target);\n if (!item || !(event.target instanceof Node) || !item.trigger.contains(event.target)) return;\n handleToggle(item, event);\n };\n\n const handleKeydown = (event: KeyboardEvent): void => {\n const item = itemFrom(event.target);\n if (!item || event.target !== item.trigger) return;\n if (event.key === 'Enter' || event.key === ' ') {\n handleToggle(item, event);\n return;\n }\n if (event.key === 'Home') {\n event.preventDefault();\n collectionNav().focusFirst();\n return;\n }\n if (event.key === 'End') {\n event.preventDefault();\n collectionNav().focusLast();\n return;\n }\n if (currentProps().orientation === 'vertical') {\n if (event.key === 'ArrowDown') {\n event.preventDefault();\n collectionNav().focusNext();\n } else if (event.key === 'ArrowUp') {\n event.preventDefault();\n collectionNav().focusPrevious();\n }\n return;\n }\n if (event.key === 'ArrowRight') {\n event.preventDefault();\n if (isRtl({el: root()})) collectionNav().focusPrevious();\n else collectionNav().focusNext();\n } else if (event.key === 'ArrowLeft') {\n event.preventDefault();\n if (isRtl({el: root()})) collectionNav().focusNext();\n else collectionNav().focusPrevious();\n }\n };\n\n const handleFocus = (event: Event): void => {\n const item = itemFrom(event.target);\n if (item && event.target === item.trigger && !itemIsDisabled(item)) {\n collectionNav().activateItem({el: item.trigger});\n }\n };\n\n const setupObserver = (): void => {\n disconnectObserver = observeSemanticChanges({\n targets: root(),\n read: collectionContext,\n onChange: sendItemsChanged,\n observer: {\n childList: true,\n subtree: true,\n attributes: true,\n attributeFilter: ['data-value', 'data-item-disabled'],\n },\n });\n };\n\n component = {\n ...bridge,\n get value(): string {\n return currentProps().mode === 'single' ? this.snapshot.current?.context.selection.values[0] ?? '' : '';\n },\n get values(): readonly string[] {\n return [...this.snapshot.current?.context.selection.values ?? []];\n },\n init(): void {\n rootEl = this.$el;\n idFor = this.$id.bind(this);\n bridge.connect(this.$el, this.snapshot);\n collection = createCollectionNavigation({\n root,\n itemSelector: '[data-ui-accordion-trigger]',\n isDisabled: (el) => el.hasAttribute('disabled'),\n loop: () => currentProps().loop,\n });\n syncAll();\n setupObserver();\n },\n destroy(): void {\n disconnectObserver?.();\n disconnectObserver = null;\n bridge.disconnect();\n collection = null;\n rootEl = null;\n },\n get root(): BindingObject {\n const props = this.snapshot.current?.props ?? currentProps();\n return mergeBindings({inputs: [\n resolveStyle({part: accordionStyles.parts.root, props, className: props.class}),\n {\n 'data-ui-accordion': '',\n ':data-orientation': () => currentProps().orientation,\n ':data-disabled': () => currentProps().disabled ? '' : undefined,\n '@click': handleClick,\n '@keydown': (event: Event) => {\n if (event instanceof KeyboardEvent) handleKeydown(event);\n },\n '@focusin': handleFocus,\n },\n ]});\n },\n open(value: string): void {\n bridge.send({type: 'OPEN', value});\n },\n close(value: string): void {\n bridge.send({type: 'CLOSE', value});\n },\n toggle(value: string, event?: Event): void {\n const item = itemForValue(value);\n if (item) handleToggle(item, event);\n },\n isOpen(value: string): boolean {\n return this.snapshot.current?.context.selection.values.includes(value) ?? false;\n },\n };\n\n return component;\n};\n\nconst registerAccordion = defineAlpineData('UiAccordion', UiAccordion);\n\nexport {registerAccordion, UiAccordion};\nexport type {AccordionData, AccordionMode, AccordionTransition, UiAccordionApi};\n","// Generated by scripts/generate_component_entries.mjs from packages/client/component-entries.json.\n// Do not edit by hand.\nimport type {Alpine as AlpineType} from 'alpinejs';\nimport {registerMotionCapability} from '../../capabilities/motion';\nimport {registerAccordion as registerComponent} from './index';\n\nconst registered = new WeakSet<AlpineType>();\n\nconst registerAccordion = (AlpineInstance: AlpineType): void => {\n if (registered.has(AlpineInstance)) return;\n registered.add(AlpineInstance);\n registerMotionCapability(AlpineInstance);\n registerComponent(AlpineInstance);\n};\n\nexport {registerAccordion};\nexport default registerAccordion;\nexport * from './index';\n"],"mappings":"gnBAGA,IAAM,EAAkB,CAAC,SAAU,UAAU,EACvC,EAAyB,EACzB,EAA2B,CAAC,WA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,CACvC,IAAM,EAAO,EAAa,CAAK,EAC3B,GAAM,EAAa,EAAM,CAAK,CACtC,EACA,OAAO,EAAwB,CAC3B,OAAO,KAAK,SAAS,SAAS,QAAQ,UAAU,OAAO,SAAS,CAAK,GAAK,EAC9E,CACJ,EAEO,CACX,EAEM,EAAoB,EAAiB,cAAe,CAAW,EC/Z/D,EAAa,IAAI,QAEjB,EAAqB,GAAqC,CACxD,EAAW,IAAI,CAAc,IACjC,EAAW,IAAI,CAAc,EAC7B,EAAyB,CAAc,EACvC,EAAkB,CAAc,EACpC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{b as e,c as t,d as n,f as r,l as i,m as a,p as o,u as s,v as c,x as l,y as u}from"./motion-
|
|
2
|
-
//# sourceMappingURL=flip-
|
|
1
|
+
import{b as e,c as t,d as n,f as r,l as i,m as a,p as o,u as s,v as c,x as l,y as u}from"./motion-B90yNOaV.js";var d=(e,t)=>Math.abs(e.left-t.left)>=.5||Math.abs(e.top-t.top)>=.5||Math.abs(e.width-t.width)>=.5||Math.abs(e.height-t.height)>=.5,f=(e,t)=>{let n=Array.isArray(t)?t:[t];return Array.from(new Set(n.map(t=>i(e,t)))).map(e=>{if(!(e instanceof HTMLElement))throw TypeError(`FLIP motion requires an HTMLElement target.`);return e})},p=(i,p)=>{let m=f(i,p.target),h=p.signal??t(i);m.forEach(e=>n(e));let g=m.map(e=>e.getBoundingClientRect()),_=m.map(e=>({transform:e.style.transform,transformOrigin:e.style.transformOrigin,willChange:e.style.willChange}));p.update();let v=m.map(e=>e.getBoundingClientRect());if(h?.aborted||u())return r();let y=p.role??`layout`,b=[];return m.forEach((t,n)=>{let r=g[n],i=v[n],o=_[n];if(!d(r,i)||i.width===0||i.height===0)return;let u=`translate(${r.left-i.left}px, ${r.top-i.top}px) scale(${r.width/i.width}, ${r.height/i.height})`,f=o.transform||`none`;t.style.transformOrigin=`top left`,t.style.willChange=`transform`,b.push(s(t,()=>a(t,{transform:[u,f]},{...l(t,y),...e(y,t)?{type:c}:{type:`tween`},...p.transition}),new Set([`transform`]),h,()=>{t.style.transform=o.transform,t.style.transformOrigin=o.transformOrigin,t.style.willChange=o.willChange}))}),o(...b)};export{p as t};
|
|
2
|
+
//# sourceMappingURL=flip-crNQSZEa.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flip-
|
|
1
|
+
{"version":3,"file":"flip-crNQSZEa.js","names":[],"sources":["../../../../../../../../client/src/motion/flip.ts"],"sourcesContent":["import {spring} from 'motion';\nimport {animate} from 'motion/mini';\nimport {noopHandle, parallel, type MotionHandle} from './animate';\nimport {ownMotion, stopOwnedMotion} from './owned';\nimport {isSpringRole, resolveMiniMotionRole, type MotionRoleName, type MotionTransition} from './recipe';\nimport {shouldReduceMotion} from './reduced-motion';\nimport {motionSignal, resolveMotionTarget, type MotionSubject} from './subject';\n\ntype FlipOptions = Readonly<{\n target?: Element | string | readonly (Element | string)[];\n update(): void;\n role?: MotionRoleName;\n transition?: MotionTransition;\n signal?: AbortSignal | null;\n}>;\n\nconst changed = (from: DOMRect, to: DOMRect): boolean => (\n Math.abs(from.left - to.left) >= 0.5\n || Math.abs(from.top - to.top) >= 0.5\n || Math.abs(from.width - to.width) >= 0.5\n || Math.abs(from.height - to.height) >= 0.5\n);\n\nconst resolveTargets = (subject: MotionSubject, requested?: FlipOptions['target']): HTMLElement[] => {\n const targets = Array.isArray(requested) ? requested : [requested];\n return Array.from(new Set(targets.map((target) => resolveMotionTarget(subject, target))))\n .map((target) => {\n if (!(target instanceof HTMLElement)) throw new TypeError('FLIP motion requires an HTMLElement target.');\n return target;\n });\n};\n\n/** Commit final geometry once, then animate every visual from its inverse frame using transform only. */\nconst flip = (subject: MotionSubject, options: FlipOptions): MotionHandle => {\n const targets = resolveTargets(subject, options.target);\n const signal = options.signal ?? motionSignal(subject);\n targets.forEach((target) => stopOwnedMotion(target));\n const from = targets.map((target) => target.getBoundingClientRect());\n const baselines = targets.map((target) => ({\n transform: target.style.transform,\n transformOrigin: target.style.transformOrigin,\n willChange: target.style.willChange,\n }));\n options.update();\n const to = targets.map((target) => target.getBoundingClientRect());\n if (signal?.aborted || shouldReduceMotion()) return noopHandle();\n const role = options.role ?? 'layout';\n const handles: MotionHandle[] = [];\n targets.forEach((target, index) => {\n const start = from[index]!;\n const end = to[index]!;\n const baseline = baselines[index]!;\n if (!changed(start, end) || end.width === 0 || end.height === 0) return;\n const inverse = `translate(${start.left - end.left}px, ${start.top - end.top}px) scale(${start.width / end.width}, ${start.height / end.height})`;\n const destination = baseline.transform || 'none';\n target.style.transformOrigin = 'top left';\n target.style.willChange = 'transform';\n handles.push(ownMotion(target, () => animate(target, {\n transform: [inverse, destination],\n }, {\n ...resolveMiniMotionRole(target, role),\n ...(isSpringRole(role, target) ? {type: spring} : {type: 'tween' as const}),\n ...options.transition,\n }), new Set(['transform']), signal, () => {\n target.style.transform = baseline.transform;\n target.style.transformOrigin = baseline.transformOrigin;\n target.style.willChange = baseline.willChange;\n }));\n });\n return parallel(...handles);\n};\n\nexport {flip};\nexport type {FlipOptions};\n"],"mappings":"+GAgBA,IAAM,GAAW,EAAe,IAC5B,KAAK,IAAI,EAAK,KAAO,EAAG,IAAI,GAAK,IAC9B,KAAK,IAAI,EAAK,IAAM,EAAG,GAAG,GAAK,IAC/B,KAAK,IAAI,EAAK,MAAQ,EAAG,KAAK,GAAK,IACnC,KAAK,IAAI,EAAK,OAAS,EAAG,MAAM,GAAK,GAGtC,GAAkB,EAAwB,IAAqD,CACjG,IAAM,EAAU,MAAM,QAAQ,CAAS,EAAI,EAAY,CAAC,CAAS,EACjE,OAAO,MAAM,KAAK,IAAI,IAAI,EAAQ,IAAK,GAAW,EAAoB,EAAS,CAAM,CAAC,CAAC,CAAC,CAAC,CACpF,IAAK,GAAW,CACb,GAAI,EAAE,aAAkB,aAAc,MAAU,UAAU,6CAA6C,EACvG,OAAO,CACX,CAAC,CACT,EAGM,GAAQ,EAAwB,IAAuC,CACzE,IAAM,EAA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EAAS,UACvC,CAAC,CAAC,CACN,CAAC,EACM,EAAS,GAAG,CAAO,CAC9B"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import{f as e,p as t}from"./ui-CTQoglp3.js";var n=Object.freeze({fast:Object.freeze({duration:.08}),moderate:Object.freeze({duration:.16}),slow:Object.freeze({duration:.24})}),r={out:[.23,1,.32,1],inOut:[.77,0,.175,1]},i=Object.freeze({feedback:Object.freeze({duration:n.fast.duration,ease:r.out}),presence:Object.freeze({duration:n.moderate.duration,ease:r.out}),presenceEmphasized:Object.freeze({duration:n.slow.duration,ease:r.out}),layout:Object.freeze({duration:n.moderate.duration,ease:r.inOut}),layoutQuick:Object.freeze({duration:n.fast.duration,ease:r.inOut}),layoutSpring:Object.freeze({visualDuration:n.moderate.duration,bounce:0}),resize:Object.freeze({visualDuration:n.moderate.duration,bounce:0}),gestureExit:Object.freeze({duration:n.moderate.duration,ease:r.out}),gestureSettle:Object.freeze({visualDuration:n.slow.duration,bounce:0})}),a=new Set([`layoutSpring`,`resize`,`gestureSettle`]),o=new Set([`feedback`,`presence`,`presenceEmphasized`,`layout`,`layoutQuick`,`layoutSpring`,`resize`,`gestureSettle`]),s={feedback:`feedback`,presence:`presence`,presenceEmphasized:`presence-emphasized`,layout:`layout`,layoutQuick:`layout-quick`,layoutSpring:`layout-spring`,resize:`resize`,gestureExit:`gesture-exit`,gestureSettle:`gesture-settle`},c={feedback:`fast`,presence:`moderate`,presenceEmphasized:`slow`,layout:`moderate`,layoutQuick:`fast`,layoutSpring:`moderate`,resize:`moderate`,gestureExit:`moderate`,gestureSettle:`slow`},l=(e,t)=>{let n=Number.parseFloat(e.getPropertyValue(t));return Number.isFinite(n)?n:void 0},u=(e,t)=>{let n=e.getPropertyValue(t).trim().toLowerCase(),r=Number.parseFloat(n);if(Number.isFinite(r))return n.endsWith(`ms`)?r:n.endsWith(`s`)?r*1e3:r},d=(e,t)=>{let n=getComputedStyle(e),r=u(n,`--motion-duration-${c[t]}`),d=l(n,`--motion-bounce-${s[t]}`),f=i[t];return a.has(t)||o.has(t)&&(d??0)>0?{visualDuration:r===void 0?`visualDuration`in f?f.visualDuration:f.duration:r/1e3,bounce:d??(`bounce`in f?f.bounce:0)}:{duration:r===void 0?`duration`in f?f.duration:f.visualDuration:r/1e3,...`ease`in f?{ease:f.ease}:{}}},f=(e,t)=>a.has(e)||t!==void 0&&o.has(e)&&(l(getComputedStyle(t),`--motion-bounce-${s[e]}`)??0)>0,p=(e,t)=>d(e,t),m=Object.freeze({opacity:Object.freeze({in:Object.freeze({opacity:Object.freeze([0,1])}),out:Object.freeze({opacity:Object.freeze([1,0])})}),popover:Object.freeze({in:Object.freeze({opacity:Object.freeze([0,1]),scale:Object.freeze([.97,1])}),out:Object.freeze({opacity:Object.freeze([1,0]),scale:Object.freeze([1,.97])})}),modal:Object.freeze({in:Object.freeze({opacity:Object.freeze([0,1]),y:Object.freeze([`calc(8px * var(--motion-displacement-scale, 1))`,`0px`]),scale:Object.freeze([.98,1])}),out:Object.freeze({opacity:Object.freeze([1,0]),y:Object.freeze([`0px`,`calc(8px * var(--motion-displacement-scale, 1))`]),scale:Object.freeze([1,.98])})}),toast:Object.freeze({in:Object.freeze({opacity:Object.freeze([0,1]),transform:Object.freeze([`translateY(calc(var(--ui-toast-stack-offset, 0px) + var(--ui-toast-outside, -100%))) scale(var(--ui-toast-stack-scale, 1))`,`translateY(var(--ui-toast-stack-offset, 0px)) scale(var(--ui-toast-stack-scale, 1))`])}),out:Object.freeze({opacity:0,transform:`translateY(calc(var(--ui-toast-stack-offset, 0px) + var(--ui-toast-outside, -100%))) scale(var(--ui-toast-stack-scale, 1))`})}),sheet:Object.freeze({left:Object.freeze({in:Object.freeze({opacity:Object.freeze([0,1]),transform:Object.freeze([`translateX(-100%)`,`none`])}),out:Object.freeze({opacity:0,transform:`translateX(-100%)`})}),right:Object.freeze({in:Object.freeze({opacity:Object.freeze([0,1]),transform:Object.freeze([`translateX(100%)`,`none`])}),out:Object.freeze({opacity:0,transform:`translateX(100%)`})}),top:Object.freeze({in:Object.freeze({opacity:Object.freeze([0,1]),transform:Object.freeze([`translateY(-100%)`,`none`])}),out:Object.freeze({opacity:0,transform:`translateY(-100%)`})}),bottom:Object.freeze({in:Object.freeze({opacity:Object.freeze([0,1]),transform:Object.freeze([`translateY(100%)`,`none`])}),out:Object.freeze({opacity:0,transform:`translateY(100%)`})})})}),h=(e=`moderate`,t)=>{if(typeof e!=`string`)return e;if(t===void 0)return n[e];let r=u(getComputedStyle(t),`--motion-duration-${e}`);return r===void 0?n[e]:{duration:r/1e3}},g=e=>Array.isArray(e)?e[e.length-1]:e,_=`(prefers-reduced-motion: reduce)`,v=()=>typeof window>`u`||typeof window.matchMedia!=`function`?!1:window.matchMedia(_).matches,y=(e=`user`)=>e===`always`||e!==`never`&&v(),b=(e,t={},n=`user`)=>y(n)?{...e,duration:0,...t}:e;function x(e,t){e.indexOf(t)===-1&&e.push(t)}function S(e,t){let n=e.indexOf(t);n>-1&&e.splice(n,1)}var C=(e,t,n)=>n>t?t:n<e?e:n;function w(e,t){return t?`${e}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${t}`:e}var T={},ee=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),te=e=>typeof e==`object`&&!!e,ne=e=>/^0[^.\s]+$/u.test(e);function re(e){let t;return()=>(t===void 0&&(t=e()),t)}var E=e=>e,D=(...e)=>e.reduce((e,t)=>n=>t(e(n))),ie=(e,t,n)=>{let r=t-e;return r?(n-e)/r:1},ae=class{constructor(){this.subscriptions=[]}add(e){return x(this.subscriptions,e),()=>S(this.subscriptions,e)}notify(e,t,n){let r=this.subscriptions.length;if(r){if(r===1)this.subscriptions[0](e,t,n);else for(let i=0;i<r;i++){let r=this.subscriptions[i];r&&r(e,t,n)}}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}},O=e=>e*1e3,k=e=>e/1e3,oe=(e,t)=>t?1e3/t*e:0,se=new Set;function ce(e,t,n){e||se.has(t)||(console.warn(w(t,n)),se.add(t))}var le=(e,t,n)=>{let r=t-e;return((n-e)%r+r)%r+e},ue=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,de=1e-7,fe=12;function pe(e,t,n,r,i){let a,o,s=0;do o=t+(n-t)/2,a=ue(o,r,i)-e,a>0?n=o:t=o;while(Math.abs(a)>de&&++s<fe);return o}function me(e,t,n,r){if(e===t&&n===r)return E;let i=t=>pe(t,0,1,e,n);return e=>e===0||e===1?e:ue(i(e),t,r)}var he=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,ge=e=>t=>1-e(1-t),_e=me(.33,1.53,.69,.99),ve=ge(_e),ye=he(ve),be=e=>e>=1?1:(e*=2)<1?.5*ve(e):.5*(2-2**(-10*(e-1))),xe=e=>1-Math.sin(Math.acos(e)),Se=ge(xe),Ce=he(xe),we=me(.42,0,1,1),Te=me(0,0,.58,1),Ee=me(.42,0,.58,1),De=e=>Array.isArray(e)&&typeof e[0]!=`number`;function Oe(e,t){return De(e)?e[le(0,e.length,t)]:e}var ke=e=>Array.isArray(e)&&typeof e[0]==`number`,Ae={linear:E,easeIn:we,easeInOut:Ee,easeOut:Te,circIn:xe,circInOut:Ce,circOut:Se,backIn:ve,backInOut:ye,backOut:_e,anticipate:be},je=e=>typeof e==`string`,Me=e=>{if(ke(e)){e.length;let[t,n,r,i]=e;return me(t,n,r,i)}return je(e)?(Ae[e],`${e}`,Ae[e]):e},Ne=[`setup`,`read`,`resolveKeyframes`,`preUpdate`,`update`,`preRender`,`render`,`postRender`];function Pe(e){let t=new Set,n=new Set,r=!1,i=!1,a=new WeakSet,o={delta:0,timestamp:0,isProcessing:!1};function s(t){a.has(t)&&(c.schedule(t),e()),t(o)}let c={schedule:(e,i=!1,o=!1)=>{let s=o&&r?t:n;return i&&a.add(e),s.add(e),e},cancel:e=>{n.delete(e),a.delete(e)},process:e=>{if(o=e,r){i=!0;return}r=!0;let a=t;t=n,n=a,t.forEach(s),t.clear(),r=!1,i&&(i=!1,c.process(e))}};return c}var Fe=40;function Ie(e,t){let n=!1,r=!0,i={delta:0,timestamp:0,isProcessing:!1},a=()=>n=!0,o=Ne.reduce((e,t)=>(e[t]=Pe(a),e),{}),{setup:s,read:c,resolveKeyframes:l,preUpdate:u,update:d,preRender:f,render:p,postRender:m}=o,h=()=>{let a=T.useManualTiming,o=a?i.timestamp:performance.now();n=!1,a||(i.delta=r?1e3/60:Math.max(Math.min(o-i.timestamp,Fe),1)),i.timestamp=o,i.isProcessing=!0,s.process(i),c.process(i),l.process(i),u.process(i),d.process(i),f.process(i),p.process(i),m.process(i),i.isProcessing=!1,n&&t&&(r=!1,e(h))},g=()=>{n=!0,r=!0,i.isProcessing||e(h)};return{schedule:Ne.reduce((e,t)=>{let r=o[t];return e[t]=(e,t=!1,i=!1)=>(n||g(),r.schedule(e,t,i)),e},{}),cancel:e=>{for(let t=0;t<Ne.length;t++)o[Ne[t]].cancel(e)},state:i,steps:o}}var{schedule:A,cancel:Le,state:Re,steps:ze}=Ie(typeof requestAnimationFrame<`u`?requestAnimationFrame:E,!0),Be;function Ve(){Be=void 0}var j={now:()=>(Be===void 0&&j.set(Re.isProcessing||T.useManualTiming?Re.timestamp:performance.now()),Be),set:e=>{Be=e,queueMicrotask(Ve)}},He=e=>t=>typeof t==`string`&&t.startsWith(e),Ue=He(`--`),We=He(`var(--`),Ge=e=>We(e)?Ke.test(e.split(`/*`)[0].trim()):!1,Ke=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function qe(e){return typeof e==`string`&&e.split(`/*`)[0].includes(`var(--`)}var M={test:e=>typeof e==`number`,parse:parseFloat,transform:e=>e},Je={...M,transform:e=>C(0,1,e)},Ye={...M,default:1},Xe=e=>Math.round(e*1e5)/1e5,Ze=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function Qe(e){return e==null}var $e=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,et=(e,t)=>n=>!!(typeof n==`string`&&$e.test(n)&&n.startsWith(e)||t&&!Qe(n)&&Object.prototype.hasOwnProperty.call(n,t)),tt=(e,t,n)=>r=>{if(typeof r!=`string`)return r;let[i,a,o,s]=r.match(Ze);return{[e]:parseFloat(i),[t]:parseFloat(a),[n]:parseFloat(o),alpha:s===void 0?1:parseFloat(s)}},nt=e=>C(0,255,e),rt={...M,transform:e=>Math.round(nt(e))},N={test:et(`rgb`,`red`),parse:tt(`red`,`green`,`blue`),transform:({red:e,green:t,blue:n,alpha:r=1})=>`rgba(`+rt.transform(e)+`, `+rt.transform(t)+`, `+rt.transform(n)+`, `+Xe(Je.transform(r))+`)`};function it(e){let t=``,n=``,r=``,i=``;return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),i=e.substring(4,5),t+=t,n+=n,r+=r,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}}var at={test:et(`#`),parse:it,transform:N.transform},ot=e=>({test:t=>typeof t==`string`&&t.endsWith(e)&&t.split(` `).length===1,parse:parseFloat,transform:t=>`${t}${e}`}),P=ot(`deg`),st=ot(`%`),F=ot(`px`),ct=ot(`vh`),lt=ot(`vw`),ut={...st,parse:e=>st.parse(e)/100,transform:e=>st.transform(e*100)},I={test:et(`hsl`,`hue`),parse:tt(`hue`,`saturation`,`lightness`),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>`hsla(`+Math.round(e)+`, `+st.transform(Xe(t))+`, `+st.transform(Xe(n))+`, `+Xe(Je.transform(r))+`)`},L={test:e=>N.test(e)||at.test(e)||I.test(e),parse:e=>N.test(e)?N.parse(e):I.test(e)?I.parse(e):at.parse(e),transform:e=>typeof e==`string`?e:e.hasOwnProperty(`red`)?N.transform(e):I.transform(e),getAnimatableNone:e=>{let t=L.parse(e);return t.alpha=0,L.transform(t)}},dt=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function ft(e){return isNaN(e)&&typeof e==`string`&&(e.match(Ze)?.length||0)+(e.match(dt)?.length||0)>0}var pt=`number`,mt=`color`,ht=`var`,gt=`var(`,_t="${}",vt=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function R(e){let t=e.toString(),n=[],r={color:[],number:[],var:[]},i=[],a=0;return{values:n,split:t.replace(vt,e=>(L.test(e)?(r.color.push(a),i.push(mt),n.push(L.parse(e))):e.startsWith(gt)?(r.var.push(a),i.push(ht),n.push(e)):(r.number.push(a),i.push(pt),n.push(parseFloat(e))),++a,_t)).split(_t),indexes:r,types:i}}function yt(e){return R(e).values}function bt({split:e,types:t}){let n=e.length;return r=>{let i=``;for(let a=0;a<n;a++)if(i+=e[a],r[a]!==void 0){let e=t[a];i+=e===pt?Xe(r[a]):e===mt?L.transform(r[a]):r[a]}return i}}function xt(e){return bt(R(e))}var St=e=>typeof e==`number`?0:L.test(e)?L.getAnimatableNone(e):e,Ct=(e,t)=>typeof e==`number`?t?.trim().endsWith(`/`)?e:0:St(e);function wt(e){let t=R(e);return bt(t)(t.values.map((e,n)=>Ct(e,t.split[n])))}var z={test:ft,parse:yt,createTransformer:xt,getAnimatableNone:wt};function Tt(e,t,n){return n<0&&(n+=1),n>1&&--n,n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function Et({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let i=0,a=0,o=0;if(!t)i=a=o=n;else{let r=n<.5?n*(1+t):n+t-n*t,s=2*n-r;i=Tt(s,r,e+1/3),a=Tt(s,r,e),o=Tt(s,r,e-1/3)}return{red:Math.round(i*255),green:Math.round(a*255),blue:Math.round(o*255),alpha:r}}function Dt(e,t){return n=>n>0?t:e}var Ot=(e,t,n)=>e+(t-e)*n,kt=(e,t,n)=>{let r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},At=[at,N,I],jt=e=>At.find(t=>t.test(e));function Mt(e){let t=jt(e);if(`${e}`,!t)return!1;let n=t.parse(e);return t===I&&(n=Et(n)),n}var Nt=(e,t)=>{let n=Mt(e),r=Mt(t);if(!n||!r)return Dt(e,t);let i={...n};return e=>(i.red=kt(n.red,r.red,e),i.green=kt(n.green,r.green,e),i.blue=kt(n.blue,r.blue,e),i.alpha=Ot(n.alpha,r.alpha,e),N.transform(i))},Pt=new Set([`none`,`hidden`]);function Ft(e,t){return Pt.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function It(e,t){return n=>Ot(e,t,n)}function Lt(e){return typeof e==`number`?It:typeof e==`string`?Ge(e)?Dt:L.test(e)?Nt:Vt:Array.isArray(e)?Rt:typeof e==`object`?L.test(e)?Nt:zt:Dt}function Rt(e,t){let n=[...e],r=n.length,i=e.map((e,n)=>Lt(e)(e,t[n]));return e=>{for(let t=0;t<r;t++)n[t]=i[t](e);return n}}function zt(e,t){let n={...e,...t},r={};for(let i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=Lt(e[i])(e[i],t[i]));return e=>{for(let t in r)n[t]=r[t](e);return n}}function Bt(e,t){let n=[],r={color:0,var:0,number:0};for(let i=0;i<t.values.length;i++){let a=t.types[i],o=e.indexes[a][r[a]],s=e.values[o]??0;n[i]=s,r[a]++}return n}var Vt=(e,t)=>{let n=z.createTransformer(t),r=R(e),i=R(t);return r.indexes.var.length===i.indexes.var.length&&r.indexes.color.length===i.indexes.color.length&&r.indexes.number.length>=i.indexes.number.length?Pt.has(e)&&!i.values.length||Pt.has(t)&&!r.values.length?Ft(e,t):D(Rt(Bt(r,i),i.values),n):(`${e}${t}`,Dt(e,t))};function Ht(e,t,n){return typeof e==`number`&&typeof t==`number`&&typeof n==`number`?Ot(e,t,n):Lt(e)(e,t)}var Ut=e=>{let t=({timestamp:t})=>e(t);return{start:(e=!0)=>A.update(t,e),stop:()=>Le(t),now:()=>Re.isProcessing?Re.timestamp:j.now()}},Wt=(e,t,n=10)=>{let r=``,i=Math.max(Math.round(t/n),2);for(let t=0;t<i;t++)r+=Math.round(e(t/(i-1))*1e4)/1e4+`, `;return`linear(${r.substring(0,r.length-2)})`},Gt=2e4;function Kt(e){let t=0,n=e.next(t);for(;!n.done&&t<2e4;)t+=50,n=e.next(t);return t>=2e4?1/0:t}function qt(e,t=100,n){let r=n({...e,keyframes:[0,t]}),i=Math.min(Kt(r),Gt);return{type:`keyframes`,ease:e=>r.next(i*e).value/t,duration:k(i)}}var B={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1};function Jt(e,t){return e*Math.sqrt(1-t*t)}var Yt=12;function Xt(e,t,n){let r=n;for(let n=1;n<Yt;n++)r-=e(r)/t(r);return r}var Zt=.001;function Qt({duration:e=B.duration,bounce:t=B.bounce,velocity:n=B.velocity,mass:r=B.mass}){let i,a;B.maxDuration;let o=1-t;o=C(B.minDamping,B.maxDamping,o),e=C(B.minDuration,B.maxDuration,k(e)),o<1?(i=t=>{let r=t*o,i=r*e,a=r-n,s=Jt(t,o),c=Math.exp(-i);return Zt-a/s*c},a=t=>{let r=t*o*e,a=r*n+n,s=o**2*t**2*e,c=Math.exp(-r),l=Jt(t**2,o);return(-i(t)+Zt>0?-1:1)*((a-s)*c)/l}):(i=t=>-.001+Math.exp(-t*e)*((t-n)*e+1),a=t=>Math.exp(-t*e)*((n-t)*(e*e)));let s=5/e,c=Xt(i,a,s);if(e=O(e),isNaN(c))return{stiffness:B.stiffness,damping:B.damping,duration:e};{let t=c**2*r;return{stiffness:t,damping:o*2*Math.sqrt(r*t),duration:e}}}var $t=[`duration`,`bounce`],en=[`stiffness`,`damping`,`mass`];function tn(e,t){return t.some(t=>e[t]!==void 0)}function nn(e){let t={velocity:B.velocity,stiffness:B.stiffness,damping:B.damping,mass:B.mass,isResolvedFromDuration:!1,...e};if(!tn(e,en)&&tn(e,$t)){if(t.velocity=0,e.visualDuration){let n=e.visualDuration,r=2*Math.PI/(n*1.2),i=r*r,a=2*C(.05,1,1-(e.bounce||0))*Math.sqrt(i);t={...t,mass:B.mass,stiffness:i,damping:a}}else{let n=Qt({...e,velocity:0});t={...t,...n,mass:B.mass},t.isResolvedFromDuration=!0}}return t}function V(e=B.visualDuration,t=B.bounce){let n=typeof e==`object`?e:{visualDuration:e,keyframes:[0,1],bounce:t},{restSpeed:r,restDelta:i}=n,a=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],s={done:!1,value:a},{stiffness:c,damping:l,mass:u,duration:d,velocity:f,isResolvedFromDuration:p}=nn({...n,velocity:-k(n.velocity||0)}),m=f||0,h=l/(2*Math.sqrt(c*u)),g=o-a,_=k(Math.sqrt(c/u)),v=Math.abs(g)<5;r||=v?B.restSpeed.granular:B.restSpeed.default,i||=v?B.restDelta.granular:B.restDelta.default;let y,b,x,S,C,w;if(h<1)x=Jt(_,h),S=(m+h*_*g)/x,y=e=>{let t=Math.exp(-h*_*e);return o-t*(S*Math.sin(x*e)+g*Math.cos(x*e))},C=h*_*S+g*x,w=h*_*g-S*x,b=e=>Math.exp(-h*_*e)*(C*Math.sin(x*e)+w*Math.cos(x*e));else if(h===1){y=e=>o-Math.exp(-_*e)*(g+(m+_*g)*e);let e=m+_*g;b=t=>Math.exp(-_*t)*(_*e*t-m)}else{let e=_*Math.sqrt(h*h-1);y=t=>{let n=Math.exp(-h*_*t),r=Math.min(e*t,300);return o-n*((m+h*_*g)*Math.sinh(r)+e*g*Math.cosh(r))/e};let t=(m+h*_*g)/e,n=h*_*t-g*e,r=h*_*g-t*e;b=t=>{let i=Math.exp(-h*_*t),a=Math.min(e*t,300);return i*(n*Math.sinh(a)+r*Math.cosh(a))}}let T={calculatedDuration:p&&d||null,velocity:e=>O(b(e)),next:e=>{if(!p&&h<1){let t=Math.exp(-h*_*e),n=Math.sin(x*e),a=Math.cos(x*e),c=o-t*(S*n+g*a),l=O(t*(C*n+w*a));return s.done=Math.abs(l)<=r&&Math.abs(o-c)<=i,s.value=s.done?o:c,s}let t=y(e);if(p)s.done=e>=d;else{let n=O(b(e));s.done=Math.abs(n)<=r&&Math.abs(o-t)<=i}return s.value=s.done?o:t,s},toString:()=>{let e=Math.min(Kt(T),Gt),t=Wt(t=>T.next(e*t).value,e,30);return e+`ms `+t},toTransition:()=>{}};return T}V.applyToOptions=e=>{let t=qt(e,100,V);return e.ease=t.ease,e.duration=O(t.duration),e.type=`keyframes`,e};var rn=5;function an(e,t,n){let r=Math.max(t-rn,0);return oe(n-e(r),t-r)}function on({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:a=500,modifyTarget:o,min:s,max:c,restDelta:l=.5,restSpeed:u}){let d=e[0],f={done:!1,value:d},p=e=>s!==void 0&&e<s||c!==void 0&&e>c,m=e=>s===void 0?c:c===void 0||Math.abs(s-e)<Math.abs(c-e)?s:c,h=n*t,g=d+h,_=o===void 0?g:o(g);_!==g&&(h=_-d);let v=e=>-h*Math.exp(-e/r),y=e=>_+v(e),b=e=>{let t=v(e),n=y(e);f.done=Math.abs(t)<=l,f.value=f.done?_:n},x,S,C=e=>{p(f.value)&&(x=e,S=V({keyframes:[f.value,m(f.value)],velocity:an(y,e,f.value),damping:i,stiffness:a,restDelta:l,restSpeed:u}))};return C(0),{calculatedDuration:null,next:e=>{let t=!1;return!S&&x===void 0&&(t=!0,b(e),C(e)),x!==void 0&&e>=x?S.next(e-x):(!t&&b(e),f)}}}function sn(e,t,n){let r=[],i=n||T.mix||Ht,a=e.length-1;for(let n=0;n<a;n++){let a=i(e[n],e[n+1]);t&&(a=D(Array.isArray(t)?t[n]||E:t,a)),r.push(a)}return r}function cn(e,t,{clamp:n=!0,ease:r,mixer:i}={}){let a=e.length;if(t.length,a===1)return()=>t[0];if(a===2&&t[0]===t[1])return()=>t[1];let o=e[0]===e[1];e[0]>e[a-1]&&(e=[...e].reverse(),t=[...t].reverse());let s=sn(t,r,i),c=s.length,l=n=>{if(o&&n<e[0])return t[0];let r=0;if(c>1)for(;r<e.length-2&&!(n<e[r+1]);r++);let i=ie(e[r],e[r+1],n);return s[r](i)};return n?t=>l(C(e[0],e[a-1],t)):l}function ln(e,t){let n=e[e.length-1];for(let r=1;r<=t;r++){let i=ie(0,t,r);e.push(Ot(n,1,i))}}function un(e){let t=[0];return ln(t,e.length-1),t}function dn(e,t){return e.map(e=>e*t)}function fn(e,t){return e.map(()=>t||Ee).splice(0,e.length-1)}function pn({duration:e=300,keyframes:t,times:n,ease:r=`easeInOut`}){let i=De(r)?r.map(Me):Me(r),a={done:!1,value:t[0]},o=cn(dn(n&&n.length===t.length?n:un(t),e),t,{ease:Array.isArray(i)?i:fn(t,i)});return{calculatedDuration:e,next:t=>(a.value=o(t),a.done=t>=e,a)}}var mn=e=>e!==null;function hn(e,{repeat:t,repeatType:n=`loop`},r,i=1){let a=e.filter(mn),o=i<0||t&&n!==`loop`&&t%2==1?0:a.length-1;return!o||r===void 0?a[o]:r}var gn={decay:on,inertia:on,tween:pn,keyframes:pn,spring:V};function _n(e){typeof e.type==`string`&&(e.type=gn[e.type])}var vn=class{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(e=>{this.resolve=e})}notifyFinished(){this.resolve()}then(e,t){return this.finished.then(e,t)}},yn=e=>e/100,bn=class extends vn{constructor(e){super(),this.state=`idle`,this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{let{motionValue:e}=this.options;e&&e.updatedAt!==j.now()&&this.tick(j.now()),this.isStopped=!0,this.state!==`idle`&&(this.teardown(),this.options.onStop?.())},this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause()}initAnimation(){let{options:e}=this;_n(e);let{type:t=pn,repeat:n=0,repeatDelay:r=0,repeatType:i,velocity:a=0}=e,{keyframes:o}=e,s=t||pn;s!==pn&&typeof o[0]!=`number`&&(this.mixKeyframes=D(yn,Ht(o[0],o[1])),o=[0,100]);let c=s({...e,keyframes:o});i===`mirror`&&(this.mirroredGenerator=s({...e,keyframes:[...o].reverse(),velocity:-a})),c.calculatedDuration===null&&(c.calculatedDuration=Kt(c));let{calculatedDuration:l}=c;this.calculatedDuration=l,this.resolvedDuration=l+r,this.totalDuration=this.resolvedDuration*(n+1)-r,this.generator=c}updateTime(e){let t=Math.round(e-this.startTime)*this.playbackSpeed;this.currentTime=this.holdTime===null?t:this.holdTime}tick(e,t=!1){let{generator:n,totalDuration:r,mixKeyframes:i,mirroredGenerator:a,resolvedDuration:o,calculatedDuration:s}=this;if(this.startTime===null)return n.next(0);let{delay:c=0,keyframes:l,repeat:u,repeatType:d,repeatDelay:f,type:p,onUpdate:m,finalKeyframe:h}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-r/this.speed,this.startTime)),t?this.currentTime=e:this.updateTime(e);let g=this.currentTime-c*(this.playbackSpeed>=0?1:-1),_=this.playbackSpeed>=0?g<0:g>r;this.currentTime=Math.max(g,0),this.state===`finished`&&this.holdTime===null&&(this.currentTime=r);let v=this.currentTime,y=n;if(u){let e=Math.min(this.currentTime,r)/o,t=Math.floor(e),n=e%1;!n&&e>=1&&(n=1),n===1&&t--,t=Math.min(t,u+1),t%2&&(d===`reverse`?(n=1-n,f&&(n-=f/o)):d===`mirror`&&(y=a)),v=C(0,1,n)*o}let b;_?(this.delayState.value=l[0],b=this.delayState):b=y.next(v),i&&!_&&(b.value=i(b.value));let{done:x}=b;!_&&s!==null&&(x=this.playbackSpeed>=0?this.currentTime>=r:this.currentTime<=0);let S=this.holdTime===null&&(this.state===`finished`||this.state===`running`&&x);return S&&p!==on&&(b.value=hn(l,this.options,h,this.speed)),m&&m(b.value),S&&this.finish(),b}then(e,t){return this.finished.then(e,t)}get duration(){return k(this.calculatedDuration)}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+k(e)}get time(){return k(this.currentTime)}set time(e){e=O(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state=`paused`,this.holdTime=e,this.tick(e))}getGeneratorVelocity(){let e=this.currentTime;if(e<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(e);let t=this.generator.next(e).value;return an(e=>this.generator.next(e).value,e,t)}get speed(){return this.playbackSpeed}set speed(e){let t=this.playbackSpeed!==e;t&&this.driver&&this.updateTime(j.now()),this.playbackSpeed=e,t&&this.driver&&(this.time=k(this.currentTime))}play(){if(this.isStopped)return;let{driver:e=Ut,startTime:t}=this.options;this.driver||=e(e=>this.tick(e)),this.options.onPlay?.();let n=this.driver.now();this.state===`finished`?(this.updateFinished(),this.startTime=n):this.holdTime===null?this.startTime||=t??n:this.startTime=n-this.holdTime,this.state===`finished`&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state=`running`,this.driver.start()}pause(){this.state=`paused`,this.updateTime(j.now()),this.holdTime=this.currentTime}complete(){this.state!==`running`&&this.play(),this.state=`finished`,this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state=`finished`,this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state=`idle`,this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&=(this.driver.stop(),void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){return this.options.allowFlatten&&(this.options.type=`keyframes`,this.options.ease=`linear`,this.initAnimation()),this.driver?.stop(),e.observe(this)}};function xn(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}var H=e=>e*180/Math.PI,Sn=e=>wn(H(Math.atan2(e[1],e[0]))),Cn={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:Sn,rotateZ:Sn,skewX:e=>H(Math.atan(e[1])),skewY:e=>H(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},wn=e=>(e%=360,e<0&&(e+=360),e),Tn=Sn,En=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),Dn=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),On={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:En,scaleY:Dn,scale:e=>(En(e)+Dn(e))/2,rotateX:e=>wn(H(Math.atan2(e[6],e[5]))),rotateY:e=>wn(H(Math.atan2(-e[2],e[0]))),rotateZ:Tn,rotate:Tn,skewX:e=>H(Math.atan(e[4])),skewY:e=>H(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function kn(e){return+!!e.includes(`scale`)}function An(e,t){if(!e||e===`none`)return kn(t);let n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u),r,i;if(n)r=On,i=n;else{let t=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=Cn,i=t}if(!i)return kn(t);let a=r[t],o=i[1].split(`,`).map(Mn);return typeof a==`function`?a(o):o[a]}var jn=(e,t)=>{let{transform:n=`none`}=getComputedStyle(e);return An(n,t)};function Mn(e){return parseFloat(e.trim())}var Nn=[`transformPerspective`,`x`,`y`,`z`,`translateX`,`translateY`,`translateZ`,`scale`,`scaleX`,`scaleY`,`rotate`,`rotateX`,`rotateY`,`rotateZ`,`skew`,`skewX`,`skewY`],Pn=new Set([...Nn,`pathRotation`]),Fn=e=>e===M||e===F,In=new Set([`x`,`y`,`z`]),Ln=Nn.filter(e=>!In.has(e));function Rn(e){let t=[];return Ln.forEach(n=>{let r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(+!!n.startsWith(`scale`)))}),t}var U={width:({x:e},{paddingLeft:t=`0`,paddingRight:n=`0`,boxSizing:r})=>{let i=e.max-e.min;return r===`border-box`?i:i-parseFloat(t)-parseFloat(n)},height:({y:e},{paddingTop:t=`0`,paddingBottom:n=`0`,boxSizing:r})=>{let i=e.max-e.min;return r===`border-box`?i:i-parseFloat(t)-parseFloat(n)},top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>An(t,`x`),y:(e,{transform:t})=>An(t,`y`)};U.translateX=U.x,U.translateY=U.y;var W=new Set,zn=!1,Bn=!1,Vn=!1;function Hn(){if(Bn){let e=Array.from(W).filter(e=>e.needsMeasurement),t=new Set(e.map(e=>e.element)),n=new Map;t.forEach(e=>{let t=Rn(e);t.length&&(n.set(e,t),e.render())}),e.forEach(e=>e.measureInitialState()),t.forEach(e=>{e.render();let t=n.get(e);t&&t.forEach(([t,n])=>{e.getValue(t)?.set(n)})}),e.forEach(e=>e.measureEndState()),e.forEach(e=>{e.suspendedScrollY!==void 0&&window.scrollTo(0,e.suspendedScrollY)})}Bn=!1,zn=!1,W.forEach(e=>e.complete(Vn)),W.clear()}function Un(){W.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Bn=!0)})}function Wn(){Vn=!0,Un(),Hn(),Vn=!1}var Gn=class{constructor(e,t,n,r,i,a=!1){this.state=`pending`,this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=t,this.name=n,this.motionValue=r,this.element=i,this.isAsync=a}scheduleResolve(){this.state=`scheduled`,this.isAsync?(W.add(this),zn||(zn=!0,A.read(Un),A.resolveKeyframes(Hn))):(this.readKeyframes(),this.complete())}readKeyframes(){let{unresolvedKeyframes:e,name:t,element:n,motionValue:r}=this;if(e[0]===null){let i=r?.get(),a=e[e.length-1];if(i!==void 0)e[0]=i;else if(n&&t){let r=n.readValue(t,a);r!=null&&(e[0]=r)}e[0]===void 0&&(e[0]=a),r&&i===void 0&&r.set(e[0])}xn(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state=`complete`,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),W.delete(this)}cancel(){this.state===`scheduled`&&(W.delete(this),this.state=`pending`)}resume(){this.state===`pending`&&this.scheduleResolve()}},Kn=e=>e.startsWith(`--`);function qn(e,t,n){Kn(t)?e.style.setProperty(t,n):e.style[t]=n}var Jn={};function Yn(e,t){let n=re(e);return()=>Jn[t]??n()}var Xn=Yn(()=>window.ScrollTimeline!==void 0,`scrollTimeline`),Zn=Yn(()=>{try{document.createElement(`div`).animate({opacity:0},{easing:`linear(0, 1)`})}catch{return!1}return!0},`linearEasing`),Qn=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,$n={linear:`linear`,ease:`ease`,easeIn:`ease-in`,easeOut:`ease-out`,easeInOut:`ease-in-out`,circIn:Qn([0,.65,.55,1]),circOut:Qn([.55,0,1,.45]),backIn:Qn([.31,.01,.66,-.59]),backOut:Qn([.33,1.53,.69,.99])};function er(e,t){if(e)return typeof e==`function`?Zn()?Wt(e,t):`ease-out`:ke(e)?Qn(e):Array.isArray(e)?e.map(e=>er(e,t)||$n.easeOut):$n[e]}function tr(e,t,n,{delay:r=0,duration:i=300,repeat:a=0,repeatType:o=`loop`,ease:s=`easeOut`,times:c}={},l=void 0){let u={[t]:n};c&&(u.offset=c);let d=er(s,i);Array.isArray(d)&&(u.easing=d);let f={delay:r,duration:i,easing:Array.isArray(d)?`linear`:d,fill:`both`,iterations:a+1,direction:o===`reverse`?`alternate`:`normal`};return l&&(f.pseudoElement=l),e.animate(u,f)}function nr(e){return typeof e==`function`&&`applyToOptions`in e}function rr({type:e,...t}){return nr(e)&&Zn()?e.applyToOptions(t):(t.duration??=300,t.ease??=`easeOut`,t)}var G=class extends vn{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;let{element:t,name:n,keyframes:r,pseudoElement:i,allowFlatten:a=!1,finalKeyframe:o,onComplete:s}=e;this.isPseudoElement=!!i,this.allowFlatten=a,this.options=e,e.type;let c=rr(e);this.animation=tr(t,n,r,c,i),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){let e=hn(r,this.options,o,this.speed);this.updateMotionValue&&this.updateMotionValue(e),qn(t,n,e),this.animation.cancel()}s?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state===`finished`&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;let{state:e}=this;e!==`idle`&&e!==`finished`&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){let e=this.options?.element;!this.isPseudoElement&&e?.isConnected&&this.animation.commitStyles?.()}get duration(){let e=this.animation.effect?.getComputedTiming?.().duration||0;return k(Number(e))}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+k(e)}get time(){return k(Number(this.animation.currentTime)||0)}set time(e){let t=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=O(e),t&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return this.finishedTime===null?this.animation.playState:`finished`}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(e){this.manualStartTime=this.animation.startTime=e}attachTimeline({timeline:e,rangeStart:t,rangeEnd:n,observe:r}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:`linear`}),this.animation.onfinish=null,e&&Xn()?(this.animation.timeline=e,t&&(this.animation.rangeStart=t),n&&(this.animation.rangeEnd=n),E):r(this)}},ir={anticipate:be,backInOut:ye,circInOut:Ce};function ar(e){return e in ir}function or(e){typeof e.ease==`string`&&ar(e.ease)&&(e.ease=ir[e.ease])}var sr=10,cr=class extends G{constructor(e){or(e),_n(e),super(e),e.startTime!==void 0&&e.autoplay!==!1&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){let{motionValue:t,onUpdate:n,onComplete:r,element:i,...a}=this.options;if(!t)return;if(e!==void 0){t.set(e);return}let o=new bn({...a,autoplay:!1}),s=Math.max(sr,j.now()-this.startTime),c=C(0,sr,s-sr),l=o.sample(s).value,{name:u}=this.options;i&&u&&qn(i,u,l),t.setWithVelocity(o.sample(Math.max(0,s-c)).value,l,c),o.stop()}},lr=(e,t)=>t!==`zIndex`&&!!(typeof e==`number`||Array.isArray(e)||typeof e==`string`&&(z.test(e)||e===`0`)&&!e.startsWith(`url(`));function ur(e){let t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function dr(e,t,n,r){let i=e[0];if(i===null)return!1;if(t===`display`||t===`visibility`)return!0;let a=e[e.length-1],o=lr(i,t),s=lr(a,t);return`${t}${i}${a}${o?a:i}`,!o||!s?!1:ur(e)||(n===`spring`||nr(n))&&r}function fr(e){e.duration=0,e.type=`keyframes`}var pr=new Set([`opacity`,`clipPath`,`filter`,`transform`,`backgroundColor`]),mr=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function hr(e){for(let t=0;t<e.length;t++)if(typeof e[t]==`string`&&mr.test(e[t]))return!0;return!1}var gr=new Set([`color`,`backgroundColor`,`outlineColor`,`fill`,`stroke`,`borderColor`,`borderTopColor`,`borderRightColor`,`borderBottomColor`,`borderLeftColor`]),_r=re(()=>Object.hasOwnProperty.call(Element.prototype,`animate`));function vr(e){let{motionValue:t,name:n,repeatDelay:r,repeatType:i,damping:a,type:o,keyframes:s}=e,c=t?.owner?.current;if(!(c instanceof HTMLElement)&&!(c instanceof SVGElement))return!1;let{onUpdate:l,transformTemplate:u}=t.owner.getProps();return _r()&&n&&(pr.has(n)||gr.has(n)&&hr(s))&&(n!==`transform`||!u)&&!l&&!r&&i!==`mirror`&&a!==0&&o!==`inertia`}var yr=40,br=class extends vn{constructor({autoplay:e=!0,delay:t=0,type:n=`keyframes`,repeat:r=0,repeatDelay:i=0,repeatType:a=`loop`,keyframes:o,name:s,motionValue:c,element:l,...u}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=j.now();let d={autoplay:e,delay:t,type:n,repeat:r,repeatDelay:i,repeatType:a,name:s,motionValue:c,element:l,...u},f=l?.KeyframeResolver||Gn;this.keyframeResolver=new f(o,(e,t,n)=>this.onKeyframesResolved(e,t,d,!n),s,c,l),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,t,n,r){this.keyframeResolver=void 0;let{name:i,type:a,velocity:o,delay:s,isHandoff:c,onUpdate:l}=n;this.resolvedAt=j.now();let u=!0;dr(e,i,a,o)||(u=!1,(T.instantAnimations||!s)&&l?.(hn(e,n,t)),e[0]=e[e.length-1],fr(n),n.repeat=0);let d={startTime:r?this.resolvedAt&&this.resolvedAt-this.createdAt>yr?this.resolvedAt:this.createdAt:void 0,finalKeyframe:t,...n,keyframes:e},f=u&&!c&&vr(d),p=d.motionValue?.owner?.current,m;if(f)try{m=new cr({...d,element:p})}catch{m=new bn(d)}else m=new bn(d);m.finished.then(()=>{this.notifyFinished()}).catch(E),this.pendingTimeline&&=(this.stopTimeline=m.attachTimeline(this.pendingTimeline),void 0),this._animation=m}get finished(){return this._animation?this.animation.finished:this._finished}then(e,t){return this.finished.finally(e).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),Wn()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}},xr=class{constructor(e){this.stop=()=>this.runAll(`stop`),this.animations=e.filter(Boolean)}get finished(){return Promise.all(this.animations.map(e=>e.finished))}getAll(e){return this.animations[0][e]}setAll(e,t){for(let n=0;n<this.animations.length;n++)this.animations[n][e]=t}attachTimeline(e){let t=this.animations.map(t=>t.attachTimeline(e));return()=>{t.forEach((e,t)=>{e&&e(),this.animations[t].stop()})}}get time(){return this.getAll(`time`)}set time(e){this.setAll(`time`,e)}get speed(){return this.getAll(`speed`)}set speed(e){this.setAll(`speed`,e)}get state(){return this.getAll(`state`)}get startTime(){return this.getAll(`startTime`)}get duration(){return Sr(this.animations,`duration`)}get iterationDuration(){return Sr(this.animations,`iterationDuration`)}runAll(e){this.animations.forEach(t=>t[e]())}play(){this.runAll(`play`)}pause(){this.runAll(`pause`)}cancel(){this.runAll(`cancel`)}complete(){this.runAll(`complete`)}};function Sr(e,t){let n=0;for(let r=0;r<e.length;r++){let i=e[r][t];i!==null&&i>n&&(n=i)}return n}var Cr=class extends xr{then(e,t){return this.finished.finally(e).then(()=>{})}},wr=class extends G{constructor(e){super(),this.animation=e,e.onfinish=()=>{this.finishedTime=this.time,this.notifyFinished()}}},Tr=new WeakMap,Er=(e,t=``)=>`${e}:${t}`;function Dr(e){let t=Tr.get(e);return t||(t=new Map,Tr.set(e,t)),t}var Or=30,kr=e=>!isNaN(parseFloat(e)),Ar={current:void 0},jr=class{constructor(e,t={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=e=>{let t=j.now();if(this.updatedAt!==t&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(e),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(let e of this.dependents)e.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=t.owner}setCurrent(e){this.current=e,this.updatedAt=j.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=kr(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on(`change`,e)}on(e,t){this.events[e]||(this.events[e]=new ae);let n=this.events[e].add(t);return e===`change`?()=>{n(),A.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(let e in this.events)this.events[e].clear()}attach(e,t){this.passiveEffect=e,this.stopPassiveEffect=t}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,t,n){this.set(t),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-n}jump(e,t=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,t&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(e){this.dependents||=new Set,this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return Ar.current&&Ar.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){let e=j.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>Or)return 0;let t=Math.min(this.updatedAt-this.prevUpdatedAt,Or);return oe(parseFloat(this.current)-parseFloat(this.prevFrameValue),t)}start(e){return this.stop(),new Promise(t=>{this.hasAnimated=!0,this.animation=e(t),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}};function K(e,t){return new jr(e,t)}function Mr(e,t){if(e?.inherit&&t){let{inherit:n,...r}=e;return{...t,...r}}return e}function q(e,t){let n=e?.[t]??e?.default??e;return n===e?n:Mr(n,e)}var Nr={type:`spring`,stiffness:500,damping:25,restSpeed:10},Pr=e=>({type:`spring`,stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),Fr={type:`keyframes`,duration:.8},Ir={type:`keyframes`,ease:[.25,.1,.35,1],duration:.3},Lr=(e,{keyframes:t})=>t.length>2?Fr:Pn.has(e)?e.startsWith(`scale`)?Pr(t[1]):Nr:Ir,Rr=new Set([`when`,`delay`,`delayChildren`,`staggerChildren`,`staggerDirection`,`repeat`,`repeatType`,`repeatDelay`,`from`,`elapsed`]);function zr(e){for(let t in e)if(!Rr.has(t))return!0;return!1}var Br=(e,t,n,r={},i,a)=>o=>{let s=q(r,e)||{},c=s.delay||r.delay||0,{elapsed:l=0}=r;l-=O(c);let u={keyframes:Array.isArray(n)?n:[null,n],ease:`easeOut`,velocity:t.getVelocity(),...s,delay:-l,onUpdate:e=>{t.set(e),s.onUpdate&&s.onUpdate(e)},onComplete:()=>{o(),s.onComplete&&s.onComplete()},name:e,motionValue:t,element:a?void 0:i};zr(s)||Object.assign(u,Lr(e,u)),u.duration&&=O(u.duration),u.repeatDelay&&=O(u.repeatDelay),u.from!==void 0&&(u.keyframes[0]=u.from);let d=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(fr(u),u.delay===0&&(d=!0)),(T.instantAnimations||T.skipAnimations||i?.shouldSkipAnimations||s.skipAnimations)&&(d=!0,fr(u),u.delay=0),u.allowFlatten=!s.type&&!s.ease,d&&!a&&t.get()!==void 0){let e=hn(u.keyframes,s);if(e!==void 0){A.update(()=>{u.onUpdate(e),u.onComplete()});return}}return s.isSync?new bn(u):new br(u)},Vr=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Hr(e){let t=Vr.exec(e);if(!t)return[,];let[,n,r,i]=t;return[`--${n??r}`,i]}function Ur(e,t,n=1){`${e}`;let[r,i]=Hr(e);if(!r)return;let a=window.getComputedStyle(t).getPropertyValue(r);if(a){let e=a.trim();return ee(e)?parseFloat(e):e}return Ge(i)?Ur(i,t,n+1):i}function Wr(e){let t=[{},{}];return e?.values.forEach((e,n)=>{t[0][n]=e.get(),t[1][n]=e.getVelocity()}),t}function Gr(e,t,n,r){if(typeof t==`function`){let[i,a]=Wr(r);t=t(n===void 0?e.custom:n,i,a)}if(typeof t==`string`&&(t=e.variants&&e.variants[t]),typeof t==`function`){let[i,a]=Wr(r);t=t(n===void 0?e.custom:n,i,a)}return t}function Kr(e,t,n){let r=e.getProps();return Gr(r,t,n===void 0?r.custom:n,e)}var qr=new Set([`width`,`height`,`top`,`left`,`right`,`bottom`,...Nn]),Jr=e=>Array.isArray(e);function Yr(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,K(n))}function Xr(e){return Jr(e)?e[e.length-1]||0:e}function Zr(e,t){let{transitionEnd:n={},transition:r={},...i}=Kr(e,t)||{};i={...i,...n};for(let t in i)Yr(e,t,Xr(i[t]))}var J=e=>!!(e&&e.getVelocity);function Qr(e){return!!(J(e)&&e.add)}function $r(e,t){let n=e.getValue(`willChange`);if(Qr(n))return n.add(t);if(!n&&T.WillChange){let n=new T.WillChange(`auto`);e.addValue(`willChange`,n),n.add(t)}}function ei(e){return e.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}var ti=`data-`+ei(`framerAppearId`);function ni(e){return e.props[ti]}function ri({protectedKeys:e,needsAnimating:t},n){let r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function ii(e,t,{delay:n=0,transitionOverride:r,type:i}={}){let{transition:a,transitionEnd:o,...s}=t,c=e.getDefaultTransition();a=a?Mr(a,c):c;let l=a?.reduceMotion,u=a?.skipAnimations;r&&(a=r);let d=[],f=i&&e.animationState&&e.animationState.getState()[i],p=a?.path;p&&p.animateVisualElement(e,s,a,n,d);for(let t in s){let r=e.getValue(t,e.latestValues[t]??null),i=s[t];if(i===void 0||f&&ri(f,t))continue;let o={delay:n,...q(a||{},t)};u&&(o.skipAnimations=!0);let c=r.get();if(c!==void 0&&!r.isAnimating()&&!Array.isArray(i)&&i===c&&!o.velocity){A.update(()=>r.set(i));continue}let p=!1;if(window.MotionHandoffAnimation){let n=ni(e);if(n){let e=window.MotionHandoffAnimation(n,t,A);e!==null&&(o.startTime=e,p=!0)}}$r(e,t);let m=l??e.shouldReduceMotion;r.start(Br(t,r,i,m&&qr.has(t)?{type:!1}:o,e,p));let h=r.animation;h&&d.push(h)}if(o){let t=()=>A.update(()=>{o&&Zr(e,o)});d.length?Promise.all(d).then(t):t()}return d}var ai={test:e=>e===`auto`,parse:e=>e},oi=e=>t=>t.test(e),si=[M,F,st,P,lt,ct,ai],ci=e=>si.find(oi(e));function li(e){return typeof e==`number`?e===0:e===null||e===`none`||e===`0`||ne(e)}var ui=new Set([`brightness`,`contrast`,`saturate`,`opacity`]);function di(e){let[t,n]=e.slice(0,-1).split(`(`);if(t===`drop-shadow`)return e;let[r]=n.match(Ze)||[];if(!r)return e;let i=n.replace(r,``),a=+!!ui.has(t);return r!==n&&(a*=100),t+`(`+a+i+`)`}var fi=/\b([a-z-]*)\(.*?\)/gu,pi={...z,getAnimatableNone:e=>{let t=e.match(fi);return t?t.map(di).join(` `):e}},mi={...z,getAnimatableNone:e=>{let t=z.parse(e);return z.createTransformer(e)(t.map(e=>typeof e==`number`?0:typeof e==`object`?{...e,alpha:1}:e))}},hi={...M,transform:Math.round},gi={borderWidth:F,borderTopWidth:F,borderRightWidth:F,borderBottomWidth:F,borderLeftWidth:F,borderRadius:F,borderTopLeftRadius:F,borderTopRightRadius:F,borderBottomRightRadius:F,borderBottomLeftRadius:F,width:F,maxWidth:F,height:F,maxHeight:F,top:F,right:F,bottom:F,left:F,inset:F,insetBlock:F,insetBlockStart:F,insetBlockEnd:F,insetInline:F,insetInlineStart:F,insetInlineEnd:F,padding:F,paddingTop:F,paddingRight:F,paddingBottom:F,paddingLeft:F,paddingBlock:F,paddingBlockStart:F,paddingBlockEnd:F,paddingInline:F,paddingInlineStart:F,paddingInlineEnd:F,margin:F,marginTop:F,marginRight:F,marginBottom:F,marginLeft:F,marginBlock:F,marginBlockStart:F,marginBlockEnd:F,marginInline:F,marginInlineStart:F,marginInlineEnd:F,fontSize:F,backgroundPositionX:F,backgroundPositionY:F,rotate:P,pathRotation:P,rotateX:P,rotateY:P,rotateZ:P,scale:Ye,scaleX:Ye,scaleY:Ye,scaleZ:Ye,skew:P,skewX:P,skewY:P,distance:F,translateX:F,translateY:F,translateZ:F,x:F,y:F,z:F,perspective:F,transformPerspective:F,opacity:Je,originX:ut,originY:ut,originZ:F,zIndex:hi,fillOpacity:Je,strokeOpacity:Je,numOctaves:hi},_i={...gi,color:L,backgroundColor:L,outlineColor:L,fill:L,stroke:L,borderColor:L,borderTopColor:L,borderRightColor:L,borderBottomColor:L,borderLeftColor:L,filter:pi,WebkitFilter:pi,mask:mi,WebkitMask:mi},vi=e=>_i[e],yi=new Set([pi,mi]);function bi(e,t){let n=vi(e);return yi.has(n)||(n=z),n.getAnimatableNone?n.getAnimatableNone(t):void 0}var xi=new Set([`auto`,`none`,`0`]);function Si(e,t,n){let r=0,i;for(;r<e.length&&!i;){let t=e[r];typeof t==`string`&&!xi.has(t)&&R(t).values.length&&(i=e[r]),r++}if(i&&n)for(let r of t)e[r]=bi(n,i)}var Ci=class extends Gn{constructor(e,t,n,r,i){super(e,t,n,r,i,!0)}readKeyframes(){let{unresolvedKeyframes:e,element:t,name:n}=this;if(!t||!t.current)return;super.readKeyframes();for(let n=0;n<e.length;n++){let r=e[n];if(typeof r==`string`&&(r=r.trim(),Ge(r))){let i=Ur(r,t.current);i!==void 0&&(e[n]=i),n===e.length-1&&(this.finalKeyframe=r)}}if(this.resolveNoneKeyframes(),!qr.has(n)||e.length!==2)return;let[r,i]=e,a=ci(r),o=ci(i);if(qe(r)!==qe(i)&&U[n]){this.needsMeasurement=!0;return}if(a!==o){if(Fn(a)&&Fn(o))for(let t=0;t<e.length;t++){let n=e[t];typeof n==`string`&&(e[t]=parseFloat(n))}else U[n]&&(this.needsMeasurement=!0)}}resolveNoneKeyframes(){let{unresolvedKeyframes:e,name:t}=this,n=[];for(let t=0;t<e.length;t++)(e[t]===null||li(e[t]))&&n.push(t);n.length&&Si(e,n,t)}measureInitialState(){let{element:e,unresolvedKeyframes:t,name:n}=this;if(!e||!e.current)return;n===`height`&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=U[n](e.measureViewportBox(),window.getComputedStyle(e.current)),t[0]=this.measuredOrigin;let r=t[t.length-1];r!==void 0&&e.getValue(n,r).jump(r,!1)}measureEndState(){let{element:e,name:t,unresolvedKeyframes:n}=this;if(!e||!e.current)return;let r=e.getValue(t);r&&r.jump(this.measuredOrigin,!1);let i=n.length-1,a=n[i];n[i]=U[t](e.measureViewportBox(),window.getComputedStyle(e.current)),a!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=a),this.removedTransforms?.length&&this.removedTransforms.forEach(([t,n])=>{e.getValue(t).set(n)}),this.resolveNoneKeyframes()}},wi=[`borderTopLeftRadius`,`borderTopRightRadius`,`borderBottomRightRadius`,`borderBottomLeftRadius`],Ti=new Set([`borderWidth`,`borderTopWidth`,`borderRightWidth`,`borderBottomWidth`,`borderLeftWidth`,`borderRadius`,...wi,`width`,`maxWidth`,`height`,`maxHeight`,`top`,`right`,`bottom`,`left`,`inset`,`insetBlock`,`insetBlockStart`,`insetBlockEnd`,`insetInline`,`insetInlineStart`,`insetInlineEnd`,`padding`,`paddingTop`,`paddingRight`,`paddingBottom`,`paddingLeft`,`paddingBlock`,`paddingBlockStart`,`paddingBlockEnd`,`paddingInline`,`paddingInlineStart`,`paddingInlineEnd`,`margin`,`marginTop`,`marginRight`,`marginBottom`,`marginLeft`,`marginBlock`,`marginBlockStart`,`marginBlockEnd`,`marginInline`,`marginInlineStart`,`marginInlineEnd`,`fontSize`,`backgroundPositionX`,`backgroundPositionY`]);function Ei(e,t){for(let n=0;n<e.length;n++)typeof e[n]==`number`&&Ti.has(t)&&(e[n]=e[n]+`px`)}function Di(e,t,n){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e==`string`){let r=document;t&&(r=t.current);let i=n?.[e]??r.querySelectorAll(e);return i?Array.from(i):[]}return Array.from(e).filter(e=>e!=null)}var Oi=(e,t)=>t&&typeof e==`number`?t.transform(e):e,{schedule:ki,cancel:Ai}=Ie(queueMicrotask,!1);function ji(e,t){let n=window.getComputedStyle(e);return Kn(t)?n.getPropertyValue(t):n[t]}function Mi(e){return te(e)&&`ownerSVGElement`in e}function Ni(e){return Mi(e)&&e.tagName===`svg`}var Pi=[...si,L,z],Fi=e=>Pi.find(oi(e)),Ii=0,Li=()=>`motion-view-${Ii++}`,Ri=e=>e.startsWith(`motion-view-`);function zi(e,t,n){t&&(e.style?.setProperty(`view-transition-class`,t),n.push(e))}function Bi(e,t,n,r,i){if(n&&(e.style?.setProperty(`view-transition-group`,n),r.push(e),n!==`none`&&i)){let n=getComputedStyle(e);(n.overflowX!==`visible`||n.overflowY!==`visible`)&&i.add(t)}}function Vi(e,t,n,r,i,a=[],o,s=[],c){let l=Di(e);if(r)return l.map((e,l)=>{let u=t.get(e);if(u)return u;let d=r[l]??Li();return e.style?.setProperty(`view-transition-name`,d),n.push(e),t.set(e,d),zi(e,i,a),Bi(e,d,o,s,c),d});let u=l.map(e=>t.has(e)?void 0:getComputedStyle(e).getPropertyValue(`view-transition-name`));return l.map((e,r)=>{let l=t.get(e);if(l)return l;let d=u[r],f;return d&&d!==`none`&&d!==`auto`&&d!==`match-element`&&!Ri(d)?f=d:(f=Li(),e.style?.setProperty(`view-transition-name`,f),n.push(e)),t.set(e,f),zi(e,i,a),Bi(e,f,o,s,c),f})}function Hi(e,t=[],n=[]){for(let t of e)t.style?.removeProperty(`view-transition-name`);for(let e of t)e.style?.removeProperty(`view-transition-class`);for(let e of n)e.style?.removeProperty(`view-transition-group`)}function Ui(e){return e===`layout`?`group`:e===`enter`||e===`new`?`new`:`old`}var Wi={},Y=null,X={set:(e,t)=>{Wi[e]=t},commit:()=>{Y||(Y=document.createElement(`style`),Y.id=`motion-view`);let e=``;for(let t in Wi){let n=Wi[t];e+=`${t} {\n`;for(let[t,r]of Object.entries(n))e+=` ${t}: ${r};\n`;e+=`}
|
|
2
|
-
`}Y.textContent=e,document.head.appendChild(Y),Wi={}},remove:()=>{Y&&Y.parentElement&&Y.parentElement.removeChild(Y)}};function Gi(e){let t=e.match(/::view-transition-(old|new|group-children|group|image-pair)\((.*?)\)/);return t?{layer:t[2],type:t[1]}:null}function Ki(){return document.getAnimations().filter(e=>{let{effect:t}=e;return!!t&&t.target===document.documentElement&&t.pseudoElement?.startsWith(`::view-transition`)})}function qi(e,t){return t.has(e)&&Object.keys(t.get(e)).length>0}var Ji=[`layout`,`enter`,`exit`,`new`,`old`],Yi=e=>e.split(` `).every(e=>parseFloat(e)===0),Xi={group:[`layout`],new:[`new`,`enter`],old:[`old`,`exit`]},Zi={new:{opacity:0,scale:.85},old:{opacity:1,scale:1}},Qi=.2;function $i(e){let{update:t,targets:n,resolveDefs:r,cropOverride:i,pairs:a,classNames:o,flatGroups:s,options:c}=e;if(!document.startViewTransition)return(async()=>(await t(),new xr([])))();let l=new Map,u=[],d=[],f=[],p=new Set,m=new Map,h=new Set,g=new Map,_=new Map,v=new Map,y=new Map,b=e=>{n.forEach((t,n)=>{let c=o.get(n),h=n===`root`||!r.has(n)?void 0:s.has(n)?`none`:`contain`,b;if(n===`root`||!r.has(n))b=[n];else if(a.has(n)){if(e===`old`)y.set(n,Di(n)),b=Vi(n,l,u,void 0,c,d,h,f,p),v.set(n,b);else{for(let e of y.get(n)??[])e.style?.removeProperty(`view-transition-name`),l.delete(e);b=Vi(a.get(n),l,u,v.get(n),c,d,h,f,p)}}else b=Vi(n,l,u,void 0,c,d,h,f,p);let x=i.get(n);b.forEach((n,r)=>{let i=m.get(n);m.set(n,i&&i!==t?{...i,...t}:t),x!==void 0&&g.set(n,x);let a=_.get(n)??{};a[e]=[r,b.length],_.set(n,a)})})},x=(e,t)=>{let n=_.get(e);return(t===`old`?n?.old:t===`new`?n?.new:n?.new??n?.old)??[-1,1]},S=(e,t,n,r,i)=>{let a=ta(q(c,n),q(ea(e,t)??{},n));return typeof a.delay==`function`&&(a.delay=a.delay(r,i)),a},C=e=>{let[t,n]=x(e,`group`),r=S(m.get(e),`group`,`layout`,t===-1?0:t,n);r.duration&&=O(r.duration);let{delay:i=0,duration:a,ease:o}=rr(r);return{delay:O(i),duration:a,ease:o}},w=new Map,T=e=>l.forEach((t,n)=>{let r=n,i=r.getBoundingClientRect?.();if(i&&i.height){let n=getComputedStyle(r),a={};for(let e of wi)a[e]=n[e];let o=w.get(t)??{};o[e]={width:i.width,height:i.height,radii:a},w.set(t,o)}}),ee=()=>{h.clear();for(let e of _.keys())e!==`root`&&(g.get(e)??te(e))&&h.add(e)},te=e=>{let t=w.get(e);return!t?.old||!t?.new||!t.old.height||!t.new.height?!1:Math.abs(t.old.width/t.old.height-t.new.width/t.new.height)>Qi},ne=()=>{qi(`root`,n)||X.set(`:root`,{"view-transition-name":`none`}),X.set(`::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*)`,{"animation-timing-function":`linear !important`}),h.forEach(e=>{X.set(`::view-transition-group(${e})`,{overflow:`clip`}),X.set(`::view-transition-old(${e}), ::view-transition-new(${e})`,{width:`100%`,height:`100%`,"object-fit":`cover`})}),p.forEach(e=>{X.set(`::view-transition-group-children(${e})`,{overflow:`clip`})}),X.commit()},re=()=>{Hi(u,d,f),X.remove()},E=async()=>{await t(),b(`new`),T(`new`),ee(),ne()},D;try{b(`old`),T(`old`),ne(),D=document.startViewTransition(E)}catch(e){return re(),Promise.reject(e)}return D.finished.finally(re),new Promise((e,t)=>{D.ready.then(()=>{let t=Ki(),n=[],r=new Set,i=new Set;m.forEach((e,t)=>{let a=_.get(t),o=!!a?.new&&!a?.old,s=!!a?.old&&!a?.new;for(let a of Ji){if(!e[a]||a===`enter`&&!o||a===`exit`&&!s)continue;let l=Ui(a),[u,d]=x(t,l);if(u===-1)continue;let{keyframes:f,options:p}=e[a];for(let[m,h]of Object.entries(f)){if(h==null)continue;if(m===`x`||m===`y`){ce(!1,`animateView() animates view-transition layers with CSS properties; the "${m}" shorthand has no effect - use transform, e.g. { transform: "translateX(40px)" }.`);continue}if(a===`new`&&o&&e.enter?.keyframes[m]!=null||a===`old`&&s&&e.exit?.keyframes[m]!=null)continue;let f=ta(q(c,m),q(p,m));if(!Array.isArray(h)){let t=a===`enter`?e.exit?.keyframes[m]:void 0,n=t==null?m===`opacity`||(l===`new`?o:s)?Zi[l]?.[m]:void 0:Array.isArray(t)?t[t.length-1]:t;n!==void 0&&(h=[n,h])}typeof f.delay==`function`&&(f.delay=f.delay(u,d)),f.duration&&=O(f.duration),f.delay&&=O(f.delay),n.push(new G({...f,element:document.documentElement,name:m,pseudoElement:`::view-transition-${l}(${t})`,keyframes:h})),r.add(`${t}:${l}`),m===`opacity`&&i.add(`${t}:${l}`)}}});for(let e of t){if(e.playState===`finished`)continue;let{effect:t}=e;if(!t||!(t instanceof KeyframeEffect))continue;let{pseudoElement:a}=t;if(!a)continue;let o=Gi(a);if(!o)continue;let s=m.get(o.layer);if(r.has(`${o.layer}:${o.type}`)){i.has(`${o.layer}:new`)&&i.has(`${o.layer}:old`)&&t.getKeyframes().some(e=>e.mixBlendMode)?n.push(new wr(e)):e.cancel();continue}let c=o.type===`old`?`new`:o.type===`new`?`old`:void 0;if(c&&r.has(`${o.layer}:${c}`)&&!i.has(`${o.layer}:${c}`)){e.cancel();continue}let l=_.get(o.layer),u=(o.type===`old`||o.type===`new`)&&!!l?.old&&!!l?.new,d;if(o.type.startsWith(`group`)){let{delay:e,duration:t,ease:n}=C(o.layer);d={delay:e,duration:t,easing:er(n,t)}}else{let e=u?`group`:o.type,[t,n]=x(o.layer,e),r=S(s,e,e===`group`?`layout`:``,t===-1?0:t,n),i=r.visualDuration;r.duration&&(r.duration=O(r.duration)),r=rr(r),d={delay:O(r.delay??0),duration:u&&i!==void 0?O(i):r.duration,easing:u?`linear`:er(r.ease,r.duration)}}t.updateTiming(d),n.push(new wr(e))}w.forEach((e,t)=>{if(!h.has(t))return;let{delay:r,duration:i,ease:a}=C(t);for(let o of wi){let s=e.old?.radii[o]||e.new?.radii[o]||`0px`,c=e.new?.radii[o]||e.old?.radii[o]||`0px`;Yi(s)&&Yi(c)||n.push(new G({element:document.documentElement,name:o,pseudoElement:`::view-transition-group(${t})`,keyframes:[s,c],delay:r,duration:i,ease:a}))}}),e(new xr(n))}).catch(()=>D.updateCallbackDone.then(()=>e(new xr([])),t))})}function ea(e,t){for(let n of Xi[t]??[]){let t=e?.[n]?.options;if(t)return t}}function ta(e,t){let n={...e,...t};return t.duration!==void 0&&(t.visualDuration===void 0&&delete n.visualDuration,t.type===void 0&&delete n.type),n}var Z=[],na=null;function ra(){na=null;let[e]=Z;e&&ia(e)}function ia(e){S(Z,e),na=e,$i(e).then(t=>(e.notifyReady(t),t.finished)).catch(t=>e.notifyReject(t)).finally(ra)}function aa(){for(let e=Z.length-1;e>=0;e--){let t=Z[e],{interrupt:n}=t.options;if(n===`immediate`){let n=Z.slice(0,e+1).map(e=>e.update),r=Z.slice(e+1);t.update=()=>{n.forEach(e=>e())},Z=[t,...r];break}}(!na||Z[0]?.options.interrupt===`immediate`)&&ra()}function oa(e){Z.push(e),ki.render(aa)}var sa=class{constructor(e,t={}){this.currentSubject=`root`,this.targets=new Map,this.resolveDefs=new Set,this.cropOverride=new Map,this.pairs=new Map,this.classNames=new Map,this.flatGroups=new Set,this.notifyReady=E,this.notifyReject=E,this.readyPromise=new Promise((e,t)=>{this.notifyReady=e,this.notifyReject=t}),this.update=e,this.options={interrupt:`wait`,...t},this.readyPromise.catch(E),oa(this)}add(e,t){return this.currentSubject=e,this.resolveDefs.add(e),t!==void 0&&this.pairs.set(e,t),this.targets.has(e)||this.targets.set(e,{}),this}crop(e=!0){return this.cropOverride.set(this.currentSubject,e),this}group(e=!0){return e?this.flatGroups.delete(this.currentSubject):this.flatGroups.add(this.currentSubject),this}class(e){return this.classNames.set(this.currentSubject,e),this}layout(e={}){return this.updateTarget(`layout`,{},e),this}enter(e,t){return this.updateTarget(`enter`,e,t),this}exit(e,t){return this.updateTarget(`exit`,e,t),this}new(e,t){return this.updateTarget(`new`,e,t),this}old(e,t){return this.updateTarget(`old`,e,t),this}updateTarget(e,t,n={}){let{currentSubject:r,targets:i}=this;i.has(r)||i.set(r,{});let a=i.get(r);a[e]={keyframes:t,options:n}}then(e,t){return this.readyPromise.then(e,t)}};function ca(e,t={}){return new sa(e,t)}var la=()=>({min:0,max:0}),ua=()=>({x:la(),y:la()}),da=new WeakMap;function fa(e){return typeof e==`object`&&!!e&&typeof e.start==`function`}function pa(e){return typeof e==`string`||Array.isArray(e)}var ma=[`initial`,`animate`,`whileInView`,`whileFocus`,`whileHover`,`whileTap`,`whileDrag`,`exit`];function ha(e){return fa(e.animate)||ma.some(t=>pa(e[t]))}function ga(e){return!!(ha(e)||e.variants)}function _a(e,t,n){for(let r in t){let i=t[r],a=n[r];if(J(i))e.addValue(r,i);else if(J(a))e.addValue(r,K(i,{owner:e}));else if(a!==i){if(e.hasValue(r)){let t=e.getValue(r);t.liveStyle===!0?t.jump(i):t.hasAnimated||t.set(i)}else{let t=e.getStaticValue(r);e.addValue(r,K(t===void 0?i:t,{owner:e}))}}}for(let r in n)t[r]===void 0&&e.removeValue(r);return t}var va={current:null},ya={current:!1},ba=typeof window<`u`;function xa(){if(ya.current=!0,ba){if(window.matchMedia){let e=window.matchMedia(`(prefers-reduced-motion)`),t=()=>va.current=e.matches;e.addEventListener(`change`,t),t()}else va.current=!1}}var Sa=[`AnimationStart`,`AnimationComplete`,`Update`,`BeforeLayoutMeasure`,`LayoutMeasure`,`LayoutAnimationStart`,`LayoutAnimationComplete`],Ca={},wa=class{scrapeMotionValuesFromProps(e,t,n){return{}}constructor({parent:e,props:t,presenceContext:n,reducedMotionConfig:r,skipAnimations:i,blockInitialAnimation:a,visualState:o},s={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=Gn,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify(`Update`,this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{let e=j.now();this.renderScheduledAt<e&&(this.renderScheduledAt=e,A.render(this.render,!1,!0))};let{latestValues:c,renderState:l}=o;this.latestValues=c,this.baseTarget={...c},this.initialValues=t.initial?{...c}:{},this.renderState=l,this.parent=e,this.props=t,this.presenceContext=n,this.depth=e?e.depth+1:0,this.reducedMotionConfig=r,this.skipAnimationsConfig=i,this.options=s,this.blockInitialAnimation=!!a,this.isControllingVariants=ha(t),this.isVariantNode=ga(t),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);let{willChange:u,...d}=this.scrapeMotionValuesFromProps(t,{},this);for(let e in d){let t=d[e];c[e]!==void 0&&J(t)&&t.set(c[e])}}mount(e){if(this.hasBeenMounted)for(let e in this.initialValues)this.values.get(e)?.jump(this.initialValues[e]),this.latestValues[e]=this.initialValues[e];this.current=e,da.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((e,t)=>this.bindToMotionValue(t,e)),this.reducedMotionConfig===`never`?this.shouldReduceMotion=!1:this.reducedMotionConfig===`always`?this.shouldReduceMotion=!0:(ya.current||xa(),this.shouldReduceMotion=va.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection&&this.projection.unmount(),Le(this.notifyUpdate),Le(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(let e in this.events)this.events[e].clear();for(let e in this.features){let t=this.features[e];t&&(t.unmount(),t.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),this.enteringChildren??=new Set,this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,t){if(this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)(),t.accelerate&&pr.has(e)&&this.current instanceof HTMLElement){let{factory:n,keyframes:r,times:i,ease:a,duration:o}=t.accelerate,s=new G({element:this.current,name:e,keyframes:r,times:i,ease:a,duration:O(o)}),c=n(s);this.valueSubscriptions.set(e,()=>{c(),s.cancel()});return}let n=Pn.has(e);n&&this.onBindTransform&&this.onBindTransform();let r=t.on(`change`,t=>{this.latestValues[e]=t,this.props.onUpdate&&A.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()}),i;typeof window<`u`&&window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,e,t)),this.valueSubscriptions.set(e,()=>{r(),i&&i()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e=`animation`;for(e in Ca){let t=Ca[e];if(!t)continue;let{isEnabled:n,Feature:r}=t;if(!this.features[e]&&r&&n(this.props)&&(this.features[e]=new r(this)),this.features[e]){let t=this.features[e];t.isMounted?t.update():(t.mount(),t.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):ua()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,t){this.latestValues[e]=t}update(e,t){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=t;for(let t=0;t<Sa.length;t++){let n=Sa[t];this.propEventSubscriptions[n]&&(this.propEventSubscriptions[n](),delete this.propEventSubscriptions[n]);let r=e[`on`+n];r&&(this.propEventSubscriptions[n]=this.on(n,r))}this.prevMotionValues=_a(this,this.scrapeMotionValuesFromProps(e,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(e){let t=this.getClosestVariantNode();if(t)return t.variantChildren&&t.variantChildren.add(e),()=>t.variantChildren.delete(e)}addValue(e,t){let n=this.values.get(e);t!==n&&(n&&this.removeValue(e),this.bindToMotionValue(e,t),this.values.set(e,t),this.latestValues[e]=t.get())}removeValue(e){this.values.delete(e);let t=this.valueSubscriptions.get(e);t&&(t(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,t){if(this.props.values&&this.props.values[e])return this.props.values[e];let n=this.values.get(e);return n===void 0&&t!==void 0&&(n=K(t===null?void 0:t,{owner:this}),this.addValue(e,n)),n}readValue(e,t){let n=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return n!=null&&(typeof n==`string`&&(ee(n)||ne(n))?n=parseFloat(n):!Fi(n)&&z.test(t)&&(n=bi(e,t)),this.setBaseTarget(e,J(n)?n.get():n)),J(n)?n.get():n}setBaseTarget(e,t){this.baseTarget[e]=t}getBaseTarget(e){let{initial:t}=this.props,n;if(typeof t==`string`||typeof t==`object`){let r=Gr(this.props,t,this.presenceContext?.custom);r&&(n=r[e])}if(t&&n!==void 0)return n;let r=this.getBaseTargetFromProps(this.props,e);return r!==void 0&&!J(r)?r:this.initialValues[e]!==void 0&&n===void 0?void 0:this.baseTarget[e]}on(e,t){return this.events[e]||(this.events[e]=new ae),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t)}scheduleRenderMicrotask(){ki.render(this.render)}},Ta=class extends wa{constructor(){super(...arguments),this.KeyframeResolver=Ci}sortInstanceNodePosition(e,t){return e.compareDocumentPosition(t)&2?1:-1}getBaseTargetFromProps(e,t){let n=e.style;return n?n[t]:void 0}removeValueFromRenderState(e,{vars:t,style:n}){delete t[e],delete n[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);let{children:e}=this.props;J(e)&&(this.childSubscription=e.on(`change`,e=>{this.current&&(this.current.textContent=`${e}`)}))}};function Ea({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function Da(e,t){if(!t)return e;let n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function Oa(e,t){return Ea(Da(e.getBoundingClientRect(),t))}var ka={x:`translateX`,y:`translateY`,z:`translateZ`,transformPerspective:`perspective`},Aa=Nn.length;function ja(e,t,n){let r=``,i=!0;for(let a=0;a<Aa;a++){let o=Nn[a],s=e[o];if(s===void 0)continue;let c=!0;if(typeof s==`number`)c=s===+!!o.startsWith(`scale`);else{let e=parseFloat(s);c=o.startsWith(`scale`)?e===1:e===0}if(!c||n){let e=Oi(s,gi[o]);if(!c){i=!1;let t=ka[o]||o;r+=`${t}(${e}) `}n&&(t[o]=e)}}let a=e.pathRotation;return a&&(i=!1,r+=`rotate(${Oi(a,gi.pathRotation)}) `),r=r.trim(),n?r=n(t,i?``:r):i&&(r=`none`),r}function Ma(e,t,n){let{style:r,vars:i,transformOrigin:a}=e,o=!1,s=!1;for(let e in t){let n=t[e];if(Pn.has(e)){o=!0;continue}if(Ue(e)){i[e]=n;continue}{let t=Oi(n,gi[e]);e.startsWith(`origin`)?(s=!0,a[e]=t):r[e]=t}}if(t.transform||(o||n?r.transform=ja(t,e.transform,n):r.transform&&=`none`),s){let{originX:e=`50%`,originY:t=`50%`,originZ:n=0}=a;r.transformOrigin=`${e} ${t} ${n}`}}function Na(e,{style:t,vars:n},r,i){let a=e.style,o;for(o in t)a[o]=t[o];for(o in i?.applyProjectionStyles(a,r),n)a.setProperty(o,n[o])}function Pa(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}var Fa={correct:(e,t)=>{if(!t.target)return e;if(typeof e==`string`){if(F.test(e))e=parseFloat(e);else return e}return`${Pa(e,t.target.x)}% ${Pa(e,t.target.y)}%`}},Ia={correct:(e,{treeScale:t,projectionDelta:n})=>{let r=e,i=z.parse(e);if(i.length>5)return r;let a=z.createTransformer(e),o=typeof i[0]==`number`?0:1,s=n.x.scale*t.x,c=n.y.scale*t.y;i[0+o]/=s,i[1+o]/=c;let l=Ot(s,c,.5);return typeof i[2+o]==`number`&&(i[2+o]/=l),typeof i[3+o]==`number`&&(i[3+o]/=l),a(i)}},La={borderRadius:{...Fa,applyTo:[...wi]},borderTopLeftRadius:Fa,borderTopRightRadius:Fa,borderBottomLeftRadius:Fa,borderBottomRightRadius:Fa,boxShadow:Ia};function Ra(e,{layout:t,layoutId:n}){return Pn.has(e)||e.startsWith(`origin`)||(t||n!==void 0)&&(!!La[e]||e===`opacity`)}function za(e,t,n){let r=e.style,i=t?.style,a={};if(!r)return a;for(let t in r)(J(r[t])||i&&J(i[t])||Ra(t,e)||n?.getValue(t)?.liveStyle!==void 0)&&(a[t]=r[t]);return a}function Ba(e){return window.getComputedStyle(e)}var Va=class extends Ta{constructor(){super(...arguments),this.type=`html`,this.renderInstance=Na}mount(e){e.style,super.mount(e)}readValueFromInstance(e,t){if(Pn.has(t))return this.projection?.isProjecting?kn(t):jn(e,t);{let n=Ba(e),r=(Ue(t)?n.getPropertyValue(t):n[t])||0;return typeof r==`string`?r.trim():r}}measureInstanceViewportBox(e,{transformPagePoint:t}){return Oa(e,t)}build(e,t,n){Ma(e,t,n.transformTemplate)}scrapeMotionValuesFromProps(e,t,n){return za(e,t,n)}};function Ha(e,t){return e in t}var Ua=class extends wa{constructor(){super(...arguments),this.type=`object`}readValueFromInstance(e,t){if(Ha(t,e)){let n=e[t];if(typeof n==`string`||typeof n==`number`)return n}}getBaseTargetFromProps(){}removeValueFromRenderState(e,t){delete t.output[e]}measureInstanceViewportBox(){return ua()}build(e,t){Object.assign(e.output,t)}renderInstance(e,{output:t}){Object.assign(e,t)}sortInstanceNodePosition(){return 0}},Wa={offset:`stroke-dashoffset`,array:`stroke-dasharray`},Ga={offset:`strokeDashoffset`,array:`strokeDasharray`};function Ka(e,t,n=1,r=0,i=!0){e.pathLength=1;let a=i?Wa:Ga;e[a.offset]=`${-r}`,e[a.array]=`${t} ${n}`}var qa=[`offsetDistance`,`offsetPath`,`offsetRotate`,`offsetAnchor`];function Ja(e,{attrX:t,attrY:n,attrScale:r,pathLength:i,pathSpacing:a=1,pathOffset:o=0,...s},c,l,u){if(Ma(e,s,l),c){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};let{attrs:d,style:f}=e;d.transform&&(f.transform=d.transform,delete d.transform),(f.transform||d.transformOrigin)&&(f.transformOrigin=d.transformOrigin??`50% 50%`,delete d.transformOrigin),f.transform&&(f.transformBox=u?.transformBox??`fill-box`,delete d.transformBox);for(let e of qa)d[e]!==void 0&&(f[e]=d[e],delete d[e]);t!==void 0&&(d.x=t),n!==void 0&&(d.y=n),r!==void 0&&(d.scale=r),i!==void 0&&Ka(d,i,a,o,!1)}var Ya=new Set([`baseFrequency`,`diffuseConstant`,`kernelMatrix`,`kernelUnitLength`,`keySplines`,`keyTimes`,`limitingConeAngle`,`markerHeight`,`markerWidth`,`numOctaves`,`targetX`,`targetY`,`surfaceScale`,`specularConstant`,`specularExponent`,`stdDeviation`,`tableValues`,`viewBox`,`gradientTransform`,`pathLength`,`startOffset`,`textLength`,`lengthAdjust`]),Xa=e=>typeof e==`string`&&e.toLowerCase()===`svg`;function Za(e,t,n,r){Na(e,t,void 0,r);for(let n in t.attrs)e.setAttribute(Ya.has(n)?n:ei(n),t.attrs[n])}function Qa(e,t,n){let r=za(e,t,n);for(let n in e)if(J(e[n])||J(t[n])){let t=Nn.indexOf(n)===-1?n:`attr`+n.charAt(0).toUpperCase()+n.substring(1);r[t]=e[n]}return r}var $a=class extends Ta{constructor(){super(...arguments),this.type=`svg`,this.isSVGTag=!1,this.measureInstanceViewportBox=ua}getBaseTargetFromProps(e,t){return e[t]}readValueFromInstance(e,t){if(Pn.has(t)){let e=vi(t);return e&&e.default||0}return t=Ya.has(t)?t:ei(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,n){return Qa(e,t,n)}build(e,t,n){Ja(e,t,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(e,t,n,r){Za(e,t,n,r)}mount(e){this.isSVGTag=Xa(e.tagName),super.mount(e)}};function eo(e,t,n){let r=J(e)?e:K(e);return r.start(Br(``,r,t,n)),r.animation}function to(e){return typeof e==`object`&&!Array.isArray(e)}function no(e,t,n,r){return e==null?[]:typeof e==`string`&&to(t)?Di(e,n,r):e instanceof NodeList?Array.from(e):Array.isArray(e)?e.filter(e=>e!=null):[e]}function ro(e,t,n){return e*(t+1)+n*t}function io(e,t,n,r){return typeof t==`number`?t:t.startsWith(`-`)||t.startsWith(`+`)?Math.max(0,e+parseFloat(t)):t===`<`?n:t.startsWith(`<`)?Math.max(0,n+parseFloat(t.slice(1))):r.get(t)??e}function ao(e,t,n){for(let r=0;r<e.length;r++){let i=e[r];i.at>t&&i.at<n&&(S(e,i),r--)}}function oo(e,t,n,r,i,a){ao(e,i,a);for(let o=0;o<t.length;o++)e.push({value:t[o],at:Ot(i,a,r[o]),easing:Oe(n,o)})}function so(e,t,n=0){let r=t+1+t*n;for(let t=0;t<e.length;t++)e[t]=e[t]/r}function co(e,t){return e.at===t.at?e.value===null?1:t.value===null?-1:0:e.at-t.at}var lo=`easeInOut`,uo=20;function fo(e,{defaultTransition:t={},...n}={},r,i){let a=t.duration||.3,o=new Map,s=new Map,c={},l=new Map,u=0,d=0,f=0;for(let n=0;n<e.length;n++){let o=e[n];if(typeof o==`string`){l.set(o,d);continue}if(!Array.isArray(o)){l.set(o.name,io(d,o.at,u,l));continue}let[p,m,h={}]=o;h.at!==void 0&&(d=io(d,h.at,u,l));let g=0,_=(e,n,r,o=0,s=0)=>{let c=ho(e),{delay:l=0,times:u=un(c),type:p=t.type||`keyframes`,repeat:m,repeatType:h,repeatDelay:_=0,...v}=n,{ease:y=t.ease||`easeOut`,duration:b}=n,x=typeof l==`function`?l(o,s):l,S=c.length,C=nr(p)?p:i?.[p||`keyframes`];if(S<=2&&C){let e=100;if(S===2&&vo(c)){let t=c[1]-c[0];e=Math.abs(t)}let n={...t,...v};b!==void 0&&(n.duration=O(b));let r=qt(n,e,C);y=r.ease,b=r.duration}b??=a;let w=d+x;u.length===1&&u[0]===0&&(u[1]=1);let T=u.length-c.length;if(T>0&&ln(u,T),c.length===1&&c.unshift(null),m&&`${m}${uo}`,m&&m<uo){let e=b>0?_/b:0;b=ro(b,m,_);let t=[...c],n=[...u];y=Array.isArray(y)?[...y]:[y];let r=[...y],i=h===`reverse`||h===`mirror`,a=t,o=r;i&&(a=[...t].reverse(),h===`reverse`&&(o=[...r].reverse().map(e=>typeof e==`function`?ge(e):e)));for(let s=0;s<m;s++){let l=i&&s%2==0,d=l?a:t,f=l?o:r,p=(s+1)*(1+e);e>0&&(c.push(c[c.length-1]),u.push(p),y.push(`linear`)),c.push(...d);for(let e=0;e<d.length;e++)u.push(n[e]+p),y.push(e===0?`linear`:Oe(f,e-1))}so(u,m,e)}let ee=w+b;oo(r,c,y,u,w,ee),g=Math.max(x+b,g),f=Math.max(ee,f)};if(J(p)){let e=po(p,s);_(m,h,mo(`default`,e))}else{let e=no(p,m,r,c),t=e.length;for(let n=0;n<t;n++){m=m,h=h;let r=e[n],i=po(r,s);for(let e in m)_(m[e],go(h,e),mo(e,i),n,t)}}u=d,d+=g}return s.forEach((e,r)=>{for(let i in e){let a=e[i];a.sort(co);let s=[],c=[],l=[];for(let e=0;e<a.length;e++){let{at:t,value:n,easing:r}=a[e];s.push(n),c.push(ie(0,f,t)),l.push(r||`easeOut`)}c[0]!==0&&(c.unshift(0),s.unshift(s[0]),l.unshift(lo)),c[c.length-1]!==1&&(c.push(1),s.push(null)),o.has(r)||o.set(r,{keyframes:{},transition:{}});let u=o.get(r);u.keyframes[i]=s;let{type:d,...p}=t;u.transition[i]={...p,duration:f,ease:l,times:c,...n}}}),o}function po(e,t){return!t.has(e)&&t.set(e,{}),t.get(e)}function mo(e,t){return t[e]||(t[e]=[]),t[e]}function ho(e){return Array.isArray(e)?e:[e]}function go(e,t){return e&&e[t]?{...e,...e[t]}:{...e}}var _o=e=>typeof e==`number`,vo=e=>e.every(_o);function yo(e){let t={presenceContext:null,props:{},visualState:{renderState:{transform:{},transformOrigin:{},style:{},vars:{},attrs:{}},latestValues:{}}},n=Mi(e)&&!Ni(e)?new $a(t):new Va(t);n.mount(e),da.set(e,n)}function bo(e){let t=new Ua({presenceContext:null,props:{},visualState:{renderState:{output:{}},latestValues:{}}});t.mount(e),da.set(e,t)}function xo(e,t){return J(e)||typeof e==`number`||typeof e==`string`&&!to(t)}function So(e,t,n,r){let i=[];if(xo(e,t))i.push(eo(e,to(t)&&t.default||t,n&&(n.default||n)));else{if(e==null)return i;let a=no(e,t,r),o=a.length;for(let e=0;e<o;e++){let r=a[e],s=r instanceof Element?yo:bo;da.has(r)||s(r);let c=da.get(r),l={...n};`delay`in l&&typeof l.delay==`function`&&(l.delay=l.delay(e,o)),i.push(...ii(c,{...t,transition:l},{}))}}return i}function Co(e,t,n){let r=[];return fo(e.map(e=>{if(Array.isArray(e)&&typeof e[0]==`function`){let t=e[0],n=K(0);return n.on(`change`,t),e.length===1?[n,[0,1]]:e.length===2?[n,[0,1],e[1]]:[n,e[1],e[2]]}return e}),t,n,{spring:V}).forEach(({keyframes:e,transition:t},n)=>{r.push(...So(n,e,t))}),r}function wo(e){return Array.isArray(e)&&e.some(Array.isArray)}function To(e={}){let{scope:t,reduceMotion:n,skipAnimations:r}=e;function i(e,i,a){let o=[],s,c={};if(n!==void 0&&(c.reduceMotion=n),r!==void 0&&(c.skipAnimations=r),wo(e)){let{onComplete:n,...r}=i||{};typeof n==`function`&&(s=n),o=Co(e,{...c,...r},t)}else{let{onComplete:n,...r}=a||{};typeof n==`function`&&(s=n),o=So(e,i,{...c,...r},t)}let l=new Cr(o);return s&&l.finished.then(s),t&&(t.animations.push(l),l.finished.then(()=>{S(t.animations,l)})),l}return i}var Eo=To();function Do(e,t,n,r){if(e==null)return[];let i=Di(e,r),a=i.length,o=[];for(let e=0;e<a;e++){let r=i[e],s={...n};typeof s.delay==`function`&&(s.delay=s.delay(e,a));for(let e in t){let n=t[e];Array.isArray(n)||(n=[n]);let i={...q(s,e)};i.duration&&=O(i.duration),i.delay&&=O(i.delay);let a=Dr(r),c=Er(e,i.pseudoElement||``),l=a.get(c);l&&l.stop(),o.push({map:a,key:c,unresolvedKeyframes:n,options:{...i,element:r,name:e,allowFlatten:!s.type&&!s.ease}})}}for(let e=0;e<o.length;e++){let{unresolvedKeyframes:t,options:n}=o[e],{element:r,name:i,pseudoElement:a}=n;!a&&t[0]===null&&(t[0]=ji(r,i)),xn(t),Ei(t,i),!a&&t.length<2&&t.unshift(ji(r,i)),n.keyframes=t}let s=[];for(let e=0;e<o.length;e++){let{map:t,key:n,options:r}=o[e],i=new G(r);t.set(n,i),i.finished.finally(()=>t.delete(n)),s.push(i)}return s}var Oo=(e=>{function t(t,n,r){return new Cr(Do(t,n,r,e))}return t})(),ko=(e,t)=>({finished:e,then:e.then.bind(e),...t}),Q=e=>ko((async()=>{await e?.()})(),{cancel(){},stop(){},complete(){}}),Ao=(e,t)=>{let n=!1,r=()=>{n||(n=!0,t?.())},i=()=>{},a=new Promise(e=>{i=e}),o=e.finished.then(()=>{},()=>{}),s=Promise.race([o,a]).finally(r),c=e=>{try{e()}finally{i(),r()}};return ko(s,{cancel(){c(()=>e.cancel())},stop(){c(()=>e.stop())},complete(){c(()=>e.complete())}})},jo=(...e)=>ko(Promise.allSettled(e.map(e=>e.finished)).then(()=>{}),{cancel(){e.forEach(e=>e.cancel())},stop(){e.forEach(e=>e.stop())},complete(){e.forEach(e=>e.complete())}}),Mo=(...e)=>{let t=!1,n=!1,r=null;return ko((async()=>{for(let i of e){if(t)break;r=i(),n&&r.complete(),await r.finished.catch(()=>{})}})(),{cancel(){t=!0,r?.cancel()},stop(){t=!0,r?.stop()},complete(){n=!0,r?.complete()}})},$=new WeakMap,No=e=>{let t=$.get(e);if(t)return t.handle.stop(),$.get(e)===t&&$.delete(e),t.properties},Po=(e,t,n,r,i)=>{let a=Ao(t(No(e))),o,s=()=>o.stop(),c=()=>{r?.removeEventListener(`abort`,s),$.get(e)?.handle===o&&(i?.(),$.get(e)?.handle===o&&$.delete(e))};return o=ko(a.finished.finally(c),{cancel(){a.cancel(),c()},stop(){a.stop(),c()},complete(){a.complete()}}),$.set(e,{handle:o,properties:n}),r?.addEventListener(`abort`,s,{once:!0}),o},Fo=e=>!(e instanceof Element)&&typeof e==`object`&&!!e&&`signal`in e,Io=e=>{let t=e instanceof Element?e:e.el;if(!(t instanceof Element))throw TypeError(`Motion subject requires an Element target.`);return t},Lo=(e,t)=>{let n=Io(e);if(!t)return n;if(t instanceof Element)return t;let r=Fo(e)?e.root:n;if(!(r instanceof Element))throw TypeError(`Motion transition subject requires an Element root.`);let i=r.matches(t)?r:r.querySelector(t);if(!i)throw Error(`Motion target not found: ${t}`);return i},Ro=e=>Fo(e)?e.signal:null,zo=e=>Array.isArray(e)?e.at(-1):e,Bo=e=>Object.fromEntries(Object.entries(e).map(([e,t])=>[e,Array.isArray(t)?[...t]:t])),Vo=(e,t)=>t===`height`?`${e.getBoundingClientRect().height}px`:t===`width`?`${e.getBoundingClientRect().width}px`:getComputedStyle(e)[t],Ho=(e,t)=>Array.isArray(e)?[t,...e.slice(1)]:[t,e],Uo=(e,t)=>{let n=Lo(e,t.target);if(!(n instanceof HTMLElement))throw TypeError(`Size motion requires an HTMLElement target.`);let r=t.signal??Ro(e);if(r?.aborted)return t.cleanup?.(),Q();let a=Bo(t.keyframes),o=new Set(Object.keys(a));if(o.size===0)return t.cleanup?.(),Q();if(y()){No(n);let e=Object.fromEntries(Object.entries(t.keyframes).flatMap(([e,t])=>e===`opacity`?[]:[[e,zo(t)]]));Object.entries(e).forEach(([e,t])=>{n.style[e]=typeof t==`number`?`${t}px`:String(t)}),Object.keys(e).length>0&&Oo(n,e,{duration:0}).complete();let a=t.keyframes.opacity;return a===void 0?(t.cleanup?.(),Q()):Po(n,()=>Oo(n,{opacity:typeof a==`number`?a:[...a]},{...i.feedback,type:`tween`}),new Set([`opacity`]),r,t.cleanup)}let s=new Map([...o].map(e=>[e,Vo(n,e)])),c=t.role??`layout`;return Po(n,e=>{for(let t of o)e?.has(t)&&(a[t]=Ho(a[t],s.get(t)));return Oo(n,a,{...p(n,c),...f(c,n)?{type:V}:{type:`tween`},...t.transition})},o,r,t.cleanup)},Wo=e=>typeof e==`object`&&!!e&&`initial`in e,Go=e=>{let t={},n=new Map,r=new Map,i;Object.keys(e.values).forEach(r=>{let i=e.values[r],a=Wo(i)?i.initial:i;t[r]=K(a),Wo(i)&&i.transition&&n.set(r,i.transition)});let a=()=>Object.fromEntries(Object.keys(t).map(e=>[e,t[e].get()])),o=e=>{r.get(e)?.stop(),r.delete(e)},s=e=>{Object.keys(e).forEach(n=>{let r=e[n];r!==void 0&&t[n]&&(o(n),t[n].set(r))})};return{mount:n=>{i?.();let r=new Map,o=()=>{Object.entries(e.style(a())).forEach(([e,t])=>{r.has(e)||r.set(e,e.startsWith(`--`)?n.style.getPropertyValue(e):String(n.style[e]??``)),e.startsWith(`--`)?n.style.setProperty(e,String(t)):n.style[e]=String(t)})},s=Object.values(t).map(e=>e.on(`change`,o));o();let c=!0,l=()=>{c&&(c=!1,s.forEach(e=>e()),r.forEach((e,t)=>{t.startsWith(`--`)?n.style.setProperty(t,e):n.style[t]=e}),i===l&&(i=void 0))};return i=l,l},set:s,animate:(i,a)=>{if(y(e.reducedMotion))return s(i),Q();let c=Object.keys(i).flatMap(e=>{let s=i[e];if(s===void 0||!t[e])return[];o(e);let c=Ao(Eo(t[e],s,{...n.get(e),...a}));return r.set(e,c),c.finished.finally(()=>{r.get(e)===c&&r.delete(e)}),[c]});return c.length?jo(...c):Q()},current:a,destroy:()=>{i?.(),r.forEach(e=>e.cancel()),r.clear()}}},Ko=new WeakMap,qo=(e,t)=>{let n=Lo(e,t.target);if(!(n instanceof HTMLElement))throw TypeError(`Motion resize requires an HTMLElement target.`);let r=Lo(n,t.measure??n);if(r===n)throw Error(`Motion resize requires a separate measurement element.`);if(!(r instanceof HTMLElement))throw TypeError(`Motion resize measurement requires an HTMLElement.`);let i=Ro(e);if(i?.aborted)return Q();let a=Math.max(r.scrollHeight,r.getBoundingClientRect().height),o=n.getBoundingClientRect().height,s=No(n),c=s?.has(`height`)?o:t.from===`content`?a:0,l=t.to===`content`?a:0;Ko.has(n)||Ko.set(n,{height:n.style.height,opacity:n.style.opacity,overflow:n.style.overflow,willChange:n.style.willChange});let u=y(),d=t.speed===void 0?void 0:h(t.speed,n),p={height:[c,l]};n.style.overflow=`hidden`,n.style.willChange=u?`opacity`:`height, opacity`,t.opacity!==void 0&&(p.opacity=s?.has(`opacity`)?Array.isArray(t.opacity)?t.opacity.at(-1):t.opacity:Array.isArray(t.opacity)?[...t.opacity]:t.opacity);let m=t.role??`resize`,g=d===void 0?{}:`stiffness`in d?d:f(m)?{visualDuration:d.duration}:d,_=()=>{let e=Ko.get(n);e&&Object.assign(n.style,e),Ko.delete(n)};return Uo(e,{target:n,keyframes:p,role:m,transition:{...g,...t.transition},signal:i,cleanup:_})},Jo=e=>Object.fromEntries(Object.entries(e).map(([e,t])=>[e,Array.isArray(t)?[...t]:t])),Yo=(e,t=new Set)=>Object.fromEntries(Object.entries(Jo(e)).map(([e,n])=>[e,t.has(e)&&Array.isArray(n)?g(n):n])),Xo=new Set(`bottom.filter.height.maxHeight.maxWidth.inset.insetBlock.insetInline.left.right.top.transform.width.translate.x.y.z.scale.scaleX.scaleY.rotate.rotateX.rotateY.skew.skewX.skewY`.split(`.`)),Zo=e=>Object.fromEntries(Object.entries(Jo(e)).flatMap(([e,t])=>Xo.has(e)?[]:[[e,t]])),Qo=e=>Object.fromEntries(Object.entries(Jo(e)).flatMap(([e,t])=>Xo.has(e)?[[e,Array.isArray(t)?g(t):t]]:[])),$o=(e,t,i,a,o)=>{let s=o?`feedback`:t,c=s===void 0?{type:`tween`,ease:r.out}:{...d(e,s),type:f(s,e)?V:`tween`},l=i===void 0?void 0:h(o?`fast`:i,e),u=l===void 0?c:`stiffness`in l?{...c,type:V,...l}:{...c,duration:l.duration};return{...u.duration===void 0&&u.type===void 0?{duration:n.moderate.duration}:{},...u,...a}},es=(e,t,n)=>{let r=Lo(e,t.target),i=Ro(e);if(i?.aborted)return Q();let a=y();if(a){let e=Qo(t.keyframes);Object.keys(e).length>0&&Eo(r,e,{duration:0}).complete()}let o=a?Zo(t.keyframes):Jo(t.keyframes);return Object.keys(o).length===0?(Eo(r,Object.fromEntries(Object.entries(Jo(t.keyframes)).map(([e,t])=>[e,Array.isArray(t)?g(t):t])),{duration:0}).complete(),Q()):Po(r,e=>Eo(r,Yo(o,e),$o(r,t.role??n.role,t.speed??n.speed,{...n.transition,...t.transition},a)),new Set(Object.keys(o)),i)},ts=(e,t,n)=>{if(t.kind===`animate`)return es(e,t,n);let r=t.speed??n.speed??t.options.speed,i=t.role??n.role??t.options.role,a={...n.transition,...t.options.transition,...t.transition};return qo(e,{...t.options,...r===void 0?{}:{speed:r},...i===void 0?{}:{role:i},...Object.keys(a).length===0?{}:{transition:a}})},ns=(e,t)=>t===void 0?{keyframes:e}:{target:e,keyframes:t},rs=class e{#e;#t;#n;constructor(e,t=[],n={}){this.#e=e,this.#t=t,this.#n=n}#r(t,n){if(!n||this.#t.length===0)return new e(this.#e,[...this.#t,[t]],this.#n);let r=this.#t.slice(0,-1),i=this.#t.at(-1)??[];return new e(this.#e,[...r,[...i,t]],this.#n)}#i(t){let n=this.#t.at(-1);if(!n?.length)throw Error(`Declare a motion segment before configuring it.`);let r=this.#t.slice(0,-1);return new e(this.#e,[...r,[...n.slice(0,-1),t(n.at(-1))]],this.#n)}animate(e,t){return this.#r({kind:`animate`,...ns(e,t)},!1)}with(e,t){return this.#r({kind:`animate`,...ns(e,t)},!0)}then(e,t){return this.animate(e,t)}resize(e){return this.#r({kind:`resize`,options:e},!1)}speed(e){return this.#i(t=>({...t,speed:e}))}role(e){return this.#i(t=>({...t,role:e}))}transition(e){return this.#i(t=>({...t,transition:{...t.transition,...e}}))}defaults(t){let n=t.speed??this.#n.speed,r=t.role??this.#n.role,i={...this.#n.transition,...t.transition};return new e(this.#e,this.#t,{...n===void 0?{}:{speed:n},...r===void 0?{}:{role:r},...Object.keys(i).length===0?{}:{transition:i}})}play(){return this.#t.length===0?Q():Mo(...this.#t.map(e=>()=>jo(...e.map(e=>ts(this.#e,e,this.#n)))))}},is=e=>new rs(e),as=e=>{let t=globalThis.CSS;return typeof t?.escape==`function`?t.escape(e):e.replaceAll(`\\`,`\\\\`).replaceAll(`"`,`\\"`)},os=t=>`[${e}="${as(t)}"]`,ss=e=>`[data-ui-${as(e)}]`,cs=e=>e instanceof Element?null:typeof e==`string`?e:`selector`in e?e.selector:`part`in e?ss(e.part):`key`in e?os(e.key):null,ls=e=>{if(e instanceof Element)return[e];let t=cs(e);return t?[t]:[]},us=(e=document,t)=>t?(Array.isArray(t)?t:[t]).flatMap(e=>{if(e instanceof Element)return[{subject:e}];if(typeof e==`object`&&`from`in e){let t=ls(e.from),n=ls(e.to);return t.flatMap((e,t)=>{let r=n[t]??n[0];return r?[{subject:e,newSubject:r}]:[]})}let t=cs(e);return t?[{subject:t}]:[]}):[],ds=async()=>{},fs=e=>{ds=async()=>{await e()}},ps=i.layout,ms={transform:[`none`,`none`]},hs=`[${e}], [${t}]`,gs=(e,t,n={})=>{if(typeof document.startViewTransition!=`function`||y(n.reducedMotion))return Q(e);let r=t??(n.layout||n.preset===`layout`?hs:null),a=us(n.scope??document,r),o=ca(e,{...i.layout,interrupt:`immediate`,...n.transition});return a.forEach(({subject:e,newSubject:t})=>{o.add(e,t),n.className&&o.class(n.className),typeof n.crop==`boolean`&&o.crop(n.crop),typeof n.group==`boolean`&&o.group(n.group),n.layout!==!1&&n.preset!==`none`&&o.layout(typeof n.layout==`object`?n.layout:ps);let r=n.newView??(n.preset===`stream`?ms:void 0),a=n.oldView??(n.preset===`stream`?ms:void 0),s=n.enter,c=n.exit;r&&o.new(r,i.feedback),a&&o.old(a,i.feedback),s&&o.enter(s,i.feedback),c&&o.exit(c,i.feedback)}),ko(Promise.resolve(o.then(()=>{},()=>{})),{cancel(){Ki().forEach(e=>e.cancel())},stop(){Ki().forEach(e=>e.pause())},complete(){Ki().forEach(e=>{try{e.finish()}catch{e.cancel()}})}})},_s=Object.assign(is,{presets:m,roles:i,speeds:n,easings:r,createController:Go,stop(e){No(e)},withReducedMotion:b,view:(e,t={})=>{let{targets:n,...r}=t;return gs(async()=>{await e(),await ds()},n,{preset:`layout`,...r})}});export{i as S,K as _,os as a,f as b,Ro as c,No as d,Q as f,Di as g,Eo as h,as as i,Lo as l,Oo as m,gs as n,is as o,jo as p,fs as r,Uo as s,_s as t,Po as u,V as v,p as x,y};
|
|
3
|
-
//# sourceMappingURL=motion-
|
|
2
|
+
`}Y.textContent=e,document.head.appendChild(Y),Wi={}},remove:()=>{Y&&Y.parentElement&&Y.parentElement.removeChild(Y)}};function Gi(e){let t=e.match(/::view-transition-(old|new|group-children|group|image-pair)\((.*?)\)/);return t?{layer:t[2],type:t[1]}:null}function Ki(){return document.getAnimations().filter(e=>{let{effect:t}=e;return!!t&&t.target===document.documentElement&&t.pseudoElement?.startsWith(`::view-transition`)})}function qi(e,t){return t.has(e)&&Object.keys(t.get(e)).length>0}var Ji=[`layout`,`enter`,`exit`,`new`,`old`],Yi=e=>e.split(` `).every(e=>parseFloat(e)===0),Xi={group:[`layout`],new:[`new`,`enter`],old:[`old`,`exit`]},Zi={new:{opacity:0,scale:.85},old:{opacity:1,scale:1}},Qi=.2;function $i(e){let{update:t,targets:n,resolveDefs:r,cropOverride:i,pairs:a,classNames:o,flatGroups:s,options:c}=e;if(!document.startViewTransition)return(async()=>(await t(),new xr([])))();let l=new Map,u=[],d=[],f=[],p=new Set,m=new Map,h=new Set,g=new Map,_=new Map,v=new Map,y=new Map,b=e=>{n.forEach((t,n)=>{let c=o.get(n),h=n===`root`||!r.has(n)?void 0:s.has(n)?`none`:`contain`,b;if(n===`root`||!r.has(n))b=[n];else if(a.has(n)){if(e===`old`)y.set(n,Di(n)),b=Vi(n,l,u,void 0,c,d,h,f,p),v.set(n,b);else{for(let e of y.get(n)??[])e.style?.removeProperty(`view-transition-name`),l.delete(e);b=Vi(a.get(n),l,u,v.get(n),c,d,h,f,p)}}else b=Vi(n,l,u,void 0,c,d,h,f,p);let x=i.get(n);b.forEach((n,r)=>{let i=m.get(n);m.set(n,i&&i!==t?{...i,...t}:t),x!==void 0&&g.set(n,x);let a=_.get(n)??{};a[e]=[r,b.length],_.set(n,a)})})},x=(e,t)=>{let n=_.get(e);return(t===`old`?n?.old:t===`new`?n?.new:n?.new??n?.old)??[-1,1]},S=(e,t,n,r,i)=>{let a=ta(q(c,n),q(ea(e,t)??{},n));return typeof a.delay==`function`&&(a.delay=a.delay(r,i)),a},C=e=>{let[t,n]=x(e,`group`),r=S(m.get(e),`group`,`layout`,t===-1?0:t,n);r.duration&&=O(r.duration);let{delay:i=0,duration:a,ease:o}=rr(r);return{delay:O(i),duration:a,ease:o}},w=new Map,T=e=>l.forEach((t,n)=>{let r=n,i=r.getBoundingClientRect?.();if(i&&i.height){let n=getComputedStyle(r),a={};for(let e of wi)a[e]=n[e];let o=w.get(t)??{};o[e]={width:i.width,height:i.height,radii:a},w.set(t,o)}}),ee=()=>{h.clear();for(let e of _.keys())e!==`root`&&(g.get(e)??te(e))&&h.add(e)},te=e=>{let t=w.get(e);return!t?.old||!t?.new||!t.old.height||!t.new.height?!1:Math.abs(t.old.width/t.old.height-t.new.width/t.new.height)>Qi},ne=()=>{qi(`root`,n)||X.set(`:root`,{"view-transition-name":`none`}),X.set(`::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*)`,{"animation-timing-function":`linear !important`}),h.forEach(e=>{X.set(`::view-transition-group(${e})`,{overflow:`clip`}),X.set(`::view-transition-old(${e}), ::view-transition-new(${e})`,{width:`100%`,height:`100%`,"object-fit":`cover`})}),p.forEach(e=>{X.set(`::view-transition-group-children(${e})`,{overflow:`clip`})}),X.commit()},re=()=>{Hi(u,d,f),X.remove()},E=async()=>{await t(),b(`new`),T(`new`),ee(),ne()},D;try{b(`old`),T(`old`),ne(),D=document.startViewTransition(E)}catch(e){return re(),Promise.reject(e)}return D.finished.finally(re),new Promise((e,t)=>{D.ready.then(()=>{let t=Ki(),n=[],r=new Set,i=new Set;m.forEach((e,t)=>{let a=_.get(t),o=!!a?.new&&!a?.old,s=!!a?.old&&!a?.new;for(let a of Ji){if(!e[a]||a===`enter`&&!o||a===`exit`&&!s)continue;let l=Ui(a),[u,d]=x(t,l);if(u===-1)continue;let{keyframes:f,options:p}=e[a];for(let[m,h]of Object.entries(f)){if(h==null)continue;if(m===`x`||m===`y`){ce(!1,`animateView() animates view-transition layers with CSS properties; the "${m}" shorthand has no effect - use transform, e.g. { transform: "translateX(40px)" }.`);continue}if(a===`new`&&o&&e.enter?.keyframes[m]!=null||a===`old`&&s&&e.exit?.keyframes[m]!=null)continue;let f=ta(q(c,m),q(p,m));if(!Array.isArray(h)){let t=a===`enter`?e.exit?.keyframes[m]:void 0,n=t==null?m===`opacity`||(l===`new`?o:s)?Zi[l]?.[m]:void 0:Array.isArray(t)?t[t.length-1]:t;n!==void 0&&(h=[n,h])}typeof f.delay==`function`&&(f.delay=f.delay(u,d)),f.duration&&=O(f.duration),f.delay&&=O(f.delay),n.push(new G({...f,element:document.documentElement,name:m,pseudoElement:`::view-transition-${l}(${t})`,keyframes:h})),r.add(`${t}:${l}`),m===`opacity`&&i.add(`${t}:${l}`)}}});for(let e of t){if(e.playState===`finished`)continue;let{effect:t}=e;if(!t||!(t instanceof KeyframeEffect))continue;let{pseudoElement:a}=t;if(!a)continue;let o=Gi(a);if(!o)continue;let s=m.get(o.layer);if(r.has(`${o.layer}:${o.type}`)){i.has(`${o.layer}:new`)&&i.has(`${o.layer}:old`)&&t.getKeyframes().some(e=>e.mixBlendMode)?n.push(new wr(e)):e.cancel();continue}let c=o.type===`old`?`new`:o.type===`new`?`old`:void 0;if(c&&r.has(`${o.layer}:${c}`)&&!i.has(`${o.layer}:${c}`)){e.cancel();continue}let l=_.get(o.layer),u=(o.type===`old`||o.type===`new`)&&!!l?.old&&!!l?.new,d;if(o.type.startsWith(`group`)){let{delay:e,duration:t,ease:n}=C(o.layer);d={delay:e,duration:t,easing:er(n,t)}}else{let e=u?`group`:o.type,[t,n]=x(o.layer,e),r=S(s,e,e===`group`?`layout`:``,t===-1?0:t,n),i=r.visualDuration;r.duration&&(r.duration=O(r.duration)),r=rr(r),d={delay:O(r.delay??0),duration:u&&i!==void 0?O(i):r.duration,easing:u?`linear`:er(r.ease,r.duration)}}t.updateTiming(d),n.push(new wr(e))}w.forEach((e,t)=>{if(!h.has(t))return;let{delay:r,duration:i,ease:a}=C(t);for(let o of wi){let s=e.old?.radii[o]||e.new?.radii[o]||`0px`,c=e.new?.radii[o]||e.old?.radii[o]||`0px`;Yi(s)&&Yi(c)||n.push(new G({element:document.documentElement,name:o,pseudoElement:`::view-transition-group(${t})`,keyframes:[s,c],delay:r,duration:i,ease:a}))}}),e(new xr(n))}).catch(()=>D.updateCallbackDone.then(()=>e(new xr([])),t))})}function ea(e,t){for(let n of Xi[t]??[]){let t=e?.[n]?.options;if(t)return t}}function ta(e,t){let n={...e,...t};return t.duration!==void 0&&(t.visualDuration===void 0&&delete n.visualDuration,t.type===void 0&&delete n.type),n}var Z=[],na=null;function ra(){na=null;let[e]=Z;e&&ia(e)}function ia(e){S(Z,e),na=e,$i(e).then(t=>(e.notifyReady(t),t.finished)).catch(t=>e.notifyReject(t)).finally(ra)}function aa(){for(let e=Z.length-1;e>=0;e--){let t=Z[e],{interrupt:n}=t.options;if(n===`immediate`){let n=Z.slice(0,e+1).map(e=>e.update),r=Z.slice(e+1);t.update=()=>{n.forEach(e=>e())},Z=[t,...r];break}}(!na||Z[0]?.options.interrupt===`immediate`)&&ra()}function oa(e){Z.push(e),ki.render(aa)}var sa=class{constructor(e,t={}){this.currentSubject=`root`,this.targets=new Map,this.resolveDefs=new Set,this.cropOverride=new Map,this.pairs=new Map,this.classNames=new Map,this.flatGroups=new Set,this.notifyReady=E,this.notifyReject=E,this.readyPromise=new Promise((e,t)=>{this.notifyReady=e,this.notifyReject=t}),this.update=e,this.options={interrupt:`wait`,...t},this.readyPromise.catch(E),oa(this)}add(e,t){return this.currentSubject=e,this.resolveDefs.add(e),t!==void 0&&this.pairs.set(e,t),this.targets.has(e)||this.targets.set(e,{}),this}crop(e=!0){return this.cropOverride.set(this.currentSubject,e),this}group(e=!0){return e?this.flatGroups.delete(this.currentSubject):this.flatGroups.add(this.currentSubject),this}class(e){return this.classNames.set(this.currentSubject,e),this}layout(e={}){return this.updateTarget(`layout`,{},e),this}enter(e,t){return this.updateTarget(`enter`,e,t),this}exit(e,t){return this.updateTarget(`exit`,e,t),this}new(e,t){return this.updateTarget(`new`,e,t),this}old(e,t){return this.updateTarget(`old`,e,t),this}updateTarget(e,t,n={}){let{currentSubject:r,targets:i}=this;i.has(r)||i.set(r,{});let a=i.get(r);a[e]={keyframes:t,options:n}}then(e,t){return this.readyPromise.then(e,t)}};function ca(e,t={}){return new sa(e,t)}var la=()=>({min:0,max:0}),ua=()=>({x:la(),y:la()}),da=new WeakMap;function fa(e){return typeof e==`object`&&!!e&&typeof e.start==`function`}function pa(e){return typeof e==`string`||Array.isArray(e)}var ma=[`initial`,`animate`,`whileInView`,`whileFocus`,`whileHover`,`whileTap`,`whileDrag`,`exit`];function ha(e){return fa(e.animate)||ma.some(t=>pa(e[t]))}function ga(e){return!!(ha(e)||e.variants)}function _a(e,t,n){for(let r in t){let i=t[r],a=n[r];if(J(i))e.addValue(r,i);else if(J(a))e.addValue(r,K(i,{owner:e}));else if(a!==i){if(e.hasValue(r)){let t=e.getValue(r);t.liveStyle===!0?t.jump(i):t.hasAnimated||t.set(i)}else{let t=e.getStaticValue(r);e.addValue(r,K(t===void 0?i:t,{owner:e}))}}}for(let r in n)t[r]===void 0&&e.removeValue(r);return t}var va={current:null},ya={current:!1},ba=typeof window<`u`;function xa(){if(ya.current=!0,ba){if(window.matchMedia){let e=window.matchMedia(`(prefers-reduced-motion)`),t=()=>va.current=e.matches;e.addEventListener(`change`,t),t()}else va.current=!1}}var Sa=[`AnimationStart`,`AnimationComplete`,`Update`,`BeforeLayoutMeasure`,`LayoutMeasure`,`LayoutAnimationStart`,`LayoutAnimationComplete`],Ca={},wa=class{scrapeMotionValuesFromProps(e,t,n){return{}}constructor({parent:e,props:t,presenceContext:n,reducedMotionConfig:r,skipAnimations:i,blockInitialAnimation:a,visualState:o},s={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=Gn,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify(`Update`,this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{let e=j.now();this.renderScheduledAt<e&&(this.renderScheduledAt=e,A.render(this.render,!1,!0))};let{latestValues:c,renderState:l}=o;this.latestValues=c,this.baseTarget={...c},this.initialValues=t.initial?{...c}:{},this.renderState=l,this.parent=e,this.props=t,this.presenceContext=n,this.depth=e?e.depth+1:0,this.reducedMotionConfig=r,this.skipAnimationsConfig=i,this.options=s,this.blockInitialAnimation=!!a,this.isControllingVariants=ha(t),this.isVariantNode=ga(t),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);let{willChange:u,...d}=this.scrapeMotionValuesFromProps(t,{},this);for(let e in d){let t=d[e];c[e]!==void 0&&J(t)&&t.set(c[e])}}mount(e){if(this.hasBeenMounted)for(let e in this.initialValues)this.values.get(e)?.jump(this.initialValues[e]),this.latestValues[e]=this.initialValues[e];this.current=e,da.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((e,t)=>this.bindToMotionValue(t,e)),this.reducedMotionConfig===`never`?this.shouldReduceMotion=!1:this.reducedMotionConfig===`always`?this.shouldReduceMotion=!0:(ya.current||xa(),this.shouldReduceMotion=va.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection&&this.projection.unmount(),Le(this.notifyUpdate),Le(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(let e in this.events)this.events[e].clear();for(let e in this.features){let t=this.features[e];t&&(t.unmount(),t.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),this.enteringChildren??=new Set,this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,t){if(this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)(),t.accelerate&&pr.has(e)&&this.current instanceof HTMLElement){let{factory:n,keyframes:r,times:i,ease:a,duration:o}=t.accelerate,s=new G({element:this.current,name:e,keyframes:r,times:i,ease:a,duration:O(o)}),c=n(s);this.valueSubscriptions.set(e,()=>{c(),s.cancel()});return}let n=Pn.has(e);n&&this.onBindTransform&&this.onBindTransform();let r=t.on(`change`,t=>{this.latestValues[e]=t,this.props.onUpdate&&A.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()}),i;typeof window<`u`&&window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,e,t)),this.valueSubscriptions.set(e,()=>{r(),i&&i()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e=`animation`;for(e in Ca){let t=Ca[e];if(!t)continue;let{isEnabled:n,Feature:r}=t;if(!this.features[e]&&r&&n(this.props)&&(this.features[e]=new r(this)),this.features[e]){let t=this.features[e];t.isMounted?t.update():(t.mount(),t.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):ua()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,t){this.latestValues[e]=t}update(e,t){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=t;for(let t=0;t<Sa.length;t++){let n=Sa[t];this.propEventSubscriptions[n]&&(this.propEventSubscriptions[n](),delete this.propEventSubscriptions[n]);let r=e[`on`+n];r&&(this.propEventSubscriptions[n]=this.on(n,r))}this.prevMotionValues=_a(this,this.scrapeMotionValuesFromProps(e,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(e){let t=this.getClosestVariantNode();if(t)return t.variantChildren&&t.variantChildren.add(e),()=>t.variantChildren.delete(e)}addValue(e,t){let n=this.values.get(e);t!==n&&(n&&this.removeValue(e),this.bindToMotionValue(e,t),this.values.set(e,t),this.latestValues[e]=t.get())}removeValue(e){this.values.delete(e);let t=this.valueSubscriptions.get(e);t&&(t(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,t){if(this.props.values&&this.props.values[e])return this.props.values[e];let n=this.values.get(e);return n===void 0&&t!==void 0&&(n=K(t===null?void 0:t,{owner:this}),this.addValue(e,n)),n}readValue(e,t){let n=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return n!=null&&(typeof n==`string`&&(ee(n)||ne(n))?n=parseFloat(n):!Fi(n)&&z.test(t)&&(n=bi(e,t)),this.setBaseTarget(e,J(n)?n.get():n)),J(n)?n.get():n}setBaseTarget(e,t){this.baseTarget[e]=t}getBaseTarget(e){let{initial:t}=this.props,n;if(typeof t==`string`||typeof t==`object`){let r=Gr(this.props,t,this.presenceContext?.custom);r&&(n=r[e])}if(t&&n!==void 0)return n;let r=this.getBaseTargetFromProps(this.props,e);return r!==void 0&&!J(r)?r:this.initialValues[e]!==void 0&&n===void 0?void 0:this.baseTarget[e]}on(e,t){return this.events[e]||(this.events[e]=new ae),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t)}scheduleRenderMicrotask(){ki.render(this.render)}},Ta=class extends wa{constructor(){super(...arguments),this.KeyframeResolver=Ci}sortInstanceNodePosition(e,t){return e.compareDocumentPosition(t)&2?1:-1}getBaseTargetFromProps(e,t){let n=e.style;return n?n[t]:void 0}removeValueFromRenderState(e,{vars:t,style:n}){delete t[e],delete n[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);let{children:e}=this.props;J(e)&&(this.childSubscription=e.on(`change`,e=>{this.current&&(this.current.textContent=`${e}`)}))}};function Ea({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function Da(e,t){if(!t)return e;let n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function Oa(e,t){return Ea(Da(e.getBoundingClientRect(),t))}var ka={x:`translateX`,y:`translateY`,z:`translateZ`,transformPerspective:`perspective`},Aa=Nn.length;function ja(e,t,n){let r=``,i=!0;for(let a=0;a<Aa;a++){let o=Nn[a],s=e[o];if(s===void 0)continue;let c=!0;if(typeof s==`number`)c=s===+!!o.startsWith(`scale`);else{let e=parseFloat(s);c=o.startsWith(`scale`)?e===1:e===0}if(!c||n){let e=Oi(s,gi[o]);if(!c){i=!1;let t=ka[o]||o;r+=`${t}(${e}) `}n&&(t[o]=e)}}let a=e.pathRotation;return a&&(i=!1,r+=`rotate(${Oi(a,gi.pathRotation)}) `),r=r.trim(),n?r=n(t,i?``:r):i&&(r=`none`),r}function Ma(e,t,n){let{style:r,vars:i,transformOrigin:a}=e,o=!1,s=!1;for(let e in t){let n=t[e];if(Pn.has(e)){o=!0;continue}if(Ue(e)){i[e]=n;continue}{let t=Oi(n,gi[e]);e.startsWith(`origin`)?(s=!0,a[e]=t):r[e]=t}}if(t.transform||(o||n?r.transform=ja(t,e.transform,n):r.transform&&=`none`),s){let{originX:e=`50%`,originY:t=`50%`,originZ:n=0}=a;r.transformOrigin=`${e} ${t} ${n}`}}function Na(e,{style:t,vars:n},r,i){let a=e.style,o;for(o in t)a[o]=t[o];for(o in i?.applyProjectionStyles(a,r),n)a.setProperty(o,n[o])}function Pa(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}var Fa={correct:(e,t)=>{if(!t.target)return e;if(typeof e==`string`){if(F.test(e))e=parseFloat(e);else return e}return`${Pa(e,t.target.x)}% ${Pa(e,t.target.y)}%`}},Ia={correct:(e,{treeScale:t,projectionDelta:n})=>{let r=e,i=z.parse(e);if(i.length>5)return r;let a=z.createTransformer(e),o=typeof i[0]==`number`?0:1,s=n.x.scale*t.x,c=n.y.scale*t.y;i[0+o]/=s,i[1+o]/=c;let l=Ot(s,c,.5);return typeof i[2+o]==`number`&&(i[2+o]/=l),typeof i[3+o]==`number`&&(i[3+o]/=l),a(i)}},La={borderRadius:{...Fa,applyTo:[...wi]},borderTopLeftRadius:Fa,borderTopRightRadius:Fa,borderBottomLeftRadius:Fa,borderBottomRightRadius:Fa,boxShadow:Ia};function Ra(e,{layout:t,layoutId:n}){return Pn.has(e)||e.startsWith(`origin`)||(t||n!==void 0)&&(!!La[e]||e===`opacity`)}function za(e,t,n){let r=e.style,i=t?.style,a={};if(!r)return a;for(let t in r)(J(r[t])||i&&J(i[t])||Ra(t,e)||n?.getValue(t)?.liveStyle!==void 0)&&(a[t]=r[t]);return a}function Ba(e){return window.getComputedStyle(e)}var Va=class extends Ta{constructor(){super(...arguments),this.type=`html`,this.renderInstance=Na}mount(e){e.style,super.mount(e)}readValueFromInstance(e,t){if(Pn.has(t))return this.projection?.isProjecting?kn(t):jn(e,t);{let n=Ba(e),r=(Ue(t)?n.getPropertyValue(t):n[t])||0;return typeof r==`string`?r.trim():r}}measureInstanceViewportBox(e,{transformPagePoint:t}){return Oa(e,t)}build(e,t,n){Ma(e,t,n.transformTemplate)}scrapeMotionValuesFromProps(e,t,n){return za(e,t,n)}};function Ha(e,t){return e in t}var Ua=class extends wa{constructor(){super(...arguments),this.type=`object`}readValueFromInstance(e,t){if(Ha(t,e)){let n=e[t];if(typeof n==`string`||typeof n==`number`)return n}}getBaseTargetFromProps(){}removeValueFromRenderState(e,t){delete t.output[e]}measureInstanceViewportBox(){return ua()}build(e,t){Object.assign(e.output,t)}renderInstance(e,{output:t}){Object.assign(e,t)}sortInstanceNodePosition(){return 0}},Wa={offset:`stroke-dashoffset`,array:`stroke-dasharray`},Ga={offset:`strokeDashoffset`,array:`strokeDasharray`};function Ka(e,t,n=1,r=0,i=!0){e.pathLength=1;let a=i?Wa:Ga;e[a.offset]=`${-r}`,e[a.array]=`${t} ${n}`}var qa=[`offsetDistance`,`offsetPath`,`offsetRotate`,`offsetAnchor`];function Ja(e,{attrX:t,attrY:n,attrScale:r,pathLength:i,pathSpacing:a=1,pathOffset:o=0,...s},c,l,u){if(Ma(e,s,l),c){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};let{attrs:d,style:f}=e;d.transform&&(f.transform=d.transform,delete d.transform),(f.transform||d.transformOrigin)&&(f.transformOrigin=d.transformOrigin??`50% 50%`,delete d.transformOrigin),f.transform&&(f.transformBox=u?.transformBox??`fill-box`,delete d.transformBox);for(let e of qa)d[e]!==void 0&&(f[e]=d[e],delete d[e]);t!==void 0&&(d.x=t),n!==void 0&&(d.y=n),r!==void 0&&(d.scale=r),i!==void 0&&Ka(d,i,a,o,!1)}var Ya=new Set([`baseFrequency`,`diffuseConstant`,`kernelMatrix`,`kernelUnitLength`,`keySplines`,`keyTimes`,`limitingConeAngle`,`markerHeight`,`markerWidth`,`numOctaves`,`targetX`,`targetY`,`surfaceScale`,`specularConstant`,`specularExponent`,`stdDeviation`,`tableValues`,`viewBox`,`gradientTransform`,`pathLength`,`startOffset`,`textLength`,`lengthAdjust`]),Xa=e=>typeof e==`string`&&e.toLowerCase()===`svg`;function Za(e,t,n,r){Na(e,t,void 0,r);for(let n in t.attrs)e.setAttribute(Ya.has(n)?n:ei(n),t.attrs[n])}function Qa(e,t,n){let r=za(e,t,n);for(let n in e)if(J(e[n])||J(t[n])){let t=Nn.indexOf(n)===-1?n:`attr`+n.charAt(0).toUpperCase()+n.substring(1);r[t]=e[n]}return r}var $a=class extends Ta{constructor(){super(...arguments),this.type=`svg`,this.isSVGTag=!1,this.measureInstanceViewportBox=ua}getBaseTargetFromProps(e,t){return e[t]}readValueFromInstance(e,t){if(Pn.has(t)){let e=vi(t);return e&&e.default||0}return t=Ya.has(t)?t:ei(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,n){return Qa(e,t,n)}build(e,t,n){Ja(e,t,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(e,t,n,r){Za(e,t,n,r)}mount(e){this.isSVGTag=Xa(e.tagName),super.mount(e)}};function eo(e,t,n){let r=J(e)?e:K(e);return r.start(Br(``,r,t,n)),r.animation}function to(e){return typeof e==`object`&&!Array.isArray(e)}function no(e,t,n,r){return e==null?[]:typeof e==`string`&&to(t)?Di(e,n,r):e instanceof NodeList?Array.from(e):Array.isArray(e)?e.filter(e=>e!=null):[e]}function ro(e,t,n){return e*(t+1)+n*t}function io(e,t,n,r){return typeof t==`number`?t:t.startsWith(`-`)||t.startsWith(`+`)?Math.max(0,e+parseFloat(t)):t===`<`?n:t.startsWith(`<`)?Math.max(0,n+parseFloat(t.slice(1))):r.get(t)??e}function ao(e,t,n){for(let r=0;r<e.length;r++){let i=e[r];i.at>t&&i.at<n&&(S(e,i),r--)}}function oo(e,t,n,r,i,a){ao(e,i,a);for(let o=0;o<t.length;o++)e.push({value:t[o],at:Ot(i,a,r[o]),easing:Oe(n,o)})}function so(e,t,n=0){let r=t+1+t*n;for(let t=0;t<e.length;t++)e[t]=e[t]/r}function co(e,t){return e.at===t.at?e.value===null?1:t.value===null?-1:0:e.at-t.at}var lo=`easeInOut`,uo=20;function fo(e,{defaultTransition:t={},...n}={},r,i){let a=t.duration||.3,o=new Map,s=new Map,c={},l=new Map,u=0,d=0,f=0;for(let n=0;n<e.length;n++){let o=e[n];if(typeof o==`string`){l.set(o,d);continue}if(!Array.isArray(o)){l.set(o.name,io(d,o.at,u,l));continue}let[p,m,h={}]=o;h.at!==void 0&&(d=io(d,h.at,u,l));let g=0,_=(e,n,r,o=0,s=0)=>{let c=ho(e),{delay:l=0,times:u=un(c),type:p=t.type||`keyframes`,repeat:m,repeatType:h,repeatDelay:_=0,...v}=n,{ease:y=t.ease||`easeOut`,duration:b}=n,x=typeof l==`function`?l(o,s):l,S=c.length,C=nr(p)?p:i?.[p||`keyframes`];if(S<=2&&C){let e=100;if(S===2&&vo(c)){let t=c[1]-c[0];e=Math.abs(t)}let n={...t,...v};b!==void 0&&(n.duration=O(b));let r=qt(n,e,C);y=r.ease,b=r.duration}b??=a;let w=d+x;u.length===1&&u[0]===0&&(u[1]=1);let T=u.length-c.length;if(T>0&&ln(u,T),c.length===1&&c.unshift(null),m&&`${m}${uo}`,m&&m<uo){let e=b>0?_/b:0;b=ro(b,m,_);let t=[...c],n=[...u];y=Array.isArray(y)?[...y]:[y];let r=[...y],i=h===`reverse`||h===`mirror`,a=t,o=r;i&&(a=[...t].reverse(),h===`reverse`&&(o=[...r].reverse().map(e=>typeof e==`function`?ge(e):e)));for(let s=0;s<m;s++){let l=i&&s%2==0,d=l?a:t,f=l?o:r,p=(s+1)*(1+e);e>0&&(c.push(c[c.length-1]),u.push(p),y.push(`linear`)),c.push(...d);for(let e=0;e<d.length;e++)u.push(n[e]+p),y.push(e===0?`linear`:Oe(f,e-1))}so(u,m,e)}let ee=w+b;oo(r,c,y,u,w,ee),g=Math.max(x+b,g),f=Math.max(ee,f)};if(J(p)){let e=po(p,s);_(m,h,mo(`default`,e))}else{let e=no(p,m,r,c),t=e.length;for(let n=0;n<t;n++){m=m,h=h;let r=e[n],i=po(r,s);for(let e in m)_(m[e],go(h,e),mo(e,i),n,t)}}u=d,d+=g}return s.forEach((e,r)=>{for(let i in e){let a=e[i];a.sort(co);let s=[],c=[],l=[];for(let e=0;e<a.length;e++){let{at:t,value:n,easing:r}=a[e];s.push(n),c.push(ie(0,f,t)),l.push(r||`easeOut`)}c[0]!==0&&(c.unshift(0),s.unshift(s[0]),l.unshift(lo)),c[c.length-1]!==1&&(c.push(1),s.push(null)),o.has(r)||o.set(r,{keyframes:{},transition:{}});let u=o.get(r);u.keyframes[i]=s;let{type:d,...p}=t;u.transition[i]={...p,duration:f,ease:l,times:c,...n}}}),o}function po(e,t){return!t.has(e)&&t.set(e,{}),t.get(e)}function mo(e,t){return t[e]||(t[e]=[]),t[e]}function ho(e){return Array.isArray(e)?e:[e]}function go(e,t){return e&&e[t]?{...e,...e[t]}:{...e}}var _o=e=>typeof e==`number`,vo=e=>e.every(_o);function yo(e){let t={presenceContext:null,props:{},visualState:{renderState:{transform:{},transformOrigin:{},style:{},vars:{},attrs:{}},latestValues:{}}},n=Mi(e)&&!Ni(e)?new $a(t):new Va(t);n.mount(e),da.set(e,n)}function bo(e){let t=new Ua({presenceContext:null,props:{},visualState:{renderState:{output:{}},latestValues:{}}});t.mount(e),da.set(e,t)}function xo(e,t){return J(e)||typeof e==`number`||typeof e==`string`&&!to(t)}function So(e,t,n,r){let i=[];if(xo(e,t))i.push(eo(e,to(t)&&t.default||t,n&&(n.default||n)));else{if(e==null)return i;let a=no(e,t,r),o=a.length;for(let e=0;e<o;e++){let r=a[e],s=r instanceof Element?yo:bo;da.has(r)||s(r);let c=da.get(r),l={...n};`delay`in l&&typeof l.delay==`function`&&(l.delay=l.delay(e,o)),i.push(...ii(c,{...t,transition:l},{}))}}return i}function Co(e,t,n){let r=[];return fo(e.map(e=>{if(Array.isArray(e)&&typeof e[0]==`function`){let t=e[0],n=K(0);return n.on(`change`,t),e.length===1?[n,[0,1]]:e.length===2?[n,[0,1],e[1]]:[n,e[1],e[2]]}return e}),t,n,{spring:V}).forEach(({keyframes:e,transition:t},n)=>{r.push(...So(n,e,t))}),r}function wo(e){return Array.isArray(e)&&e.some(Array.isArray)}function To(e={}){let{scope:t,reduceMotion:n,skipAnimations:r}=e;function i(e,i,a){let o=[],s,c={};if(n!==void 0&&(c.reduceMotion=n),r!==void 0&&(c.skipAnimations=r),wo(e)){let{onComplete:n,...r}=i||{};typeof n==`function`&&(s=n),o=Co(e,{...c,...r},t)}else{let{onComplete:n,...r}=a||{};typeof n==`function`&&(s=n),o=So(e,i,{...c,...r},t)}let l=new Cr(o);return s&&l.finished.then(s),t&&(t.animations.push(l),l.finished.then(()=>{S(t.animations,l)})),l}return i}var Eo=To();function Do(e,t,n,r){if(e==null)return[];let i=Di(e,r),a=i.length,o=[];for(let e=0;e<a;e++){let r=i[e],s={...n};typeof s.delay==`function`&&(s.delay=s.delay(e,a));for(let e in t){let n=t[e];Array.isArray(n)||(n=[n]);let i={...q(s,e)};i.duration&&=O(i.duration),i.delay&&=O(i.delay);let a=Dr(r),c=Er(e,i.pseudoElement||``),l=a.get(c);l&&l.stop(),o.push({map:a,key:c,unresolvedKeyframes:n,options:{...i,element:r,name:e,allowFlatten:!s.type&&!s.ease}})}}for(let e=0;e<o.length;e++){let{unresolvedKeyframes:t,options:n}=o[e],{element:r,name:i,pseudoElement:a}=n;!a&&t[0]===null&&(t[0]=ji(r,i)),xn(t),Ei(t,i),!a&&t.length<2&&t.unshift(ji(r,i)),n.keyframes=t}let s=[];for(let e=0;e<o.length;e++){let{map:t,key:n,options:r}=o[e],i=new G(r);t.set(n,i),i.finished.finally(()=>t.delete(n)),s.push(i)}return s}var Oo=(e=>{function t(t,n,r){return new Cr(Do(t,n,r,e))}return t})(),ko=(e,t)=>({finished:e,then:e.then.bind(e),...t}),Q=e=>ko((async()=>{await e?.()})(),{cancel(){},stop(){},complete(){}}),Ao=(e,t)=>{let n=!1,r=()=>{n||(n=!0,t?.())},i=()=>{},a=new Promise(e=>{i=e}),o=e.finished.then(()=>{},()=>{}),s=Promise.race([o,a]).finally(r),c=e=>{try{e()}finally{i(),r()}};return ko(s,{cancel(){c(()=>e.cancel())},stop(){c(()=>e.stop())},complete(){c(()=>e.complete())}})},jo=(...e)=>ko(Promise.allSettled(e.map(e=>e.finished)).then(()=>{}),{cancel(){e.forEach(e=>e.cancel())},stop(){e.forEach(e=>e.stop())},complete(){e.forEach(e=>e.complete())}}),Mo=(...e)=>{let t=!1,n=!1,r=null;return ko((async()=>{for(let i of e){if(t)break;r=i(),n&&r.complete(),await r.finished.catch(()=>{})}})(),{cancel(){t=!0,r?.cancel()},stop(){t=!0,r?.stop()},complete(){n=!0,r?.complete()}})},$=new WeakMap,No=e=>{let t=$.get(e);if(t)return t.handle.stop(),$.get(e)===t&&$.delete(e),t.properties},Po=(e,t,n,r,i)=>{let a=Ao(t(No(e))),o,s=()=>o.stop(),c=()=>{r?.removeEventListener(`abort`,s),$.get(e)?.handle===o&&(i?.(),$.get(e)?.handle===o&&$.delete(e))};return o=ko(a.finished.finally(c),{cancel(){a.cancel(),c()},stop(){a.stop(),c()},complete(){a.complete()}}),$.set(e,{handle:o,properties:n}),r?.addEventListener(`abort`,s,{once:!0}),o},Fo=e=>!(e instanceof Element)&&typeof e==`object`&&!!e&&`signal`in e,Io=e=>{let t=e instanceof Element?e:e.el;if(!(t instanceof Element))throw TypeError(`Motion subject requires an Element target.`);return t},Lo=(e,t)=>{let n=Io(e);if(!t)return n;if(t instanceof Element)return t;let r=Fo(e)?e.root:n;if(!(r instanceof Element))throw TypeError(`Motion transition subject requires an Element root.`);let i=r.matches(t)?r:r.querySelector(t);if(!i)throw Error(`Motion target not found: ${t}`);return i},Ro=e=>Fo(e)?e.signal:null,zo=e=>Array.isArray(e)?e.at(-1):e,Bo=e=>Object.fromEntries(Object.entries(e).map(([e,t])=>[e,Array.isArray(t)?[...t]:t])),Vo=(e,t)=>t===`height`?`${e.getBoundingClientRect().height}px`:t===`width`?`${e.getBoundingClientRect().width}px`:getComputedStyle(e)[t],Ho=(e,t)=>Array.isArray(e)?[t,...e.slice(1)]:[t,e],Uo=(e,t)=>{let n=Lo(e,t.target);if(!(n instanceof HTMLElement))throw TypeError(`Size motion requires an HTMLElement target.`);let r=t.signal??Ro(e);if(r?.aborted)return t.cleanup?.(),Q();let a=Bo(t.keyframes),o=new Set(Object.keys(a));if(o.size===0)return t.cleanup?.(),Q();if(y()){No(n);let e=Object.fromEntries(Object.entries(t.keyframes).flatMap(([e,t])=>e===`opacity`?[]:[[e,zo(t)]]));Object.entries(e).forEach(([e,t])=>{n.style[e]=typeof t==`number`?`${t}px`:String(t)}),Object.keys(e).length>0&&Oo(n,e,{duration:0}).complete();let a=t.keyframes.opacity;return a===void 0?(t.cleanup?.(),Q()):Po(n,()=>Oo(n,{opacity:typeof a==`number`?a:[...a]},{...i.feedback,type:`tween`}),new Set([`opacity`]),r,t.cleanup)}let s=new Map([...o].map(e=>[e,Vo(n,e)])),c=t.role??`layout`;return Po(n,e=>{for(let t of o)e?.has(t)&&(a[t]=Ho(a[t],s.get(t)));return Oo(n,a,{...p(n,c),...f(c,n)?{type:V}:{type:`tween`},...t.transition})},o,r,t.cleanup)},Wo=e=>typeof e==`object`&&!!e&&`initial`in e,Go=e=>{let t={},n=new Map,r=new Map,i;Object.keys(e.values).forEach(r=>{let i=e.values[r],a=Wo(i)?i.initial:i;t[r]=K(a),Wo(i)&&i.transition&&n.set(r,i.transition)});let a=()=>Object.fromEntries(Object.keys(t).map(e=>[e,t[e].get()])),o=e=>{r.get(e)?.stop(),r.delete(e)},s=e=>{Object.keys(e).forEach(n=>{let r=e[n];r!==void 0&&t[n]&&(o(n),t[n].set(r))})};return{mount:n=>{i?.();let r=new Map,o=()=>{Object.entries(e.style(a())).forEach(([e,t])=>{r.has(e)||r.set(e,e.startsWith(`--`)?n.style.getPropertyValue(e):String(n.style[e]??``)),e.startsWith(`--`)?n.style.setProperty(e,String(t)):n.style[e]=String(t)})},s=Object.values(t).map(e=>e.on(`change`,o));o();let c=!0,l=()=>{c&&(c=!1,s.forEach(e=>e()),r.forEach((e,t)=>{t.startsWith(`--`)?n.style.setProperty(t,e):n.style[t]=e}),i===l&&(i=void 0))};return i=l,l},set:s,animate:(i,a)=>{if(y(e.reducedMotion))return s(i),Q();let c=Object.keys(i).flatMap(e=>{let s=i[e];if(s===void 0||!t[e])return[];o(e);let c=Ao(Eo(t[e],s,{...n.get(e),...a}));return r.set(e,c),c.finished.finally(()=>{r.get(e)===c&&r.delete(e)}),[c]});return c.length?jo(...c):Q()},current:a,destroy:()=>{i?.(),r.forEach(e=>e.cancel()),r.clear()}}},Ko=new WeakMap,qo=(e,t)=>{let n=Lo(e,t.target);if(!(n instanceof HTMLElement))throw TypeError(`Motion resize requires an HTMLElement target.`);let r=Lo(n,t.measure??n);if(r===n)throw Error(`Motion resize requires a separate measurement element.`);if(!(r instanceof HTMLElement))throw TypeError(`Motion resize measurement requires an HTMLElement.`);let i=Ro(e);if(i?.aborted)return Q();let a=Math.max(r.scrollHeight,r.getBoundingClientRect().height),o=n.getBoundingClientRect().height,s=No(n),c=s?.has(`height`)?o:t.from===`content`?a:0,l=t.to===`content`?a:0;Ko.has(n)||Ko.set(n,{height:n.style.height,opacity:n.style.opacity,overflow:n.style.overflow,willChange:n.style.willChange});let u=y(),d=t.speed===void 0?void 0:h(t.speed,n),p={height:[c,l]};n.style.overflow=`hidden`,n.style.willChange=u?`opacity`:`height, opacity`,t.opacity!==void 0&&(p.opacity=s?.has(`opacity`)?Array.isArray(t.opacity)?t.opacity.at(-1):t.opacity:Array.isArray(t.opacity)?[...t.opacity]:t.opacity);let m=t.role??`resize`,g=d===void 0?{}:`stiffness`in d?d:f(m)?{visualDuration:d.duration}:d,_=()=>{let e=Ko.get(n);e&&Object.assign(n.style,e),Ko.delete(n)};return Uo(e,{target:n,keyframes:p,role:m,transition:{...g,...t.transition},signal:i,cleanup:_})},Jo=e=>Object.fromEntries(Object.entries(e).map(([e,t])=>[e,Array.isArray(t)?[...t]:t])),Yo=(e,t=new Set)=>Object.fromEntries(Object.entries(Jo(e)).map(([e,n])=>[e,t.has(e)&&Array.isArray(n)?g(n):n])),Xo=new Set(`bottom.filter.height.maxHeight.maxWidth.inset.insetBlock.insetInline.left.right.top.transform.width.translate.x.y.z.scale.scaleX.scaleY.rotate.rotateX.rotateY.skew.skewX.skewY`.split(`.`)),Zo=e=>Object.fromEntries(Object.entries(Jo(e)).flatMap(([e,t])=>Xo.has(e)?[]:[[e,t]])),Qo=e=>Object.fromEntries(Object.entries(Jo(e)).flatMap(([e,t])=>Xo.has(e)?[[e,Array.isArray(t)?g(t):t]]:[])),$o=(e,t,i,a,o)=>{let s=o?`feedback`:t,c=s===void 0?{type:`tween`,ease:r.out}:{...d(e,s),type:f(s,e)?V:`tween`},l=i===void 0?void 0:h(o?`fast`:i,e),u=l===void 0?c:`stiffness`in l?{...c,type:V,...l}:{...c,duration:l.duration};return{...u.duration===void 0&&u.type===void 0?{duration:n.moderate.duration}:{},...u,...a}},es=(e,t,n)=>{let r=Lo(e,t.target),i=Ro(e);if(i?.aborted)return Q();let a=y();if(a){let e=Qo(t.keyframes);Object.keys(e).length>0&&Eo(r,e,{duration:0}).complete()}let o=a?Zo(t.keyframes):Jo(t.keyframes);return Object.keys(o).length===0?(Eo(r,Object.fromEntries(Object.entries(Jo(t.keyframes)).map(([e,t])=>[e,Array.isArray(t)?g(t):t])),{duration:0}).complete(),Q()):Po(r,e=>Eo(r,Yo(o,e),$o(r,t.role??n.role,t.speed??n.speed,{...n.transition,...t.transition},a)),new Set(Object.keys(o)),i)},ts=(e,t,n)=>{if(t.kind===`animate`)return es(e,t,n);let r=t.speed??n.speed??t.options.speed,i=t.role??n.role??t.options.role,a={...n.transition,...t.options.transition,...t.transition};return qo(e,{...t.options,...r===void 0?{}:{speed:r},...i===void 0?{}:{role:i},...Object.keys(a).length===0?{}:{transition:a}})},ns=(e,t)=>t===void 0?{keyframes:e}:{target:e,keyframes:t},rs=class e{#e;#t;#n;constructor(e,t=[],n={}){this.#e=e,this.#t=t,this.#n=n}#r(t,n){if(!n||this.#t.length===0)return new e(this.#e,[...this.#t,[t]],this.#n);let r=this.#t.slice(0,-1),i=this.#t.at(-1)??[];return new e(this.#e,[...r,[...i,t]],this.#n)}#i(t){let n=this.#t.at(-1);if(!n?.length)throw Error(`Declare a motion segment before configuring it.`);let r=this.#t.slice(0,-1);return new e(this.#e,[...r,[...n.slice(0,-1),t(n.at(-1))]],this.#n)}animate(e,t){return this.#r({kind:`animate`,...ns(e,t)},!1)}with(e,t){return this.#r({kind:`animate`,...ns(e,t)},!0)}then(e,t){return this.animate(e,t)}resize(e){return this.#r({kind:`resize`,options:e},!1)}speed(e){return this.#i(t=>({...t,speed:e}))}role(e){return this.#i(t=>({...t,role:e}))}transition(e){return this.#i(t=>({...t,transition:{...t.transition,...e}}))}defaults(t){let n=t.speed??this.#n.speed,r=t.role??this.#n.role,i={...this.#n.transition,...t.transition};return new e(this.#e,this.#t,{...n===void 0?{}:{speed:n},...r===void 0?{}:{role:r},...Object.keys(i).length===0?{}:{transition:i}})}play(){return this.#t.length===0?Q():Mo(...this.#t.map(e=>()=>jo(...e.map(e=>ts(this.#e,e,this.#n)))))}},is=e=>new rs(e),as=e=>{let t=globalThis.CSS;return typeof t?.escape==`function`?t.escape(e):e.replaceAll(`\\`,`\\\\`).replaceAll(`"`,`\\"`)},os=t=>`[${e}="${as(t)}"]`,ss=e=>`[data-ui-${as(e)}]`,cs=e=>e instanceof Element?null:typeof e==`string`?e:`selector`in e?e.selector:`part`in e?ss(e.part):`key`in e?os(e.key):null,ls=e=>{if(e instanceof Element)return[e];let t=cs(e);return t?[t]:[]},us=(e=document,t)=>t?(Array.isArray(t)?t:[t]).flatMap(e=>{if(e instanceof Element)return[{subject:e}];if(typeof e==`object`&&`from`in e){let t=ls(e.from),n=ls(e.to);return t.flatMap((e,t)=>{let r=n[t]??n[0];return r?[{subject:e,newSubject:r}]:[]})}let t=cs(e);return t?[{subject:t}]:[]}):[],ds=async()=>{},fs=e=>{ds=async()=>{await e()}},ps=i.layout,ms={transform:[`none`,`none`]},hs=`[${e}], [${t}]`,gs=(e,t,n={})=>{if(typeof document.startViewTransition!=`function`||y(n.reducedMotion))return Q(e);let r=t??(n.layout||n.preset===`layout`?hs:null),a=us(n.scope??document,r),o=ca(e,{...i.layout,interrupt:`immediate`,...n.transition});return a.forEach(({subject:e,newSubject:t})=>{o.add(e,t),n.className&&o.class(n.className),typeof n.crop==`boolean`&&o.crop(n.crop),typeof n.group==`boolean`&&o.group(n.group),n.layout!==!1&&n.preset!==`none`&&o.layout(typeof n.layout==`object`?n.layout:ps);let r=n.newView??(n.preset===`stream`?ms:void 0),a=n.oldView??(n.preset===`stream`?ms:void 0),s=n.enter,c=n.exit;r&&o.new(r,i.feedback),a&&o.old(a,i.feedback),s&&o.enter(s,i.feedback),c&&o.exit(c,i.feedback)}),ko(Promise.resolve(o.then(()=>{},()=>{})),{cancel(){Ki().forEach(e=>e.cancel())},stop(){Ki().forEach(e=>e.pause())},complete(){Ki().forEach(e=>{try{e.finish()}catch{e.cancel()}})}})},_s=Object.assign(is,{presets:m,roles:i,speeds:n,easings:r,createController:Go,stop(e){No(e)},withReducedMotion:b,view:(e,t={})=>{let{targets:n,...r}=t;return gs(async()=>{await e(),await ds()},n,{preset:`layout`,...r})}});export{i as C,d as S,K as _,os as a,f as b,Ro as c,No as d,Q as f,Di as g,Eo as h,as as i,Lo as l,Oo as m,gs as n,is as o,jo as p,fs as r,Uo as s,_s as t,Po as u,V as v,p as x,y};
|
|
3
|
+
//# sourceMappingURL=motion-B90yNOaV.js.map
|