PageSourceSearch

https://fpc-command-center.vercel.app/assets/PizzaTracker-D1XmvdfQ.js

js fpc-command-center.vercel.app collected 2026-10-03 06:58:42 UTC 13,974 bytes, 1 lines download raw bytes

1import{g as P,r as i,j as e}from"./vendor-react-BjK7BgZ1.js";import{u as S,r as g}from"./index-DW7YeZ4h.js";import{B as d}from"./Box-D6YUCR2s.js";import{i as T,a as I,g as H}from"./orderHelpers-Do6tpnVc.js";import{g as z}from"./labels-CdAwnqXa.js";import{c as A,E as C}from"./eventLog-CypBO-8Z.js";import"./vendor-supabase-B2C_po0q.js";(function(){try{var r=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};r.SENTRY_RELEASE={id:"3806f6685009088ca536a6f1492e1499d1ed6e58"};var n=new r.Error().stack;n&&(r._sentryDebugIds=r._sentryDebugIds||{},r._sentryDebugIds[n]="34da49bc-30d0-4b40-85d7-f8f3f02fd571",r._sentryDebugIdIdentifier="sentry-dbid-34da49bc-30d0-4b40-85d7-f8f3f02fd571")}catch{}})();const $={mockup_ready:0,mockup_progress:1,mockup_approved:1,prod_prep:2,prod_ready:2,machine_1:3,machine_2:3,machine_3:3,machine_4:3,chameleon:3,green_machine:3,emb_out:3,emb_house:3,dtg:3,finishing:4,qc:5,ready:6,archived:7},M=[{label:"Order Received"},{label:"Art & Films"},{label:"Pre-Production"},{label:"In Production"},{label:"Finishing"},{label:"QC & Counts"},{label:"Ready for Customer"},{label:"Complete"}];function R(r){const n=g(r);return $[n]??0}function V(r){const n=r.checklist||[],o=n.length,c=n.filter(s=>s.done).length;return{done:c,total:o,pct:o>0?Math.round(c/o*100):0}}function B({type:r}){const n=C[r]||{icon:"dot",color:"#9CA3AF"},o=n.color,c={plus:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 4v16m8-8H4"}),arrow:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13 7l5 5m0 0l-5 5m5-5H6"}),dollar:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 8c-1.657 0-3 .895-3 2s1.343 2 3 2 3 .895 3 2-1.343 2-3 2m0-8c1.11 0 2.08.402 2.599 1M12 8V7m0 1v8m0 0v1m0-1c-1.11 0-2.08-.402-2.599-1M21 12a9 9 0 11-18 0 9 9 0 0118 0z"}),doc:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"}),edit:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"}),mail:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"}),check:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"}),truck:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13 16V6a1 1 0 00-1-1H4a1 1 0 00-1 1v10a1 1 0 001 1h1m8-1a1 1 0 01-1 1H9m4-1V8a1 1 0 011-1h2.586a1 1 0 01.707.293l3.414 3.414a1 1 0 01.293.707V16a1 1 0 01-1 1h-1m-6-1a1 1 0 001 1h1M5 17a2 2 0 104 0m-4 0a2 2 0 114 0m6 0a2 2 0 104 0m-4 0a2 2 0 114 0"}),press:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.428 15.428a2 2 0 00-1.022-.547l-2.387-.477a6 6 0 00-3.86.517l-.318.158a6 6 0 01-3.86.517L6.05 15.21a2 2 0 00-1.806.547M8 4h8l-1 1v5.172a2 2 0 00.586 1.414l5 5c1.26 1.26.367 3.414-1.415 3.414H4.828c-1.782 0-2.674-2.154-1.414-3.414l5-5A2 2 0 009 10.172V5L8 4z"}),refund:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 10h10a8 8 0 018 8v2M3 10l6 6m-6-6l6-6"}),package:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M20 7l-8-4-8 4m16 0l-8 4m8-4v10l-8 4m0-10L4 7m8 4v10M4 7v10l8 4"}),note:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M7 8h10M7 12h4m1 8l-4-4H5a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v8a2 2 0 01-2 2h-3l-4 4z"}),dot:e.jsx("circle",{cx:"12",cy:"12",r:"4",fill:o,stroke:"none"})};return e.jsx("div",{className:"w-8 h-8 rounded-full flex items-center justify-center flex-shrink-0",style:{backgroundColor:o+"20"},children:e.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:o,strokeWidth:2,children:c[n.icon]||c.dot})})}function F(r){if(!r)return"";const n=new Date(r),o=new Date,c=o-n,s=Math.floor(c/6e4),x=Math.floor(c/36e5),u=Math.floor(c/864e5);return s<1?"Just now":s<60?`${s}m ago`:x<24?`${x}h ago`:u<7?`${u}d ago`:n.toLocaleDateString("en-US",{month:"short",day:"numeric",year:n.getFullYear()!==o.getFullYear()?"numeric":void 0})+" "+n.toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit"})}function G(){var _;const{orders:r}=S(),[n]=P(),[o,c]=i.useState(""),[s,x]=i.useState(null),[u,p]=i.useState(""),[y,v]=i.useState([]),[D,N]=i.useState(!1),k=i.useRef(!1);i.useEffect(()=>{const t=(n.get("code")||"").trim();if(!t||k.current||(c(t),!r.length))return;k.current=!0;const a=r.find(l=>{var m;return((m=l.id)==null?void 0:m.toLowerCase())===t.toLowerCase()});a?(p(""),x(a)):p("Order not found. Please check your Job ID and try again.")},[r,n]);function L(){if(p(""),x(null),v([]),!o.trim()){p("Please enter a Job ID");return}const t=r.find(a=>{var l;return((l=a.id)==null?void 0:l.toLowerCase())===o.trim().toLowerCase()});if(!t){p("Order not found. Please check your Job ID and try again.");return}x(t)}i.useEffect(()=>{if(!s)return;let t=!1;return N(!0),A(s.id,{customerOnly:!0,limit:50}).then(a=>{t||v(a)}).finally(()=>{t||N(!1)}),()=>{t=!0}},[s]);const j=s?R(s.stage):-1,h=s?T(s):!1,b=s?I(s):[],f=s&&h?H(s):null,w=((s==null?void 0:s.labels)||[]).map(t=>z(t)).filter(t=>t&&["Status","Garments"].includes(t.category));
1return e.jsxs("div",{className:"max-w-3xl mx-auto space-y-8",children:[e.jsxs("div",{className:"text-center",children:[e.jsx("h1",{className:"text-3xl font-bold text-text-primary mb-2",children:"Track Your Order"}),e.jsx("p",{className:"text-text-secondary",children:"Enter your Job ID to see real-time production status"})]}),e.jsxs(d,{className:"!p-6",children:[e.jsxs("div",{className:"flex gap-3",children:[e.jsx("input",{type:"text",value:o,onChange:t=>c(t.target.value),onKeyDown:t=>t.key==="Enter"&&L(),placeholder:"Enter Job ID (e.g., FPC-20260204-AX7K)",className:"flex-1 bg-surface2 border border-border rounded-lg px-4 py-3 text-text-primary placeholder:text-text-muted focus:outline-none focus:border-brand/50 font-mono"}),e.jsx("button",{onClick:L,className:"px-6 py-3 bg-brand text-white rounded-lg font-semibold hover:bg-brand-dark transition-colors",children:"Track"})]}),u&&e.jsx("p",{className:"text-error text-sm mt-2",children:u}),!1]}),s&&e.jsxs("div",{className:"space-y-6",children:[e.jsxs(d,{children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-xl font-bold text-text-primary",children:s.project_name}),e.jsx("p",{className:"text-text-secondary",children:s.customer_company||s.customer_name})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[s.is_rush&&e.jsx("span",{className:"px-3 py-1 bg-error/20 text-error rounded-full text-sm font-bold animate-pulse",children:"RUSH"}),h&&e.jsxs("span",{className:"px-3 py-1 bg-purple/20 text-purple rounded-full text-sm font-bold",children:[b.length," Designs"]})]})]}),e.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4 text-sm",children:[e.jsxs("div",{children:[e.jsx("span",{className:"text-text-muted",children:"Job ID"}),e.jsx("p",{className:"text-text-primary font-mono",children:s.id})]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-text-muted",children:"Method"}),e.jsx("p",{className:"text-text-primary",children:h?b.map(t=>t.print_method).filter(Boolean).join(", "):s.print_method})]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-text-muted",children:"Quantity"}),e.jsxs("p",{className:"text-text-primary font-mono",children:[s.quantity," pcs"]})]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-text-muted",children:"Due Date"}),e.jsx("p",{className:"text-text-primary font-mono",children:s.due_date||"-"})]})]}),w.length>0&&e.jsx("div",{className:"flex flex-wrap gap-1.5 mt-4 pt-3 border-t border-border",children:w.map(t=>e.jsx("span",{className:"px-2.5 py-1 rounded-full text-xs font-semibold",style:{backgroundColor:t.color+"20",color:t.color},children:t.text},t.id))})]}),h&&e.jsxs(d,{children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsx("h3",{className:"text-lg font-semibold text-text-primary",children:"Design Progress"}),e.jsxs("span",{className:"text-sm text-text-secondary",children:[f.done,"/",f.total," steps complete"]})]}),e.jsx("div",{className:"w-full h-3 bg-surface3 rounded-full mb-5 overflow-hidden",children:e.jsx("div",{className:"h-full bg-success rounded-full transition-all duration-500",style:{width:`${f.total>0?f.done/f.total*100:0}%`}})}),e.jsx("div",{className:"space-y-3",children:b.map((t,a)=>{const l=V(t);return e.jsxs("div",{className:"bg-surface2 rounded-lg p-4",children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("span",{className:"text-xs font-bold text-text-muted bg-surface3 px-2 py-0.5 rounded",children:["#",a+1]}),e.jsxs("span",{className:"text-sm font-medium text-text-primary",children:[t.garment_type||"Design"," — ",t.print_method||"TBD"]})]}),e.jsxs("span",{className:`text-xs font-mono font-bold ${l.pct===100?"text-success":"text-text-secondary"}`,children:[l.pct,"%"]})]}),e.jsxs("div",{className:"flex items-center gap-4 text-xs text-text-muted mb-2",children:[t.blank_brand&&e.jsx("span",{children:t.blank_brand}),t.garment_color&&e.jsx("span",{children:t.garment_color}),t.quantity&&e.jsxs("span",{children:[t.quantity," pcs"]})]}
1),e.jsx("div",{className:"w-full h-2 bg-surface3 rounded-full overflow-hidden",children:e.jsx("div",{className:`h-full rounded-full transition-all duration-500 ${l.pct===100?"bg-success":"bg-brand"}`,style:{width:`${l.pct}%`}})}),l.pct===100&&e.jsxs("p",{className:"text-success text-xs mt-1.5 font-medium flex items-center gap-1",children:[e.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:3,children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})}),"Complete"]})]},t.id||a)})})]}),e.jsxs(d,{children:[e.jsx("h3",{className:"text-lg font-semibold text-text-primary mb-6",children:h?"Overall Stage":"Production Progress"}),e.jsx("div",{className:"relative",children:M.map((t,a)=>{const l=a<j,m=a===j,E=a>j;return e.jsxs("div",{className:"flex items-start gap-4 relative",children:[a<M.length-1&&e.jsx("div",{className:`absolute left-[19px] top-10 w-0.5 h-12 ${l?"bg-success":"bg-surface3"}`}),e.jsx("div",{className:`w-10 h-10 rounded-full flex items-center justify-center flex-shrink-0 z-10 ${l?"bg-success text-white":m?"bg-brand text-white ring-4 ring-brand/30 animate-pulse":"bg-surface3 text-text-muted"}`,children:l?e.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:3,children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})}):e.jsx("span",{className:"text-sm font-bold",children:a+1})}),e.jsxs("div",{className:`pb-10 ${E?"opacity-40":""}`,children:[e.jsxs("p",{className:`font-medium ${m?"text-brand text-lg":"text-text-primary"}`,children:[t.label,m&&e.jsx("span",{className:"text-brand text-sm ml-2",children:"In Progress"})]}),l&&e.jsx("p",{className:"text-success text-xs mt-0.5",children:"Completed"})]})]},a)})})]}),e.jsxs(d,{children:[e.jsx("h3",{className:"text-lg font-semibold text-text-primary mb-4",children:"Activity Timeline"}),D?e.jsxs("div",{className:"text-center py-6",children:[e.jsx("div",{className:"inline-block w-5 h-5 border-2 border-brand/30 border-t-brand rounded-full animate-spin"}),e.jsx("p",{className:"text-text-muted text-sm mt-2",children:"Loading activity..."})]}):y.length>0?e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"absolute left-[15px] top-4 bottom-4 w-0.5 bg-surface3"}),e.jsx("div",{className:"space-y-0",children:y.map((t,a)=>(C[t.event_type]||t.event_type,e.jsxs("div",{className:"flex items-start gap-3 relative py-3",children:[e.jsx("div",{className:"z-10",children:e.jsx(B,{type:t.event_type})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("p",{className:"text-sm font-medium text-text-primary",children:t.title}),e.jsx("span",{className:"text-[10px] text-text-muted flex-shrink-0 font-mono",children:F(t.created_at)})]}),t.description&&e.jsx("p",{className:"text-xs text-text-secondary mt-0.5",children:t.description}),t.actor&&e.jsxs("span",{className:"text-[10px] text-text-muted mt-0.5 inline-block",children:["by ",t.actor]})]})]},t.id||a)))})]}):e.jsxs("div",{className:"text-center py-6",children:[e.jsx("p",{className:"text-text-muted text-sm",children:"No activity recorded yet"}),e.jsx("p",{className:"text-text-muted text-xs mt-1",children:"Events will appear here as your order progresses"})]})]}),((_=s.pantone_colors)==null?void 0:_.length)>0&&e.jsxs(d,{children:[e.jsx("h3",{className:"text-lg font-semibold text-text-primary mb-4",children:"Ink Colors"}),e.jsx("div",{className:"flex flex-wrap gap-3",children:s.pantone_colors.map((t,a)=>e.jsxs("div",{className:"flex items-center gap-2 bg-surface2 rounded-lg px-3 py-2",children:[e.jsx("div",{className:"w-6 h-6 rounded-full border border-border",style:{backgroundColor:t.hex}}),e.jsx("span",{className:"text-text-primary text-sm font-mono",children:t.pm
1s})]},a))})]}),e.jsxs(d,{className:"text-center !py-8",children:[e.jsx("p",{className:"text-text-muted text-sm",children:"Estimated Completion"}),e.jsx("p",{className:"text-3xl font-bold text-brand font-mono mt-1",children:s.due_date||"TBD"}),g(s.stage)==="archived"&&e.jsx("p",{className:"text-success text-lg font-semibold mt-2",children:"Your order has been delivered!"}),g(s.stage)==="ready"&&e.jsx("p",{className:"text-purple text-lg font-semibold mt-2",children:"Your order is ready for pickup!"})]})]}),e.jsx("p",{className:"text-center text-text-muted text-xs",children:"Powered by French Press Custom — Premium Custom Apparel Printing"})]})}export{G as default};

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.