1import{r as e,I as t,bG as a,bq as i,bF as n,aW as o,bz as s,iQ as l,cT as r,cu as d,bO as c,cF as u,cM as m,ed as p,cJ as h,cK as g,cL as f,cE as b,cc as x}from"./MZk2sk3Q.js";import{C as y,d as k,e as v,B as S,U as E,z as _,f as A,E as T,l as j,D as R,bl as I,J as O,K as C}from"./r_90E_HP.js";import{n as L}from"./BBsopRUb.js";import{h as w,E as D,R as P}from"./Cw5jBGJS.js";import{F}from"./D6oVoAjQ.js";/* empty css */import{R as M,B as N,a as H}from"./Ck3BqV2r.js";import{u as W}from"./yDXc_zzP.js";import{R as z,X as U,Y as $,T as B,L as K,c as q}from"./DM62oQWm.js";import{a as G,R as V}from"./CTvo0ZkM.js";import"./BM-92CBZ.js";import"./B2456Otf.js";import"./BZ8oOFgu.js";var Y={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M880.1 154H143.9c-24.5 0-39.8 26.7-27.5 48L349 597.4V838c0 17.7 14.2 32 31.8 32h262.4c17.6 0 31.8-14.3 31.8-32V597.4L907.7 202c12.2-21.3-3.1-48-27.6-48zM603.4 798H420.6V642h182.9v156zm9.6-236.6l-9.5 16.6h-183l-9.5-16.6L212.7 226h598.6L613 561.4z"}}]},name:"filter",theme:"outlined"};function X(){return X=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var i in a)Object.prototype.hasOwnProperty.call(a,i)&&(e[i]=a[i])}return e},X.apply(this,arguments)}const J=(a,i)=>e.createElement(t,X({},a,{ref:i,icon:Y})),Q=e.forwardRef(J);var Z={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M854.4 800.9c.2-.3.5-.6.7-.9C920.6 722.1 960 621.7 960 512s-39.4-210.1-104.8-288c-.2-.3-.5-.5-.7-.8-1.1-1.3-2.1-2.5-3.2-3.7-.4-.5-.8-.9-1.2-1.4l-4.1-4.7-.1-.1c-1.5-1.7-3.1-3.4-4.6-5.1l-.1-.1c-3.2-3.4-6.4-6.8-9.7-10.1l-.1-.1-4.8-4.8-.3-.3c-1.5-1.5-3-2.9-4.5-4.3-.5-.5-1-1-1.6-1.5-1-1-2-1.9-3-2.8-.3-.3-.7-.6-1-1C736.4 109.2 629.5 64 512 64s-224.4 45.2-304.3 119.2c-.3.3-.7.6-1 1-1 .9-2 1.9-3 2.9-.5.5-1 1-1.6 1.5-1.5 1.4-3 2.9-4.5 4.3l-.3.3-4.8 4.8-.1.1c-3.3 3.3-6.5 6.7-9.7 10.1l-.1.1c-1.6 1.7-3.1 3.4-4.6 5.1l-.1.1c-1.4 1.5-2.8 3.1-4.1 4.7-.4.5-.8.9-1.2 1.4-1.1 1.2-2.1 2.5-3.2 3.7-.2.3-.5.5-.7.8C103.4 301.9 64 402.3 64 512s39.4 210.1 104.8 288c.2.3.5.6.7.9l3.1 3.7c.4.5.8.9 1.2 1.4l4.1 4.7c0 .1.1.1.1.2 1.5 1.7 3 3.4 4.6 5l.1.1c3.2 3.4 6.4 6.8 9.6 10.1l.1.1c1.6 1.6 3.1 3.2 4.7 4.7l.3.3c3.3 3.3 6.7 6.5 10.1 9.6 80.1 74 187 119.2 304.5 119.2s224.4-45.2 304.3-119.2a300 300 0 0010-9.6l.3-.3c1.6-1.6 3.2-3.1 4.7-4.7l.1-.1c3.3-3.3 6.5-6.7 9.6-10.1l.1-.1c1.5-1.7 3.1-3.3 4.6-5 0-.1.1-.1.1-.2 1.4-1.5 2.8-3.1 4.1-4.7.4-.5.8-.9 1.2-1.4a99 99 0 003.3-3.7zm4.1-142.6c-13.8 32.6-32 62.8-54.2 90.2a444.07 444.07 0 00-81.5-55.9c11.6-46.9 18.8-98.4 20.7-152.6H887c-3 40.9-12.6 80.6-28.5 118.3zM887 484H743.5c-1.9-54.2-9.1-105.7-20.7-152.6 29.3-15.6 56.6-34.4 81.5-55.9A373.86 373.86 0 01887 484zM658.3 165.5c39.7 16.8 75.8 40 107.6 69.2a394.72 394.72 0 01-59.4 41.8c-15.7-45-35.8-84.1-59.2-115.4 3.7 1.4 7.4 2.9 11 4.4zm-90.6 700.6c-9.2 7.2-18.4 12.7-27.7 16.4V697a389.1 389.1 0 01115.7 26.2c-8.3 24.6-17.9 47.3-29 67.8-17.4 32.4-37.8 58.3-59 75.1zm59-633.1c11 20.6 20.7 43.3 29 67.8A389.1 389.1 0 01540 327V141.6c9.2 3.7 18.5 9.1 27.7 16.4 21.2 16.7 41.6 42.6 59 75zM540 640.9V540h147.5c-1.6 44.2-7.1 87.1-16.3 127.8l-.3 1.2A445.02 445.02 0 00540 640.9zm0-156.9V383.1c45.8-2.8 89.8-12.5 130.9-28.1l.3 1.2c9.2 40.7 14.7 83.5 16.3 127.8H540zm-56 56v100.9c-45.8 2.8-89.8 12.5-130.9 28.1l-.3-1.2c-9.2-40.7-14.7-83.5-16.3-127.8H484zm-147.5-56c1.6-44.2 7.1-87.1 16.3-127.8l.3-1.2c41.1 15.6 85 25.3 130.9 28.1V484H336.5zM484 697v185.4c-9.2-3.7-18.5-9.1-27.7-16.4-21.2-16.7-41.7-42.7-59.1-75.1-11-20.6-20.7-43.3-29-67.8 37.2-14.6 75.9-23.3 115.8-26.1zm0-370a389.1 389.1 0 01-115.7-26.2c8.3-24.6 17.9-47.3 29-67.8 17.4-32.4 37.8-58.4 59.1-75.1 9.2-7.2 18.4-12.7 27.7-16.4V327zM365.7 165.5c3.7-1.5 7.3-3 11-4.4-23.4 31.3-43.5 70.4-59.2 115.4-21-12-40.9-26-59.4-41.8 31.8-29.2 67.9-52.4 107.6-69.2zM165.5 365.7c13.8-32.6 32-62.8 54.2-90.2 24.9 21.5 52.2 40.3 81.5 55.9-11.6 46.9-18.8 98.4-20.7 152.6H137c3-40.9 12.6-80.6 28.5-118.3zM137 540h143.5c1.9 54.2 9.1 105.7 20.7 152.6a444.07 444.07 0 00-81.5 55.9A373.86 373.86 0 01137 540zm228.7 318.5c-39.7-16.8-75.8-40-107.6-69.2 18.5-15.8 38.4-29.7 59.4-41.8 15.7 45 35.8 84.1 59.2 115.4-3.7-1.4-7.4-2.9-11-4.4zm292.6 0c-3.7 1.5-7.3 3-11 4.4 23.4-31.3 43.5-70.4 59.2-115.4 21 12 40.9 26 59.4 41.8a373.81 373.81 0 01-107.6 69.2z"}}]},name:"global",theme:"outlined"};function ee(){return ee=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var i in a)Object.prototype.hasOwnProperty.call(a,i)&&(e[i]=a[i])}return e},ee.apply(this,arguments)}const te=(a,i)=>e.createElement(t,ee({},a,{ref:i,icon:Z})),ae=e.forwardRef(te);var ie={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M848 359.3H627.7L825.8 109c4.1-5.3.4-13-6.3-13H436c-2.8 0-5.5 1.5-6.9 4L170 547.5c-3.1 5.3.7 12 6.9 12h174.4l-89.4 357.6c-1.9 7.8 7.5 13.3 13.3 7.7L853.5 373c5.2-4.9 1.7-13.7-5.5-13.7zM378.2 732.5l60.3-241H281.1l189.6-327.4h224.6L487 427.4h211L378.2 732.5z"}}]},name:"thunderbolt",theme:"outlined"};function ne(){return ne=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var i in a)Object.prototype.hasOwnProperty.call(a,i)&&(e[i]=a[i])}return e},ne.apply(this,arguments)}const oe=(a,i)=>e.createElement(t,ne({},a,{ref:i,icon:ie})),se=e.forwardRef(oe);var le=3.77952755906,re=(e=>(e[e.LOW=1]="LOW",e[e.NORMAL=2]="NORMAL",e[e.MEDIUM=3]="MEDIUM",e[e.HIGH=7]="HIGH",e[e.EXTREME=12]="EXTREME",e))(re||{}),de={method:"save",resolution:3,page:{margin:0,format:"A4",orientation:"portrait"},canvas:{mimeType:"image/jpeg",qualityRatio:1,useCORS:!0,logging:!1},overrides:{}},ce=class{pdf;canvas;options;constructor(e,t){this.canvas=e,this.options=t,this.pdf=new D({format:this.options.page.format,orientation:this.options.page.orientation,...this.options.overrides?.pdf,unit:"mm"})}getMarginTopMM(){const e="object"==typeof this.options.page.margin?this.options.page.margin.top:this.options.page.margin;return Number(e)}getMarginLeftMM(){const e="object"==typeof this.options.page.margin?this.options.page.margin.left:this.options.page.margin;return Number(e)}getMarginRightMM(){const e="object"==typeof this.options.page.margin?this.options.page.margin.right:this.options.page.margin;return Number(e)}getMarginBottomMM(){const e="object"==typeof this.options.page.margin?this.options.page.margin.bottom:this.options.page.margin;return Number(e)}getMarginTop(){return this.getMarginTopMM()*le}getMarginBottom(){return this.getMarginBottomMM()*le}getMarginLeft(){return this.getMarginLeftMM()*le}getMarginRight(){return this.getMarginRightMM()*le}getScale(){return this.options.resolution}getPageHeight(){return this.getPageHeightMM()*le}getPageHeightMM(){return this.pdf.internal.pageSize.height}getPageWidthMM(){return this.pdf.internal.pageSize.width}getPageWidth(){return this.getPageWidthMM()*le}getOriginalCanvasWidth(){return this.canvas.width/this.getScale()}getOriginalCanvasHeight(){return this.canvas.height/this.getScale()}getCanvasPageAvailableHeight(){return this.getPageAvailableHeight()*this.getScale()*this.getHorizontalFitFactor()}getPageAvailableWidth(){return this.getPageWidth()-(this.getMarginLeft()+this.getMarginRight())}getPageAvailableHeight(){return this.getPageHeight()-(this.getMarginTop()+this.getMarginBottom())}getPageAvailableWidthMM(){return this.getPageAvailableWidth()/le}getPageAvailableHeightMM(){return this.getPageAvailableHeight()/le}getNumberPages(){return Math.ceil(this.canvas.height/this.getCanvasPageAvailableHeight())}getHorizontalFitFactor(){return this.getPageAvailableWidth()<this.getOriginalCanvasWidth()?this.getOriginalCanvasWidth()/this.getPageAvailableWidth():1}getCanvasOffsetY(e){return this.getCanvasPageAvailableHeight()*(e-1)}getCanvasHeightLeft(e){return this.canvas.height-this.getCanvasOffsetY(e)}getCanvasPageHeight(e){if(this.canvas.height<this.getCanvasPageAvailableHeight())return this.canvas.height;const t=this.getCanvasHeightLeft(e);return t<this.getCanvasPageAvailableHeight()?t:this.getCanvasPageAvailableHeight()}getCanvasPageWidth(){return this.canvas.width}createCanvasPage(e){const t=this.getCanvasPageWidth(),a=this.getCanvasPageHeight(e),i=document.createElement("canvas");return i.setAttribute("width",String(t)),i.setAttribute("height",String(a)),i.getContext("2d").drawImage(this.canvas,0,this.getCanvasOffsetY(e),this.canvas.width,a,0,0,this.canvas.width,a),i}convert(){let e=1;const t=this.getNumberPages();for(;e<=t;){e>1&&this.pdf.addPage(this.options.page.format,this.options.page.orientation);const t=this.createCanvasPage(e),a=t.toDataURL(this.options.canvas.mimeType,this.options.canvas.qual
1ityRatio);this.pdf.setPage(e),this.pdf.addImage({imageData:a,width:t.width/(this.getScale()*le*this.getHorizontalFitFactor()),height:t.height/(this.getScale()*le*this.getHorizontalFitFactor()),x:this.getMarginLeftMM(),y:this.getMarginTopMM()}),e+=1}return this.pdf}};const ue=({title:t,isLoading:o=!1,children:s,extraHeader:l,chartHeight:r=300,defaultChartType:d="area",disabled:c=!1,disabledIcon:u,disabledMessage:m,settingsRoute:p,settingsLabel:h,notAvailable:g=!1,unavailableIcon:f,unavailableTitle:b,unavailableMessage:x,contactRoute:E,contactLabel:_})=>{const[A,T]=e.useState(d),j=a(e=>e.appState.i18n.languages),R=g||c;return i.jsxs(y,{variant:"borderless",className:"advanced-security-chart"+(R?" is-disabled":""),children:[i.jsxs(k,{justify:"space-between",align:"center",className:"chart-header"+(R?" is-disabled":""),children:[i.jsx("h3",{className:"chart-title",children:t}),!R&&i.jsxs(k,{align:"center",gap:8,children:[l,i.jsxs("div",{className:"pa-toggle",children:[i.jsx("span",{className:"pa-toggle-opt "+("area"===A?"on":""),role:"button",tabIndex:0,onClick:()=>T("area"),onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),T("area"))},"aria-label":"Line chart",children:i.jsx(M,{})}),i.jsx("span",{className:"pa-toggle-opt "+("bar"===A?"on":""),role:"button",tabIndex:0,onClick:()=>T("bar"),onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),T("bar"))},"aria-label":"Bar chart",children:i.jsx(P,{})})]})]})]}),g?i.jsxs(k,{vertical:!0,align:"center",justify:"center",gap:16,className:"chart-disabled-content",children:[f&&i.jsx("div",{className:"chart-unavailable-icon",children:f}),b&&i.jsx(v.Title,{level:5,className:"chart-disabled-title",children:b}),i.jsx(v.Text,{type:"secondary",className:"chart-disabled-message",children:x}),E&&i.jsx(S,{type:"primary",onClick:()=>window.open(E,"_blank"),children:_||j.CONTACT_LOGINRADIUS})]}):c?i.jsxs(k,{vertical:!0,align:"center",justify:"center",gap:12,className:"chart-disabled-content",children:[u&&i.jsx("div",{className:"chart-unavailable-icon",children:u}),i.jsx(v.Text,{type:"secondary",className:"chart-disabled-message",children:m||j.SECURITY_ANALYTICS_FEATURE_DISABLED}),p&&i.jsx(S,{type:"primary",onClick:()=>window.open(p,"_blank"),children:h||j.SECURITY_ANALYTICS_GO_TO_SETTINGS})]}):o?i.jsx("div",{style:{height:r,display:"flex",alignItems:"center",justifyContent:"center"},children:i.jsx(n,{tip:"Loading chart data..."})}):s(A)]})};o.extend(s),o.extend(E);const me=(e,t,a)=>{if(!e)return"";if("raw"===a)return e;const i=t?o.utc(e).tz(t):o.utc(e);return i.isValid()?i.format(a??"MMM D, YYYY HH:mm"):e},pe=({active:e,payload:t,label:a,timezone:n,dateKey:o,labelFormat:s})=>{if(!e||!t?.length)return null;const l=o?t[0]?.payload?.[o]??a:a;return i.jsxs("div",{style:{background:"#fff",border:"1px solid #f0f0f0",borderRadius:4,padding:"6px 10px",fontSize:12,pointerEvents:"none"},children:[i.jsx("p",{style:{fontSize:12,fontWeight:600,marginBottom:4,marginTop:0},children:me(l,n,s)}),t.map((e,t)=>i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,marginBottom:2},children:[i.jsx("div",{style:{width:8,height:8,borderRadius:"50%",background:e.color,flexShrink:0}}),i.jsxs("span",{style:{color:"rgba(0,0,0,0.85)",fontSize:12},children:[e.name,": ",i.jsx("strong",{children:"number"==typeof e.value?e.value.toLocaleString():e.value})]})]},t))]})},he={404:"Resource not found",901:"Api key not valid",902:"Api secret not valid",903:"Request token not valid",904:"Request token expired",905:"Access token not valid",906:"Access token expired",908:"Parameter not formatted",909:"App doesnt have permission to access this endpoint",910:"Endpoint not supported by current provider",912:"Provider name not valid",920:"Api key not well formatted",921:"Api secret not well formatted",922:"Api key required",923:"Api secret required",929:"Provider token required",936:"Emailid already registered",937:"User id not valid",938:"User not exists",942:"App not exists",950:"Operation failed",965:"Post body invalid",966:"Username or password wrong",967:"Invalid password",968:"Birth date invalid",970:"Email not verified",973:"Verification link invali
1d",974:"Link already verified",975:"Link expired",978:"Email already exists with diff type",979:"Link invalid",982:"Captcha not valid",983:"Same account cant be linked",984:"Account id is invalid",986:"Account is already linked",987:"Account is not linked with any account",989:"Provider id not linked with this account",990:"Emailid is not valid",991:"User id blocked",993:"Custom field not valid",995:"Custom object record id not valid",999:"Custom object not configured",1e3:"Provider side error",1005:"One emailid is required",1015:"Password in history",1017:"Username already registered",1022:"Username not exists",1023:"Email id not exists",1025:"Email allready verified",1026:"Unverified existing account with same email id",1030:"Emailid already registered with social account",1032:"Emailid requird",1033:"Unverified existing account with same email id in email verifcation disabled",1034:"Emailid verification disable",1035:"Custom object json not valid",1037:"Account id required",1038:"Emailid id format not valid",1039:"Raas profile not exists",1043:"Phone number not exists",1044:"Account id is already registered",1046:"Email already used",1047:"Role does not exists",1049:"Secured one time token is invalid",1051:"Social registration not allowed",1054:"Account linking disabled",1055:"Active token not exists",1056:"This email id is not allowed to register",1057:"Custom object record not exist",1058:"Phone no already registered",1059:"One click sigin not enabled",1060:"Access token required",1061:"Profile id missing",1062:"Link already used",1063:"Verification vtoken not valid",1064:"Custom object name not valid",1065:"Provider not valid",1066:"Phone not verified",1067:"Otp not exists",1068:"Otp already used",1069:"Otp expired",1070:"Otp invali
1d",1071:"Sms configuration not exists",1072:"Otp send failed",1073:"Phone number already verified",1074:"Phone no login not enabled",1075:"Username required",1076:"Phone numbers required",1077:"Phone number login enabled",1078:"Endpoint not supported by provider",1079:"Json put body required",1083:"Content type invalid",1084:"Delete body invalid",1085:"Web hook not allowed more than max limit",1086:"Web hook invalid event",1087:"Web hook target url is not valid",1090:"Invalid request body",1091:"Security question not valid",1092:"Security question not saved in profile",1093:"Security answer invalid",1094:"Security question or answer invalid",1095:"Security question or answer not enabled",1096:"Invalid phone number",1097:"Two factor authentication not enabled",1098:"Two factor authentication not configured",1099:"Two factor authentication authenticator not configured",1100:"Two factor authentication otp authentication not enabled",1101:"Two factor authentication not configured on profile",1102:"Two factor authentication authenticator code incorrect",1103:"Two factor authentication token not valid",1104:"Two factor authentication token expired",1105:"Two factor authentication otp or googleauthencation code",1106:"Two factor authentication phone already used",1107:"Address type can not be same",1110:"Web hook target url is already subscribe",1112:"Web hook target url is not subscribed",1113:"Can not enforce email invalidation",1114:"There are no archive record",1115:"Email already unverified",1117:"Two factor authentication phone not verified",1118:"Email or uid or phone required",1119:"Delete token is invalid",1120:"Access token invalid or phone number already verified",1121:"Two factor authentication not valid for delete",1122:"Email send limit reached",1123:"Sms send limit reached",1124:"Phone type can not be same",1125:"Address type required",1126:"Email allready verified token",1127:"Two factor authentication backup code already configured",1128:"Two factor authentication backup code not configured",1129:"Two factor authentication backup code not valid",1130:"Login disabled",1132:"Login is locked for recaptcha",1133:"Role context not valid",1134:"Server side validation error",1135:"Autologin not enabled",1136:"Client guid must be unique",1137:"Autologin link already used",1138:"Autologin link already verified",1139:"Autologin link not verified",1140:"Client guid not valid",1141:"Emailid or username requird",1142:"Additionalpermissions not exits",1143:"Secret doesnt have access",1145:"No registration login link already used",1146:"No registration not enabled",1147:"Can not enforce phone invalidation",1148:"Login is locked for security question",1149:"Sms send rate limit exceed",1160:"No callback login not enabled",1161:"Phone number already unverified",1162:"Email or phone not verified",1163:"Age underage",1164:"Rba account is blocked",1165:"Rba answer security question",1166:"Rba email verification",1167:"Rba sms verification",1168:"Rba browser risk identified",1169:"Rba city risk identified",1170:"Rba country risk identified",1171:"Rba ip risk identified",1172:"Invalid date roles",1173:"Email cannot be empty",1174:"Email id not allowed to update",1175:"Role not valid",1177:"Cannot add email address",1178:"Token limit reached",1179:"Otp limit reached",1180:"Jwt config not found",1181:"Invalid token type",1182:"Invalid sms otp type",1183:"User name authentication enabled",1184:"User name authentication enabled security question",1185:"Verification otp not valid",1186:"Email otp already used",1187:"Email otp expired",1188:"Email otp not exists",1189:"Jwt config not valid",1190:"Traditional registration disabled",1191:"Event based two factor authentication not enabled",1192:"Event based validation otp or googleauthencation code",1193:"Second factor verification token not valid",1194:"Privacy policy mismatched",1195:"Privacy policy not available",1196:"Privacy policy not accepted",1197:"Privacy policy not valid",1198:"User id locked",1200:"Uid is not valid",1201:"Email type required",1202:"Email id can not be same",1203:"Primary email can be only one",1205:"Password is wrong",1206:"Ip access denied",1207:"Api signature required",1208:"Api signature invalid",1209:"Api secret or signature required",1210:"Request expiry time required",1211:"Request expiry time invalid format",1212:"Request expiry time is invali
1d",1213:"Phone type required",1214:"Dangerous request",1216:"Weak password",1217:"Refresh token invalid",1218:"Captcha is not valid",1219:"Same account cant be unlinked",1220:"Account not allowed to login",1221:"Account already unlocked",1222:"Privacy policy already accepted",1223:"Provider not configured",1224:"Consent form not available",1225:"Consent form validation failed",1226:"Consent form not submitted",1227:"Consent form not enabled",1228:"Consent logs not available",1229:"Consent token not valid",1230:"Consent token expired",1231:"Provider configuration invalid",1232:"Provider not supported",1233:"Pin auth not enabled",1234:"Pin required",1235:"Pin not configured",1236:"Pin auth wrong",1238:"User name authentication not enabled",1239:"Pin auth token not valid",1240:"Pin auth token expired",1241:"Old pin wrong",1242:"Pin link already verified",1243:"Pin is required",1244:"Pin login not enabled",1245:"Pin auth session token not valid",1246:"Pin auth session token expired",1247:"Email domain not allowed to register",1248:"Reset pin url invalid",1249:"Verification url is not valid",1250:"Two factor authentication invalid phone update",1251:"Same provider cant be linked",1252:"Reset password url invalid",1253:"Account is already exist with same email",1254:"Email not verified can not li nk",1255:"Account linking token expired",1256:"Two factor authentication email otp authentication not enabled",1257:"Two factor security question authentication not enabled",1258:"Two factor authentication method enabled",1259:"Two factor security question authentication not verified",1260:"Answer minimum required questions",1261:"Security question or answer not provided",1262:"Security question authenticator enabled",1263:"Login is locked for mfa",1265:"Global idp not enabled for organization",1266:"User can not login by global idp",1267:"B2 b not enabled",1269:"Invalid provider in organization",1270:"Existing account can not link with b2 b",1271:"Signup not allowed in org",1272:"Already member of another organization",1273:"Organization not found",1274:"Auto linking not allowed with b2 b",1275:"Not member of organization",1276:"Organization missing",1277:"Multiple query parameters",1279:"Two factor authentication authenticator not enabled in app config",1280:"Two factor authentication otp authentication not enabled in app config",1281:"Voice sms configuration not enabled",1282:"Sp jwt config not found",1283:"Jwt sp token invalid",1284:"Jwt sp data mapping invalid",1285:"Unverified existing account with same phone id",1286:"Login with password not enabled",1287:"Ema il or phone number required verified",1288:"Autolookup domain not match",1289:"Add email not allowed",1290:"Qr code generation failed",1291:"Invalid uuid",1292:"Phone does not exist",1293:"Password expired",1294:"Redirection url invalid",1295:"Mfa push verification pending",1296:"Push token is not valid",1297:"Mfa push verification signature invalid",1298:"Two factor authentication push config invalid",1299:"Two factor authentication push authentication not enabled",1300:"Email is updated",1301:"Rba device risk identified",1302:"Provider id missing",1303:"Account already blocked",1304:"Account already unblocked",1305:"Delete url invalid",1306:"Vtype invalid",1307:"Expire in invalid format",1308:"Callback not whitelisted error",1309:"Invalid host",1310:"Host not whitelisted",1311:"Mfa push verification complete",1312:"Mfa push verification denied",1313:"Two factor push authentication not configured on profile",1314:"Action status retrieval error",1315:"Breached password",1316:"Breached password login",1317:"Change breached password",1320:"Passkey not enabled in app",1321:"Passkey verification failed",1322:"Passkey config invalid",1323:"Passkey not configured in profile",1324:"Passkey only support email",1325:"Invalid passkey id",1326:"Passkey autofill not enabled in app",1327:"Two factor authentication passkey authentication not enabled",1328:"Two factor passkey not configured on profile",1329:"Reset passkey url invalid",1330:"Duo auth not enabled",1331:"Two factor authentication duo auth config invalid",1332:"Duo authenticator verification failed",1333:"Duo state not valid",1334:"Two factor duo authenticator not configured on profile",1335:"Duo authenticator redirect uri not whitelisted",1336:"Duo authenticator redirect uri invalid",1337:"Refresh token required",1338:"Active sessions exceeded",1339:"Active login sessions not enabled",1340:"Email id not exist in profile",1341:"Query key index
1not found",1398:"Workflow feature not enable",1399:"Workflow not found",1400:"Invalid workflow view",1401:"Call back required error",1402:"Provider required error",1403:"Content type not supported error",1404:"Workflow failed",1405:"User denied o auth request error",1406:"Call back invalid error",1407:"Invalid client id",1408:"Workflow stage not found",1409:"Generic auth error",2e3:"Jsonp request not allowed",2007:"Invalid post body",2008:"Oauth invalid request",2009:"Oauth invalid client",2010:"Oauth invalid grant",2011:"Oauth unauthorized client",2012:"Oauth unsupported grant type",2014:"Oauth redirect uri mismatch",2015:"Saml singing certificate mismatch",2016:"Saml auth request not found",2017:"Oauth token config not found",2020:"Oauth login required",2021:"Oauth unsupported response type",2022:"Oauth request not support",2023:"Oauth redirect uri not whitelisted",2024:"Access token invalid or expired",2025:"Saml request binding invalid",2026:"Saml request not valid",2027:"Saml request expired",2030:"Something going wrong",2050:"Sp saml idp cert not valid",2051:"Sp saml sp key not valid",2052:"Saml endpoint not match as config",2053:"Sp saml sp cert not valid",2054:"Splogout url not found",2055:"Saml idp key cert not valid",2056:"Saml sp cert not valid",2057:"Valid plan not available",2058:"Device access token expired",2059:"Device authorization pending",2060:"Device slow down",2061:"Sp saml sp cert not matched",2062:"Sp saml user identity not found",2063:"Sp saml login session not active",2064:"Invalid organization",2065:"Email domain not allowed in organization",2066:"Delete url is not whitelisted",2067:"Redirect url is not whitelisted",2068:"Request uri not supported",2069:"Oauth unsupported token type",2070:"Request RAR type is not allowlisted",3001:"Sp saml config not found",3002:"Sp saml config not valid",3003:"Sp saml provider not found",3004:"Sp saml provider not match",3005:"Sp saml response id not valid",3006:"Sp saml name id not found",3007:"Oauth logout uri not whitelisted",3008:"Oauth invalid client metadata",3009:"Oauth invalid redirect uri",3010:"Oauth access denied",3011:"Oauth invalid target",4e3:"Successfully executed operation",4001:"Failed to get custom object input",4002:"Failed to store custom object",4003:"Failed to get mfa state",4004:"Failed to generate sec ques",4005:"Sec ques generated",4006:"Failed to get session data",4007:"User not exists",4008:"User id blocked",4009:"User id locked",4010:"Email not verified",4011:"Phone not verified",4012:"Login operation failed",4013:"Password expired",4014:"Workflow failed",4015:"Failed to get social provider config",4016:"Social login operation failed",4017:"Do saml login operation failed",4018:"Error getting jwt social provider config",4019:"Error doing social login operation",4020:"Privacy policy mismatched",4021:"This email id is not allowed to register",4022:"Invalid pin",4023:"Failed to create user",4024:"User exist operation failed",4025:"Update password failed",4026:"Failed to marshal profile model",4027:"Profile validation failed",4028:"Update identity operation failed",4029:"Delete user operation failed",4030:"Invalid session token",4031:"Unable to get access token from session",4032:"Failed to set session data",4033:"Send sms failed",4034:"Io invalid template",4035:"Send mfa email failed",4036:"Email required",4037:"Emailid already registered",4038:"Raas profile not exists",4039:"Token limit reached",4040:"Otp verification failed",4041:"Failed to get privacy policy status",4042:"Failed to get consent status",4043:"Account locked",4044:"Account active",4045:"Account inactive",4046:"Account not found",4047:"Account unlocked",4048:"Account suspended",4049:"Failed to update phone",4050:"Failed to verify google auth code",4051:"Failed to verify security question",4052:"Failed to reset authenticator",4053:"Failed to reset backup code",4054:"Failed to download backup code",4055:"Failed to update security answer",4056:"Error verifying backup code",4057:"Password is not breached",4058:"Error login after backup code verification",4059:"Failed to calculate risk score",4060:"Failed to execute child workflow",4061:"Pin not configured",4062:"Failed to verify pin",4063:"Failed to validate token",4064:"Pin verified",4065:"Pin auth wrong",4066:"Failed to validate pin",4067:"Failed to update pin",4068:"Pin updated",4069:"Failed to reset pin",4070:"Pin reset",4071:"Failed to get session token",4072:"Failed to display backup code",4073:"Failed to assign role",4074:"Failed to logout",4075:"Failed to execute auto lookup",4076:"Username or password wrong",4077:"Redirecting to custom script",4078:"Failed to execute custom script",4079:"Password breached",4080:"Failed to set custom cookie",4081:"Failed to get custom cookie",4082:"Failed to validate session",4083:"Failed to parse external identity url",4084:"Failed to create request",4085:"Failed to execute external identity lookup",4086:"Failed to configure mfa",4087:"Failed to generate google authenticator",4088:"Failed to decode token data",4089:"Failed to get oidc app config",4090:"Mfa not configured for user",4091:"No authenticator configured",4093:"Custom object data not found in session",4094:"Custom object node not found",4095:"Custom object not found in node properties",4096:"Failed to transform custom object",4097:"Failed to generate json schema",4098:"Failed to create custom object",4099:"Error login after google authenticator code verification",4100:"Two factor authentication authenticator code incorrect",4101:"Security question or answer invalid",4102:"Sms configuration not exists",4103:"Failed to get active not accepted forms",4104:"Failed to execute data query",4105:"Failed to decode profile payload",4106:"Identity not found",4107:"Failed to execute script",4108:"Pin configration not found",4109:"Backup code not found",4110:"Privacy policy is not accepted",4111:"Social configuration not found",4112:"Saml configuration not found",4113:"Oauth configuration not found",4114:"Jwt configuration not found",4115:"Two factor security question not configured",4116:"Webpage data not found",4117:"Workflow callback url not whitelisted",4118:"State invalid",4119:"Invalid passkey credentials",4120:"Duo verification failed",4121:"Push verification failed",4122:"Push verification pending",4123:"Failed to generate push authenticator",4124:"Push verification declined",4125:"Two factor authentication config not set",4126:"Script not completed or no output",4127:"Script execution initiated",4128:"Script execution finished",4129:"Webpage rendered successfully",4130:"Phone number already registered",4131:"Username already registered",4132:"Invalid password",4133:"Weak password",4134:"Password in history",4135:"Breached password",4136:"Two factor authentication backup code not valid",4137:"Trulioo error",4138:"Identity verification error",4139:"Two factor authentication passkey authentication not enabled",4140:"Two factor passkey not configured on profile",5e3:"Something going wrong",6e3:"Io invalid template",6001:"Authorization header not valid",6002:"Unauthorized access",6003:"Trial plan expired",6004:"Trial plan user limit reached",6005:"Workflow session expired",6006:"Two factor security question not configured",6007:"Custom field length exceeded",6008:"Return url is not whitelisted",6009:"Rate limit exceeded",6010:"Tenant rate limit exceeded",7900:"Parameter not well formatted",7901:"Record not exists",7902:"Emaili
1d already registered",7903:"Customer id not found",7904:"User not exists",7905:"App not exists",7906:"App name not available",7907:"Invalid idp certificate",7908:"Permission not exists",7909:"Operation failed",7910:"Provider is not support configuration settings",7911:"Provider is not valid",7912:"Invalid saml integration type",7913:"Missing fields in prebuilt",7914:"Json post body required",7915:"Not customer registration configration",7916:"User id blocked",7917:"Custom object id not valid",7918:"Customer or app id not exists",7919:"Custom field allready exists",7921:"Email sending fail",7922:"Email template not created",7923:"Email template not exists",7924:"Password settings not found",7925:"Custom object already exists",7926:"Shared app not found",7927:"Feature not valid",7928:"Customer registration custom data not exists",7929:"Custom field not found",7930:"Email template exists",7931:"Invalid user registration config",7932:"Users of app not found",7933:"Customer registration config not found",7934:"Json put body required",7935:"Json delete body required",7936:"Custom oauth config not found",7937:"Custom oauth provider already added",7938:"Saml config not found",7939:"Saml config already added",7940:"Custom db name not exists",7941:"Risk based authentication actions required",7942:"Data dump requests limit exceeded",7943:"Invalid data dump request id",7944:"Secondary secret limit exceeded",7945:"Secondary secret not available",7946:"Invalid secondary secret",7947:"Security question config not found",7948:"Security question already added",7949:"Invalid question id",7950:"Security question algo not found",7951:"Security question not enabled",7952:"Google authenticator config not found",7953:"Second factor auth not enabled",7954:"Sms template not found",7955:"Sms template already exists",7956:"Sms template not exists",7957:"Sms config not found",7958:"Jwt config not found",7959:"Invalid sms type",7960:"Jwt config already exist",7961:"Custom domain binding already exist",7963:"Store config already exist",7964:"Sms config invalid",7965:"Invalid secondary secret config",7967:"Invalid date range",7968:"Risk based auth is not enabled",7969:"Risk based auth is not configured",7970:"Invalid data center",7971:"Cannot delete current version of workflow",7972:"Workflow version not found",7973:"Ip authorization disabled",7974:"Invalid optional captcha config",797
15:"Access denied",7976:"Invalid hosted plugin",7977:"Global email settings not found",7978:"Sms voice settings not found",7979:"Pin config not exist",7980:"Data dump custom object name required",7981:"Oauth config not found",7982:"Oauth config already exist",7983:"Invalid password policy config",7984:"Webhook feature not enabled",7985:"Invalid webhook event type",7986:"Webhook config not found",7987:"Web hook target url is not valid",7988:"Web hook not allowed more than max limit",7989:"Web hook target url is already subscribe",7990:"App name invalid",7991:"Invalid passkey config",7992:"Invalid password hash config",7993:"Invalid pinauth config",7994:"Impersonation action taken",7995:"Impersonation authorization failed",7996:"Impersonation revoke failed",7997:"Invalid privacy policy config",7998:"Impersonation revoke time exceeded",7999:"Invalid request signing config",8e3:"Request update failed",8001:"Custom domain binding requests limit exceeded",8002:"Custom domain binding requests not found",8003:"Social app already exist",8004:"Multiple social app config not found",8005:"Social app config not found",8006:"Multiple app for same social not enabled",8007:"Invalid custom provider config",8010:"Security question render count error",8011:"Authserverapi config not found",8012:"Authserverapi config exists with same name",8013:"Authserverapi config exists with same identifier",8014:"Oauth config credentials reset failed",8015:"Invalid customobject name",8016:"Cannot update webhook",8017:"Same start and end",8018:"Invalid ip config",8019:"Special characters not allowed",802
10:"Atleast one mfa",8021:"Captcha config value not valid",8022:"Secondary secret name already exists",8023:"Failed to restore workflow version",8024:"Invalid secondary secret role",8025:"Auditlog write failure",8026:"Invalid otp delivery method",8027:"Invalid voice type",8028:"Invalid voice sms config",8029:"Missing jwt key",8030:"Missing jwksurl",8031:"Invalid workflow config",8032:"Workflow config exists with same name",8033:"Workflow config not found",8034:"Saltkeylength range",8035:"Subkeylength range",8036:"Workflow config update exists with same name",8037:"Invalid impersonation request config",8038:"Cant disable the security question",8039:"Cant disable the passkey",8040:"Invalid custom sms config",8041:"Provider not active",8042:"Custom field limit exceeded",8043:"Role name does not exists",8044:"Invalid body json",8045:"B2 b email not available",8046:"Invalid app config",8047:"Invalid push authenticator config",8048:"Tenant type conversion not allowed",8049:"Form id invalid",8050:"Push notification settings not found",8051:"Rememember me token expiry cant be greater than token expiry",8052:"Push notifications not enabled",8053:"Invalid risk security config",8054:"Passkey not found",8056:"Breached password config not found",8057:"Admin notification event not valid",8058:"Admin notification email id not valid",8059:"Customer id required",8061:"App id required",8062:"App id not found",8063:"Username login cant be disabled",8064:"Invalid restriction type",8067:"Custom object not configure",8068:"Sott not found",8069:"Passkey feature not enabled",8070:"Identity orchestration not enabled",8071:"Enable google authenticator first",8072:"Duo auth not enabled",8073:"Duo auth settings not found",8074:"Invalid duo config",8076:"Breached password not enabled",8078:"Invalid email settings",8079:"Data dump requests not found",8080:"Invalid object id",8081:"Error unmarshalling data",8082:"Not a superadmin user",8083:"Error raas config empty",8084:"Script data not found",8085:"Invalid workflow script id",8086:"Customer not found",8087:"Jwt config not valid",8088:"Oauth config not valid",8089:"Saml sp config invalid",8090:"Token expiry must be greater than pin session token expiry",8091:"Webhook logs not found",8092:"Web hook auth cred mandatory",8093:"Invalid start date time",8094:"Invalid end date time",8095:"Invalid date time range",8096:"Webhook auth type invalid",8097:"Saml idp config invalid",8098:"Invalid sq encryption config",8099:"Invalid email templates",8101:"Sott config invalid",8102:"Pin hash config not exist",8105:"Event or emailid required",8106:"Web hook target url is not reachable",8107:"Duplicate email config name",8108:"Invalid name",8109:"Workflow script exists with same name",8110:"Domain white listing not enabled",8111:"Domain restriction config not found",8112:"Multiple smtp feature not enabled",8113:"Email config does not exist",8114:"Trial plan single tenant",8115:"Trial plan app limit reached",8116:"Organization already exist",8117:"Organization id invalid",8118:"Organization not found",8119:"Permission id invalid",8120:"Duplicate permission name",8121:"Permission does not exists",8122:"Permission id required",8123:"Duplicate role name",8124:"Invalid role id",8125:"Role does not exists",8126:"Role id required",8127:"Role name required",8128:"Default role cannot be deleted",8129:"Organization id required",8130:"User role already exists",8131:"User id required",8132:"User does not exists",8133:"Role level required",8134:"Role level invalid",8135:"User not found in org",8136:"User not active",8137:"Error invalid email",8139:"Data export not enabled",8140:"M2 m authentication not enabled",8141:"Custom object name not found",8142:"Role does not belongs to org",8143:"Role does not belongs to tenant",8144:"Privacy policy not found",8145:"Pin authentication not enabled",8146:"Invalid node version",8147:"Provider not configured",8148:"Connection already exist",8149:"Connection domain already exist",8150:"Organization domain not exist",8151:"Connection id invalid",8152:"Connection config invalid",8154:"Organization domain i
1d invalid",8155:"Organization domain name invlaid",8156:"Organization domain already verify",8157:"Organization domain already exist",8159:"Organization member role not valid",8160:"Organization mfa enforcement not allowed",8161:"Group role name already exist",8162:"Group role group id already exist",8163:"Group role not exist",8164:"Group role id invalid",8166:"Status updated already",8167:"Status update invalid",8168:"Domain txt record failed",8169:"Invitation not found",8170:"User exists in org",8171:"Invitation active",8172:"Invitation accepted already",8173:"Invitation token invalid",8174:"Inviter not exist",8175:"Invalid invitation id",8176:"Invitation url is not valid",8177:"Organization domain not verified",8178:"Organization domain can not deleted",8179:"B2 b feature enabled",8180:"Organization not active",8181:"Organization jit policy not allowed",8182:"Cannot change owner",8183:"Token config not found",8184:"Risk based authentication not configured",8185:"Render count not greater than available",8187:"Custom oauth not enabled",8188:"Trial plan org limit reached",8189:"Trial plan connection limit reached",8190:"Same domain or email cannot exist in both list",8191:"Invalid workflow id",8192:"Form not found",8193:"Form name already exists",8194:"Form type already exists login registration",8195:"Invalid form",8196:"Cannot delete default email config",8197:"Migration failed",8198:"Batch parameters not well formatted",8199:"Batch migration too many records",8200:"Consent management not enabled",8201:"Consent option id already exists",8202:"Consent forms not found",8203:"Consent option not found",8204:"Limit exceeded",8205:"Consent option in use",8206:"Consent option invalid",8207:"Consent form already exists for event start date",8208:"Consent form not found",8209:"Consent form already deleted",8210:"Identity query fields not valid",8211:"Invalid trial plan expiry date",8212:"Not a trial plan",8213:"Limits not set",8214:"Custom domain feature not enabled",8215:"Authserverapi config invalid",8216:"Integration authorize not found",8217:"Integration authorize does not exist",8218:"Audit log integration config not found",8219:"Invalid audit log provider",8220:"Invalid audit log config",8221:"Hosted plugins not enabled",8222:"Progressive step not found",8223:"Duplicate additional permission",8224:"Progressive profiling not enabled",8225:"Org directory token limit reached",8226:"Org directory token min limit",8227:"Org directory already exists",8228:"Org directory not exists",8229:"Org directory token id required",8230:"Scim feature not enabled",8231:"Name not allowed to update",8232:"Org directory token not found",8233:"Delete role name reserved prefix",8234:"Delete permission name reserved prefix",8235:"Update role name reserved prefix",8236:"Update permission name reserved prefix",8237:"Resource rbac disabled"},ge=e=>{const t="string"==typeof e?parseInt(e,10):e;return he[t]||String(e)},fe=({title:e,description:t})=>i.jsxs("div",{style:{minHeight:200,padding:"32px 16px",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:8,border:`1px dashed ${l.BORDER}`,borderRadius:8,background:l.BG_PANEL,textAlign:"center"},children:[i.jsx("div",{style:{width:40,height:40,borderRadius:10,display:"inline-flex",alignItems:"center",justifyContent:"center",background:l.CARD_BORDER,color:l.TEXT_MUTED},children:i.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.5,width:20,height:20,children:[i.jsx("rect",{x:"2",y:"3",width:"12",height:"10",rx:"1.5"}),i.jsx("path",{d:"M5 7h6M5 10h4"})]})}),i.jsx("h4",{style:{margin:"8px 0 0",fontSize:15,fontWeight:600,color:l.TEXT_DARK},children:e}),t&&i.jsx("p",{style:{margin:0,color:l.TEXT_MUTED,fontSize:13,maxWidth:380},children:t})]});o.extend(s),o.extend(E);const be={total:l.TOTAL,success:l.SUCCESS,failed:l.FAILED},xe=l.FACTOR_PALETTE,ye=l.REASON_PALETTE,ke=[{key:"email",label:"Email",group:"primary",match:(e,t)=>"email"===t&&"account"===e},{key:"phone",label:"Phone",group:"primary",match:(e,t)=>"phone"===t&&"account"===e},{key:"username",label:"Username",group:"primary",match:(e,t)=>"username"===t&&"account"===e},{key:"passwordless_email",label:"Passwordless - Email",group:"primary",match:(e,t)=>"passwordless"===e&&"email"===t},{key:"passwordless_phone",label:"Passwordless - Phone",group:"primary",match:(e,t)=>
1"passwordless"===e&&"phone"===t},{key:"passkey",label:"Passkey",group:"primary",match:e=>"passkey"===e},{key:"smart_login",label:"Smart Login",group:"primary",match:e=>"smart_login"===e},{key:"one_touch",label:"One Touch Login",group:"primary",match:e=>e.startsWith("one_touch")},{key:"social",label:"Social Login",group:"federated",match:e=>"social_auth"===e||"social_provider"===e},{key:"sso",label:"SSO",group:"federated",match:e=>"sso"===e},{key:"oauth_oidc",label:"OAuth / OIDC",group:"federated",match:e=>["oauth","oauth_token.v1","oidc_token.v2","oauth_sp.callback"].includes(e)},{key:"jwt",label:"JWT",group:"federated",match:e=>"jwt"===e||"jwt_sp"===e}],ve={},Se={};for(const St of ke)ve[St.key]=St.label,Se[St.key]=St;const Ee=(e,t,a)=>{if(!e)return"";const i=a?o.utc(e).tz(a):o.utc(e);if(!i.isValid())return e;switch(t){case"MINUTE":return i.format("HH:mm");case"HOUR":return i.format("ddd HH:00");default:return i.format("MMM D")}},_e={fontSize:11,fill:l.TEXT_MUTED},Ae={primary:l.TAG_PRIMARY,federated:l.TAG_FEDERATED},Te=({label:e,value:t,closable:a,onClose:n})=>{const o=Se[t],s=o?Ae[o.group]:Ae.primary;return i.jsx(A,{variant:"outlined",closable:a,onClose:n,style:{background:s.bg,border:`1px solid ${s.border}`,color:s.text,borderRadius:6,fontSize:12,fontWeight:500,padding:"1px 8px",margin:"2px 4px 2px 0",lineHeight:"22px"},children:e})},je=({label:e,closable:t,onClose:a})=>i.jsx(A,{variant:"outlined",closable:t,onClose:a,style:{background:l.FAILED_BG,border:`1px solid ${l.FAILED_BORDER}`,color:l.FAILED_DARK,borderRadius:6,fontSize:12,fontWeight:500,padding:"1px 8px",margin:"2px 4px 2px 0",lineHeight:"22px",maxWidth:180,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",display:"inline-block",verticalAlign:"middle"},children:e}),Re=({startDate:t,endDate:n,step:o,timeFrame:s,timezone:c})=>{const[u,m]=e.useState([]),[p,h]=e.useState([]),[g,f]=e.useState({total:0,success:0,failed:0}),[b,x]=e.useState([]),[y,k]=e.useState([]),[v,S]=e.useState([]),[E,I]=e.useState([]),[O,C]=e.useState(!1),[L,w]=e.useState([]),[D,P]=e.useState([]),F=a(e=>e.appState.i18n.languages),M=e.useMemo(()=>(e=>{const t=new Set;for(const a of e)for(const e of ke)if(e.match(a.target,a.method)){t.add(e.key);break}return t})(E),[E]),G=L.length>0,V=e.useMemo(()=>ke.filter(e=>M.has(e.key)).map(e=>({label:e.label,value:e.key})),[M]),Y=e.useCallback((e,t)=>{f(e?.summary||{total:0,success:0,failed:0});const a=e?.failedReasons||[];if(x(a),k(e?.failedTrend||[]),S(a.slice(0,5).map(e=>e.code)),t&&t.length>0){const a=(e?.trend||[]).map(e=>{const a={date:e.time};for(const i of t)a[`${i}||success`]=e[i]?.success??0,a[`${i}||failed`]=e[i]?.failed??0;return a});h(a),P(t)}else{const t=(e?.trend||[]).map(e=>({date:e.time,total:e.total,success:e.success,failed:e.failed}));m(t),h([]),P([])}},[]);e.useEffect(()=>{if(!t||!n)return;C(!0);const e=G?L.map(e=>ve[e]).filter(Boolean):void 0,a=e&&e.length>0?{startDate:t,endDate:n,step:o,timeFrame:s,factors:e}:{startDate:t,endDate:n,step:o,timeFrame:s};r("/advanced-security/login-activity",{},a).then(t=>{t?.ErrorCode?d("error",t.Message||F.SA_LOGIN_ACTIVITY_ERROR):(Y(t,e),I(t?.factors||[]))}).catch(()=>d("error",F.SA_LOGIN_ACTIVITY_ERROR)).finally(()=>C(!1))},[t,n,o,s,L]);const X=i.jsx(_,{suffixIcon:i.jsx(T,{size:16,style:{display:"block"}}),mode:"multiple",value:L,onChange:e=>w(e),options:V,tagRender:e=>i.jsx(Te,{label:ve[e.value]||e.label,value:e.value,closable:e.closable,onClose:e.onClose}),style:{minWidth:260,maxWidth:480},maxTagCount:"responsive",maxTagPlaceholder:e=>i.jsxs(A,{variant:"outlined",style:{background:l.TAG_OVERFLOW.bg,border:`1px solid ${l.TAG_OVERFLOW.border}`,borderRadius:6,fontSize:12,color:l.TAG_OVERFLOW.text,padding:"1px 8px",margin:"2px 0"},children:["+",e.length," more"]}),placeholder:i.jsxs("span",{style:{display:"flex",alignItems:"center",gap:6,color:l.TEXT_MUTED},children:[i.jsx(Q,{style:{fontSize:12}}),F.SA_LOGIN_ACTIVITY_FILTER_PLACEHOLDER]}),allowClear:!0,popupMatchSelectWidth:320,listHeight:320,size:"middle"}),J=[{key:"total",name:F.SA_TOTAL,color:be.total,gradient:"url(#adv-total)"},{key:"success",name:F.SA_SUCCESSFUL,color:be.success,gradient:"url(#adv-success)"},{key:"failed",name:F.SA_FAILED,color:be.failed,gradient:"url(#adv-failed)"}],Z=e.useMemo(()=>J.filter(e=>u.some(t=>(t[e.key]??0)>0)),[u]),ee=e.useMemo(()=>D.filter(e=>p.some(t=>(t[`${e}||success`]??0)>0||(t[`${e}||failed`]??0)>0)),[D,p]),te=e.useMemo(()=>Z.map(e=>e.key),[Z]),ae=W(te),ie=e.useMemo(()=>Z.filter(e=>!ae.isHidden(e.key)),[Z,ae]),ne=e.useMemo(()=>ee.flatMap(e=>[`${e}||success`,`${e}||failed`]),[ee]),oe=W(ne),se=e.useMemo(()=>v.slice(0,5),[v]),le=W(se),re=i.jsx(fe,{title:F.SA_LOGIN_ACTIVITY_NO_DATA_TITLE,description:F.SA_LOGIN_ACTIVITY_NO_DATA_DESCRIPTION}),de=e=>{if(G){if(0===ee.length)return re;const t=i.jsx("div",{className:"ua-legend",children:ee.flatMap(e=>{const t=D.indexOf(e),a=xe[2*t%xe.length],n=xe[(2*t+1)%xe.length],o=`${e}||success`,s=`${e}||failed`;return[i.jsxs("span",{className:"ua-legend-pill "+(oe.isHidden(o)?"off":""),role:"button",tabIndex:0,onClick:()=>oe.onPillClick(o),onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),oe.onPillClick(o))},children:[i.jsx("span",{className:"ua-legend-dot",style:{background:a}})," ",e," - ",F.SA_SUCCESSFUL]},`${e}-s`),i.jsxs("span",{className:"ua-legend-pill "+(oe.isHidden(s)?"off":""),role:"button",tabIndex:0,onClick:()=>oe.onPillClick(s),onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),oe.onPillClick(s))},children:[i.jsx("span",{className:"ua-legend-dot",style:{background:n}})," ",e," - ",F.SA_FAILED]},`${e}-f`)]})});return"bar"===e?i.jsxs(i.Fragment,{children:[i.jsx(z,{width:"100%",height:300,children:i.jsxs(N,{data:p,margin:{top:5,right:10,left:-10,bottom:0},"aria-label":`${F.SA_LOGIN_ACTIVITY_TITLE} chart`,children:[i.jsx(U,{dataKey:"date",tick:_e,tickLine:!1,tickFormatter:e=>Ee(e,s,c)}
1),i.jsx($,{width:40,tick:_e,tickLine:!1,axisLine:!1,allowDecimals:!1}),i.jsx(B,{content:i.jsx(pe,{timezone:c})}),ee.flatMap(e=>{const t=D.indexOf(e),a=xe[2*t%xe.length],n=xe[(2*t+1)%xe.length],o=[];return oe.isHidden(`${e}||success`)||o.push(i.jsx(H,{dataKey:`${e}||success`,name:`${e} - ${F.SA_SUCCESSFUL}`,fill:a,stackId:e},`${e}-s`)),oe.isHidden(`${e}||failed`)||o.push(i.jsx(H,{dataKey:`${e}||failed`,name:`${e} - ${F.SA_FAILED}`,fill:n,stackId:e,radius:[4,4,0,0]},`${e}-f`)),o})]})}),t]}):i.jsxs(i.Fragment,{children:[i.jsx(z,{width:"100%",height:300,children:i.jsxs(K,{data:p,margin:{top:5,right:10,left:-10,bottom:0},"aria-label":`${F.SA_LOGIN_ACTIVITY_TITLE} chart`,children:[i.jsx(U,{dataKey:"date",tick:_e,tickLine:!1,tickFormatter:e=>Ee(e,s,c)}),i.jsx($,{width:40,tick:_e,tickLine:!1,axisLine:!1,allowDecimals:!1}),i.jsx(B,{content:i.jsx(pe,{timezone:c})}),ee.flatMap(e=>{const t=D.indexOf(e),a=xe[2*t%xe.length],n=xe[(2*t+1)%xe.length],o=[];return oe.isHidden(`${e}||success`)||o.push(i.jsx(q,{type:"linear",dataKey:`${e}||success`,name:`${e} - ${F.SA_SUCCESSFUL}`,stroke:a,strokeWidth:1.8,dot:!1},`${e}-s`)),oe.isHidden(`${e}||failed`)||o.push(i.jsx(q,{type:"linear",dataKey:`${e}||failed`,name:`${e} - ${F.SA_FAILED}`,stroke:n,strokeWidth:1.5,strokeDasharray:"5 5",dot:!1},`${e}-f`)),o})]})}),t]})}if(0===Z.length)return re;const t=i.jsx("div",{className:"ua-legend",children:Z.map(e=>i.jsxs("span",{className:"ua-legend-pill "+(ae.isHidden(e.key)?"off":""),role:"button",tabIndex:0,onClick:()=>ae.onPillClick(e.key),onKeyDown:t=>{"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),ae.onPillClick(e.key))},children:[i.jsx("span",{className:"ua-legend-dot",style:{background:e.color}})," ",e.name]},e.key))});if("bar"===e){const e=ie.filter(e=>"total"!==e.key);return i.jsxs(i.Fragment,{children:[i.jsx(z,{width:"100%",height:300,children:i.jsxs(N,{data:u,margin:{top:5,right:10,left:-10,bottom:0},"aria-label":`${F.SA_LOGIN_ACTIVITY_TITLE} chart`,children:[i.jsx(U,{dataKey:"date",tick:_e,tickLine:!1,tickFormatter:e=>Ee(e,s,c)}),i.jsx($,{width:40,tick:_e,tickLine:!1,axisLine:!1,allowDecimals:!1}),i.jsx(B,{content:i.jsx(pe,{timezone:c})}),e.map((t,a)=>i.jsx(H,{dataKey:t.key,name:t.name,fill:t.color,stackId:"login",radius:a===e.length-1?[4,4,0,0]:[0,0,0,0]},t.key))]})}),t]})}return i.jsxs(i.Fragment,{children:[i.jsx(z,{width:"100%",height:300,children:i.jsxs(K,{data:u,margin:{top:5,right:10,left:-10,bottom:0},"aria-label":`${F.SA_LOGIN_ACTIVITY_TITLE} chart`,children:[i.jsx(U,{dataKey:"date",tick:_e,tickLine:!1,tickFormatter:e=>Ee(e,s,c)}),i.jsx($,{width:40,tick:_e,tickLine:!1,axisLine:!1,allowDecimals:!1}),i.jsx(B,{content:i.jsx(pe,{timezone:c})}),ie.map(e=>i.jsx(q,{type:"linear",dataKey:e.key,name:e.name,stroke:e.color,strokeWidth:1.8,dot:!1,activeDot:{r:3}},e.key))]})}),t]})},ce=e.useMemo(()=>b.map(e=>({label:`${ge(e.code)} (${e.count.toLocaleString()})`,value:e.code})),[b]),me=e=>{if(0===b.length||0===y.length)return null;const t=v.slice(0,5),a=t.filter(e=>!le.isHidden(e));return i.jsxs(i.Fragment,{children:[i.jsx(R,{style:{margin:"16px 0 12px"}}),i.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:12},children:[i.jsx("h3",{style:{margin:0,fontSize:14,fontWeight:600,color:l.TEXT_DARK},children:F.SA_LOGIN_ACTIVITY_FAILED_REASONS_TITLE}),i.jsx(_,{suffixIcon:i.jsx(T,{size:16,style:{display:"block"}}),mode:"multiple",size:"middle",value:v,onChange:e=>{e.length>0&&e.length<=5&&S(e)},options:ce,tagRender:e=>i.jsx(je,{label:e.label,closable:e.closable,onClose:e.onClose}),style:{minWidth:260,maxWidth:480},maxTagCount:"responsive",maxTagPlaceholder:e=>i.jsxs(A,{variant:"outlined",style:{background:l.TAG_OVERFLOW.bg,border:`1px solid ${l.TAG_OVERFLOW.border}`,borderRadius:6,fontSize:12,color:l.TAG_OVERFLOW.text,padding:"1px 8px",margin:"2px 0"},children:["+",e.length," more"]}),placeholder:i.jsxs("span",{style:{display:"flex",alignItems:"center",gap:6,color:l.TEXT_MUTED},children:[i.jsx(Q,{style:{fontSize:12}}),F.SA_LOGIN_ACTIVITY_FILTER_REASON_PLACEHOLDER]}),allowClear:!0,popupMatchSelectWidth:400,listHeight:320,optionRender:e=>i.jsx("span",{style:{whiteSpace:"normal",wordBreak:"break-word",lineHeight:1.4},children:e.label})})]}),"bar"===e?i.jsx(z,{width:"100%",height:300,children:i.jsxs(N,{data:y,margin:{top:5,right:10,left:-10,bottom:0},"aria-label":`${F.SA_LOGIN_ACTIVITY_FAILED_REASONS_TITLE} chart`,children:[i.jsx(U,{dataKey:"time",tick:_e,tickLine:!1,tickFormatter:e=>Ee(e,s,c)}
1),i.jsx($,{width:40,tick:_e,tickLine:!1,axisLine:!1,allowDecimals:!1}),i.jsx(B,{content:i.jsx(pe,{timezone:c})}),a.map((e,n)=>i.jsx(H,{dataKey:e,name:ge(e),fill:ye[t.indexOf(e)%ye.length],stackId:"fr",radius:n===a.length-1?[4,4,0,0]:[0,0,0,0]},e))]})}):i.jsx(z,{width:"100%",height:300,children:i.jsxs(K,{data:y,margin:{top:5,right:10,left:-10,bottom:0},"aria-label":`${F.SA_LOGIN_ACTIVITY_FAILED_REASONS_TITLE} chart`,children:[i.jsx(U,{dataKey:"time",tick:_e,tickLine:!1,tickFormatter:e=>Ee(e,s,c)}),i.jsx($,{width:40,tick:_e,tickLine:!1,axisLine:!1,allowDecimals:!1}),i.jsx(B,{content:i.jsx(pe,{timezone:c})}),a.map(e=>i.jsx(q,{type:"linear",dataKey:e,name:ge(e),stroke:ye[t.indexOf(e)%ye.length],strokeWidth:1.6,dot:!1},e))]})}),i.jsx("div",{className:"ua-legend",children:t.map((e,t)=>i.jsxs("span",{className:"ua-legend-pill "+(le.isHidden(e)?"off":""),role:"button",tabIndex:0,onClick:()=>le.onPillClick(e),onKeyDown:t=>{"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),le.onPillClick(e))},children:[i.jsx("span",{className:"ua-legend-dot",style:{background:ye[t%ye.length]}})," ",ge(e)]},e))})]})};return i.jsx(ue,{title:F.SA_LOGIN_ACTIVITY_TITLE,isLoading:O,chartHeight:300,extraHeader:X,children:e=>i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"sa-sub-kpis",children:[{label:F.SA_TOTAL,value:g.total},{label:F.SA_SUCCESSFUL,value:g.success},{label:F.SA_FAILED,value:g.failed}].map(e=>i.jsxs("div",{className:"sa-sub-kpi",children:[i.jsx("div",{className:"sa-sub-kpi-label",children:e.label}),O?i.jsx(j.Input,{active:!0,style:{height:26,width:60,marginTop:4,display:"block"}}):i.jsx("div",{className:"sa-sub-kpi-value",children:e.value.toLocaleString()})]},e.label))}),de(e),me(e)]})})};o.extend(s),o.extend(E);const Ie={total:l.TOTAL,success:l.SUCCESS,failed:l.FAILED},Oe=l.FACTOR_PALETTE,Ce=l.REASON_PALETTE,Le=[{key:"totp",label:"TOTP"},{key:"push",label:"Push Notification"},{key:"passkey_2fa",label:"Passkey (2FA)"},{key:"email_otp",label:"Email OTP"},{key:"phone_otp",label:"Phone OTP"},{key:"security_question",label:"Security Question"},{key:"duo",label:"Duo"},{key:"backup_code",label:"Backup Code"},{key:"reauth_2fa",label:"Re-auth (2FA)"}],we={};for(const St of Le)we[St.key]=St.label;const De=(e,t,a)=>{if(!e)return"";const i=a?o.utc(e).tz(a):o.utc(e);if(!i.isValid())return e;switch(t){case"MINUTE":return i.format("HH:mm");case"HOUR":return i.format("ddd HH:00");default:return i.format("MMM D")}},Pe={fontSize:11,fill:l.TEXT_MUTED},Fe=l.TAG_MFA,Me=({label:e,closable:t,onClose:a})=>i.jsx(A,{variant:"outlined",closable:t,onClose:a,style:{background:Fe.bg,border:`1px solid ${Fe.border}`,color:Fe.text,borderRadius:6,fontSize:12,fontWeight:500,padding:"1px 8px",margin:"2px 4px 2px 0",lineHeight:"22px"},children:e}),Ne=({label:e,closable:t,onClose:a})=>i.jsx(A,{variant:"outlined",closable:t,onClose:a,style:{background:l.TAG_REASON.bg,border:`1px solid ${l.TAG_REASON.border}`,color:l.TAG_REASON.text,borderRadius:6,fontSize:12,fontWeight:500,padding:"1px 8px",margin:"2px 4px 2px 0",lineHeight:"22px",maxWidth:180,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",display:"inline-block",verticalAlign:"middle"},children:e}),He=({startDate:t,endDate:n,step:o,timeFrame:s,timezone:c,disabled:u,notAvailable:m})=>{const p=a(e=>e.appState.i18n.languages),[h,g]=e.useState([]),[f,b]=e.useState([]),[x,y]=e.useState({total:0,success:0,failed:0}),[k,v]=e.useState([]),[S,E]=e.useState([]),[I,O]=e.useState([]),[C,L]=e.useState([]),[w,D]=e.useState([]),[P,F]=e.useState(!1),[M,V]=e.useState([]),Y=e.useMemo(()=>{const e=new Set(w),t=new Set;for(const a of Le)e.has(a.label)&&t.add(a.key);return t},[w]),X=M.length>0,J=e.useMemo(()=>Le.filter(e=>Y.has(e.key)).map(e=>({label:e.label,value:e.key})),[Y]),Z=e.useCallback((e,t)=>{if(y(e?.summary||{total:0,success:0,failed:0}),v(e?.failedReasons||[]),E(e?.failedTrend||[]),t&&t.length>0){const a=(e?.trend||[]).map(e=>{const a={date:e.time};for(const i of t)a[`${i}||success`]=e[i]?.success??0,a[`${i}||failed`]=e[i]?.failed??0;return a});b(a),L(t)}else g((e?.trend||[]).map(e=>({date:e.time,total:e.total,success:e.success,failed:e.failed}))),b([]),L([])},[]);e.useEffect(()=>{if(!t||!n)return;if(u||m)return;F(!0);const e=X?M.map(e=>
1we[e]).filter(Boolean):void 0,a=e&&e.length>0?{startDate:t,endDate:n,step:o,timeFrame:s,factors:e}:{startDate:t,endDate:n,step:o,timeFrame:s};r("/advanced-security/mfa-overview",{},a).then(t=>{t?.ErrorCode?d("error",t.Message||p.SA_MFA_ERROR):(Z(t,e),D(t?.factors||[]))}).catch(()=>d("error",p.SA_MFA_ERROR)).finally(()=>F(!1))},[t,n,o,s,M]);const ee=i.jsx(_,{suffixIcon:i.jsx(T,{size:16,style:{display:"block"}}),mode:"multiple",value:M,onChange:e=>V(e),options:J,tagRender:e=>i.jsx(Me,{label:we[e.value]||e.label,closable:e.closable,onClose:e.onClose}),style:{minWidth:260,maxWidth:480},maxTagCount:"responsive",maxTagPlaceholder:e=>i.jsxs(A,{variant:"outlined",style:{background:l.TAG_OVERFLOW.bg,border:`1px solid ${l.TAG_OVERFLOW.border}`,borderRadius:6,fontSize:12,color:l.TAG_OVERFLOW.text,padding:"1px 8px",margin:"2px 0"},children:["+",e.length," more"]}),placeholder:i.jsxs("span",{style:{display:"flex",alignItems:"center",gap:6,color:l.TEXT_MUTED},children:[i.jsx(Q,{style:{fontSize:12}}),p.SA_MFA_FILTER_PLACEHOLDER]}),allowClear:!0,popupMatchSelectWidth:280,listHeight:300,size:"middle"}),te=[{key:"total",name:p.SA_TOTAL,color:Ie.total,gradient:"url(#adv-mfa-total)"},{key:"success",name:p.SA_SUCCESSFUL,color:Ie.success,gradient:"url(#adv-mfa-success)"},{key:"failed",name:p.SA_FAILED,color:Ie.failed,gradient:"url(#adv-mfa-failed)"}],ae=e.useMemo(()=>te.filter(e=>h.some(t=>(t[e.key]??0)>0)),[h]),ie=e.useMemo(()=>C.filter(e=>f.some(t=>(t[`${e}||success`]??0)>0||(t[`${e}||failed`]??0)>0)),[C,f]),ne=e.useMemo(()=>ae.map(e=>e.key),[ae]),oe=W(ne),se=e.useMemo(()=>ae.filter(e=>!oe.isHidden(e.key)),[ae,oe]),le=e.useMemo(()=>ie.flatMap(e=>[`${e}||success`,`${e}||failed`]),[ie]),re=W(le),de=e.useMemo(()=>(I.length>0?I:k.map(e=>e.code)).slice(0,5),[I,k]),ce=W(de),me=i.jsx(fe,{title:"No MFA activity in this range",description:"No MFA challenges were recorded in the selected window. Try a wider date range to confirm."}),he=e=>{if(X){if(0===ie.length)return me;const t=i.jsx("div",{className:"ua-legend",children:ie.flatMap(e=>{const t=C.indexOf(e),a=Oe[2*t%Oe.length],n=Oe[(2*t+1)%Oe.length],o=`${e}||success`,s=`${e}||failed`;return[i.jsxs("span",{className:"ua-legend-pill "+(re.isHidden(o)?"off":""),role:"button",tabIndex:0,onClick:()=>re.onPillClick(o),onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),re.onPillClick(o))},children:[i.jsx("span",{className:"ua-legend-dot",style:{background:a}})," ",e," - ",p.SA_SUCCESSFUL]},`${e}-s`),i.jsxs("span",{className:"ua-legend-pill "+(re.isHidden(s)?"off":""),role:"button",tabIndex:0,onClick:()=>re.onPillClick(s),onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),re.onPillClick(s))},children:[i.jsx("span",{className:"ua-legend-dot",style:{background:n}})," ",e," - ",p.SA_FAILED]},`${e}-f`)]})});return"bar"===e?i.jsxs(i.Fragment,{children:[i.jsx(z,{width:"100%",height:300,children:i.jsxs(N,{data:f,margin:{top:5,right:10,left:-10,bottom:0},"aria-label":`${p.SA_MFA_TITLE} chart`,children:[i.jsx(U,{dataKey:"date",tick:Pe,tickLine:!1,tickFormatter:e=>De(e,s,c)}),i.jsx($,{width:40,tick:Pe,tickLine:!1,axisLine:!1,allowDecimals:!1}),i.jsx(B,{content:i.jsx(pe,{timezone:c})}),ie.flatMap(e=>{const t=C.indexOf(e),a=Oe[2*t%Oe.length],n=Oe[(2*t+1)%Oe.length],o=[];return re.isHidden(`${e}||success`)||o.push(i.jsx(H,{dataKey:`${e}||success`,name:`${e} - ${p.SA_SUCCESSFUL}`,fill:a,stackId:e},`${e}-s`)),re.isHidden(`${e}||failed`)||o.push(i.jsx(H,{dataKey:`${e}||failed`,name:`${e} - ${p.SA_FAILED}`,fill:n,stackId:e,radius:[4,4,0,0]},`${e}-f`)),o})]})}),t]}):i.jsxs(i.Fragment,{children:[i.jsx(z,{width:"100%",height:300,children:i.jsxs(K,{data:f,margin:{top:5,right:10,left:-10,bottom:0},"aria-label":`${p.SA_MFA_TITLE} chart`,children:[i.jsx(U,{dataKey:"date",tick:Pe,tickLine:!1,tickFormatter:e=>De(e,s,c)}),i.jsx($,{width:40,tick:Pe,tickLine:!1,axisLine:!1,allowDecimals:!1}),i.jsx(B,{content:i.jsx(pe,{timezone:c})}),ie.flatMap(e=>{const t=C.indexOf(e),a=Oe[2*t%Oe.length],n=Oe[(2*t+1)%Oe.length],o=[];return re.isHidden(`${e}||success`)||o.push(i.jsx(q,{type:"linear",dataKey:`${e}||success`,name:`${e} - ${p.SA_SUCCESSFUL}`,stroke:a,strokeWidth:1.8,dot:!1},`${e}-s`)),re.isHidden(`${e}||failed`)||o.push(i.jsx(q,{type:"linear",dataKey:`${e}||failed`,name:`${e} - ${p.SA_FAILED}`,stroke:n,strokeWidth:1.5,strokeDasharray:"5 5",dot:!1},`${e}-f`)),o})]})}),t]})}if(0===ae.length)return me;const t=i.jsx("div",{className:"ua-legend",children:ae.map(e=>i.jsxs("span",{className:"ua-legend-pill "+(oe.isHidden(e.key)?"off":""),role:"button",tabIndex:0,onClick:()=>oe.onPillClick(e.key),onKeyDown:t=>{"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),oe.onPillClick(e.key))},children:[i.jsx("span",{className:"ua-legend-dot",style:{background:e.color}})," ",e.name]},e.key))});if("bar"===e){const e=se.filter(e=>"total"!==e.key);return i.jsxs(i.Fragment,{children:[i.jsx(z,{width:"100%",height:300,children:i.jsxs(N,{data:h,margin:{top:5,right:10,left:-10,bottom:0},"aria-label":`${p.SA_MFA_TITLE} chart`,children:[i.jsx(U,{dataKey:"date",tick:Pe,tickLine:!1,tickFormatter:e=>De(e,s,c)}
1),i.jsx($,{width:40,tick:Pe,tickLine:!1,axisLine:!1,allowDecimals:!1}),i.jsx(B,{content:i.jsx(pe,{timezone:c})}),e.map((t,a)=>i.jsx(H,{dataKey:t.key,name:t.name,fill:t.color,stackId:"mfa",radius:a===e.length-1?[4,4,0,0]:[0,0,0,0]},t.key))]})}),t]})}return i.jsxs(i.Fragment,{children:[i.jsx(z,{width:"100%",height:300,children:i.jsxs(K,{data:h,margin:{top:5,right:10,left:-10,bottom:0},"aria-label":`${p.SA_MFA_TITLE} chart`,children:[i.jsx(U,{dataKey:"date",tick:Pe,tickLine:!1,tickFormatter:e=>De(e,s,c)}),i.jsx($,{width:40,tick:Pe,tickLine:!1,axisLine:!1,allowDecimals:!1}),i.jsx(B,{content:i.jsx(pe,{timezone:c})}),se.map(e=>i.jsx(q,{type:"linear",dataKey:e.key,name:e.name,stroke:e.color,strokeWidth:1.8,dot:!1,activeDot:{r:3}},e.key))]})}),t]})},be=e.useMemo(()=>k.map(e=>({label:`${ge(e.code)} (${e.count.toLocaleString()})`,value:e.code})),[k]),xe=e=>{if(0===k.length||0===S.length)return null;const t=(I.length>0?I:k.map(e=>e.code)).slice(0,5),a=t.filter(e=>!ce.isHidden(e));return i.jsxs(i.Fragment,{children:[i.jsx(R,{style:{margin:"16px 0 12px"}}),i.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:12},children:[i.jsx("h3",{style:{margin:0,fontSize:14,fontWeight:600,color:l.TEXT_DARK},children:p.SA_MFA_FAILED_REASONS_TITLE}),i.jsx(_,{suffixIcon:i.jsx(T,{size:16,style:{display:"block"}}),mode:"multiple",size:"middle",value:I,onChange:e=>{e.length>0&&e.length<=5&&O(e)},options:be,tagRender:e=>i.jsx(Ne,{label:e.label,closable:e.closable,onClose:e.onClose}),style:{minWidth:260,maxWidth:480},maxTagCount:"responsive",maxTagPlaceholder:e=>i.jsxs(A,{variant:"outlined",style:{background:l.TAG_OVERFLOW.bg,border:`1px solid ${l.TAG_OVERFLOW.border}`,borderRadius:6,fontSize:12,color:l.TAG_OVERFLOW.text,padding:"1px 8px",margin:"2px 0"},children:["+",e.length," more"]}),placeholder:i.jsxs("span",{style:{display:"flex",alignItems:"center",gap:6,color:l.TEXT_MUTED},children:[i.jsx(Q,{style:{fontSize:12}}),p.SA_MFA_FILTER_REASON_PLACEHOLDER]}),allowClear:!0,popupMatchSelectWidth:400,listHeight:320,optionRender:e=>i.jsx("span",{style:{whiteSpace:"normal",wordBreak:"break-word",lineHeight:1.4},children:e.label})})]}),"bar"===e?i.jsx(z,{width:"100%",height:300,children:i.jsxs(N,{data:S,margin:{top:5,right:10,left:-10,bottom:0},"aria-label":`${p.SA_MFA_FAILED_REASONS_TITLE} chart`,children:[i.jsx(U,{dataKey:"time",tick:Pe,tickLine:!1,tickFormatter:e=>De(e,s,c)}),i.jsx($,{width:40,tick:Pe,tickLine:!1,axisLine:!1,allowDecimals:!1}),i.jsx(B,{content:i.jsx(pe,{timezone:c})}),a.map((e,n)=>i.jsx(H,{dataKey:e,name:ge(e),fill:Ce[t.indexOf(e)%Ce.length],stackId:"mfr",radius:n===a.length-1?[4,4,0,0]:[0,0,0,0]},e))]})}):i.jsx(z,{width:"100%",height:300,children:i.jsxs(K,{data:S,margin:{top:5,right:10,left:-10,bottom:0},"aria-label":`${p.SA_MFA_FAILED_REASONS_TITLE} chart`,children:[i.jsx(U,{dataKey:"time",tick:Pe,tickLine:!1,tickFormatter:e=>De(e,s,c)}),i.jsx($,{width:40,tick:Pe,tickLine:!1,axisLine:!1,allowDecimals:!1}),i.jsx(B,{content:i.jsx(pe,{timezone:c})}),a.map(e=>i.jsx(q,{type:"linear",dataKey:e,name:ge(e),stroke:Ce[t.indexOf(e)%Ce.length],strokeWidth:1.6,dot:!1},e))]})}),i.jsx("div",{className:"ua-legend",children:t.map((e,t)=>i.jsxs("span",{className:"ua-legend-pill "+(ce.isHidden(e)?"off":""),role:"button",tabIndex:0,onClick:()=>ce.onPillClick(e),onKeyDown:t=>{"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),ce.onPillClick(e))},children:[i.jsx("span",{className:"ua-legend-dot",style:{background:Ce[t%Ce.length]}})," ",ge(e)]},e))})]})};return i.jsx(ue,{title:p.SA_MFA_TITLE,isLoading:P,chartHeight:300,extraHeader:ee,disabled:u,disabledIcon:i.jsx(G,{}),disabledMessage:p.SA_MFA_DISABLED_MESSAGE,settingsRoute:"/security/multi-factor-authentication",settingsLabel:p.SA_MFA_ENABLE_LABEL,notAvailable:m,unavailableIcon:i.jsx(G,{}),unavailableTitle:p.SA_MFA_UNAVAILABLE_TITLE,unavailableMessage:p.SA_MFA_UNAVAILABLE_MESSAGE,contactRoute:"/get-support",children:e=>i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"sa-sub-kpis",children:[{label:p.SA_TOTAL,value:x.total},{label:p.SA_SUCCESSFUL,value:x.success},{label:p.SA_FAILED,value:x.failed}].map(e=>i.jsxs("div",{className:"sa-sub-kpi",children:[i.jsx("div",{className:"sa-sub-kpi-label",children:e.label}),P?i.jsx(j.Input,{active:!0,style:{height:26,width:60,marginTop:4,display:"block"}}):i.jsx("div",{className:"sa-sub-kpi-value",children:e.value.toLocaleStr
1ing()})]},e.label))}),he(e),xe(e)]})})};o.extend(s),o.extend(E);const{Text:We}=v,ze={total:l.TOTAL,success:l.SUCCESS,failed:l.FAILED},Ue=l.FACTOR_PALETTE,$e=l.REASON_PALETTE,Be=[{key:"password_email",label:"Password - Email",group:"Password"},{key:"password_username",label:"Password - Username",group:"Password"},{key:"password_phone",label:"Password - Phone",group:"Password"},{key:"password_otp_phone",label:"Password - OTP (Phone)",group:"Password"},{key:"password_otp_username",label:"Password - OTP (Username)",group:"Password"},{key:"password_reset_token",label:"Password - Reset Token",group:"Password"},{key:"password_security_q",label:"Password - Security Question",group:"Password"},{key:"pin_email",label:"PIN - Email",group:"PIN"},{key:"pin_username",label:"PIN - Username",group:"PIN"},{key:"pin_phone",label:"PIN - Phone",group:"PIN"},{key:"pin_reset_token",label:"PIN - Reset Token",group:"PIN"},{key:"pin_security_q",label:"PIN - Security Question",group:"PIN"},{key:"passkey_forgot",label:"Passkey - Forgot",group:"Passkey"},{key:"passkey_begin",label:"Passkey - Begin",group:"Passkey"},{key:"passkey_finish",label:"Passkey - Finish",group:"Passkey"},{key:"2fa_backup",label:"2FA Backup Code",group:"2FA"}],Ke={};for(const St of Be)Ke[St.key]=St.label;const qe={Password:l.TAG_PASSWORD,PIN:l.TAG_PIN,Passkey:l.TAG_PASSKEY,"2FA":l.TAG_2FA},Ge=(e,t,a)=>{if(!e)return"";const i=a?o.utc(e).tz(a):o.utc(e);if(!i.isValid())return e;switch(t){case"MINUTE":return i.format("HH:mm");case"HOUR":return i.format("ddd HH:00");default:return i.format("MMM D")}},Ve={fontSize:11,fill:l.TEXT_MUTED},Ye=({label:e,value:t,closable:a,onClose:n})=>{const o=Be.find(e=>e.key===t),s=o&&qe[o.group]||qe.Password;return i.jsx(A,{variant:"outlined",closable:a,onClose:n,style:{background:s.bg,border:`1px solid ${s.border}`,color:s.text,borderRadius:6,fontSize:12,fontWeight:500,padding:"1px 8px",margin:"2px 4px 2px 0",lineHeight:"22px"},children:e})},Xe=({label:e,closable:t,onClose:a})=>i.jsx(A,{variant:"outlined",closable:t,onClose:a,style:{background:l.TAG_REASON.bg,border:`1px solid ${l.TAG_REASON.border}`,color:l.TAG_REASON.text,borderRadius:6,fontSize:12,fontWeight:500,padding:"1px 8px",margin:"2px 4px 2px 0",lineHeight:"22px",maxWidth:180,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",display:"inline-block",verticalAlign:"middle"},children:e}),Je=({startDate:t,endDate:n,step:o,timeFrame:s,timezone:c})=>{const u=a(e=>e.appState.i18n.languages),[m,p]=e.useState([]),[h,g]=e.useState([]),[f,b]=e.useState({total:0,success:0,failed:0}),[x,y]=e.useState([]),[k,v]=e.useState([]),[S,E]=e.useState([]),[I,O]=e.useState([]),[C,L]=e.useState([]),[w,D]=e.useState(!1),[P,F]=e.useState([]),M=e.useMemo(()=>{const e=new Set(C),t=new Set;for(const a of Be)e.has(a.label)&&t.add(a.key);return t},[C]),G=P.length>0,V=e.useMemo(()=>["Password","PIN","Passkey","2FA"].map(e=>{const t=Be.filter(t=>t.group===e&&M.has(t.key)).map(e=>({label:e.label,value:e.key}));return 0===t.length?null:{label:i.jsx(We,{type:"secondary",style:{fontSize:11,fontWeight:600,textTransform:"uppercase",letterSpacing:.5},children:e}),options:t}}).filter(Boolean),[M]),Y=e.useCallback((e,t)=>{b(e?.summary||{total:0,success:0,failed:0});const a=e?.failedReasons||[];if(y(a),v(e?.failedTrend||[]),E(a.slice(0,5).map(e=>e.code)),t&&t.length>0){const a=(e?.trend||[]).map(e=>{const a={date:e.time};for(const i of t)a[`${i}||success`]=e[i]?.success??0,a[`${i}||failed`]=e[i]?.failed??0;return a});g(a),O(t)}else p((e?.trend||[]).map(e=>({date:e.time,total:e.total,success:e.success,failed:e.failed}))),g([]),O([])},[]);e.useEffect(()=>{if(!t||!n)return;D(!0);const e=G?P.map(e=>Ke[e]).filter(Boolean):void 0,a=e&&e.length>0?{startDate:t,endDate:n,step:o,timeFrame:s,factors:e}:{startDate:t,endDate:n,step:o,timeFrame:s};r("/advanced-security/password-reset",{},a).then(t=>{t?.ErrorCode?d("error",t.Message||u.SA_PASSWORD_RESET_ERROR):(Y(t,e),L(t?.factors||[]))}).catch(()=>d("error",u.SA_PASSWORD_RESET_ERROR)).finally(()=>D(!1))},[t,n,o,s,P]);const X=i.jsx(_,{suffixIcon:i.jsx(T,{size:16,style:{display:"block"}}),mode:"multiple",value:P,onChange:e=>F(e),options:V,tagRender:e=>i.jsx(Ye,{label:Ke[e.value]||e.label,value:e.value,closable:e.closable,onClose:e.onClose}),style:{minWidth:260,maxWidth:480},maxTagCount:"responsive",maxTagPlaceholder:e=>i.jsxs(A,{variant:"outlined",style:{background:l.TAG_OVERFLOW.bg,border:`1px solid ${l.TAG_OVERFLOW.border}`,borderRadius:6,fontSize:12,color:l.TAG_OVERFLOW.text,padding:"1px 8px",margin:"2px 0"},children:["+",e.length," more"]}),placeholder:i.jsxs("span",{style:{display:"flex",alignItems:"center",gap:6,color:l.TEXT_MUTED},children:[i.jsx(Q,{style:{fontSize:12}}),u.SA_PASSWORD_RESET_FILTER_PLACEHOLDER]}),allowClear:!0,popupMatchSelectWidth:340,listHeight:360,size:"middle"}),J=[{key:"total",name:u.SA_TOTAL,color:ze.total,gradient:"url(#adv-pr-total)"},{key:"success",name:u.SA_SUCCESSFUL,color:ze.success,gradient:"url(#adv-pr-success)"},{key:"failed",name:u.SA_FAILED,color:ze.failed,gradient:"url(#adv-pr-failed)"}],Z=e.useMemo(()=>J.filter(e=>m.some(t=>(t[e.key]??0)>0)),[m]),ee=e.useMemo(()=>I.filter(e=>h.some(t=>(t[`${e}||success`]??0)>0||(t[`${e}||failed`]??0)>0)),[I,h]),te=e.useMemo(()=>Z.map(e=>e.key),[Z]),ae=W(te),ie=e.useMemo(()=>ee.flatMap(e=>[`${e}-s`,`${e}-f`]),[ee]),ne=W(ie),oe=e.useMemo(()=>S.slice(0,5),[S]),se=W(oe),le=i.jsx(fe,{title:u.SA_PASSWORD_RESET_NO_DATA_TITLE,description:u.SA_PASSWORD_RESET_NO_DATA_DESCRIPTION}),re=e=>{if(G){if(0===ee.length)return le;const t=i.jsx("div",{className:"ua-legend",children:ee.flatMap(e=>{const t=I.indexOf(e),a=Ue[2*t%Ue.length],n=Ue[(2*t+1)%Ue.length],o=`${e}-s`,s=`${e}-f`;return[i.jsxs("span",{className:"ua-legend-pill "+(ne.isHidden(o)?"off":""),role:"button",tabIndex:0,onClick:()=>ne.onPillClick(o),onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),ne.onPillClick(o))},children:[i.jsx("span",{className:"ua-legend-dot",style:{background:a}})," ",e," - ",u.SA_SUCCESSFUL]},o),i.jsxs("span",{className:"ua-legend-pill "+(ne.isHidden(s)?"off":""),role:"button",tabIndex:0,onClick:()=>ne.onPillClick(s),onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),ne.onPillClick(s))},children:[i.jsx("span",{className:"ua-legend-dot",style:{background:n}})," ",e," - ",u.SA_FAILED]},s)]})});return"bar"===e?i.jsxs(i.Fragment,{children:[i.jsx(z,{width:"100%",height:300,children:i.jsxs(N,{data:h,margin:{top:5,right:10,left:-10,bottom:0},"aria-label":`${u.SA_PASSWORD_RESET_TITLE} chart`,children:[i.jsx(U,{dataKey:"date",tick:Ve,tickLine:!1,tickFormatter:e=>Ge(e,s,c)}
1),i.jsx($,{width:40,tick:Ve,tickLine:!1,axisLine:!1,allowDecimals:!1}),i.jsx(B,{content:i.jsx(pe,{timezone:c})}),ee.flatMap(e=>{const t=I.indexOf(e),a=Ue[2*t%Ue.length],n=Ue[(2*t+1)%Ue.length],o=[];return ne.isHidden(`${e}-s`)||o.push(i.jsx(H,{dataKey:`${e}||success`,name:`${e} - ${u.SA_SUCCESSFUL}`,fill:a,stackId:e},`${e}-s`)),ne.isHidden(`${e}-f`)||o.push(i.jsx(H,{dataKey:`${e}||failed`,name:`${e} - ${u.SA_FAILED}`,fill:n,stackId:e,radius:[4,4,0,0]},`${e}-f`)),o})]})}),t]}):i.jsxs(i.Fragment,{children:[i.jsx(z,{width:"100%",height:300,children:i.jsxs(K,{data:h,margin:{top:5,right:10,left:-10,bottom:0},"aria-label":`${u.SA_PASSWORD_RESET_TITLE} chart`,children:[i.jsx(U,{dataKey:"date",tick:Ve,tickLine:!1,tickFormatter:e=>Ge(e,s,c)}),i.jsx($,{width:40,tick:Ve,tickLine:!1,axisLine:!1,allowDecimals:!1}),i.jsx(B,{content:i.jsx(pe,{timezone:c})}),ee.flatMap(e=>{const t=I.indexOf(e),a=Ue[2*t%Ue.length],n=Ue[(2*t+1)%Ue.length],o=[];return ne.isHidden(`${e}-s`)||o.push(i.jsx(q,{type:"linear",dataKey:`${e}||success`,name:`${e} - ${u.SA_SUCCESSFUL}`,stroke:a,strokeWidth:1.8,dot:!1},`${e}-s`)),ne.isHidden(`${e}-f`)||o.push(i.jsx(q,{type:"linear",dataKey:`${e}||failed`,name:`${e} - ${u.SA_FAILED}`,stroke:n,strokeWidth:1.5,strokeDasharray:"5 5",dot:!1},`${e}-f`)),o})]})}),t]})}if(0===Z.length)return le;const t=i.jsx("div",{className:"ua-legend",children:Z.map(e=>i.jsxs("span",{className:"ua-legend-pill "+(ae.isHidden(e.key)?"off":""),role:"button",tabIndex:0,onClick:()=>ae.onPillClick(e.key),onKeyDown:t=>{"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),ae.onPillClick(e.key))},children:[i.jsx("span",{className:"ua-legend-dot",style:{background:e.color}})," ",e.name]},e.key))});if("bar"===e){const e=Z.filter(e=>"total"!==e.key&&!ae.isHidden(e.key));return i.jsxs(i.Fragment,{children:[i.jsx(z,{width:"100%",height:300,children:i.jsxs(N,{data:m,margin:{top:5,right:10,left:-10,bottom:0},"aria-label":`${u.SA_PASSWORD_RESET_TITLE} chart`,children:[i.jsx(U,{dataKey:"date",tick:Ve,tickLine:!1,tickFormatter:e=>Ge(e,s,c)}),i.jsx($,{width:40,tick:Ve,tickLine:!1,axisLine:!1,allowDecimals:!1}),i.jsx(B,{content:i.jsx(pe,{timezone:c})}),e.map((t,a)=>i.jsx(H,{dataKey:t.key,name:t.name,fill:t.color,stackId:"pr",radius:a===e.length-1?[4,4,0,0]:[0,0,0,0]},t.key))]})}),t]})}return i.jsxs(i.Fragment,{children:[i.jsx(z,{width:"100%",height:300,children:i.jsxs(K,{data:m,margin:{top:5,right:10,left:-10,bottom:0},"aria-label":`${u.SA_PASSWORD_RESET_TITLE} chart`,children:[i.jsx(U,{dataKey:"date",tick:Ve,tickLine:!1,tickFormatter:e=>Ge(e,s,c)}),i.jsx($,{width:40,tick:Ve,tickLine:!1,axisLine:!1,allowDecimals:!1}),i.jsx(B,{content:i.jsx(pe,{timezone:c})}),Z.filter(e=>!ae.isHidden(e.key)).map(e=>i.jsx(q,{type:"linear",dataKey:e.key,name:e.name,stroke:e.color,strokeWidth:1.8,dot:!1,activeDot:{r:3}},e.key))]})}),t]})},de=e.useMemo(()=>x.map(e=>({label:`${ge(e.code)} (${e.count.toLocaleString()})`,value:e.code})),[x]),ce=e=>{if(0===x.length||0===k.length)return null;const t=oe,a=t.filter(e=>!se.isHidden(e));return i.jsxs(i.Fragment,{children:[i.jsx(R,{style:{margin:"16px 0 12px"}}),i.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:12},children:[i.jsx("h3",{style:{margin:0,fontSize:14,fontWeight:600,color:l.TEXT_DARK},children:u.SA_PASSWORD_RESET_FAILED_REASONS_TITLE}),i.jsx(_,{suffixIcon:i.jsx(T,{size:16,style:{display:"block"}}),mode:"multiple",size:"middle",value:S,onChange:e=>{e.length>0&&e.length<=5&&E(e)},options:de,tagRender:e=>i.jsx(Xe,{label:e.label,closable:e.closable,onClose:e.onClose}),style:{minWidth:260,maxWidth:480},maxTagCount:"responsive",maxTagPlaceholder:e=>i.jsxs(A,{variant:"outlined",style:{background:l.TAG_OVERFLOW.bg,border:`1px solid ${l.TAG_OVERFLOW.border}`,borderRadius:6,fontSize:12,color:l.TAG_OVERFLOW.text,padding:"1px 8px",margin:"2px 0"},children:["+",e.length," more"]}),placeholder:i.jsxs("span",{style:{display:"flex",alignItems:"center",gap:6,color:l.TEXT_MUTED},children:[i.jsx(Q,{style:{fontSize:12}}),u.SA_PASSWORD_RESET_FILTER_REASON_PLACEHOLDER]}),allowClear:!0,popupMatchSelectWidth:400,listHeight:320,optionRender:e=>i.jsx("span",{style:{whiteSpace:"normal",wordBreak:"break-word",lineHeight:1.4},children:e.label})})]}),"bar"===e?i.jsx(z,{width:"100%",height:300,children:i.jsxs(N,{data:k,margin:{top:5,right:10,left:-10,bottom:0},"aria-label":`${u.SA_PASSWORD_RESET_FAILED_REASONS_TITLE} chart`,children:[i.jsx(U,{dataKey:"time",tick:Ve,tickLine:!1,tickFormatter:e=>Ge(e,s,c)}
1),i.jsx($,{width:40,tick:Ve,tickLine:!1,axisLine:!1,allowDecimals:!1}),i.jsx(B,{content:i.jsx(pe,{timezone:c})}),(()=>{const e=a.length>0?t.indexOf(a[a.length-1]):-1;return t.map((t,a)=>se.isHidden(t)?null:i.jsx(H,{dataKey:t,name:ge(t),fill:$e[a%$e.length],stackId:"prfr",radius:a===e?[4,4,0,0]:[0,0,0,0]},t))})()]})}):i.jsx(z,{width:"100%",height:300,children:i.jsxs(K,{data:k,margin:{top:5,right:10,left:-10,bottom:0},"aria-label":`${u.SA_PASSWORD_RESET_FAILED_REASONS_TITLE} chart`,children:[i.jsx(U,{dataKey:"time",tick:Ve,tickLine:!1,tickFormatter:e=>Ge(e,s,c)}),i.jsx($,{width:40,tick:Ve,tickLine:!1,axisLine:!1,allowDecimals:!1}),i.jsx(B,{content:i.jsx(pe,{timezone:c})}),t.map((e,t)=>se.isHidden(e)?null:i.jsx(q,{type:"linear",dataKey:e,name:ge(e),stroke:$e[t%$e.length],strokeWidth:1.6,dot:!1},e))]})}),i.jsx("div",{className:"ua-legend",children:t.map((e,t)=>i.jsxs("span",{className:"ua-legend-pill "+(se.isHidden(e)?"off":""),role:"button",tabIndex:0,onClick:()=>se.onPillClick(e),onKeyDown:t=>{"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),se.onPillClick(e))},children:[i.jsx("span",{className:"ua-legend-dot",style:{background:$e[t%$e.length]}})," ",ge(e)]},e))})]})};return i.jsx(ue,{title:u.SA_PASSWORD_RESET_TITLE,isLoading:w,chartHeight:300,extraHeader:X,children:e=>i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"sa-sub-kpis",children:[{label:u.SA_PASSWORD_RESET_TOTAL_LABEL,value:f.total},{label:u.SA_SUCCESSFUL,value:f.success},{label:u.SA_FAILED,value:f.failed}].map(e=>i.jsxs("div",{className:"sa-sub-kpi",children:[i.jsx("div",{className:"sa-sub-kpi-label",children:e.label}),w?i.jsx(j.Input,{active:!0,style:{height:26,width:60,marginTop:4,display:"block"}}):i.jsx("div",{className:"sa-sub-kpi-value",children:e.value.toLocaleString()})]},e.label))}),re(e),ce(e)]})})};o.extend(s),o.extend(E);const Qe=[{key:"SECURITY_ANSWER_INVALID",labelKey:"SA_BRUTE_FORCE_SECURITY_ANSWER_INVALID",color:l.SERIES_BRUTE_FORCE.SECURITY_ANSWER_INVALID},{key:"LOGIN_IS_LOCKED_FOR_RECAPTCHA",labelKey:"SA_BRUTE_FORCE_RECAPTCHA_LOCK",color:l.SERIES_BRUTE_FORCE.LOGIN_IS_LOCKED_FOR_RECAPTCHA},{key:"LOGIN_IS_LOCKED_FOR_SECURITY_QUESTION",labelKey:"SA_BRUTE_FORCE_SECURITY_QUESTION_LOCK",color:l.SERIES_BRUTE_FORCE.LOGIN_IS_LOCKED_FOR_SECURITY_QUESTION},{key:"USER_ID_LOCKED",labelKey:"SA_BRUTE_FORCE_USER_ID_LOCKED",color:l.SERIES_BRUTE_FORCE.USER_ID_LOCKED},{key:"LOGIN_IS_LOCKED_FOR_MFA",labelKey:"SA_BRUTE_FORCE_MFA_LOCK",color:l.SERIES_BRUTE_FORCE.LOGIN_IS_LOCKED_FOR_MFA}],Ze={fontSize:11,fill:l.TEXT_MUTED},et=(e,t,a)=>{if(!e)return"";const i=a?o.utc(e).tz(a):o.utc(e);if(!i.isValid())return e;switch(t){case"MINUTE":return i.format("HH:mm");case"HOUR":return i.format("ddd HH:00");default:return i.format("MMM D")}},tt=({startDate:t,endDate:n,step:o,timeFrame:s,timezone:l,disabled:c,notAvailable:u})=>{const m=a(e=>e.appState.i18n.languages),[p,h]=e.useState([]),[g,f]=e.useState(!1),b=e.useMemo(()=>Qe.filter(e=>p.some(t=>(t[e.key]??0)>0)),[p]),x=e.useMemo(()=>b.map(e=>e.key),[b]),{isHidden:y,onPillClick:k}=W(x),v=e.useMemo(()=>b.filter(e=>!y(e.key)),[b,y]);return e.useEffect(()=>{t&&n&&(c||u||(f(!0),r("/advanced-security/brute-force-protection",{},{startDate:t,endDate:n,step:o,timeFrame:s}).then(e=>{e?.ErrorCode?d("error",e.Message||m.SA_BRUTE_FORCE_ERROR):h((e?.trend||[]).map(e=>({date:e.time,...e,time:void 0})))}).catch(()=>d("error",m.SA_BRUTE_FORCE_ERROR)).finally(()=>f(!1))))},[t,n,o,s]),i.jsx(ue,{title:m.SA_BRUTE_FORCE_TITLE,isLoading:g,chartHeight:300,disabled:c,disabledIcon:i.jsx(se,{}),disabledMessage:m.SA_BRUTE_FORCE_DISABLED_MESSAGE,settingsRoute:"/security/attack-protection/brute-force-protection",settingsLabel:m.SA_BRUTE_FORCE_SETTINGS_LABEL,notAvailable:u,unavailableIcon:i.jsx(se,{}),unavailableTitle:m.SA_BRUTE_FORCE_UNAVAILABLE_TITLE,unavailableMessage:m.SA_BRUTE_FORCE_UNAVAILABLE_MESSAGE,contactRoute:"/get-support",children:e=>(e=>{if(0===b.length)return i.jsx(fe,{title:m.SA_BRUTE_FORCE_NO_DATA_TITLE,description:m.SA_BRUTE_FORCE_NO_DATA_DESCRIPTION});const t=i.jsx("div",{className:"ua-legend",children:b.map(e=>i.jsxs("span",{className:"ua-legend-pill "+(y(e.key)?"off":""),role:"button",tabIndex:0,onClick:()=>k(e.key),onKeyDown:t=>
1{"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),k(e.key))},children:[i.jsx("span",{className:"ua-legend-dot",style:{background:e.color}})," ",m[e.labelKey]]},e.key))});return"bar"===e?i.jsxs(i.Fragment,{children:[i.jsx(z,{width:"100%",height:300,children:i.jsxs(N,{data:p,margin:{top:5,right:10,left:-10,bottom:0},"aria-label":`${m.SA_BRUTE_FORCE_TITLE} chart`,children:[i.jsx(U,{dataKey:"date",tick:Ze,tickLine:!1,tickFormatter:e=>et(e,s,l)}),i.jsx($,{width:40,tick:Ze,tickLine:!1,axisLine:!1,allowDecimals:!1}),i.jsx(B,{content:i.jsx(pe,{timezone:l})}),v.map((e,t)=>i.jsx(H,{dataKey:e.key,name:m[e.labelKey],fill:e.color,stackId:"bf",radius:t===v.length-1?[4,4,0,0]:[0,0,0,0]},e.key))]})}),t]}):i.jsxs(i.Fragment,{children:[i.jsx(z,{width:"100%",height:300,children:i.jsxs(K,{data:p,margin:{top:5,right:10,left:-10,bottom:0},"aria-label":`${m.SA_BRUTE_FORCE_TITLE} chart`,children:[i.jsx(U,{dataKey:"date",tick:Ze,tickLine:!1,tickFormatter:e=>et(e,s,l)}),i.jsx($,{width:40,tick:Ze,tickLine:!1,axisLine:!1,allowDecimals:!1}),i.jsx(B,{content:i.jsx(pe,{timezone:l})}),v.map(e=>i.jsx(q,{type:"linear",dataKey:e.key,name:m[e.labelKey],stroke:e.color,strokeWidth:1.8,dot:!1,activeDot:{r:3}},e.key))]})}),t]})})(e)})};o.extend(s),o.extend(E);const at=[{key:"failed",labelKey:"SA_BOT_PROTECTION_ALL_APIS",color:l.SERIES_BOT.FAILED}],it="__all_endpoints__",nt={fontSize:11,fill:l.TEXT_MUTED},ot=l.FACTOR_PALETTE.length,st=(e,t,a)=>{if(!e)return"";const i=a?o.utc(e).tz(a):o.utc(e);if(!i.isValid())return e;switch(t){case"MINUTE":return i.format("HH:mm");case"HOUR":return i.format("ddd HH:00");default:return i.format("MMM D")}},lt=e=>{if(e.length<=28)return e;const t=e.split("/").filter(Boolean);return t.length<=2?e:`â¦/${t.slice(-2).join("/")}`},rt=({startDate:t,endDate:n,step:o,timeFrame:s,timezone:c,disabled:u,notAvailable:m})=>{const p=a(e=>e.appState.i18n.languages),[h,g]=e.useState([]),[f,b]=e.useState({failed:0,endpointCount:0}),[x,y]=e.useState([]),[v,S]=e.useState([]),[E,T]=e.useState([]),[R,O]=e.useState(!1),C=E.length>0,L=e.useMemo(()=>E.map((e,t)=>({key:`ep_${t}`,endpoint:e,label:lt(e),color:l.FACTOR_PALETTE[t%l.FACTOR_PALETTE.length]})),[E]),w=e.useMemo(()=>(C?L.map(e=>({key:e.key,label:e.label,color:e.color})):at.map(e=>({key:e.key,label:p[e.labelKey],color:e.color}))).filter(e=>h.some(t=>(t[e.key]??0)>0)),[C,L,h,p]),D=e.useMemo(()=>x.slice(0,ot).map(e=>e.endpoint),[x]),P=D.length>0&&D.every(e=>v.includes(e)),F=e.useMemo(()=>w.map(e=>e.key),[w]),{isHidden:M,onPillClick:G}=W(F),V=e.useMemo(()=>w.filter(e=>!M(e.key)),[w,M]);e.useEffect(()=>{if(!t||!n)return;if(u||m)return;O(!0);const e=v.slice(0,ot),a=e.length>0?{startDate:t,endDate:n,step:o,timeFrame:s,endpoints:e}:{startDate:t,endDate:n,step:o,timeFrame:s};r("/advanced-security/bot-protection",{},a).then(t=>{if(t?.ErrorCode)return void d("error",t.Message||p.SA_BOT_PROTECTION_ERROR);const a=(t?.endpoints||[]).filter(e=>e&&e.endpoint).map(e=>({endpoint:String(e.endpoint),count:Number(e.count??0)||0}));y(a);const i=(t?.trend||[]).filter(e=>e&&e.time);"endpoint"===t?.mode?(g(i.map(t=>{const a={date:t.time};return e.forEach((e,i)=>{a[`ep_${i}`]=Number(t[e]??0)||0}),a})),T(e)):(g(i.map(e=>({date:e.time,failed:Number(e.count??0)||0}))),T([])),b({failed:Number(t?.summary?.total??0)||0,endpointCount:Number(t?.summary?.endpointCount??0)||0});const n=new Set(a.map(e=>e.endpoint)),o=e.filter(e=>n.has(e));o.length!==e.length&&S(o)}).catch(()=>d("error",p.SA_BOT_PROTECTION_ERROR)).finally(()=>O(!1))},[t,n,o,s,v]);const Y=i.jsx(_,{mode:"multiple",value:v,onChange:e=>{e.includes(it)?S(P?[]:D):e.length<=ot&&S(e)},options:[...D.length>0?[{label:`${p.SA_BOT_PROTECTION_ALL_APIS} (${D.length})`,value:it}]:[],...x.map(e=>({label:`${e.endpoint} (${e.count.toLocaleString()})`,value:e.endpoint}))],tagRender:e=>i.jsx(A,{variant:"outlined",closable:e.closable,onClose:e.onClose,style:{background:l.TAG_REASON.bg,border:`1px solid ${l.TAG_REASON.border}`,borderRadius:6,fontSize:12,color:l.TAG_REASON.text,padding:"1px 8px",margin:"2px 4px 2px 0"},children:void 0===e.value?e.label:lt(String(e.value))}),style:{minWidth:260,maxWidth:480},maxTagCount:"responsive",maxTagPlaceholder:e=>i.jsxs(A,{variant:"outlined",style:{background:l.TAG_OVERFLOW.bg,border:`1px solid ${l.TAG_OVERFLOW.border}`,borderRadius:6,fontSize:12,color:l.TAG_OVERFLOW.text,padding:"1px 8px",margin:"2px 0"},children:["+",e.length," more"]}),placeholder:i.jsxs("span",{style:{display:"flex",alignItems:"center",gap:6,color:l.TEXT_MUTED},children:[i.jsx(Q,{style:{fontSize:12}}),p.SA_BOT_PROTECTION_FILTER_PLACEHOLDER]}),allowClear:!0,popupMatchSelectWidth:420,listHeight:300,size:"middle"}),X=e=>{if(0===w.length)return i.jsx(fe,{title:p.SA_BOT_PROTECTION_NO_DATA_TITLE,description:p.SA_BOT_PROTECTION_NO_DATA_DESCRIPTION});const t=i.jsx("div",{className:"ua-legend",children:w.map(e=>i.jsxs("span",{className:"ua-legend-pill "+(M(e.key)?"off":""),role:"button",tabIndex:0,title:e.label,onClick:()=>G(e.key),onKeyDown:t=>{"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),G(e.key))},children:[i.jsx("span",{className:"ua-legend-dot",style:{background:e.color}})," ",e.label]},e.key))});return"bar"===e?i.jsxs(i.Fragment,{children:[i.jsx(z,{width:"100%",height:300,children:i.jsxs(N,{data:h,margin:{top:5,right:10,left:-10,bottom:0}
1,"aria-label":`${p.SA_BOT_PROTECTION_TITLE} chart`,children:[i.jsx(U,{dataKey:"date",tick:nt,tickLine:!1,tickFormatter:e=>st(e,s,c)}),i.jsx($,{width:40,tick:nt,tickLine:!1,axisLine:!1,allowDecimals:!1}),i.jsx(B,{content:i.jsx(pe,{timezone:c})}),V.map((e,t)=>i.jsx(H,{dataKey:e.key,name:e.label,fill:e.color,stackId:"bot",radius:t===V.length-1?[4,4,0,0]:[0,0,0,0]},e.key))]})}),t]}):i.jsxs(i.Fragment,{children:[i.jsx(z,{width:"100%",height:300,children:i.jsxs(K,{data:h,margin:{top:5,right:10,left:-10,bottom:0},"aria-label":`${p.SA_BOT_PROTECTION_TITLE} chart`,children:[i.jsx(U,{dataKey:"date",tick:nt,tickLine:!1,tickFormatter:e=>st(e,s,c)}),i.jsx($,{width:40,tick:nt,tickLine:!1,axisLine:!1,allowDecimals:!1}),i.jsx(B,{content:i.jsx(pe,{timezone:c})}),V.map(e=>i.jsx(q,{type:"linear",dataKey:e.key,name:e.label,stroke:e.color,strokeWidth:1.8,dot:!1,activeDot:{r:3}},e.key))]})}),t]})};return i.jsx(ue,{title:p.SA_BOT_PROTECTION_TITLE,isLoading:R,chartHeight:300,extraHeader:Y,disabled:u,disabledIcon:i.jsx(I,{}),disabledMessage:p.SA_BOT_PROTECTION_DISABLED_MESSAGE,settingsRoute:"/security/attack-protection/bot-protection",settingsLabel:p.SA_BOT_PROTECTION_SETTINGS_LABEL,notAvailable:m,unavailableIcon:i.jsx(I,{}),unavailableTitle:p.SA_BOT_PROTECTION_UNAVAILABLE_TITLE,unavailableMessage:p.SA_BOT_PROTECTION_UNAVAILABLE_MESSAGE,contactRoute:"/get-support",children:e=>i.jsxs(i.Fragment,{children:[i.jsx(k,{gap:12,style:{marginBottom:16},children:[{label:p.SA_FAILED,value:f.failed},{label:p.SA_BOT_PROTECTION_APIS_AFFECTED,value:f.endpointCount}].map(e=>i.jsx("div",{style:{flex:1,display:"flex",alignItems:"center",gap:10,background:l.BG_WHITE,border:`1px solid ${l.CARD_BORDER}`,borderRadius:10,padding:"10px 14px"},children:i.jsxs("div",{style:{minWidth:0},children:[i.jsx("div",{style:{fontSize:14,color:l.CARD_TEXT,fontWeight:500,lineHeight:1.2},children:e.label}),R?i.jsx(j.Input,{active:!0,style:{height:22,width:60,marginTop:2,display:"block"}}):i.jsx("div",{style:{fontSize:20,fontWeight:700,color:l.CARD_TEXT,lineHeight:1.3},children:e.value.toLocaleString()})]})},e.label))}),X(e)]})})};o.extend(s),o.extend(E);const dt=[{key:"BREACHED_PASSWORD",labelKey:"SA_BREACHED_PASSWORD_ON_REGISTER",color:l.SERIES_BREACHED.BREACHED_PASSWORD},{key:"BREACHED_PASSWORD_LOGIN",labelKey:"SA_BREACHED_PASSWORD_ON_LOGIN",color:l.SERIES_BREACHED.BREACHED_PASSWORD_LOGIN},{key:"CHANGE_BREACHED_PASSWORD",labelKey:"SA_BREACHED_PASSWORD_ON_FORCED_RESET",color:l.SERIES_BREACHED.CHANGE_BREACHED_PASSWORD}],ct=Object.fromEntries(dt.map(e=>[e.key,e])),ut=l.TAG_BREACH,mt=({label:e,closable:t,onClose:a})=>i.jsx(A,{variant:"outlined",closable:t,onClose:a,style:{background:ut.bg,border:`1px solid ${ut.border}`,color:ut.text,borderRadius:6,fontSize:12,fontWeight:500,padding:"1px 8px",margin:"2px 4px 2px 0",lineHeight:"22px"},children:e}),pt={fontSize:11,fill:l.TEXT_MUTED},ht=(e,t,a)=>{if(!e)return"";const i=a?o.utc(e).tz(a):o.utc(e);if(!i.isValid())return e;switch(t){case"MINUTE":return i.format("HH:mm");case"HOUR":return i.format("ddd HH:00");default:return i.format("MMM D")}},gt=({startDate:t,endDate:n,step:o,timeFrame:s,timezone:c,disabled:u,notAvailable:m})=>{const p=a(e=>e.appState.i18n.languages),[h,g]=e.useState([]),[f,b]=e.useState(!1),[x,y]=e.useState([]);e.useEffect(()=>{t&&n&&(u||m||(b(!0),r("/advanced-security/breached-password-detection",{},{startDate:t,endDate:n,step:o,timeFrame:s}).then(e=>{e?.ErrorCode?d("error",e.Message||p.SA_BREACHED_PASSWORD_ERROR):g((e?.trend||[]).map(e=>({date:e.time,...e,time:void 0})))}).catch(()=>d("error",p.SA_BREACHED_PASSWORD_ERROR)).finally(()=>b(!1))))},[t,n,o,s]);const k=e.useMemo(()=>dt.filter(e=>h.some(t=>(t[e.key]??0)>0)),[h]),v=e.useMemo(()=>dt.filter(e=>(0===x.length||x.includes(e.key))&&h.some(t=>(t[e.key]??0)>0)),[x,h]),S=e.useMemo(()=>v.map(e=>e.key),[v]),{isHidden:E,onPillClick:j}=W(S),R=e.useMemo(()=>v.filter(e=>!E(e.key)),[v,E]),I=i.jsx(_,{suffixIcon:i.jsx(T,{size:16,style:{display:"block"}}),mode:"multiple",value:x,onChange:e=>y(e),options:k.map(e=>({label:p[e.labelKey],value:e.key})),tagRender:e=>i.jsx(mt,{label:p[ct[e.value]?.labelKey]||e.label,closable:e.closable,onClose:e.onClose}),style:{minWidth:220,maxWidth:420},maxTagCount:"responsive",maxTagPlaceholder:e=>i.jsxs(A,{variant:"outlined",style:{background:l.TAG_OVERFLOW.bg,border:`1px solid ${l.TAG_OVERFLOW.border}`,borderRadius:6,fontSize:12,color:l.TAG_OVERFLOW.text,padding:"1px 8px",margin:"2px 0"},children:["+",e.length," more"]}),placeholder:i.jsxs("span",{style:{display:"flex",alignItems:"center",gap:6,color:l.TEXT_MUTED},children:[i.jsx(Q,{style:{fontSize:12}}),p.SA_BREACHED_PASSWORD_FILTER_PLACEHOLDER]}),allowClear:!0,popupMatchSelectWidth:320,listHeight:200,size:"middle"});return i.jsx(ue,{title:p.SA_BREACHED_PASSWORD_TITLE,isLoading:f,chartHeight:300,extraHeader:I,disabled:u,disabledIcon:i.jsx(V,{}),disabledMessage:p.SA_BREACHED_PASSWORD_DISABLED_MESSAGE,settingsRoute:"/security/attack-protection/breached-password-protection",settingsLabel:p.SA_BREACHED_PASSWORD_SETTINGS_LABEL,notAvailable:m,unavailableIcon:i.jsx(V,{}),unavailableTitle:p.SA_BREACHED_PASSWORD_UNAVAILABLE_TITLE,unavailableMessage:p.SA_BREACHED_PASSWORD_UNAVAILABLE_MESSAGE,contactRoute:"/get-support",children:e=>(e=>{if(0===v.length)return i.jsx(fe,{title:p.SA_BREACHED_PASSWORD_NO_DATA_TITLE,description:p.SA_BREACHED_PASSWORD_NO_DATA_DESCRIPTION});const t=i.jsx("div",{className:"ua-legend",children:v.map(e=>i.jsxs("span",{className:"ua-legend-pill "+(E(e.key)?"off":""),role:"button",tabIndex:0,onClick:()=>j(e.key),onKeyDown:t=>{"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),j(e.key))},children:[i.jsx("span",{className:"ua-legend-dot",style:{background:e.color}})," ",p[e.labelKey]]},e.key))});return"bar"===e?i.jsxs(i.Fragment,{children:[i.jsx(z,{width:"100%",height:300,children:i.jsxs(N,{data:h,margin:{top:5,right:10,left:-10,bottom:0},"aria-label":`${p.SA_BREACHED_PASSWORD_TITLE} chart`,children:[i.jsx(U,{dataKey:"date",tick:pt,tickLine:!1,tickFormatter:e=>ht(e,s,c)}
1),i.jsx($,{width:40,tick:pt,tickLine:!1,axisLine:!1,allowDecimals:!1}),i.jsx(B,{content:i.jsx(pe,{timezone:c})}),R.map((e,t)=>i.jsx(H,{dataKey:e.key,name:p[e.labelKey],fill:e.color,stackId:"bp",radius:t===R.length-1?[4,4,0,0]:[0,0,0,0]},e.key))]})}),t]}):i.jsxs(i.Fragment,{children:[i.jsx(z,{width:"100%",height:300,children:i.jsxs(K,{data:h,margin:{top:5,right:10,left:-10,bottom:0},"aria-label":`${p.SA_BREACHED_PASSWORD_TITLE} chart`,children:[i.jsx(U,{dataKey:"date",tick:pt,tickLine:!1,tickFormatter:e=>ht(e,s,c)}),i.jsx($,{width:40,tick:pt,tickLine:!1,axisLine:!1,allowDecimals:!1}),i.jsx(B,{content:i.jsx(pe,{timezone:c})}),R.map(e=>i.jsx(q,{type:"linear",dataKey:e.key,name:p[e.labelKey],stroke:e.color,strokeWidth:1.8,dot:!1,activeDot:{r:3}},e.key))]})}),t]})})(e)})};o.extend(s),o.extend(E);const ft=[{key:"RESTRICTED_DOMAIN",labelKey:"SA_RESTRICTED_DOMAIN_LABEL",color:l.SERIES_RESTRICTED.RESTRICTED_DOMAIN},{key:"SPAM_DOMAIN",labelKey:"SA_SPAM_DOMAIN_LABEL",color:l.SERIES_RESTRICTED.SPAM_DOMAIN}],bt={fontSize:11,fill:l.TEXT_MUTED},xt=(e,t,a)=>{if(!e)return"";const i=a?o.utc(e).tz(a):o.utc(e);if(!i.isValid())return e;switch(t){case"MINUTE":return i.format("HH:mm");case"HOUR":return i.format("ddd HH:00");default:return i.format("MMM D")}},yt=({startDate:t,endDate:n,step:o,timeFrame:s,timezone:l,disabled:c,notAvailable:u})=>{const m=a(e=>e.appState.i18n.languages),[p,h]=e.useState([]),[g,f]=e.useState(!1),b=e.useMemo(()=>ft.filter(e=>p.some(t=>(t[e.key]??0)>0)),[p]),x=e.useMemo(()=>b.map(e=>e.key),[b]),{isHidden:y,onPillClick:k}=W(x),v=e.useMemo(()=>b.filter(e=>!y(e.key)),[b,y]);return e.useEffect(()=>{t&&n&&(c||u||(f(!0),r("/advanced-security/restricted-domains",{},{startDate:t,endDate:n,step:o,timeFrame:s}).then(e=>{e?.ErrorCode?d("error",e.Message||m.SA_RESTRICTED_DOMAINS_ERROR):h((e?.trend||[]).map(e=>({date:e.time,...e,time:void 0})))}).catch(()=>d("error",m.SA_RESTRICTED_DOMAINS_ERROR)).finally(()=>f(!1))))},[t,n,o,s]),i.jsx(ue,{title:m.SA_RESTRICTED_DOMAINS_TITLE,isLoading:g,chartHeight:300,disabled:c,disabledIcon:i.jsx(ae,{}),disabledMessage:m.SA_RESTRICTED_DOMAINS_DISABLED_MESSAGE,settingsRoute:"/security/attack-protection/domain-access-management",settingsLabel:m.SA_RESTRICTED_DOMAINS_SETTINGS_LABEL,notAvailable:u,unavailableIcon:i.jsx(ae,{}),unavailableTitle:m.SA_RESTRICTED_DOMAINS_UNAVAILABLE_TITLE,unavailableMessage:m.SA_RESTRICTED_DOMAINS_UNAVAILABLE_MESSAGE,contactRoute:"/get-support",children:e=>(e=>{if(0===b.length)return i.jsx(fe,{title:m.SA_RESTRICTED_DOMAINS_NO_DATA_TITLE,description:m.SA_RESTRICTED_DOMAINS_NO_DATA_DESCRIPTION});const t=i.jsx("div",{className:"ua-legend",children:b.map(e=>i.jsxs("span",{className:"ua-legend-pill "+(y(e.key)?"off":""),role:"button",tabIndex:0,onClick:()=>k(e.key),onKeyDown:t=>{"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),k(e.key))},children:[i.jsx("span",{className:"ua-legend-dot",style:{background:e.color}})," ",m[e.labelKey]]},e.key))});return"bar"===e?i.jsxs(i.Fragment,{children:[i.jsx(z,{width:"100%",height:300,children:i.jsxs(N,{data:p,margin:{top:5,right:10,left:-10,bottom:0},"aria-label":`${m.SA_RESTRICTED_DOMAINS_TITLE} chart`,children:[i.jsx(U,{dataKey:"date",tick:bt,tickLine:!1,tickFormatter:e=>xt(e,s,l)}),i.jsx($,{width:40,tick:bt,tickLine:!1,axisLine:!1,allowDecimals:!1}),i.jsx(B,{content:i.jsx(pe,{timezone:l})}),v.map((e,t)=>i.jsx(H,{dataKey:e.key,name:m[e.labelKey],fill:e.color,stackId:"rd",radius:t===v.length-1?[4,4,0,0]:[0,0,0,0]},e.key))]})}),t]}):i.jsxs(i.Fragment,{children:[i.jsx(z,{width:"100%",height:300,children:i.jsxs(K,{data:p,margin:{top:5,right:10,left:-10,bottom:0},"aria-label":`${m.SA_RESTRICTED_DOMAINS_TITLE} chart`,children:[i.jsx(U,{dataKey:"date",tick:bt,tickLine:!1,tickFormatter:e=>xt(e,s,l)}),i.jsx($,{width:40,tick:bt,tickLine:!1,axisLine:!1,allowDecimals:!1}),i.jsx(B,{content:i.jsx(pe,{timezone:l})}),v.map(e=>i.jsx(q,{type:"linear",dataKey:e.key,name:m[e.labelKey],stroke:e.color,strokeWidth:1.8,dot:!1,activeDot:{r:3}},e.key))]})}),t]})})(e)})};o.extend(s),o.extend(E);const kt={method:"save",resolution:re.HIGH,page:{margin:16,format:"letter",orientation:"landscape"},canvas:{mimeType:"image/png",qualityRatio:1},overrides:{pdf:{compress:!0},canvas:{useCORS:!0}}},vt=()=>{const t=c(),n=a(e=>e.account.AccountGetProfile),s=a(e=>e.auth.appFeatures),l=a(e=>e.auth.appPermission),r=a(e=>e.appState.i18n.languages),d=!!l?.UserInsights_View,y=a(e=>e.securityConfiguration.secondFactorAuthentication),k=a(e=>e.auth.appBasicInfo),v=a(e=>e.securityConfiguration.getBreachedPassword),E=a(e=>e.securityConfiguration.getCaptchaSettingsData),_=a(e=>e.domainAccessManagement),A=y?.Data?.IsSecondFactorAuthenticatorEnabled??!1,T=!(!k?.LoginLockedType||"None"===k.LoginLockedType),j=v?.data?.IsEnabled??!1,R=E?.IsEnabled??!1,I=_?.Data?.IsEnabled??!1,[D,P]=e.useState("UTC"),[M,N]=e.useState(!1),H=e.useRef(!1),W=e.useRef(!1),z=e.useCallback(()=>o(new Date).tz(D),[D]),U=e.useMemo(()=>z(),[z]),$=e.useMemo(()=>z().endOf("day"),[z]),B=e.useMemo(()=>z().subtract(7,"day").startOf("day"),[z]),[K,q]=e.useState(null),{toPDF:G,targetRef
1:V}=(t=>{const a=e.useRef(),i=e.useCallback(e=>(async(e,t)=>{const a=(e=>e?{...de,...e,canvas:{...de.canvas,...e.canvas},page:{...de.page,...e.page}}:de)(t),i=(e=>"function"==typeof e?e():e?.current)(e);if(!i)return;const n=await w(i,{useCORS:a.canvas.useCORS,logging:a.canvas.logging,scale:a.resolution,...a.overrides?.canvas}),o=new ce(n,a).convert();switch(a.method){case"build":return o;case"open":return window.open(o.output("bloburl"),"_blank"),o;default:{const e=a.filename??`${(new Date).getTime()}.pdf`;return await o.save(e,{returnPromise:!0}),o}}})(a,t??e),[a,t]);return{targetRef:a,toPDF:i}})({filename:"Security_Analytics_Report.pdf"});e.useEffect(()=>{n.isSuccess||n.isLoading||H.current||(H.current=!0,t(u(""))),t(m()),t(p()),t(h()),t(g()),t(f())},[]),e.useEffect(()=>{if(n.isSuccess){const e=b(n.TimeZone||"");return P(O(n.TimeZone||"",e)),void N(!0)}n.isError&&(P("UTC"),N(!0))},[n.isSuccess,n.isError,n.TimeZone]),e.useEffect(()=>{if(!M||W.current)return;W.current=!0;const e=z();q([e.clone().subtract(24,"hour"),e])},[M,z]);const Y=e.useMemo(()=>{const e=z();return[{label:"Last 15 Minutes",value:[e.clone().subtract(15,"minute"),e.clone()]},{label:"Last 30 Minutes",value:[e.clone().subtract(30,"minute"),e.clone()]},{label:"Last 1 Hour",value:[e.clone().subtract(1,"hour"),e.clone()]},{label:"Last 6 Hours",value:[e.clone().subtract(6,"hour"),e.clone()]},{label:"Last 12 Hours",value:[e.clone().subtract(12,"hour"),e.clone()]},{label:"Last 24 Hours",value:[e.clone().subtract(24,"hour"),e.clone()]},{label:"Last 3 Days",value:[e.clone().subtract(3,"day"),e.clone()]},{label:"Last 7 Days",value:[e.clone().subtract(7,"day"),e.clone()]}]},[z]),{timeFrame:X,step:J}=e.useMemo(()=>K?.[0]&&K?.[1]?((e,t)=>{const a=t.diff(e,"minute"),i=t.diff(e,"day");return a<=60?{timeFrame:"MINUTE",step:1}:a<=360?{timeFrame:"MINUTE",step:5}:a<=1440?{timeFrame:"MINUTE",step:15}:i<=3?{timeFrame:"HOUR",step:1}:i<=7?{timeFrame:"HOUR",step:3}:{timeFrame:"DAY",step:1}})(K[0],K[1]):{timeFrame:"HOUR",step:3},[K]),Q=K?.[0]?.utc().format("YYYY-MM-DD HH:mm:ss")??"",Z=K?.[1]?.utc().format("YYYY-MM-DD HH:mm:ss")??"",ee=e.useMemo(()=>{const e=[{key:"mfa",notAvailable:!s.registration_as_a_service,disabled:!A},{key:"brute-force",notAvailable:!s.registration_as_a_service,disabled:!T},{key:"breached-password",notAvailable:!s.breached_password_enabled,disabled:!j},{key:"restricted-domains",notAvailable:!s.registration_as_a_service,disabled:!I},{key:"bot-protection",notAvailable:!s.registration_as_a_service,disabled:!R}],t=e=>e.notAvailable?2:e.disabled?1:0;return[...e].sort((e,a)=>t(e)-t(a))},[s,A,T,j,R,I]);return i.jsx(F,{permissions:[],features:["enable_security_analytics"],children:i.jsxs("div",{className:"user-analytics",ref:V,children:[i.jsx("div",{className:"ua-cluster",children:i.jsxs("div",{className:"ua-cluster-right",children:[i.jsx(C.RangePicker,{className:"ua-date-picker",showTime:!0,endTimeToNowIfToday:!0,disabledDate:e=>e&&(e.endOf("day").isAfter($)||e.startOf("day").isBefore(B)),value:K,timezone:D,minDate:B,maxDate:U,format:"YYYY-MM-DD HH:mm",presets:Y,onChange:e=>{const t=e;if(!t?.[0]||!t?.[1]||t[0].isAfter(t[1]))return;const a=z(),i=(t[1].isAfter(a)?a:t[1]).second(0).millisecond(0);let n=t[0].second(0).millisecond(0),o=i.diff(n,"minute");o>10080&&(n=i.subtract(7,"day"),o=i.diff(n,"minute")),o<15||o>10080||q([n,i])}}),i.jsx(S,{type:"primary",disabled:!d,onClick:()=>G(kt),children:i.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:6,color:x},children:[i.jsx(L,{size:16,strokeWidth:1.6,style:{display:"block"}}),r.SECURITY_ANALYTICS_EXPORT_LABEL]})})]})}),i.jsx("div",{children:i.jsx(F,{permissions:["UserInsights_View"],features:[],children:i.jsx("div",{style:{display:"flex",flexDirection:"column",gap:16,paddingBottom:32},children:Q&&Z&&i.jsxs(i.Fragment,{children:[i.jsx(Re,{startDate:Q,endDate:Z,step:J,timeFrame:X,timezone:D}),i.jsx(Je,{startDate:Q,endDate:Z,step:J,timeFrame:X,timezone:D}),ee.map(({key:e,disabled:t,notAvailable:a})=>"mfa"===e?i.jsx(He,{startDate:Q,endDate:Z,step:J,timeFrame:X,timezone:D,disabled:t,notAvailable:a},e):"brute-force"===e?i.jsx(tt,{startDate:Q,endDate:Z,step:J,timeFrame:X,timezone:D,disabled:t,notAvailable:a},e):"breached-password"===e?i.jsx(gt,{startDate:Q,endDate:Z,step:J,timeFrame:X,timezone:D,disabled:t,notAvailable:a},e):"bot-protection"===e?i.jsx(rt,{startDate:Q,endDate:Z,step:J,timeFrame:X,timezone:D,disabled:t,notAvailable:a},e):"restricted-domains"===e?i.jsx(yt,{startDate:Q,endDate:Z,step:J,timeFrame:X,timezone:D,disabled:t,notAvailable:a},e):null)]})})})})]})})};export{vt as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.