PageSourceSearch

https://zaptrade.ai/chunk-TM3TCH3D.js

js zaptrade.ai collected 2026-10-05 14:49:22 UTC 5,734 bytes, 1 lines download raw bytes

1import{a as N}from"./chunk-7RKQJN3W.js";import{d as S}from"./chunk-BPUG44PP.js";import{M as p,c as m,ma as g,r as h,ra as P,x as s}from"./chunk-L7INXZLE.js";import{a as A,b as u}from"./chunk-BZNXDNCQ.js";var C=(()=>{let r=class r{constructor(n){this.http=n,this.API_BASE_URL=`${N.apiUrl}/api`,this.EXTERNAL_API_CONFIGS={alphaVantage:{baseUrl:"https://www.alphavantage.co/query",apiKey:"YOUR_ALPHA_VANTAGE_API_KEY"},iexCloud:{baseUrl:"https://cloud.iexapis.com/stable",apiKey:"YOUR_IEX_CLOUD_API_KEY"},finnhub:{baseUrl:"https://finnhub.io/api/v1",apiKey:"YOUR_FINNHUB_API_KEY"}},this.POPULAR_NASDAQ_STOCKS=["AAPL","MSFT","GOOGL","AMZN","TSLA","NVDA","META","NFLX","ADBE","CRM","ORCL","INTC","AMD","PYPL","UBER","SPOT","ZM","DOCU","ROKU","SQ","TWLO","OKTA","SNOW","PLTR","COIN","RBLX","HOOD","DKNG","MRNA","BNTX"]}getLiveNasdaqData(n="create"){return this.getSchwabNasdaqData(n).pipe(p(a=>(console.warn("Schwab NASDAQ API failed, falling back to sample data:",a),this.getSampleData())))}getSchwabNasdaqData(n="create"){let a=`${this.API_BASE_URL}/nasdaq/companies?limit=500&mode=${n}`;return this.http.get(a).pipe(s(t=>{if(!t.success||!t.companies)throw new Error("Invalid response from NASDAQ API");return t.companies.map(e=>({symbol:e.Symbol,name:e.Name,price:e.Lastsale,change:e.Netchange,changePercent:e.Pctchange,volume:e.Volume*1e6,marketCap:e.MarketCap*1e6,range:e.Range||2.5,RealTimePrice:e.RealTimePrice||!1,LastUpdated:e.LastUpdated}))}))}loadFreshNasdaqData(){let n=`${this.API_BASE_URL}/nasdaq/load-data`;return this.http.post(n,{})}getCompanyBySymbol(n){let a=`${this.API_BASE_URL}/nasdaq/company/${n.toUpperCase()}`;return this.http.get(a).pipe(s(t=>{if(!t.success||!t.company)return null;let e=t.company;return{symbol:e.Symbol,name:e.Name,price:e.Lastsale,change:e.Netchange,changePercent:e.Pctchange,volume:e.Volume*1e6,marketCap:e.MarketCap*1e6}}),p(()=>h(null)))}getIEXCloudData(){let n=this.POPULAR_NASDAQ_STOCKS.join(","),a=`${this.EXTERNAL_API_CONFIGS.iexCloud.baseUrl}/stock/market/batch?symbols=${n}&types=quote&token=${this.EXTERNAL_API_CONFIGS.iexCloud.apiKey}`;return this.http.get(a).pipe(s(t=>{let e=[];for(let o of this.POPULAR_NASDAQ_STOCKS){let c=t[o]?.quote;c&&e.push({symbol:o,name:c.companyName,price:c.latestPrice,change:c.change,changePercent:c.changePercent*100,volume:c.volume})}return e}))}getAlphaVantageData(){let n=this.POPULAR_NASDAQ_STOCKS.slice(0,5).map(a=>{let t=`${this.EXTERNAL_API_CONFIGS.alphaVantage.baseUrl}?function=GLOBAL_QUOTE&symbol=${a}&apikey=${this.EXTERNAL_API_CONFIGS.alphaVantage.apiKey}`;return this.http.get(t).toPromise()});return new m(a=>{Promise.all(n).then(t=>{let e=t.map((o,c)=>{let i=o["Global Quote"];return{symbol:this.POPULAR_NASDAQ_STOCKS[c],name:`${this.POPULAR_NASDAQ_STOCKS[c]} Inc.`,price:parseFloat(i["05. price"]),change:parseFloat(i["09. change"]),changePercent:parseFloat(i["10. change percent"].replace("%","")),volume:parseInt(i["06. volume"])}});a.next(e),a.complete()}).catch(t=>{a.error(t)})})}getFinnhubData(){let n=this.POPULAR_NASDAQ_STOCKS.slice(0,10).map(a=>{let t=`${this.EXTERNAL_API_CONFIGS.finnhub.baseUrl}/quote?symbol=${a}&token=${this.EXTERNAL_API_CONFIGS.finnhub.apiKey}`;return this.http.get(t).toPromise()});return new m(a=>{Promise.all(n).then(t=>{let e=t.map((o,c)=>({symbol:this.POPULAR_NASDAQ_STOCKS[c],name:`${this.POPULAR_NASDAQ_STOCKS[c]} Inc.`,price:o.c,change:o.d,changePercent:o.dp,volume:1e6}));a.next(e),a.complete()}).catch(t=>{a.error(t)})})}getSampleData(){let a=[{symbol:"AAPL",name:"Apple Inc.",price:150.25,change:2.15,changePercent:1.45,volume:45e6},{symbol:"MSFT",name:"Microsoft Corporation",price:285.5,change:-1.25,changePercent:-.44,volume:32e6},{symbol:"GOOGL",name:"Alphabet Inc.",price:2750.8,change:15.3,changePercent:.56,volume:12e5},{symbol:"AMZN",name:"Amazon.com Inc.",price:3200.15,change:-8.45,changePercent:-.26,volume:28e5},{symbol:"TSLA",name:"Tesla Inc.",price:850.75,change:12.5,changePercent:1.49,volume:18e6},{symbol:"NVDA",name:"NVIDIA Corporation",price:420.3,change:5.8,changePercent:1.4,volume:25e6},{symbol:"META",name:"Meta Platforms Inc.",price:325.6,change:-2.15,changePercent:-.66,volume:15e6},{symbol:"NFLX",name:"Netflix Inc.",price:485.9,change:8.25,changePercent:1.73,volume:85e5},{symbol:"ADBE",name:"Adobe Inc.",price:380.45,change:3.2,changePercent:.85,volume:32e5},{symbol:"CRM",name:"Salesforce Inc.",price:210.75,change:-1.85,changePercent:-.87,volume:41e5},{symbol:"ORCL",name:"Oracle Corporation",price:85.2,change:.95,changePercent:1.13,volume:12e6},{symbol:"INTC",name:"Intel Corporation",price:45.8,change:-.35,changePercent:-.76,volume:28e6},{symbol:"AMD",name:"Advanced Micro Devices",price:95.4,change:2.1,changePercent:2.25,volume:35e6},{symbol:"PYPL",name:"PayPal Holdings Inc.",price:65.25,change:1.45,changePercent:2.27,volume:14e6},{symbol:"UBER",name:"Uber Technologies Inc.",price:35.8,change:.75,changePercent:2.14,volume:22e6}].map(t=>u(A({},t),{price:Math.round(t.price*(1+(Math.random()-.5)*.02)*100)/100,change:Math.round(t.change*(1+(Math.random()-.5)*.3)*100)/100}));return h(a)}getStockQuote(n){return this.getCompanyBySymbol(n).pipe(s(a=>a||{symbol:n,name:`${n} Inc.`,price:100,change:0,changePercent:0,volume:1e6}))}searchStocks(n,a="create"){return this.getLiveNasdaqData(a).pipe(s(t=>t.filter(e=>e.symbol.toLowerCase().includes(n.toLowerCase())||e.name.toLowerCase().includes(n.toLowerCase()))))}refreshNasdaqData(){return this.loadFreshNasdaqData()}getNasdaqCompanies(n=100,a=0,t="create"){let e=`${this.API_BASE_URL}/nasdaq/companies?limit=${n}&offset=${a}&mode=${t}`;return this.http.get(e)}};r.\u0275fac=function(a){return new(a||r)(P(S))},r.\u0275prov=g({token:r,factory:r.\u0275fac,providedIn:"root"});let l=r;return l})();export{C as a};

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.