@pocketping/widget 1.6.0 → 1.8.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.
- package/README.md +2 -0
- package/dist/index.cjs +1501 -601
- package/dist/index.d.cts +63 -0
- package/dist/index.d.ts +63 -0
- package/dist/index.js +1515 -615
- package/dist/pocketping.min.global.js +685 -284
- package/package.json +2 -1
|
@@ -1,36 +1,52 @@
|
|
|
1
|
-
"use strict";var PocketPing=(()=>{var be=Object.defineProperty;var an=Object.getOwnPropertyDescriptor;var pn=Object.getOwnPropertyNames;var ln=Object.prototype.hasOwnProperty;var cn=(t,e)=>{for(var n in e)be(t,n,{get:e[n],enumerable:!0})},dn=(t,e,n,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of pn(e))!ln.call(t,i)&&i!==n&&be(t,i,{get:()=>e[i],enumerable:!(s=an(e,i))||s.enumerable});return t};var un=t=>dn(be({},"__esModule",{value:!0}),t);var Rn={};cn(Rn,{close:()=>Ct,default:()=>Dn,destroy:()=>It,getIdentity:()=>zt,getTrackedElements:()=>Ht,identify:()=>Nt,init:()=>Re,offEvent:()=>Wt,on:()=>Vt,onEvent:()=>Ft,open:()=>Mt,reset:()=>Ut,sendMessage:()=>At,setupTrackedElements:()=>Lt,toggle:()=>$t,trigger:()=>Ot,uploadFile:()=>Dt,uploadFiles:()=>Rt});var de,w,Ge,gn,Y,qe,Ke,Qe,Ze,Ee,we,ke,hn,ee={},et=[],fn=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,ue=Array.isArray;function j(t,e){for(var n in e)t[n]=e[n];return t}function Pe(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function Te(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?de.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 pe(t,r,s,i,null)}function pe(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??++Ge,__i:-1,__u:0};return i==null&&w.vnode!=null&&w.vnode(a),a}function $(t){return t.children}function le(t,e){this.props=t,this.context=e}function G(t,e){if(e==null)return t.__?G(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"?G(t):null}function tt(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 tt(t)}}function Je(t){(!t.__d&&(t.__d=!0)&&Y.push(t)&&!ce.__r++||qe!=w.debounceRendering)&&((qe=w.debounceRendering)||Ke)(ce)}function ce(){for(var t,e,n,s,i,a,r,d=1;Y.length;)Y.length>d&&Y.sort(Qe),t=Y.shift(),d=Y.length,t.__d&&(n=void 0,s=void 0,i=(s=(e=t).__v).__e,a=[],r=[],e.__P&&((n=j({},s)).__v=s.__v+1,w.vnode&&w.vnode(n),Ie(e.__P,n,s,e.__n,e.__P.namespaceURI,32&s.__u?[i]:null,a,i??G(s),!!(32&s.__u),r),n.__v=s.__v,n.__.__k[n.__i]=n,it(a,n,r),s.__e=s.__=null,n.__e!=i&&tt(n)));ce.__r=0}function nt(t,e,n,s,i,a,r,d,u,l,g){var p,h,f,T,D,E,_,b=s&&s.__k||et,F=e.length;for(u=mn(n,e,b,u,F),p=0;p<F;p++)(f=n.__k[p])!=null&&(h=f.__i==-1?ee:b[f.__i]||ee,f.__i=p,E=Ie(t,f,h,i,a,r,d,u,l,g),T=f.__e,f.ref&&h.ref!=f.ref&&(h.ref&&Me(h.ref,null,f),g.push(f.ref,f.__c||T,f)),D==null&&T!=null&&(D=T),(_=!!(4&f.__u))||h.__k===f.__k?u=st(f,u,t,_):typeof f.type=="function"&&E!==void 0?u=E:T&&(u=T.nextSibling),f.__u&=-7);return n.__e=D,u}function mn(t,e,n,s,i){var a,r,d,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]=pe(null,r,null,null,null):ue(r)?r=t.__k[a]=pe($,{children:r},null,null,null):r.constructor===void 0&&r.__b>0?r=t.__k[a]=pe(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,d=null,(l=r.__i=_n(r,n,u,p))!=-1&&(p--,(d=n[l])&&(d.__u|=2)),d==null||d.__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++)(d=n[a])!=null&&(2&d.__u)==0&&(d.__e==s&&(s=G(d)),rt(d,d));return s}function st(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=st(i[a],e,n,s));return e}t.__e!=e&&(s&&(e&&t.type&&!e.parentNode&&(e=G(t)),n.insertBefore(t.__e,e||null)),e=t.__e);do e=e&&e.nextSibling;while(e!=null&&e.nodeType==8);return e}function _n(t,e,n,s){var i,a,r,d=t.key,u=t.type,l=e[n],g=l!=null&&(2&l.__u)==0;if(l===null&&d==null||g&&d==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&&d==l.key&&u==l.type)return r}return-1}function Ye(t,e,n){e[0]=="-"?t.setProperty(e,n??""):t[e]=n==null?"":typeof n!="number"||fn.test(e)?n:n+"px"}function ae(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||Ye(t.style,e,"");if(n)for(e in n)s&&n[e]==s[e]||Ye(t.style,e,n[e])}else if(e[0]=="o"&&e[1]=="n")a=e!=(e=e.replace(Ze,"$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=Ee,t.addEventListener(e,a?ke:we,a)):t.removeEventListener(e,a?ke:we,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 Xe(t){return function(e){if(this.l){var n=this.l[e.type+t];if(e.t==null)e.t=Ee++;else if(e.t<n.u)return;return n(w.event?w.event(e):e)}}}function Ie(t,e,n,s,i,a,r,d,u,l){var g,p,h,f,T,D,E,_,b,F,R,q,U,X,z,W,H,O=e.type;if(e.constructor!==void 0)return null;128&n.__u&&(u=!!(32&n.__u),a=[d=e.__e=n.__e]),(g=w.__b)&&g(e);e:if(typeof O=="function")try{if(_=e.props,b="prototype"in O&&O.prototype.render,F=(g=O.contextType)&&s[g.__c],R=g?F?F.props.value:g.__:s,n.__c?E=(p=e.__c=n.__c).__=p.__E:(b?e.__c=p=new O(_,R):(e.__c=p=new le(_,R),p.constructor=O,p.render=xn),F&&F.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=j({},p.__s)),j(p.__s,O.getDerivedStateFromProps(_,p.__s))),f=p.props,T=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&&_!==f&&p.componentWillReceiveProps!=null&&p.componentWillReceiveProps(_,R),e.__v==n.__v||!p.__e&&p.shouldComponentUpdate!=null&&p.shouldComponentUpdate(_,p.__s,R)===!1){for(e.__v!=n.__v&&(p.props=_,p.state=p.__s,p.__d=!1),e.__e=n.__e,e.__k=n.__k,e.__k.some(function(V){V&&(V.__=e)}),q=0;q<p._sb.length;q++)p.__h.push(p._sb[q]);p._sb=[],p.__h.length&&r.push(p);break e}p.componentWillUpdate!=null&&p.componentWillUpdate(_,p.__s,R),b&&p.componentDidUpdate!=null&&p.__h.push(function(){p.componentDidUpdate(f,T,D)})}if(p.context=R,p.props=_,p.__P=t,p.__e=!1,U=w.__r,X=0,b){for(p.state=p.__s,p.__d=!1,U&&U(e),g=p.render(p.props,p.state,p.context),z=0;z<p._sb.length;z++)p.__h.push(p._sb[z]);p._sb=[]}else do p.__d=!1,U&&U(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=j(j({},s),p.getChildContext())),b&&!h&&p.getSnapshotBeforeUpdate!=null&&(D=p.getSnapshotBeforeUpdate(f,T)),W=g,g!=null&&g.type===$&&g.key==null&&(W=ot(g.props.children)),d=nt(t,ue(W)?W:[W],e,n,s,i,a,r,d,u,l),p.base=e.__e,e.__u&=-161,p.__h.length&&r.push(p),E&&(p.__E=p.__=null)}catch(V){if(e.__v=null,u||a!=null)if(V.then){for(e.__u|=u?160:128;d&&d.nodeType==8&&d.nextSibling;)d=d.nextSibling;a[a.indexOf(d)]=null,e.__e=d}else{for(H=a.length;H--;)Pe(a[H]);Se(e)}else e.__e=n.__e,e.__k=n.__k,V.then||Se(e);w.__e(V,e,n)}else a==null&&e.__v==n.__v?(e.__k=n.__k,e.__e=n.__e):d=e.__e=vn(n.__e,e,n,s,i,a,r,u,l);return(g=w.diffed)&&g(e),128&e.__u?void 0:d}function Se(t){t&&t.__c&&(t.__c.__e=!0),t&&t.__k&&t.__k.forEach(Se)}function it(t,e,n){for(var s=0;s<n.length;s++)Me(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 ot(t){return typeof t!="object"||t==null||t.__b&&t.__b>0?t:ue(t)?t.map(ot):j({},t)}function vn(t,e,n,s,i,a,r,d,u){var l,g,p,h,f,T,D,E=n.props||ee,_=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(_);t=document.createElementNS(i,b,_.is&&_),d&&(w.__m&&w.__m(e,a),d=!1),a=null}if(b==null)E===_||d&&t.data==_||(t.data=_);else{if(a=a&&de.call(t.childNodes),!d&&a!=null)for(E={},l=0;l<t.attributes.length;l++)E[(f=t.attributes[l]).name]=f.value;for(l in E)if(f=E[l],l!="children"){if(l=="dangerouslySetInnerHTML")p=f;else if(!(l in _)){if(l=="value"&&"defaultValue"in _||l=="checked"&&"defaultChecked"in _)continue;ae(t,l,null,f,i)}}for(l in _)f=_[l],l=="children"?h=f:l=="dangerouslySetInnerHTML"?g=f:l=="value"?T=f:l=="checked"?D=f:d&&typeof f!="function"||E[l]===f||ae(t,l,f,E[l],i);if(g)d||p&&(g.__html==p.__html||g.__html==t.innerHTML)||(t.innerHTML=g.__html),e.__k=[];else if(p&&(t.innerHTML=""),nt(e.type=="template"?t.content:t,ue(h)?h:[h],e,n,s,b=="foreignObject"?"http://www.w3.org/1999/xhtml":i,a,r,a?a[0]:n.__k&&G(n,0),d,u),a!=null)for(l=a.length;l--;)Pe(a[l]);d||(l="value",b=="progress"&&T==null?t.removeAttribute("value"):T!=null&&(T!==t[l]||b=="progress"&&!T||b=="option"&&T!=E[l])&&ae(t,l,T,E[l],i),l="checked",D!=null&&D!=t[l]&&ae(t,l,D,E[l],i))}return t}function Me(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 rt(t,e,n){var s,i;if(w.unmount&&w.unmount(t),(s=t.ref)&&(s.current&&s.current!=t.__e||Me(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]&&rt(s[i],e,n||typeof t.type!="function");n||Pe(t.__e),t.__c=t.__=t.__e=void 0}function xn(t,e,n){return this.constructor(t,n)}function Ce(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=[],Ie(e,t=(!s&&n||e).__k=Te($,null,[t]),i||ee,ee,e.namespaceURI,!s&&n?[n]:i?null:e.firstChild?de.call(e.childNodes):null,a,!s&&n?n:i?i.__e:e.firstChild,s,r),it(a,t,r)}de=et.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(d){t=d}throw t}},Ge=0,gn=function(t){return t!=null&&t.constructor===void 0},le.prototype.setState=function(t,e){var n;n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=j({},this.state),typeof t=="function"&&(t=t(j({},n),this.props)),t&&j(n,t),t!=null&&this.__v&&(e&&this._sb.push(e),Je(this))},le.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),Je(this))},le.prototype.render=$,Y=[],Ke=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Qe=function(t,e){return t.__v.__b-e.__v.__b},ce.__r=0,Ze=/(PointerCapture)$|Capture$/i,Ee=0,we=Xe(!1),ke=Xe(!0),hn=0;var te,M,$e,at,ne=0,ft=[],C=w,pt=C.__b,lt=C.__r,ct=C.diffed,dt=C.__c,ut=C.unmount,gt=C.__;function De(t,e){C.__h&&C.__h(M,t,ne||e),ne=0;var n=M.__H||(M.__H={__:[],__h:[]});return t>=n.__.length&&n.__.push({}),n.__[t]}function A(t){return ne=1,yn(xt,t)}function yn(t,e,n){var s=De(te++,2);if(s.t=t,!s.__c&&(s.__=[n?n(e):xt(void 0,e),function(d){var u=s.__N?s.__N[0]:s.__[0],l=s.t(u,d);u!==l&&(s.__N=[l,s.__[1]],s.__c.setState({}))}],s.__c=M,!M.__f)){var i=function(d,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,d,u,l);var p=s.__c.props!==d;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,d,u,l)||p};M.__f=!0;var a=M.shouldComponentUpdate,r=M.componentWillUpdate;M.componentWillUpdate=function(d,u,l){if(this.__e){var g=a;a=void 0,i(d,u,l),a=g}r&&r.call(this,d,u,l)},M.shouldComponentUpdate=i}return s.__N||s.__}function B(t,e){var n=De(te++,3);!C.__s&&vt(n.__H,e)&&(n.__=t,n.u=e,M.__H.__h.push(n))}function K(t){return ne=5,mt(function(){return{current:t}},[])}function mt(t,e){var n=De(te++,7);return vt(n.__H,e)&&(n.__=t(),n.__H=e,n.__h=t),n.__}function _t(t,e){return ne=8,mt(function(){return t},e)}function bn(){for(var t;t=ft.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(ge),t.__H.__h.forEach(Ae),t.__H.__h=[]}catch(e){t.__H.__h=[],C.__e(e,t.__v)}}C.__b=function(t){M=null,pt&&pt(t)},C.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),gt&>(t,e)},C.__r=function(t){lt&<(t),te=0;var e=(M=t.__c).__H;e&&($e===M?(e.__h=[],M.__h=[],e.__.forEach(function(n){n.__N&&(n.__=n.__N),n.u=n.__N=void 0})):(e.__h.forEach(ge),e.__h.forEach(Ae),e.__h=[],te=0)),$e=M},C.diffed=function(t){ct&&ct(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(ft.push(e)!==1&&at===C.requestAnimationFrame||((at=C.requestAnimationFrame)||wn)(bn)),e.__H.__.forEach(function(n){n.u&&(n.__H=n.u),n.u=void 0})),$e=M=null},C.__c=function(t,e){e.some(function(n){try{n.__h.forEach(ge),n.__h=n.__h.filter(function(s){return!s.__||Ae(s)})}catch(s){e.some(function(i){i.__h&&(i.__h=[])}),e=[],C.__e(s,n.__v)}}),dt&&dt(t,e)},C.unmount=function(t){ut&&ut(t);var e,n=t.__c;n&&n.__H&&(n.__H.__.forEach(function(s){try{ge(s)}catch(i){e=i}}),n.__H=void 0,e&&C.__e(e,n.__v))};var ht=typeof requestAnimationFrame=="function";function wn(t){var e,n=function(){clearTimeout(s),ht&&cancelAnimationFrame(e),setTimeout(t)},s=setTimeout(n,35);ht&&(e=requestAnimationFrame(n))}function ge(t){var e=M,n=t.__c;typeof n=="function"&&(t.__c=void 0,n()),M=e}function Ae(t){var e=M;t.__c=t.__(),M=e}function vt(t,e){return!t||t.length!==e.length||e.some(function(n,s){return n!==t[s]})}function xt(t,e){return typeof e=="function"?e(t):e}function yt(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 ht=Object.defineProperty;var mo=Object.getOwnPropertyDescriptor;var bo=Object.getOwnPropertyNames;var vo=Object.prototype.hasOwnProperty;var yo=(t,e)=>{for(var n in e)ht(t,n,{get:e[n],enumerable:!0})},_o=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of bo(e))!vo.call(t,o)&&o!==n&&ht(t,o,{get:()=>e[o],enumerable:!(r=mo(e,o))||r.enumerable});return t};var xo=t=>_o(ht({},"__esModule",{value:!0}),t);var Md={};yo(Md,{close:()=>Hr,default:()=>Od,destroy:()=>Dr,getIdentity:()=>Jr,getTrackedElements:()=>zr,identify:()=>Yr,init:()=>rn,offEvent:()=>Xr,on:()=>Zr,onEvent:()=>Kr,open:()=>Lr,reset:()=>qr,sendMessage:()=>jr,setupTrackedElements:()=>Wr,toggle:()=>Ur,trigger:()=>Gr,uploadFile:()=>Br,uploadFiles:()=>Vr});var Je,N,bn,wo,se,fn,vn,yn,_n,vt,gt,mt,Co,Ce={},xn=[],Po=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Ze=Array.isArray;function oe(t,e){for(var n in e)t[n]=e[n];return t}function yt(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function _t(t,e,n){var r,o,d,i={};for(d in e)d=="key"?r=e[d]:d=="ref"?o=e[d]:i[d]=e[d];if(arguments.length>2&&(i.children=arguments.length>3?Je.call(arguments,2):n),typeof t=="function"&&t.defaultProps!=null)for(d in t.defaultProps)i[d]===void 0&&(i[d]=t.defaultProps[d]);return Xe(t,i,r,o,null)}function Xe(t,e,n,r,o){var d={type:t,props:e,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:o??++bn,__i:-1,__u:0};return o==null&&N.vnode!=null&&N.vnode(d),d}function F(t){return t.children}function Ye(t,e){this.props=t,this.context=e}function fe(t,e){if(e==null)return t.__?fe(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"?fe(t):null}function wn(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 wn(t)}}function hn(t){(!t.__d&&(t.__d=!0)&&se.push(t)&&!qe.__r++||fn!=N.debounceRendering)&&((fn=N.debounceRendering)||vn)(qe)}function qe(){for(var t,e,n,r,o,d,i,s=1;se.length;)se.length>s&&se.sort(yn),t=se.shift(),s=se.length,t.__d&&(n=void 0,r=void 0,o=(r=(e=t).__v).__e,d=[],i=[],e.__P&&((n=oe({},r)).__v=r.__v+1,N.vnode&&N.vnode(n),xt(e.__P,n,r,e.__n,e.__P.namespaceURI,32&r.__u?[o]:null,d,o??fe(r),!!(32&r.__u),i),n.__v=r.__v,n.__.__k[n.__i]=n,En(d,n,i),r.__e=r.__=null,n.__e!=o&&wn(n)));qe.__r=0}function Cn(t,e,n,r,o,d,i,s,c,l,$){var p,f,h,v,k,w,m,g=r&&r.__k||xn,D=e.length;for(c=Eo(n,e,g,c,D),p=0;p<D;p++)(h=n.__k[p])!=null&&(f=h.__i==-1?Ce:g[h.__i]||Ce,h.__i=p,w=xt(t,h,f,o,d,i,s,c,l,$),v=h.__e,h.ref&&f.ref!=h.ref&&(f.ref&&wt(f.ref,null,h),$.push(h.ref,h.__c||v,h)),k==null&&v!=null&&(k=v),(m=!!(4&h.__u))||f.__k===h.__k?c=Pn(h,c,t,m):typeof h.type=="function"&&w!==void 0?c=w:v&&(c=v.nextSibling),h.__u&=-7);return n.__e=k,c}function Eo(t,e,n,r,o){var d,i,s,c,l,$=n.length,p=$,f=0;for(t.__k=new Array(o),d=0;d<o;d++)(i=e[d])!=null&&typeof i!="boolean"&&typeof i!="function"?(typeof i=="string"||typeof i=="number"||typeof i=="bigint"||i.constructor==String?i=t.__k[d]=Xe(null,i,null,null,null):Ze(i)?i=t.__k[d]=Xe(F,{children:i},null,null,null):i.constructor===void 0&&i.__b>0?i=t.__k[d]=Xe(i.type,i.props,i.key,i.ref?i.ref:null,i.__v):t.__k[d]=i,c=d+f,i.__=t,i.__b=t.__b+1,s=null,(l=i.__i=ko(i,n,c,p))!=-1&&(p--,(s=n[l])&&(s.__u|=2)),s==null||s.__v==null?(l==-1&&(o>$?f--:o<$&&f++),typeof i.type!="function"&&(i.__u|=4)):l!=c&&(l==c-1?f--:l==c+1?f++:(l>c?f--:f++,i.__u|=4))):t.__k[d]=null;if(p)for(d=0;d<$;d++)(s=n[d])!=null&&(2&s.__u)==0&&(s.__e==r&&(r=fe(s)),Sn(s,s));return r}function Pn(t,e,n,r){var o,d;if(typeof t.type=="function"){for(o=t.__k,d=0;o&&d<o.length;d++)o[d]&&(o[d].__=t,e=Pn(o[d],e,n,r));return e}t.__e!=e&&(r&&(e&&t.type&&!e.parentNode&&(e=fe(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,d,i,s=t.key,c=t.type,l=e[n],$=l!=null&&(2&l.__u)==0;if(l===null&&s==null||$&&s==l.key&&c==l.type)return n;if(r>($?1:0)){for(o=n-1,d=n+1;o>=0||d<e.length;)if((l=e[i=o>=0?o--:d++])!=null&&(2&l.__u)==0&&s==l.key&&c==l.type)return i}return-1}function gn(t,e,n){e[0]=="-"?t.setProperty(e,n??""):t[e]=n==null?"":typeof n!="number"||Po.test(e)?n:n+"px"}function Ke(t,e,n,r,o){var d,i;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||gn(t.style,e,"");if(n)for(e in n)r&&n[e]==r[e]||gn(t.style,e,n[e])}else if(e[0]=="o"&&e[1]=="n")d=e!=(e=e.replace(_n,"$1")),i=e.toLowerCase(),e=i in t||e=="onFocusOut"||e=="onFocusIn"?i.slice(2):e.slice(2),t.l||(t.l={}),t.l[e+d]=n,n?r?n.u=r.u:(n.u=vt,t.addEventListener(e,d?mt:gt,d)):t.removeEventListener(e,d?mt:gt,d);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 mn(t){return function(e){if(this.l){var n=this.l[e.type+t];if(e.t==null)e.t=vt++;else if(e.t<n.u)return;return n(N.event?N.event(e):e)}}}function xt(t,e,n,r,o,d,i,s,c,l){var $,p,f,h,v,k,w,m,g,D,O,G,M,q,U,X,B,L=e.type;if(e.constructor!==void 0)return null;128&n.__u&&(c=!!(32&n.__u),d=[s=e.__e=n.__e]),($=N.__b)&&$(e);e:if(typeof L=="function")try{if(m=e.props,g="prototype"in L&&L.prototype.render,D=($=L.contextType)&&r[$.__c],O=$?D?D.props.value:$.__:r,n.__c?w=(p=e.__c=n.__c).__=p.__E:(g?e.__c=p=new L(m,O):(e.__c=p=new Ye(m,O),p.constructor=L,p.render=Io),D&&D.sub(p),p.state||(p.state={}),p.__n=r,f=p.__d=!0,p.__h=[],p._sb=[]),g&&p.__s==null&&(p.__s=p.state),g&&L.getDerivedStateFromProps!=null&&(p.__s==p.state&&(p.__s=oe({},p.__s)),oe(p.__s,L.getDerivedStateFromProps(m,p.__s))),h=p.props,v=p.state,p.__v=e,f)g&&L.getDerivedStateFromProps==null&&p.componentWillMount!=null&&p.componentWillMount(),g&&p.componentDidMount!=null&&p.__h.push(p.componentDidMount);else{if(g&&L.getDerivedStateFromProps==null&&m!==h&&p.componentWillReceiveProps!=null&&p.componentWillReceiveProps(m,O),e.__v==n.__v||!p.__e&&p.shouldComponentUpdate!=null&&p.shouldComponentUpdate(m,p.__s,O)===!1){for(e.__v!=n.__v&&(p.props=m,p.state=p.__s,p.__d=!1),e.__e=n.__e,e.__k=n.__k,e.__k.some(function(Y){Y&&(Y.__=e)}),G=0;G<p._sb.length;G++)p.__h.push(p._sb[G]);p._sb=[],p.__h.length&&i.push(p);break e}p.componentWillUpdate!=null&&p.componentWillUpdate(m,p.__s,O),g&&p.componentDidUpdate!=null&&p.__h.push(function(){p.componentDidUpdate(h,v,k)})}if(p.context=O,p.props=m,p.__P=t,p.__e=!1,M=N.__r,q=0,g){for(p.state=p.__s,p.__d=!1,M&&M(e),$=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,M&&M(e),$=p.render(p.props,p.state,p.context),p.state=p.__s;while(p.__d&&++q<25);p.state=p.__s,p.getChildContext!=null&&(r=oe(oe({},r),p.getChildContext())),g&&!f&&p.getSnapshotBeforeUpdate!=null&&(k=p.getSnapshotBeforeUpdate(h,v)),X=$,$!=null&&$.type===F&&$.key==null&&(X=kn($.props.children)),s=Cn(t,Ze(X)?X:[X],e,n,r,o,d,i,s,c,l),p.base=e.__e,e.__u&=-161,p.__h.length&&i.push(p),w&&(p.__E=p.__=null)}catch(Y){if(e.__v=null,c||d!=null)if(Y.then){for(e.__u|=c?160:128;s&&s.nodeType==8&&s.nextSibling;)s=s.nextSibling;d[d.indexOf(s)]=null,e.__e=s}else{for(B=d.length;B--;)yt(d[B]);bt(e)}else e.__e=n.__e,e.__k=n.__k,Y.then||bt(e);N.__e(Y,e,n)}else d==null&&e.__v==n.__v?(e.__k=n.__k,e.__e=n.__e):s=e.__e=So(n.__e,e,n,r,o,d,i,c,l);return($=N.diffed)&&$(e),128&e.__u?void 0:s}function bt(t){t&&t.__c&&(t.__c.__e=!0),t&&t.__k&&t.__k.forEach(bt)}function En(t,e,n){for(var r=0;r<n.length;r++)wt(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(d){d.call(o)})}catch(d){N.__e(d,o.__v)}})}function kn(t){return typeof t!="object"||t==null||t.__b&&t.__b>0?t:Ze(t)?t.map(kn):oe({},t)}function So(t,e,n,r,o,d,i,s,c){var l,$,p,f,h,v,k,w=n.props||Ce,m=e.props,g=e.type;if(g=="svg"?o="http://www.w3.org/2000/svg":g=="math"?o="http://www.w3.org/1998/Math/MathML":o||(o="http://www.w3.org/1999/xhtml"),d!=null){for(l=0;l<d.length;l++)if((h=d[l])&&"setAttribute"in h==!!g&&(g?h.localName==g:h.nodeType==3)){t=h,d[l]=null;break}}if(t==null){if(g==null)return document.createTextNode(m);t=document.createElementNS(o,g,m.is&&m),s&&(N.__m&&N.__m(e,d),s=!1),d=null}if(g==null)w===m||s&&t.data==m||(t.data=m);else{if(d=d&&Je.call(t.childNodes),!s&&d!=null)for(w={},l=0;l<t.attributes.length;l++)w[(h=t.attributes[l]).name]=h.value;for(l in w)if(h=w[l],l!="children"){if(l=="dangerouslySetInnerHTML")p=h;else if(!(l in m)){if(l=="value"&&"defaultValue"in m||l=="checked"&&"defaultChecked"in m)continue;Ke(t,l,null,h,o)}}for(l in m)h=m[l],l=="children"?f=h:l=="dangerouslySetInnerHTML"?$=h:l=="value"?v=h:l=="checked"?k=h:s&&typeof h!="function"||w[l]===h||Ke(t,l,h,w[l],o);if($)s||p&&($.__html==p.__html||$.__html==t.innerHTML)||(t.innerHTML=$.__html),e.__k=[];else if(p&&(t.innerHTML=""),Cn(e.type=="template"?t.content:t,Ze(f)?f:[f],e,n,r,g=="foreignObject"?"http://www.w3.org/1999/xhtml":o,d,i,d?d[0]:n.__k&&fe(n,0),s,c),d!=null)for(l=d.length;l--;)yt(d[l]);s||(l="value",g=="progress"&&v==null?t.removeAttribute("value"):v!=null&&(v!==t[l]||g=="progress"&&!v||g=="option"&&v!=w[l])&&Ke(t,l,v,w[l],o),l="checked",k!=null&&k!=t[l]&&Ke(t,l,k,w[l],o))}return t}function wt(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 Sn(t,e,n){var r,o;if(N.unmount&&N.unmount(t),(r=t.ref)&&(r.current&&r.current!=t.__e||wt(r,null,e)),(r=t.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(d){N.__e(d,e)}r.base=r.__P=null}if(r=t.__k)for(o=0;o<r.length;o++)r[o]&&Sn(r[o],e,n||typeof t.type!="function");n||yt(t.__e),t.__c=t.__=t.__e=void 0}function Io(t,e,n){return this.constructor(t,n)}function Ct(t,e,n){var r,o,d,i;e==document&&(e=document.documentElement),N.__&&N.__(t,e),o=(r=typeof n=="function")?null:n&&n.__k||e.__k,d=[],i=[],xt(e,t=(!r&&n||e).__k=_t(F,null,[t]),o||Ce,Ce,e.namespaceURI,!r&&n?[n]:o?null:e.firstChild?Je.call(e.childNodes):null,d,!r&&n?n:o?o.__e:e.firstChild,r,i),En(d,t,i)}Je=xn.slice,N={__e:function(t,e,n,r){for(var o,d,i;e=e.__;)if((o=e.__c)&&!o.__)try{if((d=o.constructor)&&d.getDerivedStateFromError!=null&&(o.setState(d.getDerivedStateFromError(t)),i=o.__d),o.componentDidCatch!=null&&(o.componentDidCatch(t,r||{}),i=o.__d),i)return o.__E=o}catch(s){t=s}throw t}},bn=0,wo=function(t){return t!=null&&t.constructor===void 0},Ye.prototype.setState=function(t,e){var n;n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=oe({},this.state),typeof t=="function"&&(t=t(oe({},n),this.props)),t&&oe(n,t),t!=null&&this.__v&&(e&&this._sb.push(e),hn(this))},Ye.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),hn(this))},Ye.prototype.render=F,se=[],vn=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,yn=function(t,e){return t.__v.__b-e.__v.__b},qe.__r=0,_n=/(PointerCapture)$|Capture$/i,vt=0,gt=mn(!1),mt=mn(!0),Co=0;var Pe,R,Pt,In,Ee=0,Dn=[],H=N,Nn=H.__b,Tn=H.__r,An=H.diffed,On=H.__c,Mn=H.unmount,Fn=H.__;function kt(t,e){H.__h&&H.__h(R,t,Ee||e),Ee=0;var n=R.__H||(R.__H={__:[],__h:[]});return t>=n.__.length&&n.__.push({}),n.__[t]}function S(t){return Ee=1,No(jn,t)}function No(t,e,n){var r=kt(Pe++,2);if(r.t=t,!r.__c&&(r.__=[n?n(e):jn(void 0,e),function(s){var c=r.__N?r.__N[0]:r.__[0],l=r.t(c,s);c!==l&&(r.__N=[l,r.__[1]],r.__c.setState({}))}],r.__c=R,!R.__f)){var o=function(s,c,l){if(!r.__c.__H)return!0;var $=r.__c.__H.__.filter(function(f){return!!f.__c});if($.every(function(f){return!f.__N}))return!d||d.call(this,s,c,l);var p=r.__c.props!==s;return $.forEach(function(f){if(f.__N){var h=f.__[0];f.__=f.__N,f.__N=void 0,h!==f.__[0]&&(p=!0)}}),d&&d.call(this,s,c,l)||p};R.__f=!0;var d=R.shouldComponentUpdate,i=R.componentWillUpdate;R.componentWillUpdate=function(s,c,l){if(this.__e){var $=d;d=void 0,o(s,c,l),d=$}i&&i.call(this,s,c,l)},R.shouldComponentUpdate=o}return r.__N||r.__}function J(t,e){var n=kt(Pe++,3);!H.__s&&Un(n.__H,e)&&(n.__=t,n.u=e,R.__H.__h.push(n))}function te(t){return Ee=5,Ln(function(){return{current:t}},[])}function Ln(t,e){var n=kt(Pe++,7);return Un(n.__H,e)&&(n.__=t(),n.__H=e,n.__h=t),n.__}function Hn(t,e){return Ee=8,Ln(function(){return t},e)}function To(){for(var t;t=Dn.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(Qe),t.__H.__h.forEach(Et),t.__H.__h=[]}catch(e){t.__H.__h=[],H.__e(e,t.__v)}}H.__b=function(t){R=null,Nn&&Nn(t)},H.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),Fn&&Fn(t,e)},H.__r=function(t){Tn&&Tn(t),Pe=0;var e=(R=t.__c).__H;e&&(Pt===R?(e.__h=[],R.__h=[],e.__.forEach(function(n){n.__N&&(n.__=n.__N),n.u=n.__N=void 0})):(e.__h.forEach(Qe),e.__h.forEach(Et),e.__h=[],Pe=0)),Pt=R},H.diffed=function(t){An&&An(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(Dn.push(e)!==1&&In===H.requestAnimationFrame||((In=H.requestAnimationFrame)||Ao)(To)),e.__H.__.forEach(function(n){n.u&&(n.__H=n.u),n.u=void 0})),Pt=R=null},H.__c=function(t,e){e.some(function(n){try{n.__h.forEach(Qe),n.__h=n.__h.filter(function(r){return!r.__||Et(r)})}catch(r){e.some(function(o){o.__h&&(o.__h=[])}),e=[],H.__e(r,n.__v)}}),On&&On(t,e)},H.unmount=function(t){Mn&&Mn(t);var e,n=t.__c;n&&n.__H&&(n.__H.__.forEach(function(r){try{Qe(r)}catch(o){e=o}}),n.__H=void 0,e&&H.__e(e,n.__v))};var Rn=typeof requestAnimationFrame=="function";function Ao(t){var e,n=function(){clearTimeout(r),Rn&&cancelAnimationFrame(e),setTimeout(t)},r=setTimeout(n,35);Rn&&(e=requestAnimationFrame(n))}function Qe(t){var e=R,n=t.__c;typeof n=="function"&&(t.__c=void 0,n()),R=e}function Et(t){var e=R;t.__c=t.__(),R=e}function Un(t,e){return!t||t.length!==e.length||e.some(function(n,r){return n!==t[r]})}function jn(t,e){return typeof e=="function"?e(t):e}function et(t,e,n,r){return t?typeof t=="string"?t:e?t.dark:t.light:e?r:n}function Bn(t){let{primaryColor:e,theme:n,headerColor:r,footerColor:o,chatBackground:d,toggleColor:i}=t,s=n==="dark",c=et(r,s,"#008069","#202c33"),l=et(o,s,"#f0f2f5","#202c33"),$=et(i,s,"#25d366","#25d366"),p=$!=="#25d366"?D($,-10):"#22c55e",f=s?`url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E")`:`url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23000000' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E")`,h=s?`url("data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='10' cy='10' r='1' fill='%23ffffff' fill-opacity='0.05'/%3E%3C/svg%3E")`:`url("data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='10' cy='10' r='1' fill='%23000000' fill-opacity='0.05'/%3E%3C/svg%3E")`,v=et(d,s,"whatsapp","whatsapp"),k=s?"#0b141a":"#e5ddd5",w=f,m="auto";v==="plain"?w="none":v==="dots"?w=h:v==="whatsapp"||!v?w=f:(v.startsWith("http")||v.startsWith("/")||v.startsWith("data:"))&&(w=`url("${v}")`,m="cover");let g={bg:s?"#1f2937":"#ffffff",bgSecondary:s?"#374151":"#f3f4f6",text:s?"#f9fafb":"#111827",textSecondary:s?"#9ca3af":"#6b7280",border:s?"#4b5563":"#e5e7eb",messageBg:s?"#374151":"#f3f4f6"};function D(O,G){let M=parseInt(O.replace("#",""),16),q=Math.min(255,Math.max(0,(M>>16)+G)),U=Math.min(255,Math.max(0,(M>>8&255)+G)),X=Math.min(255,Math.max(0,(M&255)+G));return"#"+(16777216+(q<<16)+(U<<8)+X).toString(16).slice(1)}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: ${
|
|
6
|
+
color: ${g.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 {
|
|
10
21
|
position: fixed;
|
|
11
|
-
width:
|
|
12
|
-
height:
|
|
22
|
+
width: 60px;
|
|
23
|
+
height: 60px;
|
|
13
24
|
border-radius: 50%;
|
|
14
|
-
background: ${
|
|
25
|
+
background: ${$};
|
|
15
26
|
color: white;
|
|
16
27
|
border: none;
|
|
17
28
|
cursor: pointer;
|
|
18
29
|
display: flex;
|
|
19
30
|
align-items: center;
|
|
20
31
|
justify-content: center;
|
|
21
|
-
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
|
|
22
|
-
transition: transform 0.2s, box-shadow 0.2s;
|
|
32
|
+
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15), 0 2px 4px rgba(0, 0, 0, 0.1);
|
|
33
|
+
transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
|
|
23
34
|
z-index: 9999;
|
|
24
35
|
}
|
|
25
36
|
|
|
26
37
|
.pp-toggle:hover {
|
|
27
|
-
transform: scale(1.
|
|
28
|
-
box-shadow: 0 6px
|
|
38
|
+
transform: scale(1.08);
|
|
39
|
+
box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2), 0 2px 6px rgba(0, 0, 0, 0.15);
|
|
40
|
+
background: ${p};
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.pp-toggle:active {
|
|
44
|
+
transform: scale(0.95);
|
|
29
45
|
}
|
|
30
46
|
|
|
31
47
|
.pp-toggle svg {
|
|
32
|
-
width:
|
|
33
|
-
height:
|
|
48
|
+
width: 28px;
|
|
49
|
+
height: 28px;
|
|
34
50
|
}
|
|
35
51
|
|
|
36
52
|
.pp-toggle.pp-bottom-right {
|
|
@@ -81,13 +97,13 @@
|
|
|
81
97
|
|
|
82
98
|
.pp-window {
|
|
83
99
|
position: fixed;
|
|
84
|
-
width:
|
|
85
|
-
height:
|
|
100
|
+
width: 375px;
|
|
101
|
+
height: 550px;
|
|
86
102
|
max-height: calc(100vh - 100px);
|
|
87
103
|
max-height: calc(100dvh - 100px);
|
|
88
|
-
background: ${s
|
|
89
|
-
border-radius:
|
|
90
|
-
box-shadow: 0
|
|
104
|
+
background: ${s?"#111b21":"#ffffff"};
|
|
105
|
+
border-radius: 12px;
|
|
106
|
+
box-shadow: 0 12px 28px rgba(0, 0, 0, 0.2), 0 4px 10px rgba(0, 0, 0, 0.15);
|
|
91
107
|
display: flex;
|
|
92
108
|
flex-direction: column;
|
|
93
109
|
overflow: hidden;
|
|
@@ -96,12 +112,12 @@
|
|
|
96
112
|
}
|
|
97
113
|
|
|
98
114
|
.pp-window.pp-bottom-right {
|
|
99
|
-
bottom:
|
|
115
|
+
bottom: 20px;
|
|
100
116
|
right: 20px;
|
|
101
117
|
}
|
|
102
118
|
|
|
103
119
|
.pp-window.pp-bottom-left {
|
|
104
|
-
bottom:
|
|
120
|
+
bottom: 20px;
|
|
105
121
|
left: 20px;
|
|
106
122
|
}
|
|
107
123
|
|
|
@@ -110,9 +126,9 @@
|
|
|
110
126
|
width: calc(100vw - 20px);
|
|
111
127
|
height: auto;
|
|
112
128
|
min-height: 300px;
|
|
113
|
-
max-height: calc(100vh -
|
|
114
|
-
max-height: calc(100svh -
|
|
115
|
-
bottom:
|
|
129
|
+
max-height: calc(100vh - 40px);
|
|
130
|
+
max-height: calc(100svh - 40px); /* svh = small viewport, excludes keyboard */
|
|
131
|
+
bottom: 10px;
|
|
116
132
|
right: 10px;
|
|
117
133
|
left: 10px;
|
|
118
134
|
border-radius: 12px;
|
|
@@ -130,35 +146,38 @@
|
|
|
130
146
|
display: flex;
|
|
131
147
|
align-items: center;
|
|
132
148
|
justify-content: space-between;
|
|
133
|
-
padding:
|
|
134
|
-
background: ${
|
|
149
|
+
padding: 10px 16px;
|
|
150
|
+
background: ${c};
|
|
135
151
|
color: white;
|
|
136
152
|
}
|
|
137
153
|
|
|
138
154
|
.pp-header-info {
|
|
139
155
|
display: flex;
|
|
140
156
|
align-items: center;
|
|
141
|
-
gap:
|
|
157
|
+
gap: 12px;
|
|
142
158
|
}
|
|
143
159
|
|
|
144
160
|
.pp-avatar {
|
|
145
|
-
width:
|
|
146
|
-
height:
|
|
161
|
+
width: 40px;
|
|
162
|
+
height: 40px;
|
|
147
163
|
border-radius: 50%;
|
|
148
164
|
object-fit: cover;
|
|
165
|
+
border: 2px solid rgba(255, 255, 255, 0.2);
|
|
149
166
|
}
|
|
150
167
|
|
|
151
168
|
.pp-header-title {
|
|
152
|
-
font-weight:
|
|
153
|
-
font-size:
|
|
169
|
+
font-weight: 500;
|
|
170
|
+
font-size: 16px;
|
|
171
|
+
letter-spacing: 0.1px;
|
|
154
172
|
}
|
|
155
173
|
|
|
156
174
|
.pp-header-status {
|
|
157
|
-
font-size:
|
|
158
|
-
opacity: 0.
|
|
175
|
+
font-size: 13px;
|
|
176
|
+
opacity: 0.9;
|
|
159
177
|
display: flex;
|
|
160
178
|
align-items: center;
|
|
161
|
-
gap:
|
|
179
|
+
gap: 5px;
|
|
180
|
+
font-weight: 400;
|
|
162
181
|
}
|
|
163
182
|
|
|
164
183
|
.pp-status-dot {
|
|
@@ -169,7 +188,8 @@
|
|
|
169
188
|
}
|
|
170
189
|
|
|
171
190
|
.pp-status-dot.pp-online {
|
|
172
|
-
background: #
|
|
191
|
+
background: #25d366;
|
|
192
|
+
box-shadow: 0 0 0 2px rgba(37, 211, 102, 0.3);
|
|
173
193
|
}
|
|
174
194
|
|
|
175
195
|
.pp-close-btn {
|
|
@@ -177,13 +197,13 @@
|
|
|
177
197
|
border: none;
|
|
178
198
|
color: white;
|
|
179
199
|
cursor: pointer;
|
|
180
|
-
padding:
|
|
181
|
-
border-radius:
|
|
182
|
-
opacity: 0.
|
|
183
|
-
transition: opacity 0.2s;
|
|
200
|
+
padding: 8px;
|
|
201
|
+
border-radius: 50%;
|
|
202
|
+
opacity: 0.9;
|
|
203
|
+
transition: opacity 0.2s, background 0.2s;
|
|
184
204
|
flex-shrink: 0;
|
|
185
|
-
width:
|
|
186
|
-
height:
|
|
205
|
+
width: 36px;
|
|
206
|
+
height: 36px;
|
|
187
207
|
display: flex;
|
|
188
208
|
align-items: center;
|
|
189
209
|
justify-content: center;
|
|
@@ -191,157 +211,199 @@
|
|
|
191
211
|
|
|
192
212
|
.pp-close-btn:hover {
|
|
193
213
|
opacity: 1;
|
|
214
|
+
background: rgba(255, 255, 255, 0.1);
|
|
194
215
|
}
|
|
195
216
|
|
|
196
217
|
.pp-close-btn svg {
|
|
197
|
-
width:
|
|
198
|
-
height:
|
|
218
|
+
width: 18px;
|
|
219
|
+
height: 18px;
|
|
199
220
|
}
|
|
200
221
|
|
|
201
222
|
.pp-messages {
|
|
202
223
|
flex: 1;
|
|
203
224
|
overflow-y: auto;
|
|
204
|
-
padding: 12px;
|
|
225
|
+
padding: 16px 12px;
|
|
205
226
|
display: flex;
|
|
206
227
|
flex-direction: column;
|
|
207
|
-
gap:
|
|
228
|
+
gap: 2px;
|
|
229
|
+
overscroll-behavior: contain;
|
|
230
|
+
-webkit-overflow-scrolling: touch;
|
|
231
|
+
position: relative;
|
|
232
|
+
background: ${k};
|
|
233
|
+
background-image: ${w};
|
|
234
|
+
background-size: ${m};
|
|
235
|
+
background-position: center;
|
|
208
236
|
}
|
|
209
237
|
|
|
210
238
|
.pp-welcome {
|
|
211
239
|
text-align: center;
|
|
212
|
-
color: ${s
|
|
213
|
-
padding: 24px;
|
|
214
|
-
font-size:
|
|
240
|
+
color: ${s?"#8696a0":"#667781"};
|
|
241
|
+
padding: 32px 24px;
|
|
242
|
+
font-size: 14px;
|
|
243
|
+
line-height: 1.5;
|
|
244
|
+
background: ${s?"rgba(17, 27, 33, 0.9)":"rgba(255, 255, 255, 0.95)"};
|
|
245
|
+
margin: 12px;
|
|
246
|
+
border-radius: 8px;
|
|
247
|
+
box-shadow: 0 1px 0.5px rgba(0, 0, 0, 0.13);
|
|
215
248
|
}
|
|
216
249
|
|
|
217
250
|
.pp-date-separator {
|
|
218
251
|
display: flex;
|
|
219
252
|
align-items: center;
|
|
220
253
|
justify-content: center;
|
|
221
|
-
margin:
|
|
254
|
+
margin: 12px 0;
|
|
222
255
|
}
|
|
223
256
|
|
|
224
257
|
.pp-date-separator span {
|
|
225
|
-
background: ${s.
|
|
226
|
-
color: ${s
|
|
227
|
-
font-size:
|
|
228
|
-
padding:
|
|
229
|
-
border-radius:
|
|
230
|
-
font-weight:
|
|
258
|
+
background: ${s?"rgba(17, 27, 33, 0.9)":"rgba(255, 255, 255, 0.95)"};
|
|
259
|
+
color: ${s?"#8696a0":"#54656f"};
|
|
260
|
+
font-size: 12px;
|
|
261
|
+
padding: 6px 12px;
|
|
262
|
+
border-radius: 8px;
|
|
263
|
+
font-weight: 400;
|
|
264
|
+
box-shadow: 0 1px 0.5px rgba(0, 0, 0, 0.13);
|
|
265
|
+
text-transform: uppercase;
|
|
266
|
+
letter-spacing: 0.3px;
|
|
231
267
|
}
|
|
232
268
|
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
padding: 6px 10px;
|
|
236
|
-
border-radius: 12px;
|
|
237
|
-
word-wrap: break-word;
|
|
269
|
+
/* Swipe container for mobile actions */
|
|
270
|
+
.pp-message-swipe-container {
|
|
238
271
|
position: relative;
|
|
239
|
-
|
|
240
|
-
-
|
|
241
|
-
|
|
242
|
-
|
|
272
|
+
display: flex;
|
|
273
|
+
align-items: stretch;
|
|
274
|
+
overflow: visible;
|
|
275
|
+
touch-action: pan-y;
|
|
243
276
|
}
|
|
244
277
|
|
|
245
|
-
|
|
246
|
-
|
|
278
|
+
.pp-swipe-left {
|
|
279
|
+
justify-content: flex-end;
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
.pp-swipe-right {
|
|
283
|
+
justify-content: flex-start;
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
.pp-swipe-actions {
|
|
247
287
|
position: absolute;
|
|
248
|
-
top:
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
border-radius: 6px;
|
|
254
|
-
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
|
|
255
|
-
padding: 2px;
|
|
288
|
+
top: 0;
|
|
289
|
+
bottom: 0;
|
|
290
|
+
display: none; /* Hidden by default - only show on mobile with touch */
|
|
291
|
+
align-items: center;
|
|
292
|
+
gap: 4px;
|
|
256
293
|
opacity: 0;
|
|
257
|
-
|
|
258
|
-
z-index: 10;
|
|
259
|
-
/* Reset color inheritance from message */
|
|
260
|
-
color: ${s.textSecondary};
|
|
294
|
+
pointer-events: none;
|
|
261
295
|
}
|
|
262
296
|
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
297
|
+
/* Only show swipe actions on touch devices */
|
|
298
|
+
@media (hover: none) and (pointer: coarse) {
|
|
299
|
+
.pp-swipe-actions {
|
|
300
|
+
display: flex;
|
|
301
|
+
}
|
|
266
302
|
}
|
|
267
303
|
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
304
|
+
.pp-swipe-left .pp-swipe-actions {
|
|
305
|
+
right: -80px; /* Hidden off-screen to the right */
|
|
306
|
+
left: auto;
|
|
307
|
+
padding-right: 8px;
|
|
271
308
|
}
|
|
272
309
|
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
310
|
+
.pp-swipe-right .pp-swipe-actions {
|
|
311
|
+
left: -80px; /* Hidden off-screen to the left */
|
|
312
|
+
right: auto;
|
|
313
|
+
padding-left: 8px;
|
|
276
314
|
}
|
|
277
315
|
|
|
278
|
-
.pp-
|
|
279
|
-
width:
|
|
280
|
-
height:
|
|
316
|
+
.pp-swipe-action {
|
|
317
|
+
width: 32px;
|
|
318
|
+
height: 32px;
|
|
281
319
|
border: none;
|
|
282
|
-
|
|
283
|
-
border-radius: 4px;
|
|
320
|
+
border-radius: 50%;
|
|
284
321
|
cursor: pointer;
|
|
285
322
|
display: flex;
|
|
286
323
|
align-items: center;
|
|
287
324
|
justify-content: center;
|
|
288
|
-
|
|
289
|
-
transition: background 0.1s, color 0.1s;
|
|
290
|
-
}
|
|
291
|
-
|
|
292
|
-
.pp-message-actions .pp-action-btn:hover {
|
|
293
|
-
background: ${s.bgSecondary};
|
|
294
|
-
color: ${s.text} !important;
|
|
295
|
-
}
|
|
296
|
-
|
|
297
|
-
.pp-message-actions .pp-action-btn svg {
|
|
298
|
-
width: 14px;
|
|
299
|
-
height: 14px;
|
|
300
|
-
stroke: ${s.textSecondary};
|
|
325
|
+
opacity: 0.9;
|
|
301
326
|
}
|
|
302
327
|
|
|
303
|
-
.pp-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
.pp-message-actions .pp-action-delete:hover {
|
|
308
|
-
background: #fef2f2;
|
|
328
|
+
.pp-swipe-action svg {
|
|
329
|
+
width: 16px;
|
|
330
|
+
height: 16px;
|
|
309
331
|
}
|
|
310
332
|
|
|
311
|
-
.pp-
|
|
312
|
-
|
|
333
|
+
.pp-swipe-reply {
|
|
334
|
+
background: ${e};
|
|
313
335
|
}
|
|
314
336
|
|
|
315
|
-
.pp-
|
|
316
|
-
background: #
|
|
337
|
+
.pp-swipe-edit {
|
|
338
|
+
background: #3b82f6;
|
|
317
339
|
}
|
|
318
340
|
|
|
319
|
-
.pp-
|
|
320
|
-
|
|
341
|
+
.pp-swipe-delete {
|
|
342
|
+
background: #ef4444;
|
|
321
343
|
}
|
|
322
344
|
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
345
|
+
.pp-message {
|
|
346
|
+
max-width: 80%;
|
|
347
|
+
padding: 6px 8px 6px 9px;
|
|
348
|
+
border-radius: 8px;
|
|
349
|
+
word-wrap: break-word;
|
|
350
|
+
overflow-wrap: break-word;
|
|
351
|
+
position: relative;
|
|
352
|
+
user-select: text;
|
|
353
|
+
-webkit-user-select: text;
|
|
354
|
+
font-size: 14.2px;
|
|
355
|
+
line-height: 1.4;
|
|
356
|
+
display: block; /* Block for proper float behavior */
|
|
357
|
+
will-change: transform;
|
|
358
|
+
box-shadow: 0 1px 0.5px rgba(0, 0, 0, 0.13);
|
|
328
359
|
}
|
|
329
360
|
|
|
330
361
|
.pp-message-visitor {
|
|
331
362
|
align-self: flex-end;
|
|
332
|
-
background: ${
|
|
333
|
-
color:
|
|
334
|
-
border-
|
|
335
|
-
|
|
363
|
+
background: ${s?"#005c4b":"#d9fdd3"};
|
|
364
|
+
color: ${s?"#e9edef":"#111b21"};
|
|
365
|
+
border-top-right-radius: 8px;
|
|
366
|
+
border-top-left-radius: 8px;
|
|
367
|
+
border-bottom-left-radius: 8px;
|
|
368
|
+
border-bottom-right-radius: 0;
|
|
369
|
+
margin-left: 48px;
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
/* WhatsApp-style tail for visitor messages */
|
|
373
|
+
.pp-message-visitor::after {
|
|
374
|
+
content: '';
|
|
375
|
+
position: absolute;
|
|
376
|
+
right: -7px;
|
|
377
|
+
bottom: 0;
|
|
378
|
+
width: 8px;
|
|
379
|
+
height: 13px;
|
|
380
|
+
background: ${s?"#005c4b":"#d9fdd3"};
|
|
381
|
+
clip-path: path('M 0 0 L 0 13 L 8 13 Q 2 10 0 0');
|
|
336
382
|
}
|
|
337
383
|
|
|
338
384
|
.pp-message-operator,
|
|
339
385
|
.pp-message-ai {
|
|
340
386
|
align-self: flex-start;
|
|
341
|
-
background: ${s
|
|
342
|
-
color: ${s
|
|
343
|
-
border-
|
|
344
|
-
|
|
387
|
+
background: ${s?"#202c33":"#ffffff"};
|
|
388
|
+
color: ${s?"#e9edef":"#111b21"};
|
|
389
|
+
border-top-right-radius: 8px;
|
|
390
|
+
border-top-left-radius: 8px;
|
|
391
|
+
border-bottom-right-radius: 8px;
|
|
392
|
+
border-bottom-left-radius: 0;
|
|
393
|
+
margin-right: 48px;
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
/* WhatsApp-style tail for operator messages */
|
|
397
|
+
.pp-message-operator::after,
|
|
398
|
+
.pp-message-ai::after {
|
|
399
|
+
content: '';
|
|
400
|
+
position: absolute;
|
|
401
|
+
left: -7px;
|
|
402
|
+
bottom: 0;
|
|
403
|
+
width: 8px;
|
|
404
|
+
height: 13px;
|
|
405
|
+
background: ${s?"#202c33":"#ffffff"};
|
|
406
|
+
clip-path: path('M 8 0 L 8 13 L 0 13 Q 6 10 8 0');
|
|
345
407
|
}
|
|
346
408
|
|
|
347
409
|
/* Add spacing between different senders */
|
|
@@ -356,23 +418,38 @@
|
|
|
356
418
|
display: inline;
|
|
357
419
|
}
|
|
358
420
|
|
|
421
|
+
/* WhatsApp-style inline timestamp - floats to the right */
|
|
359
422
|
.pp-message-time {
|
|
360
|
-
font-size:
|
|
361
|
-
opacity: 0.6;
|
|
423
|
+
font-size: 11px;
|
|
362
424
|
display: inline-flex;
|
|
363
425
|
align-items: center;
|
|
364
426
|
gap: 3px;
|
|
365
427
|
float: right;
|
|
366
|
-
margin
|
|
428
|
+
margin: 3px 0 0 12px;
|
|
429
|
+
color: ${s?"rgba(255,255,255,0.6)":"rgba(0,0,0,0.45)"};
|
|
430
|
+
white-space: nowrap;
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
.pp-message-visitor .pp-message-time {
|
|
434
|
+
color: ${s?"rgba(255,255,255,0.7)":"rgba(0,0,0,0.45)"};
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
/* Timestamp for attachment-only messages */
|
|
438
|
+
.pp-attachment-time {
|
|
439
|
+
float: none;
|
|
440
|
+
display: flex;
|
|
441
|
+
justify-content: flex-end;
|
|
367
442
|
margin-top: 4px;
|
|
368
443
|
}
|
|
369
444
|
|
|
370
445
|
.pp-ai-badge {
|
|
371
|
-
background: rgba(0, 0, 0, 0.
|
|
372
|
-
padding:
|
|
446
|
+
background: ${s?"rgba(255,255,255,0.15)":"rgba(0, 0, 0, 0.08)"};
|
|
447
|
+
padding: 2px 5px;
|
|
373
448
|
border-radius: 4px;
|
|
374
|
-
font-size:
|
|
449
|
+
font-size: 9px;
|
|
375
450
|
font-weight: 600;
|
|
451
|
+
text-transform: uppercase;
|
|
452
|
+
letter-spacing: 0.3px;
|
|
376
453
|
}
|
|
377
454
|
|
|
378
455
|
.pp-status {
|
|
@@ -388,11 +465,11 @@
|
|
|
388
465
|
|
|
389
466
|
.pp-check,
|
|
390
467
|
.pp-check-double {
|
|
391
|
-
stroke: rgba(255, 255, 255, 0.
|
|
468
|
+
stroke: ${s?"rgba(255, 255, 255, 0.5)":"rgba(0, 0, 0, 0.35)"};
|
|
392
469
|
}
|
|
393
470
|
|
|
394
471
|
.pp-check-read {
|
|
395
|
-
stroke: #
|
|
472
|
+
stroke: #53bdeb;
|
|
396
473
|
}
|
|
397
474
|
|
|
398
475
|
.pp-status-sending .pp-check {
|
|
@@ -401,14 +478,15 @@
|
|
|
401
478
|
|
|
402
479
|
.pp-typing {
|
|
403
480
|
display: flex;
|
|
404
|
-
gap:
|
|
405
|
-
padding:
|
|
481
|
+
gap: 4px;
|
|
482
|
+
padding: 12px 14px;
|
|
483
|
+
align-items: center;
|
|
406
484
|
}
|
|
407
485
|
|
|
408
486
|
.pp-typing span {
|
|
409
|
-
width:
|
|
410
|
-
height:
|
|
411
|
-
background: ${s
|
|
487
|
+
width: 7px;
|
|
488
|
+
height: 7px;
|
|
489
|
+
background: ${s?"#8696a0":"#667781"};
|
|
412
490
|
border-radius: 50%;
|
|
413
491
|
animation: pp-bounce 1.4s infinite ease-in-out both;
|
|
414
492
|
}
|
|
@@ -423,57 +501,56 @@
|
|
|
423
501
|
|
|
424
502
|
.pp-input-form {
|
|
425
503
|
display: flex;
|
|
426
|
-
padding: 10px
|
|
504
|
+
padding: 8px 10px;
|
|
427
505
|
gap: 8px;
|
|
428
|
-
|
|
506
|
+
background: ${l};
|
|
429
507
|
align-items: center;
|
|
430
508
|
}
|
|
431
509
|
|
|
432
510
|
.pp-input {
|
|
433
511
|
flex: 1;
|
|
434
512
|
min-width: 0;
|
|
435
|
-
height:
|
|
436
|
-
line-height:
|
|
437
|
-
padding: 0
|
|
438
|
-
border:
|
|
439
|
-
border-radius:
|
|
440
|
-
background: ${s
|
|
441
|
-
color: ${s
|
|
442
|
-
font-size:
|
|
513
|
+
height: 42px;
|
|
514
|
+
line-height: 42px;
|
|
515
|
+
padding: 0 14px;
|
|
516
|
+
border: none;
|
|
517
|
+
border-radius: 8px;
|
|
518
|
+
background: ${s?"#2a3942":"#ffffff"};
|
|
519
|
+
color: ${s?"#e9edef":"#111b21"};
|
|
520
|
+
font-size: 15px;
|
|
443
521
|
outline: none;
|
|
444
|
-
transition: border-color 0.2s;
|
|
445
522
|
box-sizing: border-box;
|
|
446
523
|
margin: 0;
|
|
447
524
|
}
|
|
448
525
|
|
|
449
526
|
.pp-input:focus {
|
|
450
|
-
|
|
527
|
+
outline: none;
|
|
451
528
|
}
|
|
452
529
|
|
|
453
530
|
.pp-input::placeholder {
|
|
454
|
-
color: ${s
|
|
531
|
+
color: ${s?"#8696a0":"#667781"};
|
|
455
532
|
}
|
|
456
533
|
|
|
457
534
|
.pp-send-btn {
|
|
458
|
-
width:
|
|
459
|
-
height:
|
|
460
|
-
min-width:
|
|
535
|
+
width: 42px;
|
|
536
|
+
height: 42px;
|
|
537
|
+
min-width: 42px;
|
|
461
538
|
border-radius: 50%;
|
|
462
|
-
background:
|
|
539
|
+
background: #00a884;
|
|
463
540
|
color: white;
|
|
464
541
|
border: none;
|
|
465
542
|
cursor: pointer;
|
|
466
543
|
display: flex;
|
|
467
544
|
align-items: center;
|
|
468
545
|
justify-content: center;
|
|
469
|
-
transition:
|
|
546
|
+
transition: background 0.2s, transform 0.1s;
|
|
470
547
|
flex-shrink: 0;
|
|
471
548
|
margin: 0;
|
|
472
549
|
padding: 0;
|
|
473
550
|
}
|
|
474
551
|
|
|
475
552
|
.pp-send-btn:not(:disabled):hover {
|
|
476
|
-
|
|
553
|
+
background: #008f72;
|
|
477
554
|
}
|
|
478
555
|
|
|
479
556
|
.pp-send-btn:not(:disabled):active {
|
|
@@ -481,27 +558,27 @@
|
|
|
481
558
|
}
|
|
482
559
|
|
|
483
560
|
.pp-send-btn:disabled {
|
|
484
|
-
|
|
561
|
+
background: ${s?"#3b4a54":"#b3b3b3"};
|
|
485
562
|
cursor: not-allowed;
|
|
486
563
|
}
|
|
487
564
|
|
|
488
565
|
.pp-send-btn svg {
|
|
489
|
-
width:
|
|
490
|
-
height:
|
|
566
|
+
width: 20px;
|
|
567
|
+
height: 20px;
|
|
491
568
|
}
|
|
492
569
|
|
|
493
570
|
.pp-footer {
|
|
494
571
|
text-align: center;
|
|
495
|
-
padding: 8px;
|
|
496
|
-
font-size:
|
|
497
|
-
color: ${s
|
|
498
|
-
|
|
499
|
-
opacity: 0.7;
|
|
572
|
+
padding: 6px 8px;
|
|
573
|
+
font-size: 10px;
|
|
574
|
+
color: ${s?"#8696a0":"#667781"};
|
|
575
|
+
background: ${l};
|
|
500
576
|
}
|
|
501
577
|
|
|
502
578
|
.pp-footer a {
|
|
503
|
-
color: ${
|
|
579
|
+
color: ${s?"#00a884":"#008069"};
|
|
504
580
|
text-decoration: none;
|
|
581
|
+
font-weight: 500;
|
|
505
582
|
}
|
|
506
583
|
|
|
507
584
|
.pp-footer a:hover {
|
|
@@ -523,26 +600,26 @@
|
|
|
523
600
|
}
|
|
524
601
|
|
|
525
602
|
.pp-attach-btn {
|
|
526
|
-
width:
|
|
527
|
-
height:
|
|
528
|
-
min-width:
|
|
603
|
+
width: 42px;
|
|
604
|
+
height: 42px;
|
|
605
|
+
min-width: 42px;
|
|
529
606
|
border-radius: 50%;
|
|
530
607
|
background: transparent;
|
|
531
|
-
color: ${s
|
|
532
|
-
border:
|
|
608
|
+
color: ${s?"#8696a0":"#54656f"};
|
|
609
|
+
border: none;
|
|
533
610
|
cursor: pointer;
|
|
534
611
|
display: flex;
|
|
535
612
|
align-items: center;
|
|
536
613
|
justify-content: center;
|
|
537
614
|
margin: 0;
|
|
538
615
|
padding: 0;
|
|
539
|
-
transition: color 0.2s,
|
|
616
|
+
transition: color 0.2s, background 0.2s;
|
|
540
617
|
flex-shrink: 0;
|
|
541
618
|
}
|
|
542
619
|
|
|
543
620
|
.pp-attach-btn:hover:not(:disabled) {
|
|
544
|
-
color: ${
|
|
545
|
-
|
|
621
|
+
color: ${s?"#aebac1":"#3b4a54"};
|
|
622
|
+
background: ${s?"rgba(255,255,255,0.05)":"rgba(0,0,0,0.05)"};
|
|
546
623
|
}
|
|
547
624
|
|
|
548
625
|
.pp-attach-btn:disabled {
|
|
@@ -551,28 +628,27 @@
|
|
|
551
628
|
}
|
|
552
629
|
|
|
553
630
|
.pp-attach-btn svg {
|
|
554
|
-
width:
|
|
555
|
-
height:
|
|
631
|
+
width: 22px;
|
|
632
|
+
height: 22px;
|
|
556
633
|
}
|
|
557
634
|
|
|
558
635
|
.pp-attachments-preview {
|
|
559
636
|
display: flex;
|
|
560
637
|
gap: 8px;
|
|
561
|
-
padding:
|
|
562
|
-
border-top: 1px solid ${s.border};
|
|
638
|
+
padding: 10px 12px;
|
|
563
639
|
overflow-x: auto;
|
|
564
|
-
background: ${
|
|
640
|
+
background: ${l};
|
|
565
641
|
}
|
|
566
642
|
|
|
567
643
|
.pp-attachment-preview {
|
|
568
644
|
position: relative;
|
|
569
|
-
width:
|
|
570
|
-
height:
|
|
571
|
-
border-radius:
|
|
645
|
+
width: 64px;
|
|
646
|
+
height: 64px;
|
|
647
|
+
border-radius: 10px;
|
|
572
648
|
overflow: hidden;
|
|
573
649
|
flex-shrink: 0;
|
|
574
|
-
background: ${s
|
|
575
|
-
|
|
650
|
+
background: ${s?"#2a3942":"#ffffff"};
|
|
651
|
+
box-shadow: 0 1px 2px rgba(0,0,0,0.1);
|
|
576
652
|
}
|
|
577
653
|
|
|
578
654
|
.pp-preview-img {
|
|
@@ -587,7 +663,7 @@
|
|
|
587
663
|
display: flex;
|
|
588
664
|
align-items: center;
|
|
589
665
|
justify-content: center;
|
|
590
|
-
color: ${
|
|
666
|
+
color: ${g.textSecondary};
|
|
591
667
|
}
|
|
592
668
|
|
|
593
669
|
.pp-preview-file svg {
|
|
@@ -622,7 +698,7 @@
|
|
|
622
698
|
bottom: 0;
|
|
623
699
|
left: 0;
|
|
624
700
|
height: 3px;
|
|
625
|
-
background: ${
|
|
701
|
+
background: ${e};
|
|
626
702
|
transition: width 0.1s;
|
|
627
703
|
}
|
|
628
704
|
|
|
@@ -656,7 +732,10 @@
|
|
|
656
732
|
display: flex;
|
|
657
733
|
flex-direction: column;
|
|
658
734
|
gap: 8px;
|
|
659
|
-
margin-top:
|
|
735
|
+
margin-top: 6px;
|
|
736
|
+
max-width: 100%;
|
|
737
|
+
align-items: flex-start;
|
|
738
|
+
flex-shrink: 0;
|
|
660
739
|
}
|
|
661
740
|
|
|
662
741
|
.pp-attachment {
|
|
@@ -667,11 +746,22 @@
|
|
|
667
746
|
overflow: hidden;
|
|
668
747
|
}
|
|
669
748
|
|
|
749
|
+
.pp-attachment-image,
|
|
750
|
+
.pp-attachment-video,
|
|
751
|
+
.pp-attachment-audio {
|
|
752
|
+
width: 240px;
|
|
753
|
+
max-width: 100%;
|
|
754
|
+
}
|
|
755
|
+
|
|
670
756
|
.pp-attachment-image img {
|
|
671
|
-
|
|
757
|
+
width: 100% !important;
|
|
758
|
+
height: auto !important;
|
|
759
|
+
max-width: 240px;
|
|
672
760
|
max-height: 200px;
|
|
673
761
|
border-radius: 8px;
|
|
674
762
|
display: block;
|
|
763
|
+
object-fit: cover !important;
|
|
764
|
+
object-position: center;
|
|
675
765
|
}
|
|
676
766
|
|
|
677
767
|
.pp-attachment-audio {
|
|
@@ -681,7 +771,8 @@
|
|
|
681
771
|
}
|
|
682
772
|
|
|
683
773
|
.pp-attachment-audio audio {
|
|
684
|
-
width:
|
|
774
|
+
width: 240px;
|
|
775
|
+
max-width: 100%;
|
|
685
776
|
height: 36px;
|
|
686
777
|
}
|
|
687
778
|
|
|
@@ -691,14 +782,18 @@
|
|
|
691
782
|
white-space: nowrap;
|
|
692
783
|
overflow: hidden;
|
|
693
784
|
text-overflow: ellipsis;
|
|
694
|
-
max-width:
|
|
785
|
+
max-width: 100%;
|
|
695
786
|
}
|
|
696
787
|
|
|
697
788
|
.pp-attachment-video video {
|
|
698
|
-
|
|
699
|
-
|
|
789
|
+
width: 100% !important;
|
|
790
|
+
height: auto !important;
|
|
791
|
+
max-width: 240px;
|
|
792
|
+
max-height: none;
|
|
700
793
|
border-radius: 8px;
|
|
701
794
|
display: block;
|
|
795
|
+
object-fit: contain !important;
|
|
796
|
+
object-position: center;
|
|
702
797
|
}
|
|
703
798
|
|
|
704
799
|
.pp-attachment-file {
|
|
@@ -706,13 +801,13 @@
|
|
|
706
801
|
align-items: center;
|
|
707
802
|
gap: 8px;
|
|
708
803
|
padding: 8px 12px;
|
|
709
|
-
background: ${
|
|
804
|
+
background: ${s?"rgba(255,255,255,0.1)":"rgba(0,0,0,0.05)"};
|
|
710
805
|
border-radius: 8px;
|
|
711
806
|
transition: background 0.2s;
|
|
712
807
|
}
|
|
713
808
|
|
|
714
809
|
.pp-attachment-file:hover {
|
|
715
|
-
background: ${
|
|
810
|
+
background: ${s?"rgba(255,255,255,0.15)":"rgba(0,0,0,0.08)"};
|
|
716
811
|
}
|
|
717
812
|
|
|
718
813
|
.pp-attachment-file svg {
|
|
@@ -747,81 +842,86 @@
|
|
|
747
842
|
.pp-drop-overlay {
|
|
748
843
|
position: absolute;
|
|
749
844
|
inset: 0;
|
|
750
|
-
background: ${
|
|
845
|
+
background: ${s?"rgba(17, 27, 33, 0.95)":"rgba(255,255,255,0.97)"};
|
|
751
846
|
display: flex;
|
|
752
847
|
flex-direction: column;
|
|
753
848
|
align-items: center;
|
|
754
849
|
justify-content: center;
|
|
755
|
-
gap:
|
|
850
|
+
gap: 16px;
|
|
756
851
|
z-index: 100;
|
|
757
|
-
border: 3px dashed
|
|
758
|
-
border-radius:
|
|
852
|
+
border: 3px dashed #00a884;
|
|
853
|
+
border-radius: 12px;
|
|
759
854
|
margin: 4px;
|
|
760
855
|
pointer-events: none;
|
|
761
856
|
}
|
|
762
857
|
|
|
763
858
|
.pp-drop-icon svg {
|
|
764
|
-
width:
|
|
765
|
-
height:
|
|
766
|
-
color:
|
|
859
|
+
width: 56px;
|
|
860
|
+
height: 56px;
|
|
861
|
+
color: #00a884;
|
|
767
862
|
}
|
|
768
863
|
|
|
769
864
|
.pp-drop-text {
|
|
770
|
-
font-size:
|
|
865
|
+
font-size: 17px;
|
|
771
866
|
font-weight: 500;
|
|
772
|
-
color: ${s
|
|
867
|
+
color: ${s?"#e9edef":"#111b21"};
|
|
773
868
|
}
|
|
774
869
|
|
|
775
870
|
/* Message Context Menu */
|
|
776
871
|
.pp-message-menu {
|
|
777
872
|
position: fixed;
|
|
778
|
-
background: ${s
|
|
779
|
-
border:
|
|
780
|
-
border-radius:
|
|
781
|
-
box-shadow: 0
|
|
782
|
-
padding:
|
|
873
|
+
background: ${s?"#233138":"#ffffff"};
|
|
874
|
+
border: none;
|
|
875
|
+
border-radius: 12px;
|
|
876
|
+
box-shadow: 0 8px 24px rgba(0,0,0,0.2), 0 2px 8px rgba(0,0,0,0.1);
|
|
877
|
+
padding: 6px;
|
|
783
878
|
z-index: 200;
|
|
784
|
-
min-width:
|
|
879
|
+
min-width: 140px;
|
|
785
880
|
}
|
|
786
881
|
|
|
787
882
|
.pp-message-menu button {
|
|
788
883
|
display: flex;
|
|
789
884
|
align-items: center;
|
|
790
|
-
gap:
|
|
885
|
+
gap: 10px;
|
|
791
886
|
width: 100%;
|
|
792
|
-
padding:
|
|
887
|
+
padding: 10px 14px;
|
|
793
888
|
border: none;
|
|
794
889
|
background: transparent;
|
|
795
|
-
color: ${s
|
|
796
|
-
font-size:
|
|
890
|
+
color: ${s?"#e9edef":"#111b21"};
|
|
891
|
+
font-size: 14px;
|
|
797
892
|
cursor: pointer;
|
|
798
|
-
border-radius:
|
|
893
|
+
border-radius: 8px;
|
|
799
894
|
text-align: left;
|
|
895
|
+
transition: background 0.15s;
|
|
800
896
|
}
|
|
801
897
|
|
|
802
898
|
.pp-message-menu button:hover {
|
|
803
|
-
background: ${
|
|
899
|
+
background: ${s?"rgba(255,255,255,0.08)":"rgba(0,0,0,0.05)"};
|
|
804
900
|
}
|
|
805
901
|
|
|
806
902
|
.pp-message-menu button svg {
|
|
807
|
-
width:
|
|
808
|
-
height:
|
|
903
|
+
width: 18px;
|
|
904
|
+
height: 18px;
|
|
809
905
|
}
|
|
810
906
|
|
|
811
907
|
.pp-menu-delete {
|
|
812
908
|
color: #ef4444 !important;
|
|
813
909
|
}
|
|
814
910
|
|
|
911
|
+
.pp-menu-delete:hover {
|
|
912
|
+
background: ${s?"rgba(239,68,68,0.15)":"rgba(239,68,68,0.08)"} !important;
|
|
913
|
+
}
|
|
914
|
+
|
|
815
915
|
/* Edit Modal */
|
|
816
916
|
.pp-edit-modal {
|
|
817
917
|
position: absolute;
|
|
818
918
|
bottom: 80px;
|
|
819
919
|
left: 12px;
|
|
820
920
|
right: 12px;
|
|
821
|
-
background: ${s
|
|
822
|
-
border:
|
|
921
|
+
background: ${s?"#233138":"#ffffff"};
|
|
922
|
+
border: none;
|
|
823
923
|
border-radius: 12px;
|
|
824
|
-
box-shadow: 0
|
|
924
|
+
box-shadow: 0 8px 28px rgba(0,0,0,0.25), 0 2px 8px rgba(0,0,0,0.1);
|
|
825
925
|
z-index: 150;
|
|
826
926
|
overflow: hidden;
|
|
827
927
|
}
|
|
@@ -830,17 +930,24 @@
|
|
|
830
930
|
display: flex;
|
|
831
931
|
justify-content: space-between;
|
|
832
932
|
align-items: center;
|
|
833
|
-
padding:
|
|
834
|
-
border-bottom: 1px solid ${s.
|
|
933
|
+
padding: 14px 16px;
|
|
934
|
+
border-bottom: 1px solid ${s?"rgba(255,255,255,0.1)":"rgba(0,0,0,0.08)"};
|
|
835
935
|
font-weight: 500;
|
|
936
|
+
color: ${s?"#e9edef":"#111b21"};
|
|
836
937
|
}
|
|
837
938
|
|
|
838
939
|
.pp-edit-header button {
|
|
839
940
|
background: transparent;
|
|
840
941
|
border: none;
|
|
841
|
-
color: ${s
|
|
942
|
+
color: ${s?"#8696a0":"#667781"};
|
|
842
943
|
cursor: pointer;
|
|
843
|
-
padding:
|
|
944
|
+
padding: 6px;
|
|
945
|
+
border-radius: 50%;
|
|
946
|
+
transition: background 0.15s;
|
|
947
|
+
}
|
|
948
|
+
|
|
949
|
+
.pp-edit-header button:hover {
|
|
950
|
+
background: ${s?"rgba(255,255,255,0.1)":"rgba(0,0,0,0.05)"};
|
|
844
951
|
}
|
|
845
952
|
|
|
846
953
|
.pp-edit-header button svg {
|
|
@@ -850,46 +957,62 @@
|
|
|
850
957
|
|
|
851
958
|
.pp-edit-input {
|
|
852
959
|
width: 100%;
|
|
853
|
-
padding:
|
|
960
|
+
padding: 14px 16px;
|
|
854
961
|
border: none;
|
|
855
962
|
background: transparent;
|
|
856
|
-
color: ${s
|
|
857
|
-
font-size:
|
|
963
|
+
color: ${s?"#e9edef":"#111b21"};
|
|
964
|
+
font-size: 15px;
|
|
858
965
|
resize: none;
|
|
859
966
|
min-height: 80px;
|
|
860
967
|
outline: none;
|
|
968
|
+
line-height: 1.5;
|
|
969
|
+
}
|
|
970
|
+
|
|
971
|
+
.pp-edit-input::placeholder {
|
|
972
|
+
color: ${s?"#8696a0":"#667781"};
|
|
861
973
|
}
|
|
862
974
|
|
|
863
975
|
.pp-edit-actions {
|
|
864
976
|
display: flex;
|
|
865
977
|
justify-content: flex-end;
|
|
866
|
-
gap:
|
|
978
|
+
gap: 10px;
|
|
867
979
|
padding: 12px 16px;
|
|
868
|
-
border-top: 1px solid ${s.
|
|
980
|
+
border-top: 1px solid ${s?"rgba(255,255,255,0.1)":"rgba(0,0,0,0.08)"};
|
|
869
981
|
}
|
|
870
982
|
|
|
871
983
|
.pp-edit-cancel {
|
|
872
|
-
padding:
|
|
873
|
-
border:
|
|
874
|
-
border-radius:
|
|
875
|
-
background:
|
|
876
|
-
color: ${s
|
|
877
|
-
font-size:
|
|
984
|
+
padding: 10px 20px;
|
|
985
|
+
border: none;
|
|
986
|
+
border-radius: 8px;
|
|
987
|
+
background: ${s?"rgba(255,255,255,0.1)":"rgba(0,0,0,0.05)"};
|
|
988
|
+
color: ${s?"#e9edef":"#111b21"};
|
|
989
|
+
font-size: 14px;
|
|
878
990
|
cursor: pointer;
|
|
991
|
+
transition: background 0.15s;
|
|
992
|
+
}
|
|
993
|
+
|
|
994
|
+
.pp-edit-cancel:hover {
|
|
995
|
+
background: ${s?"rgba(255,255,255,0.15)":"rgba(0,0,0,0.08)"};
|
|
879
996
|
}
|
|
880
997
|
|
|
881
998
|
.pp-edit-save {
|
|
882
|
-
padding:
|
|
999
|
+
padding: 10px 20px;
|
|
883
1000
|
border: none;
|
|
884
|
-
border-radius:
|
|
885
|
-
background:
|
|
1001
|
+
border-radius: 8px;
|
|
1002
|
+
background: #00a884;
|
|
886
1003
|
color: white;
|
|
887
|
-
font-size:
|
|
1004
|
+
font-size: 14px;
|
|
1005
|
+
font-weight: 500;
|
|
888
1006
|
cursor: pointer;
|
|
1007
|
+
transition: background 0.15s;
|
|
1008
|
+
}
|
|
1009
|
+
|
|
1010
|
+
.pp-edit-save:hover:not(:disabled) {
|
|
1011
|
+
background: #008f72;
|
|
889
1012
|
}
|
|
890
1013
|
|
|
891
1014
|
.pp-edit-save:disabled {
|
|
892
|
-
|
|
1015
|
+
background: ${s?"#3b4a54":"#b3b3b3"};
|
|
893
1016
|
cursor: not-allowed;
|
|
894
1017
|
}
|
|
895
1018
|
|
|
@@ -897,11 +1020,10 @@
|
|
|
897
1020
|
.pp-reply-preview {
|
|
898
1021
|
display: flex;
|
|
899
1022
|
align-items: center;
|
|
900
|
-
gap:
|
|
1023
|
+
gap: 10px;
|
|
901
1024
|
padding: 8px 12px;
|
|
902
|
-
background: ${
|
|
903
|
-
border-
|
|
904
|
-
border-left: 3px solid ${t};
|
|
1025
|
+
background: ${l};
|
|
1026
|
+
border-left: 4px solid #00a884;
|
|
905
1027
|
}
|
|
906
1028
|
|
|
907
1029
|
.pp-reply-preview-content {
|
|
@@ -911,55 +1033,56 @@
|
|
|
911
1033
|
|
|
912
1034
|
.pp-reply-label {
|
|
913
1035
|
display: block;
|
|
914
|
-
font-size:
|
|
915
|
-
color:
|
|
1036
|
+
font-size: 12px;
|
|
1037
|
+
color: #00a884;
|
|
916
1038
|
font-weight: 500;
|
|
917
1039
|
margin-bottom: 2px;
|
|
918
1040
|
}
|
|
919
1041
|
|
|
920
1042
|
.pp-reply-text {
|
|
921
1043
|
display: block;
|
|
922
|
-
font-size:
|
|
923
|
-
color: ${s
|
|
1044
|
+
font-size: 13px;
|
|
1045
|
+
color: ${s?"#8696a0":"#667781"};
|
|
924
1046
|
white-space: nowrap;
|
|
925
1047
|
overflow: hidden;
|
|
926
1048
|
text-overflow: ellipsis;
|
|
927
1049
|
}
|
|
928
1050
|
|
|
929
1051
|
.pp-reply-cancel {
|
|
930
|
-
background:
|
|
1052
|
+
background: transparent;
|
|
931
1053
|
border: none;
|
|
932
1054
|
border-radius: 50%;
|
|
933
|
-
color: ${s
|
|
1055
|
+
color: ${s?"#8696a0":"#667781"};
|
|
934
1056
|
cursor: pointer;
|
|
935
1057
|
padding: 0;
|
|
936
|
-
width:
|
|
937
|
-
height:
|
|
938
|
-
min-width:
|
|
1058
|
+
width: 28px;
|
|
1059
|
+
height: 28px;
|
|
1060
|
+
min-width: 28px;
|
|
939
1061
|
display: flex;
|
|
940
1062
|
align-items: center;
|
|
941
1063
|
justify-content: center;
|
|
942
1064
|
flex-shrink: 0;
|
|
943
|
-
transition: background 0.15s;
|
|
1065
|
+
transition: background 0.15s, color 0.15s;
|
|
944
1066
|
}
|
|
945
1067
|
|
|
946
1068
|
.pp-reply-cancel:hover {
|
|
947
|
-
background: ${
|
|
1069
|
+
background: ${s?"rgba(255,255,255,0.1)":"rgba(0,0,0,0.08)"};
|
|
1070
|
+
color: ${s?"#aebac1":"#3b4a54"};
|
|
948
1071
|
}
|
|
949
1072
|
|
|
950
1073
|
.pp-reply-cancel svg {
|
|
951
|
-
width:
|
|
952
|
-
height:
|
|
1074
|
+
width: 16px;
|
|
1075
|
+
height: 16px;
|
|
953
1076
|
}
|
|
954
1077
|
|
|
955
1078
|
/* Reply Quote in Message */
|
|
956
1079
|
.pp-reply-quote {
|
|
957
|
-
background: ${
|
|
958
|
-
border-left:
|
|
959
|
-
padding:
|
|
960
|
-
margin-bottom:
|
|
961
|
-
border-radius: 0
|
|
962
|
-
font-size:
|
|
1080
|
+
background: ${s?"rgba(0,0,0,0.2)":"rgba(0,0,0,0.05)"};
|
|
1081
|
+
border-left: 3px solid #00a884;
|
|
1082
|
+
padding: 6px 10px;
|
|
1083
|
+
margin-bottom: 4px;
|
|
1084
|
+
border-radius: 0 6px 6px 0;
|
|
1085
|
+
font-size: 13px;
|
|
963
1086
|
position: relative;
|
|
964
1087
|
z-index: 1;
|
|
965
1088
|
}
|
|
@@ -967,13 +1090,14 @@
|
|
|
967
1090
|
.pp-reply-sender {
|
|
968
1091
|
display: block;
|
|
969
1092
|
font-weight: 500;
|
|
970
|
-
color:
|
|
1093
|
+
color: #00a884;
|
|
971
1094
|
margin-bottom: 2px;
|
|
1095
|
+
font-size: 12px;
|
|
972
1096
|
}
|
|
973
1097
|
|
|
974
1098
|
.pp-reply-content {
|
|
975
1099
|
display: block;
|
|
976
|
-
color: ${s
|
|
1100
|
+
color: ${s?"#8696a0":"#667781"};
|
|
977
1101
|
white-space: nowrap;
|
|
978
1102
|
overflow: hidden;
|
|
979
1103
|
text-overflow: ellipsis;
|
|
@@ -982,30 +1106,33 @@
|
|
|
982
1106
|
/* Clickable reply quote */
|
|
983
1107
|
.pp-reply-quote-clickable {
|
|
984
1108
|
cursor: pointer;
|
|
985
|
-
transition: background 0.15s
|
|
1109
|
+
transition: background 0.15s;
|
|
986
1110
|
}
|
|
987
1111
|
|
|
988
1112
|
.pp-reply-quote-clickable:hover {
|
|
989
|
-
background: ${
|
|
1113
|
+
background: ${s?"rgba(0,0,0,0.3)":"rgba(0,0,0,0.08)"};
|
|
990
1114
|
}
|
|
991
1115
|
|
|
992
1116
|
.pp-reply-quote-clickable:active {
|
|
993
|
-
transform: scale(0.
|
|
1117
|
+
transform: scale(0.99);
|
|
994
1118
|
}
|
|
995
1119
|
|
|
996
1120
|
/* Reply quote in visitor message bubble needs higher contrast */
|
|
997
1121
|
.pp-message-visitor .pp-reply-quote {
|
|
998
|
-
background: rgba(
|
|
999
|
-
border-left-color: rgba(255,
|
|
1122
|
+
background: ${s?"rgba(0,0,0,0.2)":"rgba(0,0,0,0.08)"};
|
|
1123
|
+
border-left-color: ${s?"rgba(255,255,255,0.5)":"#00a884"};
|
|
1000
1124
|
}
|
|
1001
1125
|
|
|
1002
1126
|
.pp-message-visitor .pp-reply-quote-clickable:hover {
|
|
1003
|
-
background: rgba(
|
|
1127
|
+
background: ${s?"rgba(0,0,0,0.3)":"rgba(0,0,0,0.12)"};
|
|
1128
|
+
}
|
|
1129
|
+
|
|
1130
|
+
.pp-message-visitor .pp-reply-sender {
|
|
1131
|
+
color: ${s?"rgba(255,255,255,0.9)":"#00a884"};
|
|
1004
1132
|
}
|
|
1005
1133
|
|
|
1006
|
-
.pp-message-visitor .pp-reply-sender,
|
|
1007
1134
|
.pp-message-visitor .pp-reply-content {
|
|
1008
|
-
color: rgba(255,
|
|
1135
|
+
color: ${s?"rgba(255,255,255,0.7)":"rgba(0,0,0,0.6)"};
|
|
1009
1136
|
}
|
|
1010
1137
|
|
|
1011
1138
|
/* Message highlight animation (when scrolling to a message) */
|
|
@@ -1015,13 +1142,13 @@
|
|
|
1015
1142
|
|
|
1016
1143
|
@keyframes pp-highlight-pulse {
|
|
1017
1144
|
0% {
|
|
1018
|
-
box-shadow: 0 0 0 0
|
|
1145
|
+
box-shadow: 0 0 0 0 rgba(0, 168, 132, 0.5);
|
|
1019
1146
|
}
|
|
1020
1147
|
30% {
|
|
1021
|
-
box-shadow: 0 0 0 6px
|
|
1148
|
+
box-shadow: 0 0 0 6px rgba(0, 168, 132, 0.25);
|
|
1022
1149
|
}
|
|
1023
1150
|
100% {
|
|
1024
|
-
box-shadow: 0 0 0 0
|
|
1151
|
+
box-shadow: 0 0 0 0 rgba(0, 168, 132, 0);
|
|
1025
1152
|
}
|
|
1026
1153
|
}
|
|
1027
1154
|
|
|
@@ -1032,7 +1159,7 @@
|
|
|
1032
1159
|
|
|
1033
1160
|
.pp-deleted-content {
|
|
1034
1161
|
font-style: italic;
|
|
1035
|
-
color: ${
|
|
1162
|
+
color: ${g.textSecondary};
|
|
1036
1163
|
display: flex;
|
|
1037
1164
|
align-items: center;
|
|
1038
1165
|
gap: 4px;
|
|
@@ -1045,11 +1172,285 @@
|
|
|
1045
1172
|
/* Edited Badge */
|
|
1046
1173
|
.pp-edited-badge {
|
|
1047
1174
|
font-size: 10px;
|
|
1048
|
-
color: ${s.textSecondary};
|
|
1049
1175
|
margin-left: 4px;
|
|
1050
1176
|
font-style: italic;
|
|
1177
|
+
opacity: 0.7;
|
|
1178
|
+
}
|
|
1179
|
+
|
|
1180
|
+
/* Pre-Chat Form */
|
|
1181
|
+
.pp-prechat {
|
|
1182
|
+
flex: 1;
|
|
1183
|
+
display: flex;
|
|
1184
|
+
flex-direction: column;
|
|
1185
|
+
padding: 24px 20px;
|
|
1186
|
+
overflow-y: auto;
|
|
1187
|
+
background: ${s?"#111b21":"#ffffff"};
|
|
1188
|
+
}
|
|
1189
|
+
|
|
1190
|
+
.pp-prechat-title {
|
|
1191
|
+
font-size: 20px;
|
|
1192
|
+
font-weight: 600;
|
|
1193
|
+
margin-bottom: 8px;
|
|
1194
|
+
color: ${s?"#e9edef":"#111b21"};
|
|
1195
|
+
}
|
|
1196
|
+
|
|
1197
|
+
.pp-prechat-subtitle {
|
|
1198
|
+
font-size: 14px;
|
|
1199
|
+
color: ${s?"#8696a0":"#667781"};
|
|
1200
|
+
margin-bottom: 24px;
|
|
1201
|
+
line-height: 1.5;
|
|
1202
|
+
}
|
|
1203
|
+
|
|
1204
|
+
.pp-prechat-tabs {
|
|
1205
|
+
display: flex;
|
|
1206
|
+
gap: 8px;
|
|
1207
|
+
margin-bottom: 20px;
|
|
1208
|
+
}
|
|
1209
|
+
|
|
1210
|
+
.pp-prechat-tab {
|
|
1211
|
+
flex: 1;
|
|
1212
|
+
padding: 10px;
|
|
1213
|
+
border: 1px solid ${g.border};
|
|
1214
|
+
border-radius: 8px;
|
|
1215
|
+
background: transparent;
|
|
1216
|
+
color: ${g.textSecondary};
|
|
1217
|
+
font-size: 13px;
|
|
1218
|
+
cursor: pointer;
|
|
1219
|
+
transition: all 0.2s;
|
|
1220
|
+
display: flex;
|
|
1221
|
+
align-items: center;
|
|
1222
|
+
justify-content: center;
|
|
1223
|
+
gap: 6px;
|
|
1224
|
+
}
|
|
1225
|
+
|
|
1226
|
+
.pp-prechat-tab:hover {
|
|
1227
|
+
background: ${g.bgSecondary};
|
|
1228
|
+
}
|
|
1229
|
+
|
|
1230
|
+
.pp-prechat-tab.active {
|
|
1231
|
+
background: ${e}15;
|
|
1232
|
+
border-color: ${e};
|
|
1233
|
+
color: ${e};
|
|
1234
|
+
}
|
|
1235
|
+
|
|
1236
|
+
.pp-prechat-tab svg {
|
|
1237
|
+
width: 16px;
|
|
1238
|
+
height: 16px;
|
|
1239
|
+
}
|
|
1240
|
+
|
|
1241
|
+
.pp-prechat-field {
|
|
1242
|
+
margin-bottom: 16px;
|
|
1243
|
+
}
|
|
1244
|
+
|
|
1245
|
+
.pp-prechat-label {
|
|
1246
|
+
display: block;
|
|
1247
|
+
font-size: 12px;
|
|
1248
|
+
font-weight: 500;
|
|
1249
|
+
color: ${g.textSecondary};
|
|
1250
|
+
margin-bottom: 6px;
|
|
1251
|
+
}
|
|
1252
|
+
|
|
1253
|
+
.pp-prechat-input {
|
|
1254
|
+
width: 100%;
|
|
1255
|
+
height: 44px;
|
|
1256
|
+
padding: 0 14px;
|
|
1257
|
+
border: 1px solid ${g.border};
|
|
1258
|
+
border-radius: 8px;
|
|
1259
|
+
background: ${g.bg};
|
|
1260
|
+
color: ${g.text};
|
|
1261
|
+
font-size: 14px;
|
|
1262
|
+
outline: none;
|
|
1263
|
+
transition: border-color 0.2s;
|
|
1264
|
+
box-sizing: border-box;
|
|
1265
|
+
}
|
|
1266
|
+
|
|
1267
|
+
.pp-prechat-input:focus {
|
|
1268
|
+
border-color: ${e};
|
|
1269
|
+
}
|
|
1270
|
+
|
|
1271
|
+
.pp-prechat-input::placeholder {
|
|
1272
|
+
color: ${g.textSecondary};
|
|
1273
|
+
}
|
|
1274
|
+
|
|
1275
|
+
.pp-prechat-input.error {
|
|
1276
|
+
border-color: #ef4444;
|
|
1277
|
+
}
|
|
1278
|
+
|
|
1279
|
+
.pp-prechat-error {
|
|
1280
|
+
color: #ef4444;
|
|
1281
|
+
font-size: 12px;
|
|
1282
|
+
margin-top: 4px;
|
|
1283
|
+
}
|
|
1284
|
+
|
|
1285
|
+
.pp-phone-input-wrapper {
|
|
1286
|
+
display: flex;
|
|
1287
|
+
gap: 8px;
|
|
1288
|
+
}
|
|
1289
|
+
|
|
1290
|
+
.pp-country-select {
|
|
1291
|
+
position: relative;
|
|
1292
|
+
}
|
|
1293
|
+
|
|
1294
|
+
.pp-country-btn {
|
|
1295
|
+
display: flex;
|
|
1296
|
+
align-items: center;
|
|
1297
|
+
gap: 6px;
|
|
1298
|
+
height: 44px;
|
|
1299
|
+
padding: 0 10px;
|
|
1300
|
+
border: 1px solid ${g.border};
|
|
1301
|
+
border-radius: 8px;
|
|
1302
|
+
background: ${g.bg};
|
|
1303
|
+
color: ${g.text};
|
|
1304
|
+
font-size: 14px;
|
|
1305
|
+
cursor: pointer;
|
|
1306
|
+
transition: border-color 0.2s;
|
|
1307
|
+
}
|
|
1308
|
+
|
|
1309
|
+
.pp-country-btn:focus {
|
|
1310
|
+
border-color: ${e};
|
|
1311
|
+
outline: none;
|
|
1312
|
+
}
|
|
1313
|
+
|
|
1314
|
+
.pp-country-flag {
|
|
1315
|
+
font-size: 18px;
|
|
1316
|
+
line-height: 1;
|
|
1317
|
+
}
|
|
1318
|
+
|
|
1319
|
+
.pp-country-code {
|
|
1320
|
+
font-size: 13px;
|
|
1321
|
+
color: ${g.textSecondary};
|
|
1322
|
+
}
|
|
1323
|
+
|
|
1324
|
+
.pp-country-chevron {
|
|
1325
|
+
width: 12px;
|
|
1326
|
+
height: 12px;
|
|
1327
|
+
color: ${g.textSecondary};
|
|
1328
|
+
}
|
|
1329
|
+
|
|
1330
|
+
.pp-country-dropdown {
|
|
1331
|
+
position: absolute;
|
|
1332
|
+
top: calc(100% + 4px);
|
|
1333
|
+
left: 0;
|
|
1334
|
+
width: 280px;
|
|
1335
|
+
max-height: 280px;
|
|
1336
|
+
overflow-y: auto;
|
|
1337
|
+
background: ${g.bg};
|
|
1338
|
+
border: 1px solid ${g.border};
|
|
1339
|
+
border-radius: 8px;
|
|
1340
|
+
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
|
|
1341
|
+
z-index: 100;
|
|
1342
|
+
}
|
|
1343
|
+
|
|
1344
|
+
.pp-country-search {
|
|
1345
|
+
position: sticky;
|
|
1346
|
+
top: 0;
|
|
1347
|
+
padding: 8px;
|
|
1348
|
+
background: ${g.bg};
|
|
1349
|
+
border-bottom: 1px solid ${g.border};
|
|
1350
|
+
}
|
|
1351
|
+
|
|
1352
|
+
.pp-country-search-input {
|
|
1353
|
+
width: 100%;
|
|
1354
|
+
height: 36px;
|
|
1355
|
+
padding: 0 12px;
|
|
1356
|
+
border: 1px solid ${g.border};
|
|
1357
|
+
border-radius: 6px;
|
|
1358
|
+
background: ${g.bgSecondary};
|
|
1359
|
+
color: ${g.text};
|
|
1360
|
+
font-size: 13px;
|
|
1361
|
+
outline: none;
|
|
1362
|
+
box-sizing: border-box;
|
|
1363
|
+
}
|
|
1364
|
+
|
|
1365
|
+
.pp-country-search-input:focus {
|
|
1366
|
+
border-color: ${e};
|
|
1367
|
+
}
|
|
1368
|
+
|
|
1369
|
+
.pp-country-list {
|
|
1370
|
+
padding: 4px;
|
|
1371
|
+
}
|
|
1372
|
+
|
|
1373
|
+
.pp-country-option {
|
|
1374
|
+
display: flex;
|
|
1375
|
+
align-items: center;
|
|
1376
|
+
gap: 10px;
|
|
1377
|
+
padding: 10px 12px;
|
|
1378
|
+
cursor: pointer;
|
|
1379
|
+
border-radius: 6px;
|
|
1380
|
+
transition: background 0.15s;
|
|
1381
|
+
}
|
|
1382
|
+
|
|
1383
|
+
.pp-country-option:hover {
|
|
1384
|
+
background: ${g.bgSecondary};
|
|
1385
|
+
}
|
|
1386
|
+
|
|
1387
|
+
.pp-country-option.selected {
|
|
1388
|
+
background: ${e}15;
|
|
1389
|
+
}
|
|
1390
|
+
|
|
1391
|
+
.pp-country-name {
|
|
1392
|
+
flex: 1;
|
|
1393
|
+
font-size: 13px;
|
|
1394
|
+
color: ${g.text};
|
|
1395
|
+
}
|
|
1396
|
+
|
|
1397
|
+
.pp-country-dial {
|
|
1398
|
+
font-size: 12px;
|
|
1399
|
+
color: ${g.textSecondary};
|
|
1400
|
+
}
|
|
1401
|
+
|
|
1402
|
+
.pp-phone-number-input {
|
|
1403
|
+
flex: 1;
|
|
1404
|
+
}
|
|
1405
|
+
|
|
1406
|
+
.pp-prechat-submit {
|
|
1407
|
+
width: 100%;
|
|
1408
|
+
height: 48px;
|
|
1409
|
+
margin-top: 12px;
|
|
1410
|
+
border: none;
|
|
1411
|
+
border-radius: 8px;
|
|
1412
|
+
background: #00a884;
|
|
1413
|
+
color: white;
|
|
1414
|
+
font-size: 15px;
|
|
1415
|
+
font-weight: 500;
|
|
1416
|
+
cursor: pointer;
|
|
1417
|
+
transition: background 0.2s, transform 0.1s;
|
|
1418
|
+
}
|
|
1419
|
+
|
|
1420
|
+
.pp-prechat-submit:hover:not(:disabled) {
|
|
1421
|
+
background: #008f72;
|
|
1422
|
+
}
|
|
1423
|
+
|
|
1424
|
+
.pp-prechat-submit:active:not(:disabled) {
|
|
1425
|
+
transform: scale(0.98);
|
|
1426
|
+
}
|
|
1427
|
+
|
|
1428
|
+
.pp-prechat-submit:disabled {
|
|
1429
|
+
background: ${s?"#3b4a54":"#b3b3b3"};
|
|
1430
|
+
cursor: not-allowed;
|
|
1431
|
+
}
|
|
1432
|
+
|
|
1433
|
+
.pp-prechat-skip {
|
|
1434
|
+
width: 100%;
|
|
1435
|
+
padding: 14px;
|
|
1436
|
+
margin-top: 8px;
|
|
1437
|
+
border: none;
|
|
1438
|
+
background: transparent;
|
|
1439
|
+
color: ${s?"#8696a0":"#667781"};
|
|
1440
|
+
font-size: 14px;
|
|
1441
|
+
cursor: pointer;
|
|
1442
|
+
transition: color 0.2s;
|
|
1443
|
+
}
|
|
1444
|
+
|
|
1445
|
+
.pp-prechat-skip:hover {
|
|
1446
|
+
color: ${s?"#aebac1":"#3b4a54"};
|
|
1051
1447
|
}
|
|
1052
|
-
`}var kn=0;function o(t,e,n,s,i,a){e||(e={});var r,d,u=e;if("ref"in u)for(d in u={},e)d=="ref"?r=e[d]:u[d]=e[d];var l={type:t,props:u,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--kn,__i:-1,__u:0,__source:i,__self:a};if(typeof t=="function"&&(r=t.defaultProps))for(d in r)u[d]===void 0&&(u[d]=r[d]);return w.vnode&&w.vnode(l),l}function Sn(t){let e=new Date,n=new Date(t),s=new Date(e.getFullYear(),e.getMonth(),e.getDate()),i=new Date(n.getFullYear(),n.getMonth(),n.getDate()),a=Math.floor((s.getTime()-i.getTime())/(1e3*60*60*24));return a===0?"Today":a===1?"Yesterday":n.toLocaleDateString("en-US",{month:"short",day:"numeric",year:n.getFullYear()!==e.getFullYear()?"numeric":void 0})}function bt(t){let e=new Date(t);return`${e.getFullYear()}-${e.getMonth()}-${e.getDate()}`}function Pt({client:t,config:e}){let[n,s]=A(!1),[i,a]=A([]),[r,d]=A(""),[u,l]=A(!1),[g,p]=A(!1),[h,f]=A(!1),[T,D]=A(0),[E,_]=A([]),[b,F]=A(!1),[R,q]=A(null),[U,X]=A(null),[z,W]=A(""),[H,O]=A(null),[V,me]=A(!1),[jt,Oe]=A(null),[Le,He]=A(null),[N,_e]=A(e),ve=K(null),xe=K(null),Fe=K(null),Bt=K(null);B(()=>{let c=t.on("openChange",s),v=t.on("message",()=>{a([...t.getMessages()])}),k=t.on("typing",m=>{l(m.isTyping)}),P=t.on("presence",m=>{p(m.online)}),S=t.on("connect",()=>{f(!0),a(t.getMessages()),p(t.getSession()?.operatorOnline??!1),_e(t.getConfig())}),I=t.on("configUpdate",()=>{_e(t.getConfig())});return t.isConnected()&&(f(!0),a(t.getMessages()),p(t.getSession()?.operatorOnline??!1),_e(t.getConfig())),()=>{c(),v(),k(),P(),S(),I()}},[t]),B(()=>{n&&ve.current?.scrollIntoView({behavior:"smooth"})},[i,n]),B(()=>{n&&(setTimeout(()=>{ve.current?.scrollIntoView({behavior:"auto"})},50),xe.current?.focus(),D(0))},[n]),B(()=>{if(!n&&i.length>0){let c=i.filter(v=>v.sender!=="visitor"&&v.status!=="read").length;D(c)}},[i,n]);let ie=_t(()=>{if(!n||!h)return;let c=i.filter(v=>v.sender!=="visitor"&&v.status!=="read");if(c.length>0){let v=c.map(k=>k.id);t.sendReadStatus(v,"read")}},[n,h,i,t]);if(B(()=>{if(!n||!h)return;let c=setTimeout(()=>{ie()},1e3);return()=>clearTimeout(c)},[n,h,i,ie]),B(()=>{let c=()=>{document.visibilityState==="visible"&&n&&ie()};return document.addEventListener("visibilitychange",c),()=>document.removeEventListener("visibilitychange",c)},[n,ie]),B(()=>{let c=t.on("read",()=>{a([...t.getMessages()])});return()=>c()},[t]),!En(N))return null;let qt=async c=>{c.preventDefault();let v=r.trim().length>0,k=E.filter(m=>m.status==="ready"&&m.attachment);if(!v&&k.length===0)return;let P=r,S=k.map(m=>m.attachment.id),I=R?.id;d(""),_([]),q(null);try{await t.sendMessage(P,S,I)}catch(m){console.error("[PocketPing] Failed to send message:",m)}},Jt=c=>{let v=c.target;d(v.value),t.sendTyping(!0)},Yt=async c=>{let v=c.target,k=v.files;if(!k||k.length===0)return;let P=[];for(let S=0;S<k.length;S++){let I=k[S],m=`pending-${Date.now()}-${S}`,x;I.type.startsWith("image/")&&(x=URL.createObjectURL(I)),P.push({id:m,file:I,preview:x,progress:0,status:"pending"})}_(S=>[...S,...P]),v.value="",F(!0);for(let S of P)try{_(m=>m.map(x=>x.id===S.id?{...x,status:"uploading"}:x));let I=await t.uploadFile(S.file,m=>{_(x=>x.map(oe=>oe.id===S.id?{...oe,progress:m}:oe))});_(m=>m.map(x=>x.id===S.id?{...x,status:"ready",progress:100,attachment:I}:x))}catch(I){console.error("[PocketPing] Failed to upload file:",I),_(m=>m.map(x=>x.id===S.id?{...x,status:"error",error:"Upload failed"}:x))}F(!1)},Xt=c=>{_(v=>{let k=v.find(P=>P.id===c);return k?.preview&&URL.revokeObjectURL(k.preview),v.filter(P=>P.id!==c)})},We=c=>{q(c),O(null),xe.current?.focus()},Gt=()=>{q(null)},Ne=c=>{c.sender==="visitor"&&(X(c),W(c.content),O(null))},Ue=()=>{X(null),W("")},Kt=async()=>{if(!(!U||!z.trim()))try{await t.editMessage(U.id,z.trim()),X(null),W("")}catch(c){console.error("[PocketPing] Failed to edit message:",c)}},ze=async c=>{if(c.sender==="visitor"&&(O(null),confirm("Delete this message?")))try{await t.deleteMessage(c.id)}catch(v){console.error("[PocketPing] Failed to delete message:",v)}},Qt=(c,v)=>{c.preventDefault();let k=c;O({message:v,x:k.clientX,y:k.clientY})},Zt=c=>{let v=setTimeout(()=>{navigator.vibrate&&navigator.vibrate(50),O({message:c,x:window.innerWidth/2-60,y:window.innerHeight/2-50})},500);He(v)},Ve=()=>{Le&&(clearTimeout(Le),He(null))};B(()=>{if(!H)return;let c=()=>O(null);return document.addEventListener("click",c),()=>document.removeEventListener("click",c)},[H]);let je=c=>{let v=document.getElementById(`pp-msg-${c}`);v&&(v.scrollIntoView({behavior:"smooth",block:"center"}),v.classList.add("pp-message-highlight"),setTimeout(()=>{v.classList.remove("pp-message-highlight")},1500))},Q=K(0),en=c=>{c.preventDefault(),c.stopPropagation(),Q.current++,Q.current===1&&me(!0)},tn=c=>{c.preventDefault(),c.stopPropagation()},nn=c=>{c.preventDefault(),c.stopPropagation(),Q.current--,Q.current===0&&me(!1)},sn=async c=>{c.preventDefault(),c.stopPropagation(),Q.current=0,me(!1);let v=c.dataTransfer?.files;if(!v||v.length===0)return;let k=[];for(let P=0;P<v.length;P++){let S=v[P],I=`pending-${Date.now()}-${P}`,m;S.type.startsWith("image/")&&(m=URL.createObjectURL(S)),k.push({id:I,file:S,preview:m,progress:0,status:"pending"})}_(P=>[...P,...k]),F(!0);for(let P of k)try{_(I=>I.map(m=>m.id===P.id?{...m,status:"uploading"}:m));let S=await t.uploadFile(P.file,I=>{_(m=>m.map(x=>x.id===P.id?{...x,progress:I}:x))});_(I=>I.map(m=>m.id===P.id?{...m,status:"ready",progress:100,attachment:S}:m))}catch(S){console.error("[PocketPing] Failed to upload dropped file:",S),_(I=>I.map(m=>m.id===P.id?{...m,status:"error",error:"Upload failed"}:m))}F(!1)},Be=N.position??"bottom-right",ye=Pn(N.theme??"auto"),on=N.primaryColor??"#6366f1",Z=ye==="dark"?"#9ca3af":"#6b7280";return o($,{children:[o("style",{children:yt(on,ye)}),o("button",{class:`pp-toggle pp-${Be}`,onClick:()=>t.toggleOpen(),"aria-label":n?"Close chat":"Open chat",children:[n?o(se,{}):o(In,{}),!n&&T>0&&o("span",{class:"pp-unread-badge",children:T>9?"9+":T}),!n&&T===0&&g&&o("span",{class:"pp-online-dot"})]}),n&&o("div",{class:`pp-window pp-${Be} pp-theme-${ye} ${V?"pp-dragging":""}`,onDragEnter:en,onDragOver:tn,onDragLeave:nn,onDrop:sn,children:[V&&o("div",{class:"pp-drop-overlay",children:[o("div",{class:"pp-drop-icon",children:o(wt,{})}),o("div",{class:"pp-drop-text",children:"Drop files to upload"})]}),o("div",{class:"pp-header",children:[o("div",{class:"pp-header-info",children:[N.operatorAvatar&&o("img",{src:N.operatorAvatar,alt:"",class:"pp-avatar"}),o("div",{children:[o("div",{class:"pp-header-title",children:N.operatorName??"Support"}),o("div",{class:"pp-header-status",children:g?o($,{children:[o("span",{class:"pp-status-dot pp-online"})," Online"]}):o($,{children:[o("span",{class:"pp-status-dot"})," Away"]})})]})]}),o("button",{class:"pp-close-btn",onClick:()=>t.setOpen(!1),"aria-label":"Close chat",children:o(se,{})})]}),o("div",{class:"pp-messages",ref:Bt,children:[N.welcomeMessage&&i.length===0&&o("div",{class:"pp-welcome",children:N.welcomeMessage}),i.map((c,v)=>{let k=!!c.deletedAt,P=!!c.editedAt,S=new Date(c.timestamp),I=v>0?i[v-1]:null,m=!I||bt(new Date(I.timestamp))!==bt(S),x=null;if(c.replyTo)if(typeof c.replyTo=="object")x=c.replyTo;else{let L=i.find(re=>re.id===c.replyTo);if(L){let re=!!(L.attachments&&L.attachments.length>0);x={id:L.id,sender:L.sender,content:L.content,deleted:!!L.deletedAt,hasAttachment:re,attachmentType:re?L.attachments[0].mimeType:void 0}}}let rn=jt===c.id&&!k;return o($,{children:[m&&o("div",{class:"pp-date-separator",children:o("span",{children:Sn(S)})}),o("div",{id:`pp-msg-${c.id}`,class:`pp-message pp-message-${c.sender} ${k?"pp-message-deleted":""}`,onContextMenu:L=>Qt(L,c),onMouseEnter:()=>Oe(c.id),onMouseLeave:()=>Oe(null),onTouchStart:()=>Zt(c),onTouchEnd:Ve,onTouchCancel:Ve,children:[rn&&o("div",{class:`pp-message-actions ${c.sender==="visitor"?"pp-actions-left":"pp-actions-right"}`,children:[o("button",{class:"pp-action-btn",onClick:()=>We(c),title:"Reply",children:o(kt,{color:Z})}),c.sender==="visitor"&&o($,{children:[o("button",{class:"pp-action-btn",onClick:()=>Ne(c),title:"Edit",children:o(St,{color:Z})}),o("button",{class:"pp-action-btn pp-action-delete",onClick:()=>ze(c),title:"Delete",children:o(Et,{color:Z})})]})]}),x&&(x.content||x.hasAttachment)&&o("div",{class:"pp-reply-quote pp-reply-quote-clickable",onClick:()=>je(x.id),role:"button",tabIndex:0,onKeyDown:L=>L.key==="Enter"&&je(x.id),children:[o("span",{class:"pp-reply-sender",children:x.sender==="visitor"?"You":"Support"}),o("span",{class:"pp-reply-content",children:x.deleted?"Message deleted":o($,{children:[x.hasAttachment&&o("span",{class:"pp-reply-attachment-icon",children:x.attachmentType?.startsWith("image/")?"\u{1F4F7} ":"\u{1F4CE} "}),x.content?o($,{children:[(x.content||"").slice(0,50),(x.content||"").length>50?"...":""]}):x.attachmentType?.startsWith("image/")?"Photo":"File"]})})]}),k?o("div",{class:"pp-message-content pp-deleted-content",children:[o("span",{class:"pp-deleted-icon",children:"\u{1F5D1}\uFE0F"})," Message deleted"]}):o($,{children:[c.content&&o("div",{class:"pp-message-content",children:c.content}),c.attachments&&c.attachments.length>0&&o("div",{class:"pp-message-attachments",children:c.attachments.map(L=>o($n,{attachment:L},L.id))})]}),o("div",{class:"pp-message-time",children:[Tn(c.timestamp),P&&!k&&o("span",{class:"pp-edited-badge",children:"edited"}),c.sender==="ai"&&o("span",{class:"pp-ai-badge",children:"AI"}),c.sender==="visitor"&&!k&&o("span",{class:`pp-status pp-status-${c.status??"sent"}`,children:o(Cn,{status:c.status})})]})]})]},c.id)}),u&&o("div",{class:"pp-message pp-message-operator pp-typing",children:[o("span",{}),o("span",{}),o("span",{})]}),o("div",{ref:ve})]}),H&&o("div",{class:"pp-message-menu",style:{top:`${H.y}px`,left:`${H.x}px`},children:[o("button",{onClick:()=>We(H.message),children:[o(kt,{color:Z})," Reply"]}),H.message.sender==="visitor"&&!H.message.deletedAt&&o($,{children:[o("button",{onClick:()=>Ne(H.message),children:[o(St,{color:Z})," Edit"]}),o("button",{class:"pp-menu-delete",onClick:()=>ze(H.message),children:[o(Et,{color:"#ef4444"})," Delete"]})]})]}),U&&o("div",{class:"pp-edit-modal",children:[o("div",{class:"pp-edit-header",children:[o("span",{children:"Edit message"}),o("button",{onClick:Ue,children:o(se,{})})]}),o("textarea",{class:"pp-edit-input",value:z,onInput:c=>W(c.target.value),autoFocus:!0}),o("div",{class:"pp-edit-actions",children:[o("button",{class:"pp-edit-cancel",onClick:Ue,children:"Cancel"}),o("button",{class:"pp-edit-save",onClick:Kt,disabled:!z.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($,{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:Gt,children:o(se,{})})]}),E.length>0&&o("div",{class:"pp-attachments-preview",children:E.map(c=>o("div",{class:`pp-attachment-preview pp-attachment-${c.status}`,children:[c.preview?o("img",{src:c.preview,alt:c.file.name,class:"pp-preview-img"}):o("div",{class:"pp-preview-file",children:o(Tt,{mimeType:c.file.type})}),o("button",{class:"pp-remove-attachment",onClick:()=>Xt(c.id),"aria-label":"Remove attachment",type:"button",children:o(se,{})}),c.status==="uploading"&&o("div",{class:"pp-upload-progress",style:{width:`${c.progress}%`}}),c.status==="error"&&o("div",{class:"pp-upload-error",title:c.error,children:"!"})]},c.id))}),o("form",{class:"pp-input-form",onSubmit:qt,children:[o("input",{ref:c=>{Fe.current=c,c&&(c.onchange=Yt)},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:()=>Fe.current?.click(),disabled:!h||b,"aria-label":"Attach file",children:o(wt,{})}),o("input",{ref:xe,type:"text",class:"pp-input",placeholder:N.placeholder??"Type a message...",value:r,onInput:Jt,disabled:!h}),o("button",{type:"submit",class:"pp-send-btn",disabled:!r.trim()&&E.filter(c=>c.status==="ready").length===0||!h||b,"aria-label":"Send message",children:o(Mn,{})})]}),o("div",{class:"pp-footer",children:["Powered by ",o("a",{href:"https://pocketping.io",target:"_blank",rel:"noopener",children:"PocketPing"})]})]})]})}function En(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 Pn(t){return t==="auto"?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":t}function Tn(t){return new Date(t).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}function In(){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 se(){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 Mn(){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 Cn({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 wt(){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 kt({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 St({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 Et({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 Tt({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 $n({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(Tt,{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 he="0.3.7";var fe=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})}),d=this.session.messages.findIndex(l=>l.id===i);d>=0&&(this.session.messages[d].id=r.messageId,this.session.messages[d].timestamp=r.timestamp,this.session.messages[d].status="sent",r.attachments&&r.attachments.length>0&&(this.session.messages[d].attachments=r.attachments),this.emit("message",this.session.messages[d]));let u=this.session.messages[d]||{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 d=this.session.messages.findIndex(u=>u.id===i);throw d>=0&&(this.session.messages.splice(d,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],d=a/i*100,u=100/i,l=await this.uploadFile(r,g=>{let p=d+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",d=>{if(d.lengthComputable){let u=d.loaded/d.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 d={...n.data,selector:n.selector,elementText:r.target?.textContent?.trim().slice(0,100),url:window.location.href};this.trigger(n.name,d,{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=`
|
|
1448
|
+
`}var Vn={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 ke(t,e){var n=Array.prototype.slice.call(e);return n.push(Vn),t.apply(this,n)}function St(t,e){t=t.split("-"),e=e.split("-");for(var n=t[0].split("."),r=e[0].split("."),o=0;o<3;o++){var d=Number(n[o]),i=Number(r[o]);if(d>i)return 1;if(i>d)return-1;if(!isNaN(d)&&isNaN(i))return 1;if(isNaN(d)&&!isNaN(i))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 Oo={}.constructor;function ne(t){return t!=null&&t.constructor===Oo}function he(t){"@babel/helpers - typeof";return he=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},he(t)}function tt(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Gn(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,Mo(r.key),r)}}function nt(t,e,n){return e&&Gn(t.prototype,e),n&&Gn(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function Mo(t){var e=Fo(t,"string");return he(e)=="symbol"?e:e+""}function Fo(t,e){if(he(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(he(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var Ro="1.2.0",Do="1.7.35",Wn=" ext. ",Lo=/^\d+$/,T=(function(){function t(e){tt(this,t),It(e),this.metadata=e,Yn.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&&Lo.test(n)&&(r=n,n=null),n&&n!=="001"){if(!this.hasCountry(n))throw new Error("Unknown country: ".concat(n));this.numberingPlan=new zn(this.getCountryMetadata(n),this)}else if(r){if(!this.hasCallingCode(r))throw new Error("Unknown calling code: ".concat(r));this.numberingPlan=new zn(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 d=this.countryCallingCodes()[n];if(d&&d.length===1&&d[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 zn=(function(){function t(e,n){tt(this,t),this.globalMetadataObject=n,this.metadata=e,Yn.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()&&Kn(this.types(),n))return new jo(Kn(this.types(),n),this)}},{key:"ext",value:function(){return this.v1||this.v2?Wn:this.metadata[13]||Wn}}])})(),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()&&!Uo.test(this.nationalPrefixFormattingRule()))}},{key:"internationalFormat",value:function(){return this._format[5]||this.format()}}])})(),Uo=/^\(?\$1\)?$/,jo=(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 Kn(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 It(t){if(!t)throw new Error("[libphonenumber-js] `metadata` argument not passed. Check your arguments.");if(!ne(t)||!ne(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(ne(t)?"an object of shape: { "+Object.keys(t).join(", ")+" }":"a "+Bo(t)+": "+t,"."))}var Bo=function(e){return he(e)};function ae(t,e){if(e=new T(e),e.hasCountry(t))return e.selectNumberingPlan(t).countryCallingCode();throw new Error("Unknown country: ".concat(t))}function Xn(t,e){return e.countries.hasOwnProperty(t)}function Yn(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?St(e,Ro)===-1?this.v2=!0:St(e,Do)===-1?this.v3=!0:this.v4=!0:this.v1=!0}function Vo(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=Go(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.
|
|
1449
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Go(t,e){if(t){if(typeof t=="string")return qn(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)?qn(t,e):void 0}}function qn(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 Nt(t,e){for(var n=t.slice(),r=Vo(e),o;!(o=r()).done;){var d=o.value;t.indexOf(d)<0&&n.push(d)}return n.sort(function(i,s){return i-s})}function le(t,e,n){return Jn(t,e,void 0,n)}function Jn(t,e,n,r){e&&(r=new T(r.metadata),r.selectNumberingPlan(e));var o=r.type(n),d=o&&o.possibleLengths()||r.possibleLengths();if(!d)return"IS_POSSIBLE";if(n==="FIXED_LINE_OR_MOBILE"){if(!r.type("FIXED_LINE"))return Jn(t,e,"MOBILE",r);var i=r.type("MOBILE");i&&(d=Nt(d,i.possibleLengths()))}else if(n&&!o)return"INVALID_LENGTH";var s=t.length,c=d[0];return c===s?"IS_POSSIBLE":c>s?"TOO_SHORT":d[d.length-1]<s?"TOO_LONG":d.indexOf(s,1)>=0?"IS_POSSIBLE":"INVALID_LENGTH"}function Tt(t,e,n){if(e===void 0&&(e={}),n=new T(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 At(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 At(t,e,n){return le(t,e,n)==="IS_POSSIBLE"}function z(t,e){return t=t||"",new RegExp("^(?:"+e+")$").test(t)}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=zo(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.
|
|
1450
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function zo(t,e){if(t){if(typeof t=="string")return Zn(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)?Zn(t,e):void 0}}function Zn(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 Ko=["MOBILE","PREMIUM_RATE","TOLL_FREE","SHARED_COST","VOIP","PERSONAL_NUMBER","PAGER","UAN","VOICEMAIL"];function pe(t,e,n){if(e=e||{},!(!t.country&&!t.countryCallingCode)){n=new T(n),n.selectNumberingPlan(t.country,t.countryCallingCode);var r=e.v2?t.nationalNumber:t.phone;if(z(r,n.nationalNumberPattern())){if(Ot(r,"FIXED_LINE",n))return n.type("MOBILE")&&n.type("MOBILE").pattern()===""||!n.type("MOBILE")||Ot(r,"MOBILE",n)?"FIXED_LINE_OR_MOBILE":"FIXED_LINE";for(var o=Wo(Ko),d;!(d=o()).done;){var i=d.value;if(Ot(r,i,n))return i}}}}function Ot(t,e,n){return e=n.type(e),!e||!e.pattern()||e.possibleLengths()&&e.possibleLengths().indexOf(t.length)<0?!1:z(t,e.pattern())}function Mt(t,e,n){if(e=e||{},n=new T(n),n.selectNumberingPlan(t.country,t.countryCallingCode),n.hasTypes())return pe(t,e,n.metadata)!==void 0;var r=e.v2?t.nationalNumber:t.phone;return z(r,n.nationalNumberPattern())}function Ft(t,e,n){var r=new T(n),o=r.getCountryCodesForCallingCode(t);return o?o.filter(function(d){return Xo(e,d,n)}):[]}function Xo(t,e,n){var r=new T(n);return r.selectNumberingPlan(e),r.numberingPlan.possibleLengths().indexOf(t.length)>=0}var Se=2,Qn=17,er=3,K="0-9\uFF10-\uFF19\u0660-\u0669\u06F0-\u06F9",Yo="-\u2010-\u2015\u2212\u30FC\uFF0D",qo="\uFF0F/",Jo="\uFF0E.",Zo=" \xA0\xAD\u200B\u2060\u3000",Qo="()\uFF08\uFF09\uFF3B\uFF3D\\[\\]",ei="~\u2053\u223C\uFF5E",ge="".concat(Yo).concat(qo).concat(Jo).concat(Zo).concat(Qo).concat(ei),Ie="+\uFF0B";var ti=new RegExp("(["+K+"])");function Rt(t,e,n,r){if(e){var o=new T(r);o.selectNumberingPlan(e,n);var d=new RegExp(o.IDDPrefix());if(t.search(d)===0){t=t.slice(t.match(d)[0].length);var i=t.match(ti);if(!(i&&i[1]!=null&&i[1].length>0&&i[1]==="0"))return t}}}function Dt(t,e){if(t&&e.numberingPlan.nationalPrefixForParsing()){var n=new RegExp("^(?:"+e.numberingPlan.nationalPrefixForParsing()+")"),r=n.exec(t);if(r){var o,d,i=r.length-1,s=i>0&&r[i];if(e.nationalPrefixTransformRule()&&s)o=t.replace(n,e.nationalPrefixTransformRule()),i>1&&(d=r[1]);else{var c=r[0];o=t.slice(c.length),s&&(d=r[1])}var l;if(s){var $=t.indexOf(r[1]),p=t.slice(0,$);p===e.numberingPlan.nationalPrefix()&&(l=e.numberingPlan.nationalPrefix())}else l=r[0];return{nationalNumber:o,nationalPrefix:l,carrierCode:d}}}return{nationalNumber:t}}function ni(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=ri(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.
|
|
1451
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ri(t,e){if(t){if(typeof t=="string")return tr(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)?tr(t,e):void 0}}function tr(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 Lt(t,e){var n=e.countries,r=e.metadata;r=new T(r);for(var o=ni(n),d;!(d=o()).done;){var i=d.value;if(r.selectNumberingPlan(i),r.leadingDigits()){if(t&&t.search(r.leadingDigits())===0)return i}else if(pe({phone:t,country:i},void 0,r.metadata))return i}}var oi=!1;function Ne(t,e){var n=e.nationalNumber,r=e.metadata;if(oi&&r.isNonGeographicCallingCode(t))return"001";var o=r.getCountryCodesForCallingCode(t);if(o)return o.length===1?o[0]:Lt(n,{countries:o,metadata:r.metadata})}function me(t,e,n){var r=Dt(t,n),o=r.carrierCode,d=r.nationalNumber;if(d!==t){if(!ii(t,d,n))return{nationalNumber:t};if(n.numberingPlan.possibleLengths()&&(e||(e=Ne(n.numberingPlan.callingCode(),{nationalNumber:d,metadata:n})),!di(d,e,n)))return{nationalNumber:t}}return{nationalNumber:d,carrierCode:o}}function ii(t,e,n){return!(z(t,n.nationalNumberPattern())&&!z(e,n.nationalNumberPattern()))}function di(t,e,n){switch(le(t,e,n)){case"TOO_SHORT":case"INVALID_LENGTH":return!1;default:return!0}}function Ht(t,e,n,r,o){var d=e||n?ae(e||n,o):r;if(t.indexOf(d)===0){o=new T(o),o.selectNumberingPlan(e||n,d);var i=t.slice(d.length),s=me(i,e,o),c=s.nationalNumber,l=me(t,e,o),$=l.nationalNumber;if(!z($,o.nationalNumberPattern())&&z(c,o.nationalNumberPattern())||le($,e,o)==="TOO_LONG")return{countryCallingCode:d,number:i}}return{number:t}}function Te(t,e,n,r,o){if(!t)return{};var d;if(t[0]!=="+"){var i=Rt(t,e||n,r,o);if(i&&i!==t)d=!0,t="+"+i;else{if(e||n||r){var s=Ht(t,e,n,r,o),c=s.countryCallingCode,l=s.number;if(c)return{countryCallingCodeSource:"FROM_NUMBER_WITHOUT_PLUS_SIGN",countryCallingCode:c,number:l}}return{number:t}}}if(t[1]==="0")return{};o=new T(o);for(var $=2;$-1<=er&&$<=t.length;){var p=t.slice(1,$);if(o.hasCallingCode(p))return o.selectNumberingPlan(p),{countryCallingCodeSource:d?"FROM_NUMBER_WITH_IDD":"FROM_NUMBER_WITH_PLUS_SIGN",countryCallingCode:p,number:t.slice($)};$++}return{}}function Ut(t){return t.replace(new RegExp("[".concat(ge,"]+"),"g")," ").trim()}var si=/(\$\d)/;function jt(t,e,n){var r=n.useInternationalFormat,o=n.withNationalPrefix,d=n.carrierCode,i=n.metadata,s=t.replace(new RegExp(e.pattern()),r?e.internationalFormat():o&&e.nationalPrefixFormattingRule()?e.format().replace(si,e.nationalPrefixFormattingRule()):e.format());return r?Ut(s):s}var ai=/^[\d]+(?:[~\u2053\u223C\uFF5E][\d]+)?$/;function Bt(t,e,n){var r=new T(n);if(r.selectNumberingPlan(t,e),r.defaultIDDPrefix())return r.defaultIDDPrefix();if(ai.test(r.IDDPrefix()))return r.IDDPrefix()}var li=";ext=",be=function(e){return"([".concat(K,"]{1,").concat(e,"})")};function Ae(t){var e="20",n="15",r="9",o="6",d="[ \xA0\\t,]*",i="[:\\.\uFF0E]?[ \xA0\\t,-]*",s="#?",c="(?:e?xt(?:ensi(?:o\u0301?|\xF3))?n?|\uFF45?\uFF58\uFF54\uFF4E?|\u0434\u043E\u0431|anexo)",l="(?:[x\uFF58#\uFF03~\uFF5E]|int|\uFF49\uFF4E\uFF54)",$="[- ]+",p="[ \xA0\\t]*",f="(?:,{2}|;)",h=li+be(e),v=d+c+i+be(e)+s,k=d+l+i+be(r)+s,w=$+be(o)+"#",m=p+f+i+be(n)+s,g=p+"(?:,)+"+i+be(r)+s;return h+"|"+v+"|"+k+"|"+w+"|"+m+"|"+g}var pi="["+K+"]{"+Se+"}",ci="["+Ie+"]{0,1}(?:["+ge+"]*["+K+"]){3,}["+ge+K+"]*",ui=new RegExp("^["+Ie+"]{0,1}(?:["+ge+"]*["+K+"]){1,2}$","i"),$i=ci+"(?:"+Ae()+")?",fi=new RegExp("^"+pi+"$|^"+$i+"$","i");function Vt(t){return t.length>=Se&&fi.test(t)}function nr(t){return ui.test(t)}function rr(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 or={formatExtension:function(e,n,r){return"".concat(e).concat(r.ext()).concat(n)}};function Wt(t,e,n,r){if(n?n=mi({},or,n):n=or,r=new T(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(),d=n.v2?t.nationalNumber:t.phone,i;switch(e){case"NATIONAL":return d?(i=rt(d,t.carrierCode,"NATIONAL",r,n),Gt(i,t.ext,r,n.formatExtension)):"";case"INTERNATIONAL":return d?(i=rt(d,null,"INTERNATIONAL",r,n),i="+".concat(o," ").concat(i),Gt(i,t.ext,r,n.formatExtension)):"+".concat(o);case"E.164":return"+".concat(o).concat(d);case"RFC3966":return rr({number:"+".concat(o).concat(d),ext:t.ext});case"IDD":if(!n.fromCountry)return;var s=gi(d,t.carrierCode,o,n.fromCountry,r);return s?Gt(s,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 d=hi(r.formats(),t);return d?jt(t,d,{useInternationalFormat:n==="INTERNATIONAL",withNationalPrefix:!(d.nationalPrefixIsOptionalWhenFormattingInNationalFormat()&&o&&o.nationalPrefix===!1),carrierCode:e,metadata:r}):t}function hi(t,e){return bi(t,function(n){if(n.leadingDigitsPatterns().length>0){var r=n.leadingDigitsPatterns()[n.leadingDigitsPatterns().length-1];if(e.search(r)!==0)return!1}return z(e,n.pattern())})}function Gt(t,e,n,r){return e?r(t,e,n):t}function gi(t,e,n,r,o){var d=ae(r,o.metadata);if(d===n){var i=rt(t,e,"NATIONAL",o);return n==="1"?n+" "+i:i}var s=Bt(r,void 0,o.metadata);if(s)return"".concat(s," ").concat(n," ").concat(rt(t,null,"INTERNATIONAL",o))}function mi(){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 bi(t,e){for(var n=0;n<t.length;){if(e(t[n]))return t[n];n++}}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 ir(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 dr(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?ir(Object(n),!0).forEach(function(r){vi(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ir(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function vi(t,e,n){return(e=ar(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function yi(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function sr(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,ar(r.key),r)}}function _i(t,e,n){return e&&sr(t.prototype,e),n&&sr(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function ar(t){var e=xi(t,"string");return Oe(e)=="symbol"?e:e+""}function xi(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)}var wi=!1,lr=(function(){function t(e,n,r){if(yi(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(ne(n)&&ne(n.countries)){r=n;var o=e;if(!Ei.test(o))throw new Error('Invalid `number` argument passed: must consist of a "+" followed by digits');var d=Te(o,void 0,void 0,void 0,r),i=d.countryCallingCode,s=d.number;if(n=s,e=i,!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");It(r);var c=Pi(e,r),l=c.country,$=c.countryCallingCode;this.country=l,this.countryCallingCode=$,this.nationalNumber=n,this.number="+"+this.countryCallingCode+this.nationalNumber,this.getMetadata=function(){return r}}return _i(t,[{key:"setExt",value:function(n){this.ext=n}},{key:"getPossibleCountries",value:function(){return this.country?[this.country]:Ft(this.countryCallingCode,this.nationalNumber,this.getMetadata())}},{key:"isPossible",value:function(){return Tt(this,{v2:!0},this.getMetadata())}},{key:"isValid",value:function(){return Mt(this,{v2:!0},this.getMetadata())}},{key:"isNonGeographic",value:function(){var n=new T(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 pe(this,{v2:!0},this.getMetadata())}},{key:"format",value:function(n,r){return Wt(this,n,r?dr(dr({},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 Pi(t,e){var n,r,o=new T(e);return Ci(t)?(n=t,o.selectNumberingPlan(n),r=o.countryCallingCode()):(r=t,wi&&o.isNonGeographicCallingCode(r)&&(n="001")),{country:n,countryCallingCode:r}}var Ei=/^\+\d+$/;function ve(t){"@babel/helpers - typeof";return ve=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},ve(t)}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,Si(r.key),r)}}function ki(t,e,n){return e&&pr(t.prototype,e),n&&pr(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function Si(t){var e=Ii(t,"string");return ve(e)=="symbol"?e:e+""}function Ii(t,e){if(ve(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(ve(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Ni(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Ti(t,e,n){return e=Fe(e),Ai(t,Kt()?Reflect.construct(e,n||[],Fe(t).constructor):e.apply(t,n))}function Ai(t,e){if(e&&(ve(e)=="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Oi(t)}function Oi(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Mi(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&&Me(t,e)}function zt(t){var e=typeof Map=="function"?new Map:void 0;return zt=function(r){if(r===null||!Ri(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 Fi(r,arguments,Fe(this).constructor)}return o.prototype=Object.create(r.prototype,{constructor:{value:o,enumerable:!1,writable:!0,configurable:!0}}),Me(o,r)},zt(t)}function Fi(t,e,n){if(Kt())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,e);var o=new(t.bind.apply(t,r));return n&&Me(o,n.prototype),o}function Kt(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Kt=function(){return!!t})()}function Ri(t){try{return Function.toString.call(t).indexOf("[native code]")!==-1}catch{return typeof t=="function"}}function Me(t,e){return Me=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},Me(t,e)}function Fe(t){return Fe=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Fe(t)}var Z=(function(t){function e(n){var r;return Ni(this,e),r=Ti(this,e,[n]),Object.setPrototypeOf(r,e.prototype),r.name=r.constructor.name,r}return Mi(e,t),ki(e)})(zt(Error));var cr=new RegExp("(?:"+Ae()+")$","i");function Xt(t){var e=t.search(cr);if(e<0)return{};for(var n=t.slice(0,e),r=t.match(cr),o=1;o<r.length;){if(r[o])return{number:n,ext:r[o]};o++}}var Di={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 ur(t){return Di[t]}function Li(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.
|
|
1452
|
+
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 $r(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)?$r(t,e):void 0}}function $r(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=Li(t.split("")),r;!(r=n()).done;){var o=r.value;e+=Ui(o,e)||""}return e}function Ui(t,e,n){if(t==="+"){if(e){typeof n=="function"&&n("end");return}return"+"}return ur(t)}var qt="+",ji="[\\-\\.\\(\\)]?",fr="(["+K+"]|"+ji+")",Bi="^\\"+qt+fr+"*["+K+"]"+fr+"*$",Vi=new RegExp(Bi,"g"),Yt=K,Gi="["+Yt+"]+((\\-)*["+Yt+"])*",Wi="a-zA-Z",zi="["+Wi+"]+((\\-)*["+Yt+"])*",Ki="^("+Gi+"\\.)*"+zi+"\\.?$",Xi=new RegExp(Ki,"g"),Jt="tel:",it=";phone-context=",hr=";isub=";function Zt(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 gr(t){return t===null?!0:t.length===0?!1:Vi.test(t)||Xi.test(t)}function Qt(t,e){var n=e.extractFormattedPhoneNumber,r=Zt(t);if(!gr(r))throw new Z("NOT_A_NUMBER");var o;if(r===null)o=n(t)||"";else{o="",r.charAt(0)===qt&&(o+=r);var d=t.indexOf(Jt),i;d>=0?i=d+Jt.length:i=0;var s=t.indexOf(it);o+=t.substring(i,s)}var c=o.indexOf(hr);if(c>0&&(o=o.substring(0,c)),o!=="")return o}var Yi=250,qi=new RegExp("["+Ie+K+"]"),Ji=new RegExp("[^"+K+"#]+$"),Zi=!1;function en(t,e,n){if(e=e||{},n=new T(n),e.defaultCountry&&!n.hasCountry(e.defaultCountry))throw e.v2?new Z("INVALID_COUNTRY"):new Error("Unknown country: ".concat(e.defaultCountry));var r=ed(t,e.v2,e.extract),o=r.number,d=r.ext,i=r.error;if(!o){if(e.v2)throw i==="TOO_SHORT"?new Z("TOO_SHORT"):new Z("NOT_A_NUMBER");return{}}var s=nd(o,e.defaultCountry,e.defaultCallingCode,n),c=s.country,l=s.nationalNumber,$=s.countryCallingCode,p=s.countryCallingCodeSource,f=s.carrierCode;if(!n.hasSelectedNumberingPlan()){if(e.v2)throw new Z("INVALID_COUNTRY");return{}}if(!l||l.length<Se){if(e.v2)throw new Z("TOO_SHORT");return{}}if(l.length>Qn){if(e.v2)throw new Z("TOO_LONG");return{}}if(e.v2){var h=new lr($,l,n.metadata);return c&&(h.country=c),f&&(h.carrierCode=f),d&&(h.ext=d),h.__countryCallingCodeSource=p,h}var v=(e.extended?n.hasSelectedNumberingPlan():c)?z(l,n.nationalNumberPattern()):!1;return e.extended?{country:c,countryCallingCode:$,carrierCode:f,valid:v,possible:v?!0:!!(e.extended===!0&&n.possibleLengths()&&At(l,c,n)),phone:l,ext:d}:v?td(c,l,d):{}}function Qi(t,e,n){if(t){if(t.length>Yi){if(n)throw new Z("TOO_LONG");return}if(e===!1)return t;var r=t.search(qi);if(!(r<0))return t.slice(r).replace(Ji,"")}}function ed(t,e,n){var r=Qt(t,{extractFormattedPhoneNumber:function(i){return Qi(i,n,e)}});if(!r)return{};if(!Vt(r))return nr(r)?{error:"TOO_SHORT"}:{};var o=Xt(r);return o.ext?o:{number:r}}function td(t,e,n){var r={country:t,phone:e};return n&&(r.ext=n),r}function nd(t,e,n,r){var o=Te(ot(t),void 0,e,n,r.metadata),d=o.countryCallingCodeSource,i=o.countryCallingCode,s=o.number,c;if(i)r.selectNumberingPlan(i);else if(s&&(e||n))r.selectNumberingPlan(e,n),e?c=e:Zi&&r.isNonGeographicCallingCode(n)&&(c="001"),i=n||ae(e,r.metadata);else return{};if(!s)return{countryCallingCodeSource:d,countryCallingCode:i};var l=me(ot(s),c,r),$=l.nationalNumber,p=l.carrierCode,f=Ne(i,{nationalNumber:$,metadata:r});return f&&(c=f,f==="001"||r.selectNumberingPlan(c)),{country:c,countryCallingCode:i,countryCallingCodeSource:d,nationalNumber:$,carrierCode:p}}function Re(t){"@babel/helpers - typeof";return Re=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},Re(t)}function mr(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 br(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?mr(Object(n),!0).forEach(function(r){rd(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):mr(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function rd(t,e,n){return(e=od(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function od(t){var e=id(t,"string");return Re(e)=="symbol"?e:e+""}function id(t,e){if(Re(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(Re(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function De(t,e,n){return en(t,br(br({},e),{},{v2:!0}),n)}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 vr(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 dd(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?vr(Object(n),!0).forEach(function(r){sd(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):vr(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function sd(t,e,n){return(e=ad(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function ad(t){var e=ld(t,"string");return Le(e)=="symbol"?e:e+""}function ld(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 pd(t,e){return fd(t)||$d(t,e)||ud(t,e)||cd()}function cd(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
1453
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ud(t,e){if(t){if(typeof t=="string")return yr(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)?yr(t,e):void 0}}function yr(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 $d(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var r,o,d,i,s=[],c=!0,l=!1;try{if(d=(n=n.call(t)).next,e===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=d.call(n)).done)&&(s.push(r.value),s.length!==e);c=!0);}catch($){l=!0,o=$}finally{try{if(!c&&n.return!=null&&(i=n.return(),Object(i)!==i))return}finally{if(l)throw o}}return s}}function fd(t){if(Array.isArray(t))return t}function He(t){var e=Array.prototype.slice.call(t),n=pd(e,4),r=n[0],o=n[1],d=n[2],i=n[3],s,c,l;if(typeof r=="string")s=r;else throw new TypeError("A text for parsing must be a string.");if(!o||typeof o=="string")i?(c=d,l=i):(c=void 0,l=d),o&&(c=dd({defaultCountry:o},c));else if(ne(o))d?(c=o,l=d):l=o;else throw new Error("Invalid second argument: ".concat(o));return{text:s,options:c,metadata:l}}function Ue(){var t=He(arguments),e=t.text,n=t.options,r=t.metadata;return De(e,n,r)}function je(t){"@babel/helpers - typeof";return je=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},je(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){hd(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 hd(t,e,n){return(e=gd(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function gd(t){var e=md(t,"string");return je(e)=="symbol"?e:e+""}function md(t,e){if(je(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(je(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function tn(t,e,n){e&&e.defaultCountry&&!Xn(e.defaultCountry,n)&&(e=xr(xr({},e),{},{defaultCountry:void 0}));try{return De(t,e,n)}catch(r){if(!(r instanceof Z))throw r}}function Be(t){"@babel/helpers - typeof";return Be=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},Be(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 Cr(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){bd(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 bd(t,e,n){return(e=vd(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function vd(t){var e=yd(t,"string");return Be(e)=="symbol"?e:e+""}function yd(t,e){if(Be(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(Be(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function dt(){var t=He(arguments),e=t.text,n=t.options,r=t.metadata;n=Cr(Cr({},n),{},{extract:!1});var o=tn(e,n,r);return o&&o.isValid()||!1}function st(){return ke(Ue,arguments)}function at(){return ke(dt,arguments)}var nn=[{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 _d(t){return nn.find(e=>e.code===t.toUpperCase())}var Pr=_d("FR");var xd=0;function a(t,e,n,r,o,d){e||(e={});var i,s,c=e;if("ref"in c)for(s in c={},e)s=="ref"?i=e[s]:c[s]=e[s];var l={type:t,props:c,key:n,ref:i,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--xd,__i:-1,__u:0,__source:o,__self:d};if(typeof t=="function"&&(i=t.defaultProps))for(s in i)c[s]===void 0&&(c[s]=i[s]);return N.vnode&&N.vnode(l),l}var wd=()=>a("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[a("rect",{x:"2",y:"4",width:"20",height:"16",rx:"2"}),a("path",{d:"M22 7l-10 7L2 7"})]}),Cd=()=>a("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:a("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"})}),Pd=()=>a("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:a("path",{d:"M6 9l6 6 6-6"})});function Er(t){return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(t)}function kr({client:t,config:e,onComplete:n,onSkip:r}){let o=e.fields==="email-only",d=e.fields==="phone-only",i=e.fields==="email-and-phone",s=e.fields==="email-or-phone",c=()=>d?"phone":"email",[l,$]=S(c()),[p,f]=S(""),[h,v]=S(""),[k,w]=S(Pr),[m,g]=S(!1),[D,O]=S(""),[G,M]=S(""),[q,U]=S(""),[X,B]=S(!1),L=te(null),Y=te(null);J(()=>{let _=V=>{L.current&&!L.current.contains(V.target)&&g(!1)};return document.addEventListener("mousedown",_),()=>document.removeEventListener("mousedown",_)},[]),J(()=>{m&&Y.current&&Y.current.focus()},[m]);let ye=nn.filter(_=>_.name.toLowerCase().includes(D.toLowerCase())||_.dialCode.includes(D)||_.code.toLowerCase().includes(D.toLowerCase())),ce=_=>{w(_),g(!1),O("")},ue=_=>_.replace(/\D/g,""),_e=_=>{let V=_.target,xe=ue(V.value);v(xe),U("")},re=()=>h?`${k.dialCode}${h}`:"",ee=()=>{let _=!0;if((o||i)&&(p.trim()?Er(p)||(M("Please enter a valid email"),_=!1):(M("Email is required"),_=!1)),d||i){let V=re();h.trim()?at(V,k.code)||(U("Please enter a valid phone number"),_=!1):(U("Phone number is required"),_=!1)}if(s)if(l==="email")p.trim()?Er(p)||(M("Please enter a valid email"),_=!1):(M("Email is required"),_=!1);else{let V=re();h.trim()?at(V,k.code)||(U("Please enter a valid phone number"),_=!1):(U("Phone number is required"),_=!1)}return _},W=async _=>{if(_.preventDefault(),!!ee()){B(!0);try{let V={};if((o||i||s&&l==="email")&&(V.email=p.trim()),d||i||s&&l==="phone"){let xe=re(),$e=st(xe,k.code);$e&&(V.phone=$e.format("E.164"),V.phoneCountry=k.code)}await t.submitPreChat(V),n()}catch(V){console.error("[PreChatForm] Submit error:",V),l==="email"||o||i?M("Something went wrong. Please try again."):U("Something went wrong. Please try again.")}finally{B(!1)}}},de=()=>a("div",{class:"pp-prechat-field",children:[a("label",{class:"pp-prechat-label",children:"Email address"}),a("input",{type:"email",class:`pp-prechat-input ${G?"error":""}`,placeholder:"you@example.com",value:p,onInput:_=>{f(_.target.value),M("")}}),G&&a("div",{class:"pp-prechat-error",children:G})]}),Q=()=>a("div",{class:"pp-prechat-field",children:[a("label",{class:"pp-prechat-label",children:"Phone number"}),a("div",{class:"pp-phone-input-wrapper",children:[a("div",{class:"pp-country-select",ref:L,children:[a("button",{type:"button",class:"pp-country-btn",onClick:()=>g(!m),children:[a("span",{class:"pp-country-flag",children:k.flag}),a("span",{class:"pp-country-code",children:k.dialCode}),a(Pd,{})]}),m&&a("div",{class:"pp-country-dropdown",children:[a("div",{class:"pp-country-search",children:a("input",{ref:Y,type:"text",class:"pp-country-search-input",placeholder:"Search country...",value:D,onInput:_=>O(_.target.value)})}),a("div",{class:"pp-country-list",children:ye.map(_=>a("div",{class:`pp-country-option ${_.code===k.code?"selected":""}`,onClick:()=>ce(_),children:[a("span",{class:"pp-country-flag",children:_.flag}),a("span",{class:"pp-country-name",children:_.name}),a("span",{class:"pp-country-dial",children:_.dialCode})]},_.code))})]})]}),a("input",{type:"tel",class:`pp-prechat-input pp-phone-number-input ${q?"error":""}`,placeholder:"612 345 678",value:h,onInput:_e})]}),q&&a("div",{class:"pp-prechat-error",children:q})]});return a("div",{class:"pp-prechat",children:[a("h2",{class:"pp-prechat-title",children:"How can we reach you?"}),a("p",{class:"pp-prechat-subtitle",children:i?"Please provide your contact information so we can follow up if needed.":s?"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."}),a("form",{onSubmit:W,children:[s&&a("div",{class:"pp-prechat-tabs",children:[a("button",{type:"button",class:`pp-prechat-tab ${l==="email"?"active":""}`,onClick:()=>{$("email"),U("")},children:[a(wd,{}),"Email"]}),a("button",{type:"button",class:`pp-prechat-tab ${l==="phone"?"active":""}`,onClick:()=>{$("phone"),M("")},children:[a(Cd,{}),"Phone"]})]}),o&&de(),d&&Q(),i&&a(F,{children:[de(),Q()]}),s&&a(F,{children:[l==="email"&&de(),l==="phone"&&Q()]}),a("button",{type:"submit",class:"pp-prechat-submit",disabled:X,children:X?"Submitting...":"Start chatting"}),!e.required&&a("button",{type:"button",class:"pp-prechat-skip",onClick:r,children:"Skip for now"})]})]})}function Ed(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()),d=Math.floor((r.getTime()-o.getTime())/(1e3*60*60*24));return d===0?"Today":d===1?"Yesterday":n.toLocaleDateString("en-US",{month:"short",day:"numeric",year:n.getFullYear()!==e.getFullYear()?"numeric":void 0})}function Sr(t){let e=new Date(t);return`${e.getFullYear()}-${e.getMonth()}-${e.getDate()}`}function Fr({client:t,config:e}){let[n,r]=S(!1),[o,d]=S([]),[i,s]=S(""),[c,l]=S(!1),[$,p]=S(!1),[f,h]=S(!1),[v,k]=S(0),[w,m]=S([]),[g,D]=S(!1),[O,G]=S(null),[M,q]=S(null),[U,X]=S(""),[B,L]=S(null),[Y,ye]=S(!1),[ce,ue]=S(null),[_e,re]=S(0),ee=te(null),[W,de]=S(e),[Q,_]=S(void 0),[V,xe]=S(!1),$e=te(null),ut=te(null),on=te(null),Qr=te(null);J(()=>{let u=t.on("openChange",r),y=t.on("message",()=>{d([...t.getMessages()])}),P=t.on("typing",b=>{l(b.isTyping)}),E=t.on("presence",b=>{p(b.online)}),I=t.on("connect",()=>{h(!0),d(t.getMessages()),p(t.getSession()?.operatorOnline??!1),de(t.getConfig()),_(t.getSession()?.preChatForm)}),A=t.on("preChatCompleted",()=>{_(b=>b&&{...b,completed:!0})}),x=t.on("configUpdate",()=>{de(t.getConfig())});return t.isConnected()&&(h(!0),d(t.getMessages()),p(t.getSession()?.operatorOnline??!1),de(t.getConfig()),_(t.getSession()?.preChatForm)),()=>{u(),y(),P(),E(),I(),A(),x()}},[t]),J(()=>{n&&$e.current?.scrollIntoView({behavior:"smooth"})},[o,n]),J(()=>{n&&(setTimeout(()=>{$e.current?.scrollIntoView({behavior:"auto"})},50),ut.current?.focus(),k(0))},[n]),J(()=>{if(!n&&o.length>0){let u=o.filter(y=>y.sender!=="visitor"&&y.status!=="read").length;k(u)}},[o,n]);let Ve=Hn(()=>{if(!n||!f)return;let u=o.filter(y=>y.sender!=="visitor"&&y.status!=="read");if(u.length>0){let y=u.map(P=>P.id);t.sendReadStatus(y,"read")}},[n,f,o,t]);if(J(()=>{if(!n||!f)return;let u=setTimeout(()=>{Ve()},1e3);return()=>clearTimeout(u)},[n,f,o,Ve]),J(()=>{let u=()=>{document.visibilityState==="visible"&&n&&Ve()};return document.addEventListener("visibilitychange",u),()=>document.removeEventListener("visibilitychange",u)},[n,Ve]),J(()=>{let u=t.on("read",()=>{d([...t.getMessages()])});return()=>u()},[t]),!kd(W))return null;let eo=async u=>{u.preventDefault();let y=i.trim().length>0,P=w.filter(x=>x.status==="ready"&&x.attachment);if(!y&&P.length===0)return;let E=i,I=P.map(x=>x.attachment.id),A=O?.id;s(""),m([]),G(null);try{await t.sendMessage(E,I,A)}catch(x){console.error("[PocketPing] Failed to send message:",x)}},to=u=>{let y=u.target;s(y.value),t.sendTyping(!0)},no=async u=>{let y=u.target,P=y.files;if(!P||P.length===0)return;let E=[];for(let I=0;I<P.length;I++){let A=P[I],x=`pending-${Date.now()}-${I}`,b;A.type.startsWith("image/")&&(b=URL.createObjectURL(A)),E.push({id:x,file:A,preview:b,progress:0,status:"pending"})}m(I=>[...I,...E]),y.value="",D(!0);for(let I of E)try{m(x=>x.map(b=>b.id===I.id?{...b,status:"uploading"}:b));let A=await t.uploadFile(I.file,x=>{m(b=>b.map(We=>We.id===I.id?{...We,progress:x}:We))});m(x=>x.map(b=>b.id===I.id?{...b,status:"ready",progress:100,attachment:A}:b))}catch(A){console.error("[PocketPing] Failed to upload file:",A),m(x=>x.map(b=>b.id===I.id?{...b,status:"error",error:"Upload failed"}:b))}D(!1)},ro=u=>{m(y=>{let P=y.find(E=>E.id===u);return P?.preview&&URL.revokeObjectURL(P.preview),y.filter(E=>E.id!==u)})},dn=u=>{G(u),L(null),ut.current?.focus()},oo=()=>{G(null)},sn=u=>{u.sender==="visitor"&&(q(u),X(u.content),L(null))},an=()=>{q(null),X("")},io=async()=>{if(!(!M||!U.trim()))try{await t.editMessage(M.id,U.trim()),q(null),X("")}catch(u){console.error("[PocketPing] Failed to edit message:",u)}},ln=async u=>{if(u.sender==="visitor"&&(L(null),confirm("Delete this message?")))try{await t.deleteMessage(u.id)}catch(y){console.error("[PocketPing] Failed to delete message:",y)}},so=(u,y)=>{u.preventDefault();let P=u;L({message:y,x:P.clientX,y:P.clientY})},ao=(u,y)=>{let P=u.touches[0];ee.current={x:P.clientX,y:P.clientY,time:Date.now()},ce&&ce!==y.id&&(ue(null),re(0))},lo=(u,y)=>{if(!ee.current)return;let P=u.touches[0],E=P.clientX-ee.current.x,I=P.clientY-ee.current.y;if(!(Math.abs(I)>Math.abs(E))&&E<0){let A=Math.max(E,-100);re(A),ue(y.id)}},pn=u=>{if(!ee.current)return;let y=Date.now()-ee.current.time;_e<-50||_e<-20&&y<200?(re(-80),navigator.vibrate&&navigator.vibrate(30)):(re(0),ue(null)),ee.current=null},Ge=()=>{ue(null),re(0)};J(()=>{if(!B)return;let u=()=>L(null);return document.addEventListener("click",u),()=>document.removeEventListener("click",u)},[B]);let cn=u=>{let y=document.getElementById(`pp-msg-${u}`);y&&(y.scrollIntoView({behavior:"smooth",block:"center"}),y.classList.add("pp-message-highlight"),setTimeout(()=>{y.classList.remove("pp-message-highlight")},1500))},we=te(0),po=u=>{u.preventDefault(),u.stopPropagation(),we.current++,we.current===1&&ye(!0)},co=u=>{u.preventDefault(),u.stopPropagation()},uo=u=>{u.preventDefault(),u.stopPropagation(),we.current--,we.current===0&&ye(!1)},$o=async u=>{u.preventDefault(),u.stopPropagation(),we.current=0,ye(!1);let y=u.dataTransfer?.files;if(!y||y.length===0)return;let P=[];for(let E=0;E<y.length;E++){let I=y[E],A=`pending-${Date.now()}-${E}`,x;I.type.startsWith("image/")&&(x=URL.createObjectURL(I)),P.push({id:A,file:I,preview:x,progress:0,status:"pending"})}m(E=>[...E,...P]),D(!0);for(let E of P)try{m(A=>A.map(x=>x.id===E.id?{...x,status:"uploading"}:x));let I=await t.uploadFile(E.file,A=>{m(x=>x.map(b=>b.id===E.id?{...b,progress:A}:b))});m(A=>A.map(x=>x.id===E.id?{...x,status:"ready",progress:100,attachment:I}:x))}catch(I){console.error("[PocketPing] Failed to upload dropped file:",I),m(A=>A.map(x=>x.id===E.id?{...x,status:"error",error:"Upload failed"}:x))}D(!1)},un=W.position??"bottom-right",$t=Sd(W.theme??"auto"),fo=W.primaryColor??"#6366f1",$n=$t==="dark"?"#9ca3af":"#6b7280",ho={primaryColor:fo,theme:$t,headerColor:W.headerColor,footerColor:W.footerColor,chatBackground:W.chatBackground,toggleColor:W.toggleColor},ft=Q&&Q.enabled&&!Q.completed&&!V&&(Q.timing==="before-first-message"&&o.length===0||Q.timing==="after-first-message"&&o.some(u=>u.sender==="visitor"));return a(F,{children:[a("style",{children:Bn(ho)}),!n&&a("button",{class:`pp-toggle pp-${un}`,onClick:()=>t.toggleOpen(),"aria-label":"Open chat",children:[a(Id,{}),v>0&&a("span",{class:"pp-unread-badge",children:v>9?"9+":v}),v===0&&$&&a("span",{class:"pp-online-dot"})]}),n&&a("div",{class:`pp-window pp-${un} pp-theme-${$t} ${Y?"pp-dragging":""}`,onDragEnter:po,onDragOver:co,onDragLeave:uo,onDrop:$o,children:[Y&&a("div",{class:"pp-drop-overlay",children:[a("div",{class:"pp-drop-icon",children:a(Tr,{})}),a("div",{class:"pp-drop-text",children:"Drop files to upload"})]}),a("div",{class:"pp-header",children:[a("div",{class:"pp-header-info",children:[W.operatorAvatar&&a("img",{src:W.operatorAvatar,alt:"",class:"pp-avatar"}),a("div",{children:[a("div",{class:"pp-header-title",children:W.operatorName??"Support"}),a("div",{class:"pp-header-status",children:$?a(F,{children:[a("span",{class:"pp-status-dot pp-online"})," Online"]}):a(F,{children:[a("span",{class:"pp-status-dot"})," Away"]})})]})]}),a("button",{class:"pp-close-btn",onClick:()=>t.setOpen(!1),"aria-label":"Close chat",children:a(lt,{})})]}),ft&&Q&&a(kr,{client:t,config:Q,onComplete:()=>{_(u=>u&&{...u,completed:!0})},onSkip:()=>{xe(!0)}}),!ft&&a("div",{class:"pp-messages",ref:Qr,onClick:()=>ce&&Ge(),children:[W.welcomeMessage&&o.length===0&&a("div",{class:"pp-welcome",children:W.welcomeMessage}),o.map((u,y)=>{let P=!!u.deletedAt,E=!!u.editedAt,I=new Date(u.timestamp),A=y>0?o[y-1]:null,x=!A||Sr(new Date(A.timestamp))!==Sr(I),b=null;if(u.replyTo)if(typeof u.replyTo=="object")b=u.replyTo;else{let j=o.find(ze=>ze.id===u.replyTo);if(j){let ze=!!(j.attachments&&j.attachments.length>0);b={id:j.id,sender:j.sender,content:j.content,deleted:!!j.deletedAt,hasAttachment:ze,attachmentType:ze?j.attachments[0].mimeType:void 0}}}let go=ce===u.id?_e:0;return a(F,{children:[x&&a("div",{class:"pp-date-separator",children:a("span",{children:Ed(I)})}),a("div",{class:`pp-message-swipe-container ${u.sender==="visitor"?"pp-swipe-left":"pp-swipe-right"}`,children:[a("div",{class:"pp-swipe-actions",children:[a("button",{class:"pp-swipe-action pp-swipe-reply",onClick:()=>{dn(u),Ge()},children:a(Ar,{color:"#fff"})}),u.sender==="visitor"&&!P&&a(F,{children:[a("button",{class:"pp-swipe-action pp-swipe-edit",onClick:()=>{sn(u),Ge()},children:a(Or,{color:"#fff"})}),a("button",{class:"pp-swipe-action pp-swipe-delete",onClick:()=>{ln(u),Ge()},children:a(Mr,{color:"#fff"})})]})]}),a("div",{id:`pp-msg-${u.id}`,class:`pp-message pp-message-${u.sender} ${P?"pp-message-deleted":""}`,style:{transform:`translateX(${go}px)`,transition:ee.current?"none":"transform 0.2s ease-out"},onContextMenu:j=>so(j,u),onTouchStart:j=>ao(j,u),onTouchMove:j=>lo(j,u),onTouchEnd:()=>pn(u),onTouchCancel:()=>pn(u),children:[b&&(b.content||b.hasAttachment)&&a("div",{class:"pp-reply-quote pp-reply-quote-clickable",onClick:()=>cn(b.id),role:"button",tabIndex:0,onKeyDown:j=>j.key==="Enter"&&cn(b.id),children:[a("span",{class:"pp-reply-sender",children:b.sender==="visitor"?"You":"Support"}),a("span",{class:"pp-reply-content",children:b.deleted?"Message deleted":a(F,{children:[b.hasAttachment&&a("span",{class:"pp-reply-attachment-icon",children:b.attachmentType?.startsWith("image/")?"\u{1F4F7} ":"\u{1F4CE} "}),b.content?a(F,{children:[(b.content||"").slice(0,50),(b.content||"").length>50?"...":""]}):b.attachmentType?.startsWith("image/")?"Photo":"File"]})})]}),P?a("div",{class:"pp-message-content pp-deleted-content",children:[a("span",{class:"pp-deleted-icon",children:"\u{1F5D1}\uFE0F"})," Message deleted"]}):a(F,{children:[u.content&&a("div",{class:"pp-message-content",children:[u.content,a("span",{class:"pp-message-time",children:[Ir(u.timestamp),E&&a("span",{class:"pp-edited-badge",children:"edited"}),u.sender==="ai"&&a("span",{class:"pp-ai-badge",children:"AI"}),u.sender==="visitor"&&a("span",{class:`pp-status pp-status-${u.status??"sent"}`,children:a(Nr,{status:u.status})})]})]}),u.attachments&&u.attachments.length>0&&a("div",{class:"pp-message-attachments",children:[u.attachments.map(j=>a(Td,{attachment:j},j.id)),!u.content&&a("span",{class:"pp-message-time pp-attachment-time",children:[Ir(u.timestamp),E&&a("span",{class:"pp-edited-badge",children:"edited"}),u.sender==="ai"&&a("span",{class:"pp-ai-badge",children:"AI"}),u.sender==="visitor"&&a("span",{class:`pp-status pp-status-${u.status??"sent"}`,children:a(Nr,{status:u.status})})]})]})]})]})]})]},u.id)}),c&&a("div",{class:"pp-message pp-message-operator pp-typing",children:[a("span",{}),a("span",{}),a("span",{})]}),a("div",{ref:$e})]}),B&&a("div",{class:"pp-message-menu",style:{top:`${B.y}px`,left:`${B.x}px`},children:[a("button",{onClick:()=>dn(B.message),children:[a(Ar,{color:$n})," Reply"]}),B.message.sender==="visitor"&&!B.message.deletedAt&&a(F,{children:[a("button",{onClick:()=>sn(B.message),children:[a(Or,{color:$n})," Edit"]}),a("button",{class:"pp-menu-delete",onClick:()=>ln(B.message),children:[a(Mr,{color:"#ef4444"})," Delete"]})]})]}),M&&a("div",{class:"pp-edit-modal",children:[a("div",{class:"pp-edit-header",children:[a("span",{children:"Edit message"}),a("button",{onClick:an,children:a(lt,{})})]}),a("textarea",{class:"pp-edit-input",value:U,onInput:u=>X(u.target.value),autoFocus:!0}),a("div",{class:"pp-edit-actions",children:[a("button",{class:"pp-edit-cancel",onClick:an,children:"Cancel"}),a("button",{class:"pp-edit-save",onClick:io,disabled:!U.trim(),children:"Save"})]})]}),O&&a("div",{class:"pp-reply-preview",children:[a("div",{class:"pp-reply-preview-content",children:[a("span",{class:"pp-reply-label",children:"Replying to"}),a("span",{class:"pp-reply-text",children:[O.attachments&&O.attachments.length>0&&a("span",{class:"pp-reply-attachment-icon",children:O.attachments[0].mimeType.startsWith("image/")?"\u{1F4F7} ":"\u{1F4CE} "}),O.content?a(F,{children:[O.content.slice(0,50),O.content.length>50?"...":""]}):O.attachments?.[0]?.mimeType.startsWith("image/")?"Photo":"File"]})]}),a("button",{class:"pp-reply-cancel",onClick:oo,children:a(lt,{})})]}),w.length>0&&a("div",{class:"pp-attachments-preview",children:w.map(u=>a("div",{class:`pp-attachment-preview pp-attachment-${u.status}`,children:[u.preview?a("img",{src:u.preview,alt:u.file.name,class:"pp-preview-img"}):a("div",{class:"pp-preview-file",children:a(Rr,{mimeType:u.file.type})}),a("button",{class:"pp-remove-attachment",onClick:()=>ro(u.id),"aria-label":"Remove attachment",type:"button",children:a(lt,{})}),u.status==="uploading"&&a("div",{class:"pp-upload-progress",style:{width:`${u.progress}%`}}),u.status==="error"&&a("div",{class:"pp-upload-error",title:u.error,children:"!"})]},u.id))}),!ft&&a("form",{class:"pp-input-form",onSubmit:eo,children:[a("input",{ref:u=>{on.current=u,u&&(u.onchange=no)},type:"file",class:"pp-file-input",accept:"image/*,audio/*,video/*,.pdf,.doc,.docx,.xls,.xlsx,.txt",multiple:!0}),a("button",{type:"button",class:"pp-attach-btn",onClick:()=>on.current?.click(),disabled:!f||g,"aria-label":"Attach file",children:a(Tr,{})}),a("input",{ref:ut,type:"text",class:"pp-input",placeholder:W.placeholder??"Type a message...",value:i,onInput:to,disabled:!f}),a("button",{type:"submit",class:"pp-send-btn",disabled:!i.trim()&&w.filter(u=>u.status==="ready").length===0||!f||g,"aria-label":"Send message",children:a(Nd,{})})]}),a("div",{class:"pp-footer",children:["Powered by ",a("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 Sd(t){return t==="auto"?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":t}function Ir(t){return new Date(t).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}function Id(){return a("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2",children:a("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 lt(){return a("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2",children:[a("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),a("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})}function Nd(){return a("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2",children:[a("line",{x1:"22",y1:"2",x2:"11",y2:"13"}),a("polygon",{points:"22 2 15 22 11 13 2 9 22 2"})]})}function Nr({status:t}){return!t||t==="sending"||t==="sent"?a("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor","stroke-width":"2",class:"pp-check",children:a("polyline",{points:"3 8 7 12 13 4"})}):t==="delivered"?a("svg",{viewBox:"0 0 20 16",fill:"none",stroke:"currentColor","stroke-width":"2",class:"pp-check-double",children:[a("polyline",{points:"1 8 5 12 11 4"}),a("polyline",{points:"7 8 11 12 17 4"})]}):t==="read"?a("svg",{viewBox:"0 0 20 16",fill:"none",stroke:"currentColor","stroke-width":"2",class:"pp-check-double pp-check-read",children:[a("polyline",{points:"1 8 5 12 11 4"}),a("polyline",{points:"7 8 11 12 17 4"})]}):null}function Tr(){return a("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2",children:a("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 Ar({color:t,size:e=16}){return a("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:[a("polyline",{points:"9 17 4 12 9 7"}),a("path",{d:"M20 18v-2a4 4 0 0 0-4-4H4"})]})}function Or({color:t,size:e=16}){return a("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:a("path",{d:"M17 3a2.828 2.828 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5L17 3z"})})}function Mr({color:t,size:e=16}){return a("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:[a("polyline",{points:"3 6 5 6 21 6"}),a("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 Rr({mimeType:t}){return t==="application/pdf"?a("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2",children:[a("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),a("polyline",{points:"14 2 14 8 20 8"}),a("path",{d:"M9 15h6"}),a("path",{d:"M9 11h6"})]}):t.startsWith("audio/")?a("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2",children:[a("path",{d:"M9 18V5l12-2v13"}),a("circle",{cx:"6",cy:"18",r:"3"}),a("circle",{cx:"18",cy:"16",r:"3"})]}):t.startsWith("video/")?a("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2",children:[a("rect",{x:"2",y:"2",width:"20",height:"20",rx:"2.18",ry:"2.18"}),a("line",{x1:"7",y1:"2",x2:"7",y2:"22"}),a("line",{x1:"17",y1:"2",x2:"17",y2:"22"}),a("line",{x1:"2",y1:"12",x2:"22",y2:"12"}),a("line",{x1:"2",y1:"7",x2:"7",y2:"7"}),a("line",{x1:"2",y1:"17",x2:"7",y2:"17"}),a("line",{x1:"17",y1:"17",x2:"22",y2:"17"}),a("line",{x1:"17",y1:"7",x2:"22",y2:"7"})]}):a("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2",children:[a("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),a("polyline",{points:"14 2 14 8 20 8"})]})}function Td({attachment:t}){let e=t.mimeType.startsWith("image/"),n=t.mimeType.startsWith("audio/"),r=t.mimeType.startsWith("video/"),o=d=>d<1024?`${d} B`:d<1024*1024?`${(d/1024).toFixed(1)} KB`:`${(d/(1024*1024)).toFixed(1)} MB`;return e?a("a",{href:t.url,target:"_blank",rel:"noopener",class:"pp-attachment pp-attachment-image",children:a("img",{src:t.thumbnailUrl||t.url,alt:t.filename})}):n?a("div",{class:"pp-attachment pp-attachment-audio",children:[a("audio",{controls:!0,preload:"metadata",children:a("source",{src:t.url,type:t.mimeType})}),a("span",{class:"pp-attachment-name",children:t.filename})]}):r?a("div",{class:"pp-attachment pp-attachment-video",children:a("video",{controls:!0,preload:"metadata",children:a("source",{src:t.url,type:t.mimeType})})}):a("a",{href:t.url,target:"_blank",rel:"noopener",class:"pp-attachment pp-attachment-file",children:[a(Rr,{mimeType:t.mimeType}),a("div",{class:"pp-attachment-info",children:[a("span",{class:"pp-attachment-name",children:t.filename}),a("span",{class:"pp-attachment-size",children:o(t.size)})]})]})}var pt="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(),d=new URLSearchParams(window.location.search).get("pp_inspector"),i=await this.fetch("/connect",{method:"POST",body:JSON.stringify({visitorId:e,sessionId:n,inspectorToken:d||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:i.sessionId,visitorId:i.visitorId,operatorOnline:i.operatorOnline??!1,messages:i.messages??[],identity:i.identity||r||void 0,preChatForm:i.preChatForm},i.operatorName&&(this.config.operatorName=i.operatorName),i.operatorAvatar&&(this.config.operatorAvatar=i.operatorAvatar),i.primaryColor&&(this.config.primaryColor=i.primaryColor),i.headerColor&&(this.config.headerColor=i.headerColor),i.footerColor&&(this.config.footerColor=i.footerColor),i.chatBackground&&(this.config.chatBackground=i.chatBackground),i.toggleColor&&(this.config.toggleColor=i.toggleColor),i.welcomeMessage&&(this.config.welcomeMessage=i.welcomeMessage),this.emit("configUpdate",{operatorName:this.config.operatorName,operatorAvatar:this.config.operatorAvatar,primaryColor:this.config.primaryColor,headerColor:this.config.headerColor,footerColor:this.config.footerColor,chatBackground:this.config.chatBackground,toggleColor:this.config.toggleColor,welcomeMessage:this.config.welcomeMessage}),this.storeSessionId(i.sessionId),this.connectRealtime(),i.inspectorMode?this.enableInspectorMode():i.trackedElements?.length&&this.setupTrackedElements(i.trackedElements),this.emit("connect",this.session),this.config.onConnect?.(i.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()}`,d={id:o,sessionId:this.session.sessionId,content:e,sender:"visitor",timestamp:new Date().toISOString(),status:"sending",replyTo:r};this.session.messages.push(d),this.emit("message",d);try{let i=await this.fetch("/message",{method:"POST",body:JSON.stringify({sessionId:this.session.sessionId,content:e,sender:"visitor",attachmentIds:n||[],replyTo:r})}),s=this.session.messages.findIndex(l=>l.id===o);s>=0&&(this.session.messages[s].id=i.messageId,this.session.messages[s].timestamp=i.timestamp,this.session.messages[s].status="sent",i.attachments&&i.attachments.length>0&&(this.session.messages[s].attachments=i.attachments),this.emit("message",this.session.messages[s]));let c=this.session.messages[s]||{id:i.messageId,sessionId:this.session.sessionId,content:e,sender:"visitor",timestamp:i.timestamp,status:"sent",attachments:i.attachments};return this.config.onMessage?.(c),c}catch(i){let s=this.session.messages.findIndex(c=>c.id===o);throw s>=0&&(this.session.messages.splice(s,1),this.emit("message",d)),i}}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,d=>{let i=10+d*.8;n?.(i),this.emit("uploadProgress",{filename:e.name,progress:i})});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 d=0;d<o;d++){let i=e[d],s=d/o*100,c=100/o,l=await this.uploadFile(i,$=>{let p=s+$/100*c;n?.(p)});r.push(l)}return r}uploadToPresignedUrl(e,n,r){return new Promise((o,d)=>{let i=new XMLHttpRequest;i.upload.addEventListener("progress",s=>{if(s.lengthComputable){let c=s.loaded/s.total*100;r?.(c)}}),i.addEventListener("load",()=>{i.status>=200&&i.status<300?o():d(new Error(`Upload failed with status ${i.status}`))}),i.addEventListener("error",()=>{d(new Error("Upload failed"))}),i.open("PUT",e),i.setRequestHeader("Content-Type",n.type||"application/octet-stream"),i.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(d=>d.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=i=>{let s={...n.data,selector:n.selector,elementText:i.target?.textContent?.trim().slice(0,100),url:window.location.href};this.trigger(n.name,s,{widgetMessage:n.widgetMessage})},d=i=>{i.target?.closest(n.selector)&&o(i)};document.addEventListener(r,d,!0),this.trackedElementCleanups.push(()=>{document.removeEventListener(r,d,!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=`
|
|
1053
1454
|
<style>
|
|
1054
1455
|
#pp-inspector-overlay {
|
|
1055
1456
|
position: fixed;
|
|
@@ -1132,9 +1533,9 @@
|
|
|
1132
1533
|
<button id="pp-inspector-exit">Exit</button>
|
|
1133
1534
|
</div>
|
|
1134
1535
|
<div id="pp-inspector-tooltip"></div>
|
|
1135
|
-
`,document.body.appendChild(e);let n=document.getElementById("pp-inspector-tooltip"),
|
|
1536
|
+
`,document.body.appendChild(e);let n=document.getElementById("pp-inspector-tooltip"),r=null,o=c=>{if(c.id&&!c.id.startsWith("pp-"))return`#${CSS.escape(c.id)}`;let l=Array.from(c.classList).filter(f=>!f.startsWith("pp-"));if(l.length>0){let f="."+l.map(h=>CSS.escape(h)).join(".");if(document.querySelectorAll(f).length===1)return f}for(let f of Array.from(c.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 $=[],p=c;for(;p&&p!==document.body;){let f=p.tagName.toLowerCase();if(p.id&&!p.id.startsWith("pp-")){f=`#${CSS.escape(p.id)}`,$.unshift(f);break}let h=p.parentElement;if(h){let v=p.tagName,k=Array.from(h.children).filter(w=>w.tagName===v);if(k.length>1){let w=k.indexOf(p)+1;f+=`:nth-of-type(${w})`}}$.unshift(f),p=h}return $.join(" > ")},d=c=>{let l=c.target;if(l.closest("#pp-inspector-overlay")||l.closest("#pocketping-widget"))return;r&&r.classList.remove("pp-inspector-highlight"),l.classList.add("pp-inspector-highlight"),r=l;let $=o(l);n.textContent=$,n.style.display="block",n.style.left=`${c.clientX+15}px`,n.style.top=`${c.clientY+15}px`;let p=n.getBoundingClientRect();p.right>window.innerWidth&&(n.style.left=`${c.clientX-p.width-15}px`),p.bottom>window.innerHeight&&(n.style.top=`${c.clientY-p.height-15}px`)},i=c=>{let l=c.target;l.closest("#pp-inspector-overlay")||(l.classList.remove("pp-inspector-highlight"),n.style.display="none")},s=c=>{let l=c.target;if(l.id==="pp-inspector-exit"){this.disableInspectorMode();return}if(l.closest("#pp-inspector-overlay")||l.closest("#pocketping-widget"))return;c.preventDefault(),c.stopPropagation();let $=o(l);this.ws&&this.ws.readyState===WebSocket.OPEN&&this.ws.send(JSON.stringify({type:"inspector_select",data:{selector:$,tagName:l.tagName.toLowerCase(),text:l.textContent?.trim().slice(0,50)||"",url:window.location.href}})),this.emit("inspectorSelect",{selector:$,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 f=p.innerHTML;p.innerHTML=`
|
|
1136
1537
|
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
|
1137
1538
|
<polyline points="20 6 9 17 4 12"/>
|
|
1138
1539
|
</svg>
|
|
1139
|
-
<span>Selector captured: <code style="background:rgba(255,255,255,0.2);padding:2px 6px;border-radius:4px;font-family:monospace;">${
|
|
1140
|
-
`,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",d,!0),this.inspectorCleanup=()=>{document.removeEventListener("mouseover",a,!0),document.removeEventListener("mouseout",r,!0),document.removeEventListener("click",d,!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 d=e.data;d.trackedElements&&(this.setupTrackedElements(d.trackedElements),this.emit("configUpdate",d));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],d=!1;i.status&&i.status!==r.status&&(r.status=i.status,d=!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,d=!0),i.editedAt!==void 0&&i.editedAt!==r.editedAt&&(r.editedAt=i.editedAt,d=!0),i.deletedAt!==void 0&&i.deletedAt!==r.deletedAt&&(r.deletedAt=i.deletedAt,d=!0),i.replyTo!==void 0&&(r.replyTo=i.replyTo,d=!0),i.attachments!==void 0&&(r.attachments=i.attachments,d=!0),d&&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":he,...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",d=!0;n==="deprecated"?r="warning":n==="unsupported"?(r="error",d=!1):n==="outdated"&&(r="info");let u={severity:r,message:a||`Widget version ${he} is ${n}`,currentVersion:he,minVersion:s||void 0,latestVersion:i||void 0,canContinue:d,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,J=null,An="https://app.pocketping.io/api/widget";function Re(t){if(y)return console.warn("[PocketPing] Already initialized"),y;let e=t.endpoint;if(!e&&t.projectId&&(e=`${An}/${t.projectId}`),!e)throw new Error("[PocketPing] endpoint or projectId is required");let n={...t,endpoint:e};return y=new fe(n),J=document.createElement("div"),J.id="pocketping-container",document.body.appendChild(J),Ce(Te(Pt,{client:y,config:t}),J),y.connect().catch(s=>{console.error("[PocketPing] Failed to connect:",s)}),y}function It(){J&&(Ce(null,J),J.remove(),J=null),y&&(y.disconnect(),y=null)}function Mt(){y?.setOpen(!0)}function Ct(){y?.setOpen(!1)}function $t(){y?.toggleOpen()}function At(t,e){if(!y)throw new Error("[PocketPing] Not initialized");return y.sendMessage(t,e)}async function Dt(t,e){if(!y)throw new Error("[PocketPing] Not initialized");return y.uploadFile(t,e)}async function Rt(t,e){if(!y)throw new Error("[PocketPing] Not initialized");return y.uploadFiles(t,e)}function Ot(t,e,n){if(!y){console.warn("[PocketPing] Not initialized, cannot trigger event");return}y.trigger(t,e,n)}function Lt(t){if(!y){console.warn("[PocketPing] Not initialized, cannot setup tracked elements");return}y.setupTrackedElements(t)}function Ht(){return y?.getTrackedElements()||[]}function Ft(t,e){return y?y.onEvent(t,e):(console.warn("[PocketPing] Not initialized, cannot subscribe to event"),()=>{})}function Wt(t,e){y?.offEvent(t,e)}async function Nt(t){if(!y)throw new Error("[PocketPing] Not initialized");return y.identify(t)}async function Ut(t){if(!y){console.warn("[PocketPing] Not initialized");return}return y.reset(t)}function zt(){return y?.getIdentity()||null}function Vt(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)&&Re({projectId:e,endpoint:n,theme:t.dataset.theme||"auto",position:t.dataset.position||"bottom-right"})}}var Dn={init:Re,destroy:It,open:Mt,close:Ct,toggle:$t,sendMessage:At,uploadFile:Dt,uploadFiles:Rt,trigger:Ot,onEvent:Ft,offEvent:Wt,on:Vt,identify:Nt,reset:Ut,getIdentity:zt,setupTrackedElements:Lt,getTrackedElements:Ht};return un(Rn);})();
|
|
1540
|
+
<span>Selector captured: <code style="background:rgba(255,255,255,0.2);padding:2px 6px;border-radius:4px;font-family:monospace;">${$}</code></span>
|
|
1541
|
+
`,setTimeout(()=>{p&&this.inspectorMode&&(p.innerHTML=f,document.getElementById("pp-inspector-exit")?.addEventListener("click",()=>{this.disableInspectorMode()}))},2e3)}console.info(`[PocketPing] \u{1F4CC} Selector captured: ${$}`)};document.addEventListener("mouseover",d,!0),document.addEventListener("mouseout",i,!0),document.addEventListener("click",s,!0),this.inspectorCleanup=()=>{document.removeEventListener("mouseover",d,!0),document.removeEventListener("mouseout",i,!0),document.removeEventListener("click",s,!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",d=>{try{let i=JSON.parse(d.data);this.handleRealtimeEvent(i)}catch(i){console.error("[PocketPing] Failed to parse SSE message:",i)}}),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 c=this.session.messages.findIndex(l=>l.id===n.id);if(c<0&&n.sender==="visitor"&&(c=this.session.messages.findIndex(l=>l.id.startsWith("temp-")&&l.content===n.content&&l.sender==="visitor"),c>=0&&(this.session.messages[c].id=n.id)),c<0&&n.sender!=="visitor"){let l=new Date(n.timestamp).getTime();c=this.session.messages.findIndex($=>$.sender===n.sender&&$.content===n.content&&Math.abs(new Date($.timestamp).getTime()-l)<2e3)}if(c>=0){let l=this.session.messages[c],$=!1;n.status&&n.status!==l.status&&(l.status=n.status,$=!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,$=!0),n.editedAt!==void 0&&n.editedAt!==l.editedAt&&(l.editedAt=n.editedAt,$=!0),n.deletedAt!==void 0&&n.deletedAt!==l.deletedAt&&(l.deletedAt=n.deletedAt,$=!0),n.replyTo!==void 0&&(l.replyTo=n.replyTo,$=!0),n.attachments!==void 0&&(l.attachments=n.attachments,$=!0),$&&this.emit("message",l)}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 c of this.session.messages)o.messageIds.includes(c.id)&&(c.status=o.status,o.deliveredAt&&(c.deliveredAt=o.deliveredAt),o.readAt&&(c.readAt=o.readAt));this.emit("read",o);break;case"message_edited":if(this.session){let c=e.data,l=this.session.messages.findIndex($=>$.id===c.messageId);if(l>=0){let $=this.session.messages[l];$.content=c.content,$.editedAt=c.editedAt??new Date().toISOString(),this.emit("message",$)}}break;case"message_deleted":if(this.session){let c=e.data,l=this.session.messages.findIndex($=>$.id===c.messageId);if(l>=0){let $=this.session.messages[l];$.deletedAt=c.deletedAt??new Date().toISOString(),this.emit("message",$)}}break;case"event":let d=e.data;this.emitCustomEvent(d);break;case"version_warning":let i=e.data;this.handleVersionWarning(i);break;case"config_update":let s=e.data;s.trackedElements&&(this.setupTrackedElements(s.trackedElements),this.emit("configUpdate",s));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 d=this.session.messages.findIndex(i=>i.id===o.id);if(d>=0){let i=this.session.messages[d],s=!1;o.status&&o.status!==i.status&&(i.status=o.status,s=!0,o.deliveredAt&&(i.deliveredAt=o.deliveredAt),o.readAt&&(i.readAt=o.readAt),this.emit("read",{messageIds:[o.id],status:o.status})),o.content!==void 0&&o.content!==i.content&&(i.content=o.content,s=!0),o.editedAt!==void 0&&o.editedAt!==i.editedAt&&(i.editedAt=o.editedAt,s=!0),o.deletedAt!==void 0&&o.deletedAt!==i.deletedAt&&(i.deletedAt=o.deletedAt,s=!0),o.replyTo!==void 0&&(i.replyTo=o.replyTo,s=!0),o.attachments!==void 0&&(i.attachments=o.attachments,s=!0),s&&this.emit("message",i)}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":pt,...n.headers}});if(this.checkVersionHeaders(o),!o.ok){let d=await o.text();throw new Error(`PocketPing API error: ${o.status} ${d}`)}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"),d=e.headers.get("X-PocketPing-Version-Message");if(!n||n==="ok")return;let i="info",s=!0;n==="deprecated"?i="warning":n==="unsupported"?(i="error",s=!1):n==="outdated"&&(i="info");let c={severity:i,message:d||`Widget version ${pt} is ${n}`,currentVersion:pt,minVersion:r||void 0,latestVersion:o||void 0,canContinue:s,upgradeUrl:"https://docs.pocketping.io/widget/installation"};this.handleVersionWarning(c)}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 C=null,ie=null,Ad="https://app.pocketping.io/api/widget";function rn(t){if(C)return console.warn("[PocketPing] Already initialized"),C;let e=t.endpoint;if(!e&&t.projectId&&(e=`${Ad}/${t.projectId}`),!e)throw new Error("[PocketPing] endpoint or projectId is required");let n={...t,endpoint:e};return C=new ct(n),ie=document.createElement("div"),ie.id="pocketping-container",document.body.appendChild(ie),Ct(_t(Fr,{client:C,config:t}),ie),C.connect().catch(r=>{console.error("[PocketPing] Failed to connect:",r)}),C}function Dr(){ie&&(Ct(null,ie),ie.remove(),ie=null),C&&(C.disconnect(),C=null)}function Lr(){C?.setOpen(!0)}function Hr(){C?.setOpen(!1)}function Ur(){C?.toggleOpen()}function jr(t,e){if(!C)throw new Error("[PocketPing] Not initialized");return C.sendMessage(t,e)}async function Br(t,e){if(!C)throw new Error("[PocketPing] Not initialized");return C.uploadFile(t,e)}async function Vr(t,e){if(!C)throw new Error("[PocketPing] Not initialized");return C.uploadFiles(t,e)}function Gr(t,e,n){if(!C){console.warn("[PocketPing] Not initialized, cannot trigger event");return}C.trigger(t,e,n)}function Wr(t){if(!C){console.warn("[PocketPing] Not initialized, cannot setup tracked elements");return}C.setupTrackedElements(t)}function zr(){return C?.getTrackedElements()||[]}function Kr(t,e){return C?C.onEvent(t,e):(console.warn("[PocketPing] Not initialized, cannot subscribe to event"),()=>{})}function Xr(t,e){C?.offEvent(t,e)}async function Yr(t){if(!C)throw new Error("[PocketPing] Not initialized");return C.identify(t)}async function qr(t){if(!C){console.warn("[PocketPing] Not initialized");return}return C.reset(t)}function Jr(){return C?.getIdentity()||null}function Zr(t,e){return C?C.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)&&rn({projectId:e,endpoint:n,theme:t.dataset.theme||"auto",position:t.dataset.position||"bottom-right"})}}var Od={init:rn,destroy:Dr,open:Lr,close:Hr,toggle:Ur,sendMessage:jr,uploadFile:Br,uploadFiles:Vr,trigger:Gr,onEvent:Kr,offEvent:Xr,on:Zr,identify:Yr,reset:qr,getIdentity:Jr,setupTrackedElements:Wr,getTrackedElements:zr};return xo(Md);})();
|