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/B,OAAO,KAAK,OAAS,CACzB,EAEO,CAEX","file":"/npm/marker-animate-unobtrusive@0.2.8/SlidingMarker.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/marker-animate-unobtrusive@0.2.8/SlidingMarker.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","﻿/* global define,module,require,google */\r\n\r\n(function (root, factory) {\r\n    'use strict';\r\n    if (typeof define === 'function' && define.amd) {\r\n        // AMD. Register as an anonymous module.\r\n        define(['jquery', 'marker-animate'], factory.bind(null, root));\r\n    } else if (typeof module !== \"undefined\" && module !== null && module.exports != null) { // jshint ignore:line\r\n        // Node module.\r\n        module.exports = factory(root, require('jquery'), require('marker-animate'));\r\n    } else {\r\n        // Browser globals\r\n        root.SlidingMarker = factory(root, root.jQuery);\r\n    }\r\n}(this,\r\n    function (root, $) {\r\n        'use strict';\r\n\r\n        //Let jQuery be soft dependency\r\n        $ = $ || {};\r\n        $.extend = $.extend || function extend(obj) {\r\n            //Taken (and modified) from here: http://stackoverflow.com/a/14604815/1691132\r\n            Array.prototype.slice.call(arguments, 1).forEach(function (source) {\r\n                if (source) {\r\n                    for (var prop in source) {\r\n                        if (source[prop] && source[prop].constructor === Object) {\r\n                            if (!obj[prop] || obj[prop].constructor === Object) {\r\n                                obj[prop] = obj[prop] || {};\r\n                                extend(obj[prop], source[prop]);\r\n                            } else {\r\n                                obj[prop] = source[prop];\r\n                            }\r\n                        } else {\r\n                            obj[prop] = source[prop];\r\n                        }\r\n                    }\r\n                }\r\n            });\r\n            return obj;\r\n        };\r\n\r\n        var GoogleMarker = google.maps.Marker; //Store original in case it will be replaced in initializeGlobally().\r\n\r\n        var animateTo,\r\n            markerAnimate_AnimateTo_Wrapper = function(destPosition, easing, duration) { //default implementation based on markerAnimate\r\n                if (destPosition === null || destPosition === undefined) {\r\n                    //as markerAnimate provides no means to stop animation, do it manually, even though it leaks markerAnimate implementation.\r\n                    if (window.cancelAnimationFrame) {\r\n                        window.cancelAnimationFrame(this.AT_animationHandler);\r\n                    } else {\r\n                        clearTimeout(this.AT_animationHandler); \r\n                    }\r\n                    return;\r\n                }\r\n                google.maps.Marker.prototype.animateTo.apply(this, arguments);\r\n            };\r\n\r\n        //default options\r\n        var defaultOptions = {\r\n            easing: \"easeInOutQuint\",\r\n            duration: 1000,\r\n            animateFunctionAdapter: function (marker, destPosition, easing, duration) {\r\n                if (!animateTo) {\r\n                    if (!google.maps.Marker.prototype.animateTo) {\r\n                        throw new Error(\"Please either reference markerAnimate.js, or provide an alternative animateFunctionAdapter\");\r\n                    }\r\n                    animateTo = markerAnimate_AnimateTo_Wrapper;\r\n                }\r\n                animateTo.call(marker, destPosition, {\r\n                    easing: easing,\r\n                    duration: duration,\r\n                    complete: function () {\r\n                    }\r\n                });\r\n            }\r\n        };\r\n\r\n        var inherits = function (childCtor, parentCtor) {\r\n            /* @constructor */\r\n            function TempCtor() {}\r\n\r\n            TempCtor.prototype = parentCtor.prototype;\r\n            childCtor.superClass_ = parentCtor.prototype;\r\n            childCtor.prototype = new TempCtor();\r\n            /* @override */\r\n            childCtor.prototype.constructor = childCtor;\r\n        };\r\n\r\n        var decorates = function (childCtor, parentCtor) {\r\n            inherits(childCtor, parentCtor);\r\n\r\n            var parentPrototype = parentCtor.prototype;\r\n\r\n            //TODO: google.maps.MVCObject.prototype.set if object instanceof GoogleMarker\r\n\r\n            $.extend(childCtor.prototype, {\r\n                _instance: null, //override it in constructor\r\n\r\n                originalSet: function () {\r\n                    return parentPrototype.set.apply(this, arguments);\r\n                },\r\n\r\n                //from MVCObject\r\n                set: function (key, value) {\r\n                    var that = this;\r\n\r\n                    that.originalSet.apply(that, arguments);\r\n\r\n                    if (key === \"position\" && that instanceof SlidingMarker) {\r\n                        that._setInstancePositionAnimated(value);\r\n                    } else {\r\n                        that.originalSet.apply(that._instance, arguments);\r\n                    }\r\n                },\r\n\r\n                _setInstancePositionAnimated: function (position) {\r\n                    var that = this;\r\n\r\n                    if (that._constructing) { //pass by\r\n                        return;\r\n                    }\r\n\r\n                    if (!position || !that._instance.getPosition()) { //If position is set for a first time, no animation should be applied\r\n                        if (that._instance.getPosition() !== position) {\r\n                            that._instance.setPosition(position);\r\n                        }\r\n                        return;\r\n                    }\r\n\r\n                    //apply animation function\r\n                    //this will cause many animationposition_changed events\r\n                    that.get(\"animateFunctionAdapter\").call(null, that._instance, position, that.get(\"easing\"), that.get(\"duration\"));\r\n                },\r\n\r\n                //setValues() will call set(), no need to override\r\n\r\n                originalAddListener: function () {\r\n                    return parentPrototype.addListener.apply(this, arguments);\r\n                },\r\n\r\n                //from MVCObject\r\n                addListener: function (eventName, handler) {\r\n                    var target = (eventName === \"map_changed\") ? this._instance : getEventTarget.call(this, eventName);\r\n                    return this.originalAddListener.apply(target, arguments);\r\n                },\r\n\r\n                map_changed: function () {\r\n                    //Should be empty\r\n                    //Prevents this marker from appearing on map. Only this._instance marker will appear.\r\n                },\r\n\r\n                //This will be called by binding created with marker.bindTo() method, instead of call to set(\"position\").\r\n                position_changed: function () {\r\n                    if (!this._suppress_animation) {\r\n                        this._setInstancePositionAnimated(this.getPosition());\r\n                    } else {\r\n                        delete this._suppress_animation;\r\n                    }\r\n                }\r\n                \r\n            });\r\n\r\n        };\r\n\r\n        //call it on SlidingMarker\r\n        var getEventTarget = function (eventName) {\r\n            //redirect _changed events to this, other events to _instance\r\n            if (eventName.endsWith(\"_changed\")) { //all _changed redirect to this\r\n                return this;\r\n            } \r\n            return this._instance;\r\n        };\r\n\r\n        var originalAddListener = google.maps.event.addListener;\r\n        google.maps.event.addListener = function (instance, eventName, handler) {\r\n            //Redirect listener to target\r\n            if (instance instanceof SlidingMarker) {\r\n                var target = (eventName === \"map_changed\") ? instance._instance : getEventTarget.call(instance, eventName);\r\n                return originalAddListener.call(this, target, eventName, handler);\r\n            }\r\n\r\n            return originalAddListener.apply(this, arguments);\r\n        };\r\n\r\n        var originalTrigger = google.maps.event.trigger;\r\n        google.maps.event.trigger = function (instance, eventName) {\r\n            //Replace instance parameter to target\r\n            if (instance instanceof SlidingMarker) {\r\n                var target = (eventName === \"map_changed\") ? instance : getEventTarget.call(instance, eventName),\r\n                    newArgs = [target].concat(Array.prototype.slice.call(arguments, 1)); //replaces instance parameter with target\r\n\r\n                return originalTrigger.apply(this, newArgs);\r\n            }\r\n\r\n            return originalTrigger.apply(this, arguments);\r\n        };\r\n\r\n        //just string helper\r\n        String.prototype.endsWith = String.prototype.endsWith || function(suffix) {\r\n            return this.indexOf(suffix, this.length - suffix.length) !== -1;\r\n        };\r\n\r\n        //constructor\r\n        var SlidingMarker = function (opt_options) {\r\n\r\n            opt_options = $.extend({}, defaultOptions, opt_options);\r\n\r\n            this._instance = new GoogleMarker(opt_options);\r\n\r\n            this.animationPosition = null;\r\n\r\n            this._constructing = true;\r\n            // Call the parent constructor.\r\n            GoogleMarker.call(this, opt_options);\r\n            delete this._constructing;\r\n\r\n            this.bindTo(\"animationPosition\", this._instance, \"position\");\r\n            this.bindTo(\"anchorPoint\", this._instance, \"anchorPoint\"); //This makes InfoWindow.open(map, marker) work.\r\n            this.bindTo(\"internalPosition\", this._instance, \"internalPosition\"); //This makes InfoWindow.open(map, marker) work.\r\n\r\n        };\r\n\r\n        decorates(SlidingMarker, GoogleMarker);\r\n\r\n        //Overrides\r\n        $.extend(SlidingMarker.prototype, {\r\n\r\n            getAnimationPosition: function () {\r\n                return this.get(\"animationPosition\");\r\n            },\r\n\r\n            //Changes marker position immediately\r\n            setPositionNotAnimated: function (position) {\r\n                this._suppress_animation = true; //will be unset by position_changed handler\r\n                this.get(\"animateFunctionAdapter\").call(null, this._instance, null); //stop current animation\r\n                this.originalSet(\"position\", position);\r\n                this._instance.setPosition(position);\r\n            },\r\n\r\n            setDuration: function (value) {\r\n                this.set(\"duration\", value);\r\n            },\r\n\r\n            getDuration: function () {\r\n                return this.get(\"duration\");\r\n            },\r\n\r\n            setEasing: function (value) {\r\n                this.set(\"easing\", value);\r\n            },\r\n\r\n            getEasing: function () {\r\n                return this.get(\"easing\");\r\n            }\r\n\r\n        });\r\n\r\n        SlidingMarker.initializeGlobally = function () {\r\n            google.maps.Marker = SlidingMarker;\r\n        };\r\n\r\n        return SlidingMarker;\r\n\r\n    }));"]}