{"version":3,"names":["dynamic","createEffect","createMemo","createSignal","omit","onCleanup","untrack","REASONS","composeRefs","userRef","createControlledState","ownerDocument","FloatingNode","FloatingTree","useFloatingNodeId","useFloatingParentNodeId","activeElement","contains","mergeRootProps","useOpenChangeComplete","resolveClassStyle","useTransitionStatus","createNavigationMenu","NavigationMenuRootContext","NavigationMenuTreeContext","useNavigationMenuRootContext","BLOCKED_RETURN_FOCUS_REASONS","Set","triggerHover","outsidePress","focusOut","NavigationMenuRootComponent","props","parentRoot","nested","resolvedValue","setUncontrolledValue","controlled","value","default","defaultValue","fallback","name","state","navMenuPrimitive","delay","closeDelay","orientation","open","activationDirection","setActivationDirection","viewportInert","setViewportInert","positionerElement","setPositionerElement","ownedWrite","popupElement","setPopupElement","viewportElement","setViewportElement","viewportTargetElement","setViewportTargetElement","floatingRootContext","setFloatingRootContext","undefined","mounted","transitionStatus","setMounted","closeReasonRef","current","rootRef","currentContentRef","beforeInsideRef","afterInsideRef","beforeOutsideRef","afterOutsideRef","prevTriggerElementRef","popupAutoSizeResetRef","abortController","owner","setValue","next","details","reason","prev","onValueChange","isCanceled","linkPress","handleUnmount","doc","activeEl","isBlocked","has","popup","HTMLElement","body","focus","preventScroll","onOpenChangeComplete","hasActionsRef","Boolean","actionsRef","popupRef","el","viewportTargetRef","enabled","ref","onComplete","o","s","actions","unmount","ar","contextValue","TreeContext","nodeId","setRootRef","defaultTag","internal","data-open","data-nested","userClassStyle","componentProps","userProps","merged","Tag","as","children","NavigationMenuRoot"],"sources":["navigation-menu-root.tsx"],"sourcesContent":["import type { JSX, ValidComponent } from \"@solidjs/web\";\n/**\n * Solid 2 port of Base UI React's `NavigationMenuRoot`\n * (`packages/react/src/navigation-menu/root/NavigationMenuRoot.tsx`).\n *\n * Groups every navigation-menu part. Renders `<nav>` when not nested, `<div>`\n * when nested. Exposes the full `<NavigationMenu.Root>` context, and wraps\n * itself in `<FloatingTree>` when this is a top-level root (detected via\n * `useFloatingParentNodeId()`).\n *\n * ### Key port choices\n *\n *  - `value` follows Base UI's controlled/uncontrolled contract via\n *    `createControlledState`: the `value` prop wins while defined,\n *    otherwise an internal signal seeded once from `defaultValue` backs\n *    the state and `setValue` writes it (after the `onValueChange`\n *    cancel gate).\n *  - `open` is derived as `value() != null` to match React.\n *  - Mount / transition status driven by `useTransitionStatus`; exit-animation\n *    unmount deferred via two `useOpenChangeComplete` invocations (one on\n *    the popup element, one on the viewport-target element — the latter\n *    catches inline-viewport usage).\n *  - Actions-ref (`unmount()`) — the Solid port accepts either a callback\n *    ref or `{ current }` object, matching the popover convention.\n */\nimport { dynamic } from \"@solidjs/web\";\nimport {\n\ttype Accessor,\n\tcreateEffect,\n\tcreateMemo,\n\tcreateSignal,\n\tomit,\n\tonCleanup,\n\tuntrack,\n} from \"solid-js\";\nimport { REASONS } from \"../../internals/change-event-details\";\nimport { composeRefs, userRef } from \"../../internals/compose-refs\";\nimport { createControlledState } from \"../../internals/create-controlled-state\";\nimport { ownerDocument } from \"../../internals/dom/owner-document\";\nimport type { FloatingRootStore } from \"../../internals/floating-ui/components/floating-root-store\";\nimport {\n\tFloatingNode,\n\tFloatingTree,\n\tuseFloatingNodeId,\n\tuseFloatingParentNodeId,\n} from \"../../internals/floating-ui/components/floating-tree\";\nimport type { MutableRef } from \"../../internals/floating-ui/types\";\nimport {\n\tactiveElement,\n\tcontains,\n} from \"../../internals/floating-ui/utils/element\";\nimport { mergeRootProps } from \"../../internals/merge-root-props\";\nimport { useOpenChangeComplete } from \"../../internals/popups/use-open-change-complete\";\nimport { resolveClassStyle } from \"../../internals/resolve-class-style\";\nimport type { BaseUIComponentProps } from \"../../internals/types\";\nimport { useTransitionStatus } from \"../../internals/use-transition-status/use-transition-status\";\nimport { createNavigationMenu } from \"../create-navigation-menu\";\nimport {\n\ttype NavigationMenuPopupAutoSizeResetState,\n\ttype NavigationMenuRootChangeEventDetails,\n\ttype NavigationMenuRootChangeEventReason,\n\tNavigationMenuRootContext,\n\ttype NavigationMenuRootContextValue,\n\tNavigationMenuTreeContext,\n\tuseNavigationMenuRootContext,\n} from \"./navigation-menu-root-context\";\n\nconst BLOCKED_RETURN_FOCUS_REASONS = new Set<string>([\n\tREASONS.triggerHover,\n\tREASONS.outsidePress,\n\tREASONS.focusOut,\n]);\n\n/**\n * Imperative actions surface exposed via `actionsRef`.\n */\nexport interface NavigationMenuRootActions {\n\t/** Force-unmount the popup subtree now, bypassing any transition. */\n\tunmount: () => void;\n}\n\nexport interface NavigationMenuRootState {\n\topen: boolean;\n\tnested: boolean;\n}\n\nexport interface NavigationMenuRootProps<Value = unknown>\n\textends BaseUIComponentProps<\"nav\", NavigationMenuRootState> {\n\t/**\n\t * Tag/component to render. Defaults to `\"nav\"` at the top level and\n\t * `\"div\"` when nested. Replaces the pre-spike `render` prop (axis G).\n\t */\n\tas?: ValidComponent;\n\t/**\n\t * Controlled active item value. `null` means closed. When provided\n\t * (resolved value not `undefined`), the consumer owns the state — pair\n\t * with {@link onValueChange}. When omitted, the menu manages its own\n\t * value state (seeded from {@link defaultValue}).\n\t */\n\tvalue?: Value | null | undefined;\n\t/**\n\t * Initial active item value when uncontrolled. Read once at mount.\n\t * @default null\n\t */\n\tdefaultValue?: Value | null | undefined;\n\tonValueChange?:\n\t\t| ((\n\t\t\t\tvalue: Value | null,\n\t\t\t\tdetails: NavigationMenuRootChangeEventDetails,\n\t\t  ) => void)\n\t\t| undefined;\n\t/** @default 50 */\n\tdelay?: number | undefined;\n\t/** @default 50 */\n\tcloseDelay?: number | undefined;\n\t/** @default \"horizontal\" */\n\torientation?: \"horizontal\" | \"vertical\" | undefined;\n\tonOpenChangeComplete?: ((open: boolean) => void) | undefined;\n\tactionsRef?:\n\t\t| ((actions: NavigationMenuRootActions | null) => void)\n\t\t| { current: NavigationMenuRootActions | null }\n\t\t| undefined;\n\tchildren?: JSX.Element;\n}\n\nfunction NavigationMenuRootComponent<Value>(\n\tprops: NavigationMenuRootProps<Value>,\n): JSX.Element {\n\tconst parentRoot = useNavigationMenuRootContext(true);\n\tconst nested = useFloatingParentNodeId() != null;\n\n\t// Controlled / uncontrolled `value` state (Base UI `value` /\n\t// `defaultValue` contract): the `value` prop wins while its resolved\n\t// value is not `undefined` (note `null` is a valid controlled value —\n\t// \"closed\"); otherwise an internal signal (seeded once from\n\t// `defaultValue`) backs the state and the root's `setValue` writes it.\n\t// `Value` is unconstrained and may itself be a function —\n\t// `createControlledState` threads writes through the functional-setter\n\t// form to avoid the value/updater ambiguity in `createSignal`'s\n\t// overloads.\n\tconst [resolvedValue, setUncontrolledValue] =\n\t\tcreateControlledState<Value | null>({\n\t\t\tcontrolled: () => props.value,\n\t\t\tdefault: () => props.defaultValue,\n\t\t\tfallback: null,\n\t\t\tname: \"<NavigationMenu.Root>\",\n\t\t\tstate: \"value\",\n\t\t});\n\n\t// Compose the headless NavigationMenu primitive — owns value, derived open,\n\t// activationDirection, viewportInert, orientation, delay, and closeDelay.\n\t// The wrapper layers FloatingTree, transition, focus return, and DOM refs.\n\tconst navMenuPrimitive = createNavigationMenu<Value>({\n\t\tvalue: resolvedValue,\n\t\tdelay: () => props.delay ?? 50,\n\t\tcloseDelay: () => props.closeDelay ?? 50,\n\t\torientation: () => props.orientation ?? \"horizontal\",\n\t\t// onValueChange is handled by the wrapper's own setValue (which has\n\t\t// extra side-effects) — the primitive callback is not wired here.\n\t});\n\n\tconst value = navMenuPrimitive.value;\n\tconst open = navMenuPrimitive.open;\n\tconst activationDirection = navMenuPrimitive.activationDirection;\n\tconst setActivationDirection = navMenuPrimitive.setActivationDirection;\n\tconst viewportInert = navMenuPrimitive.viewportInert;\n\tconst setViewportInert = navMenuPrimitive.setViewportInert;\n\n\tconst [positionerElement, setPositionerElement] =\n\t\tcreateSignal<HTMLElement | null>(null, { ownedWrite: true });\n\tconst [popupElement, setPopupElement] = createSignal<HTMLElement | null>(\n\t\tnull,\n\t\t{ ownedWrite: true },\n\t);\n\tconst [viewportElement, setViewportElement] =\n\t\tcreateSignal<HTMLElement | null>(null, { ownedWrite: true });\n\tconst [viewportTargetElement, setViewportTargetElement] =\n\t\tcreateSignal<HTMLElement | null>(null, { ownedWrite: true });\n\tconst [floatingRootContext, setFloatingRootContext] = createSignal<\n\t\tFloatingRootStore | undefined\n\t>(undefined, { ownedWrite: true });\n\n\tconst { mounted, transitionStatus, setMounted } = useTransitionStatus(\n\t\topen,\n\t\t() => true,\n\t\t() => false,\n\t);\n\n\t// Mutable refs.\n\tconst closeReasonRef: MutableRef<\n\t\tNavigationMenuRootChangeEventReason | undefined\n\t> = { current: undefined };\n\tconst rootRef: MutableRef<HTMLElement | null> = { current: null };\n\tconst currentContentRef: MutableRef<HTMLDivElement | null> = {\n\t\tcurrent: null,\n\t};\n\tconst beforeInsideRef: MutableRef<HTMLSpanElement | null> = { current: null };\n\tconst afterInsideRef: MutableRef<HTMLSpanElement | null> = { current: null };\n\tconst beforeOutsideRef: MutableRef<HTMLSpanElement | null> = {\n\t\tcurrent: null,\n\t};\n\tconst afterOutsideRef: MutableRef<HTMLSpanElement | null> = { current: null };\n\tconst prevTriggerElementRef: MutableRef<Element | null | undefined> = {\n\t\tcurrent: null,\n\t};\n\tconst popupAutoSizeResetRef: MutableRef<NavigationMenuPopupAutoSizeResetState> =\n\t\t{\n\t\t\tcurrent: { abortController: null, owner: null },\n\t\t};\n\n\t// Reset viewport inert on value change (matches React).\n\tcreateEffect(\n\t\t() => value(),\n\t\t() => {\n\t\t\tsetViewportInert(false);\n\t\t},\n\t);\n\n\t// setValue — change-notify + reason-aware side-effects.\n\t// `untrack` the body: reads of `value()` are snapshots driving change-\n\t// detection, not subscriptions. setValue is called from event handlers AND\n\t// from `<NavigationMenuTrigger>`'s `handleOpenChange` (downstream of\n\t// floating-root's effect-apply); the latter would otherwise trip\n\t// `[STRICT_READ_UNTRACKED]` via the strict-read context that survives\n\t// across the synchronous `flush()` re-entry on the hover-open path.\n\t//\n\t// Mirrors Base UI's `NavigationMenuRoot.setValue`: fire `onValueChange`\n\t// (only when the value actually changes), honor `details.cancel()`, then\n\t// write the uncontrolled state — a no-op for reads while the `value`\n\t// prop is controlled.\n\tconst setValue = (\n\t\tnext: Value | null,\n\t\tdetails: NavigationMenuRootChangeEventDetails,\n\t): void =>\n\t\tuntrack(() => {\n\t\t\tif (!next) {\n\t\t\t\tcloseReasonRef.current = details.reason;\n\t\t\t\tsetActivationDirection(null);\n\t\t\t\tsetFloatingRootContext(undefined);\n\t\t\t}\n\n\t\t\t// Snapshot the pre-event value once and gate BOTH the notify and\n\t\t\t// the write on it. Solid 2 batches writes until flush, so every\n\t\t\t// `value()` read inside one event window sees the same snapshot —\n\t\t\t// an \"unchanged\" call must therefore be a full no-op, or it would\n\t\t\t// clobber a write made earlier in the same window (e.g. useClick's\n\t\t\t// toggle-close immediately followed by the trigger's own\n\t\t\t// activation re-asserting the snapshot-stale active value). React\n\t\t\t// reaches the same observable result through handler ordering +\n\t\t\t// `setState` bail-out.\n\t\t\tconst prev = value();\n\t\t\tif (next !== prev) {\n\t\t\t\tprops.onValueChange?.(next, details);\n\t\t\t}\n\t\t\t// Base UI gates the state write AND the nested link-press\n\t\t\t// propagation on `eventDetails.isCanceled`.\n\t\t\tif (details.isCanceled) return;\n\n\t\t\tif (next !== prev) {\n\t\t\t\tsetUncontrolledValue(next);\n\t\t\t}\n\n\t\t\tif (\n\t\t\t\tnested &&\n\t\t\t\t!next &&\n\t\t\t\tdetails.reason === REASONS.linkPress &&\n\t\t\t\tparentRoot\n\t\t\t) {\n\t\t\t\tparentRoot.setValue(\n\t\t\t\t\tnull,\n\t\t\t\t\tdetails as NavigationMenuRootChangeEventDetails,\n\t\t\t\t);\n\t\t\t}\n\t\t});\n\n\t// Unmount — restores focus to the previous trigger unless the close reason\n\t// blocks return-focus (hover / outside press / focus out).\n\tconst handleUnmount = (): void => {\n\t\tconst doc = ownerDocument(rootRef.current);\n\t\tconst activeEl = activeElement(doc);\n\t\tconst reason = closeReasonRef.current;\n\t\tconst isBlocked = reason ? BLOCKED_RETURN_FOCUS_REASONS.has(reason) : false;\n\t\tconst popup = popupElement();\n\n\t\tif (\n\t\t\t!isBlocked &&\n\t\t\tprevTriggerElementRef.current instanceof HTMLElement &&\n\t\t\t(activeEl === doc.body || contains(popup, activeEl)) &&\n\t\t\tpopup\n\t\t) {\n\t\t\ttry {\n\t\t\t\tprevTriggerElementRef.current.focus({ preventScroll: true });\n\t\t\t} catch {\n\t\t\t\t/* happy-dom may throw if the element was detached */\n\t\t\t}\n\t\t\tprevTriggerElementRef.current = undefined;\n\t\t}\n\n\t\tsetMounted(false);\n\t\tprops.onOpenChangeComplete?.(false);\n\t\tsetActivationDirection(null);\n\t\tsetFloatingRootContext(undefined);\n\n\t\tcurrentContentRef.current = null;\n\t\tcloseReasonRef.current = undefined;\n\t};\n\n\t// Exit-animation deferred unmount. Mirrors React's two `useOpenChangeComplete`\n\t// invocations — one on popup, one on viewport-target (covers the inline\n\t// viewport-target variant).\n\tconst hasActionsRef = (): boolean => Boolean(props.actionsRef);\n\n\tconst popupRef: MutableRef<HTMLElement | null> = { current: null };\n\t// Mirror popupElement() into the plain ref slot for useOpenChangeComplete.\n\tcreateEffect(\n\t\t() => popupElement(),\n\t\t(el) => {\n\t\t\tpopupRef.current = el;\n\t\t},\n\t);\n\tconst viewportTargetRef: MutableRef<HTMLElement | null> = { current: null };\n\tcreateEffect(\n\t\t() => viewportTargetElement(),\n\t\t(el) => {\n\t\t\tviewportTargetRef.current = el;\n\t\t},\n\t);\n\n\tuseOpenChangeComplete({\n\t\tenabled: () => !hasActionsRef(),\n\t\topen,\n\t\tref: popupRef,\n\t\tonComplete: () => {\n\t\t\tif (!open()) handleUnmount();\n\t\t},\n\t});\n\tuseOpenChangeComplete({\n\t\tenabled: () => !hasActionsRef(),\n\t\topen,\n\t\tref: viewportTargetRef,\n\t\tonComplete: () => {\n\t\t\tif (!open()) handleUnmount();\n\t\t},\n\t});\n\n\t// Fire onOpenChangeComplete once transition has settled.\n\tcreateEffect(\n\t\t() => ({ o: open(), s: transitionStatus() }),\n\t\t({ o, s }) => {\n\t\t\tif (s === undefined) props.onOpenChangeComplete?.(o);\n\t\t},\n\t);\n\n\t// Imperative actions wiring.\n\tconst actions: NavigationMenuRootActions = {\n\t\tunmount: () => {\n\t\t\tsetMounted(false);\n\t\t\tsetActivationDirection(null);\n\t\t\tsetFloatingRootContext(undefined);\n\t\t\tcurrentContentRef.current = null;\n\t\t\tcloseReasonRef.current = undefined;\n\t\t\tprops.onOpenChangeComplete?.(false);\n\t\t},\n\t};\n\t// `actionsRef` is captured once at setup — the consumer either passes a\n\t// stable callback or a ref object, neither of which needs reactive\n\t// tracking. Snapshot through `untrack` to avoid\n\t// `[STRICT_READ_UNTRACKED]` from the root component-body scope.\n\tconst ar = untrack(() => props.actionsRef);\n\tif (typeof ar === \"function\") {\n\t\tar(actions);\n\t\tonCleanup(() => ar(null));\n\t} else if (ar && typeof ar === \"object\") {\n\t\tar.current = actions;\n\t\tonCleanup(() => {\n\t\t\tar.current = null;\n\t\t});\n\t}\n\n\tconst contextValue: NavigationMenuRootContextValue<Value> = {\n\t\topen,\n\t\tvalue: value as Accessor<Value | null>,\n\t\tsetValue,\n\t\tmounted,\n\t\ttransitionStatus,\n\t\tpositionerElement,\n\t\tsetPositionerElement,\n\t\tpopupElement,\n\t\tsetPopupElement,\n\t\tviewportElement,\n\t\tsetViewportElement,\n\t\tviewportTargetElement,\n\t\tsetViewportTargetElement,\n\t\tactivationDirection,\n\t\tsetActivationDirection,\n\t\tfloatingRootContext,\n\t\tsetFloatingRootContext,\n\t\tcurrentContentRef,\n\t\tnested,\n\t\trootRef,\n\t\tbeforeInsideRef,\n\t\tafterInsideRef,\n\t\tbeforeOutsideRef,\n\t\tafterOutsideRef,\n\t\tprevTriggerElementRef,\n\t\tpopupAutoSizeResetRef,\n\t\tdelay: navMenuPrimitive.delay,\n\t\tcloseDelay: navMenuPrimitive.closeDelay,\n\t\torientation: navMenuPrimitive.orientation,\n\t\tviewportInert,\n\t\tsetViewportInert,\n\t};\n\n\treturn (\n\t\t<NavigationMenuRootContext\n\t\t\tvalue={contextValue as NavigationMenuRootContextValue<unknown>}\n\t\t>\n\t\t\t<TreeContext\n\t\t\t\tcomponentProps={props}\n\t\t\t\trootRef={rootRef}\n\t\t\t\tnested={nested}\n\t\t\t\topen={open}\n\t\t\t/>\n\t\t</NavigationMenuRootContext>\n\t);\n}\n\nfunction TreeContext<Value>(props: {\n\tcomponentProps: NavigationMenuRootProps<Value>;\n\trootRef: MutableRef<HTMLElement | null>;\n\tnested: boolean;\n\topen: Accessor<boolean>;\n}): JSX.Element {\n\tconst nodeId = useFloatingNodeId();\n\n\tconst state = createMemo<NavigationMenuRootState>(() => ({\n\t\topen: props.open(),\n\t\tnested: props.nested,\n\t}));\n\n\tconst setRootRef = (el: HTMLElement | null): void => {\n\t\tprops.rootRef.current = el;\n\t};\n\n\tconst defaultTag = props.nested ? \"div\" : \"nav\";\n\n\tconst internal = {\n\t\tget \"data-open\"() {\n\t\t\treturn state().open ? \"\" : undefined;\n\t\t},\n\t\tget \"data-nested\"() {\n\t\t\treturn state().nested ? \"\" : undefined;\n\t\t},\n\t};\n\n\tconst userClassStyle = resolveClassStyle(props.componentProps, () => state());\n\n\tconst userProps = omit(\n\t\tprops.componentProps,\n\t\t\"as\",\n\t\t\"class\",\n\t\t\"style\",\n\t\t\"attrs\",\n\n\t\t\"children\",\n\t\t\"value\",\n\t\t\"defaultValue\",\n\t\t\"onValueChange\",\n\t\t\"delay\",\n\t\t\"closeDelay\",\n\t\t\"orientation\",\n\t\t\"onOpenChangeComplete\",\n\t\t\"actionsRef\",\n\t);\n\n\tlet merged: Record<string, unknown> = mergeRootProps(\n\t\tinternal,\n\t\tuserClassStyle,\n\t);\n\tmerged = mergeRootProps(merged, userProps);\n\n\tconst Tag = dynamic(() => props.componentProps.as ?? defaultTag);\n\treturn (\n\t\t<FloatingNode id={nodeId}>\n\t\t\t<Tag\n\t\t\t\t{...merged}\n\t\t\t\tref={composeRefs(setRootRef, userRef(props.componentProps))}\n\t\t\t>\n\t\t\t\t<NavigationMenuTreeContext value={nodeId ?? null}>\n\t\t\t\t\t{props.componentProps.children}\n\t\t\t\t</NavigationMenuTreeContext>\n\t\t\t</Tag>\n\t\t</FloatingNode>\n\t);\n}\n\n/**\n * Groups all parts of the navigation menu. Renders `<nav>` at the top level,\n * `<div>` when nested.\n */\nexport function NavigationMenuRoot<Value = unknown>(\n\tprops: NavigationMenuRootProps<Value>,\n): JSX.Element {\n\t// If we're already inside a FloatingTree (because we're nested or because\n\t// a parent root already wrapped us), don't wrap again.\n\tif (\n\t\tuseFloatingParentNodeId() != null ||\n\t\tuseNavigationMenuRootContext(true) != null\n\t) {\n\t\treturn <NavigationMenuRootComponent<Value> {...props} />;\n\t}\n\treturn (\n\t\t<FloatingTree>\n\t\t\t<NavigationMenuRootComponent<Value> {...props} />\n\t\t</FloatingTree>\n\t);\n}\n\nexport type {\n\tNavigationMenuRootChangeEventDetails,\n\tNavigationMenuRootChangeEventReason,\n};\n"],"mappings":"AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,OAAO,QAAQ,cAAc;AACtC,SAECC,YAAY,EACZC,UAAU,EACVC,YAAY,EACZC,IAAI,EACJC,SAAS,EACTC,OAAO,QACD,UAAU;AACjB,SAASC,OAAO,QAAQ,sCAAsC;AAC9D,SAASC,WAAW,EAAEC,OAAO,QAAQ,8BAA8B;AACnE,SAASC,qBAAqB,QAAQ,yCAAyC;AAC/E,SAASC,aAAa,QAAQ,oCAAoC;AAElE,SACCC,YAAY,EACZC,YAAY,EACZC,iBAAiB,EACjBC,uBAAuB,QACjB,sDAAsD;AAE7D,SACCC,aAAa,EACbC,QAAQ,QACF,2CAA2C;AAClD,SAASC,cAAc,QAAQ,kCAAkC;AACjE,SAASC,qBAAqB,QAAQ,iDAAiD;AACvF,SAASC,iBAAiB,QAAQ,qCAA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