(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(t,e="GSM_7BIT"){let n,s,i,g,h;n="WHATSAPP"===e?"WHATSAPP":this.detectEncoding(t),s=t.length,n===this.GSM_7BIT_EX&&(s+=this.countGsm7bitEx(t));for(let e=0;e<t.length;e++)switch(t[e]){case"[":case"]":case"\\":case"^":case"{":case"}":case"|":case"\n":s+=1}return g=this.messageLength[n],s>g&&(g=this.multiMessageLength[n]),i=Math.ceil(s/g),h=g*i-s,0===h&&0===i&&(h=g),{encoding:n,length:s,per_message:g,remaining:h,messages:i}},t.detectEncoding=function(t){switch(!1){case null==t.match(this.gsm7bitRegExp):return this.GSM_7BIT;case null==t.match(this.gsm7bitExRegExp):return this.GSM_7BIT_EX;default:return this.UTF16}},t.countGsm7bitEx=function(t){let e,n;return n=function(){let n,s,i;for(i=[],n=0,s=t.length;n<s;n++)e=t[n],null!=e.match(this.gsm7bitExOnlyRegExp)&&i.push(e);return i}.call(this),n.length},t}(),"undefined"!=typeof jQuery&&null!==jQuery&&(t=jQuery,t.fn.countSms=function(n){let s,i;return i=this,n=t(n),s=function(){let t,s,g,h;for(s in t=e.count(i.val()),h=[],t)g=t[s],h.push(n.find("."+s).text(g));return h},this.on("keyup",s),s()})}).call(this);
