export function uiLabelForNetworkPriority(priority){return priorityUILabelMap().get(priority)||'';}
export function uiLabelToNetworkPriority(priorityLabel){if(!PerfUI._uiLabelToPriorityMapInstance){PerfUI._uiLabelToPriorityMapInstance=new Map();priorityUILabelMap().forEach((value,key)=>PerfUI._uiLabelToPriorityMapInstance.set(value,key));}
return PerfUI._uiLabelToPriorityMapInstance.get(priorityLabel)||'';}
let _priorityUILabelMapInstance=null;export function priorityUILabelMap(){if(_priorityUILabelMapInstance){return _priorityUILabelMapInstance;}
const map=new Map();map.set(Protocol.Network.ResourcePriority.VeryLow,Common.UIString('Lowest'));map.set(Protocol.Network.ResourcePriority.Low,Common.UIString('Low'));map.set(Protocol.Network.ResourcePriority.Medium,Common.UIString('Medium'));map.set(Protocol.Network.ResourcePriority.High,Common.UIString('High'));map.set(Protocol.Network.ResourcePriority.VeryHigh,Common.UIString('Highest'));_priorityUILabelMapInstance=map;return map;}
export function networkPriorityWeight(priority){if(!PerfUI._networkPriorityWeights){const priorityMap=new Map();priorityMap.set(Protocol.Network.ResourcePriority.VeryLow,1);priorityMap.set(Protocol.Network.ResourcePriority.Low,2);priorityMap.set(Protocol.Network.ResourcePriority.Medium,3);priorityMap.set(Protocol.Network.ResourcePriority.High,4);priorityMap.set(Protocol.Network.ResourcePriority.VeryHigh,5);PerfUI._networkPriorityWeights=priorityMap;}
return PerfUI._networkPriorityWeights.get(priority)||0;}