{"ast":null,"code":"import { __extends, __rest, __assign, __read } from 'tslib';\nimport * as React from 'react';\nimport { eachAxis } from '../../../utils/each-axis.js';\nimport { startAnimation, getValueTransition } from '../../../animation/utils/transitions.js';\nimport { checkIfParentHasChanged, calcRelativeOffset, tweenAxis } from './utils.js';\nimport { VisibilityAction } from '../../../components/AnimateSharedLayout/types.js';\nimport { usePresence } from '../../../components/AnimatePresence/use-presence.js';\nimport { axisBox } from '../../../utils/geometry/index.js';\nimport { addScaleCorrection } from '../../../render/dom/projection/scale-correction.js';\nimport { defaultScaleCorrectors } from '../../../render/dom/projection/default-scale-correctors.js';\nvar progressTarget = 1000;\nvar Animate = /** @class */function (_super) {\n  __extends(Animate, _super);\n  function Animate() {\n    var _this = _super !== null && _super.apply(this, arguments) || this;\n    /**\n     * A mutable object that tracks the target viewport box\n     * for the current animation frame.\n     */\n    _this.frameTarget = axisBox();\n    /**\n     * The current animation target, we use this to check whether to start\n     * a new animation or continue the existing one.\n     */\n    _this.currentAnimationTarget = axisBox();\n    /**\n     * Track whether we're animating this axis.\n     */\n    _this.isAnimating = {\n      x: false,\n      y: false\n    };\n    _this.stopAxisAnimation = {\n      x: undefined,\n      y: undefined\n    };\n    _this.isAnimatingTree = false;\n    _this.animate = function (target, origin, _a) {\n      if (_a === void 0) {\n        _a = {};\n      }\n      var originBox = _a.originBox,\n        targetBox = _a.targetBox,\n        visibilityAction = _a.visibilityAction,\n        shouldStackAnimate = _a.shouldStackAnimate,\n        onComplete = _a.onComplete,\n        prevParent = _a.prevParent,\n        config = __rest(_a, [\"originBox\", \"targetBox\", \"visibilityAction\", \"shouldStackAnimate\", \"onComplete\", \"prevParent\"]);\n      var _b = _this.props,\n        visualElement = _b.visualElement,\n        layout = _b.layout;\n      /**\n       * Early return if we've been instructed not to animate this render.\n       */\n      if (shouldStackAnimate === false) {\n        _this.isAnimatingTree = false;\n        return _this.safeToRemove();\n      }\n      /**\n       * Prioritise tree animations\n       */\n      if (_this.isAnimatingTree && shouldStackAnimate !== true) {\n        return;\n      } else if (shouldStackAnimate) {\n        _this.isAnimatingTree = true;\n      }\n      /**\n       * Allow the measured origin (prev bounding box) and target (actual layout) to be\n       * overridden by the provided config.\n       */\n      origin = originBox || origin;\n      target = targetBox || target;\n      /**\n       * If this element has a projecting parent, there's an opportunity to animate\n       * it relatively to that parent rather than relatively to the viewport. This\n       * allows us to add orchestrated animations.\n       */\n      var isRelative = false;\n      var projectionParent = visualElement.getProjectionParent();\n      if (projectionParent) {\n        var prevParentViewportBox = projectionParent.prevViewportBox;\n        var parentLayout = projectionParent.getLayoutState().layout;\n        /**\n         * If we're being provided a previous parent VisualElement by AnimateSharedLayout\n         */\n        if (prevParent) {\n          /**\n           * If we've been provided an explicit target box it means we're animating back\n           * to this previous parent. So we can make a relative box by comparing to the previous\n           * parent's layout\n           */\n          if (targetBox) {\n            parentLayout = prevParent.getLayoutState().layout;\n          }\n          /**\n           * Likewise if we've been provided an explicit origin box it means we're\n           * animating out from a different element. So we should figure out where that was\n           * on screen relative to the new parent element.\n           */\n          if (originBox && !checkIfParentHasChanged(prevParent, projectionParent) && prevParent.prevViewportBox) {\n            prevParentViewportBox = prevParent.prevViewportBox;\n          }\n        }\n        if (prevParentViewportBox && isProvidedCorrectDataForRelativeSharedLayout(prevParent, originBox, targetBox)) {\n          isRelative = true;\n          origin = calcRelativeOffset(prevParentViewportBox, origin);\n          target = calcRelativeOffset(parentLayout, target);\n        }\n      }\n      var boxHasMoved = hasMoved(origin, target);\n      var animations = eachAxis(function (axis) {\n        var _a, _b;\n        /**\n         * If layout is set to \"position\", we can resize the origin box based on the target\n         * box and only animate its position.\n         */\n        if (layout === \"position\") {\n          var targetLength = target[axis].max - target[axis].min;\n          origin[axis].max = origin[axis].min + targetLength;\n        }\n        if (visualElement.projection.isTargetLocked) {\n          return;\n        } else if (visibilityAction !== undefined) {\n          visualElement.setVisibility(visibilityAction === VisibilityAction.Show);\n        } else if (boxHasMoved) {\n          // If the box has moved, animate between it's current visual state and its\n          // final state\n          return _this.animateAxis(axis, target[axis], origin[axis], __assign(__assign({}, config), {\n            isRelative: isRelative\n          }));\n        } else {\n          (_b = (_a = _this.stopAxisAnimation)[axis]) === null || _b === void 0 ? void 0 : _b.call(_a);\n          // If the box has remained in the same place, immediately set the axis target\n          // to the final desired state\n          return visualElement.setProjectionTargetAxis(axis, target[axis].min, target[axis].max, isRelative);\n        }\n      });\n      // Force a render to ensure there's no flash of uncorrected bounding box.\n      visualElement.syncRender();\n      /**\n       * If this visualElement isn't present (ie it's been removed from the tree by the user but\n       * kept in by the tree by AnimatePresence) then call safeToRemove when all axis animations\n       * have successfully finished.\n       */\n      return Promise.all(animations).then(function () {\n        _this.isAnimatingTree = false;\n        onComplete && onComplete();\n        visualElement.notifyLayoutAnimationComplete();\n      });\n    };\n    return _this;\n  }\n  Animate.prototype.componentDidMount = function () {\n    var _this = this;\n    var visualElement = this.props.visualElement;\n    visualElement.animateMotionValue = startAnimation;\n    visualElement.enableLayoutProjection();\n    this.unsubLayoutReady = visualElement.onLayoutUpdate(this.animate);\n    visualElement.layoutSafeToRemove = function () {\n      return _this.safeToRemove();\n    };\n    addScaleCorrection(defaultScaleCorrectors);\n  };\n  Animate.prototype.componentWillUnmount = function () {\n    var _this = this;\n    this.unsubLayoutReady();\n    eachAxis(function (axis) {\n      var _a, _b;\n      return (_b = (_a = _this.stopAxisAnimation)[axis]) === null || _b === void 0 ? void 0 : _b.call(_a);\n    });\n  };\n  /**\n   * TODO: This manually performs animations on the visualElement's layout progress\n   * values. It'd be preferable to amend the startLayoutAxisAnimation\n   * API to accept more custom animations like this.\n   */\n  Animate.prototype.animateAxis = function (axis, target, origin, _a) {\n    var _this = this;\n    var _b, _c;\n    var _d = _a === void 0 ? {} : _a,\n      transition = _d.transition,\n      isRelative = _d.isRelative;\n    /**\n     * If we're not animating to a new target, don't run this animation\n     */\n    if (this.isAnimating[axis] && axisIsEqual(target, this.currentAnimationTarget[axis])) {\n      return;\n    }\n    (_c = (_b = this.stopAxisAnimation)[axis]) === null || _c === void 0 ? void 0 : _c.call(_b);\n    this.isAnimating[axis] = true;\n    var visualElement = this.props.visualElement;\n    var frameTarget = this.frameTarget[axis];\n    var layoutProgress = visualElement.getProjectionAnimationProgress()[axis];\n    /**\n     * Set layout progress back to 0. We set it twice to hard-reset any velocity that might\n     * be re-incoporated into a subsequent spring animation.\n     */\n    layoutProgress.clearListeners();\n    layoutProgress.set(0);\n    layoutProgress.set(0);\n    /**\n     * Create an animation function to run once per frame. This will tween the visual bounding box from\n     * origin to target using the latest progress value.\n     */\n    var frame = function frame() {\n      // Convert the latest layoutProgress, which is a value from 0-1000, into a 0-1 progress\n      var p = layoutProgress.get() / progressTarget;\n      // Tween the axis and update the visualElement with the latest values\n      tweenAxis(frameTarget, origin, target, p);\n      visualElement.setProjectionTargetAxis(axis, frameTarget.min, frameTarget.max, isRelative);\n    };\n    // Synchronously run a frame to ensure there's no flash of the uncorrected bounding box.\n    frame();\n    // Create a function to stop animation on this specific axis\n    var unsubscribeProgress = layoutProgress.onChange(frame);\n    this.stopAxisAnimation[axis] = function () {\n      _this.isAnimating[axis] = false;\n      layoutProgress.stop();\n      unsubscribeProgress();\n    };\n    this.currentAnimationTarget[axis] = target;\n    var layoutTransition = transition || visualElement.getDefaultTransition() || defaultLayoutTransition;\n    // Start the animation on this axis\n    var animation = startAnimation(axis === \"x\" ? \"layoutX\" : \"layoutY\", layoutProgress, progressTarget, layoutTransition && getValueTransition(layoutTransition, \"layout\")).then(this.stopAxisAnimation[axis]);\n    return animation;\n  };\n  Animate.prototype.safeToRemove = function () {\n    var _a, _b;\n    (_b = (_a = this.props).safeToRemove) === null || _b === void 0 ? void 0 : _b.call(_a);\n  };\n  Animate.prototype.render = function () {\n    return null;\n  };\n  return Animate;\n}(React.Component);\nfunction AnimateLayoutContextProvider(props) {\n  var _a = __read(usePresence(), 2),\n    safeToRemove = _a[1];\n  return React.createElement(Animate, __assign({}, props, {\n    safeToRemove: safeToRemove\n  }));\n}\nfunction hasMoved(a, b) {\n  return !isZeroBox(a) && !isZeroBox(b) && (!axisIsEqual(a.x, b.x) || !axisIsEqual(a.y, b.y));\n}\nvar zeroAxis = {\n  min: 0,\n  max: 0\n};\nfunction isZeroBox(a) {\n  return axisIsEqual(a.x, zeroAxis) && axisIsEqual(a.y, zeroAxis);\n}\nfunction axisIsEqual(a, b) {\n  return a.min === b.min && a.max === b.max;\n}\nvar defaultLayoutTransition = {\n  duration: 0.45,\n  ease: [0.4, 0, 0.1, 1]\n};\nfunction isProvidedCorrectDataForRelativeSharedLayout(prevParent, originBox, targetBox) {\n  return prevParent || !prevParent && !(originBox || targetBox);\n}\nexport { AnimateLayoutContextProvider };","map":{"version":3,"names":["__extends","__rest","__assign","__read","React","eachAxis","startAnimation","getValueTransition","checkIfParentHasChanged","calcRelativeOffset","tweenAxis","VisibilityAction","usePresence","axisBox","addScaleCorrection","defaultScaleCorrectors","progressTarget","Animate","_super","_this","apply","arguments","frameTarget","currentAnimationTarget","isAnimating","x","y","stopAxisAnimation","undefined","isAnimatingTree","animate","target","origin","_a","originBox","targetBox","visibilityAction","shouldStackAnimate","onComplete","prevParent","config","_b","props","visualElement","layout","safeToRemove","isRelative","projectionParent","getProjectionParent","prevParentViewportBox","prevViewportBox","parentLayout","getLayoutState","isProvidedCorrectDataForRelativeSharedLayout","boxHasMoved","hasMoved","animations","axis","targetLength","max","min","projection","isTargetLocked","setVisibility","Show","animateAxis","call","setProjectionTargetAxis","syncRender","Promise","all","then","notifyLayoutAnimationComplete","prototype","componentDidMount","animateMotionValue","enableLayoutProjection","unsubLayoutReady","onLayoutUpdate","layoutSafeToRemove","componentWillUnmount","_c","_d","transition","axisIsEqual","layoutProgress","getProjectionAnimationProgress","clearListeners","set","frame","p","get","unsubscribeProgress","onChange","stop","layoutTransition","getDefaultTransition","defaultLayoutTransition","animation","render","Component","AnimateLayoutContextProvider","createElement","a","b","isZeroBox","zeroAxis","duration","ease"],"sources":["C:/ldt/LDT/Safemate_Management/node_modules/framer-motion/dist/es/motion/features/layout/Animate.js"],"sourcesContent":["import { __extends, __rest, __assign, __read } from 'tslib';\nimport * as React from 'react';\nimport { eachAxis } from '../../../utils/each-axis.js';\nimport { startAnimation, getValueTransition } from '../../../animation/utils/transitions.js';\nimport { checkIfParentHasChanged, calcRelativeOffset, tweenAxis } from './utils.js';\nimport { VisibilityAction } from '../../../components/AnimateSharedLayout/types.js';\nimport { usePresence } from '../../../components/AnimatePresence/use-presence.js';\nimport { axisBox } from '../../../utils/geometry/index.js';\nimport { addScaleCorrection } from '../../../render/dom/projection/scale-correction.js';\nimport { defaultScaleCorrectors } from '../../../render/dom/projection/default-scale-correctors.js';\n\nvar progressTarget = 1000;\nvar Animate = /** @class */ (function (_super) {\n    __extends(Animate, _super);\n    function Animate() {\n        var _this = _super !== null && _super.apply(this, arguments) || this;\n        /**\n         * A mutable object that tracks the target viewport box\n         * for the current animation frame.\n         */\n        _this.frameTarget = axisBox();\n        /**\n         * The current animation target, we use this to check whether to start\n         * a new animation or continue the existing one.\n         */\n        _this.currentAnimationTarget = axisBox();\n        /**\n         * Track whether we're animating this axis.\n         */\n        _this.isAnimating = {\n            x: false,\n            y: false,\n        };\n        _this.stopAxisAnimation = {\n            x: undefined,\n            y: undefined,\n        };\n        _this.isAnimatingTree = false;\n        _this.animate = function (target, origin, _a) {\n            if (_a === void 0) { _a = {}; }\n            var originBox = _a.originBox, targetBox = _a.targetBox, visibilityAction = _a.visibilityAction, shouldStackAnimate = _a.shouldStackAnimate, onComplete = _a.onComplete, prevParent = _a.prevParent, config = __rest(_a, [\"originBox\", \"targetBox\", \"visibilityAction\", \"shouldStackAnimate\", \"onComplete\", \"prevParent\"]);\n            var _b = _this.props, visualElement = _b.visualElement, layout = _b.layout;\n            /**\n             * Early return if we've been instructed not to animate this render.\n             */\n            if (shouldStackAnimate === false) {\n                _this.isAnimatingTree = false;\n                return _this.safeToRemove();\n            }\n            /**\n             * Prioritise tree animations\n             */\n            if (_this.isAnimatingTree && shouldStackAnimate !== true) {\n                return;\n            }\n            else if (shouldStackAnimate) {\n                _this.isAnimatingTree = true;\n            }\n            /**\n             * Allow the measured origin (prev bounding box) and target (actual layout) to be\n             * overridden by the provided config.\n             */\n            origin = originBox || origin;\n            target = targetBox || target;\n            /**\n             * If this element has a projecting parent, there's an opportunity to animate\n             * it relatively to that parent rather than relatively to the viewport. This\n             * allows us to add orchestrated animations.\n             */\n            var isRelative = false;\n            var projectionParent = visualElement.getProjectionParent();\n            if (projectionParent) {\n                var prevParentViewportBox = projectionParent.prevViewportBox;\n                var parentLayout = projectionParent.getLayoutState().layout;\n                /**\n                 * If we're being provided a previous parent VisualElement by AnimateSharedLayout\n                 */\n                if (prevParent) {\n                    /**\n                     * If we've been provided an explicit target box it means we're animating back\n                     * to this previous parent. So we can make a relative box by comparing to the previous\n                     * parent's layout\n                     */\n                    if (targetBox) {\n                        parentLayout = prevParent.getLayoutState().layout;\n                    }\n                    /**\n                     * Likewise if we've been provided an explicit origin box it means we're\n                     * animating out from a different element. So we should figure out where that was\n                     * on screen relative to the new parent element.\n                     */\n                    if (originBox &&\n                        !checkIfParentHasChanged(prevParent, projectionParent) &&\n                        prevParent.prevViewportBox) {\n                        prevParentViewportBox = prevParent.prevViewportBox;\n                    }\n                }\n                if (prevParentViewportBox &&\n                    isProvidedCorrectDataForRelativeSharedLayout(prevParent, originBox, targetBox)) {\n                    isRelative = true;\n                    origin = calcRelativeOffset(prevParentViewportBox, origin);\n                    target = calcRelativeOffset(parentLayout, target);\n                }\n            }\n            var boxHasMoved = hasMoved(origin, target);\n            var animations = eachAxis(function (axis) {\n                var _a, _b;\n                /**\n                 * If layout is set to \"position\", we can resize the origin box based on the target\n                 * box and only animate its position.\n                 */\n                if (layout === \"position\") {\n                    var targetLength = target[axis].max - target[axis].min;\n                    origin[axis].max = origin[axis].min + targetLength;\n                }\n                if (visualElement.projection.isTargetLocked) {\n                    return;\n                }\n                else if (visibilityAction !== undefined) {\n                    visualElement.setVisibility(visibilityAction === VisibilityAction.Show);\n                }\n                else if (boxHasMoved) {\n                    // If the box has moved, animate between it's current visual state and its\n                    // final state\n                    return _this.animateAxis(axis, target[axis], origin[axis], __assign(__assign({}, config), { isRelative: isRelative }));\n                }\n                else {\n                    (_b = (_a = _this.stopAxisAnimation)[axis]) === null || _b === void 0 ? void 0 : _b.call(_a);\n                    // If the box has remained in the same place, immediately set the axis target\n                    // to the final desired state\n                    return visualElement.setProjectionTargetAxis(axis, target[axis].min, target[axis].max, isRelative);\n                }\n            });\n            // Force a render to ensure there's no flash of uncorrected bounding box.\n            visualElement.syncRender();\n            /**\n             * If this visualElement isn't present (ie it's been removed from the tree by the user but\n             * kept in by the tree by AnimatePresence) then call safeToRemove when all axis animations\n             * have successfully finished.\n             */\n            return Promise.all(animations).then(function () {\n                _this.isAnimatingTree = false;\n                onComplete && onComplete();\n                visualElement.notifyLayoutAnimationComplete();\n            });\n        };\n        return _this;\n    }\n    Animate.prototype.componentDidMount = function () {\n        var _this = this;\n        var visualElement = this.props.visualElement;\n        visualElement.animateMotionValue = startAnimation;\n        visualElement.enableLayoutProjection();\n        this.unsubLayoutReady = visualElement.onLayoutUpdate(this.animate);\n        visualElement.layoutSafeToRemove = function () { return _this.safeToRemove(); };\n        addScaleCorrection(defaultScaleCorrectors);\n    };\n    Animate.prototype.componentWillUnmount = function () {\n        var _this = this;\n        this.unsubLayoutReady();\n        eachAxis(function (axis) { var _a, _b; return (_b = (_a = _this.stopAxisAnimation)[axis]) === null || _b === void 0 ? void 0 : _b.call(_a); });\n    };\n    /**\n     * TODO: This manually performs animations on the visualElement's layout progress\n     * values. It'd be preferable to amend the startLayoutAxisAnimation\n     * API to accept more custom animations like this.\n     */\n    Animate.prototype.animateAxis = function (axis, target, origin, _a) {\n        var _this = this;\n        var _b, _c;\n        var _d = _a === void 0 ? {} : _a, transition = _d.transition, isRelative = _d.isRelative;\n        /**\n         * If we're not animating to a new target, don't run this animation\n         */\n        if (this.isAnimating[axis] &&\n            axisIsEqual(target, this.currentAnimationTarget[axis])) {\n            return;\n        }\n        (_c = (_b = this.stopAxisAnimation)[axis]) === null || _c === void 0 ? void 0 : _c.call(_b);\n        this.isAnimating[axis] = true;\n        var visualElement = this.props.visualElement;\n        var frameTarget = this.frameTarget[axis];\n        var layoutProgress = visualElement.getProjectionAnimationProgress()[axis];\n        /**\n         * Set layout progress back to 0. We set it twice to hard-reset any velocity that might\n         * be re-incoporated into a subsequent spring animation.\n         */\n        layoutProgress.clearListeners();\n        layoutProgress.set(0);\n        layoutProgress.set(0);\n        /**\n         * Create an animation function to run once per frame. This will tween the visual bounding box from\n         * origin to target using the latest progress value.\n         */\n        var frame = function () {\n            // Convert the latest layoutProgress, which is a value from 0-1000, into a 0-1 progress\n            var p = layoutProgress.get() / progressTarget;\n            // Tween the axis and update the visualElement with the latest values\n            tweenAxis(frameTarget, origin, target, p);\n            visualElement.setProjectionTargetAxis(axis, frameTarget.min, frameTarget.max, isRelative);\n        };\n        // Synchronously run a frame to ensure there's no flash of the uncorrected bounding box.\n        frame();\n        // Create a function to stop animation on this specific axis\n        var unsubscribeProgress = layoutProgress.onChange(frame);\n        this.stopAxisAnimation[axis] = function () {\n            _this.isAnimating[axis] = false;\n            layoutProgress.stop();\n            unsubscribeProgress();\n        };\n        this.currentAnimationTarget[axis] = target;\n        var layoutTransition = transition ||\n            visualElement.getDefaultTransition() ||\n            defaultLayoutTransition;\n        // Start the animation on this axis\n        var animation = startAnimation(axis === \"x\" ? \"layoutX\" : \"layoutY\", layoutProgress, progressTarget, layoutTransition && getValueTransition(layoutTransition, \"layout\")).then(this.stopAxisAnimation[axis]);\n        return animation;\n    };\n    Animate.prototype.safeToRemove = function () {\n        var _a, _b;\n        (_b = (_a = this.props).safeToRemove) === null || _b === void 0 ? void 0 : _b.call(_a);\n    };\n    Animate.prototype.render = function () {\n        return null;\n    };\n    return Animate;\n}(React.Component));\nfunction AnimateLayoutContextProvider(props) {\n    var _a = __read(usePresence(), 2), safeToRemove = _a[1];\n    return React.createElement(Animate, __assign({}, props, { safeToRemove: safeToRemove }));\n}\nfunction hasMoved(a, b) {\n    return (!isZeroBox(a) &&\n        !isZeroBox(b) &&\n        (!axisIsEqual(a.x, b.x) || !axisIsEqual(a.y, b.y)));\n}\nvar zeroAxis = { min: 0, max: 0 };\nfunction isZeroBox(a) {\n    return axisIsEqual(a.x, zeroAxis) && axisIsEqual(a.y, zeroAxis);\n}\nfunction axisIsEqual(a, b) {\n    return a.min === b.min && a.max === b.max;\n}\nvar defaultLayoutTransition = {\n    duration: 0.45,\n    ease: [0.4, 0, 0.1, 1],\n};\nfunction isProvidedCorrectDataForRelativeSharedLayout(prevParent, originBox, targetBox) {\n    return prevParent || (!prevParent && !(originBox || targetBox));\n}\n\nexport { AnimateLayoutContextProvider };\n"],"mappings":"AAAA,SAASA,SAAS,EAAEC,MAAM,EAAEC,QAAQ,EAAEC,MAAM,QAAQ,OAAO;AAC3D,OAAO,KAAKC,KAAK,MAAM,OAAO;AAC9B,SAASC,QAAQ,QAAQ,6BAA6B;AACtD,SAASC,cAAc,EAAEC,kBAAkB,QAAQ,yCAAyC;AAC5F,SAASC,uBAAuB,EAAEC,kBAAkB,EAAEC,SAAS,QAAQ,YAAY;AACnF,SAASC,gBAAgB,QAAQ,kDAAkD;AACnF,SAASC,WAAW,QAAQ,qDAAqD;AACjF,SAASC,OAAO,QAAQ,kCAAkC;AAC1D,SAASC,kBAAkB,QAAQ,oDAAoD;AACvF,SAASC,sBAAsB,QAAQ,4DAA4D;AAEnG,IAAIC,cAAc,GAAG,IAAI;AACzB,IAAIC,OAAO,GAAG,aAAe,UAAUC,MAAM,EAAE;EAC3ClB,SAAS,CAACiB,OAAO,EAAEC,MAAM,CAAC;EAC1B,SAASD,OAAOA,CAAA,EAAG;IACf,IAAIE,KAAK,GAAGD,MAAM,KAAK,IAAI,IAAIA,MAAM,CAACE,KAAK,CAAC,IAAI,EAAEC,SAAS,CAAC,IAAI,IAAI;IACpE;AACR;AACA;AACA;IACQF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