1import{r,j as e}from"./react-N5bognFO.js";import{conditionalRowStyles as Y}from"./Helper-BVmzfNs1.js";import{t as o}from"./i18next-Dmc1Co8r.js";import{D as F}from"./DTable-DAcfBvAp.js";import{a as S}from"./renders-CtrLRdiN.js";import{h as v}from"./moment-B57VrxvV.js";import{F as u,I as B,B as K}from"./@fortawesome-Dv42y507.js";import{a as x}from"./axios-DYqNNW1S.js";import{NonPharmacologicalInterventionForm as M}from"./NonPharmacologicalInterventionForm-BIkM9MF_.js";import{T as g}from"./Helper-DdNlOU90.js";import{s as y}from"./helper-D2KaCjcv.js";import{F as O}from"./formik-BSPS76BD.js";import{I as T}from"./ISelect-DcsV23N_.js";import{O as s,d as p,c as k,a as j,C as R}from"./react-bootstrap-CK0flouF.js";import"./@videosdk.live-CGG26D4q.js";import"./@inertiajs-BkZulGWG.js";import"./deepmerge-C__pMiLS.js";import"./qs-IKpDohdi.js";import"./side-channel-DS4IS2NE.js";import"./es-errors-Bq3kx8t5.js";import"./object-inspect-DsT9_Yss.js";import"./side-channel-list-BfB21v3I.js";import"./side-channel-map-DasAej3K.js";import"./get-intrinsic-BpV-rLkm.js";import"./es-object-atoms-Ditt1eQ6.js";import"./math-intrinsics-4HEAT-lQ.js";import"./gopd-BB3Yz26k.js";import"./es-define-property-DY86Sk4U.js";import"./has-symbols-BN-BZRWm.js";import"./get-proto-Dl8zopyA.js";import"./dunder-proto-CExG5iS1.js";import"./call-bind-apply-helpers-DGeF_N6a.js";import"./function-bind-C9JQWjWq.js";import"./hasown-DfA0NTgp.js";import"./call-bound-D1AK9WmM.js";import"./side-channel-weakmap-Cs4DdwWI.js";import"./nprogress-CndzVgdc.js";import"./lodash.isequal-CspkLUDy.js";import"./react-data-table-component-BANXksHa.js";import"./styled-components-sKfkWijd.js";import"./react-is-DXLGNN0x.js";import"./@emotion-BIxtsS93.js";import"./hoist-non-react-statics-CQA6uf16.js";import"./stylis-BqQD4Fog.js";import"./Op-BaSs1rOr.js";import"./IModal-B859F4tV.js";import"./prop-types-ZjjlMboM.js";import"./yup-DRRYScPt.js";import"./property-expr-BV1yZDeA.js";import"./tiny-case-E-DAKCev.js";import"./toposort-HjwoVbjr.js";import"./ErrorForm-DbAjDrgH.js";import"./dateUtils-BcAiqoNw.js";import"./sweetalert2-BnHSdpMn.js";import"./react-toastify-c0VnifhY.js";import"./clsx-B-dksMZM.js";import"./lodash-es-DFFpHncn.js";import"./react-fast-compare-CbKM19l7.js";import"./react-select-CM-WlXIW.js";import"./@babel-NXIIEcrj.js";import"./react-dom-CH9nbi6W.js";import"./scheduler-Bz4_TSc2.js";import"./@floating-ui-CXe-XCQ5.js";import"./use-isomorphic-layout-effect-pPujTnnz.js";import"./classnames-_J_z_fGK.js";import"./dom-helpers-DCLM4_Fb.js";import"./react-transition-group-fuNbCc6Z.js";import"./@restart-Cynm00H8.js";import"./dequal-DYxRT05P.js";import"./@popperjs-7NgKaXqz.js";import"./warning-B8Fosm4B.js";import"./uncontrollable-LJ2uzohz.js";import"./@react-aria-CsmGj2tY.js";const w=[{sortable:!0,grow:1,omit:!0,dataIndex:"id"},{labelKey:"start_intervention_date",sortable:!0,grow:1,omit:!1,dataIndex:"start_intervention_date"},{labelKey:"end_intervention_date",sortable:!0,grow:2,omit:!1,dataIndex:"end_intervention_date"},{labelKey:"intervention_type_identifier",sortable:!0,grow:2,omit:!1,dataIndex:"intervention_type_identifier"},{labelKey:"notes",sortable:!1,grow:2,allowOverFlow:!0,omit:!1,dataIndex:"notes"},{labelKey:"OP",sortable:!1,grow:1,allowOverFlow:!0,dataIndex:"op"}],ie=({patientId:a,filters:d,readonly:m,url:c="/patients"})=>{const[b,_]=r.useState(),[I,D]=r.useState([]),i=r.useRef();r.useEffect(()=>{(async()=>{try{const t=await x.get("/nonPharmacologicalInterventionTypes");D(t.data),g.close()}catch{}})()},[]);const h={trashed:!1,intervention_type:"",sort:"start_intervention_date",sortDirection:"desc"},P=d?{...h,...d}:h,C=r.useMemo(()=>S(w,{op:t=>e.jsx(e.Fragment,{children:e.jsxs(k,{"aria-label":"Basic example",children:[e.jsx(s,{placement:"top",overlay:e.jsx(p,{id:"tooltip",children:o("edit")}),children:e.jsx(j,{variant:"outline-primary",size:"sm",onClick:()=>{_(t.id),i.current.openDialog(!0,t)},children:e.jsx(u,{icon:B})})},"edit"+t.id),!m&&e.jsx(s,{placement:"top",overlay:e.jsx(p,{id:"tooltip",children:o("delete")}),children:e.jsx(j,{variant:"outline-danger",size:"sm",onClick:()=>{g.fire({title:o("confirm_delete"),text:o("item_no_longer_available"),icon:"warning",showCancelButton:!0,confirmButtonText:o("yes_confirm"),cancelButtonText:o("no_cancel")}).then(n=>
1{n.isConfirmed&&x.delete(route("nonPharmacologicalIntervention.delete",{patient:a,nonPharmacologicalIntervention:t.id})).then(()=>{i.current.refresh(),y("success",o("element_correctly_deleted"))}).catch(l=>{var f;y("error",((f=l.response)==null?void 0:f.status)==403?o("unauthorized"):o("ops_something_wrong"))})})},children:e.jsx(u,{icon:K})})},"delete"+t.id)]})}),start_intervention_date:t=>v(t.start_intervention_date).format("DD/MM/YYYY"),end_intervention_date:t=>t.end_intervention_date?v(t.end_intervention_date).format("DD/MM/YYYY"):"",notes:t=>{var n;if(((n=t.notes)==null?void 0:n.length)>=30){const l=t.notes.substring(0,30);return e.jsx(s,{placement:"bottom",overlay:e.jsx(p,{id:`tooltip-${t.id}`,children:t.notes}),children:e.jsx("span",{children:l+"..."})},t.id)}return t.notes},intervention_type_identifier:t=>o(t.intervention_type_identifier)},t=>t),[w]);return e.jsx("div",{children:e.jsx(F,{newItem:!m,SearchFilters:()=>e.jsx(e.Fragment,{children:e.jsx(R,{md:4,children:e.jsx(O,{label:o("intervention_type_identifier"),name:"intervention_type",component:T,isSearchable:!1,placeholder:o("select_intervention_type"),options:I.map(t=>({value:t.identifier,label:o(t.identifier)}))})})}),searchBtn:!1,withOp:!1,onRowDoubleClick:!1,withAxios:!0,handleClose:()=>{_(null)},ref:i,modalTitle:o("nonPharmacologicalInterventionSingle"),renderModal:e.jsx(M,{url:c,handleClose:()=>{i.current.openDialog(!1,{}),i.current.refresh()},nonPharmacologicalInterventionId:b,patientId:a,readonly:m}),columns:C,defaultFilters:P,route:c+"/"+a+"/nonPharmacologicalInterventions",conditionalRowStyles:Y})})};export{ie as NonPharmacologicalIntervention};
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.