@pocketping/widget 1.5.2 → 1.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,9 +1,20 @@
1
- "use strict";var PocketPing=(()=>{var xe=Object.defineProperty;var nn=Object.getOwnPropertyDescriptor;var sn=Object.getOwnPropertyNames;var on=Object.prototype.hasOwnProperty;var rn=(t,e)=>{for(var n in e)xe(t,n,{get:e[n],enumerable:!0})},an=(t,e,n,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of sn(e))!on.call(t,i)&&i!==n&&xe(t,i,{get:()=>e[i],enumerable:!(s=nn(e,i))||s.enumerable});return t};var pn=t=>an(xe({},"__esModule",{value:!0}),t);var Mn={};rn(Mn,{close:()=>Tt,default:()=>In,destroy:()=>St,getIdentity:()=>Wt,getTrackedElements:()=>Ot,identify:()=>Ht,init:()=>Ae,offEvent:()=>Lt,on:()=>Nt,onEvent:()=>Dt,open:()=>Pt,reset:()=>Ft,sendMessage:()=>Mt,setupTrackedElements:()=>Rt,toggle:()=>It,trigger:()=>At,uploadFile:()=>Ct,uploadFiles:()=>$t});var pe,w,Xe,ln,J,je,Ye,Ge,Ke,ke,ye,be,cn,Z={},Qe=[],dn=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,le=Array.isArray;function V(t,e){for(var n in e)t[n]=e[n];return t}function Ee(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function Se(t,e,n){var s,i,a,r={};for(a in e)a=="key"?s=e[a]:a=="ref"?i=e[a]:r[a]=e[a];if(arguments.length>2&&(r.children=arguments.length>3?pe.call(arguments,2):n),typeof t=="function"&&t.defaultProps!=null)for(a in t.defaultProps)r[a]===void 0&&(r[a]=t.defaultProps[a]);return oe(t,r,s,i,null)}function oe(t,e,n,s,i){var a={type:t,props:e,key:n,ref:s,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:i??++Xe,__i:-1,__u:0};return i==null&&w.vnode!=null&&w.vnode(a),a}function D(t){return t.children}function re(t,e){this.props=t,this.context=e}function Y(t,e){if(e==null)return t.__?Y(t.__,t.__i+1):null;for(var n;e<t.__k.length;e++)if((n=t.__k[e])!=null&&n.__e!=null)return n.__e;return typeof t.type=="function"?Y(t):null}function Ze(t){var e,n;if((t=t.__)!=null&&t.__c!=null){for(t.__e=t.__c.base=null,e=0;e<t.__k.length;e++)if((n=t.__k[e])!=null&&n.__e!=null){t.__e=t.__c.base=n.__e;break}return Ze(t)}}function Be(t){(!t.__d&&(t.__d=!0)&&J.push(t)&&!ae.__r++||je!=w.debounceRendering)&&((je=w.debounceRendering)||Ye)(ae)}function ae(){for(var t,e,n,s,i,a,r,c=1;J.length;)J.length>c&&J.sort(Ge),t=J.shift(),c=J.length,t.__d&&(n=void 0,s=void 0,i=(s=(e=t).__v).__e,a=[],r=[],e.__P&&((n=V({},s)).__v=s.__v+1,w.vnode&&w.vnode(n),Pe(e.__P,n,s,e.__n,e.__P.namespaceURI,32&s.__u?[i]:null,a,i??Y(s),!!(32&s.__u),r),n.__v=s.__v,n.__.__k[n.__i]=n,nt(a,n,r),s.__e=s.__=null,n.__e!=i&&Ze(n)));ae.__r=0}function et(t,e,n,s,i,a,r,c,u,l,g){var p,h,f,E,A,k,x,b=s&&s.__k||Qe,H=e.length;for(u=un(n,e,b,u,H),p=0;p<H;p++)(f=n.__k[p])!=null&&(h=f.__i==-1?Z:b[f.__i]||Z,f.__i=p,k=Pe(t,f,h,i,a,r,c,u,l,g),E=f.__e,f.ref&&h.ref!=f.ref&&(h.ref&&Te(h.ref,null,f),g.push(f.ref,f.__c||E,f)),A==null&&E!=null&&(A=E),(x=!!(4&f.__u))||h.__k===f.__k?u=tt(f,u,t,x):typeof f.type=="function"&&k!==void 0?u=k:E&&(u=E.nextSibling),f.__u&=-7);return n.__e=A,u}function un(t,e,n,s,i){var a,r,c,u,l,g=n.length,p=g,h=0;for(t.__k=new Array(i),a=0;a<i;a++)(r=e[a])!=null&&typeof r!="boolean"&&typeof r!="function"?(typeof r=="string"||typeof r=="number"||typeof r=="bigint"||r.constructor==String?r=t.__k[a]=oe(null,r,null,null,null):le(r)?r=t.__k[a]=oe(D,{children:r},null,null,null):r.constructor===void 0&&r.__b>0?r=t.__k[a]=oe(r.type,r.props,r.key,r.ref?r.ref:null,r.__v):t.__k[a]=r,u=a+h,r.__=t,r.__b=t.__b+1,c=null,(l=r.__i=gn(r,n,u,p))!=-1&&(p--,(c=n[l])&&(c.__u|=2)),c==null||c.__v==null?(l==-1&&(i>g?h--:i<g&&h++),typeof r.type!="function"&&(r.__u|=4)):l!=u&&(l==u-1?h--:l==u+1?h++:(l>u?h--:h++,r.__u|=4))):t.__k[a]=null;if(p)for(a=0;a<g;a++)(c=n[a])!=null&&(2&c.__u)==0&&(c.__e==s&&(s=Y(c)),it(c,c));return s}function tt(t,e,n,s){var i,a;if(typeof t.type=="function"){for(i=t.__k,a=0;i&&a<i.length;a++)i[a]&&(i[a].__=t,e=tt(i[a],e,n,s));return e}t.__e!=e&&(s&&(e&&t.type&&!e.parentNode&&(e=Y(t)),n.insertBefore(t.__e,e||null)),e=t.__e);do e=e&&e.nextSibling;while(e!=null&&e.nodeType==8);return e}function gn(t,e,n,s){var i,a,r,c=t.key,u=t.type,l=e[n],g=l!=null&&(2&l.__u)==0;if(l===null&&c==null||g&&c==l.key&&u==l.type)return n;if(s>(g?1:0)){for(i=n-1,a=n+1;i>=0||a<e.length;)if((l=e[r=i>=0?i--:a++])!=null&&(2&l.__u)==0&&c==l.key&&u==l.type)return r}return-1}function qe(t,e,n){e[0]=="-"?t.setProperty(e,n??""):t[e]=n==null?"":typeof n!="number"||dn.test(e)?n:n+"px"}function ie(t,e,n,s,i){var a,r;e:if(e=="style")if(typeof n=="string")t.style.cssText=n;else{if(typeof s=="string"&&(t.style.cssText=s=""),s)for(e in s)n&&e in n||qe(t.style,e,"");if(n)for(e in n)s&&n[e]==s[e]||qe(t.style,e,n[e])}else if(e[0]=="o"&&e[1]=="n")a=e!=(e=e.replace(Ke,"$1")),r=e.toLowerCase(),e=r in t||e=="onFocusOut"||e=="onFocusIn"?r.slice(2):e.slice(2),t.l||(t.l={}),t.l[e+a]=n,n?s?n.u=s.u:(n.u=ke,t.addEventListener(e,a?be:ye,a)):t.removeEventListener(e,a?be:ye,a);else{if(i=="http://www.w3.org/2000/svg")e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(e!="width"&&e!="height"&&e!="href"&&e!="list"&&e!="form"&&e!="tabIndex"&&e!="download"&&e!="rowSpan"&&e!="colSpan"&&e!="role"&&e!="popover"&&e in t)try{t[e]=n??"";break e}catch{}typeof n=="function"||(n==null||n===!1&&e[4]!="-"?t.removeAttribute(e):t.setAttribute(e,e=="popover"&&n==1?"":n))}}function Je(t){return function(e){if(this.l){var n=this.l[e.type+t];if(e.t==null)e.t=ke++;else if(e.t<n.u)return;return n(w.event?w.event(e):e)}}}function Pe(t,e,n,s,i,a,r,c,u,l){var g,p,h,f,E,A,k,x,b,H,R,B,N,X,U,F,L,O=e.type;if(e.constructor!==void 0)return null;128&n.__u&&(u=!!(32&n.__u),a=[c=e.__e=n.__e]),(g=w.__b)&&g(e);e:if(typeof O=="function")try{if(x=e.props,b="prototype"in O&&O.prototype.render,H=(g=O.contextType)&&s[g.__c],R=g?H?H.props.value:g.__:s,n.__c?k=(p=e.__c=n.__c).__=p.__E:(b?e.__c=p=new O(x,R):(e.__c=p=new re(x,R),p.constructor=O,p.render=fn),H&&H.sub(p),p.state||(p.state={}),p.__n=s,h=p.__d=!0,p.__h=[],p._sb=[]),b&&p.__s==null&&(p.__s=p.state),b&&O.getDerivedStateFromProps!=null&&(p.__s==p.state&&(p.__s=V({},p.__s)),V(p.__s,O.getDerivedStateFromProps(x,p.__s))),f=p.props,E=p.state,p.__v=e,h)b&&O.getDerivedStateFromProps==null&&p.componentWillMount!=null&&p.componentWillMount(),b&&p.componentDidMount!=null&&p.__h.push(p.componentDidMount);else{if(b&&O.getDerivedStateFromProps==null&&x!==f&&p.componentWillReceiveProps!=null&&p.componentWillReceiveProps(x,R),e.__v==n.__v||!p.__e&&p.shouldComponentUpdate!=null&&p.shouldComponentUpdate(x,p.__s,R)===!1){for(e.__v!=n.__v&&(p.props=x,p.state=p.__s,p.__d=!1),e.__e=n.__e,e.__k=n.__k,e.__k.some(function(z){z&&(z.__=e)}),B=0;B<p._sb.length;B++)p.__h.push(p._sb[B]);p._sb=[],p.__h.length&&r.push(p);break e}p.componentWillUpdate!=null&&p.componentWillUpdate(x,p.__s,R),b&&p.componentDidUpdate!=null&&p.__h.push(function(){p.componentDidUpdate(f,E,A)})}if(p.context=R,p.props=x,p.__P=t,p.__e=!1,N=w.__r,X=0,b){for(p.state=p.__s,p.__d=!1,N&&N(e),g=p.render(p.props,p.state,p.context),U=0;U<p._sb.length;U++)p.__h.push(p._sb[U]);p._sb=[]}else do p.__d=!1,N&&N(e),g=p.render(p.props,p.state,p.context),p.state=p.__s;while(p.__d&&++X<25);p.state=p.__s,p.getChildContext!=null&&(s=V(V({},s),p.getChildContext())),b&&!h&&p.getSnapshotBeforeUpdate!=null&&(A=p.getSnapshotBeforeUpdate(f,E)),F=g,g!=null&&g.type===D&&g.key==null&&(F=st(g.props.children)),c=et(t,le(F)?F:[F],e,n,s,i,a,r,c,u,l),p.base=e.__e,e.__u&=-161,p.__h.length&&r.push(p),k&&(p.__E=p.__=null)}catch(z){if(e.__v=null,u||a!=null)if(z.then){for(e.__u|=u?160:128;c&&c.nodeType==8&&c.nextSibling;)c=c.nextSibling;a[a.indexOf(c)]=null,e.__e=c}else{for(L=a.length;L--;)Ee(a[L]);we(e)}else e.__e=n.__e,e.__k=n.__k,z.then||we(e);w.__e(z,e,n)}else a==null&&e.__v==n.__v?(e.__k=n.__k,e.__e=n.__e):c=e.__e=hn(n.__e,e,n,s,i,a,r,u,l);return(g=w.diffed)&&g(e),128&e.__u?void 0:c}function we(t){t&&t.__c&&(t.__c.__e=!0),t&&t.__k&&t.__k.forEach(we)}function nt(t,e,n){for(var s=0;s<n.length;s++)Te(n[s],n[++s],n[++s]);w.__c&&w.__c(e,t),t.some(function(i){try{t=i.__h,i.__h=[],t.some(function(a){a.call(i)})}catch(a){w.__e(a,i.__v)}})}function st(t){return typeof t!="object"||t==null||t.__b&&t.__b>0?t:le(t)?t.map(st):V({},t)}function hn(t,e,n,s,i,a,r,c,u){var l,g,p,h,f,E,A,k=n.props||Z,x=e.props,b=e.type;if(b=="svg"?i="http://www.w3.org/2000/svg":b=="math"?i="http://www.w3.org/1998/Math/MathML":i||(i="http://www.w3.org/1999/xhtml"),a!=null){for(l=0;l<a.length;l++)if((f=a[l])&&"setAttribute"in f==!!b&&(b?f.localName==b:f.nodeType==3)){t=f,a[l]=null;break}}if(t==null){if(b==null)return document.createTextNode(x);t=document.createElementNS(i,b,x.is&&x),c&&(w.__m&&w.__m(e,a),c=!1),a=null}if(b==null)k===x||c&&t.data==x||(t.data=x);else{if(a=a&&pe.call(t.childNodes),!c&&a!=null)for(k={},l=0;l<t.attributes.length;l++)k[(f=t.attributes[l]).name]=f.value;for(l in k)if(f=k[l],l!="children"){if(l=="dangerouslySetInnerHTML")p=f;else if(!(l in x)){if(l=="value"&&"defaultValue"in x||l=="checked"&&"defaultChecked"in x)continue;ie(t,l,null,f,i)}}for(l in x)f=x[l],l=="children"?h=f:l=="dangerouslySetInnerHTML"?g=f:l=="value"?E=f:l=="checked"?A=f:c&&typeof f!="function"||k[l]===f||ie(t,l,f,k[l],i);if(g)c||p&&(g.__html==p.__html||g.__html==t.innerHTML)||(t.innerHTML=g.__html),e.__k=[];else if(p&&(t.innerHTML=""),et(e.type=="template"?t.content:t,le(h)?h:[h],e,n,s,b=="foreignObject"?"http://www.w3.org/1999/xhtml":i,a,r,a?a[0]:n.__k&&Y(n,0),c,u),a!=null)for(l=a.length;l--;)Ee(a[l]);c||(l="value",b=="progress"&&E==null?t.removeAttribute("value"):E!=null&&(E!==t[l]||b=="progress"&&!E||b=="option"&&E!=k[l])&&ie(t,l,E,k[l],i),l="checked",A!=null&&A!=t[l]&&ie(t,l,A,k[l],i))}return t}function Te(t,e,n){try{if(typeof t=="function"){var s=typeof t.__u=="function";s&&t.__u(),s&&e==null||(t.__u=t(e))}else t.current=e}catch(i){w.__e(i,n)}}function it(t,e,n){var s,i;if(w.unmount&&w.unmount(t),(s=t.ref)&&(s.current&&s.current!=t.__e||Te(s,null,e)),(s=t.__c)!=null){if(s.componentWillUnmount)try{s.componentWillUnmount()}catch(a){w.__e(a,e)}s.base=s.__P=null}if(s=t.__k)for(i=0;i<s.length;i++)s[i]&&it(s[i],e,n||typeof t.type!="function");n||Ee(t.__e),t.__c=t.__=t.__e=void 0}function fn(t,e,n){return this.constructor(t,n)}function Ie(t,e,n){var s,i,a,r;e==document&&(e=document.documentElement),w.__&&w.__(t,e),i=(s=typeof n=="function")?null:n&&n.__k||e.__k,a=[],r=[],Pe(e,t=(!s&&n||e).__k=Se(D,null,[t]),i||Z,Z,e.namespaceURI,!s&&n?[n]:i?null:e.firstChild?pe.call(e.childNodes):null,a,!s&&n?n:i?i.__e:e.firstChild,s,r),nt(a,t,r)}pe=Qe.slice,w={__e:function(t,e,n,s){for(var i,a,r;e=e.__;)if((i=e.__c)&&!i.__)try{if((a=i.constructor)&&a.getDerivedStateFromError!=null&&(i.setState(a.getDerivedStateFromError(t)),r=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(t,s||{}),r=i.__d),r)return i.__E=i}catch(c){t=c}throw t}},Xe=0,ln=function(t){return t!=null&&t.constructor===void 0},re.prototype.setState=function(t,e){var n;n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=V({},this.state),typeof t=="function"&&(t=t(V({},n),this.props)),t&&V(n,t),t!=null&&this.__v&&(e&&this._sb.push(e),Be(this))},re.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),Be(this))},re.prototype.render=D,J=[],Ye=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Ge=function(t,e){return t.__v.__b-e.__v.__b},ae.__r=0,Ke=/(PointerCapture)$|Capture$/i,ke=0,ye=Je(!1),be=Je(!0),cn=0;var ee,M,Me,ot,te=0,gt=[],C=w,rt=C.__b,at=C.__r,pt=C.diffed,lt=C.__c,ct=C.unmount,dt=C.__;function $e(t,e){C.__h&&C.__h(M,t,te||e),te=0;var n=M.__H||(M.__H={__:[],__h:[]});return t>=n.__.length&&n.__.push({}),n.__[t]}function $(t){return te=1,mn(_t,t)}function mn(t,e,n){var s=$e(ee++,2);if(s.t=t,!s.__c&&(s.__=[n?n(e):_t(void 0,e),function(c){var u=s.__N?s.__N[0]:s.__[0],l=s.t(u,c);u!==l&&(s.__N=[l,s.__[1]],s.__c.setState({}))}],s.__c=M,!M.__f)){var i=function(c,u,l){if(!s.__c.__H)return!0;var g=s.__c.__H.__.filter(function(h){return!!h.__c});if(g.every(function(h){return!h.__N}))return!a||a.call(this,c,u,l);var p=s.__c.props!==c;return g.forEach(function(h){if(h.__N){var f=h.__[0];h.__=h.__N,h.__N=void 0,f!==h.__[0]&&(p=!0)}}),a&&a.call(this,c,u,l)||p};M.__f=!0;var a=M.shouldComponentUpdate,r=M.componentWillUpdate;M.componentWillUpdate=function(c,u,l){if(this.__e){var g=a;a=void 0,i(c,u,l),a=g}r&&r.call(this,c,u,l)},M.shouldComponentUpdate=i}return s.__N||s.__}function j(t,e){var n=$e(ee++,3);!C.__s&&mt(n.__H,e)&&(n.__=t,n.u=e,M.__H.__h.push(n))}function G(t){return te=5,ht(function(){return{current:t}},[])}function ht(t,e){var n=$e(ee++,7);return mt(n.__H,e)&&(n.__=t(),n.__H=e,n.__h=t),n.__}function ft(t,e){return te=8,ht(function(){return t},e)}function _n(){for(var t;t=gt.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(ce),t.__H.__h.forEach(Ce),t.__H.__h=[]}catch(e){t.__H.__h=[],C.__e(e,t.__v)}}C.__b=function(t){M=null,rt&&rt(t)},C.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),dt&&dt(t,e)},C.__r=function(t){at&&at(t),ee=0;var e=(M=t.__c).__H;e&&(Me===M?(e.__h=[],M.__h=[],e.__.forEach(function(n){n.__N&&(n.__=n.__N),n.u=n.__N=void 0})):(e.__h.forEach(ce),e.__h.forEach(Ce),e.__h=[],ee=0)),Me=M},C.diffed=function(t){pt&&pt(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(gt.push(e)!==1&&ot===C.requestAnimationFrame||((ot=C.requestAnimationFrame)||vn)(_n)),e.__H.__.forEach(function(n){n.u&&(n.__H=n.u),n.u=void 0})),Me=M=null},C.__c=function(t,e){e.some(function(n){try{n.__h.forEach(ce),n.__h=n.__h.filter(function(s){return!s.__||Ce(s)})}catch(s){e.some(function(i){i.__h&&(i.__h=[])}),e=[],C.__e(s,n.__v)}}),lt&&lt(t,e)},C.unmount=function(t){ct&&ct(t);var e,n=t.__c;n&&n.__H&&(n.__H.__.forEach(function(s){try{ce(s)}catch(i){e=i}}),n.__H=void 0,e&&C.__e(e,n.__v))};var ut=typeof requestAnimationFrame=="function";function vn(t){var e,n=function(){clearTimeout(s),ut&&cancelAnimationFrame(e),setTimeout(t)},s=setTimeout(n,35);ut&&(e=requestAnimationFrame(n))}function ce(t){var e=M,n=t.__c;typeof n=="function"&&(t.__c=void 0,n()),M=e}function Ce(t){var e=M;t.__c=t.__(),M=e}function mt(t,e){return!t||t.length!==e.length||e.some(function(n,s){return n!==t[s]})}function _t(t,e){return typeof e=="function"?e(t):e}function vt(t,e){let n=e==="dark",s={bg:n?"#1f2937":"#ffffff",bgSecondary:n?"#374151":"#f3f4f6",text:n?"#f9fafb":"#111827",textSecondary:n?"#9ca3af":"#6b7280",border:n?"#4b5563":"#e5e7eb",messageBg:n?"#374151":"#f3f4f6"};return`
1
+ "use strict";var PocketPing=(()=>{var vt=Object.defineProperty;var yo=Object.getOwnPropertyDescriptor;var vo=Object.getOwnPropertyNames;var bo=Object.prototype.hasOwnProperty;var _o=(t,e)=>{for(var n in e)vt(t,n,{get:e[n],enumerable:!0})},xo=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of vo(e))!bo.call(t,o)&&o!==n&&vt(t,o,{get:()=>e[o],enumerable:!(r=yo(e,o))||r.enumerable});return t};var wo=t=>xo(vt({},"__esModule",{value:!0}),t);var Dd={};_o(Dd,{close:()=>Lr,default:()=>Rd,destroy:()=>Rr,getIdentity:()=>qr,getTrackedElements:()=>Vr,identify:()=>Xr,init:()=>pn,offEvent:()=>Kr,on:()=>Jr,onEvent:()=>zr,open:()=>Dr,reset:()=>Yr,sendMessage:()=>Hr,setupTrackedElements:()=>Wr,toggle:()=>Ur,trigger:()=>Gr,uploadFile:()=>jr,uploadFiles:()=>Br});var Ze,N,xn,Po,de,yn,wn,Pn,Cn,wt,bt,_t,Co,_e={},En=[],Eo=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Qe=Array.isArray;function ne(t,e){for(var n in e)t[n]=e[n];return t}function Pt(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function Ct(t,e,n){var r,o,i,d={};for(i in e)i=="key"?r=e[i]:i=="ref"?o=e[i]:d[i]=e[i];if(arguments.length>2&&(d.children=arguments.length>3?Ze.call(arguments,2):n),typeof t=="function"&&t.defaultProps!=null)for(i in t.defaultProps)d[i]===void 0&&(d[i]=t.defaultProps[i]);return Ye(t,d,r,o,null)}function Ye(t,e,n,r,o){var i={type:t,props:e,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:o??++xn,__i:-1,__u:0};return o==null&&N.vnode!=null&&N.vnode(i),i}function M(t){return t.children}function qe(t,e){this.props=t,this.context=e}function ue(t,e){if(e==null)return t.__?ue(t.__,t.__i+1):null;for(var n;e<t.__k.length;e++)if((n=t.__k[e])!=null&&n.__e!=null)return n.__e;return typeof t.type=="function"?ue(t):null}function Sn(t){var e,n;if((t=t.__)!=null&&t.__c!=null){for(t.__e=t.__c.base=null,e=0;e<t.__k.length;e++)if((n=t.__k[e])!=null&&n.__e!=null){t.__e=t.__c.base=n.__e;break}return Sn(t)}}function vn(t){(!t.__d&&(t.__d=!0)&&de.push(t)&&!Je.__r++||yn!=N.debounceRendering)&&((yn=N.debounceRendering)||wn)(Je)}function Je(){for(var t,e,n,r,o,i,d,l=1;de.length;)de.length>l&&de.sort(Pn),t=de.shift(),l=de.length,t.__d&&(n=void 0,r=void 0,o=(r=(e=t).__v).__e,i=[],d=[],e.__P&&((n=ne({},r)).__v=r.__v+1,N.vnode&&N.vnode(n),Et(e.__P,n,r,e.__n,e.__P.namespaceURI,32&r.__u?[o]:null,i,o??ue(r),!!(32&r.__u),d),n.__v=r.__v,n.__.__k[n.__i]=n,In(i,n,d),r.__e=r.__=null,n.__e!=o&&Sn(n)));Je.__r=0}function kn(t,e,n,r,o,i,d,l,p,a,$){var c,f,h,w,T,E,g,_=r&&r.__k||En,H=e.length;for(p=So(n,e,_,p,H),c=0;c<H;c++)(h=n.__k[c])!=null&&(f=h.__i==-1?_e:_[h.__i]||_e,h.__i=c,E=Et(t,h,f,o,i,d,l,p,a,$),w=h.__e,h.ref&&f.ref!=h.ref&&(f.ref&&St(f.ref,null,h),$.push(h.ref,h.__c||w,h)),T==null&&w!=null&&(T=w),(g=!!(4&h.__u))||f.__k===h.__k?p=Nn(h,p,t,g):typeof h.type=="function"&&E!==void 0?p=E:w&&(p=w.nextSibling),h.__u&=-7);return n.__e=T,p}function So(t,e,n,r,o){var i,d,l,p,a,$=n.length,c=$,f=0;for(t.__k=new Array(o),i=0;i<o;i++)(d=e[i])!=null&&typeof d!="boolean"&&typeof d!="function"?(typeof d=="string"||typeof d=="number"||typeof d=="bigint"||d.constructor==String?d=t.__k[i]=Ye(null,d,null,null,null):Qe(d)?d=t.__k[i]=Ye(M,{children:d},null,null,null):d.constructor===void 0&&d.__b>0?d=t.__k[i]=Ye(d.type,d.props,d.key,d.ref?d.ref:null,d.__v):t.__k[i]=d,p=i+f,d.__=t,d.__b=t.__b+1,l=null,(a=d.__i=ko(d,n,p,c))!=-1&&(c--,(l=n[a])&&(l.__u|=2)),l==null||l.__v==null?(a==-1&&(o>$?f--:o<$&&f++),typeof d.type!="function"&&(d.__u|=4)):a!=p&&(a==p-1?f--:a==p+1?f++:(a>p?f--:f++,d.__u|=4))):t.__k[i]=null;if(c)for(i=0;i<$;i++)(l=n[i])!=null&&(2&l.__u)==0&&(l.__e==r&&(r=ue(l)),An(l,l));return r}function Nn(t,e,n,r){var o,i;if(typeof t.type=="function"){for(o=t.__k,i=0;o&&i<o.length;i++)o[i]&&(o[i].__=t,e=Nn(o[i],e,n,r));return e}t.__e!=e&&(r&&(e&&t.type&&!e.parentNode&&(e=ue(t)),n.insertBefore(t.__e,e||null)),e=t.__e);do e=e&&e.nextSibling;while(e!=null&&e.nodeType==8);return e}function ko(t,e,n,r){var o,i,d,l=t.key,p=t.type,a=e[n],$=a!=null&&(2&a.__u)==0;if(a===null&&l==null||$&&l==a.key&&p==a.type)return n;if(r>($?1:0)){for(o=n-1,i=n+1;o>=0||i<e.length;)if((a=e[d=o>=0?o--:i++])!=null&&(2&a.__u)==0&&l==a.key&&p==a.type)return d}return-1}function bn(t,e,n){e[0]=="-"?t.setProperty(e,n??""):t[e]=n==null?"":typeof n!="number"||Eo.test(e)?n:n+"px"}function Xe(t,e,n,r,o){var i,d;e:if(e=="style")if(typeof n=="string")t.style.cssText=n;else{if(typeof r=="string"&&(t.style.cssText=r=""),r)for(e in r)n&&e in n||bn(t.style,e,"");if(n)for(e in n)r&&n[e]==r[e]||bn(t.style,e,n[e])}else if(e[0]=="o"&&e[1]=="n")i=e!=(e=e.replace(Cn,"$1")),d=e.toLowerCase(),e=d in t||e=="onFocusOut"||e=="onFocusIn"?d.slice(2):e.slice(2),t.l||(t.l={}),t.l[e+i]=n,n?r?n.u=r.u:(n.u=wt,t.addEventListener(e,i?_t:bt,i)):t.removeEventListener(e,i?_t:bt,i);else{if(o=="http://www.w3.org/2000/svg")e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(e!="width"&&e!="height"&&e!="href"&&e!="list"&&e!="form"&&e!="tabIndex"&&e!="download"&&e!="rowSpan"&&e!="colSpan"&&e!="role"&&e!="popover"&&e in t)try{t[e]=n??"";break e}catch{}typeof n=="function"||(n==null||n===!1&&e[4]!="-"?t.removeAttribute(e):t.setAttribute(e,e=="popover"&&n==1?"":n))}}function _n(t){return function(e){if(this.l){var n=this.l[e.type+t];if(e.t==null)e.t=wt++;else if(e.t<n.u)return;return n(N.event?N.event(e):e)}}}function Et(t,e,n,r,o,i,d,l,p,a){var $,c,f,h,w,T,E,g,_,H,R,X,j,J,B,z,G,D=e.type;if(e.constructor!==void 0)return null;128&n.__u&&(p=!!(32&n.__u),i=[l=e.__e=n.__e]),($=N.__b)&&$(e);e:if(typeof D=="function")try{if(g=e.props,_="prototype"in D&&D.prototype.render,H=($=D.contextType)&&r[$.__c],R=$?H?H.props.value:$.__:r,n.__c?E=(c=e.__c=n.__c).__=c.__E:(_?e.__c=c=new D(g,R):(e.__c=c=new qe(g,R),c.constructor=D,c.render=Io),H&&H.sub(c),c.state||(c.state={}),c.__n=r,f=c.__d=!0,c.__h=[],c._sb=[]),_&&c.__s==null&&(c.__s=c.state),_&&D.getDerivedStateFromProps!=null&&(c.__s==c.state&&(c.__s=ne({},c.__s)),ne(c.__s,D.getDerivedStateFromProps(g,c.__s))),h=c.props,w=c.state,c.__v=e,f)_&&D.getDerivedStateFromProps==null&&c.componentWillMount!=null&&c.componentWillMount(),_&&c.componentDidMount!=null&&c.__h.push(c.componentDidMount);else{if(_&&D.getDerivedStateFromProps==null&&g!==h&&c.componentWillReceiveProps!=null&&c.componentWillReceiveProps(g,R),e.__v==n.__v||!c.__e&&c.shouldComponentUpdate!=null&&c.shouldComponentUpdate(g,c.__s,R)===!1){for(e.__v!=n.__v&&(c.props=g,c.state=c.__s,c.__d=!1),e.__e=n.__e,e.__k=n.__k,e.__k.some(function(K){K&&(K.__=e)}),X=0;X<c._sb.length;X++)c.__h.push(c._sb[X]);c._sb=[],c.__h.length&&d.push(c);break e}c.componentWillUpdate!=null&&c.componentWillUpdate(g,c.__s,R),_&&c.componentDidUpdate!=null&&c.__h.push(function(){c.componentDidUpdate(h,w,T)})}if(c.context=R,c.props=g,c.__P=t,c.__e=!1,j=N.__r,J=0,_){for(c.state=c.__s,c.__d=!1,j&&j(e),$=c.render(c.props,c.state,c.context),B=0;B<c._sb.length;B++)c.__h.push(c._sb[B]);c._sb=[]}else do c.__d=!1,j&&j(e),$=c.render(c.props,c.state,c.context),c.state=c.__s;while(c.__d&&++J<25);c.state=c.__s,c.getChildContext!=null&&(r=ne(ne({},r),c.getChildContext())),_&&!f&&c.getSnapshotBeforeUpdate!=null&&(T=c.getSnapshotBeforeUpdate(h,w)),z=$,$!=null&&$.type===M&&$.key==null&&(z=Tn($.props.children)),l=kn(t,Qe(z)?z:[z],e,n,r,o,i,d,l,p,a),c.base=e.__e,e.__u&=-161,c.__h.length&&d.push(c),E&&(c.__E=c.__=null)}catch(K){if(e.__v=null,p||i!=null)if(K.then){for(e.__u|=p?160:128;l&&l.nodeType==8&&l.nextSibling;)l=l.nextSibling;i[i.indexOf(l)]=null,e.__e=l}else{for(G=i.length;G--;)Pt(i[G]);xt(e)}else e.__e=n.__e,e.__k=n.__k,K.then||xt(e);N.__e(K,e,n)}else i==null&&e.__v==n.__v?(e.__k=n.__k,e.__e=n.__e):l=e.__e=No(n.__e,e,n,r,o,i,d,p,a);return($=N.diffed)&&$(e),128&e.__u?void 0:l}function xt(t){t&&t.__c&&(t.__c.__e=!0),t&&t.__k&&t.__k.forEach(xt)}function In(t,e,n){for(var r=0;r<n.length;r++)St(n[r],n[++r],n[++r]);N.__c&&N.__c(e,t),t.some(function(o){try{t=o.__h,o.__h=[],t.some(function(i){i.call(o)})}catch(i){N.__e(i,o.__v)}})}function Tn(t){return typeof t!="object"||t==null||t.__b&&t.__b>0?t:Qe(t)?t.map(Tn):ne({},t)}function No(t,e,n,r,o,i,d,l,p){var a,$,c,f,h,w,T,E=n.props||_e,g=e.props,_=e.type;if(_=="svg"?o="http://www.w3.org/2000/svg":_=="math"?o="http://www.w3.org/1998/Math/MathML":o||(o="http://www.w3.org/1999/xhtml"),i!=null){for(a=0;a<i.length;a++)if((h=i[a])&&"setAttribute"in h==!!_&&(_?h.localName==_:h.nodeType==3)){t=h,i[a]=null;break}}if(t==null){if(_==null)return document.createTextNode(g);t=document.createElementNS(o,_,g.is&&g),l&&(N.__m&&N.__m(e,i),l=!1),i=null}if(_==null)E===g||l&&t.data==g||(t.data=g);else{if(i=i&&Ze.call(t.childNodes),!l&&i!=null)for(E={},a=0;a<t.attributes.length;a++)E[(h=t.attributes[a]).name]=h.value;for(a in E)if(h=E[a],a!="children"){if(a=="dangerouslySetInnerHTML")c=h;else if(!(a in g)){if(a=="value"&&"defaultValue"in g||a=="checked"&&"defaultChecked"in g)continue;Xe(t,a,null,h,o)}}for(a in g)h=g[a],a=="children"?f=h:a=="dangerouslySetInnerHTML"?$=h:a=="value"?w=h:a=="checked"?T=h:l&&typeof h!="function"||E[a]===h||Xe(t,a,h,E[a],o);if($)l||c&&($.__html==c.__html||$.__html==t.innerHTML)||(t.innerHTML=$.__html),e.__k=[];else if(c&&(t.innerHTML=""),kn(e.type=="template"?t.content:t,Qe(f)?f:[f],e,n,r,_=="foreignObject"?"http://www.w3.org/1999/xhtml":o,i,d,i?i[0]:n.__k&&ue(n,0),l,p),i!=null)for(a=i.length;a--;)Pt(i[a]);l||(a="value",_=="progress"&&w==null?t.removeAttribute("value"):w!=null&&(w!==t[a]||_=="progress"&&!w||_=="option"&&w!=E[a])&&Xe(t,a,w,E[a],o),a="checked",T!=null&&T!=t[a]&&Xe(t,a,T,E[a],o))}return t}function St(t,e,n){try{if(typeof t=="function"){var r=typeof t.__u=="function";r&&t.__u(),r&&e==null||(t.__u=t(e))}else t.current=e}catch(o){N.__e(o,n)}}function An(t,e,n){var r,o;if(N.unmount&&N.unmount(t),(r=t.ref)&&(r.current&&r.current!=t.__e||St(r,null,e)),(r=t.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(i){N.__e(i,e)}r.base=r.__P=null}if(r=t.__k)for(o=0;o<r.length;o++)r[o]&&An(r[o],e,n||typeof t.type!="function");n||Pt(t.__e),t.__c=t.__=t.__e=void 0}function Io(t,e,n){return this.constructor(t,n)}function kt(t,e,n){var r,o,i,d;e==document&&(e=document.documentElement),N.__&&N.__(t,e),o=(r=typeof n=="function")?null:n&&n.__k||e.__k,i=[],d=[],Et(e,t=(!r&&n||e).__k=Ct(M,null,[t]),o||_e,_e,e.namespaceURI,!r&&n?[n]:o?null:e.firstChild?Ze.call(e.childNodes):null,i,!r&&n?n:o?o.__e:e.firstChild,r,d),In(i,t,d)}Ze=En.slice,N={__e:function(t,e,n,r){for(var o,i,d;e=e.__;)if((o=e.__c)&&!o.__)try{if((i=o.constructor)&&i.getDerivedStateFromError!=null&&(o.setState(i.getDerivedStateFromError(t)),d=o.__d),o.componentDidCatch!=null&&(o.componentDidCatch(t,r||{}),d=o.__d),d)return o.__E=o}catch(l){t=l}throw t}},xn=0,Po=function(t){return t!=null&&t.constructor===void 0},qe.prototype.setState=function(t,e){var n;n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=ne({},this.state),typeof t=="function"&&(t=t(ne({},n),this.props)),t&&ne(n,t),t!=null&&this.__v&&(e&&this._sb.push(e),vn(this))},qe.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),vn(this))},qe.prototype.render=M,de=[],wn=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Pn=function(t,e){return t.__v.__b-e.__v.__b},Je.__r=0,Cn=/(PointerCapture)$|Capture$/i,wt=0,bt=_n(!1),_t=_n(!0),Co=0;var xe,F,Nt,On,we=0,jn=[],L=N,Mn=L.__b,Fn=L.__r,Rn=L.diffed,Dn=L.__c,Ln=L.unmount,Un=L.__;function Tt(t,e){L.__h&&L.__h(F,t,we||e),we=0;var n=F.__H||(F.__H={__:[],__h:[]});return t>=n.__.length&&n.__.push({}),n.__[t]}function C(t){return we=1,To(Vn,t)}function To(t,e,n){var r=Tt(xe++,2);if(r.t=t,!r.__c&&(r.__=[n?n(e):Vn(void 0,e),function(l){var p=r.__N?r.__N[0]:r.__[0],a=r.t(p,l);p!==a&&(r.__N=[a,r.__[1]],r.__c.setState({}))}],r.__c=F,!F.__f)){var o=function(l,p,a){if(!r.__c.__H)return!0;var $=r.__c.__H.__.filter(function(f){return!!f.__c});if($.every(function(f){return!f.__N}))return!i||i.call(this,l,p,a);var c=r.__c.props!==l;return $.forEach(function(f){if(f.__N){var h=f.__[0];f.__=f.__N,f.__N=void 0,h!==f.__[0]&&(c=!0)}}),i&&i.call(this,l,p,a)||c};F.__f=!0;var i=F.shouldComponentUpdate,d=F.componentWillUpdate;F.componentWillUpdate=function(l,p,a){if(this.__e){var $=i;i=void 0,o(l,p,a),i=$}d&&d.call(this,l,p,a)},F.shouldComponentUpdate=o}return r.__N||r.__}function Y(t,e){var n=Tt(xe++,3);!L.__s&&Wn(n.__H,e)&&(n.__=t,n.u=e,F.__H.__h.push(n))}function Q(t){return we=5,Bn(function(){return{current:t}},[])}function Bn(t,e){var n=Tt(xe++,7);return Wn(n.__H,e)&&(n.__=t(),n.__H=e,n.__h=t),n.__}function Gn(t,e){return we=8,Bn(function(){return t},e)}function Ao(){for(var t;t=jn.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(et),t.__H.__h.forEach(It),t.__H.__h=[]}catch(e){t.__H.__h=[],L.__e(e,t.__v)}}L.__b=function(t){F=null,Mn&&Mn(t)},L.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),Un&&Un(t,e)},L.__r=function(t){Fn&&Fn(t),xe=0;var e=(F=t.__c).__H;e&&(Nt===F?(e.__h=[],F.__h=[],e.__.forEach(function(n){n.__N&&(n.__=n.__N),n.u=n.__N=void 0})):(e.__h.forEach(et),e.__h.forEach(It),e.__h=[],xe=0)),Nt=F},L.diffed=function(t){Rn&&Rn(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(jn.push(e)!==1&&On===L.requestAnimationFrame||((On=L.requestAnimationFrame)||Oo)(Ao)),e.__H.__.forEach(function(n){n.u&&(n.__H=n.u),n.u=void 0})),Nt=F=null},L.__c=function(t,e){e.some(function(n){try{n.__h.forEach(et),n.__h=n.__h.filter(function(r){return!r.__||It(r)})}catch(r){e.some(function(o){o.__h&&(o.__h=[])}),e=[],L.__e(r,n.__v)}}),Dn&&Dn(t,e)},L.unmount=function(t){Ln&&Ln(t);var e,n=t.__c;n&&n.__H&&(n.__H.__.forEach(function(r){try{et(r)}catch(o){e=o}}),n.__H=void 0,e&&L.__e(e,n.__v))};var Hn=typeof requestAnimationFrame=="function";function Oo(t){var e,n=function(){clearTimeout(r),Hn&&cancelAnimationFrame(e),setTimeout(t)},r=setTimeout(n,35);Hn&&(e=requestAnimationFrame(n))}function et(t){var e=F,n=t.__c;typeof n=="function"&&(t.__c=void 0,n()),F=e}function It(t){var e=F;t.__c=t.__(),F=e}function Wn(t,e){return!t||t.length!==e.length||e.some(function(n,r){return n!==t[r]})}function Vn(t,e){return typeof e=="function"?e(t):e}function zn(t,e){let n=e==="dark",r={bg:n?"#1f2937":"#ffffff",bgSecondary:n?"#374151":"#f3f4f6",text:n?"#f9fafb":"#111827",textSecondary:n?"#9ca3af":"#6b7280",border:n?"#4b5563":"#e5e7eb",messageBg:n?"#374151":"#f3f4f6"};return`
2
2
  #pocketping-container {
3
3
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
4
4
  font-size: 14px;
5
5
  line-height: 1.5;
6
- color: ${s.text};
6
+ color: ${r.text};
7
+ }
8
+
9
+ #pocketping-container,
10
+ #pocketping-container * {
11
+ box-sizing: border-box;
12
+ }
13
+
14
+ #pocketping-container img,
15
+ #pocketping-container video {
16
+ max-width: 100%;
17
+ height: auto;
7
18
  }
8
19
 
9
20
  .pp-toggle {
@@ -85,7 +96,7 @@
85
96
  height: 520px;
86
97
  max-height: calc(100vh - 100px);
87
98
  max-height: calc(100dvh - 100px);
88
- background: ${s.bg};
99
+ background: ${r.bg};
89
100
  border-radius: 16px;
90
101
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
91
102
  display: flex;
@@ -130,7 +141,7 @@
130
141
  display: flex;
131
142
  align-items: center;
132
143
  justify-content: space-between;
133
- padding: 16px;
144
+ padding: 12px 14px;
134
145
  background: ${t};
135
146
  color: white;
136
147
  }
@@ -138,24 +149,24 @@
138
149
  .pp-header-info {
139
150
  display: flex;
140
151
  align-items: center;
141
- gap: 12px;
152
+ gap: 10px;
142
153
  }
143
154
 
144
155
  .pp-avatar {
145
- width: 40px;
146
- height: 40px;
156
+ width: 36px;
157
+ height: 36px;
147
158
  border-radius: 50%;
148
159
  object-fit: cover;
149
160
  }
150
161
 
151
162
  .pp-header-title {
152
163
  font-weight: 600;
153
- font-size: 16px;
164
+ font-size: 15px;
154
165
  }
155
166
 
156
167
  .pp-header-status {
157
- font-size: 12px;
158
- opacity: 0.9;
168
+ font-size: 11px;
169
+ opacity: 0.85;
159
170
  display: flex;
160
171
  align-items: center;
161
172
  gap: 4px;
@@ -201,37 +212,131 @@
201
212
  .pp-messages {
202
213
  flex: 1;
203
214
  overflow-y: auto;
204
- padding: 16px;
215
+ padding: 32px 12px 12px 12px;
205
216
  display: flex;
206
217
  flex-direction: column;
207
- gap: 12px;
218
+ gap: 3px;
219
+ overscroll-behavior: contain;
220
+ -webkit-overflow-scrolling: touch;
221
+ /* Ensure proper stacking context for positioned elements */
222
+ position: relative;
208
223
  }
209
224
 
210
225
  .pp-welcome {
211
226
  text-align: center;
212
- color: ${s.textSecondary};
227
+ color: ${r.textSecondary};
213
228
  padding: 24px;
214
229
  font-size: 13px;
215
230
  }
216
231
 
232
+ .pp-date-separator {
233
+ display: flex;
234
+ align-items: center;
235
+ justify-content: center;
236
+ margin: 16px 0 12px;
237
+ }
238
+
239
+ .pp-date-separator span {
240
+ background: ${r.bgSecondary};
241
+ color: ${r.textSecondary};
242
+ font-size: 11px;
243
+ padding: 4px 12px;
244
+ border-radius: 12px;
245
+ font-weight: 500;
246
+ }
247
+
248
+ /* Swipe container for mobile actions */
249
+ .pp-message-swipe-container {
250
+ position: relative;
251
+ display: flex;
252
+ align-items: stretch;
253
+ overflow: visible;
254
+ touch-action: pan-y;
255
+ }
256
+
257
+ .pp-swipe-left {
258
+ justify-content: flex-end;
259
+ }
260
+
261
+ .pp-swipe-right {
262
+ justify-content: flex-start;
263
+ }
264
+
265
+ .pp-swipe-actions {
266
+ position: absolute;
267
+ right: 0;
268
+ top: 0;
269
+ bottom: 0;
270
+ display: flex;
271
+ align-items: center;
272
+ gap: 4px;
273
+ padding-right: 8px;
274
+ }
275
+
276
+ .pp-swipe-left .pp-swipe-actions {
277
+ right: 0;
278
+ left: auto;
279
+ }
280
+
281
+ .pp-swipe-right .pp-swipe-actions {
282
+ left: 0;
283
+ right: auto;
284
+ padding-left: 8px;
285
+ padding-right: 0;
286
+ }
287
+
288
+ .pp-swipe-action {
289
+ width: 32px;
290
+ height: 32px;
291
+ border: none;
292
+ border-radius: 50%;
293
+ cursor: pointer;
294
+ display: flex;
295
+ align-items: center;
296
+ justify-content: center;
297
+ opacity: 0.9;
298
+ }
299
+
300
+ .pp-swipe-action svg {
301
+ width: 16px;
302
+ height: 16px;
303
+ }
304
+
305
+ .pp-swipe-reply {
306
+ background: ${t};
307
+ }
308
+
309
+ .pp-swipe-edit {
310
+ background: #3b82f6;
311
+ }
312
+
313
+ .pp-swipe-delete {
314
+ background: #ef4444;
315
+ }
316
+
217
317
  .pp-message {
218
- max-width: 80%;
219
- padding: 10px 14px;
220
- border-radius: 16px;
318
+ max-width: 85%;
319
+ padding: 6px 10px;
320
+ border-radius: 12px;
221
321
  word-wrap: break-word;
222
322
  position: relative;
223
323
  user-select: text;
224
324
  -webkit-user-select: text;
325
+ font-size: 14px;
326
+ line-height: 1.35;
327
+ display: flex;
328
+ flex-direction: column;
329
+ will-change: transform;
225
330
  }
226
331
 
227
332
  /* Hover actions container - positioned above message (Slack style) */
228
333
  .pp-message-actions {
229
334
  position: absolute;
230
- top: -28px;
335
+ top: -32px;
231
336
  display: flex;
232
337
  gap: 2px;
233
- background: ${s.bg};
234
- border: 1px solid ${s.border};
338
+ background: ${r.bg};
339
+ border: 1px solid ${r.border};
235
340
  border-radius: 6px;
236
341
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
237
342
  padding: 2px;
@@ -239,7 +344,9 @@
239
344
  animation: pp-actions-fade-in 0.12s ease forwards;
240
345
  z-index: 10;
241
346
  /* Reset color inheritance from message */
242
- color: ${s.textSecondary};
347
+ color: ${r.textSecondary};
348
+ /* Ensure actions don't interfere with layout */
349
+ pointer-events: auto;
243
350
  }
244
351
 
245
352
  @keyframes pp-actions-fade-in {
@@ -267,23 +374,23 @@
267
374
  display: flex;
268
375
  align-items: center;
269
376
  justify-content: center;
270
- color: ${s.textSecondary} !important;
377
+ color: ${r.textSecondary} !important;
271
378
  transition: background 0.1s, color 0.1s;
272
379
  }
273
380
 
274
381
  .pp-message-actions .pp-action-btn:hover {
275
- background: ${s.bgSecondary};
276
- color: ${s.text} !important;
382
+ background: ${r.bgSecondary};
383
+ color: ${r.text} !important;
277
384
  }
278
385
 
279
386
  .pp-message-actions .pp-action-btn svg {
280
387
  width: 14px;
281
388
  height: 14px;
282
- stroke: ${s.textSecondary};
389
+ stroke: ${r.textSecondary};
283
390
  }
284
391
 
285
392
  .pp-message-actions .pp-action-btn:hover svg {
286
- stroke: ${s.text};
393
+ stroke: ${r.text};
287
394
  }
288
395
 
289
396
  .pp-message-actions .pp-action-delete:hover {
@@ -313,27 +420,41 @@
313
420
  align-self: flex-end;
314
421
  background: ${t};
315
422
  color: white;
316
- border-bottom-right-radius: 4px;
423
+ border-bottom-right-radius: 3px;
424
+ margin-left: 32px;
317
425
  }
318
426
 
319
427
  .pp-message-operator,
320
428
  .pp-message-ai {
321
429
  align-self: flex-start;
322
- background: ${s.messageBg};
323
- color: ${s.text};
324
- border-bottom-left-radius: 4px;
430
+ background: ${r.messageBg};
431
+ color: ${r.text};
432
+ border-bottom-left-radius: 3px;
433
+ margin-right: 32px;
434
+ }
435
+
436
+ /* Add spacing between different senders */
437
+ .pp-message-visitor + .pp-message-operator,
438
+ .pp-message-visitor + .pp-message-ai,
439
+ .pp-message-operator + .pp-message-visitor,
440
+ .pp-message-ai + .pp-message-visitor {
441
+ margin-top: 8px;
325
442
  }
326
443
 
327
444
  .pp-message-content {
328
- margin-bottom: 4px;
445
+ display: block;
446
+ flex: 1;
329
447
  }
330
448
 
331
449
  .pp-message-time {
332
- font-size: 11px;
333
- opacity: 0.7;
450
+ font-size: 10px;
451
+ opacity: 0.6;
334
452
  display: flex;
335
453
  align-items: center;
336
- gap: 4px;
454
+ gap: 3px;
455
+ justify-content: flex-end;
456
+ margin-top: 8px;
457
+ flex-shrink: 0;
337
458
  }
338
459
 
339
460
  .pp-ai-badge {
@@ -370,14 +491,14 @@
370
491
 
371
492
  .pp-typing {
372
493
  display: flex;
373
- gap: 4px;
374
- padding: 14px 18px;
494
+ gap: 3px;
495
+ padding: 8px 12px;
375
496
  }
376
497
 
377
498
  .pp-typing span {
378
- width: 8px;
379
- height: 8px;
380
- background: ${s.textSecondary};
499
+ width: 6px;
500
+ height: 6px;
501
+ background: ${r.textSecondary};
381
502
  border-radius: 50%;
382
503
  animation: pp-bounce 1.4s infinite ease-in-out both;
383
504
  }
@@ -392,21 +513,27 @@
392
513
 
393
514
  .pp-input-form {
394
515
  display: flex;
395
- padding: 12px;
516
+ padding: 10px 12px;
396
517
  gap: 8px;
397
- border-top: 1px solid ${s.border};
518
+ border-top: 1px solid ${r.border};
519
+ align-items: center;
398
520
  }
399
521
 
400
522
  .pp-input {
401
523
  flex: 1;
402
- padding: 10px 14px;
403
- border: 1px solid ${s.border};
524
+ min-width: 0;
525
+ height: 40px;
526
+ line-height: 40px;
527
+ padding: 0 16px;
528
+ border: 1px solid ${r.border};
404
529
  border-radius: 20px;
405
- background: ${s.bg};
406
- color: ${s.text};
530
+ background: ${r.bg};
531
+ color: ${r.text};
407
532
  font-size: 14px;
408
533
  outline: none;
409
534
  transition: border-color 0.2s;
535
+ box-sizing: border-box;
536
+ margin: 0;
410
537
  }
411
538
 
412
539
  .pp-input:focus {
@@ -414,12 +541,13 @@
414
541
  }
415
542
 
416
543
  .pp-input::placeholder {
417
- color: ${s.textSecondary};
544
+ color: ${r.textSecondary};
418
545
  }
419
546
 
420
547
  .pp-send-btn {
421
548
  width: 40px;
422
549
  height: 40px;
550
+ min-width: 40px;
423
551
  border-radius: 50%;
424
552
  background: ${t};
425
553
  color: white;
@@ -428,7 +556,18 @@
428
556
  display: flex;
429
557
  align-items: center;
430
558
  justify-content: center;
431
- transition: opacity 0.2s;
559
+ transition: opacity 0.2s, transform 0.1s;
560
+ flex-shrink: 0;
561
+ margin: 0;
562
+ padding: 0;
563
+ }
564
+
565
+ .pp-send-btn:not(:disabled):hover {
566
+ transform: scale(1.05);
567
+ }
568
+
569
+ .pp-send-btn:not(:disabled):active {
570
+ transform: scale(0.95);
432
571
  }
433
572
 
434
573
  .pp-send-btn:disabled {
@@ -445,8 +584,9 @@
445
584
  text-align: center;
446
585
  padding: 8px;
447
586
  font-size: 11px;
448
- color: ${s.textSecondary};
449
- border-top: 1px solid ${s.border};
587
+ color: ${r.textSecondary};
588
+ border-top: 1px solid ${r.border};
589
+ opacity: 0.7;
450
590
  }
451
591
 
452
592
  .pp-footer a {
@@ -475,14 +615,17 @@
475
615
  .pp-attach-btn {
476
616
  width: 40px;
477
617
  height: 40px;
618
+ min-width: 40px;
478
619
  border-radius: 50%;
479
620
  background: transparent;
480
- color: ${s.textSecondary};
481
- border: 1px solid ${s.border};
621
+ color: ${r.textSecondary};
622
+ border: 1px solid ${r.border};
482
623
  cursor: pointer;
483
624
  display: flex;
484
625
  align-items: center;
485
626
  justify-content: center;
627
+ margin: 0;
628
+ padding: 0;
486
629
  transition: color 0.2s, border-color 0.2s;
487
630
  flex-shrink: 0;
488
631
  }
@@ -506,9 +649,9 @@
506
649
  display: flex;
507
650
  gap: 8px;
508
651
  padding: 8px 12px;
509
- border-top: 1px solid ${s.border};
652
+ border-top: 1px solid ${r.border};
510
653
  overflow-x: auto;
511
- background: ${s.bgSecondary};
654
+ background: ${r.bgSecondary};
512
655
  }
513
656
 
514
657
  .pp-attachment-preview {
@@ -518,8 +661,8 @@
518
661
  border-radius: 8px;
519
662
  overflow: hidden;
520
663
  flex-shrink: 0;
521
- background: ${s.bg};
522
- border: 1px solid ${s.border};
664
+ background: ${r.bg};
665
+ border: 1px solid ${r.border};
523
666
  }
524
667
 
525
668
  .pp-preview-img {
@@ -534,7 +677,7 @@
534
677
  display: flex;
535
678
  align-items: center;
536
679
  justify-content: center;
537
- color: ${s.textSecondary};
680
+ color: ${r.textSecondary};
538
681
  }
539
682
 
540
683
  .pp-preview-file svg {
@@ -603,7 +746,10 @@
603
746
  display: flex;
604
747
  flex-direction: column;
605
748
  gap: 8px;
606
- margin-top: 4px;
749
+ margin-top: 6px;
750
+ max-width: 100%;
751
+ align-items: flex-start;
752
+ flex-shrink: 0;
607
753
  }
608
754
 
609
755
  .pp-attachment {
@@ -614,11 +760,22 @@
614
760
  overflow: hidden;
615
761
  }
616
762
 
763
+ .pp-attachment-image,
764
+ .pp-attachment-video,
765
+ .pp-attachment-audio {
766
+ width: 240px;
767
+ max-width: 100%;
768
+ }
769
+
617
770
  .pp-attachment-image img {
618
- max-width: 200px;
771
+ width: 100% !important;
772
+ height: auto !important;
773
+ max-width: 240px;
619
774
  max-height: 200px;
620
775
  border-radius: 8px;
621
776
  display: block;
777
+ object-fit: cover !important;
778
+ object-position: center;
622
779
  }
623
780
 
624
781
  .pp-attachment-audio {
@@ -628,7 +785,8 @@
628
785
  }
629
786
 
630
787
  .pp-attachment-audio audio {
631
- width: 200px;
788
+ width: 240px;
789
+ max-width: 100%;
632
790
  height: 36px;
633
791
  }
634
792
 
@@ -638,14 +796,18 @@
638
796
  white-space: nowrap;
639
797
  overflow: hidden;
640
798
  text-overflow: ellipsis;
641
- max-width: 200px;
799
+ max-width: 100%;
642
800
  }
643
801
 
644
802
  .pp-attachment-video video {
645
- max-width: 200px;
646
- max-height: 200px;
803
+ width: 100% !important;
804
+ height: auto !important;
805
+ max-width: 240px;
806
+ max-height: none;
647
807
  border-radius: 8px;
648
808
  display: block;
809
+ object-fit: contain !important;
810
+ object-position: center;
649
811
  }
650
812
 
651
813
  .pp-attachment-file {
@@ -716,14 +878,14 @@
716
878
  .pp-drop-text {
717
879
  font-size: 16px;
718
880
  font-weight: 500;
719
- color: ${s.text};
881
+ color: ${r.text};
720
882
  }
721
883
 
722
884
  /* Message Context Menu */
723
885
  .pp-message-menu {
724
886
  position: fixed;
725
- background: ${s.bg};
726
- border: 1px solid ${s.border};
887
+ background: ${r.bg};
888
+ border: 1px solid ${r.border};
727
889
  border-radius: 8px;
728
890
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
729
891
  padding: 4px;
@@ -739,7 +901,7 @@
739
901
  padding: 8px 12px;
740
902
  border: none;
741
903
  background: transparent;
742
- color: ${s.text};
904
+ color: ${r.text};
743
905
  font-size: 13px;
744
906
  cursor: pointer;
745
907
  border-radius: 4px;
@@ -765,8 +927,8 @@
765
927
  bottom: 80px;
766
928
  left: 12px;
767
929
  right: 12px;
768
- background: ${s.bg};
769
- border: 1px solid ${s.border};
930
+ background: ${r.bg};
931
+ border: 1px solid ${r.border};
770
932
  border-radius: 12px;
771
933
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
772
934
  z-index: 150;
@@ -778,14 +940,14 @@
778
940
  justify-content: space-between;
779
941
  align-items: center;
780
942
  padding: 12px 16px;
781
- border-bottom: 1px solid ${s.border};
943
+ border-bottom: 1px solid ${r.border};
782
944
  font-weight: 500;
783
945
  }
784
946
 
785
947
  .pp-edit-header button {
786
948
  background: transparent;
787
949
  border: none;
788
- color: ${s.textSecondary};
950
+ color: ${r.textSecondary};
789
951
  cursor: pointer;
790
952
  padding: 4px;
791
953
  }
@@ -800,7 +962,7 @@
800
962
  padding: 12px 16px;
801
963
  border: none;
802
964
  background: transparent;
803
- color: ${s.text};
965
+ color: ${r.text};
804
966
  font-size: 14px;
805
967
  resize: none;
806
968
  min-height: 80px;
@@ -812,15 +974,15 @@
812
974
  justify-content: flex-end;
813
975
  gap: 8px;
814
976
  padding: 12px 16px;
815
- border-top: 1px solid ${s.border};
977
+ border-top: 1px solid ${r.border};
816
978
  }
817
979
 
818
980
  .pp-edit-cancel {
819
981
  padding: 8px 16px;
820
- border: 1px solid ${s.border};
982
+ border: 1px solid ${r.border};
821
983
  border-radius: 6px;
822
984
  background: transparent;
823
- color: ${s.text};
985
+ color: ${r.text};
824
986
  font-size: 13px;
825
987
  cursor: pointer;
826
988
  }
@@ -847,7 +1009,7 @@
847
1009
  gap: 8px;
848
1010
  padding: 8px 12px;
849
1011
  background: ${n?"rgba(255,255,255,0.05)":"rgba(0,0,0,0.03)"};
850
- border-top: 1px solid ${s.border};
1012
+ border-top: 1px solid ${r.border};
851
1013
  border-left: 3px solid ${t};
852
1014
  }
853
1015
 
@@ -867,7 +1029,7 @@
867
1029
  .pp-reply-text {
868
1030
  display: block;
869
1031
  font-size: 12px;
870
- color: ${s.textSecondary};
1032
+ color: ${r.textSecondary};
871
1033
  white-space: nowrap;
872
1034
  overflow: hidden;
873
1035
  text-overflow: ellipsis;
@@ -877,7 +1039,7 @@
877
1039
  background: ${n?"rgba(255,255,255,0.1)":"rgba(0,0,0,0.05)"};
878
1040
  border: none;
879
1041
  border-radius: 50%;
880
- color: ${s.textSecondary};
1042
+ color: ${r.textSecondary};
881
1043
  cursor: pointer;
882
1044
  padding: 0;
883
1045
  width: 24px;
@@ -920,7 +1082,7 @@
920
1082
 
921
1083
  .pp-reply-content {
922
1084
  display: block;
923
- color: ${s.textSecondary};
1085
+ color: ${r.textSecondary};
924
1086
  white-space: nowrap;
925
1087
  overflow: hidden;
926
1088
  text-overflow: ellipsis;
@@ -979,7 +1141,7 @@
979
1141
 
980
1142
  .pp-deleted-content {
981
1143
  font-style: italic;
982
- color: ${s.textSecondary};
1144
+ color: ${r.textSecondary};
983
1145
  display: flex;
984
1146
  align-items: center;
985
1147
  gap: 4px;
@@ -992,11 +1154,283 @@
992
1154
  /* Edited Badge */
993
1155
  .pp-edited-badge {
994
1156
  font-size: 10px;
995
- color: ${s.textSecondary};
1157
+ color: ${r.textSecondary};
996
1158
  margin-left: 4px;
997
1159
  font-style: italic;
998
1160
  }
999
- `}var xn=0;function o(t,e,n,s,i,a){e||(e={});var r,c,u=e;if("ref"in u)for(c in u={},e)c=="ref"?r=e[c]:u[c]=e[c];var l={type:t,props:u,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--xn,__i:-1,__u:0,__source:i,__self:a};if(typeof t=="function"&&(r=t.defaultProps))for(c in r)u[c]===void 0&&(u[c]=r[c]);return w.vnode&&w.vnode(l),l}function kt({client:t,config:e}){let[n,s]=$(!1),[i,a]=$([]),[r,c]=$(""),[u,l]=$(!1),[g,p]=$(!1),[h,f]=$(!1),[E,A]=$(0),[k,x]=$([]),[b,H]=$(!1),[R,B]=$(null),[N,X]=$(null),[U,F]=$(""),[L,O]=$(null),[z,ge]=$(!1),[Ut,Re]=$(null),[Oe,De]=$(null),[W,he]=$(e),fe=G(null),me=G(null),Le=G(null),zt=G(null);j(()=>{let d=t.on("openChange",s),_=t.on("message",()=>{a([...t.getMessages()])}),T=t.on("typing",m=>{l(m.isTyping)}),v=t.on("presence",m=>{p(m.online)}),S=t.on("connect",()=>{f(!0),a(t.getMessages()),p(t.getSession()?.operatorOnline??!1),he(t.getConfig())}),I=t.on("configUpdate",()=>{he(t.getConfig())});return t.isConnected()&&(f(!0),a(t.getMessages()),p(t.getSession()?.operatorOnline??!1),he(t.getConfig())),()=>{d(),_(),T(),v(),S(),I()}},[t]),j(()=>{n&&fe.current?.scrollIntoView({behavior:"smooth"})},[i,n]),j(()=>{n&&(setTimeout(()=>{fe.current?.scrollIntoView({behavior:"auto"})},50),me.current?.focus(),A(0))},[n]),j(()=>{if(!n&&i.length>0){let d=i.filter(_=>_.sender!=="visitor"&&_.status!=="read").length;A(d)}},[i,n]);let se=ft(()=>{if(!n||!h)return;let d=i.filter(_=>_.sender!=="visitor"&&_.status!=="read");if(d.length>0){let _=d.map(T=>T.id);t.sendReadStatus(_,"read")}},[n,h,i,t]);if(j(()=>{if(!n||!h)return;let d=setTimeout(()=>{se()},1e3);return()=>clearTimeout(d)},[n,h,i,se]),j(()=>{let d=()=>{document.visibilityState==="visible"&&n&&se()};return document.addEventListener("visibilitychange",d),()=>document.removeEventListener("visibilitychange",d)},[n,se]),j(()=>{let d=t.on("read",()=>{a([...t.getMessages()])});return()=>d()},[t]),!yn(W))return null;let Vt=async d=>{d.preventDefault();let _=r.trim().length>0,T=k.filter(m=>m.status==="ready"&&m.attachment);if(!_&&T.length===0)return;let v=r,S=T.map(m=>m.attachment.id),I=R?.id;c(""),x([]),B(null);try{await t.sendMessage(v,S,I)}catch(m){console.error("[PocketPing] Failed to send message:",m)}},jt=d=>{let _=d.target;c(_.value),t.sendTyping(!0)},Bt=async d=>{let _=d.target,T=_.files;if(!T||T.length===0)return;let v=[];for(let S=0;S<T.length;S++){let I=T[S],m=`pending-${Date.now()}-${S}`,P;I.type.startsWith("image/")&&(P=URL.createObjectURL(I)),v.push({id:m,file:I,preview:P,progress:0,status:"pending"})}x(S=>[...S,...v]),_.value="",H(!0);for(let S of v)try{x(m=>m.map(P=>P.id===S.id?{...P,status:"uploading"}:P));let I=await t.uploadFile(S.file,m=>{x(P=>P.map(ve=>ve.id===S.id?{...ve,progress:m}:ve))});x(m=>m.map(P=>P.id===S.id?{...P,status:"ready",progress:100,attachment:I}:P))}catch(I){console.error("[PocketPing] Failed to upload file:",I),x(m=>m.map(P=>P.id===S.id?{...P,status:"error",error:"Upload failed"}:P))}H(!1)},qt=d=>{x(_=>{let T=_.find(v=>v.id===d);return T?.preview&&URL.revokeObjectURL(T.preview),_.filter(v=>v.id!==d)})},He=d=>{B(d),O(null),me.current?.focus()},Jt=()=>{B(null)},Fe=d=>{d.sender==="visitor"&&(X(d),F(d.content),O(null))},We=()=>{X(null),F("")},Xt=async()=>{if(!(!N||!U.trim()))try{await t.editMessage(N.id,U.trim()),X(null),F("")}catch(d){console.error("[PocketPing] Failed to edit message:",d)}},Ne=async d=>{if(d.sender==="visitor"&&(O(null),confirm("Delete this message?")))try{await t.deleteMessage(d.id)}catch(_){console.error("[PocketPing] Failed to delete message:",_)}},Yt=(d,_)=>{d.preventDefault();let T=d;O({message:_,x:T.clientX,y:T.clientY})},Gt=d=>{let _=setTimeout(()=>{navigator.vibrate&&navigator.vibrate(50),O({message:d,x:window.innerWidth/2-60,y:window.innerHeight/2-50})},500);De(_)},Ue=()=>{Oe&&(clearTimeout(Oe),De(null))};j(()=>{if(!L)return;let d=()=>O(null);return document.addEventListener("click",d),()=>document.removeEventListener("click",d)},[L]);let ze=d=>{let _=document.getElementById(`pp-msg-${d}`);_&&(_.scrollIntoView({behavior:"smooth",block:"center"}),_.classList.add("pp-message-highlight"),setTimeout(()=>{_.classList.remove("pp-message-highlight")},1500))},K=G(0),Kt=d=>{d.preventDefault(),d.stopPropagation(),K.current++,K.current===1&&ge(!0)},Qt=d=>{d.preventDefault(),d.stopPropagation()},Zt=d=>{d.preventDefault(),d.stopPropagation(),K.current--,K.current===0&&ge(!1)},en=async d=>{d.preventDefault(),d.stopPropagation(),K.current=0,ge(!1);let _=d.dataTransfer?.files;if(!_||_.length===0)return;let T=[];for(let v=0;v<_.length;v++){let S=_[v],I=`pending-${Date.now()}-${v}`,m;S.type.startsWith("image/")&&(m=URL.createObjectURL(S)),T.push({id:I,file:S,preview:m,progress:0,status:"pending"})}x(v=>[...v,...T]),H(!0);for(let v of T)try{x(I=>I.map(m=>m.id===v.id?{...m,status:"uploading"}:m));let S=await t.uploadFile(v.file,I=>{x(m=>m.map(P=>P.id===v.id?{...P,progress:I}:P))});x(I=>I.map(m=>m.id===v.id?{...m,status:"ready",progress:100,attachment:S}:m))}catch(S){console.error("[PocketPing] Failed to upload dropped file:",S),x(I=>I.map(m=>m.id===v.id?{...m,status:"error",error:"Upload failed"}:m))}H(!1)},Ve=W.position??"bottom-right",_e=bn(W.theme??"auto"),tn=W.primaryColor??"#6366f1",Q=_e==="dark"?"#9ca3af":"#6b7280";return o(D,{children:[o("style",{children:vt(tn,_e)}),o("button",{class:`pp-toggle pp-${Ve}`,onClick:()=>t.toggleOpen(),"aria-label":n?"Close chat":"Open chat",children:[n?o(ne,{}):o(kn,{}),!n&&E>0&&o("span",{class:"pp-unread-badge",children:E>9?"9+":E}),!n&&E===0&&g&&o("span",{class:"pp-online-dot"})]}),n&&o("div",{class:`pp-window pp-${Ve} pp-theme-${_e} ${z?"pp-dragging":""}`,onDragEnter:Kt,onDragOver:Qt,onDragLeave:Zt,onDrop:en,children:[z&&o("div",{class:"pp-drop-overlay",children:[o("div",{class:"pp-drop-icon",children:o(xt,{})}),o("div",{class:"pp-drop-text",children:"Drop files to upload"})]}),o("div",{class:"pp-header",children:[o("div",{class:"pp-header-info",children:[W.operatorAvatar&&o("img",{src:W.operatorAvatar,alt:"",class:"pp-avatar"}),o("div",{children:[o("div",{class:"pp-header-title",children:W.operatorName??"Support"}),o("div",{class:"pp-header-status",children:g?o(D,{children:[o("span",{class:"pp-status-dot pp-online"})," Online"]}):o(D,{children:[o("span",{class:"pp-status-dot"})," Away"]})})]})]}),o("button",{class:"pp-close-btn",onClick:()=>t.setOpen(!1),"aria-label":"Close chat",children:o(ne,{})})]}),o("div",{class:"pp-messages",ref:zt,children:[W.welcomeMessage&&i.length===0&&o("div",{class:"pp-welcome",children:W.welcomeMessage}),i.map(d=>{let _=!!d.deletedAt,T=!!d.editedAt,v=null;if(d.replyTo)if(typeof d.replyTo=="object")v=d.replyTo;else{let m=i.find(P=>P.id===d.replyTo);if(m){let P=!!(m.attachments&&m.attachments.length>0);v={id:m.id,sender:m.sender,content:m.content,deleted:!!m.deletedAt,hasAttachment:P,attachmentType:P?m.attachments[0].mimeType:void 0}}}let I=Ut===d.id&&!_;return o("div",{id:`pp-msg-${d.id}`,class:`pp-message pp-message-${d.sender} ${_?"pp-message-deleted":""}`,onContextMenu:m=>Yt(m,d),onMouseEnter:()=>Re(d.id),onMouseLeave:()=>Re(null),onTouchStart:()=>Gt(d),onTouchEnd:Ue,onTouchCancel:Ue,children:[I&&o("div",{class:`pp-message-actions ${d.sender==="visitor"?"pp-actions-left":"pp-actions-right"}`,children:[o("button",{class:"pp-action-btn",onClick:()=>He(d),title:"Reply",children:o(yt,{color:Q})}),d.sender==="visitor"&&o(D,{children:[o("button",{class:"pp-action-btn",onClick:()=>Fe(d),title:"Edit",children:o(bt,{color:Q})}),o("button",{class:"pp-action-btn pp-action-delete",onClick:()=>Ne(d),title:"Delete",children:o(wt,{color:Q})})]})]}),v&&(v.content||v.hasAttachment)&&o("div",{class:"pp-reply-quote pp-reply-quote-clickable",onClick:()=>ze(v.id),role:"button",tabIndex:0,onKeyDown:m=>m.key==="Enter"&&ze(v.id),children:[o("span",{class:"pp-reply-sender",children:v.sender==="visitor"?"You":"Support"}),o("span",{class:"pp-reply-content",children:v.deleted?"Message deleted":o(D,{children:[v.hasAttachment&&o("span",{class:"pp-reply-attachment-icon",children:v.attachmentType?.startsWith("image/")?"\u{1F4F7} ":"\u{1F4CE} "}),v.content?o(D,{children:[(v.content||"").slice(0,50),(v.content||"").length>50?"...":""]}):v.attachmentType?.startsWith("image/")?"Photo":"File"]})})]}),_?o("div",{class:"pp-message-content pp-deleted-content",children:[o("span",{class:"pp-deleted-icon",children:"\u{1F5D1}\uFE0F"})," Message deleted"]}):o(D,{children:[d.content&&o("div",{class:"pp-message-content",children:d.content}),d.attachments&&d.attachments.length>0&&o("div",{class:"pp-message-attachments",children:d.attachments.map(m=>o(Pn,{attachment:m},m.id))})]}),o("div",{class:"pp-message-time",children:[wn(d.timestamp),T&&!_&&o("span",{class:"pp-edited-badge",children:"edited"}),d.sender==="ai"&&o("span",{class:"pp-ai-badge",children:"AI"}),d.sender==="visitor"&&!_&&o("span",{class:`pp-status pp-status-${d.status??"sent"}`,children:o(Sn,{status:d.status})})]})]},d.id)}),u&&o("div",{class:"pp-message pp-message-operator pp-typing",children:[o("span",{}),o("span",{}),o("span",{})]}),o("div",{ref:fe})]}),L&&o("div",{class:"pp-message-menu",style:{top:`${L.y}px`,left:`${L.x}px`},children:[o("button",{onClick:()=>He(L.message),children:[o(yt,{color:Q})," Reply"]}),L.message.sender==="visitor"&&!L.message.deletedAt&&o(D,{children:[o("button",{onClick:()=>Fe(L.message),children:[o(bt,{color:Q})," Edit"]}),o("button",{class:"pp-menu-delete",onClick:()=>Ne(L.message),children:[o(wt,{color:"#ef4444"})," Delete"]})]})]}),N&&o("div",{class:"pp-edit-modal",children:[o("div",{class:"pp-edit-header",children:[o("span",{children:"Edit message"}),o("button",{onClick:We,children:o(ne,{})})]}),o("textarea",{class:"pp-edit-input",value:U,onInput:d=>F(d.target.value),autoFocus:!0}),o("div",{class:"pp-edit-actions",children:[o("button",{class:"pp-edit-cancel",onClick:We,children:"Cancel"}),o("button",{class:"pp-edit-save",onClick:Xt,disabled:!U.trim(),children:"Save"})]})]}),R&&o("div",{class:"pp-reply-preview",children:[o("div",{class:"pp-reply-preview-content",children:[o("span",{class:"pp-reply-label",children:"Replying to"}),o("span",{class:"pp-reply-text",children:[R.attachments&&R.attachments.length>0&&o("span",{class:"pp-reply-attachment-icon",children:R.attachments[0].mimeType.startsWith("image/")?"\u{1F4F7} ":"\u{1F4CE} "}),R.content?o(D,{children:[R.content.slice(0,50),R.content.length>50?"...":""]}):R.attachments?.[0]?.mimeType.startsWith("image/")?"Photo":"File"]})]}),o("button",{class:"pp-reply-cancel",onClick:Jt,children:o(ne,{})})]}),k.length>0&&o("div",{class:"pp-attachments-preview",children:k.map(d=>o("div",{class:`pp-attachment-preview pp-attachment-${d.status}`,children:[d.preview?o("img",{src:d.preview,alt:d.file.name,class:"pp-preview-img"}):o("div",{class:"pp-preview-file",children:o(Et,{mimeType:d.file.type})}),o("button",{class:"pp-remove-attachment",onClick:()=>qt(d.id),"aria-label":"Remove attachment",type:"button",children:o(ne,{})}),d.status==="uploading"&&o("div",{class:"pp-upload-progress",style:{width:`${d.progress}%`}}),d.status==="error"&&o("div",{class:"pp-upload-error",title:d.error,children:"!"})]},d.id))}),o("form",{class:"pp-input-form",onSubmit:Vt,children:[o("input",{ref:d=>{Le.current=d,d&&(d.onchange=Bt)},type:"file",class:"pp-file-input",accept:"image/*,audio/*,video/*,.pdf,.doc,.docx,.xls,.xlsx,.txt",multiple:!0}),o("button",{type:"button",class:"pp-attach-btn",onClick:()=>Le.current?.click(),disabled:!h||b,"aria-label":"Attach file",children:o(xt,{})}),o("input",{ref:me,type:"text",class:"pp-input",placeholder:W.placeholder??"Type a message...",value:r,onInput:jt,disabled:!h}),o("button",{type:"submit",class:"pp-send-btn",disabled:!r.trim()&&k.filter(d=>d.status==="ready").length===0||!h||b,"aria-label":"Send message",children:o(En,{})})]}),o("div",{class:"pp-footer",children:["Powered by ",o("a",{href:"https://pocketping.io",target:"_blank",rel:"noopener",children:"PocketPing"})]})]})]})}function yn(t){let e=window.location.pathname;return t.hideOnPages?.some(n=>new RegExp(n).test(e))?!1:t.showOnPages?.length?t.showOnPages.some(n=>new RegExp(n).test(e)):!0}function bn(t){return t==="auto"?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":t}function wn(t){return new Date(t).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}function kn(){return o("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2",children:o("path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"})})}function ne(){return o("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2",children:[o("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),o("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})}function En(){return o("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2",children:[o("line",{x1:"22",y1:"2",x2:"11",y2:"13"}),o("polygon",{points:"22 2 15 22 11 13 2 9 22 2"})]})}function Sn({status:t}){return!t||t==="sending"||t==="sent"?o("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor","stroke-width":"2",class:"pp-check",children:o("polyline",{points:"3 8 7 12 13 4"})}):t==="delivered"?o("svg",{viewBox:"0 0 20 16",fill:"none",stroke:"currentColor","stroke-width":"2",class:"pp-check-double",children:[o("polyline",{points:"1 8 5 12 11 4"}),o("polyline",{points:"7 8 11 12 17 4"})]}):t==="read"?o("svg",{viewBox:"0 0 20 16",fill:"none",stroke:"currentColor","stroke-width":"2",class:"pp-check-double pp-check-read",children:[o("polyline",{points:"1 8 5 12 11 4"}),o("polyline",{points:"7 8 11 12 17 4"})]}):null}function xt(){return o("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2",children:o("path",{d:"M21.44 11.05l-9.19 9.19a6 6 0 0 1-8.49-8.49l9.19-9.19a4 4 0 0 1 5.66 5.66l-9.2 9.19a2 2 0 0 1-2.83-2.83l8.49-8.48"})})}function yt({color:t,size:e=16}){return o("svg",{viewBox:"0 0 24 24",fill:"none","stroke-width":"2",style:{stroke:t||"currentColor",width:`${e}px`,minWidth:`${e}px`,height:`${e}px`,display:"block",flexShrink:0},children:[o("polyline",{points:"9 17 4 12 9 7"}),o("path",{d:"M20 18v-2a4 4 0 0 0-4-4H4"})]})}function bt({color:t,size:e=16}){return o("svg",{viewBox:"0 0 24 24",fill:"none","stroke-width":"2",style:{stroke:t||"currentColor",width:`${e}px`,minWidth:`${e}px`,height:`${e}px`,display:"block",flexShrink:0},children:o("path",{d:"M17 3a2.828 2.828 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5L17 3z"})})}function wt({color:t,size:e=16}){return o("svg",{viewBox:"0 0 24 24",fill:"none","stroke-width":"2",style:{stroke:t||"currentColor",width:`${e}px`,minWidth:`${e}px`,height:`${e}px`,display:"block",flexShrink:0},children:[o("polyline",{points:"3 6 5 6 21 6"}),o("path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"})]})}function Et({mimeType:t}){return t==="application/pdf"?o("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2",children:[o("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),o("polyline",{points:"14 2 14 8 20 8"}),o("path",{d:"M9 15h6"}),o("path",{d:"M9 11h6"})]}):t.startsWith("audio/")?o("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2",children:[o("path",{d:"M9 18V5l12-2v13"}),o("circle",{cx:"6",cy:"18",r:"3"}),o("circle",{cx:"18",cy:"16",r:"3"})]}):t.startsWith("video/")?o("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2",children:[o("rect",{x:"2",y:"2",width:"20",height:"20",rx:"2.18",ry:"2.18"}),o("line",{x1:"7",y1:"2",x2:"7",y2:"22"}),o("line",{x1:"17",y1:"2",x2:"17",y2:"22"}),o("line",{x1:"2",y1:"12",x2:"22",y2:"12"}),o("line",{x1:"2",y1:"7",x2:"7",y2:"7"}),o("line",{x1:"2",y1:"17",x2:"7",y2:"17"}),o("line",{x1:"17",y1:"17",x2:"22",y2:"17"}),o("line",{x1:"17",y1:"7",x2:"22",y2:"7"})]}):o("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2",children:[o("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),o("polyline",{points:"14 2 14 8 20 8"})]})}function Pn({attachment:t}){let e=t.mimeType.startsWith("image/"),n=t.mimeType.startsWith("audio/"),s=t.mimeType.startsWith("video/"),i=a=>a<1024?`${a} B`:a<1024*1024?`${(a/1024).toFixed(1)} KB`:`${(a/(1024*1024)).toFixed(1)} MB`;return e?o("a",{href:t.url,target:"_blank",rel:"noopener",class:"pp-attachment pp-attachment-image",children:o("img",{src:t.thumbnailUrl||t.url,alt:t.filename})}):n?o("div",{class:"pp-attachment pp-attachment-audio",children:[o("audio",{controls:!0,preload:"metadata",children:o("source",{src:t.url,type:t.mimeType})}),o("span",{class:"pp-attachment-name",children:t.filename})]}):s?o("div",{class:"pp-attachment pp-attachment-video",children:o("video",{controls:!0,preload:"metadata",children:o("source",{src:t.url,type:t.mimeType})})}):o("a",{href:t.url,target:"_blank",rel:"noopener",class:"pp-attachment pp-attachment-file",children:[o(Et,{mimeType:t.mimeType}),o("div",{class:"pp-attachment-info",children:[o("span",{class:"pp-attachment-name",children:t.filename}),o("span",{class:"pp-attachment-size",children:i(t.size)})]})]})}var de="0.3.6";var ue=class{constructor(e){this.session=null;this.ws=null;this.sse=null;this.isOpen=!1;this.listeners=new Map;this.customEventHandlers=new Map;this.reconnectAttempts=0;this.maxReconnectAttempts=5;this.reconnectTimeout=null;this.pollingTimeout=null;this.pollingFailures=0;this.maxPollingFailures=10;this.wsConnectedAt=0;this.quickFailureThreshold=2e3;this.connectionMode="none";this.trackedElementCleanups=[];this.currentTrackedElements=[];this.inspectorMode=!1;this.inspectorCleanup=null;this.config=e}async connect(){let e=this.getOrCreateVisitorId(),n=this.getStoredSessionId(),s=this.getStoredIdentity(),a=new URLSearchParams(window.location.search).get("pp_inspector"),r=await this.fetch("/connect",{method:"POST",body:JSON.stringify({visitorId:e,sessionId:n,inspectorToken:a||void 0,metadata:{url:window.location.href,referrer:document.referrer||void 0,pageTitle:document.title||void 0,userAgent:navigator.userAgent,timezone:Intl.DateTimeFormat().resolvedOptions().timeZone,language:navigator.language,screenResolution:`${window.screen.width}x${window.screen.height}`},identity:s||void 0})});return this.session={sessionId:r.sessionId,visitorId:r.visitorId,operatorOnline:r.operatorOnline??!1,messages:r.messages??[],identity:r.identity||s||void 0},r.operatorName&&(this.config.operatorName=r.operatorName),r.operatorAvatar&&(this.config.operatorAvatar=r.operatorAvatar),r.primaryColor&&(this.config.primaryColor=r.primaryColor),r.welcomeMessage&&(this.config.welcomeMessage=r.welcomeMessage),this.emit("configUpdate",{operatorName:this.config.operatorName,operatorAvatar:this.config.operatorAvatar,primaryColor:this.config.primaryColor,welcomeMessage:this.config.welcomeMessage}),this.storeSessionId(r.sessionId),this.connectRealtime(),r.inspectorMode?this.enableInspectorMode():r.trackedElements?.length&&this.setupTrackedElements(r.trackedElements),this.emit("connect",this.session),this.config.onConnect?.(r.sessionId),this.session}disconnect(){this.ws&&(this.ws.onclose=null,this.ws.onmessage=null,this.ws.onerror=null,this.ws.onopen=null,this.ws.close(),this.ws=null),this.sse&&(this.sse.close(),this.sse=null),this.session=null,this.connectionMode="none",this.reconnectTimeout&&clearTimeout(this.reconnectTimeout),this.stopPolling(),this.cleanupTrackedElements(),this.disableInspectorMode()}async sendMessage(e,n,s){if(!this.session)throw new Error("Not connected");let i=`temp-${this.generateId()}`,a={id:i,sessionId:this.session.sessionId,content:e,sender:"visitor",timestamp:new Date().toISOString(),status:"sending",replyTo:s};this.session.messages.push(a),this.emit("message",a);try{let r=await this.fetch("/message",{method:"POST",body:JSON.stringify({sessionId:this.session.sessionId,content:e,sender:"visitor",attachmentIds:n||[],replyTo:s})}),c=this.session.messages.findIndex(l=>l.id===i);c>=0&&(this.session.messages[c].id=r.messageId,this.session.messages[c].timestamp=r.timestamp,this.session.messages[c].status="sent",r.attachments&&r.attachments.length>0&&(this.session.messages[c].attachments=r.attachments),this.emit("message",this.session.messages[c]));let u=this.session.messages[c]||{id:r.messageId,sessionId:this.session.sessionId,content:e,sender:"visitor",timestamp:r.timestamp,status:"sent",attachments:r.attachments};return this.config.onMessage?.(u),u}catch(r){let c=this.session.messages.findIndex(u=>u.id===i);throw c>=0&&(this.session.messages.splice(c,1),this.emit("message",a)),r}}async uploadFile(e,n){if(!this.session)throw new Error("Not connected");this.emit("uploadStart",{filename:e.name,size:e.size});try{let s=await this.fetch("/upload",{method:"POST",body:JSON.stringify({sessionId:this.session.sessionId,filename:e.name,mimeType:e.type||"application/octet-stream",size:e.size})});n?.(10),this.emit("uploadProgress",{filename:e.name,progress:10}),await this.uploadToPresignedUrl(s.uploadUrl,e,a=>{let r=10+a*.8;n?.(r),this.emit("uploadProgress",{filename:e.name,progress:r})});let i=await this.fetch("/upload/complete",{method:"POST",body:JSON.stringify({sessionId:this.session.sessionId,attachmentId:s.attachmentId})});return n?.(100),this.emit("uploadComplete",i),{id:i.id,filename:i.filename,mimeType:i.mimeType,size:i.size,url:i.url,thumbnailUrl:i.thumbnailUrl,status:i.status}}catch(s){throw this.emit("uploadError",{filename:e.name,error:s}),s}}async uploadFiles(e,n){let s=[],i=e.length;for(let a=0;a<i;a++){let r=e[a],c=a/i*100,u=100/i,l=await this.uploadFile(r,g=>{let p=c+g/100*u;n?.(p)});s.push(l)}return s}uploadToPresignedUrl(e,n,s){return new Promise((i,a)=>{let r=new XMLHttpRequest;r.upload.addEventListener("progress",c=>{if(c.lengthComputable){let u=c.loaded/c.total*100;s?.(u)}}),r.addEventListener("load",()=>{r.status>=200&&r.status<300?i():a(new Error(`Upload failed with status ${r.status}`))}),r.addEventListener("error",()=>{a(new Error("Upload failed"))}),r.open("PUT",e),r.setRequestHeader("Content-Type",n.type||"application/octet-stream"),r.send(n)})}async fetchMessages(e){if(!this.session)throw new Error("Not connected");let n=new URLSearchParams({sessionId:this.session.sessionId});return e&&n.set("after",e),(await this.fetch(`/messages?${n}`,{method:"GET"})).messages}async sendTyping(e=!0){this.session&&await this.fetch("/typing",{method:"POST",body:JSON.stringify({sessionId:this.session.sessionId,sender:"visitor",isTyping:e})})}async sendReadStatus(e,n){if(!(!this.session||e.length===0))try{await this.fetch("/read",{method:"POST",body:JSON.stringify({sessionId:this.session.sessionId,messageIds:e,status:n})});for(let s of this.session.messages)e.includes(s.id)&&(s.status=n,n==="delivered"?s.deliveredAt=new Date().toISOString():n==="read"&&(s.readAt=new Date().toISOString()));this.emit("readStatusSent",{messageIds:e,status:n})}catch(s){console.error("[PocketPing] Failed to send read status:",s)}}async editMessage(e,n){if(!this.session)throw new Error("Not connected");let s=await this.fetch(`/message/${e}`,{method:"PATCH",body:JSON.stringify({sessionId:this.session.sessionId,content:n})}),i=this.session.messages.findIndex(a=>a.id===e);return i>=0&&(this.session.messages[i].content=s.message.content,this.session.messages[i].editedAt=s.message.editedAt,this.emit("messageEdited",this.session.messages[i])),this.session.messages[i]}async deleteMessage(e){if(!this.session)throw new Error("Not connected");let n=await this.fetch(`/message/${e}?sessionId=${encodeURIComponent(this.session.sessionId)}`,{method:"DELETE"});if(n.deleted){let s=this.session.messages.findIndex(i=>i.id===e);s>=0&&(this.session.messages[s].deletedAt=new Date().toISOString(),this.session.messages[s].content="",this.emit("messageDeleted",this.session.messages[s]))}return n.deleted}async getPresence(){return this.fetch("/presence",{method:"GET"})}async identify(e){if(!e?.id)throw new Error("[PocketPing] identity.id is required");if(this.storeIdentity(e),this.session)try{await this.fetch("/identify",{method:"POST",body:JSON.stringify({sessionId:this.session.sessionId,identity:e})}),this.session.identity=e,this.emit("identify",e)}catch(n){throw console.error("[PocketPing] Failed to identify:",n),n}}async reset(e){this.clearIdentity(),this.session&&(this.session.identity=void 0),e?.newSession&&(localStorage.removeItem("pocketping_session_id"),localStorage.removeItem("pocketping_visitor_id"),this.disconnect(),await this.connect()),this.emit("reset",null)}getIdentity(){return this.session?.identity||this.getStoredIdentity()}getSession(){return this.session}getMessages(){return this.session?.messages??[]}isConnected(){return this.session!==null}isWidgetOpen(){return this.isOpen}getConfig(){return this.config}setOpen(e){this.isOpen=e,this.emit("openChange",e),e?this.config.onOpen?.():this.config.onClose?.()}toggleOpen(){this.setOpen(!this.isOpen)}on(e,n){return this.listeners.has(e)||this.listeners.set(e,new Set),this.listeners.get(e).add(n),()=>{this.listeners.get(e)?.delete(n)}}emit(e,n){this.listeners.get(e)?.forEach(s=>s(n))}trigger(e,n,s){if(!this.ws||this.ws.readyState!==WebSocket.OPEN){console.warn("[PocketPing] Cannot trigger event: WebSocket not connected");return}let i={name:e,data:n,timestamp:new Date().toISOString()};this.ws.send(JSON.stringify({type:"event",data:i})),this.emit(`event:${e}`,i),s?.widgetMessage&&(this.setOpen(!0),this.emit("triggerMessage",{message:s.widgetMessage,eventName:e}))}onEvent(e,n){return this.customEventHandlers.has(e)||this.customEventHandlers.set(e,new Set),this.customEventHandlers.get(e).add(n),()=>{this.customEventHandlers.get(e)?.delete(n)}}offEvent(e,n){this.customEventHandlers.get(e)?.delete(n)}emitCustomEvent(e){let n=this.customEventHandlers.get(e.name);n&&n.forEach(s=>s(e.data,e)),this.emit("event",e),this.emit(`event:${e.name}`,e)}setupTrackedElements(e){this.cleanupTrackedElements(),this.currentTrackedElements=e;for(let n of e){let s=n.event||"click",i=r=>{let c={...n.data,selector:n.selector,elementText:r.target?.textContent?.trim().slice(0,100),url:window.location.href};this.trigger(n.name,c,{widgetMessage:n.widgetMessage})},a=r=>{r.target?.closest(n.selector)&&i(r)};document.addEventListener(s,a,!0),this.trackedElementCleanups.push(()=>{document.removeEventListener(s,a,!0)})}e.length>0&&console.info(`[PocketPing] Tracking ${e.length} element(s)`)}cleanupTrackedElements(){for(let e of this.trackedElementCleanups)e();this.trackedElementCleanups=[],this.currentTrackedElements=[]}getTrackedElements(){return[...this.currentTrackedElements]}enableInspectorMode(){if(this.inspectorMode)return;this.inspectorMode=!0,console.info("[PocketPing] \u{1F50D} Inspector mode active - click on any element to select it");let e=document.createElement("div");e.id="pp-inspector-overlay",e.innerHTML=`
1161
+
1162
+ /* Pre-Chat Form */
1163
+ .pp-prechat {
1164
+ flex: 1;
1165
+ display: flex;
1166
+ flex-direction: column;
1167
+ padding: 24px 20px;
1168
+ overflow-y: auto;
1169
+ }
1170
+
1171
+ .pp-prechat-title {
1172
+ font-size: 18px;
1173
+ font-weight: 600;
1174
+ margin-bottom: 8px;
1175
+ color: ${r.text};
1176
+ }
1177
+
1178
+ .pp-prechat-subtitle {
1179
+ font-size: 13px;
1180
+ color: ${r.textSecondary};
1181
+ margin-bottom: 24px;
1182
+ }
1183
+
1184
+ .pp-prechat-tabs {
1185
+ display: flex;
1186
+ gap: 8px;
1187
+ margin-bottom: 20px;
1188
+ }
1189
+
1190
+ .pp-prechat-tab {
1191
+ flex: 1;
1192
+ padding: 10px;
1193
+ border: 1px solid ${r.border};
1194
+ border-radius: 8px;
1195
+ background: transparent;
1196
+ color: ${r.textSecondary};
1197
+ font-size: 13px;
1198
+ cursor: pointer;
1199
+ transition: all 0.2s;
1200
+ display: flex;
1201
+ align-items: center;
1202
+ justify-content: center;
1203
+ gap: 6px;
1204
+ }
1205
+
1206
+ .pp-prechat-tab:hover {
1207
+ background: ${r.bgSecondary};
1208
+ }
1209
+
1210
+ .pp-prechat-tab.active {
1211
+ background: ${t}15;
1212
+ border-color: ${t};
1213
+ color: ${t};
1214
+ }
1215
+
1216
+ .pp-prechat-tab svg {
1217
+ width: 16px;
1218
+ height: 16px;
1219
+ }
1220
+
1221
+ .pp-prechat-field {
1222
+ margin-bottom: 16px;
1223
+ }
1224
+
1225
+ .pp-prechat-label {
1226
+ display: block;
1227
+ font-size: 12px;
1228
+ font-weight: 500;
1229
+ color: ${r.textSecondary};
1230
+ margin-bottom: 6px;
1231
+ }
1232
+
1233
+ .pp-prechat-input {
1234
+ width: 100%;
1235
+ height: 44px;
1236
+ padding: 0 14px;
1237
+ border: 1px solid ${r.border};
1238
+ border-radius: 8px;
1239
+ background: ${r.bg};
1240
+ color: ${r.text};
1241
+ font-size: 14px;
1242
+ outline: none;
1243
+ transition: border-color 0.2s;
1244
+ box-sizing: border-box;
1245
+ }
1246
+
1247
+ .pp-prechat-input:focus {
1248
+ border-color: ${t};
1249
+ }
1250
+
1251
+ .pp-prechat-input::placeholder {
1252
+ color: ${r.textSecondary};
1253
+ }
1254
+
1255
+ .pp-prechat-input.error {
1256
+ border-color: #ef4444;
1257
+ }
1258
+
1259
+ .pp-prechat-error {
1260
+ color: #ef4444;
1261
+ font-size: 12px;
1262
+ margin-top: 4px;
1263
+ }
1264
+
1265
+ .pp-phone-input-wrapper {
1266
+ display: flex;
1267
+ gap: 8px;
1268
+ }
1269
+
1270
+ .pp-country-select {
1271
+ position: relative;
1272
+ }
1273
+
1274
+ .pp-country-btn {
1275
+ display: flex;
1276
+ align-items: center;
1277
+ gap: 6px;
1278
+ height: 44px;
1279
+ padding: 0 10px;
1280
+ border: 1px solid ${r.border};
1281
+ border-radius: 8px;
1282
+ background: ${r.bg};
1283
+ color: ${r.text};
1284
+ font-size: 14px;
1285
+ cursor: pointer;
1286
+ transition: border-color 0.2s;
1287
+ }
1288
+
1289
+ .pp-country-btn:focus {
1290
+ border-color: ${t};
1291
+ outline: none;
1292
+ }
1293
+
1294
+ .pp-country-flag {
1295
+ font-size: 18px;
1296
+ line-height: 1;
1297
+ }
1298
+
1299
+ .pp-country-code {
1300
+ font-size: 13px;
1301
+ color: ${r.textSecondary};
1302
+ }
1303
+
1304
+ .pp-country-chevron {
1305
+ width: 12px;
1306
+ height: 12px;
1307
+ color: ${r.textSecondary};
1308
+ }
1309
+
1310
+ .pp-country-dropdown {
1311
+ position: absolute;
1312
+ top: calc(100% + 4px);
1313
+ left: 0;
1314
+ width: 280px;
1315
+ max-height: 280px;
1316
+ overflow-y: auto;
1317
+ background: ${r.bg};
1318
+ border: 1px solid ${r.border};
1319
+ border-radius: 8px;
1320
+ box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
1321
+ z-index: 100;
1322
+ }
1323
+
1324
+ .pp-country-search {
1325
+ position: sticky;
1326
+ top: 0;
1327
+ padding: 8px;
1328
+ background: ${r.bg};
1329
+ border-bottom: 1px solid ${r.border};
1330
+ }
1331
+
1332
+ .pp-country-search-input {
1333
+ width: 100%;
1334
+ height: 36px;
1335
+ padding: 0 12px;
1336
+ border: 1px solid ${r.border};
1337
+ border-radius: 6px;
1338
+ background: ${r.bgSecondary};
1339
+ color: ${r.text};
1340
+ font-size: 13px;
1341
+ outline: none;
1342
+ box-sizing: border-box;
1343
+ }
1344
+
1345
+ .pp-country-search-input:focus {
1346
+ border-color: ${t};
1347
+ }
1348
+
1349
+ .pp-country-list {
1350
+ padding: 4px;
1351
+ }
1352
+
1353
+ .pp-country-option {
1354
+ display: flex;
1355
+ align-items: center;
1356
+ gap: 10px;
1357
+ padding: 10px 12px;
1358
+ cursor: pointer;
1359
+ border-radius: 6px;
1360
+ transition: background 0.15s;
1361
+ }
1362
+
1363
+ .pp-country-option:hover {
1364
+ background: ${r.bgSecondary};
1365
+ }
1366
+
1367
+ .pp-country-option.selected {
1368
+ background: ${t}15;
1369
+ }
1370
+
1371
+ .pp-country-name {
1372
+ flex: 1;
1373
+ font-size: 13px;
1374
+ color: ${r.text};
1375
+ }
1376
+
1377
+ .pp-country-dial {
1378
+ font-size: 12px;
1379
+ color: ${r.textSecondary};
1380
+ }
1381
+
1382
+ .pp-phone-number-input {
1383
+ flex: 1;
1384
+ }
1385
+
1386
+ .pp-prechat-submit {
1387
+ width: 100%;
1388
+ height: 44px;
1389
+ margin-top: 8px;
1390
+ border: none;
1391
+ border-radius: 8px;
1392
+ background: ${t};
1393
+ color: white;
1394
+ font-size: 14px;
1395
+ font-weight: 500;
1396
+ cursor: pointer;
1397
+ transition: opacity 0.2s, transform 0.1s;
1398
+ }
1399
+
1400
+ .pp-prechat-submit:hover:not(:disabled) {
1401
+ opacity: 0.9;
1402
+ }
1403
+
1404
+ .pp-prechat-submit:active:not(:disabled) {
1405
+ transform: scale(0.98);
1406
+ }
1407
+
1408
+ .pp-prechat-submit:disabled {
1409
+ opacity: 0.5;
1410
+ cursor: not-allowed;
1411
+ }
1412
+
1413
+ .pp-prechat-skip {
1414
+ width: 100%;
1415
+ padding: 12px;
1416
+ margin-top: 8px;
1417
+ border: none;
1418
+ background: transparent;
1419
+ color: ${r.textSecondary};
1420
+ font-size: 13px;
1421
+ cursor: pointer;
1422
+ transition: color 0.2s;
1423
+ }
1424
+
1425
+ .pp-prechat-skip:hover {
1426
+ color: ${r.text};
1427
+ }
1428
+ `}var Kn={version:4,country_calling_codes:{1:["US","AG","AI","AS","BB","BM","BS","CA","DM","DO","GD","GU","JM","KN","KY","LC","MP","MS","PR","SX","TC","TT","VC","VG","VI"],7:["RU","KZ"],20:["EG"],27:["ZA"],30:["GR"],31:["NL"],32:["BE"],33:["FR"],34:["ES"],36:["HU"],39:["IT","VA"],40:["RO"],41:["CH"],43:["AT"],44:["GB","GG","IM","JE"],45:["DK"],46:["SE"],47:["NO","SJ"],48:["PL"],49:["DE"],51:["PE"],52:["MX"],53:["CU"],54:["AR"],55:["BR"],56:["CL"],57:["CO"],58:["VE"],60:["MY"],61:["AU","CC","CX"],62:["ID"],63:["PH"],64:["NZ"],65:["SG"],66:["TH"],81:["JP"],82:["KR"],84:["VN"],86:["CN"],90:["TR"],91:["IN"],92:["PK"],93:["AF"],94:["LK"],95:["MM"],98:["IR"],211:["SS"],212:["MA","EH"],213:["DZ"],216:["TN"],218:["LY"],220:["GM"],221:["SN"],222:["MR"],223:["ML"],224:["GN"],225:["CI"],226:["BF"],227:["NE"],228:["TG"],229:["BJ"],230:["MU"],231:["LR"],232:["SL"],233:["GH"],234:["NG"],235:["TD"],236:["CF"],237:["CM"],238:["CV"],239:["ST"],240:["GQ"],241:["GA"],242:["CG"],243:["CD"],244:["AO"],245:["GW"],246:["IO"],247:["AC"],248:["SC"],249:["SD"],250:["RW"],251:["ET"],252:["SO"],253:["DJ"],254:["KE"],255:["TZ"],256:["UG"],257:["BI"],258:["MZ"],260:["ZM"],261:["MG"],262:["RE","YT"],263:["ZW"],264:["NA"],265:["MW"],266:["LS"],267:["BW"],268:["SZ"],269:["KM"],290:["SH","TA"],291:["ER"],297:["AW"],298:["FO"],299:["GL"],350:["GI"],351:["PT"],352:["LU"],353:["IE"],354:["IS"],355:["AL"],356:["MT"],357:["CY"],358:["FI","AX"],359:["BG"],370:["LT"],371:["LV"],372:["EE"],373:["MD"],374:["AM"],375:["BY"],376:["AD"],377:["MC"],378:["SM"],380:["UA"],381:["RS"],382:["ME"],383:["XK"],385:["HR"],386:["SI"],387:["BA"],389:["MK"],420:["CZ"],421:["SK"],423:["LI"],500:["FK"],501:["BZ"],502:["GT"],503:["SV"],504:["HN"],505:["NI"],506:["CR"],507:["PA"],508:["PM"],509:["HT"],590:["GP","BL","MF"],591:["BO"],592:["GY"],593:["EC"],594:["GF"],595:["PY"],596:["MQ"],597:["SR"],598:["UY"],599:["CW","BQ"],670:["TL"],672:["NF"],673:["BN"],674:["NR"],675:["PG"],676:["TO"],677:["SB"],678:["VU"],679:["FJ"],680:["PW"],681:["WF"],682:["CK"],683:["NU"],685:["WS"],686:["KI"],687:["NC"],688:["TV"],689:["PF"],690:["TK"],691:["FM"],692:["MH"],850:["KP"],852:["HK"],853:["MO"],855:["KH"],856:["LA"],880:["BD"],886:["TW"],960:["MV"],961:["LB"],962:["JO"],963:["SY"],964:["IQ"],965:["KW"],966:["SA"],967:["YE"],968:["OM"],970:["PS"],971:["AE"],972:["IL"],973:["BH"],974:["QA"],975:["BT"],976:["MN"],977:["NP"],992:["TJ"],993:["TM"],994:["AZ"],995:["GE"],996:["KG"],998:["UZ"]},countries:{AC:["247","00","(?:[01589]\\d|[46])\\d{4}",[5,6]],AD:["376","00","(?:1|6\\d)\\d{7}|[135-9]\\d{5}",[6,8,9],[["(\\d{3})(\\d{3})","$1 $2",["[135-9]"]],["(\\d{4})(\\d{4})","$1 $2",["1"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["6"]]]],AE:["971","00","(?:[4-7]\\d|9[0-689])\\d{7}|800\\d{2,9}|[2-4679]\\d{7}",[5,6,7,8,9,10,11,12],[["(\\d{3})(\\d{2,9})","$1 $2",["60|8"]],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[236]|[479][2-8]"],"0$1"],["(\\d{3})(\\d)(\\d{5})","$1 $2 $3",["[479]"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["5"],"0$1"]],"0"],AF:["93","00","[2-7]\\d{8}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[2-7]"],"0$1"]],"0"],AG:["1","011","(?:268|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([457]\\d{6})$|1","268$1",0,"268"],AI:["1","011","(?:264|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2457]\\d{6})$|1","264$1",0,"264"],AL:["355","00","(?:700\\d\\d|900)\\d{3}|8\\d{5,7}|(?:[2-5]|6\\d)\\d{7}",[6,7,8,9],[["(\\d{3})(\\d{3,4})","$1 $2",["80|9"],"0$1"],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["4[2-6]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[2358][2-5]|4"],"0$1"],["(\\d{3})(\\d{5})","$1 $2",["[23578]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["6"],"0$1"]],"0"],AM:["374","00","(?:[1-489]\\d|55|60|77)\\d{6}",[8],[["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["[89]0"],"0 $1"],["(\\d{3})(\\d{5})","$1 $2",["2|3[12]"],"(0$1)"],["(\\d{2})(\\d{6})","$1 $2",["1|47"],"(0$1)"],["(\\d{2})(\\d{6})","$1 $2",["[3-9]"],"0$1"]],"0"],AO:["244","00","[29]\\d{8}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[29]"]]]],AR:["54","00","(?:11|[89]\\d\\d)\\d{8}|[2368]\\d{9}",[10,11],[["(\\d{4})(\\d{2})(\\d{4})","$1 $2-$3",["2(?:2[024-9]|3[0-59]|47|6[245]|9[02-8])|3(?:3[28]|4[03-9]|5[2-46-8]|7[1-578]|8[2-9])","2(?:[23]02|6(?:[25]|4[6-8])|9(?:[02356]|4[02568]|72|8[23]))|3(?:3[28]|4(?:[04679]|3[5-8]|5[4-68]|8[2379])|5(?:[2467]|3[237]|8[2-5])|7[1-578]|8(?:[2469]|3[2578]|5[4-8]|7[36-8]|8[5-8]))|2(?:2[24-9]|3[1-59]|47)","2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3[78]|5(?:4[46]|8)|8[2379])|5(?:[2467]|3[237]|8[23])|7[1-578]|8(?:[2469]|3[278]|5[56][46]|86[3-6]))|2(?:2[24-9]|3[1-59]|47)|38(?:[58][78]|7[378])|3(?:4[35][56]|58[45]|8(?:[38]5|54|76))[4-6]","2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3(?:5(?:4[0-25689]|[56])|[78])|58|8[2379])|5(?:[2467]|3[237]|8(?:[23]|4(?:[45]|60)|5(?:4[0-39]|5|64)))|7[1-578]|8(?:[2469]|3[278]|54(?:4|5[13-7]|6[89])|86[3-6]))|2(?:2[24-9]|3[1-59]|47)|38(?:[58][78]|7[378])|3(?:454|85[56])[46]|3(?:4(?:36|5[56])|8(?:[38]5|76))[4-6]"],"0$1",1],["(\\d{2})(\\d{4})(\\d{4})","$1 $2-$3",["1"],"0$1",1],["(\\d{3})(\\d{3})(\\d{4})","$1-$2-$3",["[68]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2-$3",["[23]"],"0$1",1],["(\\d)(\\d{4})(\\d{2})(\\d{4})","$2 15-$3-$4",["9(?:2[2-469]|3[3-578])","9(?:2(?:2[024-9]|3[0-59]|47|6[245]|9[02-8])|3(?:3[28]|4[03-9]|5[2-46-8]|7[1-578]|8[2-9]))","9(?:2(?:[23]02|6(?:[25]|4[6-8])|9(?:[02356]|4[02568]|72|8[23]))|3(?:3[28]|4(?:[04679]|3[5-8]|5[4-68]|8[2379])|5(?:[2467]|3[237]|8[2-5])|7[1-578]|8(?:[2469]|3[2578]|5[4-8]|7[36-8]|8[5-8])))|92(?:2[24-9]|3[1-59]|47)","9(?:2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3[78]|5(?:4[46]|8)|8[2379])|5(?:[2467]|3[237]|8[23])|7[1-578]|8(?:[2469]|3[278]|5(?:[56][46]|[78])|7[378]|8(?:6[3-6]|[78]))))|92(?:2[24-9]|3[1-59]|47)|93(?:4[35][56]|58[45]|8(?:[38]5|54|76))[4-6]","9(?:2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3(?:5(?:4[0-25689]|[56])|[78])|5(?:4[46]|8)|8[2379])|5(?:[2467]|3[237]|8(?:[23]|4(?:[45]|60)|5(?:4[0-39]|5|64)))|7[1-578]|8(?:[2469]|3[278]|5(?:4(?:4|5[13-7]|6[89])|[56][46]|[78])|7[378]|8(?:6[3-6]|[78]))))|92(?:2[24-9]|3[1-59]|47)|93(?:4(?:36|5[56])|8(?:[38]5|76))[4-6]"],"0$1",0,"$1 $2 $3-$4"],["(\\d)(\\d{2})(\\d{4})(\\d{4})","$2 15-$3-$4",["91"],"0$1",0,"$1 $2 $3-$4"],["(\\d{3})(\\d{3})(\\d{5})","$1-$2-$3",["8"],"0$1"],["(\\d)(\\d{3})(\\d{3})(\\d{4})","$2 15-$3-$4",["9"],"0$1",0,"$1 $2 $3-$4"]],"0",0,"0?(?:(11|2(?:2(?:02?|[13]|2[13-79]|4[1-6]|5[2457]|6[124-8]|7[1-4]|8[13-6]|9[1267])|3(?:02?|1[467]|2[03-6]|3[13-8]|[49][2-6]|5[2-8]|[67])|4(?:7[3-578]|9)|6(?:[0136]|2[24-6]|4[6-8]?|5[15-8])|80|9(?:0[1-3]|[19]|2\\d|3[1-6]|4[02568]?|5[2-4]|6[2-46]|72?|8[23]?))|3(?:3(?:2[79]|6|8[2578])|4(?:0[0-24-9]|[12]|3[5-8]?|4[24-7]|5[4-68]?|6[02-9]|7[126]|8[2379]?|9[1-36-8])|5(?:1|2[1245]|3[237]?|4[1-46-9]|6[2-4]|7[1-6]|8[2-5]?)|6[24]|7(?:[069]|1[1568]|2[15]|3[145]|4[13]|5[14-8]|7[2-57]|8[126])|8(?:[01]|2[15-7]|3[2578]?|4[13-6]|5[4-8]?|6[1-357-9]|7[36-8]?|8[5-8]?|9[124])))15)?","9$1"],AS:["1","011","(?:[58]\\d\\d|684|900)\\d{7}",[10],0,"1",0,"([267]\\d{6})$|1","684$1",0,"684"],AT:["43","00","1\\d{3,12}|2\\d{6,12}|43(?:(?:0\\d|5[02-9])\\d{3,9}|2\\d{4,5}|[3467]\\d{4}|8\\d{4,6}|9\\d{4,7})|5\\d{4,12}|8\\d{7,12}|9\\d{8,12}|(?:[367]\\d|4[0-24-9])\\d{4,11}",[4,5,6,7,8,9,10,11,12,13],[["(\\d)(\\d{3,12})","$1 $2",["1(?:11|[2-9])"],"0$1"],["(\\d{3})(\\d{2})","$1 $2",["517"],"0$1"],["(\\d{2})(\\d{3,5})","$1 $2",["5[079]"],"0$1"],["(\\d{3})(\\d{3,10})","$1 $2",["(?:31|4)6|51|6(?:48|5[0-3579]|[6-9])|7(?:20|32|8)|[89]","(?:31|4)6|51|6(?:485|5[0-3579]|[6-9])|7(?:20|32|8)|[89]"],"0$1"],["(\\d{4})(\\d{3,9})","$1 $2",["[2-467]|5[2-6]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["5"],"0$1"],["(\\d{2})(\\d{4})(\\d{4,7})","$1 $2 $3",["5"],"0$1"]],"0"],AU:["61","001[14-689]|14(?:1[14]|34|4[17]|[56]6|7[47]|88)0011","1(?:[0-79]\\d{7}(?:\\d(?:\\d{2})?)?|8[0-24-9]\\d{7})|[2-478]\\d{8}|1\\d{4,7}",[5,6,7,8,9,10,12],[["(\\d{2})(\\d{3,4})","$1 $2",["16"],"0$1"],["(\\d{2})(\\d{3})(\\d{2,4})","$1 $2 $3",["16"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["14|4"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["[2378]"],"(0$1)"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1(?:30|[89])"]]],"0",0,"(183[12])|0",0,0,0,[["(?:(?:241|349)0\\d\\d|8(?:51(?:0(?:0[03-9]|[12479]\\d|3[2-9]|5[0-8]|6[1-9]|8[0-7])|1(?:[0235689]\\d|1[0-69]|4[0-589]|7[0-47-9])|2(?:0[0-79]|[18][13579]|2[14-9]|3[0-46-9]|[4-6]\\d|7[89]|9[0-4])|[34]\\d\\d)|91(?:(?:[0-58]\\d|6[0135-9])\\d|7(?:0[0-24-9]|[1-9]\\d)|9(?:[0-46-9]\\d|5[0-79]))))\\d{3}|(?:2(?:[0-26-9]\\d|3[0-8]|4[02-9]|5[0135-9])|3(?:[0-3589]\\d|4[0-578]|6[1-9]|7[0-35-9])|7(?:[013-57-9]\\d|2[0-8])|8(?:55|6[0-8]|[78]\\d|9[02-9]))\\d{6}",[9]],["4(?:79[01]|83[0-36-9]|95[0-3])\\d{5}|4(?:[0-36]\\d|4[047-9]|[58][0-24-9]|7[02-8]|9[0-47-9])\\d{6}",[9]],["180(?:0\\d{3}|2)\\d{3}",[7,10]],["190[0-26]\\d{6}",[10]],0,0,0,["163\\d{2,6}",[5,6,7,8,9]],["14(?:5(?:1[0458]|[23][458])|71\\d)\\d{4}",[9]],["13(?:00\\d{6}(?:\\d{2})?|45[0-4]\\d{3})|13\\d{4}",[6,8,10,12]]],"0011"],AW:["297","00","(?:[25-79]\\d\\d|800)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[25-9]"]]]],AX:["358","00|99(?:[01469]|5(?:[14]1|3[23]|5[59]|77|88|9[09]))","2\\d{4,9}|35\\d{4,5}|(?:60\\d\\d|800)\\d{4,6}|7\\d{5,11}|(?:[14]\\d|3[0-46-9]|50)\\d{4,8}",[5,6,7,8,9,10,11,12],0,"0",0,0,0,0,"18",0,"00"],AZ:["994","00","365\\d{6}|(?:[124579]\\d|60|88)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["90"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["1[28]|2|365|46","1[28]|2|365[45]|46","1[28]|2|365(?:4|5[02])|46"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[13-9]"],"0$1"]],"0"],BA:["387","00","6\\d{8}|(?:[35689]\\d|49|70)\\d{6}",[8,9],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["6[1-3]|[7-9]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2-$3",["[3-5]|6[56]"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3 $4",["6"],"0$1"]],"0"],BB:["1","011","(?:246|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","246$1",0,"246"],BD:["880","00","[1-469]\\d{9}|8[0-79]\\d{7,8}|[2-79]\\d{8}|[2-9]\\d{7}|[3-9]\\d{6}|[57-9]\\d{5}",[6,7,8,9,10],[["(\\d{2})(\\d{4,6})","$1-$2",["31[5-8]|[459]1"],"0$1"],["(\\d{3})(\\d{3,7})","$1-$2",["3(?:[67]|8[013-9])|4(?:6[168]|7|[89][18])|5(?:6[128]|9)|6(?:[15]|28|4[14])|7[2-589]|8(?:0[014-9]|[12])|9[358]|(?:3[2-5]|4[235]|5[2-578]|6[0389]|76|8[3-7]|9[24])1|(?:44|66)[01346-9]"],"0$1"],["(\\d{4})(\\d{3,6})","$1-$2",["[13-9]|2[23]"],"0$1"],["(\\d)(\\d{7,8})","$1-$2",["2"],"0$1"]],"0"],BE:["32","00","4\\d{8}|[1-9]\\d{7}",[8,9],[["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["(?:80|9)0"],"0$1"],["(\\d)(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[239]|4[23]"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[15-8]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["4"],"0$1"]],"0"],BF:["226","00","(?:[025-7]\\d|44)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[024-7]"]]]],BG:["359","00","00800\\d{7}|[2-7]\\d{6,7}|[89]\\d{6,8}|2\\d{5}",[6,7,8,9,12],[["(\\d)(\\d)(\\d{2})(\\d{2})","$1 $2 $3 $4",["2"],"0$1"],["(\\d{3})(\\d{4})","$1 $2",["43[1-6]|70[1-9]"],"0$1"],["(\\d)(\\d{3})(\\d{3,4})","$1 $2 $3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{2,3})","$1 $2 $3",["[356]|4[124-7]|7[1-9]|8[1-6]|9[1-7]"],"0$1"],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["(?:70|8)0"],"0$1"],["(\\d{3})(\\d{3})(\\d{2})","$1 $2 $3",["43[1-7]|7"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[48]|9[08]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["9"],"0$1"]],"0"],BH:["973","00","[136-9]\\d{7}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[13679]|8[02-4679]"]]]],BI:["257","00","(?:[267]\\d|31)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2367]"]]]],BJ:["229","00","(?:01\\d|8)\\d{7}",[8,10],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["0"]]]],BL:["590","00","(?:590\\d|7090)\\d{5}|(?:69|80|9\\d)\\d{7}",[9],0,"0",0,0,0,0,0,[["590(?:2[7-9]|3[3-7]|5[12]|87)\\d{4}"],["(?:69(?:0\\d\\d|1(?:2[2-9]|3[0-5])|4(?:0[89]|1[2-6]|9\\d)|6(?:1[016-9]|5[0-4]|[67]\\d))|7090[0-4])\\d{4}"],["80[0-5]\\d{6}"],0,0,0,0,0,["9(?:(?:39[5-7]|76[018])\\d|475[0-6])\\d{4}"]]],BM:["1","011","(?:441|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","441$1",0,"441"],BN:["673","00","[2-578]\\d{6}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[2-578]"]]]],BO:["591","00(?:1\\d)?","8001\\d{5}|(?:[2-467]\\d|50)\\d{6}",[8,9],[["(\\d)(\\d{7})","$1 $2",["[235]|4[46]"]],["(\\d{8})","$1",["[67]"]],["(\\d{3})(\\d{2})(\\d{4})","$1 $2 $3",["8"]]],"0",0,"0(1\\d)?"],BQ:["599","00","(?:[34]1|7\\d)\\d{5}",[7],0,0,0,0,0,0,"[347]"],BR:["55","00(?:1[245]|2[1-35]|31|4[13]|[56]5|99)","[1-467]\\d{9,10}|55[0-46-9]\\d{8}|[34]\\d{7}|55\\d{7,8}|(?:5[0-46-9]|[89]\\d)\\d{7,9}",[8,9,10,11],[["(\\d{4})(\\d{4})","$1-$2",["300|4(?:0[02]|37|86)","300|4(?:0(?:0|20)|370|864)"]],["(\\d{3})(\\d{2,3})(\\d{4})","$1 $2 $3",["(?:[358]|90)0"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1 $2-$3",["(?:[14689][1-9]|2[12478]|3[1-578]|5[13-5]|7[13-579])[2-57]"],"($1)"],["(\\d{2})(\\d{5})(\\d{4})","$1 $2-$3",["[16][1-9]|[2-57-9]"],"($1)"]],"0",0,"(?:0|90)(?:(1[245]|2[1-35]|31|4[13]|[56]5|99)(\\d{10,11}))?","$2"],BS:["1","011","(?:242|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([3-8]\\d{6})$|1","242$1",0,"242"],BT:["975","00","[178]\\d{7}|[2-8]\\d{6}",[7,8],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[2-6]|7[246]|8[2-4]"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["1[67]|[78]"]]]],BW:["267","00","(?:0800|(?:[37]|800)\\d)\\d{6}|(?:[2-6]\\d|90)\\d{5}",[7,8,10],[["(\\d{2})(\\d{5})","$1 $2",["90"]],["(\\d{3})(\\d{4})","$1 $2",["[24-6]|3[15-9]"]],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[37]"]],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["0"]],["(\\d{3})(\\d{4})(\\d{3})","$1 $2 $3",["8"]]]],BY:["375","810","(?:[12]\\d|33|44|902)\\d{7}|8(?:0[0-79]\\d{5,7}|[1-7]\\d{9})|8(?:1[0-489]|[5-79]\\d)\\d{7}|8[1-79]\\d{6,7}|8[0-79]\\d{5}|8\\d{5}",[6,7,8,9,10,11],[["(\\d{3})(\\d{3})","$1 $2",["800"],"8 $1"],["(\\d{3})(\\d{2})(\\d{2,4})","$1 $2 $3",["800"],"8 $1"],["(\\d{4})(\\d{2})(\\d{3})","$1 $2-$3",["1(?:5[169]|6[3-5]|7[179])|2(?:1[35]|2[34]|3[3-5])","1(?:5[169]|6(?:3[1-3]|4|5[125])|7(?:1[3-9]|7[0-24-6]|9[2-7]))|2(?:1[35]|2[34]|3[3-5])"],"8 0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2-$3-$4",["1(?:[56]|7[467])|2[1-3]"],"8 0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2-$3-$4",["[1-4]"],"8 0$1"],["(\\d{3})(\\d{3,4})(\\d{4})","$1 $2 $3",["[89]"],"8 $1"]],"8",0,"0|80?",0,0,0,0,"8~10"],BZ:["501","00","(?:0800\\d|[2-8])\\d{6}",[7,11],[["(\\d{3})(\\d{4})","$1-$2",["[2-8]"]],["(\\d)(\\d{3})(\\d{4})(\\d{3})","$1-$2-$3-$4",["0"]]]],CA:["1","011","[2-9]\\d{9}|3\\d{6}",[7,10],0,"1",0,0,0,0,0,[["(?:2(?:04|[23]6|[48]9|5[07]|63)|3(?:06|43|54|6[578]|82)|4(?:03|1[68]|[26]8|3[178]|50|74)|5(?:06|1[49]|48|79|8[147])|6(?:04|[18]3|39|47|72)|7(?:0[59]|42|53|78|8[02])|8(?:[06]7|19|25|7[39])|9(?:0[25]|42))[2-9]\\d{6}",[10]],["",[10]],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}",[10]],["900[2-9]\\d{6}",[10]],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|(?:5(?:2[125-9]|3[23]|44|66|77|88)|6(?:22|33))[2-9]\\d{6}",[10]],0,["310\\d{4}",[7]],0,["600[2-9]\\d{6}",[10]]]],CC:["61","001[14-689]|14(?:1[14]|34|4[17]|[56]6|7[47]|88)0011","1(?:[0-79]\\d{8}(?:\\d{2})?|8[0-24-9]\\d{7})|[148]\\d{8}|1\\d{5,7}",[6,7,8,9,10,12],0,"0",0,"([59]\\d{7})$|0","8$1",0,0,[["8(?:51(?:0(?:02|31|60|89)|1(?:18|76)|223)|91(?:0(?:1[0-2]|29)|1(?:[28]2|50|79)|2(?:10|64)|3(?:[06]8|22)|4[29]8|62\\d|70[23]|959))\\d{3}",[9]],["4(?:79[01]|83[0-36-9]|95[0-3])\\d{5}|4(?:[0-36]\\d|4[047-9]|[58][0-24-9]|7[02-8]|9[0-47-9])\\d{6}",[9]],["180(?:0\\d{3}|2)\\d{3}",[7,10]],["190[0-26]\\d{6}",[10]],0,0,0,0,["14(?:5(?:1[0458]|[23][458])|71\\d)\\d{4}",[9]],["13(?:00\\d{6}(?:\\d{2})?|45[0-4]\\d{3})|13\\d{4}",[6,8,10,12]]],"0011"],CD:["243","00","(?:(?:[189]|5\\d)\\d|2)\\d{7}|[1-68]\\d{6}",[7,8,9,10],[["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["88"],"0$1"],["(\\d{2})(\\d{5})","$1 $2",["[1-6]"],"0$1"],["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["1"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[89]"],"0$1"],["(\\d{2})(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3 $4",["5"],"0$1"]],"0"],CF:["236","00","(?:[27]\\d{3}|8776)\\d{4}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[278]"]]]],CG:["242","00","222\\d{6}|(?:0\\d|80)\\d{7}",[9],[["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["8"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[02]"]]]],CH:["41","00","8\\d{11}|[2-9]\\d{8}",[9,12],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8[047]|90"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-79]|81"],"0$1"],["(\\d{3})(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["8"],"0$1"]],"0"],CI:["225","00","[02]\\d{9}",[10],[["(\\d{2})(\\d{2})(\\d)(\\d{5})","$1 $2 $3 $4",["2"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3 $4",["0"]]]],CK:["682","00","[2-578]\\d{4}",[5],[["(\\d{2})(\\d{3})","$1 $2",["[2-578]"]]]],CL:["56","(?:0|1(?:1[0-69]|2[02-5]|5[13-58]|69|7[0167]|8[018]))0","12300\\d{6}|6\\d{9,10}|[2-9]\\d{8}",[9,10,11],[["(\\d{5})(\\d{4})","$1 $2",["219","2196"],"($1)"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["60|809"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["44"]],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["2[1-36]"],"($1)"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["9(?:10|[2-9])"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["3[2-5]|[47]|5[1-3578]|6[13-57]|8(?:0[1-8]|[1-9])"],"($1)"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["60|8"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["1"]],["(\\d{3})(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3 $4",["60"]]]],CM:["237","00","[26]\\d{8}|88\\d{6,7}",[8,9],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["88"]],["(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["[26]|88"]]]],CN:["86","00|1(?:[12]\\d|79)\\d\\d00","(?:(?:1[03-689]|2\\d)\\d\\d|6)\\d{8}|1\\d{10}|[126]\\d{6}(?:\\d(?:\\d{2})?)?|86\\d{5,6}|(?:[3-579]\\d|8[0-57-9])\\d{5,9}",[7,8,9,10,11,12],[["(\\d{2})(\\d{5,6})","$1 $2",["(?:10|2[0-57-9])[19]|3(?:[157]|35|49|9[1-68])|4(?:1[124-9]|2[179]|6[47-9]|7|8[23])|5(?:[1357]|2[37]|4[36]|6[1-46]|80)|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:07|1[236-8]|2[5-7]|[37]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|3|4[13]|5[1-5]|7[0-79]|9[0-35-9])|(?:4[35]|59|85)[1-9]","(?:10|2[0-57-9])(?:1[02]|9[56])|8078|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:1[124-9]|2[179]|[35][1-9]|6[47-9]|7\\d|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|3\\d|4[13]|5[1-5]|7[0-79]|9[0-35-9]))1","10(?:1(?:0|23)|9[56])|2[0-57-9](?:1(?:00|23)|9[56])|80781|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:1[124-9]|2[179]|[35][1-9]|6[47-9]|7\\d|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|3\\d|4[13]|5[1-5]|7[0-79]|9[0-35-9]))12","10(?:1(?:0|23)|9[56])|2[0-57-9](?:1(?:00|23)|9[56])|807812|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:1[124-9]|2[179]|[35][1-9]|6[47-9]|7\\d|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|3\\d|4[13]|5[1-5]|7[0-79]|9[0-35-9]))123","10(?:1(?:0|23)|9[56])|2[0-57-9](?:1(?:00|23)|9[56])|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:1[124-9]|2[179]|[35][1-9]|6[47-9]|7\\d|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:078|1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|3\\d|4[13]|5[1-5]|7[0-79]|9[0-35-9]))123"],"0$1"],["(\\d{3})(\\d{5,6})","$1 $2",["3(?:[157]|35|49|9[1-68])|4(?:[17]|2[179]|6[47-9]|8[23])|5(?:[1357]|2[37]|4[36]|6[1-46]|80)|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]|4[13]|5[1-5])|(?:4[35]|59|85)[1-9]","(?:3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))[19]","85[23](?:10|95)|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[14-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))(?:10|9[56])","85[23](?:100|95)|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[14-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))(?:100|9[56])"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["(?:4|80)0"]],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["10|2(?:[02-57-9]|1[1-9])","10|2(?:[02-57-9]|1[1-9])","10[0-79]|2(?:[02-57-9]|1[1-79])|(?:10|21)8(?:0[1-9]|[1-9])"],"0$1",1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["3(?:[3-59]|7[02-68])|4(?:[26-8]|3[3-9]|5[2-9])|5(?:3[03-9]|[468]|7[028]|9[2-46-9])|6|7(?:[0-247]|3[04-9]|5[0-4689]|6[2368])|8(?:[1-358]|9[1-7])|9(?:[013479]|5[1-5])|(?:[34]1|55|79|87)[02-9]"],"0$1",1],["(\\d{3})(\\d{7,8})","$1 $2",["9"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["80"],"0$1",1],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["[3-578]"],"0$1",1],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["1[3-9]"]],["(\\d{2})(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3 $4",["[12]"],"0$1",1]],"0",0,"(1(?:[12]\\d|79)\\d\\d)|0",0,0,0,0,"00"],CO:["57","00(?:4(?:[14]4|56)|[579])","(?:46|60\\d\\d)\\d{6}|(?:1\\d|[39])\\d{9}",[8,10,11],[["(\\d{4})(\\d{4})","$1 $2",["46"]],["(\\d{3})(\\d{7})","$1 $2",["6|90"],"($1)"],["(\\d{3})(\\d{7})","$1 $2",["3[0-357]|9[14]"]],["(\\d)(\\d{3})(\\d{7})","$1-$2-$3",["1"],"0$1",0,"$1 $2 $3"]],"0",0,"0([3579]|4(?:[14]4|56))?"],CR:["506","00","(?:8\\d|90)\\d{8}|(?:[24-8]\\d{3}|3005)\\d{4}",[8,10],[["(\\d{4})(\\d{4})","$1 $2",["[2-7]|8[3-9]"]],["(\\d{3})(\\d{3})(\\d{4})","$1-$2-$3",["[89]"]]],0,0,"(19(?:0[0-2468]|1[09]|20|66|77|99))"],CU:["53","119","(?:[2-7]|8\\d\\d)\\d{7}|[2-47]\\d{6}|[34]\\d{5}",[6,7,8,10],[["(\\d{2})(\\d{4,6})","$1 $2",["2[1-4]|[34]"],"(0$1)"],["(\\d)(\\d{6,7})","$1 $2",["7"],"(0$1)"],["(\\d)(\\d{7})","$1 $2",["[56]"],"0$1"],["(\\d{3})(\\d{7})","$1 $2",["8"],"0$1"]],"0"],CV:["238","0","(?:[2-59]\\d\\d|800)\\d{4}",[7],[["(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3",["[2-589]"]]]],CW:["599","00","(?:[34]1|60|(?:7|9\\d)\\d)\\d{5}",[7,8],[["(\\d{3})(\\d{4})","$1 $2",["[3467]"]],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["9[4-8]"]]],0,0,0,0,0,"[69]"],CX:["61","001[14-689]|14(?:1[14]|34|4[17]|[56]6|7[47]|88)0011","1(?:[0-79]\\d{8}(?:\\d{2})?|8[0-24-9]\\d{7})|[148]\\d{8}|1\\d{5,7}",[6,7,8,9,10,12],0,"0",0,"([59]\\d{7})$|0","8$1",0,0,[["8(?:51(?:0(?:01|30|59|88)|1(?:17|46|75)|2(?:22|35))|91(?:00[6-9]|1(?:[28]1|49|78)|2(?:09|63)|3(?:12|26|75)|4(?:56|97)|64\\d|7(?:0[01]|1[0-2])|958))\\d{3}",[9]],["4(?:79[01]|83[0-36-9]|95[0-3])\\d{5}|4(?:[0-36]\\d|4[047-9]|[58][0-24-9]|7[02-8]|9[0-47-9])\\d{6}",[9]],["180(?:0\\d{3}|2)\\d{3}",[7,10]],["190[0-26]\\d{6}",[10]],0,0,0,0,["14(?:5(?:1[0458]|[23][458])|71\\d)\\d{4}",[9]],["13(?:00\\d{6}(?:\\d{2})?|45[0-4]\\d{3})|13\\d{4}",[6,8,10,12]]],"0011"],CY:["357","00","(?:[279]\\d|[58]0)\\d{6}",[8],[["(\\d{2})(\\d{6})","$1 $2",["[257-9]"]]]],CZ:["420","00","(?:[2-578]\\d|60)\\d{7}|9\\d{8,11}",[9,10,11,12],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[2-8]|9[015-7]"]],["(\\d{2})(\\d{3})(\\d{3})(\\d{2})","$1 $2 $3 $4",["96"]],["(\\d{2})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["9"]],["(\\d{3})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["9"]]]],DE:["49","00","[2579]\\d{5,14}|49(?:[34]0|69|8\\d)\\d\\d?|49(?:37|49|60|7[089]|9\\d)\\d{1,3}|49(?:2[024-9]|3[2-689]|7[1-7])\\d{1,8}|(?:1|[368]\\d|4[0-8])\\d{3,13}|49(?:[015]\\d|2[13]|31|[46][1-8])\\d{1,9}",[4,5,6,7,8,9,10,11,12,13,14,15],[["(\\d{2})(\\d{3,13})","$1 $2",["3[02]|40|[68]9"],"0$1"],["(\\d{3})(\\d{3,12})","$1 $2",["2(?:0[1-389]|1[124]|2[18]|3[14])|3(?:[35-9][15]|4[015])|906|(?:2[4-9]|4[2-9]|[579][1-9]|[68][1-8])1","2(?:0[1-389]|12[0-8])|3(?:[35-9][15]|4[015])|906|2(?:[13][14]|2[18])|(?:2[4-9]|4[2-9]|[579][1-9]|[68][1-8])1"],"0$1"],["(\\d{4})(\\d{2,11})","$1 $2",["[24-6]|3(?:[3569][02-46-9]|4[2-4679]|7[2-467]|8[2-46-8])|70[2-8]|8(?:0[2-9]|[1-8])|90[7-9]|[79][1-9]","[24-6]|3(?:3(?:0[1-467]|2[127-9]|3[124578]|7[1257-9]|8[1256]|9[145])|4(?:2[135]|4[13578]|9[1346])|5(?:0[14]|2[1-3589]|6[1-4]|7[13468]|8[13568])|6(?:2[1-489]|3[124-6]|6[13]|7[12579]|8[1-356]|9[135])|7(?:2[1-7]|4[145]|6[1-5]|7[1-4])|8(?:21|3[1468]|6|7[1467]|8[136])|9(?:0[12479]|2[1358]|4[134679]|6[1-9]|7[136]|8[147]|9[1468]))|70[2-8]|8(?:0[2-9]|[1-8])|90[7-9]|[79][1-9]|3[68]4[1347]|3(?:47|60)[1356]|3(?:3[46]|46|5[49])[1246]|3[4579]3[1357]"],"0$1"],["(\\d{3})(\\d{4})","$1 $2",["138"],"0$1"],["(\\d{5})(\\d{2,10})","$1 $2",["3"],"0$1"],["(\\d{3})(\\d{5,11})","$1 $2",["181"],"0$1"],["(\\d{3})(\\d)(\\d{4,10})","$1 $2 $3",["1(?:3|80)|9"],"0$1"],["(\\d{3})(\\d{7,8})","$1 $2",["1[67]"],"0$1"],["(\\d{3})(\\d{7,12})","$1 $2",["8"],"0$1"],["(\\d{5})(\\d{6})","$1 $2",["185","1850","18500"],"0$1"],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["7"],"0$1"],["(\\d{4})(\\d{7})","$1 $2",["18[68]"],"0$1"],["(\\d{4})(\\d{7})","$1 $2",["15[1279]"],"0$1"],["(\\d{5})(\\d{6})","$1 $2",["15[03568]","15(?:[0568]|3[13])"],"0$1"],["(\\d{3})(\\d{8})","$1 $2",["18"],"0$1"],["(\\d{3})(\\d{2})(\\d{7,8})","$1 $2 $3",["1(?:6[023]|7)"],"0$1"],["(\\d{4})(\\d{2})(\\d{7})","$1 $2 $3",["15[279]"],"0$1"],["(\\d{3})(\\d{2})(\\d{8})","$1 $2 $3",["15"],"0$1"]],"0"],DJ:["253","00","(?:2\\d|77)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[27]"]]]],DK:["45","00","[2-9]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-9]"]]]],DM:["1","011","(?:[58]\\d\\d|767|900)\\d{7}",[10],0,"1",0,"([2-7]\\d{6})$|1","767$1",0,"767"],DO:["1","011","(?:[58]\\d\\d|900)\\d{7}",[10],0,"1",0,0,0,0,"8001|8[024]9"],DZ:["213","00","(?:[1-4]|[5-79]\\d|80)\\d{7}",[8,9],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[1-4]"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["9"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-8]"],"0$1"]],"0"],EC:["593","00","1\\d{9,10}|(?:[2-7]|9\\d)\\d{7}",[8,9,10,11],[["(\\d)(\\d{3})(\\d{4})","$1 $2-$3",["[2-7]"],"(0$1)",0,"$1-$2-$3"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["9"],"0$1"],["(\\d{4})(\\d{3})(\\d{3,4})","$1 $2 $3",["1"]]],"0"],EE:["372","00","8\\d{9}|[4578]\\d{7}|(?:[3-8]\\d|90)\\d{5}",[7,8,10],[["(\\d{3})(\\d{4})","$1 $2",["[369]|4[3-8]|5(?:[0-2]|5[0-478]|6[45])|7[1-9]|88","[369]|4[3-8]|5(?:[02]|1(?:[0-8]|95)|5[0-478]|6(?:4[0-4]|5[1-589]))|7[1-9]|88"]],["(\\d{4})(\\d{3,4})","$1 $2",["[45]|8(?:00|[1-49])","[45]|8(?:00[1-9]|[1-49])"]],["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["7"]],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["8"]]]],EG:["20","00","[189]\\d{8,9}|[24-6]\\d{8}|[135]\\d{7}",[8,9,10],[["(\\d)(\\d{7,8})","$1 $2",["[23]"],"0$1"],["(\\d{2})(\\d{6,7})","$1 $2",["1[35]|[4-6]|8[2468]|9[235-7]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[89]"],"0$1"],["(\\d{2})(\\d{8})","$1 $2",["1"],"0$1"]],"0"],EH:["212","00","[5-8]\\d{8}",[9],0,"0",0,0,0,0,"528[89]"],ER:["291","00","[178]\\d{6}",[7],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[178]"],"0$1"]],"0"],ES:["34","00","[5-9]\\d{8}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[89]00"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-9]"]]]],ET:["251","00","(?:11|[2-579]\\d)\\d{7}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[1-579]"],"0$1"]],"0"],FI:["358","00|99(?:[01469]|5(?:[14]1|3[23]|5[59]|77|88|9[09]))","[1-35689]\\d{4}|7\\d{10,11}|(?:[124-7]\\d|3[0-46-9])\\d{8}|[1-9]\\d{5,8}",[5,6,7,8,9,10,11,12],[["(\\d{5})","$1",["20[2-59]"],"0$1"],["(\\d{3})(\\d{3,7})","$1 $2",["(?:[1-3]0|[68])0|70[07-9]"],"0$1"],["(\\d{2})(\\d{4,8})","$1 $2",["[14]|2[09]|50|7[135]"],"0$1"],["(\\d{2})(\\d{6,10})","$1 $2",["7"],"0$1"],["(\\d)(\\d{4,9})","$1 $2",["(?:19|[2568])[1-8]|3(?:0[1-9]|[1-9])|9"],"0$1"]],"0",0,0,0,0,"1[03-79]|[2-9]",0,"00"],FJ:["679","0(?:0|52)","45\\d{5}|(?:0800\\d|[235-9])\\d{6}",[7,11],[["(\\d{3})(\\d{4})","$1 $2",["[235-9]|45"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["0"]]],0,0,0,0,0,0,0,"00"],FK:["500","00","[2-7]\\d{4}",[5]],FM:["691","00","(?:[39]\\d\\d|820)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[389]"]]]],FO:["298","00","[2-9]\\d{5}",[6],[["(\\d{6})","$1",["[2-9]"]]],0,0,"(10(?:01|[12]0|88))"],FR:["33","00","[1-9]\\d{8}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0 $1"],["(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["[1-79]"],"0$1"]],"0"],GA:["241","00","(?:[067]\\d|11)\\d{6}|[2-7]\\d{6}",[7,8],[["(\\d)(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-7]"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["0"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["11|[67]"],"0$1"]],0,0,"0(11\\d{6}|60\\d{6}|61\\d{6}|6[256]\\d{6}|7[467]\\d{6})","$1"],GB:["44","00","[1-357-9]\\d{9}|[18]\\d{8}|8\\d{6}",[7,9,10],[["(\\d{3})(\\d{4})","$1 $2",["800","8001","80011","800111","8001111"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3",["845","8454","84546","845464"],"0$1"],["(\\d{3})(\\d{6})","$1 $2",["800"],"0$1"],["(\\d{5})(\\d{4,5})","$1 $2",["1(?:38|5[23]|69|76|94)","1(?:(?:38|69)7|5(?:24|39)|768|946)","1(?:3873|5(?:242|39[4-6])|(?:697|768)[347]|9467)"],"0$1"],["(\\d{4})(\\d{5,6})","$1 $2",["1(?:[2-69][02-9]|[78])"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["[25]|7(?:0|6[02-9])","[25]|7(?:0|6(?:[03-9]|2[356]))"],"0$1"],["(\\d{4})(\\d{6})","$1 $2",["7"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[1389]"],"0$1"]],"0",0,"0|180020",0,0,0,[["(?:1(?:1(?:3(?:[0-58]\\d\\d|73[0-5])|4(?:(?:[0-5]\\d|70)\\d|69[7-9])|(?:(?:5[0-26-9]|[78][0-49])\\d|6(?:[0-4]\\d|5[01]))\\d)|(?:2(?:(?:0[024-9]|2[3-9]|3[3-79]|4[1-689]|[58][02-9]|6[0-47-9]|7[013-9]|9\\d)\\d|1(?:[0-7]\\d|8[0-3]))|(?:3(?:0\\d|1[0-8]|[25][02-9]|3[02-579]|[468][0-46-9]|7[1-35-79]|9[2-578])|4(?:0[03-9]|[137]\\d|[28][02-57-9]|4[02-69]|5[0-8]|[69][0-79])|5(?:0[1-35-9]|[16]\\d|2[024-9]|3[015689]|4[02-9]|5[03-9]|7[0-35-9]|8[0-468]|9[0-57-9])|6(?:0[034689]|1\\d|2[0-35689]|[38][013-9]|4[1-467]|5[0-69]|6[13-9]|7[0-8]|9[0-24578])|7(?:0[0246-9]|2\\d|3[0236-8]|4[03-9]|5[0-46-9]|6[013-9]|7[0-35-9]|8[024-9]|9[02-9])|8(?:0[35-9]|2[1-57-9]|3[02-578]|4[0-578]|5[124-9]|6[2-69]|7\\d|8[02-9]|9[02569])|9(?:0[02-589]|[18]\\d|2[02-689]|3[1-57-9]|4[2-9]|5[0-579]|6[2-47-9]|7[0-24578]|9[2-57]))\\d)\\d)|2(?:0[013478]|3[0189]|4[017]|8[0-46-9]|9[0-2])\\d{3})\\d{4}|1(?:2(?:0(?:46[1-4]|87[2-9])|545[1-79]|76(?:2\\d|3[1-8]|6[1-6])|9(?:7(?:2[0-4]|3[2-5])|8(?:2[2-8]|7[0-47-9]|8[3-5])))|3(?:6(?:38[2-5]|47[23])|8(?:47[04-9]|64[0157-9]))|4(?:044[1-7]|20(?:2[23]|8\\d)|6(?:0(?:30|5[2-57]|6[1-8]|7[2-8])|140)|8(?:052|87[1-3]))|5(?:2(?:4(?:3[2-79]|6\\d)|76\\d)|6(?:26[06-9]|686))|6(?:06(?:4\\d|7[4-79])|295[5-7]|35[34]\\d|47(?:24|61)|59(?:5[08]|6[67]|74)|9(?:55[0-4]|77[23]))|7(?:26(?:6[13-9]|7[0-7])|(?:442|688)\\d|50(?:2[0-3]|[3-68]2|76))|8(?:27[56]\\d|37(?:5[2-5]|8[239])|843[2-58])|9(?:0(?:0(?:6[1-8]|85)|52\\d)|3583|4(?:66[1-8]|9(?:2[01]|81))|63(?:23|3[1-4])|9561))\\d{3}",[9,10]],["7(?:457[0-57-9]|700[01]|911[028])\\d{5}|7(?:[1-3]\\d\\d|4(?:[0-46-9]\\d|5[0-689])|5(?:0[0-8]|[13-9]\\d|2[0-35-9])|7(?:0[1-9]|[1-7]\\d|8[02-9]|9[0-689])|8(?:[014-9]\\d|[23][0-8])|9(?:[024-9]\\d|1[02-9]|3[0-689]))\\d{6}",[10]],["80[08]\\d{7}|800\\d{6}|8001111"],["(?:8(?:4[2-5]|7[0-3])|9(?:[01]\\d|8[2-49]))\\d{7}|845464\\d",[7,10]],["70\\d{8}",[10]],0,["(?:3[0347]|55)\\d{8}",[10]],["76(?:464|652)\\d{5}|76(?:0[0-28]|2[356]|34|4[01347]|5[49]|6[0-369]|77|8[14]|9[139])\\d{6}",[10]],["56\\d{8}",[10]]],0," x"],GD:["1","011","(?:473|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","473$1",0,"473"],GE:["995","00","(?:[3-57]\\d\\d|800)\\d{6}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["70"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["32"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[57]"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[348]"],"0$1"]],"0"],GF:["594","00","(?:[56]94\\d|7093)\\d{5}|(?:80|9\\d)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-7]|9[47]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[89]"],"0$1"]],"0"],GG:["44","00","(?:1481|[357-9]\\d{3})\\d{6}|8\\d{6}(?:\\d{2})?",[7,9,10],0,"0",0,"([25-9]\\d{5})$|0|180020","1481$1",0,0,[["1481[25-9]\\d{5}",[10]],["7(?:(?:781|839)\\d|911[17])\\d{5}",[10]],["80[08]\\d{7}|800\\d{6}|8001111"],["(?:8(?:4[2-5]|7[0-3])|9(?:[01]\\d|8[0-3]))\\d{7}|845464\\d",[7,10]],["70\\d{8}",[10]],0,["(?:3[0347]|55)\\d{8}",[10]],["76(?:464|652)\\d{5}|76(?:0[0-28]|2[356]|34|4[01347]|5[49]|6[0-369]|77|8[14]|9[139])\\d{6}",[10]],["56\\d{8}",[10]]]],GH:["233","00","(?:[235]\\d{3}|800)\\d{5}",[8,9],[["(\\d{3})(\\d{5})","$1 $2",["8"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[235]"],"0$1"]],"0"],GI:["350","00","(?:[25]\\d|60)\\d{6}",[8],[["(\\d{3})(\\d{5})","$1 $2",["2"]]]],GL:["299","00","(?:19|[2-689]\\d|70)\\d{4}",[6],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["19|[2-9]"]]]],GM:["220","00","[2-9]\\d{6}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[2-9]"]]]],GN:["224","00","722\\d{6}|(?:3|6\\d)\\d{7}",[8,9],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["3"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[67]"]]]],GP:["590","00","(?:590\\d|7090)\\d{5}|(?:69|80|9\\d)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-79]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0$1"]],"0",0,0,0,0,0,[["590(?:0[1-68]|[14][0-24-9]|2[0-68]|3[1-9]|5[3-579]|[68][0-689]|7[08]|9\\d)\\d{4}"],["(?:69(?:0\\d\\d|1(?:2[2-9]|3[0-5])|4(?:0[89]|1[2-6]|9\\d)|6(?:1[016-9]|5[0-4]|[67]\\d))|7090[0-4])\\d{4}"],["80[0-5]\\d{6}"],0,0,0,0,0,["9(?:(?:39[5-7]|76[018])\\d|475[0-6])\\d{4}"]]],GQ:["240","00","222\\d{6}|(?:3\\d|55|[89]0)\\d{7}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[235]"]],["(\\d{3})(\\d{6})","$1 $2",["[89]"]]]],GR:["30","00","5005000\\d{3}|8\\d{9,11}|(?:[269]\\d|70)\\d{8}",[10,11,12],[["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["21|7"]],["(\\d{4})(\\d{6})","$1 $2",["2(?:2|3[2-57-9]|4[2-469]|5[2-59]|6[2-9]|7[2-69]|8[2-49])|5"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[2689]"]],["(\\d{3})(\\d{3,4})(\\d{5})","$1 $2 $3",["8"]]]],GT:["502","00","80\\d{6}|(?:1\\d{3}|[2-7])\\d{7}",[8,11],[["(\\d{4})(\\d{4})","$1 $2",["[2-8]"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["1"]]]],GU:["1","011","(?:[58]\\d\\d|671|900)\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","671$1",0,"671"],GW:["245","00","[49]\\d{8}|4\\d{6}",[7,9],[["(\\d{3})(\\d{4})","$1 $2",["40"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[49]"]]]],GY:["592","001","(?:[2-8]\\d{3}|9008)\\d{3}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[2-9]"]]]],HK:["852","00(?:30|5[09]|[126-9]?)","8[0-46-9]\\d{6,7}|9\\d{4,7}|(?:[2-7]|9\\d{3})\\d{7}",[5,6,7,8,9,11],[["(\\d{3})(\\d{2,5})","$1 $2",["900","9003"]],["(\\d{4})(\\d{4})","$1 $2",["[2-7]|8[1-4]|9(?:0[1-9]|[1-8])"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8"]],["(\\d{3})(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3 $4",["9"]]],0,0,0,0,0,0,0,"00"],HN:["504","00","8\\d{10}|[237-9]\\d{7}",[8,11],[["(\\d{4})(\\d{4})","$1-$2",["[237-9]"]]]],HR:["385","00","[2-69]\\d{8}|80\\d{5,7}|[1-79]\\d{7}|6\\d{6}",[7,8,9],[["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["6[01]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2,3})","$1 $2 $3",["8"],"0$1"],["(\\d)(\\d{4})(\\d{3})","$1 $2 $3",["1"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["6|7[245]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["9"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2-57]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8"],"0$1"]],"0"],HT:["509","00","[2-589]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["[2-589]"]]]],HU:["36","00","[235-7]\\d{8}|[1-9]\\d{7}",[8,9],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["1"],"(06 $1)"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[27][2-9]|3[2-7]|4[24-9]|5[2-79]|6|8[2-57-9]|9[2-69]"],"(06 $1)"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2-9]"],"06 $1"]],"06"],ID:["62","00[89]","00[1-9]\\d{9,14}|(?:[1-36]|8\\d{5})\\d{6}|00\\d{9}|[1-9]\\d{8,10}|[2-9]\\d{7}",[7,8,9,10,11,12,13,14,15,16,17],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["15"]],["(\\d{2})(\\d{5,9})","$1 $2",["2[124]|[36]1"],"(0$1)"],["(\\d{3})(\\d{5,7})","$1 $2",["800"],"0$1"],["(\\d{3})(\\d{5,8})","$1 $2",["[2-79]"],"(0$1)"],["(\\d{3})(\\d{3,4})(\\d{3})","$1-$2-$3",["8[1-35-9]"],"0$1"],["(\\d{3})(\\d{6,8})","$1 $2",["1"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["804"],"0$1"],["(\\d{3})(\\d)(\\d{3})(\\d{3})","$1 $2 $3 $4",["80"],"0$1"],["(\\d{3})(\\d{4})(\\d{4,5})","$1-$2-$3",["8"],"0$1"]],"0"],IE:["353","00","(?:1\\d|[2569])\\d{6,8}|4\\d{6,9}|7\\d{8}|8\\d{8,9}",[7,8,9,10],[["(\\d{2})(\\d{5})","$1 $2",["2[24-9]|47|58|6[237-9]|9[35-9]"],"(0$1)"],["(\\d{3})(\\d{5})","$1 $2",["[45]0"],"(0$1)"],["(\\d)(\\d{3,4})(\\d{4})","$1 $2 $3",["1"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2569]|4[1-69]|7[14]"],"(0$1)"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["70"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["81"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[78]"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1"]],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["4"],"(0$1)"],["(\\d{2})(\\d)(\\d{3})(\\d{4})","$1 $2 $3 $4",["8"],"0$1"]],"0"],IL:["972","0(?:0|1[2-9])","1\\d{6}(?:\\d{3,5})?|[57]\\d{8}|[1-489]\\d{7}",[7,8,9,10,11,12],[["(\\d{4})(\\d{3})","$1-$2",["125"]],["(\\d{4})(\\d{2})(\\d{2})","$1-$2-$3",["121"]],["(\\d)(\\d{3})(\\d{4})","$1-$2-$3",["[2-489]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["[57]"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1-$2-$3",["12"]],["(\\d{4})(\\d{6})","$1-$2",["159"]],["(\\d)(\\d{3})(\\d{3})(\\d{3})","$1-$2-$3-$4",["1[7-9]"]],["(\\d{3})(\\d{1,2})(\\d{3})(\\d{4})","$1-$2 $3-$4",["15"]]],"0"],IM:["44","00","1624\\d{6}|(?:[3578]\\d|90)\\d{8}",[10],0,"0",0,"([25-8]\\d{5})$|0|180020","1624$1",0,"74576|(?:16|7[56])24"],IN:["91","00","(?:000800|[2-9]\\d\\d)\\d{7}|1\\d{7,12}",[8,9,10,11,12,13],[["(\\d{8})","$1",["5(?:0|2[23]|3[03]|[67]1|88)","5(?:0|2(?:21|3)|3(?:0|3[23])|616|717|888)","5(?:0|2(?:21|3)|3(?:0|3[23])|616|717|8888)"],0,1],["(\\d{4})(\\d{4,5})","$1 $2",["180","1800"],0,1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["140"],0,1],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["11|2[02]|33|4[04]|79[1-7]|80[2-46]","11|2[02]|33|4[04]|79(?:[1-6]|7[19])|80(?:[2-4]|6[0-589])","11|2[02]|33|4[04]|79(?:[124-6]|3(?:[02-9]|1[0-24-9])|7(?:1|9[1-6]))|80(?:[2-4]|6[0-589])"],"0$1",1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["1(?:2[0-249]|3[0-25]|4[145]|[68]|7[1257])|2(?:1[257]|3[013]|4[01]|5[0137]|6[0158]|78|8[1568])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|5[12]|[78]1)|6(?:12|[2-4]1|5[17]|6[13]|80)|7(?:12|3[134]|4[47]|61|88)|8(?:16|2[014]|3[126]|6[136]|7[078]|8[34]|91)|(?:43|59|75)[15]|(?:1[59]|29|67|72)[14]","1(?:2[0-24]|3[0-25]|4[145]|[59][14]|6[1-9]|7[1257]|8[1-57-9])|2(?:1[257]|3[013]|4[01]|5[0137]|6[058]|78|8[1568]|9[14])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|3[15]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|[578]1|9[15])|674|7(?:(?:2[14]|3[34]|5[15])[2-6]|61[346]|88[0-8])|8(?:70[2-6]|84[235-7]|91[3-7])|(?:1(?:29|60|8[06])|261|552|6(?:12|[2-47]1|5[17]|6[13]|80)|7(?:12|31|4[47])|8(?:16|2[014]|3[126]|6[136]|7[78]|83))[2-7]","1(?:2[0-24]|3[0-25]|4[145]|[59][14]|6[1-9]|7[1257]|8[1-57-9])|2(?:1[257]|3[013]|4[01]|5[0137]|6[058]|78|8[1568]|9[14])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|3[15]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|[578]1|9[15])|6(?:12(?:[2-6]|7[0-8])|74[2-7])|7(?:(?:2[14]|5[15])[2-6]|3171|61[346]|88(?:[2-7]|82))|8(?:70[2-6]|84(?:[2356]|7[19])|91(?:[3-6]|7[19]))|73[134][2-6]|(?:74[47]|8(?:16|2[014]|3[126]|6[136]|7[78]|83))(?:[2-6]|7[19])|(?:1(?:29|60|8[06])|261|552|6(?:[2-4]1|5[17]|6[13]|7(?:1|4[0189])|80)|7(?:12|88[01]))[2-7]"],"0$1",1],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1(?:[2-479]|5[0235-9])|[2-5]|6(?:1[1358]|2[2457-9]|3[2-5]|4[235-7]|5[2-689]|6[24578]|7[235689]|8[1-6])|7(?:1[013-9]|28|3[129]|4[1-35689]|5[29]|6[02-5]|70)|807","1(?:[2-479]|5[0235-9])|[2-5]|6(?:1[1358]|2(?:[2457]|84|95)|3(?:[2-4]|55)|4[235-7]|5[2-689]|6[24578]|7[235689]|8[1-6])|7(?:1(?:[013-8]|9[6-9])|28[6-8]|3(?:17|2[0-49]|9[2-57])|4(?:1[2-4]|[29][0-7]|3[0-8]|[56]|8[0-24-7])|5(?:2[1-3]|9[0-6])|6(?:0[5689]|2[5-9]|3[02-8]|4|5[0-367])|70[13-7])|807[19]","1(?:[2-479]|5(?:[0236-9]|5[013-9]))|[2-5]|6(?:2(?:84|95)|355|8(?:28[235-7]|3))|73179|807(?:1|9[1-3])|(?:1552|6(?:(?:1[1358]|2[2457]|3[2-4]|4[235-7]|5[2-689]|6[24578]|7[235689])\\d|8(?:[14-6]\\d|2[0-79]))|7(?:1(?:[013-8]\\d|9[6-9])|28[6-8]|3(?:2[0-49]|9[2-57])|4(?:1[2-4]|[29][0-7]|3[0-8]|[56]\\d|8[0-24-7])|5(?:2[1-3]|9[0-6])|6(?:0[5689]|2[5-9]|3[02-8]|4\\d|5[0-367])|70[13-7]))[2-7]"],"0$1",1],["(\\d{5})(\\d{5})","$1 $2",["16|[6-9]"],"0$1",1],["(\\d{4})(\\d{2,4})(\\d{4})","$1 $2 $3",["18[06]","18[06]0"],0,1],["(\\d{4})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["18"],0,1]],"0"],IO:["246","00","3\\d{6}",[7],[["(\\d{3})(\\d{4})","$1 $2",["3"]]]],IQ:["964","00","(?:1|7\\d\\d)\\d{7}|[2-6]\\d{7,8}",[8,9,10],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["1"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2-6]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"0$1"]],"0"],IR:["98","00","[1-9]\\d{9}|(?:[1-8]\\d\\d|9)\\d{3,4}",[4,5,6,7,10],[["(\\d{4,5})","$1",["96"],"0$1"],["(\\d{2})(\\d{4,5})","$1 $2",["(?:1[137]|2[13-68]|3[1458]|4[145]|5[1468]|6[16]|7[1467]|8[13467])[12689]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["9"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["[1-8]"],"0$1"]],"0"],IS:["354","00|1(?:0(?:01|[12]0)|100)","(?:38\\d|[4-9])\\d{6}",[7,9],[["(\\d{3})(\\d{4})","$1 $2",["[4-9]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["3"]]],0,0,0,0,0,0,0,"00"],IT:["39","00","0\\d{5,11}|1\\d{8,10}|3(?:[0-8]\\d{7,10}|9\\d{7,8})|(?:43|55|70)\\d{8}|8\\d{5}(?:\\d{2,4})?",[6,7,8,9,10,11,12],[["(\\d{2})(\\d{4,6})","$1 $2",["0[26]"]],["(\\d{3})(\\d{3,6})","$1 $2",["0[13-57-9][0159]|8(?:03|4[17]|9[2-5])","0[13-57-9][0159]|8(?:03|4[17]|9(?:2|3[04]|[45][0-4]))"]],["(\\d{4})(\\d{2,6})","$1 $2",["0(?:[13-579][2-46-8]|8[236-8])"]],["(\\d{4})(\\d{4})","$1 $2",["894"]],["(\\d{2})(\\d{3,4})(\\d{4})","$1 $2 $3",["0[26]|5"]],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["1(?:44|[679])|[378]|43"]],["(\\d{3})(\\d{3,4})(\\d{4})","$1 $2 $3",["0[13-57-9][0159]|14"]],["(\\d{2})(\\d{4})(\\d{5})","$1 $2 $3",["0[26]"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["0"]],["(\\d{3})(\\d{4})(\\d{4,5})","$1 $2 $3",["[03]"]]],0,0,0,0,0,0,[["0(?:669[0-79]\\d{1,6}|831\\d{2,8})|0(?:1(?:[0159]\\d|[27][1-5]|31|4[1-4]|6[1356]|8[2-57])|2\\d\\d|3(?:[0159]\\d|2[1-4]|3[12]|[48][1-6]|6[2-59]|7[1-7])|4(?:[0159]\\d|[23][1-9]|4[245]|6[1-5]|7[1-4]|81)|5(?:[0159]\\d|2[1-5]|3[2-6]|4[1-79]|6[4-6]|7[1-578]|8[3-8])|6(?:[0-57-9]\\d|6[0-8])|7(?:[0159]\\d|2[12]|3[1-7]|4[2-46]|6[13569]|7[13-6]|8[1-59])|8(?:[0159]\\d|2[3-578]|3[2356]|[6-8][1-5])|9(?:[0159]\\d|[238][1-5]|4[12]|6[1-8]|7[1-6]))\\d{2,7}"],["3[2-9]\\d{7,8}|(?:31|43)\\d{8}",[9,10]],["80(?:0\\d{3}|3)\\d{3}",[6,9]],["(?:0878\\d{3}|89(?:2\\d|3[04]|4(?:[0-4]|[5-9]\\d\\d)|5[0-4]))\\d\\d|(?:1(?:44|6[346])|89(?:38|5[5-9]|9))\\d{6}",[6,8,9,10]],["1(?:78\\d|99)\\d{6}",[9,10]],["3[2-8]\\d{9,10}",[11,12]],0,0,["55\\d{8}",[10]],["84(?:[08]\\d{3}|[17])\\d{3}",[6,9]]]],JE:["44","00","1534\\d{6}|(?:[3578]\\d|90)\\d{8}",[10],0,"0",0,"([0-24-8]\\d{5})$|0|180020","1534$1",0,0,[["1534[0-24-8]\\d{5}"],["7(?:(?:(?:50|82)9|937)\\d|7(?:00[378]|97\\d))\\d{5}"],["80(?:07(?:35|81)|8901)\\d{4}"],["(?:8(?:4(?:4(?:4(?:05|42|69)|703)|5(?:041|800))|7(?:0002|1206))|90(?:066[59]|1810|71(?:07|55)))\\d{4}"],["701511\\d{4}"],0,["(?:3(?:0(?:07(?:35|81)|8901)|3\\d{4}|4(?:4(?:4(?:05|42|69)|703)|5(?:041|800))|7(?:0002|1206))|55\\d{4})\\d{4}"],["76(?:464|652)\\d{5}|76(?:0[0-28]|2[356]|34|4[01347]|5[49]|6[0-369]|77|8[14]|9[139])\\d{6}"],["56\\d{8}"]]],JM:["1","011","(?:[58]\\d\\d|658|900)\\d{7}",[10],0,"1",0,0,0,0,"658|876"],JO:["962","00","(?:(?:[2689]|7\\d)\\d|32|427|53)\\d{6}",[8,9],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[2356]|87"],"(0$1)"],["(\\d{3})(\\d{5,6})","$1 $2",["[89]"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["70"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["[47]"],"0$1"]],"0"],JP:["81","010","00[1-9]\\d{6,14}|[25-9]\\d{9}|(?:00|[1-9]\\d\\d)\\d{6}",[8,9,10,11,12,13,14,15,16,17],[["(\\d{3})(\\d{3})(\\d{3})","$1-$2-$3",["(?:12|57|99)0"],"0$1"],["(\\d{4})(\\d)(\\d{4})","$1-$2-$3",["1(?:26|3[79]|4[56]|5[4-68]|6[3-5])|499|5(?:76|97)|746|8(?:3[89]|47|51)|9(?:80|9[16])","1(?:267|3(?:7[247]|9[278])|466|5(?:47|58|64)|6(?:3[245]|48|5[4-68]))|499[2468]|5(?:76|97)9|7468|8(?:3(?:8[7-9]|96)|477|51[2-9])|9(?:802|9(?:1[23]|69))|1(?:45|58)[67]","1(?:267|3(?:7[247]|9[278])|466|5(?:47|58|64)|6(?:3[245]|48|5[4-68]))|499[2468]|5(?:769|979[2-69])|7468|8(?:3(?:8[7-9]|96[2457-9])|477|51[2-9])|9(?:802|9(?:1[23]|69))|1(?:45|58)[67]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["60"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1-$2-$3",["3|4(?:2[09]|7[01])|6[1-9]","3|4(?:2(?:0|9[02-69])|7(?:0[019]|1))|6[1-9]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["1(?:1|5[45]|77|88|9[69])|2(?:2[1-37]|3[0-269]|4[59]|5|6[24]|7[1-358]|8[1369]|9[0-38])|4(?:[28][1-9]|3[0-57]|[45]|6[248]|7[2-579]|9[29])|5(?:2|3[0459]|4[0-369]|5[29]|8[02389]|9[0-389])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9[2-6])|8(?:2[124589]|3[26-9]|49|51|6|7[0-468]|8[68]|9[019])|9(?:[23][1-9]|4[15]|5[138]|6[1-3]|7[156]|8[189]|9[1-489])","1(?:1|5(?:4[018]|5[017])|77|88|9[69])|2(?:2(?:[127]|3[014-9])|3[0-269]|4[59]|5(?:[1-3]|5[0-69]|9[19])|62|7(?:[1-35]|8[0189])|8(?:[16]|3[0134]|9[0-5])|9(?:[028]|17))|4(?:2(?:[13-79]|8[014-6])|3[0-57]|[45]|6[248]|7[2-47]|8[1-9]|9[29])|5(?:2|3(?:[045]|9[0-8])|4[0-369]|5[29]|8[02389]|9[0-3])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9(?:[23]|4[0-59]|5[01569]|6[0167]))|8(?:2(?:[1258]|4[0-39]|9[0-2469])|3(?:[29]|60)|49|51|6(?:[0-24]|36|5[0-3589]|7[23]|9[01459])|7[0-468]|8[68])|9(?:[23][1-9]|4[15]|5[138]|6[1-3]|7[156]|8[189]|9(?:[1289]|3[34]|4[0178]))|(?:264|837)[016-9]|2(?:57|93)[015-9]|(?:25[0468]|422|838)[01]|(?:47[59]|59[89]|8(?:6[68]|9))[019]","1(?:1|5(?:4[018]|5[017])|77|88|9[69])|2(?:2[127]|3[0-269]|4[59]|5(?:[1-3]|5[0-69]|9(?:17|99))|6(?:2|4[016-9])|7(?:[1-35]|8[0189])|8(?:[16]|3[0134]|9[0-5])|9(?:[028]|17))|4(?:2(?:[13-79]|8[014-6])|3[0-57]|[45]|6[248]|7[2-47]|9[29])|5(?:2|3(?:[045]|9(?:[0-58]|6[4-9]|7[0-35689]))|4[0-369]|5[29]|8[02389]|9[0-3])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9(?:[23]|4[0-59]|5[01569]|6[0167]))|8(?:2(?:[1258]|4[0-39]|9[0169])|3(?:[29]|60|7(?:[017-9]|6[6-8]))|49|51|6(?:[0-24]|36[2-57-9]|5(?:[0-389]|5[23])|6(?:[01]|9[178])|7(?:2[2-468]|3[78])|9[0145])|7[0-468]|8[68])|9(?:4[15]|5[138]|7[156]|8[189]|9(?:[1289]|3(?:31|4[357])|4[0178]))|(?:8294|96)[1-3]|2(?:57|93)[015-9]|(?:223|8699)[014-9]|(?:25[0468]|422|838)[01]|(?:48|8292|9[23])[1-9]|(?:47[59]|59[89]|8(?:68|9))[019]"],"0$1"],["(\\d{3})(\\d{2})(\\d{4})","$1-$2-$3",["[14]|[289][2-9]|5[3-9]|7[2-4679]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1-$2-$3",["800"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1-$2-$3",["[25-9]"],"0$1"]],"0",0,"(000[2569]\\d{4,6})$|(?:(?:003768)0?)|0","$1"],KE:["254","000","(?:[17]\\d\\d|900)\\d{6}|(?:2|80)0\\d{6,7}|[4-6]\\d{6,8}",[7,8,9,10],[["(\\d{2})(\\d{5,7})","$1 $2",["[24-6]"],"0$1"],["(\\d{3})(\\d{6})","$1 $2",["[17]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["[89]"],"0$1"]],"0"],KG:["996","00","8\\d{9}|[235-9]\\d{8}",[9,10],[["(\\d{4})(\\d{5})","$1 $2",["3(?:1[346]|[24-79])"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[235-79]|88"],"0$1"],["(\\d{3})(\\d{3})(\\d)(\\d{2,3})","$1 $2 $3 $4",["8"],"0$1"]],"0"],KH:["855","00[14-9]","1\\d{9}|[1-9]\\d{7,8}",[8,9,10],[["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[1-9]"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1"]]],"0"],KI:["686","00","(?:[37]\\d|6[0-79])\\d{6}|(?:[2-48]\\d|50)\\d{3}",[5,8],0,"0"],KM:["269","00","[3478]\\d{6}",[7],[["(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3",["[3478]"]]]],KN:["1","011","(?:[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-7]\\d{6})$|1","869$1",0,"869"],KP:["850","00|99","85\\d{6}|(?:19\\d|[2-7])\\d{7}",[8,10],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["8"],"0$1"],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[2-7]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["1"],"0$1"]],"0"],KR:["82","00(?:[125689]|3(?:[46]5|91)|7(?:00|27|3|55|6[126]))","00[1-9]\\d{8,11}|(?:[12]|5\\d{3})\\d{7}|[13-6]\\d{9}|(?:[1-6]\\d|80)\\d{7}|[3-6]\\d{4,5}|(?:00|7)0\\d{8}",[5,6,8,9,10,11,12,13,14],[["(\\d{2})(\\d{3,4})","$1-$2",["(?:3[1-3]|[46][1-4]|5[1-5])1"],"0$1"],["(\\d{4})(\\d{4})","$1-$2",["1"]],["(\\d)(\\d{3,4})(\\d{4})","$1-$2-$3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["[36]0|8"],"0$1"],["(\\d{2})(\\d{3,4})(\\d{4})","$1-$2-$3",["[1346]|5[1-5]"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1-$2-$3",["[57]"],"0$1"],["(\\d{2})(\\d{5})(\\d{4})","$1-$2-$3",["5"],"0$1"]],"0",0,"0(8(?:[1-46-8]|5\\d\\d))?"],KW:["965","00","18\\d{5}|(?:[2569]\\d|41)\\d{6}",[7,8],[["(\\d{4})(\\d{3,4})","$1 $2",["[169]|2(?:[235]|4[1-35-9])|52"]],["(\\d{3})(\\d{5})","$1 $2",["[245]"]]]],KY:["1","011","(?:345|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","345$1",0,"345"],KZ:["7","810","(?:33622|8\\d{8})\\d{5}|[78]\\d{9}",[10,14],0,"8",0,0,0,0,"33622|7",0,"8~10"],LA:["856","00","[23]\\d{9}|3\\d{8}|(?:[235-8]\\d|41)\\d{6}",[8,9,10],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["2[13]|3[14]|[4-8]"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3 $4",["3"],"0$1"],["(\\d{2})(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3 $4",["[23]"],"0$1"]],"0"],LB:["961","00","[27-9]\\d{7}|[13-9]\\d{6}",[7,8],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[13-69]|7(?:[2-57]|62|8[0-6]|9[04-9])|8[02-9]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[27-9]"]]],"0"],LC:["1","011","(?:[58]\\d\\d|758|900)\\d{7}",[10],0,"1",0,"([2-8]\\d{6})$|1","758$1",0,"758"],LI:["423","00","[68]\\d{8}|(?:[2378]\\d|90)\\d{5}",[7,9],[["(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3",["[2379]|8(?:0[09]|7)","[2379]|8(?:0(?:02|9)|7)"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["69"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["6"]]],"0",0,"(1001)|0"],LK:["94","00","[1-9]\\d{8}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[1-689]"],"0$1"]],"0"],LR:["231","00","(?:[2457]\\d|33|88)\\d{7}|(?:2\\d|[4-6])\\d{6}",[7,8,9],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["4[67]|[56]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[2-578]"],"0$1"]],"0"],LS:["266","00","(?:[256]\\d\\d|800)\\d{5}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[2568]"]]]],LT:["370","00","(?:[3469]\\d|52|[78]0)\\d{6}",[8],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["52[0-7]"],"(0-$1)",1],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["[7-9]"],"0 $1",1],["(\\d{2})(\\d{6})","$1 $2",["37|4(?:[15]|6[1-8])"],"(0-$1)",1],["(\\d{3})(\\d{5})","$1 $2",["[3-6]"],"(0-$1)",1]],"0",0,"[08]"],LU:["352","00","35[013-9]\\d{4,8}|6\\d{8}|35\\d{2,4}|(?:[2457-9]\\d|3[0-46-9])\\d{2,9}",[4,5,6,7,8,9,10,11],[["(\\d{2})(\\d{3})","$1 $2",["2(?:0[2-689]|[2-9])|[3-57]|8(?:0[2-9]|[13-9])|9(?:0[89]|[2-579])"]],["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["2(?:0[2-689]|[2-9])|[3-57]|8(?:0[2-9]|[13-9])|9(?:0[89]|[2-579])"]],["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["20[2-689]"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{1,2})","$1 $2 $3 $4",["2(?:[0367]|4[3-8])"]],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["80[01]|90[015]"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3 $4",["20"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["6"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})(\\d{1,2})","$1 $2 $3 $4 $5",["2(?:[0367]|4[3-8])"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{1,5})","$1 $2 $3 $4",["[3-57]|8[13-9]|9(?:0[89]|[2-579])|(?:2|80)[2-9]"]]],0,0,"(15(?:0[06]|1[12]|[35]5|4[04]|6[26]|77|88|99)\\d)"],LV:["371","00","(?:[268]\\d|78|90)\\d{6}",[8],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[2679]|8[01]"]]]],LY:["218","00","[2-9]\\d{8}",[9],[["(\\d{2})(\\d{7})","$1-$2",["[2-9]"],"0$1"]],"0"],MA:["212","00","[5-8]\\d{8}",[9],[["(\\d{4})(\\d{5})","$1-$2",["892"],"0$1"],["(\\d{2})(\\d{7})","$1-$2",["8(?:0[0-7]|9)"],"0$1"],["(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["[5-8]"],"0$1"]],"0",0,0,0,0,0,[["5(?:(?:18|4[0679]|5[03])\\d|2(?:[0-25-79]\\d|3[1-578]|4[02-46-8]|8[0235-7])|3(?:[0-47]\\d|5[02-9]|6[02-8]|8[014-9]|9[3-9]))\\d{5}"],["(?:6(?:[0-79]\\d|8[0-247-9])|7(?:[016-8]\\d|2[0-8]|5[0-5]))\\d{6}"],["80[0-7]\\d{6}"],["89\\d{7}"],0,0,0,0,["(?:592(?:4[0-2]|93)|80[89]\\d\\d)\\d{4}"]]],MC:["377","00","(?:[3489]|[67]\\d)\\d{7}",[8,9],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["4"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[389]"]],["(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["[67]"],"0$1"]],"0"],MD:["373","00","(?:[235-7]\\d|[89]0)\\d{6}",[8],[["(\\d{3})(\\d{5})","$1 $2",["[89]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["22|3"],"0$1"],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["[25-7]"],"0$1"]],"0"],ME:["382","00","(?:20|[3-79]\\d)\\d{6}|80\\d{6,7}",[8,9],[["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2-9]"],"0$1"]],"0"],MF:["590","00","(?:590\\d|7090)\\d{5}|(?:69|80|9\\d)\\d{7}",[9],0,"0",0,0,0,0,0,[["590(?:0[079]|[14]3|[27][79]|3[03-7]|5[0-268]|87)\\d{4}"],["(?:69(?:0\\d\\d|1(?:2[2-9]|3[0-5])|4(?:0[89]|1[2-6]|9\\d)|6(?:1[016-9]|5[0-4]|[67]\\d))|7090[0-4])\\d{4}"],["80[0-5]\\d{6}"],0,0,0,0,0,["9(?:(?:39[5-7]|76[018])\\d|475[0-6])\\d{4}"]]],MG:["261","00","[23]\\d{8}",[9],[["(\\d{2})(\\d{2})(\\d{3})(\\d{2})","$1 $2 $3 $4",["[23]"],"0$1"]],"0",0,"([24-9]\\d{6})$|0","20$1"],MH:["692","011","329\\d{4}|(?:[256]\\d|45)\\d{5}",[7],[["(\\d{3})(\\d{4})","$1-$2",["[2-6]"]]],"1"],MK:["389","00","[2-578]\\d{7}",[8],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["2|34[47]|4(?:[37]7|5[47]|64)"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[347]"],"0$1"],["(\\d{3})(\\d)(\\d{2})(\\d{2})","$1 $2 $3 $4",["[58]"],"0$1"]],"0"],ML:["223","00","[24-9]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[24-9]"]]]],MM:["95","00","1\\d{5,7}|95\\d{6}|(?:[4-7]|9[0-46-9])\\d{6,8}|(?:2|8\\d)\\d{5,8}",[6,7,8,9,10],[["(\\d)(\\d{2})(\\d{3})","$1 $2 $3",["16|2"],"0$1"],["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["4(?:[2-46]|5[3-5])|5|6(?:[1-689]|7[235-7])|7(?:[0-4]|5[2-7])|8[1-5]|(?:60|86)[23]"],"0$1"],["(\\d)(\\d{3})(\\d{3,4})","$1 $2 $3",["[12]|452|678|86","[12]|452|6788|86"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[4-7]|8[1-35]"],"0$1"],["(\\d)(\\d{3})(\\d{4,6})","$1 $2 $3",["9(?:2[0-4]|[35-9]|4[137-9])"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["2"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"],"0$1"],["(\\d)(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["92"],"0$1"],["(\\d)(\\d{5})(\\d{4})","$1 $2 $3",["9"],"0$1"]],"0"],MN:["976","001","[12]\\d{7,9}|[5-9]\\d{7}",[8,9,10],[["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["[12]1"],"0$1"],["(\\d{4})(\\d{4})","$1 $2",["[5-9]"]],["(\\d{3})(\\d{5,6})","$1 $2",["[12]2[1-3]"],"0$1"],["(\\d{4})(\\d{5,6})","$1 $2",["[12](?:27|3[2-8]|4[2-68]|5[1-4689])","[12](?:27|3[2-8]|4[2-68]|5[1-4689])[0-3]"],"0$1"],["(\\d{5})(\\d{4,5})","$1 $2",["[12]"],"0$1"]],"0"],MO:["853","00","0800\\d{3}|(?:28|[68]\\d)\\d{6}",[7,8],[["(\\d{4})(\\d{3})","$1 $2",["0"]],["(\\d{4})(\\d{4})","$1 $2",["[268]"]]]],MP:["1","011","[58]\\d{9}|(?:67|90)0\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","670$1",0,"670"],MQ:["596","00","(?:596\\d|7091)\\d{5}|(?:69|[89]\\d)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-79]|8(?:0[6-9]|[36])"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0$1"]],"0"],MR:["222","00","(?:[2-4]\\d\\d|800)\\d{5}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-48]"]]]],MS:["1","011","(?:[58]\\d\\d|664|900)\\d{7}",[10],0,"1",0,"([34]\\d{6})$|1","664$1",0,"664"],MT:["356","00","3550\\d{4}|(?:[2579]\\d\\d|800)\\d{5}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[2357-9]"]]]],MU:["230","0(?:0|[24-7]0|3[03])","(?:[57]|8\\d\\d)\\d{7}|[2-468]\\d{6}",[7,8,10],[["(\\d{3})(\\d{4})","$1 $2",["[2-46]|8[013]"]],["(\\d{4})(\\d{4})","$1 $2",["[57]"]],["(\\d{5})(\\d{5})","$1 $2",["8"]]],0,0,0,0,0,0,0,"020"],MV:["960","0(?:0|19)","(?:800|9[0-57-9]\\d)\\d{7}|[34679]\\d{6}",[7,10],[["(\\d{3})(\\d{4})","$1-$2",["[34679]"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[89]"]]],0,0,0,0,0,0,0,"00"],MW:["265","00","(?:[1289]\\d|31|77)\\d{7}|1\\d{6}",[7,9],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["1[2-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["2"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[137-9]"],"0$1"]],"0"],MX:["52","0[09]","[2-9]\\d{9}",[10],[["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["33|5[56]|81"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[2-9]"]]],0,0,0,0,0,0,0,"00"],MY:["60","00","1\\d{8,9}|(?:3\\d|[4-9])\\d{7}",[8,9,10],[["(\\d)(\\d{3})(\\d{4})","$1-$2 $3",["[4-79]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1-$2 $3",["1(?:[02469]|[378][1-9]|53)|8","1(?:[02469]|[37][1-9]|53|8(?:[1-46-9]|5[7-9]))|8"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1-$2 $3",["3"],"0$1"],["(\\d)(\\d{3})(\\d{2})(\\d{4})","$1-$2-$3-$4",["1(?:[367]|80)"]],["(\\d{3})(\\d{3})(\\d{4})","$1-$2 $3",["15"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1-$2 $3",["1"],"0$1"]],"0"],MZ:["258","00","(?:2|8\\d)\\d{7}",[8,9],[["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["2|8[2-79]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8"]]]],NA:["264","00","[68]\\d{7,8}",[8,9],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["88"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["6"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["87"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["8"],"0$1"]],"0"],NC:["687","00","(?:050|[2-57-9]\\d\\d)\\d{3}",[6],[["(\\d{2})(\\d{2})(\\d{2})","$1.$2.$3",["[02-57-9]"]]]],NE:["227","00","[027-9]\\d{7}",[8],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["08"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[089]|2[013]|7[0467]"]]]],NF:["672","00","[13]\\d{5}",[6],[["(\\d{2})(\\d{4})","$1 $2",["1[0-3]"]],["(\\d)(\\d{5})","$1 $2",["[13]"]]],0,0,"([0-258]\\d{4})$","3$1"],NG:["234","009","(?:20|9\\d)\\d{8}|[78]\\d{9,13}",[10,11,12,13,14],[["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["[7-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["20[129]"],"0$1"],["(\\d{4})(\\d{2})(\\d{4})","$1 $2 $3",["2"],"0$1"],["(\\d{3})(\\d{4})(\\d{4,5})","$1 $2 $3",["[78]"],"0$1"],["(\\d{3})(\\d{5})(\\d{5,6})","$1 $2 $3",["[78]"],"0$1"]],"0"],NI:["505","00","(?:1800|[25-8]\\d{3})\\d{4}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[125-8]"]]]],NL:["31","00","(?:[124-7]\\d\\d|3(?:[02-9]\\d|1[0-8]))\\d{6}|8\\d{6,9}|9\\d{6,10}|1\\d{4,5}",[5,6,7,8,9,10,11],[["(\\d{3})(\\d{4,7})","$1 $2",["[89]0"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["66"],"0$1"],["(\\d)(\\d{8})","$1 $2",["6"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["1[16-8]|2[259]|3[124]|4[17-9]|5[124679]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[1-578]|91"],"0$1"],["(\\d{3})(\\d{3})(\\d{5})","$1 $2 $3",["9"],"0$1"]],"0"],NO:["47","00","(?:0|[2-9]\\d{3})\\d{4}",[5,8],[["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["8"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-79]"]]],0,0,0,0,0,"[02-689]|7[0-8]"],NP:["977","00","(?:1\\d|9)\\d{9}|[1-9]\\d{7}",[8,10,11],[["(\\d)(\\d{7})","$1-$2",["1[2-6]"],"0$1"],["(\\d{2})(\\d{6})","$1-$2",["1[01]|[2-8]|9(?:[1-59]|[67][2-6])"],"0$1"],["(\\d{3})(\\d{7})","$1-$2",["9"]]],"0"],NR:["674","00","(?:222|444|(?:55|8\\d)\\d|666|777|999)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[24-9]"]]]],NU:["683","00","(?:[4-7]|888\\d)\\d{3}",[4,7],[["(\\d{3})(\\d{4})","$1 $2",["8"]]]],NZ:["64","0(?:0|161)","[1289]\\d{9}|50\\d{5}(?:\\d{2,3})?|[27-9]\\d{7,8}|(?:[34]\\d|6[0-35-9])\\d{6}|8\\d{4,6}",[5,6,7,8,9,10],[["(\\d{2})(\\d{3,8})","$1 $2",["8[1-79]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2,3})","$1 $2 $3",["50[036-8]|8|90","50(?:[0367]|88)|8|90"],"0$1"],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["24|[346]|7[2-57-9]|9[2-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["2(?:10|74)|[589]"],"0$1"],["(\\d{2})(\\d{3,4})(\\d{4})","$1 $2 $3",["1|2[028]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,5})","$1 $2 $3",["2(?:[169]|7[0-35-9])|7"],"0$1"]],"0",0,0,0,0,0,0,"00"],OM:["968","00","(?:1505|[279]\\d{3}|500)\\d{4}|800\\d{5,6}",[7,8,9],[["(\\d{3})(\\d{4,6})","$1 $2",["[58]"]],["(\\d{2})(\\d{6})","$1 $2",["2"]],["(\\d{4})(\\d{4})","$1 $2",["[179]"]]]],PA:["507","00","(?:00800|8\\d{3})\\d{6}|[68]\\d{7}|[1-57-9]\\d{6}",[7,8,10,11],[["(\\d{3})(\\d{4})","$1-$2",["[1-57-9]"]],["(\\d{4})(\\d{4})","$1-$2",["[68]"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"]]]],PE:["51","00|19(?:1[124]|77|90)00","(?:[14-8]|9\\d)\\d{7}",[8,9],[["(\\d{3})(\\d{5})","$1 $2",["80"],"(0$1)"],["(\\d)(\\d{7})","$1 $2",["1"],"(0$1)"],["(\\d{2})(\\d{6})","$1 $2",["[4-8]"],"(0$1)"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["9"]]],"0",0,0,0,0,0,0,"00"," Anexo "],PF:["689","00","4\\d{5}(?:\\d{2})?|8\\d{7,8}",[6,8,9],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["44"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["4|8[7-9]"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"]]]],PG:["675","00|140[1-3]","(?:180|[78]\\d{3})\\d{4}|(?:[2-589]\\d|64)\\d{5}",[7,8],[["(\\d{3})(\\d{4})","$1 $2",["18|[2-69]|85"]],["(\\d{4})(\\d{4})","$1 $2",["[78]"]]],0,0,0,0,0,0,0,"00"],PH:["63","00","(?:[2-7]|9\\d)\\d{8}|2\\d{5}|(?:1800|8)\\d{7,9}",[6,8,9,10,11,12,13],[["(\\d)(\\d{5})","$1 $2",["2"],"(0$1)"],["(\\d{4})(\\d{4,6})","$1 $2",["3(?:23|39|46)|4(?:2[3-6]|[35]9|4[26]|76)|544|88[245]|(?:52|64|86)2","3(?:230|397|461)|4(?:2(?:35|[46]4|51)|396|4(?:22|63)|59[347]|76[15])|5(?:221|446)|642[23]|8(?:622|8(?:[24]2|5[13]))"],"(0$1)"],["(\\d{5})(\\d{4})","$1 $2",["346|4(?:27|9[35])|883","3469|4(?:279|9(?:30|56))|8834"],"(0$1)"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["2"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[3-7]|8[2-8]"],"(0$1)"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[89]"],"0$1"],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["1"]],["(\\d{4})(\\d{1,2})(\\d{3})(\\d{4})","$1 $2 $3 $4",["1"]]],"0"],PK:["92","00","122\\d{6}|[24-8]\\d{10,11}|9(?:[013-9]\\d{8,10}|2(?:[01]\\d\\d|2(?:[06-8]\\d|1[01]))\\d{7})|(?:[2-8]\\d{3}|92(?:[0-7]\\d|8[1-9]))\\d{6}|[24-9]\\d{8}|[89]\\d{7}",[8,9,10,11,12],[["(\\d{3})(\\d{3})(\\d{2,7})","$1 $2 $3",["[89]0"],"0$1"],["(\\d{4})(\\d{5})","$1 $2",["1"]],["(\\d{3})(\\d{6,7})","$1 $2",["2(?:3[2358]|4[2-4]|9[2-8])|45[3479]|54[2-467]|60[468]|72[236]|8(?:2[2-689]|3[23578]|4[3478]|5[2356])|9(?:2[2-8]|3[27-9]|4[2-6]|6[3569]|9[25-8])","9(?:2[3-8]|98)|(?:2(?:3[2358]|4[2-4]|9[2-8])|45[3479]|54[2-467]|60[468]|72[236]|8(?:2[2-689]|3[23578]|4[3478]|5[2356])|9(?:22|3[27-9]|4[2-6]|6[3569]|9[25-7]))[2-9]"],"(0$1)"],["(\\d{2})(\\d{7,8})","$1 $2",["(?:2[125]|4[0-246-9]|5[1-35-7]|6[1-8]|7[14]|8[16]|91)[2-9]"],"(0$1)"],["(\\d{5})(\\d{5})","$1 $2",["58"],"(0$1)"],["(\\d{3})(\\d{7})","$1 $2",["3"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["2[125]|4[0-246-9]|5[1-35-7]|6[1-8]|7[14]|8[16]|91"],"(0$1)"],["(\\d{3})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["[24-9]"],"(0$1)"]],"0"],PL:["48","00","(?:6|8\\d\\d)\\d{7}|[1-9]\\d{6}(?:\\d{2})?|[26]\\d{5}",[6,7,8,9,10],[["(\\d{5})","$1",["19"]],["(\\d{3})(\\d{3})","$1 $2",["11|20|64"]],["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["(?:1[2-8]|2[2-69]|3[2-4]|4[1-468]|5[24-689]|6[1-3578]|7[14-7]|8[1-79]|9[145])1","(?:1[2-8]|2[2-69]|3[2-4]|4[1-468]|5[24-689]|6[1-3578]|7[14-7]|8[1-79]|9[145])19"]],["(\\d{3})(\\d{2})(\\d{2,3})","$1 $2 $3",["64"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["21|39|45|5[0137]|6[0469]|7[02389]|8(?:0[14]|8)"]],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["1[2-8]|[2-7]|8[1-79]|9[145]"]],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["8"]]]],PM:["508","00","[45]\\d{5}|(?:708|8\\d\\d)\\d{6}",[6,9],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["[45]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["7"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0$1"]],"0"],PR:["1","011","(?:[589]\\d\\d|787)\\d{7}",[10],0,"1",0,0,0,0,"787|939"],PS:["970","00","[2489]2\\d{6}|(?:1\\d|5)\\d{8}",[8,9,10],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[2489]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["5"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1"]]],"0"],PT:["351","00","1693\\d{5}|(?:[26-9]\\d|30)\\d{7}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["2[12]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["16|[236-9]"]]]],PW:["680","01[12]","(?:[24-8]\\d\\d|345|900)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[2-9]"]]]],PY:["595","00","59\\d{4,6}|9\\d{5,10}|(?:[2-46-8]\\d|5[0-8])\\d{4,7}",[6,7,8,9,10,11],[["(\\d{3})(\\d{3,6})","$1 $2",["[2-9]0"],"0$1"],["(\\d{2})(\\d{5})","$1 $2",["[26]1|3[289]|4[1246-8]|7[1-3]|8[1-36]"],"(0$1)"],["(\\d{3})(\\d{4,5})","$1 $2",["2[279]|3[13-5]|4[359]|5|6(?:[34]|7[1-46-8])|7[46-8]|85"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["2[14-68]|3[26-9]|4[1246-8]|6(?:1|75)|7[1-35]|8[1-36]"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["87"]],["(\\d{3})(\\d{6})","$1 $2",["9(?:[5-79]|8[1-7])"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[2-8]"],"0$1"],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["9"]]],"0"],QA:["974","00","800\\d{4}|(?:2|800)\\d{6}|(?:0080|[3-7])\\d{7}",[7,8,9,11],[["(\\d{3})(\\d{4})","$1 $2",["2[136]|8"]],["(\\d{4})(\\d{4})","$1 $2",["[3-7]"]]]],RE:["262","00","709\\d{6}|(?:26|[689]\\d)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[26-9]"],"0$1"]],"0",0,0,0,0,0,[["26(?:2\\d\\d|3(?:0\\d|1[0-6]))\\d{4}"],["(?:69(?:2\\d\\d|3(?:[06][0-6]|1[0-3]|2[0-2]|3[0-39]|4\\d|5[0-5]|7[0-37]|8[0-8]|9[0-479]))|7092[0-3])\\d{4}"],["80\\d{7}"],["89[1-37-9]\\d{6}"],0,0,0,0,["9(?:399[0-3]|479[0-6]|76(?:2[278]|3[0-37]))\\d{4}"],["8(?:1[019]|2[0156]|84|90)\\d{6}"]]],RO:["40","00","(?:[236-8]\\d|90)\\d{7}|[23]\\d{5}",[6,9],[["(\\d{3})(\\d{3})","$1 $2",["2[3-6]","2[3-6]\\d9"],"0$1"],["(\\d{2})(\\d{4})","$1 $2",["219|31"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[23]1"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[236-9]"],"0$1"]],"0",0,0,0,0,0,0,0," int "],RS:["381","00","38[02-9]\\d{6,9}|6\\d{7,9}|90\\d{4,8}|38\\d{5,6}|(?:7\\d\\d|800)\\d{3,9}|(?:[12]\\d|3[0-79])\\d{5,10}",[6,7,8,9,10,11,12],[["(\\d{3})(\\d{3,9})","$1 $2",["(?:2[389]|39)0|[7-9]"],"0$1"],["(\\d{2})(\\d{5,10})","$1 $2",["[1-36]"],"0$1"]],"0"],RU:["7","810","8\\d{13}|[347-9]\\d{9}",[10,14],[["(\\d{4})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["7(?:1[0-8]|2[1-9])","7(?:1(?:[0-356]2|4[29]|7|8[27])|2(?:1[23]|[2-9]2))","7(?:1(?:[0-356]2|4[29]|7|8[27])|2(?:13[03-69]|62[013-9]))|72[1-57-9]2"],"8 ($1)",1],["(\\d{5})(\\d)(\\d{2})(\\d{2})","$1 $2 $3 $4",["7(?:1[0-68]|2[1-9])","7(?:1(?:[06][3-6]|[18]|2[35]|[3-5][3-5])|2(?:[13][3-5]|[24-689]|7[457]))","7(?:1(?:0(?:[356]|4[023])|[18]|2(?:3[013-9]|5)|3[45]|43[013-79]|5(?:3[1-8]|4[1-7]|5)|6(?:3[0-35-9]|[4-6]))|2(?:1(?:3[178]|[45])|[24-689]|3[35]|7[457]))|7(?:14|23)4[0-8]|71(?:33|45)[1-79]"],"8 ($1)",1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"8 ($1)",1],["(\\d{3})(\\d{3})(\\d{2})(\\d{2})","$1 $2-$3-$4",["[349]|8(?:[02-7]|1[1-8])"],"8 ($1)",1],["(\\d{4})(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3 $4",["8"],"8 ($1)"]],"8",0,0,0,0,0,[["336(?:[013-9]\\d|2[013-9])\\d{5}|(?:3(?:0[12]|4[1-35-79]|5[1-3]|65|8[1-58]|9[0145])|4(?:01|1[1356]|2[13467]|7[1-5]|8[1-7]|9[1-689])|8(?:1[1-8]|2[01]|3[13-6]|4[0-8]|5[15-7]|6[0-35-79]|7[1-37-9]))\\d{7}",[10]],["9\\d{9}",[10]],["8(?:0[04]|108\\d{3})\\d{7}"],["80[39]\\d{7}",[10]],["808\\d{7}",[10]]],"8~10"],RW:["250","00","(?:06|[27]\\d\\d|[89]00)\\d{6}",[8,9],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["0"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["2"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[7-9]"],"0$1"]],"0"],SA:["966","00","(?:[15]\\d|800|92)\\d{7}",[9,10],[["(\\d{4})(\\d{5})","$1 $2",["9"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["1"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["5"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"]]],"0"],SB:["677","0[01]","[6-9]\\d{6}|[1-6]\\d{4}",[5,7],[["(\\d{2})(\\d{5})","$1 $2",["6[89]|7|8[4-9]|9(?:[1-8]|9[0-8])"]]]],SC:["248","010|0[0-2]","(?:[2489]\\d|64)\\d{5}",[7],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[246]|9[57]"]]],0,0,0,0,0,0,0,"00"],SD:["249","00","[19]\\d{8}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[19]"],"0$1"]],"0"],SE:["46","00","(?:[26]\\d\\d|9)\\d{9}|[1-9]\\d{8}|[1-689]\\d{7}|[1-4689]\\d{6}|2\\d{5}",[6,7,8,9,10,12],[["(\\d{2})(\\d{2,3})(\\d{2})","$1-$2 $3",["20"],"0$1",0,"$1 $2 $3"],["(\\d{3})(\\d{4})","$1-$2",["9(?:00|39|44|9)"],"0$1",0,"$1 $2"],["(\\d{2})(\\d{3})(\\d{2})","$1-$2 $3",["[12][136]|3[356]|4[0246]|6[03]|90[1-9]"],"0$1",0,"$1 $2 $3"],["(\\d)(\\d{2,3})(\\d{2})(\\d{2})","$1-$2 $3 $4",["8"],"0$1",0,"$1 $2 $3 $4"],["(\\d{3})(\\d{2,3})(\\d{2})","$1-$2 $3",["1[2457]|2(?:[247-9]|5[0138])|3[0247-9]|4[1357-9]|5[0-35-9]|6(?:[125689]|4[02-57]|7[0-2])|9(?:[125-8]|3[02-5]|4[0-3])"],"0$1",0,"$1 $2 $3"],["(\\d{3})(\\d{2,3})(\\d{3})","$1-$2 $3",["9(?:00|39|44)"],"0$1",0,"$1 $2 $3"],["(\\d{2})(\\d{2,3})(\\d{2})(\\d{2})","$1-$2 $3 $4",["1[13689]|2[0136]|3[1356]|4[0246]|54|6[03]|90[1-9]"],"0$1",0,"$1 $2 $3 $4"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1-$2 $3 $4",["10|7"],"0$1",0,"$1 $2 $3 $4"],["(\\d)(\\d{3})(\\d{3})(\\d{2})","$1-$2 $3 $4",["8"],"0$1",0,"$1 $2 $3 $4"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1-$2 $3 $4",["[13-5]|2(?:[247-9]|5[0138])|6(?:[124-689]|7[0-2])|9(?:[125-8]|3[02-5]|4[0-3])"],"0$1",0,"$1 $2 $3 $4"],["(\\d{3})(\\d{2})(\\d{2})(\\d{3})","$1-$2 $3 $4",["9"],"0$1",0,"$1 $2 $3 $4"],["(\\d{3})(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1-$2 $3 $4 $5",["[26]"],"0$1",0,"$1 $2 $3 $4 $5"]],"0"],SG:["65","0[0-3]\\d","(?:(?:1\\d|8)\\d\\d|7000)\\d{7}|[3689]\\d{7}",[8,10,11],[["(\\d{4})(\\d{4})","$1 $2",["[369]|8(?:0[1-9]|[1-9])"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"]],["(\\d{4})(\\d{4})(\\d{3})","$1 $2 $3",["7"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["1"]]]],SH:["290","00","(?:[256]\\d|8)\\d{3}",[4,5],0,0,0,0,0,0,"[256]"],SI:["386","00|10(?:22|66|88|99)","[1-7]\\d{7}|8\\d{4,7}|90\\d{4,6}",[5,6,7,8],[["(\\d{2})(\\d{3,6})","$1 $2",["8[09]|9"],"0$1"],["(\\d{3})(\\d{5})","$1 $2",["59|8"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[37][01]|4[0139]|51|6"],"0$1"],["(\\d)(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[1-57]"],"(0$1)"]],"0",0,0,0,0,0,0,"00"],SJ:["47","00","0\\d{4}|(?:[489]\\d|79)\\d{6}",[5,8],0,0,0,0,0,0,"79"],SK:["421","00","[2-689]\\d{8}|[2-59]\\d{6}|[2-5]\\d{5}",[6,7,9],[["(\\d)(\\d{2})(\\d{3,4})","$1 $2 $3",["21"],"0$1"],["(\\d{2})(\\d{2})(\\d{2,3})","$1 $2 $3",["[3-5][1-8]1","[3-5][1-8]1[67]"],"0$1"],["(\\d)(\\d{3})(\\d{3})(\\d{2})","$1/$2 $3 $4",["2"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[689]"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1/$2 $3 $4",["[3-5]"],"0$1"]],"0"],SL:["232","00","(?:[237-9]\\d|66)\\d{6}",[8],[["(\\d{2})(\\d{6})","$1 $2",["[236-9]"],"(0$1)"]],"0"],SM:["378","00","(?:0549|[5-7]\\d)\\d{6}",[8,10],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-7]"]],["(\\d{4})(\\d{6})","$1 $2",["0"]]],0,0,"([89]\\d{5})$","0549$1"],SN:["221","00","(?:[378]\\d|93)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"]],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[379]"]]]],SO:["252","00","[346-9]\\d{8}|[12679]\\d{7}|[1-5]\\d{6}|[1348]\\d{5}",[6,7,8,9],[["(\\d{2})(\\d{4})","$1 $2",["8[125]"]],["(\\d{6})","$1",["[134]"]],["(\\d)(\\d{6})","$1 $2",["[15]|2[0-79]|3[0-46-8]|4[0-7]"]],["(\\d)(\\d{7})","$1 $2",["(?:2|90)4|[67]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[348]|64|79|90"]],["(\\d{2})(\\d{5,7})","$1 $2",["1|28|6[0-35-9]|7[67]|9[2-9]"]]],"0"],SR:["597","00","(?:[2-5]|[6-8]\\d|90)\\d{5}",[6,7],[["(\\d{2})(\\d{2})(\\d{2})","$1-$2-$3",["56"]],["(\\d{3})(\\d{3})","$1-$2",["[2-5]"]],["(\\d{3})(\\d{4})","$1-$2",["[6-9]"]]]],SS:["211","00","[19]\\d{8}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[19]"],"0$1"]],"0"],ST:["239","00","(?:22|9\\d)\\d{5}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[29]"]]]],SV:["503","00","[25-7]\\d{7}|(?:80\\d|900)\\d{4}(?:\\d{4})?",[7,8,11],[["(\\d{3})(\\d{4})","$1 $2",["[89]"]],["(\\d{4})(\\d{4})","$1 $2",["[25-7]"]],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["[89]"]]]],SX:["1","011","7215\\d{6}|(?:[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"(5\\d{6})$|1","721$1",0,"721"],SY:["963","00","[1-359]\\d{8}|[1-5]\\d{7}",[8,9],[["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[1-4]|5[1-3]"],"0$1",1],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[59]"],"0$1",1]],"0"],SZ:["268","00","0800\\d{4}|(?:[237]\\d|900)\\d{6}",[8,9],[["(\\d{4})(\\d{4})","$1 $2",["[0237]"]],["(\\d{5})(\\d{4})","$1 $2",["9"]]]],TA:["290","00","8\\d{3}",[4],0,0,0,0,0,0,"8"],TC:["1","011","(?:[58]\\d\\d|649|900)\\d{7}",[10],0,"1",0,"([2-479]\\d{6})$|1","649$1",0,"649"],TD:["235","00|16","(?:22|30|[689]\\d|77)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[236-9]"]]],0,0,0,0,0,0,0,"00"],TG:["228","00","[279]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[279]"]]]],TH:["66","00[1-9]","(?:001800|[2-57]|[689]\\d)\\d{7}|1\\d{7,9}",[8,9,10,13],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[13-9]"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1"]]],"0"],TJ:["992","810","(?:[0-57-9]\\d|66)\\d{7}",[9],[["(\\d{6})(\\d)(\\d{2})","$1 $2 $3",["331","3317"]],["(\\d{3})(\\d{2})(\\d{4})","$1 $2 $3",["44[02-479]|[34]7"]],["(\\d{4})(\\d)(\\d{4})","$1 $2 $3",["3(?:[1245]|3[12])"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["\\d"]]],0,0,0,0,0,0,0,"8~10"],TK:["690","00","[2-47]\\d{3,6}",[4,5,6,7]],TL:["670","00","7\\d{7}|(?:[2-47]\\d|[89]0)\\d{5}",[7,8],[["(\\d{3})(\\d{4})","$1 $2",["[2-489]|70"]],["(\\d{4})(\\d{4})","$1 $2",["7"]]]],TM:["993","810","(?:[1-6]\\d|71)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2-$3-$4",["12"],"(8 $1)"],["(\\d{3})(\\d)(\\d{2})(\\d{2})","$1 $2-$3-$4",["[1-5]"],"(8 $1)"],["(\\d{2})(\\d{6})","$1 $2",["[67]"],"8 $1"]],"8",0,0,0,0,0,0,"8~10"],TN:["216","00","[2-57-9]\\d{7}",[8],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[2-57-9]"]]]],TO:["676","00","(?:0800|(?:[5-8]\\d\\d|999)\\d)\\d{3}|[2-8]\\d{4}",[5,7],[["(\\d{2})(\\d{3})","$1-$2",["[2-4]|50|6[09]|7[0-24-69]|8[05]"]],["(\\d{4})(\\d{3})","$1 $2",["0"]],["(\\d{3})(\\d{4})","$1 $2",["[5-9]"]]]],TR:["90","00","4\\d{6}|8\\d{11,12}|(?:[2-58]\\d\\d|900)\\d{7}",[7,10,12,13],[["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["512|8[01589]|90"],"0$1",1],["(\\d{3})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["5(?:[0-59]|61)","5(?:[0-59]|61[06])","5(?:[0-59]|61[06]1)"],"0$1",1],["(\\d{3})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[24][1-8]|3[1-9]"],"(0$1)",1],["(\\d{3})(\\d{3})(\\d{6,7})","$1 $2 $3",["80"],"0$1",1]],"0"],TT:["1","011","(?:[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-46-8]\\d{6})$|1","868$1",0,"868"],TV:["688","00","(?:2|7\\d\\d|90)\\d{4}",[5,6,7],[["(\\d{2})(\\d{3})","$1 $2",["2"]],["(\\d{2})(\\d{4})","$1 $2",["90"]],["(\\d{2})(\\d{5})","$1 $2",["7"]]]],TW:["886","0(?:0[25-79]|19)","[2-689]\\d{8}|7\\d{9,10}|[2-8]\\d{7}|2\\d{6}",[7,8,9,10,11],[["(\\d{2})(\\d)(\\d{4})","$1 $2 $3",["202"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[258]0"],"0$1"],["(\\d)(\\d{3,4})(\\d{4})","$1 $2 $3",["[23568]|4(?:0[02-48]|[1-47-9])|7[1-9]","[23568]|4(?:0[2-48]|[1-47-9])|(?:400|7)[1-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[49]"],"0$1"],["(\\d{2})(\\d{4})(\\d{4,5})","$1 $2 $3",["7"],"0$1"]],"0",0,0,0,0,0,0,0,"#"],TZ:["255","00[056]","(?:[25-8]\\d|41|90)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{4})","$1 $2 $3",["[89]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[24]"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["5"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[67]"],"0$1"]],"0"],UA:["380","00","[89]\\d{9}|[3-9]\\d{8}",[9,10],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["6[12][29]|(?:3[1-8]|4[136-8]|5[12457]|6[49])2|(?:56|65)[24]","6[12][29]|(?:35|4[1378]|5[12457]|6[49])2|(?:56|65)[24]|(?:3[1-46-8]|46)2[013-9]"],"0$1"],["(\\d{4})(\\d{5})","$1 $2",["3[1-8]|4(?:[1367]|[45][6-9]|8[4-6])|5(?:[1-5]|6[0135689]|7[4-6])|6(?:[12][3-7]|[459])","3[1-8]|4(?:[1367]|[45][6-9]|8[4-6])|5(?:[1-5]|6(?:[015689]|3[02389])|7[4-6])|6(?:[12][3-7]|[459])"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[3-7]|89|9[1-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["[89]"],"0$1"]],"0",0,0,0,0,0,0,"0~0"],UG:["256","00[057]","800\\d{6}|(?:[29]0|[347]\\d)\\d{7}",[9],[["(\\d{4})(\\d{5})","$1 $2",["202","2024"],"0$1"],["(\\d{3})(\\d{6})","$1 $2",["[27-9]|4(?:6[45]|[7-9])"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["[34]"],"0$1"]],"0"],US:["1","011","[2-9]\\d{9}|3\\d{6}",[10],[["(\\d{3})(\\d{4})","$1-$2",["310"],0,1],["(\\d{3})(\\d{3})(\\d{4})","($1) $2-$3",["[2-9]"],0,1,"$1-$2-$3"]],"1",0,0,0,0,0,[["(?:2742|(?:472|983)[2-47-9])\\d{6}|(?:2(?:0[1-35-9]|1[02-9]|2[03-57-9]|3[1459]|4[08]|5[1-46]|6[0279]|7[0269]|8[13])|3(?:0[1-57-9]|1[02-9]|2[013-79]|3[0-24679]|4[167]|5[0-3]|6[01349]|8[056])|4(?:0[124-9]|1[02-579]|2[3-5]|3[0245]|4[023578]|58|6[349]|7[0589]|8[04])|5(?:0[1-57-9]|1[0235-8]|20|3[0149]|4[01]|5[179]|6[1-47]|7[0-5]|8[0256])|6(?:0[1-35-9]|1[024-9]|2[03689]|3[016]|4[0156]|5[01679]|6[0-279]|78|8[0-269])|7(?:0[1-46-8]|1[2-9]|2[04-8]|3[0-247]|4[0378]|5[47]|6[02359]|7[0-59]|8[156])|8(?:0[1-68]|1[02-8]|2[0168]|3[0-2589]|4[03578]|5[046-9]|6[02-5]|7[028])|9(?:0[1346-9]|1[02-9]|2[0589]|3[0146-8]|4[01357-9]|5[12469]|7[0-3589]|8[04-69]))[2-9]\\d{6}"],[""],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}"],["900[2-9]\\d{6}"],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-9]|3[23]|44|66|77|88)[2-9]\\d{6}"]]],UY:["598","0(?:0|1[3-9]\\d)","0004\\d{2,9}|[1249]\\d{7}|2\\d{3,4}|(?:[49]\\d|80)\\d{5}",[4,5,6,7,8,9,10,11,12,13],[["(\\d{4,5})","$1",["21"]],["(\\d{3})(\\d{3,4})","$1 $2",["0"]],["(\\d{3})(\\d{4})","$1 $2",["[49]0|8"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["9"],"0$1"],["(\\d{4})(\\d{4})","$1 $2",["[124]"]],["(\\d{3})(\\d{3})(\\d{2,4})","$1 $2 $3",["0"]],["(\\d{3})(\\d{3})(\\d{3})(\\d{2,4})","$1 $2 $3 $4",["0"]]],"0",0,0,0,0,0,0,"00"," int. "],UZ:["998","00","(?:20|33|[5-9]\\d)\\d{7}",[9],[["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[235-9]"]]]],VA:["39","00","0\\d{5,10}|3[0-8]\\d{7,10}|55\\d{8}|8\\d{5}(?:\\d{2,4})?|(?:1\\d|39)\\d{7,8}",[6,7,8,9,10,11,12],0,0,0,0,0,0,"06698"],VC:["1","011","(?:[58]\\d\\d|784|900)\\d{7}",[10],0,"1",0,"([2-7]\\d{6})$|1","784$1",0,"784"],VE:["58","00","[68]00\\d{7}|(?:[24]\\d|[59]0)\\d{8}",[10],[["(\\d{3})(\\d{7})","$1-$2",["[24-689]"],"0$1"]],"0"],VG:["1","011","(?:284|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-578]\\d{6})$|1","284$1",0,"284"],VI:["1","011","[58]\\d{9}|(?:34|90)0\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","340$1",0,"340"],VN:["84","00","[12]\\d{9}|[135-9]\\d{8}|[16]\\d{7}|[16-8]\\d{6}",[7,8,9,10],[["(\\d{2})(\\d{5})","$1 $2",["80"],"0$1",1],["(\\d{4})(\\d{4,6})","$1 $2",["1"],0,1],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["6"],"0$1",1],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[357-9]"],"0$1",1],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["2[48]"],"0$1",1],["(\\d{3})(\\d{4})(\\d{3})","$1 $2 $3",["2"],"0$1",1]],"0"],VU:["678","00","[57-9]\\d{6}|(?:[238]\\d|48)\\d{3}",[5,7],[["(\\d{3})(\\d{4})","$1 $2",["[57-9]"]]]],WF:["681","00","(?:40|72|8\\d{4})\\d{4}|[89]\\d{5}",[6,9],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["[47-9]"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"]]]],WS:["685","0","(?:[2-6]|8\\d{5})\\d{4}|[78]\\d{6}|[68]\\d{5}",[5,6,7,10],[["(\\d{5})","$1",["[2-5]|6[1-9]"]],["(\\d{3})(\\d{3,7})","$1 $2",["[68]"]],["(\\d{2})(\\d{5})","$1 $2",["7"]]]],XK:["383","00","2\\d{7,8}|3\\d{7,11}|(?:4\\d\\d|[89]00)\\d{5}",[8,9,10,11,12],[["(\\d{3})(\\d{5})","$1 $2",["[89]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[2-4]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["2|39"],"0$1"],["(\\d{2})(\\d{7,10})","$1 $2",["3"],"0$1"]],"0"],YE:["967","00","(?:1|7\\d)\\d{7}|[1-7]\\d{6}",[7,8,9],[["(\\d)(\\d{3})(\\d{3,4})","$1 $2 $3",["[1-6]|7(?:[24-6]|8[0-7])"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["7"],"0$1"]],"0"],YT:["262","00","7093\\d{5}|(?:80|9\\d)\\d{7}|(?:26|63)9\\d{6}",[9],0,"0",0,0,0,0,0,[["269(?:0[0-467]|15|5[0-4]|6\\d|[78]0)\\d{4}"],["(?:639(?:0[0-79]|1[019]|[267]\\d|3[09]|40|5[05-9]|9[04-79])|7093[5-7])\\d{4}"],["80\\d{7}"],0,0,0,0,0,["9(?:(?:39|47)8[01]|769\\d)\\d{4}"]]],ZA:["27","00","[1-79]\\d{8}|8\\d{4,9}",[5,6,7,8,9,10],[["(\\d{2})(\\d{3,4})","$1 $2",["8[1-4]"],"0$1"],["(\\d{2})(\\d{3})(\\d{2,3})","$1 $2 $3",["8[1-4]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["860"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[1-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"],"0$1"]],"0"],ZM:["260","00","800\\d{6}|(?:21|[579]\\d|63)\\d{7}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[28]"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["[579]"],"0$1"]],"0"],ZW:["263","00","2(?:[0-57-9]\\d{6,8}|6[0-24-9]\\d{6,7})|[38]\\d{9}|[35-8]\\d{8}|[3-6]\\d{7}|[1-689]\\d{6}|[1-3569]\\d{5}|[1356]\\d{4}",[5,6,7,8,9,10],[["(\\d{3})(\\d{3,5})","$1 $2",["2(?:0[45]|2[278]|[49]8)|3(?:[09]8|17)|6(?:[29]8|37|75)|[23][78]|(?:33|5[15]|6[68])[78]"],"0$1"],["(\\d)(\\d{3})(\\d{2,4})","$1 $2 $3",["[49]"],"0$1"],["(\\d{3})(\\d{4})","$1 $2",["80"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["24|8[13-59]|(?:2[05-79]|39|5[45]|6[15-8])2","2(?:02[014]|4|[56]20|[79]2)|392|5(?:42|525)|6(?:[16-8]21|52[013])|8[13-59]"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["2(?:1[39]|2[0157]|[378]|[56][14])|3(?:12|29)","2(?:1[39]|2[0157]|[378]|[56][14])|3(?:123|29)"],"0$1"],["(\\d{4})(\\d{6})","$1 $2",["8"],"0$1"],["(\\d{2})(\\d{3,5})","$1 $2",["1|2(?:0[0-36-9]|12|29|[56])|3(?:1[0-689]|[24-6])|5(?:[0236-9]|1[2-4])|6(?:[013-59]|7[0-46-9])|(?:33|55|6[68])[0-69]|(?:29|3[09]|62)[0-79]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["29[013-9]|39|54"],"0$1"],["(\\d{4})(\\d{3,5})","$1 $2",["(?:25|54)8","258|5483"],"0$1"]],"0"]},nonGeographic:{800:["800",0,"(?:00|[1-9]\\d)\\d{6}",[8],[["(\\d{4})(\\d{4})","$1 $2",["\\d"]]],0,0,0,0,0,0,[0,0,["(?:00|[1-9]\\d)\\d{6}"]]],808:["808",0,"[1-9]\\d{7}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[1-9]"]]],0,0,0,0,0,0,[0,0,0,0,0,0,0,0,0,["[1-9]\\d{7}"]]],870:["870",0,"7\\d{11}|[235-7]\\d{8}",[9,12],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[235-7]"]]],0,0,0,0,0,0,[0,["(?:[356]|774[45])\\d{8}|7[6-8]\\d{7}"],0,0,0,0,0,0,["2\\d{8}",[9]]]],878:["878",0,"10\\d{10}",[12],[["(\\d{2})(\\d{5})(\\d{5})","$1 $2 $3",["1"]]],0,0,0,0,0,0,[0,0,0,0,0,0,0,0,["10\\d{10}"]]],881:["881",0,"6\\d{9}|[0-36-9]\\d{8}",[9,10],[["(\\d)(\\d{3})(\\d{5})","$1 $2 $3",["[0-37-9]"]],["(\\d)(\\d{3})(\\d{5,6})","$1 $2 $3",["6"]]],0,0,0,0,0,0,[0,["6\\d{9}|[0-36-9]\\d{8}"]]],882:["882",0,"[13]\\d{6}(?:\\d{2,5})?|[19]\\d{7}|(?:[25]\\d\\d|4)\\d{7}(?:\\d{2})?",[7,8,9,10,11,12],[["(\\d{2})(\\d{5})","$1 $2",["16|342"]],["(\\d{2})(\\d{6})","$1 $2",["49"]],["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["1[36]|9"]],["(\\d{2})(\\d{4})(\\d{3})","$1 $2 $3",["3[23]"]],["(\\d{2})(\\d{3,4})(\\d{4})","$1 $2 $3",["16"]],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["10|23|3(?:[15]|4[57])|4|51"]],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["34"]],["(\\d{2})(\\d{4,5})(\\d{5})","$1 $2 $3",["[1-35]"]]],0,0,0,0,0,0,[0,["342\\d{4}|(?:337|49)\\d{6}|(?:3(?:2|47|7\\d{3})|50\\d{3})\\d{7}",[7,8,9,10,12]],0,0,0,["348[57]\\d{7}",[11]],0,0,["1(?:3(?:0[0347]|[13][0139]|2[035]|4[013568]|6[0459]|7[06]|8[15-8]|9[0689])\\d{4}|6\\d{5,10})|(?:345\\d|9[89])\\d{6}|(?:10|2(?:3|85\\d)|3(?:[15]|[69]\\d\\d)|4[15-8]|51)\\d{8}"]]],883:["883",0,"(?:[1-4]\\d|51)\\d{6,10}",[8,9,10,11,12],[["(\\d{3})(\\d{3})(\\d{2,8})","$1 $2 $3",["[14]|2[24-689]|3[02-689]|51[24-9]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["510"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["21"]],["(\\d{4})(\\d{4})(\\d{4})","$1 $2 $3",["51[13]"]],["(\\d{3})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["[235]"]]],0,0,0,0,0,0,[0,0,0,0,0,0,0,0,["(?:2(?:00\\d\\d|10)|(?:370[1-9]|51\\d0)\\d)\\d{7}|51(?:00\\d{5}|[24-9]0\\d{4,7})|(?:1[0-79]|2[24-689]|3[02-689]|4[0-4])0\\d{5,9}"]]],888:["888",0,"\\d{11}",[11],[["(\\d{3})(\\d{3})(\\d{5})","$1 $2 $3"]],0,0,0,0,0,0,[0,0,0,0,0,0,["\\d{11}"]]],979:["979",0,"[1359]\\d{8}",[9],[["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["[1359]"]]],0,0,0,0,0,0,[0,0,0,["[1359]\\d{8}"]]]}};function Pe(t,e){var n=Array.prototype.slice.call(e);return n.push(Kn),t.apply(this,n)}function At(t,e){t=t.split("-"),e=e.split("-");for(var n=t[0].split("."),r=e[0].split("."),o=0;o<3;o++){var i=Number(n[o]),d=Number(r[o]);if(i>d)return 1;if(d>i)return-1;if(!isNaN(i)&&isNaN(d))return 1;if(isNaN(i)&&!isNaN(d))return-1}return t[1]&&e[1]?t[1]>e[1]?1:t[1]<e[1]?-1:0:!t[1]&&e[1]?1:t[1]&&!e[1]?-1:0}var Mo={}.constructor;function ee(t){return t!=null&&t.constructor===Mo}function $e(t){"@babel/helpers - typeof";return $e=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},$e(t)}function tt(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Xn(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Fo(r.key),r)}}function nt(t,e,n){return e&&Xn(t.prototype,e),n&&Xn(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function Fo(t){var e=Ro(t,"string");return $e(e)=="symbol"?e:e+""}function Ro(t,e){if($e(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if($e(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var Do="1.2.0",Lo="1.7.35",Yn=" ext. ",Uo=/^\d+$/,I=(function(){function t(e){tt(this,t),Ot(e),this.metadata=e,Qn.call(this,e)}return nt(t,[{key:"getCountries",value:function(){return Object.keys(this.metadata.countries).filter(function(n){return n!=="001"})}},{key:"getCountryMetadata",value:function(n){return this.metadata.countries[n]}},{key:"nonGeographic",value:function(){if(!(this.v1||this.v2||this.v3))return this.metadata.nonGeographic||this.metadata.nonGeographical}},{key:"hasCountry",value:function(n){return this.getCountryMetadata(n)!==void 0}},{key:"hasCallingCode",value:function(n){if(this.getCountryCodesForCallingCode(n))return!0;if(this.nonGeographic()){if(this.nonGeographic()[n])return!0}else{var r=this.countryCallingCodes()[n];if(r&&r.length===1&&r[0]==="001")return!0}}},{key:"isNonGeographicCallingCode",value:function(n){return this.nonGeographic()?!!this.nonGeographic()[n]:!this.getCountryCodesForCallingCode(n)}},{key:"country",value:function(n){return this.selectNumberingPlan(n)}},{key:"selectNumberingPlan",value:function(n,r){if(n&&Uo.test(n)&&(r=n,n=null),n&&n!=="001"){if(!this.hasCountry(n))throw new Error("Unknown country: ".concat(n));this.numberingPlan=new qn(this.getCountryMetadata(n),this)}else if(r){if(!this.hasCallingCode(r))throw new Error("Unknown calling code: ".concat(r));this.numberingPlan=new qn(this.getNumberingPlanMetadata(r),this)}else this.numberingPlan=void 0;return this}},{key:"getCountryCodesForCallingCode",value:function(n){var r=this.countryCallingCodes()[n];if(r)return r.length===1&&r[0].length===3?void 0:r}},{key:"getCountryCodeForCallingCode",value:function(n){var r=this.getCountryCodesForCallingCode(n);if(r)return r[0]}},{key:"getNumberingPlanMetadata",value:function(n){var r=this.getCountryCodeForCallingCode(n);if(r)return this.getCountryMetadata(r);if(this.nonGeographic()){var o=this.nonGeographic()[n];if(o)return o}else{var i=this.countryCallingCodes()[n];if(i&&i.length===1&&i[0]==="001")return this.metadata.countries["001"]}}},{key:"countryCallingCode",value:function(){return this.numberingPlan.callingCode()}},{key:"IDDPrefix",value:function(){return this.numberingPlan.IDDPrefix()}},{key:"defaultIDDPrefix",value:function(){return this.numberingPlan.defaultIDDPrefix()}},{key:"nationalNumberPattern",value:function(){return this.numberingPlan.nationalNumberPattern()}},{key:"possibleLengths",value:function(){return this.numberingPlan.possibleLengths()}},{key:"formats",value:function(){return this.numberingPlan.formats()}},{key:"nationalPrefixForParsing",value:function(){return this.numberingPlan.nationalPrefixForParsing()}},{key:"nationalPrefixTransformRule",value:function(){return this.numberingPlan.nationalPrefixTransformRule()}},{key:"leadingDigits",value:function(){return this.numberingPlan.leadingDigits()}},{key:"hasTypes",value:function(){return this.numberingPlan.hasTypes()}},{key:"type",value:function(n){return this.numberingPlan.type(n)}},{key:"ext",value:function(){return this.numberingPlan.ext()}},{key:"countryCallingCodes",value:function(){return this.v1?this.metadata.country_phone_code_to_countries:this.metadata.country_calling_codes}},{key:"chooseCountryByCountryCallingCode",value:function(n){return this.selectNumberingPlan(n)}},{key:"hasSelectedNumberingPlan",value:function(){return this.numberingPlan!==void 0}}])})();var qn=(function(){function t(e,n){tt(this,t),this.globalMetadataObject=n,this.metadata=e,Qn.call(this,n.metadata)}return nt(t,[{key:"callingCode",value:function(){return this.metadata[0]}},{key:"getDefaultCountryMetadataForRegion",value:function(){return this.globalMetadataObject.getNumberingPlanMetadata(this.callingCode())}},{key:"IDDPrefix",value:function(){if(!(this.v1||this.v2))return this.metadata[1]}},{key:"defaultIDDPrefix",value:function(){if(!(this.v1||this.v2))return this.metadata[12]}},{key:"nationalNumberPattern",value:function(){return this.v1||this.v2?this.metadata[1]:this.metadata[2]}},{key:"possibleLengths",value:function(){if(!this.v1)return this.metadata[this.v2?2:3]}},{key:"_getFormats",value:function(n){return n[this.v1?2:this.v2?3:4]}},{key:"formats",value:function(){var n=this,r=this._getFormats(this.metadata)||this._getFormats(this.getDefaultCountryMetadataForRegion())||[];return r.map(function(o){return new Ho(o,n)})}},{key:"nationalPrefix",value:function(){return this.metadata[this.v1?3:this.v2?4:5]}},{key:"_getNationalPrefixFormattingRule",value:function(n){return n[this.v1?4:this.v2?5:6]}},{key:"nationalPrefixFormattingRule",value:function(){return this._getNationalPrefixFormattingRule(this.metadata)||this._getNationalPrefixFormattingRule(this.getDefaultCountryMetadataForRegion())}},{key:"_nationalPrefixForParsing",value:function(){return this.metadata[this.v1?5:this.v2?6:7]}},{key:"nationalPrefixForParsing",value:function(){return this._nationalPrefixForParsing()||this.nationalPrefix()}},{key:"nationalPrefixTransformRule",value:function(){return this.metadata[this.v1?6:this.v2?7:8]}},{key:"_getNationalPrefixIsOptionalWhenFormatting",value:function(){return!!this.metadata[this.v1?7:this.v2?8:9]}},{key:"nationalPrefixIsOptionalWhenFormattingInNationalFormat",value:function(){return this._getNationalPrefixIsOptionalWhenFormatting(this.metadata)||this._getNationalPrefixIsOptionalWhenFormatting(this.getDefaultCountryMetadataForRegion())}},{key:"leadingDigits",value:function(){return this.metadata[this.v1?8:this.v2?9:10]}},{key:"types",value:function(){return this.metadata[this.v1?9:this.v2?10:11]}},{key:"hasTypes",value:function(){return this.types()&&this.types().length===0?!1:!!this.types()}},{key:"type",value:function(n){if(this.hasTypes()&&Jn(this.types(),n))return new Bo(Jn(this.types(),n),this)}},{key:"ext",value:function(){return this.v1||this.v2?Yn:this.metadata[13]||Yn}}])})(),Ho=(function(){function t(e,n){tt(this,t),this._format=e,this.metadata=n}return nt(t,[{key:"pattern",value:function(){return this._format[0]}},{key:"format",value:function(){return this._format[1]}},{key:"leadingDigitsPatterns",value:function(){return this._format[2]||[]}},{key:"nationalPrefixFormattingRule",value:function(){return this._format[3]||this.metadata.nationalPrefixFormattingRule()}},{key:"nationalPrefixIsOptionalWhenFormattingInNationalFormat",value:function(){return!!this._format[4]||this.metadata.nationalPrefixIsOptionalWhenFormattingInNationalFormat()}},{key:"nationalPrefixIsMandatoryWhenFormattingInNationalFormat",value:function(){return this.usesNationalPrefix()&&!this.nationalPrefixIsOptionalWhenFormattingInNationalFormat()}},{key:"usesNationalPrefix",value:function(){return!!(this.nationalPrefixFormattingRule()&&!jo.test(this.nationalPrefixFormattingRule()))}},{key:"internationalFormat",value:function(){return this._format[5]||this.format()}}])})(),jo=/^\(?\$1\)?$/,Bo=(function(){function t(e,n){tt(this,t),this.type=e,this.metadata=n}return nt(t,[{key:"pattern",value:function(){return this.metadata.v1?this.type:this.type[0]}},{key:"possibleLengths",value:function(){if(!this.metadata.v1)return this.type[1]||this.metadata.possibleLengths()}}])})();function Jn(t,e){switch(e){case"FIXED_LINE":return t[0];case"MOBILE":return t[1];case"TOLL_FREE":return t[2];case"PREMIUM_RATE":return t[3];case"PERSONAL_NUMBER":return t[4];case"VOICEMAIL":return t[5];case"UAN":return t[6];case"PAGER":return t[7];case"VOIP":return t[8];case"SHARED_COST":return t[9]}}function Ot(t){if(!t)throw new Error("[libphonenumber-js] `metadata` argument not passed. Check your arguments.");if(!ee(t)||!ee(t.countries))throw new Error("[libphonenumber-js] `metadata` argument was passed but it's not a valid metadata. Must be an object having `.countries` child object property. Got ".concat(ee(t)?"an object of shape: { "+Object.keys(t).join(", ")+" }":"a "+Go(t)+": "+t,"."))}var Go=function(e){return $e(e)};function se(t,e){if(e=new I(e),e.hasCountry(t))return e.selectNumberingPlan(t).countryCallingCode();throw new Error("Unknown country: ".concat(t))}function Zn(t,e){return e.countries.hasOwnProperty(t)}function Qn(t){var e=t.version;typeof e=="number"?(this.v1=e===1,this.v2=e===2,this.v3=e===3,this.v4=e===4):e?At(e,Do)===-1?this.v2=!0:At(e,Lo)===-1?this.v3=!0:this.v4=!0:this.v1=!0}function Wo(t,e){var n=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n)return(n=n.call(t)).next.bind(n);if(Array.isArray(t)||(n=Vo(t))||e&&t&&typeof t.length=="number"){n&&(t=n);var r=0;return function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
1429
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Vo(t,e){if(t){if(typeof t=="string")return er(t,e);var n={}.toString.call(t).slice(8,-1);return n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set"?Array.from(t):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?er(t,e):void 0}}function er(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function Mt(t,e){for(var n=t.slice(),r=Wo(e),o;!(o=r()).done;){var i=o.value;t.indexOf(i)<0&&n.push(i)}return n.sort(function(d,l){return d-l})}function ae(t,e,n){return tr(t,e,void 0,n)}function tr(t,e,n,r){e&&(r=new I(r.metadata),r.selectNumberingPlan(e));var o=r.type(n),i=o&&o.possibleLengths()||r.possibleLengths();if(!i)return"IS_POSSIBLE";if(n==="FIXED_LINE_OR_MOBILE"){if(!r.type("FIXED_LINE"))return tr(t,e,"MOBILE",r);var d=r.type("MOBILE");d&&(i=Mt(i,d.possibleLengths()))}else if(n&&!o)return"INVALID_LENGTH";var l=t.length,p=i[0];return p===l?"IS_POSSIBLE":p>l?"TOO_SHORT":i[i.length-1]<l?"TOO_LONG":i.indexOf(l,1)>=0?"IS_POSSIBLE":"INVALID_LENGTH"}function Ft(t,e,n){if(e===void 0&&(e={}),n=new I(n),e.v2){if(!t.countryCallingCode)throw new Error("Invalid phone number object passed");n.selectNumberingPlan(t.countryCallingCode)}else{if(!t.phone)return!1;if(t.country){if(!n.hasCountry(t.country))throw new Error("Unknown country: ".concat(t.country));n.selectNumberingPlan(t.country)}else{if(!t.countryCallingCode)throw new Error("Invalid phone number object passed");n.selectNumberingPlan(t.countryCallingCode)}}if(n.possibleLengths())return Rt(t.phone||t.nationalNumber,t.country,n);if(t.countryCallingCode&&n.isNonGeographicCallingCode(t.countryCallingCode))return!0;throw new Error('Missing "possibleLengths" in metadata. Perhaps the metadata has been generated before v1.0.18.')}function Rt(t,e,n){return ae(t,e,n)==="IS_POSSIBLE"}function W(t,e){return t=t||"",new RegExp("^(?:"+e+")$").test(t)}function zo(t,e){var n=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n)return(n=n.call(t)).next.bind(n);if(Array.isArray(t)||(n=Ko(t))||e&&t&&typeof t.length=="number"){n&&(t=n);var r=0;return function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
1430
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ko(t,e){if(t){if(typeof t=="string")return nr(t,e);var n={}.toString.call(t).slice(8,-1);return n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set"?Array.from(t):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?nr(t,e):void 0}}function nr(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}var Xo=["MOBILE","PREMIUM_RATE","TOLL_FREE","SHARED_COST","VOIP","PERSONAL_NUMBER","PAGER","UAN","VOICEMAIL"];function le(t,e,n){if(e=e||{},!(!t.country&&!t.countryCallingCode)){n=new I(n),n.selectNumberingPlan(t.country,t.countryCallingCode);var r=e.v2?t.nationalNumber:t.phone;if(W(r,n.nationalNumberPattern())){if(Dt(r,"FIXED_LINE",n))return n.type("MOBILE")&&n.type("MOBILE").pattern()===""||!n.type("MOBILE")||Dt(r,"MOBILE",n)?"FIXED_LINE_OR_MOBILE":"FIXED_LINE";for(var o=zo(Xo),i;!(i=o()).done;){var d=i.value;if(Dt(r,d,n))return d}}}}function Dt(t,e,n){return e=n.type(e),!e||!e.pattern()||e.possibleLengths()&&e.possibleLengths().indexOf(t.length)<0?!1:W(t,e.pattern())}function Lt(t,e,n){if(e=e||{},n=new I(n),n.selectNumberingPlan(t.country,t.countryCallingCode),n.hasTypes())return le(t,e,n.metadata)!==void 0;var r=e.v2?t.nationalNumber:t.phone;return W(r,n.nationalNumberPattern())}function Ut(t,e,n){var r=new I(n),o=r.getCountryCodesForCallingCode(t);return o?o.filter(function(i){return Yo(e,i,n)}):[]}function Yo(t,e,n){var r=new I(n);return r.selectNumberingPlan(e),r.numberingPlan.possibleLengths().indexOf(t.length)>=0}var Ce=2,rr=17,or=3,V="0-9\uFF10-\uFF19\u0660-\u0669\u06F0-\u06F9",qo="-\u2010-\u2015\u2212\u30FC\uFF0D",Jo="\uFF0F/",Zo="\uFF0E.",Qo=" \xA0\xAD\u200B\u2060\u3000",ei="()\uFF08\uFF09\uFF3B\uFF3D\\[\\]",ti="~\u2053\u223C\uFF5E",fe="".concat(qo).concat(Jo).concat(Zo).concat(Qo).concat(ei).concat(ti),Ee="+\uFF0B";var ni=new RegExp("(["+V+"])");function Ht(t,e,n,r){if(e){var o=new I(r);o.selectNumberingPlan(e,n);var i=new RegExp(o.IDDPrefix());if(t.search(i)===0){t=t.slice(t.match(i)[0].length);var d=t.match(ni);if(!(d&&d[1]!=null&&d[1].length>0&&d[1]==="0"))return t}}}function jt(t,e){if(t&&e.numberingPlan.nationalPrefixForParsing()){var n=new RegExp("^(?:"+e.numberingPlan.nationalPrefixForParsing()+")"),r=n.exec(t);if(r){var o,i,d=r.length-1,l=d>0&&r[d];if(e.nationalPrefixTransformRule()&&l)o=t.replace(n,e.nationalPrefixTransformRule()),d>1&&(i=r[1]);else{var p=r[0];o=t.slice(p.length),l&&(i=r[1])}var a;if(l){var $=t.indexOf(r[1]),c=t.slice(0,$);c===e.numberingPlan.nationalPrefix()&&(a=e.numberingPlan.nationalPrefix())}else a=r[0];return{nationalNumber:o,nationalPrefix:a,carrierCode:i}}}return{nationalNumber:t}}function ri(t,e){var n=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n)return(n=n.call(t)).next.bind(n);if(Array.isArray(t)||(n=oi(t))||e&&t&&typeof t.length=="number"){n&&(t=n);var r=0;return function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
1431
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function oi(t,e){if(t){if(typeof t=="string")return ir(t,e);var n={}.toString.call(t).slice(8,-1);return n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set"?Array.from(t):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ir(t,e):void 0}}function ir(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function Bt(t,e){var n=e.countries,r=e.metadata;r=new I(r);for(var o=ri(n),i;!(i=o()).done;){var d=i.value;if(r.selectNumberingPlan(d),r.leadingDigits()){if(t&&t.search(r.leadingDigits())===0)return d}else if(le({phone:t,country:d},void 0,r.metadata))return d}}var ii=!1;function Se(t,e){var n=e.nationalNumber,r=e.metadata;if(ii&&r.isNonGeographicCallingCode(t))return"001";var o=r.getCountryCodesForCallingCode(t);if(o)return o.length===1?o[0]:Bt(n,{countries:o,metadata:r.metadata})}function he(t,e,n){var r=jt(t,n),o=r.carrierCode,i=r.nationalNumber;if(i!==t){if(!di(t,i,n))return{nationalNumber:t};if(n.numberingPlan.possibleLengths()&&(e||(e=Se(n.numberingPlan.callingCode(),{nationalNumber:i,metadata:n})),!si(i,e,n)))return{nationalNumber:t}}return{nationalNumber:i,carrierCode:o}}function di(t,e,n){return!(W(t,n.nationalNumberPattern())&&!W(e,n.nationalNumberPattern()))}function si(t,e,n){switch(ae(t,e,n)){case"TOO_SHORT":case"INVALID_LENGTH":return!1;default:return!0}}function Gt(t,e,n,r,o){var i=e||n?se(e||n,o):r;if(t.indexOf(i)===0){o=new I(o),o.selectNumberingPlan(e||n,i);var d=t.slice(i.length),l=he(d,e,o),p=l.nationalNumber,a=he(t,e,o),$=a.nationalNumber;if(!W($,o.nationalNumberPattern())&&W(p,o.nationalNumberPattern())||ae($,e,o)==="TOO_LONG")return{countryCallingCode:i,number:d}}return{number:t}}function ke(t,e,n,r,o){if(!t)return{};var i;if(t[0]!=="+"){var d=Ht(t,e||n,r,o);if(d&&d!==t)i=!0,t="+"+d;else{if(e||n||r){var l=Gt(t,e,n,r,o),p=l.countryCallingCode,a=l.number;if(p)return{countryCallingCodeSource:"FROM_NUMBER_WITHOUT_PLUS_SIGN",countryCallingCode:p,number:a}}return{number:t}}}if(t[1]==="0")return{};o=new I(o);for(var $=2;$-1<=or&&$<=t.length;){var c=t.slice(1,$);if(o.hasCallingCode(c))return o.selectNumberingPlan(c),{countryCallingCodeSource:i?"FROM_NUMBER_WITH_IDD":"FROM_NUMBER_WITH_PLUS_SIGN",countryCallingCode:c,number:t.slice($)};$++}return{}}function Wt(t){return t.replace(new RegExp("[".concat(fe,"]+"),"g")," ").trim()}var ai=/(\$\d)/;function Vt(t,e,n){var r=n.useInternationalFormat,o=n.withNationalPrefix,i=n.carrierCode,d=n.metadata,l=t.replace(new RegExp(e.pattern()),r?e.internationalFormat():o&&e.nationalPrefixFormattingRule()?e.format().replace(ai,e.nationalPrefixFormattingRule()):e.format());return r?Wt(l):l}var li=/^[\d]+(?:[~\u2053\u223C\uFF5E][\d]+)?$/;function zt(t,e,n){var r=new I(n);if(r.selectNumberingPlan(t,e),r.defaultIDDPrefix())return r.defaultIDDPrefix();if(li.test(r.IDDPrefix()))return r.IDDPrefix()}var ci=";ext=",ge=function(e){return"([".concat(V,"]{1,").concat(e,"})")};function Ne(t){var e="20",n="15",r="9",o="6",i="[ \xA0\\t,]*",d="[:\\.\uFF0E]?[ \xA0\\t,-]*",l="#?",p="(?:e?xt(?:ensi(?:o\u0301?|\xF3))?n?|\uFF45?\uFF58\uFF54\uFF4E?|\u0434\u043E\u0431|anexo)",a="(?:[x\uFF58#\uFF03~\uFF5E]|int|\uFF49\uFF4E\uFF54)",$="[- ]+",c="[ \xA0\\t]*",f="(?:,{2}|;)",h=ci+ge(e),w=i+p+d+ge(e)+l,T=i+a+d+ge(r)+l,E=$+ge(o)+"#",g=c+f+d+ge(n)+l,_=c+"(?:,)+"+d+ge(r)+l;return h+"|"+w+"|"+T+"|"+E+"|"+g+"|"+_}var pi="["+V+"]{"+Ce+"}",ui="["+Ee+"]{0,1}(?:["+fe+"]*["+V+"]){3,}["+fe+V+"]*",$i=new RegExp("^["+Ee+"]{0,1}(?:["+fe+"]*["+V+"]){1,2}$","i"),fi=ui+"(?:"+Ne()+")?",hi=new RegExp("^"+pi+"$|^"+fi+"$","i");function Kt(t){return t.length>=Ce&&hi.test(t)}function dr(t){return $i.test(t)}function sr(t){var e=t.number,n=t.ext;if(!e)return"";if(e[0]!=="+")throw new Error('"formatRFC3966()" expects "number" to be in E.164 format.');return"tel:".concat(e).concat(n?";ext="+n:"")}var ar={formatExtension:function(e,n,r){return"".concat(e).concat(r.ext()).concat(n)}};function Yt(t,e,n,r){if(n?n=yi({},ar,n):n=ar,r=new I(r),t.country&&t.country!=="001"){if(!r.hasCountry(t.country))throw new Error("Unknown country: ".concat(t.country));r.selectNumberingPlan(t.country)}else if(t.countryCallingCode)r.selectNumberingPlan(t.countryCallingCode);else return t.phone||"";var o=r.countryCallingCode(),i=n.v2?t.nationalNumber:t.phone,d;switch(e){case"NATIONAL":return i?(d=rt(i,t.carrierCode,"NATIONAL",r,n),Xt(d,t.ext,r,n.formatExtension)):"";case"INTERNATIONAL":return i?(d=rt(i,null,"INTERNATIONAL",r,n),d="+".concat(o," ").concat(d),Xt(d,t.ext,r,n.formatExtension)):"+".concat(o);case"E.164":return"+".concat(o).concat(i);case"RFC3966":return sr({number:"+".concat(o).concat(i),ext:t.ext});case"IDD":if(!n.fromCountry)return;var l=mi(i,t.carrierCode,o,n.fromCountry,r);return l?Xt(l,t.ext,r,n.formatExtension):void 0;default:throw new Error('Unknown "format" argument passed to "formatNumber()": "'.concat(e,'"'))}}function rt(t,e,n,r,o){var i=gi(r.formats(),t);return i?Vt(t,i,{useInternationalFormat:n==="INTERNATIONAL",withNationalPrefix:!(i.nationalPrefixIsOptionalWhenFormattingInNationalFormat()&&o&&o.nationalPrefix===!1),carrierCode:e,metadata:r}):t}function gi(t,e){return vi(t,function(n){if(n.leadingDigitsPatterns().length>0){var r=n.leadingDigitsPatterns()[n.leadingDigitsPatterns().length-1];if(e.search(r)!==0)return!1}return W(e,n.pattern())})}function Xt(t,e,n,r){return e?r(t,e,n):t}function mi(t,e,n,r,o){var i=se(r,o.metadata);if(i===n){var d=rt(t,e,"NATIONAL",o);return n==="1"?n+" "+d:d}var l=zt(r,void 0,o.metadata);if(l)return"".concat(l," ").concat(n," ").concat(rt(t,null,"INTERNATIONAL",o))}function yi(){for(var t=1,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];for(;t<n.length;){if(n[t])for(var o in n[t])n[0][o]=n[t][o];t++}return n[0]}function vi(t,e){for(var n=0;n<t.length;){if(e(t[n]))return t[n];n++}}function Ie(t){"@babel/helpers - typeof";return Ie=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ie(t)}function lr(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),n.push.apply(n,r)}return n}function cr(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?lr(Object(n),!0).forEach(function(r){bi(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):lr(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function bi(t,e,n){return(e=ur(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function _i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function pr(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,ur(r.key),r)}}function xi(t,e,n){return e&&pr(t.prototype,e),n&&pr(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function ur(t){var e=wi(t,"string");return Ie(e)=="symbol"?e:e+""}function wi(t,e){if(Ie(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(Ie(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var Pi=!1,$r=(function(){function t(e,n,r){if(_i(this,t),!e)throw new TypeError("First argument is required");if(typeof e!="string")throw new TypeError("First argument must be a string");if(e[0]==="+"&&!n)throw new TypeError("`metadata` argument not passed");if(ee(n)&&ee(n.countries)){r=n;var o=e;if(!Si.test(o))throw new Error('Invalid `number` argument passed: must consist of a "+" followed by digits');var i=ke(o,void 0,void 0,void 0,r),d=i.countryCallingCode,l=i.number;if(n=l,e=d,!n)throw new Error("Invalid `number` argument passed: too short")}if(!n)throw new TypeError("`nationalNumber` argument is required");if(typeof n!="string")throw new TypeError("`nationalNumber` argument must be a string");Ot(r);var p=Ei(e,r),a=p.country,$=p.countryCallingCode;this.country=a,this.countryCallingCode=$,this.nationalNumber=n,this.number="+"+this.countryCallingCode+this.nationalNumber,this.getMetadata=function(){return r}}return xi(t,[{key:"setExt",value:function(n){this.ext=n}},{key:"getPossibleCountries",value:function(){return this.country?[this.country]:Ut(this.countryCallingCode,this.nationalNumber,this.getMetadata())}},{key:"isPossible",value:function(){return Ft(this,{v2:!0},this.getMetadata())}},{key:"isValid",value:function(){return Lt(this,{v2:!0},this.getMetadata())}},{key:"isNonGeographic",value:function(){var n=new I(this.getMetadata());return n.isNonGeographicCallingCode(this.countryCallingCode)}},{key:"isEqual",value:function(n){return this.number===n.number&&this.ext===n.ext}},{key:"getType",value:function(){return le(this,{v2:!0},this.getMetadata())}},{key:"format",value:function(n,r){return Yt(this,n,r?cr(cr({},r),{},{v2:!0}):{v2:!0},this.getMetadata())}},{key:"formatNational",value:function(n){return this.format("NATIONAL",n)}},{key:"formatInternational",value:function(n){return this.format("INTERNATIONAL",n)}},{key:"getURI",value:function(n){return this.format("RFC3966",n)}}])})();var Ci=function(e){return/^[A-Z]{2}$/.test(e)};function Ei(t,e){var n,r,o=new I(e);return Ci(t)?(n=t,o.selectNumberingPlan(n),r=o.countryCallingCode()):(r=t,Pi&&o.isNonGeographicCallingCode(r)&&(n="001")),{country:n,countryCallingCode:r}}var Si=/^\+\d+$/;function me(t){"@babel/helpers - typeof";return me=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},me(t)}function fr(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Ni(r.key),r)}}function ki(t,e,n){return e&&fr(t.prototype,e),n&&fr(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function Ni(t){var e=Ii(t,"string");return me(e)=="symbol"?e:e+""}function Ii(t,e){if(me(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(me(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Ti(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Ai(t,e,n){return e=Ae(e),Oi(t,Jt()?Reflect.construct(e,n||[],Ae(t).constructor):e.apply(t,n))}function Oi(t,e){if(e&&(me(e)=="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Mi(t)}function Mi(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Fi(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Te(t,e)}function qt(t){var e=typeof Map=="function"?new Map:void 0;return qt=function(r){if(r===null||!Di(r))return r;if(typeof r!="function")throw new TypeError("Super expression must either be null or a function");if(e!==void 0){if(e.has(r))return e.get(r);e.set(r,o)}function o(){return Ri(r,arguments,Ae(this).constructor)}return o.prototype=Object.create(r.prototype,{constructor:{value:o,enumerable:!1,writable:!0,configurable:!0}}),Te(o,r)},qt(t)}function Ri(t,e,n){if(Jt())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,e);var o=new(t.bind.apply(t,r));return n&&Te(o,n.prototype),o}function Jt(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Jt=function(){return!!t})()}function Di(t){try{return Function.toString.call(t).indexOf("[native code]")!==-1}catch{return typeof t=="function"}}function Te(t,e){return Te=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},Te(t,e)}function Ae(t){return Ae=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Ae(t)}var q=(function(t){function e(n){var r;return Ti(this,e),r=Ai(this,e,[n]),Object.setPrototypeOf(r,e.prototype),r.name=r.constructor.name,r}return Fi(e,t),ki(e)})(qt(Error));var hr=new RegExp("(?:"+Ne()+")$","i");function Zt(t){var e=t.search(hr);if(e<0)return{};for(var n=t.slice(0,e),r=t.match(hr),o=1;o<r.length;){if(r[o])return{number:n,ext:r[o]};o++}}var Li={0:"0",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9","\uFF10":"0","\uFF11":"1","\uFF12":"2","\uFF13":"3","\uFF14":"4","\uFF15":"5","\uFF16":"6","\uFF17":"7","\uFF18":"8","\uFF19":"9","\u0660":"0","\u0661":"1","\u0662":"2","\u0663":"3","\u0664":"4","\u0665":"5","\u0666":"6","\u0667":"7","\u0668":"8","\u0669":"9","\u06F0":"0","\u06F1":"1","\u06F2":"2","\u06F3":"3","\u06F4":"4","\u06F5":"5","\u06F6":"6","\u06F7":"7","\u06F8":"8","\u06F9":"9"};function gr(t){return Li[t]}function Ui(t,e){var n=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n)return(n=n.call(t)).next.bind(n);if(Array.isArray(t)||(n=Hi(t))||e&&t&&typeof t.length=="number"){n&&(t=n);var r=0;return function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
1432
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Hi(t,e){if(t){if(typeof t=="string")return mr(t,e);var n={}.toString.call(t).slice(8,-1);return n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set"?Array.from(t):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?mr(t,e):void 0}}function mr(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function ot(t){for(var e="",n=Ui(t.split("")),r;!(r=n()).done;){var o=r.value;e+=ji(o,e)||""}return e}function ji(t,e,n){if(t==="+"){if(e){typeof n=="function"&&n("end");return}return"+"}return gr(t)}var en="+",Bi="[\\-\\.\\(\\)]?",yr="(["+V+"]|"+Bi+")",Gi="^\\"+en+yr+"*["+V+"]"+yr+"*$",Wi=new RegExp(Gi,"g"),Qt=V,Vi="["+Qt+"]+((\\-)*["+Qt+"])*",zi="a-zA-Z",Ki="["+zi+"]+((\\-)*["+Qt+"])*",Xi="^("+Vi+"\\.)*"+Ki+"\\.?$",Yi=new RegExp(Xi,"g"),tn="tel:",it=";phone-context=",vr=";isub=";function nn(t){var e=t.indexOf(it);if(e<0)return null;var n=e+it.length;if(n>=t.length)return"";var r=t.indexOf(";",n);return r>=0?t.substring(n,r):t.substring(n)}function br(t){return t===null?!0:t.length===0?!1:Wi.test(t)||Yi.test(t)}function rn(t,e){var n=e.extractFormattedPhoneNumber,r=nn(t);if(!br(r))throw new q("NOT_A_NUMBER");var o;if(r===null)o=n(t)||"";else{o="",r.charAt(0)===en&&(o+=r);var i=t.indexOf(tn),d;i>=0?d=i+tn.length:d=0;var l=t.indexOf(it);o+=t.substring(d,l)}var p=o.indexOf(vr);if(p>0&&(o=o.substring(0,p)),o!=="")return o}var qi=250,Ji=new RegExp("["+Ee+V+"]"),Zi=new RegExp("[^"+V+"#]+$"),Qi=!1;function on(t,e,n){if(e=e||{},n=new I(n),e.defaultCountry&&!n.hasCountry(e.defaultCountry))throw e.v2?new q("INVALID_COUNTRY"):new Error("Unknown country: ".concat(e.defaultCountry));var r=td(t,e.v2,e.extract),o=r.number,i=r.ext,d=r.error;if(!o){if(e.v2)throw d==="TOO_SHORT"?new q("TOO_SHORT"):new q("NOT_A_NUMBER");return{}}var l=rd(o,e.defaultCountry,e.defaultCallingCode,n),p=l.country,a=l.nationalNumber,$=l.countryCallingCode,c=l.countryCallingCodeSource,f=l.carrierCode;if(!n.hasSelectedNumberingPlan()){if(e.v2)throw new q("INVALID_COUNTRY");return{}}if(!a||a.length<Ce){if(e.v2)throw new q("TOO_SHORT");return{}}if(a.length>rr){if(e.v2)throw new q("TOO_LONG");return{}}if(e.v2){var h=new $r($,a,n.metadata);return p&&(h.country=p),f&&(h.carrierCode=f),i&&(h.ext=i),h.__countryCallingCodeSource=c,h}var w=(e.extended?n.hasSelectedNumberingPlan():p)?W(a,n.nationalNumberPattern()):!1;return e.extended?{country:p,countryCallingCode:$,carrierCode:f,valid:w,possible:w?!0:!!(e.extended===!0&&n.possibleLengths()&&Rt(a,p,n)),phone:a,ext:i}:w?nd(p,a,i):{}}function ed(t,e,n){if(t){if(t.length>qi){if(n)throw new q("TOO_LONG");return}if(e===!1)return t;var r=t.search(Ji);if(!(r<0))return t.slice(r).replace(Zi,"")}}function td(t,e,n){var r=rn(t,{extractFormattedPhoneNumber:function(d){return ed(d,n,e)}});if(!r)return{};if(!Kt(r))return dr(r)?{error:"TOO_SHORT"}:{};var o=Zt(r);return o.ext?o:{number:r}}function nd(t,e,n){var r={country:t,phone:e};return n&&(r.ext=n),r}function rd(t,e,n,r){var o=ke(ot(t),void 0,e,n,r.metadata),i=o.countryCallingCodeSource,d=o.countryCallingCode,l=o.number,p;if(d)r.selectNumberingPlan(d);else if(l&&(e||n))r.selectNumberingPlan(e,n),e?p=e:Qi&&r.isNonGeographicCallingCode(n)&&(p="001"),d=n||se(e,r.metadata);else return{};if(!l)return{countryCallingCodeSource:i,countryCallingCode:d};var a=he(ot(l),p,r),$=a.nationalNumber,c=a.carrierCode,f=Se(d,{nationalNumber:$,metadata:r});return f&&(p=f,f==="001"||r.selectNumberingPlan(p)),{country:p,countryCallingCode:d,countryCallingCodeSource:i,nationalNumber:$,carrierCode:c}}function Oe(t){"@babel/helpers - typeof";return Oe=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Oe(t)}function _r(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),n.push.apply(n,r)}return n}function xr(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?_r(Object(n),!0).forEach(function(r){od(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):_r(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function od(t,e,n){return(e=id(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function id(t){var e=dd(t,"string");return Oe(e)=="symbol"?e:e+""}function dd(t,e){if(Oe(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(Oe(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Me(t,e,n){return on(t,xr(xr({},e),{},{v2:!0}),n)}function Fe(t){"@babel/helpers - typeof";return Fe=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Fe(t)}function wr(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),n.push.apply(n,r)}return n}function sd(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?wr(Object(n),!0).forEach(function(r){ad(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):wr(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function ad(t,e,n){return(e=ld(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function ld(t){var e=cd(t,"string");return Fe(e)=="symbol"?e:e+""}function cd(t,e){if(Fe(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(Fe(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function pd(t,e){return hd(t)||fd(t,e)||$d(t,e)||ud()}function ud(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
1433
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function $d(t,e){if(t){if(typeof t=="string")return Pr(t,e);var n={}.toString.call(t).slice(8,-1);return n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set"?Array.from(t):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Pr(t,e):void 0}}function Pr(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function fd(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var r,o,i,d,l=[],p=!0,a=!1;try{if(i=(n=n.call(t)).next,e===0){if(Object(n)!==n)return;p=!1}else for(;!(p=(r=i.call(n)).done)&&(l.push(r.value),l.length!==e);p=!0);}catch($){a=!0,o=$}finally{try{if(!p&&n.return!=null&&(d=n.return(),Object(d)!==d))return}finally{if(a)throw o}}return l}}function hd(t){if(Array.isArray(t))return t}function Re(t){var e=Array.prototype.slice.call(t),n=pd(e,4),r=n[0],o=n[1],i=n[2],d=n[3],l,p,a;if(typeof r=="string")l=r;else throw new TypeError("A text for parsing must be a string.");if(!o||typeof o=="string")d?(p=i,a=d):(p=void 0,a=i),o&&(p=sd({defaultCountry:o},p));else if(ee(o))i?(p=o,a=i):a=o;else throw new Error("Invalid second argument: ".concat(o));return{text:l,options:p,metadata:a}}function De(){var t=Re(arguments),e=t.text,n=t.options,r=t.metadata;return Me(e,n,r)}function Le(t){"@babel/helpers - typeof";return Le=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Le(t)}function Cr(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),n.push.apply(n,r)}return n}function Er(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?Cr(Object(n),!0).forEach(function(r){gd(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Cr(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function gd(t,e,n){return(e=md(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function md(t){var e=yd(t,"string");return Le(e)=="symbol"?e:e+""}function yd(t,e){if(Le(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(Le(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function dn(t,e,n){e&&e.defaultCountry&&!Zn(e.defaultCountry,n)&&(e=Er(Er({},e),{},{defaultCountry:void 0}));try{return Me(t,e,n)}catch(r){if(!(r instanceof q))throw r}}function Ue(t){"@babel/helpers - typeof";return Ue=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ue(t)}function Sr(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),n.push.apply(n,r)}return n}function kr(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?Sr(Object(n),!0).forEach(function(r){vd(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Sr(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function vd(t,e,n){return(e=bd(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function bd(t){var e=_d(t,"string");return Ue(e)=="symbol"?e:e+""}function _d(t,e){if(Ue(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(Ue(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function dt(){var t=Re(arguments),e=t.text,n=t.options,r=t.metadata;n=kr(kr({},n),{},{extract:!1});var o=dn(e,n,r);return o&&o.isValid()||!1}function st(){return Pe(De,arguments)}function at(){return Pe(dt,arguments)}var sn=[{code:"FR",name:"France",dialCode:"+33",flag:"\u{1F1EB}\u{1F1F7}"},{code:"DE",name:"Germany",dialCode:"+49",flag:"\u{1F1E9}\u{1F1EA}"},{code:"GB",name:"United Kingdom",dialCode:"+44",flag:"\u{1F1EC}\u{1F1E7}"},{code:"ES",name:"Spain",dialCode:"+34",flag:"\u{1F1EA}\u{1F1F8}"},{code:"IT",name:"Italy",dialCode:"+39",flag:"\u{1F1EE}\u{1F1F9}"},{code:"PT",name:"Portugal",dialCode:"+351",flag:"\u{1F1F5}\u{1F1F9}"},{code:"NL",name:"Netherlands",dialCode:"+31",flag:"\u{1F1F3}\u{1F1F1}"},{code:"BE",name:"Belgium",dialCode:"+32",flag:"\u{1F1E7}\u{1F1EA}"},{code:"CH",name:"Switzerland",dialCode:"+41",flag:"\u{1F1E8}\u{1F1ED}"},{code:"AT",name:"Austria",dialCode:"+43",flag:"\u{1F1E6}\u{1F1F9}"},{code:"SE",name:"Sweden",dialCode:"+46",flag:"\u{1F1F8}\u{1F1EA}"},{code:"NO",name:"Norway",dialCode:"+47",flag:"\u{1F1F3}\u{1F1F4}"},{code:"DK",name:"Denmark",dialCode:"+45",flag:"\u{1F1E9}\u{1F1F0}"},{code:"FI",name:"Finland",dialCode:"+358",flag:"\u{1F1EB}\u{1F1EE}"},{code:"PL",name:"Poland",dialCode:"+48",flag:"\u{1F1F5}\u{1F1F1}"},{code:"CZ",name:"Czech Republic",dialCode:"+420",flag:"\u{1F1E8}\u{1F1FF}"},{code:"GR",name:"Greece",dialCode:"+30",flag:"\u{1F1EC}\u{1F1F7}"},{code:"IE",name:"Ireland",dialCode:"+353",flag:"\u{1F1EE}\u{1F1EA}"},{code:"RO",name:"Romania",dialCode:"+40",flag:"\u{1F1F7}\u{1F1F4}"},{code:"HU",name:"Hungary",dialCode:"+36",flag:"\u{1F1ED}\u{1F1FA}"},{code:"US",name:"United States",dialCode:"+1",flag:"\u{1F1FA}\u{1F1F8}"},{code:"CA",name:"Canada",dialCode:"+1",flag:"\u{1F1E8}\u{1F1E6}"},{code:"MX",name:"Mexico",dialCode:"+52",flag:"\u{1F1F2}\u{1F1FD}"},{code:"BR",name:"Brazil",dialCode:"+55",flag:"\u{1F1E7}\u{1F1F7}"},{code:"AR",name:"Argentina",dialCode:"+54",flag:"\u{1F1E6}\u{1F1F7}"},{code:"CL",name:"Chile",dialCode:"+56",flag:"\u{1F1E8}\u{1F1F1}"},{code:"CO",name:"Colombia",dialCode:"+57",flag:"\u{1F1E8}\u{1F1F4}"},{code:"PE",name:"Peru",dialCode:"+51",flag:"\u{1F1F5}\u{1F1EA}"},{code:"CN",name:"China",dialCode:"+86",flag:"\u{1F1E8}\u{1F1F3}"},{code:"JP",name:"Japan",dialCode:"+81",flag:"\u{1F1EF}\u{1F1F5}"},{code:"KR",name:"South Korea",dialCode:"+82",flag:"\u{1F1F0}\u{1F1F7}"},{code:"IN",name:"India",dialCode:"+91",flag:"\u{1F1EE}\u{1F1F3}"},{code:"ID",name:"Indonesia",dialCode:"+62",flag:"\u{1F1EE}\u{1F1E9}"},{code:"TH",name:"Thailand",dialCode:"+66",flag:"\u{1F1F9}\u{1F1ED}"},{code:"VN",name:"Vietnam",dialCode:"+84",flag:"\u{1F1FB}\u{1F1F3}"},{code:"MY",name:"Malaysia",dialCode:"+60",flag:"\u{1F1F2}\u{1F1FE}"},{code:"SG",name:"Singapore",dialCode:"+65",flag:"\u{1F1F8}\u{1F1EC}"},{code:"PH",name:"Philippines",dialCode:"+63",flag:"\u{1F1F5}\u{1F1ED}"},{code:"PK",name:"Pakistan",dialCode:"+92",flag:"\u{1F1F5}\u{1F1F0}"},{code:"BD",name:"Bangladesh",dialCode:"+880",flag:"\u{1F1E7}\u{1F1E9}"},{code:"AE",name:"United Arab Emirates",dialCode:"+971",flag:"\u{1F1E6}\u{1F1EA}"},{code:"SA",name:"Saudi Arabia",dialCode:"+966",flag:"\u{1F1F8}\u{1F1E6}"},{code:"IL",name:"Israel",dialCode:"+972",flag:"\u{1F1EE}\u{1F1F1}"},{code:"TR",name:"Turkey",dialCode:"+90",flag:"\u{1F1F9}\u{1F1F7}"},{code:"EG",name:"Egypt",dialCode:"+20",flag:"\u{1F1EA}\u{1F1EC}"},{code:"ZA",name:"South Africa",dialCode:"+27",flag:"\u{1F1FF}\u{1F1E6}"},{code:"NG",name:"Nigeria",dialCode:"+234",flag:"\u{1F1F3}\u{1F1EC}"},{code:"KE",name:"Kenya",dialCode:"+254",flag:"\u{1F1F0}\u{1F1EA}"},{code:"MA",name:"Morocco",dialCode:"+212",flag:"\u{1F1F2}\u{1F1E6}"},{code:"TN",name:"Tunisia",dialCode:"+216",flag:"\u{1F1F9}\u{1F1F3}"},{code:"DZ",name:"Algeria",dialCode:"+213",flag:"\u{1F1E9}\u{1F1FF}"},{code:"AU",name:"Australia",dialCode:"+61",flag:"\u{1F1E6}\u{1F1FA}"},{code:"NZ",name:"New Zealand",dialCode:"+64",flag:"\u{1F1F3}\u{1F1FF}"},{code:"RU",name:"Russia",dialCode:"+7",flag:"\u{1F1F7}\u{1F1FA}"},{code:"UA",name:"Ukraine",dialCode:"+380",flag:"\u{1F1FA}\u{1F1E6}"}].sort((t,e)=>t.name.localeCompare(e.name));function xd(t){return sn.find(e=>e.code===t.toUpperCase())}var Nr=xd("FR");var wd=0;function s(t,e,n,r,o,i){e||(e={});var d,l,p=e;if("ref"in p)for(l in p={},e)l=="ref"?d=e[l]:p[l]=e[l];var a={type:t,props:p,key:n,ref:d,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--wd,__i:-1,__u:0,__source:o,__self:i};if(typeof t=="function"&&(d=t.defaultProps))for(l in d)p[l]===void 0&&(p[l]=d[l]);return N.vnode&&N.vnode(a),a}var Pd=()=>s("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[s("rect",{x:"2",y:"4",width:"20",height:"16",rx:"2"}),s("path",{d:"M22 7l-10 7L2 7"})]}),Cd=()=>s("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:s("path",{d:"M22 16.92v3a2 2 0 01-2.18 2 19.79 19.79 0 01-8.63-3.07 19.5 19.5 0 01-6-6 19.79 19.79 0 01-3.07-8.67A2 2 0 014.11 2h3a2 2 0 012 1.72 12.84 12.84 0 00.7 2.81 2 2 0 01-.45 2.11L8.09 9.91a16 16 0 006 6l1.27-1.27a2 2 0 012.11-.45 12.84 12.84 0 002.81.7A2 2 0 0122 16.92z"})}),Ed=()=>s("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:s("path",{d:"M6 9l6 6 6-6"})});function Ir(t){return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(t)}function Tr({client:t,config:e,onComplete:n,onSkip:r}){let o=e.fields==="email-only",i=e.fields==="phone-only",d=e.fields==="email-and-phone",l=e.fields==="email-or-phone",p=()=>i?"phone":"email",[a,$]=C(p()),[c,f]=C(""),[h,w]=C(""),[T,E]=C(Nr),[g,_]=C(!1),[H,R]=C(""),[X,j]=C(""),[J,B]=C(""),[z,G]=C(!1),D=Q(null),K=Q(null);Y(()=>{let m=A=>{D.current&&!D.current.contains(A.target)&&_(!1)};return document.addEventListener("mousedown",m),()=>document.removeEventListener("mousedown",m)},[]),Y(()=>{g&&K.current&&K.current.focus()},[g]);let ye=sn.filter(m=>m.name.toLowerCase().includes(H.toLowerCase())||m.dialCode.includes(H)||m.code.toLowerCase().includes(H.toLowerCase())),pt=m=>{E(m),_(!1),R("")},je=m=>m.replace(/\D/g,""),un=m=>{let A=m.target,ie=je(A.value);w(ie),B("")},Be=()=>h?`${T.dialCode}${h}`:"",ce=()=>{let m=!0;if((o||d)&&(c.trim()?Ir(c)||(j("Please enter a valid email"),m=!1):(j("Email is required"),m=!1)),i||d){let A=Be();h.trim()?at(A,T.code)||(B("Please enter a valid phone number"),m=!1):(B("Phone number is required"),m=!1)}if(l)if(a==="email")c.trim()?Ir(c)||(j("Please enter a valid email"),m=!1):(j("Email is required"),m=!1);else{let A=Be();h.trim()?at(A,T.code)||(B("Please enter a valid phone number"),m=!1):(B("Phone number is required"),m=!1)}return m},pe=async m=>{if(m.preventDefault(),!!ce()){G(!0);try{let A={};if((o||d||l&&a==="email")&&(A.email=c.trim()),i||d||l&&a==="phone"){let ie=Be(),Z=st(ie,T.code);Z&&(A.phone=Z.format("E.164"),A.phoneCountry=T.code)}await t.submitPreChat(A),n()}catch(A){console.error("[PreChatForm] Submit error:",A),a==="email"||o||d?j("Something went wrong. Please try again."):B("Something went wrong. Please try again.")}finally{G(!1)}}},oe=()=>s("div",{class:"pp-prechat-field",children:[s("label",{class:"pp-prechat-label",children:"Email address"}),s("input",{type:"email",class:`pp-prechat-input ${X?"error":""}`,placeholder:"you@example.com",value:c,onInput:m=>{f(m.target.value),j("")}}),X&&s("div",{class:"pp-prechat-error",children:X})]}),te=()=>s("div",{class:"pp-prechat-field",children:[s("label",{class:"pp-prechat-label",children:"Phone number"}),s("div",{class:"pp-phone-input-wrapper",children:[s("div",{class:"pp-country-select",ref:D,children:[s("button",{type:"button",class:"pp-country-btn",onClick:()=>_(!g),children:[s("span",{class:"pp-country-flag",children:T.flag}),s("span",{class:"pp-country-code",children:T.dialCode}),s(Ed,{})]}),g&&s("div",{class:"pp-country-dropdown",children:[s("div",{class:"pp-country-search",children:s("input",{ref:K,type:"text",class:"pp-country-search-input",placeholder:"Search country...",value:H,onInput:m=>R(m.target.value)})}),s("div",{class:"pp-country-list",children:ye.map(m=>s("div",{class:`pp-country-option ${m.code===T.code?"selected":""}`,onClick:()=>pt(m),children:[s("span",{class:"pp-country-flag",children:m.flag}),s("span",{class:"pp-country-name",children:m.name}),s("span",{class:"pp-country-dial",children:m.dialCode})]},m.code))})]})]}),s("input",{type:"tel",class:`pp-prechat-input pp-phone-number-input ${J?"error":""}`,placeholder:"612 345 678",value:h,onInput:un})]}),J&&s("div",{class:"pp-prechat-error",children:J})]});return s("div",{class:"pp-prechat",children:[s("h2",{class:"pp-prechat-title",children:"How can we reach you?"}),s("p",{class:"pp-prechat-subtitle",children:d?"Please provide your contact information so we can follow up if needed.":l?"Choose how you would like us to contact you.":o?"Enter your email so we can follow up with you.":"Enter your phone number so we can call you back."}),s("form",{onSubmit:pe,children:[l&&s("div",{class:"pp-prechat-tabs",children:[s("button",{type:"button",class:`pp-prechat-tab ${a==="email"?"active":""}`,onClick:()=>{$("email"),B("")},children:[s(Pd,{}),"Email"]}),s("button",{type:"button",class:`pp-prechat-tab ${a==="phone"?"active":""}`,onClick:()=>{$("phone"),j("")},children:[s(Cd,{}),"Phone"]})]}),o&&oe(),i&&te(),d&&s(M,{children:[oe(),te()]}),l&&s(M,{children:[a==="email"&&oe(),a==="phone"&&te()]}),s("button",{type:"submit",class:"pp-prechat-submit",disabled:z,children:z?"Submitting...":"Start chatting"}),!e.required&&s("button",{type:"button",class:"pp-prechat-skip",onClick:r,children:"Skip for now"})]})]})}function Sd(t){let e=new Date,n=new Date(t),r=new Date(e.getFullYear(),e.getMonth(),e.getDate()),o=new Date(n.getFullYear(),n.getMonth(),n.getDate()),i=Math.floor((r.getTime()-o.getTime())/(1e3*60*60*24));return i===0?"Today":i===1?"Yesterday":n.toLocaleDateString("en-US",{month:"short",day:"numeric",year:n.getFullYear()!==e.getFullYear()?"numeric":void 0})}function Ar(t){let e=new Date(t);return`${e.getFullYear()}-${e.getMonth()}-${e.getDate()}`}function Mr({client:t,config:e}){let[n,r]=C(!1),[o,i]=C([]),[d,l]=C(""),[p,a]=C(!1),[$,c]=C(!1),[f,h]=C(!1),[w,T]=C(0),[E,g]=C([]),[_,H]=C(!1),[R,X]=C(null),[j,J]=C(null),[B,z]=C(""),[G,D]=C(null),[K,ye]=C(!1),[pt,je]=C(null),[un,Be]=C(null),[ce,pe]=C(null),[oe,te]=C(0),m=Q(null),[A,ie]=C(e),[Z,Ge]=C(void 0),[Zr,Qr]=C(!1),ut=Q(null),$t=Q(null),$n=Q(null),eo=Q(null);Y(()=>{let u=t.on("openChange",r),v=t.on("message",()=>{i([...t.getMessages()])}),x=t.on("typing",y=>{a(y.isTyping)}),S=t.on("presence",y=>{c(y.online)}),k=t.on("connect",()=>{h(!0),i(t.getMessages()),c(t.getSession()?.operatorOnline??!1),ie(t.getConfig()),Ge(t.getSession()?.preChatForm)}),O=t.on("preChatCompleted",()=>{Ge(y=>y&&{...y,completed:!0})}),b=t.on("configUpdate",()=>{ie(t.getConfig())});return t.isConnected()&&(h(!0),i(t.getMessages()),c(t.getSession()?.operatorOnline??!1),ie(t.getConfig()),Ge(t.getSession()?.preChatForm)),()=>{u(),v(),x(),S(),k(),O(),b()}},[t]),Y(()=>{n&&ut.current?.scrollIntoView({behavior:"smooth"})},[o,n]),Y(()=>{n&&(setTimeout(()=>{ut.current?.scrollIntoView({behavior:"auto"})},50),$t.current?.focus(),T(0))},[n]),Y(()=>{if(!n&&o.length>0){let u=o.filter(v=>v.sender!=="visitor"&&v.status!=="read").length;T(u)}},[o,n]);let We=Gn(()=>{if(!n||!f)return;let u=o.filter(v=>v.sender!=="visitor"&&v.status!=="read");if(u.length>0){let v=u.map(x=>x.id);t.sendReadStatus(v,"read")}},[n,f,o,t]);if(Y(()=>{if(!n||!f)return;let u=setTimeout(()=>{We()},1e3);return()=>clearTimeout(u)},[n,f,o,We]),Y(()=>{let u=()=>{document.visibilityState==="visible"&&n&&We()};return document.addEventListener("visibilitychange",u),()=>document.removeEventListener("visibilitychange",u)},[n,We]),Y(()=>{let u=t.on("read",()=>{i([...t.getMessages()])});return()=>u()},[t]),!kd(A))return null;let to=async u=>{u.preventDefault();let v=d.trim().length>0,x=E.filter(b=>b.status==="ready"&&b.attachment);if(!v&&x.length===0)return;let S=d,k=x.map(b=>b.attachment.id),O=R?.id;l(""),g([]),X(null);try{await t.sendMessage(S,k,O)}catch(b){console.error("[PocketPing] Failed to send message:",b)}},no=u=>{let v=u.target;l(v.value),t.sendTyping(!0)},ro=async u=>{let v=u.target,x=v.files;if(!x||x.length===0)return;let S=[];for(let k=0;k<x.length;k++){let O=x[k],b=`pending-${Date.now()}-${k}`,y;O.type.startsWith("image/")&&(y=URL.createObjectURL(O)),S.push({id:b,file:O,preview:y,progress:0,status:"pending"})}g(k=>[...k,...S]),v.value="",H(!0);for(let k of S)try{g(b=>b.map(y=>y.id===k.id?{...y,status:"uploading"}:y));let O=await t.uploadFile(k.file,b=>{g(y=>y.map(ze=>ze.id===k.id?{...ze,progress:b}:ze))});g(b=>b.map(y=>y.id===k.id?{...y,status:"ready",progress:100,attachment:O}:y))}catch(O){console.error("[PocketPing] Failed to upload file:",O),g(b=>b.map(y=>y.id===k.id?{...y,status:"error",error:"Upload failed"}:y))}H(!1)},oo=u=>{g(v=>{let x=v.find(S=>S.id===u);return x?.preview&&URL.revokeObjectURL(x.preview),v.filter(S=>S.id!==u)})},ft=u=>{X(u),D(null),$t.current?.focus()},io=()=>{X(null)},ht=u=>{u.sender==="visitor"&&(J(u),z(u.content),D(null))},fn=()=>{J(null),z("")},so=async()=>{if(!(!j||!B.trim()))try{await t.editMessage(j.id,B.trim()),J(null),z("")}catch(u){console.error("[PocketPing] Failed to edit message:",u)}},gt=async u=>{if(u.sender==="visitor"&&(D(null),confirm("Delete this message?")))try{await t.deleteMessage(u.id)}catch(v){console.error("[PocketPing] Failed to delete message:",v)}},ao=(u,v)=>{u.preventDefault();let x=u;D({message:v,x:x.clientX,y:x.clientY})},lo=(u,v)=>{let x=u.touches[0];m.current={x:x.clientX,y:x.clientY,time:Date.now()},ce&&ce!==v.id&&(pe(null),te(0))},co=(u,v)=>{if(!m.current)return;let x=u.touches[0],S=x.clientX-m.current.x,k=x.clientY-m.current.y;if(!(Math.abs(k)>Math.abs(S))&&S<0){let O=Math.max(S,-100);te(O),pe(v.id)}},hn=u=>{if(!m.current)return;let v=Date.now()-m.current.time;oe<-50||oe<-20&&v<200?(te(-80),navigator.vibrate&&navigator.vibrate(30)):(te(0),pe(null)),m.current=null},Ve=()=>{pe(null),te(0)};Y(()=>{if(!G)return;let u=()=>D(null);return document.addEventListener("click",u),()=>document.removeEventListener("click",u)},[G]);let gn=u=>{let v=document.getElementById(`pp-msg-${u}`);v&&(v.scrollIntoView({behavior:"smooth",block:"center"}),v.classList.add("pp-message-highlight"),setTimeout(()=>{v.classList.remove("pp-message-highlight")},1500))},ve=Q(0),po=u=>{u.preventDefault(),u.stopPropagation(),ve.current++,ve.current===1&&ye(!0)},uo=u=>{u.preventDefault(),u.stopPropagation()},$o=u=>{u.preventDefault(),u.stopPropagation(),ve.current--,ve.current===0&&ye(!1)},fo=async u=>{u.preventDefault(),u.stopPropagation(),ve.current=0,ye(!1);let v=u.dataTransfer?.files;if(!v||v.length===0)return;let x=[];for(let S=0;S<v.length;S++){let k=v[S],O=`pending-${Date.now()}-${S}`,b;k.type.startsWith("image/")&&(b=URL.createObjectURL(k)),x.push({id:O,file:k,preview:b,progress:0,status:"pending"})}g(S=>[...S,...x]),H(!0);for(let S of x)try{g(O=>O.map(b=>b.id===S.id?{...b,status:"uploading"}:b));let k=await t.uploadFile(S.file,O=>{g(b=>b.map(y=>y.id===S.id?{...y,progress:O}:y))});g(O=>O.map(b=>b.id===S.id?{...b,status:"ready",progress:100,attachment:k}:b))}catch(k){console.error("[PocketPing] Failed to upload dropped file:",k),g(O=>O.map(b=>b.id===S.id?{...b,status:"error",error:"Upload failed"}:b))}H(!1)},mn=A.position??"bottom-right",mt=Nd(A.theme??"auto"),ho=A.primaryColor??"#6366f1",be=mt==="dark"?"#9ca3af":"#6b7280",yt=Z&&Z.enabled&&!Z.completed&&!Zr&&(Z.timing==="before-first-message"&&o.length===0||Z.timing==="after-first-message"&&o.some(u=>u.sender==="visitor"));return s(M,{children:[s("style",{children:zn(ho,mt)}),s("button",{class:`pp-toggle pp-${mn}`,onClick:()=>t.toggleOpen(),"aria-label":n?"Close chat":"Open chat",children:[n?s(He,{}):s(Td,{}),!n&&w>0&&s("span",{class:"pp-unread-badge",children:w>9?"9+":w}),!n&&w===0&&$&&s("span",{class:"pp-online-dot"})]}),n&&s("div",{class:`pp-window pp-${mn} pp-theme-${mt} ${K?"pp-dragging":""}`,onDragEnter:po,onDragOver:uo,onDragLeave:$o,onDrop:fo,children:[K&&s("div",{class:"pp-drop-overlay",children:[s("div",{class:"pp-drop-icon",children:s(Or,{})}),s("div",{class:"pp-drop-text",children:"Drop files to upload"})]}),s("div",{class:"pp-header",children:[s("div",{class:"pp-header-info",children:[A.operatorAvatar&&s("img",{src:A.operatorAvatar,alt:"",class:"pp-avatar"}),s("div",{children:[s("div",{class:"pp-header-title",children:A.operatorName??"Support"}),s("div",{class:"pp-header-status",children:$?s(M,{children:[s("span",{class:"pp-status-dot pp-online"})," Online"]}):s(M,{children:[s("span",{class:"pp-status-dot"})," Away"]})})]})]}),s("button",{class:"pp-close-btn",onClick:()=>t.setOpen(!1),"aria-label":"Close chat",children:s(He,{})})]}),yt&&Z&&s(Tr,{client:t,config:Z,onComplete:()=>{Ge(u=>u&&{...u,completed:!0})},onSkip:()=>{Qr(!0)}}),!yt&&s("div",{class:"pp-messages",ref:eo,onClick:()=>ce&&Ve(),children:[A.welcomeMessage&&o.length===0&&s("div",{class:"pp-welcome",children:A.welcomeMessage}),o.map((u,v)=>{let x=!!u.deletedAt,S=!!u.editedAt,k=new Date(u.timestamp),O=v>0?o[v-1]:null,b=!O||Ar(new Date(O.timestamp))!==Ar(k),y=null;if(u.replyTo)if(typeof u.replyTo=="object")y=u.replyTo;else{let U=o.find(Ke=>Ke.id===u.replyTo);if(U){let Ke=!!(U.attachments&&U.attachments.length>0);y={id:U.id,sender:U.sender,content:U.content,deleted:!!U.deletedAt,hasAttachment:Ke,attachmentType:Ke?U.attachments[0].mimeType:void 0}}}let go=pt===u.id&&!x,mo=ce===u.id?oe:0;return s(M,{children:[b&&s("div",{class:"pp-date-separator",children:s("span",{children:Sd(k)})}),s("div",{class:`pp-message-swipe-container ${u.sender==="visitor"?"pp-swipe-left":"pp-swipe-right"}`,children:[s("div",{class:"pp-swipe-actions",children:[s("button",{class:"pp-swipe-action pp-swipe-reply",onClick:()=>{ft(u),Ve()},children:s(an,{color:"#fff"})}),u.sender==="visitor"&&!x&&s(M,{children:[s("button",{class:"pp-swipe-action pp-swipe-edit",onClick:()=>{ht(u),Ve()},children:s(ln,{color:"#fff"})}),s("button",{class:"pp-swipe-action pp-swipe-delete",onClick:()=>{gt(u),Ve()},children:s(cn,{color:"#fff"})})]})]}),s("div",{id:`pp-msg-${u.id}`,class:`pp-message pp-message-${u.sender} ${x?"pp-message-deleted":""}`,style:{transform:`translateX(${mo}px)`,transition:m.current?"none":"transform 0.2s ease-out"},onContextMenu:U=>ao(U,u),onMouseEnter:()=>je(u.id),onMouseLeave:()=>je(null),onTouchStart:U=>lo(U,u),onTouchMove:U=>co(U,u),onTouchEnd:()=>hn(u),onTouchCancel:()=>hn(u),children:[go&&s("div",{class:`pp-message-actions ${u.sender==="visitor"?"pp-actions-left":"pp-actions-right"}`,children:[s("button",{class:"pp-action-btn",onClick:()=>ft(u),title:"Reply",children:s(an,{color:be})}),u.sender==="visitor"&&s(M,{children:[s("button",{class:"pp-action-btn",onClick:()=>ht(u),title:"Edit",children:s(ln,{color:be})}),s("button",{class:"pp-action-btn pp-action-delete",onClick:()=>gt(u),title:"Delete",children:s(cn,{color:be})})]})]}),y&&(y.content||y.hasAttachment)&&s("div",{class:"pp-reply-quote pp-reply-quote-clickable",onClick:()=>gn(y.id),role:"button",tabIndex:0,onKeyDown:U=>U.key==="Enter"&&gn(y.id),children:[s("span",{class:"pp-reply-sender",children:y.sender==="visitor"?"You":"Support"}),s("span",{class:"pp-reply-content",children:y.deleted?"Message deleted":s(M,{children:[y.hasAttachment&&s("span",{class:"pp-reply-attachment-icon",children:y.attachmentType?.startsWith("image/")?"\u{1F4F7} ":"\u{1F4CE} "}),y.content?s(M,{children:[(y.content||"").slice(0,50),(y.content||"").length>50?"...":""]}):y.attachmentType?.startsWith("image/")?"Photo":"File"]})})]}),x?s("div",{class:"pp-message-content pp-deleted-content",children:[s("span",{class:"pp-deleted-icon",children:"\u{1F5D1}\uFE0F"})," Message deleted"]}):s(M,{children:[u.content&&s("div",{class:"pp-message-content",children:u.content}),u.attachments&&u.attachments.length>0&&s("div",{class:"pp-message-attachments",children:u.attachments.map(U=>s(Md,{attachment:U},U.id))})]}),s("div",{class:"pp-message-time",children:[Id(u.timestamp),S&&!x&&s("span",{class:"pp-edited-badge",children:"edited"}),u.sender==="ai"&&s("span",{class:"pp-ai-badge",children:"AI"}),u.sender==="visitor"&&!x&&s("span",{class:`pp-status pp-status-${u.status??"sent"}`,children:s(Od,{status:u.status})})]})]})]})]},u.id)}),p&&s("div",{class:"pp-message pp-message-operator pp-typing",children:[s("span",{}),s("span",{}),s("span",{})]}),s("div",{ref:ut})]}),G&&s("div",{class:"pp-message-menu",style:{top:`${G.y}px`,left:`${G.x}px`},children:[s("button",{onClick:()=>ft(G.message),children:[s(an,{color:be})," Reply"]}),G.message.sender==="visitor"&&!G.message.deletedAt&&s(M,{children:[s("button",{onClick:()=>ht(G.message),children:[s(ln,{color:be})," Edit"]}),s("button",{class:"pp-menu-delete",onClick:()=>gt(G.message),children:[s(cn,{color:"#ef4444"})," Delete"]})]})]}),j&&s("div",{class:"pp-edit-modal",children:[s("div",{class:"pp-edit-header",children:[s("span",{children:"Edit message"}),s("button",{onClick:fn,children:s(He,{})})]}),s("textarea",{class:"pp-edit-input",value:B,onInput:u=>z(u.target.value),autoFocus:!0}),s("div",{class:"pp-edit-actions",children:[s("button",{class:"pp-edit-cancel",onClick:fn,children:"Cancel"}),s("button",{class:"pp-edit-save",onClick:so,disabled:!B.trim(),children:"Save"})]})]}),R&&s("div",{class:"pp-reply-preview",children:[s("div",{class:"pp-reply-preview-content",children:[s("span",{class:"pp-reply-label",children:"Replying to"}),s("span",{class:"pp-reply-text",children:[R.attachments&&R.attachments.length>0&&s("span",{class:"pp-reply-attachment-icon",children:R.attachments[0].mimeType.startsWith("image/")?"\u{1F4F7} ":"\u{1F4CE} "}),R.content?s(M,{children:[R.content.slice(0,50),R.content.length>50?"...":""]}):R.attachments?.[0]?.mimeType.startsWith("image/")?"Photo":"File"]})]}),s("button",{class:"pp-reply-cancel",onClick:io,children:s(He,{})})]}),E.length>0&&s("div",{class:"pp-attachments-preview",children:E.map(u=>s("div",{class:`pp-attachment-preview pp-attachment-${u.status}`,children:[u.preview?s("img",{src:u.preview,alt:u.file.name,class:"pp-preview-img"}):s("div",{class:"pp-preview-file",children:s(Fr,{mimeType:u.file.type})}),s("button",{class:"pp-remove-attachment",onClick:()=>oo(u.id),"aria-label":"Remove attachment",type:"button",children:s(He,{})}),u.status==="uploading"&&s("div",{class:"pp-upload-progress",style:{width:`${u.progress}%`}}),u.status==="error"&&s("div",{class:"pp-upload-error",title:u.error,children:"!"})]},u.id))}),!yt&&s("form",{class:"pp-input-form",onSubmit:to,children:[s("input",{ref:u=>{$n.current=u,u&&(u.onchange=ro)},type:"file",class:"pp-file-input",accept:"image/*,audio/*,video/*,.pdf,.doc,.docx,.xls,.xlsx,.txt",multiple:!0}),s("button",{type:"button",class:"pp-attach-btn",onClick:()=>$n.current?.click(),disabled:!f||_,"aria-label":"Attach file",children:s(Or,{})}),s("input",{ref:$t,type:"text",class:"pp-input",placeholder:A.placeholder??"Type a message...",value:d,onInput:no,disabled:!f}),s("button",{type:"submit",class:"pp-send-btn",disabled:!d.trim()&&E.filter(u=>u.status==="ready").length===0||!f||_,"aria-label":"Send message",children:s(Ad,{})})]}),s("div",{class:"pp-footer",children:["Powered by ",s("a",{href:"https://pocketping.io",target:"_blank",rel:"noopener",children:"PocketPing"})]})]})]})}function kd(t){let e=window.location.pathname;return t.hideOnPages?.some(n=>new RegExp(n).test(e))?!1:t.showOnPages?.length?t.showOnPages.some(n=>new RegExp(n).test(e)):!0}function Nd(t){return t==="auto"?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":t}function Id(t){return new Date(t).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}function Td(){return s("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2",children:s("path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"})})}function He(){return s("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2",children:[s("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),s("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})}function Ad(){return s("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2",children:[s("line",{x1:"22",y1:"2",x2:"11",y2:"13"}),s("polygon",{points:"22 2 15 22 11 13 2 9 22 2"})]})}function Od({status:t}){return!t||t==="sending"||t==="sent"?s("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor","stroke-width":"2",class:"pp-check",children:s("polyline",{points:"3 8 7 12 13 4"})}):t==="delivered"?s("svg",{viewBox:"0 0 20 16",fill:"none",stroke:"currentColor","stroke-width":"2",class:"pp-check-double",children:[s("polyline",{points:"1 8 5 12 11 4"}),s("polyline",{points:"7 8 11 12 17 4"})]}):t==="read"?s("svg",{viewBox:"0 0 20 16",fill:"none",stroke:"currentColor","stroke-width":"2",class:"pp-check-double pp-check-read",children:[s("polyline",{points:"1 8 5 12 11 4"}),s("polyline",{points:"7 8 11 12 17 4"})]}):null}function Or(){return s("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2",children:s("path",{d:"M21.44 11.05l-9.19 9.19a6 6 0 0 1-8.49-8.49l9.19-9.19a4 4 0 0 1 5.66 5.66l-9.2 9.19a2 2 0 0 1-2.83-2.83l8.49-8.48"})})}function an({color:t,size:e=16}){return s("svg",{viewBox:"0 0 24 24",fill:"none","stroke-width":"2",style:{stroke:t||"currentColor",width:`${e}px`,minWidth:`${e}px`,height:`${e}px`,display:"block",flexShrink:0},children:[s("polyline",{points:"9 17 4 12 9 7"}),s("path",{d:"M20 18v-2a4 4 0 0 0-4-4H4"})]})}function ln({color:t,size:e=16}){return s("svg",{viewBox:"0 0 24 24",fill:"none","stroke-width":"2",style:{stroke:t||"currentColor",width:`${e}px`,minWidth:`${e}px`,height:`${e}px`,display:"block",flexShrink:0},children:s("path",{d:"M17 3a2.828 2.828 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5L17 3z"})})}function cn({color:t,size:e=16}){return s("svg",{viewBox:"0 0 24 24",fill:"none","stroke-width":"2",style:{stroke:t||"currentColor",width:`${e}px`,minWidth:`${e}px`,height:`${e}px`,display:"block",flexShrink:0},children:[s("polyline",{points:"3 6 5 6 21 6"}),s("path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"})]})}function Fr({mimeType:t}){return t==="application/pdf"?s("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2",children:[s("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),s("polyline",{points:"14 2 14 8 20 8"}),s("path",{d:"M9 15h6"}),s("path",{d:"M9 11h6"})]}):t.startsWith("audio/")?s("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2",children:[s("path",{d:"M9 18V5l12-2v13"}),s("circle",{cx:"6",cy:"18",r:"3"}),s("circle",{cx:"18",cy:"16",r:"3"})]}):t.startsWith("video/")?s("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2",children:[s("rect",{x:"2",y:"2",width:"20",height:"20",rx:"2.18",ry:"2.18"}),s("line",{x1:"7",y1:"2",x2:"7",y2:"22"}),s("line",{x1:"17",y1:"2",x2:"17",y2:"22"}),s("line",{x1:"2",y1:"12",x2:"22",y2:"12"}),s("line",{x1:"2",y1:"7",x2:"7",y2:"7"}),s("line",{x1:"2",y1:"17",x2:"7",y2:"17"}),s("line",{x1:"17",y1:"17",x2:"22",y2:"17"}),s("line",{x1:"17",y1:"7",x2:"22",y2:"7"})]}):s("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2",children:[s("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),s("polyline",{points:"14 2 14 8 20 8"})]})}function Md({attachment:t}){let e=t.mimeType.startsWith("image/"),n=t.mimeType.startsWith("audio/"),r=t.mimeType.startsWith("video/"),o=i=>i<1024?`${i} B`:i<1024*1024?`${(i/1024).toFixed(1)} KB`:`${(i/(1024*1024)).toFixed(1)} MB`;return e?s("a",{href:t.url,target:"_blank",rel:"noopener",class:"pp-attachment pp-attachment-image",children:s("img",{src:t.thumbnailUrl||t.url,alt:t.filename})}):n?s("div",{class:"pp-attachment pp-attachment-audio",children:[s("audio",{controls:!0,preload:"metadata",children:s("source",{src:t.url,type:t.mimeType})}),s("span",{class:"pp-attachment-name",children:t.filename})]}):r?s("div",{class:"pp-attachment pp-attachment-video",children:s("video",{controls:!0,preload:"metadata",children:s("source",{src:t.url,type:t.mimeType})})}):s("a",{href:t.url,target:"_blank",rel:"noopener",class:"pp-attachment pp-attachment-file",children:[s(Fr,{mimeType:t.mimeType}),s("div",{class:"pp-attachment-info",children:[s("span",{class:"pp-attachment-name",children:t.filename}),s("span",{class:"pp-attachment-size",children:o(t.size)})]})]})}var lt="0.3.7";var ct=class{constructor(e){this.session=null;this.ws=null;this.sse=null;this.isOpen=!1;this.listeners=new Map;this.customEventHandlers=new Map;this.reconnectAttempts=0;this.maxReconnectAttempts=5;this.reconnectTimeout=null;this.pollingTimeout=null;this.pollingFailures=0;this.maxPollingFailures=10;this.wsConnectedAt=0;this.quickFailureThreshold=2e3;this.connectionMode="none";this.trackedElementCleanups=[];this.currentTrackedElements=[];this.inspectorMode=!1;this.inspectorCleanup=null;this.config=e}async connect(){let e=this.getOrCreateVisitorId(),n=this.getStoredSessionId(),r=this.getStoredIdentity(),i=new URLSearchParams(window.location.search).get("pp_inspector"),d=await this.fetch("/connect",{method:"POST",body:JSON.stringify({visitorId:e,sessionId:n,inspectorToken:i||void 0,metadata:{url:window.location.href,referrer:document.referrer||void 0,pageTitle:document.title||void 0,userAgent:navigator.userAgent,timezone:Intl.DateTimeFormat().resolvedOptions().timeZone,language:navigator.language,screenResolution:`${window.screen.width}x${window.screen.height}`},identity:r||void 0})});return this.session={sessionId:d.sessionId,visitorId:d.visitorId,operatorOnline:d.operatorOnline??!1,messages:d.messages??[],identity:d.identity||r||void 0,preChatForm:d.preChatForm},d.operatorName&&(this.config.operatorName=d.operatorName),d.operatorAvatar&&(this.config.operatorAvatar=d.operatorAvatar),d.primaryColor&&(this.config.primaryColor=d.primaryColor),d.welcomeMessage&&(this.config.welcomeMessage=d.welcomeMessage),this.emit("configUpdate",{operatorName:this.config.operatorName,operatorAvatar:this.config.operatorAvatar,primaryColor:this.config.primaryColor,welcomeMessage:this.config.welcomeMessage}),this.storeSessionId(d.sessionId),this.connectRealtime(),d.inspectorMode?this.enableInspectorMode():d.trackedElements?.length&&this.setupTrackedElements(d.trackedElements),this.emit("connect",this.session),this.config.onConnect?.(d.sessionId),this.session}disconnect(){this.ws&&(this.ws.onclose=null,this.ws.onmessage=null,this.ws.onerror=null,this.ws.onopen=null,this.ws.close(),this.ws=null),this.sse&&(this.sse.close(),this.sse=null),this.session=null,this.connectionMode="none",this.reconnectTimeout&&clearTimeout(this.reconnectTimeout),this.stopPolling(),this.cleanupTrackedElements(),this.disableInspectorMode()}async sendMessage(e,n,r){if(!this.session)throw new Error("Not connected");let o=`temp-${this.generateId()}`,i={id:o,sessionId:this.session.sessionId,content:e,sender:"visitor",timestamp:new Date().toISOString(),status:"sending",replyTo:r};this.session.messages.push(i),this.emit("message",i);try{let d=await this.fetch("/message",{method:"POST",body:JSON.stringify({sessionId:this.session.sessionId,content:e,sender:"visitor",attachmentIds:n||[],replyTo:r})}),l=this.session.messages.findIndex(a=>a.id===o);l>=0&&(this.session.messages[l].id=d.messageId,this.session.messages[l].timestamp=d.timestamp,this.session.messages[l].status="sent",d.attachments&&d.attachments.length>0&&(this.session.messages[l].attachments=d.attachments),this.emit("message",this.session.messages[l]));let p=this.session.messages[l]||{id:d.messageId,sessionId:this.session.sessionId,content:e,sender:"visitor",timestamp:d.timestamp,status:"sent",attachments:d.attachments};return this.config.onMessage?.(p),p}catch(d){let l=this.session.messages.findIndex(p=>p.id===o);throw l>=0&&(this.session.messages.splice(l,1),this.emit("message",i)),d}}async uploadFile(e,n){if(!this.session)throw new Error("Not connected");this.emit("uploadStart",{filename:e.name,size:e.size});try{let r=await this.fetch("/upload",{method:"POST",body:JSON.stringify({sessionId:this.session.sessionId,filename:e.name,mimeType:e.type||"application/octet-stream",size:e.size})});n?.(10),this.emit("uploadProgress",{filename:e.name,progress:10}),await this.uploadToPresignedUrl(r.uploadUrl,e,i=>{let d=10+i*.8;n?.(d),this.emit("uploadProgress",{filename:e.name,progress:d})});let o=await this.fetch("/upload/complete",{method:"POST",body:JSON.stringify({sessionId:this.session.sessionId,attachmentId:r.attachmentId})});return n?.(100),this.emit("uploadComplete",o),{id:o.id,filename:o.filename,mimeType:o.mimeType,size:o.size,url:o.url,thumbnailUrl:o.thumbnailUrl,status:o.status}}catch(r){throw this.emit("uploadError",{filename:e.name,error:r}),r}}async uploadFiles(e,n){let r=[],o=e.length;for(let i=0;i<o;i++){let d=e[i],l=i/o*100,p=100/o,a=await this.uploadFile(d,$=>{let c=l+$/100*p;n?.(c)});r.push(a)}return r}uploadToPresignedUrl(e,n,r){return new Promise((o,i)=>{let d=new XMLHttpRequest;d.upload.addEventListener("progress",l=>{if(l.lengthComputable){let p=l.loaded/l.total*100;r?.(p)}}),d.addEventListener("load",()=>{d.status>=200&&d.status<300?o():i(new Error(`Upload failed with status ${d.status}`))}),d.addEventListener("error",()=>{i(new Error("Upload failed"))}),d.open("PUT",e),d.setRequestHeader("Content-Type",n.type||"application/octet-stream"),d.send(n)})}async fetchMessages(e){if(!this.session)throw new Error("Not connected");let n=new URLSearchParams({sessionId:this.session.sessionId});return e&&n.set("after",e),(await this.fetch(`/messages?${n}`,{method:"GET"})).messages}async sendTyping(e=!0){this.session&&await this.fetch("/typing",{method:"POST",body:JSON.stringify({sessionId:this.session.sessionId,sender:"visitor",isTyping:e})})}async sendReadStatus(e,n){if(!(!this.session||e.length===0))try{await this.fetch("/read",{method:"POST",body:JSON.stringify({sessionId:this.session.sessionId,messageIds:e,status:n})});for(let r of this.session.messages)e.includes(r.id)&&(r.status=n,n==="delivered"?r.deliveredAt=new Date().toISOString():n==="read"&&(r.readAt=new Date().toISOString()));this.emit("readStatusSent",{messageIds:e,status:n})}catch(r){console.error("[PocketPing] Failed to send read status:",r)}}async editMessage(e,n){if(!this.session)throw new Error("Not connected");let r=await this.fetch(`/message/${e}`,{method:"PATCH",body:JSON.stringify({sessionId:this.session.sessionId,content:n})}),o=this.session.messages.findIndex(i=>i.id===e);return o>=0&&(this.session.messages[o].content=r.message.content,this.session.messages[o].editedAt=r.message.editedAt,this.emit("messageEdited",this.session.messages[o])),this.session.messages[o]}async deleteMessage(e){if(!this.session)throw new Error("Not connected");let n=await this.fetch(`/message/${e}?sessionId=${encodeURIComponent(this.session.sessionId)}`,{method:"DELETE"});if(n.deleted){let r=this.session.messages.findIndex(o=>o.id===e);r>=0&&(this.session.messages[r].deletedAt=new Date().toISOString(),this.session.messages[r].content="",this.emit("messageDeleted",this.session.messages[r]))}return n.deleted}async getPresence(){return this.fetch("/presence",{method:"GET"})}async identify(e){if(!e?.id)throw new Error("[PocketPing] identity.id is required");if(this.storeIdentity(e),this.session)try{await this.fetch("/identify",{method:"POST",body:JSON.stringify({sessionId:this.session.sessionId,identity:e})}),this.session.identity=e,this.emit("identify",e)}catch(n){throw console.error("[PocketPing] Failed to identify:",n),n}}async submitPreChat(e){if(!this.session)throw new Error("[PocketPing] Not connected");if(!e.email&&!e.phone)throw new Error("[PocketPing] Either email or phone is required");try{await this.fetch("/prechat",{method:"POST",body:JSON.stringify({sessionId:this.session.sessionId,email:e.email,phone:e.phone,phoneCountry:e.phoneCountry})}),this.session.preChatForm&&(this.session.preChatForm.completed=!0),this.emit("preChatCompleted",e)}catch(n){throw console.error("[PocketPing] Failed to submit pre-chat form:",n),n}}async reset(e){this.clearIdentity(),this.session&&(this.session.identity=void 0),e?.newSession&&(localStorage.removeItem("pocketping_session_id"),localStorage.removeItem("pocketping_visitor_id"),this.disconnect(),await this.connect()),this.emit("reset",null)}getIdentity(){return this.session?.identity||this.getStoredIdentity()}getSession(){return this.session}getMessages(){return this.session?.messages??[]}isConnected(){return this.session!==null}isWidgetOpen(){return this.isOpen}getConfig(){return this.config}setOpen(e){this.isOpen=e,this.emit("openChange",e),e?this.config.onOpen?.():this.config.onClose?.()}toggleOpen(){this.setOpen(!this.isOpen)}on(e,n){return this.listeners.has(e)||this.listeners.set(e,new Set),this.listeners.get(e).add(n),()=>{this.listeners.get(e)?.delete(n)}}emit(e,n){this.listeners.get(e)?.forEach(r=>r(n))}trigger(e,n,r){if(!this.ws||this.ws.readyState!==WebSocket.OPEN){console.warn("[PocketPing] Cannot trigger event: WebSocket not connected");return}let o={name:e,data:n,timestamp:new Date().toISOString()};this.ws.send(JSON.stringify({type:"event",data:o})),this.emit(`event:${e}`,o),r?.widgetMessage&&(this.setOpen(!0),this.emit("triggerMessage",{message:r.widgetMessage,eventName:e}))}onEvent(e,n){return this.customEventHandlers.has(e)||this.customEventHandlers.set(e,new Set),this.customEventHandlers.get(e).add(n),()=>{this.customEventHandlers.get(e)?.delete(n)}}offEvent(e,n){this.customEventHandlers.get(e)?.delete(n)}emitCustomEvent(e){let n=this.customEventHandlers.get(e.name);n&&n.forEach(r=>r(e.data,e)),this.emit("event",e),this.emit(`event:${e.name}`,e)}setupTrackedElements(e){this.cleanupTrackedElements(),this.currentTrackedElements=e;for(let n of e){let r=n.event||"click",o=d=>{let l={...n.data,selector:n.selector,elementText:d.target?.textContent?.trim().slice(0,100),url:window.location.href};this.trigger(n.name,l,{widgetMessage:n.widgetMessage})},i=d=>{d.target?.closest(n.selector)&&o(d)};document.addEventListener(r,i,!0),this.trackedElementCleanups.push(()=>{document.removeEventListener(r,i,!0)})}e.length>0&&console.info(`[PocketPing] Tracking ${e.length} element(s)`)}cleanupTrackedElements(){for(let e of this.trackedElementCleanups)e();this.trackedElementCleanups=[],this.currentTrackedElements=[]}getTrackedElements(){return[...this.currentTrackedElements]}enableInspectorMode(){if(this.inspectorMode)return;this.inspectorMode=!0,console.info("[PocketPing] \u{1F50D} Inspector mode active - click on any element to select it");let e=document.createElement("div");e.id="pp-inspector-overlay",e.innerHTML=`
1000
1434
  <style>
1001
1435
  #pp-inspector-overlay {
1002
1436
  position: fixed;
@@ -1079,9 +1513,9 @@
1079
1513
  <button id="pp-inspector-exit">Exit</button>
1080
1514
  </div>
1081
1515
  <div id="pp-inspector-tooltip"></div>
1082
- `,document.body.appendChild(e);let n=document.getElementById("pp-inspector-tooltip"),s=null,i=u=>{if(u.id&&!u.id.startsWith("pp-"))return`#${CSS.escape(u.id)}`;let l=Array.from(u.classList).filter(h=>!h.startsWith("pp-"));if(l.length>0){let h="."+l.map(f=>CSS.escape(f)).join(".");if(document.querySelectorAll(h).length===1)return h}for(let h of Array.from(u.attributes))if(h.name.startsWith("data-")&&h.value){let f=`[${h.name}="${CSS.escape(h.value)}"]`;if(document.querySelectorAll(f).length===1)return f}let g=[],p=u;for(;p&&p!==document.body;){let h=p.tagName.toLowerCase();if(p.id&&!p.id.startsWith("pp-")){h=`#${CSS.escape(p.id)}`,g.unshift(h);break}let f=p.parentElement;if(f){let E=p.tagName,A=Array.from(f.children).filter(k=>k.tagName===E);if(A.length>1){let k=A.indexOf(p)+1;h+=`:nth-of-type(${k})`}}g.unshift(h),p=f}return g.join(" > ")},a=u=>{let l=u.target;if(l.closest("#pp-inspector-overlay")||l.closest("#pocketping-widget"))return;s&&s.classList.remove("pp-inspector-highlight"),l.classList.add("pp-inspector-highlight"),s=l;let g=i(l);n.textContent=g,n.style.display="block",n.style.left=`${u.clientX+15}px`,n.style.top=`${u.clientY+15}px`;let p=n.getBoundingClientRect();p.right>window.innerWidth&&(n.style.left=`${u.clientX-p.width-15}px`),p.bottom>window.innerHeight&&(n.style.top=`${u.clientY-p.height-15}px`)},r=u=>{let l=u.target;l.closest("#pp-inspector-overlay")||(l.classList.remove("pp-inspector-highlight"),n.style.display="none")},c=u=>{let l=u.target;if(l.id==="pp-inspector-exit"){this.disableInspectorMode();return}if(l.closest("#pp-inspector-overlay")||l.closest("#pocketping-widget"))return;u.preventDefault(),u.stopPropagation();let g=i(l);this.ws&&this.ws.readyState===WebSocket.OPEN&&this.ws.send(JSON.stringify({type:"inspector_select",data:{selector:g,tagName:l.tagName.toLowerCase(),text:l.textContent?.trim().slice(0,50)||"",url:window.location.href}})),this.emit("inspectorSelect",{selector:g,element:l}),l.classList.remove("pp-inspector-highlight"),l.classList.add("pp-inspector-highlight"),setTimeout(()=>{l.classList.remove("pp-inspector-highlight")},500);let p=document.getElementById("pp-inspector-banner");if(p){let h=p.innerHTML;p.innerHTML=`
1516
+ `,document.body.appendChild(e);let n=document.getElementById("pp-inspector-tooltip"),r=null,o=p=>{if(p.id&&!p.id.startsWith("pp-"))return`#${CSS.escape(p.id)}`;let a=Array.from(p.classList).filter(f=>!f.startsWith("pp-"));if(a.length>0){let f="."+a.map(h=>CSS.escape(h)).join(".");if(document.querySelectorAll(f).length===1)return f}for(let f of Array.from(p.attributes))if(f.name.startsWith("data-")&&f.value){let h=`[${f.name}="${CSS.escape(f.value)}"]`;if(document.querySelectorAll(h).length===1)return h}let $=[],c=p;for(;c&&c!==document.body;){let f=c.tagName.toLowerCase();if(c.id&&!c.id.startsWith("pp-")){f=`#${CSS.escape(c.id)}`,$.unshift(f);break}let h=c.parentElement;if(h){let w=c.tagName,T=Array.from(h.children).filter(E=>E.tagName===w);if(T.length>1){let E=T.indexOf(c)+1;f+=`:nth-of-type(${E})`}}$.unshift(f),c=h}return $.join(" > ")},i=p=>{let a=p.target;if(a.closest("#pp-inspector-overlay")||a.closest("#pocketping-widget"))return;r&&r.classList.remove("pp-inspector-highlight"),a.classList.add("pp-inspector-highlight"),r=a;let $=o(a);n.textContent=$,n.style.display="block",n.style.left=`${p.clientX+15}px`,n.style.top=`${p.clientY+15}px`;let c=n.getBoundingClientRect();c.right>window.innerWidth&&(n.style.left=`${p.clientX-c.width-15}px`),c.bottom>window.innerHeight&&(n.style.top=`${p.clientY-c.height-15}px`)},d=p=>{let a=p.target;a.closest("#pp-inspector-overlay")||(a.classList.remove("pp-inspector-highlight"),n.style.display="none")},l=p=>{let a=p.target;if(a.id==="pp-inspector-exit"){this.disableInspectorMode();return}if(a.closest("#pp-inspector-overlay")||a.closest("#pocketping-widget"))return;p.preventDefault(),p.stopPropagation();let $=o(a);this.ws&&this.ws.readyState===WebSocket.OPEN&&this.ws.send(JSON.stringify({type:"inspector_select",data:{selector:$,tagName:a.tagName.toLowerCase(),text:a.textContent?.trim().slice(0,50)||"",url:window.location.href}})),this.emit("inspectorSelect",{selector:$,element:a}),a.classList.remove("pp-inspector-highlight"),a.classList.add("pp-inspector-highlight"),setTimeout(()=>{a.classList.remove("pp-inspector-highlight")},500);let c=document.getElementById("pp-inspector-banner");if(c){let f=c.innerHTML;c.innerHTML=`
1083
1517
  <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
1084
1518
  <polyline points="20 6 9 17 4 12"/>
1085
1519
  </svg>
1086
- <span>Selector captured: <code style="background:rgba(255,255,255,0.2);padding:2px 6px;border-radius:4px;font-family:monospace;">${g}</code></span>
1087
- `,setTimeout(()=>{p&&this.inspectorMode&&(p.innerHTML=h,document.getElementById("pp-inspector-exit")?.addEventListener("click",()=>{this.disableInspectorMode()}))},2e3)}console.info(`[PocketPing] \u{1F4CC} Selector captured: ${g}`)};document.addEventListener("mouseover",a,!0),document.addEventListener("mouseout",r,!0),document.addEventListener("click",c,!0),this.inspectorCleanup=()=>{document.removeEventListener("mouseover",a,!0),document.removeEventListener("mouseout",r,!0),document.removeEventListener("click",c,!0),e.remove(),s&&s.classList.remove("pp-inspector-highlight")},document.getElementById("pp-inspector-exit")?.addEventListener("click",()=>{this.disableInspectorMode()})}disableInspectorMode(){this.inspectorMode&&(this.inspectorMode=!1,this.inspectorCleanup&&(this.inspectorCleanup(),this.inspectorCleanup=null),console.info("[PocketPing] Inspector mode disabled"),this.emit("inspectorDisabled",null))}isInspectorModeActive(){return this.inspectorMode}connectRealtime(){if(this.session){if(this.connectionMode==="polling"){this.startPolling();return}if(this.connectionMode==="sse"){this.connectSSE();return}this.connectWebSocket()}}connectWebSocket(){if(!this.session)return;let e=this.config.endpoint.replace(/^http/,"ws").replace(/\/$/,"")+`/stream?sessionId=${this.session.sessionId}`;try{this.ws=new WebSocket(e),this.wsConnectedAt=Date.now();let n=setTimeout(()=>{console.warn("[PocketPing] \u23F1\uFE0F WebSocket timeout - trying SSE"),this.ws&&this.ws.readyState!==WebSocket.OPEN&&(this.ws.onclose=null,this.ws.onerror=null,this.ws.onopen=null,this.ws.close(),this.ws=null,this.connectSSE())},5e3);this.ws.onopen=()=>{clearTimeout(n),this.connectionMode="ws",this.reconnectAttempts=0,this.wsConnectedAt=Date.now(),this.emit("wsConnected",null)},this.ws.onmessage=s=>{try{let i=JSON.parse(s.data);this.handleRealtimeEvent(i)}catch(i){console.error("[PocketPing] Failed to parse WS message:",i)}},this.ws.onclose=()=>{clearTimeout(n),this.emit("wsDisconnected",null),this.handleWsFailure()},this.ws.onerror=()=>{clearTimeout(n)}}catch{console.warn("[PocketPing] WebSocket unavailable - trying SSE"),this.connectSSE()}}connectSSE(){if(!this.session)return;let e=new URLSearchParams({sessionId:this.session.sessionId}),n=this.getLastEventTimestamp();n&&e.set("after",n);let s=this.config.endpoint.replace(/\/$/,"")+`/stream?${e.toString()}`;try{this.sse=new EventSource(s);let i=setTimeout(()=>{console.warn("[PocketPing] \u23F1\uFE0F SSE timeout - falling back to polling"),this.sse&&this.sse.readyState!==EventSource.OPEN&&(this.sse.close(),this.sse=null,this.connectionMode="polling",this.startPolling())},5e3);this.sse.onopen=()=>{clearTimeout(i),this.connectionMode="sse",this.emit("sseConnected",null)},this.sse.addEventListener("message",a=>{try{let r=JSON.parse(a.data);this.handleRealtimeEvent(r)}catch(r){console.error("[PocketPing] Failed to parse SSE message:",r)}}),this.sse.addEventListener("connected",()=>{}),this.sse.onerror=()=>{clearTimeout(i),console.warn("[PocketPing] \u274C SSE error - falling back to polling"),this.sse&&(this.sse.close(),this.sse=null),this.connectionMode="polling",this.startPolling()}}catch{console.warn("[PocketPing] SSE unavailable - falling back to polling"),this.connectionMode="polling",this.startPolling()}}handleWsFailure(){if(Date.now()-this.wsConnectedAt<this.quickFailureThreshold){console.info("[PocketPing] WebSocket failed quickly - trying SSE"),this.connectSSE();return}this.scheduleReconnect()}handleRealtimeEvent(e){this.handleWebSocketEvent(e)}getLastEventTimestamp(){if(!this.session)return null;let e=null;for(let n of this.session.messages){let s=[n.timestamp,n.editedAt,n.deletedAt,n.deliveredAt,n.readAt].filter(Boolean).map(i=>new Date(i)).filter(i=>!isNaN(i.getTime()));for(let i of s)(!e||i>e)&&(e=i)}return e?e.toISOString():null}handleWebSocketEvent(e){switch(e.type){case"message":let n=e.data;if(this.session){let u=this.session.messages.findIndex(l=>l.id===n.id);if(u<0&&n.sender==="visitor"&&(u=this.session.messages.findIndex(l=>l.id.startsWith("temp-")&&l.content===n.content&&l.sender==="visitor"),u>=0&&(this.session.messages[u].id=n.id)),u<0&&n.sender!=="visitor"){let l=new Date(n.timestamp).getTime();u=this.session.messages.findIndex(g=>g.sender===n.sender&&g.content===n.content&&Math.abs(new Date(g.timestamp).getTime()-l)<2e3)}if(u>=0){let l=this.session.messages[u],g=!1;n.status&&n.status!==l.status&&(l.status=n.status,g=!0,n.deliveredAt&&(l.deliveredAt=n.deliveredAt),n.readAt&&(l.readAt=n.readAt),this.emit("read",{messageIds:[n.id],status:n.status})),n.content!==void 0&&n.content!==l.content&&(l.content=n.content,g=!0),n.editedAt!==void 0&&n.editedAt!==l.editedAt&&(l.editedAt=n.editedAt,g=!0),n.deletedAt!==void 0&&n.deletedAt!==l.deletedAt&&(l.deletedAt=n.deletedAt,g=!0),n.replyTo!==void 0&&(l.replyTo=n.replyTo,g=!0),n.attachments!==void 0&&(l.attachments=n.attachments,g=!0),g&&this.emit("message",l)}else this.session.messages.push(n),this.emit("message",n),this.config.onMessage?.(n)}n.sender!=="visitor"&&this.emit("typing",{isTyping:!1});break;case"typing":let s=e.data;s.sender!=="visitor"&&this.emit("typing",{isTyping:s.isTyping});break;case"presence":this.session&&(this.session.operatorOnline=e.data.online),this.emit("presence",e.data);break;case"ai_takeover":this.emit("aiTakeover",e.data);break;case"read":let i=e.data;if(this.session)for(let u of this.session.messages)i.messageIds.includes(u.id)&&(u.status=i.status,i.deliveredAt&&(u.deliveredAt=i.deliveredAt),i.readAt&&(u.readAt=i.readAt));this.emit("read",i);break;case"message_edited":if(this.session){let u=e.data,l=this.session.messages.findIndex(g=>g.id===u.messageId);if(l>=0){let g=this.session.messages[l];g.content=u.content,g.editedAt=u.editedAt??new Date().toISOString(),this.emit("message",g)}}break;case"message_deleted":if(this.session){let u=e.data,l=this.session.messages.findIndex(g=>g.id===u.messageId);if(l>=0){let g=this.session.messages[l];g.deletedAt=u.deletedAt??new Date().toISOString(),this.emit("message",g)}}break;case"event":let a=e.data;this.emitCustomEvent(a);break;case"version_warning":let r=e.data;this.handleVersionWarning(r);break;case"config_update":let c=e.data;c.trackedElements&&(this.setupTrackedElements(c.trackedElements),this.emit("configUpdate",c));break}}handleVersionWarning(e){let n="[PocketPing]",s=e.upgradeUrl?` Upgrade: ${e.upgradeUrl}`:" Update your widget to the latest version.";switch(e.severity){case"error":console.error(`${n} \u{1F6A8} VERSION ERROR: ${e.message}${s}`),console.error(`${n} Current: ${e.currentVersion}, Required: ${e.minVersion||"unknown"}`);break;case"warning":console.warn(`${n} \u26A0\uFE0F VERSION WARNING: ${e.message}${s}`),console.warn(`${n} Current: ${e.currentVersion}, Latest: ${e.latestVersion||"unknown"}`);break;case"info":console.info(`${n} \u2139\uFE0F ${e.message}`);break}this.emit("versionWarning",e),this.config.onVersionWarning?.(e),e.canContinue||(console.error(`${n} Widget is incompatible with backend. Please update immediately.`),this.disconnect())}scheduleReconnect(){if(this.reconnectAttempts>=this.maxReconnectAttempts){console.warn("[PocketPing] Max reconnect attempts reached, trying SSE"),this.connectSSE();return}let e=Math.min(1e3*Math.pow(2,this.reconnectAttempts),3e4);this.reconnectAttempts++,this.reconnectTimeout=setTimeout(()=>{this.connectWebSocket()},e)}startPolling(){let e=async()=>{if(this.session){try{let n=this.getLastEventTimestamp(),s=await this.fetchMessages(n??void 0);this.pollingFailures=0;for(let i of s){let a=this.session.messages.findIndex(r=>r.id===i.id);if(a>=0){let r=this.session.messages[a],c=!1;i.status&&i.status!==r.status&&(r.status=i.status,c=!0,i.deliveredAt&&(r.deliveredAt=i.deliveredAt),i.readAt&&(r.readAt=i.readAt),this.emit("read",{messageIds:[i.id],status:i.status})),i.content!==void 0&&i.content!==r.content&&(r.content=i.content,c=!0),i.editedAt!==void 0&&i.editedAt!==r.editedAt&&(r.editedAt=i.editedAt,c=!0),i.deletedAt!==void 0&&i.deletedAt!==r.deletedAt&&(r.deletedAt=i.deletedAt,c=!0),i.replyTo!==void 0&&(r.replyTo=i.replyTo,c=!0),i.attachments!==void 0&&(r.attachments=i.attachments,c=!0),c&&this.emit("message",r)}else this.session.messages.push(i),this.emit("message",i),this.config.onMessage?.(i)}}catch(n){if(this.pollingFailures++,console.error("[PocketPing] \u274C Polling error:",n),(this.pollingFailures<=3||this.pollingFailures%3===0)&&console.warn(`[PocketPing] Polling failed (${this.pollingFailures}/${this.maxPollingFailures})`),this.pollingFailures>=this.maxPollingFailures){console.error("[PocketPing] Polling disabled after too many failures. Real-time updates unavailable."),this.emit("pollingDisabled",{failures:this.pollingFailures});return}}if(this.session){let n=this.pollingFailures>0?Math.min(2e3*Math.pow(2,this.pollingFailures-1),3e4):2e3;this.pollingTimeout=setTimeout(e,n)}}};this.pollingTimeout=setTimeout(e,500)}stopPolling(){this.pollingTimeout&&(clearTimeout(this.pollingTimeout),this.pollingTimeout=null),this.pollingFailures=0}async fetch(e,n){let s=this.config.endpoint.replace(/\/$/,"")+e,i=await fetch(s,{...n,headers:{"Content-Type":"application/json","X-PocketPing-Version":de,...n.headers}});if(this.checkVersionHeaders(i),!i.ok){let a=await i.text();throw new Error(`PocketPing API error: ${i.status} ${a}`)}return i.json()}checkVersionHeaders(e){let n=e.headers.get("X-PocketPing-Version-Status"),s=e.headers.get("X-PocketPing-Min-Version"),i=e.headers.get("X-PocketPing-Latest-Version"),a=e.headers.get("X-PocketPing-Version-Message");if(!n||n==="ok")return;let r="info",c=!0;n==="deprecated"?r="warning":n==="unsupported"?(r="error",c=!1):n==="outdated"&&(r="info");let u={severity:r,message:a||`Widget version ${de} is ${n}`,currentVersion:de,minVersion:s||void 0,latestVersion:i||void 0,canContinue:c,upgradeUrl:"https://docs.pocketping.io/widget/installation"};this.handleVersionWarning(u)}getOrCreateVisitorId(){let e="pocketping_visitor_id",n=localStorage.getItem(e);return n||(n=this.generateId(),localStorage.setItem(e,n)),n}getStoredSessionId(){return localStorage.getItem("pocketping_session_id")}storeSessionId(e){localStorage.setItem("pocketping_session_id",e)}getStoredIdentity(){try{let e=localStorage.getItem("pocketping_user_identity");return e?JSON.parse(e):null}catch{return null}}storeIdentity(e){localStorage.setItem("pocketping_user_identity",JSON.stringify(e))}clearIdentity(){localStorage.removeItem("pocketping_user_identity")}generateId(){return`${Date.now().toString(36)}-${Math.random().toString(36).slice(2,11)}`}};var y=null,q=null,Tn="https://app.pocketping.io/api/widget";function Ae(t){if(y)return console.warn("[PocketPing] Already initialized"),y;let e=t.endpoint;if(!e&&t.projectId&&(e=`${Tn}/${t.projectId}`),!e)throw new Error("[PocketPing] endpoint or projectId is required");let n={...t,endpoint:e};return y=new ue(n),q=document.createElement("div"),q.id="pocketping-container",document.body.appendChild(q),Ie(Se(kt,{client:y,config:t}),q),y.connect().catch(s=>{console.error("[PocketPing] Failed to connect:",s)}),y}function St(){q&&(Ie(null,q),q.remove(),q=null),y&&(y.disconnect(),y=null)}function Pt(){y?.setOpen(!0)}function Tt(){y?.setOpen(!1)}function It(){y?.toggleOpen()}function Mt(t,e){if(!y)throw new Error("[PocketPing] Not initialized");return y.sendMessage(t,e)}async function Ct(t,e){if(!y)throw new Error("[PocketPing] Not initialized");return y.uploadFile(t,e)}async function $t(t,e){if(!y)throw new Error("[PocketPing] Not initialized");return y.uploadFiles(t,e)}function At(t,e,n){if(!y){console.warn("[PocketPing] Not initialized, cannot trigger event");return}y.trigger(t,e,n)}function Rt(t){if(!y){console.warn("[PocketPing] Not initialized, cannot setup tracked elements");return}y.setupTrackedElements(t)}function Ot(){return y?.getTrackedElements()||[]}function Dt(t,e){return y?y.onEvent(t,e):(console.warn("[PocketPing] Not initialized, cannot subscribe to event"),()=>{})}function Lt(t,e){y?.offEvent(t,e)}async function Ht(t){if(!y)throw new Error("[PocketPing] Not initialized");return y.identify(t)}async function Ft(t){if(!y){console.warn("[PocketPing] Not initialized");return}return y.reset(t)}function Wt(){return y?.getIdentity()||null}function Nt(t,e){return y?y.on(t,e):(console.warn("[PocketPing] Not initialized, cannot subscribe to event"),()=>{})}if(typeof document<"u"){let t=document.currentScript;if(t){let e=t.dataset.projectId,n=t.dataset.endpoint;(e||n)&&Ae({projectId:e,endpoint:n,theme:t.dataset.theme||"auto",position:t.dataset.position||"bottom-right"})}}var In={init:Ae,destroy:St,open:Pt,close:Tt,toggle:It,sendMessage:Mt,uploadFile:Ct,uploadFiles:$t,trigger:At,onEvent:Dt,offEvent:Lt,on:Nt,identify:Ht,reset:Ft,getIdentity:Wt,setupTrackedElements:Rt,getTrackedElements:Ot};return pn(Mn);})();
1520
+ <span>Selector captured: <code style="background:rgba(255,255,255,0.2);padding:2px 6px;border-radius:4px;font-family:monospace;">${$}</code></span>
1521
+ `,setTimeout(()=>{c&&this.inspectorMode&&(c.innerHTML=f,document.getElementById("pp-inspector-exit")?.addEventListener("click",()=>{this.disableInspectorMode()}))},2e3)}console.info(`[PocketPing] \u{1F4CC} Selector captured: ${$}`)};document.addEventListener("mouseover",i,!0),document.addEventListener("mouseout",d,!0),document.addEventListener("click",l,!0),this.inspectorCleanup=()=>{document.removeEventListener("mouseover",i,!0),document.removeEventListener("mouseout",d,!0),document.removeEventListener("click",l,!0),e.remove(),r&&r.classList.remove("pp-inspector-highlight")},document.getElementById("pp-inspector-exit")?.addEventListener("click",()=>{this.disableInspectorMode()})}disableInspectorMode(){this.inspectorMode&&(this.inspectorMode=!1,this.inspectorCleanup&&(this.inspectorCleanup(),this.inspectorCleanup=null),console.info("[PocketPing] Inspector mode disabled"),this.emit("inspectorDisabled",null))}isInspectorModeActive(){return this.inspectorMode}connectRealtime(){if(this.session){if(this.connectionMode==="polling"){this.startPolling();return}if(this.connectionMode==="sse"){this.connectSSE();return}this.connectWebSocket()}}connectWebSocket(){if(!this.session)return;let e=this.config.endpoint.replace(/^http/,"ws").replace(/\/$/,"")+`/stream?sessionId=${this.session.sessionId}`;try{this.ws=new WebSocket(e),this.wsConnectedAt=Date.now();let n=setTimeout(()=>{console.warn("[PocketPing] \u23F1\uFE0F WebSocket timeout - trying SSE"),this.ws&&this.ws.readyState!==WebSocket.OPEN&&(this.ws.onclose=null,this.ws.onerror=null,this.ws.onopen=null,this.ws.close(),this.ws=null,this.connectSSE())},5e3);this.ws.onopen=()=>{clearTimeout(n),this.connectionMode="ws",this.reconnectAttempts=0,this.wsConnectedAt=Date.now(),this.emit("wsConnected",null)},this.ws.onmessage=r=>{try{let o=JSON.parse(r.data);this.handleRealtimeEvent(o)}catch(o){console.error("[PocketPing] Failed to parse WS message:",o)}},this.ws.onclose=()=>{clearTimeout(n),this.emit("wsDisconnected",null),this.handleWsFailure()},this.ws.onerror=()=>{clearTimeout(n)}}catch{console.warn("[PocketPing] WebSocket unavailable - trying SSE"),this.connectSSE()}}connectSSE(){if(!this.session)return;let e=new URLSearchParams({sessionId:this.session.sessionId}),n=this.getLastEventTimestamp();n&&e.set("after",n);let r=this.config.endpoint.replace(/\/$/,"")+`/stream?${e.toString()}`;try{this.sse=new EventSource(r);let o=setTimeout(()=>{console.warn("[PocketPing] \u23F1\uFE0F SSE timeout - falling back to polling"),this.sse&&this.sse.readyState!==EventSource.OPEN&&(this.sse.close(),this.sse=null,this.connectionMode="polling",this.startPolling())},5e3);this.sse.onopen=()=>{clearTimeout(o),this.connectionMode="sse",this.emit("sseConnected",null)},this.sse.addEventListener("message",i=>{try{let d=JSON.parse(i.data);this.handleRealtimeEvent(d)}catch(d){console.error("[PocketPing] Failed to parse SSE message:",d)}}),this.sse.addEventListener("connected",()=>{}),this.sse.onerror=()=>{clearTimeout(o),console.warn("[PocketPing] \u274C SSE error - falling back to polling"),this.sse&&(this.sse.close(),this.sse=null),this.connectionMode="polling",this.startPolling()}}catch{console.warn("[PocketPing] SSE unavailable - falling back to polling"),this.connectionMode="polling",this.startPolling()}}handleWsFailure(){if(Date.now()-this.wsConnectedAt<this.quickFailureThreshold){console.info("[PocketPing] WebSocket failed quickly - trying SSE"),this.connectSSE();return}this.scheduleReconnect()}handleRealtimeEvent(e){this.handleWebSocketEvent(e)}getLastEventTimestamp(){if(!this.session)return null;let e=null;for(let n of this.session.messages){let r=[n.timestamp,n.editedAt,n.deletedAt,n.deliveredAt,n.readAt].filter(Boolean).map(o=>new Date(o)).filter(o=>!isNaN(o.getTime()));for(let o of r)(!e||o>e)&&(e=o)}return e?e.toISOString():null}handleWebSocketEvent(e){switch(e.type){case"message":let n=e.data;if(this.session){let p=this.session.messages.findIndex(a=>a.id===n.id);if(p<0&&n.sender==="visitor"&&(p=this.session.messages.findIndex(a=>a.id.startsWith("temp-")&&a.content===n.content&&a.sender==="visitor"),p>=0&&(this.session.messages[p].id=n.id)),p<0&&n.sender!=="visitor"){let a=new Date(n.timestamp).getTime();p=this.session.messages.findIndex($=>$.sender===n.sender&&$.content===n.content&&Math.abs(new Date($.timestamp).getTime()-a)<2e3)}if(p>=0){let a=this.session.messages[p],$=!1;n.status&&n.status!==a.status&&(a.status=n.status,$=!0,n.deliveredAt&&(a.deliveredAt=n.deliveredAt),n.readAt&&(a.readAt=n.readAt),this.emit("read",{messageIds:[n.id],status:n.status})),n.content!==void 0&&n.content!==a.content&&(a.content=n.content,$=!0),n.editedAt!==void 0&&n.editedAt!==a.editedAt&&(a.editedAt=n.editedAt,$=!0),n.deletedAt!==void 0&&n.deletedAt!==a.deletedAt&&(a.deletedAt=n.deletedAt,$=!0),n.replyTo!==void 0&&(a.replyTo=n.replyTo,$=!0),n.attachments!==void 0&&(a.attachments=n.attachments,$=!0),$&&this.emit("message",a)}else this.session.messages.push(n),this.emit("message",n),this.config.onMessage?.(n),n.sender!=="visitor"&&!this.isOpen&&(this.config.autoOpenOnMessage??!0)&&this.setOpen(!0)}n.sender!=="visitor"&&this.emit("typing",{isTyping:!1});break;case"typing":let r=e.data;r.sender!=="visitor"&&this.emit("typing",{isTyping:r.isTyping});break;case"presence":this.session&&(this.session.operatorOnline=e.data.online),this.emit("presence",e.data);break;case"ai_takeover":this.emit("aiTakeover",e.data);break;case"read":let o=e.data;if(this.session)for(let p of this.session.messages)o.messageIds.includes(p.id)&&(p.status=o.status,o.deliveredAt&&(p.deliveredAt=o.deliveredAt),o.readAt&&(p.readAt=o.readAt));this.emit("read",o);break;case"message_edited":if(this.session){let p=e.data,a=this.session.messages.findIndex($=>$.id===p.messageId);if(a>=0){let $=this.session.messages[a];$.content=p.content,$.editedAt=p.editedAt??new Date().toISOString(),this.emit("message",$)}}break;case"message_deleted":if(this.session){let p=e.data,a=this.session.messages.findIndex($=>$.id===p.messageId);if(a>=0){let $=this.session.messages[a];$.deletedAt=p.deletedAt??new Date().toISOString(),this.emit("message",$)}}break;case"event":let i=e.data;this.emitCustomEvent(i);break;case"version_warning":let d=e.data;this.handleVersionWarning(d);break;case"config_update":let l=e.data;l.trackedElements&&(this.setupTrackedElements(l.trackedElements),this.emit("configUpdate",l));break}}handleVersionWarning(e){let n="[PocketPing]",r=e.upgradeUrl?` Upgrade: ${e.upgradeUrl}`:" Update your widget to the latest version.";switch(e.severity){case"error":console.error(`${n} \u{1F6A8} VERSION ERROR: ${e.message}${r}`),console.error(`${n} Current: ${e.currentVersion}, Required: ${e.minVersion||"unknown"}`);break;case"warning":console.warn(`${n} \u26A0\uFE0F VERSION WARNING: ${e.message}${r}`),console.warn(`${n} Current: ${e.currentVersion}, Latest: ${e.latestVersion||"unknown"}`);break;case"info":console.info(`${n} \u2139\uFE0F ${e.message}`);break}this.emit("versionWarning",e),this.config.onVersionWarning?.(e),e.canContinue||(console.error(`${n} Widget is incompatible with backend. Please update immediately.`),this.disconnect())}scheduleReconnect(){if(this.reconnectAttempts>=this.maxReconnectAttempts){console.warn("[PocketPing] Max reconnect attempts reached, trying SSE"),this.connectSSE();return}let e=Math.min(1e3*Math.pow(2,this.reconnectAttempts),3e4);this.reconnectAttempts++,this.reconnectTimeout=setTimeout(()=>{this.connectWebSocket()},e)}startPolling(){let e=async()=>{if(this.session){try{let n=this.getLastEventTimestamp(),r=await this.fetchMessages(n??void 0);this.pollingFailures=0;for(let o of r){let i=this.session.messages.findIndex(d=>d.id===o.id);if(i>=0){let d=this.session.messages[i],l=!1;o.status&&o.status!==d.status&&(d.status=o.status,l=!0,o.deliveredAt&&(d.deliveredAt=o.deliveredAt),o.readAt&&(d.readAt=o.readAt),this.emit("read",{messageIds:[o.id],status:o.status})),o.content!==void 0&&o.content!==d.content&&(d.content=o.content,l=!0),o.editedAt!==void 0&&o.editedAt!==d.editedAt&&(d.editedAt=o.editedAt,l=!0),o.deletedAt!==void 0&&o.deletedAt!==d.deletedAt&&(d.deletedAt=o.deletedAt,l=!0),o.replyTo!==void 0&&(d.replyTo=o.replyTo,l=!0),o.attachments!==void 0&&(d.attachments=o.attachments,l=!0),l&&this.emit("message",d)}else this.session.messages.push(o),this.emit("message",o),this.config.onMessage?.(o),o.sender!=="visitor"&&!this.isOpen&&(this.config.autoOpenOnMessage??!0)&&this.setOpen(!0)}}catch(n){if(this.pollingFailures++,console.error("[PocketPing] \u274C Polling error:",n),(this.pollingFailures<=3||this.pollingFailures%3===0)&&console.warn(`[PocketPing] Polling failed (${this.pollingFailures}/${this.maxPollingFailures})`),this.pollingFailures>=this.maxPollingFailures){console.error("[PocketPing] Polling disabled after too many failures. Real-time updates unavailable."),this.emit("pollingDisabled",{failures:this.pollingFailures});return}}if(this.session){let n=this.pollingFailures>0?Math.min(2e3*Math.pow(2,this.pollingFailures-1),3e4):2e3;this.pollingTimeout=setTimeout(e,n)}}};this.pollingTimeout=setTimeout(e,500)}stopPolling(){this.pollingTimeout&&(clearTimeout(this.pollingTimeout),this.pollingTimeout=null),this.pollingFailures=0}async fetch(e,n){let r=this.config.endpoint.replace(/\/$/,"")+e,o=await fetch(r,{...n,headers:{"Content-Type":"application/json","X-PocketPing-Version":lt,...n.headers}});if(this.checkVersionHeaders(o),!o.ok){let i=await o.text();throw new Error(`PocketPing API error: ${o.status} ${i}`)}return o.json()}checkVersionHeaders(e){let n=e.headers.get("X-PocketPing-Version-Status"),r=e.headers.get("X-PocketPing-Min-Version"),o=e.headers.get("X-PocketPing-Latest-Version"),i=e.headers.get("X-PocketPing-Version-Message");if(!n||n==="ok")return;let d="info",l=!0;n==="deprecated"?d="warning":n==="unsupported"?(d="error",l=!1):n==="outdated"&&(d="info");let p={severity:d,message:i||`Widget version ${lt} is ${n}`,currentVersion:lt,minVersion:r||void 0,latestVersion:o||void 0,canContinue:l,upgradeUrl:"https://docs.pocketping.io/widget/installation"};this.handleVersionWarning(p)}getOrCreateVisitorId(){let e="pocketping_visitor_id",n=localStorage.getItem(e);return n||(n=this.generateId(),localStorage.setItem(e,n)),n}getStoredSessionId(){return localStorage.getItem("pocketping_session_id")}storeSessionId(e){localStorage.setItem("pocketping_session_id",e)}getStoredIdentity(){try{let e=localStorage.getItem("pocketping_user_identity");return e?JSON.parse(e):null}catch{return null}}storeIdentity(e){localStorage.setItem("pocketping_user_identity",JSON.stringify(e))}clearIdentity(){localStorage.removeItem("pocketping_user_identity")}generateId(){return`${Date.now().toString(36)}-${Math.random().toString(36).slice(2,11)}`}};var P=null,re=null,Fd="https://app.pocketping.io/api/widget";function pn(t){if(P)return console.warn("[PocketPing] Already initialized"),P;let e=t.endpoint;if(!e&&t.projectId&&(e=`${Fd}/${t.projectId}`),!e)throw new Error("[PocketPing] endpoint or projectId is required");let n={...t,endpoint:e};return P=new ct(n),re=document.createElement("div"),re.id="pocketping-container",document.body.appendChild(re),kt(Ct(Mr,{client:P,config:t}),re),P.connect().catch(r=>{console.error("[PocketPing] Failed to connect:",r)}),P}function Rr(){re&&(kt(null,re),re.remove(),re=null),P&&(P.disconnect(),P=null)}function Dr(){P?.setOpen(!0)}function Lr(){P?.setOpen(!1)}function Ur(){P?.toggleOpen()}function Hr(t,e){if(!P)throw new Error("[PocketPing] Not initialized");return P.sendMessage(t,e)}async function jr(t,e){if(!P)throw new Error("[PocketPing] Not initialized");return P.uploadFile(t,e)}async function Br(t,e){if(!P)throw new Error("[PocketPing] Not initialized");return P.uploadFiles(t,e)}function Gr(t,e,n){if(!P){console.warn("[PocketPing] Not initialized, cannot trigger event");return}P.trigger(t,e,n)}function Wr(t){if(!P){console.warn("[PocketPing] Not initialized, cannot setup tracked elements");return}P.setupTrackedElements(t)}function Vr(){return P?.getTrackedElements()||[]}function zr(t,e){return P?P.onEvent(t,e):(console.warn("[PocketPing] Not initialized, cannot subscribe to event"),()=>{})}function Kr(t,e){P?.offEvent(t,e)}async function Xr(t){if(!P)throw new Error("[PocketPing] Not initialized");return P.identify(t)}async function Yr(t){if(!P){console.warn("[PocketPing] Not initialized");return}return P.reset(t)}function qr(){return P?.getIdentity()||null}function Jr(t,e){return P?P.on(t,e):(console.warn("[PocketPing] Not initialized, cannot subscribe to event"),()=>{})}if(typeof document<"u"){let t=document.currentScript;if(t){let e=t.dataset.projectId,n=t.dataset.endpoint;(e||n)&&pn({projectId:e,endpoint:n,theme:t.dataset.theme||"auto",position:t.dataset.position||"bottom-right"})}}var Rd={init:pn,destroy:Rr,open:Dr,close:Lr,toggle:Ur,sendMessage:Hr,uploadFile:jr,uploadFiles:Br,trigger:Gr,onEvent:zr,offEvent:Kr,on:Jr,identify:Xr,reset:Yr,getIdentity:qr,setupTrackedElements:Wr,getTrackedElements:Vr};return wo(Dd);})();