import*as SDK from"../sdk/sdk.js";import{CategorizedBreakpointsSidebarPane}from"./CategorizedBreakpointsSidebarPane.js";let cspViolationBreakpointsSidebarPaneInstance;export class CSPViolationBreakpointsSidebarPane extends CategorizedBreakpointsSidebarPane{constructor(){const e=SDK.DOMDebuggerModel.DOMDebuggerManager.instance().cspViolationBreakpoints(),a=e.map((e=>e.category()));a.sort(),super(a,e,"sources.cspViolationBreakpoints",Protocol.Debugger.PausedEventReason.CSPViolation)}static instance(){return cspViolationBreakpointsSidebarPaneInstance||(cspViolationBreakpointsSidebarPaneInstance=new CSPViolationBreakpointsSidebarPane),cspViolationBreakpointsSidebarPaneInstance}_getBreakpointFromPausedDetails(e){const a=e.auxData&&e.auxData.violationType?e.auxData.violationType:"",n=SDK.DOMDebuggerModel.DOMDebuggerManager.instance().cspViolationBreakpoints().find((e=>e.type()===a));return n||null}_toggleBreakpoint(e,a){e.setEnabled(a),SDK.DOMDebuggerModel.DOMDebuggerManager.instance().updateCSPViolationBreakpoints()}}