{"version":3,"file":"dialog.mjs","sources":["../src/dialog/DialogRoot.ts","../src/dialog/DialogClose.ts","../src/dialog/DialogClose.vue","../src/dialog/DialogContent.ts","../src/dialog/DialogContentImpl.ts","../src/dialog/DialogContentImpl.vue","../src/dialog/DialogContent.vue","../src/dialog/DialogDescription.ts","../src/dialog/DialogDescription.vue","../src/dialog/DialogOverlay.ts","../src/dialog/DialogOverlay.vue","../src/dialog/DialogRoot.vue","../src/dialog/DialogTitle.ts","../src/dialog/DialogTitle.vue","../src/dialog/DialogTrigger.ts","../src/dialog/DialogTrigger.vue"],"sourcesContent":["import type { EmitsToHookProps, PrimitiveDefaultProps } from '../shared/index.ts'\nimport { type Ref, shallowRef } from 'vue'\nimport { createContext, type MutableRefObject, useControllableStateV2, useId, useRef } from '../hooks/index.ts'\n\nexport interface DialogRootProps {\n  open?: boolean\n  defaultOpen?: boolean\n  modal?: boolean\n}\n\nexport const DEFAULT_DIALOG_ROOT_PROPS = {\n  open: undefined,\n  defaultOpen: undefined,\n  modal: undefined,\n} satisfies PrimitiveDefaultProps<DialogRootProps>\n\nexport type DialogRootEmits = {\n  'update:open': [open: boolean]\n}\n\nexport interface DialogContext {\n  triggerRef: MutableRefObject<HTMLElement | undefined>\n  content: Ref<HTMLElement | undefined>\n  contentId: string\n  titleId: string\n  descriptionId: string\n  open: Ref<boolean>\n  onOpenChange: (open: boolean) => void\n  onOpenToggle: () => void\n  modal: boolean\n}\n\nexport const [provideDialogContext, useDialogContext] = createContext<DialogContext>('Dialog')\n\nexport interface UseDialogRootProps extends EmitsToHookProps<DialogRootEmits> {\n  triggerRef?: MutableRefObject<HTMLElement | undefined>\n  content?: Ref<HTMLElement | undefined>\n\n  open?: () => boolean | undefined\n  defaultOpen?: boolean\n  modal?: boolean\n}\n\nexport function useDialogRoot(props: UseDialogRootProps) {\n  const {\n    modal = true,\n    defaultOpen = false,\n  } = props\n  const triggerRef = props.content || useRef<HTMLElement>()\n  const content = props.content || shallowRef<HTMLElement>()\n\n  const open = useControllableStateV2(props.open, props.onUpdateOpen, defaultOpen)\n\n  provideDialogContext({\n    triggerRef,\n    content,\n    contentId: useId(),\n    titleId: useId(),\n    descriptionId: useId(),\n    open,\n    modal,\n    onOpenChange(value) {\n      open.value = value\n    },\n    onOpenToggle() {\n      open.value = !open.value\n    },\n  })\n}\n","import type { PrimitiveProps } from '../primitive/index.ts'\nimport type { PrimitiveDefaultProps, RadixPrimitiveReturns } from '../shared/index.ts'\nimport { mergePrimitiveAttrs } from '../shared/index.ts'\nimport { useDialogContext } from './DialogRoot.ts'\n\nexport interface DialogCloseProps {\n  as?: PrimitiveProps['as']\n}\n\nexport const DEFAULT_DIALOG_CLOSE_PROPS = {\n  as: 'button',\n} satisfies PrimitiveDefaultProps<DialogCloseProps>\n\nexport function useDialogClose(): RadixPrimitiveReturns {\n  const context = useDialogContext('DialogClose')\n\n  function onClick(event: MouseEvent) {\n    if (event.defaultPrevented)\n      return\n    context.onOpenChange(false)\n  }\n\n  return {\n    attrs(extraAttrs) {\n      const attrs = {\n        onClick,\n      }\n\n      if (extraAttrs && extraAttrs.length > 0) {\n        mergePrimitiveAttrs(attrs, extraAttrs)\n      }\n\n      return attrs\n    },\n  }\n}\n","<script setup lang=\"ts\">\nimport { Primitive } from '../primitive/index.ts'\nimport { normalizeAttrs } from '../shared/index.ts'\nimport { DEFAULT_DIALOG_CLOSE_PROPS, type DialogCloseProps, useDialogClose } from './DialogClose.ts'\n\ndefineOptions({\n  name: 'DialogClose',\n})\n\nwithDefaults(defineProps<DialogCloseProps>(), DEFAULT_DIALOG_CLOSE_PROPS)\n\nconst dialogClose = useDialogClose()\n</script>\n\n<template>\n  <Primitive v-bind=\"normalizeAttrs(dialogClose.attrs([$attrs, { as }]))\">\n    <slot />\n  </Primitive>\n</template>\n","import type { PrimitiveDefaultProps, RadixPrimitiveReturns } from '../shared/index.ts'\nimport { type Ref, shallowRef } from 'vue'\nimport { usePresence } from '../presence/index.ts'\nimport { useDialogContext } from './DialogRoot.ts'\n\nexport interface DialogContentProps {\n  /**\n   * Used to force mounting when more control is needed. Useful when\n   * controlling transntion with Vue native transition or other animation libraries.\n   */\n  forceMount?: boolean\n}\n\nexport const DEFAULT_DIALOG_CONTENT_PROPS = {\n  forceMount: undefined,\n} satisfies PrimitiveDefaultProps<DialogContentProps>\n\nexport interface UseDialogContent {\n  forceMount?: boolean\n}\n\nexport function useDialogContent(props: UseDialogContent): RadixPrimitiveReturns<{\n  isPresent: Ref<boolean>\n}> {\n  const context = useDialogContext('DialogContent')\n\n  const isPresent = props.forceMount ? shallowRef(true) : usePresence(context.content, context.open)\n\n  return {\n    isPresent,\n  }\n}\n","import type { EmitsToHookProps, RadixPrimitiveReturns } from '../shared/index.ts'\nimport { hideOthers } from 'aria-hidden'\nimport { onBeforeUnmount, onMounted, shallowRef } from 'vue'\nimport { type DismissableLayerEmits, useDismissableLayer, type UseDismissableLayerProps } from '../dismissable-layer/index.ts'\nimport { useFocusGuards } from '../focus-guards/index.ts'\nimport { useFocusScope } from '../focus-scope/index.ts'\nimport { useDialogContext } from './DialogRoot.ts'\n\nexport type DialogContentImplEmits = {\n  /**\n   * Event handler called when auto-focusing on open.\n   * Can be prevented.\n   */\n  openAutoFocus: [event: Event]\n  /**\n   * Event handler called when auto-focusing on close.\n   * Can be prevented.\n   */\n  closeAutoFocus: [event: Event]\n} & Omit<DismissableLayerEmits, 'dismiss'>\n\nexport interface UseDialogContentImplProps extends Omit<UseDialogContentImplSharedProps, 'trapFocus' | 'disableOutsidePointerEvents'> { }\n\nexport function useDialogContentImpl(props: UseDialogContentImplProps): RadixPrimitiveReturns {\n  const context = useDialogContext('DialogContent')\n\n  const useDialogContent = context.modal ? useDialogContentImplModal : useDialogContentImplNonModal\n\n  return useDialogContent(props)\n}\n\nexport function useDialogContentImplModal(props: UseDialogContentImplProps): RadixPrimitiveReturns {\n  const context = useDialogContext('DialogContentModal')\n\n  // aria-hide everything except the content (better supported equivalent to setting aria-modal)\n  let clearHideOthers: (() => void) | undefined\n\n  onMounted(() => {\n    if (context.content.value)\n      clearHideOthers = hideOthers(context.content.value)\n  })\n\n  onBeforeUnmount(() => {\n    clearHideOthers?.()\n    clearHideOthers = undefined\n  })\n\n  return useDialogContentImplShared({\n    trapFocus() {\n      return context.open.value\n    },\n    disableOutsidePointerEvents() {\n      return true\n    },\n    onCloseAutoFocus(event) {\n      props.onCloseAutoFocus?.(event)\n      if (event.defaultPrevented)\n        return\n\n      event.preventDefault()\n      context.triggerRef.value?.focus()\n    },\n    onOpenAutoFocus: props.onOpenAutoFocus,\n    onInteractOutside: props.onInteractOutside,\n    onPointerdownOutside(event) {\n      props.onPointerdownOutside?.(event)\n      if (event.defaultPrevented)\n        return\n      const originalEvent = event.detail.originalEvent\n      const ctrlLeftClick = originalEvent.button === 0 && originalEvent.ctrlKey === true\n      const isRightClick = originalEvent.button === 2 || ctrlLeftClick\n\n      // If the event is a right-click, we shouldn't close because\n      // it is effectively as if we right-clicked the `Overlay`.\n      if (isRightClick)\n        event.preventDefault()\n    },\n    onFocusOutside(event) {\n      props.onFocusOutside?.(event)\n      if (event.defaultPrevented)\n        return\n\n      event.preventDefault()\n    },\n    onEscapeKeydown: props.onEscapeKeydown,\n  })\n}\n\nexport function useDialogContentImplNonModal(props: UseDialogContentImplProps): RadixPrimitiveReturns {\n  const context = useDialogContext('DialogContentNonModal')\n\n  let hasInteractedOutsideRef = false\n  let hasPointerdownOutsideRef = false\n\n  return useDialogContentImplShared({\n    trapFocus() {\n      return false\n    },\n    disableOutsidePointerEvents() {\n      return false\n    },\n    onCloseAutoFocus(event) {\n      props.onCloseAutoFocus?.(event)\n\n      if (!event.defaultPrevented) {\n        if (!hasInteractedOutsideRef) {\n          context.triggerRef.value?.focus()\n        }\n        // Always prevent auto focus because we either focus manually or want user agent focus\n        event.preventDefault()\n      }\n\n      hasInteractedOutsideRef = false\n      hasPointerdownOutsideRef = false\n    },\n    onOpenAutoFocus: props.onOpenAutoFocus,\n    onInteractOutside(event) {\n      props.onInteractOutside?.(event)\n\n      if (!event.defaultPrevented) {\n        hasInteractedOutsideRef = true\n        if (event.detail.originalEvent.type === 'pointerdown') {\n          hasPointerdownOutsideRef = true\n        }\n      }\n\n      // Prevent dismissing when clicking the trigger.\n      // As the trigger is already setup to close, without doing so would\n      // cause it to close and immediately open.\n      const target = event.target as HTMLElement\n      const targetIsTrigger = context.triggerRef.value?.contains(target)\n      if (targetIsTrigger)\n        event.preventDefault()\n\n      // On Safari if the trigger is inside a container with tabIndex={0}, when clicked\n      // we will get the pointer down outside event on the trigger, but then a subsequent\n      // focus outside event on the container, we ignore any focus outside event when we've\n      // already had a pointer down outside event.\n      if (event.detail.originalEvent.type === 'focusin' && hasPointerdownOutsideRef) {\n        event.preventDefault()\n      }\n    },\n    onPointerdownOutside: props.onPointerdownOutside,\n    onFocusOutside: props.onFocusOutside,\n    onEscapeKeydown: props.onEscapeKeydown,\n  })\n}\n\nexport interface UseDialogContentImplSharedProps extends EmitsToHookProps<DialogContentImplEmits>, Omit<UseDismissableLayerProps, 'onDismiss'> {\n  trapFocus?: () => boolean\n}\n\nexport function useDialogContentImplShared(props: UseDialogContentImplSharedProps): RadixPrimitiveReturns {\n  const context = useDialogContext('DialogContentNonModal')\n\n  const el = props.el || shallowRef<HTMLElement>()\n  const setElRef = props.el\n    ? undefined\n    : (value: HTMLElement | undefined) => {\n        el.value = value\n        context.content.value = value\n      }\n\n  // Make sure the whole tree has focus guards as our `Dialog` will be\n  // the last element in the DOM (because of the `Portal`)\n  useFocusGuards()\n\n  const dismissableLayer = useDismissableLayer({\n    el,\n    disableOutsidePointerEvents: props.disableOutsidePointerEvents,\n    onPointerdownOutside: props.onPointerdownOutside,\n    onFocusOutside: props.onFocusOutside,\n    onInteractOutside: props.onInteractOutside,\n    onEscapeKeydown: props.onEscapeKeydown,\n    onDismiss() {\n      context.onOpenChange(false)\n    },\n  })\n\n  const focusScope = useFocusScope({\n    el,\n    loop: true,\n    trapped: props.trapFocus,\n    onMountAutoFocus: props.onOpenAutoFocus,\n    onUnmountAutoFocus: props.onCloseAutoFocus,\n  })\n\n  return {\n    attrs(extraAttrs = []) {\n      const dismissableAttrs = {\n        'elRef': setElRef,\n        'role': 'dialog',\n        'id': context.contentId,\n        'aria-describedby': context.descriptionId,\n        'aria-labelledby': context.titleId,\n        'data-state': context.open.value ? 'open' : 'closed',\n      }\n\n      return dismissableLayer.attrs([focusScope.attrs(), dismissableAttrs, ...extraAttrs])\n    },\n  }\n}\n","<script setup lang=\"ts\">\nimport { Primitive } from '../primitive/index.ts'\nimport { type EmitsToHookProps, normalizeAttrs } from '../shared/index.ts'\nimport { type DialogContentImplEmits, useDialogContentImpl } from './DialogContentImpl.ts'\n\ndefineOptions({\n  name: 'DialogContentImpl',\n  inheritAttrs: false,\n})\n\nconst emit = defineEmits<DialogContentImplEmits>()\n\nconst dialogContentImpl = useDialogContentImpl({\n  onOpenAutoFocus(event) {\n    emit('openAutoFocus', event)\n  },\n  onCloseAutoFocus(event) {\n    emit('closeAutoFocus', event)\n  },\n  onEscapeKeydown(event) {\n    emit('escapeKeydown', event)\n  },\n  onPointerdownOutside(event) {\n    emit('pointerdownOutside', event)\n  },\n  onFocusOutside(event) {\n    emit('focusOutside', event)\n  },\n  onInteractOutside(event) {\n    emit('interactOutside', event)\n  },\n} satisfies Required<EmitsToHookProps<DialogContentImplEmits>>)\n</script>\n\n<template>\n  <Primitive v-bind=\"normalizeAttrs(dialogContentImpl.attrs([$attrs]))\">\n    <slot />\n  </Primitive>\n</template>\n","<script setup lang=\"ts\">\nimport { convertPropsToHookProps } from '../shared/index.ts'\nimport { DEFAULT_DIALOG_CONTENT_PROPS, type DialogContentProps, useDialogContent } from './DialogContent.ts'\nimport DialogContentImpl from './DialogContentImpl.vue'\n\ndefineOptions({\n  name: 'DialogContent',\n})\n\nconst props = withDefaults(defineProps<DialogContentProps>(), DEFAULT_DIALOG_CONTENT_PROPS)\n\nconst dialogContent = useDialogContent(convertPropsToHookProps(props))\n</script>\n\n<template>\n  <DialogContentImpl v-if=\"dialogContent.isPresent.value\">\n    <slot />\n  </DialogContentImpl>\n</template>\n","import type { PrimitiveProps } from '../primitive/index.ts'\nimport { mergePrimitiveAttrs, type PrimitiveDefaultProps, type RadixPrimitiveReturns } from '../shared/index.ts'\nimport { useDialogContext } from './DialogRoot.ts'\n\nexport interface DialogDescriptionProps {\n  as?: PrimitiveProps['as']\n}\n\nexport const DEFAULT_DIALOG_DESCRIPTION_PROPS = {\n  as: 'p',\n} satisfies PrimitiveDefaultProps<DialogDescriptionProps>\n\nexport function useDialogDescription(): RadixPrimitiveReturns {\n  const context = useDialogContext('DialogDescription')\n\n  return {\n    attrs(extraAttrs) {\n      const attrs = {\n        id: context.descriptionId,\n      }\n\n      if (extraAttrs && extraAttrs.length > 0) {\n        mergePrimitiveAttrs(attrs, extraAttrs)\n      }\n\n      return attrs\n    },\n  }\n}\n","<script setup lang=\"ts\">\nimport { Primitive } from '../primitive/index.ts'\nimport { normalizeAttrs } from '../shared/index.ts'\nimport { DEFAULT_DIALOG_DESCRIPTION_PROPS, type DialogDescriptionProps, useDialogDescription } from './DialogDescription.ts'\n\ndefineOptions({\n  name: 'DialogDescription',\n  inheritAttrs: false,\n})\n\nwithDefaults(defineProps<DialogDescriptionProps>(), DEFAULT_DIALOG_DESCRIPTION_PROPS)\n\nconst dialogDescription = useDialogDescription()\n</script>\n\n<template>\n  <Primitive v-bind=\"normalizeAttrs(dialogDescription.attrs([$attrs, { as }]))\">\n    <slot />\n  </Primitive>\n</template>\n","import { onWatcherCleanup, type Ref, shallowRef, watchEffect } from 'vue'\nimport { useBodyScrollLock } from '../hooks/index.ts'\nimport { usePresence } from '../presence/index.ts'\nimport {\n  mergePrimitiveAttrs,\n  type PrimitiveDefaultProps,\n  type RadixPrimitiveGetAttrs,\n  type RadixPrimitiveReturns,\n} from '../shared/index.ts'\nimport { useDialogContext } from './DialogRoot.ts'\n\nexport interface DialogOverlayProps {\n  /**\n   * Used to force mounting when more control is needed. Useful when\n   * controlling animation with React animation libraries.\n   */\n  forceMount?: boolean\n}\n\nexport const DEFAULT_DIALOG_OVERLAY_PROPS = {\n  forceMount: undefined,\n} satisfies PrimitiveDefaultProps<DialogOverlayProps>\n\nexport interface UseDialogOverlayProps {\n  forceMount?: boolean\n  el?: Ref<HTMLElement | undefined>\n}\n\nexport function useDialogOverlay(props: UseDialogOverlayProps = {}): RadixPrimitiveReturns<{\n  isPresent: Ref<boolean>\n  attrs: RadixPrimitiveGetAttrs\n}> {\n  const context = useDialogContext('DialogOverlay')\n\n  const el = props.el || shallowRef<HTMLElement>()\n  const setElRef = props.el ? undefined : (value: HTMLElement | undefined) => el.value = value\n\n  const isPresent = props.forceMount ? shallowRef(true) : usePresence(el, context.open)\n\n  watchEffect(() => {\n    if (isPresent.value) {\n      onWatcherCleanup(useBodyScrollLock())\n    }\n  })\n\n  return {\n    isPresent,\n    attrs(extraAttrs) {\n      const attrs = {\n        'elRef': setElRef,\n        'data-state': isPresent.value ? 'open' : 'closed',\n        'style': 'pointer-events: auto',\n      }\n\n      if (extraAttrs && extraAttrs.length > 0) {\n        mergePrimitiveAttrs(attrs, extraAttrs)\n      }\n\n      return attrs\n    },\n  }\n}\n","<script setup lang=\"ts\">\nimport { Primitive } from '../primitive/index.ts'\nimport { normalizeAttrs } from '../shared/index.ts'\nimport { DEFAULT_DIALOG_OVERLAY_PROPS, type DialogOverlayProps, useDialogOverlay } from './DialogOverlay.ts'\n\ndefineOptions({\n  name: 'DialogOverlay',\n})\n\nconst props = withDefaults(defineProps<DialogOverlayProps>(), DEFAULT_DIALOG_OVERLAY_PROPS)\n\nconst dialogOverlay = useDialogOverlay({\n  forceMount: props.forceMount,\n})\n</script>\n\n<template>\n  <Primitive\n    v-if=\"dialogOverlay.isPresent.value\"\n    v-bind=\"normalizeAttrs(dialogOverlay.attrs([$attrs]))\"\n  >\n    <slot />\n  </Primitive>\n</template>\n","<script setup lang=\"ts\">\nimport type { EmitsToHookProps } from '../shared/index.ts'\nimport { convertPropsToHookProps } from '../shared/index.ts'\nimport {\n  DEFAULT_DIALOG_ROOT_PROPS,\n  type DialogRootEmits,\n  type DialogRootProps,\n  useDialogRoot,\n} from './DialogRoot.ts'\n\ndefineOptions({\n  name: 'DialogRoot',\n  inheritAttrs: false,\n})\n\nconst props = withDefaults(defineProps<DialogRootProps>(), DEFAULT_DIALOG_ROOT_PROPS)\n\nconst emit = defineEmits<DialogRootEmits>()\n\nuseDialogRoot(convertPropsToHookProps(\n  props,\n  ['open'],\n  (): Required<EmitsToHookProps<DialogRootEmits>> => ({\n    onUpdateOpen(open) {\n      emit('update:open', open)\n    },\n  }),\n))\n</script>\n\n<template>\n  <slot />\n</template>\n","import type { PrimitiveProps } from '../primitive/index.ts'\nimport type { PrimitiveDefaultProps, RadixPrimitiveReturns } from '../shared/index.ts'\nimport { mergePrimitiveAttrs } from '../shared/index.ts'\nimport { useDialogContext } from './DialogRoot.ts'\n\nexport interface DialogTitleProps {\n  as?: PrimitiveProps['as']\n}\n\nexport const DEFAULT_DIALOG_TITLE_PROPS = {\n  as: 'h2',\n} satisfies PrimitiveDefaultProps<DialogTitleProps>\n\nexport function useDialogTitle(): RadixPrimitiveReturns {\n  const context = useDialogContext('DialogTitle')\n\n  return {\n    attrs(extraAttrs) {\n      const attrs = {\n        id: context.titleId,\n      }\n\n      if (extraAttrs && extraAttrs.length > 0) {\n        mergePrimitiveAttrs(attrs, extraAttrs)\n      }\n\n      return attrs\n    },\n  }\n}\n","<script setup lang=\"ts\">\nimport { Primitive } from '../primitive/index.ts'\nimport { normalizeAttrs } from '../shared/index.ts'\nimport { DEFAULT_DIALOG_TITLE_PROPS, type DialogTitleProps, useDialogTitle } from './DialogTitle.ts'\n\ndefineOptions({\n  name: 'DialogTitle',\n})\n\nwithDefaults(defineProps<DialogTitleProps>(), DEFAULT_DIALOG_TITLE_PROPS)\n\nconst dialogTitle = useDialogTitle()\n</script>\n\n<template>\n  <Primitive v-bind=\"normalizeAttrs(dialogTitle.attrs([$attrs, { as }]))\">\n    <slot />\n  </Primitive>\n</template>\n","import type { PrimitiveProps } from '../primitive/index.ts'\nimport type { PrimitiveDefaultProps, PrimitiveElAttrs, RadixPrimitiveReturns } from '../shared/index.ts'\nimport { mergePrimitiveAttrs } from '../shared/index.ts'\nimport { useDialogContext } from './DialogRoot.ts'\n\nexport interface DialogTriggerProps {\n  as?: PrimitiveProps['as']\n}\n\nexport const DEFAULT_DIALOG_TRIGGER_PROPS = {\n  as: 'button',\n} satisfies PrimitiveDefaultProps<DialogTriggerProps>\n\nexport function useDialogTrigger(): RadixPrimitiveReturns {\n  const context = useDialogContext('DialogTrigger')\n\n  const setElRef = (value: HTMLElement | undefined) => context.triggerRef.value = value\n\n  function onClick(event: MouseEvent) {\n    if (event.defaultPrevented)\n      return\n    context.onOpenToggle()\n  }\n\n  return {\n    attrs(extraAttrs) {\n      const attrs: PrimitiveElAttrs = {\n        'elRef': setElRef,\n        'type': 'button',\n        'aria-haspopup': 'dialog',\n        'aria-expanded': context.open.value || false,\n        'aria-controls': context.open.value ? context.contentId : undefined,\n        'data-state': context.open.value ? 'open' : 'closed',\n        onClick,\n      }\n\n      if (extraAttrs && extraAttrs.length > 0) {\n        mergePrimitiveAttrs(attrs, extraAttrs)\n      }\n\n      return attrs\n    },\n  }\n}\n","<script setup lang=\"ts\">\nimport { Primitive } from '../primitive/index.ts'\nimport { normalizeAttrs } from '../shared/index.ts'\nimport { DEFAULT_DIALOG_TRIGGER_PROPS, type DialogTriggerProps, useDialogTrigger } from './DialogTrigger.ts'\n\ndefineOptions({\n  name: 'DialogTrigger',\n  inheritAttrs: false,\n})\n\nwithDefaults(defineProps<DialogTriggerProps>(), DEFAULT_DIALOG_TRIGGER_PROPS)\n\nconst dialogTrigger = useDialogTrigger()\n</script>\n\n<template>\n  <Primitive v-bind=\"normalizeAttrs(dialogTrigger.attrs([$attrs, { as }]))\">\n    <slot />\n  </Primitive>\n</template>\n"],"names":[],"mappings":";;;;;;;;;;AAUO,MAAM,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