(window.webpackJsonp=window.webpackJsonp||[]).push([["floating-toolbars"],{"0ZwQ":function(t,e,o){"use strict";function i(){return Object(p.ensureNotNull)(window.containerElement)}function n(){var t,e,o,n;return s?(t=i(),o=(e=getComputedStyle(t)).paddingLeft&&parseFloat(e.paddingLeft)||0,n=e.paddingRight&&parseFloat(e.paddingRight)||0,t.clientWidth-o-n):window.innerWidth}function r(){var t,e,o,n;return s?(t=i(),o=(e=getComputedStyle(t)).paddingTop&&parseFloat(e.paddingTop)||0,n=e.paddingBottom&&parseFloat(e.paddingBottom)||0,t.clientHeight-o-n):window.innerHeight}var s,a,l,d=o("P5fv"),c=o.n(d),p=(o("bf9a"),o("Eyy1")),u=o("j1f4"),h=o("Vdly"),g=o("aIyQ"),_=o.n(g),v=o("hY0g"),f=o.n(v),b=o("5qpw"),y=o("mrSG"),w=o("cZRT"),m=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(y.__extends)(e,t),e.prototype._startLoading=function(){return o.e("hammerjs").then(o.bind(null,"be1f")).then(function(t){return t.HammerJS})},e}(w.a),C=o("qFKp"),x=o("yB98");o("PwLo");o.d(e,"a",function(){return l}),s=C.CheckMobile.iOS(),a='
'+(Modernizr.mobiletouch?'
':"")+'
'+x+'
',l=function(){function t(e){this._widget=document.createElement("div"),this._isVertical=!1,this._hiddingTimeoutId=null,this._visibility=new f.a(!1),this._windowResizeListener=this._onWindowResize.bind(this),this._reorderedDelegate=new _.a,this._responsiveResizeFunction=null,t._toolbars.push(this),this._options=e,this._widget=c()(a).get(0),this._content=this._widget.getElementsByClassName("js-content").item(0),this._setZIndex(t._startZIndex+t._toolbars.length-1),this._options.addClass&&(this._widget.className+=" "+this._options.addClass),this._options.layout&&"auto"!==this._options.layout&&(this._isVertical="vertical"===this._options.layout,this._updateLayoutType(),this._updateAxisOption())}return t.prototype.destroy=function(){this.hide(!0),t._toolbars.splice(t._toolbars.indexOf(this),1),document.body.contains(this._widget)&&document.body.removeChild(this._widget),this._widget.innerHTML="",this._responsiveResizeFunction=null},t.prototype.setResponsiveResizeFunc=function(t){this._responsiveResizeFunction=t},t.prototype.isVisible=function(){return this._visibility.value()},t.prototype.visibility=function(){return this._visibility.readonly()},t.prototype.isVertical=function(){return this._isVertical},t.prototype.show=function(){var t=this;this.isVisible()||(document.body.contains(this._widget)||(this._init(),document.body.appendChild(this._widget)),this._setHiddingTimeout(null),window.addEventListener("resize",this._windowResizeListener),this.raise(),this._visibility.setValue(!0),this._widget.classList.contains("i-hidden")?(this._widget.classList.remove("i-hidden"),setTimeout(function(){t.isVisible()&&t._widget.classList.remove("i-closed") })):this._widget.classList.remove("i-closed"),this._onWindowResize())},t.prototype.hide=function(t){var e,o,i=this;void 0===t&&(t=!1),this.isVisible()&&(e=this._widget.classList.contains("i-closed"),this._widget.classList.add("i-closed"),this._visibility.setValue(!1),t||e?(this._setHiddingTimeout(null),this._widget.classList.add("i-hidden")):(o=setTimeout(function(){i._setHiddingTimeout(null),i._widget.classList.add("i-hidden")},this.hideDuration()),this._setHiddingTimeout(o)),window.removeEventListener("resize",this._windowResizeListener))},t.prototype.raise=function(){t._toolbars.length+t._startZIndex!==this._zIndex()&&(t._toolbars.splice(t._toolbars.indexOf(this),1),t._toolbars.push(this),t._updateAllZIndexes())},t.prototype.hideDuration=function(){return.75*u.dur},t.prototype.addWidget=function(t,e){var o,i,n;if(void 0===e&&(e={}),o=this.widgetsCount(),void 0===e.index&&(e.index=o),e.index<0||e.index>o)throw new Error("Index must be in [0, "+o+"]");(i=document.createElement("div")).className="tv-floating-toolbar__widget js-widget",i.appendChild(t),n=e.index===o?null:this._content.childNodes.item(e.index),this._content.insertBefore(i,n),this._onWindowResize()},t.prototype.removeWidget=function(t){var e=this._findWrapperForWidget(t);e&&(this._content.removeChild(e),this._onWindowResize())},t.prototype.widgetsCount=function(){return this._content.childNodes.length},t.prototype.showWidget=function(t){var e=this._findWrapperForWidget(t);e&&e.classList.remove("i-hidden")},t.prototype.hideWidget=function(t){var e=this._findWrapperForWidget(t);e&&e.classList.add("i-hidden")},t.prototype.removeWidgets=function(){for(;this._content.firstChild;)this._content.removeChild(this._content.firstChild);this._onWindowResize()},t.prototype.onWidgetsReordered=function(){return this._reorderedDelegate},t.prototype.onContextMenu=function(t){var e=this;Modernizr.mobiletouch?(new m).load().then(function(o){var i=new o(e._widget);i.get("press").set({time:500}),i.on("press",function(o){e._preventWidgetTouchEndEvent(),t(o.srcEvent)})}):this._widget.addEventListener("contextmenu",t)},t.prototype._determineCurrentLayoutVertical=function(t){var e=this._isVertical?t.height:t.width;return n()n()&&(t.left=Math.max(0,n()-e.width)),t.top+e.height>r()&&(t.top=Math.max(0,r()-e.height)),t.left=Math.max(0,t.left),t.top=Math.max(0,t.top)},t.prototype._setZIndex=function(t){this._widget.style.zIndex=String(t)},t.prototype._zIndex=function(){return Number(this._widget.style.zIndex)},t.prototype._loadPosition=function(){var t=Object(h.getJSON)(this._options.positionSettingsKey,this._options.defaultPosition);this._widget.style.left=Math.round(t.left)+"px",this._widget.style.top=Math.round(t.top)+"px",this._onWindowResize()},t.prototype._savePosition=function(){var t=this._widget.getBoundingClientRect();Object(h.setJSON)(this._options.positionSettingsKey,{left:t.left,top:t.top})},t.prototype._init=function(){this._loadPosition(),Object(b.lazyJqueryUI)(c()(this._widget)).draggable({containment:"window",drag:this._onDragEvent.bind(this),handle:".js-drag",stop:this._savePosition.bind(this)}),this._options.allowSortable&&this._initSortable(),this._widget.addEventListener(Modernizr.mobiletouch?"touchstart":"mousedown",this.raise.bind(this))},t.prototype._onDragEvent=function(t,e){this._correctPosition(e.position)},t.prototype._initSortable=function(){var t=this,e=-1;Object(b.lazyJqueryUI)(c()(this._content)).sortable({start:function(t,o){e=o.item.index()},stop:function(o,i){var n=i.item.index();e!==n&&t._reorderedDelegate.fire(e,n)},tolerance:"pointer",distance:5,containment:!!this._options.dragOnlyInsideToolbar&&"parent",scroll:!1,placeholder:"sortable-placeholder",forcePlaceholderSize:!0}),this._updateAxisOption()},t.prototype._getCorrectedWidgetRect=function(){var t,e,o,i=this._widget.getBoundingClientRect();return this._widget.classList.contains("i-closed")?(t=1/.925-1,e=i.width*t,o=i.height*t,{bottom:i.bottom+o/2,height:i.height+o,left:i.left-e/2,right:i.right+e/2,top:i.top-o/2,width:i.width+e}):i},t._updateAllZIndexes=function(){t._toolbars.forEach(function(e,o){e._setZIndex(t._startZIndex+o)})},t._startZIndex=20,t._toolbars=[],t}()},"2JFs":function(t,e){ t.exports=''},"5qpw":function(t,e,o){"use strict";function i(t){return t in $.fn?Promise.resolve():(s||(s=new Promise(function(t){Promise.all([o.e(76),o.e("lazy-jquery-ui")]).then(function(e){o("ONnG"),t()}.bind(null,o)).catch(void 0)})),s)}function n(t){return new a(t)}var r,s,a;o.r(e),o.d(e,"LazyJqueryUI",function(){return a}),o.d(e,"lazyJqueryUI",function(){return n}),r=o("P5fv"),a=function(){function t(t){this._$elem=t}return t.prototype.draggable=function(){var t=arguments,e=this._$elem;return i("draggable").then(function(){return e.draggable.apply(e,t)})},t.prototype.resizable=function(){var t=arguments,e=this._$elem;return i("resizable").then(function(){return e.resizable.apply(e,t)})},t.prototype.sortable=function(){var t=arguments,e=this._$elem;return i("sortable").then(function(){return e.sortable.apply(e,t)})},t.prototype.datepicker=function(){var t=arguments,e=this._$elem;return i("datepicker").then(function(){return e.datepicker.apply(e,t)})},t}()},"9On3":function(t,e){t.exports=''},ADFN:function(t,e,o){},BiGZ:function(t,e){t.exports=''},BsMi:function(t,e){t.exports=''},HKvk:function(t,e){t.exports=''},Kjbl:function(t,e){t.exports=''},NDCK:function(t,e){t.exports=''},Nz7V:function(t,e){ t.exports=''},PwLo:function(t,e,o){},RRhU:function(t,e){t.exports=''},RsxI:function(t,e){t.exports=''},TXAa:function(t,e,o){},WRHa:function(t,e){t.exports=''},XqDt:function(t,e){t.exports=''},dhuF:function(t,e){t.exports=''},eHtW:function(t,e){t.exports=''},"fUH/":function(t,e){t.exports=''},gPdB:function(t,e){ t.exports=''},gmn6:function(t,e,o){"use strict";o.r(e),function(t){var i,n,r,s,a,l,d,c,p,u,h,g,_,v,f,b;o.d(e,"FavoriteDrawingToolbar",function(){return b}),i=o("mrSG"),n=o("P5fv"),r=o("OiQe"),s=o("bf9a"),o("YFKU"),a=o("0ZwQ"),l=o("b2d7"),d=o("7KDR"),c=o("5VQP"),p=o("mMWL"),u=o("MP+M"),h=o("Vdly"),g=o("hY0g"),_=o.n(g),v=o("TXAa"),f='{{{icon}}}',b=function(e){function o(t){var o=e.call(this,{allowSortable:!Modernizr.mobiletouch,dragOnlyInsideToolbar:!0,defaultPosition:t,positionSettingsKey:"chart.favoriteDrawingsPosition"})||this;return o._linetoolsWidgets={},o._canBeShownValue=new _.a(!1),o._attachHandlers(),o._loadVisibilityState(),o}return Object(i.__extends)(o,e),o.prototype.show=function(){this._canBeShownValue.value()&&(h.setValue(o._visibilitySettingsKey,!0),this.isVisible()||this._renderAllLinetools(),e.prototype.show.call(this))},o.prototype.hide=function(){h.setValue(o._visibilitySettingsKey,!1),e.prototype.hide.call(this)},o.prototype.canBeShown=function(){return this._canBeShownValue.readonly()},o.prototype._onFavoriteAdded=function(t){this._canBeShownValue.setValue(!0),this.addWidget(this._createLinetoolWidget(t)),this.show()},o.prototype._onFavoriteRemoved=function(t){this.removeWidget(this._linetoolsWidgets[t]),delete this._linetoolsWidgets[t],0===l.a.favoritesCount()&&(this._canBeShownValue.setValue(!1),this.hide())},o.prototype._onFavoriteMoved=function(){this._renderAllLinetools()},o.prototype._onSelectedLinetoolChanged=function(t){var e=this;Object.keys(this._linetoolsWidgets).forEach(function(o){e._linetoolsWidgets[o].classList.toggle("i-active",t===o)})},o.prototype._createLinetoolWidget=function(e){var o=$(t.render(f,{icon:u.a[e].icon,isActive:e===p.tool.value(),title:u.a[e].localizedName}))[0];return o.addEventListener("click",function(t){t.preventDefault(),p.tool.value()!==e&&p.tool.setValue(e)}),this._linetoolsWidgets[e]=o,o},o.prototype._renderAllLinetools=function(){var t=this;this._linetoolsWidgets={},this.removeWidgets(),l.a.favorites().filter(function(t){return u.a[t]}).forEach(function(e){t.addWidget(t._createLinetoolWidget(e))})},o.prototype._attachHandlers=function(){var t=this;l.a.favoriteAdded.subscribe(this,this._onFavoriteAdded),l.a.favoriteRemoved.subscribe(this,this._onFavoriteRemoved),l.a.favoriteMoved.subscribe(this,this._onFavoriteMoved),l.a.favoritesSynced.subscribe(null,function(){t._loadVisibilityState(),t._renderAllLinetools()}), this.onWidgetsReordered().subscribe(this,function(e,o){if(l.a.favoriteMoved.unsubscribe(t,t._onFavoriteMoved),!l.a.moveFavorite(l.a.favorite(e),o))throw new Error("Something went wrong");l.a.favoriteMoved.subscribe(t,t._onFavoriteMoved)}),this.onContextMenu(function(e){e.preventDefault();var o=new d.Action({label:window.t("Hide Favorite Drawings Toolbar"),onExecute:function(){t.hide()}});c.ContextMenuManager.createMenu([o]).then(function(t){t.show(e)})}),p.tool.subscribe(this._onSelectedLinetoolChanged.bind(this))},o.prototype._loadVisibilityState=function(){var t=l.a.favoritesCount()>0;this._canBeShownValue.setValue(t),h.getBool(o._visibilitySettingsKey,!0)&&t?this.show():this.hide()},o._visibilitySettingsKey="ChartFavoriteDrawingToolbarWidget.visible",o}(a.a)}.call(this,o("OiQe"))},"m/4m":function(t,e,o){},my99:function(t,e,o){"use strict";var i,n,r,s,a,l,d,c;o.r(e),o.d(e,"GroupButtonFloatingToolbar",function(){return c}),i=o("mrSG"),n=o("Eyy1"),r=o("0ZwQ"),s=o("aIyQ"),a=o.n(s),l=o("m/4m"),d=o("ADFN"),c=function(t){function e(o){var i=t.call(this,e._prepareOptions(o))||this;return i._onWidgetStateChangedDelegate=new a.a,i._statedWidgets=[],i._currentPopup=null,i._onWindowClickedListener=i._onWindowClicked.bind(i),i}return Object(i.__extends)(e,t),e.prototype.show=function(){t.prototype.show.call(this),document.addEventListener("mousedown",this._onWindowClickedListener)},e.prototype.hide=function(){t.prototype.hide.call(this),document.removeEventListener("mousedown",this._onWindowClickedListener)},e.prototype.destroy=function(){this._closePopup(),t.prototype.destroy.call(this)},e.prototype.addGroupedWidget=function(t,o){var i,r,s;void 0===o&&(o={}),Object(n.assert)(t.states.length>0&&-1!==e._getStateIndexById(t,t.currentStateId),"Argument is invalid (count: "+t.states.length+", state: "+t.currentStateId+")"),(i=document.createElement("div")).className="tv-grouped-floating-toolbar__widget-wrapper apply-common-tooltip",t.widgetAddClass&&i.classList.add(t.widgetAddClass),i.setAttribute("title",t.tooltip),r={isEnabled:!0,statedWidget:t,toolbarWidget:i},s=this._onWidgetClicked.bind(this,r),r.clickListener=s,i.addEventListener("click",s),this._updateWidgetPreview(r),this.addWidget(i,o),this._statedWidgets.push(r)},e.prototype.removeGroupedWidget=function(t){var e,o,i=this._statedWidgets.length;for(e=0;ewindow.innerWidth-e.right?r.classList.add("tv-grouped-floating-toolbar__popup--at-left"):r.classList.remove("tv-grouped-floating-toolbar__popup--at-left")):(r.classList.remove("tv-grouped-floating-toolbar__popup--at-left"),s=0,i.left+n.width>window.innerWidth?e.left+n.width>window.innerWidth&&(s=e.width-n.width):s=i.left-e.left+1,r.style.left=s+"px",e.bottom+n.height>window.innerHeight?r.classList.add("tv-grouped-floating-toolbar__popup--at-top"):(r.classList.remove("tv-grouped-floating-toolbar__popup--at-top"),r.style.top=""))}},e.prototype._isPopupCreatedForWidget=function(t){return Boolean(this._currentPopup&&this._currentPopup.stateWidgetId===t)},e.prototype._createSubWidget=function(t,e){var o=document.createElement("div");return o.className+="tv-grouped-floating-toolbar__sub-widget",t.statedWidget.stateWidgetAddClass&&o.classList.add(t.statedWidget.stateWidgetAddClass),o.appendChild(e.widget),o},e.prototype._onSubWidgetClicked=function(t,e){this._closePopup(),t.statedWidget.currentStateId!==e&&(this.setGroupedWidgetState(t.statedWidget.id,e),this._onWidgetStateChangedDelegate.fire(t.statedWidget.id,e))},e.prototype._onWindowClicked=function(t){if(this.isVisible()&&this._currentPopup&&!e._isEventInElement(t,this._currentPopup.element)){for(var o=0;o'},nApS:function(t,e){t.exports=''},nSyy:function(t,e,o){},tPkB:function(t,e,o){"use strict" ;(function(e,i){function n(t){this._chartWidgetCollection=t,this._bindings=[],this._hasAlertWathcedValue=null,this._$templatesButton=null,this._currentProperties=null,this._toolbarWidgets=[],this._clearPropertiesOnHideTimeoutId=null,this._init(),this.attachHandlers()}function r(t,e){t.push({id:e,widget:$('
'+e+"
")[0]})}function s(t,e){t.push({id:e.value,widget:$(e.iconSvgCode)[0]})}function a(t){return function(t,e){return $("
").addClass("tv-linetool-properties-toolbar__icon").addClass(e).append(t)[0]}(t,"tv-linetool-properties-toolbar__icon--line-props")}var l,d,c,p,u,h,g,_,v,f,b,y,w,m,C,x=o("DxCR"),W=x.PropertyPage,L=x.ColorBinding,T=o("mMWL"),P=o("bR4N").bindPopupMenu,S=o("Ocx9").DefaultProperty,E=o("my99").GroupButtonFloatingToolbar,k=o("a7Ha").LineEnd,B=o("VNzU").isMultipleLayout,z=o("yMne"),V=o("CW80"),A=V.createLineToolProperties,F=V.isLineTool,M=o("PC8g").trackEvent;o("m/4m"),o("nSyy"),n.prototype.activeChartWidget=function(){return this._chartWidgetCollection.activeChartWidget.value()},n.prototype.selectedSources=function(){return this._chartWidgetCollection.selectedSources.value()},n.prototype._init=function(){this._floatingToolbar=new E({addClass:"tv-linetool-properties-toolbar",defaultPosition:{top:z.HEADER_TOOLBAR_HEIGHT_EXPANDED+15,left:window.innerWidth/2},positionSettingsKey:"properties_toolbar.position"}),this._floatingToolbar.onWidgetStateChanged().subscribe(this,this._onPropertyChangedInToolbar),this._sourceActions=this._createSourceActions(),this._sourceActions.forEach(function(t){this._floatingToolbar.addWidget(t.button)},this)},n.prototype._bindPopupMenuDirection=function(){return this._floatingToolbar.isVertical()?"right":"down"},n.prototype._onPropertyChangedInToolbar=function(t,e){this._currentProperties&&this.activeChartWidget().model().setProperty(this._currentProperties[t],e)},n.prototype._onPropertyChanged=function(t,e){this._floatingToolbar.setGroupedWidgetState(t,e.value())},n.prototype._hideAllSourceActions=function(){this._sourceActions.forEach(function(t){this._floatingToolbar.hideWidget(t.button)},this),this._sourceActionsVisible=!1},n.prototype._updateSourceActionsVisibility=function(t){this._sourceActionsVisible=!1,this._sourceActions.forEach(function(e){!e.isVisibleForSources||e.isVisibleForSources(t)?(this._floatingToolbar.showWidget(e.button),this._sourceActionsVisible=!0):this._floatingToolbar.hideWidget(e.button)},this)},n.prototype.attachHandlers=function(){T.tool.subscribe(this.onToolChanged.bind(this),{callWithLast:!0}),this._chartWidgetCollection.selectedSources.subscribe(this.onSourceChanged.bind(this)),this._chartWidgetCollection.layout.subscribe(this._updateCloneButtonTitle.bind(this))},n.prototype._updateCloneButtonTitle=function(){this._setButtonTitle(this._cloneButton,this._cloneButtonTitle())},n.prototype.onToolChanged=function(t,e){if(t&&-1!==t.toLowerCase().indexOf("linetool")){e=e instanceof S?e:A(t);this._hideAllSourceActions(),this.showPropertiesOf(t,e),this.showTemplatesOf({tool:t,properties:e}), this._updateVisibility()}else this.selectedSources()?this.onSourceChanged(this.selectedSources()):this.hide()},n.prototype.findSourceOnWidget=function(t){var e,o,i;for(e=0;e0}},{button:this._createLockButton()},{button:this._createHideButton()},{button:this._createRemoveButton()}),t},n.prototype._getCloneActions=function(){var t,e=this.activeChartWidget().model(),o=this.selectedSources(),i=[],n=o.filter(function(t){return t.cloneable()});return n.length>0&&i.push({name:"clone",title:window.t("Clone"),action:function(){e.cloneLineTools(n)}}),(t=o.filter(function(t){return t.copiable()})).length>0&&i.push({name:"copy",title:window.t("Copy"),shortcut:"Ctrl-C",action:function(){e.copySourcesToClip(t)}}),B(this._chartWidgetCollection.layout.value())?(o.filter(function(t){return!!t.linkKey}).length?i.push({name:"stop-sync",title:$.t("Stop syncing"),action:function(){e.unlinkLines(o)}}):i.push({name:"sync",title:$.t("Sync to all charts"),action:function(){e.copyToOtherCharts(o)}}),i):i},n.prototype._getZOrderActions=function(){var t=[],e=this.selectedSources(),o=this.activeChartWidget().model(),i={name:"bring-to-front",title:$.t("Bring to Front"),action:function(){o.bringToFront(e)}},n={name:"send-to-back",title:$.t("Send to Back"),action:function(){o.sendToBack(e)}},r={name:"bring-forward",title:$.t("Bring Forward"),action:function(){o.bringForward(e)}},s={name:"send-backward",title:$.t("Send Backward"),action:function(){o.sendBackward(e)} },a=o.paneForSource(e[0]),l=a.getZOrderMinMax();return 1===e.length&&e[0].zorder()===l.minZOrder&&(n.disabled=!0,s.disabled=!0),1===e.length&&e[0].zorder()===l.maxZOrder&&(r.disabled=!0,i.disabled=!0),t.push(i,n,r,s),t},n.prototype._getPossibleProperty=function(t){var e,o,i=[],r=this._defaultToolProperties();for(e=0;e=0;--n)if(l=e[(a=o[n]).name],"function"!=typeof(d=a.showIf)||d(l,e)){if(!l)continue;if(this._propertiesVisible=!0,c=[],"combobox"!==a.inputType){p=this.colorPropertyControl(l,a,e),this._floatingToolbar.addWidget(p[0],{index:this._$templatesButton?1:0}),this._toolbarWidgets.push(p);continue}a.simple?a.comboboxOptions.forEach(r.bind(null,c)):a.comboboxOptions.forEach(s.bind(null,c)),a.propertyProxy&&(l=a.propertyProxy(e,this.activeChartWidget().model())),i[a.name]=l,l.subscribe(this,this._onPropertyChanged.bind(this,a.name,l)),this._floatingToolbar.addGroupedWidget({id:a.name,currentStateId:l.value(),stateWidgetAddClass:"tv-linetool-properties-toolbar__sub-widget",states:c,widgetAddClass:"tv-linetool-properties-toolbar__grouped-button",tooltip:a.title},{index:this._$templatesButton?1:0})}this._currentProperties=i}},n.prototype._updateVisibility=function(){this._propertiesVisible||this._sourceActionsVisible||this._templatesVisible?this._show():this.hide()},n.prototype._clearProperties=function(){this._currentProperties&&(this._clearPropertiesOnHideTimeoutId&&(clearTimeout(this._clearPropertiesOnHideTimeoutId),this._clearPropertiesOnHideTimeoutId=null),Object.keys(this._currentProperties).forEach(function(t){this._currentProperties[t].unsubscribeAll(this),this._floatingToolbar.removeGroupedWidget(t)},this),this._currentProperties=null,this._toolbarWidgets.forEach(function(t){this._floatingToolbar.removeWidget(t[0]),t.remove()},this),this._toolbarWidgets=[],this.clearBindings())},n.prototype.hide=function(){this._floatingToolbar.hide(),this._clearPropertiesOnHideTimeoutId=setTimeout(this._clearProperties.bind(this),this._floatingToolbar.hideDuration())},n.prototype._show=function(){this._clearPropertiesOnHideTimeoutId&&(clearTimeout(this._clearPropertiesOnHideTimeoutId),this._clearPropertiesOnHideTimeoutId=null),this._floatingToolbar.show()},n.prototype.refresh=function(){this.onSourceChanged(this.selectedSources())},n.prototype._setupToggleLockButton=function(t){ t!==this._selectedSourceBk&&(this._selectedSourceBk&&this._selectedSourceBk.properties().frozen&&this._selectedSourceBk.properties().frozen.unsubscribe(this,this._lockChangeListener),t&&t.properties().frozen&&(t.properties().frozen.subscribe(this,this._lockChangeListener),this._lockChangeListener(t.properties().frozen)),this._selectedSourceBk=t)},n.prototype.bindControl=function(t){this._bindings.push(t)},n.prototype.clearBindings=function(t){for(var e=this._bindings.length;e--;)this._bindings[e].destroy();this._bindings.length=0},n.prototype.colorPropertyControl=function(t,e,o){var i,r,s=W.prototype.createColorPicker({addClass:"tv-linetool-properties-toolbar__color-picker apply-common-tooltip",direction:this._bindPopupMenuDirection.bind(this)});return s.attr("title",e.title),i=s.find("input"),(r=$(e.iconSvgCode)).on("click",function(t){i.data("tvcolorpicker")||i.focus()}),$(document).on("click",function(t){i.data("tvcolorpicker")?i.addClass("i-active"):i.removeClass("i-active")}),i.after(r),this.bindControl(new L(s,t,!0,this.activeChartWidget().model(),null,n.getTransparency(e,o))),"string"==typeof e.addClass&&s.addClass(e.addClass),s},n.getTransparency=function(t,e){if(t.transparency)return t.transparencyField?e[t.transparencyField].value():e.transparency.value()},n.prototype.createLineEndPropertyProxy=function(t,e){return function(o,r){var s,a;return s=o[e]&&o[e].value()?n.LINE_EXTEND:o[t].value(),(a=new i(s)).subscribe(this,function(i){var n=i.value();n<2?(r.beginUndoMacro(""),o[t].setValue(n),o[e]&&o[e].setValue(!1),r.endUndoMacro()):(r.beginUndoMacro(""),o[t].setValue(k.Normal),o[e]&&o[e].setValue(!0),r.endUndoMacro())}),a}},n.LINE_EXTEND=42,l=a(o("wLZl")),d=a(o("XqDt")),c=a(o("znEV")),p=a(o("NDCK")),u=a(o("9On3")),h=a(o("Nz7V")),g=a(o("dhuF")),_=a(o("n2Ch")),v=a(o("eHtW")),f=a(o("BiGZ")),b=a(o("fUH/")),y=a(o("BsMi")),w=o("HKvk"),m=o("2JFs"),C=o("Kjbl"),n.prototype._defaultToolProperties=function(){return[{name:"color",inputType:"colorPicker",iconSvgCode:w,title:$.t("Color")},{name:"linecolor",inputType:"colorPicker",iconSvgCode:w,title:$.t("Color")},{name:"backgroundColor",inputType:"colorPicker",iconSvgCode:m,title:$.t("Background Color"),transparency:!0},{name:"linewidth",inputType:"combobox",comboboxOptions:[{value:1,iconSvgCode:l},{value:2,iconSvgCode:d},{value:3,iconSvgCode:c},{value:4,iconSvgCode:p}],title:$.t("Width")},{name:"linestyle",title:$.t("Style"),inputType:"combobox",comboboxOptions:[{value:0,iconSvgCode:l},{value:1,iconSvgCode:u},{value:2,iconSvgCode:h}]},{name:"leftEnd",title:$.t("Left End"),inputType:"combobox",comboboxOptions:[{value:k.Normal,iconSvgCode:g},{value:k.Arrow,iconSvgCode:_},{value:n.LINE_EXTEND,iconSvgCode:v}],propertyProxy:this.createLineEndPropertyProxy("leftEnd","extendLeft")},{name:"rightEnd",title:$.t("Right End"),inputType:"combobox",comboboxOptions:[{value:k.Normal,iconSvgCode:f},{value:k.Arrow,iconSvgCode:b},{value:n.LINE_EXTEND,iconSvgCode:y}],propertyProxy:this.createLineEndPropertyProxy("rightEnd","extendRight")}]}, n.prototype._riskPropertiesExceptionCases=function(){return[{name:"textcolor",title:$.t("Text color"),inputType:"colorPicker",iconSvgCode:C},{name:"profitBackground",title:$.t("Profit Background Color"),inputType:"colorPicker",iconSvgCode:m,transparency:!0,transparencyField:"profitBackgroundTransparency"},{name:"stopBackground",title:$.t("Stop Background Color"),inputType:"colorPicker",iconSvgCode:m,transparency:!0,transparencyField:"stopBackgroundTransparency"},{name:"linecolor",title:$.t("Border color"),inputType:"colorPicker",iconSvgCode:w}]},n.prototype._elliottPropertiesExceptionCases=function(){return[{name:"color",title:$.t("Color"),inputType:"colorPicker",iconSvgCode:w}]},n.prototype._rangeExceptionCases=function(){return[{name:"linecolor",inputType:"colorPicker",iconSvgCode:w,title:$.t("Color")},{name:"backgroundColor",inputType:"colorPicker",iconSvgCode:m,title:$.t("Background Color"),transparency:!0,transparencyField:"backgroundTransparency"},{name:"linewidth",inputType:"combobox",comboboxOptions:[{value:1,iconSvgCode:l},{value:2,iconSvgCode:d},{value:3,iconSvgCode:c},{value:4,iconSvgCode:p}],title:"Width"}]},n.prototype._textPropertiesExceptionCases=function(){return[{name:"color",title:$.t("Text color"),inputType:"colorPicker",iconSvgCode:C},{name:"backgroundColor",title:$.t("Background Color"),inputType:"colorPicker",iconSvgCode:m,showIf:function(t,e){return!e||!e.fillBackground||!!e.fillBackground.value()}},{name:"borderColor",title:$.t("Border Color"),inputType:"colorPicker",iconSvgCode:w},{name:"bordercolor",title:$.t("Border Color"),inputType:"colorPicker",iconSvgCode:w},{name:"fontsize",title:$.t("Font Size"),inputType:"combobox",simple:!0,addClass:"simple fontsize-dropdown",comboboxOptions:[10,11,12,14,16,20,24,28,32,40]}]},n.prototype._notePropertiesExceptionCases=function(){return[{name:"markerColor",title:$.t("Marker Color"),inputType:"colorPicker",iconSvgCode:w},{name:"textColor",title:$.t("Text color"),inputType:"colorPicker",iconSvgCode:C},{name:"fontSize",title:$.t("Font Size"),inputType:"combobox",simple:!0,addClass:"simple fontsize-dropdown",comboboxOptions:[10,11,12,14,16,20,24,28,32,40]}]},n.prototype._brushPropertiesExceptionCases=function(){return[{name:"linecolor",inputType:"colorPicker",iconSvgCode:w,title:$.t("Color")},{name:"backgroundColor",inputType:"colorPicker",iconSvgCode:m,transparency:!0,showIf:function(t,e){return e.fillBackground.value()},title:$.t("Background Color")},{name:"linewidth",inputType:"combobox",comboboxOptions:[{value:1,iconSvgCode:l},{value:2,iconSvgCode:d},{value:3,iconSvgCode:c},{value:4,iconSvgCode:p}],title:$.t("Line Width")},{name:"leftEnd",title:$.t("Left End"),inputType:"combobox",comboboxOptions:[{value:k.Normal,iconSvgCode:g},{value:k.Arrow,iconSvgCode:_}],propertyProxy:this.createLineEndPropertyProxy("leftEnd","extendLeft")},{name:"rightEnd",title:$.t("Right End"),inputType:"combobox",comboboxOptions:[{value:k.Normal,iconSvgCode:f},{value:k.Arrow,iconSvgCode:b}],propertyProxy:this.createLineEndPropertyProxy("rightEnd","extendRight")}]}, n.prototype._oneColorForAllLines=function(){return[{name:"collectibleColors",inputType:"colorPicker",iconSvgCode:w,title:$.t("One color for all lines")}]},n.prototype._trackContextAction=function(t){M("GUI","Context action on drawings",t)},n.prototype._createToolExceptionCases=function(){return{LineToolRegressionTrend:[],LineToolGannSquare:n.prototype._oneColorForAllLines(),LineToolFibTimeZone:n.prototype._oneColorForAllLines(),LineToolBrush:n.prototype._brushPropertiesExceptionCases(),LineToolPolyline:n.prototype._brushPropertiesExceptionCases(),LineToolText:n.prototype._textPropertiesExceptionCases(),LineToolTextAbsolute:n.prototype._textPropertiesExceptionCases(),LineToolBalloon:n.prototype._textPropertiesExceptionCases(),LineToolCallout:n.prototype._textPropertiesExceptionCases(),LineToolPriceLabel:n.prototype._textPropertiesExceptionCases(),LineToolArrowMarkLeft:[],LineToolArrowMarkRight:[],LineToolArrowMarkUp:[],LineToolArrowMarkDown:[],LineToolFlagMark:[],LineToolElliottCircle:n.prototype._elliottPropertiesExceptionCases(),LineToolElliottSubminuette:n.prototype._elliottPropertiesExceptionCases(),LineToolElliottMinor:n.prototype._elliottPropertiesExceptionCases(),LineToolElliottMinorRetr:n.prototype._elliottPropertiesExceptionCases(),LineToolElliottMajorRetr:n.prototype._elliottPropertiesExceptionCases(),LineToolDateRange:n.prototype._rangeExceptionCases(),LineToolPriceRange:n.prototype._rangeExceptionCases(),LineToolDateAndPriceRange:n.prototype._rangeExceptionCases(),LineToolIcon:[{name:"color",title:$.t("Color"),inputType:"colorPicker",iconSvgCode:m}],LineToolNote:n.prototype._notePropertiesExceptionCases(),LineToolNoteAbsolute:n.prototype._notePropertiesExceptionCases(),LineToolThreeDrivers:[{name:"color",title:$.t("Text color"),inputType:"colorPicker",iconSvgCode:w}],LineToolRiskRewardLong:n.prototype._riskPropertiesExceptionCases(),LineToolRiskRewardShort:n.prototype._riskPropertiesExceptionCases(),LineToolBarsPattern:[{name:"color",title:$.t("Color"),inputType:"colorPicker",iconSvgCode:m}],LineToolProjection:[{name:"color1",title:$.t("Background color 1"),inputType:"colorPicker",iconSvgCode:m,transparency:!0},{name:"color2",title:$.t("Background color 2"),inputType:"colorPicker",iconSvgCode:m,transparency:!0},{name:"linewidth",inputType:"combobox",comboboxOptions:[{value:1,iconSvgCode:l},{value:2,iconSvgCode:d},{value:3,iconSvgCode:c},{value:4,iconSvgCode:p}]}],LineToolFibCircles:n.prototype._oneColorForAllLines(),LineToolFibChannel:n.prototype._oneColorForAllLines(),LineToolFibSpeedResistanceArcs:n.prototype._oneColorForAllLines(),LineToolFibRetracement:n.prototype._oneColorForAllLines(),LineToolFibSpeedResistanceFan:n.prototype._oneColorForAllLines(),LineToolTrendBasedFibTime:n.prototype._oneColorForAllLines(),LineToolFibWedge:n.prototype._oneColorForAllLines(),LineToolGannComplex:n.prototype._oneColorForAllLines(),LineToolGannFixed:n.prototype._oneColorForAllLines(),LineToolGannFan:n.prototype._oneColorForAllLines(),LineToolPitchfan:n.prototype._oneColorForAllLines(), LineToolPitchfork:n.prototype._oneColorForAllLines(),LineToolSchiffPitchfork2:n.prototype._oneColorForAllLines(),LineToolSchiffPitchfork:n.prototype._oneColorForAllLines(),LineToolInsidePitchfork:n.prototype._oneColorForAllLines(),LineToolTrendBasedFibExtension:n.prototype._oneColorForAllLines()}},t.exports=n}).call(this,o("Kxc7"),o("tc+8"))},tzjn:function(t,e){t.exports=''},wLZl:function(t,e){t.exports=''},yB98:function(t,e){t.exports=''},znEV:function(t,e){t.exports=''}}]);