1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6987],{55639:(t,e,n)=>{n.r(e),n.d(e,{decodeHTMLAttribute:()=>o,encodeHTMLAttribute:()=>i,parseChartMarkdown:()=>r,processChartsInHTML:()=>a});let r=t=>{let e,n=/<chart>([\s\S]*?)<\/chart>/g,r=[],a=t;for(;null!==(e=n.exec(t));){let t=e[1],n="chart_".concat(Date.now(),"_").concat(Math.random().toString(36).substr(2,9)),i="CHART_PLACEHOLDER_".concat(n);r.push({id:n,description:t,placeholder:i}),a=a.replace(e[0],i)}return{processedText:a,charts:r}},a=(t,e)=>{let n=t;return e.forEach(t=>{let e='<div class="chart-component" \n data-chart-id="'.concat(t.id,'" \n data-chart-desc="').concat(i(t.description),'">\n </div>');n=n.replace(t.placeholder,e)}),n},i=t=>(null==t?"":String(t)).replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">"),o=t=>t.replace(/"/g,'"').replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">").replace(/&/g,"&")},62331:(t,e,n)=>{n.d(e,{aG:()=>a});var r=n(1623);function a(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,a=String(null!=e?e:"").toLowerCase();try{return(0,r.vM)(t,a,n)}catch(t){return console.error("Error generating reference content for format ".concat(e,":"),t),"[".concat(n,"]")}}},76987:(t,e,n)=>{n.r(e),n.d(e,{htmlToHtml:()=>i,restoreChartRetryEvents:()=>s});var r=n(55639),a=n(62331);let i=async function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2?arguments[2]:void 0,a=arguments.length>3?arguments[3]:void 0,i=arguments.length>4?arguments[4]:void 0,c=arguments.length>5?arguments[5]:void 0;if(!t)return{processedHtml:"",reorderedCitations:[]};try{let d=t,g=[];if(e&&e.length>0){let{clearCitationManager:t}=await n.e(2452).then(n.bind(n,12452));t();let a=await o(d,e,r);d=a.processedHtml,g=a.reorderedCitations}return d=l(d),setTimeout(()=>{s(i,c,a)},100),{processedHtml:d,reorderedCitations:g}}catch(e){return console.error("Error processing HTML to HTML:",e),{processedHtml:t,reorderedCitations:[]}}},o=async(t,e,n)=>{let i=[];if(e.forEach(t=>{t.sites&&Array.isArray(t.sites)?i.push(...t.sites):(t.id||t.url)&&i.push(t)}),0===i.length)return{processedHtml:t,reorderedCitations:[]};let o=new DOMParser().parseFromString(t,"text/html"),c=o.querySelectorAll("span.citation-reference");if(0===c.length)return{processedHtml:t,reorderedCitations:[]};let s=[],l=[];c.forEach((t,e)=>{let n=t.getAttribute("data-citation-id");if(!n)return void l.push(t);let r=i.find(t=>String(t.id)===String(n));if(!r)return void l.push(t);s.push({element:t,citationId:n,referContent:r,order:e})}),l.forEach(t=>{var e;let n=t.textContent||"",r=o.createTextNode(n);null==(e=t.parentNode)||e.replaceChild(r,t)});let d=new Map,g=new Set,u=1;s.forEach(t=>{let{citationId:e}=t;g.has(e)||(g.add(e),d.set(e,u++))}),s.forEach(t=>{let{element:e,citationId:i,referContent:o}=t,c=d.get(i);if(!c)return;let s={authors:(null==o?void 0:o.authors)||[],year:null==o?void 0:o.year},l=(0,a.aG)(s,n,c);e.setAttribute("data-citation-index",c.toString()),e.setAttribute("data-citation-title",(0,r.encodeHTMLAttribute)(o.title||"")),e.setAttribute("data-citation-url",(0,r.encodeHTMLAttribute)(o.url||"")),e.setAttribute("data-citation-content",(0,r.encodeHTMLAttribute)(o.snippet||"")),e.setAttribute("data-citation-authors",(0,r.encodeHTMLAttribute)(JSON.stringify(o.authors||[]))),e.setAttribute("data-is-content-only","true"),e.textContent=l});let h=o.body.innerHTML,p=Array.from(d.entries()).map(t=>{let[e,n]=t,r=s.find(t=>t.citationId===e);return{id:e,newIndex:n,referContent:r.referContent}}).sort((t,e)=>t.newIndex-e.newIndex);return 0===p.length&&s.length>0?{processedHtml:h,reorderedCitations:s.map((t,e)=>({id:t.citationId,newIndex:e+1,referContent:t.referContent}))}:{processedHtml:h,reorderedCitations:p}},c=null,s=(t,e,a)=>{a||(c&&document.removeEventListener("click",c),c=async a=>{let i=a.target;if((null==i?void 0:i.tagName)==="IMG"&&(null==i?void 0:i.closest(".chart-image-container"))&&(null==i?void 0:i.getAttribute("src"))){a.stopPropagation(),a.preventDefault();let t=i.getAttribute("src");t&&window.openChartImageViewer&&window.openChartImageViewer(t);return}if((null==i?void 0:i.classList.contains("bg-[#67519C]"))&&(null==i?void 0:i.tagName)==="BUTTON"&&(null==i?void 0:i.closest(".chart-loading-container"))){a.stopPropagation(),a.preventDefault(),console.log("Event delegation handling retry click");let o=i.closest(".chart-node-view");if(!o||o.hasAttribute("data-chart-success"))return;let c=o.getAttribute("data-chart-id"),s=o.getAttribute("data-chart-desc"),l=o.getAttribute("data-chart-background")||"";if(c&&s)try{let a=(0,r.decodeHTMLAttribute)(s);if(window.chartCache){let t="".concat(a,"-").concat(l);delete window.chartCache[t]}o.innerHTML='\n <div class="chart-loading-container my-4">\n <div class="bg-[#EBEAE6] rounded-xl p-8 animate-pulse">\n <div class="flex flex-col items-center justify-center space-y-4 static-image-container min-h-[200px]">\n <img alt="Loading" width="56" height="56" src="/svg/loadingChart.svg" style="color: transparent;">
1\n <span class="text-[#989999] text-sm"> '.concat(null==e?void 0:e.generatingChart,"</span>\n </div>\n </div>\n </div>\n ");let{generateChartScreenshot:i}=await Promise.resolve().then(n.bind(n,624)),c=await i(a,l,t||"");if(c.success&&c.imageUrl){let t='\n <div class="chart-image-container my-6" style="opacity: 1; transform: none;">\n <div class="bg-white rounded-xl border border-gray-200 shadow-sm overflow-hidden">\n <div class="relative">\n <img alt="Generated Chart" width="800" height="500" \n src="'.concat(c.imageUrl,'" \n class="w-full h-auto chart-success-image cursor-pointer" \n style="color: transparent; max-height: 500px; object-fit: contain;"\n onclick="event.stopPropagation(); window.openChartImageViewer && window.openChartImageViewer(\'').concat(c.imageUrl,'\');"\n onmousedown="event.stopPropagation();"\n data-chart-final="true">\n </div>\n </div>\n </div>\n ');if(o.setAttribute("data-chart-success","true"),o.innerHTML=t,window.chartCache){let t="".concat(a,"-").concat(l);window.chartCache[t]={loading:!1,imageUrl:c.imageUrl}}}else o.innerHTML='\n <div class="chart-loading-container my-4">\n <div class="bg-[#EBEAE6] rounded-xl p-8">\n <div class="flex flex-col items-center justify-center space-y-4 static-image-container min-h-[200px]">\n <img alt="Loading" width="56" height="56" src="/svg/loadingChart.svg" style="color: transparent;">\n <span class="text-[#989999] text-sm">'.concat(null==e?void 0:e.failedToGenerate,'</span>\n <button class="mt-3 px-4 py-2 text-white text-sm rounded-lg bg-[#67519C] hover:bg-opacity-90 transition-colors">\n ').concat(null==e?void 0:e.retry,"\n </button>\n </div>\n </div>\n </div>\n ")}catch(t){console.error("Chart generation failed:",t),o.innerHTML='\n <div class="chart-loading-container my-4">\n <div class="bg-[#EBEAE6] rounded-xl p-8">\n <div class="flex flex-col items-center justify-center space-y-4 static-image-container min-h-[200px]">\n <img alt="Loading" width="56" height="56" src="/svg/loadingChart.svg" style="color: transparent;">\n <span class="text-[#989999] text-sm">'.concat(null==e?void 0:e.failedToGenerate,'</span>\n <button class="mt-3 px-4 py-2 text-white text-sm rounded-lg bg-[#67519C] hover:bg-opacity-90 transition-colors">\n ').concat(null==e?void 0:e.retry,"\n </button>\n </div>\n </div>\n </div>\n ")}}},document.addEventListener("click",c))},l=t=>{let e=new DOMParser().parseFromString(t,"text/html");return e.querySelectorAll(".chart-image-container").forEach(t=>{let e=t.querySelector("img");e&&e.src&&!e.src.includes("loadingChart.svg")&&(e.classList.add("cursor-pointer"),e.setAttribute("onclick","event.stopPropagation(); window.openChartImageViewer && window.openChartImageViewer('".concat(e.src,"');")),e.setAttribute("onmousedown","event.stopPropagation();"))}),e.body.innerHTML}}}]);
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.