"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[6398],{57487:function(e,t,n){var r=n(21510),o=n(12739),i=n(10392),a=n(81248),u=n(75469),l=n(51291),c=n(41372),s=n(95783),f=n(36104),p=n(86923),h=n(92932),y=n(69039),v=n(85528),d=n(12810);function x(e){return(x="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _(){return(_="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=g(e,t);if(r){var o=Object.getOwnPropertyDescriptor(r,t);return o.get?o.get.call(arguments.length<3?e:n):o.value}}).apply(this,arguments)}function g(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=F(e)););return e}function w(e,t){for(var n=0;nf?i[1]:i[0]),a}}return null}},{key:"handlePointerMove_",value:function(e){var t=e.pixel,n=e.map,r=this.snapToVertex_(t,n);r||(r=n.getCoordinateFromPixelInternal(t)),this.createOrUpdatePointerFeature_(r)}},{key:"createOrUpdateExtentFeature_",value:function(e){var t=this.extentFeature_;return t?e?t.setGeometry((0,v.oJ)(e)):t.setGeometry(void 0):(t=e?new o.Z((0,v.oJ)(e)):new o.Z({}),this.extentFeature_=t,this.extentOverlay_.getSource().addFeature(t)),t}},{key:"createOrUpdatePointerFeature_",value:function(e){var t=this.vertexFeature_;t?t.getGeometry().setCoordinates(e):(t=new o.Z(new u.Z(e)),this.vertexFeature_=t,this.vertexOverlay_.getSource().addFeature(t));return t}},{key:"handleEvent",value:function(e){return!e.originalEvent||!this.condition_(e)||(e.type!=a.Z.POINTERMOVE||this.handlingDownUpSequence||this.handlePointerMove_(e),_(F(n.prototype),"handleEvent",this).call(this,e),!1)}},{key:"handleDownEvent",value:function(e){var t=e.pixel,n=e.map,r=this.getExtentInternal(),o=this.snapToVertex_(t,n),i=function(e){var t=null,n=null;return e[0]==r[0]?t=r[2]:e[0]==r[2]&&(t=r[0]),e[1]==r[1]?n=r[3]:e[1]==r[3]&&(n=r[1]),null!==t&&null!==n?[t,n]:null};if(o&&r){var a=o[0]==r[0]||o[0]==r[2]?o[0]:null,u=o[1]==r[1]||o[1]==r[3]?o[1]:null;null!==a&&null!==u?this.pointerHandler_=S(i(o)):null!==a?this.pointerHandler_=j(i([a,r[1]]),i([a,r[3]])):null!==u&&(this.pointerHandler_=j(i([r[0],u]),i([r[2],u])))}else o=n.getCoordinateFromPixelInternal(t),this.setExtent([o[0],o[1],o[0],o[1]]),this.pointerHandler_=S(o);return!0}},{key:"handleDragEvent",value:function(e){if(this.pointerHandler_){var t=e.coordinate;this.setExtent(this.pointerHandler_(t)),this.createOrUpdatePointerFeature_(t)}}},{key:"handleUpEvent",value:function(e){this.pointerHandler_=null;var t=this.getExtentInternal();return t&&0!==(0,p.bg)(t)||this.setExtent(null),!1}},{key:"setMap",value:function(e){this.extentOverlay_.setMap(e),this.vertexOverlay_.setMap(e),_(F(n.prototype),"setMap",this).call(this,e)}},{key:"getExtent",value:function(){return(0,d.Fj)(this.getExtentInternal(),this.getMap().getView().getProjection())}},{key:"getExtentInternal",value:function(){return this.extent_}},{key:"setExtent",value:function(e){this.extent_=e||null,this.createOrUpdateExtentFeature_(e),this.dispatchEvent(new T(this.extent_))}}]),n}(l.Z),M=n(41376),R=n(79847),H=n(42010),V=n(54354),U=new M.Z({layers:[new H.Z({source:new R.Z})],target:"map",view:new V.ZP({center:[0,0],zoom:2})}),B=new C({condition:f.vY});U.addInteraction(B)}},function(e){var t=function(t){return e(e.s=t)};t(9877),t(57487)}]); //# sourceMappingURL=extent-interaction.js.map