makearmy-app/.next/server/app/co2-gantry-settings/page.js
2025-09-22 10:37:53 -04:00

1 line
No EOL
10 KiB
JavaScript

(()=>{var e={};e.id=6775,e.ids=[6775],e.modules={1379:(e,s,a)=>{"use strict";a.r(s),a.d(s,{default:()=>n});var t=a(37413),r=a(61120);function n({children:e}){return(0,t.jsx)(r.Suspense,{fallback:null,children:e})}},3295:e=>{"use strict";e.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},10846:e=>{"use strict";e.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},19121:e=>{"use strict";e.exports=require("next/dist/server/app-render/action-async-storage.external.js")},20552:(e,s,a)=>{Promise.resolve().then(a.bind(a,84558))},29294:e=>{"use strict";e.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33873:e=>{"use strict";e.exports=require("path")},52408:(e,s,a)=>{"use strict";a.r(s),a.d(s,{default:()=>t});let t=(0,a(12907).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/app/app/co2-gantry-settings/page.tsx\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/app/app/co2-gantry-settings/page.tsx","default")},57e3:(e,s,a)=>{Promise.resolve().then(a.bind(a,52408))},63033:e=>{"use strict";e.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},63856:(e,s,a)=>{"use strict";a.r(s),a.d(s,{GlobalError:()=>l.a,__next_app__:()=>x,pages:()=>d,routeModule:()=>b,tree:()=>o});var t=a(65239),r=a(48088),n=a(88170),l=a.n(n),c=a(30893),i={};for(let e in c)0>["default","tree","pages","GlobalError","__next_app__","routeModule"].indexOf(e)&&(i[e]=()=>c[e]);a.d(s,i);let o={children:["",{children:["co2-gantry-settings",{children:["__PAGE__",{},{page:[()=>Promise.resolve().then(a.bind(a,52408)),"/app/app/co2-gantry-settings/page.tsx"]}]},{layout:[()=>Promise.resolve().then(a.bind(a,1379)),"/app/app/co2-gantry-settings/layout.tsx"]}]},{layout:[()=>Promise.resolve().then(a.bind(a,58014)),"/app/app/layout.tsx"],"not-found":[()=>Promise.resolve().then(a.t.bind(a,57398,23)),"next/dist/client/components/not-found-error"],forbidden:[()=>Promise.resolve().then(a.t.bind(a,89999,23)),"next/dist/client/components/forbidden-error"],unauthorized:[()=>Promise.resolve().then(a.t.bind(a,65284,23)),"next/dist/client/components/unauthorized-error"]}]}.children,d=["/app/app/co2-gantry-settings/page.tsx"],x={require:a,loadChunk:()=>Promise.resolve()},b=new t.AppPageRouteModule({definition:{kind:r.RouteKind.APP_PAGE,page:"/co2-gantry-settings/page",pathname:"/co2-gantry-settings",bundlePath:"",filename:"",appPaths:[]},userland:{loaderTree:o}})},84558:(e,s,a)=>{"use strict";a.r(s),a.d(s,{default:()=>x});var t=a(60687),r=a(76180),n=a.n(r),l=a(43210),c=a(16189),i=a(85814),o=a.n(i),d=a(30474);function x(){let e=(0,c.useSearchParams)().get("query")||"",[s,a]=(0,l.useState)(e),[r,i]=(0,l.useState)(e),[x,b]=(0,l.useState)([]),[m,p]=(0,l.useState)(!0),u=e=>{if(!r)return e;let s=RegExp(`(${r})`,"gi");return e?.replace(s,"<mark>$1</mark>")},h=(0,l.useMemo)(()=>{let e=r.toLowerCase();return x.filter(s=>[s.setting_title,s.uploader,s.mat?.name,s.mat_coat?.name,s.source?.model,s.lens?.name].filter(Boolean).some(s=>s.toLowerCase().includes(e)))},[x,r]),f=x.length,j=new Set(x.map(e=>e.mat?.name).filter(Boolean)).size,g=x.reduce((e,s)=>{let a=s.lens?.name;return a&&(e[a]=(e[a]||0)+1),e},{}),N=Object.entries(g).sort((e,s)=>(Number(s[1])||0)-(Number(e[1])||0))[0]?.[0]||"—",y=x.reduce((e,s)=>{let a=s.source?.model;return a&&(e[a]=(e[a]||0)+1),e},{}),_=Object.entries(y).sort((e,s)=>(Number(s[1])||0)-(Number(e[1])||0))[0]?.[0]||"—",v=[...x].sort((e,s)=>s.submission_id-e.submission_id).slice(0,5);return(0,t.jsxs)("div",{className:"jsx-12522c6baa7fb659 p-6 max-w-7xl mx-auto",children:[(0,t.jsx)(n(),{id:"12522c6baa7fb659",children:"mark{background:#ffde59;color:#242424;padding:0 2px;-webkit-border-radius:2px;-moz-border-radius:2px;border-radius:2px}"}),(0,t.jsxs)("div",{className:"jsx-12522c6baa7fb659 grid grid-cols-1 md:grid-cols-2 xl:grid-cols-3 gap-4 mb-6",children:[(0,t.jsxs)("div",{className:"jsx-12522c6baa7fb659 card bg-card text-card-foreground p-4",children:[(0,t.jsx)("h1",{className:"jsx-12522c6baa7fb659 text-2xl font-bold mb-2",children:"CO₂ Gantry Settings"}),(0,t.jsx)("input",{type:"search",value:s,onChange:e=>a(e.target.value),placeholder:"Search settings by material, uploader, etc...",className:"jsx-12522c6baa7fb659 w-full mb-4 dark:bg-background border border-border rounded-md p-2"}),(0,t.jsx)("p",{className:"jsx-12522c6baa7fb659 text-sm text-muted-foreground mb-2",children:"Explore curated CO₂ gantry settings. Search by material, uploader, or source."}),(0,t.jsx)("a",{href:"/",className:"jsx-12522c6baa7fb659 inline-block mt-2 px-4 py-2 bg-accent text-background rounded-md text-sm",children:"← Back to Main Menu"})]}),(0,t.jsxs)("div",{className:"jsx-12522c6baa7fb659 card bg-card text-card-foreground p-4",children:[(0,t.jsx)("h2",{className:"jsx-12522c6baa7fb659 text-lg font-semibold mb-2",children:"How to Use"}),(0,t.jsx)("p",{className:"jsx-12522c6baa7fb659 text-sm",children:"Browse real-world CO₂ gantry settings. Search or filter results, and click any setting for full configuration and notes."})]}),(0,t.jsxs)("div",{className:"jsx-12522c6baa7fb659 card bg-card text-card-foreground p-4",children:[(0,t.jsx)("h2",{className:"jsx-12522c6baa7fb659 text-lg font-semibold mb-2",children:"Stats Summary"}),(0,t.jsxs)("ul",{className:"jsx-12522c6baa7fb659 text-sm space-y-1",children:[(0,t.jsxs)("li",{className:"jsx-12522c6baa7fb659",children:["Total Settings: ",f]}),(0,t.jsxs)("li",{className:"jsx-12522c6baa7fb659",children:["Unique Materials: ",j]}),(0,t.jsxs)("li",{className:"jsx-12522c6baa7fb659",children:["Most Common Lens: ",N]}),(0,t.jsxs)("li",{className:"jsx-12522c6baa7fb659",children:["Most Used Source: ",_]})]})]}),(0,t.jsxs)("div",{className:"jsx-12522c6baa7fb659 card bg-card text-card-foreground p-4",children:[(0,t.jsx)("h2",{className:"jsx-12522c6baa7fb659 text-lg font-semibold mb-2",children:"Recently Added"}),(0,t.jsx)("ul",{className:"jsx-12522c6baa7fb659 text-sm space-y-1",children:v.map(e=>(0,t.jsxs)("li",{className:"jsx-12522c6baa7fb659",children:[(0,t.jsx)(o(),{href:`/co2gantry-settings/${e.submission_id}`,className:"underline text-accent",children:e.setting_title||"Untitled"})," by ",e.uploader||"—"]},e.submission_id))})]}),(0,t.jsxs)("div",{className:"jsx-12522c6baa7fb659 card bg-card text-card-foreground p-4",children:[(0,t.jsx)("h2",{className:"jsx-12522c6baa7fb659 text-lg font-semibold mb-2",children:"Resources"}),(0,t.jsxs)("ul",{className:"jsx-12522c6baa7fb659 text-sm space-y-1",children:[(0,t.jsx)("li",{className:"jsx-12522c6baa7fb659",children:(0,t.jsx)("a",{href:"/materials",target:"_blank",rel:"noopener noreferrer",className:"jsx-12522c6baa7fb659 underline text-accent",children:"Material Safety Guide"})}),(0,t.jsx)("li",{className:"jsx-12522c6baa7fb659",children:(0,t.jsx)("a",{href:"https://lasereverything.net/scripts/laspwrconvert.php",target:"_blank",rel:"noopener noreferrer",className:"jsx-12522c6baa7fb659 underline text-accent",children:"Laser Parameter Calculator"})}),(0,t.jsx)("li",{className:"jsx-12522c6baa7fb659",children:(0,t.jsx)("a",{href:"https://jptoe.com/downloads",target:"_blank",rel:"noopener noreferrer",className:"jsx-12522c6baa7fb659 underline text-accent",children:"JPT Datasheets"})})]})]}),(0,t.jsxs)("div",{className:"jsx-12522c6baa7fb659 card bg-card text-card-foreground p-4 flex flex-col justify-between",children:[(0,t.jsxs)("div",{className:"jsx-12522c6baa7fb659",children:[(0,t.jsx)("h2",{className:"jsx-12522c6baa7fb659 text-md font-semibold mb-2",children:"Submit a Setting"}),(0,t.jsx)("p",{className:"jsx-12522c6baa7fb659 text-sm text-muted-foreground mb-2",children:"Got a dialed-in gantry setting? Contribute it to the database."})]}),(0,t.jsx)(o(),{href:"/submit/settings?target=settings_co2gan",className:"bg-accent text-background text-sm px-4 py-2 rounded hover:opacity-90 transition",children:"Submit a Setting"})]})]}),m?(0,t.jsx)("p",{className:"jsx-12522c6baa7fb659 text-muted",children:"Loading settings..."}):0===h.length?(0,t.jsx)("p",{className:"jsx-12522c6baa7fb659 text-muted",children:"No gantry settings found."}):(0,t.jsx)("div",{className:"jsx-12522c6baa7fb659 overflow-x-auto",children:(0,t.jsxs)("table",{className:"jsx-12522c6baa7fb659 w-full text-sm",children:[(0,t.jsx)("thead",{className:"jsx-12522c6baa7fb659",children:(0,t.jsxs)("tr",{className:"jsx-12522c6baa7fb659",children:[(0,t.jsx)("th",{className:"jsx-12522c6baa7fb659 px-2 py-2 text-left",children:"Photo"}),(0,t.jsx)("th",{className:"jsx-12522c6baa7fb659 px-2 py-2 text-left",children:"Title"}),(0,t.jsx)("th",{className:"jsx-12522c6baa7fb659 px-2 py-2 text-left",children:"Uploader"}),(0,t.jsx)("th",{className:"jsx-12522c6baa7fb659 px-2 py-2 text-left",children:"Material"}),(0,t.jsx)("th",{className:"jsx-12522c6baa7fb659 px-2 py-2 text-left",children:"Coating"}),(0,t.jsx)("th",{className:"jsx-12522c6baa7fb659 px-2 py-2 text-left",children:"Source"}),(0,t.jsx)("th",{className:"jsx-12522c6baa7fb659 px-2 py-2 text-left",children:"Lens"})]})}),(0,t.jsx)("tbody",{className:"jsx-12522c6baa7fb659",children:h.map(e=>(0,t.jsxs)("tr",{className:"jsx-12522c6baa7fb659 border-t border-border",children:[(0,t.jsx)("td",{className:"jsx-12522c6baa7fb659 px-2 py-2",children:e.photo?.id?(0,t.jsx)(d.default,{src:`https://forms.lasereverything.net/assets/${e.photo.id}`,alt:e.photo.title||"laser preview",width:64,height:64,className:"rounded-md"}):"—"}),(0,t.jsx)("td",{className:"jsx-12522c6baa7fb659 px-2 py-2 whitespace-nowrap",children:(0,t.jsx)(o(),{href:`/co2gantry-settings/${e.submission_id}`,className:"text-accent underline",dangerouslySetInnerHTML:{__html:u(e.setting_title||"—")}})}),(0,t.jsx)("td",{dangerouslySetInnerHTML:{__html:u(e.uploader||"—")},className:"jsx-12522c6baa7fb659 px-2 py-2 whitespace-nowrap"}),(0,t.jsx)("td",{dangerouslySetInnerHTML:{__html:u(e.mat?.name||"—")},className:"jsx-12522c6baa7fb659 px-2 py-2 whitespace-nowrap"}),(0,t.jsx)("td",{dangerouslySetInnerHTML:{__html:u(e.mat_coat?.name||"—")},className:"jsx-12522c6baa7fb659 px-2 py-2 whitespace-nowrap"}),(0,t.jsx)("td",{dangerouslySetInnerHTML:{__html:u(e.source?.model||"—")},className:"jsx-12522c6baa7fb659 px-2 py-2 whitespace-nowrap"}),(0,t.jsx)("td",{dangerouslySetInnerHTML:{__html:u(e.lens?.name||"—")},className:"jsx-12522c6baa7fb659 px-2 py-2 whitespace-nowrap"})]},e.submission_id))})]})})]})}}};var s=require("../../webpack-runtime.js");s.C(e);var a=e=>s(s.s=e),t=s.X(0,[7719,4825,5814,598,1661],()=>a(63856));module.exports=t})();