2 lines
486 KiB
JavaScript
2 lines
486 KiB
JavaScript
!function(){"use strict";var e,t,n,a,s={96:function(e,t,n){n.d(t,{A:function(){return C}});var a=n(3247),s=n(2582),i=n(4408),r=n(9710);function o(e,t,n){var s=new a.Ay(n).getCountryCodesForCallingCode(e);return s?s.filter(function(e){return function(e,t,n){var s=new a.Ay(n);if(s.selectNumberingPlan(t),s.numberingPlan.possibleLengths().indexOf(e.length)>=0)return!0;return!1}(t,e,n)}):[]}var d=n(9713),l=n(284),c=n(1528),h=/^[\d]+(?:[~\u2053\u223C\uFF5E][\d]+)?$/;var p={formatExtension:function(e,t,n){return"".concat(e).concat(n.ext()).concat(t)}};function u(e,t,n,s){if(n=n?function(){for(var e=1,t=arguments.length,n=new Array(t),a=0;a<t;a++)n[a]=arguments[a];for(;e<n.length;){if(n[e])for(var s in n[e])n[0][s]=n[e][s];e++}return n[0]}({},p,n):p,s=new a.Ay(s),e.country&&"001"!==e.country){if(!s.hasCountry(e.country))throw new Error("Unknown country: ".concat(e.country));s.selectNumberingPlan(e.country)}else{if(!e.countryCallingCode)return e.phone||"";s.selectNumberingPlan(e.countryCallingCode)}var i,r=s.countryCallingCode(),o=n.v2?e.nationalNumber:e.phone;switch(t){case"NATIONAL":return o?g(i=m(o,e.carrierCode,"NATIONAL",s,n),e.ext,s,n.formatExtension):"";case"INTERNATIONAL":return o?(i=m(o,null,"INTERNATIONAL",s,n),g(i="+".concat(r," ").concat(i),e.ext,s,n.formatExtension)):"+".concat(r);case"E.164":return"+".concat(r).concat(o);case"RFC3966":return function(e){var t=e.number,n=e.ext;if(!t)return"";if("+"!==t[0])throw new Error('"formatRFC3966()" expects "number" to be in E.164 format.');return"tel:".concat(t).concat(n?";ext="+n:"")}({number:"+".concat(r).concat(o),ext:e.ext});case"IDD":if(!n.fromCountry)return;var d=function(e,t,n,s,i){var r=(0,a.Ko)(s,i.metadata);if(r===n){var o=m(e,t,"NATIONAL",i);return"1"===n?n+" "+o:o}var d=function(e,t,n){var s=new a.Ay(n);return s.selectNumberingPlan(e,t),s.defaultIDDPrefix()?s.defaultIDDPrefix():h.test(s.IDDPrefix())?s.IDDPrefix():void 0}(s,void 0,i.metadata);if(d)return"".concat(d," ").concat(n," ").concat(m(e,null,"INTERNATIONAL",i))}(o,e.carrierCode,r,n.fromCountry,s);return g(d,e.ext,s,n.formatExtension);default:throw new Error('Unknown "format" argument passed to "formatNumber()": "'.concat(t,'"'))}}function m(e,t,n,a,s){var r,o,d=(r=a.formats(),o=e,function(e,t){for(var n=0;n<e.length;){if(t(e[n]))return e[n];n++}}(r,function(e){if(e.leadingDigitsPatterns().length>0){var t=e.leadingDigitsPatterns()[e.leadingDigitsPatterns().length-1];if(0!==o.search(t))return!1}return(0,i.A)(o,e.pattern())}));return d?(0,c.A)(e,d,{useInternationalFormat:"INTERNATIONAL"===n,withNationalPrefix:!d.nationalPrefixIsOptionalWhenFormattingInNationalFormat()||!s||!1!==s.nationalPrefix,carrierCode:t,metadata:a}):e}function g(e,t,n,a){return t?a(e,t,n):e}function f(e){return f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},f(e)}function v(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,a)}return n}function $(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?v(Object(n),!0).forEach(function(t){b(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):v(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function b(e,t,n){return(t=E(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function y(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,E(a.key),a)}}function E(e){var t=function(e,t){if("object"!=f(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var a=n.call(e,t||"default");if("object"!=f(a))return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==f(t)?t:t+""}var C=function(){return e=function e(t,n,s){if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),!t)throw new TypeError("First argument is required");if("string"!=typeof t)throw new TypeError("First argument must be a string");if("+"===t[0]&&!n)throw new TypeError("`metadata` argument not passed");if((0,l.A)(n)&&(0,l.A)(n.countries)){s=n;var i=t;if(!S.test(i))throw new Error('Invalid `number` argument passed: must consist of a "+" followed by digits');var r=(0,d.A)(i,void 0,void 0,void 0,s);if(t=r.countryCallingCode,!(n=r.number))throw new Error("Invalid `number` argument passed: too short")}if(!n)throw new TypeError("`nationalNumber` argument is required");if("string"!=typeof n)throw new TypeError("`nationalNumber` argument must be a string");(0,a.aR)(s);var o=function(e,t){var n,s,i=new a.Ay(t);return w(e)?(n=e,i.selectNumberingPlan(n),s=i.countryCallingCode()):s=e,{country:n,countryCallingCode:s}}(t,s),c=o.country,h=o.countryCallingCode;this.country=c,this.countryCallingCode=h,this.nationalNumber=n,this.number="+"+this.countryCallingCode+this.nationalNumber,this.getMetadata=function(){return s}},(t=[{key:"setExt",value:function(e){this.ext=e}},{key:"getPossibleCountries",value:function(){return this.country?[this.country]:o(this.countryCallingCode,this.nationalNumber,this.getMetadata())}},{key:"isPossible",value:function(){return(0,s.A)(this,{v2:!0},this.getMetadata())}},{key:"isValid",value:function(){return function(e,t,n){if(t=t||{},(n=new a.Ay(n)).selectNumberingPlan(e.country,e.countryCallingCode),n.hasTypes())return void 0!==(0,r.A)(e,t,n.metadata);var s=t.v2?e.nationalNumber:e.phone;return(0,i.A)(s,n.nationalNumberPattern())}(this,{v2:!0},this.getMetadata())}},{key:"isNonGeographic",value:function(){return new a.Ay(this.getMetadata()).isNonGeographicCallingCode(this.countryCallingCode)}},{key:"isEqual",value:function(e){return this.number===e.number&&this.ext===e.ext}},{key:"getType",value:function(){return(0,r.A)(this,{v2:!0},this.getMetadata())}},{key:"format",value:function(e,t){return u(this,e,t?$($({},t),{},{v2:!0}):{v2:!0},this.getMetadata())}},{key:"formatNational",value:function(e){return this.format("NATIONAL",e)}},{key:"formatInternational",value:function(e){return this.format("INTERNATIONAL",e)}},{key:"getURI",value:function(e){return this.format("RFC3966",e)}}])&&y(e.prototype,t),n&&y(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,n}(),w=function(e){return/^[A-Z]{2}$/.test(e)};var S=/^\+\d+$/},221:function(e,t,n){n.d(t,{A:function(){return d}});var a=n(1594),s=n.n(a),i=n(8181);class r extends s().Component{constructor(e){super(e),this.state={panX:0,panY:0,originX:0,originY:0,zoom:1,minZoom:.001,maxZoom:8},this.overlay=s().createRef(),this.cutout=s().createRef(),this.preview=s().createRef(),this.boundingBox=s().createRef(),this.imageWidth=0,this.imageHeight=0,this.mouseX=0,this.mouseY=0,this.prevDistance=0,this.cutoutRect={},this.bBoxRect={},this.originX=0,this.originY=0,this.initScaling=this.initScaling.bind(this),this.onZoom=this.onZoom.bind(this),this.handleZoom=this.handleZoom.bind(this),this.mouseDown=this.mouseDown.bind(this),this.mouseUp=this.mouseUp.bind(this),this.mouseMove=this.mouseMove.bind(this),this.mouseTouch=this.mouseTouch.bind(this),this.positionAll=this.positionAll.bind(this),this.translate=this.translate.bind(this)}componentDidMount(){this.overlay.current.addEventListener("mousedown",this.mouseDown,{passive:!0}),this.overlay.current.addEventListener("touchstart",this.mouseDown,{passive:!0}),this.bBoxRect=this.boundingBox.current.getBoundingClientRect(),this.originX=this.bBoxRect.width/2,this.originY=this.bBoxRect.height/2,this.cutoutRect=this.cutout.current.getBoundingClientRect()}componentWillUnmount(){this.overlay.current&&(this.overlay.current.removeEventListener("mousedown",this.mouseDown),this.overlay.current.removeEventListener("touchstart",this.mouseDown))}positionAll(e,t,n){this.setState({panX:e,panY:t,zoom:n,originX:this.originX-e,originY:this.originY-t});const a=(this.originX-e)*n-this.originX,s=(this.originY-t)*n-this.originY;this.props.onChange((a+this.cutoutRect.left-this.bBoxRect.left)/n,(s+this.cutoutRect.top-this.bBoxRect.top)/n,this.cutoutRect.width/n,this.cutoutRect.height/n,n)}static checkBound(e,t,n,a){let s=Math.min(0,n[0]-t[0]-a,t[1]-n[1]+a);return(0==s||Math.min(0,n[0]-t[0],t[1]-n[1])<s)&&(e+=a),e}initScaling(){const e=this.preview.current.getBoundingClientRect();this.imageWidth=e.width,this.imageHeight=e.height;const t=Math.max(this.cutoutRect.width/e.width,this.cutoutRect.height/e.height);this.setState({minZoom:t,maxZoom:8*t});const n=Math.max(this.bBoxRect.width/e.width,this.bBoxRect.height/e.height),a=this.cutoutRect.left-this.bBoxRect.left-(e.width-this.cutoutRect.width)/2,s=this.cutoutRect.top-this.bBoxRect.top-(e.height-this.cutoutRect.height)/2;this.positionAll(a,s,n)}onZoom(e){this.handleZoom(e.target.value)}handleZoom(e){let t=this.state.panX,n=this.state.panY;const a=this.originX-(this.originX-t)*e,s=a+this.imageWidth*e,i=this.originY-(this.originY-n)*e,r=i+this.imageHeight*e,o=this.cutoutRect.left-this.bBoxRect.left,d=o+this.cutoutRect.width,l=this.cutoutRect.top-this.bBoxRect.top,c=l+this.cutoutRect.height;o<a?t-=(a-o)/e:d>s&&(t+=(d-s)/e),l<i?n-=(i-l)/e:c>r&&(n+=(c-r)/e),this.positionAll(t,n,e)}mouseDown(e){e.touches?(this.mouseX=e.touches[0].pageX,this.mouseY=e.touches[0].pageY):(this.mouseX=e.pageX,this.mouseY=e.pageY),window.addEventListener("mousemove",this.mouseMove,{passive:!1}),window.addEventListener("touchmove",this.mouseTouch,{passive:!1}),window.addEventListener("mouseup",this.mouseUp,{passive:!0}),window.addEventListener("touchend",this.mouseUp,{passive:!0}),document.body.style.userSelect="none"}translate(e,t){const n=(e-this.mouseX)/this.state.zoom,a=(t-this.mouseY)/this.state.zoom;this.mouseX=e,this.mouseY=t;const s=this.preview.current.getBoundingClientRect(),i=r.checkBound(this.state.panX,[s.left,s.right],[this.cutoutRect.left,this.cutoutRect.right],n),o=r.checkBound(this.state.panY,[s.top,s.bottom],[this.cutoutRect.top,this.cutoutRect.bottom],a);this.positionAll(i,o,this.state.zoom)}mouseMove(e){e.preventDefault(),this.translate(e.pageX,e.pageY)}mouseTouch(e){if(e.preventDefault(),1==e.touches.length)return void this.translate(e.touches[0].pageX,e.touches[0].pageY);const[t,n]=e.touches,a=Math.sqrt((t.pageX-n.pageX)*(t.pageX-n.pageX)+(t.pageY-n.pageY)*(t.pageY-n.pageY));this.prevDistance||(this.prevDistance=a/this.state.zoom);let s=a/this.prevDistance;this.handleZoom(Math.max(this.minZoom,Math.min(this.maxZoom,s)))}mouseUp(e){window.removeEventListener("mousemove",this.mouseMove),window.removeEventListener("touchmove",this.mouseTouch),window.removeEventListener("mouseup",this.mouseUp),window.removeEventListener("touchend",this.mouseUp),document.body.style.userSelect="",this.positionAll(this.state.panX,this.state.panY,this.state.zoom)}render(){const e=`translate3d(${this.state.panX}px, ${this.state.panY}px, 0) scale(${this.state.zoom})`,t=`${this.state.originX}px ${this.state.originY}px`,n={top:this.originY-this.state.originY*this.state.zoom+"px",left:this.originX-this.state.originX*this.state.zoom+"px",width:this.imageWidth*this.state.zoom+"px",height:this.imageHeight*this.state.zoom+"px"};return s().createElement("div",{className:"cropper"},s().createElement("div",{className:"bounding-box",ref:this.boundingBox},s().createElement("img",{src:this.props.source,className:"preview",alt:"",style:{transform:e,transformOrigin:t},ref:this.preview,onLoad:this.initScaling}),s().createElement("div",{className:"cutout circle",ref:this.cutout}),s().createElement("div",{className:"overlay",style:n,ref:this.overlay})),s().createElement("div",{className:"zoom-wrapper"},s().createElement("input",{type:"range",className:"zoomer",step:"0.001",min:this.state.minZoom,max:this.state.maxZoom,value:this.state.zoom,onChange:this.onZoom})))}}var o=n(6110);class d extends s().PureComponent{constructor(e){super(e),this.state={top:0,left:0,width:0,height:0,scale:1},this.handleSubmit=this.handleSubmit.bind(this),this.handleChange=this.handleChange.bind(this)}handleChange(e,t,n,a,s){this.setState({left:e,top:t,width:n,height:a,scale:s})}handleSubmit(){(0,o.CO)(this.props.mime,this.props.avatar,this.state.left,this.state.top,this.state.width,this.state.height,this.state.scale).then(e=>{this.props.onSubmit(e.mime,e.blob,e.width,e.height)}).catch(e=>{this.props.onError(e)})}render(){return s().createElement("div",{className:"panel-form"},s().createElement("div",{className:"panel-form-row"},s().createElement(r,{source:this.props.avatar,onChange:this.handleChange})),s().createElement("div",{className:"dialog-buttons"},this.props.onCancel?s().createElement("button",{className:"secondary",onClick:this.props.onCancel},s().createElement(i.FormattedMessage,{id:"button_cancel",defaultMessage:[{type:0,value:"Cancel"}]})):null,s().createElement("button",{className:"primary",onClick:this.handleSubmit},s().createElement(i.FormattedMessage,{id:"button_ok",defaultMessage:[{type:0,value:"OK"}]}))))}}},257:function(e,t,n){n.d(t,{i:function(){return a}});const a="0.25.0"},283:function(e,t,n){n.d(t,{A:function(){return o}});var a=n(3247),s=n(4408),i=n(4573),r=n(1786);function o(e,t,n,o,d){var l=t||n?(0,a.Ko)(t||n,d):o;if(0===e.indexOf(l)){(d=new a.Ay(d)).selectNumberingPlan(t||n,l);var c=e.slice(l.length),h=(0,i.A)(c,t,d).nationalNumber,p=(0,i.A)(e,t,d).nationalNumber;if(!(0,s.A)(p,d.nationalNumberPattern())&&(0,s.A)(h,d.nationalNumberPattern())||"TOO_LONG"===(0,r.A)(p,t,d))return{countryCallingCode:l,number:c}}return{number:e}}},284:function(e,t,n){n.d(t,{A:function(){return s}});var a={}.constructor;function s(e){return null!=e&&e.constructor===a}},504:function(e,t,n){n.d(t,{A:function(){return r}});var a=n(1594),s=n.n(a);const i={muted:"notifications_off",banned:"block",staff:"verified_user"};class r extends s().PureComponent{render(){let e=null;return this.props.badges&&this.props.badges.length>0?(e=[],this.props.badges.forEach(t=>{const n=t.color?" "+t.color:"";t.icon?e.push(s().createElement("i",{className:"material-icons as-badge"+n,key:t.key||t.icon},i[t.icon]||t.icon)):e.push(s().createElement("span",{className:"badge"+n,key:t.key||t.name},t.name))}),s().createElement(s().Fragment,null,e)):null}}},635:function(e,t,n){var a=n(1594),s=n.n(a),i=n(8181);const r={staff:"verified_user"},o=(0,i.defineMessages)({badge_verified:{id:"badge_verified",defaultMessage:[{type:0,value:"Verified/official"}]},badge_staff:{id:"badge_staff",defaultMessage:[{type:0,value:"Staff-managed"}]},badge_danger:{id:"badge_danger",defaultMessage:[{type:0,value:"Untrustworthy"}]}});class d extends s().PureComponent{render(){const{formatMessage:e}=this.props.intl;let t=null;return this.props.trustedBadges&&this.props.trustedBadges.length>0?(t=[],this.props.trustedBadges.forEach(n=>{const a=this.props.short?null:e(o["badge_"+n]),i="material-icons "+n+"-color";t.push(s().createElement("div",{className:"trusted-badge",key:n},s().createElement("i",{className:i},r[n]||n)," ",a))}),s().createElement(s().Fragment,null,t)):null}}t.A=(0,i.injectIntl)(d)},1013:function(e,t,n){n.d(t,{A:function(){return i}});var a=n(1594),s=n.n(a);class i extends s().PureComponent{render(){const e="load-spinner-box"+(this.props.large?" large":"")+(this.props.clear?" clear":"")+(this.props.centered?" centered":"");return this.props.show?s().createElement("div",{className:e},s().createElement("div",{className:"loader-spinner"})):null}}},1135:function(e,t,n){n.d(t,{A:function(){return s}});var a=n(6128);function s(e){return e.replace(new RegExp("[".concat(a.uD,"]+"),"g")," ").trim()}},1166:function(e,t,n){n.d(t,{A:function(){return i}});var a=n(1594),s=n.n(a);class i extends s().PureComponent{constructor(e){super(e),this.handleChange=this.handleChange.bind(this)}handleChange(){this.props.onChange(this.props.name,!this.props.checked)}render(){let e,t=["material-icons"];Array.isArray(this.props.className)?t.push(...this.props.className):this.props.className&&t.push(this.props.className),this.props.onChange?this.props.checked?(t.push("blue","clickable"),e="check_box"):!1===this.props.checked?(t.push("blue","clickable"),e="check_box_outline_blank"):(t.push("lt-blue"),e="indeterminate_check_box"):e=this.props.checked?"check_box":"check_box_outline_blank";let n={className:t.join(" "),id:this.props.id};return this.props.onChange&&(n.onClick=this.handleChange),s().createElement("i",n,e)}}},1211:function(e,t){t.A={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],0,0,0,0,0,0,0,[0,["4\\d{4}",[5]]]],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"]]],0,0,0,0,0,0,[0,["690\\d{6}|[356]\\d{5}",[6,9]]]],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",0,0,0,0,0,[0,["5[024-68]\\d{7}",[9]]]],AF:["93","00","[2-7]\\d{8}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[2-7]"],"0$1"]],"0",0,0,0,0,0,[0,["7\\d{8}"]]],AG:["1","011","(?:268|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([457]\\d{6})$|1","268$1",0,"268",[0,["268(?:464|7(?:1[3-9]|[28]\\d|3[0246]|64|7[0-689]))\\d{4}"]]],AI:["1","011","(?:264|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2457]\\d{6})$|1","264$1",0,"264",[0,["264(?:235|4(?:69|76)|5(?:3[6-9]|8[1-4])|7(?:29|72))\\d{4}"]]],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",0,0,0,0,0,[0,["6(?:[78][2-9]|9\\d)\\d{6}",[9]]]],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",0,0,0,0,0,[0,["(?:33|4[1349]|55|77|88|9[13-9])\\d{6}"]]],AO:["244","00","[29]\\d{8}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[29]"]]],0,0,0,0,0,0,[0,["9[1-79]\\d{7}"]]],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",0,0,[0,["93(?:7(?:1[15]|81)|8(?:21|4[16]|69|9[12]))[46]\\d{5}|9(?:2(?:2(?:2[59]|44|52)|3(?:26|44)|47[35]|9(?:[07]2|2[26]|34|46))|3327)[45]\\d{5}|9(?:2(?:657|9(?:54|66))|3(?:48[27]|7(?:55|77)|8(?:65|78)))[2-8]\\d{5}|9(?:2(?:284|3(?:02|23)|477|622|920)|3(?:4(?:46|89|92)|541))[2-7]\\d{5}|(?:675\\d|9(?:11[1-8]\\d|2(?:2(?:0[45]|1[2-6]|3[3-6])|3(?:[06]4|7[45])|494|6(?:04|1[2-8]|[36][45]|4[3-6])|80[45]|9(?:[17][4-6]|[48][45]|9[3-6]))|3(?:364|4(?:1[2-8]|[25][4-6]|3[3-6]|84)|5(?:1[2-9]|[38][4-6])|6(?:2[45]|44)|7[069][45]|8(?:0[45]|1[2-7]|3[4-6]|5[3-6]|7[2-6]|8[3-68]))))\\d{6}|9(?:2(?:2(?:62|81)|320|9(?:42|83))|3(?:329|4(?:62|7[16])|5(?:43|64)|7(?:18|5[17])))[2-6]\\d{5}|92(?:2(?:21|4[23]|6[145]|7[1-4]|8[356]|9[267])|3(?:16|3[13-8]|43|5[346-8]|9[3-5])|6(?:2[46]|4[78]|5[1568])|9(?:03|2[1457-9]|3[1356]|4[08]|[56][23]|82))4\\d{5}|9(?:2(?:257|3(?:24|46|92)|9(?:01|23|64))|3(?:4(?:42|64)|5(?:25|37|4[47]|71)|7(?:35|72)|825))[3-6]\\d{5}|9(?:2(?:2(?:02|2[3467]|4[156]|5[45]|6[6-8]|91)|3(?:1[47]|25|[45][25]|96)|47[48]|625|932)|3(?:38[2578]|4(?:0[0-24-9]|3[78]|4[457]|58|6[035-9]|72|83|9[136-8])|5(?:2[124]|[368][23]|4[2689]|7[2-6])|7(?:16|2[15]|3[14]|4[13]|5[468]|7[3-5]|8[26])|8(?:2[67]|3[278]|4[3-5]|5[78]|6[1-378]|[78]7|94)))[4-6]\\d{5}"]]],AS:["1","011","(?:[58]\\d\\d|684|900)\\d{7}",[10],0,"1",0,"([267]\\d{6})$|1","684$1",0,"684",[0,["684(?:2(?:48|5[2468]|7[26])|7(?:3[13]|70|82))\\d{4}"]]],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",0,0,0,0,0,[0,["6(?:485|(?:5[0-3579]|6[013-9]|[7-9]\\d)\\d)\\d{3,9}",[7,8,9,10,11,12,13]]]],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,[0,["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]]],"0011"],AW:["297","00","(?:[25-79]\\d\\d|800)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[25-9]"]]],0,0,0,0,0,0,[0,["(?:290|5[69]\\d|6(?:[03]0|22|4[0-2]|[69]\\d)|7(?:[34]\\d|7[07])|9(?:6[45]|9[4-8]))\\d{4}"]]],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,["4946\\d{2,6}|(?:4[0-8]|50)\\d{4,8}",[6,7,8,9,10]]],"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",0,0,0,0,0,[0,["36554\\d{4}|(?:[16]0|4[04]|5[015]|7[07]|99)\\d{7}"]]],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",0,0,0,0,0,[0,["6040\\d{5}|6(?:03|[1-356]|44|7\\d)\\d{6}"]]],BB:["1","011","(?:246|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","246$1",0,"246",[0,["246(?:(?:2(?:[3568]\\d|4[0-57-9])|3(?:5[2-9]|6[0-6])|4(?:46|5\\d)|69[5-7]|8(?:[2-5]\\d|83))\\d|52(?:1[147]|20))\\d{3}"]]],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",0,0,0,0,0,[0,["(?:1[13-9]\\d|644)\\d{7}|(?:3[78]|44|66)[02-9]\\d{7}",[10]]]],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",0,0,0,0,0,[0,["4[5-9]\\d{7}",[9]]]],BF:["226","00","(?:[025-7]\\d|44)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[024-7]"]]],0,0,0,0,0,0,[0,["(?:0[1-7]|44|5[0-8]|[67]\\d)\\d{6}"]]],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",0,0,0,0,0,[0,["(?:43[07-9]|99[69]\\d)\\d{5}|(?:8[7-9]|98)\\d{7}",[8,9]]]],BH:["973","00","[136-9]\\d{7}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[13679]|8[02-4679]"]]],0,0,0,0,0,0,[0,["(?:3(?:[0-79]\\d|8[0-57-9])\\d|6(?:3(?:00|33|6[16])|441|6(?:3[03-9]|[69]\\d|7[0-689])))\\d{4}"]]],BI:["257","00","(?:[267]\\d|31)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2367]"]]],0,0,0,0,0,0,[0,["(?:29|6[124-9]|7[125-9])\\d{6}"]]],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"]]],0,0,0,0,0,0,[0,["01(?:2[5-9]|[4-69]\\d)\\d{6}",[10]]]],BL:["590","00","(?:590\\d|7090)\\d{5}|(?:69|80|9\\d)\\d{7}",[9],0,"0",0,0,0,0,0,[0,["(?: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}"]]],BM:["1","011","(?:441|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","441$1",0,"441",[0,["441(?:[2378]\\d|5[0-39]|9[02])\\d{5}"]]],BN:["673","00","[2-578]\\d{6}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[2-578]"]]],0,0,0,0,0,0,[0,["(?:22[89]|[78]\\d\\d)\\d{4}"]]],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)?",0,0,0,[0,["[67]\\d{7}",[8]]]],BQ:["599","00","(?:[34]1|7\\d)\\d{5}",[7],0,0,0,0,0,0,"[347]",[0,["(?:31(?:8[14-8]|9[14578])|416[14-9]|7(?:0[01]|7[07]|8\\d|9[056])\\d)\\d{3}"]]],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",0,0,[0,["(?:[14689][1-9]|2[12478]|3[1-578]|5[13-5]|7[13-579])(?:7|9\\d)\\d{7}",[10,11]]]],BS:["1","011","(?:242|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([3-8]\\d{6})$|1","242$1",0,"242",[0,["242(?:3(?:5[79]|7[56]|95)|4(?:[23][1-9]|4[1-35-9]|5[1-8]|6[2-8]|7\\d|81)|5(?:2[45]|3[35]|44|5[1-46-9]|65|77)|6[34]6|7(?:27|38)|8(?:0[1-9]|1[02-9]|2\\d|3[0-4]|[89]9))\\d{4}"]]],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]"]]],0,0,0,0,0,0,[0,["(?:1[67]|[78]7)\\d{6}",[8]]]],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"]]],0,0,0,0,0,0,[0,["(?:321|7[1-8]\\d)\\d{5}",[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,["(?:2(?:5[5-79]|9[1-9])|(?:33|44)\\d)\\d{6}",[9]]],"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"]]],0,0,0,0,0,0,[0,["6[0-35-7]\\d{5}",[7]]]],CA:["1","011","[2-9]\\d{9}|3\\d{6}",[7,10],0,"1",0,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]]]],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,[0,["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]]],"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",0,0,0,0,0,[0,["88\\d{5}|(?:8[0-69]|9[017-9])\\d{7}",[7,9]]]],CF:["236","00","(?:[27]\\d{3}|8776)\\d{4}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[278]"]]],0,0,0,0,0,0,[0,["7[02-7]\\d{6}"]]],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]"]]],0,0,0,0,0,0,[0,["026(?:1[0-5]|6[6-9])\\d{4}|0(?:[14-6]\\d\\d|2(?:40|5[5-8]|6[07-9]))\\d{5}"]]],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",0,0,0,0,0,[0,["(?:6[89]|7[235-9])\\d{7}",[9]]]],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"]]],0,0,0,0,0,0,[0,["0[157]\\d{8}"]]],CK:["682","00","[2-578]\\d{4}",[5],[["(\\d{2})(\\d{3})","$1 $2",["[2-578]"]]],0,0,0,0,0,0,[0,["[578]\\d{4}"]]],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"]]],0,0,0,0,0,0,[0,["2(?:1982[0-6]|3314[05-9])\\d{3}|(?:2(?:1(?:160|962)|2\\d{3}|3(?:(?:2\\d|50)\\d|3(?:[03467]\\d|1[0-35-9]|2[1-9]|5[0-24-9]|8[0-389]|9[0-8])|600)|646[59])|(?:(?:3[2-5]|[47][1-35]|5[1-3578]|6[13-57])\\d|8(?:0[1-8]|[1-9]\\d))\\d\\d|9(?:(?:10[01]|(?:[2458]\\d|7[1-9])\\d)\\d|3(?:[0-57-9]\\d\\d|6(?:0[02-9]|[1-9]\\d))|6(?:[0-8]\\d\\d|9(?:[02-79]\\d|1[05-9]))|9(?:[03-9]\\d\\d|1(?:[0235-9]\\d|4[0-24-9])|2(?:[0-79]\\d|8[0-46-9]))))\\d{4}",[9]]]],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"]]],0,0,0,0,0,0,[0,["(?:24[23]|6(?:[25-9]\\d|40))\\d{6}",[9]]]],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,["1740[0-5]\\d{6}|1(?:[38]\\d|4[57]|[59][0-35-9]|6[25-7]|7[0-35-8])\\d{8}",[11]]],"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))?",0,0,0,[0,["333301[0-5]\\d{3}|3333(?:00|2[5-9]|[3-9]\\d)\\d{4}|(?:3(?:(?:0[0-5]|1\\d|5[01]|70)\\d|2(?:[0-3]\\d|4[1-9])|3(?:00|3[0-24-9]))|9(?:101|408))\\d{6}",[10]]]],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))",0,0,0,[0,["(?:3005\\d|6500[01])\\d{3}|(?:5[07]|6[0-4]|7[0-3]|8[3-9])\\d{6}",[8]]]],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",0,0,0,0,0,[0,["(?:5\\d|6[2-4])\\d{6}",[8]]]],CV:["238","0","(?:[2-59]\\d\\d|800)\\d{4}",[7],[["(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3",["[2-589]"]]],0,0,0,0,0,0,[0,["(?:36|5[1-389]|9\\d)\\d{5}"]]],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]",[0,["953[01]\\d{4}|9(?:5[12467]|6[5-9])\\d{5}"]]],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,[0,["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]]],"0011"],CY:["357","00","(?:[279]\\d|[58]0)\\d{6}",[8],[["(\\d{2})(\\d{6})","$1 $2",["[257-9]"]]],0,0,0,0,0,0,[0,["9(?:10|[4-79]\\d)\\d{5}"]]],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"]]],0,0,0,0,0,0,[0,["7(?:060\\d|19(?:[0-5]\\d|6[0-6]))\\d{4}|(?:60[1-8]|7(?:0[2-5]|[2379]\\d))\\d{6}",[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",0,0,0,0,0,[0,["1(?:(?:5(?:[0-25-9]\\d\\d|3(?:10|33))|7[26-9]\\d\\d)\\d{6}|6[023]\\d{7,8})|17\\d{8}",[10,11]]]],DJ:["253","00","(?:2\\d|77)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[27]"]]],0,0,0,0,0,0,[0,["77\\d{6}"]]],DK:["45","00","[2-9]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-9]"]]],0,0,0,0,0,0,[0,["(?:2[6-8]|37|6[78]|96)\\d{6}|(?:2[0-59]|3[0-689]|[457]\\d|6[0-69]|8[126-9]|9[1-47-9])[1-9]\\d{5}"]]],DM:["1","011","(?:[58]\\d\\d|767|900)\\d{7}",[10],0,"1",0,"([2-7]\\d{6})$|1","767$1",0,"767",[0,["767(?:2(?:[2-4689]5|7[5-7])|31[5-7]|61[1-8]|70[1-6])\\d{4}"]]],DO:["1","011","(?:[58]\\d\\d|900)\\d{7}",[10],0,"1",0,0,0,0,"8001|8[024]9",[0,["8[024]9[2-9]\\d{6}"]]],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",0,0,0,0,0,[0,["(?:5(?:4[0-29]|5\\d|6[0-3])|6(?:[569]\\d|7[0-6])|7[7-9]\\d)\\d{6}",[9]]]],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",0,0,0,0,0,[0,["964[0-2]\\d{5}|9(?:39|[57][89]|6[0-36-9]|[89]\\d)\\d{6}",[9]]]],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"]]],0,0,0,0,0,0,[0,["(?:5\\d{5}|8(?:1(?:0(?:0(?:00|[178]\\d)|[3-9]\\d\\d)|(?:1(?:0[2-6]|1\\d)|(?:2[0-59]|[3-79]\\d)\\d)\\d)|2(?:0(?:0(?:00|4\\d)|(?:19|[2-7]\\d)\\d)|(?:(?:[124-69]\\d|3[5-9])\\d|7(?:[0-79]\\d|8[013-9])|8(?:[2-6]\\d|7[01]))\\d)|[349]\\d{4}))\\d\\d|5(?:(?:[02]\\d|5[0-478])\\d|1(?:[0-8]\\d|95)|6(?:4[0-4]|5[1-589]))\\d{3}",[7,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",0,0,0,0,0,[0,["1[0-25]\\d{8}",[10]]]],EH:["212","00","[5-8]\\d{8}",[9],0,"0",0,0,0,0,"528[89]",[0,["(?:6(?:[0-79]\\d|8[0-247-9])|7(?:[016-8]\\d|2[0-8]|5[0-5]))\\d{6}"]]],ER:["291","00","[178]\\d{6}",[7],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[178]"],"0$1"]],"0",0,0,0,0,0,[0,["(?:17[1-3]|7\\d\\d)\\d{4}"]]],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]"]]],0,0,0,0,0,0,[0,["96906(?:09|10)\\d\\d|(?:590(?:10[0-2]|600)|97390\\d)\\d{3}|(?:6\\d|7[1-48])\\d{7}"]]],ET:["251","00","(?:11|[2-579]\\d)\\d{7}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[1-579]"],"0$1"]],"0",0,0,0,0,0,[0,["700[1-9]\\d{5}|(?:7(?:0[1-9]|1[0-8]|2[1-35-79]|3\\d|77|86|99)|9\\d\\d)\\d{6}"]]],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,["4946\\d{2,6}|(?:4[0-8]|50)\\d{4,8}",[6,7,8,9,10]]],"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,["(?:[279]\\d|45|5[01568]|8[034679])\\d{5}",[7]]],"00"],FK:["500","00","[2-7]\\d{4}",[5],0,0,0,0,0,0,0,[0,["[56]\\d{4}"]]],FM:["691","00","(?:[39]\\d\\d|820)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[389]"]]],0,0,0,0,0,0,[0,["31(?:00[67]|208|309)\\d\\d|(?:3(?:[2357]0[1-9]|602|804|905)|(?:820|9[2-7]\\d)\\d)\\d{3}"]]],FO:["298","00","[2-9]\\d{5}",[6],[["(\\d{6})","$1",["[2-9]"]]],0,0,"(10(?:01|[12]0|88))",0,0,0,[0,["(?:[27][1-9]|5\\d|9[16])\\d{4}"]]],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",0,0,0,0,0,[0,["(?:6(?:[0-24-8]\\d|3[0-8]|9[589])|7[3-9]\\d)\\d{6}"]]],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",0,0,[0,["(?:(?:0[2-7]|7[467])\\d|6(?:0[0-4]|10|[256]\\d))\\d{5}|[2-7]\\d{6}"]]],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,[0,["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]]],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",[0,["473(?:4(?:0[2-79]|1[04-9]|2[0-5]|49|5[6-8])|5(?:2[01]|3[3-8])|901)\\d{4}"]]],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",0,0,0,0,0,[0,["5(?:(?:(?:0555|1(?:[17]77|555))[5-9]|757(?:7[7-9]|8[01]))\\d|22252[0-4])\\d\\d|5(?:0(?:0(?:1[09]|70)|505)|1(?:0[01]0|1(?:07|33|51))|2(?:0[02]0|2[25]2)|3(?:0[03]0|3[35]3)|(?:40[04]|900)0|5222)[0-4]\\d{3}|(?:5(?:0(?:0(?:0\\d|1[12]|22|3[0-6]|44|5[05]|77|88|9[09])|(?:[14]\\d|77)\\d|22[02])|1(?:1(?:[03][01]|[124]\\d|5[2-6]|7[0-4])|4\\d\\d)|[23]555|4(?:4\\d\\d|555)|5(?:[0157-9]\\d\\d|200|333|444)|6[89]\\d\\d|7(?:(?:[0147-9]\\d|22)\\d|5(?:00|[57]5))|8(?:0(?:[018]\\d|2[0-4])|5(?:55|8[89])|8(?:55|88))|9(?:090|[1-35-9]\\d\\d))|790\\d\\d)\\d{4}"]]],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",0,0,0,0,0,[0,["(?:694(?:[0-249]\\d|3[0-8])|7093[0-3])\\d{4}"]]],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,[0,["7(?:(?:781|839)\\d|911[17])\\d{5}",[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",0,0,0,0,0,[0,["(?:2(?:[0346-9]\\d|5[67])|5(?:[03-7]\\d|9[1-9]))\\d{6}",[9]]]],GI:["350","00","(?:[25]\\d|60)\\d{6}",[8],[["(\\d{3})(\\d{5})","$1 $2",["2"]]],0,0,0,0,0,0,[0,["5251[0-4]\\d{3}|(?:5(?:[146-8]\\d\\d|250)|60(?:1[01]|6\\d))\\d{4}"]]],GL:["299","00","(?:19|[2-689]\\d|70)\\d{4}",[6],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["19|[2-9]"]]],0,0,0,0,0,0,[0,["[245]\\d{5}"]]],GM:["220","00","[2-9]\\d{6}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[2-9]"]]],0,0,0,0,0,0,[0,["556\\d{4}|(?:[23679]\\d|4[015]|5[0-489]|8[67])\\d{5}"]]],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]"]]],0,0,0,0,0,0,[0,["6[0-356]\\d{7}",[9]]]],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,[0,["(?: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}"]]],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]"]]],0,0,0,0,0,0,[0,["(?:222|55\\d)\\d{6}"]]],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"]]],0,0,0,0,0,0,[0,["68[57-9]\\d{7}|(?:69|94)\\d{8}",[10]]]],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"]]],0,0,0,0,0,0,[0,["(?:[3-5]\\d\\d|80[0-4])\\d{5}",[8]]]],GU:["1","011","(?:[58]\\d\\d|671|900)\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","671$1",0,"671",[0,["671(?:2\\d\\d|3(?:00|3[39]|4[349]|55|6[26])|4(?:00|56|7[1-9]|8[02-9])|5(?:55|6[2-5]|88)|6(?:3[2-578]|4[24-9]|5[34]|78|8[235-9])|7(?:[0479]7|2[0167]|3[45]|8[7-9])|8(?:[2-57-9]8|6[478])|9(?:2[29]|6[79]|7[1279]|8[7-9]|9[78]))\\d{4}"]]],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]"]]],0,0,0,0,0,0,[0,["9(?:5\\d|6[569]|77)\\d{6}",[9]]]],GY:["592","001","(?:[2-8]\\d{3}|9008)\\d{3}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[2-9]"]]],0,0,0,0,0,0,[0,["(?:51[01]|6\\d\\d|7(?:[0-5]\\d|6[0-39]|70))\\d{4}"]]],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,["(?:4(?:44[0-35-9]|6(?:4[0-57-9]|6[0-6])|7(?:3[0-4]|4[0-48]|6[0-5]))|5(?:35[4-8]|73[0-6]|95[0-8])|6(?:26[013-8]|(?:66|78)[0-5])|70(?:7[1-8]|8[0-8])|84(?:4[0-2]|8[0-35-9])|9(?:29[013-9]|39[014-9]|59[0-467]|899))\\d{4}|(?:4(?:4[0-35-9]|6[0-357-9]|7[0-25])|5(?:[1-59][0-46-9]|6[0-4689]|7[0-246-9])|6(?:0[1-9]|[13-59]\\d|[268][0-57-9]|7[0-79])|70[1-59]|84[0-39]|9(?:0[1-9]|1[02-9]|[2358][0-8]|[467]\\d))\\d{5}",[8]]],"00"],HN:["504","00","8\\d{10}|[237-9]\\d{7}",[8,11],[["(\\d{4})(\\d{4})","$1-$2",["[237-9]"]]],0,0,0,0,0,0,[0,["[37-9]\\d{7}",[8]]]],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",0,0,0,0,0,[0,["9(?:(?:0[1-9]|[12589]\\d)\\d\\d|7(?:[0679]\\d\\d|5(?:[01]\\d|44|55|77|9[5-79])))\\d{4}|98\\d{6}",[8,9]]]],HT:["509","00","[2-589]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["[2-589]"]]],0,0,0,0,0,0,[0,["(?:[34]\\d|5[56])\\d{6}"]]],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",0,0,0,0,0,[0,["(?:[257]0|3[01])\\d{7}",[9]]]],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",0,0,0,0,0,[0,["8[1-35-9]\\d{7,10}",[9,10,11,12]]]],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",0,0,0,0,0,[0,["8(?:22|[35-9]\\d)\\d{6}",[9]]]],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",0,0,0,0,0,[0,["55(?:4(?:0[0-2]|[16]0|5[0-7])|57[0-289])\\d{4}|5(?:(?:[0-2][02-9]|[36]\\d|[49][2-9]|8[3-7])\\d|5(?:01|2\\d|3[0-3]|4[34]|5[0-25689]|6[6-8]|7[0-267]|8[7-9]|9[1-9]))\\d{5}",[9]]]],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",[0,["76245[06]\\d{4}|7(?:4576|[59]24\\d|624[0-4689])\\d{5}"]]],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",["[6-9]"],"0$1",1],["(\\d{4})(\\d{2,4})(\\d{4})","$1 $2 $3",["1(?:6|8[06])","1(?:6|8[06]0)"],0,1],["(\\d{4})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["18"],0,1]],"0",0,0,0,0,0,[0,["(?:6(?:1279|828[01489])|7(?:887[02-9]|9(?:313|79[07-9]))|8(?:079[04-9]|(?:84|91)7[02-8]))\\d{5}|(?:6(?:12|[2-47]1|5[17]|6[13]|80)[0189]|7(?:1(?:2[0189]|9[0-5])|2(?:[14][017-9]|8[0-59])|3(?:2[5-8]|[34][017-9]|9[016-9])|4(?:1[015-9]|[29][89]|39|8[389])|5(?:[15][017-9]|2[04-9]|9[7-9])|6(?:0[0-47]|1[0-257-9]|2[0-4]|3[19]|5[4589])|70[0289]|88[089]|97[02-8])|8(?:0(?:6[67]|7[02-8])|70[017-9]|84[01489]|91[0-289]))\\d{6}|(?:7(?:31|4[47])|8(?:16|2[014]|3[126]|6[136]|7[78]|83))(?:[0189]\\d|7[02-8])\\d{5}|(?:6(?:[09]\\d|1[04679]|2[03689]|3[05-9]|4[0489]|50|6[069]|7[07]|8[7-9])|7(?:0\\d|2[0235-79]|3[05-8]|40|5[0346-8]|6[6-9]|7[1-9]|8[0-79]|9[089])|8(?:0[01589]|1[0-57-9]|2[235-9]|3[03-57-9]|[45]\\d|6[02457-9]|7[1-69]|8[0-25-9]|9[02-9])|9\\d\\d)\\d{7}|(?:6(?:(?:1[1358]|2[2457]|3[2-4]|4[235-7]|5[2-689]|6[24578])\\d|7(?:[235689]\\d|4[0189])|8(?:[14-6]\\d|2[0-79]))|7(?:1(?:[013-8]\\d|9[6-9])|28[6-8]|3(?:2[0-49]|9[2-5])|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]|881))[0189]\\d{5}",[10]]]],IO:["246","00","3\\d{6}",[7],[["(\\d{3})(\\d{4})","$1 $2",["3"]]],0,0,0,0,0,0,[0,["38\\d{5}"]]],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",0,0,0,0,0,[0,["7[3-9]\\d{8}",[10]]]],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",0,0,0,0,0,[0,["9(?:(?:0[0-5]|[13]\\d|2[0-3])\\d\\d|9(?:[0-46]\\d\\d|5(?:10|5\\d)|8(?:[12]\\d|88)|9(?:[0159]\\d|21|69|77|8[7-9])))\\d{5}",[10]]]],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,["(?:38[589]\\d\\d|6(?:1[1-8]|2[0-6]|3[026-9]|4[014679]|5[0159]|6[0-69]|70|8[06-8]|9\\d)|7(?:5[057]|[6-9]\\d)|8(?:2[0-59]|[3-69]\\d|8[238]))\\d{4}"]],"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,["3[2-9]\\d{7,8}|(?:31|43)\\d{8}",[9,10]]]],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,[0,["7(?:(?:(?:50|82)9|937)\\d|7(?:00[378]|97\\d))\\d{5}"]]],JM:["1","011","(?:[58]\\d\\d|658|900)\\d{7}",[10],0,"1",0,0,0,0,"658|876",[0,["(?:658295|876(?:2(?:0[1-9]|[13-9]\\d|2[013-9])|[348]\\d\\d|5(?:0[1-9]|[1-9]\\d)|6(?:4[89]|6[67])|7(?:0[07]|7\\d|8[1-47-9]|9[0-36-9])|9(?:[01]9|9[0579])))\\d{4}"]]],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",0,0,0,0,0,[0,["(?:427|7(?:[78][0-25-9]|9\\d))\\d{6}",[9]]]],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",0,0,[0,["(?:601[0-4]0|[7-9]0[1-9]\\d\\d)\\d{5}",[10]]]],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",0,0,0,0,0,[0,["(?:1(?:0[0-8]|1\\d|2[014]|[34]0)|7\\d\\d)\\d{6}",[9]]]],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",0,0,0,0,0,[0,["312(?:58\\d|973)\\d{3}|(?:2(?:0[0-35]|2\\d)|5[0-24-7]\\d|600|7(?:[07]\\d|55)|88[08]|9(?:12|9[05-9]))\\d{6}",[9]]]],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",0,0,0,0,0,[0,["(?:(?:1[28]|3[18]|9[67])\\d|6[016-9]|7(?:[07-9]|[16]\\d)|8(?:[013-79]|8\\d))\\d{6}|(?:1\\d|9[0-57-9])\\d{6}|(?:2[3-6]|3[2-6]|4[2-4]|[5-7][2-5])48\\d{5}",[8,9]]]],KI:["686","00","(?:[37]\\d|6[0-79])\\d{6}|(?:[2-48]\\d|50)\\d{3}",[5,8],0,"0",0,0,0,0,0,[0,["(?:6200[01]|7(?:310[1-9]|5(?:02[03-9]|12[0-47-9]|22[0-7]|[34](?:0[1-9]|8[02-9])|50[1-9])))\\d{3}|(?:63\\d\\d|7(?:(?:[0146-9]\\d|2[0-689])\\d|3(?:[02-9]\\d|1[1-9])|5(?:[0-2][013-9]|[34][1-79]|5[1-9]|[6-9]\\d)))\\d{4}",[8]]]],KM:["269","00","[3478]\\d{6}",[7],[["(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3",["[3478]"]]],0,0,0,0,0,0,[0,["[34]\\d{6}"]]],KN:["1","011","(?:[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-7]\\d{6})$|1","869$1",0,"869",[0,["869(?:48[89]|55[6-8]|66\\d|76[02-7])\\d{4}"]]],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",0,0,0,0,0,[0,["19[1-3]\\d{7}",[10]]]],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))?",0,0,0,[0,["1(?:05(?:[0-8]\\d|9[0-6])|22[13]\\d)\\d{4,5}|1(?:0[0-46-9]|[16-9]\\d|2[013-9])\\d{6,7}",[9,10]]]],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]"]]],0,0,0,0,0,0,[0,["(?:41\\d\\d|5(?:(?:[05]\\d|1[0-7]|6[56])\\d|2(?:22|5[25])|7(?:55|77)|88[58])|6(?:(?:0[034679]|5[015-9]|6\\d)\\d|1(?:00|11|6[16])|2[26]2|3[36]3|4[46]4|7(?:0[013-9]|[67]\\d)|8[68]8|9(?:[069]\\d|3[039]))|9(?:(?:[04679]\\d|8[057-9])\\d|1(?:00|1[01]|99)|2(?:00|2\\d)|3(?:00|3[03])|5(?:00|5\\d)))\\d{4}",[8]]]],KY:["1","011","(?:345|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","345$1",0,"345",[0,["345(?:32[1-9]|42[0-4]|5(?:1[67]|2[5-79]|4[6-9]|50|76)|649|82[56]|9(?:1[679]|2[2-9]|3[06-9]|90))\\d{4}"]]],KZ:["7","810","(?:33622|8\\d{8})\\d{5}|[78]\\d{9}",[10,14],0,"8",0,0,0,0,"33622|7",[0,["7(?:0[0-25-8]|47|6[0-4]|7[15-8]|85)\\d{7}",[10]]],"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",0,0,0,0,0,[0,["(?:20(?:[23579]\\d|8[78])|30[24]\\d)\\d{6}|30\\d{7}",[9,10]]]],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",0,0,0,0,0,[0,["(?:(?:3|81)\\d|7(?:[01]\\d|6[013-9]|8[7-9]|9[0-4]))\\d{5}"]]],LC:["1","011","(?:[58]\\d\\d|758|900)\\d{7}",[10],0,"1",0,"([2-8]\\d{6})$|1","758$1",0,"758",[0,["758(?:28[4-7]|384|4(?:6[01]|8[4-9])|5(?:1[89]|20|84)|7(?:1[2-9]|2\\d|3[0-3])|812)\\d{4}"]]],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",0,0,0,[0,["(?:6(?:(?:4[5-9]|5\\d)\\d|6(?:[024-68]\\d|1[01]|3[7-9]|70))\\d|7(?:[37-9]\\d|42|56))\\d{4}"]]],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",0,0,0,0,0,[0,["7(?:[0-25-8]\\d|4[0-4])\\d{6}"]]],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",0,0,0,0,0,[0,["(?:(?:(?:22|33)0|555|7(?:6[01]|7\\d)|88\\d)\\d|4(?:240|[67]))\\d{5}|[56]\\d{6}",[7,9]]]],LS:["266","00","(?:[256]\\d\\d|800)\\d{5}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[2568]"]]],0,0,0,0,0,0,[0,["[56]\\d{7}"]]],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]",0,0,0,[0,["6\\d{7}"]]],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)",0,0,0,[0,["6(?:[269][18]|5[1568]|7[189]|81)\\d{6}",[9]]]],LV:["371","00","(?:[268]\\d|78|90)\\d{6}",[8],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[2679]|8[01]"]]],0,0,0,0,0,0,[0,["2333[0-8]\\d{3}|2(?:[0-24-9]\\d\\d|3(?:0[07]|[14-9]\\d|2[02-9]|3[0-24-9]))\\d{4}"]]],LY:["218","00","[2-9]\\d{8}",[9],[["(\\d{2})(\\d{7})","$1-$2",["[2-9]"],"0$1"]],"0",0,0,0,0,0,[0,["9[1-6]\\d{7}"]]],MA:["212","00","[5-8]\\d{8}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["5[45]"],"0$1"],["(\\d{4})(\\d{5})","$1-$2",["5(?:[19]|2[2-46-9]|3[3-9])|8(?:0[89]|92)"],"0$1"],["(\\d{2})(\\d{7})","$1-$2",["8"],"0$1"],["(\\d{3})(\\d{6})","$1-$2",["[5-7]"],"0$1"]],"0",0,0,0,0,0,[0,["(?:6(?:[0-79]\\d|8[0-247-9])|7(?:[016-8]\\d|2[0-8]|5[0-5]))\\d{6}"]]],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",0,0,0,0,0,[0,["4(?:[469]\\d|5[1-9])\\d{5}|(?:3|[67]\\d)\\d{7}"]]],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",0,0,0,0,0,[0,["562\\d{5}|(?:6\\d|7[16-9])\\d{6}"]]],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",0,0,0,0,0,[0,["6(?:[07-9]\\d|3[024]|6[0-25])\\d{5}",[8]]]],MF:["590","00","(?:590\\d|7090)\\d{5}|(?:69|80|9\\d)\\d{7}",[9],0,"0",0,0,0,0,0,[0,["(?: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}"]]],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",0,0,[0,["3[2-46-9]\\d{7}"]]],MH:["692","011","329\\d{4}|(?:[256]\\d|45)\\d{5}",[7],[["(\\d{3})(\\d{4})","$1-$2",["[2-6]"]]],"1",0,0,0,0,0,[0,["(?:(?:23|54)5|329|45[35-8])\\d{4}"]]],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",0,0,0,0,0,[0,["7(?:3555|(?:474|9[019]7)7)\\d{3}|7(?:[0-25-8]\\d\\d|3(?:[1-478]\\d|6[01])|4(?:2\\d|60|7[01578])|9(?:[2-4]\\d|5[01]|7[015]))\\d{4}"]]],ML:["223","00","[24-9]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[24-9]"]]],0,0,0,0,0,0,[0,["2(?:0(?:01|79)|17\\d)\\d{4}|(?:5[0-3]|[679]\\d|8[2-59])\\d{6}"]]],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",0,0,0,0,0,[0,["(?:17[01]|9(?:2(?:[0-4]|[56]\\d\\d)|(?:3(?:[0-36]|4\\d)|(?:6\\d|8[89]|9[4-8])\\d|7(?:3|40|[5-9]\\d))\\d|4(?:(?:[0245]\\d|[1379])\\d|88)|5[0-6])\\d)\\d{4}|9[69]1\\d{6}|9(?:[68]\\d|9[089])\\d{5}",[7,8,9,10]]]],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",0,0,0,0,0,[0,["92[0139]\\d{5}|(?:5[05]|6[069]|7[28]|8[0135689]|9[013-9])\\d{6}",[8]]]],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]"]]],0,0,0,0,0,0,[0,["6800[0-79]\\d{3}|6(?:[235]\\d\\d|6(?:0[0-5]|[1-9]\\d)|8(?:0[1-9]|[14-8]\\d|2[5-9]|[39][0-4]))\\d{4}",[8]]]],MP:["1","011","[58]\\d{9}|(?:67|90)0\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","670$1",0,"670",[0,["670(?:2(?:3[3-7]|56|8[4-8])|32[1-38]|4(?:33|8[348])|5(?:32|55|88)|6(?:64|70|82)|78[3589]|8[3-9]8|989)\\d{4}"]]],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",0,0,0,0,0,[0,["(?:69[67]\\d\\d|7091[0-3])\\d{4}"]]],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]"]]],0,0,0,0,0,0,[0,["[2-4][0-46-9]\\d{6}"]]],MS:["1","011","(?:[58]\\d\\d|664|900)\\d{7}",[10],0,"1",0,"([34]\\d{6})$|1","664$1",0,"664",[0,["664(?:3(?:49|9[1-6])|49[2-6])\\d{4}"]]],MT:["356","00","3550\\d{4}|(?:[2579]\\d\\d|800)\\d{5}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[2357-9]"]]],0,0,0,0,0,0,[0,["(?:7(?:210|[79]\\d\\d)|9(?:[29]\\d\\d|69[67]|8(?:1[1-3]|89|97)))\\d{4}"]]],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,["5(?:4(?:2[1-389]|7[1-9])|87[15-8])\\d{4}|(?:5(?:2[5-9]|4[3-689]|[57]\\d|8[0-689]|9[0-8])|7(?:0[0-6]|3[013]))\\d{5}",[8]]],"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,["(?:46[46]|[79]\\d\\d)\\d{4}",[7]]],"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",0,0,0,0,0,[0,["111\\d{6}|(?:31|77|[89][89])\\d{7}",[9]]]],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,["(?:2(?:2\\d|3[1-35-8]|4[13-9]|7[1-689]|8[1-578]|9[467])|3(?:1[1-79]|[2458][1-9]|3\\d|7[1-8]|9[1-5])|4(?:1[1-57-9]|[267][1-9]|3[1-8]|[45]\\d|8[1-35-9]|9[2-689])|5(?:[56]\\d|88|9[1-79])|6(?:1[2-68]|[2-4][1-9]|5[1-36-9]|6[0-57-9]|7[1-7]|8[67]|9[4-8])|7(?:[1346][1-9]|[27]\\d|5[13-9]|8[1-69]|9[17])|8(?:1\\d|2[13-689]|3[1-6]|4[124-6]|6[1246-9]|7[0-378]|9[12479])|9(?:1[346-9]|2[1-4]|3[2-46-8]|5[1348]|[69]\\d|7[12]|8[1-8]))\\d{7}"]],"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",0,0,0,0,0,[0,["1(?:1888[689]|4400|8(?:47|8[27])[0-4])\\d{4}|1(?:0(?:[23568]\\d|4[0-6]|7[016-9]|9[0-8])|1(?:[1-5]\\d\\d|6(?:0[5-9]|[1-9]\\d)|7(?:[0-4]\\d|5[0-7]))|(?:[269]\\d|[37][1-9]|4[235-9])\\d|5(?:31|9\\d\\d)|8(?:1[23]|[236]\\d|4[06]|5(?:46|[7-9])|7[016-9]|8[01]|9[0-8]))\\d{5}",[9,10]]]],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"]]],0,0,0,0,0,0,[0,["8[2-79]\\d{7}",[9]]]],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",0,0,0,0,0,[0,["(?:60|8[1245])\\d{7}",[9]]]],NC:["687","00","(?:050|[2-57-9]\\d\\d)\\d{3}",[6],[["(\\d{2})(\\d{2})(\\d{2})","$1.$2.$3",["[02-57-9]"]]],0,0,0,0,0,0,[0,["(?:[579]\\d|8[0-79])\\d{4}"]]],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]"]]],0,0,0,0,0,0,[0,["(?:23|7[0467]|[89]\\d)\\d{6}"]]],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",0,0,[0,["(?:14|3[58])\\d{4}"]]],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",0,0,0,0,0,[0,["(?:702[0-24-9]|819[01])\\d{6}|(?:7(?:0[13-9]|[12]\\d)|8(?:0[1-9]|1[0-8])|9(?:0[1-9]|1[1-6]))\\d{7}",[10]]]],NI:["505","00","(?:1800|[25-8]\\d{3})\\d{4}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[125-8]"]]],0,0,0,0,0,0,[0,["(?:5(?:5[0-7]|[78]\\d)|6(?:20|3[035]|4[045]|5[05]|77|8[1-9]|9[059])|(?:7[5-8]|8\\d)\\d)\\d{5}"]]],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",0,0,0,0,0,[0,["(?:6[1-58]|970\\d)\\d{7}",[9,11]]]],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]",[0,["(?:4[015-8]|9\\d)\\d{6}",[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",0,0,0,0,0,[0,["9(?:00|6[0-3]|7[0-24-6]|8[0-24-68])\\d{7}",[10]]]],NR:["674","00","(?:222|444|(?:55|8\\d)\\d|666|777|999)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[24-9]"]]],0,0,0,0,0,0,[0,["(?:222|55[3-9]|666|777|8\\d\\d|999)\\d{4}"]]],NU:["683","00","(?:[4-7]|888\\d)\\d{3}",[4,7],[["(\\d{3})(\\d{4})","$1 $2",["8"]]],0,0,0,0,0,0,[0,["(?:[56]|888[1-9])\\d{3}"]]],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,["2(?:[0-27-9]\\d|6)\\d{6,7}|2(?:1\\d|75)\\d{5}",[8,9,10]]],"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]"]]],0,0,0,0,0,0,[0,["(?:1505|90[1-9]\\d)\\d{4}|(?:7[124-9]|9[1-9])\\d{6}",[8]]]],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"]]],0,0,0,0,0,0,[0,["(?:1[16]1|21[89]|6\\d{3}|8(?:1[01]|7[23]))\\d{4}",[7,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,["9\\d{8}",[9]]],"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"]]],0,0,0,0,0,0,[0,["8[7-9]\\d{6}",[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,["(?:7\\d|8[1-48])\\d{6}",[8]]],"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",0,0,0,0,0,[0,["(?:8(?:1[37]|9[5-8])|9(?:0[5-9]|1[0-24-9]|[235-7]\\d|4[2-9]|8[135-9]|9[1-9]))\\d{7}",[10]]]],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",0,0,0,0,0,[0,["3(?:[0-247]\\d|3[0-79]|55|64)\\d{7}",[10]]]],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"]]],0,0,0,0,0,0,[0,["2131[89]\\d{4}|21(?:1[013-5]|2\\d|3[2-9])\\d{5}|(?:45|5[0137]|6[069]|7[2389]|88)\\d{7}",[9]]]],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",0,0,0,0,0,[0,["(?:4[02-489]|5[02-9]|708(?:4[0-5]|5[0-6]))\\d{4}"]]],PR:["1","011","(?:[589]\\d\\d|787)\\d{7}",[10],0,"1",0,0,0,0,"787|939",[0,["(?:787|939)[2-9]\\d{6}"]]],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",0,0,0,0,0,[0,["5[69]\\d{7}",[9]]]],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]"]]],0,0,0,0,0,0,[0,["6(?:[06]92(?:30|9\\d)|[35]92(?:[049]\\d|3[034]))\\d{3}|(?:(?:16|6[0356])93|9(?:[1-36]\\d\\d|480))\\d{5}"]]],PW:["680","01[12]","(?:[24-8]\\d\\d|345|900)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[2-9]"]]],0,0,0,0,0,0,[0,["(?:(?:46|83)[0-5]|(?:6[2-4689]|78)0)\\d{4}|(?:45|77|88)\\d{5}"]]],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",0,0,0,0,0,[0,["9(?:51|6[129]|7[1-6]|8[1-7]|9[1-5])\\d{6}",[9]]]],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]"]]],0,0,0,0,0,0,[0,["[35-7]\\d{7}",[8]]]],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,[0,["(?: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}"]]],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,["(?:630|702)0\\d{5}|(?:6(?:00|2\\d)|7(?:0[013-9]|1[0-3]|[2-7]\\d|8[03-8]|9[0-39]))\\d{6}",[9]]],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",0,0,0,0,0,[0,["6(?:[0-689]|7\\d)\\d{6,7}",[8,9,10]]]],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,[0,["9\\d{9}",[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",0,0,0,0,0,[0,["7[237-9]\\d{7}",[9]]]],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",0,0,0,0,0,[0,["579[01]\\d{5}|5(?:[013-689]\\d|7[0-8])\\d{6}",[9]]]],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])"]]],0,0,0,0,0,0,[0,["48\\d{3}|(?:(?:6[89]|7[1-9]|8[4-9])\\d|9(?:1[2-9]|2[013-9]|3[0-2]|[46]\\d|5[0-46-9]|7[0-689]|8[0-79]|9[0-8]))\\d{4}"]]],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,["2[125-8]\\d{5}"]],"00"],SD:["249","00","[19]\\d{8}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[19]"],"0$1"]],"0",0,0,0,0,0,[0,["(?:1[0-2]|9[0-3569])\\d{7}"]]],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",0,0,0,0,0,[0,["7[02369]\\d{7}",[9]]]],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"]]],0,0,0,0,0,0,[0,["89(?:8[02-9]|90)\\d{4}|(?:8(?:0[1-9]|[1-8]\\d|9[0-7])|9[0-8]\\d)\\d{5}",[8]]]],SH:["290","00","(?:[256]\\d|8)\\d{3}",[4,5],0,0,0,0,0,0,"[256]",[0,["[56]\\d{4}",[5]]]],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,["65(?:[178]\\d|5[56]|6[01])\\d{4}|(?:[37][01]|4[0139]|51|6[489])\\d{6}",[8]]],"00"],SJ:["47","00","0\\d{4}|(?:[489]\\d|79)\\d{6}",[5,8],0,0,0,0,0,0,"79",[0,["(?:4[015-8]|9\\d)\\d{6}",[8]]]],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",0,0,0,0,0,[0,["909[1-9]\\d{5}|9(?:0[1-8]|1[0-24-9]|4[03-57-9]|5\\d)\\d{6}",[9]]]],SL:["232","00","(?:[237-9]\\d|66)\\d{6}",[8],[["(\\d{2})(\\d{6})","$1 $2",["[236-9]"],"(0$1)"]],"0",0,0,0,0,0,[0,["(?:25|3[0-5]|66|7[1-9]|8[08]|9[09])\\d{6}"]]],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",0,0,[0,["6[16]\\d{6}",[8]]]],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]"]]],0,0,0,0,0,0,[0,["7(?:[015-8]\\d|21|90)\\d{6}"]]],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",0,0,0,0,0,[0,["(?:(?:15|(?:3[59]|4[89]|6\\d|7[679]|8[08])\\d|9(?:0\\d|[2-9]))\\d|2(?:4\\d|8))\\d{5}|(?:[67]\\d\\d|904)\\d{5}",[7,8,9]]]],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]"]]],0,0,0,0,0,0,[0,["(?:6[08]|7[124-7]|8[1-9])\\d{5}",[7]]]],SS:["211","00","[19]\\d{8}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[19]"],"0$1"]],"0",0,0,0,0,0,[0,["(?:12|9[1257-9])\\d{7}"]]],ST:["239","00","(?:22|9\\d)\\d{5}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[29]"]]],0,0,0,0,0,0,[0,["900[5-9]\\d{3}|9(?:0[1-9]|[89]\\d)\\d{4}"]]],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]"]]],0,0,0,0,0,0,[0,["(?:5(?:00[0-4]|100)|[67]\\d{3})\\d{4}",[8]]]],SX:["1","011","7215\\d{6}|(?:[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"(5\\d{6})$|1","721$1",0,"721",[0,["7215(?:1[02]|2\\d|5[034679]|8[014-8])\\d{4}"]]],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",0,0,0,0,0,[0,["(?:50|9[1-9])\\d{7}",[9]]]],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"]]],0,0,0,0,0,0,[0,["7[5-9]\\d{6}",[8]]]],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",[0,["649(?:2(?:3[129]|4[1-79])|3\\d\\d|4[34][1-3])\\d{4}"]]],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,["(?:30|[69]\\d|77|8[56])\\d{6}"]],"00"],TG:["228","00","[279]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[279]"]]],0,0,0,0,0,0,[0,["(?:7[0-29]|9[0-36-9])\\d{6}"]]],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",0,0,0,0,0,[0,["67(?:1[0-8]|2[4-7])\\d{5}|(?:14|6[1-6]|[89]\\d)\\d{7}",[9]]]],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,["(?:33[03-9]|4(?:1[18]|4[02-479])|81[1-9])\\d{6}|(?:[09]\\d|1[0-27-9]|2[0-27]|3[08]|40|5[05]|66|7[01578]|8[078])\\d{7}"]],"8~10"],TK:["690","00","[2-47]\\d{3,6}",[4,5,6,7],0,0,0,0,0,0,0,[0,["7[2-4]\\d{2,5}"]]],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"]]],0,0,0,0,0,0,[0,["7[2-8]\\d{6}",[8]]]],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,["(?:6\\d|71)\\d{6}"]],"8~10"],TN:["216","00","[2-57-9]\\d{7}",[8],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[2-57-9]"]]],0,0,0,0,0,0,[0,["3(?:001|[12]40)\\d{4}|(?:(?:[259]\\d|4[0-8])\\d|3(?:1[1-35]|6[0-4]|91))\\d{5}"]]],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]"]]],0,0,0,0,0,0,[0,["(?:5(?:4[0-5]|5[4-6])|6(?:[09]\\d|3[02]|8[15-9])|(?:7\\d|8[46-9])\\d|999)\\d{4}",[7]]]],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",0,0,0,0,0,[0,["561(?:011|61\\d)\\d{4}|5(?:0[15-7]|1[06]|24|[34]\\d|5[1-59]|9[46])\\d{7}",[10]]]],TT:["1","011","(?:[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-46-8]\\d{6})$|1","868$1",0,"868",[0,["868(?:(?:2[5-9]|3\\d)\\d|4(?:3[0-6]|[6-9]\\d)|6(?:20|78|8\\d)|7(?:0[1-9]|1[02-9]|[2-9]\\d))\\d{4}"]]],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"]]],0,0,0,0,0,0,[0,["(?:7[01]\\d|90)\\d{4}",[6,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,["(?:40001[0-2]|9[0-8]\\d{4})\\d{3}",[9]]],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",0,0,0,0,0,[0,["(?:6[125-9]|7[13-9])\\d{7}"]]],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,["790\\d{6}|(?:39|50|6[36-8]|7[1-357]|9[1-9])\\d{7}",[9]]],"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",0,0,0,0,0,[0,["72[48]0\\d{5}|7(?:[014-8]\\d|2[0167]|36|9[0-2589])\\d{6}"]]],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,[0,["3052(?:0[0-8]|[1-9]\\d)\\d{4}|(?:2742|305[3-9])\\d{6}|(?: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-47-9]|1[02-9]|2[013-79]|3[0-24679]|4[167]|5[0-2]|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}"]]],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,["9[1-9]\\d{6}",[8]]],"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]"]]],0,0,0,0,0,0,[0,["(?:(?:[25]0|33|8[78]|9[0-57-9])\\d{3}|6(?:1(?:2(?:2[01]|98)|35[0-4]|50\\d|61[23]|7(?:[01][017]|4\\d|55|9[5-9]))|2(?:(?:11|7\\d)\\d|2(?:[12]1|9[01379])|5(?:[126]\\d|3[0-4]))|5(?:19[01]|2(?:27|9[26])|(?:30|59|7\\d)\\d)|6(?:2(?:1[5-9]|2[0367]|38|41|52|60)|(?:3[79]|9[0-3])\\d|4(?:56|83)|7(?:[07]\\d|1[017]|3[07]|4[047]|5[057]|67|8[0178]|9[79]))|7(?:2(?:24|3[237]|4[5-9]|7[15-8])|5(?:7[12]|8[0589])|7(?:0\\d|[39][07])|9(?:0\\d|7[079])))|7(?:[07]\\d{3}|2(?:2(?:2[79]|95)|3(?:2[5-9]|6[0-6])|57\\d|7(?:0\\d|1[17]|2[27]|3[37]|44|5[057]|66|88))|3(?:2(?:1[0-6]|21|3[469]|7[159])|(?:33|9[4-6])\\d|5(?:0[0-4]|5[579]|9\\d)|7(?:[0-3579]\\d|4[0467]|6[67]|8[078]))|4(?:2(?:29|5[0257]|6[0-7]|7[1-57])|5(?:1[0-4]|8\\d|9[5-9])|7(?:0\\d|1[024589]|2[0-27]|3[0137]|[46][07]|5[01]|7[5-9]|9[079])|9(?:7[015-9]|[89]\\d))|5(?:112|2(?:0\\d|2[29]|[49]4)|3[1568]\\d|52[6-9]|7(?:0[01578]|1[017]|[23]7|4[047]|[5-7]\\d|8[78]|9[079]))|9(?:22[128]|3(?:2[0-4]|7\\d)|57[02569]|7(?:2[05-9]|3[37]|4\\d|60|7[2579]|87|9[07]))))\\d{4}"]]],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",[0,["3[1-9]\\d{8}|3[2-9]\\d{7}",[9,10]]]],VC:["1","011","(?:[58]\\d\\d|784|900)\\d{7}",[10],0,"1",0,"([2-7]\\d{6})$|1","784$1",0,"784",[0,["784(?:4(?:3[0-5]|5[45]|89|9[0-8])|5(?:2[6-9]|3[0-4])|720)\\d{4}"]]],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",0,0,0,0,0,[0,["4(?:1[24-8]|2[246])\\d{7}"]]],VG:["1","011","(?:284|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-578]\\d{6})$|1","284$1",0,"284",[0,["284(?:245|3(?:0[0-3]|4[0-7]|68|9[34])|4(?:4[0-6]|68|9[69])|5(?:4[0-7]|68|9[69]))\\d{4}"]]],VI:["1","011","[58]\\d{9}|(?:34|90)0\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","340$1",0,"340",[0,["340(?:2(?:0\\d|10|2[06-8]|4[49]|77)|3(?:32|44)|4(?:2[23]|44|7[34]|89)|5(?:1[34]|55)|6(?:2[56]|4[23]|77|9[023])|7(?:1[2-57-9]|2[57]|7\\d)|884|998)\\d{4}"]]],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",0,0,0,0,0,[0,["(?:5(?:2[238]|59)|89[6-9]|99[013-9])\\d{6}|(?:3\\d|5[1689]|7[06-9]|8[1-8]|9[0-8])\\d{7}",[9]]]],VU:["678","00","[57-9]\\d{6}|(?:[238]\\d|48)\\d{3}",[5,7],[["(\\d{3})(\\d{4})","$1 $2",["[57-9]"]]],0,0,0,0,0,0,[0,["(?:[58]\\d|7[013-7])\\d{5}",[7]]]],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"]]],0,0,0,0,0,0,[0,["(?:72|8[23])\\d{4}",[6]]]],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"]]],0,0,0,0,0,0,[0,["(?:7[1-35-8]|8(?:[3-7]|9\\d{3}))\\d{5}",[7,10]]]],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",0,0,0,0,0,[0,["4[3-9]\\d{6}",[8]]]],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",0,0,0,0,0,[0,["7[01378]\\d{7}",[9]]]],YT:["262","00","7093\\d{5}|(?:80|9\\d)\\d{7}|(?:26|63)9\\d{6}",[9],0,"0",0,0,0,0,0,[0,["(?:639(?:0[0-79]|1[019]|[267]\\d|3[09]|40|5[05-9]|9[04-79])|7093[5-7])\\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",0,0,0,0,0,[0,["(?:1(?:3492[0-25]|4495[0235]|549(?:20|5[01]))|4[34]492[01])\\d{3}|8[1-4]\\d{3,7}|(?:2[27]|47|54)4950\\d{3}|(?:1(?:049[2-4]|9[12]\\d\\d)|(?:50[0-2]|[67]\\d\\d)\\d\\d|8(?:5\\d{3}|7(?:08[67]|158|28[5-9]|310)))\\d{4}|(?:1[6-8]|28|3[2-69]|4[025689]|5[36-8])4920\\d{3}|(?:12|[2-5]1)492\\d{4}",[5,6,7,8,9]]]],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",0,0,0,0,0,[0,["(?:[59][5-8]|7[5-9])\\d{7}"]]],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",0,0,0,0,0,[0,["7(?:[1278]\\d|3[1-9])\\d{6}",[9]]]]},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}"]]]}}},1334:function(e,t,n){n.d(t,{A:function(){return r}});var a=n(1594),s=n.n(a),i=n(3913);class r extends s().PureComponent{constructor(e){super(e),this.state={show:!1},this.hide=this.hide.bind(this)}componentDidUpdate(e){e.level!==this.props.level&&this.setState({show:!!this.props.level})}hide(){this.setState({show:!1}),this.props.onClearError&&this.props.onClearError()}render(){const e={err:"error",warn:"warning",info:"info"}[this.props.level]||"",t="info-box "+e;return s().createElement("div",{className:t},s().createElement("div",{className:"icon"},s().createElement("i",{className:"material-icons"},e)),s().createElement("span",null,this.props.text,this.props.action?s().createElement(s().Fragment,null," ",s().createElement("a",{href:"#",style:{whiteSpace:"nowrap"},onClick:e=>{e.preventDefault(),this.props.action()}},this.props.actionText)):null),s().createElement("div",{className:"cancel"},s().createElement(i.A,{onCancel:this.hide})))}}},1459:function(e,t,n){function a(e,t){if(e&&t.numberingPlan.nationalPrefixForParsing()){var n=new RegExp("^(?:"+t.numberingPlan.nationalPrefixForParsing()+")"),a=n.exec(e);if(a){var s,i,r,o=a.length-1,d=o>0&&a[o];if(t.nationalPrefixTransformRule()&&d)s=e.replace(n,t.nationalPrefixTransformRule()),o>1&&(i=a[1]);else{var l=a[0];s=e.slice(l.length),d&&(i=a[1])}if(d){var c=e.indexOf(a[1]);e.slice(0,c)===t.numberingPlan.nationalPrefix()&&(r=t.numberingPlan.nationalPrefix())}else r=a[0];return{nationalNumber:s,nationalPrefix:r,carrierCode:i}}}return{nationalNumber:e}}n.d(t,{A:function(){return a}})},1485:function(e,t,n){n.d(t,{A:function(){return r}});var a=n(1594),s=n.n(a),i=n(6789);class r extends s().Component{constructor(e){super(e),this.selfRef=s().createRef(),this.state={active:e.active,initialValue:e.value||"",value:e.value||"",valid:!0},this.handeTextChange=this.handeTextChange.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleStartEditing=this.handleStartEditing.bind(this),this.handleEditingFinished=this.handleEditingFinished.bind(this),this.handlePasswordFinished=this.handlePasswordFinished.bind(this)}componentDidUpdate(e,t){const n=this.props.value||"";t.initialValue==n||t.active||this.setState({initialValue:n,value:n})}handeTextChange(e){this.setState({value:e.target.value||""}),this.props.validator&&Promise.resolve(this.props.validator(e.target.value)).then(e=>{this.setState({valid:e})}).catch(e=>{e&&this.setState({valid:!1})})}handleKeyDown(e){27===e.keyCode?this.setState({value:this.props.value,active:!1}):13===e.keyCode&&this.handleEditingFinished(e)}handleStartEditing(){this.props.readOnly||this.setState({active:!0},e=>{this.selfRef.current&&this.selfRef.current.focus()})}handleEditingFinished(e){const t=this.state.value.trim();!this.props.required||e.target.checkValidity()&&t?(this.setState({active:!1}),(t||this.props.value)&&t!==this.props.value&&this.state.valid&&this.props.onFinished(t)):this.setState({value:this.props.value,active:!1})}handlePasswordFinished(e){this.setState({active:!1}),e&&e!==this.props.value&&this.props.onFinished(e)}render(){if(!this.state.active){let e="password"==this.props.type?"••••••••":this.state.value,t="in-place-edit"+(this.props.readOnly?" disabled":"");return e||(e=this.props.placeholder,t+=" placeholder"),this.props.multiline&&1!=this.props.multiline||(t+=" short"),s().createElement("span",{className:t,onClick:this.handleStartEditing},this.props.iconLeft&&s().createElement("i",{className:"material-icons light-gray"},this.props.iconLeft),s().createElement("span",null,e),this.props.iconRight&&s().createElement("i",{className:"material-icons light-gray"},this.props.iconRight))}let e;const t={};return"password"==this.props.type?(e=i.A,t.onFinished=this.handlePasswordFinished):(this.props.multiline>1?(e="textarea",t.rows=this.props.multiline,t.className="in-place-edit"):(e="input",t.type=this.props.type||"text",t.className="in-place-edit"+(this.props.iconLeft?" with-icon-left":this.props.iconRight?" with-icon-right":""),this.props.maxLength&&(t.maxLength=this.props.maxLength)),t.value=this.state.value,t.className+=this.state.valid?"":" invalid",t.ref=this.selfRef,t.onChange=this.handeTextChange,t.onKeyDown=this.handleKeyDown,t.onBlur=this.handleEditingFinished),t.placeholder=this.props.placeholder,t.required=this.props.required?"required":"",t.autoComplete=this.props.autoComplete,t.autoFocus=!0,void 0!==this.props.spellCheck&&(t.spellCheck=this.props.spellCheck?"true":"false"),this.props.iconLeft||this.props.iconRight?s().createElement(s().Fragment,null,this.props.iconLeft&&s().createElement("i",{className:"material-icons light-gray"},this.props.iconLeft),s().createElement(e,t,null),this.props.iconRight&&s().createElement("i",{className:"material-icons light-gray"},this.props.iconRight)):s().createElement(e,t,null)}}},1528:function(e,t,n){n.d(t,{A:function(){return i},_:function(){return s}});var a=n(1135),s=/(\$\d)/;function i(e,t,n){var i=n.useInternationalFormat,r=n.withNationalPrefix,o=(n.carrierCode,n.metadata,e.replace(new RegExp(t.pattern()),i?t.internationalFormat():r&&t.nationalPrefixFormattingRule()?t.format().replace(s,t.nationalPrefixFormattingRule()):t.format()));return i?(0,a.A)(o):o}},1594:function(e){e.exports=React},1781:function(e){e.exports=JSON.parse('{"patt":[{"name":"a00.png","size":200},{"name":"a01.jpg","size":384},{"name":"a02.jpg","size":384},{"name":"a03.jpg","size":384},{"name":"a04.png","size":400},{"name":"a05.jpg","size":400},{"name":"a06.jpg","size":256},{"name":"a07.jpg","size":384},{"name":"a08.jpg","size":384},{"name":"a09.jpg","size":400},{"name":"a10.jpg","size":256},{"name":"a11.png","size":200}],"img":[{"name":"w01.jpg","pr":"p01.jpg"},{"name":"w02.jpg","pr":"p02.jpg"},{"name":"w03.jpg","pr":"p03.jpg"},{"name":"w04.jpg","pr":"p04.jpg"},{"name":"w05.jpg","pr":"p05.jpg"},{"name":"w06.jpg","pr":"p06.jpg"},{"name":"w07.jpg","pr":"p07.jpg"},{"name":"w08.jpg","pr":"p08.jpg"},{"name":"w09.jpg","pr":"p09.jpg"},{"name":"w10.jpg","pr":"p10.jpg"},{"name":"w11.jpg","pr":"p11.jpg"},{"name":"w12.jpg","pr":"p12.jpg"},{"name":"w13.jpg","pr":"p13.jpg"},{"name":"w14.jpg","pr":"p14.jpg"},{"name":"w15.jpg","pr":"p15.jpg"},{"name":"w16.jpg","pr":"p16.jpg"},{"name":"w17.jpg","pr":"p17.jpg"},{"name":"w18.jpg","pr":"p18.jpg"},{"name":"w19.jpg","pr":"p19.jpg"},{"name":"w20.jpg","pr":"p20.jpg"},{"name":"w21.jpg","pr":"p21.jpg"},{"name":"w22.jpg","pr":"p22.jpg"},{"name":"w23.jpg","pr":"p23.jpg"},{"name":"w24.jpg","pr":"p24.jpg"}]}')},1786:function(e,t,n){n.d(t,{A:function(){return r}});var a=n(3247);function s(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return i(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?i(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var a=0;return function(){return a>=e.length?{done:!0}:{done:!1,value:e[a++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,a=Array(t);n<t;n++)a[n]=e[n];return a}function r(e,t,n){return o(e,t,void 0,n)}function o(e,t,n,i){t&&(i=new a.Ay(i.metadata)).selectNumberingPlan(t);var r=i.type(n),d=r&&r.possibleLengths()||i.possibleLengths();if(!d)return"IS_POSSIBLE";if("FIXED_LINE_OR_MOBILE"===n){if(!i.type("FIXED_LINE"))return o(e,t,"MOBILE",i);var l=i.type("MOBILE");l&&(d=function(e,t){for(var n,a=e.slice(),i=s(t);!(n=i()).done;){var r=n.value;e.indexOf(r)<0&&a.push(r)}return a.sort(function(e,t){return e-t})}(d,l.possibleLengths()))}else if(n&&!r)return"INVALID_LENGTH";var c=e.length,h=d[0];return h===c?"IS_POSSIBLE":h>c?"TOO_SHORT":d[d.length-1]<c?"TOO_LONG":d.indexOf(c,1)>=0?"IS_POSSIBLE":"INVALID_LENGTH"}},2582:function(e,t,n){n.d(t,{A:function(){return i},x:function(){return r}});var a=n(3247),s=n(1786);function i(e,t,n){if(void 0===t&&(t={}),n=new a.Ay(n),t.v2){if(!e.countryCallingCode)throw new Error("Invalid phone number object passed");n.selectNumberingPlan(e.countryCallingCode)}else{if(!e.phone)return!1;if(e.country){if(!n.hasCountry(e.country))throw new Error("Unknown country: ".concat(e.country));n.selectNumberingPlan(e.country)}else{if(!e.countryCallingCode)throw new Error("Invalid phone number object passed");n.selectNumberingPlan(e.countryCallingCode)}}if(n.possibleLengths())return r(e.phone||e.nationalNumber,e.country,n);if(e.countryCallingCode&&n.isNonGeographicCallingCode(e.countryCallingCode))return!0;throw new Error('Missing "possibleLengths" in metadata. Perhaps the metadata has been generated before v1.0.18.')}function r(e,t,n){return"IS_POSSIBLE"===(0,s.A)(e,t,n)}},3247:function(e,t,n){function a(e,t){e=e.split("-"),t=t.split("-");for(var n=e[0].split("."),a=t[0].split("."),s=0;s<3;s++){var i=Number(n[s]),r=Number(a[s]);if(i>r)return 1;if(r>i)return-1;if(!isNaN(i)&&isNaN(r))return 1;if(isNaN(i)&&!isNaN(r))return-1}return e[1]&&t[1]?e[1]>t[1]?1:e[1]<t[1]?-1:0:!e[1]&&t[1]?1:e[1]&&!t[1]?-1:0}n.d(t,{Ay:function(){return p},Ko:function(){return y},aR:function(){return $}});var s=n(284);function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,l(a.key),a)}}function d(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function l(e){var t=function(e,t){if("object"!=i(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var a=n.call(e,t||"default");if("object"!=i(a))return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==i(t)?t:t+""}var c=" ext. ",h=/^\d+$/,p=function(){return d(function e(t){r(this,e),$(t),this.metadata=t,E.call(this,t)},[{key:"getCountries",value:function(){return Object.keys(this.metadata.countries).filter(function(e){return"001"!==e})}},{key:"getCountryMetadata",value:function(e){return this.metadata.countries[e]}},{key:"nonGeographic",value:function(){if(!(this.v1||this.v2||this.v3))return this.metadata.nonGeographic||this.metadata.nonGeographical}},{key:"hasCountry",value:function(e){return void 0!==this.getCountryMetadata(e)}},{key:"hasCallingCode",value:function(e){if(this.getCountryCodesForCallingCode(e))return!0;if(this.nonGeographic()){if(this.nonGeographic()[e])return!0}else{var t=this.countryCallingCodes()[e];if(t&&1===t.length&&"001"===t[0])return!0}}},{key:"isNonGeographicCallingCode",value:function(e){return this.nonGeographic()?!!this.nonGeographic()[e]:!this.getCountryCodesForCallingCode(e)}},{key:"country",value:function(e){return this.selectNumberingPlan(e)}},{key:"selectNumberingPlan",value:function(e,t){if(e&&h.test(e)&&(t=e,e=null),e&&"001"!==e){if(!this.hasCountry(e))throw new Error("Unknown country: ".concat(e));this.numberingPlan=new u(this.getCountryMetadata(e),this)}else if(t){if(!this.hasCallingCode(t))throw new Error("Unknown calling code: ".concat(t));this.numberingPlan=new u(this.getNumberingPlanMetadata(t),this)}else this.numberingPlan=void 0;return this}},{key:"getCountryCodesForCallingCode",value:function(e){var t=this.countryCallingCodes()[e];if(t){if(1===t.length&&3===t[0].length)return;return t}}},{key:"getCountryCodeForCallingCode",value:function(e){var t=this.getCountryCodesForCallingCode(e);if(t)return t[0]}},{key:"getNumberingPlanMetadata",value:function(e){var t=this.getCountryCodeForCallingCode(e);if(t)return this.getCountryMetadata(t);if(this.nonGeographic()){var n=this.nonGeographic()[e];if(n)return n}else{var a=this.countryCallingCodes()[e];if(a&&1===a.length&&"001"===a[0])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(e){return this.numberingPlan.type(e)}},{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(e){return this.selectNumberingPlan(e)}},{key:"hasSelectedNumberingPlan",value:function(){return void 0!==this.numberingPlan}}])}(),u=function(){return d(function e(t,n){r(this,e),this.globalMetadataObject=n,this.metadata=t,E.call(this,n.metadata)},[{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(e){return e[this.v1?2:this.v2?3:4]}},{key:"formats",value:function(){var e=this,t=this._getFormats(this.metadata)||this._getFormats(this.getDefaultCountryMetadataForRegion())||[];return t.map(function(t){return new m(t,e)})}},{key:"nationalPrefix",value:function(){return this.metadata[this.v1?3:this.v2?4:5]}},{key:"_getNationalPrefixFormattingRule",value:function(e){return e[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()||0!==this.types().length)&&!!this.types()}},{key:"type",value:function(e){if(this.hasTypes()&&v(this.types(),e))return new f(v(this.types(),e),this)}},{key:"ext",value:function(){return this.v1||this.v2?c:this.metadata[13]||c}}])}(),m=function(){return d(function e(t,n){r(this,e),this._format=t,this.metadata=n},[{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()||g.test(this.nationalPrefixFormattingRule()))}},{key:"internationalFormat",value:function(){return this._format[5]||this.format()}}])}(),g=/^\(?\$1\)?$/,f=function(){return d(function e(t,n){r(this,e),this.type=t,this.metadata=n},[{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 v(e,t){switch(t){case"FIXED_LINE":return e[0];case"MOBILE":return e[1];case"TOLL_FREE":return e[2];case"PREMIUM_RATE":return e[3];case"PERSONAL_NUMBER":return e[4];case"VOICEMAIL":return e[5];case"UAN":return e[6];case"PAGER":return e[7];case"VOIP":return e[8];case"SHARED_COST":return e[9]}}function $(e){if(!e)throw new Error("[libphonenumber-js] `metadata` argument not passed. Check your arguments.");if(!(0,s.A)(e)||!(0,s.A)(e.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((0,s.A)(e)?"an object of shape: { "+Object.keys(e).join(", ")+" }":"a "+b(e)+": "+e,"."))}var b=function(e){return i(e)};function y(e,t){if((t=new p(t)).hasCountry(e))return t.selectNumberingPlan(e).countryCallingCode();throw new Error("Unknown country: ".concat(e))}function E(e){var t=e.version;"number"==typeof t?(this.v1=1===t,this.v2=2===t,this.v3=3===t,this.v4=4===t):t?-1===a(t,"1.2.0")?this.v2=!0:-1===a(t,"1.7.35")?this.v3=!0:this.v4=!0:this.v1=!0}},3307:function(e,t,n){n.d(t,{A:function(){return c}});var a=n(1594),s=n.n(a),i=n(8181),r=n(5874),o=n(4532),d=n(9027),l=n(3540);class c extends s().Component{constructor(e){super(e),this.state={tags:this.props.tags||[],alias:o.Tinode.tagByPrefix(this.props.tags,o.Tinode.TAG_ALIAS)||"",tagInput:"",activated:this.props.activated},this.handleTagInput=this.handleTagInput.bind(this),this.handleAddTag=this.handleAddTag.bind(this),this.handleRemoveTag=this.handleRemoveTag.bind(this),this.handleSubmit=this.handleSubmit.bind(this),this.handleCancel=this.handleCancel.bind(this)}static getDerivedStateFromProps(e,t){const n=e.tags||[];return(0,l.af)(n,t.tags)||t.activated?null:{tags:n||[],alias:o.Tinode.tagByPrefix(n,o.Tinode.TAG_ALIAS)||""}}handleTagInput(e){if(this.setState({tagInput:e}),e.length>0){const t=e[e.length-1];'"'==e[0]?e.length>1&&'"'==t&&this.handleAddTag(e.substring(1,e.length-1)):","!=t&&" "!=t&&";"!=t&&'"'!=t||this.handleAddTag(e.substring(0,e.length-1).trim())}}handleAddTag(e){const t=this.props.tinode.getServerParam(o.Tinode.MAX_TAG_COUNT,d.GB);if(e.length>0&&this.state.tags.length<t){const t=this.state.tags.slice(0);return t.push(e),this.setState({tags:t,tagInput:""}),this.props.onTagsChanged&&this.props.onTagsChanged(t),t}return this.state.tags}handleRemoveTag(e,t){const n=this.state.tags.slice(0);n.splice(t,1),this.setState({tags:n}),this.props.onTagsChanged&&this.props.onTagsChanged(n)}handleSubmit(){let e=this.handleAddTag(this.state.tagInput.trim());e=o.Tinode.setUniqueTag(e,this.state.alias),this.props.onSubmit(e),this.setState({activated:!1,tags:this.props.tags||[]})}handleCancel(){this.setState({activated:!1,tagInput:"",tags:this.props.tags||[]}),this.props.onCancel&&this.props.onCancel()}render(){const e=this.props.tinode.getServerParam(o.Tinode.MIN_TAG_LENGTH,d.rn),t=this.props.tinode.getServerParam(o.Tinode.MAX_TAG_LENGTH,d.Ti);let n=[];return this.state.activated?this.state.tags.forEach(a=>{a!=this.state.alias&&n.push({user:a,invalid:a.length<e||a.length>t})}):(this.state.tags.forEach(e=>{e!=this.state.alias&&n.push(s().createElement("span",{className:"badge",key:n.length},e))}),0==n.length&&(n=s().createElement("i",null,s().createElement(i.FormattedMessage,{id:"tags_not_found",defaultMessage:[{type:0,value:"No tags defined. Add some."}]})))),s().createElement("div",{className:"panel-form-column"},s().createElement("div",{className:"panel-form-row"},s().createElement("label",{className:"small"},this.props.title)),this.state.activated?s().createElement("div",null,s().createElement(i.FormattedMessage,{id:"tags_editor_no_tags",defaultMessage:[{type:0,value:"Add some tags"}]},e=>s().createElement(r.A,{tinode:this.props.tinode,chips:n,avatarDisabled:!0,prompt:e,tabIndex:this.props.tabIndex,onEnter:this.handleAddTag,onFocusLost:this.handleAddTag,onCancel:this.handleCancel,onChipRemoved:this.handleRemoveTag,filterFunc:this.handleTagInput})),this.props.onSubmit||this.props.onCancel?s().createElement("div",{id:"tag-manager-buttons",className:"dialog-buttons panel-form-row"},s().createElement("button",{className:"outline",onClick:this.handleCancel},s().createElement(i.FormattedMessage,{id:"button_cancel",defaultMessage:[{type:0,value:"Cancel"}]})),s().createElement("button",{className:"primary",onClick:this.handleSubmit},s().createElement(i.FormattedMessage,{id:"button_ok",defaultMessage:[{type:0,value:"OK"}]}))):null):s().createElement("div",{className:"quoted"},s().createElement("a",{href:"#",className:"flat-button",onClick:e=>{e.preventDefault(),this.setState({activated:!0})}},s().createElement("i",{className:"material-icons"},"edit")," ",s().createElement(i.FormattedMessage,{id:"title_manage_tags",defaultMessage:[{type:0,value:"Manage"}]})),s().createElement(s().Fragment,null,n)))}}},3540:function(e,t,n){n.d(t,{FH:function(){return u},Jf:function(){return h},Jt:function(){return d},KY:function(){return f},LO:function(){return m},MC:function(){return $},OM:function(){return i},YO:function(){return c},af:function(){return o},iE:function(){return g},k6:function(){return r},t7:function(){return v},wk:function(){return p},xH:function(){return l}});var a=n(4532),s=n(9027);function i(e){const t=document.getElementById("shortcut-icon"),n=document.head||document.getElementsByTagName("head")[0],a=document.createElement("link");a.type="image/png",a.id="shortcut-icon",a.rel="shortcut icon",a.href="img/logo32x32"+(e>0?"a":"")+".png",t&&n.removeChild(t),n.appendChild(a),document.title=(e>0?"("+e+") ":"")+"Tinode"}function r(e,t,n,s){let i=null;if((e=e&&e.trim())&&(i={fn:e}),"string"==typeof(s=s&&s.trim())&&(i=i||{},i.note=s||a.Tinode.DEL_CHAR),t){i=i||{};let e=n;const s=/^data:(image\/[-a-z0-9+.]+)?(;base64)?,/i.exec(t);s?(e=s[1],i.photo={data:t.substring(t.indexOf(",")+1),ref:a.Tinode.DEL_CHAR}):i.photo={data:a.Tinode.DEL_CHAR,ref:t},i.photo.type=(e||"image/jpeg").substring(6)}return i}function o(e,t){if(e===t)return!0;if(!Array.isArray(e)||!Array.isArray(t))return!1;if(e.length!=t.length)return!1;e.sort(),t.sort();for(let n=0,a=e.length;n<a;n++)if(e[n]!==t[n])return!1;return!0}function d(e){return e=e.trim(),/^(?:\+?(\d{1,3}))?[- (.]*(\d{3})[- ).]*(\d{3})[- .]*(\d{2})[- .]*(\d{2})?$/.test(e)?e.replaceAll(/[- ().]*/g,""):null}function l(e){return e=e.trim(),/^[a-z0-9_.+-]+@[a-z0-9-]+(\.[a-z0-9-]+)+$/i.test(e)?e:null}function c(e){return e&&!/^\s*([a-z][a-z0-9+.-]*:|\/\/)/im.test(e.replace(/\\/g,"/"))}function h(e,t){if("string"!=typeof e)return e;if(e=(e=e.replace(/[^\x21-\x7E]/gim,"").trim()).replace(/\\/g,"/"),!/^([a-z][a-z0-9+.-]*:|\/\/)/i.test(e))return e;if(/^blob:http/.test(e))return e;const n=Array.isArray(t)?t.join("|"):"http|https";return new RegExp("^(("+n+"):|//)","i").test(e)?e:null}function p(e,t){if(!e)return null;const n=h(e);if(n)return n;return new RegExp(`data:${t}/[-+.a-z0-9]+;base64,`,"i").test(e.trim())?e:null}function u(e){if(e.startsWith("data:")||e.startsWith("blob:"))return e;let t="",n="";const a=e.indexOf("#");a>0&&(n=e.substring(a+1),e=e.substring(0,a));const s=e.indexOf("?");s>0&&(t=e.substring(s+1),e=e.substring(0,s));const i=new URLSearchParams(t);return i.append("asatt","1"),`${e}?${i.toString()}`+(n?`#${n}`:"")}function m(e){switch(e){case a.Tinode.MESSAGE_STATUS_SENDING:return{name:"access_time"};case a.Tinode.MESSAGE_STATUS_FAILED:case a.Tinode.MESSAGE_STATUS_FATAL:return{name:"warning",color:"danger-color"};case a.Tinode.MESSAGE_STATUS_SENT:return{name:"done"};case a.Tinode.MESSAGE_STATUS_RECEIVED:return{name:"done_all"};case a.Tinode.MESSAGE_STATUS_READ:return{name:"done_all",color:"blue"}}return null}function g(e){let t=!1;return{promise:e instanceof Error?Promise.reject(e):new Promise((n,a)=>{e.then(e=>t?a({isCanceled:!0}):n(e),e=>a(t?{isCanceled:!0}:e))}),cancel(){t=!0}}}function f(){const e=n(1781)[s.S.type][s.S.index];return{name:`../${s.S.path}${e.name}`,size:e.size}}function v(e){const t=e.split("/");return t[t.length-1]}function $(e){const t=v(e),a=n(1781);for(const e in a)for(let n=0;n<a[e].length;n++)if(a[e][n].name==t)return e;return null}},3578:function(e,t,n){function a(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return s(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?s(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var a=0;return function(){return a>=e.length?{done:!0}:{done:!1,value:e[a++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,a=Array(t);n<t;n++)a[n]=e[n];return a}n.d(t,{Ay:function(){return o},ZW:function(){return r}});var i={0:"0",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9","0":"0","1":"1","2":"2","3":"3","4":"4","5":"5","6":"6","7":"7","8":"8","9":"9","٠":"0","١":"1","٢":"2","٣":"3","٤":"4","٥":"5","٦":"6","٧":"7","٨":"8","٩":"9","۰":"0","۱":"1","۲":"2","۳":"3","۴":"4","۵":"5","۶":"6","۷":"7","۸":"8","۹":"9"};function r(e){return i[e]}function o(e){for(var t,n="",s=a(e.split(""));!(t=s()).done;){var i=r(t.value);i&&(n+=i)}return n}},3913:function(e,t,n){n.d(t,{A:function(){return i}});var a=n(1594),s=n.n(a);class i extends s().PureComponent{render(){return s().createElement("a",{href:"#",onClick:e=>{e.preventDefault(),this.props.onCancel()}},s().createElement("i",{className:"material-icons"},"close"))}}},4152:function(e,t,n){n.d(t,{A:function(){return m}});var a=n(1594),s=n.n(a),i=n(8181),r=n(4532),o=n(6005);class d extends s().PureComponent{constructor(e){super(e),this.handleClick=this.handleClick.bind(this)}handleClick(e){e.preventDefault(),e.stopPropagation(),this.props.onAction(this.props.action)}render(){const{formatMessage:e}=this.props.intl;return s().createElement("li",{onClick:this.handleClick,className:"action"},s().createElement("div",{className:"action-text"},e(this.props.title,this.props.values)))}}var l=(0,i.injectIntl)(d),c=n(6110),h=n(9027);const p=(0,i.defineMessages)({badge_you:{id:"badge_you",defaultMessage:[{type:0,value:"you"}]},badge_owner:{id:"badge_owner",defaultMessage:[{type:0,value:"owner"}]}});class u extends s().Component{render(){const{formatMessage:e}=this.props.intl,t=Array.isArray(this.props.topicSelected),n=[];let a=0;if(this.props.showSelfTopic){const e=t?this.props.topicSelected.indexOf("slf")>-1:"slf"===this.props.topicSelected;n.push(s().createElement(o.A,{tinode:this.props.tinode,avatar:!0,showMode:this.props.showMode,selected:e,showCheckmark:t,onSelected:this.props.onTopicSelected,showContextMenu:this.props.showContextMenu,index:n.length,item:"slf",key:"slf"})),a++}return this.props.contacts&&this.props.contacts.length>0&&this.props.contacts.forEach(i=>{if(i.action)n.push(s().createElement(l,{title:i.title,action:i.action,values:i.values,key:i.action,onAction:this.props.onAction}));else{const d=this.props.showMode?i.user:i.topic||i.user;if(this.props.filterFunc&&this.props.filter){const e=[d];if(i.private&&i.private.comment&&e.push((""+i.private.comment).toLowerCase()),i.public&&i.public.fn&&e.push((""+i.public.fn).toLowerCase()),!this.props.filterFunc(this.props.filter,e))return}const l=r.Tinode.isChannelTopicName(d),u=!l&&r.Tinode.isGroupTopicName(d),m=t?this.props.topicSelected.indexOf(d)>-1:this.props.topicSelected===d,g=[];this.props.showMode&&(d==this.props.myUserId&&g.push({name:e(p.badge_you),color:"green"}),i.acs&&i.acs.isOwner()&&g.push({name:e(p.badge_owner),color:"blue"}));const f=Array.isArray(i.private)?i.private.join(","):i.private?i.private.comment:null;let v,$,b,y;if(!this.props.showMode&&i.latestMessage){const e=i.latestMessage();e&&($=e.head?e.head.forwarded:null,y=e._status||i.msgStatus(e,!0),b=e.from!=this.props.myUserId,e.content&&(v="string"==typeof e.content?e.content.substr(0,h.sT):r.Drafty.preview(e.content,h.sT)))}n.push(s().createElement(o.A,{tinode:this.props.tinode,title:i.public?i.public.fn:null,avatar:(0,c.to)(i.public?i.public.photo:null),comment:f,preview:v,previewIsResponse:b,forwarded:$,received:y,unread:this.props.showUnread?i.unread:0,now:i.online&&this.props.connected,acs:i.acs,showMode:this.props.showMode,badges:g,showCheckmark:t,selected:m,pinned:i.pinned,showOnline:this.props.showOnline&&!l,isChannel:l,isGroup:u,showContextMenu:this.props.showContextMenu,isVerified:i.trusted&&i.trusted.verified,isStaff:i.trusted&&i.trusted.staff,isDangerous:i.trusted&&i.trusted.danger,deleted:i._deleted,onSelected:this.props.onTopicSelected,item:d,index:n.length,key:d})),a++}},this),s().createElement("div",{className:this.props.noScroll?null:"scrollable-panel"},0==a?s().createElement("div",{className:"center-medium-text",dangerouslySetInnerHTML:{__html:this.props.emptyListMessage}}):null,n.length>0?s().createElement("ul",{className:"contact-box"},n):null)}}var m=(0,i.injectIntl)(u)},4408:function(e,t,n){function a(e,t){return e=e||"",new RegExp("^(?:"+t+")$").test(e)}n.d(t,{A:function(){return a}})},4532:function(e){e.exports=tinode},4573:function(e,t,n){n.d(t,{A:function(){return o}});var a=n(1459),s=n(4408),i=n(1786),r=n(9495);function o(e,t,n){var o=(0,a.A)(e,n),d=o.carrierCode,l=o.nationalNumber;if(l!==e){if(!function(e,t,n){if((0,s.A)(e,n.nationalNumberPattern())&&!(0,s.A)(t,n.nationalNumberPattern()))return!1;return!0}(e,l,n))return{nationalNumber:e};if(n.numberingPlan.possibleLengths()&&(t||(t=(0,r.A)(n.numberingPlan.callingCode(),{nationalNumber:l,metadata:n})),!function(e,t,n){switch((0,i.A)(e,t,n)){case"TOO_SHORT":case"INVALID_LENGTH":return!1;default:return!0}}(l,t,n)))return{nationalNumber:e}}return{nationalNumber:l,carrierCode:d}}},5053:function(e,t,n){var a=n(1594),s=n.n(a),i=n(8181),r=n(8589),o=n(6110);const d="#666C",l=(0,i.defineMessages)({icon_title_play:{id:"icon_title_play",defaultMessage:[{type:0,value:"Play recording"}]}});class c extends s().PureComponent{constructor(e){super(e);let t=(0,o.F8)(this.props.preview);(!Array.isArray(t)||t.length<16)&&(t=null),this.state={canPlay:!1,playing:!1,currentTime:"0:00",duration:this.props.duration>0?(0,r.Ye)(this.props.duration/1e3):"-:--",longMin:this.props.duration>=6e5,preview:t},this.initAudio=this.initAudio.bind(this),this.initCanvas=this.initCanvas.bind(this),this.resampleBars=this.resampleBars.bind(this),this.visualize=this.visualize.bind(this),this.handlePlay=this.handlePlay.bind(this),this.handleSeek=this.handleSeek.bind(this),this.handleError=this.handleError.bind(this),this.audioPlayer=null,this.viewBuffer=[],this.canvasRef=s().createRef()}componentDidMount(){this.props.src&&this.initAudio(),this.initCanvas()}componentWillUnmount(){this.audioPlayer&&(this.audioPlayer.onloadedmetadata=null,this.audioPlayer.ontimeupdate=null,this.audioPlayer.onended=null,this.audioPlayer.pause(),this.audioPlayer=null)}componentDidUpdate(e){if(this.props.src!=e.src&&this.initAudio(),this.props.preview!=e.preview){let e=(0,o.F8)(this.props.preview);(!Array.isArray(e)||e.length<16)&&(e=null),this.setState({preview:e},this.initCanvas)}}initAudio(){this.audioPlayer=new Audio(this.props.src),this.audioPlayer.onloadedmetadata=e=>this.setState({canPlay:!0}),this.audioPlayer.ontimeupdate=e=>this.setState({currentTime:(0,r.Ye)(this.audioPlayer.currentTime,this.state.longMin)}),this.audioPlayer.onended=e=>{this.audioPlayer.currentTime=0,this.setState({playing:!1,currentTime:(0,r.Ye)(0,this.state.longMin)})}}initCanvas(){this.canvasRef.current.width=2*this.canvasRef.current.offsetWidth,this.canvasRef.current.height=2*this.canvasRef.current.offsetHeight,this.canvasContext=this.canvasRef.current.getContext("2d"),this.canvasContext.lineCap="round",this.viewBuffer=this.resampleBars(this.state.preview),this.visualize()}visualize(){if(!this.canvasRef.current)return;const e=this.effectiveWidth,t=this.canvasRef.current.height;this.canvasContext.lineWidth=6;const n=a=>{if(this.canvasRef.current&&this.audioPlayer&&(this.canvasContext.clearRect(0,0,this.canvasRef.current.width,t),this.viewBuffer)){this.state.playing&&window.requestAnimationFrame(n);const a=this.props.duration?Math.max(0,Math.min(1e3*this.audioPlayer.currentTime/this.props.duration,1))*(e-12):-1;this.canvasContext.beginPath(),this.canvasContext.strokeStyle=d;for(let e=0;e<this.viewBuffer.length;e++){let n=1+10*e+3,s=Math.max(this.viewBuffer[e]*t*.9,1);const i=n<a?d:"#888A";this.canvasContext.strokeStyle!=i&&(this.canvasContext.stroke(),this.canvasContext.beginPath(),this.canvasContext.strokeStyle=i),this.canvasContext.moveTo(n,.5*(t-s)),this.canvasContext.lineTo(n,.5*(t+s))}this.canvasContext.stroke(),this.props.duration&&(this.canvasContext.beginPath(),this.canvasContext.arc(a+12,.5*t,12,0,2*Math.PI),this.canvasContext.fillStyle="#1781d7",this.canvasContext.fill())}};n()}resampleBars(e){const t=(this.canvasRef.current.width-4)/10|0;if(this.effectiveWidth=10*t+4,!Array.isArray(e)||0==e.length)return Array.apply(null,Array(t)).map(e=>.01);const n=e.length/t;let a=[],s=-1;for(let i=0;i<t;i++){let t=i*n|0,r=(i+1)*n|0;if(r==t)a[i]=e[t];else{let n=0;for(let a=t;a<r;a++)n+=e[a];a[i]=Math.max(0,n/(r-t))}s=Math.max(a[i],s)}return s>0?a.map(e=>e/s):Array.apply(null,Array(t)).map(e=>.01)}handlePlay(e){e.preventDefault(),this.state.canPlay&&(this.state.playing?(this.audioPlayer.pause(),this.setState({playing:!1})):this.audioPlayer.readyState>=2&&(this.audioPlayer.play(),this.setState({playing:!0},this.visualize)))}handleError(e){console.error(e)}handleSeek(e){if(e.preventDefault(),e.target&&this.props.duration){const t=e.target.getBoundingClientRect(),n=(e.clientX-t.left)/this.effectiveWidth*2;this.audioPlayer.currentTime=this.props.duration*n/1e3,this.setState({currentTime:(0,r.Ye)(this.audioPlayer.currentTime,this.state.longMin)}),this.state.playing||this.visualize()}}render(){const e="material-icons"+(this.props.short?"":" large")+(this.state.canPlay?"":" disabled"),t=s().createElement("a",{href:"#",onClick:this.handlePlay,title:this.props.intl.formatMessage(l.icon_title_play)},s().createElement("i",{className:e},this.state.playing?"pause_circle":this.state.canPlay?"play_circle":"not_interested"));return s().createElement("div",{className:"audio-player"},this.props.short?s().createElement(s().Fragment,null,s().createElement("canvas",{className:"playback",ref:this.canvasRef,onClick:this.handleSeek}),t):s().createElement(s().Fragment,null,t,s().createElement("div",null,s().createElement("canvas",{className:"playback",ref:this.canvasRef,onClick:this.handleSeek}),s().createElement("div",{className:"timer"},this.state.currentTime,"/",this.state.duration))))}}t.A=(0,i.injectIntl)(c)},5206:function(e){e.exports=ReactDOM},5338:function(e,t,n){var a=n(5206);t.H=a.createRoot,a.hydrateRoot},5693:function(e,t,n){n.d(t,{A:function(){return s}});var a=n(1211);function s(e,t){var n=Array.prototype.slice.call(t);return n.push(a.A),e.apply(this,n)}},5791:function(e,t,n){n.d(t,{e3:function(){return w},TU:function(){return _},NV:function(){return P}});var a=n(1594),s=n.n(a),i=n(8181),r=n(4532),o=n(5053),d=n(8589);class l extends s().PureComponent{render(){const e=["busy","declined","disconnected","missed"].includes(this.props.callState),t="material-icons medium "+(e?"red":"green"),n=this.props.incoming?e?"call_missed":"call_received":e?"call_missed_outgoing":"call_made",a=this.props.incoming?s().createElement(i.FormattedMessage,{id:"calls_incoming",defaultMessage:[{type:0,value:"Incoming call"}]}):s().createElement(i.FormattedMessage,{id:"calls_outgoing",defaultMessage:[{type:0,value:"Outgoing call"}]});let r;if(e)switch(this.props.callState){case"busy":r=s().createElement(i.FormattedMessage,{id:"call_busy",defaultMessage:[{type:0,value:"busy"}]});break;case"declined":r=s().createElement(i.FormattedMessage,{id:"call_declined",defaultMessage:[{type:0,value:"declined"}]});break;case"missed":r=this.props.incoming?s().createElement(i.FormattedMessage,{id:"call_missed",defaultMessage:[{type:0,value:"missed"}]}):s().createElement(i.FormattedMessage,{id:"call_cancelled",defaultMessage:[{type:0,value:"cancelled"}]});break;default:r=s().createElement(i.FormattedMessage,{id:"call_disconnected",defaultMessage:[{type:0,value:"disconnected"}]})}else r=s().createElement("span",null,(0,d.Ye)(this.props.duration/1e3));return s().createElement("div",{className:"call-message"},s().createElement("div",null,s().createElement("i",{className:"material-icons big gray"},"call")),s().createElement("div",{className:"flex-column narrow"},s().createElement("div",null,a),s().createElement("div",{className:"duration"},s().createElement("i",{className:t},n)," ",r)))}}class c extends s().PureComponent{render(){const e=["busy","declined","disconnected","missed"].includes(this.props.callState),t=this.props.incoming?e?"call_missed":"call_received":e?"call_missed_outgoing":"call_made";let n;if(e)switch(this.props.callState){case"busy":n=s().createElement(i.FormattedMessage,{id:"call_busy",defaultMessage:[{type:0,value:"busy"}]});break;case"declined":n=s().createElement(i.FormattedMessage,{id:"call_declined",defaultMessage:[{type:0,value:"declined"}]});break;case"missed":n=this.props.incoming?s().createElement(i.FormattedMessage,{id:"call_missed",defaultMessage:[{type:0,value:"missed"}]}):s().createElement(i.FormattedMessage,{id:"call_cancelled",defaultMessage:[{type:0,value:"cancelled"}]});break;default:n=s().createElement(i.FormattedMessage,{id:"call_disconnected",defaultMessage:[{type:0,value:"disconnected"}]})}else n=["accepted","started"].includes(this.props.callState)&&!this.props.duration?s().createElement(i.FormattedMessage,{id:"call_in_progress",defaultMessage:[{type:0,value:"in progress"}]}):s().createElement("span",null,(0,d.Ye)(this.props.duration/1e3));return s().createElement(s().Fragment,null,s().createElement("div",{className:"composed-material"},s().createElement("i",{className:"material-icons"},"call"),s().createElement("i",{className:"material-icons second"},t))," ",n)}}class h extends s().PureComponent{constructor(e){super(e),this.videoRef=s().createRef(),this.handleClick=this.handleClick.bind(this)}handleClick(e){this.props.onClick&&this.props.onClick(e)}render(){const e=(0,d.Ye)(this.props["data-duration"]/1e3),t="inline-video"+(this.props.onClick?" image-clickable":"");return s().createElement("div",{className:t},s().createElement("img",this.props),s().createElement("div",{className:"play-control"},this.props.onClick?s().createElement("i",{className:"material-icons white x-big"},"play_arrow"):s().createElement("img",{src:"img/broken_video.png",style:{filter:"invert(100%)"},width:"36",height:"36"})),e?s().createElement("div",{className:"duration"},e):null)}}class p extends s().PureComponent{constructor(e){super(e),this.state={src:this.props.isvideo?"img/blankvid.png":"img/blankimg.png",style:Object.assign({padding:"4px"},this.props.style),className:this.props.className,alt:this.props.alt,onClick:this.props.onClick}}componentDidMount(){this.props.whenDone.promise.then(e=>this.setState({src:e.src,style:{...this.state.style,padding:0}})).catch(e=>this.setState({src:this.props.isvideo?"img/broken_video.png":"img/broken_image.png"}))}componentWillUnmount(){this.props.whenDone.cancel()}componentDidUpdate(e){e.whenDone!=this.props.whenDone&&(this.setState({src:this.props.isvideo?"img/blankvid.png":"img/blankimg.png",style:{...this.state.style,padding:"4px"}}),this.props.whenDone.promise.then(e=>this.setState({src:e.src,style:{...this.state.style,padding:0}})).catch(e=>this.setState({src:this.props.isvideo?"img/broken_video.png":"img/broken_image.png"})))}render(){return s().createElement("img",this.state)}}var u=n(6904);const m=(0,i.defineMessages)({unknown_name:{id:"unknown_name",defaultMessage:[{type:0,value:"Unknown"}]}});class g extends s().PureComponent{constructor(e){super(e),this.handleDownload=this.handleDownload.bind(this),this.handleMessage=this.handleMessage.bind(this)}handleDownload(e){e.preventDefault();try{const e=r.TheCard.exportVCard(this.props.content),t=new Blob([e],{type:"text/vcard"}),n=URL.createObjectURL(t),a=document.createElement("a");a.style.display="none",a.href=n,a.download=(this.props.content.fn||"contact")+".vcf",document.body.appendChild(a),a.click(),window.URL.revokeObjectURL(n),document.body.removeChild(a)}catch(e){console.error("Failed to download vcard",e),this.props.onError&&this.props.onError("Failed to download vcard","err")}}handleMessage(e){}render(){const e=this.props.content;if(!e)return null;const t=r.TheCard.getFirstTinodeID(e),n=r.TheCard.getEmails(e).concat(r.TheCard.getPhones(e)),a=r.TheCard.getOrg(e);return s().createElement("div",{className:"contact-card"},s().createElement("div",{className:"contact-body"},s().createElement("div",{className:"avatar-box"},s().createElement(u.A,{authorizeURL:this.props.authorizeURL,topic:t||"usr123XXX",avatar:r.TheCard.getPhotoUrl(e)||!0,title:e.fn})),s().createElement("div",{className:"name-box"},s().createElement("div",{className:"name"},e.fn||s().createElement(i.FormattedMessage,m.unknown_name)),a&&s().createElement("div",{className:"org"},a))),s().createElement("div",{className:"contact-actions"},t&&s().createElement("a",{className:"flat-button","data-val":t,onClick:this.props.onChatClick},s().createElement(i.FormattedMessage,{id:"chat_now",defaultMessage:[{type:0,value:"Chat"}]})),t&&s().createElement("div",{className:"divider"}),n.length>0&&s().createElement("a",{className:"flat-button","data-val":n.join(","),onClick:this.props.onChatClick},s().createElement(i.FormattedMessage,{id:"find_user",defaultMessage:[{type:0,value:"Find"}]})),n.length>0&&s().createElement("div",{className:"divider"}),s().createElement("a",{className:"flat-button",onClick:this.handleDownload},s().createElement(i.FormattedMessage,{id:"save_action",defaultMessage:[{type:0,value:"Save"}]}))))}}var f=(0,i.injectIntl)(g),v=n(9895);class $ extends s().PureComponent{constructor(e){super(e)}render(){return s().createElement("div",{className:"inline-image"},s().createElement("img",this.props),s().createElement("div",{className:"rounded-container"},s().createElement(v.A,{progress:this.props.progress,onCancel:this.props.onCancelUpload})))}}var b=n(9027),y=n(6110),E=n(3540);const C=(0,i.defineMessages)({drafty_form:{id:"drafty_form",defaultMessage:[{type:0,value:"Form:"}]},drafty_attachment:{id:"drafty_attachment",defaultMessage:[{type:0,value:"Attachment"}]},drafty_image:{id:"drafty_image",defaultMessage:[{type:0,value:"Picture"}]},drafty_video:{id:"drafty_video",defaultMessage:[{type:0,value:"Video recording"}]},drafty_unknown:{id:"drafty_unknown",defaultMessage:[{type:0,value:"Unsupported"}]}});function w(e,t,n,a,i){if(i.includes("QQ"))return k.call(this,e,t,n,a);if(!e)return n;let c=r.Drafty.tagName(e),h=r.Drafty.attrValue(e,t)||{};switch(h.key=a,e){case"AU":h.src&&(h.src=this.authorizeURL((0,E.wk)(h.src,"audio")),h.duration=t.duration>0?0|t.duration:void 0,h.preview=t.preview,h.loading="lazy"),c=o.A,n=null;break;case"BR":n=null;break;case"EX":case"RW":break;case"HL":h.className="highlight";break;case"HD":c=null,n=null;break;case"IM":c=S.call(this,c,t,h),n=null;break;case"BN":h.onClick=e=>this.onHandleClick(e,"form_button");let e=s().Children.map(n,e=>"string"==typeof e?e:void 0);e&&0!=e.length||(e=[h.name]),h["data-title"]=e.join("");break;case"LN":h&&(h.href="string"==typeof h.href?(0,E.Jf)(h.href,b.kA):"");break;case"MN":h.className="mention",t&&(h.className+=" "+(0,d.kJ)(t.val,!1,!0));break;case"FM":h.className="bot-form";break;case"QQ":h.className="reply-quote",h.onClick=e=>this.onHandleClick(e,"quote");break;case"TC":c=f,h.content=t,h.authorizeURL=this.authorizeURL,h.onChatClick=e=>this.onHandleClick(e,"contact_chat"),h.onFindClick=e=>this.onHandleClick(e,"contact_find"),n=null;break;case"VC":c=l,n=null,t&&(h.callState=t.state,h.incoming=t.incoming,h.duration=t.duration);break;case"VD":c=M.call(this,c,t,h),n=null;break;default:if(!c){c=s().Fragment,h={key:a};let e=n;Array.isArray(n)&&n.join("").trim()||(e=[s().createElement("span",{key:"x1",className:"gray"},this.formatMessage(C.drafty_unknown))]),n=[s().createElement("i",{key:"x0",className:"material-icons gray"},"extension")," "].concat(e)}}return c?s().createElement(c,h,n):n}function S(e,t,n){if(!t)return n.src="img/broken_image.png",n.style={width:b._g+"px",height:b._g+"px"},e;n.className="inline-image";const a=(0,y.ae)(t.width,t.height,this.viewportWidth>0?Math.min(this.viewportWidth-6.5*b.JS,34.5*b.JS):34.5*b.JS,24*b.JS,!1)||{dstWidth:b._j,dstHeight:b._j};return n.style={width:a.dstWidth+"px",height:a.dstHeight+"px",minWidth:a.dstWidth+"px",minHeight:a.dstHeight+"px"},r.Drafty.isProcessing(t)?e=$:(n.src=this.authorizeURL((0,E.wk)(n.src,"image")),n.alt=t.name,n.src?(Math.max(t.width||0,t.height||0)>b._g&&(n.onClick=e=>this.onHandleClick(e,"image"),n.className+=" image-clickable"),n.loading="lazy"):n.src=null),e}function M(e,t,n){if(!t)return n.src="img/broken_video.png",n.style={width:b._g+"px",height:b._g+"px"},e;n.className="inline-image";const a=(0,y.ae)(t.width,t.height,this.viewportWidth>0?Math.min(this.viewportWidth-6.5*b.JS,34.5*b.JS):34.5*b.JS,24*b.JS,!1)||{dstWidth:b.qV,dstHeight:b.qV};return n.style={width:a.dstWidth+"px",height:a.dstHeight+"px",minWidth:a.dstWidth+"px",minHeight:a.dstHeight+"px"},r.Drafty.isProcessing(t)?e=$:(n.src=this.authorizeURL((0,E.wk)(n.src,"image")),n.alt=t.name,(t.ref||t.val)&&(n.onClick=e=>this.onHandleClick(e,"video"),n.loading="lazy"),e=h),e}function _(e,t,n,a){if(!e)return n;let i=r.Drafty.tagName(e);const o={key:a};switch(e){case"AU":i=s().Fragment,n=[s().createElement("i",{key:"au",className:"material-icons"},"mic")," ",(0,d.Ye)(t.duration/1e3)];break;case"BR":i=s().Fragment,n=[" "];break;case"HL":o.className="highlight preview";break;case"LN":case"MN":i="span";break;case"IM":i=s().Fragment,n=[s().createElement("i",{key:"im",className:"material-icons"},"photo")," ",this.formatMessage(C.drafty_image)];break;case"BN":i="span",o.className="flat-button faux";break;case"FM":i=s().Fragment,n=[s().createElement("i",{key:"fm",className:"material-icons"},"dashboard"),this.formatMessage(C.drafty_form)].concat(" ",n||[]);break;case"RW":i=s().Fragment;break;case"EX":if(t){if(r.Drafty.isFormResponseType(t.mime))return null;delete t.val,delete t.ref}i=s().Fragment,n=[s().createElement("i",{key:"ex",className:"material-icons"},"attachment")," ",this.formatMessage(C.drafty_attachment)];break;case"VC":i=c,t&&(o.callState=t.state,o.incoming=t.incoming,o.duration=t.duration),n=null;break;case"QQ":case"HD":i=null,n=null;break;case"TC":i=s().Fragment,n=[s().createElement("i",{key:"tc",className:"material-icons"},"contact_mail")," ",r.TheCard.getFn(t)||this.formatMessage(C.drafty_unknown)];break;case"VD":i=s().Fragment,n=[s().createElement("i",{key:"im",className:"material-icons"},"play_circle_outline")," ",this.formatMessage(C.drafty_video)];break;default:i||(i=s().Fragment,n=[s().createElement("i",{key:"x0",className:"material-icons gray"},"extension")," ",this.formatMessage(C.drafty_unknown)])}return i?s().createElement(i,o,n):n}function T(e,t){return e.style={width:b._g+"px",height:b._g+"px",maxWidth:b._g+"px",maxHeight:b._g+"px"},e.className="inline-image",e.alt=this.formatMessage(C.drafty_image),e.src=t&&e.src||"img/broken_image.png",e.title=e.alt,e}function A(e,t){const n=(0,y.ae)(t.width,t.height,b.iq,b._g);return e.style={width:n.width+"px",height:n.height+"px",maxWidth:b.iq+"px",maxHeight:b._g+"px"},e.className="inline-image",e.alt=this.formatMessage(C.drafty_video),e.title=e.alt,e.src=t&&e.src||"img/broken_video.png",e}function k(e,t,n,a){if(["BR","EX","IM","MN","VD"].includes(e)){let i=r.Drafty.tagName(e),o=r.Drafty.attrValue(e,t)||{};switch(o.key=a,e){case"BR":n=null;break;case"IM":o=T.call(this,o,t),n=[s().createElement("img",o,null)," ",o.alt],i=s().Fragment,o={key:a};break;case"VD":o=A.call(this,o,t),n=[s().createElement("img",o,null)," ",o.alt],i=s().Fragment,o={key:a};break;case"MN":i="span",o.className="mention",t&&(o.className+=" "+(0,d.kJ)(t.val,!1,!0));break;case"EX":let e;if(t){if(r.Drafty.isFormResponseType(t.mime))return null;e=t.name,delete t.val,delete t.ref}i=s().Fragment,n=[s().createElement("i",{key:"ex",className:"material-icons"},"attachment"),(0,d.Tu)(e,16)||this.formatMessage(C.drafty_attachment)]}return s().createElement(i,o,n)}return _.call(this,e,t,n,a)}function N(e,t){let n,a,s,i;if(t?(a=e.preview,i=e.premime||"image/jpeg",s=e.preref):(a=e.val,i=e.mime,s=e.ref),a){const e=(0,y.i)(a,i);if(!e)throw new Error("Invalid image");n=Promise.resolve(e)}else{if(!s)throw new Error("Missing image data");n=fetch(this.authorizeURL((0,E.wk)(s,"image"))).then(e=>{if(e.ok)return e.blob();throw new Error(`Image fetch unsuccessful: ${e.status} ${e.statusText}`)})}return n.then(e=>(0,y.ag)(e,t?b.iq:b._g,b._g,-1,!t)).then(n=>(t?e.premime=n.mime:e.mime=n.mime,e.size=n.blob.size,e.width=n.width,e.height=n.height,delete e.ref,delete e.preref,e.src=URL.createObjectURL(n.blob),(0,y.Sk)(n.blob))).then(n=>(t?e.preview=n.bits:e.val=n.bits,e)).catch(t=>{throw delete e.val,delete e.preview,delete e.src,e.width=b._g,e.height=b._g,t})}function P(e,t,n,a,i){if("IM"==e||"VD"==e){const i="IM"==e?T.call(this,{key:a},t):A.call(this,{key:a},t);let r;try{r=(0,E.iE)(N.call(this,t,"VD"==e))}catch(e){console.warn("Failed to quote image:",e.message),r=(0,E.iE)(e)}return i.whenDone=r,n=[s().createElement(p,i,null)," ",i.alt],s().createElement(s().Fragment,{key:a},n)}if("QQ"==e){if(i.includes("QQ"))return s().createElement("span",{key:a},[s().createElement("i",{key:"qq",className:"material-icons"},"format_quote")," "]);const e=r.Drafty.attrValue("QQ",t)||{};return e.key=a,e.className="reply-quote",s().createElement(r.Drafty.tagName("QQ"),e,n)}return k.call(this,e,t,n,a)}},5874:function(e,t,n){n.d(t,{A:function(){return d}});var a=n(1594),s=n.n(a),i=n(6904);class r extends s().PureComponent{constructor(e){super(e),this.handleCancel=this.handleCancel.bind(this)}handleCancel(e){e.preventDefault(),this.props.onCancel(this.props.topic,this.props.index)}render(){const e=this.props.title||this.props.topic,t=this.props.invalid?"chip invalid":"chip";return s().createElement("div",{className:t},this.props.noAvatar?s().createElement("span",{className:"spacer"}):s().createElement("div",{className:"avatar-box"},s().createElement(i.A,{authorizeURL:this.props.tinode.authorizeURL,avatar:this.props.avatar||!0,topic:this.props.topic,title:this.props.title})),s().createElement("span",null,e),this.props.onCancel&&!this.props.required?s().createElement("a",{href:"#",onClick:this.handleCancel},"×"):s().createElement("span",{className:"spacer"}))}}var o=n(6110);class d extends s().Component{constructor(e){super(e),this.state=d.deriveStateFromProps(e),this.state.input="",this.state.focused=!1,this.handleTextInput=this.handleTextInput.bind(this),this.removeChipAt=this.removeChipAt.bind(this),this.handleChipCancel=this.handleChipCancel.bind(this),this.handleFocusGained=this.handleFocusGained.bind(this),this.handleFocusLost=this.handleFocusLost.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this)}static deriveStateFromProps(e){return{placeholder:e.chips?"":e.prompt,sortedChips:d.sortChips(e.chips,e.staticMembers),chipIndex:d.indexChips(e.chips)}}componentDidUpdate(e,t){e.chips==this.props.chips&&e.staticMembers==this.props.staticMembers&&e.prompt==this.props.prompt||this.setState(d.deriveStateFromProps(this.props)),(!t||this.props.chips.length>t.sortedChips.length)&&this.setState({input:""})}static indexChips(e){const t={};let n=0;return e.forEach(e=>{t[e.user]=n,n++}),t}static sortChips(e,t){const n=[],a=[];return e.forEach(e=>{t&&t.includes(e.user)?n.push(e):a.push(e)}),n.concat(a)}handleTextInput(e){this.setState({input:e.target.value}),this.props.filterFunc&&this.props.filterFunc(e.target.value)}removeChipAt(e){const t=this.state.sortedChips[e];this.props.onChipRemoved(t.user,this.state.chipIndex[t.user])}handleChipCancel(e,t){this.removeChipAt(t)}handleFocusGained(){this.setState({focused:!0})}handleFocusLost(){this.setState({focused:!1}),this.props.onFocusLost&&this.props.onFocusLost(this.state.input)}handleKeyDown(e){if("Backspace"===e.key){if(0==this.state.input.length&&this.state.sortedChips.length>0){const e=this.state.sortedChips.length-1;this.state.sortedChips[e].user!==this.props.staticMembers&&this.removeChipAt(e)}}else"Enter"===e.key?this.props.onEnter&&this.props.onEnter(this.state.input):"Escape"===e.key&&this.props.onCancel&&this.props.onCancel()}render(){const e=[];let t=0;const n=this.props.staticMembers||[];this.state.sortedChips.forEach(a=>{e.push(s().createElement(r,{tinode:this.props.tinode,onCancel:this.handleChipCancel,avatar:(0,o.to)(a.public?a.public.photo:null),title:a.public?a.public.fn:void 0,noAvatar:this.props.avatarDisabled,topic:a.user,required:n.includes(a.user),invalid:a.invalid,index:t,key:a.user})),t++});const a="chip-input"+(this.state.focused?" focused":""),i=!(this.props.tabIndex>0);return s().createElement("div",{className:a},e,s().createElement("input",{type:"text",placeholder:this.state.placeholder,onChange:this.handleTextInput,onFocus:this.handleFocusGained,onBlur:this.handleFocusLost,onKeyDown:this.handleKeyDown,value:this.state.input,tabIndex:this.props.tabIndex,autoFocus:i}))}}},6005:function(e,t,n){n.d(t,{A:function(){return g}});var a=n(1594),s=n.n(a),i=n(8181),r=n(4532),o=n(504),d=n(6904);class l extends s().PureComponent{render(){return this.props.count>0?s().createElement("span",{className:"unread"},this.props.count>9?"9+":this.props.count):null}}var c=n(5791),h=n(3540),p=n(8589);const u=(0,i.defineMessages)({self_topic_name:{id:"self_topic_name",defaultMessage:[{type:0,value:"Saved messages"}]},self_topic_comment:{id:"self_topic_comment",defaultMessage:[{type:0,value:"Notes, messages, links, files saved for posterity"}]}});class m extends s().Component{constructor(e){super(e),this.handleClick=this.handleClick.bind(this),this.handleContextClick=this.handleContextClick.bind(this)}handleClick(e){e.preventDefault(),e.stopPropagation(),this.props.onSelected&&this.props.onSelected(this.props.item,this.props.index)}handleContextClick(e){e.preventDefault(),e.stopPropagation(),this.props.showContextMenu({topicName:this.props.item,topicTitle:this.props.title,y:e.pageY,x:e.pageX})}render(){let e=this.props.title;const t=r.Tinode.isSelfTopicName(this.props.item);e?e.length>30&&(e=(0,p.W5)(e,30)):e=t?this.props.intl.formatMessage(u.self_topic_name):s().createElement("i",null,s().createElement(i.FormattedMessage,{id:"unnamed_topic",defaultMessage:[{type:0,value:"Unnamed"}]}));const n=this.props.now?"online":"offline",a=!this.props.avatar||this.props.avatar,m=this.props.badges?this.props.badges.slice():[],g=[];let f;this.props.isVerified&&g.push({icon:"verified",color:"verified-color"}),this.props.isStaff&&g.push({icon:"staff",color:"staff-color"}),this.props.isDangerous&&g.push({icon:"dangerous",color:"danger-color"}),this.props.acs&&(this.props.showMode&&m.push({name:this.props.acs.getMode(),key:"mode"}),this.props.acs.isMuted()&&g.push({icon:"muted"}),this.props.acs.isJoiner()||g.push({icon:"banned"})),"string"==typeof this.props.preview?f=this.props.preview:r.Drafty.isValid(this.props.preview)?f=s().createElement(s().Fragment,null,r.Drafty.format(this.props.preview,c.TU,{formatMessage:this.props.intl.formatMessage,previewIsResponse:this.props.previewIsResponse})):this.props.preview&&(f=s().createElement(s().Fragment,null,s().createElement("i",{className:"material-icons gray"},"warning_amber")," ",s().createElement("i",{className:"gray"},s().createElement(i.FormattedMessage,{id:"invalid_content",defaultMessage:[{type:0,value:"invalid content"}]}))));const v=(0,h.LO)(this.props.received),$=v?s().createElement("i",{className:"material-icons small space-right"+(v.color?" "+v.color:"")},v.name):null,b="contact-title"+(this.props.deleted?" deleted":""),y=f||this.props.comment||(t?this.props.intl.formatMessage(u.self_topic_comment):" "),E=this.props.showCheckmark?null:this.props.selected?"selected":this.props.pinned?"tpinned":null;return s().createElement("li",{className:E,onClick:this.handleClick},s().createElement("div",{className:"avatar-box"},s().createElement(d.A,{authorizeURL:this.props.tinode.authorizeURL,avatar:a,title:this.props.title,topic:this.props.item,deleted:this.props.deleted}),this.props.deleted?s().createElement("i",{className:"deleted material-icons"},"cancel"):!t&&this.props.showOnline?s().createElement("span",{className:n}):this.props.showCheckmark&&this.props.selected?s().createElement("i",{className:"checkmark material-icons"},"check_circle"):null),s().createElement("div",{className:"text-box"},s().createElement("div",null,s().createElement("span",{className:b},e),this.props.isGroup?s().createElement("i",{className:"material-icons as-badge"},"group"):null,this.props.isChannel?s().createElement("i",{className:"material-icons as-badge"},"podcasts"):null,t?null:s().createElement(o.A,{badges:g}),this.props.deleted?null:s().createElement(l,{count:this.props.unread})),this.props.showMode?s().createElement("span",null,s().createElement(o.A,{badges:m})):this.props.small?null:s().createElement("div",{className:"contact-comment"},$,s().createElement("span",null,y))),this.props.showContextMenu?s().createElement("span",{className:"menuTrigger"},s().createElement("a",{href:"#",onClick:this.handleContextClick},s().createElement("i",{className:"material-icons"},"expand_more"))):null)}}var g=(0,i.injectIntl)(m)},6110:function(e,t,n){n.d(t,{$Z:function(){return m},CO:function(){return c},F8:function(){return v},Pv:function(){return f},QJ:function(){return $},Sk:function(){return p},ae:function(){return o},ag:function(){return l},bB:function(){return h},i:function(){return g},iJ:function(){return u},to:function(){return r}});var a=n(4532);const s=["image/jpeg","image/gif","image/png","image/svg","image/svg+xml"],i=["jpg","gif","png","svg","svg"];function r(e){if(e&&"object"==typeof e){if(e.ref)return e.ref;if(e.data&&e.type){return"data:"+(e.type.startsWith("image/")?e.type:"image/"+e.type)+";base64,"+e.data}}return null}function o(e,t,n,a,s){if(t|=0,n|=0,a|=0,(e|=0)<=0||t<=0||n<=0||a<=0)return null;s&&(n=a=Math.min(n,a));const i=Math.min(Math.min(e,n)/e,Math.min(t,a)/t),r={dstWidth:e*i|0,dstHeight:t*i|0};return s?(r.dstWidth=r.dstHeight=Math.min(r.dstWidth,r.dstHeight),r.srcWidth=r.srcHeight=Math.min(e,t),r.xoffset=(e-r.srcWidth)/2|0,r.yoffset=(t-r.srcWidth)/2|0):(r.xoffset=r.yoffset=0,r.srcWidth=e,r.srcHeight=t),r}function d(e,t){const n=s.indexOf(t);if(n<0||!e)return e;const a=i[n],r=e.lastIndexOf(".");return r>=0&&(e=e.substring(0,r)),e+"."+a}function l(e,t,n,a,i){return new Promise((r,l)=>{const c=new Image;c.crossOrigin="Anonymous",c.onerror=function(e){l(new Error("Image format unrecognized"))},c.onload=async function(){URL.revokeObjectURL(c.src);const h=o(c.width,c.height,t,n,i);if(!h)return void l(new Error("Invalid image"));let p=document.createElement("canvas");p.width=h.dstWidth,p.height=h.dstHeight;let u=p.getContext("2d");u.imageSmoothingEnabled=!0,u.drawImage(c,h.xoffset,h.yoffset,h.srcWidth,h.srcHeight,0,0,h.dstWidth,h.dstHeight);const m=s.includes(e.type)?e.type:"image/jpeg";let g=await new Promise(e=>p.toBlob(e,m));if(g){for(;a>0&&g.length>a;)h.dstWidth=.70710678118*h.dstWidth|0,h.dstHeight=.70710678118*h.dstHeight|0,p.width=h.dstWidth,p.height=h.dstHeight,u=p.getContext("2d"),u.clearRect(0,0,p.width,p.height),u.drawImage(c,h.xoffset,h.yoffset,h.srcWidth,h.srcHeight,0,0,h.dstWidth,h.dstHeight),g=await new Promise(e=>p.toBlob(e,m));p=null,r({mime:m,blob:g,width:h.dstWidth,height:h.dstHeight,name:d(e.name,m)})}else l(new Error("Unsupported image format"))},c.src=URL.createObjectURL(e)})}function c(e,t,n,a,i,r,o){return new Promise((d,l)=>{const c=new Image;c.crossOrigin="Anonymous",c.onerror=e=>{l(new Error("Image format unrecognized"))},c.onload=t=>{URL.revokeObjectURL(c.src);let h=document.createElement("canvas");h.width=i*o,h.height=r*o;let p=h.getContext("2d");p.imageSmoothingEnabled=!0,p.drawImage(c,n,a,i,r,0,0,h.width,h.height),e=s.includes(e)?e:"image/jpeg",h.toBlob(t=>{h=null,t?d({mime:e,blob:t,width:i,height:r}):l(new Error("Unsupported image format"))},e)},c.src=t})}function h(e){return new Promise((t,n)=>{const a=new FileReader;a.onerror=e=>{n(a.error)},a.onload=n=>{t({mime:e.type,bits:a.result.split(",")[1],name:e.name})},a.readAsDataURL(e)})}function p(e){return new Promise((t,n)=>{const a=new FileReader;a.onerror=e=>{n(a.error)},a.onload=n=>{t({mime:e.type,bits:a.result.split(",")[1]})},a.readAsDataURL(e)})}function u(e,t,n,a){const s=(e.clipboardData||e.originalEvent.clipboardData||{}).items;if(!s||!s.length)return!1;for(let e in s){const i=s[e];if("file"===i.kind){const e=i.getAsFile();if(!e){console.error("Failed to get file object from pasted file item",i.kind,i.type),a("Failed to get file object from pasted file item");continue}return e.type&&"image"==e.type.split("/")[0]?t(e):n(e),!0}}return!1}function m(e){if(e){e=e.replace(/-/g,"+").replace(/_/g,"/");try{e=btoa(atob(e))}catch(t){console.error("Failed to base64 re-encode string.",t),e=null}}return e}function g(e,t){if(!e)return null;try{const n=atob(e),a=n.length,s=new ArrayBuffer(a),i=new Uint8Array(s);for(let e=0;e<a;e++)i[e]=n.charCodeAt(e);return new Blob([s],{type:t})}catch(e){console.error("Failed to convert base64 to blob: ",e)}return null}function f(e){if(!Array.isArray(e))return null;try{let t="";return new Uint8Array(e).forEach(e=>t+=String.fromCharCode(e)),window.btoa(t)}catch(e){}return null}function v(e){const t=[];try{return[...window.atob(e)].forEach(e=>{t.push(e.charCodeAt(0))}),t}catch(e){}return null}function $(e){return new Promise((t,n)=>{const s=new FileReader;s.onerror=e=>{n(s.error)},s.onload=e=>{const i=a.TheCard.importVCard(s.result);i?t(i):n(new Error("Failed to parse vCard"))},s.readAsText(e)})}},6111:function(e,t,n){n.d(t,{A:function(){return o}});var a=n(3247),s=n(9710);function i(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return r(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var a=0;return function(){return a>=e.length?{done:!0}:{done:!1,value:e[a++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,a=Array(t);n<t;n++)a[n]=e[n];return a}function o(e,t){var n=t.countries,r=t.metadata;r=new a.Ay(r);for(var o,d=i(n);!(o=d()).done;){var l=o.value;if(r.selectNumberingPlan(l),r.leadingDigits()){if(e&&0===e.search(r.leadingDigits()))return l}else if((0,s.A)({phone:e,country:l},void 0,r.metadata))return l}}},6128:function(e,t,n){n.d(t,{Cb:function(){return s},Jq:function(){return i},OA:function(){return r},c7:function(){return a},tz:function(){return d},uD:function(){return o}});var a=2,s=17,i=3,r="0-90-9٠-٩۰-۹",o="".concat("-‐-―−ー-").concat("//").concat("..").concat(" ").concat("()()[]\\[\\]").concat("~⁓∼~"),d="++"},6789:function(e,t,n){n.d(t,{A:function(){return i}});var a=n(1594),s=n.n(a);class i extends s().PureComponent{constructor(e){super(e),this.inputRef=s().createRef(),this.state={value:this.props.value||"",visible:!1},this.handleVisibility=this.handleVisibility.bind(this),this.handeTextChange=this.handeTextChange.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleEditingFinished=this.handleEditingFinished.bind(this)}componentDidMount(){this.props.autoFocus&&this.inputRef.current.focus()}handeTextChange(e){this.setState({value:e.target.value}),this.props.onChange&&this.props.onChange(e)}handleVisibility(e){e.preventDefault(),this.setState({visible:!this.state.visible})}handleKeyDown(e){27==e.keyCode?(this.setState({value:this.props.value||"",visible:!1}),this.props.onFinished&&this.props.onFinished()):13==e.keyCode&&this.handleEditingFinished()}handleEditingFinished(e){if(e){let t=e.currentTarget;setTimeout(e=>{t.contains(document.activeElement)||this.props.onFinished&&this.props.onFinished(this.state.value)},0)}else this.props.onFinished&&this.props.onFinished(this.state.value.trim())}render(){return s().createElement("div",{tabIndex:"-1",className:"group-focus",onBlur:this.handleEditingFinished},s().createElement("input",{className:"with-icon-right",type:this.state.visible?"text":"password",value:this.state.value,placeholder:this.props.placeholder,maxLength:32,required:this.props.required?"required":"",autoFocus:this.props.autoFocus?"autoFocus":"",autoComplete:this.props.autoComplete,onChange:this.handeTextChange,onKeyDown:this.handleKeyDown,ref:this.inputRef}),s().createElement("span",{onClick:this.handleVisibility},s().createElement("i",{className:"material-icons clickable light-gray"},this.state.visible?"visibility":"visibility_off")))}}},6890:function(e,t,n){n.d(t,{A:function(){return r}});var a=n(3247),s=n(6128),i=new RegExp("(["+s.OA+"])");function r(e,t,n,s){if(t){var r=new a.Ay(s);r.selectNumberingPlan(t,n);var o=new RegExp(r.IDDPrefix());if(0===e.search(o)){var d=(e=e.slice(e.match(o)[0].length)).match(i);if(!(d&&null!=d[1]&&d[1].length>0&&"0"===d[1]))return e}}}},6904:function(e,t,n){n.d(t,{A:function(){return l}});var a=n(1594),s=n.n(a),i=n(4532),r=n(8589),o=n(3540),d=n(9027);class l extends s().PureComponent{render(){let e;if(!0===this.props.avatar)if(i.Tinode.isSelfTopicName(this.props.topic))e=s().createElement("img",{className:"avatar self",alt:"avatar",src:d.Yd});else{const t=i.Tinode.isGroupTopicName(this.props.topic),n=(0,r.kJ)(this.props.topic,t);if(this.props.topic&&this.props.title&&this.props.title.trim()){const t=this.props.title.trim().charAt(0),a="lettertile "+n+(this.props.deleted?" disabled":"");e=s().createElement("div",{className:a},s().createElement("div",null,t))}else{const a="material-icons "+n+(this.props.deleted?" disabled":"");e=t?s().createElement("i",{className:a},"group"):s().createElement("i",{className:a},"person")}}else if(this.props.avatar){const t=this.props.authorizeURL((0,o.wk)(this.props.avatar,"image")),n="avatar"+(this.props.deleted?" deleted":"");e=s().createElement("img",{className:n,alt:"avatar",src:t,onError:e=>{e.target.onerror=null,e.target.src="img/broken_image.png"}})}else e=null;return e}}},7151:function(e,t,n){n.d(t,{A:function(){return a}});class a{static parseUrlHash(e){const t=e.split("?",2),n={};let a=[];return t[0]&&(a=t[0].replace("#","").split("/")),t[1]&&t[1].split("&").forEach(e=>{const t=e.indexOf("=");t>0&&(n[e.slice(0,t)]=decodeURIComponent(e.slice(t+1)))}),{path:a,params:n}}static navigateTo(e){window.location.hash=e}static composeUrlHash(e,t){let n=e.join("/");const a=[];for(const e in t)t.hasOwnProperty(e)&&void 0!==t[e]&&a.push(e+"="+encodeURIComponent(t[e]));return a.length>0&&(n+="?"+a.join("&")),n}static addUrlParam(e,t,n){const s=a.parseUrlHash(e);return s.params[t]=n,a.composeUrlHash(s.path,s.params)}static removeUrlParam(e,t){const n=a.parseUrlHash(e);return delete n.params[t],a.composeUrlHash(n.path,n.params)}static setUrlSidePanel(e,t){const n=a.parseUrlHash(e);return n.path[0]=t,a.composeUrlHash(n.path,n.params)}static setUrlInfoPanel(e,t){const n=a.parseUrlHash(e);return t?n.params.info=t:delete n.params.info,a.composeUrlHash(n.path,n.params)}static setUrlTopic(e,t){const n=a.parseUrlHash(e);return n.path[1]=t,delete n.params.info,a.composeUrlHash(n.path,n.params)}}},8089:function(e,t,n){n.d(t,{A:function(){return $}});var a=n(1594),s=n.n(a),i=n(8181),r=n(4532),o=n(221),d=n(9418),l=n(1485),c=n(3307),h=n(9027),p=n(6110),u=n(8589),m=n(3540);const g=(0,i.defineMessages)({alias_invalid:{id:"alias_invalid",defaultMessage:[{type:0,value:"(invalid)"}]},alias_already_taken:{id:"alias_already_taken",defaultMessage:[{type:0,value:"(already taken)"}]},self_topic_name:{id:"self_topic_name",defaultMessage:[{type:0,value:"Saved messages"}]},self_topic_comment:{id:"self_topic_comment",defaultMessage:[{type:0,value:"Notes, messages, links, files saved for posterity"}]}});class f extends s().Component{constructor(e){super(e);const t=this.props.tinode.getTopic(this.props.topic),n=t.getAccessMode(),a=r.Tinode.isSelfTopicName(this.props.topic);this.state={isMe:r.Tinode.isMeTopicName(this.props.topic),isSelf:a,owner:n&&n.isOwner(),fullName:t.public?t.public.fn:a?this.props.intl.formatMessage(g.self_topic_name):null,private:t.private?t.private.comment:null,description:t.public?t.public.note:a?this.props.intl.formatMessage(g.self_topic_comment):null,avatar:(0,p.to)(t.public?t.public.photo:null),tags:t.tags()||[],newAvatar:null,newAvatarMime:null,aliasError:""},this.previousOnTags=null,this.aliasCheckTimer=null,this.aliasCheckPromise=null,this.tnNewTags=this.tnNewTags.bind(this),this.handleFullNameUpdate=this.handleFullNameUpdate.bind(this),this.handleImageUpdated=this.handleImageUpdated.bind(this),this.handleAvatarCropped=this.handleAvatarCropped.bind(this),this.handleAvatarCropCancel=this.handleAvatarCropCancel.bind(this),this.uploadAvatar=this.uploadAvatar.bind(this),this.handlePrivateUpdate=this.handlePrivateUpdate.bind(this),this.handleAliasUpdate=this.handleAliasUpdate.bind(this),this.handleDescriptionUpdate=this.handleDescriptionUpdate.bind(this),this.handleTagsUpdated=this.handleTagsUpdated.bind(this),this.validateAlias=this.validateAlias.bind(this),this.cancelValidator=this.cancelValidator.bind(this)}componentDidMount(){const e=this.props.tinode.getTopic(this.props.topic);this.previousOnTags=e.onTagsUpdated,e.onTagsUpdated=this.tnNewTags}componentWillUnmount(){this.props.tinode.getTopic(this.props.topic).onTagsUpdated=this.previousOnTags,this.cancelValidator()}tnNewTags(e){this.setState({tags:e})}handleFullNameUpdate(e){(e=(0,u.W5)(e.trim(),h.tS))&&this.state.fullName!==e&&(this.setState({fullName:e}),this.props.onUpdateTopicDesc(this.props.topic,(0,m.k6)(e,null)))}handlePrivateUpdate(e){e=e.trim().substring(0,h.tS),this.state.private!==e&&(this.setState({private:e}),this.props.onUpdateTopicDesc(this.props.topic,null,e||r.Tinode.DEL_CHAR))}handleDescriptionUpdate(e){(e=e.trim().substring(0,h.lQ))&&(this.setState({description:e}),this.props.onUpdateTopicDesc(this.props.topic,(0,m.k6)(null,null,null,e)))}handleImageUpdated(e,t){this.setState({newAvatar:t,newAvatarMime:e}),t||(this.setState({avatar:null}),this.props.onUpdateTopicDesc(this.props.topic,(0,m.k6)(null,r.Tinode.DEL_CHAR)))}handleAvatarCropped(e,t,n,a){const s=t?URL.createObjectURL(t):null;this.setState({avatar:s,newAvatar:null,newAvatarMime:null}),t&&this.uploadAvatar(e,t,n,a)}uploadAvatar(e,t,n,a){const s=e=>{let{mime:t,blob:n}=e;if(n.size>h.Z7){this.props.tinode.getLargeFileHelper().upload(n).then(e=>this.props.onUpdateTopicDesc(this.props.topic,(0,m.k6)(null,e))).catch(e=>this.props.onError(e.message,"err"))}else(0,p.Sk)(n).then(e=>{const n=(0,p.to)({data:e.bits,type:t});this.setState({source:n}),this.props.onUpdateTopicDesc(this.props.topic,(0,m.k6)(null,n))})};n>h.eQ||a>h.eQ||n!=a?(0,p.ag)(t,h.eQ,h.eQ,h.qy,!0).then(e=>s(e)).catch(e=>this.props.onError(e.message,"err")):s({mime:e,blob:t,width:n,height:a})}handleAvatarCropCancel(){this.setState({newAvatar:null,newAvatarMime:null})}handleAliasUpdate(e){const t=(e=(e||"").trim())?r.Tinode.setUniqueTag(this.state.tags,r.Tinode.TAG_ALIAS+e.toLowerCase()):r.Tinode.clearTagPrefix(this.state.tags,r.Tinode.TAG_ALIAS);this.handleTagsUpdated(t)}validateAlias(e){if(this.cancelValidator(),!(e=e.trim()))return this.setState({aliasError:""}),!0;if(!r.Tinode.isValidTagValue(e))return this.setState({aliasError:this.props.intl.formatMessage(g.alias_invalid)}),!1;this.setState({aliasError:""});const t=this.props.tinode.getFndTopic();if(!t)return this.setState({aliasError:""}),!0;this.aliasCheckPromise={};const n=new Promise((e,t)=>{this.aliasCheckPromise.resolve=e,this.aliasCheckPromise.reject=t});return this.aliasCheckTimer=setTimeout(n=>{this.aliasCheckTimer=null,t.checkTagUniqueness(`${r.Tinode.TAG_ALIAS}${e}`,this.props.topic).then(e=>{this.aliasCheckPromise.resolve(e),this.setState({aliasError:e?"":this.props.intl.formatMessage(g.alias_already_taken)})}).catch(e=>{this.aliasCheckPromise.reject(e),this.setState({aliasError:e.message})})},1e3),n}cancelValidator(){this.aliasCheckTimer&&(clearTimeout(this.aliasCheckTimer),this.aliasCheckTimer=null,this.aliasCheckPromise.reject(null))}handleTagsUpdated(e){(0,m.af)(this.state.tags.slice(0),e.slice(0))||this.props.onUpdateTags(e)}render(){if(this.state.newAvatar)return s().createElement(o.A,{avatar:this.state.newAvatar,mime:this.state.newAvatarMime,onSubmit:this.handleAvatarCropped,onCancel:this.handleAvatarCropCancel,onError:this.props.onError});const e=this.state.isMe||this.state.owner&&!this.state.isSelf;let t=this.state.tags&&this.state.tags.find(e=>e.startsWith("alias:"));return t&&(t=t.substring(6)),s().createElement(s().Fragment,null,s().createElement("div",{className:"panel-form-column"},s().createElement("center",null,s().createElement(d.A,{tinode:this.props.tinode,avatar:this.state.avatar,readOnly:!e,uid:this.props.topic,title:this.state.fullName,onImageUpdated:this.handleImageUpdated,onError:this.props.onError})),this.state.isMe?s().createElement("div",{className:"group"},s().createElement("label",{className:"small"},s().createElement(i.FormattedMessage,{id:"label_your_name",defaultMessage:[{type:0,value:"Your name"}]})),s().createElement("div",null,s().createElement(i.FormattedMessage,{id:"full_name_prompt",defaultMessage:[{type:0,value:"Full name, e.g. John Doe"}]},e=>s().createElement(l.A,{placeholder:e,value:this.state.fullName,required:!0,onFinished:this.handleFullNameUpdate})))):s().createElement(s().Fragment,null,s().createElement("div",{className:"group"},s().createElement("div",null,s().createElement("label",{className:"small"},s().createElement(i.FormattedMessage,{id:"label_topic_name",defaultMessage:[{type:0,value:"Name"}]}))),s().createElement("div",null,s().createElement(i.FormattedMessage,{id:"topic_name_editing_placeholder",defaultMessage:[{type:0,value:"Freeform name of the group"}]},t=>s().createElement(l.A,{placeholder:t,readOnly:!e,value:this.state.fullName,required:!0,maxLength:32,onFinished:this.handleFullNameUpdate})))),s().createElement("div",{className:"group"},s().createElement("div",null,s().createElement("label",{className:"small"},s().createElement(i.FormattedMessage,{id:"label_private",defaultMessage:[{type:0,value:"Private comment"}]}))),s().createElement("div",null,s().createElement(i.FormattedMessage,{id:"private_editing_placeholder",defaultMessage:[{type:0,value:"Visible to you only"}]},e=>s().createElement(l.A,{placeholder:e,value:this.state.private,onFinished:this.handlePrivateUpdate}))))),e||t?s().createElement("div",{className:"group"},s().createElement("div",null,s().createElement("label",{className:"small "+(this.state.aliasError?"invalid":"")},s().createElement(i.FormattedMessage,{id:"label_alias_edit",defaultMessage:[{type:0,value:"Alias"}]})," ",this.state.aliasError)),s().createElement("div",null,s().createElement(i.FormattedMessage,{id:"alias_editing_placeholder",defaultMessage:[{type:0,value:"Alias (optional)"}]},n=>s().createElement(l.A,{placeholder:n,readOnly:!e,value:t,validator:this.validateAlias,iconLeft:"alternate_email",maxLength:24,spellCheck:!1,onFinished:this.handleAliasUpdate})))):null,e||this.state.description?s().createElement("div",{className:"group"},s().createElement("div",null,s().createElement("label",{className:"small"},s().createElement(i.FormattedMessage,{id:"label_description",defaultMessage:[{type:0,value:"Description"}]}))),s().createElement("div",null,s().createElement(i.FormattedMessage,{id:"description_editing_placeholder",defaultMessage:[{type:0,value:"Description (optional)"}]},t=>s().createElement(l.A,{placeholder:t,readOnly:!e,value:this.state.description,multiline:2,onFinished:this.handleDescriptionUpdate})))):null),e&&!this.state.isMe?s().createElement(s().Fragment,null,s().createElement("div",{className:"hr"}),s().createElement(i.FormattedMessage,{id:"title_tag_manager",defaultMessage:[{type:0,value:"Tags (search & discovery)"}]},e=>s().createElement(c.A,{tinode:this.props.tinode,title:e,activated:!1,tags:this.state.tags,onSubmit:this.handleTagsUpdated}))):null)}}var v=(0,i.injectIntl)(f);class $ extends s().Component{constructor(e){super(e);this.props.tinode.getTopic(this.props.topic).getAccessMode();this.state={tags:[]},this.previousTagsUpdated=void 0,this.onTagsUpdated=this.onTagsUpdated.bind(this),this.handleTagsUpdated=this.handleTagsUpdated.bind(this)}componentDidUpdate(e){const t=this.props.tinode.getTopic(e.topic);t&&(t.onTagsUpdated!=this.onTagsUpdated&&("grp"==t.getType()?(this.previousTagsUpdated=t.onTagsUpdated,t.onTagsUpdated=this.onTagsUpdated):this.previousTagsUpdated=void 0),this.state.topic!=e.topic&&this.setState({topic:e.topic}))}componentWillUnmount(){this.props.tinode.getTopic(this.props.topic).onTagsUpdated=this.previousTagsUpdated}onTagsUpdated(e){this.setState({tags:e}),this.previousTagsUpdated&&this.previousTagsUpdated!=this.onTagsUpdated&&this.previousTagsUpdated(e)}handleTagsUpdated(e){(0,m.af)(this.state.tags.slice(0),e.slice(0))||this.props.onUpdateTagsRequest(this.props.topic,e)}render(){return s().createElement("div",{className:"scrollable-panel"},s().createElement(v,{tinode:this.props.tinode,topic:this.props.topic,onUpdateTopicDesc:this.props.onUpdateTopicDesc,onUpdateTags:this.handleTagsUpdated,onError:this.props.onError}))}}},8181:function(e){e.exports=ReactIntl},8262:function(e,t,n){n.d(t,{A:function(){return a}});class a{static setObject(e,t){localStorage.setItem(e,JSON.stringify(t))}static getObject(e){const t=localStorage.getItem(e);return t&&JSON.parse(t)}static updateObject(e,t){const n=this.getObject(e);this.setObject(e,Object.assign(n||{},t))}static removeItem(e){localStorage.removeItem(e)}}},8589:function(e,t,n){function a(e,t){t=t||window.navigator.userLanguage||window.navigator.language;const n=new Date;return e.getFullYear()==n.getFullYear()?e.getMonth()==n.getMonth()&&e.getDate()==n.getDate()?e.toLocaleTimeString(t,{hour12:!1,hour:"2-digit",minute:"2-digit"}):e.toLocaleDateString(t,{hour12:!1,month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}):e.toLocaleDateString(t,{year:"numeric",month:"short",day:"numeric"})}function s(e,t){t=t||window.navigator.userLanguage||window.navigator.language;const n=new Date,a=Math.floor((e.getTime()-6e4*e.getTimezoneOffset())/864e5)-Math.floor((n.getTime()-6e4*n.getTimezoneOffset())/864e5);return Math.abs(a)<2?new Intl.RelativeTimeFormat(t,{numeric:"auto"}).format(a,"day"):new Intl.DateTimeFormat(t).format(e)}function i(e,t){if("number"!=typeof e)return"";let n=(0|Math.floor(e/60))%60,a=0|Math.floor(e/3600);(t||a>0)&&(n=n<10?`0${n}`:n);let s=(0|e)%60;return s=s<10?`0${s}`:s,0==a?`${n}:${s}`:`${a}:${n}:${s}`}function r(e){if(!e||0==e)return"0 Bytes";const t=["Bytes","KB","MB","GB","TB","PB"],n=Math.min(0|Math.floor(Math.log2(e)/10),t.length-1),a=e/Math.pow(1024,n),s=n>0?a<3?2:a<30?1:0:0;return a.toFixed(s)+" "+t[n]}function o(e,t){return"string"!=typeof e?e:e.length>t?e.slice(0,t/2-1)+"…"+e.slice(1-t/2):e}function d(e,t,n){return(t?"lt-":"dk-")+(n?"fg-":"bg-")+(a=e,Math.abs(function(e){let t=0;e=""+e;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t&=t;return t}(a))%16);var a}function l(e){const t=e.toUpperCase().split("").map(e=>127397+e.charCodeAt());return String.fromCodePoint(...t)}function c(e,t){if("string"!=typeof e)return e;if(e.length<=t)return e;return/[\u0590-\u05FF\u0600-\u06FF\u0750-\u077F\u08A0-\u08FF\uFB50-\uFDFF\uFE70-\uFEFF]/.test(e)?"…"+e.slice(0,t-1):e.slice(0,t-1)+"…"}n.d(t,{Tu:function(){return o},W5:function(){return c},Ye:function(){return i},cq:function(){return a},kJ:function(){return d},lX:function(){return r},lb:function(){return l},mf:function(){return s}})},8892:function(e,t,n){n.d(t,{L:function(){return oe}});var a=n(5693),s=n(6128);function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}function r(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,o(a.key),a)}}function o(e){var t=function(e,t){if("object"!=i(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var a=n.call(e,t||"default");if("object"!=i(a))return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==i(t)?t:t+""}function d(e,t,n){return t=p(t),function(e,t){if(t&&("object"==i(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,c()?Reflect.construct(t,n||[],p(e).constructor):t.apply(e,n))}function l(e){var t="function"==typeof Map?new Map:void 0;return l=function(e){if(null===e||!function(e){try{return-1!==Function.toString.call(e).indexOf("[native code]")}catch(t){return"function"==typeof e}}(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return function(e,t,n){if(c())return Reflect.construct.apply(null,arguments);var a=[null];a.push.apply(a,t);var s=new(e.bind.apply(e,a));return n&&h(s,n.prototype),s}(e,arguments,p(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),h(n,e)},l(e)}function c(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(c=function(){return!!e})()}function h(e,t){return h=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},h(e,t)}function p(e){return p=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},p(e)}var u=function(e){function t(e){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),n=d(this,t,[e]),Object.setPrototypeOf(n,t.prototype),n.name=n.constructor.name,n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&h(e,t)}(t,e),n=t,a&&r(n.prototype,a),s&&r(n,s),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,a,s}(l(Error)),m=n(3247),g=function(e){return"([".concat(s.OA,"]{1,").concat(e,"})")};function f(e){var t="[ \\t,]*",n="[:\\..]?[ \\t,-]*",a="#?",s="[ \\t]*";return";ext="+g("20")+"|"+(t+"(?:e?xt(?:ensi(?:ó?|ó))?n?|e?xtn?|доб|anexo)"+n+g("20")+a)+"|"+(t+"(?:[xx##~~]|int|int)"+n+g("9")+a)+"|"+("[- ]+"+g("6")+"#")+"|"+(s+"(?:,{2}|;)"+n+g("15")+a)+"|"+(s+"(?:,)+"+n+g("9")+a)}var v="["+s.OA+"]{"+s.c7+"}",$="["+s.tz+"]{0,1}(?:["+s.uD+"]*["+s.OA+"]){3,}["+s.uD+s.OA+"]*",b=new RegExp("^["+s.tz+"]{0,1}(?:["+s.uD+"]*["+s.OA+"]){1,2}$","i"),y=$+"(?:"+f()+")?",E=new RegExp("^"+v+"$|^"+y+"$","i");var C=new RegExp("(?:"+f()+")$","i");var w=n(3578);function S(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return M(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?M(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var a=0;return function(){return a>=e.length?{done:!0}:{done:!1,value:e[a++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function M(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,a=Array(t);n<t;n++)a[n]=e[n];return a}function _(e){for(var t,n="",a=S(e.split(""));!(t=a()).done;){n+=T(t.value,n)||""}return n}function T(e,t,n){return"+"===e?t?void("function"==typeof n&&n("end")):"+":(0,w.ZW)(e)}var A=n(2582),k=n(96),N=n(4408),P=n(9713),D=n(4573),I=n(9495),R="+",F="(["+s.OA+"]|[\\-\\.\\(\\)]?)",x="^\\"+R+F+"*["+s.OA+"]"+F+"*$",O=new RegExp(x,"g"),L=s.OA,U=new RegExp("^("+("["+L+"]+((\\-)*["+L+"])*")+"\\.)*"+("[a-zA-Z]+((\\-)*["+L+"])*")+"\\.?$","g"),j="tel:",B=";phone-context=",z=";isub=";function q(e,t){var n,a=t.extractFormattedPhoneNumber,s=function(e){var t=e.indexOf(B);if(t<0)return null;var n=t+B.length;if(n>=e.length)return"";var a=e.indexOf(";",n);return a>=0?e.substring(n,a):e.substring(n)}(e);if(!function(e){return null===e||0!==e.length&&(O.test(e)||U.test(e))}(s))throw new u("NOT_A_NUMBER");if(null===s)n=a(e)||"";else{n="",s.charAt(0)===R&&(n+=s);var i,r=e.indexOf(j);i=r>=0?r+j.length:0;var o=e.indexOf(B);n+=e.substring(i,o)}var d=n.indexOf(z);if(d>0&&(n=n.substring(0,d)),""!==n)return n}var V=250,H=new RegExp("["+s.tz+s.OA+"]"),W=new RegExp("[^"+s.OA+"#]+$"),G=!1;function K(e,t,n){if(t=t||{},n=new m.Ay(n),t.defaultCountry&&!n.hasCountry(t.defaultCountry)){if(t.v2)throw new u("INVALID_COUNTRY");throw new Error("Unknown country: ".concat(t.defaultCountry))}var a=function(e,t,n){var a=q(e,{extractFormattedPhoneNumber:function(e){return function(e,t,n){if(!e)return;if(e.length>V){if(n)throw new u("TOO_LONG");return}if(!1===t)return e;var a=e.search(H);if(a<0)return;return e.slice(a).replace(W,"")}(e,n,t)}});if(!a)return{};if(!function(e){return e.length>=s.c7&&E.test(e)}(a))return function(e){return b.test(e)}(a)?{error:"TOO_SHORT"}:{};var i=function(e){var t=e.search(C);if(t<0)return{};for(var n=e.slice(0,t),a=e.match(C),s=1;s<a.length;){if(a[s])return{number:n,ext:a[s]};s++}}(a);if(i.ext)return i;return{number:a}}(e,t.v2,t.extract),i=a.number,r=a.ext,o=a.error;if(!i){if(t.v2){if("TOO_SHORT"===o)throw new u("TOO_SHORT");throw new u("NOT_A_NUMBER")}return{}}var d=function(e,t,n,a){var s,i=(0,P.A)(_(e),void 0,t,n,a.metadata),r=i.countryCallingCodeSource,o=i.countryCallingCode,d=i.number;if(o)a.selectNumberingPlan(o);else{if(!d||!t&&!n)return{};a.selectNumberingPlan(t,n),t?s=t:G&&a.isNonGeographicCallingCode(n)&&(s="001"),o=n||(0,m.Ko)(t,a.metadata)}if(!d)return{countryCallingCodeSource:r,countryCallingCode:o};var l=(0,D.A)(_(d),s,a),c=l.nationalNumber,h=l.carrierCode,p=(0,I.A)(o,{nationalNumber:c,metadata:a});p&&(s=p,"001"===p||a.selectNumberingPlan(s));return{country:s,countryCallingCode:o,countryCallingCodeSource:r,nationalNumber:c,carrierCode:h}}(i,t.defaultCountry,t.defaultCallingCode,n),l=d.country,c=d.nationalNumber,h=d.countryCallingCode,p=d.countryCallingCodeSource,g=d.carrierCode;if(!n.hasSelectedNumberingPlan()){if(t.v2)throw new u("INVALID_COUNTRY");return{}}if(!c||c.length<s.c7){if(t.v2)throw new u("TOO_SHORT");return{}}if(c.length>s.Cb){if(t.v2)throw new u("TOO_LONG");return{}}if(t.v2){var f=new k.A(h,c,n.metadata);return l&&(f.country=l),g&&(f.carrierCode=g),r&&(f.ext=r),f.__countryCallingCodeSource=p,f}var v=!!(t.extended?n.hasSelectedNumberingPlan():l)&&(0,N.A)(c,n.nationalNumberPattern());return t.extended?{country:l,countryCallingCode:h,carrierCode:g,valid:v,possible:!!v||!(!0!==t.extended||!n.possibleLengths()||!(0,A.x)(c,l,n)),phone:c,ext:r}:v?function(e,t,n){var a={country:e,phone:t};n&&(a.ext=n);return a}(l,c,r):{}}function Y(e){return Y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Y(e)}function Q(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,a)}return n}function X(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Q(Object(n),!0).forEach(function(t){J(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Q(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function J(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=Y(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var a=n.call(e,t||"default");if("object"!=Y(a))return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Y(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Z=n(284);function ee(e){return ee="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ee(e)}function te(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,a)}return n}function ne(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=ee(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var a=n.call(e,t||"default");if("object"!=ee(a))return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==ee(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ae(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var a,s,i,r,o=[],d=!0,l=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;d=!1}else for(;!(d=(a=i.call(n)).done)&&(o.push(a.value),o.length!==t);d=!0);}catch(e){l=!0,s=e}finally{try{if(!d&&null!=n.return&&(r=n.return(),Object(r)!==r))return}finally{if(l)throw s}}return o}}(e,t)||function(e,t){if(e){if("string"==typeof e)return se(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?se(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function se(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,a=Array(t);n<t;n++)a[n]=e[n];return a}function ie(e){var t,n,a,s=ae(Array.prototype.slice.call(e),4),i=s[0],r=s[1],o=s[2],d=s[3];if("string"!=typeof i)throw new TypeError("A text for parsing must be a string.");if(t=i,r&&"string"!=typeof r){if(!(0,Z.A)(r))throw new Error("Invalid second argument: ".concat(r));o?(n=r,a=o):a=r}else d?(n=o,a=d):(n=void 0,a=o),r&&(n=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?te(Object(n),!0).forEach(function(t){ne(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):te(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}({defaultCountry:r},n));return{text:t,options:n,metadata:a}}function re(){var e=ie(arguments);return function(e,t,n){return K(e,X(X({},t),{},{v2:!0}),n)}(e.text,e.options,e.metadata)}function oe(){return(0,a.A)(re,arguments)}},9027:function(e,t,n){n.d(t,{C3:function(){return a},Cx:function(){return _},D3:function(){return m},DT:function(){return k},GB:function(){return p},H1:function(){return E},HX:function(){return r},J:function(){return l},JS:function(){return f},Lq:function(){return s},NR:function(){return d},QG:function(){return S},RS:function(){return j},Rz:function(){return R},S:function(){return Z},SE:function(){return i},TR:function(){return F},Ti:function(){return h},Tn:function(){return V},U3:function(){return o},Uv:function(){return J},V9:function(){return B},VJ:function(){return g},Yd:function(){return K},Z7:function(){return $},ZW:function(){return W},_g:function(){return T},_j:function(){return b},bn:function(){return Y},cL:function(){return X},cZ:function(){return u},eQ:function(){return v},fi:function(){return U},gb:function(){return Q},hB:function(){return x},hT:function(){return H},iB:function(){return L},iq:function(){return A},kA:function(){return q},lQ:function(){return P},mp:function(){return C},mu:function(){return D},qV:function(){return y},qy:function(){return w},rl:function(){return z},rn:function(){return c},sT:function(){return I},tS:function(){return N},wj:function(){return M},wl:function(){return O},yS:function(){return G}});const a="TinodeWeb/"+(n(257).i||"0.24"),s="AQEAAAABAAD_rAp4DJh05a1HAwFT3A6K",i={hosted:"web.tinode.co",local:"localhost:6060"},r=i.hosted,o=!0,d=3e3,l=1500,c=2,h=96,p=16,u="JRWPS",m="N",g=640,f=13,v=384,$=4096,b=32,y=128,E=24,C=262144,w=1<<23,S=1024,M=64,_=96,T=36,A=48,k=4,N=60,P=360,D=24,I=80,R=30,F=84,x=48,O=2e3,L=6e5,U="mailto:support@tinode.co",j="https://tinode.co/privacy.html",B="https://tinode.co/terms.html",z=!1,q=["http","https","ftp","ftps"],V=128,H=8e4,W=1e3,G=3*f,K="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz48c3ZnIHZpZXdCb3g9IjAgMCAxNyAxNyIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNMy41NjIgMXYxNS40NTlsNC42ODYtMy4yNyA0Ljc1MiAzLjI2di0xNS40NDloLTkuNDM4ek0xMiAxNC41NTFsLTMuNzU2LTIuNTc4LTMuNjgxIDIuNTY4di0xMi41NDFoNy40Mzd2MTIuNTUxeiIgZmlsbD0iIzU1NTU1NSIgLz48L3N2Zz4=",Y=3e3,Q="auto",X=10,J="application/json",Z={type:"patt",index:0,path:"img/bkg/"}},9418:function(e,t,n){n.d(t,{A:function(){return l}});var a=n(1594),s=n.n(a),i=n(6904),r=n(1013),o=n(3540),d=n(9027);class l extends s().Component{constructor(e){super(e),this.state={source:e.avatar},this.handleFileReceived=this.handleFileReceived.bind(this)}componentDidUpdate(e){this.props.avatar!=e.avatar&&this.setState({source:this.props.avatar})}handleFileReceived(e){const t=e.target.files[0];this.props.onImageUpdated(t.type,URL.createObjectURL(t),t.name),e.target.value=""}render(){const e="file-input-avatar-"+(""+Math.random()).substring(0,4),t="avatar-upload"+(this.props.readOnly?" read-only":"");return s().createElement("div",{className:t},this.props.readOnly||!this.state.source?null:s().createElement("a",{href:"#",className:"clear-avatar",onClick:e=>{e.preventDefault(),this.props.onImageUpdated()}},s().createElement("i",{className:"material-icons"},"clear")),this.state.source?s().createElement("img",{src:this.props.tinode.authorizeURL((0,o.wk)(this.state.source,"image")),className:"preview"}):this.props.readOnly&&this.props.uid?s().createElement("div",{className:"avatar-box"},s().createElement(i.A,{authorizeURL:this.props.tinode.authorizeURL,avatar:!0,topic:this.props.uid,title:this.props.title})):s().createElement("div",{className:"blank"},d.eQ,"×",d.eQ),this.props.readOnly?null:s().createElement("input",{type:"file",id:e,className:"inputfile hidden",accept:"image/*",onChange:this.handleFileReceived}),this.props.readOnly?null:s().createElement("label",{htmlFor:e,className:"round"},s().createElement("i",{className:"material-icons"},"file_upload")),s().createElement(r.A,{show:this.props.uploading,large:!0,clear:!0,centered:!0}))}}},9495:function(e,t,n){n.d(t,{A:function(){return i}});var a=n(6111),s=!1;function i(e,t){var n=t.nationalNumber,i=t.metadata;if(s&&i.isNonGeographicCallingCode(e))return"001";var r=i.getCountryCodesForCallingCode(e);return r?1===r.length?r[0]:(0,a.A)(n,{countries:r,metadata:i.metadata}):void 0}},9593:function(e){e.exports=QRCode},9710:function(e,t,n){n.d(t,{A:function(){return d}});var a=n(3247),s=n(4408);function i(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return r(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var a=0;return function(){return a>=e.length?{done:!0}:{done:!1,value:e[a++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,a=Array(t);n<t;n++)a[n]=e[n];return a}var o=["MOBILE","PREMIUM_RATE","TOLL_FREE","SHARED_COST","VOIP","PERSONAL_NUMBER","PAGER","UAN","VOICEMAIL"];function d(e,t,n){if(t=t||{},e.country||e.countryCallingCode){(n=new a.Ay(n)).selectNumberingPlan(e.country,e.countryCallingCode);var r=t.v2?e.nationalNumber:e.phone;if((0,s.A)(r,n.nationalNumberPattern())){if(l(r,"FIXED_LINE",n))return n.type("MOBILE")&&""===n.type("MOBILE").pattern()?"FIXED_LINE_OR_MOBILE":n.type("MOBILE")?l(r,"MOBILE",n)?"FIXED_LINE_OR_MOBILE":"FIXED_LINE":"FIXED_LINE_OR_MOBILE";for(var d,c=i(o);!(d=c()).done;){var h=d.value;if(l(r,h,n))return h}}}}function l(e,t,n){return!(!(t=n.type(t))||!t.pattern())&&(!(t.possibleLengths()&&t.possibleLengths().indexOf(e.length)<0)&&(0,s.A)(e,t.pattern()))}},9713:function(e,t,n){n.d(t,{A:function(){return o}});var a=n(6890),s=n(283),i=n(3247),r=n(6128);function o(e,t,n,o,d){if(!e)return{};var l;if("+"!==e[0]){var c=(0,a.A)(e,t||n,o,d);if(!c||c===e){if(t||n||o){var h=(0,s.A)(e,t,n,o,d),p=h.countryCallingCode,u=h.number;if(p)return{countryCallingCodeSource:"FROM_NUMBER_WITHOUT_PLUS_SIGN",countryCallingCode:p,number:u}}return{number:e}}l=!0,e="+"+c}if("0"===e[1])return{};d=new i.Ay(d);for(var m=2;m-1<=r.Jq&&m<=e.length;){var g=e.slice(1,m);if(d.hasCallingCode(g))return d.selectNumberingPlan(g),{countryCallingCodeSource:l?"FROM_NUMBER_WITH_IDD":"FROM_NUMBER_WITH_PLUS_SIGN",countryCallingCode:g,number:e.slice(m)};m++}return{}}},9895:function(e,t,n){n.d(t,{A:function(){return r}});var a=n(1594),s=n.n(a),i=n(8181);class r extends s().PureComponent{render(){return s().createElement("div",{className:"uploader"},s().createElement("div",null,s().createElement("span",{style:{width:100*this.props.progress+"%"}})),this.props.progress<.999?s().createElement("a",{href:"#",onClick:e=>{e.preventDefault(),this.props.onCancel()}},s().createElement("i",{className:"material-icons"},"close")," ",s().createElement(i.FormattedMessage,{id:"action_cancel",defaultMessage:[{type:0,value:"cancel"}]})):s().createElement(i.FormattedMessage,{id:"upload_finishing",defaultMessage:[{type:0,value:"finishing..."}]}))}}}},i={};function r(e){var t=i[e];if(void 0!==t)return t.exports;var n=i[e]={exports:{}};return s[e].call(n.exports,n,n.exports,r),n.exports}r.m=s,r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,{a:t}),t},t=Object.getPrototypeOf?function(e){return Object.getPrototypeOf(e)}:function(e){return e.__proto__},r.t=function(n,a){if(1&a&&(n=this(n)),8&a)return n;if("object"==typeof n&&n){if(4&a&&n.__esModule)return n;if(16&a&&"function"==typeof n.then)return n}var s=Object.create(null);r.r(s);var i={};e=e||[null,t({}),t([]),t(t)];for(var o=2&a&&n;("object"==typeof o||"function"==typeof o)&&!~e.indexOf(o);o=t(o))Object.getOwnPropertyNames(o).forEach(function(e){i[e]=function(){return n[e]}});return i.default=function(){return n},r.d(s,i),s},r.d=function(e,t){for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.f={},r.e=function(e){return Promise.all(Object.keys(r.f).reduce(function(t,n){return r.f[n](e,t),t},[]))},r.u=function(e){return e+".prod.js"},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n={},a="tinode-webapp:",r.l=function(e,t,s,i){if(n[e])n[e].push(t);else{var o,d;if(void 0!==s)for(var l=document.getElementsByTagName("script"),c=0;c<l.length;c++){var h=l[c];if(h.getAttribute("src")==e||h.getAttribute("data-webpack")==a+s){o=h;break}}o||(d=!0,(o=document.createElement("script")).charset="utf-8",r.nc&&o.setAttribute("nonce",r.nc),o.setAttribute("data-webpack",a+s),o.src=e),n[e]=[t];var p=function(t,a){o.onerror=o.onload=null,clearTimeout(u);var s=n[e];if(delete n[e],o.parentNode&&o.parentNode.removeChild(o),s&&s.forEach(function(e){return e(a)}),t)return t(a)},u=setTimeout(p.bind(null,void 0,{type:"timeout",target:o}),12e4);o.onerror=p.bind(null,o.onerror),o.onload=p.bind(null,o.onload),d&&document.head.appendChild(o)}},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.p="/umd/",function(){var e={57:0};r.f.j=function(t,n){var a=r.o(e,t)?e[t]:void 0;if(0!==a)if(a)n.push(a[2]);else{var s=new Promise(function(n,s){a=e[t]=[n,s]});n.push(a[2]=s);var i=r.p+r.u(t),o=new Error;r.l(i,function(n){if(r.o(e,t)&&(0!==(a=e[t])&&(e[t]=void 0),a)){var s=n&&("load"===n.type?"missing":n.type),i=n&&n.target&&n.target.src;o.message="Loading chunk "+t+" failed.\n("+s+": "+i+")",o.name="ChunkLoadError",o.type=s,o.request=i,a[1](o)}},"chunk-"+t,t)}};var t=function(t,n){var a,s,i=n[0],o=n[1],d=n[2],l=0;if(i.some(function(t){return 0!==e[t]})){for(a in o)r.o(o,a)&&(r.m[a]=o[a]);if(d)d(r)}for(t&&t(n);l<i.length;l++)s=i[l],r.o(e,s)&&e[s]&&e[s][0](),e[s]=0},n=self.webpackChunktinode_webapp=self.webpackChunktinode_webapp||[];n.forEach(t.bind(null,0)),n.push=t.bind(null,n.push.bind(n))}();var o=r(1594),d=r.n(o),l=r(5338),c=r(8181);const h=function(e){const t=[];let n=0;for(let a=0;a<e.length;a++){let s=e.charCodeAt(a);s<128?t[n++]=s:s<2048?(t[n++]=s>>6|192,t[n++]=63&s|128):55296==(64512&s)&&a+1<e.length&&56320==(64512&e.charCodeAt(a+1))?(s=65536+((1023&s)<<10)+(1023&e.charCodeAt(++a)),t[n++]=s>>18|240,t[n++]=s>>12&63|128,t[n++]=s>>6&63|128,t[n++]=63&s|128):(t[n++]=s>>12|224,t[n++]=s>>6&63|128,t[n++]=63&s|128)}return t},p={byteToCharMap_:null,charToByteMap_:null,byteToCharMapWebSafe_:null,charToByteMapWebSafe_:null,ENCODED_VALS_BASE:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",get ENCODED_VALS(){return this.ENCODED_VALS_BASE+"+/="},get ENCODED_VALS_WEBSAFE(){return this.ENCODED_VALS_BASE+"-_."},HAS_NATIVE_SUPPORT:"function"==typeof atob,encodeByteArray(e,t){if(!Array.isArray(e))throw Error("encodeByteArray takes an array as a parameter");this.init_();const n=t?this.byteToCharMapWebSafe_:this.byteToCharMap_,a=[];for(let t=0;t<e.length;t+=3){const s=e[t],i=t+1<e.length,r=i?e[t+1]:0,o=t+2<e.length,d=o?e[t+2]:0,l=s>>2,c=(3&s)<<4|r>>4;let h=(15&r)<<2|d>>6,p=63&d;o||(p=64,i||(h=64)),a.push(n[l],n[c],n[h],n[p])}return a.join("")},encodeString(e,t){return this.HAS_NATIVE_SUPPORT&&!t?btoa(e):this.encodeByteArray(h(e),t)},decodeString(e,t){return this.HAS_NATIVE_SUPPORT&&!t?atob(e):function(e){const t=[];let n=0,a=0;for(;n<e.length;){const s=e[n++];if(s<128)t[a++]=String.fromCharCode(s);else if(s>191&&s<224){const i=e[n++];t[a++]=String.fromCharCode((31&s)<<6|63&i)}else if(s>239&&s<365){const i=((7&s)<<18|(63&e[n++])<<12|(63&e[n++])<<6|63&e[n++])-65536;t[a++]=String.fromCharCode(55296+(i>>10)),t[a++]=String.fromCharCode(56320+(1023&i))}else{const i=e[n++],r=e[n++];t[a++]=String.fromCharCode((15&s)<<12|(63&i)<<6|63&r)}}return t.join("")}(this.decodeStringToByteArray(e,t))},decodeStringToByteArray(e,t){this.init_();const n=t?this.charToByteMapWebSafe_:this.charToByteMap_,a=[];for(let t=0;t<e.length;){const s=n[e.charAt(t++)],i=t<e.length?n[e.charAt(t)]:0;++t;const r=t<e.length?n[e.charAt(t)]:64;++t;const o=t<e.length?n[e.charAt(t)]:64;if(++t,null==s||null==i||null==r||null==o)throw new u;const d=s<<2|i>>4;if(a.push(d),64!==r){const e=i<<4&240|r>>2;if(a.push(e),64!==o){const e=r<<6&192|o;a.push(e)}}}return a},init_(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(let e=0;e<this.ENCODED_VALS.length;e++)this.byteToCharMap_[e]=this.ENCODED_VALS.charAt(e),this.charToByteMap_[this.byteToCharMap_[e]]=e,this.byteToCharMapWebSafe_[e]=this.ENCODED_VALS_WEBSAFE.charAt(e),this.charToByteMapWebSafe_[this.byteToCharMapWebSafe_[e]]=e,e>=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(e)]=e,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(e)]=e)}}};class u extends Error{constructor(){super(...arguments),this.name="DecodeBase64StringError"}}const m=function(e){return function(e){const t=h(e);return p.encodeByteArray(t,!0)}(e).replace(/\./g,"")},g=function(e){try{return p.decodeString(e,!0)}catch(e){console.error("base64Decode failed: ",e)}return null};const f=()=>function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==r.g)return r.g;throw new Error("Unable to locate global object.")}().__FIREBASE_DEFAULTS__,v=()=>{try{return f()||(()=>{if("undefined"==typeof process||void 0===process.env)return;const e=process.env.__FIREBASE_DEFAULTS__;return e?JSON.parse(e):void 0})()||(()=>{if("undefined"==typeof document)return;let e;try{e=document.cookie.match(/__FIREBASE_DEFAULTS__=([^;]+)/)}catch(e){return}const t=e&&g(e[1]);return t&&JSON.parse(t)})()}catch(e){return void console.info(`Unable to get __FIREBASE_DEFAULTS__ due to: ${e}`)}},$=()=>{var e;return null===(e=v())||void 0===e?void 0:e.config};class b{constructor(){this.reject=()=>{},this.resolve=()=>{},this.promise=new Promise((e,t)=>{this.resolve=e,this.reject=t})}wrapCallback(e){return(t,n)=>{t?this.reject(t):this.resolve(n),"function"==typeof e&&(this.promise.catch(()=>{}),1===e.length?e(t):e(t,n))}}}function y(){try{return"object"==typeof indexedDB}catch(e){return!1}}function E(){return new Promise((e,t)=>{try{let n=!0;const a="validate-browser-context-for-indexeddb-analytics-module",s=self.indexedDB.open(a);s.onsuccess=()=>{s.result.close(),n||self.indexedDB.deleteDatabase(a),e(!0)},s.onupgradeneeded=()=>{n=!1},s.onerror=()=>{var e;t((null===(e=s.error)||void 0===e?void 0:e.message)||"")}}catch(e){t(e)}})}class C extends Error{constructor(e,t,n){super(t),this.code=e,this.customData=n,this.name="FirebaseError",Object.setPrototypeOf(this,C.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,w.prototype.create)}}class w{constructor(e,t,n){this.service=e,this.serviceName=t,this.errors=n}create(e,...t){const n=t[0]||{},a=`${this.service}/${e}`,s=this.errors[e],i=s?function(e,t){return e.replace(S,(e,n)=>{const a=t[n];return null!=a?String(a):`<${n}?>`})}(s,n):"Error",r=`${this.serviceName}: ${i} (${a}).`;return new C(a,r,n)}}const S=/\{\$([^}]+)}/g;function M(e,t){if(e===t)return!0;const n=Object.keys(e),a=Object.keys(t);for(const s of n){if(!a.includes(s))return!1;const n=e[s],i=t[s];if(_(n)&&_(i)){if(!M(n,i))return!1}else if(n!==i)return!1}for(const e of a)if(!n.includes(e))return!1;return!0}function _(e){return null!==e&&"object"==typeof e}function T(e){return e&&e._delegate?e._delegate:e}class A{constructor(e,t,n){this.name=e,this.instanceFactory=t,this.type=n,this.multipleInstances=!1,this.serviceProps={},this.instantiationMode="LAZY",this.onInstanceCreated=null}setInstantiationMode(e){return this.instantiationMode=e,this}setMultipleInstances(e){return this.multipleInstances=e,this}setServiceProps(e){return this.serviceProps=e,this}setInstanceCreatedCallback(e){return this.onInstanceCreated=e,this}}const k="[DEFAULT]";class N{constructor(e,t){this.name=e,this.container=t,this.component=null,this.instances=new Map,this.instancesDeferred=new Map,this.instancesOptions=new Map,this.onInitCallbacks=new Map}get(e){const t=this.normalizeInstanceIdentifier(e);if(!this.instancesDeferred.has(t)){const e=new b;if(this.instancesDeferred.set(t,e),this.isInitialized(t)||this.shouldAutoInitialize())try{const n=this.getOrInitializeService({instanceIdentifier:t});n&&e.resolve(n)}catch(e){}}return this.instancesDeferred.get(t).promise}getImmediate(e){var t;const n=this.normalizeInstanceIdentifier(null==e?void 0:e.identifier),a=null!==(t=null==e?void 0:e.optional)&&void 0!==t&&t;if(!this.isInitialized(n)&&!this.shouldAutoInitialize()){if(a)return null;throw Error(`Service ${this.name} is not available`)}try{return this.getOrInitializeService({instanceIdentifier:n})}catch(e){if(a)return null;throw e}}getComponent(){return this.component}setComponent(e){if(e.name!==this.name)throw Error(`Mismatching Component ${e.name} for Provider ${this.name}.`);if(this.component)throw Error(`Component for ${this.name} has already been provided`);if(this.component=e,this.shouldAutoInitialize()){if(function(e){return"EAGER"===e.instantiationMode}(e))try{this.getOrInitializeService({instanceIdentifier:k})}catch(e){}for(const[e,t]of this.instancesDeferred.entries()){const n=this.normalizeInstanceIdentifier(e);try{const e=this.getOrInitializeService({instanceIdentifier:n});t.resolve(e)}catch(e){}}}}clearInstance(e=k){this.instancesDeferred.delete(e),this.instancesOptions.delete(e),this.instances.delete(e)}async delete(){const e=Array.from(this.instances.values());await Promise.all([...e.filter(e=>"INTERNAL"in e).map(e=>e.INTERNAL.delete()),...e.filter(e=>"_delete"in e).map(e=>e._delete())])}isComponentSet(){return null!=this.component}isInitialized(e=k){return this.instances.has(e)}getOptions(e=k){return this.instancesOptions.get(e)||{}}initialize(e={}){const{options:t={}}=e,n=this.normalizeInstanceIdentifier(e.instanceIdentifier);if(this.isInitialized(n))throw Error(`${this.name}(${n}) has already been initialized`);if(!this.isComponentSet())throw Error(`Component ${this.name} has not been registered yet`);const a=this.getOrInitializeService({instanceIdentifier:n,options:t});for(const[e,t]of this.instancesDeferred.entries()){n===this.normalizeInstanceIdentifier(e)&&t.resolve(a)}return a}onInit(e,t){var n;const a=this.normalizeInstanceIdentifier(t),s=null!==(n=this.onInitCallbacks.get(a))&&void 0!==n?n:new Set;s.add(e),this.onInitCallbacks.set(a,s);const i=this.instances.get(a);return i&&e(i,a),()=>{s.delete(e)}}invokeOnInitCallbacks(e,t){const n=this.onInitCallbacks.get(t);if(n)for(const a of n)try{a(e,t)}catch(e){}}getOrInitializeService({instanceIdentifier:e,options:t={}}){let n=this.instances.get(e);if(!n&&this.component&&(n=this.component.instanceFactory(this.container,{instanceIdentifier:(a=e,a===k?void 0:a),options:t}),this.instances.set(e,n),this.instancesOptions.set(e,t),this.invokeOnInitCallbacks(n,e),this.component.onInstanceCreated))try{this.component.onInstanceCreated(this.container,e,n)}catch(e){}var a;return n||null}normalizeInstanceIdentifier(e=k){return this.component?this.component.multipleInstances?e:k:e}shouldAutoInitialize(){return!!this.component&&"EXPLICIT"!==this.component.instantiationMode}}class P{constructor(e){this.name=e,this.providers=new Map}addComponent(e){const t=this.getProvider(e.name);if(t.isComponentSet())throw new Error(`Component ${e.name} has already been registered with ${this.name}`);t.setComponent(e)}addOrOverwriteComponent(e){this.getProvider(e.name).isComponentSet()&&this.providers.delete(e.name),this.addComponent(e)}getProvider(e){if(this.providers.has(e))return this.providers.get(e);const t=new N(e,this);return this.providers.set(e,t),t}getProviders(){return Array.from(this.providers.values())}}const D=[];var I;!function(e){e[e.DEBUG=0]="DEBUG",e[e.VERBOSE=1]="VERBOSE",e[e.INFO=2]="INFO",e[e.WARN=3]="WARN",e[e.ERROR=4]="ERROR",e[e.SILENT=5]="SILENT"}(I||(I={}));const R={debug:I.DEBUG,verbose:I.VERBOSE,info:I.INFO,warn:I.WARN,error:I.ERROR,silent:I.SILENT},F=I.INFO,x={[I.DEBUG]:"log",[I.VERBOSE]:"log",[I.INFO]:"info",[I.WARN]:"warn",[I.ERROR]:"error"},O=(e,t,...n)=>{if(t<e.logLevel)return;const a=(new Date).toISOString(),s=x[t];if(!s)throw new Error(`Attempted to log a message with an invalid logType (value: ${t})`);console[s](`[${a}] ${e.name}:`,...n)};let L,U;const j=new WeakMap,B=new WeakMap,z=new WeakMap,q=new WeakMap,V=new WeakMap;let H={get(e,t,n){if(e instanceof IDBTransaction){if("done"===t)return B.get(e);if("objectStoreNames"===t)return e.objectStoreNames||z.get(e);if("store"===t)return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return K(e[t])},set(e,t,n){return e[t]=n,!0},has(e,t){return e instanceof IDBTransaction&&("done"===t||"store"===t)||t in e}};function W(e){return e!==IDBDatabase.prototype.transaction||"objectStoreNames"in IDBTransaction.prototype?(U||(U=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])).includes(e)?function(...t){return e.apply(Y(this),t),K(j.get(this))}:function(...t){return K(e.apply(Y(this),t))}:function(t,...n){const a=e.call(Y(this),t,...n);return z.set(a,t.sort?t.sort():[t]),K(a)}}function G(e){return"function"==typeof e?W(e):(e instanceof IDBTransaction&&function(e){if(B.has(e))return;const t=new Promise((t,n)=>{const a=()=>{e.removeEventListener("complete",s),e.removeEventListener("error",i),e.removeEventListener("abort",i)},s=()=>{t(),a()},i=()=>{n(e.error||new DOMException("AbortError","AbortError")),a()};e.addEventListener("complete",s),e.addEventListener("error",i),e.addEventListener("abort",i)});B.set(e,t)}(e),t=e,(L||(L=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])).some(e=>t instanceof e)?new Proxy(e,H):e);var t}function K(e){if(e instanceof IDBRequest)return function(e){const t=new Promise((t,n)=>{const a=()=>{e.removeEventListener("success",s),e.removeEventListener("error",i)},s=()=>{t(K(e.result)),a()},i=()=>{n(e.error),a()};e.addEventListener("success",s),e.addEventListener("error",i)});return t.then(t=>{t instanceof IDBCursor&&j.set(t,e)}).catch(()=>{}),V.set(t,e),t}(e);if(q.has(e))return q.get(e);const t=G(e);return t!==e&&(q.set(e,t),V.set(t,e)),t}const Y=e=>V.get(e);function Q(e,t,{blocked:n,upgrade:a,blocking:s,terminated:i}={}){const r=indexedDB.open(e,t),o=K(r);return a&&r.addEventListener("upgradeneeded",e=>{a(K(r.result),e.oldVersion,e.newVersion,K(r.transaction),e)}),n&&r.addEventListener("blocked",e=>n(e.oldVersion,e.newVersion,e)),o.then(e=>{i&&e.addEventListener("close",()=>i()),s&&e.addEventListener("versionchange",e=>s(e.oldVersion,e.newVersion,e))}).catch(()=>{}),o}function X(e,{blocked:t}={}){const n=indexedDB.deleteDatabase(e);return t&&n.addEventListener("blocked",e=>t(e.oldVersion,e)),K(n).then(()=>{})}const J=["get","getKey","getAll","getAllKeys","count"],Z=["put","add","delete","clear"],ee=new Map;function te(e,t){if(!(e instanceof IDBDatabase)||t in e||"string"!=typeof t)return;if(ee.get(t))return ee.get(t);const n=t.replace(/FromIndex$/,""),a=t!==n,s=Z.includes(n);if(!(n in(a?IDBIndex:IDBObjectStore).prototype)||!s&&!J.includes(n))return;const i=async function(e,...t){const i=this.transaction(e,s?"readwrite":"readonly");let r=i.store;return a&&(r=r.index(t.shift())),(await Promise.all([r[n](...t),s&&i.done]))[0]};return ee.set(t,i),i}H=(e=>({...e,get:(t,n,a)=>te(t,n)||e.get(t,n,a),has:(t,n)=>!!te(t,n)||e.has(t,n)}))(H);class ne{constructor(e){this.container=e}getPlatformInfoString(){return this.container.getProviders().map(e=>{if(function(e){const t=e.getComponent();return"VERSION"===(null==t?void 0:t.type)}(e)){const t=e.getImmediate();return`${t.library}/${t.version}`}return null}).filter(e=>e).join(" ")}}const ae="@firebase/app",se="0.13.2",ie=new class{constructor(e){this.name=e,this._logLevel=F,this._logHandler=O,this._userLogHandler=null,D.push(this)}get logLevel(){return this._logLevel}set logLevel(e){if(!(e in I))throw new TypeError(`Invalid value "${e}" assigned to \`logLevel\``);this._logLevel=e}setLogLevel(e){this._logLevel="string"==typeof e?R[e]:e}get logHandler(){return this._logHandler}set logHandler(e){if("function"!=typeof e)throw new TypeError("Value assigned to `logHandler` must be a function");this._logHandler=e}get userLogHandler(){return this._userLogHandler}set userLogHandler(e){this._userLogHandler=e}debug(...e){this._userLogHandler&&this._userLogHandler(this,I.DEBUG,...e),this._logHandler(this,I.DEBUG,...e)}log(...e){this._userLogHandler&&this._userLogHandler(this,I.VERBOSE,...e),this._logHandler(this,I.VERBOSE,...e)}info(...e){this._userLogHandler&&this._userLogHandler(this,I.INFO,...e),this._logHandler(this,I.INFO,...e)}warn(...e){this._userLogHandler&&this._userLogHandler(this,I.WARN,...e),this._logHandler(this,I.WARN,...e)}error(...e){this._userLogHandler&&this._userLogHandler(this,I.ERROR,...e),this._logHandler(this,I.ERROR,...e)}}("@firebase/app"),re="@firebase/app-compat",oe="@firebase/analytics-compat",de="@firebase/analytics",le="@firebase/app-check-compat",ce="@firebase/app-check",he="@firebase/auth",pe="@firebase/auth-compat",ue="@firebase/database",me="@firebase/data-connect",ge="@firebase/database-compat",fe="@firebase/functions",ve="@firebase/functions-compat",$e="@firebase/installations",be="@firebase/installations-compat",ye="@firebase/messaging",Ee="@firebase/messaging-compat",Ce="@firebase/performance",we="@firebase/performance-compat",Se="@firebase/remote-config",Me="@firebase/remote-config-compat",_e="@firebase/storage",Te="@firebase/storage-compat",Ae="@firebase/firestore",ke="@firebase/ai",Ne="@firebase/firestore-compat",Pe="firebase",De="[DEFAULT]",Ie={[ae]:"fire-core",[re]:"fire-core-compat",[de]:"fire-analytics",[oe]:"fire-analytics-compat",[ce]:"fire-app-check",[le]:"fire-app-check-compat",[he]:"fire-auth",[pe]:"fire-auth-compat",[ue]:"fire-rtdb",[me]:"fire-data-connect",[ge]:"fire-rtdb-compat",[fe]:"fire-fn",[ve]:"fire-fn-compat",[$e]:"fire-iid",[be]:"fire-iid-compat",[ye]:"fire-fcm",[Ee]:"fire-fcm-compat",[Ce]:"fire-perf",[we]:"fire-perf-compat",[Se]:"fire-rc",[Me]:"fire-rc-compat",[_e]:"fire-gcs",[Te]:"fire-gcs-compat",[Ae]:"fire-fst",[Ne]:"fire-fst-compat",[ke]:"fire-vertex","fire-js":"fire-js",[Pe]:"fire-js-all"},Re=new Map,Fe=new Map,xe=new Map;function Oe(e,t){try{e.container.addComponent(t)}catch(n){ie.debug(`Component ${t.name} failed to register with FirebaseApp ${e.name}`,n)}}function Le(e){const t=e.name;if(xe.has(t))return ie.debug(`There were multiple attempts to register component ${t}.`),!1;xe.set(t,e);for(const t of Re.values())Oe(t,e);for(const t of Fe.values())Oe(t,e);return!0}function Ue(e,t){const n=e.container.getProvider("heartbeat").getImmediate({optional:!0});return n&&n.triggerHeartbeat(),e.container.getProvider(t)}const je=new w("app","Firebase",{"no-app":"No Firebase App '{$appName}' has been created - call initializeApp() first","bad-app-name":"Illegal App name: '{$appName}'","duplicate-app":"Firebase App named '{$appName}' already exists with different options or config","app-deleted":"Firebase App named '{$appName}' already deleted","server-app-deleted":"Firebase Server App has been deleted","no-options":"Need to provide options, when not being deployed to hosting via source.","invalid-app-argument":"firebase.{$appName}() takes either no argument or a Firebase App instance.","invalid-log-argument":"First argument to `onLog` must be null or a function.","idb-open":"Error thrown when opening IndexedDB. Original error: {$originalErrorMessage}.","idb-get":"Error thrown when reading from IndexedDB. Original error: {$originalErrorMessage}.","idb-set":"Error thrown when writing to IndexedDB. Original error: {$originalErrorMessage}.","idb-delete":"Error thrown when deleting from IndexedDB. Original error: {$originalErrorMessage}.","finalization-registry-not-supported":"FirebaseServerApp deleteOnDeref field defined but the JS runtime does not support FinalizationRegistry.","invalid-server-app-environment":"FirebaseServerApp is not for use in browser environments."});class Be{constructor(e,t,n){this._isDeleted=!1,this._options=Object.assign({},e),this._config=Object.assign({},t),this._name=t.name,this._automaticDataCollectionEnabled=t.automaticDataCollectionEnabled,this._container=n,this.container.addComponent(new A("app",()=>this,"PUBLIC"))}get automaticDataCollectionEnabled(){return this.checkDestroyed(),this._automaticDataCollectionEnabled}set automaticDataCollectionEnabled(e){this.checkDestroyed(),this._automaticDataCollectionEnabled=e}get name(){return this.checkDestroyed(),this._name}get options(){return this.checkDestroyed(),this._options}get config(){return this.checkDestroyed(),this._config}get container(){return this._container}get isDeleted(){return this._isDeleted}set isDeleted(e){this._isDeleted=e}checkDestroyed(){if(this.isDeleted)throw je.create("app-deleted",{appName:this._name})}}function ze(e,t={}){let n=e;if("object"!=typeof t){t={name:t}}const a=Object.assign({name:De,automaticDataCollectionEnabled:!0},t),s=a.name;if("string"!=typeof s||!s)throw je.create("bad-app-name",{appName:String(s)});if(n||(n=$()),!n)throw je.create("no-options");const i=Re.get(s);if(i){if(M(n,i.options)&&M(a,i.config))return i;throw je.create("duplicate-app",{appName:s})}const r=new P(s);for(const e of xe.values())r.addComponent(e);const o=new Be(n,a,r);return Re.set(s,o),o}function qe(e,t,n){var a;let s=null!==(a=Ie[e])&&void 0!==a?a:e;n&&(s+=`-${n}`);const i=s.match(/\s|\//),r=t.match(/\s|\//);if(i||r){const e=[`Unable to register library "${s}" with version "${t}":`];return i&&e.push(`library name "${s}" contains illegal characters (whitespace or "/")`),i&&r&&e.push("and"),r&&e.push(`version name "${t}" contains illegal characters (whitespace or "/")`),void ie.warn(e.join(" "))}Le(new A(`${s}-version`,()=>({library:s,version:t}),"VERSION"))}const Ve="firebase-heartbeat-store";let He=null;function We(){return He||(He=Q("firebase-heartbeat-database",1,{upgrade:(e,t)=>{if(0===t)try{e.createObjectStore(Ve)}catch(e){console.warn(e)}}}).catch(e=>{throw je.create("idb-open",{originalErrorMessage:e.message})})),He}async function Ge(e,t){try{const n=(await We()).transaction(Ve,"readwrite"),a=n.objectStore(Ve);await a.put(t,Ke(e)),await n.done}catch(e){if(e instanceof C)ie.warn(e.message);else{const t=je.create("idb-set",{originalErrorMessage:null==e?void 0:e.message});ie.warn(t.message)}}}function Ke(e){return`${e.name}!${e.options.appId}`}class Ye{constructor(e){this.container=e,this._heartbeatsCache=null;const t=this.container.getProvider("app").getImmediate();this._storage=new Xe(t),this._heartbeatsCachePromise=this._storage.read().then(e=>(this._heartbeatsCache=e,e))}async triggerHeartbeat(){var e,t;try{const n=this.container.getProvider("platform-logger").getImmediate().getPlatformInfoString(),a=Qe();if(null==(null===(e=this._heartbeatsCache)||void 0===e?void 0:e.heartbeats)&&(this._heartbeatsCache=await this._heartbeatsCachePromise,null==(null===(t=this._heartbeatsCache)||void 0===t?void 0:t.heartbeats)))return;if(this._heartbeatsCache.lastSentHeartbeatDate===a||this._heartbeatsCache.heartbeats.some(e=>e.date===a))return;if(this._heartbeatsCache.heartbeats.push({date:a,agent:n}),this._heartbeatsCache.heartbeats.length>30){const e=function(e){if(0===e.length)return-1;let t=0,n=e[0].date;for(let a=1;a<e.length;a++)e[a].date<n&&(n=e[a].date,t=a);return t}(this._heartbeatsCache.heartbeats);this._heartbeatsCache.heartbeats.splice(e,1)}return this._storage.overwrite(this._heartbeatsCache)}catch(e){ie.warn(e)}}async getHeartbeatsHeader(){var e;try{if(null===this._heartbeatsCache&&await this._heartbeatsCachePromise,null==(null===(e=this._heartbeatsCache)||void 0===e?void 0:e.heartbeats)||0===this._heartbeatsCache.heartbeats.length)return"";const t=Qe(),{heartbeatsToSend:n,unsentEntries:a}=function(e,t=1024){const n=[];let a=e.slice();for(const s of e){const e=n.find(e=>e.agent===s.agent);if(e){if(e.dates.push(s.date),Je(n)>t){e.dates.pop();break}}else if(n.push({agent:s.agent,dates:[s.date]}),Je(n)>t){n.pop();break}a=a.slice(1)}return{heartbeatsToSend:n,unsentEntries:a}}(this._heartbeatsCache.heartbeats),s=m(JSON.stringify({version:2,heartbeats:n}));return this._heartbeatsCache.lastSentHeartbeatDate=t,a.length>0?(this._heartbeatsCache.heartbeats=a,await this._storage.overwrite(this._heartbeatsCache)):(this._heartbeatsCache.heartbeats=[],this._storage.overwrite(this._heartbeatsCache)),s}catch(e){return ie.warn(e),""}}}function Qe(){return(new Date).toISOString().substring(0,10)}class Xe{constructor(e){this.app=e,this._canUseIndexedDBPromise=this.runIndexedDBEnvironmentCheck()}async runIndexedDBEnvironmentCheck(){return!!y()&&E().then(()=>!0).catch(()=>!1)}async read(){if(await this._canUseIndexedDBPromise){const e=await async function(e){try{const t=(await We()).transaction(Ve),n=await t.objectStore(Ve).get(Ke(e));return await t.done,n}catch(e){if(e instanceof C)ie.warn(e.message);else{const t=je.create("idb-get",{originalErrorMessage:null==e?void 0:e.message});ie.warn(t.message)}}}(this.app);return(null==e?void 0:e.heartbeats)?e:{heartbeats:[]}}return{heartbeats:[]}}async overwrite(e){var t;if(await this._canUseIndexedDBPromise){const n=await this.read();return Ge(this.app,{lastSentHeartbeatDate:null!==(t=e.lastSentHeartbeatDate)&&void 0!==t?t:n.lastSentHeartbeatDate,heartbeats:e.heartbeats})}}async add(e){var t;if(await this._canUseIndexedDBPromise){const n=await this.read();return Ge(this.app,{lastSentHeartbeatDate:null!==(t=e.lastSentHeartbeatDate)&&void 0!==t?t:n.lastSentHeartbeatDate,heartbeats:[...n.heartbeats,...e.heartbeats]})}}}function Je(e){return m(JSON.stringify({version:2,heartbeats:e})).length}var Ze;Ze="",Le(new A("platform-logger",e=>new ne(e),"PRIVATE")),Le(new A("heartbeat",e=>new Ye(e),"PRIVATE")),qe(ae,se,Ze),qe(ae,se,"esm2017"),qe("fire-js","");qe("firebase","11.10.0","app");const et="@firebase/installations",tt="0.6.18",nt=1e4,at=`w:${tt}`,st="FIS_v2",it=36e5,rt=new w("installations","Installations",{"missing-app-config-values":'Missing App configuration value: "{$valueName}"',"not-registered":"Firebase Installation is not registered.","installation-not-found":"Firebase Installation not found.","request-failed":'{$requestName} request failed with error "{$serverCode} {$serverStatus}: {$serverMessage}"',"app-offline":"Could not process request. Application offline.","delete-pending-registration":"Can't delete installation while there is a pending registration request."});function ot(e){return e instanceof C&&e.code.includes("request-failed")}function dt({projectId:e}){return`https://firebaseinstallations.googleapis.com/v1/projects/${e}/installations`}function lt(e){return{token:e.token,requestStatus:2,expiresIn:(t=e.expiresIn,Number(t.replace("s","000"))),creationTime:Date.now()};var t}async function ct(e,t){const n=(await t.json()).error;return rt.create("request-failed",{requestName:e,serverCode:n.code,serverMessage:n.message,serverStatus:n.status})}function ht({apiKey:e}){return new Headers({"Content-Type":"application/json",Accept:"application/json","x-goog-api-key":e})}function pt(e,{refreshToken:t}){const n=ht(e);return n.append("Authorization",function(e){return`${st} ${e}`}(t)),n}async function ut(e){const t=await e();return t.status>=500&&t.status<600?e():t}function mt(e){return new Promise(t=>{setTimeout(t,e)})}const gt=/^[cdef][\w-]{21}$/;function ft(){try{const e=new Uint8Array(17);(self.crypto||self.msCrypto).getRandomValues(e),e[0]=112+e[0]%16;const t=function(e){const t=(n=e,btoa(String.fromCharCode(...n)).replace(/\+/g,"-").replace(/\//g,"_"));var n;return t.substr(0,22)}(e);return gt.test(t)?t:""}catch(e){return""}}function vt(e){return`${e.appName}!${e.appId}`}const $t=new Map;function bt(e,t){const n=vt(e);yt(n,t),function(e,t){const n=Ct();n&&n.postMessage({key:e,fid:t});wt()}(n,t)}function yt(e,t){const n=$t.get(e);if(n)for(const e of n)e(t)}let Et=null;function Ct(){return!Et&&"BroadcastChannel"in self&&(Et=new BroadcastChannel("[Firebase] FID Change"),Et.onmessage=e=>{yt(e.data.key,e.data.fid)}),Et}function wt(){0===$t.size&&Et&&(Et.close(),Et=null)}const St="firebase-installations-store";let Mt=null;function _t(){return Mt||(Mt=Q("firebase-installations-database",1,{upgrade:(e,t)=>{if(0===t)e.createObjectStore(St)}})),Mt}async function Tt(e,t){const n=vt(e),a=(await _t()).transaction(St,"readwrite"),s=a.objectStore(St),i=await s.get(n);return await s.put(t,n),await a.done,i&&i.fid===t.fid||bt(e,t.fid),t}async function At(e){const t=vt(e),n=(await _t()).transaction(St,"readwrite");await n.objectStore(St).delete(t),await n.done}async function kt(e,t){const n=vt(e),a=(await _t()).transaction(St,"readwrite"),s=a.objectStore(St),i=await s.get(n),r=t(i);return void 0===r?await s.delete(n):await s.put(r,n),await a.done,!r||i&&i.fid===r.fid||bt(e,r.fid),r}async function Nt(e){let t;const n=await kt(e.appConfig,n=>{const a=function(e){const t=e||{fid:ft(),registrationStatus:0};return It(t)}(n),s=function(e,t){if(0===t.registrationStatus){if(!navigator.onLine){return{installationEntry:t,registrationPromise:Promise.reject(rt.create("app-offline"))}}const n={fid:t.fid,registrationStatus:1,registrationTime:Date.now()},a=async function(e,t){try{const n=await async function({appConfig:e,heartbeatServiceProvider:t},{fid:n}){const a=dt(e),s=ht(e),i=t.getImmediate({optional:!0});if(i){const e=await i.getHeartbeatsHeader();e&&s.append("x-firebase-client",e)}const r={fid:n,authVersion:st,appId:e.appId,sdkVersion:at},o={method:"POST",headers:s,body:JSON.stringify(r)},d=await ut(()=>fetch(a,o));if(d.ok){const e=await d.json();return{fid:e.fid||n,registrationStatus:2,refreshToken:e.refreshToken,authToken:lt(e.authToken)}}throw await ct("Create Installation",d)}(e,t);return Tt(e.appConfig,n)}catch(n){throw ot(n)&&409===n.customData.serverCode?await At(e.appConfig):await Tt(e.appConfig,{fid:t.fid,registrationStatus:0}),n}}(e,n);return{installationEntry:n,registrationPromise:a}}return 1===t.registrationStatus?{installationEntry:t,registrationPromise:Pt(e)}:{installationEntry:t}}(e,a);return t=s.registrationPromise,s.installationEntry});return""===n.fid?{installationEntry:await t}:{installationEntry:n,registrationPromise:t}}async function Pt(e){let t=await Dt(e.appConfig);for(;1===t.registrationStatus;)await mt(100),t=await Dt(e.appConfig);if(0===t.registrationStatus){const{installationEntry:t,registrationPromise:n}=await Nt(e);return n||t}return t}function Dt(e){return kt(e,e=>{if(!e)throw rt.create("installation-not-found");return It(e)})}function It(e){return 1===(t=e).registrationStatus&&t.registrationTime+nt<Date.now()?{fid:e.fid,registrationStatus:0}:e;var t}async function Rt({appConfig:e,heartbeatServiceProvider:t},n){const a=function(e,{fid:t}){return`${dt(e)}/${t}/authTokens:generate`}(e,n),s=pt(e,n),i=t.getImmediate({optional:!0});if(i){const e=await i.getHeartbeatsHeader();e&&s.append("x-firebase-client",e)}const r={installation:{sdkVersion:at,appId:e.appId}},o={method:"POST",headers:s,body:JSON.stringify(r)},d=await ut(()=>fetch(a,o));if(d.ok){return lt(await d.json())}throw await ct("Generate Auth Token",d)}async function Ft(e,t=!1){let n;const a=await kt(e.appConfig,a=>{if(!Ot(a))throw rt.create("not-registered");const s=a.authToken;if(!t&&function(e){return 2===e.requestStatus&&!function(e){const t=Date.now();return t<e.creationTime||e.creationTime+e.expiresIn<t+it}(e)}(s))return a;if(1===s.requestStatus)return n=async function(e,t){let n=await xt(e.appConfig);for(;1===n.authToken.requestStatus;)await mt(100),n=await xt(e.appConfig);const a=n.authToken;return 0===a.requestStatus?Ft(e,t):a}(e,t),a;{if(!navigator.onLine)throw rt.create("app-offline");const t=function(e){const t={requestStatus:1,requestTime:Date.now()};return Object.assign(Object.assign({},e),{authToken:t})}(a);return n=async function(e,t){try{const n=await Rt(e,t),a=Object.assign(Object.assign({},t),{authToken:n});return await Tt(e.appConfig,a),n}catch(n){if(!ot(n)||401!==n.customData.serverCode&&404!==n.customData.serverCode){const n=Object.assign(Object.assign({},t),{authToken:{requestStatus:0}});await Tt(e.appConfig,n)}else await At(e.appConfig);throw n}}(e,t),t}});return n?await n:a.authToken}function xt(e){return kt(e,e=>{if(!Ot(e))throw rt.create("not-registered");const t=e.authToken;return 1===(n=t).requestStatus&&n.requestTime+nt<Date.now()?Object.assign(Object.assign({},e),{authToken:{requestStatus:0}}):e;var n})}function Ot(e){return void 0!==e&&2===e.registrationStatus}async function Lt(e,t=!1){const n=e;await async function(e){const{registrationPromise:t}=await Nt(e);t&&await t}(n);return(await Ft(n,t)).token}function Ut(e){return rt.create("missing-app-config-values",{valueName:e})}const jt="installations",Bt=e=>{const t=Ue(e.getProvider("app").getImmediate(),jt).getImmediate();return{getId:()=>async function(e){const t=e,{installationEntry:n,registrationPromise:a}=await Nt(t);return a?a.catch(console.error):Ft(t).catch(console.error),n.fid}(t),getToken:e=>Lt(t,e)}};Le(new A(jt,e=>{const t=e.getProvider("app").getImmediate(),n=function(e){if(!e||!e.options)throw Ut("App Configuration");if(!e.name)throw Ut("App Name");const t=["projectId","apiKey","appId"];for(const n of t)if(!e.options[n])throw Ut(n);return{appName:e.name,projectId:e.options.projectId,apiKey:e.options.apiKey,appId:e.options.appId}}(t);return{app:t,appConfig:n,heartbeatServiceProvider:Ue(t,"heartbeat"),_delete:()=>Promise.resolve()}},"PUBLIC")),Le(new A("installations-internal",Bt,"PRIVATE")),qe(et,tt),qe(et,tt,"esm2017");const zt="BDOU99-h67HcA6JeFXHbSNMu7e2yNNu3RzoMj8TM4W88jITfq7ZmPvIM1Iv-4_l2LxQcYwhqby2xGpWwzjfAnG4",qt="google.c.a.c_id",Vt=1e4;var Ht,Wt;function Gt(e){const t=new Uint8Array(e);return btoa(String.fromCharCode(...t)).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function Kt(e){const t=(e+"=".repeat((4-e.length%4)%4)).replace(/\-/g,"+").replace(/_/g,"/"),n=atob(t),a=new Uint8Array(n.length);for(let e=0;e<n.length;++e)a[e]=n.charCodeAt(e);return a}!function(e){e[e.DATA_MESSAGE=1]="DATA_MESSAGE",e[e.DISPLAY_NOTIFICATION=3]="DISPLAY_NOTIFICATION"}(Ht||(Ht={})),function(e){e.PUSH_RECEIVED="push-received",e.NOTIFICATION_CLICKED="notification-clicked"}(Wt||(Wt={}));const Yt="fcm_token_details_db",Qt="fcm_token_object_Store";const Xt="firebase-messaging-store";let Jt=null;function Zt(){return Jt||(Jt=Q("firebase-messaging-database",1,{upgrade:(e,t)=>{if(0===t)e.createObjectStore(Xt)}})),Jt}async function en(e){const t=nn(e),n=await Zt(),a=await n.transaction(Xt).objectStore(Xt).get(t);if(a)return a;{const t=await async function(e){if("databases"in indexedDB){const e=(await indexedDB.databases()).map(e=>e.name);if(!e.includes(Yt))return null}let t=null;return(await Q(Yt,5,{upgrade:async(n,a,s,i)=>{var r;if(a<2)return;if(!n.objectStoreNames.contains(Qt))return;const o=i.objectStore(Qt),d=await o.index("fcmSenderId").get(e);if(await o.clear(),d)if(2===a){const e=d;if(!e.auth||!e.p256dh||!e.endpoint)return;t={token:e.fcmToken,createTime:null!==(r=e.createTime)&&void 0!==r?r:Date.now(),subscriptionOptions:{auth:e.auth,p256dh:e.p256dh,endpoint:e.endpoint,swScope:e.swScope,vapidKey:"string"==typeof e.vapidKey?e.vapidKey:Gt(e.vapidKey)}}}else if(3===a){const e=d;t={token:e.fcmToken,createTime:e.createTime,subscriptionOptions:{auth:Gt(e.auth),p256dh:Gt(e.p256dh),endpoint:e.endpoint,swScope:e.swScope,vapidKey:Gt(e.vapidKey)}}}else if(4===a){const e=d;t={token:e.fcmToken,createTime:e.createTime,subscriptionOptions:{auth:Gt(e.auth),p256dh:Gt(e.p256dh),endpoint:e.endpoint,swScope:e.swScope,vapidKey:Gt(e.vapidKey)}}}}})).close(),await X(Yt),await X("fcm_vapid_details_db"),await X("undefined"),function(e){if(!e||!e.subscriptionOptions)return!1;const{subscriptionOptions:t}=e;return"number"==typeof e.createTime&&e.createTime>0&&"string"==typeof e.token&&e.token.length>0&&"string"==typeof t.auth&&t.auth.length>0&&"string"==typeof t.p256dh&&t.p256dh.length>0&&"string"==typeof t.endpoint&&t.endpoint.length>0&&"string"==typeof t.swScope&&t.swScope.length>0&&"string"==typeof t.vapidKey&&t.vapidKey.length>0}(t)?t:null}(e.appConfig.senderId);if(t)return await tn(e,t),t}}async function tn(e,t){const n=nn(e),a=(await Zt()).transaction(Xt,"readwrite");return await a.objectStore(Xt).put(t,n),await a.done,t}function nn({appConfig:e}){return e.appId}const an=new w("messaging","Messaging",{"missing-app-config-values":'Missing App configuration value: "{$valueName}"',"only-available-in-window":"This method is available in a Window context.","only-available-in-sw":"This method is available in a service worker context.","permission-default":"The notification permission was not granted and dismissed instead.","permission-blocked":"The notification permission was not granted and blocked instead.","unsupported-browser":"This browser doesn't support the API's required to use the Firebase SDK.","indexed-db-unsupported":"This browser doesn't support indexedDb.open() (ex. Safari iFrame, Firefox Private Browsing, etc)","failed-service-worker-registration":"We are unable to register the default service worker. {$browserErrorMessage}","token-subscribe-failed":"A problem occurred while subscribing the user to FCM: {$errorInfo}","token-subscribe-no-token":"FCM returned no token when subscribing the user to push.","token-unsubscribe-failed":"A problem occurred while unsubscribing the user from FCM: {$errorInfo}","token-update-failed":"A problem occurred while updating the user from FCM: {$errorInfo}","token-update-no-token":"FCM returned no token when updating the user to push.","use-sw-after-get-token":"The useServiceWorker() method may only be called once and must be called before calling getToken() to ensure your service worker is used.","invalid-sw-registration":"The input to useServiceWorker() must be a ServiceWorkerRegistration.","invalid-bg-handler":"The input to setBackgroundMessageHandler() must be a function.","invalid-vapid-key":"The public VAPID key must be a string.","use-vapid-key-after-get-token":"The usePublicVapidKey() method may only be called once and must be called before calling getToken() to ensure your VAPID key is used."});async function sn(e,t){const n={method:"DELETE",headers:await on(e)};try{const a=await fetch(`${rn(e.appConfig)}/${t}`,n),s=await a.json();if(s.error){const e=s.error.message;throw an.create("token-unsubscribe-failed",{errorInfo:e})}}catch(e){throw an.create("token-unsubscribe-failed",{errorInfo:null==e?void 0:e.toString()})}}function rn({projectId:e}){return`https://fcmregistrations.googleapis.com/v1/projects/${e}/registrations`}async function on({appConfig:e,installations:t}){const n=await t.getToken();return new Headers({"Content-Type":"application/json",Accept:"application/json","x-goog-api-key":e.apiKey,"x-goog-firebase-installations-auth":`FIS ${n}`})}function dn({p256dh:e,auth:t,endpoint:n,vapidKey:a}){const s={web:{endpoint:n,auth:t,p256dh:e}};return a!==zt&&(s.web.applicationPubKey=a),s}async function ln(e){const t=await async function(e,t){const n=await e.pushManager.getSubscription();if(n)return n;return e.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:Kt(t)})}(e.swRegistration,e.vapidKey),n={vapidKey:e.vapidKey,swScope:e.swRegistration.scope,endpoint:t.endpoint,auth:Gt(t.getKey("auth")),p256dh:Gt(t.getKey("p256dh"))},a=await en(e.firebaseDependencies);if(a){if(function(e,t){const n=t.vapidKey===e.vapidKey,a=t.endpoint===e.endpoint,s=t.auth===e.auth,i=t.p256dh===e.p256dh;return n&&a&&s&&i}(a.subscriptionOptions,n))return Date.now()>=a.createTime+6048e5?async function(e,t){try{const n=await async function(e,t){const n=await on(e),a=dn(t.subscriptionOptions),s={method:"PATCH",headers:n,body:JSON.stringify(a)};let i;try{const n=await fetch(`${rn(e.appConfig)}/${t.token}`,s);i=await n.json()}catch(e){throw an.create("token-update-failed",{errorInfo:null==e?void 0:e.toString()})}if(i.error){const e=i.error.message;throw an.create("token-update-failed",{errorInfo:e})}if(!i.token)throw an.create("token-update-no-token");return i.token}(e.firebaseDependencies,t),a=Object.assign(Object.assign({},t),{token:n,createTime:Date.now()});return await tn(e.firebaseDependencies,a),n}catch(e){throw e}}(e,{token:a.token,createTime:Date.now(),subscriptionOptions:n}):a.token;try{await sn(e.firebaseDependencies,a.token)}catch(e){console.warn(e)}return hn(e.firebaseDependencies,n)}return hn(e.firebaseDependencies,n)}async function cn(e){const t=await en(e.firebaseDependencies);t&&(await sn(e.firebaseDependencies,t.token),await async function(e){const t=nn(e),n=(await Zt()).transaction(Xt,"readwrite");await n.objectStore(Xt).delete(t),await n.done}(e.firebaseDependencies));const n=await e.swRegistration.pushManager.getSubscription();return!n||n.unsubscribe()}async function hn(e,t){const n=await async function(e,t){const n=await on(e),a=dn(t),s={method:"POST",headers:n,body:JSON.stringify(a)};let i;try{const t=await fetch(rn(e.appConfig),s);i=await t.json()}catch(e){throw an.create("token-subscribe-failed",{errorInfo:null==e?void 0:e.toString()})}if(i.error){const e=i.error.message;throw an.create("token-subscribe-failed",{errorInfo:e})}if(!i.token)throw an.create("token-subscribe-no-token");return i.token}(e,t),a={token:n,createTime:Date.now(),subscriptionOptions:t};return await tn(e,a),a.token}function pn(e){const t={from:e.from,collapseKey:e.collapse_key,messageId:e.fcmMessageId};return function(e,t){if(!t.notification)return;e.notification={};const n=t.notification.title;n&&(e.notification.title=n);const a=t.notification.body;a&&(e.notification.body=a);const s=t.notification.image;s&&(e.notification.image=s);const i=t.notification.icon;i&&(e.notification.icon=i)}(t,e),function(e,t){if(!t.data)return;e.data=t.data}(t,e),function(e,t){var n,a,s,i,r;if(!t.fcmOptions&&!(null===(n=t.notification)||void 0===n?void 0:n.click_action))return;e.fcmOptions={};const o=null!==(s=null===(a=t.fcmOptions)||void 0===a?void 0:a.link)&&void 0!==s?s:null===(i=t.notification)||void 0===i?void 0:i.click_action;o&&(e.fcmOptions.link=o);const d=null===(r=t.fcmOptions)||void 0===r?void 0:r.analytics_label;d&&(e.fcmOptions.analyticsLabel=d)}(t,e),t}function un(e){return an.create("missing-app-config-values",{valueName:e})}!function(e,t){const n=[];for(let a=0;a<e.length;a++)n.push(e.charAt(a)),a<t.length&&n.push(t.charAt(a));n.join("")}("AzSCbw63g1R0nCw85jG8","Iaya3yLKwmgvh7cF0q4");class mn{constructor(e,t,n){this.deliveryMetricsExportedToBigQueryEnabled=!1,this.onBackgroundMessageHandler=null,this.onMessageHandler=null,this.logEvents=[],this.isLogServiceStarted=!1;const a=function(e){if(!e||!e.options)throw un("App Configuration Object");if(!e.name)throw un("App Name");const t=["projectId","apiKey","appId","messagingSenderId"],{options:n}=e;for(const e of t)if(!n[e])throw un(e);return{appName:e.name,projectId:n.projectId,apiKey:n.apiKey,appId:n.appId,senderId:n.messagingSenderId}}(e);this.firebaseDependencies={app:e,appConfig:a,installations:t,analyticsProvider:n}}_delete(){return Promise.resolve()}}async function gn(e){try{e.swRegistration=await navigator.serviceWorker.register("/firebase-messaging-sw.js",{scope:"/firebase-cloud-messaging-push-scope"}),e.swRegistration.update().catch(()=>{}),await async function(e){return new Promise((t,n)=>{const a=setTimeout(()=>n(new Error("Service worker not registered after 10000 ms")),Vt),s=e.installing||e.waiting;e.active?(clearTimeout(a),t()):s?s.onstatechange=e=>{var n;"activated"===(null===(n=e.target)||void 0===n?void 0:n.state)&&(s.onstatechange=null,clearTimeout(a),t())}:(clearTimeout(a),n(new Error("No incoming service worker found.")))})}(e.swRegistration)}catch(e){throw an.create("failed-service-worker-registration",{browserErrorMessage:null==e?void 0:e.message})}}async function fn(e,t){if(!navigator)throw an.create("only-available-in-window");if("default"===Notification.permission&&await Notification.requestPermission(),"granted"!==Notification.permission)throw an.create("permission-blocked");return await async function(e,t){t?e.vapidKey=t:e.vapidKey||(e.vapidKey=zt)}(e,null==t?void 0:t.vapidKey),await async function(e,t){if(t||e.swRegistration||await gn(e),t||!e.swRegistration){if(!(t instanceof ServiceWorkerRegistration))throw an.create("invalid-sw-registration");e.swRegistration=t}}(e,null==t?void 0:t.serviceWorkerRegistration),ln(e)}async function vn(e,t,n){const a=function(e){switch(e){case Wt.NOTIFICATION_CLICKED:return"notification_open";case Wt.PUSH_RECEIVED:return"notification_foreground";default:throw new Error}}(t);(await e.firebaseDependencies.analyticsProvider.get()).logEvent(a,{message_id:n[qt],message_name:n["google.c.a.c_l"],message_time:n["google.c.a.ts"],message_device_time:Math.floor(Date.now()/1e3)})}async function $n(e,t){const n=t.data;if(!n.isFirebaseMessaging)return;e.onMessageHandler&&n.messageType===Wt.PUSH_RECEIVED&&("function"==typeof e.onMessageHandler?e.onMessageHandler(pn(n)):e.onMessageHandler.next(pn(n)));const a=n.data;var s;"object"==typeof(s=a)&&s&&qt in s&&"1"===a["google.c.a.e"]&&await vn(e,n.messageType,a)}const bn="@firebase/messaging",yn="0.12.22",En=e=>{const t=e.getProvider("messaging").getImmediate();return{getToken:e=>fn(t,e)}};async function Cn(){try{await E()}catch(e){return!1}return"undefined"!=typeof window&&y()&&!("undefined"==typeof navigator||!navigator.cookieEnabled)&&"serviceWorker"in navigator&&"PushManager"in window&&"Notification"in window&&"fetch"in window&&ServiceWorkerRegistration.prototype.hasOwnProperty("showNotification")&&PushSubscription.prototype.hasOwnProperty("getKey")}function wn(e=function(e=De){const t=Re.get(e);if(!t&&e===De&&$())return ze();if(!t)throw je.create("no-app",{appName:e});return t}()){return Cn().then(e=>{if(!e)throw an.create("unsupported-browser")},e=>{throw an.create("indexed-db-unsupported")}),Ue(T(e),"messaging").getImmediate()}async function Sn(e,t){return fn(e=T(e),t)}function Mn(e){return async function(e){if(!navigator)throw an.create("only-available-in-window");return e.swRegistration||await gn(e),cn(e)}(e=T(e))}function _n(e,t){return function(e,t){if(!navigator)throw an.create("only-available-in-window");return e.onMessageHandler=t,()=>{e.onMessageHandler=null}}(e=T(e),t)}Le(new A("messaging",e=>{const t=new mn(e.getProvider("app").getImmediate(),e.getProvider("installations-internal").getImmediate(),e.getProvider("analytics-internal"));return navigator.serviceWorker.addEventListener("message",e=>$n(t,e)),t},"PUBLIC")),Le(new A("messaging-internal",En,"PRIVATE")),qe(bn,yn),qe(bn,yn,"esm2017");var Tn=r(4532);class An extends d().PureComponent{render(){return d().createElement("div",{className:"alert-container"},d().createElement("div",{className:"alert"},d().createElement("div",{className:"title"},this.props.title),d().createElement("div",{className:"content"},this.props.content),d().createElement("div",{className:"dialog-buttons"},this.props.onReject?d().createElement("button",{className:"outline",onClick:this.props.onReject},this.props.reject||d().createElement(c.FormattedMessage,{id:"button_cancel",defaultMessage:[{type:0,value:"Cancel"}]})):null,this.props.onConfirm?d().createElement("button",{className:"primary",onClick:this.props.onConfirm},this.props.confirm||d().createElement(c.FormattedMessage,{id:"button_ok",defaultMessage:[{type:0,value:"OK"}]})):null)))}}var kn=r(9027);const Nn=(0,c.defineMessages)({info:{id:"menu_item_info",defaultMessage:[{type:0,value:"Info"}]},clear_messages:{id:"menu_item_clear_messages",defaultMessage:[{type:0,value:"Clear messages"}]},clear_for_all:{id:"menu_item_clear_messages_for_all",defaultMessage:[{type:0,value:"Clear for All"}]},delete:{id:"menu_item_delete",defaultMessage:[{type:0,value:"Delete"}]},delete_for_all:{id:"menu_item_delete_for_all",defaultMessage:[{type:0,value:"Delete for All"}]},send_retry:{id:"menu_item_send_retry",defaultMessage:[{type:0,value:"Retry"}]},mute:{id:"menu_item_mute",defaultMessage:[{type:0,value:"Mute"}]},unmute:{id:"menu_item_unmute",defaultMessage:[{type:0,value:"Unmute"}]},reply:{id:"menu_item_reply",defaultMessage:[{type:0,value:"Reply"}]},forward:{id:"menu_item_forward",defaultMessage:[{type:0,value:"Forward"}]},edit:{id:"menu_item_edit",defaultMessage:[{type:0,value:"Edit"}]},topic_delete:{id:"menu_item_delete_topic",defaultMessage:[{type:0,value:"Delete"}]},topic_delete_warning:{id:"topic_delete_warning",defaultMessage:[{type:0,value:"Are you sure you want to delete this conversation? It cannot be undone."}]},delete_messages_warning:{id:"delete_messages_warning",defaultMessage:[{type:0,value:"Are you sure you want to delete all messages for everyone? It cannot be undone."}]},unblock:{id:"menu_item_unblock",defaultMessage:[{type:0,value:"Unblock"}]},block:{id:"menu_item_block",defaultMessage:[{type:0,value:"Block"}]},topic_block_warning:{id:"topic_block_warning",defaultMessage:[{type:0,value:"Are you sure you want to block this conversation?"}]},member_delete:{id:"menu_item_member_delete",defaultMessage:[{type:0,value:"Remove"}]},archive:{id:"menu_item_archive_topic",defaultMessage:[{type:0,value:"Archive"}]},unarchive:{id:"menu_item_restore_topic",defaultMessage:[{type:0,value:"Restore"}]},edit_permissions:{id:"menu_item_edit_permissions",defaultMessage:[{type:0,value:"Edit permissions"}]},clear_messages_warning:{id:"clear_messages_warning",defaultMessage:[{type:0,value:"Are you sure you want to clear all messages? It cannot be undone."}]},pin_message:{id:"pin_message",defaultMessage:[{type:0,value:"Pin"}]},unpin_message:{id:"unpin_message",defaultMessage:[{type:0,value:"Unpin"}]},pin_chat:{id:"pin_chat",defaultMessage:[{type:0,value:"Pin"}]},unpin_chat:{id:"unpin_chat",defaultMessage:[{type:0,value:"Unpin"}]}});class Pn extends d().Component{constructor(e){super(e),this.selfRef=d().createRef();const{formatMessage:t}=e.intl;this.handlePageClick=this.handlePageClick.bind(this),this.handleEscapeKey=this.handleEscapeKey.bind(this),this.handleClick=this.handleClick.bind(this),this.MenuItems={topic_info:{id:"topic_info",title:t(Nn.info),handler:null},messages_clear:{id:"messages_clear",title:t(Nn.clear_messages),handler:(n,a)=>e.onShowAlert(n.topicTitle||t(Nn.clear_messages),t(Nn.clear_messages_warning),e=>{this.deleteMessages(!0,!1,n,a)},null,!0,null)},messages_clear_hard:{id:"messages_clear_hard",title:t(Nn.clear_for_all),handler:(n,a)=>e.onShowAlert(n.topicTitle||t(Nn.clear_for_all),t(Nn.delete_messages_warning),e=>this.deleteMessages(!0,!0,n,a),null,!0,null)},message_delete:{id:"message_delete",title:t(Nn.delete),handler:(e,t)=>this.deleteMessages(!1,!1,e,t)},message_delete_hard:{id:"message_delete_hard",title:t(Nn.delete_for_all),handler:(e,t)=>this.deleteMessages(!1,!0,e,t)},message_delete_generic:{id:"message_delete_generic",title:t(Nn.delete),handler:(e,t)=>this.deleteMessages(!1,!0,e,t)},menu_item_send_retry:{id:"menu_item_send_retry",title:t(Nn.send_retry),handler:(e,t)=>this.retryMessage(e,t)},menu_item_reply:{id:"menu_item_reply",title:t(Nn.reply),handler:(e,t)=>this.replyToMessage(e,t)},menu_item_forward:{id:"menu_item_forward",title:t(Nn.forward),handler:e=>{}},menu_item_edit:{id:"menu_item_edit",title:t(Nn.edit),handler:(e,t)=>this.editMessage(e,t)},menu_item_pin:{id:"menu_item_pin",title:t(Nn.pin_message),handler:(e,t)=>this.pinMessage(!0,e,t)},menu_item_unpin:{id:"menu_item_unpin",title:t(Nn.unpin_message),handler:(e,t)=>this.pinMessage(!1,e,t)},topic_unmute:{id:"topic_unmute",title:t(Nn.unmute),handler:this.topicPermissionSetter.bind(this,"+P")},topic_mute:{id:"topic_mute",title:t(Nn.mute),handler:this.topicPermissionSetter.bind(this,"-P")},topic_unblock:{id:"topic_unblock",title:t(Nn.unblock),handler:this.topicPermissionSetter.bind(this,"+JP")},topic_block:{id:"topic_block",title:t(Nn.block),handler:(n,a)=>e.onShowAlert(n.topicTitle||t(Nn.block),t(Nn.topic_block_warning),e=>this.topicPermissionSetter("-JP",n,a).then(e=>(this.props.onTopicRemoved(n.topicName),e)),null,!0,null)},topic_delete:{id:"topic_delete",title:t(Nn.topic_delete),handler:(n,a)=>e.onShowAlert(n.topicTitle||t(Nn.topic_delete),t(Nn.topic_delete_warning),e=>{const t=this.props.tinode.getTopic(n.topicName);if(t)return t.delTopic(!0).catch(e=>{a&&a(e.message,"err")});console.warn("Topic not found: ",n.topicName)},null,!0,null)},topic_archive:{id:"topic_archive",title:t(Nn.archive),handler:(e,t)=>{const n=this.props.tinode.getTopic(e.topicName);if(n)return n.archive(!0).catch(e=>{t&&t(e.message,"err")});console.warn("Topic not found: ",e.topicName)}},topic_restore:{id:"topic_restore",title:t(Nn.unarchive),handler:(e,t)=>{const n=this.props.tinode.getTopic(e.topicName);if(n)return n.archive(!1).catch(e=>{t&&t(e.message,"err")});console.warn("Topic not found: ",e.topicName)}},topic_pin:{id:"topic_pin",title:t(Nn.pin_chat),handler:(e,t)=>{const n=this.props.tinode.getMeTopic();if(n)return n.pinTopic(e.topicName,!0).catch(e=>{t&&t(e.message,"err")});console.warn("'me' topic not found")}},topic_unpin:{id:"topic_unpin",title:t(Nn.unpin_chat),handler:(e,t)=>{const n=this.props.tinode.getMeTopic();if(n)return n.pinTopic(e.topicName,!1).catch(e=>{t&&t(e.message,"err")});console.warn("'me' topic not found")}},permissions:{id:"permissions",title:t(Nn.edit_permissions),handler:null},member_delete:{id:"member_delete",title:t(Nn.member_delete),handler:(e,t)=>{const n=this.props.tinode.getTopic(e.topicName);if(n&&e.user)return n.delSubscription(e.user).catch(e=>{t&&t(e.message,"err")});console.warn("Topic or user not found: '"+e.topicName+"', '"+e.user+"'")}},member_mute:{id:"member_mute",title:t(Nn.mute),handler:this.topicPermissionSetter.bind(this,"-P")},member_unmute:{id:"member_unmute",title:t(Nn.unmute),handler:this.topicPermissionSetter.bind(this,"+P")},member_block:{id:"member_block",title:t(Nn.block),handler:this.topicPermissionSetter.bind(this,"-JP")},member_unblock:{id:"member_unblock",title:t(Nn.unblock),handler:this.topicPermissionSetter.bind(this,"+JP")}}}componentDidMount(){document.addEventListener("mousedown",this.handlePageClick,!1),document.addEventListener("keyup",this.handleEscapeKey,!1)}componentWillUnmount(){document.removeEventListener("mousedown",this.handlePageClick,!1),document.removeEventListener("keyup",this.handleEscapeKey,!1)}handlePageClick(e){this.selfRef.current.contains(e.target)||(e.preventDefault(),e.stopPropagation(),this.props.hide())}handleEscapeKey(e){27===e.keyCode&&this.props.hide()}handleClick(e){e.preventDefault(),e.stopPropagation(),this.props.hide();let t=this.props.items[e.currentTarget.dataset.id];"string"==typeof t&&(t=this.MenuItems[t]),t?this.props.onAction(t.id,t.handler(this.props.params,this.props.onError),this.props.params):console.error("Invalid menu item ID",e.currentTarget.dataset.id)}deleteMessages(e,t,n,a){const s=this.props.tinode.getTopic(n.topicName);if(!s)return void console.warn("Topic not found: ",n.topicName);if(!e&&s.cancelSend(n.seq))return;return(e?s.delMessagesAll(t):n.replace>0?s.delMessagesEdits(n.replace,t):s.delMessagesList([n.seq],t)).catch(e=>{a&&a(e.message,"err")})}retryMessage(e,t){const n=this.props.tinode.getTopic(e.topicName);if(!n||!n.flushMessage(e.seq))return;const a=n.createMessage(e.content,!1);return n.publishDraft(a).catch(e=>{t&&t(e.message,"err")})}pinMessage(e,t,n){const a=this.props.tinode.getTopic(t.topicName);a&&a.pinMessage(t.seq,e).catch(e=>n?n(e.message,"err"):null)}topicPermissionSetter(e,t,n){const a=this.props.tinode.getTopic(t.topicName);if(!a)return void console.warn("Topic not found",t.topicName);let s=a.updateMode(t.user,e);return n&&(s=s.catch(e=>n(e.message,"err"))),s}replyToMessage(e,t){e.pickReply(e.seq,e.content,e.userFrom,e.userName,t)}editMessage(e,t){e.editMessage(e.replace||e.seq,e.content,t)}render(){const e=[];let t=0;this.props.items.forEach(n=>{if("string"==typeof n&&(n=this.MenuItems[n]),n&&n.title){const a=n.disabled?"disabled":void 0;e.push("-"==n.title?d().createElement("li",{className:"separator",key:t}):d().createElement("li",{className:a,onClick:this.handleClick,"data-id":t,key:t},n.title))}t++});const n=12*kn.JS,a=kn.JS*(.7+2.5*e.length),s={left:(this.props.bounds.right-this.props.clickAt.x<n?this.props.clickAt.x-this.props.bounds.left-n:this.props.clickAt.x-this.props.bounds.left)+"px",top:(this.props.bounds.bottom-this.props.clickAt.y<a?this.props.clickAt.y-this.props.bounds.top-a:this.props.clickAt.y-this.props.bounds.top)+"px"};return d().createElement("ul",{className:"menu",style:s,ref:this.selfRef},e)}}var Dn=(0,c.injectIntl)(Pn),In=r(4152);class Rn extends d().PureComponent{constructor(e){super(e),this.state={edited:!1,search:""},this.handleSearchChange=this.handleSearchChange.bind(this),this.handleSearch=this.handleSearch.bind(this),this.handleClear=this.handleClear.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this)}componentWillUnmount(){this.state.edited&&(this.setState({search:"",edited:!1}),this.props.onSearchContacts(Tn.Tinode.DEL_CHAR))}handleSearchChange(e){this.setState({search:e.target.value})}handleSearch(e){e.preventDefault();const t=this.state.search.trim();this.setState({edited:t.length>0}),this.props.onSearchContacts(t.length>0?t:Tn.Tinode.DEL_CHAR)}handleClear(e){e.preventDefault(),this.state.edited&&this.props.onSearchContacts(Tn.Tinode.DEL_CHAR),this.setState({search:"",edited:!1})}handleKeyDown(e){"Enter"===e.key?this.handleSearch(e):"Escape"===e.key&&this.handleClear()}render(){return d().createElement("div",{className:"panel-form"},d().createElement("div",{className:"panel-form-row"},d().createElement("i",{className:"material-icons search"},"search"),d().createElement("input",{className:"search",type:"text",placeholder:this.props.placeholder,value:this.state.search,onChange:this.handleSearchChange,onKeyDown:this.handleKeyDown,required:!0,autoFocus:!0}),this.state.search?d().createElement("a",{href:"#",onClick:this.handleClear},d().createElement("i",{className:"material-icons"},"highlight_off")):d().createElement("span",null,d().createElement("i",{className:"material-icons"}," "))))}}class Fn extends d().Component{constructor(e){super(e),this.state={query:null},this.handleEscapeKey=this.handleEscapeKey.bind(this),this.handleClose=this.handleClose.bind(this),this.handleSearchContacts=this.handleSearchContacts.bind(this),this.handleContactSelected=this.handleContactSelected.bind(this)}componentDidMount(){this.props.onInitFind()}handleEscapeKey(e){27===e.keyCode&&this.props.hide(!1)}handleClose(e){e.preventDefault(),this.props.hide(!1)}handleSearchContacts(e){this.setState({query:Tn.Tinode.isNullValue(e)?null:e}),this.props.onSearchContacts(e)}handleContactSelected(e){this.props.onTopicSelected(e),this.props.hide(!0)}render(){let e=null!=this.state.query?this.props.searchResults:this.props.contacts;return e=e.filter(e=>e.name!=this.props.topicSelected&&e.acs.isJoiner()&&e.acs.isWriter()),d().createElement("div",{className:"alert-container"},d().createElement("div",{className:"forward-dialog"},d().createElement("div",{className:"title with-control"},d().createElement("div",null,d().createElement(c.FormattedMessage,{id:"forward_to",defaultMessage:[{type:0,value:"Forward to"}],desription:"Title of the contact selector dialog when forwarding a message"})),d().createElement("div",null,d().createElement("a",{href:"#",onClick:this.handleClose},d().createElement("i",{className:"material-icons"},"close")))),d().createElement(c.FormattedMessage,{id:"forward_to_search_placeholder",defaultMessage:[{type:0,value:"Search contacts"}]},e=>d().createElement(Rn,{placeholder:e,onSearchContacts:this.handleSearchContacts})),d().createElement(c.FormattedMessage,{id:"search_no_results",defaultMessage:[{type:0,value:"Search returned no results"}]},t=>d().createElement(In.A,{tinode:this.props.tinode,contacts:e,myUserId:this.props.myUserId,emptyListMessage:t,showOnline:!1,showUnread:!1,showContextMenu:!1,onTopicSelected:this.handleContactSelected}))))}}var xn=r(635),On=r(6904);const Ln="started";var Un=r(6110),jn=r(8589);const Bn=new Audio("audio/call-in.m4a");class zn extends d().Component{constructor(e){super(e),this.state={topic:null,fullName:void 0,avatar:null,trustedBadges:[],previousMetaDesc:void 0},this.resetDesc=this.resetDesc.bind(this),this.onMetaDesc=this.onMetaDesc.bind(this),this.handleRejectCall=this.handleRejectCall.bind(this),this.handleAcceptCall=this.handleAcceptCall.bind(this),this.ringTimer=null}componentDidMount(){const e=this.props.tinode.getTopic(this.props.topic);e&&(this.resetDesc(e),2==this.props.callState&&(Bn.play().catch(e=>{}),this.ringTimer=setInterval(e=>{Bn.play().catch(e=>{})},2e3),this.props.onRinging(this.props.topic,this.props.seq)))}componentDidUpdate(e){const t=this.props.tinode.getTopic(e.topic);t&&(this.onMetaDesc!=t.onMetaDesc&&(this.previousMetaDesc=t.onMetaDesc,t.onMetaDesc=this.onMetaDesc),this.state.topic!=e.topic&&(this.setState({topic:e.topic}),this.resetDesc(t,e)))}componentWillUnmount(){null!=this.ringTimer&&(clearInterval(this.ringTimer),Bn.pause());const e=this.props.tinode.getTopic(this.props.topic);e&&(this.setState({topic:null}),e.onMetaDesc=this.previousMetaDesc)}resetDesc(e){const t=[];if(e.trusted)for(const[n,a]of Object.entries(e.trusted))a&&t.push(n);this.setState({fullName:(0,jn.W5)(e.public?e.public.fn:void 0,kn.tS),avatar:(0,Un.to)(e.public?e.public.photo:null),trustedBadges:t})}onMetaDesc(e){const t=this.props.tinode.getTopic(this.props.topic);t&&(this.resetDesc(t),this.previousMetaDesc&&this.previousMetaDesc!=this.onMetaDesc&&this.previousMetaDesc(e))}handleAcceptCall(){this.props.onAcceptCall(this.props.topic)}handleRejectCall(){this.props.onReject(this.props.topic,this.props.seq),this.props.onClose()}render(){return d().createElement("div",{className:"alert-container"},d().createElement("div",{className:"incoming-call"},d().createElement("div",{className:"caller-card incoming pulse"},d().createElement("div",{className:"avatar-box"},d().createElement(On.A,{authorizeURL:this.props.tinode.authorizeURL,avatar:this.state.avatar||!0,topic:this.props.topic,title:this.state.fullName})),d().createElement("div",{className:"caller-name"},(0,jn.W5)(this.state.fullName,kn.mu),d().createElement(xn.A,{short:!0,trustedBadges:this.state.trustedBadges}))),d().createElement("div",{id:"controls"},2==this.props.callState?d().createElement(d().Fragment,null,d().createElement("button",{className:"danger",onClick:this.handleRejectCall},d().createElement("i",{className:"material-icons"},"call_end")),d().createElement("button",{className:"positive",onClick:this.handleAcceptCall},d().createElement("i",{className:"material-icons"},"call"))):null)))}}const qn=new Audio("audio/call-out.m4a");qn.loop=!0;const Vn=new Audio("audio/call-end.m4a");Vn.loop=!0;const Hn=new Audio("audio/dialing.m4a"),Wn="video:muted",Gn="video:unmuted",Kn=(0,c.defineMessages)({already_in_call:{id:"already_in_call",defaultMessage:[{type:0,value:"You already in an ongoing call!"}]}});class Yn extends d().PureComponent{constructor(e){super(e),this.state={localStream:void 0,remoteStream:void 0,pc:void 0,dataChannel:void 0,previousOnInfo:void 0,waitingForPeer:!1,callInitialSetupComplete:!1,audioOnly:e.callAudioOnly,videoToggleInProgress:!1,remoteVideoLive:!1},this.localStreamConstraints={audio:!0,video:!e.callAudioOnly},this.isOutgoingCall=1==e.callState,this.containerRef=d().createRef(),this.localRef=d().createRef(),this.remoteRef=d().createRef(),this.remoteIceCandidatesCache=[],this.onInfo=this.onInfo.bind(this),this.start=this.start.bind(this),this.stop=this.stop.bind(this),this.createPeerConnection=this.createPeerConnection.bind(this),this.canSendOffer=this.canSendOffer.bind(this),this.drainRemoteIceCandidatesCache=this.drainRemoteIceCandidatesCache.bind(this),this.handleNegotiationNeededEvent=this.handleNegotiationNeededEvent.bind(this),this.handleICECandidateEvent=this.handleICECandidateEvent.bind(this),this.handleNewICECandidateMsg=this.handleNewICECandidateMsg.bind(this),this.handleICEConnectionStateChangeEvent=this.handleICEConnectionStateChangeEvent.bind(this),this.handleSignalingStateChangeEvent=this.handleSignalingStateChangeEvent.bind(this),this.handleICEGatheringStateChangeEvent=this.handleICEGatheringStateChangeEvent.bind(this),this.handleIceCandidateErrorEvent=this.handleIceCandidateErrorEvent.bind(this),this.handleTrackEvent=this.handleTrackEvent.bind(this),this.handleVideoOfferMsg=this.handleVideoOfferMsg.bind(this),this.handleVideoAnswerMsg=this.handleVideoAnswerMsg.bind(this),this.handleNewICECandidateMsg=this.handleNewICECandidateMsg.bind(this),this.reportError=this.reportError.bind(this),this.handleGetUserMediaError=this.handleGetUserMediaError.bind(this),this.stopTracks=this.stopTracks.bind(this),this.disconnectMedia=this.disconnectMedia.bind(this),this.handleCloseClick=this.handleCloseClick.bind(this),this.handleToggleCameraClick=this.handleToggleCameraClick.bind(this),this.handleToggleMicClick=this.handleToggleMicClick.bind(this),this.handleRemoteHangup=this.handleRemoteHangup.bind(this),this.handleVideoCallAccepted=this.handleVideoCallAccepted.bind(this),this.muteVideo=this.muteVideo.bind(this),this.unmuteVideo=this.unmuteVideo.bind(this),this.emptyVideoTrack=this.emptyVideoTrack.bind(this),this.handleDataChannelEvent=this.handleDataChannelEvent.bind(this),this.handleDataChannelError=this.handleDataChannelError.bind(this),this.handleDataChannelMessage=this.handleDataChannelMessage.bind(this),this.handleDataChannelOpen=this.handleDataChannelOpen.bind(this),this.handleDataChannelClose=this.handleDataChannelClose.bind(this),this.bounds={},this.dragStart=e=>{if(e.target.classList.contains("draggable")&&!window.matchMedia("(width<=640px)")&&this.props.minimized&&this.containerRef){e.stopPropagation(),this.containerRef.current.setPointerCapture(e.pointerId),this.containerRef.current.style.cursor="grabbing",this.bounds.left=this.containerRef.current.offsetLeft,this.bounds.top=this.containerRef.current.offsetTop,this.bounds.width=this.containerRef.current.offsetWidth,this.bounds.height=this.containerRef.current.offsetHeight;const t=this.containerRef.current.offsetParent;this.bounds.maxX=t.offsetWidth,this.bounds.maxY=t.offsetHeight}},this.drag=e=>{e.stopPropagation();const t=this.containerRef.current;this.props.minimized&&this.containerRef&&t.hasPointerCapture(e.pointerId)&&(this.bounds.left=Math.min(Math.max(this.bounds.left+e.movementX,0),this.bounds.maxX-this.bounds.width),this.bounds.top=Math.min(Math.max(this.bounds.top+e.movementY,0),this.bounds.maxY-this.bounds.height),t.style.left=`${this.bounds.left}px`,t.style.top=`${this.bounds.top}px`)},this.dragEnd=e=>{e.stopPropagation(),this.props.minimized&&this.containerRef&&(this.containerRef.current.releasePointerCapture(e.pointerId),this.containerRef.current.style.cursor="grab")}}componentDidMount(){const e=this.props.tinode.getTopic(this.props.topic);this.previousOnInfo=e.onInfo,e.onInfo=this.onInfo,1!=this.props.callState&&3!=this.props.callState||!this.localRef.current||this.start(),this.containerRef&&(this.containerRef.current.addEventListener("pointerdown",this.dragStart),this.containerRef.current.addEventListener("pointermove",this.drag),this.containerRef.current.addEventListener("pointerup",this.dragEnd))}componentWillUnmount(){this.props.tinode.getTopic(this.props.topic).onInfo=this.previousOnInfo,this.stop(),this.containerRef&&(this.containerRef.current.removeEventListener("pointerdown",this.dragStart),this.containerRef.current.removeEventListener("pointermove",this.drag),this.containerRef.current.removeEventListener("pointerup",this.dragEnd))}handleVideoCallAccepted(e){qn.pause();const t=this.createPeerConnection(!0),n=this.state.localStream;n.getTracks().forEach(e=>{t.addTrack(e,n),"video"==e.kind&&this.state.audioOnly&&(e.enabled=!1,e.stop(),n.removeTrack(e))})}onInfo(e){if("call"==e.what)switch(e.event){case"accept":this.handleVideoCallAccepted(e);break;case"answer":this.handleVideoAnswerMsg(e);break;case"ice-candidate":this.handleNewICECandidateMsg(e);break;case"hang-up":this.handleRemoteHangup(e);break;case"offer":this.handleVideoOfferMsg(e);break;case"ringing":qn.play().catch(e=>{});break;default:console.warn("Unknown call event",e.event)}}emptyVideoTrack(){const e=Object.assign(document.createElement("canvas"),{width:640,height:480});e.getContext("2d").fillRect(0,0,640,480);const t=e.captureStream(0);return Object.assign(t.getVideoTracks()[0],{enabled:!1})}start(){this.state.localStream?this.props.onError(this.props.intl.formatMessage(Kn.already_in_call),"info"):3!=this.props.callState?navigator.mediaDevices.getUserMedia(this.localStreamConstraints).then(e=>{this.localStreamConstraints.video||e.addTrack(this.emptyVideoTrack()),this.setState({localStream:e,waitingForPeer:!0}),this.localRef.current.srcObject=e,Hn.play(),this.props.onInvite(this.props.topic,this.props.seq,this.props.callState,this.props.callAudioOnly)}).catch(this.handleGetUserMediaError):this.props.onInvite(this.props.topic,this.props.seq,3,this.props.callAudioOnly)}stop(){Vn.pause(),Vn.currentTime=0,qn.pause(),qn.currentTime=0,this.stopTracks(this.state.localStream),this.stopTracks(this.state.remoteStream),this.disconnectMedia(this.localRef.current),this.disconnectMedia(this.remoteRef.current),this.state.pc&&(this.state.pc.ontrack=null,this.state.pc.onremovetrack=null,this.state.pc.onremovestream=null,this.state.pc.onicecandidate=null,this.state.pc.oniceconnectionstatechange=null,this.state.pc.onsignalingstatechange=null,this.state.pc.onicegatheringstatechange=null,this.state.pc.onnegotiationneeded=null,this.state.pc.onicecandidateerror=null,this.state.pc.ondatachannel=null,!this.state.dataChannel||"open"!=this.state.dataChannel.readyState&&"connecting"!=this.state.dataChannel.readyState||this.state.dataChannel.close(),this.state.pc.close()),this.setState({pc:null,waitingForPeer:!1})}disconnectMedia(e){e&&(e.srcObject=null,e.src="")}stopTracks(e){if(!e)return;let t=e.getTracks();t&&t.forEach(e=>{e.stop(),e.enabled=!1})}handleDataChannelError(e){console.error("data channel error",e)}handleDataChannelMessage(e){switch(e.data){case Wn:this.setState({remoteVideoLive:!1},e=>{this.remoteRef.current.srcObject=this.state.remoteStream});break;case Gn:this.setState({remoteVideoLive:!0},e=>{this.remoteRef.current.srcObject=this.state.remoteStream})}}handleDataChannelOpen(e){this.state.audioOnly||e.target.send(Gn)}handleDataChannelClose(e){console.log("close data channel:",e)}handleDataChannelEvent(e){console.log("data channel event:",e);const t=e.channel;t.onerror=this.handleDataChannelError,t.onmessage=this.handleDataChannelMessage,t.onopen=this.handleDataChannelOpen,t.onclose=this.handleDataChannelClose,this.setState({dataChannel:t})}createPeerConnection(e){const t=this.props.tinode.getServerParam("iceServers",null),n=t?new RTCPeerConnection({iceServers:t}):new RTCPeerConnection;n.onicecandidate=this.handleICECandidateEvent,n.oniceconnectionstatechange=this.handleICEConnectionStateChangeEvent,n.onicegatheringstatechange=this.handleICEGatheringStateChangeEvent,n.onsignalingstatechange=this.handleSignalingStateChangeEvent,n.onnegotiationneeded=this.handleNegotiationNeededEvent,n.onicecandidateerror=this.handleIceCandidateErrorEvent,n.ontrack=this.handleTrackEvent,n.ondatachannel=this.handleDataChannelEvent;let a={pc:n,waitingForPeer:!1};if(e){const e=n.createDataChannel("events",{ordered:!0});e.onerror=this.handleDataChannelError,e.onmessage=this.handleDataChannelMessage,e.onopen=this.handleDataChannelOpen,e.onclose=this.handleDataChannelClose,a.dataChannel=e}return this.setState(a),n}handleVideoAnswerMsg(e){const t=new RTCSessionDescription(e.payload);this.state.pc.setRemoteDescription(t).then(e=>{this.setState({callInitialSetupComplete:!0},e=>this.drainRemoteIceCandidatesCache())}).catch(e=>this.reportError(e))}reportError(e){this.props.onError(e.message,"err")}canSendOffer(){return this.isOutgoingCall||this.state.callInitialSetupComplete}handleNegotiationNeededEvent(e){const t=e.target;this.canSendOffer()&&t.createOffer().then(e=>t.setLocalDescription(e)).then(e=>{this.props.onSendOffer(this.props.topic,this.props.seq,t.localDescription.toJSON())}).catch(e=>this.reportError(e))}handleIceCandidateErrorEvent(e){console.warn("ICE candidate error:",e)}handleICECandidateEvent(e){e.candidate&&this.props.onIceCandidate(this.props.topic,this.props.seq,e.candidate.toJSON())}handleNewICECandidateMsg(e){const t=new RTCIceCandidate(e.payload);this.state.callInitialSetupComplete?this.state.pc.addIceCandidate(t).catch(e=>{t.candidate&&this.reportError(e),console.warn("Error adding new ice candidate",t,e)}):this.remoteIceCandidatesCache.push(t)}drainRemoteIceCandidatesCache(){this.remoteIceCandidatesCache.forEach(e=>{this.state.pc.addIceCandidate(e).catch(t=>{e.candidate&&this.reportError(t),console.warn("Error adding cached ice candidate",e,t)})}),this.remoteIceCandidatesCache=[]}handleICEConnectionStateChangeEvent(e){switch(e.target.iceConnectionState){case"closed":case"failed":this.handleCloseClick()}}handleSignalingStateChangeEvent(e){"closed"==e.target.signalingState&&this.handleCloseClick()}handleICEGatheringStateChangeEvent(e){}handleTrackEvent(e){this.remoteRef.current.srcObject=e.streams[0],this.setState({remoteStream:e.streams[0]})}handleGetUserMediaError(e){switch(console.error("Error opening camera and/or microphone",e),e.name){case"NotFoundError":default:this.reportError(e);case"SecurityError":case"PermissionDeniedError":}this.handleCloseClick()}handleVideoOfferMsg(e){let t=null;const n=this.state.pc?this.state.pc:this.createPeerConnection(!1),a=new RTCSessionDescription(e.payload);n.setRemoteDescription(a).then(e=>navigator.mediaDevices.getUserMedia(this.localStreamConstraints)).then(e=>{let a;this.localStreamConstraints.video||(a=this.emptyVideoTrack(),e.addTrack(a)),t=e,this.localRef.current.srcObject=e,this.setState({localStream:e}),t.getTracks().forEach(e=>{n.addTrack(e,t)}),a&&(a.enabled=!1,a.stop(),e.removeTrack(a))}).then(e=>n.createAnswer()).then(e=>n.setLocalDescription(e)).then(e=>{this.props.onSendAnswer(this.props.topic,this.props.seq,n.localDescription.toJSON()),this.setState({callInitialSetupComplete:!0},e=>this.drainRemoteIceCandidatesCache())}).catch(this.handleGetUserMediaError)}handleRemoteHangup(){this.state.waitingForPeer?(this.setState({waitingForPeer:!1}),qn.pause(),qn.currentTime=0,Vn.loop=!0,Vn.play().catch(e=>{}),setTimeout(e=>{this.handleCloseClick()},2e3)):this.handleCloseClick()}handleCloseClick(){this.stop(),this.props.onHangup(this.props.topic,this.props.seq)}muteVideo(){if(!this.state.pc||!this.state.dataChannel)return;const e=this.state.localStream,t=e.getVideoTracks()[0];t.enabled=!1,t.stop(),e.removeTrack(t),this.state.dataChannel.send(Wn),this.setState({videoToggleInProgress:!1})}unmuteVideo(){this.state.pc&&this.state.dataChannel&&navigator.mediaDevices.getUserMedia({video:!0}).then(e=>{this.localRef.current.srcObject=null;const t=this.state.pc.getSenders().find(e=>"video"==e.track.kind),n=e.getVideoTracks()[0];return e.removeTrack(n),this.state.localStream.addTrack(n),t.replaceTrack(n)}).then(e=>{this.localRef.current.srcObject=this.state.localStream,this.state.dataChannel.send(Gn)}).catch(e=>this.handleGetUserMediaError(e)).finally(e=>{this.setState({videoToggleInProgress:!1})})}handleToggleCameraClick(){if(this.state.videoToggleInProgress)return;const e=this.state.localStream.getVideoTracks();this.setState({videoToggleInProgress:!0},t=>{e&&e.length>0&&e[0].enabled&&"live"==e[0].readyState?this.muteVideo():this.unmuteVideo(),this.setState({audioOnly:!this.state.audioOnly})})}handleToggleMicClick(){const e=this.state.localStream.getAudioTracks()[0];e.enabled=!e.enabled,this.forceUpdate()}render(){const e=this.state.localStream&&this.state.localStream.getAudioTracks(),t=!this.state.audioOnly&&this.state.localStream&&this.state.localStream.getVideoTracks(),n=!this.state.pc||!this.state.dataChannel||!(e&&e[0]),a=e&&e[0]&&e[0].enabled?"mic":"mic_off",s=t&&t[0]&&t[0].enabled&&"live"==t[0].readyState?"videocam":"videocam_off",i=(0,jn.W5)(this.props.title,kn.mu),r=this.state.waitingForPeer?" pulse":"";let o=!1;if(this.remoteRef.current&&this.remoteRef.current.srcObject&&this.state.remoteVideoLive){const e=this.remoteRef.current.srcObject;if(e.getVideoTracks().length>0){const t=e.getVideoTracks()[0];o=t.enabled&&"live"==t.readyState}}const l=this.props.minimized?"minimized":null,h=this.props.minimized?"fullscreen":"fullscreen_exit";return d().createElement("div",{id:"video-container",className:l,ref:this.containerRef},d().createElement("div",{id:"video-container-panel"},d().createElement("div",{className:"call-party self",disabled:this.state.audioOnly||this.props.minimized},d().createElement("video",{ref:this.localRef,autoPlay:!0,muted:!0,playsInline:!0}),d().createElement("div",{className:"caller-name inactive"},d().createElement(c.FormattedMessage,{id:"calls_you_label",defaultMessage:[{type:0,value:"You"}]}))),d().createElement("div",{className:"call-party peer",disabled:!o},o?d().createElement(d().Fragment,null,d().createElement("video",{ref:this.remoteRef,autoPlay:!0,playsInline:!0}),d().createElement("div",{className:"caller-name inactive"},i)):d().createElement(d().Fragment,null,d().createElement("audio",{ref:this.remoteRef,autoPlay:!0}),d().createElement("div",{className:`caller-card${r} draggable`},d().createElement("div",{className:"avatar-box"},d().createElement(On.A,{authorizeURL:this.props.tinode.authorizeURL,avatar:this.props.avatar,topic:this.props.topic,title:this.props.title})),d().createElement("div",{className:"caller-name"},i))))),d().createElement("button",{className:"full-screen",onClick:this.props.onToggleMinimize},d().createElement("i",{className:"material-icons"},h)),d().createElement("div",{id:"controls",className:l},d().createElement("button",{className:"danger",onClick:this.handleCloseClick},d().createElement("i",{className:"material-icons"},"call_end")),d().createElement("button",{className:"secondary",onClick:this.handleToggleCameraClick,disabled:n},d().createElement("i",{className:"material-icons"},s)),d().createElement("button",{className:"secondary",onClick:this.handleToggleMicClick,disabled:n},d().createElement("i",{className:"material-icons"},a))))}}var Qn=(0,c.injectIntl)(Yn),Xn=r(9895),Jn=r(3540);class Zn extends d().Component{constructor(e){super(e),this.state={downloader:null,progress:0},this.downloadFile=this.downloadFile.bind(this),this.handleCancel=this.handleCancel.bind(this)}downloadFile(e,t,n){if(!e)return void this.props.onError("Invalid download URL '"+e+"'");const a=this.props.tinode.getLargeFileHelper();this.setState({downloader:a}),a.download(e,t,n,e=>this.setState({progress:e/this.props.size}),e=>this.props.onError(e,"err")).then(e=>this.setState({downloader:null,progress:0})).catch(e=>{e&&this.props.onError("Error downloading file: "+e.message,"err"),this.setState({downloader:null,progress:0})})}handleCancel(){this.props.uploading?this.props.onCancelUpload():this.state.downloader&&this.state.downloader.cancel()}render(){let e=this.props.filename||"file_attachment";e.length>36&&(e=e.substr(0,16)+"..."+e.substr(-16));let t,n,a=this.props.size>0?d().createElement("span",{className:"small gray"},"(",(0,jn.lX)(this.props.size),")"):null;this.props.uploading||this.state.downloader||!(0,Jn.YO)(this.props.downloadUrl)?(t=(0,Jn.Jf)(this.props.downloadUrl),n=null):(t="#",n=e=>{e.preventDefault(),this.downloadFile(this.props.downloadUrl,this.props.filename,this.props.mimetype)});const s=d().createElement(d().Fragment,null,d().createElement("i",{className:"material-icons"},"file_download")," ",d().createElement(c.FormattedMessage,{id:"save_attachment",defaultMessage:[{type:0,value:"save"}]}));return d().createElement("div",{className:"attachment"},d().createElement("div",null,d().createElement("i",{className:"material-icons big gray"},"insert_drive_file")),d().createElement("div",{className:"flex-column"},d().createElement("div",null,e," ",a),this.props.uploading||this.state.downloader?d().createElement(Xn.A,{progress:this.props.uploading?this.props.progress:this.state.progress,onCancel:this.handleCancel}):d().createElement("div",null,t?d().createElement("a",{href:t,download:this.props.filename,onClick:n},s):d().createElement("span",{className:"light-gray"},s))))}}const ea=(0,c.defineMessages)({message_sending:{id:"message_sending",defaultMessage:[{type:0,value:"sending..."}]},message_sending_failed:{id:"message_sending_failed",defaultMessage:[{type:0,value:"failed"}]},message_edited_marker:{id:"message_edited_marker",defaultMessage:[{type:0,value:", edited"}]}});class ta extends d().PureComponent{render(){const{formatMessage:e}=this.props.intl;let t;t=this.props.received<=Tn.Tinode.MESSAGE_STATUS_SENDING?e(ea.message_sending):this.props.received==Tn.Tinode.MESSAGE_STATUS_FAILED||this.props.received==Tn.Tinode.MESSAGE_STATUS_FATAL?e(ea.message_sending_failed):this.props.timestamp.toLocaleTimeString(this.props.intl.locale,{timeStyle:"short"});const n=(0,Jn.LO)(this.props.received),a=n?d().createElement("i",{className:"material-icons small "+n.color},n.name):null,s=this.props.edited?e(ea.message_edited_marker):null;return d().createElement("span",{className:"timestamp"},t,s," ",a)}}var na=(0,c.injectIntl)(ta),aa=r(5791);function sa(){return sa=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)({}).hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},sa.apply(null,arguments)}class ia extends d().PureComponent{constructor(e){super(e),this.state={progress:0},e.uploader&&(e.uploader.onProgress=this.handleProgress.bind(this)),this.handleExpandImage=this.handleExpandImage.bind(this),this.handlePlayVideo=this.handlePlayVideo.bind(this),this.handleFormButtonClick=this.handleFormButtonClick.bind(this),this.handleQuoteClick=this.handleQuoteClick.bind(this),this.handleContextClick=this.handleContextClick.bind(this),this.handleCancelUpload=this.handleCancelUpload.bind(this),this.handleDraftyClick=this.handleDraftyClick.bind(this),this.formatterContext={formatMessage:e.intl.formatMessage.bind(e.intl),viewportWidth:e.viewportWidth,authorizeURL:e.tinode.authorizeURL.bind(e.tinode),onHandleClick:this.handleDraftyClick}}handleDraftyClick=(e,t)=>{switch(t){case"image":this.handleExpandImage(e);break;case"video":this.handlePlayVideo(e);break;case"form_button":this.handleFormButtonClick(e);break;case"quote":this.handleQuoteClick(e);break;case"contact_chat":case"contact_find":e.preventDefault(),console.log("Contact click handling not implemented yet.",t,e.target.dataset);break;default:console.log("Unhandled drafty action.",t,e.target.dataset)}};handleExpandImage(e){e.preventDefault(),this.props.onExpandMedia({url:e.target.src,filename:e.target.dataset.name,width:e.target.dataset.width,height:e.target.dataset.height,size:e.target.dataset.size,type:e.target.dataset.mime})}handlePlayVideo(e){e.preventDefault(),this.props.onExpandMedia({video:!0,url:e.target.dataset.src,preview:e.target.src,filename:e.target.dataset.name,width:e.target.dataset.width,height:e.target.dataset.height,duration:e.target.dataset.duration,size:e.target.dataset.size,type:e.target.dataset.mime})}handleFormButtonClick(e){e.preventDefault();const t={seq:this.props.seq,resp:{}};e.target.dataset.name&&(t.resp[e.target.dataset.name]=e.target.dataset.val?e.target.dataset.val:void 0===e.target.dataset.val?1:""+e.target.dataset.val),"url"==e.target.dataset.act&&(t.ref=(0,Jn.Jf)(e.target.dataset.ref)||"about:blank");const n=e.target.dataset.title||"unknown";this.props.onFormResponse(e.target.dataset.act,n,t)}handleContextClick(e){e.preventDefault(),e.stopPropagation();const t=[];if(this.props.received==Tn.Tinode.MESSAGE_STATUS_FAILED&&t.push("menu_item_send_retry"),this.props.received>Tn.Tinode.MESSAGE_STATUS_FATAL){if(this.props.userIsWriter&&(t.push("menu_item_reply"),!this.props.response)){let e=!1;Tn.Drafty.entities(this.props.content,(t,n,a)=>(e=["AU","EX","FM","IM","TC","VC","VD"].includes(a),e)),e||Tn.Drafty.styles(this.props.content,t=>(e=["QQ"].includes(t),e)),e||t.push("menu_item_edit")}this.props.userIsAdmin&&t.push(this.props.pinned?"menu_item_unpin":"menu_item_pin")}t.push("menu_item_forward"),this.props.showContextMenu({seq:this.props.seq,replace:this.props.edited?parseInt(this.props.edited.split(":")[1]):0,content:this.props.content,userFrom:this.props.userFrom,userName:this.props.userName,y:e.pageY,x:e.pageX,pickReply:this.props.pickReply,editMessage:this.props.editMessage,timestamp:this.props.timestamp},t)}handleProgress(e){this.setState({progress:e})}handleCancelUpload(){this.props.onCancelUpload(this.props.seq,this.props.uploader)}handleQuoteClick(e){e.preventDefault(),e.stopPropagation();const t=this.props.replyToSeq;t&&this.props.onQuoteClick(t)}render(){const e=this.props.sequence+" "+(this.props.response?"left":"right"),t="single"==this.props.sequence||"last"==this.props.sequence?"bubble tip":"bubble",n=this.props.userAvatar||!0;let a="message-content";const s=this.props.isGroup&&this.props.response&&("single"==this.props.sequence||"last"==this.props.sequence);let i=this.props.content;const r=[];if(this.props.mimeType==Tn.Drafty.getContentType()&&Tn.Drafty.isValid(i)){Tn.Drafty.attachments(i,(e,t)=>{Tn.Drafty.isFormResponseType(e.mime)||r.push(d().createElement(Zn,{tinode:this.props.tinode,downloadUrl:Tn.Drafty.getDownloadUrl(e),filename:e.name,uploading:Tn.Drafty.isProcessing(e),mimetype:e.mime,size:Tn.Drafty.getEntitySize(e),progress:this.state.progress,onCancelUpload:this.handleCancelUpload,onError:this.props.onError,key:t}))},this);const e=Tn.Drafty.format(i,aa.e3,this.formatterContext);i=d().createElement(d().Fragment,null,e)}else"string"==typeof i?new RegExp("^\\p{RGI_Emoji}{1,5}$","v").test(i||"")&&(a+=" emoji-"+(i||"").match(/(?:👨🏻❤️💋👨🏻|👨🏻❤️💋👨🏼|👨🏻❤️💋👨🏽|👨🏻❤️💋👨🏾|👨🏻❤️💋👨🏿|👨🏼❤️💋👨🏻|👨🏼❤️💋👨🏼|👨🏼❤️💋👨🏽|👨🏼❤️💋👨🏾|👨🏼❤️💋👨🏿|👨🏽❤️💋👨🏻|👨🏽❤️💋👨🏼|👨🏽❤️💋👨🏽|👨🏽❤️💋👨🏾|👨🏽❤️💋👨🏿|👨🏾❤️💋👨🏻|👨🏾❤️💋👨🏼|👨🏾❤️💋👨🏽|👨🏾❤️💋👨🏾|👨🏾❤️💋👨🏿|👨🏿❤️💋👨🏻|👨🏿❤️💋👨🏼|👨🏿❤️💋👨🏽|👨🏿❤️💋👨🏾|👨🏿❤️💋👨🏿|👩🏻❤️💋👨🏻|👩🏻❤️💋👨🏼|👩🏻❤️💋👨🏽|👩🏻❤️💋👨🏾|👩🏻❤️💋👨🏿|👩🏻❤️💋👩🏻|👩🏻❤️💋👩🏼|👩🏻❤️💋👩🏽|👩🏻❤️💋👩🏾|👩🏻❤️💋👩🏿|👩🏼❤️💋👨🏻|👩🏼❤️💋👨🏼|👩🏼❤️💋👨🏽|👩🏼❤️💋👨🏾|👩🏼❤️💋👨🏿|👩🏼❤️💋👩🏻|👩🏼❤️💋👩🏼|👩🏼❤️💋👩🏽|👩🏼❤️💋👩🏾|👩🏼❤️💋👩🏿|👩🏽❤️💋👨🏻|👩🏽❤️💋👨🏼|👩🏽❤️💋👨🏽|👩🏽❤️💋👨🏾|👩🏽❤️💋👨🏿|👩🏽❤️💋👩🏻|👩🏽❤️💋👩🏼|👩🏽❤️💋👩🏽|👩🏽❤️💋👩🏾|👩🏽❤️💋👩🏿|👩🏾❤️💋👨🏻|👩🏾❤️💋👨🏼|👩🏾❤️💋👨🏽|👩🏾❤️💋👨🏾|👩🏾❤️💋👨🏿|👩🏾❤️💋👩🏻|👩🏾❤️💋👩🏼|👩🏾❤️💋👩🏽|👩🏾❤️💋👩🏾|👩🏾❤️💋👩🏿|👩🏿❤️💋👨🏻|👩🏿❤️💋👨🏼|👩🏿❤️💋👨🏽|👩🏿❤️💋👨🏾|👩🏿❤️💋👨🏿|👩🏿❤️💋👩🏻|👩🏿❤️💋👩🏼|👩🏿❤️💋👩🏽|👩🏿❤️💋👩🏾|👩🏿❤️💋👩🏿|🧑🏻❤️💋🧑🏼|🧑🏻❤️💋🧑🏽|🧑🏻❤️💋🧑🏾|🧑🏻❤️💋🧑🏿|🧑🏼❤️💋🧑🏻|🧑🏼❤️💋🧑🏽|🧑🏼❤️💋🧑🏾|🧑🏼❤️💋🧑🏿|🧑🏽❤️💋🧑🏻|🧑🏽❤️💋🧑🏼|🧑🏽❤️💋🧑🏾|🧑🏽❤️💋🧑🏿|🧑🏾❤️💋🧑🏻|🧑🏾❤️💋🧑🏼|🧑🏾❤️💋🧑🏽|🧑🏾❤️💋🧑🏿|🧑🏿❤️💋🧑🏻|🧑🏿❤️💋🧑🏼|🧑🏿❤️💋🧑🏽|🧑🏿❤️💋🧑🏾|🏴|🏴|🏴|👨🏻❤️👨🏻|👨🏻❤️👨🏼|👨🏻❤️👨🏽|👨🏻❤️👨🏾|👨🏻❤️👨🏿|👨🏻🐰👨🏼|👨🏻🐰👨🏽|👨🏻🐰👨🏾|👨🏻🐰👨🏿|👨🏻🤝👨🏼|👨🏻🤝👨🏽|👨🏻🤝👨🏾|👨🏻🤝👨🏿|👨🏻👨🏼|👨🏻👨🏽|👨🏻👨🏾|👨🏻👨🏿|👨🏼❤️👨🏻|👨🏼❤️👨🏼|👨🏼❤️👨🏽|👨🏼❤️👨🏾|👨🏼❤️👨🏿|👨🏼🐰👨🏻|👨🏼🐰👨🏽|👨🏼🐰👨🏾|👨🏼🐰👨🏿|👨🏼🤝👨🏻|👨🏼🤝👨🏽|👨🏼🤝👨🏾|👨🏼🤝👨🏿|👨🏼👨🏻|👨🏼👨🏽|👨🏼👨🏾|👨🏼👨🏿|👨🏽❤️👨🏻|👨🏽❤️👨🏼|👨🏽❤️👨🏽|👨🏽❤️👨🏾|👨🏽❤️👨🏿|👨🏽🐰👨🏻|👨🏽🐰👨🏼|👨🏽🐰👨🏾|👨🏽🐰👨🏿|👨🏽🤝👨🏻|👨🏽🤝👨🏼|👨🏽🤝👨🏾|👨🏽🤝👨🏿|👨🏽👨🏻|👨🏽👨🏼|👨🏽👨🏾|👨🏽👨🏿|👨🏾❤️👨🏻|👨🏾❤️👨🏼|👨🏾❤️👨🏽|👨🏾❤️👨🏾|👨🏾❤️👨🏿|👨🏾🐰👨🏻|👨🏾🐰👨🏼|👨🏾🐰👨🏽|👨🏾🐰👨🏿|👨🏾🤝👨🏻|👨🏾🤝👨🏼|👨🏾🤝👨🏽|👨🏾🤝👨🏿|👨🏾👨🏻|👨🏾👨🏼|👨🏾👨🏽|👨🏾👨🏿|👨🏿❤️👨🏻|👨🏿❤️👨🏼|👨🏿❤️👨🏽|👨🏿❤️👨🏾|👨🏿❤️👨🏿|👨🏿🐰👨🏻|👨🏿🐰👨🏼|👨🏿🐰👨🏽|👨🏿🐰👨🏾|👨🏿🤝👨🏻|👨🏿🤝👨🏼|👨🏿🤝👨🏽|👨🏿🤝👨🏾|👨🏿👨🏻|👨🏿👨🏼|👨🏿👨🏽|👨🏿👨🏾|👩🏻❤️👨🏻|👩🏻❤️👨🏼|👩🏻❤️👨🏽|👩🏻❤️👨🏾|👩🏻❤️👨🏿|👩🏻❤️👩🏻|👩🏻❤️👩🏼|👩🏻❤️👩🏽|👩🏻❤️👩🏾|👩🏻❤️👩🏿|👩🏻🐰👩🏼|👩🏻🐰👩🏽|👩🏻🐰👩🏾|👩🏻🐰👩🏿|👩🏻🤝👨🏼|👩🏻🤝👨🏽|👩🏻🤝👨🏾|👩🏻🤝👨🏿|👩🏻🤝👩🏼|👩🏻🤝👩🏽|👩🏻🤝👩🏾|👩🏻🤝👩🏿|👩🏻👩🏼|👩🏻👩🏽|👩🏻👩🏾|👩🏻👩🏿|👩🏼❤️👨🏻|👩🏼❤️👨🏼|👩🏼❤️👨🏽|👩🏼❤️👨🏾|👩🏼❤️👨🏿|👩🏼❤️👩🏻|👩🏼❤️👩🏼|👩🏼❤️👩🏽|👩🏼❤️👩🏾|👩🏼❤️👩🏿|👩🏼🐰👩🏻|👩🏼🐰👩🏽|👩🏼🐰👩🏾|👩🏼🐰👩🏿|👩🏼🤝👨🏻|👩🏼🤝👨🏽|👩🏼🤝👨🏾|👩🏼🤝👨🏿|👩🏼🤝👩🏻|👩🏼🤝👩🏽|👩🏼🤝👩🏾|👩🏼🤝👩🏿|👩🏼👩🏻|👩🏼👩🏽|👩🏼👩🏾|👩🏼👩🏿|👩🏽❤️👨🏻|👩🏽❤️👨🏼|👩🏽❤️👨🏽|👩🏽❤️👨🏾|👩🏽❤️👨🏿|👩🏽❤️👩🏻|👩🏽❤️👩🏼|👩🏽❤️👩🏽|👩🏽❤️👩🏾|👩🏽❤️👩🏿|👩🏽🐰👩🏻|👩🏽🐰👩🏼|👩🏽🐰👩🏾|👩🏽🐰👩🏿|👩🏽🤝👨🏻|👩🏽🤝👨🏼|👩🏽🤝👨🏾|👩🏽🤝👨🏿|👩🏽🤝👩🏻|👩🏽🤝👩🏼|👩🏽🤝👩🏾|👩🏽🤝👩🏿|👩🏽👩🏻|👩🏽👩🏼|👩🏽👩🏾|👩🏽👩🏿|👩🏾❤️👨🏻|👩🏾❤️👨🏼|👩🏾❤️👨🏽|👩🏾❤️👨🏾|👩🏾❤️👨🏿|👩🏾❤️👩🏻|👩🏾❤️👩🏼|👩🏾❤️👩🏽|👩🏾❤️👩🏾|👩🏾❤️👩🏿|👩🏾🐰👩🏻|👩🏾🐰👩🏼|👩🏾🐰👩🏽|👩🏾🐰👩🏿|👩🏾🤝👨🏻|👩🏾🤝👨🏼|👩🏾🤝👨🏽|👩🏾🤝👨🏿|👩🏾🤝👩🏻|👩🏾🤝👩🏼|👩🏾🤝👩🏽|👩🏾🤝👩🏿|👩🏾👩🏻|👩🏾👩🏼|👩🏾👩🏽|👩🏾👩🏿|👩🏿❤️👨🏻|👩🏿❤️👨🏼|👩🏿❤️👨🏽|👩🏿❤️👨🏾|👩🏿❤️👨🏿|👩🏿❤️👩🏻|👩🏿❤️👩🏼|👩🏿❤️👩🏽|👩🏿❤️👩🏾|👩🏿❤️👩🏿|👩🏿🐰👩🏻|👩🏿🐰👩🏼|👩🏿🐰👩🏽|👩🏿🐰👩🏾|👩🏿🤝👨🏻|👩🏿🤝👨🏼|👩🏿🤝👨🏽|👩🏿🤝👨🏾|👩🏿🤝👩🏻|👩🏿🤝👩🏼|👩🏿🤝👩🏽|👩🏿🤝👩🏾|👩🏿👩🏻|👩🏿👩🏼|👩🏿👩🏽|👩🏿👩🏾|🧑🏻❤️🧑🏼|🧑🏻❤️🧑🏽|🧑🏻❤️🧑🏾|🧑🏻❤️🧑🏿|🧑🏻🐰🧑🏼|🧑🏻🐰🧑🏽|🧑🏻🐰🧑🏾|🧑🏻🐰🧑🏿|🧑🏻🤝🧑🏻|🧑🏻🤝🧑🏼|🧑🏻🤝🧑🏽|🧑🏻🤝🧑🏾|🧑🏻🤝🧑🏿|🧑🏻🧑🏼|🧑🏻🧑🏽|🧑🏻🧑🏾|🧑🏻🧑🏿|🧑🏼❤️🧑🏻|🧑🏼❤️🧑🏽|🧑🏼❤️🧑🏾|🧑🏼❤️🧑🏿|🧑🏼🐰🧑🏻|🧑🏼🐰🧑🏽|🧑🏼🐰🧑🏾|🧑🏼🐰🧑🏿|🧑🏼🤝🧑🏻|🧑🏼🤝🧑🏼|🧑🏼🤝🧑🏽|🧑🏼🤝🧑🏾|🧑🏼🤝🧑🏿|🧑🏼🧑🏻|🧑🏼🧑🏽|🧑🏼🧑🏾|🧑🏼🧑🏿|🧑🏽❤️🧑🏻|🧑🏽❤️🧑🏼|🧑🏽❤️🧑🏾|🧑🏽❤️🧑🏿|🧑🏽🐰🧑🏻|🧑🏽🐰🧑🏼|🧑🏽🐰🧑🏾|🧑🏽🐰🧑🏿|🧑🏽🤝🧑🏻|🧑🏽🤝🧑🏼|🧑🏽🤝🧑🏽|🧑🏽🤝🧑🏾|🧑🏽🤝🧑🏿|🧑🏽🧑🏻|🧑🏽🧑🏼|🧑🏽🧑🏾|🧑🏽🧑🏿|🧑🏾❤️🧑🏻|🧑🏾❤️🧑🏼|🧑🏾❤️🧑🏽|🧑🏾❤️🧑🏿|🧑🏾🐰🧑🏻|🧑🏾🐰🧑🏼|🧑🏾🐰🧑🏽|🧑🏾🐰🧑🏿|🧑🏾🤝🧑🏻|🧑🏾🤝🧑🏼|🧑🏾🤝🧑🏽|🧑🏾🤝🧑🏾|🧑🏾🤝🧑🏿|🧑🏾🧑🏻|🧑🏾🧑🏼|🧑🏾🧑🏽|🧑🏾🧑🏿|🧑🏿❤️🧑🏻|🧑🏿❤️🧑🏼|🧑🏿❤️🧑🏽|🧑🏿❤️🧑🏾|🧑🏿🐰🧑🏻|🧑🏿🐰🧑🏼|🧑🏿🐰🧑🏽|🧑🏿🐰🧑🏾|🧑🏿🤝🧑🏻|🧑🏿🤝🧑🏼|🧑🏿🤝🧑🏽|🧑🏿🤝🧑🏾|🧑🏿🤝🧑🏿|🧑🏿🧑🏻|🧑🏿🧑🏼|🧑🏿🧑🏽|🧑🏿🧑🏾|👨❤️💋👨|👨👨👦👦|👨👨👧👦|👨👨👧👧|👨👩👦👦|👨👩👧👦|👨👩👧👧|👩❤️💋👨|👩❤️💋👩|👩👩👦👦|👩👩👧👦|👩👩👧👧|🧑🧑🧒🧒|🏃🏻♀️➡️|🏃🏻♂️➡️|🏃🏼♀️➡️|🏃🏼♂️➡️|🏃🏽♀️➡️|🏃🏽♂️➡️|🏃🏾♀️➡️|🏃🏾♂️➡️|🏃🏿♀️➡️|🏃🏿♂️➡️|👨🏻🦯➡️|👨🏻🦼➡️|👨🏻🦽➡️|👨🏼🦯➡️|👨🏼🦼➡️|👨🏼🦽➡️|👨🏽🦯➡️|👨🏽🦼➡️|👨🏽🦽➡️|👨🏾🦯➡️|👨🏾🦼➡️|👨🏾🦽➡️|👨🏿🦯➡️|👨🏿🦼➡️|👨🏿🦽➡️|👩🏻🦯➡️|👩🏻🦼➡️|👩🏻🦽➡️|👩🏼🦯➡️|👩🏼🦼➡️|👩🏼🦽➡️|👩🏽🦯➡️|👩🏽🦼➡️|👩🏽🦽➡️|👩🏾🦯➡️|👩🏾🦼➡️|👩🏾🦽➡️|👩🏿🦯➡️|👩🏿🦼➡️|👩🏿🦽➡️|🚶🏻♀️➡️|🚶🏻♂️➡️|🚶🏼♀️➡️|🚶🏼♂️➡️|🚶🏽♀️➡️|🚶🏽♂️➡️|🚶🏾♀️➡️|🚶🏾♂️➡️|🚶🏿♀️➡️|🚶🏿♂️➡️|🧎🏻♀️➡️|🧎🏻♂️➡️|🧎🏼♀️➡️|🧎🏼♂️➡️|🧎🏽♀️➡️|🧎🏽♂️➡️|🧎🏾♀️➡️|🧎🏾♂️➡️|🧎🏿♀️➡️|🧎🏿♂️➡️|🧑🏻🦯➡️|🧑🏻🦼➡️|🧑🏻🦽➡️|🧑🏼🦯➡️|🧑🏼🦼➡️|🧑🏼🦽➡️|🧑🏽🦯➡️|🧑🏽🦼➡️|🧑🏽🦽➡️|🧑🏾🦯➡️|🧑🏾🦼➡️|🧑🏾🦽➡️|🧑🏿🦯➡️|🧑🏿🦼➡️|🧑🏿🦽➡️|🫱🏻🫲🏼|🫱🏻🫲🏽|🫱🏻🫲🏾|🫱🏻🫲🏿|🫱🏼🫲🏻|🫱🏼🫲🏽|🫱🏼🫲🏾|🫱🏼🫲🏿|🫱🏽🫲🏻|🫱🏽🫲🏼|🫱🏽🫲🏾|🫱🏽🫲🏿|🫱🏾🫲🏻|🫱🏾🫲🏼|🫱🏾🫲🏽|🫱🏾🫲🏿|🫱🏿🫲🏻|🫱🏿🫲🏼|🫱🏿🫲🏽|🫱🏿🫲🏾|🏃♀️➡️|🏃♂️➡️|👨❤️👨|👨👦👦|👨👧👦|👨👧👧|👨👨👦|👨👨👧|👨👩👦|👨👩👧|👨🦯➡️|👨🦼➡️|👨🦽➡️|👩❤️👨|👩❤️👩|👩👦👦|👩👧👦|👩👧👧|👩👩👦|👩👩👧|👩🦯➡️|👩🦼➡️|👩🦽➡️|🚶♀️➡️|🚶♂️➡️|🧎♀️➡️|🧎♂️➡️|🧑🤝🧑|🧑🦯➡️|🧑🦼➡️|🧑🦽➡️|🧑🧑🧒|🧑🧒🧒|🏃🏻♀️|🏃🏻♂️|🏃🏻➡️|🏃🏼♀️|🏃🏼♂️|🏃🏼➡️|🏃🏽♀️|🏃🏽♂️|🏃🏽➡️|🏃🏾♀️|🏃🏾♂️|🏃🏾➡️|🏃🏿♀️|🏃🏿♂️|🏃🏿➡️|🏄🏻♀️|🏄🏻♂️|🏄🏼♀️|🏄🏼♂️|🏄🏽♀️|🏄🏽♂️|🏄🏾♀️|🏄🏾♂️|🏄🏿♀️|🏄🏿♂️|🏊🏻♀️|🏊🏻♂️|🏊🏼♀️|🏊🏼♂️|🏊🏽♀️|🏊🏽♂️|🏊🏾♀️|🏊🏾♂️|🏊🏿♀️|🏊🏿♂️|🏋🏻♀️|🏋🏻♂️|🏋🏼♀️|🏋🏼♂️|🏋🏽♀️|🏋🏽♂️|🏋🏾♀️|🏋🏾♂️|🏋🏿♀️|🏋🏿♂️|🏌🏻♀️|🏌🏻♂️|🏌🏼♀️|🏌🏼♂️|🏌🏽♀️|🏌🏽♂️|🏌🏾♀️|🏌🏾♂️|🏌🏿♀️|🏌🏿♂️|👁️🗨️|👨🏻⚕️|👨🏻⚖️|👨🏻✈️|👨🏻🌾|👨🏻🍳|👨🏻🍼|👨🏻🎓|👨🏻🎤|👨🏻🎨|👨🏻🏫|👨🏻🏭|👨🏻💻|👨🏻💼|👨🏻🔧|👨🏻🔬|👨🏻🚀|👨🏻🚒|👨🏻🦯|👨🏻🦰|👨🏻🦱|👨🏻🦲|👨🏻🦳|👨🏻🦼|👨🏻🦽|👨🏼⚕️|👨🏼⚖️|👨🏼✈️|👨🏼🌾|👨🏼🍳|👨🏼🍼|👨🏼🎓|👨🏼🎤|👨🏼🎨|👨🏼🏫|👨🏼🏭|👨🏼💻|👨🏼💼|👨🏼🔧|👨🏼🔬|👨🏼🚀|👨🏼🚒|👨🏼🦯|👨🏼🦰|👨🏼🦱|👨🏼🦲|👨🏼🦳|👨🏼🦼|👨🏼🦽|👨🏽⚕️|👨🏽⚖️|👨🏽✈️|👨🏽🌾|👨🏽🍳|👨🏽🍼|👨🏽🎓|👨🏽🎤|👨🏽🎨|👨🏽🏫|👨🏽🏭|👨🏽💻|👨🏽💼|👨🏽🔧|👨🏽🔬|👨🏽🚀|👨🏽🚒|👨🏽🦯|👨🏽🦰|👨🏽🦱|👨🏽🦲|👨🏽🦳|👨🏽🦼|👨🏽🦽|👨🏾⚕️|👨🏾⚖️|👨🏾✈️|👨🏾🌾|👨🏾🍳|👨🏾🍼|👨🏾🎓|👨🏾🎤|👨🏾🎨|👨🏾🏫|👨🏾🏭|👨🏾💻|👨🏾💼|👨🏾🔧|👨🏾🔬|👨🏾🚀|👨🏾🚒|👨🏾🦯|👨🏾🦰|👨🏾🦱|👨🏾🦲|👨🏾🦳|👨🏾🦼|👨🏾🦽|👨🏿⚕️|👨🏿⚖️|👨🏿✈️|👨🏿🌾|👨🏿🍳|👨🏿🍼|👨🏿🎓|👨🏿🎤|👨🏿🎨|👨🏿🏫|👨🏿🏭|👨🏿💻|👨🏿💼|👨🏿🔧|👨🏿🔬|👨🏿🚀|👨🏿🚒|👨🏿🦯|👨🏿🦰|👨🏿🦱|👨🏿🦲|👨🏿🦳|👨🏿🦼|👨🏿🦽|👩🏻⚕️|👩🏻⚖️|👩🏻✈️|👩🏻🌾|👩🏻🍳|👩🏻🍼|👩🏻🎓|👩🏻🎤|👩🏻🎨|👩🏻🏫|👩🏻🏭|👩🏻💻|👩🏻💼|👩🏻🔧|👩🏻🔬|👩🏻🚀|👩🏻🚒|👩🏻🦯|👩🏻🦰|👩🏻🦱|👩🏻🦲|👩🏻🦳|👩🏻🦼|👩🏻🦽|👩🏼⚕️|👩🏼⚖️|👩🏼✈️|👩🏼🌾|👩🏼🍳|👩🏼🍼|👩🏼🎓|👩🏼🎤|👩🏼🎨|👩🏼🏫|👩🏼🏭|👩🏼💻|👩🏼💼|👩🏼🔧|👩🏼🔬|👩🏼🚀|👩🏼🚒|👩🏼🦯|👩🏼🦰|👩🏼🦱|👩🏼🦲|👩🏼🦳|👩🏼🦼|👩🏼🦽|👩🏽⚕️|👩🏽⚖️|👩🏽✈️|👩🏽🌾|👩🏽🍳|👩🏽🍼|👩🏽🎓|👩🏽🎤|👩🏽🎨|👩🏽🏫|👩🏽🏭|👩🏽💻|👩🏽💼|👩🏽🔧|👩🏽🔬|👩🏽🚀|👩🏽🚒|👩🏽🦯|👩🏽🦰|👩🏽🦱|👩🏽🦲|👩🏽🦳|👩🏽🦼|👩🏽🦽|👩🏾⚕️|👩🏾⚖️|👩🏾✈️|👩🏾🌾|👩🏾🍳|👩🏾🍼|👩🏾🎓|👩🏾🎤|👩🏾🎨|👩🏾🏫|👩🏾🏭|👩🏾💻|👩🏾💼|👩🏾🔧|👩🏾🔬|👩🏾🚀|👩🏾🚒|👩🏾🦯|👩🏾🦰|👩🏾🦱|👩🏾🦲|👩🏾🦳|👩🏾🦼|👩🏾🦽|👩🏿⚕️|👩🏿⚖️|👩🏿✈️|👩🏿🌾|👩🏿🍳|👩🏿🍼|👩🏿🎓|👩🏿🎤|👩🏿🎨|👩🏿🏫|👩🏿🏭|👩🏿💻|👩🏿💼|👩🏿🔧|👩🏿🔬|👩🏿🚀|👩🏿🚒|👩🏿🦯|👩🏿🦰|👩🏿🦱|👩🏿🦲|👩🏿🦳|👩🏿🦼|👩🏿🦽|👮🏻♀️|👮🏻♂️|👮🏼♀️|👮🏼♂️|👮🏽♀️|👮🏽♂️|👮🏾♀️|👮🏾♂️|👮🏿♀️|👮🏿♂️|👯🏻♀️|👯🏻♂️|👯🏼♀️|👯🏼♂️|👯🏽♀️|👯🏽♂️|👯🏾♀️|👯🏾♂️|👯🏿♀️|👯🏿♂️|👰🏻♀️|👰🏻♂️|👰🏼♀️|👰🏼♂️|👰🏽♀️|👰🏽♂️|👰🏾♀️|👰🏾♂️|👰🏿♀️|👰🏿♂️|👱🏻♀️|👱🏻♂️|👱🏼♀️|👱🏼♂️|👱🏽♀️|👱🏽♂️|👱🏾♀️|👱🏾♂️|👱🏿♀️|👱🏿♂️|👳🏻♀️|👳🏻♂️|👳🏼♀️|👳🏼♂️|👳🏽♀️|👳🏽♂️|👳🏾♀️|👳🏾♂️|👳🏿♀️|👳🏿♂️|👷🏻♀️|👷🏻♂️|👷🏼♀️|👷🏼♂️|👷🏽♀️|👷🏽♂️|👷🏾♀️|👷🏾♂️|👷🏿♀️|👷🏿♂️|💁🏻♀️|💁🏻♂️|💁🏼♀️|💁🏼♂️|💁🏽♀️|💁🏽♂️|💁🏾♀️|💁🏾♂️|💁🏿♀️|💁🏿♂️|💂🏻♀️|💂🏻♂️|💂🏼♀️|💂🏼♂️|💂🏽♀️|💂🏽♂️|💂🏾♀️|💂🏾♂️|💂🏿♀️|💂🏿♂️|💆🏻♀️|💆🏻♂️|💆🏼♀️|💆🏼♂️|💆🏽♀️|💆🏽♂️|💆🏾♀️|💆🏾♂️|💆🏿♀️|💆🏿♂️|💇🏻♀️|💇🏻♂️|💇🏼♀️|💇🏼♂️|💇🏽♀️|💇🏽♂️|💇🏾♀️|💇🏾♂️|💇🏿♀️|💇🏿♂️|🕵🏻♀️|🕵🏻♂️|🕵🏼♀️|🕵🏼♂️|🕵🏽♀️|🕵🏽♂️|🕵🏾♀️|🕵🏾♂️|🕵🏿♀️|🕵🏿♂️|🙅🏻♀️|🙅🏻♂️|🙅🏼♀️|🙅🏼♂️|🙅🏽♀️|🙅🏽♂️|🙅🏾♀️|🙅🏾♂️|🙅🏿♀️|🙅🏿♂️|🙆🏻♀️|🙆🏻♂️|🙆🏼♀️|🙆🏼♂️|🙆🏽♀️|🙆🏽♂️|🙆🏾♀️|🙆🏾♂️|🙆🏿♀️|🙆🏿♂️|🙇🏻♀️|🙇🏻♂️|🙇🏼♀️|🙇🏼♂️|🙇🏽♀️|🙇🏽♂️|🙇🏾♀️|🙇🏾♂️|🙇🏿♀️|🙇🏿♂️|🙋🏻♀️|🙋🏻♂️|🙋🏼♀️|🙋🏼♂️|🙋🏽♀️|🙋🏽♂️|🙋🏾♀️|🙋🏾♂️|🙋🏿♀️|🙋🏿♂️|🙍🏻♀️|🙍🏻♂️|🙍🏼♀️|🙍🏼♂️|🙍🏽♀️|🙍🏽♂️|🙍🏾♀️|🙍🏾♂️|🙍🏿♀️|🙍🏿♂️|🙎🏻♀️|🙎🏻♂️|🙎🏼♀️|🙎🏼♂️|🙎🏽♀️|🙎🏽♂️|🙎🏾♀️|🙎🏾♂️|🙎🏿♀️|🙎🏿♂️|🚣🏻♀️|🚣🏻♂️|🚣🏼♀️|🚣🏼♂️|🚣🏽♀️|🚣🏽♂️|🚣🏾♀️|🚣🏾♂️|🚣🏿♀️|🚣🏿♂️|🚴🏻♀️|🚴🏻♂️|🚴🏼♀️|🚴🏼♂️|🚴🏽♀️|🚴🏽♂️|🚴🏾♀️|🚴🏾♂️|🚴🏿♀️|🚴🏿♂️|🚵🏻♀️|🚵🏻♂️|🚵🏼♀️|🚵🏼♂️|🚵🏽♀️|🚵🏽♂️|🚵🏾♀️|🚵🏾♂️|🚵🏿♀️|🚵🏿♂️|🚶🏻♀️|🚶🏻♂️|🚶🏻➡️|🚶🏼♀️|🚶🏼♂️|🚶🏼➡️|🚶🏽♀️|🚶🏽♂️|🚶🏽➡️|🚶🏾♀️|🚶🏾♂️|🚶🏾➡️|🚶🏿♀️|🚶🏿♂️|🚶🏿➡️|🤦🏻♀️|🤦🏻♂️|🤦🏼♀️|🤦🏼♂️|🤦🏽♀️|🤦🏽♂️|🤦🏾♀️|🤦🏾♂️|🤦🏿♀️|🤦🏿♂️|🤵🏻♀️|🤵🏻♂️|🤵🏼♀️|🤵🏼♂️|🤵🏽♀️|🤵🏽♂️|🤵🏾♀️|🤵🏾♂️|🤵🏿♀️|🤵🏿♂️|🤷🏻♀️|🤷🏻♂️|🤷🏼♀️|🤷🏼♂️|🤷🏽♀️|🤷🏽♂️|🤷🏾♀️|🤷🏾♂️|🤷🏿♀️|🤷🏿♂️|🤸🏻♀️|🤸🏻♂️|🤸🏼♀️|🤸🏼♂️|🤸🏽♀️|🤸🏽♂️|🤸🏾♀️|🤸🏾♂️|🤸🏿♀️|🤸🏿♂️|🤹🏻♀️|🤹🏻♂️|🤹🏼♀️|🤹🏼♂️|🤹🏽♀️|🤹🏽♂️|🤹🏾♀️|🤹🏾♂️|🤹🏿♀️|🤹🏿♂️|🤼🏻♀️|🤼🏻♂️|🤼🏼♀️|🤼🏼♂️|🤼🏽♀️|🤼🏽♂️|🤼🏾♀️|🤼🏾♂️|🤼🏿♀️|🤼🏿♂️|🤽🏻♀️|🤽🏻♂️|🤽🏼♀️|🤽🏼♂️|🤽🏽♀️|🤽🏽♂️|🤽🏾♀️|🤽🏾♂️|🤽🏿♀️|🤽🏿♂️|🤾🏻♀️|🤾🏻♂️|🤾🏼♀️|🤾🏼♂️|🤾🏽♀️|🤾🏽♂️|🤾🏾♀️|🤾🏾♂️|🤾🏿♀️|🤾🏿♂️|🦸🏻♀️|🦸🏻♂️|🦸🏼♀️|🦸🏼♂️|🦸🏽♀️|🦸🏽♂️|🦸🏾♀️|🦸🏾♂️|🦸🏿♀️|🦸🏿♂️|🦹🏻♀️|🦹🏻♂️|🦹🏼♀️|🦹🏼♂️|🦹🏽♀️|🦹🏽♂️|🦹🏾♀️|🦹🏾♂️|🦹🏿♀️|🦹🏿♂️|🧍🏻♀️|🧍🏻♂️|🧍🏼♀️|🧍🏼♂️|🧍🏽♀️|🧍🏽♂️|🧍🏾♀️|🧍🏾♂️|🧍🏿♀️|🧍🏿♂️|🧎🏻♀️|🧎🏻♂️|🧎🏻➡️|🧎🏼♀️|🧎🏼♂️|🧎🏼➡️|🧎🏽♀️|🧎🏽♂️|🧎🏽➡️|🧎🏾♀️|🧎🏾♂️|🧎🏾➡️|🧎🏿♀️|🧎🏿♂️|🧎🏿➡️|🧏🏻♀️|🧏🏻♂️|🧏🏼♀️|🧏🏼♂️|🧏🏽♀️|🧏🏽♂️|🧏🏾♀️|🧏🏾♂️|🧏🏿♀️|🧏🏿♂️|🧑🏻⚕️|🧑🏻⚖️|🧑🏻✈️|🧑🏻🌾|🧑🏻🍳|🧑🏻🍼|🧑🏻🎄|🧑🏻🎓|🧑🏻🎤|🧑🏻🎨|🧑🏻🏫|🧑🏻🏭|🧑🏻💻|🧑🏻💼|🧑🏻🔧|🧑🏻🔬|🧑🏻🚀|🧑🏻🚒|🧑🏻🦯|🧑🏻🦰|🧑🏻🦱|🧑🏻🦲|🧑🏻🦳|🧑🏻🦼|🧑🏻🦽|🧑🏻🩰|🧑🏼⚕️|🧑🏼⚖️|🧑🏼✈️|🧑🏼🌾|🧑🏼🍳|🧑🏼🍼|🧑🏼🎄|🧑🏼🎓|🧑🏼🎤|🧑🏼🎨|🧑🏼🏫|🧑🏼🏭|🧑🏼💻|🧑🏼💼|🧑🏼🔧|🧑🏼🔬|🧑🏼🚀|🧑🏼🚒|🧑🏼🦯|🧑🏼🦰|🧑🏼🦱|🧑🏼🦲|🧑🏼🦳|🧑🏼🦼|🧑🏼🦽|🧑🏼🩰|🧑🏽⚕️|🧑🏽⚖️|🧑🏽✈️|🧑🏽🌾|🧑🏽🍳|🧑🏽🍼|🧑🏽🎄|🧑🏽🎓|🧑🏽🎤|🧑🏽🎨|🧑🏽🏫|🧑🏽🏭|🧑🏽💻|🧑🏽💼|🧑🏽🔧|🧑🏽🔬|🧑🏽🚀|🧑🏽🚒|🧑🏽🦯|🧑🏽🦰|🧑🏽🦱|🧑🏽🦲|🧑🏽🦳|🧑🏽🦼|🧑🏽🦽|🧑🏽🩰|🧑🏾⚕️|🧑🏾⚖️|🧑🏾✈️|🧑🏾🌾|🧑🏾🍳|🧑🏾🍼|🧑🏾🎄|🧑🏾🎓|🧑🏾🎤|🧑🏾🎨|🧑🏾🏫|🧑🏾🏭|🧑🏾💻|🧑🏾💼|🧑🏾🔧|🧑🏾🔬|🧑🏾🚀|🧑🏾🚒|🧑🏾🦯|🧑🏾🦰|🧑🏾🦱|🧑🏾🦲|🧑🏾🦳|🧑🏾🦼|🧑🏾🦽|🧑🏾🩰|🧑🏿⚕️|🧑🏿⚖️|🧑🏿✈️|🧑🏿🌾|🧑🏿🍳|🧑🏿🍼|🧑🏿🎄|🧑🏿🎓|🧑🏿🎤|🧑🏿🎨|🧑🏿🏫|🧑🏿🏭|🧑🏿💻|🧑🏿💼|🧑🏿🔧|🧑🏿🔬|🧑🏿🚀|🧑🏿🚒|🧑🏿🦯|🧑🏿🦰|🧑🏿🦱|🧑🏿🦲|🧑🏿🦳|🧑🏿🦼|🧑🏿🦽|🧑🏿🩰|🧔🏻♀️|🧔🏻♂️|🧔🏼♀️|🧔🏼♂️|🧔🏽♀️|🧔🏽♂️|🧔🏾♀️|🧔🏾♂️|🧔🏿♀️|🧔🏿♂️|🧖🏻♀️|🧖🏻♂️|🧖🏼♀️|🧖🏼♂️|🧖🏽♀️|🧖🏽♂️|🧖🏾♀️|🧖🏾♂️|🧖🏿♀️|🧖🏿♂️|🧗🏻♀️|🧗🏻♂️|🧗🏼♀️|🧗🏼♂️|🧗🏽♀️|🧗🏽♂️|🧗🏾♀️|🧗🏾♂️|🧗🏿♀️|🧗🏿♂️|🧘🏻♀️|🧘🏻♂️|🧘🏼♀️|🧘🏼♂️|🧘🏽♀️|🧘🏽♂️|🧘🏾♀️|🧘🏾♂️|🧘🏿♀️|🧘🏿♂️|🧙🏻♀️|🧙🏻♂️|🧙🏼♀️|🧙🏼♂️|🧙🏽♀️|🧙🏽♂️|🧙🏾♀️|🧙🏾♂️|🧙🏿♀️|🧙🏿♂️|🧚🏻♀️|🧚🏻♂️|🧚🏼♀️|🧚🏼♂️|🧚🏽♀️|🧚🏽♂️|🧚🏾♀️|🧚🏾♂️|🧚🏿♀️|🧚🏿♂️|🧛🏻♀️|🧛🏻♂️|🧛🏼♀️|🧛🏼♂️|🧛🏽♀️|🧛🏽♂️|🧛🏾♀️|🧛🏾♂️|🧛🏿♀️|🧛🏿♂️|🧜🏻♀️|🧜🏻♂️|🧜🏼♀️|🧜🏼♂️|🧜🏽♀️|🧜🏽♂️|🧜🏾♀️|🧜🏾♂️|🧜🏿♀️|🧜🏿♂️|🧝🏻♀️|🧝🏻♂️|🧝🏼♀️|🧝🏼♂️|🧝🏽♀️|🧝🏽♂️|🧝🏾♀️|🧝🏾♂️|🧝🏿♀️|🧝🏿♂️|⛹🏻♀️|⛹🏻♂️|⛹🏼♀️|⛹🏼♂️|⛹🏽♀️|⛹🏽♂️|⛹🏾♀️|⛹🏾♂️|⛹🏿♀️|⛹🏿♂️|🏋️♀️|🏋️♂️|🏌️♀️|🏌️♂️|🏳️⚧️|🏳️🌈|🕵️♀️|🕵️♂️|😶🌫️|⛓️💥|⛹️♀️|⛹️♂️|❤️🔥|❤️🩹|🍄🟫|🍋🟩|🏃♀️|🏃♂️|🏃➡️|🏄♀️|🏄♂️|🏊♀️|🏊♂️|🏴☠️|🐕🦺|🐦🔥|🐻❄️|👨⚕️|👨⚖️|👨✈️|👨🌾|👨🍳|👨🍼|👨🎓|👨🎤|👨🎨|👨🏫|👨🏭|👨👦|👨👧|👨💻|👨💼|👨🔧|👨🔬|👨🚀|👨🚒|👨🦯|👨🦰|👨🦱|👨🦲|👨🦳|👨🦼|👨🦽|👩⚕️|👩⚖️|👩✈️|👩🌾|👩🍳|👩🍼|👩🎓|👩🎤|👩🎨|👩🏫|👩🏭|👩👦|👩👧|👩💻|👩💼|👩🔧|👩🔬|👩🚀|👩🚒|👩🦯|👩🦰|👩🦱|👩🦲|👩🦳|👩🦼|👩🦽|👮♀️|👮♂️|👯♀️|👯♂️|👰♀️|👰♂️|👱♀️|👱♂️|👳♀️|👳♂️|👷♀️|👷♂️|💁♀️|💁♂️|💂♀️|💂♂️|💆♀️|💆♂️|💇♀️|💇♂️|😮💨|😵💫|🙂↔️|🙂↕️|🙅♀️|🙅♂️|🙆♀️|🙆♂️|🙇♀️|🙇♂️|🙋♀️|🙋♂️|🙍♀️|🙍♂️|🙎♀️|🙎♂️|🚣♀️|🚣♂️|🚴♀️|🚴♂️|🚵♀️|🚵♂️|🚶♀️|🚶♂️|🚶➡️|🤦♀️|🤦♂️|🤵♀️|🤵♂️|🤷♀️|🤷♂️|🤸♀️|🤸♂️|🤹♀️|🤹♂️|🤼♀️|🤼♂️|🤽♀️|🤽♂️|🤾♀️|🤾♂️|🦸♀️|🦸♂️|🦹♀️|🦹♂️|🧍♀️|🧍♂️|🧎♀️|🧎♂️|🧎➡️|🧏♀️|🧏♂️|🧑⚕️|🧑⚖️|🧑✈️|🧑🌾|🧑🍳|🧑🍼|🧑🎄|🧑🎓|🧑🎤|🧑🎨|🧑🏫|🧑🏭|🧑💻|🧑💼|🧑🔧|🧑🔬|🧑🚀|🧑🚒|🧑🦯|🧑🦰|🧑🦱|🧑🦲|🧑🦳|🧑🦼|🧑🦽|🧑🧒|🧑🩰|🧔♀️|🧔♂️|🧖♀️|🧖♂️|🧗♀️|🧗♂️|🧘♀️|🧘♂️|🧙♀️|🧙♂️|🧚♀️|🧚♂️|🧛♀️|🧛♂️|🧜♀️|🧜♂️|🧝♀️|🧝♂️|🧞♀️|🧞♂️|🧟♀️|🧟♂️|\*️⃣|🇦🇨|🇦🇩|🇦🇪|🇦🇫|🇦🇬|🇦🇮|🇦🇱|🇦🇲|🇦🇴|🇦🇶|🇦🇷|🇦🇸|🇦🇹|🇦🇺|🇦🇼|🇦🇽|🇦🇿|🇧🇦|🇧🇧|🇧🇩|🇧🇪|🇧🇫|🇧🇬|🇧🇭|🇧🇮|🇧🇯|🇧🇱|🇧🇲|🇧🇳|🇧🇴|🇧🇶|🇧🇷|🇧🇸|🇧🇹|🇧🇻|🇧🇼|🇧🇾|🇧🇿|🇨🇦|🇨🇨|🇨🇩|🇨🇫|🇨🇬|🇨🇭|🇨🇮|🇨🇰|🇨🇱|🇨🇲|🇨🇳|🇨🇴|🇨🇵|🇨🇶|🇨🇷|🇨🇺|🇨🇻|🇨🇼|🇨🇽|🇨🇾|🇨🇿|🇩🇪|🇩🇬|🇩🇯|🇩🇰|🇩🇲|🇩🇴|🇩🇿|🇪🇦|🇪🇨|🇪🇪|🇪🇬|🇪🇭|🇪🇷|🇪🇸|🇪🇹|🇪🇺|🇫🇮|🇫🇯|🇫🇰|🇫🇲|🇫🇴|🇫🇷|🇬🇦|🇬🇧|🇬🇩|🇬🇪|🇬🇫|🇬🇬|🇬🇭|🇬🇮|🇬🇱|🇬🇲|🇬🇳|🇬🇵|🇬🇶|🇬🇷|🇬🇸|🇬🇹|🇬🇺|🇬🇼|🇬🇾|🇭🇰|🇭🇲|🇭🇳|🇭🇷|🇭🇹|🇭🇺|🇮🇨|🇮🇩|🇮🇪|🇮🇱|🇮🇲|🇮🇳|🇮🇴|🇮🇶|🇮🇷|🇮🇸|🇮🇹|🇯🇪|🇯🇲|🇯🇴|🇯🇵|🇰🇪|🇰🇬|🇰🇭|🇰🇮|🇰🇲|🇰🇳|🇰🇵|🇰🇷|🇰🇼|🇰🇾|🇰🇿|🇱🇦|🇱🇧|🇱🇨|🇱🇮|🇱🇰|🇱🇷|🇱🇸|🇱🇹|🇱🇺|🇱🇻|🇱🇾|🇲🇦|🇲🇨|🇲🇩|🇲🇪|🇲🇫|🇲🇬|🇲🇭|🇲🇰|🇲🇱|🇲🇲|🇲🇳|🇲🇴|🇲🇵|🇲🇶|🇲🇷|🇲🇸|🇲🇹|🇲🇺|🇲🇻|🇲🇼|🇲🇽|🇲🇾|🇲🇿|🇳🇦|🇳🇨|🇳🇪|🇳🇫|🇳🇬|🇳🇮|🇳🇱|🇳🇴|🇳🇵|🇳🇷|🇳🇺|🇳🇿|🇴🇲|🇵🇦|🇵🇪|🇵🇫|🇵🇬|🇵🇭|🇵🇰|🇵🇱|🇵🇲|🇵🇳|🇵🇷|🇵🇸|🇵🇹|🇵🇼|🇵🇾|🇶🇦|🇷🇪|🇷🇴|🇷🇸|🇷🇺|🇷🇼|🇸🇦|🇸🇧|🇸🇨|🇸🇩|🇸🇪|🇸🇬|🇸🇭|🇸🇮|🇸🇯|🇸🇰|🇸🇱|🇸🇲|🇸🇳|🇸🇴|🇸🇷|🇸🇸|🇸🇹|🇸🇻|🇸🇽|🇸🇾|🇸🇿|🇹🇦|🇹🇨|🇹🇩|🇹🇫|🇹🇬|🇹🇭|🇹🇯|🇹🇰|🇹🇱|🇹🇲|🇹🇳|🇹🇴|🇹🇷|🇹🇹|🇹🇻|🇹🇼|🇹🇿|🇺🇦|🇺🇬|🇺🇲|🇺🇳|🇺🇸|🇺🇾|🇺🇿|🇻🇦|🇻🇨|🇻🇪|🇻🇬|🇻🇮|🇻🇳|🇻🇺|🇼🇫|🇼🇸|🇽🇰|🇾🇪|🇾🇹|🇿🇦|🇿🇲|🇿🇼|🎅🏻|🎅🏼|🎅🏽|🎅🏾|🎅🏿|🏂🏻|🏂🏼|🏂🏽|🏂🏾|🏂🏿|🏃🏻|🏃🏼|🏃🏽|🏃🏾|🏃🏿|🏄🏻|🏄🏼|🏄🏽|🏄🏾|🏄🏿|🏇🏻|🏇🏼|🏇🏽|🏇🏾|🏇🏿|🏊🏻|🏊🏼|🏊🏽|🏊🏾|🏊🏿|🏋🏻|🏋🏼|🏋🏽|🏋🏾|🏋🏿|🏌🏻|🏌🏼|🏌🏽|🏌🏾|🏌🏿|🐈⬛|🐦⬛|👂🏻|👂🏼|👂🏽|👂🏾|👂🏿|👃🏻|👃🏼|👃🏽|👃🏾|👃🏿|👆🏻|👆🏼|👆🏽|👆🏾|👆🏿|👇🏻|👇🏼|👇🏽|👇🏾|👇🏿|👈🏻|👈🏼|👈🏽|👈🏾|👈🏿|👉🏻|👉🏼|👉🏽|👉🏾|👉🏿|👊🏻|👊🏼|👊🏽|👊🏾|👊🏿|👋🏻|👋🏼|👋🏽|👋🏾|👋🏿|👌🏻|👌🏼|👌🏽|👌🏾|👌🏿|👍🏻|👍🏼|👍🏽|👍🏾|👍🏿|👎🏻|👎🏼|👎🏽|👎🏾|👎🏿|👏🏻|👏🏼|👏🏽|👏🏾|👏🏿|👐🏻|👐🏼|👐🏽|👐🏾|👐🏿|👦🏻|👦🏼|👦🏽|👦🏾|👦🏿|👧🏻|👧🏼|👧🏽|👧🏾|👧🏿|👨🏻|👨🏼|👨🏽|👨🏾|👨🏿|👩🏻|👩🏼|👩🏽|👩🏾|👩🏿|👫🏻|👫🏼|👫🏽|👫🏾|👫🏿|👬🏻|👬🏼|👬🏽|👬🏾|👬🏿|👭🏻|👭🏼|👭🏽|👭🏾|👭🏿|👮🏻|👮🏼|👮🏽|👮🏾|👮🏿|👯🏻|👯🏼|👯🏽|👯🏾|👯🏿|👰🏻|👰🏼|👰🏽|👰🏾|👰🏿|👱🏻|👱🏼|👱🏽|👱🏾|👱🏿|👲🏻|👲🏼|👲🏽|👲🏾|👲🏿|👳🏻|👳🏼|👳🏽|👳🏾|👳🏿|👴🏻|👴🏼|👴🏽|👴🏾|👴🏿|👵🏻|👵🏼|👵🏽|👵🏾|👵🏿|👶🏻|👶🏼|👶🏽|👶🏾|👶🏿|👷🏻|👷🏼|👷🏽|👷🏾|👷🏿|👸🏻|👸🏼|👸🏽|👸🏾|👸🏿|👼🏻|👼🏼|👼🏽|👼🏾|👼🏿|💁🏻|💁🏼|💁🏽|💁🏾|💁🏿|💂🏻|💂🏼|💂🏽|💂🏾|💂🏿|💃🏻|💃🏼|💃🏽|💃🏾|💃🏿|💅🏻|💅🏼|💅🏽|💅🏾|💅🏿|💆🏻|💆🏼|💆🏽|💆🏾|💆🏿|💇🏻|💇🏼|💇🏽|💇🏾|💇🏿|💏🏻|💏🏼|💏🏽|💏🏾|💏🏿|💑🏻|💑🏼|💑🏽|💑🏾|💑🏿|💪🏻|💪🏼|💪🏽|💪🏾|💪🏿|🕴🏻|🕴🏼|🕴🏽|🕴🏾|🕴🏿|🕵🏻|🕵🏼|🕵🏽|🕵🏾|🕵🏿|🕺🏻|🕺🏼|🕺🏽|🕺🏾|🕺🏿|🖐🏻|🖐🏼|🖐🏽|🖐🏾|🖐🏿|🖕🏻|🖕🏼|🖕🏽|🖕🏾|🖕🏿|🖖🏻|🖖🏼|🖖🏽|🖖🏾|🖖🏿|🙅🏻|🙅🏼|🙅🏽|🙅🏾|🙅🏿|🙆🏻|🙆🏼|🙆🏽|🙆🏾|🙆🏿|🙇🏻|🙇🏼|🙇🏽|🙇🏾|🙇🏿|🙋🏻|🙋🏼|🙋🏽|🙋🏾|🙋🏿|🙌🏻|🙌🏼|🙌🏽|🙌🏾|🙌🏿|🙍🏻|🙍🏼|🙍🏽|🙍🏾|🙍🏿|🙎🏻|🙎🏼|🙎🏽|🙎🏾|🙎🏿|🙏🏻|🙏🏼|🙏🏽|🙏🏾|🙏🏿|🚣🏻|🚣🏼|🚣🏽|🚣🏾|🚣🏿|🚴🏻|🚴🏼|🚴🏽|🚴🏾|🚴🏿|🚵🏻|🚵🏼|🚵🏽|🚵🏾|🚵🏿|🚶🏻|🚶🏼|🚶🏽|🚶🏾|🚶🏿|🛀🏻|🛀🏼|🛀🏽|🛀🏾|🛀🏿|🛌🏻|🛌🏼|🛌🏽|🛌🏾|🛌🏿|🤌🏻|🤌🏼|🤌🏽|🤌🏾|🤌🏿|🤏🏻|🤏🏼|🤏🏽|🤏🏾|🤏🏿|🤘🏻|🤘🏼|🤘🏽|🤘🏾|🤘🏿|🤙🏻|🤙🏼|🤙🏽|🤙🏾|🤙🏿|🤚🏻|🤚🏼|🤚🏽|🤚🏾|🤚🏿|🤛🏻|🤛🏼|🤛🏽|🤛🏾|🤛🏿|🤜🏻|🤜🏼|🤜🏽|🤜🏾|🤜🏿|🤝🏻|🤝🏼|🤝🏽|🤝🏾|🤝🏿|🤞🏻|🤞🏼|🤞🏽|🤞🏾|🤞🏿|🤟🏻|🤟🏼|🤟🏽|🤟🏾|🤟🏿|🤦🏻|🤦🏼|🤦🏽|🤦🏾|🤦🏿|🤰🏻|🤰🏼|🤰🏽|🤰🏾|🤰🏿|🤱🏻|🤱🏼|🤱🏽|🤱🏾|🤱🏿|🤲🏻|🤲🏼|🤲🏽|🤲🏾|🤲🏿|🤳🏻|🤳🏼|🤳🏽|🤳🏾|🤳🏿|🤴🏻|🤴🏼|🤴🏽|🤴🏾|🤴🏿|🤵🏻|🤵🏼|🤵🏽|🤵🏾|🤵🏿|🤶🏻|🤶🏼|🤶🏽|🤶🏾|🤶🏿|🤷🏻|🤷🏼|🤷🏽|🤷🏾|🤷🏿|🤸🏻|🤸🏼|🤸🏽|🤸🏾|🤸🏿|🤹🏻|🤹🏼|🤹🏽|🤹🏾|🤹🏿|🤼🏻|🤼🏼|🤼🏽|🤼🏾|🤼🏿|🤽🏻|🤽🏼|🤽🏽|🤽🏾|🤽🏿|🤾🏻|🤾🏼|🤾🏽|🤾🏾|🤾🏿|🥷🏻|🥷🏼|🥷🏽|🥷🏾|🥷🏿|🦵🏻|🦵🏼|🦵🏽|🦵🏾|🦵🏿|🦶🏻|🦶🏼|🦶🏽|🦶🏾|🦶🏿|🦸🏻|🦸🏼|🦸🏽|🦸🏾|🦸🏿|🦹🏻|🦹🏼|🦹🏽|🦹🏾|🦹🏿|🦻🏻|🦻🏼|🦻🏽|🦻🏾|🦻🏿|🧍🏻|🧍🏼|🧍🏽|🧍🏾|🧍🏿|🧎🏻|🧎🏼|🧎🏽|🧎🏾|🧎🏿|🧏🏻|🧏🏼|🧏🏽|🧏🏾|🧏🏿|🧑🏻|🧑🏼|🧑🏽|🧑🏾|🧑🏿|🧒🏻|🧒🏼|🧒🏽|🧒🏾|🧒🏿|🧓🏻|🧓🏼|🧓🏽|🧓🏾|🧓🏿|🧔🏻|🧔🏼|🧔🏽|🧔🏾|🧔🏿|🧕🏻|🧕🏼|🧕🏽|🧕🏾|🧕🏿|🧖🏻|🧖🏼|🧖🏽|🧖🏾|🧖🏿|🧗🏻|🧗🏼|🧗🏽|🧗🏾|🧗🏿|🧘🏻|🧘🏼|🧘🏽|🧘🏾|🧘🏿|🧙🏻|🧙🏼|🧙🏽|🧙🏾|🧙🏿|🧚🏻|🧚🏼|🧚🏽|🧚🏾|🧚🏿|🧛🏻|🧛🏼|🧛🏽|🧛🏾|🧛🏿|🧜🏻|🧜🏼|🧜🏽|🧜🏾|🧜🏿|🧝🏻|🧝🏼|🧝🏽|🧝🏾|🧝🏿|🫃🏻|🫃🏼|🫃🏽|🫃🏾|🫃🏿|🫄🏻|🫄🏼|🫄🏽|🫄🏾|🫄🏿|🫅🏻|🫅🏼|🫅🏽|🫅🏾|🫅🏿|🫰🏻|🫰🏼|🫰🏽|🫰🏾|🫰🏿|🫱🏻|🫱🏼|🫱🏽|🫱🏾|🫱🏿|🫲🏻|🫲🏼|🫲🏽|🫲🏾|🫲🏿|🫳🏻|🫳🏼|🫳🏽|🫳🏾|🫳🏿|🫴🏻|🫴🏼|🫴🏽|🫴🏾|🫴🏿|🫵🏻|🫵🏼|🫵🏽|🫵🏾|🫵🏿|🫶🏻|🫶🏼|🫶🏽|🫶🏾|🫶🏿|🫷🏻|🫷🏼|🫷🏽|🫷🏾|🫷🏿|🫸🏻|🫸🏼|🫸🏽|🫸🏾|🫸🏿|#️⃣|0️⃣|1️⃣|2️⃣|3️⃣|4️⃣|5️⃣|6️⃣|7️⃣|8️⃣|9️⃣|☝🏻|☝🏼|☝🏽|☝🏾|☝🏿|⛹🏻|⛹🏼|⛹🏽|⛹🏾|⛹🏿|✊🏻|✊🏼|✊🏽|✊🏾|✊🏿|✋🏻|✋🏼|✋🏽|✋🏾|✋🏿|✌🏻|✌🏼|✌🏽|✌🏾|✌🏿|✍🏻|✍🏼|✍🏽|✍🏾|✍🏿|🅰️|🅱️|🅾️|🅿️|🈂️|🈷️|🌡️|🌤️|🌥️|🌦️|🌧️|🌨️|🌩️|🌪️|🌫️|🌬️|🌶️|🍽️|🎖️|🎗️|🎙️|🎚️|🎛️|🎞️|🎟️|🏋️|🏌️|🏍️|🏎️|🏔️|🏕️|🏖️|🏗️|🏘️|🏙️|🏚️|🏛️|🏜️|🏝️|🏞️|🏟️|🏳️|🏵️|🏷️|🐿️|👁️|📽️|🕉️|🕊️|🕯️|🕰️|🕳️|🕴️|🕵️|🕶️|🕷️|🕸️|🕹️|🖇️|🖊️|🖋️|🖌️|🖍️|🖐️|🖥️|🖨️|🖱️|🖲️|🖼️|🗂️|🗃️|🗄️|🗑️|🗒️|🗓️|🗜️|🗝️|🗞️|🗡️|🗣️|🗨️|🗯️|🗳️|🗺️|🛋️|🛍️|🛎️|🛏️|🛠️|🛡️|🛢️|🛣️|🛤️|🛥️|🛩️|🛰️|🛳️|©️|®️|‼️|⁉️|™️|ℹ️|↔️|↕️|↖️|↗️|↘️|↙️|↩️|↪️|⌨️|⏏️|⏭️|⏮️|⏯️|⏱️|⏲️|⏸️|⏹️|⏺️|Ⓜ️|▪️|▫️|▶️|◀️|◻️|◼️|☀️|☁️|☂️|☃️|☄️|☎️|☑️|☘️|☝️|☠️|☢️|☣️|☦️|☪️|☮️|☯️|☸️|☹️|☺️|♀️|♂️|♟️|♠️|♣️|♥️|♦️|♨️|♻️|♾️|⚒️|⚔️|⚕️|⚖️|⚗️|⚙️|⚛️|⚜️|⚠️|⚧️|⚰️|⚱️|⛈️|⛏️|⛑️|⛓️|⛩️|⛰️|⛱️|⛴️|⛷️|⛸️|⛹️|✂️|✈️|✉️|✌️|✍️|✏️|✒️|✔️|✖️|✝️|✡️|✳️|✴️|❄️|❇️|❣️|❤️|➡️|⤴️|⤵️|⬅️|⬆️|⬇️|〰️|〽️|㊗️|㊙️|[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55\u{1F004}\u{1F0CF}\u{1F18E}\u{1F191}-\u{1F19A}\u{1F201}\u{1F21A}\u{1F22F}\u{1F232}-\u{1F236}\u{1F238}-\u{1F23A}\u{1F250}\u{1F251}\u{1F300}-\u{1F320}\u{1F32D}-\u{1F335}\u{1F337}-\u{1F37C}\u{1F37E}-\u{1F393}\u{1F3A0}-\u{1F3CA}\u{1F3CF}-\u{1F3D3}\u{1F3E0}-\u{1F3F0}\u{1F3F4}\u{1F3F8}-\u{1F43E}\u{1F440}\u{1F442}-\u{1F4FC}\u{1F4FF}-\u{1F53D}\u{1F54B}-\u{1F54E}\u{1F550}-\u{1F567}\u{1F57A}\u{1F595}\u{1F596}\u{1F5A4}\u{1F5FB}-\u{1F64F}\u{1F680}-\u{1F6C5}\u{1F6CC}\u{1F6D0}-\u{1F6D2}\u{1F6D5}-\u{1F6D8}\u{1F6DC}-\u{1F6DF}\u{1F6EB}\u{1F6EC}\u{1F6F4}-\u{1F6FC}\u{1F7E0}-\u{1F7EB}\u{1F7F0}\u{1F90C}-\u{1F93A}\u{1F93C}-\u{1F945}\u{1F947}-\u{1F9FF}\u{1FA70}-\u{1FA7C}\u{1FA80}-\u{1FA8A}\u{1FA8E}-\u{1FAC6}\u{1FAC8}\u{1FACD}-\u{1FADC}\u{1FADF}-\u{1FAEA}\u{1FAEF}-\u{1FAF8}])/gu).length):i=d().createElement(d().Fragment,null,d().createElement("i",{className:"material-icons gray"},"warning_amber")," ",d().createElement("i",{className:"gray"},d().createElement(c.FormattedMessage,{id:"invalid_content",defaultMessage:[{type:0,value:"invalid content"}]})));return d().createElement("li",{ref:this.props.innerRef,className:e},this.props.isGroup&&this.props.response?d().createElement("div",{className:"avatar-box"},s?d().createElement(On.A,{authorizeURL:this.props.tinode.authorizeURL,topic:this.props.userFrom,title:this.props.userName,avatar:n}):null):null,d().createElement("div",null,d().createElement("div",{className:t},d().createElement("div",{className:"content-meta"},d().createElement("div",{className:a},i,r),this.props.timestamp?d().createElement(na,{edited:this.props.edited,timestamp:this.props.timestamp,received:this.props.received}):null),this.props.showContextMenu?d().createElement("span",{className:"menuTrigger"},d().createElement("a",{href:"#",onClick:this.handleContextClick},d().createElement("i",{className:"material-icons"},"expand_more"))):null),s?d().createElement("div",{className:"author"},this.props.userName||d().createElement("i",null,d().createElement(c.FormattedMessage,{id:"user_not_found",defaultMessage:[{type:0,value:"Not found"}]}))):null))}}const ra=(0,c.injectIntl)(ia);var oa=d().forwardRef((e,t)=>d().createElement(ra,sa({innerRef:t},e))),da=r(504);const la=d().lazy(e=>Promise.all([r.e(537),r.e(0)]).then(r.bind(r,4e3))),ca=(0,c.defineMessages)({messaging_disabled:{id:"messaging_disabled_prompt",defaultMessage:[{type:0,value:"Messaging disabled"}]},type_new_message:{id:"new_message_prompt",defaultMessage:[{type:0,value:"New message"}]},add_image_caption:{id:"image_caption_prompt",defaultMessage:[{type:0,value:"Image caption"}]},file_attachment_too_large:{id:"file_attachment_too_large",defaultMessage:[{type:0,value:"The file size "},{type:1,value:"size"},{type:0,value:" exceeds the "},{type:1,value:"limit"},{type:0,value:" limit."}]},cannot_initiate_upload:{id:"cannot_initiate_file_upload",defaultMessage:[{type:0,value:"Cannot initiate file upload."}]},icon_title_record_voice:{id:"icon_title_record_voice",defaultMessage:[{type:0,value:"Record voice message"}]},icon_title_attach_file:{id:"icon_title_attach_file",defaultMessage:[{type:0,value:"Attach file"}]},icon_title_add_image:{id:"icon_title_add_image",defaultMessage:[{type:0,value:"Add image"}]},icon_title_send:{id:"icon_title_send",defaultMessage:[{type:0,value:"Send message"}]}});class ha extends d().PureComponent{constructor(e){super(e),this.state={quote:null,message:"",audioRec:!1,audioAvailable:!(!navigator.mediaDevices||!navigator.mediaDevices.getUserMedia)},this.keypressTimestamp=0,this.handlePasteEvent=this.handlePasteEvent.bind(this),this.handleAttachImage=this.handleAttachImage.bind(this),this.handleAttachFile=this.handleAttachFile.bind(this),this.handleAttachAudio=this.handleAttachAudio.bind(this),this.handleSend=this.handleSend.bind(this),this.handleKeyPress=this.handleKeyPress.bind(this),this.handleMessageTyping=this.handleMessageTyping.bind(this),this.handleDropAttach=this.handleDropAttach.bind(this),this.handleQuoteClick=this.handleQuoteClick.bind(this),this.formatReply=this.formatReply.bind(this)}componentDidMount(){this.messageEditArea&&(this.messageEditArea.addEventListener("paste",this.handlePasteEvent,!1),"all"==window.getComputedStyle(this.messageEditArea).getPropertyValue("transition-property")&&this.messageEditArea.focus()),this.setState({quote:this.formatReply()})}componentWillUnmount(){this.messageEditArea&&this.messageEditArea.removeEventListener("paste",this.handlePasteEvent,!1)}componentDidUpdate(e){if(this.messageEditArea&&("all"==window.getComputedStyle(this.messageEditArea).getPropertyValue("transition-property")&&this.messageEditArea.focus(),this.messageEditArea.style.height="0px",this.messageEditArea.style.height=this.messageEditArea.scrollHeight+"px"),e.topicName!=this.props.topicName)this.setState({message:this.props.initMessage||"",audioRec:!1,quote:null});else if(e.initMessage!=this.props.initMessage){const e=this.props.initMessage||"";this.setState({message:e},t=>{this.messageEditArea.scrollTop=this.messageEditArea.scrollHeight,this.messageEditArea.setSelectionRange(e.length,e.length)})}e.reply!=this.props.reply&&this.setState({quote:this.formatReply()})}formatReply(){return this.props.reply?Tn.Drafty.format(this.props.reply.content,aa.NV,{formatMessage:this.props.intl.formatMessage.bind(this.props.intl),authorizeURL:this.props.tinode.authorizeURL.bind(this.props.tinode)}):null}handlePasteEvent(e){this.props.disabled||(0,Un.iJ)(e,e=>{this.props.onAttachImage(e)},e=>{this.props.onAttachFile(e)},this.props.onError)&&e.preventDefault()}handleAttachImage(e){e.target.files&&e.target.files.length>0&&this.props.onAttachImage(e.target.files[0]),e.target.value=""}handleAttachFile(e){e.target.files&&e.target.files.length>0&&this.props.onAttachFile(e.target.files[0]),e.target.value=""}handleDropAttach(e){e&&e.length>0&&this.props.onAttachFile(e[0])}handleAttachAudio(e,t,n){this.setState({audioRec:!1}),this.props.onAttachAudio(e,t,n)}handleSend(e){e.preventDefault();const t=this.state.message.trim();(t||this.props.acceptBlank||this.props.noInput)&&(this.props.onSendMessage(t),this.setState({message:""}))}handleKeyPress(e){if(this.state.audioRec)return e.preventDefault(),void e.stopPropagation();"Enter"===e.key&&("plain"==this.props.sendOnEnter?e.shiftKey||(e.preventDefault(),e.stopPropagation(),this.handleSend(e)):(e.ctrlKey||e.metaKey)&&(e.preventDefault(),e.stopPropagation(),this.handleSend(e)))}handleMessageTyping(e){if(this.setState({message:e.target.value}),this.props.onKeyPress){const e=(new Date).getTime();e-this.keypressTimestamp>kn.NR&&(this.props.onKeyPress(),this.keypressTimestamp=e)}}handleQuoteClick(e){if(e.preventDefault(),e.stopPropagation(),this.props.reply&&this.props.onQuoteClick){const e=this.props.reply.seq;this.props.onQuoteClick(e)}}render(){const{formatMessage:e}=this.props.intl,t=this.props.disabled?e(ca.messaging_disabled):this.props.messagePrompt?e(ca[this.props.messagePrompt]):e(ca.type_new_message),n=this.props.reply&&this.props.reply.editing?"check_circle":"send",a=this.state.quote?d().createElement("div",{id:"reply-quote-preview"},d().createElement("div",{className:"cancel"},d().createElement("a",{href:"#",onClick:e=>{e.preventDefault(),this.props.onCancelReply()}},d().createElement("i",{className:"material-icons gray"},"close"))),this.state.quote):null,s=this.state.audioAvailable&&this.props.onAttachAudio;return d().createElement("div",{id:"send-message-wrapper"},this.props.noInput?null:a,d().createElement("div",{id:"send-message-panel"},this.props.disabled?d().createElement("div",{id:"writing-disabled"},t):d().createElement(d().Fragment,null,this.props.onAttachFile&&!this.state.audioRec?d().createElement(d().Fragment,null,d().createElement("a",{href:"#",onClick:e=>{e.preventDefault(),this.attachImage.click()},title:e(ca.icon_title_add_image)},d().createElement("i",{className:"material-icons secondary"},"photo")),d().createElement("a",{href:"#",onClick:e=>{e.preventDefault(),this.attachFile.click()},title:e(ca.icon_title_attach_file)},d().createElement("i",{className:"material-icons secondary"},"attach_file"))):null,this.props.noInput?a||d().createElement("div",{className:"hr thin"}):this.state.audioRec?d().createElement(o.Suspense,{fallback:d().createElement("div",null,d().createElement(c.FormattedMessage,{id:"loading_note",defaultMessage:[{type:0,value:"Loading..."}]}))},d().createElement(la,{onRecordingProgress:e=>this.props.onKeyPress(!0),onDeleted:e=>this.setState({audioRec:!1}),onFinished:this.handleAttachAudio})):d().createElement("textarea",{id:"send-message-input",placeholder:t,value:this.state.message,onChange:this.handleMessageTyping,onKeyDown:this.handleKeyPress,ref:e=>{this.messageEditArea=e}}),this.state.message||!s?d().createElement("a",{href:"#",onClick:this.handleSend,title:e(ca.icon_title_send)},d().createElement("i",{className:"material-icons"},n)):this.state.audioRec?null:d().createElement("a",{href:"#",onClick:e=>{e.preventDefault(),this.setState({audioRec:!0})},title:e(ca.icon_title_record_voice)},d().createElement("i",{className:"material-icons"},"mic")),d().createElement("input",{type:"file",ref:e=>{this.attachFile=e},onChange:this.handleAttachFile,style:{display:"none"}}),d().createElement("input",{type:"file",ref:e=>{this.attachImage=e},accept:"image/*, video/*",onChange:this.handleAttachImage,style:{display:"none"}}))))}}var pa=(0,c.injectIntl)(ha);class ua extends d().PureComponent{constructor(e){super(e),this.handleSendDoc=this.handleSendDoc.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this)}componentDidMount(){document.addEventListener("keydown",this.handleKeyDown)}componentWillUnmount(){document.removeEventListener("keydown",this.handleKeyDown)}handleKeyDown(e){e.preventDefault(),"Escape"===e.key&&this.props.onClose()}handleSendDoc(e){this.props.onClose(),this.props.onSendMessage(this.props.content.file)}render(){return this.props.content?d().createElement("div",{id:"image-preview"},d().createElement("div",{id:"image-preview-caption-panel"},d().createElement("span",null,this.props.content.name),d().createElement("a",{href:"#",onClick:e=>{e.preventDefault(),this.props.onClose()}},d().createElement("i",{className:"material-icons gray"},"close"))),d().createElement("div",{id:"image-preview-container"},d().createElement("div",{className:"doc-card"},d().createElement("i",{className:"material-icons gray"},function(e){const t={default:"insert_drive_file",image:"image",text:"description",video:"theaters"};return t[e]||t[(e||"").split("/")[0]]||t.default}(this.props.content.type)),d().createElement("div",null,d().createElement("b",null,d().createElement(c.FormattedMessage,{id:"label_file_name",defaultMessage:[{type:0,value:"File name:"}]}))," ",(0,jn.Tu)(this.props.content.name,24)||"-"),d().createElement("div",null,d().createElement("b",null,d().createElement(c.FormattedMessage,{id:"label_content_type",defaultMessage:[{type:0,value:"Content type:"}]}))," ",this.props.content.type||"application/octet-stream"),d().createElement("div",null,d().createElement("b",null,d().createElement(c.FormattedMessage,{id:"label_size",defaultMessage:[{type:0,value:"Size:"}]}))," ",(0,jn.lX)(this.props.content.size)))),d().createElement(pa,{noInput:!0,tinode:this.props.tinode,reply:this.props.reply,onCancelReply:this.props.onCancelReply,onSendMessage:this.handleSendDoc,onError:this.props.onError})):null}}var ma=r(1334);class ga extends d().Component{constructor(e){super(e)}render(){const e=[],t=(this.props.subscribers||[]).length,n=Math.min(kn.DT,t);return(this.props.subscribers||[]).some(t=>(e.push(d().createElement("div",{className:"avatar-box",key:t.user},d().createElement(On.A,{authorizeURL:this.props.tinode.authorizeURL,topic:t.user,avatar:(0,Un.to)(t.public?t.public.photo:null)||!0,title:t.public?t.public.fn:null}))),e.length==n)),0==e.length?null:d().createElement("div",{id:"topic-users"},e," ",t>n?d().createElement("span",null,d().createElement(c.FormattedMessage,{id:"more_online_members",defaultMessage:[{type:0,value:"+"},{type:1,value:"overflow"},{type:0,value:" more"}],values:{overflow:t-n}})):null)}}class fa extends d().PureComponent{constructor(e){super(e),this.state={width:0,height:0},this.handleSendImage=this.handleSendImage.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this)}componentDidMount(){document.addEventListener("keydown",this.handleKeyDown)}componentWillUnmount(){document.removeEventListener("keydown",this.handleKeyDown)}handleKeyDown(e){this.props.onSendMessage||(e.preventDefault(),"Escape"===e.key&&this.props.onClose())}assignWidth(e){if(e&&!this.state.width){const t=e.getBoundingClientRect();this.setState({width:0|t.width,height:0|t.height})}}handleSendImage(e){this.props.onClose(),this.props.onSendMessage(e,this.props.content.blob)}render(){if(!this.props.content)return null;const e=(0,Un.ae)(this.props.content.width,this.props.content.height,this.state.width,this.state.height,!1),t=e?{width:e.dstWidth+"px",height:e.dstHeight+"px"}:this.props.content.width>this.props.content.height?{width:"100%"}:{height:"100%"};t.maxWidth="100%",t.maxHeight="100%";const n=Math.max((this.state.width/kn.JS/1.5|0)-2,12),a=(0,jn.Tu)(this.props.content.filename,n)||"-",s=this.props.content.width||"-",i=this.props.content.height||"-",r=(0,Jn.FH)(this.props.content.url);return d().createElement("div",{id:"image-preview"},d().createElement("div",{id:"image-preview-caption-panel"},this.props.onSendMessage?d().createElement("span",null,a):d().createElement("a",{href:r,download:this.props.content.filename},d().createElement("i",{className:"material-icons"},"file_download")," ",d().createElement(c.FormattedMessage,{id:"download_action",defaultMessage:[{type:0,value:"download"}]})),d().createElement("a",{href:"#",onClick:e=>{e.preventDefault(),this.props.onClose()}},d().createElement("i",{className:"material-icons gray"},"close"))),d().createElement("div",{id:"image-preview-container",ref:e=>this.assignWidth(e)},d().createElement("img",{src:this.props.content.url,style:t,className:"image-preview",alt:this.props.content.filename})),this.props.onSendMessage?d().createElement(pa,{messagePrompt:"add_image_caption",acceptBlank:!0,tinode:this.props.tinode,reply:this.props.reply,onCancelReply:this.props.onCancelReply,onSendMessage:this.handleSendImage,onError:this.props.onError}):d().createElement("div",{id:"image-preview-footer"},d().createElement("div",null,d().createElement("div",null,d().createElement("b",null,d().createElement(c.FormattedMessage,{id:"label_file_name",defaultMessage:[{type:0,value:"File name:"}]}))),d().createElement("div",null,d().createElement("span",{title:this.props.content.filename},a))),d().createElement("div",null,d().createElement("div",null,d().createElement("b",null,d().createElement(c.FormattedMessage,{id:"label_content_type",defaultMessage:[{type:0,value:"Content type:"}]}))),d().createElement("div",null,this.props.content.type)),d().createElement("div",null,d().createElement("div",null,d().createElement("b",null,d().createElement(c.FormattedMessage,{id:"label_size",defaultMessage:[{type:0,value:"Size:"}]}))),d().createElement("div",null,s," × ",i," px; ",(0,jn.lX)(this.props.content.size)))))}}class va extends d().PureComponent{constructor(e){super(e),this.handleButtonAction=this.handleButtonAction.bind(this)}handleButtonAction(e,t){e.preventDefault(),this.props.onAction(t)}render(){return d().createElement("div",{className:"accept-invite-panel"},d().createElement("div",{className:"title"},d().createElement(c.FormattedMessage,{id:"chat_invitation",defaultMessage:[{type:0,value:"You are invited to start a new chat. What would you like to do?"}]})),d().createElement("div",{className:"footer"},d().createElement("button",{className:"primary",onClick:e=>{this.handleButtonAction(e,"accept")}},d().createElement(c.FormattedMessage,{id:"chat_invitation_accept",defaultMessage:[{type:0,value:"Accept"}]})),d().createElement("button",{className:"secondary",onClick:e=>{this.handleButtonAction(e,"delete")}},d().createElement(c.FormattedMessage,{id:"chat_invitation_ignore",defaultMessage:[{type:0,value:"Ignore"}]})),d().createElement("button",{className:"secondary",onClick:e=>{this.handleButtonAction(e,"block")}},d().createElement(c.FormattedMessage,{id:"chat_invitation_block",defaultMessage:[{type:0,value:"Block"}]}))))}}var $a=r(1013);class ba extends d().PureComponent{render(){const e=kn.C3+" ("+Tn.Tinode.getLibrary()+")";return d().createElement("div",{id:"dummy-view"},d().createElement("div",null,d().createElement("a",{href:"https://github.com/tinode/chat/"},d().createElement("img",{id:"logo",alt:"logo",src:"img/logo.svg"}),d().createElement("h2",null,"Tinode Web")),d().createElement("p",null,d().createElement(c.FormattedMessage,{id:"label_client",defaultMessage:[{type:0,value:"Client:"}]})," ",e),d().createElement("p",null,d().createElement(c.FormattedMessage,{id:"label_server",defaultMessage:[{type:0,value:"Server:"}]})," ",this.props.serverVersion," (",this.props.serverAddress,")")))}}class ya extends d().PureComponent{constructor(e){super(e)}render(){let e=null,t="bubble";return this.props.date&&(e=d().createElement(d().Fragment,null,this.props.date),t+=" date"),e?d().createElement("li",{className:"meta"},d().createElement("div",{className:t},d().createElement("div",{className:"message-content"},e))):d().createElement(d().Fragment,null,null)}}const Ea=(0,c.defineMessages)({message_not_found:{id:"message_not_found",defaultMessage:[{type:0,value:"message not found"}]},message_deleted:{id:"message_deleted",defaultMessage:[{type:0,value:"message deleted"}]}});class Ca extends d().PureComponent{constructor(e){super(e),this.touchX=null,this.touchY=null,this.touchSurface=d().createRef(),this.getSelectedIndex=this.getSelectedIndex.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleSelected=this.handleSelected.bind(this),this.handleMoveNext=this.handleMoveNext.bind(this),this.handleMovePrev=this.handleMovePrev.bind(this),this.handleTouchEventStart=this.handleTouchEventStart.bind(this),this.handleTouchEventEnd=this.handleTouchEventEnd.bind(this),this.handleTouchCancel=this.handleTouchCancel.bind(this)}componentDidMount(){this.touchSurface.current.addEventListener("touchstart",this.handleTouchEventStart,{passive:!0}),this.touchSurface.current.addEventListener("touchend",this.handleTouchEventEnd,{passive:!0}),this.touchSurface.current.addEventListener("touchcancel",this.handleTouchCancel,{passive:!0})}componentWillUnmount(){this.touchSurface.current.removeEventListener("touchstart",this.handleTouchEventStart),this.touchSurface.current.removeEventListener("touchend",this.handleTouchEventEnd),this.touchSurface.current.removeEventListener("touchcancel",this.handleTouchCancel)}getSelectedIndex(){return(this.props.pins||[]).length-this.props.selected-1}handleCancel(e){e.preventDefault(),this.props.onCancel(this.props.pins[this.getSelectedIndex()])}handleSelected(e){e.preventDefault(),this.props.onSelected(this.props.pins[this.getSelectedIndex()])}handleMoveNext(e,t){t||e.preventDefault(),e.stopPropagation();const n=Math.max(this.props.selected-1,0);n!=this.props.selected&&this.props.setSelected(n)}handleMovePrev(e,t){t||e.preventDefault(),e.stopPropagation();const n=Math.min(this.props.selected+1,(this.props.pins||[]).length-1);n!=this.props.selected&&this.props.setSelected(n)}handleTouchEventStart(e){1==e.touches.length&&(this.touchX=e.touches[0].clientX,this.touchY=e.touches[0].clientY)}handleTouchEventEnd(e){if(null===this.touchX||1!=e.changedTouches.length)return void(this.touchX=null);const t=this.touchX-e.changedTouches[0].clientX,n=this.touchY-e.changedTouches[0].clientY;this.touchX=null,Math.abs(t)>Math.abs(n)||Math.abs(n)<kn.yS||(n>0?this.handleMovePrev(e,!0):this.handleMoveNext(e,!0))}handleTouchCancel(){this.touchX=null}render(){const e=this.getSelectedIndex();let t=(this.props.messages||[])[e];t=t?t._deleted?d().createElement("i",{className:"gray"},this.props.intl.formatMessage(Ea.message_deleted)):Tn.Drafty.format(t.content,aa.TU,{formatMessage:this.props.intl.formatMessage.bind(this.props.intl),authorizeURL:this.props.tinode.authorizeURL.bind(this.props.tinode)}):d().createElement("i",{className:"gray"},this.props.intl.formatMessage(Ea.message_not_found));const n=[];return this.props.pins.forEach(t=>{const a=n.length==e?"adot":"dot";n.push(d().createElement("div",{key:t,className:a}))}),d().createElement("div",{id:"pinned-wrapper",ref:this.touchSurface},this.props.isAdmin?d().createElement("div",{className:"cancel"},d().createElement("a",{href:"#",onClick:this.handleCancel},d().createElement("i",{className:"material-icons gray"},"close"))):d().createElement("div",null,d().createElement("i",{className:"material-icons gray"},"push_pin")),d().createElement("div",{className:"pinned-scroll"},n),d().createElement("div",{className:"pinned",onClick:this.handleSelected},d().createElement("p",null,t)),d().createElement("div",{className:"pinned-menu"},d().createElement("span",{className:"menuTrigger upper"},e>0?d().createElement("a",{href:"#",onClick:this.handleMovePrev},d().createElement("i",{className:"material-icons"},"expand_less")):null),d().createElement("span",{className:"menuTrigger lower"},this.props.selected>0?d().createElement("a",{href:"#",onClick:this.handleMoveNext},d().createElement("i",{className:"material-icons"},"expand_more")):null)))}}var wa=(0,c.injectIntl)(Ca),Sa=r(8892);const Ma=(0,c.defineMessages)({unknown_name:{id:"unknown_name",defaultMessage:[{type:0,value:"Unknown"}]}});class _a extends d().PureComponent{constructor(e){super(e),this.state={content:null},(0,Un.QJ)(e.content.file).then(e=>{this.setState({content:e})}),this.handleSendCard=this.handleSendCard.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this)}componentDidMount(){document.addEventListener("keydown",this.handleKeyDown)}componentWillUnmount(){document.removeEventListener("keydown",this.handleKeyDown)}handleKeyDown(e){e.preventDefault(),"Escape"===e.key&&this.props.onClose()}handleSendCard(){this.props.onClose(),this.props.onSendMessage(this.props.content)}render(){const e=this.state.content,t=Tn.TheCard.getFn(e),n=Tn.TheCard.getPhotoUrl(e)||null,a=e?.note,s=Tn.TheCard.getOrg(e),i=Tn.TheCard.getComm(e,"email")||[],r=Tn.TheCard.getComm(e,"tel")||[],o=Tn.TheCard.getComm(e,"tinode")||[],l=Tn.TheCard.getComm(e,"http")||[],h=[];return i.forEach((e,t)=>{const n=Array.isArray(e.des)?e.des.join(", "):"";h.push(d().createElement("div",{className:"group quoted",key:`email-${t}`},d().createElement("tt",null,e.value),d().createElement("span",{className:"small gray"}," ",n?`(${n})`:"")))}),r.forEach((e,t)=>{let n=e.value;try{const t=(0,Sa.L)(e.value);n=t?t.formatInternational():e.value}catch(e){}const a=Array.isArray(e.des)?e.des.join(", "):"";h.push(d().createElement("div",{className:"group quoted",key:`tel-${t}`},d().createElement("tt",null,n),d().createElement("span",{className:"small gray"}," ",a?`(${a})`:"")))}),o.forEach((e,t)=>{const n=Array.isArray(e.des)?e.des.join(", "):"";h.push(d().createElement("div",{className:"group quoted",key:`tinode-${t}`},d().createElement("tt",null,e.value),d().createElement("span",{className:"small gray"}," ",n?`(${n})`:"")))}),l.forEach((e,t)=>{const n=Array.isArray(e.des)?e.des.join(", "):"";h.push(d().createElement("div",{className:"group quoted",key:`url-${t}`},d().createElement("tt",null,e.value),d().createElement("span",{className:"small gray"}," ",n?`(${n})`:"")))}),d().createElement("div",{id:"image-preview"},d().createElement("div",{id:"image-preview-caption-panel"},d().createElement("span",null,d().createElement(c.FormattedMessage,{id:"label_contact_card",defaultMessage:[{type:0,value:"Contact Card"}]})),d().createElement("a",{href:"#",onClick:e=>{e.preventDefault(),this.props.onClose()}},d().createElement("i",{className:"material-icons gray"},"close"))),d().createElement("div",{id:"image-preview-container"},d().createElement("div",{className:"doc-card"},d().createElement("div",{className:"panel-form-column"},d().createElement("center",null,d().createElement("div",{className:"avatar-box"},d().createElement(On.A,{authorizeURL:this.props.tinode.authorizeURL,avatar:n||!0,topic:"usrXXX123",title:t}))),d().createElement("div",{className:"group"},d().createElement("div",{className:"large ellipsized"},t||d().createElement(c.FormattedMessage,Ma.unknown_name))),s?d().createElement("div",{className:"group"},d().createElement("div",null,s)):null,a?d().createElement("div",{className:"group"},d().createElement("label",{className:"small"},d().createElement(c.FormattedMessage,{id:"label_description",defaultMessage:[{type:0,value:"Description"}]})),d().createElement("div",{className:"quoted"},a)):null,h.length>0?d().createElement("div",{className:"group"},d().createElement("label",{className:"small"},d().createElement(c.FormattedMessage,{id:"label_contacts",defaultMessage:[{type:0,value:"Contacts"}]})),h):null))),d().createElement(pa,{noInput:!0,tinode:this.props.tinode,reply:this.props.reply,onCancelReply:this.props.onCancelReply,onSendMessage:this.handleSendCard,onError:this.props.onError}))}}const Ta=(0,c.defineMessages)({unrecognized_video_format:{id:"unrecognized_video_format",defaultMessage:[{type:0,value:"Format of this video is not recognized"}]}});class Aa extends d().PureComponent{constructor(e){super(e),this.videoRef=d().createRef(),this.handleSendVideo=this.handleSendVideo.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this)}componentDidMount(){document.addEventListener("keydown",this.handleKeyDown)}componentWillUnmount(){document.removeEventListener("keydown",this.handleKeyDown)}handleKeyDown(e){this.props.onSendMessage||(e.preventDefault(),"Escape"===e.key&&this.props.onClose())}handleSendVideo(e){this.props.onClose();const t={width:this.videoRef.current.videoWidth,height:this.videoRef.current.videoHeight,duration:1e3*this.videoRef.current.duration|0,mime:this.props.content.mime,name:this.props.content.filename};if(0==t.width||0==t.height)return void this.props.onError(this.props.intl.formatMessage(Ta.unrecognized_video_format),"err");const n=document.createElement("canvas");n.width=t.width,n.height=t.height;const a=n.getContext("2d");a.drawImage(this.videoRef.current,0,0,n.width,n.height),a.canvas.toBlob(n=>this.props.onSendMessage(e,this.props.content.blob,n,t),"image/jpeg",.75)}render(){if(!this.props.content)return null;const e=this.props.content.width||"-",t=this.props.content.height||"-",n=this.props.onSendMessage?"nodownload":"",a=!this.props.onSendMessage;return d().createElement("div",{id:"image-preview"},d().createElement("div",{id:"image-preview-caption-panel"},d().createElement("span",null,this.props.content.filename),d().createElement("a",{href:"#",onClick:e=>{e.preventDefault(),this.props.onClose()}},d().createElement("i",{className:"material-icons gray"},"close"))),d().createElement("div",{id:"image-preview-container"},d().createElement("video",{className:"image-preview",controls:!0,controlsList:n,disablePictureInPicture:!0,ref:this.videoRef,autoPlay:a,src:this.props.tinode.authorizeURL(this.props.content.url),poster:this.props.content.preview,alt:this.props.content.filename})),this.props.onSendMessage?d().createElement(pa,{messagePrompt:"add_image_caption",acceptBlank:!0,tinode:this.props.tinode,reply:this.props.reply,onCancelReply:this.props.onCancelReply,onSendMessage:this.handleSendVideo,onError:this.props.onError}):d().createElement("div",{id:"image-preview-footer"},d().createElement("div",null,d().createElement("div",null,d().createElement("b",null,d().createElement(c.FormattedMessage,{id:"label_file_name",defaultMessage:[{type:0,value:"File name:"}]}))),d().createElement("div",null,d().createElement("span",{title:this.props.content.filename},this.props.content.filename))),d().createElement("div",null,d().createElement("div",null,d().createElement("b",null,d().createElement(c.FormattedMessage,{id:"label_content_type",defaultMessage:[{type:0,value:"Content type:"}]}))),d().createElement("div",null,this.props.content.type)),d().createElement("div",null,d().createElement("div",null,d().createElement("b",null,d().createElement(c.FormattedMessage,{id:"label_size",defaultMessage:[{type:0,value:"Size:"}]}))),d().createElement("div",null,e," × ",t," px; ",(0,jn.lX)(this.props.content.size)))))}}var ka=(0,c.injectIntl)(Aa),Na=r(7151);const Pa=(0,c.defineMessages)({online_now:{id:"online_now",defaultMessage:[{type:0,value:"online now"}]},last_seen:{id:"last_seen_timestamp",defaultMessage:[{type:0,value:"Last seen: "},{type:1,value:"timestamp"}]},not_found:{id:"title_not_found",defaultMessage:[{type:0,value:"Not found"}]},channel:{id:"channel",defaultMessage:[{type:0,value:"channel"}]},file_attachment_too_large:{id:"file_attachment_too_large",defaultMessage:[{type:0,value:"The file size "},{type:1,value:"size"},{type:0,value:" exceeds the "},{type:1,value:"limit"},{type:0,value:" limit."}]},invalid_content:{id:"invalid_content",defaultMessage:[{type:0,value:"invalid content"}]},editing_message:{id:"editing_message",defaultMessage:[{type:0,value:"Editing"}]},drag_file:{id:"drag_file",defaultMessage:[{type:0,value:"Drag file here"}]},self_topic_name:{id:"self_topic_name",defaultMessage:[{type:0,value:"Saved messages"}]},subscriber_count:{id:"subscriber_count",defaultMessage:[{type:6,value:"count",options:{one:{value:[{type:2,value:"count",style:null},{type:0,value:" subscriber"}]},two:{value:[{type:2,value:"count",style:null},{type:0,value:" subscribers"}]},three:{value:[{type:2,value:"count",style:null},{type:0,value:" subscribers"}]},few:{value:[{type:2,value:"count",style:null},{type:0,value:" subscribers"}]},many:{value:[{type:2,value:"count",style:null},{type:0,value:" subscribers"}]},other:{value:[{type:2,value:"count",style:null},{type:0,value:" subscribers"}]}},offset:0,pluralType:"cardinal"}]},member_count:{id:"member_count",defaultMessage:[{type:6,value:"count",options:{one:{value:[{type:2,value:"count",style:null},{type:0,value:" member"}]},two:{value:[{type:2,value:"count",style:null},{type:0,value:" members"}]},three:{value:[{type:2,value:"count",style:null},{type:0,value:" members"}]},few:{value:[{type:2,value:"count",style:null},{type:0,value:" members"}]},many:{value:[{type:2,value:"count",style:null},{type:0,value:" members"}]},other:{value:[{type:2,value:"count",style:null},{type:0,value:" members"}]}},offset:0,pluralType:"cardinal"}]},cannot_parse_vcard:{id:"cannot_parse_vcard",defaultMessage:[{type:0,value:"Cannot parse vCard file."}]}});function Da(e){if(e){const t=e.getExcessive()||"";return e.isJoiner("given")&&(t.includes("R")||t.includes("W"))}return!1}function Ia(e){if(e){const t=e.getMissing()||"";return e.isJoiner("want")&&(t.includes("R")||t.includes("W"))}return!1}function Ra(e){return 1==e||3==e}class Fa extends d().Component{constructor(e){super(e),this.state=Fa.getDerivedStateFromProps(e,{}),this.componentSetup=this.componentSetup.bind(this),this.leave=this.leave.bind(this),this.sendMessage=this.sendMessage.bind(this),this.retrySend=this.retrySend.bind(this),this.sendImageAttachment=this.sendImageAttachment.bind(this),this.sendVideoAttachment=this.sendVideoAttachment.bind(this),this.sendFileAttachment=this.sendFileAttachment.bind(this),this.sendAudioAttachment=this.sendAudioAttachment.bind(this),this.sendTheCardAttachment=this.sendTheCardAttachment.bind(this),this.sendKeyPress=this.sendKeyPress.bind(this),this.subscribe=this.subscribe.bind(this),this.handleScrollReference=this.handleScrollReference.bind(this),this.mountDnDEvents=this.mountDnDEvents.bind(this),this.handleScrollEvent=this.handleScrollEvent.bind(this),this.handleDescChange=this.handleDescChange.bind(this),this.handleSubsUpdated=this.handleSubsUpdated.bind(this),this.handleMessageUpdate=this.handleMessageUpdate.bind(this),this.handleAuxUpdate=this.handleAuxUpdate.bind(this),this.handleAllMessagesReceived=this.handleAllMessagesReceived.bind(this),this.handleInfoReceipt=this.handleInfoReceipt.bind(this),this.handleExpandMedia=this.handleExpandMedia.bind(this),this.handleClosePreview=this.handleClosePreview.bind(this),this.handleCallPanelToggle=this.handleCallPanelToggle.bind(this),this.handleFormResponse=this.handleFormResponse.bind(this),this.handleContextClick=this.handleContextClick.bind(this),this.handleShowMessageContextMenu=this.handleShowMessageContextMenu.bind(this),this.handleNewChatAcceptance=this.handleNewChatAcceptance.bind(this),this.handleEnablePeer=this.handleEnablePeer.bind(this),this.handleAttachFile=this.handleAttachFile.bind(this),this.handleAttachImageOrVideo=this.handleAttachImageOrVideo.bind(this),this.handleCancelUpload=this.handleCancelUpload.bind(this),this.postReadNotification=this.postReadNotification.bind(this),this.clearNotificationQueue=this.clearNotificationQueue.bind(this),this.goToLatestMessage=this.goToLatestMessage.bind(this),this.handleFileDrop=this.handleFileDrop.bind(this),this.handlePickReply=this.handlePickReply.bind(this),this.handleEditMessage=this.handleEditMessage.bind(this),this.handleCancelReply=this.handleCancelReply.bind(this),this.handleQuoteClick=this.handleQuoteClick.bind(this),this.handleUnpinMessage=this.handleUnpinMessage.bind(this),this.handleCallHangup=this.handleCallHangup.bind(this),this.isDragEnabled=this.isDragEnabled.bind(this),this.handleDragStart=this.handleDragStart.bind(this),this.handleDragIn=this.handleDragIn.bind(this),this.handleDragOut=this.handleDragOut.bind(this),this.handleDrag=this.handleDrag.bind(this),this.handleDrop=this.handleDrop.bind(this),this.chatMessageRefs=[],this.getOrCreateMessageRef=this.getOrCreateMessageRef.bind(this),this.getVisibleMessageRange=this.getVisibleMessageRange.bind(this),this.dragCounter=0,this.dndRef=null,this.readNotificationQueue=[],this.readNotificationTimer=null,this.keyPressTimer=null}getOrCreateMessageRef(e){if(this.chatMessageRefs[e])return this.chatMessageRefs[e];const t=d().createRef();return this.chatMessageRefs[e]=t,t}getVisibleMessageRange(e){let t=Number.MAX_SAFE_INTEGER,n=-1,a=!1;return this.chatMessageRefs.every((s,i)=>{if(s.current){const{top:r,bottom:o,height:d}=s.current.getBoundingClientRect();if(r<=e.top?e.top-r<=d:o-e.bottom<=d)a=!0,t=Math.min(t,i),n=Math.max(n,i);else if(a)return!1}return!0}),n>=t?{min:t,max:n}:{min:0,max:0}}componentDidMount(){this.messagesScroller&&this.messagesScroller.addEventListener("scroll",this.handleScrollEvent),this.mountDnDEvents(this.dndRef),this.componentSetup({},{})}componentWillUnmount(){this.messagesScroller&&this.messagesScroller.removeEventListener("scroll",this.handleScrollEvent),this.clearNotificationQueue(),this.dndRef&&(this.dndRef.removeEventListener("dragstart",this.handleDragStart),this.dndRef.removeEventListener("dragenter",this.handleDragIn),this.dndRef.removeEventListener("dragleave",this.handleDragOut),this.dndRef.removeEventListener("dragover",this.handleDrag),this.dndRef.removeEventListener("drop",this.handleDrop))}componentDidUpdate(e,t){!this.messagesScroller||t.topic==this.state.topic&&t.maxSeqId==this.state.maxSeqId&&t.minSeqId==this.state.minSeqId||this.state.scrollPosition<100&&(this.messagesScroller.scrollTop=this.messagesScroller.scrollHeight-this.state.scrollPosition-this.messagesScroller.offsetHeight),this.props.applicationVisible?this.postReadNotification(0):this.clearNotificationQueue(),this.componentSetup(e,t)}componentSetup(e,t){const n=this.props.tinode?this.props.tinode.getTopic(this.state.topic):void 0;if(this.state.topic!=t.topic&&(t.topic&&!Tn.Tinode.isNewGroupTopicName(t.topic)&&(this.leave(t.topic),t.rtcPanel&&this.handleCallHangup(t.topic,e.callSeq)),n&&(n.onData=this.handleMessageUpdate,n.onAllMessagesReceived=this.handleAllMessagesReceived,n.onInfo=this.handleInfoReceipt,n.onMetaDesc=this.handleDescChange,n.onSubsUpdated=this.handleSubsUpdated,n.onPres=this.handleSubsUpdated,n.onAuxUpdated=this.handleAuxUpdate)),n)if(this.state.topic!=t.topic||this.props.myUserId&&!e.myUserId){const e=this.props.newTopicParams&&this.props.newTopicParams._topicName==this.props.topic;n.isP2PType()&&e&&!kn.rl?n.getMeta(n.startMetaQuery().withDesc().build()):this.props.myUserId&&this.subscribe(n)}else n.isSubscribed()&&this.state.isReader&&!t.isReader&&n.getMeta(n.startMetaQuery().withLaterData().build())}static getDerivedStateFromProps(e,t){let n={};if(e.topic)if(e.topic!=t.topic){const a=e.tinode.getTopic(e.topic);if(n={topic:e.topic,deleted:a._deleted,docPreview:null,imagePreview:null,imagePostview:null,videoPreview:null,videoPostview:null,rtcPanel:null,minimizedCallPanel:!1,typingIndicator:!1,scrollPosition:0,fetchingMessages:!1,showGoToLastButton:!1,contentToEdit:null,dragging:!1,selectedPin:0},e.forwardMessage?n.reply={content:e.forwardMessage.preview,seq:null}:n.reply=null,a){const s=[];e.connected&&a.subscribers(t=>{t.online&&t.user!=e.myUserId&&s.push(t)}),Object.assign(n,{onlineSubs:s}),a.isSelfType()?Object.assign(n,{title:e.intl.formatMessage(Pa.self_topic_name),avatar:!0}):a.public?Object.assign(n,{title:a.public.fn,avatar:(0,Un.to)(a.public.photo)}):Object.assign(n,{title:"",avatar:null});const i=a.p2pPeerDesc();i?Object.assign(n,{peerMessagingDisabled:Ia(i.acs)}):t.peerMessagingDisabled&&Object.assign(n,{peerMessagingDisabled:!1}),Object.assign(n,{minSeqId:a.minMsgSeq(),maxSeqId:a.maxMsgSeq(),latestClearId:a.maxClearId(),channel:a.isChannelType(),pins:(a.aux("pins")||[]).slice(),pinsLoaded:!1}),e.callTopic==a.name&&Ra(e.callState)&&(n.rtcPanel=e.callTopic)}else Object.assign(n,{minSeqId:-1,maxSeqId:-1,latestClearId:-1,onlineSubs:[],title:"",avatar:null,peerMessagingDisabled:!1,channel:!1,pins:[],pinsLoaded:!1})}else e.callTopic==t.topic&&!t.rtcPanel&&Ra(e.callState)&&(n.rtcPanel=e.callTopic);else n={minSeqId:-1,maxSeqId:-1,latestClearId:-1,onlineSubs:[],topic:null,title:"",avatar:null,isVerified:!1,isStaff:!1,isDangerous:!1,deleted:!1,docPreview:null,imagePreview:null,imagePostview:null,videoPreview:null,videoPostview:null,rtcPanel:null,minimizedCallPanel:!1,typingIndicator:!1,scrollPosition:0,fetchingMessages:!1,peerMessagingDisabled:!1,channel:!1,reply:null,contentToEdit:null,showGoToLastButton:!1,dragging:!1,pins:[],pinsLoaded:!1,selectedPin:0,subsVersion:0};return e.acs?(e.acs.isWriter()!=t.isWriter&&(n.isWriter=!t.isWriter),e.acs.isReader()!=t.isReader&&(n.isReader=!t.isReader),e.acs.isAdmin()!=t.isAdmin&&(n.isAdmin=!t.isAdmin),!e.acs.isReader("given")!=t.readingBlocked&&(n.readingBlocked=!t.readingBlocked),e.acs.isSharer()!=t.isSharer&&(n.isSharer=!t.isSharer)):(t.isWriter&&(n.isWriter=!1),t.isReader&&(n.isReader=!1),t.isAdmin&&(n.isAdmin=!1),t.readingBlocked||(t.readingBlocked=!0),t.isSharer&&(n.isSharer=!1)),Da(e.acs)==!t.unconformed&&(n.unconfirmed=!t.unconformed),!e.connected&&t.onlineSubs&&t.onlineSubs.length>0&&(n.onlineSubs=[]),n}subscribe(e){if(e.isSubscribed()||!this.props.ready)return;const t=this.props.newTopicParams&&this.props.newTopicParams._topicName==this.props.topic;let n=e.startMetaQuery().withLaterDesc().withLaterSub().withAux();(this.state.isReader||t)&&(n=n.withLaterData(kn.H1),this.state.isReader&&(n=n.withLaterDel()),this.setState({fetchingMessages:!0}));const a=t?this.props.newTopicParams:void 0;e.subscribe(n.build(),a).then(t=>{if(303==t.code)return void Na.A.navigateTo(Na.A.setUrlTopic("",t.params.topic));this.state.topic!=t.topic&&this.setState({topic:t.topic}),this.state.deleted&&this.setState({deleted:!1}),this.props.onNewTopicCreated(this.props.topic,t.topic);let n=[];e.queuedMessages(t=>{t._sending||(t._fatal||t.head&&t.head.webrtc?n.push(t.seq):e.isSubscribed()&&this.retrySend(t))}),n.length>0&&e.delMessagesList(n,!0)}).catch(e=>{console.error("Failed subscription to",this.state.topic,e),this.props.onError(e.message,"err");const t=Fa.getDerivedStateFromProps({},{});t.title=this.props.intl.formatMessage(Pa.not_found),this.setState(t)})}leave(e){if(!e||!this.props.tinode.isTopicCached(e))return;const t=this.props.tinode.getTopic(e);t&&t.isSubscribed()&&t.leave(!1).catch(e=>{}).finally(e=>{this.setState({fetchingMessages:!1}),t.onData=void 0,t.onAllMessagesReceived=void 0,t.onInfo=void 0,t.onMetaDesc=void 0,t.onSubsUpdated=void 0,t.onPres=void 0,t.onAuxUpdated=void 0})}handleScrollReference(e){e&&(e.addEventListener("scroll",this.handleScrollEvent),this.messagesScroller=e,this.messagesScroller.scrollTop=this.messagesScroller.scrollHeight-this.state.scrollPosition-this.messagesScroller.offsetHeight)}handleScrollEvent(e){const t=e.target.scrollHeight-e.target.scrollTop-e.target.offsetHeight;if(this.setState({scrollPosition:t,showGoToLastButton:t>100&&t<this.state.scrollPosition}),!this.state.fetchingMessages&&!this.processingScrollEvent){if(e.target.scrollTop<=40){const t=this.props.tinode.getTopic(this.state.topic);if(t&&t.isSubscribed()){this.processingScrollEvent=!0;const{min:n,max:a}=this.getVisibleMessageRange(e.target.getBoundingClientRect()),s=t.msgHasMoreMessages(n,a,!1);s.length>0&&this.setState({fetchingMessages:!0},e=>{t.getMessagesPage(kn.H1,s,n,a).catch(e=>this.props.onError(e.message,"err")).finally(e=>this.setState({fetchingMessages:!1}))})}}this.processingScrollEvent=!1}}mountDnDEvents(e){e&&(e.addEventListener("dragstart",this.handleDragStart),e.addEventListener("dragenter",this.handleDragIn),e.addEventListener("dragleave",this.handleDragOut),e.addEventListener("dragover",this.handleDrag),e.addEventListener("drop",this.handleDrop),this.dndRef=e)}goToLatestMessage(){this.setState({scrollPosition:0}),this.messagesScroller&&(this.messagesScroller.scrollTop=this.messagesScroller.scrollHeight-this.messagesScroller.offsetHeight)}handleDescChange(e){Tn.Tinode.isSelfTopicName(this.props.topic)?this.setState({title:this.props.intl.formatMessage(Pa.self_topic_name),avatar:!0}):e.public?this.setState({title:e.public.fn,avatar:(0,Un.to)(e.public.photo)}):this.setState({title:"",avatar:null}),e.acs&&this.setState({isWriter:e.acs.isWriter(),isReader:e.acs.isReader(),isAdmin:e.acs.isAdmin(),readingBlocked:!e.acs.isReader("given"),unconfirmed:Da(e.acs)})}postReadNotification(e){if(!this.props.applicationVisible||!this.state.topic)return;this.readNotificationTimer||(this.readNotificationTimer=setInterval(e=>{if(0==this.readNotificationQueue.length)return clearInterval(this.readNotificationTimer),void(this.readNotificationTimer=null);let t=-1;for(;this.readNotificationQueue.length>0;){const e=this.readNotificationQueue[0];if(e.topicName!=this.state.topic){this.readNotificationQueue.shift();continue}const n=new Date;if(!(e.sendAt<=n))break;this.readNotificationQueue.shift(),(0==e.seq||Tn.Tinode.isServerAssignedSeq(e.seq))&&(t=Math.max(t,e.seq))}if(t>=0){const e=this.props.tinode.getTopic(this.state.topic);if(e)try{e.noteRead(t)}catch(e){console.error("Failed to send read notification",e)}}},300));const t=new Date;this.readNotificationQueue.push({topicName:this.state.topic,seq:e,sendAt:t.setMilliseconds(t.getMilliseconds()+kn.J)})}clearNotificationQueue(){this.readNotificationQueue=[],this.readNotificationTimer&&(clearInterval(this.readNotificationTimer),this.readNotificationTimer=null)}handleSubsUpdated(){if(this.state.topic){const e=[],t=this.props.tinode.getTopic(this.state.topic);t.subscribers(t=>{t.online&&t.user!=this.props.myUserId&&e.push(t)});const n={onlineSubs:e,subsVersion:this.state.subsVersion+1},a=t.p2pPeerDesc();a?Object.assign(n,{peerMessagingDisabled:Ia(a.acs)}):this.state.peerMessagingDisabled&&Object.assign(n,{peerMessagingDisabled:!1}),this.setState(n)}}handleMessageUpdate(e){if(!this.state.topic)return;const t=this.props.tinode.getTopic(this.state.topic);if(!e)return void this.setState({latestClearId:t.maxClearId()});clearTimeout(this.keyPressTimer),this.setState({maxSeqId:t.maxMsgSeq(),minSeqId:t.minMsgSeq(),typingIndicator:!1},n=>{t.isNewMessage(e.seq)?this.state.scrollPosition>100?this.setState({showGoToLastButton:!0}):this.goToLatestMessage():this.messagesScroller&&(this.messagesScroller.scrollTop=this.messagesScroller.scrollHeight-this.state.scrollPosition-this.messagesScroller.offsetHeight)});t.msgStatus(e,!0)>=Tn.Tinode.MESSAGE_STATUS_SENT&&e.from!=this.props.myUserId&&this.postReadNotification(e.seq)}handleAllMessagesReceived(e){if(this.setState({fetchingMessages:!1}),!e){const e=this.props.tinode.getTopic(this.state.topic);return void(e&&this.postReadNotification(e.seq))}if(this.state.pinsLoaded)this.setState({pinsLoaded:!1});else{const e=this.props.tinode.getTopic(this.state.topic);this.setState({pinsLoaded:!0},t=>{e.getPinnedMessages()})}}handleAuxUpdate(e){const t=(e.pins||[]).slice();let n=this.state.selectedPin;t.length>this.state.pins.length?n=0:n>=t.length&&(n=Math.max(0,t.length-1)),this.setState({pins:t,selectedPin:n})}handleInfoReceipt(e){switch(e.what){case"kp":clearTimeout(this.keyPressTimer),this.keyPressTimer=setTimeout(e=>this.setState({typingIndicator:!1}),kn.NR+1e3),this.state.typingIndicator||this.setState({typingIndicator:!0});break;case"read":case"recv":this.forceUpdate();break;default:console.info("Other change in topic: ",e.what)}}handleExpandMedia(e){e&&(e.video?this.setState({videoPostview:e}):this.setState({imagePostview:e}))}handleClosePreview(){this.state.imagePreview&&this.state.imagePreview.url&&URL.revokeObjectURL(this.state.imagePreview.url),this.state.videoPreview&&this.state.videoPreview.url&&URL.revokeObjectURL(this.state.videoPreview.url),this.setState({imagePostview:null,imagePreview:null,docPreview:null,videoPreview:null,videoPostview:null})}handleFormResponse(e,t,n){if("pub"==e)this.sendMessage(Tn.Drafty.attachJSON(Tn.Drafty.parse(t),n));else if("url"==e){const e=new URL(n.ref),t=e.searchParams;for(let e in n.resp)n.resp.hasOwnProperty(e)&&t.set(e,n.resp[e]);["name","seq"].forEach(e=>{n[e]&&t.set(e,n[e])}),t.set("uid",this.props.myUserId),t.set("topic",this.state.topic),e.search=t,window.open(e,"_blank")}else console.info("Unknown action in form",e)}handleContextClick(e){e.preventDefault(),e.stopPropagation(),this.props.showContextMenu({topicName:this.state.topic,y:e.pageY,x:e.pageX})}handleShowMessageContextMenu(e,t){"chan"==e.userFrom&&(e.userFrom=this.state.topic,e.userName=this.state.title),e.topicName=this.state.topic;const n=t||[],a=this.props.tinode.getTopic(e.topicName);if(a)if(a.isSelfType())n.push("message_delete_generic");else{a.isChannelType()||n.push("message_delete");const t=a.getAccessMode();if(t&&t.isDeleter()){let a=t.isOwner();if(!a){const t=0|this.props.tinode.getServerParam(Tn.Tinode.MSG_DELETE_AGE,0);a=0==t||!!(t>0&&e.timestamp)&&e.timestamp.getTime()>(new Date).getTime()-1e3*t}a&&n.push("message_delete_hard")}}this.props.showContextMenu(e,n)}handleNewChatAcceptance(e){this.props.onNewChat(this.state.topic,e)}handleEnablePeer(e){e.preventDefault(),this.props.onChangePermissions(this.state.topic,kn.cZ,this.state.topic)}sendKeyPress(e){const t=this.props.tinode.getTopic(this.state.topic);t.isSubscribed()&&(e?t.noteRecording(!0):t.noteKeyPress())}sendMessage(e,t,n){let a;if(this.props.forwardMessage)e=this.props.forwardMessage.msg,a=this.props.forwardMessage.head,this.handleCancelReply();else if(this.state.reply){if(this.state.reply.editing){if(e==this.state.contentToEdit)return void this.handleCancelReply();a={replace:":"+this.state.reply.seq}}else this.state.reply.content&&(a={reply:""+this.state.reply.seq},"string"==typeof e&&(e=Tn.Drafty.parse(e)),e=Tn.Drafty.append(Tn.Drafty.sanitizeEntities(this.state.reply.content),e));this.handleCancelReply()}this.props.sendMessage(e,t,n,a)}retrySend(e){this.props.sendMessage(e.content,void 0,void 0,e.head).then(t=>{this.props.tinode.getTopic(this.state.topic).delMessagesList([e.seq],!0)})}sendFileAttachment(e){const t=.75*this.props.tinode.getServerParam("maxMessageSize",kn.mp)-1024|0;if(Tn.TheCard.isFileSupported(e.type,e.name)&&this.sendTheCardAttachment(e,t))return;const n=e=>e===kn.Uv?"application/octet-stream":e;if(e.size>t){const t=this.props.tinode.getLargeFileHelper();if(!t)return void this.props.onError(this.props.intl.formatMessage(Pa.cannot_initiate_upload));const a=t.upload(e),s=Tn.Drafty.attachFile(null,{mime:n(e.type),filename:e.name,size:e.size,urlPromise:a});this.sendMessage(s,a,t)}else(0,Un.bB)(e).then(t=>this.sendMessage(Tn.Drafty.attachFile(null,{mime:n(t.mime),data:t.bits,filename:t.name,size:e.size}))).catch(e=>this.props.onError(e.message,"err"))}sendTheCardAttachment(e,t){return!(e.size>t)&&((0,Un.QJ)(e).then(e=>{this.sendMessage(Tn.Drafty.appendTheCard(null,e))}).catch(e=>{this.props.onError(this.props.intl.formatMessage(Pa.cannot_parse_vcard,{error:e.message}),"err")}),!0)}handleAttachFile(e){const t=this.props.tinode.getServerParam("maxFileUploadSize",kn.qy);e.size>t?this.props.onError(this.props.intl.formatMessage(Pa.file_attachment_too_large,{size:(0,jn.lX)(e.size),limit:(0,jn.lX)(t)}),"err"):this.setState({docPreview:{file:e,name:e.name,size:e.size,type:e.type}})}handleCallHangup(e,t){this.props.onVideoCallClosed(),this.setState({rtcPanel:null}),this.props.onCallHangup(e,t)}handleCallPanelToggle(){this.setState({minimizedCallPanel:!this.state.minimizedCallPanel})}sendImageAttachment(e,t){const n=this.state.imagePreview.mime,a=this.state.imagePreview.width,s=this.state.imagePreview.height,i=this.state.imagePreview.filename,r=.75*this.props.tinode.getServerParam("maxMessageSize",kn.mp)-1024|0;if(t.size>r){const r=this.props.tinode.getLargeFileHelper();if(!r)return void this.props.onError(this.props.intl.formatMessage(Pa.cannot_initiate_upload));const o=r.upload(t);return void(0,Un.ag)(t,kn.wj,kn.wj,-1,!1).then(e=>(0,Un.Sk)(e.blob)).then(d=>{let l=Tn.Drafty.insertImage(null,0,{mime:n,_tempPreview:d.bits,bits:d.bits,width:a,height:s,filename:i,size:t.size,urlPromise:o});e&&(l=Tn.Drafty.appendLineBreak(l),l=Tn.Drafty.append(l,Tn.Drafty.parse(e))),this.sendMessage(l,o,r)}).catch(e=>this.props.onError(e,"err"))}(0,Un.Sk)(t).then(n=>{let r=Tn.Drafty.insertImage(null,0,{mime:n.mime,bits:n.bits,width:a,height:s,filename:i,size:t.size});e&&(r=Tn.Drafty.appendLineBreak(r),r=Tn.Drafty.append(r,Tn.Drafty.parse(e))),this.sendMessage(r)})}sendVideoAttachment(e,t,n,a){const s=a.width,i=a.height,r=.75*this.props.tinode.getServerParam("maxMessageSize",kn.mp)-1024|0,o=[];let d;if(t.size+n.size>r){if(d=this.props.tinode.getLargeFileHelper(),!d)return void this.props.onError(this.props.intl.formatMessage(Pa.cannot_initiate_upload));o[0]=t.size>.675*r?d.upload(t):null,o[1]=n.size>.275*r?d.upload(n):null}if(0==o.length)return void Promise.all([(0,Un.Sk)(t),(0,Un.Sk)(n)]).then(n=>{const[r,o]=n;let d=Tn.Drafty.insertVideo(null,0,{mime:r.mime,bits:r.bits,preview:o.bits,premime:o.mime,width:s,height:i,duration:a.duration,filename:a.name,size:t.size});e&&(d=Tn.Drafty.appendLineBreak(d),d=Tn.Drafty.append(d,Tn.Drafty.parse(e))),this.sendMessage(d)});const l=Promise.all(o),c=[];c[0]=o[0]?null:(0,Un.Sk)(t),c[1]=o[1]?null:(0,Un.ag)(n,kn.QG,kn.QG,-1,!1).then(e=>(0,Un.Sk)(e.blob)),c[2]=(0,Un.ag)(n,kn.Cx,kn.Cx,-1,!1).then(e=>(0,Un.Sk)(e.blob)),Promise.all(c).then(n=>{const[r,o,c]=n;let h=Tn.Drafty.insertVideo(null,0,{mime:a.mime,bits:r?r.bits:null,_tempPreview:c.bits,preview:o?o.bits:c.bits,premime:o?o.mime:c.mime,width:s,height:i,duration:a.duration,filename:a.name,size:t.size,urlPromise:l});e&&(h=Tn.Drafty.appendLineBreak(h),h=Tn.Drafty.append(h,Tn.Drafty.parse(e))),this.sendMessage(h,l,d)}).catch(e=>this.props.onError(e.message,"err"))}handleAttachImageOrVideo(e){const t=this.props.tinode.getServerParam("maxFileUploadSize",kn.qy);e.type.startsWith("video/")?this.setState({videoPreview:{url:URL.createObjectURL(e),blob:e,filename:e.name,size:e.size,mime:e.type}}):(0,Un.ag)(e,kn.QG,kn.QG,t,!1).then(e=>{this.setState({imagePreview:{url:URL.createObjectURL(e.blob),blob:e.blob,filename:e.name,width:e.width,height:e.height,size:e.blob.size,mime:e.mime}})}).catch(e=>{this.props.onError(e.message,"err")})}handleFileDrop(e){if(!e||0==e.length)return;const t=e[0];t.type&&t.type.startsWith("image/")?this.handleAttachImageOrVideo(t):this.handleAttachFile(t)}sendAudioAttachment(e,t,n){fetch(e).then(e=>e.blob()).then(e=>{const a=.75*this.props.tinode.getServerParam("maxMessageSize",kn.mp)-1024;if(e.size>a){const a=this.props.tinode.getLargeFileHelper();if(!a)return void this.props.onError(this.props.intl.formatMessage(Pa.cannot_initiate_upload));const s=a.upload(e),i=Tn.Drafty.appendAudio(null,{mime:e.type,size:e.size,duration:n,preview:t,urlPromise:s});this.sendMessage(i,s,a)}else(0,Un.Sk)(e).then(a=>{this.sendMessage(Tn.Drafty.appendAudio(null,{mime:a.mime,bits:a.bits,size:e.size,duration:n,preview:t}))})}).catch(e=>{this.props.onError(e.message,"err")})}handleCancelUpload(e,t){const n=this.props.tinode.getTopic(this.state.topic).findMessage(e);n&&(n._cancelled=!0),t.cancel()}handlePickReply(e,t,n,a){e&&t?(t="string"==typeof t?Tn.Drafty.init(t):t,t=Tn.Drafty.isValid(t)?Tn.Drafty.replyContent(t,kn.Rz):Tn.Drafty.append(Tn.Drafty.init("⚠ "),Tn.Drafty.wrapInto(this.props.intl.formatMessage(Pa.invalid_content),"EM")),this.setState({reply:{content:Tn.Drafty.quote(a,n,t),seq:e}}),this.props.onCancelForwardMessage()):this.setState({reply:null})}handleEditMessage(e,t){if(!e||!t)return void this.setState({reply:null});t="string"==typeof t?Tn.Drafty.init(t):t;const n=Tn.Drafty.toMarkdown(t);t=Tn.Drafty.isValid(t)?Tn.Drafty.replyContent(t,kn.hB):Tn.Drafty.append(Tn.Drafty.init("⚠ "),Tn.Drafty.wrapInto(this.props.intl.formatMessage(Pa.invalid_content),"EM")),this.setState({reply:{content:Tn.Drafty.quote(this.props.intl.formatMessage(Pa.editing_message),null,t),seq:e,editing:!0},contentToEdit:n}),this.props.onCancelForwardMessage()}handleCancelReply(){this.setState({reply:null,contentToEdit:null}),this.props.onCancelForwardMessage()}handleQuoteClick(e){const t=this.getOrCreateMessageRef(e);t&&t.current?(t.current.scrollIntoView({block:"center",behavior:"smooth"}),t.current.classList.add("flash"),setTimeout(e=>{t.current.classList.remove("flash")},1e3)):console.error("Unresolved message ref",e)}handleUnpinMessage(e){this.props.tinode.getTopic(this.state.topic).pinMessage(e,!1)}isDragEnabled(){return this.state.isWriter&&!this.state.unconfirmed&&!this.props.forwardMessage&&!this.state.peerMessagingDisabled}handleDragStart(e){e.preventDefault(),e.stopPropagation(),e.dataTransfer.clearData()}handleDragIn(e){e.preventDefault(),e.stopPropagation(),this.dragCounter++,e.dataTransfer.items&&e.dataTransfer.items.length>0&&this.setState({dragging:!0})}handleDragOut(e){e.preventDefault(),e.stopPropagation(),this.dragCounter--,this.dragCounter<=0&&this.setState({dragging:!1})}handleDrag(e){e.preventDefault(),e.stopPropagation()}handleDrop(e){e.preventDefault(),e.stopPropagation(),this.setState({dragging:!1}),this.isDragEnabled()&&e.dataTransfer.files&&e.dataTransfer.files.length>0&&(this.handleFileDrop(e.dataTransfer.files),this.dragCounter=0)}render(){const{formatMessage:e}=this.props.intl,t=this.state.rtcPanel&&d().createElement(Qn,{topic:this.state.topic,seq:this.props.callSeq,callState:this.props.callState,callAudioOnly:this.props.callAudioOnly,tinode:this.props.tinode,title:this.state.title,avatar:this.state.avatar||!0,minimized:this.state.minimizedCallPanel,onError:this.props.onError,onHangup:this.handleCallHangup,onToggleMinimize:this.handleCallPanelToggle,onInvite:this.props.onCallInvite,onSendOffer:this.props.onCallSendOffer,onIceCandidate:this.props.onCallIceCandidate,onSendAnswer:this.props.onCallSendAnswer});let n;if(this.state.topic){let a;if(this.state.imagePreview)a=d().createElement(fa,{content:this.state.imagePreview,tinode:this.props.tinode,reply:this.state.reply,onCancelReply:this.handleCancelReply,onClose:this.handleClosePreview,onSendMessage:this.sendImageAttachment});else if(this.state.videoPreview)a=d().createElement(ka,{content:this.state.videoPreview,tinode:this.props.tinode,reply:this.state.reply,onError:this.props.onError,onCancelReply:this.handleCancelReply,onClose:this.handleClosePreview,onSendMessage:this.sendVideoAttachment});else if(this.state.imagePostview)a=d().createElement(fa,{content:this.state.imagePostview,onClose:this.handleClosePreview});else if(this.state.videoPostview)a=d().createElement(ka,{content:this.state.videoPostview,tinode:this.props.tinode,onError:this.props.onError,onClose:this.handleClosePreview});else if(this.state.docPreview)a=Tn.TheCard.isFileSupported(this.state.docPreview.type,this.state.docPreview.name)?d().createElement(_a,{content:this.state.docPreview,tinode:this.props.tinode,reply:this.state.reply,onCancelReply:this.handleCancelReply,onClose:this.handleClosePreview,onSendMessage:this.sendFileAttachment}):d().createElement(ua,{content:this.state.docPreview,tinode:this.props.tinode,reply:this.state.reply,onCancelReply:this.handleCancelReply,onClose:this.handleClosePreview,onSendMessage:this.sendFileAttachment});else{const t=this.props.tinode.getTopic(this.state.topic),n=t.isChannelType()||t.chan,s=t.isGroupType()&&!n,i=[];t.trusted&&(t.trusted.verified&&i.push({icon:"verified",color:"badge-inv"}),t.trusted.staff&&i.push({icon:"staff",color:"badge-inv"}),t.trusted.danger&&i.push({icon:"dangerous",color:"badge-inv"}));const r=[];this.state.pins.forEach(e=>r.push(t.latestMsgVersion(e)||t.findMessage(e)));const o=[];let l=null,h=null,p=null;t.messages((e,n,a,i)=>{let r=a?a.from||"chan":null,c="single",u=e.from||"chan";u==l?c=u==r?"middle":"last":u==r&&(c="first"),l=u;const m=!(u==this.props.myUserId),g=t.msgStatus(e,!0);let f,v,$=u;const b=t.userDesc(u);b&&b.public&&(f=b.public.fn,v=(0,Un.to)(b.public.photo)),p=s?"chat-box group":"chat-box";const y=this.getOrCreateMessageRef(e.seq);let E=e.head?parseInt(e.head.reply):null;if(E&&!isNaN(E)||(E=null),e.hi)o.push(d().createElement(ya,{deleted:!0,key:e.seq}));else{const t=new Date(e.ts);h&&h.toDateString()==t.toDateString()||(o.push(d().createElement(ya,{date:(0,jn.mf)(e.ts),locale:this.props.intl.locale,key:"date-"+e.seq})),h=t),o.push(d().createElement(oa,{tinode:this.props.tinode,topic:this.state.topic,content:e.content,mimeType:e.head&&e.head.mime,replyToSeq:E,edited:e.head&&!e.head.webrtc&&e.head.replace,timestamp:e.ts,response:m,seq:e.seq,isGroup:s,isChan:this.state.channel,userFrom:$,userName:f,userAvatar:v,sequence:c,received:g,uploader:e._uploader,userIsWriter:this.state.isWriter,userIsAdmin:this.state.isAdmin,pinned:this.state.pins.includes(e.seq),viewportWidth:this.props.viewportWidth,showContextMenu:this.handleShowMessageContextMenu,onExpandMedia:this.handleExpandMedia,onFormResponse:this.handleFormResponse,onCancelUpload:this.handleCancelUpload,pickReply:this.handlePickReply,editMessage:this.handleEditMessage,onQuoteClick:this.handleQuoteClick,onAcceptCall:this.props.onAcceptCall,onError:this.props.onError,ref:y,key:e.seq}))}});let u=null;if(n)t.subcnt&&(u=e(Pa.subscriber_count,{count:t.subcnt}));else{const n=this.props.tinode.getMeTopic().getContact(this.state.topic);n&&(Tn.Tinode.isP2PTopicName(n.topic)?n.online?u=e(Pa.online_now):n.seen&&(u=e(Pa.last_seen,{timestamp:(0,jn.cq)(n.seen.when,this.props.intl.locale)})):Tn.Tinode.isGroupTopicName(n.topic)&&t.subcnt&&(u=e(Pa.member_count,{count:t.subcnt})))}const m=this.state.avatar||!0,g=this.state.deleted||t.isSelfType()?null:this.props.online?"online"+(this.state.typingIndicator?" typing":""):"offline",f="panel-title"+(this.state.deleted?" deleted":""),v="dark"==this.props.colorSchema?"dark":"";let $=d().createElement(d().Fragment,null,d().createElement("div",{id:"messages-container",className:v},d().createElement("button",{id:"go-to-latest",className:"action-button"+(this.state.showGoToLastButton?"":" hidden"),onClick:this.goToLatestMessage},d().createElement("i",{className:"material-icons"},"arrow_downward")),d().createElement("div",{id:"messages-panel",ref:this.handleScrollReference},d().createElement("ul",{id:"scroller",className:p},o)),this.state.isReader?null:d().createElement("div",{id:"write-only-background"},this.state.readingBlocked?d().createElement("div",{id:"write-only-note"},d().createElement(c.FormattedMessage,{id:"messages_not_readable",defaultMessage:[{type:0,value:"no access to messages"}]})):null)),this.state.peerMessagingDisabled&&!this.state.unconfirmed?d().createElement("div",{id:"peer-messaging-disabled-note"},d().createElement("i",{className:"material-icons secondary"},"block")," ",d().createElement(c.FormattedMessage,{id:"peers_messaging_disabled",defaultMessage:[{type:0,value:"Peer's messaging is disabled."}]})," ",d().createElement("a",{href:"#",onClick:this.handleEnablePeer},d().createElement(c.FormattedMessage,{id:"enable_peers_messaging",defaultMessage:[{type:0,value:"Enable"}]})),"."):null,this.state.unconfirmed?d().createElement(va,{onAction:this.handleNewChatAcceptance}):d().createElement(pa,{tinode:this.props.tinode,topicName:this.state.topic,noInput:!!this.props.forwardMessage,disabled:!this.state.isWriter||this.state.deleted,reply:this.state.reply,initMessage:this.state.contentToEdit,sendOnEnter:this.props.sendOnEnter,onKeyPress:this.sendKeyPress,onRecordingProgress:this.sendKeyPress,onSendMessage:this.sendMessage,onAttachFile:this.props.forwardMessage?null:this.handleAttachFile,onAttachImage:this.props.forwardMessage?null:this.handleAttachImageOrVideo,onAttachAudio:this.props.forwardMessage?null:this.sendAudioAttachment,onError:this.props.onError,onQuoteClick:this.handleQuoteClick,onCancelReply:this.handleCancelReply}));a=d().createElement(d().Fragment,null,d().createElement("div",{id:"topic-caption-panel",className:"caption-panel"},this.props.displayMobile?d().createElement("a",{href:"#",id:"hide-message-view",onClick:e=>{e.preventDefault(),this.leave(this.state.topic),this.props.onHideMessagesView()}},d().createElement("i",{className:"material-icons"},"arrow_back")):null,d().createElement("div",{className:"avatar-box"},d().createElement(On.A,{authorizeURL:this.props.tinode.authorizeURL,avatar:m,topic:this.state.topic,title:this.state.title,deleted:this.state.deleted}),n?null:d().createElement("span",{className:g})),d().createElement("div",{id:"topic-title-group"},d().createElement("div",{id:"topic-title",className:f},this.state.title||d().createElement("i",null,d().createElement(c.FormattedMessage,{id:"unnamed_topic",defaultMessage:[{type:0,value:"Unnamed"}]})),d().createElement(da.A,{badges:i})),d().createElement("div",{id:"topic-last-seen"},u)),d().createElement("div",{style:{marginLeft:"auto"}}),!this.props.displayMobile&&this.state.pins.length>0?d().createElement(wa,{tinode:this.props.tinode,pins:this.state.pins,messages:r,selected:this.state.selectedPin,isAdmin:this.state.isAdmin,setSelected:e=>this.setState({selectedPin:e}),onSelected:this.handleQuoteClick,onCancel:this.handleUnpinMessage}):null,s?d().createElement(ga,{tinode:this.props.tinode,subscribers:this.state.onlineSubs}):null,d().createElement("div",null,d().createElement("a",{href:"#",onClick:this.handleContextClick},d().createElement("i",{className:"material-icons"},"more_vert")))),this.props.displayMobile?d().createElement(d().Fragment,null,this.state.pins.length>0?d().createElement(wa,{tinode:this.props.tinode,pins:this.state.pins,messages:r,selected:this.state.selectedPin,isAdmin:this.state.isAdmin,setSelected:e=>this.setState({selectedPin:e}),onSelected:this.handleQuoteClick,onCancel:this.handleUnpinMessage}):null,d().createElement(ma.A,{level:this.props.errorLevel,text:this.props.errorText,onClearError:this.props.onError})):null,d().createElement($a.A,{show:this.state.fetchingMessages}),$,this.state.dragging&&this.isDragEnabled()?d().createElement("div",{className:"drag-n-drop"},e(Pa.drag_file)):null)}n=d().createElement("div",{id:"topic-view",ref:this.mountDnDEvents},a,t)}else n=d().createElement(ba,{serverVersion:this.props.serverVersion,serverAddress:this.props.serverAddress});return n}}var xa=(0,c.injectIntl)(Fa);class Oa extends d().PureComponent{render(){return d().createElement("a",{href:"#",onClick:e=>{e.preventDefault(),this.props.onBack()}},d().createElement("i",{className:"material-icons"},"arrow_back"))}}class La extends d().PureComponent{render(){return d().createElement("div",null,d().createElement("a",{href:"#",onClick:e=>{e.preventDefault(),this.props.onNewTopic()}},d().createElement("i",{className:"material-icons"},"chat"))," ",d().createElement("a",{href:"#",onClick:e=>{e.preventDefault(),this.props.onSettings()}},d().createElement("i",{className:"material-icons"},"settings")))}}class Ua extends d().PureComponent{render(){return d().createElement("div",null,d().createElement("a",{href:"#",onClick:e=>{e.preventDefault(),this.props.onSignUp()}},d().createElement("i",{className:"material-icons"},"person_add"))," ",d().createElement("a",{href:"#",onClick:e=>{e.preventDefault(),this.props.onSettings()}},d().createElement("i",{className:"material-icons"},"settings")))}}class ja extends d().PureComponent{render(){const e=[];this.props.trustedBadges&&this.props.trustedBadges.forEach(t=>{e.push({icon:t,color:"badge-inv"})});let t=null;return this.props.tinode&&(t=this.props.tinode.authorizeURL((0,Jn.wk)(this.props.avatar,"image"))),d().createElement("div",{id:"side-caption-panel",className:"caption-panel"},this.props.onCancel?d().createElement(Oa,{onBack:this.props.onCancel}):null,t?d().createElement("div",{id:"self-avatar",className:"avatar-box"},d().createElement(On.A,{authorizeURL:this.props.tinode.authorizeURL,avatar:t,topic:this.props.myUserId,title:this.props.title})):null,d().createElement("div",{id:"sidepanel-title",className:"panel-title"},this.props.title,d().createElement(da.A,{badges:e})),"login"===this.props.state?d().createElement(Ua,{onSignUp:this.props.onSignUp,onSettings:this.props.onSettings}):"contacts"===this.props.state?d().createElement(La,{onNewTopic:this.props.onNewTopic,onSettings:this.props.onSettings}):null)}}var Ba=r(8089);const za=(0,c.defineMessages)({archived_contacts_title:{id:"archived_contacts",defaultMessage:[{type:0,value:"Archived contacts ("},{type:1,value:"count"},{type:0,value:")"}]}});class qa extends d().Component{constructor(e){super(e),this.handleAction=this.handleAction.bind(this),this.state=qa.deriveStateFromProps(e)}static deriveStateFromProps(e){const t=[];let n=0,a=0;const s=e.tinode.getMeTopic();return e.chatList.forEach(i=>{const r=i.acs&&!i.acs.isJoiner();i.pinned=s.pinnedTopicRank(i.topic),r&&e.blocked&&t.push(i),r||e.blocked||(i.private&&i.private.arch?e.archive?t.push(i):a++:e.archive||(t.push(i),n+=i.unread>0?1:0))}),t.sort((e,t)=>{const n=t.pinned-e.pinned;return 0!=n?n:(t.touched||0)-(e.touched||0)}),a>0&&t.push({action:"archive",title:za.archived_contacts_title,values:{count:a}}),{contactList:t,unreadThreads:n}}componentDidUpdate(e,t){if(e.chatList!=this.props.chatList||e.archive!=this.props.archive||e.blocked!=this.props.blocked){const e=qa.deriveStateFromProps(this.props);this.setState(e),e.unreadThreads!=t.unreadThreads&&(0,Jn.OM)(e.unreadThreads)}}handleAction(e){this.props.onShowArchive()}render(){return d().createElement(c.FormattedMessage,{id:"contacts_not_found",defaultMessage:[{type:0,value:"You have no chats"},{type:0,value:"<br/>"},{type:0,value:"¯∖_(ツ)_/¯"}]},e=>d().createElement(In.A,{tinode:this.props.tinode,connected:this.props.connected,contacts:this.state.contactList,emptyListMessage:e,topicSelected:this.props.topicSelected,myUserId:this.props.myUserId,showOnline:!0,showUnread:!0,onTopicSelected:this.props.onTopicSelected,showContextMenu:this.props.showContextMenu,onAction:this.handleAction}))}}class Va extends d().PureComponent{constructor(e){super(e),this.state={colorSchema:e.colorSchema||"auto",textSize:10*e.textSize||"100",sendOnEnter:e.sendOnEnter||"plain"},this.isMac=(navigator.userAgentData&&navigator.userAgentData.platform||navigator.platform).toLowerCase().startsWith("mac"),this.handleColorSchemaSelected=this.handleColorSchemaSelected.bind(this),this.handleTextSizeChanged=this.handleTextSizeChanged.bind(this),this.handleSendOnEnterSelected=this.handleSendOnEnterSelected.bind(this)}handleColorSchemaSelected(e){this.setState({colorSchema:e.currentTarget.value}),this.props.onChangeColorSchema(e.currentTarget.value)}handleTextSizeChanged(e){this.setState({textSize:e.currentTarget.value}),this.props.onTextSizeChanged(e.currentTarget.value/10|0)}handleSendOnEnterSelected(e){this.setState({sendOnEnter:e.currentTarget.value}),this.props.onSendOnEnterChanged(e.currentTarget.value)}render(){return d().createElement("div",{id:"settings-form",className:"scrollable-panel"},d().createElement("div",{className:"panel-form-column"},d().createElement("div",{className:"panel-form-row"},d().createElement("label",{className:"small"},d().createElement(c.FormattedMessage,{id:"label_color_schema",defaultMessage:[{type:0,value:"Theme:"}]}))),d().createElement("div",{className:"panel-form-row"},d().createElement("ul",{className:"quoted"},d().createElement("li",{key:"system"},d().createElement("input",{type:"radio",id:"system",name:"color-scheme-select",value:"auto",checked:"auto"==this.state.colorSchema,onChange:this.handleColorSchemaSelected})," ",d().createElement("label",{htmlFor:"system"},d().createElement(c.FormattedMessage,{id:"color_schema_system",defaultMessage:[{type:0,value:"System default"}]})," ",d().createElement("img",{src:"img/routine.svg",style:{verticalAlign:"top",width:"1.6rem",height:"1.6rem"}}))),d().createElement("li",{key:"light"},d().createElement("input",{type:"radio",id:"light",name:"color-scheme-select",value:"light",checked:"light"==this.state.colorSchema,onChange:this.handleColorSchemaSelected})," ",d().createElement("label",{htmlFor:"light"},d().createElement(c.FormattedMessage,{id:"color_schema_light",defaultMessage:[{type:0,value:"Light"}]})," ",d().createElement("i",{className:"material-icons orange large"},"light_mode"))),d().createElement("li",{key:"dark"},d().createElement("input",{type:"radio",id:"dark",name:"color-scheme-select",value:"dark",checked:"dark"==this.state.colorSchema,onChange:this.handleColorSchemaSelected})," ",d().createElement("label",{htmlFor:"dark"},d().createElement(c.FormattedMessage,{id:"color_schema_dark",defaultMessage:[{type:0,value:"Dark"}]})," ",d().createElement("i",{className:"material-icons blue large"},"dark_mode")))))),d().createElement("div",{className:"hr"}),d().createElement("div",{className:"panel-form-row clean-clickable"},d().createElement("a",{onClick:this.props.onSelectWallpapers,className:"flat-button"},d().createElement("i",{className:"material-icons"},"wallpaper")," ",d().createElement(c.FormattedMessage,{id:"wallpapers",defaultMessage:[{type:0,value:"Wallpapers"}]}))),d().createElement("div",{className:"hr"}),d().createElement("div",{className:"panel-form-column"},d().createElement("div",{className:"panel-form-row"},d().createElement("label",{className:"small"},d().createElement(c.FormattedMessage,{id:"label_text_size",defaultMessage:[{type:0,value:"Text size:"}]}))),d().createElement("div",{className:"panel-form-row"},d().createElement("input",{type:"range",id:"text_size",name:"text_size",min:"80",max:"120",step:"10",list:"text_size_options",value:this.state.textSize,onChange:this.handleTextSizeChanged})),d().createElement("div",{className:"panel-form-row"},d().createElement("datalist",{id:"text_size_options"},d().createElement("option",{value:"80",label:"80%"}),d().createElement("option",{value:"90",label:"90%"}),d().createElement("option",{value:"100",label:"100%"}),d().createElement("option",{value:"110",label:"110%"}),d().createElement("option",{value:"120",label:"120%"})))),d().createElement("div",{className:"hr"}),d().createElement("div",{className:"panel-form-row"},d().createElement("label",{className:"small"},d().createElement(c.FormattedMessage,{id:"label_keyboard",defaultMessage:[{type:0,value:"Keyboard:"}]}))),d().createElement("div",{className:"panel-form-row"},d().createElement("ul",{className:"quoted"},d().createElement("li",{key:"plain"},d().createElement("input",{type:"radio",id:"plain",name:"send-select",value:"plain",checked:"plain"==this.state.sendOnEnter,onChange:this.handleSendOnEnterSelected})," ",d().createElement("label",{htmlFor:"send_plain"},d().createElement(c.FormattedMessage,{id:"send_plain",defaultMessage:[{type:0,value:"Send on Enter"}]})," "),d().createElement("div",{className:"panel-form-row"},d().createElement("span",{className:"small gray"},d().createElement(c.FormattedMessage,{id:"send_plain_explained",defaultMessage:[{type:0,value:"Press Shift + Enter for new line"}]})))),d().createElement("li",{key:"command"},d().createElement("input",{type:"radio",id:"command",name:"send-select",value:"command",checked:"command"==this.state.sendOnEnter,onChange:this.handleSendOnEnterSelected})," ",d().createElement("label",{htmlFor:"send_command"},d().createElement(c.FormattedMessage,{id:"send_command",defaultMessage:[{type:0,value:"Send on "},{type:1,value:"key"}],values:{key:this.isMac?"⌘ + Enter":"Ctrl + Enter"}})," "),d().createElement("div",{className:"panel-form-row"},d().createElement("span",{className:"small gray"},d().createElement(c.FormattedMessage,{id:"send_command_explained",defaultMessage:[{type:0,value:"Press Enter for new line"}]})))))))}}var Ha=r(1166);class Wa extends d().PureComponent{constructor(e){super(e),this.handleCheckboxClick=this.handleCheckboxClick.bind(this)}handleCheckboxClick(e,t){"sound"==e?this.props.onToggleMessageSounds(t):"alert"==e&&this.props.onTogglePushNotifications(t)}render(){return d().createElement("div",{className:"scrollable-panel"},d().createElement("div",{className:"panel-form-row"},d().createElement("label",{htmlFor:"message-sound"},d().createElement(c.FormattedMessage,{id:"label_message_sound",defaultMessage:[{type:0,value:"Message sound:"}]})),d().createElement(Ha.A,{name:"sound",id:"message-sound",checked:this.props.messageSounds,onChange:this.handleCheckboxClick})),d().createElement("div",{className:"panel-form-row"},d().createElement("label",{htmlFor:"desktop-alerts"},this.props.desktopAlertsEnabled?d().createElement(c.FormattedMessage,{id:"label_push_notifications",defaultMessage:[{type:0,value:"Notification alerts:"}]}):d().createElement(c.FormattedMessage,{id:"label_push_notifications_disabled",defaultMessage:[{type:0,value:"Notification alerts (requires HTTPS):"}]})),d().createElement(Ha.A,{name:"alert",id:"desktop-alerts",checked:this.props.desktopAlerts,onChange:this.props.desktopAlertsEnabled?this.handleCheckboxClick:null})))}}class Ga extends d().PureComponent{render(){return d().createElement("div",{className:"scrollable-panel"},d().createElement("div",{className:"panel-form-column"},d().createElement("a",{href:kn.fi,className:"flat-button",target:"_blank"},d().createElement("i",{className:"material-icons"},"email")," ",d().createElement(c.FormattedMessage,{id:"link_contact_us",defaultMessage:[{type:0,value:"Contact Us"}]})),d().createElement("a",{href:kn.V9,className:"flat-button",target:"_blank"},d().createElement("i",{className:"material-icons"},"description")," ",d().createElement(c.FormattedMessage,{id:"link_terms_of_service",defaultMessage:[{type:0,value:"Terms of Service"}]})),d().createElement("a",{href:kn.RS,className:"flat-button",target:"_blank"},d().createElement("i",{className:"material-icons"},"policy")," ",d().createElement(c.FormattedMessage,{id:"link_privacy_policy",defaultMessage:[{type:0,value:"Privacy Policy"}]}))),d().createElement("div",{className:"hr"}),d().createElement("div",{className:"panel-form-column"},d().createElement("div",{className:"panel-form-row"},d().createElement("label",{className:"small"},d().createElement(c.FormattedMessage,{id:"label_client",defaultMessage:[{type:0,value:"Client:"}]})),kn.C3),d().createElement("div",{className:"panel-form-row"},d().createElement("label",{className:"small"},d().createElement(c.FormattedMessage,{id:"label_sdk",defaultMessage:[{type:0,value:"SDK:"}]})),Tn.Tinode.getLibrary()),d().createElement("div",{className:"panel-form-row"},d().createElement("label",{className:"small"},d().createElement(c.FormattedMessage,{id:"label_server",defaultMessage:[{type:0,value:"Server:"}]})),this.props.serverVersion),d().createElement("div",{className:"panel-form-row"},d().createElement("label",{className:"small"},d().createElement(c.FormattedMessage,{id:"label_server_address",defaultMessage:[{type:0,value:"Server address:"}]})),this.props.serverAddress)))}}var Ka=r(6789);class Ya extends d().Component{constructor(e){super(e),this.state={login:e.login,password:"",hostName:e.serverAddress,saveToken:e.persist},this.handleLoginChange=this.handleLoginChange.bind(this),this.handlePasswordChange=this.handlePasswordChange.bind(this),this.handleToggleSaveToken=this.handleToggleSaveToken.bind(this),this.handleSubmit=this.handleSubmit.bind(this)}handleLoginChange(e){this.setState({login:e.target.value})}handlePasswordChange(e){this.setState({password:e.target.value})}handleToggleSaveToken(){this.props.onPersistenceChange(!this.state.saveToken),this.setState({saveToken:!this.state.saveToken})}handleSubmit(e){e.preventDefault(),this.props.onLogin(this.state.login.trim(),this.state.password.trim())}render(){let e="primary";return this.props.disabled&&(e+=" disabled"),d().createElement("form",{id:"login-form",onSubmit:this.handleSubmit},d().createElement(c.FormattedMessage,{id:"login_prompt",defaultMessage:[{type:0,value:"Login"}]},e=>d().createElement("input",{type:"text",id:"inputLogin",placeholder:e,autoComplete:"username",autoCorrect:"off",autoCapitalize:"none",value:this.state.login,onChange:this.handleLoginChange,required:!0,autoFocus:!0})),d().createElement(c.FormattedMessage,{id:"password_prompt",defaultMessage:[{type:0,value:"Password"}]},e=>d().createElement(Ka.A,{type:"password",id:"inputPassword",placeholder:e,autoComplete:"current-password",value:this.state.password,onChange:this.handlePasswordChange,required:!0})),d().createElement("div",{className:"panel-form-row"},d().createElement(Ha.A,{id:"save-token",name:"save-token",checked:this.state.saveToken,onChange:this.handleToggleSaveToken}),d().createElement("label",{htmlFor:"save-token"}," ",d().createElement(c.FormattedMessage,{id:"stay_logged_in",defaultMessage:[{type:0,value:"Stay logged in"}]})),d().createElement("a",{href:"#reset"},d().createElement(c.FormattedMessage,{id:"forgot_password_link",defaultMessage:[{type:0,value:"Forgot password?"}]}))),d().createElement("div",{className:"dialog-buttons"},d().createElement("button",{className:e,type:"submit"},d().createElement(c.FormattedMessage,{id:"button_sign_in",defaultMessage:[{type:0,value:"Sign in"}]}))))}}var Qa=r(9593),Xa=r.n(Qa);const Ja=(0,c.defineMessages)({invalid_id:{id:"error_invalid_id",defaultMessage:[{type:0,value:"Invalid ID"}]}});class Za extends d().PureComponent{constructor(e){super(e),this.qrCodeRef=d().createRef(),this.state={groupId:""},this.handleChange=this.handleChange.bind(this),this.handleKeyPress=this.handleKeyPress.bind(this),this.handleSubmit=this.handleSubmit.bind(this)}componentDidMount(){new(Xa())(this.qrCodeRef.current,{text:this.props.myURI,width:kn.Tn,height:kn.Tn})}handleChange(e){this.setState({groupId:e.target.value})}handleKeyPress(e){"Enter"===e.key&&this.handleSubmit(e)}handleSubmit(e){if(e.preventDefault(),this.state.groupId){const e=this.state.groupId.trim(),t=e.substring(0,3);e.length>3&&["usr","grp","chn"].includes(t)?this.props.onSubmit(e):this.props.onError(this.props.intl.formatMessage(Ja.invalid_id),"err")}}render(){return d().createElement("div",{className:"panel-form"},d().createElement("div",{className:"panel-form-row"},d().createElement(c.FormattedMessage,{id:"group_user_id_prompt",defaultMessage:[{type:0,value:"Group or User ID"}]},e=>d().createElement("input",{type:"text",placeholder:e,value:this.state.groupId,onChange:this.handleChange,onKeyDown:this.handleKeyPress,required:!0,autoFocus:!0}))),d().createElement("div",{className:"dialog-buttons"},d().createElement("button",{className:"primary",onClick:this.handleSubmit},d().createElement(c.FormattedMessage,{id:"button_subscribe",defaultMessage:[{type:0,value:"Subscribe"}]}))),d().createElement("br",null),d().createElement("div",{className:"panel-form-column"},d().createElement("label",{className:"small"},d().createElement(c.FormattedMessage,{id:"label_scan_id",defaultMessage:[{type:0,value:"Scan my ID:"}]})),d().createElement("div",{className:"qr-code",ref:this.qrCodeRef})))}}var es=(0,c.injectIntl)(Za),ts=r(221),ns=r(9418),as=r(3307);class ss extends d().PureComponent{constructor(e){super(e),this.fullName=d().createRef(),this.state={fullName:"",private:"",description:"",imageUrl:null,tags:[],isChannel:!1,newAvatar:null,newAvatarMime:null},this.handleFieldEdit=this.handleFieldEdit.bind(this),this.handleImageChanged=this.handleImageChanged.bind(this),this.handleAvatarCropped=this.handleAvatarCropped.bind(this),this.handleAvatarCropCancel=this.handleAvatarCropCancel.bind(this),this.uploadAvatar=this.uploadAvatar.bind(this),this.handleTagsChanged=this.handleTagsChanged.bind(this),this.handleChannelToggle=this.handleChannelToggle.bind(this),this.handleSubmit=this.handleSubmit.bind(this)}componentDidMount(){}handleFieldEdit(e,t){this.setState({[e]:t.target.value||""})}handleImageChanged(e,t){this.setState({newAvatar:t,newAvatarMime:e})}handleAvatarCropped(e,t,n,a){const s=t?URL.createObjectURL(t):null;this.setState({imageUrl:s,newAvatar:null,newAvatarMime:null}),t&&this.uploadAvatar(e,t,n,a)}handleAvatarCropCancel(){this.setState({newAvatar:null,newAvatarMime:null})}uploadAvatar(e,t,n,a){const s=e=>{let{mime:t,blob:n}=e;if(n.size>kn.Z7){this.props.tinode.getLargeFileHelper().upload(n).then(e=>this.setState({imageUrl:e})).catch(e=>this.props.onError(e.message,"err"))}else(0,Un.Sk)(n).then(e=>this.setState({imageUrl:(0,Un.to)({data:e.bits,type:t})}))};n>kn.eQ||a>kn.eQ||n!=a?(0,Un.ag)(t,kn.eQ,kn.eQ,kn.qy,!0).then(e=>s(e)).catch(e=>this.props.onError(e.message,"err")):s({mime:e,blob:t,width:n,height:a})}handleTagsChanged(e){this.setState({tags:e})}handleChannelToggle(){this.setState({isChannel:!this.state.isChannel})}handleSubmit(e){e.preventDefault();const t=(0,jn.W5)(this.state.fullName.trim(),kn.tS),n=(0,jn.W5)(this.state.private.trim(),kn.tS),a=(0,jn.W5)(this.state.description.trim(),kn.lQ);t&&this.props.onSubmit(t,a,this.state.imageUrl,n,this.state.tags,this.state.isChannel)}render(){if(this.state.newAvatar)return d().createElement(ts.A,{avatar:this.state.newAvatar,mime:this.state.newAvatarMime,onSubmit:this.handleAvatarCropped,onCancel:this.handleAvatarCropCancel,onError:this.props.onError});let e="primary";return this.props.disabled&&(e+=" disabled"),d().createElement("form",{className:"panel-form",onSubmit:this.handleSubmit},d().createElement("div",{className:"panel-form-column"},d().createElement("center",null,d().createElement(ns.A,{tinode:this.props.tinode,avatar:this.state.imageUrl,onError:this.props.onError,onImageUpdated:this.handleImageChanged})),d().createElement("div",{className:"group"},d().createElement("label",{className:"small",htmlFor:"new-topic-fn"},d().createElement(c.FormattedMessage,{id:"label_topic_name",defaultMessage:[{type:0,value:"Name"}]})),d().createElement(c.FormattedMessage,{id:"topic_name_editing_placeholder",defaultMessage:[{type:0,value:"Freeform name of the group"}]},e=>d().createElement("input",{type:"text",id:"new-topic-fn",placeholder:e,ref:this.fullName,value:this.state.fullName,onChange:this.handleFieldEdit.bind(this,"fullName"),autoFocus:!0,required:!0,tabIndex:0}))),d().createElement("div",{className:"group"},d().createElement("label",{className:"small",htmlFor:"new-topic-priv"},d().createElement(c.FormattedMessage,{id:"label_private",defaultMessage:[{type:0,value:"Private comment"}]})),d().createElement(c.FormattedMessage,{id:"private_editing_placeholder",defaultMessage:[{type:0,value:"Visible to you only"}]},e=>d().createElement("input",{type:"text",id:"new-topic-priv",placeholder:e,value:this.state.private,onChange:this.handleFieldEdit.bind(this,"private"),tabIndex:1}))),d().createElement("div",{className:"group"},d().createElement("label",{className:"small",htmlFor:"new-topic-desc"},d().createElement(c.FormattedMessage,{id:"label_description",defaultMessage:[{type:0,value:"Description"}]})),d().createElement(c.FormattedMessage,{id:"description_editing_placeholder",defaultMessage:[{type:0,value:"Description (optional)"}]},e=>d().createElement("input",{type:"text",id:"new-topic-desc",placeholder:e,value:this.state.description,onChange:this.handleFieldEdit.bind(this,"description"),tabIndex:2})))),d().createElement("div",{className:"panel-form-row"},d().createElement(Ha.A,{checked:this.state.isChannel,tabIndex:3,onChange:this.handleChannelToggle})," ",d().createElement("label",{onClick:this.handleChannelToggle},d().createElement(c.FormattedMessage,{id:"channel_prompt",defaultMessage:[{type:0,value:"This is a channel"}]}))),d().createElement(c.FormattedMessage,{id:"title_tag_manager",defaultMessage:[{type:0,value:"Tags (search & discovery)"}]},e=>d().createElement(as.A,{tinode:this.props.tinode,tags:this.state.tags,activated:!0,onTagsChanged:this.handleTagsChanged,tabIndex:4,title:e})),d().createElement("div",{className:"dialog-buttons"},d().createElement("button",{className:e},d().createElement(c.FormattedMessage,{id:"button_create",defaultMessage:[{type:0,value:"Create"}]}))))}}const is=(0,c.defineMessages)({search_for_contacts:{id:"search_for_contacts",defaultMessage:[{type:0,value:"Use search to find contacts"}]},search_no_results:{id:"search_no_results",defaultMessage:[{type:0,value:"Search returned no results"}]},search_placeholder:{id:"search_placeholder",defaultMessage:[{type:0,value:"List like alice@example.com, +17025550003..."}]}});class rs extends d().Component{constructor(e){super(e),this.state={tabSelected:"find",searchQuery:null},this.handleTabClick=this.handleTabClick.bind(this),this.handleSearchContacts=this.handleSearchContacts.bind(this),this.handleSearchResultSelected=this.handleSearchResultSelected.bind(this),this.handleNewGroupSubmit=this.handleNewGroupSubmit.bind(this),this.handleGroupByID=this.handleGroupByID.bind(this)}componentDidMount(){this.props.onInitFind()}handleTabClick(e){e.preventDefault(),Na.A.navigateTo(Na.A.addUrlParam(window.location.hash,"tab",e.currentTarget.dataset.id)),this.setState({tabSelected:e.currentTarget.dataset.id})}handleSearchContacts(e){if(e=e.trim()||Tn.Tinode.DEL_CHAR,!/[\s,:]/.test(e)&&e!=Tn.Tinode.DEL_CHAR){const t=(0,Jn.xH)(e);if(t)e=`${Tn.Tinode.TAG_EMAIL}${t}`;else{const t=(0,Jn.Jt)(e);t?e=`${Tn.Tinode.TAG_PHONE}${t}`:("@"==e[0]&&(e=e.substring(1)),e=`${Tn.Tinode.TAG_ALIAS}${e},${e}`)}}this.props.onSearchContacts(e),this.setState({searchQuery:Tn.Tinode.isNullValue(e)?null:e})}handleSearchResultSelected(e){"find"==this.state.tabSelected&&(Na.A.navigateTo(Na.A.removeUrlParam(window.location.hash,"tab")),this.props.onCreateTopic(e))}handleNewGroupSubmit(e,t,n,a,s,i){Na.A.navigateTo(Na.A.removeUrlParam(window.location.hash,"tab")),this.props.onCreateTopic(void 0,{public:(0,Jn.k6)(e,n,null,t),private:a,tags:s},i)}handleGroupByID(e){Na.A.navigateTo(Na.A.removeUrlParam(window.location.hash,"tab")),this.props.onCreateTopic(e)}render(){const{formatMessage:e}=this.props.intl,t=e(this.state.searchQuery?is.search_no_results:is.search_for_contacts),n=e(is.search_placeholder);return d().createElement("div",{className:"flex-column"},d().createElement("ul",{className:"tabbar"},d().createElement("li",{className:"find"===this.state.tabSelected?"active":null},d().createElement("a",{href:"#","data-id":"find",onClick:this.handleTabClick},d().createElement(c.FormattedMessage,{id:"tabtitle_find_user",defaultMessage:[{type:0,value:"find"}]}))),d().createElement("li",{className:"grp"===this.state.tabSelected?"active":null},d().createElement("a",{href:"#","data-id":"grp",onClick:this.handleTabClick},d().createElement(c.FormattedMessage,{id:"tabtitle_new_group",defaultMessage:[{type:0,value:"new group"}]}))),d().createElement("li",{className:"byid"===this.state.tabSelected?"active":null},d().createElement("a",{href:"#","data-id":"byid",onClick:this.handleTabClick},d().createElement(c.FormattedMessage,{id:"tabtitle_group_by_id",defaultMessage:[{type:0,value:"by id"}]})))),"grp"===this.state.tabSelected?d().createElement(ss,{tinode:this.props.tinode,onSubmit:this.handleNewGroupSubmit,onError:this.props.onError}):"byid"===this.state.tabSelected?d().createElement(es,{myURI:Tn.Tinode.URI_TOPIC_ID_PREFIX+this.props.tinode.getCurrentUserID(),onSubmit:this.handleGroupByID,onError:this.props.onError}):d().createElement("div",{className:"flex-column"},d().createElement(Rn,{placeholder:n,onSearchContacts:this.handleSearchContacts}),d().createElement(In.A,{tinode:this.props.tinode,contacts:this.props.searchResults,myUserId:this.props.myUserId,emptyListMessage:t,showSelfTopic:!this.state.searchQuery,showOnline:!1,showUnread:!1,showContextMenu:!1,onTopicSelected:this.handleSearchResultSelected})))}}var os=(0,c.injectIntl)(rs);class ds extends d().PureComponent{constructor(e){super(e),this.state={hostName:e.serverAddress,changed:!1},this.handleHostNameChange=this.handleHostNameChange.bind(this),this.handleEditingFinished=this.handleEditingFinished.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this)}handleHostNameChange(e){this.setState({hostName:e.target.value,changed:!0})}handleEditingFinished(){this.state.changed&&(this.setState({changed:!1}),this.props.onServerAddressChange(this.state.hostName.trim()))}handleKeyDown(e){"Enter"==e.key&&this.handleEditingFinished()}render(){const e=[];for(let t in kn.SE){let n=kn.SE[t];e.push(d().createElement("option",{key:n,value:n}))}return d().createElement("div",{className:"panel-form-row"},d().createElement("input",{type:"search",id:"host-name",placeholder:this.props.hostName,list:"known-hosts",className:"quoted",value:this.state.hostName,onChange:this.handleHostNameChange,onBlur:this.handleEditingFinished,onKeyDown:this.handleKeyDown,required:!0}),d().createElement("datalist",{id:"known-hosts"},e))}}class ls extends d().PureComponent{constructor(e){super(e),this.state={transport:e.transport||"def",serverAddress:e.serverAddress,secureConnection:e.secureConnection},this.handleSubmit=this.handleSubmit.bind(this),this.handleTransportSelected=this.handleTransportSelected.bind(this),this.handleServerAddressChange=this.handleServerAddressChange.bind(this),this.handleToggleSecure=this.handleToggleSecure.bind(this)}handleSubmit(e){e.preventDefault(),this.props.onUpdate({transport:this.state.transport,serverAddress:this.state.serverAddress,secureConnection:this.state.secureConnection})}handleTransportSelected(e){this.setState({transport:e.currentTarget.value})}handleServerAddressChange(e){this.setState({serverAddress:e})}handleToggleSecure(e){this.setState({secureConnection:!this.state.secureConnection})}render(){const e={def:"default",ws:"websocket",lp:"long polling"},t=[];return["def","ws","lp"].forEach(n=>{const a="transport-"+n,s=e[n];t.push(d().createElement("li",{key:n},d().createElement("input",{type:"radio",id:a,name:"transport-select",value:n,checked:this.state.transport===n,onChange:this.handleTransportSelected}),d().createElement("label",{htmlFor:a},s)))}),d().createElement("form",{id:"settings-form",className:"panel-form",onSubmit:this.handleSubmit},d().createElement("div",{className:"panel-form-row"},d().createElement("label",{className:"small"},d().createElement(c.FormattedMessage,{id:"label_server_to_use",defaultMessage:[{type:0,value:"Server to use:"}]}))),d().createElement(ds,{serverAddress:this.state.serverAddress,onServerAddressChange:this.handleServerAddressChange}),d().createElement("div",{className:"panel-form-row"},d().createElement(Ha.A,{id:"secure-connection",name:"secure-connection",checked:this.state.secureConnection,className:"quoted",onChange:this.handleToggleSecure}),d().createElement("label",{htmlFor:"secure-connection"},d().createElement(c.FormattedMessage,{id:"label_use_secure_connection",defaultMessage:[{type:0,value:"Use secure connection"}]}))),d().createElement("div",{className:"panel-form-row"},d().createElement("label",{className:"small"},d().createElement(c.FormattedMessage,{id:"label_wire_transport",defaultMessage:[{type:0,value:"Wire transport:"}]}))),d().createElement("div",{className:"panel-form-row"},d().createElement("ul",{className:"quoted"},t)),d().createElement("div",{className:"dialog-buttons"},d().createElement("button",{type:"submit",className:"primary"},d().createElement(c.FormattedMessage,{id:"button_update",defaultMessage:[{type:0,value:"Update"}]}))))}}const cs=(0,c.defineMessages)({phone:{id:"phone_dative",defaultMessage:[{type:0,value:"phone"}]},email:{id:"email_dative",defaultMessage:[{type:0,value:"email"}]}});class hs extends d().PureComponent{constructor(e){super(e),this.state={code:e.credCode||"",codeReceived:e.credCode},this.handleCodeChange=this.handleCodeChange.bind(this),this.handleKeyPress=this.handleKeyPress.bind(this),this.handleSubmit=this.handleSubmit.bind(this),this.handleCancel=this.handleCancel.bind(this)}static getDerivedStateFromProps(e,t){return e.credCode!=t.codeReceived?{code:e.credCode||"",codeReceived:e.credCode}:t}componentDidMount(){this.props.credCode&&this.props.onSubmit(this.props.credMethod,this.props.credCode,this.props.credToken)}componentDidUpdate(e,t){this.state.codeReceived&&this.state.code&&this.state.code!=t.code&&this.props.onSubmit(this.props.credMethod,this.state.code,this.props.credToken)}handleCodeChange(e){this.setState({code:e.target.value.replace(/[^\d]/g,"")})}handleKeyPress(e){"Enter"===e.key?this.handleSubmit(e):"Escape"==e.key&&this.handleCancel(e)}handleSubmit(e){e.preventDefault(),this.state.code&&this.state.code.trim()&&this.props.onSubmit(this.props.credMethod,this.state.code.trim(),this.props.credToken)}handleCancel(e){e.preventDefault(),this.props.onCancel()}render(){const{formatMessage:e}=this.props.intl,t={email:e(cs.email),tel:e(cs.phone)}[this.props.credMethod]||this.props.credMethod;return d().createElement("div",{className:"panel-form"},d().createElement("div",{className:"panel-form-row"},d().createElement("label",{className:"small gray",htmlFor:"enter-confirmation-code"},d().createElement(c.FormattedMessage,{id:"enter_confirmation_code_prompt",defaultMessage:[{type:0,value:"Confirmation code"}],values:{method:t}}))),d().createElement("div",{className:"panel-form-row"},d().createElement(c.FormattedMessage,{id:"numeric_confirmation_code_prompt",defaultMessage:[{type:0,value:"Numbers only"}]},e=>d().createElement("input",{type:"text",id:"enter-confirmation-code",placeholder:e,value:this.state.code,onChange:this.handleCodeChange,onKeyDown:this.handleKeyPress,required:!0}))),d().createElement("div",{className:"dialog-buttons"},d().createElement("button",{className:"secondary",onClick:this.handleCancel},d().createElement(c.FormattedMessage,{id:"button_cancel",defaultMessage:[{type:0,value:"Cancel"}]})),d().createElement("button",{className:"primary",onClick:this.handleSubmit},d().createElement(c.FormattedMessage,{id:"button_confirm",defaultMessage:[{type:0,value:"Confirm"}]}))))}}var ps=(0,c.injectIntl)(hs);const us=d().lazy(e=>Promise.all([r.e(330),r.e(271)]).then(r.bind(r,4271))),ms=d().lazy(e=>Promise.all([r.e(330),r.e(996)]).then(r.bind(r,3996))),gs=d().lazy(e=>r.e(352).then(r.bind(r,2352))),fs=d().lazy(e=>Promise.all([r.e(330),r.e(993)]).then(r.bind(r,3993))),vs=d().lazy(e=>r.e(827).then(r.bind(r,3827))),$s=(0,c.defineMessages)({login:{id:"sidepanel_title_login",defaultMessage:[{type:0,value:"Sign In"}]},register:{id:"sidepanel_title_register",defaultMessage:[{type:0,value:"Create Account"}]},settings:{id:"sidepanel_title_settings",defaultMessage:[{type:0,value:"Settings"}]},edit:{id:"sidepanel_title_account_settings",defaultMessage:[{type:0,value:"Account Settings"}]},general:{id:"panel_title_general",defaultMessage:[{type:0,value:"General"}]},security:{id:"panel_title_security",defaultMessage:[{type:0,value:"Security"}]},crop:{id:"panel_title_crop",defaultMessage:[{type:0,value:"Drag to Adjust"}]},notif:{id:"sidepanel_title_acc_notifications",defaultMessage:[{type:0,value:"Notifications"}]},acc_general:{id:"sidepanel_title_acc_general",defaultMessage:[{type:0,value:"General"}]},support:{id:"sidepanel_title_acc_support",defaultMessage:[{type:0,value:"Support"}]},newtpk:{id:"sidepanel_title_newtpk",defaultMessage:[{type:0,value:"Start New Chat"}]},cred:{id:"sidepanel_title_cred",defaultMessage:[{type:0,value:"Confirm Credentials"}]},reset:{id:"sidepanel_title_reset",defaultMessage:[{type:0,value:"Reset Password"}]},archive:{id:"sidepanel_title_archive",defaultMessage:[{type:0,value:"Archived Chats"}]},blocked:{id:"sidepanel_title_blocked",defaultMessage:[{type:0,value:"Blocked Chats"}]},wallpapers:{id:"wallpapers",defaultMessage:[{type:0,value:"Wallpapers"}]}});class bs extends d().PureComponent{constructor(e){super(e),this.handleNewTopic=this.handleNewTopic.bind(this)}handleNewTopic(){this.props.onNavigate("newtpk")}render(){const{formatMessage:e}=this.props.intl,t=this.props.state||(this.props.myUserId?"contacts":"login");let n,a,s,i;return"contacts"==t?(n=this.props.title,a=!this.props.avatar||this.props.avatar,s=this.props.trustedBadges):(n=e($s[t]),a=!1,s=null),-1==["login","contacts"].indexOf(t)&&(i=this.props.onCancel),d().createElement("div",{id:"sidepanel"},d().createElement(ja,{state:t,title:n,avatar:a,tinode:this.props.tinode,trustedBadges:s,myUserId:this.props.myUserId,onSignUp:this.props.onSignUp,onSettings:this.props.onSettings,onNewTopic:this.handleNewTopic,onCancel:i}),d().createElement(ma.A,{level:this.props.errorLevel,text:this.props.errorText,action:this.props.errorAction,actionText:this.props.errorActionText,onClearError:this.props.onError}),d().createElement($a.A,{show:this.props.loadSpinnerVisible}),"login"===t?d().createElement(Ya,{login:this.props.login,disabled:this.props.loginDisabled,persist:this.props.persist,onLogin:this.props.onLoginRequest,onPersistenceChange:this.props.onPersistenceChange}):"register"===t?d().createElement(o.Suspense,{fallback:d().createElement("div",{className:"panel-form-row"},d().createElement(c.FormattedMessage,{id:"loading_note",defaultMessage:[{type:0,value:"Loading..."}]}))},d().createElement(ms,{tinode:this.props.tinode,reqCredMethod:this.props.reqCredMethod,onShowCountrySelector:this.props.onShowCountrySelector,onCreateAccount:this.props.onCreateAccount,onCancel:this.props.onCancel,onError:this.props.onError})):"settings"===t?d().createElement(ls,{transport:this.props.transport,serverAddress:this.props.serverAddress,secureConnection:this.props.secureConnection,onCancel:this.props.onCancel,onUpdate:this.props.onGlobalSettings}):"edit"===t?d().createElement(o.Suspense,{fallback:d().createElement("div",{className:"panel-form-row"},d().createElement(c.FormattedMessage,{id:"loading_note",defaultMessage:[{type:0,value:"Loading..."}]}))},d().createElement(us,{tinode:this.props.tinode,myUserId:this.props.myUserId,trustedBadges:this.props.trustedBadges,reqCredMethod:this.props.reqCredMethod,onShowCountrySelector:this.props.onShowCountrySelector,onNavigate:this.props.onNavigate,onCredAdd:this.props.onCredAdd,onCredDelete:this.props.onCredDelete,onCredConfirm:this.props.onCredConfirm,onError:this.props.onError})):"general"===t||"crop"===t?d().createElement(Ba.A,{topic:"me",tinode:this.props.tinode,myUserId:this.props.myUserId,reqCredMethod:this.props.reqCredMethod,onUpdateTopicDesc:this.props.onUpdateAccountDesc,onUpdateTagsRequest:this.props.onUpdateAccountTags,onError:this.props.onError}):"acc_general"===t?d().createElement(Va,{colorSchema:this.props.colorSchema,onSelectWallpapers:this.props.onSelectWallpapers,textSize:this.props.textSize,sendOnEnter:this.props.sendOnEnter,onChangeColorSchema:this.props.onChangeColorSchema,onTextSizeChanged:this.props.onTextSizeChanged,onSendOnEnterChanged:this.props.onSendOnEnterChanged}):"notif"===t?d().createElement(Wa,{messageSounds:this.props.messageSounds,desktopAlerts:this.props.desktopAlerts,desktopAlertsEnabled:this.props.desktopAlertsEnabled,onTogglePushNotifications:this.props.onTogglePushNotifications,onToggleMessageSounds:this.props.onToggleMessageSounds}):"security"===t?d().createElement(o.Suspense,{fallback:d().createElement("div",{className:"panel-form-row"},d().createElement(c.FormattedMessage,{id:"loading_note",defaultMessage:[{type:0,value:"Loading..."}]}))},d().createElement(gs,{tinode:this.props.tinode,incognitoMode:this.props.incognitoMode,onUpdateAccountDesc:this.props.onUpdateAccountDesc,onUpdatePassword:this.props.onUpdatePassword,onLogout:this.props.onLogout,onDeleteAccount:this.props.onDeleteAccount,onShowAlert:this.props.onShowAlert,onShowBlocked:this.props.onShowBlocked,onToggleIncognitoMode:this.props.onToggleIncognitoMode})):"support"===t?d().createElement(Ga,{serverAddress:this.props.serverAddress,serverVersion:this.props.serverVersion}):"wallpapers"===t?d().createElement(o.Suspense,{fallback:d().createElement("div",{className:"panel-form-row"},d().createElement(c.FormattedMessage,{id:"loading_note",defaultMessage:[{type:0,value:"Loading..."}]}))},d().createElement(vs,{wallpaper:this.props.wallpaper,wallpaperSize:this.props.wallpaperSize,wallpaperBlur:this.props.wallpaperBlur,colorSchema:"auto"!==this.props.colorSchema?this.props.colorSchema:this.props.systemColorSchema,onWallpaperSelected:this.props.onWallpaperSelected})):"contacts"===t||"archive"==t||"blocked"==t?d().createElement(qa,{tinode:this.props.tinode,myUserId:this.props.myUserId,connected:this.props.connected,topicSelected:this.props.topicSelected,archive:"archive"==t,blocked:"blocked"==t,chatList:this.props.chatList,showContextMenu:this.props.showContextMenu,onTopicSelected:this.props.onTopicSelected,onShowArchive:this.props.onShowArchive}):"newtpk"===t?d().createElement(os,{tinode:this.props.tinode,searchResults:this.props.searchResults,onInitFind:this.props.onInitFind,onSearchContacts:this.props.onSearchContacts,onCreateTopic:this.props.onCreateTopic,onError:this.props.onError}):"cred"===t?d().createElement(ps,{credCode:this.props.credCode,credMethod:this.props.credMethod,credToken:this.props.credToken,onSubmit:this.props.onValidateCredentials,onCancel:this.props.onCancel}):"reset"===t?d().createElement(o.Suspense,{fallback:d().createElement("div",{className:"panel-form-row"},d().createElement(c.FormattedMessage,{id:"loading_note",defaultMessage:[{type:0,value:"Loading..."}]}))},d().createElement(fs,{tinode:this.props.tinode,reqCredMethod:this.props.reqCredMethod,onShowCountrySelector:this.props.onShowCountrySelector,onRequest:this.props.onPasswordResetRequest,onReset:this.props.onResetPassword,onCancel:this.props.onCancel,onError:this.props.onError})):null)}}var ys=(0,c.injectIntl)(bs),Es=r(257);function Cs(){let e=kn.HX;return"object"==typeof window.location&&("file:"==window.location.protocol||"localhost"==window.location.hostname?e=kn.SE.local:window.location.hostname&&(e=window.location.hostname+(window.location.port?":"+window.location.port:""))),e}function ws(){return"object"==typeof window.location&&"https:"==window.location.protocol}var Ss=r(8262);const Ms=d().lazy(e=>r.e(316).then(r.bind(r,4316))),_s=d().lazy(e=>r.e(747).then(r.bind(r,7747))),Ts=new Audio("audio/msg.m4a"),As=(0,c.defineMessages)({reconnect_countdown:{id:"reconnect_countdown",defaultMessage:[{type:0,value:"Disconnected. Reconnecting in "},{type:1,value:"seconds"},{type:0,value:"…"}]},reconnect_now:{id:"reconnect_now",defaultMessage:[{type:0,value:"Try now"}]},push_init_failed:{id:"push_init_failed",defaultMessage:[{type:0,value:"Failed to initialize push notifications"}]},invalid_security_token:{id:"invalid_security_token",defaultMessage:[{type:0,value:"Invalid security token"}]},no_connection:{id:"no_connection",defaultMessage:[{type:0,value:"No connection"}]},code_doesnot_match:{id:"code_doesnot_match",defaultMessage:[{type:0,value:"Code does not match"}]},menu_item_info:{id:"menu_item_info",defaultMessage:[{type:0,value:"Info"}]},menu_item_audio_call:{id:"menu_item_audio_call",defaultMessage:[{type:0,value:"Call"}]},menu_item_video_call:{id:"menu_item_video_call",defaultMessage:[{type:0,value:"Video call"}]},cred_confirmed_successfully:{id:"cred_confirmed_successfully",defaultMessage:[{type:0,value:"Confirmed successfully"}]},password_reset_success:{id:"password_reset_success",defaultMessage:[{type:0,value:"Password reset successfully"}]},select_country:{id:"select_country",defaultMessage:[{type:0,value:"Select country"}]}});class ks extends d().Component{constructor(e){super(e),this.selfRef=d().createRef(),this.state=this.getBlankState(),this.handleResize=this.handleResize.bind(this),this.handleHashRoute=this.handleHashRoute.bind(this),this.handleOnline=this.handleOnline.bind(this),this.handleColorSchemeChange=this.handleColorSchemeChange.bind(this),this.checkForAppUpdate=this.checkForAppUpdate.bind(this),this.handleVisibilityEvent=this.handleVisibilityEvent.bind(this),this.handleError=this.handleError.bind(this),this.handleLoginRequest=this.handleLoginRequest.bind(this),this.handlePersistenceChange=this.handlePersistenceChange.bind(this),this.handleConnected=this.handleConnected.bind(this),this.handleAutoreconnectIteration=this.handleAutoreconnectIteration.bind(this),this.doLogin=this.doLogin.bind(this),this.handleLoginSuccessful=this.handleLoginSuccessful.bind(this),this.handleDisconnect=this.handleDisconnect.bind(this),this.tnMeMetaDesc=this.tnMeMetaDesc.bind(this),this.tnMeContactUpdate=this.tnMeContactUpdate.bind(this),this.tnMeSubsUpdated=this.tnMeSubsUpdated.bind(this),this.resetContactList=this.resetContactList.bind(this),this.tnInitFind=this.tnInitFind.bind(this),this.tnFndSubsUpdated=this.tnFndSubsUpdated.bind(this),this.handleSearchContacts=this.handleSearchContacts.bind(this),this.handleTopicSelected=this.handleTopicSelected.bind(this),this.handleHideMessagesView=this.handleHideMessagesView.bind(this),this.handleSendMessage=this.handleSendMessage.bind(this),this.handleNewChatInvitation=this.handleNewChatInvitation.bind(this),this.handleNewAccount=this.handleNewAccount.bind(this),this.handleNewAccountRequest=this.handleNewAccountRequest.bind(this),this.handleUpdatePasswordRequest=this.handleUpdatePasswordRequest.bind(this),this.handleUpdateAccountTagsRequest=this.handleUpdateAccountTagsRequest.bind(this),this.handleToggleIncognitoMode=this.handleToggleIncognitoMode.bind(this),this.handleChangeColorSchema=this.handleChangeColorSchema.bind(this),this.handleChangeTextSize=this.handleChangeTextSize.bind(this),this.handleSendOnEnter=this.handleSendOnEnter.bind(this),this.handleSelectWallpapers=this.handleSelectWallpapers.bind(this),this.handleWallpaperSelected=this.handleWallpaperSelected.bind(this),this.handleSettings=this.handleSettings.bind(this),this.handleGlobalSettings=this.handleGlobalSettings.bind(this),this.handleShowArchive=this.handleShowArchive.bind(this),this.handleShowBlocked=this.handleShowBlocked.bind(this),this.handleToggleMessageSounds=this.handleToggleMessageSounds.bind(this),this.handleCredAdd=this.handleCredAdd.bind(this),this.handleCredDelete=this.handleCredDelete.bind(this),this.handleCredConfirm=this.handleCredConfirm.bind(this),this.initFCMessaging=this.initFCMessaging.bind(this),this.toggleFCMToken=this.toggleFCMToken.bind(this),this.handlePushMessage=this.handlePushMessage.bind(this),this.handleSidepanelCancel=this.handleSidepanelCancel.bind(this),this.handleStartTopicRequest=this.handleStartTopicRequest.bind(this),this.handleNewTopicCreated=this.handleNewTopicCreated.bind(this),this.handleTopicUpdateRequest=this.handleTopicUpdateRequest.bind(this),this.handleUnarchive=this.handleUnarchive.bind(this),this.handleChangePermissions=this.handleChangePermissions.bind(this),this.handleTagsUpdateRequest=this.handleTagsUpdateRequest.bind(this),this.handleLogout=this.handleLogout.bind(this),this.handleDeleteAccount=this.handleDeleteAccount.bind(this),this.handleDeleteTopicRequest=this.handleDeleteTopicRequest.bind(this),this.handleDeleteMessagesRequest=this.handleDeleteMessagesRequest.bind(this),this.handleLeaveUnsubRequest=this.handleLeaveUnsubRequest.bind(this),this.handleBlockTopicRequest=this.handleBlockTopicRequest.bind(this),this.handleReportTopic=this.handleReportTopic.bind(this),this.handleShowContextMenu=this.handleShowContextMenu.bind(this),this.defaultTopicContextMenu=this.defaultTopicContextMenu.bind(this),this.handleHideContextMenu=this.handleHideContextMenu.bind(this),this.handleShowAlert=this.handleShowAlert.bind(this),this.handleShowInfoView=this.handleShowInfoView.bind(this),this.handleMemberUpdateRequest=this.handleMemberUpdateRequest.bind(this),this.handleValidateCredentialsRequest=this.handleValidateCredentialsRequest.bind(this),this.handlePasswordResetRequest=this.handlePasswordResetRequest.bind(this),this.handleResetPassword=this.handleResetPassword.bind(this),this.handleContextMenuAction=this.handleContextMenuAction.bind(this),this.handleShowCountrySelector=this.handleShowCountrySelector.bind(this),this.handleShowForwardDialog=this.handleShowForwardDialog.bind(this),this.handleHideForwardDialog=this.handleHideForwardDialog.bind(this),this.handleStartVideoCall=this.handleStartVideoCall.bind(this),this.handleStartAudioCall=this.handleStartAudioCall.bind(this),this.handleInfoMessage=this.handleInfoMessage.bind(this),this.handleDataMessage=this.handleDataMessage.bind(this),this.handleCallClose=this.handleCallClose.bind(this),this.handleCallInvite=this.handleCallInvite.bind(this),this.handleCallRinging=this.handleCallRinging.bind(this),this.handleCallHangup=this.handleCallHangup.bind(this),this.handleCallSendOffer=this.handleCallSendOffer.bind(this),this.handleCallIceCandidate=this.handleCallIceCandidate.bind(this),this.handleCallSendAnswer=this.handleCallSendAnswer.bind(this),this.handleCallAccept=this.handleCallAccept.bind(this),this.sendMessageToTopic=this.sendMessageToTopic.bind(this),this.callTimeoutTimer=null}getBlankState(){const e=Ss.A.getObject("settings")||{},t=!!Ss.A.getObject("keep-logged-in");if(!e.wallpaper){const t=(0,Jn.KY)();e.wallpaper=t.name||"",e.wallpaperSize=t.size||0,e.wallpaperBlur=0}return{connected:!1,ready:!1,autoLogin:!1,transport:e.transport||null,serverAddress:e.serverAddress||Cs(),secureConnection:void 0===e.secureConnection?ws():e.secureConnection,serverVersion:"no connection",messageSounds:!e.messageSoundsOff,incognitoMode:!1,colorSchema:e.colorSchema||kn.gb,systemColorSchema:window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light",wallpaper:e.wallpaper,wallpaperSize:e.wallpaperSize,wallpaperBlur:0,textSize:e.textSize||kn.cL,sendOnEnter:e.sendOnEnter||"plain",desktopAlerts:t&&!!e.desktopAlerts,desktopAlertsEnabled:(ws()||"object"==typeof window.location&&"localhost"==window.location.hostname)&&void 0!==ze&&"undefined"!=typeof navigator&&"undefined"!=typeof FIREBASE_INIT,firebaseToken:t?Ss.A.getObject("firebase-token"):null,applicationVisible:!document.hidden,errorText:"",errorLevel:null,errorAction:void 0,errorActionText:null,sidePanelSelected:"login",sidePanelTitle:null,sidePanelAvatar:null,myTrustedBadges:[],loadSpinnerVisible:!1,login:"",password:"",persist:t,myUserId:null,liveConnection:navigator.onLine,topicSelected:"",topicSelectedOnline:!1,topicSelectedAcs:null,newTopicParams:null,loginDisabled:!1,displayMobile:window.innerWidth<=kn.VJ,infoPanel:void 0,mobilePanel:"sidepanel",callTopic:void 0,callState:0,callAudioOnly:void 0,callShouldStart:!1,contextMenuVisible:!1,contextMenuBounds:null,contextMenuClickAt:null,contextMenuParams:null,contextMenuItems:[],forwardDialogVisible:!1,forwardMessage:null,alertVisible:!1,alertParams:{},chatList:[],searchResults:[],searchableContacts:[],reqCredMethod:void 0,credMethod:void 0,credCode:void 0,credToken:void 0,requestedTopic:void 0}}componentDidMount(){if(window.addEventListener("resize",this.handleResize),this.handleOnlineOn=e=>{this.handleOnline(!0)},window.addEventListener("online",this.handleOnlineOn),this.handleOnlineOff=e=>{this.handleOnline(!1)},window.addEventListener("offline",this.handleOnlineOff),window.addEventListener("hashchange",this.handleHashRoute),window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",this.handleColorSchemeChange),document.addEventListener("visibilitychange",this.handleVisibilityEvent),document.documentElement.style.colorScheme="auto"==this.state.colorSchema?"light dark":this.state.colorSchema,document.documentElement.style.setProperty("--message-text-size",`${this.state.textSize}pt`),this.applyWallpaperSettings(this.state.wallpaper,this.state.wallpaperSize,this.state.wallpaperBlur,"auto"==this.state.colorSchema?this.state.systemColorSchema:this.state.colorSchema),"function"==typeof BroadcastChannel){new BroadcastChannel("tinode-sw").addEventListener("message",this.handlePushMessage)}else console.warn("Your browser does not support BroadcastChannel. Some features will not be available");this.lastWakeUpCheck=(new Date).getTime(),this.wakeUpTicker=setInterval(e=>{const t=(new Date).getTime();t-this.lastWakeUpCheck>kn.hT&&this.handleOnlineOn(),this.lastWakeUpCheck=t},kn.ZW),this.setState({viewportWidth:document.documentElement.clientWidth,viewportHeight:document.documentElement.clientHeight}),new Promise((e,t)=>{this.tinode=ks.tnSetup(this.state.serverAddress,ws(),this.state.transport,this.props.intl.locale,this.state.persist,e),this.tinode.onConnect=this.handleConnected,this.tinode.onDisconnect=this.handleDisconnect,this.tinode.onAutoreconnectIteration=this.handleAutoreconnectIteration,this.tinode.onInfoMessage=this.handleInfoMessage,this.tinode.onDataMessage=this.handleDataMessage}).then(e=>{this.state.desktopAlertsEnabled&&this.initFCMessaging().catch(e=>{}),this.resetContactList();const t=this.state.persist?Ss.A.getObject("auth-token"):void 0;t&&(this.setState({autoLogin:!0}),t.expires=new Date(t.expires),this.tinode.setAuthToken(t),this.tinode.connect().catch(e=>{this.handleError(e.message,"err")}));const n=Na.A.parseUrlHash(window.location.hash);if(["cred","reset","register"].includes(n.path[0]))this.handleHashRoute();else{this.setState({requestedTopic:n.path[1]});const e=n.params&&n.params.cred_done?Na.A.addUrlParam("","cred_done",n.params.cred_done):"";Na.A.navigateTo(e)}})}componentWillUnmount(){window.removeEventListener("resize",this.handleResize),window.removeEventListener("hashchange",this.handleHashRoute),window.removeEventListener("online",this.handleOnlineOn),window.removeEventListener("offline",this.handleOnlineOff),window.matchMedia("(prefers-color-scheme: dark)").removeEventListener("change",this.handleColorSchemeChange),document.removeEventListener("visibilitychange",this.handleVisibilityEvent),clearInterval(this.wakeUpTicker)}static tnSetup(e,t,n,a,s,i){const r=new Tn.Tinode({appName:kn.C3,host:e,apiKey:kn.Lq,transport:n,secure:t,persist:s},i);return r.setHumanLanguage(a),r.enableLogging(kn.U3,!0),r}handlePushMessage(e){this.tinode.oobNotification(e.data||{})}initFCMessaging(){const{formatMessage:e,locale:t}=this.props.intl,n=(t,n)=>{console.error(t,n),this.handleError(e(As.push_init_failed),"err"),this.setState({firebaseToken:null}),Ss.A.updateObject("settings",{desktopAlerts:!1})};try{return this.fcm=wn(ze(FIREBASE_INIT,kn.C3)),navigator.serviceWorker.getRegistration("/service-worker.js").then(e=>e||navigator.serviceWorker.register("/service-worker.js").then(e=>(this.checkForAppUpdate(e),e))).then(e=>((e.active||e.installing).postMessage(JSON.stringify({locale:t,version:Es.i})),ks.requestFCMToken(this.fcm,e))).then(e=>{const t=Ss.A.getObject("keep-logged-in");e!=this.state.firebaseToken&&(this.tinode.setDeviceToken(e),t&&Ss.A.setObject("firebase-token",e)),this.setState({firebaseToken:e,desktopAlerts:!0}),t&&Ss.A.updateObject("settings",{desktopAlerts:!0}),_n(this.fcm,e=>{this.handlePushMessage(e)})}).catch(e=>{throw n(e),e})}catch(e){return n(e),Promise.reject(e)}}static requestFCMToken(e,t){return Sn(e,{serviceWorkerRegistration:t,vapidKey:FIREBASE_INIT.messagingVapidKey}).then(t=>{if(t)return t;if("undefined"!=typeof Notification)return Notification.requestPermission().then(t=>{if("granted"===t)return Sn(e,{serviceWorkerRegistration:reg,vapidKey:FIREBASE_INIT.messagingVapidKey}).then(e=>{if(e)return e;throw new Error("Failed to initialize notifications")});throw new Error("No permission to send notifications: "+t)});throw new Error("Notifications are not supported")})}handleResize(){const e=document.documentElement.clientWidth<=kn.VJ;this.setState({viewportWidth:document.documentElement.clientWidth,viewportHeight:document.documentElement.clientHeight}),this.state.displayMobile!=e&&this.setState({displayMobile:e})}checkForAppUpdate(e){e.onupdatefound=t=>{const n=e.installing;n.onstatechange=e=>{if("installed"==n.state&&navigator.serviceWorker.controller){const e=d().createElement(d().Fragment,null,d().createElement(c.FormattedMessage,{id:"update_available",defaultMessage:[{type:0,value:"Update available."}]})," ",d().createElement("a",{href:""},d().createElement(c.FormattedMessage,{id:"reload_update",defaultMessage:[{type:0,value:"Reload"}]})),".");this.handleError(e,"info")}}}}handleHashRoute(){const e=Na.A.parseUrlHash(window.location.hash),t={infoPanel:e.params.info,newTopicTabSelected:e.params.tab};if(e.path&&e.path.length>0){["acc_general","archive","blocked","contacts","cred","crop","edit","general","newtpk","notif","register","reset","security","settings","support","wallpapers",""].includes(e.path[0])?t.sidePanelSelected=e.path[0]:console.warn("Unknown sidepanel view",e.path[0]);let n=e.path[1]||null;n!=this.state.topicSelected&&(Tn.Tinode.topicType(n)?t.mobilePanel="topic-view":(n=null,t.mobilePanel="sidepanel"),Object.assign(t,{topicSelected:n,topicSelectedAcs:this.tinode.getTopicAccessMode(n)}))}else Object.assign(t,{sidePanelSelected:"",topicSelected:null});e.params.method&&(t.credMethod=e.params.method),e.params.code&&(t.credCode=e.params.code),e.params.token&&(t.credToken=e.params.token),e.params.cred_done&&Object.assign(t,ks.stateForError(this.props.intl.formatMessage(As.cred_confirmed_successfully),"info")),this.setState(t)}handleOnline(e){e?(this.handleError(),clearInterval(this.reconnectCountdown),this.tinode.reconnect()):this.handleError(this.props.intl.formatMessage(As.no_connection),"warn"),this.setState({liveConnection:e})}handleVisibilityEvent(){this.setState({applicationVisible:!document.hidden})}static stateForError(e,t,n,a){return{errorText:e,errorLevel:t,errorAction:n,errorActionText:a,callShouldStart:!1}}handleError(e,t,n,a){this.setState(ks.stateForError(e,t,n,a))}handleLoginRequest(e,t){this.setState({loginDisabled:!0,login:e,password:t,loadSpinnerVisible:!0,autoLogin:!0}),this.handleError("",null),this.tinode.isConnected()?this.doLogin(e,t,null,{meth:this.state.credMethod,resp:this.state.credCode}):this.tinode.connect().catch(e=>{this.setState({loginDisabled:!1,autoLogin:!1,loadSpinnerVisible:!1}),this.handleError(e.message,"err")}),this.state.desktopAlertsEnabled&&!this.state.firebaseToken&&this.initFCMessaging()}handlePersistenceChange(e){e?this.tinode.initStorage().then(e=>{Ss.A.setObject("keep-logged-in",!0),this.setState({persist:!0})}):this.tinode.clearStorage().then(e=>{Ss.A.setObject("keep-logged-in",!1),this.setState({persist:!1})})}handleConnected(){clearInterval(this.reconnectCountdown),this.handleError();const e=this.tinode.getServerInfo();this.setState({serverVersion:e.ver+" "+(e.build?e.build:"none"),reqCredMethod:((e.reqCred||{}).auth||[])[0]||"email"}),this.state.autoLogin&&this.doLogin(this.state.login,this.state.password,null,{meth:this.state.credMethod,resp:this.state.credCode})}handleAutoreconnectIteration(e,t){if(clearInterval(this.reconnectCountdown),e<0)return void this.handleError();if(t)return void t.then(e=>{this.handleError()}).catch(e=>{this.handleError(e.message,"err")});const{formatMessage:n}=this.props.intl;let a=e/1e3;a|=a,this.reconnectCountdown=setInterval(e=>{if(a<-10)return clearInterval(this.reconnectCountdown),void this.tinode.reconnect();const t=a>99?(0,jn.Ye)(a):a;this.handleError(n(As.reconnect_countdown,{seconds:t}),"warn",e=>{clearInterval(this.reconnectCountdown),this.tinode.reconnect()},n(As.reconnect_now)),a-=1},1e3)}handleDisconnect(e){this.setState({connected:!1,ready:!1,topicSelectedOnline:!1,errorText:e&&e.message?e.message:"Disconnected",errorLevel:e&&e.message?"err":"warn",loginDisabled:!1,contextMenuVisible:!1,forwardDialogVisible:!1,serverVersion:"no connection"})}doLogin(e,t,n,a){if(this.tinode.isAuthenticated())return void Na.A.navigateTo("");let s=n||(this.tinode.getAuthToken()||{}).token;if(!(e&&t||s))return Na.A.navigateTo(""),void this.setState({loginDisabled:!1});a=Tn.Tinode.credential(a);let i,r=this.tinode.isConnected()?Promise.resolve():this.tinode.connect();e&&t?(s=null,this.setState({password:null}),i=r.then(n=>this.tinode.loginBasic(e,t,a))):i=r.then(e=>this.tinode.loginToken(s,a)),i.then(e=>{e.code>=300&&"validate credentials"===e.text?(this.setState({loadSpinnerVisible:!1}),a&&this.handleError(this.props.intl.formatMessage(As.code_doesnot_match),"warn"),ks.navigateToCredentialsView(e.params)):this.handleLoginSuccessful()}).catch(e=>{const t=e.code>=500;this.setState({loginDisabled:!1,credMethod:void 0,credCode:void 0,loadSpinnerVisible:!1,autoLogin:t}),this.handleError(e.message,"err"),console.warn("Login failed",e),t||(s&&this.handleLogout(),Na.A.navigateTo(""))})}static navigateToCredentialsView(e){const t=Na.A.parseUrlHash(window.location.hash);t.path[0]="cred",t.params.method=e.cred[0],t.params.token=e.token,t.params.code=e.code,Na.A.navigateTo(Na.A.composeUrlHash(t.path,t.params))}handleLoginSuccessful(){this.handleError(),Ss.A.getObject("keep-logged-in")&&Ss.A.setObject("auth-token",this.tinode.getAuthToken());const e=this.state.requestedTopic,t=this.tinode.getMeTopic();t.onMetaDesc=this.tnMeMetaDesc,t.onContactUpdate=this.tnMeContactUpdate,t.onSubsUpdated=this.tnMeSubsUpdated,this.setState({connected:!0,credMethod:void 0,credCode:void 0,credToken:void 0,myUserId:this.tinode.getCurrentUserID(),autoLogin:!0,requestedTopic:void 0}),t.subscribe(t.startMetaQuery().withLaterSub().withDesc().withTags().withCred().build()).catch(e=>{this.tinode.disconnect(),localStorage.removeItem("auth-token"),this.handleError(e.message,"err"),Na.A.navigateTo("")}).finally(e=>{this.setState({loadSpinnerVisible:!1})});let n=Na.A.setUrlSidePanel(window.location.hash,"contacts");e&&(n=Na.A.setUrlTopic(n,e)),Na.A.navigateTo(n)}tnMeMetaDesc(e){if(e){if(e.public&&this.setState({sidePanelTitle:e.public.fn,sidePanelAvatar:(0,Un.to)(e.public.photo)}),e.trusted){const t=[];for(const[n,a]of Object.entries(e.trusted))a&&t.push(n);this.setState({myTrustedBadges:t})}e.acs&&this.setState({incognitoMode:!e.acs.isPresencer()}),ks.checkIfPinsUpdated(e,this.state.chatList)&&this.resetContactList()}}tnMeContactUpdate(e,t){if("on"==e||"off"==e)this.resetContactList(),this.state.topicSelected==t.topic&&this.setState({topicSelectedOnline:"on"==e});else if("read"==e)this.resetContactList();else if("msg"==e&&t){const e=this.tinode.getTopic(t.topic),n=e&&e.isArchived();t.unread>0&&this.state.messageSounds&&!n&&(document.hidden||this.state.topicSelected!=t.topic)&&Ts.play().catch(e=>{}),this.resetContactList()}else"recv"==e||("gone"==e||"unsub"==e?(this.state.topicSelected==t.topic&&this.handleTopicSelected(null),this.resetContactList()):"acs"==e?this.state.topicSelected==t.topic&&this.setState({topicSelectedAcs:t.acs}):"del"==e||"upd"==e||"call"==e||console.info("Unsupported (yet) presence update:",e,"in",(t||{}).topic))}tnMeSubsUpdated(e){this.resetContactList()}static prepareSearchableContacts(e,t){const n={};for(const t of e)Tn.Tinode.isP2PTopicName(t.topic)&&(n[t.topic]={user:t.topic,updated:t.updated,public:t.public,private:t.private,acs:t.acs});for(const e of t)n[e.user]||(n[e.user]=e);return Object.values(n)}resetContactList(){const e={chatList:[]};this.state.ready||(e.ready=!0);const t=this.tinode.getMeTopic();t.contacts(t=>{t.topic||t.user||(t.topic=t.name),e.chatList.push(t),this.state.topicSelected==t.topic&&(e.topicSelectedOnline=t.online,e.topicSelectedAcs=t.acs)});const n=new Date(0);e.chatList.sort((e,a)=>{const s=t.pinnedTopicRank(a.topic)-t.pinnedTopicRank(e.topic);return 0!=s?s:(a.touched||n).getTime()-(e.touched||n).getTime()}),e.searchableContacts=ks.prepareSearchableContacts(e.chatList,this.state.searchResults),this.setState(e)}static checkIfPinsUpdated(e,t){for(let n=0;n<t.length;n++){const a=t[n];if(!!e.pinnedTopicRank(a.topic)!=a.pinned)return!0}return!1}tnInitFind(){const e=this.tinode.getFndTopic();e.onSubsUpdated=this.tnFndSubsUpdated,e.isSubscribed()?this.tnFndSubsUpdated():e.subscribe(e.startMetaQuery().withSub().build()).catch(e=>{this.handleError(e.message,"err")})}tnFndSubsUpdated(){const e=[];this.tinode.getFndTopic().contacts(t=>{e.push(t)}),this.setState({searchResults:e,searchableContacts:ks.prepareSearchableContacts(this.state.chatList,e)})}handleSearchContacts(e){const t=this.tinode.getFndTopic();t.setMeta({desc:{public:e}}).then(e=>t.getMeta(t.startMetaQuery().withSub().build())).catch(e=>this.handleError(e.message,"err"))}handleTopicSelected(e){this.state.newTopicParams&&this.state.newTopicParams._topicName!=e&&this.setState({newTopicParams:null}),e?(this.setState({errorText:"",errorLevel:null,mobilePanel:"topic-view",infoPanel:void 0}),this.state.topicSelected!=e&&(this.setState({topicSelectedOnline:this.tinode.isTopicOnline(e),topicSelectedAcs:this.tinode.getTopicAccessMode(e),forwardMessage:null}),Na.A.navigateTo(Na.A.setUrlTopic("",e)))):(this.setState({topicSelected:null,errorText:"",errorLevel:null,mobilePanel:"sidepanel",topicSelectedOnline:!1,topicSelectedAcs:null,infoPanel:void 0,forwardMessage:null}),Na.A.navigateTo(Na.A.setUrlTopic("",null)))}handleHideMessagesView(){this.setState({mobilePanel:"sidepanel"}),Na.A.navigateTo(Na.A.setUrlTopic(window.location.hash,null))}handleSendMessage(e,t,n,a){const s=this.tinode.getTopic(this.state.topicSelected);return this.sendMessageToTopic(s,e,t,n,a)}sendMessageToTopic(e,t,n,a,s){(t=e.createMessage(t,!1))._uploader=a,s&&(t.head=Object.assign(t.head||{},s));const i=[];if(n&&i.push(n),!e.isSubscribed()){const n=e.subscribe().then(n=>{let a=[];e.queuedMessages(n=>{n._sending||n.seq==t.seq||(n.head&&n.head.webrtc?a.push(n.seq):e.isSubscribed()&&e.publishMessage(n))}),a.length>0&&e.delMessagesList(a,!0)});i.push(n)}return e.publishDraft(t,Promise.all(i)).then(t=>(e.isArchived()&&e.archive(!1),t)).catch(e=>this.handleError(e.message,"err"))}handleNewChatInvitation(e,t){const n=this.tinode.getTopic(e);let a=null;switch(t){case"accept":const s=n.getAccessMode().getGiven();a=n.setMeta({sub:{mode:s}}),n.isP2PType()&&(a=a.then(t=>n.setMeta({sub:{user:e,mode:s}})));break;case"delete":a=n.delTopic(!0);break;case"block":const i=n.getAccessMode().updateWant("-JP").getWant();a=n.setMeta({sub:{mode:i}}).then(e=>this.handleTopicSelected(null));break;default:console.warn("Unknown invitation action",'"'+t+'""')}null!=a&&a.catch(e=>this.handleError(e.message,"err"))}handleNewAccount(){this.handleError(),Na.A.navigateTo(Na.A.setUrlSidePanel(window.location.hash,"register"))}handleNewAccountRequest(e,t,n,a,s){this.handleError(),this.tinode.connect(this.state.serverAddress).then(i=>{let r;return n&&n.photo&&n.photo.ref&&(r=[n.photo.ref]),this.tinode.createAccountBasic(e,t,{public:n,tags:s,cred:Tn.Tinode.credential(a),attachments:r})}).then(e=>{e.code>=300&&"validate credentials"==e.text?ks.navigateToCredentialsView(e.params):this.handleLoginSuccessful(this)}).catch(e=>{this.handleError(e.message,"err")})}handleToggleIncognitoMode(e){this.setState({incognitoMode:null});const t=this.tinode.getMeTopic(),n=t.getAccessMode().updateWant(e?"-P":"+P").getWant();t.setMeta({sub:{mode:n}}).catch(t=>{this.setState({incognitoMode:!e}),this.handleError(t.message,"err")})}handleChangeColorSchema(e){this.setState({colorSchema:e}),Ss.A.updateObject("settings",{colorSchema:e}),document.documentElement.style.colorScheme="auto"==e?"light dark":e,this.applyColorSchema(e,this.state.systemColorSchema,this.state.wallpaperSize)}handleColorSchemeChange(e){const t=e.matches?"dark":"light";this.setState({systemColorSchema:t}),this.applyColorSchema(this.state.colorSchema,t,this.state.wallpaperSize)}applyColorSchema(e,t,n){const a="auto"==e?t:e;document.documentElement.style.setProperty("--wallpaper-invert","dark"==a&&n?"1":"0"),document.documentElement.style.setProperty("--wallpaper-brightness","dark"!=a||n?"1":"0.5")}handleSelectWallpapers(){this.handleError(),Na.A.navigateTo(Na.A.setUrlSidePanel(window.location.hash,"wallpapers"))}applyWallpaperSettings(e,t,n,a){document.documentElement.style.setProperty("--wallpaper-url",`url('${e}')`),document.documentElement.style.setProperty("--wallpaper-repeat",t?"repeat":"no-repeat"),document.documentElement.style.setProperty("--wallpaper-blur",t?"0px":`${n}px`),document.documentElement.style.setProperty("--wallpaper-size",t?`${t}px`:"cover"),document.documentElement.style.setProperty("--wallpaper-position",t?"unset":"center"),document.documentElement.style.setProperty("--wallpaper-invert","dark"==a&&t?"1":"0"),document.documentElement.style.setProperty("--wallpaper-brightness","dark"!=a||t?"1":"0.5")}handleWallpaperSelected(e,t,n){this.handleError(),Ss.A.updateObject("settings",{wallpaper:e,wallpaperSize:t,wallpaperBlur:n}),this.setState({wallpaper:e,wallpaperSize:t,wallpaperBlur:n}),this.applyWallpaperSettings(e,t,n,"auto"==this.state.colorSchema?this.state.systemColorSchema:this.state.colorSchema)}handleChangeTextSize(e){this.setState({textSize:0|e}),Ss.A.updateObject("settings",{textSize:e}),document.documentElement.style.setProperty("--message-text-size",`${e}pt`)}handleSendOnEnter(e){this.setState({sendOnEnter:e}),Ss.A.updateObject("settings",{sendOnEnter:e})}handleUpdateAccountTagsRequest(e,t){this.tinode.getMeTopic().setMeta({tags:t}).catch(e=>this.handleError(e.message,"err"))}handleSettings(){this.handleError(),Na.A.navigateTo(Na.A.setUrlSidePanel(window.location.hash,this.state.myUserId?"edit":"settings"))}handleGlobalSettings(e){const t=e.serverAddress||this.state.serverAddress,n=e.transport||this.state.transport,a=void 0===e.secureConnection?this.state.secureConnection:e.secureConnection;this.tinode&&(this.tinode.clearStorage(),this.tinode.onDisconnect=void 0,this.tinode.disconnect()),this.tinode=ks.tnSetup(t,a,n,this.props.intl.locale,Ss.A.getObject("keep-logged-in")),this.tinode.onConnect=this.handleConnected,this.tinode.onDisconnect=this.handleDisconnect,this.tinode.onAutoreconnectIteration=this.handleAutoreconnectIteration,this.tinode.onInfoMessage=this.handleInfoMessage,this.tinode.onDataMessage=this.handleDataMessage,this.setState({serverAddress:t,transport:n,secureConnection:a}),Ss.A.setObject("settings",{serverAddress:t,transport:n,secureConnection:a}),Na.A.navigateTo(Na.A.setUrlSidePanel(window.location.hash,""))}handleShowArchive(){Na.A.navigateTo(Na.A.setUrlSidePanel(window.location.hash,this.state.myUserId?"archive":""))}handleShowBlocked(){Na.A.navigateTo(Na.A.setUrlSidePanel(window.location.hash,this.state.myUserId?"blocked":""))}toggleFCMToken(e){e?(this.setState({desktopAlerts:null}),this.state.firebaseToken?(this.setState({desktopAlerts:!0}),Ss.A.getObject("keep-logged-in")&&Ss.A.updateObject("settings",{desktopAlerts:!0})):this.initFCMessaging()):this.state.firebaseToken&&this.fcm?Mn(this.fcm).catch(e=>{console.error("Unable to delete token.",e)}).finally(e=>{Ss.A.updateObject("settings",{desktopAlerts:!1}),localStorage.removeItem("firebase-token"),this.setState({desktopAlerts:!1,firebaseToken:null}),this.tinode.setDeviceToken(null)}):(this.setState({desktopAlerts:!1,firebaseToken:null}),Ss.A.updateObject("settings",{desktopAlerts:!1}))}handleToggleMessageSounds(e){this.setState({messageSounds:e}),Ss.A.updateObject("settings",{messageSoundsOff:!e})}handleCredAdd(e,t){this.tinode.getMeTopic().setMeta({cred:{meth:e,val:t}}).catch(e=>this.handleError(e.message,"err"))}handleCredDelete(e,t){this.tinode.getMeTopic().delCredential(e,t).catch(e=>this.handleError(e.message,"err"))}handleCredConfirm(e,t){ks.navigateToCredentialsView({cred:[e],code:t})}handleSidepanelCancel(){const e=Na.A.parseUrlHash(window.location.hash);let t="";["security","support","general","notif","acc_general"].includes(e.path[0])?t="edit":"crop"==e.path[0]?t="general":"blocked"==e.path[0]?t="security":"wallpapers"==e.path[0]?t="acc_general":this.state.myUserId&&(t="contacts"),e.path[0]=t,e.params&&(delete e.params.code,delete e.params.method,delete e.params.tab,delete e.params.scheme,delete e.params.token),Na.A.navigateTo(Na.A.composeUrlHash(e.path,e.params)),this.setState({errorText:"",errorLevel:null})}basicNavigator(e){Na.A.navigateTo(Na.A.setUrlSidePanel(window.location.hash,e))}infoNavigator(e){Na.A.navigateTo(Na.A.setUrlInfoPanel(window.location.hash,e))}handleStartTopicRequest(e,t,n){if(e&&this.tinode.isTopicCached(e))return void this.handleTopicSelected(e);const a={};Tn.Tinode.isP2PTopicName(e)?(a.sub={mode:kn.cZ},a.desc={defacs:{auth:kn.cZ}}):(e=e||this.tinode.newGroupTopicName(n),t&&(a.desc={public:t.public,private:{comment:t.private}},a.tags=t.tags)),a._topicName=e,this.setState({newTopicParams:a},t=>{this.handleTopicSelected(e)})}handleNewTopicCreated(e,t){let n={};this.state.callShouldStart&&(n={callState:3,callShouldStart:!1}),this.state.topicSelected==e&&e!=t&&(n.topicSelected=t),this.setState(n,e=>{Na.A.navigateTo(Na.A.setUrlTopic("",t))})}handleTopicUpdateRequest(e,t,n,a){this.handleError();const s=this.tinode.getTopic(e);if(s){const e={};let i;t&&(t.photo&&(t.photo.ref&&t.photo.ref!=Tn.Tinode.DEL_CHAR?i=[t.photo.ref]:t.photo.data&&t.photo.data!=Tn.Tinode.DEL_CHAR||(t.photo=Tn.Tinode.DEL_CHAR)),e.public=t),"string"==typeof n&&(e.private=n===Tn.Tinode.DEL_CHAR?Tn.Tinode.DEL_CHAR:{comment:n}),a&&(e.defacs=a),s.setMeta({desc:e,attachments:i}).catch(e=>this.handleError(e.message,"err"))}}handleUnarchive(e){const t=this.tinode.getTopic(e);t&&t.archive(!1).catch(e=>this.handleError(e.message,"err"))}handleUpdatePasswordRequest(e){this.handleError(),e&&this.tinode.updateAccountBasic(null,this.tinode.getCurrentLogin(),e).catch(e=>this.handleError(e.message,"err"))}handleChangePermissions(e,t,n){const a=this.tinode.getTopic(e);if(a){const e=a.getAccessMode();n?(e.updateGiven(t),t=e.getGiven()):(e.updateWant(t),t=e.getWant()),a.setMeta({sub:{user:n,mode:t}}).catch(e=>this.handleError(e.message,"err"))}}handleTagsUpdateRequest(e,t){const n=this.tinode.getTopic(e);n&&n.setMeta({tags:t}).catch(e=>this.handleError(e.message,"err"))}handleLogout(){let e;(0,Jn.OM)(0),localStorage.removeItem("auth-token"),localStorage.removeItem("firebase-token"),localStorage.removeItem("settings"),this.state.firebaseToken&&Mn(this.fcm),document.documentElement.style.colorScheme="auto"==kn.gb?"light dark":kn.gb,document.documentElement.style.setProperty("--message-text-size",`${kn.cL}pt`),clearInterval(this.reconnectCountdown),this.tinode?(e=this.tinode.clearStorage(),this.tinode.onDisconnect=void 0,this.tinode.disconnect()):e=Promose.resolve(),this.setState(this.getBlankState()),e.then(e=>{this.tinode=ks.tnSetup(this.state.serverAddress,ws(),this.state.transport,this.props.intl.locale,Ss.A.getObject("keep-logged-in"),e=>{this.tinode.onConnect=this.handleConnected,this.tinode.onDisconnect=this.handleDisconnect,this.tinode.onAutoreconnectIteration=this.handleAutoreconnectIteration,this.tinode.onInfoMessage=this.handleInfoMessage,this.tinode.onDataMessage=this.handleDataMessage,Na.A.navigateTo("")})})}handleDeleteAccount(){this.tinode.delCurrentUser(!0).then(e=>{this.handleLogout()})}handleDeleteTopicRequest(e){const t=this.tinode.getTopic(e);t&&t.delTopic(!0).then(e=>{Na.A.navigateTo(Na.A.setUrlTopic(window.location.hash,""))}).catch(e=>{this.handleError(e.message,"err")})}handleDeleteMessagesRequest(e){const t=this.tinode.getTopic(e);t&&t.delMessagesAll(!0).catch(e=>this.handleError(e.message,"err"))}handleLeaveUnsubRequest(e){const t=this.tinode.getTopic(e);t&&t.leave(!0).then(e=>{Na.A.navigateTo(Na.A.setUrlTopic(window.location.hash,""))}).catch(e=>{this.handleError(e.message,"err")})}handleBlockTopicRequest(e){const t=this.tinode.getTopic(e);t&&t.updateMode(null,"-JP").then(e=>{Na.A.navigateTo(Na.A.setUrlTopic(window.location.hash,""))}).catch(e=>this.handleError(e.message,"err"))}handleReportTopic(e){const t=this.tinode.getTopic(e);t&&(this.tinode.report("report",e),t.updateMode(null,"-JP").then(e=>{Na.A.navigateTo(Na.A.setUrlTopic(window.location.hash,""))}).catch(e=>this.handleError(e.message,"err")))}handleShowContextMenu(e,t){this.setState({contextMenuVisible:!0,contextMenuClickAt:{x:e.x,y:e.y},contextMenuParams:e,contextMenuItems:t||this.defaultTopicContextMenu(e.topicName),contextMenuBounds:this.selfRef.current.getBoundingClientRect()})}handleShowForwardDialog(e){"newtpk"==this.state.sidePanelSelected&&this.handleSidepanelCancel();const t="➦ "+e.userName,n="string"==typeof e.content?Tn.Drafty.init(e.content):Tn.Drafty.forwardedContent(e.content),a=Tn.Drafty.preview(n,kn.TR,!0),s=Tn.Drafty.append(Tn.Drafty.appendLineBreak(Tn.Drafty.mention(t,e.userFrom)),n),i=Tn.Drafty.quote(t,e.userFrom,a),r={forwarded:e.topicName+":"+e.seq};this.setState({forwardDialogVisible:!0,forwardMessage:{head:r,msg:s,preview:i}})}defaultTopicContextMenu(e){const t=this.tinode.getTopic(e);if(t._deleted)return["topic_delete"];const n=this.tinode.getMeTopic();let a=!1,s=!1,i=!1,r=!1,o=!1,d=!1,l=!1,c=!1,h=!1,p=!1,u=!1;if(t){r=t.isSubscribed(),d=t.isArchived(),l=n.pinnedTopicRank(e)>0;const c=t.getAccessMode();c&&(a=c.isMuted(),s=!c.isJoiner(),i=!c.isJoiner("want"),o=c.isDeleter(),h=c.isWriter())}return c=h&&!!this.tinode.getServerParam("iceServers"),p=Tn.Tinode.isP2PTopicName(e),u=Tn.Tinode.isSelfTopicName(e),[r?{title:this.props.intl.formatMessage(As.menu_item_info),handler:this.handleShowInfoView}:null,r&&p&&c?{title:this.props.intl.formatMessage(As.menu_item_audio_call),handler:this.handleStartAudioCall}:null,r&&p&&c?{title:this.props.intl.formatMessage(As.menu_item_video_call),handler:this.handleStartVideoCall}:null,r?"messages_clear":null,r&&o&&!u?"messages_clear_hard":null,u?null:a?s?null:"topic_unmute":"topic_mute",u?null:i?"topic_unblock":"topic_block",l?"topic_unpin":"topic_pin",d?"topic_restore":"topic_archive","topic_delete"]}handleHideContextMenu(){this.setState({contextMenuVisible:!1,contextMenuClickAt:null,contextMenuParams:null,contextMenuBounds:null})}handleHideForwardDialog(e){this.setState({forwardDialogVisible:!1,forwardMessage:e?this.state.forwardMessage:null})}handleContextMenuAction(e,t,n){"topic_archive"==e?t&&n.topicName&&n.topicName==this.state.topicSelected&&t.then(e=>{this.handleTopicSelected(null)}):"menu_item_forward"==e&&this.handleShowForwardDialog(n)}handleShowAlert(e,t,n,a,s,i){this.setState({alertVisible:!0,alertParams:{title:e,content:t,onConfirm:n,confirm:a,onReject:s,reject:i}})}handleShowInfoView(){Na.A.navigateTo(Na.A.addUrlParam(window.location.hash,"info","info")),this.setState({infoPanel:"info"})}handleMemberUpdateRequest(e,t,n){if(!e)return;const a=this.tinode.getTopic(e);a&&(t&&t.length>0&&t.forEach(e=>{a.invite(e,null).catch(e=>this.handleError(e.message,"err"))}),n&&n.length>0&&n.forEach(e=>{a.delSubscription(e).catch(e=>this.handleError(e.message,"err"))}))}handleValidateCredentialsRequest(e,t,n){this.tinode.isAuthenticated()?this.tinode.getMeTopic().setMeta({cred:{meth:e,resp:t}}).then(e=>Na.A.navigateTo(Na.A.setUrlSidePanel(window.location.hash,"contacts"))).catch(e=>this.handleError(e.message,"err")):(this.setState({credMethod:e,credCode:t,credToken:n}),this.doLogin(null,null,n,{meth:e,resp:t}))}handlePasswordResetRequest(e,t){return this.tinode.connect().then(n=>this.tinode.requestResetAuthSecret("basic",e,t)).catch(e=>{this.handleError(e.message,"err")})}handleResetPassword(e,t){const n=(0,Un.$Z)(t.secret);n&&t.scheme?this.tinode.connect().then(a=>this.tinode.updateAccountBasic(null,null,e,{scheme:t.scheme,secret:n})).then(e=>{this.handleError(this.props.intl.formatMessage(As.password_reset_success),"info"),Na.A.navigateTo("")}).catch(e=>{this.handleError(e.message,"err")}):this.handleError(this.props.intl.formatMessage(As.invalid_security_token),"err")}handleShowCountrySelector(e,t,n){this.handleShowAlert(this.props.intl.formatMessage(As.select_country),d().createElement(o.Suspense,{fallback:d().createElement("div",null,d().createElement(c.FormattedMessage,{id:"loading_note",defaultMessage:[{type:0,value:"Loading..."}]}))},d().createElement(Ms,{selected:e,onSubmit:(e,t)=>{this.setState({alertVisible:!1}),n(e,t)}})),null,null,e=>{},null)}handleStartVideoCall(){this.setState({callTopic:this.state.topicSelected,callState:1,callAudioOnly:!1})}handleStartAudioCall(){this.setState({callTopic:this.state.topicSelected,callState:1,callAudioOnly:!0})}handleCallInvite(e,t,n,a){switch(n){case 1:const n={webrtc:Ln,aonly:!!a};return this.handleSendMessage(Tn.Drafty.videoCall(a),void 0,void 0,n).then(e=>e.code<200||e.code>=300||!e.params||!e.params.seq?(this.handleCallClose(),e):(this.setState({callSeq:e.params.seq}),e));case 3:const s=this.tinode.getTopic(e);if(!s)return;s.videoCall("accept",t)}}handleCallRinging(e,t){const n=this.tinode.getTopic(e);n&&n.videoCall("ringing",t)}handleCallHangup(e,t){const n=this.tinode.getTopic(e);n&&n.videoCall("hang-up",t)}handleCallSendOffer(e,t,n){const a=this.tinode.getTopic(e);a&&a.videoCall("offer",t,n)}handleCallIceCandidate(e,t,n){const a=this.tinode.getTopic(e);a&&a.videoCall("ice-candidate",t,n)}handleCallSendAnswer(e,t,n){const a=this.tinode.getTopic(e);a&&a.videoCall("answer",t,n)}handleCallClose(){this.callTimeoutTimer&&clearTimeout(this.callTimeoutTimer),this.setState({callTopic:void 0,callState:0,callAudioOnly:void 0})}handleCallAccept(e,t,n){const a=this.tinode.getTopic(e);if(a)if(a.isSubscribed()){this.handleTopicSelected(t?e:this.state.callTopic);const a={callState:3};t&&(a.callTopic=e,a.callSeq=n),this.setState(a)}else this.setState({callShouldStart:!0},e=>this.handleTopicSelected(this.state.callTopic))}handleInfoMessage(e){if("call"==e.what)switch(e.event){case"accept":if(Tn.Tinode.isMeTopicName(e.topic)&&this.tinode.isMe(e.from))return void this.setState({callTopic:null,callState:0,callSeq:null,callAudioOnly:void 0});e.topic==this.state.callTopic&&this.setState({callState:3});break;case"hang-up":this.handleCallClose()}}handleDataMessage(e){if(e.head&&e.head.webrtc&&e.head.webrtc==Ln&&Tn.Tinode.isP2PTopicName(e.topic)){const t=this.tinode.getTopic(e.topic);if(t){const n=t.latestMsgVersion(e.seq)||e;n.head&&n.head.webrtc&&n.head.webrtc==Ln&&e.from!=this.state.myUserId&&(0==this.state.callState?this.setState({callTopic:e.topic,callState:2,callSeq:e.seq,callAudioOnly:!!n.head.aonly}):this.handleCallHangup(e.topic,e.seq))}else console.warn("Received vc data message from unknown topic",e.topic)}}render(){const e="auto"!==this.state.colorSchema?this.state.colorSchema:this.state.systemColorSchema;return d().createElement("div",{id:"app-container",ref:this.selfRef},this.state.contextMenuVisible?d().createElement(Dn,{tinode:this.tinode,bounds:this.state.contextMenuBounds,clickAt:this.state.contextMenuClickAt,params:this.state.contextMenuParams,items:this.state.contextMenuItems,hide:this.handleHideContextMenu,onShowAlert:this.handleShowAlert,onAction:this.handleContextMenuAction,onTopicRemoved:e=>{e==this.state.topicSelected&&this.handleTopicSelected(null)},onError:this.handleError}):null,this.state.forwardDialogVisible?d().createElement(Fn,{tinode:this.tinode,contacts:this.state.chatList,topicSelected:this.state.topicSelected,myUserId:this.state.myUserId,hide:this.handleHideForwardDialog,onInitFind:this.tnInitFind,searchResults:this.state.searchResults,onSearchContacts:this.handleSearchContacts,onTopicSelected:this.handleStartTopicRequest}):null,this.state.callTopic&&2==this.state.callState?d().createElement(zn,{tinode:this.tinode,topic:this.state.callTopic,seq:this.state.callSeq,callState:this.state.callState,audioOnly:this.state.callAudioOnly,onClose:this.handleCallClose,onRinging:this.handleCallRinging,onAcceptCall:this.handleCallAccept,onReject:this.handleCallHangup}):null,this.state.alertVisible?d().createElement(An,{title:this.state.alertParams.title,content:this.state.alertParams.content,onReject:this.state.alertParams.onReject?e=>this.setState({alertVisible:!1}):null,reject:this.state.alertParams.reject,onConfirm:this.state.alertParams.onConfirm?e=>{this.setState({alertVisible:!1}),this.state.alertParams.onConfirm()}:null,confirm:this.state.alertParams.confirm}):null,this.state.displayMobile&&"sidepanel"!=this.state.mobilePanel?null:d().createElement(ys,{tinode:this.tinode,connected:this.state.connected,displayMobile:this.state.displayMobile,state:this.state.sidePanelSelected,title:this.state.sidePanelTitle,avatar:this.state.sidePanelAvatar,trustedBadges:this.state.myTrustedBadges,login:this.state.login,persist:this.state.persist,myUserId:this.state.myUserId,loginDisabled:this.state.loginDisabled,loadSpinnerVisible:this.state.loadSpinnerVisible,errorText:this.state.errorText,errorLevel:this.state.errorLevel,errorAction:this.state.errorAction,errorActionText:this.state.errorActionText,topicSelected:this.state.topicSelected,chatList:this.state.chatList,credMethod:this.state.credMethod,credCode:this.state.credCode,credToken:this.state.credToken,transport:this.state.transport,messageSounds:this.state.messageSounds,desktopAlerts:this.state.desktopAlerts,desktopAlertsEnabled:this.state.desktopAlertsEnabled,incognitoMode:this.state.incognitoMode,serverAddress:this.state.serverAddress,secureConnection:this.state.secureConnection,serverVersion:this.state.serverVersion,reqCredMethod:this.state.reqCredMethod,textSize:this.state.textSize,colorSchema:this.state.colorSchema,wallpaper:this.state.wallpaper,wallpaperSize:this.state.wallpaperSize,wallpaperBlur:this.state.wallpaperBlur,systemColorSchema:this.state.systemColorSchema,sendOnEnter:this.state.sendOnEnter,onGlobalSettings:this.handleGlobalSettings,onSignUp:this.handleNewAccount,onSettings:this.handleSettings,onNavigate:this.basicNavigator,onLoginRequest:this.handleLoginRequest,onPersistenceChange:this.handlePersistenceChange,onCreateAccount:this.handleNewAccountRequest,onUpdateAccountDesc:this.handleTopicUpdateRequest,onUpdatePassword:this.handleUpdatePasswordRequest,onUpdateAccountTags:this.handleUpdateAccountTagsRequest,onTogglePushNotifications:this.toggleFCMToken,onToggleMessageSounds:this.handleToggleMessageSounds,onToggleIncognitoMode:this.handleToggleIncognitoMode,onChangeColorSchema:this.handleChangeColorSchema,onTextSizeChanged:this.handleChangeTextSize,onSendOnEnterChanged:this.handleSendOnEnter,onSelectWallpapers:this.handleSelectWallpapers,onWallpaperSelected:this.handleWallpaperSelected,onCredAdd:this.handleCredAdd,onCredDelete:this.handleCredDelete,onCredConfirm:this.handleCredConfirm,onTopicSelected:this.handleTopicSelected,onCreateTopic:this.handleStartTopicRequest,onLogout:this.handleLogout,onDeleteAccount:this.handleDeleteAccount,onShowAlert:this.handleShowAlert,onCancel:this.handleSidepanelCancel,onError:this.handleError,onValidateCredentials:this.handleValidateCredentialsRequest,onPasswordResetRequest:this.handlePasswordResetRequest,onResetPassword:this.handleResetPassword,onShowArchive:this.handleShowArchive,onShowBlocked:this.handleShowBlocked,onShowCountrySelector:this.handleShowCountrySelector,onInitFind:this.tnInitFind,searchResults:this.state.searchResults,onSearchContacts:this.handleSearchContacts,showContextMenu:this.handleShowContextMenu}),!this.state.displayMobile||"topic-view"==this.state.mobilePanel&&!this.state.infoPanel?d().createElement(xa,{tinode:this.tinode,connected:this.state.connected,ready:this.state.ready,online:this.state.topicSelectedOnline,acs:this.state.topicSelectedAcs,displayMobile:this.state.displayMobile,viewportWidth:this.state.viewportWidth,viewportHeight:this.state.viewportHeight,topic:this.state.topicSelected,myUserId:this.state.myUserId,myUserName:this.state.sidePanelTitle,serverVersion:this.state.serverVersion,serverAddress:this.state.serverAddress,applicationVisible:this.state.applicationVisible,colorSchema:e,sendOnEnter:this.state.sendOnEnter,wallpaper:this.state.wallpaper,forwardMessage:this.state.forwardMessage,onCancelForwardMessage:this.handleHideForwardDialog,callTopic:this.state.callTopic,callSeq:this.state.callSeq,callState:this.state.callState,callAudioOnly:this.state.callAudioOnly,onCallHangup:this.handleCallHangup,onAcceptCall:this.handleCallAccept,onCallInvite:this.handleCallInvite,onCallSendOffer:this.handleCallSendOffer,onCallIceCandidate:this.handleCallIceCandidate,onCallSendAnswer:this.handleCallSendAnswer,errorText:this.state.errorText,errorLevel:this.state.errorLevel,errorAction:this.state.errorAction,errorActionText:this.state.errorActionText,newTopicParams:this.state.newTopicParams,onHideMessagesView:this.handleHideMessagesView,onError:this.handleError,onNewTopicCreated:this.handleNewTopicCreated,showContextMenu:this.handleShowContextMenu,onChangePermissions:this.handleChangePermissions,onNewChat:this.handleNewChatInvitation,sendMessage:this.handleSendMessage,onVideoCallClosed:this.handleCallClose}):null,this.state.infoPanel?d().createElement(o.Suspense,{fallback:d().createElement("div",null,d().createElement(c.FormattedMessage,{id:"loading_note",defaultMessage:[{type:0,value:"Loading..."}]}))},d().createElement(_s,{tinode:this.tinode,connected:this.state.connected,displayMobile:this.state.displayMobile,topic:this.state.topicSelected,searchableContacts:this.state.searchableContacts,myUserId:this.state.myUserId,panel:this.state.infoPanel,errorText:this.state.errorText,errorLevel:this.state.errorLevel,errorAction:this.state.errorAction,errorActionText:this.state.errorActionText,onNavigate:this.infoNavigator,onTopicDescUpdateRequest:this.handleTopicUpdateRequest,onShowAlert:this.handleShowAlert,onChangePermissions:this.handleChangePermissions,onMemberUpdateRequest:this.handleMemberUpdateRequest,onDeleteTopic:this.handleDeleteTopicRequest,onDeleteMessages:this.handleDeleteMessagesRequest,onLeaveTopic:this.handleLeaveUnsubRequest,onBlockTopic:this.handleBlockTopicRequest,onReportTopic:this.handleReportTopic,onAddMember:this.handleManageGroupMembers,onTopicTagsUpdateRequest:this.handleTagsUpdateRequest,onTopicUnArchive:this.handleUnarchive,onInitFind:this.tnInitFind,onError:this.handleError,showContextMenu:this.handleShowContextMenu})):null)}}var Ns=(0,c.injectIntl)(ks);if("undefined"!=typeof FIREBASE_INIT&&FIREBASE_INIT&&FIREBASE_INIT.measurementId){const Us=document.getElementsByTagName("head")[0];let js=document.createElement("script");function Bs(){dataLayer.push(arguments)}js.src="https://www.googletagmanager.com/gtag/js?id="+FIREBASE_INIT.measurementId,js.async=!0,Us.prepend(js),window.dataLayer=window.dataLayer||[],Bs("js",new Date),Bs("config",FIREBASE_INIT.measurementId)}const Ps={ar:e=>r.e(143).then(r.t.bind(r,7143,19)),de:e=>r.e(175).then(r.t.bind(r,2175,19)),en:e=>r.e(399).then(r.t.bind(r,3399,19)),es:e=>r.e(64).then(r.t.bind(r,6064,19)),fr:e=>r.e(500).then(r.t.bind(r,2500,19)),it:e=>r.e(197).then(r.t.bind(r,7197,19)),ko:e=>r.e(186).then(r.t.bind(r,1186,19)),ro:e=>r.e(780).then(r.t.bind(r,8399,19)),ru:e=>r.e(553).then(r.t.bind(r,5553,19)),th:e=>r.e(536).then(r.t.bind(r,2536,19)),uk:e=>r.e(552).then(r.t.bind(r,4552,19)),zh:e=>r.e(570).then(r.t.bind(r,570,19)),"zh-TW":e=>r.e(744).then(r.t.bind(r,5744,19))},{params:Ds}=Na.A.parseUrlHash(window.location.hash),Is=Ds&&Ds.hl||navigator.languages&&navigator.languages[0]||navigator.language||navigator.userLanguage||"en",Rs=Is.replace("_","-"),Fs=Rs.split("-")[0].toLowerCase(),xs=Ps[Rs]?Is:Ps[Fs]?Fs:"en",Os=document.getElementsByTagName("html")[0];Os.setAttribute("lang",xs),["ar","fa","he","ur"].includes(Fs)&&Os.setAttribute("dir","rtl");const Ls=(0,l.H)(document.getElementById("mountPoint"));Ps[xs]().then(e=>Ls.render(d().createElement(c.IntlProvider,{locale:Is,messages:e,textComponent:d().Fragment},d().createElement(Ns,null))))}();
|
||
//# sourceMappingURL=index.prod.js.map
|