{"ast":null,"code":"import { mixNumber } from '../../utils/mix/number.mjs';\nimport { complex } from '../../value/types/complex/index.mjs';\nconst correctBoxShadow = {\n  correct: (latest, _ref) => {\n    let {\n      treeScale,\n      projectionDelta\n    } = _ref;\n    const original = latest;\n    const shadow = complex.parse(latest);\n    // TODO: Doesn't support multiple shadows\n    if (shadow.length > 5) return original;\n    const template = complex.createTransformer(latest);\n    const offset = typeof shadow[0] !== \"number\" ? 1 : 0;\n    // Calculate the overall context scale\n    const xScale = projectionDelta.x.scale * treeScale.x;\n    const yScale = projectionDelta.y.scale * treeScale.y;\n    shadow[0 + offset] /= xScale;\n    shadow[1 + offset] /= yScale;\n    /**\n     * Ideally we'd correct x and y scales individually, but because blur and\n     * spread apply to both we have to take a scale average and apply that instead.\n     * We could potentially improve the outcome of this by incorporating the ratio between\n     * the two scales.\n     */\n    const averageScale = mixNumber(xScale, yScale, 0.5);\n    // Blur\n    if (typeof shadow[2 + offset] === \"number\") shadow[2 + offset] /= averageScale;\n    // Spread\n    if (typeof shadow[3 + offset] === \"number\") shadow[3 + offset] /= averageScale;\n    return template(shadow);\n  }\n};\nexport { correctBoxShadow };","map":{"version":3,"names":["mixNumber","complex","correctBoxShadow","correct","latest","_ref","treeScale","projectionDelta","original","shadow","parse","length","template","createTransformer","offset","xScale","x","scale","yScale","y","averageScale"],"sources":["/opt/bitnami/minigames/frasle/node_modules/framer-motion/dist/es/projection/styles/scale-box-shadow.mjs"],"sourcesContent":["import { mixNumber } from '../../utils/mix/number.mjs';\nimport { complex } from '../../value/types/complex/index.mjs';\n\nconst correctBoxShadow = {\n    correct: (latest, { treeScale, projectionDelta }) => {\n        const original = latest;\n        const shadow = complex.parse(latest);\n        // TODO: Doesn't support multiple shadows\n        if (shadow.length > 5)\n            return original;\n        const template = complex.createTransformer(latest);\n        const offset = typeof shadow[0] !== \"number\" ? 1 : 0;\n        // Calculate the overall context scale\n        const xScale = projectionDelta.x.scale * treeScale.x;\n        const yScale = projectionDelta.y.scale * treeScale.y;\n        shadow[0 + offset] /= xScale;\n        shadow[1 + offset] /= yScale;\n        /**\n         * Ideally we'd correct x and y scales individually, but because blur and\n         * spread apply to both we have to take a scale average and apply that instead.\n         * We could potentially improve the outcome of this by incorporating the ratio between\n         * the two scales.\n         */\n        const averageScale = mixNumber(xScale, yScale, 0.5);\n        // Blur\n        if (typeof shadow[2 + offset] === \"number\")\n            shadow[2 + offset] /= averageScale;\n        // Spread\n        if (typeof shadow[3 + offset] === \"number\")\n            shadow[3 + offset] /= averageScale;\n        return template(shadow);\n    },\n};\n\nexport { correctBoxShadow };\n"],"mappings":"AAAA,SAASA,SAAS,QAAQ,4BAA4B;AACtD,SAASC,OAAO,QAAQ,qCAAqC;AAE7D,MAAMC,gBAAgB,GAAG;EACrBC,OAAO,EAAEA,CAACC,MAAM,EAAAC,IAAA,KAAqC;IAAA,IAAnC;MAAEC,SAAS;MAAEC;IAAgB,CAAC,GAAAF,IAAA;IAC5C,MAAMG,QAAQ,GAAGJ,MAAM;IACvB,MAAMK,MAAM,GAAGR,OAAO,CAACS,KAAK,CAACN,MAAM,CAAC;IACpC;IACA,IAAIK,MAAM,CAACE,MAAM,GAAG,CAAC,EACjB,OAAOH,QAAQ;IACnB,MAAMI,QAAQ,GAAGX,OAAO,CAACY,iBAAiB,CAACT,MAAM,CAAC;IAClD,MAAMU,MAAM,GAAG,OAAOL,MAAM,CAAC,CAAC,CAAC,KAAK,QAAQ,GAAG,CAAC,GAAG,CAAC;IACpD;IACA,MAAMM,MAAM,GAAGR,eAAe,CAACS,CAAC,CAACC,KAAK,GAAGX,SAAS,CAACU,CAAC;IACpD,MAAME,MAAM,GAAGX,eAAe,CAACY,CAAC,CAACF,KAAK,GAAGX,SAAS,CAACa,CAAC;IACpDV,MAAM,CAAC,CAAC,GAAGK,MAAM,CAAC,IAAIC,MAAM;IAC5BN,MAAM,CAAC,CAAC,GAAGK,MAAM,CAAC,IAAII,MAAM;IAC5B;AACR;AACA;AACA;AACA;AACA;IACQ,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