"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.getCurrentItemFromPath=exports.getApi=exports.eventPath=exports.decodeChannelName=exports.apiPath=void 0;var a=require("./common.js"),b=function(b){if(b)return(0,a.cleanUpKey)(b.info.title+"_"+b.info.version)};exports.apiPath=b;var c=function(a,c,d){var e="";return a&&(e+="/".concat(b(a))),c&&(e+="/".concat(encodeURIComponent(c))),d&&(e+="/".concat(d)),e};exports.eventPath=c;var d=function(a){return decodeURIComponent(a)};exports.decodeChannelName=d;var e=function(a){var b=a.split("/"),c="";switch(b[1]){case"documentation":c=b[2]+"_"+b[b.length-1];break;default:}switch(b[2]){case"overview":c="overview";break;case"operation":c=decodeURIComponent(b[3])+"_"+b[4];break;case"definitions":c="definitions";break;case"documentation":c=b[1]+"_"+b[2]+"_"+b[3]+"_"+b[b.length-1];break;default:}switch(b[3]){case"overview":c=decodeURIComponent(b[2])+"_overview";break;case"publish":c=decodeURIComponent(b[2])+"_data";break;case"subscribe":c=decodeURIComponent(b[2])+"_data";break;default:}return c};exports.getCurrentItemFromPath=e;var f=function(a,c){return a.find(function(a){return b(a)===c})};exports.getApi=f;