{"version":3,"names":["dynamic","createEffect","createMemo","createSignal","omit","onCleanup","untrack","useDialogRootContext","useDialogPortalContext","composeRefs","userRef","FloatingFocusManager","mergeRootProps","resolveClassStyle","useIsoLayoutEffect","DrawerBackdropCssVars","useDrawerRootContext","useDrawerSnapPoints","useDrawerViewportContext","DrawerPopupCssVars","DrawerPopupDataAttributes","COMPOSITE_KEYS","Set","drawerSwipeVarsRegistered","registerSwipeCSSProperties","anyCSS","globalThis","CSS","registerProperty","name","swipeMovementX","swipeMovementY","snapPointOffset","syntax","inherits","initialValue","swipeProgress","swipeStrength","DrawerPopup","props","root","drawer","swipeCtx","snapPoints","activeSnapPoint","activeSnapPointOffset","nestedDrawerOpen","nestedOpenDrawerCount","swiping","popupHeight","setPopupHeightSig","ownedWrite","popupHeightRef","setPopupRef","el","popupRef","current","setPopupElement","mounted","popupEl","popupElement","nestedDrawerOpenFlag","onPopupHeightChange","undefined","measure","offsetHeight","frontmost","frontmostHeight","hasNested","hasNestedDrawer","keepHeightWhileNested","oldHeight","next","ResizeObserver","ro","observe","disconnect","sync","progress","nestedSwipeProgressStore","getSnapshot","style","setProperty","unsubscribe","subscribe","o","open","h","notifyParentFrontmostHeight","t","transitionStatus","notifyParentHasNestedDrawer","present","state","expanded","nested","nestedDrawerSwiping","nestedSwiping","swipeDirection","defaultInitialFocus","resolvedInitialFocus","initialFocus","resolvedFinalFocus","finalFocus","internal","role","tabIndex","hidden","aria-labelledby","titleId","aria-describedby","descriptionId","onKeyDown","event","has","key","stopPropagation","pts","swipeDir","offset","shouldApplySnapPoints","length","snapPointOffsetValue","ph","isEnding","shouldUseAutoHeight","heightVal","dragStyles","getDragStyles","strength","strengthVal","Number","isFinite","nestedDrawers","String","nestedOpenDialogCount","height","data-open","data-closed","data-starting-style","data-ending-style","v","userClassStyle","userProps","merged","interactions","getFloatingProps","Tag","as","modalValue","modal","closeOnFocusOut","disablePointerDismissal","floatingRootContext","openMethod"],"sources":["drawer-popup.tsx"],"sourcesContent":["import type { JSX, ValidComponent } from \"@solidjs/web\";\n/**\n * `<Drawer.Popup>` — container for the drawer contents.\n *\n * Mirrors Base UI React's `DrawerPopup`\n * (`packages/react/src/drawer/popup/DrawerPopup.tsx`). Wraps the rendered\n * element in `<FloatingFocusManager>` when modal/trap-focus; exposes\n * `initialFocus` / `finalFocus` overrides with the same union shape as\n * `<Dialog.Popup>`.\n *\n * Responsibilities beyond dialog's popup:\n *\n *  - Measures the popup `offsetHeight` on mount + via `ResizeObserver`,\n *    piping the result into `<Drawer.Root>`'s `onPopupHeightChange`.\n *  - Subscribes to the drawer root's `nestedSwipeProgressStore` and pushes\n *    `--drawer-swipe-progress` onto the element (non-reactive bridge).\n *  - Emits drawer-specific data-attrs: `data-expanded`,\n *    `data-nested-drawer-open`, `data-nested-drawer-swiping`,\n *    `data-swipe-direction`, `data-swiping`.\n *  - Applies snap-point offset + consumer swipe drag styles.\n *  - Forwards frontmost-height / nested-presence to the parent drawer\n *    (for stacked drawer layouts).\n *\n * happy-dom deferrals:\n *  - `offsetHeight` is 0 / `ResizeObserver` may be unavailable; the\n *    measurement paths are inert in the test env.\n *  - `CSS.registerProperty` is skipped when unavailable — same path as\n *    React.\n */\n\nimport { dynamic } from \"@solidjs/web\";\nimport {\n\tcreateEffect,\n\tcreateMemo,\n\tcreateSignal,\n\tomit,\n\tonCleanup,\n\tuntrack,\n} from \"solid-js\";\nimport { useDialogRootContext } from \"../../dialog/dialog-root-context\";\nimport { useDialogPortalContext } from \"../../dialog/portal/dialog-portal-context\";\nimport { composeRefs, userRef } from \"../../internals/compose-refs\";\nimport {\n\tFloatingFocusManager,\n\ttype InteractionType,\n} from \"../../internals/floating-ui/components/floating-focus-manager\";\nimport { mergeRootProps } from \"../../internals/merge-root-props\";\nimport { resolveClassStyle } from \"../../internals/resolve-class-style\";\nimport type { BaseUIComponentProps } from \"../../internals/types\";\nimport { useIsoLayoutEffect } from \"../../internals/use-iso-layout-effect\";\nimport type { TransitionStatus } from \"../../internals/use-transition-status/use-transition-status\";\nimport { DrawerBackdropCssVars } from \"../backdrop/drawer-backdrop-css-vars\";\nimport {\n\ttype DrawerSwipeDirection,\n\tuseDrawerRootContext,\n} from \"../root/drawer-root-context\";\nimport { useDrawerSnapPoints } from \"../root/use-drawer-snap-points\";\nimport { useDrawerViewportContext } from \"../viewport/drawer-viewport-context\";\nimport { DrawerPopupCssVars } from \"./drawer-popup-css-vars\";\nimport { DrawerPopupDataAttributes } from \"./drawer-popup-data-attributes\";\n\n/** Keys that the popup intercepts so they don't escape composite parents. */\nconst COMPOSITE_KEYS = new Set([\n\t\"ArrowUp\",\n\t\"ArrowDown\",\n\t\"ArrowLeft\",\n\t\"ArrowRight\",\n\t\"Home\",\n\t\"End\",\n\t\"PageUp\",\n\t\"PageDown\",\n]);\n\n// Module-level guard mirroring React's `drawerSwipeVarsRegistered`.\nlet drawerSwipeVarsRegistered = false;\n\nfunction registerSwipeCSSProperties(): void {\n\tif (drawerSwipeVarsRegistered) return;\n\tconst anyCSS = (globalThis as { CSS?: unknown }).CSS as\n\t\t| (typeof CSS & {\n\t\t\t\tregisterProperty?: (desc: {\n\t\t\t\t\tname: string;\n\t\t\t\t\tsyntax: string;\n\t\t\t\t\tinherits: boolean;\n\t\t\t\t\tinitialValue: string;\n\t\t\t\t}) => void;\n\t\t  })\n\t\t| undefined;\n\tif (anyCSS && typeof anyCSS.registerProperty === \"function\") {\n\t\tfor (const name of [\n\t\t\tDrawerPopupCssVars.swipeMovementX,\n\t\t\tDrawerPopupCssVars.swipeMovementY,\n\t\t\tDrawerPopupCssVars.snapPointOffset,\n\t\t]) {\n\t\t\ttry {\n\t\t\t\tanyCSS.registerProperty?.({\n\t\t\t\t\tname,\n\t\t\t\t\tsyntax: \"<length>\",\n\t\t\t\t\tinherits: false,\n\t\t\t\t\tinitialValue: \"0px\",\n\t\t\t\t});\n\t\t\t} catch {\n\t\t\t\t/* ignore */\n\t\t\t}\n\t\t}\n\t\tfor (const { name, initialValue } of [\n\t\t\t{ name: DrawerBackdropCssVars.swipeProgress, initialValue: \"0\" },\n\t\t\t{ name: DrawerPopupCssVars.swipeStrength, initialValue: \"1\" },\n\t\t]) {\n\t\t\ttry {\n\t\t\t\tanyCSS.registerProperty?.({\n\t\t\t\t\tname,\n\t\t\t\t\tsyntax: \"<number>\",\n\t\t\t\t\tinherits: false,\n\t\t\t\t\tinitialValue,\n\t\t\t\t});\n\t\t\t} catch {\n\t\t\t\t/* ignore */\n\t\t\t}\n\t\t}\n\t}\n\tdrawerSwipeVarsRegistered = true;\n}\n\nexport interface DrawerPopupState {\n\topen: boolean;\n\ttransitionStatus: TransitionStatus;\n\texpanded: boolean;\n\tnested: boolean;\n\tnestedDrawerOpen: boolean;\n\tnestedDrawerSwiping: boolean;\n\tswipeDirection: DrawerSwipeDirection;\n\tswiping: boolean;\n}\n\nexport type DrawerFocusHandle =\n\t| boolean\n\t| HTMLElement\n\t| { current: HTMLElement | null }\n\t| ((t: InteractionType) => boolean | HTMLElement | null | undefined);\n\nexport interface DrawerPopupProps\n\textends BaseUIComponentProps<\"div\", DrawerPopupState> {\n\t/**\n\t * Tag/component to render. Defaults to `\"div\"`. Replaces the\n\t * pre-spike `render` prop (axis G).\n\t */\n\tas?: ValidComponent;\n\tinitialFocus?: DrawerFocusHandle | undefined;\n\tfinalFocus?: DrawerFocusHandle | undefined;\n}\n\n/**\n * A container for the drawer contents. Renders a `<div>` element.\n */\nexport function DrawerPopup(props: DrawerPopupProps): JSX.Element {\n\tconst root = useDialogRootContext();\n\tconst drawer = useDrawerRootContext();\n\tuseDialogPortalContext();\n\n\tconst swipeCtx = useDrawerViewportContext(true);\n\tconst { snapPoints, activeSnapPoint, activeSnapPointOffset } =\n\t\tuseDrawerSnapPoints();\n\n\tconst nestedDrawerOpen = (): boolean => root.nestedOpenDrawerCount() > 0;\n\t// `nestedOpenDrawerCount` is wired on the dialog context; drawers\n\t// increment on open (via `IsDrawerContext`). We project it to a\n\t// drawer-specific attr.\n\n\tconst swiping = (): boolean => swipeCtx?.swiping() ?? false;\n\tconst swipeStrength = (): number | null => swipeCtx?.swipeStrength() ?? null;\n\n\tconst [popupHeight, setPopupHeightSig] = createSignal(0, {\n\t\townedWrite: true,\n\t});\n\tlet popupHeightRef = 0;\n\n\tconst setPopupRef = (el: HTMLElement | null): void => {\n\t\troot.popupRef.current = el;\n\t\troot.setPopupElement(el);\n\t};\n\n\t// Measure height + observe resizes, forwarding to drawer.onPopupHeightChange.\n\tuseIsoLayoutEffect(\n\t\t() => ({\n\t\t\tmounted: root.mounted(),\n\t\t\tpopupEl: root.popupElement(),\n\t\t\tnestedDrawerOpenFlag: nestedDrawerOpen(),\n\t\t}),\n\t\t({ mounted, popupEl }) => {\n\t\t\tif (!mounted) {\n\t\t\t\tpopupHeightRef = 0;\n\t\t\t\tsetPopupHeightSig(0);\n\t\t\t\tdrawer.onPopupHeightChange(0);\n\t\t\t\treturn undefined;\n\t\t\t}\n\t\t\tif (!popupEl) return undefined;\n\t\t\tregisterSwipeCSSProperties();\n\n\t\t\t// `measure` is a side-effect helper: it reads the latest snapshot\n\t\t\t// of `drawer.frontmostHeight()` / `drawer.hasNestedDrawer()` to\n\t\t\t// decide whether to update `popupHeightRef`. Re-runs are driven\n\t\t\t// by the compute object above (and ResizeObserver), so the reads\n\t\t\t// are snapshots, not subscriptions. Wrap in `untrack` to avoid\n\t\t\t// `[STRICT_READ_UNTRACKED]` when invoked from this apply scope\n\t\t\t// or from the ResizeObserver callback (which also lands outside\n\t\t\t// any tracking owner).\n\t\t\tconst measure = (): void =>\n\t\t\t\tuntrack(() => {\n\t\t\t\t\tconst offsetHeight = popupEl.offsetHeight;\n\t\t\t\t\tconst frontmost = drawer.frontmostHeight();\n\t\t\t\t\tconst hasNested = drawer.hasNestedDrawer();\n\n\t\t\t\t\tif (\n\t\t\t\t\t\tpopupHeightRef > 0 &&\n\t\t\t\t\t\tfrontmost > popupHeightRef &&\n\t\t\t\t\t\toffsetHeight > popupHeightRef\n\t\t\t\t\t) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tconst keepHeightWhileNested = popupHeightRef > 0 && hasNested;\n\t\t\t\t\tif (keepHeightWhileNested) {\n\t\t\t\t\t\tconst oldHeight = popupHeightRef;\n\t\t\t\t\t\tsetPopupHeightSig(oldHeight);\n\t\t\t\t\t\tdrawer.onPopupHeightChange(oldHeight);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tconst next = offsetHeight;\n\t\t\t\t\tif (next === popupHeightRef) return;\n\t\t\t\t\tpopupHeightRef = next;\n\t\t\t\t\tsetPopupHeightSig(next);\n\t\t\t\t\tdrawer.onPopupHeightChange(next);\n\t\t\t\t});\n\n\t\t\tmeasure();\n\n\t\t\tif (typeof ResizeObserver !== \"function\") return undefined;\n\t\t\tconst ro = new ResizeObserver(measure);\n\t\t\tro.observe(popupEl);\n\t\t\treturn () => {\n\t\t\t\tro.disconnect();\n\t\t\t};\n\t\t},\n\t);\n\n\t// Subscribe to nested-swipe-progress store, push backdrop swipe-progress\n\t// CSS var onto the popup. Non-reactive bridge matching React.\n\tuseIsoLayoutEffect(\n\t\t() => root.popupElement(),\n\t\t(popupEl) => {\n\t\t\tif (!popupEl) return undefined;\n\t\t\tconst sync = (): void => {\n\t\t\t\tconst progress = drawer.nestedSwipeProgressStore.getSnapshot();\n\t\t\t\tpopupEl.style.setProperty(\n\t\t\t\t\tDrawerBackdropCssVars.swipeProgress,\n\t\t\t\t\tprogress > 0 ? `${progress}` : \"0\",\n\t\t\t\t);\n\t\t\t};\n\t\t\tsync();\n\t\t\tconst unsubscribe = drawer.nestedSwipeProgressStore.subscribe(sync);\n\t\t\treturn () => {\n\t\t\t\tunsubscribe();\n\t\t\t\tpopupEl.style.setProperty(DrawerBackdropCssVars.swipeProgress, \"0\");\n\t\t\t};\n\t\t},\n\t);\n\n\t// Forward frontmost height upward when open.\n\t// `notifyParentFrontmostHeight` may itself read parent reactive state in\n\t// its body — we untrack the side-effect call so those reads don't trip\n\t// `[STRICT_READ_UNTRACKED]` from this unowned apply scope. The compute\n\t// object already drives re-runs.\n\tcreateEffect(\n\t\t() => ({ o: root.open(), h: drawer.frontmostHeight() }),\n\t\t({ o, h }) => {\n\t\t\tif (!o) return undefined;\n\t\t\tuntrack(() => drawer.notifyParentFrontmostHeight?.(h));\n\t\t\treturn () => {\n\t\t\t\tuntrack(() => drawer.notifyParentFrontmostHeight?.(0));\n\t\t\t};\n\t\t},\n\t);\n\n\t// Forward nested-drawer presence upward.\n\tcreateEffect(\n\t\t() => ({ o: root.open(), t: root.transitionStatus() }),\n\t\t({ o, t }) => {\n\t\t\tif (!drawer.notifyParentHasNestedDrawer) return undefined;\n\t\t\tconst present = o || t === \"ending\";\n\t\t\tuntrack(() => drawer.notifyParentHasNestedDrawer?.(present));\n\t\t\treturn () => {\n\t\t\t\tuntrack(() => drawer.notifyParentHasNestedDrawer?.(false));\n\t\t\t};\n\t\t},\n\t);\n\n\tonCleanup(() => {\n\t\tdrawer.notifyParentHasNestedDrawer?.(false);\n\t});\n\n\tconst state = createMemo<DrawerPopupState>(() => ({\n\t\topen: root.open(),\n\t\ttransitionStatus: root.transitionStatus(),\n\t\texpanded: activeSnapPoint() === 1,\n\t\tnested: root.nested(),\n\t\tnestedDrawerOpen: nestedDrawerOpen(),\n\t\tnestedDrawerSwiping: drawer.nestedSwiping(),\n\t\tswipeDirection: drawer.swipeDirection(),\n\t\tswiping: swiping(),\n\t}));\n\n\tconst defaultInitialFocus = (t: InteractionType) => {\n\t\tif (t === \"touch\") return root.popupRef.current;\n\t\treturn true;\n\t};\n\tconst resolvedInitialFocus = () => props.initialFocus ?? defaultInitialFocus;\n\tconst resolvedFinalFocus = () => props.finalFocus ?? true;\n\n\tconst internal = {\n\t\trole: \"dialog\",\n\t\ttabIndex: -1,\n\t\tget hidden() {\n\t\t\treturn !root.mounted();\n\t\t},\n\t\tget \"aria-labelledby\"() {\n\t\t\treturn root.titleId() ?? \"\";\n\t\t},\n\t\tget \"aria-describedby\"() {\n\t\t\treturn root.descriptionId() ?? \"\";\n\t\t},\n\t\tonKeyDown(event: KeyboardEvent) {\n\t\t\tif (COMPOSITE_KEYS.has(event.key)) event.stopPropagation();\n\t\t},\n\t\tget style(): JSX.CSSProperties {\n\t\t\tconst pts = snapPoints();\n\t\t\tconst swipeDir = drawer.swipeDirection();\n\t\t\tconst offset = activeSnapPointOffset();\n\t\t\tconst shouldApplySnapPoints =\n\t\t\t\tpts && pts.length > 0 && (swipeDir === \"down\" || swipeDir === \"up\");\n\t\t\tlet snapPointOffsetValue: number | null = null;\n\t\t\tif (shouldApplySnapPoints && offset !== null) {\n\t\t\t\tsnapPointOffsetValue = swipeDir === \"up\" ? -offset : offset;\n\t\t\t}\n\n\t\t\tconst frontmost = drawer.frontmostHeight();\n\t\t\tconst ph = popupHeight();\n\t\t\tconst hasNested = drawer.hasNestedDrawer();\n\t\t\tconst isEnding = root.transitionStatus() === \"ending\";\n\t\t\tconst shouldUseAutoHeight = !hasNested && !isEnding;\n\t\t\tconst heightVal = ph && !shouldUseAutoHeight ? `${ph}px` : undefined;\n\n\t\t\tconst dragStyles = swipeCtx ? swipeCtx.getDragStyles() : {};\n\n\t\t\tconst strength = swipeStrength();\n\t\t\tconst strengthVal =\n\t\t\t\ttypeof strength === \"number\" &&\n\t\t\t\tNumber.isFinite(strength) &&\n\t\t\t\tstrength > 0\n\t\t\t\t\t? `${strength}`\n\t\t\t\t\t: \"1\";\n\n\t\t\treturn {\n\t\t\t\t...(dragStyles as JSX.CSSProperties),\n\t\t\t\t[DrawerBackdropCssVars.swipeProgress]: \"0\",\n\t\t\t\t[DrawerPopupCssVars.nestedDrawers]: String(\n\t\t\t\t\troot.nestedOpenDialogCount(),\n\t\t\t\t),\n\t\t\t\t[DrawerPopupCssVars.height]: heightVal as string | undefined,\n\t\t\t\t[DrawerPopupCssVars.snapPointOffset]:\n\t\t\t\t\ttypeof snapPointOffsetValue === \"number\"\n\t\t\t\t\t\t? `${snapPointOffsetValue}px`\n\t\t\t\t\t\t: \"0px\",\n\t\t\t\t[DrawerPopupCssVars.frontmostHeight]: frontmost\n\t\t\t\t\t? `${frontmost}px`\n\t\t\t\t\t: undefined,\n\t\t\t\t[DrawerPopupCssVars.swipeStrength]: strengthVal,\n\t\t\t} as JSX.CSSProperties;\n\t\t},\n\t\tget \"data-open\"() {\n\t\t\treturn state().open ? \"\" : undefined;\n\t\t},\n\t\tget \"data-closed\"() {\n\t\t\treturn state().open ? undefined : \"\";\n\t\t},\n\t\tget \"data-starting-style\"() {\n\t\t\treturn state().transitionStatus === \"starting\" ? \"\" : undefined;\n\t\t},\n\t\tget \"data-ending-style\"() {\n\t\t\treturn state().transitionStatus === \"ending\" ? \"\" : undefined;\n\t\t},\n\t\tget [DrawerPopupDataAttributes.expanded]() {\n\t\t\treturn state().expanded ? \"\" : undefined;\n\t\t},\n\t\tget [DrawerPopupDataAttributes.nestedDrawerOpen]() {\n\t\t\treturn state().nestedDrawerOpen ? \"\" : undefined;\n\t\t},\n\t\tget [DrawerPopupDataAttributes.nestedDrawerSwiping]() {\n\t\t\treturn state().nestedDrawerSwiping ? \"\" : undefined;\n\t\t},\n\t\tget [DrawerPopupDataAttributes.swipeDirection]() {\n\t\t\tconst v = state().swipeDirection;\n\t\t\treturn v ? v : undefined;\n\t\t},\n\t\tget [DrawerPopupDataAttributes.swiping]() {\n\t\t\treturn state().swiping ? \"\" : undefined;\n\t\t},\n\t};\n\n\tconst userClassStyle = resolveClassStyle(props, () => state());\n\n\tconst userProps = omit(\n\t\tprops,\n\t\t\"as\",\n\t\t\"class\",\n\t\t\"style\",\n\t\t\"attrs\",\n\n\t\t\"initialFocus\",\n\t\t\"finalFocus\",\n\t);\n\n\tlet merged: Record<string, unknown> = mergeRootProps(\n\t\troot.interactions.getFloatingProps(),\n\t\tinternal,\n\t);\n\tmerged = mergeRootProps(merged, userClassStyle);\n\tmerged = mergeRootProps(merged, userProps);\n\n\tconst Tag = dynamic(() => props.as ?? \"div\");\n\tconst popupEl = (\n\t\t<Tag {...merged} ref={composeRefs(setPopupRef, userRef(props))} />\n\t);\n\n\tconst modalValue = (): boolean => root.modal() !== false;\n\tconst closeOnFocusOut = (): boolean => !root.disablePointerDismissal();\n\n\treturn (\n\t\t<FloatingFocusManager\n\t\t\tcontext={root.floatingRootContext}\n\t\t\topenInteractionType={root.openMethod()}\n\t\t\tdisabled={!root.mounted()}\n\t\t\tcloseOnFocusOut={closeOnFocusOut()}\n\t\t\tinitialFocus={resolvedInitialFocus()}\n\t\t\treturnFocus={resolvedFinalFocus()}\n\t\t\tmodal={modalValue()}\n\t\t\trestoreFocus=\"popup\"\n\t\t>\n\t\t\t{popupEl}\n\t\t</FloatingFocusManager>\n\t);\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;AACA;AACA;AACA;;AAEA,SAASA,OAAO,QAAQ,cAAc;AACtC,SACCC,YAAY,EACZC,UAAU,EACVC,YAAY,EACZC,IAAI,EACJC,SAAS,EACTC,OAAO,QACD,UAAU;AACjB,SAASC,oBAAoB,QAAQ,kCAAkC;AACvE,SAASC,sBAAsB,QAAQ,2CAA2C;AAClF,SAASC,WAAW,EAAEC,OAAO,QAAQ,8BAA8B;AACnE,SACCC,oBAAoB,QAEd,+DAA+D;AACtE,SAASC,cAAc,QAAQ,kCAAkC;AACjE,SAASC,iBAAiB,QAAQ,qCAAqC;AAEvE,SAASC,kBAAkB,QAAQ,uCAAuC;AAE1E,SAASC,qBAAqB,QAAQ,sCAAsC;AAC5E,SAECC,oBAAoB,QACd,6BAA6B;AACpC,SAASC,mBAAmB,QAAQ,gCAAgC;AACpE,SAASC,wBAAwB,QAAQ,qCAAqC;AAC9E,SAASC,kBAAkB,QAAQ,yBAAyB;AAC5D,SAASC,yBAAyB,QAAQ,gCAAgC;;AAE1E;AACA,MAAMC,cAAc,GA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