1import{u as Y,r as M,t as ae,j as e,v as ke}from"./vendor-react-zwv87yMD.js";import{u as je,a as se,b as ve}from"./vendor-query-DYq8g7OI.js";import{p as Ne}from"./payroll-CkTcIQY8.js";import{e as Ce}from"./employees-BPFguWOi.js";import{t as Me}from"./time-entries-EFguVi-E.js";import{u as re}from"./authStore-Bv6p2Ne2.js";import{c as z}from"./api-client-wl3SCNAO.js";import{c as we}from"./vendor-router-DimZLiZb.js";import"./vendor-charts-CtrTLS4K.js";import"./vendor-i18n-BdYkS11p.js";import"./vendor-ui-CfDMlrKu.js";import"./vendor-pdf-DQuePnfN.js";import"./vendor-state-ByI9XJey.js";import"./vendor-editor-C_dhmuey.js";import"./i18n-CwjSIy0a.js";import"./vendor-icons-bLSWzydc.js";const K=40;function ne(t){const o=t-Math.floor(t/2),c=Math.floor(t/2);return{week1Days:o,week2Days:c}}function oe(t,o){const c=o===7,d=c?6:o,x=Math.min(8,t),l=Math.min(4,Math.max(0,t-8)),y=Math.max(0,t-12),j=c?Math.min(8,t):0,p=c?Math.max(0,t-8):0,u=d*x,b=Math.min(K,u),h=Math.max(0,u-K),v=d*l+j+h,D=d*y+p;return{reg:b,ot15:v,ot2:D}}function le(t,o,c){const{week1Days:d,week2Days:x}=ne(o),l=oe(t,d),y=oe(t,x),j=l.reg+y.reg,p=l.ot15+y.ot15,u=l.ot2+y.ot2;return{wage:j*c+p*c*1.5+u*c*2,reg:j,ot15:p,ot2:u}}function Se(t,o,c){if(t<=0||o<=0||c<=0)return null;let d=0,x=24;for(let h=0;h<100;h++){const v=(d+x)/2,{wage:D}=le(v,o,c);if(D<t?d=v:x=v,Math.abs(x-d)<1e-4)break}const l=(d+x)/2,{reg:y,ot15:j,ot2:p}=le(l,o,c),u=y+j+p,b=y*c+j*c*1.5+p*c*2;return{hoursPerDay:Math.round(l*100)/100,regularHours:Math.round(y*100)/100,otHours15x:Math.round(j*100)/100,otHours2x:Math.round(p*100)/100,totalHours:Math.round(u*100)/100,calculatedWage:Math.round(b*100)/100}}function B(t){return t>10?60:t>5?30:0}function L(t){const o=Math.floor(t/60),c=Math.round(t%60),d=o>=12?"PM":"AM";return`${o>12?o-12:o===0?12:o}:${c.toString().padStart(2,"0")} ${d}`}function G(t){const o=Math.floor(t/60),c=Math.round(t%60);return`${o.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}`}function F(t){const[o,c]=t.split(":").map(Number);return o*60+(c||0)}function ce(t){const o={};let c=0;for(let d=1;d<t;d++){const x=(Math.random()*20-10)/60;o[d]=x,c+=x}return o[t]=-c,o}function ie(t,o,c,d){const x=t.hoursPerDay,l=[],{week1Days:y,week2Days:j}=ne(o);let p=0,u=0;for(let b=1;b<=14;b++){const h=b<=7?1:2,v=h===1?b:b-7,D=h===1?y:j,I=v>D;if(b===8&&(p=0),I){l.push({day:b,week:h,isSeventhDay:!1,isDayOff:!0,clockIn:"",clockOut:"",breakMinutes:0,workHours:0,regHours:0,ot15Hours:0,ot2Hours:0});continue}u++;const S=D===7&&v===7,N=x+(d[u]||0);let f,m;const k=S?Math.max(0,N-8):Math.max(0,N-12);if(S)f=0,m=Math.min(8,N);else{const T=Math.min(8,N);m=Math.min(4,Math.max(0,N-8)),p+T>K?(f=Math.max(0,K-p),m+=T-f):f=T}p+=f;const C=B(N),$=480,w=N*60,i=$+w+C;l.push({day:b,week:h,isSeventhDay:S,isDayOff:!1,clockIn:L($),clockOut:L(Math.round(i)),breakMinutes:C,workHours:Math.round(N*100)/100,regHours:Math.round(f*100)/100,ot15Hours:Math.round(m*100)/100,ot2Hours:Math.round(k*100)/100})}return l}function _e(){const{t}=Y("payroll"),o=we(),c=je(),d=re(a=>a.currentOrganizationId),x=re(a=>{var r;return(r=a.currentOrganization)==null?void 0:r.timezone})||"America/Los_Angeles",[l,y]=M.useState(""),[j,p]=M.useState("08:45"),[u,b]=M.use
1State("12:00"),[h,v]=M.useState([]),[D,I]=M.useState(0),[S,N]=M.useState(null),{data:f=[]}=se({queryKey:["payroll-periods",d],queryFn:()=>Ne.getPeriods(),enabled:!!d,staleTime:300*1e3}),{data:m=[]}=se({queryKey:["employees",d],queryFn:()=>Ce.getAll(),enabled:!!d,staleTime:300*1e3}),k=M.useMemo(()=>m.filter(a=>a.isActive&&a.payType==="HOURLY"&&a.hourlyRate).sort((a,r)=>`${a.lastName}, ${a.firstName}`.localeCompare(`${r.lastName}, ${r.firstName}`)),[m]),C=M.useMemo(()=>new Set(h.map(a=>a.employeeId)),[h]),$=f.find(a=>a.id===l),w=M.useMemo(()=>[...f].sort((a,r)=>r.startDate.localeCompare(a.startDate)),[f]),i=ve({mutationFn:a=>Me.bulkGenerate(a),onSuccess:(a,r)=>{const g=h.find(R=>R.employeeId===r.employeeId),O=(g==null?void 0:g.employeeName)||t("overtimeCalc.toast.defaultEmployee");ae.success(a.deleted>0?t("overtimeCalc.toast.createdWithReplaced",{created:a.created,name:O,deleted:a.deleted}):t("overtimeCalc.toast.created",{created:a.created,name:O})),c.invalidateQueries({queryKey:["time-entries"]}),c.invalidateQueries({queryKey:["payroll"]})},onError:a=>{var r,g;ae.error(((g=(r=a.response)==null?void 0:r.data)==null?void 0:g.message)||t("overtimeCalc.toast.generateFailed"))}}),T=()=>{v(a=>[...a,{id:crypto.randomUUID(),employeeId:"",employeeName:"",hourlyRate:0,totalWage:"",daysWorked:"",result:null,expanded:!1}])},s=a=>{v(r=>r.filter(g=>g.id!==a))},n=(a,r)=>{v(g=>g.map(O=>O.id===a?{...O,...r}:O))},H=(a,r)=>{const g=k.find(O=>O.id===r);g&&n(a,{employeeId:r,employeeName:`${g.lastName}, ${g.firstName}`,hourlyRate:Number(g.hourlyRate)||0})},W=()=>{v(a=>a.map(r=>{if(!r.employeeId||!r.totalWage||!r.daysWorked)return r;const g=Se(parseFloat(r.totalWage)||0,parseFloat(r.daysWorked)||0,r.hourlyRate);return{...r,result:g}})),I(a=>a+1)},q=a=>{const r=h.find(g=>g.id===a);!(r!=null&&r.result)||!$||N({rowId:r.id,employeeName:r.employeeName,startDate:$.startDate,endDate:$.endDate,entryCount:Math.round(parseFloat(r.daysWorked)||0)})},Q=a=>{const r=h.find(E=>E.id===a);if(!(r!=null&&r.result)||!$)return;const g=Math.round(parseFloat(r.daysWorked)||0),O=F(j),R=F(u),A=ce(g),xe=ie(r.result,g,null,A).filter(E=>!E.isDayOff).map(E=>{const ue=Math.round(Math.random()*10-5),he=Math.round(Math.random()*20-10),pe=Math.round(Math.random()*10),V=O+ue,J=B(E.workHours),X=J+pe,Z=V+E.workHours*60+X,ge=$.startDate.split("T")[0],_=new Date(ge+"T12:00:00Z");_.setUTCDate(_.getUTCDate()+E.day-1);const P=_.toISOString().split("T")[0],ye=U(P,V,x),be=Z>=1440?U(De(P),Z-1440,x):U(P,Z,x),ee=[];if(J>0){const te=R+he,fe=te+Math.max(0,X);ee.push({start:U(P,te,x),end:U(P,fe,x)})}return{clockIn:ye,clockOut:be,breaks:ee}});i.mutate({employeeId:r.employeeId,periodStartDate:$.startDate,periodEndDate:$.endDate,entries:xe}),N(null)},de="w-full px-2 py-1.5 border border-gray-300 dark:border-gray-600 rounded text-sm text-right focus:outline-none focus:ring-1 focus:ring-blue-400 bg-green-50 dark:bg-green-950/30 dark:text-gray-100",me="text-sm text-right font-mono tabular-nums";return e.jsxs("div",{className:"space-y-6",children:[e.jsx("div",{className:"flex flex-col sm:flex-row sm:justify-between sm:items-center gap-4",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("button",{onClick:()=>o("/dashboard/payroll"),className:"p-1.5 hover:bg-accent rounded-md",title:t("overtimeCalc.backToPayroll"),children:"â"}),e.jsx("h2",{className:"text-xl sm:text-2xl font-bold",children:t("overtimeCalc.title")})]})}),e.jsxs("div",{className:"p-3 bg-blue-50 dark:bg-blue-950/30 border border-blue-200 dark:border-blue-800 rounded text-xs text-blue-800 dark:text-blue-200 space-y-1",children:[e.jsx("p",{className:"font-semibold",children:t("overtimeCalc.rules.heading")}),e.jsx("p",{children:t("overtimeCalc.rules.daily")}),e.jsx("p",{children:t("overtimeCalc.rules.seventhDay")}),e.jsx("p",{children:t("overtimeCalc.rules.splitEvenly")}),e.jsx("p",{children:t("overtimeCalc.rules.maxRegular")})]}),e.jsxs("div",{className:"flex flex-col gap-3",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[e.jsx("label",{className:"text-sm font-medium w-32",children:t("overt
1imeCalc.payrollPeriod")}),e.jsxs("select",{value:l,onChange:a=>y(a.target.value),className:"px-3 py-1.5 border rounded text-sm min-w-[280px] dark:bg-gray-800 dark:border-gray-600",children:[e.jsx("option",{value:"",children:t("overtimeCalc.selectPeriod")}),w.map(a=>e.jsxs("option",{value:a.id,children:[z(a.startDate)," â ",z(a.endDate)," (",a.periodType,")"]},a.id))]})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[e.jsx("label",{className:"text-sm font-medium w-32",children:t("overtimeCalc.defaultStartTime")}),e.jsx("input",{type:"time",value:j,onChange:a=>p(a.target.value),className:"w-28 px-2 py-1.5 border rounded text-sm text-center dark:bg-gray-800 dark:border-gray-600"})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[e.jsx("label",{className:"text-sm font-medium w-32",children:t("overtimeCalc.defaultBreakStart")}),e.jsx("input",{type:"time",value:u,onChange:a=>b(a.target.value),className:"w-28 px-2 py-1.5 border rounded text-sm text-center dark:bg-gray-800 dark:border-gray-600"})]})]}),e.jsx("div",{className:"bg-white dark:bg-gray-900 rounded-lg shadow border dark:border-gray-700 overflow-x-auto",children:e.jsxs("table",{className:"w-full border-collapse",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"bg-gray-100 dark:bg-gray-800 border-b dark:border-gray-700",children:[e.jsx("th",{className:"px-3 py-2 text-left text-xs font-semibold text-gray-600 dark:text-gray-300 w-56",children:t("overtimeCalc.table.employee")}),e.jsx("th",{className:"px-3 py-2 text-right text-xs font-semibold text-gray-600 dark:text-gray-300 w-24",children:t("overtimeCalc.table.rate")}),e.jsx("th",{className:"px-3 py-2 text-right text-xs font-semibold text-gray-600 dark:text-gray-300 w-36",children:t("overtimeCalc.table.totalWage")}),e.jsx("th",{className:"px-3 py-2 text-right text-xs font-semibold text-gray-600 dark:text-gray-300 w-24",children:t("overtimeCalc.table.days")}),e.jsx("th",{className:"px-3 py-2 text-right text-xs font-semibold text-gray-600 dark:text-gray-300 w-20",children:t("overtimeCalc.table.hrsPerDay")}),e.jsx("th",{className:"px-3 py-2 text-right text-xs font-semibold text-gray-600 dark:text-gray-300 w-20",children:t("overtimeCalc.table.regular")}),e.jsx("th",{className:"px-3 py-2 text-right text-xs font-semibold text-gray-600 dark:text-gray-300 w-20",children:t("overtimeCalc.table.ot15x")}),e.jsx("th",{className:"px-3 py-2 text-right text-xs font-semibold text-gray-600 dark:text-gray-300 w-20",children:t("overtimeCalc.table.ot2x")}),e.jsx("th",{className:"px-3 py-2 text-right text-xs font-semibold text-gray-600 dark:text-gray-300 w-24",children:t("overtimeCalc.table.totalHrs")}),e.jsx("th",{className:"px-3 py-2 text-right text-xs font-semibold text-gray-600 dark:text-gray-300 w-28",children:t("overtimeCalc.table.calcWage")}),e.jsx("th",{className:"px-3 py-2 w-24"})]})}),e.jsxs("tbody",{children:[h.map(a=>{const r=a.result?Math.abs(a.result.calculatedWage-(parseFloat(a.totalWage)||0)):0,g=parseFloat(a.daysWorked)||0,O=F(j),R=F(u);return e.jsx($e,{row:a,wageDiff:r,daysWorked:g,defaultStartMin:O,defaultBreakStartMin:R,calcKey:D,hourlyEmployees:k,selectedEmployeeIds:C,inputClass:de,resultClass:me,selectedPeriod:$,isMutating:i.isPending,onSelectEmployee:A=>H(a.id,A),onUpdateRow:A=>n(a.id,A),onRemove:()=>s(a.id),onToggleExpand:()=>n(a.id,{expanded:!a.expanded}),onApply:()=>q(a.id)},a.id)}),h.length===0&&e.jsx("tr",{children:e.jsx("td",{colSpan:11,className:"px-3 py-8 text-center text-sm text-muted-foreground",children:t(l?"overtimeCalc.emptyAddEmployee":"overtimeCalc.emptySelectPeriod")})})]})]})}),e.jsxs("div",{className:"flex gap-3",children:[e.jsx("button",{onClick:W,disabled:h.length===0,className:"px-6 py-2 text-sm font-semibold bg-blue-600 text-white rounded hover:bg-blue-700 disabled:opacity-50",children:t("overtimeCalc.calculate")}),e.jsx("button",{onClick:T,disabled:!l,className:"px-4 py-2 text-sm border rounded hover:bg-accent disabled:opacity-50",children:t("overtimeCalc.addEmployee")})]}),e.jsxs("div",{className:"p-3 bg-yellow-50 dark:bg-yellow-950/30 border border-yellow-200 dark:border-yellow-800 rounded text-xs text-yellow-800 dark:text-yellow-200",children:[e.jsx("p",{className:"font-semibold",children:t("overt
1imeCalc.assumptions.heading")}),e.jsx("p",{children:t("overtimeCalc.assumptions.equalHours")}),e.jsx("p",{children:t("overtimeCalc.assumptions.splitEvenly")}),e.jsx("p",{children:t("overtimeCalc.assumptions.doubleTime")}),e.jsx("p",{children:t("overtimeCalc.assumptions.seventhDay")}),e.jsx("p",{children:t("overtimeCalc.assumptions.calcWageVerify")})]}),e.jsx("p",{className:"text-xs text-muted-foreground italic",children:t("overtimeCalc.disclaimer")}),S&&e.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50 p-4",children:e.jsxs("div",{className:"bg-white dark:bg-gray-800 rounded-lg shadow-xl max-w-md w-full p-6 space-y-4",children:[e.jsx("h3",{className:"text-lg font-semibold",children:t("overtimeCalc.confirm.title")}),e.jsx("p",{className:"text-sm text-muted-foreground",children:e.jsx(ke,{t,i18nKey:"overtimeCalc.confirm.message",values:{name:S.employeeName,startDate:z(S.startDate),endDate:z(S.endDate),count:S.entryCount},components:{b:e.jsx("strong",{})}})}),e.jsxs("div",{className:"flex justify-end gap-3",children:[e.jsx("button",{onClick:()=>N(null),className:"px-4 py-2 text-sm border rounded hover:bg-accent",children:t("overtimeCalc.confirm.cancel")}),e.jsx("button",{onClick:()=>Q(S.rowId),disabled:i.isPending,className:"px-4 py-2 text-sm font-semibold bg-blue-600 text-white rounded hover:bg-blue-700 disabled:opacity-50",children:i.isPending?t("overtimeCalc.confirm.generating"):t("overtimeCalc.confirm.generate")})]})]})})]})}function U(t,o,c){const[d,x,l]=t.split("-").map(Number),y=Math.floor(o/60),j=Math.round(o%60),p=new Date(Date.UTC(d,x-1,l,y,j,0)),u=p.toLocaleString("en-US",{timeZone:"UTC"}),b=p.toLocaleString("en-US",{timeZone:c}),h=new Date(u).getTime()-new Date(b).getTime();return new Date(p.getTime()+h).toISOString()}function De(t){const o=new Date(t+"T12:00:00Z");return o.setUTCDate(o.getUTCDate()+1),o.toISOString().split("T")[0]}function $e({row:t,wageDiff:o,daysWorked:c,defaultStartMin:d,defaultBreakStartMin:x,calcKey:l,hourlyEmployees:y,selectedEmployeeIds:j,inputClass:p,resultClass:u,selectedPeriod:b,isMutating:h,onSelectEmployee:v,onUpdateRow:D,onRemove:I,onToggleExpand:S,onApply:N}){const{t:f}=Y("payroll"),m=t.result;return e.jsxs(e.Fragment,{children:[e.jsxs("tr",{className:"border-b dark:border-gray-700 hover:bg-gray-50 dark:hover:bg-gray-800/50",children:[e.jsx("td",{className:"px-3 py-2",children:e.jsxs("div",{className:"flex items-center gap-1",children:[m&&e.jsx("button",{onClick:S,className:"text-gray-400 hover:text-gray-700 dark:hover:text-gray-200 text-xs w-4 flex-shrink-0",title:t.expanded?f("overtimeCalc.row.collapse"):f("overtimeCalc.row.expand"),children:t.expanded?"â¼":"â¶"}),e.jsxs("select",{value:t.employeeId,onChange:k=>v(k.target.value),className:"w-full px-2 py-1.5 border border-gray-300 dark:border-gray-600 rounded text-sm dark:bg-gray-800",children:[e.jsx("option",{value:"",children:f("overtimeCalc.row.selectEmployee")}),y.map(k=>e.jsx("option",{value:k.id,disabled:j.has(k.id)&&k.id!==t.employeeId,children:f("overtimeCalc.row.employeeOption",{last:k.lastName,first:k.firstName,rate:k.hourlyRate})},k.id))]})]})}),e.jsx("td",{className:"px-3 py-2 text-right text-sm font-mono",children:t.hourlyRate>0?`$${t.hourlyRate.toFixed(2)}`:"-"}),e.jsx("td",{className:"px-3 py-2",children:e.jsx("input",{type:"text",value:t.totalWage,onChange:k=>D({totalWage:k.target.value}),placeholder:"0.00",className:p})}),e.jsx("td",{className:"px-3 py-2",children:e.jsx("input",{type:"text",value:t.daysWorked,onChange:k=>D({daysWorked:k.target.value}),placeholder:"0",className:p})}),e.jsx("td",{className:"px-3 py-2 text-right",children:e.jsx("span",{className:`${u} text-gray-500 dark:text-gray-400`,children:m?m.hoursPerDay:"-"})}),e.jsx("td",{className:"px-3 py-2 text-right",children:e.jsx("span",{className:u,children:m?m.regularHours.toFixed(2):"-"})}),e.jsx("td",{className:"px-3 py-2 text-right",children:e.jsx("span",{className:`${u} ${m&&m.otHours15x>0?"text-orange-600 font-semibold":""}`,children:m?m.otHours15x.toFixed(2):"-"})}),e.jsx("td",{className:"px-3 py-2 text-right",children:e.jsx("span",{className:`${u} ${m&&m.otHours2x>0?"text-red-600 font-semibold":""}`,children:m?m.otHours2x.toFixed(2):"-"})}),e.jsx("td",{className:"px-3 py-2 text-right",children:e.jsx("span",{className:`${u} font-semibold`,children:m?m.totalHours.toFixed(2):"-"})}),e.jsx("td",{className:"px-3 py-2 text-right",children:e.jsx("span",{className:`${u} ${o>.01?"text-red-600":m?"text-green-600":""}`,title:o>.01?f("overtimeCalc.row.diff",{amount:o.toFixed(2)}
1):f("overtimeCalc.row.matches"),children:m?`$${m.calculatedWage.toFixed(2)}`:"-"})}),e.jsxs("td",{className:"px-3 py-2 flex items-center gap-1",children:[m&&b&&e.jsx("button",{onClick:N,disabled:h,className:"px-2 py-1 text-xs font-medium bg-green-600 text-white rounded hover:bg-green-700 disabled:opacity-50",title:f("overtimeCalc.row.applyTitle"),children:f("overtimeCalc.row.apply")}),e.jsx("button",{onClick:I,className:"text-gray-400 hover:text-red-500 text-sm px-1",title:f("overtimeCalc.row.removeRow"),children:"â"})]})]}),t.expanded&&m&&e.jsx("tr",{children:e.jsx("td",{colSpan:11,className:"p-0 bg-slate-50 dark:bg-slate-900/50 border-b dark:border-gray-700",children:e.jsx(He,{result:m,daysWorked:c,defaultStartMin:d,defaultBreakStartMin:x,hourlyRate:t.hourlyRate},l)})})]})}function He({result:t,daysWorked:o,defaultStartMin:c,defaultBreakStartMin:d,hourlyRate:x}){const{t:l}=Y("payroll"),y=Math.round(o),[j]=M.useState(()=>ce(y)),[p]=M.useState(()=>{const s={};for(let n=1;n<=y;n++)s[n]=Math.round(Math.random()*10-5);return s}),[u]=M.useState(()=>{const s={};for(let n=1;n<=y;n++)s[n]=Math.round(Math.random()*20-10);return s}),[b]=M.useState(()=>{const s={};for(let n=1;n<=y;n++)s[n]=Math.round(Math.random()*10);return s}),h=ie(t,o,null,j),v=h.filter(s=>!s.isDayOff),[D,I]=M.useState(()=>{const s={};for(const n of v)s[n.day]=c+(p[n.day]||0);return s}),[S,N]=M.useState(()=>{const s={};for(const n of v)s[n.day]=d+(u[n.day]||0);return s}),[f,m]=M.useState(()=>{const s={};for(const n of v){const H=d+(u[n.day]||0),W=B(n.workHours);s[n.day]=H+W+(b[n.day]||0)}return s}),k=h.map(s=>{if(s.isDayOff)return{...s,clockInMin:0,brkStartMin:0,brkEndMin:0,breakMinutes:0,clockIn:"",clockOut:""};const n=D[s.day]??c,H=S[s.day]??d,W=f[s.day]??H+B(s.workHours)+(b[s.day]||0),q=Math.max(0,W-H),Q=n+s.workHours*60+q;return{...s,clockInMin:n,brkStartMin:H,brkEndMin:W,breakMinutes:q,clockIn:L(n),clockOut:L(Math.round(Q))}}),C=k.reduce((s,n)=>({workHours:s.workHours+n.workHours,regHours:s.regHours+n.regHours,ot15Hours:s.ot15Hours+n.ot15Hours,ot2Hours:s.ot2Hours+n.ot2Hours,breakMinutes:s.breakMinutes+n.breakMinutes}),{workHours:0,regHours:0,ot15Hours:0,ot2Hours:0,breakMinutes:0}),$=C.regHours*x+C.ot15Hours*x*1.5+C.ot2Hours*x*2,w="px-3 py-1.5 text-xs font-semibold text-gray-600 dark:text-gray-300",i="px-3 py-1.5 text-xs font-mono tabular-nums",T="px-1 py-0.5 border border-gray-300 dark:border-gray-600 rounded text-xs text-center focus:outline-none focus:ring-1 focus:ring-blue-400 bg-green-50 dark:bg-green-950/30";return e.jsx("div",{className:"px-8 py-3",children:e.jsxs("table",{className:"w-full border-collapse border border-gray-200 dark:border-gray-700 rounded",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"bg-gray-200 dark:bg-gray-700",children:[e.jsx("th",{className:`${w} text-left w-16`,children:l("overtimeCalc.detail.day")}),e.jsx("th",{className:`${w} text-center w-12`,children:l("overtimeCalc.detail.wk")}),e.jsx("th",{className:`${w} text-center w-28`,children:l("overtimeCalc.detail.clockIn")}),e.jsx("th",{className:`${w} text-center w-24`,children:l("overtimeCalc.detail.clockOut")}),e.jsx("th",{className:`${w} text-center w-28`,children:l("overtimeCalc.detail.breakStart")}),e.jsx("th",{className:`${w} text-center w-28`,children:l("overtimeCalc.detail.breakEnd")}),e.jsx("th",{className:`${w} text-center w-16`,children:l("overtimeCalc.detail.break")}),e.jsx("th",{className:`${w} text-right w-20`,children:l("overtimeCalc.detail.workHrs")}),e.jsx("th",{className:`${w} text-right w-20`,children:l("overtimeCalc.detail.regular")}),e.jsx("th",{className:`${w} text-right w-20`,children:l("overtimeCalc.detail.ot15x")}),e.jsx("th",{className:`${w} text-right w-20`,children:l("overtimeCalc.detail.ot2x")})]})}),e.jsxs("tbody",{children:[k.map(s=>s.isDayOff?e.jsxs("tr",{className:"border-t border-gray-200 dark:border-gray-700 bg-gray-50 dark:bg-gray-800/50",children:[e.jsx("td",{className:`${i} text-left text-gray-400`,children:l("overtimeCalc.detail.dayNum",{day:s.day})}),e.jsx("td",{className:`${i} text-center text-gray-400`,children:s.week}),e.jsx("td",{colSpan:9,className:`${i} text-center text-gray-400 italic`,children:l("overtimeCalc.detail.dayOff")})]},s.day):e.jsxs("tr",{className:`border-t border-gray-200 dark:border-gray-700 ${s.isSeventhDay?"bg-amber-50 dark:bg-amber-950/30":"bg-white dark:bg-gray-900"}`,children:[e.jsxs("td",{className:`${i}
1 text-left`,children:[l("overtimeCalc.detail.dayNum",{day:s.day}),s.isSeventhDay&&e.jsx("span",{className:"ml-1 text-[10px] font-semibold text-amber-600 bg-amber-100 dark:bg-amber-900/50 px-1 rounded",children:l("overtimeCalc.detail.seventh")})]}),e.jsx("td",{className:`${i} text-center text-gray-400`,children:s.week}),e.jsx("td",{className:`${i} text-center`,children:e.jsx("input",{type:"time",value:G(s.clockInMin),onChange:n=>I(H=>({...H,[s.day]:F(n.target.value)})),className:`${T} w-24`})}),e.jsx("td",{className:`${i} text-center`,children:s.clockOut}),e.jsx("td",{className:`${i} text-center`,children:e.jsx("input",{type:"time",value:G(s.brkStartMin),onChange:n=>N(H=>({...H,[s.day]:F(n.target.value)})),className:`${T} w-24`})}),e.jsx("td",{className:`${i} text-center`,children:e.jsx("input",{type:"time",value:G(s.brkEndMin),onChange:n=>m(H=>({...H,[s.day]:F(n.target.value)})),className:`${T} w-24`})}),e.jsx("td",{className:`${i} text-center text-gray-500`,children:l("overtimeCalc.detail.minutes",{count:s.breakMinutes})}),e.jsx("td",{className:`${i} text-right`,children:s.workHours.toFixed(2)}),e.jsx("td",{className:`${i} text-right`,children:s.regHours>0?s.regHours.toFixed(2):"-"}),e.jsx("td",{className:`${i} text-right ${s.ot15Hours>0?"text-orange-600 font-semibold":""}`,children:s.ot15Hours>0?s.ot15Hours.toFixed(2):"-"}),e.jsx("td",{className:`${i} text-right ${s.ot2Hours>0?"text-red-600 font-semibold":""}`,children:s.ot2Hours>0?s.ot2Hours.toFixed(2):"-"})]},s.day)),e.jsxs("tr",{className:"border-t-2 border-gray-400 dark:border-gray-500 bg-gray-100 dark:bg-gray-800 font-semibold",children:[e.jsx("td",{className:`${i} text-left`,children:l("overtimeCalc.detail.total")}),e.jsx("td",{className:i}),e.jsx("td",{className:i}),e.jsx("td",{className:i}),e.jsx("td",{className:i}),e.jsx("td",{className:i}),e.jsx("td",{className:`${i} text-center text-gray-500`,children:Math.floor(C.breakMinutes/60)>0?l("overtimeCalc.detail.breakHoursMinutes",{hours:Math.floor(C.breakMinutes/60),minutes:C.breakMinutes%60}):l("overtimeCalc.detail.minutes",{count:C.breakMinutes})}),e.jsx("td",{className:`${i} text-right`,children:C.workHours.toFixed(2)}),e.jsx("td",{className:`${i} text-right`,children:C.regHours.toFixed(2)}),e.jsx("td",{className:`${i} text-right text-orange-600`,children:C.ot15Hours.toFixed(2)}),e.jsx("td",{className:`${i} text-right text-red-600`,children:C.ot2Hours.toFixed(2)})]}),e.jsxs("tr",{className:"bg-gray-100 dark:bg-gray-800",children:[e.jsx("td",{colSpan:7,className:`${i} text-right font-semibold`,children:l("overtimeCalc.detail.calculatedWage")}),e.jsxs("td",{colSpan:4,className:`${i} text-left font-semibold text-green-700 dark:text-green-400 pl-4`,children:["$",$.toFixed(2)]})]})]})]})})}export{_e 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.