1var F=Object.defineProperty;var P=(g,t,e)=>t in g?F(g,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):g[t]=e;var o=(g,t,e)=>P(g,typeof t!="symbol"?t+"":t,e);import{R as V,S as M}from"./BRH9bTPS.js";import{br as $,av as Q,bs as X,aj as N,ak as H,d as Z,al as J,i as O,b7 as G,k as K,u as Y,E as R,ai as tt,J as et,q as U,p as st,am as it,ao as ot,c as nt,b as j,t as at,g as q,S as rt,F as lt,at as z,bt as A,bn as ct,as as ht,bu as ut,o as dt,aD as pt,bp as p,V as gt,z as mt}from"./DkdofgM8.js";class ft{constructor(t){o(this,"token");o(this,"symbolInfo",{});o(this,"configuration");o(this,"request");o(this,"type");o(this,"currentSymbol","");o(this,"currentResolutions","");o(this,"stopRequest",!1);o(this,"lastBar");o(this,"language","en-US");o(this,"noData",!1);o(this,"resolution","1");o(this,"ticker","");o(this,"onErrorLogin",()=>{});o(this,"updateSymbol",()=>{});const{token:e,lang:i,onErrorLogin:s,updateSymbol:n}=t;this.token=e,this.language=i,this.request=new V(e),this.configuration=this.defaultConfiguration(),this.onErrorLogin=s,this.updateSymbol=n}onReady(t){setTimeout(()=>{t(this.configuration)},0)}async searchSymbols(t,e,i,s){return s([])}async resolveSymbol(t,e,i){var s,n,l;if(this.symbolInfo[t]){(s=this.updateSymbol)==null||s.call(this,"symbol",t);const a=setTimeout(()=>{e(this.symbolInfo[t]),clearTimeout(a)},0);return}try{const a=await this.request.getSymbolInfo(t);if(!a){i("æ¥æ¾ä¸å°äº§å");return}(n=this.updateSymbol)==null||n.call(this,"symbol",t);const h={...a,subsessions:a.subsessions??[],...$(a),currency_code:a.currencyCode,has_intraday:a.hasIntraday,listed_exchange:a.listedExchange,session_display:a.sessionDisplay,subsession_id:a.subsessionId,variable_tick_size:a.variableTickSize,visible_plots_set:a.visiblePlotsSet,description:a.baseName??a.description,full_name:t,pro_name:t,base_name:[t],ticker:t,exchange:a.type==="crypto"||a.type==="forex"||a.type==="indices"?"iTick":a.exchange,supp
1orted_resolutions:a.supported_resolutions||this.configuration.supported_resolutions,has_daily:!0,daily_multipliers:["1"],has_empty_bars:!1,has_weekly_and_monthly:!0,weekly_multipliers:["1"],monthly_multipliers:["1","12"],intraday_multipliers:["1","5","15","30","60","1D","1W","1M"],data_status:"streaming"};this.symbolInfo[t]=h,e(h)}catch(a){i("æ¥æ¾ä¸å°äº§å"),a.code===401&&((l=this.onErrorLogin)==null||l.call(this,{code:401}))}}barsUnique(t){const e=new Map;return t.filter(i=>{const s=i.time,n=e.has(s);return e.set(s,!0),!n})}async getBars(t,e,i,s,n){var E,I;if(t.ticker!==this.ticker&&(this.noData=!1,this.ticker=t.ticker||""),this.resolution!==e&&(this.noData=!1,(E=this.updateSymbol)==null||E.call(this,"interval",e),this.resolution=e),this.noData)return s([],{noData:!0});const{name:l,type:a,region:h,timezone:r}=t,{countBack:u,firstDataRequest:f,from:w,to:C}=i;try{const _=Math.ceil((C-w)/u),m=500,k=Math.ceil(u/m),T=u%m||m,S=[];for(let d=0;d<k;d++){const v=d===k-1,D=v?T:m,L=v?C:w+((d+1)*m-1)*_;S.push(this.request.getKline({symbolType:a,region:this.getSymbolRegion(a,h),symbol:l,et:L*1e3,limit:D,resolution:this.getResolution(e)},r))}const c=(await Promise.all(S)).flat(),b={noData:c.length<u};f&&(this.lastBar=c==null?void 0:c.at(-1)),b.noData&&(this.noData=!0),s(this.barsUnique(c))}catch(_){const{code:m,msg:k}=_;(I=this.onErrorLogin)==null||I.call(this,{code:m,msg:k}),s([],{noData:!0})}}getSymbolRegion(t,e){return t==="crypto"||t==="stock"||t==="future"||t==="fund"?(e||"").toLocaleUpperCase():"GB"}getResolution(t){return{1:1,5:2,15:3,30:4,60:5,"1D":8,"1W":9,"1M":10}[t]}unsubscribeBars(t){}subscribeBars(t,e,i,s,n){const{region:l,type:a,name:h}=t,r=M.getInstance(this.token);r.connect(a,h,l,e,this.lastBar),r.onMessage(u=>{u&&i(u)})}getServerTime(t){}getQuotes(){}subscribeQuotes(){}unsubscribeQuotes(){}defaultConfiguration(){return{supported_resolutions:["1","5","15","30","60","1D","1W","1M"],supports_marks:!1,supports_timescale_marks:!1,supports_time:!1}}}const W=g=>`<svg style="${g}" width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M6.93556 4.5061L3.43556 8.5061L3.00342 8.99998L3.43556 9.49386L6.93556 13.4939L8.06443 12.5061L4.99657 8.99998L8.06443 5.49386L6.93556 4.5061ZM11.0644 13.4939L14.5644 9.49386L14.9966 8.99998L14.5644 8.5061L11.0644 4.5061L9.93556 5.49386L13.0034 8.99998L9.93556 12.5061L11.0644 13.4939Z" fill="currentColor"/></svg>`,bt=` 2 #documentation-toolbar-button { 3 all: unset; 4 position: relative; 5 color: #FFF; 6 font-size: 14px; 7 font-weight: 400; 8 line-height: 18px; 9 letter-spacing: 0.15408px; 10 padding: 5px 12px; 11 border-radius: 80px; 12 background: #2962FF; 13 cursor: pointer; 14 } 15 #documentation-toolbar-button:hover { 16 background: #1E53E5; 17 } 18 #documentation-toolbar-button:active { 19 background: #1948CC; 20 } 21 #theme-toggle { 22 display: flex; 23 flex-direction: row; 24 align-items: center; 25 gap: 12px; 26 } 27 .switcher { 28 display: inline-block; 29 position: relative; 30 flex: 0 0 auto; 31 width: 38px; 32 height: 20px; 33 vertical-align: middle; 34 z-index: 0; 35 -webkit-tap-highlight-color: transparent; 36 } 37 38 .switcher input { 39 position: absolute; 40 top: 0; 41 left: 0; 42 width: 100%; 43 height: 100%; 44 opacity: 0; 45 z-index: 1; 46 cursor: default; 47 } 48 49 .switcher .thumb-wrapper { 50 display: block; 51 border-radius: 20px; 52 position: relative; 53 z-index: 0; 54 width: 100%; 55 height: 100%; 56 } 57 58 .switcher .track { 59 position: absolute; 60 left: 0; 61 top: 0; 62 width: 100%; 63 height: 100%; 64 border-radius: 20px; 65 background-color: #a3a6af; 66 } 67 68 #theme-switch:checked + .thumb-wrapper .track { 69 background-color: #2962ff; 70 } 71 72 .switcher .thumb { 73 display: block; 74 width: 14px; 75 height: 14px; 76 border-radius: 14px; 77 transition-duration: 250ms; 78 transition-property: transform; 79 transition-timing-function: ease-out; 80 transform: translate(3px, 3px); 81 background: #ffffff; 82 } 83 84 [dir=rtl] .switcher .thumb { 85 transform: translate(-3px, 3px); 86 } 87 88 .switcher input:checked + .thumb-wrapper .thumb { 89 transform: translate(21px, 3px); 90 } 91 92 [dir=rtl] .switcher input:checked + .thumb-wrapper .thumb { 93 transform: translate(-21px, 3px); 94 } 95 96 #documentation-toolbar-button:focus-visible:before, 97 .switcher:focus-within:before { 98 content: ''; 99 display: block; 100 position: absolute; 101 top: -2px; 102 right: -2px; 103 bottom: -2px; 104 left: -2px; 105 border-radius: 16px; 106 outline: #2962FF solid 2px; 107 } 108 .popupWidget-Wu2pIo3E .desc-Wu2pIo3E{ 109 font-family: "Inter", sans-serif; 110 } 111 .popupWidget-Wu2pIo3E .desc-Wu2pIo3E a{ 112 color: blue; 113 background-color: transparent; 114 font: inherit; 115 cursor: pointer; 116 outline: none; 117 } 118 .popupWidget-Wu2pIo3E .desc-Wu2pIo3E a:hover { 119 text-decoration: none; 120 text-decoration: underline; 121 } 122 .source-oRSs8UQo{ 123 font-family: initial; 124 } 125 #header-toolbar-symbol-search{ 126 display: none; 127 } 128 #overlap-manager-root div[data-outside-boundary-for='symbol-search-items-dialog']{ 129 display: none; 130 } 131 .bubbles-ZXzPWcCf { 132 padding-bottom: 4px; 133 } 134 .container-IxKZEhmO.selected-IxKZEhmO{ 135 background-color: #2e2e2e; 136 } 137 .pills-PVWoXu5j.pills-PVWoXu5j.pills-PVWoXu5j.pills-PVWoXu5j.pills-PVWoXu5j.pills-PVWoXu5j{ 138 --ui-lib-light-button-default-color-bg: #2e2e2e; 139 --ui-lib-light-button-default-color-border: #2e2e2e; 140 --ui-lib-light-button-default-color-content: #fff; 141 } 142 .pills-PVWoXu5j.pills-PVWoXu5j.pills-PVWoXu5j.pills-PVWoXu5j.pills-PVWoXu5j.pills-PVWoXu5j:hover{ 143 --ui-lib-light-button-default-color-bg: #4a4a4a; 144 --ui-lib-light-button-default-color-border: #4a4a4a; 145 --ui-lib-light-button-default-color-content: #fff; 146 } 147 .groupTitleDesktop-dfKL9A7t{ 148 font-size: 11px; 149 color: var(--themed-color-default-gray,#6a6d78); 150 letter-spacing: .4px; 151 line-height: 16px; 152 padding-bottom: 8px; 153 text-transform: uppercase; 154 } 155 .custom{ 156 list-style-type: none; 157 } 158 .custom li{ 159 display: flex; 160 justify-content: center; 161 } 162 .custom li a{ 163 display: flex; 164 color: #3865f2; 165 font-family: 'Inter',sans-serif; 166 font-size: 15px; 167 width: 180px; 168 } 169 .custom .icon-box { 170 background: #3865f2; 171 display: flex; 172 width: 30px; 173 height: 30px; 174 border-radius: 100%; 175 align-items: center; 176 justify-content: center; 177 margin-right: 10px; 178 } 179 180 .custom .icon-box i {
181 width: 20px; 182 height: 20px; 183 display: block; 184 background-repeat: no-repeat; 185 background-size: 80%; 186 background-position: center; 187 } 188 189 .custom .icon-box.whatsApp i { 190 background-image: url(/images/contact/whatsApp.svg); 191 } 192 193 .custom .icon-box.telegram i { 194 background-image: url(/images/contact/email.svg); 195 background-size: 530%; 196 background-position: 4%; 197 } 198 .container-kfvcmk8t{ 199 display: none; 200 } 201 .api-keys-btn{ 202 padding: 9px 8px; 203 } 204 .api-keys-select{ 205 position: fixed; 206 } 207 .emptyIcon-ZXzPWcCf { 208 color: var(--textColor,var(--themed-color-error-text,#434651)); 209 } 210 html.theme-dark .emptyIcon-ZXzPWcCf{ 211 color: var(--textColor,var(--themed-color-error-text,#9598a1)); 212 } 213 214 .login-tips{ 215 display:flex;justify-content:center;margin-bottom:1rem;margin-top:1rem;color:#e6a23c;font-size: 15px; 216 } 217 .login-box{ 218 display: flex; 219 justify-content: center; 220 } 221 .login-btn{ 222 display: flex; 223 justify-content: center; 224 align-items: center; 225 height: 2.3rem; 226 text-transform: capitalize; 227 font-size: 15px; 228 font-weight: 600; 229 padding: 13px 30px; 230 background-color: #3865f2; 231 color: #fff; 232 border: none; 233 -webkit-transition: 0.2s; 234 transition: 0.2s; 235 border-radius: 5px; 236 position: relative; 237 z-index: 1; 238 margin-right: 5px; 239 overflow: hidden; 240 transition: all 0.3s; 241 } 242 .login-btn:hover{ 243 background-color: #081828; 244 color: #fff; 245 cursor: pointer; 246 } 247 248 `,yt=new Blob([bt],{type:"text/css"}),wt=URL.createObjectURL(yt);let xt=class{constructor(t){o(this,"buttonToggleEl");o(this,"widget");o(this,"symbol");o(this,"onClick",()=>{});const{widget:e,onClick:i,symbol:s}=t;this.widget=e,this.symbol=this.transfromSymbol(s),this.onClick=i,this.createselectBtn()}createselectBtn(){var s,n;if(!this.widget||(this.buttonToggleEl=this.widget.createButton({useTradingViewStyle:!1,align:"left"}),!this.buttonToggleEl))return!1;this.buttonToggleEl.setAttribute("aria-label","ååä»£ç æç´¢"),this.buttonToggleEl.setAttribute("data-tooltip","ååä»£ç æç´¢"),this.buttonToggleEl.classList.add("uppercase-cq__ntSC","smallLeftPadding-cq__ntSC","button-GwQQdU8S","button-cq__ntSC","apply-common-tooltip","isInteractive-GwQQdU8S","accessible-GwQQdU8S"),this.buttonToggleEl.innerHTML=`<span class="icon-GwQQdU8S" role="img" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 18 18" width="18" height="18"><path fill="currentColor" d="M3.5 8a4.5 4.5 0 1 1 9 0 4.5 4.5 0 0 1-9 0ZM8 2a6 6 0 1 0 3.65 10.76l3.58 3.58 1.06-1.06-3.57-3.57A6 6 0 0 0 8 2Z"></path></svg></span><div class="js-button-text text-GwQQdU8S text-cq__ntSC">${this.symbol}</div>`;const t=(n=(s=this.buttonToggleEl)==null?void 0:s.parentNode)==null?void 0:n.parentNode;t==null||t.addEventListener("click",()=>{this.onClick(this.symbol)});const e=t==null?void 0:t.previousSibling;e==null||e.remove();var i=t==null?void 0:t.parentNode;if(i&&t){i.insertBefore(t,i.firstChild);const l=t==null?void 0:t.nextSibling;l==null||l.remove()}}transfromSymbol(t){try{const[e,i]=t.split(":");return i}catch{return t}}updateSearchButtonText(t){if(this.symbol=this.transfromSymbol(t),this.buttonToggleEl){const e=this.buttonToggleEl.querySelector(".js-button-text");e&&(e.textContent=this.symbol)}}};class kt{constructor(t){o(this,"TRDocument");o(this,"selectToggleEl");o(this,"widget");o(this,"keyId");o(this,"visible",!1);o(this,"apiKeys");o(this,"buyApiKeyText","è´ä¹°API KEY");o(this,"selectEl");o(this,"change",()=>{});var h;const{widget:e,change:i,keyId:s,apiKeys:n,buyApiKeyText:l,TRDocument:a}=t;this.widget=e,this.TRDocument=a,this.buyApiKeyText=l,this.change=i,this.keyId=s,this.apiKeys=n,this.createselectBtn(),(h=this.TRDocument)==null||h.addEventListener("click",r=>{var f,w;const u=r.target;(f=u==null?void 0:u.classList)!=null&&f.contains("api-keys-btn")||((w=this.selectEl)==null||w.remove(),this.visible=!1)})}createselectBtn(){var e;if(!this.widget||(this.selectToggleEl=this.widget.createButton({useTradingViewStyle:!1,align:"left"}),!this.selectToggleEl))return!1;this.selectToggleEl.dataset.internalAllowKeyboardNavigation="true",this.selectToggleEl.id="apiKeys-toggle";const t=((e=this.apiKeys.find(i=>i.id===this.keyId))==null?void 0:e.name)||"API KEY";this.selectToggleEl.innerHTML=`<button type="button" class="api-keys-btn button-merBkM5y apply-common-tooltip accessible-merBkM5y" data-tooltip="API KEY">${t}</button>`,this.selectToggleEl.title="API KEY",this.selectToggleEl.addEventListener("click",()=>{var i;if(this.visible)return(i=this.selectEl)==null||i.remove(),this.visible=!1,!1;this.openSelect()})}openSelect(){var t,e,i;if(!this.TRDocument)return!1;this.visible=!0,this.selectEl=(t=this.TRDocument)==null?void 0:t.createElement("div"),this.selectEl.className="menuWrap-Kq3ruQo8",this.selectEl.style.position="fixed",this.selectEl.style.zIndex="150",this.selectEl.style.top=`${(((e=this.selectToggleEl)==null?void 0:e.offsetTop)??0)+38}px`,this.selectEl.style.left=`${((i=this.selectToggleEl)==null?void 0:i.offsetLeft)??0}px`,this.selectEl.innerHTML=`<div class="api-keys-select-content menuBox-Kq3ruQo8"> 249 <div class="accessible-NQERJsv9 addCustomInterval-S_1OCXUK desktop-S_1OCXUK item-jFqVJoPk withIcon-jFqVJoPk buy-api-key"> 250 <span class="icon-jFqVJoPk"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28">
250<path fill="currentColor" d="M13.9 14.1V22h1.2v-7.9H23v-1.2h-7.9V5h-1.2v7.9H6v1.2h7.9Z"></path></svg></span> 251 <span class="labelRow-jFqVJoPk"><span class="label-jFqVJoPk">${this.buyApiKeyText}</span></span> 252 </div> 253 <div class="separator-QjUlCDId normal-QjUlCDId" role="separator" aria-hidden="false"></div> 254 ${this.apiKeys.map(s=>`<div class="api-keys-select-item accessible-NQERJsv9 item-jFqVJoPk ${s.id===this.keyId?"isActive-jFqVJoPk":"withIcon-jFqVJoPk"}" data-key-id="${s.id}">${s.name}</div>`).join("")}</div>`,this.selectEl.addEventListener("click",async s=>{const n=s.target;if(n.classList.contains("api-keys-select-item")){const l=n.dataset.keyId||"";if(l===this.keyId)return!1;this.change(l)}(n.classList.contains("buy-api-key")||n.closest(".buy-api-key"))&&await Q({path:"/payment"})}),this.TRDocument.body.appendChild(this.selectEl)}}class Tt{constructor(t){o(this,"themeToggleEl");o(this,"widget");o(this,"theme");o(this,"change",()=>{});const{widget:e,change:i,theme:s}=t;this.widget=e,this.change=i,this.theme=s,this.createThemeCkeck()}createThemeCkeck(){if(!this.widget||(this.themeToggleEl=this.widget.createButton({useTradingViewStyle:!1,align:"right"}),!this.themeToggleEl))return!1;this.themeToggleEl.dataset.internalAllowKeyboardNavigation="true",this.themeToggleEl.id="theme-toggle",this.themeToggleEl.innerHTML=`<label for="theme-switch" id="theme-switch-label">${this.theme==="dark"?"Light":"Dark"} Mode</label> 255 <div class="switcher"> 256 <input type="checkbox" id="theme-switch" tabindex="-1"> 257 <span class="thumb-wrapper"> 258 <span class="track"></span> 259 <span class="thumb"></span> 260 </span> 261 </div>`,this.themeToggleEl.title="Toggle theme";const t=this.themeToggleEl.querySelector("#theme-switch");t.checked=this.theme==="dark",t.addEventListener("change",i=>{const n=i.target.checked?"dark":"light";this.change(n),this.updateTheme(n),this.widget.changeTheme(n,{disableUndo:!0})});const e=this.themeToggleEl.querySelector("#theme-switch");e==null||e.addEventListener("roving-tabindex:main-element",i=>{const s=i.target;s&&(s.tabIndex=0)}),e==null||e.addEventListener("roving-tabindex:secondary-element",i=>{const s=i.target;s&&(s.tabIndex=-1)})}updateTheme(t){if(this.theme=t,this.themeToggleEl){const e=this.themeToggleEl.querySelector("#theme-switch-label");e&&(e.textContent=`${t==="dark"?"Light":"Dark"} Mode`)}}}const vt={"zh-CN":"zh","en-US":"en","zh-HK":"zh_TW"};class St extends ft{constructor(e){super(e);o(this,"lang","zh-CN");this.lang=e.lang||"zh-CN"}setLogoFn(e){const i=N(),s=H(i.host),n={"zh-CN":"峿¶éèå¸åºæ°æ®APIs 夿±ãææ°ãè¡ç¥¨ãå å¯è´§å¸","en-US":"Real-time Financial Market Data APIs for Forex, Indices, Stocks, and Cryptocurrencies","zh-HK":"峿éèå¸å ´æ¸æAPIs å¤å¯ãææ¸ãè¡ç¥¨ãå å¯è²¨å¹£"};B.widget.customSymbolStatus().symbol(e).setColor("#00BCD4").setVisible(!0).setIcon(W("")).setTooltip("iTick").setDropDownContent([{title:"iTick",color:"#3865f2",icon:W("color:#00BCD4;background-color: rgba(0, 188, 212, 0.15); border-radius: 100%"),content:[n[this.lang],`<br/><a href="https://www.${s}" target="_blank">www.${s}</a>`]}])}resolveSymbol(e,i,s){return this.setLogoFn&&this.setLogoFn(e),super.resolveSymbol(e,i,s)}}const y=class y{constructor(t){o(this,"token");o(this,"keyId");o(this,"buyApiKeyText","");o(this,"apiKeys",[]);o(this,"container",null);o(this,"containerId","tradingview-container");o(this,"TRDocument");o(this,"symbol","BINANCE:BTCUSDT");o(this,"interval","5");o(this,"lang","zh-CN");o(this,"theme","light");o(this,"changeHeadeTheme");o(this,"updateSymbol");o(this,"changeKey");o(this,"onErrorLogin");o(this,"openSearch");o(this,"searchButton",null);var u;const{keyId:e,apiKeys:i,buyApiKeyText:s,symbol:n,interval:l,lang:a,theme:h,container:r}=t;this.keyId=e,this.buyApiKeyText=s,this.token=((u=i.find(f=>f.id===e))==null?void 0:u.key)||"",this.apiKeys=i||[],this.symbol=n||"BINANCE:BTCUSDT",this.interval=l||"5",this.lang=a||"zh-CN",this.theme=h||"light",this.container=r,this.containerId=r?r.id:"tradingview-container",this.initOnReady()}initOnReady(){var t;y.widget=new window.TradingView.widget({debug:!1,fullscreen:!1,symbol:this.symbol,interval:this.interval,container:this.containerId,datafeed:new St({token:this.token,lang:this.lang,onErrorLogin:({code:e,msg:i})=>{var s;return(s=this.onErrorLogin)==null?void 0:s.call(this,{code:e,msg:i})},updateSymbol:(e,i)=>{var s,n;e==="symbol"&&((s=this.searchButton)==null||s.updateSearchButtonText(i),this.symbol=i),(n=this.updateSymbol)==null||n.call(this,e,i)}}),library_path:"/charting_library/",locale:vt[this.lang],autosize:!0,width:window.innerWidth,height:(t=this.container)==null?void 0:t.clientHeight,disabled_features:["use_localstorage_for_settings"],enabled_features:["pre_post_market_sessions","show_symbol_logos","show_exchange_logos","seconds_resolution","custom_resolutions","secondary_series_extend_time_scale","show_percent_option_for_right_margin","items_favoriting","disable_resolution_rebuild"],custom_css_url:wt,timezone:Intl.DateTimeFormat().resolvedOptions().timeZone,theme:this.theme,loading_screen:{backgroundColor:this.theme==="light"?"#FFFFFF":"#171b26"}}),y.widget.headerReady().then(()=>{var i,s;const e=(i=document.getElementById(this.containerId))==null?void 0:i.firstChild;this.TRDocument=(s=e==null?void 0:e.contentWindow)==null?void 0:s.document,new Tt({widget:y.widget,theme:this.theme,change:n=>{var l;(l=this.changeHeadeTheme)==null||l.call(this,n)}}),this.searchButton=new xt({symbol:this.symbol,widget:y.widget,onClick:n=>{var l;(l=this.openSearch)==null||l.call(this,{keyWords:n||this.symbol.split(":")[1],TRDocument:this.TRDocument,type:"click"})}}),new kt({TRDocument:this.TRDocument,widget:y.widget,keyId:this.keyId,buyApiKeyText:this.buyApiKeyText,apiKeys:this.apiKeys,change:n=>{var l,a;this.keyId=n,(l=this.changeKey)==null||l.call(this,n),this.token=((a=this.apiKeys.find(h=>h.id===n))==null?void 0:a.key)||"",this.initOnReady()}})}),y.widget.onChartReady(()=>{var e,i;(e=this.TRDocument)==null||e.addEventListener("keyup",s=>{var l,a,h;if(((l=s.target)==null?void 0:l.classList[0])==="input-qm7Rg5MB"||((a=s.target)==null?void 0:a.classList[0])==="search-ZXzPWcCf")return!1;const n=s.key;/^[a-zA-Z]$/.test(n)&&((h=this.openSearch)==null||h.call(this,{keyWords:n||this.symbol.split(":")[1],TRDocument:this.TRDocument,type:"keydown"}))}),X((i=this.TRDocument)==null?void 0:i.querySelector(".chart-gui-wrapper"),".title-l31H9iuA.accessible-l31H9iuA",s=>{s==null||s.addEventListener("click",()=>{var n;(n=this.openSearch)==null||n.call(this,{keyWords:this.symbol.split(":")[1],TRDocument:this.TRDocument,type:"click"})}),s==null||s.addEventListener("touchstart",()=>{var n;(n=this.openSearch)==null||n.call(this,{keyWords:this.symbol.split(":")[1],TRDocument:this.TRDocument,type:"click"})})})})}changeTheme(t){return this.changeHeadeTheme=t,this}onError(t){return this.onErrorLogin=t,this}update(t){return this.updateSymbol=t,this}openSearchButton(t){return this.openSearch=t,this}setSymbol(t){return y.widget.chart().setSymbol(t),this}updateKey(t){return this.changeKey=t,this}};o(y,"widget",null);let B=y;const _t={class:"text-hidden"},Ct=Z({__name:"chartold",setup(g){const t=J(),{setTheme:e}=t,i=O(),s=G(),{$login:n,$message:l}=i,a=K(null),{locale:h,t:r,te:u}=Y(),f=R(()=>r("chart.head.title")),w=R(()=>r("chart.head.description")),C=R(()=>r("chart.head.keywords")),{tradingViewSearch:E,confirm:I}=ct(),_=x=>{const c=new Date;c.setFullYear(c.getFullYear()+10);const b=pt("theme",{expires:c});b.value=x,e(x)},m=K(!1),k=K(!1);tt({script:[{src:"/charting_library/charting_library.standalone.js",onload:async()=>{m.value=!0,t.getLoginStatus||await z("userInfo",t.fetchUserInfo),S()},onerror:()=>{console.error("Failed to load charting_library.standalone.js")}}]});const T=x=>{switch(x){case 401:return{slots:{default:()=>p("div",{style:"margin:0 1rem"},[p("div",{style:"display:flex;justify-content:center;margin-bottom:1rem;color:#e6a23c"},r("chart.head.tips"))])},showCancelButton:!1,confirmText:r("common.login.loginbtn"),onConfirm:c=>{n(c)}};case 429:return{slots:{default:()=>p("div",{style:"margin:0 1rem"},[p("div",[p("p",{style:"text-align:center;margin-bottom:0.5rem;color:#e6a23c"},r("chart.tradingViewTips.frequencyData")),p("a",{href:"/payment",style:"color:#3865f2"},r("chart.tradingViewTips.recommend"))])])},showCancelButton:!0,confirmText:r("common.btn.confirmText"),cancelText:r("common.btn.cancelText"),onConfirm:()=>{s.push({path:"/payment"})}};case 1:return{slots:{default:()=>p("div",{style:"margin:0 1rem;"},[p("div",[p("p",{style:"text-align:center;margin-bottom:0.5rem;color:#e6a23c"},r("chart.tradingViewTips.historicalData")),p("a",{href:"/payment",style:"color:#3865f2"},r("chart.tradingViewTips.recommend"))])])},showCancelButton:!0,confirmText:r("common.btn.confirmText"),cancelText:r("common.btn.cancelText"),onConfirm:()=>{s.push({path:"/payment"})}};case-1:return{slots:{default:()=>p("div",{style:"margin:0 1rem"},[p("div",{style:"display:flex;justify-content:center;margin-bottom:1rem;color:#e6a23c"},r("common.message.planExpired"))])},showCancelButton:!1,confirmText:r("common.btn.confirmText"),onConfirm:c=>{s.push({path:"/payment",query:{type:"renew",plan:t.getUserApiLevel,renewId:t.getUserApiKeyId}})}};default:return{slots:{default:()=>p("div",{style:"margin:0 1rem"},[p("div",{style:"display:flex;justify-content:center;margin-bottom:1rem;color:#e6a23c"},r("common.message.server"))])},showCancelButton:!1,confirmText:r("common.btn.confirmText"),onConfirm:()=>{}}}},S=()=>
261{if(!a.value||k.value)return!1;k.value=!0;const x=new B({container:a.value,keyId:t.getUserApiKeyId,buyApiKeyText:r("chart.tradingViewTips.buyApiKeyText"),apiKeys:t.getUserApiKeys.map(({key:c,id:b,level:d,name:v})=>({name:(u(`dashboard.market.${d}.name`)?r(`dashboard.market.${d}.name`):u(`dashboard.market.${d}`)?r(`dashboard.market.${d}`):"")+`ï¼${v}ï¼`,key:c,id:b})),symbol:A.getItem("symbol")||"BINANCE:BTCUSDT",interval:A.getItem("interval")||"5",lang:h.value,theme:t.theme}).updateKey(c=>{t.changeKeyId(c)}).changeTheme(_).update((c,b)=>{A.setItem(c,b)}).openSearchButton(c=>{const{keyWords:b,TRDocument:d,type:v}=c;d&&E({keyWords:b,TRDocument:d,type:v,lang:h.value}).then(({ticker:D})=>{var L;x.setSymbol(D),(L=x.searchButton)==null||L.updateSearchButtonText(D)}).catch(()=>{})}).onError(({code:c,msg:b})=>{const d=ht();if(ut().value||d.path!=="/chart")return!1;c=t.getUserApiExpiredStayus?-1:c,I({title:r("common.message.tips"),theme:t.theme,slots:T(c).slots,center:!0,showCancelButton:T(c).showCancelButton,confirmText:T(c).confirmText,cancelText:T(c).cancelText}).then(()=>{T(c).onConfirm(d.path)}).catch(()=>{})})};return et(()=>{U(()=>m.value,async()=>{if(!m.value)return!1;t.getLoginStatus||await z("userInfo",t.fetchUserInfo),await gt(),S()})}),st(()=>{it.publish("onUnmounted")}),U(h,()=>{k.value=!1,S()}),ot({title:f,keywords:C,ogTitle:f,twitterTitle:f,description:w,ogDescription:w,twitterDescription:w}),(x,c)=>(dt(),nt(lt,null,[j("h1",_t,at(q(r)("chart.head.h1")),1),j("div",{ref_key:"tradingview",ref:a,id:"tradingview-container",class:rt(["tradingview-container",q(t).theme])},null,2)],64))}}),Bt=mt(Ct,[["__scopeId","data-v-ec3a871b"]]);export{Bt as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.