Files
ai/charting_library/bundles/line-tool-triangle-pattern.96d7b59be6ef6920626a.js

7 lines
20 KiB
JavaScript

"use strict";(self.webpackChunktradingview=self.webpackChunktradingview||[]).push([[1632],{25432:(e,t,i)=>{i.d(t,{commonLineToolPropertiesStateKeys:()=>n});const n=["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,o,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"}(o||(o={})),function(e){e.FloatingToolbarButton="FloatingToolbarButton",e.Default="Default"}(s||(s={}))},41928:(e,t,i)=>{i.d(t,{LineSourcePaneView:()=>y,anchorResizeCursorType:()=>g,createLineSourcePaneViewPoint:()=>_});var n=i(11284),r=i(85842),o=i(29968),s=i(83077),a=i(71367),l=i(8165),h=i(28031),d=i(61208);const c=n.colorsPalette["color-tv-blue-600"];var u,p;function g(e,t){const i=e.x-t.x,n=e.y-t.y;if(!Number.isFinite(i)||!Number.isFinite(n)||0===i&&0===n)return h.PaneCursorType.Default;let o=Math.atan2(n,i);return o<0&&(o+=2*Math.PI),o>=p.deg337_5||o<p.deg22_5||o>=p.deg157_5&&o<p.deg202_5?h.PaneCursorType.HorizontalResize:o>=p.deg22_5&&o<p.deg67_5||o>=p.deg202_5&&o<p.deg247_5?h.PaneCursorType.DiagonalNwSeResize:o>=p.deg67_5&&o<p.deg112_5||o>=p.deg247_5&&o<p.deg292_5?h.PaneCursorType.VerticalResize:o>=p.deg112_5&&o<p.deg157_5||o>=p.deg292_5&&o<p.deg337_5?h.PaneCursorType.DiagonalNeSwResize:void(0,r.assert)(!1,"unexpected angle")}function _(e,t){return e.pointIndex=t,e}!function(e){e[e.RegularAnchorRadius=6]="RegularAnchorRadius",e[e.TouchAnchorRadius=13]="TouchAnchorRadius",e[e.RegularStrokeWidth=1]="RegularStrokeWidth",e[e.TouchStrokeWidth=3]="TouchStrokeWidth",e[e.RegularSelectedStrokeWidth=3]="RegularSelectedStrokeWidth",e[e.TouchSelectedStrokeWidth=0]="TouchSelectedStrokeWidth"}(u||(u={})),function(e){e[e.deg22_5=Math.PI/8]="deg22_5",e[e.deg67_5=3*Math.PI/8]="deg67_5",e[e.deg112_5=5*Math.PI/8]="deg112_5",e[e.deg157_5=7*Math.PI/8]="deg157_5",e[e.deg202_5=9*Math.PI/8]="deg202_5",e[e.deg247_5=11*Math.PI/8]="deg247_5",e[e.deg292_5=13*Math.PI/8]="deg292_5",e[e.deg337_5=15*Math.PI/8]="deg337_5"}(p||(p={}));class y{constructor(e,t,i){this._invalidated=!0,this._points=[],this._middlePoint=null,this._selectionRenderers=[],this._lineAnchorRenderers=[],this._source=e,this._model=t,this._ownerSource=i??null}priceToCoordinate(e){const t=this._getOwnerSource(),i=t?.priceScale()
;if(null==i)return null;const n=null!==t?t.firstValue():null;return null===n?null:i.priceToCoordinate(e,n)}anchorColor(){return c}isHoveredSource(){return this._source===this._model.hoveredSource()}isSelectedSource(){return this._model.selection().isSelected(this._source)}isBeingEdited(){return this._model.lineBeingEdited()===this._source}isEditMode(){return!this._model.isSnapshot()}areAnchorsVisible(){return(this.isHoveredSource()&&!this.isLocked()||this.isSelectedSource())&&this.isEditMode()}update(){this._invalidated=!0}isLocked(){return Boolean(this._source.isLocked&&this._source.isLocked())}addAnchors(e,t={}){let i=this._getPoints();this._model.lineBeingCreated()===this._source&&(i=i.slice(0,-1));const n=this._source.points(),r=i.map(((e,t)=>{const i=n[t],r=(0,l.lineSourcePaneViewPointToLineAnchorPoint)(e);return i&&(r.snappingPrice=i.price,r.snappingIndex=i.index),r}));e.append(this.createLineAnchor({...t,points:r},0))}createLineAnchor(e,t){const i=e.points.map((e=>e.point)),n=this._getOwnerSource();if(this.isLocked()){const r=this._getSelectionRenderer(t);return r.setData({bgColors:this._lineAnchorColors(i),points:e.points,visible:this.areAnchorsVisible(),hittestResult:s.HitTarget.Regular,ownerSourceId:n?.id(),barSpacing:this._model.timeScale().barSpacing()}),r}const r=(0,o.lastMouseOrTouchEventInfo)().isTouch,a=this._getLineAnchorRenderer(t),l=this.isHoveredSource()?this._model.lastHittestData()?.pointIndex??null:null;return a.setData({...e,color:this.anchorColor(),backgroundColors:this._lineAnchorColors(i),hoveredPointIndex:l,linePointBeingEdited:this.isBeingEdited()?this._model.linePointBeingEdited():null,radius:this._anchorRadius(),strokeWidth:r?u.TouchStrokeWidth:u.RegularStrokeWidth,selected:this.isSelectedSource(),selectedStrokeWidth:r?u.TouchSelectedStrokeWidth:u.RegularSelectedStrokeWidth,visible:this.areAnchorsVisible(),clickHandler:e.clickHandler,ownerSourceId:n?.id()}),a}_getOwnerSource(){return this._ownerSource??this._source.ownerSource()}_anchorRadius(){return(0,o.lastMouseOrTouchEventInfo)().isTouch?u.TouchAnchorRadius:u.RegularAnchorRadius}_lineAnchorColors(e){const t=(0,r.ensureNotNull)(this._model.paneForSource(this._source)).height();return e.map((e=>this._model.backgroundColorAtYPercentFromTop(e.y/t)))}_updateImpl(e){this._points=[];this._model.timeScale().isEmpty()||this._validatePriceScale()&&(this._source.points().forEach(((e,t)=>{const i=this._source.pointToScreenPoint(e,this._ownerSource??void 0);i&&this._points.push(_(i,t))})),2===this._points.length&&(this._middlePoint=this._source.calcMiddlePoint(this._points[0],this._points[1])),this._invalidated=!1)}_validatePriceScale(){const e=this._getOwnerSource()?.priceScale();return null!=e&&!e.isEmpty()}_getSource(){return this._source}_getPoints(){return this._points}_getModel(){return this._model}_height(){const e=this._getOwnerSource()?.priceScale();return null!=e?e.height():0}_width(){return this._model.timeScale().width()}_needLabelExclusionPath(e,t){const i=this._source.properties().childs()
;return"middle"===(t??i.vertLabelsAlign.value())&&(0,d.needTextExclusionPath)(e)}_addAlertRenderer(e,t,i=this._source.properties().linecolor.value()){}_getAlertRenderer(e){return null}_getSelectionRenderer(e){for(;this._selectionRenderers.length<=e;)this._selectionRenderers.push(new a.SelectionRenderer);return this._selectionRenderers[e]}_getLineAnchorRenderer(e){for(;this._lineAnchorRenderers.length<=e;)this._lineAnchorRenderers.push(new l.LineAnchorRenderer);return this._lineAnchorRenderers[e]}}},86371:(e,t,i)=>{i.d(t,{LineDataSourceProperty:()=>l});var n=i(57600),r=i(35558),o=i(85842),s=i(93445),a=i(47895);class l extends s.DefaultProperty{constructor({templateKeys:e,factoryDefaultsSupplier:t,...i}){let n=t;t&&(n=()=>{const e=t();return(0,a.applyDefaultsOverrides)(e,void 0,void 0,i.defaultName),e}),super({saveNonDefaultUserPreferencesOnly:!0,factoryDefaultsSupplier:n,...i}),this._templateKeys=(0,o.ensureDefined)(e||this._allDefaultsKeys)}template(){return(0,s.extractState)(this.state(),this._templateKeys,[])}applyTemplate(e){this.mergeAndFire((0,s.extractState)((0,r.default)((0,n.default)(this._factoryDefaultsSupplier()),e),this._templateKeys))}}},32388:(e,t,i)=>{i.r(t),i.d(t,{LineToolTrianglePattern:()=>B});var n=i(82014),r=i(85842),o=i(11284),s=i(47097),a=i(17567),l=i(93445),h=i(33993),d=i(5829),c=i(88483),u=i(25432),p=i(86371);const g=(0,o.getHexColorByName)("color-deep-blue-500"),_=(0,o.getHexColorByName)("color-white"),y={intervalsVisibilities:{...c.intervalsVisibilitiesDefaults},fillBackground:!0,fontsize:12,bold:!1,italic:!1,linewidth:d.DEFAULT_LINE_TOOL_LINE_WIDTH},f={color:g,textcolor:_,backgroundColor:g,transparency:85},x=new Map([[s.StdTheme.Light,f],[s.StdTheme.Dark,f]]),P=(0,l.extractThemedColors)((0,r.ensureDefined)(x.get(s.StdTheme.Light)),(0,r.ensureDefined)(x.get(s.StdTheme.Dark))),w=(0,l.extractAllPropertiesKeys)((0,r.ensureDefined)(x.get(s.StdTheme.Light))),m=(0,l.extractAllPropertiesKeys)(y),T=[...w,...m],S=[...new Set([...T,...u.commonLineToolPropertiesStateKeys])];class v extends p.LineDataSourceProperty{constructor(e){super(e),this.addChild("linesColors",new h.LineToolColorsProperty([this.childs().color])),this.addChild("textsColors",new h.LineToolColorsProperty([this.childs().textcolor])),this.addChild("backgroundsColors",new h.LineToolColorsProperty([this.childs().backgroundColor]))}static create(e,t){return new this({defaultName:"linetooltrianglepattern",factoryDefaultsSupplier:()=>(0,a.factoryDefaultsForCurrentTheme)(y,x),nonThemedDefaultsKeys:m,themedDefaultsKeys:w,allStateKeys:S,themedColors:P,templateKeys:T,replaceThemedColorsOnThemeChange:!0,state:t,theme:e})}}var b=i(57415),M=i(80140),R=i(95385),L=i(99680),I=i(6353),A=i(93489),D=i(61208),k=i(68459),C=i(41928),V=i(14491);class E extends C.LineSourcePaneView{constructor(){super(...arguments),this._trendLineRendererPoints01=new I.TrendLineRenderer,this._trendLineRendererPoints12=new I.TrendLineRenderer,this._trendLineRendererPoints23=new I.TrendLineRenderer,this._intersectionRenderer=new A.TriangleRenderer,
this._aLabelRenderer=new D.TextRenderer,this._bLabelRenderer=new D.TextRenderer,this._cLabelRenderer=new D.TextRenderer,this._dLabelRenderer=new D.TextRenderer,this._renderer=null}renderer(e){return this._invalidated&&this._updateImpl(e),this._renderer}_updateImpl(e){super._updateImpl(e),this._renderer=null;const[t,i,n,o]=this._points;let s,a,l;if(4===this._points.length){if(Math.abs(n.x-t.x)<1||Math.abs(o.x-i.x)<1)return;let e=Math.min(t.x,i.x);e=Math.min(e,n.x),e=Math.min(e,o.x);const r=(n.y-t.y)/(n.x-t.x),h=t.y+(e-t.x)*r,d=(o.y-i.y)/(o.x-i.x),c=i.y+(e-i.x)*d;if(Math.abs(r-d)<1e-6)return;a=new b.Point(e,h),l=new b.Point(e,c);const u=(i.y-t.y+(t.x*r-i.x*d))/(r-d);if(u<e){let e=Math.max(t.x,i.x);e=Math.max(e,n.x),e=Math.max(e,o.x),a=new b.Point(e,t.y+(e-t.x)*r),l=new b.Point(e,i.y+(e-i.x)*d)}const p=t.y+(u-t.x)*r;s=new b.Point(u,p)}if(this._points.length<2)return;const h=this._source.properties().childs(),d=new L.CompositeRenderer,c=(e,t)=>({points:[e],text:t,color:h.textcolor.value(),vertAlign:R.VerticalAlign.Middle,horzAlign:R.HorizontalAlign.Center,font:V.CHART_FONT_FAMILY,offsetX:0,offsetY:0,bold:h.bold&&h.bold.value(),italic:h.italic&&h.italic.value(),fontsize:h.fontsize.value(),backgroundColor:h.color.value(),backgroundRoundRect:4}),u=(e,t)=>({points:[e,t],color:h.color.value(),linewidth:h.linewidth.value(),linestyle:M.LINESTYLE_SOLID,extendleft:!1,extendright:!1,leftend:k.LineEnd.Normal,rightend:k.LineEnd.Normal});if(this._trendLineRendererPoints01.setData(u(t,i)),d.append(this._trendLineRendererPoints01),this._points.length>=3&&(this._trendLineRendererPoints12.setData(u(i,n)),d.append(this._trendLineRendererPoints12)),4===this._points.length&&(this._trendLineRendererPoints23.setData(u(n,o)),d.append(this._trendLineRendererPoints23),s)){const e={points:[(0,r.ensureDefined)(a),(0,r.ensureDefined)(l),s],color:h.color.value(),linewidth:h.linewidth.value(),backcolor:h.backgroundColor.value(),fillBackground:h.fillBackground.value(),transparency:h.transparency.value(),linestyle:M.LINESTYLE_DOTTED};this._intersectionRenderer.setData(e),d.append(this._intersectionRenderer)}const p=c(t,"A");i.y>t.y?(p.vertAlign=R.VerticalAlign.Bottom,p.offsetY=5):(p.vertAlign=R.VerticalAlign.Top,p.offsetY=5),this._aLabelRenderer.setData(p),d.append(this._aLabelRenderer);const g=c(i,"B");if(i.y<t.y?(g.vertAlign=R.VerticalAlign.Bottom,g.offsetY=5):(g.vertAlign=R.VerticalAlign.Top,g.offsetY=5),this._bLabelRenderer.setData(g),d.append(this._bLabelRenderer),this._points.length>2){const e=c(n,"C");n.y<i.y?(e.vertAlign=R.VerticalAlign.Bottom,e.offsetY=5):(e.vertAlign=R.VerticalAlign.Top,e.offsetY=5),this._cLabelRenderer.setData(e),d.append(this._cLabelRenderer)}if(this._points.length>3){const e=c(o,"D");o.y<n.y?(e.vertAlign=R.VerticalAlign.Bottom,e.offsetY=5):(e.vertAlign=R.VerticalAlign.Top,e.offsetY=5),this._dLabelRenderer.setData(e),d.append(this._dLabelRenderer)}this.addAnchors(d),this._renderer=d}}class B extends n.LineDataSource{constructor(e,t,i,n){super(e,t??B.createProperties(e.backgroundTheme().spawnOwnership()),i,n),
this._setPaneViews([new E(this,e)])}pointsCount(){return 4}name(){return"Triangle Pattern"}static createProperties(e,t){const i=v.create(e,t);return this._configureProperties(i),i}_getPropertyDefinitionsViewModelClass(){return Promise.all([i.e(1982),i.e(7686),i.e(2428),i.e(3920),i.e(9328)]).then(i.bind(i,57207)).then((e=>e.PatternWithBackgroundDefinitionViewModel))}}},80071:(e,t,i)=>{i.d(t,{intersectLineWithViewport:()=>s});var n=i(57415);function r(e,t,i){return e>=t&&e<=i?e:null}function o(e,t,i,n){return Math.sign(e.x-t.x)===Math.sign(i.x-n.x)&&Math.sign(e.y-t.y)===Math.sign(i.y-n.y)}function s(e,t,i,s,a,l,h){const d=e.x>=0&&e.x<=a&&e.y>=0&&e.y<=l,c=t.x>=0&&t.x<=a&&t.y>=0&&t.y<=l;if(d&&c&&!i&&!s)return[e,t];if(e.x<0&&t.x<0&&(e.x<t.x?!s:!i)||e.x>a&&t.x>a&&(e.x<t.x?!i:!s)||e.y<0&&t.y<0&&(e.y<t.y?!s:!i)||e.y>l&&t.y>l&&(e.y<t.y?!i:!s))return null;const u=[];if(e.x===t.x){if(e.x<0||e.x>a)return null;e.y<t.y?u.push(new n.Point(e.x,0===h?0:e.y<0?e.y%h:-(h-e.y%h)),new n.Point(t.x,l)):u.push(new n.Point(e.x,0===h?l:e.y>l?l+(e.y-l)%h:l+(h-(l-e.y)%h)),new n.Point(t.x,0))}else if(e.y===t.y){if(e.y<0||e.y>l)return null;e.x<t.x?u.push(new n.Point(0===h?0:e.x<0?e.x%h:-(h-e.x%h),e.y),new n.Point(a,t.y)):u.push(new n.Point(0===h?a:e.x>a?a+(e.x-a)%h:a+(h-(a-e.x)%h),e.y),new n.Point(0,t.y))}else{const o=(t.y-e.y)/(t.x-e.x),s=e.y-o*e.x;let d=0,c=0;const p=r(s,0,l);if(null!==p)if(h>0&&(e.x<=0||i&&e.x<t.x)){const t=e.x<=0?Math.sqrt(Math.pow(0-e.x,2)+Math.pow(p-e.y,2))%h:h-Math.sqrt(Math.pow(0-e.x,2)+Math.pow(p-e.y,2))%h;d=Math.cos(Math.atan(o))*t,c=o*d,u.push(new n.Point(-d,p-c))}else u.push(new n.Point(0,p));const g=r(o*a+s,0,l);if(null!==g)if(h>0&&(e.x>=a||i&&e.x>t.x)){const t=e.x>=a?Math.sqrt(Math.pow(e.x-a,2)+Math.pow(e.y-g,2))%h:h-Math.sqrt(Math.pow(e.x-a,2)+Math.pow(e.y-g,2))%h;d=Math.cos(Math.atan(o))*t,c=o*d,u.push(new n.Point(a+d,g+c))}else u.push(new n.Point(a,g));const _=r(-s/o,0,a);if(null!==_&&(0!==_||0!==p))if(h>0&&(e.y<=0||i&&e.y<t.y)){const t=e.y<=0?Math.sqrt(Math.pow(e.x-_,2)+Math.pow(e.y-0,2))%h:h-Math.sqrt(Math.pow(e.x-_,2)+Math.pow(e.y-0,2))%h;d=Math.cos(Math.atan(o))*t,c=o*d,u.push(new n.Point(_-Math.sign(o)*d,-Math.sign(o)*c))}else u.push(new n.Point(_,0));const y=r((l-s)/o,0,a);if(null!==y&&(0!==y||g!==l))if(h>0&&(e.y>=l||i&&e.y>t.y)){const t=e.y>=l?Math.sqrt(Math.pow(e.x-y,2)+Math.pow(e.y-l,2))%h:h-Math.sqrt(Math.pow(e.x-y,2)+Math.pow(e.y-l,2))%h;d=Math.cos(Math.atan(o))*t,c=o*d,u.push(new n.Point(y+Math.sign(o)*d,l+Math.sign(o)*c))}else u.push(new n.Point(y,l))}if(u.length<1)return null;if(u.length<2&&u.push(u[0]),!i&&d){return[e,o(u[0],u[1],e,t)?u[1]:u[0]]}if(!s&&c){return[o(u[0],u[1],e,t)?u[0]:u[1],t]}return o(u[0],u[1],e,t)?[u[0],u[1]]:[u[1],u[0]]}},8165:(e,t,i)=>{i.d(t,{LineAnchorRenderer:()=>f,lineSourcePaneViewPointToLineAnchorPoint:()=>x,lineSourcePaneViewPointToLineAnchorPoint2:()=>P,mapLineSourcePaneViewPointToLineAnchorPoint:()=>w});var n=i(57415),r=i(91069),o=i(85842),s=i(51946),a=i(7321),l=i(83077),h=i(28031),d=i(72244),c=i(57507);function u(e,t,i,n){const{point:r}=t,o=i+n/2;(0,
s.drawRoundRect)(e,r.x-o,r.y-o,2*o,2*o,(i+n)/2),e.closePath(),e.lineWidth=n}function p(e,t,i,n){e.globalAlpha=.2,u(e,t,i,n),e.stroke(),e.globalAlpha=1}function g(e,t,i,n){u(e,t,i-n,n),e.fill(),e.stroke()}function _(e,t,i,n){const{point:r}=t;e.globalAlpha=.2,e.beginPath(),e.arc(r.x,r.y,i+n/2,0,2*Math.PI,!0),e.closePath(),e.lineWidth=n,e.stroke(),e.globalAlpha=1}function y(e,t,i,n){const{point:r}=t;e.beginPath(),e.arc(r.x,r.y,i-n/2,0,2*Math.PI,!0),e.closePath(),e.lineWidth=n,e.fill(),e.stroke()}class f extends c.BitmapCoordinatesPaneRenderer{constructor(e){super(),this._data=e??null}setData(e){this._data=e}hitTest(e){if(null===this._data||this._data.disableInteractions)return null;const{radius:t,points:i}=this._data,n=t+(0,d.interactionTolerance)().anchor;for(const t of i){if(t.point.subtract(e).length()<=n)return new l.HitTestResult(t.hitTarget??l.HitTarget.ChangePoint,{areaName:l.AreaName.AnchorPoint,pointIndex:t.pointIndex,cursorType:t.cursorType??h.PaneCursorType.Default,activeItem:t.activeItem,snappingPrice:t.snappingPrice,snappingIndex:t.snappingIndex,nonDiscreteIndex:t.nonDiscreteIndex,possibleMovingDirections:t.possibleMovingDirections,clickHandler:this._data.clickHandler,tapHandler:this._data.clickHandler,ownerSourceId:this._data.ownerSourceId})}return null}doesIntersectWithBox(e){return null!==this._data&&this._data.points.some((t=>(0,r.pointInBox)(t.point,e)))}_drawImpl(e){if(null===this._data||!this._data.visible)return;const t=[],i=[],n=[],r=[];for(let e=0;e<this._data.points.length;++e){const o=this._data.points[e],s=this._data.backgroundColors[e];o.square?(t.push(o),i.push(s)):(n.push(o),r.push(s))}t.length&&this._drawPoints(e,t,i,g,p),n.length&&this._drawPoints(e,n,r,y,_)}_drawPoints(e,t,i,r,s){const{context:l,horizontalPixelRatio:h,verticalPixelRatio:d}=e,c=(0,o.ensureNotNull)(this._data),u=c.radius;let p=Math.max(1,Math.floor((c.strokeWidth||2)*h));c.selected&&(p+=Math.max(1,Math.floor(h/2)));const g=Math.max(1,Math.floor(h));let _=Math.round(u*h*2);_%2!=g%2&&(_+=1);const y=g%2/2;l.strokeStyle=c.color;for(let e=0;e<t.length;++e){const o=t[e];if(!((0,a.isInteger)(o.pointIndex)&&c.linePointBeingEdited===o.pointIndex)){l.fillStyle=i[e];if(r(l,{...o,point:new n.Point(Math.round(o.point.x*h)+y,Math.round(o.point.y*d)+y)},_/2,p),!c.disableInteractions){if(null!==c.hoveredPointIndex&&o.pointIndex===c.hoveredPointIndex){const e=Math.max(1,Math.floor(c.selectedStrokeWidth*h));let t=Math.round(u*h*2);t%2!=g%2&&(t+=1);s(l,{...o,point:new n.Point(Math.round(o.point.x*h)+y,Math.round(o.point.y*d)+y)},t/2,e)}}}}}}function x(e,t=e.pointIndex,i,n,r,o,s,a,l,h){return{point:e,pointIndex:t,cursorType:i,square:n,hitTarget:r,snappingPrice:o,snappingIndex:s,nonDiscreteIndex:a,activeItem:l,possibleMovingDirections:h}}function P(e){return x(e.point,e.pointIndex,e.cursorType,e.square,e.hitTarget,e.snappingPrice,e.snappingIndex,e.nonDiscreteIndex,e.activeItem,e.possibleMovingDirections)}function w(e){return x(e)}},93489:(e,t,i)=>{i.d(t,{TriangleRenderer:()=>p})
;var n=i(57415),r=i(17086),o=i(91069),s=i(56568),a=i(83077),l=i(82347),h=i(72244),d=i(51946),c=i(80140),u=i(80071);class p extends s.MediaCoordinatesPaneRenderer{constructor(){super(...arguments),this._data=null}setData(e){this._data=e}hitTest(e){if(null===this._data||this._data.points.length<2)return null;const[t,i]=this._data.points;let n=(0,r.distanceToSegment)(t,i,e);const s=(0,h.interactionTolerance)().line;if(n.distance<=s)return new a.HitTestResult(a.HitTarget.MovePoint);if(3!==this._data.points.length)return null;const l=this._data.points[2];return n=(0,r.distanceToSegment)(i,l,e),n.distance<=s?new a.HitTestResult(a.HitTarget.MovePoint):(n=(0,r.distanceToSegment)(l,t,e),n.distance<=s?new a.HitTestResult(a.HitTarget.MovePoint):this._data.fillBackground&&(0,o.pointInTriangle)(e,t,i,l)?new a.HitTestResult(a.HitTarget.MovePointBackground):null)}_drawImpl(e){if(null===this._data||this._data.points.length<2)return;const t=e.context,i=(this._data.linestyle??c.LINESTYLE_SOLID)===c.LINESTYLE_SOLID?"round":"butt";t.lineCap=i,t.lineJoin="round",t.strokeStyle=this._data.color,t.lineWidth=this._data.linewidth,void 0!==this._data.linestyle&&(0,d.setLineStyle)(t,this._data.linestyle);const[r,o,s=o]=this._data.points,{mediaSize:a}=e;if(this._data.fillBackground&&Math.abs((r.x-s.x)*(o.y-s.y)-(o.x-s.x)*(r.y-s.y))>1e-10){let e=[new n.Point(0,0),new n.Point(a.width,0),new n.Point(a.width,a.height),new n.Point(0,a.height)];if(e=(0,d.clipPolygonByEdge)(e,r,o,[o,s]),e=(0,d.clipPolygonByEdge)(e,o,s,[s,r]),e=(0,d.clipPolygonByEdge)(e,s,r,[r,o]),e&&e.length>1){t.save(),t.beginPath(),t.moveTo(e[0].x,e[0].y);for(let i=1;i<e.length;i++)t.lineTo(e[i].x,e[i].y);t.fillStyle=(0,l.generateColor)(this._data.backcolor,this._data.transparency),t.fill(),t.restore()}}const h=[],p=t.getLineDash().reduce(((e,t)=>e+t),0);[[r,o],[o,s],[s,r]].forEach((([e,t])=>{const i=(0,u.intersectLineWithViewport)(e,t,!1,!1,a.width,a.height,p);i&&h.push(i)})),h.length&&(t.beginPath(),h.forEach((([e,i])=>{t.moveTo(e.x,e.y),t.lineTo(i.x,i.y)})),t.stroke())}}},17567:(e,t,i)=>{i.d(t,{factoryDefaultsForCurrentTheme:()=>l});var n=i(35558),r=i(57600),o=i(85842),s=i(49841),a=i(47097);function l(e,t){const i=s.watchedTheme.value()??a.StdTheme.Light,l=(0,r.default)(e);return(0,n.default)(l,(0,o.ensureDefined)(t.get(i))),l}}}]);