export default class SecurityModel extends SDK.SDKModel{constructor(target){super(target);this._dispatcher=new SecurityDispatcher(this);this._securityAgent=target.securityAgent();target.registerSecurityDispatcher(this._dispatcher);this._securityAgent.enable();} resourceTreeModel(){return(this.target().model(SDK.ResourceTreeModel));} networkManager(){return(this.target().model(SDK.NetworkManager));} static SecurityStateComparator(a,b){let securityStateMap;if(SecurityModel._symbolicToNumericSecurityState){securityStateMap=SecurityModel._symbolicToNumericSecurityState;}else{securityStateMap=new Map();const ordering=[Protocol.Security.SecurityState.Info,Protocol.Security.SecurityState.InsecureBroken,Protocol.Security.SecurityState.Insecure,Protocol.Security.SecurityState.Neutral,Protocol.Security.SecurityState.Secure,Protocol.Security.SecurityState.Unknown];for(let i=0;iDate.now());} getKeyExchangeName(){if(this.keyExchangeGroup){return this.keyExchange?ls`${this.keyExchange} with ${this.keyExchangeGroup}`:this.keyExchangeGroup;} return this.keyExchange;} getCipherFullName(){return this.mac?ls`${this.cipher} with ${this.mac}`:this.cipher;}} class SafetyTipInfo{constructor(safetyTipInfo){this.safetyTipStatus=safetyTipInfo.safetyTipStatus;this.safeUrl=safetyTipInfo.safeUrl||null;}} export class SecurityStyleExplanation{constructor(securityState,title,summary,description,certificate=[],mixedContentType=Protocol.Security.MixedContentType.None,recommendations=[]){this.securityState=securityState;this.title=title;this.summary=summary;this.description=description;this.certificate=certificate;this.mixedContentType=mixedContentType;this.recommendations=recommendations;}} class SecurityDispatcher{constructor(model){this._model=model;} securityStateChanged(securityState,schemeIsCryptographic,explanations,insecureContentStatus,summary){const pageSecurityState=new PageSecurityState(securityState,explanations,summary||null);this._model.dispatchEventToListeners(Events.SecurityStateChanged,pageSecurityState);} visibleSecurityStateChanged(visibleSecurityState){const pageVisibleSecurityState=new PageVisibleSecurityState(visibleSecurityState.securityState,visibleSecurityState.certificateSecurityState||null,visibleSecurityState.safetyTipInfo||null,visibleSecurityState.securityStateIssueIds);this._model.dispatchEventToListeners(Events.VisibleSecurityStateChanged,pageVisibleSecurityState);} certificateError(eventId,errorType,requestURL){}} self.Security=self.Security||{};Security=Security||{};Security.SecurityModel=SecurityModel;Security.SecurityModel.Events=Events;Security.SummaryMessages=SummaryMessages;Security.PageSecurityState=PageSecurityState;Security.PageVisibleSecurityState=PageVisibleSecurityState;Security.CertificateSecurityState=CertificateSecurityState;Security.SecurityStyleExplanation=SecurityStyleExplanation;