PageSourceSearch

https://dashboard.xfa.tech/static/js/5724.820004ae.chunk.js

js xfa.tech collected 2026-10-01 11:41:57 UTC 120,767 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkxfa_dashboard=self.webpackChunkxfa_dashboard||[]).push([[5724],{98(e,i,o){o.d(i,{A:()=>a});o(9950);var n=o(44414);const a=e=>{let i=e.className,o=e.text,a=void 0===o?"beta":o;return(0,n.jsxs)("span",{className:i?"beta-tag ".concat(i):"beta-tag","aria-hidden":"true","data-testid":"beta-badge",children:["(",a,")"]})}},4576(e,i,o){o.d(i,{A:()=>n});o(9950);const n=o.p+"static/media/google.d7f092af888a54de79ed9c9303d689d7.svg"},7312(e,i,o){o.d(i,{A:()=>d});o(9950);var n=o(83274),a=o(25333),t=o(13413),s=o(55030),l=o(43907),r=o(44414);const d=e=>{let i=e.type;const o=(0,s.Bd)().t,d=(0,l.R)(i,o),c=(0,r.jsxs)("div",{className:"informational-tooltip__content",children:[(0,r.jsx)("div",{className:"informational-tooltip__title",children:d.title}),(0,r.jsx)("div",{className:"informational-tooltip__body",children:d.paragraphs.map((e,i)=>(0,r.jsx)("p",{className:"informational-tooltip__paragraph",children:e},i))})]});return(0,r.jsx)(n.A,{title:c,placement:"bottom-start",componentsProps:{tooltip:{className:"informational-tooltip"}},children:(0,r.jsx)(a.A,{"aria-label":d.title,size:"small",sx:{width:40,height:40,padding:"10px",marginLeft:"2px",flexShrink:0,color:"var(--color-gray-500)","&:hover":{color:"var(--color-gray-700)",backgroundColor:"transparent"}},children:(0,r.jsx)(t.A,{sx:{fontSize:20}})})})}},16188(e,i,o){o.r(i),o.d(i,{default:()=>To});var n=o(89379),a=o(5544),t=o(9950),s=o(28429),l=o(42074),r=o(55030),d=o(65429),c=o(10226),u=o(20032),p=o(79419),v=o(84142),x=o(25277),g=o(8145),h=o(2046),m=o(49715),f=o(93412),y=o(82259),b=o(60927),k=o(84730),A=o(53286),w=o(74438),_=o(6718),j=o(79812),S=o(42167),C=o(81134);var z=o(48091),E=o(51392),I=o(22046),T=o(49959),D=o(58560),M=o(87128);const W=(e,i)=>{if(!i)return-1;const o=L(e,i),n=o.hasWarning;return o.hasBlocking?2:n?1:0},P=(e,i)=>{if(!i||0===i.length)return;return[...i].sort((i,o)=>{var n,a;const t=W(e,o)-W(e,i);if(0!==t)return t;const s=R(e,i),l=R(e,o);if(null!==s&&null!==l&&s!==l)return s-l;if(null!==s&&null===l)return-1;if(null===s&&null!==l)return 1;const r=F(e,i),d=F(e,o);if(null!==r&&null!==d&&r!==d)return r-d;if(null!==r&&null===d)return-1;if(null===r&&null!==d)return 1;const c="default"===(null===(n=i.name)||void 0===n?void 0:n.toLowerCase()),u="default"===(null===(a=o.name)||void 0===a?void 0:a.toLowerCase());return c&&!u?-1:u&&!c?1:(i.name||"").localeCompare(o.name||"")})[0]},B=(e,i,o)=>{const n=P(e,i);return n||P(e,o)},L=(e,i)=>{if(!i)return{hasWarning:!1,hasBlocking:!1};const o=(0,M.jV)(e);if(!o)return{hasWarning:!1,hasBlocking:!1};const n=i[o];if(!n)return{hasWarning:!1,hasBlocking:!1};if(void 0!==n.WarnTime||void 0!==n.BlockTime){return{hasWarning:void 0!==n.WarnTime&&null!==n.WarnTime&&n.WarnTime>=0||void 0!==n.BlockTime&&null!==n.BlockTime,hasBlocking:void 0!==n.BlockTime&&null!==n.BlockTime}}if(void 0!==n.WarnTimeInDays||void 0!==n.BlockTimeInDays){return{hasWarning:void 0!==n.WarnTimeInDays&&null!==n.WarnTimeInDays&&n.WarnTimeInDays>0||void 0!==n.BlockTimeInDays&&null!==n.BlockTimeInDays,hasBlocking:void 0!==n.BlockTimeInDays&&null!==n.BlockTimeInDays}}if(void 0!==n.warn||void 0!==n.block){return{hasWarning:!0===n.warn,hasBlocking:!0===n.block}}return{hasWarning:!1,hasBlocking:!1}},N=86400,R=(e,i)=>{if(!i)return null;const o=(0,M.jV)(e);if(!o)return null;const n=i[o];return n?void 0!==n.BlockTime&&null!==n.BlockTime?Math.floor(n.BlockTime/N):void 0!==n.BlockTimeInDays&&null!==n.BlockTimeInDays?n.BlockTimeInDays:null:null},F=(e,i)=>{if(!i)return null;const o=(0,M.jV)(e);if(!o)return null;const n=i[o];return n?void 0!==n.GoalTime&&null!==n.GoalTime?Math.floor(n.GoalTime/N):void 0!==n.GoalTimeInDays&&null!==n.GoalTimeInDays?n.GoalTimeInDays:null:null},O=(e,i)=>{if(!i)return null;const o=(0,M.jV)(e);if(!o)return null;const n=i[o];return n?void 0!==n.WarnTime&&null!==n.WarnTime?Math.floor(n.WarnTime/N):void 0!==n.WarnTimeInDays&&null!==n.WarnTimeInDays?n.WarnTimeInDays:null:null},U=(e,i)=>{if(!i)return{allowsBeta:!1,allowsMajorVersions:!1};const o=(0,M.jV)(e);if(!o)return{allowsBeta:!1,allowsMajorVersions:!1};const n=i[o];return n?{allowsBeta:void 0!==n.beta_versions&&null!==n.beta_versions,allowsMajorVersions:void 0!==n.older_supported_major_versions&&null!==n.older_supported_major_versions}:{allowsBeta:!1,allowsMajorVersions:!1}};var V=o(97817),K=o(95486);const H={onepassword:"1Password",lastpass:"LastPass",dashlane:"Dashlane",bitwarden:"Bitwarden",keepass:"KeePass",nordpass:"NordPass",protonpass:"ProtonPass",icloud_passwords:"iCloud Passwords",dropbox_passwords:"Dropbox Passwords",passbolt:"Passbolt",enpass:"Enpass",avast_passwords:"Avast Passwords",avira_passwords:"Avira Passwords"},G={os_uptodate:{version:"os_version",outdated:"os_outdated"},chrome_uptodate:{version:"chrome_version",outdated:"chrome_outdated"},firefox_uptodate:{version:"firefox_version",outdated:"firefox_outdated"},edge_uptodate:{version:"edge_version",outdated:"edge_outdated"},safari_uptodate:{version:"safari_version",outdated:"safari_outdated"},brave_uptodate:{version:"brave_version",outdated:"brave_outdated"},arc_uptodate:{version:"arc_version",outdated:"arc_outdated"},opera_uptodate:{version:"opera_version",outdated:"opera_outdated"},vivaldi_uptodate:{version:"vivaldi_version",outdated:"vivaldi_outdated"}},q={exact_match:"Exact match",exact_with_extra:"Exact with extra",contains:"Contains"},J=(e,i,o,n)=>{const a=e;
1if("windows_recall"===i){const e=a.windows_recall;if(e&&!1===e.available)return"devices.checks.table.unknownNotAvailable"}return"find_my_device_enabled"===i&&(0,z.O9)(a.find_my_device_enabled)&&!1===a.find_my_device_evaluated_by_policy||n?"devices.checks.table.unknownNotEvaluated":o?"devices.checks.table.unknownNotReportedYet":"devices.checks.table.unknownNoApp"},Y=e=>{var i,o;return!0===e.isEnforced||null!==(null===(i=e.policyTimeline)||void 0===i?void 0:i.goalDays)&&void 0!==(null===(o=e.policyTimeline)||void 0===o?void 0:o.goalDays)||void 0!==e.goalStatus},Q=e=>"UNKNOWN"===e.goalStatus||void 0===e.goalStatus&&(e.risk===z.En.Unknown||!0===e.isEnforced&&!e.passed),Z=e=>e===z.En.Safe?"enabled":e===z.En.Unsafe?"disabled":"unknown",X=new Set(["developer_mode","remote_login_enabled","remote_management_enabled","remote_scripting_enabled","screen_sharing_enabled","unattended_remote_access_enabled","windows_recall"]),$={jailbroken:{safe:"devices.checks.state.notJailbroken",unsafe:"devices.checks.state.jailbroken",unknown:"devices.unknown"},rooted:{safe:"devices.checks.state.notRooted",unsafe:"devices.checks.state.rooted",unknown:"devices.unknown"},secrets_in_environment:{safe:"devices.checks.state.noSecrets",unsafe:"devices.checks.state.secretsFound",unknown:"devices.unknown"},autonomous_agents_present:{safe:"devices.checks.state.noAgents",unsafe:"devices.checks.state.agentsFound",unknown:"devices.unknown"},unguarded_elevation:{safe:"devices.checks.state.secured",unsafe:"devices.checks.state.unsecured",unknown:"devices.unknown"},unsafe_ai_mode:{safe:"devices.checks.state.noUnsafeAiMode",unsafe:"devices.checks.state.unsafeAiModeDetected",unknown:"devices.unknown"}},ee=(e,i)=>{const o=$[e];return o?i===z.En.Safe?o.safe:i===z.En.Unsafe?o.unsafe:o.unknown:X.has(e)?i===z.En.Safe?"devices.disabled":i===z.En.Unsafe?"devices.enabled":"devices.unknown":i===z.En.Safe?"devices.enabled":i===z.En.Unsafe?"devices.disabled":"devices.unknown"},ie=(e,i,o,n)=>o.filter(o=>{var a,t;const s=null!==(a=null===n||void 0===n||null===(t=n[o.policy_id])||void 0===t?void 0:t.device)&&void 0!==a?a:i;return(0,T.dr)(s,o).some(i=>i.check===e)}),oe=(e,i,o,n,t,s)=>{if("dns_servers_compliant"===i){var l,r;const e=(null===n||void 0===n||null===(l=n.dns)||void 0===l?void 0:l.dns_servers)||[],i=(null===n||void 0===n||null===(r=n.dns)||void 0===r?void 0:r.validation_mode)||"exact_match";return{type:"dns",dnsExpected:e,dnsValidationMode:q[i]||i}}if(G[i]){const o=((e,i)=>{var o;const n=G[i];if(!n)return{version:null,outdatedDays:null};const a=e,t=null===(o=e.os_name)||void 0===o?void 0:o.toLowerCase().includes("android");let s=n.version;"os_uptodate"===i&&t&&(s="string"===typeof a.android_security_level?"android_security_level":n.version);const l="string"===typeof a[s]?a[s]:null,r="number"===typeof a[n.outdated]?a[n.outdated]:null;return{version:l,outdatedDays:null!==r?Math.max(0,Math.floor((Math.floor(Date.now()/1e3)-r)/V.xz)):null}})(e,i),n=o.version,a=o.outdatedDays;if(n){var d,c;const o=null===t||void 0===t?void 0:t[i],s=null===(d=e.os_name)||void 0===d?void 0:d.toLowerCase().includes("android"),l="string"===typeof e.android_security_level,r="os_uptodate"===i&&s&&!l?"devices.checks.table.androidSecurityPatchUnknown":void 0,u=null!==o&&void 0!==o&&o.upToDate?null:null!==(c=null===o||void 0===o?void 0:o.outdatedDays)&&void 0!==c?c:a;return{type:"version",version:n,latestVersion:null===o||void 0===o?void 0:o.latestVersion,outdatedDays:u,channel:null===o||void 0===o?void 0:o.channel,isLatestForChannel:null===o||void 0===o?void 0:o.isLatestForChannel,latestForChannel:null===o||void 0===o?void 0:o.latestForChannel,isLatestForMajor:null===o||void 0===o?void 0:o.isLatestForMajor,isSupportedMajor:null===o||void 0===o?void 0:o.isSupportedMajor,latestForMajor:null===o||void 0===o?void 0:o.latestForMajor,major:null===o||void 0===o?void 0:o.major,infoMessageKey:r}}return{type:"boolean",booleanState:"unknown",booleanLabelKey:"devices.unknown"}}if("passwordmanager"===i){const n=(u=e.passwordmanager)?Object.entries(u).filter(e=>{let i=(0,a.A)(e,2);return i[0],!0===i[1]}).map(e=>{let i=(0,a.A)(e,1)[0];return H[i]||i}):[];return n.length>0?{type:"passwordmanager",passwordManagers:n}:{type:"boolean",booleanState:Z(o),booleanLabelKey:ee(i,o)}}var u,p;if("reboot"===i){const n=e,a="number"===typeof n.time_since_boot_in_days?n.time_since_boot_in_days:null;return null!==a?{type:"reboot",daysSinceReboot:a}:{type:"boolean",booleanState:Z(o),booleanLabelKey:ee(i,o)}}if("intune_enrolled"===i&&null!==n&&void 0!==n&&n.intune){var v;const a=!!e.intune_enrolled,t=!(null===s||void 0===s||!s.enrolled_in_external_tenant),l=!!n.intune.external_enrollment_allowed,r=null!==(v=n.intune.tenant_ids)&&void 0!==v?v:[],d=r.length>0;let c,u;return a?t?l&&d?c="devices.checks.table.intuneExternalTenant":d&&(c="devices.checks.table.intuneNotInTenants",u=r):d?(c="devices.checks.table.intuneEnrolledInTenants",u=r):l&&(c="devices.checks.table.intuneEnrolledGeneric"):c="devices.checks.table.intuneNotEnrolled",{type:"boolean",booleanState:Z(o),booleanLabelKey:ee(i,o),intuneMessageKey:c,intuneTenantList:u}}if("antivirus_enabled"===i&&(e.antivirus_product_name||e.antivirus_products||null!==s&&void 0!==s&&s.reason||null!==s&&void 0!==s&&s.required_products))return{type:"antivirus",antivirusProduct:(null===(p=e.antivirus_products)||void 0===p?void 0:p.map(e=>e.product_name).join(", "))||e.antivirus_product_name,antivirusRequiredProducts:Array.isArray(null===s||void 0===s?void 0:s.required_products)?s.required_products.filter(e=>"string"===typeof e):void 0,antivirusReason:"string"===typeof(null===s||void 0===s?void 0:s.reason)?s.reason:void 0,booleanState:Z(o),booleanLabelKey:ee(i,o)};
1if("aikido_safe_chain"===i||"aikido_endpoint"===i){const o=e,n="aikido_safe_chain"===i?o.aikido_safe_chain_version:o.aikido_endpoint_version,a="aikido_safe_chain"===i?o.aikido_safe_chain_latest_version:o.aikido_endpoint_latest_version;if(n)return{type:"version",version:n,latestVersion:a}}return{type:"boolean",booleanState:Z(o),booleanLabelKey:ee(i,o)}},ne=function(e,i,o){let a=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],s=arguments.length>4?arguments[4]:void 0,l=arguments.length>5?arguments[5]:void 0,d=arguments.length>6?arguments[6]:void 0,c=arguments.length>7?arguments[7]:void 0;const u=(0,r.Bd)().t,p=(0,A.V)().policies,v=(0,t.useMemo)(()=>{const t=[];if(!e)return t;const r=i===I.JE,v=i===I.Px;if((!p||0===p.length)&&!r)return t;const x=(0,T.$Z)(e,l),g=r?o?[o]:[]:v?(p||[]).filter(e=>e.policy_id!==I.JE):i?(p||[]).filter(e=>e.policy_id===i):p||[];if(0===g.length)return t;const h=null===c||void 0===c?void 0:c.default_policy_id,m=Boolean(h&&(p||[]).some(e=>e.policy_id===h)),f=!r&&!v&&i&&g.some(e=>e.policy_id===i)?i:r||v||!m?void 0:h,y=(0,K.Lq)(e);return x.map(i=>{var o,t,l;const p=ie(i,e,g,d),x=B(i,p,[]),h=x||p[0]||g[0],m=p.length>0,b=h&&(null===d||void 0===d||null===(o=d[h.policy_id])||void 0===o?void 0:o.device),A=null!==b&&void 0!==b?b:e,w=(0,D.yC)(A,i),_=(0,D.Y_)(A,i);let j=(0,k.lJ)(A,i,h);const S=m?null===w||void 0===w?void 0:w.goal_status:void 0,C=void 0!==S;v&&"passwordmanager"===i&&m&&!1===e.passwordmanager_evaluated_by_policy&&(0,z.O9)(e.passwordmanager)&&(j=Object.values(e.passwordmanager).some(e=>!0===e)?z.En.Safe:z.En.Unsafe);const I=r?{hasWarning:!1,hasBlocking:!1}:L(i,x);let T=!!C&&I.hasWarning,M=!!C&&I.hasBlocking;const W=(0,V.qp)(w,i);m&&C&&("OK"===_||"MISSING"===_?(T=!1,M=!1):"WARNING"===_?(T=!0,M=I.hasBlocking||null!==W):"BLOCKING"===_&&(T=!0,M=!0));const P=r?null:R(i,x),N=a&&((e,i)=>{const o={os_uptodate:"os_cves",chrome_uptodate:"chrome_cves",firefox_uptodate:"firefox_cves",edge_uptodate:"edge_cves",safari_uptodate:"safari_cves",brave_uptodate:"brave_cves",arc_uptodate:"arc_cves",opera_uptodate:"opera_cves",vivaldi_uptodate:"vivaldi_cves"}[i];return!(!o||!e[o])&&Array.isArray(e[o])&&e[o].length>0})(e,i),K=!y&&j===z.En.Unknown,H=j===z.En.Unknown,G=(0,k.lJ)(e,i,h,!0),q=[G,A===e?G:(0,k.lJ)(A,i,h,!0)].some(e=>e===z.En.Safe||e===z.En.Unsafe),Y=G===z.En.NotPresent||G===z.En.DontShow?j:G,Z=oe(e,i,Y,h,s,w),X=Q({goalStatus:S,risk:j,isEnforced:m,passed:j===z.En.Safe})&&!Z.antivirusReason?(0,n.A)((0,n.A)({},Z),{},{unknownReasonKey:J(A,i,y,q)}):Z;let $=null,ee=null;const ne="OK"===_||"MISSING"===_,ae=(0,V.Ui)(w,i),te=(0,V.CA)(w,i),se="version"===X.type&&null!==(t=X.outdatedDays)&&void 0!==t?t:null,le=null!==ae&&void 0!==ae?ae:se,re="reboot"===i?null:r?se:le,de=r?null:O(i,x),ce=(0,V.fY)(w);C&&"MISSING"!==_&&!("WARNING"===_||"BLOCKING"===_)&&(null!==ce?$=ce:I.hasWarning&&null!==de&&null!==le&&($=Math.max(0,de-le)));const ue=(0,V.ow)(w,i),pe="WARNING"===_||"BLOCKING"===_?null!==ue&&void 0!==ue?ue:null!==te&&null!==de?Math.max(0,te-de*V.xz):null:null,ve=(0,V.jx)(w,i),xe="BLOCKING"===_?null!==ve&&void 0!==ve?ve:null!==te&&null!==P?Math.max(0,te-P*V.xz):null:null;C&&"BLOCKING"===_?ee=0:C&&"MISSING"!==_&&I.hasBlocking&&null!==W?ee=W:C&&"MISSING"!==_&&I.hasBlocking&&null!==P&&null!==le&&(ee=Math.max(0,P-le)),"OK"===_&&0===ee&&(ee=null);return{name:u(k.kS[i]),checkKey:i,betaLabelKey:(0,E.uX)(i,e.os_name,c),explanationExtraKey:"antivirus_enabled"===i?(0,E.m6)(c):void 0,fixSupported:j===z.En.Unsafe&&(0,D.JS)(A,i),passed:j===z.En.Safe,risk:j,isEnforced:m,policy:m&&(null===x||void 0===x?void 0:x.name)||u("devices.policy.notEnforced"),policyId:r?void 0:m?null===x||void 0===x?void 0:x.policy_id:f,status:(()=>{if(K||H)return"";if(r)return"";if(!m)return"";if(w&&!C)return"";if(ne)return"";if("WARNING"===_)return u("devices.status.warning");if("BLOCKING"===_)return u("devices.status.blocked");if(j===z.En.Safe||"OK"===S)return u("devices.status.passed");if(!_&&j===z.En.Unsafe){const e=I.hasWarning;return u(!e||null!==ee&&void 0!==ee&&ee<=0?"devices.status.blocked":"devices.status.warning")}return""})(),decisionStatus:_,lastCheck:("antivirus_enabled"===i&&null!==(l=e.antivirus_timestamp)&&void 0!==l?l:e.timestamp_submitted)||0,hasWarning:T,hasBlocking:M,warningEnabled:I.hasWarning,blockingEnabled:I.hasBlocking,hasCVE:N,extraInfo:X,daysUntilWarned:$,daysUntilBlocked:ee,outdatedDays:re,policyTimeline:r?null:{goalDays:F(i,x),warnDays:O(i,x),blockDays:R(i,x)},versionPolicySettings:m?U(i,x):void 0,goalStatus:S,warnedAgoSeconds:pe,blockedAgoSeconds:xe}}).filter(i=>{var o;const n=x.find(e=>u(k.kS[e])===i.name),a=ie(n,e,g,d),t=B(n,a,[])||a[0]||g[0],s=t&&(null===d||void 0===d||null===(o=d[t.policy_id])||void 0===o?void 0:o.device),l=(0,k.lJ)(null!==s&&void 0!==s?s:e,n,t);if(k.yw.includes(n)&&0===a.length)return!1;if((e=>"os_uptodate"!==e&&e.endsWith("_uptodate"))(n)){const i=null!==s&&void 0!==s?s:e,o=(e=>"".concat(e.slice(0,-9),"_version"))(n),a=i[o];if(!("string"===typeof a&&a.length>0))return!1}return l!==z.En.NotPresent&&l!==z.En.DontShow&&("dns_servers_compliant"!==n||l!==z.En.Unknown||0!==a.length)})},[o,a,e,d,l,c,p,i,u,s]),x=(0,t.useMemo)(()=>{var n;if(!e)return 0;const a=i===I.JE?o:i===I.Px?null:(p||[]).find(e=>e.policy_id===i)||null;if(i===I.Px){return v.filter(i=>
1i.risk===z.En.Unsafe&&(0,T.F7)(e,i.checkKey)).length}const t=a&&(null===d||void 0===d||null===(n=d[a.policy_id])||void 0===n?void 0:n.device);return(0,T.TY)(null!==t&&void 0!==t?t:e,a,l)},[e,d,i,o,p,v,l,u]);return{deviceChecks:v,failedChecksCount:x}},ae=e=>{const i=e.decisions;return i&&"object"===typeof i?i:void 0},te=e=>({device:e,decisions:ae(e)}),se=e=>e instanceof Error?e:new Error(String(e)),le="https://versions.xfa.tech",re={os_uptodate_macos:"macos",os_uptodate_ios:"ios",os_uptodate_ipados:"ipados",os_uptodate_windows:"windows",os_uptodate_windows10:"windows10",os_uptodate_windows11:"windows11",chrome_uptodate:"googlechrome",firefox_uptodate:"mozillafirefox",edge_uptodate:"microsoftedge",safari_uptodate:"safari",opera_uptodate:"opera",vivaldi_uptodate:"vivaldi"};async function de(e){try{const i=await fetch("".concat(le,"/").concat(e,"/latest"));return i.ok?await i.json():null}catch(i){return null}}async function ce(e,i){try{const o="macos"===e?function(e){const i=e.match(/[0-9.]{2,}/);return i?i[0]:e}(i):i,n=encodeURIComponent(o),a=await fetch("".concat(le,"/").concat(e,"/").concat(n,"/info"));if(a.ok)return await a.json();const t=await de(e);return t?{name:t.name,version:i,"latest-version":t.version,"latest-released":t.released,released:0,outdated:null,"is-latest":!1}:null}catch(o){return null}}const ue=["os_uptodate","chrome_uptodate","firefox_uptodate","edge_uptodate","safari_uptodate","brave_uptodate","arc_uptodate","opera_uptodate","vivaldi_uptodate"],pe={os_uptodate:{version:"os_version",uptodate:"os_uptodate"},chrome_uptodate:{version:"chrome_version",uptodate:"chrome_uptodate"},firefox_uptodate:{version:"firefox_version",uptodate:"firefox_uptodate"},edge_uptodate:{version:"edge_version",uptodate:"edge_uptodate"},safari_uptodate:{version:"safari_version",uptodate:"safari_uptodate"},brave_uptodate:{version:"brave_version",uptodate:"brave_uptodate"},arc_uptodate:{version:"arc_version",uptodate:"arc_uptodate"},opera_uptodate:{version:"opera_version",uptodate:"opera_uptodate"},vivaldi_uptodate:{version:"vivaldi_version",uptodate:"vivaldi_uptodate"}};function ve(e){const i=(0,t.useState)({}),o=(0,a.A)(i,2),n=o[0],s=o[1],l=(0,t.useState)(!1),r=(0,a.A)(l,2),d=r[0],c=r[1],u=(0,t.useCallback)(async()=>{var i;if(!e)return void s({});const o=function(e){var i;const o=e,n=[],a=null===(i=e.os_name)||void 0===i?void 0:i.toLowerCase().includes("android");for(const t of ue){const e=pe[t];if(!e)continue;const i="os_uptodate"===t&&a?o.android_security_level:o[e.version];"string"===typeof i&&i&&n.push({check:t,version:i})}return n}(e),n=null===(i=e.os_name)||void 0===i?void 0:i.toLowerCase().includes("android"),a="string"===typeof e.android_security_level,t=n&&!a;if(0===o.length&&!t)return void s({});c(!0);const l={};if(await Promise.all(o.map(async i=>{let o=i.check,n=i.version;const a=function(e,i){if("os_uptodate"===e){const e=(null===i||void 0===i?void 0:i.toLowerCase())||"";return e.includes("macos")||e.includes("mac os")?"macos":e.includes("ios")?"ios":e.includes("ipados")?"ipados":e.includes("windows 11")?"windows11":e.includes("windows 10")?"windows10":e.includes("windows")?"windows":e.includes("android")?"androidsecuritypatchlevel":null}return"arc_uptodate"===e?"arc":"brave_uptodate"===e?"brave":re[e]||null}(o,e.os_name);if(!a)return;const t=await ce(a,n);if(t){const e=86400,i=!0===t["is-latest"]||!0===t["is-latest-for-major"]&&!0===t["is-supported-major"]||(0,K.Gd)(t.channel)&&!0===t["is-latest-for-channel"];let n=null;if(!i&&t.outdated){const i=Math.floor(Date.now()/1e3)-t.outdated;i>0&&(n=Math.floor(i/e))}l[o]={latestVersion:t["latest-version"],outdatedDays:n,upToDate:i,isLatestForMajor:t["is-latest-for-major"],isSupportedMajor:t["is-supported-major"],latestForMajor:t["latest-for-major"],major:t.major,isLatestForChannel:t["is-latest-for-channel"],latestForChannel:t["latest-for-channel"],channel:t.channel}}})),t&&!l.os_uptodate){const e=await de("androidsecuritypatchlevel");e&&(l.os_uptodate={latestVersion:e.version,outdatedDays:null})}s(l),c(!1)},[e]);return(0,t.useEffect)(()=>{u()},[u]),{versionsInfo:n,loading:d}}var xe=o(26194),ge=o(87233),he=o(34961),me=o(66282),fe=o(69195),ye=o(40344);const be=o.p+"static/media/note-icon.186544b3128e650789b02729ba7784e9.svg";var ke=o(95222),Ae=o(48572),we=o(11776),_e=o(49224),je=o(62105),Se=o(44414);const Ce=e=>{let i=e.deviceName,o=e.onSendVerificationEmail,n=e.onSendRiskEmail,a=e.onAddNote,s=e.hasDeviceNote,l=void 0!==s&&s,d=e.onAddTag,c=e.onSelectTag,p=e.onCreateTag,v=e.onOpenTagMenu,x=e.onCloseTagMenu,g=e.tagOptions,h=void 0===g?[]:g,m=e.selectedTag,f=e.tagSearchValue,y=void 0===f?"":f,b=e.onTagSearchChange,k=e.isTagMenuOpen,A=void 0!==k&&k,w=e.onResetMfa,_=e.onDeleteDevice,j=e.onSnooze,C=e.onCancelSnooze,z=e.onOpenSnoozeDialog,E=e.snoozedUntil,I=e.verificationDisabled,T=void 0!==I&&I,D=e.isReadOnly,M=void 0!==D&&D,W=e.onDebug;const P=(0,r.Bd)().t,B=(0,S.g)().manualAwarenessQuota,L=(0,K.NP)({snoozed_until:null!==E&&void 0!==E?E:void 0}),N="trial"===(null===B||void 0===B?void 0:B.period)?(0,Se.jsx)(je.A,{remaining:B.remaining,variant:"action"}):void 0,R=(0,t.useMemo)(()=>h.length?P("devices.tags.searchPlaceholder"):P("devices.tags.createPlaceholder"),[h.length,P]),F=y.trim(),O=(0,t.useMemo)(()=>F?h.filter(e=>e.toLowerCase().includes(F.toLowerCase())):h,[h,F]),U=(0,t.useMemo)(()=>!!F&&!h.some(e=>e.toLowerCase()===F.toLowerCase()),[F,h]),V=[{label:"devices.tags.search",keepMenuOpen:!0,disableTranslation:!0,renderContent:()=>(0,Se.jsx)(Ae.CO,{placeholder:R,value:y,onChange:b,onSubmit:e=>{e.trim()&&(null===p||void 0===p||p(e.trim()))},maxLength:we.U})}];
1(O.length||U)&&(O.forEach(e=>{const i=m===e;V.push({label:e,value:e,disableTranslation:!0,keepMenuOpen:!1,onClick:()=>null===c||void 0===c?void 0:c(e),renderContent:()=>(0,Se.jsx)(Ae.H8,{tag:e,isSelected:i}),selected:i})}),U&&V.push({label:F,value:F,disableTranslation:!0,onClick:()=>null===p||void 0===p?void 0:p(F),renderContent:()=>(0,Se.jsx)(Ae.j_,{label:P("devices.tags.create",{tag:F})})}));const H=[];return H.push({label:P("devices.addTag"),icon:(0,Se.jsx)("img",{src:ke.A,alt:"Add tag",className:"icon"}),keepMenuOpen:!0,onClick:()=>{null===d||void 0===d||d(),A||null===v||void 0===v||v()}}),L?C&&H.push({label:P("devices.editSnooze"),icon:(0,Se.jsx)(_e.M,{}),onClick:()=>null===z||void 0===z?void 0:z()}):j&&H.push({label:P("devices.snooze"),icon:(0,Se.jsx)(_e.M,{}),onClick:()=>null===z||void 0===z?void 0:z()}),H.push({label:P(l?"devices.editNote":"devices.addNote"),icon:(0,Se.jsx)("img",{src:be,alt:"Add note",className:"icon"}),onClick:()=>null===a||void 0===a?void 0:a()}),w&&H.push({label:P("devices.resetMfa"),icon:(0,Se.jsx)("img",{src:ye.A,alt:"Reset MFA",className:"icon"}),onClick:w}),!o||T||L||H.push({label:P("devices.verificationEmail"),icon:(0,Se.jsx)("img",{src:fe.A,alt:"Notify",className:"icon"}),onClick:o,endAdornment:N}),!n||T||L||H.push({label:P("devices.riskEmail"),icon:(0,Se.jsx)("img",{src:fe.A,alt:"Notify",className:"icon"}),onClick:n,endAdornment:N}),W&&H.push({label:"Debug",icon:(0,Se.jsx)(he.A,{sx:{fontSize:"18px"}}),onClick:W}),_&&H.push({label:P("devices.removeDevice"),icon:(0,Se.jsxs)("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"icon-delete",children:[(0,Se.jsx)("path",{d:"M15 6.75L13.5037 15.2597C13.3777 15.977 12.7546 16.5 12.0265 16.5H5.97355C5.24534 16.5 4.62232 15.977 4.49622 15.2597L3 6.75",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),(0,Se.jsx)("path",{d:"M15.75 4.5H11.5312M11.5312 4.5V3C11.5312 2.17157 10.8597 1.5 10.0312 1.5H7.96875C7.14032 1.5 6.46875 2.17157 6.46875 3V4.5M11.5312 4.5H6.46875M2.25 4.5H6.46875",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),delete:!0,onClick:_}),(0,Se.jsx)(Se.Fragment,{children:(0,Se.jsxs)(u.A,{className:"devices-header",sx:{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",gap:{xs:"8px",sm:"16px"},marginBottom:{xs:"16px",sm:"24px"}},children:[(0,Se.jsx)(u.A,{sx:{display:"flex",flexDirection:"column",gap:"6px",minWidth:0},children:(0,Se.jsx)(ge.A,{variant:"pagetitle",sx:{fontSize:{xs:"20px",sm:"24px"},wordBreak:"break-word",minWidth:0},children:(0,Se.jsx)("div",{children:i})})}),(0,Se.jsx)(u.A,{sx:{display:"flex",alignItems:"center",gap:"8px"},children:!M&&(0,Se.jsx)(me.A,{mode:"select",defaultSelected:"Devices.actions",actions:A?V:H,keepOpen:A,onClose:x,buttonLabel:"Devices.actions",buttonContent:P("Devices.actions"),menuSx:A?Ae.cR:void 0,autoOpen:A})})]})})};var ze=o(83274);const Ee=e=>{let i=e.label,o=e.variant,a=e.startIcon,t=e.endAdornment;const s=(()=>{switch(o){case"blocked":return{backgroundColor:"var(--color-red-100)",color:"var(--color-red-800)",dotColor:"var(--color-red-500)"};case"compliant":return{backgroundColor:"var(--color-green-100)",color:"var(--color-green-800)",dotColor:"var(--color-green-500)"};case"discovered":return{backgroundColor:"white",color:"var(--color-gray-800)",dotColor:null,border:"1px dashed var(--color-gray-400)"};case"lostConnection":return{backgroundColor:"white",color:"var(--color-orange-700)",dotColor:null,border:"1px dashed var(--color-orange-500)"};case"skippedVerification":return{backgroundColor:"var(--color-yellow-100)",color:"var(--color-yellow-800)",dotColor:null,border:"1px solid var(--color-yellow-400)"};case"missingInfo":return{backgroundColor:"var(--color-gray-200)",color:"var(--color-gray-600)",dotColor:"var(--color-gray-400)"};case"snoozed":return{backgroundColor:"white",color:"var(--color-gray-500)",dotColor:null,border:"1px solid var(--color-gray-100)"};default:return{backgroundColor:"white",color:"var(--color-gray-800)",dotColor:null}}}
1)(),l=s.dotColor&&!a,r="snoozed"===o;return(0,Se.jsxs)(u.A,{sx:(0,n.A)({display:"inline-flex",alignItems:"center",gap:"6px",padding:"4px 12px",borderRadius:"16px",backgroundColor:s.backgroundColor,border:s.border||"none",cursor:r?"pointer":"default",transition:r?"box-shadow 120ms ease":void 0},r&&{"&:hover, &:focus-visible":{boxShadow:"0 0 0 2px rgba(255, 255, 255, 0.9), 0 0 0 3px var(--color-gray-400), 0px 1px 4px 0px rgba(16, 19, 26, 0.2)"}}),children:[a?(0,Se.jsx)(u.A,{sx:{display:"inline-flex",alignItems:"center"},children:a}):l&&(0,Se.jsx)(u.A,{sx:{width:"6px",height:"6px",borderRadius:"50%",backgroundColor:s.dotColor}}),(0,Se.jsx)("span",{style:{fontWeight:600,fontSize:"12px",lineHeight:"18px",letterSpacing:0,color:s.color},children:i}),t&&(0,Se.jsx)(u.A,{sx:{display:"inline-flex",alignItems:"center",gap:"4px"},children:t})]})};var Ie=o(25333);const Te=e=>{let i=e.notes,o=e.onEditNotes;const n=(0,r.Bd)().t;return i&&0!==i.trim().length?(0,Se.jsxs)(u.A,{sx:{minWidth:0,maxWidth:"100%"},children:[(0,Se.jsx)(ge.A,{sx:{color:"var(--color-gray-500)",fontWeight:500,fontSize:{xs:"13px",sm:"14px"},lineHeight:"20px"},children:n("devices.noteLabel")}),(0,Se.jsxs)(u.A,{sx:{display:"flex",alignItems:"center",gap:"8px",minWidth:0},children:[o&&(0,Se.jsx)(ze.A,{title:n("devices.editNote"),placement:"top",children:(0,Se.jsx)(Ie.A,{size:"small",onClick:o,sx:{flexShrink:0,padding:"0px",width:"14px",height:"14px",color:"var(--color-gray-400)","&:hover":{color:"var(--color-gray-600)",backgroundColor:"transparent"}},children:(0,Se.jsx)("img",{src:be,alt:n("devices.editNote"),style:{width:"14px",height:"14px"}})})}),(0,Se.jsx)(ge.A,{sx:{color:"var(--color-gray-900)",fontWeight:600,fontSize:{xs:"13px",sm:"14px"},lineHeight:"20px",wordBreak:"break-word",overflowWrap:"anywhere",flex:1,minWidth:0},children:i})]})]}):null};var De=o(98619),Me=o(22576),We=o(27970),Pe=o(26584),Be=o(60123),Le=o(13413),Ne=o(46310),Re=o(95882),Fe=o(4576),Oe=o(51684),Ue=o(30820),Ve=o(10487),Ke=o(54713),He=o(7312),Ge=o(62784);const qe=e=>{var i,o,n,a,l,d,c,p,v,g;let h=e.device,m=e.statuses,f=e.hasDeviceChecks,y=e.cveEnabled,b=void 0===y||y,k=e.selectedTag,A=e.onRemoveTag,w=e.deviceNotes,_=e.onEditNotes,j=e.latestXfaVersion,S=e.xfaVersionInfo,C=e.snoozedUntil,z=e.snoozeReason,E=e.onSnoozeClick,I=e.flashTag,T=void 0===I?0:I,D=e.flashNotes,M=void 0===D?0:D,W=e.latestBlockedAgoSeconds,P=void 0===W?null:W;const B=(0,r.Bd)(),L=B.t,N=B.i18n,R=(0,s.Zp)(),F=(null===(i=h.os_name)||void 0===i?void 0:i.toLowerCase().includes("ios"))||(null===(o=h.os_name)||void 0===o?void 0:o.toLowerCase().includes("android")),O=function(e){let i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(!e)return L("Devices.never");const o=(0,K.Vm)(e,L),n=(0,K.uI)(e),a=i&&(0,K.iR)(e);return(0,Se.jsxs)(u.A,{sx:{display:"flex",alignItems:"center",gap:"6px"},children:[a&&(0,Se.jsx)(ze.A,{title:L("devices.details.lastSeenOutdatedTooltip"),arrow:!0,placement:"top",children:(0,Se.jsx)(u.A,{component:"img",src:Be.A,alt:L("devices.details.lastSeenOutdated"),sx:{width:14,height:14,cursor:"pointer",flexShrink:0}})}),(0,Se.jsx)(ze.A,{title:n,placement:"top",arrow:!0,children:(0,Se.jsx)(ge.A,{component:"span",sx:{color:"var(--color-gray-900)",fontWeight:600,fontSize:{xs:"13px",sm:"14px"},lineHeight:"20px",wordBreak:"break-word",overflowWrap:"anywhere"},children:o})})]})},U=b?(0,De.cL)(h):[],H=U.length>0,G=(0,Me.SD)(h.os_name,h.os_version,h.os_flavour,h.android_security_level),q=G&&G.trim().length>0?G:h.os_name||h.os_version||"Unknown",J=(0,Me.VY)(h),Y=J?"".concat(q," (").concat(L("devices.rollingRelease"),")"):q,Q=J?(0,Me.fE)(L,h.os_rolling_release_last_full_update,h.os_rolling_release_has_security_risks_local_detection):void 0,Z=Q?(0,Se.jsxs)(Se.Fragment,{children:[(0,Se.jsx)(ge.A,{sx:{color:"var(--color-gray-900)",fontWeight:600,fontSize:{xs:"13px",sm:"14px"},lineHeight:"20px",wordBreak:"break-word",overflowWrap:"anywhere"},children:Y}),(0,Se.jsx)(ge.A,{sx:{color:"var(--color-gray-500)",fontWeight:500,fontSize:"12px",lineHeight:"16px"},children:Q})]}):Y,X=(0,We.q6)(h),$=t.useMemo(()=>{const e=[];return h.manufacturer&&h.manufacturer.trim().length>0&&e.push(h.manufacturer.trim()),h.model&&h.model.trim().length>0&&e.push(h.model.trim()),e},[h.manufacturer,h.model]),ee=t.useMemo(()=>{const e=[],i=X.trim();return i.length>0&&e.push(i),$.forEach(i=>
1{const o=i.trim();o.length>0&&!e.some(e=>e.toLowerCase()===o.toLowerCase()||e.toLowerCase().includes(o.toLowerCase())||o.toLowerCase().includes(e.toLowerCase()))&&e.push(o)}),e.join(" \xb7 ")},[$,X]),ie=(F?2:3)<=2?"1fr":"repeat(2, minmax(0, 1fr))",oe=!(null!==h&&void 0!==h&&h.xfa_version)&&f&&!0!==(null===h||void 0===h?void 0:h.discovered),ne=!0!==(null===h||void 0===h?void 0:h.discovered)&&!0===(null===h||void 0===h?void 0:h.skip),ae=t.useMemo(()=>{if(null===h||void 0===h||!h.discovered)return null;const e=[],i=Boolean(Array.isArray(null===h||void 0===h?void 0:h.google_mobile_device_ids)&&h.google_mobile_device_ids.length>0||Array.isArray(null===h||void 0===h?void 0:h.google_cloud_identity_device_ids)&&h.google_cloud_identity_device_ids.length>0),o=Boolean(Array.isArray(null===h||void 0===h?void 0:h.microsoft_device_ids)&&h.microsoft_device_ids.length>0),n=Boolean(null===h||void 0===h?void 0:h.okta_discovered);return i&&e.push((0,Se.jsx)(u.A,{component:"img",src:Fe.A,alt:L("devices.deviceDiscoveredGoogle"),sx:{width:16,height:16}},"google")),o&&e.push((0,Se.jsx)(u.A,{component:"img",src:Re.A,alt:L("devices.deviceDiscoveredMicrosoft"),sx:{width:16,height:16}},"microsoft")),n&&e.push((0,Se.jsx)(u.A,{component:"img",src:Oe,alt:L("devices.deviceDiscoveredOkta"),sx:{width:16,height:16}},"okta")),0===e.length?null:{startIcon:(0,Se.jsx)(u.A,{sx:{display:"inline-flex",alignItems:"center",gap:"4px"},children:e}),additionalIcons:null}},[h,L]),te=t.useMemo(()=>!0===(null===h||void 0===h?void 0:h.managed)||null!==h&&void 0!==h&&h.intune_enrolled?L("Devices.managedByOrganization"):L("Devices.managedByUser"),[null===h||void 0===h?void 0:h.intune_enrolled,null===h||void 0===h?void 0:h.managed,L]),se="agentless"===(null===h||void 0===h||null===(n=h.xfa_version)||void 0===n?void 0:n.toLowerCase()),le=(()=>{if(!j||null===h||void 0===h||!h.xfa_version||se)return{isOutdated:!1,targetVersion:null,messageKey:null};if(S){if(S["is-latest"])return{isOutdated:!1,targetVersion:null,messageKey:null};if(!1===S["is-supported-major"])return{isOutdated:!0,targetVersion:j,messageKey:"devices.details.xfaUnsupportedMajor"};if(S["is-latest-for-major"]||S["is-latest-for-channel"])return{isOutdated:!1,targetVersion:null,messageKey:null};return{isOutdated:!0,targetVersion:S["latest-for-major"]||S["latest-for-channel"]||j,messageKey:S.channel?"devices.details.xfaOutdatedChannel":"devices.details.xfaOutdatedTooltip"}}return{isOutdated:j!==h.xfa_version,targetVersion:j,messageKey:"devices.details.xfaOutdatedTooltip"}})(),re=le.isOutdated,de=(0,K.Gd)(null===S||void 0===S?void 0:S.channel),ce=oe?(0,Se.jsxs)(u.A,{sx:{display:"flex",alignItems:"center",gap:"6px"},children:[(0,Se.jsx)(ge.A,{sx:{color:"var(--color-gray-900)",fontWeight:600,fontSize:{xs:"13px",sm:"14px"},lineHeight:"20px"},children:L("devices.details.xfaUnknownVersion")}),(0,Se.jsx)(ze.A,{title:L(ne?"devices.details.xfaSkippedVersionTooltip":"devices.details.xfaUnknownVersionTooltip"),arrow:!0,placement:"top",children:(0,Se.jsx)(Le.A,{tabIndex:0,role:"button","aria-label":L(ne?"devices.details.xfaSkippedVersionTooltip":"devices.details.xfaUnknownVersionTooltip"),sx:{fontSize:18,color:"var(--color-gray-400)",cursor:"pointer"}})})]}):re?(0,Se.jsxs)(u.A,{sx:{display:"flex",alignItems:"center",gap:"6px"},children:[(0,Se.jsx)(ze.A,{title:L(le.messageKey||"devices.details.xfaOutdatedTooltip",{version:le.targetVersion,channel:null===S||void 0===S?void 0:S.channel,current:h.xfa_version}),arrow:!0,placement:"top",children:(0,Se.jsx)(u.A,{component:"img",src:Be.A,alt:L("devices.details.xfaOutdated"),sx:{width:14,height:14,cursor:"pointer"}})}),(0,Se.jsx)(ge.A,{sx:{color:"var(--color-gray-900)",fontWeight:600,fontSize:{xs:"13px",sm:"14px"},lineHeight:"20px"},children:h.xfa_version}),de&&(0,Se.jsx)(x.A,{label:null===S||void 0===S?void 0:S.channel,size:"small",sx:K._v})]}):se?(0,Se.jsxs)(u.A,{sx:{display:"flex",alignItems:"center",gap:"6px"},children:[(0,Se.jsx)(ge.A,{sx:{color:"var(--color-gray-400)",fontWeight:600,fontSize:{xs:"13px",sm:"14px"},lineHeight:"20px"},children:h.xfa_version}),(0,Se.jsx)(He.A,{type:Ge.Y.AGENTLESS})]}):(0,Se.jsxs)(u.A,{sx:{display:"flex",alignItems:"center",gap:"6px"},children:[(0,Se.jsx)(ge.A,{sx:{color:"var(--color-gray-900)",fontWeight:600,fontSize:{xs:"13px",sm:"14px"},lineHeight:"20px"},children:h.xfa_version||L("devices.notInstalled")}),de&&h.xfa_version&&(0,Se.jsx)(x.A,{label:null===S||void 0===S?void 0:S.channel,size:"small",sx:K._v})]}),ue=t.useMemo(()=>{var e,i;const o=null===h||void 0===h||null===(e=h.battery)||void 0===e?void 0:e.health,n=null===h||void 0===h||null===(i=h.battery)||void 0===i?void 0:i.max_capacity,a=void 0!==o&&null!==o,t=void 0!==n&&null!==n,s=a?"".concat(o).trim():void 0,l="string"===typeof s&&"unknown"===s.toLowerCase();return a&&t&&!l?"".concat(s," - ").concat(n,"%"):a&&!l?s:!a&&t?"".concat(Number(n).toFixed(1),"%"):l?L("devices.status.unknown"):null},[null===h||void 0===h||null===(a=h.battery)||void 0===a?void 0:a.health,null===h||void 0===h||null===(l=h.battery)||void 0===l?void 0:l.max_capacity,L]),pe=L("devices.status.unknown"),ve="".concat(null!==ue&&void 0!==ue?ue:pe).trim(),xe=pe.trim().toLowerCase(),he=0===ve.length||ve.toLowerCase()===xe||"unknown"===ve.toLowerCase()?(0,Se.jsxs)(u.A,{sx:{display:"flex",alignItems:"center",gap:"6px"},children:[(0,Se.jsx)(ge.A,{sx:{color:"var(--color-gray-900)",fontWeight:600,fontSize:{xs:"13px",sm:"14px"},lineHeight:"20px"},children:pe}),(0,Se.jsx)(ze.A,{title:L("devices.details.batteryUnknownTooltip"),arrow:!0,placement:"top",children:(0,Se.jsx)(Le.A,{sx:{fontSize:18,color:"var(--color-gray-400)"}})})]}):ve,me=(0,K.NP)({snoozed_until:null!==C&&void 0!==C?C:void 0});return(0,Se.jsxs)("div",{className:"device-details-outer-container",children:[(0,Se.jsxs)(u.A,{sx:{display:"flex",alignItems:"center",marginBottom:"8px",gap:"8px",flexWrap:"wrap"},children:[(0,Se.jsxs)(u.A,{sx:{display:"flex",alignItems:"center",gap:"8px",flexWrap:"wrap"},children:[(0,Se.jsx)("div",{className:"statisticTitle",children:L("devices.details.title")}),me&&C&&(0,Se.jsx)(ze.A,{title:(0,Se.jsx)(Ve.j,{snoozedUntil:C,reason:z}),arrow:!0,placement:"top",children:(0,Se.jsx)(u.A,{component:"span",onClick:E,sx:{display:"inline-flex",cursor:E?"pointer":"default"},children:(0,Se.jsx)(Ee,{variant:"snoozed",startIcon:(0,Se.jsx)(_e.M,{}),label:"".concat(L("devices.snoozedUntil")," ").concat((0,K.Lr)(C,null!==(d=null===N||void 0===N?void 0:N.resolvedLanguage)&&void 0!==d?d:null===N||void 0===N?void 0:N.language))})})}),m.map((e,i)=>{const o=(0,Se.jsx)(Ee,{label:e.label,variant:e.variant,startIcon:"lostConnection"===e.variant?(0,Se.jsx)(u.A,{component:"img",src:Ne.A,alt:"",sx:{width:14,height:14,filter:"brightness(0) saturate(100%) invert(32%) sepia(85%) saturate(1406%) hue-rotate(359deg) brightness(92%) contrast(92%)"}}):void 0});return e.tooltip?(0,Se.jsx)(ze.A,{title:"lostConnection"===e.variant?(0,Se.jsx)(Ke.F,{description:String(e.tooltip)}):e.tooltip,arrow:!0,placement:"top",children:(0,Se.jsx)(u.A,{component:"span",sx:{dis
1play:"inline-flex"},children:o})},i):(0,Se.jsx)(t.Fragment,{children:o},i)}),null!==P&&(0,Se.jsx)(Ee,{label:L("devices.status.deviceBlockedAgo",{time:(0,V.cS)(P,null!==(c=null===N||void 0===N?void 0:N.language)&&void 0!==c?c:"en")}),variant:"blocked"}),"skippedVerification"===(0,We.Md)(h)&&(0,Se.jsx)(ze.A,{title:L("Devices.verificationTooltip.skippedVerification"),arrow:!0,placement:"top",children:(0,Se.jsx)(u.A,{component:"span",sx:{display:"inline-flex"},children:(0,Se.jsx)(Ee,{label:L("Users.onboardingStatus.skippedVerification"),variant:"skippedVerification"})})}),h.discovered&&(0,Se.jsx)(ze.A,{title:(0,We.CW)(h)?L("devices.statusTooltip.discovered",{providers:(0,We.CW)(h)}):L("devices.statusTooltip.discoveredUnknownProvider"),arrow:!0,placement:"top",children:(0,Se.jsx)(u.A,{component:"span",sx:{display:"inline-flex"},children:(0,Se.jsx)(Ee,{label:L("Users.discovered"),variant:"discovered",startIcon:null!==(p=null===ae||void 0===ae?void 0:ae.startIcon)&&void 0!==p?p:void 0,endAdornment:null!==(v=null===ae||void 0===ae?void 0:ae.additionalIcons)&&void 0!==v?v:null})})})]}),k&&(0,Se.jsx)(u.A,{className:T>0?"flash-updated":void 0,sx:{marginLeft:{xs:0,sm:"auto"},marginRight:0,borderRadius:"6px"},children:(0,Se.jsx)(Ue.Q,{tag:k,onRemove:A})},T)]}),(0,Se.jsxs)("div",{className:"device-details-inner-container",children:[(0,Se.jsxs)(u.A,{sx:{display:"flex",flexDirection:{xs:"column",md:"row"},rowGap:{xs:"16px",md:"16px"},columnGap:{xs:"16px",md:"32px"},justifyContent:{md:"space-between"},alignItems:{md:"flex-start"},flexWrap:{xs:"wrap",md:"nowrap"}},children:[(0,Se.jsxs)(u.A,{sx:{flex:{xs:"1 1 100%",md:"0 1 auto"},flexBasis:{xs:"100%",md:"min(60%, 1000px)"},maxWidth:{xs:"100%",md:"min(60%, 1000px)"},display:"grid",gridTemplateColumns:{xs:"1fr",sm:"repeat(2, 1fr)",lg:"repeat(3, 1fr)"},gap:{xs:"16px",sm:"26px"},paddingTop:{xs:"8px",sm:"16px"},paddingBottom:{xs:"8px",sm:"16px"},borderRadius:"6px",minWidth:0},children:[(0,Se.jsx)(Je,{label:L("devices.details.owner"),value:h.email?(0,Se.jsx)(ge.A,{component:"span",onClick:()=>R("/devices?tab=devices&search=".concat(encodeURIComponent(h.email))),sx:{color:"var(--color-gray-900)",fontWeight:600,fontSize:{xs:"13px",sm:"14px"},lineHeight:"20px",wordBreak:"break-word",overflowWrap:"anywhere",cursor:"pointer","&:hover":{textDecoration:"underline"}},children:h.email}):"Unknown"}),(0,Se.jsx)(Je,{label:L("devices.details.deviceName"),value:(null===(g=h.computer_name)||void 0===g?void 0:g.name)||h.model||"Unknown"}),(0,Se.jsx)(Je,{label:L("Devices.managedBy"),value:te}),h.timestamp_submitted_verified||h.timestamp_submitted_discovery?(0,Se.jsxs)(Se.Fragment,{children:[h.timestamp_submitted_verified&&(0,Se.jsx)(Je,{label:L("devices.details.lastSeenVerified"),value:O(h.timestamp_submitted_verified)}),h.timestamp_submitted_discovery&&(0,Se.jsx)(Je,{label:L("devices.details.lastSeenDiscovery"),value:O(h.timestamp_submitted_discovery)})]}):(0,Se.jsx)(Je,{label:L("devices.details.lastSeen"),value:O(h.timestamp_submitted)}),h.timestamp_last_notified&&(0,Se.jsx)(Je,{label:L("devices.lastNotified"),value:O(h.timestamp_last_notified,!1)}),(0,Se.jsx)(Je,{label:L(F?"devices.details.xfaMobileApp":"devices.details.xfaDesktopAgent"),value:ce})]}),(0,Se.jsxs)(u.A,{sx:{flex:{xs:"1 1 100%",md:"1 1 auto"},flexBasis:{xs:"100%",md:"min(calc(40% - 32px), 680px)"},maxWidth:{xs:"100%",md:"min(calc(40% - 32px), 680px)"},display:"grid",gridTemplateColumns:{xs:"1fr",sm:ie},gap:{xs:"16px",sm:"24px"},padding:{xs:"8px",sm:"16px"},borderRadius:"6px",backgroundColor:"var(--color-gray-100)",alignSelf:{xs:"stretch",md:"flex-start"},minWidth:0,justifyItems:"start",textAlign:"left"},children:[(0,Se.jsx)(Je,{label:L("devices.details.hardware"),value:ee}),(0,Se.jsx)(Je,{label:L("devices.details.operatingSystem"),value:Z}),!F&&(0,Se.jsx)(Je,{label:L("devices.details.batteryHealth"),value:he,fullWidth:!0})]})]}),w&&(0,Se.jsx)(u.A,{className:M>0?"flash-updated":void 0,sx:{marginTop:"16px",borderRadius:"6px"},children:(0,Se.jsx)(Te,{notes:w,onEditNotes:_})},M),me&&z&&z.trim().length>0&&(0,Se.jsx)(u.A,{sx:{marginTop:"16px"},children:(0,Se.jsx)(Je,{label:L("devices.snoozeDialog.reason"),value:z})}),H&&(0,Se.jsxs)(u.A,{sx:{backgroundColor:"var(--color-red-600)",borderRadius:"6px",padding:"8px",display:"flex",flexDirection:"column",gap:"6px",marginTop:"16px",width:{xs:"100%",sm:"fit-content"},maxWidth:"100%"},children:[(0,Se.jsxs)(u.A,{sx:{display:"flex",alignItems:"center",gap:"6px",flexWrap:"wrap"},children:[(0,Se.jsx)("img",{src:Pe.A,alt:"warning",style:{width:"16px",height:"16px",flexShrink:0}}),(0,Se.jsx)(ge.A,{sx:{color:"white",fontWeight:600,fontSize:{xs:"13px",sm:"14px"},lineHeight:"20px",marginBottom:"1px",flex:1,minWidth:0},children:L("devices.details.cveWarning",{count:U.length})})]}),(0,Se.jsx)(u.A,{sx:{display:"flex",flexWrap:"wrap",gap:"6px"},children:U.map(e=>(0,Se.jsx)(Qe,{cve:e,t:L},e.id))})]})]})]})},Je=e=>{let i=e.label,o=e.value,n=e.fullWidth;const a="string"===typeof o||"number"===typeof o||null===o;return(0,Se.jsxs)(u.A,{sx:{minWidth:0,maxWidth:"100%",gridColumn:n?{xs:"auto",sm:"1 / span 2"}:void 0},children:[(0,Se.jsx)(ge.A,{sx:{color:"var(--color-gray-500)",fontWeight:500,fontSize:{xs:"13px",sm:"14px"},lineHeight:"20px"},children:i}),a?(0,Se.jsx)(ge.A,{sx:{color:"var(--color-gray-900)",fontWeight:600,fontSize:{xs:"13px",sm:"14px"},lineHeight:"20px",wordBreak:"break-word",overflowWrap:"anywhere"},children:null!==o&&void 0!==o?o:""}):(0,Se.jsx)(u.A,{children:o})]})};function Ye(e){return e>=9?"CRITICAL":e>=7?"HIGH":e>=4?"MEDIUM":e>=.1?"LOW":"NONE"}const Qe=e=>{var i,o,n,a,t,s;let l=e.cve,r=e.t;const d=function(e){var i,o,n,a;const t=null===(i=e.descriptions)||void 0===i||null===(o=i.find(e=>"en"===e.lang))||void 0===o?void 0:o.value;return t||(null===(n=e.descriptions)||void 0===n||null===(a=n[0])||void 0===a?void 0:a.value)}(l),c=null!==(i=l.categories)&&void 0!==i&&i.length?l.categories.join(", "):void 0,p=function(e){var i,o,n,a,t,s,l,r,d,c,u,p,v,x,g;const h=null===(i=e.metrics)||void 0===i||null===(o=i.cvssMetricV31)||void 0===o||null===(n=o[0])||void 0===n||null===(a=n.cvssData)||void 0===a?void 0:a.baseScore;if(null!=h)return Ye(h);const m=null===(t=e.metrics)||void 0===t||null===(s=t.cvssMetricV30)||void 0===s||null===(l=s[0])||void 0===l||null===(r=l.cvssData)||void 0===r?void 0:r.baseScore;if(null!=m)return Ye(m);const f=null===(d=e.metrics)||void 0===d||null===(c=d.cvssMetricV2)||void 0===c||null===(u=c[0])||void 0===u?void 0:u.baseSeverity;if(f)return f;const y=null===(p=e.metrics)||void 0===p||null===(v=p.cvssMetricV40)||void 0===v||null===(x=v[0])||void 0===x||null===(g=x.cvssData)||void 0===g?void 0:g.baseScore;return null!=y?Ye(y):void 0}(l),v=l.cisaRequiredAction||(null===(o=l.kev)||void 0===o?void 0:o.requiredAction),g=l.cisaActionDue||(null===(n=l.kev)||void 0===n?void 0:n.dueDate),h=null===(a=l.kev)||void 0===a?void 0:a.knownRansomwareCampaignUse,m=l.id?"https://nvd.nist.gov/vuln/detail/".concat(l.id):void 0,f=d||c||p||v||g||h,y=(0,Se.jsx)(x.A,{label:f?(0,Se.jsxs)(u.A,{sx:{display:"flex",alignItems:"center",gap:"4px"},children:[null===(t=l.id)||void 0===t?void 0:t.toUpperCase(),(0,Se.jsx)(Le.A,{sx:{fontSize:12}})]}):null===(s=l.id)||void 0===s?void 0:s.toUpperCase(),component:m?"a":"div",href:m,target:"_blank",rel:"noopener noreferrer",clickable:!!m,sx:{height:"24px",borderRadius:"16px",backgroundColor:"var(--color-red-50) !important",color:"var(--color-red-700) !important",fontWeight:600,fontSize:"12px",lineHeight:"18px",letterSpacing:"0px",padding:"4px 12px",border:"none",cursor:"pointer",textDecoration:"none","&:hover":{backgroundColor:"var(--color-red-100) !important"},"& .MuiChip-label":{padding:"0"}}});if(!f)return y;const b={fontSize:"12px",lineHeight:"16px"};return(0,Se.jsx)(ze.A,{arrow:!0,placement:"top",title:(0,Se.jsxs)(u.A,{sx:{display:"flex",flexDirection:"column",gap:"4px",padding:"4px 0",maxWidth:"360px"},children:[p&&(0,Se.jsxs)(ge.A,{sx:b,children:[(0,Se.jsxs)("strong",{children:[r("devices.details.cveTooltipSeverity"),":"]})," ",p]}),c&&(0,Se.jsxs)(ge.A,{sx:b,children:[(0,Se.jsxs)("strong",{children:[r("devices.details.cveTooltipCategory"),":"]})," ",c]}),v&&(0,Se.jsxs)(ge.A,{sx:b,children:[(0,Se.jsxs)("strong",{children:[r("devices.details.cveTooltipRequiredAction"),":"]})," ",v]}),g&&(0,Se.jsxs)(ge.A,{sx:b,children:[(0,Se.jsxs)("strong",{children:[r("devices.details.cveTooltipActionDue"),":"]})," ",g]}),h&&(0,Se.jsxs)(ge.A,{sx:b,children:[(0,Se.jsxs)("strong",{children:[r("devices.details.cveTooltipR
1ansomwareUse"),":"]})," ",h]}),d&&(0,Se.jsxs)(ge.A,{sx:b,children:[(0,Se.jsxs)("strong",{children:[r("devices.details.cveTooltipDescription"),":"]})," ",d]})]}),children:y})};var Ze=o(57918),Xe=o(14857),$e=o(66096),ei=o(70693),ii=o(1320),oi=o(15769),ni=o(69780),ai=o(9213),ti=o(21671),si=o(34075),li=o(21923),ri=o(99699),di=o(6858),ci=o(87940);o(97172);const ui=o.p+"static/media/unsafe-filled-icon.573ded6bc1b9bce42efb11d38e0b00d2.svg";var pi=o(42254),vi=o(49992),xi=o(27393),gi=o(72970),hi=o(53040),mi=o(92227);const fi=o.p+"static/media/security-alerts-action.02e82f02204a1b104f6226966e280925.svg";const yi=o.p+"static/media/enforcement-setup-action.d341880462da4aa6fe46dfd27baef935.svg";const bi=o.p+"static/media/action-arrow.5f46c7e90b3bbb5a7175f04723b9ae11.svg";var ki=o(50256),Ai=o(98);const wi=o.p+"static/media/bolt-icon.4e1e5b498d7a23c584ddf939a355a62c.svg";var _i=o(56424);const ji=e=>{let i=e.title,o=e.description;const n=(0,r.Bd)().t;return(0,Se.jsx)(_i.__,{pages:[{title:i,body:(0,Se.jsx)("p",{children:o})}],arrow:"bottom",trigger:"hover",children:(0,Se.jsx)(x.A,{"data-testid":"fix-available-tag",label:(0,Se.jsxs)("span",{style:{fontSize:"10px",display:"flex",alignItems:"center",gap:"4px"},children:[(0,Se.jsx)("img",{src:wi,alt:"",style:{width:"12px",height:"12px",opacity:.7}}),n("devices.checks.fixAvailable")]}),size:"small",sx:{height:"18px",flexShrink:0,backgroundColor:"#ffffff",border:"1px solid #e0e0e0",color:"#666",cursor:"default","& .MuiChip-label":{padding:"0 6px"},"&:hover":{backgroundColor:"#ffffff"}}})})};o(21924);const Si=260,Ci="1%",zi=56,Ei=e=>{let i=e.check,o=e.intendedAction,n=e.launcher,a=e.onPolicyCheckEdit,t=e.navigate;const s=(0,M.y_)(i.checkKey,i.policyId,o);s&&a?a(s,n):t((e=>{if(!(0,M.TT)(e.policyId))return"/policies";const i=(0,M.YW)(e.checkKey),o=new URLSearchParams({tab:i.fallback.tabKey});return i.fallback.editorKey&&o.set("focus",i.fallback.editorKey),"/policies/".concat(e.policyId,"?").concat(o.toString())})(i))},Ii=()=>{const e=(0,r.Bd)().t;return(0,Se.jsx)(ji,{title:e("devices.checks.fixAvailableTag.title"),description:e("devices.checks.fixAvailableTag.description")})},Ti={os_uptodate:"applications.policies.osExplanation",os_autoupdate:"applications.policies.osAutoUpdateExplanation",chrome_uptodate:"applications.policies.browserExplanation",firefox_uptodate:"applications.policies.browserExplanation",edge_uptodate:"applications.policies.browserExplanation",safari_uptodate:"applications.policies.browserExplanation",brave_uptodate:"applications.policies.browserExplanation",arc_uptodate:"applications.policies.browserExplanation",vivaldi_uptodate:"applications.policies.browserExplanation",opera_uptodate:"applications.policies.browserExplanation",diskencryption_active:"applications.policies.diskEncryptionExplanation",authentication_active:"applications.policies.screenlockExplanation",antivirus_enabled:"applications.policies.antivirusExplanation",passwordmanager:"applications.policies.passwordmanagerExplanation",biometrics:"applications.policies.biometricsExplanation",firewall_enabled:"applications.policies.firewallExplanation",dns_servers_compliant:"applications.policies.dnsExplanation",find_my_device_enabled:"applications.policies.findmydeviceExplanation",jailbroken:"applications.policies.jailbrokenExplanation",rooted:"applications.policies.jailbrokenExplanation",developer_mode:"applications.policies.developerModeExplanation",reboot:"applications.policies.rebootExplanation",windows_recall:"applications.policies.windowsRecallExplanation",remote_login_enabled:"applications.policies.remoteLoginExplanation",remote_management_enabled:"applications.policies.remoteManagementExplanation",remote_scripting_enabled:"applications.policies.remoteScriptingExplanation",screen_sharing_enabled:"applications.policies.screenSharingExplanation",unattended_remote_access_enabled:"applications.policies.unattendedRemoteAccessExplanation",secrets_in_environment:"applications.policies.secretsInEnvironmentExplanation",autonomous_agents_present:"applications.policies.autonomousAgentsPresentExplanation",unguarded_elevation:"applications.policies.unguardedElevationExplanation",unsafe_ai_mode:"applications.policies.unsafeAiModeExplanation",vanta_client_running:"applications.policies.vantaClientExplanation",intune_enrolled:"applications.policies.intuneEnrolledExplanation",aikido_s
1afe_chain:"applications.policies.aikidoSafeChainExplanation",aikido_endpoint:"applications.policies.aikidoEndpointExplanation"},Di=e=>{let i=e.checks,o=e.sortField,n=e.sortDirection,a=e.onSort,t=e.noPoliciesApplied,s=void 0!==t&&t,l=e.awarenessConfigured,d=void 0!==l&&l,c=e.enforcementConfigured,p=void 0!==c&&c,v=e.awarenessLocked,x=void 0!==v&&v,g=e.enforcementLocked,h=void 0!==g&&g,m=e.emptyMessage,f=e.onPolicyCheckEdit;const y=(0,r.Bd)().t,b=(0,Xe.A)(),k=(0,$e.A)(b.breakpoints.down("md"));return 0===i.length?(0,Se.jsx)(ei.A,{variant:"outlined",sx:{padding:"40px 24px",textAlign:"center",boxShadow:"none"},children:(0,Se.jsx)(ge.A,{sx:{color:"var(--color-gray-500)",fontSize:"14px"},children:null!==m&&void 0!==m?m:y("devices.checks.emptyFilter")})}):k?(0,Se.jsx)(u.A,{sx:{display:"flex",flexDirection:"column",gap:"8px"},children:i.map((e,i)=>(0,Se.jsxs)(ei.A,{component:"article","aria-label":e.name,sx:{padding:"16px",border:"1px solid var(--color-gray-200)",borderRadius:"8px",boxShadow:"none",overflow:"hidden"},children:[(0,Se.jsxs)(u.A,{"data-device-check-card-header":"true",sx:{display:"grid",gridTemplateColumns:"minmax(0, 1fr) auto",alignItems:"start",columnGap:"8px",marginBottom:"12px"},children:[(0,Se.jsxs)(u.A,{sx:{display:"flex",alignItems:"center",flexWrap:"wrap",gap:"6px",minWidth:0},children:[(0,Se.jsx)(ge.A,{sx:{fontWeight:600,fontSize:"14px",lineHeight:"20px",color:"var(--color-gray-900)"},children:e.name}),e.betaLabelKey&&(0,Se.jsx)(Ai.A,{text:y(e.betaLabelKey)}),e.fixSupported&&(0,Se.jsx)(Ii,{}),(0,Se.jsx)(Bi,{checkKey:e.checkKey,extraInfo:e.extraInfo,versionPolicySettings:e.versionPolicySettings,explanationExtraKeyOverride:e.explanationExtraKey})]}),!s&&(0,Se.jsx)(u.A,{sx:{display:"flex",margin:"-6px -8px 0 0","& .MuiIconButton-root":{width:"32px",height:"32px",padding:"4px"}},children:(0,Se.jsx)(Vi,{check:e,awarenessConfigured:d,enforcementConfigured:p,awarenessLocked:x,enforcementLocked:h,onPolicyCheckEdit:f})})]}),(0,Se.jsxs)(u.A,{sx:{display:"flex",flexDirection:"column",gap:"12px"},children:[(0,Se.jsx)(Ki,{extraInfo:e.extraInfo,outdatedDays:e.outdatedDays,hasCVE:e.hasCVE,isMobile:!0}),!s&&(0,Se.jsx)(u.A,{"data-device-check-policy-state":"true",sx:{width:"100%",maxWidth:"100%",overflow:"hidden"},children:(0,Se.jsx)(Ui,{check:e,awarenessConfigured:d,enforcementConfigured:p,awarenessLocked:x,enforcementLocked:h,onPolicyCheckEdit:f})})]})]},i))}):(0,Se.jsx)(ii.A,{component:ei.A,"data-device-check-table-container":"true",sx:{maxWidth:"100%",containerType:"inline-size",containerName:"device-checks-table"},children:(0,Se.jsxs)(oi.A,{sx:{width:"100%",tableLayout:"auto"},children:[(0,Se.jsx)(ni.A,{children:(0,Se.jsxs)(ai.A,{sx:{"& td, & th":{borderColor:"var(--color-gray-200)"}},children:[(0,Se.jsx)(Mi,{label:y("devices.checks.table.deviceCheck"),field:"name",sortField:o,sortDirection:n,onSort:a,width:"".concat(Si,"px"),minWidth:Si}),(0,Se.jsx)(ti.A,{sx:{width:Ci,whiteSpace:"nowrap",fontSize:{xs:"13px",sm:"14px"}},children:y("devices.checks.table.extraInfo")}),!s&&(0,Se.jsx)(ti.A,{sx:{width:"100%",minWidth:0,whiteSpace:"nowrap",fontSize:{xs:"13px",sm:"14px"}},children:y("devices.checks.table.definedInPolicy")}),!s&&(0,Se.jsx)(ti.A,{"aria-label":y("devices.checks.table.actions"),"data-device-check-actions":"true",sx:{position:"sticky",right:0,zIndex:2,width:zi,minWidth:zi,maxWidth:zi,paddingLeft:"8px",paddingRight:"8px",backgroundColor:"var(--color-gray-100)"}})]})}),(0,Se.jsx)(si.A,{children:i.map((e,i)=>(0,Se.jsx)(Wi,{check:e,index:i,noPoliciesApplied:s,awarenessConfigured:d,enforcementConfigured:p,awarenessLocked:x,enforcementLocked:h,onPolicyCheckEdit:f},i))})]})})},Mi=e=>{let i=e.label,o=e.field,n=e.sortField,a=e.sortDirection,t=e.onSort,s=e.width,l=e.minWidth;const r=n===o;return(0,Se.jsx)(ti.A,{onClick:()=>t(o),sx:{cursor:"pointer",userSelect:"none",width:s,minWidth:l,whiteSpace:"nowrap",fontSize:{xs:"13px",sm:"14px"},transition:"background-color 150ms ease"},children:(0,Se.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"4px"},children:[i,(0,Se.jsx)(ci.A,{showFirst:r,children:[(0,Se.jsx)(ri.A,{fontSize:"small",style:{transform:"asc"===a?"rotate(180deg)":"rotate(0deg)",transition:"transform 180ms var(--motion-ease-out, cubic-bezier(0.23, 1, 0.32, 1))"}},"sorted"),(0,Se.jsx)(di.A,{fontSize:"small"},"unsorted")]})]})})},Wi=e=>{let i=e.check,o=e.index,n=e.noPoliciesApplied,a=void 0!==n&&n,t=e.awarenessConfigured,s=e.enforcementConfigured,l=e.awarenessLocked,d=e.enforcementLocked,c=e.onPolicyCheckEdit;const p=(0,r.Bd)().t;return(0,Se.jsxs)(ai.A,{sx:{height:{xs:"auto",sm:"72px"},backgroundColor:o%2===0?"white":"gray.50",'& td:not([data-device-check-actions="true"]), & th':{borderColor:"var(--color-gray-200)",fontSize:{xs:"13px",sm:"14px"},padding:{xs:"12px 8px",sm:"16px"}},'& td[data-device-check-actions="true"]':{borderColor:"var(--color-gray-200)",fontSize:{xs:"13px",sm:"14px"},padding:"0 8px",overflow:"visible"}},children:[(0,Se.jsx)(ti.A,{children:(0,Se.jsxs)(u.A,{sx:{display:"flex",alignItems:"center",flexWrap:"wrap",gap:"6px"},children:[(0,Se.jsx)(ge.A,{variant:"body2",sx:{fontWeight:600,fontSize:"14px",lineHeight:"20px",letterSpacing:0,color:"var(--color-gray-900)"},children:i.name}),i.betaLabelKey&&(0,Se.jsx)(Ai.A,{text:p(i.betaLabelKey)}),i.fixSupported&&(0,Se.jsx)(Ii,{}),(0,Se.jsx)(Bi,{checkKey:i.checkKey,extraInfo:i.extraInfo,versionPolicySettings:i.versionPolicySettings,explanationExtraKeyOverride:i.explanationExtraKey})]})}),(0,Se.jsx)(ti.A,{sx:{width:Ci,whiteSpace:"nowrap"},children:(0,Se.jsx)(Ki,{extraInfo:i.extraInfo,outdatedDays:i.outdatedDays,hasCVE:i.hasCVE}
1)}),!a&&(0,Se.jsx)(ti.A,{sx:{minWidth:0,overflow:"hidden"},children:(0,Se.jsx)(Ui,{check:i,awarenessConfigured:t,enforcementConfigured:s,awarenessLocked:l,enforcementLocked:d,onPolicyCheckEdit:c})}),!a&&(0,Se.jsx)(ti.A,{"data-device-check-actions":"true",sx:{position:"sticky",right:0,zIndex:1,width:zi,minWidth:zi,maxWidth:zi,padding:"0 8px",overflow:"visible",backgroundColor:"inherit"},children:(0,Se.jsx)(Vi,{check:i,awarenessConfigured:t,enforcementConfigured:s,awarenessLocked:l,enforcementLocked:d,onPolicyCheckEdit:c})})]})},Pi={diskencryption_active:"discovery.DiskEncryption.tooltip_extra",antivirus_enabled:"discovery.Antivirus.tooltip_extra"},Bi=e=>{let i=e.checkKey,o=e.extraInfo,n=e.versionPolicySettings,a=e.explanationExtraKeyOverride;const t=(0,r.Bd)().t,s=Ti[i];if(!s)return null;let l=t(s);const d=null!==a&&void 0!==a?a:Pi[i];if(d&&(l+="\n\n"+t(d)),"version"===(null===o||void 0===o?void 0:o.type)&&n){const e=[];n.allowsMajorVersions&&e.push(t("applications.policies.majorVersionsAllowExplanation")),n.allowsBeta&&e.push(t("applications.policies.betaVersionsAllowExplanation")),e.length>0&&(l+="\n\n"+e.join("\n"))}return(0,Se.jsx)(ze.A,{title:l,arrow:!0,placement:"top",children:(0,Se.jsx)(Le.A,{sx:{fontSize:16,color:"var(--color-gray-400)",cursor:"pointer",flexShrink:0}})})},Li=e=>{let i=e.label,o=e.icon,a=e.tone,t=e.onClick,s=e.actionRequired,l=void 0!==s&&s,r=e.secondaryLabel,d=e.onTooltipAnchorChange,c=e.first,p=void 0!==c&&c,v=e.last,x=void 0!==v&&v;const g=(0,n.A)({display:"inline-flex",alignItems:"center",gap:"2px",minHeight:"32px",padding:"6px 8px",boxSizing:"border-box",marginLeft:p?0:"-1px",border:"1px solid var(--color-border, #d9dce0)",borderRadius:"".concat(p?"6px":"0"," ").concat(x?"6px":"0"," ").concat(x?"6px":"0"," ").concat(p?"6px":"0"),backgroundColor:"white",color:{goal:"var(--Gray-600, #4B5057)",success:"#1D4ED8",danger:"var(--red-600, #DC2626)",warning:"var(--yellow-800, #92400E)",muted:"var(--Gray-400, #9BA1AB)",upgrade:"var(--color-purple-600, #7c3aed)"}[a],whiteSpace:"nowrap"},"upgrade"===a&&{flexWrap:"wrap",minWidth:0,maxWidth:"100%"}),h=(0,Se.jsxs)(Se.Fragment,{children:["upgrade"===a?(0,Se.jsxs)(Se.Fragment,{children:[(0,Se.jsxs)(u.A,{component:"span",sx:{display:"inline-flex",alignItems:"center",gap:"4px",margin:"-2px 0",padding:"2px 8px 2px 3px",borderRadius:"12px",backgroundColor:"var(--color-purple-100, #ede9fe)",color:"#7c3aed",flexShrink:0,whiteSpace:"nowrap"},children:[(0,Se.jsx)(ki.A,{size:14,"aria-hidden":"true"}),(0,Se.jsx)(ge.A,{component:"span",sx:{fontFamily:"Manrope",fontSize:"12px",fontStyle:"normal",lineHeight:"18px",fontWeight:600,color:"inherit"},children:i})]}),r&&(0,Se.jsx)(ge.A,{component:"span",sx:{fontFamily:"Manrope",fontSize:"12px",fontStyle:"normal",lineHeight:"18px",fontWeight:600,color:"var(--color-gray-400)",whiteSpace:"normal",minWidth:0},children:r})]}):(0,Se.jsxs)(Se.Fragment,{children:[(0,Se.jsx)(u.A,{component:"span","aria-hidden":"true",sx:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:14,height:14,flexShrink:0,"& > img":{width:14,height:14},"& > svg":{width:14,height:14,fontSize:14}},children:o}),(0,Se.jsx)(ge.A,{component:"span",sx:{fontFamily:"Manrope",fontSize:"12px",lineHeight:"18px",fontStyle:"normal",fontWeight:600,color:"inherit"},children:i})]}),l&&(0,Se.jsx)(u.A,{component:"img",src:bi,alt:"",sx:{width:14,height:14,flexShrink:0}})]});return void 0===t?(0,Se.jsx)(u.A,{component:"span",onMouseEnter:e=>null===d||void 0===d?void 0:d(e.currentTarget),"data-policy-tone":a,sx:g,children:h}):(0,Se.jsx)(li.A,{onClick:e=>t(e.currentTarget),onMouseEnter:e=>null===d||void 0===d?void 0:d(e.currentTarget),onFocus:e=>null===d||void 0===d?void 0:d(e.currentTarget),"data-action-required":l?"true":void 0,"data-policy-tone":a,sx:(0,n.A)((0,n.A)({},g),{},{cursor:"pointer","&:hover":{backgroundColor:"var(--color-gray-50, #f9fafb)",zIndex:1},"&.Mui-focusVisible":{outline:"2px solid var(--color-blue-600, #2563eb)",outlineOffset:"1px",zIndex:2}}),children:h})},Ni=e=>{let i=e.icon,o=e.label,n=e.description,a=e.muted,t=void 0!==a&&a;return(0,Se.jsxs)(u.A,{sx:{display:"grid",gridTemplateColumns:{xs:"minmax(0, 1fr)",sm:"108px minmax(0, 1fr)"},alignItems:"start",columnGap:"16px",rowGap:"4px"},children:[(0,Se.jsxs)(u.A,{sx:{display:"flex",alignItems:"center",gap:"8px"},children:[(0,Se.jsx)(u.A,{component:"img",src:i,alt:"",sx:{width:14,height:14}}),(0,Se.jsx)(ge.A,{component:"span",sx:{color:t?"#9ba1ab":"#ccd0d6",fontFamily:"Manrope",fontSize:"13px",fontStyle:"normal",lineHeight:"19px",fontWeight:700},children:o})]}),(0,Se.jsx)(u.A,{component:"span",sx:{color:"#ccd0d6",fontFamily:"Manrope",fontSize:"13px",fontStyle:"normal",lineHeight:"19px",fontWeight:400},children:n})]})},Ri=e=>{let i=e.text,o=e.note;
1return o?(0,Se.jsxs)(u.A,{component:"span",sx:{display:"flex",flexDirection:"column",gap:"2px"},children:[(0,Se.jsx)("span",{children:i}),(0,Se.jsx)(u.A,{component:"span","data-policy-tooltip-note":"true",sx:{color:"#9ba1ab"},children:o})]}):(0,Se.jsx)(Se.Fragment,{children:i})},Fi=e=>{let i=e.details;const o=(0,r.Bd)().t;return 0===i.length?null:(0,Se.jsxs)(u.A,{sx:{display:"flex",flexDirection:"column",gap:"6px",marginTop:"2px",paddingTop:"10px",borderTop:"1px solid #393e45"},children:[(0,Se.jsx)(ge.A,{component:"span",sx:{color:"#ccd0d6",fontFamily:"Manrope",fontSize:"12px",lineHeight:"18px",fontWeight:700},children:o("devices.checks.tooltip.additionalPolicySettings")}),i.map(e=>(0,Se.jsxs)(u.A,{sx:{display:"flex",alignItems:"center",gap:"8px"},children:[(0,Se.jsx)(u.A,{component:"span","aria-hidden":"true",sx:{width:"4px",height:"4px",flexShrink:0,borderRadius:"50%",backgroundColor:"#9ba1ab"}}),(0,Se.jsx)(ge.A,{component:"span",sx:{color:"#ccd0d6",fontFamily:"Manrope",fontSize:"12px",lineHeight:"18px",fontWeight:400},children:e})]},e))]})},Oi=e=>{let i=e.label,o=e.onClick,n=e.upgrade,a=void 0!==n&&n,t=e.disabled,s=void 0!==t&&t,l=e.disabledTooltip;const r=(0,Se.jsxs)(li.A,{disabled:s,onClick:e=>{e.stopPropagation(),o(e.currentTarget)},sx:{display:"inline-flex",alignItems:"center",gap:"6px",boxSizing:"border-box",padding:a?"5px 10px 5px 6px":"5px 10px",border:a?"none":"1px solid #393e45",borderRadius:a?"999px":"8px",backgroundColor:a?"#f0eaff":"#21252b",color:a?"#7c3aed":"#f5f6f7",fontFamily:"Manrope",fontSize:"12px",fontStyle:"normal",lineHeight:a?"18px":"16px",fontWeight:a?600:500,whiteSpace:"normal",maxWidth:"100%","@media (pointer: coarse)":{minHeight:44},"&:hover":{backgroundColor:a?"#e4d8ff":"#2a3038"},"&.Mui-disabled":{color:"#9ba1ab",opacity:1,cursor:"not-allowed"},"&.Mui-focusVisible":{outline:"2px solid #60a5fa",outlineOffset:"2px"}},children:[a&&(0,Se.jsx)(ki.A,{size:16,"aria-hidden":"true"}),i,!a&&(0,Se.jsx)(u.A,{component:"img",src:bi,alt:"",sx:{width:14,height:14,flexShrink:0}})]});return s?(0,Se.jsx)(ze.A,{title:l||"",arrow:!0,placement:"top",children:(0,Se.jsx)(u.A,{component:"span",sx:{display:"inline-flex"},children:r})}):r},Ui=e=>{var i,o,n,l,d;let c=e.check,p=e.awarenessConfigured,v=e.enforcementConfigured,x=e.awarenessLocked,g=e.enforcementLocked,h=e.onPolicyCheckEdit;const m=(0,r.Bd)().t,f=(0,s.Zp)(),y=t.useState(null),b=(0,a.A)(y,2),k=b[0],A=b[1],w=Y(c),_=Q(c),j=!_&&(c.passed||"OK"===c.goal
1Status),S=m(w?_?"devices.status.missingInformation":j?"devices.status.compliant":"devices.status.notCompliant":"devices.checks.table.noComplianceGoal"),C=(0,Se.jsx)(u.A,{component:"img",src:w?_?pi.A:j?vi.A:ui:xi.A,alt:""}),z=!w||_?"muted":j?"success":"danger",E=p&&!x,I=v&&!g,T=E||I,D=T&&("WARNING"===c.decisionStatus||"BLOCKING"===c.decisionStatus),M=T&&Boolean(c.warningEnabled)&&!D&&null!=c.daysUntilWarned&&c.daysUntilWarned>0,W=D?m("devices.checks.status.warned"):M?1===c.daysUntilWarned?m("devices.checks.status.willBeWarnedTomorrow"):m("devices.checks.status.willBeWarnedInDays",{days:c.daysUntilWarned}):c.warningEnabled&&T?m("devices.checks.status.warningEnabled"):null,P=D?"warning":"muted",B=x?m("devices.checks.status.upgradePlan"):c.warningEnabled&&!p?m("devices.checks.status.turnOnSecurityAlerts"):c.warningEnabled?null:m("devices.checks.status.enableWarning"),L=x?"upgrade":"goal",N=x?()=>f("/settings/subscription"):p?void 0:()=>f("/awareness?focus=alerts"),R="BLOCKING"===c.decisionStatus,F=g||x,O=null!=c.daysUntilBlocked&&c.daysUntilBlocked>0,U=(!j||"WARNING"===c.decisionStatus||O)&&c.blockingEnabled&&v&&!F&&!R,V=R?m("devices.checks.status.deviceBlocked"):F?m("devices.checks.status.upgradePlan"):c.blockingEnabled&&!v?m("devices.checks.status.setupEnforcement"):U?null!=c.daysUntilBlocked&&c.daysUntilBlocked>0?1===c.daysUntilBlocked?m("devices.checks.status.willBeBlockedTomorrow"):m("devices.checks.status.willBeBlockedInDays",{days:c.daysUntilBlocked}):m("devices.checks.status.willBeBlocked"):m("devices.checks.status.enableBlocking"),K=R?"danger":F?"upgrade":U?"muted":c.blockingEnabled&&!v?"goal":c.blockingEnabled?"muted":"goal",H=F?()=>f("/settings/subscription"):v?void 0:()=>f("/applications?focus=add-application"),G=null!==W&&(!j||D||M),q=null!==B,J=!j||U||R||F||!c.blockingEnabled||!v,Z=J&&!R&&!U&&(F||!c.blockingEnabled||c.blockingEnabled&&!v),X=J&&!Z,$=(0,Se.jsx)(u.A,{component:"span","data-policy-tone-icon":"warning","aria-hidden":"true",sx:{display:"inline-block",width:14,height:14,backgroundColor:"currentColor",maskImage:"url(".concat(gi.A,")"),maskPosition:"center",maskRepeat:"no-repeat",maskSize:"contain",WebkitMaskImage:"url(".concat(gi.A,")"),WebkitMaskPosition:"center",WebkitMaskRepeat:"no-repeat",WebkitMaskSize:"contain"}}),ee=D?(0,Se.jsx)(u.A,{component:"img",src:Be.A,alt:""}):$,ie=!c.warningEnabled||p||x?$:(0,Se.jsx)(u.A,{component:"img",src:fi,alt:""}),oe=R?(0,Se.jsx)(u.A,{component:"img",src:hi.A,alt:""}):!c.blockingEnabled||v||F?(0,Se.jsx)(u.A,{component:"span","data-policy-tone-icon":"blocking","aria-hidden":"true",sx:{display:"inline-block",width:14,height:14,backgroundColor:"currentColor",maskImage:"url(".concat(mi.A,")"),maskPosition:"center",maskRepeat:"no-repeat",maskSize:"contain",WebkitMaskImage:"url(".concat(mi.A,")"),WebkitMaskPosition:"center",WebkitMaskRepeat:"no-repeat",WebkitMaskSize:"contain"}}):(0,Se.jsx)(u.A,{component:"img",src:yi,alt:""}),ne=w?null!=(null===(i=c.policyTimeline)||void 0===i?void 0:i.goalDays)?m("policies.editPolicy.statusIndicators.complianceGoalWithin",{days:c.policyTimeline.goalDays}):m("policies.editPolicy.statusIndicators.complianceGoalSet"):m("policies.editPolicy.statusIndicators.noComplianceGoalSet"),ae=Boolean(c.warningEnabled),te=((e,i,o,n)=>{const a=null===(e=c.policyTimeline)||void 0===e?void 0:e.warnDays;if(null==a)return m("policies.editPolicy.statusIndicators.warningUsers");if(0===a)return m("policies.editPolicy.statusIndicators.warnImmediately");if("reboot"===c.checkKey)return m("policies.editPolicy.statusIndicators.warnAfterReboot",{days:a});if("version"===(null===(i=c.extraInfo)||void 0===i?void 0:i.type))return m("policies.editPolicy.statusIndicators.warnAfterUpdate",{days:a});const t=null===(o=c.policyTimeline)||void 0===o?void 0:o.goalDays;if(null!=t)return a<t?m("policies.editPolicy.statusIndicators.warnBeforeGoal",{days:t-a}):a===t?m("policies.editPolicy.statusIndicators.warnOnGoal"):m("policies.editPolicy.statusIndicators.warnAfterGoal",{days:a-t});const s=null===(n=c.policyTimeline)||void 0===n?void 0:n.blockDays;return null!=s&&s>a?m("devices.checks.tooltip.warningBeforeBlocking",{days:s-a}):m("policies.editPolicy.statusIndicators.warningUsers")})(),se=ae?I&&!E?m(x?"devices.checks.tooltip.warnedOnSignInUpgradeForSecurityAlerts":"devices.checks.tooltip.warnedOnSignInSecurityAlertsNotConfigured"):T?null:m(x?"devices.checks.tooltip.upgradePlanForSecurityAlerts":"devices.checks.tooltip.securityAlertsNotConfigured"):null,le=ae?(0,Se.jsx)(Ri,{text:te,note:se}):m("devices.checks.tooltip.warningNotEnabled"),re=Boolean(c.blockingEnabled),de=null!=(null===(o=c.policyT
1imeline)||void 0===o?void 0:o.blockDays)&&null!=(null===(n=c.policyTimeline)||void 0===n?void 0:n.goalDays)?c.policyTimeline.blockDays===c.policyTimeline.goalDays?m("policies.editPolicy.statusIndicators.blockOnGoal"):c.policyTimeline.blockDays<c.policyTimeline.goalDays?m("policies.editPolicy.statusIndicators.blockBeforeGoal",{days:c.policyTimeline.goalDays-c.policyTimeline.blockDays}):m("policies.editPolicy.statusIndicators.blockAfterGoal",{days:c.policyTimeline.blockDays-c.policyTimeline.goalDays}):m("policies.editPolicy.statusIndicators.blockingDevices"),ce=re?F?m("devices.checks.tooltip.upgradePlanToBlock"):v?null:m("devices.checks.tooltip.enforcementNotConfigured"):null,ue=re?(0,Se.jsx)(Ri,{text:de,note:ce}):m("devices.checks.tooltip.blockingNotEnabled"),pe=!p&&!x,ve=Boolean(c.blockingEnabled)&&!v&&!F,xe=x||F,ge=[...null!==(l=c.versionPolicySettings)&&void 0!==l&&l.allowsMajorVersions?[m("applications.policies.majorVersionsAllow")]:[],...null!==(d=c.versionPolicySettings)&&void 0!==d&&d.allowsBeta?[m("applications.policies.betaVersionsAllow")]:[]],he=(0,Se.jsxs)(u.A,{sx:{display:"flex",flexDirection:"column",gap:"10px"},children:[(0,Se.jsx)(Ni,{icon:w?vi.A:xi.A,label:m("devices.checks.table.goal"),description:ne,muted:!w}),(0,Se.jsx)(Ni,{icon:ae?Be.A:gi.A,label:m("devices.status.warning"),description:le,muted:!ae}),(0,Se.jsx)(Ni,{icon:re?hi.A:mi.A,label:m("devices.checks.tooltip.blocking"),description:ue,muted:!re}),(0,Se.jsx)(Fi,{details:ge}),(0,Se.jsxs)(u.A,{sx:{display:"flex",alignItems:"center",flexWrap:"wrap",gap:"10px",paddingTop:"8px"},children:[(0,Se.jsx)(Oi,{label:m("devices.checks.table.changePolicySettings"),onClick:e=>((e,i)=>Ei({check:c,intendedAction:e,launcher:i,onPolicyCheckEdit:h,navigate:f}))("edit",e),disabled:!c.policyId,disabledTooltip:m("devices.checks.table.changePolicySettingsUnavailable")}),pe&&(0,Se.jsx)(Oi,{label:m("devices.checks.status.turnOnSecurityAlerts"),onClick:()=>f("/awareness?focus=alerts")}),ve&&(0,Se.jsx)(Oi,{label:m("devices.checks.tooltip.setupEnforcement"),onClick:()=>f("/applications?focus=add-application")}),xe&&(0,Se.jsx)(Oi,{label:m("devices.checks.status.upgradePlan"),onClick:()=>f("/settings/subscription"),upgrade:!0})]})]});return(0,Se.jsx)(_i.__,{pages:[{title:c.name,body:he}],arrow:"bottom",placement:"top",width:520,anchorEl:k,children:(0,Se.jsxs)(u.A,{"data-policy-state-layout":"true",sx:{display:"inline-flex",alignItems:"center",gap:"8px",flexWrap:"wrap",width:"fit-content",maxWidth:"100%",overflowX:"visible",padding:"2px 0 4px"},children:[(0,Se.jsxs)(u.A,{"data-policy-status-group":"true",sx:{display:"inline-flex",alignItems:"center",flexShrink:0},children:[(0,Se.jsx)(Li,{label:S,icon:C,tone:z,onTooltipAnchorChange:A,first:!0,last:!G&&!X}),G&&null!==W&&(0,Se.jsx)(Li,{label:W,icon:ee,tone:P,onTooltipAnchorChange:A,last:!X}),X&&(0,Se.jsx)(Li,{label:V,icon:oe,tone:K,onClick:H,onTooltipAnchorChange:A,last:!0})]}),q&&null!==B&&(0,Se.jsx)(Li,{label:B,icon:ie,tone:L,onClick:N,onTooltipAnchorChange:A,secondaryLabel:"upgrade"===L?m("devices.checks.status.turnOnSecurityAlerts"):void 0,first:!0,last:!0}),Z&&(0,Se.jsx)(Li,{label:V,icon:oe,tone:K,onClick:H,onTooltipAnchorChange:A,actionRequired:!F&&Boolean(c.blockingEnabled)&&!v,secondaryLabel:"upgrade"===K?m("devices.checks.status.setupEnforcement"):void 0,first:!0,last:!0})]})})},Vi=e=>{let i=e.check,o=e.awarenessConfigured,n=e.enforcementConfigured,a=e.awarenessLocked,l=e.enforcementLocked,d=e.onPolicyCheckEdit;const c=(0,r.Bd)().t,p=(0,s.Zp)(),v=t.useRef(null),x=[{label:c("devices.checks.table.changePolicySettings"),disabled:!i.policyId,disabledTooltip:c("devices.checks.table.changePolicySettingsUnavailable"),disableTranslation:!0,onClick:(e,o)=>{var n,a;const t=null!==(n=null===(a=v.current)||void 0===a?void 0:a.querySelector("button"))&&void 0!==n?n:null===o||void 0===o?void 0:o.currentTarget;t instanceof HTMLElement&&Ei({check:i,intendedAction:"edit",launcher:t,onPolicyCheckEdit:d,navigate:p})}},...o||a?[]:[{label:c("devices.checks.status.turnOnSecurityAlerts"),disableTranslation:!0,onClick:()=>p("/awareness?focus=alerts")}],...n||l||a?[]:[{label:c("devices.checks.status.setupEnforcement"),disableTranslation:!0,onClick:()=>p("/applications?focus=add-application")}]];return(0,Se.jsx)(u.A,{ref:v,children:(0,Se.jsx)(me.A,{mode:"dropdown",actions:x,menuAlign:"right"})})},Ki=e=>{let i=e.extraInfo,o=e.outdatedDays,a=e.hasCVE,t=void 0!==a&&a,s=e.isMobile,l=void 0!==s&&s;const d=(0,r.Bd)().t,c={fontWeight:600,fontSize:l?"13px":"14px",lineHeight:l?"18px":"20px",letterSpacing:0,color:"var(--color-gray-900)"},p={fontWeight:600,fontSize:l?"13px":"14px",lineHeight:l?"18px":"20px",letterSpacing:0,color:"var(--color-gray-500)"},v=t?(0,Se.jsx)(u.A,{sx:{display:"inline-flex",alignItems:"center",gap:"4px",padding:"2px 8px",borderRadius:"12px",backgroundColor:"var(--color-red-600)",color:"var(--color-red-50)",fontSize:"12px",fontWeight:600,whiteSpace:"nowrap",marginTop:i&&null!==i.type?"4px":0},children:d("devices.cveDetected")}):null;
1if(!i||null===i.type)return v;let g=null;if("dns"===i.type){const e=i.dnsExpected||[],o=i.dnsValidationMode||"";g=(0,Se.jsxs)(u.A,{sx:{display:"flex",flexDirection:"column",gap:"2px"},children:[(0,Se.jsxs)(ge.A,{variant:"body2",sx:(0,n.A)((0,n.A)({},c),{},{wordBreak:"break-word"}),children:[d("devices.checks.table.dnsExpected"),":"," ",e.length>0?e.join(", "):d("devices.checks.table.none")]}),o&&(0,Se.jsxs)(ge.A,{variant:"body2",sx:p,children:[d("devices.checks.table.mode"),": ",o]})]})}else if("version"===i.type){const e=i.version||"",a=i.latestVersion,t=i.channel,s=(0,K.Gd)(t),l=i.isSupportedMajor&&i.isLatestForMajor&&i.latestForMajor&&a!==i.latestForMajor;g=(0,Se.jsxs)(u.A,{sx:{display:"flex",flexDirection:"column",gap:"2px"},children:[(0,Se.jsxs)(u.A,{sx:{display:"flex",alignItems:"center",gap:"6px"},children:[(0,Se.jsxs)(ge.A,{variant:"body2",sx:c,children:[d("devices.checks.table.version"),": ",e,null!=o&&o>0&&(0,Se.jsxs)(ge.A,{component:"span",sx:(0,n.A)((0,n.A)({},p),{},{marginLeft:"4px"}),children:["(",d("devices.checks.table.outdatedDays",{days:o}),")"]}),i.infoMessageKey&&(0,Se.jsxs)(ge.A,{component:"span",sx:(0,n.A)((0,n.A)({},p),{},{marginLeft:"4px"}),children:["(",d(i.infoMessageKey),")"]})]}),s&&(0,Se.jsx)(x.A,{label:t,size:"small",sx:K._v})]}),a&&(a!==e||i.infoMessageKey)&&(0,Se.jsxs)(u.A,{sx:{display:"flex",alignItems:"center",gap:"4px"},children:[(0,Se.jsxs)(ge.A,{variant:"body2",sx:p,children:[d("devices.checks.table.latestVersion"),": ",a]}),l&&(0,Se.jsx)(ze.A,{title:d("devices.checks.table.latestForMajorTooltip",{majorVersion:i.latestForMajor}),arrow:!0,placement:"top",children:(0,Se.jsx)(Le.A,{tabIndex:0,role:"button","aria-label":d("devices.checks.table.latestForMajorTooltip",{majorVersion:i.latestForMajor}),sx:{fontSize:16,color:"var(--color-gray-400)",cursor:"pointer"}})})]})]})}else if("passwordmanager"===i.type){const e=i.passwordManagers||[];g=(0,Se.jsx)(ge.A,{variant:"body2",sx:(0,n.A)((0,n.A)({},c),{},{wordBreak:"break-word"}),children:e.join(", ")})}else if("antivirus"===i.type){var h;g=(0,Se.jsxs)(u.A,{sx:{wordBreak:"break-word"},children:[i.antivirusProduct&&(0,Se.jsx)(ge.A,{variant:"body2",sx:c,children:d("policies.antivirusProducts.detected",{products:i.antivirusProduct})}),!(null===(h=i.antivirusRequiredProducts)||void 0===h||!h.length)&&(0,Se.jsx)(ge.A,{variant:"body2",children:d("policies.antivirusProducts.required",{products:i.antivirusRequiredProducts.map(Ze.dI).join(", ")})}),i.antivirusReason&&(0,Se.jsx)(ge.A,{variant:"body2",children:d("policies.antivirusProducts.reason.".concat(i.antivirusReason))})]})}else if("reboot"===i.type){const e=i.daysSinceReboot;null!==e&&void 0!==e&&(g=(0,Se.jsx)(ge.A,{variant:"body2",sx:c,children:d("devices.checks.table.daysSinceReboot",{days:e})}))}else if("boolean"===i.type){const e=i.booleanLabelKey||("enabled"===i.booleanState?"devices.enabled":"disabled"===i.booleanState?"devices.disabled":"devices.unknown");g=(0,Se.jsx)(u.A,{sx:{display:"flex",flexDirection:"column",gap:"2px"},children:(0,Se.jsx)(ge.A,{variant:"body2",sx:(0,n.A)({},"unknown"===i.booleanState?p:c),children:d(e)})})}const m=i.unknownReasonKey?(0,Se.jsx)(ge.A,{variant:"body2",sx:(0,n.A)((0,n.A)({},p),{},{fontWeight:500,whiteSpace:l?"normal":"nowrap",marginTop:g?"2px":0},!l&&{"@container device-checks-table (max-width: 1600px)":{width:"clamp(300px, 30cqw, 340px)",maxWidth:"100%",whiteSpace:"normal"}}),children:d(i.unknownReasonKey)}):null;return g||v||m?(0,Se.jsxs)(u.A,{sx:{display:"flex",flexDirection:"column",alignItems:"flex-start"},children:[g,m,v]}):null},Hi=e=>{var i;let o=e.policies,n=e.actualPolicy,a=e.selectedPolicyId,t=e.onPolicyChange;const s=(0,r.Bd)().t,l=n?[...o,n]:o,d=a&&null!==(i=l.find(e=>e.policy_id===a))&&void 0!==i?i:null,c=s("devices.allPoliciesEvaluated"),u=s("devices.noPoliciesApplied"),p=[...o.map((e,i)=>({label:e.name||s("Users.selectPolicy"),icon:null,onClick:()=>t(e.policy_id),value:e.policy_id,disableTranslation:!0,dividerBelow:i===o.length-1})),{label:c,description:s("devices.allPoliciesDescription"),icon:null,onClick:()=>t(I.Px),value:I.Px,disableTranslation:!0,dividerBelow:!0}];return n&&p.push({label:u,description:s("devices.noPoliciesDescription"),icon:null,onClick:()=>t(n.policy_id),value:n.policy_id,disableTranslation:!0}),(0,Se.jsx)(me.A,{mode:"select",defaultSelected:a===I.Px?c:n&&a===n.policy_id?u:(null===d||void 0===d?void 0:d.name)||c,actions:p})};var Gi=o(33997);const qi=e=>{let i=e.backHref,o=void 0===i?"/devices":i;const n=(0,r.Bd)().t;return(0,Se.jsxs)(Se.Fragment,{children:[(0,Se.jsx)(f.A,{links:[{label:n("navigation.devices"),href:o}]}),(0,Se.jsxs)("div",{className:"device-detail","data-testid":"device-detail-skeleton",children:[(0,Se.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:"16px 0"},children:[(0,Se.jsx)("div",{style:{display:"flex",alignItems:"center",gap:12},children:(0,Se.jsx)(Gi.A,{variant:"line",width:180,height:20})}),(0,Se.jsxs)("div",{style:{display:"flex",gap:8},children:[(0,Se.jsx)(Gi.A,{variant:"rect",width:100,height:36,borderRadius:8}),(0,Se.jsx)(Gi.A,{variant:"rect",width:36,height:36,borderRadius:8})]})]}),(0,Se.jsx)("div",{style:{border:"1px solid var(--color-gray-200)",borderRadius:8,padding:24,marginBottom:16},children:(0,Se.jsxs)("div",{style:{display:"flex",gap:24},children:[(0,Se.jsx)(Gi.A,{variant:"rect",width:48,height:48,borderRadius:8}),(0,Se.jsxs)("div",{style:{flex:1,display:"flex",flexDirection:"column",gap:10},children:[(0,Se.jsx)(Gi.A,{variant:"line",width:"35%",height:14}),(0,Se.jsx)(Gi.A,{variant:"line",width:"50%",height:12}),(0,Se.jsx)(Gi.A,{variant:"line",width:"40%",height:12})]}),(0,Se.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:8,alignItems:"flex-end"},children:[(0,Se.jsx)(Gi.A,{variant:"rect",width:80,height:24,borderRadius:12}),(0,Se.jsx)(Gi.A,{variant:"line",width:120,height:10})]})]})}),(0,Se.jsxs)("div",{style:{border:"1px solid var(--color-gray-200)",borderRadius:8,overflow:"hidden"},children:[(0,Se.jsxs)("div",{style:{display:"flex",gap:16,padding:"12px 16px",background:"var(--color-gray-100)"},children:[(0,Se.jsx)(Gi.A,{variant:"line",width:"25%",height:12}),(0,Se.jsx)(Gi.A,{variant:"line",width:"20%",height:12}),(0,Se.jsx)(Gi.A,{variant:"line",width:"15%",height:12})]}),Array.from({length:3}).map((e,i)=>(0,Se.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:16,height:56,padding:"0 16px",borderTop:"1px solid var(--color-gray-100)"},children:[(0,Se.jsx)(Gi.A,{variant:"line",width:"30%",height:14}),(0,Se.jsx)(Gi.A,{variant:"line",width:"20%",height:12}),(0,Se.jsx)(Gi.A,{variant:"rect",width:64,height:24,borderRadius:12})]},i))]})]})]})};var Ji=o(69802),Yi=o(14801);const Qi=e=>{let i=e.backHref,o=void 0===i?"/devices":i;const n=(0,r.Bd)().t,a=(0,s.Zp)();return(0,Se.jsxs)(Se.Fragment,{children:[(0,Se.jsx)(f.A,{links:[{label:n("navigation.devices"),href:o}]}),(0,Se.jsx)("div",{className:"device-detail",children:(0,Se.jsxs)(u.A,{sx:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",minHeight:"400px",gap:"24px",padding:"80px 40px",marginTop:"20px",border:"1px solid var(--color-gray-200)",borderRadius:"6px",backgroundColor:"white"},children:[(0,Se.jsx)(u.A,{sx:{width:"80px",height:"80px",borderRadius:"50%",backgroundColor:"var(--color-gray-100)",display:"flex",alignItems:"center",justifyContent:"center"},children:(0,Se.jsx)(Ji.A,{sx:{fontSize:40,color:"var(--color-gray-400)"}})}),(0,Se.jsxs)(u.A,{sx:{textAlign:"center",maxWidth:"400px"},children:[(0,Se.jsx)(ge.A,{sx:{fontSize:"18px",fontWeight:600,lineHeight:"24px",color:"var(--color-gray-900)",marginBottom:"8px"},children:n("devices.notFoundTitle")}),(0,Se.jsx)(ge.A,{sx:{fontSize:"14px",fontWeight:400,lineHeight:"20px",color:"var(--color-gray-500)"},children:n("devices.notFoundDescription")})]}),(0,Se.jsx)(c.A,{variant:"outlined",startIcon:(0,Se.jsx)(Yi.A,{}),onClick:()=>a(o),sx:{marginTop:"8px",backgroundColor:"white",borderColor:"var(--color-gray-300)",color:"var(--color-gray-700)","&:hover":{backgroundColor:"var(--color-gray-50)",borderColor:"var(--color-gray-400)"}},children:n("devices.backToDevices")})]})})]})};var Zi=o(96583);const Xi=e=>{let i=e.open,o=e.onClose,n=e.onSave,s=e.onDelete,l=e.existingNote,d=void 0===l?"":l,p=e.isEditMode,v=void 0!==p&&p;const x=(0,r.Bd)().t,h=(0,t.useState)(d),m=(0,a.A)(h,2),f=m[0],y=m[1],b=(0,t.useRef)(null),k=f.length,A=k>we.A,w=(0,t.useMemo)(()=>A?x("devices.notes.maxLengthError",{max:we.A}):x("devices.notes.characterHelper",{count:k,max:we.A}),[A,k,x]),_=A||!f.trim();(0,t.useEffect)(()=>{i&&y(d)},[i,d]),(0,t.useEffect)(()=>
1{if(!i)return;const e=setTimeout(()=>{if(b.current){b.current.focus();const e=b.current.value.length;b.current.setSelectionRange(e,e)}},0);return()=>clearTimeout(e)},[i]);const j=()=>{y(""),o()};return(0,Se.jsx)(Zi.A,{open:i,onClose:j,maxWidth:"sm",fullWidth:!0,PaperProps:{sx:{backgroundColor:"white",borderRadius:"12px",padding:"24px",boxShadow:"0px 8px 8px -4px #10182808, 0px 20px 24px -4px #10182814"}},children:(0,Se.jsxs)(u.A,{sx:{display:"flex",flexDirection:"column",gap:"32px"},children:[(0,Se.jsx)(ge.A,{sx:{color:"var(--color-gray-900)",fontWeight:600,fontSize:"18px",lineHeight:"28px",letterSpacing:"0px",textAlign:"left"},children:x(v?"devices.editNote":"devices.addNote")}),(0,Se.jsxs)(u.A,{sx:{display:"flex",flexDirection:"column",gap:"8px"},children:[(0,Se.jsx)(ge.A,{component:"label",sx:{color:"var(--color-gray-700)",fontWeight:500,fontSize:"14px",lineHeight:"20px",letterSpacing:"0px"},children:x("devices.noteLabel")}),(0,Se.jsx)(g.A,{multiline:!0,rows:4,fullWidth:!0,value:f,onChange:e=>y(e.target.value),placeholder:x("devices.notePlaceholder"),inputRef:b,error:A,helperText:w,FormHelperTextProps:{sx:{margin:"4px 0 0",textAlign:"right",fontSize:"12px",lineHeight:"16px",color:A?"var(--color-red-600)":"var(--color-gray-500)"}},sx:{"& .MuiOutlinedInput-root":{borderRadius:"8px"}}})]}),(0,Se.jsxs)(u.A,{sx:{display:"flex",justifyContent:"space-between",gap:"12px",alignItems:"center"},children:[v&&s?(0,Se.jsx)(c.A,{onClick:()=>{s&&(s(),y(""),o())},variant:"text",sx:{textTransform:"none",padding:"10px 0",color:"#dc2626"},children:x("devices.deleteNote")}):null,(0,Se.jsxs)(u.A,{sx:{display:"flex",gap:"12px",flex:v&&s?"0 0 auto":"1 1 auto",width:v&&s?"auto":"100%"},children:[(0,Se.jsx)(c.A,{onClick:j,variant:"outlined",sx:{textTransform:"none",borderRadius:"8px",padding:"10px 16px",flex:v&&s?"0 0 auto":"1 1 0"},children:x("general.cancel")}),(0,Se.jsx)(c.A,{onClick:()=>{const e=f.trim();e&&!A&&(n(e),y(""),o())},variant:"contained",disabled:_,sx:{textTransform:"none",borderRadius:"8px",padding:"10px 16px",flex:v&&s?"0 0 auto":"1 1 0"},children:x("general.confirm")})]})]})]})})};var $i=o(5631),eo=o(73847),io=(o(49344),o(80016)),oo=o(21638),no=o(57329),ao=o(70334),to=o(87121),so=o(43762),lo=o(62649),ro=o(93125),co=o(39919),uo=o(49939),po=o(35834),vo=o(68476),xo=o(22056);const go={display:"flex",alignItems:"center",py:"2px",cursor:"pointer","&:hover":{backgroundColor:"rgba(0,0,0,0.06)"},borderRadius:"4px"},ho={fontSize:"16px",color:"#666"},mo={fontSize:"12px",fontFamily:"monospace",color:"#333",fontWeight:600},fo=e=>{let i=e.label,o=e.value,n=e.defaultExpanded,s=void 0!==n&&n;const l=(0,t.useState)(s),r=(0,a.A)(l,2),d=r[0],c=r[1];if(null===o||void 0===o)return(0,Se.jsxs)(u.A,{sx:{display:"flex",alignItems:"center",py:"2px",pl:"20px"},children:[(0,Se.jsxs)(ge.A,{component:"span",sx:{fontSize:"12px",fontFamily:"monospace",color:"#666"},children:[i,":"]}),(0,Se.jsx)(ge.A,{component:"span",sx:{fontSize:"12px",fontFamily:"monospace",color:"#999",ml:"6px"},children:null===o?"null":"undefined"})]});if("object"===typeof o&&!Array.isArray(o)){const e=Object.entries(o).sort((e,i)=>{let o=(0,a.A)(e,1)[0],n=(0,a.A)(i,1)[0];return o.localeCompare(n)});return 0===e.length?(0,Se.jsxs)(u.A,{sx:{display:"flex",alignItems:"center",py:"2px",pl:"20px"},children:[(0,Se.jsxs)(ge.A,{component:"span",sx:{fontSize:"12px",fontFamily:"monospace",color:"#666"},children:[i,":"]}),(0,Se.jsx)(ge.A,{component:"span",sx:{fontSize:"12px",fontFamily:"monospace",color:"#999",ml:"6px"},children:"{}"})]}):(0,Se.jsxs)(u.A,{children:[(0,Se.jsxs)(u.A,{onClick:()=>c(!d),sx:go,children:[d?(0,Se.jsx)(po.A,{sx:ho}):(0,Se.jsx)(vo.A,{sx:ho}),(0,Se.jsx)(ge.A,{component:"span",sx:mo,children:i}),(0,Se.jsx)(ge.A,{component:"span",sx:{fontSize:"12px",fontFamily:"monospace",color:"#999",ml:"6px"},children:d?"{":"{".concat(e.length,"}")})]}),d&&(0,Se.jsx)(u.A,{sx:{pl:"16px",borderLeft:"1px solid #e0e0e0",ml:"8px"},children:e.map(e=>{let i=(0,a.A)(e,2),o=i[0],n=i[1];return(0,Se.jsx)(fo,{label:o,value:n},o)})}),d&&(0,Se.jsx)(ge.A,{component:"span",sx:{fontSize:"12px",fontFamily:"monospace",color:"#999",pl:"20px"},children:"}"})]})}if(Array.isArray(o))return 0===o.length?(0,Se.jsxs)(u.A,{sx:{display:"flex",alignItems:"center",py:"2px",pl:"20px"},children:[(0,Se.jsxs)(ge.A,{component:"span",sx:{fontSize:"12px",fontFamily:"monospace",color:"#666"},children:[i,":"]}),(0,Se.jsx)(ge.A,{component:"span",sx:{fontSize:"12px",fontFamily:"monospace",color:"#999",ml:"6px"},children:"[]"})]}):(0,Se.jsxs)(u.A,{children:[(0,Se.jsxs)(u.A,{onClick:()=>c(!d),sx:go,children:[d?(0,Se.jsx)(po.A,{sx:ho}):(0,Se.jsx)(vo.A,{sx:ho}),(0,Se.jsx)(ge.A,{component:"span",sx:mo,children:i}),(0,Se.jsx)(ge.A,{component:"span",sx:{fontSize:"12px",fontFamily:"monospace",color:"#999",ml:"6px"},children:d?"[":"[".concat(o.length,"]")})]}),d&&(0,Se.jsx)(u.A,{sx:{pl:"16px",borderLeft:"1px solid #e0e0e0",ml:"8px"},children:o.map((e,i)=>(0,Se.jsx)(fo,{label:"".concat(i),value:e},i))}),d&&(0,Se.jsx)(ge.A,{component:"span",sx:{fontSize:"12px",fontFamily:"monospace",color:"#999",pl:"20px"},children:"]"})]});const p="string"===typeof o?"#c41a16":"number"===typeof o?"#1c00cf":"boolean"===typeof o?"#0d47a1":"#333",v="string"===typeof o?'"'.concat(o,'"'):String(o);return(0,Se.jsxs)(u.A,{sx:{display:"flex",alignItems:"center",py:"2px",pl:"20px"},children:[(0,Se.jsxs)(ge.A,{component:"span",sx:{fontSize:"12px",fontFamily:"monospace",color:"#666"},children:[i,":"]}),(0,Se.jsx)(ge.A,{component:"span",sx:{fontSize:"12px",fontFamily:"monospace",color:p,ml:"6px",wordBreak:"break-all"},children:v})]})},yo=e=>{let i=e.open,o=e.onClose,n=e.device;const s=(0,t.useState)("tree"),l=(0,a.A)(s,2),r=l[0],d=l[1],p=(0,t.useMemo)(()=>i?JSON.stringify(n,null,2):"",[i,n]),v=(0,t.useCallback)(()=>{navigator.clipboard.writeText(JSON.stringify(n,null,2))},[n]);return(0,Se.jsxs)(xo._T,{open:i,onClose:o,title:"Device Shadow Data",maxWidth:"md",showCloseButton:!0,actions:(0,Se.jsx)(u.A,{sx:{display:"flex",justifyContent:"flex-end",gap:"12px"},children:(0,Se.jsx)(c.A,{onClick:o,variant:"outlined",sx:{textTransform:"none",borderRadius:"8px"},children:"Close"})}),children:[(0,Se.jsxs)(u.A,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:"12px"},children:[(0,Se.jsxs)(ro.A,{value:r,exclusive:!0,onChange:(e,i)=>{i&&d(i)},size:"small",children:[(0,Se.jsx)(co.A,{value:"tree",sx:{textTransform:"none",fontSize:"12px",py:"4px",px:"12px"},children:"Tree"}),(0,Se.jsx)(co.A,{value:"raw",sx:{textTransform:"none",fontSize:"12px",py:"4px",px:"12px"},children:"Raw JSON"})]}),(0,Se.jsx)(ze.A,{title:"Copy to clipboard",children:(0,Se.jsx)(Ie.A,{onClick:v,size:"small",children:(0,Se.jsx)(uo.A,{fontSize:"small"})})})]}),(0,Se.jsx)(u.A,{sx:{backgroundColor:"#f5f5f5",borderRadius:"8px",padding:"16px",overflow:"auto",maxHeight:"60vh"},children:"raw"===r?(0,Se.jsx)(u.A,{component:"pre",sx:{fontSize:"12px",lineHeight:1.5,margin:0,fontFamily:"monospace"},children:p}):(0,Se.jsx)(u.A,{children:Object.entries(n).sort((e,i)=>
1{let o=(0,a.A)(e,1)[0],n=(0,a.A)(i,1)[0];return o.localeCompare(n)}).map(e=>{let i=(0,a.A)(e,2),o=i[0],n=i[1];return(0,Se.jsx)(fo,{label:o,value:n},o)})})})]})};var bo=o(51658),ko=o(26162),Ao=o(95595),wo=o(33390);const _o=["needsAction","enforced","notEnforced","missingInformation","all"],jo={awarenessConfigured:!0,enforcementConfigured:!0,awarenessLocked:!1,enforcementLocked:!1},So=e=>e.isEnforced,Co=e=>Y(e)&&Q(e),zo=function(e){let i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:jo;return!!e.isEnforced&&(Co(e)||!1===e.passed||!0===e.warningEnabled&&(!i.awarenessConfigured||i.awarenessLocked)||!0===e.blockingEnabled&&(!i.enforcementConfigured||i.enforcementLocked))},Eo=function(e,i,o){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:jo;const a=o.trim().toLocaleLowerCase();return e.filter(e=>(()=>{switch(i){case"needsAction":return zo(e,n);case"enforced":return So(e);case"notEnforced":return!So(e);case"missingInformation":return Co(e);case"all":return!0}})()&&(0===a.length||e.name.toLocaleLowerCase().includes(a)))};var Io=o(35565);const To=e=>{var i,o,E,T,D,M,W,P,B,L,N,R,F,O,U,V,H,G,q,J,Y,Q,Z,X,$;let ee=e.role;const ie=(0,r.Bd)().t,oe=ie("general.errorMessage"),ae=(0,s.Zp)(),le=(0,s.zy)(),re=(0,l.ok)(),de=(0,a.A)(re,2),ue=de[0],pe=de[1],ge=(0,C.d)().addToast,he=(0,wo.P)(),me=he.showSuccess,fe=he.showQuotaError,ye=(0,s.g)().deviceId,be=(0,A.V)(),ke=be.policies,Ae=be.selectedPolicy,_e=be.refreshPolicies,je=(0,w.G)().applications,ze=(null===(i=ee.organization)||void 0===i?void 0:i.notify_discovered_devices)||(null===(o=ee.organization)||void 0===o?void 0:o.notify_unsafe_devices)||!1,Ee=je.filter(e=>!(0,_.l2)(e)).length>1,Ie=(0,t.useState)(null),Te=(0,a.A)(Ie,2),De=Te[0],Me=Te[1],We=(0,t.useState)(""),Pe=(0,a.A)(We,2),Be=Pe[0],Le=Pe[1],Ne=le.state,Re=(0,t.useState)(null!==(E=null!==(T=null!==(D=null===Ne||void 0===Ne?void 0:Ne.selectedPolicyId)&&void 0!==D?D:null===Ae||void 0===Ae?void 0:Ae.policy_id)&&void 0!==T?T:ee.organization.default_policy_id)&&void 0!==E?E:I.Px),Fe=(0,a.A)(Re,2),Oe=Fe[0],Ue=Fe[1],Ve=(0,t.useState)(!1),Ke=(0,a.A)(Ve,2),He=Ke[0],Ge=Ke[1],Je=(0,t.useState)(!1),Ye=(0,a.A)(Je,2),Qe=Ye[0],Ze=Ye[1],Xe=(0,t.useState)(!1),$e=(0,a.A)(Xe,2),ei=$e[0],ii=$e[1],oi=(0,t.useState)(!1),ni=(0,a.A)(oi,2),ai=ni[0],ti=ni[1],si=(0,t.useState)(!1),li=(0,a.A)(si,2),ri=li[0],di=li[1],ci=(0,t.useState)(!1),ui=(0,a.A)(ci,2),pi=ui[0],vi=ui[1],xi=(0,t.useState)(!1),gi=(0,a.A)(xi,2),hi=gi[0],mi=gi[1],fi=(0,t.useState)(void 0),yi=(0,a.A)(fi,2),bi=yi[0],ki=yi[1],Ai=(0,t.useState)(void 0),wi=(0,a.A)(Ai,2),_i=wi[0],ji=wi[1],Si=(0,t.useState)(void 0),Ci=(0,a.A)(Si,2),zi=Ci[0],Ei=Ci[1],Ii=(0,t.useState)(!1),Ti=(0,a.A)(Ii,2),Mi=Ti[0],Wi=Ti[1],Pi=(0,t.useState)(!1),Bi=(0,a.A)(Pi,2),Li=Bi[0],Ni=Bi[1],Ri=(0,t.useState)(!1),Fi=(0,a.A)(Ri,2),Oi=Fi[0],Ui=Fi[1],Vi=(0,t.useState)(null),Ki=(0,a.A)(Vi,2),Gi=Ki[0],Ji=Ki[1],Yi=(0,t.useState)([]),Zi=(0,a.A)(Yi,2),ro=Zi[0],co=Zi[1],uo=(0,t.useState)(null),po=(0,a.A)(uo,2),vo=po[0],xo=po[1],go=(0,t.useState)(""),ho=(0,a.A)(go,2),mo=ho[0],fo=ho[1],So=(0,t.useState)(null),Co=(0,a.A)(So,2),To=Co[0],Do=Co[1],Mo=(0,t.useState)(null),Wo=(0,a.A)(Mo,2),Po=Wo[0],Bo=Wo[1],Lo=(0,t.useState)(0),No=(0,a.A)(Lo,2),Ro=No[0],Fo=No[1],Oo=(0,t.useState)(0),Uo=(0,a.A)(Oo,2),Vo=Uo[0],Ko=Uo[1],Ho=(0,t.useState)(null),Go=(0,a.A)(Ho,2),qo=Go[0],Jo=Go[1],Yo=(0,t.useRef)(null),Qo=(0,t.useRef)(null),Zo=null!==(M=null===Ne||void 0===Ne?void 0:Ne.from)&&void 0!==M?M:"/devices",Xo=(e=>{const i=(0,j.dp)(),o=i.users,n=i.loading,a=i.priorityDevice,s=i.priorityDeviceLoading,l=i.fetchPriorityDevice,r=(0,t.useRef)(null),d=(0,t.useMemo)(()=>{if(!o||!e)return null;for(const i of o)if(i.devices){const o=i.devices.find(i=>i.device_id===e);if(o)return o}return null},[o,e]),c=(0,t.useMemo)(()=>a&&e&&(a.device.device_id||a.device.deviceId||a.device.id)===e?a.device:null,[a,e]);(0,t.useEffect)(()=>{!e||d||c||s||r.current===e||(r.current=e,l(e))},[e,d,c,s,l]);const u=r.current===e,p=null!==d&&void 0!==d?d:c;return{device:p,usersLoading:!p&&(s||!u&&n)}})(ye),$o=Xo.device,en=Xo.usersLoading,on=((e,i,o,n)=>{const s=(0,t.useState)(null),l=(0,a.A)(s,2),r=l[0],d=l[1],c=(0,t.useState)({}),u=(0,a.A)(c,2),p=u[0],v=u[1],x=(0,t.useState)(!0),g=(0,a.A)(x,2),h=g[0],m=g[1],f=(0,t.useState)(!1),b=(0,a.A)(f,2),k=b[0],A=b[1],w=(0,t.useRef)(0),_=(null!==o&&void 0!==o?o:[]).map(e=>
1e.policy_id).filter(Boolean).sort().join(","),j=(0,t.useCallback)(async o=>{const a="atomic_refresh"===o,t=++w.current,s=()=>w.current===t,l=_?_.split(","):[];if(!e||!i||!n){if(s()&&(d(null),v({}),m(!1),A(!1)),a)throw new Error("A device, organization, and default policy are required");return}let r;m(!0),A(!1);try{const o=await y.Ay.getDevice(i,e,n);if(!o)throw new Error("The device response was empty");if(!s()){if(a)throw new Error("Device refresh was superseded");return}r=o.device,a||(d(r),v({[n]:te(r)}))}catch(g){if(s()&&m(!1),a)throw se(g);return void console.error("Failed to fetch device for default policy:",g)}if(!s())return;m(!1);const c=l.filter(e=>e!==n);if(0===c.length)return void(a&&(d(r),v({[n]:te(r)})));A(!0);const u=await Promise.allSettled(c.map(async o=>{const n=await y.Ay.getDevice(i,e,o);if(!n)throw new Error("Device response for ".concat(o," was empty"));return{policyId:o,device:n.device}}));if(!s()){if(a)throw new Error("Device refresh was superseded");return}const p={[n]:te(r)},x=[];if(u.forEach(e=>{"fulfilled"===e.status?p[e.value.policyId]=te(e.value.device):x.push(se(e.reason))}),A(!1),x.length>0){if(a)throw x[0];return v(p),void x.forEach(e=>console.error("Failed to fetch device for remaining policy:",e))}d(r),v(p)},[n,e,i,_]);return(0,t.useEffect)(()=>(j("progressive"),()=>{w.current+=1}),[j]),{device:r,deviceByPolicy:p,defaultPolicyLoading:h,remainingPoliciesLoading:k,refreshPolicyDecisions:(0,t.useCallback)(()=>j("atomic_refresh"),[j])}})(ye,ee.organization.organization_id,ke,ee.organization.default_policy_id),nn=on.device,an=on.deviceByPolicy,tn=on.defaultPolicyLoading,sn=on.refreshPolicyDecisions,ln=Oe&&Oe!==I.Px&&Oe!==I.JE&&null!==(W=null===(P=an[Oe])||void 0===P?void 0:P.device)&&void 0!==W?W:null,rn=Oe&&Oe!==I.Px&&Oe!==I.JE&&Oe!==ee.organization.default_policy_id,dn=null!==ln&&void 0!==ln?ln:rn?$o:null!==nn&&void 0!==nn?nn:$o,cn=(0,S.g)(),un=cn.planCapabilities,pn=cn.onTrial,vn=cn.settings,xn=(0,to.yK)(un,pn,vn),gn=(0,j.dp)(),hn=gn.users,mn=gn.trialUsers,fn=gn.refreshUsers,yn=gn.updateDevice,bn=gn.removeDevice,kn=gn.fetchPriorityDevice,An=(0,lo.M)(),wn=(0,Io.w)(),_n=(0,t.useCallback)((e,i)=>{Yo.current=i,Jo(e)},[]),jn=(0,t.useCallback)(async e=>{if(!ye)throw new Error("The selected device is unavailable");if(!await _e(!1))throw new Error("Policies could not be refreshed");if(!await kn(ye,!0))throw new Error("The selected device could not be refreshed");await sn()},[ye,kn,_e,sn]),Sn=null!==(B=null===(L=ee.email)||void 0===L?void 0:L.endsWith("@xfa.tech"))&&void 0!==B&&B,Cn=(0,t.useState)(!1),zn=(0,a.A)(Cn,2),En=zn[0],In=zn[1],Tn=(0,t.useState)(!1),Dn=(0,a.A)(Tn,2),Mn=Dn[0],Wn=Dn[1],Pn=(0,t.useState)(!1),Bn=(0,a.A)(Pn,2),Ln=Bn[0],Nn=Bn[1],Rn=(0,t.useState)(!1),Fn=(0,a.A)(Rn,2),On=Fn[0],Un=Fn[1];(0,t.useEffect)(()=>{let e=!1;return(async()=>{try{const i=await y.Ay.getMessagingConnections(ee.organization.organization_id),o=(0,Ao.SZ)(i,"slack"),n=(0,Ao.SZ)(i,"teams");e||(Wn(!0===(null===o||void 0===o?void 0:o.connected)),Nn(!0===(null===n||void 0===n?void 0:n.connected)),Un(!0))}catch(i){console.error("Failed to load messaging connections:",i),e||(Wn(!1),Nn(!1),Un(!0),ge({isSaved:!1,message:oe}))}})(),()=>{e=!0}},[ee.organization.organization_id,ge,oe]);const Vn=(0,ko.x)({organizationId:ee.organization.organization_id,slackConnected:Mn,teamsConnected:Ln,showTeams:(0,b.FW)(ee.organization)}),Kn=(0,t.useMemo)(()=>(0,k.S_)(ee.organization),[ee.organization]),Hn=(0,t.useMemo)(()=>({policy_id:I.JE,organization_id:ee.organization.organization_id,name:ie("Users.actualDeviceState")}),[ee.organization.organization_id,ie]),Gn=Oe?Oe===I.JE?Hn:null===ke||void 0===ke?void 0:ke.find(e=>e.policy_id===Oe):Ae,qn=ve(dn).versionsInfo;(0,t.useEffect)(()=>{(async()=>{if(null===dn||void 0===dn||!dn.xfa_version||"agentless"===dn.xfa_version.toLowerCase())return Do(null),void Bo(null);const e=function(e){const i=(null===e||void 0===e?void 0:e.toLowerCase())||"";return i.includes("macos")||i.includes("mac os")||i.includes("windows")?"xfadesktop":i.includes("ios")||i.includes("ipados")?"xfamobileios":i.includes("android")?"xfamobileandroid":null}(null===dn||void 0===dn?void 0:dn.os_name);if(!e)return Do(null),void Bo(null);const i=await ce(e,dn.xfa_version);i&&(Do(i["latest-version"]),Bo(i))})()},[null===dn||void 0===dn?void 0:dn.xfa_version,null===dn||void 0===dn?void 0:dn.os_name]);const Jn=ne(dn,Oe||(null===Ae||void 0===Ae?void 0:Ae.policy_id),Hn,xn,qn,Kn,an,ee.organization),Yn=Jn.deviceChecks,Qn=Jn.failedChecksCount,Zn=(e=>{const i=(0,r.Bd)().t,o=(0,t.useState)("passed"),n=(0,a.A)(o,2),s=n[0],l=n[1],d=(0,t.useState)("asc"),
1c=(0,a.A)(d,2),u=c[0],p=c[1],v=(0,t.useMemo)(()=>{const o=i("devices.policy.notEnforced"),n=e=>{const i=e.policy!==o,n=!e.passed,a=e.risk===z.En.Unknown,t=Boolean(e.hasBlocking),s=Boolean(e.hasWarning);return i?n&&!a?t?0:s?1:2:n?4:3:n&&!a?t?5:s?6:7:n?9:8};return[...e].sort((e,i)=>{if(!s){const o=n(e)-n(i);return 0!==o?o:e.passed!==i.passed?e.passed?1:-1:e.policy.localeCompare(i.policy)}if("passed"===s){const o=e=>{var i,o;return e.isEnforced||null!==(null===(i=e.policyTimeline)||void 0===i?void 0:i.goalDays)&&void 0!==(null===(o=e.policyTimeline)||void 0===o?void 0:o.goalDays)||void 0!==e.goalStatus?void 0===e.goalStatus&&(e.risk===z.En.Unknown||e.isEnforced&&!e.passed)?5:e.passed||"OK"===e.goalStatus?"BLOCKING"===e.decisionStatus||e.hasBlocking?4:"WARNING"===e.decisionStatus||e.hasWarning?5:6:null!==e.daysUntilBlocked&&void 0!==e.daysUntilBlocked&&e.daysUntilBlocked<=0?0:e.hasWarning&&e.hasBlocking?1:e.hasWarning?2:3:6},a=o(e)-o(i);if(0!==a)return"asc"===u?a:-a;const t=n(e)-n(i);return 0!==t?"asc"===u?t:-t:e.policy.localeCompare(i.policy)}if("name"===s||"policy"===s){const o=e[s],n=i[s],a=o.localeCompare(n);return"asc"===u?a:-a}return 0})},[e,s,u,i]);return{sortField:s,sortDirection:u,handleSort:e=>{s===e?p("asc"===u?"desc":"asc"):(l(e),p("asc"))},sortedDeviceChecks:v}})(Yn),Xn=Zn.sortField,$n=Zn.sortDirection,ea=Zn.handleSort,ia=Zn.sortedDeviceChecks,oa=(0,t.useMemo)(()=>{const e=Yn.map(e=>e.blockedAgoSeconds).filter(e=>null!==e);return e.length>0?Math.min(...e):null},[Yn]),na=(0,to.UU)(vn,pn),aa=(0,to.Vr)(vn,pn),ta=(0,to.lV)(un,pn,vn),sa=ta||aa,la=(0,t.useMemo)(()=>({awarenessConfigured:ze,enforcementConfigured:Ee,awarenessLocked:aa,enforcementLocked:sa}),[ze,sa,Ee,aa]),ra=(0,t.useMemo)(()=>Yn.filter(e=>zo(e,la)).length,[la,Yn]),da=(0,t.useMemo)(()=>function(e){let i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:jo;return _o.filter(o=>Eo(e,o,"",i).length>0)}(Yn,la),[la,Yn]),ca=((e,i)=>{var o;return e&&i.includes(e)?e:null!==(o=i[0])&&void 0!==o?o:"all"})(De,da),ua=(0,t.useMemo)(()=>Eo(ia,ca,Be,la),[ca,Be,la,ia]),pa=(0,t.useMemo)(()=>(0,no.w)(un,ie),[un,ie]),va=pa.included,xa=(0,t.useMemo)(()=>{const e=new Set(pa.baseMissing);return na&&e.add(ie("Awareness.reminders.planUpgrade")),Array.from(e)},[na,pa.baseMissing,ie]),ga=null!==vn&&void 0!==vn&&null!==(N=vn.PaymentPlan)&&void 0!==N&&null!==(R=N.Name)&&void 0!==R&&R.trim()?null===vn||void 0===vn||null===(F=vn.PaymentPlan)||void 0===F||null===(O=F.Name)||void 0===O?void 0:O.trim():void 0,ha=(0,t.useCallback)(()=>{Wi(!0)},[]),ma=(0,t.useCallback)(()=>{Wi(!1)},[]),fa=(0,t.useCallback)(()=>{Wi(!1),(0,ao.z$)(ie("policies.upgradeModal.contactSalesMessage"))},[ie]),ya=(0,t.useCallback)(()=>Oe===I.Px||Oe===I.JE?ee.organization.default_policy_id:Oe||(null===Ae||void 0===Ae?void 0:Ae.policy_id),[Oe,Ae,ee.organization.default_policy_id]),ba=(0,t.useCallback)(function(e,i){var o;let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(!e||null===ee||void 0===ee||null===(o=ee.organization)||void 0===o||!o.organization_id)return;Vn.requestSend("notify",async o=>{try{if("verification"===i){const i=await y.Ay.sendVerificationEmail(ee.organization.organization_id,e,ya(),o);me(ie("devices.verificationEmailSent"),i)}else{const i=await y.Ay.sendRiskEmail(ee.organization.organization_id,e,ya(),o);me(ie("devices.riskEmailSent"),i)}}catch(n){if(fe(n))return;console.error("Failed to send ".concat(i," email:"),n),ge({isSaved:!1,message:n.message||ie("general.errorMessage")})}},{deviceId:e,action:i},void 0,n)},[ee,ya,ge,fe,me,ie,Vn]),ka=(0,t.useCallback)(()=>{na?ha():dn&&ba(dn.device_id,"verification")},[na,ha,dn,ba]),Aa=(0,t.useCallback)(()=>{na?ha():dn&&ba(dn.device_id,"risk")},[na,ha,dn,ba]),wa=t.useRef(!1);(0,t.useEffect)(()=>{if(wa.current)return;if(!On)return;if(null===ue.get(Ao.r7))return;if("notify"!==(0,Ao.AA)(ue,ee.organization.organization_id))return;wa.current=!0;const e=(0,Ao.tG)(ue,"notify",ee.organization.organization_id),i=new URLSearchParams(ue);i.delete(Ao.r7),i.delete(Ao.X6),pe(i,{replace:!0}),null!==e&&void 0!==e&&e.deviceId&&e.action&&ba(e.deviceId,e.action,!0)},[On,ue,pe,ba,ee.organization.organization_id]),(0,t.useEffect)(()=>{var e,i;if(!dn)return void xo(null);const o=dn,n=null!==(i=(Array.isArray(null===o||void 0===o?void 0:o.tags)?[...null!==(e=null===o||void 0===o?void 0:o.tags)&&void 0!==e?e:[]]:[])[0])&&void 0!==i?i:null;xo(n)},[null===dn||void 0===dn?void 0:dn.device_id,JSON.stringify(null!==(U=null===dn||void 0===dn?void 0:dn.tags)&&void 0!==U?U:[])]),(0,t.useEffect)(()=>{ki(void 0),ji(void 0),Ei(void 0)},[null===dn||void 0===dn?void 0:dn.device_id]),(0,t.useEffect)(()=>{var e;if(!dn)return void Ji(null);const i=null!==(e=null===dn||void 0===dn?void 0:dn.note)&&void 0!==e?e:null;Ji(i)},[null===dn||void 0===dn?void 0:dn.device_id,null===dn||void 0===dn?void 0:dn.note]);const _a=(0,t.useCallback)(async()=>{var e;if(null!==ee&&void 0!==ee&&null!==(e=ee.organization)&&void 0!==e&&e.organization_id)try{const e=await y.Ay.getTags(ee.organization.organization_id);co(e)}catch(i){console.error("Failed to load tags:",i)}},[null===ee||void 0===ee||null===(V=ee.organization)||void 0===V?void 0:V.organization_id]);(0,t.useEffect)(()=>{_a()},[_a]);const ja=(0,t.useCallback)(()=>{Ui(!0)},[]),Sa=(0,t.useCallback)(()=>{Ui(!0)},[]),Ca=(0,t.useCallback)(async e=>{var i;if(dn&&null!==ee&&void 0!==ee&&null!==(i=ee.organization)&&void 0!==i&&i.organization_id)try{var o;await y.Ay.updateDeviceMetadata(ee.organization.organization_id,dn.device_id,{note:e}),Ji(e),Ko(e=>e+1),yn(dn.device_id,{note:e}),ge({isSaved:!0,title:ie("devices.noteAdded"),message:ie("devices.noteAddedDescription",{deviceName:(null===(o=dn.computer_name)||void 0===o?void 0:o.name)||dn.model||"Unknown"})})}catch(n){console.error("Failed to save note:",n),ge({isSaved:!1,message:n.message||ie("general.errorMessage")})}},[dn,ee,ge,ie,yn]),za=(0,t.useCallback)(async()=>{var e;if(dn&&null!==ee&&void 0!==ee&&null!==(e=ee.organization)&&void 0!==e&&e.organization_id)try{await y.Ay.updateDeviceMetadata(ee.organization.organization_id,dn.device_id,{note:""}),Ji(null),yn(dn.device_id,{note:void 0}),ge({isSaved:!0,title:ie("general.noteDeleted")})}catch(i){console.error("Failed to delete note:",i),ge({isSaved:!1,message:i.message||ie("general.errorMessage")})}},[dn,ee,ge,ie,yn]),Ea=(0,t.useCallback)(()=>{Ui(!1)},[]),Ia=(0,t.useCallback)(()=>{Ni(!0),fo("")},[]),Ta=(0,t.useCallback)(()=>{Ni(!1),fo("")},[]),Da=(0,t.useCallback)(e=>{fo(e)},[]),Ma=(0,t.useCallback)(async e=>{var i;const o=e.trim();if(o&&dn&&null!==ee&&void 0!==ee&&null!==(i=ee.organization)&&void 0!==i&&i.organization_id)if(o.length>we.U)ge({isSaved:!1,message:ie("devices.tags.maxLengthError",{max:we.U})});else try{const e=[o];await y.Ay.updateDeviceMetadata(ee.organization.organization_id,dn.device_id,{tags:e}),yn(dn.device_id,{tags:e}),await _a(),xo(o),Fo(e=>e+1),Ni(!1),fo(""),ge({isSaved:!0,title:ie("general.tagAdded")})}catch(n){console.error("Failed to create tag:",n),ge({isSaved:!1,message:n.message||ie("general.errorMessage")})}},[dn,ee,ge,ie,yn,_a]),Wa=(0,t.useCallback)(async e=>{var i;if(!dn||null===ee||void 0===ee||null===(i=ee.organization)||void 0===i||!i.organization_id)return;const o=e.trim();if(o.length>we.U)ge({isSaved:!1,message:ie("devices.tags.maxLengthError",{max:we.U})});else try{var n;const e=Array.isArray(null===dn||void 0===dn?void 0:dn.tags)?[...null!==(n=null===dn||void 0===dn?void 0:dn.tags)&&void 0!==n?n:[]]:[],i=e.includes(o),a=i?[]:[o];yn(dn.device_id,{tags:a}),i?xo(null):(xo(o),Fo(e=>e+1)),Ni(!1),fo(""),ge({isSaved:!0,message:ie(i?"general.tagRemoved":"general.tagAdded")}),y.Ay.updateDeviceMetadata(ee.organization.organization_id,dn.device_id,{tags:a}).catch(n=>{console.error("Failed to select tag:",n),yn(dn.device_id,{tags:e}),xo(i?o:null),ge({isSaved:!1,message:n.message||ie("general.errorMessage")})})}catch(a){console.error("Failed to select tag:",a),ge({isSaved:!1,message:a.message||ie("general.errorMessage")})}},[dn,ee,ge,ie,yn]),Pa=(0,t.useCallback)(async()=>{var e;if(dn&&null!==ee&&void 0!==ee&&null!==(e=ee.organization)&&void 0!==e&&e.organization_id&&vo)try{var i;const e=Array.isArray(null===dn||void 0===dn?void 0:dn.tags)?[...null!==(i=null===dn||void 0===dn?void 0:dn.tags)&&void 0!==i?i:[]]:[],o=e.filter(e=>e!==vo);
1yn(dn.device_id,{tags:o}),xo(null),ge({isSaved:!0,message:ie("general.tagRemoved")}),y.Ay.updateDeviceMetadata(ee.organization.organization_id,dn.device_id,{tags:o}).catch(i=>{console.error("Failed to remove tag:",i),yn(dn.device_id,{tags:e}),xo(vo),ge({isSaved:!1,message:i.message||ie("general.errorMessage")})})}catch(o){console.error("Failed to remove tag:",o),ge({isSaved:!1,message:o.message||ie("general.errorMessage")})}},[dn,ee,vo,ge,ie,yn]),Ba=(0,t.useCallback)(async()=>{var e;if(!dn||null===ee||void 0===ee||null===(e=ee.organization)||void 0===e||!e.organization_id)return void Ge(!1);Ze(!0);const i=dn.device_id,o=dn.email||void 0,n=(0,so.$)([...(0,so.z)(hn),...(0,so.z)(mn)],o,i);try{await y.Ay.deleteDevice(ee.organization.organization_id,i,o,{revokeSessions:!n}),bn(i),Ge(!1),Ze(!1),ae("/devices",{replace:!0}),fn(Ae,!0,!0)}catch(a){console.error("Failed to delete device:",a),ge({isSaved:!1,message:ie("general.errorMessage")})}finally{Ze(!1),Ge(!1)}},[dn,ee,hn,mn,ge,ie,bn,ae,fn,Ae]),La=(0,t.useCallback)(async()=>{var e;if(!dn||null===ee||void 0===ee||null===(e=ee.organization)||void 0===e||!e.organization_id||!dn.email)return ge({isSaved:!1,message:ie("general.errorMessage")}),void ii(!1);ti(!0);try{await y.Ay.deleteMfa(ee.organization.organization_id,dn.device_id,dn.email),ge({isSaved:!0,title:ie("Users.mfa.success")})}catch(i){console.error("Failed to reset MFA:",i),ge({isSaved:!1,message:(null===i||void 0===i?void 0:i.message)||ie("general.errorMessage")})}finally{ti(!1),ii(!1)}},[dn,ee,ge,ie]),Na=dn?(null===(H=dn.computer_name)||void 0===H?void 0:H.name)||dn.model||(0,z.ZI)(dn,ie):"",Ra=null!==(G=null!==(q=null===dn||void 0===dn?void 0:dn.snoozed_until)&&void 0!==q?q:null===$o||void 0===$o?void 0:$o.snoozed_until)&&void 0!==G?G:null,Fa=null!==(J=null!==(Y=null===dn||void 0===dn?void 0:dn.snooze_reason)&&void 0!==Y?Y:null===$o||void 0===$o?void 0:$o.snooze_reason)&&void 0!==J?J:null,Oa=null!==(Q=null!==(Z=null===dn||void 0===dn?void 0:dn.snooze_mfa)&&void 0!==Z?Z:null===$o||void 0===$o?void 0:$o.snooze_mfa)&&void 0!==Q?Q:null,Ua=void 0!==bi?bi:Ra,Va=void 0!==_i?_i:Fa,Ka=void 0!==zi?zi:Oa,Ha=(0,K.NP)({snoozed_until:Ua}),Ga=!An,qa=(0,t.useCallback)(()=>{Ha||!(0,K.R9)(dn)?di(!0):vi(!0)},[Ha,dn]),Ja=(0,t.useCallback)(async e=>{let i=e.snoozedUntil,o=e.snoozeMfa,n=e.timeZone,a=e.reason;if(null!==dn&&void 0!==dn&&dn.device_id)try{await y.Ay.snoozeDevice(ee.organization.organization_id,dn.device_id,i,o,n,a),ki(i),ji(null!==a&&void 0!==a?a:null),Ei(o),yn(dn.device_id,{snoozed_until:i,snooze_reason:a,snooze_mfa:o}),kn(dn.device_id,!0),fn(Ae,!0,!0),ge({isSaved:!0,title:ie("devices.snoozeToastTitle"),message:ie("devices.snoozeToastMessage",{deviceName:Na,until:(0,K.F$)(i)})})}catch(t){console.error("Failed to snooze device:",t),ge({isSaved:!1,message:ie("devices.snoozeError")})}},[null===dn||void 0===dn?void 0:dn.device_id,ee.organization.organization_id,yn,kn,fn,Ae,ge,ie,Na]),Ya=(0,t.useCallback)(async()=>{if(null!==dn&&void 0!==dn&&dn.device_id)try{await y.Ay.cancelDeviceSnooze(ee.organization.organization_id,dn.device_id),ki(null),ji(null),Ei(null),yn(dn.device_id,{snoozed_until:null,snooze_reason:null,snooze_mfa:null}),kn(dn.device_id,!0),fn(Ae,!0,!0),ge({isSaved:!0,message:ie("devices.snoozeCancelled")})}catch(e){console.error("Failed to cancel snooze:",e),ge({isSaved:!1,message:ie("devices.snoozeCancelError")})}},[null===dn||void 0===dn?void 0:dn.device_id,ee.organization.organization_id,yn,kn,fn,Ae,ge,ie]);if((en||tn)&&!dn)return(0,Se.jsx)(qi,{backHref:Zo});if(!dn)return(0,Se.jsx)(Qi,{backHref:Zo});const Qa=Yn.length>0&&Yn.some(e=>e.risk===z.En.Unknown&&e.isEnforced),Za=(0,K.$I)(Qn,Qa,(0,z.fZ)(dn),ie),Xa=(0,z.Nf)(dn),$a=(0,z.US)(dn,Gn,Kn),et=((0,z.xl)(dn.os_name),[{label:ie("navigation.devices"),href:Zo},{label:Na,href:"/devices/".concat(ye)}]),it=!Ha&&Xa===z.dI.Unverified&&dn.os_name,ot=!Ha&&$a!==z.En.Safe&&Xa===z.dI.Verified&&dn.os_name,nt=Boolean(null===ee||void 0===ee||null===(X=ee.organization)||void 0===X?void 0:X.organization_id)&&Boolean(dn.email)&&!ta,at=Boolean(null===ee||void 0===ee||null===($=ee.organization)||void 0===$?void 0:$.organization_id);return(0,Se.jsxs)(Se.Fragment,{children:[(0,Se.jsx)(f.A,{links:et}),(0,Se.jsxs)("div",{className:"device-detail",children:[(0,Se.jsx)(Ce,{deviceName:Na,onAddNote:An?void 0:ja,hasDeviceNote:Boolean(Gi),onAddTag:An?void 0:Ia,onSelectTag:An?void 0:Wa,onCreateTag:An?void 0:Ma,onOpenTagMenu:An?void 0:()=>Ni(!0),onCloseTagMenu:An?void 0:Ta,tagOptions:ro,selectedTag:vo,tagSearchValue:mo,onTagSearchChange:An?void 0:Da,isTagMenuOpen:!An&&Li,onSendVerificationEmail
1:An?void 0:it?ka:void 0,onSendRiskEmail:An?void 0:ot?Aa:void 0,onResetMfa:An?void 0:nt?()=>ii(!0):void 0,onDeleteDevice:An?void 0:at?()=>Ge(!0):void 0,onSnooze:Ga?Ja:void 0,onCancelSnooze:Ga&&Ha?Ya:void 0,onOpenSnoozeDialog:Ga?qa:void 0,snoozedUntil:Ua,verificationDisabled:na,isReadOnly:An,onDebug:Sn?()=>In(!0):void 0}),(0,Se.jsx)(qe,{device:dn,statuses:Za,hasDeviceChecks:Yn.length>0,cveEnabled:xn,selectedTag:vo,onRemoveTag:An?void 0:Pa,deviceNotes:Gi,onEditNotes:An?void 0:Sa,latestXfaVersion:To,xfaVersionInfo:Po,snoozedUntil:Ua,snoozeReason:Va,onSnoozeClick:Ga?qa:void 0,flashTag:Ro,flashNotes:Vo,latestBlockedAgoSeconds:oa}),dn.managed&&!An&&(0,b.x8)(ee.organization)&&(0,Se.jsx)(d.A,{severity:"info",action:(0,Se.jsx)(c.A,{color:"inherit",size:"small",onClick:()=>ae("/integrations#mdm-preinstall"),children:ie("mdmDeployment.viewIntegrations")}),children:ie("mdmDeployment.managedDeviceHint")}),(0,Se.jsx)($i.R,{open:ri,inProgress:hi,initialSnoozedUntil:Ha?Ua:null,initialReason:Ha?Va:null,initialSnoozeMfa:Ha?Ka:null,onCancel:()=>di(!1),onConfirm:async e=>{mi(!0);try{await Ja(e),di(!1)}finally{mi(!1)}},onRemoveSnooze:async()=>{mi(!0);try{await Ya(),di(!1)}finally{mi(!1)}}}),(0,Se.jsx)(xe.s,{open:pi,onClose:()=>vi(!1)}),da.length>0&&(0,Se.jsx)(u.A,{sx:{borderBottom:1,borderColor:"divider",display:"flex",justifyContent:"flex-start",alignItems:"center",marginTop:"24px"},children:(0,Se.jsxs)(p.A,{value:ca,onChange:(e,i)=>Me(i),variant:"scrollable",scrollButtons:"auto","aria-label":ie("devices.checks.filters.label"),children:[da.includes("needsAction")&&(0,Se.jsx)(v.A,{value:"needsAction",label:(0,Se.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[ie("devices.checks.filters.needsAction"),(0,Se.jsx)(x.A,{className:"device-checks-needs-action-badge",label:ra,size:"small",sx:{width:"24px",minWidth:"24px",height:"24px",flexShrink:0,borderRadius:"50%"}})]})}),da.includes("enforced")&&(0,Se.jsx)(v.A,{value:"enforced",label:ie("devices.checks.filters.enforced")}),da.includes("notEnforced")&&(0,Se.jsx)(v.A,{value:"notEnforced",label:ie("devices.checks.filters.notEnforced")}),da.includes("missingInformation")&&(0,Se.jsx)(v.A,{value:"missingInformation",label:ie("devices.checks.filters.missingInformation")}),da.includes("all")&&(0,Se.jsx)(v.A,{value:"all",label:ie("devices.checks.filters.all")})]})}),(0,Se.jsxs)(u.A,{sx:{display:"flex",alignItems:{xs:"stretch",sm:"center"},justifyContent:"space-between",flexDirection:{xs:"column",sm:"row"},gap:"12px",margin:"16px 0"},children:[(0,Se.jsx)(g.A,{inputRef:Qo,value:Be,onChange:e=>Le(e.target.value),placeholder:ie("devices.checks.searchPlaceholder"),size:"small",inputProps:{"aria-label":ie("devices.checks.searchLabel")},InputProps:{startAdornment:(0,Se.jsx)(h.A,{position:"start",children:(0,Se.jsx)(m.A,{fontSize:"small"})})},sx:{width:{xs:"100%",sm:"320px"}}}),(0,Se.jsx)(Hi,{policies:ke||[],actualPolicy:Hn,selectedPolicyId:Oe,onPolicyChange:Ue})]}),(0,Se.jsx)(Di,{checks:ua,sortField:Xn,sortDirection:$n,onSort:ea,noPoliciesApplied:Oe===I.JE,awarenessConfigured:ze,enforcementConfigured:Ee,awarenessLocked:aa,enforcementLocked:sa,onPolicyCheckEdit:!wn.permissionsLoading&&wn.canMutateOrganization?_n:void 0,emptyMessage:Be.trim().length>0?ie("devices.checks.emptySearch"):ie("devices.checks.emptyFilter")}),(0,Se.jsx)(io.A,{open:null!==qo,organizationId:ee.organization.organization_id,source:"device_details",request:qo,policyCandidates:null!==ke&&void 0!==ke?ke:[],capabilities:(0,n.A)((0,n.A)({},wn),{},{awarenessConfigured:ze,awarenessLocked:aa,enforcementLocked:sa}),onClose:()=>Jo(null),refreshOwner:jn,returnFocusRef:Yo,fallbackFocusRef:Qo}),He&&(0,Se.jsx)(eo.A,{title:ie("devices.deleteDeviceTitle")+Na,cancelText:ie("devices.mfa.cancel"),confirmText:ie("devices.mfa.confirm"),inProgress:Qe,onCancel:()=>Ge(!1),onConfirm:Ba}),ei&&(0,Se.jsx)(eo.A,{title:ie("devices.mfa.confirmTitle")+dn.email,cancelText:ie("devices.mfa.cancel"),confirmText:ie("devices.mfa.confirm"),inProgress:ai,onCancel:()=>ii(!1),onConfirm:La}),(0,Se.jsx)(Xi,{open:Oi,onClose:Ea,onSave:Ca,onDelete:Gi?za:void 0,existingNote:Gi||"",isEditMode:!!Gi}),(0,Se.jsx)(oo.g0,{open:Mi,onClose:ma,planName:ga,includedFeatures:va,missingFeatures:xa,onContactSales:fa}),Sn&&(0,Se.jsx)(yo,{open:En,onClose:()=>In(!1),device:dn}),(0,Se.jsx)(bo.I,(0,n.A)({},Vn.dialogProps))]})]})}},23354(e,i,o){o.d(i,{A:()=>n});o(9950);const n=o.p+"static/media/Slack-icon.75843cc7b002489e3c23e3105b8feac2.svg"},26584(e,i,o){o.d(i,{A:()=>n});o(9950);const n=o.p+"static/media/warning-circle-outline-white.a270deca8ee981337b856821334dc426.svg"},30841(e,i,o){o.d(i,{I2:()=>s,Qm:()=>t});var n=o(47028);const a="csrfToken",t=()=>{const e=l(a);return""===e?null:e},s=()=>{const e=(0,n.A)();return r(a,e),e},l=e=>{if("undefined"!==typeof window)return sessionStorage.getItem(e)},r=(e,i)=>{"undefined"!==typeof window&&sessionStorage.setItem(e,i)}},33390(e,i,o){o.d(i,{P:()=>d});var n=o(89379),a=o(9950),t=o(55030),s=o(82259),l=o(81134),r=o(13495);const d=()=>{const e=(0,t.Bd)().t,i=(0,l.d)().addToast,o=(0,a.useCallback)(function(o,a,t){let s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"emails";const l=[t,a&&a.limit>
10?e("trial"===a.period?"invitations"===s?"Awareness.manualQuota.invitationsRemainingTrial":"Awareness.manualQuota.remainingTrial":"Awareness.manualQuota.remaining",{count:a.remaining,limit:a.limit}):void 0].filter(Boolean).join(" ");i((0,n.A)({isSaved:!0,title:o},l?{message:l}:{}))},[i,e]);return{showSuccess:o,showQuotaError:(0,a.useCallback)(o=>{if(!(0,s.RM)(o))return!1;const n=void 0!==o.requested&&o.remaining>0&&o.requested>o.remaining;return i({isSaved:!1,title:e(n?"Awareness.manualQuota.batchTooLargeTitle":"Awareness.manualQuota.limitReachedTitle"),message:e(n?"Awareness.manualQuota.batchTooLargeMessage":o.isTrial?"Awareness.manualQuota.limitReachedTrialMessage":"Awareness.manualQuota.limitReachedMessage",{count:o.remaining,limit:o.limit,requested:o.requested}),actionLabel:e("Awareness.manualQuota.upgradeAction"),action:r.h}),!0},[i,e])}}},49735(e,i,o){o.d(i,{Ll:()=>u,rP:()=>l,uK:()=>p,uh:()=>v,vp:()=>x,ym:()=>c});var n=o(89379),a=o(66364),t=o(30841),s=o(95595);const l="slackConnectOrigin",r=e=>{if(!e)return;const i=(0,s.ty)(e.route);return i?(0,n.A)((0,n.A)((0,n.A)((0,n.A)((0,n.A)({route:i},"invite"===e.dialog||"notify"===e.dialog?{dialog:e.dialog}:{}),"string"===typeof e.email&&e.email.trim()?{email:e.email}:{}),"string"===typeof e.deviceId&&e.deviceId.trim()?{deviceId:e.deviceId}:{}),"verification"===e.action||"risk"===e.action?{action:e.action}:{}),"resend"===e.inviteAction?{inviteAction:e.inviteAction}:{}):void 0},d=e=>"".concat("slackConnectPending:").concat(e),c=e=>{const i=sessionStorage.getItem(d(e));if(!i)return null;try{const o=JSON.parse(i);if(o&&"object"===typeof o&&"string"===typeof o.organizationId&&o.organizationId.trim()&&o.state===e)return{organizationId:o.organizationId,state:o.state,origin:r(o.origin)}}catch(o){return null}return null},u=e=>{sessionStorage.removeItem(d(e))},p=e=>{var i;const o=c(e);return null!==o&&void 0!==o&&null!==(i=o.origin)&&void 0!==i&&i.dialog?((0,s.fB)(e,o.organizationId,o.origin),u(e),(0,s.BE)(e,o.origin)):(u(e),null)},v=(e,i)=>{sessionStorage.setItem(l,(0,s.ty)(null===i||void 0===i?void 0:i.route)||window.location.pathname+window.location.search);const o=(0,t.I2)();sessionStorage.setItem(d(o),JSON.stringify({organizationId:e,state:o,origin:r(i)}));const n="2827818075858.10786412790256";const c=x(),u=new URL("https://slack.com/oauth/v2/authorize");u.searchParams.append("client_id",n),u.searchParams.append("scope","chat:write,users:read,users:read.email"),u.searchParams.append("state",o),u.searchParams.append("redirect_uri",c),u.searchParams.append("response_type","code"),a.A.navigateToExternal(u.toString(),!0)},x=()=>{const e=new URL(window.location.href);return e.search="",e.pathname="/connect/slack",e.toString()}},50256(e,i,o){o.d(i,{A:()=>l});var n=o(89379),a=o(80045),t=(o(9950),o(44414));const s=["size","fill"],l=e=>{let i=e.size,o=void 0===i?16:i,l=e.fill,r=void 0===l?"currentColor":l,d=(0,a.A)(e,s);return(0,t.jsx)("svg",(0,n.A)((0,n.A)({width:o,height:o,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},d),{},{children:(0,t.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2.9324 13.0676C5.73116 15.8664 10.2688 15.8664 13.0676 13.0676C15.8664 10.2688 15.8664 5.73116 13.0676 2.93241C10.2688 0.13363 5.73118 0.133631 2.9324 2.93241C0.133644 5.73116 0.133625 10.2688 2.9324 13.0676ZM7.5 10.6668C7.5 10.943 7.72386 11.1668 8 11.1668C8.27614 11.1668 8.5 10.943 8.5 10.6668L8.49997 6.54063L9.97976 8.02042C10.175 8.21568 10.4916 8.21567 10.6869 8.02042C10.8821 7.82516 10.8821 7.50857 10.6869 7.31331L8.35355 4.98
1C8.30561 4.93206 8.25036 4.89585 8.19139 4.87148C8.13242 4.84701 8.06783 4.83353 8 4.83358C7.93216 4.83353 7.86758 4.84701 7.80861 4.87148C7.74964 4.89585 7.69439 4.93206 7.64645 4.98L5.31313 7.31331C5.11787 7.50858 5.11787 7.82516 5.31313 8.02042C5.50839 8.21568 5.82497 8.21569 6.02024 8.02042L7.50003 6.54063L7.5 10.6668Z",fill:r})}))}},51392(e,i,o){o.d(i,{JY:()=>r,m6:()=>c,uX:()=>d});var n=o(44426),a=o(84730),t=o(48091),s=o(60927);const l=new Set([n.T.PLAY_PROTECT,n.T.DESKTOP_AWARENESS_NOTIFICATIONS,n.T.RUNAWAY_AI,n.T.AIKIDO_ENABLED,n.T.SELF_INVITE,n.T.PASSKEYS,n.T.FIX_FROM_WEB,n.T.IDP,n.T.GOOGLE_ENFORCEMENT]),r=e=>l.has(e),d=(e,i,o)=>{if(((e,i,o)=>"antivirus_enabled"===e?!!(0,t.m0)(null!==i&&void 0!==i?i:void 0)&&!!r(n.T.PLAY_PROTECT)&&(0,s.st)(o,n.T.PLAY_PROTECT):a.rd.includes(e)?!!r(n.T.RUNAWAY_AI)&&(0,s.st)(o,n.T.RUNAWAY_AI):!!a.aJ.includes(e)&&!!r(n.T.AIKIDO_ENABLED)&&(0,s.st)(o,n.T.AIKIDO_ENABLED))(e,i,o))return"antivirus_enabled"===e?"devices.checks.androidBeta":"devices.checks.beta"},c=e=>(0,s.st)(e,n.T.PLAY_PROTECT)?"discovery.Antivirus.tooltip_extra_play_protect":"discovery.Antivirus.tooltip_extra"},93412(e,i,o){o.d(i,{A:()=>s});o(9950);var n=o(68476),a=o(66364),t=o(44414);const s=e=>{let i=e.links;const o=i.length-1;return(0,t.jsx)("nav",{className:"breadcrumbs","aria-label":"breadcrumb",children:(0,t.jsx)("ol",{className:"breadcrumbs-list",children:i.map((e,i)=>{const s=i===o;return(0,t.jsxs)("li",{className:"breadcrumbs-item",children:[e.href&&!s?(0,t.jsx)("a",{className:"breadcrumbs-link",href:e.href,onClick:i=>((e,i)=>{e.preventDefault(),i&&a.A.navigateTo(i)})(i,e.href),children:e.label}):(0,t.jsx)("span",{className:"breadcrumbs-current","aria-current":"page",children:e.label}),!s&&(0,t.jsx)(n.A,{"aria-hidden":"true",className:"breadcrumbs-separator"})]},"".concat(e.label,"-").concat(i))})})})}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.