{"map":"{\"version\":3,\"file\":\"_slidingWindow.js\",\"sourceRoot\":\"\",\"sources\":[\"../../../../src/operators/foundation/_slidingWindow.ts\"],\"names\":[],\"mappings\":\"AAAA;;;;;;;;;;;;;;GAcG;AAmBH,MAAM,4BAA6E,UAAa;IAC9F,MAAM,CAAC,KAAM,SAAQ,UAAU;QAC7B;;;;;WAKG;QACH,cAAc,CAAC,EAAE,IAAI,GAAG,CAAC,EAAE,GAAG,EAAE;YAC9B,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC;gBACxB,SAAS,CAAC,EAAE,IAAI,EAAE;oBAChB,MAAM,MAAM,GAAa,EAAE,CAAC;oBAE5B,MAAM,CAAC,CAAC,EAAE,QAAQ,EAAE;wBAClB,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;wBAEtB,EAAE,CAAC,CAAC,MAAM,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC;4BACzB,MAAM,CAAC,KAAK,EAAE,CAAC;wBACjB,CAAC;wBAED,IAAI,CAAC,MAAM,CAAC,CAAC;oBACf,CAAC,CAAC;gBACJ,CAAC;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 withSlidingWindow(superclass) {\r\n    return class extends superclass {\r\n        /**\r\n         * Emits the last values to be received in an array of the given `size`.\r\n         *\r\n         * Reuses the same array on each emit, so if you want to compare emissions,\r\n         * make a copy of each as you receive it.\r\n         */\r\n        _slidingWindow({ size = 2 } = {}) {\r\n            return this._nextOperator({\r\n                operation({ emit }) {\r\n                    const result = [];\r\n                    return ({ upstream }) => {\r\n                        result.push(upstream);\r\n                        if (result.length > size) {\r\n                            result.shift();\r\n                        }\r\n                        emit(result);\r\n                    };\r\n                }\r\n            });\r\n        }\r\n    };\r\n}\r\n//# sourceMappingURL=_slidingWindow.js.map"}
