PageSourceSearch

https://polydesk.ai/_next/static/chunks/1706.9bff021206f87c1d.js

js polydesk.ai collected 2026-10-05 12:58:51 UTC 9,631 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1706,9519],{5219:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(30772).A)("clipboard",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}]])},19519:(e,t,n)=>{n.d(t,{g:()=>i});var r=n(12115);function a(e,t,n){let r=e.getBoundingClientRect();return t<r.left||t>r.right||n<r.top||n>r.bottom}function i(e){let t=(0,r.useRef)(null),n=t=>{t.open&&t.close(),e()};return{onCancel:e=>{e.preventDefault(),n(e.currentTarget)},onPointerCancel:e=>{t.current===e.pointerId&&(t.current=null)},onPointerDown:e=>{t.current=0===e.button&&e.isPrimary&&a(e.currentTarget,e.clientX,e.clientY)?e.pointerId:null},onPointerUp:e=>{let r=t.current===e.pointerId;t.current=null,r&&a(e.currentTarget,e.clientX,e.clientY)&&n(e.currentTarget)}}}},69325:(e,t,n)=>{n.r(t),n.d(t,{CompanyComparisonDialog:()=>S});var r=n(95155),a=n(87791),i=n(50825),s=n(92571),l=n(64577),c=n(5219),o=n(9005),m=n(12115),d=n(97638),u=n(72073),p=n(19519),x=n(94156),f=n(15217),h=n(17817),b=n(7514);let k="median";function g(e){return null!=e&&Number.isFinite(e)?e:null}function j(e){return 1e-10>Math.abs(e)?0:e}function v(e,t,n){if(n===k){let n=e.map(e=>e.metrics[t]).flatMap(e=>{let t=g(e);return null===t?[]:[t]}).sort((e,t)=>e-t);if(0===n.length)return null;let r=Math.floor(n.length/2);return n.length%2==1?n[r]:(n[r-1]+n[r])/2}return g(e.find(e=>e.ticker===n)?.metrics[t])}function N(e,t,n){let r=g(e),a=g(t);return null===r||null===a?null:"percent"===n?{kind:"percentagePoints",value:j(r-a)}:0===a?null:{kind:"percent",value:j((r-a)/Math.abs(a)*100)}}function w(e,t="en-US"){if(!e)return"N/M";let n=e.value>0?"+":"",r="percentagePoints"===e.kind?" pp":"%",a=e.value.toLocaleString(t,{maximumFractionDigits:1,minimumFractionDigits:1});return`${n}${a}${r}`}var y=n(50912),C=n(85583);function $(e,t){if(t===k)return"Median";let n=e.find(e=>e.ticker===t);return n?`${n.ticker} — ${n.name}`:t}function M({baseline:e,baselineValue:t,company:n,locale:r="en-US",metricKey:a}){let i=n.metrics[a];return null!==i&&Number.isFinite(i)?e===n.ticker&&null!==t?"Reference":w(N(i,t,f.Cb[a].format),r):"N/M"}function z(e){return e.replaceAll("\\","\\\\").replaceAll("|","\\|").replaceAll("\n"," ")}function S({companies:e,metricKeys:t,onClose:n,onRemove:g}){let j,A=(0,m.useRef)(null),{preferences:R}=(0,u.CI)(),D=(0,y.wx)(R.numberFormat),[F,T]=(0,m.useState)(k),[E,P]=(0,m.useState)(!1),[U,L]=(0,m.useState)(null),V=F===k||e.some(e=>e.ticker===F)?F:k,I=(0,m.useMemo)(()=>({baseline:V,companies:e,metricKeys:t}),[V,e,t]),_=(0,m.useMemo)(()=>(function({baseline:e,companies:t,metricKeys:n}){let r=$(t,e),a=[["Metric","Unit","Reference","Reference value",...t.flatMap(e=>[`${e.ticker} value`,`${e.ticker} vs reference`])]];for(let i of n){let n=f.Cb[i],s=v(t,i,e);a.push([n.label,n.format,r,s,...t.flatMap(t=>[t.metrics[i],M({baseline:e,baselineValue:s,company:t,metricKey:i})])])}return(0,h.serializeCsv)(a)})(I),[I]),B=(0,m.useMemo)(()=>(function({baseline:e,companies:t,locale:n="en-US",metricKeys:r}){let a=$(t,e),i=["Metric","Reference value",...t.map(e=>`${e.ticker} — ${e.name}`)],s=["# Company comparison","",`Reference: ${a}`,"",`| ${i.map(z).join(" | ")} |`,`| ${i.map((e,t)=>0===t?"---":"---:").join(" | ")} |`];for(let a of r){let r=f.Cb[a],i=v(t,a,e),l=t.map(t=>{let s=(0,C.dd)(t.metrics[a],r,n),l=M({baseline:e,baselineValue:i,company:t,locale:n,metricKey:a});return`${s} (${l})`});s.push(`| ${[r.label,(0,C.dd)(i,r,n),...l].map(z).join(" | ")} |`)}return s.join("\n")})({...I,locale:D}),[I,D]),H=(j=e.map(e=>e.ticker.toLowerCase().replaceAll(/[^a-z0-9.-]/g,"")).filter(Boolean).join("-"),`company-comparison${j?`-${j}`:""}`),X=(0,p.g)(n);async function Y(){if(!E){P(!0),L(null);try{await (0,h.copyTextToClipboard)(B),L({message:"Markdown copied.",tone:"success"})}catch{L({message:"Clipboard access is unavailable. Download Markdown instead.",tone:"error"})}finally{P(!1)}}}return(0,m.useEffect)(()=>{let e=A.current;if(!e)return;let t=document.activeElement;return e.showModal(),()=>{e.open&&e.close(),t instanceof HTMLElement&&t.isConnected&&t.focu
1s({preventScroll:!0})}},[]),(0,r.jsxs)(x.lG,{ref:A,"aria-labelledby":"explicit-comparison-title",...X,size:"xl",children:[(0,r.jsx)(x.c7,{closeLabel:"Close company comparison",onClose:n,children:(0,r.jsxs)("div",{children:[(0,r.jsxs)("h2",{id:"explicit-comparison-title",className:"ui-section-title flex items-center gap-2",children:[(0,r.jsx)(a.A,{className:"size-4"}),"Compare companies"]}),(0,r.jsx)("p",{className:"ui-caption mt-0.5",children:"Side-by-side view of the metrics currently visible in the table."})]})}),(0,r.jsxs)(x.R4,{className:"p-0",children:[(0,r.jsxs)("section",{"aria-label":"Comparison reference and exports",className:"border-b border-border bg-surface px-4 py-3",children:[(0,r.jsxs)("div",{className:"flex flex-col gap-3 lg:flex-row lg:items-end lg:justify-between",children:[(0,r.jsxs)("div",{className:"max-w-sm",children:[(0,r.jsx)("label",{className:"ui-label mb-1.5 block text-ink-muted",htmlFor:"comparison-baseline",children:"Compare against"}),(0,r.jsxs)(x.l6,{"aria-describedby":"comparison-baseline-hint",id:"comparison-baseline",onChange:e=>{T(e.target.value),L(null)},size:"md",value:V,children:[(0,r.jsx)("option",{value:k,children:"Median of selected companies"}),e.map(e=>(0,r.jsxs)("option",{value:e.ticker,children:[e.ticker," — ",e.name]},e.ticker))]}),(0,r.jsx)("p",{id:"comparison-baseline-hint",className:"ui-caption mt-1.5",children:"Percent metrics use percentage-point gaps; all others use relative percent gaps."})]}),(0,r.jsxs)("div",{"aria-label":"Export comparison",className:"flex flex-wrap items-center gap-2",children:[(0,r.jsxs)(x.$n,{"aria-label":"Download comparison as CSV",onClick:function(){try{(0,h.downloadTextFile)({contents:_,fileName:`${H}.csv`,mimeType:"text/csv;charset=utf-8"}),L({message:"CSV download started.",tone:"success"})}catch{L({message:"CSV export is unavailable in this browser.",tone:"error"})}},size:"sm",variant:"outline",children:[(0,r.jsx)(i.A,{className:"size-3.5"}),"CSV"]}),(0,r.jsxs)(x.$n,{"aria-label":E?"Copying comparison as Markdown":"Copy comparison as Markdown",disabled:E,onClick:Y,size:"sm",variant:"outline",children:[E?(0,r.jsx)(s.A,{className:"size-3.5 animate-spin"}):U?.message==="Markdown copied."?(0,r.jsx)(l.A,{className:"size-3.5"}):(0,r.jsx)(c.A,{className:"size-3.5"}),E?"Copying":"Copy Markdown"]}),(0,r.jsxs)(x.$n,{"aria-label":"Download comparison as Markdown",onClick:function(){try{(0,h.downloadTextFile)({contents:B,fileName:`${H}.md`,mimeType:"text/markdown;charset=utf-8"}),L({message:"Markdown download started.",tone:"success"})}catch{L({message:"Markdown export is unavailable in this browser.",tone:"error"})}},size:"sm",variant:"outline",children:[(0,r.jsx)(i.A,{className:"size-3.5"}),"Markdown"]})]})]}),(0,r.jsx)("p",{"aria-atomic":"true","aria-live":U?.tone==="error"?"assertive":"polite",className:U?`mt-2 min-h-4 text-xs ${"error"===U.tone?"text-loss-strong":"text-positive"}`:"sr-only",children:U?.message??""})]}),(0,r.jsx)("div",{className:"overflow-x-auto",children:(0,r.jsxs)("table",{className:"min-w-full border-collapse text-sm",children:[(0,r.jsx)("caption",{className:"sr-only",children:"Side-by-side comparison of the selected companies"}),(0,r.jsx)("thead",{className:"sticky top-0 bg-surface-2",children:(0,r.jsxs)("tr",{className:"border-b border-border",children:[(0,r.jsx)("th",{className:"min-w-36 px-4 py-3 text-left text-xs uppercase tracking-wide text-ink-faint",children:"Metric"}),e.map(e=>(0,r.jsx)("th",{className:"min-w-40 px-3 py-3 text-left",children:(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)(d.v,{logoUrl:(0,b.W)(e.websiteUrl),size:"sm",symbol:e.ticker}),(0,r.jsxs)("span",{className:"min-w-0",children:[(0,r.jsx)("span",{className:"block font-semibold text-ink",children:e.ticker}),(0,r.jsx)("span",{className:"block truncate text-xs font-normal text-ink-faint",children:e.name})]}),(0,r.jsx)(x.K0,{label:`Remove ${e.ticker} from comparison selection`,size:"sm",className:"ml-auto",onClick:()=>{V===e.ticker&&T(k),g(e.ticker)},children:(0,r.jsx)(o.A,{className:"size-3.5"})})]})},e.ticker))]})}),(0,r.jsx)("tbody",{className:"divide-y divide-border",children:t.map(t=>{let n=f.Cb[t],a=v(e,t,V);return(0,r.jsxs)("tr",{children:[(0,r.jsx)("th",{className:"px-4 py-2.5 text-left text-xs font-medium text-ink-muted",children:n.label}),e.map(e=>{let i=e.metrics[t],s=(0,C.dd)(i,n,D),l=V===e.ticker&&null!==i&&Number.isFinite(i),c=l?null:N(i,a,n.format),o=l?"Reference":w(c,D),m=l?"Selected reference":function(e,t="en-US"){if(!e)return"Not comparable to the reference";if(0===e.value)return"Equal to the reference";let n=e.value>0?"above":"below",r="percentagePoints"===e.kind?"percentage points":"percent",a=Math.abs(e.value).toLocaleStr
1ing(t,{maximumFractionDigits:1,minimumFractionDigits:1});return`${a} ${r} ${n} the reference`}(c,D);return(0,r.jsx)("td",{"aria-label":`${e.ticker} ${n.label}: ${s}. ${m}.`,className:"px-3 py-2.5 tabular-nums text-ink",children:(0,r.jsxs)("span",{"aria-hidden":"true",children:[(0,r.jsx)("span",{className:"block font-semibold",children:s}),(0,r.jsxs)("span",{className:"mt-0.5 block text-xs font-normal text-ink-faint",title:m,children:[o,"Reference"!==o&&" vs reference"]})]})},e.ticker)})]},t)})})]})})]}),(0,r.jsx)(x.Es,{children:(0,r.jsx)(x.$n,{onClick:n,children:"Done"})})]})}},92571:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(30772).A)("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]])}}]);

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.