import{Settings as e}from"../common/common.js";import{Runtime as o}from"../root/root.js";import{ViewManager as t,ActionRegistration as r}from"../ui/ui.js";import{i18n as n}from"../i18n/i18n.js";const i={showNetwork:"Show Network",network:"Network",showNetworkRequestBlocking:"Show Network request blocking",networkRequestBlocking:"Network request blocking",showNetworkConditions:"Show Network conditions",networkConditions:"Network conditions",diskCache:"disk cache",networkThrottling:"network throttling",useragent:"useragent",userAgent:"user agent",userdagent:"user-agent",showSearch:"Show Search",search:"Search",recordNetworkLog:"Record network log",stopRecordingNetworkLog:"Stop recording network log",hideRequestDetails:"Hide request details",colorcodeResourceTypes:"Color-code resource types",colorCode:"color code",resourceType:"resource type",colorCodeByResourceType:"Color code by resource type",useDefaultColors:"Use default colors",groupNetworkLogByFrame:"Group network log by frame",netWork:"network",frame:"frame",group:"group",groupNetworkLogItemsByFrame:"Group network log items by frame",dontGroupNetworkLogItemsByFrame:"Don't group network log items by frame"},a=n.registerUIStrings("network/network-meta.ts",i),s=n.getLazilyComputedLocalizedString.bind(void 0,a);let c;async function l(){return c||(await o.Runtime.instance().loadModulePromise("network"),c=await import("./network.js")),c}function w(e){return void 0===c?[]:e(c)}t.registerViewExtension({location:"panel",id:"network",commandPrompt:s(i.showNetwork),title:s(i.network),order:40,loadView:async()=>(await l()).NetworkPanel.NetworkPanel.instance()}),t.registerViewExtension({location:"drawer-view",id:"network.blocked-urls",commandPrompt:s(i.showNetworkRequestBlocking),title:s(i.networkRequestBlocking),persistence:"closeable",order:60,loadView:async()=>(await l()).BlockedURLsPane.BlockedURLsPane.instance()}),t.registerViewExtension({location:"drawer-view",id:"network.config",commandPrompt:s(i.showNetworkConditions),title:s(i.networkConditions),persistence:"closeable",order:40,tags:[s(i.diskCache),s(i.networkThrottling),s(i.userdagent),s(i.userAgent),s(i.userdagent)],loadView:async()=>(await l()).NetworkConfigView.NetworkConfigView.instance()}),t.registerViewExtension({location:"network-sidebar",id:"network.search-network-tab",commandPrompt:s(i.showSearch),title:s(i.search),persistence:"permanent",loadView:async()=>(await l()).NetworkPanel.SearchNetworkView.instance()}),r.registerActionExtension({actionId:"network.toggle-recording",category:r.ActionCategory.NETWORK,iconClass:"largeicon-start-recording",toggleable:!0,toggledIconClass:"largeicon-stop-recording",toggleWithRedColor:!0,contextTypes:()=>w((e=>[e.NetworkPanel.NetworkPanel])),loadActionDelegate:async()=>(await l()).NetworkPanel.ActionDelegate.instance(),options:[{value:!0,title:s(i.recordNetworkLog)},{value:!1,title:s(i.stopRecordingNetworkLog)}],bindings:[{shortcut:"Ctrl+E",platform:"windows,linux"},{shortcut:"Meta+E",platform:"mac"}]}),r.registerActionExtension({actionId:"network.hide-request-details",category:r.ActionCategory.NETWORK,title:s(i.hideRequestDetails),contextTypes:()=>w((e=>[e.NetworkPanel.NetworkPanel])),loadActionDelegate:async()=>(await l()).NetworkPanel.ActionDelegate.instance(),bindings:[{shortcut:"Esc"}]}),r.registerActionExtension({actionId:"network.search",category:r.ActionCategory.NETWORK,title:s(i.search),contextTypes:()=>w((e=>[e.NetworkPanel.NetworkPanel])),loadActionDelegate:async()=>(await l()).NetworkPanel.ActionDelegate.instance(),bindings:[{platform:"mac",shortcut:"Meta+F",keybindSets:["devToolsDefault","vsCode"]},{platform:"windows,linux",shortcut:"Ctrl+F",keybindSets:["devToolsDefault","vsCode"]}]}),e.registerSettingExtension({category:e.SettingCategoryObject.NETWORK,title:s(i.colorcodeResourceTypes),settingName:"networkColorCodeResourceTypes",settingType:e.SettingTypeObject.BOOLEAN,defaultValue:!1,tags:[s(i.colorCode),s(i.resourceType)],options:[{value:!0,title:s(i.colorCodeByResourceType)},{value:!1,title:s(i.useDefaultColors)}]}),e.registerSettingExtension({category:e.SettingCategoryObject.NETWORK,title:s(i.groupNetworkLogByFrame),settingName:"network.group-by-frame",settingType:e.SettingTypeObject.BOOLEAN,defaultValue:!1,tags:[s(i.netWork),s(i.frame),s(i.group)],options:[{value:!0,title:s(i.groupNetworkLogItemsByFrame)},{value:!1,title:s(i.dontGroupNetworkLogItemsByFrame)}]}),t.registerLocationResolver({name:"network-sidebar",category:t.ViewLocationCategoryValues.NETWORK,loadResolver:async()=>(await l()).NetworkPanel.NetworkPanel.instance()});export{i as UIStrings};
