1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7106],{27106:function(e,t,r){r.r(t),r.d(t,{default:function(){return c}});var o=r(85893),n=r(67294);async function i(e){try{if(!/^[A-Za-z0-9\._\-:\/]+$/.test(e))return!1;let t=await fetch("/api/symbol/verify?symbol=".concat(encodeURIComponent(e)));if(!t.ok)throw Error("API error: ".concat(t.status));return(await t.json()).exists}catch(e){return console.error("Error validating symbol:",e),!1}}function a(e){let{message:t}=e;return(0,o.jsx)("div",{className:"tradingview-error",children:t})}function l(e){let{message:t="Loading TradingView chart..."}=e;return(0,o.jsx)("div",{className:"tradingview-loading",children:t})}function c(e){let{symbol:t,onError:r,theme:c="light",autosize:d=!0,height:s=500,width:u=800,interval:h="D",timezone:g="Etc/UTC",style:w="1",locale:m="en",toolbar_bg:p="#f1f3f6",enable_publishing:y=!1,withdateranges:b=!0,hide_side_toolbar:v=!1,allow_symbol_change:_=!0,save_image:f=!0,show_popup_button:E=!0,popup_width:T="1000",popup_height:x="650",container_id:j}=e,C=(0,n.useRef)(null),{isLoading:I,isValidSymbol:S,containerId:V}=function(e){let[t,r]=(0,n.useState)(!0),[o,a]=(0,n.useState)(!1),[l,c]=(0,n.useState)(""),[d,s]=(0,n.useState)(!0),u=e.containerId||e.container_id||"tradingview_".concat(Math.random().toString(36).substr(2,9));return(0,n.useEffect)(()=>((async()=>{var t,o,n;if(e.symbol)try{let o=await i(e.symbol);if(s(o),!o){a(!0),c("Invalid symbol: ".concat(e.symbol)),r(!1),null===(t=e.onError)||void 0===t||t.call(e,"Invalid symbol: ".concat(e.symbol));return}}catch(t){s(!1),a(!0),c("Symbol validation error: ".concat(t)),r(!1),null===(o=e.onError)||void 0===o||o.call(e,"Symbol validation error: ".concat(t));return}let l={symbol:e.symbol,onError:e.onError,theme:e.theme,autosize:e.autosize,height:e.height,width:e.width,interval:e.interval,timezone:e.timezone,style:e.style,locale:e.locale,toolbar_bg:e.toolbar_bg,enable_publishing:e.enable_publishing,withdateranges:e.withdateranges,hide_side_toolbar:e.hide_side_toolbar,allow_symbol_change:e.allow_symbol_change,save_image:e.save_image,show_popup_button:e.show_popup_button,popup_width:e.popup_width,popup_height:e.popup_height,largeChartUrl:e.largeChartUrl};if(window.TradingView)try{new window.TradingView.widget({...l,container_id:u}),r(!1),a(!1)}catch(t){a(!0),c("Widget creation error: ".concat(t)),r(!1),null===(n=e.onError)||void 0===n||n.call(e,"Widget creation error: ".concat(t))}else(()=>{try{let t=document.getElementById(u);t&&(t.innerHTML="");let o=document.createElement("script");o.type="text/javascript",o.src="https://s3.tradingview.com/tv.js",o.async=!0,o.onload=()=>{window.TradingView&&(new window.TradingView.widget({...l,container_id:u}),r(!1),a(!1))},o.onerror=()=>{var t;a(!0),c("Failed to load TradingView widget"),r(!1),null===(t=e.onError)||void 0===t||t.call(e,"Failed to load TradingView widget")},document.head.appendChild(o)}catch(o){var t;a(!0),c("Widget initialization error: ".concat(o)),r(!1),null===(t=e.onError)||void 0===t||t.call(e,"Widget initialization error: ".concat(o))}})()})(),()=>{let e=document.getElementById(u);if(e)try{e.innerHTML="",e.querySelectorAll("*").forEach(e=>{if(e.cloneNode){var t;let r=e.cloneNode(!0);null===(t=e.parentNode)||void 0===t||t.replaceChild(r,e)}})}catch(e){}}),[e.symbol,u]),{isLoading:t,hasError:o,errorMessage:l,isValidSymbol:d,containerId:u}}({symbol:t,onError:r,theme:c,autosize:d,height:s,width:u,interval:h,timezone:g,style:w,locale:m,toolbar_bg:p,enable_publishing:y,withdateranges:b,hide_side_toolbar:v,allow_symbol_change:_,save_image:f,show_popup_button:E,popup_width:T,popup_height:x,container_id:j});return S?(0,o.jsx)("div",{id:V,ref:C,style:{height:d?"100%":"".concat(s,"px"),width:d?"100%":"".concat(u,"px")},children:I&&(0,o.jsx)(l,{})}
1):(0,o.jsx)(a,{message:"Invalid TradingView symbol: ".concat(t)})}}}]);
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.