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,UAAU;oBACrB,OAAO,EAAE,QAAQ;oBACjB,OAAO,EAAE,QAAQ;oBACjB,KAAK,EAAE,MAAM;oBACb,WAAW,EAAE,YAAY;iBAC1B;aACF,CAAC,CAAC;QACL,CAAC;KACF,CAAC;AACJ,CAAC\"}","code":"/** @license\r\n *  Copyright 2016 - present The Material Motion Authors. All Rights Reserved.\r\n *\r\n *  Licensed under the Apache License, Version 2.0 (the \"License\"); you may not\r\n *  use this file except in compliance with the License. You may obtain a copy\r\n *  of the License at\r\n *\r\n *      http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n *  Unless required by applicable law or agreed to in writing, software\r\n *  distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\r\n *  WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the\r\n *  License for the specific language governing permissions and limitations\r\n *  under the License.\r\n */\r\nexport function withRewriteRange(superclass) {\r\n    return class extends superclass {\r\n        /**\r\n         * Receives a value from upstream, linearly interpolates it between the given\r\n         * ranges, and emits the result.\r\n         */\r\n        rewriteRange({ fromStart$ = 0, fromEnd$ = 1, toStart$ = 0, toEnd$ = 1, shouldClamp$ = false, }) {\r\n            return this._reactiveNextOperator({\r\n                operation: ({ emit }) => ({ upstream, fromStart, fromEnd, toStart, toEnd, shouldClamp, }) => {\r\n                    const fromRange = fromStart - fromEnd;\r\n                    const fromProgress = (upstream - fromEnd) / fromRange;\r\n                    const toRange = toStart - toEnd;\r\n                    const result = toEnd + fromProgress * toRange;\r\n                    if (shouldClamp) {\r\n                        const min = Math.min(toStart, toEnd);\r\n                        const max = Math.max(toStart, toEnd);\r\n                        emit(Math.max(min, Math.min(result, max)));\r\n                    }\r\n                    else {\r\n                        emit(result);\r\n                    }\r\n                },\r\n                inputs: {\r\n                    fromStart: fromStart$,\r\n                    fromEnd: fromEnd$,\r\n                    toStart: toStart$,\r\n                    toEnd: toEnd$,\r\n                    shouldClamp: shouldClamp$,\r\n                },\r\n            });\r\n        }\r\n    };\r\n}\r\n//# sourceMappingURL=rewriteRange.js.map"}
