modified-dicom-pacs
Version:
A modified version of DICOM PACS implementation
2 lines • 751 kB
JavaScript
/*! For license information please see vendors~dicom-microscopy-viewer.bundle.9f1314e253d7302929df.js.LICENSE */
(window.webpackJsonp=window.webpackJsonp||[]).push([[11],{1104:function(e,t,i){(function(e){(function(t){"use strict";function i(){return function(){throw new Error("Unimplemented abstract method.")}()}var n=0;function r(e){return e.ol_uid||(e.ol_uid=String(++n))}var o="5.3.0",a=function(e){function t(t){var i="Assertion failed. See https://openlayers.org/en/v"+o.split("-")[0]+"/doc/errors/#"+t+" for details.";e.call(this,i),this.code=t,this.name="AssertionError",this.message=i}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t}(Error),s={ADD:"add",REMOVE:"remove"},c="propertychange",l="function"==typeof Object.assign?Object.assign:function(e,t){var i=arguments;if(null==e)throw new TypeError("Cannot convert undefined or null to object");for(var n=Object(e),r=1,o=arguments.length;r<o;++r){var a=i[r];if(null!=a)for(var s in a)a.hasOwnProperty(s)&&(n[s]=a[s])}return n};function u(e){for(var t in e)delete e[t]}function h(e){var t=[];for(var i in e)t.push(e[i]);return t}function d(e){var t;for(t in e)return!1;return!t}function p(e,t,i,n){for(var r,o=0,a=e.length;o<a;++o)if((r=e[o]).listener===t&&r.bindTo===i)return n&&(r.deleteIndex=o),r}function m(e,t){var i=f(e);return i?i[t]:void 0}function f(e,t){var i=e.ol_lm;return!i&&t&&(i=e.ol_lm={}),i}function g(e,t){var i=m(e,t);if(i){for(var n=0,r=i.length;n<r;++n)e.removeEventListener(t,i[n].boundListener),u(i[n]);i.length=0;var o=f(e);o&&(delete o[t],0===Object.keys(o).length&&function(e){delete e.ol_lm}(e))}}function S(e,t,i,n,r){var o=f(e,!0),a=o[t];a||(a=o[t]=[]);var s=p(a,i,n,!1);return s?r||(s.callOnce=!1):(s={bindTo:n,callOnce:!!r,listener:i,target:e,type:t},e.addEventListener(t,function(e){var t=function(t){var i=e.listener,n=e.bindTo||e.target;return e.callOnce&&_(e),i.call(n,t)};return e.boundListener=t,t}(s)),a.push(s)),s}function y(e,t,i,n){return S(e,t,i,n,!0)}function v(e,t,i,n){var r=m(e,t);if(r){var o=p(r,i,n,!0);o&&_(o)}}function _(e){if(e&&e.target){e.target.removeEventListener(e.type,e.boundListener);var t=m(e.target,e.type);if(t){var i="deleteIndex"in e?e.deleteIndex:t.indexOf(e);-1!==i&&t.splice(i,1),0===t.length&&g(e.target,e.type)}u(e)}}function C(e){var t=f(e);if(t)for(var i in t)g(e,i)}var T=function(){this.disposed_=!1};function D(){return!0}function A(){return!1}function I(){}T.prototype.dispose=function(){this.disposed_||(this.disposed_=!0,this.disposeInternal())},T.prototype.disposeInternal=function(){};var P=function(e){this.propagationStopped,this.type=e,this.target=null};function R(e){e.stopPropagation()}P.prototype.preventDefault=function(){this.propagationStopped=!0},P.prototype.stopPropagation=function(){this.propagationStopped=!0};var x=function(e){function t(){e.call(this),this.pendingRemovals_={},this.dispatching_={},this.listeners_={}}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.addEventListener=function(e,t){var i=this.listeners_[e];i||(i=this.listeners_[e]=[]),-1===i.indexOf(t)&&i.push(t)},t.prototype.dispatchEvent=function(e){var t="string"==typeof e?new P(e):e,i=t.type;t.target=this;var n,r=this.listeners_[i];if(r){i in this.dispatching_||(this.dispatching_[i]=0,this.pendingRemovals_[i]=0),++this.dispatching_[i];for(var o=0,a=r.length;o<a;++o)if(!1===r[o].call(this,t)||t.propagationStopped){n=!1;break}if(--this.dispatching_[i],0===this.dispatching_[i]){var s=this.pendingRemovals_[i];for(delete this.pendingRemovals_[i];s--;)this.removeEventListener(i,I);delete this.dispatching_[i]}return n}},t.prototype.disposeInternal=function(){C(this)},t.prototype.getListeners=function(e){return this.listeners_[e]},t.prototype.hasListener=function(e){return e?e in this.listeners_:Object.keys(this.listeners_).length>0},t.prototype.removeEventListener=function(e,t){var i=this.listeners_[e];if(i){var n=i.indexOf(t);e in this.pendingRemovals_?(i[n]=I,++this.pendingRemovals_[e]):(i.splice(n,1),0===i.length&&delete this.listeners_[e])}},t}(T),E={CHANGE:"change",CLEAR:"clear",CONTEXTMENU:"contextmenu",CLICK:"click",DBLCLICK:"dblclick",DRAGENTER:"dragenter",DRAGOVER:"dragover",DROP:"drop",ERROR:"error",KEYDOWN:"keydown",KEYPRESS:"keypress",LOAD:"load",MOUSEDOWN:"mousedown",MOUSEMOVE:"mousemove",MOUSEOUT:"mouseout",MOUSEUP:"mouseup",MOUSEWHEEL:"mousewheel",MSPOINTERDOWN:"MSPointerDown",RESIZE:"resize",TOUCHSTART:"touchstart",TOUCHMOVE:"touchmove",TOUCHEND:"touchend",WHEEL:"wheel"},b=function(e){function t(){e.call(this),this.revision_=0}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.changed=function(){++this.revision_,this.dispatchEvent(E.CHANGE)},t.prototype.getRevision=function(){return this.revision_},t.prototype.on=function(e,t){if(Array.isArray(e)){for(var i=e.length,n=new Array(i),r=0;r<i;++r)n[r]=S(this,e[r],t);return n}return S(this,e,t)},t.prototype.once=function(e,t){if(Array.isArray(e)){for(var i=e.length,n=new Array(i),r=0;r<i;++r)n[r]=y(this,e[r],t);return n}return y(this,e,t)},t.prototype.un=function(e,t){if(Array.isArray(e))for(var i=0,n=e.length;i<n;++i)v(this,e[i],t);else v(this,e,t)},t}(x),O=function(e){function t(t,i,n){e.call(this,t),this.key=i,this.oldValue=n}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t}(P),q=function(e){function t(t){e.call(this),r(this),this.values_={},void 0!==t&&this.setProperties(t)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.get=function(e){var t;return this.values_.hasOwnProperty(e)&&(t=this.values_[e]),t},t.prototype.getKeys=function(){return Object.keys(this.values_)},t.prototype.getProperties=function(){return l({},this.values_)},t.prototype.notify=function(e,t){var i;i=M(e),this.dispatchEvent(new O(i,e,t)),i=c,this.dispatchEvent(new O(i,e,t))},t.prototype.set=function(e,t,i){if(i)this.values_[e]=t;else{var n=this.values_[e];this.values_[e]=t,n!==t&&this.notify(e,n)}},t.prototype.setProperties=function(e,t){for(var i in e)this.set(i,e[i],t)},t.prototype.unset=function(e,t){if(e in this.values_){var i=this.values_[e];delete this.values_[e],t||this.notify(e,i)}},t}(b),F={};function M(e){return F.hasOwnProperty(e)?F[e]:F[e]="change:"+e}var L,w,N="length",B=function(e){function t(t,i){e.call(this,t),this.element=i}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t}(P),V=function(e){function t(t,i){e.call(this);var n=i||{};if(this.unique_=!!n.unique,this.array_=t||[],this.unique_)for(var r=0,o=this.array_.length;r<o;++r)this.assertUnique_(this.array_[r],r);this.updateLength_()}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.clear=function(){for(;this.getLength()>0;)this.pop()},t.prototype.extend=function(e){for(var t=0,i=e.length;t<i;++t)this.push(e[t]);return this},t.prototype.forEach=function(e){for(var t=this.array_,i=0,n=t.length;i<n;++i)e(t[i],i,t)},t.prototype.getArray=function(){return this.array_},t.prototype.item=function(e){return this.array_[e]},t.prototype.getLength=function(){return this.get(N)},t.prototype.insertAt=function(e,t){this.unique_&&this.assertUnique_(t),this.array_.splice(e,0,t),this.updateLength_(),this.dispatchEvent(new B(s.ADD,t))},t.prototype.pop=function(){return this.removeAt(this.getLength()-1)},t.prototype.push=function(e){this.unique_&&this.assertUnique_(e);var t=this.getLength();return this.insertAt(t,e),this.getLength()},t.prototype.remove=function(e){for(var t=this.array_,i=0,n=t.length;i<n;++i)if(t[i]===e)return this.removeAt(i)},t.prototype.removeAt=function(e){var t=this.array_[e];return this.array_.splice(e,1),this.updateLength_(),this.dispatchEvent(new B(s.REMOVE,t)),t},t.prototype.setAt=function(e,t){var i=this.getLength();if(e<i){this.unique_&&this.assertUnique_(t,e);var n=this.array_[e];this.array_[e]=t,this.dispatchEvent(new B(s.REMOVE,n)),this.dispatchEvent(new B(s.ADD,t))}else{for(var r=i;r<e;++r)this.insertAt(r,void 0);this.insertAt(e,t)}},t.prototype.updateLength_=function(){this.set(N,this.array_.length)},t.prototype.assertUnique_=function(e,t){for(var i=0,n=this.array_.length;i<n;++i)if(this.array_[i]===e&&i!==t)throw new a(58)},t}(q),k=function(e){function t(t,i,n){e.call(this,t),this.map=i,this.frameState=void 0!==n?n:null}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t}(P),G=function(e){function t(t,i,n,r,o){e.call(this,t,i,o),this.originalEvent=n,this.pixel=i.getEventPixel(n),this.coordinate=i.getCoordinateFromPixel(this.pixel),this.dragging=void 0!==r&&r}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.preventDefault=function(){e.prototype.preventDefault.call(this),this.originalEvent.preventDefault()},t.prototype.stopPropagation=function(){e.prototype.stopPropagation.call(this),this.originalEvent.stopPropagation()},t}(k),U=9729,W=10242,z=10243,H=3553,j=["experimental-webgl","webgl","webkit-3d","moz-webgl"];function X(e,t){for(var i=j.length,n=0;n<i;++n)try{var r=e.getContext(j[n],t);if(r)return r}catch(e){}return null}if("undefined"!=typeof window&&"WebGLRenderingContext"in window)try{var Y=X(document.createElement("canvas"),{failIfMajorPerformanceCaveat:!0});Y&&(L=Y.getParameter(Y.MAX_TEXTURE_SIZE),w=Y.getSupportedExtensions())}catch(e){}var K="undefined"!=typeof navigator?navigator.userAgent.toLowerCase():"",Z=-1!==K.indexOf("firefox"),Q=-1!==K.indexOf("safari")&&-1==K.indexOf("chrom"),J=-1!==K.indexOf("webkit")&&-1==K.indexOf("edge"),$=-1!==K.indexOf("macintosh"),ee=window.devicePixelRatio||1,te=function(){var e=!1;try{e=!!document.createElement("canvas").getContext("2d").setLineDash}catch(e){}return e}(),ie="ontouchstart"in window,ne="PointerEvent"in window,re=!!navigator.msPointerEnabled,oe={SINGLECLICK:"singleclick",CLICK:E.CLICK,DBLCLICK:E.DBLCLICK,POINTERDRAG:"pointerdrag",POINTERMOVE:"pointermove",POINTERDOWN:"pointerdown",POINTERUP:"pointerup",POINTEROVER:"pointerover",POINTEROUT:"pointerout",POINTERENTER:"pointerenter",POINTERLEAVE:"pointerleave",POINTERCANCEL:"pointercancel"},ae=function(e){function t(t,i,n,r,o){e.call(this,t,i,n.originalEvent,r,o),this.pointerEvent=n}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t}(G),se={POINTERMOVE:"pointermove",POINTERDOWN:"pointerdown",POINTERUP:"pointerup",POINTEROVER:"pointerover",POINTEROUT:"pointerout",POINTERENTER:"pointerenter",POINTERLEAVE:"pointerleave",POINTERCANCEL:"pointercancel"},ce=function(e,t){this.dispatcher=e,this.mapping_=t};ce.prototype.getEvents=function(){return Object.keys(this.mapping_)},ce.prototype.getHandlerForEvent=function(e){return this.mapping_[e]};var le=1,ue="mouse";function he(e){if(!this.isEventSimulatedFromTouch_(e)){le.toString()in this.pointerMap&&this.cancel(e);var t=Se(e,this.dispatcher);this.pointerMap[le.toString()]=e,this.dispatcher.down(t,e)}}function de(e){if(!this.isEventSimulatedFromTouch_(e)){var t=Se(e,this.dispatcher);this.dispatcher.move(t,e)}}function pe(e){if(!this.isEventSimulatedFromTouch_(e)){var t=this.pointerMap[le.toString()];if(t&&t.button===e.button){var i=Se(e,this.dispatcher);this.dispatcher.up(i,e),this.cleanupMouse()}}}function me(e){if(!this.isEventSimulatedFromTouch_(e)){var t=Se(e,this.dispatcher);this.dispatcher.enterOver(t,e)}}function fe(e){if(!this.isEventSimulatedFromTouch_(e)){var t=Se(e,this.dispatcher);this.dispatcher.leaveOut(t,e)}}var ge=function(e){function t(t){var i={mousedown:he,mousemove:de,mouseup:pe,mouseover:me,mouseout:fe};e.call(this,t,i),this.pointerMap=t.pointerMap,this.lastTouches=[]}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.isEventSimulatedFromTouch_=function(e){for(var t=this.lastTouches,i=e.clientX,n=e.clientY,r=0,o=t.length,a=void 0;r<o&&(a=t[r]);r++){var s=Math.abs(i-a[0]),c=Math.abs(n-a[1]);if(s<=25&&c<=25)return!0}return!1},t.prototype.cancel=function(e){var t=Se(e,this.dispatcher);this.dispatcher.cancel(t,e),this.cleanupMouse()},t.prototype.cleanupMouse=function(){delete this.pointerMap[le.toString()]},t}(ce);function Se(e,t){var i=t.cloneEvent(e,e),n=i.preventDefault;return i.preventDefault=function(){e.preventDefault(),n()},i.pointerId=le,i.isPrimary=!0,i.pointerType=ue,i}var ye=["","unavailable","touch","pen","mouse"];function ve(e){this.pointerMap[e.pointerId.toString()]=e;var t=this.prepareEvent_(e);this.dispatcher.down(t,e)}function _e(e){var t=this.prepareEvent_(e);this.dispatcher.move(t,e)}function Ce(e){var t=this.prepareEvent_(e);this.dispatcher.up(t,e),this.cleanup(e.pointerId)}function Te(e){var t=this.prepareEvent_(e);this.dispatcher.leaveOut(t,e)}function De(e){var t=this.prepareEvent_(e);this.dispatcher.enterOver(t,e)}function Ae(e){var t=this.prepareEvent_(e);this.dispatcher.cancel(t,e),this.cleanup(e.pointerId)}function Ie(e){var t=this.dispatcher.makeEvent("lostpointercapture",e,e);this.dispatcher.dispatchEvent(t)}function Pe(e){var t=this.dispatcher.makeEvent("gotpointercapture",e,e);this.dispatcher.dispatchEvent(t)}var Re=function(e){function t(t){var i={MSPointerDown:ve,MSPointerMove:_e,MSPointerUp:Ce,MSPointerOut:Te,MSPointerOver:De,MSPointerCancel:Ae,MSGotPointerCapture:Pe,MSLostPointerCapture:Ie};e.call(this,t,i),this.pointerMap=t.pointerMap}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.prepareEvent_=function(e){var t=e;return"number"==typeof e.pointerType&&((t=this.dispatcher.cloneEvent(e,e)).pointerType=ye[e.pointerType]),t},t.prototype.cleanup=function(e){delete this.pointerMap[e.toString()]},t}(ce);function xe(e){this.dispatcher.fireNativeEvent(e)}function Ee(e){this.dispatcher.fireNativeEvent(e)}function be(e){this.dispatcher.fireNativeEvent(e)}function Oe(e){this.dispatcher.fireNativeEvent(e)}function qe(e){this.dispatcher.fireNativeEvent(e)}function Fe(e){this.dispatcher.fireNativeEvent(e)}function Me(e){this.dispatcher.fireNativeEvent(e)}function Le(e){this.dispatcher.fireNativeEvent(e)}var we=function(e){function t(t){var i={pointerdown:xe,pointermove:Ee,pointerup:be,pointerout:Oe,pointerover:qe,pointercancel:Fe,gotpointercapture:Le,lostpointercapture:Me};e.call(this,t,i)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t}(ce),Ne=!1,Be=function(e){function t(t,i,n){e.call(this,t),this.originalEvent=i;var r=n||{};this.buttons=function(e){var t;if(e.buttons||Ne)t=e.buttons;else switch(e.which){case 1:t=1;break;case 2:t=4;break;case 3:t=2;break;default:t=0}return t}(r),this.pressure=function(e,t){return e.pressure?e.pressure:t?.5:0}(r,this.buttons),this.bubbles="bubbles"in r&&r.bubbles,this.cancelable="cancelable"in r&&r.cancelable,this.view="view"in r?r.view:null,this.detail="detail"in r?r.detail:null,this.screenX="screenX"in r?r.screenX:0,this.screenY="screenY"in r?r.screenY:0,this.clientX="clientX"in r?r.clientX:0,this.clientY="clientY"in r?r.clientY:0,this.ctrlKey="ctrlKey"in r&&r.ctrlKey,this.altKey="altKey"in r&&r.altKey,this.shiftKey="shiftKey"in r&&r.shiftKey,this.metaKey="metaKey"in r&&r.metaKey,this.button="button"in r?r.button:0,this.relatedTarget="relatedTarget"in r?r.relatedTarget:null,this.pointerId="pointerId"in r?r.pointerId:0,this.width="width"in r?r.width:0,this.height="height"in r?r.height:0,this.tiltX="tiltX"in r?r.tiltX:0,this.tiltY="tiltY"in r?r.tiltY:0,this.pointerType="pointerType"in r?r.pointerType:"",this.hwTimestamp="hwTimestamp"in r?r.hwTimestamp:0,this.isPrimary="isPrimary"in r&&r.isPrimary,i.preventDefault&&(this.preventDefault=function(){i.preventDefault()})}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t}(P);function Ve(e,t){return e>t?1:e<t?-1:0}function ke(e,t){return e.indexOf(t)>=0}function Ge(e,t,i){var n,r=e.length;if(e[0]<=t)return 0;if(t<=e[r-1])return r-1;if(i>0){for(n=1;n<r;++n)if(e[n]<t)return n-1}else if(i<0){for(n=1;n<r;++n)if(e[n]<=t)return n}else for(n=1;n<r;++n){if(e[n]==t)return n;if(e[n]<t)return e[n-1]-t<t-e[n]?n-1:n}return r-1}function Ue(e,t,i){for(;t<i;){var n=e[t];e[t]=e[i],e[i]=n,++t,--i}}function We(e,t){for(var i=Array.isArray(t)?t:[t],n=i.length,r=0;r<n;r++)e[e.length]=i[r]}function ze(e,t){var i=e.length;if(i!==t.length)return!1;for(var n=0;n<i;n++)if(e[n]!==t[n])return!1;return!0}function He(e,t){var i,n=e.length,r=Array(e.length);for(i=0;i<n;i++)r[i]={index:i,value:e[i]};for(r.sort((function(e,i){return t(e.value,i.value)||e.index-i.index})),i=0;i<e.length;i++)e[i]=r[i].value}function je(e){this.vacuumTouches_(e),this.setPrimaryTouch_(e.changedTouches[0]),this.dedupSynthMouse_(e),this.clickCount_++,this.processTouches_(e,this.overDown_)}function Xe(e){this.processTouches_(e,this.moveOverOut_)}function Ye(e){this.dedupSynthMouse_(e),this.processTouches_(e,this.upOut_)}function Ke(e){this.processTouches_(e,this.cancelOut_)}!function(){try{var e=new MouseEvent("click",{buttons:1});Ne=1===e.buttons}catch(e){}}();var Ze=function(e){function t(t,i){var n={touchstart:je,touchmove:Xe,touchend:Ye,touchcancel:Ke};e.call(this,t,n),this.pointerMap=t.pointerMap,this.mouseSource=i,this.firstTouchId_=void 0,this.clickCount_=0,this.resetId_,this.dedupTimeout_=2500}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.isPrimaryTouch_=function(e){return this.firstTouchId_===e.identifier},t.prototype.setPrimaryTouch_=function(e){var t=Object.keys(this.pointerMap).length;(0===t||1===t&&le.toString()in this.pointerMap)&&(this.firstTouchId_=e.identifier,this.cancelResetClickCount_())},t.prototype.removePrimaryPointer_=function(e){e.isPrimary&&(this.firstTouchId_=void 0,this.resetClickCount_())},t.prototype.resetClickCount_=function(){this.resetId_=setTimeout(this.resetClickCountHandler_.bind(this),200)},t.prototype.resetClickCountHandler_=function(){this.clickCount_=0,this.resetId_=void 0},t.prototype.cancelResetClickCount_=function(){void 0!==this.resetId_&&clearTimeout(this.resetId_)},t.prototype.touchToPointer_=function(e,t){var i=this.dispatcher.cloneEvent(e,t);return i.pointerId=t.identifier+2,i.bubbles=!0,i.cancelable=!0,i.detail=this.clickCount_,i.button=0,i.buttons=1,i.width=t.radiusX||0,i.height=t.radiusY||0,i.pressure=t.force||.5,i.isPrimary=this.isPrimaryTouch_(t),i.pointerType="touch",i.clientX=t.clientX,i.clientY=t.clientY,i.screenX=t.screenX,i.screenY=t.screenY,i},t.prototype.processTouches_=function(e,t){var i=Array.prototype.slice.call(e.changedTouches),n=i.length;function r(){e.preventDefault()}for(var o=0;o<n;++o){var a=this.touchToPointer_(e,i[o]);a.preventDefault=r,t.call(this,e,a)}},t.prototype.findTouch_=function(e,t){for(var i=e.length,n=0;n<i;n++)if(e[n].identifier===t)return!0;return!1},t.prototype.vacuumTouches_=function(e){var t=e.touches,i=Object.keys(this.pointerMap),n=i.length;if(n>=t.length){for(var r=[],o=0;o<n;++o){var a=Number(i[o]),s=this.pointerMap[a];a==le||this.findTouch_(t,a-2)||r.push(s.out)}for(var c=0;c<r.length;++c)this.cancelOut_(e,r[c])}},t.prototype.overDown_=function(e,t){this.pointerMap[t.pointerId]={target:t.target,out:t,outTarget:t.target},this.dispatcher.over(t,e),this.dispatcher.enter(t,e),this.dispatcher.down(t,e)},t.prototype.moveOverOut_=function(e,t){var i=t,n=this.pointerMap[i.pointerId];if(n){var r=n.out,o=n.outTarget;this.dispatcher.move(i,e),r&&o!==i.target&&(r.relatedTarget=i.target,i.relatedTarget=o,r.target=o,i.target?(this.dispatcher.leaveOut(r,e),this.dispatcher.enterOver(i,e)):(i.target=o,i.relatedTarget=null,this.cancelOut_(e,i))),n.out=i,n.outTarget=i.target}},t.prototype.upOut_=function(e,t){this.dispatcher.up(t,e),this.dispatcher.out(t,e),this.dispatcher.leave(t,e),this.cleanUpPointer_(t)},t.prototype.cancelOut_=function(e,t){this.dispatcher.cancel(t,e),this.dispatcher.out(t,e),this.dispatcher.leave(t,e),this.cleanUpPointer_(t)},t.prototype.cleanUpPointer_=function(e){delete this.pointerMap[e.pointerId],this.removePrimaryPointer_(e)},t.prototype.dedupSynthMouse_=function(e){var t=this.mouseSource.lastTouches,i=e.changedTouches[0];if(this.isPrimaryTouch_(i)){var n=[i.clientX,i.clientY];t.push(n),setTimeout((function(){var e,i,r;i=n,(r=(e=t).indexOf(i))>-1&&e.splice(r,1)}),this.dedupTimeout_)}},t}(ce),Qe=[["bubbles",!1],["cancelable",!1],["view",null],["detail",null],["screenX",0],["screenY",0],["clientX",0],["clientY",0],["ctrlKey",!1],["altKey",!1],["shiftKey",!1],["metaKey",!1],["button",0],["relatedTarget",null],["buttons",0],["pointerId",0],["width",0],["height",0],["pressure",0],["tiltX",0],["tiltY",0],["pointerType",""],["hwTimestamp",0],["isPrimary",!1],["type",""],["target",null],["currentTarget",null],["which",0]],Je=function(e){function t(t){e.call(this),this.element_=t,this.pointerMap={},this.eventMap_={},this.eventSourceList_=[],this.registerSources()}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.registerSources=function(){if(ne)this.registerSource("native",new we(this));else if(re)this.registerSource("ms",new Re(this));else{var e=new ge(this);this.registerSource("mouse",e),ie&&this.registerSource("touch",new Ze(this,e))}this.register_()},t.prototype.registerSource=function(e,t){var i=t,n=i.getEvents();n&&(n.forEach(function(e){var t=i.getHandlerForEvent(e);t&&(this.eventMap_[e]=t.bind(i))}.bind(this)),this.eventSourceList_.push(i))},t.prototype.register_=function(){for(var e=this.eventSourceList_.length,t=0;t<e;t++){var i=this.eventSourceList_[t];this.addEvents_(i.getEvents())}},t.prototype.unregister_=function(){for(var e=this.eventSourceList_.length,t=0;t<e;t++){var i=this.eventSourceList_[t];this.removeEvents_(i.getEvents())}},t.prototype.eventHandler_=function(e){var t=e.type,i=this.eventMap_[t];i&&i(e)},t.prototype.addEvents_=function(e){e.forEach(function(e){S(this.element_,e,this.eventHandler_,this)}.bind(this))},t.prototype.removeEvents_=function(e){e.forEach(function(e){v(this.element_,e,this.eventHandler_,this)}.bind(this))},t.prototype.cloneEvent=function(e,t){for(var i={},n=0,r=Qe.length;n<r;n++){var o=Qe[n][0];i[o]=e[o]||t[o]||Qe[n][1]}return i},t.prototype.down=function(e,t){this.fireEvent(se.POINTERDOWN,e,t)},t.prototype.move=function(e,t){this.fireEvent(se.POINTERMOVE,e,t)},t.prototype.up=function(e,t){this.fireEvent(se.POINTERUP,e,t)},t.prototype.enter=function(e,t){e.bubbles=!1,this.fireEvent(se.POINTERENTER,e,t)},t.prototype.leave=function(e,t){e.bubbles=!1,this.fireEvent(se.POINTERLEAVE,e,t)},t.prototype.over=function(e,t){e.bubbles=!0,this.fireEvent(se.POINTEROVER,e,t)},t.prototype.out=function(e,t){e.bubbles=!0,this.fireEvent(se.POINTEROUT,e,t)},t.prototype.cancel=function(e,t){this.fireEvent(se.POINTERCANCEL,e,t)},t.prototype.leaveOut=function(e,t){this.out(e,t),this.contains_(e.target,e.relatedTarget)||this.leave(e,t)},t.prototype.enterOver=function(e,t){this.over(e,t),this.contains_(e.target,e.relatedTarget)||this.enter(e,t)},t.prototype.contains_=function(e,t){return!(!e||!t)&&e.contains(t)},t.prototype.makeEvent=function(e,t,i){return new Be(e,i,t)},t.prototype.fireEvent=function(e,t,i){var n=this.makeEvent(e,t,i);this.dispatchEvent(n)},t.prototype.fireNativeEvent=function(e){var t=this.makeEvent(e.type,e,e);this.dispatchEvent(t)},t.prototype.wrapMouseEvent=function(e,t){return this.makeEvent(e,Se(t,this),t)},t.prototype.disposeInternal=function(){this.unregister_(),e.prototype.disposeInternal.call(this)},t}(x),$e=function(e){function t(t,i){e.call(this),this.map_=t,this.clickTimeoutId_,this.dragging_=!1,this.dragListenerKeys_=[],this.moveTolerance_=i?i*ee:ee,this.down_=null;var n=this.map_.getViewport();this.activePointers_=0,this.trackedTouches_={},this.pointerEventHandler_=new Je(n),this.documentPointerEventHandler_=null,this.pointerdownListenerKey_=S(this.pointerEventHandler_,se.POINTERDOWN,this.handlePointerDown_,this),this.relayedListenerKey_=S(this.pointerEventHandler_,se.POINTERMOVE,this.relayEvent_,this)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.emulateClick_=function(e){var t=new ae(oe.CLICK,this.map_,e);this.dispatchEvent(t),void 0!==this.clickTimeoutId_?(clearTimeout(this.clickTimeoutId_),this.clickTimeoutId_=void 0,t=new ae(oe.DBLCLICK,this.map_,e),this.dispatchEvent(t)):this.clickTimeoutId_=setTimeout(function(){this.clickTimeoutId_=void 0;var t=new ae(oe.SINGLECLICK,this.map_,e);this.dispatchEvent(t)}.bind(this),250)},t.prototype.updateActivePointers_=function(e){var t=e;t.type==oe.POINTERUP||t.type==oe.POINTERCANCEL?delete this.trackedTouches_[t.pointerId]:t.type==oe.POINTERDOWN&&(this.trackedTouches_[t.pointerId]=!0),this.activePointers_=Object.keys(this.trackedTouches_).length},t.prototype.handlePointerUp_=function(e){this.updateActivePointers_(e);var t=new ae(oe.POINTERUP,this.map_,e);this.dispatchEvent(t),t.propagationStopped||this.dragging_||!this.isMouseActionButton_(e)||this.emulateClick_(this.down_),0===this.activePointers_&&(this.dragListenerKeys_.forEach(_),this.dragListenerKeys_.length=0,this.dragging_=!1,this.down_=null,this.documentPointerEventHandler_.dispose(),this.documentPointerEventHandler_=null)},t.prototype.isMouseActionButton_=function(e){return 0===e.button},t.prototype.handlePointerDown_=function(e){this.updateActivePointers_(e);var t=new ae(oe.POINTERDOWN,this.map_,e);this.dispatchEvent(t),this.down_=e,0===this.dragListenerKeys_.length&&(this.documentPointerEventHandler_=new Je(document),this.dragListenerKeys_.push(S(this.documentPointerEventHandler_,oe.POINTERMOVE,this.handlePointerMove_,this),S(this.documentPointerEventHandler_,oe.POINTERUP,this.handlePointerUp_,this),S(this.pointerEventHandler_,oe.POINTERCANCEL,this.handlePointerUp_,this)))},t.prototype.handlePointerMove_=function(e){if(this.isMoving_(e)){this.dragging_=!0;var t=new ae(oe.POINTERDRAG,this.map_,e,this.dragging_);this.dispatchEvent(t)}e.preventDefault()},t.prototype.relayEvent_=function(e){var t=!(!this.down_||!this.isMoving_(e));this.dispatchEvent(new ae(e.type,this.map_,e,t))},t.prototype.isMoving_=function(e){return this.dragging_||Math.abs(e.clientX-this.down_.clientX)>this.moveTolerance_||Math.abs(e.clientY-this.down_.clientY)>this.moveTolerance_},t.prototype.disposeInternal=function(){this.relayedListenerKey_&&(_(this.relayedListenerKey_),this.relayedListenerKey_=null),this.pointerdownListenerKey_&&(_(this.pointerdownListenerKey_),this.pointerdownListenerKey_=null),this.dragListenerKeys_.forEach(_),this.dragListenerKeys_.length=0,this.documentPointerEventHandler_&&(this.documentPointerEventHandler_.dispose(),this.documentPointerEventHandler_=null),this.pointerEventHandler_&&(this.pointerEventHandler_.dispose(),this.pointerEventHandler_=null),e.prototype.disposeInternal.call(this)},t}(x),et={POSTRENDER:"postrender",MOVESTART:"movestart",MOVEEND:"moveend"},tt={LAYERGROUP:"layergroup",SIZE:"size",TARGET:"target",VIEW:"view"},it="postcompose",nt="precompose",rt="render",ot="rendercomplete",at={IDLE:0,LOADING:1,LOADED:2,ERROR:3,EMPTY:4,ABORT:5};function st(e,t){if(!e)throw new a(t)}var ct=function(e,t){this.priorityFunction_=e,this.keyFunction_=t,this.elements_=[],this.priorities_=[],this.queuedElements_={}};ct.prototype.clear=function(){this.elements_.length=0,this.priorities_.length=0,u(this.queuedElements_)},ct.prototype.dequeue=function(){var e=this.elements_,t=this.priorities_,i=e[0];1==e.length?(e.length=0,t.length=0):(e[0]=e.pop(),t[0]=t.pop(),this.siftUp_(0));var n=this.keyFunction_(i);return delete this.queuedElements_[n],i},ct.prototype.enqueue=function(e){st(!(this.keyFunction_(e)in this.queuedElements_),31);var t=this.priorityFunction_(e);return t!=1/0&&(this.elements_.push(e),this.priorities_.push(t),this.queuedElements_[this.keyFunction_(e)]=!0,this.siftDown_(0,this.elements_.length-1),!0)},ct.prototype.getCount=function(){return this.elements_.length},ct.prototype.getLeftChildIndex_=function(e){return 2*e+1},ct.prototype.getRightChildIndex_=function(e){return 2*e+2},ct.prototype.getParentIndex_=function(e){return e-1>>1},ct.prototype.heapify_=function(){var e;for(e=(this.elements_.length>>1)-1;e>=0;e--)this.siftUp_(e)},ct.prototype.isEmpty=function(){return 0===this.elements_.length},ct.prototype.isKeyQueued=function(e){return e in this.queuedElements_},ct.prototype.isQueued=function(e){return this.isKeyQueued(this.keyFunction_(e))},ct.prototype.siftUp_=function(e){for(var t=this.elements_,i=this.priorities_,n=t.length,r=t[e],o=i[e],a=e;e<n>>1;){var s=this.getLeftChildIndex_(e),c=this.getRightChildIndex_(e),l=c<n&&i[c]<i[s]?c:s;t[e]=t[l],i[e]=i[l],e=l}t[e]=r,i[e]=o,this.siftDown_(a,e)},ct.prototype.siftDown_=function(e,t){for(var i=this.elements_,n=this.priorities_,r=i[t],o=n[t];t>e;){var a=this.getParentIndex_(t);if(!(n[a]>o))break;i[t]=i[a],n[t]=n[a],t=a}i[t]=r,n[t]=o},ct.prototype.reprioritize=function(){var e,t,i,n=this.priorityFunction_,r=this.elements_,o=this.priorities_,a=0,s=r.length;for(t=0;t<s;++t)(i=n(e=r[t]))==1/0?delete this.queuedElements_[this.keyFunction_(e)]:(o[a]=i,r[a++]=e);r.length=a,o.length=a,this.heapify_()};var lt=function(e){function t(t,i){e.call(this,(function(e){return t.apply(null,e)}),(function(e){return e[0].getKey()})),this.tileChangeCallback_=i,this.tilesLoading_=0,this.tilesLoadingKeys_={}}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.enqueue=function(t){var i=e.prototype.enqueue.call(this,t);return i&&S(t[0],E.CHANGE,this.handleTileChange,this),i},t.prototype.getTilesLoading=function(){return this.tilesLoading_},t.prototype.handleTileChange=function(e){var t=e.target,i=t.getState();if(i===at.LOADED||i===at.ERROR||i===at.EMPTY||i===at.ABORT){v(t,E.CHANGE,this.handleTileChange,this);var n=t.getKey();n in this.tilesLoadingKeys_&&(delete this.tilesLoadingKeys_[n],--this.tilesLoading_),this.tileChangeCallback_()}},t.prototype.loadMoreTiles=function(e,t){for(var i,n,r,o=0,a=!1;this.tilesLoading_<e&&o<t&&this.getCount()>0;)r=(n=this.dequeue()[0]).getKey(),(i=n.getState())===at.ABORT?a=!0:i!==at.IDLE||r in this.tilesLoadingKeys_||(this.tilesLoadingKeys_[r]=!0,++this.tilesLoading_,++o,n.load());0===o&&a&&this.tileChangeCallback_()},t}(ct),ut=42,ht=256;function dt(e,t,i){return Math.min(Math.max(e,t),i)}var pt="cosh"in Math?Math.cosh:function(e){var t=Math.exp(e);return(t+1/t)/2};function mt(e,t,i,n,r,o){var a=r-i,s=o-n;if(0!==a||0!==s){var c=((e-i)*a+(t-n)*s)/(a*a+s*s);c>1?(i=r,n=o):c>0&&(i+=a*c,n+=s*c)}return ft(e,t,i,n)}function ft(e,t,i,n){var r=i-e,o=n-t;return r*r+o*o}function gt(e){return e*Math.PI/180}function St(e,t){var i=e%t;return i*t<0?i+t:i}function yt(e,t,i){return e+i*(t-e)}function vt(e){return e}function _t(e,t){return void 0!==e?0:void 0}function Ct(e,t){return void 0!==e?e+t:void 0}var Tt=0,Dt=1,At="center",It="resolution",Pt="rotation";function Rt(e,t){return e[0]+=t[0],e[1]+=t[1],e}function xt(e,t){var i,n,r=e[0],o=e[1],a=t[0],s=t[1],c=a[0],l=a[1],u=s[0],h=s[1],d=u-c,p=h-l,m=0===d&&0===p?0:(d*(r-c)+p*(o-l))/(d*d+p*p||0);return m<=0?(i=c,n=l):m>=1?(i=u,n=h):(i=c+m*d,n=l+m*p),[i,n]}function Et(e,t){for(var i=!0,n=e.length-1;n>=0;--n)if(e[n]!=t[n]){i=!1;break}return i}function bt(e,t){var i=Math.cos(t),n=Math.sin(t),r=e[0]*i-e[1]*n,o=e[1]*i+e[0]*n;return e[0]=r,e[1]=o,e}function Ot(e,t){return e[0]*=t,e[1]*=t,e}function qt(e,t){var i=e[0]-t[0],n=e[1]-t[1];return i*i+n*n}function Ft(e,t){return Math.sqrt(qt(e,t))}function Mt(e,t){return qt(e,xt(e,t))}function Lt(e){return Math.pow(e,3)}function wt(e){return 1-Lt(1-e)}function Nt(e){return 3*e*e-2*e*e*e}function Bt(e){return e}var Vt={BOTTOM_LEFT:"bottom-left",BOTTOM_RIGHT:"bottom-right",TOP_LEFT:"top-left",TOP_RIGHT:"top-right"},kt={UNKNOWN:0,INTERSECTING:1,ABOVE:2,RIGHT:4,BELOW:8,LEFT:16};function Gt(e){for(var t=[1/0,1/0,-1/0,-1/0],i=0,n=e.length;i<n;++i)ii(t,e[i]);return t}function Ut(e,t,i){return i?(i[0]=e[0]-t,i[1]=e[1]-t,i[2]=e[2]+t,i[3]=e[3]+t,i):[e[0]-t,e[1]-t,e[2]+t,e[3]+t]}function Wt(e,t){return t?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t):e.slice()}function zt(e,t,i){var n,r;return(n=t<e[0]?e[0]-t:e[2]<t?t-e[2]:0)*n+(r=i<e[1]?e[1]-i:e[3]<i?i-e[3]:0)*r}function Ht(e,t){return Xt(e,t[0],t[1])}function jt(e,t){return e[0]<=t[0]&&t[2]<=e[2]&&e[1]<=t[1]&&t[3]<=e[3]}function Xt(e,t,i){return e[0]<=t&&t<=e[2]&&e[1]<=i&&i<=e[3]}function Yt(e,t){var i=e[0],n=e[1],r=e[2],o=e[3],a=t[0],s=t[1],c=kt.UNKNOWN;return a<i?c|=kt.LEFT:a>r&&(c|=kt.RIGHT),s<n?c|=kt.BELOW:s>o&&(c|=kt.ABOVE),c===kt.UNKNOWN&&(c=kt.INTERSECTING),c}function Kt(e,t,i,n,r){return r?(r[0]=e,r[1]=t,r[2]=i,r[3]=n,r):[e,t,i,n]}function Zt(e){return Kt(1/0,1/0,-1/0,-1/0,e)}function Qt(e,t){var i=e[0],n=e[1];return Kt(i,n,i,n,t)}function Jt(e,t){return function(e,t){for(var i=0,n=t.length;i<n;++i)ii(e,t[i]);return e}(Zt(t),e)}function $t(e,t,i,n,r){return ni(Zt(r),e,t,i,n)}function ei(e,t){return e[0]==t[0]&&e[2]==t[2]&&e[1]==t[1]&&e[3]==t[3]}function ti(e,t){return t[0]<e[0]&&(e[0]=t[0]),t[2]>e[2]&&(e[2]=t[2]),t[1]<e[1]&&(e[1]=t[1]),t[3]>e[3]&&(e[3]=t[3]),e}function ii(e,t){t[0]<e[0]&&(e[0]=t[0]),t[0]>e[2]&&(e[2]=t[0]),t[1]<e[1]&&(e[1]=t[1]),t[1]>e[3]&&(e[3]=t[1])}function ni(e,t,i,n,r){for(;i<n;i+=r)ri(e,t[i],t[i+1]);return e}function ri(e,t,i){e[0]=Math.min(e[0],t),e[1]=Math.min(e[1],i),e[2]=Math.max(e[2],t),e[3]=Math.max(e[3],i)}function oi(e,t,i){var n;return(n=t.call(i,si(e)))?n:(n=t.call(i,ci(e)))?n:(n=t.call(i,fi(e)))?n:(n=t.call(i,mi(e)))||!1}function ai(e){var t=0;return yi(e)||(t=gi(e)*di(e)),t}function si(e){return[e[0],e[1]]}function ci(e){return[e[2],e[1]]}function li(e){return[(e[0]+e[2])/2,(e[1]+e[3])/2]}function ui(e,t){var i;return t===Vt.BOTTOM_LEFT?i=si(e):t===Vt.BOTTOM_RIGHT?i=ci(e):t===Vt.TOP_LEFT?i=mi(e):t===Vt.TOP_RIGHT?i=fi(e):st(!1,13),i}function hi(e,t,i,n,r){var o=t*n[0]/2,a=t*n[1]/2,s=Math.cos(i),c=Math.sin(i),l=o*s,u=o*c,h=a*s,d=a*c,p=e[0],m=e[1],f=p-l+d,g=p-l-d,S=p+l-d,y=p+l+d,v=m-u-h,_=m-u+h,C=m+u+h,T=m+u-h;return Kt(Math.min(f,g,S,y),Math.min(v,_,C,T),Math.max(f,g,S,y),Math.max(v,_,C,T),r)}function di(e){return e[3]-e[1]}function pi(e,t,i){var n=i||[1/0,1/0,-1/0,-1/0];return Si(e,t)?(e[0]>t[0]?n[0]=e[0]:n[0]=t[0],e[1]>t[1]?n[1]=e[1]:n[1]=t[1],e[2]<t[2]?n[2]=e[2]:n[2]=t[2],e[3]<t[3]?n[3]=e[3]:n[3]=t[3]):Zt(n),n}function mi(e){return[e[0],e[3]]}function fi(e){return[e[2],e[3]]}function gi(e){return e[2]-e[0]}function Si(e,t){return e[0]<=t[2]&&e[2]>=t[0]&&e[1]<=t[3]&&e[3]>=t[1]}function yi(e){return e[2]<e[0]||e[3]<e[1]}function vi(e,t){var i=(e[2]-e[0])/2*(t-1),n=(e[3]-e[1])/2*(t-1);e[0]-=i,e[2]+=i,e[1]-=n,e[3]+=n}var _i={POINT:"Point",LINE_STRING:"LineString",LINEAR_RING:"LinearRing",POLYGON:"Polygon",MULTI_POINT:"MultiPoint",MULTI_LINE_STRING:"MultiLineString",MULTI_POLYGON:"MultiPolygon",GEOMETRY_COLLECTION:"GeometryCollection",CIRCLE:"Circle"},Ci={XY:"XY",XYZ:"XYZ",XYM:"XYM",XYZM:"XYZM"};function Ti(e,t,i,n,r,o){for(var a=o||[],s=0,c=t;c<i;c+=n){var l=e[c],u=e[c+1];a[s++]=r[0]*l+r[2]*u+r[4],a[s++]=r[1]*l+r[3]*u+r[5]}return o&&a.length!=s&&(a.length=s),a}function Di(e,t,i,n,r,o,a){for(var s=a||[],c=0,l=t;l<i;l+=n){s[c++]=e[l]+r,s[c++]=e[l+1]+o;for(var u=l+2;u<l+n;++u)s[c++]=e[u]}return a&&s.length!=c&&(s.length=c),s}var Ai=6371008.8;function Ii(e,t,i){var n=i||Ai,r=gt(e[1]),o=gt(t[1]),a=(o-r)/2,s=gt(t[0]-e[0])/2,c=Math.sin(a)*Math.sin(a)+Math.sin(s)*Math.sin(s)*Math.cos(r)*Math.cos(o);return 2*n*Math.atan2(Math.sqrt(c),Math.sqrt(1-c))}var Pi={DEGREES:"degrees",FEET:"ft",METERS:"m",PIXELS:"pixels",TILE_PIXELS:"tile-pixels",USFEET:"us-ft"},Ri={};Ri[Pi.DEGREES]=2*Math.PI*6370997/360,Ri[Pi.FEET]=.3048,Ri[Pi.METERS]=1,Ri[Pi.USFEET]=1200/3937;var xi=function(e){this.code_=e.code,this.units_=e.units,this.extent_=void 0!==e.extent?e.extent:null,this.worldExtent_=void 0!==e.worldExtent?e.worldExtent:null,this.axisOrientation_=void 0!==e.axisOrientation?e.axisOrientation:"enu",this.global_=void 0!==e.global&&e.global,this.canWrapX_=!(!this.global_||!this.extent_),this.getPointResolutionFunc_=e.getPointResolution,this.defaultTileGrid_=null,this.metersPerUnit_=e.metersPerUnit};xi.prototype.canWrapX=function(){return this.canWrapX_},xi.prototype.getCode=function(){return this.code_},xi.prototype.getExtent=function(){return this.extent_},xi.prototype.getUnits=function(){return this.units_},xi.prototype.getMetersPerUnit=function(){return this.metersPerUnit_||Ri[this.units_]},xi.prototype.getWorldExtent=function(){return this.worldExtent_},xi.prototype.getAxisOrientation=function(){return this.axisOrientation_},xi.prototype.isGlobal=function(){return this.global_},xi.prototype.setGlobal=function(e){this.global_=e,this.canWrapX_=!(!e||!this.extent_)},xi.prototype.getDefaultTileGrid=function(){return this.defaultTileGrid_},xi.prototype.setDefaultTileGrid=function(e){this.defaultTileGrid_=e},xi.prototype.setExtent=function(e){this.extent_=e,this.canWrapX_=!(!this.global_||!e)},xi.prototype.setWorldExtent=function(e){this.worldExtent_=e},xi.prototype.setGetPointResolution=function(e){this.getPointResolutionFunc_=e},xi.prototype.getPointResolutionFunc=function(){return this.getPointResolutionFunc_};var Ei=6378137,bi=Math.PI*Ei,Oi=[-bi,-bi,bi,bi],qi=[-180,-85,180,85],Fi=function(e){function t(t){e.call(this,{code:t,units:Pi.METERS,extent:Oi,global:!0,worldExtent:qi,getPointResolution:function(e,t){return e/pt(t[1]/Ei)}})}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t}(xi),Mi=[new Fi("EPSG:3857"),new Fi("EPSG:102100"),new Fi("EPSG:102113"),new Fi("EPSG:900913"),new Fi("urn:ogc:def:crs:EPSG:6.18:3:3857"),new Fi("urn:ogc:def:crs:EPSG::3857"),new Fi("http://www.opengis.net/gml/srs/epsg.xml#3857")];function Li(e,t,i){var n=e.length,r=i>1?i:2,o=t;void 0===o&&(o=r>2?e.slice():new Array(n));for(var a=bi,s=0;s<n;s+=r){o[s]=a*e[s]/180;var c=Ei*Math.log(Math.tan(Math.PI*(e[s+1]+90)/360));c>a?c=a:c<-a&&(c=-a),o[s+1]=c}return o}function wi(e,t,i){var n=e.length,r=i>1?i:2,o=t;void 0===o&&(o=r>2?e.slice():new Array(n));for(var a=0;a<n;a+=r)o[a]=180*e[a]/bi,o[a+1]=360*Math.atan(Math.exp(e[a+1]/Ei))/Math.PI-90;return o}var Ni,Bi,Vi,ki=[-180,-90,180,90],Gi=6378137*Math.PI/180,Ui=function(e){function t(t,i){e.call(this,{code:t,units:Pi.DEGREES,extent:ki,axisOrientation:i,global:!0,metersPerUnit:Gi,worldExtent:ki})}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t}(xi),Wi=[new Ui("CRS:84"),new Ui("EPSG:4326","neu"),new Ui("urn:ogc:def:crs:EPSG::4326","neu"),new Ui("urn:ogc:def:crs:EPSG:6.6:4326","neu"),new Ui("urn:ogc:def:crs:OGC:1.3:CRS84"),new Ui("urn:ogc:def:crs:OGC:2:84"),new Ui("http://www.opengis.net/gml/srs/epsg.xml#4326","neu"),new Ui("urn:x-ogc:def:crs:EPSG:4326","neu")],zi={},Hi={};function ji(e,t,i){var n=e.getCode(),r=t.getCode();n in Hi||(Hi[n]={}),Hi[n][r]=i}function Xi(e,t,i){var n;if(void 0!==t){for(var r=0,o=e.length;r<o;++r)t[r]=e[r];n=t}else n=e.slice();return n}function Yi(e,t,i){if(void 0!==t&&e!==t){for(var n=0,r=e.length;n<r;++n)t[n]=e[n];e=t}return e}function Ki(e){!function(e,t){zi[e]=t}(e.getCode(),e),ji(e,e,Xi)}function Zi(e){return"string"==typeof e?zi[e]||null:e||null}function Qi(e,t,i,n){var r,o=(e=Zi(e)).getPointResolutionFunc();if(o)r=o(t,i);else if(e.getUnits()==Pi.DEGREES&&!n||n==Pi.DEGREES)r=t;else{var a=tn(e,Zi("EPSG:4326")),s=[i[0]-t/2,i[1],i[0]+t/2,i[1],i[0],i[1]-t/2,i[0],i[1]+t/2];r=(Ii((s=a(s,s,2)).slice(0,2),s.slice(2,4))+Ii(s.slice(4,6),s.slice(6,8)))/2;var c=n?Ri[n]:e.getMetersPerUnit();void 0!==c&&(r/=c)}return r}function Ji(e){!function(e){e.forEach(Ki)}(e),e.forEach((function(t){e.forEach((function(e){t!==e&&ji(t,e,Xi)}))}))}function $i(e,t){return e?"string"==typeof e?Zi(e):e:Zi(t)}function en(e,t){if(e===t)return!0;var i=e.getUnits()===t.getUnits();return e.getCode()===t.getCode()?i:tn(e,t)===Xi&&i}function tn(e,t){var i=function(e,t){var i;return e in Hi&&t in Hi[e]&&(i=Hi[e][t]),i}(e.getCode(),t.getCode());return i||(i=Yi),i}function nn(e,t){return tn(Zi(e),Zi(t))}Ji(Mi),Ji(Wi),Ni=Mi,Bi=Li,Vi=wi,Wi.forEach((function(e){Ni.forEach((function(t){ji(e,t,Bi),ji(t,e,Vi)}))}));var rn=new Array(6);function on(e){return sn(e,1,0,0,1,0,0)}function an(e,t){var i=e[0],n=e[1],r=e[2],o=e[3],a=e[4],s=e[5],c=t[0],l=t[1],u=t[2],h=t[3],d=t[4],p=t[5];return e[0]=i*c+r*l,e[1]=n*c+o*l,e[2]=i*u+r*h,e[3]=n*u+o*h,e[4]=i*d+r*p+a,e[5]=n*d+o*p+s,e}function sn(e,t,i,n,r,o,a){return e[0]=t,e[1]=i,e[2]=n,e[3]=r,e[4]=o,e[5]=a,e}function cn(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}function ln(e,t){var i=t[0],n=t[1];return t[0]=e[0]*i+e[2]*n+e[4],t[1]=e[1]*i+e[3]*n+e[5],t}function un(e,t){var i=Math.cos(t),n=Math.sin(t);return an(e,sn(rn,i,n,-n,i,0,0))}function hn(e,t,i){return an(e,sn(rn,t,0,0,i,0,0))}function dn(e,t,i){return an(e,sn(rn,1,0,0,1,t,i))}function pn(e,t,i,n,r,o,a,s){var c=Math.sin(o),l=Math.cos(o);return e[0]=n*l,e[1]=r*c,e[2]=-n*c,e[3]=r*l,e[4]=a*n*l-s*n*c+t,e[5]=a*r*c+s*r*l+i,e}function mn(e){var t,i=(t=e)[0]*t[3]-t[1]*t[2];st(0!==i,32);var n=e[0],r=e[1],o=e[2],a=e[3],s=e[4],c=e[5];return e[0]=a/i,e[1]=-r/i,e[2]=-o/i,e[3]=n/i,e[4]=(o*c-a*s)/i,e[5]=-(n*c-r*s)/i,e}var fn=[1,0,0,1,0,0],gn=function(e){function t(){e.call(this),this.layout=Ci.XY,this.stride=2,this.flatCoordinates=null}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.computeExtent=function(e){return $t(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e)},t.prototype.getCoordinates=function(){return i()},t.prototype.getFirstCoordinate=function(){return this.flatCoordinates.slice(0,this.stride)},t.prototype.getFlatCoordinates=function(){return this.flatCoordinates},t.prototype.getLastCoordinate=function(){return this.flatCoordinates.slice(this.flatCoordinates.length-this.stride)},t.prototype.getLayout=function(){return this.layout},t.prototype.getSimplifiedGeometry=function(e){if(this.simplifiedGeometryRevision!=this.getRevision()&&(u(this.simplifiedGeometryCache),this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=this.getRevision()),e<0||0!==this.simplifiedGeometryMaxMinSquaredTolerance&&e<=this.simplifiedGeometryMaxMinSquaredTolerance)return this;var t=e.toString();if(this.simplifiedGeometryCache.hasOwnProperty(t))return this.simplifiedGeometryCache[t];var i=this.getSimplifiedGeometryInternal(e);return i.getFlatCoordinates().length<this.flatCoordinates.length?(this.simplifiedGeometryCache[t]=i,i):(this.simplifiedGeometryMaxMinSquaredTolerance=e,this)},t.prototype.getSimplifiedGeometryInternal=function(e){return this},t.prototype.getStride=function(){return this.stride},t.prototype.setFlatCoordinates=function(e,t){this.stride=Sn(e),this.layout=e,this.flatCoordinates=t},t.prototype.setCoordinates=function(e,t){i()},t.prototype.setLayout=function(e,t,i){var n;if(e)n=Sn(e);else{for(var r=0;r<i;++r){if(0===t.length)return this.layout=Ci.XY,void(this.stride=2);t=t[0]}e=function(e){var t;return 2==e?t=Ci.XY:3==e?t=Ci.XYZ:4==e&&(t=Ci.XYZM),t}(n=t.length)}this.layout=e,this.stride=n},t.prototype.applyTransform=function(e){this.flatCoordinates&&(e(this.flatCoordinates,this.flatCoordinates,this.stride),this.changed())},t.prototype.rotate=function(e,t){var i=this.getFlatCoordinates();if(i){var n=this.getStride();!function(e,t,i,n,r,o,a){for(var s=a||[],c=Math.cos(r),l=Math.sin(r),u=o[0],h=o[1],d=0,p=t;p<i;p+=n){var m=e[p]-u,f=e[p+1]-h;s[d++]=u+m*c-f*l,s[d++]=h+m*l+f*c;for(var g=p+2;g<p+n;++g)s[d++]=e[g]}a&&s.length!=d&&(s.length=d)}(i,0,i.length,n,e,t,i),this.changed()}},t.prototype.scale=function(e,t,i){var n=t;void 0===n&&(n=e);var r=i;r||(r=li(this.getExtent()));var o=this.getFlatCoordinates();if(o){var a=this.getStride();!function(e,t,i,n,r,o,a,s){for(var c=s||[],l=a[0],u=a[1],h=0,d=t;d<i;d+=n){var p=e[d]-l,m=e[d+1]-u;c[h++]=l+r*p,c[h++]=u+o*m;for(var f=d+2;f<d+n;++f)c[h++]=e[f]}s&&c.length!=h&&(c.length=h)}(o,0,o.length,a,e,n,r,o),this.changed()}},t.prototype.translate=function(e,t){var i=this.getFlatCoordinates();if(i){var n=this.getStride();Di(i,0,i.length,n,e,t,i),this.changed()}},t}(function(e){function t(){e.call(this),this.extent_=[1/0,1/0,-1/0,-1/0],this.extentRevision_=-1,this.simplifiedGeometryCache={},this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=0}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.clone=function(){return i()},t.prototype.closestPointXY=function(e,t,n,r){return i()},t.prototype.containsXY=function(e,t){return!1},t.prototype.getClosestPoint=function(e,t){var i=t||[NaN,NaN];return this.closestPointXY(e[0],e[1],i,1/0),i},t.prototype.intersectsCoordinate=function(e){return this.containsXY(e[0],e[1])},t.prototype.computeExtent=function(e){return i()},t.prototype.getExtent=function(e){return this.extentRevision_!=this.getRevision()&&(this.extent_=this.computeExtent(this.extent_),this.extentRevision_=this.getRevision()),function(e,t){return t?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t):e}(this.extent_,e)},t.prototype.rotate=function(e,t){i()},t.prototype.scale=function(e,t,n){i()},t.prototype.simplify=function(e){return this.getSimplifiedGeometry(e*e)},t.prototype.getSimplifiedGeometry=function(e){return i()},t.prototype.getType=function(){return i()},t.prototype.applyTransform=function(e){i()},t.prototype.intersectsExtent=function(e){return i()},t.prototype.translate=function(e,t){i()},t.prototype.transform=function(e,t){var i=Zi(e),n=i.getUnits()==Pi.TILE_PIXELS?function(e,n,r){var o=i.getExtent(),a=i.getWorldExtent(),s=di(a)/di(o);return pn(fn,a[0],a[3],s,-s,0,0,0),Ti(e,0,e.length,r,fn,n),nn(i,t)(e,n,r)}:nn(i,t);return this.applyTransform(n),this},t}(q));function Sn(e){var t;return e==Ci.XY?t=2:e==Ci.XYZ||e==Ci.XYM?t=3:e==Ci.XYZM&&(t=4),t}function yn(e,t,i,n){for(var r=0,o=e[i-n],a=e[i-n+1];t<i;t+=n){var s=e[t],c=e[t+1];r+=a*s-o*c,o=s,a=c}return r/2}function vn(e,t,i,n){for(var r=0,o=0,a=i.length;o<a;++o){var s=i[o];r+=yn(e,t,s,n),t=s}return r}function _n(e,t,i,n,r,o,a){var s,c=e[t],l=e[t+1],u=e[i]-c,h=e[i+1]-l;if(0===u&&0===h)s=t;else{var d=((r-c)*u+(o-l)*h)/(u*u+h*h);if(d>1)s=i;else{if(d>0){for(var p=0;p<n;++p)a[p]=yt(e[t+p],e[i+p],d);return void(a.length=n)}s=t}}for(var m=0;m<n;++m)a[m]=e[s+m];a.length=n}function Cn(e,t,i,n,r){var o=e[t],a=e[t+1];for(t+=n;t<i;t+=n){var s=e[t],c=e[t+1],l=ft(o,a,s,c);l>r&&(r=l),o=s,a=c}return r}function Tn(e,t,i,n,r){for(var o=0,a=i.length;o<a;++o){var s=i[o];r=Cn(e,t,s,n,r),t=s}return r}function Dn(e,t,i,n,r,o,a,s,c,l,u){if(t==i)return l;var h,d;if(0===r){if((d=ft(a,s,e[t],e[t+1]))<l){for(h=0;h<n;++h)c[h]=e[t+h];return c.length=n,d}return l}for(var p=u||[NaN,NaN],m=t+n;m<i;)if(_n(e,m-n,m,n,a,s,p),(d=ft(a,s,p[0],p[1]))<l){for(l=d,h=0;h<n;++h)c[h]=p[h];c.length=n,m+=n}else m+=n*Math.max((Math.sqrt(d)-Math.sqrt(l))/r|0,1);if(o&&(_n(e,i-n,t,n,a,s,p),(d=ft(a,s,p[0],p[1]))<l)){for(l=d,h=0;h<n;++h)c[h]=p[h];c.length=n}return l}function An(e,t,i,n,r,o,a,s,c,l,u){for(var h=u||[NaN,NaN],d=0,p=i.length;d<p;++d){var m=i[d];l=Dn(e,t,m,n,r,o,a,s,c,l,h),t=m}return l}function In(e,t,i,n){for(var r=0,o=i.length;r<o;++r)e[t++]=i[r];return t}function Pn(e,t,i,n){for(var r=0,o=i.length;r<o;++r)for(var a=i[r],s=0;s<n;++s)e[t++]=a[s];return t}function Rn(e,t,i,n,r){for(var o=r||[],a=0,s=0,c=i.length;s<c;++s){var l=Pn(e,t,i[s],n);o[a++]=l,t=l}return o.length=a,o}function xn(e,t,i,n,r){for(var o=void 0!==r?r:[],a=0,s=t;s<i;s+=n)o[a++]=e.slice(s,s+n);return o.length=a,o}function En(e,t,i,n,r){for(var o=void 0!==r?r:[],a=0,s=0,c=i.length;s<c;++s){var l=i[s];o[a++]=xn(e,t,l,n,o[a]),t=l}return o.length=a,o}function bn(e,t,i,n,r){for(var o=void 0!==r?r:[],a=0,s=0,c=i.length;s<c;++s){var l=i[s];o[a++]=En(e,t,l,n,o[a]),t=l[l.length-1]}return o.length=a,o}function On(e,t,i,n,r,o,a){var s=(i-t)/n;if(s<3){for(;t<i;t+=n)o[a++]=e[t],o[a++]=e[t+1];return a}var c=new Array(s);c[0]=1,c[s-1]=1;for(var l=[t,i-n],u=0;l.length>0;){for(var h=l.pop(),d=l.pop(),p=0,m=e[d],f=e[d+1],g=e[h],S=e[h+1],y=d+n;y<h;y+=n){var v=mt(e[y],e[y+1],m,f,g,S);v>p&&(u=y,p=v)}p>r&&(c[(u-t)/n]=1,d+n<u&&l.push(d,u),u+n<h&&l.push(u,h))}for(var _=0;_<s;++_)c[_]&&(o[a++]=e[t+_*n],o[a++]=e[t+_*n+1]);return a}function qn(e,t){return t*Math.round(e/t)}function Fn(e,t,i,n,r,o,a){if(t==i)return a;var s,c,l=qn(e[t],r),u=qn(e[t+1],r);t+=n,o[a++]=l,o[a++]=u;do{if(s=qn(e[t],r),c=qn(e[t+1],r),(t+=n)==i)return o[a++]=s,o[a++]=c,a}while(s==l&&c==u);for(;t<i;){var h=qn(e[t],r),d=qn(e[t+1],r);if(t+=n,h!=s||d!=c){var p=s-l,m=c-u,f=h-l,g=d-u;p*g==m*f&&(p<0&&f<p||p==f||p>0&&f>p)&&(m<0&&g<m||m==g||m>0&&g>m)?(s=h,c=d):(o[a++]=s,o[a++]=c,l=s,u=c,s=h,c=d)}}return o[a++]=s,o[a++]=c,a}function Mn(e,t,i,n,r,o,a,s){for(var c=0,l=i.length;c<l;++c){var u=i[c];a=Fn(e,t,u,n,r,o,a),s.push(a),t=u}return a}var Ln=function(e){function t(t,i){e.call(this),this.maxDelta_=-1,this.maxDeltaRevision_=-1,void 0===i||Array.isArray(t[0])?this.setCoordinates(t,i):this.setFlatCoordinates(i,t)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.clone=function(){return new t(this.flatCoordinates.slice(),this.layout)},t.prototype.closestPointXY=function(e,t,i,n){return n<zt(this.getExtent(),e,t)?n:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Cn(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Dn(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!0,e,t,i,n))},t.prototype.getArea=function(){return yn(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},t.prototype.getCoordinates=function(){return xn(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},t.prototype.getSimplifiedGeometryInternal=function(e){var i=[];return i.length=On(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e,i,0),new t(i,Ci.XY)},t.prototype.getType=function(){return _i.LINEAR_RING},t.prototype.intersectsExtent=function(e){return!1},t.prototype.setCoordinates=function(e,t){this.setLayout(t,e,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=Pn(this.flat