(self.webpackChunktradingview=self.webpackChunktradingview||[]).push([[81274],{59171:(e,t,n)=>{"use strict";var r=n(244842),o=[{d:"E-Mini S&P 500",t:"ES"},{d:"E-Mini Nasdaq 100",t:"NQ"},{d:"Gold",t:"GC"},{d:"Silver",t:"SI"},{d:"Crude Oil WTI",t:"CL"},{d:"Natural Gas",t:"NG"},{d:"Australian Dollar",t:"6A"},{d:"Australian Dollar (Floor)",t:"AD"},{d:"Euro FX",t:"6E"},{d:"Euro FX (Floor)",t:"EC"},{d:"Corn",t:"ZC"},{d:"Corn (Floor)",t:"C"},{d:"Eurodollar",t:"GE"},{d:"Eurodollar (Floor)",t:"ED"}],i=function(){var e=[{pattern:"(",ctor:s},{pattern:")",ctor:a},{pattern:"+",ctor:c},{pattern:"-",ctor:l},{pattern:"*",ctor:p},{pattern:"/",ctor:d},{pattern:"^",ctor:f},{pattern:/\d+(?:\.\d*|(?![a-zA-Z0-9_!:.&]))|\.\d+/,ctor:v},{pattern:/\./,ctor:P},{pattern:r.enabled("charting_library_base")?/[a-zA-Z0-9_\u0370-\u1FFF_\u2E80-\uFFFF^][a-zA-Z0-9_\u0020\u0370-\u1FFF_\u2E80-\uFFFF_!:.&]*|'.+?'/:/[a-zA-Z0-9_\u0370-\u1FFF_\u2E80-\uFFFF][a-zA-Z0-9_\u0020\u0370-\u1FFF_\u2E80-\uFFFF_!|:.&]*|'.+?'/,ctor:g},{pattern:/'[^']*/,ctor:_},{pattern:/[\0-\x20\s]+/,ctor:i}];function t(e,t){var n=function(){};return n.prototype=t.prototype,e.prototype=new n,e}function n(){}function i(e){this.value=e}function s(){}function a(){}function u(){}function c(){}function l(){}function p(){}function d(){}function f(){}n.prototype.toString=function(){return this.value},t(i,n),t(s,n),s.prototype.value="(",t(a,n),a.prototype.value=")",t(u,n),t(c,u),c.prototype.value="+",c.prototype.precedence=0,c.prototype.commutative=!0,t(l,u),l.prototype.value="-",l.prototype.precedence=0,l.prototype.commutative=!1,t(p,u),p.prototype.value="*",p.prototype.precedence=1,p.prototype.commutative=!0,t(d,u),d.prototype.value="/",d.prototype.precedence=1,d.prototype.commutative=!1,t(f,u),f.prototype.value="^",f.prototype.precedence=2,f.prototype.commutative=!1;var h=/^'?(?:([A-Z0-9_]+):)?(.*?)'?$/i,y=/[+\-/*]/;function g(e){this.value=e}function v(e){this.value=e}function S(e){this.value=e}function _(){g.apply(this,arguments)}function P(){v.apply(this,arguments)}t(g,n),g.prototype.toString=function(){if(this.hasOwnProperty("_ticker")){var e=y.test(this._ticker)?"'":"";return e+(this._exchange?this._exchange+":":"")+this._ticker+e}return this.value},g.prototype.parse=function(){var e=h.exec(this.value);e[1]&&(this._exchange=e[1]),this._ticker=e[2]},g.prototype.parseAsFutures=function(){this.hasOwnProperty("_ticker")||this.parse();for(var e=function(e){return o.some((function(t){return t.t===e}))},t=2;t>=1;--t){var n=this._ticker.slice(0,t);if(e(n)){this._root=n,this._contract=this._ticker.slice(t);break}}},g.prototype.exchange=function(e){if(this.hasOwnProperty("_ticker")||this.parse(),!(arguments.length>0))return this._exchange;null==e?delete this._exchange:this._exchange=e+""},g.prototype.ticker=function(e){if(this.hasOwnProperty("_ticker")||this.parse(),!(arguments.length>0))return this._ticker;null==e?delete this._ticker:this._ticker=e+"",delete this._root,delete this._contract},g.prototype.root=function(e){if(this.hasOwnProperty("_root")||this.parseAsFutures(), !(arguments.length>0))return this._root;null==e?delete this._root:(this._root=e+"",this._root&&(this._ticker=this._root+(this._contract||"")))},g.prototype.contract=function(e){if(this.hasOwnProperty("_contract")||this.parseAsFutures(),!(arguments.length>0))return this._root;null==e?delete this._contract:(this._contract=e+"",this._root&&(this._ticker=this._root+this._contract))},t(v,n),v.prototype.toString=function(){return this.hasOwnProperty("_normalizedValue")?this._normalizedValue:this.value},v.prototype.parse=function(){this._normalizedValue=this.value.replace(/^0+|\.0*$/g,"").replace(/(\.\d*?)0+$/,"$1").replace(/^(\.|$)/,"0$1")},S.prototype.toString=function(){return this.value},t(_,g),_.prototype.isIncomplete=!0,_.prototype.incompleteSuggest=function(){if("'"!==this.value)return String("'")},t(P,v),P.prototype.isIncomplete=!0;var m=new RegExp(e.map((function(e){return"("+("string"==typeof e.pattern?e.pattern.replace(/[\^$()[\]{}*+?|\\]/g,"\\$&"):e.pattern.source)+")"})).concat(".").join("|"),"g");function T(t,n){var r,o=[];e:for(;r=m.exec(t);){for(var s=e.length;s--;)if(r[s+1]){if(e[s].ctor){var a=new e[s].ctor(r[s+1]);a._offset=r.index,o.push(a)}continue e}var u=new S(r[0]);u._offset=r.index,o.push(u)}if(n&&n.recover){var c;for(s=o.length;s--;){var l=o[s];if(l instanceof v||l instanceof g){if(void 0!==c){var p=new g(""),d=o.splice(s,c-s+1,p);p.value=d.map((function(e){return e.value})).join("")}c=s}else l instanceof i||(c=void 0)}}return o}function I(e){for(var t=[],n=0;ni.precedence&&(r[r.length-1].minPrecedence=i.precedence);else if(i instanceof s)r.push(t={minPrecedence:1/0,openBraceIndex:o});else if(i instanceof a){var c=e[(t=r.pop()).openBraceIndex-1],l=e[o+1];l instanceof u&&!(l.precedence<=t.minPrecedence)||!(!(c instanceof u)||c.precedencet.minPrecedence&&(r[r.length-1].minPrecedence=t.minPrecedence))}}for(o=n.length;o--;)e.splice(n[o],1);return e}function A(e){if("string"!=typeof e)throw new TypeError("expression must be a string");return(e=T(e)).filter((function(e){return e instanceof g})).map((function(e){return e.exchange()})).filter((function(e){return e}))}function w(e){return 1!==(e=A(e)).length?null:e[0]}function O(e,t){return(e=A(e)).some((function(e){return t.includes((e||"").toUpperCase())}))}function C(e){return e.join("")}return{tokenize:T,validate:function(e){if(r.enabled("charting_library_base"))return{currentState:"var"};for(var t="init",n="var",o=t,c={warnings:[],errors:[],isEmpty:!0},l=[],p=0;p{"use strict";function r(e,t){return`${e}@${t}`}function o(e){return e.replace(/(@[^-]+-[^-]+).*$/,"$1")}n.d(t,{extractStudyId:()=>o,studyIdString:()=>r})},62745:(e,t,n)=>{"use strict";n.d(t,{ChartColorDependentStudyInputNames:()=>i,InputDisplayFlags:()=>r,RangeDependentStudyInputNames:()=>o,areStudyInputsEqual:()=>p,editableStudyInputs:()=>h,getInputValue:()=>c,isExtendedInput:()=>a,isExtendedInputSource:()=>u,isStudyInputDependsOnChart:()=>g, isStudyInputDependsOnChartColors:()=>y,isStudyInputOptionsInfo:()=>l,isTimeOrPriceNotHiddenInput:()=>f,rangeDependentStudyInputsToTimeRange:()=>d});var r,o,i,s=n(598279);function a(e){return(0,s.default)(e)}function u(e){return"source"===e.t}function c(e){return a(e)?e.v:e}function l(e){return["text","integer","float","price","session","resolution"].includes(e.type)&&e.hasOwnProperty("options")}function p(e,t,n){for(const r of e)if(t[r.id]!==n[r.id])return!1;return!0}function d(e){return{from:Math.round(e.first_visible_bar_time/1e3),to:Math.round(e.last_visible_bar_time/1e3)}}function f(e){return("time"===e.type||"price"===e.type)&&!0!==e.isHidden}function h(e){const t=e.filter(f);if(0===t.length)return[];const n=new Map,r=[];t.forEach((e=>{var t;const{group:o,inline:i}=e;if(void 0===i)return void r.push(e);const s=i+(o||"");if(n.has(s))null===(t=n.get(s))||void 0===t||t.push(e);else{const t=[e];n.set(s,t),r.push(t)}}));const o=[];for(let e=0;ee)).includes(e.id)}function g(e){return!!y(e)||Object.values(o).map((e=>e)).includes(e.id)}!function(e){e[e.None=0]="None",e[e.DataWindow=2]="DataWindow",e[e.StatusLine=8]="StatusLine",e[e.All=15]="All"}(r||(r={})),function(e){e.FirstBar="first_visible_bar_time",e.LastBar="last_visible_bar_time",e.Realtime="subscribeRealtime"}(o||(o={})),function(e){e.FgColor="__chart_fgcolor",e.BgColor="__chart_bgcolor"}(i||(i={}))},428784:(e,t,n)=>{"use strict";n.d(t,{applyOverridesToStudyDefaults:()=>p});var r=n(650151),o=n(368135),i=n(201089);const s={line:o.LineStudyPlotStyle.Line,histogram:o.LineStudyPlotStyle.Histogram,cross:o.LineStudyPlotStyle.Cross,area:o.LineStudyPlotStyle.Area,columns:o.LineStudyPlotStyle.Columns,circles:o.LineStudyPlotStyle.Circles,line_with_breaks:o.LineStudyPlotStyle.LineWithBreaks,area_with_breaks:o.LineStudyPlotStyle.AreaWithBreaks,step_line:o.LineStudyPlotStyle.StepLine,step_line_with_breaks:o.LineStudyPlotStyle.StepLineWithBreaks,step_line_with_diamonds:o.LineStudyPlotStyle.StepLineWithDiamonds},a=(0,i.getLogger)("Chart.Model.StudyPropertiesOverrider");var u,c;function l(e,t,n,r){const o=n.split(".");if(0===o.length||0===o[0].length)return;const i=function(e){const t=e.split(":");return{name:t[0],type:2===t.length?t[1]:null}}(o[0]),s=i.name,l=i.type,p=null!==l,d=!p||"band"===l,f=!p||"area"===l,h=!p||"input"===l,y=!p||"plot"===l?c.getPlotIdByTitle(e,s):null,g=d?c.getBandIndexByName(e,s):null,v=f?c.getFilledAreaIdByTitle(e,s):null,S=h?c.getInputByName(e,s):null,_=t.hasOwnProperty(s);if((null!==y?1:0)+(null!==g?1:0)+(null!==v?1:0)+(null!==S?1:0)+(_?1:0)>1)return void a.logWarn(`Study '${e.description}' has ambiguous identifier '${s}'`);const P=o[1];if(null!==y){if(1===o.length)return void a.logWarn(`Path of sub-property of '${s}' plot for study '${e.description}' must be not empty`);const n=o.slice(1);u.applyPlotProperty(e,t,y,n,r)}else if(null!==S)u.applyInputValue(t,S,r);else if(null!==g){ if(void 0===P)return void a.logWarn(`Property name of '${s}' band for study '${e.description}' must be set`);u.applyBandProperty(t,g,P,r)}else if(null!==v){if(void 0===P)return void a.logWarn(`Property name of '${s}' area for study '${e.description}' must be set`);u.applyFilledAreaProperty(t,v,P,r)}else _?u.setRootProperty(t,o,r):a.logWarn(`Study '${e.description}' has no plot or input '${s}'`)}function p(e,t,n){for(const r in e){if(!e.hasOwnProperty(r))continue;const o=r.indexOf(".");if(-1===o)continue;const i=r.substring(0,o),s=c.getMetaInfoByDescription(t,i);if(null===s){a.logWarn(`There is no such study ${i}`);continue}const u=n(s);null!==u?l(s,u,r.substring(o+1),e[r]):a.logWarn(`Cannot apply overrides for study ${i}`)}}!function(e){e.applyPlotProperty=function(e,t,n,i,u){if(void 0===t.styles)return void a.logWarn("Study does not have styles");const c=i[0];if("color"===c){const s=function(e,t,n){if(void 0===e.plots)return null;for(const r of e.plots){if(!(0,o.isPaletteColorerPlot)(r)||void 0===t.palettes)continue;const e=t.palettes[r.palette];if(r.target===n&&void 0!==e)return e}return null}(e,t,n);return void function(e,t,n,o,i){var s;void 0!==e.styles?null===t&&!isNaN(o)&&o>0?a.logWarn(`Study plot does not have color #${o}`):((0===o||isNaN(o))&&((0,r.ensureDefined)(e.styles[n]).color=String(i),o=0),null!==t&&((0,r.ensureDefined)(null===(s=t.colors)||void 0===s?void 0:s[o]).color=String(i))):a.logWarn("Study does not have styles")}(t,s,n,i.length>1?parseInt(i[1]):NaN,u)}const l=t.styles[n];if(void 0!==l&&l.hasOwnProperty(c)){if("plottype"===c){const e=s[String(u)];if(void 0===e)return void a.logWarn(`Unsupported plot type for plot: ${u}`);u=e}l[c]=u}else a.logWarn(`Study plot does not have property '${c}'`)},e.applyBandProperty=function(e,t,n,r){if(void 0===e.bands)return void a.logWarn("Study does not have bands");const o=e.bands[t];if(void 0!==o&&o.hasOwnProperty(n)){if("plottype"===n){const e=s[String(r)];if(void 0===e)return void a.logWarn(`Unsupported plot type for band: ${r}`);r=e}o[n]=r}else a.logWarn(`Study band does not have property '${n}'`)},e.applyFilledAreaProperty=function(e,t,n,r){if(void 0===e.filledAreasStyle)return void a.logWarn("Study does not have areas");const o=e.filledAreasStyle[t];void 0!==o&&o.hasOwnProperty(n)?o[n]=r:a.logWarn(`Study area does not have property '${n}'`)},e.applyInputValue=function(e,t,n){void 0!==e.inputs&&e.inputs.hasOwnProperty(t)?e.inputs[t]=n:a.logWarn(`Study does not have input '${t}'`)},e.setRootProperty=function(e,t,n){if(0===t.length)return;let r=e;for(const e of t.slice(0,-1)){if(null==r||!r.hasOwnProperty(e))break;r=r[e]}const o=t[t.length-1];null!=r&&r.hasOwnProperty(o)?r[o]=n:a.logWarn(`Study does not have property ${t.join(".")}`)}}(u||(u={})),function(e){e.getInputByName=function(e,t){if(void 0===e.inputs)return null;t=t.toLowerCase();for(const n of e.inputs)if(n.name.toLowerCase()===t)return n.id;return null},e.getPlotIdByTitle=function(e,t){if(void 0===e.styles)return null;t=t.toLowerCase();for(const n in e.styles){const r=e.styles[n] ;if((void 0!==r&&void 0!==r.title?r.title:n).toLowerCase()===t)return n}return null},e.getFilledAreaIdByTitle=function(e,t){if(void 0===e.filledAreas)return null;t=t.toLowerCase();for(const n of e.filledAreas)if(n.title.toLowerCase()===t)return n.id;return null},e.getBandIndexByName=function(e,t){if(void 0===e.bands)return null;t=t.toLowerCase();for(let n=0;n{"use strict";n.d(t,{translatedIntervalString:()=>o});var r=n(731042);function o(e){const t=(0,r.getTranslatedResolutionModel)(e,!0);return null===t?e:t.multiplier+(t.mayOmitShortKind?"":t.shortKind)}},883161:(e,t,n)=>{"use strict";n.d(t,{StudyMetaInfoBase:()=>y});var r=n(827147),o=n(650151),i=n(62745),s=n(389137),a=n(42292),u=n(922814);const c=new Set(["CorrelationCoefficient@tv-basicstudies","Correlation - Log@tv-basicstudies-1"]),l=new Set([]),p=new Set(["line"]),d=new Map([["AnchoredVWAP@tv-basicstudies","linetoolanchoredvwap"],["RegressionTrend@tv-basicstudies","linetoolregressiontrend"],["VbPAnchored@tv-basicstudies","linetoolanchoredvp"]]),f=/^([^\$]+)\$\d+$/,h=["bool","color","time","text_area"];class y{createDefaults(){if(this.defaults){const e=(0,s.clone)(this.defaults);e.precision="default";const t=y.getStudyPropertyRootName(this);(0,a.createDefaults)(t,e)}}removeDefaults(){(0,a.removeDefaults)(y.getStudyPropertyRootName(this))}static getSourceIdsByInputs(e,t){if(!Array.isArray(e)||!t)return[];const n=[];for(const o of e)if(y.isSourceInput(o)&&(0,r.default)(t[o.id])){const e=t[o.id];e.includes("$")&&n.push(e.split("$")[0])}return n}static isSourceInput(e){return Boolean(e.id&&(("source"===e.id||"src"===e.id)&&("text"===e.type||"source"===e.type)||"source"===e.type))}static getSourceInputIds(e){const t=[];for(const n of e.inputs)y.isSourceInput(n)&&t.push(n.id);return t}static setChildStudyMetaInfoPropertiesSourceId(e,t,n){for(const r of e.inputs){if(!y.isSourceInput(r))continue;const e=n.childs().inputs&&n.childs().inputs.childs()[r.id];if(e){const n=e.value(),r=f.exec(n);if(2===(null==r?void 0:r.length)){if("{pid}"===r[1]){const r=n.replace(/^[^\$]+/,t);e.setValue(r)}}}}}static patchSoSInputs(e,t){const n=e=>{const n=f.exec(e);if(2===(null==n?void 0:n.length)){const r=n[1],i=`${(0,o.ensureNotNull)(t(r))}`;return e.replace(/^[^\$]+/,i)}return e};for(const t in e)if(/in_[\d+]/.test(t)||"source"===t){const o=e[t];(0,r.default)(o)?e[t]=n(o):(0,i.isExtendedInput)(o)&&(0,i.isExtendedInputSource)(o)&&(o.v=n(o.v))}}static canBeChild(e){if((0,r.default)(e))return!0;if(!e)return!1;if(e.extra&&!y.isAllowedSourceInputsCount(e.extra.sourceInputsCount)||!0===e.canNotBeChild||!1===e.canBeChild||c.has(e.id))return!1;let t=0;for(const n of e.inputs)y.isSourceInput(n)&&(t+=1);return y.isAllowedSourceInputsCount(t)}static isAllowedSourceInputsCount(e){return e>0||1===e}static canHaveChildren(e){ if(e){if(e.isTVScriptStrategy||e.TVScriptSourceCode&&(0,u.isStrategy)(e.TVScriptSourceCode))return!1;if(e.id&&!l.has(e.id)&&Array.isArray(e.plots))for(const t of e.plots)if(p.has(t.type))return!0}return!1}static getChildSourceInputTitles(e,t,n){var r;const o={};if(t.plots&&t.plots.length&&e.options&&e.options.length)for(const i of e.options){const e=i?+i.split("$")[1]:NaN,s=isFinite(e)&&t.plots[e];s&&p.has(s.type)&&(o[i]=t.styles&&t.styles[s.id]&&(null===(r=t.styles[s.id])||void 0===r?void 0:r.title)||s.id,n&&(o[i]=n+": "+o[i]))}return o}static canPlotBeSourceOfChildStudy(e){return p.has(e)}static getStudyPropertyRootName(e){const t=d.get(e.id);if(void 0!==t)return t;let n="study_"+e.id;return e.pine&&e.pine.version&&(n+="_"+e.pine.version.replace(".","_")),n}static getStudyPropertyRootNameById(e){const t=d.get(e);return void 0!==t?t:"study_"+e}static isScriptStrategy(e){if(e.extra&&e.extra.kind)return"strategy"===e.extra.kind;if(!0===e.isTVScriptStrategy)return!0;const t=e.TVScriptSourceCode||e.scriptSource;return!!t&&(0,u.isStrategy)(t)}_updateInputDisplayDefaults(){this.inputs.filter((e=>void 0===e.display)).forEach((e=>{h.includes(e.type)?e.display=i.InputDisplayFlags.None:e.display=i.InputDisplayFlags.All}))}}},526075:(e,t,n)=>{"use strict";n.r(t),n.d(t,{StudyMetaInfo:()=>a});var r=n(201089).getLogger("Chart.Study.MetaInfo"),o=n(428784).applyOverridesToStudyDefaults,i=n(883161).StudyMetaInfoBase,s={};class a extends i{constructor(e){super(),TradingView.merge(this,{palettes:{},inputs:[],plots:[],graphics:{},defaults:{}}),TradingView.merge(this,e);var t=e.fullId||e.id;TradingView.merge(this,a.parseIdString(t)),this._updateInputDisplayDefaults()}static versionOf(e){var t="_metainfoVersion"in e&&isNumber(e._metainfoVersion)?e._metainfoVersion:0;return t<0&&r.logError("Metainfo format version cannot be negative: "+t),t}static parseIdString(e){var t={};if(-1===e.indexOf("@"))t.shortId=e,t.packageId="tv-basicstudies",t.id=e+"@"+t.packageId,t.version=1;else{var n=e.split("@");t.shortId=n[0];var r=n[1].split("-");if(3===r.length)t.packageId=r.slice(0,2).join("-"),t.id=t.shortId+"@"+t.packageId,t.version=r[2];else if(1===r.length&&"decisionbar"===r[0])t.packageId="les-"+r[0],t.id=t.shortId+"@"+t.packageId,t.version=1;else{if(1!==r.length)throw new Error("unexpected study id:"+e);t.packageId="tv-"+r[0],t.id=t.shortId+"@"+t.packageId,t.version=1}}if(t.fullId=t.id+"-"+t.version,"tv-scripting"===t.packageId){var o=t.shortId;if(0===o.indexOf("Script$")||0===o.indexOf("StrategyScript$")){var i=o.indexOf("_");t.productId=i>=0?o.substring(0,i):t.packageId}else t.productId=t.packageId}else t.productId=t.packageId;return t}static getPackageName(e){return(/^[^@]+@([^-]+-[^-]+)/.exec(e||"")||[0,"tv-basicstudies"])[1]}static cutDollarHash(e){var t=e.indexOf("$"),n=e.indexOf("@");return-1===t?e:e.substring(0,t)+(n>=0?e.substring(n):"")}static hasUserIdSuffix(e){return/^USER;[\d\w]+;\d+$/.test(e)}static hasPubSuffix(e){return/^PUB;.+$/.test(e)}static hasStdSuffix(e){return/^STD;.+$/.test(e)}static isStandardPine(e){ return/^(Strategy)?Script\$STD;.*@tv-scripting$/.test(e)}static getStudyIdWithLatestVersion(e){const t=a.cutDollarHash(e.id);let n=t;return t.indexOf("@tv-scripting")>=0?n+="-101!":t.endsWith("CP@tv-basicstudies")?n+="-"+Math.min(e.version,207):t.endsWith("CP@tv-chartpatterns")?n+="-"+Math.min(e.version,9):n+="-"+e.version,n}defaultInputs(){for(var e=[],t=0;t0?e[0].id:null}static findStudyMetaInfoByDescription(e,t){if(e){for(var n=0;n{var r;e=n.nmd(e),"undefined"!=typeof window&&(r=window.TVScript=window.TVScript||{}),(r=r||{}).Access={},r.Access.ACCESS_OPEN_NO_AUTH="open_no_auth",r.Access.ACCESS_CLOSED_NO_AUTH="closed_no_auth",r.Access.ACCESS_CLOSED_NEEDS_AUTH="closed_needs_auth",r.Access.MAP_ID_TO_NAME={1:r.Access.ACCESS_OPEN_NO_AUTH,2:r.Access.ACCESS_CLOSED_NO_AUTH,3:r.Access.ACCESS_CLOSED_NEEDS_AUTH},r.Access.MAP_NAME_TO_ID={},Object.keys(r.Access.MAP_ID_TO_NAME).forEach((function(e){r.Access.MAP_NAME_TO_ID[r.Access.MAP_ID_TO_NAME[e]]=e})),r.PinePrefix={},r.PinePrefix.USER="USER;",r.PinePrefix.PUB="PUB;",r.PinePrefix.STD="STD;",r.PinePrefix.TV="TV_",r.PinePrefix.EDGR="EDGR_",r.PineType={},r.PineType.UserSaved="PineType_UserSaved",r.PineType.UserPublished="PineType_UserPublished",r.PineType.BuiltIn="PineType_BuiltIn",r.PineType.Addon="PineType_Addon",r.Type=r.Type||function(){},r.Type.VOID="void",r.Type.INTEGER="integer",r.Type.FLOAT="float",r.Type.STRING="string",r.Type.BOOL="bool",r.Type.COLOR="color",r.Type.SERIES="series",r.Type.PLOT="plot",r.Type.HLINE="hline",r.Type.BARCOLOR="barcolor",r.Type.BGCOLOR="bgcolor",r.Type.PLOTSHAPES="plotshape",r.Type.PLOTCHARS="plotchar",r.Type.PLOTARROWS="plotarrow",r.Type.NA="na",r.Type.ARRAY="array",r.TranslatorDefaultVersion=1,r.TranslatorReferenceVersioningIntroduced=4,r.TranslatorLastVersion=5,r.pineType=function(e){ return e.startsWith(r.PinePrefix.USER)?r.PineType.UserSaved:e.startsWith(r.PinePrefix.PUB)?r.PineType.UserPublished:e.startsWith(r.PinePrefix.STD)||e.startsWith(r.PinePrefix.TV)||e.startsWith(r.PinePrefix.EDGR)?r.PineType.BuiltIn:r.PineType.Addon},r.patchILTemplate=function(e,t,n){var o=n||{};return r._patchTemplate(/<(in_\d+)>/g,e,t,o)},r.decorateQuotes=function(e){if(!e)return e;var t=/([^\\']+?)(')[^']*?/g,n="$1\\$2",r=e;return"'"==r.charAt(0)&&"'"==r.charAt(r.length-1)?"'"+(r=r.substr(1,r.length-2)).replace(t,n)+"'":r.replace(t,n)},r.patchInputs=function(e,t){var n={};for(var r in e)if(e.hasOwnProperty(r)){var o,i=e[r];o=i.isFake?{v:t[i.id],f:!0,t:i.type}:t[i.id],n[i.id]=o}return n},r._patchTemplate=function(e,t,n,o){var i=o||{};return t.replace(e,(function(e,t){for(var o=(t in i?i[t]:n.defaults.inputs[t]),s=0;s=0)o="'"+r.decorateQuotes(o)+"'";else if("source"===n.inputs[s].type){var a=o.split("$");a[0]="'"+a[0]+"'",o="source("+a.join(",")+")"}return o}))},r.isStrategy=function(e){return/^\s*strategy\s*\(/m.test(e)};var o=/^\s*\/\/\s*?@version\s*?=\s*?(\S*?)\s*?$/gm,i=/^[0-9]+$/;r.extractVersion=function(e){o.lastIndex=0;var t=o.exec(e);if(null===t)return 1;var n=t[1],s=i.test(n)?Number(n):NaN;return isNaN(s)?1:Math.max(r.TranslatorDefaultVersion,Math.min(s,r.TranslatorLastVersion))},r.canUpgradeVersion=function(e){return e>=3&&e=4&&e<=r.TranslatorLastVersion},e&&e.exports&&(e.exports=r)},695242:(e,t,n)=>{"use strict";n.d(t,{canPlaceAlertOnResolution:()=>s});var r=n(223699),o=n(778016),i=n(833813);function s(e,t){const n=r.Interval.isSeconds(e),s=t?null==t?void 0:t.alertsOnSeconds:(0,o.enabled)(i.ProductFeatures.ALERTS_ON_SECONDS);return!n||s}},246733:(e,t,n)=>{"use strict";n.r(t),n.d(t,{alphaToTransparency:()=>s,applyAlpha:()=>i,applyTransparency:()=>u,colorFromBackground:()=>d,colorToInteger:()=>v,generateColor:()=>o,getLuminance:()=>l,gradientColorAtPercent:()=>f,isColorDark:()=>h,isHexColor:()=>p,resetTransparency:()=>c,rgbaFromInteger:()=>y,rgbaToInteger:()=>g,transparencyToAlpha:()=>a});var r=n(724377);function o(e,t,n){if(t=t||0,!p(e))return n?(0,r.rgbaToString)((0,r.rgba)((0,r.parseRgb)(e),(0,r.normalizeAlphaComponent)(a(t)))):e;const[o,i,s]=(0,r.parseRgb)(e),u=(0,r.normalizeAlphaComponent)(a(t));return(0,r.rgbaToString)([o,i,s,u])}function i(e,t){return o(e,s(t),!0)}function s(e){return 100*(1-e)}function a(e){if(e<0||e>100)throw new Error("invalid transparency");return 1-e/100}function u(e,t){if("transparent"===e)return e;const n=(0,r.parseRgba)(e),o=n[3];return(0,r.rgbaToString)((0,r.rgba)(n[0],n[1],n[2],a(t)*o))}function c(e){return"transparent"===e?e:p(e)?e.slice(0,7):(0,r.rgbaToString)((0,r.rgba)((0,r.parseRgb)(e),(0,r.normalizeAlphaComponent)(1)))}function l(e){const t=(0,r.parseRgb)(e).map((e=>(e/=255)<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4))) ;return Number((.2126*t[0]+.7152*t[1]+.0722*t[2]).toFixed(3))}function p(e){return 0===e.indexOf("#")}function d(e){return"black"===(0,r.rgbToBlackWhiteString)((0,r.parseRgb)(e),150)?"#ffffff":"#000000"}function f(e,t,n){const[o,i,s,a]=(0,r.parseRgba)(e),[u,c,l,p]=(0,r.parseRgba)(t),d=(0,r.rgba)(Math.round(o+n*(u-o)),Math.round(i+n*(c-i)),Math.round(s+n*(l-s)),a+n*(p-a));return(0,r.rgbaToString)(d)}function h(e){return l(c(e))<.5}function y(e){const t=(e=Math.round(e))%256;e-=t;const n=(e/=256)%256;e-=n;const r=(e/=256)%256;e-=r;return`rgba(${t},${n},${r},${(e/=256)/255})`}function g(e){const t=Math.round(255*e[3]);return e[0]+256*e[1]+65536*e[2]+16777216*t}function v(e){const t=(0,r.tryParseRgba)(e);return null===t?0:g(t)}}}]);