Release v26.002 (from 2dcfe7d4)
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -12,17 +12,17 @@ const{initialMode:t="symbolSearch",autofocus:n=!0,defaultValue:l,showSpreadActio
|
||||
return"#"+[255*s,255*r,255*a].map((e=>("0"+Math.round(e).toString(16)).replace(/.+?([a-f0-9]{2})$/i,"$1"))).join("")}(e)||T;this.setState({color:t,inputColor:t.replace(/^#/,""),hsv:e}),this.props.onSelect(t)},this._handleInput=e=>{const t=e.currentTarget.value;try{const e=y(t),n=`#${t}`;this.setState({color:n,inputColor:t,hsv:e}),this.props.onSelect(n)}catch(e){this.setState({inputColor:t})}},this._handleAddColor=()=>this.props.onAdd(this.state.color);const t=e.color||T;this.state={color:t,inputColor:t.replace(/^#/,""),hsv:y(t)}}render(){const{color:e,hsv:t,inputColor:n}=this.state;return o.createElement("div",{className:N.container},o.createElement("div",{className:N.form},o.createElement("div",{className:N.swatch,style:{backgroundColor:e}}),o.createElement("div",{className:N.inputWrap},o.createElement("span",{className:N.inputHash},"#"),o.createElement("input",{type:"text",className:N.input,value:n,onChange:this._handleInput})),o.createElement("div",{className:N.buttonWrap},o.createElement(C.Button,{size:"s",onClick:this._handleAddColor},I))),o.createElement("div",{className:N.hueSaturationWrap},o.createElement(w,{className:N.saturation,hsv:t,onChange:this._handleHSV}),o.createElement(_,{className:N.hue,hsv:t,onChange:this._handleHSV})))}}var P=n(93402);const B=a.t(null,{context:"Color Picker"},n(53585)),D=a.t(null,{context:"Color Picker"},n(81865));class M extends o.PureComponent{constructor(e){super(e),this._handleAddColor=e=>{this.setState({isCustom:!1}),this._onToggleCustom(!1);const{onAddColor:t}=this.props;t&&t(e)},this._handleSelectColor=e=>{const{onColorChange:t}=this.props,{isCustom:n}=this.state;t&&t(e,n)},this._handleCustomClick=()=>{this.setState({isCustom:!0}),this._onToggleCustom(!0)},this._handleOpacity=e=>{const{onOpacityChange:t}=this.props;t&&t(e)},this.state={isCustom:!1}}componentDidUpdate(e,t){e.selectOpacity!==this.props.selectOpacity&&this.props.menu&&this.props.menu.update()}render(){const{color:e,opacity:t,selectCustom:n,selectOpacity:s,customColors:a,onRemoveCustomColor:i}=this.props,{isCustom:l}=this.state,c="number"==typeof t?t:1;return l?o.createElement(k,{color:e,onSelect:this._handleSelectColor,onAdd:this._handleAddColor}):o.createElement("div",{className:P.container},o.createElement(b,{colors:h.basic,color:e,onSelect:this._handleSelectColor}),o.createElement(b,{colors:h.extended,color:e,onSelect:this._handleSelectColor}),o.createElement("div",{className:P.separator}),o.createElement(d.Provider,{value:i},o.createElement(b,{colors:a,color:e,onSelect:this._handleSelectColor},n&&o.createElement("div",{className:r()(P.customButton,"apply-common-tooltip"),onClick:this._handleCustomClick,title:B}))),s&&o.createElement(o.Fragment,null,o.createElement("div",{className:P.sectionTitle},D),o.createElement(f.Opacity,{color:e,opacity:c,onChange:this._handleOpacity})))}_onToggleCustom(e){const{onToggleCustom:t}=this.props;t&&t(e)}}},54368:(e,t,n)=>{"use strict";n.d(t,{Opacity:()=>l});var o=n(50959),s=n(97754),r=n(50151),a=n(37160),i=n(30099);class l extends o.PureComponent{constructor(e){super(e),
|
||||
this._container=null,this._pointer=null,this._raf=null,this._refContainer=e=>{this._container=e},this._refPointer=e=>{this._pointer=e},this._handlePosition=e=>{null===this._raf&&(this._raf=requestAnimationFrame((()=>{const t=(0,r.ensureNotNull)(this._container),n=(0,r.ensureNotNull)(this._pointer),o=t.getBoundingClientRect(),s=n.offsetWidth,i=e.clientX-s/2-o.left,l=(0,a.clamp)(i/(o.width-s),0,1);this.setState({inputOpacity:Math.round(100*l).toString()}),this.props.onChange(l),this._raf=null})))},this._onSliderClick=e=>{this._handlePosition(e.nativeEvent),this._dragSubscribe()},this._mouseUp=e=>{this.setState({isPointerDragged:!1}),this._dragUnsubscribe(),this._handlePosition(e)},this._mouseMove=e=>{this.setState({isPointerDragged:!0}),this._handlePosition(e)},this._onTouchStart=e=>{this._handlePosition(e.nativeEvent.touches[0])},this._handleTouch=e=>{this.setState({isPointerDragged:!0}),this._handlePosition(e.nativeEvent.touches[0])},this._handleTouchEnd=()=>{this.setState({isPointerDragged:!1})},this._handleInput=e=>{const t=e.currentTarget.value,n=Number(t)/100;this.setState({inputOpacity:t}),Number.isNaN(n)||n>1||this.props.onChange(n)},this.state={inputOpacity:Math.round(100*e.opacity).toString(),isPointerDragged:!1}}componentWillUnmount(){null!==this._raf&&(cancelAnimationFrame(this._raf),this._raf=null),this._dragUnsubscribe()}render(){const{color:e,opacity:t,hideInput:n}=this.props,{inputOpacity:r,isPointerDragged:a}=this.state,l={color:e||void 0};return o.createElement("div",{className:i.opacity},o.createElement("div",{className:i.opacitySlider,style:l,ref:this._refContainer,onMouseDown:this._onSliderClick,onTouchStart:this._onTouchStart,onTouchMove:this._handleTouch,onTouchEnd:this._handleTouchEnd},o.createElement("div",{className:i.opacitySliderGradient,style:{backgroundImage:`linear-gradient(90deg, transparent, ${e})`}}),o.createElement("div",{className:i.opacityPointerWrap},o.createElement("div",{className:s(i.pointer,a&&i.dragged),style:{left:100*t+"%"},ref:this._refPointer}))),!n&&o.createElement("div",{className:i.opacityInputWrap},o.createElement("input",{type:"text",className:i.opacityInput,value:r,onChange:this._handleInput}),o.createElement("span",{className:i.opacityInputPercent},"%")))}_dragSubscribe(){const e=(0,r.ensureNotNull)(this._container).ownerDocument;e&&(e.addEventListener("mouseup",this._mouseUp),e.addEventListener("mousemove",this._mouseMove))}_dragUnsubscribe(){const e=(0,r.ensureNotNull)(this._container).ownerDocument;e&&(e.removeEventListener("mousemove",this._mouseMove),e.removeEventListener("mouseup",this._mouseUp))}}},6914:(e,t,n)=>{"use strict";n.d(t,{basic:()=>i,extended:()=>c,white:()=>s});var o=n(48891);const s=o.colorsPalette["color-white"],r=["ripe-red","tan-orange","banana-yellow","iguana-green","minty-green","sky-blue","tv-blue","deep-blue","grapes-purple","berry-pink"],a=[200,300,400,500,600,700,800,900].map((e=>`color-cold-gray-${e}`));a.unshift("color-white"),a.push("color-black"),r.forEach((e=>{a.push(`color-${e}-500`)}));const i=a.map((e=>o.colorsPalette[e])),l=[]
|
||||
;[100,200,300,400,700,900].forEach((e=>{r.forEach((t=>{l.push(`color-${t}-${e}`)}))}));const c=l.map((e=>o.colorsPalette[e]))},59054:(e,t,n)=>{"use strict";n.d(t,{ControlDisclosureView:()=>g});var o=n(50959),s=n(97754),r=n.n(s),a=n(38528),i=n(67029),l=n(78274),c=n(4523),u=n(9745),p=n(2948),d=n(23428);function h(e){const{isDropped:t}=e;return o.createElement(u.Icon,{className:r()(d.icon,t&&d.dropped),icon:p})}function m(e){const{className:t,disabled:n,isDropped:s}=e;return o.createElement("span",{className:r()(d.button,n&&d.disabled,t)},o.createElement(h,{isDropped:s}))}var v=n(66986);const g=o.forwardRef(((e,t)=>{const{listboxId:n,className:s,listboxClassName:u,listboxTabIndex:p,hideArrowButton:d,matchButtonAndListboxWidths:h,popupPosition:g,disabled:b,isOpened:f,scrollWrapReference:C,repositionOnScroll:y,closeOnHeaderOverlap:E,listboxReference:S,size:w="small",onClose:x,onOpen:_,onListboxFocus:N,onListboxBlur:T,onListboxKeyDown:I,buttonChildren:k,children:P,caretClassName:B,listboxAria:D,...M}=e,V=(0,o.useRef)(null),O=!d&&o.createElement(l.EndSlot,null,o.createElement(m,{isDropped:f,disabled:b,className:B}));return o.createElement(c.PopupMenuDisclosureView,{buttonRef:V,listboxId:n,listboxClassName:u,listboxTabIndex:p,isOpened:f,onClose:x,onOpen:_,listboxReference:S,scrollWrapReference:C,onListboxFocus:N,onListboxBlur:T,onListboxKeyDown:I,listboxAria:D,matchButtonAndListboxWidths:h,popupPosition:g,button:o.createElement(i.ControlSkeleton,{...M,"data-role":"listbox",disabled:b,className:r()(v.button,s),size:w,ref:(0,a.useMergedRefs)([V,t]),middleSlot:o.createElement(l.MiddleSlot,null,o.createElement("span",{className:r()(v["button-children"],d&&v.hiddenArrow)},k)),endSlot:O}),popupChildren:P,repositionOnScroll:y,closeOnHeaderOverlap:E})}));g.displayName="ControlDisclosureView"},56512:(e,t,n)=>{"use strict";n.d(t,{useCustomColors:()=>l});var o=n(50959),s=n(56840),r=n(76422);function a(e,t){(0,o.useEffect)((()=>(r.subscribe(e,t,null),()=>{r.unsubscribe(e,t,null)})),[e,t])}var i=n(24377);function l(){const[e,t]=(0,o.useState)((0,s.getJSON)("pickerCustomColors",[]));a("add_new_custom_color",(n=>t(c(n,e)))),a("remove_custom_color",(n=>t(u(n,e))));const n=(0,o.useCallback)((t=>{const n=t?(0,i.parseRgb)(t):null;e.some((e=>null!==e&&null!==n&&(0,i.areEqualRgb)((0,i.parseRgb)(e),n)))||(r.emit("add_new_custom_color",t),(0,s.setJSON)("pickerCustomColors",c(t,e)))}),[e]),l=(0,o.useCallback)((t=>{(t>=0||t<e.length)&&(r.emit("remove_custom_color",t),(0,s.setJSON)("pickerCustomColors",u(t,e)))}),[e]);return[e,n,l]}function c(e,t){const n=t.slice();return n.push(e),n.length>29&&n.shift(),n}function u(e,t){return t.filter(((t,n)=>e!==n))}},90405:(e,t,n)=>{"use strict";n.d(t,{Select:()=>C});var o=n(50959),s=n(22064),r=n(38528),a=n(16921),i=n(16396),l=n(12481),c=n(43370);var u=n(36762),p=n(26597),d=n(59054),h=n(36104),m=n(38223),v=n(60673);function g(e){return!e.readonly}function b(e,t){var n;return null!==(n=null==t?void 0:t.id)&&void 0!==n?n:(0,s.createDomId)(e,"item",null==t?void 0:t.value)}function f(e){var t,n
|
||||
;const{selectedItem:s,placeholder:r}=e;if(!s)return o.createElement("span",{className:v.placeholder},r);const a=null!==(n=null!==(t=s.selectedContent)&&void 0!==t?t:s.content)&&void 0!==n?n:s.value;return o.createElement("span",null,a)}const C=o.forwardRef(((e,t)=>{const{id:n,menuClassName:v,menuItemClassName:C,tabIndex:y,disabled:E,highlight:S,intent:w,hideArrowButton:x,placeholder:_,addPlaceholderToItems:N=!0,value:T,"aria-labelledby":I,onFocus:k,onBlur:P,onClick:B,onChange:D,onKeyDown:M,repositionOnScroll:V=!0,openMenuOnEnter:O=!0,"aria-describedby":F,"aria-invalid":R,...L}=e;let{items:W}=e;if(_&&N){W=[{value:void 0,content:_,id:(0,s.createDomId)(n,"placeholder")},...W]}const{listboxId:A,isOpened:q,isFocused:U,buttonTabIndex:z,listboxTabIndex:Z,highlight:G,intent:H,open:K,onOpen:Y,close:$,toggle:j,buttonFocusBindings:X,onButtonClick:Q,buttonRef:J,listboxRef:ee,buttonAria:te}=(0,h.useControlDisclosure)({id:n,disabled:E,buttonTabIndex:y,intent:w,highlight:S,onFocus:k,onBlur:P,onClick:B}),ne=W.filter(g),oe=ne.find((e=>e.value===T)),[se,re,ae]=(0,a.useKeepActiveItemIntoView)({activeItem:oe}),ie=(0,s.joinDomIds)(I,n),le=ie.length>0?ie:void 0,ce=(0,o.useMemo)((()=>({role:"listbox","aria-labelledby":I,"aria-activedescendant":b(n,oe)})),[I,oe]),ue=(0,o.useCallback)((e=>e.value===T),[T]),pe=(0,o.useCallback)((e=>D&&D(e.value)),[D]),de=(0,u.useItemsKeyboardNavigation)(m.isRtl,ne,ue,pe,!1,{next:[40],previous:[38]}),he=(0,p.useKeyboardToggle)(j,q||O),me=(0,p.useKeyboardClose)(q,$),ve=(0,p.useKeyboardOpen)(q,K),ge=(0,p.useKeyboardEventHandler)([he,me,ve]),be=(0,p.useKeyboardEventHandler)([de,he,me]),fe=function(e){const t=(0,o.useRef)(""),n=(0,o.useMemo)((()=>(0,l.default)((()=>{t.current=""}),500)),[]),s=(0,o.useMemo)((()=>(0,c.default)(e,200)),[e]);return(0,o.useCallback)((e=>{e.key.length>0&&e.key.length<3&&(t.current+=e.key,s(t.current,e),n())}),[n,s])}(((t,n)=>{const o=function(e,t,n){return e.find((e=>{var o;const s=t.toLowerCase();return!e.readonly&&(n?n(e).toLowerCase().startsWith(s):!e.readonly&&("string"==typeof e.content&&e.content.toLowerCase().startsWith(s)||"string"==typeof e.textContent&&e.textContent.toLowerCase().startsWith(s)||String(null!==(o=e.value)&&void 0!==o?o:"").toLowerCase().startsWith(s)))}))}(ne,t,e.getSearchKey);void 0!==o&&D&&(n.stopPropagation(),q||K(),D(o.value))}));return o.createElement(d.ControlDisclosureView,{...L,...te,...X,id:n,role:"button",tabIndex:z,"aria-owns":te["aria-controls"],"aria-haspopup":"listbox","aria-labelledby":le,disabled:E,hideArrowButton:x,isFocused:U,isOpened:q,highlight:G,intent:H,ref:(0,r.useMergedRefs)([J,t]),onClick:Q,onOpen:function(){ae(oe,{duration:0}),Y()},onClose:$,onKeyDown:function(e){ge(e),M&&M(e);e.defaultPrevented||fe(e)},listboxId:A,listboxTabIndex:Z,listboxClassName:v,listboxAria:ce,"aria-describedby":F,"aria-invalid":R,listboxReference:ee,scrollWrapReference:se,onListboxKeyDown:function(e){be(e),e.defaultPrevented||fe(e)},buttonChildren:o.createElement(f,{selectedItem:oe,placeholder:_}),repositionOnScroll:V},W.map(((e,t)=>{var s
|
||||
;const{selectedItem:s,placeholder:r}=e;if(!s)return o.createElement("span",{className:v.placeholder},r);const a=null!==(n=null!==(t=s.selectedContent)&&void 0!==t?t:s.content)&&void 0!==n?n:s.value;return o.createElement("span",null,a)}const C=o.forwardRef(((e,t)=>{const{id:n,menuClassName:v,menuItemClassName:C,tabIndex:y,disabled:E,highlight:S,intent:w,hideArrowButton:x,placeholder:_,addPlaceholderToItems:N=!0,value:T,"aria-labelledby":I,onFocus:k,onBlur:P,onClick:B,onChange:D,onKeyDown:M,repositionOnScroll:V=!0,openMenuOnEnter:O=!0,"aria-describedby":F,"aria-invalid":R,...L}=e;let{items:W}=e;if(_&&N){W=[{value:void 0,content:_,id:(0,s.createDomId)(n,"placeholder")},...W]}const{listboxId:A,isOpened:q,isFocused:U,buttonTabIndex:z,listboxTabIndex:Z,highlight:G,intent:H,open:K,onOpen:$,close:Y,toggle:j,buttonFocusBindings:X,onButtonClick:Q,buttonRef:J,listboxRef:ee,buttonAria:te}=(0,h.useControlDisclosure)({id:n,disabled:E,buttonTabIndex:y,intent:w,highlight:S,onFocus:k,onBlur:P,onClick:B}),ne=W.filter(g),oe=ne.find((e=>e.value===T)),[se,re,ae]=(0,a.useKeepActiveItemIntoView)({activeItem:oe}),ie=(0,s.joinDomIds)(I,n),le=ie.length>0?ie:void 0,ce=(0,o.useMemo)((()=>({role:"listbox","aria-labelledby":I,"aria-activedescendant":b(n,oe)})),[I,oe]),ue=(0,o.useCallback)((e=>e.value===T),[T]),pe=(0,o.useCallback)((e=>D&&D(e.value)),[D]),de=(0,u.useItemsKeyboardNavigation)(m.isRtl,ne,ue,pe,!1,{next:[40],previous:[38]}),he=(0,p.useKeyboardToggle)(j,q||O),me=(0,p.useKeyboardClose)(q,Y),ve=(0,p.useKeyboardOpen)(q,K),ge=(0,p.useKeyboardEventHandler)([he,me,ve]),be=(0,p.useKeyboardEventHandler)([de,he,me]),fe=function(e){const t=(0,o.useRef)(""),n=(0,o.useMemo)((()=>(0,l.default)((()=>{t.current=""}),500)),[]),s=(0,o.useMemo)((()=>(0,c.default)(e,200)),[e]);return(0,o.useCallback)((e=>{e.key.length>0&&e.key.length<3&&(t.current+=e.key,s(t.current,e),n())}),[n,s])}(((t,n)=>{const o=function(e,t,n){return e.find((e=>{var o;const s=t.toLowerCase();return!e.readonly&&(n?n(e).toLowerCase().startsWith(s):!e.readonly&&("string"==typeof e.content&&e.content.toLowerCase().startsWith(s)||"string"==typeof e.textContent&&e.textContent.toLowerCase().startsWith(s)||String(null!==(o=e.value)&&void 0!==o?o:"").toLowerCase().startsWith(s)))}))}(ne,t,e.getSearchKey);void 0!==o&&D&&(n.stopPropagation(),q||K(),D(o.value))}));return o.createElement(d.ControlDisclosureView,{...L,...te,...X,id:n,role:"button",tabIndex:z,"aria-owns":te["aria-controls"],"aria-haspopup":"listbox","aria-labelledby":le,disabled:E,hideArrowButton:x,isFocused:U,isOpened:q,highlight:G,intent:H,ref:(0,r.useMergedRefs)([J,t]),onClick:Q,onOpen:function(){ae(oe,{duration:0}),$()},onClose:Y,onKeyDown:function(e){ge(e),M&&M(e);e.defaultPrevented||fe(e)},listboxId:A,listboxTabIndex:Z,listboxClassName:v,listboxAria:ce,"aria-describedby":F,"aria-invalid":R,listboxReference:ee,scrollWrapReference:se,onListboxKeyDown:function(e){be(e),e.defaultPrevented||fe(e)},buttonChildren:o.createElement(f,{selectedItem:oe,placeholder:_}),repositionOnScroll:V},W.map(((e,t)=>{var s
|
||||
;if(e.readonly)return o.createElement(o.Fragment,{key:`readonly_item_${t}`},e.content);const r=b(n,e);return o.createElement(i.PopupMenuItem,{key:r,id:r,className:C,role:"option","aria-selected":T===e.value,isActive:T===e.value,label:null!==(s=e.content)&&void 0!==s?s:e.value,onClick:Ce,onClickArg:e.value,isDisabled:e.disabled,reference:t=>re(e,t)})})));function Ce(e){D&&D(e)}}));C.displayName="Select"},86656:(e,t,n)=>{"use strict";n.d(t,{TouchScrollContainer:()=>i});var o=n(50959),s=n(59142),r=n(50151),a=n(49483);const i=(0,o.forwardRef)(((e,t)=>{const{children:n,...r}=e,i=(0,o.useRef)(null);return(0,o.useImperativeHandle)(t,(()=>i.current)),(0,o.useLayoutEffect)((()=>{if(a.CheckMobile.iOS())return null!==i.current&&(0,s.disableBodyScroll)(i.current,{allowTouchMove:l(i)}),()=>{null!==i.current&&(0,s.enableBodyScroll)(i.current)}}),[]),o.createElement("div",{ref:i,...r},n)}));function l(e){return t=>{const n=(0,r.ensureNotNull)(e.current),o=document.activeElement;return!n.contains(t)||null!==o&&n.contains(o)&&o.contains(t)}}},26278:e=>{e.exports={titleWrap:"titleWrap-Izz3hpJc",groupFooter:"groupFooter-Izz3hpJc"}},49934:e=>{e.exports={wrapper:"wrapper-JXHzsa7P"}},17611:e=>{e.exports={inlineRow:"inlineRow-D8g11qqA"}},93071:e=>{e.exports={container:"container-QyF09i7Y",hasTooltip:"hasTooltip-QyF09i7Y",datePickerWrapper:"datePickerWrapper-QyF09i7Y",timePickerWrapper:"timePickerWrapper-QyF09i7Y"}},27698:e=>{e.exports={input:"input-ZOx_CVY3",symbol:"symbol-ZOx_CVY3",checkbox:"checkbox-ZOx_CVY3",label:"label-ZOx_CVY3",dropdownMenu:"dropdownMenu-ZOx_CVY3",sessionStart:"sessionStart-ZOx_CVY3",sessionEnd:"sessionEnd-ZOx_CVY3",sessionInputContainer:"sessionInputContainer-ZOx_CVY3",sessionDash:"sessionDash-ZOx_CVY3",inputGroup:"inputGroup-ZOx_CVY3",textarea:"textarea-ZOx_CVY3",inlineGroup:"inlineGroup-ZOx_CVY3",hasTooltip:"hasTooltip-ZOx_CVY3"}},24712:e=>{e.exports={content:"content-tBgV1m0B",cell:"cell-tBgV1m0B",inner:"inner-tBgV1m0B",first:"first-tBgV1m0B",inlineCell:"inlineCell-tBgV1m0B",fill:"fill-tBgV1m0B",top:"top-tBgV1m0B",topCenter:"topCenter-tBgV1m0B",offset:"offset-tBgV1m0B",inlineRow:"inlineRow-tBgV1m0B",grouped:"grouped-tBgV1m0B",separator:"separator-tBgV1m0B",groupSeparator:"groupSeparator-tBgV1m0B",big:"big-tBgV1m0B",adaptive:"adaptive-tBgV1m0B",checkableTitle:"checkableTitle-tBgV1m0B"}},80128:e=>{e.exports={wrap:"wrap-QutFvTLS",labelWrap:"labelWrap-QutFvTLS",label:"label-QutFvTLS",hasTooltip:"hasTooltip-QutFvTLS"}},82161:(e,t,n)=>{"use strict";n.d(t,{splitThousands:()=>s});var o=n(50335);function s(e,t=" "){let n=e+"";-1!==n.indexOf("e")&&(n=function(e){return(0,o.fixComputationError)(e).toFixed(10).replace(/\.?0+$/,"")}(Number(e)));const s=n.split(".");return s[0].replace(/\B(?=(\d{3})+(?!\d))/g,t)+(s[1]?"."+s[1]:"")}},83207:(e,t,n)=>{"use strict";n.d(t,{bind:()=>a,setter:()=>i});var o=n(50959),s=n(76917),r=n(27365);function a(e){var t;return t=class extends o.PureComponent{constructor(){super(...arguments),this._onChange=(e,t,n)=>{const{setValue:o}=this.context,{onChange:s}=this.props;i(o,s)(e,t,n)}}
|
||||
render(){const{input:t}=this.props,{values:n,model:s}=this.context;return o.createElement(e,{...this.props,value:n[t.id],tzName:(0,r.getTimezoneName)(s),onChange:this._onChange})}},t.contextType=s.PropertyContext,t}function i(e,t){return(n,o,s)=>{e(o,n,s),t&&t(n,o,s)}}},76917:(e,t,n)=>{"use strict";n.d(t,{PropertyContainer:()=>u,PropertyContext:()=>c});var o=n(50959),s=n(50151),r=n(44352),a=n(36298);const i=(0,n(59224).getLogger)("Platform.GUI.StudyInputPropertyContainer"),l=new a.TranslatedString("change {propertyName} property",r.t(null,void 0,n(18567))),c=o.createContext(null);class u extends o.PureComponent{constructor(e){super(e),this._setValue=(e,t,o)=>{const{property:c,model:u}=this.props,p=(0,s.ensureDefined)(c.child(e));i.logNormal(`Changing property "${e}" value from "${c.value()}" to "${t}"`);const d=new a.TranslatedString(o,function(e){return r.t(e,{context:"input"},n(88601))}(o));u.setProperty(p,t,l.format({propertyName:d}))};const{property:t}=e,o={};t.childNames().forEach((e=>{const n=(0,s.ensureDefined)(t.child(e));o.hasOwnProperty(e)||(o[e]=n.value())})),this.state=o}componentDidMount(){const{property:e,onStudyInputChange:t}=this.props;e.childNames().forEach((n=>{(0,s.ensureDefined)(e.child(n)).subscribe(this,(e=>{const o=e.value();i.logNormal(`Property "${n}" updated to value "${o}"`),this.setState({[n]:o}),null==t||t(o,n)}))}))}componentWillUnmount(){const{property:e}=this.props;e.childNames().forEach((t=>{(0,s.ensureDefined)(e.child(t)).unsubscribeAll(this)}))}render(){const{study:e,model:t,children:n}=this.props,s={study:e,model:t,values:this.state,setValue:this._setValue};return o.createElement(c.Provider,{value:s},n)}}},51717:(e,t,n)=>{"use strict";n.d(t,{ModelContext:()=>s,bindModel:()=>r});var o=n(50959);const s=o.createContext(null);function r(e,t){return o.createElement(s.Consumer,null,(n=>n?o.createElement(e,{...Object.assign({model:n},t)}):null))}},41594:(e,t,n)=>{"use strict";n.d(t,{StylePropertyContainer:()=>a,StylePropertyContext:()=>r,bindPropertyContext:()=>i});var o=n(50959),s=n(51717);const r=o.createContext(null);class a extends o.PureComponent{constructor(){super(...arguments),this._setValue=(e,t,n)=>{const{model:o}=this.props;o.setProperty(e,t,n)}}componentDidMount(){const{property:e}=this.props;e.subscribe(this,(()=>this.forceUpdate()))}componentWillUnmount(){const{property:e}=this.props;e.unsubscribeAll(this)}render(){const e={setValue:this._setValue};return o.createElement(r.Provider,{value:e},this.props.children)}}function i(e,t){return(0,s.bindModel)((({model:n})=>o.createElement(a,{model:n,property:t.property},o.createElement(e,{...t}))),t)}},76694:(e,t,n)=>{"use strict";n.d(t,{IconGroupWrapper:()=>r});var o=n(50959),s=n(49934);function r(e){const{children:t}=e;return o.createElement("div",{className:s.wrapper},t)}},39847:(e,t,n)=>{"use strict";n.d(t,{InputTooltip:()=>E});var o=n(50959),s=n(97754),r=n(90186),a=n(9745),i=n(5325);function l(){const[e,t]=(0,o.useState)(!1);return(0,o.useEffect)((()=>{t(i.mobiletouch)}),[]),e}
|
||||
var c=n(38952),u=n(38528),p=n(82353),d=n(27941),h=n(99084),m=n(30162),v=n(78370),g=n.n(v);const b={info:d,question:p,check:h,exclamation:m};function f(e){return o.createElement("span",{...(0,c.renameRef)(e),className:s(e.className,g()["no-active-state"])})}function C(e){const{icon:t,intent:n="default",ariaLabel:i,tooltip:c,className:p,reference:d,showTooltipOnTouch:h=!0,renderComponent:m=f,showTooltip:v,hideTooltip:C,onFocus:y,onBlur:E,onClick:S,tabIndex:w}=e,x=l()?h:Boolean(c),_=o.useRef(null),N=(0,u.useMergedRefs)([d,_]),T=function(e){const{tabIndex:t=0,showTooltip:n,hideTooltip:s,onFocus:r,onBlur:a,onClick:i,ref:c}=e,u=l();return{onBlur:(0,o.useCallback)((e=>{s&&s(),a&&a(e)}),[s,a]),onFocus:(0,o.useCallback)((e=>{n&&n(e.currentTarget,{tooltipDelay:200}),r&&r(e)}),[n,r]),onClick:(0,o.useCallback)((e=>{var t;u&&(null===(t=c.current)||void 0===t||t.focus()),i&&i(e)}),[i]),tabIndex:t}}({showTooltip:v,hideTooltip:C,onFocus:y,onBlur:E,onClick:S,ref:_,tabIndex:w}),I=o.useMemo((()=>function(e,t){return t?b[t]:"success"===e?b.check:b.exclamation}(n,t)),[t,n]);return o.createElement(m,{className:s(p,g()["icon-wrapper"],g()[`intent-${n}`],x&&c&&g()["with-tooltip"],x&&c&&"apply-common-tooltip"),title:x?c:void 0,"aria-label":i,reference:N,...(0,r.filterDataProps)(e),...T},o.createElement(a.Icon,{"aria-hidden":!0,icon:I,className:g().icon}))}var y=n(38780);function E(e){const{className:t,title:n}=e;return o.createElement(C,{icon:"info",className:t,ariaLabel:n,showTooltip:y.showOnElement,hideTooltip:y.hide,tooltip:n,tabIndex:-1})}},12949:(e,t,n)=>{"use strict";n.d(t,{InputRow:()=>ne});var o=n(44352),s=n(50959),r=n(50151),a=n(33703),i=n(96438),l=n(47510),c=n(4781),u=n(97754),p=n.n(u),d=n(31261),h=n(83207),m=n(90009),v=n(27698);class g extends s.PureComponent{constructor(){super(...arguments),this._onChange=e=>{const{input:{id:t,name:n},onChange:o}=this.props;o(e.currentTarget.value,t,n)}}render(){const{input:{defval:e},value:t,disabled:n,onBlur:o,onKeyDown:r,hasTooltip:a}=this.props;return s.createElement(d.InputControl,{className:p()(v.input,a&&v.hasTooltip),value:void 0===t?e:t,onChange:this._onChange,onBlur:o,onKeyDown:r,disabled:n,maxLength:4096})}}const b=(0,m.debounced)(g),f=(0,h.bind)(b);var C=n(55141),y=n(11062);function E(e){const{className:t}=e,n=(0,s.useContext)(y.PropertyTable.InlineRowContext);return s.createElement("div",{className:u(v.inputGroup,n&&v.inlineGroup,t)},e.children)}var S=n(36565);function w(e=""){const[,t="",n="",o="",s=""]=Array.from(e.match(/^(\d\d)(\d\d)-(\d\d)(\d\d)/)||[]);return[`${t}:${n}`,`${o}:${s}`]}class x extends s.PureComponent{constructor(e){super(e),this._onStartPick=e=>{this.setState({startTime:e},this._onChange)},this._onEndPick=e=>{this.setState({endTime:e},this._onChange)},this._onChange=()=>{const{input:{id:e,name:t},onChange:n}=this.props,{startTime:o,endTime:s}=this.state;n(o.replace(":","")+"-"+s.replace(":",""),e,t)};const t=e.value||e.input.defval,[n,o]=w(t);this.state={prevValue:t,startTime:n,endTime:o}}render(){
|
||||
const{startTime:e,endTime:t}=this.state,{hasTooltip:n,disabled:o}=this.props;return s.createElement(E,{className:p()(n&&v.hasTooltip)},s.createElement("div",{className:v.sessionStart},s.createElement(S.TimeInput,{className:p()(v.input,v.sessionInputContainer),name:"start",value:(0,r.ensureDefined)(e),onChange:this._onStartPick,disabled:o}),s.createElement("span",{className:v.sessionDash}," — ")),s.createElement("div",{className:v.sessionEnd},s.createElement(S.TimeInput,{className:p()(v.input,v.sessionInputContainer),name:"end",value:(0,r.ensureDefined)(t),onChange:this._onEndPick,disabled:o})))}static getDerivedStateFromProps(e,t){if(e.value===t.prevValue)return t;const[n,o]=w(e.value);return{prevValue:e.value,startTime:n,endTime:o}}}const _=(0,h.bind)(x);var N=n(14483),T=n(42856),I=n(37591),k=n(76917),P=n(90405);class B extends s.PureComponent{constructor(){super(...arguments),this._onChange=e=>{const{input:{id:t,name:n},onChange:o}=this.props;o(e,t,n)}}render(){const{input:{id:e,defval:t,options:r,optionsTitles:a},value:i,disabled:l,hasTooltip:c}=this.props,u=r.map((e=>{const t=a&&a[e]?a[e]:e;return{value:e,content:o.t(t,{context:"input"},n(88601))}})),d=void 0!==i&&r.includes(i)?i:t;return s.createElement(P.Select,{id:e,className:p()(v.input,c&&v.hasTooltip),menuClassName:v.dropdownMenu,value:d,items:u,onChange:this._onChange,disabled:l})}}const D=(0,h.bind)(B);var M=n(73146),V=n(28853);const O={open:o.t(null,void 0,n(38466)),high:o.t(null,void 0,n(39337)),low:o.t(null,void 0,n(3919)),close:o.t(null,void 0,n(36962)),hl2:o.t(null,void 0,n(91815)),hlc3:o.t(null,void 0,n(40771)),ohlc4:o.t(null,void 0,n(12504)),hlcc4:o.t(null,void 0,n(9523))};class F extends s.PureComponent{render(){const{input:e}=this.props,{study:t,model:n}=this.context;let o={...O};delete o.hlcc4;const i=(0,M.createAdapter)(t);if(t&&this._isStudy(t)&&t.isChildStudy()){const t=(0,a.getInputValue)(i.inputs()[e.id]),n=i.parentSourceForInput(t);if((0,V.isStudy)(n)){const t=n.title(I.TitleDisplayTarget.StatusLine),s=T.StudyMetaInfo.getChildSourceInputTitles(e,n.metaInfo(),t);o={...o,...s}}}if(N.enabled("study_on_study")&&t&&this._isStudy(t)&&(t.isChildStudy()||T.StudyMetaInfo.canBeChild(t.metaInfo()))){const e=[t,...i.getAllChildren()];n.model().allStudies().filter((t=>t.canHaveChildren()&&!e.includes(t))).forEach((e=>{const t=e.title(I.TitleDisplayTarget.StatusLine,!0,void 0,!0),n=e.id(),s=e.metaInfo(),a=s.styles,i=s.plots||[];if(1===i.length)o[n+"$0"]=t;else if(i.length>1){const e=i.reduce(((e,o,s)=>{if(!T.StudyMetaInfo.canPlotBeSourceOfChildStudy(o.type))return e;let i;try{i=(0,r.ensureDefined)((0,r.ensureDefined)(a)[o.id]).title}catch(e){i=o.id}return{...e,[`${n}$${s}`]:`${t}: ${i}`}}),{});o={...o,...e}}}))}const l={...e,type:"text",options:Object.keys(o),optionsTitles:o};return s.createElement(D,{...this.props,input:l})}_isStudy(e){return!e.hasOwnProperty("isInputsStudy")}}F.contextType=k.PropertyContext;var R=n(36274),L=n(94025)
|
||||
;const W=void 0,A=["1","3","5","15","30","45","60","120","180","240","1D","1W","1M","3M","6M","12M"],q=["1S","5S","10S","15S","30S"];class U extends s.PureComponent{constructor(){super(...arguments),this._onChange=e=>{const{input:{id:t,name:n},onChange:o}=this.props;o(e,t,n)}}render(){const{input:e,value:t,disabled:r,hasTooltip:a}=this.props,i=R.Interval.parse(void 0===t?e.defval:t),l=i.isValid()?i.value():t,c=W?W.get().filter((e=>!R.Interval.parse(e).isRange())):[],u=(0,L.mergeResolutions)(A,(0,L.isSecondsEnabled)()?q:[],c);return u.unshift(""),s.createElement(P.Select,{id:e.id,className:p()(v.input,v.resolution,a&&v.hasTooltip),menuClassName:p()(v.dropdownMenu,v.resolution),items:(d=u,d.map((e=>({value:e,content:""===e?o.t(null,void 0,n(94551)):(0,L.getTranslatedResolutionModel)(e).hint})))),value:l,onChange:this._onChange,disabled:r});var d}}const z=(0,h.bind)(U);var Z=n(41552),G=n(41594);class H extends s.PureComponent{render(){return s.createElement(k.PropertyContext.Consumer,null,(e=>e?this._getColorInputWithContext(e):null))}_getColorInputWithContext(e){var t;const{input:{id:n},disabled:o,hasTooltip:r}=this.props,{model:a,study:i}=e;if("properties"in i||"tempProperties"in i){const e="properties"in i?i.properties().inputs[n]:null===(t=i.tempProperties)||void 0===t?void 0:t.inputs.child(n);return s.createElement(G.StylePropertyContainer,{model:a,property:e},s.createElement(Z.ColorWithThicknessSelect,{className:p()(r&&v.hasTooltip),color:e,disabled:o}))}return null}}var K=n(85528),Y=n(76056),$=n(23935),j=n(27365),X=n(93071);const Q=(0,h.bind)((function(e){const{value:t,onChange:n,input:o,tzName:r,hasTooltip:a}=e,{id:i,name:l,defval:c}=o,u=(0,s.useMemo)((()=>Number(null!=t?t:c)),[t,c]),d=(0,s.useMemo)((()=>(0,j.getChartTimezoneOffsetMs)(u,r)),[u,r]),h=(0,s.useMemo)((()=>{const e=new Date(u+d+v(u));return e.setSeconds(0),e}),[u,d]),m=(0,s.useMemo)((()=>(0,$.twoDigitsFormat)(h.getHours())+":"+(0,$.twoDigitsFormat)(h.getMinutes())),[h]);return s.createElement("div",{className:p()(X.container,a&&X.hasTooltip)},s.createElement("div",{className:X.datePickerWrapper},s.createElement(K.DatePicker,{InputComponent:Y.DateInput,initial:h,onPick:function(e){if(null===e)return;const t=new Date(h);t.setFullYear(e.getFullYear()),t.setMonth(e.getMonth()),t.setDate(e.getDate()),n(g(t),i,l)},revertInvalidData:!0})),s.createElement("div",{className:X.timePickerWrapper},s.createElement(S.TimeInput,{value:m,onChange:function(e){const[t,o]=e.split(":"),s=new Date(h);s.setHours(Number(t)),s.setMinutes(Number(o)),n(g(s),i,l)}})));function v(e){return 60*new Date(e).getTimezoneOffset()*1e3}function g(e){return e.valueOf()-d-v(u)}}));class J extends s.PureComponent{render(){const{input:e,disabled:t,onChange:n,tzName:o,hasTooltip:r}=this.props;if((0,a.isStudyInputOptionsInfo)(e))return s.createElement(D,{input:e,disabled:t,onChange:n,hasTooltip:r});switch(e.type){case"integer":return s.createElement(i.IntegerInput,{input:e,disabled:t,onChange:n,hasTooltip:r});case"float":case"price":return s.createElement(l.FloatInput,{input:e,disabled:t,
|
||||
onChange:n,hasTooltip:r});case"bool":return s.createElement(c.BoolInput,{input:e,disabled:t,onChange:n,hasTooltip:r});case"text":return s.createElement(f,{input:e,disabled:t,onChange:n,hasTooltip:r});case"symbol":return s.createElement(C.SymbolInput,{input:e,disabled:t,onChange:n,hasTooltip:r});case"session":return s.createElement(_,{input:e,disabled:t,onChange:n,hasTooltip:r});case"source":return s.createElement(F,{input:e,disabled:t,onChange:n,hasTooltip:r});case"resolution":return s.createElement(z,{input:e,disabled:t,onChange:n,hasTooltip:r});case"time":return s.createElement(Q,{input:e,tzName:o,onChange:n,hasTooltip:r});case"color":return s.createElement(H,{input:e,disabled:t,onChange:n,hasTooltip:r});default:return null}}}var ee=n(39847),te=n(76694);class ne extends s.PureComponent{render(){const{label:e,children:t,input:a,disabled:i,onChange:l,labelAlign:c,grouped:u,tooltip:p,solutionId:d,offset:h}=this.props,m=Boolean(p);return s.createElement(y.PropertyTable.Row,null,s.createElement(y.PropertyTable.Cell,{placement:"first",verticalAlign:c,grouped:u,offset:h},void 0!==e?e:o.t((0,r.ensureDefined)(a).name,{context:"input"},n(88601))),s.createElement(y.PropertyTable.Cell,{placement:"last",grouped:u},t||s.createElement(J,{input:(0,r.ensureDefined)(a),onChange:l,disabled:i,hasTooltip:m}),m&&s.createElement(te.IconGroupWrapper,null,p&&s.createElement(ee.InputTooltip,{title:p}),!1)))}}},39828:(e,t,n)=>{"use strict";n.d(t,{InputsTabContent:()=>A});var o,s=n(50959),r=n(50151),a=n(44352),i=n(76917),l=n(11062),c=n(57733),u=n(97754),p=n.n(u),d=n(88400),h=n.n(d);const m=(0,c.makeSwitchGroupItem)(((o=class extends s.PureComponent{constructor(){super(...arguments),this._onChange=()=>{this.props.onChange&&this.props.onChange(this.props.value)}}render(){const e=u(this.props.className,h().radio,{[h().reverse]:Boolean(this.props.labelPositionReverse)}),t=u(h().label,{[h().disabled]:this.props.disabled}),n=u(h().box,{[h().noOutline]:-1===this.props.tabIndex});let o=null;return this.props.label&&(o=s.createElement("span",{className:t},this.props.label)),s.createElement("label",{className:e},s.createElement("span",{className:h().wrapper,title:this.props.title},s.createElement("input",{id:this.props.id,tabIndex:this.props.tabIndex,autoFocus:this.props.autoFocus,role:this.props.role,className:h().input,type:"radio",name:this.props.name,checked:this.props.checked,disabled:this.props.disabled,value:this.props.value,onChange:this._onChange,ref:this.props.reference,"aria-describedby":this.props["aria-describedby"],"aria-invalid":this.props["aria-invalid"]}),s.createElement("span",{className:n})),o)}}).defaultProps={value:"on"},o));var v=n(55141),g=n(83207),b=n(39847),f=n(76694),C=n(27698);function y(e){const{children:t,input:o,disabled:u,onChange:p,grouped:d,tooltip:h,solutionId:y}=e,E=(0,s.useContext)(i.PropertyContext),{values:S,setValue:w}=(0,r.ensureNotNull)(E),x=S[o.id],[_,N]=(0,s.useState)(x?"another-symbol":"main-symbol"),[T,I]=(0,s.useState)(x),k=Boolean(h);return(0,s.useEffect)((()=>{x&&I(x)}),[x]),
|
||||
s.createElement(c.SwitchGroup,{name:`symbol-source-${o.id}`,values:[_],onChange:function(e){N(e),"main-symbol"===e?(0,g.setter)(w)("",o.id,o.name):"another-symbol"===e&&T&&(0,g.setter)(w,p)(T,o.id,o.name)}},s.createElement(l.PropertyTable.Row,null,s.createElement(l.PropertyTable.Cell,{colSpan:2,placement:"first",grouped:d},s.createElement(m,{value:"main-symbol",className:C.checkbox,disabled:u,label:s.createElement("span",{className:C.label},a.t(null,{context:"input"},n(88046)))}))),s.createElement(l.PropertyTable.Row,null,s.createElement(l.PropertyTable.Cell,{placement:"first",grouped:d},s.createElement(m,{value:"another-symbol",className:C.checkbox,disabled:u,label:s.createElement("span",{className:C.label},a.t(null,{context:"input"},n(73755)))})),s.createElement(l.PropertyTable.Cell,{placement:"last",grouped:d},t||s.createElement(v.SymbolInput,{input:(0,r.ensureDefined)(o),onChange:p,disabled:u||"main-symbol"===_,hasTooltip:k}),k&&s.createElement(f.IconGroupWrapper,null,h&&s.createElement(b.InputTooltip,{title:h}),!1))))}var E=n(4781);class S extends s.PureComponent{render(){const{label:e,input:t,tooltip:n,solutionId:o}=this.props,r=Boolean(n);return s.createElement(l.PropertyTable.Row,null,s.createElement(l.PropertyTable.Cell,{placement:"first",colSpan:2},s.createElement(E.BoolInput,{label:e,input:t,hasTooltip:r}),r&&s.createElement(f.IconGroupWrapper,null,n&&s.createElement(b.InputTooltip,{title:n}),!1)))}}var w=n(12949),x=n(2568),_=n(67029),N=n(90009);class T extends s.PureComponent{constructor(){super(...arguments),this._onChange=e=>{const{input:{id:t,name:n},onChange:o}=this.props;o(e.currentTarget.value,t,n)}}render(){const{input:{defval:e},value:t,disabled:n,onBlur:o,onKeyDown:r}=this.props;return s.createElement(x.Textarea,{className:p()(C.input,C.textarea,_.InputClasses.FontSizeMedium),value:void 0===t?e:t,onChange:this._onChange,onBlur:o,onKeyDown:r,disabled:n,maxLength:4096})}}const I=(0,N.debounced)(T),k=(0,g.bind)(I);var P=n(80128);function B(e){const{input:t,label:n,tooltip:o,solutionId:r}=e,a=Boolean(o);return s.createElement(l.PropertyTable.Row,null,s.createElement(l.PropertyTable.Cell,{placement:"first",colSpan:2,className:P.wrap},s.createElement("div",{className:P.labelWrap},s.createElement("span",{className:p()(P.label,a&&P.hasTooltip)},n),a&&s.createElement(f.IconGroupWrapper,null,o&&s.createElement(b.InputTooltip,{title:o}),!1)),s.createElement(k,{input:t})))}function D(e){const{input:t,tooltip:o,solutionId:r}=e;return"symbol"===t.type&&t.optional?s.createElement(y,{input:t,tooltip:o,solutionId:r}):"bool"===t.type?s.createElement(S,{label:a.t(t.name,{context:"input"},n(88601)),input:t,tooltip:o,solutionId:r}):"text_area"===t.type?s.createElement(B,{label:a.t(t.name,{context:"input"},n(88601)),input:t,tooltip:o,solutionId:r}):s.createElement(w.InputRow,{labelAlign:function(e){switch(e){case"session":return"adaptive";case"time":return"topCenter";default:return}}(t.type),input:t,tooltip:o,solutionId:r})}var M=n(86067),V=n(17611);function O(e){const{content:t}=e;let n
|
||||
;return s.createElement(l.PropertyTable.InlineRowContext.Provider,{value:!0},s.createElement("div",{className:V.inlineRow},t.children.map(((e,o)=>(void 0!==e.tooltip&&(n=e.tooltip),s.createElement(D,{key:e.id,input:e,tooltip:o===t.children.length-1?n:void 0}))))))}var F=n(64420),R=n(26278);function L(e){const{content:t}=e;return(0,F.isGroup)(t)?(0,F.isInputInlines)(t)?s.createElement(O,{content:t}):s.createElement(s.Fragment,null,s.createElement("div",{className:R.titleWrap},s.createElement(M.GroupTitleSection,{title:a.t(t.id,{context:"input"},n(88601)),name:t.id})),t.children.map((e=>(0,F.isGroup)(e)?s.createElement(O,{key:e.id,content:e}):s.createElement(D,{key:e.id,input:e,tooltip:e.tooltip,solutionId:e.solutionId}))),s.createElement("div",{className:R.groupFooter})):s.createElement(D,{input:t,tooltip:t.tooltip,solutionId:t.solutionId})}const W={offset:a.t(null,void 0,n(89298))};class A extends s.PureComponent{render(){const{reference:e,inputs:t,property:n,study:o,studyMetaInfo:a,model:i,onStudyInputChange:c,className:u}=this.props,{offset:p,offsets:d}=n;return s.createElement(l.PropertyTable,{reference:e,className:u},s.createElement(q,{study:o,model:i,property:n.inputs,inputs:t,onStudyInputChange:c}),p&&this._createOffsetSection(p,(0,r.ensureDefined)(a.offset)),d&&d.childNames().map((e=>{var t;const n=d.childs()[e];return this._createOffsetSection(n,(0,r.ensureDefined)(null===(t=a.offsets)||void 0===t?void 0:t[e]))})))}_createOffsetSection(e,t){const n=e.childs();return s.createElement(q,{key:`offset_${t.title}`,study:this.props.study,model:this.props.model,inputs:[U(n,t)],property:e})}}function q(e){const{study:t,model:n,inputs:o,property:r,onStudyInputChange:a}=e,l=o,c=(0,s.useMemo)((()=>(0,F.getInputGroups)(l)),[l]);return s.createElement(i.PropertyContainer,{property:r,study:t,model:n,onStudyInputChange:a},!1,!1,c.map((e=>s.createElement(s.Fragment,{key:e.id},s.createElement(L,{content:e}),!1))))}function U(e,t){return{id:"val",name:t.title||W.offset,defval:e.val.value(),type:"integer",min:t.min,max:t.max}}},4781:(e,t,n)=>{"use strict";n.d(t,{BoolInput:()=>u,BoolInputComponent:()=>c});var o=n(50959),s=n(15294),r=n(97754),a=n.n(r),i=n(83207),l=n(27698);class c extends o.PureComponent{constructor(){super(...arguments),this._onChange=()=>{const{input:{id:e,name:t},value:n,onChange:o}=this.props;o(!n,e,t)}}render(){const{input:{defval:e},value:t,disabled:n,label:r,hasTooltip:i}=this.props,c=void 0===t?e:t;return o.createElement(s.Checkbox,{className:a()(l.checkbox,i&&l.hasTooltip),disabled:n,checked:c,onChange:this._onChange,label:o.createElement("span",{className:l.label},r),labelAlignBaseline:!0})}}const u=(0,i.bind)(c)},90009:(e,t,n)=>{"use strict";n.d(t,{debounced:()=>r});var o=n(50959);const s={blur:0,commit:0,change:1/0};function r(e,t=s){return class extends o.PureComponent{constructor(e){super(e),this._onChange=(e,n,o)=>{const s=t.change;s?(clearTimeout(this._timeout),this.setState({value:e},(()=>{s!==1/0&&(this._timeout=setTimeout((()=>this._flush()),s))}))):this._flush(e)},this._onBlur=()=>{
|
||||
this._debounce(t.blur);const{onBlur:e}=this.props;e&&e()},this._onKeyDown=e=>{13===e.keyCode&&this._debounce(t.commit)},this.state={prevValue:e.value,value:e.value}}componentWillUnmount(){this._flush()}render(){const{value:t}=this.state;return o.createElement(e,{...this.props,value:t,onChange:this._onChange,onBlur:this._onBlur,onKeyDown:this._onKeyDown})}static getDerivedStateFromProps(e,t){return e.value===t.prevValue?t:{prevValue:e.value,value:e.value}}_debounce(e){e?(clearTimeout(this._timeout),e!==1/0&&(this._timeout=setTimeout((()=>this._flush()),e))):this.setState((e=>{this._flush(e.value)}))}_flush(e){const{input:{id:t,name:n},onChange:o}=this.props,{prevValue:s,value:r}=this.state;clearTimeout(this._timeout);const a=void 0!==e?e:r;void 0!==a&&a!==s&&o(a,t,n)}}}},47510:(e,t,n)=>{"use strict";n.d(t,{FloatInput:()=>d,FloatInputComponent:()=>p});var o=n(50959),s=n(97754),r=n.n(s),a=n(95052),i=n(83207),l=n(90009),c=n(27698);class u extends o.PureComponent{render(){const{hasTooltip:e}=this.props;return o.createElement(a.NumericInput,{...this.props,className:r()(c.input,e&&c.hasTooltip),stretch:!1})}}const p=(0,l.debounced)(u,{change:1/0,commit:0,blur:0}),d=(0,i.bind)(p)},96438:(e,t,n)=>{"use strict";n.d(t,{IntegerInput:()=>d,IntegerInputComponent:()=>p});var o=n(50959),s=n(97754),r=n.n(s),a=n(83207),i=n(90009),l=n(95052),c=n(27698);class u extends o.PureComponent{render(){const{hasTooltip:e}=this.props;return o.createElement(l.NumericInput,{...this.props,mode:"integer",className:r()(c.input,e&&c.hasTooltip),stretch:!1})}}const p=(0,i.debounced)(u,{change:1/0,commit:0,blur:0}),d=(0,a.bind)(p)},95052:(e,t,n)=>{"use strict";n.d(t,{NumericInput:()=>y});var o=n(50959),s=n(50151),r=n(44352),a=n(60521),i=n(49483),l=n(92399),c=n(82161),u=n(38223);var p=n(87663),d=n(37160);const h=r.t(null,void 0,n(35563)),m=new class{constructor(e=" "){this._divider=e}format(e){const t=(0,c.splitThousands)(e,this._divider);return(0,u.isRtl)()?(0,u.startWithLTR)(t):t}parse(e){const t=(0,u.stripLTRMarks)(e).split(this._divider).join(""),n=Number(t);return isNaN(n)||/e/i.test(t)?{res:!1}:{res:!0,value:n,suggest:this.format(n)}}},v=/^-?[0-9]*$/,g=9e15;class b extends o.PureComponent{constructor(e){super(e),this._onFocus=e=>{this.setState({focused:!0}),this.props.onFocus&&this.props.onFocus(e)},this._onBlur=e=>{this.setState({focused:!1}),!1!==this.props.shouldApplyValueOnBlur&&(this.setState({displayValue:f(this.props,this.props.value)}),this.props.errorHandler&&this.props.errorHandler(!1)),this.props.onBlur&&this.props.onBlur(e)},this._onValueChange=e=>{const t=e.target.value;if(void 0!==this.props.onEmptyString&&""===t&&this.props.onEmptyString(),"integer"===this.props.mode&&!v.test(t))return;const n=C(t,this.props.formatter),o=n.res?this._checkValueBoundaries(n.value):{isPassed:!1,msg:void 0},s=n.res&&!o.isPassed,r=n.res&&n.suggest&&!this.state.focused?n.suggest:t,a=s&&o.msg?o.msg:h;this.setState({displayValue:r,errorMsg:a}),n.res&&o.isPassed&&this.props.onValueChange(n.value,"input"),
|
||||
this.props.errorHandler&&this.props.errorHandler(!n.res||s)},this._onValueByStepChange=e=>{const{roundByStep:t=!0,step:n=1,uiStep:o,min:s=n,formatter:r}=this.props,i=C(this.state.displayValue,r),l=null!=o?o:n;let c=n;if(i.res){const o=new a.Big(i.value),r=o.minus(s).mod(n);let u=o.plus(e*l);!r.eq(0)&&t&&(u=u.plus((e>0?0:1)*l).minus(r)),c=u.toNumber()}const{isPassed:u,clampedValue:p}=this._checkValueBoundaries(c);c=u?c:p,this.setState({displayValue:f(this.props,c)}),this.props.onValueChange(c,"step"),this.props.errorHandler&&this.props.errorHandler(!1)};const{value:t}=e;this.state={value:t,displayValue:f(e,t),focused:!1,errorMsg:h}}render(){var e;return o.createElement(l.NumberInputView,{id:this.props.id,inputMode:null!==(e=this.props.inputMode)&&void 0!==e?e:i.CheckMobile.iOS()?void 0:"numeric",borderStyle:this.props.borderStyle,fontSizeStyle:this.props.fontSizeStyle,value:this.state.displayValue,forceShowControls:this.props.forceShowControls,className:this.props.className,inputClassName:this.props.inputClassName,button:this.props.button,placeholder:this.props.placeholder,innerLabel:this.props.innerLabel,endSlot:this.props.endSlot,disabled:this.props.disabled,warning:this.props.warning,error:this.props.error,errorMessage:this.props.errorMessage||this.state.errorMsg,onValueChange:this._onValueChange,onValueByStepChange:this._onValueByStepChange,containerReference:this.props.containerReference,inputReference:this.props.inputReference,onClick:this.props.onClick,onFocus:this._onFocus,onBlur:this._onBlur,onKeyDown:this.props.onKeyDown,controlDecKeyCodes:this.props.controlDecKeyCodes,controlIncKeyCodes:this.props.controlIncKeyCodes,title:this.props.title,intent:this.props.intent,highlight:this.props.highlight,highlightRemoveRoundBorder:this.props.highlightRemoveRoundBorder,stretch:this.props.stretch,autoSelectOnFocus:!i.CheckMobile.any(),"data-name":this.props["data-name"]})}getClampedValue(){const{min:e=-1/0,max:t=g}=this.props,n=C(this.state.displayValue,this.props.formatter);return n.res?(0,d.clamp)(n.value,e,t):null}static getDerivedStateFromProps(e,t){const{alwaysUpdateValueFromProps:n,value:o}=e;return t.focused&&!n||t.value===o?null:{value:o,displayValue:f(e,o)}}_checkValueBoundaries(e){var t,o,s,a;const{min:i=-1/0,max:l=g}=this.props,c=function(e,t,n){const o=e>=t,s=e<=n;return{passMin:o,passMax:s,pass:o&&s,clamped:(0,d.clamp)(e,t,n)}}(e,i,l);let u;return c.passMax||(u=null!==(o=null===(t=this.props.boundariesErrorMessages)||void 0===t?void 0:t.greaterThanMax)&&void 0!==o?o:r.t(null,{replace:{max:String(l)}},n(2607))),c.passMin||(u=null!==(a=null===(s=this.props.boundariesErrorMessages)||void 0===s?void 0:s.lessThanMin)&&void 0!==a?a:r.t(null,{replace:{min:String(i)}},n(53669))),{isPassed:c.pass,msg:u,clampedValue:c.clamped}}}function f(e,t){const{useFormatter:n=!0,formatter:o,mode:s}=e;return n&&"integer"!==s?function(e,t=m){return null!==e?t.format(e):""}(t,o):function(e){if(null===e)return"";return p.NumericFormatter.formatNoE(e)}(t)}function C(e,t=m){return t.parse?t.parse(e):{res:!1,
|
||||
error:"Formatter does not support parse"}}class y extends o.PureComponent{constructor(){super(...arguments),this._container=null,this._handleContainerRef=e=>this._container=e,this._onChange=(e,t)=>{const{input:{id:n,name:o},onChange:s,onBlur:r}=this.props;s(e,n,o),"step"===t&&r&&r()},this._onBlur=e=>{const{onBlur:t}=this.props;if(t){const n=(0,s.ensureNotNull)(this._container);n.contains(document.activeElement)||n.contains(e.relatedTarget)||t()}}}render(){const{input:{defval:e,min:t,max:n,step:s},value:r,disabled:a,onKeyDown:i,className:l,mode:c,stretch:u}=this.props;return o.createElement(b,{className:l,value:Number(void 0===r?e:r),min:t,max:n,step:s,mode:c,onBlur:this._onBlur,onValueChange:this._onChange,onKeyDown:i,disabled:a,containerReference:this._handleContainerRef,fontSizeStyle:"medium",roundByStep:!1,stretch:u})}}},55141:(e,t,n)=>{"use strict";n.d(t,{SymbolInput:()=>p,getInternalSymbolName:()=>c});var o=n(50959),s=n(50151),r=n(76917),a=n(83207),i=n(73146),l=n(48897);function c(e,t){const n=(0,i.createAdapter)(t).resolvedSymbolInfoBySymbol(e);return n&&(n.ticker||n.full_name)?n.ticker||n.full_name:e}function u(e,t){const n=(0,i.createAdapter)(t).resolvedSymbolInfoBySymbol(e);return null===n?e:n.name}const p=(0,a.bind)((function(e){const t=(0,o.useContext)(r.PropertyContext),{study:n}=(0,s.ensureNotNull)(t),{input:{defval:a},value:i}=e;return o.createElement(l.SymbolInputsButton,{...e,value:u(i||a||"",n),study:n})}))},41552:(e,t,n)=>{"use strict";n.d(t,{ColorWithThicknessSelect:()=>g});var o=n(50959),s=n(24377),r=n(44352),a=n(36298),i=n(87095),l=n(41594),c=n(58593),u=n(17948),p=n(51768);const d=new a.TranslatedString("change thickness",r.t(null,void 0,n(95657))),h=new a.TranslatedString("change color",r.t(null,void 0,n(13066))),m=new a.TranslatedString("change opacity",r.t(null,void 0,n(17023))),v=[1,2,3,4];class g extends o.PureComponent{constructor(){super(...arguments),this._trackEventLabel=null,this._getTransparencyValue=()=>{const{transparency:e}=this.props;return e?e.value():0},this._getOpacityValue=()=>{const{color:e}=this.props,t=(0,u.getPropertyValue)(e);if(t)return(0,i.isHexColor)(t)?(0,i.transparencyToAlpha)(this._getTransparencyValue()):(0,s.parseRgba)(t)[3]},this._getColorValueInHex=()=>{const{color:e}=this.props,t=(0,u.getPropertyValue)(e);return t?(0,i.isHexColor)(t)?t:(0,s.rgbToHexString)((0,s.parseRgb)(t)):null},this._onThicknessChange=e=>{const{thickness:t}=this.props;void 0!==t&&this._setProperty(t,e,d)},this._onColorChange=e=>{const{color:t,isPaletteColor:n}=this.props,o=(0,u.getPropertyValue)(t);let r=0;o&&(r=(0,i.isHexColor)(o)?this._getTransparencyValue():(0,i.alphaToTransparency)((0,s.parseRgba)(o)[3])),this._setProperty(t,(0,i.generateColor)(String(e),r,!0),h),this._trackEventLabel="Plot color > "+(n?"Palette":"Single")},this._onOpacityChange=e=>{const{color:t}=this.props,n=(0,u.getPropertyValue)(t);this._setProperty(t,(0,i.generateColor)(n,(0,i.alphaToTransparency)(e),!0),m)},this._onPopupClose=()=>{this._trackEventLabel&&((0,
|
||||
p.trackEvent)("GUI","Study settings",this._trackEventLabel),this._trackEventLabel=null)}}componentWillUnmount(){this._onPopupClose()}render(){const{selectOpacity:e=!0,disabled:t,className:n}=this.props;return o.createElement(c.ColorSelect,{className:n,disabled:t,color:this._getColorValueInHex(),selectOpacity:e,opacity:this._getOpacityValue(),thickness:this._getThicknessValue(),thicknessItems:v,onColorChange:this._onColorChange,onOpacityChange:this._onOpacityChange,onThicknessChange:this._onThicknessChange,onPopupClose:this._onPopupClose})}_getThicknessValue(){const{thickness:e}=this.props;return e?(0,u.getPropertyValue)(e):void 0}_setProperty(e,t,n){const{setValue:o}=this.context;(0,u.setPropertyValue)(e,(e=>o(e,t,n)))}}g.contextType=l.StylePropertyContext},11062:(e,t,n)=>{"use strict";n.d(t,{PropertyTable:()=>l});var o=n(50959),s=n(97754),r=n(90186),a=n(24712);const i=o.createContext(!1);class l extends o.PureComponent{render(){return o.createElement("div",{ref:this.props.reference,className:s(a.content,this.props.className)},this.props.children)}}l.InlineRowContext=i,l.Row=function(e){const{children:t}=e;return(0,o.useContext)(i)?o.createElement("span",{className:a.inlineRow},t):o.createElement(o.Fragment,null,t)},l.Cell=function(e){const t=(0,o.useContext)(i),n=s(a.cell,e.offset&&a.offset,e.grouped&&a.grouped,t&&a.inlineCell,"top"===e.verticalAlign&&a.top,"topCenter"===e.verticalAlign&&a.topCenter,"adaptive"===e.verticalAlign&&a.adaptive,e.checkableTitle&&a.checkableTitle,2===e.colSpan&&a.fill,"first"===e.placement&&2!==e.colSpan&&a.first,"last"===e.placement&&2!==e.colSpan&&a.last),l=(0,r.filterDataProps)(e);return o.createElement("div",{...l,className:n},o.createElement("div",{className:s(a.inner,e.className)},e.children))},l.Separator=function(e){return o.createElement(l.Row,null,o.createElement("div",{className:s(a.cell,a.separator,a.fill)}))},l.GroupSeparator=function(e){const t=e.size||0;return o.createElement(l.Row,null,o.createElement("div",{className:s(a.cell,a.groupSeparator,a.fill,1===t&&a.big)}))}},17948:(e,t,n)=>{"use strict";function o(e){return Array.isArray(e)?e[0].value():e.value()}function s(e,t){if(Array.isArray(e))for(const n of e)t(n);else t(e)}n.d(t,{getPropertyValue:()=>o,setPropertyValue:()=>s})},99084:e=>{e.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 18 18" width="18" height="18"><path fill="currentColor" d="M9 17A8 8 0 1 0 9 1a8 8 0 0 0 0 16Zm3.87-12.15c.36.2.49.66.28 1.02l-4 7a.75.75 0 0 1-1.18.16l-3-3a.75.75 0 1 1 1.06-1.06l2.3 2.3 3.52-6.14a.75.75 0 0 1 1.02-.28Z"/></svg>'},30162:e=>{e.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 18 18" width="18" height="18"><path fill="currentColor" fill-rule="evenodd" d="M9 17A8 8 0 1 0 9 1a8 8 0 0 0 0 16ZM9 4c-.79 0-1.38.7-1.25 1.48l.67 4.03a.59.59 0 0 0 1.16 0l.67-4.03A1.27 1.27 0 0 0 9 4Zm0 8a1 1 0 1 0 0 2 1 1 0 0 0 0-2Z"/></svg>'},27941:e=>{
|
||||
e.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 18 18" width="18" height="18"><path fill="currentColor" d="M9 17A8 8 0 1 0 9 1a8 8 0 0 0 0 16ZM8 6a1 1 0 1 1 2 0 1 1 0 0 1-2 0Zm1 2c.49 0 1 .59 1 1v3.01c0 .42-.51.99-1 .99s-1-.57-1-.99V9c0-.41.51-1 1-1Z"/></svg>'},82353:e=>{e.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 18 18" width="18" height="18"><path fill="currentColor" d="M9 17A8 8 0 1 0 9 1a8 8 0 0 0 0 16Zm0-3a1 1 0 1 1 0-2 1 1 0 0 1 0 2ZM6 7.5a3 3 0 1 1 6 0c0 .96-.6 1.48-1.17 1.98-.55.48-1.08.95-1.08 1.77h-1.5c0-1.37.7-1.9 1.33-2.38.49-.38.92-.71.92-1.37C10.5 6.67 9.82 6 9 6s-1.5.67-1.5 1.5H6Z"/></svg>'},65890:e=>{e.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 11 9" width="11" height="9" fill="none"><path stroke-width="2" d="M0.999878 4L3.99988 7L9.99988 1"/></svg>'},93929:e=>{e.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 18 18" width="18" height="18" fill="none"><path stroke="currentColor" d="M13.5 7l1.65-1.65a.5.5 0 0 0 0-.7l-1.8-1.8a.5.5 0 0 0-.7 0L11 4.5M13.5 7L11 4.5M13.5 7l-8.35 8.35a.5.5 0 0 1-.36.15H2.5v-2.3a.5.5 0 0 1 .15-.35L11 4.5"/></svg>'}}]);
|
||||
;const W=void 0,A=["1","3","5","15","30","45","60","120","180","240","1D","1W","1M","3M","6M","12M"],q=["1S","5S","10S","15S","30S"];class U extends s.PureComponent{constructor(){super(...arguments),this._onChange=e=>{const{input:{id:t,name:n},onChange:o}=this.props;o(e,t,n)}}render(){const{input:e,value:t,disabled:r,hasTooltip:a}=this.props,i=R.Interval.parse(void 0===t?e.defval:t),l=i.isValid()?i.value():t,c=W?W.get().filter((e=>!R.Interval.parse(e).isRange())):[],u=(0,L.mergeResolutions)(A,(0,L.isSecondsEnabled)()?q:[],c);return u.unshift(""),s.createElement(P.Select,{id:e.id,className:p()(v.input,v.resolution,a&&v.hasTooltip),menuClassName:p()(v.dropdownMenu,v.resolution),items:(d=u,d.map((e=>({value:e,content:""===e?o.t(null,void 0,n(94551)):(0,L.getTranslatedResolutionModel)(e).hint})))),value:l,onChange:this._onChange,disabled:r});var d}}const z=(0,h.bind)(U);var Z=n(41552),G=n(41594);class H extends s.PureComponent{render(){return s.createElement(k.PropertyContext.Consumer,null,(e=>e?this._getColorInputWithContext(e):null))}_getColorInputWithContext(e){var t;const{input:{id:n},disabled:o,hasTooltip:r}=this.props,{model:a,study:i}=e;if("properties"in i||"tempProperties"in i){const e="properties"in i?i.properties().inputs[n]:null===(t=i.tempProperties)||void 0===t?void 0:t.inputs.child(n);return s.createElement(G.StylePropertyContainer,{model:a,property:e},s.createElement(Z.ColorWithThicknessSelect,{className:p()(r&&v.hasTooltip),color:e,disabled:o}))}return null}}var K=n(85528),$=n(76056),Y=n(23935),j=n(27365),X=n(93071);const Q=(0,h.bind)((function(e){const{value:t,onChange:n,input:o,tzName:r,hasTooltip:a}=e,{id:i,name:l,defval:c}=o,u=(0,s.useMemo)((()=>Number(null!=t?t:c)),[t,c]),d=(0,s.useMemo)((()=>(0,j.getChartTimezoneOffsetMs)(u,r)),[u,r]),h=(0,s.useMemo)((()=>{const e=new Date(u+d+v(u));return e.setSeconds(0),e}),[u,d]),m=(0,s.useMemo)((()=>(0,Y.twoDigitsFormat)(h.getHours())+":"+(0,Y.twoDigitsFormat)(h.getMinutes())),[h]);return s.createElement("div",{className:p()(X.container,a&&X.hasTooltip)},s.createElement("div",{className:X.datePickerWrapper},s.createElement(K.DatePicker,{InputComponent:$.DateInput,initial:h,onPick:function(e){if(null===e)return;const t=new Date(h);t.setFullYear(e.getFullYear()),t.setMonth(e.getMonth()),t.setDate(e.getDate()),n(g(t),i,l)},revertInvalidData:!0})),s.createElement("div",{className:X.timePickerWrapper},s.createElement(S.TimeInput,{value:m,onChange:function(e){const[t,o]=e.split(":"),s=new Date(h);s.setHours(Number(t)),s.setMinutes(Number(o)),n(g(s),i,l)}})));function v(e){return 60*new Date(e).getTimezoneOffset()*1e3}function g(e){return e.valueOf()-d-v(u)}}));class J extends s.PureComponent{render(){const{input:e,disabled:t,onChange:n,tzName:o,hasTooltip:r}=this.props;if((0,a.isStudyInputOptionsInfo)(e))return s.createElement(D,{input:e,disabled:t,onChange:n,hasTooltip:r});switch(e.type){case"integer":return s.createElement(i.IntegerInput,{input:e,disabled:t,onChange:n,hasTooltip:r});case"float":case"price":return s.createElement(l.FloatInput,{input:e,disabled:t,
|
||||
onChange:n,hasTooltip:r});case"bool":return s.createElement(c.BoolInput,{input:e,disabled:t,onChange:n,hasTooltip:r});case"text":return s.createElement(f,{input:e,disabled:t,onChange:n,hasTooltip:r});case"symbol":return s.createElement(C.SymbolInput,{input:e,disabled:t,onChange:n,hasTooltip:r});case"session":return s.createElement(_,{input:e,disabled:t,onChange:n,hasTooltip:r});case"source":return s.createElement(F,{input:e,disabled:t,onChange:n,hasTooltip:r});case"resolution":return s.createElement(z,{input:e,disabled:t,onChange:n,hasTooltip:r});case"time":return s.createElement(Q,{input:e,tzName:o,onChange:n,hasTooltip:r});case"color":return s.createElement(H,{input:e,disabled:t,onChange:n,hasTooltip:r});default:return null}}}var ee=n(39847),te=n(76694);class ne extends s.PureComponent{render(){const{label:e,children:t,input:a,disabled:i,onChange:l,labelAlign:c,grouped:u,tooltip:p,solutionId:d,offset:h}=this.props,m=Boolean(p);return s.createElement(y.PropertyTable.Row,null,s.createElement(y.PropertyTable.Cell,{"data-study-input-name":(null==a?void 0:a.id)&&`${a.id}-label`,placement:"first",verticalAlign:c,grouped:u,offset:h},void 0!==e?e:o.t((0,r.ensureDefined)(a).name,{context:"input"},n(88601))),s.createElement(y.PropertyTable.Cell,{"data-study-input-name":(null==a?void 0:a.id)&&`${a.id}-input`,placement:"last",grouped:u},t||s.createElement(J,{input:(0,r.ensureDefined)(a),onChange:l,disabled:i,hasTooltip:m}),m&&s.createElement(te.IconGroupWrapper,null,p&&s.createElement(ee.InputTooltip,{title:p}),!1)))}}},39828:(e,t,n)=>{"use strict";n.d(t,{InputsTabContent:()=>A});var o,s=n(50959),r=n(50151),a=n(44352),i=n(76917),l=n(11062),c=n(57733),u=n(97754),p=n.n(u),d=n(88400),h=n.n(d);const m=(0,c.makeSwitchGroupItem)(((o=class extends s.PureComponent{constructor(){super(...arguments),this._onChange=()=>{this.props.onChange&&this.props.onChange(this.props.value)}}render(){const e=u(this.props.className,h().radio,{[h().reverse]:Boolean(this.props.labelPositionReverse)}),t=u(h().label,{[h().disabled]:this.props.disabled}),n=u(h().box,{[h().noOutline]:-1===this.props.tabIndex});let o=null;return this.props.label&&(o=s.createElement("span",{className:t},this.props.label)),s.createElement("label",{className:e},s.createElement("span",{className:h().wrapper,title:this.props.title},s.createElement("input",{id:this.props.id,tabIndex:this.props.tabIndex,autoFocus:this.props.autoFocus,role:this.props.role,className:h().input,type:"radio",name:this.props.name,checked:this.props.checked,disabled:this.props.disabled,value:this.props.value,onChange:this._onChange,ref:this.props.reference,"aria-describedby":this.props["aria-describedby"],"aria-invalid":this.props["aria-invalid"]}),s.createElement("span",{className:n})),o)}}).defaultProps={value:"on"},o));var v=n(55141),g=n(83207),b=n(39847),f=n(76694),C=n(27698);function y(e){const{children:t,input:o,disabled:u,onChange:p,grouped:d,tooltip:h,solutionId:y}=e,E=(0,s.useContext)(i.PropertyContext),{values:S,setValue:w}=(0,r.ensureNotNull)(E),x=S[o.id],[_,N]=(0,
|
||||
s.useState)(x?"another-symbol":"main-symbol"),[T,I]=(0,s.useState)(x),k=Boolean(h);return(0,s.useEffect)((()=>{x&&I(x)}),[x]),s.createElement(c.SwitchGroup,{name:`symbol-source-${o.id}`,values:[_],onChange:function(e){N(e),"main-symbol"===e?(0,g.setter)(w)("",o.id,o.name):"another-symbol"===e&&T&&(0,g.setter)(w,p)(T,o.id,o.name)}},s.createElement(l.PropertyTable.Row,null,s.createElement(l.PropertyTable.Cell,{colSpan:2,placement:"first",grouped:d,"data-study-input-name":(null==o?void 0:o.id)&&`${o.id}-main-symbol`},s.createElement(m,{value:"main-symbol",className:C.checkbox,disabled:u,label:s.createElement("span",{className:C.label},a.t(null,{context:"input"},n(88046)))}))),s.createElement(l.PropertyTable.Row,null,s.createElement(l.PropertyTable.Cell,{placement:"first",grouped:d,"data-study-input-name":(null==o?void 0:o.id)&&`${o.id}-another-symbol-label`},s.createElement(m,{value:"another-symbol",className:C.checkbox,disabled:u,label:s.createElement("span",{className:C.label},a.t(null,{context:"input"},n(73755)))})),s.createElement(l.PropertyTable.Cell,{placement:"last",grouped:d,"data-study-input-name":(null==o?void 0:o.id)&&`${o.id}-another-symbol-input`},t||s.createElement(v.SymbolInput,{input:(0,r.ensureDefined)(o),onChange:p,disabled:u||"main-symbol"===_,hasTooltip:k}),k&&s.createElement(f.IconGroupWrapper,null,h&&s.createElement(b.InputTooltip,{title:h}),!1))))}var E=n(4781);class S extends s.PureComponent{render(){const{label:e,input:t,tooltip:n,solutionId:o}=this.props,r=Boolean(n);return s.createElement(l.PropertyTable.Row,null,s.createElement(l.PropertyTable.Cell,{placement:"first",colSpan:2,"data-study-input-name":(null==t?void 0:t.id)&&`${t.id}-checkbox`},s.createElement(E.BoolInput,{label:e,input:t,hasTooltip:r}),r&&s.createElement(f.IconGroupWrapper,null,n&&s.createElement(b.InputTooltip,{title:n}),!1)))}}var w=n(12949),x=n(2568),_=n(67029),N=n(90009);class T extends s.PureComponent{constructor(){super(...arguments),this._onChange=e=>{const{input:{id:t,name:n},onChange:o}=this.props;o(e.currentTarget.value,t,n)}}render(){const{input:{defval:e},value:t,disabled:n,onBlur:o,onKeyDown:r}=this.props;return s.createElement(x.Textarea,{className:p()(C.input,C.textarea,_.InputClasses.FontSizeMedium),value:void 0===t?e:t,onChange:this._onChange,onBlur:o,onKeyDown:r,disabled:n,maxLength:4096})}}const I=(0,N.debounced)(T),k=(0,g.bind)(I);var P=n(80128);function B(e){const{input:t,label:n,tooltip:o,solutionId:r}=e,a=Boolean(o);return s.createElement(l.PropertyTable.Row,null,s.createElement(l.PropertyTable.Cell,{placement:"first",colSpan:2,className:P.wrap,"data-study-input-name":(null==t?void 0:t.id)&&`${t.id}-textarea`},s.createElement("div",{className:P.labelWrap},s.createElement("span",{className:p()(P.label,a&&P.hasTooltip)},n),a&&s.createElement(f.IconGroupWrapper,null,o&&s.createElement(b.InputTooltip,{title:o}),!1)),s.createElement(k,{input:t})))}function D(e){const{input:t,tooltip:o,solutionId:r}=e;return"symbol"===t.type&&t.optional?s.createElement(y,{input:t,tooltip:o,solutionId:r
|
||||
}):"bool"===t.type?s.createElement(S,{label:a.t(t.name,{context:"input"},n(88601)),input:t,tooltip:o,solutionId:r}):"text_area"===t.type?s.createElement(B,{label:a.t(t.name,{context:"input"},n(88601)),input:t,tooltip:o,solutionId:r}):s.createElement(w.InputRow,{labelAlign:function(e){switch(e){case"session":return"adaptive";case"time":return"topCenter";default:return}}(t.type),input:t,tooltip:o,solutionId:r})}var M=n(86067),V=n(17611);function O(e){const{content:t}=e;let n;return s.createElement(l.PropertyTable.InlineRowContext.Provider,{value:!0},s.createElement("div",{className:V.inlineRow},t.children.map(((e,o)=>(void 0!==e.tooltip&&(n=e.tooltip),s.createElement(D,{key:e.id,input:e,tooltip:o===t.children.length-1?n:void 0}))))))}var F=n(64420),R=n(26278);function L(e){const{content:t}=e;return(0,F.isGroup)(t)?(0,F.isInputInlines)(t)?s.createElement(O,{content:t}):s.createElement(s.Fragment,null,s.createElement("div",{className:R.titleWrap},s.createElement(M.GroupTitleSection,{title:a.t(t.id,{context:"input"},n(88601)),name:t.id})),t.children.map((e=>(0,F.isGroup)(e)?s.createElement(O,{key:e.id,content:e}):s.createElement(D,{key:e.id,input:e,tooltip:e.tooltip,solutionId:e.solutionId}))),s.createElement("div",{className:R.groupFooter})):s.createElement(D,{input:t,tooltip:t.tooltip,solutionId:t.solutionId})}const W={offset:a.t(null,void 0,n(89298))};class A extends s.PureComponent{render(){const{reference:e,inputs:t,property:n,study:o,studyMetaInfo:a,model:i,onStudyInputChange:c,className:u}=this.props,{offset:p,offsets:d}=n;return s.createElement(l.PropertyTable,{reference:e,className:u},s.createElement(q,{study:o,model:i,property:n.inputs,inputs:t,onStudyInputChange:c}),p&&this._createOffsetSection(p,(0,r.ensureDefined)(a.offset)),d&&d.childNames().map((e=>{var t;const n=d.childs()[e];return this._createOffsetSection(n,(0,r.ensureDefined)(null===(t=a.offsets)||void 0===t?void 0:t[e]))})))}_createOffsetSection(e,t){const n=e.childs();return s.createElement(q,{key:`offset_${t.title}`,study:this.props.study,model:this.props.model,inputs:[U(n,t)],property:e})}}function q(e){const{study:t,model:n,inputs:o,property:r,onStudyInputChange:a}=e,l=o,c=(0,s.useMemo)((()=>(0,F.getInputGroups)(l)),[l]);return s.createElement(i.PropertyContainer,{property:r,study:t,model:n,onStudyInputChange:a},!1,!1,c.map((e=>s.createElement(s.Fragment,{key:e.id},s.createElement(L,{content:e}),!1))))}function U(e,t){return{id:"val",name:t.title||W.offset,defval:e.val.value(),type:"integer",min:t.min,max:t.max}}},4781:(e,t,n)=>{"use strict";n.d(t,{BoolInput:()=>u,BoolInputComponent:()=>c});var o=n(50959),s=n(15294),r=n(97754),a=n.n(r),i=n(83207),l=n(27698);class c extends o.PureComponent{constructor(){super(...arguments),this._onChange=()=>{const{input:{id:e,name:t},value:n,onChange:o}=this.props;o(!n,e,t)}}render(){const{input:{defval:e},value:t,disabled:n,label:r,hasTooltip:i}=this.props,c=void 0===t?e:t;return o.createElement(s.Checkbox,{className:a()(l.checkbox,i&&l.hasTooltip),disabled:n,checked:c,onChange:this._onChange,
|
||||
label:o.createElement("span",{className:l.label},r),labelAlignBaseline:!0})}}const u=(0,i.bind)(c)},90009:(e,t,n)=>{"use strict";n.d(t,{debounced:()=>r});var o=n(50959);const s={blur:0,commit:0,change:1/0};function r(e,t=s){return class extends o.PureComponent{constructor(e){super(e),this._onChange=(e,n,o)=>{const s=t.change;s?(clearTimeout(this._timeout),this.setState({value:e},(()=>{s!==1/0&&(this._timeout=setTimeout((()=>this._flush()),s))}))):this._flush(e)},this._onBlur=()=>{this._debounce(t.blur);const{onBlur:e}=this.props;e&&e()},this._onKeyDown=e=>{13===e.keyCode&&this._debounce(t.commit)},this.state={prevValue:e.value,value:e.value}}componentWillUnmount(){this._flush()}render(){const{value:t}=this.state;return o.createElement(e,{...this.props,value:t,onChange:this._onChange,onBlur:this._onBlur,onKeyDown:this._onKeyDown})}static getDerivedStateFromProps(e,t){return e.value===t.prevValue?t:{prevValue:e.value,value:e.value}}_debounce(e){e?(clearTimeout(this._timeout),e!==1/0&&(this._timeout=setTimeout((()=>this._flush()),e))):this.setState((e=>{this._flush(e.value)}))}_flush(e){const{input:{id:t,name:n},onChange:o}=this.props,{prevValue:s,value:r}=this.state;clearTimeout(this._timeout);const a=void 0!==e?e:r;void 0!==a&&a!==s&&o(a,t,n)}}}},47510:(e,t,n)=>{"use strict";n.d(t,{FloatInput:()=>d,FloatInputComponent:()=>p});var o=n(50959),s=n(97754),r=n.n(s),a=n(95052),i=n(83207),l=n(90009),c=n(27698);class u extends o.PureComponent{render(){const{hasTooltip:e}=this.props;return o.createElement(a.NumericInput,{...this.props,className:r()(c.input,e&&c.hasTooltip),stretch:!1})}}const p=(0,l.debounced)(u,{change:1/0,commit:0,blur:0}),d=(0,i.bind)(p)},96438:(e,t,n)=>{"use strict";n.d(t,{IntegerInput:()=>d,IntegerInputComponent:()=>p});var o=n(50959),s=n(97754),r=n.n(s),a=n(83207),i=n(90009),l=n(95052),c=n(27698);class u extends o.PureComponent{render(){const{hasTooltip:e}=this.props;return o.createElement(l.NumericInput,{...this.props,mode:"integer",className:r()(c.input,e&&c.hasTooltip),stretch:!1})}}const p=(0,i.debounced)(u,{change:1/0,commit:0,blur:0}),d=(0,a.bind)(p)},95052:(e,t,n)=>{"use strict";n.d(t,{NumericInput:()=>y});var o=n(50959),s=n(50151),r=n(44352),a=n(60521),i=n(49483),l=n(92399),c=n(82161),u=n(38223);var p=n(87663),d=n(37160);const h=r.t(null,void 0,n(35563)),m=new class{constructor(e=" "){this._divider=e}format(e){const t=(0,c.splitThousands)(e,this._divider);return(0,u.isRtl)()?(0,u.startWithLTR)(t):t}parse(e){const t=(0,u.stripLTRMarks)(e).split(this._divider).join(""),n=Number(t);return isNaN(n)||/e/i.test(t)?{res:!1}:{res:!0,value:n,suggest:this.format(n)}}},v=/^-?[0-9]*$/,g=9e15;class b extends o.PureComponent{constructor(e){super(e),this._onFocus=e=>{this.setState({focused:!0}),this.props.onFocus&&this.props.onFocus(e)},this._onBlur=e=>{this.setState({focused:!1}),!1!==this.props.shouldApplyValueOnBlur&&(this.setState({displayValue:f(this.props,this.props.value)}),this.props.errorHandler&&this.props.errorHandler(!1)),this.props.onBlur&&this.props.onBlur(e)},this._onValueChange=e=>{
|
||||
const t=e.target.value;if(void 0!==this.props.onEmptyString&&""===t&&this.props.onEmptyString(),"integer"===this.props.mode&&!v.test(t))return;const n=C(t,this.props.formatter),o=n.res?this._checkValueBoundaries(n.value):{isPassed:!1,msg:void 0},s=n.res&&!o.isPassed,r=n.res&&n.suggest&&!this.state.focused?n.suggest:t,a=s&&o.msg?o.msg:h;this.setState({displayValue:r,errorMsg:a}),n.res&&o.isPassed&&this.props.onValueChange(n.value,"input"),this.props.errorHandler&&this.props.errorHandler(!n.res||s)},this._onValueByStepChange=e=>{const{roundByStep:t=!0,step:n=1,uiStep:o,min:s=n,formatter:r}=this.props,i=C(this.state.displayValue,r),l=null!=o?o:n;let c=n;if(i.res){const o=new a.Big(i.value),r=o.minus(s).mod(n);let u=o.plus(e*l);!r.eq(0)&&t&&(u=u.plus((e>0?0:1)*l).minus(r)),c=u.toNumber()}const{isPassed:u,clampedValue:p}=this._checkValueBoundaries(c);c=u?c:p,this.setState({displayValue:f(this.props,c)}),this.props.onValueChange(c,"step"),this.props.errorHandler&&this.props.errorHandler(!1)};const{value:t}=e;this.state={value:t,displayValue:f(e,t),focused:!1,errorMsg:h}}render(){var e;return o.createElement(l.NumberInputView,{id:this.props.id,inputMode:null!==(e=this.props.inputMode)&&void 0!==e?e:i.CheckMobile.iOS()?void 0:"numeric",borderStyle:this.props.borderStyle,fontSizeStyle:this.props.fontSizeStyle,value:this.state.displayValue,forceShowControls:this.props.forceShowControls,className:this.props.className,inputClassName:this.props.inputClassName,button:this.props.button,placeholder:this.props.placeholder,innerLabel:this.props.innerLabel,endSlot:this.props.endSlot,disabled:this.props.disabled,warning:this.props.warning,error:this.props.error,errorMessage:this.props.errorMessage||this.state.errorMsg,onValueChange:this._onValueChange,onValueByStepChange:this._onValueByStepChange,containerReference:this.props.containerReference,inputReference:this.props.inputReference,onClick:this.props.onClick,onFocus:this._onFocus,onBlur:this._onBlur,onKeyDown:this.props.onKeyDown,controlDecKeyCodes:this.props.controlDecKeyCodes,controlIncKeyCodes:this.props.controlIncKeyCodes,title:this.props.title,intent:this.props.intent,highlight:this.props.highlight,highlightRemoveRoundBorder:this.props.highlightRemoveRoundBorder,stretch:this.props.stretch,autoSelectOnFocus:!i.CheckMobile.any(),"data-name":this.props["data-name"]})}getClampedValue(){const{min:e=-1/0,max:t=g}=this.props,n=C(this.state.displayValue,this.props.formatter);return n.res?(0,d.clamp)(n.value,e,t):null}static getDerivedStateFromProps(e,t){const{alwaysUpdateValueFromProps:n,value:o}=e;return t.focused&&!n||t.value===o?null:{value:o,displayValue:f(e,o)}}_checkValueBoundaries(e){var t,o,s,a;const{min:i=-1/0,max:l=g}=this.props,c=function(e,t,n){const o=e>=t,s=e<=n;return{passMin:o,passMax:s,pass:o&&s,clamped:(0,d.clamp)(e,t,n)}}(e,i,l);let u;return c.passMax||(u=null!==(o=null===(t=this.props.boundariesErrorMessages)||void 0===t?void 0:t.greaterThanMax)&&void 0!==o?o:r.t(null,{replace:{max:String(l)}},n(2607))),
|
||||
c.passMin||(u=null!==(a=null===(s=this.props.boundariesErrorMessages)||void 0===s?void 0:s.lessThanMin)&&void 0!==a?a:r.t(null,{replace:{min:String(i)}},n(53669))),{isPassed:c.pass,msg:u,clampedValue:c.clamped}}}function f(e,t){const{useFormatter:n=!0,formatter:o,mode:s}=e;return n&&"integer"!==s?function(e,t=m){return null!==e?t.format(e):""}(t,o):function(e){if(null===e)return"";return p.NumericFormatter.formatNoE(e)}(t)}function C(e,t=m){return t.parse?t.parse(e):{res:!1,error:"Formatter does not support parse"}}class y extends o.PureComponent{constructor(){super(...arguments),this._container=null,this._handleContainerRef=e=>this._container=e,this._onChange=(e,t)=>{const{input:{id:n,name:o},onChange:s,onBlur:r}=this.props;s(e,n,o),"step"===t&&r&&r()},this._onBlur=e=>{const{onBlur:t}=this.props;if(t){const n=(0,s.ensureNotNull)(this._container);n.contains(document.activeElement)||n.contains(e.relatedTarget)||t()}}}render(){const{input:{defval:e,min:t,max:n,step:s},value:r,disabled:a,onKeyDown:i,className:l,mode:c,stretch:u}=this.props;return o.createElement(b,{className:l,value:Number(void 0===r?e:r),min:t,max:n,step:s,mode:c,onBlur:this._onBlur,onValueChange:this._onChange,onKeyDown:i,disabled:a,containerReference:this._handleContainerRef,fontSizeStyle:"medium",roundByStep:!1,stretch:u})}}},55141:(e,t,n)=>{"use strict";n.d(t,{SymbolInput:()=>p,getInternalSymbolName:()=>c});var o=n(50959),s=n(50151),r=n(76917),a=n(83207),i=n(73146),l=n(48897);function c(e,t){const n=(0,i.createAdapter)(t).resolvedSymbolInfoBySymbol(e);return n&&(n.ticker||n.full_name)?n.ticker||n.full_name:e}function u(e,t){const n=(0,i.createAdapter)(t).resolvedSymbolInfoBySymbol(e);return null===n?e:n.name}const p=(0,a.bind)((function(e){const t=(0,o.useContext)(r.PropertyContext),{study:n}=(0,s.ensureNotNull)(t),{input:{defval:a},value:i}=e;return o.createElement(l.SymbolInputsButton,{...e,value:u(i||a||"",n),study:n})}))},41552:(e,t,n)=>{"use strict";n.d(t,{ColorWithThicknessSelect:()=>g});var o=n(50959),s=n(24377),r=n(44352),a=n(36298),i=n(87095),l=n(41594),c=n(58593),u=n(17948),p=n(51768);const d=new a.TranslatedString("change thickness",r.t(null,void 0,n(95657))),h=new a.TranslatedString("change color",r.t(null,void 0,n(13066))),m=new a.TranslatedString("change opacity",r.t(null,void 0,n(17023))),v=[1,2,3,4];class g extends o.PureComponent{constructor(){super(...arguments),this._trackEventLabel=null,this._getTransparencyValue=()=>{const{transparency:e}=this.props;return e?e.value():0},this._getOpacityValue=()=>{const{color:e}=this.props,t=(0,u.getPropertyValue)(e);if(t)return(0,i.isHexColor)(t)?(0,i.transparencyToAlpha)(this._getTransparencyValue()):(0,s.parseRgba)(t)[3]},this._getColorValueInHex=()=>{const{color:e}=this.props,t=(0,u.getPropertyValue)(e);return t?(0,i.isHexColor)(t)?t:(0,s.rgbToHexString)((0,s.parseRgb)(t)):null},this._onThicknessChange=e=>{const{thickness:t}=this.props;void 0!==t&&this._setProperty(t,e,d)},this._onColorChange=e=>{const{color:t,isPaletteColor:n}=this.props,o=(0,u.getPropertyValue)(t);let r=0;o&&(r=(0,
|
||||
i.isHexColor)(o)?this._getTransparencyValue():(0,i.alphaToTransparency)((0,s.parseRgba)(o)[3])),this._setProperty(t,(0,i.generateColor)(String(e),r,!0),h),this._trackEventLabel="Plot color > "+(n?"Palette":"Single")},this._onOpacityChange=e=>{const{color:t}=this.props,n=(0,u.getPropertyValue)(t);this._setProperty(t,(0,i.generateColor)(n,(0,i.alphaToTransparency)(e),!0),m)},this._onPopupClose=()=>{this._trackEventLabel&&((0,p.trackEvent)("GUI","Study settings",this._trackEventLabel),this._trackEventLabel=null)}}componentWillUnmount(){this._onPopupClose()}render(){const{selectOpacity:e=!0,disabled:t,className:n}=this.props;return o.createElement(c.ColorSelect,{className:n,disabled:t,color:this._getColorValueInHex(),selectOpacity:e,opacity:this._getOpacityValue(),thickness:this._getThicknessValue(),thicknessItems:v,onColorChange:this._onColorChange,onOpacityChange:this._onOpacityChange,onThicknessChange:this._onThicknessChange,onPopupClose:this._onPopupClose})}_getThicknessValue(){const{thickness:e}=this.props;return e?(0,u.getPropertyValue)(e):void 0}_setProperty(e,t,n){const{setValue:o}=this.context;(0,u.setPropertyValue)(e,(e=>o(e,t,n)))}}g.contextType=l.StylePropertyContext},11062:(e,t,n)=>{"use strict";n.d(t,{PropertyTable:()=>l});var o=n(50959),s=n(97754),r=n(90186),a=n(24712);const i=o.createContext(!1);class l extends o.PureComponent{render(){return o.createElement("div",{ref:this.props.reference,className:s(a.content,this.props.className)},this.props.children)}}l.InlineRowContext=i,l.Row=function(e){const{children:t}=e;return(0,o.useContext)(i)?o.createElement("span",{className:a.inlineRow},t):o.createElement(o.Fragment,null,t)},l.Cell=function(e){const t=(0,o.useContext)(i),n=s(a.cell,e.offset&&a.offset,e.grouped&&a.grouped,t&&a.inlineCell,"top"===e.verticalAlign&&a.top,"topCenter"===e.verticalAlign&&a.topCenter,"adaptive"===e.verticalAlign&&a.adaptive,e.checkableTitle&&a.checkableTitle,2===e.colSpan&&a.fill,"first"===e.placement&&2!==e.colSpan&&a.first,"last"===e.placement&&2!==e.colSpan&&a.last),l=(0,r.filterDataProps)(e);return o.createElement("div",{...l,className:n},o.createElement("div",{className:s(a.inner,e.className)},e.children))},l.Separator=function(e){return o.createElement(l.Row,null,o.createElement("div",{className:s(a.cell,a.separator,a.fill)}))},l.GroupSeparator=function(e){const t=e.size||0;return o.createElement(l.Row,null,o.createElement("div",{className:s(a.cell,a.groupSeparator,a.fill,1===t&&a.big)}))}},17948:(e,t,n)=>{"use strict";function o(e){return Array.isArray(e)?e[0].value():e.value()}function s(e,t){if(Array.isArray(e))for(const n of e)t(n);else t(e)}n.d(t,{getPropertyValue:()=>o,setPropertyValue:()=>s})},99084:e=>{e.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 18 18" width="18" height="18"><path fill="currentColor" d="M9 17A8 8 0 1 0 9 1a8 8 0 0 0 0 16Zm3.87-12.15c.36.2.49.66.28 1.02l-4 7a.75.75 0 0 1-1.18.16l-3-3a.75.75 0 1 1 1.06-1.06l2.3 2.3 3.52-6.14a.75.75 0 0 1 1.02-.28Z"/></svg>'},30162:e=>{
|
||||
e.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 18 18" width="18" height="18"><path fill="currentColor" fill-rule="evenodd" d="M9 17A8 8 0 1 0 9 1a8 8 0 0 0 0 16ZM9 4c-.79 0-1.38.7-1.25 1.48l.67 4.03a.59.59 0 0 0 1.16 0l.67-4.03A1.27 1.27 0 0 0 9 4Zm0 8a1 1 0 1 0 0 2 1 1 0 0 0 0-2Z"/></svg>'},27941:e=>{e.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 18 18" width="18" height="18"><path fill="currentColor" d="M9 17A8 8 0 1 0 9 1a8 8 0 0 0 0 16ZM8 6a1 1 0 1 1 2 0 1 1 0 0 1-2 0Zm1 2c.49 0 1 .59 1 1v3.01c0 .42-.51.99-1 .99s-1-.57-1-.99V9c0-.41.51-1 1-1Z"/></svg>'},82353:e=>{e.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 18 18" width="18" height="18"><path fill="currentColor" d="M9 17A8 8 0 1 0 9 1a8 8 0 0 0 0 16Zm0-3a1 1 0 1 1 0-2 1 1 0 0 1 0 2ZM6 7.5a3 3 0 1 1 6 0c0 .96-.6 1.48-1.17 1.98-.55.48-1.08.95-1.08 1.77h-1.5c0-1.37.7-1.9 1.33-2.38.49-.38.92-.71.92-1.37C10.5 6.67 9.82 6 9 6s-1.5.67-1.5 1.5H6Z"/></svg>'},65890:e=>{e.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 11 9" width="11" height="9" fill="none"><path stroke-width="2" d="M0.999878 4L3.99988 7L9.99988 1"/></svg>'},93929:e=>{e.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 18 18" width="18" height="18" fill="none"><path stroke="currentColor" d="M13.5 7l1.65-1.65a.5.5 0 0 0 0-.7l-1.8-1.8a.5.5 0 0 0-.7 0L11 4.5M13.5 7L11 4.5M13.5 7l-8.35 8.35a.5.5 0 0 1-.36.15H2.5v-2.3a.5.5 0 0 1 .15-.35L11 4.5"/></svg>'}}]);
|
||||
File diff suppressed because one or more lines are too long
@@ -46,44 +46,44 @@ const r=s.vertLabelsAlign.value(),l=s.horzLabelsAlign.value();let c=0,p=0;"left"
|
||||
return Boolean(this._source.isLocked&&this._source.isLocked())}addAnchors(e,t){let i=this._points;this._model.lineBeingCreated()===this._source&&(i=i.slice(0,-1));const n=i.map(((e,t)=>{const i=this._source.points()[t],n=e;return n.snappingPrice=null==i?void 0:i.price,n.snappingIndex=null==i?void 0:i.index,n}));e.append(this.createLineAnchor({...null!=t?t:{},points:n},0))}createLineAnchor(e,t){var i;if(this.isLocked()){const i=this._getSelectionRenderer(t);return i.setData({bgColors:this._lineAnchorColors(e.points),points:e.points,visible:this.areAnchorsVisible(),hittestResult:o.HitTarget.Regular,barSpacing:this._model.timeScale().barSpacing()}),i}const n=(0,s.lastMouseOrTouchEventInfo)().isTouch,r=this._getLineAnchorRenderer(t);return r.setData({...e,color:this.anchorColor(),backgroundColors:this._lineAnchorColors(e.points),currentPoint:this.currentPoint(),linePointBeingEdited:this.isBeingEdited()?this._model.linePointBeingEdited():null,hittestResult:null!==(i=e.hittestResult)&&void 0!==i?i:o.HitTarget.ChangePoint,radius:this._anchorRadius(),strokeWidth:n?c.TouchStrokeWidth:c.RegularStrokeWidth,selected:this.isSelectedSource(),selectedStrokeWidth:n?c.TouchSelectedStrokeWidth:c.RegularSelectedStrokeWidth,visible:this.areAnchorsVisible()}),r}_anchorRadius(){return(0,s.lastMouseOrTouchEventInfo)().isTouch?c.TouchAnchorRadius:c.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,t){this._points=[];if(this._model.timeScale().isEmpty())return;if(!this._validatePriceScale())return;const i=this._source.points();for(let e=0;e<i.length;e++){const t=i[e],n=this._source.pointToScreenPoint(t);if(!n)return;const r=n;r.data=e,this._points.push(r)}2===this._points.length&&(this._middlePoint=this._source.calcMiddlePoint(this._points[0],this._points[1])),this._invalidated=!1}_validatePriceScale(){const e=this._source.priceScale();return null!==e&&!e.isEmpty()}_getSource(){return this._source}_getPoints(){return this._points}_getModel(){return this._model}_height(){const e=this._source.priceScale();return null!==e?e.height():0}_width(){return this._model.timeScale().width()}_needLabelExclusionPath(e,t){const i=this._source.properties().childs();if("middle"!==(null!=t?t:i.vertLabelsAlign.value()))return!1;const n=e.getLinesInfo().lines;if(n.length%2==0)return!1;if(""===n[Math.floor(n.length/2)].trim())return!1;return!0}_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]}}},99058:(e,t,i)=>{"use strict";i.r(t),i.d(t,{LineToolBeingCreatedPaneView:()=>c});var n=i(48891),r=i(79191),s=i(79849),o=i(73436),a=i(19266),l=i(71254),d=i(99031);const h=n.colorsPalette["color-cold-gray-500"];class c extends r.LineSourcePaneView{
|
||||
constructor(){super(...arguments),this._lineRenderer1=new l.VerticalLineRenderer,this._lineRenderer2=new l.VerticalLineRenderer,this._medianRenderer=new d.TrendLineRenderer,this._renderer=null}renderer(){return this._invalidated&&(this._updateImpl(),this._invalidated=!1),this._renderer}_updateImpl(){super._updateImpl(),this._renderer=null;const e=this._getPoints();if(e.length<1)return;this._renderer=new a.CompositeRenderer;const[t,i]=e;this._lineRenderer1.setData({x:t.x,color:h,linewidth:1,linestyle:s.LINESTYLE_SOLID}),this._renderer.append(this._lineRenderer1),e.length>1&&(this._lineRenderer2.setData({x:i.x,color:h,linewidth:1,linestyle:s.LINESTYLE_SOLID}),this._medianRenderer.setData({points:[t,i],color:h,linewidth:1,linestyle:s.LINESTYLE_SOLID,extendleft:!1,extendright:!1,leftend:o.LineEnd.Normal,rightend:o.LineEnd.Normal}),this._renderer.append(this._lineRenderer2),this._renderer.append(this._medianRenderer))}}},134:(e,t,i)=>{"use strict";i.r(t),i.d(t,{LineToolPaneViewFibWithLabels:()=>d});var n=i(86441),r=i(79191),s=i(80657),o=i(87663),a=i(93572),l=i(46501);class d extends r.LineSourcePaneView{constructor(e,t){super(e,t),this._labelsRenderers={};for(let t=0;t<e.levelsCount();t++)this._labelsRenderers[t]=new s.TextRenderer;this._numericFormatter=new o.NumericFormatter,this._percentageFormatter=new a.PercentageFormatter}_updateLabelForLevel({i:e,levelIndex:t,leftPoint:i,rightPoint:r,price:s,color:o,horzAlign:a,vertAlign:d,extendLeft:h=!1,extendRight:c=!1}){var u,p,_,g,f;const v=this._labelsRenderers[e];if(void 0===v)return null;const x=this._source.priceScale();if(!x)return null;const m=this._source.properties(),w=Boolean(null===(u=m.showCoeffs)||void 0===u?void 0:u.value()),R=Boolean(null===(p=m.showPrices)||void 0===p?void 0:p.value());if(!w&&!R)return null;const y=null===(_=this._source.ownerSource())||void 0===_?void 0:_.firstValue();if(null==y)return null;const T=!(i.x>this._model.timeScale().width()&&!h||r.x<0&&!c);let b,P,L=a;switch(L){case"left":P=i.y,h?b=T?0:r.x:(b=i.x,L="right");break;case"right":P=r.y,c?b=T?this._model.timeScale().width():i.x:(b=r.x,L="left");break;default:b=(i.x+r.x)/2,P=(i.y+r.y)/2}const S=m["level"+t].coeff.value();let C="";if(w){C+=null!==(f=null===(g=m.coeffsAsPercents)||void 0===g?void 0:g.value())&&void 0!==f&&f?this._percentageFormatter.format(100*S,!1,2):this._numericFormatter.format(S)}return R&&(C+="("+x.formatPrice(s,y)+")"),v.setData({points:[new n.Point(b,P)],text:C,color:o,vertAlign:d,horzAlign:L,offsetX:4,offsetY:0,font:l.CHART_FONT_FAMILY,fontSize:m.labelFontSize?m.labelFontSize.value():12}),v}}},34658:(e,t,i)=>{"use strict";i.r(t),i.d(t,{NotePaneView:()=>m});var n=i(50151),r=i(79191),s=i(19266),o=i(80101),a=i(18807),l=i(46501),d=i(80657),h=i(87095),c=i(38223),u=i(74359),p=i(57352),_=i(27714),g=i(86441),f=i(34026);class v{constructor(e){this._data=null,this._sourceCanvas=null,this._translate=new g.Point(0,0),this._renderParams=e}destroy(){var e;null===(e=this._sourceCanvas)||void 0===e||e.remove()}renderParams(){return this._renderParams}update(e){var t,i;t=this._data,
|
||||
i=e,(null===t||t.markerColor!==i.markerColor||t.borderColor!==i.borderColor||t.width!==i.width||t.height!==i.height)&&this._createSource(e.width,e.height,e.markerColor),this._data=e}drawOn(e){const t=(0,n.ensureNotNull)(this._data),i=new g.Point(Math.round(t.point.x),Math.round(t.point.y)).add(this._translate);e.drawImage((0,n.ensureNotNull)(this._sourceCanvas),Math.round(i.x*this._renderParams.pixelRatio),Math.round(i.y*this._renderParams.pixelRatio),Math.round(t.width*this._renderParams.pixelRatio),Math.round(t.height*this._renderParams.pixelRatio))}hasPoint(e){const t=(0,n.ensureNotNull)(this._data),i=t.point.add(this._translate),r=new g.Point(t.point.x-this._translate.x,t.point.y);return(0,f.pointInBox)(e,(0,g.box)(i,r))}_createSource(e,t,i){this._sourceCanvas=(0,u.createDisconnectedCanvas)(document,(0,_.size)({width:e,height:t}),this._renderParams.pixelRatio),this._translate=new g.Point(-e/2,.5-t),this._translate.x%1==0&&(this._translate=new g.Point(this._translate.x+.5,this._translate.y));const r=(0,n.ensureNotNull)(this._sourceCanvas.getContext("2d")),{pixelRatio:s}=this._renderParams;(0,u.drawScaled)(r,s,s,(()=>{const n=.6*e;r.fillStyle=i,r.beginPath(),r.moveTo(e/2,t),r.quadraticCurveTo(e,e/1.15,e,e/2),r.arc(e/2,e/2,e/2,0,Math.PI,!0),r.quadraticCurveTo(0,e/1.15,e/2,t),r.fill(),r.globalCompositeOperation="destination-out",r.beginPath(),r.moveTo((e-n)/2,e/2),r.arc(e/2,e/2,n/2,0,2*Math.PI),r.fill()}))}}class x{constructor(){this._source=null,this._data=null}setData(e){this._data=e,this._source&&this._source.update(e)}draw(e,t){var i;if(null===this._data)return;null!==this._source&&(0,p.areEqualPaneRenderParams)(this._source.renderParams(),t)||(null===(i=this._source)||void 0===i||i.destroy(),this._source=new v(t),this._source.update(this._data));this._source.drawOn(e),this._data.tooltipVisible&&this._drawTooltipOn(e,t)}hitTest(e){return null!==this._data&&null!==this._source&&this._source.hasPoint(e)?new a.HitTestResult(a.HitTarget.MovePoint):null}_drawTooltipOn(e,t){e.save(),e.translate(.5,.5);const i=(0,n.ensureNotNull)(this._data),r=String(i.text).replace(/^\s+|\s+$/g,"");e.font=(i.bold?"bold ":"")+(i.italic?"italic ":"")+i.fontSize+"px "+i.font;const s=i.tooltipWidth-2*i.tooltipPadding,o=(0,d.wordWrap)(r,e.font,s),a=i.point,l=i.tooltipLineSpacing;let p=i.tooltipWidth,_=o.length*i.fontSize+2*i.tooltipPadding;o.length>1&&(_+=(o.length-1)*l);let g=Math.round(a.x-p/2),f=Math.round(a.y-i.height-_-8);const v=a.x<20||a.x+20>i.vpWidth;let x=v?null:"top",m=v?0:Math.round(a.x);f<10?f=a.y+13:x="bottom",g<10?g+=Math.abs(g-10):g+p+10>i.vpWidth&&(g-=g+p+10-i.vpWidth),e.fillStyle=(0,h.generateColor)(i.backgroundColor,i.backgroundTransparency),e.strokeStyle=i.borderColor,e.lineWidth=1,e.beginPath();const w=Math.round(g*t.pixelRatio),R=Math.round(f*t.pixelRatio);m=Math.round(m*t.pixelRatio),_=Math.round(_*t.pixelRatio),p=Math.round(p*t.pixelRatio);const y=Math.round(7*t.pixelRatio);e.moveTo(w,R),v||"top"!==x||(e.lineTo(m-y,R),e.lineTo(m,R-y),e.lineTo(m+y,R)),e.lineTo(w+p,R),e.lineTo(w+p,R+_),
|
||||
v||"bottom"!==x||(e.lineTo(m+y,R+_),e.lineTo(m,R+_+y),e.lineTo(m-y,R+_)),e.lineTo(w,R+_),e.closePath(),e.fill(),e.stroke(),e.textBaseline="middle",e.fillStyle=i.textColor,e.textAlign=(0,c.isRtl)()?"right":"left";const T=(0,u.calcTextHorizontalShift)(e,s),b=g+i.tooltipPadding+T;let P=f+i.tooltipPadding+i.fontSize/2;(0,u.drawScaled)(e,t.pixelRatio,t.pixelRatio,(()=>{for(let t=0;t<o.length;t++)e.fillText(o[t].replace(/^\s+/,""),b,P),P+=i.fontSize+l})),e.restore()}}class m extends r.LineSourcePaneView{constructor(e,t){super(e,t),this._renderer=null,this._noteRenderer=new x}isLabelVisible(){return this.isHoveredSource()||this.isSelectedSource()}renderer(e,t){return this._invalidated&&this._updateImpl(),this._renderer}_updateImpl(){super._updateImpl(),this._renderer=null;const e=this._getSource(),t=this._source.isFixed()?[(0,n.ensureDefined)(e.fixedPoint())]:this._points;if(t.length<1)return;const i=new s.CompositeRenderer,r=this.isLabelVisible(),d=this._source.properties().childs(),h={text:d.text.value(),bold:d.bold.value(),italic:d.italic.value(),font:l.CHART_FONT_FAMILY,fontSize:d.fontSize.value(),backgroundColor:d.backgroundColor.value(),backgroundTransparency:d.backgroundTransparency.value(),borderColor:d.borderColor.value(),textColor:d.textColor.value(),markerColor:d.markerColor.value(),point:t[0],width:24,height:32,tooltipVisible:r,vpWidth:this._model.timeScale().width(),tooltipWidth:e.getTooltipWidth(),tooltipPadding:e.getTooltipPadding(),tooltipLineSpacing:e.getTooltipLineSpacing()};this._noteRenderer.setData(h),i.append(this._noteRenderer),i.append(new o.SelectionRenderer({points:t,bgColors:this._lineAnchorColors(t),visible:this.areAnchorsVisible(),barSpacing:this._model.timeScale().barSpacing(),hittestResult:a.HitTarget.MovePoint})),this._renderer=i}}},61144:(e,t,i)=>{"use strict";i.r(t),i.d(t,{OrderPaneView:()=>v});var n=i(86441),r=i(79191),s=i(19266),o=i(44352),a=i(82161),l=i(68441),d=i(15187),h=i(18807),c=i(53180),u=i(47043);const p=o.t(null,void 0,i(33241)),_=o.t(null,void 0,i(16075));class g extends d.MediaCoordinatesPaneRenderer{constructor(e){super(),this._data=null,this._cache={},this._data=null,this._adapter=e}setData(e){this._data=e}hitTest(e,t){if(null===this._data||0===this._data.points.length)return null;const i=this._cache;if(e.y<i.top||e.y>i.bottom)return null;if(this._adapter.getBlocked()&&e.x>=i.left&&e.x<i.right)return new h.HitTestResult(h.HitTarget.Custom,{});if(this._adapter.getEditable()&&e.x>=i.left&&e.x<i.bodyRight){const e=this._adapter.hasMoveCallback()?h.HitTarget.MovePoint:h.HitTarget.Regular;return 0===this._adapter.getTooltip().length?new h.HitTestResult(e):new h.HitTestResult(e,{tooltip:{text:this._adapter.getTooltip(),forceHideOnMove:this._adapter.hasMoveCallback(),rect:{x:i.left,y:i.top,w:i.bodyRight-i.left,h:i.bottom-i.top}}})}return this._adapter.getEditable()&&e.x>=i.bodyRight&&e.x<i.quantityRight?this._adapter.hasModifyCallback()?new h.HitTestResult(h.HitTarget.Custom,{clickHandler:this._adapter.callOnModify.bind(this._adapter),
|
||||
tapHandler:this._adapter.callOnModify.bind(this._adapter),tooltip:{text:this._adapter.getModifyTooltip()||(0,c.appendEllipsis)(p),rect:{x:i.bodyRight,y:i.top,w:i.quantityRight-i.bodyRight,h:i.bottom-i.top}}}):new h.HitTestResult(h.HitTarget.Regular):this._adapter.getCancellable()&&e.x>=i.quantityRight&&e.x<i.right?new h.HitTestResult(h.HitTarget.Custom,{clickHandler:this._adapter.callOnCancel.bind(this._adapter),tapHandler:this._adapter.callOnCancel.bind(this._adapter),tooltip:{text:this._adapter.getCancelTooltip()||_,rect:{x:i.quantityRight,y:i.top,w:i.right-i.quantityRight,h:i.bottom-i.top}}}):null}_drawImpl(e){if(null===this._data||!this._data.points||this._data.points.length<1)return;const t=e.context,i=e.mediaSize.width,n=this._bodyWidth(t),r=this._quantityWidth(t),s=n+r+this._cancelButtonWidth(),o=i-s,a=Math.max(this._adapter.getLineLength()/100*i,1),l=Math.round(i-Math.min(o,a)),d=l-s,h=Math.round(this._data.points[0].y),c=Math.round(h-(this._height()+1)/2);this._cache.bodyRight=d+n,this._cache.quantityRight=d+n+r,this._cache.top=c,this._cache.bottom=c+this._height(),this._cache.left=d,this._cache.right=l,this._drawLines(t,d,l,h,i);let u=!1;0!==n&&(this._drawBody(t,d,c),this._adapter.hasMoveCallback()&&this._drawMovePoints(t,d,c),this._drawBodyText(t,d,c),u=!0),0!==r&&(this._drawQuantity(t,d+n,c,u),this._drawQuantityText(t,d+n,c),u=!0),0!==this._cancelButtonWidth()&&this._drawCancelButton(t,d+n+r,c,u)}_height(){return Math.max(20,1+Math.max(u.fontHeight(this._adapter.getBodyFont()),u.fontHeight(this._adapter.getQuantityFont())))}_bodyWidth(e){if(0===this._adapter.getText().length)return 0;e.save(),e.font=this._adapter.getBodyFont();const t=e.measureText(this._adapter.getText()).width;return e.restore(),Math.round(20+t)}_getQuantity(){return(0,a.splitThousands)(this._adapter.getQuantity()," ")}_quantityWidth(e){if(0===this._getQuantity().length)return 0;e.save(),e.font=this._adapter.getQuantityFont();const t=e.measureText(this._getQuantity()).width;return e.restore(),Math.round(Math.max(this._height(),10+t))}_cancelButtonWidth(){return this._adapter.isOnCancelCallbackPresent()?this._height():0}_drawLines(e,t,i,n,r){e.save(),e.strokeStyle=this._adapter.getLineColor(),(0,l.setLineStyle)(e,this._adapter.getLineStyle()),e.lineWidth=this._adapter.getLineWidth(),(0,l.drawLine)(e,i,n,r,n),this._adapter.getExtendLeft()&&(0,l.drawLine)(e,0,n,t,n),e.restore()}_drawMovePoints(e,t,i){e.save(),e.strokeStyle=this._adapter.getBodyBorderColor(),e.fillStyle=this._adapter.getBodyBorderColor();const n=t+4,r=n+2,s=Math.floor((this._height()-10)/2)+1;for(let t=0;t<s;++t){const s=i+5+2*t;(0,l.drawLine)(e,n,s,r,s)}e.restore()}_drawBody(e,t,i){e.strokeStyle=this._adapter.getBodyBorderColor(),e.fillStyle=this._adapter.getBodyBackgroundColor();const n=this._bodyWidth(e),r=this._height();e.fillRect(t+.5,i+.5,n-1,r-1),e.strokeRect(t,i,n,r)}_drawBodyText(e,t,i){e.textAlign="center",e.textBaseline="middle",e.font=this._adapter.getBodyFont(),e.fillStyle=this._adapter.getBodyTextColor();const n=t+this._bodyWidth(e)/2,r=i+this._height()/2
|
||||
;e.fillText(this._adapter.getText(),5+n-2,r)}_drawQuantity(e,t,i,n){e.save(),e.strokeStyle=this._adapter.getQuantityBorderColor(),e.fillStyle=this._adapter.getQuantityBackgroundColor();const r=this._quantityWidth(e),s=this._height();e.fillRect(t+.5,i+.5,r-1,s-1),n&&e.clip&&(e.beginPath(),e.rect(t+.5,i-.5,r+1,s+1),e.clip()),e.strokeRect(t,i,r,s),e.restore()}_drawQuantityText(e,t,i){e.save(),e.textAlign="center",e.textBaseline="middle",e.font=this._adapter.getQuantityFont(),e.fillStyle=this._adapter.getQuantityTextColor();const n=t+this._quantityWidth(e)/2,r=i+this._height()/2;e.fillText(this._getQuantity(),n,r),e.restore()}_drawCancelButton(e,t,i,r){e.strokeStyle=this._adapter.getCancelButtonBorderColor(),e.fillStyle=this._adapter.getCancelButtonBackgroundColor();const s=this._cancelButtonWidth(),o=this._height();e.fillRect(t+.5,i+.5,s-1,o-1),this._adapter.getBlocked()&&(e.fillStyle="rgba(140, 140, 140, 0.75)",e.fillRect(t+.5,i+.5,s-1,o-1)),e.save(),r&&e.clip&&(e.beginPath(),e.rect(t+.5,i-.5,s+1,o+1),e.clip()),e.strokeRect(t,i,s,o),e.restore();const a=t+s,d=i+o;e.strokeStyle=this._adapter.getCancelButtonIconColor();const h=(this._cancelButtonWidth()-8)/2,c=(this._height()-8)/2;(0,l.drawPoly)(e,[new n.Point(t+h,i+c),new n.Point(a-h,d-c)],!0),(0,l.drawPoly)(e,[new n.Point(a-h,i+c),new n.Point(t+h,d-c)],!0)}}var f=i(80101);class v extends r.LineSourcePaneView{constructor(e,t){super(e,t),this._renderer=new s.CompositeRenderer,this._selectionRenderer=new f.SelectionRenderer,this._selectionData=null,this._adapter=e.adapter(),this._orderRenderer=new g(e.adapter()),this._renderer.append(this._orderRenderer),this._renderer.append(this._selectionRenderer)}renderer(e,t){return this._invalidated&&this._updateImpl(t),this._renderer}_updateImpl(e){if(super._updateImpl(),this._selectionData=null,this.isSelectedSource()&&this._points.length>0){const t=this._points[0].y,i=e-3.5-1,r=this._adapter.hasMoveCallback()?h.HitTarget.MovePoint:h.HitTarget.Regular,s=[new n.Point(i,t)];this._selectionData={barSpacing:this._model.timeScale().barSpacing(),points:s,bgColors:this._lineAnchorColors(s),hittestResult:r,visible:!0}}this._orderRenderer.setData({points:this._points}),this._selectionRenderer.setData(this._selectionData)}}},26013:(e,t,i)=>{"use strict";i.r(t),i.d(t,{ParallelChannelPaneView:()=>d});var n=i(86441),r=i(66103),s=i(19266),o=i(28621),a=i(33295);const l=[r.PaneCursorType.Default,r.PaneCursorType.Default,r.PaneCursorType.Default,r.PaneCursorType.Default,r.PaneCursorType.VerticalResize,r.PaneCursorType.VerticalResize];class d extends a.AlertableLineSourcePaneView{constructor(){super(...arguments),this._channelRenderer=new o.ParallelChannelRenderer,this._renderer=null}renderer(e,t){return this._invalidated&&this._updateImpl(),this._renderer}_updateImpl(){super._updateImpl(),this._renderer=null;const e=this._source.priceScale();if(!e||e.isEmpty())return;if(0===this._source.points().length)return;let t=null,i=null;if(3===this._points.length){const e=this._points[0],r=this._points[1],s=this._points[2].y-this._points[0].y;t=e.add((0,
|
||||
n.point)(0,s)),i=r.add((0,n.point)(0,s))}if(this._points.length<=1)return;const r=this._source.properties(),o={points:this._points.length>2&&null!==t&&null!==i?[this._points[0],this._points[1],t,i]:[this._points[0],this._points[1]],color:r.childs().linecolor.value(),linewidth:r.childs().linewidth.value(),linestyle:r.childs().linestyle.value(),extendleft:r.childs().extendLeft.value(),extendright:r.childs().extendRight.value(),fillBackground:r.childs().fillBackground.value(),backcolor:r.childs().backgroundColor.value(),transparency:r.childs().transparency.value(),showMidline:r.childs().showMidline.value(),midlinewidth:r.childs().midlinewidth.value(),midlinestyle:r.childs().midlinestyle.value(),midcolor:r.childs().midlinecolor.value(),hittestOnBackground:!0};this._channelRenderer.setData(o);const a=new s.CompositeRenderer;a.append(this._channelRenderer);const d=[];if(this._points[0]&&d.push(this._points[0]),this._points[1]&&d.push(this._points[1]),t&&i){const e=t;e.data=2,d.push(e);const n=i;n.data=3,d.push(n);const r=t.add(i).scaled(.5);r.data=4,r.square=!0,d.push(r);const s=d[0].add(d[1]).scaled(.5);s.data=5,s.square=!0,d.push(s)}const h=3===this._points.length&&!t;if(this._model.lineBeingCreated()!==this._source||h||(d.pop(),d.pop()),a.append(this.createLineAnchor({points:d,pointsCursorType:l},0)),this._points.length>=2){const e=this._points;this._addAlertRenderer(a,[e[0],e[1]])}this._renderer=a}}},62801:(e,t,i)=>{"use strict";i.r(t),i.d(t,{PathPaneView:()=>o});var n=i(79797),r=i(19266),s=i(79191);class o extends s.LineSourcePaneView{constructor(e,t){super(e,t),this._polygonRenderer=new n.PolygonRenderer,this._renderer=new r.CompositeRenderer}renderer(e,t){return this._invalidated&&this._updateImpl(),this._renderer}_updateImpl(){super._updateImpl(),this._renderer.clear();const e=this._source.properties().childs(),t={points:this._points,color:e.lineColor.value(),linewidth:e.lineWidth.value(),linestyle:e.lineStyle.value(),leftend:e.leftEnd.value(),rightend:e.rightEnd.value(),filled:!1,backcolor:"",fillBackground:!1,transparency:0};this._polygonRenderer.setData(t),this._renderer.append(this._polygonRenderer),this.addAnchors(this._renderer)}}},87202:(e,t,i)=>{"use strict";i.r(t),i.d(t,{PitchfanLinePaneView:()=>d});var n=i(18807),r=i(14146),s=i(19266),o=i(73436),a=i(99031),l=i(79191);class d extends l.LineSourcePaneView{constructor(){super(...arguments),this._medianRenderer=new a.TrendLineRenderer,this._sideRenderer=new a.TrendLineRenderer,this._renderer=null,this._medianPoint=null}renderer(e,t){return this._invalidated&&this._updateImpl(),this._renderer}_updateImpl(){if(super._updateImpl(),this._renderer=null,0===this._points.length)return;if(3===this._points.length?(this._medianPoint=this._points[1].add(this._points[2]).scaled(.5),this._medianPoint.data=3):2===this._points.length?(this._medianPoint=this._points[1].clone(),this._medianPoint.data=3):(this._medianPoint=this._points[0].clone(),this._medianPoint.data=3),this._points.length<2)return;if(!this._medianPoint)return
|
||||
;const e=new s.CompositeRenderer,t=this._source.properties().childs(),i=t.median.childs(),l={points:[this._points[0],this._medianPoint],color:i.color.value(),linewidth:i.linewidth.value(),linestyle:i.linestyle.value(),extendleft:!1,extendright:!0,leftend:o.LineEnd.Normal,rightend:o.LineEnd.Normal};if(this._medianRenderer.setData(l),e.append(this._medianRenderer),this._points.length<3)return this.addAnchors(e),void(this._renderer=e);const d={points:[this._points[1],this._points[2]],color:i.color.value(),linewidth:i.linewidth.value(),linestyle:i.linestyle.value(),extendleft:!1,extendright:!1,leftend:o.LineEnd.Normal,rightend:o.LineEnd.Normal};this._sideRenderer.setData(d),e.append(this._sideRenderer);let h=0;const c=this._points[2].subtract(this._points[1]).scaled(.5),u=t.fillBackground.value(),p=t.transparency.value();for(let t=0;t<=8;t++){const i="level"+t,s=this._source.properties().child(i);if(s.childs().visible.value()){const i=this._medianPoint.addScaled(c,s.childs().coeff.value()),l=this._medianPoint.addScaled(c,-s.childs().coeff.value());if(u){{const t={p1:this._points[0],p2:i,p3:this._points[0],p4:this._medianPoint.addScaled(c,h),color:s.childs().color.value(),transparency:p,hittestOnBackground:!0,extendLeft:!1},n=new r.ChannelRenderer;n.setData(t),e.append(n)}{const t={p1:this._points[0],p2:l,p3:this._points[0],p4:this._medianPoint.addScaled(c,-h),color:s.childs().color.value(),transparency:p,hittestOnBackground:!0,extendLeft:!1},i=new r.ChannelRenderer;i.setData(t),e.append(i)}}h=s.childs().coeff.value();{const r={points:[this._points[0],i],color:s.childs().color.value(),linewidth:s.childs().linewidth.value(),linestyle:s.childs().linestyle.value(),extendleft:!1,extendright:!0,leftend:o.LineEnd.Normal,rightend:o.LineEnd.Normal},l=new a.TrendLineRenderer;l.setData(r),l.setHitTest(new n.HitTestResult(n.HitTarget.MovePoint,void 0,t)),e.append(l)}{const i={points:[this._points[0],l],color:s.childs().color.value(),linewidth:s.childs().linewidth.value(),linestyle:s.childs().linestyle.value(),extendleft:!1,extendright:!0,leftend:o.LineEnd.Normal,rightend:o.LineEnd.Normal},r=new a.TrendLineRenderer;r.setData(i),r.setHitTest(new n.HitTestResult(n.HitTarget.MovePoint,void 0,t)),e.append(r)}}}this.addAnchors(e),this._renderer=e}}},95337:(e,t,i)=>{"use strict";i.r(t),i.d(t,{InsidePitchforkLinePaneView:()=>p,PitchforkLinePaneView:()=>h,SchiffPitchfork2LinePaneView:()=>u,SchiffPitchforkLinePaneView:()=>c});var n=i(86441),r=i(18807),s=i(14146),o=i(19266),a=i(73436),l=i(99031),d=i(79191);class h extends d.LineSourcePaneView{constructor(){super(...arguments),this._medianRenderer=new l.TrendLineRenderer,this._sideRenderer=new l.TrendLineRenderer,this._renderer=null,this._medianPoint=null}renderer(e,t){return this._invalidated&&this._updateImpl(),this._renderer}_updateImpl(){super._updateImpl(),this._renderer=null,0!==this._points.length&&(3===this._points.length?(this._medianPoint=this._points[1].add(this._points[2]).scaled(.5),this._medianPoint.data=3):2===this._points.length?(this._medianPoint=this._points[1].clone(),
|
||||
this._medianPoint.data=3):(this._medianPoint=this._points[0].clone(),this._medianPoint.data=3),this._updateRenderer())}_updateRenderer(){if(this._points.length<2)return;if(!this._medianPoint)return;const e=this._source.properties(),t=e.childs().median.childs(),i=new o.CompositeRenderer,n={points:[this._points[0],this._medianPoint],color:t.color.value(),linewidth:t.linewidth.value(),linestyle:t.linestyle.value(),extendleft:e.childs().extendLines.value(),extendright:!0,leftend:a.LineEnd.Normal,rightend:a.LineEnd.Normal};if(this._medianRenderer.setData(n),i.append(this._medianRenderer),this._points.length<3)return this.addAnchors(i),void(this._renderer=i);const d={points:[this._points[1],this._points[2]],color:t.color.value(),linewidth:t.linewidth.value(),linestyle:t.linestyle.value(),extendleft:!1,extendright:!1,leftend:a.LineEnd.Normal,rightend:a.LineEnd.Normal};this._sideRenderer.setData(d),i.append(this._sideRenderer);const h=this._points[2].subtract(this._points[1]).scaled(.5),c=this._medianPoint.subtract(this._points[0]);let u=0;const p=e.childs().fillBackground.value(),_=e.childs().transparency.value();for(let t=0;t<=8;t++){const n="level"+t,o=e.childs()[n];if(o.childs().visible.value()){const n=this._medianPoint.addScaled(h,o.childs().coeff.value()),d=n.add(c),g=this._medianPoint.addScaled(h,-o.childs().coeff.value()),f=g.add(c);if(p){{const t=this._medianPoint.addScaled(h,u),r={p1:n,p2:d,p3:t,p4:t.add(c),color:o.childs().color.value(),transparency:_,hittestOnBackground:!0,extendLeft:e.childs().extendLines.value()},a=new s.ChannelRenderer;a.setData(r),i.append(a)}{const t=this._medianPoint.addScaled(h,-u),n={p1:g,p2:f,p3:t,p4:t.add(c),color:o.childs().color.value(),transparency:_,hittestOnBackground:!0,extendLeft:e.childs().extendLines.value()},r=new s.ChannelRenderer;r.setData(n),i.append(r)}}u=o.childs().coeff.value();const v={points:[n,d],color:o.childs().color.value(),linewidth:o.childs().linewidth.value(),linestyle:o.childs().linestyle.value(),extendleft:e.childs().extendLines.value(),extendright:!0,leftend:a.LineEnd.Normal,rightend:a.LineEnd.Normal},x=new l.TrendLineRenderer;x.setData(v),x.setHitTest(new r.HitTestResult(r.HitTarget.MovePoint,void 0,t)),i.append(x);const m={points:[g,f],color:o.childs().color.value(),linewidth:o.childs().linewidth.value(),linestyle:o.childs().linestyle.value(),extendleft:e.childs().extendLines.value(),extendright:!0,leftend:a.LineEnd.Normal,rightend:a.LineEnd.Normal},w=new l.TrendLineRenderer;w.setData(m),w.setHitTest(new r.HitTestResult(r.HitTarget.MovePoint,void 0,t)),i.append(w)}}this.addAnchors(i),this._renderer=i}}class c extends h{constructor(){super(...arguments),this._modifiedBase=null,this._backSideRenderer=new l.TrendLineRenderer}renderer(e,t){return this._invalidated&&this._updateImpl(),this._renderer}_updateRenderer(){if(this._points.length<2)return;this._calcMofifiedBase();const e=this._source.properties(),t=new o.CompositeRenderer,i=e.childs().median.childs();{const e={points:[this._points[0],this._points[1]],color:i.color.value(),
|
||||
linewidth:i.linewidth.value(),linestyle:i.linestyle.value(),extendleft:!1,extendright:!1,leftend:a.LineEnd.Normal,rightend:a.LineEnd.Normal};if(this._backSideRenderer.setData(e),t.append(this._backSideRenderer),!this._medianPoint||!this._modifiedBase)return this.addAnchors(t),void(this._renderer=t)}{const n={points:[this._modifiedBase,this._medianPoint],color:i.color.value(),linewidth:i.linewidth.value(),linestyle:i.linestyle.value(),extendleft:e.childs().extendLines.value(),extendright:!0,leftend:a.LineEnd.Normal,rightend:a.LineEnd.Normal};if(this._medianRenderer.setData(n),t.append(this._medianRenderer),this._points.length<3)return this.addAnchors(t),void(this._renderer=t)}{const e={points:[this._points[1],this._points[2]],color:i.color.value(),linewidth:i.linewidth.value(),linestyle:i.linestyle.value(),extendleft:!1,extendright:!1,leftend:a.LineEnd.Normal,rightend:a.LineEnd.Normal};this._sideRenderer.setData(e),t.append(this._sideRenderer)}{const i=this._points[2].subtract(this._points[1]).scaled(.5),n=this._medianPoint.subtract(this._modifiedBase);let o=0;const d=e.childs().fillBackground.value(),h=e.childs().transparency.value();for(let c=0;c<=8;c++){const u="level"+c,p=e.child(u);if(p.childs().visible.value()){const u=this._medianPoint.addScaled(i,p.childs().coeff.value()),_=u.add(n),g=this._medianPoint.addScaled(i,-p.childs().coeff.value()),f=g.add(n);if(d){const r=this._medianPoint.addScaled(i,o);{const i={p1:u,p2:_,p3:r,p4:r.add(n),color:p.childs().color.value(),transparency:h,hittestOnBackground:!0,extendLeft:e.childs().extendLines.value()},o=new s.ChannelRenderer;o.setData(i),t.append(o)}{const r=this._medianPoint.addScaled(i,-o),a={p1:g,p2:f,p3:r,p4:r.add(n),color:p.childs().color.value(),transparency:h,hittestOnBackground:!0,extendLeft:e.childs().extendLines.value()},l=new s.ChannelRenderer;l.setData(a),t.append(l)}}o=p.childs().coeff.value();const v={points:[u,_],color:p.childs().color.value(),linewidth:p.childs().linewidth.value(),linestyle:p.childs().linestyle.value(),extendleft:e.childs().extendLines.value(),extendright:!0,leftend:a.LineEnd.Normal,rightend:a.LineEnd.Normal},x=new l.TrendLineRenderer;x.setData(v),x.setHitTest(new r.HitTestResult(r.HitTarget.MovePoint,void 0,c)),t.append(x);const m={points:[g,f],color:p.childs().color.value(),linewidth:p.childs().linewidth.value(),linestyle:p.childs().linestyle.value(),extendleft:e.childs().extendLines.value(),extendright:!0,leftend:a.LineEnd.Normal,rightend:a.LineEnd.Normal},w=new l.TrendLineRenderer;w.setData(m),w.setHitTest(new r.HitTestResult(r.HitTarget.MovePoint,void 0,c)),t.append(w)}}}this.addAnchors(t),this._renderer=t}_calcMofifiedBase(){this._points.length>1&&(this._modifiedBase=this._points[0].add(this._points[1]).scaled(.5))}}class u extends c{_calcMofifiedBase(){if(this._points.length>2){const e=this._points[0].x,t=.5*(this._points[0].y+this._points[1].y),i=new n.Point(e,t);this._modifiedBase=i}}}class p extends h{constructor(){super(...arguments),this._backSideRenderer=new l.TrendLineRenderer,this._centerRenderer=new l.TrendLineRenderer,
|
||||
this._modifiedBase=null}renderer(e,t){return this._invalidated&&this._updateImpl(),this._renderer}_updateRenderer(){if(this._points.length>1&&(this._modifiedBase=this._points[0].add(this._points[1]).scaled(.5)),this._points.length<2)return;const e=new o.CompositeRenderer;if(!this._medianPoint||!this._modifiedBase)return void this.addAnchors(e);const t=this._source.properties(),i=t.childs().median.childs();if(3===this._points.length){const t={points:[this._modifiedBase,this._points[2]],color:i.color.value(),linewidth:i.linewidth.value(),linestyle:i.linestyle.value(),extendleft:!1,extendright:!1,leftend:a.LineEnd.Normal,rightend:a.LineEnd.Normal};this._medianRenderer.setData(t),e.append(this._medianRenderer)}{const t={points:[this._points[0],this._points[1]],color:i.color.value(),linewidth:i.linewidth.value(),linestyle:i.linestyle.value(),extendleft:!1,extendright:!1,leftend:a.LineEnd.Normal,rightend:a.LineEnd.Normal};if(this._backSideRenderer.setData(t),e.append(this._backSideRenderer),this._points.length<3)return this.addAnchors(e),void(this._renderer=e)}{const t={points:[this._points[1],this._points[2]],color:i.color.value(),linewidth:i.linewidth.value(),linestyle:i.linestyle.value(),extendleft:!1,extendright:!1,leftend:a.LineEnd.Normal,rightend:a.LineEnd.Normal};this._sideRenderer.setData(t),e.append(this._sideRenderer)}{const n=this._points[2].subtract(this._points[1]).scaled(.5),o=this._points[2].subtract(this._modifiedBase);let d=0;const h=t.childs().fillBackground.value(),c=t.childs().transparency.value(),u={points:[this._medianPoint,this._medianPoint.add(o)],color:i.color.value(),linewidth:i.linewidth.value(),linestyle:i.linestyle.value(),extendleft:t.childs().extendLines.value(),extendright:!0,leftend:a.LineEnd.Normal,rightend:a.LineEnd.Normal};this._centerRenderer.setData(u),e.append(this._centerRenderer);for(let i=0;i<=8;i++){const u="level"+i,p=t.child(u).childs();if(p.visible.value()){const u=this._medianPoint.addScaled(n,p.coeff.value()),_=u.add(o),g=this._medianPoint.addScaled(n,-p.coeff.value()),f=g.add(o);if(h){{const i=this._medianPoint.addScaled(n,d),r={p1:u,p2:_,p3:i,p4:i.add(o),color:p.color.value(),transparency:c,hittestOnBackground:!0,extendLeft:t.childs().extendLines.value()},a=new s.ChannelRenderer;a.setData(r),e.append(a)}{const i=this._medianPoint.addScaled(n,-d),r={p1:g,p2:f,p3:i,p4:i.add(o),color:p.color.value(),transparency:c,hittestOnBackground:!0,extendLeft:t.childs().extendLines.value()},a=new s.ChannelRenderer;a.setData(r),e.append(a)}}d=p.coeff.value();const v={points:[u,_],color:p.color.value(),linewidth:p.linewidth.value(),linestyle:p.linestyle.value(),extendleft:t.childs().extendLines.value(),extendright:!0,leftend:a.LineEnd.Normal,rightend:a.LineEnd.Normal},x=new l.TrendLineRenderer;x.setData(v),x.setHitTest(new r.HitTestResult(r.HitTarget.MovePoint,void 0,i)),e.append(x);const m={points:[g,f],color:p.color.value(),linewidth:p.linewidth.value(),linestyle:p.linestyle.value(),extendleft:t.childs().extendLines.value(),extendright:!0,leftend:a.LineEnd.Normal,rightend:a.LineEnd.Normal
|
||||
},w=new l.TrendLineRenderer;w.setData(m),w.setHitTest(new r.HitTestResult(r.HitTarget.MovePoint,void 0,i)),e.append(w)}}}this.addAnchors(e),this._renderer=e}}},50253:(e,t,i)=>{"use strict";i.r(t),i.d(t,{PolylinePaneView:()=>o});var n=i(79797),r=i(19266),s=i(79191);class o extends s.LineSourcePaneView{constructor(e,t){super(e,t),this._polygonRenderer=new n.PolygonRenderer,this._renderer=new r.CompositeRenderer}renderer(e,t){return this._invalidated&&this._updateImpl(),this._renderer}_updateImpl(){super._updateImpl(),this._renderer.clear();const e=this._source.properties().childs(),t={points:this._points,color:e.linecolor.value(),linewidth:e.linewidth.value(),linestyle:e.linestyle.value(),filled:e.filled.value(),backcolor:e.backgroundColor.value(),fillBackground:e.fillBackground.value(),transparency:e.transparency.value()};this._polygonRenderer.setData(t),this._renderer.append(this._polygonRenderer),this.addAnchors(this._renderer)}}},46258:(e,t,i)=>{"use strict";var n=i(79191).LineSourcePaneView,r=i(47043),s=i(18807).HitTestResult,o=i(18807).HitTarget,a=i(82161).splitThousands,l=i(38223),d=i(53180).appendEllipsis,h=i(15187).MediaCoordinatesPaneRenderer;const{setLineStyle:c,drawLine:u,drawPoly:p}=i(68441),{LINESTYLE_SOLID:_}=i(79849);class g extends h{constructor(e,t){super(),this._data=null,this._cache=e,this._adapter=t}setData(e){this._data=e}_height(){return Math.max(20,1+Math.max(r.fontHeight(this._adapter.getBodyFont()),r.fontHeight(this._adapter.getQuantityFont())))}_bodyWidth(e){if(0===this._adapter.getText().length)return 0;e.save(),e.font=this._adapter.getBodyFont();var t=e.measureText(this._adapter.getText()).width;return e.restore(),Math.round(10+t)}_getQuantity(){var e=this._adapter.getQuantity();return isNaN(e)?e:a(this._adapter.getQuantity()," ")}_quantityWidth(e){if(0===this._getQuantity().length)return 0;e.save(),e.font=this._adapter.getQuantityFont();var t=e.measureText(this._getQuantity()).width;return e.restore(),Math.round(Math.max(this._height(),10+t))}_reverseButtonWidth(){return this._adapter.isOnReverseCallbackPresent()?this._height():0}_closeButtonWidth(){return this._adapter.isOnCloseCallbackPresent()?this._height():0}_drawLines(e,t,i,n,r){e.save(),e.strokeStyle=this._adapter.getLineColor(),e.lineStyle=this._adapter.getLineStyle(),e.lineWidth=this._adapter.getLineWidth(),u(e,i,n,r,n),this._adapter.getExtendLeft()&&u(e,0,n,t,n),e.restore()}_drawBody(e,t,i){e.strokeStyle=this._adapter.getBodyBorderColor(),e.fillStyle=this._adapter.getBodyBackgroundColor();var n=this._bodyWidth(e),r=this._height();e.fillRect(t+.5,i+.5,n-1,r-1),e.strokeRect(t,i,n,r)}_drawBodyText(e,t,i){e.save(),e.textAlign="center",e.textBaseline="middle",e.font=this._adapter.getBodyFont(),e.fillStyle=this._adapter.getBodyTextColor();var n=t+this._bodyWidth(e)/2,r=i+this._height()/2;e.fillText(this._adapter.getText(),n,r),e.restore()}_drawQuantity(e,t,i){e.strokeStyle=this._adapter.getQuantityBorderColor(),e.fillStyle=this._adapter.getQuantityBackgroundColor();var n=this._quantityWidth(e),r=this._height()
|
||||
;e.fillRect(t+.5,i+.5,n-1,r-1),e.strokeRect(t,i,n,r)}_drawQuantityText(e,t,i){e.save(),e.textAlign="center",e.textBaseline="middle",e.font=this._adapter.getQuantityFont(),e.fillStyle=this._adapter.getQuantityTextColor();var n=t+this._quantityWidth(e)/2,r=i+this._height()/2;e.fillText(l.startWithLTR(this._getQuantity()+""),n,r),e.restore()}_drawReverseButton(e,t,i){e.save(),e.strokeStyle=this._adapter.getReverseButtonBorderColor(),e.fillStyle=this._adapter.getReverseButtonBackgroundColor();var n=this._reverseButtonWidth(),r=this._height();e.fillRect(t+.5,i+.5,n-1,r-1),e.strokeRect(t,i,n,r),e.strokeStyle=this._adapter.getReverseButtonIconColor();var s=function(e,t){c(e,_),u(e,0,0,0,t),u(e,-1,1,1,1),u(e,-2,2,2,2)},o=t+Math.round((this._reverseButtonWidth()-6)/2),a=i+5;e.save(),e.translate(o,a),s(e,10),e.translate(6,10),e.rotate(Math.PI),s(e,10),e.restore(),this._adapter._blocked&&(e.fillStyle="rgba(140, 140, 140, 0.75)",e.fillRect(t+.5,i+.5,n-1,r-1)),e.restore()}_drawCloseButton(e,t,i){e.save(),e.strokeStyle=this._adapter.getCloseButtonBorderColor(),e.fillStyle=this._adapter.getCloseButtonBackgroundColor();var n=this._closeButtonWidth(),r=this._height();e.fillRect(t+.5,i+.5,n-1,r-1),e.strokeRect(t,i,n,r);var s=t+n,o=i+r;e.strokeStyle=this._adapter.getCloseButtonIconColor();var a=(this._closeButtonWidth()-8)/2,l=(this._height()-8)/2;p(e,[{x:t+a,y:i+l},{x:s-a,y:o-l}],!0),p(e,[{x:s-a,y:i+l},{x:t+a,y:o-l}],!0),this._adapter._blocked&&(e.fillStyle="rgba(140, 140, 140, 0.75)",e.fillRect(t+.5,i+.5,n-1,r-1)),e.restore()}_drawImpl(e){if(null!==this._data&&this._data.points&&!(this._data.points.length<1)){var t=e.context,i=this._data.width,n=this._bodyWidth(t),r=this._quantityWidth(t),s=this._reverseButtonWidth(t),o=n+r+s+this._closeButtonWidth(),a=i-o,l=Math.max(this._adapter.getLineLength()/100*i,1),d=Math.round(i-Math.min(a,l)),h=d-o,c=Math.round(this._data.points[0].y),u=Math.round(c-(this._height()+1)/2);this._cache.bodyRight=h+n,this._cache.quantityRight=this._cache.bodyRight+r,this._cache.reverseButtonRight=this._cache.quantityRight+s,this._cache.top=u,this._cache.bottom=u+this._height(),this._cache.left=h,this._cache.right=d,this._drawLines(t,h,d,c,i),0!==n&&(this._drawBody(t,h,u),this._drawBodyText(t,h,u)),0!==r&&(this._drawQuantity(t,this._cache.bodyRight,u),this._drawQuantityText(t,this._cache.bodyRight,u)),0!==s&&this._drawReverseButton(t,this._cache.quantityRight,u),0!==this._closeButtonWidth()&&this._drawCloseButton(t,this._cache.reverseButtonRight,u)}}hitTest(e){return null===this._data||0===this._data.points.length||e.y<this._cache.top||e.y>this._cache.bottom||e.x<this._cache.left||this._cache.right<e.x?null:this._adapter._blocked?new s(o.Custom,{}):e.x>=this._cache.bodyRight&&e.x<this._cache.quantityRight&&this._adapter._onModifyCallback?new s(o.Custom,{clickHandler:this._adapter.callOnModify.bind(this._adapter),tapHandler:this._adapter.callOnModify.bind(this._adapter),tooltip:{text:this._adapter.getProtectTooltip()||d(i(44352).t(null,void 0,i(11810))),rect:{x:this._cache.bodyRight,y:this._cache.top,
|
||||
w:this._cache.quantityRight-this._cache.bodyRight,h:this._cache.bottom-this._cache.top}}}):e.x>=this._cache.quantityRight&&e.x<this._cache.reverseButtonRight?new s(o.Custom,{clickHandler:this._adapter.callOnReverse.bind(this._adapter),tapHandler:this._adapter.callOnReverse.bind(this._adapter),tooltip:{text:this._adapter.getReverseTooltip()||i(44352).t(null,void 0,i(19780)),rect:{x:this._cache.quantityRight,y:this._cache.top,w:this._cache.reverseButtonRight-this._cache.quantityRight,h:this._cache.bottom-this._cache.top}}}):e.x>=this._cache.reverseButtonRight&&e.x<this._cache.right?new s(o.Custom,{clickHandler:this._adapter.callOnClose.bind(this._adapter),tapHandler:this._adapter.callOnClose.bind(this._adapter),tooltip:{text:this._adapter.getCloseTooltip()||i(44352).t(null,void 0,i(37431)),rect:{x:this._cache.reverseButtonRight,y:this._cache.top,w:this._cache.right-this._cache.reverseButtonRight,h:this._cache.bottom-this._cache.top}}}):new s(o.Custom,{clickHandler:function(){},tapHandler:function(){},tooltip:{text:this._adapter.getTooltip(),rect:{x:this._cache.left,y:this._cache.top,w:this._cache.bodyRight-this._cache.left,h:this._cache.bottom-this._cache.top}}})}}t.PositionPaneView=class extends n{constructor(e,t){super(e,t),this._rendererCache={},this._renderer=new g(this._rendererCache,e._adapter)}renderer(e,t){return this._invalidated&&this._updateImpl(),this._renderer.setData({points:this._points,width:this._model.timeScale().width()}),this._renderer}}},75061:(e,t,i)=>{"use strict";var n=i(86441).Point,r=i(79191).LineSourcePaneView,s=i(36274).Interval,o=i(18807).HitTestResult,a=i(18807).HitTarget,l=i(19266).CompositeRenderer,d=i(12767).getImage,h=i(37160),c=i(93572).PercentageFormatter,u=i(53741).DateFormatter,p=i(79206).TimeFormatter,_=i(79206).hourMinuteFormat,g=i(79206).hourMinuteSecondFormat,f=i(2043).TimeSpanFormatter,v=i(87095),x=i(21316),m=i(74359).calcTextHorizontalShift,w=i(38223).isRtl,R=i(68441).drawRoundRect,y=i(29764).makeFont,T=i(15187).MediaCoordinatesPaneRenderer,b=i(38223),P=b.forceLTRStr,L=b.startWithLTR,S=i(46501).CHART_FONT_FAMILY;class C extends T{constructor(){super(),this._data=null,this._font=S,this._targetFontSize1=14,this._targetFontSize2=11,this._sourceFontSize1=12,this._sourceFontSize2=10,this._arrowOffset=6,this._arrowWidth=5,this._arrowHeight=5,this._radius=3,this._sourceWidth=void 0,this._sourceHeight=void 0,this._sourceRectLeftOffset=void 0,this._targetWidth=void 0,this._targetHeight=void 0,this._targetRectLeftOffset=void 0}setData(e){this._data=e}drawBalloon(e,t,i,r,s,o){var a=o||20;if(e.beginPath(),"down"===s){var l=new n(t.x-a,t.y-this._arrowOffset-this._arrowHeight-r);return e.moveTo(l.x+this._radius,l.y),e.lineTo(l.x+i-this._radius,l.y),e.arcTo(l.x+i,l.y,l.x+i,l.y+this._radius,this._radius),e.lineTo(l.x+i,l.y+r-this._radius),e.arcTo(l.x+i,l.y+r,l.x+i-this._radius,l.y+r,this._radius),e.lineTo(l.x+a+this._arrowWidth,l.y+r),e.lineTo(l.x+a,l.y+r+this._arrowHeight),e.lineTo(l.x+a-this._arrowWidth,l.y+r),e.lineTo(l.x+this._radius,l.y+r),
|
||||
e.arcTo(l.x,l.y+r,l.x,l.y+r-this._radius,this._radius),e.lineTo(l.x,l.y+this._radius),e.arcTo(l.x,l.y,l.x+this._radius,l.y,this._radius),l}var d=new n(t.x-a,t.y+this._arrowOffset+this._arrowHeight+r);return e.moveTo(d.x+this._radius,d.y),e.lineTo(d.x+i-this._radius,d.y),e.arcTo(d.x+i,d.y,d.x+i,d.y-this._radius,this._radius),e.lineTo(d.x+i,d.y-r+this._radius),e.arcTo(d.x+i,d.y-r,d.x+i-this._radius,d.y-r,this._radius),e.lineTo(d.x+a+this._arrowWidth,d.y-r),e.lineTo(d.x+a,d.y-r-this._arrowHeight),e.lineTo(d.x+a-this._arrowWidth,d.y-r),e.lineTo(d.x+this._radius,d.y-r),e.arcTo(d.x,d.y-r,d.x,d.y-r+this._radius,this._radius),e.lineTo(d.x,d.y-this._radius),e.arcTo(d.x,d.y,d.x+this._radius,d.y,this._radius),new n(d.x,d.y-r)}drawTargetLabel(e){e.save(),e.translate(.5,.5);var t=y(this._targetFontSize1,this._font,"normal"),n=y(this._targetFontSize2,this._font,"normal"),r=this._data.targetLine1,s=this._data.targetLine2,o=this._data.targetLine3,a=this._data.targetLine4;e.font=t;var l=e.measureText(r).width,d=e.measureText(s).width,h=e.measureText(" ").width;e.font=n;var c=e.measureText(o).width,u=e.measureText(a).width,p=e.measureText(" ").width,_=this._data.clockWhite&&this._data.clockWhite.width||0;this._targetWidth=Math.max(l+d+h,c+u+_+2*p)+8+4,this._targetHeight=this._targetFontSize1+this._targetFontSize2+9+4;var g=this._data.points[1],f=g.x+this._targetWidth-e.canvas.width+5;this._targetRectLeftOffset=Math.max(20,Math.min(this._targetWidth-15,f));var T="up"===this._data.direction?"down":"up",b=this.drawBalloon(e,g,this._targetWidth,this._targetHeight,T,this._targetRectLeftOffset);e.fillStyle=v.generateColor(this._data.targetBackColor,this._data.transparency),e.fill(),e.lineWidth=2,e.strokeStyle=v.generateColor(this._data.targetStrokeColor,this._data.transparency),e.stroke();e.beginPath(),e.arc(g.x,g.y,3,0,2*Math.PI,!1),e.fillStyle=this._data.centersColor,e.fill(),e.textBaseline="top",e.fillStyle=this._data.targetTextColor;var P=2+b.x+4,L=2+b.y+3,S=this._targetWidth-8-4;e.font=t,e.textAlign=w()?"right":"left";var C=m(e,S-d-h);e.fillText(r,P+C,L);var M=m(e,S-l);e.fillText(s,P+l+h+M,L),e.font=n;var I=L+this._targetFontSize1+3,A=m(e,S-u-_-p);e.fillText(o,P+A,I);var k=m(e,S-c-p-_-u);this._data.clockWhite&&e.drawImage(this._data.clockWhite,P+c+p+k,I+1);var N=m(e,S-c-_);if(e.fillText(a,P+c+_+2*p+N,I),this._data.status){var D,B,z,E;switch(e.font=y(this._targetFontSize1,this._font,"bold"),this._data.status){case x.AlertStatus.Success:D=i(44352).t(null,void 0,i(26787)),B=v.generateColor(this._data.successBackground,this._data.transparency),z=this._data.successTextColor,E=this._data.successIcon;break;case x.AlertStatus.Failure:D=i(44352).t(null,void 0,i(968)),B=v.generateColor(this._data.failureBackground,this._data.transparency),z=this._data.failureTextColor,E=this._data.failureIcon}var H=this._targetFontSize1+4,O=e.measureText(D).width,V=Math.round((this._targetWidth-O)/2),W=m(e,O);e.fillStyle=B,"up"===this._data.direction?(R(e,b.x-1,b.y-H-2,this._targetWidth+2,H,5),e.fill(),e.fillStyle=z,e.fillText(D,b.x+V+W,b.y-H+1),
|
||||
E&&e.drawImage(E,b.x+V-E.width-4,b.y-H-2+Math.abs(H-E.height)/2)):(R(e,b.x-1,b.y+this._targetHeight+2,this._targetWidth+2,H,5),e.fill(),e.fillStyle=z,e.fillText(D,b.x+V+W,b.y+this._targetHeight+5),E&&e.drawImage(E,b.x+V-E.width-4,b.y+this._targetHeight+10-Math.abs(H-E.height)/2)),e.restore()}else e.restore()}drawStartLabel(e){e.save(),e.translate(.5,.5);var t=y(this._sourceFontSize1,this._font,"normal"),i=y(this._sourceFontSize2,this._font,"normal");e.font=t;var n=e.measureText(this._data.sourceLine1).width;e.font=i;var r=e.measureText(this._data.sourceLine2).width;this._sourceWidth=Math.max(n,r)+6+4,this._sourceHeight=this._sourceFontSize1+this._sourceFontSize2+6+4;var s=this._data.points[0],o=s.x+this._sourceWidth-e.canvas.width+5;this._sourceRectLeftOffset=Math.max(20,Math.min(this._sourceWidth-15,o));var a=this.drawBalloon(e,s,this._sourceWidth,this._sourceHeight,this._data.direction,this._sourceRectLeftOffset);e.fillStyle=v.generateColor(this._data.sourceBackColor,this._data.transparency),e.fill(),e.lineWidth=2,e.strokeStyle=v.generateColor(this._data.sourceStrokeColor,this._data.transparency),e.stroke(),e.textAlign=w()?"right":"left",e.textBaseline="top",e.fillStyle=this._data.sourceTextColor;var l=m(e,this._sourceWidth-6-4),d=2+a.x+3+l,h=2+a.y+2;e.font=t,e.fillText(this._data.sourceLine1,d,h),e.font=i,e.fillText(this._data.sourceLine2,d,h+this._sourceFontSize1+2);e.beginPath(),e.arc(s.x,s.y,3,0,2*Math.PI,!1),e.fillStyle=this._data.centersColor,e.fill(),e.restore()}_drawImpl(e){if(!(null===this._data||this._data.points.length<2)){var t=e.context;t.lineCap="butt",t.strokeStyle=this._data.color,t.lineWidth=this._data.linewidth,t.lineStyle=this._data.linestyle;var i=this._data.points[0],n=this._data.points[1],r=n.subtract(i);Math.abs(r.x)<1||Math.abs(r.y)<1?(t.beginPath(),t.moveTo(i.x,i.y),t.lineTo(n.x,n.y),t.stroke()):(t.save(),t.beginPath(),t.translate(i.x,i.y),t.scale(1,r.y/r.x),t.moveTo(0,0),t.arcTo(r.x,0,r.x,r.x,Math.abs(r.x)),t.lineTo(r.x,r.x),t.restore(),t.stroke()),this.drawTargetLabel(t),this.drawStartLabel(t);var s=Math.max(8,4*this._data.linewidth);t.fillStyle=this._data.color;var o=r.y<0?1:-1;if(Math.abs(r.x)<1||Math.abs(r.y)<1)var a=Math.atan(r.x/r.y);else{var l,d,h=Math.abs(r.x),c=Math.abs(r.y),u=0,p=Math.PI/2,_=(u+p)/2;if(r.length()>s)for(;;){l=h*Math.sin(_),d=c*(1-Math.cos(_));var g=Math.sqrt((l-h)*(l-h)+(d-c)*(d-c));if(Math.abs(g-s)<1)break;g>s?u=_:p=_,_=(u+p)/2}a=Math.atan((h-l)/(c-d)),r.x*r.y<0&&(a=-a)}t.save(),t.beginPath(),t.translate(n.x,n.y),t.rotate(-a),t.moveTo(0,0),t.lineTo(-s/2,o*s),t.lineTo(s/2,o*s),t.lineTo(0,0),t.restore(),t.fill()}}targetLabelHitTest(e){if(void 0===this._targetWidth||void 0===this._targetHeight||void 0===this._targetRectLeftOffset)return null;var t=this._targetHeight+this._arrowHeight;this._data.status&&(t+=this._targetFontSize1+10);var i="up"===this._data.direction?-1:1,n=this._radius,r=this._data.points[1],s=r.x-this._targetRectLeftOffset,l=r.y+i*n,d=r.y+i*(t+n),h=Math.min(l,d),c=Math.max(l,d)
|
||||
;return e.x>=s&&e.x<=s+this._targetWidth&&e.y>=h&&e.y<=c?new o(a.MovePoint):null}sourceLabelHitTest(e){if(void 0===this._sourceHeight||void 0===this._sourceWidth||void 0===this._sourceRectLeftOffset)return null;var t="up"===this._data.direction?1:-1,i=this._radius,n=this._data.points[0],r=n.x-this._sourceRectLeftOffset,s=n.y+i*t,l=n.y+(i+this._sourceHeight+this._arrowHeight)*t,d=Math.min(s,l),h=Math.max(s,l);return e.x>=r&&e.x<=r+this._sourceWidth&&e.y>=d&&e.y<=h?new o(a.MovePoint):null}hitTest(e){if(null===this._data||this._data.points.length<2)return null;var t=this._data.points[0],i=this._data.points[1],n=i.subtract(t),r=(n=i.subtract(t),e.subtract(t)),s=Math.abs(n.x),l=Math.abs(n.y),d=h.sign(n.y)*(l-l*Math.sqrt(1-r.x*r.x/(s*s)));if(Math.abs(d-r.y)<3)return new o(a.MovePoint);var c=this.targetLabelHitTest(e);return c||this.sourceLabelHitTest(e)}}t.PredictionPaneView=class extends r{constructor(e,t){super(e,t),this._pendingIcons=3;var n=this;function r(){n._pendingIcons-=1,0===n._pendingIcons&&n._source.model().updateSource(n._source)}this._clockWhite=null,this._successIcon=null,this._failureIcon=null,d("prediction-clock-white",i(99620)).then((function(e){n._clockWhite=e,r()})),d("prediction-success-white",i(14012)).then((function(e){n._successIcon=e,r()})),d("prediction-failure-white",i(88249)).then((function(e){n._failureIcon=e,r()})),this._percentageFormatter=new c,this._predictionRenderer=new C,this._renderer=null}iconsReady(){return 0===this._pendingIcons}renderer(e,t){return this._invalidated&&this._updateImpl(),this._renderer}_updateImpl(){if((super._updateImpl(),this._renderer=null,this._targetLine1="",this._targetLine2="",this._targetLine3="",this._targetLine4="",!(this._source.points().length<2))&&this._source.priceScale()){var e=this._source.ownerSource().formatter(),t=this._source.points()[1],n=this._source.points()[0];this._targetLine3=P(e.format(t.price));var r=t.price-n.price,o=r/Math.abs(n.price)*100;this._targetLine1=P(e.format(r)+" ("+this._percentageFormatter.format(o)+")");var a=this._model.timeScale().indexToUserTime(n.index),d=this._model.timeScale().indexToUserTime(t.index);n.time&&t.time&&(a=TradingView.isString(n.time)?new Date(Date.parse(n.time)):n.time,d=TradingView.isString(t.time)?new Date(Date.parse(t.time)):t.time);var h=this._model.mainSeries().isDWM(),c=s.parse(this._model.mainSeries().interval()),v=c.isSeconds()||c.isTicks();if(d&&a){this._targetLine4=(new u).format(d),h||(this._targetLine4=this._targetLine4+" "+new p(v?g:_).format(d));var m=(d.valueOf()-a.valueOf())/1e3;this._targetLine2=i(44352).t(null,{context:"dates"},i(91481))+" "+L((new f).format(m))}this._sourceLine1=e.format(n.price),this._sourceLine2="";var w=this._model.timeScale().indexToUserTime(n.index);w&&(this._sourceLine2=(new u).format(w),h||(this._sourceLine2=this._sourceLine2+" "+new p(v?g:_).format(w))),this._direction=this._source.direction()===x.Direction.Up?"up":"down",
|
||||
this._finished=this._model.lineBeingCreated()!==this._source&&this._model.lineBeingEdited()!==this._source&&!this._model.sourcesBeingMoved().includes(this._source);var R={};R.points=this._points,R.color=this._source.properties().linecolor.value(),R.linewidth=this._source.properties().linewidth.value(),R.targetLine1=this._targetLine1,R.targetLine2=this._targetLine2,R.targetLine3=this._targetLine3,R.targetLine4=this._targetLine4,R.status=this._source.properties().status.value(),R.transparency=this._source.properties().transparency.value(),R.targetBackColor=this._source.properties().targetBackColor.value(),R.targetStrokeColor=this._source.properties().targetStrokeColor.value(),R.targetTextColor=this._source.properties().targetTextColor.value(),R.sourceBackColor=this._source.properties().sourceBackColor.value(),R.sourceStrokeColor=this._source.properties().sourceStrokeColor.value(),R.sourceTextColor=this._source.properties().sourceTextColor.value(),R.successBackground=this._source.properties().successBackground.value(),R.successTextColor=this._source.properties().successTextColor.value(),R.failureBackground=this._source.properties().failureBackground.value(),R.failureTextColor=this._source.properties().failureTextColor.value(),R.intermediateBackColor=this._source.properties().intermediateBackColor.value(),R.intermediateTextColor=this._source.properties().intermediateTextColor.value(),R.sourceLine1=this._sourceLine1,R.sourceLine2=this._sourceLine2,R.direction=this._direction,R.clockWhite=this._clockWhite,R.successIcon=this._successIcon,R.failureIcon=this._failureIcon,R.finished=this._finished,R.centersColor=this._model.backgroundCounterColor().value(),this._predictionRenderer.setData(R);var y=new l;y.append(this._predictionRenderer),this.addAnchors(y),this._renderer=y}}}},86583:(e,t,i)=>{"use strict";var n=i(86441),r=n.Point,s=n.box,o=i(34026).pointInBox,a=i(79191).LineSourcePaneView,l=i(80101).SelectionRenderer,d=i(18807).HitTestResult,h=i(18807).HitTarget,c=i(19266).CompositeRenderer,u=i(87095),p=i(74359).calcTextHorizontalShift,_=i(38223).isRtl,g=i(15187).MediaCoordinatesPaneRenderer,f=i(46501);class v extends g{constructor(e,t){super(),this._data=null,this._measureCache=e,this._chartModel=t,this._points=null}setData(e){this._data=e,this._points=e.points}_drawImpl(e){if(null!==this._data&&null!==this._points&&0!==this._points.length){var t=e.context;t.font=[this._data.fontWeight,this._data.fontSize+"px",this._data.fontFamily].join(" ");var i=t.measureText(this._data.label);i.height=this._data.fontSize;var n=10,r=5,s=i.width+2*n,o=i.height+2*r,a=this._points[0].x- -9,l=this._points[0].y-(o+15);t.textAlign=_()?"right":"left";var d=p(t,i.width);this._measureCache&&Object.assign(this._measureCache,{innerWidth:s,innerHeight:o,tailLeft:-9,tailHeight:15}),t.translate(.5+a,.5+l),t.beginPath(),t.moveTo(12,o),t.lineTo(-9,o+15),t.lineTo(-10,o+15-1),t.lineTo(5,o),t.lineTo(3,o),t.arcTo(0,o,0,0,3),t.lineTo(0,3),t.arcTo(0,0,s,0,3),t.lineTo(s-3,0),t.arcTo(s,0,s,o,3),t.lineTo(s,o-3),t.arcTo(s,o,0,o,3),t.lineTo(12,o),
|
||||
t.fillStyle=u.generateColor(this._data.backgroundColor,this._data.transparency),t.fill(),t.strokeStyle=this._data.borderColor,t.lineWidth=2,t.stroke(),t.closePath(),t.textBaseline="alphabetic",t.fillStyle=this._data.color,t.fillText(this._data.label,n+d,o/2+Math.floor(.35*this._data.fontSize)),t.translate(-.5,-.5),t.beginPath(),t.arc(-9,o+15,2.5,0,2*Math.PI,!1),t.fillStyle=u.generateColor(this._data.borderColor,this._data.transparency),t.fill(),t.strokeStyle=this._chartModel.backgroundColor().value(),t.lineWidth=1,t.stroke(),t.closePath()}}hitTest(e){if(null===this._data||null===this._points||0===this._points.length)return null;var t=this._points[0].x-this._measureCache.tailLeft,i=this._points[0].y-(this._measureCache.innerHeight+this._measureCache.tailHeight),n=s(new r(t,i),new r(t+this._measureCache.innerWidth,i+this._measureCache.innerHeight));return o(e,n)?new d(h.MovePoint):null}}t.PriceLabelPaneView=class extends a{constructor(e,t,i){super(e,t),this._rendererCache={},this._priceLabelRenderer=new v(this._rendererCache,t),this._renderer=null}_updateImpl(){if(super._updateImpl(),this._renderer=null,this._source.points().length>0){var e=this._source.points()[0].price,t=this._source.priceScale();if(!t||t.isEmpty())return;var i=this._source.ownerSource().firstValue();this._priceLabel=t.formatPrice(e,i)}var n={};if(n.points=this._points,n.borderColor=this._source.properties().borderColor.value(),n.backgroundColor=this._source.properties().backgroundColor.value(),n.color=this._source.properties().color.value(),n.fontWeight=this._source.properties().fontWeight.value(),n.fontSize=this._source.properties().fontsize.value(),n.fontFamily=f.CHART_FONT_FAMILY,n.transparency=this._source.properties().transparency.value(),n.label=this._priceLabel,this._priceLabelRenderer.setData(n),1===n.points.length){var r=new c;return r.append(this._priceLabelRenderer),r.append(new l({points:n.points,bgColors:this._lineAnchorColors(n.points),visible:this.areAnchorsVisible()})),void(this._renderer=r)}this._renderer=this._priceLabelRenderer}renderer(e,t){return this._invalidated&&this._updateImpl(),this._renderer}}},29734:(e,t,i)=>{"use strict";i.r(t),i.d(t,{PriceNotePaneView:()=>m});var n=i(50151),r=i(86441),s=i(48891),o=i(19266),a=i(80657),l=i(79191),d=i(4652),h=i(79849),c=i(74359),u=i(46501),p=i(38325),_=i(18807),g=i(68441),f=i(45197);function v(e){let t,i;return e>=-135&&e<=-45?(t="center",i="bottom"):e>-45&&e<45?(t="left",i="middle"):e>=45&&e<=135?(t="center",i="top"):(t="right",i="middle"),{horzAlign:t,vertAlign:i}}class x{constructor(){this._data=null,this._priceLabelRenderer=new a.TextRenderer(void 0,new _.HitTestResult(_.HitTarget.MovePoint,{areaName:_.AreaName.Style,activeItem:1})),this._hittest=new _.HitTestResult(_.HitTarget.MovePoint,{areaName:_.AreaName.Style})}setData(e){this._data=e;const t=e.points[0],i=e.points[1],n=Math.round(180*Math.atan2(i.y-t.y,i.x-t.x)/Math.PI);this._priceLabelRenderer.setData({...v(n),points:[i],text:e.text,color:e.textColor,font:u.CHART_FONT_FAMILY,fontSize:e.fontSize,bold:e.bold,italic:e.italic,
|
||||
offsetX:0,offsetY:0,borderColor:e.borderColor,borderWidth:1,backgroundColor:e.backgroundColor,backgroundRoundRect:4,boxPaddingVert:6,boxPaddingHorz:8})}setHitTest(e){this._hittest=e}draw(e,t){const i=this._data;if(null===i||i.points.length<2)return;e.save();const n=t.pixelRatio,r=Math.round(i.points[0].x*n),s=Math.round(i.points[0].y*n),o=Math.round(i.points[1].x*n),a=Math.round(i.points[1].y*n);e.lineCap="round",(0,g.setLineStyle)(e,h.LINESTYLE_SOLID),e.strokeStyle=i.lineColor,e.fillStyle=i.lineColor,e.lineWidth=Math.round(1*n);const l=(0,f.fillScaledRadius)(2,n);(0,g.createCircle)(e,r,s,l),e.fill(),void 0!==i.excludeBoundaries&&(e.save(),(0,c.addExclusionArea)(e,t,i.excludeBoundaries)),(0,g.drawLine)(e,r,s,o,a),void 0!==i.excludeBoundaries&&e.restore(),this._priceLabelRenderer.draw(e,t);const d=1*n;e.strokeStyle=i.circleBorderColor,e.lineWidth=d;const u=l+d/2;(0,g.createCircle)(e,r,s,u),e.stroke(),e.restore()}hitTest(e){const t=this._data;if(null===t)return null;const i=(0,p.lastMouseOrTouchEventInfo)().isTouch?20:3;return(0,d.distanceToSegment)(t.points[0],t.points[1],e).distance<=i?this._hittest:this._priceLabelRenderer.hitTest(e)}}class m extends l.LineSourcePaneView{constructor(){super(...arguments),this._renderer=new o.CompositeRenderer,this._priceNoteRenderer=new x,this._customLabelRenderer=new a.TextRenderer}renderer(e,t){return this._invalidated&&this._updateImpl(e,t),this._renderer}_updateImpl(e,t){var i;super._updateImpl(),this._renderer.clear();const o=this._source.priceScale();if(!o||o.isEmpty())return;const l=this._points;if(l.length<2)return;const d=(0,n.ensureNotNull)(this._source.ownerSource()).firstValue();if(null===d)return;const h=this._source.properties().childs(),c=this._model.dark().value()?s.colorsPalette["color-cold-gray-900"]:s.colorsPalette["color-white"],p=this._source.points()[0].price,_={text:o.formatPrice(p,d),points:l,lineColor:h.lineColor.value(),circleBorderColor:c,backgroundColor:h.priceLabelBackgroundColor.value(),borderColor:h.priceLabelBorderColor.value(),textColor:h.priceLabelTextColor.value(),fontSize:h.priceLabelFontSize.value(),bold:h.priceLabelBold.value(),italic:h.priceLabelItalic.value()};if(h.showLabel&&h.showLabel.value()){const n=l[0],s=l[1],o=n.x<s.x?n:s,d=o===n?s:n,c=h.vertLabelsAlign.value(),p=h.horzLabelsAlign.value();let g;g="left"===p?o.clone():"right"===p?d.clone():new r.Point((n.x+s.x)/2,(n.y+s.y)/2);const f=Math.atan((d.y-o.y)/(d.x-o.x)),v={points:[g],text:h.text.value(),color:h.textColor.value(),vertAlign:c,horzAlign:p,font:u.CHART_FONT_FAMILY,offsetX:0,offsetY:0,bold:h.bold.value(),italic:h.italic.value(),fontsize:h.fontSize.value(),forceTextAlign:!0,angle:f};this._customLabelRenderer.setData(v),this._renderer.append(this._customLabelRenderer),"middle"===c&&(_.excludeBoundaries=null!==(i=(0,a.getTextBoundaries)(this._customLabelRenderer,t,e))&&void 0!==i?i:void 0)}this._renderer.append(this._priceNoteRenderer),this._priceNoteRenderer.setData(_),this._renderer.append(this.createLineAnchor({points:l},0))}}},61416:(e,t,i)=>{"use strict";i.r(t),i.d(t,{
|
||||
PriceRangePaneView:()=>v});var n=i(50151),r=i(86441),s=i(38223),o=i(80657),a=i(72739),l=i(99031),d=i(19266),h=i(93572),c=i(79849),u=i(73436),p=i(57322),_=i(46501),g=i(99734);const f=new h.PercentageFormatter;class v extends g.DateAndPriceRangeBasePaneView{constructor(){super(...arguments),this._topBorderRenderer=new l.TrendLineRenderer,this._bottomBorderRenderer=new l.TrendLineRenderer,this._distanceRenderer=new l.TrendLineRenderer,this._backgroundRenderer=new a.RectangleRenderer,this._labelRenderer=new o.TextRenderer,this._renderer=new d.CompositeRenderer,this._pipFormatter=null,this._lastSymbolInfo=null}renderer(e,t){return this._invalidated&&this._updateImpl(e,t),this._renderer}_updateImpl(e,t){var i,a,l;if(super._updateImpl(),this._renderer.clear(),this._points.length<2||this._source.points().length<2)return;const d=this._source.properties().childs(),h=d.extendLeft.value(),g=d.extendRight.value(),[v,x]=this._points,m=Math.min(v.x,x.x),w=Math.max(v.x,x.x);d.fillBackground.value()&&(this._backgroundRenderer.setData({points:[new r.Point(m,v.y),new r.Point(w,x.y)],color:"white",linewidth:0,backcolor:d.backgroundColor.value(),fillBackground:!0,transparency:d.backgroundTransparency.value(),extendLeft:h,extendRight:g}),this._renderer.append(this._backgroundRenderer));const R=(e,t,i)=>{e.setData({points:[t,i],color:d.linecolor.value(),linewidth:d.linewidth.value(),linestyle:c.LINESTYLE_SOLID,extendleft:h,extendright:g,leftend:u.LineEnd.Normal,rightend:u.LineEnd.Normal}),this._renderer.append(e)};let y=m,T=w;y===T&&(h&&(y-=1),g&&(T+=1)),R(this._topBorderRenderer,new r.Point(y,v.y),new r.Point(T,v.y)),R(this._bottomBorderRenderer,new r.Point(y,x.y),new r.Point(T,x.y));const b=Math.round((v.x+x.x)/2),P=new r.Point(b,v.y),L=new r.Point(b,x.y),S=this._updateCustomTextRenderer(e,t);this._distanceRenderer.setData({points:[P,L],color:d.linecolor.value(),linewidth:d.linewidth.value(),linestyle:c.LINESTYLE_SOLID,extendleft:!1,extendright:!1,leftend:u.LineEnd.Normal,rightend:Math.abs(P.y-L.y)>=15*d.linewidth.value()?u.LineEnd.Arrow:u.LineEnd.Normal,excludeBoundaries:null!=S?S:void 0}),this._renderer.append(this._distanceRenderer);const C=this._source.points()[0].price,M=this._source.points()[1].price,I=M-C,A=100*I/Math.abs(C),k=this._model.mainSeries().symbolInfo();k&&k!==this._lastSymbolInfo&&(this._pipFormatter=new p.PipFormatter(k.pricescale,k.minmov,k.type,k.minmove2,k.typespecs),this._lastSymbolInfo=k);const N=(0,n.ensureNotNull)(this._source.ownerSource()).formatter(),D=null!==(a=null===(i=N.formatChange)||void 0===i?void 0:i.call(N,M,C))&&void 0!==a?a:N.format(I),B=(0,s.forceLTRStr)(D+" ("+f.format(A)+") "+(this._pipFormatter?this._pipFormatter.format(I):""));let z;z=M>C?new r.Point(.5*(v.x+x.x),x.y-2*d.fontsize.value()):new r.Point(.5*(v.x+x.x),x.y+.7*d.fontsize.value());const E={x:0,y:10},H=d.fontsize.value(),O={points:[z],text:B,color:d.textcolor.value(),font:_.CHART_FONT_FAMILY,offsetX:E.x,offsetY:E.y,padding:8,vertAlign:"middle",horzAlign:"center",fontsize:H,backgroundRoundRect:4,backgroundHorzInflate:.4*H,
|
||||
backgroundVertInflate:.2*H};(null===(l=d.fillLabelBackground)||void 0===l?void 0:l.value())&&(O.boxShadow={shadowColor:d.shadow.value(),shadowBlur:4,shadowOffsetY:1},O.backgroundColor=d.labelBackgroundColor.value()),this._labelRenderer.setData(O);const V=this._labelRenderer.measure(),W=(0,o.calculateLabelPosition)(V,v,x,E,e);this._labelRenderer.setPoints([W]),this._renderer.append(this._labelRenderer),this._renderer.append(this._customTextrenderer),this.addAnchors(this._renderer)}_needLabelExclusionPath(e){return e.getLinesInfo().lines.length>0}}},75219:(e,t,i)=>{"use strict";var n=i(81139).ArcWedgeRenderer,r=i(60322).FibWedgePaneView,s=i(99031).TrendLineRenderer,o=i(19266).CompositeRenderer,a=i(73436).LineEnd;t.ProjectionLinePaneView=class extends r{constructor(e,t){super(e,t),this._baseTrendRenderer=new s,this._edgeTrendRenderer=new s,this._arcWedgeRenderer=new n}renderer(e,t){return this._invalidated&&this._updateImpl(),this._renderer}_updateRenderer(){if(!(this._points.length<2)){var e=new o,t=this._source.properties(),i=this._points,n=i[0],r=i[1],s={points:[n,r],width:this._model.timeScale().width(),height:this._source.priceScale().height(),color:t.trendline.color.value(),linewidth:t.linewidth.value(),linestyle:t.trendline.linestyle.value(),extendleft:!1,extendright:!1,leftend:a.Normal,rightend:a.Normal};if(this._baseTrendRenderer.setData(s),e.append(this._baseTrendRenderer),this._points.length<3)return this.addAnchors(e),void(this._renderer=e);var l=i[2],d=l.data,h=r.subtract(n).length(),c=l.subtract(n).normalized();(l=n.add(c.scaled(h))).data=d,s={points:[n,l],width:this._model.timeScale().width(),height:this._source.priceScale().height(),color:t.trendline.color.value(),linewidth:t.linewidth.value(),linestyle:t.trendline.linestyle.value(),extendleft:!1,extendright:!1,leftend:a.Normal,rightend:a.Normal},this._edgeTrendRenderer.setData(s),e.append(this._edgeTrendRenderer);var u=this._levels[0],p={};p.center=this._points[0],p.radius=u.radius,p.prevRadius=0,p.edge=this._edge,p.color=t.trendline.color.value(),p.color1=t.color1.value(),p.color2=t.color2.value(),p.linewidth=t.linewidth.value(),p.edge1=this._edge1,p.edge2=this._edge2,p.p1=u.p1,p.p2=u.p2,p.fillBackground=t.fillBackground.value(),p.transparency=t.transparency.value(),p.gradient=!0,this._arcWedgeRenderer.setData(p),e.append(this._arcWedgeRenderer),this.addAnchors(e),this._renderer=e}}}},31320:(e,t,i)=>{"use strict";i.r(t),i.d(t,{RectanglePaneView:()=>h});var n=i(86441),r=i(46501),s=i(72739),o=i(19266),a=i(80657),l=i(79191),d=i(66103);class h extends l.LineSourcePaneView{constructor(e,t){super(e,t),this._rectangleRenderer=new s.RectangleRenderer,this._textRenderer=new a.TextRenderer,this._renderer=null}renderer(e,t){return this._invalidated&&this._updateImpl(),this._renderer}_updateImpl(){if(super._updateImpl(),this._renderer=null,this._points.length<2)return;const e=this._getSource().properties().childs(),t={points:this._points,color:e.color.value(),linewidth:e.linewidth.value(),backcolor:e.backgroundColor.value(),fillBackground:e.fillBackground.value(),
|
||||
transparency:e.transparency.value(),extendLeft:e.extendLeft.value(),extendRight:e.extendRight.value()};this._rectangleRenderer.setData(t);const i=new o.CompositeRenderer;i.append(this._rectangleRenderer);const s=this._points[0],a=this._points[1];if(e.showLabel.value()){const t=Math.min(s.x,a.x),o=Math.max(s.x,a.x),l=Math.min(s.y,a.y),d=Math.max(s.y,a.y);let h,c,u,p;const _=e.fontSize.value()/3;let g,f,v=0;switch(e.vertLabelsAlign.value()){case"middle":p=(l+d)/2,c="middle",v=_;break;case"top":p=d,c="top";break;case"bottom":p=l,c="bottom"}switch(e.horzLabelsAlign.value()){case"center":u=(t+o)/2,h="center";break;case"left":u=t,h="left";break;case"right":u=o,h="right"}"middle"===c&&(g=o-t-2*v,f=d-l);const x={points:[new n.Point(u,p)],text:e.text.value(),fontSize:e.fontSize.value(),font:r.CHART_FONT_FAMILY,bold:e.bold.value(),italic:e.italic.value(),horzAlign:h,vertAlign:c,color:e.textColor.value(),wordWrapWidth:g,maxHeight:f,offsetX:0,offsetY:0,boxPaddingVert:_,boxPaddingHorz:v,forceTextAlign:!0};this._textRenderer.setData(x),i.append(this._textRenderer)}this._addAnchors(s,a,i),this._renderer=i}_addAnchors(e,t,i){const r=new n.Point(e.x,t.y);r.data=2;const s=new n.Point(t.x,e.y);s.data=3;const o=new n.Point(e.x,.5*(e.y+t.y));o.data=4;const a=new n.Point(t.x,.5*(e.y+t.y));a.data=5;const l=new n.Point(.5*(e.x+t.x),e.y);l.data=6;const h=new n.Point(.5*(e.x+t.x),t.y);h.data=7,[o,a,l,h].forEach((e=>e.square=!0));const c=e.x-t.x,u=e.y-t.y,p=Math.sign(c*u),_=[p<0?d.PaneCursorType.DiagonalNeSwResize:d.PaneCursorType.DiagonalNwSeResize,p<0?d.PaneCursorType.DiagonalNeSwResize:d.PaneCursorType.DiagonalNwSeResize,p>0?d.PaneCursorType.DiagonalNeSwResize:d.PaneCursorType.DiagonalNwSeResize,p>0?d.PaneCursorType.DiagonalNeSwResize:d.PaneCursorType.DiagonalNwSeResize,d.PaneCursorType.HorizontalResize,d.PaneCursorType.HorizontalResize,d.PaneCursorType.VerticalResize,d.PaneCursorType.VerticalResize];i.append(this.createLineAnchor({points:[e,t,r,s,o,a,l,h],pointsCursorType:_},0))}}},5374:(e,t,i)=>{"use strict";i.r(t),i.d(t,{RegressionTrendPaneView:()=>g});var n=i(50151),r=i(87095),s=i(18807),o=i(19266),a=i(28621),l=i(80657),d=i(99031),h=i(80101),c=i(86441),u=i(73436),p=i(46501);var _=i(79191);class g extends _.LineSourcePaneView{constructor(e,t){super(e,t),this._data=null,this._pearsonsLabelRenderer=new l.TextRenderer,this._renderer=null,this._renderer=null}renderer(){return this._invalidated&&this._updateImpl(),this._renderer}_updateImpl(){super._updateImpl(),this._data=function(e,t){const i={lines:[],pearsons:null};if(!t.properties().visible.value())return i;const r=e.timeScale(),s=t.priceScale(),o=e.mainSeries().firstBar();if(!s||s.isEmpty()||r.isEmpty()||!o)return i;const a=t.startIndex(),l=t.endIndex();if(null===a||null===l)return i;const d=[t.baseLine(),t.downLine(),t.upLine()],h=Math.round(r.indexToCoordinate(a)),_=Math.round(r.indexToCoordinate(l)),g=t.properties(),f=[g.styles.baseLine,g.styles.downLine,g.styles.upLine],v=o[4];for(let r=0;r<d.length;r++){if(1!=(1&f[r].display.value()))continue;const o=(0,
|
||||
n.ensureNotNull)(d[r]).startPrice,a=(0,n.ensureNotNull)(d[r]).endPrice;if(void 0===o||void 0===a)continue;const l=s.priceToCoordinate(o,v),p=s.priceToCoordinate(a,v),x=new c.Point(h,l),m=new c.Point(_,p),w=f[r].color.value(),R=f[r].linewidth.value(),y=f[r].linestyle.value(),T={points:[x,m],width:e.timeScale().width(),height:(0,n.ensureNotNull)(t.priceScale()).height(),color:w,linewidth:R,linestyle:y,extendleft:!1,extendright:g.styles.extendLines.value(),leftend:u.LineEnd.Normal,rightend:u.LineEnd.Normal};i.lines.push(T)}const x=(0,n.ensureNotNull)(t.downLine());if(g.styles.showPearsons.value()&&void 0!==x.startPrice){const e=s.priceToCoordinate(x.startPrice,v),n=new c.Point(h,e);i.pearsons={points:[n],text:""+t.pearsons(),color:g.styles.downLine.color.value(),vertAlign:"top",horzAlign:"center",font:p.CHART_FONT_FAMILY,offsetX:0,offsetY:4,fontsize:12}}return i}(this._model,this._source),this._renderer=null;const e=new o.CompositeRenderer;let t=[];const i=[this._data.lines[1],this._data.lines[0],this._data.lines[2]].filter((e=>!!e)),l=this._source.properties().childs().styles.childs().transparency.value();for(let t=1;t<i.length;t++){const n={points:[i[t].points[0],i[t].points[1],i[t-1].points[0],i[t-1].points[1]],color:i[t].color,linewidth:i[t].linewidth,linestyle:i[t].linestyle,extendleft:!1,extendright:i[t].extendright,backcolor:i[t].color,transparency:l,skipLines:!0,fillBackground:!0,showMidline:!1},r=new a.ParallelChannelRenderer(new s.HitTestResult(s.HitTarget.Regular));r.setData(n),e.append(r)}const _=this._getTransparencyResetLines();for(let n=0;n<i.length;n++){const r=new d.TrendLineRenderer;r.setData(_[n]),r.setHitTest(new s.HitTestResult(s.HitTarget.Regular)),e.append(r),0!==n&&(t=t.concat(i[n].points))}this._data.pearsons&&(this._data.pearsons.color=(0,r.resetTransparency)(this._data.pearsons.color),this._pearsonsLabelRenderer.setData(this._data.pearsons),e.append(this._pearsonsLabelRenderer)),this._data.lines.length>=1&&e.append(new h.SelectionRenderer({points:t,bgColors:this._lineAnchorColors(t),visible:this.areAnchorsVisible(),hittestResult:s.HitTarget.Regular,barSpacing:this._model.timeScale().barSpacing()})),this._renderer=e}_getTransparencyResetLines(){return(0,n.ensureNotNull)(this._data).lines.map((e=>({...e,color:(0,r.resetTransparency)(e.color)})))}}},56457:(e,t,i)=>{"use strict";i.r(t),i.d(t,{RiskRewardPaneView:()=>A});var n=i(86441),r=i(50151),s=i(44352),o=i(79191),a=i(99031),l=i(80657),d=i(72739),h=i(18807),c=i(19266),u=i(93572),p=i(87663),_=i(57322),g=i(87095),f=i(73436),v=i(95539),x=i(38223),m=i(66103),w=i(88145),R=i(46501),y=i(79849);const T=[m.PaneCursorType.Default,m.PaneCursorType.HorizontalResize,m.PaneCursorType.VerticalResize,m.PaneCursorType.VerticalResize],b=s.t(null,void 0,i(72892)),P=s.t(null,{context:"line_tool_position"},i(50140)),L=s.t(null,{context:"line_tool_position"},i(44143)),S=s.t(null,void 0,i(53115)),C=s.t(null,void 0,i(438)),M=s.t(null,void 0,i(15166)),I=s.t(null,void 0,i(87061));class A extends o.LineSourcePaneView{constructor(){super(...arguments),
|
||||
this._percentageFormatter=new u.PercentageFormatter,this._numericFormatter=new p.NumericFormatter,this._pipFormatter=null,this._lastSymbolInfo=null,this._entryLineRenderer=new a.TrendLineRenderer,this._stopLineRenderer=new a.TrendLineRenderer,this._targetLineRenderer=new a.TrendLineRenderer,this._positionLineRenderer=new a.TrendLineRenderer,this._fullStopBgRenderer=new d.RectangleRenderer(new h.HitTestResult(h.HitTarget.MovePoint),new h.HitTestResult(h.HitTarget.MovePoint)),this._stopBgRenderer=new d.RectangleRenderer(new h.HitTestResult(h.HitTarget.MovePoint),new h.HitTestResult(h.HitTarget.MovePoint)),this._fullTargetBgRenderer=new d.RectangleRenderer(new h.HitTestResult(h.HitTarget.MovePoint),new h.HitTestResult(h.HitTarget.MovePoint)),this._targetBgRenderer=new d.RectangleRenderer(new h.HitTestResult(h.HitTarget.MovePoint),new h.HitTestResult(h.HitTarget.MovePoint)),this._stopLabelRenderer=new l.TextRenderer,this._middleLabelRenderer=new l.TextRenderer,this._profitLabelRenderer=new l.TextRenderer,this._renderer=new c.CompositeRenderer}isLabelVisible(){return this.isHoveredSource()||this.isSelectedSource()||this._source.properties().childs().alwaysShowStats.value()}renderer(e,t){return this._invalidated&&this._updateImpl(e,t),this._renderer}_updateImpl(e,t){super._updateImpl(e,t),this._renderer.clear();const i=this._model.timeScale(),s=this._source.priceScale();if(!s||s.isEmpty()||i.isEmpty())return;const o=this._source.points();if(o.length<2||this._points.length<2)return;const a=(0,r.ensureNotNull)(this._source.ownerSource()),l=null==a?void 0:a.barsProvider().bars();if(!l||l.isEmpty())return;if(null===l.last())return;const d=4===o.length,h=this._source.lastBarData();if(!h)return;const c=h.closePrice,u=this._source.stopPrice(),p=this._source.profitPrice(),g=this._source.calculatePL(c),f=a.symbolSource().symbolInfo();if(!f)return;const x=a.firstValue();if(null===x)return;const m=this._points[v.RiskRewardPointIndex.Entry].y,w=s.priceToCoordinate(u,x),R=s.priceToCoordinate(p,x),y=s.priceToCoordinate(h.closePrice,x),b=i.indexToCoordinate(h.index),P=this._points[v.RiskRewardPointIndex.Entry].x,L=this._points[v.RiskRewardPointIndex.ActualEntry]?this._points[v.RiskRewardPointIndex.ActualEntry].x:this._points[v.RiskRewardPointIndex.Close].x,S=this._points[v.RiskRewardPointIndex.ActualClose]?this._points[v.RiskRewardPointIndex.ActualClose].x:this._points[v.RiskRewardPointIndex.Close].x,C=this._points[v.RiskRewardPointIndex.Close].x,M=this._source.entryPrice(),I=this._source.stopPrice(),A=this._source.profitPrice(),k={pl:g,isClosed:d,entryLevel:m,stopLevel:w,profitLevel:R,closeLevel:y,closeBar:b,left:P,entryX:L,right:S,edge:C,entryPrice:M,stopPrice:I,profitPrice:A,currentPrice:c};let N=C<-5||P>t+5;if(this._createBackgroundRenderers(k,this._renderer),this._createLinesRenderers(k,this._renderer),this._createLabelsRenderers(k,this._renderer,f),f!==this._lastSymbolInfo&&(this._pipFormatter=new _.PipFormatter(f.pricescale,f.minmov,f.type,f.minmove2,f.typespecs),this._lastSymbolInfo=f),
|
||||
N=[this._profitLabelRenderer,this._stopLabelRenderer,this._middleLabelRenderer].reduce(((i,n)=>i&&n.isOutOfScreen(t,e)),N),N)return;const D=this._points[0].clone();D.data=0,D.snappingPrice=M;const B=new n.Point(P,w);B.data=2,B.square=!0,B.snappingPrice=I;const z=new n.Point(P,R);z.data=3,z.square=!0,z.snappingPrice=A;const E=new n.Point(C,D.y);E.data=1,E.square=!0,E.snappingIndex=h.index;const H={points:[D,E,B,z],pointsCursorType:T};this._renderer.append(this.createLineAnchor(H,0))}_createBackgroundRenderers(e,t){const i=this._source.properties().childs();{const t={points:[new n.Point(e.left,e.entryLevel),new n.Point(e.edge,e.stopLevel)],color:"white",linewidth:0,backcolor:i.stopBackground.value(),fillBackground:!0,transparency:i.stopBackgroundTransparency.value(),extendLeft:!1,extendRight:!1};this._fullStopBgRenderer.setData(t),this._renderer.append(this._fullStopBgRenderer)}if(e.pl<0&&e.entryX!==e.right){const t=new n.Point(e.entryX,e.entryLevel),r=new n.Point(e.right,e.closeLevel),s=.01*i.stopBackgroundTransparency.value(),o=100-100*(1-s*s*s),a={points:[t,r],color:"white",linewidth:0,backcolor:i.stopBackground.value(),fillBackground:!0,transparency:o,extendLeft:!1,extendRight:!1};this._stopBgRenderer.setData(a),this._renderer.append(this._stopBgRenderer)}{const t={points:[new n.Point(e.left,e.entryLevel),new n.Point(e.edge,e.profitLevel)],color:"white",linewidth:0,backcolor:i.profitBackground.value(),fillBackground:!0,transparency:i.profitBackgroundTransparency.value(),extendLeft:!1,extendRight:!1};this._fullTargetBgRenderer.setData(t),this._renderer.append(this._fullTargetBgRenderer)}if(e.pl>0&&e.entryX!==e.right){const t=new n.Point(e.entryX,e.entryLevel),r=new n.Point(e.right,e.closeLevel),s=.01*i.profitBackgroundTransparency.value(),o=100-100*(1-s*s*s),a={points:[t,r],color:"white",linewidth:0,backcolor:i.profitBackground.value(),fillBackground:!0,transparency:o,extendLeft:!1,extendRight:!1};this._targetBgRenderer.setData(a),this._renderer.append(this._targetBgRenderer)}}_createLinesRenderers(e,t){const i=this._source.properties().childs(),r=(e,t,n,r)=>{const s={points:[t,n],color:null!=r?r:i.linecolor.value(),linewidth:i.linewidth.value(),linestyle:y.LINESTYLE_SOLID,extendleft:!1,extendright:!1,leftend:f.LineEnd.Normal,rightend:f.LineEnd.Normal};e.setData(s),this._renderer.append(e)};if(this._points[v.RiskRewardPointIndex.ActualEntry]){const t={points:[this._points[v.RiskRewardPointIndex.ActualEntry],e.isClosed?this._points[v.RiskRewardPointIndex.ActualClose]:new n.Point(e.closeBar,e.closeLevel)],color:this._source.properties().childs().linecolor.value(),linewidth:1,linestyle:y.LINESTYLE_DASHED,extendleft:!1,extendright:!1,leftend:f.LineEnd.Normal,rightend:f.LineEnd.Arrow};this._positionLineRenderer.setData(t),this._renderer.append(this._positionLineRenderer)}{const t=new n.Point(e.left,this._points[v.RiskRewardPointIndex.Entry].y),i=new n.Point(e.edge,this._points[v.RiskRewardPointIndex.Entry].y);r(this._entryLineRenderer,t,i)}{const t=new n.Point(e.left,e.stopLevel),s=new n.Point(e.edge,e.stopLevel)
|
||||
;r(this._stopLineRenderer,t,s,i.stopBackground.value())}{const t=new n.Point(e.left,e.profitLevel),s=new n.Point(e.edge,e.profitLevel);r(this._targetLineRenderer,t,s,i.profitBackground.value())}}_addCenterLabel(e,t,i){const n=this._source.properties().childs(),r={font:R.CHART_FONT_FAMILY,offsetX:3,horzAlign:"center",backgroundRoundRect:4,backgroundHorzInflate:4,points:[i.p],text:i.txt,color:n.textcolor.value(),offsetY:i.offsetY,vertAlign:i.vertAlign,backgroundColor:(0,g.resetTransparency)(i.color),fontsize:n.fontsize.value(),borderColor:i.border};return t.setData(r),e.append(t),r}_creareMiddleLabel(e,t,i){const{entryPrice:s,profitPrice:o,stopPrice:a,currentPrice:l,pl:d,left:h,edge:c,isClosed:u}=e,p=Math.abs(s-o)/Math.abs(s-a),_=this._source.properties().childs(),g=(0,r.ensureNotNull)(this._source.ownerSource()),f=new n.Point((h+c)/2,Math.round(this._points[0].y));let v="",x="";const m=this._numericFormatter.format(Math.round(100*p)/100);if(this._points[1]){const e=g.formatter();if(e.formatChange){const t=Math.max(l,s),i=Math.min(l,s);x=d>=0?e.formatChange(t,i):e.formatChange(i,t)}else x=e.format(d)}const R=_.qty.value()/_.lotSize.value(),y="futures"===i.type||(0,w.hasCryptoTypespec)(i.typespecs||[])?Math.round(1e3*R)/1e3:Math.floor(R);if(_.compact.value())v+=x?x+" ~ ":"",v+=y+"\n",v+=m;else{const e=u?L:P;v+=x?b.format({status:e,pnl:x})+", ":"",v+=I.format({qty:""+y})+"\n",v+=S.format({ratio:m})+" "}let T=_.linecolor.value();return d<0?T=_.stopBackground.value():d>0&&(T=_.profitBackground.value()),this._addCenterLabel(t,this._middleLabelRenderer,{p:f,txt:v,color:T,vertAlign:"middle",offsetY:0,border:"white"})}_createStopLabel(e,t){var i,s;const{stopPrice:o,entryPrice:a,left:l,edge:d,stopLevel:h}=e,c=this._source.properties().childs(),u=(0,r.ensureNotNull)(this._source.ownerSource()),p=Math.abs(o-a),_=Math.round(1e4*p/a)/100,g=new n.Point((l+d)/2,h);let f="";const v=u.formatter(),m=null!==(s=null===(i=v.formatChange)||void 0===i?void 0:i.call(v,Math.max(o,a),Math.min(o,a)))&&void 0!==s?s:v.format(p),w=this._percentageFormatter.format(_);return f=c.compact.value()?m+" ("+w+") "+c.amountStop.value():C.format({stopChange:(0,x.forceLTRStr)(m),stopChangePercent:(0,x.forceLTRStr)(this._percentageFormatter.format(_)),stopChangePip:this._pipFormatter?(0,x.forceLTRStr)(this._pipFormatter.format(p)):"",amount:(0,x.forceLTRStr)(""+c.amountStop.value())}),this._addCenterLabel(t,this._stopLabelRenderer,{p:g,txt:f,color:c.stopBackground.value(),vertAlign:a<o?"bottom":"top",offsetY:0})}_createTargetLabel(e,t){var i,s;const{profitPrice:o,entryPrice:a,stopPrice:l,left:d,edge:h,profitLevel:c}=e,u=this._source.properties().childs(),p=(0,r.ensureNotNull)(this._source.ownerSource()),_=Math.abs(o-a),g=Math.round(1e4*_/a)/100,f=new n.Point((d+h)/2,c);let v="";const m=p.formatter(),w=null!==(s=null===(i=m.formatChange)||void 0===i?void 0:i.call(m,Math.max(o,a),Math.min(o,a)))&&void 0!==s?s:m.format(_),R=this._percentageFormatter.format(g);return v=u.compact.value()?w+" ("+R+") "+u.amountTarget.value():M.format({profitChange:w,
|
||||
profitChangePercent:(0,x.forceLTRStr)(this._percentageFormatter.format(g)),profitChangePip:this._pipFormatter?(0,x.forceLTRStr)(this._pipFormatter.format(_)):"",amount:(0,x.forceLTRStr)(""+u.amountTarget.value())}),this._addCenterLabel(t,this._profitLabelRenderer,{p:f,txt:v,color:u.profitBackground.value(),vertAlign:a<l?"top":"bottom",offsetY:0})}_createLabelsRenderers(e,t,i){var s;if(!this.isLabelVisible())return;const o=this._creareMiddleLabel(e,t,i),a=this._createStopLabel(e,t),l=this._createTargetLabel(e,t),d=[this._profitLabelRenderer,this._stopLabelRenderer,this._middleLabelRenderer].reduce(((e,t)=>Math.max(e,t.measure().width)),0),h=e.edge-e.left,c=this._anchorRadius();if(h-d-c<=8&&(l&&(l.offsetY+=c+8,this._profitLabelRenderer.setData(l)),a&&(a.offsetY+=c+8,this._stopLabelRenderer.setData(a)),o)){let t;if(null===(s=this._source.priceScale())||void 0===s?void 0:s.isLog()){const i=Math.abs(this._points[0].y-e.stopLevel);t=Math.abs(this._points[0].y-e.profitLevel)>i?-1:1}else{const i=Math.abs(e.stopPrice-e.entryPrice);t=Math.abs(e.profitPrice-e.entryPrice)>i?-1:1}const i=e.profitLevel<e.stopLevel?1:-1,a=(0,r.ensureDefined)(o.points)[0].add(new n.Point(0,i*t*(.5*this._middleLabelRenderer.measure().height+c+8)));o.points=[a],this._middleLabelRenderer.setData(o)}}}},55832:(e,t,i)=>{"use strict";var n=i(86441).Point,r=i(4652).distanceToLine,s=i(79191).LineSourcePaneView,o=i(79191).thirdPointCursorType,a=i(99031).TrendLineRenderer,l=i(79797).PolygonRenderer,d=i(19266).CompositeRenderer,h=i(73436).LineEnd,c=i(66103).PaneCursorType;const{LINESTYLE_SOLID:u}=i(79849);t.RotatedRectanglePaneView=class extends s{constructor(e,t){super(e,t),this._poligonRenderer=new l,this._renderer=null}_updateImpl(){if(super._updateImpl(),this._renderer=null,this._distance=0,3===this._points.length&&(this._distance=r(this._points[0],this._points[1],this._points[2]).distance),0!==this._points.length){var e,t,i,s,l=new d,p=this._source.properties(),_=this._points[0],g=this._points[1];if(2===this._points.length){(v={}).points=this._points,v.floatPoints=this._floatPoints,v.width=this._model.timeScale().width(),v.height=this._source.priceScale().height(),v.color=p.color.value(),v.linewidth=1,v.linestyle=u,v.extendleft=!1,v.extendright=!1,v.leftend=h.Normal,v.rightend=h.Normal;var f=new a;f.setData(v),l.append(f)}else if(3===this._points.length){var v,x=g.subtract(_),m=new n(x.y,-x.x).normalized().scaled(this._distance),w=m.scaled(-1);e=_.add(m),t=g.add(m),i=_.add(w),s=g.add(w),(v={}).points=[e,t,s,i],v.color=p.color.value(),v.linewidth=this._source.properties().linewidth.value(),v.linestyle=u,v.filled=!0,v.backcolor=p.backgroundColor.value(),v.fillBackground=p.fillBackground.value(),v.transparency=p.transparency.value(),this._poligonRenderer.setData(v),l.append(this._poligonRenderer)}var R=[];R.push(_),this._points.length>=2&&R.push(g);var y=[c.Default,c.Default];if(3===this._points.length){e.data=2,i.data=2,t.data=2,s.data=2,R.push(e,i,t,s);var T=o(_,g);y.push(T,T,T,T)}l.append(this.createLineAnchor({points:R,pointsCursorType:y},0)),
|
||||
this._renderer=l}}renderer(e,t){return this._invalidated&&this._updateImpl(),this._renderer}}},26294:(e,t,i)=>{"use strict";i.r(t),i.d(t,{SignpostPaneView:()=>L});var n=i(86441),r=i(48891),s=i(19266),o=i(66103),a=i(18807),l=i(79191),d=i(85573),h=i(46501),c=i(4652),u=i(34026),p=i(50151),_=i(38325),g=i(80657),f=i(45197);function v(e){return void 0===e?0:e.poleTailHeight+2*e.circleRadius}function x(e){return e.poleStartY}function m(e){return e.inverseAnchorPosition?e.anchorY:e.anchorY+(e.labelHeight+v(e.plate))*e.direction}function w(e){return e.inverseAnchorPosition?e.anchorY+v(e.plate)*e.direction:e.anchorY+e.labelHeight*e.direction}class R{constructor(e,t){this._data=null,this._hitTestResult=e,this._phantomMode=Boolean(t)}setData(e){if(null===e)return void(this._data=null);this._data={...e,labelHeight:0,labelRenderer:new g.TextRenderer};const t=this._data,i=t.label,r={offsetX:0,offsetY:0,points:[new n.Point(t.x,t.anchorY)],forceCalculateMaxLineWidth:!0,vertAlign:-1===i.labelDirection?"bottom":"top",horzAlign:"center",horzTextAlign:"center",font:i.labelFont,fontSize:i.labelFontSize,bold:i.labelFontBold,italic:i.labelFontItalic,backgroundRoundRect:i.labelBorderRadius,padding:i.labelPadding,boxPaddingVert:i.labelBoxPaddingVert,boxPaddingHorz:i.labelBoxPaddingHorz,wordWrapWidth:i.labelWordWrapWidth,color:i.labelColor,borderColor:i.labelBorderColor,borderWidth:1,backgroundColor:i.labelBackgroundColor,text:i.text};if(t.labelRenderer.setData(r),this._data.labelHeight=this._data.labelRenderer.measure().height,t.inverseAnchorPosition){const e=(0,p.ensureDefined)(r.points);r.points=[new n.Point(e[0].x,w(t))]}else{const e=1===t.direction?Math.min(t.poleStartY-this._data.labelHeight,t.anchorY):Math.max(t.poleStartY+this._data.labelHeight,t.anchorY);t.anchorY!==e&&(t.anchorY=e,r.points=[new n.Point(t.x,e)])}t.labelRenderer.setData(r)}itemAnchorY(){return null===this._data?null:this._data.anchorY}hitTest(e,t){if(null===this._data)return null;const[i,r,s]=function(e,t){const i=(0,_.lastMouseOrTouchEventInfo)().isTouch?20:3,r=e.x,s=e.plate,o=(0,c.distanceToSegment)(new n.Point(r,x(e)),new n.Point(r,m(e)),t).distance<i;let a=!1;if(!o&&void 0!==s){const o=e.inverseAnchorPosition?e.anchorY+s.circleRadius*e.direction:e.anchorY+(e.labelHeight+s.poleTailHeight+s.circleRadius)*e.direction;a=s.circleRadius>0&&(0,u.pointInCircle)(t,new n.Point(r,o),s.circleRadius+i)}return[o,a,!o&&!a&&null!==e.labelRenderer.hitTest(t)]}(this._data,e);if(i||r||s){const e={hideCrosshairLinesOnHover:!0,activeItem:i||r?this._data.itemIndex:this._data.label.labelIndex};return s?e.areaName=a.AreaName.Text:r&&(e.areaName=a.AreaName.Style),new a.HitTestResult(this._hitTestResult,e)}return null}draw(e,t){if(null===this._data)return;e.save(),this._phantomMode&&(e.globalAlpha=.5);const{poleColor:i,emojiRadius:n}=this._data,r=t.pixelRatio,s=Math.max(1,Math.floor(r)),o=s%2?.5:0;e.beginPath(),e.strokeStyle=i,e.lineWidth=s;const a=Math.round(this._data.x*r)+o;e.moveTo(a,Math.round(x(this._data)*r)),e.lineTo(a,Math.round(m(this._data)*r)),
|
||||
void 0!==this._data.plate&&0!==this._data.plate.poleTailHeight&&(e.moveTo(a,Math.round(w(this._data)*r)),e.lineTo(a,Math.round(function(e){var t,i;const n=null!==(i=null===(t=e.plate)||void 0===t?void 0:t.poleTailHeight)&&void 0!==i?i:0;return e.inverseAnchorPosition?w(e)-n*e.direction:w(e)+n*e.direction}(this._data)*r))),e.stroke(),void 0!==this._data.plate&&function(e,t,i,n,r){const s=r.pixelRatio,{circleRadius:o,poleTailHeight:a,circleBorderColor:l,circleBackgroundColor:d}=i;e.strokeStyle=l,e.fillStyle=d;const h=(0,f.fillScaledRadius)(o,s),c=Math.round(t.x*s),u=t.inverseAnchorPosition?Math.round(t.anchorY*s)+Math.round(o*s)*t.direction:Math.round(t.anchorY*s)+Math.round((t.labelHeight+a+o)*s)*t.direction,p=Math.max(1,Math.floor(s))%2/2,_=c+p,g=u+p;if(e.shadowOffsetY=1,e.shadowColor=i.shadowColor,e.shadowBlur=4,e.beginPath(),e.arc(_,g,h,0,2*Math.PI,!0),e.closePath(),e.fill(),e.shadowColor="transparent",t.svgRenderer){const i=2*(0,f.fillScaledRadius)(n,s);t.svgRenderer.render(e,{targetViewBox:{x:_-i/2,y:g-i/2,width:i,height:i}})}const v=Math.round(i.circleBorderWidth*s),x=(0,f.strokeScaledRadius)(o,s,v);if(e.lineWidth=v,e.beginPath(),e.arc(_,g,x,0,2*Math.PI,!0),e.closePath(),e.stroke(),i.outsideBorderWidth){e.save();const t=Math.round(i.outsideBorderWidth*s),n=x+v/2+t/2;e.lineWidth=t,e.strokeStyle=i.outsideBorderColor,e.beginPath(),e.arc(_,g,n,0,2*Math.PI,!0),e.closePath(),e.stroke(),e.restore()}}(e,this._data,this._data.plate,n,t),this._data.labelRenderer.draw(e,t),e.restore()}}var y=i(68616),T=i(69798);const b={circleBorderColor:(0,r.getHexColorByName)("color-cold-gray-900"),labelBackgroundColor:(0,r.getHexColorByName)("color-cold-gray-900"),labelBorderColor:(0,r.getHexColorByName)("color-cold-gray-800"),labelTextColor:(0,r.getHexColorByName)("color-cold-gray-200"),poleColor:(0,r.getHexColorByName)("color-cold-gray-500"),shadowColor:"rgba(0,0,0,0.4)",selectionColor:(0,r.getHexColorByName)("color-tv-blue-500")},P={circleBorderColor:(0,r.getHexColorByName)("color-white"),labelBackgroundColor:(0,r.getHexColorByName)("color-white"),labelBorderColor:(0,r.getHexColorByName)("color-cold-gray-150"),labelTextColor:(0,r.getHexColorByName)("color-cold-gray-900"),poleColor:(0,r.getHexColorByName)("color-cold-gray-500"),shadowColor:"rgba(0,0,0,0.2)",selectionColor:(0,r.getHexColorByName)("color-tv-blue-500")};class L extends l.LineSourcePaneView{constructor(e,t){super(e,t),this._renderer=new s.CompositeRenderer,this._emojiCache=null,this._destroyed=!1,this._signpostRenderer=new R(a.HitTarget.MovePoint,e.isPhantom()),e.properties().childs().emoji.subscribe(this,this._updateEmoji),this._updateEmoji()}destroy(){this._source.properties().childs().emoji.unsubscribeAll(this),this._destroyed=!0}renderer(e,t){return this._invalidated&&this._updateImpl(e,t),this._renderer}_updateImpl(e,t){if(super._updateImpl(),this._renderer.clear(),!this._updateTimelineRenderer(e))return;if(this._renderer.append(this._signpostRenderer),this._source.isPhantom())return;const i=this._itemAnchorY();if(null===i)return
|
||||
;const r=this._points[0],s=new n.Point(r.x,i);s.data=r.data,s.square=!0,this._renderer.append(this.createLineAnchor({points:[s],pointsCursorType:[o.PaneCursorType.VerticalResize]},0))}_itemAnchorY(){return this._signpostRenderer.itemAnchorY()}_updateTimelineRenderer(e){var t;const i=this._source.ownerSource();if(null===i)return!1;const n=this._model.timeScale(),r=i.priceScale(),s=i.firstValue();if(n.isEmpty()||null===r||r.isEmpty()||null===s)return!1;const o=this._model.dark().value()?b:P,a=this._model.mainSeries(),l=this._source.properties().childs(),c=l.position.value(),u=this._source.customEvent(),p=i===a?(0,d.getSeriesPosition)(a,u):(0,d.getNoDataPosition)(u,r,s);if(null===p)return!1;const _=n.indexToCoordinate(p.index),g=r.priceToCoordinate(p.price,s),f=l.showImage.value();let v=(0,d.positionToCoordinate)(c,e,g,p.positionPointDirection);v>=-1e-10&&v<=e+1e-10&&(v=Math.min(e-2,Math.max(2,v)));const x=p.visualDirection!==p.positionPointDirection,m=p.visualDirection,w={emojiRadius:16,poleColor:o.poleColor,svgRenderer:null===(t=this._emojiCache)||void 0===t?void 0:t.emojiSvgRenderer,itemIndex:1,label:{labelIndex:1,labelDirection:p.positionPointDirection,labelFont:h.CHART_FONT_FAMILY,labelFontSize:l.fontSize.value(),labelFontBold:l.bold.value(),labelFontItalic:l.italic.value(),labelBorderRadius:4,labelPadding:3,labelBoxPaddingVert:6,labelBoxPaddingHorz:8,labelWordWrapWidth:134,labelColor:o.labelTextColor,labelBorderColor:o.labelBorderColor,labelBackgroundColor:o.labelBackgroundColor,text:l.text.value()},x:_,anchorY:v,poleStartY:p.poleStartY,direction:m*(x?-1:1),inverseAnchorPosition:x};return f&&(w.plate={circleBackgroundColor:l.backgroundsColors.value(),outsideBorderWidth:0,circleBorderColor:o.circleBorderColor,circleBorderWidth:1,poleTailHeight:l.text.value()?10:0,circleRadius:35,shadowColor:o.shadowColor,outsideBorderColor:o.selectionColor}),this._signpostRenderer.setData(w),!0}async _updateEmoji(){var e;const t=this._source.properties().childs().emoji.value();if(null!==this._emojiCache&&this._emojiCache.emoji===t)return;null!==this._emojiCache&&(null===(e=this._emojiCache.abortController)||void 0===e||e.abort(),this._emojiCache.abortController=void 0);const n=(0,y.getTwemojiUrl)(t,"svg"),r=new AbortController,s=(0,T.fetch)(n,{signal:r.signal}).then((e=>e.text())),o={emoji:t,abortController:r};this._emojiCache=o;const[a,{svgRenderer:l}]=await Promise.all([s,i.e(2616).then(i.bind(i,50765))]);!this._destroyed&&o.abortController&&(o.emojiSvgRenderer=l(a),this._model.updateSource(this._source))}}},5362:(e,t,i)=>{"use strict";i.r(t),i.d(t,{SineLinePaneView:()=>h});var n=i(86441),r=i(79191),s=i(19266),o=i(15187),a=i(18807),l=i(68441);class d extends o.MediaCoordinatesPaneRenderer{constructor(e){super(),this._data=e}hitTest(e,t){const i=(e.x-this._data.point.x)*Math.PI/this._data.width;let n=Math.sin(i-Math.PI/2)*this._data.height/2;return n=this._data.point.y+n+this._data.height/2,Math.abs(n-e.y)<=3?new a.HitTestResult(a.HitTarget.MovePoint):null}_drawImpl(e){const t=e.context;t.strokeStyle=this._data.color,
|
||||
t.lineWidth=this._data.lineWidth,(0,l.setLineStyle)(t,this._data.lineStyle),t.beginPath(),t.moveTo(this._data.point.x,this._data.point.y);const i=Math.max(1,this._data.width/30),n=e.mediaSize.width-this._data.point.x+i;for(let e=1;e<=n;e+=i){const i=e*Math.PI/this._data.width,n=Math.sin(i-Math.PI/2)*this._data.height/2;t.lineTo(this._data.point.x+e,this._data.point.y+n+this._data.height/2)}t.stroke()}}class h extends r.LineSourcePaneView{constructor(e,t){super(e,t),this._renderer=new s.CompositeRenderer}renderer(e,t){return this._invalidated&&this._updateImpl(e,t),this._renderer}_updateImpl(e,t){if(super._updateImpl(),this._renderer.clear(),this._points.length<2)return;const[i,r]=this._source.points();if(0===2*Math.abs(i.index-r.index))return void this.addAnchors(this._renderer);const[s,o]=this._points,a=Math.abs(s.x-o.x),l=o.y-s.y,h=this._source.properties().childs(),c=h.linewidth.value();if(s.y<-c&&o.y<-c||s.y>e+c&&o.y>e+c)return;const u=2*a,p=s.x>0?s.x-Math.ceil(s.x/u)*u:s.x+Math.floor(-s.x/u)*u,_={point:new n.Point(p,s.y),width:a,height:l,color:h.linecolor.value(),lineWidth:h.linewidth.value(),lineStyle:h.linestyle.value()};this._renderer.append(new d(_)),this.addAnchors(this._renderer)}}},15378:(e,t,i)=>{"use strict";i.r(t),i.d(t,{StickerPaneView:()=>r});var n=i(50761);class r extends n.SvgIconPaneView{_iconColor(){return null}}},44666:(e,t,i)=>{"use strict";i.r(t),i.d(t,{StudyLineDataSourceAnchorsPaneView:()=>r});var n=i(79191);class r extends n.LineSourcePaneView{renderer(){return this._invalidated&&(this._updateImpl(),this._invalidated=!1),this.createLineAnchor({points:this._getPoints()},0)}}},50761:(e,t,i)=>{"use strict";i.d(t,{SvgIconPaneView:()=>g});var n=i(86441),r=i(25422),s=i(50151),o=i(87095),a=i(19266),l=i(66103),d=i(79191),h=i(48891),c=i(15187),u=i(18807);const p=(0,h.getHexColorByName)("color-tv-blue-600");class _ extends c.MediaCoordinatesPaneRenderer{constructor(){super(...arguments),this._data=null}setData(e){this._data=e}hitTest(e,t){if(null===this._data)return null;const{size:i,angle:n,point:s}=this._data,o=(0,r.rotationMatrix)(-n),a=(0,r.transformPoint)(o,e.subtract(s));return Math.abs(a.y)<=i/2&&Math.abs(a.x)<=i/2?new u.HitTestResult(u.HitTarget.MovePoint):null}isOutOfScreen(e,t){if(null===this._data)return!0;const{size:i,point:n,angle:r}=this._data;let s;return s=r%(Math.PI/2)==0?i/2:Math.sqrt(i**2*2)/2,n.x+s<0||n.x-s>t||n.y+s<0||n.y-s>e}_drawImpl(e){if(null===this._data)return;const{size:t,svg:i,point:n,angle:r,color:s,background:o,selected:a}=this._data,l=e.context;l.translate(n.x,n.y);const d=r-Math.PI/2;l.rotate(d);const h=t/2;a&&(l.fillStyle=o,l.strokeStyle=p,l.beginPath(),l.rect(-h,-h,t,t),l.closePath(),l.fill(),l.stroke()),i&&(l.translate(-h,-h),null!==s&&(l.fillStyle=s),i.render(l,{targetViewBox:{x:0,y:0,width:t,height:t},doNotApplyColors:null!==s}))}}class g extends d.LineSourcePaneView{constructor(e,t,i){super(e,t),this._iconRenderer=new _,this._renderer=new a.CompositeRenderer,this._svg=i}renderer(e,t){return this._invalidated&&this._updateImpl(e,t),this._renderer}
|
||||
_updateImpl(e,t){if(super._updateImpl(),this._renderer.clear(),this._points.length<1)return;const i=this._source.properties().childs(),s=i.size.value(),o={point:this._points[0],color:this._iconColor(),size:s,svg:this._svg,angle:i.angle.value(),selected:this.areAnchorsVisible(),background:this._calculateBackgroundColor()};this._iconRenderer.setData(o),this._iconRenderer.isOutOfScreen(e,t)||this._renderer.append(this._iconRenderer);const a=this._points[0],h=this._source.getAnchorLimit();let c=new n.Point(Math.max(h,s)/2,0),u=new n.Point(0,Math.max(h,s)/2);const p=(0,r.rotationMatrix)(i.angle.value());c=(0,r.transformPoint)(p,c),u=(0,r.transformPoint)(p,u);const _=a.add(c);_.data=0,_.nonDiscreteIndex=!0;const g=a.subtract(c);g.data=1,g.nonDiscreteIndex=!0;const f=a.add(u);f.data=2,f.square=!0,f.nonDiscreteIndex=!0;const v=a.subtract(u);v.data=3,v.square=!0,v.nonDiscreteIndex=!0;const x=(0,d.thirdPointCursorType)(_,g),m=[l.PaneCursorType.Default,l.PaneCursorType.Default,x,x];this._renderer.append(this.createLineAnchor({points:[_,g,f,v],pointsCursorType:m},0))}_calculateBackgroundColor(){return(0,o.generateColor)(this._model.backgroundColorAtYPercentFromTop(this._points[0].y/(0,s.ensureNotNull)(this._model.paneForSource(this._source)).height()),60,!0)}}},62912:(e,t,i)=>{"use strict";i.r(t),i.d(t,{TextPaneView:()=>_});var n=i(50151),r=i(86441),s=i(46501),o=i(66103),a=i(80657),l=i(19266),d=i(80101),h=i(78211),c=i(18807),u=i(79191);const p=[o.PaneCursorType.HorizontalResize];class _ extends u.LineSourcePaneView{constructor(e,t,i,n,r,s,o,l){super(e,t),this._textRenderer=new a.TextRenderer,this._noSelection=!1,this._renderer=null,this._offsetX=i,this._offsetY=n,this._vertAlign=r,this._horzAlign=s,this._forceTextAlign=Boolean(o),this._noSelection=!1,this._renderer=null,this._recalculateSourcePointsOnFirstUpdate=l}renderer(e,t){return this._invalidated&&this._updateImpl(e,t),this._renderer}disableSelection(){this._noSelection=!0}isEditMode(){return!this._getModel().readOnly()}_updateImpl(e,t){super._updateImpl(e,t),this._renderer=null;const i=this._getSource(),o=i.priceScale();if(!o||o.isEmpty())return;const a=i.properties().childs(),u=this._getModel(),_={text:a.text.value(),color:a.color.value(),fontSize:a.fontsize.value(),boxPadding:a.fontsize.value()/6,font:s.CHART_FONT_FAMILY,vertAlign:this._vertAlign||"top",horzAlign:this._horzAlign||"left",offsetX:this._offsetX||0,offsetY:this._offsetY||0,forceTextAlign:this._forceTextAlign};if(_.points=i.isFixed()?[(0,n.ensureDefined)(i.fixedPoint())]:this._points,a.fillBackground&&a.fillBackground.value()&&(_.backgroundColor=a.backgroundColor.value()),a.drawBorder&&a.drawBorder.value()&&(_.borderColor=a.borderColor.value()),a.wordWrap&&a.wordWrap.value()&&(_.wordWrapWidth=a.wordWrapWidth.value()),_.bold=a.bold&&a.bold.value(),_.italic=a.italic&&a.italic.value(),_.highlightBorder=u.selection().isSelected(i),!i.isFixed()&&a.fixedSize&&!a.fixedSize.value()){_.scaleX=u.timeScale().barSpacing()/i.barSpacing();const e=(0,n.ensureNotNull)(o.priceRange());let t=o.height()/e.length()
|
||||
;const r=o.logFormula();i.isPriceDencityLog()&&!o.isLog()&&(t=o.height()/((0,h.toLog)(e.maxValue(),r)-(0,h.toLog)(e.minValue(),r))),!i.isPriceDencityLog()&&o.isLog()&&(t=o.height()/((0,h.fromLog)(e.maxValue(),r)-(0,h.fromLog)(e.minValue(),r)));const s=i.priceDencity();void 0!==s&&(_.scaleY=t/s),(void 0===s||void 0===_.scaleY||_.scaleY<=0)&&delete _.scaleY}if(this._textRenderer.setData(_),this._textRenderer.isOutOfScreen(t,e))return;const g=1===_.points.length;if(g&&void 0!==this._recalculateSourcePointsOnFirstUpdate){this._renderer=null;const e=this._textRenderer.measure();return this._recalculateSourcePointsOnFirstUpdate(e.width,e.height),void(this._recalculateSourcePointsOnFirstUpdate=void 0)}if(g&&!this._noSelection){const e=new l.CompositeRenderer;e.append(this._textRenderer);const t=_.points[0].clone(),i=this._textRenderer.measure(),n=i.width,s=i.height;if(_.wordWrapWidth){const i=new r.Point(t.x+n,t.y+s/2);i.data=1,e.append(this.createLineAnchor({points:[i],pointsCursorType:p},1))}const o=new r.Point(t.x+n/2,t.y+s);return o.data=0,e.append(new d.SelectionRenderer({points:[o],bgColors:this._lineAnchorColors([o]),visible:this.areAnchorsVisible(),hittestResult:c.HitTarget.MovePoint,barSpacing:u.timeScale().barSpacing()})),void(this._renderer=e)}this._renderer=this._textRenderer}}},90042:(e,t,i)=>{"use strict";i.r(t),i.d(t,{LineToolThreeDrivesPaneView:()=>u});var n=i(79849),r=i(19266),s=i(80657),o=i(87663),a=i(99031),l=i(73436),d=i(79797),h=i(79191),c=i(46501);class u extends h.LineSourcePaneView{constructor(){super(...arguments),this._numericFormatter=new o.NumericFormatter,this._retrace1LabelRenderer=new s.TextRenderer,this._retrace12LabelRenderer=new s.TextRenderer,this._polyLineRenderer=new d.PolygonRenderer,this._renderer=null}renderer(e,t){return this._invalidated&&this._updateImpl(),this._renderer}_updateImpl(){super._updateImpl(),this._renderer=null;let e=NaN,t=NaN;if(this._source.points().length>=4){const[,t,i,n]=this._source.points();e=Math.round(100*Math.abs((n.price-i.price)/(i.price-t.price)))/100}if(this._source.points().length>=6){const[,,,e,i,n]=this._source.points();t=Math.round(100*Math.abs((n.price-i.price)/(i.price-e.price)))/100}if(this._points.length<2)return;const i=this._source.properties().childs(),s=new r.CompositeRenderer,o=(e,t)=>({points:[e],text:t,color:i.textcolor.value(),vertAlign:"middle",horzAlign:"center",font:c.CHART_FONT_FAMILY,offsetX:0,offsetY:0,bold:i.bold&&i.bold.value(),italic:i.italic&&i.italic.value(),fontsize:i.fontsize.value(),backgroundColor:i.color.value(),backgroundRoundRect:4}),d=(e,t)=>({points:[e,t],color:i.color.value(),linewidth:i.linewidth.value(),linestyle:n.LINESTYLE_DOTTED,extendleft:!1,extendright:!1,leftend:l.LineEnd.Normal,rightend:l.LineEnd.Normal}),h={points:this._points,color:i.color.value(),linewidth:i.linewidth.value(),linestyle:n.LINESTYLE_SOLID,leftend:l.LineEnd.Normal,rightend:l.LineEnd.Normal,backcolor:"rgba(0, 0, 0, 0)",fillBackground:!1,filled:!1};if(this._polyLineRenderer.setData(h),s.append(this._polyLineRenderer),!isNaN(e)){
|
||||
const t=new a.TrendLineRenderer;t.setData(d(this._points[1],this._points[3])),s.append(t);const i=o(this._points[1].add(this._points[3]).scaled(.5),this._numericFormatter.format(e));this._retrace1LabelRenderer.setData(i),s.append(this._retrace1LabelRenderer)}if(!isNaN(t)){const e=new a.TrendLineRenderer;e.setData(d(this._points[3],this._points[5])),s.append(e);const i=o(this._points[5].add(this._points[3]).scaled(.5),this._numericFormatter.format(t));this._retrace12LabelRenderer.setData(i),s.append(this._retrace12LabelRenderer)}this.addAnchors(s),this._renderer=s}}},65557:(e,t,i)=>{"use strict";i.r(t),i.d(t,{TimeCyclesPaneView:()=>c});var n=i(86441),r=i(19266),s=i(79191),o=i(87095),a=i(18807),l=i(68441),d=i(15187);class h extends d.MediaCoordinatesPaneRenderer{constructor(){super(...arguments),this._data=null}setData(e){this._data=e}hitTest(e){if(null===this._data||e.y>this._data.point.y)return null;if(e.x<this._data.point.x||e.x>this._data.point.x+this._data.width)return null;const t=new n.Point(this._data.point.x+this._data.width/2,this._data.point.y);let i=e.subtract(t);const r=this._data.height/this._data.width;i=new n.Point(i.x,i.y/r);const s=i.length();return Math.abs(s-this._data.width/2)<3?new a.HitTestResult(a.HitTarget.MovePoint):null}_drawImpl(e){if(null===this._data)return;const t=e.context;t.strokeStyle=this._data.color,t.lineWidth=this._data.linewidth,(0,l.setLineStyle)(t,this._data.linestyle),t.save(),t.translate(this._data.point.x+1,this._data.point.y),t.scale(this._data.width,this._data.height),t.beginPath(),t.arc(.5,0,.5,Math.PI,0,!1),t.restore(),t.stroke(),this._data.fillBackground&&(t.fillStyle=(0,o.generateColor)(this._data.backcolor,this._data.transparency),t.fill())}}class c extends s.LineSourcePaneView{constructor(){super(...arguments),this._renderer=null}renderer(e,t){return this._invalidated&&this._updateImpl(),this._renderer}_updateImpl(){if(super._updateImpl(),this._renderer=null,this._points.length<2)return;const e=this._source.points(),t=e[0],i=e[1],s=Math.min(t.index,i.index),o=Math.max(t.index,i.index),a=o-s,l=this._points[0],d=this._points[1],c=Math.abs(l.x-d.x),u=new r.CompositeRenderer,p=this._source.properties().childs(),_=this._model.timeScale();if(0===a)return;let g=Math.min(l.x,d.x);const f=[];for(let e=s;g>-c;e-=a)g=_.indexToCoordinate(e),f.push(g);g=Math.max(l.x,d.x);for(let e=o;g<_.width();e+=a)g=_.indexToCoordinate(e),f.push(g);for(let e=0;e<f.length;e++){const t={point:new n.Point(f[e],l.y),width:c,height:c,color:p.linecolor.value(),linewidth:p.linewidth.value(),linestyle:p.linestyle.value(),fillBackground:p.fillBackground.value(),backcolor:p.backgroundColor.value(),transparency:p.transparency.value()},i=new h;i.setData(t),u.append(i)}this.addAnchors(u),this._renderer=u}}},67998:(e,t,i)=>{"use strict";i.r(t),i.d(t,{TrendAnglePaneView:()=>m});var n=i(50151),r=i(86441),s=i(5531),o=i(34026),a=i(38223),l=i(18807),d=i(73436),h=i(9155),c=i(80657),u=i(99031),p=i(80101),_=i(46501),g=i(21477),f=i(15187);class v extends f.MediaCoordinatesPaneRenderer{constructor(){
|
||||
super(...arguments),this._data=null}setData(e){this._data=e}hitTest(e){return null}_drawImpl(e){if(null===this._data)return;const t=e.context;t.translate(this._data.point.x,this._data.point.y),t.strokeStyle=this._data.color,t.setLineDash([1,2]);const i=this._data.size;t.beginPath(),t.moveTo(0,0),t.lineTo(i,0),t.arc(0,0,i,0,-this._data.angle,this._data.angle>0),t.stroke()}}var x=i(48063);class m extends x.TrendToolWithStatsPaneView{constructor(e,t){super(e,t),this._secondPoint=null,this._trendRenderer=new u.TrendLineRenderer,this._angleRenderer=new v,this._angleLabelRenderer=new c.TextRenderer}_getPointsForStats(){return[this._points[0],(0,n.ensureNotNull)(this._middlePoint),(0,n.ensureNotNull)(this._secondPoint)]}_updateImpl(e,t){var i;this._renderer.clear(),super._updateImpl();const n=this._source,c=n.angle();if(this._points.length>0&&null!==c){const e=Math.cos(c),t=-Math.sin(c),i=new r.Point(e,t);this._secondPoint=this._points[0].addScaled(i,n.distance()),this._middlePoint=this._source.calcMiddlePoint(this._points[0],this._secondPoint)}this._invalidated=!1;const u=this._source.priceScale(),f=this._model.timeScale();if(!u||u.isEmpty()||f.isEmpty())return;if(null===this._model.timeScale().visibleBarsStrictRange())return;if(this._source.points().length<2)return;if(this._points.length<2||null===this._secondPoint)return;const v=this._points[0],x=this._points[1],m=this._source.properties().childs();m.showBarsRange.value()||m.showPriceRange.value()||m.showPercentPriceRange.value()||m.showPipsPriceRange.value()||(this._label=null,this._labelData&&(this._labelData.text=""));const w=m.linecolor.value(),R={points:[v,this._secondPoint],color:w,linewidth:m.linewidth.value(),linestyle:m.linestyle.value(),extendleft:m.extendLeft.value(),extendright:m.extendRight.value(),leftend:d.LineEnd.Normal,rightend:d.LineEnd.Normal};this._trendRenderer.setData(R),this._renderer.append(this._trendRenderer);const y=(0,r.box)(new r.Point(0,0),new r.Point(t,e));let T=!1;m.statsPosition.value()===h.StatsPosition.Auto&&(T=(0,r.equalPoints)(v,x)?!(0,o.pointInBox)(v,y):null===(0,s.intersectLineSegmentAndBox)((0,r.lineSegment)(v,x),y));if((this.isHoveredSource()||this.isSelectedSource()||m.alwaysShowStats.value())&&!T&&2===this._points.length){const e=new g.PaneRendererCachedImage(this,0);this._renderer.append(e)}const b=(this.isHoveredSource()||this.isSelectedSource())&&m.showMiddlePoint.value();this._middlePoint&&this._renderer.append(new p.SelectionRenderer({points:[this._middlePoint],bgColors:this._lineAnchorColors([this._middlePoint]),color:w,visible:b&&this.areAnchorsVisible(),hittestResult:l.HitTarget.Regular,barSpacing:0}));const P={point:v,angle:null!==(i=n.angle())&&void 0!==i?i:0,color:m.linecolor.value(),size:50};this._angleRenderer.setData(P),this._renderer.append(this._angleRenderer);const L=Math.round(180*P.angle/Math.PI)+"º",S={points:[new r.Point(v.x+50,v.y)],text:(0,a.forceLTRStr)(L),color:m.textcolor.value(),horzAlign:"left",font:_.CHART_FONT_FAMILY,offsetX:5,offsetY:0,bold:m.bold.value(),italic:m.italic.value(),
|
||||
fontsize:m.fontsize.value(),vertAlign:"middle"};this._angleLabelRenderer.setData(S),this._renderer.append(this._angleLabelRenderer),R.points.length>=2&&this._addAlertRenderer(this._renderer,R.points);const C=new r.Point(this._secondPoint.x,this._secondPoint.y);C.data=1,this._renderer.append(this.createLineAnchor({points:[v,C]},0))}}},38058:(e,t,i)=>{"use strict";i.r(t),i.d(t,{TrendBasedFibExtensionPaneView:()=>u});var n=i(86441),r=i(72739),s=i(99031),o=i(18807),a=i(19266),l=i(73436),d=i(26702),h=i(80657),c=i(134);class u extends c.LineToolPaneViewFibWithLabels{constructor(e,t){super(e,t),this._trendLineRendererPoints12=new s.TrendLineRenderer,this._trendLineRendererPoints23=new s.TrendLineRenderer,this._rectangleRenderers={},this._hlevelLineRenderers={},this._renderer=new a.CompositeRenderer,this._levels=[]}renderer(e,t){return this._invalidated&&this._updateImpl(t,e),this._renderer}_updateImpl(e,t){var i,a;if(super._updateImpl(),this._renderer.clear(),this._points.length<2)return;const[c,u]=this._points,p=this._source.properties().childs();if(3===this._source.points().length){const e=this._source.priceScale();if(!e||e.isEmpty()||this._model.timeScale().isEmpty())return;const t=null===(i=this._source.ownerSource())||void 0===i?void 0:i.firstValue();if(null==t)return;const[n,r,s]=this._source.points();let o=!1;p.reverse&&p.reverse.value()&&(o=p.reverse.value()),this._levels=[];const a=o?n.price:r.price,l=o?r.price:n.price,h=a-l;let c,u,_;const g=e.isLog()&&p.fibLevelsBasedOnLogScale.value();if(g){c=e.priceToCoordinate(a,t);u=c-e.priceToCoordinate(l,t),_=e.priceToCoordinate(s.price,t)}const f={price:s.price,coordinate:_},v={price:h,coordinate:u},x=this._source.levelsCount();for(let i=1;i<=x;i++){const n=p["level"+i].childs();if(!n.visible.value())continue;const r=n.coeff.value(),s=n.color.value(),o=(0,d.fibLevelCoordinate)(f,v,r,e,t,g),a=(0,d.fibLevelPrice)(f,v,r,e,t,g);this._levels.push({color:s,price:a,y:o,linewidth:p.levelsStyle.childs().linewidth.value(),linestyle:p.levelsStyle.childs().linestyle.value(),index:i})}}const _=p.trendline.childs();if(_.visible.value()){const e={points:[c,u],color:_.color.value(),linewidth:_.linewidth.value(),linestyle:_.linestyle.value(),extendleft:!1,extendright:!1,leftend:l.LineEnd.Normal,rightend:l.LineEnd.Normal};this._trendLineRendererPoints12.setData(e),this._renderer.append(this._trendLineRendererPoints12)}if(this._points.length<3)return void this.addAnchors(this._renderer);const g=this._points[2];if(_.visible.value()){const e={points:[u,g],color:_.color.value(),linewidth:_.linewidth.value(),linestyle:_.linestyle.value(),extendleft:!1,extendright:!1,leftend:l.LineEnd.Normal,rightend:l.LineEnd.Normal};this._trendLineRendererPoints23.setData(e),this._renderer.append(this._trendLineRendererPoints23)}const f=Math.min(g.x,u.x),v=Math.max(g.x,u.x),x=p.fillBackground.value(),m=p.transparency.value(),w=p.extendLinesLeft.value(),R=p.extendLines.value();if(x)for(let e=0;e<this._levels.length;e++)if(e>0&&x){const t=this._levels[e-1],i={
|
||||
points:[new n.Point(f,this._levels[e].y),new n.Point(v,t.y)],color:this._levels[e].color,linewidth:0,backcolor:this._levels[e].color,fillBackground:!0,transparency:m,extendLeft:w,extendRight:R};this._rectangleRenderers.hasOwnProperty(e)||(this._rectangleRenderers[e]=new r.RectangleRenderer(void 0,void 0,!0));const s=this._rectangleRenderers[e];s.setData(i),this._renderer.append(s)}let y=f,T=v;y===T&&(w&&(y-=1),R&&(T+=1));for(let i=0;i<this._levels.length;i++){const r=new n.Point(y,this._levels[i].y),d=new n.Point(T,this._levels[i].y);let c;const u=this._updateLabelForLevel({i,levelIndex:this._levels[i].index,leftPoint:r,rightPoint:d,price:this._levels[i].price,color:this._levels[i].color,extendLeft:w,extendRight:R,horzAlign:p.horzLabelsAlign.value(),vertAlign:p.vertLabelsAlign.value()});null!==u&&(this._renderer.append(u),"middle"===p.vertLabelsAlign.value()&&(c=null!==(a=(0,h.getTextBoundaries)(u,e,t))&&void 0!==a?a:void 0));const _={points:[r,d],color:this._levels[i].color,linewidth:this._levels[i].linewidth,linestyle:this._levels[i].linestyle,extendleft:w,extendright:R,leftend:l.LineEnd.Normal,rightend:l.LineEnd.Normal,excludeBoundaries:c};this._hlevelLineRenderers.hasOwnProperty(i)||(this._hlevelLineRenderers[i]=new s.TrendLineRenderer);const g=this._hlevelLineRenderers[i];g.setData(_),g.setHitTest(new o.HitTestResult(o.HitTarget.MovePoint,{snappingPrice:this._levels[i].price},this._levels[i].index)),this._renderer.append(g)}this.addAnchors(this._renderer)}}},33482:(e,t,i)=>{"use strict";i.r(t),i.d(t,{TrendBasedFibTimePaneView:()=>p});var n=i(86441),r=i(71254),s=i(80657),o=i(72739),a=i(99031),l=i(18807),d=i(19266),h=i(73436),c=i(46501),u=i(79191);class p extends u.LineSourcePaneView{constructor(e,t){super(e,t),this._trendLineRendererPoints12=new a.TrendLineRenderer,this._trendLineRendererPoints23=new a.TrendLineRenderer,this._renderer=new d.CompositeRenderer,this._levels=[]}renderer(e,t){return this._invalidated&&this._updateImpl(e,t),this._renderer}_updateImpl(e,t){var i;super._updateImpl(),this._renderer.clear();const a=this._source.properties().childs();if(3===this._source.points().length){const e=this._model.timeScale();if(e.isEmpty())return;const[t,i,n]=this._source.points();if(this._levels=[],i.index===t.index)return;const r=i.index-t.index,s=n.index;if(null===e.visibleBarsStrictRange())return;for(let t=1;t<=11;t++){const i=a["level"+t].childs();if(!i.visible.value())continue;const n=i.coeff.value(),o=i.color.value(),l=Math.round(s+n*r),d={x:e.indexToCoordinate(l),coeff:n,color:o,linewidth:i.linewidth.value(),linestyle:i.linestyle.value(),index:t,text:String(n)};this._levels.push(d)}}if(this._points.length<2)return;const u=new d.CompositeRenderer,[p,_]=this._points,g=a.trendline.childs();if(g.visible.value()){const e={points:[p,_],color:g.color.value(),linewidth:g.linewidth.value(),linestyle:g.linestyle.value(),extendleft:!1,extendright:!1,leftend:h.LineEnd.Normal,rightend:h.LineEnd.Normal};this._trendLineRendererPoints12.setData(e),u.append(this._trendLineRendererPoints12)}
|
||||
if(this._points.length<3)return this.addAnchors(u),void(this._renderer=u);const f=this._points[2];if(g.visible.value()){const e={points:[_,f],color:g.color.value(),linewidth:g.linewidth.value(),linestyle:g.linestyle.value(),extendleft:!1,extendright:!1,leftend:h.LineEnd.Normal,rightend:h.LineEnd.Normal};this._trendLineRendererPoints23.setData(e),u.append(this._trendLineRendererPoints23)}if(a.fillBackground.value()){const t=a.transparency.value();for(let i=1;i<this._levels.length;i++){const r=this._levels[i-1],s={points:[new n.Point(r.x,0),new n.Point(this._levels[i].x,e)],color:this._levels[i].color,linewidth:0,backcolor:this._levels[i].color,fillBackground:!0,transparency:t,extendLeft:!1,extendRight:!1},a=new o.RectangleRenderer(void 0,void 0,!0);a.setData(s),u.append(a)}}let v=a.horzLabelsAlign.value();v="left"===v?"right":"right"===v?"left":"center";const x=a.vertLabelsAlign.value(),m=a.showCoeffs.value();for(let o=0;o<this._levels.length;o++){let a;if(m){let r;switch(x){case"top":r=new n.Point(this._levels[o].x,0);break;case"middle":r=new n.Point(this._levels[o].x,.5*e);break;default:r=new n.Point(this._levels[o].x,e)}const l={points:[r],text:this._levels[o].text,color:this._levels[o].color,vertAlign:x,horzAlign:v,font:c.CHART_FONT_FAMILY,offsetX:2,offsetY:0,fontsize:12},d=new s.TextRenderer(l);this._needLabelExclusionPath(d)&&(a=null!==(i=(0,s.getTextBoundaries)(d,t,e))&&void 0!==i?i:void 0),u.append(d)}const d={x:this._levels[o].x,color:this._levels[o].color,linewidth:this._levels[o].linewidth,linestyle:this._levels[o].linestyle,excludeBoundaries:a},h=new l.HitTestResult(l.HitTarget.MovePoint,void 0,this._levels[o].index),p=new r.VerticalLineRenderer;p.setData(d),p.setHitTest(h),u.append(p)}this.addAnchors(u),this._renderer=u}_needLabelExclusionPath(e){return"center"===this._source.properties().childs().horzLabelsAlign.value()}}},96310:(e,t,i)=>{"use strict";i.r(t),i.d(t,{TrendLinePaneView:()=>g});var n=i(50151),r=i(86441),s=i(34026),o=i(5531),a=i(21477),l=i(80657),d=i(9155),h=i(80101),c=i(99031),u=i(46501),p=i(18807),_=i(48063);class g extends _.TrendToolWithStatsPaneView{constructor(){super(...arguments),this._trendRenderer=new c.TrendLineRenderer,this._labelRenderer=new l.TextRenderer}_getPointsForStats(){return[this._points[0],(0,n.ensureNotNull)(this._middlePoint),this._points[1]]}_updateImpl(e,t){var i;this._renderer.clear(),this._invalidated=!1;const n=this._source.priceScale(),c=this._model.timeScale();if(!n||n.isEmpty()||c.isEmpty())return;const _=this._model.timeScale().visibleBarsStrictRange();if(null===_)return;const g=this._source.points();if(g.length<2)return;const f=g[0],v=g[1],x=this._source.properties().childs();if(f.index<_.firstBar()&&v.index<_.firstBar()&&!x.extendLeft.value()&&!x.extendRight.value())return;if(super._updateImpl(),this._points.length<2)return;x.showPriceRange.value()||x.showPercentPriceRange.value()||x.showPipsPriceRange.value()||x.showBarsRange.value()||x.showDateTimeRange.value()||x.showDistance.value()||x.showAngle.value()||(this._label=null,
|
||||
this._labelData&&(this._labelData.text=""));const m=this._points[0],w=this._points[1];let R;if(x.showLabel&&x.showLabel.value()&&x.text.value().length>0){const n=m.x<w.x?m:w,s=n===m?w:m,o=x.vertLabelsAlign.value(),a=x.horzLabelsAlign.value();let d;d="left"===a?n.clone():"right"===a?s.clone():new r.Point((m.x+w.x)/2,(m.y+w.y)/2);const h=Math.atan((s.y-n.y)/(s.x-n.x)),c={points:[d],text:x.text.value(),color:x.textcolor.value(),vertAlign:o,horzAlign:a,font:u.CHART_FONT_FAMILY,offsetX:0,offsetY:0,bold:x.bold.value(),italic:x.italic.value(),fontsize:x.fontsize.value(),forceTextAlign:!0,angle:h};this._labelRenderer.setData(c),this._renderer.append(this._labelRenderer),this._needLabelExclusionPath(this._labelRenderer)&&(R=null!==(i=(0,l.getTextBoundaries)(this._labelRenderer,t,e))&&void 0!==i?i:void 0)}const y=x.linecolor.value(),T={points:this._points,color:y,linewidth:x.linewidth.value(),linestyle:x.linestyle.value(),extendleft:x.extendLeft.value(),extendright:x.extendRight.value(),leftend:x.leftEnd.value(),rightend:x.rightEnd.value(),excludeBoundaries:R};this._trendRenderer.setData(T),this._renderer.append(this._trendRenderer);const b=(0,r.box)(new r.Point(0,0),new r.Point(t,e));let P=!1;x.statsPosition.value()===d.StatsPosition.Auto&&(P=(0,r.equalPoints)(m,w)?!(0,s.pointInBox)(m,b):null===(0,o.intersectLineSegmentAndBox)((0,r.lineSegment)(m,w),b));if(((this.isHoveredSource()||this.isSelectedSource())&&this.isEditMode()||x.alwaysShowStats.value())&&!P&&2===this._points.length){const e=new a.PaneRendererCachedImage(this,0);this._renderer.append(e)}const L=(this.isHoveredSource()||this.isSelectedSource())&&x.showMiddlePoint.value();this._middlePoint&&this._renderer.append(new h.SelectionRenderer({points:[this._middlePoint],bgColors:this._lineAnchorColors([this._middlePoint]),color:y,visible:L&&this.areAnchorsVisible(),hittestResult:p.HitTarget.Regular,barSpacing:0})),this.addAnchors(this._renderer),T.points.length>=2&&this._addAlertRenderer(this._renderer,T.points)}}},48063:(e,t,i)=>{"use strict";i.d(t,{TrendToolWithStatsPaneView:()=>V});var n=i(50151),r=i(86441),s=i(5531),o=i(44352),a=i(38223),l=i(19266),d=i(93572),h=i(87663),c=i(2043),u=i(57322),p=i(57352),_=i(27714),g=i(34026),f=i(49483),v=i(80657),x=i(18807),m=i(68441),w=i(1722),R=i(74359),y=i(57898);class T{constructor(e,t,i){this._ready=!1,this._img=function(e,t,i){const n=new Image;return n.width=t,n.height=t,n.onload=i,n.src=e,n}(e,t,(()=>{this._ready=!0,i()}))}ready(){return this._ready}image(){return this._img}}let b=null;const P=18,L=new class{constructor(e,t){this._icons=new Map,this._onAllIconsLoaded=new y.Delegate,this._pendingLoading=e.length;const i=()=>{0==--this._pendingLoading&&this._onAllIconsLoaded.fire()};e.forEach((e=>{const n=this._icons.get(e.name)||new Map;n.set(e.theme,new T(e.imageData,t,i)),this._icons.set(e.name,n)}))}getIcon(e,t){return(0,n.ensureDefined)((0,n.ensureDefined)(this._icons.get(e)).get(t))}onAllIconsReady(){return this._onAllIconsLoaded}}([{name:"angle",theme:"dark",
|
||||
imageData:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTgiIGhlaWdodD0iMTgiIHZpZXdCb3g9IjAgMCAxOCAxOCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0zLjQ5OTk5IDE1SDIuNjU3NzFMMy4wNjEwNCAxNC4yNjA2TDkuMDYxMDQgMy4yNjA1N0w5LjMwMDQ2IDIuODIxNjJMMTAuMTc4NCAzLjMwMDQ4TDkuOTM4OTMgMy43Mzk0Mkw3LjUxMzg1IDguMTg1NDJDMTAuNTYyMSA5LjY3MjA1IDEwLjk0NTEgMTIuNjI2MSAxMC45OTMxIDE0SDE0LjVIMTVWMTVIMTQuNUgzLjQ5OTk5Wk05Ljk5MTk3IDE0QzkuOTQyMzYgMTIuNzI1OSA5LjU4NjI5IDEwLjI4OCA3LjAzNDM1IDkuMDY0NDlMNC4zNDIyNiAxNEg5Ljk5MTk3WiIgZmlsbD0iI0Y4RjlGRCIvPgo8L3N2Zz4K"},{name:"angle",theme:"light",imageData:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTgiIGhlaWdodD0iMTgiIHZpZXdCb3g9IjAgMCAxOCAxOCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4NCjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNMy40OTk5OSAxNUgyLjY1NzcxTDMuMDYxMDQgMTQuMjYwNkw5LjA2MTA0IDMuMjYwNTdMOS4zMDA0NiAyLjgyMTYyTDEwLjE3ODQgMy4zMDA0OEw5LjkzODkzIDMuNzM5NDJMNy41MTM4NSA4LjE4NTQyQzEwLjU2MjEgOS42NzIwNSAxMC45NDUxIDEyLjYyNjEgMTAuOTkzMSAxNEgxNC41SDE1VjE1SDE0LjVIMy40OTk5OVpNOS45OTE5NyAxNEM5Ljk0MjM2IDEyLjcyNTkgOS41ODYyOSAxMC4yODggNy4wMzQzNSA5LjA2NDQ5TDQuMzQyMjYgMTRIOS45OTE5N1oiIGZpbGw9IiMyQTJFMzkiLz4NCjwvc3ZnPg0K"},{name:"barsRange",theme:"dark",imageData:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTgiIGhlaWdodD0iMTgiIHZpZXdCb3g9IjAgMCAxOCAxOCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4NCjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNMiAzVjMuNVY1SDFWNlYxM1YxNEgyVjE1LjVWMTZIM1YxNS41VjE0SDRWMTNWNlY1SDNWMy41VjNIMlpNOC4yMDcxMSA3LjVMNy44NTM1NSA3Ljg1MzU1TDYuNzA3MTEgOUgxMS4yOTI5TDEwLjE0NjQgNy44NTM1NUw5Ljc5Mjg5IDcuNUwxMC41IDYuNzkyODlMMTAuODUzNiA3LjE0NjQ1TDEyLjg1MzYgOS4xNDY0NUwxMy4yMDcxIDkuNUwxMi44NTM2IDkuODUzNTVMMTAuODUzNiAxMS44NTM2TDEwLjUgMTIuMjA3MUw5Ljc5Mjg5IDExLjVMMTAuMTQ2NCAxMS4xNDY0TDExLjI5MjkgMTBINi43MDcxMUw3Ljg1MzU1IDExLjE0NjRMOC4yMDcxMSAxMS41TDcuNSAxMi4yMDcxTDcuMTQ2NDUgMTEuODUzNkw1LjE0NjQ1IDkuODUzNTVMNC43OTI4OSA5LjVMNS4xNDY0NSA5LjE0NjQ1TDcuMTQ2NDUgNy4xNDY0NUw3LjUgNi43OTI4OUw4LjIwNzExIDcuNVpNMyA2SDJWMTNIM1Y2Wk0xNSAzLjVWM0gxNlYzLjVWNUgxN1Y2VjEzVjE0SDE2VjE1LjVWMTZIMTVWMTUuNVYxNEgxNFYxM1Y2VjVIMTVWMy41Wk0xNSA2SDE2VjEzSDE1VjZaIiBmaWxsPSIjRjhGOUZEIi8+DQo8L3N2Zz4NCg=="},{name:"barsRange",theme:"light",
|
||||
v||"bottom"!==x||(e.lineTo(m+y,R+_),e.lineTo(m,R+_+y),e.lineTo(m-y,R+_)),e.lineTo(w,R+_),e.closePath(),e.fill(),e.stroke(),e.textBaseline="middle",e.fillStyle=i.textColor,e.textAlign=(0,c.isRtl)()?"right":"left";const T=(0,u.calcTextHorizontalShift)(e,s),b=g+i.tooltipPadding+T;let P=f+i.tooltipPadding+i.fontSize/2;(0,u.drawScaled)(e,t.pixelRatio,t.pixelRatio,(()=>{for(let t=0;t<o.length;t++)e.fillText(o[t].replace(/^\s+/,""),b,P),P+=i.fontSize+l})),e.restore()}}class m extends r.LineSourcePaneView{constructor(e,t){super(e,t),this._renderer=null,this._noteRenderer=new x}isLabelVisible(){return this.isHoveredSource()||this.isSelectedSource()}renderer(e,t){return this._invalidated&&this._updateImpl(),this._renderer}_updateImpl(){super._updateImpl(),this._renderer=null;const e=this._getSource(),t=this._source.isFixed()?[(0,n.ensureDefined)(e.fixedPoint())]:this._points;if(t.length<1)return;const i=new s.CompositeRenderer,r=this.isLabelVisible(),d=this._source.properties().childs(),h={text:d.text.value(),bold:d.bold.value(),italic:d.italic.value(),font:l.CHART_FONT_FAMILY,fontSize:d.fontSize.value(),backgroundColor:d.backgroundColor.value(),backgroundTransparency:d.backgroundTransparency.value(),borderColor:d.borderColor.value(),textColor:d.textColor.value(),markerColor:d.markerColor.value(),point:t[0],width:24,height:32,tooltipVisible:r,vpWidth:this._model.timeScale().width(),tooltipWidth:e.getTooltipWidth(),tooltipPadding:e.getTooltipPadding(),tooltipLineSpacing:e.getTooltipLineSpacing()};this._noteRenderer.setData(h),i.append(this._noteRenderer),i.append(new o.SelectionRenderer({points:t,bgColors:this._lineAnchorColors(t),visible:this.areAnchorsVisible(),barSpacing:this._model.timeScale().barSpacing(),hittestResult:a.HitTarget.MovePoint})),this._renderer=i}}},14002:(e,t,i)=>{"use strict";function n(e,t,i){const n=t-i;if("percentage"===e.getLineLengthUnit()){const r=Math.max(e.getLineLength()/100*t,1),s=Math.round(t-Math.min(n,r));return{right:s,left:s-i}}const r=e.getLineLength();if(r<0){const e=Math.round(Math.min(n,-1*r));return{left:e,right:e+i}}{const e=Math.round(t-Math.min(n,r));return{right:e,left:e-i}}}i.d(t,{orderLineLocation:()=>n})},61144:(e,t,i)=>{"use strict";i.r(t),i.d(t,{OrderPaneView:()=>x});var n=i(86441),r=i(79191),s=i(19266),o=i(44352),a=i(82161),l=i(68441),d=i(15187),h=i(18807),c=i(53180),u=i(47043),p=i(14002);const _=o.t(null,void 0,i(33241)),g=o.t(null,void 0,i(16075));class f extends d.MediaCoordinatesPaneRenderer{constructor(e){super(),this._data=null,this._cache={},this._data=null,this._adapter=e}setData(e){this._data=e}hitTest(e,t){if(null===this._data||0===this._data.points.length)return null;const i=this._cache;if(e.y<i.top||e.y>i.bottom)return null;if(this._adapter.getBlocked()&&e.x>=i.left&&e.x<i.right)return new h.HitTestResult(h.HitTarget.Custom,{});if(this._adapter.getEditable()&&e.x>=i.left&&e.x<i.bodyRight){const e=this._adapter.hasMoveCallback()?h.HitTarget.MovePoint:h.HitTarget.Regular;return 0===this._adapter.getTooltip().length?new h.HitTestResult(e):new h.HitTestResult(e,{
|
||||
tooltip:{text:this._adapter.getTooltip(),forceHideOnMove:this._adapter.hasMoveCallback(),rect:{x:i.left,y:i.top,w:i.bodyRight-i.left,h:i.bottom-i.top}}})}return this._adapter.getEditable()&&e.x>=i.bodyRight&&e.x<i.quantityRight?this._adapter.hasModifyCallback()?new h.HitTestResult(h.HitTarget.Custom,{clickHandler:this._adapter.callOnModify.bind(this._adapter),tapHandler:this._adapter.callOnModify.bind(this._adapter),tooltip:{text:this._adapter.getModifyTooltip()||(0,c.appendEllipsis)(_),rect:{x:i.bodyRight,y:i.top,w:i.quantityRight-i.bodyRight,h:i.bottom-i.top}}}):new h.HitTestResult(h.HitTarget.Regular):this._adapter.getCancellable()&&e.x>=i.quantityRight&&e.x<i.right?new h.HitTestResult(h.HitTarget.Custom,{clickHandler:this._adapter.callOnCancel.bind(this._adapter),tapHandler:this._adapter.callOnCancel.bind(this._adapter),tooltip:{text:this._adapter.getCancelTooltip()||g,rect:{x:i.quantityRight,y:i.top,w:i.right-i.quantityRight,h:i.bottom-i.top}}}):null}_drawImpl(e){if(null===this._data||!this._data.points||this._data.points.length<1)return;const t=e.context,i=e.mediaSize.width,n=this._bodyWidth(t),r=this._quantityWidth(t),s=n+r+this._cancelButtonWidth(),{left:o,right:a}=(0,p.orderLineLocation)(this._adapter,i,s),l=Math.round(this._data.points[0].y),d=Math.round(l-(this._height()+1)/2);this._cache.bodyRight=o+n,this._cache.quantityRight=o+n+r,this._cache.top=d,this._cache.bottom=d+this._height(),this._cache.left=o,this._cache.right=a,this._drawLines(t,o,a,l,i);let h=!1;0!==n&&(this._drawBody(t,o,d),this._adapter.hasMoveCallback()&&this._drawMovePoints(t,o,d),this._drawBodyText(t,o,d),h=!0),0!==r&&(this._drawQuantity(t,o+n,d,h),this._drawQuantityText(t,o+n,d),h=!0),0!==this._cancelButtonWidth()&&this._drawCancelButton(t,o+n+r,d,h)}_height(){return Math.max(20,1+Math.max(u.fontHeight(this._adapter.getBodyFont()),u.fontHeight(this._adapter.getQuantityFont())))}_bodyWidth(e){if(0===this._adapter.getText().length)return 0;e.save(),e.font=this._adapter.getBodyFont();const t=e.measureText(this._adapter.getText()).width;return e.restore(),Math.round(20+t)}_getQuantity(){return(0,a.splitThousands)(this._adapter.getQuantity()," ")}_quantityWidth(e){if(0===this._getQuantity().length)return 0;e.save(),e.font=this._adapter.getQuantityFont();const t=e.measureText(this._getQuantity()).width;return e.restore(),Math.round(Math.max(this._height(),10+t))}_cancelButtonWidth(){return this._adapter.isOnCancelCallbackPresent()?this._height():0}_drawLines(e,t,i,n,r){e.save(),e.strokeStyle=this._adapter.getLineColor(),(0,l.setLineStyle)(e,this._adapter.getLineStyle()),e.lineWidth=this._adapter.getLineWidth(),(0,l.drawLine)(e,i,n,r,n),this._adapter.getExtendLeft()&&(0,l.drawLine)(e,0,n,t,n),e.restore()}_drawMovePoints(e,t,i){e.save(),e.strokeStyle=this._adapter.getBodyBorderColor(),e.fillStyle=this._adapter.getBodyBorderColor();const n=t+4,r=n+2,s=Math.floor((this._height()-10)/2)+1;for(let t=0;t<s;++t){const s=i+5+2*t;(0,l.drawLine)(e,n,s,r,s)}e.restore()}_drawBody(e,t,i){e.strokeStyle=this._adapter.getBodyBorderColor(),
|
||||
e.fillStyle=this._adapter.getBodyBackgroundColor();const n=this._bodyWidth(e),r=this._height();e.fillRect(t+.5,i+.5,n-1,r-1),e.strokeRect(t,i,n,r)}_drawBodyText(e,t,i){e.textAlign="center",e.textBaseline="middle",e.font=this._adapter.getBodyFont(),e.fillStyle=this._adapter.getBodyTextColor();const n=t+this._bodyWidth(e)/2,r=i+this._height()/2;e.fillText(this._adapter.getText(),5+n-2,r)}_drawQuantity(e,t,i,n){e.save(),e.strokeStyle=this._adapter.getQuantityBorderColor(),e.fillStyle=this._adapter.getQuantityBackgroundColor();const r=this._quantityWidth(e),s=this._height();e.fillRect(t+.5,i+.5,r-1,s-1),n&&e.clip&&(e.beginPath(),e.rect(t+.5,i-.5,r+1,s+1),e.clip()),e.strokeRect(t,i,r,s),e.restore()}_drawQuantityText(e,t,i){e.save(),e.textAlign="center",e.textBaseline="middle",e.font=this._adapter.getQuantityFont(),e.fillStyle=this._adapter.getQuantityTextColor();const n=t+this._quantityWidth(e)/2,r=i+this._height()/2;e.fillText(this._getQuantity(),n,r),e.restore()}_drawCancelButton(e,t,i,r){e.strokeStyle=this._adapter.getCancelButtonBorderColor(),e.fillStyle=this._adapter.getCancelButtonBackgroundColor();const s=this._cancelButtonWidth(),o=this._height();e.fillRect(t+.5,i+.5,s-1,o-1),this._adapter.getBlocked()&&(e.fillStyle="rgba(140, 140, 140, 0.75)",e.fillRect(t+.5,i+.5,s-1,o-1)),e.save(),r&&e.clip&&(e.beginPath(),e.rect(t+.5,i-.5,s+1,o+1),e.clip()),e.strokeRect(t,i,s,o),e.restore();const a=t+s,d=i+o;e.strokeStyle=this._adapter.getCancelButtonIconColor();const h=(this._cancelButtonWidth()-8)/2,c=(this._height()-8)/2;(0,l.drawPoly)(e,[new n.Point(t+h,i+c),new n.Point(a-h,d-c)],!0),(0,l.drawPoly)(e,[new n.Point(a-h,i+c),new n.Point(t+h,d-c)],!0)}}var v=i(80101);class x extends r.LineSourcePaneView{constructor(e,t){super(e,t),this._renderer=new s.CompositeRenderer,this._selectionRenderer=new v.SelectionRenderer,this._selectionData=null,this._adapter=e.adapter(),this._orderRenderer=new f(e.adapter()),this._renderer.append(this._orderRenderer),this._renderer.append(this._selectionRenderer)}renderer(e,t){return this._invalidated&&this._updateImpl(t),this._renderer}_updateImpl(e){if(super._updateImpl(),this._selectionData=null,this.isSelectedSource()&&this._points.length>0){const t=this._points[0].y,i=e-3.5-1,r=this._adapter.hasMoveCallback()?h.HitTarget.MovePoint:h.HitTarget.Regular,s=[new n.Point(i,t)];this._selectionData={barSpacing:this._model.timeScale().barSpacing(),points:s,bgColors:this._lineAnchorColors(s),hittestResult:r,visible:!0}}this._orderRenderer.setData({points:this._points}),this._selectionRenderer.setData(this._selectionData)}}},26013:(e,t,i)=>{"use strict";i.r(t),i.d(t,{ParallelChannelPaneView:()=>d});var n=i(86441),r=i(66103),s=i(19266),o=i(28621),a=i(33295);const l=[r.PaneCursorType.Default,r.PaneCursorType.Default,r.PaneCursorType.Default,r.PaneCursorType.Default,r.PaneCursorType.VerticalResize,r.PaneCursorType.VerticalResize];class d extends a.AlertableLineSourcePaneView{constructor(){super(...arguments),this._channelRenderer=new o.ParallelChannelRenderer,this._renderer=null}renderer(e,t){
|
||||
return this._invalidated&&this._updateImpl(),this._renderer}_updateImpl(){super._updateImpl(),this._renderer=null;const e=this._source.priceScale();if(!e||e.isEmpty())return;if(0===this._source.points().length)return;let t=null,i=null;if(3===this._points.length){const e=this._points[0],r=this._points[1],s=this._points[2].y-this._points[0].y;t=e.add((0,n.point)(0,s)),i=r.add((0,n.point)(0,s))}if(this._points.length<=1)return;const r=this._source.properties(),o={points:this._points.length>2&&null!==t&&null!==i?[this._points[0],this._points[1],t,i]:[this._points[0],this._points[1]],color:r.childs().linecolor.value(),linewidth:r.childs().linewidth.value(),linestyle:r.childs().linestyle.value(),extendleft:r.childs().extendLeft.value(),extendright:r.childs().extendRight.value(),fillBackground:r.childs().fillBackground.value(),backcolor:r.childs().backgroundColor.value(),transparency:r.childs().transparency.value(),showMidline:r.childs().showMidline.value(),midlinewidth:r.childs().midlinewidth.value(),midlinestyle:r.childs().midlinestyle.value(),midcolor:r.childs().midlinecolor.value(),hittestOnBackground:!0};this._channelRenderer.setData(o);const a=new s.CompositeRenderer;a.append(this._channelRenderer);const d=[];if(this._points[0]&&d.push(this._points[0]),this._points[1]&&d.push(this._points[1]),t&&i){const e=t;e.data=2,d.push(e);const n=i;n.data=3,d.push(n);const r=t.add(i).scaled(.5);r.data=4,r.square=!0,d.push(r);const s=d[0].add(d[1]).scaled(.5);s.data=5,s.square=!0,d.push(s)}const h=3===this._points.length&&!t;if(this._model.lineBeingCreated()!==this._source||h||(d.pop(),d.pop()),a.append(this.createLineAnchor({points:d,pointsCursorType:l},0)),this._points.length>=2){const e=this._points;this._addAlertRenderer(a,[e[0],e[1]])}this._renderer=a}}},62801:(e,t,i)=>{"use strict";i.r(t),i.d(t,{PathPaneView:()=>o});var n=i(79797),r=i(19266),s=i(79191);class o extends s.LineSourcePaneView{constructor(e,t){super(e,t),this._polygonRenderer=new n.PolygonRenderer,this._renderer=new r.CompositeRenderer}renderer(e,t){return this._invalidated&&this._updateImpl(),this._renderer}_updateImpl(){super._updateImpl(),this._renderer.clear();const e=this._source.properties().childs(),t={points:this._points,color:e.lineColor.value(),linewidth:e.lineWidth.value(),linestyle:e.lineStyle.value(),leftend:e.leftEnd.value(),rightend:e.rightEnd.value(),filled:!1,backcolor:"",fillBackground:!1,transparency:0};this._polygonRenderer.setData(t),this._renderer.append(this._polygonRenderer),this.addAnchors(this._renderer)}}},87202:(e,t,i)=>{"use strict";i.r(t),i.d(t,{PitchfanLinePaneView:()=>d});var n=i(18807),r=i(14146),s=i(19266),o=i(73436),a=i(99031),l=i(79191);class d extends l.LineSourcePaneView{constructor(){super(...arguments),this._medianRenderer=new a.TrendLineRenderer,this._sideRenderer=new a.TrendLineRenderer,this._renderer=null,this._medianPoint=null}renderer(e,t){return this._invalidated&&this._updateImpl(),this._renderer}_updateImpl(){if(super._updateImpl(),this._renderer=null,0===this._points.length)return
|
||||
;if(3===this._points.length?(this._medianPoint=this._points[1].add(this._points[2]).scaled(.5),this._medianPoint.data=3):2===this._points.length?(this._medianPoint=this._points[1].clone(),this._medianPoint.data=3):(this._medianPoint=this._points[0].clone(),this._medianPoint.data=3),this._points.length<2)return;if(!this._medianPoint)return;const e=new s.CompositeRenderer,t=this._source.properties().childs(),i=t.median.childs(),l={points:[this._points[0],this._medianPoint],color:i.color.value(),linewidth:i.linewidth.value(),linestyle:i.linestyle.value(),extendleft:!1,extendright:!0,leftend:o.LineEnd.Normal,rightend:o.LineEnd.Normal};if(this._medianRenderer.setData(l),e.append(this._medianRenderer),this._points.length<3)return this.addAnchors(e),void(this._renderer=e);const d={points:[this._points[1],this._points[2]],color:i.color.value(),linewidth:i.linewidth.value(),linestyle:i.linestyle.value(),extendleft:!1,extendright:!1,leftend:o.LineEnd.Normal,rightend:o.LineEnd.Normal};this._sideRenderer.setData(d),e.append(this._sideRenderer);let h=0;const c=this._points[2].subtract(this._points[1]).scaled(.5),u=t.fillBackground.value(),p=t.transparency.value();for(let t=0;t<=8;t++){const i="level"+t,s=this._source.properties().child(i);if(s.childs().visible.value()){const i=this._medianPoint.addScaled(c,s.childs().coeff.value()),l=this._medianPoint.addScaled(c,-s.childs().coeff.value());if(u){{const t={p1:this._points[0],p2:i,p3:this._points[0],p4:this._medianPoint.addScaled(c,h),color:s.childs().color.value(),transparency:p,hittestOnBackground:!0,extendLeft:!1},n=new r.ChannelRenderer;n.setData(t),e.append(n)}{const t={p1:this._points[0],p2:l,p3:this._points[0],p4:this._medianPoint.addScaled(c,-h),color:s.childs().color.value(),transparency:p,hittestOnBackground:!0,extendLeft:!1},i=new r.ChannelRenderer;i.setData(t),e.append(i)}}h=s.childs().coeff.value();{const r={points:[this._points[0],i],color:s.childs().color.value(),linewidth:s.childs().linewidth.value(),linestyle:s.childs().linestyle.value(),extendleft:!1,extendright:!0,leftend:o.LineEnd.Normal,rightend:o.LineEnd.Normal},l=new a.TrendLineRenderer;l.setData(r),l.setHitTest(new n.HitTestResult(n.HitTarget.MovePoint,void 0,t)),e.append(l)}{const i={points:[this._points[0],l],color:s.childs().color.value(),linewidth:s.childs().linewidth.value(),linestyle:s.childs().linestyle.value(),extendleft:!1,extendright:!0,leftend:o.LineEnd.Normal,rightend:o.LineEnd.Normal},r=new a.TrendLineRenderer;r.setData(i),r.setHitTest(new n.HitTestResult(n.HitTarget.MovePoint,void 0,t)),e.append(r)}}}this.addAnchors(e),this._renderer=e}}},95337:(e,t,i)=>{"use strict";i.r(t),i.d(t,{InsidePitchforkLinePaneView:()=>p,PitchforkLinePaneView:()=>h,SchiffPitchfork2LinePaneView:()=>u,SchiffPitchforkLinePaneView:()=>c});var n=i(86441),r=i(18807),s=i(14146),o=i(19266),a=i(73436),l=i(99031),d=i(79191);class h extends d.LineSourcePaneView{constructor(){super(...arguments),this._medianRenderer=new l.TrendLineRenderer,this._sideRenderer=new l.TrendLineRenderer,this._renderer=null,this._medianPoint=null}
|
||||
renderer(e,t){return this._invalidated&&this._updateImpl(),this._renderer}_updateImpl(){super._updateImpl(),this._renderer=null,0!==this._points.length&&(3===this._points.length?(this._medianPoint=this._points[1].add(this._points[2]).scaled(.5),this._medianPoint.data=3):2===this._points.length?(this._medianPoint=this._points[1].clone(),this._medianPoint.data=3):(this._medianPoint=this._points[0].clone(),this._medianPoint.data=3),this._updateRenderer())}_updateRenderer(){if(this._points.length<2)return;if(!this._medianPoint)return;const e=this._source.properties(),t=e.childs().median.childs(),i=new o.CompositeRenderer,n={points:[this._points[0],this._medianPoint],color:t.color.value(),linewidth:t.linewidth.value(),linestyle:t.linestyle.value(),extendleft:e.childs().extendLines.value(),extendright:!0,leftend:a.LineEnd.Normal,rightend:a.LineEnd.Normal};if(this._medianRenderer.setData(n),i.append(this._medianRenderer),this._points.length<3)return this.addAnchors(i),void(this._renderer=i);const d={points:[this._points[1],this._points[2]],color:t.color.value(),linewidth:t.linewidth.value(),linestyle:t.linestyle.value(),extendleft:!1,extendright:!1,leftend:a.LineEnd.Normal,rightend:a.LineEnd.Normal};this._sideRenderer.setData(d),i.append(this._sideRenderer);const h=this._points[2].subtract(this._points[1]).scaled(.5),c=this._medianPoint.subtract(this._points[0]);let u=0;const p=e.childs().fillBackground.value(),_=e.childs().transparency.value();for(let t=0;t<=8;t++){const n="level"+t,o=e.childs()[n];if(o.childs().visible.value()){const n=this._medianPoint.addScaled(h,o.childs().coeff.value()),d=n.add(c),g=this._medianPoint.addScaled(h,-o.childs().coeff.value()),f=g.add(c);if(p){{const t=this._medianPoint.addScaled(h,u),r={p1:n,p2:d,p3:t,p4:t.add(c),color:o.childs().color.value(),transparency:_,hittestOnBackground:!0,extendLeft:e.childs().extendLines.value()},a=new s.ChannelRenderer;a.setData(r),i.append(a)}{const t=this._medianPoint.addScaled(h,-u),n={p1:g,p2:f,p3:t,p4:t.add(c),color:o.childs().color.value(),transparency:_,hittestOnBackground:!0,extendLeft:e.childs().extendLines.value()},r=new s.ChannelRenderer;r.setData(n),i.append(r)}}u=o.childs().coeff.value();const v={points:[n,d],color:o.childs().color.value(),linewidth:o.childs().linewidth.value(),linestyle:o.childs().linestyle.value(),extendleft:e.childs().extendLines.value(),extendright:!0,leftend:a.LineEnd.Normal,rightend:a.LineEnd.Normal},x=new l.TrendLineRenderer;x.setData(v),x.setHitTest(new r.HitTestResult(r.HitTarget.MovePoint,void 0,t)),i.append(x);const m={points:[g,f],color:o.childs().color.value(),linewidth:o.childs().linewidth.value(),linestyle:o.childs().linestyle.value(),extendleft:e.childs().extendLines.value(),extendright:!0,leftend:a.LineEnd.Normal,rightend:a.LineEnd.Normal},w=new l.TrendLineRenderer;w.setData(m),w.setHitTest(new r.HitTestResult(r.HitTarget.MovePoint,void 0,t)),i.append(w)}}this.addAnchors(i),this._renderer=i}}class c extends h{constructor(){super(...arguments),this._modifiedBase=null,this._backSideRenderer=new l.TrendLineRenderer}
|
||||
renderer(e,t){return this._invalidated&&this._updateImpl(),this._renderer}_updateRenderer(){if(this._points.length<2)return;this._calcMofifiedBase();const e=this._source.properties(),t=new o.CompositeRenderer,i=e.childs().median.childs();{const e={points:[this._points[0],this._points[1]],color:i.color.value(),linewidth:i.linewidth.value(),linestyle:i.linestyle.value(),extendleft:!1,extendright:!1,leftend:a.LineEnd.Normal,rightend:a.LineEnd.Normal};if(this._backSideRenderer.setData(e),t.append(this._backSideRenderer),!this._medianPoint||!this._modifiedBase)return this.addAnchors(t),void(this._renderer=t)}{const n={points:[this._modifiedBase,this._medianPoint],color:i.color.value(),linewidth:i.linewidth.value(),linestyle:i.linestyle.value(),extendleft:e.childs().extendLines.value(),extendright:!0,leftend:a.LineEnd.Normal,rightend:a.LineEnd.Normal};if(this._medianRenderer.setData(n),t.append(this._medianRenderer),this._points.length<3)return this.addAnchors(t),void(this._renderer=t)}{const e={points:[this._points[1],this._points[2]],color:i.color.value(),linewidth:i.linewidth.value(),linestyle:i.linestyle.value(),extendleft:!1,extendright:!1,leftend:a.LineEnd.Normal,rightend:a.LineEnd.Normal};this._sideRenderer.setData(e),t.append(this._sideRenderer)}{const i=this._points[2].subtract(this._points[1]).scaled(.5),n=this._medianPoint.subtract(this._modifiedBase);let o=0;const d=e.childs().fillBackground.value(),h=e.childs().transparency.value();for(let c=0;c<=8;c++){const u="level"+c,p=e.child(u);if(p.childs().visible.value()){const u=this._medianPoint.addScaled(i,p.childs().coeff.value()),_=u.add(n),g=this._medianPoint.addScaled(i,-p.childs().coeff.value()),f=g.add(n);if(d){const r=this._medianPoint.addScaled(i,o);{const i={p1:u,p2:_,p3:r,p4:r.add(n),color:p.childs().color.value(),transparency:h,hittestOnBackground:!0,extendLeft:e.childs().extendLines.value()},o=new s.ChannelRenderer;o.setData(i),t.append(o)}{const r=this._medianPoint.addScaled(i,-o),a={p1:g,p2:f,p3:r,p4:r.add(n),color:p.childs().color.value(),transparency:h,hittestOnBackground:!0,extendLeft:e.childs().extendLines.value()},l=new s.ChannelRenderer;l.setData(a),t.append(l)}}o=p.childs().coeff.value();const v={points:[u,_],color:p.childs().color.value(),linewidth:p.childs().linewidth.value(),linestyle:p.childs().linestyle.value(),extendleft:e.childs().extendLines.value(),extendright:!0,leftend:a.LineEnd.Normal,rightend:a.LineEnd.Normal},x=new l.TrendLineRenderer;x.setData(v),x.setHitTest(new r.HitTestResult(r.HitTarget.MovePoint,void 0,c)),t.append(x);const m={points:[g,f],color:p.childs().color.value(),linewidth:p.childs().linewidth.value(),linestyle:p.childs().linestyle.value(),extendleft:e.childs().extendLines.value(),extendright:!0,leftend:a.LineEnd.Normal,rightend:a.LineEnd.Normal},w=new l.TrendLineRenderer;w.setData(m),w.setHitTest(new r.HitTestResult(r.HitTarget.MovePoint,void 0,c)),t.append(w)}}}this.addAnchors(t),this._renderer=t}_calcMofifiedBase(){this._points.length>1&&(this._modifiedBase=this._points[0].add(this._points[1]).scaled(.5))}}
|
||||
class u extends c{_calcMofifiedBase(){if(this._points.length>2){const e=this._points[0].x,t=.5*(this._points[0].y+this._points[1].y),i=new n.Point(e,t);this._modifiedBase=i}}}class p extends h{constructor(){super(...arguments),this._backSideRenderer=new l.TrendLineRenderer,this._centerRenderer=new l.TrendLineRenderer,this._modifiedBase=null}renderer(e,t){return this._invalidated&&this._updateImpl(),this._renderer}_updateRenderer(){if(this._points.length>1&&(this._modifiedBase=this._points[0].add(this._points[1]).scaled(.5)),this._points.length<2)return;const e=new o.CompositeRenderer;if(!this._medianPoint||!this._modifiedBase)return void this.addAnchors(e);const t=this._source.properties(),i=t.childs().median.childs();if(3===this._points.length){const t={points:[this._modifiedBase,this._points[2]],color:i.color.value(),linewidth:i.linewidth.value(),linestyle:i.linestyle.value(),extendleft:!1,extendright:!1,leftend:a.LineEnd.Normal,rightend:a.LineEnd.Normal};this._medianRenderer.setData(t),e.append(this._medianRenderer)}{const t={points:[this._points[0],this._points[1]],color:i.color.value(),linewidth:i.linewidth.value(),linestyle:i.linestyle.value(),extendleft:!1,extendright:!1,leftend:a.LineEnd.Normal,rightend:a.LineEnd.Normal};if(this._backSideRenderer.setData(t),e.append(this._backSideRenderer),this._points.length<3)return this.addAnchors(e),void(this._renderer=e)}{const t={points:[this._points[1],this._points[2]],color:i.color.value(),linewidth:i.linewidth.value(),linestyle:i.linestyle.value(),extendleft:!1,extendright:!1,leftend:a.LineEnd.Normal,rightend:a.LineEnd.Normal};this._sideRenderer.setData(t),e.append(this._sideRenderer)}{const n=this._points[2].subtract(this._points[1]).scaled(.5),o=this._points[2].subtract(this._modifiedBase);let d=0;const h=t.childs().fillBackground.value(),c=t.childs().transparency.value(),u={points:[this._medianPoint,this._medianPoint.add(o)],color:i.color.value(),linewidth:i.linewidth.value(),linestyle:i.linestyle.value(),extendleft:t.childs().extendLines.value(),extendright:!0,leftend:a.LineEnd.Normal,rightend:a.LineEnd.Normal};this._centerRenderer.setData(u),e.append(this._centerRenderer);for(let i=0;i<=8;i++){const u="level"+i,p=t.child(u).childs();if(p.visible.value()){const u=this._medianPoint.addScaled(n,p.coeff.value()),_=u.add(o),g=this._medianPoint.addScaled(n,-p.coeff.value()),f=g.add(o);if(h){{const i=this._medianPoint.addScaled(n,d),r={p1:u,p2:_,p3:i,p4:i.add(o),color:p.color.value(),transparency:c,hittestOnBackground:!0,extendLeft:t.childs().extendLines.value()},a=new s.ChannelRenderer;a.setData(r),e.append(a)}{const i=this._medianPoint.addScaled(n,-d),r={p1:g,p2:f,p3:i,p4:i.add(o),color:p.color.value(),transparency:c,hittestOnBackground:!0,extendLeft:t.childs().extendLines.value()},a=new s.ChannelRenderer;a.setData(r),e.append(a)}}d=p.coeff.value();const v={points:[u,_],color:p.color.value(),linewidth:p.linewidth.value(),linestyle:p.linestyle.value(),extendleft:t.childs().extendLines.value(),extendright:!0,leftend:a.LineEnd.Normal,rightend:a.LineEnd.Normal
|
||||
},x=new l.TrendLineRenderer;x.setData(v),x.setHitTest(new r.HitTestResult(r.HitTarget.MovePoint,void 0,i)),e.append(x);const m={points:[g,f],color:p.color.value(),linewidth:p.linewidth.value(),linestyle:p.linestyle.value(),extendleft:t.childs().extendLines.value(),extendright:!0,leftend:a.LineEnd.Normal,rightend:a.LineEnd.Normal},w=new l.TrendLineRenderer;w.setData(m),w.setHitTest(new r.HitTestResult(r.HitTarget.MovePoint,void 0,i)),e.append(w)}}}this.addAnchors(e),this._renderer=e}}},50253:(e,t,i)=>{"use strict";i.r(t),i.d(t,{PolylinePaneView:()=>o});var n=i(79797),r=i(19266),s=i(79191);class o extends s.LineSourcePaneView{constructor(e,t){super(e,t),this._polygonRenderer=new n.PolygonRenderer,this._renderer=new r.CompositeRenderer}renderer(e,t){return this._invalidated&&this._updateImpl(),this._renderer}_updateImpl(){super._updateImpl(),this._renderer.clear();const e=this._source.properties().childs(),t={points:this._points,color:e.linecolor.value(),linewidth:e.linewidth.value(),linestyle:e.linestyle.value(),filled:e.filled.value(),backcolor:e.backgroundColor.value(),fillBackground:e.fillBackground.value(),transparency:e.transparency.value()};this._polygonRenderer.setData(t),this._renderer.append(this._polygonRenderer),this.addAnchors(this._renderer)}}},46258:(e,t,i)=>{"use strict";var n=i(79191).LineSourcePaneView,r=i(47043),s=i(18807).HitTestResult,o=i(18807).HitTarget,a=i(82161).splitThousands,l=i(38223),d=i(53180).appendEllipsis,h=i(15187).MediaCoordinatesPaneRenderer,c=i(14002).orderLineLocation;const{setLineStyle:u,drawLine:p,drawPoly:_}=i(68441),{LINESTYLE_SOLID:g}=i(79849);class f extends h{constructor(e,t){super(),this._data=null,this._cache=e,this._adapter=t}setData(e){this._data=e}_height(){return Math.max(20,1+Math.max(r.fontHeight(this._adapter.getBodyFont()),r.fontHeight(this._adapter.getQuantityFont())))}_bodyWidth(e){if(0===this._adapter.getText().length)return 0;e.save(),e.font=this._adapter.getBodyFont();var t=e.measureText(this._adapter.getText()).width;return e.restore(),Math.round(10+t)}_getQuantity(){var e=this._adapter.getQuantity();return isNaN(e)?e:a(this._adapter.getQuantity()," ")}_quantityWidth(e){if(0===this._getQuantity().length)return 0;e.save(),e.font=this._adapter.getQuantityFont();var t=e.measureText(this._getQuantity()).width;return e.restore(),Math.round(Math.max(this._height(),10+t))}_reverseButtonWidth(){return this._adapter.isOnReverseCallbackPresent()?this._height():0}_closeButtonWidth(){return this._adapter.isOnCloseCallbackPresent()?this._height():0}_drawLines(e,t,i,n,r){e.save(),e.strokeStyle=this._adapter.getLineColor(),u(e,this._adapter.getLineStyle()),e.lineWidth=this._adapter.getLineWidth(),p(e,i,n,r,n),this._adapter.getExtendLeft()&&p(e,0,n,t,n),e.restore()}_drawBody(e,t,i){e.strokeStyle=this._adapter.getBodyBorderColor(),e.fillStyle=this._adapter.getBodyBackgroundColor();var n=this._bodyWidth(e),r=this._height();e.fillRect(t+.5,i+.5,n-1,r-1),e.strokeRect(t,i,n,r)}_drawBodyText(e,t,i){e.save(),e.textAlign="center",e.textBaseline="middle",
|
||||
e.font=this._adapter.getBodyFont(),e.fillStyle=this._adapter.getBodyTextColor();var n=t+this._bodyWidth(e)/2,r=i+this._height()/2;e.fillText(this._adapter.getText(),n,r),e.restore()}_drawQuantity(e,t,i){e.strokeStyle=this._adapter.getQuantityBorderColor(),e.fillStyle=this._adapter.getQuantityBackgroundColor();var n=this._quantityWidth(e),r=this._height();e.fillRect(t+.5,i+.5,n-1,r-1),e.strokeRect(t,i,n,r)}_drawQuantityText(e,t,i){e.save(),e.textAlign="center",e.textBaseline="middle",e.font=this._adapter.getQuantityFont(),e.fillStyle=this._adapter.getQuantityTextColor();var n=t+this._quantityWidth(e)/2,r=i+this._height()/2;e.fillText(l.startWithLTR(this._getQuantity()+""),n,r),e.restore()}_drawReverseButton(e,t,i){e.save(),e.strokeStyle=this._adapter.getReverseButtonBorderColor(),e.fillStyle=this._adapter.getReverseButtonBackgroundColor();var n=this._reverseButtonWidth(),r=this._height();e.fillRect(t+.5,i+.5,n-1,r-1),e.strokeRect(t,i,n,r),e.strokeStyle=this._adapter.getReverseButtonIconColor();var s=function(e,t){u(e,g),p(e,0,0,0,t),p(e,-1,1,1,1),p(e,-2,2,2,2)},o=t+Math.round((this._reverseButtonWidth()-6)/2),a=i+5;e.save(),e.translate(o,a),s(e,10),e.translate(6,10),e.rotate(Math.PI),s(e,10),e.restore(),this._adapter._blocked&&(e.fillStyle="rgba(140, 140, 140, 0.75)",e.fillRect(t+.5,i+.5,n-1,r-1)),e.restore()}_drawCloseButton(e,t,i){e.save(),e.strokeStyle=this._adapter.getCloseButtonBorderColor(),e.fillStyle=this._adapter.getCloseButtonBackgroundColor();var n=this._closeButtonWidth(),r=this._height();e.fillRect(t+.5,i+.5,n-1,r-1),e.strokeRect(t,i,n,r);var s=t+n,o=i+r;e.strokeStyle=this._adapter.getCloseButtonIconColor();var a=(this._closeButtonWidth()-8)/2,l=(this._height()-8)/2;_(e,[{x:t+a,y:i+l},{x:s-a,y:o-l}],!0),_(e,[{x:s-a,y:i+l},{x:t+a,y:o-l}],!0),this._adapter._blocked&&(e.fillStyle="rgba(140, 140, 140, 0.75)",e.fillRect(t+.5,i+.5,n-1,r-1)),e.restore()}_drawImpl(e){if(null===this._data||!this._data.points||this._data.points.length<1)return;var t=e.context,i=this._data.width,n=this._bodyWidth(t),r=this._quantityWidth(t),s=this._reverseButtonWidth(t),o=n+r+s+this._closeButtonWidth();const{left:a,right:l}=c(this._adapter,i,o);var d=Math.round(this._data.points[0].y),h=Math.round(d-(this._height()+1)/2);this._cache.bodyRight=a+n,this._cache.quantityRight=this._cache.bodyRight+r,this._cache.reverseButtonRight=this._cache.quantityRight+s,this._cache.top=h,this._cache.bottom=h+this._height(),this._cache.left=a,this._cache.right=l,this._drawLines(t,a,l,d,i),0!==n&&(this._drawBody(t,a,h),this._drawBodyText(t,a,h)),0!==r&&(this._drawQuantity(t,this._cache.bodyRight,h),this._drawQuantityText(t,this._cache.bodyRight,h)),0!==s&&this._drawReverseButton(t,this._cache.quantityRight,h),0!==this._closeButtonWidth()&&this._drawCloseButton(t,this._cache.reverseButtonRight,h)}hitTest(e){
|
||||
return null===this._data||0===this._data.points.length||e.y<this._cache.top||e.y>this._cache.bottom||e.x<this._cache.left||this._cache.right<e.x?null:this._adapter._blocked?new s(o.Custom,{}):e.x>=this._cache.bodyRight&&e.x<this._cache.quantityRight&&this._adapter._onModifyCallback?new s(o.Custom,{clickHandler:this._adapter.callOnModify.bind(this._adapter),tapHandler:this._adapter.callOnModify.bind(this._adapter),tooltip:{text:this._adapter.getProtectTooltip()||d(i(44352).t(null,void 0,i(11810))),rect:{x:this._cache.bodyRight,y:this._cache.top,w:this._cache.quantityRight-this._cache.bodyRight,h:this._cache.bottom-this._cache.top}}}):e.x>=this._cache.quantityRight&&e.x<this._cache.reverseButtonRight?new s(o.Custom,{clickHandler:this._adapter.callOnReverse.bind(this._adapter),tapHandler:this._adapter.callOnReverse.bind(this._adapter),tooltip:{text:this._adapter.getReverseTooltip()||i(44352).t(null,void 0,i(19780)),rect:{x:this._cache.quantityRight,y:this._cache.top,w:this._cache.reverseButtonRight-this._cache.quantityRight,h:this._cache.bottom-this._cache.top}}}):e.x>=this._cache.reverseButtonRight&&e.x<this._cache.right?new s(o.Custom,{clickHandler:this._adapter.callOnClose.bind(this._adapter),tapHandler:this._adapter.callOnClose.bind(this._adapter),tooltip:{text:this._adapter.getCloseTooltip()||i(44352).t(null,void 0,i(37431)),rect:{x:this._cache.reverseButtonRight,y:this._cache.top,w:this._cache.right-this._cache.reverseButtonRight,h:this._cache.bottom-this._cache.top}}}):new s(o.Custom,{clickHandler:function(){},tapHandler:function(){},tooltip:{text:this._adapter.getTooltip(),rect:{x:this._cache.left,y:this._cache.top,w:this._cache.bodyRight-this._cache.left,h:this._cache.bottom-this._cache.top}}})}}t.PositionPaneView=class extends n{constructor(e,t){super(e,t),this._rendererCache={},this._renderer=new f(this._rendererCache,e._adapter)}renderer(e,t){return this._invalidated&&this._updateImpl(),this._renderer.setData({points:this._points,width:this._model.timeScale().width()}),this._renderer}}},75061:(e,t,i)=>{"use strict";var n=i(86441).Point,r=i(79191).LineSourcePaneView,s=i(36274).Interval,o=i(18807).HitTestResult,a=i(18807).HitTarget,l=i(19266).CompositeRenderer,d=i(12767).getImage,h=i(37160),c=i(93572).PercentageFormatter,u=i(53741).DateFormatter,p=i(79206).TimeFormatter,_=i(79206).hourMinuteFormat,g=i(79206).hourMinuteSecondFormat,f=i(2043).TimeSpanFormatter,v=i(87095),x=i(21316),m=i(74359).calcTextHorizontalShift,w=i(38223).isRtl,R=i(68441).drawRoundRect,y=i(29764).makeFont,T=i(15187).MediaCoordinatesPaneRenderer,b=i(38223),P=b.forceLTRStr,L=b.startWithLTR,S=i(46501).CHART_FONT_FAMILY;class C extends T{constructor(){super(),this._data=null,this._font=S,this._targetFontSize1=14,this._targetFontSize2=11,this._sourceFontSize1=12,this._sourceFontSize2=10,this._arrowOffset=6,this._arrowWidth=5,this._arrowHeight=5,this._radius=3,this._sourceWidth=void 0,this._sourceHeight=void 0,this._sourceRectLeftOffset=void 0,this._targetWidth=void 0,this._targetHeight=void 0,this._targetRectLeftOffset=void 0}setData(e){
|
||||
this._data=e}drawBalloon(e,t,i,r,s,o){var a=o||20;if(e.beginPath(),"down"===s){var l=new n(t.x-a,t.y-this._arrowOffset-this._arrowHeight-r);return e.moveTo(l.x+this._radius,l.y),e.lineTo(l.x+i-this._radius,l.y),e.arcTo(l.x+i,l.y,l.x+i,l.y+this._radius,this._radius),e.lineTo(l.x+i,l.y+r-this._radius),e.arcTo(l.x+i,l.y+r,l.x+i-this._radius,l.y+r,this._radius),e.lineTo(l.x+a+this._arrowWidth,l.y+r),e.lineTo(l.x+a,l.y+r+this._arrowHeight),e.lineTo(l.x+a-this._arrowWidth,l.y+r),e.lineTo(l.x+this._radius,l.y+r),e.arcTo(l.x,l.y+r,l.x,l.y+r-this._radius,this._radius),e.lineTo(l.x,l.y+this._radius),e.arcTo(l.x,l.y,l.x+this._radius,l.y,this._radius),l}var d=new n(t.x-a,t.y+this._arrowOffset+this._arrowHeight+r);return e.moveTo(d.x+this._radius,d.y),e.lineTo(d.x+i-this._radius,d.y),e.arcTo(d.x+i,d.y,d.x+i,d.y-this._radius,this._radius),e.lineTo(d.x+i,d.y-r+this._radius),e.arcTo(d.x+i,d.y-r,d.x+i-this._radius,d.y-r,this._radius),e.lineTo(d.x+a+this._arrowWidth,d.y-r),e.lineTo(d.x+a,d.y-r-this._arrowHeight),e.lineTo(d.x+a-this._arrowWidth,d.y-r),e.lineTo(d.x+this._radius,d.y-r),e.arcTo(d.x,d.y-r,d.x,d.y-r+this._radius,this._radius),e.lineTo(d.x,d.y-this._radius),e.arcTo(d.x,d.y,d.x+this._radius,d.y,this._radius),new n(d.x,d.y-r)}drawTargetLabel(e){e.save(),e.translate(.5,.5);var t=y(this._targetFontSize1,this._font,"normal"),n=y(this._targetFontSize2,this._font,"normal"),r=this._data.targetLine1,s=this._data.targetLine2,o=this._data.targetLine3,a=this._data.targetLine4;e.font=t;var l=e.measureText(r).width,d=e.measureText(s).width,h=e.measureText(" ").width;e.font=n;var c=e.measureText(o).width,u=e.measureText(a).width,p=e.measureText(" ").width,_=this._data.clockWhite&&this._data.clockWhite.width||0;this._targetWidth=Math.max(l+d+h,c+u+_+2*p)+8+4,this._targetHeight=this._targetFontSize1+this._targetFontSize2+9+4;var g=this._data.points[1],f=g.x+this._targetWidth-e.canvas.width+5;this._targetRectLeftOffset=Math.max(20,Math.min(this._targetWidth-15,f));var T="up"===this._data.direction?"down":"up",b=this.drawBalloon(e,g,this._targetWidth,this._targetHeight,T,this._targetRectLeftOffset);e.fillStyle=v.generateColor(this._data.targetBackColor,this._data.transparency),e.fill(),e.lineWidth=2,e.strokeStyle=v.generateColor(this._data.targetStrokeColor,this._data.transparency),e.stroke();e.beginPath(),e.arc(g.x,g.y,3,0,2*Math.PI,!1),e.fillStyle=this._data.centersColor,e.fill(),e.textBaseline="top",e.fillStyle=this._data.targetTextColor;var P=2+b.x+4,L=2+b.y+3,S=this._targetWidth-8-4;e.font=t,e.textAlign=w()?"right":"left";var C=m(e,S-d-h);e.fillText(r,P+C,L);var M=m(e,S-l);e.fillText(s,P+l+h+M,L),e.font=n;var I=L+this._targetFontSize1+3,A=m(e,S-u-_-p);e.fillText(o,P+A,I);var k=m(e,S-c-p-_-u);this._data.clockWhite&&e.drawImage(this._data.clockWhite,P+c+p+k,I+1);var N=m(e,S-c-_);if(e.fillText(a,P+c+_+2*p+N,I),this._data.status){var D,B,z,E;switch(e.font=y(this._targetFontSize1,this._font,"bold"),this._data.status){case x.AlertStatus.Success:D=i(44352).t(null,void 0,i(26787)),
|
||||
B=v.generateColor(this._data.successBackground,this._data.transparency),z=this._data.successTextColor,E=this._data.successIcon;break;case x.AlertStatus.Failure:D=i(44352).t(null,void 0,i(968)),B=v.generateColor(this._data.failureBackground,this._data.transparency),z=this._data.failureTextColor,E=this._data.failureIcon}var H=this._targetFontSize1+4,O=e.measureText(D).width,V=Math.round((this._targetWidth-O)/2),W=m(e,O);e.fillStyle=B,"up"===this._data.direction?(R(e,b.x-1,b.y-H-2,this._targetWidth+2,H,5),e.fill(),e.fillStyle=z,e.fillText(D,b.x+V+W,b.y-H+1),E&&e.drawImage(E,b.x+V-E.width-4,b.y-H-2+Math.abs(H-E.height)/2)):(R(e,b.x-1,b.y+this._targetHeight+2,this._targetWidth+2,H,5),e.fill(),e.fillStyle=z,e.fillText(D,b.x+V+W,b.y+this._targetHeight+5),E&&e.drawImage(E,b.x+V-E.width-4,b.y+this._targetHeight+10-Math.abs(H-E.height)/2)),e.restore()}else e.restore()}drawStartLabel(e){e.save(),e.translate(.5,.5);var t=y(this._sourceFontSize1,this._font,"normal"),i=y(this._sourceFontSize2,this._font,"normal");e.font=t;var n=e.measureText(this._data.sourceLine1).width;e.font=i;var r=e.measureText(this._data.sourceLine2).width;this._sourceWidth=Math.max(n,r)+6+4,this._sourceHeight=this._sourceFontSize1+this._sourceFontSize2+6+4;var s=this._data.points[0],o=s.x+this._sourceWidth-e.canvas.width+5;this._sourceRectLeftOffset=Math.max(20,Math.min(this._sourceWidth-15,o));var a=this.drawBalloon(e,s,this._sourceWidth,this._sourceHeight,this._data.direction,this._sourceRectLeftOffset);e.fillStyle=v.generateColor(this._data.sourceBackColor,this._data.transparency),e.fill(),e.lineWidth=2,e.strokeStyle=v.generateColor(this._data.sourceStrokeColor,this._data.transparency),e.stroke(),e.textAlign=w()?"right":"left",e.textBaseline="top",e.fillStyle=this._data.sourceTextColor;var l=m(e,this._sourceWidth-6-4),d=2+a.x+3+l,h=2+a.y+2;e.font=t,e.fillText(this._data.sourceLine1,d,h),e.font=i,e.fillText(this._data.sourceLine2,d,h+this._sourceFontSize1+2);e.beginPath(),e.arc(s.x,s.y,3,0,2*Math.PI,!1),e.fillStyle=this._data.centersColor,e.fill(),e.restore()}_drawImpl(e){if(!(null===this._data||this._data.points.length<2)){var t=e.context;t.lineCap="butt",t.strokeStyle=this._data.color,t.lineWidth=this._data.linewidth,t.lineStyle=this._data.linestyle;var i=this._data.points[0],n=this._data.points[1],r=n.subtract(i);Math.abs(r.x)<1||Math.abs(r.y)<1?(t.beginPath(),t.moveTo(i.x,i.y),t.lineTo(n.x,n.y),t.stroke()):(t.save(),t.beginPath(),t.translate(i.x,i.y),t.scale(1,r.y/r.x),t.moveTo(0,0),t.arcTo(r.x,0,r.x,r.x,Math.abs(r.x)),t.lineTo(r.x,r.x),t.restore(),t.stroke()),this.drawTargetLabel(t),this.drawStartLabel(t);var s=Math.max(8,4*this._data.linewidth);t.fillStyle=this._data.color;var o=r.y<0?1:-1;if(Math.abs(r.x)<1||Math.abs(r.y)<1)var a=Math.atan(r.x/r.y);else{var l,d,h=Math.abs(r.x),c=Math.abs(r.y),u=0,p=Math.PI/2,_=(u+p)/2;if(r.length()>s)for(;;){l=h*Math.sin(_),d=c*(1-Math.cos(_));var g=Math.sqrt((l-h)*(l-h)+(d-c)*(d-c));if(Math.abs(g-s)<1)break;g>s?u=_:p=_,_=(u+p)/2}a=Math.atan((h-l)/(c-d)),r.x*r.y<0&&(a=-a)}t.save(),t.beginPath(),
|
||||
t.translate(n.x,n.y),t.rotate(-a),t.moveTo(0,0),t.lineTo(-s/2,o*s),t.lineTo(s/2,o*s),t.lineTo(0,0),t.restore(),t.fill()}}targetLabelHitTest(e){if(void 0===this._targetWidth||void 0===this._targetHeight||void 0===this._targetRectLeftOffset)return null;var t=this._targetHeight+this._arrowHeight;this._data.status&&(t+=this._targetFontSize1+10);var i="up"===this._data.direction?-1:1,n=this._radius,r=this._data.points[1],s=r.x-this._targetRectLeftOffset,l=r.y+i*n,d=r.y+i*(t+n),h=Math.min(l,d),c=Math.max(l,d);return e.x>=s&&e.x<=s+this._targetWidth&&e.y>=h&&e.y<=c?new o(a.MovePoint):null}sourceLabelHitTest(e){if(void 0===this._sourceHeight||void 0===this._sourceWidth||void 0===this._sourceRectLeftOffset)return null;var t="up"===this._data.direction?1:-1,i=this._radius,n=this._data.points[0],r=n.x-this._sourceRectLeftOffset,s=n.y+i*t,l=n.y+(i+this._sourceHeight+this._arrowHeight)*t,d=Math.min(s,l),h=Math.max(s,l);return e.x>=r&&e.x<=r+this._sourceWidth&&e.y>=d&&e.y<=h?new o(a.MovePoint):null}hitTest(e){if(null===this._data||this._data.points.length<2)return null;var t=this._data.points[0],i=this._data.points[1],n=i.subtract(t),r=(n=i.subtract(t),e.subtract(t)),s=Math.abs(n.x),l=Math.abs(n.y),d=h.sign(n.y)*(l-l*Math.sqrt(1-r.x*r.x/(s*s)));if(Math.abs(d-r.y)<3)return new o(a.MovePoint);var c=this.targetLabelHitTest(e);return c||this.sourceLabelHitTest(e)}}t.PredictionPaneView=class extends r{constructor(e,t){super(e,t),this._pendingIcons=3;var n=this;function r(){n._pendingIcons-=1,0===n._pendingIcons&&n._source.model().updateSource(n._source)}this._clockWhite=null,this._successIcon=null,this._failureIcon=null,d("prediction-clock-white",i(99620)).then((function(e){n._clockWhite=e,r()})),d("prediction-success-white",i(14012)).then((function(e){n._successIcon=e,r()})),d("prediction-failure-white",i(88249)).then((function(e){n._failureIcon=e,r()})),this._percentageFormatter=new c,this._predictionRenderer=new C,this._renderer=null}iconsReady(){return 0===this._pendingIcons}renderer(e,t){return this._invalidated&&this._updateImpl(),this._renderer}_updateImpl(){if((super._updateImpl(),this._renderer=null,this._targetLine1="",this._targetLine2="",this._targetLine3="",this._targetLine4="",!(this._source.points().length<2))&&this._source.priceScale()){var e=this._source.ownerSource().formatter(),t=this._source.points()[1],n=this._source.points()[0];this._targetLine3=P(e.format(t.price));var r=t.price-n.price,o=r/Math.abs(n.price)*100;this._targetLine1=P(e.format(r)+" ("+this._percentageFormatter.format(o)+")");var a=this._model.timeScale().indexToUserTime(n.index),d=this._model.timeScale().indexToUserTime(t.index);n.time&&t.time&&(a=TradingView.isString(n.time)?new Date(Date.parse(n.time)):n.time,d=TradingView.isString(t.time)?new Date(Date.parse(t.time)):t.time);var h=this._model.mainSeries().isDWM(),c=s.parse(this._model.mainSeries().interval()),v=c.isSeconds()||c.isTicks();if(d&&a){this._targetLine4=(new u).format(d),h||(this._targetLine4=this._targetLine4+" "+new p(v?g:_).format(d));var m=(d.valueOf()-a.valueOf())/1e3
|
||||
;this._targetLine2=i(44352).t(null,{context:"dates"},i(91481))+" "+L((new f).format(m))}this._sourceLine1=e.format(n.price),this._sourceLine2="";var w=this._model.timeScale().indexToUserTime(n.index);w&&(this._sourceLine2=(new u).format(w),h||(this._sourceLine2=this._sourceLine2+" "+new p(v?g:_).format(w))),this._direction=this._source.direction()===x.Direction.Up?"up":"down",this._finished=this._model.lineBeingCreated()!==this._source&&this._model.lineBeingEdited()!==this._source&&!this._model.sourcesBeingMoved().includes(this._source);var R={};R.points=this._points,R.color=this._source.properties().linecolor.value(),R.linewidth=this._source.properties().linewidth.value(),R.targetLine1=this._targetLine1,R.targetLine2=this._targetLine2,R.targetLine3=this._targetLine3,R.targetLine4=this._targetLine4,R.status=this._source.properties().status.value(),R.transparency=this._source.properties().transparency.value(),R.targetBackColor=this._source.properties().targetBackColor.value(),R.targetStrokeColor=this._source.properties().targetStrokeColor.value(),R.targetTextColor=this._source.properties().targetTextColor.value(),R.sourceBackColor=this._source.properties().sourceBackColor.value(),R.sourceStrokeColor=this._source.properties().sourceStrokeColor.value(),R.sourceTextColor=this._source.properties().sourceTextColor.value(),R.successBackground=this._source.properties().successBackground.value(),R.successTextColor=this._source.properties().successTextColor.value(),R.failureBackground=this._source.properties().failureBackground.value(),R.failureTextColor=this._source.properties().failureTextColor.value(),R.intermediateBackColor=this._source.properties().intermediateBackColor.value(),R.intermediateTextColor=this._source.properties().intermediateTextColor.value(),R.sourceLine1=this._sourceLine1,R.sourceLine2=this._sourceLine2,R.direction=this._direction,R.clockWhite=this._clockWhite,R.successIcon=this._successIcon,R.failureIcon=this._failureIcon,R.finished=this._finished,R.centersColor=this._model.backgroundCounterColor().value(),this._predictionRenderer.setData(R);var y=new l;y.append(this._predictionRenderer),this.addAnchors(y),this._renderer=y}}}},86583:(e,t,i)=>{"use strict";var n=i(86441),r=n.Point,s=n.box,o=i(34026).pointInBox,a=i(79191).LineSourcePaneView,l=i(80101).SelectionRenderer,d=i(18807).HitTestResult,h=i(18807).HitTarget,c=i(19266).CompositeRenderer,u=i(87095),p=i(74359).calcTextHorizontalShift,_=i(38223).isRtl,g=i(15187).MediaCoordinatesPaneRenderer,f=i(46501);class v extends g{constructor(e,t){super(),this._data=null,this._measureCache=e,this._chartModel=t,this._points=null}setData(e){this._data=e,this._points=e.points}_drawImpl(e){if(null!==this._data&&null!==this._points&&0!==this._points.length){var t=e.context;t.font=[this._data.fontWeight,this._data.fontSize+"px",this._data.fontFamily].join(" ");var i=t.measureText(this._data.label);i.height=this._data.fontSize;var n=10,r=5,s=i.width+2*n,o=i.height+2*r,a=this._points[0].x- -9,l=this._points[0].y-(o+15);t.textAlign=_()?"right":"left";var d=p(t,i.width)
|
||||
;this._measureCache&&Object.assign(this._measureCache,{innerWidth:s,innerHeight:o,tailLeft:-9,tailHeight:15}),t.translate(.5+a,.5+l),t.beginPath(),t.moveTo(12,o),t.lineTo(-9,o+15),t.lineTo(-10,o+15-1),t.lineTo(5,o),t.lineTo(3,o),t.arcTo(0,o,0,0,3),t.lineTo(0,3),t.arcTo(0,0,s,0,3),t.lineTo(s-3,0),t.arcTo(s,0,s,o,3),t.lineTo(s,o-3),t.arcTo(s,o,0,o,3),t.lineTo(12,o),t.fillStyle=u.generateColor(this._data.backgroundColor,this._data.transparency),t.fill(),t.strokeStyle=this._data.borderColor,t.lineWidth=2,t.stroke(),t.closePath(),t.textBaseline="alphabetic",t.fillStyle=this._data.color,t.fillText(this._data.label,n+d,o/2+Math.floor(.35*this._data.fontSize)),t.translate(-.5,-.5),t.beginPath(),t.arc(-9,o+15,2.5,0,2*Math.PI,!1),t.fillStyle=u.generateColor(this._data.borderColor,this._data.transparency),t.fill(),t.strokeStyle=this._chartModel.backgroundColor().value(),t.lineWidth=1,t.stroke(),t.closePath()}}hitTest(e){if(null===this._data||null===this._points||0===this._points.length)return null;var t=this._points[0].x-this._measureCache.tailLeft,i=this._points[0].y-(this._measureCache.innerHeight+this._measureCache.tailHeight),n=s(new r(t,i),new r(t+this._measureCache.innerWidth,i+this._measureCache.innerHeight));return o(e,n)?new d(h.MovePoint):null}}t.PriceLabelPaneView=class extends a{constructor(e,t,i){super(e,t),this._rendererCache={},this._priceLabelRenderer=new v(this._rendererCache,t),this._renderer=null}_updateImpl(){if(super._updateImpl(),this._renderer=null,this._source.points().length>0){var e=this._source.points()[0].price,t=this._source.priceScale();if(!t||t.isEmpty())return;var i=this._source.ownerSource().firstValue();this._priceLabel=t.formatPrice(e,i)}var n={};if(n.points=this._points,n.borderColor=this._source.properties().borderColor.value(),n.backgroundColor=this._source.properties().backgroundColor.value(),n.color=this._source.properties().color.value(),n.fontWeight=this._source.properties().fontWeight.value(),n.fontSize=this._source.properties().fontsize.value(),n.fontFamily=f.CHART_FONT_FAMILY,n.transparency=this._source.properties().transparency.value(),n.label=this._priceLabel,this._priceLabelRenderer.setData(n),1===n.points.length){var r=new c;return r.append(this._priceLabelRenderer),r.append(new l({points:n.points,bgColors:this._lineAnchorColors(n.points),visible:this.areAnchorsVisible()})),void(this._renderer=r)}this._renderer=this._priceLabelRenderer}renderer(e,t){return this._invalidated&&this._updateImpl(),this._renderer}}},29734:(e,t,i)=>{"use strict";i.r(t),i.d(t,{PriceNotePaneView:()=>m});var n=i(50151),r=i(86441),s=i(48891),o=i(19266),a=i(80657),l=i(79191),d=i(4652),h=i(79849),c=i(74359),u=i(46501),p=i(38325),_=i(18807),g=i(68441),f=i(45197);function v(e){let t,i;return e>=-135&&e<=-45?(t="center",i="bottom"):e>-45&&e<45?(t="left",i="middle"):e>=45&&e<=135?(t="center",i="top"):(t="right",i="middle"),{horzAlign:t,vertAlign:i}}class x{constructor(){this._data=null,this._priceLabelRenderer=new a.TextRenderer(void 0,new _.HitTestResult(_.HitTarget.MovePoint,{areaName:_.AreaName.Style,
|
||||
activeItem:1})),this._hittest=new _.HitTestResult(_.HitTarget.MovePoint,{areaName:_.AreaName.Style})}setData(e){this._data=e;const t=e.points[0],i=e.points[1],n=Math.round(180*Math.atan2(i.y-t.y,i.x-t.x)/Math.PI);this._priceLabelRenderer.setData({...v(n),points:[i],text:e.text,color:e.textColor,font:u.CHART_FONT_FAMILY,fontSize:e.fontSize,bold:e.bold,italic:e.italic,offsetX:0,offsetY:0,borderColor:e.borderColor,borderWidth:1,backgroundColor:e.backgroundColor,backgroundRoundRect:4,boxPaddingVert:6,boxPaddingHorz:8})}setHitTest(e){this._hittest=e}draw(e,t){const i=this._data;if(null===i||i.points.length<2)return;e.save();const n=t.pixelRatio,r=Math.round(i.points[0].x*n),s=Math.round(i.points[0].y*n),o=Math.round(i.points[1].x*n),a=Math.round(i.points[1].y*n);e.lineCap="round",(0,g.setLineStyle)(e,h.LINESTYLE_SOLID),e.strokeStyle=i.lineColor,e.fillStyle=i.lineColor,e.lineWidth=Math.round(1*n);const l=(0,f.fillScaledRadius)(2,n);(0,g.createCircle)(e,r,s,l),e.fill(),void 0!==i.excludeBoundaries&&(e.save(),(0,c.addExclusionArea)(e,t,i.excludeBoundaries)),(0,g.drawLine)(e,r,s,o,a),void 0!==i.excludeBoundaries&&e.restore(),this._priceLabelRenderer.draw(e,t);const d=1*n;e.strokeStyle=i.circleBorderColor,e.lineWidth=d;const u=l+d/2;(0,g.createCircle)(e,r,s,u),e.stroke(),e.restore()}hitTest(e){const t=this._data;if(null===t)return null;const i=(0,p.lastMouseOrTouchEventInfo)().isTouch?20:3;return(0,d.distanceToSegment)(t.points[0],t.points[1],e).distance<=i?this._hittest:this._priceLabelRenderer.hitTest(e)}}class m extends l.LineSourcePaneView{constructor(){super(...arguments),this._renderer=new o.CompositeRenderer,this._priceNoteRenderer=new x,this._customLabelRenderer=new a.TextRenderer}renderer(e,t){return this._invalidated&&this._updateImpl(e,t),this._renderer}_updateImpl(e,t){var i;super._updateImpl(),this._renderer.clear();const o=this._source.priceScale();if(!o||o.isEmpty())return;const l=this._points;if(l.length<2)return;const d=(0,n.ensureNotNull)(this._source.ownerSource()).firstValue();if(null===d)return;const h=this._source.properties().childs(),c=this._model.dark().value()?s.colorsPalette["color-cold-gray-900"]:s.colorsPalette["color-white"],p=this._source.points()[0].price,_={text:o.formatPrice(p,d),points:l,lineColor:h.lineColor.value(),circleBorderColor:c,backgroundColor:h.priceLabelBackgroundColor.value(),borderColor:h.priceLabelBorderColor.value(),textColor:h.priceLabelTextColor.value(),fontSize:h.priceLabelFontSize.value(),bold:h.priceLabelBold.value(),italic:h.priceLabelItalic.value()};if(h.showLabel&&h.showLabel.value()){const n=l[0],s=l[1],o=n.x<s.x?n:s,d=o===n?s:n,c=h.vertLabelsAlign.value(),p=h.horzLabelsAlign.value();let g;g="left"===p?o.clone():"right"===p?d.clone():new r.Point((n.x+s.x)/2,(n.y+s.y)/2);const f=Math.atan((d.y-o.y)/(d.x-o.x)),v={points:[g],text:h.text.value(),color:h.textColor.value(),vertAlign:c,horzAlign:p,font:u.CHART_FONT_FAMILY,offsetX:0,offsetY:0,bold:h.bold.value(),italic:h.italic.value(),fontsize:h.fontSize.value(),forceTextAlign:!0,angle:f};this._customLabelRenderer.setData(v),
|
||||
this._renderer.append(this._customLabelRenderer),"middle"===c&&(_.excludeBoundaries=null!==(i=(0,a.getTextBoundaries)(this._customLabelRenderer,t,e))&&void 0!==i?i:void 0)}this._renderer.append(this._priceNoteRenderer),this._priceNoteRenderer.setData(_),this._renderer.append(this.createLineAnchor({points:l},0))}}},61416:(e,t,i)=>{"use strict";i.r(t),i.d(t,{PriceRangePaneView:()=>v});var n=i(50151),r=i(86441),s=i(38223),o=i(80657),a=i(72739),l=i(99031),d=i(19266),h=i(93572),c=i(79849),u=i(73436),p=i(57322),_=i(46501),g=i(99734);const f=new h.PercentageFormatter;class v extends g.DateAndPriceRangeBasePaneView{constructor(){super(...arguments),this._topBorderRenderer=new l.TrendLineRenderer,this._bottomBorderRenderer=new l.TrendLineRenderer,this._distanceRenderer=new l.TrendLineRenderer,this._backgroundRenderer=new a.RectangleRenderer,this._labelRenderer=new o.TextRenderer,this._renderer=new d.CompositeRenderer,this._pipFormatter=null,this._lastSymbolInfo=null}renderer(e,t){return this._invalidated&&this._updateImpl(e,t),this._renderer}_updateImpl(e,t){var i,a,l;if(super._updateImpl(),this._renderer.clear(),this._points.length<2||this._source.points().length<2)return;const d=this._source.properties().childs(),h=d.extendLeft.value(),g=d.extendRight.value(),[v,x]=this._points,m=Math.min(v.x,x.x),w=Math.max(v.x,x.x);d.fillBackground.value()&&(this._backgroundRenderer.setData({points:[new r.Point(m,v.y),new r.Point(w,x.y)],color:"white",linewidth:0,backcolor:d.backgroundColor.value(),fillBackground:!0,transparency:d.backgroundTransparency.value(),extendLeft:h,extendRight:g}),this._renderer.append(this._backgroundRenderer));const R=(e,t,i)=>{e.setData({points:[t,i],color:d.linecolor.value(),linewidth:d.linewidth.value(),linestyle:c.LINESTYLE_SOLID,extendleft:h,extendright:g,leftend:u.LineEnd.Normal,rightend:u.LineEnd.Normal}),this._renderer.append(e)};let y=m,T=w;y===T&&(h&&(y-=1),g&&(T+=1)),R(this._topBorderRenderer,new r.Point(y,v.y),new r.Point(T,v.y)),R(this._bottomBorderRenderer,new r.Point(y,x.y),new r.Point(T,x.y));const b=Math.round((v.x+x.x)/2),P=new r.Point(b,v.y),L=new r.Point(b,x.y),S=this._updateCustomTextRenderer(e,t);this._distanceRenderer.setData({points:[P,L],color:d.linecolor.value(),linewidth:d.linewidth.value(),linestyle:c.LINESTYLE_SOLID,extendleft:!1,extendright:!1,leftend:u.LineEnd.Normal,rightend:Math.abs(P.y-L.y)>=15*d.linewidth.value()?u.LineEnd.Arrow:u.LineEnd.Normal,excludeBoundaries:null!=S?S:void 0}),this._renderer.append(this._distanceRenderer);const C=this._source.points()[0].price,M=this._source.points()[1].price,I=M-C,A=100*I/Math.abs(C),k=this._model.mainSeries().symbolInfo();k&&k!==this._lastSymbolInfo&&(this._pipFormatter=new p.PipFormatter(k.pricescale,k.minmov,k.type,k.minmove2,k.typespecs),this._lastSymbolInfo=k);const N=(0,n.ensureNotNull)(this._source.ownerSource()).formatter(),D=null!==(a=null===(i=N.formatChange)||void 0===i?void 0:i.call(N,M,C))&&void 0!==a?a:N.format(I),B=(0,s.forceLTRStr)(D+" ("+f.format(A)+") "+(this._pipFormatter?this._pipFormatter.format(I):""));let z
|
||||
;z=M>C?new r.Point(.5*(v.x+x.x),x.y-2*d.fontsize.value()):new r.Point(.5*(v.x+x.x),x.y+.7*d.fontsize.value());const E={x:0,y:10},H=d.fontsize.value(),O={points:[z],text:B,color:d.textcolor.value(),font:_.CHART_FONT_FAMILY,offsetX:E.x,offsetY:E.y,padding:8,vertAlign:"middle",horzAlign:"center",fontsize:H,backgroundRoundRect:4,backgroundHorzInflate:.4*H,backgroundVertInflate:.2*H};(null===(l=d.fillLabelBackground)||void 0===l?void 0:l.value())&&(O.boxShadow={shadowColor:d.shadow.value(),shadowBlur:4,shadowOffsetY:1},O.backgroundColor=d.labelBackgroundColor.value()),this._labelRenderer.setData(O);const V=this._labelRenderer.measure(),W=(0,o.calculateLabelPosition)(V,v,x,E,e);this._labelRenderer.setPoints([W]),this._renderer.append(this._labelRenderer),this._renderer.append(this._customTextrenderer),this.addAnchors(this._renderer)}_needLabelExclusionPath(e){return e.getLinesInfo().lines.length>0}}},75219:(e,t,i)=>{"use strict";var n=i(81139).ArcWedgeRenderer,r=i(60322).FibWedgePaneView,s=i(99031).TrendLineRenderer,o=i(19266).CompositeRenderer,a=i(73436).LineEnd;t.ProjectionLinePaneView=class extends r{constructor(e,t){super(e,t),this._baseTrendRenderer=new s,this._edgeTrendRenderer=new s,this._arcWedgeRenderer=new n}renderer(e,t){return this._invalidated&&this._updateImpl(),this._renderer}_updateRenderer(){if(!(this._points.length<2)){var e=new o,t=this._source.properties(),i=this._points,n=i[0],r=i[1],s={points:[n,r],width:this._model.timeScale().width(),height:this._source.priceScale().height(),color:t.trendline.color.value(),linewidth:t.linewidth.value(),linestyle:t.trendline.linestyle.value(),extendleft:!1,extendright:!1,leftend:a.Normal,rightend:a.Normal};if(this._baseTrendRenderer.setData(s),e.append(this._baseTrendRenderer),this._points.length<3)return this.addAnchors(e),void(this._renderer=e);var l=i[2],d=l.data,h=r.subtract(n).length(),c=l.subtract(n).normalized();(l=n.add(c.scaled(h))).data=d,s={points:[n,l],width:this._model.timeScale().width(),height:this._source.priceScale().height(),color:t.trendline.color.value(),linewidth:t.linewidth.value(),linestyle:t.trendline.linestyle.value(),extendleft:!1,extendright:!1,leftend:a.Normal,rightend:a.Normal},this._edgeTrendRenderer.setData(s),e.append(this._edgeTrendRenderer);var u=this._levels[0],p={};p.center=this._points[0],p.radius=u.radius,p.prevRadius=0,p.edge=this._edge,p.color=t.trendline.color.value(),p.color1=t.color1.value(),p.color2=t.color2.value(),p.linewidth=t.linewidth.value(),p.edge1=this._edge1,p.edge2=this._edge2,p.p1=u.p1,p.p2=u.p2,p.fillBackground=t.fillBackground.value(),p.transparency=t.transparency.value(),p.gradient=!0,this._arcWedgeRenderer.setData(p),e.append(this._arcWedgeRenderer),this.addAnchors(e),this._renderer=e}}}},31320:(e,t,i)=>{"use strict";i.r(t),i.d(t,{RectanglePaneView:()=>h});var n=i(86441),r=i(46501),s=i(72739),o=i(19266),a=i(80657),l=i(79191),d=i(66103);class h extends l.LineSourcePaneView{constructor(e,t){super(e,t),this._rectangleRenderer=new s.RectangleRenderer,this._textRenderer=new a.TextRenderer,this._renderer=null}
|
||||
renderer(e,t){return this._invalidated&&this._updateImpl(),this._renderer}_updateImpl(){if(super._updateImpl(),this._renderer=null,this._points.length<2)return;const e=this._getSource().properties().childs(),t={points:this._points,color:e.color.value(),linewidth:e.linewidth.value(),backcolor:e.backgroundColor.value(),fillBackground:e.fillBackground.value(),transparency:e.transparency.value(),extendLeft:e.extendLeft.value(),extendRight:e.extendRight.value()};this._rectangleRenderer.setData(t);const i=new o.CompositeRenderer;i.append(this._rectangleRenderer);const s=this._points[0],a=this._points[1];if(e.showLabel.value()){const t=Math.min(s.x,a.x),o=Math.max(s.x,a.x),l=Math.min(s.y,a.y),d=Math.max(s.y,a.y);let h,c,u,p;const _=e.fontSize.value()/3;let g,f,v=0;switch(e.vertLabelsAlign.value()){case"middle":p=(l+d)/2,c="middle",v=_;break;case"top":p=d,c="top";break;case"bottom":p=l,c="bottom"}switch(e.horzLabelsAlign.value()){case"center":u=(t+o)/2,h="center";break;case"left":u=t,h="left";break;case"right":u=o,h="right"}"middle"===c&&(g=o-t-2*v,f=d-l);const x={points:[new n.Point(u,p)],text:e.text.value(),fontSize:e.fontSize.value(),font:r.CHART_FONT_FAMILY,bold:e.bold.value(),italic:e.italic.value(),horzAlign:h,vertAlign:c,color:e.textColor.value(),wordWrapWidth:g,maxHeight:f,offsetX:0,offsetY:0,boxPaddingVert:_,boxPaddingHorz:v,forceTextAlign:!0};this._textRenderer.setData(x),i.append(this._textRenderer)}this._addAnchors(s,a,i),this._renderer=i}_addAnchors(e,t,i){const r=new n.Point(e.x,t.y);r.data=2;const s=new n.Point(t.x,e.y);s.data=3;const o=new n.Point(e.x,.5*(e.y+t.y));o.data=4;const a=new n.Point(t.x,.5*(e.y+t.y));a.data=5;const l=new n.Point(.5*(e.x+t.x),e.y);l.data=6;const h=new n.Point(.5*(e.x+t.x),t.y);h.data=7,[o,a,l,h].forEach((e=>e.square=!0));const c=e.x-t.x,u=e.y-t.y,p=Math.sign(c*u),_=[p<0?d.PaneCursorType.DiagonalNeSwResize:d.PaneCursorType.DiagonalNwSeResize,p<0?d.PaneCursorType.DiagonalNeSwResize:d.PaneCursorType.DiagonalNwSeResize,p>0?d.PaneCursorType.DiagonalNeSwResize:d.PaneCursorType.DiagonalNwSeResize,p>0?d.PaneCursorType.DiagonalNeSwResize:d.PaneCursorType.DiagonalNwSeResize,d.PaneCursorType.HorizontalResize,d.PaneCursorType.HorizontalResize,d.PaneCursorType.VerticalResize,d.PaneCursorType.VerticalResize];i.append(this.createLineAnchor({points:[e,t,r,s,o,a,l,h],pointsCursorType:_},0))}}},5374:(e,t,i)=>{"use strict";i.r(t),i.d(t,{RegressionTrendPaneView:()=>g});var n=i(50151),r=i(87095),s=i(18807),o=i(19266),a=i(28621),l=i(80657),d=i(99031),h=i(80101),c=i(86441),u=i(73436),p=i(46501);var _=i(79191);class g extends _.LineSourcePaneView{constructor(e,t){super(e,t),this._data=null,this._pearsonsLabelRenderer=new l.TextRenderer,this._renderer=null,this._renderer=null}renderer(){return this._invalidated&&this._updateImpl(),this._renderer}_updateImpl(){super._updateImpl(),this._data=function(e,t){const i={lines:[],pearsons:null};if(!t.properties().visible.value())return i;const r=e.timeScale(),s=t.priceScale(),o=e.mainSeries().firstBar();if(!s||s.isEmpty()||r.isEmpty()||!o)return i
|
||||
;const a=t.startIndex(),l=t.endIndex();if(null===a||null===l)return i;const d=[t.baseLine(),t.downLine(),t.upLine()],h=Math.round(r.indexToCoordinate(a)),_=Math.round(r.indexToCoordinate(l)),g=t.properties(),f=[g.styles.baseLine,g.styles.downLine,g.styles.upLine],v=o[4];for(let r=0;r<d.length;r++){if(1!=(1&f[r].display.value()))continue;const o=(0,n.ensureNotNull)(d[r]).startPrice,a=(0,n.ensureNotNull)(d[r]).endPrice;if(void 0===o||void 0===a)continue;const l=s.priceToCoordinate(o,v),p=s.priceToCoordinate(a,v),x=new c.Point(h,l),m=new c.Point(_,p),w=f[r].color.value(),R=f[r].linewidth.value(),y=f[r].linestyle.value(),T={points:[x,m],width:e.timeScale().width(),height:(0,n.ensureNotNull)(t.priceScale()).height(),color:w,linewidth:R,linestyle:y,extendleft:!1,extendright:g.styles.extendLines.value(),leftend:u.LineEnd.Normal,rightend:u.LineEnd.Normal};i.lines.push(T)}const x=(0,n.ensureNotNull)(t.downLine());if(g.styles.showPearsons.value()&&void 0!==x.startPrice){const e=s.priceToCoordinate(x.startPrice,v),n=new c.Point(h,e);i.pearsons={points:[n],text:""+t.pearsons(),color:g.styles.downLine.color.value(),vertAlign:"top",horzAlign:"center",font:p.CHART_FONT_FAMILY,offsetX:0,offsetY:4,fontsize:12}}return i}(this._model,this._source),this._renderer=null;const e=new o.CompositeRenderer;let t=[];const i=[this._data.lines[1],this._data.lines[0],this._data.lines[2]].filter((e=>!!e)),l=this._source.properties().childs().styles.childs().transparency.value();for(let t=1;t<i.length;t++){const n={points:[i[t].points[0],i[t].points[1],i[t-1].points[0],i[t-1].points[1]],color:i[t].color,linewidth:i[t].linewidth,linestyle:i[t].linestyle,extendleft:!1,extendright:i[t].extendright,backcolor:i[t].color,transparency:l,skipLines:!0,fillBackground:!0,showMidline:!1},r=new a.ParallelChannelRenderer(new s.HitTestResult(s.HitTarget.Regular));r.setData(n),e.append(r)}const _=this._getTransparencyResetLines();for(let n=0;n<i.length;n++){const r=new d.TrendLineRenderer;r.setData(_[n]),r.setHitTest(new s.HitTestResult(s.HitTarget.Regular)),e.append(r),0!==n&&(t=t.concat(i[n].points))}this._data.pearsons&&(this._data.pearsons.color=(0,r.resetTransparency)(this._data.pearsons.color),this._pearsonsLabelRenderer.setData(this._data.pearsons),e.append(this._pearsonsLabelRenderer)),this._data.lines.length>=1&&e.append(new h.SelectionRenderer({points:t,bgColors:this._lineAnchorColors(t),visible:this.areAnchorsVisible(),hittestResult:s.HitTarget.Regular,barSpacing:this._model.timeScale().barSpacing()})),this._renderer=e}_getTransparencyResetLines(){return(0,n.ensureNotNull)(this._data).lines.map((e=>({...e,color:(0,r.resetTransparency)(e.color)})))}}},56457:(e,t,i)=>{"use strict";i.r(t),i.d(t,{RiskRewardPaneView:()=>A});var n=i(86441),r=i(50151),s=i(44352),o=i(79191),a=i(99031),l=i(80657),d=i(72739),h=i(18807),c=i(19266),u=i(93572),p=i(87663),_=i(57322),g=i(87095),f=i(73436),v=i(95539),x=i(38223),m=i(66103),w=i(88145),R=i(46501),y=i(79849)
|
||||
;const T=[m.PaneCursorType.Default,m.PaneCursorType.HorizontalResize,m.PaneCursorType.VerticalResize,m.PaneCursorType.VerticalResize],b=s.t(null,void 0,i(72892)),P=s.t(null,{context:"line_tool_position"},i(50140)),L=s.t(null,{context:"line_tool_position"},i(44143)),S=s.t(null,void 0,i(53115)),C=s.t(null,void 0,i(438)),M=s.t(null,void 0,i(15166)),I=s.t(null,void 0,i(87061));class A extends o.LineSourcePaneView{constructor(){super(...arguments),this._percentageFormatter=new u.PercentageFormatter,this._numericFormatter=new p.NumericFormatter,this._pipFormatter=null,this._lastSymbolInfo=null,this._entryLineRenderer=new a.TrendLineRenderer,this._stopLineRenderer=new a.TrendLineRenderer,this._targetLineRenderer=new a.TrendLineRenderer,this._positionLineRenderer=new a.TrendLineRenderer,this._fullStopBgRenderer=new d.RectangleRenderer(new h.HitTestResult(h.HitTarget.MovePoint),new h.HitTestResult(h.HitTarget.MovePoint)),this._stopBgRenderer=new d.RectangleRenderer(new h.HitTestResult(h.HitTarget.MovePoint),new h.HitTestResult(h.HitTarget.MovePoint)),this._fullTargetBgRenderer=new d.RectangleRenderer(new h.HitTestResult(h.HitTarget.MovePoint),new h.HitTestResult(h.HitTarget.MovePoint)),this._targetBgRenderer=new d.RectangleRenderer(new h.HitTestResult(h.HitTarget.MovePoint),new h.HitTestResult(h.HitTarget.MovePoint)),this._stopLabelRenderer=new l.TextRenderer,this._middleLabelRenderer=new l.TextRenderer,this._profitLabelRenderer=new l.TextRenderer,this._renderer=new c.CompositeRenderer}isLabelVisible(){return this.isHoveredSource()||this.isSelectedSource()||this._source.properties().childs().alwaysShowStats.value()}renderer(e,t){return this._invalidated&&this._updateImpl(e,t),this._renderer}_updateImpl(e,t){super._updateImpl(e,t),this._renderer.clear();const i=this._model.timeScale(),s=this._source.priceScale();if(!s||s.isEmpty()||i.isEmpty())return;const o=this._source.points();if(o.length<2||this._points.length<2)return;const a=(0,r.ensureNotNull)(this._source.ownerSource()),l=null==a?void 0:a.barsProvider().bars();if(!l||l.isEmpty())return;if(null===l.last())return;const d=4===o.length,h=this._source.lastBarData();if(!h)return;const c=h.closePrice,u=this._source.stopPrice(),p=this._source.profitPrice(),g=this._source.calculatePL(c),f=a.symbolSource().symbolInfo();if(!f)return;const x=a.firstValue();if(null===x)return;const m=this._points[v.RiskRewardPointIndex.Entry].y,w=s.priceToCoordinate(u,x),R=s.priceToCoordinate(p,x),y=s.priceToCoordinate(h.closePrice,x),b=i.indexToCoordinate(h.index),P=this._points[v.RiskRewardPointIndex.Entry].x,L=this._points[v.RiskRewardPointIndex.ActualEntry]?this._points[v.RiskRewardPointIndex.ActualEntry].x:this._points[v.RiskRewardPointIndex.Close].x,S=this._points[v.RiskRewardPointIndex.ActualClose]?this._points[v.RiskRewardPointIndex.ActualClose].x:this._points[v.RiskRewardPointIndex.Close].x,C=this._points[v.RiskRewardPointIndex.Close].x,M=this._source.entryPrice(),I=this._source.stopPrice(),A=this._source.profitPrice(),k={pl:g,isClosed:d,entryLevel:m,stopLevel:w,profitLevel:R,closeLevel:y,
|
||||
closeBar:b,left:P,entryX:L,right:S,edge:C,entryPrice:M,stopPrice:I,profitPrice:A,currentPrice:c};let N=C<-5||P>t+5;if(this._createBackgroundRenderers(k,this._renderer),this._createLinesRenderers(k,this._renderer),this._createLabelsRenderers(k,this._renderer,f),f!==this._lastSymbolInfo&&(this._pipFormatter=new _.PipFormatter(f.pricescale,f.minmov,f.type,f.minmove2,f.typespecs),this._lastSymbolInfo=f),N=[this._profitLabelRenderer,this._stopLabelRenderer,this._middleLabelRenderer].reduce(((i,n)=>i&&n.isOutOfScreen(t,e)),N),N)return;const D=this._points[0].clone();D.data=0,D.snappingPrice=M;const B=new n.Point(P,w);B.data=2,B.square=!0,B.snappingPrice=I;const z=new n.Point(P,R);z.data=3,z.square=!0,z.snappingPrice=A;const E=new n.Point(C,D.y);E.data=1,E.square=!0,E.snappingIndex=h.index;const H={points:[D,E,B,z],pointsCursorType:T};this._renderer.append(this.createLineAnchor(H,0))}_createBackgroundRenderers(e,t){const i=this._source.properties().childs();{const t={points:[new n.Point(e.left,e.entryLevel),new n.Point(e.edge,e.stopLevel)],color:"white",linewidth:0,backcolor:i.stopBackground.value(),fillBackground:!0,transparency:i.stopBackgroundTransparency.value(),extendLeft:!1,extendRight:!1};this._fullStopBgRenderer.setData(t),this._renderer.append(this._fullStopBgRenderer)}if(e.pl<0&&e.entryX!==e.right){const t=new n.Point(e.entryX,e.entryLevel),r=new n.Point(e.right,e.closeLevel),s=.01*i.stopBackgroundTransparency.value(),o=100-100*(1-s*s*s),a={points:[t,r],color:"white",linewidth:0,backcolor:i.stopBackground.value(),fillBackground:!0,transparency:o,extendLeft:!1,extendRight:!1};this._stopBgRenderer.setData(a),this._renderer.append(this._stopBgRenderer)}{const t={points:[new n.Point(e.left,e.entryLevel),new n.Point(e.edge,e.profitLevel)],color:"white",linewidth:0,backcolor:i.profitBackground.value(),fillBackground:!0,transparency:i.profitBackgroundTransparency.value(),extendLeft:!1,extendRight:!1};this._fullTargetBgRenderer.setData(t),this._renderer.append(this._fullTargetBgRenderer)}if(e.pl>0&&e.entryX!==e.right){const t=new n.Point(e.entryX,e.entryLevel),r=new n.Point(e.right,e.closeLevel),s=.01*i.profitBackgroundTransparency.value(),o=100-100*(1-s*s*s),a={points:[t,r],color:"white",linewidth:0,backcolor:i.profitBackground.value(),fillBackground:!0,transparency:o,extendLeft:!1,extendRight:!1};this._targetBgRenderer.setData(a),this._renderer.append(this._targetBgRenderer)}}_createLinesRenderers(e,t){const i=this._source.properties().childs(),r=(e,t,n,r)=>{const s={points:[t,n],color:null!=r?r:i.linecolor.value(),linewidth:i.linewidth.value(),linestyle:y.LINESTYLE_SOLID,extendleft:!1,extendright:!1,leftend:f.LineEnd.Normal,rightend:f.LineEnd.Normal};e.setData(s),this._renderer.append(e)};if(this._points[v.RiskRewardPointIndex.ActualEntry]){const t={points:[this._points[v.RiskRewardPointIndex.ActualEntry],e.isClosed?this._points[v.RiskRewardPointIndex.ActualClose]:new n.Point(e.closeBar,e.closeLevel)],color:this._source.properties().childs().linecolor.value(),linewidth:1,linestyle:y.LINESTYLE_DASHED,extendleft:!1,
|
||||
extendright:!1,leftend:f.LineEnd.Normal,rightend:f.LineEnd.Arrow};this._positionLineRenderer.setData(t),this._renderer.append(this._positionLineRenderer)}{const t=new n.Point(e.left,this._points[v.RiskRewardPointIndex.Entry].y),i=new n.Point(e.edge,this._points[v.RiskRewardPointIndex.Entry].y);r(this._entryLineRenderer,t,i)}{const t=new n.Point(e.left,e.stopLevel),s=new n.Point(e.edge,e.stopLevel);r(this._stopLineRenderer,t,s,i.stopBackground.value())}{const t=new n.Point(e.left,e.profitLevel),s=new n.Point(e.edge,e.profitLevel);r(this._targetLineRenderer,t,s,i.profitBackground.value())}}_addCenterLabel(e,t,i){const n=this._source.properties().childs(),r={font:R.CHART_FONT_FAMILY,offsetX:3,horzAlign:"center",backgroundRoundRect:4,backgroundHorzInflate:4,points:[i.p],text:i.txt,color:n.textcolor.value(),offsetY:i.offsetY,vertAlign:i.vertAlign,backgroundColor:(0,g.resetTransparency)(i.color),fontsize:n.fontsize.value(),borderColor:i.border};return t.setData(r),e.append(t),r}_creareMiddleLabel(e,t,i){const{entryPrice:s,profitPrice:o,stopPrice:a,currentPrice:l,pl:d,left:h,edge:c,isClosed:u}=e,p=Math.abs(s-o)/Math.abs(s-a),_=this._source.properties().childs(),g=(0,r.ensureNotNull)(this._source.ownerSource()),f=new n.Point((h+c)/2,Math.round(this._points[0].y));let v="",x="";const m=this._numericFormatter.format(Math.round(100*p)/100);if(this._points[1]){const e=g.formatter();if(e.formatChange){const t=Math.max(l,s),i=Math.min(l,s);x=d>=0?e.formatChange(t,i):e.formatChange(i,t)}else x=e.format(d)}const R=_.qty.value()/_.lotSize.value(),y="futures"===i.type||(0,w.hasCryptoTypespec)(i.typespecs||[])?Math.round(1e3*R)/1e3:Math.floor(R);if(_.compact.value())v+=x?x+" ~ ":"",v+=y+"\n",v+=m;else{const e=u?L:P;v+=x?b.format({status:e,pnl:x})+", ":"",v+=I.format({qty:""+y})+"\n",v+=S.format({ratio:m})+" "}let T=_.linecolor.value();return d<0?T=_.stopBackground.value():d>0&&(T=_.profitBackground.value()),this._addCenterLabel(t,this._middleLabelRenderer,{p:f,txt:v,color:T,vertAlign:"middle",offsetY:0,border:"white"})}_createStopLabel(e,t){var i,s;const{stopPrice:o,entryPrice:a,left:l,edge:d,stopLevel:h}=e,c=this._source.properties().childs(),u=(0,r.ensureNotNull)(this._source.ownerSource()),p=Math.abs(o-a),_=Math.round(1e4*p/a)/100,g=new n.Point((l+d)/2,h);let f="";const v=u.formatter(),m=null!==(s=null===(i=v.formatChange)||void 0===i?void 0:i.call(v,Math.max(o,a),Math.min(o,a)))&&void 0!==s?s:v.format(p),w=this._percentageFormatter.format(_);return f=c.compact.value()?m+" ("+w+") "+c.amountStop.value():C.format({stopChange:(0,x.forceLTRStr)(m),stopChangePercent:(0,x.forceLTRStr)(this._percentageFormatter.format(_)),stopChangePip:this._pipFormatter?(0,x.forceLTRStr)(this._pipFormatter.format(p)):"",amount:(0,x.forceLTRStr)(""+c.amountStop.value())}),this._addCenterLabel(t,this._stopLabelRenderer,{p:g,txt:f,color:c.stopBackground.value(),vertAlign:a<o?"bottom":"top",offsetY:0})}_createTargetLabel(e,t){var i,s;const{profitPrice:o,entryPrice:a,stopPrice:l,left:d,edge:h,profitLevel:c}=e,u=this._source.properties().childs(),p=(0,
|
||||
r.ensureNotNull)(this._source.ownerSource()),_=Math.abs(o-a),g=Math.round(1e4*_/a)/100,f=new n.Point((d+h)/2,c);let v="";const m=p.formatter(),w=null!==(s=null===(i=m.formatChange)||void 0===i?void 0:i.call(m,Math.max(o,a),Math.min(o,a)))&&void 0!==s?s:m.format(_),R=this._percentageFormatter.format(g);return v=u.compact.value()?w+" ("+R+") "+u.amountTarget.value():M.format({profitChange:w,profitChangePercent:(0,x.forceLTRStr)(this._percentageFormatter.format(g)),profitChangePip:this._pipFormatter?(0,x.forceLTRStr)(this._pipFormatter.format(_)):"",amount:(0,x.forceLTRStr)(""+u.amountTarget.value())}),this._addCenterLabel(t,this._profitLabelRenderer,{p:f,txt:v,color:u.profitBackground.value(),vertAlign:a<l?"top":"bottom",offsetY:0})}_createLabelsRenderers(e,t,i){var s;if(!this.isLabelVisible())return;const o=this._creareMiddleLabel(e,t,i),a=this._createStopLabel(e,t),l=this._createTargetLabel(e,t),d=[this._profitLabelRenderer,this._stopLabelRenderer,this._middleLabelRenderer].reduce(((e,t)=>Math.max(e,t.measure().width)),0),h=e.edge-e.left,c=this._anchorRadius();if(h-d-c<=8&&(l&&(l.offsetY+=c+8,this._profitLabelRenderer.setData(l)),a&&(a.offsetY+=c+8,this._stopLabelRenderer.setData(a)),o)){let t;if(null===(s=this._source.priceScale())||void 0===s?void 0:s.isLog()){const i=Math.abs(this._points[0].y-e.stopLevel);t=Math.abs(this._points[0].y-e.profitLevel)>i?-1:1}else{const i=Math.abs(e.stopPrice-e.entryPrice);t=Math.abs(e.profitPrice-e.entryPrice)>i?-1:1}const i=e.profitLevel<e.stopLevel?1:-1,a=(0,r.ensureDefined)(o.points)[0].add(new n.Point(0,i*t*(.5*this._middleLabelRenderer.measure().height+c+8)));o.points=[a],this._middleLabelRenderer.setData(o)}}}},55832:(e,t,i)=>{"use strict";var n=i(86441).Point,r=i(4652).distanceToLine,s=i(79191).LineSourcePaneView,o=i(79191).thirdPointCursorType,a=i(99031).TrendLineRenderer,l=i(79797).PolygonRenderer,d=i(19266).CompositeRenderer,h=i(73436).LineEnd,c=i(66103).PaneCursorType;const{LINESTYLE_SOLID:u}=i(79849);t.RotatedRectanglePaneView=class extends s{constructor(e,t){super(e,t),this._poligonRenderer=new l,this._renderer=null}_updateImpl(){if(super._updateImpl(),this._renderer=null,this._distance=0,3===this._points.length&&(this._distance=r(this._points[0],this._points[1],this._points[2]).distance),0!==this._points.length){var e,t,i,s,l=new d,p=this._source.properties(),_=this._points[0],g=this._points[1];if(2===this._points.length){(v={}).points=this._points,v.floatPoints=this._floatPoints,v.width=this._model.timeScale().width(),v.height=this._source.priceScale().height(),v.color=p.color.value(),v.linewidth=1,v.linestyle=u,v.extendleft=!1,v.extendright=!1,v.leftend=h.Normal,v.rightend=h.Normal;var f=new a;f.setData(v),l.append(f)}else if(3===this._points.length){var v,x=g.subtract(_),m=new n(x.y,-x.x).normalized().scaled(this._distance),w=m.scaled(-1);e=_.add(m),t=g.add(m),i=_.add(w),s=g.add(w),(v={}).points=[e,t,s,i],v.color=p.color.value(),v.linewidth=this._source.properties().linewidth.value(),v.linestyle=u,v.filled=!0,v.backcolor=p.backgroundColor.value(),
|
||||
v.fillBackground=p.fillBackground.value(),v.transparency=p.transparency.value(),this._poligonRenderer.setData(v),l.append(this._poligonRenderer)}var R=[];R.push(_),this._points.length>=2&&R.push(g);var y=[c.Default,c.Default];if(3===this._points.length){e.data=2,i.data=2,t.data=2,s.data=2,R.push(e,i,t,s);var T=o(_,g);y.push(T,T,T,T)}l.append(this.createLineAnchor({points:R,pointsCursorType:y},0)),this._renderer=l}}renderer(e,t){return this._invalidated&&this._updateImpl(),this._renderer}}},26294:(e,t,i)=>{"use strict";i.r(t),i.d(t,{SignpostPaneView:()=>L});var n=i(86441),r=i(48891),s=i(19266),o=i(66103),a=i(18807),l=i(79191),d=i(85573),h=i(46501),c=i(4652),u=i(34026),p=i(50151),_=i(38325),g=i(80657),f=i(45197);function v(e){return void 0===e?0:e.poleTailHeight+2*e.circleRadius}function x(e){return e.poleStartY}function m(e){return e.inverseAnchorPosition?e.anchorY:e.anchorY+(e.labelHeight+v(e.plate))*e.direction}function w(e){return e.inverseAnchorPosition?e.anchorY+v(e.plate)*e.direction:e.anchorY+e.labelHeight*e.direction}class R{constructor(e,t){this._data=null,this._hitTestResult=e,this._phantomMode=Boolean(t)}setData(e){if(null===e)return void(this._data=null);this._data={...e,labelHeight:0,labelRenderer:new g.TextRenderer};const t=this._data,i=t.label,r={offsetX:0,offsetY:0,points:[new n.Point(t.x,t.anchorY)],forceCalculateMaxLineWidth:!0,vertAlign:-1===i.labelDirection?"bottom":"top",horzAlign:"center",horzTextAlign:"center",font:i.labelFont,fontSize:i.labelFontSize,bold:i.labelFontBold,italic:i.labelFontItalic,backgroundRoundRect:i.labelBorderRadius,padding:i.labelPadding,boxPaddingVert:i.labelBoxPaddingVert,boxPaddingHorz:i.labelBoxPaddingHorz,wordWrapWidth:i.labelWordWrapWidth,color:i.labelColor,borderColor:i.labelBorderColor,borderWidth:1,backgroundColor:i.labelBackgroundColor,text:i.text};if(t.labelRenderer.setData(r),this._data.labelHeight=this._data.labelRenderer.measure().height,t.inverseAnchorPosition){const e=(0,p.ensureDefined)(r.points);r.points=[new n.Point(e[0].x,w(t))]}else{const e=1===t.direction?Math.min(t.poleStartY-this._data.labelHeight,t.anchorY):Math.max(t.poleStartY+this._data.labelHeight,t.anchorY);t.anchorY!==e&&(t.anchorY=e,r.points=[new n.Point(t.x,e)])}t.labelRenderer.setData(r)}itemAnchorY(){return null===this._data?null:this._data.anchorY}hitTest(e,t){if(null===this._data)return null;const[i,r,s]=function(e,t){const i=(0,_.lastMouseOrTouchEventInfo)().isTouch?20:3,r=e.x,s=e.plate,o=(0,c.distanceToSegment)(new n.Point(r,x(e)),new n.Point(r,m(e)),t).distance<i;let a=!1;if(!o&&void 0!==s){const o=e.inverseAnchorPosition?e.anchorY+s.circleRadius*e.direction:e.anchorY+(e.labelHeight+s.poleTailHeight+s.circleRadius)*e.direction;a=s.circleRadius>0&&(0,u.pointInCircle)(t,new n.Point(r,o),s.circleRadius+i)}return[o,a,!o&&!a&&null!==e.labelRenderer.hitTest(t)]}(this._data,e);if(i||r||s){const e={hideCrosshairLinesOnHover:!0,activeItem:i||r?this._data.itemIndex:this._data.label.labelIndex};return s?e.areaName=a.AreaName.Text:r&&(e.areaName=a.AreaName.Style),
|
||||
new a.HitTestResult(this._hitTestResult,e)}return null}draw(e,t){if(null===this._data)return;e.save(),this._phantomMode&&(e.globalAlpha=.5);const{poleColor:i,emojiRadius:n}=this._data,r=t.pixelRatio,s=Math.max(1,Math.floor(r)),o=s%2?.5:0;e.beginPath(),e.strokeStyle=i,e.lineWidth=s;const a=Math.round(this._data.x*r)+o;e.moveTo(a,Math.round(x(this._data)*r)),e.lineTo(a,Math.round(m(this._data)*r)),void 0!==this._data.plate&&0!==this._data.plate.poleTailHeight&&(e.moveTo(a,Math.round(w(this._data)*r)),e.lineTo(a,Math.round(function(e){var t,i;const n=null!==(i=null===(t=e.plate)||void 0===t?void 0:t.poleTailHeight)&&void 0!==i?i:0;return e.inverseAnchorPosition?w(e)-n*e.direction:w(e)+n*e.direction}(this._data)*r))),e.stroke(),void 0!==this._data.plate&&function(e,t,i,n,r){const s=r.pixelRatio,{circleRadius:o,poleTailHeight:a,circleBorderColor:l,circleBackgroundColor:d}=i;e.strokeStyle=l,e.fillStyle=d;const h=(0,f.fillScaledRadius)(o,s),c=Math.round(t.x*s),u=t.inverseAnchorPosition?Math.round(t.anchorY*s)+Math.round(o*s)*t.direction:Math.round(t.anchorY*s)+Math.round((t.labelHeight+a+o)*s)*t.direction,p=Math.max(1,Math.floor(s))%2/2,_=c+p,g=u+p;if(e.shadowOffsetY=1,e.shadowColor=i.shadowColor,e.shadowBlur=4,e.beginPath(),e.arc(_,g,h,0,2*Math.PI,!0),e.closePath(),e.fill(),e.shadowColor="transparent",t.svgRenderer){const i=2*(0,f.fillScaledRadius)(n,s);t.svgRenderer.render(e,{targetViewBox:{x:_-i/2,y:g-i/2,width:i,height:i}})}const v=Math.round(i.circleBorderWidth*s),x=(0,f.strokeScaledRadius)(o,s,v);if(e.lineWidth=v,e.beginPath(),e.arc(_,g,x,0,2*Math.PI,!0),e.closePath(),e.stroke(),i.outsideBorderWidth){e.save();const t=Math.round(i.outsideBorderWidth*s),n=x+v/2+t/2;e.lineWidth=t,e.strokeStyle=i.outsideBorderColor,e.beginPath(),e.arc(_,g,n,0,2*Math.PI,!0),e.closePath(),e.stroke(),e.restore()}}(e,this._data,this._data.plate,n,t),this._data.labelRenderer.draw(e,t),e.restore()}}var y=i(68616),T=i(69798);const b={circleBorderColor:(0,r.getHexColorByName)("color-cold-gray-900"),labelBackgroundColor:(0,r.getHexColorByName)("color-cold-gray-900"),labelBorderColor:(0,r.getHexColorByName)("color-cold-gray-800"),labelTextColor:(0,r.getHexColorByName)("color-cold-gray-200"),poleColor:(0,r.getHexColorByName)("color-cold-gray-500"),shadowColor:"rgba(0,0,0,0.4)",selectionColor:(0,r.getHexColorByName)("color-tv-blue-500")},P={circleBorderColor:(0,r.getHexColorByName)("color-white"),labelBackgroundColor:(0,r.getHexColorByName)("color-white"),labelBorderColor:(0,r.getHexColorByName)("color-cold-gray-150"),labelTextColor:(0,r.getHexColorByName)("color-cold-gray-900"),poleColor:(0,r.getHexColorByName)("color-cold-gray-500"),shadowColor:"rgba(0,0,0,0.2)",selectionColor:(0,r.getHexColorByName)("color-tv-blue-500")};class L extends l.LineSourcePaneView{constructor(e,t){super(e,t),this._renderer=new s.CompositeRenderer,this._emojiCache=null,this._destroyed=!1,this._signpostRenderer=new R(a.HitTarget.MovePoint,e.isPhantom()),e.properties().childs().emoji.subscribe(this,this._updateEmoji),this._updateEmoji()}destroy(){
|
||||
this._source.properties().childs().emoji.unsubscribeAll(this),this._destroyed=!0}renderer(e,t){return this._invalidated&&this._updateImpl(e,t),this._renderer}_updateImpl(e,t){if(super._updateImpl(),this._renderer.clear(),!this._updateTimelineRenderer(e))return;if(this._renderer.append(this._signpostRenderer),this._source.isPhantom())return;const i=this._itemAnchorY();if(null===i)return;const r=this._points[0],s=new n.Point(r.x,i);s.data=r.data,s.square=!0,this._renderer.append(this.createLineAnchor({points:[s],pointsCursorType:[o.PaneCursorType.VerticalResize]},0))}_itemAnchorY(){return this._signpostRenderer.itemAnchorY()}_updateTimelineRenderer(e){var t;const i=this._source.ownerSource();if(null===i)return!1;const n=this._model.timeScale(),r=i.priceScale(),s=i.firstValue();if(n.isEmpty()||null===r||r.isEmpty()||null===s)return!1;const o=this._model.dark().value()?b:P,a=this._model.mainSeries(),l=this._source.properties().childs(),c=l.position.value(),u=this._source.customEvent(),p=i===a?(0,d.getSeriesPosition)(a,u):(0,d.getNoDataPosition)(u,r,s);if(null===p)return!1;const _=n.indexToCoordinate(p.index),g=r.priceToCoordinate(p.price,s),f=l.showImage.value();let v=(0,d.positionToCoordinate)(c,e,g,p.positionPointDirection);v>=-1e-10&&v<=e+1e-10&&(v=Math.min(e-2,Math.max(2,v)));const x=p.visualDirection!==p.positionPointDirection,m=p.visualDirection,w={emojiRadius:16,poleColor:o.poleColor,svgRenderer:null===(t=this._emojiCache)||void 0===t?void 0:t.emojiSvgRenderer,itemIndex:1,label:{labelIndex:1,labelDirection:p.positionPointDirection,labelFont:h.CHART_FONT_FAMILY,labelFontSize:l.fontSize.value(),labelFontBold:l.bold.value(),labelFontItalic:l.italic.value(),labelBorderRadius:4,labelPadding:3,labelBoxPaddingVert:6,labelBoxPaddingHorz:8,labelWordWrapWidth:134,labelColor:o.labelTextColor,labelBorderColor:o.labelBorderColor,labelBackgroundColor:o.labelBackgroundColor,text:l.text.value()},x:_,anchorY:v,poleStartY:p.poleStartY,direction:m*(x?-1:1),inverseAnchorPosition:x};return f&&(w.plate={circleBackgroundColor:l.backgroundsColors.value(),outsideBorderWidth:0,circleBorderColor:o.circleBorderColor,circleBorderWidth:1,poleTailHeight:l.text.value()?10:0,circleRadius:35,shadowColor:o.shadowColor,outsideBorderColor:o.selectionColor}),this._signpostRenderer.setData(w),!0}async _updateEmoji(){var e;const t=this._source.properties().childs().emoji.value();if(null!==this._emojiCache&&this._emojiCache.emoji===t)return;null!==this._emojiCache&&(null===(e=this._emojiCache.abortController)||void 0===e||e.abort(),this._emojiCache.abortController=void 0);const n=(0,y.getTwemojiUrl)(t,"svg"),r=new AbortController,s=(0,T.fetch)(n,{signal:r.signal}).then((e=>e.text())),o={emoji:t,abortController:r};this._emojiCache=o;const[a,{svgRenderer:l}]=await Promise.all([s,i.e(2616).then(i.bind(i,50765))]);!this._destroyed&&o.abortController&&(o.emojiSvgRenderer=l(a),this._model.updateSource(this._source))}}},5362:(e,t,i)=>{"use strict";i.r(t),i.d(t,{SineLinePaneView:()=>h});var n=i(86441),r=i(79191),s=i(19266),o=i(15187),a=i(18807),l=i(68441)
|
||||
;class d extends o.MediaCoordinatesPaneRenderer{constructor(e){super(),this._data=e}hitTest(e,t){const i=(e.x-this._data.point.x)*Math.PI/this._data.width;let n=Math.sin(i-Math.PI/2)*this._data.height/2;return n=this._data.point.y+n+this._data.height/2,Math.abs(n-e.y)<=3?new a.HitTestResult(a.HitTarget.MovePoint):null}_drawImpl(e){const t=e.context;t.strokeStyle=this._data.color,t.lineWidth=this._data.lineWidth,(0,l.setLineStyle)(t,this._data.lineStyle),t.beginPath(),t.moveTo(this._data.point.x,this._data.point.y);const i=Math.max(1,this._data.width/30),n=e.mediaSize.width-this._data.point.x+i;for(let e=1;e<=n;e+=i){const i=e*Math.PI/this._data.width,n=Math.sin(i-Math.PI/2)*this._data.height/2;t.lineTo(this._data.point.x+e,this._data.point.y+n+this._data.height/2)}t.stroke()}}class h extends r.LineSourcePaneView{constructor(e,t){super(e,t),this._renderer=new s.CompositeRenderer}renderer(e,t){return this._invalidated&&this._updateImpl(e,t),this._renderer}_updateImpl(e,t){if(super._updateImpl(),this._renderer.clear(),this._points.length<2)return;const[i,r]=this._source.points();if(0===2*Math.abs(i.index-r.index))return void this.addAnchors(this._renderer);const[s,o]=this._points,a=Math.abs(s.x-o.x),l=o.y-s.y,h=this._source.properties().childs(),c=h.linewidth.value();if(s.y<-c&&o.y<-c||s.y>e+c&&o.y>e+c)return;const u=2*a,p=s.x>0?s.x-Math.ceil(s.x/u)*u:s.x+Math.floor(-s.x/u)*u,_={point:new n.Point(p,s.y),width:a,height:l,color:h.linecolor.value(),lineWidth:h.linewidth.value(),lineStyle:h.linestyle.value()};this._renderer.append(new d(_)),this.addAnchors(this._renderer)}}},15378:(e,t,i)=>{"use strict";i.r(t),i.d(t,{StickerPaneView:()=>r});var n=i(50761);class r extends n.SvgIconPaneView{_iconColor(){return null}}},44666:(e,t,i)=>{"use strict";i.r(t),i.d(t,{StudyLineDataSourceAnchorsPaneView:()=>r});var n=i(79191);class r extends n.LineSourcePaneView{renderer(){return this._invalidated&&(this._updateImpl(),this._invalidated=!1),this.createLineAnchor({points:this._getPoints()},0)}}},50761:(e,t,i)=>{"use strict";i.d(t,{SvgIconPaneView:()=>g});var n=i(86441),r=i(25422),s=i(50151),o=i(87095),a=i(19266),l=i(66103),d=i(79191),h=i(48891),c=i(15187),u=i(18807);const p=(0,h.getHexColorByName)("color-tv-blue-600");class _ extends c.MediaCoordinatesPaneRenderer{constructor(){super(...arguments),this._data=null}setData(e){this._data=e}hitTest(e,t){if(null===this._data)return null;const{size:i,angle:n,point:s}=this._data,o=(0,r.rotationMatrix)(-n),a=(0,r.transformPoint)(o,e.subtract(s));return Math.abs(a.y)<=i/2&&Math.abs(a.x)<=i/2?new u.HitTestResult(u.HitTarget.MovePoint):null}isOutOfScreen(e,t){if(null===this._data)return!0;const{size:i,point:n,angle:r}=this._data;let s;return s=r%(Math.PI/2)==0?i/2:Math.sqrt(i**2*2)/2,n.x+s<0||n.x-s>t||n.y+s<0||n.y-s>e}_drawImpl(e){if(null===this._data)return;const{size:t,svg:i,point:n,angle:r,color:s,background:o,selected:a}=this._data,l=e.context;l.translate(n.x,n.y);const d=r-Math.PI/2;l.rotate(d);const h=t/2;a&&(l.fillStyle=o,l.strokeStyle=p,l.beginPath(),l.rect(-h,-h,t,t),l.closePath(),
|
||||
l.fill(),l.stroke()),i&&(l.translate(-h,-h),null!==s&&(l.fillStyle=s),i.render(l,{targetViewBox:{x:0,y:0,width:t,height:t},doNotApplyColors:null!==s}))}}class g extends d.LineSourcePaneView{constructor(e,t,i){super(e,t),this._iconRenderer=new _,this._renderer=new a.CompositeRenderer,this._svg=i}renderer(e,t){return this._invalidated&&this._updateImpl(e,t),this._renderer}_updateImpl(e,t){if(super._updateImpl(),this._renderer.clear(),this._points.length<1)return;const i=this._source.properties().childs(),s=i.size.value(),o={point:this._points[0],color:this._iconColor(),size:s,svg:this._svg,angle:i.angle.value(),selected:this.areAnchorsVisible(),background:this._calculateBackgroundColor()};this._iconRenderer.setData(o),this._iconRenderer.isOutOfScreen(e,t)||this._renderer.append(this._iconRenderer);const a=this._points[0],h=this._source.getAnchorLimit();let c=new n.Point(Math.max(h,s)/2,0),u=new n.Point(0,Math.max(h,s)/2);const p=(0,r.rotationMatrix)(i.angle.value());c=(0,r.transformPoint)(p,c),u=(0,r.transformPoint)(p,u);const _=a.add(c);_.data=0,_.nonDiscreteIndex=!0;const g=a.subtract(c);g.data=1,g.nonDiscreteIndex=!0;const f=a.add(u);f.data=2,f.square=!0,f.nonDiscreteIndex=!0;const v=a.subtract(u);v.data=3,v.square=!0,v.nonDiscreteIndex=!0;const x=(0,d.thirdPointCursorType)(_,g),m=[l.PaneCursorType.Default,l.PaneCursorType.Default,x,x];this._renderer.append(this.createLineAnchor({points:[_,g,f,v],pointsCursorType:m},0))}_calculateBackgroundColor(){return(0,o.generateColor)(this._model.backgroundColorAtYPercentFromTop(this._points[0].y/(0,s.ensureNotNull)(this._model.paneForSource(this._source)).height()),60,!0)}}},62912:(e,t,i)=>{"use strict";i.r(t),i.d(t,{TextPaneView:()=>_});var n=i(50151),r=i(86441),s=i(46501),o=i(66103),a=i(80657),l=i(19266),d=i(80101),h=i(78211),c=i(18807),u=i(79191);const p=[o.PaneCursorType.HorizontalResize];class _ extends u.LineSourcePaneView{constructor(e,t,i,n,r,s,o,l){super(e,t),this._textRenderer=new a.TextRenderer,this._noSelection=!1,this._renderer=null,this._offsetX=i,this._offsetY=n,this._vertAlign=r,this._horzAlign=s,this._forceTextAlign=Boolean(o),this._noSelection=!1,this._renderer=null,this._recalculateSourcePointsOnFirstUpdate=l}renderer(e,t){return this._invalidated&&this._updateImpl(e,t),this._renderer}disableSelection(){this._noSelection=!0}isEditMode(){return!this._getModel().readOnly()}_updateImpl(e,t){super._updateImpl(e,t),this._renderer=null;const i=this._getSource(),o=i.priceScale();if(!o||o.isEmpty())return;const a=i.properties().childs(),u=this._getModel(),_={text:a.text.value(),color:a.color.value(),fontSize:a.fontsize.value(),boxPadding:a.fontsize.value()/6,font:s.CHART_FONT_FAMILY,vertAlign:this._vertAlign||"top",horzAlign:this._horzAlign||"left",offsetX:this._offsetX||0,offsetY:this._offsetY||0,forceTextAlign:this._forceTextAlign};if(_.points=i.isFixed()?[(0,n.ensureDefined)(i.fixedPoint())]:this._points,a.fillBackground&&a.fillBackground.value()&&(_.backgroundColor=a.backgroundColor.value()),
|
||||
a.drawBorder&&a.drawBorder.value()&&(_.borderColor=a.borderColor.value()),a.wordWrap&&a.wordWrap.value()&&(_.wordWrapWidth=a.wordWrapWidth.value()),_.bold=a.bold&&a.bold.value(),_.italic=a.italic&&a.italic.value(),_.highlightBorder=u.selection().isSelected(i),!i.isFixed()&&a.fixedSize&&!a.fixedSize.value()){_.scaleX=u.timeScale().barSpacing()/i.barSpacing();const e=(0,n.ensureNotNull)(o.priceRange());let t=o.height()/e.length();const r=o.logFormula();i.isPriceDencityLog()&&!o.isLog()&&(t=o.height()/((0,h.toLog)(e.maxValue(),r)-(0,h.toLog)(e.minValue(),r))),!i.isPriceDencityLog()&&o.isLog()&&(t=o.height()/((0,h.fromLog)(e.maxValue(),r)-(0,h.fromLog)(e.minValue(),r)));const s=i.priceDencity();void 0!==s&&(_.scaleY=t/s),(void 0===s||void 0===_.scaleY||_.scaleY<=0)&&delete _.scaleY}if(this._textRenderer.setData(_),this._textRenderer.isOutOfScreen(t,e))return;const g=1===_.points.length;if(g&&void 0!==this._recalculateSourcePointsOnFirstUpdate){this._renderer=null;const e=this._textRenderer.measure();return this._recalculateSourcePointsOnFirstUpdate(e.width,e.height),void(this._recalculateSourcePointsOnFirstUpdate=void 0)}if(g&&!this._noSelection){const e=new l.CompositeRenderer;e.append(this._textRenderer);const t=_.points[0].clone(),i=this._textRenderer.measure(),n=i.width,s=i.height;if(_.wordWrapWidth){const i=new r.Point(t.x+n,t.y+s/2);i.data=1,e.append(this.createLineAnchor({points:[i],pointsCursorType:p},1))}const o=new r.Point(t.x+n/2,t.y+s);return o.data=0,e.append(new d.SelectionRenderer({points:[o],bgColors:this._lineAnchorColors([o]),visible:this.areAnchorsVisible(),hittestResult:c.HitTarget.MovePoint,barSpacing:u.timeScale().barSpacing()})),void(this._renderer=e)}this._renderer=this._textRenderer}}},90042:(e,t,i)=>{"use strict";i.r(t),i.d(t,{LineToolThreeDrivesPaneView:()=>u});var n=i(79849),r=i(19266),s=i(80657),o=i(87663),a=i(99031),l=i(73436),d=i(79797),h=i(79191),c=i(46501);class u extends h.LineSourcePaneView{constructor(){super(...arguments),this._numericFormatter=new o.NumericFormatter,this._retrace1LabelRenderer=new s.TextRenderer,this._retrace12LabelRenderer=new s.TextRenderer,this._polyLineRenderer=new d.PolygonRenderer,this._renderer=null}renderer(e,t){return this._invalidated&&this._updateImpl(),this._renderer}_updateImpl(){super._updateImpl(),this._renderer=null;let e=NaN,t=NaN;if(this._source.points().length>=4){const[,t,i,n]=this._source.points();e=Math.round(100*Math.abs((n.price-i.price)/(i.price-t.price)))/100}if(this._source.points().length>=6){const[,,,e,i,n]=this._source.points();t=Math.round(100*Math.abs((n.price-i.price)/(i.price-e.price)))/100}if(this._points.length<2)return;const i=this._source.properties().childs(),s=new r.CompositeRenderer,o=(e,t)=>({points:[e],text:t,color:i.textcolor.value(),vertAlign:"middle",horzAlign:"center",font:c.CHART_FONT_FAMILY,offsetX:0,offsetY:0,bold:i.bold&&i.bold.value(),italic:i.italic&&i.italic.value(),fontsize:i.fontsize.value(),backgroundColor:i.color.value(),backgroundRoundRect:4}),d=(e,t)=>({points:[e,t],color:i.color.value(),
|
||||
linewidth:i.linewidth.value(),linestyle:n.LINESTYLE_DOTTED,extendleft:!1,extendright:!1,leftend:l.LineEnd.Normal,rightend:l.LineEnd.Normal}),h={points:this._points,color:i.color.value(),linewidth:i.linewidth.value(),linestyle:n.LINESTYLE_SOLID,leftend:l.LineEnd.Normal,rightend:l.LineEnd.Normal,backcolor:"rgba(0, 0, 0, 0)",fillBackground:!1,filled:!1};if(this._polyLineRenderer.setData(h),s.append(this._polyLineRenderer),!isNaN(e)){const t=new a.TrendLineRenderer;t.setData(d(this._points[1],this._points[3])),s.append(t);const i=o(this._points[1].add(this._points[3]).scaled(.5),this._numericFormatter.format(e));this._retrace1LabelRenderer.setData(i),s.append(this._retrace1LabelRenderer)}if(!isNaN(t)){const e=new a.TrendLineRenderer;e.setData(d(this._points[3],this._points[5])),s.append(e);const i=o(this._points[5].add(this._points[3]).scaled(.5),this._numericFormatter.format(t));this._retrace12LabelRenderer.setData(i),s.append(this._retrace12LabelRenderer)}this.addAnchors(s),this._renderer=s}}},65557:(e,t,i)=>{"use strict";i.r(t),i.d(t,{TimeCyclesPaneView:()=>c});var n=i(86441),r=i(19266),s=i(79191),o=i(87095),a=i(18807),l=i(68441),d=i(15187);class h extends d.MediaCoordinatesPaneRenderer{constructor(){super(...arguments),this._data=null}setData(e){this._data=e}hitTest(e){if(null===this._data||e.y>this._data.point.y)return null;if(e.x<this._data.point.x||e.x>this._data.point.x+this._data.width)return null;const t=new n.Point(this._data.point.x+this._data.width/2,this._data.point.y);let i=e.subtract(t);const r=this._data.height/this._data.width;i=new n.Point(i.x,i.y/r);const s=i.length();return Math.abs(s-this._data.width/2)<3?new a.HitTestResult(a.HitTarget.MovePoint):null}_drawImpl(e){if(null===this._data)return;const t=e.context;t.strokeStyle=this._data.color,t.lineWidth=this._data.linewidth,(0,l.setLineStyle)(t,this._data.linestyle),t.save(),t.translate(this._data.point.x+1,this._data.point.y),t.scale(this._data.width,this._data.height),t.beginPath(),t.arc(.5,0,.5,Math.PI,0,!1),t.restore(),t.stroke(),this._data.fillBackground&&(t.fillStyle=(0,o.generateColor)(this._data.backcolor,this._data.transparency),t.fill())}}class c extends s.LineSourcePaneView{constructor(){super(...arguments),this._renderer=null}renderer(e,t){return this._invalidated&&this._updateImpl(),this._renderer}_updateImpl(){if(super._updateImpl(),this._renderer=null,this._points.length<2)return;const e=this._source.points(),t=e[0],i=e[1],s=Math.min(t.index,i.index),o=Math.max(t.index,i.index),a=o-s,l=this._points[0],d=this._points[1],c=Math.abs(l.x-d.x),u=new r.CompositeRenderer,p=this._source.properties().childs(),_=this._model.timeScale();if(0===a)return;let g=Math.min(l.x,d.x);const f=[];for(let e=s;g>-c;e-=a)g=_.indexToCoordinate(e),f.push(g);g=Math.max(l.x,d.x);for(let e=o;g<_.width();e+=a)g=_.indexToCoordinate(e),f.push(g);for(let e=0;e<f.length;e++){const t={point:new n.Point(f[e],l.y),width:c,height:c,color:p.linecolor.value(),linewidth:p.linewidth.value(),linestyle:p.linestyle.value(),fillBackground:p.fillBackground.value(),
|
||||
backcolor:p.backgroundColor.value(),transparency:p.transparency.value()},i=new h;i.setData(t),u.append(i)}this.addAnchors(u),this._renderer=u}}},67998:(e,t,i)=>{"use strict";i.r(t),i.d(t,{TrendAnglePaneView:()=>m});var n=i(50151),r=i(86441),s=i(5531),o=i(34026),a=i(38223),l=i(18807),d=i(73436),h=i(9155),c=i(80657),u=i(99031),p=i(80101),_=i(46501),g=i(21477),f=i(15187);class v extends f.MediaCoordinatesPaneRenderer{constructor(){super(...arguments),this._data=null}setData(e){this._data=e}hitTest(e){return null}_drawImpl(e){if(null===this._data)return;const t=e.context;t.translate(this._data.point.x,this._data.point.y),t.strokeStyle=this._data.color,t.setLineDash([1,2]);const i=this._data.size;t.beginPath(),t.moveTo(0,0),t.lineTo(i,0),t.arc(0,0,i,0,-this._data.angle,this._data.angle>0),t.stroke()}}var x=i(48063);class m extends x.TrendToolWithStatsPaneView{constructor(e,t){super(e,t),this._secondPoint=null,this._trendRenderer=new u.TrendLineRenderer,this._angleRenderer=new v,this._angleLabelRenderer=new c.TextRenderer}_getPointsForStats(){return[this._points[0],(0,n.ensureNotNull)(this._middlePoint),(0,n.ensureNotNull)(this._secondPoint)]}_updateImpl(e,t){var i;this._renderer.clear(),super._updateImpl();const n=this._source,c=n.angle();if(this._points.length>0&&null!==c){const e=Math.cos(c),t=-Math.sin(c),i=new r.Point(e,t);this._secondPoint=this._points[0].addScaled(i,n.distance()),this._middlePoint=this._source.calcMiddlePoint(this._points[0],this._secondPoint)}this._invalidated=!1;const u=this._source.priceScale(),f=this._model.timeScale();if(!u||u.isEmpty()||f.isEmpty())return;if(null===this._model.timeScale().visibleBarsStrictRange())return;if(this._source.points().length<2)return;if(this._points.length<2||null===this._secondPoint)return;const v=this._points[0],x=this._points[1],m=this._source.properties().childs();m.showBarsRange.value()||m.showPriceRange.value()||m.showPercentPriceRange.value()||m.showPipsPriceRange.value()||(this._label=null,this._labelData&&(this._labelData.text=""));const w=m.linecolor.value(),R={points:[v,this._secondPoint],color:w,linewidth:m.linewidth.value(),linestyle:m.linestyle.value(),extendleft:m.extendLeft.value(),extendright:m.extendRight.value(),leftend:d.LineEnd.Normal,rightend:d.LineEnd.Normal};this._trendRenderer.setData(R),this._renderer.append(this._trendRenderer);const y=(0,r.box)(new r.Point(0,0),new r.Point(t,e));let T=!1;m.statsPosition.value()===h.StatsPosition.Auto&&(T=(0,r.equalPoints)(v,x)?!(0,o.pointInBox)(v,y):null===(0,s.intersectLineSegmentAndBox)((0,r.lineSegment)(v,x),y));if((this.isHoveredSource()||this.isSelectedSource()||m.alwaysShowStats.value())&&!T&&2===this._points.length){const e=new g.PaneRendererCachedImage(this,0);this._renderer.append(e)}const b=(this.isHoveredSource()||this.isSelectedSource())&&m.showMiddlePoint.value();this._middlePoint&&this._renderer.append(new p.SelectionRenderer({points:[this._middlePoint],bgColors:this._lineAnchorColors([this._middlePoint]),color:w,visible:b&&this.areAnchorsVisible(),hittestResult:l.HitTarget.Regular,
|
||||
barSpacing:0}));const P={point:v,angle:null!==(i=n.angle())&&void 0!==i?i:0,color:m.linecolor.value(),size:50};this._angleRenderer.setData(P),this._renderer.append(this._angleRenderer);const L=Math.round(180*P.angle/Math.PI)+"º",S={points:[new r.Point(v.x+50,v.y)],text:(0,a.forceLTRStr)(L),color:m.textcolor.value(),horzAlign:"left",font:_.CHART_FONT_FAMILY,offsetX:5,offsetY:0,bold:m.bold.value(),italic:m.italic.value(),fontsize:m.fontsize.value(),vertAlign:"middle"};this._angleLabelRenderer.setData(S),this._renderer.append(this._angleLabelRenderer),R.points.length>=2&&this._addAlertRenderer(this._renderer,R.points);const C=new r.Point(this._secondPoint.x,this._secondPoint.y);C.data=1,this._renderer.append(this.createLineAnchor({points:[v,C]},0))}}},38058:(e,t,i)=>{"use strict";i.r(t),i.d(t,{TrendBasedFibExtensionPaneView:()=>u});var n=i(86441),r=i(72739),s=i(99031),o=i(18807),a=i(19266),l=i(73436),d=i(26702),h=i(80657),c=i(134);class u extends c.LineToolPaneViewFibWithLabels{constructor(e,t){super(e,t),this._trendLineRendererPoints12=new s.TrendLineRenderer,this._trendLineRendererPoints23=new s.TrendLineRenderer,this._rectangleRenderers={},this._hlevelLineRenderers={},this._renderer=new a.CompositeRenderer,this._levels=[]}renderer(e,t){return this._invalidated&&this._updateImpl(t,e),this._renderer}_updateImpl(e,t){var i,a;if(super._updateImpl(),this._renderer.clear(),this._points.length<2)return;const[c,u]=this._points,p=this._source.properties().childs();if(3===this._source.points().length){const e=this._source.priceScale();if(!e||e.isEmpty()||this._model.timeScale().isEmpty())return;const t=null===(i=this._source.ownerSource())||void 0===i?void 0:i.firstValue();if(null==t)return;const[n,r,s]=this._source.points();let o=!1;p.reverse&&p.reverse.value()&&(o=p.reverse.value()),this._levels=[];const a=o?n.price:r.price,l=o?r.price:n.price,h=a-l;let c,u,_;const g=e.isLog()&&p.fibLevelsBasedOnLogScale.value();if(g){c=e.priceToCoordinate(a,t);u=c-e.priceToCoordinate(l,t),_=e.priceToCoordinate(s.price,t)}const f={price:s.price,coordinate:_},v={price:h,coordinate:u},x=this._source.levelsCount();for(let i=1;i<=x;i++){const n=p["level"+i].childs();if(!n.visible.value())continue;const r=n.coeff.value(),s=n.color.value(),o=(0,d.fibLevelCoordinate)(f,v,r,e,t,g),a=(0,d.fibLevelPrice)(f,v,r,e,t,g);this._levels.push({color:s,price:a,y:o,linewidth:p.levelsStyle.childs().linewidth.value(),linestyle:p.levelsStyle.childs().linestyle.value(),index:i})}}const _=p.trendline.childs();if(_.visible.value()){const e={points:[c,u],color:_.color.value(),linewidth:_.linewidth.value(),linestyle:_.linestyle.value(),extendleft:!1,extendright:!1,leftend:l.LineEnd.Normal,rightend:l.LineEnd.Normal};this._trendLineRendererPoints12.setData(e),this._renderer.append(this._trendLineRendererPoints12)}if(this._points.length<3)return void this.addAnchors(this._renderer);const g=this._points[2];if(_.visible.value()){const e={points:[u,g],color:_.color.value(),linewidth:_.linewidth.value(),linestyle:_.linestyle.value(),extendleft:!1,extendright:!1,
|
||||
leftend:l.LineEnd.Normal,rightend:l.LineEnd.Normal};this._trendLineRendererPoints23.setData(e),this._renderer.append(this._trendLineRendererPoints23)}const f=Math.min(g.x,u.x),v=Math.max(g.x,u.x),x=p.fillBackground.value(),m=p.transparency.value(),w=p.extendLinesLeft.value(),R=p.extendLines.value();if(x)for(let e=0;e<this._levels.length;e++)if(e>0&&x){const t=this._levels[e-1],i={points:[new n.Point(f,this._levels[e].y),new n.Point(v,t.y)],color:this._levels[e].color,linewidth:0,backcolor:this._levels[e].color,fillBackground:!0,transparency:m,extendLeft:w,extendRight:R};this._rectangleRenderers.hasOwnProperty(e)||(this._rectangleRenderers[e]=new r.RectangleRenderer(void 0,void 0,!0));const s=this._rectangleRenderers[e];s.setData(i),this._renderer.append(s)}let y=f,T=v;y===T&&(w&&(y-=1),R&&(T+=1));for(let i=0;i<this._levels.length;i++){const r=new n.Point(y,this._levels[i].y),d=new n.Point(T,this._levels[i].y);let c;const u=this._updateLabelForLevel({i,levelIndex:this._levels[i].index,leftPoint:r,rightPoint:d,price:this._levels[i].price,color:this._levels[i].color,extendLeft:w,extendRight:R,horzAlign:p.horzLabelsAlign.value(),vertAlign:p.vertLabelsAlign.value()});null!==u&&(this._renderer.append(u),"middle"===p.vertLabelsAlign.value()&&(c=null!==(a=(0,h.getTextBoundaries)(u,e,t))&&void 0!==a?a:void 0));const _={points:[r,d],color:this._levels[i].color,linewidth:this._levels[i].linewidth,linestyle:this._levels[i].linestyle,extendleft:w,extendright:R,leftend:l.LineEnd.Normal,rightend:l.LineEnd.Normal,excludeBoundaries:c};this._hlevelLineRenderers.hasOwnProperty(i)||(this._hlevelLineRenderers[i]=new s.TrendLineRenderer);const g=this._hlevelLineRenderers[i];g.setData(_),g.setHitTest(new o.HitTestResult(o.HitTarget.MovePoint,{snappingPrice:this._levels[i].price},this._levels[i].index)),this._renderer.append(g)}this.addAnchors(this._renderer)}}},33482:(e,t,i)=>{"use strict";i.r(t),i.d(t,{TrendBasedFibTimePaneView:()=>p});var n=i(86441),r=i(71254),s=i(80657),o=i(72739),a=i(99031),l=i(18807),d=i(19266),h=i(73436),c=i(46501),u=i(79191);class p extends u.LineSourcePaneView{constructor(e,t){super(e,t),this._trendLineRendererPoints12=new a.TrendLineRenderer,this._trendLineRendererPoints23=new a.TrendLineRenderer,this._renderer=new d.CompositeRenderer,this._levels=[]}renderer(e,t){return this._invalidated&&this._updateImpl(e,t),this._renderer}_updateImpl(e,t){var i;super._updateImpl(),this._renderer.clear();const a=this._source.properties().childs();if(3===this._source.points().length){const e=this._model.timeScale();if(e.isEmpty())return;const[t,i,n]=this._source.points();if(this._levels=[],i.index===t.index)return;const r=i.index-t.index,s=n.index;if(null===e.visibleBarsStrictRange())return;for(let t=1;t<=11;t++){const i=a["level"+t].childs();if(!i.visible.value())continue;const n=i.coeff.value(),o=i.color.value(),l=Math.round(s+n*r),d={x:e.indexToCoordinate(l),coeff:n,color:o,linewidth:i.linewidth.value(),linestyle:i.linestyle.value(),index:t,text:String(n)};this._levels.push(d)}}if(this._points.length<2)return
|
||||
;const u=new d.CompositeRenderer,[p,_]=this._points,g=a.trendline.childs();if(g.visible.value()){const e={points:[p,_],color:g.color.value(),linewidth:g.linewidth.value(),linestyle:g.linestyle.value(),extendleft:!1,extendright:!1,leftend:h.LineEnd.Normal,rightend:h.LineEnd.Normal};this._trendLineRendererPoints12.setData(e),u.append(this._trendLineRendererPoints12)}if(this._points.length<3)return this.addAnchors(u),void(this._renderer=u);const f=this._points[2];if(g.visible.value()){const e={points:[_,f],color:g.color.value(),linewidth:g.linewidth.value(),linestyle:g.linestyle.value(),extendleft:!1,extendright:!1,leftend:h.LineEnd.Normal,rightend:h.LineEnd.Normal};this._trendLineRendererPoints23.setData(e),u.append(this._trendLineRendererPoints23)}if(a.fillBackground.value()){const t=a.transparency.value();for(let i=1;i<this._levels.length;i++){const r=this._levels[i-1],s={points:[new n.Point(r.x,0),new n.Point(this._levels[i].x,e)],color:this._levels[i].color,linewidth:0,backcolor:this._levels[i].color,fillBackground:!0,transparency:t,extendLeft:!1,extendRight:!1},a=new o.RectangleRenderer(void 0,void 0,!0);a.setData(s),u.append(a)}}let v=a.horzLabelsAlign.value();v="left"===v?"right":"right"===v?"left":"center";const x=a.vertLabelsAlign.value(),m=a.showCoeffs.value();for(let o=0;o<this._levels.length;o++){let a;if(m){let r;switch(x){case"top":r=new n.Point(this._levels[o].x,0);break;case"middle":r=new n.Point(this._levels[o].x,.5*e);break;default:r=new n.Point(this._levels[o].x,e)}const l={points:[r],text:this._levels[o].text,color:this._levels[o].color,vertAlign:x,horzAlign:v,font:c.CHART_FONT_FAMILY,offsetX:2,offsetY:0,fontsize:12},d=new s.TextRenderer(l);this._needLabelExclusionPath(d)&&(a=null!==(i=(0,s.getTextBoundaries)(d,t,e))&&void 0!==i?i:void 0),u.append(d)}const d={x:this._levels[o].x,color:this._levels[o].color,linewidth:this._levels[o].linewidth,linestyle:this._levels[o].linestyle,excludeBoundaries:a},h=new l.HitTestResult(l.HitTarget.MovePoint,void 0,this._levels[o].index),p=new r.VerticalLineRenderer;p.setData(d),p.setHitTest(h),u.append(p)}this.addAnchors(u),this._renderer=u}_needLabelExclusionPath(e){return"center"===this._source.properties().childs().horzLabelsAlign.value()}}},96310:(e,t,i)=>{"use strict";i.r(t),i.d(t,{TrendLinePaneView:()=>g});var n=i(50151),r=i(86441),s=i(34026),o=i(5531),a=i(21477),l=i(80657),d=i(9155),h=i(80101),c=i(99031),u=i(46501),p=i(18807),_=i(48063);class g extends _.TrendToolWithStatsPaneView{constructor(){super(...arguments),this._trendRenderer=new c.TrendLineRenderer,this._labelRenderer=new l.TextRenderer}_getPointsForStats(){return[this._points[0],(0,n.ensureNotNull)(this._middlePoint),this._points[1]]}_updateImpl(e,t){var i;this._renderer.clear(),this._invalidated=!1;const n=this._source.priceScale(),c=this._model.timeScale();if(!n||n.isEmpty()||c.isEmpty())return;const _=this._model.timeScale().visibleBarsStrictRange();if(null===_)return;const g=this._source.points();if(g.length<2)return;const f=g[0],v=g[1],x=this._source.properties().childs()
|
||||
;if(f.index<_.firstBar()&&v.index<_.firstBar()&&!x.extendLeft.value()&&!x.extendRight.value())return;if(super._updateImpl(),this._points.length<2)return;x.showPriceRange.value()||x.showPercentPriceRange.value()||x.showPipsPriceRange.value()||x.showBarsRange.value()||x.showDateTimeRange.value()||x.showDistance.value()||x.showAngle.value()||(this._label=null,this._labelData&&(this._labelData.text=""));const m=this._points[0],w=this._points[1];let R;if(x.showLabel&&x.showLabel.value()&&x.text.value().length>0){const n=m.x<w.x?m:w,s=n===m?w:m,o=x.vertLabelsAlign.value(),a=x.horzLabelsAlign.value();let d;d="left"===a?n.clone():"right"===a?s.clone():new r.Point((m.x+w.x)/2,(m.y+w.y)/2);const h=Math.atan((s.y-n.y)/(s.x-n.x)),c={points:[d],text:x.text.value(),color:x.textcolor.value(),vertAlign:o,horzAlign:a,font:u.CHART_FONT_FAMILY,offsetX:0,offsetY:0,bold:x.bold.value(),italic:x.italic.value(),fontsize:x.fontsize.value(),forceTextAlign:!0,angle:h};this._labelRenderer.setData(c),this._renderer.append(this._labelRenderer),this._needLabelExclusionPath(this._labelRenderer)&&(R=null!==(i=(0,l.getTextBoundaries)(this._labelRenderer,t,e))&&void 0!==i?i:void 0)}const y=x.linecolor.value(),T={points:this._points,color:y,linewidth:x.linewidth.value(),linestyle:x.linestyle.value(),extendleft:x.extendLeft.value(),extendright:x.extendRight.value(),leftend:x.leftEnd.value(),rightend:x.rightEnd.value(),excludeBoundaries:R};this._trendRenderer.setData(T),this._renderer.append(this._trendRenderer);const b=(0,r.box)(new r.Point(0,0),new r.Point(t,e));let P=!1;x.statsPosition.value()===d.StatsPosition.Auto&&(P=(0,r.equalPoints)(m,w)?!(0,s.pointInBox)(m,b):null===(0,o.intersectLineSegmentAndBox)((0,r.lineSegment)(m,w),b));if(((this.isHoveredSource()||this.isSelectedSource())&&this.isEditMode()||x.alwaysShowStats.value())&&!P&&2===this._points.length){const e=new a.PaneRendererCachedImage(this,0);this._renderer.append(e)}const L=(this.isHoveredSource()||this.isSelectedSource())&&x.showMiddlePoint.value();this._middlePoint&&this._renderer.append(new h.SelectionRenderer({points:[this._middlePoint],bgColors:this._lineAnchorColors([this._middlePoint]),color:y,visible:L&&this.areAnchorsVisible(),hittestResult:p.HitTarget.Regular,barSpacing:0})),this.addAnchors(this._renderer),T.points.length>=2&&this._addAlertRenderer(this._renderer,T.points)}}},48063:(e,t,i)=>{"use strict";i.d(t,{TrendToolWithStatsPaneView:()=>V});var n=i(50151),r=i(86441),s=i(5531),o=i(44352),a=i(38223),l=i(19266),d=i(93572),h=i(87663),c=i(2043),u=i(57322),p=i(57352),_=i(27714),g=i(34026),f=i(49483),v=i(80657),x=i(18807),m=i(68441),w=i(1722),R=i(74359),y=i(57898);class T{constructor(e,t,i){this._ready=!1,this._img=function(e,t,i){const n=new Image;return n.width=t,n.height=t,n.onload=i,n.src=e,n}(e,t,(()=>{this._ready=!0,i()}))}ready(){return this._ready}image(){return this._img}}let b=null;const P=18,L=new class{constructor(e,t){this._icons=new Map,this._onAllIconsLoaded=new y.Delegate,this._pendingLoading=e.length;const i=()=>{
|
||||
0==--this._pendingLoading&&this._onAllIconsLoaded.fire()};e.forEach((e=>{const n=this._icons.get(e.name)||new Map;n.set(e.theme,new T(e.imageData,t,i)),this._icons.set(e.name,n)}))}getIcon(e,t){return(0,n.ensureDefined)((0,n.ensureDefined)(this._icons.get(e)).get(t))}onAllIconsReady(){return this._onAllIconsLoaded}}([{name:"angle",theme:"dark",imageData:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTgiIGhlaWdodD0iMTgiIHZpZXdCb3g9IjAgMCAxOCAxOCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0zLjQ5OTk5IDE1SDIuNjU3NzFMMy4wNjEwNCAxNC4yNjA2TDkuMDYxMDQgMy4yNjA1N0w5LjMwMDQ2IDIuODIxNjJMMTAuMTc4NCAzLjMwMDQ4TDkuOTM4OTMgMy43Mzk0Mkw3LjUxMzg1IDguMTg1NDJDMTAuNTYyMSA5LjY3MjA1IDEwLjk0NTEgMTIuNjI2MSAxMC45OTMxIDE0SDE0LjVIMTVWMTVIMTQuNUgzLjQ5OTk5Wk05Ljk5MTk3IDE0QzkuOTQyMzYgMTIuNzI1OSA5LjU4NjI5IDEwLjI4OCA3LjAzNDM1IDkuMDY0NDlMNC4zNDIyNiAxNEg5Ljk5MTk3WiIgZmlsbD0iI0Y4RjlGRCIvPgo8L3N2Zz4K"},{name:"angle",theme:"light",imageData:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTgiIGhlaWdodD0iMTgiIHZpZXdCb3g9IjAgMCAxOCAxOCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4NCjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNMy40OTk5OSAxNUgyLjY1NzcxTDMuMDYxMDQgMTQuMjYwNkw5LjA2MTA0IDMuMjYwNTdMOS4zMDA0NiAyLjgyMTYyTDEwLjE3ODQgMy4zMDA0OEw5LjkzODkzIDMuNzM5NDJMNy41MTM4NSA4LjE4NTQyQzEwLjU2MjEgOS42NzIwNSAxMC45NDUxIDEyLjYyNjEgMTAuOTkzMSAxNEgxNC41SDE1VjE1SDE0LjVIMy40OTk5OVpNOS45OTE5NyAxNEM5Ljk0MjM2IDEyLjcyNTkgOS41ODYyOSAxMC4yODggNy4wMzQzNSA5LjA2NDQ5TDQuMzQyMjYgMTRIOS45OTE5N1oiIGZpbGw9IiMyQTJFMzkiLz4NCjwvc3ZnPg0K"},{name:"barsRange",theme:"dark",imageData:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTgiIGhlaWdodD0iMTgiIHZpZXdCb3g9IjAgMCAxOCAxOCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4NCjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNMiAzVjMuNVY1SDFWNlYxM1YxNEgyVjE1LjVWMTZIM1YxNS41VjE0SDRWMTNWNlY1SDNWMy41VjNIMlpNOC4yMDcxMSA3LjVMNy44NTM1NSA3Ljg1MzU1TDYuNzA3MTEgOUgxMS4yOTI5TDEwLjE0NjQgNy44NTM1NUw5Ljc5Mjg5IDcuNUwxMC41IDYuNzkyODlMMTAuODUzNiA3LjE0NjQ1TDEyLjg1MzYgOS4xNDY0NUwxMy4yMDcxIDkuNUwxMi44NTM2IDkuODUzNTVMMTAuODUzNiAxMS44NTM2TDEwLjUgMTIuMjA3MUw5Ljc5Mjg5IDExLjVMMTAuMTQ2NCAxMS4xNDY0TDExLjI5MjkgMTBINi43MDcxMUw3Ljg1MzU1IDExLjE0NjRMOC4yMDcxMSAxMS41TDcuNSAxMi4yMDcxTDcuMTQ2NDUgMTEuODUzNkw1LjE0NjQ1IDkuODUzNTVMNC43OTI4OSA5LjVMNS4xNDY0NSA5LjE0NjQ1TDcuMTQ2NDUgNy4xNDY0NUw3LjUgNi43OTI4OUw4LjIwNzExIDcuNVpNMyA2SDJWMTNIM1Y2Wk0xNSAzLjVWM0gxNlYzLjVWNUgxN1Y2VjEzVjE0SDE2VjE1LjVWMTZIMTVWMTUuNVYxNEgxNFYxM1Y2VjVIMTVWMy41Wk0xNSA2SDE2VjEzSDE1VjZaIiBmaWxsPSIjRjhGOUZEIi8+DQo8L3N2Zz4NCg=="},{name:"barsRange",theme:"light",
|
||||
imageData:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTgiIGhlaWdodD0iMTgiIHZpZXdCb3g9IjAgMCAxOCAxOCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4NCjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNMiAzVjMuNVY1SDFWNlYxM1YxNEgyVjE1LjVWMTZIM1YxNS41VjE0SDRWMTNWNlY1SDNWMy41VjNIMlpNOC4yMDcxMSA3LjVMNy44NTM1NSA3Ljg1MzU1TDYuNzA3MTEgOUgxMS4yOTI5TDEwLjE0NjQgNy44NTM1NUw5Ljc5Mjg5IDcuNUwxMC41IDYuNzkyODlMMTAuODUzNiA3LjE0NjQ1TDEyLjg1MzYgOS4xNDY0NUwxMy4yMDcxIDkuNUwxMi44NTM2IDkuODUzNTVMMTAuODUzNiAxMS44NTM2TDEwLjUgMTIuMjA3MUw5Ljc5Mjg5IDExLjVMMTAuMTQ2NCAxMS4xNDY0TDExLjI5MjkgMTBINi43MDcxMUw3Ljg1MzU1IDExLjE0NjRMOC4yMDcxMSAxMS41TDcuNSAxMi4yMDcxTDcuMTQ2NDUgMTEuODUzNkw1LjE0NjQ1IDkuODUzNTVMNC43OTI4OSA5LjVMNS4xNDY0NSA5LjE0NjQ1TDcuMTQ2NDUgNy4xNDY0NUw3LjUgNi43OTI4OUw4LjIwNzExIDcuNVpNMyA2SDJWMTNIM1Y2Wk0xNSAzLjVWM0gxNlYzLjVWNUgxN1Y2VjEzVjE0SDE2VjE1LjVWMTZIMTVWMTUuNVYxNEgxNFYxM1Y2VjVIMTVWMy41Wk0xNSA2SDE2VjEzSDE1VjZaIiBmaWxsPSIjMkEyRTM5Ii8+DQo8L3N2Zz4NCg=="},{name:"priceRange",theme:"dark",imageData:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTgiIGhlaWdodD0iMTgiIHZpZXdCb3g9IjAgMCAxOCAxOCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4NCjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNMyAySDMuNUgxMy41SDE0VjNIMTMuNUgzLjVIM1YyWk04LjUgMy43OTI4OUw4Ljg1MzU1IDQuMTQ2NDVMMTAuODUzNiA2LjE0NjQ1TDExLjIwNzEgNi41TDEwLjUgNy4yMDcxMUwxMC4xNDY0IDYuODUzNTVMOSA1LjcwNzExVjEyLjI5MjlMMTAuMTQ2NCAxMS4xNDY0TDEwLjUgMTAuNzkyOUwxMS4yMDcxIDExLjVMMTAuODUzNiAxMS44NTM2TDguODUzNTUgMTMuODUzNkw4LjUgMTQuMjA3MUw4LjE0NjQ1IDEzLjg1MzZMNi4xNDY0NSAxMS44NTM2TDUuNzkyODkgMTEuNUw2LjUgMTAuNzkyOUw2Ljg1MzU1IDExLjE0NjRMOCAxMi4yOTI5VjUuNzA3MTFMNi44NTM1NSA2Ljg1MzU1TDYuNSA3LjIwNzExTDUuNzkyODkgNi41TDYuMTQ2NDUgNi4xNDY0NUw4LjE0NjQ1IDQuMTQ2NDVMOC41IDMuNzkyODlaTTMuNSAxNkgzVjE1SDMuNUgxMy41SDE0VjE2SDEzLjVIMy41WiIgZmlsbD0iI0Y4RjlGRCIvPg0KPC9zdmc+DQo="},{name:"priceRange",theme:"light",imageData:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTgiIGhlaWdodD0iMTgiIHZpZXdCb3g9IjAgMCAxOCAxOCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4NCjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNMyAySDMuNUgxMy41SDE0VjNIMTMuNUgzLjVIM1YyWk04LjUgMy43OTI4OUw4Ljg1MzU1IDQuMTQ2NDVMMTAuODUzNiA2LjE0NjQ1TDExLjIwNzEgNi41TDEwLjUgNy4yMDcxMUwxMC4xNDY0IDYuODUzNTVMOSA1LjcwNzExVjEyLjI5MjlMMTAuMTQ2NCAxMS4xNDY0TDEwLjUgMTAuNzkyOUwxMS4yMDcxIDExLjVMMTAuODUzNiAxMS44NTM2TDguODUzNTUgMTMuODUzNkw4LjUgMTQuMjA3MUw4LjE0NjQ1IDEzLjg1MzZMNi4xNDY0NSAxMS44NTM2TDUuNzkyODkgMTEuNUw2LjUgMTAuNzkyOUw2Ljg1MzU1IDExLjE0NjRMOCAxMi4yOTI5VjUuNzA3MTFMNi44NTM1NSA2Ljg1MzU1TDYuNSA3LjIwNzExTDUuNzkyODkgNi41TDYuMTQ2NDUgNi4xNDY0NUw4LjE0NjQ1IDQuMTQ2NDVMOC41IDMuNzkyODlaTTMuNSAxNkgzVjE1SDMuNUgxMy41SDE0VjE2SDEzLjVIMy41WiIgZmlsbD0iIzJBMkUzOSIvPg0KPC9zdmc+DQo="}],P),S=new Map;class C{constructor(e,t,i){this._fontSize=0,this._preRendered=!1,this._boundingBox=null,this._rect=null,this._padding=null,this._textPoint=null,this._textSizeCache=t,this._data=e,this._fontSize=e.fontSize?e.fontSize:12,this._lineSpacing=(0,
|
||||
w.isNumber)(this._data.lineSpacing)&&this._data.lineSpacing?this._data.lineSpacing:0,e.lines=this._lines=null===e.text?[]:(0,v.wordWrap)(e.text,this.fontStyle(),e.wordWrapWidth),this._hittest=i||new x.HitTestResult(x.HitTarget.MovePoint)}fontStyle(){return`${this._data.bold?"bold ":""}${this._data.italic?"italic ":""}${this._fontSize}px ${this._data.font}`}draw(e,t){if(0===this._data.points.length||null===this._data.text)return{width:0};this._preRender();const i=this._fontSize+this._lineSpacing;e.textBaseline="top",e.font=this.fontStyle();const r=(0,n.ensureNotNull)(this._rect);if(this._rect){if("right"!==this._data.horzAlign&&"center"!==this._data.horzAlign||!0!==this._data.doNotAlignText&&(e.textAlign="right"===this._data.horzAlign?"end":"center"),this._data.backgroundRoundRect?((0,m.drawRoundRect)(e,r.x,r.y,r.w,r.h,this._data.backgroundRoundRect),e.fillStyle=this._data.backgroundColor,e.fill(),e.globalAlpha=1):(e.fillStyle=this._data.backgroundColor,e.fillRect(r.x,r.y,r.w,r.h),e.globalAlpha=1),this._data.icons){let s=0;const o=Math.ceil((P-this._fontSize)/2),a=(0,n.ensureNotNull)(this._padding);for(const n of this._data.icons){const l=Math.round(r.x+a.left),d=Math.round(r.y+a.top+i*s-o);this._drawIcon(e,l,d,n,Boolean(this._data.isDark),t),s+=1}}}else"right"===this._data.horzAlign?e.textAlign="end":"center"===this._data.horzAlign&&(e.textAlign="center");const s=(0,n.ensureNotNull)(this._textPoint),o=s.x;let a=s.y;e.fillStyle=this._data.color;for(const t of this._lines)e.fillText(t,o,a),a+=i;return{width:r.w+2}}hitTest(e){return 0===this._data.points.length?null:(this._preRender(),this._boundingBox&&(0,g.pointInBox)(e,this._boundingBox)?this._hittest:null)}_preRender(){if(this._preRendered)return;const e=function(){if(null!==b)return b;const e=(0,R.createDisconnectedCanvas)(document,(0,_.size)({width:0,height:0}));return b=(0,R.getPrescaledContext2D)(e),b}(),t=this._data.points[0].x;let i=t;const n=this._data.points[0].y;let s=n;const o=this._fontSize,a=this._lineSpacing,l=(o+a)*this._lines.length-a;e.textBaseline="top",e.font=this.fontStyle();const d=[];let h;if(this._data.wordWrapWidth){h=this._data.wordWrapWidth;for(let e=0;e<this._lines.length;e++)d.push(this._data.wordWrapWidth)}else{h=0;for(let t=0;t<this._lines.length;t++){const i=e.measureText(this._lines[t]).width;d.push(i),h=Math.max(h,i)}}const c={top:this._data.paddingTop,right:this._data.paddingRight,bottom:this._data.paddingBottom,left:this._data.paddingLeft},u={x:Math.floor(t),y:Math.floor(n),w:Math.ceil(h+c.left+c.right),h:Math.ceil(l+c.top+c.bottom)};if(i+=c.left,s+=c.top,this._data.icons){const e=void 0!==this._data.textPadding?this._data.textPadding:Math.round(o/2);i+=P+e,u.w+=P+e}if("bottom"===this._data.vertAlign||"middle"===this._data.vertAlign){const e="middle"===this._data.vertAlign?n-u.h/2:n-u.h-(u.y-n);s+=e-u.y,u.y=e}if("right"===this._data.horzAlign||"center"===this._data.horzAlign){const n="center"===this._data.horzAlign?t-u.w/2:t-u.w-(u.x-t);i+=n-u.x,u.x=n,
|
||||
!0!==this._data.doNotAlignText&&("right"===this._data.horzAlign?(e.textAlign="end",i+=h):(e.textAlign="center",i+=h/2))}u.w%2!=0&&u.w++,u.x+=.5,u.y+=.5,this._boundingBox=(0,r.box)(new r.Point(u.x,u.y),new r.Point(u.x+u.w,u.y+u.h)),this._rect=u,this._padding=c,this._textPoint={x:i,y:s},this._textSizeCache&&(this._textSizeCache.widths=d),this._preRendered=!0}_drawIcon(e,t,i,r,s,o){const a=`${r}${this._data.isDark}${o.pixelRatio}`;let l=S.get(a);if(!l){l=document.createElement("canvas"),l.width=P*o.pixelRatio,l.height=P*o.pixelRatio,l.style.width="18px",l.style.height="18px";const e=(0,n.ensureNotNull)(l.getContext("2d"));e.setTransform(1,0,0,1,0,0),f.isEdge||e.scale(o.pixelRatio,o.pixelRatio);const t=L.getIcon(r,s?"dark":"light");t.ready()&&(e.drawImage(t.image(),0,0),S.set(a,l))}e.drawImage(l,t-.5,i-.5,P,P)}}var M,I=i(46501),A=i(33295),k=i(59224);!function(e){e.offset=8,e.fontSize=12,e.lineSpacing=16,e.rectRadius=4,e.bgColorLight="rgba(227,242,253,0.9)",e.bgColorDark="rgba(67,70,81,0.9)",e.textColorLight="#2A2E39",e.textColorDark="#F8F9FD",e.textPadding=10,e.paddingTopBottom=13,e.paddingLeftRight=10}(M||(M={}));var N=M.fontSize,D=M.lineSpacing,B=M.paddingTopBottom;const z=(0,k.getLogger)("Chart.LineToolTrendLine");function E(e,t){return!(!e&&!t)&&(!(!e||t)||(!(e||!t)||(e.index!==t.index||e.price!==t.price)))}class H{constructor(e){this._sourcesToRow=new Map,this._rowsToSources=new Map,this._currentWidth=400,this._actualCapacity=1,this._currentSymbol="",this._params=e;const t=D,i=N+t;this._maxRowHeight=3*i-t+2*B+2,this._recreateCanvas()}destroy(){delete this._canvas,delete this._ctx}canvas(){return this._canvas}topByRow(e){return e*this._maxRowHeight}rowHeight(e){const t=(0,n.ensureDefined)(this._rowsToSources.get(e)),i=(0,n.ensureDefined)(this._sourcesToRow.get(t)).effectiveState;return null!==i?i.realRowHeight:this._maxRowHeight}rowWidth(e){const t=(0,n.ensureDefined)(this._rowsToSources.get(e));return(0,n.ensureDefined)(this._sourcesToRow.get(t)).width}currentWidth(){return this._currentWidth}updateSource(e,t){const i=e.properties().symbol.value();this._currentSymbol!==i&&(z.logDebug("TrendLineCache. Clearing canvas because of changing symbol from "+this._currentSymbol+" to "+i),this._currentSymbol=i,this._sourcesToRow.clear(),this._rowsToSources.clear());const n=e.id();let r=this._sourcesToRow.get(n);if(void 0===r){const e=this._findEmptyRow(n);r={effectiveState:null,rowIndex:e,width:0},this._sourcesToRow.set(n,r),this._rowsToSources.set(e,n)}const s=r.effectiveState,o=this._effectiveState(e);if(!this._effectiveStatesEquals(s,o)){const e=t();this._repaintSource(n,r.rowIndex,e),r.effectiveState=o}return r}_findEmptyRow(e){let t=0;for(;void 0!==this._rowsToSources.get(t);)t++;return this._rowsToSources.set(t,e),t>=this._actualCapacity&&(this._actualCapacity++,this._recreateCanvas()),t}_effectiveState(e){var t,i
|
||||
@@ -7,8 +7,8 @@ o.ensureDefined)(null!==(e=null==d?void 0:d.value())&&void 0!==e?e:n),onChange:t
|
||||
title:(0,o.ensureDefined)(null===(l=null==p?void 0:p[a])||void 0===l?void 0:l.title),property:d,isRGB:m,isFundamental:false,showLineWidth:"line"===u});if("arrows"===u){const e=this._getPlotSwitch(a,Ze(s,a),d.display);if(m)return e;const t=i.up,l=i.down;return t||l?r.createElement(r.Fragment,null,e,t&&t.palette&&t.paletteProps?r.createElement(ce,{title:Fe,plot:n,palette:t.palette,paletteProps:t.paletteProps,styleProp:d,showSeparator:!1,showOnlyTitle:!0,offset:!0}):r.createElement(ge,{id:a,isRGB:m,title:Fe,color:d.colorup,display:d.display,transparency:d.transparency,switchable:!1,grouped:!0,offset:!0}),l&&l.palette&&l.paletteProps?r.createElement(ce,{title:Ge,plot:n,palette:l.palette,paletteProps:l.paletteProps,styleProp:d,showSeparator:!1,showOnlyTitle:!0,offset:!0}):r.createElement(ge,{id:a,isRGB:m,title:Ge,color:d.colordown,display:d.display,transparency:d.transparency,switchable:!1,grouped:!0,offset:!0}),r.createElement(oe.PropertyTable.GroupSeparator,null)):r.createElement(be,{id:a,property:d,isRGB:m,plot:n,palettes:i,styleProp:d})}if("chars"===u||"shapes"===u){const e=(0,o.ensureDefined)(null==p?void 0:p[a]),t=e.title;return r.createElement(r.Fragment,null,"chars"===u?r.createElement(De,{id:a,title:t,char:e.char,property:d,hasPalette:Boolean(h&&h.palette),isRGB:m}):r.createElement(ze,{id:a,title:t,property:d,hasPalette:Boolean(h&&h.palette),isRGB:m}),h&&h.palette&&h.paletteProps&&r.createElement(ce,{title:t,plot:n,palette:h.palette,paletteProps:h.paletteProps,hideVisibilitySwitch:!0,styleProp:d}))}if((0,x.isOhlcPlot)(n)){const e=n.target,t=s.properties().ohlcPlots[e],l=(0,o.ensureDefined)((0,o.ensureDefined)(s.metaInfo().ohlcPlots)[e]),c=this._getPlotSwitch(a,l.title,t.display);if(m)return c;const p=i.wick&&i.wick.palette&&i.wick.paletteProps,d=i.border&&i.border.palette&&i.border.paletteProps;return r.createElement(r.Fragment,null,c,h&&h.palette&&h.paletteProps?r.createElement(ce,{title:Ue,plot:n,palette:h.palette,paletteProps:h.paletteProps,styleProp:t,showSeparator:!1,showOnlyTitle:!0,offset:!0}):r.createElement(ge,{id:a,isRGB:m,title:Ue,display:t.display,color:t.color,transparency:t.transparency,switchable:!1,grouped:!0,offset:!0}),i.wick&&i.wick.palette&&i.wick.paletteProps&&r.createElement(ce,{title:Oe,plot:n,palette:i.wick.palette,paletteProps:i.wick.paletteProps,styleProp:t,showSeparator:!1,showOnlyTitle:!0,offset:!0}),Boolean(!p&&t.wickColor)&&r.createElement(ge,{id:a,isRGB:m,title:Oe,display:t.display,color:t.wickColor,transparency:t.transparency,switchable:!1,grouped:!0,offset:!0}),i.border&&i.border.palette&&i.border.paletteProps&&r.createElement(ce,{title:je,plot:n,palette:i.border.palette,paletteProps:i.border.paletteProps,styleProp:t,showSeparator:!1,showOnlyTitle:!0,offset:!0}),Boolean(!d&&t.borderColor)&&r.createElement(ge,{id:a,isRGB:m,title:je,display:t.display,color:t.borderColor,transparency:t.transparency,switchable:!1,grouped:!0,offset:!0}),r.createElement(oe.PropertyTable.GroupSeparator,null))}return He.logError("Unknown plot type: "+u),null}_getPlotSwitch(e,t,l){
|
||||
return r.createElement(oe.PropertyTable.Row,null,r.createElement(oe.PropertyTable.Cell,{placement:"first",colSpan:2},r.createElement(pe,{id:e,title:t,display:l})))}}function Ze(e,t){const l=(0,o.ensureDefined)(e.metaInfo().styles),{title:n}=(0,o.ensureDefined)(l[t]);return(0,o.ensureDefined)(n)}var qe=l(47510),Ke=l(53598);const $e=new s.TranslatedString("change line style",i.t(null,void 0,l(28691)));class Xe extends r.PureComponent{constructor(){super(...arguments),this._onLineStyleChange=e=>{const{setValue:t}=this.context,{lineStyle:l}=this.props;(0,V.setPropertyValue)(l,(l=>t(l,e,$e)))}}render(){const{lineStyle:e,...t}=this.props;return r.createElement(Ke.LineStyleSelect,{...t,lineStyle:(0,V.getPropertyValue)(e),lineStyleChange:this._onLineStyleChange})}}Xe.contextType=L.StylePropertyContext;const Ye=new s.TranslatedString("change value",i.t(null,void 0,l(50463)));class Je extends r.PureComponent{constructor(){super(...arguments),this._onValueChange=e=>{const{setValue:t}=this.context,{value:l}=this.props.property;t(l,e,Ye)}}render(){const{id:e,name:t,property:{color:l,linestyle:n,linewidth:o,transparency:i,value:s,visible:a}}=this.props;return r.createElement(B.InputRow,{labelAlign:"adaptive",label:r.createElement(M,{id:e,title:t,visible:a})},r.createElement("div",{className:te.block},r.createElement("div",{className:te.group},r.createElement(ee.ColorWithThicknessSelect,{disabled:!a.value(),color:l,transparency:i,thickness:o}),r.createElement(Xe,{id:(0,_.createDomId)(e,"line-style-select"),disabled:!a.value(),className:te.smallStyleControl,lineStyle:n})),r.createElement("div",{className:Ce(te.wrapGroup,te.defaultSelect,te.additionalSelect)},r.createElement(qe.FloatInputComponent,{input:{id:"",name:"",type:"float",defval:0},value:s.value(),disabled:!a.value(),onChange:this._onValueChange}))))}}Je.contextType=L.StylePropertyContext;class et extends r.PureComponent{render(){const{orders:{visible:e,showLabels:t,showQty:n}}=this.props;return r.createElement(r.Fragment,null,r.createElement(oe.PropertyTable.Row,null,r.createElement(oe.PropertyTable.Cell,{placement:"first",colSpan:2},r.createElement(M,{id:"chart-orders-switch",title:i.t(null,void 0,l(77409)),visible:e}))),r.createElement(oe.PropertyTable.Row,null,r.createElement(oe.PropertyTable.Cell,{placement:"first",colSpan:2},r.createElement(M,{id:"chart-orders-labels-switch",title:i.t(null,void 0,l(86520)),visible:t}))),r.createElement(oe.PropertyTable.Row,null,r.createElement(oe.PropertyTable.Cell,{placement:"first",colSpan:2},r.createElement(M,{id:"chart-orders-qty-switch",title:i.t(null,void 0,l(66596)),visible:n}))))}}et.contextType=L.StylePropertyContext;var tt=l(90164),lt=l(96438);const nt=new s.TranslatedString("change percent width",i.t(null,void 0,l(51081))),rt=new s.TranslatedString("change placement",i.t(null,void 0,l(47634))),ot=new s.TranslatedString("change values visibility",i.t(null,void 0,l(12628))),it=[{value:tt.HHistDirection.LeftToRight,content:i.t(null,void 0,l(19286))},{value:tt.HHistDirection.RightToLeft,content:i.t(null,void 0,l(21141))
|
||||
}],st=i.t(null,void 0,l(95247)),at=i.t(null,void 0,l(91502)),ct=i.t(null,void 0,l(91322)),pt=i.t(null,void 0,l(19221));class dt extends r.PureComponent{constructor(){super(...arguments),this._onPercentWidthChange=e=>{const{setValue:t}=this.context,{percentWidth:l}=this.props.property.childs();t(l,e,nt)},this._onPlacementChange=e=>{const{setValue:t}=this.context,{direction:l}=this.props.property.childs();t(l,e,rt)},this._onShowValuesChange=e=>{const{setValue:t}=this.context,{showValues:l}=this.props.property.childs();t(l,e,ot)}}render(){const{hHistInfo:e,property:t}=this.props,{percentWidth:l,direction:n,showValues:o,valuesColor:i,visible:s}=t.childs(),{title:a}=e;return r.createElement(r.Fragment,null,r.createElement(oe.PropertyTable.Row,null,r.createElement(oe.PropertyTable.Cell,{placement:"first",colSpan:2,grouped:!0},r.createElement(M,{id:a,title:a,visible:s}))),r.createElement(B.InputRow,{label:r.createElement("div",{className:te.childRowContainer},st),grouped:!0},r.createElement(lt.IntegerInputComponent,{input:{id:"",name:"",type:"integer",defval:0},value:l.value(),disabled:!s.value(),onChange:this._onPercentWidthChange})),r.createElement(B.InputRow,{label:r.createElement("div",{className:te.childRowContainer},at),grouped:!0},r.createElement(Ee.Select,{id:"hhist-graphic-placement-select",disabled:!s.value(),className:te.defaultSelect,menuItemClassName:te.defaultSelectItem,items:it,value:n.value(),onChange:this._onPlacementChange})),r.createElement(oe.PropertyTable.Row,null,r.createElement(oe.PropertyTable.Cell,{className:te.childRowContainer,placement:"first",colSpan:2,grouped:!0},r.createElement(D.BoolInputComponent,{label:ct,input:{id:a+"_showValues",type:"bool",defval:!0,name:"visible"},value:!o||o.value(),disabled:!s.value(),onChange:this._onShowValuesChange}))),r.createElement(B.InputRow,{label:r.createElement("div",{className:te.childRowContainer},pt),grouped:!0},r.createElement(ee.ColorWithThicknessSelect,{disabled:s&&!s.value(),color:i})),this._renderColors(),r.createElement(oe.PropertyTable.GroupSeparator,null))}_renderColors(){const{property:e,hHistInfo:t}=this.props,{colors:l,transparencies:n,visible:o}=e.childs(),{titles:i}=t;return l.childNames().map((e=>r.createElement(B.InputRow,{key:e,grouped:!0,label:r.createElement("div",{className:te.childRowContainer},i[+e])},r.createElement(ee.ColorWithThicknessSelect,{disabled:!o.value(),color:l[+e],transparency:n[+e]}))))}}dt.contextType=L.StylePropertyContext;class ut extends r.PureComponent{render(){const{title:e,property:t}=this.props,{color:l,width:n,style:o,visible:i}=t.childs();return r.createElement(B.InputRow,{label:r.createElement(M,{id:e,title:e,visible:i})},r.createElement(ee.ColorWithThicknessSelect,{disabled:!i.value(),color:l,transparency:t.child("transparency"),thickness:n}),r.createElement(Xe,{id:(0,_.createDomId)(e,"line-style-select"),disabled:!i.value(),className:te.smallStyleControl,lineStyle:o}))}}ut.contextType=L.StylePropertyContext;var ht,mt;l(1115);!function(e){e.Triangle="triangle",e.Rectangle="rectangle"}(ht||(ht={})),
|
||||
function(e){e.Verdana="Verdana",e.CourierNew="Courier New",e.TimesNewRoman="Times New Roman",e.Arial="Arial"}(mt||(mt={}));class vt extends r.PureComponent{render(){const{graphicType:e,study:t}=this.props,l=t.metaInfo(),n=l.graphics,i=t.properties().graphics.childs(),s=(0,o.ensureDefined)(n[e]);return Object.keys(s).map(((t,n)=>{var s,a,c,p;const d=(0,o.ensureDefined)(null===(s=i[e])||void 0===s?void 0:s.childs()[t]);return"horizlines"===e||"vertlines"===e?r.createElement(ut,{key:t,title:(0,o.ensureDefined)(null===(a=l.graphics[e])||void 0===a?void 0:a[t]).name,property:d}):"lines"===e?r.createElement(ut,{key:t,title:(0,o.ensureDefined)(null===(c=l.graphics.lines)||void 0===c?void 0:c[t]).title,property:d}):"hhists"===e?r.createElement(dt,{key:t,hHistInfo:(0,o.ensureDefined)(null===(p=l.graphics.hhists)||void 0===p?void 0:p[t]),property:d}):null}))}}var yt=l(66045);const gt=new s.TranslatedString("change font size",i.t(null,void 0,l(7378))),bt=[10,11,12,14,16,20,24,28,32,40].map((e=>({value:e,title:e.toString()})));class wt extends r.PureComponent{constructor(){super(...arguments),this._onFontSizeChange=e=>{const{setValue:t}=this.context,{fontSize:l}=this.props;t(l,e,gt)}}render(){const{fontSize:e,...t}=this.props;return r.createElement(yt.FontSizeSelect,{...t,fontSizes:bt,fontSize:e.value(),fontSizeChange:this._onFontSizeChange})}}wt.contextType=L.StylePropertyContext;const ft=new s.TranslatedString("change visibility",i.t(null,void 0,l(21511))),Ct=i.t(null,void 0,l(64606)),Pt=i.t(null,void 0,l(94420)),St={Traditional:new Set(["S5/R5","S4/R4","S3/R3","S2/R2","S1/R1","P"]),Fibonacci:new Set(["S3/R3","S2/R2","S1/R1","P"]),Woodie:new Set(["S4/R4","S3/R3","S2/R2","S1/R1","P"]),Classic:new Set(["S4/R4","S3/R3","S2/R2","S1/R1","P"]),DM:new Set(["S1/R1","P"]),DeMark:new Set(["S1/R1","P"]),Camarilla:new Set(["S4/R4","S3/R3","S2/R2","S1/R1","P"])};class Et extends r.PureComponent{constructor(){super(...arguments),this._onChange=e=>{const{setValue:t}=this.context,{levelsStyle:l}=this.props.property.childs(),{showLabels:n}=l.childs();t(n,e,ft)}}render(){const{fontsize:e,levelsStyle:t}=this.props.property.childs();return r.createElement(r.Fragment,null,r.createElement(B.InputRow,{labelAlign:"adaptive",label:r.createElement("span",null,Ct)},r.createElement("div",{className:te.block},r.createElement("div",{className:Ce(te.wrapGroup,te.additionalSelect)},r.createElement(wt,{id:"pivot-points-standard-font-size-select",fontSize:e})))),r.createElement(oe.PropertyTable.Row,null,r.createElement(oe.PropertyTable.Cell,{placement:"first",colSpan:2},r.createElement(D.BoolInputComponent,{label:Pt,input:{id:"ShowLabels",type:"bool",defval:!0,name:"visible"},value:t.childs().showLabels.value(),onChange:this._onChange}))),this._renderColors())}_renderColors(){const{levelsStyle:e,inputs:t}=this.props.property.childs(),{colors:l,widths:n,visibility:i}=e.childs(),{kind:s}=t.childs(),a=(0,o.ensureDefined)(St[s.value()]);return l.childNames().filter((e=>a.has(e))).map((e=>r.createElement(ye,{key:e,id:e,title:e,color:l.childs()[e],
|
||||
visible:i.childs()[e],thickness:n.childs()[e]})))}}Et.contextType=L.StylePropertyContext;const Tt=i.t(null,void 0,l(91502)),kt=[{value:tt.HHistDirection.RightToLeft,content:i.t(null,void 0,l(21141))},{value:tt.HHistDirection.LeftToRight,content:i.t(null,void 0,l(19286))}],_t=new s.TranslatedString("change visibility",i.t(null,void 0,l(21511))),xt=i.t(null,void 0,l(14414)),It=i.t(null,void 0,l(91322)),Lt=i.t(null,void 0,l(95247)),Dt=i.t(null,void 0,l(31577)),Vt=i.t(null,{context:"input"},l(45811)),Rt=i.t(null,{context:"input"},l(41596));class Mt extends r.PureComponent{constructor(){super(...arguments),this._onChange=e=>{this._setHhistsProperty("visible",e)},this._onShowValuesChange=e=>{this._setHhistsProperty("showValues",e)},this._onValueChange=e=>{this._setHhistsProperty("percentWidth",e)},this._onDirectionChange=e=>{this._setHhistsProperty("direction",e)}}render(){var e,t,n,s,a,c;const{metaInfo:p}=this.props,{graphics:d,styles:u,showLabelsOnPriceScale:h,showLegendValues:m}=this.props.property.childs(),{hhists:v,horizlines:y,polygons:g}=d.childs(),b=(0,o.ensureDefined)(p.graphics.hhists),w=Object.keys(b),f=v.childs()[w[0]],C=f.childs().visible,P=w.map((e=>v.childs()[e].childs().showValues)),S=f.childs().percentWidth,E=f.childs().direction,T=w.map((e=>v.childs()[e].childs().valuesColor)),k=null===(e=y.childs())||void 0===e?void 0:e.vahLines,_=null===(t=p.graphics.horizlines)||void 0===t?void 0:t.vahLines,x=null===(n=y.childs())||void 0===n?void 0:n.valLines,I=null===(s=p.graphics.horizlines)||void 0===s?void 0:s.valLines,L=y.childs().pocLines,V=(0,o.ensureDefined)(null===(a=p.graphics.horizlines)||void 0===a?void 0:a.pocLines),R=u.childs().developingPoc,N=new ae.StudyPlotVisibleProperty(R.childs().display),W=(0,o.ensureDefined)(null===(c=p.styles)||void 0===c?void 0:c.developingPoc),A=u.childs().developingVAHigh,z=new ae.StudyPlotVisibleProperty(A.childs().display),H=u.childs().developingVALow,F=new ae.StudyPlotVisibleProperty(H.childs().display),G=p.graphics.polygons&&p.graphics.polygons.histBoxBg;return r.createElement(r.Fragment,null,r.createElement(oe.PropertyTable.Row,null,r.createElement(oe.PropertyTable.Cell,{placement:"first",colSpan:2},r.createElement(D.BoolInputComponent,{label:xt,input:{id:"VolumeProfile",type:"bool",defval:!0,name:"visible"},value:C.value(),onChange:this._onChange}))),r.createElement(oe.PropertyTable.Row,null,r.createElement(oe.PropertyTable.Cell,{placement:"first"},r.createElement("div",{className:te.childRowContainer},r.createElement(D.BoolInputComponent,{disabled:!C.value(),label:It,input:{id:"ShowValues",type:"bool",defval:!0,name:"visible"},value:P[0].value(),onChange:this._onShowValuesChange}))),r.createElement(oe.PropertyTable.Cell,{placement:"last"},r.createElement(ee.ColorWithThicknessSelect,{disabled:!C.value()||!P[0].value(),color:T}))),r.createElement(oe.PropertyTable.Row,null,r.createElement(oe.PropertyTable.Cell,{placement:"first"},r.createElement("div",{className:te.childRowContainer},Lt)),r.createElement(oe.PropertyTable.Cell,{placement:"last"
|
||||
function(e){e.Verdana="Verdana",e.CourierNew="Courier New",e.TimesNewRoman="Times New Roman",e.Arial="Arial"}(mt||(mt={}));class vt extends r.PureComponent{render(){const{graphicType:e,study:t}=this.props,l=t.metaInfo(),n=l.graphics,i=t.properties().graphics.childs(),s=(0,o.ensureDefined)(n[e]);return Object.keys(s).map(((t,n)=>{var s,a,c,p;const d=(0,o.ensureDefined)(null===(s=i[e])||void 0===s?void 0:s.childs()[t]);return"horizlines"===e||"vertlines"===e?r.createElement(ut,{key:t,title:(0,o.ensureDefined)(null===(a=l.graphics[e])||void 0===a?void 0:a[t]).name,property:d}):"lines"===e?r.createElement(ut,{key:t,title:(0,o.ensureDefined)(null===(c=l.graphics.lines)||void 0===c?void 0:c[t]).title,property:d}):"hhists"===e?r.createElement(dt,{key:t,hHistInfo:(0,o.ensureDefined)(null===(p=l.graphics.hhists)||void 0===p?void 0:p[t]),property:d}):null}))}}var yt=l(66045);const gt=new s.TranslatedString("change font size",i.t(null,void 0,l(7378))),bt=[10,11,12,14,16,20,24,28,32,40].map((e=>({value:e,title:e.toString()})));class wt extends r.PureComponent{constructor(){super(...arguments),this._onFontSizeChange=e=>{const{setValue:t}=this.context,{fontSize:l}=this.props;t(l,e,gt)}}render(){const{fontSize:e,...t}=this.props;return r.createElement(yt.FontSizeSelect,{...t,fontSizes:bt,fontSize:e.value(),fontSizeChange:this._onFontSizeChange})}}wt.contextType=L.StylePropertyContext;const ft=new s.TranslatedString("change visibility",i.t(null,void 0,l(21511))),Ct=i.t(null,void 0,l(64606)),Pt=i.t(null,void 0,l(94420)),St={Traditional:new Set(["S5/R5","S4/R4","S3/R3","S2/R2","S1/R1","P"]),Fibonacci:new Set(["S3/R3","S2/R2","S1/R1","P"]),Woodie:new Set(["S4/R4","S3/R3","S2/R2","S1/R1","P"]),Classic:new Set(["S4/R4","S3/R3","S2/R2","S1/R1","P"]),DM:new Set(["S1/R1","P"]),DeMark:new Set(["S1/R1","P"]),Camarilla:new Set(["S4/R4","S3/R3","S2/R2","S1/R1","P"]),Floor:new Set(["S3/R3","S2/R2","S1/R1","P"])};class Et extends r.PureComponent{constructor(){super(...arguments),this._onChange=e=>{const{setValue:t}=this.context,{levelsStyle:l}=this.props.property.childs(),{showLabels:n}=l.childs();t(n,e,ft)}}render(){const{fontsize:e,levelsStyle:t}=this.props.property.childs();return r.createElement(r.Fragment,null,r.createElement(B.InputRow,{labelAlign:"adaptive",label:r.createElement("span",null,Ct)},r.createElement("div",{className:te.block},r.createElement("div",{className:Ce(te.wrapGroup,te.additionalSelect)},r.createElement(wt,{id:"pivot-points-standard-font-size-select",fontSize:e})))),r.createElement(oe.PropertyTable.Row,null,r.createElement(oe.PropertyTable.Cell,{placement:"first",colSpan:2},r.createElement(D.BoolInputComponent,{label:Pt,input:{id:"ShowLabels",type:"bool",defval:!0,name:"visible"},value:t.childs().showLabels.value(),onChange:this._onChange}))),this._renderColors())}_renderColors(){const{levelsStyle:e,inputs:t}=this.props.property.childs(),{colors:l,widths:n,visibility:i}=e.childs(),{kind:s}=t.childs(),a=(0,o.ensureDefined)(St[s.value()]);return l.childNames().filter((e=>a.has(e))).map((e=>r.createElement(ye,{key:e,id:e,
|
||||
title:e,color:l.childs()[e],visible:i.childs()[e],thickness:n.childs()[e]})))}}Et.contextType=L.StylePropertyContext;const Tt=i.t(null,void 0,l(91502)),kt=[{value:tt.HHistDirection.RightToLeft,content:i.t(null,void 0,l(21141))},{value:tt.HHistDirection.LeftToRight,content:i.t(null,void 0,l(19286))}],_t=new s.TranslatedString("change visibility",i.t(null,void 0,l(21511))),xt=i.t(null,void 0,l(14414)),It=i.t(null,void 0,l(91322)),Lt=i.t(null,void 0,l(95247)),Dt=i.t(null,void 0,l(31577)),Vt=i.t(null,{context:"input"},l(45811)),Rt=i.t(null,{context:"input"},l(41596));class Mt extends r.PureComponent{constructor(){super(...arguments),this._onChange=e=>{this._setHhistsProperty("visible",e)},this._onShowValuesChange=e=>{this._setHhistsProperty("showValues",e)},this._onValueChange=e=>{this._setHhistsProperty("percentWidth",e)},this._onDirectionChange=e=>{this._setHhistsProperty("direction",e)}}render(){var e,t,n,s,a,c;const{metaInfo:p}=this.props,{graphics:d,styles:u,showLabelsOnPriceScale:h,showLegendValues:m}=this.props.property.childs(),{hhists:v,horizlines:y,polygons:g}=d.childs(),b=(0,o.ensureDefined)(p.graphics.hhists),w=Object.keys(b),f=v.childs()[w[0]],C=f.childs().visible,P=w.map((e=>v.childs()[e].childs().showValues)),S=f.childs().percentWidth,E=f.childs().direction,T=w.map((e=>v.childs()[e].childs().valuesColor)),k=null===(e=y.childs())||void 0===e?void 0:e.vahLines,_=null===(t=p.graphics.horizlines)||void 0===t?void 0:t.vahLines,x=null===(n=y.childs())||void 0===n?void 0:n.valLines,I=null===(s=p.graphics.horizlines)||void 0===s?void 0:s.valLines,L=y.childs().pocLines,V=(0,o.ensureDefined)(null===(a=p.graphics.horizlines)||void 0===a?void 0:a.pocLines),R=u.childs().developingPoc,N=new ae.StudyPlotVisibleProperty(R.childs().display),W=(0,o.ensureDefined)(null===(c=p.styles)||void 0===c?void 0:c.developingPoc),A=u.childs().developingVAHigh,z=new ae.StudyPlotVisibleProperty(A.childs().display),H=u.childs().developingVALow,F=new ae.StudyPlotVisibleProperty(H.childs().display),G=p.graphics.polygons&&p.graphics.polygons.histBoxBg;return r.createElement(r.Fragment,null,r.createElement(oe.PropertyTable.Row,null,r.createElement(oe.PropertyTable.Cell,{placement:"first",colSpan:2},r.createElement(D.BoolInputComponent,{label:xt,input:{id:"VolumeProfile",type:"bool",defval:!0,name:"visible"},value:C.value(),onChange:this._onChange}))),r.createElement(oe.PropertyTable.Row,null,r.createElement(oe.PropertyTable.Cell,{placement:"first"},r.createElement("div",{className:te.childRowContainer},r.createElement(D.BoolInputComponent,{disabled:!C.value(),label:It,input:{id:"ShowValues",type:"bool",defval:!0,name:"visible"},value:P[0].value(),onChange:this._onShowValuesChange}))),r.createElement(oe.PropertyTable.Cell,{placement:"last"},r.createElement(ee.ColorWithThicknessSelect,{disabled:!C.value()||!P[0].value(),color:T}))),r.createElement(oe.PropertyTable.Row,null,r.createElement(oe.PropertyTable.Cell,{placement:"first"},r.createElement("div",{className:te.childRowContainer},Lt)),r.createElement(oe.PropertyTable.Cell,{placement:"last"
|
||||
},r.createElement(lt.IntegerInputComponent,{disabled:!C.value(),input:{id:"",name:"",type:"integer",defval:0},value:S.value(),onChange:this._onValueChange}))),r.createElement(oe.PropertyTable.Row,null,r.createElement(oe.PropertyTable.Cell,{placement:"first"},r.createElement("div",{className:te.childRowContainer},Tt)),r.createElement(oe.PropertyTable.Cell,{placement:"last"},r.createElement(Ee.Select,{id:"hhist-direction-select",disabled:!C.value(),className:te.defaultSelect,menuItemClassName:te.defaultSelectItem,items:kt,value:E.value(),onChange:this._onDirectionChange}))),w.map((e=>r.createElement(r.Fragment,{key:e},v.childs()[e].childs().colors.childNames().map(((t,n)=>{const o=b[e];return r.createElement(B.InputRow,{key:n,label:r.createElement("div",{className:te.childRowContainer},o&&i.t(o.titles[n],{context:"input"},l(88601))||"")},r.createElement(ee.ColorWithThicknessSelect,{disabled:!C.value(),color:v.childs()[e].childs().colors.childs()[n],transparency:v.childs()[e].childs().transparencies.childs()[n]}))}))))),_&&k&&r.createElement(ye,{id:"vahLines",title:_.name,color:k.childs().color,visible:k.childs().visible,thickness:k.childs().width},r.createElement(Xe,{id:"vah-lines-line-style-select",disabled:!k.childs().visible.value(),className:te.smallStyleControl,lineStyle:k.childs().style})),I&&x&&r.createElement(ye,{id:"valLines",title:I.name,color:x.childs().color,visible:x.childs().visible,thickness:x.childs().width},r.createElement(Xe,{id:"val-lines-line-style-select",disabled:!x.childs().visible.value(),className:te.smallStyleControl,lineStyle:x.childs().style})),r.createElement(ye,{id:"pocLines",title:V.name,color:L.childs().color,visible:L.childs().visible,thickness:L.childs().width},r.createElement(Xe,{id:"poc-lines-line-style-select",disabled:!L.childs().visible.value(),className:te.smallStyleControl,lineStyle:L.childs().style})),R&&r.createElement(ye,{id:"developingPoc",title:W.title&&i.t(W.title,{context:"input"},l(88601))||"",color:R.childs().color,visible:N,thickness:R.childs().linewidth},r.createElement(Xe,{id:"developing-poc-line-style-select",disabled:!N.value(),className:te.smallStyleControl,lineStyle:R.childs().linestyle})),A&&H&&r.createElement(ye,{id:"developingPoc",title:Dt,color:[A.childs().color,H.childs().color],visible:[z,F],thickness:[A.childs().linewidth,H.childs().linewidth]},r.createElement(Xe,{id:"developing-VA-line-style-select",disabled:!z.value()&&!F.value(),className:te.smallStyleControl,lineStyle:[A.childs().linestyle,H.childs().linestyle]})),g&&r.createElement(B.InputRow,{label:r.createElement("div",null,G&&i.t(G.name,{context:"input"},l(88601))||"")},r.createElement(ee.ColorWithThicknessSelect,{color:g.childs().histBoxBg.childs().color,transparency:g.childs().histBoxBg.childs().transparency})),(h||m)&&"VbPFixed"!==p.shortId&&r.createElement(r.Fragment,null,h&&r.createElement(oe.PropertyTable.Cell,{placement:"first",colSpan:2},r.createElement(M,{id:"showLabelsOnPriceScale",title:Rt,visible:h})),m&&r.createElement(oe.PropertyTable.Cell,{placement:"first",colSpan:2
|
||||
},r.createElement(M,{id:"showLegendValues",title:Vt,visible:m}))))}_setHhistsProperty(e,t){const{setValue:l}=this.context,{metaInfo:n,property:r}=this.props,i=r.childs().graphics.childs().hhists,s=Object.keys((0,o.ensureDefined)(n.graphics.hhists));for(let n=0;n<s.length;n++){const r=i.childs()[s[n]].child(e);l((0,o.ensureDefined)(r),t,_t)}}}function Bt(){const e=(0,o.ensureNotNull)((0,r.useContext)(ve)),t=e.metaInfo(),l=e.properties();return r.createElement(Mt,{metaInfo:t,property:l})}Mt.contextType=L.StylePropertyContext;var Nt=l(51717);const Wt={VbPFixed:Bt,PivotPointsStandard:function(){const e=(0,o.ensureNotNull)((0,r.useContext)(ve)).properties();return r.createElement(Et,{property:e})},VbPVisible:Bt,VbPAnchored:Bt};class At extends r.PureComponent{render(){const e=(0,o.ensureNotNull)(this.context);return r.createElement(ve.Consumer,null,(t=>r.createElement(L.StylePropertyContainer,{property:(0,o.ensureNotNull)(t).properties(),model:e},r.createElement(oe.PropertyTable,null,this._renderCustomContent((0,o.ensureNotNull)(t).metaInfo().shortId)))))}_renderCustomContent(e){if(e in Wt){const t=Wt[e];return r.createElement(t,null)}return null}}At.contextType=Nt.ModelContext;var zt=l(43886);const Ht=new s.TranslatedString("change precision",i.t(null,void 0,l(164))),Ft=i.t(null,void 0,l(4329)),Gt=i.t(null,void 0,l(73947)),Ut=[{value:"default",content:Ft}];for(let e=0;e<=8;e++)Ut.push({value:e,content:e.toString()});class Ot extends r.PureComponent{constructor(){super(...arguments),this._onChange=e=>{const{setValue:t}=this.context,{precision:l}=this.props;t(l,e,Ht)}}render(){const{id:e,precision:t}=this.props;return r.createElement(B.InputRow,{label:Gt},r.createElement(Ee.Select,{id:e,className:te.defaultSelect,menuItemClassName:te.defaultSelectItem,items:Ut,value:t.value(),onChange:this._onChange}))}}Ot.contextType=L.StylePropertyContext;const jt=new s.TranslatedString("change min tick",i.t(null,void 0,l(20834))),Qt=i.t(null,void 0,l(4329)),Zt=i.t(null,void 0,l(36993)),qt=[{priceScale:1,minMove:1,frac:!1},{priceScale:10,minMove:1,frac:!1},{priceScale:100,minMove:1,frac:!1},{priceScale:1e3,minMove:1,frac:!1},{priceScale:1e4,minMove:1,frac:!1},{priceScale:1e5,minMove:1,frac:!1},{priceScale:1e6,minMove:1,frac:!1},{priceScale:1e7,minMove:1,frac:!1},{priceScale:1e8,minMove:1,frac:!1},{priceScale:2,minMove:1,frac:!0},{priceScale:4,minMove:1,frac:!0},{priceScale:8,minMove:1,frac:!0},{priceScale:16,minMove:1,frac:!0},{priceScale:32,minMove:1,frac:!0},{priceScale:64,minMove:1,frac:!0},{priceScale:128,minMove:1,frac:!0},{priceScale:320,minMove:1,frac:!0}],Kt=[{id:"tick-default",value:"default",content:Qt}];for(let e=0;e<qt.length;e++){const t=qt[e];Kt.push({value:t.priceScale+","+t.minMove+","+t.frac,content:t.minMove+"/"+t.priceScale})}class $t extends r.PureComponent{constructor(){super(...arguments),this._onChange=e=>{const{setValue:t}=this.context,{minTick:l}=this.props;t(l,e,jt)}}render(){const{id:e,minTick:t}=this.props;return r.createElement(B.InputRow,{label:Zt},r.createElement(Ee.Select,{id:e,className:te.defaultSelect,
|
||||
menuItemClassName:te.defaultSelectItem,items:Kt,value:t.value(),onChange:this._onChange}))}}$t.contextType=L.StylePropertyContext;var Xt=l(73146),Yt=l(86067);class Jt extends r.PureComponent{render(){const{id:e,isRGB:t,title:l,visible:n,bottomColor:o,topColor:i,transparency:s,children:a,switchable:c=!0,offset:p,grouped:d}=this.props;return r.createElement(B.InputRow,{label:c?r.createElement(M,{id:e,title:l,visible:n}):l,offset:p,grouped:d},t?null:r.createElement(r.Fragment,null,i&&r.createElement(ee.ColorWithThicknessSelect,{disabled:n&&!(Array.isArray(n)?n[0].value():n.value()),color:i,transparency:s}),o&&r.createElement("div",{className:Pe()(o&&i&&te.additionalSelect)},r.createElement(ee.ColorWithThicknessSelect,{disabled:n&&!(Array.isArray(n)?n[0].value():n.value()),color:o,transparency:s}))),a)}}Jt.contextType=L.StylePropertyContext;const el=i.t(null,void 0,l(27331)),tl=i.t(null,{context:"input"},l(45811)),ll=i.t(null,{context:"input"},l(41596)),nl=i.t(null,void 0,l(40297));class rl extends r.PureComponent{constructor(){super(...arguments),this._findPlotPalettes=e=>{const{study:t}=this.props,l=t.metaInfo(),n=(0,o.ensureDefined)(l.palettes);return(0,x.isBarColorerPlot)(e)||(0,x.isBgColorerPlot)(e)?{main:{palette:n[e.palette],paletteProps:t.properties().palettes[e.palette]}}:this._findPalettesByTargetId(e.id)}}render(){const{study:e}=this.props,t=e.metaInfo();if((0,zt.isCustomStudy)(t.shortId))return r.createElement(At,null);const l=e.properties(),{precision:n,strategy:o,minTick:i,showLabelsOnPriceScale:s,showLegendValues:a}=l,c=t.plots.length>0,p=t.plots.some((e=>!(0,x.isPlotWithTechnicalValues)(e))),d=c||t.inputs.some((e=>"price"===e.type)),u=(0,Xt.createAdapter)(e).canOverrideMinTick();return r.createElement(oe.PropertyTable,null,this._plotsElement(),this._bandsElement(),this._bandsBackgroundsElement(),this._areasBackgroundsElement(),this._filledAreasElement(),this._graphicsElement(),u&&r.createElement($t,{id:(0,_.createDomId)(t.id,"min-tick-select"),minTick:i}),I.StudyMetaInfo.isScriptStrategy(t)&&r.createElement(et,{orders:o.orders}),(d||p)&&r.createElement(oe.PropertyTable.Row,null,r.createElement(oe.PropertyTable.GroupSeparator,{size:1}),r.createElement(Yt.GroupTitleSection,{title:nl,name:nl}),d&&r.createElement(Ot,{id:(0,_.createDomId)(t.id,"precision-select"),precision:n}),p&&r.createElement(r.Fragment,null,r.createElement(oe.PropertyTable.Cell,{placement:"first",colSpan:2},r.createElement(M,{id:"showLabelsOnPriceScale",title:ll,visible:s})),r.createElement(oe.PropertyTable.Cell,{placement:"first",colSpan:2},r.createElement(M,{id:"showLegendValues",title:tl,visible:a})))))}_plotsElement(){const{study:e}=this.props,t=e.metaInfo();return new T.MetaInfoHelper(t).getUserEditablePlots().filter((e=>!((0,x.isUpColorerPlot)(e)||(0,x.isDownColorerPlot)(e)||(0,x.isCandleBorderColorerPlot)(e)||(0,x.isCandleWickColorerPlot)(e)))).map((t=>{const l=(0,x.isOhlcPlot)(t)?{...t,id:t.target}:t,n=this._findPlotPalettes(l);return r.createElement(Qe,{key:t.id,plot:t,palettes:n,study:e})}))}_bandsElement(){
|
||||
@@ -1,5 +1,5 @@
|
||||
(()=>{"use strict";var e,a,c,d,f,t={},b={};function r(e){var a=b[e];if(void 0!==a)return a.exports;var c=b[e]={id:e,loaded:!1,exports:{}};return t[e].call(c.exports,c,c.exports,r),c.loaded=!0,c.exports}r.m=t,r.c=b,e=[],r.O=(a,c,d,f)=>{if(!c){var t=1/0;for(i=0;i<e.length;i++){for(var[c,d,f]=e[i],b=!0,o=0;o<c.length;o++)(!1&f||t>=f)&&Object.keys(r.O).every((e=>r.O[e](c[o])))?c.splice(o--,1):(b=!1,f<t&&(t=f));if(b){e.splice(i--,1);var n=d();void 0!==n&&(a=n)}}return a}f=f||0;for(var i=e.length;i>0&&e[i-1][2]>f;i--)e[i]=e[i-1];e[i]=[c,d,f]},r.n=e=>{var a=e&&e.__esModule?()=>e.default:()=>e;return r.d(a,{a}),a},c=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,r.t=function(e,d){if(1&d&&(e=this(e)),8&d)return e;if("object"==typeof e&&e){if(4&d&&e.__esModule)return e;if(16&d&&"function"==typeof e.then)return e}var f=Object.create(null);r.r(f);var t={};a=a||[null,c({}),c([]),c(c)];for(var b=2&d&&e;"object"==typeof b&&!~a.indexOf(b);b=c(b))Object.getOwnPropertyNames(b).forEach((a=>t[a]=()=>e[a]));return t.default=()=>e,r.d(f,t),f},r.d=(e,a)=>{for(var c in a)r.o(a,c)&&!r.o(e,c)&&Object.defineProperty(e,c,{enumerable:!0,get:a[c]})},r.f={},r.e=e=>Promise.all(Object.keys(r.f).reduce(((a,c)=>(r.f[c](e,a),a)),[])),r.u=e=>5652===e?"__LANG__.5652.afa01acb54a69426de69.js":2427===e?"__LANG__.2427.9e75295442d2edc53485.js":77===e?"__LANG__.77.99662205014782bfbe4a.js":6196===e?"__LANG__.6196.1cb6c0cf4b3c1139a67d.js":9871===e?"__LANG__.9871.80491970c40a96588ffd.js":7201===e?"__LANG__.7201.d9e269cc77c4bebf986c.js":3753===e?"__LANG__.3753.453e4c91d1197ef94e09.js":2521===e?"__LANG__.2521.8eba2dc07079697338fc.js":8884===e?"__LANG__.8884.377844211bfc698fda75.js":2684===e?"__LANG__.2684.89c78924594078c4eeb0.js":({92:"chart-screenshot-hint",139:"get-error-card",507:"study-pane-views",607:"study-property-pages-with-definitions",731:"add-compare-dialog",1583:"lt-pane-views",1584:"context-menu-renderer",1702:"manage-drawings-dialog",1754:"symbol-search-dialog",1859:"go-to-date-dialog-impl",1890:"line-tools-icons",2077:"change-interval-dialog",2183:"study-inputs-pane-views",2306:"floating-toolbars",2377:"hammerjs",2616:"svg-renderer",2704:"currency-label-menu",2878:"drawing-toolbar",3005:"header-toolbar",3030:"new-confirm-inputs-dialog",3596:"general-property-page",4013:"custom-intervals-add-dialog",4079:"series-pane-views",4389:"take-chart-image-impl",4665:"share-chart-to-social-utils",4862:"object-tree-dialog",5009:"load-chart-dialog",5093:"chart-widget-gui",5516:"restricted-toolset",5551:"favorite-drawings-api",5598:"lt-stickers-atlas",6166:"chart-event-hint",6265:"new-edit-object-dialog",6456:"study-market",6631:"study-template-dialog",6780:"source-properties-editor",7078:"general-chart-properties-dialog",7260:"chart-bottom-toolbar",7271:"compare-model",7648:"show-theme-save-dialog",7987:"lt-icons-atlas",8020:"user-defined-bars-marks-tooltip",8537:"lt-property-pages-with-definitions",8643:"full-tooltips-popup",8890:"simple-dialog",9039:"lollipop-tooltip-renderer",9374:"symbol-info-dialog-impl",9498:"export-data",
|
||||
9685:"series-icons-map"}[e]||e)+"."+{6:"a03a8ff024d47ed075c6",92:"bfb76cc7578ab709169b",139:"02c0064b96893d572f7c",306:"6c2d5d0bc3a42274d1e6",507:"ed33f2a0cf4f0d37ca70",607:"8ba8754a2a9412395338",731:"f9dfb2d8c088196803c5",769:"9e4ee987380cde8a482f",855:"61db310932f8af2c5989",898:"b63568700f1380e37b1a",962:"e2eb6a85de39a3d76e5d",1013:"ccba7f12442264960551",1033:"bb804c64fe58de0bace7",1044:"c0b266912178dd5523e1",1054:"c09e1aa220385adef79a",1109:"845f0f111ff830ab93c8",1365:"e1fe1d66c5bb17da7c3a",1553:"c076714f5e24887f0b94",1583:"f9c2f48c51585106118a",1584:"429d5a2ad09b6791326c",1702:"3f5b604134bebba28c6c",1754:"33210ecad56124f25ac1",1762:"9511e5b410d7d629bc49",1859:"a3a8e03aafa01f2649cb",1890:"8b313f77ea6c1f51530a",2020:"4a7196a939413830080e",2077:"53c155e0d72b7d0f0e3d",2109:"291fa715b6ded706c3dd",2183:"a80a3e282aa441e156d1",2191:"2197cc1b66a1db8969cc",2260:"95dc0a20b147b6b2eeed",2306:"e8314762db1d7d9aac81",2377:"6e30e0c48af40bf2f6c0",2587:"615babc52637decdb6e2",2616:"f065beaf6b5b37da27d9",2639:"a55d77a7912be54f7b9d",2666:"d28c0fa0a323b8118f22",2676:"a9a5ede4d514162164fa",2704:"b2d329d398bc58f1b425",2731:"55eed17fefac5e82c077",2878:"1077ac737eee4d6fdb30",2984:"dc61504f5c150afee786",3005:"d2aa6e1dc6d61ae08053",3016:"37427b1dab6d44713245",3030:"dbb4bdcbf10acf6b5280",3066:"8b1d2ceb22d9fedde67b",3127:"dbb10377920ca14e55a2",3179:"b87763465b433e5b66fd",3291:"1b7cd1c0d6b4fdf5f9e9",3502:"1985af3fa836c4248178",3596:"ca806447f87d03e5b322",3610:"c79c6bddd919cb78428a",3717:"6f65e91a870250a6e450",3842:"8758110ab553b5368121",3889:"c5a6834243c3ccfc1fcb",3896:"14d9e7509c300245c219",3980:"9d7eeb2bacce45c508b3",3986:"aee89bf9b2348c0d0d7f",4013:"38f48de95854d191751c",4015:"9b6607a6f543f077c5a5",4062:"9229fac3ef3db26fd5bc",4079:"97a8e6dbe1a94532eb49",4081:"c86fb8f04554726af6c0",4215:"8934b190aaed2663c300",4378:"a2a37780b99d50d784f7",4387:"b928c72ea82decd4ae7b",4389:"c0ec40f417c36a1c6179",4403:"fc4cac3ecee3925b9ec2",4665:"d7331dbca4a2aa0909e7",4713:"365b703a3ce33b603ace",4717:"ff71583495773a86dd1b",4862:"f3c95c3754723530ee6d",4894:"035fecc664874bb752b0",4987:"a23484dfcca6d5fae195",5009:"4b08ba7264d2d6e73f2e",5050:"cc5e2d631f109ee4d535",5093:"e192c9080b7e430f8bfc",5145:"da831552b3b54ca47682",5163:"953e65e04ed31b0ea0b3",5403:"a8ce3bbae4ddbe632714",5516:"6b6f00fca2682a673f64",5551:"340e60e2342b0d93ebe7",5598:"52ad6e6d7d7b134ab0ba",5649:"5c1e55c9dad604880876",5711:"592f6b06b20ea7958f2e",5866:"039e25226b82968cca61",5871:"1571b33c7b086a73eadd",5899:"610e274e70fffca8c232",5901:"bf6858d021c8e6c577d5",5993:"0e5f49179c6a516963de",6025:"d669a0315da9d6fda6b3",6036:"5b373caaaa6e1ba4495f",6106:"1d31df88e63bf542ea7b",6166:"8b7dc7926d170fc11eac",6214:"5a578175aab923a979dc",6221:"56c4d15c823c019ddb39",6265:"4788a10b2e7019e41282",6456:"44f6b4ef758efe0fb876",6494:"7f264af8142cb9910c06",6625:"364cf21fe24d7e675de8",6631:"f4fa646ba9150ed60d55",6639:"a1bd5bf1d51c681561a1",6752:"912872ffa56a7243d664",6780:"36857414f568c0fc82b2",6831:"912351c7cf5f8ac16dfe",6884:"07642217627127113fb0",6925:"665969c4af4481df0691",6949:"f50051a55eaa8dd5e780",
|
||||
9685:"series-icons-map"}[e]||e)+"."+{6:"a03a8ff024d47ed075c6",92:"bfb76cc7578ab709169b",139:"02c0064b96893d572f7c",306:"6c2d5d0bc3a42274d1e6",507:"ed33f2a0cf4f0d37ca70",607:"8ba8754a2a9412395338",731:"f9dfb2d8c088196803c5",769:"9e4ee987380cde8a482f",855:"61db310932f8af2c5989",898:"b63568700f1380e37b1a",962:"e2eb6a85de39a3d76e5d",1013:"ccba7f12442264960551",1033:"bb804c64fe58de0bace7",1044:"c0b266912178dd5523e1",1054:"c09e1aa220385adef79a",1109:"845f0f111ff830ab93c8",1365:"e1fe1d66c5bb17da7c3a",1553:"c076714f5e24887f0b94",1583:"9222abe1a9c6cc59d449",1584:"429d5a2ad09b6791326c",1702:"3f5b604134bebba28c6c",1754:"33210ecad56124f25ac1",1762:"9511e5b410d7d629bc49",1859:"a3a8e03aafa01f2649cb",1890:"8b313f77ea6c1f51530a",2020:"4a7196a939413830080e",2077:"53c155e0d72b7d0f0e3d",2109:"291fa715b6ded706c3dd",2183:"a80a3e282aa441e156d1",2191:"2197cc1b66a1db8969cc",2260:"95dc0a20b147b6b2eeed",2306:"e8314762db1d7d9aac81",2377:"6e30e0c48af40bf2f6c0",2587:"615babc52637decdb6e2",2616:"f065beaf6b5b37da27d9",2639:"a55d77a7912be54f7b9d",2666:"d28c0fa0a323b8118f22",2676:"a9a5ede4d514162164fa",2704:"b2d329d398bc58f1b425",2731:"55eed17fefac5e82c077",2878:"1077ac737eee4d6fdb30",2984:"dc61504f5c150afee786",3005:"d2aa6e1dc6d61ae08053",3016:"37427b1dab6d44713245",3030:"dbb4bdcbf10acf6b5280",3066:"8b1d2ceb22d9fedde67b",3127:"dbb10377920ca14e55a2",3179:"b87763465b433e5b66fd",3291:"1b7cd1c0d6b4fdf5f9e9",3502:"1985af3fa836c4248178",3596:"ca806447f87d03e5b322",3610:"c79c6bddd919cb78428a",3717:"6f65e91a870250a6e450",3842:"8758110ab553b5368121",3889:"c5a6834243c3ccfc1fcb",3896:"14d9e7509c300245c219",3980:"9d7eeb2bacce45c508b3",3986:"aee89bf9b2348c0d0d7f",4013:"38f48de95854d191751c",4015:"9b6607a6f543f077c5a5",4062:"9229fac3ef3db26fd5bc",4079:"97a8e6dbe1a94532eb49",4081:"c86fb8f04554726af6c0",4215:"8934b190aaed2663c300",4378:"a2a37780b99d50d784f7",4387:"b928c72ea82decd4ae7b",4389:"c0ec40f417c36a1c6179",4403:"fc4cac3ecee3925b9ec2",4665:"d7331dbca4a2aa0909e7",4713:"365b703a3ce33b603ace",4717:"ff71583495773a86dd1b",4862:"f3c95c3754723530ee6d",4894:"035fecc664874bb752b0",4987:"a23484dfcca6d5fae195",5009:"4b08ba7264d2d6e73f2e",5050:"cc5e2d631f109ee4d535",5093:"e192c9080b7e430f8bfc",5145:"da831552b3b54ca47682",5163:"953e65e04ed31b0ea0b3",5403:"a8ce3bbae4ddbe632714",5516:"6b6f00fca2682a673f64",5551:"340e60e2342b0d93ebe7",5598:"52ad6e6d7d7b134ab0ba",5649:"5c1e55c9dad604880876",5711:"592f6b06b20ea7958f2e",5866:"039e25226b82968cca61",5871:"1571b33c7b086a73eadd",5899:"610e274e70fffca8c232",5901:"3f691f17bd266aac284c",5993:"0e5f49179c6a516963de",6025:"d669a0315da9d6fda6b3",6036:"5b373caaaa6e1ba4495f",6106:"1d31df88e63bf542ea7b",6166:"8b7dc7926d170fc11eac",6214:"5a578175aab923a979dc",6221:"56c4d15c823c019ddb39",6265:"59756c2933ec24d194f0",6456:"44f6b4ef758efe0fb876",6494:"7f264af8142cb9910c06",6625:"364cf21fe24d7e675de8",6631:"f4fa646ba9150ed60d55",6639:"a1bd5bf1d51c681561a1",6752:"912872ffa56a7243d664",6780:"36857414f568c0fc82b2",6831:"912351c7cf5f8ac16dfe",6884:"07642217627127113fb0",6925:"665969c4af4481df0691",6949:"f50051a55eaa8dd5e780",
|
||||
6959:"61ce9bf171293ea37c54",7078:"aef234c059b0b7c64ae8",7111:"4716f3208dc337521c10",7149:"d450e8145ad7e6fbd67f",7194:"098c1a8da1ddbbda98f6",7232:"abf9ba18c92e46a44f3b",7260:"4c9c01959c7ebe94b74f",7271:"1c3f95ada81fc7c425a4",7350:"aa555ff9e17c4029aedd",7391:"c63bd39c42093cc4130c",7413:"3a52b91975b98e6fe8e4",7555:"ea682716c26bc13db765",7648:"d599965fb89ec8e183eb",7871:"df6a9177c293c0c53e80",7987:"2267a50d874703af7f28",8020:"520f315000510aab3003",8056:"c06a1c8fb4a1f18cf217",8115:"aef220eae07f8df278f7",8149:"9fb525d10e5c8ba95701",8167:"fd915cf05676c668486e",8385:"32e961c4a8591abe04cd",8399:"ebb97a8311b57f015b11",8537:"168b8df16f57900a29da",8643:"71b6b063699eb3e1407e",8890:"9d651e36d783aafef499",8904:"87e94e93ade13962a48f",9039:"0a3f1b99d355b6297d18",9138:"f516266ddcf6ca8c7064",9322:"fcbf1e7bff530c95a44f",9327:"0c38440ca52f144413ac",9374:"4660d2cad62644ff2ea9",9498:"3892fbd90646aa80aef1",9685:"6b7b2f52a18274053c99",9727:"f86b3426312923af0159",9789:"458feb5c8c0263b0618b",9795:"d66be24693cf931f6914",9842:"581808dd4a8651b16779",9916:"0c2cb2d12479a20efce1"}[e]+".js",r.miniCssF=e=>e+"."+{6:"362fa6a7ab1f3e3b06c4",855:"26e8cce3ad082b02cc26",898:"f909d7c1efc95f635922",1013:"01583b91f7384f25e038",1033:"5197f9f8b8500206d06c",1054:"d5b8033c360af91ed458",1109:"ec16a629917db2baf412",1365:"0116666d16b5bc64c47a",1762:"7ff6b353c441db2276da",2109:"39627406fe95483ff7db",2191:"6563d97efc3339a1e518",2260:"b98824e4829a1aa9b444",2587:"1f1100dc01693edfe269",2639:"c87f745c32020e3a8cff",2666:"fbb750fd312778403036",2676:"2d3cabbd39a3b0d6e9ea",2731:"df45c9c18811872fec07",2984:"57f5ad22257d1a4e1ef9",3066:"2acb4b086c32c9448837",3127:"fd89143aebe89e23faed",3502:"c49903f7222870ff8aca",3610:"62c553543d76c38edfbc",3717:"da244b56f00e05470918",3842:"6a8a7842ee841f6d2cff",3889:"a2646d6c3b33d166eee2",3896:"019229d7d874e1da11be",3980:"b2ff45a2d8bb6a131d7c",4015:"1d0e3a62a59d173c81f3",4081:"1a314e4dade74df359f0",4215:"d24836a292b1969ab4bb",4387:"bf2665aacf1dc00074fa",4894:"cc39b3740f4022cbd5cf",4987:"861f49973c19dc84365b",5145:"a2b224fd27ab2941c565",5163:"8dc3fd2d8bb68b7d880e",5403:"d6bd43a35209059f1060",5649:"b60ed09c5ea8c55827d4",5866:"c89b7fc29afe92efc1f3",5993:"d3e96a56dd65b0b2db55",6025:"263b457b1a7f9ca139b2",6036:"3b493a9f0ab052e6447c",6106:"cf6f129517250c80b39f",6214:"65b7dbf8be6cca5ac143",6221:"25d30f095d6a54fbf276",6494:"e9af15c073886bef781b",6625:"cd54dd2a77c47eb6003d",6639:"cea47dbe77ae73ace44b",6752:"207eb3cc75b3ed2c6754",6831:"ac1745947bd2665f6c9a",6884:"bb7d30a7bbbe5af36556",6925:"43e91cba4f1aefba5311",6949:"19355e81a60b640ea097",6959:"0cd4b06da6b4fd1fcc56",7111:"b16b4eb739a7e8577559",7149:"12adbb19fdefe9b66b18",7194:"e04f69c8933166966874",7232:"dfa17050a6458c8bf3da",7350:"abf568a3d6ce7b47cc59",7391:"9c809fa91ed0c8f75bc0",7413:"f830ad1ad6ee6f9b1cb3",7555:"8c1e3939e7666b0f8c69",7871:"cb99fc4ec9bbe0895a26",8056:"a83d512c1dc2173349a1",8149:"21f2b01074a4d082e268",8399:"525ea48565b11d84e370",8904:"a302177fe7e3ccd50cb0",9138:"03b8fbcfabcae851949a",9322:"beec29aa1b9aa9601ccf",9327:"e6fe2b8bd7bfc4b93efe",9789:"cb5ad20bc727d3820b6c",
|
||||
9842:"2f8e5864b0d72a886373",9916:"60c48148a54dba9504a0"}[e]+".css",r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.hmd=e=>((e=Object.create(e)).children||(e.children=[]),Object.defineProperty(e,"exports",{enumerable:!0,set:()=>{throw new Error("ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: "+e.id)}}),e),r.o=(e,a)=>Object.prototype.hasOwnProperty.call(e,a),d={},f="tradingview:",r.l=(e,a,c,t)=>{if(d[e])d[e].push(a);else{var b,o;if(void 0!==c)for(var n=document.getElementsByTagName("script"),i=0;i<n.length;i++){var s=n[i];if(s.getAttribute("src")==e||s.getAttribute("data-webpack")==f+c){b=s;break}}b||(o=!0,(b=document.createElement("script")).charset="utf-8",b.timeout=120,r.nc&&b.setAttribute("nonce",r.nc),b.setAttribute("data-webpack",f+c),b.src=e,0!==b.src.indexOf(window.location.origin+"/")&&(b.crossOrigin="anonymous")),d[e]=[a];var l=(a,c)=>{b.onerror=b.onload=null,clearTimeout(u);var f=d[e];if(delete d[e],b.parentNode&&b.parentNode.removeChild(b),f&&f.forEach((e=>e(c))),a)return a(c)},u=setTimeout(l.bind(null,void 0,{type:"timeout",target:b}),12e4);b.onerror=l.bind(null,b.onerror),b.onload=l.bind(null,b.onload),o&&document.head.appendChild(b)}},r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),(()=>{var e;r.g.importScripts&&(e=r.g.location+"");var a=r.g.document;if(!e&&a&&(a.currentScript&&(e=a.currentScript.src),!e)){var c=a.getElementsByTagName("script");c.length&&(e=c[c.length-1].src)}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),r.p=e})(),r.g.location&&r.p.startsWith(r.g.location.origin)&&(r.p=r.p.slice(r.g.location.origin.length)),(()=>{const e=r.u;r.u=a=>e(a).replace("__LANG__",r.g.language)})(),r.p=r.g.WEBPACK_PUBLIC_PATH||r.p;var o=r.e,n=Object.create(null);function i(e,a){return o(e).catch((function(){return new Promise((function(c){var d=function(){self.removeEventListener("online",d,!1),!1===navigator.onLine?self.addEventListener("online",d,!1):c(a<2?i(e,a+1):o(e))};setTimeout(d,a*a*1e3)}))}))}r.e=function(e){if(!n[e]){n[e]=i(e,0);var a=function(){delete n[e]};n[e].then(a,a)}return n[e]},(()=>{if("undefined"!=typeof document){var e=e=>new Promise(((a,c)=>{var d=r.miniCssF(e),f=r.p+d;if(((e,a)=>{for(var c=document.getElementsByTagName("link"),d=0;d<c.length;d++){var f=(b=c[d]).getAttribute("data-href")||b.getAttribute("href");if("stylesheet"===b.rel&&(f===e||f===a))return b}var t=document.getElementsByTagName("style");for(d=0;d<t.length;d++){var b;if((f=(b=t[d]).getAttribute("data-href"))===e||f===a)return b}})(d,f))return a();((e,a,c,d,f)=>{var t=document.createElement("link");t.rel="stylesheet",t.type="text/css",t.onerror=t.onload=c=>{if(t.onerror=t.onload=null,
|
||||
"load"===c.type)d();else{var b=c&&("load"===c.type?"missing":c.type),r=c&&c.target&&c.target.href||a,o=new Error("Loading CSS chunk "+e+" failed.\n("+r+")");o.code="CSS_CHUNK_LOAD_FAILED",o.type=b,o.request=r,t.parentNode&&t.parentNode.removeChild(t),f(o)}},t.href=a,0!==t.href.indexOf(window.location.origin+"/")&&(t.crossOrigin="anonymous"),c?c.parentNode.insertBefore(t,c.nextSibling):document.head.appendChild(t)})(e,f,null,a,c)})),a={3666:0};r.f.miniCss=(c,d)=>{a[c]?d.push(a[c]):0!==a[c]&&{6:1,855:1,898:1,1013:1,1033:1,1054:1,1109:1,1365:1,1762:1,2109:1,2191:1,2260:1,2587:1,2639:1,2666:1,2676:1,2731:1,2984:1,3066:1,3127:1,3502:1,3610:1,3717:1,3842:1,3889:1,3896:1,3980:1,4015:1,4081:1,4215:1,4387:1,4894:1,4987:1,5145:1,5163:1,5403:1,5649:1,5866:1,5993:1,6025:1,6036:1,6106:1,6214:1,6221:1,6494:1,6625:1,6639:1,6752:1,6831:1,6884:1,6925:1,6949:1,6959:1,7111:1,7149:1,7194:1,7232:1,7350:1,7391:1,7413:1,7555:1,7871:1,8056:1,8149:1,8399:1,8904:1,9138:1,9322:1,9327:1,9789:1,9842:1,9916:1}[c]&&d.push(a[c]=e(c).then((()=>{a[c]=0}),(e=>{throw delete a[c],e})))}}})(),(()=>{var e={3666:0,3515:0};r.f.j=(a,c)=>{var d=r.o(e,a)?e[a]:void 0;if(0!==d)if(d)c.push(d[2]);else if(/^(1(0(13|33|54)|109|365|762)|2(6(39|66|76)|109|191|260|587|731|984)|3(8(42|89|96)|[06]66|127|502|515|610|717|980)|4([02]15|[39]87|081|894)|5((16|40|99)3|145|649|866)|6(9(25|49|59)|[06]25|(21|49|88)4||036|106|221|639|752|831)|7(1(11|49|94)|232|350|391|413|555|871)|8(056|149|399|55|904|98)|9(32[27]|138|789|842|916))$/.test(a))e[a]=0;else{var f=new Promise(((c,f)=>d=e[a]=[c,f]));c.push(d[2]=f);var t=r.p+r.u(a),b=new Error;r.l(t,(c=>{if(r.o(e,a)&&(0!==(d=e[a])&&(e[a]=void 0),d)){var f=c&&("load"===c.type?"missing":c.type),t=c&&c.target&&c.target.src;b.message="Loading chunk "+a+" failed.\n("+f+": "+t+")",b.name="ChunkLoadError",b.type=f,b.request=t,d[1](b)}}),"chunk-"+a,a)}},r.O.j=a=>0===e[a];var a=(a,c)=>{var d,f,[t,b,o]=c,n=0;if(t.some((a=>0!==e[a]))){for(d in b)r.o(b,d)&&(r.m[d]=b[d]);if(o)var i=o(r)}for(a&&a(c);n<t.length;n++)f=t[n],r.o(e,f)&&e[f]&&e[f][0](),e[f]=0;return r.O(i)},c=self.webpackChunktradingview=self.webpackChunktradingview||[];c.forEach(a.bind(null,0)),c.push=a.bind(null,c.push.bind(c))})(),(()=>{const{miniCssF:e}=r;r.miniCssF=a=>self.document&&"rtl"===self.document.dir?e(a).replace(/\.css$/,".rtl.css"):e(a)})()})();
|
||||
File diff suppressed because one or more lines are too long
171
charting_library/charting_library.d.ts
vendored
171
charting_library/charting_library.d.ts
vendored
@@ -2852,6 +2852,30 @@ export interface ChartPropertiesOverrides extends StudyOverrides {
|
||||
* @default 50
|
||||
*/
|
||||
"mainSeriesProperties.baselineStyle.baseLevelPercentage": number;
|
||||
/**
|
||||
* Main series Line With Markers style Line Color.
|
||||
*
|
||||
* @default '#2962FF'
|
||||
*/
|
||||
"mainSeriesProperties.lineWithMarkersStyle.color": string;
|
||||
/**
|
||||
* Main series Line With Markers style Line style.
|
||||
*
|
||||
* @default LineStyle.Solid
|
||||
*/
|
||||
"mainSeriesProperties.lineWithMarkersStyle.linestyle": OverrideLineStyle;
|
||||
/**
|
||||
* Main series Line With Markers style Line width.
|
||||
*
|
||||
* @default 2
|
||||
*/
|
||||
"mainSeriesProperties.lineWithMarkersStyle.linewidth": number;
|
||||
/**
|
||||
* Main series Line With Markers style Price Source.
|
||||
*
|
||||
* @default 'close'
|
||||
*/
|
||||
"mainSeriesProperties.lineWithMarkersStyle.priceSource": string;
|
||||
}
|
||||
/**
|
||||
* A chart template.
|
||||
@@ -3067,7 +3091,7 @@ export interface ChartingLibraryWidgetOptions {
|
||||
*/
|
||||
studies_access?: AccessList;
|
||||
/**
|
||||
* Maximum amount of studies on the chart of a multichart layout. Minimum value is 2.
|
||||
* Maximum amount of studies allowed at one time within the layout. Minimum value is 2.
|
||||
*
|
||||
* ```javascript
|
||||
* study_count_limit: 5,
|
||||
@@ -3482,7 +3506,7 @@ export interface ChartingLibraryWidgetOptions {
|
||||
* For example, if you want to rename "Trend Line" shape to "Line Shape", then you can do something like this:
|
||||
*
|
||||
* ```javascript
|
||||
* custom_translate_function: (key, options) => {
|
||||
* custom_translate_function: (key, options, isTranslated) => {
|
||||
* if (key === 'Trend Line') {
|
||||
* // patch the title of trend line
|
||||
* return 'Line Shape';
|
||||
@@ -3649,8 +3673,27 @@ export interface ContextMenuOptions {
|
||||
*
|
||||
* You can filter out, add yours and re-order items.
|
||||
*
|
||||
* The library will call your function each time it wants to display a context menu and with provide a list of items to display.
|
||||
* The library will call your function each time it wants to display a context menu and will provide a list of items to display.
|
||||
* This function should return an array of items to display.
|
||||
*
|
||||
* Example:
|
||||
*
|
||||
* ```js
|
||||
* context_menu: {
|
||||
* items_processor: function(items, actionsFactory, params) {
|
||||
* console.log(`Menu name is: ${params.menuName}`);
|
||||
* const newItem = actionsFactory.createAction({
|
||||
* actionId: 'hello-world',
|
||||
* label: 'Say Hello',
|
||||
* onExecute: function() {
|
||||
* alert('Hello World');
|
||||
* },
|
||||
* });
|
||||
* items.unshift(newItem);
|
||||
* return Promise.resolve(items);
|
||||
* },
|
||||
* },
|
||||
* ```
|
||||
*/
|
||||
items_processor?: ContextMenuItemsProcessor;
|
||||
/**
|
||||
@@ -3747,6 +3790,16 @@ export interface CreateContextMenuParams {
|
||||
type: "groupOfShapes";
|
||||
/** id */
|
||||
id: string | null;
|
||||
} | {
|
||||
/** Trading position */
|
||||
type: "position";
|
||||
/** id */
|
||||
id: string | null;
|
||||
} | {
|
||||
/** Trading order */
|
||||
type: "order";
|
||||
/** id */
|
||||
id: string | null;
|
||||
};
|
||||
}
|
||||
export interface CreateHTMLButtonOptions {
|
||||
@@ -4179,6 +4232,19 @@ export interface CustomTimezoneInfo {
|
||||
*/
|
||||
title: string;
|
||||
}
|
||||
/**
|
||||
* Additional translation options
|
||||
*/
|
||||
export interface CustomTranslateOptions {
|
||||
/** Plural/s of the phrase */
|
||||
plural?: string | string[];
|
||||
/** Count of the phrase */
|
||||
count?: number;
|
||||
/** Context of the phrase */
|
||||
context?: string;
|
||||
/** Replacements object */
|
||||
replace?: Record<string, string>;
|
||||
}
|
||||
/**
|
||||
* Override properties for the Cypherpattern drawing tool.
|
||||
*/
|
||||
@@ -7008,21 +7074,11 @@ export interface IBrokerConnectionAdapterFactory {
|
||||
createWatchedValue<T>(value?: T): IWatchedValue<T>;
|
||||
/**
|
||||
* Creates a price formatter.
|
||||
* @param priceScale - defines the number of decimal places. It is `10^number-of-decimal-places`. If a price is displayed as `1.01`, `pricescale` is `100`; If it is displayed as `1.005`, `pricescale` is `1000`.
|
||||
* @param minMove - the amount of price precision steps for 1 tick. For example, since the tick size for U.S. equities is `0.01`, `minmov` is 1. But the price of the E-mini S&P futures contract moves upward or downward by `0.25` increments, so the `minmov` is `25`.
|
||||
* @param fractional - for common prices is `false` or it can be skipped.
|
||||
* @param minMove2 - for common prices is `0` or it can be skipped.
|
||||
* @param variableMinTick - for common prices is string (for example, `0.01 10 0.02 25 0.05`) or it can be skipped.
|
||||
*
|
||||
* Example:
|
||||
* 1. Typical stock with `0.01` price increment: `minmov = 1, pricescale = 100, minmove2 = 0`.
|
||||
* 2. If `minmov = 1, pricescale = 100, minmove2 = 0, variableMinTick = "0.01 10 0.02 25 0.05"`:
|
||||
*
|
||||
* - for `price = 9`: `minmov = 1, pricescale = 100, minmove2 = 0`.
|
||||
* - for `price = 13`: `minmov = 2, pricescale = 100, minmove2 = 0`.
|
||||
* - for `price = 27`: `minmov = 5, pricescale = 100, minmove2 = 0`.
|
||||
*
|
||||
* For more information on fractional prices, see this [article](https://www.tradingview.com/charting-library-docs/latest/connecting_data/Symbology#price-format)
|
||||
* @param priceScale - Defines the number of decimal places. It is `10^number-of-decimal-places`. If a price is displayed as `1.01`, `pricescale` is `100`; If it is displayed as `1.005`, `pricescale` is `1000`.
|
||||
* @param minMove - The amount of price precision steps for 1 tick. For example, since the tick size for U.S. equities is `0.01`, `minmov` is 1. But the price of the E-mini S&P futures contract moves upward or downward by `0.25` increments, so the `minmov` is `25`.
|
||||
* @param fractional - For common prices, is `false` or it can be skipped. For more information on fractional prices, refer to [Fractional format](https://www.tradingview.com/charting-library-docs/latest/connecting_data/Symbology.md#fractional-format).
|
||||
* @param minMove2 - For common prices, is `0` or it can be skipped.
|
||||
* @param variableMinTick - For common prices, is `string` (for example, `0.01 10 0.02 25 0.05`) or it can be skipped. For more information, refer to [Variable tick size](https://www.tradingview.com/charting-library-docs/latest/connecting_data/Symbology.md#variable-tick-size).
|
||||
*/
|
||||
createPriceFormatter(priceScale?: number, minMove?: number, fractional?: boolean, minMove2?: number, variableMinTick?: string): IPriceFormatter;
|
||||
}
|
||||
@@ -9864,12 +9920,20 @@ export interface IOrderLineAdapter {
|
||||
* Get the line length of the order line.
|
||||
*/
|
||||
getLineLength(): number;
|
||||
/**
|
||||
* Get the unit of length specified for the line length of the order line.
|
||||
*/
|
||||
getLineLengthUnit(): OrderLineLengthUnit;
|
||||
/**
|
||||
* Set the line length of the order line.
|
||||
*
|
||||
* If negative number is provided for the value and the unit is 'pixel' then
|
||||
* the position will be relative to the left edge of the chart.
|
||||
*
|
||||
* @param value The new line length.
|
||||
* @param [unit] - unit for the line length, defaults to 'percentage'.
|
||||
*/
|
||||
setLineLength(value: number): this;
|
||||
setLineLength(value: number, unit?: OrderLineLengthUnit): this;
|
||||
/**
|
||||
* Get the line style of the order line.
|
||||
*/
|
||||
@@ -10242,15 +10306,24 @@ export interface IPositionLineAdapter {
|
||||
* @param value The new extend left flag value.
|
||||
*/
|
||||
setExtendLeft(value: boolean): this;
|
||||
/**
|
||||
* Get the unit of length specified for the line length of the position line.
|
||||
*/
|
||||
getLineLengthUnit(): PositionLineLengthUnit;
|
||||
/**
|
||||
* Get the line length of the position line.
|
||||
*/
|
||||
getLineLength(): number;
|
||||
/**
|
||||
* Set the line length of the position line.
|
||||
*
|
||||
* If negative number is provided for the value and the unit is 'pixel' then
|
||||
* the position will be relative to the left edge of the chart.
|
||||
*
|
||||
* @param value The new line length.
|
||||
* @param [unit] - unit for the line length, defaults to 'percentage'.
|
||||
*/
|
||||
setLineLength(value: number): this;
|
||||
setLineLength(value: number, unit?: PositionLineLengthUnit): this;
|
||||
/**
|
||||
* Get the line style of the position line.
|
||||
*/
|
||||
@@ -11683,6 +11756,10 @@ export interface LibrarySubsessionInfo {
|
||||
* Session corrections string. See {@link LibrarySymbolInfo.corrections}.
|
||||
*/
|
||||
"session-correction"?: string;
|
||||
/**
|
||||
* Session to display. See {@link LibrarySymbolInfo.session_display}.
|
||||
*/
|
||||
"session-display"?: string;
|
||||
}
|
||||
export interface LibrarySymbolInfo {
|
||||
/**
|
||||
@@ -11889,10 +11966,12 @@ export interface LibrarySymbolInfo {
|
||||
*/
|
||||
seconds_multipliers?: string[];
|
||||
/**
|
||||
* The boolean value showing whether data feed has its own daily resolution bars or not.
|
||||
* The boolean value specifying whether the datafeed can supply historical data at the daily resolution.
|
||||
*
|
||||
* If `has_daily` is set to `false`, all buttons for resolutions that include days are disabled for this particular symbol.
|
||||
* Otherwise, the library requests daily bars from the datafeed.
|
||||
* All daily resolutions that the datafeed supplies must be included in the {@link LibrarySymbolInfo.daily_multipliers} array.
|
||||
*
|
||||
* If `has_daily` = `false` then the library will build the respective resolutions using 1-minute bars by itself.
|
||||
* If not, then it will request those bars from the data feed only if specified resolution belongs to `daily_multipliers`, otherwise an error will be thrown.
|
||||
* @default true
|
||||
*/
|
||||
has_daily?: boolean;
|
||||
@@ -15548,9 +15627,9 @@ export interface StudyOrDrawingAddedToChartEventParams {
|
||||
}
|
||||
/**
|
||||
* Study overrides.
|
||||
* See [Studies Overrides](https://www.tradingview.com/charting-library-docs/latest/customization/overrides/Studies-Overrides) to get a list of all possible properties to override.
|
||||
*
|
||||
* @example { 'a.overridable.property': 123 }
|
||||
* See [Studies Overrides](https://www.tradingview.com/charting-library-docs/latest/customization/overrides/Studies-Overrides) to get a list of all possible properties to override.
|
||||
*/
|
||||
export interface StudyOverrides {
|
||||
/**
|
||||
@@ -16667,6 +16746,10 @@ export interface TradingTerminalWidgetOptions extends Omit<ChartingLibraryWidget
|
||||
* ```
|
||||
*/
|
||||
rss_news_feed?: RssNewsFeedParams;
|
||||
/**
|
||||
* Title for the News Widget
|
||||
*/
|
||||
rss_news_title?: string;
|
||||
/**
|
||||
* Use this property to set your own news getter function. Both the `symbol` and `callback` will be passed to the function.
|
||||
*
|
||||
@@ -16706,19 +16789,6 @@ export interface TradingTerminalWidgetOptions extends Omit<ChartingLibraryWidget
|
||||
*/
|
||||
broker_factory?(host: IBrokerConnectionAdapterHost): IBrokerWithoutRealtime | IBrokerTerminal;
|
||||
}
|
||||
/**
|
||||
* Additional translation options
|
||||
*/
|
||||
export interface TranslateOptions {
|
||||
/** Plural of the phrase */
|
||||
plural?: string;
|
||||
/** Count of the phrase */
|
||||
count?: number;
|
||||
/** Context of the phrase */
|
||||
context?: string;
|
||||
/** Replacements object */
|
||||
replace?: Record<string, string>;
|
||||
}
|
||||
/**
|
||||
* Override properties for the Trendangle drawing tool.
|
||||
*/
|
||||
@@ -17639,6 +17709,12 @@ export type ChartingLibraryFeatureset =
|
||||
"pre_post_market_sessions" |
|
||||
/** Show the option to specify the default right margin in percentage within chart settings dialog @default false */
|
||||
"show_percent_option_for_right_margin" |
|
||||
/**
|
||||
* Lock the visible range when adjusting the percentage right margin via the settings dialog.
|
||||
* This applies when the chart is already at the current default margin position.
|
||||
* @default false
|
||||
*/
|
||||
"lock_visible_time_range_when_adjusting_percentage_right_margin" |
|
||||
/**
|
||||
* Alternative loading mode for the library, which can be used to support
|
||||
* older browsers and a few non-standard browsers.
|
||||
@@ -17686,15 +17762,21 @@ export type ChartingLibraryFeatureset =
|
||||
*/
|
||||
"always_show_legend_values_on_mobile" |
|
||||
/** Enable studies to extend the time scale, if enabled in the study metainfo */
|
||||
"studies_extend_time_scale";
|
||||
"studies_extend_time_scale" |
|
||||
/**
|
||||
* Enable accessibility features. Adds a keyboard shortcut which turns on keyboard navigation (alt/opt + z).
|
||||
* @default true
|
||||
*/
|
||||
"accessibility";
|
||||
/** These are defining the types for a background */
|
||||
export type ColorTypes = "solid" | "gradient";
|
||||
/**
|
||||
* Context menu items processor signature
|
||||
* @param {readonlyIActionVariant[]} items - an array of items the library wants to display
|
||||
* @param {ActionsFactory} actionsFactory - factory you could use to create a new items for the context menu.
|
||||
* @param {CreateContextMenuParams} params - an object representing additional information about the context menu, such as the menu name.
|
||||
*/
|
||||
export type ContextMenuItemsProcessor = (items: readonly IActionVariant[], actionsFactory: ActionsFactory) => Promise<readonly IActionVariant[]>;
|
||||
export type ContextMenuItemsProcessor = (items: readonly IActionVariant[], actionsFactory: ActionsFactory, params: CreateContextMenuParams) => Promise<readonly IActionVariant[]>;
|
||||
/**
|
||||
* @param {readonlyIActionVariant[]} items - an array of items the library wants to display
|
||||
* @param {CreateContextMenuParams} params - an object representing where the user right-clicked on (only if there is an existing menu)
|
||||
@@ -17719,9 +17801,10 @@ export type CustomTimezones = "Africa/Cairo" | "Africa/Casablanca" | "Africa/Joh
|
||||
/**
|
||||
* Custom translation function
|
||||
* @param {string} key - key for string to be translated
|
||||
* @param {TranslateOptions} options? - additional translation options
|
||||
* @param {CustomTranslateOptions} [options] - additional translation options
|
||||
* @param {boolean} [isTranslated] - True, if the provide key is already translated
|
||||
*/
|
||||
export type CustomTranslateFunction = (key: string, options?: TranslateOptions) => string | null;
|
||||
export type CustomTranslateFunction = (key: string, options?: CustomTranslateOptions, isTranslated?: boolean) => string | null;
|
||||
export type DOMCallback = (data: DOMData) => void;
|
||||
export type DateFormat = keyof typeof dateFormatFunctions;
|
||||
export type DeepWriteable<T> = {
|
||||
@@ -17860,16 +17943,17 @@ export type ISeriesStudyResult = [ /* time */
|
||||
*/
|
||||
export type InputFieldValidator = (value: any) => InputFieldValidatorResult;
|
||||
export type InputFieldValidatorResult = PositiveBaseInputFieldValidatorResult | NegativeBaseInputFieldValidatorResult;
|
||||
export type LanguageCode = "ar" | "zh" | "cs" | "da_DK" | "ca_ES" | "nl_NL" | "en" | "et_EE" | "fr" | "de" | "el" | "he_IL" | "hu_HU" | "id_ID" | "it" | "ja" | "ko" | "fa" | "pl" | "pt" | "ro" | "ru" | "sk_SK" | "es" | "sv" | "th" | "tr" | "vi" | "no" | "ms_MY" | "zh_TW";
|
||||
export type LanguageCode = "ar" | "zh" | "cs" | "ca_ES" | "nl_NL" | "en" | "fr" | "de" | "el" | "he_IL" | "hu_HU" | "id_ID" | "it" | "ja" | "ko" | "fa" | "pl" | "pt" | "ro" | "ru" | "es" | "sv" | "th" | "tr" | "vi" | "ms_MY" | "zh_TW";
|
||||
export type LayoutType = SingleChartLayoutType | MultipleChartsLayoutType;
|
||||
export type LegendMode = "horizontal" | "vertical";
|
||||
export type LibrarySessionId = "regular" | "extended" | "premarket" | "postmarket";
|
||||
export type MarkConstColors = "red" | "green" | "blue" | "yellow";
|
||||
export type MultipleChartsLayoutType = "2h" | "2v" | "2-1" | "3s" | "3h" | "3v" | "4" | "6" | "8" | "1-2" | "3r" | "4h" | "4v" | "4s" | "5h" | "6h" | "7h" | "8h" | "1-3" | "2-2" | "2-3" | "1-4" | "5s" | "6c" | "8c" | "10c5" | "12c6" | "12c4" | "14c7" | "16c8" | "16c4";
|
||||
export type MultipleChartsLayoutType = "2h" | "2v" | "2-1" | "3s" | "3h" | "3v" | "4" | "6" | "8" | "1-2" | "3r" | "4h" | "4v" | "4s" | "5h" | "6h" | "7h" | "8h" | "1-3" | "2-2" | "2-3" | "1-4" | "5s" | "6c" | "8c";
|
||||
export type OnActionExecuteHandler = (action: IAction) => void;
|
||||
export type OnActionUpdateHandler = (action: IAction) => void;
|
||||
export type OnReadyCallback = (configuration: DatafeedConfiguration) => void;
|
||||
export type Order = PlacedOrder | BracketOrder;
|
||||
export type OrderLineLengthUnit = "pixel" | "percentage";
|
||||
export type OrderTableColumn = AccountManagerColumn & {
|
||||
/**
|
||||
* An optional numeric array of order statuses that is applied to order columns only. If it is available then the column will be displayed in the specified tabs of the status filter only.
|
||||
@@ -17890,6 +17974,7 @@ export type PageName = "watchlist_details_news" | "data_window" | "object_tree";
|
||||
* Plot shape ID.
|
||||
*/
|
||||
export type PlotShapeId = "shape_arrow_down" | "shape_arrow_up" | "shape_circle" | "shape_cross" | "shape_xcross" | "shape_diamond" | "shape_flag" | "shape_square" | "shape_label_down" | "shape_label_up" | "shape_triangle_down" | "shape_triangle_up";
|
||||
export type PositionLineLengthUnit = "pixel" | "percentage";
|
||||
export type PriceSource = "open" | "high" | "low" | "close";
|
||||
export type QuoteData = QuoteOkData | QuoteErrorData;
|
||||
/**
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
12
charting_library/datafeed-api.d.ts
vendored
12
charting_library/datafeed-api.d.ts
vendored
@@ -374,6 +374,10 @@ export interface LibrarySubsessionInfo {
|
||||
* Session corrections string. See {@link LibrarySymbolInfo.corrections}.
|
||||
*/
|
||||
"session-correction"?: string;
|
||||
/**
|
||||
* Session to display. See {@link LibrarySymbolInfo.session_display}.
|
||||
*/
|
||||
"session-display"?: string;
|
||||
}
|
||||
export interface LibrarySymbolInfo {
|
||||
/**
|
||||
@@ -580,10 +584,12 @@ export interface LibrarySymbolInfo {
|
||||
*/
|
||||
seconds_multipliers?: string[];
|
||||
/**
|
||||
* The boolean value showing whether data feed has its own daily resolution bars or not.
|
||||
* The boolean value specifying whether the datafeed can supply historical data at the daily resolution.
|
||||
*
|
||||
* If `has_daily` is set to `false`, all buttons for resolutions that include days are disabled for this particular symbol.
|
||||
* Otherwise, the library requests daily bars from the datafeed.
|
||||
* All daily resolutions that the datafeed supplies must be included in the {@link LibrarySymbolInfo.daily_multipliers} array.
|
||||
*
|
||||
* If `has_daily` = `false` then the library will build the respective resolutions using 1-minute bars by itself.
|
||||
* If not, then it will request those bars from the data feed only if specified resolution belongs to `daily_multipliers`, otherwise an error will be thrown.
|
||||
* @default true
|
||||
*/
|
||||
has_daily?: boolean;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"private": true,
|
||||
"description": "CL v26.001 (internal id 04caa94e @ 2023-08-09T11:45:15.021Z)",
|
||||
"description": "CL v26.002 (internal id 2dcfe7d4 @ 2023-09-18T14:22:15.636Z)",
|
||||
"type": "module",
|
||||
"main": "charting_library.cjs.js",
|
||||
"module": "charting_library.esm.js",
|
||||
|
||||
Reference in New Issue
Block a user