function i(n,e){let t={color:null,icon:null,duration:5e3,"container-id":"ohsnap",context:document,"fade-duration":"fast"};e=typeof e=="object"?$.extend(t,e):t;let r=$("#"+e["container-id"],e.context),o="",c="";e.icon&&(o="<span class='"+e.icon+"'></span> "),e.color&&(c="ohsnap-alert-"+e.color);let l=$('<div class="ohsnap-alert '+c+'">'+o+n+"</div>").fadeIn(e["fade-duration"]);r.append(l),l.on("click",function(){s($(this))}),setTimeout(function(){s(l)},e.duration)}function s(n,e){let t={duration:"fast"};e=typeof e=="object"?$.extend(t,e):t,typeof n<"u"?n.fadeOut(e.duration,function(){$(this).remove()}):$(".ohsnap-alert").fadeOut(e.duration,function(){$(this).remove()})}function u(n,e={}){let t=window.FleetCart.langs[n];for(let r in e)t=t.replace(`:${r}`,e[r]);return t}function f(n){return Object.keys(FleetCart.permissions).includes(n)}function d(){const n=Math.floor(Math.random()*Date.now()).toString(36),e=Math.random().toString(36).substring(2,8);return(n+e).substring(0,12)}function m(){$(".fullscreen-mode-open").on("click",n=>{n.preventDefault(),document.fullscreenElement?($(".fullscreen-mode-open .fullscreen-two").removeClass("enter-full-screen"),$(".fullscreen-mode-open .fullscreen-one").addClass("exit-full-screen"),document.exitFullscreen().catch(e=>{alert(`Error attempting to disable full-screen mode: ${e.message} (${e.name})`)})):($(".fullscreen-mode-open .fullscreen-one").removeClass("exit-full-screen"),$(".fullscreen-mode-open .fullscreen-two").addClass("enter-full-screen"),document.documentElement.requestFullscreen().catch(e=>{alert(`Error attempting to enable full-screen mode: ${e.message} (${e.name})`)}))})}function p(n){$(document).keypressAction({actions:n})}function a(n,e,{duration:t=5e3,context:r=document}){i(e,{"container-id":"notification-toast",context:r,color:{info:"blue",success:"green",warning:"yellow",error:"red"}[n],duration:t})}function g(n,e){a("info",n,{duration:e})}function h(n,e){a("success",n,{duration:e})}function y(n,e){a("warning",n,{duration:e})}function w(n,e){a("error",n,{duration:e})}function x(n){let e="";return e=n.toLowerCase().replace(/e|é|è|ẽ|ẻ|ẹ|ê|ế|ề|ễ|ể|ệ/gi,"e"),e=e.replace(/a|á|à|ã|ả|ạ|ă|ắ|ằ|ẵ|ẳ|ặ|â|ấ|ầ|ẫ|ẩ|ậ/gi,"a"),e=e.replace(/o|ó|ò|õ|ỏ|ọ|ô|ố|ồ|ỗ|ổ|ộ|ơ|ớ|ờ|ỡ|ở|ợ/gi,"o"),e=e.replace(/u|ú|ù|ũ|ủ|ụ|ư|ứ|ừ|ữ|ử|ự/gi,"u"),e=e.replace(/ć|ĉ|č|ċ|ç/gi,"c"),e=e.replace(/î|ï|í|ī|į|ì/gi,"i"),e=e.replace(/\/|'|"|′|’|,|\?|\.|;|]|\[|\+|=|\$|%|&|<|>|:/g," "),e=e.replace(/đ/gi,"d"),e=e.replace(/\s*$/g,""),e=e.replace(/\s+/g,"-"),e}Array.prototype.remove||(Array.prototype.remove=function(){let n,e=arguments,t=e.length,r;for(;t&&this.length;)for(n=e[--t];(r=this.indexOf(n))!==-1;)this.splice(r,1);return this});String.prototype.format||(String.prototype.format=function(){return this.replace(/%(\d+)%/g,(n,e)=>typeof arguments[e]<"u"?arguments[e]:n)});export{x as a,w as e,m as f,d as g,f as h,g as i,p as k,a as n,h as s,u as t,y as w};
