@trii/components 2.0.74 → 2.0.75

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cjs/index.js CHANGED
@@ -17,5 +17,5 @@ React keys must be passed directly to JSX without using spread:
17
17
  display: 'flex',
18
18
  flexDirection: 'column',
19
19
  gap: 1,
20
- `,gd=s.styled(s.Box)(()=>({display:"flex",justifyContent:"space-between",alignItems:"baseline",userSelect:"none"})),md=({notificationsField:e,disabled:a})=>{const n=Me(),{addNotification:r,deleteNotification:i,handleReminderChange:o,handleTimeFieldChange:d,handleTimePeriodChange:c}=e.action,u=e.notifications.length>0;return t.jsxs(fd,{children:[t.jsxs(gd,{children:[t.jsx(s.Typography,{variant:"subtitle2",sx:{userSelect:"none"},children:n("calendarView.reminders.title")}),!a&&t.jsx(s.Button,{disabled:a,startIcon:t.jsx(Ha,{}),size:"small",variant:"outlined",onClick:r,color:"secondary",children:n("calendarView.reminders.addReminder")})]}),t.jsx(s.Box,{sx:{pt:1,px:.5},children:u?e.notifications.map(g=>t.jsx(pd,{data:g,deleteHandler:i,sendToContactHandler:o,timePeriodHandler:c,timeValueHandler:d},g.id)):a?t.jsx(s.Typography,{variant:"body1",sx:{py:.5},children:"-"}):null})]})},zn=({descriptionField:e,disabled:a})=>{const n=Me(),{value:r,type:i,...o}=e.attributes,d=r||"";return a?t.jsx(ze,{title:n("global.description"),children:t.jsx(s.Typography,{variant:"body2",sx:{py:.5,whiteSpace:"pre-wrap",color:c=>c.palette.text.secondary,fontSize:"0.9rem"},children:d||"-"})}):t.jsx(ze,{title:n("global.description"),children:t.jsx(s.TextField,{...o,value:d,disabled:a,size:"small",multiline:!0,maxRows:5,fullWidth:!0,variant:"outlined"})})},hd=({onPlaceSelected:e})=>{const a=l.useRef(null),n=l.useRef(null),r=l.useRef(null),i=l.useRef(null),[o,d]=l.useState([]),[c,u]=l.useState(!1),g=Me();l.useEffect(()=>{if(!a.current)return;const m=()=>{if(!window.google?.maps?.places)return console.warn("Google Places API no est\xE1 disponible a\xFAn"),!1;n.current=new window.google.maps.places.AutocompleteService;const p=document.createElement("div");return r.current=new window.google.maps.places.PlacesService(p),i.current=new window.google.maps.places.AutocompleteSessionToken,!0};if(!m()){const p=setTimeout(()=>{m()},500);return()=>clearTimeout(p)}},[]);const b=m=>{const p=m.target.value;if(!p||p.length<3||!n.current){d([]),u(!1);return}n.current.getPlacePredictions({input:p,types:["geocode"],sessionToken:i.current||void 0},(x,S)=>{S===window.google.maps.places.PlacesServiceStatus.OK&&x?(d(x),u(!0)):(d([]),u(!1))})},h=(m,p)=>{r.current&&r.current.getDetails({placeId:m,fields:["geometry","formatted_address"],sessionToken:i.current||void 0},(x,S)=>{if(S===window.google.maps.places.PlacesServiceStatus.OK&&x?.geometry?.location){const v=x.geometry.location.lat(),T=x.geometry.location.lng(),C=x.formatted_address??p;e({lat:v,lng:T},C),a.current&&(a.current.value=C),u(!1),d([]),i.current=new window.google.maps.places.AutocompleteSessionToken}})};return l.useEffect(()=>{const m=p=>{a.current&&!a.current.contains(p.target)&&u(!1)};return document.addEventListener("mousedown",m),()=>document.removeEventListener("mousedown",m)},[]),t.jsxs("div",{style:{position:"absolute",width:"100%",maxWidth:300,margin:"0 auto",zIndex:13e3,top:"10px",left:"10px"},children:[t.jsx("input",{ref:a,placeholder:g("global.searchLocation","Buscar en Google Maps"),onChange:b,onFocus:()=>o.length>0&&u(!0),style:{width:"100%",padding:"12px 16px 5px",borderRadius:"24px",border:"1px solid #ccc",backgroundColor:"white",fontSize:"15px",boxShadow:"0 1px 4px rgba(0,0,0,0.3)",outline:"none",position:"relative",zIndex:13e3}}),c&&o.length>0&&t.jsx("div",{style:{position:"absolute",top:"100%",left:0,right:0,backgroundColor:"white",borderRadius:"8px",boxShadow:"0 2px 8px rgba(0,0,0,0.15)",marginTop:"4px",maxHeight:"300px",overflowY:"auto",zIndex:13001},children:o.map(m=>t.jsxs("div",{onClick:()=>h(m.place_id,m.description),style:{padding:"12px 16px",cursor:"pointer",borderBottom:"1px solid #f0f0f0",fontSize:"14px",transition:"background-color 0.2s"},onMouseEnter:p=>{p.currentTarget.style.backgroundColor="#f5f5f5"},onMouseLeave:p=>{p.currentTarget.style.backgroundColor="white"},children:[t.jsx("div",{style:{fontWeight:500},children:m.structured_formatting.main_text}),t.jsx("div",{style:{fontSize:"12px",color:"#666",marginTop:"2px"},children:m.structured_formatting.secondary_text})]},m.place_id))})]})},Wn="AIzaSyAQ1bUt3y6UoAhbi5-HAwYwaFx71pAiaKU",_n=["places"],Na={apiKey:Wn,libraries:_n,loading:"async"},ia=()=>!!(window.google?.maps?.Map&&window.google?.maps?.Marker&&window.google?.maps?.Geocoder&&window.google?.maps?.places),Vn=(e=Wn,a=_n)=>{if(ia())return Promise.resolve();const n=()=>{document.querySelectorAll('script[src*="maps.googleapis.com"]').forEach(r=>{r.parentNode?.removeChild(r)})};return document.getElementById("google-maps-script")?new Promise((r,i)=>{let o=0;const d=100,c=setInterval(()=>{o++,ia()?(clearInterval(c),r()):o>=d&&(clearInterval(c),n(),Vn(e,a).then(r).catch(i))},100)}):new Promise((r,i)=>{try{n();const o="initGoogleMaps";window[o]=()=>{ia()?r():setTimeout(()=>{ia()||console.warn("Google Maps API se carg\xF3 pero algunos componentes no est\xE1n disponibles"),r()},500)};const d=document.createElement("script");d.id="google-maps-script",d.type="text/javascript";const c=Array.isArray(a)?a.join(","):a;d.src=`https://maps.googleapis.com/maps/api/js?key=${e}&libraries=${c}&callback=${o}&loading=async`,d.async=!0,d.defer=!0,d.onerror=()=>{delete window[o],i(new Error("Error al cargar Google Maps API"))},document.head.appendChild(d)}catch(o){i(o)}})},Ut=(e,a,n=18,r=400,i=400,o="red",d=Na.apiKey)=>`https://maps.googleapis.com/maps/api/staticmap?center=${e},${a}&zoom=${n}&size=${r}x${i}&markers=color:${o}%7Clabel:A%7C${e},${a}&key=${d}`,yd=({onLocationChange:e,initialLocation:a})=>{const n=l.useRef(null),r=l.useRef(null),i=l.useRef(null),o=l.useRef(null),[d,c]=l.useState(!0),[u,g]=l.useState(!1),[b,h]=l.useState(a||null),m=18,p=l.useCallback(C=>{h(C),e(C)},[e]);l.useEffect(()=>{let C=!0;(async()=>{try{if(await Vn(Na.apiKey,Na.libraries),!window.google?.maps?.Map||!window.google?.maps?.Geocoder){console.error("Google Maps APIs no est\xE1n completamente disponibles"),c(!1);return}window.google?.maps?.Geocoder&&(o.current=new window.google.maps.Geocoder),c(!1)}catch(w){console.error("Error al cargar Google Maps:",w),c(!1)}})(),a||navigator.geolocation.getCurrentPosition(w=>{const j=w.coords.latitude,W=w.coords.longitude,E=j.toString(),B=W.toString(),A=Ut(j,W,m);p({lat:E,lng:B,title:"",description:"",url:A})},w=>{console.error("Error getting location:",w);const j=-34.6037,W=-58.3816;p({lat:j.toString(),lng:W.toString(),title:"",description:"",url:Ut(j,W,m)})})},[a,p,m]),l.useEffect(()=>{if(d||r.current)return;const C=setTimeout(()=>{r.current||x()},50);return()=>clearTimeout(C)},[d]),l.useEffect(()=>{u&&b&&v()},[u,b]),l.useEffect(()=>()=>{i.current&&(i.current.setMap(null),i.current=null)},[]);const x=()=>{if(!n.current){console.warn("Contenedor del mapa no disponible");return}if(!window.google?.maps){console.warn("Google Maps API no disponible a\xFAn");return}try{const C={zoom:m,disableDefaultUI:!1,zoomControl:!0,mapTypeControl:!1,streetViewControl:!1,fullscreenControl:!1};r.current=new window.google.maps.Map(n.current,C),r.current.addListener("click",w=>{S(w)}),g(!0)}catch(C){console.error("Error inicializando mapa:",C)}},S=C=>{if(!C.latLng||!o.current)return;const w={lat:C.latLng.lat(),lng:C.latLng.lng()};i.current?i.current.setPosition(w):r.current&&(i.current=new window.google.maps.Marker({position:w,map:r.current})),o.current.geocode({location:w},(j,W)=>{if(W==="OK"&&j&&j[0]){const E=j[0].formatted_address,B=Ut(w.lat,w.lng,m);p({lat:w.lat.toString(),lng:w.lng.toString(),title:E||"",description:"",url:B})}else{const E=Ut(w.lat,w.lng,m);p({lat:w.lat.toString(),lng:w.lng.toString(),title:`${w.lat.toFixed(6)}, ${w.lng.toFixed(6)}`,description:"",url:E})}})},v=()=>{if(!(!r.current||!b))try{const C={lat:parseFloat(b.lat),lng:parseFloat(b.lng)};r.current.setCenter(C),i.current?i.current.setPosition(C):i.current=new window.google.maps.Marker({position:C,map:r.current})}catch(C){console.error("Error actualizando mapa:",C)}},T=(C,w)=>{const j=Ut(C.lat,C.lng,m);p({lat:C.lat.toString(),lng:C.lng.toString(),title:w||"",description:"",url:j})};return d?t.jsx(s.Box,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"100vh"},children:t.jsx(s.CircularProgress,{})}):t.jsxs(s.Box,{sx:{position:"relative",height:"calc(100vh - 305px)"},children:[t.jsx(hd,{onPlaceSelected:T}),t.jsx("div",{style:{height:"100%"},ref:n})]})},bd=({open:e,onClose:a,onSelectLocation:n,initialAddress:r})=>{const i=Me(),[o,d]=l.useState(null),c=l.useRef(null);l.useEffect(()=>{e||d(null)},[e]),l.useEffect(()=>{c.current&&o&&(c.current.scrollTop=c.current.scrollHeight/4)},[o]);const u=l.useCallback(b=>{d(b)},[]),g=l.useCallback(()=>{o&&(n(o.title||`${o.lat}, ${o.lng}`,o.lat,o.lng),a())},[o,n,a]);return t.jsxs(s.Dialog,{open:e,onClose:a,maxWidth:"md",fullWidth:!0,disableEnforceFocus:!0,disableAutoFocus:!0,PaperProps:{sx:{maxHeight:"80vh",height:"80vh"}},sx:{"& .MuiDialog-paper":{backgroundColor:b=>b.palette.background.panel}},children:[t.jsxs(s.Box,{sx:{position:"relative",display:"flex",alignItems:"center",p:2},children:[t.jsx(s.Typography,{variant:"body1",sx:{flex:1},children:i("global.selectLocation","Seleccionar ubicaci\xF3n")}),t.jsx(s.IconButton,{"aria-label":"close",onClick:a,size:"small",children:t.jsx(za,{fontSize:"small"})})]}),t.jsx(s.DialogContent,{sx:{p:0,display:"flex",flexDirection:"column",height:"100%"},children:t.jsxs(s.Box,{sx:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",overflow:"hidden",width:"100%",height:"100%",position:"relative"},children:[t.jsx(s.Box,{ref:c,sx:{width:"100%",flex:1,overflow:"auto",zIndex:1},children:t.jsx(yd,{onLocationChange:u,initialLocation:void 0})}),t.jsx(s.Divider,{sx:{width:"100%",padding:0}}),t.jsxs(s.Box,{sx:{width:"100%",display:"flex",justifyContent:"flex-end",gap:".5rem",p:2},children:[t.jsx(s.Button,{variant:"outlined",color:"error",size:"small",sx:{borderRadius:"0.5rem"},onClick:a,children:i("global.cancel","Cancelar")}),t.jsx(s.Button,{variant:"outlined",color:"secondary",size:"small",sx:{borderRadius:"0.5rem"},onClick:g,disabled:!o,children:i("global.selectLocation","Seleccionar ubicaci\xF3n")})]})]})})]})},xd=({locationField:e,disabled:a})=>{const n=Me(),[r,i]=l.useState(!1),{value:o,type:d,...c}=e.attributes,u=o||"",g=()=>{a||i(!0)},b=()=>{i(!1)},h=m=>{e.actions.changeValue(m)};return a?t.jsx(s.Box,{children:t.jsx(ze,{title:n("global.location","Ubicaci\xF3n"),children:t.jsxs(s.Box,{sx:{display:"flex",alignItems:"center",gap:1,py:.5},children:[u&&t.jsx(Ya,{sx:{opacity:.5},fontSize:"small"}),t.jsx(s.Typography,{variant:"body1",sx:{color:m=>m.palette.text.secondary,fontSize:"0.9rem"},children:u||"-"})]})})}):t.jsxs(s.Box,{children:[t.jsx(ze,{title:n("global.location","Ubicaci\xF3n"),children:t.jsx(s.TextField,{...c,value:u,disabled:a,size:"small",fullWidth:!0,variant:"outlined",placeholder:n("global.addLocation","Agregar ubicaci\xF3n"),onClick:g,InputProps:{startAdornment:t.jsx(Ya,{sx:{mr:1,opacity:.5},fontSize:"small"}),readOnly:!0},sx:{cursor:a?"default":"pointer","& .MuiInputBase-input":{cursor:a?"default":"pointer"}}})}),t.jsx(bd,{open:r,onClose:b,onSelectLocation:h,initialAddress:u})]})},vd=({handleScroll:e,contactList:a,handleSelectContact:n,selectedContactIds:r,search:i})=>{const o=Me(),d=s.useTheme();return t.jsx(s.List,{sx:{width:"100%",height:"100%",overflow:"auto",border:`1px solid ${d.palette.divider}`,borderTop:"none",backgroundColor:d.palette.background.panel,backgroundImage:"linear-gradient(rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.12))"},onScroll:e,children:i&&a?.map(c=>t.jsxs(s.ListItemButton,{sx:{width:"100%"},onClick:()=>n(c),selected:r.includes(c.id),children:[t.jsx(s.ListItemIcon,{children:t.jsx(Be.Person,{sx:{color:u=>u.palette.text.disabled}})}),t.jsx(s.ListItemText,{primary:o(c.name),secondary:c?.phone})]},c.id))})},Cd={format:"IContact",total:0,lastPage:1,perPage:10,order:"ASC",orderColumn:"Id"};function Sd(e){const a=l.useRef(null),n=l.useRef(null),[r,i]=l.useState([]),[o,d]=l.useState(!1),[c,u]=l.useState(!1),[g,b]=l.useState(!1),[h,m]=l.useState(!1),[p,x]=l.useState(1),[S,v]=l.useState(!1),T=l.useCallback(()=>{n.current?.abort(),n.current=null,a.current&&(clearTimeout(a.current),a.current=null),d(!1),v(!1),x(1),m(!1),i([])},[]),C=E=>E.filter(B=>!!B?.id),w=l.useCallback(async({query:E,page:B})=>{if(!e)return;n.current?.abort();const A=new AbortController;n.current=A,u(!0);try{const I={...Cd,currentPage:B,filter:[{value:E,column:"name",condition:""}]},O=await ad({baseUrl:e.baseUrl,spaceId:e.spaceId,pagination:I,signal:A.signal});if(A.signal.aborted)return;const V=C(O?.contactos??[]);d(!0);const _=O?.paginacion?.total??0;i(Y=>{const $=B===1?V:(()=>{const Z=new Map;for(const q of Y)Z.set(q.id,q);for(const q of V)Z.set(q.id,q);return Array.from(Z.values())})();return _&&$.length>=_&&v(!0),$})}finally{u(!1),b(!1),m(!1)}},[e]),j=l.useCallback(E=>{T(),E&&(a.current&&(clearTimeout(a.current),a.current=null),b(!0),a.current=setTimeout(()=>{w({query:E,page:1})},800))},[w,T]),W=l.useCallback((E,B)=>{const A=E.target;if(!(A.scrollHeight-A.scrollTop-A.clientHeight<1)||S||c||!B)return;const I=p+1;m(!0),x(I),w({query:B,page:I})},[S,c,p,w]);return{contactList:r,hasSearched:o,isLoading:c,isLoadingTimer:g,isNextPage:h,handleQueryChanged:j,handleScroll:W,resetSearchState:T}}const Hn=({linkContactsHandler:e,disabled:a=!1})=>{const n=Me(),r=Bn(),i=l.useRef(null),[o,d]=l.useState(null),{action:{handleSearchChange:c,handleSelectContact:u,handleRemoveContact:g},state:{search:b,selectedContacts:h}}=e,{contactList:m,hasSearched:p,isLoading:x,isLoadingTimer:S,handleQueryChanged:v,handleScroll:T,resetSearchState:C}=Sd(r),w=b||"",j=!!o&&w.length>0&&!a,W=h.map(I=>I.id);l.useEffect(()=>{w?v(w):C()},[w,v,C]);const E=I=>{c(I),I&&!o?d(i.current):I||d(null)},B=I=>{u(I),d(null),C()},A=()=>{d(null)};return a?t.jsx(ze,{title:n("global.linkContacts"),children:h.length>0?t.jsx(s.Box,{sx:{display:"flex",flexWrap:"wrap",gap:.5,pt:.5},children:h.map(I=>t.jsx(s.Chip,{icon:t.jsx(va,{fontSize:"small"}),label:I.name,size:"small",variant:"outlined"},I.id))}):t.jsx(s.Typography,{variant:"body1",sx:{py:.5},children:"-"})}):t.jsx(s.ClickAwayListener,{onClickAway:A,children:t.jsxs(s.Box,{children:[t.jsxs(ze,{title:n("global.linkContacts"),children:[t.jsx(s.TextField,{ref:i,fullWidth:!0,size:"small",placeholder:n("global.searchContacts"),value:w,onChange:I=>E(I.target.value),onFocus:()=>{w&&d(i.current)},InputProps:{startAdornment:t.jsx(va,{sx:{mr:1,opacity:.5},fontSize:"small"}),endAdornment:x||S?t.jsx(s.CircularProgress,{size:18,sx:{mr:1}}):null}}),h.length>0&&t.jsx(s.Box,{sx:{display:"flex",flexWrap:"wrap",gap:.5,mt:1},children:h.map(I=>t.jsx(s.Chip,{icon:t.jsx(va,{fontSize:"small"}),label:I.name,size:"small",onDelete:()=>g(I.id)},I.id))})]}),t.jsx(s.Popper,{open:j,anchorEl:o,placement:"bottom-start",style:{width:o?.offsetWidth||"auto",zIndex:1300},children:t.jsxs(s.Paper,{elevation:8,sx:{mt:.5,maxHeight:300,overflow:"hidden"},children:[p&&m.length>0&&t.jsx(vd,{handleScroll:I=>T(I,w),contactList:m,handleSelectContact:B,selectedContactIds:W,search:w}),p&&m.length===0&&t.jsx(s.Box,{sx:{p:2,textAlign:"center",color:"text.secondary"},children:t.jsx(s.Typography,{variant:"body2",children:n("global.noResults","No se encontraron resultados")})})]})})]})})},jd=({isFinalized:e})=>{const{eventDialog:{handleClose:a},handleCreateEvent:n,dialogMode:r,handleStartEditingEvent:i,handleSaveUpdatedEvent:o,handleEndEvent:d,dialogType:c,handleCreateTask:u,handleSaveUpdatedTask:g,selectedTask:b,handleToggleTaskCompleted:h}=l.useContext(Ba),m=Me(),p=c==="event",x=!1,S=!1,v=!1,T=()=>{p?n():u()},C=(()=>{if(r==="view")return i;if(r==="edit")return p?()=>o?.():()=>g?.();if(r==="create")return T})(),w=m(r==="view"?p?"global.editEvent":"global.editTask":r==="edit"?p?"global.saveEvent":"global.saveTask":p?"global.createEvent":"global.createTask"),j=p?x:v,W=e,E=!p&&r==="view",B=b?.isCompleted||!1;return E?t.jsx(s.DialogActions,{children:t.jsx(Ze.LoadingButton,{startIcon:t.jsx(Be.CheckCircleOutline,{}),size:"small",loading:v,disabled:v,onClick:h,variant:"contained",color:B?"inherit":"primary",children:B?m("global.markAsIncomplete","Marcar como incompleta"):m("global.markAsCompleted","Marcar como completada")})}):t.jsxs(s.DialogActions,{children:[t.jsx(s.Button,{variant:"outlined",size:"small",onClick:a,color:"secondary",children:m("global.cancel")}),p&&(r==="edit"||r==="view")&&t.jsx(Ze.LoadingButton,{startIcon:t.jsx(Be.EventAvailable,{}),size:"small",disabled:e,loading:S,onClick:d,variant:"contained",children:m("global.finalizeEvent")}),t.jsx(Ze.LoadingButton,{startIcon:t.jsx(Be.EditCalendar,{}),size:"small",loading:j,disabled:W,onClick:C,variant:"contained",children:w})]})},Gn={textTransform:"none",borderRadius:2,minHeight:34,px:1.5,fontSize:13,fontWeight:500,lineHeight:1.1},wd=({value:e,onChange:a,labels:n})=>t.jsxs(s.Box,{sx:{display:"flex",gap:1},children:[t.jsx(s.Button,{size:"small",onClick:()=>a("event"),variant:e==="event"?"contained":"text",disableElevation:!0,color:"primary",sx:{...Gn},children:n.event}),t.jsx(s.Button,{size:"small",onClick:()=>a("task"),variant:e==="task"?"contained":"text",disableElevation:!0,sx:{...Gn},color:"primary",children:n.task})]}),Td="DD/MM/YYYY",kd="HH:mm",Id=({selectedDateTime:e,handleSelect:a,disabled:n,isError:r=!1,hideLabel:i=!1})=>{const o=Me(),d=u=>{if(!u)return;const g=u.hour(e.hour()).minute(e.minute());a(g)},c=u=>{if(!u)return;const g=e.hour(u.hour()).minute(u.minute());a(g)};return n?t.jsxs(sa,{children:[!i&&t.jsx("span",{style:{userSelect:"none",marginBottom:10},children:o("global.date")}),t.jsxs(s.Box,{children:[t.jsx(s.Typography,{variant:"body1",sx:{mb:1},children:e.format(Td)}),t.jsx(s.Typography,{variant:"body1",children:e.format(kd)})]})]}):t.jsxs(sa,{children:[!i&&t.jsx("span",{style:{userSelect:"none",marginBottom:10},children:o("global.date")}),t.jsx(Pa,{children:t.jsxs(Ye.LocalizationProvider,{dateAdapter:Ga.AdapterDayjs,children:[t.jsx(Ye.DatePicker,{disabled:n,value:e,onChange:d,slotProps:{textField:()=>({label:o("global.date"),size:"small",className:"smallInput"}),popper:{sx:{"& .MuiPaper-root":{backgroundColor:u=>u.palette.background.panel}}}},sx:{alignSelf:"baseline",flex:1},minDate:J()}),t.jsx(Ua,{variant:"body1",children:"_"}),t.jsx(Ye.TimePicker,{disabled:n,value:e,onChange:c,ampm:!1,slotProps:{textField:()=>({label:o("global.time"),size:"small",className:"smallInput"}),popper:{sx:{"& .MuiPaper-root":{backgroundColor:u=>u.palette.background.panel}}}},sx:{alignSelf:"baseline",flex:1}})]})}),t.jsx(s.Fade,{in:r,children:t.jsx(s.Typography,{color:"red",variant:"caption",children:o("conversations.sidebar.events.errorDate")})})]})},Yn=({disabled:e,calendars:a,userId:n,value:r,onChange:i})=>{const o=Me(),d=l.useMemo(()=>a??[],[a]),c=l.useMemo(()=>d.find(u=>u.id===r)??null,[d,r]);return e?t.jsx(ze,{title:o("global.calendar"),children:t.jsxs(s.Box,{sx:{display:"flex",alignItems:"center",gap:1,py:.5},children:[c&&t.jsx(Br,{sx:{opacity:.5,color:u=>u.palette.text.secondary},fontSize:"small"}),t.jsx(s.Typography,{variant:"subtitle2",sx:{color:u=>u.palette.text.secondary,fontSize:"0.9rem"},children:c?.title||"-"})]})}):t.jsx(ze,{title:o("global.calendar"),children:t.jsx(s.Autocomplete,{disabled:e,size:"small",fullWidth:!0,options:d,value:c,onChange:(u,g)=>i(g?.id??""),getOptionLabel:u=>u?.title??"",isOptionEqualToValue:(u,g)=>u.id===g.id,groupBy:n?u=>u.userId===n?o("calendarView.myCalendars"):o("calendarView.othersCalendars"):void 0,renderGroup:u=>t.jsxs("li",{children:[t.jsx(s.ListSubheader,{component:"div",sx:{lineHeight:"32px",fontSize:"0.75rem",fontWeight:600,color:"text.secondary",backgroundColor:g=>g.palette.background.panel},children:u.group}),t.jsx("ul",{style:{padding:0},children:u.children})]},u.key),slotProps:{popper:{sx:{zIndex:1400}},paper:{sx:{backgroundColor:u=>u.palette.background.panel}}},renderInput:u=>t.jsx(s.TextField,{...u,placeholder:o("global.selectCalendar")})})})},Ed=({checked:e,onChange:a,disabled:n})=>{const r=Me();return t.jsx(s.Box,{sx:{display:"flex",alignItems:"center"},children:t.jsx(s.FormControlLabel,{control:t.jsx(s.Checkbox,{checked:e,onChange:i=>a(i.target.checked),disabled:n,color:"secondary"}),label:r("global.allDay","Todo el d\xEDa")})})},Dd=({colorField:e,disabled:a,onColorChange:n})=>{const r=Me(),i=e.attributes.value||"#1976d2",o=(c=>{if(c.startsWith("#"))return c;const u=c.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)/);if(u&&u[1]&&u[2]&&u[3]){const g=parseInt(u[1]),b=parseInt(u[2]),h=parseInt(u[3]),m=p=>{const x=p.toString(16);return x.length===1?"0"+x:x};return`#${m(g)}${m(b)}${m(h)}`}return"#1976d2"})(i),d=c=>{const u=c.target.value;n?n(u):e.actions.changeValue(u)};return a?t.jsx(ze,{title:r("global.color","Color"),children:t.jsxs(s.Box,{sx:{display:"flex",gap:1,alignItems:"center"},children:[t.jsx(s.Box,{sx:{width:40,height:40,backgroundColor:o,border:"1px solid rgba(0, 0, 0, 0.23)",borderRadius:1}}),t.jsx(s.Typography,{variant:"body2",sx:{color:"text.secondary"},children:o})]})}):t.jsx(ze,{title:r("global.color","Color"),children:t.jsx(s.Box,{sx:{display:"flex",gap:1,alignItems:"center"},children:t.jsx("input",{type:"color",value:o,onChange:d,disabled:a,style:{width:60,height:40,border:"1px solid rgba(0, 0, 0, 0.23)",borderRadius:4,cursor:a?"not-allowed":"pointer"}})})})},qn=[{value:"",label:"global.noRepeat"},{value:"FREQ=DAILY",label:"global.everyDay"},{value:"FREQ=WEEKLY",label:"global.everyWeek"},{value:"FREQ=MONTHLY",label:"global.everyMonth"},{value:"FREQ=YEARLY",label:"global.everyYear"},{value:"FREQ=DAILY;INTERVAL=2",label:"global.everyTwoDays"},{value:"FREQ=WEEKLY;INTERVAL=2",label:"global.everyTwoWeeks"},{value:"FREQ=WEEKLY;BYDAY=MO,TU,WE,TH,FR",label:"global.everyWeekday"}],Ad=({value:e,onChange:a,disabled:n,hideLabel:r=!1})=>{const i=Me(),o=g=>{a(g.target.value)},d=l.useMemo(()=>qn.map(g=>t.jsx(s.MenuItem,{value:g.value,children:i(g.label,g.label)},g.value)),[i]),c=l.useMemo(()=>{const g=qn.find(b=>b.value===e);return g?i(g.label,g.label):i("global.noRepeat")},[e,i]);if(n)return r?t.jsxs(s.Box,{sx:{display:"flex",alignItems:"center",gap:1},children:[t.jsx(Ca,{sx:{opacity:.5},fontSize:"small"}),t.jsx(s.Typography,{variant:"body2",children:c})]}):t.jsx(ze,{title:i("global.recurrence","Recurrencia"),children:t.jsxs(s.Box,{sx:{display:"flex",alignItems:"center",gap:1,py:.5},children:[t.jsx(Ca,{sx:{opacity:.5},fontSize:"small"}),t.jsx(s.Typography,{variant:"body1",children:c})]})});const u=t.jsx(s.Select,{disabled:n,size:"small",variant:"outlined",fullWidth:!0,value:e||"",onChange:o,startAdornment:t.jsx(Ca,{sx:{mr:1,ml:1,opacity:.5},fontSize:"small"}),MenuProps:{PaperProps:{sx:{backgroundColor:g=>g.palette.background.panel}}},children:d});return r?u:t.jsx(ze,{title:i("global.recurrence","Recurrencia"),children:u})},Fd=({open:e,onClose:a,onConfirm:n,itemTitle:r,itemType:i})=>{const{t:o}=Ge.useTranslation(),d=()=>{n(),a()},c=i==="event"?o("calendar.deleteEvent","Eliminar evento"):o("calendar.deleteTask","Eliminar tarea"),u=i==="event"?o("calendar.confirmDeleteEvent","\xBFEst\xE1s seguro de que quer\xE9s eliminar este evento?"):o("calendar.confirmDeleteTask","\xBFEst\xE1s seguro de que quer\xE9s eliminar esta tarea?");return t.jsxs(s.Dialog,{open:e,onClose:a,maxWidth:"xs",fullWidth:!0,PaperProps:{sx:{backgroundColor:g=>g.palette.background.panel}},children:[t.jsxs(s.DialogTitle,{sx:{display:"flex",alignItems:"center",gap:1},children:[t.jsx($r,{color:"warning"}),c]}),t.jsxs(s.DialogContent,{children:[t.jsx(s.Typography,{variant:"body2",sx:{mb:2},children:u}),r&&t.jsx(s.Box,{sx:{p:1.5,bgcolor:"action.hover",borderRadius:1,borderLeft:3,borderColor:"warning.main"},children:t.jsxs(s.Typography,{variant:"body2",sx:{fontWeight:500},children:['"',r,'"']})})]}),t.jsxs(s.DialogActions,{sx:{px:3,pb:2},children:[t.jsx(s.Button,{onClick:a,variant:"outlined",color:"inherit",sx:{borderRadius:"8px"},children:o("global.cancel","Cancelar")}),t.jsx(s.Button,{onClick:d,variant:"contained",color:"error",sx:{borderRadius:"8px"},children:o("global.delete","Eliminar")})]})]})},Bd=({open:e,onClose:a,onConfirm:n,eventTitle:r})=>{const{t:i}=Ge.useTranslation(),[o,d]=l.useState("single"),c=()=>{n(o==="all"),a()},u=()=>{d("single"),a()};return t.jsxs(s.Dialog,{open:e,onClose:u,maxWidth:"xs",fullWidth:!0,PaperProps:{sx:{backgroundColor:g=>g.palette.background.panel}},children:[t.jsx(s.DialogTitle,{children:i("calendar.deleteRecurringEvent","Borrar evento recurrente")}),t.jsxs(s.DialogContent,{children:[r&&t.jsxs(s.Box,{sx:{mb:2,color:"text.secondary",fontSize:"0.875rem"},children:['"',r,'"']}),t.jsx(s.FormControl,{component:"fieldset",fullWidth:!0,children:t.jsxs(s.RadioGroup,{value:o,onChange:g=>d(g.target.value),children:[t.jsx(s.FormControlLabel,{value:"single",control:t.jsx(s.Radio,{color:"secondary"}),label:i("calendar.deleteThisEvent","Este evento"),sx:{mb:1}}),t.jsx(s.FormControlLabel,{value:"all",control:t.jsx(s.Radio,{color:"secondary"}),label:i("calendar.deleteAllEvents","Todos los eventos")})]})})]}),t.jsxs(s.DialogActions,{sx:{px:3,pb:2},children:[t.jsx(s.Button,{onClick:u,variant:"outlined",color:"inherit",sx:{borderRadius:"8px"},children:i("global.cancel","Cancelar")}),t.jsx(s.Button,{onClick:c,variant:"contained",color:"error",sx:{borderRadius:"8px"},children:i("global.delete","Eliminar")})]})]})},$d=({open:e,onClose:a,onConfirm:n,eventTitle:r})=>{const{t:i}=Ge.useTranslation(),[o,d]=l.useState("single"),c=()=>{n(o==="all"),a()},u=()=>{d("single"),a()};return t.jsxs(s.Dialog,{open:e,onClose:u,maxWidth:"xs",fullWidth:!0,PaperProps:{sx:{backgroundColor:g=>g.palette.background.panel}},children:[t.jsx(s.DialogTitle,{children:i("calendar.editRecurringEvent","Editar evento recurrente")}),t.jsxs(s.DialogContent,{children:[r&&t.jsxs(s.Box,{sx:{mb:2,color:"text.secondary",fontSize:"0.875rem"},children:['"',r,'"']}),t.jsx(s.FormControl,{component:"fieldset",fullWidth:!0,children:t.jsxs(s.RadioGroup,{value:o,onChange:g=>d(g.target.value),children:[t.jsx(s.FormControlLabel,{value:"single",control:t.jsx(s.Radio,{color:"secondary"}),label:i("calendar.editThisEvent","Este evento"),sx:{mb:1}}),t.jsx(s.FormControlLabel,{value:"all",control:t.jsx(s.Radio,{color:"secondary"}),label:i("calendar.editAllEvents","Todos los eventos")})]})})]}),t.jsxs(s.DialogActions,{sx:{px:3,pb:2},children:[t.jsx(s.Button,{onClick:u,variant:"outlined",color:"inherit",sx:{borderRadius:"8px"},children:i("global.cancel","Cancelar")}),t.jsx(s.Button,{onClick:c,variant:"contained",color:"secondary",sx:{borderRadius:"8px"},children:i("global.save","Guardar")})]})]})},Md=()=>{const e=Me(),{event:a,task:n,dialogMode:r,selectedEvent:i,handleDeleteEvent:o,handleStartEditingEvent:d,handleDuplicateItem:c,dialogType:u,setDialogType:g,selectedTask:b,taskCalendarId:h,setTaskCalendarId:m,eventCalendarId:p,setEventCalendarId:x,myCalendars:S,otherCalendars:v,handleDeleteTask:T,userManuallyChangedColor:C,setUserManuallyChangedColor:w,eventDialog:{open:j,handleClose:W},confirmDeleteDialog:E,handleConfirmDelete:B,deleteRecurringDialog:A,handleConfirmDeleteRecurring:I,editRecurringDialog:O,handleConfirmEditRecurring:V,hiddenTabs:_}=l.useContext(Ba);if(!a||!n)return t.jsx(s.Modal,{open:j,onClose:W,closeAfterTransition:!0,slots:{backdrop:s.Backdrop},slotProps:{backdrop:{timeout:200}},children:t.jsx(s.Fade,{in:j,timeout:200,children:t.jsx(s.Box,{sx:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",width:"min(640px, calc(100vw - 32px))",height:"min(560px, calc(100vh - 64px))",bgcolor:N=>N.palette.background.panel,borderRadius:3,boxShadow:24,outline:0,p:3,overflow:"visible"}})})});const Y=u==="event",$=Y?a:n,Z=Y?i:b,q=l.useRef(null),L=l.useRef(null);l.useEffect(()=>{j||(q.current=null,L.current=null)},[j]);const{titleField:k,descriptionField:M,date:P,linkContact:R}=$,H=Y?a.notifications:null,G=Y?{locationField:a.locationField,colorField:a.colorField,allDay:a.allDay,setAllDay:a.setAllDay,isPrivate:a.isPrivate,setIsPrivate:a.setIsPrivate,recurrenceRule:a.recurrenceRule,setRecurrenceRule:a.setRecurrenceRule}:null,te=e(r==="edit"?Y?"global.editEvent":"global.editTask":r==="create"?Y?"global.createEvent":"global.createTask":Y?"global.showEvent":"global.showTask"),de=(r==="edit"||r==="view")&&!!Z?.id,pe=r==="view";l.useEffect(()=>{if(r!=="create"||u!=="event"||!j||C||!p)return;const N=S.find(Se=>Se.id===p);N?.color&&a.colorField.actions.changeValue(N.color)},[r,u,j,p,C,S]),l.useEffect(()=>{if(!j||u!=="event"||r!=="edit")return;const N=P.state.selectedStartDate.isAfter(P.state.selectedEndDate)&&!P.state.selectedStartDate.isSame(P.state.selectedEndDate,"minute");L.current!==N&&(L.current=N,P.action.setError(N))},[j,u,r,P.state.selectedStartDate.valueOf(),P.state.selectedEndDate.valueOf()]),l.useEffect(()=>{if(!j||r==="create")return;const N=Z?.relatedContact;N?.id&&q.current!==N.id&&(q.current=N.id,R.action.resetField(),R.action.handleSelectContact({id:N.id,name:N.name}))},[j,r,Z?.id]);const ve=N=>{if(N==="task"){const Se=a.date.state.selectedStartDate;n.date.action.setSelectedStartDate(Se),n.date.action.setSelectedEndDate(Se),n.date.action.setError(!1),a.date.action.setError(!1)}else{const Se=n.date.state.selectedStartDate;a.date.action.setSelectedStartDate(Se),a.date.action.setError(!1),n.date.action.setError(!1)}g(N)},ye=N=>{a.colorField.actions.changeValue(N),w(!0)};return t.jsxs(t.Fragment,{children:[t.jsx(s.Modal,{open:j,onClose:W,closeAfterTransition:!0,slots:{backdrop:s.Backdrop},slotProps:{backdrop:{timeout:200}},children:t.jsx(s.Fade,{in:j,timeout:200,children:t.jsxs(s.Box,{sx:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",width:"min(640px, calc(100vw - 32px))",maxHeight:"calc(100vh - 64px)",bgcolor:N=>N.palette.background.panel,borderRadius:3,boxShadow:24,outline:0,overflow:"hidden",display:"flex",flexDirection:"column"},children:[t.jsxs(s.Box,{sx:{display:"flex",flexDirection:"column",gap:2,p:3,pt:4,overflowY:"auto",flex:1},children:[t.jsxs(s.Box,{sx:{display:"flex",alignItems:"center",justifyContent:r==="create"?"flex-end":"space-between",gap:1,mb:.5},children:[r!=="create"&&t.jsx(s.Typography,{sx:{fontWeight:600},children:te}),t.jsxs(s.Box,{sx:{display:"flex",gap:1},children:[pe&&t.jsx(s.IconButton,{size:"small",onClick:d,"aria-label":e("global.edit","Editar"),children:t.jsx(Ct,{fontSize:"small"})}),de&&t.jsx(s.IconButton,{size:"small",onClick:Y?o:T,color:"error","aria-label":e("global.delete","Eliminar"),children:t.jsx(qt,{fontSize:"small"})}),pe&&t.jsx(s.IconButton,{size:"small",onClick:c,"aria-label":e("global.duplicate","Duplicar"),children:t.jsx(Mr,{fontSize:"small"})})]})]}),r==="create"&&t.jsxs(t.Fragment,{children:[t.jsx(Ra,{disabled:!1,titleField:k,variantMode:"inline"}),!_&&t.jsx(wd,{value:u,onChange:ve,labels:{event:e("global.event","Evento"),task:e("global.task","Tarea")}})]}),u==="event"?t.jsxs(t.Fragment,{children:[r!=="create"&&t.jsx(Ra,{disabled:r==="view",titleField:k}),t.jsx(zn,{disabled:r==="view",descriptionField:M}),t.jsx(Yn,{disabled:r==="view",calendars:[...S,...v],userId:S[0]?.userId,value:p,onChange:N=>x(N)}),t.jsxs(s.Box,{sx:{display:"flex",flexDirection:"column",gap:1.5,borderRadius:1,padding:"15px",bgcolor:N=>N.palette.mode==="dark"?"rgba(255, 255, 255, 0.05)":"rgba(0, 0, 0, 0.02)"},children:[t.jsx(s.Box,{sx:{display:"flex",gap:1.5,alignItems:"flex-start"},children:t.jsx(s.Box,{sx:{flex:1},children:t.jsx(rd,{disabled:r==="view",selectedStartDate:P.state.selectedStartDate,selectedEndDate:P.state.selectedEndDate,handleSelectStart:P.action.handleSelect(P.action.setSelectedStartDate),handleSelectEnd:P.action.handleSelect(P.action.setSelectedEndDate),isError:P.state.error,hideLabel:!0,allDay:G?.allDay??!1})})}),G&&t.jsxs(s.Box,{sx:{display:"flex",gap:2,alignItems:"center"},children:[t.jsx(Ed,{checked:G.allDay,onChange:G.setAllDay,disabled:r==="view"}),t.jsx(s.Box,{sx:{flex:1},children:t.jsx(Ad,{disabled:r==="view",value:G.recurrenceRule,onChange:G.setRecurrenceRule,hideLabel:!0})})]})]}),G&&t.jsx(t.Fragment,{children:t.jsx(Dd,{disabled:r==="view",colorField:G.colorField,onColorChange:r==="create"?ye:void 0})}),H&&t.jsx(md,{disabled:r==="view",notificationsField:H}),t.jsx(Hn,{linkContactsHandler:R,disabled:r==="view"}),G&&t.jsx(xd,{disabled:r==="view",locationField:G.locationField})]}):t.jsxs(t.Fragment,{children:[r!=="create"&&t.jsx(Ra,{disabled:r==="view",titleField:k}),t.jsx(zn,{disabled:r==="view",descriptionField:M}),t.jsx(Yn,{disabled:r==="view",calendars:[...S,...v],userId:S[0]?.userId,value:h,onChange:N=>m(N)}),t.jsx(s.Box,{sx:{display:"flex",flexDirection:"column",gap:1.5,p:2,borderRadius:1,bgcolor:N=>N.palette.mode==="dark"?"rgba(255, 255, 255, 0.05)":"rgba(0, 0, 0, 0.02)"},children:t.jsxs(s.Box,{sx:{display:"flex",gap:1.5,alignItems:"flex-start"},children:[t.jsx(Pr,{sx:{mt:.5,color:"text.secondary",fontSize:"1.25rem"}}),t.jsx(s.Box,{sx:{flex:1},children:t.jsx(Id,{disabled:r==="view",selectedDateTime:P.state.selectedStartDate,handleSelect:N=>{P.action.setSelectedStartDate(N),P.action.setSelectedEndDate(N),P.action.setError(!1)},isError:P.state.error,hideLabel:!0})})]})}),t.jsx(Hn,{linkContactsHandler:R,disabled:r==="view"})]})]}),t.jsx(s.Box,{sx:{borderTop:1,borderColor:"divider",p:2},children:t.jsx(jd,{isFinalized:i?.finalized})})]})})}),t.jsx(Fd,{open:E.open,onClose:E.handleClose,onConfirm:B,itemTitle:E.itemType==="event"?i?.title:b?.title,itemType:E.itemType}),t.jsx(Bd,{open:A.open,onClose:A.handleClose,onConfirm:I,eventTitle:i?.title}),t.jsx($d,{open:O.open,onClose:O.handleClose,onConfirm:V,eventTitle:i?.title})]})},Kn=e=>{const a=e.palette.background;return s.createTheme({...e,components:{MuiSelect:{defaultProps:{MenuProps:{PaperProps:{sx:{backgroundColor:a.panel,backgroundImage:"linear-gradient(rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.05))"}}}}},MuiAutocomplete:{styleOverrides:{popper:{zIndex:11,"& div":{backgroundColor:a.panel}}}},MuiPaper:{styleOverrides:{root:{backgroundColor:a.panel,backgroundImage:"linear-gradient(rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.05))"}}},MuiMenu:{styleOverrides:{paper:{backgroundColor:a.panel,backgroundImage:"linear-gradient(rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.05))"}}},MuiList:{styleOverrides:{root:{padding:0}}},MuiModal:{styleOverrides:{root:{}}},MuiTypography:{styleOverrides:{root:{color:e.palette.text.primary}}},MuiChip:{styleOverrides:{root:{color:e.palette.text.primary,border:"1px solid rgba(0, 0, 0, 0.1)",borderRadius:"4px",height:"20px",fontSize:"0.7125rem"}}},MuiListSubheader:{styleOverrides:{root:{backgroundColor:a.accordionHeader}}},MuiButton:{styleOverrides:{outlined:{color:e.palette.mode==="light"?e.palette.primary.dark:e.palette.info.dark,borderColor:e.palette.mode==="light"?e.palette.primary.dark:e.palette.info.dark,"&:hover":{borderColor:e.palette.mode==="light"?e.palette.primary.main:e.palette.info.main,color:e.palette.mode==="light"?e.palette.primary.main:e.palette.info.main}}}}}})},Pd=e=>{const{open:a,onClose:n,baseUrl:r,spaceId:i,language:o="en",mode:d="create",type:c="event",eventCalendarId:u,taskCalendarId:g,selectedEvent:b,selectedTask:h,hiddenTabs:m=!1,onActionComplete:p,contactId:x}=e,{i18n:S}=Ge.useTranslation();return l.useEffect(()=>{o&&S.changeLanguage(o)},[o,S]),t.jsx(ml,{value:{baseUrl:r,spaceId:i},children:t.jsx(nd,{externalOpen:a,externalOnClose:n,externalMode:d,externalType:c,externalEventCalendarId:u,externalTaskCalendarId:g,externalSelectedEvent:b,externalSelectedTask:h,hiddenTabs:m,externalOnActionComplete:p,externalContactId:x,children:t.jsx(Md,{})})})},Ud=e=>{const a=s.useTheme(),n=a?.palette?a:s.createTheme(),r=Kn(n);return t.jsx(s.ThemeProvider,{theme:r,children:t.jsx(Ge.I18nextProvider,{i18n:It,children:t.jsx(Pd,{...e})})})},la=s.createTheme({name:"lightBlueIndigo",palette:{mode:"light",background:{default:"#ffffff",mainCenter:"#ebf6fd",mainGradient:"linear-gradient(270deg, #215c97, #1976d2)",navMenu:"#1976d2",dropdownMenu:"#f5f5f5",panel:"#ffffff",tooltip:"#1976d2",accordionHeader:"#F3F4F6",panelHeader:"#F3F4F6",panelCenter:"#ffffff",paper:"#ffffff"},primary:{main:"#1976d2",light:"#42a5f5",dark:"#1565c0",contrastText:"#fff"},secondary:{main:"#1976d2",light:"#ba68c8",dark:"#7b1fa2",contrastText:"rgba(0, 0, 0, 0.87)"},error:{main:"#d32f2f",light:"#ef5350",dark:"#c62828"},warning:{main:"#ed6c02",light:"#ff9800",dark:"#e65100"},info:{main:"#0288d1",light:"#03a9f4",dark:"#01579b"},success:{main:"#2e7d32",light:"#4caf50",dark:"#1b5e20"},containerBox:{default:"#ffffff",main:"#f5f5f5"},action:{active:"rgba(0, 0, 0, 0.10)",hover:"rgba(0, 0, 0, 0.05)",selected:"#ebf6fd",disabled:"rgba(0, 0, 0, 0.26)",disabledBackground:"rgba(255, 255, 255, 0.12)"},text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.6)",disabled:"rgba(0, 0, 0, 0.58)",colorMain:"#1976d2"},divider:"rgba(0, 0, 0, 0.12)",dropdownBox:"#ffffff",color:{icons:"#1976d2"},cellHeader:"#d3d3d3",Skeleton:{bg:"#f5f5f5"},messageBox:"#d3e6fd",boxShadow:"rgba(0, 0, 0, 0.1)",disabled:"rgba(0, 0, 0, 0.26)"}}),Jn=s.createTheme({name:"lightBlue",palette:{mode:"light",background:{default:"#ffffff",mainCenter:"#e3f2fd",mainGradient:"linear-gradient(270deg, #005cb2, #1e88e5)",navMenu:"#4fc354",dropdownMenu:"#f5f5f5",panel:"#ffffff",tooltip:"#1e88e5",accordionHeader:"#F3F4F6",panelHeader:"#F3F4F6",panelCenter:"#ffffff",paper:"#ffffff"},primary:{main:"#1e88e5",light:"#6ab7ff",dark:"#005cb2",contrastText:"#fff"},secondary:{main:"#1e88e5",light:"#ba68c8",dark:"#7b1fa2",contrastText:"rgba(0, 0, 0, 0.87)"},error:{main:"#d32f2f",light:"#ef5350",dark:"#c62828"},warning:{main:"#ed6c02",light:"#ff9800",dark:"#e65100"},info:{main:"#0288d1",light:"#03a9f4",dark:"#01579b"},success:{main:"#2e7d32",light:"#4caf50",dark:"#1b5e20"},containerBox:{default:"#ffffff",main:"#f5f5f5"},action:{active:"rgba(0, 0, 0, 0.10)",hover:"rgba(0, 0, 0, 0.05)",selected:"#e3f2fd",disabled:"rgba(0, 0, 0, 0.26)",disabledBackground:"rgba(255, 255, 255, 0.12)"},text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.6)",disabled:"rgba(0, 0, 0, 0.58)",colorMain:"#1e88e5"},divider:"rgba(0, 0, 0, 0.12)",dropdownBox:"#ffffff",color:{icons:"#1e88e5"},cellHeader:"#d3d3d3",Skeleton:{bg:"#f5f5f5"},messageBox:"#d3e6fd",boxShadow:"rgba(0, 0, 0, 0.1)",disabled:"rgba(0, 0, 0, 0.26)"}}),Qn=s.createTheme({name:"lightRed",palette:{mode:"light",background:{default:"#ffffff",mainCenter:"#ffebee",mainGradient:"linear-gradient(270deg, #b61827, #ef5350)",navMenu:"#f44336",dropdownMenu:"#f5f5f5",panel:"#ffffff",tooltip:"#ef5350",accordionHeader:"#F3F4F6",panelHeader:"#F3F4F6",panelCenter:"#ffffff",paper:"#ffffff"},primary:{main:"#ef5350",light:"#ff867c",dark:"#b61827",contrastText:"#fff"},secondary:{main:"#ef5350",light:"#ba68c8",dark:"#7b1fa2",contrastText:"rgba(0, 0, 0, 0.87)"},error:{main:"#d32f2f",light:"#ef5350",dark:"#c62828"},warning:{main:"#ed6c02",light:"#ff9800",dark:"#e65100"},info:{main:"#0288d1",light:"#03a9f4",dark:"#01579b"},success:{main:"#2e7d32",light:"#4caf50",dark:"#1b5e20"},containerBox:{default:"#ffffff",main:"#f5f5f5"},action:{active:"rgba(0, 0, 0, 0.10)",hover:"rgba(0, 0, 0, 0.05)",selected:"#ffebee",disabled:"rgba(0, 0, 0, 0.26)",disabledBackground:"rgba(255, 255, 255, 0.12)"},text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.6)",disabled:"rgba(0, 0, 0, 0.58)",colorMain:"#ef5350"},divider:"rgba(0, 0, 0, 0.12)",dropdownBox:"#ffffff",color:{icons:"#ef5350"},cellHeader:"#d3d3d3",Skeleton:{bg:"#f5f5f5"},messageBox:"#d3e6fd",boxShadow:"rgba(0, 0, 0, 0.1)",disabled:"rgba(0, 0, 0, 0.26)"}}),Xn=s.createTheme({name:"lightGreen",palette:{mode:"light",background:{default:"#ffffff",mainCenter:"#e8f5e9",mainGradient:"linear-gradient(270deg, #087f23, #4caf50)",navMenu:"#4fc354",dropdownMenu:"#f5f5f5",panel:"#ffffff",tooltip:"#4caf50",accordionHeader:"#F3F4F6",panelHeader:"#F3F4F6",panelCenter:"#ffffff",paper:"#ffffff"},primary:{main:"#4caf50",light:"#80e27e",dark:"#087f23",contrastText:"#fff"},secondary:{main:"#4caf50",light:"#ba68c8",dark:"#7b1fa2",contrastText:"rgba(0, 0, 0, 0.87)"},error:{main:"#d32f2f",light:"#ef5350",dark:"#c62828"},warning:{main:"#ed6c02",light:"#ff9800",dark:"#e65100"},info:{main:"#0288d1",light:"#03a9f4",dark:"#01579b"},success:{main:"#2e7d32",light:"#4caf50",dark:"#1b5e20"},containerBox:{default:"#ffffff",main:"#f5f5f5"},action:{active:"rgba(0, 0, 0, 0.10)",hover:"rgba(0, 0, 0, 0.05)",selected:"#e8f5e9",disabled:"rgba(0, 0, 0, 0.26)",disabledBackground:"rgba(255, 255, 255, 0.12)"},text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.6)",disabled:"rgba(0, 0, 0, 0.58)",colorMain:"#4caf50"},divider:"rgba(0, 0, 0, 0.12)",dropdownBox:"#ffffff",color:{icons:"#4caf50"},cellHeader:"#d3d3d3",Skeleton:{bg:"#f5f5f5"},messageBox:"#d3e6fd",boxShadow:"rgba(0, 0, 0, 0.1)",disabled:"rgba(0, 0, 0, 0.26)"}}),Zn=s.createTheme({name:"lightPink",palette:{mode:"light",background:{default:"#ffffff",mainCenter:"#fce4ec",mainGradient:"linear-gradient(270deg, #b0003a, #e91e63)",navMenu:"#e91e63",dropdownMenu:"#f5f5f5",panel:"#ffffff",tooltip:"#e91e63",accordionHeader:"#F3F4F6",panelHeader:"#F3F4F6",panelCenter:"#ffffff",paper:"#ffffff"},primary:{main:"#e91e63",light:"#ff6090",dark:"#b0003a",contrastText:"#fff"},secondary:{main:"#9c27b0",light:"#ba68c8",dark:"#7b1fa2",contrastText:"rgba(0, 0, 0, 0.87)"},error:{main:"#d32f2f",light:"#ef5350",dark:"#c62828"},warning:{main:"#ed6c02",light:"#ff9800",dark:"#e65100"},info:{main:"#0288d1",light:"#03a9f4",dark:"#01579b"},success:{main:"#2e7d32",light:"#4caf50",dark:"#1b5e20"},containerBox:{default:"#ffffff",main:"#f5f5f5"},action:{active:"rgba(0, 0, 0, 0.10)",hover:"rgba(0, 0, 0, 0.05)",selected:"#fce4ec",disabled:"rgba(0, 0, 0, 0.26)",disabledBackground:"rgba(255, 255, 255, 0.12)"},text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.6)",disabled:"rgba(0, 0, 0, 0.58)",colorMain:"#e91e63"},divider:"rgba(0, 0, 0, 0.12)",dropdownBox:"#ffffff",color:{icons:"#e91e63"},cellHeader:"#d3d3d3",Skeleton:{bg:"#f5f5f5"},messageBox:"#d3e6fd",boxShadow:"rgba(0, 0, 0, 0.1)",disabled:"rgba(0, 0, 0, 0.26)"}}),er=s.createTheme({name:"lightPurple",palette:{mode:"light",background:{default:"#ffffff",mainCenter:"#f3e5f5",mainGradient:"linear-gradient(270deg, #6a0080, #9c27b0)",navMenu:"#f8bbd0",dropdownMenu:"#f5f5f5",panel:"#ffffff",tooltip:"#9c27b0",accordionHeader:"#F3F4F6",panelHeader:"#F3F4F6",panelCenter:"#ffffff",paper:"#ffffff"},primary:{main:"#9c27b0",light:"#d05ce3",dark:"#6a0080",contrastText:"#fff"},secondary:{main:"#9c27b0",light:"#ba68c8",dark:"#7b1fa2",contrastText:"rgba(0, 0, 0, 0.87)"},error:{main:"#d32f2f",light:"#ef5350",dark:"#c62828"},warning:{main:"#ed6c02",light:"#ff9800",dark:"#e65100"},info:{main:"#0288d1",light:"#03a9f4",dark:"#01579b"},success:{main:"#2e7d32",light:"#4caf50",dark:"#1b5e20"},containerBox:{default:"#ffffff",main:"#f5f5f5"},action:{active:"rgba(0, 0, 0, 0.10)",hover:"rgba(0, 0, 0, 0.05)",selected:"#f3e5f5",disabled:"rgba(0, 0, 0, 0.26)",disabledBackground:"rgba(255, 255, 255, 0.12)"},text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.6)",disabled:"rgba(0, 0, 0, 0.58)",colorMain:"#9c27b0"},divider:"rgba(0, 0, 0, 0.12)",dropdownBox:"#ffffff",color:{icons:"#9c27b0"},cellHeader:"#d3d3d3",Skeleton:{bg:"#f5f5f5"},messageBox:"#d3e6fd",boxShadow:"rgba(0, 0, 0, 0.1)",disabled:"rgba(0, 0, 0, 0.26)"}}),tr=s.createTheme({name:"lightTeal",palette:{mode:"light",background:{default:"#ffffff",mainCenter:"#e0f2f1",mainGradient:"linear-gradient(270deg, #00675b, #009688)",navMenu:"#f8bbd0",dropdownMenu:"#f5f5f5",panel:"#ffffff",tooltip:"#009688",accordionHeader:"#F3F4F6",panelHeader:"#F3F4F6",panelCenter:"#ffffff",paper:"#ffffff"},primary:{main:"#009688",light:"#52c7b8",dark:"#00675b",contrastText:"#fff"},secondary:{main:"#009688",light:"#ba68c8",dark:"#7b1fa2",contrastText:"rgba(0, 0, 0, 0.87)"},error:{main:"#d32f2f",light:"#ef5350",dark:"#c62828"},warning:{main:"#ed6c02",light:"#ff9800",dark:"#e65100"},info:{main:"#0288d1",light:"#03a9f4",dark:"#01579b"},success:{main:"#2e7d32",light:"#4caf50",dark:"#1b5e20"},containerBox:{default:"#ffffff",main:"#f5f5f5"},action:{active:"rgba(0, 0, 0, 0.10)",hover:"rgba(0, 0, 0, 0.05)",selected:"#e0f2f1",disabled:"rgba(0, 0, 0, 0.26)",disabledBackground:"rgba(255, 255, 255, 0.12)"},text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.6)",disabled:"rgba(0, 0, 0, 0.58)",colorMain:"#009688"},divider:"rgba(0, 0, 0, 0.12)",dropdownBox:"#ffffff",color:{icons:"#009688"},cellHeader:"#d3d3d3",Skeleton:{bg:"#f5f5f5"},messageBox:"#d3e6fd",boxShadow:"rgba(0, 0, 0, 0.1)",disabled:"rgba(0, 0, 0, 0.26)"}}),ar=s.createTheme({name:"lightLime",palette:{mode:"light",background:{default:"#ffffff",mainCenter:"#f9fbe7",mainGradient:"linear-gradient(270deg, #99aa00, #cddc39)",navMenu:"#f8bbd0",dropdownMenu:"#f5f5f5",panel:"#ffffff",tooltip:"#cddc39",accordionHeader:"#F3F4F6",panelHeader:"#F3F4F6",panelCenter:"#ffffff",paper:"#ffffff"},primary:{main:"#cddc39",light:"#ffff6e",dark:"#99aa00",contrastText:"#fff"},secondary:{main:"#cddc39",light:"#ba68c8",dark:"#7b1fa2",contrastText:"rgba(0, 0, 0, 0.87)"},error:{main:"#d32f2f",light:"#ef5350",dark:"#c62828"},warning:{main:"#ed6c02",light:"#ff9800",dark:"#e65100"},info:{main:"#0288d1",light:"#03a9f4",dark:"#01579b"},success:{main:"#2e7d32",light:"#4caf50",dark:"#1b5e20"},containerBox:{default:"#ffffff",main:"#f5f5f5"},action:{active:"rgba(0, 0, 0, 0.10)",hover:"rgba(0, 0, 0, 0.05)",selected:"#f9fbe7",disabled:"rgba(0, 0, 0, 0.26)",disabledBackground:"rgba(255, 255, 255, 0.12)"},text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.6)",disabled:"rgba(0, 0, 0, 0.58)",colorMain:"#cddc39"},divider:"rgba(0, 0, 0, 0.12)",dropdownBox:"#ffffff",color:{icons:"#cddc39"},cellHeader:"#d3d3d3",Skeleton:{bg:"#f5f5f5"},messageBox:"#d3e6fd",boxShadow:"rgba(0, 0, 0, 0.1)",disabled:"rgba(0, 0, 0, 0.26)"}}),nr=s.createTheme({name:"lightYellow",palette:{mode:"light",background:{default:"#ffffff",mainCenter:"#fffde7",mainGradient:"linear-gradient(270deg, #c8b900, #ffeb3b)",navMenu:"#f8bbd0",dropdownMenu:"#f5f5f5",panel:"#ffffff",tooltip:"#ffeb3b",accordionHeader:"#F3F4F6",panelHeader:"#F3F4F6",panelCenter:"#ffffff",paper:"#ffffff"},primary:{main:"#ffeb3b",light:"#ffff72",dark:"#c8b900",contrastText:"#fff"},secondary:{main:"#ffeb3b",light:"#ba68c8",dark:"#7b1fa2",contrastText:"rgba(0, 0, 0, 0.87)"},error:{main:"#d32f2f",light:"#ef5350",dark:"#c62828"},warning:{main:"#ed6c02",light:"#ff9800",dark:"#e65100"},info:{main:"#0288d1",light:"#03a9f4",dark:"#01579b"},success:{main:"#2e7d32",light:"#4caf50",dark:"#1b5e20"},containerBox:{default:"#ffffff",main:"#f5f5f5"},action:{active:"rgba(0, 0, 0, 0.10)",hover:"rgba(0, 0, 0, 0.05)",selected:"#fffde7",disabled:"rgba(0, 0, 0, 0.26)",disabledBackground:"rgba(255, 255, 255, 0.12)"},text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.6)",disabled:"rgba(0, 0, 0, 0.58)",colorMain:"#ffeb3b"},divider:"rgba(0, 0, 0, 0.12)",dropdownBox:"#ffffff",color:{icons:"#ffeb3b"},cellHeader:"#d3d3d3",Skeleton:{bg:"#f5f5f5"},messageBox:"#d3e6fd",boxShadow:"rgba(0, 0, 0, 0.1)",disabled:"rgba(0, 0, 0, 0.26)"}}),rr=s.createTheme({name:"lightAmber",palette:{mode:"light",background:{default:"#ffffff",mainCenter:"#fff8e1",mainGradient:"linear-gradient(270deg, #c68400, #ffb300)",navMenu:"#f8bbd0",dropdownMenu:"#f5f5f5",panel:"#ffffff",tooltip:"#ffb300",accordionHeader:"#F3F4F6",panelHeader:"#F3F4F6",panelCenter:"#ffffff",paper:"#ffffff"},primary:{main:"#ffb300",light:"#ffe54c",dark:"#c68400",contrastText:"#fff"},secondary:{main:"#ffb300",light:"#ba68c8",dark:"#7b1fa2",contrastText:"rgba(0, 0, 0, 0.87)"},error:{main:"#d32f2f",light:"#ef5350",dark:"#c62828"},warning:{main:"#ed6c02",light:"#ff9800",dark:"#e65100"},info:{main:"#0288d1",light:"#03a9f4",dark:"#01579b"},success:{main:"#2e7d32",light:"#4caf50",dark:"#1b5e20"},containerBox:{default:"#ffffff",main:"#f5f5f5"},action:{active:"rgba(0, 0, 0, 0.10)",hover:"rgba(0, 0, 0, 0.05)",selected:"#fff8e1",disabled:"rgba(0, 0, 0, 0.26)",disabledBackground:"rgba(255, 255, 255, 0.12)"},text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.6)",disabled:"rgba(0, 0, 0, 0.58)",colorMain:"#ffb300"},divider:"rgba(0, 0, 0, 0.12)",dropdownBox:"#ffffff",color:{icons:"#ffb300"},cellHeader:"#d3d3d3",Skeleton:{bg:"#f5f5f5"},messageBox:"#d3e6fd",boxShadow:"rgba(0, 0, 0, 0.1)",disabled:"rgba(0, 0, 0, 0.26)"}}),sr=s.createTheme({name:"lightOrange",palette:{mode:"light",background:{default:"#ffffff",mainCenter:"#fff3e0",mainGradient:"linear-gradient(270deg, #c66900, #ff9800)",navMenu:"#f8bbd0",dropdownMenu:"#f5f5f5",panel:"#ffffff",tooltip:"#ff9800",accordionHeader:"#F3F4F6",panelHeader:"#F3F4F6",panelCenter:"#ffffff",paper:"#ffffff"},primary:{main:"#ff9800",light:"#ffc947",dark:"#c66900",contrastText:"#fff"},secondary:{main:"#ff9800",light:"#ba68c8",dark:"#7b1fa2",contrastText:"rgba(0, 0, 0, 0.87)"},error:{main:"#d32f2f",light:"#ef5350",dark:"#c62828"},warning:{main:"#ed6c02",light:"#ff9800",dark:"#e65100"},info:{main:"#0288d1",light:"#03a9f4",dark:"#01579b"},success:{main:"#2e7d32",light:"#4caf50",dark:"#1b5e20"},containerBox:{default:"#ffffff",main:"#f5f5f5"},action:{active:"rgba(0, 0, 0, 0.10)",hover:"rgba(0, 0, 0, 0.05)",selected:"#fff3e0",disabled:"rgba(0, 0, 0, 0.26)",disabledBackground:"rgba(255, 255, 255, 0.12)"},text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.6)",disabled:"rgba(0, 0, 0, 0.58)",colorMain:"#ff9800"},divider:"rgba(0, 0, 0, 0.12)",dropdownBox:"#ffffff",color:{icons:"#ff9800"},cellHeader:"#d3d3d3",Skeleton:{bg:"#f5f5f5"},messageBox:"#d3e6fd",boxShadow:"rgba(0, 0, 0, 0.1)",disabled:"rgba(0, 0, 0, 0.26)"}}),or=s.createTheme({name:"lightBrown",palette:{mode:"light",background:{default:"#ffffff",mainCenter:"#efebe9",mainGradient:"linear-gradient(270deg, #4b2c20, #795548)",navMenu:"#f8bbd0",dropdownMenu:"#f5f5f5",panel:"#ffffff",tooltip:"#795548",accordionHeader:"#F3F4F6",panelHeader:"#F3F4F6",panelCenter:"#ffffff",paper:"#ffffff"},primary:{main:"#795548",light:"#a98274",dark:"#4b2c20",contrastText:"#fff"},secondary:{main:"#795548",light:"#ba68c8",dark:"#7b1fa2",contrastText:"rgba(0, 0, 0, 0.87)"},error:{main:"#d32f2f",light:"#ef5350",dark:"#c62828"},warning:{main:"#ed6c02",light:"#ff9800",dark:"#e65100"},info:{main:"#0288d1",light:"#03a9f4",dark:"#01579b"},success:{main:"#2e7d32",light:"#4caf50",dark:"#1b5e20"},containerBox:{default:"#ffffff",main:"#f5f5f5"},action:{active:"rgba(0, 0, 0, 0.10)",hover:"rgba(0, 0, 0, 0.05)",selected:"#efebe9",disabled:"rgba(0, 0, 0, 0.26)",disabledBackground:"rgba(255, 255, 255, 0.12)"},text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.6)",disabled:"rgba(0, 0, 0, 0.58)",colorMain:"#795548"},divider:"rgba(0, 0, 0, 0.12)",dropdownBox:"#ffffff",color:{icons:"#795548"},cellHeader:"#d3d3d3",Skeleton:{bg:"#f5f5f5"},messageBox:"#d3e6fd",boxShadow:"rgba(0, 0, 0, 0.1)",disabled:"rgba(0, 0, 0, 0.26)"}}),ir=s.createTheme({name:"lightGray",palette:{mode:"light",background:{default:"#ffffff",mainCenter:"#fafafa",mainGradient:"linear-gradient(270deg, #707070, #9e9e9e)",navMenu:"#f8bbd0",dropdownMenu:"#f5f5f5",panel:"#ffffff",tooltip:"#9e9e9e",accordionHeader:"#F3F4F6",panelHeader:"#F3F4F6",panelCenter:"#ffffff",paper:"#ffffff"},primary:{main:"#9e9e9e",light:"#cfcfcf",dark:"#707070",contrastText:"#fff"},secondary:{main:"#9e9e9e",light:"#ba68c8",dark:"#7b1fa2",contrastText:"rgba(0, 0, 0, 0.87)"},error:{main:"#d32f2f",light:"#ef5350",dark:"#c62828"},warning:{main:"#ed6c02",light:"#ff9800",dark:"#e65100"},info:{main:"#0288d1",light:"#03a9f4",dark:"#01579b"},success:{main:"#2e7d32",light:"#4caf50",dark:"#1b5e20"},containerBox:{default:"#ffffff",main:"#f5f5f5"},action:{active:"rgba(0, 0, 0, 0.10)",hover:"rgba(0, 0, 0, 0.05)",selected:"#fafafa",disabled:"rgba(0, 0, 0, 0.26)",disabledBackground:"rgba(255, 255, 255, 0.12)"},text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.6)",disabled:"rgba(0, 0, 0, 0.58)",colorMain:"#9e9e9e"},divider:"rgba(0, 0, 0, 0.12)",dropdownBox:"#ffffff",color:{icons:"#9e9e9e"},cellHeader:"#d3d3d3",Skeleton:{bg:"#f5f5f5"},messageBox:"#d3e6fd",boxShadow:"rgba(0, 0, 0, 0.1)",disabled:"rgba(0, 0, 0, 0.26)"}}),lr=s.createTheme({name:"darkBlue",palette:{mode:"dark",primary:{main:"#1f5c8e",light:"#2196f3",dark:"#0d47a1",contrastText:"#fff"},secondary:{light:"#FFEA41",main:"#90caf9",dark:"#DBBE01",contrastText:"rgba(0, 0, 0, 0.87)"},error:{main:"#f44336",light:"#e57373",dark:"#d32f2f"},warning:{main:"#ffa726",light:"#ffb74d",dark:"#f57c00"},info:{main:"#29b6f6",light:"#4fc3f7",dark:"#0288d1"},success:{main:"#66bb6a",light:"#81c784",dark:"#388e3c"},background:{default:"#222B45",mainGradient:"linear-gradient(270deg, #222B45, #222B45)",mainCenter:"#28324e",navMenu:"#222B45",panel:"#2d364e",dropdownMenu:"#484f65",tooltip:"#484f65",accordionHeader:"#2a3249e3",panelHeader:"#2a3249e3",panelCenter:"#484f65",paper:"#2d364e"},containerBox:{default:"#2d354e",main:"#2d354e"},action:{active:"rgba(255, 255, 255, 0.2)",hover:"rgba(255, 255, 255, 0.08)",selected:"rgba(255, 255, 255, 0.16)",disabled:"rgba(255, 255, 255, 0.3)",disabledBackground:"rgba(255, 255, 255, 0.12)"},text:{primary:"#EEEEEF",secondary:"#AEB0B4",disabled:"rgba(255, 255, 255, 0.5)",colorMain:"#EEEEEF"},divider:"rgba(255, 255, 255, 0.12)",dropdownBox:"#2d354e",color:{icons:"#fff"},cellHeader:"#505050",Skeleton:{bg:"#f5f5f5"},messageBox:"#1f5c8e",boxShadow:"rgba(0, 0, 0, 0.1)",disabled:"rgba(0, 0, 0, 0.26)"}}),dr=s.createTheme({name:"darkBlack",palette:{mode:"dark",background:{default:"#201f1e",mainGradient:"linear-gradient(270deg, #201f1e, #201f1e)",mainCenter:"#252423",navMenu:"#201f1e",panel:"#3B3A39",dropdownMenu:"#585858",tooltip:"#616161eb",accordionHeader:"#25242369",panelHeader:"#3b3a39ba",panelCenter:"#585858",paper:"#3B3A39"},primary:{main:"#1976d2",light:"#2196f3",dark:"#42a5f5",contrastText:"#fff"},secondary:{light:"#FFEA41",main:"#90caf9",dark:"#DBBE01",contrastText:"rgba(0, 0, 0, 0.87)"},error:{main:"#f44336",light:"#e57373",dark:"#d32f2f"},warning:{main:"#ffa726",light:"#ffb74d",dark:"#f57c00"},info:{main:"#29b6f6",light:"#4fc3f7",dark:"#0288d1"},success:{main:"#66bb6a",light:"#81c784",dark:"#388e3c"},containerBox:{main:"#ffffffb3",default:"#3B3A39"},action:{active:"rgba(255, 255, 255, 0.2)",hover:"rgba(255, 255, 255, 0.08)",selected:"rgba(255, 255, 255, 0.16)",disabled:"rgba(255, 255, 255, 0.3)",disabledBackground:"rgba(255, 255, 255, 0.12)"},text:{primary:"#EEEEEF",secondary:"#AEB0B4",disabled:"rgba(255, 255, 255, 0.5)",colorMain:"#EEEEEF"},divider:"rgba(255, 255, 255, 0.12)",dropdownBox:"#3B3A39",color:{icons:"#fff"},cellHeader:"#505050",Skeleton:{bg:"#f5f5f5"},messageBox:"#1f5c8e",boxShadow:"rgba(0, 0, 0, 0.1)",disabled:"rgba(0, 0, 0, 0.26)"}}),Rd="https://agent-api.trii.app/api/v1/settings/user/setTheme",Nd={themeSelected:la,darkMode:!1,toggleStatus:"idle"},cr=qa.createAsyncThunk("Theme/updateTheme",async(e,{getState:a})=>{const{uid:n}=a().User.user,r=JSON.stringify({theme:e,uid:n});return(await Ur.put(Rd,r)).data}),ur=qa.createSlice({name:"Theme",initialState:Nd,reducers:{toggleTheme:(e,a)=>{const n=pr(a.payload);Object.assign(e,{themeSelected:n,toggleStatus:"toggled"})},toggleModeTheme:e=>{e.darkMode=!e.darkMode}},extraReducers:e=>{e.addCase(cr.fulfilled,(a,n)=>{const r=pr(n.payload.theme);Object.assign(a,{themeSelected:r})})}}),pr=e=>{switch(e){case"lightBlueIndigo":return la;case"darkBlack":return dr;case"darkBlue":return lr;case"lightAmber":return rr;case"lightBlue":return Jn;case"lightBrown":return or;case"lightGray":return ir;case"lightGreen":return Xn;case"lightLime":return ar;case"lightOrange":return sr;case"lightPink":return Zn;case"lightPurple":return er;case"lightRed":return Qn;case"lightTeal":return tr;case"lightYellow":return nr;default:return la}},Ld=e=>["lightBlueIndigo","darkBlack","darkBlue","lightAmber","lightBlue","lightBrown","lightGray","lightGreen","lightLime","lightOrange","lightPink","lightPurple","lightRed","lightTeal","lightYellow"].includes(e),{toggleTheme:Od,toggleModeTheme:zd}=ur.actions,Wd=e=>e.Theme.toggleStatus,_d=e=>e.Theme.themeSelected,Vd=e=>e.Theme.darkMode;ur.reducer,exports.ContactInfoPopup=en,exports.EditContactModal=gl,exports.EventsDialog=Ud,exports.MuiComponentsConfig=Kn,exports.darkBlack=dr,exports.darkBlue=lr,exports.i18n=It,exports.isValidThemeName=Ld,exports.lightAmber=rr,exports.lightBlue=Jn,exports.lightBlueIndigo=la,exports.lightBrown=or,exports.lightGray=ir,exports.lightGreen=Xn,exports.lightLime=ar,exports.lightOrange=sr,exports.lightPink=Zn,exports.lightPurple=er,exports.lightRed=Qn,exports.lightTeal=tr,exports.lightYellow=nr,exports.selectThemeToggleStatus=Wd,exports.selectedDarkTheme=Vd,exports.selectedTheme=_d,exports.toggleModeTheme=zd,exports.toggleTheme=Od,exports.updateTheme=cr;
20
+ `,gd=s.styled(s.Box)(()=>({display:"flex",justifyContent:"space-between",alignItems:"baseline",userSelect:"none"})),md=({notificationsField:e,disabled:a})=>{const n=Me(),{addNotification:r,deleteNotification:i,handleReminderChange:o,handleTimeFieldChange:d,handleTimePeriodChange:c}=e.action,u=e.notifications.length>0;return t.jsxs(fd,{children:[t.jsxs(gd,{children:[t.jsx(s.Typography,{variant:"subtitle2",sx:{userSelect:"none"},children:n("calendarView.reminders.title")}),!a&&t.jsx(s.Button,{disabled:a,startIcon:t.jsx(Ha,{}),size:"small",variant:"outlined",onClick:r,color:"secondary",children:n("calendarView.reminders.addReminder")})]}),t.jsx(s.Box,{sx:{pt:1,px:.5},children:u?e.notifications.map(g=>t.jsx(pd,{data:g,deleteHandler:i,sendToContactHandler:o,timePeriodHandler:c,timeValueHandler:d},g.id)):a?t.jsx(s.Typography,{variant:"body1",sx:{py:.5},children:"-"}):null})]})},zn=({descriptionField:e,disabled:a})=>{const n=Me(),{value:r,type:i,...o}=e.attributes,d=r||"";return a?t.jsx(ze,{title:n("global.description"),children:t.jsx(s.Typography,{variant:"body2",sx:{py:.5,whiteSpace:"pre-wrap",color:c=>c.palette.text.secondary,fontSize:"0.9rem"},children:d||"-"})}):t.jsx(ze,{title:n("global.description"),children:t.jsx(s.TextField,{...o,value:d,disabled:a,size:"small",multiline:!0,maxRows:5,fullWidth:!0,variant:"outlined"})})},hd=({onPlaceSelected:e})=>{const a=l.useRef(null),n=l.useRef(null),r=l.useRef(null),i=l.useRef(null),[o,d]=l.useState([]),[c,u]=l.useState(!1),g=Me();l.useEffect(()=>{if(!a.current)return;const m=()=>{if(!window.google?.maps?.places)return console.warn("Google Places API no est\xE1 disponible a\xFAn"),!1;n.current=new window.google.maps.places.AutocompleteService;const p=document.createElement("div");return r.current=new window.google.maps.places.PlacesService(p),i.current=new window.google.maps.places.AutocompleteSessionToken,!0};if(!m()){const p=setTimeout(()=>{m()},500);return()=>clearTimeout(p)}},[]);const b=m=>{const p=m.target.value;if(!p||p.length<3||!n.current){d([]),u(!1);return}n.current.getPlacePredictions({input:p,types:["geocode"],sessionToken:i.current||void 0},(x,S)=>{S===window.google.maps.places.PlacesServiceStatus.OK&&x?(d(x),u(!0)):(d([]),u(!1))})},h=(m,p)=>{r.current&&r.current.getDetails({placeId:m,fields:["geometry","formatted_address"],sessionToken:i.current||void 0},(x,S)=>{if(S===window.google.maps.places.PlacesServiceStatus.OK&&x?.geometry?.location){const v=x.geometry.location.lat(),T=x.geometry.location.lng(),C=x.formatted_address??p;e({lat:v,lng:T},C),a.current&&(a.current.value=C),u(!1),d([]),i.current=new window.google.maps.places.AutocompleteSessionToken}})};return l.useEffect(()=>{const m=p=>{a.current&&!a.current.contains(p.target)&&u(!1)};return document.addEventListener("mousedown",m),()=>document.removeEventListener("mousedown",m)},[]),t.jsxs("div",{style:{position:"absolute",width:"100%",maxWidth:300,margin:"0 auto",zIndex:13e3,top:"10px",left:"10px"},children:[t.jsx("input",{ref:a,placeholder:g("global.searchLocation","Buscar en Google Maps"),onChange:b,onFocus:()=>o.length>0&&u(!0),style:{width:"100%",padding:"12px 16px 5px",borderRadius:"24px",border:"1px solid #ccc",backgroundColor:"white",fontSize:"15px",boxShadow:"0 1px 4px rgba(0,0,0,0.3)",outline:"none",position:"relative",zIndex:13e3}}),c&&o.length>0&&t.jsx("div",{style:{position:"absolute",top:"100%",left:0,right:0,backgroundColor:"white",borderRadius:"8px",boxShadow:"0 2px 8px rgba(0,0,0,0.15)",marginTop:"4px",maxHeight:"300px",overflowY:"auto",zIndex:13001},children:o.map(m=>t.jsxs("div",{onClick:()=>h(m.place_id,m.description),style:{padding:"12px 16px",cursor:"pointer",borderBottom:"1px solid #f0f0f0",fontSize:"14px",transition:"background-color 0.2s"},onMouseEnter:p=>{p.currentTarget.style.backgroundColor="#f5f5f5"},onMouseLeave:p=>{p.currentTarget.style.backgroundColor="white"},children:[t.jsx("div",{style:{fontWeight:500},children:m.structured_formatting.main_text}),t.jsx("div",{style:{fontSize:"12px",color:"#666",marginTop:"2px"},children:m.structured_formatting.secondary_text})]},m.place_id))})]})},Wn="AIzaSyAQ1bUt3y6UoAhbi5-HAwYwaFx71pAiaKU",_n=["places"],Na={apiKey:Wn,libraries:_n,loading:"async"},ia=()=>!!(window.google?.maps?.Map&&window.google?.maps?.Marker&&window.google?.maps?.Geocoder&&window.google?.maps?.places),Vn=(e=Wn,a=_n)=>{if(ia())return Promise.resolve();const n=()=>{document.querySelectorAll('script[src*="maps.googleapis.com"]').forEach(r=>{r.parentNode?.removeChild(r)})};return document.getElementById("google-maps-script")?new Promise((r,i)=>{let o=0;const d=100,c=setInterval(()=>{o++,ia()?(clearInterval(c),r()):o>=d&&(clearInterval(c),n(),Vn(e,a).then(r).catch(i))},100)}):new Promise((r,i)=>{try{n();const o="initGoogleMaps";window[o]=()=>{ia()?r():setTimeout(()=>{ia()||console.warn("Google Maps API se carg\xF3 pero algunos componentes no est\xE1n disponibles"),r()},500)};const d=document.createElement("script");d.id="google-maps-script",d.type="text/javascript";const c=Array.isArray(a)?a.join(","):a;d.src=`https://maps.googleapis.com/maps/api/js?key=${e}&libraries=${c}&callback=${o}&loading=async`,d.async=!0,d.defer=!0,d.onerror=()=>{delete window[o],i(new Error("Error al cargar Google Maps API"))},document.head.appendChild(d)}catch(o){i(o)}})},Ut=(e,a,n=18,r=400,i=400,o="red",d=Na.apiKey)=>`https://maps.googleapis.com/maps/api/staticmap?center=${e},${a}&zoom=${n}&size=${r}x${i}&markers=color:${o}%7Clabel:A%7C${e},${a}&key=${d}`,yd=({onLocationChange:e,initialLocation:a})=>{const n=l.useRef(null),r=l.useRef(null),i=l.useRef(null),o=l.useRef(null),[d,c]=l.useState(!0),[u,g]=l.useState(!1),[b,h]=l.useState(a||null),m=18,p=l.useCallback(C=>{h(C),e(C)},[e]);l.useEffect(()=>{let C=!0;(async()=>{try{if(await Vn(Na.apiKey,Na.libraries),!window.google?.maps?.Map||!window.google?.maps?.Geocoder){console.error("Google Maps APIs no est\xE1n completamente disponibles"),c(!1);return}window.google?.maps?.Geocoder&&(o.current=new window.google.maps.Geocoder),c(!1)}catch(w){console.error("Error al cargar Google Maps:",w),c(!1)}})(),a||navigator.geolocation.getCurrentPosition(w=>{const j=w.coords.latitude,W=w.coords.longitude,E=j.toString(),B=W.toString(),A=Ut(j,W,m);p({lat:E,lng:B,title:"",description:"",url:A})},w=>{console.error("Error getting location:",w);const j=-34.6037,W=-58.3816;p({lat:j.toString(),lng:W.toString(),title:"",description:"",url:Ut(j,W,m)})})},[a,p,m]),l.useEffect(()=>{if(d||r.current)return;const C=setTimeout(()=>{r.current||x()},50);return()=>clearTimeout(C)},[d]),l.useEffect(()=>{u&&b&&v()},[u,b]),l.useEffect(()=>()=>{i.current&&(i.current.setMap(null),i.current=null)},[]);const x=()=>{if(!n.current){console.warn("Contenedor del mapa no disponible");return}if(!window.google?.maps){console.warn("Google Maps API no disponible a\xFAn");return}try{const C={zoom:m,disableDefaultUI:!1,zoomControl:!0,mapTypeControl:!1,streetViewControl:!1,fullscreenControl:!1};r.current=new window.google.maps.Map(n.current,C),r.current.addListener("click",w=>{S(w)}),g(!0)}catch(C){console.error("Error inicializando mapa:",C)}},S=C=>{if(!C.latLng||!o.current)return;const w={lat:C.latLng.lat(),lng:C.latLng.lng()};i.current?i.current.setPosition(w):r.current&&(i.current=new window.google.maps.Marker({position:w,map:r.current})),o.current.geocode({location:w},(j,W)=>{if(W==="OK"&&j&&j[0]){const E=j[0].formatted_address,B=Ut(w.lat,w.lng,m);p({lat:w.lat.toString(),lng:w.lng.toString(),title:E||"",description:"",url:B})}else{const E=Ut(w.lat,w.lng,m);p({lat:w.lat.toString(),lng:w.lng.toString(),title:`${w.lat.toFixed(6)}, ${w.lng.toFixed(6)}`,description:"",url:E})}})},v=()=>{if(!(!r.current||!b))try{const C={lat:parseFloat(b.lat),lng:parseFloat(b.lng)};r.current.setCenter(C),i.current?i.current.setPosition(C):i.current=new window.google.maps.Marker({position:C,map:r.current})}catch(C){console.error("Error actualizando mapa:",C)}},T=(C,w)=>{const j=Ut(C.lat,C.lng,m);p({lat:C.lat.toString(),lng:C.lng.toString(),title:w||"",description:"",url:j})};return d?t.jsx(s.Box,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"100vh"},children:t.jsx(s.CircularProgress,{})}):t.jsxs(s.Box,{sx:{position:"relative",height:"calc(100vh - 305px)"},children:[t.jsx(hd,{onPlaceSelected:T}),t.jsx("div",{style:{height:"100%"},ref:n})]})},bd=({open:e,onClose:a,onSelectLocation:n,initialAddress:r})=>{const i=Me(),[o,d]=l.useState(null),c=l.useRef(null);l.useEffect(()=>{e||d(null)},[e]),l.useEffect(()=>{c.current&&o&&(c.current.scrollTop=c.current.scrollHeight/4)},[o]);const u=l.useCallback(b=>{d(b)},[]),g=l.useCallback(()=>{o&&(n(o.title||`${o.lat}, ${o.lng}`,o.lat,o.lng),a())},[o,n,a]);return t.jsxs(s.Dialog,{open:e,onClose:a,maxWidth:"md",fullWidth:!0,disableEnforceFocus:!0,disableAutoFocus:!0,PaperProps:{sx:{maxHeight:"80vh",height:"80vh"}},sx:{"& .MuiDialog-paper":{backgroundColor:b=>b.palette.background.panel}},children:[t.jsxs(s.Box,{sx:{position:"relative",display:"flex",alignItems:"center",p:2},children:[t.jsx(s.Typography,{variant:"body1",sx:{flex:1},children:i("global.selectLocation","Seleccionar ubicaci\xF3n")}),t.jsx(s.IconButton,{"aria-label":"close",onClick:a,size:"small",children:t.jsx(za,{fontSize:"small"})})]}),t.jsx(s.DialogContent,{sx:{p:0,display:"flex",flexDirection:"column",height:"100%"},children:t.jsxs(s.Box,{sx:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",overflow:"hidden",width:"100%",height:"100%",position:"relative"},children:[t.jsx(s.Box,{ref:c,sx:{width:"100%",flex:1,overflow:"auto",zIndex:1},children:t.jsx(yd,{onLocationChange:u,initialLocation:void 0})}),t.jsx(s.Divider,{sx:{width:"100%",padding:0}}),t.jsxs(s.Box,{sx:{width:"100%",display:"flex",justifyContent:"flex-end",gap:".5rem",p:2},children:[t.jsx(s.Button,{variant:"outlined",color:"error",size:"small",sx:{borderRadius:"0.5rem"},onClick:a,children:i("global.cancel","Cancelar")}),t.jsx(s.Button,{variant:"outlined",color:"secondary",size:"small",sx:{borderRadius:"0.5rem"},onClick:g,disabled:!o,children:i("global.selectLocation","Seleccionar ubicaci\xF3n")})]})]})})]})},xd=({locationField:e,disabled:a})=>{const n=Me(),[r,i]=l.useState(!1),{value:o,type:d,...c}=e.attributes,u=o||"",g=()=>{a||i(!0)},b=()=>{i(!1)},h=m=>{e.actions.changeValue(m)};return a?t.jsx(s.Box,{children:t.jsx(ze,{title:n("global.location","Ubicaci\xF3n"),children:t.jsxs(s.Box,{sx:{display:"flex",alignItems:"center",gap:1,py:.5},children:[u&&t.jsx(Ya,{sx:{opacity:.5},fontSize:"small"}),t.jsx(s.Typography,{variant:"body1",sx:{color:m=>m.palette.text.secondary,fontSize:"0.9rem"},children:u||"-"})]})})}):t.jsxs(s.Box,{children:[t.jsx(ze,{title:n("global.location","Ubicaci\xF3n"),children:t.jsx(s.TextField,{...c,value:u,disabled:a,size:"small",fullWidth:!0,variant:"outlined",placeholder:n("global.addLocation","Agregar ubicaci\xF3n"),onClick:g,InputProps:{startAdornment:t.jsx(Ya,{sx:{mr:1,opacity:.5},fontSize:"small"}),readOnly:!0},sx:{cursor:a?"default":"pointer","& .MuiInputBase-input":{cursor:a?"default":"pointer"}}})}),t.jsx(bd,{open:r,onClose:b,onSelectLocation:h,initialAddress:u})]})},vd=({handleScroll:e,contactList:a,handleSelectContact:n,selectedContactIds:r,search:i})=>{const o=Me(),d=s.useTheme();return t.jsx(s.List,{sx:{width:"100%",height:"100%",overflow:"auto",border:`1px solid ${d.palette.divider}`,borderTop:"none",backgroundColor:d.palette.background.panel,backgroundImage:"linear-gradient(rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.12))"},onScroll:e,children:i&&a?.map(c=>t.jsxs(s.ListItemButton,{sx:{width:"100%"},onClick:()=>n(c),selected:r.includes(c.id),children:[t.jsx(s.ListItemIcon,{children:t.jsx(Be.Person,{sx:{color:u=>u.palette.text.disabled}})}),t.jsx(s.ListItemText,{primary:o(c.name),secondary:c?.phone})]},c.id))})},Cd={format:"IContact",total:0,lastPage:1,perPage:10,order:"ASC",orderColumn:"Id"};function Sd(e){const a=l.useRef(null),n=l.useRef(null),[r,i]=l.useState([]),[o,d]=l.useState(!1),[c,u]=l.useState(!1),[g,b]=l.useState(!1),[h,m]=l.useState(!1),[p,x]=l.useState(1),[S,v]=l.useState(!1),T=l.useCallback(()=>{n.current?.abort(),n.current=null,a.current&&(clearTimeout(a.current),a.current=null),d(!1),v(!1),x(1),m(!1),i([])},[]),C=E=>E.filter(B=>!!B?.id),w=l.useCallback(async({query:E,page:B})=>{if(!e)return;n.current?.abort();const A=new AbortController;n.current=A,u(!0);try{const I={...Cd,currentPage:B,filter:[{value:E,column:"name",condition:""}]},O=await ad({baseUrl:e.baseUrl,spaceId:e.spaceId,pagination:I,signal:A.signal});if(A.signal.aborted)return;const V=C(O?.contactos??[]);d(!0);const _=O?.paginacion?.total??0;i(Y=>{const $=B===1?V:(()=>{const Z=new Map;for(const q of Y)Z.set(q.id,q);for(const q of V)Z.set(q.id,q);return Array.from(Z.values())})();return _&&$.length>=_&&v(!0),$})}finally{u(!1),b(!1),m(!1)}},[e]),j=l.useCallback(E=>{T(),E&&(a.current&&(clearTimeout(a.current),a.current=null),b(!0),a.current=setTimeout(()=>{w({query:E,page:1})},800))},[w,T]),W=l.useCallback((E,B)=>{const A=E.target;if(!(A.scrollHeight-A.scrollTop-A.clientHeight<1)||S||c||!B)return;const I=p+1;m(!0),x(I),w({query:B,page:I})},[S,c,p,w]);return{contactList:r,hasSearched:o,isLoading:c,isLoadingTimer:g,isNextPage:h,handleQueryChanged:j,handleScroll:W,resetSearchState:T}}const Hn=({linkContactsHandler:e,disabled:a=!1})=>{const n=Me(),r=Bn(),i=l.useRef(null),[o,d]=l.useState(null),{action:{handleSearchChange:c,handleSelectContact:u,handleRemoveContact:g},state:{search:b,selectedContacts:h}}=e,{contactList:m,hasSearched:p,isLoading:x,isLoadingTimer:S,handleQueryChanged:v,handleScroll:T,resetSearchState:C}=Sd(r),w=b||"",j=!!o&&w.length>0&&!a,W=h.map(I=>I.id);l.useEffect(()=>{w?v(w):C()},[w,v,C]);const E=I=>{c(I),I&&!o?d(i.current):I||d(null)},B=I=>{u(I),d(null),C()},A=()=>{d(null)};return a?t.jsx(ze,{title:n("global.linkContacts"),children:h.length>0?t.jsx(s.Box,{sx:{display:"flex",flexWrap:"wrap",gap:.5,pt:.5},children:h.map(I=>t.jsx(s.Chip,{icon:t.jsx(va,{fontSize:"small"}),label:I.name,size:"small",variant:"outlined"},I.id))}):t.jsx(s.Typography,{variant:"body1",sx:{py:.5},children:"-"})}):t.jsx(s.ClickAwayListener,{onClickAway:A,children:t.jsxs(s.Box,{children:[t.jsxs(ze,{title:n("global.linkContacts"),children:[t.jsx(s.TextField,{ref:i,fullWidth:!0,size:"small",placeholder:n("global.searchContacts"),value:w,onChange:I=>E(I.target.value),onFocus:()=>{w&&d(i.current)},InputProps:{startAdornment:t.jsx(va,{sx:{mr:1,opacity:.5},fontSize:"small"}),endAdornment:x||S?t.jsx(s.CircularProgress,{size:18,sx:{mr:1}}):null}}),h.length>0&&t.jsx(s.Box,{sx:{display:"flex",flexWrap:"wrap",gap:.5,mt:1},children:h.map(I=>t.jsx(s.Chip,{icon:t.jsx(va,{fontSize:"small"}),label:I.name,size:"small",onDelete:()=>g(I.id)},I.id))})]}),t.jsx(s.Popper,{open:j,anchorEl:o,placement:"bottom-start",style:{width:o?.offsetWidth||"auto",zIndex:1300},children:t.jsxs(s.Paper,{elevation:8,sx:{mt:.5,maxHeight:300,overflow:"hidden"},children:[p&&m.length>0&&t.jsx(vd,{handleScroll:I=>T(I,w),contactList:m,handleSelectContact:B,selectedContactIds:W,search:w}),p&&m.length===0&&t.jsx(s.Box,{sx:{p:2,textAlign:"center",color:"text.secondary"},children:t.jsx(s.Typography,{variant:"body2",children:n("global.noResults","No se encontraron resultados")})})]})})]})})},jd=({isFinalized:e})=>{const{eventDialog:{handleClose:a},handleCreateEvent:n,dialogMode:r,handleStartEditingEvent:i,handleSaveUpdatedEvent:o,handleEndEvent:d,dialogType:c,handleCreateTask:u,handleSaveUpdatedTask:g,selectedTask:b,handleToggleTaskCompleted:h}=l.useContext(Ba),m=Me(),p=c==="event",x=!1,S=!1,v=!1,T=()=>{p?n():u()},C=(()=>{if(r==="view")return i;if(r==="edit")return p?()=>o?.():()=>g?.();if(r==="create")return T})(),w=m(r==="view"?p?"global.editEvent":"global.editTask":r==="edit"?p?"global.saveEvent":"global.saveTask":p?"global.createEvent":"global.createTask"),j=p?x:v,W=e,E=!p&&r==="view",B=b?.isCompleted||!1;return E?t.jsx(s.DialogActions,{children:t.jsx(Ze.LoadingButton,{startIcon:t.jsx(Be.CheckCircleOutline,{}),size:"small",loading:v,disabled:v,onClick:h,variant:"contained",color:B?"inherit":"primary",children:B?m("global.markAsIncomplete","Marcar como incompleta"):m("global.markAsCompleted","Marcar como completada")})}):t.jsxs(s.DialogActions,{children:[t.jsx(s.Button,{variant:"outlined",size:"small",onClick:a,color:"secondary",children:m("global.cancel")}),p&&(r==="edit"||r==="view")&&t.jsx(Ze.LoadingButton,{startIcon:t.jsx(Be.EventAvailable,{}),size:"small",disabled:e,loading:S,onClick:d,variant:"contained",children:m("global.finalizeEvent")}),t.jsx(Ze.LoadingButton,{startIcon:t.jsx(Be.EditCalendar,{}),size:"small",loading:j,disabled:W,onClick:C,variant:"contained",children:w})]})},Gn={textTransform:"none",borderRadius:2,minHeight:34,px:1.5,fontSize:13,fontWeight:500,lineHeight:1.1},wd=({value:e,onChange:a,labels:n})=>t.jsxs(s.Box,{sx:{display:"flex",gap:1},children:[t.jsx(s.Button,{size:"small",onClick:()=>a("event"),variant:e==="event"?"contained":"text",disableElevation:!0,color:"primary",sx:{...Gn},children:n.event}),t.jsx(s.Button,{size:"small",onClick:()=>a("task"),variant:e==="task"?"contained":"text",disableElevation:!0,sx:{...Gn},color:"primary",children:n.task})]}),Td="DD/MM/YYYY",kd="HH:mm",Id=({selectedDateTime:e,handleSelect:a,disabled:n,isError:r=!1,hideLabel:i=!1})=>{const o=Me(),d=u=>{if(!u)return;const g=u.hour(e.hour()).minute(e.minute());a(g)},c=u=>{if(!u)return;const g=e.hour(u.hour()).minute(u.minute());a(g)};return n?t.jsxs(sa,{children:[!i&&t.jsx("span",{style:{userSelect:"none",marginBottom:10},children:o("global.date")}),t.jsxs(s.Box,{children:[t.jsx(s.Typography,{variant:"body1",sx:{mb:1},children:e.format(Td)}),t.jsx(s.Typography,{variant:"body1",children:e.format(kd)})]})]}):t.jsxs(sa,{children:[!i&&t.jsx("span",{style:{userSelect:"none",marginBottom:10},children:o("global.date")}),t.jsx(Pa,{children:t.jsxs(Ye.LocalizationProvider,{dateAdapter:Ga.AdapterDayjs,children:[t.jsx(Ye.DatePicker,{disabled:n,value:e,onChange:d,slotProps:{textField:()=>({label:o("global.date"),size:"small",className:"smallInput"}),popper:{sx:{"& .MuiPaper-root":{backgroundColor:u=>u.palette.background.panel}}}},sx:{alignSelf:"baseline",flex:1},minDate:J()}),t.jsx(Ua,{variant:"body1",children:"_"}),t.jsx(Ye.TimePicker,{disabled:n,value:e,onChange:c,ampm:!1,slotProps:{textField:()=>({label:o("global.time"),size:"small",className:"smallInput"}),popper:{sx:{"& .MuiPaper-root":{backgroundColor:u=>u.palette.background.panel}}}},sx:{alignSelf:"baseline",flex:1}})]})}),t.jsx(s.Fade,{in:r,children:t.jsx(s.Typography,{color:"red",variant:"caption",children:o("conversations.sidebar.events.errorDate")})})]})},Yn=({disabled:e,calendars:a,userId:n,value:r,onChange:i})=>{const o=Me(),d=l.useMemo(()=>a??[],[a]),c=l.useMemo(()=>d.find(u=>u.id===r)??null,[d,r]);return e?t.jsx(ze,{title:o("global.calendar"),children:t.jsxs(s.Box,{sx:{display:"flex",alignItems:"center",gap:1,py:.5},children:[c&&t.jsx(Br,{sx:{opacity:.5,color:u=>u.palette.text.secondary},fontSize:"small"}),t.jsx(s.Typography,{variant:"subtitle2",sx:{color:u=>u.palette.text.secondary,fontSize:"0.9rem"},children:c?.title||"-"})]})}):t.jsx(ze,{title:o("global.calendar"),children:t.jsx(s.Autocomplete,{disabled:e,size:"small",fullWidth:!0,options:d,value:c,onChange:(u,g)=>i(g?.id??""),getOptionLabel:u=>u?.title??"",isOptionEqualToValue:(u,g)=>u.id===g.id,groupBy:n?u=>u.userId===n?o("calendarView.myCalendars"):o("calendarView.othersCalendars"):void 0,renderGroup:u=>t.jsxs("li",{children:[t.jsx(s.ListSubheader,{component:"div",sx:{lineHeight:"32px",fontSize:"0.75rem",fontWeight:600,color:"text.secondary",backgroundColor:g=>g.palette.background.panel},children:u.group}),t.jsx("ul",{style:{padding:0},children:u.children})]},u.key),slotProps:{popper:{sx:{zIndex:1400}},paper:{sx:{backgroundColor:u=>u.palette.background.panel}}},renderInput:u=>t.jsx(s.TextField,{...u,placeholder:o("global.selectCalendar")})})})},Ed=({checked:e,onChange:a,disabled:n})=>{const r=Me();return t.jsx(s.Box,{sx:{display:"flex",alignItems:"center"},children:t.jsx(s.FormControlLabel,{control:t.jsx(s.Checkbox,{checked:e,onChange:i=>a(i.target.checked),disabled:n,color:"secondary"}),label:r("global.allDay","Todo el d\xEDa")})})},Dd=({colorField:e,disabled:a,onColorChange:n})=>{const r=Me(),i=e.attributes.value||"#1976d2",o=(c=>{if(c.startsWith("#"))return c;const u=c.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)/);if(u&&u[1]&&u[2]&&u[3]){const g=parseInt(u[1]),b=parseInt(u[2]),h=parseInt(u[3]),m=p=>{const x=p.toString(16);return x.length===1?"0"+x:x};return`#${m(g)}${m(b)}${m(h)}`}return"#1976d2"})(i),d=c=>{const u=c.target.value;n?n(u):e.actions.changeValue(u)};return a?t.jsx(ze,{title:r("global.color","Color"),children:t.jsxs(s.Box,{sx:{display:"flex",gap:1,alignItems:"center"},children:[t.jsx(s.Box,{sx:{width:40,height:40,backgroundColor:o,border:"1px solid rgba(0, 0, 0, 0.23)",borderRadius:1}}),t.jsx(s.Typography,{variant:"body2",sx:{color:"text.secondary"},children:o})]})}):t.jsx(ze,{title:r("global.color","Color"),children:t.jsx(s.Box,{sx:{display:"flex",gap:1,alignItems:"center"},children:t.jsx("input",{type:"color",value:o,onChange:d,disabled:a,style:{width:60,height:40,border:"1px solid rgba(0, 0, 0, 0.23)",borderRadius:4,cursor:a?"not-allowed":"pointer"}})})})},qn=[{value:"",label:"global.noRepeat"},{value:"FREQ=DAILY",label:"global.everyDay"},{value:"FREQ=WEEKLY",label:"global.everyWeek"},{value:"FREQ=MONTHLY",label:"global.everyMonth"},{value:"FREQ=YEARLY",label:"global.everyYear"},{value:"FREQ=DAILY;INTERVAL=2",label:"global.everyTwoDays"},{value:"FREQ=WEEKLY;INTERVAL=2",label:"global.everyTwoWeeks"},{value:"FREQ=WEEKLY;BYDAY=MO,TU,WE,TH,FR",label:"global.everyWeekday"}],Ad=({value:e,onChange:a,disabled:n,hideLabel:r=!1})=>{const i=Me(),o=g=>{a(g.target.value)},d=l.useMemo(()=>qn.map(g=>t.jsx(s.MenuItem,{value:g.value,children:i(g.label,g.label)},g.value)),[i]),c=l.useMemo(()=>{const g=qn.find(b=>b.value===e);return g?i(g.label,g.label):i("global.noRepeat")},[e,i]);if(n)return r?t.jsxs(s.Box,{sx:{display:"flex",alignItems:"center",gap:1},children:[t.jsx(Ca,{sx:{opacity:.5},fontSize:"small"}),t.jsx(s.Typography,{variant:"body2",children:c})]}):t.jsx(ze,{title:i("global.recurrence","Recurrencia"),children:t.jsxs(s.Box,{sx:{display:"flex",alignItems:"center",gap:1,py:.5},children:[t.jsx(Ca,{sx:{opacity:.5},fontSize:"small"}),t.jsx(s.Typography,{variant:"body1",children:c})]})});const u=t.jsx(s.Select,{disabled:n,size:"small",variant:"outlined",fullWidth:!0,value:e||"",onChange:o,startAdornment:t.jsx(Ca,{sx:{mr:1,ml:1,opacity:.5},fontSize:"small"}),MenuProps:{PaperProps:{sx:{backgroundColor:g=>g.palette.background.panel}}},children:d});return r?u:t.jsx(ze,{title:i("global.recurrence","Recurrencia"),children:u})},Fd=({open:e,onClose:a,onConfirm:n,itemTitle:r,itemType:i})=>{const{t:o}=Ge.useTranslation(),d=()=>{n(),a()},c=i==="event"?o("calendar.deleteEvent","Eliminar evento"):o("calendar.deleteTask","Eliminar tarea"),u=i==="event"?o("calendar.confirmDeleteEvent","\xBFEst\xE1s seguro de que quer\xE9s eliminar este evento?"):o("calendar.confirmDeleteTask","\xBFEst\xE1s seguro de que quer\xE9s eliminar esta tarea?");return t.jsxs(s.Dialog,{open:e,onClose:a,maxWidth:"xs",fullWidth:!0,PaperProps:{sx:{backgroundColor:g=>g.palette.background.panel}},children:[t.jsxs(s.DialogTitle,{sx:{display:"flex",alignItems:"center",gap:1},children:[t.jsx($r,{color:"warning"}),c]}),t.jsxs(s.DialogContent,{children:[t.jsx(s.Typography,{variant:"body2",sx:{mb:2},children:u}),r&&t.jsx(s.Box,{sx:{p:1.5,bgcolor:"action.hover",borderRadius:1,borderLeft:3,borderColor:"warning.main"},children:t.jsxs(s.Typography,{variant:"body2",sx:{fontWeight:500},children:['"',r,'"']})})]}),t.jsxs(s.DialogActions,{sx:{px:3,pb:2},children:[t.jsx(s.Button,{onClick:a,variant:"outlined",color:"inherit",sx:{borderRadius:"8px"},children:o("global.cancel","Cancelar")}),t.jsx(s.Button,{onClick:d,variant:"contained",color:"error",sx:{borderRadius:"8px"},children:o("global.delete","Eliminar")})]})]})},Bd=({open:e,onClose:a,onConfirm:n,eventTitle:r})=>{const{t:i}=Ge.useTranslation(),[o,d]=l.useState("single"),c=()=>{n(o==="all"),a()},u=()=>{d("single"),a()};return t.jsxs(s.Dialog,{open:e,onClose:u,maxWidth:"xs",fullWidth:!0,PaperProps:{sx:{backgroundColor:g=>g.palette.background.panel}},children:[t.jsx(s.DialogTitle,{children:i("calendar.deleteRecurringEvent","Borrar evento recurrente")}),t.jsxs(s.DialogContent,{children:[r&&t.jsxs(s.Box,{sx:{mb:2,color:"text.secondary",fontSize:"0.875rem"},children:['"',r,'"']}),t.jsx(s.FormControl,{component:"fieldset",fullWidth:!0,children:t.jsxs(s.RadioGroup,{value:o,onChange:g=>d(g.target.value),children:[t.jsx(s.FormControlLabel,{value:"single",control:t.jsx(s.Radio,{color:"secondary"}),label:i("calendar.deleteThisEvent","Este evento"),sx:{mb:1}}),t.jsx(s.FormControlLabel,{value:"all",control:t.jsx(s.Radio,{color:"secondary"}),label:i("calendar.deleteAllEvents","Todos los eventos")})]})})]}),t.jsxs(s.DialogActions,{sx:{px:3,pb:2},children:[t.jsx(s.Button,{onClick:u,variant:"outlined",color:"inherit",sx:{borderRadius:"8px"},children:i("global.cancel","Cancelar")}),t.jsx(s.Button,{onClick:c,variant:"contained",color:"error",sx:{borderRadius:"8px"},children:i("global.delete","Eliminar")})]})]})},$d=({open:e,onClose:a,onConfirm:n,eventTitle:r})=>{const{t:i}=Ge.useTranslation(),[o,d]=l.useState("single"),c=()=>{n(o==="all"),a()},u=()=>{d("single"),a()};return t.jsxs(s.Dialog,{open:e,onClose:u,maxWidth:"xs",fullWidth:!0,PaperProps:{sx:{backgroundColor:g=>g.palette.background.panel}},children:[t.jsx(s.DialogTitle,{children:i("calendar.editRecurringEvent","Editar evento recurrente")}),t.jsxs(s.DialogContent,{children:[r&&t.jsxs(s.Box,{sx:{mb:2,color:"text.secondary",fontSize:"0.875rem"},children:['"',r,'"']}),t.jsx(s.FormControl,{component:"fieldset",fullWidth:!0,children:t.jsxs(s.RadioGroup,{value:o,onChange:g=>d(g.target.value),children:[t.jsx(s.FormControlLabel,{value:"single",control:t.jsx(s.Radio,{color:"secondary"}),label:i("calendar.editThisEvent","Este evento"),sx:{mb:1}}),t.jsx(s.FormControlLabel,{value:"all",control:t.jsx(s.Radio,{color:"secondary"}),label:i("calendar.editAllEvents","Todos los eventos")})]})})]}),t.jsxs(s.DialogActions,{sx:{px:3,pb:2},children:[t.jsx(s.Button,{onClick:u,variant:"outlined",color:"inherit",sx:{borderRadius:"8px"},children:i("global.cancel","Cancelar")}),t.jsx(s.Button,{onClick:c,variant:"contained",color:"secondary",sx:{borderRadius:"8px"},children:i("global.save","Guardar")})]})]})},Md=()=>{const e=Me(),{event:a,task:n,dialogMode:r,selectedEvent:i,handleDeleteEvent:o,handleStartEditingEvent:d,handleDuplicateItem:c,dialogType:u,setDialogType:g,selectedTask:b,taskCalendarId:h,setTaskCalendarId:m,eventCalendarId:p,setEventCalendarId:x,myCalendars:S,otherCalendars:v,handleDeleteTask:T,userManuallyChangedColor:C,setUserManuallyChangedColor:w,eventDialog:{open:j,handleClose:W},confirmDeleteDialog:E,handleConfirmDelete:B,deleteRecurringDialog:A,handleConfirmDeleteRecurring:I,editRecurringDialog:O,handleConfirmEditRecurring:V,hiddenTabs:_}=l.useContext(Ba);if(!a||!n)return t.jsx(s.Modal,{open:j,onClose:W,closeAfterTransition:!0,slots:{backdrop:s.Backdrop},slotProps:{backdrop:{timeout:200}},children:t.jsx(s.Fade,{in:j,timeout:200,children:t.jsx(s.Box,{sx:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",width:"min(640px, calc(100vw - 32px))",height:"min(560px, calc(100vh - 64px))",bgcolor:N=>N.palette.background.panel,borderRadius:3,boxShadow:24,outline:0,p:3,overflow:"visible"}})})});const Y=u==="event",$=Y?a:n,Z=Y?i:b,q=l.useRef(null),L=l.useRef(null);l.useEffect(()=>{j||(q.current=null,L.current=null)},[j]);const{titleField:k,descriptionField:M,date:P,linkContact:R}=$,H=Y?a.notifications:null,G=Y?{locationField:a.locationField,colorField:a.colorField,allDay:a.allDay,setAllDay:a.setAllDay,isPrivate:a.isPrivate,setIsPrivate:a.setIsPrivate,recurrenceRule:a.recurrenceRule,setRecurrenceRule:a.setRecurrenceRule}:null,te=e(r==="edit"?Y?"global.editEvent":"global.editTask":r==="create"?Y?"global.createEvent":"global.createTask":Y?"global.showEvent":"global.showTask"),de=(r==="edit"||r==="view")&&!!Z?.id,pe=r==="view";l.useEffect(()=>{if(r!=="create"||u!=="event"||!j||C||!p)return;const N=S.find(Se=>Se.id===p);N?.color&&a.colorField.actions.changeValue(N.color)},[r,u,j,p,C,S]),l.useEffect(()=>{if(!j||u!=="event"||r!=="edit")return;const N=P.state.selectedStartDate.isAfter(P.state.selectedEndDate)&&!P.state.selectedStartDate.isSame(P.state.selectedEndDate,"minute");L.current!==N&&(L.current=N,P.action.setError(N))},[j,u,r,P.state.selectedStartDate.valueOf(),P.state.selectedEndDate.valueOf()]),l.useEffect(()=>{if(!j||r==="create")return;const N=Z?.relatedContact;N?.id&&q.current!==N.id&&(q.current=N.id,R.action.resetField(),R.action.handleSelectContact({id:N.id,name:N.name}))},[j,r,Z?.id]);const ve=N=>{if(N==="task"){const Se=a.date.state.selectedStartDate;n.date.action.setSelectedStartDate(Se),n.date.action.setSelectedEndDate(Se),n.date.action.setError(!1),a.date.action.setError(!1)}else{const Se=n.date.state.selectedStartDate;a.date.action.setSelectedStartDate(Se),a.date.action.setError(!1),n.date.action.setError(!1)}g(N)},ye=N=>{a.colorField.actions.changeValue(N),w(!0)};return t.jsxs(t.Fragment,{children:[t.jsx(s.Modal,{open:j,onClose:W,closeAfterTransition:!0,slots:{backdrop:s.Backdrop},slotProps:{backdrop:{timeout:200}},children:t.jsx(s.Fade,{in:j,timeout:200,children:t.jsxs(s.Box,{sx:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",width:"min(640px, calc(100vw - 32px))",maxHeight:"calc(100vh - 64px)",bgcolor:N=>N.palette.background.panel,borderRadius:3,boxShadow:24,outline:0,overflow:"hidden",display:"flex",flexDirection:"column"},children:[t.jsxs(s.Box,{sx:{display:"flex",flexDirection:"column",gap:2,p:3,pt:4,overflowY:"auto",flex:1},children:[t.jsxs(s.Box,{sx:{display:"flex",alignItems:"center",justifyContent:r==="create"?"flex-end":"space-between",gap:1,mb:.5},children:[r!=="create"&&t.jsx(s.Typography,{sx:{fontWeight:600},children:te}),t.jsxs(s.Box,{sx:{display:"flex",gap:1},children:[pe&&t.jsx(s.IconButton,{size:"small",onClick:d,"aria-label":e("global.edit","Editar"),children:t.jsx(Ct,{fontSize:"small"})}),de&&t.jsx(s.IconButton,{size:"small",onClick:Y?o:T,color:"error","aria-label":e("global.delete","Eliminar"),children:t.jsx(qt,{fontSize:"small"})}),pe&&t.jsx(s.IconButton,{size:"small",onClick:c,"aria-label":e("global.duplicate","Duplicar"),children:t.jsx(Mr,{fontSize:"small"})})]})]}),r==="create"&&t.jsxs(t.Fragment,{children:[t.jsx(Ra,{disabled:!1,titleField:k,variantMode:"inline"}),!_&&t.jsx(wd,{value:u,onChange:ve,labels:{event:e("global.event","Evento"),task:e("global.task","Tarea")}})]}),u==="event"?t.jsxs(t.Fragment,{children:[r!=="create"&&t.jsx(Ra,{disabled:r==="view",titleField:k}),t.jsx(zn,{disabled:r==="view",descriptionField:M}),t.jsx(Yn,{disabled:r==="view",calendars:[...S,...v],userId:S[0]?.userId,value:p,onChange:N=>x(N)}),t.jsxs(s.Box,{sx:{display:"flex",flexDirection:"column",gap:1.5,borderRadius:1,padding:"15px",bgcolor:N=>N.palette.mode==="dark"?"rgba(255, 255, 255, 0.05)":"rgba(0, 0, 0, 0.02)"},children:[t.jsx(s.Box,{sx:{display:"flex",gap:1.5,alignItems:"flex-start"},children:t.jsx(s.Box,{sx:{flex:1},children:t.jsx(rd,{disabled:r==="view",selectedStartDate:P.state.selectedStartDate,selectedEndDate:P.state.selectedEndDate,handleSelectStart:P.action.handleSelect(P.action.setSelectedStartDate),handleSelectEnd:P.action.handleSelect(P.action.setSelectedEndDate),isError:P.state.error,hideLabel:!0,allDay:G?.allDay??!1})})}),G&&t.jsxs(s.Box,{sx:{display:"flex",gap:2,alignItems:"center"},children:[t.jsx(Ed,{checked:G.allDay,onChange:G.setAllDay,disabled:r==="view"}),t.jsx(s.Box,{sx:{flex:1},children:t.jsx(Ad,{disabled:r==="view",value:G.recurrenceRule,onChange:G.setRecurrenceRule,hideLabel:!0})})]})]}),G&&t.jsx(t.Fragment,{children:t.jsx(Dd,{disabled:r==="view",colorField:G.colorField,onColorChange:r==="create"?ye:void 0})}),H&&t.jsx(md,{disabled:r==="view",notificationsField:H}),t.jsx(Hn,{linkContactsHandler:R,disabled:r==="view"}),G&&t.jsx(xd,{disabled:r==="view",locationField:G.locationField})]}):t.jsxs(t.Fragment,{children:[r!=="create"&&t.jsx(Ra,{disabled:r==="view",titleField:k}),t.jsx(zn,{disabled:r==="view",descriptionField:M}),t.jsx(Yn,{disabled:r==="view",calendars:[...S,...v],userId:S[0]?.userId,value:h,onChange:N=>m(N)}),t.jsx(s.Box,{sx:{display:"flex",flexDirection:"column",gap:1.5,p:2,borderRadius:1,bgcolor:N=>N.palette.mode==="dark"?"rgba(255, 255, 255, 0.05)":"rgba(0, 0, 0, 0.02)"},children:t.jsxs(s.Box,{sx:{display:"flex",gap:1.5,alignItems:"flex-start"},children:[t.jsx(Pr,{sx:{mt:.5,color:"text.secondary",fontSize:"1.25rem"}}),t.jsx(s.Box,{sx:{flex:1},children:t.jsx(Id,{disabled:r==="view",selectedDateTime:P.state.selectedStartDate,handleSelect:N=>{P.action.setSelectedStartDate(N),P.action.setSelectedEndDate(N),P.action.setError(!1)},isError:P.state.error,hideLabel:!0})})]})}),t.jsx(Hn,{linkContactsHandler:R,disabled:r==="view"})]})]}),t.jsx(s.Box,{sx:{borderTop:1,borderColor:"divider",p:2},children:t.jsx(jd,{isFinalized:i?.finalized})})]})})}),t.jsx(Fd,{open:E.open,onClose:E.handleClose,onConfirm:B,itemTitle:E.itemType==="event"?i?.title:b?.title,itemType:E.itemType}),t.jsx(Bd,{open:A.open,onClose:A.handleClose,onConfirm:I,eventTitle:i?.title}),t.jsx($d,{open:O.open,onClose:O.handleClose,onConfirm:V,eventTitle:i?.title})]})},Kn=e=>{const a=e.palette.background;return s.createTheme({...e,components:{MuiSelect:{defaultProps:{MenuProps:{PaperProps:{sx:{backgroundColor:a.panel,backgroundImage:"linear-gradient(rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.05))"}}}}},MuiAutocomplete:{styleOverrides:{popper:{zIndex:11,"& div":{backgroundColor:a.panel}}}},MuiPaper:{styleOverrides:{root:{backgroundColor:a.panel,backgroundImage:"linear-gradient(rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.05))"}}},MuiMenu:{styleOverrides:{paper:{backgroundColor:a.panel,backgroundImage:"linear-gradient(rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.05))"}}},MuiList:{styleOverrides:{root:{padding:0}}},MuiModal:{styleOverrides:{root:{}}},MuiTypography:{styleOverrides:{root:{color:e.palette.text.primary}}},MuiChip:{styleOverrides:{root:{color:e.palette.text.primary,border:"1px solid rgba(0, 0, 0, 0.1)",borderRadius:"4px",height:"20px",fontSize:"0.7125rem"}}},MuiListSubheader:{styleOverrides:{root:{backgroundColor:a.accordionHeader}}},MuiButton:{styleOverrides:{outlined:{color:e.palette.mode==="light"?e.palette.primary.dark:e.palette.info.dark,borderColor:e.palette.mode==="light"?e.palette.primary.dark:e.palette.info.dark,"&:hover":{borderColor:e.palette.mode==="light"?e.palette.primary.main:e.palette.info.main,color:e.palette.mode==="light"?e.palette.primary.main:e.palette.info.main}}}}}})},Pd=e=>{const{open:a,onClose:n,baseUrl:r,spaceId:i,language:o="en",mode:d="create",type:c="event",eventCalendarId:u,taskCalendarId:g,selectedEvent:b,selectedTask:h,hiddenTabs:m=!1,onActionComplete:p,contactId:x}=e,{i18n:S}=Ge.useTranslation();return l.useEffect(()=>{o&&S.changeLanguage(o)},[o,S]),t.jsx(ml,{value:{baseUrl:r,spaceId:i},children:t.jsx(nd,{externalOpen:a,externalOnClose:n,externalMode:d,externalType:c,externalEventCalendarId:u,externalTaskCalendarId:g,externalSelectedEvent:b,externalSelectedTask:h,hiddenTabs:m,externalOnActionComplete:p,externalContactId:x,children:t.jsx(Md,{})})})},Ud=e=>{const a=s.useTheme(),n=a?.palette?a:s.createTheme(),r=Kn(n);return t.jsx(s.ThemeProvider,{theme:r,children:t.jsx(Ge.I18nextProvider,{i18n:It,children:t.jsx(Pd,{...e})})})},la=s.createTheme({name:"lightBlueIndigo",palette:{mode:"light",background:{default:"#ffffff",mainCenter:"#ebf6fd",mainGradient:"linear-gradient(270deg, #215c97, #1976d2)",navMenu:"#1976d2",dropdownMenu:"#f5f5f5",panel:"#ffffff",tooltip:"#1976d2",accordionHeader:"#F3F4F6",panelHeader:"#F3F4F6",panelCenter:"#ffffff",panelGradient:"#ffffff",paper:"#ffffff"},primary:{main:"#1976d2",light:"#42a5f5",dark:"#1565c0",contrastText:"#fff"},secondary:{main:"#1976d2",light:"#ba68c8",dark:"#7b1fa2",contrastText:"rgba(0, 0, 0, 0.87)"},error:{main:"#d32f2f",light:"#ef5350",dark:"#c62828"},warning:{main:"#ed6c02",light:"#ff9800",dark:"#e65100"},info:{main:"#0288d1",light:"#03a9f4",dark:"#01579b"},success:{main:"#2e7d32",light:"#4caf50",dark:"#1b5e20"},containerBox:{default:"#ffffff",main:"#f5f5f5"},action:{active:"rgba(0, 0, 0, 0.10)",hover:"rgba(0, 0, 0, 0.05)",selected:"#ebf6fd",disabled:"rgba(0, 0, 0, 0.26)",disabledBackground:"rgba(255, 255, 255, 0.12)"},text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.6)",disabled:"rgba(0, 0, 0, 0.58)",colorMain:"#1976d2"},divider:"rgba(0, 0, 0, 0.12)",dropdownBox:"#ffffff",color:{icons:"#1976d2"},cellHeader:"#d3d3d3",Skeleton:{bg:"#f5f5f5"},messageBox:"#d3e6fd",boxShadow:"rgba(0, 0, 0, 0.1)",disabled:"rgba(0, 0, 0, 0.26)"}}),Jn=s.createTheme({name:"lightBlue",palette:{mode:"light",background:{default:"#ffffff",mainCenter:"#e3f2fd",mainGradient:"linear-gradient(270deg, #005cb2, #1e88e5)",navMenu:"#4fc354",dropdownMenu:"#f5f5f5",panel:"#ffffff",tooltip:"#1e88e5",accordionHeader:"#F3F4F6",panelHeader:"#F3F4F6",panelCenter:"#ffffff",panelGradient:"#ffffff",paper:"#ffffff"},primary:{main:"#1e88e5",light:"#6ab7ff",dark:"#005cb2",contrastText:"#fff"},secondary:{main:"#1e88e5",light:"#ba68c8",dark:"#7b1fa2",contrastText:"rgba(0, 0, 0, 0.87)"},error:{main:"#d32f2f",light:"#ef5350",dark:"#c62828"},warning:{main:"#ed6c02",light:"#ff9800",dark:"#e65100"},info:{main:"#0288d1",light:"#03a9f4",dark:"#01579b"},success:{main:"#2e7d32",light:"#4caf50",dark:"#1b5e20"},containerBox:{default:"#ffffff",main:"#f5f5f5"},action:{active:"rgba(0, 0, 0, 0.10)",hover:"rgba(0, 0, 0, 0.05)",selected:"#e3f2fd",disabled:"rgba(0, 0, 0, 0.26)",disabledBackground:"rgba(255, 255, 255, 0.12)"},text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.6)",disabled:"rgba(0, 0, 0, 0.58)",colorMain:"#1e88e5"},divider:"rgba(0, 0, 0, 0.12)",dropdownBox:"#ffffff",color:{icons:"#1e88e5"},cellHeader:"#d3d3d3",Skeleton:{bg:"#f5f5f5"},messageBox:"#d3e6fd",boxShadow:"rgba(0, 0, 0, 0.1)",disabled:"rgba(0, 0, 0, 0.26)"}}),Qn=s.createTheme({name:"lightRed",palette:{mode:"light",background:{default:"#ffffff",mainCenter:"#ffebee",mainGradient:"linear-gradient(270deg, #b61827, #ef5350)",navMenu:"#f44336",dropdownMenu:"#f5f5f5",panel:"#ffffff",tooltip:"#ef5350",accordionHeader:"#F3F4F6",panelHeader:"#F3F4F6",panelCenter:"#ffffff",panelGradient:"#ffffff",paper:"#ffffff"},primary:{main:"#ef5350",light:"#ff867c",dark:"#b61827",contrastText:"#fff"},secondary:{main:"#ef5350",light:"#ba68c8",dark:"#7b1fa2",contrastText:"rgba(0, 0, 0, 0.87)"},error:{main:"#d32f2f",light:"#ef5350",dark:"#c62828"},warning:{main:"#ed6c02",light:"#ff9800",dark:"#e65100"},info:{main:"#0288d1",light:"#03a9f4",dark:"#01579b"},success:{main:"#2e7d32",light:"#4caf50",dark:"#1b5e20"},containerBox:{default:"#ffffff",main:"#f5f5f5"},action:{active:"rgba(0, 0, 0, 0.10)",hover:"rgba(0, 0, 0, 0.05)",selected:"#ffebee",disabled:"rgba(0, 0, 0, 0.26)",disabledBackground:"rgba(255, 255, 255, 0.12)"},text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.6)",disabled:"rgba(0, 0, 0, 0.58)",colorMain:"#ef5350"},divider:"rgba(0, 0, 0, 0.12)",dropdownBox:"#ffffff",color:{icons:"#ef5350"},cellHeader:"#d3d3d3",Skeleton:{bg:"#f5f5f5"},messageBox:"#d3e6fd",boxShadow:"rgba(0, 0, 0, 0.1)",disabled:"rgba(0, 0, 0, 0.26)"}}),Xn=s.createTheme({name:"lightGreen",palette:{mode:"light",background:{default:"#ffffff",mainCenter:"#e8f5e9",mainGradient:"linear-gradient(270deg, #087f23, #4caf50)",navMenu:"#4fc354",dropdownMenu:"#f5f5f5",panel:"#ffffff",tooltip:"#4caf50",accordionHeader:"#F3F4F6",panelHeader:"#F3F4F6",panelCenter:"#ffffff",panelGradient:"#ffffff",paper:"#ffffff"},primary:{main:"#4caf50",light:"#80e27e",dark:"#087f23",contrastText:"#fff"},secondary:{main:"#4caf50",light:"#ba68c8",dark:"#7b1fa2",contrastText:"rgba(0, 0, 0, 0.87)"},error:{main:"#d32f2f",light:"#ef5350",dark:"#c62828"},warning:{main:"#ed6c02",light:"#ff9800",dark:"#e65100"},info:{main:"#0288d1",light:"#03a9f4",dark:"#01579b"},success:{main:"#2e7d32",light:"#4caf50",dark:"#1b5e20"},containerBox:{default:"#ffffff",main:"#f5f5f5"},action:{active:"rgba(0, 0, 0, 0.10)",hover:"rgba(0, 0, 0, 0.05)",selected:"#e8f5e9",disabled:"rgba(0, 0, 0, 0.26)",disabledBackground:"rgba(255, 255, 255, 0.12)"},text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.6)",disabled:"rgba(0, 0, 0, 0.58)",colorMain:"#4caf50"},divider:"rgba(0, 0, 0, 0.12)",dropdownBox:"#ffffff",color:{icons:"#4caf50"},cellHeader:"#d3d3d3",Skeleton:{bg:"#f5f5f5"},messageBox:"#d3e6fd",boxShadow:"rgba(0, 0, 0, 0.1)",disabled:"rgba(0, 0, 0, 0.26)"}}),Zn=s.createTheme({name:"lightPink",palette:{mode:"light",background:{default:"#ffffff",mainCenter:"#fce4ec",mainGradient:"linear-gradient(270deg, #b0003a, #e91e63)",navMenu:"#e91e63",dropdownMenu:"#f5f5f5",panel:"#ffffff",tooltip:"#e91e63",accordionHeader:"#F3F4F6",panelHeader:"#F3F4F6",panelCenter:"#ffffff",panelGradient:"#ffffff",paper:"#ffffff"},primary:{main:"#e91e63",light:"#ff6090",dark:"#b0003a",contrastText:"#fff"},secondary:{main:"#9c27b0",light:"#ba68c8",dark:"#7b1fa2",contrastText:"rgba(0, 0, 0, 0.87)"},error:{main:"#d32f2f",light:"#ef5350",dark:"#c62828"},warning:{main:"#ed6c02",light:"#ff9800",dark:"#e65100"},info:{main:"#0288d1",light:"#03a9f4",dark:"#01579b"},success:{main:"#2e7d32",light:"#4caf50",dark:"#1b5e20"},containerBox:{default:"#ffffff",main:"#f5f5f5"},action:{active:"rgba(0, 0, 0, 0.10)",hover:"rgba(0, 0, 0, 0.05)",selected:"#fce4ec",disabled:"rgba(0, 0, 0, 0.26)",disabledBackground:"rgba(255, 255, 255, 0.12)"},text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.6)",disabled:"rgba(0, 0, 0, 0.58)",colorMain:"#e91e63"},divider:"rgba(0, 0, 0, 0.12)",dropdownBox:"#ffffff",color:{icons:"#e91e63"},cellHeader:"#d3d3d3",Skeleton:{bg:"#f5f5f5"},messageBox:"#d3e6fd",boxShadow:"rgba(0, 0, 0, 0.1)",disabled:"rgba(0, 0, 0, 0.26)"}}),er=s.createTheme({name:"lightPurple",palette:{mode:"light",background:{default:"#ffffff",mainCenter:"#f3e5f5",mainGradient:"linear-gradient(270deg, #6a0080, #9c27b0)",navMenu:"#f8bbd0",dropdownMenu:"#f5f5f5",panel:"#ffffff",tooltip:"#9c27b0",accordionHeader:"#F3F4F6",panelHeader:"#F3F4F6",panelCenter:"#ffffff",panelGradient:"#ffffff",paper:"#ffffff"},primary:{main:"#9c27b0",light:"#d05ce3",dark:"#6a0080",contrastText:"#fff"},secondary:{main:"#9c27b0",light:"#ba68c8",dark:"#7b1fa2",contrastText:"rgba(0, 0, 0, 0.87)"},error:{main:"#d32f2f",light:"#ef5350",dark:"#c62828"},warning:{main:"#ed6c02",light:"#ff9800",dark:"#e65100"},info:{main:"#0288d1",light:"#03a9f4",dark:"#01579b"},success:{main:"#2e7d32",light:"#4caf50",dark:"#1b5e20"},containerBox:{default:"#ffffff",main:"#f5f5f5"},action:{active:"rgba(0, 0, 0, 0.10)",hover:"rgba(0, 0, 0, 0.05)",selected:"#f3e5f5",disabled:"rgba(0, 0, 0, 0.26)",disabledBackground:"rgba(255, 255, 255, 0.12)"},text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.6)",disabled:"rgba(0, 0, 0, 0.58)",colorMain:"#9c27b0"},divider:"rgba(0, 0, 0, 0.12)",dropdownBox:"#ffffff",color:{icons:"#9c27b0"},cellHeader:"#d3d3d3",Skeleton:{bg:"#f5f5f5"},messageBox:"#d3e6fd",boxShadow:"rgba(0, 0, 0, 0.1)",disabled:"rgba(0, 0, 0, 0.26)"}}),tr=s.createTheme({name:"lightTeal",palette:{mode:"light",background:{default:"#ffffff",mainCenter:"#e0f2f1",mainGradient:"linear-gradient(270deg, #00675b, #009688)",navMenu:"#f8bbd0",dropdownMenu:"#f5f5f5",panel:"#ffffff",tooltip:"#009688",accordionHeader:"#F3F4F6",panelHeader:"#F3F4F6",panelCenter:"#ffffff",panelGradient:"#ffffff",paper:"#ffffff"},primary:{main:"#009688",light:"#52c7b8",dark:"#00675b",contrastText:"#fff"},secondary:{main:"#009688",light:"#ba68c8",dark:"#7b1fa2",contrastText:"rgba(0, 0, 0, 0.87)"},error:{main:"#d32f2f",light:"#ef5350",dark:"#c62828"},warning:{main:"#ed6c02",light:"#ff9800",dark:"#e65100"},info:{main:"#0288d1",light:"#03a9f4",dark:"#01579b"},success:{main:"#2e7d32",light:"#4caf50",dark:"#1b5e20"},containerBox:{default:"#ffffff",main:"#f5f5f5"},action:{active:"rgba(0, 0, 0, 0.10)",hover:"rgba(0, 0, 0, 0.05)",selected:"#e0f2f1",disabled:"rgba(0, 0, 0, 0.26)",disabledBackground:"rgba(255, 255, 255, 0.12)"},text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.6)",disabled:"rgba(0, 0, 0, 0.58)",colorMain:"#009688"},divider:"rgba(0, 0, 0, 0.12)",dropdownBox:"#ffffff",color:{icons:"#009688"},cellHeader:"#d3d3d3",Skeleton:{bg:"#f5f5f5"},messageBox:"#d3e6fd",boxShadow:"rgba(0, 0, 0, 0.1)",disabled:"rgba(0, 0, 0, 0.26)"}}),ar=s.createTheme({name:"lightLime",palette:{mode:"light",background:{default:"#ffffff",mainCenter:"#f9fbe7",mainGradient:"linear-gradient(270deg, #99aa00, #cddc39)",navMenu:"#f8bbd0",dropdownMenu:"#f5f5f5",panel:"#ffffff",tooltip:"#cddc39",accordionHeader:"#F3F4F6",panelHeader:"#F3F4F6",panelCenter:"#ffffff",panelGradient:"#ffffff",paper:"#ffffff"},primary:{main:"#cddc39",light:"#ffff6e",dark:"#99aa00",contrastText:"#fff"},secondary:{main:"#cddc39",light:"#ba68c8",dark:"#7b1fa2",contrastText:"rgba(0, 0, 0, 0.87)"},error:{main:"#d32f2f",light:"#ef5350",dark:"#c62828"},warning:{main:"#ed6c02",light:"#ff9800",dark:"#e65100"},info:{main:"#0288d1",light:"#03a9f4",dark:"#01579b"},success:{main:"#2e7d32",light:"#4caf50",dark:"#1b5e20"},containerBox:{default:"#ffffff",main:"#f5f5f5"},action:{active:"rgba(0, 0, 0, 0.10)",hover:"rgba(0, 0, 0, 0.05)",selected:"#f9fbe7",disabled:"rgba(0, 0, 0, 0.26)",disabledBackground:"rgba(255, 255, 255, 0.12)"},text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.6)",disabled:"rgba(0, 0, 0, 0.58)",colorMain:"#cddc39"},divider:"rgba(0, 0, 0, 0.12)",dropdownBox:"#ffffff",color:{icons:"#cddc39"},cellHeader:"#d3d3d3",Skeleton:{bg:"#f5f5f5"},messageBox:"#d3e6fd",boxShadow:"rgba(0, 0, 0, 0.1)",disabled:"rgba(0, 0, 0, 0.26)"}}),nr=s.createTheme({name:"lightYellow",palette:{mode:"light",background:{default:"#ffffff",mainCenter:"#fffde7",mainGradient:"linear-gradient(270deg, #c8b900, #ffeb3b)",navMenu:"#f8bbd0",dropdownMenu:"#f5f5f5",panel:"#ffffff",tooltip:"#ffeb3b",accordionHeader:"#F3F4F6",panelHeader:"#F3F4F6",panelCenter:"#ffffff",panelGradient:"#ffffff",paper:"#ffffff"},primary:{main:"#ffeb3b",light:"#ffff72",dark:"#c8b900",contrastText:"#fff"},secondary:{main:"#ffeb3b",light:"#ba68c8",dark:"#7b1fa2",contrastText:"rgba(0, 0, 0, 0.87)"},error:{main:"#d32f2f",light:"#ef5350",dark:"#c62828"},warning:{main:"#ed6c02",light:"#ff9800",dark:"#e65100"},info:{main:"#0288d1",light:"#03a9f4",dark:"#01579b"},success:{main:"#2e7d32",light:"#4caf50",dark:"#1b5e20"},containerBox:{default:"#ffffff",main:"#f5f5f5"},action:{active:"rgba(0, 0, 0, 0.10)",hover:"rgba(0, 0, 0, 0.05)",selected:"#fffde7",disabled:"rgba(0, 0, 0, 0.26)",disabledBackground:"rgba(255, 255, 255, 0.12)"},text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.6)",disabled:"rgba(0, 0, 0, 0.58)",colorMain:"#ffeb3b"},divider:"rgba(0, 0, 0, 0.12)",dropdownBox:"#ffffff",color:{icons:"#ffeb3b"},cellHeader:"#d3d3d3",Skeleton:{bg:"#f5f5f5"},messageBox:"#d3e6fd",boxShadow:"rgba(0, 0, 0, 0.1)",disabled:"rgba(0, 0, 0, 0.26)"}}),rr=s.createTheme({name:"lightAmber",palette:{mode:"light",background:{default:"#ffffff",mainCenter:"#fff8e1",mainGradient:"linear-gradient(270deg, #c68400, #ffb300)",navMenu:"#f8bbd0",dropdownMenu:"#f5f5f5",panel:"#ffffff",tooltip:"#ffb300",accordionHeader:"#F3F4F6",panelHeader:"#F3F4F6",panelCenter:"#ffffff",panelGradient:"#ffffff",paper:"#ffffff"},primary:{main:"#ffb300",light:"#ffe54c",dark:"#c68400",contrastText:"#fff"},secondary:{main:"#ffb300",light:"#ba68c8",dark:"#7b1fa2",contrastText:"rgba(0, 0, 0, 0.87)"},error:{main:"#d32f2f",light:"#ef5350",dark:"#c62828"},warning:{main:"#ed6c02",light:"#ff9800",dark:"#e65100"},info:{main:"#0288d1",light:"#03a9f4",dark:"#01579b"},success:{main:"#2e7d32",light:"#4caf50",dark:"#1b5e20"},containerBox:{default:"#ffffff",main:"#f5f5f5"},action:{active:"rgba(0, 0, 0, 0.10)",hover:"rgba(0, 0, 0, 0.05)",selected:"#fff8e1",disabled:"rgba(0, 0, 0, 0.26)",disabledBackground:"rgba(255, 255, 255, 0.12)"},text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.6)",disabled:"rgba(0, 0, 0, 0.58)",colorMain:"#ffb300"},divider:"rgba(0, 0, 0, 0.12)",dropdownBox:"#ffffff",color:{icons:"#ffb300"},cellHeader:"#d3d3d3",Skeleton:{bg:"#f5f5f5"},messageBox:"#d3e6fd",boxShadow:"rgba(0, 0, 0, 0.1)",disabled:"rgba(0, 0, 0, 0.26)"}}),sr=s.createTheme({name:"lightOrange",palette:{mode:"light",background:{default:"#ffffff",mainCenter:"#fff3e0",mainGradient:"linear-gradient(270deg, #c66900, #ff9800)",navMenu:"#f8bbd0",dropdownMenu:"#f5f5f5",panel:"#ffffff",tooltip:"#ff9800",accordionHeader:"#F3F4F6",panelHeader:"#F3F4F6",panelCenter:"#ffffff",panelGradient:"#ffffff",paper:"#ffffff"},primary:{main:"#ff9800",light:"#ffc947",dark:"#c66900",contrastText:"#fff"},secondary:{main:"#ff9800",light:"#ba68c8",dark:"#7b1fa2",contrastText:"rgba(0, 0, 0, 0.87)"},error:{main:"#d32f2f",light:"#ef5350",dark:"#c62828"},warning:{main:"#ed6c02",light:"#ff9800",dark:"#e65100"},info:{main:"#0288d1",light:"#03a9f4",dark:"#01579b"},success:{main:"#2e7d32",light:"#4caf50",dark:"#1b5e20"},containerBox:{default:"#ffffff",main:"#f5f5f5"},action:{active:"rgba(0, 0, 0, 0.10)",hover:"rgba(0, 0, 0, 0.05)",selected:"#fff3e0",disabled:"rgba(0, 0, 0, 0.26)",disabledBackground:"rgba(255, 255, 255, 0.12)"},text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.6)",disabled:"rgba(0, 0, 0, 0.58)",colorMain:"#ff9800"},divider:"rgba(0, 0, 0, 0.12)",dropdownBox:"#ffffff",color:{icons:"#ff9800"},cellHeader:"#d3d3d3",Skeleton:{bg:"#f5f5f5"},messageBox:"#d3e6fd",boxShadow:"rgba(0, 0, 0, 0.1)",disabled:"rgba(0, 0, 0, 0.26)"}}),or=s.createTheme({name:"lightBrown",palette:{mode:"light",background:{default:"#ffffff",mainCenter:"#efebe9",mainGradient:"linear-gradient(270deg, #4b2c20, #795548)",navMenu:"#f8bbd0",dropdownMenu:"#f5f5f5",panel:"#ffffff",tooltip:"#795548",accordionHeader:"#F3F4F6",panelHeader:"#F3F4F6",panelCenter:"#ffffff",panelGradient:"#ffffff",paper:"#ffffff"},primary:{main:"#795548",light:"#a98274",dark:"#4b2c20",contrastText:"#fff"},secondary:{main:"#795548",light:"#ba68c8",dark:"#7b1fa2",contrastText:"rgba(0, 0, 0, 0.87)"},error:{main:"#d32f2f",light:"#ef5350",dark:"#c62828"},warning:{main:"#ed6c02",light:"#ff9800",dark:"#e65100"},info:{main:"#0288d1",light:"#03a9f4",dark:"#01579b"},success:{main:"#2e7d32",light:"#4caf50",dark:"#1b5e20"},containerBox:{default:"#ffffff",main:"#f5f5f5"},action:{active:"rgba(0, 0, 0, 0.10)",hover:"rgba(0, 0, 0, 0.05)",selected:"#efebe9",disabled:"rgba(0, 0, 0, 0.26)",disabledBackground:"rgba(255, 255, 255, 0.12)"},text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.6)",disabled:"rgba(0, 0, 0, 0.58)",colorMain:"#795548"},divider:"rgba(0, 0, 0, 0.12)",dropdownBox:"#ffffff",color:{icons:"#795548"},cellHeader:"#d3d3d3",Skeleton:{bg:"#f5f5f5"},messageBox:"#d3e6fd",boxShadow:"rgba(0, 0, 0, 0.1)",disabled:"rgba(0, 0, 0, 0.26)"}}),ir=s.createTheme({name:"lightGray",palette:{mode:"light",background:{default:"#ffffff",mainCenter:"#fafafa",mainGradient:"linear-gradient(270deg, #707070, #9e9e9e)",navMenu:"#f8bbd0",dropdownMenu:"#f5f5f5",panel:"#ffffff",tooltip:"#9e9e9e",accordionHeader:"#F3F4F6",panelHeader:"#F3F4F6",panelCenter:"#ffffff",panelGradient:"#ffffff",paper:"#ffffff"},primary:{main:"#9e9e9e",light:"#cfcfcf",dark:"#707070",contrastText:"#fff"},secondary:{main:"#9e9e9e",light:"#ba68c8",dark:"#7b1fa2",contrastText:"rgba(0, 0, 0, 0.87)"},error:{main:"#d32f2f",light:"#ef5350",dark:"#c62828"},warning:{main:"#ed6c02",light:"#ff9800",dark:"#e65100"},info:{main:"#0288d1",light:"#03a9f4",dark:"#01579b"},success:{main:"#2e7d32",light:"#4caf50",dark:"#1b5e20"},containerBox:{default:"#ffffff",main:"#f5f5f5"},action:{active:"rgba(0, 0, 0, 0.10)",hover:"rgba(0, 0, 0, 0.05)",selected:"#fafafa",disabled:"rgba(0, 0, 0, 0.26)",disabledBackground:"rgba(255, 255, 255, 0.12)"},text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.6)",disabled:"rgba(0, 0, 0, 0.58)",colorMain:"#9e9e9e"},divider:"rgba(0, 0, 0, 0.12)",dropdownBox:"#ffffff",color:{icons:"#9e9e9e"},cellHeader:"#d3d3d3",Skeleton:{bg:"#f5f5f5"},messageBox:"#d3e6fd",boxShadow:"rgba(0, 0, 0, 0.1)",disabled:"rgba(0, 0, 0, 0.26)"}}),lr=s.createTheme({name:"darkBlue",palette:{mode:"dark",primary:{main:"#1f5c8e",light:"#2196f3",dark:"#0d47a1",contrastText:"#fff"},secondary:{light:"#FFEA41",main:"#90caf9",dark:"#DBBE01",contrastText:"rgba(0, 0, 0, 0.87)"},error:{main:"#f44336",light:"#e57373",dark:"#d32f2f"},warning:{main:"#ffa726",light:"#ffb74d",dark:"#f57c00"},info:{main:"#29b6f6",light:"#4fc3f7",dark:"#0288d1"},success:{main:"#66bb6a",light:"#81c784",dark:"#388e3c"},background:{default:"#222B45",mainGradient:"linear-gradient(270deg, #222B45, #222B45)",mainCenter:"#28324e",navMenu:"#222B45",panel:"#2d364e",dropdownMenu:"#484f65",tooltip:"#484f65",accordionHeader:"#2a3249e3",panelHeader:"#2a3249e3",panelCenter:"#484f65",panelGradient:"#384057",paper:"#2d364e"},containerBox:{default:"#2d354e",main:"#2d354e"},action:{active:"rgba(255, 255, 255, 0.2)",hover:"rgba(255, 255, 255, 0.08)",selected:"rgba(255, 255, 255, 0.16)",disabled:"rgba(255, 255, 255, 0.3)",disabledBackground:"rgba(255, 255, 255, 0.12)"},text:{primary:"#EEEEEF",secondary:"#AEB0B4",disabled:"rgba(255, 255, 255, 0.5)",colorMain:"#EEEEEF"},divider:"rgba(255, 255, 255, 0.12)",dropdownBox:"#2d354e",color:{icons:"#fff"},cellHeader:"#505050",Skeleton:{bg:"#f5f5f5"},messageBox:"#1f5c8e",boxShadow:"rgba(0, 0, 0, 0.1)",disabled:"rgba(0, 0, 0, 0.26)"}}),dr=s.createTheme({name:"darkBlack",palette:{mode:"dark",background:{default:"#201f1e",mainGradient:"linear-gradient(270deg, #201f1e, #201f1e)",mainCenter:"#252423",navMenu:"#201f1e",panel:"#3B3A39",dropdownMenu:"#585858",tooltip:"#616161eb",accordionHeader:"#25242369",panelHeader:"#3b3a39ba",panelCenter:"#585858",panelGradient:"#454443",paper:"#3B3A39"},primary:{main:"#1976d2",light:"#2196f3",dark:"#42a5f5",contrastText:"#fff"},secondary:{light:"#FFEA41",main:"#90caf9",dark:"#DBBE01",contrastText:"rgba(0, 0, 0, 0.87)"},error:{main:"#f44336",light:"#e57373",dark:"#d32f2f"},warning:{main:"#ffa726",light:"#ffb74d",dark:"#f57c00"},info:{main:"#29b6f6",light:"#4fc3f7",dark:"#0288d1"},success:{main:"#66bb6a",light:"#81c784",dark:"#388e3c"},containerBox:{main:"#ffffffb3",default:"#3B3A39"},action:{active:"rgba(255, 255, 255, 0.2)",hover:"rgba(255, 255, 255, 0.08)",selected:"rgba(255, 255, 255, 0.16)",disabled:"rgba(255, 255, 255, 0.3)",disabledBackground:"rgba(255, 255, 255, 0.12)"},text:{primary:"#EEEEEF",secondary:"#AEB0B4",disabled:"rgba(255, 255, 255, 0.5)",colorMain:"#EEEEEF"},divider:"rgba(255, 255, 255, 0.12)",dropdownBox:"#3B3A39",color:{icons:"#fff"},cellHeader:"#505050",Skeleton:{bg:"#f5f5f5"},messageBox:"#1f5c8e",boxShadow:"rgba(0, 0, 0, 0.1)",disabled:"rgba(0, 0, 0, 0.26)"}}),Rd="https://agent-api.trii.app/api/v1/settings/user/setTheme",Nd={themeSelected:la,darkMode:!1,toggleStatus:"idle"},cr=qa.createAsyncThunk("Theme/updateTheme",async(e,{getState:a})=>{const{uid:n}=a().User.user,r=JSON.stringify({theme:e,uid:n});return(await Ur.put(Rd,r)).data}),ur=qa.createSlice({name:"Theme",initialState:Nd,reducers:{toggleTheme:(e,a)=>{const n=pr(a.payload);Object.assign(e,{themeSelected:n,toggleStatus:"toggled"})},toggleModeTheme:e=>{e.darkMode=!e.darkMode}},extraReducers:e=>{e.addCase(cr.fulfilled,(a,n)=>{const r=pr(n.payload.theme);Object.assign(a,{themeSelected:r})})}}),pr=e=>{switch(e){case"lightBlueIndigo":return la;case"darkBlack":return dr;case"darkBlue":return lr;case"lightAmber":return rr;case"lightBlue":return Jn;case"lightBrown":return or;case"lightGray":return ir;case"lightGreen":return Xn;case"lightLime":return ar;case"lightOrange":return sr;case"lightPink":return Zn;case"lightPurple":return er;case"lightRed":return Qn;case"lightTeal":return tr;case"lightYellow":return nr;default:return la}},Ld=e=>["lightBlueIndigo","darkBlack","darkBlue","lightAmber","lightBlue","lightBrown","lightGray","lightGreen","lightLime","lightOrange","lightPink","lightPurple","lightRed","lightTeal","lightYellow"].includes(e),{toggleTheme:Od,toggleModeTheme:zd}=ur.actions,Wd=e=>e.Theme.toggleStatus,_d=e=>e.Theme.themeSelected,Vd=e=>e.Theme.darkMode;ur.reducer,exports.ContactInfoPopup=en,exports.EditContactModal=gl,exports.EventsDialog=Ud,exports.MuiComponentsConfig=Kn,exports.darkBlack=dr,exports.darkBlue=lr,exports.i18n=It,exports.isValidThemeName=Ld,exports.lightAmber=rr,exports.lightBlue=Jn,exports.lightBlueIndigo=la,exports.lightBrown=or,exports.lightGray=ir,exports.lightGreen=Xn,exports.lightLime=ar,exports.lightOrange=sr,exports.lightPink=Zn,exports.lightPurple=er,exports.lightRed=Qn,exports.lightTeal=tr,exports.lightYellow=nr,exports.selectThemeToggleStatus=Wd,exports.selectedDarkTheme=Vd,exports.selectedTheme=_d,exports.toggleModeTheme=zd,exports.toggleTheme=Od,exports.updateTheme=cr;
21
21
  //# sourceMappingURL=index.js.map