Files
ai/charting_library/bundles/line-tool-note.6e53fe29d7e3ecd0c498.js

9 lines
23 KiB
JavaScript

(self.webpackChunktradingview=self.webpackChunktradingview||[]).push([[8557],{2171:(e,t,o)=>{"use strict";o.d(t,{createTextStyleDefinition:()=>w});var i=o(91599),r=o(72769),n=o(73405),s=o(42897);const l=new r.TranslatedString("change {toolName} text visibility",i.t(null,void 0,o(67684))),a=new r.TranslatedString("change {toolName} text color",i.t(null,void 0,o(65304))),d=new r.TranslatedString("change {toolName} text font size",i.t(null,void 0,o(70052))),c=new r.TranslatedString("change {toolName} text font bold",i.t(null,void 0,o(75446))),h=new r.TranslatedString("change {toolName} text font italic",i.t(null,void 0,o(63944))),u=new r.TranslatedString("change {toolName} text",i.t(null,void 0,o(40382))),p=new r.TranslatedString("change {toolName} labels alignment vertical",i.t(null,void 0,o(28579))),g=new r.TranslatedString("change {toolName} labels alignment horizontal",i.t(null,void 0,o(81746))),f=new r.TranslatedString("change {toolName} labels direction",i.t(null,void 0,o(10377))),b=new r.TranslatedString("change {toolName} text background visibility",i.t(null,void 0,o(31397))),m=new r.TranslatedString("change {toolName} text background color",i.t(null,void 0,o(28838))),T=new r.TranslatedString("change {toolName} text border visibility",i.t(null,void 0,o(12379))),y=new r.TranslatedString("change {toolName} text border width",i.t(null,void 0,o(81802))),_=new r.TranslatedString("change {toolName} text border color",i.t(null,void 0,o(22174))),v=new r.TranslatedString("change {toolName} text wrap",i.t(null,void 0,o(55044))),x=i.t(null,void 0,o(36926)),C=i.t(null,void 0,o(69407)),S=i.t(null,void 0,o(41697)),P=i.t(null,void 0,o(3443));function w(e,t,o,i){const r={},w={id:`${(0,s.removeSpaces)(o.originalText())}Text`,title:i.customTitles&&i.customTitles.text||"",placeholder:i.placeholder??P};if(void 0===t.showText||i.hideTextCheckbox||(r.checked=(0,n.convertToDefinitionProperty)(e,t.showText,l.format({toolName:o}))),void 0!==t.textColor&&(r.color=(0,n.getColorDefinitionProperty)(e,t.textColor,t.transparency||null,a.format({toolName:o}))),void 0!==t.fontSize&&(r.size=(0,n.convertToDefinitionProperty)(e,t.fontSize,d.format({toolName:o}))),void 0!==t.bold&&(r.bold=(0,n.convertToDefinitionProperty)(e,t.bold,c.format({toolName:o}))),void 0!==t.italic&&(r.italic=(0,n.convertToDefinitionProperty)(e,t.italic,h.format({toolName:o}))),void 0!==t.text){const s=u.format({toolName:o});r.text=(0,n.convertToDefinitionProperty)(e,t.text,s,void 0),w.isEditable=Boolean(i.isEditable),w.isMultiLine=Boolean(i.isMultiLine)}if(void 0!==t.vertLabelsAlign&&(r.alignmentVertical=(0,n.convertToDefinitionProperty)(e,t.vertLabelsAlign,p.format({toolName:o})),w.alignmentVerticalItems=i.alignmentVerticalItems),void 0!==t.horzLabelsAlign&&(r.alignmentHorizontal=(0,n.convertToDefinitionProperty)(e,t.horzLabelsAlign,g.format({toolName:o})),w.alignmentHorizontalItems=i.alignmentHorizontalItems),void 0!==t.textOrientation&&(r.orientation=(0,n.convertToDefinitionProperty)(e,t.textOrientation,f.format({toolName:o}))),
void 0!==t.backgroundVisible&&(r.backgroundVisible=(0,n.convertToDefinitionProperty)(e,t.backgroundVisible,b.format({toolName:o}))),void 0!==t.backgroundColor){let i=null;void 0!==t.backgroundTransparency&&(i=t.backgroundTransparency),r.backgroundColor=(0,n.getColorDefinitionProperty)(e,t.backgroundColor,i,m.format({toolName:o}))}return void 0===t.backgroundVisible&&void 0===t.backgroundColor||(w.backgroundTitle=i.customTitles&&i.customTitles.backgroundTitle||x),void 0!==t.borderVisible&&(r.borderVisible=(0,n.convertToDefinitionProperty)(e,t.borderVisible,T.format({toolName:o}))),void 0!==t.borderWidth&&(r.borderWidth=(0,n.convertToDefinitionProperty)(e,t.borderWidth,y.format({toolName:o}))),void 0!==t.borderColor&&(r.borderColor=(0,n.getColorDefinitionProperty)(e,t.borderColor,null,_.format({toolName:o}))),void 0===t.borderVisible&&void 0===t.borderColor&&void 0===t.borderWidth||(w.borderTitle=i.customTitles&&i.customTitles.borderTitle||C),void 0!==t.wrap&&(r.wrap=(0,n.convertToDefinitionProperty)(e,t.wrap,v.format({toolName:o})),w.wrapTitle=i.customTitles&&i.customTitles.wrapTitle||S),(0,n.createTextPropertyDefinition)(r,w)}},44907:(e,t,o)=>{"use strict";o.r(t),o.d(t,{LineDataSourceDefinitionsViewModel:()=>_,LineDataSourceTabTypes:()=>i,pointPriceBarTitle:()=>y});var i,r=o(85842),n=o(91599),s=o(72769),l=(o(53225),o(73405)),a=o(18632),d=o(89659),c=o(5258),h=o(14405),u=o(78379),p=o(65366);!function(e){e.Visibility="visibility",e.Coordinates="coordinates",e.Style="style",e.Text="text",e.Inputs="inputs"}(i||(i={}));const g=n.t(null,void 0,o(87733)),f=n.t(null,void 0,o(18817)),b=n.t(null,void 0,o(31992)),m=n.t(null,void 0,o(79115)),T=n.t(null,void 0,o(2931)),y=n.t(null,{context:"linetool point"},o(59712));class _{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 u.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,l.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 o=this._createTextPropertyPage();null!==o&&this._propertyPages.push(o);const i=this._createCoordinatesPropertyPage();null!==i&&(i.visible=this._source.hasEditableCoordinates(),this._propertyPages.push(i));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 s.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,o=[],i=this._getYCoordinateStepWV();return e.forEach(((e,r)=>{const n=t[r].childs();n&&o.push((0,h.getCoordinatesPropertiesDefinitions)(this._propertyApplier,n,e,i,y.format({count:(r+1).toString()}),this._source.name()))})),{definitions:o}}_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",m):null}_textPropertyDefinitions(){return null}_createInputsPropertyPage(){const e=this._inputsPropertyDefinitions();return null!==e?(0,a.createPropertyPage)(e,"inputs",T):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)}}}},25432:(e,t,o)=>{"use strict";o.d(t,{commonLineToolPropertiesStateKeys:()=>i})
;const i=["symbolStateVersion","zOrderVersion","frozen","title","interval","symbol","currencyId","unitId","metricId","visible","adjustedToSplitTime","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,s;!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"}(s||(s={}))},86371:(e,t,o)=>{"use strict";o.d(t,{LineDataSourceProperty:()=>a});var i=o(57600),r=o(35558),n=o(85842),s=o(93445),l=o(47895);class a extends s.DefaultProperty{constructor({templateKeys:e,factoryDefaultsSupplier:t,...o}){let i=t;t&&(i=()=>{const e=t();return(0,l.applyDefaultsOverrides)(e,void 0,void 0,o.defaultName),e}),super({saveNonDefaultUserPreferencesOnly:!0,factoryDefaultsSupplier:i,...o}),this._templateKeys=(0,n.ensureDefined)(e||this._allDefaultsKeys)}template(){return(0,s.extractState)(this.state(),this._templateKeys,[])}applyTemplate(e){this.mergeAndFire((0,s.extractState)((0,r.default)((0,i.default)(this._factoryDefaultsSupplier()),e),this._templateKeys))}}},22268:(e,t,o)=>{"use strict";o.r(t),o.d(t,{LineToolNote:()=>le,LineToolNoteAbsolute:()=>ae});var i=o(33812),r=o(91599),n=o(72769),s=o(2171),l=o(44907),a=o(73405),d=o(42897);const c=new n.TranslatedString("change {title} background color",r.t(null,void 0,o(77582))),h=r.t(null,void 0,o(78011));class u extends l.LineDataSourceDefinitionsViewModel{_stylePropertyDefinitions(){const e=this._source.properties().childs(),t=this._source.name(),o=new n.TranslatedString(t,this._source.translatedType());return{definitions:[(0,a.createColorPropertyDefinition)({color:(0,a.getColorDefinitionProperty)(this._propertyApplier,e.markerColor,null,c.format({title:o}))},{id:(0,d.removeSpaces)(`${t}LabelColor`),title:h})]}}_textPropertyDefinitions(){const e=this._source.properties().childs();return{definitions:[(0,s.createTextStyleDefinition)(this._propertyApplier,{textColor:e.textColor,fontSize:e.fontSize,bold:e.bold,italic:e.italic,text:e.text,backgroundVisible:e.drawBackground,backgroundColor:e.backgroundColor,backgroundTransparency:e.backgroundTransparency,borderVisible:e.drawBorder,borderColor:e.borderColor},new n.TranslatedString(this._source.name(),this._source.translatedType()),{isEditable:!0,isMultiLine:!0})]}}}
var p,g,f=o(85842),b=o(11284),m=o(82347),T=o(31048),y=o(99680),_=o(71367),v=o(83077),x=o(14491),C=o(665),S=o(57268),P=o(8165),w=o(7919),D=o(7955),V=o(57415),k=o(91069),N=o(81458),M=o(91903),A=o(40450),L=o(64333),B=o(60525),W=o(35101);function I(e){const{ctx:t,renderingInfo:o,left:i,top:r,width:n,height:s,point:l,caretPos:a,mode:d}=e,{horizontalPixelRatio:c,verticalPixelRatio:h}=o,u=Math.max(1,Math.floor(c))%2/2,p=Math.round(l.x*c)+u,g=0===d?Math.max(1,1*Math.floor(c)):0,f=Math.round(i*c)+g/2,b=Math.round(r*h)+g/2,m=Math.round(s*h)-g,T=Math.round(n*c)-g,y=Math.round(12*c),_=Math.round(10*h),v=p-y/2,x=p+y/2,C=Math.atan(10/6),S=4*Math.cos(C),P=4*Math.sin(C),w=4*c;if(t.beginPath(),t.moveTo(f,b+w),t.arcTo(f,b,f+w,b,w),"top"===a){const e=b,o=b-_;t.lineTo(v-w,e),t.arcTo(v,e,v+S,e-P,w),t.lineTo(p-1.2*S,o+1.2*P),t.arcTo(p,o,p+1.2*S,o+1.2*P,1.2*S),t.lineTo(x-S,e-P),t.arcTo(x,e,x+w,e,w)}if(t.lineTo(f+T-w,b),t.arcTo(f+T,b,f+T,b+w,w),t.lineTo(f+T,b+m-w),t.arcTo(f+T,b+m,f+T-w,b+m,w),"bottom"===a){const e=b+m,o=e+_;t.lineTo(x+w,e),t.arcTo(x,e,x-S,e+P,w),t.lineTo(p+1.2*S,o-1.2*P),t.arcTo(p,o,p-1.2*S,o-1.2*P,1.2*S),t.lineTo(v+S,e+P),t.arcTo(v,e,v-w,e,w)}t.lineTo(f+w,b+m),t.arcTo(f,b+m,f,b+m-w,w),t.closePath()}!function(e){e[e.MinTooltipWidth=20]="MinTooltipWidth",e[e.TooltipMinWidth=236]="TooltipMinWidth",e[e.TooltipVertMargin=13]="TooltipVertMargin",e[e.TooltipHorzPadding=12]="TooltipHorzPadding",e[e.TooltipVertPadding=12]="TooltipVertPadding",e[e.TooltipLineSpacing=5]="TooltipLineSpacing",e[e.TooltipBorderLineWidth=1]="TooltipBorderLineWidth",e[e.TooltipBorderRadius=4]="TooltipBorderRadius",e[e.TooltipApexBorderRadiusCoeff=1.2]="TooltipApexBorderRadiusCoeff",e[e.CorrectPositionYDistance=10]="CorrectPositionYDistance",e[e.CorrectPositionXDistance=10]="CorrectPositionXDistance",e[e.CaretWidth=12]="CaretWidth",e[e.CaretHeight=10]="CaretHeight",e[e.NoCaretEdgeXDistance=24]="NoCaretEdgeXDistance",e[e.ShadowBlur=4]="ShadowBlur",e[e.ShadowOffsetX=0]="ShadowOffsetX",e[e.ShadowOffsetY=2]="ShadowOffsetY",e[e.SpaceBetweenMarkerAndTooltipTolerance=8]="SpaceBetweenMarkerAndTooltipTolerance"}(p||(p={})),function(e){e[e.Stroke=0]="Stroke",e[e.Fill=1]="Fill"}(g||(g={}));const R=(0,L.svgRenderer)(W);class z{constructor(e){this._data=null,this._tooltipHitTest=new v.HitTestResult(v.HitTarget.MovePoint,{...e,areaName:v.AreaName.Text})}setData(e){this._data=e}setCursorType(e){this._tooltipHitTest.mergeData({cursorType:e})}draw(e,t){if(null===this._data)return;const{horizontalPixelRatio:o,verticalPixelRatio:i}=t,r=Math.max(1,Math.floor(o))%2/2,n=Math.max(1,Math.floor(i))%2/2,{point:s,markerColor:l}=this._data,a=Math.round(s.x*o)+r,d=Math.round(s.y*i)+n,c=R.viewBox();e.fillStyle=l,R.render(e,{targetViewBox:{x:a-o*c.width/2,y:d-o*c.height,width:o*c.width,height:o*c.height},doNotApplyColors:!0}),this._data.tooltipVisible&&this._drawTooltipOn(e,t)}hitTest(e,t){if(null!==this._data){const{point:t,left:o,top:i,width:r,height:n,tooltipVisible:s}=this._data,l=t.x,a=t.y,d=R.viewBox(),c=(0,V.box)((0,V.point)(l-d.width/2,a-d.height),(0,V.point)(l+d.width/2,a))
;if((0,k.pointInBox)(e,c))return new v.HitTestResult(v.HitTarget.MovePoint);if(s){const t=(0,V.box)((0,V.point)(o,i),(0,V.point)(o+r,i+n));if((0,k.pointInBox)(e,t))return this._tooltipHitTest;const s=t.min.y<c.min.y?t.max.y:c.max.y,l=t.min.y<c.min.y?c.min.y:t.min.y,a=(0,V.box)((0,V.point)(c.min.x-8,s),(0,V.point)(c.max.x+8,l));if((0,k.pointInBox)(e,a))return new v.HitTestResult(v.HitTarget.MovePoint)}}return null}getTextInfo(){const{font:e,fontSize:t,width:o,left:i,top:r,height:n,lineSpacing:s}=(0,f.ensureNotNull)(this._data);return{font:e,fontSize:t,lineHeight:t,lineSpacing:s,textTop:r+12,textBottom:r+n-12,textLeft:i+12,textRight:i+o-12,textAlign:(0,N.isRtl)()?"right":"left"}}positionToCoordinate(e,t){const o=(0,f.ensureNotNull)(this._data),i=this.getTextInfo(),{x:r,y:n,lineNumber:s}=(0,B.getSymbolCoordinatesInfo)({symbolPosition:t,textWidth:i.textRight-i.textLeft,textByLines:o.linesIncludingHidden,lineHeight:o.fontSize,lineSpacing:o.lineSpacing,font:o.font,textAlign:i.textAlign});return{x:r+i.textLeft,y:n+i.textTop,lineNumber:s}}_drawTooltipOn(e,t){e.save();const o=(0,f.ensureNotNull)(this._data),{point:i,textColor:r,font:n,fontSize:s,backgroundColor:l,borderColor:a,boxShadowColor:d,width:c,textWidth:h,left:u,top:p,height:g,lineSpacing:b,caretPos:m,lines:T,selectionHighlight:y}=o;e.font=n;const{horizontalPixelRatio:_,verticalPixelRatio:v}=t;if(l){e.fillStyle=l;let o=!1;d&&(e.save(),e.shadowColor=d,e.shadowBlur=4,e.shadowOffsetX=0,e.shadowOffsetY=2,o=!0),I({ctx:e,renderingInfo:t,left:u,top:p,width:c,height:g,point:i,caretPos:m,mode:1}),e.fill(),o&&e.restore()}a&&(e.lineWidth=Math.max(1,1*Math.floor(_)),e.strokeStyle=a,I({ctx:e,renderingInfo:t,left:u,top:p,width:c,height:g,point:i,caretPos:m,mode:0}),e.stroke()),e.textBaseline="middle",e.fillStyle=r,e.textAlign=(0,N.isRtl)()?"right":"left";const x=u+12+(0,M.calcTextHorizontalShift)(e,h);let C=p+12+s/2;(0,M.drawScaled)(e,_,v,(()=>{if(y){const t=this.positionToCoordinate(!1,y.start),i=this.positionToCoordinate(!1,y.end),r=this.getTextInfo();(0,B.drawSelection)(e,A.dpr1PixelRatioInfo,{lines:o.linesIncludingHidden,selectionStart:t,selectionEnd:i,left:r.textLeft,right:r.textRight,color:y.color,font:n,lineHeight:s,lineSpacing:b})}for(const t of T)e.fillText(t,x,C),C+=s+b})),e.restore()}}const H=(0,m.generateColor)((0,b.getHexColorByName)("color-black"),80),F=(0,m.generateColor)((0,b.getHexColorByName)("color-black"),60);class O extends w.InplaceTextLineSourcePaneView{constructor(e,t,o,i){super(e,t,o,i),this._renderer=null,this._textWidthCache=new S.TextWidthCache,this._wordWrap=(0,C.wordWrapCached)(),this._noteRenderer=new z((0,D.inplaceEditHandlers)(this._tryActivateEditMode.bind(this,null))),this._source.setAdditionalCursorData((()=>({color:this._source.editableTextStyle().cursorColor,...this._noteRenderer.getTextInfo()})),this._noteRenderer.positionToCoordinate.bind(this._noteRenderer,!0))}isLabelVisible(){return this.isHoveredSource()||this.isSelectedSource()}renderer(e){return this._invalidated&&this._updateImpl(e),this._renderer}_updateImpl(e){super._updateImpl(e),
this._renderer=null;const t=this._getSource();if(!this._points||this._source.isFixed()&&void 0===t.fixedPoint())return;const o=this._source.isFixed()?[(0,f.ensureDefined)(t.fixedPoint())]:this._points;if(o.length<1)return;const i=new y.CompositeRenderer,r=this.isLabelVisible(),n=this._source.properties().childs(),s=(0,T.makeFont)(n.fontSize.value(),x.CHART_FONT_FAMILY,n.italic.value()?"italic":void 0,n.bold.value()?"bold":void 0);let l,a;n.drawBackground.value()&&(l=(0,m.generateColor)(n.backgroundColor.value(),n.backgroundTransparency.value()),a=this._model.dark().value()?F:H);const d=Math.min(236,e.mediaSize.width),c=d-24,h=o[0],{mediaSize:u}=e,p=r?this._wordWrap(this._textData(),s,this._textWidthCache,!1,c):[],g=p.filter((e=>!e.hidden)).map((e=>e.text)),b=n.fontSize.value();let C=g.length*b+24;g.length>1&&(C+=5*(g.length-1));let S=Math.round(h.x-d/2);const w=R.viewBox();let D=Math.round(h.y-w.height-C-13);const V=h.x<24||h.x+24>u.width;let k=V?null:"top";D<10?D=h.y+13:V||(k="bottom"),S<10?S=10:S+d+10>u.width&&(S=u.width-d-10),this._noteRenderer.setData({linesIncludingHidden:p,lines:g,font:s,fontSize:b,backgroundColor:l,boxShadowColor:a,borderColor:n.drawBorder.value()?n.borderColor.value():void 0,textColor:this._textColor(),markerColor:n.markerColor.value(),point:h,tooltipVisible:r,width:d,height:C,left:S,top:D,caretPos:k,lineSpacing:5,textWidth:c,...this._inplaceTextHighlight()}),this._noteRenderer.setCursorType(this._textCursorType()),this._updateInplaceText(this._noteRenderer.getTextInfo()),i.append(this._noteRenderer),i.append(new _.SelectionRenderer({points:o.map(P.mapLineSourcePaneViewPointToLineAnchorPoint),bgColors:this._lineAnchorColors(o),visible:this.areAnchorsVisible(),barSpacing:this._model.timeScale().barSpacing(),hittestResult:v.HitTarget.MovePoint})),this._renderer=i}}var E=o(11624),K=o(85067),Y=o(68657),X=o(63212),$=o(47097),G=o(22384),Z=o(93445),j=o(17567),U=o(25432),q=o(86371);const J={intervalsVisibilities:{...o(88483).intervalsVisibilitiesDefaults},fontSize:14,bold:!1,italic:!1,drawBackground:!0,drawBorder:!1},Q=new Map([[$.StdTheme.Light,{textColor:b.colorsPalette["color-cold-gray-900"],backgroundColor:b.colorsPalette["color-white"],backgroundTransparency:0,borderColor:b.colorsPalette["color-cold-gray-150"],markerColor:b.colorsPalette["color-tv-blue-500"]}],[$.StdTheme.Dark,{textColor:b.colorsPalette["color-cold-gray-200"],backgroundColor:b.colorsPalette["color-cold-gray-800"],backgroundTransparency:0,borderColor:b.colorsPalette["color-cold-gray-700"],markerColor:b.colorsPalette["color-tv-blue-500"]}]]),ee=(0,Z.extractThemedColors)((0,f.ensureDefined)(Q.get($.StdTheme.Light)),(0,f.ensureDefined)(Q.get($.StdTheme.Dark))),te=(0,Z.extractAllPropertiesKeys)((0,f.ensureDefined)(Q.get($.StdTheme.Light))),oe=(0,Z.extractAllPropertiesKeys)(J),ie=[...new Set([...te,...oe,...U.commonLineToolPropertiesStateKeys,"text","anchored"])],re=[...new Set([...te,...oe,"text"])];class ne extends q.LineDataSourceProperty{constructor(e,t){super(t),this.hasChild("text")||this.addProperty("text",""),
t.state?.anchored||this.addChild("anchored",new G.Property(e))}static create(e,t,o,i){return new this(t,{defaultName:e,factoryDefaultsSupplier:()=>(0,j.factoryDefaultsForCurrentTheme)(J,Q),nonThemedDefaultsKeys:oe,themedDefaultsKeys:te,allStateKeys:ie,themedColors:ee,templateKeys:re,replaceThemedColorsOnThemeChange:!0,state:i,theme:o})}}var se;!function(e){e[e.Version=1]="Version"}(se||(se={}));class le extends X.InplaceTextLineDataSource{constructor(e,t,o,i){const r=t??le.createProperties(e.backgroundTheme().spawnOwnership());super(e,r,o,i),this.version=1,this._setPaneViews([new O(this,this._model,this._openTextEditor.bind(this),this._closeTextEditor.bind(this))]),r.childs().anchored.subscribe(this,this._onAnchoredChange.bind(this)),this._hasEditableCoordinates=(0,Y.combine)((e=>!e),(0,K.createWVFromProperty)(this.properties().childs().anchored).ownership())}destroy(){this._hasEditableCoordinates.destroy(),super.destroy()}pointsCount(){return 1}name(){return"Pin"}isFixed(){return this._properties.childs().anchored.value()}anchorable(){return!0}template(){return this._properties.template()}activateEditingOnCreation(){return!0}editableTextProperties(){const e=this.properties().childs();return{text:e.text,textColor:e.textColor}}static createProperties(e,t){null!=t&&void 0!==t.markerColor&&void 0===t.borderColor&&(t.borderColor=t.markerColor);const o=ne.create(this._defaultsKey(),this._anchoredDefaultValue(),e,t);return this._configureProperties(o),o}_normalizePoint(e,t){return super._normalizePointWithoutOffset(e)??super._normalizePoint(e,t)}async _getPropertyDefinitionsViewModelClass(){return u}_createDataSourceBackgroundColorWV(){const e=(0,i.generateColorCached)(),{backgroundColor:t,backgroundTransparency:o}=this.properties().childs();return(0,Y.combine)(((t,o)=>e(t,o)),(0,E.convertPropertyToWatchedValue)(t).ownership(),(0,E.convertPropertyToWatchedValue)(o).ownership()).ownership()}static _defaultsKey(){return"linetoolnote"}static _anchoredDefaultValue(){return!1}}class ae extends le{constructor(e,t,o,i){super(e,t??ae.createProperties(e.backgroundTheme().spawnOwnership()),o,i)}name(){return"Anchored Note"}static _defaultsKey(){return"linetoolnoteabsolute"}static _anchoredDefaultValue(){return!0}}},17567:(e,t,o)=>{"use strict";o.d(t,{factoryDefaultsForCurrentTheme:()=>a});var i=o(35558),r=o(57600),n=o(85842),s=o(49841),l=o(47097);function a(e,t){const o=s.watchedTheme.value()??l.StdTheme.Light,a=(0,r.default)(e);return(0,i.default)(a,(0,n.ensureDefined)(t.get(o))),a}},33812:(e,t,o)=>{"use strict";o.d(t,{generateColorCached:()=>s});var i=o(4003),r=o(82347),n=o(19050);function s(e=1e3){const t=i.default.Cache;i.default.Cache=n.CircularCacheBuffer.bind(n.CircularCacheBuffer,e);const o=(0,i.default)(r.generateColor,((e,t,o)=>`${e}_${t}_${o}`));return i.default.Cache=t,o}},35101:e=>{
e.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 30" width="24" height="30"><path fill="#2962FF" fill-rule="evenodd" d="m12 30 .88-.77C20.25 22.73 24 17.07 24 12.09 24 5.04 18.54 0 12 0S0 5.04 0 12.1c0 4.97 3.75 10.64 11.12 17.13L12 30Zm0-13a5 5 0 1 0 0-10 5 5 0 0 0 0 10Z"/></svg>'}}]);