import*as Common from"../common/common.js";import*as i18n from"../i18n/i18n.js";import*as Root from"../root/root.js";import*as UI from"../ui/ui.js";const UIStrings={flamechartMouseWheelAction:"Flamechart mouse wheel action:",scroll:"Scroll",zoom:"Zoom",liveMemoryAllocationAnnotations:"Live memory allocation annotations",showLiveMemoryAllocation:"Show live memory allocation annotations",hideLiveMemoryAllocation:"Hide live memory allocation annotations",collectGarbage:"Collect garbage"},str_=i18n.i18n.registerUIStrings("perf_ui/perf_ui-meta.ts",UIStrings),i18nLazyString=i18n.i18n.getLazilyComputedLocalizedString.bind(void 0,str_);let loadedPerfUIModule;async function loadPerfUIModule(){return loadedPerfUIModule||(await Root.Runtime.Runtime.instance().loadModulePromise("perf_ui"),loadedPerfUIModule=await import("./perf_ui.js")),loadedPerfUIModule}UI.ActionRegistration.registerActionExtension({actionId:"components.collect-garbage",category:UI.ActionRegistration.ActionCategory.PERFORMANCE,title:i18nLazyString(UIStrings.collectGarbage),iconClass:"largeicon-trash-bin",loadActionDelegate:async()=>(await loadPerfUIModule()).GCActionDelegate.GCActionDelegate.instance()}),Common.Settings.registerSettingExtension({category:"PERFORMANCE",title:i18nLazyString(UIStrings.flamechartMouseWheelAction),settingName:"flamechartMouseWheelAction",settingType:"enum",defaultValue:"zoom",options:[{title:i18nLazyString(UIStrings.scroll),text:i18nLazyString(UIStrings.scroll),value:"scroll"},{title:i18nLazyString(UIStrings.zoom),text:i18nLazyString(UIStrings.zoom),value:"zoom"}]}),Common.Settings.registerSettingExtension({category:"MEMORY",experiment:Root.Runtime.ExperimentName.LIVE_HEAP_PROFILE,title:i18nLazyString(UIStrings.liveMemoryAllocationAnnotations),settingName:"memoryLiveHeapProfile",settingType:"boolean",defaultValue:!1,options:[{value:!0,title:i18nLazyString(UIStrings.showLiveMemoryAllocation)},{value:!1,title:i18nLazyString(UIStrings.hideLiveMemoryAllocation)}]});