import{j as a}from"./tanstack-1.0.74-aU0azVkW.js";import{r as N}from"./redux-1.0.74-D8bIc6ki.js";import{P as h}from"./react-number-format.es-1.0.74-V5uzMUOI.js";import{l as j,d5 as y}from"./lib-1.0.74-B5IEqfHg.js";import{T as C}from"./TextField-1.0.74-BW9Byijb.js";import"./vendor-1.0.74-CN03Eozo.js";import"./utils-1.0.74-7xWhx9mc.js";import"./CircularProgress-1.0.74-QfwfRJ7i.js";import"./ButtonBase-1.0.74-W6tAH7AI.js";import"./Typography-1.0.74-B4mhsevh.js";import"./useEnhancedEffect-1.0.74-B56M26dS.js";import"./Select-1.0.74-DHOnlEEH.js";import"./Menu-1.0.74-CdjCBJ4R.js";import"./ThemeProvider-1.0.74-4uzbYYLM.js";import"./index-1.0.74-DxwH6OqZ.js";import"./Portal-1.0.74-BrUPeMX9.js";import"./iconBase-1.0.74-Cs0vntJu.js";import"./isHostComponent-1.0.74-DVu5iVWx.js";import"./Modal-1.0.74-BfLid1bk.js";import"./createSvgIcon-1.0.74-Cw_ZFbxi.js";const H=({value:s,columnState:o,columnMetaData:t,setValue:p,saveChanges:u,cancel:d,setButtons:m,rowIndex:x,updateInlineEditingErrors:i})=>{j.debug(s,o,t);const[c,n]=N.useState(!1),f=r=>{let e=r.substring(3,4),g=r.substring(6,7);const l=x+"_"+o.columnName;return Number(e)>5||Number(g)>5?(n(!0),i&&i(l,!0),!0):(n(!1),i&&i(l,!1),!1)},b=()=>{const r=y(o);return r["& .MuiInputBase-root.Mui-focused.Mui-error fieldset"]={borderWidth:"2px !important"},r};return a.jsx("div",{onClick:r=>{r.stopPropagation()},onKeyDown:r=>{r.stopPropagation()},children:a.jsx(h,{error:c,customInput:C,className:"pp-inline-editing",value:s??"",required:t.is_nullable==="NO",variant:"outlined",prefix:(o==null?void 0:o.prefix)??"",format:"##:##:##",placeholder:"00:00:00",onChange:r=>{const e=r.target.value;e===""&&t.is_nullable!=="NO"?p(null):p(e),f(e)},onKeyDown:r=>{r.key==="Enter"?f(s)||u():r.key==="Escape"&&d()},onFocus:()=>{m(!0)},onBlur:()=>{setTimeout(()=>{m(!1)},200)},sx:b()})})};export{H as default};
