"use strict";(self.webpackChunktradingview=self.webpackChunktradingview||[]).push([[9123],{91445:(e,t,i)=>{i.d(t,{createTextStyleDefinition:()=>D});var o=i(11542),r=i(95804),n=i(95338),l=i(91682);const s=new r.TranslatedString("change {toolName} text visibility",o.t(null,void 0,i(56634))),a=new r.TranslatedString("change {toolName} text color",o.t(null,void 0,i(64500))),d=new r.TranslatedString("change {toolName} text font size",o.t(null,void 0,i(21781))),c=new r.TranslatedString("change {toolName} text font bold",o.t(null,void 0,i(24701))),u=new r.TranslatedString("change {toolName} text font italic",o.t(null,void 0,i(42694))),h=new r.TranslatedString("change {toolName} text",o.t(null,void 0,i(66668))),p=new r.TranslatedString("change {toolName} labels alignment vertical",o.t(null,void 0,i(31689))),g=new r.TranslatedString("change {toolName} labels alignment horizontal",o.t(null,void 0,i(88277))),f=new r.TranslatedString("change {toolName} labels direction",o.t(null,void 0,i(61160))),b=new r.TranslatedString("change {toolName} text background visibility",o.t(null,void 0,i(31133))),_=new r.TranslatedString("change {toolName} text background color",o.t(null,void 0,i(22231))),v=new r.TranslatedString("change {toolName} text border visibility",o.t(null,void 0,i(58704))),y=new r.TranslatedString("change {toolName} text border width",o.t(null,void 0,i(35423))),x=new r.TranslatedString("change {toolName} text border color",o.t(null,void 0,i(36666))),m=new r.TranslatedString("change {toolName} text wrap",o.t(null,void 0,i(39587))),T=o.t(null,void 0,i(79468)),C=o.t(null,void 0,i(38408)),P=o.t(null,void 0,i(7560)),S=o.t(null,void 0,i(6060));function D(e,t,i,o){const r={},D={id:`${(0,l.removeSpaces)(i.originalText())}Text`,title:o.customTitles&&o.customTitles.text||"",placeholder:o.placeholder??S};if(void 0===t.showText||o.hideTextCheckbox||(r.checked=(0,n.convertToDefinitionProperty)(e,t.showText,s.format({toolName:i}))),void 0!==t.textColor&&(r.color=(0,n.getColorDefinitionProperty)(e,t.textColor,t.transparency||null,a.format({toolName:i}))),void 0!==t.fontSize&&(r.size=(0,n.convertToDefinitionProperty)(e,t.fontSize,d.format({toolName:i}))),void 0!==t.bold&&(r.bold=(0,n.convertToDefinitionProperty)(e,t.bold,c.format({toolName:i}))),void 0!==t.italic&&(r.italic=(0,n.convertToDefinitionProperty)(e,t.italic,u.format({toolName:i}))),void 0!==t.text){const l=h.format({toolName:i});r.text=(0,n.convertToDefinitionProperty)(e,t.text,l,void 0),D.isEditable=Boolean(o.isEditable),D.isMultiLine=Boolean(o.isMultiLine)}if(void 0!==t.vertLabelsAlign&&(r.alignmentVertical=(0,n.convertToDefinitionProperty)(e,t.vertLabelsAlign,p.format({toolName:i})),D.alignmentVerticalItems=o.alignmentVerticalItems),void 0!==t.horzLabelsAlign&&(r.alignmentHorizontal=(0,n.convertToDefinitionProperty)(e,t.horzLabelsAlign,g.format({toolName:i})),D.alignmentHorizontalItems=o.alignmentHorizontalItems),void 0!==t.textOrientation&&(r.orientation=(0,n.convertToDefinitionProperty)(e,t.textOrientation,f.format({toolName:i}))),
void 0!==t.backgroundVisible&&(r.backgroundVisible=(0,n.convertToDefinitionProperty)(e,t.backgroundVisible,b.format({toolName:i}))),void 0!==t.backgroundColor){let o=null;void 0!==t.backgroundTransparency&&(o=t.backgroundTransparency),r.backgroundColor=(0,n.getColorDefinitionProperty)(e,t.backgroundColor,o,_.format({toolName:i}))}return void 0===t.backgroundVisible&&void 0===t.backgroundColor||(D.backgroundTitle=o.customTitles&&o.customTitles.backgroundTitle||T),void 0!==t.borderVisible&&(r.borderVisible=(0,n.convertToDefinitionProperty)(e,t.borderVisible,v.format({toolName:i}))),void 0!==t.borderWidth&&(r.borderWidth=(0,n.convertToDefinitionProperty)(e,t.borderWidth,y.format({toolName:i}))),void 0!==t.borderColor&&(r.borderColor=(0,n.getColorDefinitionProperty)(e,t.borderColor,null,x.format({toolName:i}))),void 0===t.borderVisible&&void 0===t.borderColor&&void 0===t.borderWidth||(D.borderTitle=o.customTitles&&o.customTitles.borderTitle||C),void 0!==t.wrap&&(r.wrap=(0,n.convertToDefinitionProperty)(e,t.wrap,m.format({toolName:i})),D.wrapTitle=o.customTitles&&o.customTitles.wrapTitle||P),(0,n.createTextPropertyDefinition)(r,D)}},14472:(e,t,i)=>{i.r(t),i.d(t,{LineDataSourceDefinitionsViewModel:()=>x,LineDataSourceTabTypes:()=>o,pointPriceBarTitle:()=>y});var o,r=i(50151),n=i(11542),l=i(95804),s=(i(40167),i(95338)),a=i(60567),d=i(22613),c=i(73863),u=i(97578),h=i(81634),p=i(36313);!function(e){e.Visibility="visibility",e.Coordinates="coordinates",e.Style="style",e.Text="text",e.Inputs="inputs"}(o||(o={}));const g=n.t(null,void 0,i(40091)),f=n.t(null,void 0,i(78930)),b=n.t(null,void 0,i(92516)),_=n.t(null,void 0,i(70320)),v=n.t(null,void 0,i(21429)),y=n.t(null,{context:"linetool point"},i(80166));class x{constructor(e,t){this._yCoordinateStepWV=null,this._propertyPages=[],this._source=t,this._undoModel=e,this._ownerSource=(0,r.ensureNotNull)(this._source.ownerSource()),this._propertyApplier=new h.PropertyApplierWithoutSavingChart((()=>e)),this._createPropertyRages()}destroy(){null!==this._yCoordinateStepWV&&(this._source.ownerSourceChanged().unsubscribeAll(this),this._ownerSource.priceStepChanged().unsubscribeAll(this)),this._source.pointAdded().unsubscribeAll(this),this._propertyPages.forEach((e=>{(0,s.destroyDefinitions)(e.definitions.value())}))}propertyPages(){return Promise.resolve(this._propertyPages)}_createPropertyRages(){this._propertyPages=[];const e=this._createInputsPropertyPage();null!==e&&this._propertyPages.push(e);const t=this._createStylePropertyPage();null!==t&&this._propertyPages.push(t);const i=this._createTextPropertyPage();null!==i&&this._propertyPages.push(i);const o=this._createCoordinatesPropertyPage();null!==o&&(o.visible=this._source.hasEditableCoordinates(),this._propertyPages.push(o));const r=this._createVisibilitiesPropertyPage();this._propertyPages.push(r)}_createVisibilitiesPropertyPage(){const e=this._source.properties().childs().intervalsVisibilities.childs();return(0,a.createPropertyPage)((0,
c.getIntervalsVisibilitiesPropertiesDefinitions)(this._propertyApplier,e,new l.TranslatedString(this._source.name(),this._source.title(p.TitleDisplayTarget.StatusLine,!0))),"visibility",g)}_createCoordinatesPropertyPage(){const e=this._coordinatesPropertyDefinitions();return null!==e?(e.definitions.length<this._source.pointsCount()&&this._source.pointAdded().subscribe(this,this._updateCoordinatesPropertyDefinitons),(0,a.createPropertyPage)(e,"coordinates",f)):null}_getYCoordinateStepWV(){return null===this._yCoordinateStepWV&&(this._yCoordinateStepWV=new d.WatchedValue(function(e){if(null!==e){const t=e.priceStep();if(null!==t)return t}return 1}(this._source.ownerSource())),this._ownerSource.priceStepChanged().subscribe(this,(()=>this._updateYCoordinateStep())),this._source.ownerSourceChanged().subscribe(this,(()=>{this._ownerSource.priceStepChanged().unsubscribeAll(this),this._ownerSource=(0,r.ensureNotNull)(this._source.ownerSource()),this._ownerSource.priceStepChanged().subscribe(this,(()=>this._updateYCoordinateStep()))}))),this._yCoordinateStepWV}_coordinatesPropertyDefinitions(){const e=this._source.points(),t=this._source.pointsProperty().childs().points,i=[],o=this._getYCoordinateStepWV();return e.forEach(((e,r)=>{const n=t[r].childs();n&&i.push((0,u.getCoordinatesPropertiesDefinitions)(this._propertyApplier,n,e,o,y.format({count:(r+1).toString()}),this._source.name()))})),{definitions:i}}_createStylePropertyPage(){const e=this._stylePropertyDefinitions();return null!==e?(0,a.createPropertyPage)(e,"style",b):null}_stylePropertyDefinitions(){return null}_createTextPropertyPage(){const e=this._textPropertyDefinitions();return null!==e?(0,a.createPropertyPage)(e,"text",_):null}_textPropertyDefinitions(){return null}_createInputsPropertyPage(){const e=this._inputsPropertyDefinitions();return null!==e?(0,a.createPropertyPage)(e,"inputs",v):null}_inputsPropertyDefinitions(){return null}_updateYCoordinateStep(){const e=this._ownerSource.priceStep();this._getYCoordinateStepWV().setValue(e||1)}_updateCoordinatesPropertyDefinitons(){const e=this._coordinatesPropertyDefinitions();if(null!==e){(0,r.ensureDefined)(this._propertyPages.find((e=>"coordinates"===e.id))).definitions.setValue(e.definitions),this._source.points().length===this._source.pointsCount()&&this._source.pointAdded().unsubscribeAll(this)}}}},31558:(e,t,i)=>{i.d(t,{commonLineToolPropertiesStateKeys:()=>o})
;const o=["symbolStateVersion","zOrderVersion","frozen","title","interval","symbol","currencyId","unitId","visible","intervalsVisibilities.ticks","intervalsVisibilities.seconds","intervalsVisibilities.secondsFrom","intervalsVisibilities.secondsTo","intervalsVisibilities.minutes","intervalsVisibilities.minutesFrom","intervalsVisibilities.minutesTo","intervalsVisibilities.hours","intervalsVisibilities.hoursFrom","intervalsVisibilities.hoursTo","intervalsVisibilities.days","intervalsVisibilities.daysFrom","intervalsVisibilities.daysTo","intervalsVisibilities.weeks","intervalsVisibilities.weeksFrom","intervalsVisibilities.weeksTo","intervalsVisibilities.months","intervalsVisibilities.monthsFrom","intervalsVisibilities.monthsTo","intervalsVisibilities.ranges"];var r,n,l;!function(e){e[e.NotShared=0]="NotShared",e[e.SharedInLayout=1]="SharedInLayout",e[e.GloballyShared=2]="GloballyShared"}(r||(r={})),function(e){e.BeforeAllAction="BeforeAll",e.CustomAction="CustomAction"}(n||(n={})),function(e){e.FloatingToolbarButton="FloatingToolbarButton",e.Default="Default"}(l||(l={}))},88636:(e,t,i)=>{i.d(t,{LineDataSourceProperty:()=>s});var o=i(90054),r=i(16738),n=i(50151),l=i(78176);class s extends l.DefaultProperty{constructor({templateKeys:e,...t}){super({ignoreAllowSavingDefaults:!0,saveNonDefaultUserPreferencesOnly:!0,...t}),this._templateKeys=(0,n.ensureDefined)(e||this._allDefaultsKeys)}template(){return(0,l.extractState)(this.state(),this._templateKeys,[])}applyTemplate(e){this.mergeAndFire((0,l.extractState)((0,r.default)((0,o.default)(this._factoryDefaultsSupplier()),e),this._templateKeys))}}},9750:(e,t,i)=>{i.d(t,{alignByAngle:()=>r});var o=i(50605);function r(e){let t,i;return e>=-135&&e<=-45?(t=o.HorizontalAlign.Center,i=o.VerticalAlign.Bottom):e>-45&&e<45?(t=o.HorizontalAlign.Left,i=o.VerticalAlign.Middle):e>=45&&e<=135?(t=o.HorizontalAlign.Center,i=o.VerticalAlign.Top):(t=o.HorizontalAlign.Right,i=o.VerticalAlign.Middle),{horzAlign:t,vertAlign:i}}},55241:(e,t,i)=>{i.r(t),i.d(t,{LineToolTextNote:()=>pe});var o=i(18712),r=i(50151),n=i(24633),l=i(49156),s=i(37293),a=i(31558),d=i(78176),c=i(70031),u=i(88636),h=i(65045);const p={intervalsVisibilities:{...s.intervalsVisibilitiesDefaults},drawBackground:!0,drawBorder:!1,fontSize:14,bold:!1,italic:!1},g=new Map([[n.StdTheme.Light,{lineColor:l.colors.colorColdGray900,backgroundColor:l.colors.colorWhite,borderColor:l.colors.colorColdGray150,textColor:l.colors.colorColdGray900}],[n.StdTheme.Dark,{lineColor:l.colors.colorColdGray200,backgroundColor:l.colors.colorColdGray800,borderColor:l.colors.colorColdGray700,textColor:l.colors.colorColdGray200}]]),f=(0,d.extractThemedColors)((0,r.ensureDefined)(g.get(n.StdTheme.Light)),(0,r.ensureDefined)(g.get(n.StdTheme.Dark))),b=(0,d.extractAllPropertiesKeys)((0,r.ensureDefined)(g.get(n.StdTheme.Light))),_=(0,d.extractAllPropertiesKeys)(p),v=[...new Set([...b,..._,...a.commonLineToolPropertiesStateKeys,"text"])],y=[...new Set([...b,..._,"text"])];class x extends u.LineDataSourceProperty{constructor(e){super(e),
this.hasChild("text")||this.addProperty("text",""),this.addChild("linesColors",new h.LineToolColorsProperty([(0,r.ensureDefined)(this.child("lineColor"))])),this.addChild("backgroundsColors",new h.LineToolColorsProperty([(0,r.ensureDefined)(this.child("backgroundColor"))])),this.addChild("textsColors",new h.LineToolColorsProperty([(0,r.ensureDefined)(this.child("textColor"))]))}static create(e,t){return new this({defaultName:"linetooltextnote",factoryDefaultsSupplier:()=>(0,c.factoryDefaultsForCurrentTheme)(p,g),nonThemedDefaultsKeys:_,themedDefaultsKeys:b,allStateKeys:v,themedColors:f,templateKeys:y,replaceThemedColorsOnThemeChange:!0,state:t,theme:e})}}var m=i(63117),T=i(58978),C=i(49251),P=i(84617),S=i(94602),D=i(73914),w=i(2268),A=i(10555),V=i(6453),L=i(2624),k=i(24640),R=i(10307),N=i(2383),z=i(58221),M=i(4539),H=i(4753),B=i(50605),I=i(73041);var W,F,E=i(37103),O=i(9750);function K(e){return E.enabled("text-note-align-anchor-to-corner")?function(e){let t,i;return e>=-180&&e<-90?(t=B.HorizontalAlign.Right,i=B.VerticalAlign.Bottom):e>=-90&&e<=0?(t=B.HorizontalAlign.Left,i=B.VerticalAlign.Bottom):e>0&&e<=90?(t=B.HorizontalAlign.Left,i=B.VerticalAlign.Top):(t=B.HorizontalAlign.Right,i=B.VerticalAlign.Top),{horzAlign:t,vertAlign:i}}(e):(0,O.alignByAngle)(e)}!function(e){e[e.Label=1]="Label"}(W||(W={})),function(e){e[e.CircleRadius=2]="CircleRadius",e[e.RoundRectRadius=4]="RoundRectRadius",e[e.LabelVertPadding=6]="LabelVertPadding",e[e.LabelHorzPadding=8]="LabelHorzPadding",e[e.TextMargins=2]="TextMargins",e[e.Blur=4]="Blur",e[e.ShadowOffsetY=2]="ShadowOffsetY"}(F||(F={}));class Y extends R.BitmapCoordinatesPaneRenderer{constructor(e){super(),this._data=null,this._textLabelRenderer=new H.TextRenderer,this._textInfoCache=null,this._lineHitTest=new N.HitTestResult(N.HitTarget.MovePoint),this._textHitTest=e||new N.HitTestResult(N.HitTarget.MovePoint,{areaName:N.AreaName.Text}),this._textHitTest.mergeData({activeItem:W.Label})}setData(e){null===this._data||this._data.textData.text===e.textData.text&&this._data.textData.fontSize===e.textData.fontSize||(this._textInfoCache=null),this._data=e;const t=e.points[1];this._textLabelRenderer.setData({horzAlign:B.HorizontalAlign.Left,vertAlign:B.VerticalAlign.Middle,points:[t],text:e.textData.text||" ",color:e.textData.color,font:P.CHART_FONT_FAMILY,fontSize:e.textData.fontSize,bold:e.textData.bold,italic:e.textData.italic,offsetX:0,offsetY:0,borderColor:e.drawBorder?e.borderColor:void 0,borderWidth:1,backgroundColor:e.drawBackground?e.backgroundColor:void 0,backgroundRoundRect:F.RoundRectRadius,boxPaddingVert:F.LabelVertPadding,boxPaddingHorz:F.LabelHorzPadding,boxShadow:e.drawBorder||e.drawBackground?{shadowColor:e.shadowColor,shadowBlur:F.Blur,shadowOffsetY:F.ShadowOffsetY}:void 0,selectionHighlight:e.textData.selectionHighlight});const i=this._textLabelRenderer.rect(),o=e.points[0],r=e.points[1],n=K(Math.round(180*Math.atan2(r.y-o.y,r.x-o.x)/Math.PI));let l=e.points[1];switch(n.horzAlign){case B.HorizontalAlign.Center:l=l.add((0,A.point)(.5*-i.width,0));break
;case B.HorizontalAlign.Right:l=l.add((0,A.point)(-i.width,0))}switch(n.vertAlign){case B.VerticalAlign.Top:l=l.add((0,A.point)(0,.5*i.height));break;case B.VerticalAlign.Bottom:l=l.add((0,A.point)(0,.5*-i.height))}this._textLabelRenderer.setPoint(l)}setCursorType(e){this._textHitTest.mergeData({cursorType:e})}hitTest(e){const t=this._data;if(null===t||t.points.length<2)return null;const i=(0,M.interactionTolerance)().line+.5,o=t.points[0],r=t.points[1];if((0,L.distanceToSegment)(o,r,e).distance<=i)return this._lineHitTest;const n=this._textLabelRenderer.rect(),l=(0,A.box)((0,A.point)(n.x,n.y),(0,A.point)(n.x+n.width,n.y+n.height));return(0,V.pointInBox)(e,l)?this._textHitTest:null}getTextInfo(){const e=(0,r.ensureNotNull)(this._data),t=(0,k.isRtl)()?"right":"left",i=F.RoundRectRadius,o=F.TextMargins,n=(0,r.ensureNotNull)(this._calcTextSize()),l=this._textLabelRenderer.rect(),s=(0,r.ensureDefined)(this._textLabelRenderer.data()?.points?.[0]).add((0,A.point)(0,.5*-l.height)),{totalWidth:a,totalHeight:d}=n,c=i+o;return{font:e.textData.font,fontSize:e.textData.fontSize,lineHeight:Math.ceil(e.textData.fontSize),lineSpacing:0,textTop:s.y+c,textBottom:s.y+d-c,textLeft:s.x+c,textRight:s.x+a-c,textAlign:t}}positionToCoordinate(e,t){const i=(0,r.ensureNotNull)(this._data),o=this.getTextInfo(),n=this._textLabelRenderer.getLinesInfo(),{x:l,y:s,lineNumber:a}=(0,I.getSymbolCoordinatesInfo)({symbolPosition:t,textWidth:o.textRight-o.textLeft,textByLines:n.linesIncludingHidden,lineHeight:i.textData.fontSize,font:o.font,textAlign:o.textAlign});return{x:l+o.textLeft,y:s+o.textTop,lineNumber:a}}_drawImpl(e){const t=this._data;if(null===t||t.points.length<2)return;const{context:i}=e,o=t.points[0];let r=t.points[1];if(E.enabled("text-note-align-anchor-to-corner")){const e=Math.atan2(r.y-o.y,r.x-o.x);r=r.add(new A.Point(2*Math.cos(e),2*Math.sin(e)))}i.strokeStyle=t.lineColor,i.lineWidth=Math.max(1,Math.floor(e.horizontalPixelRatio)),i.beginPath();const[n,l]=(0,z.addPixelPerfectLineToPath)(i,o.x,o.y,r.x,r.y,e);i.stroke();const s=Math.round(F.CircleRadius*e.horizontalPixelRatio);i.fillStyle=t.lineColor,i.beginPath(),i.arc(n,l,s,0,2*Math.PI,!1),i.fill(),i.beginPath(),i.strokeStyle=t.circleBorderColor,i.lineWidth=1;const a=Math.round(F.CircleRadius*e.horizontalPixelRatio+.5*e.horizontalPixelRatio);i.arc(n,l,a,0,2*Math.PI,!1),i.stroke(),this._textLabelRenderer.draw(i,e)}_calcTextSize(){if(null===this._data||this._data.points.length<2)return null;if(null===this._textInfoCache){const e=this._textLabelRenderer.getLinesInfo(),t=this._data.textData.fontSize*e.lines.length,i=e.linesMaxWidth,o=F.RoundRectRadius,r=2*F.TextMargins+2*o;this._textInfoCache={textWidth:i,textHeight:t,totalWidth:i+r,totalHeight:t+r}}return this._textInfoCache}}var G=i(52859);const $=(0,G.generateColor)((0,T.getHexColorByName)("color-black"),80),U=(0,G.generateColor)((0,T.getHexColorByName)("color-black"),60);class X extends w.InplaceTextLineSourcePaneView{constructor(e,t,i,o){super(e,t,i,o),this._renderer=new S.CompositeRenderer,
this._noteRenderer=new Y(new N.HitTestResult(N.HitTarget.MovePoint,(0,w.inplaceEditHandlers)(this._tryActivateEditMode.bind(this,null)))),this._source.setAdditionalCursorData((()=>({color:this._source.editableTextStyle().cursorColor,...this._noteRenderer.getTextInfo()})),this._noteRenderer.positionToCoordinate.bind(this._noteRenderer,!0))}renderer(e){return this._invalidated&&this._updateImpl(e),this._renderer}_updateImpl(e){super._updateImpl(e),this._renderer.clear();const t=this._source.priceScale();if(!t||t.isEmpty())return;const i=this._points;if(i.length<2)return;if(null===(0,r.ensureNotNull)(this._source.ownerSource()).firstValue())return;const o=this._source.properties().childs(),n=this._model.dark().value()?l.colors.colorColdGray850:l.colors.colorWhite,s=this._model.dark().value()?U:$,a=o.fontSize.value(),d=o.bold.value(),c=o.italic.value(),u={textData:{font:(0,C.makeFont)(a,P.CHART_FONT_FAMILY,c?"italic":"",d?"bold":""),fontSize:a,text:this._textData(),color:this._textColor(),bold:d,italic:c,selectionHighlight:this._inplaceTextHighlight().selectionHighlight},shadowColor:s,points:i,lineColor:o.lineColor.value(),drawBackground:o.drawBackground.value(),drawBorder:o.drawBorder.value(),backgroundColor:o.backgroundColor.value(),borderColor:o.borderColor.value(),circleBorderColor:n};this._renderer.append(this._noteRenderer),this._noteRenderer.setData(u),this._noteRenderer.setCursorType(this._textCursorType()),this._renderer.append(this.createLineAnchor({points:i.map(D.mapLineSourcePaneViewPointToLineAnchorPoint)},0)),this._updateInplaceText(this._noteRenderer.getTextInfo())}}var j=i(11542),q=i(95804),J=i(91445),Q=i(14472),Z=i(95338),ee=i(91682);const te=new q.TranslatedString("change {title} line color",j.t(null,void 0,i(7455))),ie=new q.TranslatedString("change {title} background visibility",j.t(null,void 0,i(30839))),oe=new q.TranslatedString("change {title} background color",j.t(null,void 0,i(49765))),re=new q.TranslatedString("change {title} border visibility",j.t(null,void 0,i(19298))),ne=new q.TranslatedString("change {title} border color",j.t(null,void 0,i(69437))),le=j.t(null,void 0,i(70320)),se=j.t(null,void 0,i(97575)),ae=j.t(null,void 0,i(34974)),de=j.t(null,void 0,i(16236));class ce extends Q.LineDataSourceDefinitionsViewModel{_stylePropertyDefinitions(){const e=this._source.properties().childs(),t=this._source.name(),i=(0,ee.removeSpaces)(t),o=new q.TranslatedString(t,this._source.translatedType());return{definitions:[(0,Z.createColorPropertyDefinition)({checked:(0,Z.convertToDefinitionProperty)(this._propertyApplier,e.drawBackground,ie.format({title:o})),color:(0,Z.getColorDefinitionProperty)(this._propertyApplier,e.backgroundColor,null,oe.format({title:o}))},{id:(0,ee.removeSpaces)(`${t}BackgroundColor`),title:de}),(0,Z.createColorPropertyDefinition)({checked:(0,Z.convertToDefinitionProperty)(this._propertyApplier,e.drawBorder,re.format({title:o})),color:(0,Z.getColorDefinitionProperty)(this._propertyApplier,e.borderColor,null,ne.format({title:o}))},{id:(0,ee.removeSpaces)(`${t}BorderColor`),title:ae
}),(0,Z.createColorPropertyDefinition)({color:(0,Z.getColorDefinitionProperty)(this._propertyApplier,e.lineColor,null,te.format({title:o}))},{id:`${i}LineColor`,title:se})]}}_textPropertyDefinitions(){const{backgroundColor:e,borderColor:t,...i}=this._source.properties().childs();return{definitions:[(0,J.createTextStyleDefinition)(this._propertyApplier,{...i,textColor:i.textColor,fontSize:i.fontSize},new q.TranslatedString(this._source.name(),this._source.translatedType()),{isEditable:!0,isMultiLine:!0,customTitles:{text:le}})]}}}var ue=i(40472);class he{constructor(e,t){this._labelMovingDelta=null,this._line=e,this._itemIndex=t}startMoving(e,t,i){if(t===this._itemIndex){if(this._line.isSourceHidden())return!0;const i=(0,r.ensureDefined)(e.logical),o=this._line.points()[1];return this._labelMovingDelta={index:o.index-i.index,price:o.price-i.price},this._line.startChanging(t,i),!0}return this._labelMovingDelta=null,!1}move(e,t,i){if(null!==this._labelMovingDelta){const t=(0,r.ensureDefined)(e.logical),o={index:t.index+this._labelMovingDelta.index,price:t.price+this._labelMovingDelta.price};return this._line.setPoint(1,o,i),this._line.updateAllViews((0,ue.sourceChangeEvent)(this._line.id())),!0}return!1}endMoving(e,t,i){return null!==this._labelMovingDelta?(this._labelMovingDelta=null,this._line.endChanging(!1,e)):null}}class pe extends m.InplaceTextLineDataSource{constructor(e,t,i,o){super(e,t??pe.createProperties(e.backgroundTheme().spawnOwnership()),i,o),this._moveAsChangeBehavior=new he(this,W.Label),this._setPaneViews([new X(this,e,this._openTextEditor.bind(this),this._closeTextEditor.bind(this))])}pointsCount(){return 2}name(){return"Note"}removeIfEditableTextIsEmpty(){return!0}activateEditingOnCreation(){return!0}shouldBeRemovedOnDeselect(){const e=this._properties.childs().text.value().trim();return this._points.length===this.pointsCount()&&""===e}editableTextProperties(){const e=this.properties().childs();return{text:e.text,textColor:e.textColor}}template(){return this._properties.template()}startMoving(e,t,i){this._moveAsChangeBehavior.startMoving(e,t,i)||super.startMoving(e,t,i)}move(e,t,i){this._moveAsChangeBehavior.move(e,t,i)||super.move(e,t,i)}endMoving(e,t,i){return this._moveAsChangeBehavior.endMoving(e,t,i)??super.endMoving(e,t,i)}snapTo45DegreesAvailable(){return!0}static createProperties(e,t){const i=x.create(e,t);return this._configureProperties(i),i}async _getPropertyDefinitionsViewModelClass(){return ce}_createDataSourceBackgroundColorWV(){return(0,o.convertPropertyToWatchedValue)(this.properties().childs().backgroundColor).ownership()}}},70031:(e,t,i)=>{i.d(t,{factoryDefaultsForCurrentTheme:()=>a});var o=i(16738),r=i(90054),n=i(50151),l=i(45345),s=i(24633);function a(e,t){const i=l.watchedTheme.value()??s.StdTheme.Light,a=(0,r.default)(e);return(0,o.default)(a,(0,n.ensureDefined)(t.get(i))),a}}}]);