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B,eAAgB,kBAAmB,iBAAkB","file":"/npm/angular-drag-bounce@2.1.0/dist/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/angular-drag-bounce@2.1.0/dist/index.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","import { ChangeDetectorRef, Component, ElementRef, Inject, Injectable, InjectionToken, Input, NgModule, ViewEncapsulation } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport 'rxjs/add/observable/interval';\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\nvar BOUNCEABLE_CFG = new InjectionToken('as.bounceable.config');\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\nvar Vector = (function () {\n    function Vector(x, y) {\n        if (x === void 0) { x = 0; }\n        if (y === void 0) { y = 0; }\n        this.x = x;\n        this.y = y;\n    }\n    Object.defineProperty(Vector.prototype, \"length\", {\n        get: /**\n         * @return {?}\n         */\n        function () {\n            return Math.sqrt((this.x * this.x) + (this.y * this.y));\n        },\n        enumerable: true,\n        configurable: true\n    });\n    /**\n     * @param {?} x\n     * @param {?} y\n     * @return {?}\n     */\n    Vector.prototype.set = /**\n     * @param {?} x\n     * @param {?} y\n     * @return {?}\n     */\n    function (x, y) {\n        this.x = x;\n        this.y = y;\n    };\n    /**\n     * @return {?}\n     */\n    Vector.prototype.normalize = /**\n     * @return {?}\n     */\n    function () {\n        this.multiply(1 / this.length);\n    };\n    /**\n     * @param {?} x\n     * @param {?} y\n     * @return {?}\n     */\n    Vector.prototype.add = /**\n     * @param {?} x\n     * @param {?} y\n     * @return {?}\n     */\n    function (x, y) {\n        this.x += x;\n        this.y += y;\n    };\n    /**\n     * @param {?} x\n     * @param {?} y\n     * @return {?}\n     */\n    Vector.prototype.subtract = /**\n     * @param {?} x\n     * @param {?} y\n     * @return {?}\n     */\n    function (x, y) {\n        this.add(-x, -y);\n    };\n    /**\n     * @param {?} factor\n     * @return {?}\n     */\n    Vector.prototype.multiply = /**\n     * @param {?} factor\n     * @return {?}\n     */\n    function (factor) {\n        this.x *= factor;\n        this.y *= factor;\n    };\n    /**\n     * @param {?} factor\n     * @return {?}\n     */\n    Vector.prototype.divide = /**\n     * @param {?} factor\n     * @return {?}\n     */\n    function (factor) {\n        this.multiply(1 / factor);\n    };\n    return Vector;\n}());\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\nvar BounceableService = (function () {\n    function BounceableService(_bounceableConfig) {\n        var _this = this;\n        this._bounceableConfig = _bounceableConfig;\n        this._items = [];\n        this._dragStart = new Vector();\n        this.onMouseDown = function ($event) {\n            _this._dragStart = new Vector($event.clientX, $event.clientY);\n            _this._items.forEach(function (i) { return i.onMouseDown($event); });\n        };\n        this.onMouseUp = function ($event) {\n            var /** @type {?} */ momentum = new Vector(($event.clientX - _this._dragStart.x) * _this._bounceableConfig.momentumSlowDownFactor, ($event.clientY - _this._dragStart.y) * _this._bounceableConfig.momentumSlowDownFactor);\n            _this._items.forEach(function (i) { return i.onMouseUp(momentum); });\n            _this.forceUpdate();\n        };\n        this._timeUntilNextRenderMS = 1000 / this._bounceableConfig.framesPerSecond;\n        this.setupListeners();\n    }\n    /**\n     * @param {?} item\n     * @return {?}\n     */\n    BounceableService.prototype.register = /**\n     * @param {?} item\n     * @return {?}\n     */\n    function (item) {\n        this._items.push(item);\n        this.forceUpdate();\n    };\n    /**\n     * @param {?} item\n     * @return {?}\n     */\n    BounceableService.prototype.unregister = /**\n     * @param {?} item\n     * @return {?}\n     */\n    function (item) {\n        this._items = this._items.filter(function (i) { return i !== item; });\n    };\n    /**\n     * @return {?}\n     */\n    BounceableService.prototype.getItems = /**\n     * @return {?}\n     */\n    function () {\n        return this._items;\n    };\n    /**\n     * @return {?}\n     */\n    BounceableService.prototype.step = /**\n     * @return {?}\n     */\n    function () {\n        var _this = this;\n        this.clearTimeout();\n        this._items.forEach(function (item) { return item.step(); });\n        if (this.itemsAreStillMoving()) {\n            this._nextRenderTimeout = setTimeout(function () { return _this.step(); }, this._timeUntilNextRenderMS);\n        }\n    };\n    /**\n     * @return {?}\n     */\n    BounceableService.prototype.forceUpdate = /**\n     * @return {?}\n     */\n    function () {\n        if (!this._nextRenderTimeout) {\n            this.step();\n        }\n    };\n    /**\n     * @return {?}\n     */\n    BounceableService.prototype.clearTimeout = /**\n     * @return {?}\n     */\n    function () {\n        clearTimeout(this._nextRenderTimeout);\n        this._nextRenderTimeout = null;\n    };\n    /**\n     * @return {?}\n     */\n    BounceableService.prototype.setupListeners = /**\n     * @return {?}\n     */\n    function () {\n        document.addEventListener('mousedown', this.onMouseDown);\n        document.addEventListener('mouseup', this.onMouseUp);\n    };\n    /**\n     * @return {?}\n     */\n    BounceableService.prototype.itemsAreStillMoving = /**\n     * @return {?}\n     */\n    function () {\n        return this._items.some(function (i) { return i.isMoving; });\n    };\n    BounceableService.decorators = [\n        { type: Injectable },\n    ];\n    /** @nocollapse */\n    BounceableService.ctorParameters = function () { return [\n        { type: undefined, decorators: [{ type: Inject, args: [BOUNCEABLE_CFG,] },] },\n    ]; };\n    return BounceableService;\n}());\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\nvar CollisionService = (function () {\n    function CollisionService() {\n    }\n    /**\n     * @param {?} item1\n     * @param {?} item2\n     * @return {?}\n     */\n    CollisionService.prototype.doItemsCollide = /**\n     * @param {?} item1\n     * @param {?} item2\n     * @return {?}\n     */\n    function (item1, item2) {\n        return item1.left < item2.right\n            && item1.right > item2.left\n            && item1.top < item2.bottom\n            && item1.bottom > item2.top;\n    };\n    /**\n     * @param {?} item1\n     * @param {?} item2\n     * @return {?}\n     */\n    CollisionService.prototype.getItemsOverlap = /**\n     * @param {?} item1\n     * @param {?} item2\n     * @return {?}\n     */\n    function (item1, item2) {\n        var /** @type {?} */ overlapXside1 = Math.abs(item1.left - item2.right);\n        var /** @type {?} */ overlapXside2 = Math.abs(item1.right - item2.left);\n        var /** @type {?} */ overlapYside1 = Math.abs(item1.top - item2.bottom);\n        var /** @type {?} */ overlapYside2 = Math.abs(item1.bottom - item2.top);\n        return new Vector(Math.min(overlapXside1, overlapXside2), Math.min(overlapYside1, overlapYside2));\n    };\n    CollisionService.decorators = [\n        { type: Injectable },\n    ];\n    /** @nocollapse */\n    CollisionService.ctorParameters = function () { return []; };\n    return CollisionService;\n}());\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\nvar BounceableComponent = (function () {\n    function BounceableComponent(_bounceableConfig, _bounceableService, _changeDetectorRef, _collisionService, _elementRef) {\n        this._bounceableConfig = _bounceableConfig;\n        this._bounceableService = _bounceableService;\n        this._changeDetectorRef = _changeDetectorRef;\n        this._collisionService = _collisionService;\n        this._elementRef = _elementRef;\n        this.position = new Vector();\n        this.momentum = new Vector();\n    }\n    /**\n     * @return {?}\n     */\n    BounceableComponent.prototype.ngOnInit = /**\n     * @return {?}\n     */\n    function () {\n        this._bounceableService.register(this);\n        this._changeDetectorRef.detach();\n    };\n    /**\n     * @param {?} changes\n     * @return {?}\n     */\n    BounceableComponent.prototype.ngOnChanges = /**\n     * @param {?} changes\n     * @return {?}\n     */\n    function (changes) {\n        var position = changes.position, momentum = changes.momentum;\n        if (position && position.currentValue) {\n            this.position = new Vector(position.currentValue.x, position.currentValue.y);\n        }\n        if (momentum && momentum.currentValue) {\n            this.momentum = new Vector(momentum.currentValue.x, momentum.currentValue.y);\n        }\n    };\n    /**\n     * @return {?}\n     */\n    BounceableComponent.prototype.ngAfterViewInit = /**\n     * @return {?}\n     */\n    function () {\n        this.width = this._elementRef.nativeElement.offsetWidth;\n        this.height = this._elementRef.nativeElement.offsetHeight;\n        this.weight = this.width * this.height;\n        this.updatePosition();\n    };\n    /**\n     * @return {?}\n     */\n    BounceableComponent.prototype.ngOnDestroy = /**\n     * @return {?}\n     */\n    function () {\n        this._bounceableService.unregister(this);\n    };\n    /**\n     * @param {?} $event\n     * @return {?}\n     */\n    BounceableComponent.prototype.onMouseDown = /**\n     * @param {?} $event\n     * @return {?}\n     */\n    function ($event) {\n        this.isDragging = false;\n        if (this._elementRef.nativeElement.contains($event.target)) {\n            $event.preventDefault();\n            this.isDragging = true;\n        }\n    };\n    /**\n     * @param {?} momentum\n     * @return {?}\n     */\n    BounceableComponent.prototype.onMouseUp = /**\n     * @param {?} momentum\n     * @return {?}\n     */\n    function (momentum) {\n        if (!this.isDragging) {\n            return;\n        }\n        this.momentum = new Vector(momentum.x, momentum.y);\n        this.isMoving = true;\n        this.isDragging = false;\n    };\n    /**\n     * @return {?}\n     */\n    BounceableComponent.prototype.step = /**\n     * @return {?}\n     */\n    function () {\n        if (!this.isMoving) {\n            return;\n        }\n        this.handleCollisions();\n        this.handleOutOfContainerBounds();\n        this.applyAirFriction();\n        this.updatePosition();\n    };\n    Object.defineProperty(BounceableComponent.prototype, \"bottom\", {\n        get: /**\n         * @return {?}\n         */\n        function () {\n            return this.position.y + this.height;\n        },\n        enumerable: true,\n        configurable: true\n    });\n    Object.defineProperty(BounceableComponent.prototype, \"top\", {\n        get: /**\n         * @return {?}\n         */\n        function () {\n            return this.position.y;\n        },\n        enumerable: true,\n        configurable: true\n    });\n    Object.defineProperty(BounceableComponent.prototype, \"right\", {\n        get: /**\n         * @return {?}\n         */\n        function () {\n            return this.position.x + this.width;\n        },\n        enumerable: true,\n        configurable: true\n    });\n    Object.defineProperty(BounceableComponent.prototype, \"left\", {\n        get: /**\n         * @return {?}\n         */\n        function () {\n            return this.position.x;\n        },\n        enumerable: true,\n        configurable: true\n    });\n    /**\n     * @return {?}\n     */\n    BounceableComponent.prototype.handleCollisions = /**\n     * @return {?}\n     */\n    function () {\n        var _this = this;\n        this._bounceableService.getItems()\n            .filter(function (item) { return item !== _this; })\n            .filter(function (item) { return _this._collisionService.doItemsCollide(item, _this); })\n            .forEach(function (item) { return _this.respondToCollisionWithItem(item); });\n    };\n    /**\n     * @return {?}\n     */\n    BounceableComponent.prototype.handleOutOfContainerBounds = /**\n     * @return {?}\n     */\n    function () {\n        var /** @type {?} */ left = this.position.x;\n        var /** @type {?} */ right = this.position.x + this.width;\n        var /** @type {?} */ top = this.position.y;\n        var /** @type {?} */ bottom = this.position.y + this.height;\n        if (left < 0) {\n            this.position.x = 0;\n            this.momentum.x *= -this._bounceableConfig.edgeBounceFrictionFactor;\n        }\n        if (right > document.body.clientWidth) {\n            this.position.x = document.body.clientWidth - this.width;\n            this.momentum.x *= -this._bounceableConfig.edgeBounceFrictionFactor;\n        }\n        if (top < 0) {\n            this.position.y = 0;\n            this.momentum.y *= -this._bounceableConfig.edgeBounceFrictionFactor;\n        }\n        if (bottom > document.body.clientHeight) {\n            this.position.y = document.body.clientHeight - this.height;\n            this.momentum.y *= -this._bounceableConfig.edgeBounceFrictionFactor;\n        }\n    };\n    /**\n     * @param {?} item\n     * @return {?}\n     */\n    BounceableComponent.prototype.respondToCollisionWithItem = /**\n     * @param {?} item\n     * @return {?}\n     */\n    function (item) {\n        var /** @type {?} */ overlapVector = this._collisionService.getItemsOverlap(this, item);\n        var /** @type {?} */ overlapRatioX = Math.abs(overlapVector.x / this.momentum.x);\n        var /** @type {?} */ overlapRatioY = Math.abs(overlapVector.y / this.momentum.y);\n        var /** @type {?} */ itemWeightRatio = this.weight / (this.weight + item.weight);\n        var /** @type {?} */ thisWeightRatio = 1 - itemWeightRatio;\n        var /** @type {?} */ totalImpulse = new Vector(this.momentum.x + item.momentum.x, this.momentum.y + item.momentum.y);\n        var /** @type {?} */ itemImpulse = new Vector(totalImpulse.x * itemWeightRatio, totalImpulse.y * itemWeightRatio);\n        var /** @type {?} */ thisImpulse = new Vector(totalImpulse.x * thisWeightRatio, totalImpulse.y * thisWeightRatio);\n        var /** @type {?} */ setBackVector = new Vector(this.momentum.x, this.momentum.y);\n        setBackVector.multiply((Math.abs(overlapRatioX) < Math.abs(overlapRatioY) ? overlapRatioX : overlapRatioY) * -1.001);\n        this.position.add(setBackVector.x, setBackVector.y);\n        this.momentum.set(-thisImpulse.x, -thisImpulse.y);\n        item.momentum.add(itemImpulse.x, itemImpulse.y);\n        item.isMoving = true;\n    };\n    /**\n     * @return {?}\n     */\n    BounceableComponent.prototype.applyAirFriction = /**\n     * @return {?}\n     */\n    function () {\n        this.momentum.multiply(this._bounceableConfig.airFrictionFactor);\n        if (Math.abs(this.momentum.x) < this._bounceableConfig.momentumNullThreshold) {\n            this.momentum.x = 0;\n        }\n        if (Math.abs(this.momentum.y) < this._bounceableConfig.momentumNullThreshold) {\n            this.momentum.y = 0;\n        }\n        this.isMoving = !(this.momentum.x === 0 && this.momentum.y === 0);\n    };\n    /**\n     * @return {?}\n     */\n    BounceableComponent.prototype.updatePosition = /**\n     * @return {?}\n     */\n    function () {\n        this.position.add(this.momentum.x, this.momentum.y);\n        this._elementRef.nativeElement.style.transform = \"translate3d(\" + this.position.x + \"px, \" + this.position.y + \"px, 0px)\";\n    };\n    BounceableComponent.decorators = [\n        { type: Component, args: [{\n                    selector: 'as-bounceable',\n                    template: '<ng-content></ng-content>',\n                    styles: [\"as-bounceable { display: inline-block; cursor: pointer; position: fixed; top: 0px; left: 0px; } as-bounceable * { -webkit-user-select: none; -moz-user-select: none; user-select: none; } \"],\n                    encapsulation: ViewEncapsulation.None\n                },] },\n    ];\n    /** @nocollapse */\n    BounceableComponent.ctorParameters = function () { return [\n        { type: undefined, decorators: [{ type: Inject, args: [BOUNCEABLE_CFG,] },] },\n        { type: BounceableService, },\n        { type: ChangeDetectorRef, },\n        { type: CollisionService, },\n        { type: ElementRef, },\n    ]; };\n    BounceableComponent.propDecorators = {\n        \"position\": [{ type: Input },],\n        \"momentum\": [{ type: Input },],\n    };\n    return BounceableComponent;\n}());\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\n/**\n * @record\n */\n\nvar DEFAULT_CONFIG = {\n    framesPerSecond: 50,\n    momentumSlowDownFactor: 0.1,\n    momentumNullThreshold: 0.5,\n    airFrictionFactor: 0.9,\n    edgeBounceFrictionFactor: 0.5\n};\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes} checked by tsc\n */\nvar BounceableModule = (function () {\n    function BounceableModule() {\n    }\n    /**\n     * @param {?=} config\n     * @return {?}\n     */\n    BounceableModule.initialize = /**\n     * @param {?=} config\n     * @return {?}\n     */\n    function (config) {\n        return {\n            ngModule: BounceableModule,\n            providers: [{\n                    provide: BOUNCEABLE_CFG,\n                    useValue: Object.assign(Object.assign({}, DEFAULT_CONFIG), config || {})\n                }]\n        };\n    };\n    BounceableModule.decorators = [\n        { type: NgModule, args: [{\n                    imports: [CommonModule],\n                    providers: [BounceableService, CollisionService],\n                    declarations: [BounceableComponent],\n                    exports: [BounceableComponent]\n                },] },\n    ];\n    /** @nocollapse */\n    BounceableModule.ctorParameters = function () { return []; };\n    return BounceableModule;\n}());\n\nexport { BounceableModule, BounceableComponent, DEFAULT_CONFIG, BOUNCEABLE_CFG, BounceableService, CollisionService, Vector };\n"]}