'use strict';
import { addQueryParamsToPath } from './paths.js';
import { isLocalUrl } from '../url/urls.js';
import { navigate } from '../redirect/redirect-functions.js';
import { httpProtocols } from '../../base-repo/constants/http-constants.js';

var __defProp=Object['defineProperty'],__name=(_0x31d2a0,_0x3fec44)=>__defProp(_0x31d2a0,'name',{'value':_0x3fec44,'configurable':!![]});const slash='/';function silentChangeUrl(_0x44e045,_0x34c543){const _0x16fb30=addQueryParamsToPath(_0x44e045,_0x34c543);window['history']['pushState'](void(0x1921+-0xdf5+-0x37*0x34),'',_0x16fb30);}__name(silentChangeUrl,'silentChangeUrl');function navigateWithReload(_0x18fe79,_0x4f41bc){const _0x9fb6ed=addQueryParamsToPath(_0x18fe79,_0x4f41bc);navigate(_0x9fb6ed);}__name(navigateWithReload,'navigateWithReload');function goBack(){window['history']['back']();}__name(goBack,'goBack');function getAbsoluteUrl(_0x3aafa7){const _0x3d145b=/^https?:\/\//,_0x3fe5a4=_0x3aafa7['trim']();let _0x53a848=_0x3aafa7;if(_0x3d145b['test'](_0x3fe5a4))_0x53a848=_0x3fe5a4;else !isLocalUrl(_0x3aafa7)&&(_0x53a848='//'+_0x3aafa7);return _0x53a848;}__name(getAbsoluteUrl,'getAbsoluteUrl');function getMailToUrl(_0x4b8cd2){return 'mailto:'+_0x4b8cd2;}__name(getMailToUrl,'getMailToUrl');const pathConstants={'basePath':'/'};function getRelativeUrl(_0x3fdc52){if(!_0x3fdc52['trim']())return pathConstants['basePath'];return ''+pathConstants['basePath']+_0x3fdc52;}__name(getRelativeUrl,'getRelativeUrl');function addSlashToUrlIfNeeded(_0x1a1338){if(_0x1a1338['startsWith'](slash)||_0x1a1338['startsWith'](httpProtocols['http']))return _0x1a1338;return ''+slash+_0x1a1338;}__name(addSlashToUrlIfNeeded,'addSlashToUrlIfNeeded');

export { addSlashToUrlIfNeeded, getAbsoluteUrl, getMailToUrl, getRelativeUrl, goBack, navigateWithReload, silentChangeUrl };
