1(()=>{"use strict";(()=>{const t="skeleton";class e{constructor(t,{updateInterval:e=5e3,removeMissingSymbols:s=!0,fetchOnInit:i=!0,excludeFields:a=""}={}){if(this.tableEl=t,this.updateInterval=e,this.removeMissingSymbols=s,this.fetchOnInit=i,this.excludeFields=a,this.lastData={},this.intervalId=null,this.isFetching=!1,this.errorCount=0,this.maxErrors=10,this.isTabActive=!0,this.isElementVisible=!0,this._intersectionObserver=null,!this.tableEl)return console.warn(`SymbolTable: table not found for selector "${tableSelector}"`),void(this.symbolElements=[]);this.symbolElements=Array.from(this.tableEl.querySelectorAll("[data-symbol-name]")),this.symbols=this._collectSymbols(),this.fieldsToUpdate=this._parseFieldsToUpdate(),this._initSkeletons(),this._handleVisibilityChange=this._handleVisibilityChange.bind(this),document.addEventListener("visibilitychange",this._handleVisibilityChange),this.isTabActive=!document.hidden,this._handleIntersection=this._handleIntersection.bind(this),this._intersectionObserver=new window.IntersectionObserver(this._handleIntersection,{threshold:0}),this._intersectionObserver.observe(this.tableEl),this.fetchOnInit&&this._scheduleInitialFetch(),!1!==this.updateInterval&&this._updateAutoFetchState()}_handleVisibilityChange(){this.isTabActive=!document.hidden,this._updateAutoFetchState()}_handleIntersection(t){t&&t.length&&(this.isElementVisible=t[0].isIntersecting,this._updateAutoFetchState())}_updateAutoFetchState(){this.isTabActive&&this.isElementVisible?this.startAutoFetch():this.stopAutoFetch()}_scheduleInitialFetch(){const t=()=>{"function"==typeof window.requestIdleCallback?window.requestIdleCallback((()=>this._fetchAndUpdate()),{timeout:500}):setTimeout((()=>this._fetchAndUpdate()),0)};"complete"===document.readyState?t():window.addEventListener("load",t,{once:!0})}async _fetchAndUpdate(){if(!this.isFetching){if(this.errorCount>=this.maxErrors)return this.stopAutoFetch(),void console.warn(`SymbolTable: Stopped auto-fetching after ${this.maxErrors} consecutive errors.`);this.isFetching=!0;try{const t=await this._fetchSymbolsData(),e=t&&"object"==typeof t&&Object.keys(t).length>0;this.updateTable(t),e&&this._clearSkeletons(),this.errorCount=0}catch(t){this.errorCount+=1,console.error("SymbolTable fetch/update error:",t),this.errorCount===this.maxErrors&&(this.stopAutoFetch(),console.warn(`SymbolTable: Stopped auto-fetching after ${this.maxErrors} consecutive errors.`))}finally{this.isFetching=!1}}}updateTable(t){if(!t||"object"!=typeof t)return;if(!this.symbols.length)return;this.symbols.forEach((e=>{const s=this.tableEl.querySelector(`[data-symbol-name="${e}"]`);if(!s)return;t[e]?(this.fieldsToUpdate.forEach((i=>{switch(i){case"bid":this._updatePrice(s,t[e]?.bid);break;case"day-change":this._updateDayChange(s,t[e]?.price_change_percentage);break;case"sentiment":this._updateSentiment(s,t[e]?.sentiments);break;default:console.warn(`SymbolTable: unknown field "${i}"`)}})),s.classList.add("updated-data")):this.removeMissingSymbols&&s.remove()}));if(0===this.tableEl.querySelectorAll("[data-symbol-name]").length){const t=this.tableEl.closest(".tab-content").id,e=document.querySelector(`[data-tab=${t}]`).closest(".tabs-links");document.querySelector(`#${t}`).remove(),document.querySelector(`[data-tab=${t}]`).remove();e.querySelector(".tabs-link").click(),this.symbols=this._collectSymbols()}}async _fetchSymbolsData(t=this.symbols){if(!t.length)return{};const e=this._buildParams(t),s={};window.app?.rest?.nonce&&(s["X-WP-Nonce"]=window.app.rest.nonce);const i=await fetch(`${app.wp_rest_root}app/v1/trading/symbol/info?${e}&exclude=${this.excludeFields}`,{headers:s});if(!i.ok)throw new Error(`HTTP error! status: ${i.status}`);const a=await i.json();return this.lastData=a,a}_initSkeletons(){this.symbols.forEach((e=>{const s=this.tableEl.querySelector(`[data-symbol-name="${e}"]`);s&&this.fieldsToUpdate.forEach((e=>{s.querySelector(`[data-ajax-${e}]`)?.classList.add(t)}))}))}_clearSkeletons(){this.symbols.forEach((e=>{const s=this.tableEl.querySelector(`[data-symbol-name="${e}"]`);if(!s)return;s.querySelectorAll(`.${t}`).forEach((e=>e.classList.remove(t)))}))}_collectSymbols(){return Array.from(this.tableEl.querySelectorAll("[data-symbol-name]")).map((t=>
1t.dataset.symbolName)).filter(Boolean)}_parseFieldsToUpdate(){const t=this.tableEl.dataset.ajaxToUpdate||"";try{return JSON.parse(t)}catch{return t.split(",").map((t=>t.trim())).filter(Boolean)}}_buildParams(t=[]){const e=new URLSearchParams;return t.forEach((t=>e.append("symbols[]",t))),e.toString()}_updatePrice(t,e){const s=t.querySelector("[data-ajax-bid] .value")||t.querySelector("[data-ajax-bid]");s&&(s.textContent=e??"")}_updateDayChange(t,e){const s=t?.querySelector(".day-change[data-ajax-day-change]"),i=s?.querySelector(".value");s&&i&&("number"==typeof e&&(i.textContent=e>0?`+${e}%`:`${e}%`),s.className="cell day-change","number"==typeof e&&(e>0?s.classList.add("day-change--up"):e<0&&s.classList.add("day-change--down")))}_updateSentiment(t,e){const s=t?.querySelector("[data-ajax-sentiment]");s&&e.html&&(s.innerHTML=e.html)}startAutoFetch(){!1!==this.updateInterval&&(this.intervalId||(this.intervalId=setInterval((()=>{this._fetchAndUpdate()}),this.updateInterval)))}stopAutoFetch(){this.intervalId&&(clearInterval(this.intervalId),this.intervalId=null)}destroy(){document.removeEventListener("visibilitychange",this._handleVisibilityChange),this._intersectionObserver&&(this._intersectionObserver.disconnect(),this._intersectionObserver=null),this.stopAutoFetch()}}document.querySelectorAll(".c-block-hero-registration-form .trading-table").forEach((t=>{new e(t,{updateInterval:4e3,removeMissingSymbols:!1,excludeFields:"market_activity,sentiments,spread"})}));const s=".c-block-hero-registration-form__registration";!function(t){const e=document.querySelectorAll(t);if(!e.length)return;e.forEach((t=>{t.addEventListener("click",(e=>{e.preventDefault();const i=t.closest(s);if(!i)return;const a=i.querySelector(".hero-registration-email");if(!a)return;const r=a.value,n=t.getAttribute("href");if(!n||!function(t){try{const e=new URL(t,window.location.origin);return"https:"===e.protocol||"http:"===e.protocol}catch{return!1}}(n))return;const o=new URL(n,window.location.origin);o.searchParams.set("email",r);let l=o.toString();l=l.replace("%40","@"),window.location.href=l}));const e=t.closest(s);if(!e)return;const i=e.querySelector(".hero-registration-email");i&&i.addEventListener("keydown",(e=>{"Enter"===e.key&&(e.preventDefault(),t.focus(),t.click())}))}))}(".hero-registration-link")})()})();
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.