(function(){let t,e;window.SmsCounter=e=function(){function t(){}return t.gsm7bitChars="@£$¥èéùìòÇ\nØø\rÅåΔ_ΦΓΛΩΠΨΣΘΞÆæßÉ !\"#¤%&'()*+,-./0123456789:;<=>?¡ABCDEFGHIJKLMNOPQRSTUVWXYZÄÖÑÜ§¿abcdefghijklmnopqrstuvwxyzäöñüà",t.gsm7bitExChar="^{}\\[~]|€",t.gsm7bitRegExp=RegExp("^["+t.gsm7bitChars+"]*$"),t.gsm7bitExRegExp=RegExp("^["+t.gsm7bitChars+t.gsm7bitExChar+"]*$"),t.gsm7bitExOnlyRegExp=RegExp("^["+t.gsm7bitExChar+"]*$"),t.GSM_7BIT="GSM_7BIT",t.GSM_7BIT_EX="GSM_7BIT_EX",t.UTF16="UTF16",t.WhatsApp="WHATSAPP",t.messageLength={GSM_7BIT:160,GSM_7BIT_EX:160,UTF16:70,WHATSAPP:1e3},t.multiMessageLength={GSM_7BIT:153,GSM_7BIT_EX:153,UTF16:67,WHATSAPP:1e3},t.count=function(e,n="GSM_7BIT"){let i,s,g,h,u=0;i="WHATSAPP"===n?"WHATSAPP":this.detectEncoding(e);for(let n=0;n<e.length;n++){const s=e[n];i===this.GSM_7BIT_EX&&t.gsm7bitExChar.includes(s)?u+=2:u+=1}return g=this.messageLength[i],u>g&&(g=this.multiMessageLength[i]),s=Math.ceil(u/g),h=g*s-u,0===h&&0===s&&(h=g),{encoding:i,length:u,per_message:g,remaining:h,messages:s}},t.detectEncoding=function(t){return t.match(this.gsm7bitRegExp)?this.GSM_7BIT:t.match(this.gsm7bitExRegExp)?this.GSM_7BIT_EX:this.UTF16},t.countGsm7bitEx=function(t){let e=0;for(let n=0;n<t.length;n++){const i=t[n];this.gsm7bitExChar.includes(i)&&e++}return e},t}(),"undefined"!=typeof jQuery&&null!==jQuery&&(t=jQuery,t.fn.countSms=function(n){let i,s;return s=this,n=t(n),i=function(){let t=e.count(s.val());for(let e in t){let i=t[e];n.find("."+e).text(i)}},this.on("keyup change input",i),i()})}).call(this);
