import{Settings as e}from"../common/common.js";import{ls as t}from"../platform/platform.js";import{Runtime as o}from"../root/root.js";import{ViewManager as i,ActionRegistration as n}from"../ui/ui.js";let a;async function s(){return a||(await o.Runtime.instance().loadModulePromise("console"),a=await import("./console.js")),a}i.registerViewExtension({location:"panel",id:"console",title:()=>t`Console`,commandPrompt:()=>t`Show Console`,order:20,loadView:async()=>(await s()).ConsolePanel.ConsolePanel.instance()}),i.registerViewExtension({location:"drawer-view",id:"console-view",title:()=>t`Console`,commandPrompt:()=>t`Show Console`,persistence:"permanent",order:0,loadView:async()=>(await s()).ConsolePanel.WrapperView.instance()}),n.registerActionExtension({actionId:"console.show",category:n.ActionCategory.CONSOLE,title:()=>t`Show Console`,loadActionDelegate:async()=>(await s()).ConsoleView.ActionDelegate.instance(),bindings:[{shortcut:"Ctrl+`",keybindSets:["devToolsDefault","vsCode"]}]}),n.registerActionExtension({actionId:"console.clear",category:n.ActionCategory.CONSOLE,title:()=>t`Clear console`,iconClass:"largeicon-clear",loadActionDelegate:async()=>(await s()).ConsoleView.ActionDelegate.instance(),contextTypes(){return e=e=>[e.ConsoleView.ConsoleView],void 0===a?[]:e(a);var e},bindings:[{shortcut:"Ctrl+L"},{shortcut:"Meta+K",platform:"mac"}]}),n.registerActionExtension({actionId:"console.clear.history",category:n.ActionCategory.CONSOLE,title:()=>t`Clear console history`,loadActionDelegate:async()=>(await s()).ConsoleView.ActionDelegate.instance()}),n.registerActionExtension({actionId:"console.create-pin",category:n.ActionCategory.CONSOLE,title:()=>t`Create live expression`,iconClass:"largeicon-visibility",loadActionDelegate:async()=>(await s()).ConsoleView.ActionDelegate.instance()}),e.registerSettingExtension({category:e.SettingCategoryObject.CONSOLE,title:()=>t`Hide network messages`,settingName:"hideNetworkMessages",settingType:e.SettingTypeObject.BOOLEAN,defaultValue:!1,options:[{value:!0,title:()=>t`Hide network messages`},{value:!1,title:()=>t`Show network messages`}]}),e.registerSettingExtension({category:e.SettingCategoryObject.CONSOLE,title:()=>t`Selected context only`,settingName:"selectedContextFilterEnabled",settingType:e.SettingTypeObject.BOOLEAN,defaultValue:!1,options:[{value:!0,title:()=>t`Only show messages from the current context (top, iframe, worker, extension)`},{value:!1,title:()=>t`Show messages from all contexts`}]}),e.registerSettingExtension({category:e.SettingCategoryObject.CONSOLE,title:()=>t`Log XMLHttpRequests`,settingName:"monitoringXHREnabled",settingType:e.SettingTypeObject.BOOLEAN,defaultValue:!1}),e.registerSettingExtension({category:e.SettingCategoryObject.CONSOLE,title:()=>t`Show timestamps`,settingName:"consoleTimestampsEnabled",settingType:e.SettingTypeObject.BOOLEAN,defaultValue:!1,options:[{value:!0,title:()=>t`Show timestamps`},{value:!1,title:()=>t`Hide timestamps`}]}),e.registerSettingExtension({category:e.SettingCategoryObject.CONSOLE,title:()=>t`Autocomplete from history`,settingName:"consoleHistoryAutocomplete",settingType:e.SettingTypeObject.BOOLEAN,defaultValue:!0,options:[{value:!0,title:()=>t`Autocomplete from history`},{value:!1,title:()=>t`Do not autocomplete from history`}]}),e.registerSettingExtension({category:e.SettingCategoryObject.CONSOLE,title:()=>t`Group similar messages in console`,settingName:"consoleGroupSimilar",settingType:e.SettingTypeObject.BOOLEAN,defaultValue:!0,options:[{value:!0,title:()=>t`Group similar messages in console`},{value:!1,title:()=>t`Do not group similar messages in console`}]}),e.registerSettingExtension({category:e.SettingCategoryObject.CONSOLE,title:()=>t`Eager evaluation`,settingName:"consoleEagerEval",settingType:e.SettingTypeObject.BOOLEAN,defaultValue:!0,options:[{value:!0,title:()=>t`Eagerly evaluate console prompt text`},{value:!1,title:()=>t`Do not eagerly evaluate console prompt text`}]}),e.registerSettingExtension({category:e.SettingCategoryObject.CONSOLE,title:()=>t`Evaluate triggers user activation`,settingName:"consoleUserActivationEval",settingType:e.SettingTypeObject.BOOLEAN,defaultValue:!0,options:[{value:!0,title:()=>t`Treat evaluation as user activation`},{value:!1,title:()=>t`Do not treat evaluation as user activation`}]});
