1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7090],{19088:function(e,t,n){n.d(t,{j:function(){return d}});var r=n(18566),i=n(7898),a=n(21401),o=n(59824),l=n(38312),s=n(52901),c=n(41483);function d(e){let{url:t,filename:n,onClose:d,swipeToDismiss:u=!0,children:f}=e,m=(0,l.E)(d),h=(0,i.useRef)(null),x=u?m.handlers:void 0;return(0,i.useEffect)(()=>{let e=e=>{"Escape"===e.key&&d()};document.addEventListener("keydown",e);let t=(0,o.t2)(h.current);return()=>{document.removeEventListener("keydown",e),t()}},[d]),(0,r.jsxs)("div",{ref:h,className:"fixed inset-0 z-[100] flex items-center justify-center backdrop-blur-sm animate-in fade-in duration-150",style:{backgroundColor:"rgba(0, 0, 0, ".concat(.8*m.backdropOpacity,")")},onClick:d,role:"dialog","aria-modal":"true","aria-label":n,...x,children:[(0,r.jsxs)("div",{className:"absolute right-[max(1rem,env(safe-area-inset-right))] top-[max(1rem,env(safe-area-inset-top))] z-10 flex gap-2",onClick:e=>e.stopPropagation(),children:[(0,r.jsx)("button",{onClick:()=>(0,a.S)(t,n),className:"flex h-9 w-9 items-center justify-center rounded-full bg-white/10 text-white transition hover:bg-white/20","aria-label":"Download",children:(0,r.jsx)(s.Z,{className:"h-5 w-5"})}),(0,r.jsx)("button",{onClick:d,className:"flex h-9 w-9 items-center justify-center rounded-full bg-white/10 text-white transition hover:bg-white/20","aria-label":"Close",children:(0,r.jsx)(c.Z,{className:"h-5 w-5"})})]}),f(m)]})}},38451:function(e,t,n){n.d(t,{C:function(){return d}});var r=n(18566),i=n(7898);async function a(e,t){let n=await fetch("/api/download-token?url=".concat(encodeURIComponent(e)),{credentials:"include"});if(!n.ok)throw Error("token request failed (".concat(n.status,")"));let{token:r}=await n.json(),i="/api/download?url=".concat(encodeURIComponent(e))+"&filename=".concat(encodeURIComponent(t),"&token=").concat(encodeURIComponent(r)),a=await fetch(i,{credentials:"include"});if(!a.ok)throw Error("download failed (".concat(a.status,")"));return a.text()}var o=n(2536),l=n(19088),s=n(61763),c=n(6101);function d(e){let{file:t,url:n,onClose:d,children:u}=e,f=(0,s.yH)(t.mimeType,t.filename),[m,h]=(0,i.useState)({status:"idle"});(0,i.useEffect)(()=>{if("markdown"!==f&&"text"!==f)return;if(t.sizeBytes>262144){h({status:"too-large"});return}let e=!1;return h({status:"loading"}),a(n,t.filename).then(t=>{e||h({status:"ready",text:t})}).catch(()=>{e||h({status:"error"})}),()=>{e=!0}},[f,n,t.filename,t.sizeBytes]);let x="flex h-[90vh] w-[min(64rem,92vw)] flex-col gap-3";return(0,r.jsx)(l.j,{url:n,filename:t.filename,onClose:d,swipeToDismiss:!1,children:()=>(0,r.jsxs)(r.Fragment,{children:["pdf"===f?(0,r.jsxs)("div",{className:x,onClick:e=>e.stopPropagation(),children:[(0,r.jsx)("iframe",{src:n,title:t.filename,className:"h-full w-full rounded-lg bg-white"}),(0,r.jsx)("a",{href:n,target:"_blank",rel:"noopener noreferrer",className:"self-center text-xs text-white/70 underline hover:text-white",children:"Open in new tab"})]}):(0,r.jsxs)("div",{className:"".concat(x," overflow-hidden rounded-xl border border-theme-border bg-theme-card p-6"),onClick:e=>e.stopPropagation(),children:[(0,r.jsx)("p",{className:"shrink-0 truncate text-sm font-medium text-theme-text",title:t.filename,children:t.filename}),(0,r.jsxs)("div",{className:"min-h-0 flex-1 overflow-y-auto",children:["loading"===m.status&&(0,r.jsx)("div",{className:"flex h-full items-center justify-center text-theme-text-muted",children:(0,r.jsx)(c.Z,{className:"h-6 w-6 animate-spin"})}),"too-large"===m.status&&(0,r.jsx)("p",{className:"text-sm text-theme-text-muted",children:"File is too large to preview. Use the download button above."}),"error"===m.status&&(0,r.jsx)("p",{className:"text-sm text-status-err",children:"Could not load this file. Use the download button above."}),"ready"===m.status&&("markdown"===f?(0,r.jsx)(o.MarkdownRenderer,{content:m.text}):(0,r.jsx)("pre",{className:"whitespace-pre-wrap break-words font-mono text-xs text-theme-text-muted",children:m.text}))]})]}),u]})})}},61763:function(e,t,n){function r(e){return e.startsWith("image/")?"image":e.startsWith("video/")?"video":e.startsWith("audio/")?"audio":"document"}function i(e,t){var n,r;let i=e.includes(".")&&null!==(n=e.split(".").pop())&&void 0!==n?n:"";return(/^[a-z0-9]+$/i.test(i)?i:null!==(r=t.split("/").pop())&&void 0!==r?r:"FILE").slice(0,4).toUpperCase()}function a(e,t){if("application/pdf"===e)return"pdf";let n=/\.(md|markdown)$/i.test(t);return"text/markdown"===e||"text/plain"===e&&n?"markdown":"text/plain"===e||"text/csv"===e?"text":null}n.d(t,{i3:function(){return r},uj:function(){return i},yH:function(){return a}})},82555:function(e,t,n){n.d(t,{z:function(){return c}});var r=n(18566),i=n(7898),a=n(8449),o=n(59829),l=n(24109);let s=(0,o.j)("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand-500 focus-visible:ring-offset-2 focus-visible:ring-offset-theme-bg disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-brand-500 text-white hover:bg-brand-600",destructive:"bg-red-600 text-white hover:bg-red-700",outline:"border border-theme-border bg-transparent text-theme-text hover:bg-surface-hover",secondary:"bg-surface-hover text-theme-text hover:bg-surface-raised",ghost:"text-theme-text-secondary hover:bg-surface-hover hover:text-theme-text",link:"text-accent-text underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-12 rounded-md px-8 text-base",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),c=i.forwardRef((e,t)=>
1{let{className:n,variant:i,size:o,asChild:c=!1,...d}=e,u=c?a.g7:"button";return(0,r.jsx)(u,{className:(0,l.cn)(s({variant:i,size:o,className:n})),ref:t,...d})});c.displayName="Button"},27654:function(e,t,n){n.d(t,{Q:function(){return l}});var r=n(18566),i=n(88510),a=n(6101),o=n(82555);function l(e){let{open:t,title:n,description:l,confirmLabel:s="Confirm",cancelLabel:c="Cancel",variant:d="destructive",icon:u=i.Z,iconClassName:f,iconBgClassName:m,loading:h,onClose:x,onConfirm:v}=e;return t?(0,r.jsxs)("div",{className:"fixed inset-0 z-50 flex items-center justify-center animate-in fade-in duration-150",role:"dialog","aria-modal":"true",children:[(0,r.jsx)("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-sm",onClick:()=>!h&&x()}),(0,r.jsxs)("div",{className:"relative z-10 mx-4 w-full max-w-sm rounded-xl border border-theme-border bg-surface-raised p-6 shadow-2xl animate-in zoom-in-95 slide-in-from-bottom-2 duration-200",children:[(0,r.jsxs)("div",{className:"text-center",children:[(0,r.jsx)("div",{className:"mx-auto mb-4 flex h-12 w-12 items-center justify-center rounded-full ".concat(null!=m?m:"destructive"===d?"bg-red-500/10":"bg-brand-500/10"),children:(0,r.jsx)(u,{className:"h-6 w-6 ".concat(null!=f?f:"destructive"===d?"text-status-err":"text-accent-text")})}),(0,r.jsx)("h2",{className:"text-lg font-semibold text-theme-text",children:n}),(0,r.jsx)("div",{className:"mt-2 text-sm text-theme-text-muted",children:l})]}),(0,r.jsxs)("div",{className:"mt-6 flex gap-3",children:[(0,r.jsx)(o.z,{variant:"ghost",className:"flex-1",onClick:x,disabled:h,children:c}),(0,r.jsxs)(o.z,{variant:"destructive"===d?"destructive":"default",className:"flex-1",onClick:v,disabled:h,children:[h&&(0,r.jsx)(a.Z,{className:"mr-2 h-4 w-4 animate-spin"}),s]})]})]})]}):null}},8592:function(e,t,n){n.d(t,{Am:function(){return m},Xd:function(){return x},e1:function(){return v}});var r=n(7898);let i=[],a=new Set,o=new Map,l=0;function s(){a.forEach(e=>e())}function c(e){return a.add(e),()=>{a.delete(e)}}function d(){return i}let u=[];function f(){return u}function m(e){var t;let n="string"==typeof e?e:e.description;if(!(null==n?void 0:n.trim())||i.some(t=>{var r;return t.description===n&&t.variant===("string"==typeof e?"default":null!==(r=e.variant)&&void 0!==r?r:"default")}))return;let r="string"==typeof e?{id:String(++l),description:n,variant:"default"}:{id:String(++l),description:n,title:e.title,variant:null!==(t=e.variant)&&void 0!==t?t:"default"};if((i=[...i,r]).length>5){let e=i[0];i=i.slice(1),h(e.id)}s();let a=setTimeout(()=>{o.delete(r.id),x(r.id)},5e3);o.set(r.id,a)}function h(e){let t=o.get(e);t&&(clearTimeout(t),o.delete(e))}function x(e){let t=i;i=i.filter(t=>t.id!==e),h(e),t.length!==i.length&&s()}function v(){return(0,r.useSyncExternalStore)(c,d,f)}m.success=e=>m({description:e,variant:"success"}),m.error=e=>m({description:e,variant:"error"}),m.info=e=>m({description:e,variant:"info"})},21401:function(e,t,n){async function r(e,t){if(e.startsWith("/")){let t=e.includes("?")?"&":"?";return"".concat(e).concat(t,"download=1")}try{let n=await fetch("/api/download-token?url=".concat(encodeURIComponent(e)),{credentials:"include"});if(!n.ok)return null;let{token:r}=await n.json();return"/api/download?url=".concat(encodeURIComponent(e),"&filename=").concat(encodeURIComponent(t),"&token=").concat(encodeURIComponent(r))}catch(e){return null}}function i(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=document.createElement("a");r.href=e,r.download=t,n&&(r.target="_blank"),document.body.appendChild(r),r.click(),document.body.removeChild(r)}async function a(e,t){let n=await r(e,t);if(n&&"undefined"!=typeof navigator&&"function"==typeof navigator.share&&"function"==typeof navigator.canShare&&("undefined"!=typeof navigator&&!0===navigator.standalone||function(){if("undefined"==typeof navigator)return!1;let e=navigator.userAgent||"",t=/Macintosh/i.test(e)&&navigator.maxTouchPoints>1;return/iPad|iPhone|iPod/i.test(e)||t}()))try{let e=await fetch(n,{credentials:"include"});if(e.ok){let n=await e.blob(),r=new File([n],t,{type:n.type});if(navigator.canShare({files:[r]})){try{await navigator.share({files:[r],title:t})}catch(e){}return}}}catch(e){}n?i(n,t):i(e,t,!0)}n.d(t,{S:function(){return a}})},59824:function(e,t,n){function r(e){return("auto"===e.overflowY||"scroll"===e.overflowY)&&e.scrollHeight>e.clientHeight}function i(e){let t=function(e){var t,n;let i=[],a=[];for(let n=null!==(t=null==e?void 0:e.parentElement)&&void 0!==t?t:null;n;n=n.parentElement){let e=window.getComputedStyle(n);i.push(n),a.push({overflowY:e.overflowY,scrollHeight:n.scrollHeight,clientHeight:n.clientHeight})}return null!==(n=i[a.findIndex(r)])&&void 0!==n?n:document.body}(e),n=t.style.overflow;return t.style.overflow="hidden",()=>{t.style.overflow=n}}n.d(t,{t2:function(){return i}})}}]);
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.