import*as i18n from"../i18n/i18n.js";const UIStrings={lowest:"Lowest",low:"Low",medium:"Medium",high:"High",highest:"Highest"},str_=i18n.i18n.registerUIStrings("perf_ui/NetworkPriorities.ts",UIStrings),i18nString=i18n.i18n.getLocalizedString.bind(void 0,str_);export function uiLabelForNetworkPriority(r){return priorityUILabelMap().get(r)||""}const uiLabelToPriorityMapInstance=new Map;export function uiLabelToNetworkPriority(r){return 0===uiLabelToPriorityMapInstance.size&&priorityUILabelMap().forEach(((r,t)=>uiLabelToPriorityMapInstance.set(r,t))),uiLabelToPriorityMapInstance.get(r)||""}let _priorityUILabelMapInstance;export function priorityUILabelMap(){if(_priorityUILabelMapInstance)return _priorityUILabelMapInstance;const r=new Map;return r.set(Protocol.Network.ResourcePriority.VeryLow,i18nString(UIStrings.lowest)),r.set(Protocol.Network.ResourcePriority.Low,i18nString(UIStrings.low)),r.set(Protocol.Network.ResourcePriority.Medium,i18nString(UIStrings.medium)),r.set(Protocol.Network.ResourcePriority.High,i18nString(UIStrings.high)),r.set(Protocol.Network.ResourcePriority.VeryHigh,i18nString(UIStrings.highest)),_priorityUILabelMapInstance=r,r}const networkPriorityWeights=new Map;export function networkPriorityWeight(r){return 0===networkPriorityWeights.size&&(networkPriorityWeights.set(Protocol.Network.ResourcePriority.VeryLow,1),networkPriorityWeights.set(Protocol.Network.ResourcePriority.Low,2),networkPriorityWeights.set(Protocol.Network.ResourcePriority.Medium,3),networkPriorityWeights.set(Protocol.Network.ResourcePriority.High,4),networkPriorityWeights.set(Protocol.Network.ResourcePriority.VeryHigh,5)),networkPriorityWeights.get(r)||0}