@connorpham/live-chat-widget 15.0.0 → 16.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -4049,10 +4049,12 @@ const xe = (u, D) => {
|
|
|
4049
4049
|
};
|
|
4050
4050
|
return /* @__PURE__ */ a.jsxs("div", { className: "staff-menu", ref: t, children: [
|
|
4051
4051
|
/* @__PURE__ */ a.jsx(
|
|
4052
|
-
"
|
|
4052
|
+
"div",
|
|
4053
4053
|
{
|
|
4054
4054
|
className: "staff-menu-toggle",
|
|
4055
|
-
onClick: () =>
|
|
4055
|
+
onClick: (F) => {
|
|
4056
|
+
F.preventDefault(), F.stopPropagation(), e(!f);
|
|
4057
|
+
},
|
|
4056
4058
|
children: /* @__PURE__ */ a.jsxs("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "currentColor", children: [
|
|
4057
4059
|
/* @__PURE__ */ a.jsx("circle", { cx: "12", cy: "6", r: "2" }),
|
|
4058
4060
|
/* @__PURE__ */ a.jsx("circle", { cx: "12", cy: "12", r: "2" }),
|
|
@@ -4060,7 +4062,7 @@ const xe = (u, D) => {
|
|
|
4060
4062
|
] })
|
|
4061
4063
|
}
|
|
4062
4064
|
),
|
|
4063
|
-
|
|
4065
|
+
/* @__PURE__ */ a.jsx("div", { className: `staff-menu-dropdown ${f ? "staff-menu-dropdown-open" : "staff-menu-dropdown-closed"}`, children: /* @__PURE__ */ a.jsx(
|
|
4064
4066
|
"button",
|
|
4065
4067
|
{
|
|
4066
4068
|
className: "staff-menu-item",
|
|
@@ -24,7 +24,7 @@ object-assign
|
|
|
24
24
|
|
|
25
25
|
Check the render method of \``+i+"`."}return""}}function P2(i){return""}var L1={};function I2(i){{var p=I1();if(!p){var A=typeof i=="string"?i:i.displayName||i.name;A&&(p=`
|
|
26
26
|
|
|
27
|
-
Check the top-level render call using <`+A+">.")}return p}}function M1(i,p){{if(!i._store||i._store.validated||i.key!=null)return;i._store.validated=!0;var A=I2(p);if(L1[A])return;L1[A]=!0;var M="";i&&i._owner&&i._owner!==Ef.current&&(M=" It was passed a child from "+h(i._owner.type)+"."),fD(i),_('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',A,M),fD(null)}}function z1(i,p){{if(typeof i!="object")return;if(Array.isArray(i))for(var A=0;A<i.length;A++){var M=i[A];bf(M)&&M1(M,p)}else if(bf(i))i._store&&(i._store.validated=!0);else if(i){var X=k(i);if(typeof X=="function"&&X!==i.entries)for(var K=X.call(i),$;!($=K.next()).done;)bf($.value)&&M1($.value,p)}}}function L2(i){{var p=i.type;if(p==null||typeof p=="string")return;var A;if(typeof p=="function")A=p.propTypes;else if(typeof p=="object"&&(p.$$typeof===d||p.$$typeof===j))A=p.propTypes;else return;if(A){var M=h(p);A2(A,i.props,"prop",M,i)}else if(p.PropTypes!==void 0&&!hf){hf=!0;var X=h(p);_("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",X||"Unknown")}typeof p.getDefaultProps=="function"&&!p.getDefaultProps.isReactClassApproved&&_("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function M2(i){{for(var p=Object.keys(i.props),A=0;A<p.length;A++){var M=p[A];if(M!=="children"&&M!=="key"){fD(i),_("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",M),fD(null);break}}i.ref!==null&&(fD(i),_("Invalid attribute `ref` supplied to `React.Fragment`."),fD(null))}}function U1(i,p,A,M,X,K){{var $=bu(i);if(!$){var Y="";(i===void 0||typeof i=="object"&&i!==null&&Object.keys(i).length===0)&&(Y+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var pu=P2();pu?Y+=pu:Y+=I1();var tu;i===null?tu="null":Array.isArray(i)?tu="array":i!==void 0&&i.$$typeof===t?(tu="<"+(h(i.type)||"Unknown")+" />",Y=" Did you accidentally export a JSX literal instead of a component?"):tu=typeof i,_("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",tu,Y)}var au=O2(i,p,A,X,K);if(au==null)return au;if($){var zu=p.children;if(zu!==void 0)if(M)if(Array.isArray(zu)){for(var eD=0;eD<zu.length;eD++)z1(zu[eD],i);Object.freeze&&Object.freeze(zu)}else _("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else z1(zu,i)}return i===u.Fragment?M2(au):L2(au),au}}function z2(i,p,A){return U1(i,p,A,!0)}function U2(i,p,A){return U1(i,p,A,!1)}var V2=U2,W2=z2;u.jsx=V2,u.jsxs=W2}()}(jD)),jD}var q1={};q1.NODE_ENV==="production"?kD.exports=W1():kD.exports=H1();var s=kD.exports;const _f=c.createContext(void 0),yf=({children:u,channelName:D})=>{const f=c.useRef(new BroadcastChannel(D)),e=c.useRef({});c.useEffect(()=>{const r=({data:a})=>{e.current[a.event].forEach(F=>F(a))};return f.current.addEventListener("message",r),()=>{f.current.removeEventListener("message",r),f.current.close()}},[]);const t=(r,a)=>{var F;return(F=e.current)[r]??(F[r]=[]),e.current[r].push(a),()=>{const o=e.current[r].indexOf(a);o!==-1&&e.current[r].splice(o,1)}},n=r=>{f.current.postMessage(r)};return s.jsx(_f.Provider,{value:{subscribe:t,postMessage:n},children:u})},Y1=()=>{const u=c.useContext(_f);if(!u)throw new Error("useBroadcastChannel must be used within a BroadcastChannelProvider");return u},$1=(...u)=>{const{subscribe:D}=Y1();c.useEffect(()=>{D(...u)},[D,...u])};var TD=(u=>(u.message="message",u.delivery="delivery",u.read="read",u.typing="typing",u.follow="follow",u.echo="echo",u.unknown="",u))(TD||{}),Z=(u=>(u.sent="sent",u.received="received",u))(Z||{}),vf=(u=>(u.text="text",u.location="location",u))(vf||{}),yu=(u=>(u.text="text",u.quick_reply="quick_reply",u.postback="postback",u.location="location",u.file="file",u.notify="notify",u))(yu||{}),ND=(u=>(u.text="text",u.buttons="buttons",u.quick_replies="quick_replies",u.file="file",u.list="list",u.carousel="carousel",u))(ND||{}),tD=(u=>(u[u.sent=0]="sent",u[u.sending=1]="sending",u[u.uploading=2]="uploading",u))(tD||{}),Qu=(u=>(u[u.disconnected=0]="disconnected",u[u.wantToConnect=1]="wantToConnect",u[u.tryingToConnect=2]="tryingToConnect",u[u.connected=3]="connected",u))(Qu||{}),nD={};const wf={apiUrl:nD.REACT_APP_WIDGET_API_URL||"http://localhost:4000",channel:nD.REACT_APP_WIDGET_CHANNEL||"console-channel",language:"en",maxUploadSize:nD.UPLOAD_MAX_SIZE_IN_BYTES??""?Number(nD.UPLOAD_MAX_SIZE_IN_BYTES):20*1024*1024,ownerId:nD.REACT_APP_WIDGET_OWNER_ID||"68342cec1e3cef0065f1b563"},Af=c.createContext(wf),xf=({children:u,...D})=>{const f=c.useRef({...wf,...D});return s.jsx(Af.Provider,{value:f.current,children:u})},Iu=()=>{const u=c.useContext(Af);if(!u)throw new Error("useConfig must be used within a ConfigProvider");return u},kf={en:{user_subscription:{get_started:"Start Chat",first_name:"First Name",last_name:"Last Name",phone:"Phone Number",email:"Email Address"},settings:{greeting:"Welcome !",placeholder:"Write something...",connection_lost:"Connection Lost",back:"Back"},messages:{get_started:"Start Chat",file_message:{browser_audio_unsupport:"Browser does not support the audio element.",browser_video_unsupport:"Browser does not support the video element.",download:"Download",unsupported_file_type:"This file type is not supported.",unsupported_file_size:"This file size is not supported."}}},fr:{user_subscription:{get_started:"Commencer",first_name:"Prénom",last_name:"Nom",phone:"Numéro de Téléphone",email:"Adresse Email"},settings:{greeting:"Bienvenue !",placeholder:"Écrivez quelque chose...",connection_lost:"Connexion perdue",back:"Retour"},messages:{get_started:"Démarrer",file_message:{browser_audio_unsupport:"Le navigateur ne prend pas en charge l'élément audio.",browser_video_unsupport:"Le navigateur ne prend pas en charge l'élément vidéo.",download:"Télécharger",unsupported_file_type:"Ce type de fichier n'est pas pris en charge.",unsupported_file_size:"Cette taille de fichier n'est pas prise en charge."}}}},Sf=c.createContext(void 0),jf=({children:u})=>{const f=Iu().language,e=r=>r in kf,[t,n]=c.useState(e(f)?f:"en");return s.jsx(Sf.Provider,{value:{translations:kf,language:t,setLanguage:n},children:u})},K1=()=>{const u=c.useContext(Sf);if(!u)throw new Error("useTranslationContext must be used within a TranslationProvider");return u},J1=(u,D)=>D.split(".").reduce((f,e)=>{if(typeof f=="object"&&f!==null)return f[e]},u),Su=()=>{const{translations:u,language:D}=K1();return{t:c.useCallback((e,t={})=>(J1(u[D],e)||e).replace(/{(\w+)}/g,(r,a)=>t[a]||`{${a}}`),[D,u])}};function G1(u,D){if(typeof D>"u")throw new Error("Value cannot be undefined");return sessionStorage.setItem(u,JSON.stringify(D)),!0}function X1(u){const D=sessionStorage.getItem(u);return D===null?null:JSON.parse(D)}const Tf={setItem:G1,getItem:X1},ju=Object.create(null);ju.open="0",ju.close="1",ju.ping="2",ju.pong="3",ju.message="4",ju.upgrade="5",ju.noop="6";const oD=Object.create(null);Object.keys(ju).forEach(u=>{oD[ju[u]]=u});const RD={type:"error",data:"parser error"},Nf=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",Rf=typeof ArrayBuffer=="function",Of=u=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(u):u&&u.buffer instanceof ArrayBuffer,OD=({type:u,data:D},f,e)=>Nf&&D instanceof Blob?f?e(D):Pf(D,e):Rf&&(D instanceof ArrayBuffer||Of(D))?f?e(D):Pf(new Blob([D]),e):e(ju[u]+(D||"")),Pf=(u,D)=>{const f=new FileReader;return f.onload=function(){const e=f.result.split(",")[1];D("b"+(e||""))},f.readAsDataURL(u)};function If(u){return u instanceof Uint8Array?u:u instanceof ArrayBuffer?new Uint8Array(u):new Uint8Array(u.buffer,u.byteOffset,u.byteLength)}let PD;function Z1(u,D){if(Nf&&u.data instanceof Blob)return u.data.arrayBuffer().then(If).then(D);if(Rf&&(u.data instanceof ArrayBuffer||Of(u.data)))return D(If(u.data));OD(u,!1,f=>{PD||(PD=new TextEncoder),D(PD.encode(f))})}const Lf="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",rD=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let u=0;u<Lf.length;u++)rD[Lf.charCodeAt(u)]=u;const Q1=u=>{let D=u.length*.75,f=u.length,e,t=0,n,r,a,F;u[u.length-1]==="="&&(D--,u[u.length-2]==="="&&D--);const o=new ArrayBuffer(D),d=new Uint8Array(o);for(e=0;e<f;e+=4)n=rD[u.charCodeAt(e)],r=rD[u.charCodeAt(e+1)],a=rD[u.charCodeAt(e+2)],F=rD[u.charCodeAt(e+3)],d[t++]=n<<2|r>>4,d[t++]=(r&15)<<4|a>>2,d[t++]=(a&3)<<6|F&63;return o},u0=typeof ArrayBuffer=="function",ID=(u,D)=>{if(typeof u!="string")return{type:"message",data:Mf(u,D)};const f=u.charAt(0);return f==="b"?{type:"message",data:D0(u.substring(1),D)}:oD[f]?u.length>1?{type:oD[f],data:u.substring(1)}:{type:oD[f]}:RD},D0=(u,D)=>{if(u0){const f=Q1(u);return Mf(f,D)}else return{base64:!0,data:u}},Mf=(u,D)=>{switch(D){case"blob":return u instanceof Blob?u:new Blob([u]);case"arraybuffer":default:return u instanceof ArrayBuffer?u:u.buffer}},zf="",f0=(u,D)=>{const f=u.length,e=new Array(f);let t=0;u.forEach((n,r)=>{OD(n,!1,a=>{e[r]=a,++t===f&&D(e.join(zf))})})},e0=(u,D)=>{const f=u.split(zf),e=[];for(let t=0;t<f.length;t++){const n=ID(f[t],D);if(e.push(n),n.type==="error")break}return e};function t0(){return new TransformStream({transform(u,D){Z1(u,f=>{const e=f.length;let t;if(e<126)t=new Uint8Array(1),new DataView(t.buffer).setUint8(0,e);else if(e<65536){t=new Uint8Array(3);const n=new DataView(t.buffer);n.setUint8(0,126),n.setUint16(1,e)}else{t=new Uint8Array(9);const n=new DataView(t.buffer);n.setUint8(0,127),n.setBigUint64(1,BigInt(e))}u.data&&typeof u.data!="string"&&(t[0]|=128),D.enqueue(t),D.enqueue(f)})}})}let LD;function dD(u){return u.reduce((D,f)=>D+f.length,0)}function CD(u,D){if(u[0].length===D)return u.shift();const f=new Uint8Array(D);let e=0;for(let t=0;t<D;t++)f[t]=u[0][e++],e===u[0].length&&(u.shift(),e=0);return u.length&&e<u[0].length&&(u[0]=u[0].slice(e)),f}function n0(u,D){LD||(LD=new TextDecoder);const f=[];let e=0,t=-1,n=!1;return new TransformStream({transform(r,a){for(f.push(r);;){if(e===0){if(dD(f)<1)break;const F=CD(f,1);n=(F[0]&128)===128,t=F[0]&127,t<126?e=3:t===126?e=1:e=2}else if(e===1){if(dD(f)<2)break;const F=CD(f,2);t=new DataView(F.buffer,F.byteOffset,F.length).getUint16(0),e=3}else if(e===2){if(dD(f)<8)break;const F=CD(f,8),o=new DataView(F.buffer,F.byteOffset,F.length),d=o.getUint32(0);if(d>Math.pow(2,21)-1){a.enqueue(RD);break}t=d*Math.pow(2,32)+o.getUint32(4),e=3}else{if(dD(f)<t)break;const F=CD(f,t);a.enqueue(ID(n?F:LD.decode(F),D)),e=0}if(t===0||t>u){a.enqueue(RD);break}}}})}const Uf=4;function nu(u){if(u)return r0(u)}function r0(u){for(var D in nu.prototype)u[D]=nu.prototype[D];return u}nu.prototype.on=nu.prototype.addEventListener=function(u,D){return this._callbacks=this._callbacks||{},(this._callbacks["$"+u]=this._callbacks["$"+u]||[]).push(D),this},nu.prototype.once=function(u,D){function f(){this.off(u,f),D.apply(this,arguments)}return f.fn=D,this.on(u,f),this},nu.prototype.off=nu.prototype.removeListener=nu.prototype.removeAllListeners=nu.prototype.removeEventListener=function(u,D){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var f=this._callbacks["$"+u];if(!f)return this;if(arguments.length==1)return delete this._callbacks["$"+u],this;for(var e,t=0;t<f.length;t++)if(e=f[t],e===D||e.fn===D){f.splice(t,1);break}return f.length===0&&delete this._callbacks["$"+u],this},nu.prototype.emit=function(u){this._callbacks=this._callbacks||{};for(var D=new Array(arguments.length-1),f=this._callbacks["$"+u],e=1;e<arguments.length;e++)D[e-1]=arguments[e];if(f){f=f.slice(0);for(var e=0,t=f.length;e<t;++e)f[e].apply(this,D)}return this},nu.prototype.emitReserved=nu.prototype.emit,nu.prototype.listeners=function(u){return this._callbacks=this._callbacks||{},this._callbacks["$"+u]||[]},nu.prototype.hasListeners=function(u){return!!this.listeners(u).length};const cD=typeof Promise=="function"&&typeof Promise.resolve=="function"?D=>Promise.resolve().then(D):(D,f)=>f(D,0),vu=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),s0="arraybuffer";function u8(){}function Vf(u,...D){return D.reduce((f,e)=>(u.hasOwnProperty(e)&&(f[e]=u[e]),f),{})}const a0=vu.setTimeout,F0=vu.clearTimeout;function lD(u,D){D.useNativeTimers?(u.setTimeoutFn=a0.bind(vu),u.clearTimeoutFn=F0.bind(vu)):(u.setTimeoutFn=vu.setTimeout.bind(vu),u.clearTimeoutFn=vu.clearTimeout.bind(vu))}const i0=1.33;function o0(u){return typeof u=="string"?d0(u):Math.ceil((u.byteLength||u.size)*i0)}function d0(u){let D=0,f=0;for(let e=0,t=u.length;e<t;e++)D=u.charCodeAt(e),D<128?f+=1:D<2048?f+=2:D<55296||D>=57344?f+=3:(e++,f+=4);return f}function Wf(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function C0(u){let D="";for(let f in u)u.hasOwnProperty(f)&&(D.length&&(D+="&"),D+=encodeURIComponent(f)+"="+encodeURIComponent(u[f]));return D}function c0(u){let D={},f=u.split("&");for(let e=0,t=f.length;e<t;e++){let n=f[e].split("=");D[decodeURIComponent(n[0])]=decodeURIComponent(n[1])}return D}class l0 extends Error{constructor(D,f,e){super(D),this.description=f,this.context=e,this.type="TransportError"}}class MD extends nu{constructor(D){super(),this.writable=!1,lD(this,D),this.opts=D,this.query=D.query,this.socket=D.socket,this.supportsBinary=!D.forceBase64}onError(D,f,e){return super.emitReserved("error",new l0(D,f,e)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(D){this.readyState==="open"&&this.write(D)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(D){const f=ID(D,this.socket.binaryType);this.onPacket(f)}onPacket(D){super.emitReserved("packet",D)}onClose(D){this.readyState="closed",super.emitReserved("close",D)}pause(D){}createUri(D,f={}){return D+"://"+this._hostname()+this._port()+this.opts.path+this._query(f)}_hostname(){const D=this.opts.hostname;return D.indexOf(":")===-1?D:"["+D+"]"}_port(){return this.opts.port&&(this.opts.secure&&+(this.opts.port!==443)||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(D){const f=C0(D);return f.length?"?"+f:""}}class E0 extends MD{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(D){this.readyState="pausing";const f=()=>{this.readyState="paused",D()};if(this._polling||!this.writable){let e=0;this._polling&&(e++,this.once("pollComplete",function(){--e||f()})),this.writable||(e++,this.once("drain",function(){--e||f()}))}else f()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(D){const f=e=>{if(this.readyState==="opening"&&e.type==="open"&&this.onOpen(),e.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(e)};e0(D,this.socket.binaryType).forEach(f),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const D=()=>{this.write([{type:"close"}])};this.readyState==="open"?D():this.once("open",D)}write(D){this.writable=!1,f0(D,f=>{this.doWrite(f,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const D=this.opts.secure?"https":"http",f=this.query||{};return this.opts.timestampRequests!==!1&&(f[this.opts.timestampParam]=Wf()),!this.supportsBinary&&!f.sid&&(f.b64=1),this.createUri(D,f)}}let Hf=!1;try{Hf=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const h0=Hf;function b0(){}class p0 extends E0{constructor(D){if(super(D),typeof location<"u"){const f=location.protocol==="https:";let e=location.port;e||(e=f?"443":"80"),this.xd=typeof location<"u"&&D.hostname!==location.hostname||e!==D.port}}doWrite(D,f){const e=this.request({method:"POST",data:D});e.on("success",f),e.on("error",(t,n)=>{this.onError("xhr post error",t,n)})}doPoll(){const D=this.request();D.on("data",this.onData.bind(this)),D.on("error",(f,e)=>{this.onError("xhr poll error",f,e)}),this.pollXhr=D}}class Tu extends nu{constructor(D,f,e){super(),this.createRequest=D,lD(this,e),this._opts=e,this._method=e.method||"GET",this._uri=f,this._data=e.data!==void 0?e.data:null,this._create()}_create(){var D;const f=Vf(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");f.xdomain=!!this._opts.xd;const e=this._xhr=this.createRequest(f);try{e.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){e.setDisableHeaderCheck&&e.setDisableHeaderCheck(!0);for(let t in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(t)&&e.setRequestHeader(t,this._opts.extraHeaders[t])}}catch{}if(this._method==="POST")try{e.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{e.setRequestHeader("Accept","*/*")}catch{}(D=this._opts.cookieJar)===null||D===void 0||D.addCookies(e),"withCredentials"in e&&(e.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(e.timeout=this._opts.requestTimeout),e.onreadystatechange=()=>{var t;e.readyState===3&&((t=this._opts.cookieJar)===null||t===void 0||t.parseCookies(e.getResponseHeader("set-cookie"))),e.readyState===4&&(e.status===200||e.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof e.status=="number"?e.status:0)},0))},e.send(this._data)}catch(t){this.setTimeoutFn(()=>{this._onError(t)},0);return}typeof document<"u"&&(this._index=Tu.requestsCount++,Tu.requests[this._index]=this)}_onError(D){this.emitReserved("error",D,this._xhr),this._cleanup(!0)}_cleanup(D){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=b0,D)try{this._xhr.abort()}catch{}typeof document<"u"&&delete Tu.requests[this._index],this._xhr=null}}_onLoad(){const D=this._xhr.responseText;D!==null&&(this.emitReserved("data",D),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}if(Tu.requestsCount=0,Tu.requests={},typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",qf);else if(typeof addEventListener=="function"){const u="onpagehide"in vu?"pagehide":"unload";addEventListener(u,qf,!1)}}function qf(){for(let u in Tu.requests)Tu.requests.hasOwnProperty(u)&&Tu.requests[u].abort()}const B0=function(){const u=Yf({xdomain:!1});return u&&u.responseType!==null}();class g0 extends p0{constructor(D){super(D);const f=D&&D.forceBase64;this.supportsBinary=B0&&!f}request(D={}){return Object.assign(D,{xd:this.xd},this.opts),new Tu(Yf,this.uri(),D)}}function Yf(u){const D=u.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!D||h0))return new XMLHttpRequest}catch{}if(!D)try{return new vu[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const $f=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class m0 extends MD{get name(){return"websocket"}doOpen(){const D=this.uri(),f=this.opts.protocols,e=$f?{}:Vf(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(e.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(D,f,e)}catch(t){return this.emitReserved("error",t)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=D=>this.onClose({description:"websocket connection closed",context:D}),this.ws.onmessage=D=>this.onData(D.data),this.ws.onerror=D=>this.onError("websocket error",D)}write(D){this.writable=!1;for(let f=0;f<D.length;f++){const e=D[f],t=f===D.length-1;OD(e,this.supportsBinary,n=>{try{this.doWrite(e,n)}catch{}t&&cD(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const D=this.opts.secure?"wss":"ws",f=this.query||{};return this.opts.timestampRequests&&(f[this.opts.timestampParam]=Wf()),this.supportsBinary||(f.b64=1),this.createUri(D,f)}}const zD=vu.WebSocket||vu.MozWebSocket;class _0 extends m0{createSocket(D,f,e){return $f?new zD(D,f,e):f?new zD(D,f):new zD(D)}doWrite(D,f){this.ws.send(f)}}class y0 extends MD{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(D){return this.emitReserved("error",D)}this._transport.closed.then(()=>{this.onClose()}).catch(D=>{this.onError("webtransport error",D)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(D=>{const f=n0(Number.MAX_SAFE_INTEGER,this.socket.binaryType),e=D.readable.pipeThrough(f).getReader(),t=t0();t.readable.pipeTo(D.writable),this._writer=t.writable.getWriter();const n=()=>{e.read().then(({done:a,value:F})=>{a||(this.onPacket(F),n())}).catch(a=>{})};n();const r={type:"open"};this.query.sid&&(r.data=`{"sid":"${this.query.sid}"}`),this._writer.write(r).then(()=>this.onOpen())})})}write(D){this.writable=!1;for(let f=0;f<D.length;f++){const e=D[f],t=f===D.length-1;this._writer.write(e).then(()=>{t&&cD(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var D;(D=this._transport)===null||D===void 0||D.close()}}const v0={websocket:_0,webtransport:y0,polling:g0},w0=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,A0=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function UD(u){if(u.length>8e3)throw"URI too long";const D=u,f=u.indexOf("["),e=u.indexOf("]");f!=-1&&e!=-1&&(u=u.substring(0,f)+u.substring(f,e).replace(/:/g,";")+u.substring(e,u.length));let t=w0.exec(u||""),n={},r=14;for(;r--;)n[A0[r]]=t[r]||"";return f!=-1&&e!=-1&&(n.source=D,n.host=n.host.substring(1,n.host.length-1).replace(/;/g,":"),n.authority=n.authority.replace("[","").replace("]","").replace(/;/g,":"),n.ipv6uri=!0),n.pathNames=x0(n,n.path),n.queryKey=k0(n,n.query),n}function x0(u,D){const f=/\/{2,9}/g,e=D.replace(f,"/").split("/");return(D.slice(0,1)=="/"||D.length===0)&&e.splice(0,1),D.slice(-1)=="/"&&e.splice(e.length-1,1),e}function k0(u,D){const f={};return D.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(e,t,n){t&&(f[t]=n)}),f}const VD=typeof addEventListener=="function"&&typeof removeEventListener=="function",ED=[];VD&&addEventListener("offline",()=>{ED.forEach(u=>u())},!1);class Vu extends nu{constructor(D,f){if(super(),this.binaryType=s0,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,D&&typeof D=="object"&&(f=D,D=null),D){const e=UD(D);f.hostname=e.host,f.secure=e.protocol==="https"||e.protocol==="wss",f.port=e.port,e.query&&(f.query=e.query)}else f.host&&(f.hostname=UD(f.host).host);lD(this,f),this.secure=f.secure!=null?f.secure:typeof location<"u"&&location.protocol==="https:",f.hostname&&!f.port&&(f.port=this.secure?"443":"80"),this.hostname=f.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=f.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},f.transports.forEach(e=>{const t=e.prototype.name;this.transports.push(t),this._transportsByName[t]=e}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},f),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=c0(this.opts.query)),VD&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},ED.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(D){const f=Object.assign({},this.opts.query);f.EIO=Uf,f.transport=D,this.id&&(f.sid=this.id);const e=Object.assign({},this.opts,{query:f,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[D]);return new this._transportsByName[D](e)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const D=this.opts.rememberUpgrade&&Vu.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const f=this.createTransport(D);f.open(),this.setTransport(f)}setTransport(D){this.transport&&this.transport.removeAllListeners(),this.transport=D,D.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",f=>this._onClose("transport close",f))}onOpen(){this.readyState="open",Vu.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(D){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",D),this.emitReserved("heartbeat"),D.type){case"open":this.onHandshake(JSON.parse(D.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const f=new Error("server error");f.code=D.data,this._onError(f);break;case"message":this.emitReserved("data",D.data),this.emitReserved("message",D.data);break}}onHandshake(D){this.emitReserved("handshake",D),this.id=D.sid,this.transport.query.sid=D.sid,this._pingInterval=D.pingInterval,this._pingTimeout=D.pingTimeout,this._maxPayload=D.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const D=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+D,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},D),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const D=this._getWritablePackets();this.transport.send(D),this._prevBufferLen=D.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let f=1;for(let e=0;e<this.writeBuffer.length;e++){const t=this.writeBuffer[e].data;if(t&&(f+=o0(t)),e>0&&f>this._maxPayload)return this.writeBuffer.slice(0,e);f+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const D=Date.now()>this._pingTimeoutTime;return D&&(this._pingTimeoutTime=0,cD(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),D}write(D,f,e){return this._sendPacket("message",D,f,e),this}send(D,f,e){return this._sendPacket("message",D,f,e),this}_sendPacket(D,f,e,t){if(typeof f=="function"&&(t=f,f=void 0),typeof e=="function"&&(t=e,e=null),this.readyState==="closing"||this.readyState==="closed")return;e=e||{},e.compress=e.compress!==!1;const n={type:D,data:f,options:e};this.emitReserved("packetCreate",n),this.writeBuffer.push(n),t&&this.once("flush",t),this.flush()}close(){const D=()=>{this._onClose("forced close"),this.transport.close()},f=()=>{this.off("upgrade",f),this.off("upgradeError",f),D()},e=()=>{this.once("upgrade",f),this.once("upgradeError",f)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?e():D()}):this.upgrading?e():D()),this}_onError(D){if(Vu.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",D),this._onClose("transport error",D)}_onClose(D,f){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),VD&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const e=ED.indexOf(this._offlineEventListener);e!==-1&&ED.splice(e,1)}this.readyState="closed",this.id=null,this.emitReserved("close",D,f),this.writeBuffer=[],this._prevBufferLen=0}}}Vu.protocol=Uf;class S0 extends Vu{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let D=0;D<this._upgrades.length;D++)this._probe(this._upgrades[D])}_probe(D){let f=this.createTransport(D),e=!1;Vu.priorWebsocketSuccess=!1;const t=()=>{e||(f.send([{type:"ping",data:"probe"}]),f.once("packet",l=>{if(!e)if(l.type==="pong"&&l.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",f),!f)return;Vu.priorWebsocketSuccess=f.name==="websocket",this.transport.pause(()=>{e||this.readyState!=="closed"&&(d(),this.setTransport(f),f.send([{type:"upgrade"}]),this.emitReserved("upgrade",f),f=null,this.upgrading=!1,this.flush())})}else{const E=new Error("probe error");E.transport=f.name,this.emitReserved("upgradeError",E)}}))};function n(){e||(e=!0,d(),f.close(),f=null)}const r=l=>{const E=new Error("probe error: "+l);E.transport=f.name,n(),this.emitReserved("upgradeError",E)};function a(){r("transport closed")}function F(){r("socket closed")}function o(l){f&&l.name!==f.name&&n()}const d=()=>{f.removeListener("open",t),f.removeListener("error",r),f.removeListener("close",a),this.off("close",F),this.off("upgrading",o)};f.once("open",t),f.once("error",r),f.once("close",a),this.once("close",F),this.once("upgrading",o),this._upgrades.indexOf("webtransport")!==-1&&D!=="webtransport"?this.setTimeoutFn(()=>{e||f.open()},200):f.open()}onHandshake(D){this._upgrades=this._filterUpgrades(D.upgrades),super.onHandshake(D)}_filterUpgrades(D){const f=[];for(let e=0;e<D.length;e++)~this.transports.indexOf(D[e])&&f.push(D[e]);return f}}let j0=class extends S0{constructor(D,f={}){const e=typeof D=="object"?D:f;(!e.transports||e.transports&&typeof e.transports[0]=="string")&&(e.transports=(e.transports||["polling","websocket","webtransport"]).map(t=>v0[t]).filter(t=>!!t)),super(D,e)}};function T0(u,D="",f){let e=u;f=f||typeof location<"u"&&location,u==null&&(u=f.protocol+"//"+f.host),typeof u=="string"&&(u.charAt(0)==="/"&&(u.charAt(1)==="/"?u=f.protocol+u:u=f.host+u),/^(https?|wss?):\/\//.test(u)||(typeof f<"u"?u=f.protocol+"//"+u:u="https://"+u),e=UD(u)),e.port||(/^(http|ws)$/.test(e.protocol)?e.port="80":/^(http|ws)s$/.test(e.protocol)&&(e.port="443")),e.path=e.path||"/";const n=e.host.indexOf(":")!==-1?"["+e.host+"]":e.host;return e.id=e.protocol+"://"+n+":"+e.port+D,e.href=e.protocol+"://"+n+(f&&f.port===e.port?"":":"+e.port),e}const N0=typeof ArrayBuffer=="function",R0=u=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(u):u.buffer instanceof ArrayBuffer,Kf=Object.prototype.toString,O0=typeof Blob=="function"||typeof Blob<"u"&&Kf.call(Blob)==="[object BlobConstructor]",P0=typeof File=="function"||typeof File<"u"&&Kf.call(File)==="[object FileConstructor]";function WD(u){return N0&&(u instanceof ArrayBuffer||R0(u))||O0&&u instanceof Blob||P0&&u instanceof File}function hD(u,D){if(!u||typeof u!="object")return!1;if(Array.isArray(u)){for(let f=0,e=u.length;f<e;f++)if(hD(u[f]))return!0;return!1}if(WD(u))return!0;if(u.toJSON&&typeof u.toJSON=="function"&&arguments.length===1)return hD(u.toJSON(),!0);for(const f in u)if(Object.prototype.hasOwnProperty.call(u,f)&&hD(u[f]))return!0;return!1}function I0(u){const D=[],f=u.data,e=u;return e.data=HD(f,D),e.attachments=D.length,{packet:e,buffers:D}}function HD(u,D){if(!u)return u;if(WD(u)){const f={_placeholder:!0,num:D.length};return D.push(u),f}else if(Array.isArray(u)){const f=new Array(u.length);for(let e=0;e<u.length;e++)f[e]=HD(u[e],D);return f}else if(typeof u=="object"&&!(u instanceof Date)){const f={};for(const e in u)Object.prototype.hasOwnProperty.call(u,e)&&(f[e]=HD(u[e],D));return f}return u}function L0(u,D){return u.data=qD(u.data,D),delete u.attachments,u}function qD(u,D){if(!u)return u;if(u&&u._placeholder===!0){if(typeof u.num=="number"&&u.num>=0&&u.num<D.length)return D[u.num];throw new Error("illegal attachments")}else if(Array.isArray(u))for(let f=0;f<u.length;f++)u[f]=qD(u[f],D);else if(typeof u=="object")for(const f in u)Object.prototype.hasOwnProperty.call(u,f)&&(u[f]=qD(u[f],D));return u}const M0=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],z0=5;var H;(function(u){u[u.CONNECT=0]="CONNECT",u[u.DISCONNECT=1]="DISCONNECT",u[u.EVENT=2]="EVENT",u[u.ACK=3]="ACK",u[u.CONNECT_ERROR=4]="CONNECT_ERROR",u[u.BINARY_EVENT=5]="BINARY_EVENT",u[u.BINARY_ACK=6]="BINARY_ACK"})(H||(H={}));class U0{constructor(D){this.replacer=D}encode(D){return(D.type===H.EVENT||D.type===H.ACK)&&hD(D)?this.encodeAsBinary({type:D.type===H.EVENT?H.BINARY_EVENT:H.BINARY_ACK,nsp:D.nsp,data:D.data,id:D.id}):[this.encodeAsString(D)]}encodeAsString(D){let f=""+D.type;return(D.type===H.BINARY_EVENT||D.type===H.BINARY_ACK)&&(f+=D.attachments+"-"),D.nsp&&D.nsp!=="/"&&(f+=D.nsp+","),D.id!=null&&(f+=D.id),D.data!=null&&(f+=JSON.stringify(D.data,this.replacer)),f}encodeAsBinary(D){const f=I0(D),e=this.encodeAsString(f.packet),t=f.buffers;return t.unshift(e),t}}function Jf(u){return Object.prototype.toString.call(u)==="[object Object]"}class YD extends nu{constructor(D){super(),this.reviver=D}add(D){let f;if(typeof D=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");f=this.decodeString(D);const e=f.type===H.BINARY_EVENT;e||f.type===H.BINARY_ACK?(f.type=e?H.EVENT:H.ACK,this.reconstructor=new V0(f),f.attachments===0&&super.emitReserved("decoded",f)):super.emitReserved("decoded",f)}else if(WD(D)||D.base64)if(this.reconstructor)f=this.reconstructor.takeBinaryData(D),f&&(this.reconstructor=null,super.emitReserved("decoded",f));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+D)}decodeString(D){let f=0;const e={type:Number(D.charAt(0))};if(H[e.type]===void 0)throw new Error("unknown packet type "+e.type);if(e.type===H.BINARY_EVENT||e.type===H.BINARY_ACK){const n=f+1;for(;D.charAt(++f)!=="-"&&f!=D.length;);const r=D.substring(n,f);if(r!=Number(r)||D.charAt(f)!=="-")throw new Error("Illegal attachments");e.attachments=Number(r)}if(D.charAt(f+1)==="/"){const n=f+1;for(;++f&&!(D.charAt(f)===","||f===D.length););e.nsp=D.substring(n,f)}else e.nsp="/";const t=D.charAt(f+1);if(t!==""&&Number(t)==t){const n=f+1;for(;++f;){const r=D.charAt(f);if(r==null||Number(r)!=r){--f;break}if(f===D.length)break}e.id=Number(D.substring(n,f+1))}if(D.charAt(++f)){const n=this.tryParse(D.substr(f));if(YD.isPayloadValid(e.type,n))e.data=n;else throw new Error("invalid payload")}return e}tryParse(D){try{return JSON.parse(D,this.reviver)}catch{return!1}}static isPayloadValid(D,f){switch(D){case H.CONNECT:return Jf(f);case H.DISCONNECT:return f===void 0;case H.CONNECT_ERROR:return typeof f=="string"||Jf(f);case H.EVENT:case H.BINARY_EVENT:return Array.isArray(f)&&(typeof f[0]=="number"||typeof f[0]=="string"&&M0.indexOf(f[0])===-1);case H.ACK:case H.BINARY_ACK:return Array.isArray(f)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class V0{constructor(D){this.packet=D,this.buffers=[],this.reconPack=D}takeBinaryData(D){if(this.buffers.push(D),this.buffers.length===this.reconPack.attachments){const f=L0(this.reconPack,this.buffers);return this.finishedReconstruction(),f}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const W0=Object.freeze(Object.defineProperty({__proto__:null,Decoder:YD,Encoder:U0,get PacketType(){return H},protocol:z0},Symbol.toStringTag,{value:"Module"}));function xu(u,D,f){return u.on(D,f),function(){u.off(D,f)}}const H0=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class Gf extends nu{constructor(D,f,e){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=D,this.nsp=f,e&&e.auth&&(this.auth=e.auth),this._opts=Object.assign({},e),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const D=this.io;this.subs=[xu(D,"open",this.onopen.bind(this)),xu(D,"packet",this.onpacket.bind(this)),xu(D,"error",this.onerror.bind(this)),xu(D,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...D){return D.unshift("message"),this.emit.apply(this,D),this}emit(D,...f){var e,t,n;if(H0.hasOwnProperty(D))throw new Error('"'+D.toString()+'" is a reserved event name');if(f.unshift(D),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(f),this;const r={type:H.EVENT,data:f};if(r.options={},r.options.compress=this.flags.compress!==!1,typeof f[f.length-1]=="function"){const d=this.ids++,l=f.pop();this._registerAckCallback(d,l),r.id=d}const a=(t=(e=this.io.engine)===null||e===void 0?void 0:e.transport)===null||t===void 0?void 0:t.writable,F=this.connected&&!(!((n=this.io.engine)===null||n===void 0)&&n._hasPingExpired());return this.flags.volatile&&!a||(F?(this.notifyOutgoingListeners(r),this.packet(r)):this.sendBuffer.push(r)),this.flags={},this}_registerAckCallback(D,f){var e;const t=(e=this.flags.timeout)!==null&&e!==void 0?e:this._opts.ackTimeout;if(t===void 0){this.acks[D]=f;return}const n=this.io.setTimeoutFn(()=>{delete this.acks[D];for(let a=0;a<this.sendBuffer.length;a++)this.sendBuffer[a].id===D&&this.sendBuffer.splice(a,1);f.call(this,new Error("operation has timed out"))},t),r=(...a)=>{this.io.clearTimeoutFn(n),f.apply(this,a)};r.withError=!0,this.acks[D]=r}emitWithAck(D,...f){return new Promise((e,t)=>{const n=(r,a)=>r?t(r):e(a);n.withError=!0,f.push(n),this.emit(D,...f)})}_addToQueue(D){let f;typeof D[D.length-1]=="function"&&(f=D.pop());const e={id:this._queueSeq++,tryCount:0,pending:!1,args:D,flags:Object.assign({fromQueue:!0},this.flags)};D.push((t,...n)=>e!==this._queue[0]?void 0:(t!==null?e.tryCount>this._opts.retries&&(this._queue.shift(),f&&f(t)):(this._queue.shift(),f&&f(null,...n)),e.pending=!1,this._drainQueue())),this._queue.push(e),this._drainQueue()}_drainQueue(D=!1){if(!this.connected||this._queue.length===0)return;const f=this._queue[0];f.pending&&!D||(f.pending=!0,f.tryCount++,this.flags=f.flags,this.emit.apply(this,f.args))}packet(D){D.nsp=this.nsp,this.io._packet(D)}onopen(){typeof this.auth=="function"?this.auth(D=>{this._sendConnectPacket(D)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(D){this.packet({type:H.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},D):D})}onerror(D){this.connected||this.emitReserved("connect_error",D)}onclose(D,f){this.connected=!1,delete this.id,this.emitReserved("disconnect",D,f),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(D=>{if(!this.sendBuffer.some(e=>String(e.id)===D)){const e=this.acks[D];delete this.acks[D],e.withError&&e.call(this,new Error("socket has been disconnected"))}})}onpacket(D){if(D.nsp===this.nsp)switch(D.type){case H.CONNECT:D.data&&D.data.sid?this.onconnect(D.data.sid,D.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case H.EVENT:case H.BINARY_EVENT:this.onevent(D);break;case H.ACK:case H.BINARY_ACK:this.onack(D);break;case H.DISCONNECT:this.ondisconnect();break;case H.CONNECT_ERROR:this.destroy();const e=new Error(D.data.message);e.data=D.data.data,this.emitReserved("connect_error",e);break}}onevent(D){const f=D.data||[];D.id!=null&&f.push(this.ack(D.id)),this.connected?this.emitEvent(f):this.receiveBuffer.push(Object.freeze(f))}emitEvent(D){if(this._anyListeners&&this._anyListeners.length){const f=this._anyListeners.slice();for(const e of f)e.apply(this,D)}super.emit.apply(this,D),this._pid&&D.length&&typeof D[D.length-1]=="string"&&(this._lastOffset=D[D.length-1])}ack(D){const f=this;let e=!1;return function(...t){e||(e=!0,f.packet({type:H.ACK,id:D,data:t}))}}onack(D){const f=this.acks[D.id];typeof f=="function"&&(delete this.acks[D.id],f.withError&&D.data.unshift(null),f.apply(this,D.data))}onconnect(D,f){this.id=D,this.recovered=f&&this._pid===f,this._pid=f,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(D=>this.emitEvent(D)),this.receiveBuffer=[],this.sendBuffer.forEach(D=>{this.notifyOutgoingListeners(D),this.packet(D)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(D=>D()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:H.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(D){return this.flags.compress=D,this}get volatile(){return this.flags.volatile=!0,this}timeout(D){return this.flags.timeout=D,this}onAny(D){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(D),this}prependAny(D){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(D),this}offAny(D){if(!this._anyListeners)return this;if(D){const f=this._anyListeners;for(let e=0;e<f.length;e++)if(D===f[e])return f.splice(e,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(D){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(D),this}prependAnyOutgoing(D){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(D),this}offAnyOutgoing(D){if(!this._anyOutgoingListeners)return this;if(D){const f=this._anyOutgoingListeners;for(let e=0;e<f.length;e++)if(D===f[e])return f.splice(e,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(D){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const f=this._anyOutgoingListeners.slice();for(const e of f)e.apply(this,D.data)}}}function uD(u){u=u||{},this.ms=u.min||100,this.max=u.max||1e4,this.factor=u.factor||2,this.jitter=u.jitter>0&&u.jitter<=1?u.jitter:0,this.attempts=0}uD.prototype.duration=function(){var u=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var D=Math.random(),f=Math.floor(D*this.jitter*u);u=Math.floor(D*10)&1?u+f:u-f}return Math.min(u,this.max)|0},uD.prototype.reset=function(){this.attempts=0},uD.prototype.setMin=function(u){this.ms=u},uD.prototype.setMax=function(u){this.max=u},uD.prototype.setJitter=function(u){this.jitter=u};class $D extends nu{constructor(D,f){var e;super(),this.nsps={},this.subs=[],D&&typeof D=="object"&&(f=D,D=void 0),f=f||{},f.path=f.path||"/socket.io",this.opts=f,lD(this,f),this.reconnection(f.reconnection!==!1),this.reconnectionAttempts(f.reconnectionAttempts||1/0),this.reconnectionDelay(f.reconnectionDelay||1e3),this.reconnectionDelayMax(f.reconnectionDelayMax||5e3),this.randomizationFactor((e=f.randomizationFactor)!==null&&e!==void 0?e:.5),this.backoff=new uD({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(f.timeout==null?2e4:f.timeout),this._readyState="closed",this.uri=D;const t=f.parser||W0;this.encoder=new t.Encoder,this.decoder=new t.Decoder,this._autoConnect=f.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(D){return arguments.length?(this._reconnection=!!D,D||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(D){return D===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=D,this)}reconnectionDelay(D){var f;return D===void 0?this._reconnectionDelay:(this._reconnectionDelay=D,(f=this.backoff)===null||f===void 0||f.setMin(D),this)}randomizationFactor(D){var f;return D===void 0?this._randomizationFactor:(this._randomizationFactor=D,(f=this.backoff)===null||f===void 0||f.setJitter(D),this)}reconnectionDelayMax(D){var f;return D===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=D,(f=this.backoff)===null||f===void 0||f.setMax(D),this)}timeout(D){return arguments.length?(this._timeout=D,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(D){if(~this._readyState.indexOf("open"))return this;this.engine=new j0(this.uri,this.opts);const f=this.engine,e=this;this._readyState="opening",this.skipReconnect=!1;const t=xu(f,"open",function(){e.onopen(),D&&D()}),n=a=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",a),D?D(a):this.maybeReconnectOnOpen()},r=xu(f,"error",n);if(this._timeout!==!1){const a=this._timeout,F=this.setTimeoutFn(()=>{t(),n(new Error("timeout")),f.close()},a);this.opts.autoUnref&&F.unref(),this.subs.push(()=>{this.clearTimeoutFn(F)})}return this.subs.push(t),this.subs.push(r),this}connect(D){return this.open(D)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const D=this.engine;this.subs.push(xu(D,"ping",this.onping.bind(this)),xu(D,"data",this.ondata.bind(this)),xu(D,"error",this.onerror.bind(this)),xu(D,"close",this.onclose.bind(this)),xu(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(D){try{this.decoder.add(D)}catch(f){this.onclose("parse error",f)}}ondecoded(D){cD(()=>{this.emitReserved("packet",D)},this.setTimeoutFn)}onerror(D){this.emitReserved("error",D)}socket(D,f){let e=this.nsps[D];return e?this._autoConnect&&!e.active&&e.connect():(e=new Gf(this,D,f),this.nsps[D]=e),e}_destroy(D){const f=Object.keys(this.nsps);for(const e of f)if(this.nsps[e].active)return;this._close()}_packet(D){const f=this.encoder.encode(D);for(let e=0;e<f.length;e++)this.engine.write(f[e],D.options)}cleanup(){this.subs.forEach(D=>D()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(D,f){var e;this.cleanup(),(e=this.engine)===null||e===void 0||e.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",D,f),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const D=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const f=this.backoff.duration();this._reconnecting=!0;const e=this.setTimeoutFn(()=>{D.skipReconnect||(this.emitReserved("reconnect_attempt",D.backoff.attempts),!D.skipReconnect&&D.open(t=>{t?(D._reconnecting=!1,D.reconnect(),this.emitReserved("reconnect_error",t)):D.onreconnect()}))},f);this.opts.autoUnref&&e.unref(),this.subs.push(()=>{this.clearTimeoutFn(e)})}}onreconnect(){const D=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",D)}}const sD={};function bD(u,D){typeof u=="object"&&(D=u,u=void 0),D=D||{};const f=T0(u,D.path||"/socket.io"),e=f.source,t=f.id,n=f.path,r=sD[t]&&n in sD[t].nsps,a=D.forceNew||D["force new connection"]||D.multiplex===!1||r;let F;return a?F=new $D(e,D):(sD[t]||(sD[t]=new $D(e,D)),F=sD[t]),f.query&&!D.query&&(D.query=f.queryKey),F.socket(f.path,D)}Object.assign(bD,{Manager:$D,Socket:Gf,io:bD,connect:bD});const q0=()=>typeof location>"u"?"unknown-host":location.host,KD=(u,D=q0())=>`${u}-${D}`;function Y0(u,D,f){if(typeof D>"u")throw new Error("Value cannot be undefined");return localStorage.setItem(KD(u,f),JSON.stringify(D)),!0}function $0(u,D){const f=localStorage.getItem(KD(u,D));return f===null?null:JSON.parse(f)}function K0(u,D){localStorage.removeItem(KD(u,D))}const J={setItem:Y0,getItem:$0,removeItem:K0},wD=class wD{constructor(D,f,e){AD(this,"socket");AD(this,"config");this.config={...wD.defaultConfig,...f,autoConnect:!1};const t=new URL(D);this.socket=bD(t.origin,this.config),this.init(e)}get io(){return this.socket.io}init({onConnect:D,onDisconnect:f,onConnectError:e}){D&&this.uniqueOn("connect",D),f&&this.uniqueOn("disconnect",f),e&&this.uniqueOn("connect_error",e)}uniqueOn(D,f){this.socket.off(D),this.socket.on(D,f)}disconnect(){this.socket.disconnect()}connect(){this.socket.active||this.socket.connect()}on(D,f){this.socket.on(D,f)}off(D,f){this.socket.off(D,f)}async request(D){const f=await this.socket.emitWithAck(D.method,D);if(f.statusCode>=200&&f.statusCode<300)return f;throw new Error(`Request failed with status code ${f.statusCode}: ${JSON.stringify(f.body)}`)}async get(D,f){return await this.request({method:"get",url:D,...f})}async post(D,f){return await this.request({method:"post",url:D,...f})}};AD(wD,"defaultConfig",{ackTimeout:1e3,retries:3,autoConnect:!0,reconnection:!0,reconnectionAttempts:100,reconnectionDelay:1e3,reconnectionDelayMax:5e3,timeout:2e4,addTrailingSlash:!0,transports:["websocket","polling"],upgrade:!0,withCredentials:!0});let JD=wD,GD;const J0=(u,D)=>{var e;const f=(e=J.getItem("profileLiveChat"))==null?void 0:e.id;return GD||(GD=new JD(u.apiUrl,{query:{channel:u.channel,ownerId:u.ownerId,profileId:f}},D)),GD},Xf=c.createContext({socket:{}}),Zf=u=>{const D=Iu(),f=c.useRef(J0(D,{onConnect:()=>{console.info("Hexabot Live Chat : Successfully established WS Connection!")},onConnectError:()=>{console.error("Hexabot Live Chat : Failed to establish WS Connection!")},onDisconnect:()=>{console.info("Hexabot Live Chat : Disconnected WS.")}}));return s.jsx(Xf.Provider,{value:{socket:f.current},children:u.children})},Wu=()=>c.useContext(Xf),XD=(u,D)=>{const{socket:f}=Wu();c.useEffect(()=>(f.on(u,D),()=>f.off(u,D)),[u,D,f])},G0=()=>{const{socket:u}=Wu();c.useEffect(()=>(u.connect(),()=>{u.disconnect()}),[])},pD={showEmoji:!0,showFile:!0,showLocation:!0,showTypingIndicator:!0,alwaysScrollToBottom:!0,focusOnOpen:!0,title:"Cellcast Bot :)",titleImageUrl:"",inputDisabled:!1,placeholder:"Write something...",menu:[],autoFlush:!0,allowedUploadTypes:["image/gif","image/png","image/jpeg"],color:"blue",greetingMessage:"Welcome to Cellcast Bot !",avatarUrl:"",logoUrl:"",formSettings:[],termsAndConditions:{url:"https://www.cellcast.com/au/legal/terms-conditions",text:"terms"},offline_mode:{status:"active",start_time:"",end_time:"",time_zone:"Etc/GMT+12"}},Qf=c.createContext(pD),u1=({children:u})=>{const{t:D}=Su(),f=Tf.getItem("settings"),[e,t]=c.useState(f||pD),n=c.useCallback(r=>{Tf.setItem("settings",r),t(r)},[]);return XD("settings",r=>{var a;n({...pD,showEmoji:r.show_emoji,showFile:r.show_file,showLocation:r.show_location,title:r.window_title,titleImageUrl:r.avatar_url,menu:r.menu,allowedUploadTypes:(a=r.allowed_upload_types)==null?void 0:a.split(","),inputDisabled:r.input_disabled,color:r.theme_color,greetingMessage:r.greeting_message,placeholder:D("settings.placeholder"),avatarUrl:r.avatar_url,logoUrl:r.logo_url,formSettings:r.form_settings,termsAndConditions:r.terms_and_conditions||pD.termsAndConditions,offline_mode:r.offline_mode})}),s.jsx(Qf.Provider,{value:e,children:u})},hu=()=>c.useContext(Qf),D1=c.createContext(void 0),f1=({onOpen:u,onClose:D,onScrollToTop:f,defaultScreen:e="prechat",children:t})=>{const[n,r]=c.useState(!0),[a,F]=c.useState(!1),[o,d]=c.useState(e),[l,E]=c.useState(100),R={syncState:n,isOpen:a,screen:o,scroll:l,setSyncState:g=>{r(g)},setIsOpen:g=>{F(g),n&&(g?u&&u():D&&D())},setScreen:g=>{d(["prechat","postchat","webview"].includes(g)?g:"chat")},setScroll:g=>{E(g),f&&n&&g===0&&f()}};return s.jsx(D1.Provider,{value:R,children:t})},Nu=()=>{const u=c.useContext(D1);if(u===void 0)throw new Error("useWidget must be used within a WidgetProvider");return u},X0=u=>new Intl.DateTimeFormat("en-GB",{hour:"2-digit",minute:"2-digit",hour12:!1,timeZone:u}).format(new Date),BD=u=>{const D=u||{};if(!D||D.status!=="active")return!1;if(D.start_time&&D.end_time&&D.time_zone){const f=X0(D.time_zone);return!(f>=D.start_time&&f<=D.end_time)}return!0},mu={participants:[{id:"chatbot",name:"Hexabot",foreign_id:"chatbot",imageUrl:""}],setParticipants:()=>{},outgoingMessageState:0,setOutgoingMessageState:()=>{},connectionState:0,setConnectionState:()=>{},messages:[],setMessages:()=>{},suggestions:[],setSuggestions:()=>{},showTypingIndicator:!1,setShowTypingIndicator:()=>{},newIOMessage:null,setNewIOMessage:()=>{},newMessagesCount:0,setNewMessagesCount:()=>{},webviewUrl:"",setWebviewUrl:()=>{},message:"",setMessage:()=>{},payload:null,setPayload:()=>{},file:null,setFile:()=>{},send:()=>{},handleSubscription:()=>{},isContactFormActive:!1,setIsContactFormActive:()=>{},isOfflineMode:!1,setIsOfflineMode:()=>{}},e1=c.createContext(mu),t1=({wantToConnect:u,defaultConnectionState:D=0,children:f})=>{const e=Iu(),t=hu(),{screen:n,setScreen:r}=Nu(),{setScroll:a,syncState:F,isOpen:o}=Nu(),d=Wu(),[l,E]=c.useState(mu.participants),[j,v]=c.useState(D),[C,N]=c.useState([]),[R,g]=c.useState(mu.newMessagesCount),[z,y]=c.useState(mu.showTypingIndicator),[B,P]=c.useState(mu.suggestions),[k,q]=c.useState(mu.newIOMessage),[_,x]=c.useState(mu.message),[w,bu]=c.useState(mu.outgoingMessageState),[fu,T]=c.useState(mu.payload),[h,b]=c.useState(mu.file),[S,m]=c.useState(mu.webviewUrl),[L,I]=c.useState(mu.isContactFormActive),[U,W]=c.useState(mu.isOfflineMode),{send:G}=ou(),{t:V}=Su(),Q=O=>{v(O),O===Qu.wantToConnect&&u&&u(),O===Qu.connected&&t.alwaysScrollToBottom&&a(101)},eu=t.offline_mode,cu=BD(eu),_u=O=>{if(q(O),J.setItem("isOffline",(O==null?void 0:O.isOffline)||!1),J.setItem("submitedFormLateTime",(O==null?void 0:O.submitedFormLateTime)||null),O&&"type"in O&&O.type==="typing")return z===!0;y(!1),O&&"mid"in O&&!C.find(uu=>O.mid===uu.mid)&&("author"in O&&(O.direction=O.author==="chatbot"?Z.received:Z.sent,O.read=!0,O.delivery=!0),N(uu=>[...uu.filter(su=>su.mid!==O.mid),O]),a(0),"direction"in O&&O.direction===Z.received&&!O.isOffline&&W(!1)),O&&"data"in O&&"quick_replies"in O.data?P((O.data.quick_replies||[]).map(uu=>({content_type:vf.text,text:uu.title,payload:uu.payload}))):P([]),o||g(uu=>uu+1),t.alwaysScrollToBottom&&a(101),bu(tD.sent)},{socket:Bu}=Wu(),ru=async({data:O})=>{var su;bu(O.type==="file"?tD.uploading:tD.sending),x("");const uu=await d.socket.post(`/webhook/${e.channel}/`,{data:{...O,author:(O==null?void 0:O.author)??((su=l[1])==null?void 0:su.id)}});console.log("🚀 ~ ChatProvider.tsx:351 ~ handleSend ~ sentMessage:",uu),console.log("=== CALLING handleNewIOMessage from handleSend (API Response) ===")},du=c.useCallback(async(O,uu)=>{try{v(2);const su=new URLSearchParams;Object.entries({...O&&uu?{first_name:O,last_name:uu}:{},_refresh:Date.now().toString()}).forEach(([gu,qu])=>{typeof qu=="string"&&qu.trim()&&su.append(gu,qu)}),su.append("owner_id",e.ownerId);const{body:lu}=await Bu.get(`/webhook/${e.channel}/?${su.toString()}`);console.log("jump here 2"),J.setItem("profileLiveChat",lu.profile),J.setItem("isOffline",cu||!1),J.setItem("submitedFormLateTime",lu.profile.submitedFormLateTime||null),N(lu.messages.map(gu=>({...gu,direction:gu.author===lu.profile.foreignId||gu.author===lu.profile.id?Z.sent:Z.received,read:gu.direction===Z.sent||gu.read,delivery:gu.direction===Z.sent||gu.delivery,isOffline:gu.isOffline||lu.profile.isOffline,submitedFormLateTime:gu.submitedFormLateTime||lu.profile.submitedFormLateTime}))),E([l[0],{id:lu.profile.foreignId,foreign_id:lu.profile.foreignId,name:`${lu.profile.firstName} ${lu.profile.firstName}`}]),C.length===0&&G({event,source:"get_started_button",data:{type:yu.postback,data:{text:V("messages.get_started"),payload:"GET_STARTED"},author:lu.profile.foreignId}}),v(3),r("chat")}catch(su){console.error("Unable to subscribe user",su),r("prechat"),v(0)}},[l,v,N,E,r,d]);XD(TD.message,O=>{console.log("=== CALLING handleNewIOMessage from useSubscribe (Socket Realtime) ==="),_u(O)}),XD(TD.typing,y);const Lu=O=>{O?(m(O),r("webview")):r("chat")};c.useEffect(()=>{F&&o&&g(0)},[F,o]),c.useEffect(()=>{if(o&&j===Qu.connected){console.log("🔄 Widget opened - fetching fresh data");const O=J.getItem("profileLiveChat");if(O){const uu=O;console.log("🔄 Widget opened - fetching fresh data",uu),du(uu.firstName,uu.lastName)}!O&&!cu&&r("prechat")}},[o]),$1("logout",()=>{d.socket.disconnect()}),c.useEffect(()=>{n==="chat"&&j===Qu.connected&&du();const O=()=>{const uu=J.getItem("profileLiveChat");if(uu){const su=uu;du(su.firstName,su.lastName)}};return d.socket.io.on("reconnect",O),()=>{d.socket.io.off("reconnect",O)}},[]),c.useEffect(()=>{const O=[...l];O[0].imageUrl=t.avatarUrl,E(O)},[t.avatarUrl]);const Mu={participants:l,setParticipants:E,outgoingMessageState:w,setOutgoingMessageState:bu,connectionState:j,setConnectionState:Q,messages:C.sort((O,uu)=>{const su=Date.parse(O.createdAt),lu=Date.parse(uu.createdAt);return+new Date(su)-+new Date(lu)}),setMessages:N,newMessagesCount:R,setNewMessagesCount:g,newIOMessage:k,setNewIOMessage:q,send:ru,showTypingIndicator:t.showTypingIndicator&&z,setShowTypingIndicator:y,suggestions:B,setSuggestions:P,webviewUrl:S,setWebviewUrl:Lu,payload:fu,setPayload:T,file:h,setFile:b,message:_,setMessage:x,handleSubscription:du,isContactFormActive:L,setIsContactFormActive:I,isOfflineMode:U,setIsOfflineMode:W};return s.jsx(e1.Provider,{value:Mu,children:f})},ou=()=>{const u=c.useContext(e1);if(!u)throw new Error("useChat must be used within a ChatContext");return u},gD={orange:{header:{bg:"#FF851B",text:"#fff"},launcher:{bg:"#FF851B"},messageList:{bg:"#fff"},sent:{bg:"#FF851B",text:"#fff"},received:{bg:"#f6f8f9",text:"#000"},userInput:{bg:"#fff",text:"#000"},button:{bg:"#ffffff",text:"#FF851B",border:"#FF851B"},messageStatus:{bg:"#FF851B"},messageTime:{text:"#9C9C9C"}},red:{header:{bg:"#FF4136",text:"#fff"},launcher:{bg:"#FF4136"},messageList:{bg:"#fff"},sent:{bg:"#FF4136",text:"#fff"},received:{bg:"#f6f8f9",text:"#000"},userInput:{bg:"#fff",text:"#000"},button:{bg:"#ffffff",text:"#FF4136",border:"#FF4136"},messageStatus:{bg:"#FF4136"},messageTime:{text:"#FF4136"}},green:{header:{bg:"#2ECC40",text:"#fff"},launcher:{bg:"#2ECC40"},messageList:{bg:"#fff"},sent:{bg:"#2ECC40",text:"#fff"},received:{bg:"#f6f8f9",text:"#000"},userInput:{bg:"#fff",text:"#000"},button:{bg:"#ffffff",text:"#2ECC40",border:"#2ECC40"},messageStatus:{bg:"#2ECC40"},messageTime:{text:"#2ECC40"}},blue:{header:{bg:"#0074D9",text:"#fff"},launcher:{bg:"#0074D9"},messageList:{bg:"#fff"},sent:{bg:"#0074D9",text:"#fff"},received:{bg:"#f6f8f9",text:"#000"},userInput:{bg:"#fff",text:"#000"},button:{bg:"#ffffff",text:"#0074D9",border:"#0074D9"},messageStatus:{bg:"#0074D9"},messageTime:{text:"#0074D9"}},teal:{header:{bg:"#1BA089",text:"#fff"},launcher:{bg:"#1BA089"},messageList:{bg:"#fff"},sent:{bg:"#1BA089",text:"#fff"},received:{bg:"#f6f8f9",text:"#000"},userInput:{bg:"#fff",text:"#000"},button:{bg:"#ffffff",text:"#1BA089",border:"#1BA089"},messageStatus:{bg:"#1BA089"},messageTime:{text:"#9C9C9C"}},dark:{header:{bg:"#000",text:"#ecf0f1"},launcher:{bg:"#000"},messageList:{bg:"#FFF"},sent:{bg:"#000",text:"#FFF"},received:{bg:"#f6f8f9",text:"#000"},userInput:{bg:"#fff",text:"#000"},button:{bg:"#000",text:"#ecf0f1",border:"#34495e"},messageStatus:{bg:"#95a5a6"},messageTime:{text:"#ffffff"}},purple:{header:{bg:"#7950F2",text:"#fff"},launcher:{bg:"#7950F2"},messageList:{bg:"#fff"},sent:{bg:"#7950F2",text:"#fff"},received:{bg:"#f6f8f9",text:"#000"},userInput:{bg:"#fff",text:"#000"},button:{bg:"#ffffff",text:"#7950F2",border:"#7950F2"},messageStatus:{bg:"#7950F2"},messageTime:{text:"#9C9C9C"}}},Z0=u=>{const D=u.replace("#",""),f=parseInt(D.substring(0,2),16),e=parseInt(D.substring(2,4),16),t=parseInt(D.substring(4,6),16);return(.299*f+.587*e+.114*t)/255>.5?"#000000":"#FFFFFF"},Q0=u=>/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/.test(u),ue=u=>{const D=u.replace("#","");return{r:parseInt(D.substring(0,2),16),g:parseInt(D.substring(2,4),16),b:parseInt(D.substring(4,6),16)}},De=u=>(u.startsWith("#")||(u="#"+u),u.length===4?"#"+u[1]+u[1]+u[2]+u[2]+u[3]+u[3]:u),ZD=u=>{const D=De(u);if(!Q0(D))return console.warn(`Invalid color: ${u}, using default blue theme`),ZD("#0074D9");const f=Z0(D),e=ue(D),t=Math.min(255,Math.floor(e.r+(255-e.r)*.9)),n=Math.min(255,Math.floor(e.g+(255-e.g)*.9)),r=Math.min(255,Math.floor(e.b+(255-e.b)*.9)),a=`#${t.toString(16).padStart(2,"0")}${n.toString(16).padStart(2,"0")}${r.toString(16).padStart(2,"0")}`,F=Math.max(0,Math.floor(e.r*.8)),o=Math.max(0,Math.floor(e.g*.8)),d=Math.max(0,Math.floor(e.b*.8));return`${F.toString(16).padStart(2,"0")}${o.toString(16).padStart(2,"0")}${d.toString(16).padStart(2,"0")}`,{header:{bg:D,text:f},launcher:{bg:D},messageList:{bg:"#fff"},sent:{bg:D,text:f},received:{bg:a,text:"#000"},userInput:{bg:"#fff",text:"#000"},button:{bg:"#ffffff",text:D,border:D},messageStatus:{bg:D},messageTime:{text:"#9C9C9C"}}},n1={orange:"#FF851B",red:"#FF4136",green:"#2ECC40",blue:"#0074D9",teal:"#1BA089",dark:"#000000",purple:"#7950F2"},fe=u=>n1[u]?ZD(n1[u]):ZD(u),ee=()=>({bg:"#f6f8f9",text:"#000"}),te=gD.orange,r1=c.createContext({colors:te}),s1=({children:u})=>{const D=hu(),f=()=>{const e=D.color;if(gD[e])return gD[e];try{return{...fe(e),received:ee()}}catch{return console.warn(`Failed to generate theme for color: ${e}, using orange fallback`),gD.orange}};return s.jsx(r1.Provider,{value:{colors:f()},children:u})},Fu=()=>{const u=c.useContext(r1);if(!u)throw new Error("useColors must be used within a ColorProvider");return u},QD=({viewBox:u="0 0 24 24",...D})=>s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:u,...D,children:s.jsx("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"})}),a1=({width:u="24",height:D="24",logoUrl:f,...e})=>s.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16.64 17.71",width:u,height:D,className:"widget-logo",...e,children:[s.jsx("defs",{children:s.jsx("style",{children:".cls-1{fill:#ffffff;fill-rule:evenodd;}"})}),s.jsx("path",{className:"cls-1",d:"M7.5,13.44c.44,.13,.88,.19,1.35,.19,1.61,0,3.04-.8,3.9-2,.42-.58,1.04-.91,1.75-.91h.23c.73,0,1.35,.37,1.69,1.02,.34,.63,.31,1.35-.1,1.95-.93,1.4-2.32,2.31-4.33,2.31-1.88,0-3.57-.84-4.72-2.18-.06-.08-.08-.19-.02-.28,.05-.1,.16-.15,.26-.11Zm-2.52,3.38c1.17,.57,2.48,.89,3.86,.89h.1c.13-.02,.23-.1,.24-.21s-.05-.23-.15-.26c-6.8-2.63-6.7-13.16-.19-13.16,1.57,0,3,.75,3.9,2,.42,.58,1.04,.89,1.75,.89h.16c.73,0,1.35-.37,1.69-1.01s.31-1.35-.08-1.95c-.45-.68-.99-1.3-1.61-1.83-1.54-1.35-3.59-2.18-5.81-2.18C3.96,0,0,3.96,0,8.85c0,1.87,.57,3.59,1.56,5.02v.02c.86,1.23,2.01,2.26,3.43,2.94Z"})]}),ne=({onChatWithStaff:u,onSendNoticeToStaff:D})=>{const[f,e]=c.useState(!1),t=c.useRef(null),{socket:n}=Wu();Iu();const{send:r}=ou();Su(),c.useEffect(()=>{const F=o=>{t.current&&!t.current.contains(o.target)&&e(!1)};return document.addEventListener("mousedown",F),()=>{document.removeEventListener("mousedown",F)}},[]);const a=async F=>{F.preventDefault(),F.stopPropagation();try{const o=J.getItem("profileLiveChat");if(!o){console.error("No profile found in localStorage");return}r({event:F,source:"staff-notice",data:{type:yu.notify,data:{text:"Notice sent to staff"},author:o.foreignId}}),e(!1),D==null||D()}catch(o){console.error("Error sending notice to staff:",o)}};return s.jsxs("div",{className:"staff-menu",ref:t,children:[s.jsx("button",{className:"staff-menu-toggle",onClick:()=>e(!f),children:s.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"currentColor",children:[s.jsx("circle",{cx:"12",cy:"6",r:"2"}),s.jsx("circle",{cx:"12",cy:"12",r:"2"}),s.jsx("circle",{cx:"12",cy:"18",r:"2"})]})}),f&&s.jsx("div",{className:"staff-menu-dropdown",children:s.jsx("button",{className:"staff-menu-item",onClick:a,children:"Send Notice to Staff"})})]})},re=({children:u})=>{const D=hu(),{colors:f}=Fu(),e=Nu();return s.jsxs("div",{className:"sc-header",style:{background:f.header.bg,color:f.header.text},children:[u||s.jsxs(s.Fragment,{children:[s.jsx("a",{href:"https://hexabot.ai",target:"_blank",title:"Powered By Hexabot.ai",className:"sc-header--img",children:D.logoUrl?s.jsx("img",{src:D.logoUrl,width:38,height:38,className:"sc-open-icon",style:{borderRadius:"50%"}}):s.jsx(a1,{width:32,height:32})}),s.jsx("div",{className:"sc-header--title",children:D.title})]}),s.jsxs("div",{className:"sc-header--actions",children:[s.jsx(ne,{onChatWithStaff:()=>{console.log("Chat with staff requested")},onSendNoticeToStaff:()=>{console.log("Notice sent to staff")}}),s.jsx("div",{className:"sc-header--close-button",onClick:()=>e.setIsOpen(!1),children:s.jsx(QD,{})})]})]})},se=({width:u="100",height:D="100",x:f="0",y:e="0",viewBox:t="0 0 512.115 512.115",...n})=>s.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:u,height:D,x:f,y:e,viewBox:t,...n,children:[s.jsx("circle",{cx:"255.998",cy:"374.496",r:"32.133"}),s.jsx("path",{d:"M259.46 342.551c20.068 21.447 2.961 57.089-26.924 53.889 19.876 21.242 55.595 7.028 55.595-21.944 0-16.576-12.553-30.217-28.671-31.945zM346.922 272.908c-14.694-11.793-31.719-20.793-50.261-26.198l28.056-28.056a181.486 181.486 0 0144.53 26.284c8.351 6.698 9.121 19.122 1.552 26.692-6.461 6.46-16.738 7.007-23.877 1.278zm-204.172-27.97c-8.351 6.698-9.122 19.122-1.552 26.692 6.109 6.254 16.525 7.178 23.876 1.278 20.705-16.617 46.037-27.689 73.723-30.964l35.859-35.859c-48.401-4.971-95.296 9.491-131.906 38.853zm157.933-64.88l29.253-29.253c-79.639-25.044-168.342-8.412-234.2 47.892-7.97 6.814-8.541 18.928-1.127 26.343 6.568 6.568 17.121 7.079 24.173 1.035 51.196-43.872 118.577-59.715 181.901-46.017zm116.705 44.982c7.415-7.415 6.844-19.529-1.127-26.343a248.048 248.048 0 00-42.385-29.203l-26.573 26.573a211.854 211.854 0 0145.912 30.008c7.052 6.044 17.605 5.533 24.173-1.035zm-116.359 95.457c6.604 4.525 15.912 4.623 22.908-2.005 7.88-7.88 6.751-21.016-2.422-27.343a114.995 114.995 0 00-49.967-19.326l-37.95 37.95c22.182-6.494 47.03-3.254 67.431 10.724z"}),s.jsx("path",{d:"M416.261 198.697a248.048 248.048 0 00-42.385-29.203l-7.388 7.388a247.907 247.907 0 0129.774 21.814c9.055 7.741 8.317 21.88-1.529 28.533 6.982 4.781 16.543 3.922 22.655-2.19 7.414-7.413 6.843-19.528-1.127-26.342zM369.247 244.938a181.486 181.486 0 00-44.53-26.284l-6.327 6.327a181.811 181.811 0 0130.857 19.957c9.462 7.589 8.937 22.091-1.089 28.871 7.054 4.744 16.544 3.917 22.64-2.178 7.57-7.571 6.8-19.996-1.551-26.693zM321.515 291.148a114.995 114.995 0 00-49.967-19.326l-3.48 3.48a115.07 115.07 0 0133.447 15.846c10.331 7.126 10.2 22.482-.221 29.513 6.595 4.357 15.745 4.365 22.643-2.17 7.88-7.879 6.751-21.016-2.422-27.343z"}),s.jsx("path",{d:"M437.077 75.038c-100.046-100.044-261.982-100.057-362.039 0-100.044 100.042-100.058 261.98 0 362.039 100.046 100.044 261.981 100.057 362.04 0 100.043-100.046 100.057-261.981-.001-362.039zm-25.685 67.607c1.856-1.856 4.94-1.582 6.444.568 54.271 77.582 45.249 184.719-22.326 252.297-67.579 67.576-174.715 76.599-252.298 22.326-2.15-1.504-2.423-4.589-.568-6.444l268.748-268.747zM94.274 368.912C5.205 241.953 93.085 58.843 256.057 58.843c40.925 0 79.777 12.225 112.855 35.431 2.147 1.506 2.42 4.588.565 6.443l-268.76 268.761c-1.855 1.854-4.937 1.581-6.443-.566z"}),s.jsx("path",{d:"M349.926 17.756c141.317 87.019 164.005 282.465 47.152 399.321-74.64 74.638-183.463 93.269-274.888 57.282 97.36 59.953 228.457 49.147 314.888-37.282 131.453-131.456 82.523-352.533-87.152-419.321z"})]}),ae=({size:u=50,color:D="#000",...f})=>s.jsxs("svg",{width:u,height:u,viewBox:"0 0 50 50",xmlns:"http://www.w3.org/2000/svg",fill:D,...f,children:[s.jsxs("circle",{cx:"25",cy:"25",r:"20",stroke:"none",fill:"none",children:[s.jsx("animate",{attributeName:"r",begin:"0s",dur:"1.5s",values:"20; 0",keyTimes:"0; 1",repeatCount:"indefinite"}),s.jsx("animate",{attributeName:"stroke-opacity",begin:"0s",dur:"1.5s",values:"1; 0",keyTimes:"0; 1",repeatCount:"indefinite"})]}),s.jsxs("circle",{cx:"25",cy:"25",r:"20",stroke:"none",fill:"none",children:[s.jsx("animate",{attributeName:"r",begin:"0.75s",dur:"1.5s",values:"20; 0",keyTimes:"0; 1",repeatCount:"indefinite"}),s.jsx("animate",{attributeName:"stroke-opacity",begin:"0.75s",dur:"1.5s",values:"1; 0",keyTimes:"0; 1",repeatCount:"indefinite"})]})]}),Fe=()=>{const{t:u}=Su(),{connectionState:D,setConnectionState:f}=ou(),{colors:e}=Fu(),t=()=>{D===0&&f(1)},n=D>0;return s.jsx("div",{className:"sc-chat--disconnected-icon-wrapper",style:{backgroundColor:e.messageList.bg},children:n?s.jsx(ae,{className:"loading-image"}):s.jsxs("div",{className:"sc-chat--disconnected-icon",children:[s.jsx(se,{}),s.jsx("h3",{className:"sc-chat--disconnected-text",style:{color:e.button.text},children:u("settings.connection_lost")}),s.jsx("button",{className:"sc-chat--disconnected-button",style:{color:e.button.text,backgroundColor:e.button.bg,borderColor:e.button.border},onClick:t,children:"Refresh"})]})})};var uf={exports:{}},F1;function i1(){return F1||(F1=1,function(u,D){(function(f,e){u.exports=e()})(ku,function(){var f=1e3,e=6e4,t=36e5,n="millisecond",r="second",a="minute",F="hour",o="day",d="week",l="month",E="quarter",j="year",v="date",C="Invalid Date",N=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,R=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,g={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(T){var h=["th","st","nd","rd"],b=T%100;return"["+T+(h[(b-20)%10]||h[b]||h[0])+"]"}},z=function(T,h,b){var S=String(T);return!S||S.length>=h?T:""+Array(h+1-S.length).join(b)+T},y={s:z,z:function(T){var h=-T.utcOffset(),b=Math.abs(h),S=Math.floor(b/60),m=b%60;return(h<=0?"+":"-")+z(S,2,"0")+":"+z(m,2,"0")},m:function T(h,b){if(h.date()<b.date())return-T(b,h);var S=12*(b.year()-h.year())+(b.month()-h.month()),m=h.clone().add(S,l),L=b-m<0,I=h.clone().add(S+(L?-1:1),l);return+(-(S+(b-m)/(L?m-I:I-m))||0)},a:function(T){return T<0?Math.ceil(T)||0:Math.floor(T)},p:function(T){return{M:l,y:j,w:d,d:o,D:v,h:F,m:a,s:r,ms:n,Q:E}[T]||String(T||"").toLowerCase().replace(/s$/,"")},u:function(T){return T===void 0}},B="en",P={};P[B]=g;var k="$isDayjsObject",q=function(T){return T instanceof bu||!(!T||!T[k])},_=function T(h,b,S){var m;if(!h)return B;if(typeof h=="string"){var L=h.toLowerCase();P[L]&&(m=L),b&&(P[L]=b,m=L);var I=h.split("-");if(!m&&I.length>1)return T(I[0])}else{var U=h.name;P[U]=h,m=U}return!S&&m&&(B=m),m||!S&&B},x=function(T,h){if(q(T))return T.clone();var b=typeof h=="object"?h:{};return b.date=T,b.args=arguments,new bu(b)},w=y;w.l=_,w.i=q,w.w=function(T,h){return x(T,{locale:h.$L,utc:h.$u,x:h.$x,$offset:h.$offset})};var bu=function(){function T(b){this.$L=_(b.locale,null,!0),this.parse(b),this.$x=this.$x||b.x||{},this[k]=!0}var h=T.prototype;return h.parse=function(b){this.$d=function(S){var m=S.date,L=S.utc;if(m===null)return new Date(NaN);if(w.u(m))return new Date;if(m instanceof Date)return new Date(m);if(typeof m=="string"&&!/Z$/i.test(m)){var I=m.match(N);if(I){var U=I[2]-1||0,W=(I[7]||"0").substring(0,3);return L?new Date(Date.UTC(I[1],U,I[3]||1,I[4]||0,I[5]||0,I[6]||0,W)):new Date(I[1],U,I[3]||1,I[4]||0,I[5]||0,I[6]||0,W)}}return new Date(m)}(b),this.init()},h.init=function(){var b=this.$d;this.$y=b.getFullYear(),this.$M=b.getMonth(),this.$D=b.getDate(),this.$W=b.getDay(),this.$H=b.getHours(),this.$m=b.getMinutes(),this.$s=b.getSeconds(),this.$ms=b.getMilliseconds()},h.$utils=function(){return w},h.isValid=function(){return this.$d.toString()!==C},h.isSame=function(b,S){var m=x(b);return this.startOf(S)<=m&&m<=this.endOf(S)},h.isAfter=function(b,S){return x(b)<this.startOf(S)},h.isBefore=function(b,S){return this.endOf(S)<x(b)},h.$g=function(b,S,m){return w.u(b)?this[S]:this.set(m,b)},h.unix=function(){return Math.floor(this.valueOf()/1e3)},h.valueOf=function(){return this.$d.getTime()},h.startOf=function(b,S){var m=this,L=!!w.u(S)||S,I=w.p(b),U=function(Bu,ru){var du=w.w(m.$u?Date.UTC(m.$y,ru,Bu):new Date(m.$y,ru,Bu),m);return L?du:du.endOf(o)},W=function(Bu,ru){return w.w(m.toDate()[Bu].apply(m.toDate("s"),(L?[0,0,0,0]:[23,59,59,999]).slice(ru)),m)},G=this.$W,V=this.$M,Q=this.$D,eu="set"+(this.$u?"UTC":"");switch(I){case j:return L?U(1,0):U(31,11);case l:return L?U(1,V):U(0,V+1);case d:var cu=this.$locale().weekStart||0,_u=(G<cu?G+7:G)-cu;return U(L?Q-_u:Q+(6-_u),V);case o:case v:return W(eu+"Hours",0);case F:return W(eu+"Minutes",1);case a:return W(eu+"Seconds",2);case r:return W(eu+"Milliseconds",3);default:return this.clone()}},h.endOf=function(b){return this.startOf(b,!1)},h.$set=function(b,S){var m,L=w.p(b),I="set"+(this.$u?"UTC":""),U=(m={},m[o]=I+"Date",m[v]=I+"Date",m[l]=I+"Month",m[j]=I+"FullYear",m[F]=I+"Hours",m[a]=I+"Minutes",m[r]=I+"Seconds",m[n]=I+"Milliseconds",m)[L],W=L===o?this.$D+(S-this.$W):S;if(L===l||L===j){var G=this.clone().set(v,1);G.$d[U](W),G.init(),this.$d=G.set(v,Math.min(this.$D,G.daysInMonth())).$d}else U&&this.$d[U](W);return this.init(),this},h.set=function(b,S){return this.clone().$set(b,S)},h.get=function(b){return this[w.p(b)]()},h.add=function(b,S){var m,L=this;b=Number(b);var I=w.p(S),U=function(V){var Q=x(L);return w.w(Q.date(Q.date()+Math.round(V*b)),L)};if(I===l)return this.set(l,this.$M+b);if(I===j)return this.set(j,this.$y+b);if(I===o)return U(1);if(I===d)return U(7);var W=(m={},m[a]=e,m[F]=t,m[r]=f,m)[I]||1,G=this.$d.getTime()+b*W;return w.w(G,this)},h.subtract=function(b,S){return this.add(-1*b,S)},h.format=function(b){var S=this,m=this.$locale();if(!this.isValid())return m.invalidDate||C;var L=b||"YYYY-MM-DDTHH:mm:ssZ",I=w.z(this),U=this.$H,W=this.$m,G=this.$M,V=m.weekdays,Q=m.months,eu=m.meridiem,cu=function(ru,du,Lu,Mu){return ru&&(ru[du]||ru(S,L))||Lu[du].slice(0,Mu)},_u=function(ru){return w.s(U%12||12,ru,"0")},Bu=eu||function(ru,du,Lu){var Mu=ru<12?"AM":"PM";return Lu?Mu.toLowerCase():Mu};return L.replace(R,function(ru,du){return du||function(Lu){switch(Lu){case"YY":return String(S.$y).slice(-2);case"YYYY":return w.s(S.$y,4,"0");case"M":return G+1;case"MM":return w.s(G+1,2,"0");case"MMM":return cu(m.monthsShort,G,Q,3);case"MMMM":return cu(Q,G);case"D":return S.$D;case"DD":return w.s(S.$D,2,"0");case"d":return String(S.$W);case"dd":return cu(m.weekdaysMin,S.$W,V,2);case"ddd":return cu(m.weekdaysShort,S.$W,V,3);case"dddd":return V[S.$W];case"H":return String(U);case"HH":return w.s(U,2,"0");case"h":return _u(1);case"hh":return _u(2);case"a":return Bu(U,W,!0);case"A":return Bu(U,W,!1);case"m":return String(W);case"mm":return w.s(W,2,"0");case"s":return String(S.$s);case"ss":return w.s(S.$s,2,"0");case"SSS":return w.s(S.$ms,3,"0");case"Z":return I}return null}(ru)||I.replace(":","")})},h.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},h.diff=function(b,S,m){var L,I=this,U=w.p(S),W=x(b),G=(W.utcOffset()-this.utcOffset())*e,V=this-W,Q=function(){return w.m(I,W)};switch(U){case j:L=Q()/12;break;case l:L=Q();break;case E:L=Q()/3;break;case d:L=(V-G)/6048e5;break;case o:L=(V-G)/864e5;break;case F:L=V/t;break;case a:L=V/e;break;case r:L=V/f;break;default:L=V}return m?L:w.a(L)},h.daysInMonth=function(){return this.endOf(l).$D},h.$locale=function(){return P[this.$L]},h.locale=function(b,S){if(!b)return this.$L;var m=this.clone(),L=_(b,S,!0);return L&&(m.$L=L),m},h.clone=function(){return w.w(this.$d,this)},h.toDate=function(){return new Date(this.valueOf())},h.toJSON=function(){return this.isValid()?this.toISOString():null},h.toISOString=function(){return this.$d.toISOString()},h.toString=function(){return this.$d.toUTCString()},T}(),fu=bu.prototype;return x.prototype=fu,[["$ms",n],["$s",r],["$m",a],["$H",F],["$W",o],["$M",l],["$y",j],["$D",v]].forEach(function(T){fu[T[1]]=function(h){return this.$g(h,T[0],T[1])}}),x.extend=function(T,h){return T.$i||(T(h,bu,x),T.$i=!0),x},x.locale=_,x.isDayjs=q,x.unix=function(T){return x(1e3*T)},x.en=P[B],x.Ls=P,x.p={},x})}(uf)),uf.exports}var ie=i1();const o1=xD(ie);var oe={exports:{}};(function(u,D){(function(f,e){u.exports=e()})(ku,function(){return{name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(f){var e=["th","st","nd","rd"],t=f%100;return"["+f+(e[(t-20)%10]||e[t]||e[0])+"]"}}})})(oe);var de={exports:{}};(function(u,D){(function(f,e){u.exports=e(i1())})(ku,function(f){function e(r){return r&&typeof r=="object"&&"default"in r?r:{default:r}}var t=e(f),n={name:"fr",weekdays:"dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"),weekdaysShort:"dim._lun._mar._mer._jeu._ven._sam.".split("_"),weekdaysMin:"di_lu_ma_me_je_ve_sa".split("_"),months:"janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre".split("_"),monthsShort:"janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.".split("_"),weekStart:1,yearStart:4,formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},relativeTime:{future:"dans %s",past:"il y a %s",s:"quelques secondes",m:"une minute",mm:"%d minutes",h:"une heure",hh:"%d heures",d:"un jour",dd:"%d jours",M:"un mois",MM:"%d mois",y:"un an",yy:"%d ans"},ordinal:function(r){return""+r+(r===1?"er":"")}};return t.default.locale(n,null,!0),n})})(de);var d1={exports:{}};(function(u,D){(function(f,e){u.exports=e()})(ku,function(){return function(f,e,t){f=f||{};var n=e.prototype,r={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function a(o,d,l,E){return n.fromToBase(o,d,l,E)}t.en.relativeTime=r,n.fromToBase=function(o,d,l,E,j){for(var v,C,N,R=l.$locale().relativeTime||r,g=f.thresholds||[{l:"s",r:44,d:"second"},{l:"m",r:89},{l:"mm",r:44,d:"minute"},{l:"h",r:89},{l:"hh",r:21,d:"hour"},{l:"d",r:35},{l:"dd",r:25,d:"day"},{l:"M",r:45},{l:"MM",r:10,d:"month"},{l:"y",r:17},{l:"yy",d:"year"}],z=g.length,y=0;y<z;y+=1){var B=g[y];B.d&&(v=E?t(o).diff(l,B.d,!0):l.diff(o,B.d,!0));var P=(f.rounding||Math.round)(Math.abs(v));if(N=v>0,P<=B.r||!B.r){P<=1&&y>0&&(B=g[y-1]);var k=R[B.l];j&&(P=j(""+P)),C=typeof k=="string"?k.replace("%d",P):k(P,d,B.l,N);break}}if(d)return C;var q=N?R.future:R.past;return typeof q=="function"?q(C):q.replace("%s",C)},n.to=function(o,d){return a(o,d,this,!0)},n.from=function(o,d){return a(o,d,this)};var F=function(o){return o.$u?t.utc():t()};n.toNow=function(o){return this.to(F(this),o)},n.fromNow=function(o){return this.from(F(this),o)}}})})(d1);var Ce=d1.exports;const ce=xD(Ce),C1=({width:u="18",height:D="18",...f})=>s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 42.555282 47.2949",width:u,height:D,...f,children:s.jsxs("g",{fillOpacity:1,strokeDasharray:"none",children:[s.jsx("path",{d:"M32.756 170.872l-4.26 7.482-2.786-7.494-8.211-.017a4.405 4.405 0 01-3.8-2.191l-6.443-11.087a4.215 4.215 0 01-.011-4.216l6.213-10.833a4.96 4.96 0 014.288-2.492l12.2-.034a4.715 4.715 0 014.09 2.347l6.16 10.602a4.864 4.864 0 01.02 4.855z",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeOpacity:1,strokeWidth:4.4649702399999995,paintOrder:"normal",style:{mixBlendMode:"normal"},transform:"translate(-58.835 -133.808) translate(53.705 -18.313) scale(1.10427)"}),s.jsxs("g",{fill:"currentColor",fillRule:"nonzero",stroke:"none",strokeWidth:.662,fillOpacity:1,children:[s.jsx("path",{d:"M-532.348 630.303a6.253 6.253 0 11-12.506.023 6.253 6.253 0 0112.506-.023",transform:"translate(-58.835 -133.808) translate(53.705 -18.313) scale(1.10427) matrix(.25113 0 0 .25263 -27.6 133.42) matrix(1.51171 0 0 1.50275 1044.41 -860.854)"}),s.jsx("path",{d:"M-532.348 630.303a6.253 6.253 0 11-12.506.023 6.253 6.253 0 0112.506-.023",transform:"translate(-58.835 -133.808) translate(53.705 -18.313) scale(1.10427) matrix(.25113 0 0 .25263 -27.6 133.42) matrix(1.51171 0 0 1.50275 992.8 -860.854)"}),s.jsx("path",{d:"M-532.348 630.303a6.253 6.253 0 11-12.506.023 6.253 6.253 0 0112.506-.023",transform:"translate(-58.835 -133.808) translate(53.705 -18.313) scale(1.10427) matrix(.25113 0 0 .25263 -27.6 133.42) matrix(1.51171 0 0 1.50275 1018.605 -860.854)"})]})]})}),mD=({message:u})=>{const{setPayload:D,send:f,setWebviewUrl:e}=ou(),t=hu(),{colors:n}=Fu(),r=(a,F)=>{F.type==="web_url"&&F.url?F.messenger_extensions?e(F.url):window.open(F.url,"_blank"):F.type==="postback"&&(D({text:F.title,payload:F.payload}),f({event:a,source:"post-back",data:{type:yu.postback,data:{text:F.title,payload:F.payload}}}),t.autoFlush&&D(null))};if(!("buttons"in u.data))throw new Error("Unable to find buttons");return s.jsx("div",{className:"sc-message--buttons",children:u.data.buttons.map((a,F)=>s.jsx("button",{className:"sc-message--buttons-content",onClick:o=>r(o,a),style:{borderColor:n.button.border,color:n.button.text,backgroundColor:n.button.bg},children:a.title},F))})},le=(u,D=100)=>u.length>D?u.substr(0,D)+"...":u,Ee=u=>u.replace(/\n/g,"<br />"),he=u=>{let D=le(u,50);return D=Ee(u),D},be=({message:u})=>s.jsx("div",{className:"sc-message--carousel-element-wrapper",children:s.jsxs("div",{className:"sc-message--carousel-element",children:[u.image_url&&s.jsx("div",{className:"sc-message--carousel-element-image",style:{backgroundImage:`url('${u.image_url}')`}}),s.jsxs("div",{className:"sc-message--carousel-element-description",children:[s.jsx("h3",{className:"sc-message--carousel-title",children:u.title}),u.subtitle&&s.jsx("p",{dangerouslySetInnerHTML:{__html:he(u.subtitle)}})]}),u.buttons&&s.jsx(mD,{message:{data:{buttons:u.buttons}}})]})}),pe=({messageCarousel:u})=>{const{colors:D}=Fu(),[f,e]=c.useState(0),t=u.data.elements,n=()=>{e(o=>(o+t.length-1)%t.length)},r=()=>{e(o=>(o+1)%t.length)},a=D[u.direction||"received"],F=t.length>1;return s.jsxs("div",{className:"sc-message--carousel",style:{color:a.text,backgroundColor:a.bg},children:[s.jsx("div",{className:"sc-message--carousel-inner",style:{transform:`translateX(-${f*100}%)`},children:t.map((o,d)=>s.jsx(be,{message:o,idx:d},d))}),F&&s.jsxs(s.Fragment,{children:[s.jsx("button",{className:"sc-message--carousel-control prev",onClick:n,children:"❮"}),s.jsx("button",{className:"sc-message--carousel-control next",onClick:r,children:"❯"})]})]})},Be=({viewBox:u="0 0 512 512",...D})=>s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:u,...D,children:s.jsxs("g",{"data-name":"1",children:[s.jsx("path",{d:"M378.83 450H150a50.17 50.17 0 01-50.11-50.11V98.11A50.17 50.17 0 01150 48h150.1a15 15 0 0110.61 4.39l113.84 113.88a15 15 0 014.39 10.61v223A50.17 50.17 0 01378.83 450zM150 78a20.13 20.13 0 00-20.11 20.11v301.78A20.13 20.13 0 00150 420h228.83a20.13 20.13 0 0020.11-20.11v-216.8L293.85 78z"}),s.jsx("path",{d:"M413.94 191.88h-78.77a50.17 50.17 0 01-50.11-50.11V63a15 15 0 0130 0v78.77a20.13 20.13 0 0020.11 20.11h78.77a15 15 0 010 30zM264.4 375a15 15 0 01-10.61-4.4l-54.45-54.44a15 15 0 1121.21-21.22l43.85 43.84 43.84-43.84a15 15 0 1121.21 21.22L275 370.55a15 15 0 01-10.6 4.45z"}),s.jsx("path",{d:"M264.4 365a15 15 0 01-15-15V231a15 15 0 0130 0v119a15 15 0 01-15 15z"})]})}),ge=({message:u})=>{const{t:D}=Su(),{colors:f}=Fu(),e=f[u.direction||Z.received];if(!("type"in u.data))throw new Error("Unable to detect type for file message");if(u.data&&u.data.type!=="image"&&u.data.type!=="audio"&&u.data.type!=="video"&&u.data.type!=="file")throw new Error("Uknown type for file message");return s.jsxs("div",{className:"sc-message--file",style:{color:e.text,backgroundColor:e.bg},children:[u.data.type==="image"&&s.jsx("div",{className:"sc-message--file-icon",children:s.jsx("img",{src:u.data.url||"",className:"sc-image",alt:"File"})}),u.data.type==="audio"&&s.jsx("div",{className:"sc-message--file-audio",children:s.jsxs("audio",{controls:!0,children:[s.jsx("source",{src:u.data.url}),D("messages.file_message.browser_audio_unsupport")]})}),u.data.type==="video"&&s.jsx("div",{className:"sc-message--file-video",children:s.jsxs("video",{controls:!0,width:"100%",children:[s.jsx("source",{src:u.data.url}),D("messages.file_message.browser_video_unsupport")]})}),u.data.type==="file"&&s.jsx("div",{className:"sc-message--file-download",style:{color:e.text,backgroundColor:e.bg},children:s.jsxs("a",{href:u.data.url?u.data.url:"#",target:"_blank",rel:"noopener noreferrer",download:!0,children:[s.jsx(Be,{}),D("messages.file_message.download")]})})]})},me=({message:u})=>{var o;const{colors:D}=Fu(),f=Nu(),[e,t]=c.useState(!1),n=c.useRef(null);if(c.useEffect(()=>{const d=new IntersectionObserver(l=>{!e&&l[0].intersectionRatio>0&&t(!0)});return n.current&&d.observe(n.current),()=>{n.current&&d.unobserve(n.current)}},[e]),c.useEffect(()=>{e&&f&&f.scroll>85&&(f.scroll=101)},[e,f]),!("coordinates"in u.data))throw new Error("Unable to find coordinates");const r=((o=u.data)==null?void 0:o.coordinates)||{lat:0,lng:0},a=`https://www.openstreetmap.org/export/embed.html?bbox=${r.lng-.1},${r.lat-.1},${r.lng+.1},${r.lat+.1}&layer=mapnik&marker=${r.lat},${r.lng}`,F=D[u.direction||Z.received];return s.jsx("div",{className:"sc-message--location",style:{color:F.text,backgroundColor:F.bg},ref:n,children:e&&s.jsx("iframe",{loading:"lazy",frameBorder:"0",scrolling:"no",marginHeight:0,marginWidth:0,src:a,className:"sc-message-map"})})},_e=({messageList:u})=>{const{colors:D}=Fu(),f=r=>{let a=e(r,50);return a=t(r),a},e=(r,a=100)=>r.length>a?r.substr(0,a)+"...":r,t=r=>r.replace(/\n/g,"<br />");if(!("elements"in u.data))throw new Error("Unable to find elements");const n=D[u.direction||Z.received];return s.jsxs("div",{className:"sc-message--list",style:{color:n.text,backgroundColor:n.bg},children:[u.data.elements.map((r,a)=>{const F=a===0&&"top_element_style"in u.data&&u.data.top_element_style==="large"?"large":"compact";return s.jsxs("div",{className:"sc-message--list-element",style:{borderColor:D.messageList.bg},children:[s.jsxs("div",{className:`sc-message--list-element-content ${F}`,children:[r.image_url&&s.jsx("div",{className:"sc-message--list-element-image",style:{backgroundImage:`url('${r.image_url}')`},children:F==="large"&&s.jsxs("div",{className:"sc-message--list-element-description",children:[s.jsx("h3",{className:"sc-message--title",children:r.title}),r.subtitle&&s.jsx("p",{dangerouslySetInnerHTML:{__html:f(r.subtitle)}})]})}),F==="compact"&&s.jsxs("div",{className:"sc-message--list-element-description",children:[s.jsx("h3",{className:"sc-message--title",children:r.title}),r.subtitle&&s.jsx("p",{dangerouslySetInnerHTML:{__html:f(r.subtitle)}})]})]}),r.buttons&&s.jsx(mD,{message:{data:{buttons:r.buttons}}})]},a)}),"buttons"in u.data&&Array.isArray(u.data.buttons)&&u.data.buttons.length>0&&s.jsx("div",{className:"sc-message--list-element-bottom",children:s.jsx(mD,{message:u})})]})};var Df=function(u,D){return Df=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(f,e){f.__proto__=e}||function(f,e){for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(f[t]=e[t])},Df(u,D)};function aD(u,D){if(typeof D!="function"&&D!==null)throw new TypeError("Class extends value "+String(D)+" is not a constructor or null");Df(u,D);function f(){this.constructor=u}u.prototype=D===null?Object.create(D):(f.prototype=D.prototype,new f)}var iu=function(){return iu=Object.assign||function(D){for(var f,e=1,t=arguments.length;e<t;e++){f=arguments[e];for(var n in f)Object.prototype.hasOwnProperty.call(f,n)&&(D[n]=f[n])}return D},iu.apply(this,arguments)};function ye(u,D){var f=typeof Symbol=="function"&&u[Symbol.iterator];if(!f)return u;var e=f.call(u),t,n=[],r;try{for(;(D===void 0||D-- >0)&&!(t=e.next()).done;)n.push(t.value)}catch(a){r={error:a}}finally{try{t&&!t.done&&(f=e.return)&&f.call(e)}finally{if(r)throw r.error}}return n}function ve(u,D,f){if(f||arguments.length===2)for(var e=0,t=D.length,n;e<t;e++)(n||!(e in D))&&(n||(n=Array.prototype.slice.call(D,0,e)),n[e]=D[e]);return u.concat(n||Array.prototype.slice.call(D))}typeof SuppressedError=="function"&&SuppressedError;var we="4.1.5",Ae=Object.prototype.hasOwnProperty;function wu(u){return typeof u=="boolean"}function xe(u,D,f){var e;return u.length>D&&(f==null?(f="…",e=3):e=f.length,u=u.substring(0,D-e)+f),u}function Yu(u,D){for(var f=u.length-1;f>=0;f--)D(u[f])===!0&&u.splice(f,1)}function $u(u){throw new Error("Unhandled case for value: '".concat(u,"'"))}var _D=/\s+/,c1=function(){function u(D){D===void 0&&(D={}),this.tagName="",this.attrs={},this.innerHTML="",this.tagName=D.tagName||"",this.attrs=D.attrs||{},this.innerHTML=D.innerHtml||D.innerHTML||""}return u.prototype.setTagName=function(D){return this.tagName=D,this},u.prototype.getTagName=function(){return this.tagName},u.prototype.setAttr=function(D,f){var e=this.getAttrs();return e[D]=f,this},u.prototype.getAttr=function(D){return this.getAttrs()[D]},u.prototype.setAttrs=function(D){return Object.assign(this.getAttrs(),D),this},u.prototype.getAttrs=function(){return this.attrs},u.prototype.setClass=function(D){return this.setAttr("class",D)},u.prototype.addClass=function(D){for(var f=this.getClass(),e=f?f.split(_D):[],t=D.split(_D),n;n=t.shift();)e.indexOf(n)===-1&&e.push(n);return this.getAttrs().class=e.join(" "),this},u.prototype.removeClass=function(D){for(var f=this.getClass(),e=f?f.split(_D):[],t=D.split(_D),n;e.length&&(n=t.shift());){var r=e.indexOf(n);r!==-1&&e.splice(r,1)}return this.getAttrs().class=e.join(" "),this},u.prototype.getClass=function(){return this.getAttrs().class||""},u.prototype.hasClass=function(D){return(" "+this.getClass()+" ").indexOf(" "+D+" ")!==-1},u.prototype.setInnerHTML=function(D){return this.innerHTML=D,this},u.prototype.setInnerHtml=function(D){return this.setInnerHTML(D)},u.prototype.getInnerHTML=function(){return this.innerHTML||""},u.prototype.getInnerHtml=function(){return this.getInnerHTML()},u.prototype.toAnchorString=function(){var D=this.getTagName(),f=this.buildAttrsStr();return f=f?" "+f:"",["<",D,f,">",this.getInnerHtml(),"</",D,">"].join("")},u.prototype.buildAttrsStr=function(){var D=this.getAttrs(),f=[];for(var e in D)Ae.call(D,e)&&f.push(e+'="'+D[e]+'"');return f.join(" ")},u}();function ke(u,D,f){var e,t;if(f==null?(f="…",t=3,e=8):(t=f.length,e=f.length),u.length<=D)return u;var n=D-t,r=Se(u);if(r.query){var a=r.query.match(/^(.*?)(?=(\?|#))(.*?)$/i);a&&(r.query=r.query.substr(0,a[1].length),u=l1(r))}if(u.length<=D||(r.host&&(r.host=r.host.replace(/^www\./,""),u=l1(r)),u.length<=D))return u;var F="";if(r.host&&(F+=r.host),F.length>=n)return r.host.length===D?(r.host.substr(0,D-t)+f).substr(0,n+e):ff(F,n,f).substr(0,n+e);var o="";if(r.path&&(o+="/"+r.path),r.query&&(o+="?"+r.query),o)if((F+o).length>=n){if((F+o).length==D)return(F+o).substr(0,D);var d=n-F.length;return(F+ff(o,d,f)).substr(0,n+e)}else F+=o;if(r.fragment){var l="#"+r.fragment;if((F+l).length>=n){if((F+l).length==D)return(F+l).substr(0,D);var E=n-F.length;return(F+ff(l,E,f)).substr(0,n+e)}else F+=l}if(r.scheme&&r.host){var j=r.scheme+"://";if((F+j).length<n)return(j+F).substr(0,D)}if(F.length<=D)return F;var v="";return n>0&&(v=F.substr(-1*Math.floor(n/2))),(F.substr(0,Math.ceil(n/2))+f+v).substr(0,n+e)}function Se(u){var D={},f=u,e=f.match(/^([a-z]+):\/\//i);return e&&(D.scheme=e[1],f=f.slice(e[0].length)),e=f.match(/^(.*?)(?=(\?|#|\/|$))/i),e&&(D.host=e[1],f=f.slice(e[0].length)),e=f.match(/^\/(.*?)(?=(\?|#|$))/i),e&&(D.path=e[1],f=f.slice(e[0].length)),e=f.match(/^\?(.*?)(?=(#|$))/i),e&&(D.query=e[1],f=f.slice(e[0].length)),e=f.match(/^#(.*?)$/i),e&&(D.fragment=e[1]),D}function l1(u){var D="";return u.scheme&&u.host&&(D+=u.scheme+"://"),u.host&&(D+=u.host),u.path&&(D+="/"+u.path),u.query&&(D+="?"+u.query),u.fragment&&(D+="#"+u.fragment),D}function ff(u,D,f){var e=D/2,t=Math.ceil(e),n=-1*Math.floor(e),r="";return n<0&&(r=u.substr(n)),u.substr(0,t)+f+r}function je(u,D,f){if(u.length<=D)return u;var e,t;f==null?(f="…",e=8,t=3):(e=f.length,t=f.length);var n=D-t,r="";return n>0&&(r=u.substr(-1*Math.floor(n/2))),(u.substr(0,Math.ceil(n/2))+f+r).substr(0,n+e)}function Te(u,D,f){return xe(u,D,f)}var Ne=function(){function u(D){D===void 0&&(D={}),this.newWindow=!1,this.truncate={},this.className="",this.newWindow=D.newWindow||!1,this.truncate=D.truncate||{},this.className=D.className||""}return u.prototype.build=function(D){return new c1({tagName:"a",attrs:this.createAttrs(D),innerHtml:this.processAnchorText(D.getAnchorText())})},u.prototype.createAttrs=function(D){var f={href:D.getAnchorHref()},e=this.createCssClass(D);return e&&(f.class=e),this.newWindow&&(f.target="_blank",f.rel="noopener noreferrer"),this.truncate.length&&this.truncate.length<D.getAnchorText().length&&(f.title=D.getAnchorHref()),f},u.prototype.createCssClass=function(D){var f=this.className;if(f){for(var e=[f],t=D.getCssClassSuffixes(),n=0,r=t.length;n<r;n++)e.push(f+"-"+t[n]);return e.join(" ")}else return""},u.prototype.processAnchorText=function(D){return D=this.doTruncate(D),D},u.prototype.doTruncate=function(D){var f=this.truncate;if(!f.length)return D;var e=f.length,t=f.location;return t==="smart"?ke(D,e):t==="middle"?je(D,e):Te(D,e)},u}(),FD=function(){function u(D){this._=null,this.matchedText="",this.offset=0,this.tagBuilder=D.tagBuilder,this.matchedText=D.matchedText,this.offset=D.offset}return u.prototype.getMatchedText=function(){return this.matchedText},u.prototype.setOffset=function(D){this.offset=D},u.prototype.getOffset=function(){return this.offset},u.prototype.getCssClassSuffixes=function(){return[this.type]},u.prototype.buildTag=function(){return this.tagBuilder.build(this)},u}();function Re(u){return u>=0&&u<=31||u==127}function DD(u){return u>=65&&u<=90||u>=97&&u<=122}function Cu(u){return u>=48&&u<=57}function ef(u){return u==34||u==39}function Ku(u){return u<8232?u<160?u>=9&&u<=13||u==32:u<5760?u==160:u==5760||u>=8192&&u<=8202:u<8287?u>=8232&&u<=8233||u==8239:u<12288?u==8287:u==12288||u==65279}function Ju(u){return u<4800?u<2949?u<2451?u<1425?u<768?u<192?u<169?u<65?u>=48&&u<=57:u>=65&&u<=90||u>=97&&u<=122:u<181?u>=169&&u<=170||u==174:u==181||u==186:u<710?u<216?u>=192&&u<=214:u>=216&&u<=246||u>=248&&u<=705:u<748?u>=710&&u<=721||u>=736&&u<=740:u==748||u==750:u<910?u<895?u<886?u>=768&&u<=884:u>=886&&u<=887||u>=890&&u<=893:u<904?u==895||u==902:u>=904&&u<=906||u==908:u<1155?u<931?u>=910&&u<=929:u>=931&&u<=1013||u>=1015&&u<=1153:u<1369?u>=1155&&u<=1327||u>=1329&&u<=1366:u==1369||u>=1377&&u<=1415:u<1808?u<1552?u<1476?u<1471?u>=1425&&u<=1469:u==1471||u>=1473&&u<=1474:u<1488?u>=1476&&u<=1477||u==1479:u>=1488&&u<=1514||u>=1520&&u<=1522:u<1749?u<1568?u>=1552&&u<=1562:u>=1568&&u<=1641||u>=1646&&u<=1747:u<1770?u>=1749&&u<=1756||u>=1759&&u<=1768:u>=1770&&u<=1788||u==1791:u<2230?u<2042?u<1869?u>=1808&&u<=1866:u>=1869&&u<=1969||u>=1984&&u<=2037:u<2112?u==2042||u>=2048&&u<=2093:u>=2112&&u<=2139||u>=2208&&u<=2228:u<2406?u<2260?u>=2230&&u<=2237:u>=2260&&u<=2273||u>=2275&&u<=2403:u<2437?u>=2406&&u<=2415||u>=2417&&u<=2435:u>=2437&&u<=2444||u>=2447&&u<=2448:u<2693?u<2579?u<2519?u<2486?u<2474?u>=2451&&u<=2472:u>=2474&&u<=2480||u==2482:u<2503?u>=2486&&u<=2489||u>=2492&&u<=2500:u>=2503&&u<=2504||u>=2507&&u<=2510:u<2534?u<2524?u==2519:u>=2524&&u<=2525||u>=2527&&u<=2531:u<2565?u>=2534&&u<=2545||u>=2561&&u<=2563:u>=2565&&u<=2570||u>=2575&&u<=2576:u<2631?u<2613?u<2602?u>=2579&&u<=2600:u>=2602&&u<=2608||u>=2610&&u<=2611:u<2620?u>=2613&&u<=2614||u>=2616&&u<=2617:u==2620||u>=2622&&u<=2626:u<2649?u<2635?u>=2631&&u<=2632:u>=2635&&u<=2637||u==2641:u<2662?u>=2649&&u<=2652||u==2654:u>=2662&&u<=2677||u>=2689&&u<=2691:u<2821?u<2759?u<2730?u<2703?u>=2693&&u<=2701:u>=2703&&u<=2705||u>=2707&&u<=2728:u<2741?u>=2730&&u<=2736||u>=2738&&u<=2739:u>=2741&&u<=2745||u>=2748&&u<=2757:u<2784?u<2763?u>=2759&&u<=2761:u>=2763&&u<=2765||u==2768:u<2809?u>=2784&&u<=2787||u>=2790&&u<=2799:u==2809||u>=2817&&u<=2819:u<2887?u<2858?u<2831?u>=2821&&u<=2828:u>=2831&&u<=2832||u>=2835&&u<=2856:u<2869?u>=2858&&u<=2864||u>=2866&&u<=2867:u>=2869&&u<=2873||u>=2876&&u<=2884:u<2911?u<2902?u>=2887&&u<=2888||u>=2891&&u<=2893:u>=2902&&u<=2903||u>=2908&&u<=2909:u<2929?u>=2911&&u<=2915||u>=2918&&u<=2927:u==2929||u>=2946&&u<=2947:u<3517?u<3205?u<3046?u<2984?u<2969?u<2958?u>=2949&&u<=2954:u>=2958&&u<=2960||u>=2962&&u<=2965:u<2974?u>=2969&&u<=2970||u==2972:u>=2974&&u<=2975||u>=2979&&u<=2980:u<3014?u<2990?u>=2984&&u<=2986:u>=2990&&u<=3001||u>=3006&&u<=3010:u<3024?u>=3014&&u<=3016||u>=3018&&u<=3021:u==3024||u==3031:u<3142?u<3086?u<3072?u>=3046&&u<=3055:u>=3072&&u<=3075||u>=3077&&u<=3084:u<3114?u>=3086&&u<=3088||u>=3090&&u<=3112:u>=3114&&u<=3129||u>=3133&&u<=3140:u<3160?u<3146?u>=3142&&u<=3144:u>=3146&&u<=3149||u>=3157&&u<=3158:u<3174?u>=3160&&u<=3162||u>=3168&&u<=3171:u>=3174&&u<=3183||u>=3200&&u<=3203:u<3333?u<3274?u<3242?u<3214?u>=3205&&u<=3212:u>=3214&&u<=3216||u>=3218&&u<=3240:u<3260?u>=3242&&u<=3251||u>=3253&&u<=3257:u>=3260&&u<=3268||u>=3270&&u<=3272:u<3296?u<3285?u>=3274&&u<=3277:u>=3285&&u<=3286||u==3294:u<3313?u>=3296&&u<=3299||u>=3302&&u<=3311:u>=3313&&u<=3314||u>=3329&&u<=3331:u<3423?u<3389?u<3342?u>=3333&&u<=3340:u>=3342&&u<=3344||u>=3346&&u<=3386:u<3402?u>=3389&&u<=3396||u>=3398&&u<=3400:u>=3402&&u<=3406||u>=3412&&u<=3415:u<3458?u<3430?u>=3423&&u<=3427:u>=3430&&u<=3439||u>=3450&&u<=3455:u<3482?u>=3458&&u<=3459||u>=3461&&u<=3478:u>=3482&&u<=3505||u>=3507&&u<=3515:u<3804?u<3722?u<3570?u<3535?u<3520?u==3517:u>=3520&&u<=3526||u==3530:u<3544?u>=3535&&u<=3540||u==3542:u>=3544&&u<=3551||u>=3558&&u<=3567:u<3664?u<3585?u>=3570&&u<=3571:u>=3585&&u<=3642||u>=3648&&u<=3662:u<3716?u>=3664&&u<=3673||u>=3713&&u<=3714:u==3716||u>=3719&&u<=3720:u<3754?u<3737?u<3725?u==3722:u==3725||u>=3732&&u<=3735:u<3749?u>=3737&&u<=3743||u>=3745&&u<=3747:u==3749||u==3751:u<3776?u<3757?u>=3754&&u<=3755:u>=3757&&u<=3769||u>=3771&&u<=3773:u<3784?u>=3776&&u<=3780||u==3782:u>=3784&&u<=3789||u>=3792&&u<=3801:u<4176?u<3902?u<3872?u<3840?u>=3804&&u<=3807:u==3840||u>=3864&&u<=3865:u<3895?u>=3872&&u<=3881||u==3893:u==3895||u==3897:u<3974?u<3913?u>=3902&&u<=3911:u>=3913&&u<=3948||u>=3953&&u<=3972:u<4038?u>=3974&&u<=3991||u>=3993&&u<=4028:u==4038||u>=4096&&u<=4169:u<4688?u<4301?u<4256?u>=4176&&u<=4253:u>=4256&&u<=4293||u==4295:u<4348?u==4301||u>=4304&&u<=4346:u>=4348&&u<=4680||u>=4682&&u<=4685:u<4746?u<4698?u>=4688&&u<=4694||u==4696:u>=4698&&u<=4701||u>=4704&&u<=4744:u<4786?u>=4746&&u<=4749||u>=4752&&u<=4784:u>=4786&&u<=4789||u>=4792&&u<=4798:u<11035?u<7416?u<6176?u<5873?u<4992?u<4824?u<4802?u==4800:u>=4802&&u<=4805||u>=4808&&u<=4822:u<4888?u>=4824&&u<=4880||u>=4882&&u<=4885:u>=4888&&u<=4954||u>=4957&&u<=4959:u<5121?u<5024?u>=4992&&u<=5007:u>=5024&&u<=5109||u>=5112&&u<=5117:u<5761?u>=5121&&u<=5740||u>=5743&&u<=5759:u>=5761&&u<=5786||u>=5792&&u<=5866:u<6002?u<5920?u<5888?u>=5873&&u<=5880:u>=5888&&u<=5900||u>=5902&&u<=5908:u<5984?u>=5920&&u<=5940||u>=5952&&u<=5971:u>=5984&&u<=5996||u>=5998&&u<=6e3:u<6108?u<6016?u>=6002&&u<=6003:u>=6016&&u<=6099||u==6103:u<6155?u>=6108&&u<=6109||u>=6112&&u<=6121:u>=6155&&u<=6157||u>=6160&&u<=6169:u<6783?u<6512?u<6400?u<6272?u>=6176&&u<=6263:u>=6272&&u<=6314||u>=6320&&u<=6389:u<6448?u>=6400&&u<=6430||u>=6432&&u<=6443:u>=6448&&u<=6459||u>=6470&&u<=6509:u<6608?u<6528?u>=6512&&u<=6516:u>=6528&&u<=6571||u>=6576&&u<=6601:u<6688?u>=6608&&u<=6617||u>=6656&&u<=6683:u>=6688&&u<=6750||u>=6752&&u<=6780:u<7040?u<6832?u<6800?u>=6783&&u<=6793:u>=6800&&u<=6809||u==6823:u<6992?u>=6832&&u<=6846||u>=6912&&u<=6987:u>=6992&&u<=7001||u>=7019&&u<=7027:u<7245?u<7168?u>=7040&&u<=7155:u>=7168&&u<=7223||u>=7232&&u<=7241:u<7376?u>=7245&&u<=7293||u>=7296&&u<=7304:u>=7376&&u<=7378||u>=7380&&u<=7414:u<8450?u<8130?u<8025?u<7960?u<7424?u>=7416&&u<=7417:u>=7424&&u<=7669||u>=7675&&u<=7957:u<8008?u>=7960&&u<=7965||u>=7968&&u<=8005:u>=8008&&u<=8013||u>=8016&&u<=8023:u<8031?u<8027?u==8025:u==8027||u==8029:u<8118?u>=8031&&u<=8061||u>=8064&&u<=8116:u>=8118&&u<=8124||u==8126:u<8205?u<8150?u<8134?u>=8130&&u<=8132:u>=8134&&u<=8140||u>=8144&&u<=8147:u<8178?u>=8150&&u<=8155||u>=8160&&u<=8172:u>=8178&&u<=8180||u>=8182&&u<=8188:u<8305?u<8252?u==8205:u==8252||u==8265:u<8336?u==8305||u==8319:u>=8336&&u<=8348||u>=8400&&u<=8432:u<8579?u<8486?u<8469?u<8455?u==8450:u==8455||u>=8458&&u<=8467:u<8482?u==8469||u>=8473&&u<=8477:u==8482||u==8484:u<8495?u<8488?u==8486:u==8488||u>=8490&&u<=8493:u<8517?u>=8495&&u<=8505||u>=8508&&u<=8511:u>=8517&&u<=8521||u==8526:u<9410?u<9e3?u<8592?u>=8579&&u<=8580:u>=8592&&u<=8703||u>=8986&&u<=8987:u<9193?u==9e3||u==9167:u>=9193&&u<=9203||u>=9208&&u<=9210:u<9723?u<9654?u==9410||u>=9642&&u<=9643:u==9654||u==9664:u<10548?u>=9723&&u<=9726||u>=9728&&u<=10175:u>=10548&&u<=10549||u>=11013&&u<=11015:u<43259?u<12445?u<11688?u<11520?u<11264?u<11088?u>=11035&&u<=11036:u==11088||u==11093:u<11360?u>=11264&&u<=11310||u>=11312&&u<=11358:u>=11360&&u<=11492||u>=11499&&u<=11507:u<11568?u<11559?u>=11520&&u<=11557:u==11559||u==11565:u<11647?u>=11568&&u<=11623||u==11631:u>=11647&&u<=11670||u>=11680&&u<=11686:u<11744?u<11712?u<11696?u>=11688&&u<=11694:u>=11696&&u<=11702||u>=11704&&u<=11710:u<11728?u>=11712&&u<=11718||u>=11720&&u<=11726:u>=11728&&u<=11734||u>=11736&&u<=11742:u<12330?u<11823?u>=11744&&u<=11775:u==11823||u>=12293&&u<=12294:u<12353?u>=12330&&u<=12341||u>=12347&&u<=12349:u>=12353&&u<=12438||u>=12441&&u<=12442:u<42512?u<12951?u<12549?u<12449?u>=12445&&u<=12447:u>=12449&&u<=12538||u>=12540&&u<=12543:u<12704?u>=12549&&u<=12589||u>=12593&&u<=12686:u>=12704&&u<=12730||u>=12784&&u<=12799:u<19968?u<12953?u==12951:u==12953||u>=13312&&u<=19893:u<42192?u>=19968&&u<=40917||u>=40960&&u<=42124:u>=42192&&u<=42237||u>=42240&&u<=42508:u<42891?u<42623?u<42560?u>=42512&&u<=42539:u>=42560&&u<=42610||u>=42612&&u<=42621:u<42775?u>=42623&&u<=42725||u>=42736&&u<=42737:u>=42775&&u<=42783||u>=42786&&u<=42888:u<43072?u<42928?u>=42891&&u<=42926:u>=42928&&u<=42935||u>=42999&&u<=43047:u<43216?u>=43072&&u<=43123||u>=43136&&u<=43205:u>=43216&&u<=43225||u>=43232&&u<=43255:u<55243?u<43744?u<43488?u<43312?u<43261?u==43259:u==43261||u>=43264&&u<=43309:u<43392?u>=43312&&u<=43347||u>=43360&&u<=43388:u>=43392&&u<=43456||u>=43471&&u<=43481:u<43600?u<43520?u>=43488&&u<=43518:u>=43520&&u<=43574||u>=43584&&u<=43597:u<43642?u>=43600&&u<=43609||u>=43616&&u<=43638:u>=43642&&u<=43714||u>=43739&&u<=43741:u<43824?u<43785?u<43762?u>=43744&&u<=43759:u>=43762&&u<=43766||u>=43777&&u<=43782:u<43808?u>=43785&&u<=43790||u>=43793&&u<=43798:u>=43808&&u<=43814||u>=43816&&u<=43822:u<44012?u<43868?u>=43824&&u<=43866:u>=43868&&u<=43877||u>=43888&&u<=44010:u<44032?u>=44012&&u<=44013||u>=44016&&u<=44025:u>=44032&&u<=55203||u>=55216&&u<=55238:u<64848?u<64298?u<64112?u<55296?u>=55243&&u<=55291:u>=55296&&u<=57343||u>=63744&&u<=64109:u<64275?u>=64112&&u<=64217||u>=64256&&u<=64262:u>=64275&&u<=64279||u>=64285&&u<=64296:u<64320?u<64312?u>=64298&&u<=64310:u>=64312&&u<=64316||u==64318:u<64326?u>=64320&&u<=64321||u>=64323&&u<=64324:u>=64326&&u<=64433||u>=64467&&u<=64829:u<65296?u<65024?u<64914?u>=64848&&u<=64911:u>=64914&&u<=64967||u>=65008&&u<=65019:u<65136?u>=65024&&u<=65039||u>=65056&&u<=65071:u>=65136&&u<=65140||u>=65142&&u<=65276:u<65474?u<65345?u>=65296&&u<=65305||u>=65313&&u<=65338:u>=65345&&u<=65370||u>=65382&&u<=65470:u<65490?u>=65474&&u<=65479||u>=65482&&u<=65487:u>=65490&&u<=65495||u>=65498&&u<=65500}function Oe(u){return u<47?u<42?u==33||u>=35&&u<=39:u>=42&&u<=43||u==45:u<63?u==47||u==61:u<94?u==63:u>=94&&u<=96||u>=123&&u<=126}function Pe(u){return u<91?u<47?u>=35&&u<=43||u==45:u<61?u==47:u==61||u==64:u<95?u==91||u==93:u<123?u==95:u>=123&&u<=126||u==10003}function E1(u){return u<58?u<44?u==33:u==44||u==46:u<63?u>=58&&u<=59:u==63||u==94}function Ie(u){return u<91?u==40:u==91||u==123}function h1(u){return u<93?u==41:u==93||u==125}var Le=/^(?:xn--vermgensberatung-pwb|xn--vermgensberater-ctb|xn--clchc0ea0b2g2a9gcd|xn--w4r85el8fhu5dnra|travelersinsurance|vermögensberatung|xn--5su34j936bgsg|xn--bck1b9a5dre4c|xn--mgbah1a3hjkrd|xn--mgbai9azgqp6j|xn--mgberp4a5d4ar|xn--xkc2dl3a5ee0h|vermögensberater|xn--fzys8d69uvgm|xn--mgba7c0bbn0a|xn--mgbcpq6gpa1a|xn--xkc2al3hye2a|americanexpress|kerryproperties|sandvikcoromant|xn--i1b6b1a6a2e|xn--kcrx77d1x4a|xn--lgbbat1ad8j|xn--mgba3a4f16a|xn--mgbc0a9azcg|xn--nqv7fs00ema|americanfamily|weatherchannel|xn--54b7fta0cc|xn--6qq986b3xl|xn--80aqecdr1a|xn--b4w605ferd|xn--fiq228c5hs|xn--h2breg3eve|xn--jlq480n2rg|xn--mgba3a3ejt|xn--mgbaam7a8h|xn--mgbayh7gpa|xn--mgbbh1a71e|xn--mgbca7dzdo|xn--mgbi4ecexp|xn--mgbx4cd0ab|xn--rvc1e0am3e|international|lifeinsurance|wolterskluwer|xn--cckwcxetd|xn--eckvdtc9d|xn--fpcrj9c3d|xn--fzc2c9e2c|xn--h2brj9c8c|xn--tiq49xqyj|xn--yfro4i67o|xn--ygbi2ammx|construction|lplfinancial|scholarships|versicherung|xn--3e0b707e|xn--45br5cyl|xn--4dbrk0ce|xn--80adxhks|xn--80asehdb|xn--8y0a063a|xn--gckr3f0f|xn--mgb9awbf|xn--mgbab2bd|xn--mgbgu82a|xn--mgbpl2fh|xn--mgbt3dhd|xn--mk1bu44c|xn--ngbc5azd|xn--ngbe9e0a|xn--ogbpf8fl|xn--qcka1pmc|accountants|barclaycard|blackfriday|blockbuster|bridgestone|calvinklein|contractors|creditunion|engineering|enterprises|investments|kerryhotels|lamborghini|motorcycles|olayangroup|photography|playstation|productions|progressive|redumbrella|williamhill|xn--11b4c3d|xn--1ck2e1b|xn--1qqw23a|xn--2scrj9c|xn--3bst00m|xn--3ds443g|xn--3hcrj9c|xn--42c2d9a|xn--45brj9c|xn--55qw42g|xn--6frz82g|xn--80ao21a|xn--9krt00a|xn--cck2b3b|xn--czr694b|xn--d1acj3b|xn--efvy88h|xn--fct429k|xn--fjq720a|xn--flw351e|xn--g2xx48c|xn--gecrj9c|xn--gk3at1e|xn--h2brj9c|xn--hxt814e|xn--imr513n|xn--j6w193g|xn--jvr189m|xn--kprw13d|xn--kpry57d|xn--mgbbh1a|xn--mgbtx2b|xn--mix891f|xn--nyqy26a|xn--otu796d|xn--pgbs0dh|xn--q9jyb4c|xn--rhqv96g|xn--rovu88b|xn--s9brj9c|xn--ses554g|xn--t60b56a|xn--vuq861b|xn--w4rs40l|xn--xhq521b|xn--zfr164b|சிங்கப்பூர்|accountant|apartments|associates|basketball|bnpparibas|boehringer|capitalone|consulting|creditcard|cuisinella|eurovision|extraspace|foundation|healthcare|immobilien|industries|management|mitsubishi|nextdirect|properties|protection|prudential|realestate|republican|restaurant|schaeffler|tatamotors|technology|university|vlaanderen|xn--30rr7y|xn--3pxu8k|xn--45q11c|xn--4gbrim|xn--55qx5d|xn--5tzm5g|xn--80aswg|xn--90a3ac|xn--9dbq2a|xn--9et52u|xn--c2br7g|xn--cg4bki|xn--czrs0t|xn--czru2d|xn--fiq64b|xn--fiqs8s|xn--fiqz9s|xn--io0a7i|xn--kput3i|xn--mxtq1m|xn--o3cw4h|xn--pssy2u|xn--q7ce6a|xn--unup4y|xn--wgbh1c|xn--wgbl6a|xn--y9a3aq|accenture|allfinanz|amsterdam|analytics|aquarelle|barcelona|bloomberg|christmas|community|directory|education|equipment|fairwinds|financial|firestone|fresenius|furniture|goldpoint|hisamitsu|homedepot|homegoods|homesense|institute|insurance|kuokgroup|landrover|lifestyle|marketing|marshalls|melbourne|microsoft|panasonic|pramerica|richardli|shangrila|solutions|statebank|statefarm|stockholm|travelers|vacations|xn--90ais|xn--c1avg|xn--d1alf|xn--e1a4c|xn--fhbei|xn--j1aef|xn--j1amh|xn--l1acc|xn--ngbrx|xn--nqv7f|xn--p1acf|xn--qxa6a|xn--tckwe|xn--vhquv|yodobashi|موريتانيا|abudhabi|airforce|allstate|attorney|barclays|barefoot|bargains|baseball|boutique|bradesco|broadway|brussels|builders|business|capetown|catering|catholic|cipriani|cleaning|clinique|clothing|commbank|computer|delivery|deloitte|democrat|diamonds|discount|discover|download|engineer|ericsson|exchange|feedback|fidelity|firmdale|football|frontier|goodyear|grainger|graphics|hdfcbank|helsinki|holdings|hospital|infiniti|ipiranga|istanbul|jpmorgan|lighting|lundbeck|marriott|mckinsey|memorial|merckmsd|mortgage|observer|partners|pharmacy|pictures|plumbing|property|redstone|reliance|saarland|samsclub|security|services|shopping|softbank|software|stcgroup|supplies|training|vanguard|ventures|verisign|woodside|xn--90ae|xn--node|xn--p1ai|xn--qxam|yokohama|السعودية|abogado|academy|agakhan|alibaba|android|athleta|auction|audible|auspost|banamex|bauhaus|bestbuy|booking|brother|capital|caravan|careers|channel|charity|chintai|citadel|clubmed|college|cologne|company|compare|contact|cooking|corsica|country|coupons|courses|cricket|cruises|dentist|digital|domains|exposed|express|farmers|fashion|ferrari|ferrero|finance|fishing|fitness|flights|florist|flowers|forsale|frogans|fujitsu|gallery|genting|godaddy|grocery|guitars|hamburg|hangout|hitachi|holiday|hosting|hotmail|hyundai|ismaili|jewelry|juniper|kitchen|komatsu|lacaixa|lanxess|lasalle|latrobe|leclerc|limited|lincoln|markets|monster|netbank|netflix|network|neustar|okinawa|organic|origins|philips|pioneer|politie|realtor|recipes|rentals|reviews|rexroth|samsung|sandvik|schmidt|schwarz|science|shiksha|singles|staples|storage|support|surgery|systems|temasek|theater|theatre|tickets|toshiba|trading|walmart|wanggou|watches|weather|website|wedding|whoswho|windows|winners|yamaxun|youtube|zuerich|католик|البحرين|الجزائر|العليان|پاکستان|كاثوليك|இந்தியா|abbott|abbvie|africa|agency|airbus|airtel|alipay|alsace|alstom|amazon|anquan|aramco|author|bayern|beauty|berlin|bharti|bostik|boston|broker|camera|career|casino|center|chanel|chrome|church|circle|claims|clinic|coffee|comsec|condos|coupon|credit|cruise|dating|datsun|dealer|degree|dental|design|direct|doctor|dunlop|dupont|durban|emerck|energy|estate|events|expert|family|flickr|futbol|gallup|garden|george|giving|global|google|gratis|health|hermes|hiphop|hockey|hotels|hughes|imamat|insure|intuit|jaguar|joburg|juegos|kaufen|kindle|kosher|latino|lawyer|lefrak|living|locker|london|luxury|madrid|maison|makeup|market|mattel|mobile|monash|mormon|moscow|museum|nagoya|nissan|nissay|norton|nowruz|office|olayan|online|oracle|orange|otsuka|pfizer|photos|physio|pictet|quebec|racing|realty|reisen|repair|report|review|rogers|ryukyu|safety|sakura|sanofi|school|schule|search|secure|select|shouji|soccer|social|stream|studio|supply|suzuki|swatch|sydney|taipei|taobao|target|tattoo|tennis|tienda|tjmaxx|tkmaxx|toyota|travel|unicom|viajes|viking|villas|virgin|vision|voting|voyage|walter|webcam|xihuan|yachts|yandex|zappos|москва|онлайн|ابوظبي|ارامكو|الاردن|المغرب|امارات|فلسطين|مليسيا|भारतम्|இலங்கை|ファッション|actor|adult|aetna|amfam|amica|apple|archi|audio|autos|azure|baidu|beats|bible|bingo|black|boats|bosch|build|canon|cards|chase|cheap|cisco|citic|click|cloud|coach|codes|crown|cymru|dance|deals|delta|drive|dubai|earth|edeka|email|epson|faith|fedex|final|forex|forum|gallo|games|gifts|gives|glass|globo|gmail|green|gripe|group|gucci|guide|homes|honda|horse|house|hyatt|ikano|irish|jetzt|koeln|kyoto|lamer|lease|legal|lexus|lilly|loans|locus|lotte|lotto|mango|media|miami|money|movie|music|nexus|nikon|ninja|nokia|nowtv|omega|osaka|paris|parts|party|phone|photo|pizza|place|poker|praxi|press|prime|promo|quest|radio|rehab|reise|ricoh|rocks|rodeo|rugby|salon|sener|seven|sharp|shell|shoes|skype|sling|smart|smile|solar|space|sport|stada|store|study|style|sucks|swiss|tatar|tires|tirol|tmall|today|tokyo|tools|toray|total|tours|trade|trust|tunes|tushu|ubank|vegas|video|vodka|volvo|wales|watch|weber|weibo|works|world|xerox|yahoo|ישראל|ایران|بازار|بھارت|سودان|سورية|همراه|भारोत|संगठन|বাংলা|భారత్|ഭാരതം|嘉里大酒店|aarp|able|aero|akdn|ally|amex|arab|army|arpa|arte|asda|asia|audi|auto|baby|band|bank|bbva|beer|best|bike|bing|blog|blue|bofa|bond|book|buzz|cafe|call|camp|care|cars|casa|case|cash|cbre|cern|chat|citi|city|club|cool|coop|cyou|data|date|dclk|deal|dell|desi|diet|dish|docs|dvag|erni|fage|fail|fans|farm|fast|fido|film|fire|fish|flir|food|ford|free|fund|game|gbiz|gent|ggee|gift|gmbh|gold|golf|goog|guge|guru|hair|haus|hdfc|help|here|host|hsbc|icbc|ieee|imdb|immo|info|itau|java|jeep|jobs|jprs|kddi|kids|kiwi|kpmg|kred|land|lego|lgbt|lidl|life|like|limo|link|live|loan|love|ltda|luxe|maif|meet|meme|menu|mini|mint|mobi|moda|moto|name|navy|news|next|nico|nike|ollo|open|page|pars|pccw|pics|ping|pink|play|plus|pohl|porn|post|prod|prof|qpon|read|reit|rent|rest|rich|room|rsvp|ruhr|safe|sale|sarl|save|saxo|scot|seat|seek|sexy|shia|shop|show|silk|sina|site|skin|sncf|sohu|song|sony|spot|star|surf|talk|taxi|team|tech|teva|tiaa|tips|town|toys|tube|vana|visa|viva|vivo|vote|voto|wang|weir|wien|wiki|wine|work|xbox|yoga|zara|zero|zone|дети|сайт|بارت|بيتك|ڀارت|تونس|شبكة|عراق|عمان|موقع|भारत|ভারত|ভাৰত|ਭਾਰਤ|ભારત|ଭାରତ|ಭಾರತ|ලංකා|アマゾン|グーグル|クラウド|ポイント|组织机构|電訊盈科|香格里拉|aaa|abb|abc|aco|ads|aeg|afl|aig|anz|aol|app|art|aws|axa|bar|bbc|bbt|bcg|bcn|bet|bid|bio|biz|bms|bmw|bom|boo|bot|box|buy|bzh|cab|cal|cam|car|cat|cba|cbn|ceo|cfa|cfd|com|cpa|crs|dad|day|dds|dev|dhl|diy|dnp|dog|dot|dtv|dvr|eat|eco|edu|esq|eus|fan|fit|fly|foo|fox|frl|ftr|fun|fyi|gal|gap|gay|gdn|gea|gle|gmo|gmx|goo|gop|got|gov|hbo|hiv|hkt|hot|how|ibm|ice|icu|ifm|inc|ing|ink|int|ist|itv|jcb|jio|jll|jmp|jnj|jot|joy|kfh|kia|kim|kpn|krd|lat|law|lds|llc|llp|lol|lpl|ltd|man|map|mba|med|men|mil|mit|mlb|mls|mma|moe|moi|mom|mov|msd|mtn|mtr|nab|nba|nec|net|new|nfl|ngo|nhk|now|nra|nrw|ntt|nyc|obi|one|ong|onl|ooo|org|ott|ovh|pay|pet|phd|pid|pin|pnc|pro|pru|pub|pwc|red|ren|ril|rio|rip|run|rwe|sap|sas|sbi|sbs|scb|sew|sex|sfr|ski|sky|soy|spa|srl|stc|tab|tax|tci|tdk|tel|thd|tjx|top|trv|tui|tvs|ubs|uno|uol|ups|vet|vig|vin|vip|wed|win|wme|wow|wtc|wtf|xin|xxx|xyz|you|yun|zip|бел|ком|қаз|мкд|мон|орг|рус|срб|укр|հայ|קום|عرب|قطر|كوم|مصر|कॉम|नेट|คอม|ไทย|ລາວ|ストア|セール|みんな|中文网|亚马逊|天主教|我爱你|新加坡|淡马锡|飞利浦|ac|ad|ae|af|ag|ai|al|am|ao|aq|ar|as|at|au|aw|ax|az|ba|bb|bd|be|bf|bg|bh|bi|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|cr|cu|cv|cw|cx|cy|cz|de|dj|dk|dm|do|dz|ec|ee|eg|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gg|gh|gi|gl|gm|gn|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|im|in|io|iq|ir|is|it|je|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|me|mg|mh|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|mv|mw|mx|my|mz|na|nc|ne|nf|ng|ni|nl|no|np|nr|nu|nz|om|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|ps|pt|pw|py|qa|re|ro|rs|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|sk|sl|sm|sn|so|sr|ss|st|su|sv|sx|sy|sz|tc|td|tf|tg|th|tj|tk|tl|tm|tn|to|tr|tt|tv|tw|tz|ua|ug|uk|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|za|zm|zw|ελ|ευ|бг|ею|рф|გე|닷넷|닷컴|삼성|한국|コム|世界|中信|中国|中國|企业|佛山|信息|健康|八卦|公司|公益|台湾|台灣|商城|商店|商标|嘉里|在线|大拿|娱乐|家電|广东|微博|慈善|手机|招聘|政务|政府|新闻|时尚|書籍|机构|游戏|澳門|点看|移动|网址|网店|网站|网络|联通|谷歌|购物|通販|集团|食品|餐厅|香港)$/,b1=/https?:\/\//i,Me=new RegExp("^"+b1.source,"i"),ze=/^(javascript|vbscript):/i,Ue=/^[A-Za-z][-.+A-Za-z0-9]*:(\/\/)?([^:/]*)/,Ve=/^(?:\/\/)?([^/#?:]+)/,iD=DD;function p1(u){return DD(u)||Cu(u)||u===43||u===45||u===46}var Hu=Ju;function tf(u){return u===95||Hu(u)}function B1(u){return Ju(u)||Pe(u)||E1(u)}function nf(u){return u===47||u===63||u===35}function g1(u){return Le.test(u.toLowerCase())}function We(u){if(ze.test(u))return!1;var D=u.match(Ue);if(!D)return!1;var f=!!D[1],e=D[2];return f?!0:!(e.indexOf(".")===-1||!/[A-Za-z]/.test(e))}function He(u){var D=u.match(Ve);if(!D)return!1;var f=D[0],e=f.split(".");if(e.length<2)return!1;var t=e[e.length-1];return!!g1(t)}var qe=/^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/,Ye=/[:/?#]/;function $e(u){var D=u.split(Ye,1)[0];return qe.test(D)}var Ke=/^(https?:\/\/)?(?:www\.)?/i,Je=/^\/\//,Ge=function(u){aD(D,u);function D(f){var e=u.call(this,f)||this;return e.type="url",e.url="",e.urlMatchType="scheme",e.protocolRelativeMatch=!1,e.stripPrefix={scheme:!0,www:!0},e.stripTrailingSlash=!0,e.decodePercentEncoding=!0,e.protocolPrepended=!1,e.urlMatchType=f.urlMatchType,e.url=f.url,e.protocolRelativeMatch=f.protocolRelativeMatch,e.stripPrefix=f.stripPrefix,e.stripTrailingSlash=f.stripTrailingSlash,e.decodePercentEncoding=f.decodePercentEncoding,e}return D.prototype.getType=function(){return"url"},D.prototype.getUrlMatchType=function(){return this.urlMatchType},D.prototype.getUrl=function(){var f=this.url;return!this.protocolRelativeMatch&&this.urlMatchType!=="scheme"&&!this.protocolPrepended&&(f=this.url="http://"+f,this.protocolPrepended=!0),f},D.prototype.getAnchorHref=function(){var f=this.getUrl();return f.replace(/&/g,"&")},D.prototype.getAnchorText=function(){var f=this.getMatchedText();return this.protocolRelativeMatch&&(f=Qe(f)),this.stripPrefix.scheme&&(f=Xe(f)),this.stripPrefix.www&&(f=Ze(f)),this.stripTrailingSlash&&(f=u3(f)),this.decodePercentEncoding&&(f=D3(f)),f},D}(FD);function Xe(u){return u.replace(Me,"")}function Ze(u){return u.includes("www.")?u.replace(Ke,"$1"):u}function Qe(u){return u.replace(Je,"")}function u3(u){return u.charAt(u.length-1)==="/"&&(u=u.slice(0,-1)),u}function D3(u){var D=u.replace(/%(?:22|26|27|3C|3E)/gi,function(f){return f==="%22"?""":f==="%26"?"&":f==="%27"?"'":f==="%3C"||f==="%3c"?"<":">"});if(D.includes("%"))try{return decodeURIComponent(D)}catch{}return D}var f3=/^mailto:/i,m1=Ju;function rf(u){return m1(u)||Oe(u)}function e3(u){var D=u.split(".").pop();return g1(D)}var t3=function(u){aD(D,u);function D(f){var e=u.call(this,f)||this;return e.type="email",e.email="",e.email=f.email,e}return D.prototype.getType=function(){return"email"},D.prototype.getEmail=function(){return this.email},D.prototype.getAnchorHref=function(){return"mailto:"+this.email},D.prototype.getAnchorText=function(){return this.email},D}(FD);function _1(u){return u===95||Ju(u)}function n3(u){return u.length<=140}var r3=["twitter","facebook","instagram","tiktok","youtube"],s3=function(u){aD(D,u);function D(f){var e=u.call(this,f)||this;return e.type="hashtag",e.serviceName="twitter",e.hashtag="",e.serviceName=f.serviceName,e.hashtag=f.hashtag,e}return D.prototype.getType=function(){return"hashtag"},D.prototype.getServiceName=function(){return this.serviceName},D.prototype.getHashtag=function(){return this.hashtag},D.prototype.getAnchorHref=function(){var f=this.serviceName,e=this.hashtag;switch(f){case"twitter":return"https://twitter.com/hashtag/"+e;case"facebook":return"https://www.facebook.com/hashtag/"+e;case"instagram":return"https://instagram.com/explore/tags/"+e;case"tiktok":return"https://www.tiktok.com/tag/"+e;case"youtube":return"https://youtube.com/hashtag/"+e;default:$u(f)}},D.prototype.getAnchorText=function(){return"#"+this.hashtag},D.prototype.getCssClassSuffixes=function(){var f=u.prototype.getCssClassSuffixes.call(this),e=this.getServiceName();return e&&f.push(e),f},D}(FD),a3={twitter:/^@\w{1,15}$/,instagram:/^@[_\w]{1,30}$/,soundcloud:/^@[-a-z0-9_]{3,25}$/,tiktok:/^@[.\w]{1,23}[\w]$/,youtube:/^@[-.·\w]{3,30}$/};function y1(u){return u===45||u===46||u===95||DD(u)||Cu(u)}function F3(u,D){var f=a3[D];return f.test(u)}var i3=["twitter","instagram","soundcloud","tiktok","youtube"],o3=function(u){aD(D,u);function D(f){var e=u.call(this,f)||this;return e.type="mention",e.serviceName="twitter",e.mention="",e.mention=f.mention,e.serviceName=f.serviceName,e}return D.prototype.getType=function(){return"mention"},D.prototype.getMention=function(){return this.mention},D.prototype.getServiceName=function(){return this.serviceName},D.prototype.getAnchorHref=function(){switch(this.serviceName){case"twitter":return"https://twitter.com/"+this.mention;case"instagram":return"https://instagram.com/"+this.mention;case"soundcloud":return"https://soundcloud.com/"+this.mention;case"tiktok":return"https://www.tiktok.com/@"+this.mention;case"youtube":return"https://youtube.com/@"+this.mention;default:$u(this.serviceName)}},D.prototype.getAnchorText=function(){return"@"+this.mention},D.prototype.getCssClassSuffixes=function(){var f=u.prototype.getCssClassSuffixes.call(this),e=this.getServiceName();return e&&f.push(e),f},D}(FD),d3=/[-. ()]/,C3=/(?:(?:(?:(\+)?\d{1,3}[-. ]?)?\(?\d{3}\)?[-. ]?\d{3}[-. ]?\d{4})|(?:(\+)(?:9[976]\d|8[987530]\d|6[987]\d|5[90]\d|42\d|3[875]\d|2[98654321]\d|9[8543210]|8[6421]|6[6543210]|5[87654321]|4[987654310]|3[9643210]|2[70]|7|1)[-. ]?(?:\d[-. ]?){6,12}\d+))([,;]+[0-9]+#?)*/,c3=/(0([1-9]-?[1-9]\d{3}|[1-9]{2}-?\d{3}|[1-9]{2}\d{1}-?\d{2}|[1-9]{2}\d{2}-?\d{1})-?\d{4}|0[789]0-?\d{4}-?\d{4}|050-?\d{4}-?\d{4})/,l3=new RegExp("^".concat(C3.source,"|").concat(c3.source,"$"));function v1(u){return u===45||u===46||u===32}function sf(u){return u===44||u===59}function E3(u){var D=u.charAt(0)==="+"||d3.test(u);return D&&l3.test(u)}var h3=function(u){aD(D,u);function D(f){var e=u.call(this,f)||this;return e.type="phone",e.number="",e.plusSign=!1,e.number=f.number,e.plusSign=f.plusSign,e}return D.prototype.getType=function(){return"phone"},D.prototype.getPhoneNumber=function(){return this.number},D.prototype.getNumber=function(){return this.getPhoneNumber()},D.prototype.getAnchorHref=function(){return"tel:"+(this.plusSign?"+":"")+this.number},D.prototype.getAnchorText=function(){return this.matchedText},D}(FD),b3=function(){function u(D,f){this.charIdx=0,this.matches=[],this._stateMachines=[],this.schemeUrlMachinesCount=0,this.text=D,this.tagBuilder=f.tagBuilder,this.stripPrefix=f.stripPrefix,this.stripTrailingSlash=f.stripTrailingSlash,this.decodePercentEncoding=f.decodePercentEncoding,this.hashtagServiceName=f.hashtagServiceName,this.mentionServiceName=f.mentionServiceName}return Object.defineProperty(u.prototype,"stateMachines",{get:function(){return this._stateMachines},enumerable:!1,configurable:!0}),u.prototype.addMachine=function(D){this._stateMachines.push(D),A1(D)&&this.schemeUrlMachinesCount++},u.prototype.removeMachine=function(D){this._stateMachines=this._stateMachines.filter(function(f){return f!==D}),A1(D)&&this.schemeUrlMachinesCount--},u.prototype.hasSchemeUrlMachine=function(){return this.schemeUrlMachinesCount>0},u}();function p3(u,D){for(var f=new b3(u,D);f.charIdx<f.text.length;f.charIdx++){var e=u.charAt(f.charIdx),t=u.charCodeAt(f.charIdx);if(f.stateMachines.length===0)yD(f,e,t);else{for(var n=f.stateMachines.length-1;n>=0;n--){var r=f.stateMachines[n];switch(r.state){case 11:v3(f,r,t);break;case 12:w3(f,r,t);break;case 0:B3(f,r,t);break;case 1:g3(f,r,t);break;case 2:m3(f,r,t);break;case 3:_3(f,r,t);break;case 4:y3(f,r,e,t);break;case 5:A3(f,r,t);break;case 6:x3(f,r,e,t);break;case 7:k3(f,r,e,t);break;case 13:S3(f,r,t);break;case 14:j3(f,r,t);break;case 8:T3(f,r,t);break;case 9:N3(f,r,t);break;case 10:R3(f,r,t);break;case 15:O3(f,r,e,t);break;case 16:P3(f,r,e,t);break;case 17:I3(f,r,e,t);break;case 18:L3(f,r,e,t);break;case 19:M3(f,r,e,t);break;case 20:z3(f,r,t);break;case 21:U3(f,r,t);break;case 22:Gu(f,r,t);break;case 23:V3(f,r,t);break;case 24:W3(f,r,t);break;case 25:H3(f,r,t);break;case 26:q3(f,r,t);break;case 27:Y3(f,r,t);break;case 28:$3(f,r,t);break;case 29:K3(f,r,t);break;case 30:J3(f,r,t);break;case 31:G3(f,r,t);break;case 32:Z3(f,r,e,t);break;case 33:Q3(f,r,t);break;case 34:ut(f,r,t);break;case 35:Dt(f,r,t);break;case 36:ft(f,r,e,t);break;case 37:X3(f,r,e,t);break;case 38:et(f,r,e,t);break;case 39:tt(f,r,e,t);break;case 40:nt(f,r,t);break;case 41:rt(f,r,t);break;default:$u(r.state)}}if(!f.hasSchemeUrlMachine()&&f.charIdx>0&&iD(t)){var a=f.text.charCodeAt(f.charIdx-1);iD(a)||f.addMachine(vD(f.charIdx,0))}}}for(var F=f.stateMachines.length-1;F>=0;F--)f.stateMachines.forEach(function(o){return Du(f,o)});return f.matches}function yD(u,D,f){var e=u.charIdx;if(f===35)u.addMachine(ot(e,28));else if(f===64)u.addMachine(dt(e,30));else if(f===47)u.addMachine(af(e,11));else if(f===43)u.addMachine(Ff(e,37));else if(f===40)u.addMachine(Ff(e,32));else{if(Cu(f)&&(u.addMachine(Ff(e,38)),u.addMachine(Ft(e,13))),m1(f)){var t=D.toLowerCase()==="m"?15:22;u.addMachine(it(e,t))}iD(f)&&u.addMachine(vD(e,0)),Ju(f)&&u.addMachine(af(e,5))}}function B3(u,D,f){f===58?D.state=2:f===45?D.state=1:p1(f)||u.removeMachine(D)}function g3(u,D,f){var e=u.charIdx;f===45||(f===47?(u.removeMachine(D),u.addMachine(af(e,11))):p1(f)?D.state=0:u.removeMachine(D))}function m3(u,D,f){var e=u.charIdx;f===47?D.state=3:f===46?u.removeMachine(D):Hu(f)?(D.state=5,iD(f)&&u.addMachine(vD(e,0))):u.removeMachine(D)}function _3(u,D,f){f===47?D.state=4:B1(f)?(D.state=10,D.acceptStateReached=!0):Du(u,D)}function y3(u,D,f,e){e===47?(D.state=10,D.acceptStateReached=!0):Hu(e)?(D.state=5,D.acceptStateReached=!0):u.removeMachine(D)}function v3(u,D,f){f===47?D.state=12:u.removeMachine(D)}function w3(u,D,f){Hu(f)?D.state=5:u.removeMachine(D)}function A3(u,D,f){f===46?D.state=7:f===45?D.state=6:f===58?D.state=8:nf(f)?D.state=10:tf(f)||Du(u,D)}function x3(u,D,f,e){e===45||(e===46?Du(u,D):Hu(e)?D.state=5:Du(u,D))}function k3(u,D,f,e){e===46?Du(u,D):Hu(e)?(D.state=5,D.acceptStateReached=!0):Du(u,D)}function S3(u,D,f){f===46?D.state=14:f===58?D.state=8:Cu(f)||(nf(f)?D.state=10:Ju(f)?u.removeMachine(D):Du(u,D))}function j3(u,D,f){Cu(f)?(D.octetsEncountered++,D.octetsEncountered===4&&(D.acceptStateReached=!0),D.state=13):Du(u,D)}function T3(u,D,f){Cu(f)?D.state=9:Du(u,D)}function N3(u,D,f){Cu(f)||(nf(f)?D.state=10:Du(u,D))}function R3(u,D,f){B1(f)||Du(u,D)}function O3(u,D,f,e){f.toLowerCase()==="a"?D.state=16:Gu(u,D,e)}function P3(u,D,f,e){f.toLowerCase()==="i"?D.state=17:Gu(u,D,e)}function I3(u,D,f,e){f.toLowerCase()==="l"?D.state=18:Gu(u,D,e)}function L3(u,D,f,e){f.toLowerCase()==="t"?D.state=19:Gu(u,D,e)}function M3(u,D,f,e){f.toLowerCase()==="o"?D.state=20:Gu(u,D,e)}function z3(u,D,f){f===58?D.state=21:Gu(u,D,f)}function U3(u,D,f){rf(f)?D.state=22:u.removeMachine(D)}function Gu(u,D,f){f===46?D.state=23:f===64?D.state=24:rf(f)?D.state=22:u.removeMachine(D)}function V3(u,D,f){f===46||f===64?u.removeMachine(D):rf(f)?D.state=22:u.removeMachine(D)}function W3(u,D,f){Hu(f)?D.state=25:u.removeMachine(D)}function H3(u,D,f){f===46?D.state=27:f===45?D.state=26:tf(f)||Du(u,D)}function q3(u,D,f){f===45||f===46?Du(u,D):tf(f)?D.state=25:Du(u,D)}function Y3(u,D,f){f===46||f===45?Du(u,D):Hu(f)?(D.state=25,D.acceptStateReached=!0):Du(u,D)}function $3(u,D,f){_1(f)?(D.state=29,D.acceptStateReached=!0):u.removeMachine(D)}function K3(u,D,f){_1(f)||Du(u,D)}function J3(u,D,f){y1(f)?(D.state=31,D.acceptStateReached=!0):u.removeMachine(D)}function G3(u,D,f){y1(f)||(Ju(f)?u.removeMachine(D):Du(u,D))}function X3(u,D,f,e){Cu(e)?D.state=38:(u.removeMachine(D),yD(u,f,e))}function Z3(u,D,f,e){Cu(e)?D.state=33:u.removeMachine(D),yD(u,f,e)}function Q3(u,D,f){Cu(f)?D.state=34:u.removeMachine(D)}function ut(u,D,f){Cu(f)?D.state=35:u.removeMachine(D)}function Dt(u,D,f){f===41?D.state=36:u.removeMachine(D)}function ft(u,D,f,e){Cu(e)?D.state=38:v1(e)?D.state=39:u.removeMachine(D)}function et(u,D,f,e){var t=u.charIdx;D.acceptStateReached=!0,sf(e)?D.state=40:e===35?D.state=41:Cu(e)||(e===40?D.state=32:v1(e)?D.state=39:(Du(u,D),iD(e)&&u.addMachine(vD(t,0))))}function tt(u,D,f,e){Cu(e)?D.state=38:e===40?D.state=32:(Du(u,D),yD(u,f,e))}function nt(u,D,f){sf(f)||(f===35?D.state=41:Cu(f)?D.state=38:Du(u,D))}function rt(u,D,f){sf(f)?D.state=40:Cu(f)?u.removeMachine(D):Du(u,D)}function Du(u,D){var f=u.matches,e=u.text,t=u.charIdx,n=u.tagBuilder,r=u.stripPrefix,a=u.stripTrailingSlash,F=u.decodePercentEncoding,o=u.hashtagServiceName,d=u.mentionServiceName;if(u.removeMachine(D),!!D.acceptStateReached){var l=D.startIdx,E=e.slice(D.startIdx,t);switch(E=at(E),D.type){case 0:{var j=e.charCodeAt(D.startIdx-1);if(j===64)return;switch(D.matchType){case 0:{var v=b1.exec(E);if(v&&(l=l+v.index,E=E.slice(v.index)),!We(E))return;break}case 1:{if(!He(E))return;break}case 2:{if(!$e(E))return;break}default:$u(D)}f.push(new Ge({tagBuilder:n,matchedText:E,offset:l,urlMatchType:st(D.matchType),url:E,protocolRelativeMatch:E.slice(0,2)==="//",stripPrefix:r,stripTrailingSlash:a,decodePercentEncoding:F}));break}case 1:{e3(E)&&f.push(new t3({tagBuilder:n,matchedText:E,offset:l,email:E.replace(f3,"")}));break}case 2:{n3(E)&&f.push(new s3({tagBuilder:n,matchedText:E,offset:l,serviceName:o,hashtag:E.slice(1)}));break}case 3:{F3(E,d)&&f.push(new o3({tagBuilder:n,matchedText:E,offset:l,serviceName:d,mention:E.slice(1)}));break}case 4:{if(E=E.replace(/ +$/g,""),E3(E)){var C=E.replace(/[^0-9,;#]/g,"");f.push(new h3({tagBuilder:n,matchedText:E,offset:l,number:C,plusSign:E.charAt(0)==="+"}))}break}default:$u(D)}}}function st(u){switch(u){case 0:return"scheme";case 1:return"tld";case 2:return"ipV4";default:$u(u)}}var w1={")":"(","}":"{","]":"["};function at(u){for(var D={"(":0,"{":0,"[":0},f=0;f<u.length;f++){var e=u.charAt(f),t=u.charCodeAt(f);Ie(t)?D[e]++:h1(t)&&D[w1[e]]--}for(var n=u.length-1;n>=0;){var e=u.charAt(n),t=u.charCodeAt(n);if(h1(t)){var r=w1[e];if(D[r]<0)D[r]++,n--;else break}else if(E1(t))n--;else break}return u.slice(0,n+1)}function vD(u,D){return{type:0,startIdx:u,state:D,acceptStateReached:!1,matchType:0}}function af(u,D){return{type:0,startIdx:u,state:D,acceptStateReached:!1,matchType:1}}function Ft(u,D){return{type:0,startIdx:u,state:D,acceptStateReached:!1,matchType:2,octetsEncountered:1}}function it(u,D){return{type:1,startIdx:u,state:D,acceptStateReached:!1}}function ot(u,D){return{type:2,startIdx:u,state:D,acceptStateReached:!1}}function dt(u,D){return{type:3,startIdx:u,state:D,acceptStateReached:!1}}function Ff(u,D){return{type:4,startIdx:u,state:D,acceptStateReached:!1}}function A1(u){return u.type===0&&u.matchType===0}var Ru=function(){function u(D){D===void 0&&(D={}),this.idx=D.idx!==void 0?D.idx:-1,this.type=D.type||"tag",this.name=D.name||"",this.isOpening=!!D.isOpening,this.isClosing=!!D.isClosing}return u}(),of=new Ru,Ct=function(){function u(D,f){this.charIdx=0,this.state=0,this.currentDataIdx=0,this.currentTag=of,this.html=D,this.callbacks=f}return u}();function ct(u,D){for(var f=new Ct(u,D),e=u.length;f.charIdx<e;){var t=u.charAt(f.charIdx),n=u.charCodeAt(f.charIdx);switch(f.state){case 0:lt(f,t);break;case 1:Et(f,t,n);break;case 2:bt(f,t,n);break;case 3:ht(f,t,n);break;case 4:pt(f,t,n);break;case 5:Bt(f,t,n);break;case 6:gt(f,t,n);break;case 7:mt(f,t,n);break;case 8:_t(f,t);break;case 9:yt(f,t);break;case 10:vt(f,t,n);break;case 11:wt(f,t,n);break;case 12:At(f,t);break;case 13:xt(f);break;case 14:kt(f,t);break;case 15:St(f,t);break;case 16:jt(f,t);break;case 17:Tt(f,t);break;case 18:Nt(f,t);break;case 19:Rt(f,t);break;case 20:Ot(f,t);break;default:$u(f.state)}f.charIdx++}f.currentDataIdx<f.charIdx&&Pt(f)}function lt(u,D){D==="<"&&Ou(u)}function Et(u,D,f){D==="!"?u.state=13:D==="/"?(u.state=2,u.currentTag=new Ru(iu(iu({},u.currentTag),{isClosing:!0}))):D==="<"?Ou(u):DD(f)?(u.state=3,u.currentTag=new Ru(iu(iu({},u.currentTag),{isOpening:!0}))):(u.state=0,u.currentTag=of)}function ht(u,D,f){Ku(f)?(u.currentTag=new Ru(iu(iu({},u.currentTag),{name:df(u)})),u.state=4):D==="<"?Ou(u):D==="/"?(u.currentTag=new Ru(iu(iu({},u.currentTag),{name:df(u)})),u.state=12):D===">"?(u.currentTag=new Ru(iu(iu({},u.currentTag),{name:df(u)})),Pu(u)):!DD(f)&&!Cu(f)&&D!==":"&&Au(u)}function bt(u,D,f){D===">"?Au(u):DD(f)?u.state=3:Au(u)}function pt(u,D,f){Ku(f)||(D==="/"?u.state=12:D===">"?Pu(u):D==="<"?Ou(u):D==="="||ef(f)||Re(f)?Au(u):u.state=5)}function Bt(u,D,f){Ku(f)?u.state=6:D==="/"?u.state=12:D==="="?u.state=7:D===">"?Pu(u):D==="<"?Ou(u):ef(f)&&Au(u)}function gt(u,D,f){Ku(f)||(D==="/"?u.state=12:D==="="?u.state=7:D===">"?Pu(u):D==="<"?Ou(u):ef(f)?Au(u):u.state=5)}function mt(u,D,f){Ku(f)||(D==='"'?u.state=8:D==="'"?u.state=9:/[>=`]/.test(D)?Au(u):D==="<"?Ou(u):u.state=10)}function _t(u,D){D==='"'&&(u.state=11)}function yt(u,D){D==="'"&&(u.state=11)}function vt(u,D,f){Ku(f)?u.state=4:D===">"?Pu(u):D==="<"&&Ou(u)}function wt(u,D,f){Ku(f)?u.state=4:D==="/"?u.state=12:D===">"?Pu(u):D==="<"?Ou(u):(u.state=4,It(u))}function At(u,D){D===">"?(u.currentTag=new Ru(iu(iu({},u.currentTag),{isClosing:!0})),Pu(u)):Au(u)}function xt(u){var D=u.html,f=u.charIdx;D.slice(f,f+2)==="--"?(u.charIdx++,u.currentTag=new Ru(iu(iu({},u.currentTag),{type:"comment"})),u.state=14):D.slice(f,f+7).toUpperCase()==="DOCTYPE"?(u.charIdx+=6,u.currentTag=new Ru(iu(iu({},u.currentTag),{type:"doctype"})),u.state=20):Au(u)}function kt(u,D){D==="-"?u.state=15:D===">"?Au(u):u.state=16}function St(u,D){D==="-"?u.state=18:D===">"?Au(u):u.state=16}function jt(u,D){D==="-"&&(u.state=17)}function Tt(u,D){D==="-"?u.state=18:u.state=16}function Nt(u,D){D===">"?Pu(u):D==="!"?u.state=19:D==="-"||(u.state=16)}function Rt(u,D){D==="-"?u.state=17:D===">"?Pu(u):u.state=16}function Ot(u,D){D===">"?Pu(u):D==="<"&&Ou(u)}function Au(u){u.state=0,u.currentTag=of}function Ou(u){u.state=1,u.currentTag=new Ru({idx:u.charIdx})}function Pu(u){var D=u.html.slice(u.currentDataIdx,u.currentTag.idx);D&&u.callbacks.onText(D,u.currentDataIdx);var f=u.currentTag;f.type==="comment"?u.callbacks.onComment(f.idx):f.type==="doctype"?u.callbacks.onDoctype(f.idx):(f.isOpening&&u.callbacks.onOpenTag(f.name,f.idx),f.isClosing&&u.callbacks.onCloseTag(f.name,f.idx)),Au(u),u.currentDataIdx=u.charIdx+1}function Pt(u){var D=u.html.slice(u.currentDataIdx,u.charIdx);u.callbacks.onText(D,u.currentDataIdx),u.currentDataIdx=u.charIdx+1}function df(u){var D=u.currentTag.idx+(u.currentTag.isClosing?2:1);return u.html.slice(D,u.charIdx).toLowerCase()}function It(u){u.charIdx--}var Lt=function(){function u(D){D===void 0&&(D={}),this.version=u.version,this.urls={},this.email=!0,this.phone=!0,this.hashtag=!1,this.mention=!1,this.newWindow=!0,this.stripPrefix={scheme:!0,www:!0},this.stripTrailingSlash=!0,this.decodePercentEncoding=!0,this.truncate={length:0,location:"end"},this.className="",this.replaceFn=null,this.context=void 0,this.sanitizeHtml=!1,this.tagBuilder=null,this.urls=Mt(D.urls),this.email=wu(D.email)?D.email:this.email,this.phone=wu(D.phone)?D.phone:this.phone,this.hashtag=D.hashtag||this.hashtag,this.mention=D.mention||this.mention,this.newWindow=wu(D.newWindow)?D.newWindow:this.newWindow,this.stripPrefix=zt(D.stripPrefix),this.stripTrailingSlash=wu(D.stripTrailingSlash)?D.stripTrailingSlash:this.stripTrailingSlash,this.decodePercentEncoding=wu(D.decodePercentEncoding)?D.decodePercentEncoding:this.decodePercentEncoding,this.sanitizeHtml=D.sanitizeHtml||!1;var f=this.mention;if(f!==!1&&i3.indexOf(f)===-1)throw new Error("invalid `mention` cfg '".concat(f,"' - see docs"));var e=this.hashtag;if(e!==!1&&r3.indexOf(e)===-1)throw new Error("invalid `hashtag` cfg '".concat(e,"' - see docs"));this.truncate=Ut(D.truncate),this.className=D.className||this.className,this.replaceFn=D.replaceFn||this.replaceFn,this.context=D.context||this}return u.link=function(D,f){var e=new u(f);return e.link(D)},u.parse=function(D,f){var e=new u(f);return e.parse(D)},u.prototype.parse=function(D){var f=this,e=["a","style","script"],t=0,n=[];return ct(D,{onOpenTag:function(r){e.indexOf(r)>=0&&t++},onText:function(r,a){if(t===0){var F=/( | |<|<|>|>|"|"|')/gi,o=r.split(F),d=a;o.forEach(function(l,E){if(E%2===0){var j=f.parseText(l,d);n.push.apply(n,ve([],ye(j),!1))}d+=l.length})}},onCloseTag:function(r){e.indexOf(r)>=0&&(t=Math.max(t-1,0))},onComment:function(){},onDoctype:function(){}}),n=this.compactMatches(n),n=this.removeUnwantedMatches(n),n},u.prototype.compactMatches=function(D){D.sort(Vt);for(var f=0;f<D.length-1;){var e=D[f],t=e.getOffset(),n=e.getMatchedText().length;if(f+1<D.length&&D[f+1].getOffset()===t){var r=D[f+1].getMatchedText().length>n?f:f+1;D.splice(r,1);continue}f++}return D},u.prototype.removeUnwantedMatches=function(D){return this.hashtag||Yu(D,function(f){return f.getType()==="hashtag"}),this.email||Yu(D,function(f){return f.getType()==="email"}),this.phone||Yu(D,function(f){return f.getType()==="phone"}),this.mention||Yu(D,function(f){return f.getType()==="mention"}),this.urls.schemeMatches||Yu(D,function(f){return f.getType()==="url"&&f.getUrlMatchType()==="scheme"}),this.urls.tldMatches||Yu(D,function(f){return f.getType()==="url"&&f.getUrlMatchType()==="tld"}),this.urls.ipV4Matches||Yu(D,function(f){return f.getType()==="url"&&f.getUrlMatchType()==="ipV4"}),D},u.prototype.parseText=function(D,f){f=f||0;for(var e=p3(D,{tagBuilder:this.getTagBuilder(),stripPrefix:this.stripPrefix,stripTrailingSlash:this.stripTrailingSlash,decodePercentEncoding:this.decodePercentEncoding,hashtagServiceName:this.hashtag,mentionServiceName:this.mention||"twitter"}),t=0,n=e.length;t<n;t++)e[t].setOffset(f+e[t].getOffset());return e},u.prototype.link=function(D){if(!D)return"";this.sanitizeHtml&&(D=D.replace(/</g,"<").replace(/>/g,">"));for(var f=this.parse(D),e=new Array(f.length*2+1),t=0,n=0,r=f.length;n<r;n++){var a=f[n];e.push(D.substring(t,a.getOffset())),e.push(this.createMatchReturnVal(a)),t=a.getOffset()+a.getMatchedText().length}return e.push(D.substring(t)),e.join("")},u.prototype.createMatchReturnVal=function(D){var f;if(this.replaceFn&&(f=this.replaceFn.call(this.context,D)),typeof f=="string")return f;if(f===!1)return D.getMatchedText();if(f instanceof c1)return f.toAnchorString();var e=D.buildTag();return e.toAnchorString()},u.prototype.getTagBuilder=function(){var D=this.tagBuilder;return D||(D=this.tagBuilder=new Ne({newWindow:this.newWindow,truncate:this.truncate,className:this.className})),D},u.version=we,u}();function Mt(u){return u==null&&(u=!0),wu(u)?{schemeMatches:u,tldMatches:u,ipV4Matches:u}:{schemeMatches:wu(u.schemeMatches)?u.schemeMatches:!0,tldMatches:wu(u.tldMatches)?u.tldMatches:!0,ipV4Matches:wu(u.ipV4Matches)?u.ipV4Matches:!0}}function zt(u){return u==null&&(u=!0),wu(u)?{scheme:u,www:u}:{scheme:wu(u.scheme)?u.scheme:!0,www:wu(u.www)?u.www:!0}}function Ut(u){return typeof u=="number"?{length:u,location:"end"}:iu({length:Number.POSITIVE_INFINITY,location:"end"},u)}function Vt(u,D){return u.getOffset()-D.getOffset()}const Xu=[{name:"Australia",countryCode:"+61",code:"AU",flag:"🇦🇺"},{name:"United States",countryCode:"+1",code:"US",flag:"🇺🇸"},{name:"New Zealand",countryCode:"+64",code:"NZ",flag:"🇳🇿"},{name:"United Kingdom",countryCode:"+44",code:"UK",flag:"🇬🇧"},{name:"Indonesia",countryCode:"+62",code:"ID",flag:"🇮🇩"}],Wt={AU:/^(?:\+?(61))? ?(?:\((?=.*\))\))?(0?[4])\)? ?(\d\d(?:[- ](?=\d{3})|(?!\d\d[- ]?\d[- ]))\d\d[- ]?\d[- ]?\d{3})$/gm,US:/^(\+?1\s?)?\(?([0-9]{3})\)?[-. ]?([0-9]{3})[-. ]?([0-9]{4})$/gm,UK:/^(\+?44\s?)?\(?([0-9]{3})\)?[-. ]?([0-9]{3})[-. ]?([0-9]{4})$/gm,NZ:/^(\+?64\s?)?\(?([0-9]{3})\)?[-. ]?([0-9]{3})[-. ]?([0-9]{4})$/gm,ID:/^(\+?62\s?)?\(?([0-9]{3})\)?[-. ]?([0-9]{3})[-. ]?([0-9]{4})$/gm},Ht={AU:"+61",US:"+1",NZ:"+64",UK:"+44",ID:"+62"},qt=u=>u.toUpperCase(),Yt=u=>u.replace(/\s+/g,"").replace(/[^0-9+]/g,"");function $t(u,D){const f=Ht[u];return D.startsWith(f)?{cleanNumber:D.slice(f.length),countryCode:f}:{cleanNumber:D,countryCode:f}}function Kt(u,D){const f=Wt[u];return new RegExp(f.source,"mi").test(D)}function Jt({number:u,region:D,validateDuplicate:f,contacts:e}){const t={originalNumber:u,fullNumber:"",cleanNumber:"",errorMessage:"",isValid:!1},n=qt(D);if(!u)return t.errorMessage="Number is empty",t;const r=u.trim();let a=Yt(u);a=a.startsWith("0")?a.slice(1):a;const{cleanNumber:F,countryCode:o}=$t(n,a);a=F,t.fullNumber=`${o}${a}`,t.cleanNumber=a;try{if(!Kt(n,r))throw new Error("Please enter a valid phone number");t.isValid=!0}catch(d){t.errorMessage=d.message,t.isValid=!1}return t}const x1=({initialData:u,loadFromDataUserSubs:D=!1}={})=>{const[f,e]=c.useState(u||{}),[t,n]=c.useState({}),[r,a]=c.useState({}),F=(C,N)=>{let R="";if(C.isRequired)if(typeof N=="string"){const g=N.trim();if(!g)return`${C.label} is required`;if(C.key.toLowerCase().includes("phone")||C.label.toLowerCase().includes("phone")){const z=g.replace(/\s+/g,""),y=Xu.find(P=>z.startsWith(P.countryCode)),B=z.replace(/^\+?\d+/,"");if(y&&B.length===0)return""}}else typeof N=="boolean"?N!==!0&&(R=`${C.label} is required`):N||(R=`${C.label} is required`);if(R&&t[C.key])return console.log(`[VALIDATE] ${C.key}=${N}, ERROR=${R}`),R;if(C.key.toLowerCase().includes("email")||C.label.toLowerCase().includes("email")){const g=String(N||"").trim();g&&(/^[^\s@]+@[^\s@]+\.[^\s@]{2,}$/.test(g)||(R="Please enter a valid email address"))}if(C.key.toLowerCase().includes("phone")||C.label.toLowerCase().includes("phone")){const g=String(N||""),z=g.replace(/[^0-9+]/g,""),y=Xu.find(k=>z.startsWith(k.countryCode)),B=(y==null?void 0:y.code)||"AU",P=y?z.substring(y.countryCode.length):z;if(!C.isRequired&&y&&P==="")return"";if(g){const k=Jt({number:g,region:B,validateDuplicate:!1,contacts:new Map});k.isValid||(R=k.errorMessage||"Please enter a valid phone number")}}return R};c.useEffect(()=>{if(D)try{const C=J.getItem("dataUserSubs");C&&e(C)}catch(C){console.error("Error loading dataUserSubs from localStorage:",C)}},[D]);const o=c.useCallback((C,N)=>{e(R=>({...R,[C]:N})),a(R=>({...R,[C]:""}))},[]),d=c.useCallback(C=>{n(g=>({...g,[C.key]:!0}));const N=f[C.key],R=F(C,N);a(g=>({...g,[C.key]:R}))},[f]),l=C=>{const N={email:"email",phone:"tel",date:"date",password:"password"},R=Object.keys(N).find(g=>C.toLowerCase().includes(g));return R?N[R]:"text"},E=c.useCallback(C=>{var z;if(!C.isDisplay)return null;const N=f[C.key],R=l(C.key),g=!!r[C.key]&&t[C.key];if(C.key.includes("language")||C.key.includes("country"))return s.jsx("select",{className:`user-subscription-form-input${g?" error":""}`,value:N||"",onChange:y=>o(C.key,y.target.value),onBlur:()=>d(C),"aria-invalid":g,style:C.color?{borderColor:C.color}:void 0,children:s.jsxs("option",{value:"",children:["Select ",C.label]})},C.key);if(C.key.includes("newsletter")||C.key.includes("subscribe"))return s.jsxs("div",{className:"user-subscription-checkbox",children:[s.jsx("input",{type:"checkbox",id:C.key,checked:N||!1,onChange:y=>o(C.key,y.target.checked),"aria-invalid":g}),s.jsx("label",{htmlFor:C.key,children:C.label})]},C.key);if(C.key.toLowerCase().includes("phone")){const y=N||"",B=((z=Xu.find(_=>y.startsWith(_.countryCode)))==null?void 0:z.countryCode)||"+61",P=y.replace(/^\+?\d+\s?/,"").trim(),k=_=>{const x=_.replace(/[^0-9\s]/g,"").trim();o(C.key,x?`${B} ${x}`:`${B} `)},q=_=>{o(C.key,P?`${_} ${P}`:`${_} `)};return s.jsxs("div",{className:"user-subscription-form-field",children:[s.jsxs("div",{style:{display:"flex",flexDirection:"row",gap:"0.25rem",alignItems:"center"},children:[s.jsxs("select",{className:`user-subscription-form-input${g?" error":""}`,style:{maxWidth:"100px"},value:B,onChange:_=>q(_.target.value),onBlur:()=>d(C),"aria-invalid":!!g,children:[s.jsx("option",{value:"",children:"+Code"}),Xu.map(_=>s.jsx("option",{value:_.countryCode,children:`${_.flag} ${_.countryCode}`},_.code))]}),s.jsx("input",{className:`user-subscription-form-input${g?" error":""}`,type:"tel",value:P,onChange:_=>k(_.target.value),onBlur:()=>d(C),placeholder:C.label,"aria-invalid":!!g,style:{...C.color?{borderColor:C.color}:{},flex:1}})]}),g&&s.jsx("div",{className:"user-subscription-error",children:r[C.key]})]},C.key)}return s.jsxs("div",{className:"user-subscription-form-field",children:[s.jsx("input",{className:`user-subscription-form-input${g?" error":""}`,type:R,value:N||"",onChange:y=>o(C.key,y.target.value),onBlur:()=>d(C),placeholder:C.label,"aria-invalid":g,style:C.color?{borderColor:C.color}:void 0}),g&&s.jsx("div",{className:"user-subscription-error",children:r[C.key]})]},C.key)},[r,t,f,o,d]),j=c.useCallback(C=>{var z;if(!C.isDisplay)return null;const N=f[C.key],R=l(C.key),g=!!r[C.key]&&t[C.key];if(C.key.toLowerCase().includes("phone")){const y=N||"",B=((z=Xu.find(_=>y.startsWith(_.countryCode)))==null?void 0:z.countryCode)||"+61",P=y.replace(/^\+?\d+\s?/,"").trim(),k=_=>{const x=_.replace(/[^0-9\s]/g,"").trim();o(C.key,x?`${B} ${x}`:`${B} `)},q=_=>{o(C.key,P?`${_} ${P}`:`${_} `)};return s.jsxs("div",{className:"sc-message--contact-form-field",children:[s.jsx("label",{htmlFor:`contact-${C.key}`,className:"sc-message--contact-form-label",children:C.label}),s.jsxs("div",{style:{display:"flex",gap:"0.25rem",alignItems:"center"},children:[s.jsxs("select",{className:"sc-message--contact-form-input",style:{maxWidth:"100px"},value:B,onChange:_=>q(_.target.value),onBlur:()=>d(C),"aria-invalid":g,children:[s.jsx("option",{value:"",children:"+Code"}),Xu.map(_=>s.jsx("option",{value:_.countryCode,children:`${_.flag} ${_.countryCode}`},_.code))]}),s.jsx("input",{id:`contact-${C.key}`,type:"tel",value:P,onChange:_=>k(_.target.value),onBlur:()=>d(C),placeholder:"",className:`sc-message--contact-form-input ${g?"error":""}`,"aria-invalid":g,style:{...C.color?{borderColor:C.color}:{},flex:1,...g?{borderColor:"#ff4444"}:{}}})]}),g&&s.jsx("div",{style:{color:"#ff4444",fontSize:"0.75rem",marginTop:"0.25rem"},children:r[C.key]})]},C.key)}return s.jsxs("div",{className:"sc-message--contact-form-field",children:[s.jsx("label",{htmlFor:`contact-${C.key}`,className:"sc-message--contact-form-label",children:C.label}),s.jsx("input",{id:`contact-${C.key}`,type:R,value:N||"",onChange:y=>o(C.key,y.target.value),onBlur:()=>d(C),placeholder:"",className:`sc-message--contact-form-input ${g?"error":""}`,"aria-invalid":g,style:{...C.color?{borderColor:C.color}:{},...g?{borderColor:"#ff4444"}:{}}}),g&&s.jsx("div",{style:{color:"#ff4444",fontSize:"0.75rem",marginTop:"0.25rem"},children:r[C.key]})]},C.key)},[f,l,t,r,o,d]),v=c.useCallback(C=>{const N={};return C.filter(R=>R.isDisplay).forEach(R=>{const g=f[R.key];N[R.key]=F(R,g)}),a(R=>({...R,...N})),C.filter(R=>R.isDisplay&&R.isRequired).every(R=>N[R.key]==="")},[f,F]);return{formData:f,setFormData:e,touched:t,setTouched:n,handleFieldChange:o,handleFieldBlur:d,renderFormField:E,renderContactFormField:j,getInputType:l,errors:r,validateAll:v}};function Gt(u){const D={};return Object.entries(u).forEach(([f,e])=>{if(e){if(f.toLowerCase().includes("phone")){const t=e.replace(/\s+/g,""),n=Xu.find(r=>t.startsWith(r.countryCode));if(n&&t.slice(n.countryCode.length)==="")return}D[f]=e}}),D}const Xt=({onSubmit:u,onFormStateChange:D})=>{const{colors:f}=Fu(),e=Iu(),t=hu(),{socket:n}=Wu(),{setScreen:r}=Nu();Su();const{setIsOfflineMode:a,send:F,participants:o,setMessages:d,setParticipants:l,setConnectionState:E}=ou(),{formData:j,renderContactFormField:v,errors:C,validateAll:N}=x1({initialData:{},loadFromDataUserSubs:!0}),[R,g]=c.useState(!1),[z,y]=c.useState(!1);c.useEffect(()=>{D&&!z&&D(!0),D&&z&&D(!1)},[z]);const B=async k=>{var _;if(k.preventDefault(),!!N(t.formSettings)){g(!0);try{const x={};t.formSettings.forEach(h=>{var b;h.isDisplay&&j[h.key]!==void 0&&(x[h.key]=((b=j[h.key])==null?void 0:b.toString().trim())||"")});const w=Gt(x);if(!J.getItem("profileLiveChat"))try{const h=new URLSearchParams;Object.entries(w).forEach(([U,W])=>{typeof W=="string"&&W&&h.append(U,W)}),h.append("owner_id",e.ownerId),h.append("contactLateTime",new Date().toISOString());const{body:b}=await n.get(`/webhook/${e.channel}/?${h.toString()}`),{messages:S,profile:m}=b;J.setItem("profileLiveChat",m),J.setItem("isOffline",!1),J.setItem("submitedFormLateTime",(m==null?void 0:m.submitedFormLateTime)||null),S.forEach(U=>{const W=U.author===m.foreignId||U.author===m.id?Z.sent:Z.received;U.direction=W,U.direction===Z.sent&&(U.read=!0,U.delivery=!1)}),d(S),l([o[0],{id:m.foreignId,foreign_id:m.foreignId,name:`${m.firstName} ${m.lastName}`}]),E(3),r("chat"),y(!0);const I={text:Object.entries(w).map(([U,W])=>`${U.charAt(0).toUpperCase()+U.slice(1)}: ${W}`).join(`
|
|
27
|
+
Check the top-level render call using <`+A+">.")}return p}}function M1(i,p){{if(!i._store||i._store.validated||i.key!=null)return;i._store.validated=!0;var A=I2(p);if(L1[A])return;L1[A]=!0;var M="";i&&i._owner&&i._owner!==Ef.current&&(M=" It was passed a child from "+h(i._owner.type)+"."),fD(i),_('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',A,M),fD(null)}}function z1(i,p){{if(typeof i!="object")return;if(Array.isArray(i))for(var A=0;A<i.length;A++){var M=i[A];bf(M)&&M1(M,p)}else if(bf(i))i._store&&(i._store.validated=!0);else if(i){var X=k(i);if(typeof X=="function"&&X!==i.entries)for(var K=X.call(i),$;!($=K.next()).done;)bf($.value)&&M1($.value,p)}}}function L2(i){{var p=i.type;if(p==null||typeof p=="string")return;var A;if(typeof p=="function")A=p.propTypes;else if(typeof p=="object"&&(p.$$typeof===d||p.$$typeof===j))A=p.propTypes;else return;if(A){var M=h(p);A2(A,i.props,"prop",M,i)}else if(p.PropTypes!==void 0&&!hf){hf=!0;var X=h(p);_("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",X||"Unknown")}typeof p.getDefaultProps=="function"&&!p.getDefaultProps.isReactClassApproved&&_("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function M2(i){{for(var p=Object.keys(i.props),A=0;A<p.length;A++){var M=p[A];if(M!=="children"&&M!=="key"){fD(i),_("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",M),fD(null);break}}i.ref!==null&&(fD(i),_("Invalid attribute `ref` supplied to `React.Fragment`."),fD(null))}}function U1(i,p,A,M,X,K){{var $=bu(i);if(!$){var Y="";(i===void 0||typeof i=="object"&&i!==null&&Object.keys(i).length===0)&&(Y+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var pu=P2();pu?Y+=pu:Y+=I1();var tu;i===null?tu="null":Array.isArray(i)?tu="array":i!==void 0&&i.$$typeof===t?(tu="<"+(h(i.type)||"Unknown")+" />",Y=" Did you accidentally export a JSX literal instead of a component?"):tu=typeof i,_("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",tu,Y)}var au=O2(i,p,A,X,K);if(au==null)return au;if($){var zu=p.children;if(zu!==void 0)if(M)if(Array.isArray(zu)){for(var eD=0;eD<zu.length;eD++)z1(zu[eD],i);Object.freeze&&Object.freeze(zu)}else _("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else z1(zu,i)}return i===u.Fragment?M2(au):L2(au),au}}function z2(i,p,A){return U1(i,p,A,!0)}function U2(i,p,A){return U1(i,p,A,!1)}var V2=U2,W2=z2;u.jsx=V2,u.jsxs=W2}()}(jD)),jD}var q1={};q1.NODE_ENV==="production"?kD.exports=W1():kD.exports=H1();var s=kD.exports;const _f=c.createContext(void 0),yf=({children:u,channelName:D})=>{const f=c.useRef(new BroadcastChannel(D)),e=c.useRef({});c.useEffect(()=>{const r=({data:a})=>{e.current[a.event].forEach(F=>F(a))};return f.current.addEventListener("message",r),()=>{f.current.removeEventListener("message",r),f.current.close()}},[]);const t=(r,a)=>{var F;return(F=e.current)[r]??(F[r]=[]),e.current[r].push(a),()=>{const o=e.current[r].indexOf(a);o!==-1&&e.current[r].splice(o,1)}},n=r=>{f.current.postMessage(r)};return s.jsx(_f.Provider,{value:{subscribe:t,postMessage:n},children:u})},Y1=()=>{const u=c.useContext(_f);if(!u)throw new Error("useBroadcastChannel must be used within a BroadcastChannelProvider");return u},$1=(...u)=>{const{subscribe:D}=Y1();c.useEffect(()=>{D(...u)},[D,...u])};var TD=(u=>(u.message="message",u.delivery="delivery",u.read="read",u.typing="typing",u.follow="follow",u.echo="echo",u.unknown="",u))(TD||{}),Z=(u=>(u.sent="sent",u.received="received",u))(Z||{}),vf=(u=>(u.text="text",u.location="location",u))(vf||{}),yu=(u=>(u.text="text",u.quick_reply="quick_reply",u.postback="postback",u.location="location",u.file="file",u.notify="notify",u))(yu||{}),ND=(u=>(u.text="text",u.buttons="buttons",u.quick_replies="quick_replies",u.file="file",u.list="list",u.carousel="carousel",u))(ND||{}),tD=(u=>(u[u.sent=0]="sent",u[u.sending=1]="sending",u[u.uploading=2]="uploading",u))(tD||{}),Qu=(u=>(u[u.disconnected=0]="disconnected",u[u.wantToConnect=1]="wantToConnect",u[u.tryingToConnect=2]="tryingToConnect",u[u.connected=3]="connected",u))(Qu||{}),nD={};const wf={apiUrl:nD.REACT_APP_WIDGET_API_URL||"http://localhost:4000",channel:nD.REACT_APP_WIDGET_CHANNEL||"console-channel",language:"en",maxUploadSize:nD.UPLOAD_MAX_SIZE_IN_BYTES??""?Number(nD.UPLOAD_MAX_SIZE_IN_BYTES):20*1024*1024,ownerId:nD.REACT_APP_WIDGET_OWNER_ID||"68342cec1e3cef0065f1b563"},Af=c.createContext(wf),xf=({children:u,...D})=>{const f=c.useRef({...wf,...D});return s.jsx(Af.Provider,{value:f.current,children:u})},Iu=()=>{const u=c.useContext(Af);if(!u)throw new Error("useConfig must be used within a ConfigProvider");return u},kf={en:{user_subscription:{get_started:"Start Chat",first_name:"First Name",last_name:"Last Name",phone:"Phone Number",email:"Email Address"},settings:{greeting:"Welcome !",placeholder:"Write something...",connection_lost:"Connection Lost",back:"Back"},messages:{get_started:"Start Chat",file_message:{browser_audio_unsupport:"Browser does not support the audio element.",browser_video_unsupport:"Browser does not support the video element.",download:"Download",unsupported_file_type:"This file type is not supported.",unsupported_file_size:"This file size is not supported."}}},fr:{user_subscription:{get_started:"Commencer",first_name:"Prénom",last_name:"Nom",phone:"Numéro de Téléphone",email:"Adresse Email"},settings:{greeting:"Bienvenue !",placeholder:"Écrivez quelque chose...",connection_lost:"Connexion perdue",back:"Retour"},messages:{get_started:"Démarrer",file_message:{browser_audio_unsupport:"Le navigateur ne prend pas en charge l'élément audio.",browser_video_unsupport:"Le navigateur ne prend pas en charge l'élément vidéo.",download:"Télécharger",unsupported_file_type:"Ce type de fichier n'est pas pris en charge.",unsupported_file_size:"Cette taille de fichier n'est pas prise en charge."}}}},Sf=c.createContext(void 0),jf=({children:u})=>{const f=Iu().language,e=r=>r in kf,[t,n]=c.useState(e(f)?f:"en");return s.jsx(Sf.Provider,{value:{translations:kf,language:t,setLanguage:n},children:u})},K1=()=>{const u=c.useContext(Sf);if(!u)throw new Error("useTranslationContext must be used within a TranslationProvider");return u},J1=(u,D)=>D.split(".").reduce((f,e)=>{if(typeof f=="object"&&f!==null)return f[e]},u),Su=()=>{const{translations:u,language:D}=K1();return{t:c.useCallback((e,t={})=>(J1(u[D],e)||e).replace(/{(\w+)}/g,(r,a)=>t[a]||`{${a}}`),[D,u])}};function G1(u,D){if(typeof D>"u")throw new Error("Value cannot be undefined");return sessionStorage.setItem(u,JSON.stringify(D)),!0}function X1(u){const D=sessionStorage.getItem(u);return D===null?null:JSON.parse(D)}const Tf={setItem:G1,getItem:X1},ju=Object.create(null);ju.open="0",ju.close="1",ju.ping="2",ju.pong="3",ju.message="4",ju.upgrade="5",ju.noop="6";const oD=Object.create(null);Object.keys(ju).forEach(u=>{oD[ju[u]]=u});const RD={type:"error",data:"parser error"},Nf=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",Rf=typeof ArrayBuffer=="function",Of=u=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(u):u&&u.buffer instanceof ArrayBuffer,OD=({type:u,data:D},f,e)=>Nf&&D instanceof Blob?f?e(D):Pf(D,e):Rf&&(D instanceof ArrayBuffer||Of(D))?f?e(D):Pf(new Blob([D]),e):e(ju[u]+(D||"")),Pf=(u,D)=>{const f=new FileReader;return f.onload=function(){const e=f.result.split(",")[1];D("b"+(e||""))},f.readAsDataURL(u)};function If(u){return u instanceof Uint8Array?u:u instanceof ArrayBuffer?new Uint8Array(u):new Uint8Array(u.buffer,u.byteOffset,u.byteLength)}let PD;function Z1(u,D){if(Nf&&u.data instanceof Blob)return u.data.arrayBuffer().then(If).then(D);if(Rf&&(u.data instanceof ArrayBuffer||Of(u.data)))return D(If(u.data));OD(u,!1,f=>{PD||(PD=new TextEncoder),D(PD.encode(f))})}const Lf="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",rD=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let u=0;u<Lf.length;u++)rD[Lf.charCodeAt(u)]=u;const Q1=u=>{let D=u.length*.75,f=u.length,e,t=0,n,r,a,F;u[u.length-1]==="="&&(D--,u[u.length-2]==="="&&D--);const o=new ArrayBuffer(D),d=new Uint8Array(o);for(e=0;e<f;e+=4)n=rD[u.charCodeAt(e)],r=rD[u.charCodeAt(e+1)],a=rD[u.charCodeAt(e+2)],F=rD[u.charCodeAt(e+3)],d[t++]=n<<2|r>>4,d[t++]=(r&15)<<4|a>>2,d[t++]=(a&3)<<6|F&63;return o},u0=typeof ArrayBuffer=="function",ID=(u,D)=>{if(typeof u!="string")return{type:"message",data:Mf(u,D)};const f=u.charAt(0);return f==="b"?{type:"message",data:D0(u.substring(1),D)}:oD[f]?u.length>1?{type:oD[f],data:u.substring(1)}:{type:oD[f]}:RD},D0=(u,D)=>{if(u0){const f=Q1(u);return Mf(f,D)}else return{base64:!0,data:u}},Mf=(u,D)=>{switch(D){case"blob":return u instanceof Blob?u:new Blob([u]);case"arraybuffer":default:return u instanceof ArrayBuffer?u:u.buffer}},zf="",f0=(u,D)=>{const f=u.length,e=new Array(f);let t=0;u.forEach((n,r)=>{OD(n,!1,a=>{e[r]=a,++t===f&&D(e.join(zf))})})},e0=(u,D)=>{const f=u.split(zf),e=[];for(let t=0;t<f.length;t++){const n=ID(f[t],D);if(e.push(n),n.type==="error")break}return e};function t0(){return new TransformStream({transform(u,D){Z1(u,f=>{const e=f.length;let t;if(e<126)t=new Uint8Array(1),new DataView(t.buffer).setUint8(0,e);else if(e<65536){t=new Uint8Array(3);const n=new DataView(t.buffer);n.setUint8(0,126),n.setUint16(1,e)}else{t=new Uint8Array(9);const n=new DataView(t.buffer);n.setUint8(0,127),n.setBigUint64(1,BigInt(e))}u.data&&typeof u.data!="string"&&(t[0]|=128),D.enqueue(t),D.enqueue(f)})}})}let LD;function dD(u){return u.reduce((D,f)=>D+f.length,0)}function CD(u,D){if(u[0].length===D)return u.shift();const f=new Uint8Array(D);let e=0;for(let t=0;t<D;t++)f[t]=u[0][e++],e===u[0].length&&(u.shift(),e=0);return u.length&&e<u[0].length&&(u[0]=u[0].slice(e)),f}function n0(u,D){LD||(LD=new TextDecoder);const f=[];let e=0,t=-1,n=!1;return new TransformStream({transform(r,a){for(f.push(r);;){if(e===0){if(dD(f)<1)break;const F=CD(f,1);n=(F[0]&128)===128,t=F[0]&127,t<126?e=3:t===126?e=1:e=2}else if(e===1){if(dD(f)<2)break;const F=CD(f,2);t=new DataView(F.buffer,F.byteOffset,F.length).getUint16(0),e=3}else if(e===2){if(dD(f)<8)break;const F=CD(f,8),o=new DataView(F.buffer,F.byteOffset,F.length),d=o.getUint32(0);if(d>Math.pow(2,21)-1){a.enqueue(RD);break}t=d*Math.pow(2,32)+o.getUint32(4),e=3}else{if(dD(f)<t)break;const F=CD(f,t);a.enqueue(ID(n?F:LD.decode(F),D)),e=0}if(t===0||t>u){a.enqueue(RD);break}}}})}const Uf=4;function nu(u){if(u)return r0(u)}function r0(u){for(var D in nu.prototype)u[D]=nu.prototype[D];return u}nu.prototype.on=nu.prototype.addEventListener=function(u,D){return this._callbacks=this._callbacks||{},(this._callbacks["$"+u]=this._callbacks["$"+u]||[]).push(D),this},nu.prototype.once=function(u,D){function f(){this.off(u,f),D.apply(this,arguments)}return f.fn=D,this.on(u,f),this},nu.prototype.off=nu.prototype.removeListener=nu.prototype.removeAllListeners=nu.prototype.removeEventListener=function(u,D){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var f=this._callbacks["$"+u];if(!f)return this;if(arguments.length==1)return delete this._callbacks["$"+u],this;for(var e,t=0;t<f.length;t++)if(e=f[t],e===D||e.fn===D){f.splice(t,1);break}return f.length===0&&delete this._callbacks["$"+u],this},nu.prototype.emit=function(u){this._callbacks=this._callbacks||{};for(var D=new Array(arguments.length-1),f=this._callbacks["$"+u],e=1;e<arguments.length;e++)D[e-1]=arguments[e];if(f){f=f.slice(0);for(var e=0,t=f.length;e<t;++e)f[e].apply(this,D)}return this},nu.prototype.emitReserved=nu.prototype.emit,nu.prototype.listeners=function(u){return this._callbacks=this._callbacks||{},this._callbacks["$"+u]||[]},nu.prototype.hasListeners=function(u){return!!this.listeners(u).length};const cD=typeof Promise=="function"&&typeof Promise.resolve=="function"?D=>Promise.resolve().then(D):(D,f)=>f(D,0),vu=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),s0="arraybuffer";function u8(){}function Vf(u,...D){return D.reduce((f,e)=>(u.hasOwnProperty(e)&&(f[e]=u[e]),f),{})}const a0=vu.setTimeout,F0=vu.clearTimeout;function lD(u,D){D.useNativeTimers?(u.setTimeoutFn=a0.bind(vu),u.clearTimeoutFn=F0.bind(vu)):(u.setTimeoutFn=vu.setTimeout.bind(vu),u.clearTimeoutFn=vu.clearTimeout.bind(vu))}const i0=1.33;function o0(u){return typeof u=="string"?d0(u):Math.ceil((u.byteLength||u.size)*i0)}function d0(u){let D=0,f=0;for(let e=0,t=u.length;e<t;e++)D=u.charCodeAt(e),D<128?f+=1:D<2048?f+=2:D<55296||D>=57344?f+=3:(e++,f+=4);return f}function Wf(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function C0(u){let D="";for(let f in u)u.hasOwnProperty(f)&&(D.length&&(D+="&"),D+=encodeURIComponent(f)+"="+encodeURIComponent(u[f]));return D}function c0(u){let D={},f=u.split("&");for(let e=0,t=f.length;e<t;e++){let n=f[e].split("=");D[decodeURIComponent(n[0])]=decodeURIComponent(n[1])}return D}class l0 extends Error{constructor(D,f,e){super(D),this.description=f,this.context=e,this.type="TransportError"}}class MD extends nu{constructor(D){super(),this.writable=!1,lD(this,D),this.opts=D,this.query=D.query,this.socket=D.socket,this.supportsBinary=!D.forceBase64}onError(D,f,e){return super.emitReserved("error",new l0(D,f,e)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(D){this.readyState==="open"&&this.write(D)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(D){const f=ID(D,this.socket.binaryType);this.onPacket(f)}onPacket(D){super.emitReserved("packet",D)}onClose(D){this.readyState="closed",super.emitReserved("close",D)}pause(D){}createUri(D,f={}){return D+"://"+this._hostname()+this._port()+this.opts.path+this._query(f)}_hostname(){const D=this.opts.hostname;return D.indexOf(":")===-1?D:"["+D+"]"}_port(){return this.opts.port&&(this.opts.secure&&+(this.opts.port!==443)||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(D){const f=C0(D);return f.length?"?"+f:""}}class E0 extends MD{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(D){this.readyState="pausing";const f=()=>{this.readyState="paused",D()};if(this._polling||!this.writable){let e=0;this._polling&&(e++,this.once("pollComplete",function(){--e||f()})),this.writable||(e++,this.once("drain",function(){--e||f()}))}else f()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(D){const f=e=>{if(this.readyState==="opening"&&e.type==="open"&&this.onOpen(),e.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(e)};e0(D,this.socket.binaryType).forEach(f),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const D=()=>{this.write([{type:"close"}])};this.readyState==="open"?D():this.once("open",D)}write(D){this.writable=!1,f0(D,f=>{this.doWrite(f,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const D=this.opts.secure?"https":"http",f=this.query||{};return this.opts.timestampRequests!==!1&&(f[this.opts.timestampParam]=Wf()),!this.supportsBinary&&!f.sid&&(f.b64=1),this.createUri(D,f)}}let Hf=!1;try{Hf=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const h0=Hf;function b0(){}class p0 extends E0{constructor(D){if(super(D),typeof location<"u"){const f=location.protocol==="https:";let e=location.port;e||(e=f?"443":"80"),this.xd=typeof location<"u"&&D.hostname!==location.hostname||e!==D.port}}doWrite(D,f){const e=this.request({method:"POST",data:D});e.on("success",f),e.on("error",(t,n)=>{this.onError("xhr post error",t,n)})}doPoll(){const D=this.request();D.on("data",this.onData.bind(this)),D.on("error",(f,e)=>{this.onError("xhr poll error",f,e)}),this.pollXhr=D}}class Tu extends nu{constructor(D,f,e){super(),this.createRequest=D,lD(this,e),this._opts=e,this._method=e.method||"GET",this._uri=f,this._data=e.data!==void 0?e.data:null,this._create()}_create(){var D;const f=Vf(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");f.xdomain=!!this._opts.xd;const e=this._xhr=this.createRequest(f);try{e.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){e.setDisableHeaderCheck&&e.setDisableHeaderCheck(!0);for(let t in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(t)&&e.setRequestHeader(t,this._opts.extraHeaders[t])}}catch{}if(this._method==="POST")try{e.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{e.setRequestHeader("Accept","*/*")}catch{}(D=this._opts.cookieJar)===null||D===void 0||D.addCookies(e),"withCredentials"in e&&(e.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(e.timeout=this._opts.requestTimeout),e.onreadystatechange=()=>{var t;e.readyState===3&&((t=this._opts.cookieJar)===null||t===void 0||t.parseCookies(e.getResponseHeader("set-cookie"))),e.readyState===4&&(e.status===200||e.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof e.status=="number"?e.status:0)},0))},e.send(this._data)}catch(t){this.setTimeoutFn(()=>{this._onError(t)},0);return}typeof document<"u"&&(this._index=Tu.requestsCount++,Tu.requests[this._index]=this)}_onError(D){this.emitReserved("error",D,this._xhr),this._cleanup(!0)}_cleanup(D){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=b0,D)try{this._xhr.abort()}catch{}typeof document<"u"&&delete Tu.requests[this._index],this._xhr=null}}_onLoad(){const D=this._xhr.responseText;D!==null&&(this.emitReserved("data",D),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}if(Tu.requestsCount=0,Tu.requests={},typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",qf);else if(typeof addEventListener=="function"){const u="onpagehide"in vu?"pagehide":"unload";addEventListener(u,qf,!1)}}function qf(){for(let u in Tu.requests)Tu.requests.hasOwnProperty(u)&&Tu.requests[u].abort()}const B0=function(){const u=Yf({xdomain:!1});return u&&u.responseType!==null}();class g0 extends p0{constructor(D){super(D);const f=D&&D.forceBase64;this.supportsBinary=B0&&!f}request(D={}){return Object.assign(D,{xd:this.xd},this.opts),new Tu(Yf,this.uri(),D)}}function Yf(u){const D=u.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!D||h0))return new XMLHttpRequest}catch{}if(!D)try{return new vu[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const $f=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class m0 extends MD{get name(){return"websocket"}doOpen(){const D=this.uri(),f=this.opts.protocols,e=$f?{}:Vf(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(e.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(D,f,e)}catch(t){return this.emitReserved("error",t)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=D=>this.onClose({description:"websocket connection closed",context:D}),this.ws.onmessage=D=>this.onData(D.data),this.ws.onerror=D=>this.onError("websocket error",D)}write(D){this.writable=!1;for(let f=0;f<D.length;f++){const e=D[f],t=f===D.length-1;OD(e,this.supportsBinary,n=>{try{this.doWrite(e,n)}catch{}t&&cD(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const D=this.opts.secure?"wss":"ws",f=this.query||{};return this.opts.timestampRequests&&(f[this.opts.timestampParam]=Wf()),this.supportsBinary||(f.b64=1),this.createUri(D,f)}}const zD=vu.WebSocket||vu.MozWebSocket;class _0 extends m0{createSocket(D,f,e){return $f?new zD(D,f,e):f?new zD(D,f):new zD(D)}doWrite(D,f){this.ws.send(f)}}class y0 extends MD{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(D){return this.emitReserved("error",D)}this._transport.closed.then(()=>{this.onClose()}).catch(D=>{this.onError("webtransport error",D)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(D=>{const f=n0(Number.MAX_SAFE_INTEGER,this.socket.binaryType),e=D.readable.pipeThrough(f).getReader(),t=t0();t.readable.pipeTo(D.writable),this._writer=t.writable.getWriter();const n=()=>{e.read().then(({done:a,value:F})=>{a||(this.onPacket(F),n())}).catch(a=>{})};n();const r={type:"open"};this.query.sid&&(r.data=`{"sid":"${this.query.sid}"}`),this._writer.write(r).then(()=>this.onOpen())})})}write(D){this.writable=!1;for(let f=0;f<D.length;f++){const e=D[f],t=f===D.length-1;this._writer.write(e).then(()=>{t&&cD(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var D;(D=this._transport)===null||D===void 0||D.close()}}const v0={websocket:_0,webtransport:y0,polling:g0},w0=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,A0=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function UD(u){if(u.length>8e3)throw"URI too long";const D=u,f=u.indexOf("["),e=u.indexOf("]");f!=-1&&e!=-1&&(u=u.substring(0,f)+u.substring(f,e).replace(/:/g,";")+u.substring(e,u.length));let t=w0.exec(u||""),n={},r=14;for(;r--;)n[A0[r]]=t[r]||"";return f!=-1&&e!=-1&&(n.source=D,n.host=n.host.substring(1,n.host.length-1).replace(/;/g,":"),n.authority=n.authority.replace("[","").replace("]","").replace(/;/g,":"),n.ipv6uri=!0),n.pathNames=x0(n,n.path),n.queryKey=k0(n,n.query),n}function x0(u,D){const f=/\/{2,9}/g,e=D.replace(f,"/").split("/");return(D.slice(0,1)=="/"||D.length===0)&&e.splice(0,1),D.slice(-1)=="/"&&e.splice(e.length-1,1),e}function k0(u,D){const f={};return D.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(e,t,n){t&&(f[t]=n)}),f}const VD=typeof addEventListener=="function"&&typeof removeEventListener=="function",ED=[];VD&&addEventListener("offline",()=>{ED.forEach(u=>u())},!1);class Vu extends nu{constructor(D,f){if(super(),this.binaryType=s0,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,D&&typeof D=="object"&&(f=D,D=null),D){const e=UD(D);f.hostname=e.host,f.secure=e.protocol==="https"||e.protocol==="wss",f.port=e.port,e.query&&(f.query=e.query)}else f.host&&(f.hostname=UD(f.host).host);lD(this,f),this.secure=f.secure!=null?f.secure:typeof location<"u"&&location.protocol==="https:",f.hostname&&!f.port&&(f.port=this.secure?"443":"80"),this.hostname=f.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=f.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},f.transports.forEach(e=>{const t=e.prototype.name;this.transports.push(t),this._transportsByName[t]=e}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},f),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=c0(this.opts.query)),VD&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},ED.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(D){const f=Object.assign({},this.opts.query);f.EIO=Uf,f.transport=D,this.id&&(f.sid=this.id);const e=Object.assign({},this.opts,{query:f,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[D]);return new this._transportsByName[D](e)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const D=this.opts.rememberUpgrade&&Vu.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const f=this.createTransport(D);f.open(),this.setTransport(f)}setTransport(D){this.transport&&this.transport.removeAllListeners(),this.transport=D,D.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",f=>this._onClose("transport close",f))}onOpen(){this.readyState="open",Vu.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(D){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",D),this.emitReserved("heartbeat"),D.type){case"open":this.onHandshake(JSON.parse(D.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const f=new Error("server error");f.code=D.data,this._onError(f);break;case"message":this.emitReserved("data",D.data),this.emitReserved("message",D.data);break}}onHandshake(D){this.emitReserved("handshake",D),this.id=D.sid,this.transport.query.sid=D.sid,this._pingInterval=D.pingInterval,this._pingTimeout=D.pingTimeout,this._maxPayload=D.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const D=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+D,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},D),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const D=this._getWritablePackets();this.transport.send(D),this._prevBufferLen=D.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let f=1;for(let e=0;e<this.writeBuffer.length;e++){const t=this.writeBuffer[e].data;if(t&&(f+=o0(t)),e>0&&f>this._maxPayload)return this.writeBuffer.slice(0,e);f+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const D=Date.now()>this._pingTimeoutTime;return D&&(this._pingTimeoutTime=0,cD(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),D}write(D,f,e){return this._sendPacket("message",D,f,e),this}send(D,f,e){return this._sendPacket("message",D,f,e),this}_sendPacket(D,f,e,t){if(typeof f=="function"&&(t=f,f=void 0),typeof e=="function"&&(t=e,e=null),this.readyState==="closing"||this.readyState==="closed")return;e=e||{},e.compress=e.compress!==!1;const n={type:D,data:f,options:e};this.emitReserved("packetCreate",n),this.writeBuffer.push(n),t&&this.once("flush",t),this.flush()}close(){const D=()=>{this._onClose("forced close"),this.transport.close()},f=()=>{this.off("upgrade",f),this.off("upgradeError",f),D()},e=()=>{this.once("upgrade",f),this.once("upgradeError",f)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?e():D()}):this.upgrading?e():D()),this}_onError(D){if(Vu.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",D),this._onClose("transport error",D)}_onClose(D,f){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),VD&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const e=ED.indexOf(this._offlineEventListener);e!==-1&&ED.splice(e,1)}this.readyState="closed",this.id=null,this.emitReserved("close",D,f),this.writeBuffer=[],this._prevBufferLen=0}}}Vu.protocol=Uf;class S0 extends Vu{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let D=0;D<this._upgrades.length;D++)this._probe(this._upgrades[D])}_probe(D){let f=this.createTransport(D),e=!1;Vu.priorWebsocketSuccess=!1;const t=()=>{e||(f.send([{type:"ping",data:"probe"}]),f.once("packet",l=>{if(!e)if(l.type==="pong"&&l.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",f),!f)return;Vu.priorWebsocketSuccess=f.name==="websocket",this.transport.pause(()=>{e||this.readyState!=="closed"&&(d(),this.setTransport(f),f.send([{type:"upgrade"}]),this.emitReserved("upgrade",f),f=null,this.upgrading=!1,this.flush())})}else{const E=new Error("probe error");E.transport=f.name,this.emitReserved("upgradeError",E)}}))};function n(){e||(e=!0,d(),f.close(),f=null)}const r=l=>{const E=new Error("probe error: "+l);E.transport=f.name,n(),this.emitReserved("upgradeError",E)};function a(){r("transport closed")}function F(){r("socket closed")}function o(l){f&&l.name!==f.name&&n()}const d=()=>{f.removeListener("open",t),f.removeListener("error",r),f.removeListener("close",a),this.off("close",F),this.off("upgrading",o)};f.once("open",t),f.once("error",r),f.once("close",a),this.once("close",F),this.once("upgrading",o),this._upgrades.indexOf("webtransport")!==-1&&D!=="webtransport"?this.setTimeoutFn(()=>{e||f.open()},200):f.open()}onHandshake(D){this._upgrades=this._filterUpgrades(D.upgrades),super.onHandshake(D)}_filterUpgrades(D){const f=[];for(let e=0;e<D.length;e++)~this.transports.indexOf(D[e])&&f.push(D[e]);return f}}let j0=class extends S0{constructor(D,f={}){const e=typeof D=="object"?D:f;(!e.transports||e.transports&&typeof e.transports[0]=="string")&&(e.transports=(e.transports||["polling","websocket","webtransport"]).map(t=>v0[t]).filter(t=>!!t)),super(D,e)}};function T0(u,D="",f){let e=u;f=f||typeof location<"u"&&location,u==null&&(u=f.protocol+"//"+f.host),typeof u=="string"&&(u.charAt(0)==="/"&&(u.charAt(1)==="/"?u=f.protocol+u:u=f.host+u),/^(https?|wss?):\/\//.test(u)||(typeof f<"u"?u=f.protocol+"//"+u:u="https://"+u),e=UD(u)),e.port||(/^(http|ws)$/.test(e.protocol)?e.port="80":/^(http|ws)s$/.test(e.protocol)&&(e.port="443")),e.path=e.path||"/";const n=e.host.indexOf(":")!==-1?"["+e.host+"]":e.host;return e.id=e.protocol+"://"+n+":"+e.port+D,e.href=e.protocol+"://"+n+(f&&f.port===e.port?"":":"+e.port),e}const N0=typeof ArrayBuffer=="function",R0=u=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(u):u.buffer instanceof ArrayBuffer,Kf=Object.prototype.toString,O0=typeof Blob=="function"||typeof Blob<"u"&&Kf.call(Blob)==="[object BlobConstructor]",P0=typeof File=="function"||typeof File<"u"&&Kf.call(File)==="[object FileConstructor]";function WD(u){return N0&&(u instanceof ArrayBuffer||R0(u))||O0&&u instanceof Blob||P0&&u instanceof File}function hD(u,D){if(!u||typeof u!="object")return!1;if(Array.isArray(u)){for(let f=0,e=u.length;f<e;f++)if(hD(u[f]))return!0;return!1}if(WD(u))return!0;if(u.toJSON&&typeof u.toJSON=="function"&&arguments.length===1)return hD(u.toJSON(),!0);for(const f in u)if(Object.prototype.hasOwnProperty.call(u,f)&&hD(u[f]))return!0;return!1}function I0(u){const D=[],f=u.data,e=u;return e.data=HD(f,D),e.attachments=D.length,{packet:e,buffers:D}}function HD(u,D){if(!u)return u;if(WD(u)){const f={_placeholder:!0,num:D.length};return D.push(u),f}else if(Array.isArray(u)){const f=new Array(u.length);for(let e=0;e<u.length;e++)f[e]=HD(u[e],D);return f}else if(typeof u=="object"&&!(u instanceof Date)){const f={};for(const e in u)Object.prototype.hasOwnProperty.call(u,e)&&(f[e]=HD(u[e],D));return f}return u}function L0(u,D){return u.data=qD(u.data,D),delete u.attachments,u}function qD(u,D){if(!u)return u;if(u&&u._placeholder===!0){if(typeof u.num=="number"&&u.num>=0&&u.num<D.length)return D[u.num];throw new Error("illegal attachments")}else if(Array.isArray(u))for(let f=0;f<u.length;f++)u[f]=qD(u[f],D);else if(typeof u=="object")for(const f in u)Object.prototype.hasOwnProperty.call(u,f)&&(u[f]=qD(u[f],D));return u}const M0=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],z0=5;var H;(function(u){u[u.CONNECT=0]="CONNECT",u[u.DISCONNECT=1]="DISCONNECT",u[u.EVENT=2]="EVENT",u[u.ACK=3]="ACK",u[u.CONNECT_ERROR=4]="CONNECT_ERROR",u[u.BINARY_EVENT=5]="BINARY_EVENT",u[u.BINARY_ACK=6]="BINARY_ACK"})(H||(H={}));class U0{constructor(D){this.replacer=D}encode(D){return(D.type===H.EVENT||D.type===H.ACK)&&hD(D)?this.encodeAsBinary({type:D.type===H.EVENT?H.BINARY_EVENT:H.BINARY_ACK,nsp:D.nsp,data:D.data,id:D.id}):[this.encodeAsString(D)]}encodeAsString(D){let f=""+D.type;return(D.type===H.BINARY_EVENT||D.type===H.BINARY_ACK)&&(f+=D.attachments+"-"),D.nsp&&D.nsp!=="/"&&(f+=D.nsp+","),D.id!=null&&(f+=D.id),D.data!=null&&(f+=JSON.stringify(D.data,this.replacer)),f}encodeAsBinary(D){const f=I0(D),e=this.encodeAsString(f.packet),t=f.buffers;return t.unshift(e),t}}function Jf(u){return Object.prototype.toString.call(u)==="[object Object]"}class YD extends nu{constructor(D){super(),this.reviver=D}add(D){let f;if(typeof D=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");f=this.decodeString(D);const e=f.type===H.BINARY_EVENT;e||f.type===H.BINARY_ACK?(f.type=e?H.EVENT:H.ACK,this.reconstructor=new V0(f),f.attachments===0&&super.emitReserved("decoded",f)):super.emitReserved("decoded",f)}else if(WD(D)||D.base64)if(this.reconstructor)f=this.reconstructor.takeBinaryData(D),f&&(this.reconstructor=null,super.emitReserved("decoded",f));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+D)}decodeString(D){let f=0;const e={type:Number(D.charAt(0))};if(H[e.type]===void 0)throw new Error("unknown packet type "+e.type);if(e.type===H.BINARY_EVENT||e.type===H.BINARY_ACK){const n=f+1;for(;D.charAt(++f)!=="-"&&f!=D.length;);const r=D.substring(n,f);if(r!=Number(r)||D.charAt(f)!=="-")throw new Error("Illegal attachments");e.attachments=Number(r)}if(D.charAt(f+1)==="/"){const n=f+1;for(;++f&&!(D.charAt(f)===","||f===D.length););e.nsp=D.substring(n,f)}else e.nsp="/";const t=D.charAt(f+1);if(t!==""&&Number(t)==t){const n=f+1;for(;++f;){const r=D.charAt(f);if(r==null||Number(r)!=r){--f;break}if(f===D.length)break}e.id=Number(D.substring(n,f+1))}if(D.charAt(++f)){const n=this.tryParse(D.substr(f));if(YD.isPayloadValid(e.type,n))e.data=n;else throw new Error("invalid payload")}return e}tryParse(D){try{return JSON.parse(D,this.reviver)}catch{return!1}}static isPayloadValid(D,f){switch(D){case H.CONNECT:return Jf(f);case H.DISCONNECT:return f===void 0;case H.CONNECT_ERROR:return typeof f=="string"||Jf(f);case H.EVENT:case H.BINARY_EVENT:return Array.isArray(f)&&(typeof f[0]=="number"||typeof f[0]=="string"&&M0.indexOf(f[0])===-1);case H.ACK:case H.BINARY_ACK:return Array.isArray(f)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class V0{constructor(D){this.packet=D,this.buffers=[],this.reconPack=D}takeBinaryData(D){if(this.buffers.push(D),this.buffers.length===this.reconPack.attachments){const f=L0(this.reconPack,this.buffers);return this.finishedReconstruction(),f}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const W0=Object.freeze(Object.defineProperty({__proto__:null,Decoder:YD,Encoder:U0,get PacketType(){return H},protocol:z0},Symbol.toStringTag,{value:"Module"}));function xu(u,D,f){return u.on(D,f),function(){u.off(D,f)}}const H0=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class Gf extends nu{constructor(D,f,e){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=D,this.nsp=f,e&&e.auth&&(this.auth=e.auth),this._opts=Object.assign({},e),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const D=this.io;this.subs=[xu(D,"open",this.onopen.bind(this)),xu(D,"packet",this.onpacket.bind(this)),xu(D,"error",this.onerror.bind(this)),xu(D,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...D){return D.unshift("message"),this.emit.apply(this,D),this}emit(D,...f){var e,t,n;if(H0.hasOwnProperty(D))throw new Error('"'+D.toString()+'" is a reserved event name');if(f.unshift(D),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(f),this;const r={type:H.EVENT,data:f};if(r.options={},r.options.compress=this.flags.compress!==!1,typeof f[f.length-1]=="function"){const d=this.ids++,l=f.pop();this._registerAckCallback(d,l),r.id=d}const a=(t=(e=this.io.engine)===null||e===void 0?void 0:e.transport)===null||t===void 0?void 0:t.writable,F=this.connected&&!(!((n=this.io.engine)===null||n===void 0)&&n._hasPingExpired());return this.flags.volatile&&!a||(F?(this.notifyOutgoingListeners(r),this.packet(r)):this.sendBuffer.push(r)),this.flags={},this}_registerAckCallback(D,f){var e;const t=(e=this.flags.timeout)!==null&&e!==void 0?e:this._opts.ackTimeout;if(t===void 0){this.acks[D]=f;return}const n=this.io.setTimeoutFn(()=>{delete this.acks[D];for(let a=0;a<this.sendBuffer.length;a++)this.sendBuffer[a].id===D&&this.sendBuffer.splice(a,1);f.call(this,new Error("operation has timed out"))},t),r=(...a)=>{this.io.clearTimeoutFn(n),f.apply(this,a)};r.withError=!0,this.acks[D]=r}emitWithAck(D,...f){return new Promise((e,t)=>{const n=(r,a)=>r?t(r):e(a);n.withError=!0,f.push(n),this.emit(D,...f)})}_addToQueue(D){let f;typeof D[D.length-1]=="function"&&(f=D.pop());const e={id:this._queueSeq++,tryCount:0,pending:!1,args:D,flags:Object.assign({fromQueue:!0},this.flags)};D.push((t,...n)=>e!==this._queue[0]?void 0:(t!==null?e.tryCount>this._opts.retries&&(this._queue.shift(),f&&f(t)):(this._queue.shift(),f&&f(null,...n)),e.pending=!1,this._drainQueue())),this._queue.push(e),this._drainQueue()}_drainQueue(D=!1){if(!this.connected||this._queue.length===0)return;const f=this._queue[0];f.pending&&!D||(f.pending=!0,f.tryCount++,this.flags=f.flags,this.emit.apply(this,f.args))}packet(D){D.nsp=this.nsp,this.io._packet(D)}onopen(){typeof this.auth=="function"?this.auth(D=>{this._sendConnectPacket(D)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(D){this.packet({type:H.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},D):D})}onerror(D){this.connected||this.emitReserved("connect_error",D)}onclose(D,f){this.connected=!1,delete this.id,this.emitReserved("disconnect",D,f),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(D=>{if(!this.sendBuffer.some(e=>String(e.id)===D)){const e=this.acks[D];delete this.acks[D],e.withError&&e.call(this,new Error("socket has been disconnected"))}})}onpacket(D){if(D.nsp===this.nsp)switch(D.type){case H.CONNECT:D.data&&D.data.sid?this.onconnect(D.data.sid,D.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case H.EVENT:case H.BINARY_EVENT:this.onevent(D);break;case H.ACK:case H.BINARY_ACK:this.onack(D);break;case H.DISCONNECT:this.ondisconnect();break;case H.CONNECT_ERROR:this.destroy();const e=new Error(D.data.message);e.data=D.data.data,this.emitReserved("connect_error",e);break}}onevent(D){const f=D.data||[];D.id!=null&&f.push(this.ack(D.id)),this.connected?this.emitEvent(f):this.receiveBuffer.push(Object.freeze(f))}emitEvent(D){if(this._anyListeners&&this._anyListeners.length){const f=this._anyListeners.slice();for(const e of f)e.apply(this,D)}super.emit.apply(this,D),this._pid&&D.length&&typeof D[D.length-1]=="string"&&(this._lastOffset=D[D.length-1])}ack(D){const f=this;let e=!1;return function(...t){e||(e=!0,f.packet({type:H.ACK,id:D,data:t}))}}onack(D){const f=this.acks[D.id];typeof f=="function"&&(delete this.acks[D.id],f.withError&&D.data.unshift(null),f.apply(this,D.data))}onconnect(D,f){this.id=D,this.recovered=f&&this._pid===f,this._pid=f,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(D=>this.emitEvent(D)),this.receiveBuffer=[],this.sendBuffer.forEach(D=>{this.notifyOutgoingListeners(D),this.packet(D)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(D=>D()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:H.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(D){return this.flags.compress=D,this}get volatile(){return this.flags.volatile=!0,this}timeout(D){return this.flags.timeout=D,this}onAny(D){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(D),this}prependAny(D){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(D),this}offAny(D){if(!this._anyListeners)return this;if(D){const f=this._anyListeners;for(let e=0;e<f.length;e++)if(D===f[e])return f.splice(e,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(D){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(D),this}prependAnyOutgoing(D){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(D),this}offAnyOutgoing(D){if(!this._anyOutgoingListeners)return this;if(D){const f=this._anyOutgoingListeners;for(let e=0;e<f.length;e++)if(D===f[e])return f.splice(e,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(D){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const f=this._anyOutgoingListeners.slice();for(const e of f)e.apply(this,D.data)}}}function uD(u){u=u||{},this.ms=u.min||100,this.max=u.max||1e4,this.factor=u.factor||2,this.jitter=u.jitter>0&&u.jitter<=1?u.jitter:0,this.attempts=0}uD.prototype.duration=function(){var u=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var D=Math.random(),f=Math.floor(D*this.jitter*u);u=Math.floor(D*10)&1?u+f:u-f}return Math.min(u,this.max)|0},uD.prototype.reset=function(){this.attempts=0},uD.prototype.setMin=function(u){this.ms=u},uD.prototype.setMax=function(u){this.max=u},uD.prototype.setJitter=function(u){this.jitter=u};class $D extends nu{constructor(D,f){var e;super(),this.nsps={},this.subs=[],D&&typeof D=="object"&&(f=D,D=void 0),f=f||{},f.path=f.path||"/socket.io",this.opts=f,lD(this,f),this.reconnection(f.reconnection!==!1),this.reconnectionAttempts(f.reconnectionAttempts||1/0),this.reconnectionDelay(f.reconnectionDelay||1e3),this.reconnectionDelayMax(f.reconnectionDelayMax||5e3),this.randomizationFactor((e=f.randomizationFactor)!==null&&e!==void 0?e:.5),this.backoff=new uD({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(f.timeout==null?2e4:f.timeout),this._readyState="closed",this.uri=D;const t=f.parser||W0;this.encoder=new t.Encoder,this.decoder=new t.Decoder,this._autoConnect=f.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(D){return arguments.length?(this._reconnection=!!D,D||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(D){return D===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=D,this)}reconnectionDelay(D){var f;return D===void 0?this._reconnectionDelay:(this._reconnectionDelay=D,(f=this.backoff)===null||f===void 0||f.setMin(D),this)}randomizationFactor(D){var f;return D===void 0?this._randomizationFactor:(this._randomizationFactor=D,(f=this.backoff)===null||f===void 0||f.setJitter(D),this)}reconnectionDelayMax(D){var f;return D===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=D,(f=this.backoff)===null||f===void 0||f.setMax(D),this)}timeout(D){return arguments.length?(this._timeout=D,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(D){if(~this._readyState.indexOf("open"))return this;this.engine=new j0(this.uri,this.opts);const f=this.engine,e=this;this._readyState="opening",this.skipReconnect=!1;const t=xu(f,"open",function(){e.onopen(),D&&D()}),n=a=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",a),D?D(a):this.maybeReconnectOnOpen()},r=xu(f,"error",n);if(this._timeout!==!1){const a=this._timeout,F=this.setTimeoutFn(()=>{t(),n(new Error("timeout")),f.close()},a);this.opts.autoUnref&&F.unref(),this.subs.push(()=>{this.clearTimeoutFn(F)})}return this.subs.push(t),this.subs.push(r),this}connect(D){return this.open(D)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const D=this.engine;this.subs.push(xu(D,"ping",this.onping.bind(this)),xu(D,"data",this.ondata.bind(this)),xu(D,"error",this.onerror.bind(this)),xu(D,"close",this.onclose.bind(this)),xu(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(D){try{this.decoder.add(D)}catch(f){this.onclose("parse error",f)}}ondecoded(D){cD(()=>{this.emitReserved("packet",D)},this.setTimeoutFn)}onerror(D){this.emitReserved("error",D)}socket(D,f){let e=this.nsps[D];return e?this._autoConnect&&!e.active&&e.connect():(e=new Gf(this,D,f),this.nsps[D]=e),e}_destroy(D){const f=Object.keys(this.nsps);for(const e of f)if(this.nsps[e].active)return;this._close()}_packet(D){const f=this.encoder.encode(D);for(let e=0;e<f.length;e++)this.engine.write(f[e],D.options)}cleanup(){this.subs.forEach(D=>D()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(D,f){var e;this.cleanup(),(e=this.engine)===null||e===void 0||e.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",D,f),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const D=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const f=this.backoff.duration();this._reconnecting=!0;const e=this.setTimeoutFn(()=>{D.skipReconnect||(this.emitReserved("reconnect_attempt",D.backoff.attempts),!D.skipReconnect&&D.open(t=>{t?(D._reconnecting=!1,D.reconnect(),this.emitReserved("reconnect_error",t)):D.onreconnect()}))},f);this.opts.autoUnref&&e.unref(),this.subs.push(()=>{this.clearTimeoutFn(e)})}}onreconnect(){const D=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",D)}}const sD={};function bD(u,D){typeof u=="object"&&(D=u,u=void 0),D=D||{};const f=T0(u,D.path||"/socket.io"),e=f.source,t=f.id,n=f.path,r=sD[t]&&n in sD[t].nsps,a=D.forceNew||D["force new connection"]||D.multiplex===!1||r;let F;return a?F=new $D(e,D):(sD[t]||(sD[t]=new $D(e,D)),F=sD[t]),f.query&&!D.query&&(D.query=f.queryKey),F.socket(f.path,D)}Object.assign(bD,{Manager:$D,Socket:Gf,io:bD,connect:bD});const q0=()=>typeof location>"u"?"unknown-host":location.host,KD=(u,D=q0())=>`${u}-${D}`;function Y0(u,D,f){if(typeof D>"u")throw new Error("Value cannot be undefined");return localStorage.setItem(KD(u,f),JSON.stringify(D)),!0}function $0(u,D){const f=localStorage.getItem(KD(u,D));return f===null?null:JSON.parse(f)}function K0(u,D){localStorage.removeItem(KD(u,D))}const J={setItem:Y0,getItem:$0,removeItem:K0},wD=class wD{constructor(D,f,e){AD(this,"socket");AD(this,"config");this.config={...wD.defaultConfig,...f,autoConnect:!1};const t=new URL(D);this.socket=bD(t.origin,this.config),this.init(e)}get io(){return this.socket.io}init({onConnect:D,onDisconnect:f,onConnectError:e}){D&&this.uniqueOn("connect",D),f&&this.uniqueOn("disconnect",f),e&&this.uniqueOn("connect_error",e)}uniqueOn(D,f){this.socket.off(D),this.socket.on(D,f)}disconnect(){this.socket.disconnect()}connect(){this.socket.active||this.socket.connect()}on(D,f){this.socket.on(D,f)}off(D,f){this.socket.off(D,f)}async request(D){const f=await this.socket.emitWithAck(D.method,D);if(f.statusCode>=200&&f.statusCode<300)return f;throw new Error(`Request failed with status code ${f.statusCode}: ${JSON.stringify(f.body)}`)}async get(D,f){return await this.request({method:"get",url:D,...f})}async post(D,f){return await this.request({method:"post",url:D,...f})}};AD(wD,"defaultConfig",{ackTimeout:1e3,retries:3,autoConnect:!0,reconnection:!0,reconnectionAttempts:100,reconnectionDelay:1e3,reconnectionDelayMax:5e3,timeout:2e4,addTrailingSlash:!0,transports:["websocket","polling"],upgrade:!0,withCredentials:!0});let JD=wD,GD;const J0=(u,D)=>{var e;const f=(e=J.getItem("profileLiveChat"))==null?void 0:e.id;return GD||(GD=new JD(u.apiUrl,{query:{channel:u.channel,ownerId:u.ownerId,profileId:f}},D)),GD},Xf=c.createContext({socket:{}}),Zf=u=>{const D=Iu(),f=c.useRef(J0(D,{onConnect:()=>{console.info("Hexabot Live Chat : Successfully established WS Connection!")},onConnectError:()=>{console.error("Hexabot Live Chat : Failed to establish WS Connection!")},onDisconnect:()=>{console.info("Hexabot Live Chat : Disconnected WS.")}}));return s.jsx(Xf.Provider,{value:{socket:f.current},children:u.children})},Wu=()=>c.useContext(Xf),XD=(u,D)=>{const{socket:f}=Wu();c.useEffect(()=>(f.on(u,D),()=>f.off(u,D)),[u,D,f])},G0=()=>{const{socket:u}=Wu();c.useEffect(()=>(u.connect(),()=>{u.disconnect()}),[])},pD={showEmoji:!0,showFile:!0,showLocation:!0,showTypingIndicator:!0,alwaysScrollToBottom:!0,focusOnOpen:!0,title:"Cellcast Bot :)",titleImageUrl:"",inputDisabled:!1,placeholder:"Write something...",menu:[],autoFlush:!0,allowedUploadTypes:["image/gif","image/png","image/jpeg"],color:"blue",greetingMessage:"Welcome to Cellcast Bot !",avatarUrl:"",logoUrl:"",formSettings:[],termsAndConditions:{url:"https://www.cellcast.com/au/legal/terms-conditions",text:"terms"},offline_mode:{status:"active",start_time:"",end_time:"",time_zone:"Etc/GMT+12"}},Qf=c.createContext(pD),u1=({children:u})=>{const{t:D}=Su(),f=Tf.getItem("settings"),[e,t]=c.useState(f||pD),n=c.useCallback(r=>{Tf.setItem("settings",r),t(r)},[]);return XD("settings",r=>{var a;n({...pD,showEmoji:r.show_emoji,showFile:r.show_file,showLocation:r.show_location,title:r.window_title,titleImageUrl:r.avatar_url,menu:r.menu,allowedUploadTypes:(a=r.allowed_upload_types)==null?void 0:a.split(","),inputDisabled:r.input_disabled,color:r.theme_color,greetingMessage:r.greeting_message,placeholder:D("settings.placeholder"),avatarUrl:r.avatar_url,logoUrl:r.logo_url,formSettings:r.form_settings,termsAndConditions:r.terms_and_conditions||pD.termsAndConditions,offline_mode:r.offline_mode})}),s.jsx(Qf.Provider,{value:e,children:u})},hu=()=>c.useContext(Qf),D1=c.createContext(void 0),f1=({onOpen:u,onClose:D,onScrollToTop:f,defaultScreen:e="prechat",children:t})=>{const[n,r]=c.useState(!0),[a,F]=c.useState(!1),[o,d]=c.useState(e),[l,E]=c.useState(100),R={syncState:n,isOpen:a,screen:o,scroll:l,setSyncState:g=>{r(g)},setIsOpen:g=>{F(g),n&&(g?u&&u():D&&D())},setScreen:g=>{d(["prechat","postchat","webview"].includes(g)?g:"chat")},setScroll:g=>{E(g),f&&n&&g===0&&f()}};return s.jsx(D1.Provider,{value:R,children:t})},Nu=()=>{const u=c.useContext(D1);if(u===void 0)throw new Error("useWidget must be used within a WidgetProvider");return u},X0=u=>new Intl.DateTimeFormat("en-GB",{hour:"2-digit",minute:"2-digit",hour12:!1,timeZone:u}).format(new Date),BD=u=>{const D=u||{};if(!D||D.status!=="active")return!1;if(D.start_time&&D.end_time&&D.time_zone){const f=X0(D.time_zone);return!(f>=D.start_time&&f<=D.end_time)}return!0},mu={participants:[{id:"chatbot",name:"Hexabot",foreign_id:"chatbot",imageUrl:""}],setParticipants:()=>{},outgoingMessageState:0,setOutgoingMessageState:()=>{},connectionState:0,setConnectionState:()=>{},messages:[],setMessages:()=>{},suggestions:[],setSuggestions:()=>{},showTypingIndicator:!1,setShowTypingIndicator:()=>{},newIOMessage:null,setNewIOMessage:()=>{},newMessagesCount:0,setNewMessagesCount:()=>{},webviewUrl:"",setWebviewUrl:()=>{},message:"",setMessage:()=>{},payload:null,setPayload:()=>{},file:null,setFile:()=>{},send:()=>{},handleSubscription:()=>{},isContactFormActive:!1,setIsContactFormActive:()=>{},isOfflineMode:!1,setIsOfflineMode:()=>{}},e1=c.createContext(mu),t1=({wantToConnect:u,defaultConnectionState:D=0,children:f})=>{const e=Iu(),t=hu(),{screen:n,setScreen:r}=Nu(),{setScroll:a,syncState:F,isOpen:o}=Nu(),d=Wu(),[l,E]=c.useState(mu.participants),[j,v]=c.useState(D),[C,N]=c.useState([]),[R,g]=c.useState(mu.newMessagesCount),[z,y]=c.useState(mu.showTypingIndicator),[B,P]=c.useState(mu.suggestions),[k,q]=c.useState(mu.newIOMessage),[_,x]=c.useState(mu.message),[w,bu]=c.useState(mu.outgoingMessageState),[fu,T]=c.useState(mu.payload),[h,b]=c.useState(mu.file),[S,m]=c.useState(mu.webviewUrl),[L,I]=c.useState(mu.isContactFormActive),[U,W]=c.useState(mu.isOfflineMode),{send:G}=ou(),{t:V}=Su(),Q=O=>{v(O),O===Qu.wantToConnect&&u&&u(),O===Qu.connected&&t.alwaysScrollToBottom&&a(101)},eu=t.offline_mode,cu=BD(eu),_u=O=>{if(q(O),J.setItem("isOffline",(O==null?void 0:O.isOffline)||!1),J.setItem("submitedFormLateTime",(O==null?void 0:O.submitedFormLateTime)||null),O&&"type"in O&&O.type==="typing")return z===!0;y(!1),O&&"mid"in O&&!C.find(uu=>O.mid===uu.mid)&&("author"in O&&(O.direction=O.author==="chatbot"?Z.received:Z.sent,O.read=!0,O.delivery=!0),N(uu=>[...uu.filter(su=>su.mid!==O.mid),O]),a(0),"direction"in O&&O.direction===Z.received&&!O.isOffline&&W(!1)),O&&"data"in O&&"quick_replies"in O.data?P((O.data.quick_replies||[]).map(uu=>({content_type:vf.text,text:uu.title,payload:uu.payload}))):P([]),o||g(uu=>uu+1),t.alwaysScrollToBottom&&a(101),bu(tD.sent)},{socket:Bu}=Wu(),ru=async({data:O})=>{var su;bu(O.type==="file"?tD.uploading:tD.sending),x("");const uu=await d.socket.post(`/webhook/${e.channel}/`,{data:{...O,author:(O==null?void 0:O.author)??((su=l[1])==null?void 0:su.id)}});console.log("🚀 ~ ChatProvider.tsx:351 ~ handleSend ~ sentMessage:",uu),console.log("=== CALLING handleNewIOMessage from handleSend (API Response) ===")},du=c.useCallback(async(O,uu)=>{try{v(2);const su=new URLSearchParams;Object.entries({...O&&uu?{first_name:O,last_name:uu}:{},_refresh:Date.now().toString()}).forEach(([gu,qu])=>{typeof qu=="string"&&qu.trim()&&su.append(gu,qu)}),su.append("owner_id",e.ownerId);const{body:lu}=await Bu.get(`/webhook/${e.channel}/?${su.toString()}`);console.log("jump here 2"),J.setItem("profileLiveChat",lu.profile),J.setItem("isOffline",cu||!1),J.setItem("submitedFormLateTime",lu.profile.submitedFormLateTime||null),N(lu.messages.map(gu=>({...gu,direction:gu.author===lu.profile.foreignId||gu.author===lu.profile.id?Z.sent:Z.received,read:gu.direction===Z.sent||gu.read,delivery:gu.direction===Z.sent||gu.delivery,isOffline:gu.isOffline||lu.profile.isOffline,submitedFormLateTime:gu.submitedFormLateTime||lu.profile.submitedFormLateTime}))),E([l[0],{id:lu.profile.foreignId,foreign_id:lu.profile.foreignId,name:`${lu.profile.firstName} ${lu.profile.firstName}`}]),C.length===0&&G({event,source:"get_started_button",data:{type:yu.postback,data:{text:V("messages.get_started"),payload:"GET_STARTED"},author:lu.profile.foreignId}}),v(3),r("chat")}catch(su){console.error("Unable to subscribe user",su),r("prechat"),v(0)}},[l,v,N,E,r,d]);XD(TD.message,O=>{console.log("=== CALLING handleNewIOMessage from useSubscribe (Socket Realtime) ==="),_u(O)}),XD(TD.typing,y);const Lu=O=>{O?(m(O),r("webview")):r("chat")};c.useEffect(()=>{F&&o&&g(0)},[F,o]),c.useEffect(()=>{if(o&&j===Qu.connected){console.log("🔄 Widget opened - fetching fresh data");const O=J.getItem("profileLiveChat");if(O){const uu=O;console.log("🔄 Widget opened - fetching fresh data",uu),du(uu.firstName,uu.lastName)}!O&&!cu&&r("prechat")}},[o]),$1("logout",()=>{d.socket.disconnect()}),c.useEffect(()=>{n==="chat"&&j===Qu.connected&&du();const O=()=>{const uu=J.getItem("profileLiveChat");if(uu){const su=uu;du(su.firstName,su.lastName)}};return d.socket.io.on("reconnect",O),()=>{d.socket.io.off("reconnect",O)}},[]),c.useEffect(()=>{const O=[...l];O[0].imageUrl=t.avatarUrl,E(O)},[t.avatarUrl]);const Mu={participants:l,setParticipants:E,outgoingMessageState:w,setOutgoingMessageState:bu,connectionState:j,setConnectionState:Q,messages:C.sort((O,uu)=>{const su=Date.parse(O.createdAt),lu=Date.parse(uu.createdAt);return+new Date(su)-+new Date(lu)}),setMessages:N,newMessagesCount:R,setNewMessagesCount:g,newIOMessage:k,setNewIOMessage:q,send:ru,showTypingIndicator:t.showTypingIndicator&&z,setShowTypingIndicator:y,suggestions:B,setSuggestions:P,webviewUrl:S,setWebviewUrl:Lu,payload:fu,setPayload:T,file:h,setFile:b,message:_,setMessage:x,handleSubscription:du,isContactFormActive:L,setIsContactFormActive:I,isOfflineMode:U,setIsOfflineMode:W};return s.jsx(e1.Provider,{value:Mu,children:f})},ou=()=>{const u=c.useContext(e1);if(!u)throw new Error("useChat must be used within a ChatContext");return u},gD={orange:{header:{bg:"#FF851B",text:"#fff"},launcher:{bg:"#FF851B"},messageList:{bg:"#fff"},sent:{bg:"#FF851B",text:"#fff"},received:{bg:"#f6f8f9",text:"#000"},userInput:{bg:"#fff",text:"#000"},button:{bg:"#ffffff",text:"#FF851B",border:"#FF851B"},messageStatus:{bg:"#FF851B"},messageTime:{text:"#9C9C9C"}},red:{header:{bg:"#FF4136",text:"#fff"},launcher:{bg:"#FF4136"},messageList:{bg:"#fff"},sent:{bg:"#FF4136",text:"#fff"},received:{bg:"#f6f8f9",text:"#000"},userInput:{bg:"#fff",text:"#000"},button:{bg:"#ffffff",text:"#FF4136",border:"#FF4136"},messageStatus:{bg:"#FF4136"},messageTime:{text:"#FF4136"}},green:{header:{bg:"#2ECC40",text:"#fff"},launcher:{bg:"#2ECC40"},messageList:{bg:"#fff"},sent:{bg:"#2ECC40",text:"#fff"},received:{bg:"#f6f8f9",text:"#000"},userInput:{bg:"#fff",text:"#000"},button:{bg:"#ffffff",text:"#2ECC40",border:"#2ECC40"},messageStatus:{bg:"#2ECC40"},messageTime:{text:"#2ECC40"}},blue:{header:{bg:"#0074D9",text:"#fff"},launcher:{bg:"#0074D9"},messageList:{bg:"#fff"},sent:{bg:"#0074D9",text:"#fff"},received:{bg:"#f6f8f9",text:"#000"},userInput:{bg:"#fff",text:"#000"},button:{bg:"#ffffff",text:"#0074D9",border:"#0074D9"},messageStatus:{bg:"#0074D9"},messageTime:{text:"#0074D9"}},teal:{header:{bg:"#1BA089",text:"#fff"},launcher:{bg:"#1BA089"},messageList:{bg:"#fff"},sent:{bg:"#1BA089",text:"#fff"},received:{bg:"#f6f8f9",text:"#000"},userInput:{bg:"#fff",text:"#000"},button:{bg:"#ffffff",text:"#1BA089",border:"#1BA089"},messageStatus:{bg:"#1BA089"},messageTime:{text:"#9C9C9C"}},dark:{header:{bg:"#000",text:"#ecf0f1"},launcher:{bg:"#000"},messageList:{bg:"#FFF"},sent:{bg:"#000",text:"#FFF"},received:{bg:"#f6f8f9",text:"#000"},userInput:{bg:"#fff",text:"#000"},button:{bg:"#000",text:"#ecf0f1",border:"#34495e"},messageStatus:{bg:"#95a5a6"},messageTime:{text:"#ffffff"}},purple:{header:{bg:"#7950F2",text:"#fff"},launcher:{bg:"#7950F2"},messageList:{bg:"#fff"},sent:{bg:"#7950F2",text:"#fff"},received:{bg:"#f6f8f9",text:"#000"},userInput:{bg:"#fff",text:"#000"},button:{bg:"#ffffff",text:"#7950F2",border:"#7950F2"},messageStatus:{bg:"#7950F2"},messageTime:{text:"#9C9C9C"}}},Z0=u=>{const D=u.replace("#",""),f=parseInt(D.substring(0,2),16),e=parseInt(D.substring(2,4),16),t=parseInt(D.substring(4,6),16);return(.299*f+.587*e+.114*t)/255>.5?"#000000":"#FFFFFF"},Q0=u=>/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/.test(u),ue=u=>{const D=u.replace("#","");return{r:parseInt(D.substring(0,2),16),g:parseInt(D.substring(2,4),16),b:parseInt(D.substring(4,6),16)}},De=u=>(u.startsWith("#")||(u="#"+u),u.length===4?"#"+u[1]+u[1]+u[2]+u[2]+u[3]+u[3]:u),ZD=u=>{const D=De(u);if(!Q0(D))return console.warn(`Invalid color: ${u}, using default blue theme`),ZD("#0074D9");const f=Z0(D),e=ue(D),t=Math.min(255,Math.floor(e.r+(255-e.r)*.9)),n=Math.min(255,Math.floor(e.g+(255-e.g)*.9)),r=Math.min(255,Math.floor(e.b+(255-e.b)*.9)),a=`#${t.toString(16).padStart(2,"0")}${n.toString(16).padStart(2,"0")}${r.toString(16).padStart(2,"0")}`,F=Math.max(0,Math.floor(e.r*.8)),o=Math.max(0,Math.floor(e.g*.8)),d=Math.max(0,Math.floor(e.b*.8));return`${F.toString(16).padStart(2,"0")}${o.toString(16).padStart(2,"0")}${d.toString(16).padStart(2,"0")}`,{header:{bg:D,text:f},launcher:{bg:D},messageList:{bg:"#fff"},sent:{bg:D,text:f},received:{bg:a,text:"#000"},userInput:{bg:"#fff",text:"#000"},button:{bg:"#ffffff",text:D,border:D},messageStatus:{bg:D},messageTime:{text:"#9C9C9C"}}},n1={orange:"#FF851B",red:"#FF4136",green:"#2ECC40",blue:"#0074D9",teal:"#1BA089",dark:"#000000",purple:"#7950F2"},fe=u=>n1[u]?ZD(n1[u]):ZD(u),ee=()=>({bg:"#f6f8f9",text:"#000"}),te=gD.orange,r1=c.createContext({colors:te}),s1=({children:u})=>{const D=hu(),f=()=>{const e=D.color;if(gD[e])return gD[e];try{return{...fe(e),received:ee()}}catch{return console.warn(`Failed to generate theme for color: ${e}, using orange fallback`),gD.orange}};return s.jsx(r1.Provider,{value:{colors:f()},children:u})},Fu=()=>{const u=c.useContext(r1);if(!u)throw new Error("useColors must be used within a ColorProvider");return u},QD=({viewBox:u="0 0 24 24",...D})=>s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:u,...D,children:s.jsx("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"})}),a1=({width:u="24",height:D="24",logoUrl:f,...e})=>s.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16.64 17.71",width:u,height:D,className:"widget-logo",...e,children:[s.jsx("defs",{children:s.jsx("style",{children:".cls-1{fill:#ffffff;fill-rule:evenodd;}"})}),s.jsx("path",{className:"cls-1",d:"M7.5,13.44c.44,.13,.88,.19,1.35,.19,1.61,0,3.04-.8,3.9-2,.42-.58,1.04-.91,1.75-.91h.23c.73,0,1.35,.37,1.69,1.02,.34,.63,.31,1.35-.1,1.95-.93,1.4-2.32,2.31-4.33,2.31-1.88,0-3.57-.84-4.72-2.18-.06-.08-.08-.19-.02-.28,.05-.1,.16-.15,.26-.11Zm-2.52,3.38c1.17,.57,2.48,.89,3.86,.89h.1c.13-.02,.23-.1,.24-.21s-.05-.23-.15-.26c-6.8-2.63-6.7-13.16-.19-13.16,1.57,0,3,.75,3.9,2,.42,.58,1.04,.89,1.75,.89h.16c.73,0,1.35-.37,1.69-1.01s.31-1.35-.08-1.95c-.45-.68-.99-1.3-1.61-1.83-1.54-1.35-3.59-2.18-5.81-2.18C3.96,0,0,3.96,0,8.85c0,1.87,.57,3.59,1.56,5.02v.02c.86,1.23,2.01,2.26,3.43,2.94Z"})]}),ne=({onChatWithStaff:u,onSendNoticeToStaff:D})=>{const[f,e]=c.useState(!1),t=c.useRef(null),{socket:n}=Wu();Iu();const{send:r}=ou();Su(),c.useEffect(()=>{const F=o=>{t.current&&!t.current.contains(o.target)&&e(!1)};return document.addEventListener("mousedown",F),()=>{document.removeEventListener("mousedown",F)}},[]);const a=async F=>{F.preventDefault(),F.stopPropagation();try{const o=J.getItem("profileLiveChat");if(!o){console.error("No profile found in localStorage");return}r({event:F,source:"staff-notice",data:{type:yu.notify,data:{text:"Notice sent to staff"},author:o.foreignId}}),e(!1),D==null||D()}catch(o){console.error("Error sending notice to staff:",o)}};return s.jsxs("div",{className:"staff-menu",ref:t,children:[s.jsx("div",{className:"staff-menu-toggle",onClick:F=>{F.preventDefault(),F.stopPropagation(),e(!f)},children:s.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"currentColor",children:[s.jsx("circle",{cx:"12",cy:"6",r:"2"}),s.jsx("circle",{cx:"12",cy:"12",r:"2"}),s.jsx("circle",{cx:"12",cy:"18",r:"2"})]})}),s.jsx("div",{className:`staff-menu-dropdown ${f?"staff-menu-dropdown-open":"staff-menu-dropdown-closed"}`,children:s.jsx("button",{className:"staff-menu-item",onClick:a,children:"Send Notice to Staff"})})]})},re=({children:u})=>{const D=hu(),{colors:f}=Fu(),e=Nu();return s.jsxs("div",{className:"sc-header",style:{background:f.header.bg,color:f.header.text},children:[u||s.jsxs(s.Fragment,{children:[s.jsx("a",{href:"https://hexabot.ai",target:"_blank",title:"Powered By Hexabot.ai",className:"sc-header--img",children:D.logoUrl?s.jsx("img",{src:D.logoUrl,width:38,height:38,className:"sc-open-icon",style:{borderRadius:"50%"}}):s.jsx(a1,{width:32,height:32})}),s.jsx("div",{className:"sc-header--title",children:D.title})]}),s.jsxs("div",{className:"sc-header--actions",children:[s.jsx(ne,{onChatWithStaff:()=>{console.log("Chat with staff requested")},onSendNoticeToStaff:()=>{console.log("Notice sent to staff")}}),s.jsx("div",{className:"sc-header--close-button",onClick:()=>e.setIsOpen(!1),children:s.jsx(QD,{})})]})]})},se=({width:u="100",height:D="100",x:f="0",y:e="0",viewBox:t="0 0 512.115 512.115",...n})=>s.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:u,height:D,x:f,y:e,viewBox:t,...n,children:[s.jsx("circle",{cx:"255.998",cy:"374.496",r:"32.133"}),s.jsx("path",{d:"M259.46 342.551c20.068 21.447 2.961 57.089-26.924 53.889 19.876 21.242 55.595 7.028 55.595-21.944 0-16.576-12.553-30.217-28.671-31.945zM346.922 272.908c-14.694-11.793-31.719-20.793-50.261-26.198l28.056-28.056a181.486 181.486 0 0144.53 26.284c8.351 6.698 9.121 19.122 1.552 26.692-6.461 6.46-16.738 7.007-23.877 1.278zm-204.172-27.97c-8.351 6.698-9.122 19.122-1.552 26.692 6.109 6.254 16.525 7.178 23.876 1.278 20.705-16.617 46.037-27.689 73.723-30.964l35.859-35.859c-48.401-4.971-95.296 9.491-131.906 38.853zm157.933-64.88l29.253-29.253c-79.639-25.044-168.342-8.412-234.2 47.892-7.97 6.814-8.541 18.928-1.127 26.343 6.568 6.568 17.121 7.079 24.173 1.035 51.196-43.872 118.577-59.715 181.901-46.017zm116.705 44.982c7.415-7.415 6.844-19.529-1.127-26.343a248.048 248.048 0 00-42.385-29.203l-26.573 26.573a211.854 211.854 0 0145.912 30.008c7.052 6.044 17.605 5.533 24.173-1.035zm-116.359 95.457c6.604 4.525 15.912 4.623 22.908-2.005 7.88-7.88 6.751-21.016-2.422-27.343a114.995 114.995 0 00-49.967-19.326l-37.95 37.95c22.182-6.494 47.03-3.254 67.431 10.724z"}),s.jsx("path",{d:"M416.261 198.697a248.048 248.048 0 00-42.385-29.203l-7.388 7.388a247.907 247.907 0 0129.774 21.814c9.055 7.741 8.317 21.88-1.529 28.533 6.982 4.781 16.543 3.922 22.655-2.19 7.414-7.413 6.843-19.528-1.127-26.342zM369.247 244.938a181.486 181.486 0 00-44.53-26.284l-6.327 6.327a181.811 181.811 0 0130.857 19.957c9.462 7.589 8.937 22.091-1.089 28.871 7.054 4.744 16.544 3.917 22.64-2.178 7.57-7.571 6.8-19.996-1.551-26.693zM321.515 291.148a114.995 114.995 0 00-49.967-19.326l-3.48 3.48a115.07 115.07 0 0133.447 15.846c10.331 7.126 10.2 22.482-.221 29.513 6.595 4.357 15.745 4.365 22.643-2.17 7.88-7.879 6.751-21.016-2.422-27.343z"}),s.jsx("path",{d:"M437.077 75.038c-100.046-100.044-261.982-100.057-362.039 0-100.044 100.042-100.058 261.98 0 362.039 100.046 100.044 261.981 100.057 362.04 0 100.043-100.046 100.057-261.981-.001-362.039zm-25.685 67.607c1.856-1.856 4.94-1.582 6.444.568 54.271 77.582 45.249 184.719-22.326 252.297-67.579 67.576-174.715 76.599-252.298 22.326-2.15-1.504-2.423-4.589-.568-6.444l268.748-268.747zM94.274 368.912C5.205 241.953 93.085 58.843 256.057 58.843c40.925 0 79.777 12.225 112.855 35.431 2.147 1.506 2.42 4.588.565 6.443l-268.76 268.761c-1.855 1.854-4.937 1.581-6.443-.566z"}),s.jsx("path",{d:"M349.926 17.756c141.317 87.019 164.005 282.465 47.152 399.321-74.64 74.638-183.463 93.269-274.888 57.282 97.36 59.953 228.457 49.147 314.888-37.282 131.453-131.456 82.523-352.533-87.152-419.321z"})]}),ae=({size:u=50,color:D="#000",...f})=>s.jsxs("svg",{width:u,height:u,viewBox:"0 0 50 50",xmlns:"http://www.w3.org/2000/svg",fill:D,...f,children:[s.jsxs("circle",{cx:"25",cy:"25",r:"20",stroke:"none",fill:"none",children:[s.jsx("animate",{attributeName:"r",begin:"0s",dur:"1.5s",values:"20; 0",keyTimes:"0; 1",repeatCount:"indefinite"}),s.jsx("animate",{attributeName:"stroke-opacity",begin:"0s",dur:"1.5s",values:"1; 0",keyTimes:"0; 1",repeatCount:"indefinite"})]}),s.jsxs("circle",{cx:"25",cy:"25",r:"20",stroke:"none",fill:"none",children:[s.jsx("animate",{attributeName:"r",begin:"0.75s",dur:"1.5s",values:"20; 0",keyTimes:"0; 1",repeatCount:"indefinite"}),s.jsx("animate",{attributeName:"stroke-opacity",begin:"0.75s",dur:"1.5s",values:"1; 0",keyTimes:"0; 1",repeatCount:"indefinite"})]})]}),Fe=()=>{const{t:u}=Su(),{connectionState:D,setConnectionState:f}=ou(),{colors:e}=Fu(),t=()=>{D===0&&f(1)},n=D>0;return s.jsx("div",{className:"sc-chat--disconnected-icon-wrapper",style:{backgroundColor:e.messageList.bg},children:n?s.jsx(ae,{className:"loading-image"}):s.jsxs("div",{className:"sc-chat--disconnected-icon",children:[s.jsx(se,{}),s.jsx("h3",{className:"sc-chat--disconnected-text",style:{color:e.button.text},children:u("settings.connection_lost")}),s.jsx("button",{className:"sc-chat--disconnected-button",style:{color:e.button.text,backgroundColor:e.button.bg,borderColor:e.button.border},onClick:t,children:"Refresh"})]})})};var uf={exports:{}},F1;function i1(){return F1||(F1=1,function(u,D){(function(f,e){u.exports=e()})(ku,function(){var f=1e3,e=6e4,t=36e5,n="millisecond",r="second",a="minute",F="hour",o="day",d="week",l="month",E="quarter",j="year",v="date",C="Invalid Date",N=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,R=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,g={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(T){var h=["th","st","nd","rd"],b=T%100;return"["+T+(h[(b-20)%10]||h[b]||h[0])+"]"}},z=function(T,h,b){var S=String(T);return!S||S.length>=h?T:""+Array(h+1-S.length).join(b)+T},y={s:z,z:function(T){var h=-T.utcOffset(),b=Math.abs(h),S=Math.floor(b/60),m=b%60;return(h<=0?"+":"-")+z(S,2,"0")+":"+z(m,2,"0")},m:function T(h,b){if(h.date()<b.date())return-T(b,h);var S=12*(b.year()-h.year())+(b.month()-h.month()),m=h.clone().add(S,l),L=b-m<0,I=h.clone().add(S+(L?-1:1),l);return+(-(S+(b-m)/(L?m-I:I-m))||0)},a:function(T){return T<0?Math.ceil(T)||0:Math.floor(T)},p:function(T){return{M:l,y:j,w:d,d:o,D:v,h:F,m:a,s:r,ms:n,Q:E}[T]||String(T||"").toLowerCase().replace(/s$/,"")},u:function(T){return T===void 0}},B="en",P={};P[B]=g;var k="$isDayjsObject",q=function(T){return T instanceof bu||!(!T||!T[k])},_=function T(h,b,S){var m;if(!h)return B;if(typeof h=="string"){var L=h.toLowerCase();P[L]&&(m=L),b&&(P[L]=b,m=L);var I=h.split("-");if(!m&&I.length>1)return T(I[0])}else{var U=h.name;P[U]=h,m=U}return!S&&m&&(B=m),m||!S&&B},x=function(T,h){if(q(T))return T.clone();var b=typeof h=="object"?h:{};return b.date=T,b.args=arguments,new bu(b)},w=y;w.l=_,w.i=q,w.w=function(T,h){return x(T,{locale:h.$L,utc:h.$u,x:h.$x,$offset:h.$offset})};var bu=function(){function T(b){this.$L=_(b.locale,null,!0),this.parse(b),this.$x=this.$x||b.x||{},this[k]=!0}var h=T.prototype;return h.parse=function(b){this.$d=function(S){var m=S.date,L=S.utc;if(m===null)return new Date(NaN);if(w.u(m))return new Date;if(m instanceof Date)return new Date(m);if(typeof m=="string"&&!/Z$/i.test(m)){var I=m.match(N);if(I){var U=I[2]-1||0,W=(I[7]||"0").substring(0,3);return L?new Date(Date.UTC(I[1],U,I[3]||1,I[4]||0,I[5]||0,I[6]||0,W)):new Date(I[1],U,I[3]||1,I[4]||0,I[5]||0,I[6]||0,W)}}return new Date(m)}(b),this.init()},h.init=function(){var b=this.$d;this.$y=b.getFullYear(),this.$M=b.getMonth(),this.$D=b.getDate(),this.$W=b.getDay(),this.$H=b.getHours(),this.$m=b.getMinutes(),this.$s=b.getSeconds(),this.$ms=b.getMilliseconds()},h.$utils=function(){return w},h.isValid=function(){return this.$d.toString()!==C},h.isSame=function(b,S){var m=x(b);return this.startOf(S)<=m&&m<=this.endOf(S)},h.isAfter=function(b,S){return x(b)<this.startOf(S)},h.isBefore=function(b,S){return this.endOf(S)<x(b)},h.$g=function(b,S,m){return w.u(b)?this[S]:this.set(m,b)},h.unix=function(){return Math.floor(this.valueOf()/1e3)},h.valueOf=function(){return this.$d.getTime()},h.startOf=function(b,S){var m=this,L=!!w.u(S)||S,I=w.p(b),U=function(Bu,ru){var du=w.w(m.$u?Date.UTC(m.$y,ru,Bu):new Date(m.$y,ru,Bu),m);return L?du:du.endOf(o)},W=function(Bu,ru){return w.w(m.toDate()[Bu].apply(m.toDate("s"),(L?[0,0,0,0]:[23,59,59,999]).slice(ru)),m)},G=this.$W,V=this.$M,Q=this.$D,eu="set"+(this.$u?"UTC":"");switch(I){case j:return L?U(1,0):U(31,11);case l:return L?U(1,V):U(0,V+1);case d:var cu=this.$locale().weekStart||0,_u=(G<cu?G+7:G)-cu;return U(L?Q-_u:Q+(6-_u),V);case o:case v:return W(eu+"Hours",0);case F:return W(eu+"Minutes",1);case a:return W(eu+"Seconds",2);case r:return W(eu+"Milliseconds",3);default:return this.clone()}},h.endOf=function(b){return this.startOf(b,!1)},h.$set=function(b,S){var m,L=w.p(b),I="set"+(this.$u?"UTC":""),U=(m={},m[o]=I+"Date",m[v]=I+"Date",m[l]=I+"Month",m[j]=I+"FullYear",m[F]=I+"Hours",m[a]=I+"Minutes",m[r]=I+"Seconds",m[n]=I+"Milliseconds",m)[L],W=L===o?this.$D+(S-this.$W):S;if(L===l||L===j){var G=this.clone().set(v,1);G.$d[U](W),G.init(),this.$d=G.set(v,Math.min(this.$D,G.daysInMonth())).$d}else U&&this.$d[U](W);return this.init(),this},h.set=function(b,S){return this.clone().$set(b,S)},h.get=function(b){return this[w.p(b)]()},h.add=function(b,S){var m,L=this;b=Number(b);var I=w.p(S),U=function(V){var Q=x(L);return w.w(Q.date(Q.date()+Math.round(V*b)),L)};if(I===l)return this.set(l,this.$M+b);if(I===j)return this.set(j,this.$y+b);if(I===o)return U(1);if(I===d)return U(7);var W=(m={},m[a]=e,m[F]=t,m[r]=f,m)[I]||1,G=this.$d.getTime()+b*W;return w.w(G,this)},h.subtract=function(b,S){return this.add(-1*b,S)},h.format=function(b){var S=this,m=this.$locale();if(!this.isValid())return m.invalidDate||C;var L=b||"YYYY-MM-DDTHH:mm:ssZ",I=w.z(this),U=this.$H,W=this.$m,G=this.$M,V=m.weekdays,Q=m.months,eu=m.meridiem,cu=function(ru,du,Lu,Mu){return ru&&(ru[du]||ru(S,L))||Lu[du].slice(0,Mu)},_u=function(ru){return w.s(U%12||12,ru,"0")},Bu=eu||function(ru,du,Lu){var Mu=ru<12?"AM":"PM";return Lu?Mu.toLowerCase():Mu};return L.replace(R,function(ru,du){return du||function(Lu){switch(Lu){case"YY":return String(S.$y).slice(-2);case"YYYY":return w.s(S.$y,4,"0");case"M":return G+1;case"MM":return w.s(G+1,2,"0");case"MMM":return cu(m.monthsShort,G,Q,3);case"MMMM":return cu(Q,G);case"D":return S.$D;case"DD":return w.s(S.$D,2,"0");case"d":return String(S.$W);case"dd":return cu(m.weekdaysMin,S.$W,V,2);case"ddd":return cu(m.weekdaysShort,S.$W,V,3);case"dddd":return V[S.$W];case"H":return String(U);case"HH":return w.s(U,2,"0");case"h":return _u(1);case"hh":return _u(2);case"a":return Bu(U,W,!0);case"A":return Bu(U,W,!1);case"m":return String(W);case"mm":return w.s(W,2,"0");case"s":return String(S.$s);case"ss":return w.s(S.$s,2,"0");case"SSS":return w.s(S.$ms,3,"0");case"Z":return I}return null}(ru)||I.replace(":","")})},h.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},h.diff=function(b,S,m){var L,I=this,U=w.p(S),W=x(b),G=(W.utcOffset()-this.utcOffset())*e,V=this-W,Q=function(){return w.m(I,W)};switch(U){case j:L=Q()/12;break;case l:L=Q();break;case E:L=Q()/3;break;case d:L=(V-G)/6048e5;break;case o:L=(V-G)/864e5;break;case F:L=V/t;break;case a:L=V/e;break;case r:L=V/f;break;default:L=V}return m?L:w.a(L)},h.daysInMonth=function(){return this.endOf(l).$D},h.$locale=function(){return P[this.$L]},h.locale=function(b,S){if(!b)return this.$L;var m=this.clone(),L=_(b,S,!0);return L&&(m.$L=L),m},h.clone=function(){return w.w(this.$d,this)},h.toDate=function(){return new Date(this.valueOf())},h.toJSON=function(){return this.isValid()?this.toISOString():null},h.toISOString=function(){return this.$d.toISOString()},h.toString=function(){return this.$d.toUTCString()},T}(),fu=bu.prototype;return x.prototype=fu,[["$ms",n],["$s",r],["$m",a],["$H",F],["$W",o],["$M",l],["$y",j],["$D",v]].forEach(function(T){fu[T[1]]=function(h){return this.$g(h,T[0],T[1])}}),x.extend=function(T,h){return T.$i||(T(h,bu,x),T.$i=!0),x},x.locale=_,x.isDayjs=q,x.unix=function(T){return x(1e3*T)},x.en=P[B],x.Ls=P,x.p={},x})}(uf)),uf.exports}var ie=i1();const o1=xD(ie);var oe={exports:{}};(function(u,D){(function(f,e){u.exports=e()})(ku,function(){return{name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(f){var e=["th","st","nd","rd"],t=f%100;return"["+f+(e[(t-20)%10]||e[t]||e[0])+"]"}}})})(oe);var de={exports:{}};(function(u,D){(function(f,e){u.exports=e(i1())})(ku,function(f){function e(r){return r&&typeof r=="object"&&"default"in r?r:{default:r}}var t=e(f),n={name:"fr",weekdays:"dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"),weekdaysShort:"dim._lun._mar._mer._jeu._ven._sam.".split("_"),weekdaysMin:"di_lu_ma_me_je_ve_sa".split("_"),months:"janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre".split("_"),monthsShort:"janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.".split("_"),weekStart:1,yearStart:4,formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},relativeTime:{future:"dans %s",past:"il y a %s",s:"quelques secondes",m:"une minute",mm:"%d minutes",h:"une heure",hh:"%d heures",d:"un jour",dd:"%d jours",M:"un mois",MM:"%d mois",y:"un an",yy:"%d ans"},ordinal:function(r){return""+r+(r===1?"er":"")}};return t.default.locale(n,null,!0),n})})(de);var d1={exports:{}};(function(u,D){(function(f,e){u.exports=e()})(ku,function(){return function(f,e,t){f=f||{};var n=e.prototype,r={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function a(o,d,l,E){return n.fromToBase(o,d,l,E)}t.en.relativeTime=r,n.fromToBase=function(o,d,l,E,j){for(var v,C,N,R=l.$locale().relativeTime||r,g=f.thresholds||[{l:"s",r:44,d:"second"},{l:"m",r:89},{l:"mm",r:44,d:"minute"},{l:"h",r:89},{l:"hh",r:21,d:"hour"},{l:"d",r:35},{l:"dd",r:25,d:"day"},{l:"M",r:45},{l:"MM",r:10,d:"month"},{l:"y",r:17},{l:"yy",d:"year"}],z=g.length,y=0;y<z;y+=1){var B=g[y];B.d&&(v=E?t(o).diff(l,B.d,!0):l.diff(o,B.d,!0));var P=(f.rounding||Math.round)(Math.abs(v));if(N=v>0,P<=B.r||!B.r){P<=1&&y>0&&(B=g[y-1]);var k=R[B.l];j&&(P=j(""+P)),C=typeof k=="string"?k.replace("%d",P):k(P,d,B.l,N);break}}if(d)return C;var q=N?R.future:R.past;return typeof q=="function"?q(C):q.replace("%s",C)},n.to=function(o,d){return a(o,d,this,!0)},n.from=function(o,d){return a(o,d,this)};var F=function(o){return o.$u?t.utc():t()};n.toNow=function(o){return this.to(F(this),o)},n.fromNow=function(o){return this.from(F(this),o)}}})})(d1);var Ce=d1.exports;const ce=xD(Ce),C1=({width:u="18",height:D="18",...f})=>s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 42.555282 47.2949",width:u,height:D,...f,children:s.jsxs("g",{fillOpacity:1,strokeDasharray:"none",children:[s.jsx("path",{d:"M32.756 170.872l-4.26 7.482-2.786-7.494-8.211-.017a4.405 4.405 0 01-3.8-2.191l-6.443-11.087a4.215 4.215 0 01-.011-4.216l6.213-10.833a4.96 4.96 0 014.288-2.492l12.2-.034a4.715 4.715 0 014.09 2.347l6.16 10.602a4.864 4.864 0 01.02 4.855z",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeOpacity:1,strokeWidth:4.4649702399999995,paintOrder:"normal",style:{mixBlendMode:"normal"},transform:"translate(-58.835 -133.808) translate(53.705 -18.313) scale(1.10427)"}),s.jsxs("g",{fill:"currentColor",fillRule:"nonzero",stroke:"none",strokeWidth:.662,fillOpacity:1,children:[s.jsx("path",{d:"M-532.348 630.303a6.253 6.253 0 11-12.506.023 6.253 6.253 0 0112.506-.023",transform:"translate(-58.835 -133.808) translate(53.705 -18.313) scale(1.10427) matrix(.25113 0 0 .25263 -27.6 133.42) matrix(1.51171 0 0 1.50275 1044.41 -860.854)"}),s.jsx("path",{d:"M-532.348 630.303a6.253 6.253 0 11-12.506.023 6.253 6.253 0 0112.506-.023",transform:"translate(-58.835 -133.808) translate(53.705 -18.313) scale(1.10427) matrix(.25113 0 0 .25263 -27.6 133.42) matrix(1.51171 0 0 1.50275 992.8 -860.854)"}),s.jsx("path",{d:"M-532.348 630.303a6.253 6.253 0 11-12.506.023 6.253 6.253 0 0112.506-.023",transform:"translate(-58.835 -133.808) translate(53.705 -18.313) scale(1.10427) matrix(.25113 0 0 .25263 -27.6 133.42) matrix(1.51171 0 0 1.50275 1018.605 -860.854)"})]})]})}),mD=({message:u})=>{const{setPayload:D,send:f,setWebviewUrl:e}=ou(),t=hu(),{colors:n}=Fu(),r=(a,F)=>{F.type==="web_url"&&F.url?F.messenger_extensions?e(F.url):window.open(F.url,"_blank"):F.type==="postback"&&(D({text:F.title,payload:F.payload}),f({event:a,source:"post-back",data:{type:yu.postback,data:{text:F.title,payload:F.payload}}}),t.autoFlush&&D(null))};if(!("buttons"in u.data))throw new Error("Unable to find buttons");return s.jsx("div",{className:"sc-message--buttons",children:u.data.buttons.map((a,F)=>s.jsx("button",{className:"sc-message--buttons-content",onClick:o=>r(o,a),style:{borderColor:n.button.border,color:n.button.text,backgroundColor:n.button.bg},children:a.title},F))})},le=(u,D=100)=>u.length>D?u.substr(0,D)+"...":u,Ee=u=>u.replace(/\n/g,"<br />"),he=u=>{let D=le(u,50);return D=Ee(u),D},be=({message:u})=>s.jsx("div",{className:"sc-message--carousel-element-wrapper",children:s.jsxs("div",{className:"sc-message--carousel-element",children:[u.image_url&&s.jsx("div",{className:"sc-message--carousel-element-image",style:{backgroundImage:`url('${u.image_url}')`}}),s.jsxs("div",{className:"sc-message--carousel-element-description",children:[s.jsx("h3",{className:"sc-message--carousel-title",children:u.title}),u.subtitle&&s.jsx("p",{dangerouslySetInnerHTML:{__html:he(u.subtitle)}})]}),u.buttons&&s.jsx(mD,{message:{data:{buttons:u.buttons}}})]})}),pe=({messageCarousel:u})=>{const{colors:D}=Fu(),[f,e]=c.useState(0),t=u.data.elements,n=()=>{e(o=>(o+t.length-1)%t.length)},r=()=>{e(o=>(o+1)%t.length)},a=D[u.direction||"received"],F=t.length>1;return s.jsxs("div",{className:"sc-message--carousel",style:{color:a.text,backgroundColor:a.bg},children:[s.jsx("div",{className:"sc-message--carousel-inner",style:{transform:`translateX(-${f*100}%)`},children:t.map((o,d)=>s.jsx(be,{message:o,idx:d},d))}),F&&s.jsxs(s.Fragment,{children:[s.jsx("button",{className:"sc-message--carousel-control prev",onClick:n,children:"❮"}),s.jsx("button",{className:"sc-message--carousel-control next",onClick:r,children:"❯"})]})]})},Be=({viewBox:u="0 0 512 512",...D})=>s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:u,...D,children:s.jsxs("g",{"data-name":"1",children:[s.jsx("path",{d:"M378.83 450H150a50.17 50.17 0 01-50.11-50.11V98.11A50.17 50.17 0 01150 48h150.1a15 15 0 0110.61 4.39l113.84 113.88a15 15 0 014.39 10.61v223A50.17 50.17 0 01378.83 450zM150 78a20.13 20.13 0 00-20.11 20.11v301.78A20.13 20.13 0 00150 420h228.83a20.13 20.13 0 0020.11-20.11v-216.8L293.85 78z"}),s.jsx("path",{d:"M413.94 191.88h-78.77a50.17 50.17 0 01-50.11-50.11V63a15 15 0 0130 0v78.77a20.13 20.13 0 0020.11 20.11h78.77a15 15 0 010 30zM264.4 375a15 15 0 01-10.61-4.4l-54.45-54.44a15 15 0 1121.21-21.22l43.85 43.84 43.84-43.84a15 15 0 1121.21 21.22L275 370.55a15 15 0 01-10.6 4.45z"}),s.jsx("path",{d:"M264.4 365a15 15 0 01-15-15V231a15 15 0 0130 0v119a15 15 0 01-15 15z"})]})}),ge=({message:u})=>{const{t:D}=Su(),{colors:f}=Fu(),e=f[u.direction||Z.received];if(!("type"in u.data))throw new Error("Unable to detect type for file message");if(u.data&&u.data.type!=="image"&&u.data.type!=="audio"&&u.data.type!=="video"&&u.data.type!=="file")throw new Error("Uknown type for file message");return s.jsxs("div",{className:"sc-message--file",style:{color:e.text,backgroundColor:e.bg},children:[u.data.type==="image"&&s.jsx("div",{className:"sc-message--file-icon",children:s.jsx("img",{src:u.data.url||"",className:"sc-image",alt:"File"})}),u.data.type==="audio"&&s.jsx("div",{className:"sc-message--file-audio",children:s.jsxs("audio",{controls:!0,children:[s.jsx("source",{src:u.data.url}),D("messages.file_message.browser_audio_unsupport")]})}),u.data.type==="video"&&s.jsx("div",{className:"sc-message--file-video",children:s.jsxs("video",{controls:!0,width:"100%",children:[s.jsx("source",{src:u.data.url}),D("messages.file_message.browser_video_unsupport")]})}),u.data.type==="file"&&s.jsx("div",{className:"sc-message--file-download",style:{color:e.text,backgroundColor:e.bg},children:s.jsxs("a",{href:u.data.url?u.data.url:"#",target:"_blank",rel:"noopener noreferrer",download:!0,children:[s.jsx(Be,{}),D("messages.file_message.download")]})})]})},me=({message:u})=>{var o;const{colors:D}=Fu(),f=Nu(),[e,t]=c.useState(!1),n=c.useRef(null);if(c.useEffect(()=>{const d=new IntersectionObserver(l=>{!e&&l[0].intersectionRatio>0&&t(!0)});return n.current&&d.observe(n.current),()=>{n.current&&d.unobserve(n.current)}},[e]),c.useEffect(()=>{e&&f&&f.scroll>85&&(f.scroll=101)},[e,f]),!("coordinates"in u.data))throw new Error("Unable to find coordinates");const r=((o=u.data)==null?void 0:o.coordinates)||{lat:0,lng:0},a=`https://www.openstreetmap.org/export/embed.html?bbox=${r.lng-.1},${r.lat-.1},${r.lng+.1},${r.lat+.1}&layer=mapnik&marker=${r.lat},${r.lng}`,F=D[u.direction||Z.received];return s.jsx("div",{className:"sc-message--location",style:{color:F.text,backgroundColor:F.bg},ref:n,children:e&&s.jsx("iframe",{loading:"lazy",frameBorder:"0",scrolling:"no",marginHeight:0,marginWidth:0,src:a,className:"sc-message-map"})})},_e=({messageList:u})=>{const{colors:D}=Fu(),f=r=>{let a=e(r,50);return a=t(r),a},e=(r,a=100)=>r.length>a?r.substr(0,a)+"...":r,t=r=>r.replace(/\n/g,"<br />");if(!("elements"in u.data))throw new Error("Unable to find elements");const n=D[u.direction||Z.received];return s.jsxs("div",{className:"sc-message--list",style:{color:n.text,backgroundColor:n.bg},children:[u.data.elements.map((r,a)=>{const F=a===0&&"top_element_style"in u.data&&u.data.top_element_style==="large"?"large":"compact";return s.jsxs("div",{className:"sc-message--list-element",style:{borderColor:D.messageList.bg},children:[s.jsxs("div",{className:`sc-message--list-element-content ${F}`,children:[r.image_url&&s.jsx("div",{className:"sc-message--list-element-image",style:{backgroundImage:`url('${r.image_url}')`},children:F==="large"&&s.jsxs("div",{className:"sc-message--list-element-description",children:[s.jsx("h3",{className:"sc-message--title",children:r.title}),r.subtitle&&s.jsx("p",{dangerouslySetInnerHTML:{__html:f(r.subtitle)}})]})}),F==="compact"&&s.jsxs("div",{className:"sc-message--list-element-description",children:[s.jsx("h3",{className:"sc-message--title",children:r.title}),r.subtitle&&s.jsx("p",{dangerouslySetInnerHTML:{__html:f(r.subtitle)}})]})]}),r.buttons&&s.jsx(mD,{message:{data:{buttons:r.buttons}}})]},a)}),"buttons"in u.data&&Array.isArray(u.data.buttons)&&u.data.buttons.length>0&&s.jsx("div",{className:"sc-message--list-element-bottom",children:s.jsx(mD,{message:u})})]})};var Df=function(u,D){return Df=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(f,e){f.__proto__=e}||function(f,e){for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(f[t]=e[t])},Df(u,D)};function aD(u,D){if(typeof D!="function"&&D!==null)throw new TypeError("Class extends value "+String(D)+" is not a constructor or null");Df(u,D);function f(){this.constructor=u}u.prototype=D===null?Object.create(D):(f.prototype=D.prototype,new f)}var iu=function(){return iu=Object.assign||function(D){for(var f,e=1,t=arguments.length;e<t;e++){f=arguments[e];for(var n in f)Object.prototype.hasOwnProperty.call(f,n)&&(D[n]=f[n])}return D},iu.apply(this,arguments)};function ye(u,D){var f=typeof Symbol=="function"&&u[Symbol.iterator];if(!f)return u;var e=f.call(u),t,n=[],r;try{for(;(D===void 0||D-- >0)&&!(t=e.next()).done;)n.push(t.value)}catch(a){r={error:a}}finally{try{t&&!t.done&&(f=e.return)&&f.call(e)}finally{if(r)throw r.error}}return n}function ve(u,D,f){if(f||arguments.length===2)for(var e=0,t=D.length,n;e<t;e++)(n||!(e in D))&&(n||(n=Array.prototype.slice.call(D,0,e)),n[e]=D[e]);return u.concat(n||Array.prototype.slice.call(D))}typeof SuppressedError=="function"&&SuppressedError;var we="4.1.5",Ae=Object.prototype.hasOwnProperty;function wu(u){return typeof u=="boolean"}function xe(u,D,f){var e;return u.length>D&&(f==null?(f="…",e=3):e=f.length,u=u.substring(0,D-e)+f),u}function Yu(u,D){for(var f=u.length-1;f>=0;f--)D(u[f])===!0&&u.splice(f,1)}function $u(u){throw new Error("Unhandled case for value: '".concat(u,"'"))}var _D=/\s+/,c1=function(){function u(D){D===void 0&&(D={}),this.tagName="",this.attrs={},this.innerHTML="",this.tagName=D.tagName||"",this.attrs=D.attrs||{},this.innerHTML=D.innerHtml||D.innerHTML||""}return u.prototype.setTagName=function(D){return this.tagName=D,this},u.prototype.getTagName=function(){return this.tagName},u.prototype.setAttr=function(D,f){var e=this.getAttrs();return e[D]=f,this},u.prototype.getAttr=function(D){return this.getAttrs()[D]},u.prototype.setAttrs=function(D){return Object.assign(this.getAttrs(),D),this},u.prototype.getAttrs=function(){return this.attrs},u.prototype.setClass=function(D){return this.setAttr("class",D)},u.prototype.addClass=function(D){for(var f=this.getClass(),e=f?f.split(_D):[],t=D.split(_D),n;n=t.shift();)e.indexOf(n)===-1&&e.push(n);return this.getAttrs().class=e.join(" "),this},u.prototype.removeClass=function(D){for(var f=this.getClass(),e=f?f.split(_D):[],t=D.split(_D),n;e.length&&(n=t.shift());){var r=e.indexOf(n);r!==-1&&e.splice(r,1)}return this.getAttrs().class=e.join(" "),this},u.prototype.getClass=function(){return this.getAttrs().class||""},u.prototype.hasClass=function(D){return(" "+this.getClass()+" ").indexOf(" "+D+" ")!==-1},u.prototype.setInnerHTML=function(D){return this.innerHTML=D,this},u.prototype.setInnerHtml=function(D){return this.setInnerHTML(D)},u.prototype.getInnerHTML=function(){return this.innerHTML||""},u.prototype.getInnerHtml=function(){return this.getInnerHTML()},u.prototype.toAnchorString=function(){var D=this.getTagName(),f=this.buildAttrsStr();return f=f?" "+f:"",["<",D,f,">",this.getInnerHtml(),"</",D,">"].join("")},u.prototype.buildAttrsStr=function(){var D=this.getAttrs(),f=[];for(var e in D)Ae.call(D,e)&&f.push(e+'="'+D[e]+'"');return f.join(" ")},u}();function ke(u,D,f){var e,t;if(f==null?(f="…",t=3,e=8):(t=f.length,e=f.length),u.length<=D)return u;var n=D-t,r=Se(u);if(r.query){var a=r.query.match(/^(.*?)(?=(\?|#))(.*?)$/i);a&&(r.query=r.query.substr(0,a[1].length),u=l1(r))}if(u.length<=D||(r.host&&(r.host=r.host.replace(/^www\./,""),u=l1(r)),u.length<=D))return u;var F="";if(r.host&&(F+=r.host),F.length>=n)return r.host.length===D?(r.host.substr(0,D-t)+f).substr(0,n+e):ff(F,n,f).substr(0,n+e);var o="";if(r.path&&(o+="/"+r.path),r.query&&(o+="?"+r.query),o)if((F+o).length>=n){if((F+o).length==D)return(F+o).substr(0,D);var d=n-F.length;return(F+ff(o,d,f)).substr(0,n+e)}else F+=o;if(r.fragment){var l="#"+r.fragment;if((F+l).length>=n){if((F+l).length==D)return(F+l).substr(0,D);var E=n-F.length;return(F+ff(l,E,f)).substr(0,n+e)}else F+=l}if(r.scheme&&r.host){var j=r.scheme+"://";if((F+j).length<n)return(j+F).substr(0,D)}if(F.length<=D)return F;var v="";return n>0&&(v=F.substr(-1*Math.floor(n/2))),(F.substr(0,Math.ceil(n/2))+f+v).substr(0,n+e)}function Se(u){var D={},f=u,e=f.match(/^([a-z]+):\/\//i);return e&&(D.scheme=e[1],f=f.slice(e[0].length)),e=f.match(/^(.*?)(?=(\?|#|\/|$))/i),e&&(D.host=e[1],f=f.slice(e[0].length)),e=f.match(/^\/(.*?)(?=(\?|#|$))/i),e&&(D.path=e[1],f=f.slice(e[0].length)),e=f.match(/^\?(.*?)(?=(#|$))/i),e&&(D.query=e[1],f=f.slice(e[0].length)),e=f.match(/^#(.*?)$/i),e&&(D.fragment=e[1]),D}function l1(u){var D="";return u.scheme&&u.host&&(D+=u.scheme+"://"),u.host&&(D+=u.host),u.path&&(D+="/"+u.path),u.query&&(D+="?"+u.query),u.fragment&&(D+="#"+u.fragment),D}function ff(u,D,f){var e=D/2,t=Math.ceil(e),n=-1*Math.floor(e),r="";return n<0&&(r=u.substr(n)),u.substr(0,t)+f+r}function je(u,D,f){if(u.length<=D)return u;var e,t;f==null?(f="…",e=8,t=3):(e=f.length,t=f.length);var n=D-t,r="";return n>0&&(r=u.substr(-1*Math.floor(n/2))),(u.substr(0,Math.ceil(n/2))+f+r).substr(0,n+e)}function Te(u,D,f){return xe(u,D,f)}var Ne=function(){function u(D){D===void 0&&(D={}),this.newWindow=!1,this.truncate={},this.className="",this.newWindow=D.newWindow||!1,this.truncate=D.truncate||{},this.className=D.className||""}return u.prototype.build=function(D){return new c1({tagName:"a",attrs:this.createAttrs(D),innerHtml:this.processAnchorText(D.getAnchorText())})},u.prototype.createAttrs=function(D){var f={href:D.getAnchorHref()},e=this.createCssClass(D);return e&&(f.class=e),this.newWindow&&(f.target="_blank",f.rel="noopener noreferrer"),this.truncate.length&&this.truncate.length<D.getAnchorText().length&&(f.title=D.getAnchorHref()),f},u.prototype.createCssClass=function(D){var f=this.className;if(f){for(var e=[f],t=D.getCssClassSuffixes(),n=0,r=t.length;n<r;n++)e.push(f+"-"+t[n]);return e.join(" ")}else return""},u.prototype.processAnchorText=function(D){return D=this.doTruncate(D),D},u.prototype.doTruncate=function(D){var f=this.truncate;if(!f.length)return D;var e=f.length,t=f.location;return t==="smart"?ke(D,e):t==="middle"?je(D,e):Te(D,e)},u}(),FD=function(){function u(D){this._=null,this.matchedText="",this.offset=0,this.tagBuilder=D.tagBuilder,this.matchedText=D.matchedText,this.offset=D.offset}return u.prototype.getMatchedText=function(){return this.matchedText},u.prototype.setOffset=function(D){this.offset=D},u.prototype.getOffset=function(){return this.offset},u.prototype.getCssClassSuffixes=function(){return[this.type]},u.prototype.buildTag=function(){return this.tagBuilder.build(this)},u}();function Re(u){return u>=0&&u<=31||u==127}function DD(u){return u>=65&&u<=90||u>=97&&u<=122}function Cu(u){return u>=48&&u<=57}function ef(u){return u==34||u==39}function Ku(u){return u<8232?u<160?u>=9&&u<=13||u==32:u<5760?u==160:u==5760||u>=8192&&u<=8202:u<8287?u>=8232&&u<=8233||u==8239:u<12288?u==8287:u==12288||u==65279}function Ju(u){return u<4800?u<2949?u<2451?u<1425?u<768?u<192?u<169?u<65?u>=48&&u<=57:u>=65&&u<=90||u>=97&&u<=122:u<181?u>=169&&u<=170||u==174:u==181||u==186:u<710?u<216?u>=192&&u<=214:u>=216&&u<=246||u>=248&&u<=705:u<748?u>=710&&u<=721||u>=736&&u<=740:u==748||u==750:u<910?u<895?u<886?u>=768&&u<=884:u>=886&&u<=887||u>=890&&u<=893:u<904?u==895||u==902:u>=904&&u<=906||u==908:u<1155?u<931?u>=910&&u<=929:u>=931&&u<=1013||u>=1015&&u<=1153:u<1369?u>=1155&&u<=1327||u>=1329&&u<=1366:u==1369||u>=1377&&u<=1415:u<1808?u<1552?u<1476?u<1471?u>=1425&&u<=1469:u==1471||u>=1473&&u<=1474:u<1488?u>=1476&&u<=1477||u==1479:u>=1488&&u<=1514||u>=1520&&u<=1522:u<1749?u<1568?u>=1552&&u<=1562:u>=1568&&u<=1641||u>=1646&&u<=1747:u<1770?u>=1749&&u<=1756||u>=1759&&u<=1768:u>=1770&&u<=1788||u==1791:u<2230?u<2042?u<1869?u>=1808&&u<=1866:u>=1869&&u<=1969||u>=1984&&u<=2037:u<2112?u==2042||u>=2048&&u<=2093:u>=2112&&u<=2139||u>=2208&&u<=2228:u<2406?u<2260?u>=2230&&u<=2237:u>=2260&&u<=2273||u>=2275&&u<=2403:u<2437?u>=2406&&u<=2415||u>=2417&&u<=2435:u>=2437&&u<=2444||u>=2447&&u<=2448:u<2693?u<2579?u<2519?u<2486?u<2474?u>=2451&&u<=2472:u>=2474&&u<=2480||u==2482:u<2503?u>=2486&&u<=2489||u>=2492&&u<=2500:u>=2503&&u<=2504||u>=2507&&u<=2510:u<2534?u<2524?u==2519:u>=2524&&u<=2525||u>=2527&&u<=2531:u<2565?u>=2534&&u<=2545||u>=2561&&u<=2563:u>=2565&&u<=2570||u>=2575&&u<=2576:u<2631?u<2613?u<2602?u>=2579&&u<=2600:u>=2602&&u<=2608||u>=2610&&u<=2611:u<2620?u>=2613&&u<=2614||u>=2616&&u<=2617:u==2620||u>=2622&&u<=2626:u<2649?u<2635?u>=2631&&u<=2632:u>=2635&&u<=2637||u==2641:u<2662?u>=2649&&u<=2652||u==2654:u>=2662&&u<=2677||u>=2689&&u<=2691:u<2821?u<2759?u<2730?u<2703?u>=2693&&u<=2701:u>=2703&&u<=2705||u>=2707&&u<=2728:u<2741?u>=2730&&u<=2736||u>=2738&&u<=2739:u>=2741&&u<=2745||u>=2748&&u<=2757:u<2784?u<2763?u>=2759&&u<=2761:u>=2763&&u<=2765||u==2768:u<2809?u>=2784&&u<=2787||u>=2790&&u<=2799:u==2809||u>=2817&&u<=2819:u<2887?u<2858?u<2831?u>=2821&&u<=2828:u>=2831&&u<=2832||u>=2835&&u<=2856:u<2869?u>=2858&&u<=2864||u>=2866&&u<=2867:u>=2869&&u<=2873||u>=2876&&u<=2884:u<2911?u<2902?u>=2887&&u<=2888||u>=2891&&u<=2893:u>=2902&&u<=2903||u>=2908&&u<=2909:u<2929?u>=2911&&u<=2915||u>=2918&&u<=2927:u==2929||u>=2946&&u<=2947:u<3517?u<3205?u<3046?u<2984?u<2969?u<2958?u>=2949&&u<=2954:u>=2958&&u<=2960||u>=2962&&u<=2965:u<2974?u>=2969&&u<=2970||u==2972:u>=2974&&u<=2975||u>=2979&&u<=2980:u<3014?u<2990?u>=2984&&u<=2986:u>=2990&&u<=3001||u>=3006&&u<=3010:u<3024?u>=3014&&u<=3016||u>=3018&&u<=3021:u==3024||u==3031:u<3142?u<3086?u<3072?u>=3046&&u<=3055:u>=3072&&u<=3075||u>=3077&&u<=3084:u<3114?u>=3086&&u<=3088||u>=3090&&u<=3112:u>=3114&&u<=3129||u>=3133&&u<=3140:u<3160?u<3146?u>=3142&&u<=3144:u>=3146&&u<=3149||u>=3157&&u<=3158:u<3174?u>=3160&&u<=3162||u>=3168&&u<=3171:u>=3174&&u<=3183||u>=3200&&u<=3203:u<3333?u<3274?u<3242?u<3214?u>=3205&&u<=3212:u>=3214&&u<=3216||u>=3218&&u<=3240:u<3260?u>=3242&&u<=3251||u>=3253&&u<=3257:u>=3260&&u<=3268||u>=3270&&u<=3272:u<3296?u<3285?u>=3274&&u<=3277:u>=3285&&u<=3286||u==3294:u<3313?u>=3296&&u<=3299||u>=3302&&u<=3311:u>=3313&&u<=3314||u>=3329&&u<=3331:u<3423?u<3389?u<3342?u>=3333&&u<=3340:u>=3342&&u<=3344||u>=3346&&u<=3386:u<3402?u>=3389&&u<=3396||u>=3398&&u<=3400:u>=3402&&u<=3406||u>=3412&&u<=3415:u<3458?u<3430?u>=3423&&u<=3427:u>=3430&&u<=3439||u>=3450&&u<=3455:u<3482?u>=3458&&u<=3459||u>=3461&&u<=3478:u>=3482&&u<=3505||u>=3507&&u<=3515:u<3804?u<3722?u<3570?u<3535?u<3520?u==3517:u>=3520&&u<=3526||u==3530:u<3544?u>=3535&&u<=3540||u==3542:u>=3544&&u<=3551||u>=3558&&u<=3567:u<3664?u<3585?u>=3570&&u<=3571:u>=3585&&u<=3642||u>=3648&&u<=3662:u<3716?u>=3664&&u<=3673||u>=3713&&u<=3714:u==3716||u>=3719&&u<=3720:u<3754?u<3737?u<3725?u==3722:u==3725||u>=3732&&u<=3735:u<3749?u>=3737&&u<=3743||u>=3745&&u<=3747:u==3749||u==3751:u<3776?u<3757?u>=3754&&u<=3755:u>=3757&&u<=3769||u>=3771&&u<=3773:u<3784?u>=3776&&u<=3780||u==3782:u>=3784&&u<=3789||u>=3792&&u<=3801:u<4176?u<3902?u<3872?u<3840?u>=3804&&u<=3807:u==3840||u>=3864&&u<=3865:u<3895?u>=3872&&u<=3881||u==3893:u==3895||u==3897:u<3974?u<3913?u>=3902&&u<=3911:u>=3913&&u<=3948||u>=3953&&u<=3972:u<4038?u>=3974&&u<=3991||u>=3993&&u<=4028:u==4038||u>=4096&&u<=4169:u<4688?u<4301?u<4256?u>=4176&&u<=4253:u>=4256&&u<=4293||u==4295:u<4348?u==4301||u>=4304&&u<=4346:u>=4348&&u<=4680||u>=4682&&u<=4685:u<4746?u<4698?u>=4688&&u<=4694||u==4696:u>=4698&&u<=4701||u>=4704&&u<=4744:u<4786?u>=4746&&u<=4749||u>=4752&&u<=4784:u>=4786&&u<=4789||u>=4792&&u<=4798:u<11035?u<7416?u<6176?u<5873?u<4992?u<4824?u<4802?u==4800:u>=4802&&u<=4805||u>=4808&&u<=4822:u<4888?u>=4824&&u<=4880||u>=4882&&u<=4885:u>=4888&&u<=4954||u>=4957&&u<=4959:u<5121?u<5024?u>=4992&&u<=5007:u>=5024&&u<=5109||u>=5112&&u<=5117:u<5761?u>=5121&&u<=5740||u>=5743&&u<=5759:u>=5761&&u<=5786||u>=5792&&u<=5866:u<6002?u<5920?u<5888?u>=5873&&u<=5880:u>=5888&&u<=5900||u>=5902&&u<=5908:u<5984?u>=5920&&u<=5940||u>=5952&&u<=5971:u>=5984&&u<=5996||u>=5998&&u<=6e3:u<6108?u<6016?u>=6002&&u<=6003:u>=6016&&u<=6099||u==6103:u<6155?u>=6108&&u<=6109||u>=6112&&u<=6121:u>=6155&&u<=6157||u>=6160&&u<=6169:u<6783?u<6512?u<6400?u<6272?u>=6176&&u<=6263:u>=6272&&u<=6314||u>=6320&&u<=6389:u<6448?u>=6400&&u<=6430||u>=6432&&u<=6443:u>=6448&&u<=6459||u>=6470&&u<=6509:u<6608?u<6528?u>=6512&&u<=6516:u>=6528&&u<=6571||u>=6576&&u<=6601:u<6688?u>=6608&&u<=6617||u>=6656&&u<=6683:u>=6688&&u<=6750||u>=6752&&u<=6780:u<7040?u<6832?u<6800?u>=6783&&u<=6793:u>=6800&&u<=6809||u==6823:u<6992?u>=6832&&u<=6846||u>=6912&&u<=6987:u>=6992&&u<=7001||u>=7019&&u<=7027:u<7245?u<7168?u>=7040&&u<=7155:u>=7168&&u<=7223||u>=7232&&u<=7241:u<7376?u>=7245&&u<=7293||u>=7296&&u<=7304:u>=7376&&u<=7378||u>=7380&&u<=7414:u<8450?u<8130?u<8025?u<7960?u<7424?u>=7416&&u<=7417:u>=7424&&u<=7669||u>=7675&&u<=7957:u<8008?u>=7960&&u<=7965||u>=7968&&u<=8005:u>=8008&&u<=8013||u>=8016&&u<=8023:u<8031?u<8027?u==8025:u==8027||u==8029:u<8118?u>=8031&&u<=8061||u>=8064&&u<=8116:u>=8118&&u<=8124||u==8126:u<8205?u<8150?u<8134?u>=8130&&u<=8132:u>=8134&&u<=8140||u>=8144&&u<=8147:u<8178?u>=8150&&u<=8155||u>=8160&&u<=8172:u>=8178&&u<=8180||u>=8182&&u<=8188:u<8305?u<8252?u==8205:u==8252||u==8265:u<8336?u==8305||u==8319:u>=8336&&u<=8348||u>=8400&&u<=8432:u<8579?u<8486?u<8469?u<8455?u==8450:u==8455||u>=8458&&u<=8467:u<8482?u==8469||u>=8473&&u<=8477:u==8482||u==8484:u<8495?u<8488?u==8486:u==8488||u>=8490&&u<=8493:u<8517?u>=8495&&u<=8505||u>=8508&&u<=8511:u>=8517&&u<=8521||u==8526:u<9410?u<9e3?u<8592?u>=8579&&u<=8580:u>=8592&&u<=8703||u>=8986&&u<=8987:u<9193?u==9e3||u==9167:u>=9193&&u<=9203||u>=9208&&u<=9210:u<9723?u<9654?u==9410||u>=9642&&u<=9643:u==9654||u==9664:u<10548?u>=9723&&u<=9726||u>=9728&&u<=10175:u>=10548&&u<=10549||u>=11013&&u<=11015:u<43259?u<12445?u<11688?u<11520?u<11264?u<11088?u>=11035&&u<=11036:u==11088||u==11093:u<11360?u>=11264&&u<=11310||u>=11312&&u<=11358:u>=11360&&u<=11492||u>=11499&&u<=11507:u<11568?u<11559?u>=11520&&u<=11557:u==11559||u==11565:u<11647?u>=11568&&u<=11623||u==11631:u>=11647&&u<=11670||u>=11680&&u<=11686:u<11744?u<11712?u<11696?u>=11688&&u<=11694:u>=11696&&u<=11702||u>=11704&&u<=11710:u<11728?u>=11712&&u<=11718||u>=11720&&u<=11726:u>=11728&&u<=11734||u>=11736&&u<=11742:u<12330?u<11823?u>=11744&&u<=11775:u==11823||u>=12293&&u<=12294:u<12353?u>=12330&&u<=12341||u>=12347&&u<=12349:u>=12353&&u<=12438||u>=12441&&u<=12442:u<42512?u<12951?u<12549?u<12449?u>=12445&&u<=12447:u>=12449&&u<=12538||u>=12540&&u<=12543:u<12704?u>=12549&&u<=12589||u>=12593&&u<=12686:u>=12704&&u<=12730||u>=12784&&u<=12799:u<19968?u<12953?u==12951:u==12953||u>=13312&&u<=19893:u<42192?u>=19968&&u<=40917||u>=40960&&u<=42124:u>=42192&&u<=42237||u>=42240&&u<=42508:u<42891?u<42623?u<42560?u>=42512&&u<=42539:u>=42560&&u<=42610||u>=42612&&u<=42621:u<42775?u>=42623&&u<=42725||u>=42736&&u<=42737:u>=42775&&u<=42783||u>=42786&&u<=42888:u<43072?u<42928?u>=42891&&u<=42926:u>=42928&&u<=42935||u>=42999&&u<=43047:u<43216?u>=43072&&u<=43123||u>=43136&&u<=43205:u>=43216&&u<=43225||u>=43232&&u<=43255:u<55243?u<43744?u<43488?u<43312?u<43261?u==43259:u==43261||u>=43264&&u<=43309:u<43392?u>=43312&&u<=43347||u>=43360&&u<=43388:u>=43392&&u<=43456||u>=43471&&u<=43481:u<43600?u<43520?u>=43488&&u<=43518:u>=43520&&u<=43574||u>=43584&&u<=43597:u<43642?u>=43600&&u<=43609||u>=43616&&u<=43638:u>=43642&&u<=43714||u>=43739&&u<=43741:u<43824?u<43785?u<43762?u>=43744&&u<=43759:u>=43762&&u<=43766||u>=43777&&u<=43782:u<43808?u>=43785&&u<=43790||u>=43793&&u<=43798:u>=43808&&u<=43814||u>=43816&&u<=43822:u<44012?u<43868?u>=43824&&u<=43866:u>=43868&&u<=43877||u>=43888&&u<=44010:u<44032?u>=44012&&u<=44013||u>=44016&&u<=44025:u>=44032&&u<=55203||u>=55216&&u<=55238:u<64848?u<64298?u<64112?u<55296?u>=55243&&u<=55291:u>=55296&&u<=57343||u>=63744&&u<=64109:u<64275?u>=64112&&u<=64217||u>=64256&&u<=64262:u>=64275&&u<=64279||u>=64285&&u<=64296:u<64320?u<64312?u>=64298&&u<=64310:u>=64312&&u<=64316||u==64318:u<64326?u>=64320&&u<=64321||u>=64323&&u<=64324:u>=64326&&u<=64433||u>=64467&&u<=64829:u<65296?u<65024?u<64914?u>=64848&&u<=64911:u>=64914&&u<=64967||u>=65008&&u<=65019:u<65136?u>=65024&&u<=65039||u>=65056&&u<=65071:u>=65136&&u<=65140||u>=65142&&u<=65276:u<65474?u<65345?u>=65296&&u<=65305||u>=65313&&u<=65338:u>=65345&&u<=65370||u>=65382&&u<=65470:u<65490?u>=65474&&u<=65479||u>=65482&&u<=65487:u>=65490&&u<=65495||u>=65498&&u<=65500}function Oe(u){return u<47?u<42?u==33||u>=35&&u<=39:u>=42&&u<=43||u==45:u<63?u==47||u==61:u<94?u==63:u>=94&&u<=96||u>=123&&u<=126}function Pe(u){return u<91?u<47?u>=35&&u<=43||u==45:u<61?u==47:u==61||u==64:u<95?u==91||u==93:u<123?u==95:u>=123&&u<=126||u==10003}function E1(u){return u<58?u<44?u==33:u==44||u==46:u<63?u>=58&&u<=59:u==63||u==94}function Ie(u){return u<91?u==40:u==91||u==123}function h1(u){return u<93?u==41:u==93||u==125}var Le=/^(?:xn--vermgensberatung-pwb|xn--vermgensberater-ctb|xn--clchc0ea0b2g2a9gcd|xn--w4r85el8fhu5dnra|travelersinsurance|vermögensberatung|xn--5su34j936bgsg|xn--bck1b9a5dre4c|xn--mgbah1a3hjkrd|xn--mgbai9azgqp6j|xn--mgberp4a5d4ar|xn--xkc2dl3a5ee0h|vermögensberater|xn--fzys8d69uvgm|xn--mgba7c0bbn0a|xn--mgbcpq6gpa1a|xn--xkc2al3hye2a|americanexpress|kerryproperties|sandvikcoromant|xn--i1b6b1a6a2e|xn--kcrx77d1x4a|xn--lgbbat1ad8j|xn--mgba3a4f16a|xn--mgbc0a9azcg|xn--nqv7fs00ema|americanfamily|weatherchannel|xn--54b7fta0cc|xn--6qq986b3xl|xn--80aqecdr1a|xn--b4w605ferd|xn--fiq228c5hs|xn--h2breg3eve|xn--jlq480n2rg|xn--mgba3a3ejt|xn--mgbaam7a8h|xn--mgbayh7gpa|xn--mgbbh1a71e|xn--mgbca7dzdo|xn--mgbi4ecexp|xn--mgbx4cd0ab|xn--rvc1e0am3e|international|lifeinsurance|wolterskluwer|xn--cckwcxetd|xn--eckvdtc9d|xn--fpcrj9c3d|xn--fzc2c9e2c|xn--h2brj9c8c|xn--tiq49xqyj|xn--yfro4i67o|xn--ygbi2ammx|construction|lplfinancial|scholarships|versicherung|xn--3e0b707e|xn--45br5cyl|xn--4dbrk0ce|xn--80adxhks|xn--80asehdb|xn--8y0a063a|xn--gckr3f0f|xn--mgb9awbf|xn--mgbab2bd|xn--mgbgu82a|xn--mgbpl2fh|xn--mgbt3dhd|xn--mk1bu44c|xn--ngbc5azd|xn--ngbe9e0a|xn--ogbpf8fl|xn--qcka1pmc|accountants|barclaycard|blackfriday|blockbuster|bridgestone|calvinklein|contractors|creditunion|engineering|enterprises|investments|kerryhotels|lamborghini|motorcycles|olayangroup|photography|playstation|productions|progressive|redumbrella|williamhill|xn--11b4c3d|xn--1ck2e1b|xn--1qqw23a|xn--2scrj9c|xn--3bst00m|xn--3ds443g|xn--3hcrj9c|xn--42c2d9a|xn--45brj9c|xn--55qw42g|xn--6frz82g|xn--80ao21a|xn--9krt00a|xn--cck2b3b|xn--czr694b|xn--d1acj3b|xn--efvy88h|xn--fct429k|xn--fjq720a|xn--flw351e|xn--g2xx48c|xn--gecrj9c|xn--gk3at1e|xn--h2brj9c|xn--hxt814e|xn--imr513n|xn--j6w193g|xn--jvr189m|xn--kprw13d|xn--kpry57d|xn--mgbbh1a|xn--mgbtx2b|xn--mix891f|xn--nyqy26a|xn--otu796d|xn--pgbs0dh|xn--q9jyb4c|xn--rhqv96g|xn--rovu88b|xn--s9brj9c|xn--ses554g|xn--t60b56a|xn--vuq861b|xn--w4rs40l|xn--xhq521b|xn--zfr164b|சிங்கப்பூர்|accountant|apartments|associates|basketball|bnpparibas|boehringer|capitalone|consulting|creditcard|cuisinella|eurovision|extraspace|foundation|healthcare|immobilien|industries|management|mitsubishi|nextdirect|properties|protection|prudential|realestate|republican|restaurant|schaeffler|tatamotors|technology|university|vlaanderen|xn--30rr7y|xn--3pxu8k|xn--45q11c|xn--4gbrim|xn--55qx5d|xn--5tzm5g|xn--80aswg|xn--90a3ac|xn--9dbq2a|xn--9et52u|xn--c2br7g|xn--cg4bki|xn--czrs0t|xn--czru2d|xn--fiq64b|xn--fiqs8s|xn--fiqz9s|xn--io0a7i|xn--kput3i|xn--mxtq1m|xn--o3cw4h|xn--pssy2u|xn--q7ce6a|xn--unup4y|xn--wgbh1c|xn--wgbl6a|xn--y9a3aq|accenture|allfinanz|amsterdam|analytics|aquarelle|barcelona|bloomberg|christmas|community|directory|education|equipment|fairwinds|financial|firestone|fresenius|furniture|goldpoint|hisamitsu|homedepot|homegoods|homesense|institute|insurance|kuokgroup|landrover|lifestyle|marketing|marshalls|melbourne|microsoft|panasonic|pramerica|richardli|shangrila|solutions|statebank|statefarm|stockholm|travelers|vacations|xn--90ais|xn--c1avg|xn--d1alf|xn--e1a4c|xn--fhbei|xn--j1aef|xn--j1amh|xn--l1acc|xn--ngbrx|xn--nqv7f|xn--p1acf|xn--qxa6a|xn--tckwe|xn--vhquv|yodobashi|موريتانيا|abudhabi|airforce|allstate|attorney|barclays|barefoot|bargains|baseball|boutique|bradesco|broadway|brussels|builders|business|capetown|catering|catholic|cipriani|cleaning|clinique|clothing|commbank|computer|delivery|deloitte|democrat|diamonds|discount|discover|download|engineer|ericsson|exchange|feedback|fidelity|firmdale|football|frontier|goodyear|grainger|graphics|hdfcbank|helsinki|holdings|hospital|infiniti|ipiranga|istanbul|jpmorgan|lighting|lundbeck|marriott|mckinsey|memorial|merckmsd|mortgage|observer|partners|pharmacy|pictures|plumbing|property|redstone|reliance|saarland|samsclub|security|services|shopping|softbank|software|stcgroup|supplies|training|vanguard|ventures|verisign|woodside|xn--90ae|xn--node|xn--p1ai|xn--qxam|yokohama|السعودية|abogado|academy|agakhan|alibaba|android|athleta|auction|audible|auspost|banamex|bauhaus|bestbuy|booking|brother|capital|caravan|careers|channel|charity|chintai|citadel|clubmed|college|cologne|company|compare|contact|cooking|corsica|country|coupons|courses|cricket|cruises|dentist|digital|domains|exposed|express|farmers|fashion|ferrari|ferrero|finance|fishing|fitness|flights|florist|flowers|forsale|frogans|fujitsu|gallery|genting|godaddy|grocery|guitars|hamburg|hangout|hitachi|holiday|hosting|hotmail|hyundai|ismaili|jewelry|juniper|kitchen|komatsu|lacaixa|lanxess|lasalle|latrobe|leclerc|limited|lincoln|markets|monster|netbank|netflix|network|neustar|okinawa|organic|origins|philips|pioneer|politie|realtor|recipes|rentals|reviews|rexroth|samsung|sandvik|schmidt|schwarz|science|shiksha|singles|staples|storage|support|surgery|systems|temasek|theater|theatre|tickets|toshiba|trading|walmart|wanggou|watches|weather|website|wedding|whoswho|windows|winners|yamaxun|youtube|zuerich|католик|البحرين|الجزائر|العليان|پاکستان|كاثوليك|இந்தியா|abbott|abbvie|africa|agency|airbus|airtel|alipay|alsace|alstom|amazon|anquan|aramco|author|bayern|beauty|berlin|bharti|bostik|boston|broker|camera|career|casino|center|chanel|chrome|church|circle|claims|clinic|coffee|comsec|condos|coupon|credit|cruise|dating|datsun|dealer|degree|dental|design|direct|doctor|dunlop|dupont|durban|emerck|energy|estate|events|expert|family|flickr|futbol|gallup|garden|george|giving|global|google|gratis|health|hermes|hiphop|hockey|hotels|hughes|imamat|insure|intuit|jaguar|joburg|juegos|kaufen|kindle|kosher|latino|lawyer|lefrak|living|locker|london|luxury|madrid|maison|makeup|market|mattel|mobile|monash|mormon|moscow|museum|nagoya|nissan|nissay|norton|nowruz|office|olayan|online|oracle|orange|otsuka|pfizer|photos|physio|pictet|quebec|racing|realty|reisen|repair|report|review|rogers|ryukyu|safety|sakura|sanofi|school|schule|search|secure|select|shouji|soccer|social|stream|studio|supply|suzuki|swatch|sydney|taipei|taobao|target|tattoo|tennis|tienda|tjmaxx|tkmaxx|toyota|travel|unicom|viajes|viking|villas|virgin|vision|voting|voyage|walter|webcam|xihuan|yachts|yandex|zappos|москва|онлайн|ابوظبي|ارامكو|الاردن|المغرب|امارات|فلسطين|مليسيا|भारतम्|இலங்கை|ファッション|actor|adult|aetna|amfam|amica|apple|archi|audio|autos|azure|baidu|beats|bible|bingo|black|boats|bosch|build|canon|cards|chase|cheap|cisco|citic|click|cloud|coach|codes|crown|cymru|dance|deals|delta|drive|dubai|earth|edeka|email|epson|faith|fedex|final|forex|forum|gallo|games|gifts|gives|glass|globo|gmail|green|gripe|group|gucci|guide|homes|honda|horse|house|hyatt|ikano|irish|jetzt|koeln|kyoto|lamer|lease|legal|lexus|lilly|loans|locus|lotte|lotto|mango|media|miami|money|movie|music|nexus|nikon|ninja|nokia|nowtv|omega|osaka|paris|parts|party|phone|photo|pizza|place|poker|praxi|press|prime|promo|quest|radio|rehab|reise|ricoh|rocks|rodeo|rugby|salon|sener|seven|sharp|shell|shoes|skype|sling|smart|smile|solar|space|sport|stada|store|study|style|sucks|swiss|tatar|tires|tirol|tmall|today|tokyo|tools|toray|total|tours|trade|trust|tunes|tushu|ubank|vegas|video|vodka|volvo|wales|watch|weber|weibo|works|world|xerox|yahoo|ישראל|ایران|بازار|بھارت|سودان|سورية|همراه|भारोत|संगठन|বাংলা|భారత్|ഭാരതം|嘉里大酒店|aarp|able|aero|akdn|ally|amex|arab|army|arpa|arte|asda|asia|audi|auto|baby|band|bank|bbva|beer|best|bike|bing|blog|blue|bofa|bond|book|buzz|cafe|call|camp|care|cars|casa|case|cash|cbre|cern|chat|citi|city|club|cool|coop|cyou|data|date|dclk|deal|dell|desi|diet|dish|docs|dvag|erni|fage|fail|fans|farm|fast|fido|film|fire|fish|flir|food|ford|free|fund|game|gbiz|gent|ggee|gift|gmbh|gold|golf|goog|guge|guru|hair|haus|hdfc|help|here|host|hsbc|icbc|ieee|imdb|immo|info|itau|java|jeep|jobs|jprs|kddi|kids|kiwi|kpmg|kred|land|lego|lgbt|lidl|life|like|limo|link|live|loan|love|ltda|luxe|maif|meet|meme|menu|mini|mint|mobi|moda|moto|name|navy|news|next|nico|nike|ollo|open|page|pars|pccw|pics|ping|pink|play|plus|pohl|porn|post|prod|prof|qpon|read|reit|rent|rest|rich|room|rsvp|ruhr|safe|sale|sarl|save|saxo|scot|seat|seek|sexy|shia|shop|show|silk|sina|site|skin|sncf|sohu|song|sony|spot|star|surf|talk|taxi|team|tech|teva|tiaa|tips|town|toys|tube|vana|visa|viva|vivo|vote|voto|wang|weir|wien|wiki|wine|work|xbox|yoga|zara|zero|zone|дети|сайт|بارت|بيتك|ڀارت|تونس|شبكة|عراق|عمان|موقع|भारत|ভারত|ভাৰত|ਭਾਰਤ|ભારત|ଭାରତ|ಭಾರತ|ලංකා|アマゾン|グーグル|クラウド|ポイント|组织机构|電訊盈科|香格里拉|aaa|abb|abc|aco|ads|aeg|afl|aig|anz|aol|app|art|aws|axa|bar|bbc|bbt|bcg|bcn|bet|bid|bio|biz|bms|bmw|bom|boo|bot|box|buy|bzh|cab|cal|cam|car|cat|cba|cbn|ceo|cfa|cfd|com|cpa|crs|dad|day|dds|dev|dhl|diy|dnp|dog|dot|dtv|dvr|eat|eco|edu|esq|eus|fan|fit|fly|foo|fox|frl|ftr|fun|fyi|gal|gap|gay|gdn|gea|gle|gmo|gmx|goo|gop|got|gov|hbo|hiv|hkt|hot|how|ibm|ice|icu|ifm|inc|ing|ink|int|ist|itv|jcb|jio|jll|jmp|jnj|jot|joy|kfh|kia|kim|kpn|krd|lat|law|lds|llc|llp|lol|lpl|ltd|man|map|mba|med|men|mil|mit|mlb|mls|mma|moe|moi|mom|mov|msd|mtn|mtr|nab|nba|nec|net|new|nfl|ngo|nhk|now|nra|nrw|ntt|nyc|obi|one|ong|onl|ooo|org|ott|ovh|pay|pet|phd|pid|pin|pnc|pro|pru|pub|pwc|red|ren|ril|rio|rip|run|rwe|sap|sas|sbi|sbs|scb|sew|sex|sfr|ski|sky|soy|spa|srl|stc|tab|tax|tci|tdk|tel|thd|tjx|top|trv|tui|tvs|ubs|uno|uol|ups|vet|vig|vin|vip|wed|win|wme|wow|wtc|wtf|xin|xxx|xyz|you|yun|zip|бел|ком|қаз|мкд|мон|орг|рус|срб|укр|հայ|קום|عرب|قطر|كوم|مصر|कॉम|नेट|คอม|ไทย|ລາວ|ストア|セール|みんな|中文网|亚马逊|天主教|我爱你|新加坡|淡马锡|飞利浦|ac|ad|ae|af|ag|ai|al|am|ao|aq|ar|as|at|au|aw|ax|az|ba|bb|bd|be|bf|bg|bh|bi|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|cr|cu|cv|cw|cx|cy|cz|de|dj|dk|dm|do|dz|ec|ee|eg|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gg|gh|gi|gl|gm|gn|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|im|in|io|iq|ir|is|it|je|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|me|mg|mh|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|mv|mw|mx|my|mz|na|nc|ne|nf|ng|ni|nl|no|np|nr|nu|nz|om|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|ps|pt|pw|py|qa|re|ro|rs|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|sk|sl|sm|sn|so|sr|ss|st|su|sv|sx|sy|sz|tc|td|tf|tg|th|tj|tk|tl|tm|tn|to|tr|tt|tv|tw|tz|ua|ug|uk|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|za|zm|zw|ελ|ευ|бг|ею|рф|გე|닷넷|닷컴|삼성|한국|コム|世界|中信|中国|中國|企业|佛山|信息|健康|八卦|公司|公益|台湾|台灣|商城|商店|商标|嘉里|在线|大拿|娱乐|家電|广东|微博|慈善|手机|招聘|政务|政府|新闻|时尚|書籍|机构|游戏|澳門|点看|移动|网址|网店|网站|网络|联通|谷歌|购物|通販|集团|食品|餐厅|香港)$/,b1=/https?:\/\//i,Me=new RegExp("^"+b1.source,"i"),ze=/^(javascript|vbscript):/i,Ue=/^[A-Za-z][-.+A-Za-z0-9]*:(\/\/)?([^:/]*)/,Ve=/^(?:\/\/)?([^/#?:]+)/,iD=DD;function p1(u){return DD(u)||Cu(u)||u===43||u===45||u===46}var Hu=Ju;function tf(u){return u===95||Hu(u)}function B1(u){return Ju(u)||Pe(u)||E1(u)}function nf(u){return u===47||u===63||u===35}function g1(u){return Le.test(u.toLowerCase())}function We(u){if(ze.test(u))return!1;var D=u.match(Ue);if(!D)return!1;var f=!!D[1],e=D[2];return f?!0:!(e.indexOf(".")===-1||!/[A-Za-z]/.test(e))}function He(u){var D=u.match(Ve);if(!D)return!1;var f=D[0],e=f.split(".");if(e.length<2)return!1;var t=e[e.length-1];return!!g1(t)}var qe=/^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/,Ye=/[:/?#]/;function $e(u){var D=u.split(Ye,1)[0];return qe.test(D)}var Ke=/^(https?:\/\/)?(?:www\.)?/i,Je=/^\/\//,Ge=function(u){aD(D,u);function D(f){var e=u.call(this,f)||this;return e.type="url",e.url="",e.urlMatchType="scheme",e.protocolRelativeMatch=!1,e.stripPrefix={scheme:!0,www:!0},e.stripTrailingSlash=!0,e.decodePercentEncoding=!0,e.protocolPrepended=!1,e.urlMatchType=f.urlMatchType,e.url=f.url,e.protocolRelativeMatch=f.protocolRelativeMatch,e.stripPrefix=f.stripPrefix,e.stripTrailingSlash=f.stripTrailingSlash,e.decodePercentEncoding=f.decodePercentEncoding,e}return D.prototype.getType=function(){return"url"},D.prototype.getUrlMatchType=function(){return this.urlMatchType},D.prototype.getUrl=function(){var f=this.url;return!this.protocolRelativeMatch&&this.urlMatchType!=="scheme"&&!this.protocolPrepended&&(f=this.url="http://"+f,this.protocolPrepended=!0),f},D.prototype.getAnchorHref=function(){var f=this.getUrl();return f.replace(/&/g,"&")},D.prototype.getAnchorText=function(){var f=this.getMatchedText();return this.protocolRelativeMatch&&(f=Qe(f)),this.stripPrefix.scheme&&(f=Xe(f)),this.stripPrefix.www&&(f=Ze(f)),this.stripTrailingSlash&&(f=u3(f)),this.decodePercentEncoding&&(f=D3(f)),f},D}(FD);function Xe(u){return u.replace(Me,"")}function Ze(u){return u.includes("www.")?u.replace(Ke,"$1"):u}function Qe(u){return u.replace(Je,"")}function u3(u){return u.charAt(u.length-1)==="/"&&(u=u.slice(0,-1)),u}function D3(u){var D=u.replace(/%(?:22|26|27|3C|3E)/gi,function(f){return f==="%22"?""":f==="%26"?"&":f==="%27"?"'":f==="%3C"||f==="%3c"?"<":">"});if(D.includes("%"))try{return decodeURIComponent(D)}catch{}return D}var f3=/^mailto:/i,m1=Ju;function rf(u){return m1(u)||Oe(u)}function e3(u){var D=u.split(".").pop();return g1(D)}var t3=function(u){aD(D,u);function D(f){var e=u.call(this,f)||this;return e.type="email",e.email="",e.email=f.email,e}return D.prototype.getType=function(){return"email"},D.prototype.getEmail=function(){return this.email},D.prototype.getAnchorHref=function(){return"mailto:"+this.email},D.prototype.getAnchorText=function(){return this.email},D}(FD);function _1(u){return u===95||Ju(u)}function n3(u){return u.length<=140}var r3=["twitter","facebook","instagram","tiktok","youtube"],s3=function(u){aD(D,u);function D(f){var e=u.call(this,f)||this;return e.type="hashtag",e.serviceName="twitter",e.hashtag="",e.serviceName=f.serviceName,e.hashtag=f.hashtag,e}return D.prototype.getType=function(){return"hashtag"},D.prototype.getServiceName=function(){return this.serviceName},D.prototype.getHashtag=function(){return this.hashtag},D.prototype.getAnchorHref=function(){var f=this.serviceName,e=this.hashtag;switch(f){case"twitter":return"https://twitter.com/hashtag/"+e;case"facebook":return"https://www.facebook.com/hashtag/"+e;case"instagram":return"https://instagram.com/explore/tags/"+e;case"tiktok":return"https://www.tiktok.com/tag/"+e;case"youtube":return"https://youtube.com/hashtag/"+e;default:$u(f)}},D.prototype.getAnchorText=function(){return"#"+this.hashtag},D.prototype.getCssClassSuffixes=function(){var f=u.prototype.getCssClassSuffixes.call(this),e=this.getServiceName();return e&&f.push(e),f},D}(FD),a3={twitter:/^@\w{1,15}$/,instagram:/^@[_\w]{1,30}$/,soundcloud:/^@[-a-z0-9_]{3,25}$/,tiktok:/^@[.\w]{1,23}[\w]$/,youtube:/^@[-.·\w]{3,30}$/};function y1(u){return u===45||u===46||u===95||DD(u)||Cu(u)}function F3(u,D){var f=a3[D];return f.test(u)}var i3=["twitter","instagram","soundcloud","tiktok","youtube"],o3=function(u){aD(D,u);function D(f){var e=u.call(this,f)||this;return e.type="mention",e.serviceName="twitter",e.mention="",e.mention=f.mention,e.serviceName=f.serviceName,e}return D.prototype.getType=function(){return"mention"},D.prototype.getMention=function(){return this.mention},D.prototype.getServiceName=function(){return this.serviceName},D.prototype.getAnchorHref=function(){switch(this.serviceName){case"twitter":return"https://twitter.com/"+this.mention;case"instagram":return"https://instagram.com/"+this.mention;case"soundcloud":return"https://soundcloud.com/"+this.mention;case"tiktok":return"https://www.tiktok.com/@"+this.mention;case"youtube":return"https://youtube.com/@"+this.mention;default:$u(this.serviceName)}},D.prototype.getAnchorText=function(){return"@"+this.mention},D.prototype.getCssClassSuffixes=function(){var f=u.prototype.getCssClassSuffixes.call(this),e=this.getServiceName();return e&&f.push(e),f},D}(FD),d3=/[-. ()]/,C3=/(?:(?:(?:(\+)?\d{1,3}[-. ]?)?\(?\d{3}\)?[-. ]?\d{3}[-. ]?\d{4})|(?:(\+)(?:9[976]\d|8[987530]\d|6[987]\d|5[90]\d|42\d|3[875]\d|2[98654321]\d|9[8543210]|8[6421]|6[6543210]|5[87654321]|4[987654310]|3[9643210]|2[70]|7|1)[-. ]?(?:\d[-. ]?){6,12}\d+))([,;]+[0-9]+#?)*/,c3=/(0([1-9]-?[1-9]\d{3}|[1-9]{2}-?\d{3}|[1-9]{2}\d{1}-?\d{2}|[1-9]{2}\d{2}-?\d{1})-?\d{4}|0[789]0-?\d{4}-?\d{4}|050-?\d{4}-?\d{4})/,l3=new RegExp("^".concat(C3.source,"|").concat(c3.source,"$"));function v1(u){return u===45||u===46||u===32}function sf(u){return u===44||u===59}function E3(u){var D=u.charAt(0)==="+"||d3.test(u);return D&&l3.test(u)}var h3=function(u){aD(D,u);function D(f){var e=u.call(this,f)||this;return e.type="phone",e.number="",e.plusSign=!1,e.number=f.number,e.plusSign=f.plusSign,e}return D.prototype.getType=function(){return"phone"},D.prototype.getPhoneNumber=function(){return this.number},D.prototype.getNumber=function(){return this.getPhoneNumber()},D.prototype.getAnchorHref=function(){return"tel:"+(this.plusSign?"+":"")+this.number},D.prototype.getAnchorText=function(){return this.matchedText},D}(FD),b3=function(){function u(D,f){this.charIdx=0,this.matches=[],this._stateMachines=[],this.schemeUrlMachinesCount=0,this.text=D,this.tagBuilder=f.tagBuilder,this.stripPrefix=f.stripPrefix,this.stripTrailingSlash=f.stripTrailingSlash,this.decodePercentEncoding=f.decodePercentEncoding,this.hashtagServiceName=f.hashtagServiceName,this.mentionServiceName=f.mentionServiceName}return Object.defineProperty(u.prototype,"stateMachines",{get:function(){return this._stateMachines},enumerable:!1,configurable:!0}),u.prototype.addMachine=function(D){this._stateMachines.push(D),A1(D)&&this.schemeUrlMachinesCount++},u.prototype.removeMachine=function(D){this._stateMachines=this._stateMachines.filter(function(f){return f!==D}),A1(D)&&this.schemeUrlMachinesCount--},u.prototype.hasSchemeUrlMachine=function(){return this.schemeUrlMachinesCount>0},u}();function p3(u,D){for(var f=new b3(u,D);f.charIdx<f.text.length;f.charIdx++){var e=u.charAt(f.charIdx),t=u.charCodeAt(f.charIdx);if(f.stateMachines.length===0)yD(f,e,t);else{for(var n=f.stateMachines.length-1;n>=0;n--){var r=f.stateMachines[n];switch(r.state){case 11:v3(f,r,t);break;case 12:w3(f,r,t);break;case 0:B3(f,r,t);break;case 1:g3(f,r,t);break;case 2:m3(f,r,t);break;case 3:_3(f,r,t);break;case 4:y3(f,r,e,t);break;case 5:A3(f,r,t);break;case 6:x3(f,r,e,t);break;case 7:k3(f,r,e,t);break;case 13:S3(f,r,t);break;case 14:j3(f,r,t);break;case 8:T3(f,r,t);break;case 9:N3(f,r,t);break;case 10:R3(f,r,t);break;case 15:O3(f,r,e,t);break;case 16:P3(f,r,e,t);break;case 17:I3(f,r,e,t);break;case 18:L3(f,r,e,t);break;case 19:M3(f,r,e,t);break;case 20:z3(f,r,t);break;case 21:U3(f,r,t);break;case 22:Gu(f,r,t);break;case 23:V3(f,r,t);break;case 24:W3(f,r,t);break;case 25:H3(f,r,t);break;case 26:q3(f,r,t);break;case 27:Y3(f,r,t);break;case 28:$3(f,r,t);break;case 29:K3(f,r,t);break;case 30:J3(f,r,t);break;case 31:G3(f,r,t);break;case 32:Z3(f,r,e,t);break;case 33:Q3(f,r,t);break;case 34:ut(f,r,t);break;case 35:Dt(f,r,t);break;case 36:ft(f,r,e,t);break;case 37:X3(f,r,e,t);break;case 38:et(f,r,e,t);break;case 39:tt(f,r,e,t);break;case 40:nt(f,r,t);break;case 41:rt(f,r,t);break;default:$u(r.state)}}if(!f.hasSchemeUrlMachine()&&f.charIdx>0&&iD(t)){var a=f.text.charCodeAt(f.charIdx-1);iD(a)||f.addMachine(vD(f.charIdx,0))}}}for(var F=f.stateMachines.length-1;F>=0;F--)f.stateMachines.forEach(function(o){return Du(f,o)});return f.matches}function yD(u,D,f){var e=u.charIdx;if(f===35)u.addMachine(ot(e,28));else if(f===64)u.addMachine(dt(e,30));else if(f===47)u.addMachine(af(e,11));else if(f===43)u.addMachine(Ff(e,37));else if(f===40)u.addMachine(Ff(e,32));else{if(Cu(f)&&(u.addMachine(Ff(e,38)),u.addMachine(Ft(e,13))),m1(f)){var t=D.toLowerCase()==="m"?15:22;u.addMachine(it(e,t))}iD(f)&&u.addMachine(vD(e,0)),Ju(f)&&u.addMachine(af(e,5))}}function B3(u,D,f){f===58?D.state=2:f===45?D.state=1:p1(f)||u.removeMachine(D)}function g3(u,D,f){var e=u.charIdx;f===45||(f===47?(u.removeMachine(D),u.addMachine(af(e,11))):p1(f)?D.state=0:u.removeMachine(D))}function m3(u,D,f){var e=u.charIdx;f===47?D.state=3:f===46?u.removeMachine(D):Hu(f)?(D.state=5,iD(f)&&u.addMachine(vD(e,0))):u.removeMachine(D)}function _3(u,D,f){f===47?D.state=4:B1(f)?(D.state=10,D.acceptStateReached=!0):Du(u,D)}function y3(u,D,f,e){e===47?(D.state=10,D.acceptStateReached=!0):Hu(e)?(D.state=5,D.acceptStateReached=!0):u.removeMachine(D)}function v3(u,D,f){f===47?D.state=12:u.removeMachine(D)}function w3(u,D,f){Hu(f)?D.state=5:u.removeMachine(D)}function A3(u,D,f){f===46?D.state=7:f===45?D.state=6:f===58?D.state=8:nf(f)?D.state=10:tf(f)||Du(u,D)}function x3(u,D,f,e){e===45||(e===46?Du(u,D):Hu(e)?D.state=5:Du(u,D))}function k3(u,D,f,e){e===46?Du(u,D):Hu(e)?(D.state=5,D.acceptStateReached=!0):Du(u,D)}function S3(u,D,f){f===46?D.state=14:f===58?D.state=8:Cu(f)||(nf(f)?D.state=10:Ju(f)?u.removeMachine(D):Du(u,D))}function j3(u,D,f){Cu(f)?(D.octetsEncountered++,D.octetsEncountered===4&&(D.acceptStateReached=!0),D.state=13):Du(u,D)}function T3(u,D,f){Cu(f)?D.state=9:Du(u,D)}function N3(u,D,f){Cu(f)||(nf(f)?D.state=10:Du(u,D))}function R3(u,D,f){B1(f)||Du(u,D)}function O3(u,D,f,e){f.toLowerCase()==="a"?D.state=16:Gu(u,D,e)}function P3(u,D,f,e){f.toLowerCase()==="i"?D.state=17:Gu(u,D,e)}function I3(u,D,f,e){f.toLowerCase()==="l"?D.state=18:Gu(u,D,e)}function L3(u,D,f,e){f.toLowerCase()==="t"?D.state=19:Gu(u,D,e)}function M3(u,D,f,e){f.toLowerCase()==="o"?D.state=20:Gu(u,D,e)}function z3(u,D,f){f===58?D.state=21:Gu(u,D,f)}function U3(u,D,f){rf(f)?D.state=22:u.removeMachine(D)}function Gu(u,D,f){f===46?D.state=23:f===64?D.state=24:rf(f)?D.state=22:u.removeMachine(D)}function V3(u,D,f){f===46||f===64?u.removeMachine(D):rf(f)?D.state=22:u.removeMachine(D)}function W3(u,D,f){Hu(f)?D.state=25:u.removeMachine(D)}function H3(u,D,f){f===46?D.state=27:f===45?D.state=26:tf(f)||Du(u,D)}function q3(u,D,f){f===45||f===46?Du(u,D):tf(f)?D.state=25:Du(u,D)}function Y3(u,D,f){f===46||f===45?Du(u,D):Hu(f)?(D.state=25,D.acceptStateReached=!0):Du(u,D)}function $3(u,D,f){_1(f)?(D.state=29,D.acceptStateReached=!0):u.removeMachine(D)}function K3(u,D,f){_1(f)||Du(u,D)}function J3(u,D,f){y1(f)?(D.state=31,D.acceptStateReached=!0):u.removeMachine(D)}function G3(u,D,f){y1(f)||(Ju(f)?u.removeMachine(D):Du(u,D))}function X3(u,D,f,e){Cu(e)?D.state=38:(u.removeMachine(D),yD(u,f,e))}function Z3(u,D,f,e){Cu(e)?D.state=33:u.removeMachine(D),yD(u,f,e)}function Q3(u,D,f){Cu(f)?D.state=34:u.removeMachine(D)}function ut(u,D,f){Cu(f)?D.state=35:u.removeMachine(D)}function Dt(u,D,f){f===41?D.state=36:u.removeMachine(D)}function ft(u,D,f,e){Cu(e)?D.state=38:v1(e)?D.state=39:u.removeMachine(D)}function et(u,D,f,e){var t=u.charIdx;D.acceptStateReached=!0,sf(e)?D.state=40:e===35?D.state=41:Cu(e)||(e===40?D.state=32:v1(e)?D.state=39:(Du(u,D),iD(e)&&u.addMachine(vD(t,0))))}function tt(u,D,f,e){Cu(e)?D.state=38:e===40?D.state=32:(Du(u,D),yD(u,f,e))}function nt(u,D,f){sf(f)||(f===35?D.state=41:Cu(f)?D.state=38:Du(u,D))}function rt(u,D,f){sf(f)?D.state=40:Cu(f)?u.removeMachine(D):Du(u,D)}function Du(u,D){var f=u.matches,e=u.text,t=u.charIdx,n=u.tagBuilder,r=u.stripPrefix,a=u.stripTrailingSlash,F=u.decodePercentEncoding,o=u.hashtagServiceName,d=u.mentionServiceName;if(u.removeMachine(D),!!D.acceptStateReached){var l=D.startIdx,E=e.slice(D.startIdx,t);switch(E=at(E),D.type){case 0:{var j=e.charCodeAt(D.startIdx-1);if(j===64)return;switch(D.matchType){case 0:{var v=b1.exec(E);if(v&&(l=l+v.index,E=E.slice(v.index)),!We(E))return;break}case 1:{if(!He(E))return;break}case 2:{if(!$e(E))return;break}default:$u(D)}f.push(new Ge({tagBuilder:n,matchedText:E,offset:l,urlMatchType:st(D.matchType),url:E,protocolRelativeMatch:E.slice(0,2)==="//",stripPrefix:r,stripTrailingSlash:a,decodePercentEncoding:F}));break}case 1:{e3(E)&&f.push(new t3({tagBuilder:n,matchedText:E,offset:l,email:E.replace(f3,"")}));break}case 2:{n3(E)&&f.push(new s3({tagBuilder:n,matchedText:E,offset:l,serviceName:o,hashtag:E.slice(1)}));break}case 3:{F3(E,d)&&f.push(new o3({tagBuilder:n,matchedText:E,offset:l,serviceName:d,mention:E.slice(1)}));break}case 4:{if(E=E.replace(/ +$/g,""),E3(E)){var C=E.replace(/[^0-9,;#]/g,"");f.push(new h3({tagBuilder:n,matchedText:E,offset:l,number:C,plusSign:E.charAt(0)==="+"}))}break}default:$u(D)}}}function st(u){switch(u){case 0:return"scheme";case 1:return"tld";case 2:return"ipV4";default:$u(u)}}var w1={")":"(","}":"{","]":"["};function at(u){for(var D={"(":0,"{":0,"[":0},f=0;f<u.length;f++){var e=u.charAt(f),t=u.charCodeAt(f);Ie(t)?D[e]++:h1(t)&&D[w1[e]]--}for(var n=u.length-1;n>=0;){var e=u.charAt(n),t=u.charCodeAt(n);if(h1(t)){var r=w1[e];if(D[r]<0)D[r]++,n--;else break}else if(E1(t))n--;else break}return u.slice(0,n+1)}function vD(u,D){return{type:0,startIdx:u,state:D,acceptStateReached:!1,matchType:0}}function af(u,D){return{type:0,startIdx:u,state:D,acceptStateReached:!1,matchType:1}}function Ft(u,D){return{type:0,startIdx:u,state:D,acceptStateReached:!1,matchType:2,octetsEncountered:1}}function it(u,D){return{type:1,startIdx:u,state:D,acceptStateReached:!1}}function ot(u,D){return{type:2,startIdx:u,state:D,acceptStateReached:!1}}function dt(u,D){return{type:3,startIdx:u,state:D,acceptStateReached:!1}}function Ff(u,D){return{type:4,startIdx:u,state:D,acceptStateReached:!1}}function A1(u){return u.type===0&&u.matchType===0}var Ru=function(){function u(D){D===void 0&&(D={}),this.idx=D.idx!==void 0?D.idx:-1,this.type=D.type||"tag",this.name=D.name||"",this.isOpening=!!D.isOpening,this.isClosing=!!D.isClosing}return u}(),of=new Ru,Ct=function(){function u(D,f){this.charIdx=0,this.state=0,this.currentDataIdx=0,this.currentTag=of,this.html=D,this.callbacks=f}return u}();function ct(u,D){for(var f=new Ct(u,D),e=u.length;f.charIdx<e;){var t=u.charAt(f.charIdx),n=u.charCodeAt(f.charIdx);switch(f.state){case 0:lt(f,t);break;case 1:Et(f,t,n);break;case 2:bt(f,t,n);break;case 3:ht(f,t,n);break;case 4:pt(f,t,n);break;case 5:Bt(f,t,n);break;case 6:gt(f,t,n);break;case 7:mt(f,t,n);break;case 8:_t(f,t);break;case 9:yt(f,t);break;case 10:vt(f,t,n);break;case 11:wt(f,t,n);break;case 12:At(f,t);break;case 13:xt(f);break;case 14:kt(f,t);break;case 15:St(f,t);break;case 16:jt(f,t);break;case 17:Tt(f,t);break;case 18:Nt(f,t);break;case 19:Rt(f,t);break;case 20:Ot(f,t);break;default:$u(f.state)}f.charIdx++}f.currentDataIdx<f.charIdx&&Pt(f)}function lt(u,D){D==="<"&&Ou(u)}function Et(u,D,f){D==="!"?u.state=13:D==="/"?(u.state=2,u.currentTag=new Ru(iu(iu({},u.currentTag),{isClosing:!0}))):D==="<"?Ou(u):DD(f)?(u.state=3,u.currentTag=new Ru(iu(iu({},u.currentTag),{isOpening:!0}))):(u.state=0,u.currentTag=of)}function ht(u,D,f){Ku(f)?(u.currentTag=new Ru(iu(iu({},u.currentTag),{name:df(u)})),u.state=4):D==="<"?Ou(u):D==="/"?(u.currentTag=new Ru(iu(iu({},u.currentTag),{name:df(u)})),u.state=12):D===">"?(u.currentTag=new Ru(iu(iu({},u.currentTag),{name:df(u)})),Pu(u)):!DD(f)&&!Cu(f)&&D!==":"&&Au(u)}function bt(u,D,f){D===">"?Au(u):DD(f)?u.state=3:Au(u)}function pt(u,D,f){Ku(f)||(D==="/"?u.state=12:D===">"?Pu(u):D==="<"?Ou(u):D==="="||ef(f)||Re(f)?Au(u):u.state=5)}function Bt(u,D,f){Ku(f)?u.state=6:D==="/"?u.state=12:D==="="?u.state=7:D===">"?Pu(u):D==="<"?Ou(u):ef(f)&&Au(u)}function gt(u,D,f){Ku(f)||(D==="/"?u.state=12:D==="="?u.state=7:D===">"?Pu(u):D==="<"?Ou(u):ef(f)?Au(u):u.state=5)}function mt(u,D,f){Ku(f)||(D==='"'?u.state=8:D==="'"?u.state=9:/[>=`]/.test(D)?Au(u):D==="<"?Ou(u):u.state=10)}function _t(u,D){D==='"'&&(u.state=11)}function yt(u,D){D==="'"&&(u.state=11)}function vt(u,D,f){Ku(f)?u.state=4:D===">"?Pu(u):D==="<"&&Ou(u)}function wt(u,D,f){Ku(f)?u.state=4:D==="/"?u.state=12:D===">"?Pu(u):D==="<"?Ou(u):(u.state=4,It(u))}function At(u,D){D===">"?(u.currentTag=new Ru(iu(iu({},u.currentTag),{isClosing:!0})),Pu(u)):Au(u)}function xt(u){var D=u.html,f=u.charIdx;D.slice(f,f+2)==="--"?(u.charIdx++,u.currentTag=new Ru(iu(iu({},u.currentTag),{type:"comment"})),u.state=14):D.slice(f,f+7).toUpperCase()==="DOCTYPE"?(u.charIdx+=6,u.currentTag=new Ru(iu(iu({},u.currentTag),{type:"doctype"})),u.state=20):Au(u)}function kt(u,D){D==="-"?u.state=15:D===">"?Au(u):u.state=16}function St(u,D){D==="-"?u.state=18:D===">"?Au(u):u.state=16}function jt(u,D){D==="-"&&(u.state=17)}function Tt(u,D){D==="-"?u.state=18:u.state=16}function Nt(u,D){D===">"?Pu(u):D==="!"?u.state=19:D==="-"||(u.state=16)}function Rt(u,D){D==="-"?u.state=17:D===">"?Pu(u):u.state=16}function Ot(u,D){D===">"?Pu(u):D==="<"&&Ou(u)}function Au(u){u.state=0,u.currentTag=of}function Ou(u){u.state=1,u.currentTag=new Ru({idx:u.charIdx})}function Pu(u){var D=u.html.slice(u.currentDataIdx,u.currentTag.idx);D&&u.callbacks.onText(D,u.currentDataIdx);var f=u.currentTag;f.type==="comment"?u.callbacks.onComment(f.idx):f.type==="doctype"?u.callbacks.onDoctype(f.idx):(f.isOpening&&u.callbacks.onOpenTag(f.name,f.idx),f.isClosing&&u.callbacks.onCloseTag(f.name,f.idx)),Au(u),u.currentDataIdx=u.charIdx+1}function Pt(u){var D=u.html.slice(u.currentDataIdx,u.charIdx);u.callbacks.onText(D,u.currentDataIdx),u.currentDataIdx=u.charIdx+1}function df(u){var D=u.currentTag.idx+(u.currentTag.isClosing?2:1);return u.html.slice(D,u.charIdx).toLowerCase()}function It(u){u.charIdx--}var Lt=function(){function u(D){D===void 0&&(D={}),this.version=u.version,this.urls={},this.email=!0,this.phone=!0,this.hashtag=!1,this.mention=!1,this.newWindow=!0,this.stripPrefix={scheme:!0,www:!0},this.stripTrailingSlash=!0,this.decodePercentEncoding=!0,this.truncate={length:0,location:"end"},this.className="",this.replaceFn=null,this.context=void 0,this.sanitizeHtml=!1,this.tagBuilder=null,this.urls=Mt(D.urls),this.email=wu(D.email)?D.email:this.email,this.phone=wu(D.phone)?D.phone:this.phone,this.hashtag=D.hashtag||this.hashtag,this.mention=D.mention||this.mention,this.newWindow=wu(D.newWindow)?D.newWindow:this.newWindow,this.stripPrefix=zt(D.stripPrefix),this.stripTrailingSlash=wu(D.stripTrailingSlash)?D.stripTrailingSlash:this.stripTrailingSlash,this.decodePercentEncoding=wu(D.decodePercentEncoding)?D.decodePercentEncoding:this.decodePercentEncoding,this.sanitizeHtml=D.sanitizeHtml||!1;var f=this.mention;if(f!==!1&&i3.indexOf(f)===-1)throw new Error("invalid `mention` cfg '".concat(f,"' - see docs"));var e=this.hashtag;if(e!==!1&&r3.indexOf(e)===-1)throw new Error("invalid `hashtag` cfg '".concat(e,"' - see docs"));this.truncate=Ut(D.truncate),this.className=D.className||this.className,this.replaceFn=D.replaceFn||this.replaceFn,this.context=D.context||this}return u.link=function(D,f){var e=new u(f);return e.link(D)},u.parse=function(D,f){var e=new u(f);return e.parse(D)},u.prototype.parse=function(D){var f=this,e=["a","style","script"],t=0,n=[];return ct(D,{onOpenTag:function(r){e.indexOf(r)>=0&&t++},onText:function(r,a){if(t===0){var F=/( | |<|<|>|>|"|"|')/gi,o=r.split(F),d=a;o.forEach(function(l,E){if(E%2===0){var j=f.parseText(l,d);n.push.apply(n,ve([],ye(j),!1))}d+=l.length})}},onCloseTag:function(r){e.indexOf(r)>=0&&(t=Math.max(t-1,0))},onComment:function(){},onDoctype:function(){}}),n=this.compactMatches(n),n=this.removeUnwantedMatches(n),n},u.prototype.compactMatches=function(D){D.sort(Vt);for(var f=0;f<D.length-1;){var e=D[f],t=e.getOffset(),n=e.getMatchedText().length;if(f+1<D.length&&D[f+1].getOffset()===t){var r=D[f+1].getMatchedText().length>n?f:f+1;D.splice(r,1);continue}f++}return D},u.prototype.removeUnwantedMatches=function(D){return this.hashtag||Yu(D,function(f){return f.getType()==="hashtag"}),this.email||Yu(D,function(f){return f.getType()==="email"}),this.phone||Yu(D,function(f){return f.getType()==="phone"}),this.mention||Yu(D,function(f){return f.getType()==="mention"}),this.urls.schemeMatches||Yu(D,function(f){return f.getType()==="url"&&f.getUrlMatchType()==="scheme"}),this.urls.tldMatches||Yu(D,function(f){return f.getType()==="url"&&f.getUrlMatchType()==="tld"}),this.urls.ipV4Matches||Yu(D,function(f){return f.getType()==="url"&&f.getUrlMatchType()==="ipV4"}),D},u.prototype.parseText=function(D,f){f=f||0;for(var e=p3(D,{tagBuilder:this.getTagBuilder(),stripPrefix:this.stripPrefix,stripTrailingSlash:this.stripTrailingSlash,decodePercentEncoding:this.decodePercentEncoding,hashtagServiceName:this.hashtag,mentionServiceName:this.mention||"twitter"}),t=0,n=e.length;t<n;t++)e[t].setOffset(f+e[t].getOffset());return e},u.prototype.link=function(D){if(!D)return"";this.sanitizeHtml&&(D=D.replace(/</g,"<").replace(/>/g,">"));for(var f=this.parse(D),e=new Array(f.length*2+1),t=0,n=0,r=f.length;n<r;n++){var a=f[n];e.push(D.substring(t,a.getOffset())),e.push(this.createMatchReturnVal(a)),t=a.getOffset()+a.getMatchedText().length}return e.push(D.substring(t)),e.join("")},u.prototype.createMatchReturnVal=function(D){var f;if(this.replaceFn&&(f=this.replaceFn.call(this.context,D)),typeof f=="string")return f;if(f===!1)return D.getMatchedText();if(f instanceof c1)return f.toAnchorString();var e=D.buildTag();return e.toAnchorString()},u.prototype.getTagBuilder=function(){var D=this.tagBuilder;return D||(D=this.tagBuilder=new Ne({newWindow:this.newWindow,truncate:this.truncate,className:this.className})),D},u.version=we,u}();function Mt(u){return u==null&&(u=!0),wu(u)?{schemeMatches:u,tldMatches:u,ipV4Matches:u}:{schemeMatches:wu(u.schemeMatches)?u.schemeMatches:!0,tldMatches:wu(u.tldMatches)?u.tldMatches:!0,ipV4Matches:wu(u.ipV4Matches)?u.ipV4Matches:!0}}function zt(u){return u==null&&(u=!0),wu(u)?{scheme:u,www:u}:{scheme:wu(u.scheme)?u.scheme:!0,www:wu(u.www)?u.www:!0}}function Ut(u){return typeof u=="number"?{length:u,location:"end"}:iu({length:Number.POSITIVE_INFINITY,location:"end"},u)}function Vt(u,D){return u.getOffset()-D.getOffset()}const Xu=[{name:"Australia",countryCode:"+61",code:"AU",flag:"🇦🇺"},{name:"United States",countryCode:"+1",code:"US",flag:"🇺🇸"},{name:"New Zealand",countryCode:"+64",code:"NZ",flag:"🇳🇿"},{name:"United Kingdom",countryCode:"+44",code:"UK",flag:"🇬🇧"},{name:"Indonesia",countryCode:"+62",code:"ID",flag:"🇮🇩"}],Wt={AU:/^(?:\+?(61))? ?(?:\((?=.*\))\))?(0?[4])\)? ?(\d\d(?:[- ](?=\d{3})|(?!\d\d[- ]?\d[- ]))\d\d[- ]?\d[- ]?\d{3})$/gm,US:/^(\+?1\s?)?\(?([0-9]{3})\)?[-. ]?([0-9]{3})[-. ]?([0-9]{4})$/gm,UK:/^(\+?44\s?)?\(?([0-9]{3})\)?[-. ]?([0-9]{3})[-. ]?([0-9]{4})$/gm,NZ:/^(\+?64\s?)?\(?([0-9]{3})\)?[-. ]?([0-9]{3})[-. ]?([0-9]{4})$/gm,ID:/^(\+?62\s?)?\(?([0-9]{3})\)?[-. ]?([0-9]{3})[-. ]?([0-9]{4})$/gm},Ht={AU:"+61",US:"+1",NZ:"+64",UK:"+44",ID:"+62"},qt=u=>u.toUpperCase(),Yt=u=>u.replace(/\s+/g,"").replace(/[^0-9+]/g,"");function $t(u,D){const f=Ht[u];return D.startsWith(f)?{cleanNumber:D.slice(f.length),countryCode:f}:{cleanNumber:D,countryCode:f}}function Kt(u,D){const f=Wt[u];return new RegExp(f.source,"mi").test(D)}function Jt({number:u,region:D,validateDuplicate:f,contacts:e}){const t={originalNumber:u,fullNumber:"",cleanNumber:"",errorMessage:"",isValid:!1},n=qt(D);if(!u)return t.errorMessage="Number is empty",t;const r=u.trim();let a=Yt(u);a=a.startsWith("0")?a.slice(1):a;const{cleanNumber:F,countryCode:o}=$t(n,a);a=F,t.fullNumber=`${o}${a}`,t.cleanNumber=a;try{if(!Kt(n,r))throw new Error("Please enter a valid phone number");t.isValid=!0}catch(d){t.errorMessage=d.message,t.isValid=!1}return t}const x1=({initialData:u,loadFromDataUserSubs:D=!1}={})=>{const[f,e]=c.useState(u||{}),[t,n]=c.useState({}),[r,a]=c.useState({}),F=(C,N)=>{let R="";if(C.isRequired)if(typeof N=="string"){const g=N.trim();if(!g)return`${C.label} is required`;if(C.key.toLowerCase().includes("phone")||C.label.toLowerCase().includes("phone")){const z=g.replace(/\s+/g,""),y=Xu.find(P=>z.startsWith(P.countryCode)),B=z.replace(/^\+?\d+/,"");if(y&&B.length===0)return""}}else typeof N=="boolean"?N!==!0&&(R=`${C.label} is required`):N||(R=`${C.label} is required`);if(R&&t[C.key])return console.log(`[VALIDATE] ${C.key}=${N}, ERROR=${R}`),R;if(C.key.toLowerCase().includes("email")||C.label.toLowerCase().includes("email")){const g=String(N||"").trim();g&&(/^[^\s@]+@[^\s@]+\.[^\s@]{2,}$/.test(g)||(R="Please enter a valid email address"))}if(C.key.toLowerCase().includes("phone")||C.label.toLowerCase().includes("phone")){const g=String(N||""),z=g.replace(/[^0-9+]/g,""),y=Xu.find(k=>z.startsWith(k.countryCode)),B=(y==null?void 0:y.code)||"AU",P=y?z.substring(y.countryCode.length):z;if(!C.isRequired&&y&&P==="")return"";if(g){const k=Jt({number:g,region:B,validateDuplicate:!1,contacts:new Map});k.isValid||(R=k.errorMessage||"Please enter a valid phone number")}}return R};c.useEffect(()=>{if(D)try{const C=J.getItem("dataUserSubs");C&&e(C)}catch(C){console.error("Error loading dataUserSubs from localStorage:",C)}},[D]);const o=c.useCallback((C,N)=>{e(R=>({...R,[C]:N})),a(R=>({...R,[C]:""}))},[]),d=c.useCallback(C=>{n(g=>({...g,[C.key]:!0}));const N=f[C.key],R=F(C,N);a(g=>({...g,[C.key]:R}))},[f]),l=C=>{const N={email:"email",phone:"tel",date:"date",password:"password"},R=Object.keys(N).find(g=>C.toLowerCase().includes(g));return R?N[R]:"text"},E=c.useCallback(C=>{var z;if(!C.isDisplay)return null;const N=f[C.key],R=l(C.key),g=!!r[C.key]&&t[C.key];if(C.key.includes("language")||C.key.includes("country"))return s.jsx("select",{className:`user-subscription-form-input${g?" error":""}`,value:N||"",onChange:y=>o(C.key,y.target.value),onBlur:()=>d(C),"aria-invalid":g,style:C.color?{borderColor:C.color}:void 0,children:s.jsxs("option",{value:"",children:["Select ",C.label]})},C.key);if(C.key.includes("newsletter")||C.key.includes("subscribe"))return s.jsxs("div",{className:"user-subscription-checkbox",children:[s.jsx("input",{type:"checkbox",id:C.key,checked:N||!1,onChange:y=>o(C.key,y.target.checked),"aria-invalid":g}),s.jsx("label",{htmlFor:C.key,children:C.label})]},C.key);if(C.key.toLowerCase().includes("phone")){const y=N||"",B=((z=Xu.find(_=>y.startsWith(_.countryCode)))==null?void 0:z.countryCode)||"+61",P=y.replace(/^\+?\d+\s?/,"").trim(),k=_=>{const x=_.replace(/[^0-9\s]/g,"").trim();o(C.key,x?`${B} ${x}`:`${B} `)},q=_=>{o(C.key,P?`${_} ${P}`:`${_} `)};return s.jsxs("div",{className:"user-subscription-form-field",children:[s.jsxs("div",{style:{display:"flex",flexDirection:"row",gap:"0.25rem",alignItems:"center"},children:[s.jsxs("select",{className:`user-subscription-form-input${g?" error":""}`,style:{maxWidth:"100px"},value:B,onChange:_=>q(_.target.value),onBlur:()=>d(C),"aria-invalid":!!g,children:[s.jsx("option",{value:"",children:"+Code"}),Xu.map(_=>s.jsx("option",{value:_.countryCode,children:`${_.flag} ${_.countryCode}`},_.code))]}),s.jsx("input",{className:`user-subscription-form-input${g?" error":""}`,type:"tel",value:P,onChange:_=>k(_.target.value),onBlur:()=>d(C),placeholder:C.label,"aria-invalid":!!g,style:{...C.color?{borderColor:C.color}:{},flex:1}})]}),g&&s.jsx("div",{className:"user-subscription-error",children:r[C.key]})]},C.key)}return s.jsxs("div",{className:"user-subscription-form-field",children:[s.jsx("input",{className:`user-subscription-form-input${g?" error":""}`,type:R,value:N||"",onChange:y=>o(C.key,y.target.value),onBlur:()=>d(C),placeholder:C.label,"aria-invalid":g,style:C.color?{borderColor:C.color}:void 0}),g&&s.jsx("div",{className:"user-subscription-error",children:r[C.key]})]},C.key)},[r,t,f,o,d]),j=c.useCallback(C=>{var z;if(!C.isDisplay)return null;const N=f[C.key],R=l(C.key),g=!!r[C.key]&&t[C.key];if(C.key.toLowerCase().includes("phone")){const y=N||"",B=((z=Xu.find(_=>y.startsWith(_.countryCode)))==null?void 0:z.countryCode)||"+61",P=y.replace(/^\+?\d+\s?/,"").trim(),k=_=>{const x=_.replace(/[^0-9\s]/g,"").trim();o(C.key,x?`${B} ${x}`:`${B} `)},q=_=>{o(C.key,P?`${_} ${P}`:`${_} `)};return s.jsxs("div",{className:"sc-message--contact-form-field",children:[s.jsx("label",{htmlFor:`contact-${C.key}`,className:"sc-message--contact-form-label",children:C.label}),s.jsxs("div",{style:{display:"flex",gap:"0.25rem",alignItems:"center"},children:[s.jsxs("select",{className:"sc-message--contact-form-input",style:{maxWidth:"100px"},value:B,onChange:_=>q(_.target.value),onBlur:()=>d(C),"aria-invalid":g,children:[s.jsx("option",{value:"",children:"+Code"}),Xu.map(_=>s.jsx("option",{value:_.countryCode,children:`${_.flag} ${_.countryCode}`},_.code))]}),s.jsx("input",{id:`contact-${C.key}`,type:"tel",value:P,onChange:_=>k(_.target.value),onBlur:()=>d(C),placeholder:"",className:`sc-message--contact-form-input ${g?"error":""}`,"aria-invalid":g,style:{...C.color?{borderColor:C.color}:{},flex:1,...g?{borderColor:"#ff4444"}:{}}})]}),g&&s.jsx("div",{style:{color:"#ff4444",fontSize:"0.75rem",marginTop:"0.25rem"},children:r[C.key]})]},C.key)}return s.jsxs("div",{className:"sc-message--contact-form-field",children:[s.jsx("label",{htmlFor:`contact-${C.key}`,className:"sc-message--contact-form-label",children:C.label}),s.jsx("input",{id:`contact-${C.key}`,type:R,value:N||"",onChange:y=>o(C.key,y.target.value),onBlur:()=>d(C),placeholder:"",className:`sc-message--contact-form-input ${g?"error":""}`,"aria-invalid":g,style:{...C.color?{borderColor:C.color}:{},...g?{borderColor:"#ff4444"}:{}}}),g&&s.jsx("div",{style:{color:"#ff4444",fontSize:"0.75rem",marginTop:"0.25rem"},children:r[C.key]})]},C.key)},[f,l,t,r,o,d]),v=c.useCallback(C=>{const N={};return C.filter(R=>R.isDisplay).forEach(R=>{const g=f[R.key];N[R.key]=F(R,g)}),a(R=>({...R,...N})),C.filter(R=>R.isDisplay&&R.isRequired).every(R=>N[R.key]==="")},[f,F]);return{formData:f,setFormData:e,touched:t,setTouched:n,handleFieldChange:o,handleFieldBlur:d,renderFormField:E,renderContactFormField:j,getInputType:l,errors:r,validateAll:v}};function Gt(u){const D={};return Object.entries(u).forEach(([f,e])=>{if(e){if(f.toLowerCase().includes("phone")){const t=e.replace(/\s+/g,""),n=Xu.find(r=>t.startsWith(r.countryCode));if(n&&t.slice(n.countryCode.length)==="")return}D[f]=e}}),D}const Xt=({onSubmit:u,onFormStateChange:D})=>{const{colors:f}=Fu(),e=Iu(),t=hu(),{socket:n}=Wu(),{setScreen:r}=Nu();Su();const{setIsOfflineMode:a,send:F,participants:o,setMessages:d,setParticipants:l,setConnectionState:E}=ou(),{formData:j,renderContactFormField:v,errors:C,validateAll:N}=x1({initialData:{},loadFromDataUserSubs:!0}),[R,g]=c.useState(!1),[z,y]=c.useState(!1);c.useEffect(()=>{D&&!z&&D(!0),D&&z&&D(!1)},[z]);const B=async k=>{var _;if(k.preventDefault(),!!N(t.formSettings)){g(!0);try{const x={};t.formSettings.forEach(h=>{var b;h.isDisplay&&j[h.key]!==void 0&&(x[h.key]=((b=j[h.key])==null?void 0:b.toString().trim())||"")});const w=Gt(x);if(!J.getItem("profileLiveChat"))try{const h=new URLSearchParams;Object.entries(w).forEach(([U,W])=>{typeof W=="string"&&W&&h.append(U,W)}),h.append("owner_id",e.ownerId),h.append("contactLateTime",new Date().toISOString());const{body:b}=await n.get(`/webhook/${e.channel}/?${h.toString()}`),{messages:S,profile:m}=b;J.setItem("profileLiveChat",m),J.setItem("isOffline",!1),J.setItem("submitedFormLateTime",(m==null?void 0:m.submitedFormLateTime)||null),S.forEach(U=>{const W=U.author===m.foreignId||U.author===m.id?Z.sent:Z.received;U.direction=W,U.direction===Z.sent&&(U.read=!0,U.delivery=!1)}),d(S),l([o[0],{id:m.foreignId,foreign_id:m.foreignId,name:`${m.firstName} ${m.lastName}`}]),E(3),r("chat"),y(!0);const I={text:Object.entries(w).map(([U,W])=>`${U.charAt(0).toUpperCase()+U.slice(1)}: ${W}`).join(`
|
|
28
28
|
`),contactInfo:{...w,owner_id:e.ownerId},contactLateTime:new Date};F({event:k,source:"contact-form",data:{type:yu.text,data:I,author:m.foreignId}}),a(!0),u&&u(x.name,x.phone);return}catch(h){console.error("Error in subscription flow:",h)}const T={text:Object.entries(w).map(([h,b])=>`${h.charAt(0).toUpperCase()+h.slice(1)}: ${b}`).join(`
|
|
29
29
|
`),contactInfo:{...w,owner_id:e.ownerId},contactLateTime:new Date};F({event:k,source:"contact-form",data:{type:yu.text,data:T,author:(_=o[1])==null?void 0:_.id}}),y(!0),a(!0),u&&u(x.name,x.phone)}catch(x){console.error("Error sending contact form to webhook:",x)}finally{g(!1)}}},P=f[Z.received];return z?null:s.jsx("div",{className:"sc-message--contact-form",style:{color:P.text,backgroundColor:P.bg},children:s.jsx("div",{className:"sc-message--contact-form-content",children:s.jsxs("form",{onSubmit:B,className:"sc-message--contact-form-form",noValidate:!0,children:[t.formSettings.sort((k,q)=>k.order-q.order).map(v),s.jsx("div",{className:"sc-message--contact-form-authorization",children:s.jsx("a",{href:t.termsAndConditions.url,target:"_blank",rel:"noopener noreferrer",className:"sc-message--contact-form-link",children:t.termsAndConditions.text})}),s.jsx("button",{type:"submit",className:"sc-message--contact-form-submit",style:{background:f.header.bg,color:f.header.text,width:"40%"},disabled:R||Object.values(C).some(k=>k!==""),children:"Send"})]})})})},Zt=({message:u,onFormSubmitted:D})=>{const{colors:f}=Fu(),{setIsContactFormActive:e}=ou(),t=c.useRef(null);c.useEffect(()=>{n()},[u]);const n=()=>{if(u.direction===Z.received&&t.current){const F=t.current.innerText;let o=Lt.link(F,{className:"chatLink",truncate:{length:50,location:"smart"}});o=o.replace(/\n/g,"<br>"),t.current.innerHTML=o}};if(!("text"in u.data))throw new Error("Unable to find text.");const r=f[u.direction||Z.received];return"isShowForm"in u.data&&u.data.isShowForm?s.jsx(Xt,{onFormStateChange:F=>{e(F),!F&&D&&D(!0)}}):s.jsx(s.Fragment,{children:s.jsx("div",{className:"sc-message--text",style:{color:r.text,backgroundColor:r.bg},children:s.jsx("p",{className:"sc-message--text-content",ref:t,children:u.data.text})})})},k1=({viewBox:u="0 0 24 24",fill:D="none",stroke:f="",strokeWidth:e="2",strokeLinecap:t="round",strokeLinejoin:n="round",...r})=>s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:u,fill:D,stroke:f,strokeWidth:e,strokeLinecap:t,strokeLinejoin:n,...r,children:s.jsx("path",{d:"M20 6L9 17l-5-5"})}),Qt=({message:u})=>{const{colors:D}=Fu();if(!("delivery"in u&&"read"in u))throw new Error("Unable to find delivery/read attributes");return s.jsxs("div",{className:"sc--status",style:{color:D.messageStatus.bg},children:[u.read&&s.jsx("div",{className:"sc--status-wrapper sc--status-read",title:"Read",children:s.jsx(k1,{width:"16px",height:"16px",className:"read check",style:{stroke:D.messageStatus.bg}})}),u.delivery&&s.jsx("div",{className:"sc--status-wrapper sc--status-delivery",title:"Delivered",children:s.jsx(k1,{width:"16px",height:"16px",className:"delivery check",style:{stroke:D.messageStatus.bg}})})]})};o1.extend(ce);const u2=({message:u,Avatar:D})=>{const{participants:f}=ou(),{colors:e}=Fu(),[t,n]=c.useState(!1),[r,a]=c.useState(!1),F=hu(),o=u.data&&"text"in u.data&&"isShowForm"in u.data&&u.data.isShowForm,d=f.find(j=>j.id===u.author)||{name:"Anon"},l=()=>{n(!t)},E=j=>o1(j).fromNow();return s.jsx("div",{className:`sc-message ${u.direction}`,children:s.jsxs("div",{className:`sc-message--content ${u.direction}`,children:[(!r||!o)&&s.jsx("div",{title:d.name,className:"sc-message--avatar",style:d.imageUrl?{backgroundImage:`url(${d.imageUrl}?color=${encodeURIComponent(e.header.bg)})`}:void 0,children:F.avatarUrl?s.jsx("img",{src:F.avatarUrl,width:32,height:32,style:{borderRadius:"50%"}}):D?s.jsx(D,{}):d.imageUrl?null:s.jsx(C1,{width:"32px",height:"32px"})}),s.jsxs("div",{className:"sc-message--wrapper",onClick:l,children:[u.data&&"text"in u.data&&s.jsx(s.Fragment,{children:s.jsx(Zt,{message:u,onFormSubmitted:a})}),u.type==="file"&&s.jsx(ge,{message:u}),u.type==="location"&&s.jsx(me,{message:u}),u.type==="list"&&s.jsx(_e,{messageList:u}),u.type==="carousel"&&s.jsx(pe,{messageCarousel:u}),u.type==="buttons"&&s.jsx(mD,{message:u}),s.jsxs("div",{className:"sc-message--meta",children:[u.direction==="sent"&&s.jsx(Qt,{message:u}),s.jsx("div",{style:{color:e.messageTime.text},className:"sc-message--time",children:t&&(!r||!o)&&E(u.createdAt)})]})]})]})})},D2=()=>{const{colors:u}=Fu();return s.jsxs("div",{className:"sc-typing-indicator",style:{color:u.received.text,backgroundColor:u.received.bg},children:[s.jsx("span",{}),s.jsx("span",{}),s.jsx("span",{})]})},f2=({Avatar:u,phone:D})=>{const{colors:f}=Fu(),e=f[Z.received];hu();const{participants:t}=ou(),n=t.find(r=>r.id==="chatbot")||{name:"Bot"};return s.jsx("div",{className:`sc-message ${Z.received}`,children:s.jsxs("div",{className:`sc-message--content ${Z.received}`,children:[s.jsx("div",{title:n.name,className:"sc-message--avatar",style:n.imageUrl?{backgroundImage:`url(${n.imageUrl}?color=${encodeURIComponent(f.header.bg)})`}:void 0,children:u?s.jsx(u,{}):n.imageUrl?null:s.jsx(C1,{width:"32px",height:"32px"})}),s.jsx("div",{className:"sc-message--wrapper",children:s.jsxs("div",{className:"sc-message--text chatLink sc-message--contact-form-confirmation",style:{color:e.text,backgroundColor:e.bg},children:[s.jsx("div",{className:"sc-message--contact-form-phone-display",children:s.jsx("a",{href:"tel:+61481075986",className:"sc-message--contact-form-phone-link",children:"+61 481075986"})}),s.jsxs("div",{className:"sc-message--contact-form-response-text",children:[s.jsx("h4",{className:"sc-message--contact-form-response-text-title",children:"we received your message."}),s.jsx("p",{children:"Our team will be texting you from the number above."})]})]})})]})})},e2=({Avatar:u})=>{const{scroll:D,setScroll:f,isOpen:e}=Nu(),{messages:t,showTypingIndicator:n,setNewIOMessage:r,setMessages:a}=ou(),F=hu(),{colors:o}=Fu(),{formSettings:d}=hu(),[l,E]=c.useState(""),j=c.useRef(""),v=F.offline_mode,C=BD(v),N=B=>{if(!("text"in B.data))return null;const P=B.data.text||"",k=w=>w.toLowerCase().replace(/\s+/g,"").replace(/[^a-z0-9_]/g,""),_=P.split(`
|
|
30
30
|
`).map(w=>w.trim()).find(w=>k(w.split(":")[0])==="phone");if(!_)return null;const[,x=""]=_.split(":");return x.trim()},R=B=>{if(!("text"in B.data))return!1;const P=B.data.text||"",k=w=>w.toLowerCase().replace(/\s+/g,"").replace(/[^a-z0-9_]/g,""),q=P.split(`
|
package/dist/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
@charset "UTF-8";/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */html{line-height:1.15;-webkit-text-size-adjust:100%}body{margin:0}main{display:block}h1{font-size:2em;margin:.67em 0}hr{box-sizing:content-box;height:0;overflow:visible}pre{font-family:monospace,monospace;font-size:1em}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;text-decoration:underline dotted}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0}button,input{overflow:visible}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button}button::-moz-focus-inner,[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner{border-style:none;padding:0}button:-moz-focusring,[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:.35em .75em .625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress{vertical-align:baseline}textarea{overflow:auto}[type=checkbox],[type=radio]{box-sizing:border-box;padding:0}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}details{display:block}summary{display:list-item}template{display:none}[hidden]{display:none}.sc-header{min-height:64px;border-top-left-radius:.5rem;border-top-right-radius:.5rem;padding:10px;box-shadow:0 1px 4px #0003;position:relative;box-sizing:border-box;display:flex}.sc-header--img{border-radius:50%;align-self:center;padding:10px;max-width:32px;max-height:32px;box-sizing:content-box}.sc-header--title{align-self:center;flex:1;-webkit-user-select:none;user-select:none;font-size:1.25rem}.sc-header--title.enabled{cursor:pointer;border-radius:5px}.sc-header--title.enabled:hover{box-shadow:0 2px 5px #0000011a}.sc-header--actions{display:flex;align-items:center;gap:8px;margin-left:auto}.sc-header--close-button{width:36px;height:36px;align-self:center;margin-right:10px;box-sizing:border-box;cursor:pointer;border-radius:100%}.sc-header--close-button:hover{box-shadow:0 2px 5px #0000011a}.sc-header--close-button svg{width:100%;height:100%;padding:5px;box-sizing:border-box;fill:#fff}@media (max-width: 450px){.sc-header{border-radius:0}}.staff-menu{position:relative;display:inline-block}.staff-menu-toggle{background:none;border:none;cursor:pointer;padding:8px;border-radius:4px;color:inherit;transition:background-color .2s ease;display:flex;align-items:center;justify-content:center}.staff-menu-toggle:hover{background-color:#ffffff1a}.staff-menu-toggle:focus{outline:none;background-color:#ffffff1a}.staff-menu-dropdown{position:absolute;top:100%;right:0;background:#fff;border:1px solid #e0e0e0;border-radius:8px;box-shadow:0 4px 12px #00000026;z-index:1000;min-width:180px;overflow:hidden;animation:dropdownFadeIn .2s ease-out}@keyframes dropdownFadeIn{0%{opacity:0;transform:translateY(-8px)}to{opacity:1;transform:translateY(0)}}.staff-menu-item{width:100%;padding:12px 16px;border:none;background:none;cursor:pointer;display:flex;align-items:center;gap:8px;color:#333;font-size:14px;transition:background-color .2s ease;text-align:left}.staff-menu-item:hover{background-color:#f5f5f5}.staff-menu-item:focus{outline:none;background-color:#f5f5f5}.staff-menu-item:first-child{border-top-left-radius:8px;border-top-right-radius:8px}.staff-menu-item:last-child{border-bottom-left-radius:8px;border-bottom-right-radius:8px}.staff-menu-item svg{flex-shrink:0}.sc-header[style*="background: rgb(51, 51, 51)"] .staff-menu-dropdown,.sc-header[style*="background: #333"] .staff-menu-dropdown{background:#2a2a2a;border-color:#444}.sc-header[style*="background: rgb(51, 51, 51)"] .staff-menu-dropdown .staff-menu-item,.sc-header[style*="background: #333"] .staff-menu-dropdown .staff-menu-item{color:#fff}.sc-header[style*="background: rgb(51, 51, 51)"] .staff-menu-dropdown .staff-menu-item:hover,.sc-header[style*="background: #333"] .staff-menu-dropdown .staff-menu-item:hover{background-color:#3a3a3a}.sc-header[style*="background: rgb(51, 51, 51)"] .staff-menu-dropdown .staff-menu-item:focus,.sc-header[style*="background: #333"] .staff-menu-dropdown .staff-menu-item:focus{background-color:#3a3a3a}.sc-chat--disconnected-icon-wrapper{position:relative;height:100%;width:100%}.sc-chat--disconnected-icon{position:absolute;top:50%;left:50%;transform:translateY(-50%) translate(-50%);text-align:center}.sc-chat--disconnected-text{width:100%}.sc-chat--disconnected-button{border:1px solid;border-radius:2rem;padding:5px 10px;width:80%;margin:2px;cursor:pointer;outline:0}.sc-chat--disconnected-button:active{content:"";opacity:0;transition:all .5s}.sc-chat--disconnected-button:active:after{opacity:1;transition:0s}.sc-message{margin:auto;padding:0 .5rem 0 0;display:flex;margin-bottom:.25rem}.sc-message:first-child{margin-top:50%}.sc-message.sent{flex-direction:row-reverse}.sc-message.sent .sc-message--content{justify-content:flex-end}.sc-message.sent .sc-message--content .sc-message--avatar{display:none}.sc-message.sent .sc-message--content .sc-message--wrapper{align-items:flex-end}.sc-message.sent .sc-message--content .sc-message--wrapper .sc-message--text{color:#fff;background-color:#4e8cff;word-wrap:break-word}.sc-message.sent .sc-message--content .sc-message--wrapper .sc-message--meta{flex-direction:row-reverse}.sc-message .sc-message--content{display:flex;flex-direction:row;position:relative;max-width:calc(100% - 40px);width:auto}.sc-message .sc-message--content .sc-message--avatar{width:32px;height:32px;margin:2px 4px;background-position:0 0;flex-shrink:0;background-size:cover;border-radius:100%}.sc-message .sc-message--content .sc-message--wrapper{display:flex;flex-direction:column}.sc-message .sc-message--content .sc-message--wrapper .sc-message--text{padding:10px 20px;border-radius:.5rem;font-weight:400;font-size:.9rem;line-height:1.5;position:relative;-webkit-font-smoothing:subpixel-antialiased;color:#263238;background-color:#f4f7f9}.sc-message .sc-message--content .sc-message--wrapper .sc-message--text .sc-message--text-body .sc-message--text-content{white-space:pre-wrap}.sc-message .sc-message--content .sc-message--wrapper .sc-message--meta{display:flex;justify-content:space-between;align-items:flex-start;font-size:.65rem;margin-top:4px;padding:0 4px;width:100%;height:18px;box-sizing:border-box}@media (max-width: 450px){.sc-message{width:80%}}.sc-message--buttons{color:#222;max-width:-webkit-fill-available;padding:.25rem .5rem;border-radius:.5rem;font-weight:300;font-size:1.25rem;line-height:1.4;position:relative;-webkit-font-smoothing:subpixel-antialiased;text-align:center}.sc-message--buttons .sc-message--buttons-content{border:1px solid;border-radius:2rem;padding:.25rem;width:80%;margin:2px;cursor:pointer;outline:0;font-size:.75rem}.sc-message--list-element-bottom .sc-message--buttons-content{width:100%;font-weight:600;border-radius:0 0 6px 6px;padding:.5rem;margin:0}.sc-message--list-element-bottom .sc-message--buttons{padding:0}.sc-message--list-element .sc-message--buttons-content{padding:.5rem;margin:0}.sc-message--list-element .sc-message--buttons{padding:0;margin:1rem;text-align:center}.sc-message--carousel-element .sc-message--buttons-content{padding:.5rem;margin-bottom:16px}.sc-message--carousel-element .sc-message--buttons{margin:0;text-align:center}.sc-message--carousel{border-radius:.5rem;position:relative;width:275px;overflow:hidden}.sc-message--carousel .sc-message--carousel-inner{display:flex;transition:transform .5s ease;width:100%}.sc-message--carousel .sc-message--carousel-inner .sc-message--carousel-element-wrapper{min-width:100%;height:100%;display:flex;align-items:flex-end;justify-content:center}.sc-message--carousel .sc-message--carousel-inner .sc-message--carousel-element-wrapper .sc-message--carousel-element{width:100%}.sc-message--carousel .sc-message--carousel-inner .sc-message--carousel-element-wrapper .sc-message--carousel-element .sc-message--carousel-element-image{background-repeat:no-repeat;background-size:cover;position:relative;width:100%;height:150px}.sc-message--carousel .sc-message--carousel-inner .sc-message--carousel-element-wrapper .sc-message--carousel-element .sc-message--carousel-title{font-size:1rem;font-weight:600;padding:.5rem 0;margin-top:8px}.sc-message--carousel .sc-message--carousel-inner .sc-message--carousel-element-wrapper .sc-message--carousel-element .sc-message--carousel-element-description{width:100%;padding:0 2rem;box-sizing:border-box}.sc-message--carousel .sc-message--carousel-control{position:absolute;top:50%;transform:translateY(-50%);background-color:#00000080;color:#fff;border:none;cursor:pointer;z-index:2;font-size:.75rem}.sc-message--carousel .sc-message--carousel-control.prev{left:0;top:calc(50% - 14px);width:1.5rem;height:2rem}.sc-message--carousel .sc-message--carousel-control.next{top:calc(50% - 14px);right:0;width:1.5rem;height:2rem}.sc-message--file{background-color:transparent!important;border-radius:.5rem;font-weight:300;font-size:14px;line-height:1.4;-webkit-font-smoothing:subpixel-antialiased}.sc-message--file audio,.sc-message--file video{max-width:100%}.sc-message--content.sent .sc-message--file{word-wrap:break-word}.sc-message--file-icon{text-align:center;margin-left:auto;margin-right:auto;margin-bottom:0}.sc-image{max-width:100%;height:auto}.sc-message--file-download{padding:10px 20px;border-radius:.5rem;color:#fff;text-align:center}.sc-message--file-download a{text-decoration:none;color:#ece7e7}.sc-message--file-download a img{vertical-align:middle;width:24px;height:auto}.sc-message--content.received .sc-message--file{color:#263238;background-color:#f4f7f9;margin-right:40px}.sc-message--content.received .sc-message--file-download{color:#000}.sc-message--content.received .sc-message--file a{color:#2b2828b3}.sc-message--content.received .sc-message--file a:hover{color:#0c0c0c}.sc-message--location{border-radius:.5rem}.sc-message-map{width:200px;height:150px;border-radius:.5rem}.sc-message--list{border-radius:.5rem;width:256px}.sc-message--list .sc-message--list-element{position:relative;border-bottom:1px solid;padding:1rem}.sc-message--list .sc-message--list-element .sc-message--list-element-content{width:100%;display:block}.sc-message--list .sc-message--list-element .sc-message--list-element-content.large{width:100%;display:block;margin:0}.sc-message--list .sc-message--list-element .sc-message--list-element-content.large .sc-message--list-element-image{background-size:cover;height:auto;border-radius:.5rem .5rem 0 0}.sc-message--list .sc-message--list-element .sc-message--list-element-content.large .sc-message--list-element-description{color:#fff;border-radius:.5rem .5rem 0 0;background:#00000080}.sc-message--list .sc-message--list-element .sc-message--list-element-content.compact{padding:.5rem 0}.sc-message--list .sc-message--list-element .sc-message--list-element-content .sc-message--list-element-title{font-size:1.125rem;font-weight:600;margin:0;white-space:pre-line}.sc-message--list .sc-message--list-element .sc-message--list-element-content .sc-message--list-element-image{background-position:center;background-repeat:no-repeat;background-size:cover;position:relative;width:100%;height:117px}.sc-message--contact-form{border-radius:12px;padding:10px;margin:10px 0 2px;max-width:100%;word-wrap:break-word;position:relative;background-color:#fff;box-shadow:0 2px 8px #0000001a}.sc-message--contact-form-content,.sc-message--contact-form-form{display:flex;flex-direction:column;gap:16px}.sc-message--contact-form-field{display:flex;flex-direction:column;gap:8px}.sc-message--contact-form-label{font-size:14px;font-weight:500;color:#666;margin-bottom:4px}.sc-message--contact-form-label.name-label{color:#007bff}.sc-message--contact-form-label.phone-label,.sc-message--contact-form-label.email-label,.sc-message--contact-form-label.message-label{color:#666}.sc-message--contact-form-input{padding:0 0 8px;border:none;border-bottom:1px solid #e0e0e0;border-radius:0;font-size:16px;background-color:transparent;color:#333;transition:border-color .2s ease;outline:none}.sc-message--contact-form-input:focus{border-bottom-color:#007bff}.sc-message--contact-form-input:disabled{opacity:.6;cursor:not-allowed}.sc-message--contact-form-authorization{font-size:12px;color:#666;line-height:1.4;margin:8px 0}.sc-message--contact-form-link{color:#007bff;text-decoration:none}.sc-message--contact-form-link:hover{text-decoration:underline}.sc-message--contact-form-submit{padding:12px 24px;background-color:#007bff;border:none;border-radius:8px;color:#fff;font-size:16px;font-weight:600;cursor:pointer;transition:all .2s ease;margin-top:8px;text-align:center;margin-left:auto;margin-right:auto}.sc-message--contact-form-submit:hover:not(:disabled){background-color:#0056b3}.sc-message--contact-form-submit:disabled{opacity:.6;cursor:not-allowed}.sc-message--contact-form-submitted{display:flex;flex-direction:column;gap:16px}.sc-message--contact-form-submitted-title{font-size:16px;font-weight:600;color:#4caf50;text-align:center;margin-bottom:8px}.sc-message--contact-form-submitted-info{display:flex;flex-direction:column;gap:12px}.sc-message--contact-form-submitted-item{display:flex;flex-direction:column;gap:4px;padding:12px;background-color:#f8f9fa;border-radius:8px;border-left:4px solid #007bff}.sc-message--contact-form-submitted-label{font-size:12px;font-weight:500;color:#666;text-transform:uppercase;letter-spacing:.5px}.sc-message--contact-form-submitted-value{font-size:14px;font-weight:500;color:#333;word-break:break-word}.sc-message--contact-form-submitted-text{font-size:14px;line-height:1.6;color:inherit;padding:12px;background-color:#ffffff1a;border-radius:8px;border-left:4px solid #007bff}.sc-message--contact-form-submitted-text strong{font-weight:600;color:inherit;opacity:.8}.sc-message--contact-form-phone-display{font-size:18px;font-weight:700;color:#007bff;text-align:center;padding:8px 12px;background-color:#007bff1a;border-radius:8px;margin-bottom:12px;border:2px solid #007bff;cursor:pointer;transition:all .2s ease}.sc-message--contact-form-phone-display:hover{background-color:#007bff33;transform:translateY(-1px);box-shadow:0 2px 8px #007bff4d}.sc-message--contact-form-phone-link{color:inherit;text-decoration:none;display:block;width:100%;height:100%}.sc-message--contact-form-phone-link:hover{color:inherit;text-decoration:none}.sc-message--contact-form-phone-link:focus{outline:none;color:inherit}.sc-message--contact-form-phone-link:active,.sc-message--contact-form-phone-link:visited{color:inherit}.sc-message--contact-form-response-text{font-size:14px;line-height:1.5;color:inherit;text-align:center;opacity:.9}.sc-message--contact-form-system{margin-top:8px}.sc-message--contact-form-user{margin-bottom:8px}.sc-message--contact-form-error{color:#dc3545;font-size:12px;margin-top:4px;display:block;line-height:1.4}a.chatLink{color:inherit!important}p.sc-message--text-content{margin:0!important;white-space:pre-line}.sc-message--contact-form-phone-display{padding-top:10px}.sc--status{display:flex;flex-direction:row}.sc--status .sc--status-read{margin-right:-6px}.sc-message-list{height:80%;overflow-y:auto;background-size:100%;padding:40px 0}.sc-typing-indicator{text-align:center;padding:.5rem;border-radius:2rem;width:50px;margin-left:2rem}.sc-typing-indicator span{display:inline-block;background-color:#b6b5ba;width:5px;height:5px;border-radius:100%;margin-right:3px;animation:bob 2s infinite}.sc-typing-indicator span:nth-child(1){animation-delay:-1s}.sc-typing-indicator span:nth-child(2){animation-delay:-.85s}.sc-typing-indicator span:nth-child(3){animation-delay:-.7s}@keyframes bob{10%{transform:translateY(-10px);background-color:#9e9da2}50%{transform:translateY(0);background-color:#b6b5ba}}.sc-message--contact-form-confirmation{margin:8px 0;padding:12px 16px;border-radius:8px;border:1px solid rgba(0,0,0,.1);width:70%}.sc-message--contact-form-confirmation .sc-message--contact-form-phone-display{margin-bottom:12px}.sc-message--contact-form-confirmation .sc-message--contact-form-phone-display .sc-message--contact-form-phone-link{color:#007bff;text-decoration:none;font-weight:600;font-size:16px}.sc-message--contact-form-confirmation .sc-message--contact-form-phone-display .sc-message--contact-form-phone-link:hover{text-decoration:underline}.sc-message--contact-form-confirmation .sc-message--contact-form-response-text h3{margin:0 0 8px;font-size:16px;font-weight:600;color:inherit}.sc-message--contact-form-confirmation .sc-message--contact-form-response-text p{margin:0;font-size:14px;line-height:1.4;color:inherit}.sc-emoji-picker{position:absolute;bottom:30px;right:0;min-width:200px;max-height:215px;box-shadow:0 7px 40px 2px #9495964d;background:#fff;border-radius:10px;outline:none}.sc-emoji-picker:after{content:"";width:14px;height:14px;background:#fff;position:absolute;bottom:-6px;right:55px;transform:rotate(45deg);border-radius:2px}.sc-emoji-picker--content{padding:.5rem;overflow:auto;width:100%;max-height:195px;margin-top:5px;box-sizing:border-box}.sc-emoji-picker--category{display:flex;flex-direction:row;flex-wrap:wrap}.sc-emoji-picker--category-title{min-width:100%;color:#b8c3ca;font-weight:200;font-size:1rem;margin:5px;letter-spacing:1px}.sc-emoji-picker--emoji{margin:5px;width:18px;text-align:center;cursor:pointer;vertical-align:middle;font-size:1.5rem;transition:transform 60ms ease-out,-webkit-transform 60ms ease-out}.sc-emoji-picker--emoji:hover{transform:scale(1.4)}.sc-user-input--emoji-icon-wrapper{background:none;border:none;padding:0;margin:0;outline:none;opacity:.5}.sc-user-input--emoji-icon-wrapper:focus{outline:none}.sc-user-input--emoji-icon{width:20px;height:20px;cursor:pointer;align-self:center;vertical-align:middle}.sc-user-input--emoji-icon-wrapper:focus,.sc-user-input--emoji-icon-wrapper:hover{opacity:1}.sc-user-input--file-wrapper{background:none;border:none;padding:0;margin:0;outline:none;position:relative;cursor:pointer;opacity:.5}.sc-user-input--file-icon-wrapper{background:none;border:none;padding:0;margin:0;outline:none;cursor:pointer!important}.sc-user-input--file-icon{width:16px;height:16px;align-self:center;outline:none;vertical-align:middle}.sc-user-input--file-wrapper:hover{opacity:1}.sc-user-input--location-icon-wrapper{background:none;border:none;padding:0;margin:0;outline:none;opacity:.5}.sc-user-input--location-icon-wrapper:focus{outline:none}.sc-user-input--location-icon{width:20px;height:20px;cursor:pointer;align-self:center;vertical-align:middle}.sc-user-input--location-icon-wrapper:hover{opacity:1}.sc-menu-element{position:relative;font-size:.9rem;cursor:pointer;min-width:100px;max-width:130px}.sc-menu-item{display:flex;flex-direction:row;align-items:center;justify-content:flex-start;padding:5px 10px;text-decoration:none;width:100%;background:transparent;border:none;border-radius:0;transition:all .2s ease;box-shadow:none;gap:8px}.sc-menu-item:hover{background:transparent;transform:none;box-shadow:none}.sc-menu-item:active{transform:none;box-shadow:none}.sc-menu-item:focus{outline:2px solid #007bff;outline-offset:2px}.sc-menu-item .sc-menu-item-emoji{font-size:1.2rem;flex-shrink:0}.sc-menu-item .sc-menu-item-text{font-size:.9rem;font-weight:500;text-align:left;line-height:1.3;color:#333;flex:1;padding:8px 12px;background:#f5f5f5;border:1px solid #e0e0e0;border-radius:12px;transition:all .2s ease;box-shadow:0 2px 6px #00000014}.sc-menu-item .sc-menu-item-text:hover{background:#eee;transform:translateY(-1px);box-shadow:0 4px 12px #0000001f}.sc-menu-item-button{display:none}@media (max-width: 480px){.sc-menu-element{min-width:100px;max-width:130px}.sc-menu-item{padding:8px 12px;min-height:44px;gap:6px}.sc-menu-item .sc-menu-item-emoji{font-size:1.1rem}.sc-menu-item .sc-menu-item-text{font-size:.8rem;padding:6px 10px}}.sc-user-input--menu{align-self:center;width:100%}.sc-user-input--menu-button,.sc-user-input--menu-img{display:none}.sc-menu-content{display:block;position:absolute;box-shadow:0 -8px 24px #00000026;width:95%;max-width:500px;bottom:55px;z-index:3;border-radius:16px;padding:20px;background:#fff;border:1px solid #f0f0f0}.sc-menu-content:active,.sc-menu-content:focus{outline:none}.sc-menu-always-visible{position:static;width:100%;max-width:none;bottom:auto;box-shadow:none;border:none;border-radius:0;background:transparent}.sc-header-submenu-content{position:relative;text-align:center;margin-bottom:20px}.sc-header-submenu-content .sc-title-submenu-title{font-weight:600;font-size:1.125rem;margin:0;color:#333}.sc-return-submenu-content{display:inline-block;position:absolute;left:0;top:50%;transform:translateY(-50%);font-size:1.5rem;padding:1rem;text-decoration:none;cursor:pointer;color:#666}.sc-return-submenu-content:hover{color:#333}.sc-menu-elements-horizontal{display:flex;gap:16px;flex-wrap:wrap}.sc-menu-elements-carousel{display:flex;justify-content:center;gap:8px;width:100%;overflow-x:auto;overflow-y:hidden;-webkit-overflow-scrolling:touch;scrollbar-width:thin;scrollbar-color:rgba(0,0,0,.12) transparent}.sc-menu-elements-carousel::-webkit-scrollbar{height:2px}.sc-menu-elements-carousel::-webkit-scrollbar-track{background:transparent}.sc-menu-elements-carousel::-webkit-scrollbar-thumb{background:#0000001f;border-radius:2px}.sc-menu-elements-carousel:hover::-webkit-scrollbar-thumb{background:#0000002e}.sc-menu-carousel-card{flex:0 0 auto}.sc-menu-carousel-card .sc-menu-element{width:100%;height:100%}.sc-menu-carousel-card .sc-menu-item{display:block;width:100%;text-decoration:none;color:inherit}.sc-menu-carousel-card .sc-menu-item-text{font-size:.8rem;font-weight:500;color:#333;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:block}@media (max-width: 480px){.sc-menu-carousel-card .sc-menu-item-text{font-size:.75rem}}.sc-user-input--button-icon-wrapper{background:none;border:none;padding:0;margin:0;outline:none;cursor:pointer}.sc-user-input--button-icon-wrapper:focus{outline:none}.sc-user-input--button-icon-wrapper svg{width:16px;height:16px;cursor:pointer;align-self:center;outline:none;display:inline-block;vertical-align:middle}.sc-user-input--button-icon-wrapper svg:hover path{filter:contrast(15%)}.sc-suggestions-row{text-align:center;padding:.5rem 0}.sc-suggestions-element{margin:0 0 .25rem .25rem;padding:.25rem .5rem;border:1px solid;border-radius:2rem;font-size:1rem;background:inherit;cursor:pointer;outline:0}.sc-user-input{min-height:55px;margin:0;position:relative;bottom:0;display:flex;background-color:#f4f7f9;border-bottom-left-radius:.5rem;border-bottom-right-radius:.5rem;transition:background-color .2s ease,box-shadow .2s ease;border-top:1px solid #eef2f4}.sc-user-input--text{flex-grow:1;resize:none;border:none;outline:none;border-bottom-left-radius:.5rem;box-sizing:border-box;padding:18px 8px;font-size:15px;font-weight:400;line-height:1.33;white-space:pre-wrap;word-wrap:break-word;color:#565867;-webkit-font-smoothing:antialiased;max-height:200px;overflow:scroll;bottom:0;overflow-x:hidden;overflow-y:auto}.sc-user-input--text:empty:before{content:attr(placeholder);display:block;color:#56586780;filter:contrast(15%);outline:none;cursor:text}.sc-user-input--text[contenteditable=true]:focus:empty:before{position:absolute}.sc-user-input--text[contenteditable=true]:focus:empty:after{content:" "}.sc-user-input--buttons{display:flex;gap:4px;margin:0 .5rem}.sc-user-input--button{display:flex;flex-direction:column;justify-content:center}.sc-user-input--button:not(:last-child){margin-right:2px}.sc-user-input.active{box-shadow:none;background-color:#fff;box-shadow:0 -5px 20px #96a5be33}.sc-user-input--button label{position:relative;height:24px;padding-left:3px;cursor:pointer}.sc-user-input--button label:hover path{fill:#565867}.sc-user-input--button input{position:absolute;left:0;top:0;width:100%;z-index:99999;height:100%;opacity:0;cursor:pointer;overflow:hidden}.sc-file-container{padding:5px 20px;display:flex;align-items:center}.sc-user-input--file-icon{vertical-align:bottom;width:16px;height:16px}.delete-file-message{font-style:normal;float:right;cursor:pointer;color:#c8cad0}.delete-file-message:hover{color:#5d5e6d}.icon-file-message{margin-right:5px}.sc-webview{border:0!important;position:relative;width:100%;height:100%;padding:0;margin:0}.sc-webview iframe{width:100%;height:calc(100% - 35px)}.sc-webview--footer{width:100%;height:35px;text-align:center;display:table}.sc-webview--button{cursor:pointer;display:table-cell;vertical-align:middle;margin:0;padding:0}.sc-webview--button img{vertical-align:middle}.sc-chat-window{width:370px;height:calc(100% - 120px);max-height:590px;position:fixed;right:25px;bottom:100px;box-sizing:border-box;box-shadow:0 7px 40px 2px #9495961a;background:#fff;display:flex;flex-direction:column;justify-content:space-between;border-radius:10px;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,sans-serif;animation:fadeIn;animation-duration:.3s;animation-timing-function:ease-in-out;z-index:10000}.sc-chat-window.closed{opacity:0;display:none;bottom:90px}@keyframes fadeIn{0%{display:none;opacity:0}to{display:flex;opacity:1}}.sc-message--me{text-align:right}.sc-message--them{text-align:left}@media (max-width: 450px){.sc-chat-window{width:100%;height:100%;max-height:100%;right:0;bottom:0;border-radius:0}.sc-chat-window{transition:.1s ease-in-out}.sc-chat-window.closed{bottom:0}}.sc-launcher{width:60px;height:60px;background-position:center;background-repeat:no-repeat;position:fixed;right:20px;bottom:20px;border-radius:50%;box-shadow:4px 4px 10px #0000004d;transition:box-shadow .2s ease-in-out;cursor:pointer}.sc-launcher:before{content:"";position:relative;display:block;width:60px;height:60px;border-radius:50%;transition:box-shadow .2s ease-in-out}.sc-launcher .sc-open-icon,.sc-launcher .sc-closed-icon{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);width:32px;height:32px;fill:#fff}.sc-launcher .sc-new-messages-count{position:absolute;top:-3px;left:41px;display:flex;justify-content:center;flex-direction:column;border-radius:50%;width:22px;height:22px;background:#ff4646;color:#fff;text-align:center;margin:auto;font-size:12px;font-weight:500}.sc-launcher.opened:before{box-shadow:0 0 400px 250px #94959633}.sc-launcher:hover{box-shadow:0 0 27px 1.5px #0003}.loading-image{position:absolute;top:50%;left:50%;transform:translate(-50%) translateY(-50%)}.user-subscription-wrapper{height:100%;width:100%;position:relative;text-align:center;align-content:center;display:flex;flex-direction:column}.user-subscription-wrapper .user-subscription{height:100%;max-height:520px;display:flex;flex-direction:column}.user-subscription-wrapper .user-subscription .user-subscription-title{margin:2rem;flex-shrink:0}.user-subscription-wrapper .user-subscription .user-subscription-form{height:calc(100vh - 20px);flex:1;display:flex;flex-direction:column;min-height:0}.user-subscription-wrapper .user-subscription .user-subscription-form .user-subscription-inputs{flex:1;overflow-y:auto;padding:0 1rem .5rem .5rem;display:flex;flex-direction:column;gap:1rem}.user-subscription-wrapper .user-subscription .user-subscription-form .user-subscription-inputs .user-subscription-form-field{display:flex;flex-direction:column;align-items:stretch}.user-subscription-wrapper .user-subscription .user-subscription-form .user-subscription-inputs .user-subscription-form-input{border:1px solid #dfe5e8;outline:0;padding:.75rem;border-radius:.75rem;width:100%;box-sizing:border-box;font-size:.95rem;transition:border-color .15s ease,box-shadow .15s ease}.user-subscription-wrapper .user-subscription .user-subscription-form .user-subscription-inputs .user-subscription-form-input:focus{border-color:#999;box-shadow:0 0 0 2px #0000000d}.user-subscription-wrapper .user-subscription .user-subscription-form .user-subscription-inputs .user-subscription-form-input.error{border-color:#ff4d4f}.user-subscription-wrapper .user-subscription .user-subscription-form .user-subscription-inputs .user-subscription-error{margin-top:.35rem;color:#ff4d4f;font-size:.8rem;text-align:left}.user-subscription-wrapper .user-subscription .user-subscription-form .user-subscription-button-section{flex-shrink:0;padding:1rem;background:#fff;border-top:1px solid #f0f0f0;position:sticky;bottom:0;z-index:10;box-shadow:0 -2px 10px #0000001a}.user-subscription-wrapper .user-subscription .user-subscription-form .user-subscription-button-section .user-subscription-form-button-submit{display:block;border-radius:2rem;border:0;width:100%;padding:1rem;cursor:pointer;font-size:1rem;font-weight:500}.user-subscription-wrapper .user-subscription .user-subscription-form .sc-message--contact-form-authorization{margin:.5rem 1rem 1rem;color:#737b80;font-size:.78rem;line-height:1.4;text-align:left}.user-subscription-wrapper .user-subscription .user-subscription-form .sc-message--contact-form-link{color:#1677ff;text-decoration:underline;cursor:pointer}.sc-launcher,.sc-chat-window{right:25px!important;bottom:25px!important;z-index:999!important;box-shadow:0 0 8px #c4c4c4!important}
|
|
1
|
+
@charset "UTF-8";/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */html{line-height:1.15;-webkit-text-size-adjust:100%}body{margin:0}main{display:block}h1{font-size:2em;margin:.67em 0}hr{box-sizing:content-box;height:0;overflow:visible}pre{font-family:monospace,monospace;font-size:1em}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;text-decoration:underline dotted}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0}button,input{overflow:visible}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button}button::-moz-focus-inner,[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner{border-style:none;padding:0}button:-moz-focusring,[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:.35em .75em .625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress{vertical-align:baseline}textarea{overflow:auto}[type=checkbox],[type=radio]{box-sizing:border-box;padding:0}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}details{display:block}summary{display:list-item}template{display:none}[hidden]{display:none}.sc-header{min-height:64px;border-top-left-radius:.5rem;border-top-right-radius:.5rem;padding:10px;box-shadow:0 1px 4px #0003;position:relative;box-sizing:border-box;display:flex}.sc-header--img{border-radius:50%;align-self:center;padding:10px;max-width:32px;max-height:32px;box-sizing:content-box}.sc-header--title{align-self:center;flex:1;-webkit-user-select:none;user-select:none;font-size:1.25rem}.sc-header--title.enabled{cursor:pointer;border-radius:5px}.sc-header--title.enabled:hover{box-shadow:0 2px 5px #0000011a}.sc-header--actions{display:flex;align-items:center;gap:8px;margin-left:auto}.sc-header--close-button{width:36px;height:36px;align-self:center;margin-right:10px;box-sizing:border-box;cursor:pointer;border-radius:100%}.sc-header--close-button:hover{box-shadow:0 2px 5px #0000011a}.sc-header--close-button svg{width:100%;height:100%;padding:5px;box-sizing:border-box;fill:#fff}@media (max-width: 450px){.sc-header{border-radius:0}}.staff-menu{position:relative;display:inline-block}.staff-menu-toggle{background:none;border:none;cursor:pointer;padding:8px;border-radius:4px;color:inherit;transition:background-color .2s ease;display:flex;align-items:center;justify-content:center}.staff-menu-toggle:hover{background-color:#ffffff1a}.staff-menu-toggle:focus{outline:none;background-color:#ffffff1a}.staff-menu-dropdown{position:absolute;top:100%;right:0;background:#fff;border:1px solid #e0e0e0;border-radius:8px;box-shadow:0 4px 12px #00000026;z-index:1000;min-width:180px;overflow:hidden;animation:dropdownFadeIn .2s ease-out}.staff-menu-dropdown-open{display:block!important}.staff-menu-dropdown-closed{display:none!important}@keyframes dropdownFadeIn{0%{opacity:0;transform:translateY(-8px)}to{opacity:1;transform:translateY(0)}}.staff-menu-item{width:100%;padding:12px 16px;border:none;background:none;cursor:pointer;display:flex;align-items:center;gap:8px;color:#333;font-size:14px;transition:background-color .2s ease;text-align:left}.staff-menu-item:hover{background-color:#f5f5f5}.staff-menu-item:focus{outline:none;background-color:#f5f5f5}.staff-menu-item:first-child{border-top-left-radius:8px;border-top-right-radius:8px}.staff-menu-item:last-child{border-bottom-left-radius:8px;border-bottom-right-radius:8px}.staff-menu-item svg{flex-shrink:0}.sc-header[style*="background: rgb(51, 51, 51)"] .staff-menu-dropdown,.sc-header[style*="background: #333"] .staff-menu-dropdown{background:#2a2a2a;border-color:#444}.sc-header[style*="background: rgb(51, 51, 51)"] .staff-menu-dropdown .staff-menu-item,.sc-header[style*="background: #333"] .staff-menu-dropdown .staff-menu-item{color:#fff}.sc-header[style*="background: rgb(51, 51, 51)"] .staff-menu-dropdown .staff-menu-item:hover,.sc-header[style*="background: #333"] .staff-menu-dropdown .staff-menu-item:hover{background-color:#3a3a3a}.sc-header[style*="background: rgb(51, 51, 51)"] .staff-menu-dropdown .staff-menu-item:focus,.sc-header[style*="background: #333"] .staff-menu-dropdown .staff-menu-item:focus{background-color:#3a3a3a}.sc-chat--disconnected-icon-wrapper{position:relative;height:100%;width:100%}.sc-chat--disconnected-icon{position:absolute;top:50%;left:50%;transform:translateY(-50%) translate(-50%);text-align:center}.sc-chat--disconnected-text{width:100%}.sc-chat--disconnected-button{border:1px solid;border-radius:2rem;padding:5px 10px;width:80%;margin:2px;cursor:pointer;outline:0}.sc-chat--disconnected-button:active{content:"";opacity:0;transition:all .5s}.sc-chat--disconnected-button:active:after{opacity:1;transition:0s}.sc-message{margin:auto;padding:0 .5rem 0 0;display:flex;margin-bottom:.25rem}.sc-message:first-child{margin-top:50%}.sc-message.sent{flex-direction:row-reverse}.sc-message.sent .sc-message--content{justify-content:flex-end}.sc-message.sent .sc-message--content .sc-message--avatar{display:none}.sc-message.sent .sc-message--content .sc-message--wrapper{align-items:flex-end}.sc-message.sent .sc-message--content .sc-message--wrapper .sc-message--text{color:#fff;background-color:#4e8cff;word-wrap:break-word}.sc-message.sent .sc-message--content .sc-message--wrapper .sc-message--meta{flex-direction:row-reverse}.sc-message .sc-message--content{display:flex;flex-direction:row;position:relative;max-width:calc(100% - 40px);width:auto}.sc-message .sc-message--content .sc-message--avatar{width:32px;height:32px;margin:2px 4px;background-position:0 0;flex-shrink:0;background-size:cover;border-radius:100%}.sc-message .sc-message--content .sc-message--wrapper{display:flex;flex-direction:column}.sc-message .sc-message--content .sc-message--wrapper .sc-message--text{padding:10px 20px;border-radius:.5rem;font-weight:400;font-size:.9rem;line-height:1.5;position:relative;-webkit-font-smoothing:subpixel-antialiased;color:#263238;background-color:#f4f7f9}.sc-message .sc-message--content .sc-message--wrapper .sc-message--text .sc-message--text-body .sc-message--text-content{white-space:pre-wrap}.sc-message .sc-message--content .sc-message--wrapper .sc-message--meta{display:flex;justify-content:space-between;align-items:flex-start;font-size:.65rem;margin-top:4px;padding:0 4px;width:100%;height:18px;box-sizing:border-box}@media (max-width: 450px){.sc-message{width:80%}}.sc-message--buttons{color:#222;max-width:-webkit-fill-available;padding:.25rem .5rem;border-radius:.5rem;font-weight:300;font-size:1.25rem;line-height:1.4;position:relative;-webkit-font-smoothing:subpixel-antialiased;text-align:center}.sc-message--buttons .sc-message--buttons-content{border:1px solid;border-radius:2rem;padding:.25rem;width:80%;margin:2px;cursor:pointer;outline:0;font-size:.75rem}.sc-message--list-element-bottom .sc-message--buttons-content{width:100%;font-weight:600;border-radius:0 0 6px 6px;padding:.5rem;margin:0}.sc-message--list-element-bottom .sc-message--buttons{padding:0}.sc-message--list-element .sc-message--buttons-content{padding:.5rem;margin:0}.sc-message--list-element .sc-message--buttons{padding:0;margin:1rem;text-align:center}.sc-message--carousel-element .sc-message--buttons-content{padding:.5rem;margin-bottom:16px}.sc-message--carousel-element .sc-message--buttons{margin:0;text-align:center}.sc-message--carousel{border-radius:.5rem;position:relative;width:275px;overflow:hidden}.sc-message--carousel .sc-message--carousel-inner{display:flex;transition:transform .5s ease;width:100%}.sc-message--carousel .sc-message--carousel-inner .sc-message--carousel-element-wrapper{min-width:100%;height:100%;display:flex;align-items:flex-end;justify-content:center}.sc-message--carousel .sc-message--carousel-inner .sc-message--carousel-element-wrapper .sc-message--carousel-element{width:100%}.sc-message--carousel .sc-message--carousel-inner .sc-message--carousel-element-wrapper .sc-message--carousel-element .sc-message--carousel-element-image{background-repeat:no-repeat;background-size:cover;position:relative;width:100%;height:150px}.sc-message--carousel .sc-message--carousel-inner .sc-message--carousel-element-wrapper .sc-message--carousel-element .sc-message--carousel-title{font-size:1rem;font-weight:600;padding:.5rem 0;margin-top:8px}.sc-message--carousel .sc-message--carousel-inner .sc-message--carousel-element-wrapper .sc-message--carousel-element .sc-message--carousel-element-description{width:100%;padding:0 2rem;box-sizing:border-box}.sc-message--carousel .sc-message--carousel-control{position:absolute;top:50%;transform:translateY(-50%);background-color:#00000080;color:#fff;border:none;cursor:pointer;z-index:2;font-size:.75rem}.sc-message--carousel .sc-message--carousel-control.prev{left:0;top:calc(50% - 14px);width:1.5rem;height:2rem}.sc-message--carousel .sc-message--carousel-control.next{top:calc(50% - 14px);right:0;width:1.5rem;height:2rem}.sc-message--file{background-color:transparent!important;border-radius:.5rem;font-weight:300;font-size:14px;line-height:1.4;-webkit-font-smoothing:subpixel-antialiased}.sc-message--file audio,.sc-message--file video{max-width:100%}.sc-message--content.sent .sc-message--file{word-wrap:break-word}.sc-message--file-icon{text-align:center;margin-left:auto;margin-right:auto;margin-bottom:0}.sc-image{max-width:100%;height:auto}.sc-message--file-download{padding:10px 20px;border-radius:.5rem;color:#fff;text-align:center}.sc-message--file-download a{text-decoration:none;color:#ece7e7}.sc-message--file-download a img{vertical-align:middle;width:24px;height:auto}.sc-message--content.received .sc-message--file{color:#263238;background-color:#f4f7f9;margin-right:40px}.sc-message--content.received .sc-message--file-download{color:#000}.sc-message--content.received .sc-message--file a{color:#2b2828b3}.sc-message--content.received .sc-message--file a:hover{color:#0c0c0c}.sc-message--location{border-radius:.5rem}.sc-message-map{width:200px;height:150px;border-radius:.5rem}.sc-message--list{border-radius:.5rem;width:256px}.sc-message--list .sc-message--list-element{position:relative;border-bottom:1px solid;padding:1rem}.sc-message--list .sc-message--list-element .sc-message--list-element-content{width:100%;display:block}.sc-message--list .sc-message--list-element .sc-message--list-element-content.large{width:100%;display:block;margin:0}.sc-message--list .sc-message--list-element .sc-message--list-element-content.large .sc-message--list-element-image{background-size:cover;height:auto;border-radius:.5rem .5rem 0 0}.sc-message--list .sc-message--list-element .sc-message--list-element-content.large .sc-message--list-element-description{color:#fff;border-radius:.5rem .5rem 0 0;background:#00000080}.sc-message--list .sc-message--list-element .sc-message--list-element-content.compact{padding:.5rem 0}.sc-message--list .sc-message--list-element .sc-message--list-element-content .sc-message--list-element-title{font-size:1.125rem;font-weight:600;margin:0;white-space:pre-line}.sc-message--list .sc-message--list-element .sc-message--list-element-content .sc-message--list-element-image{background-position:center;background-repeat:no-repeat;background-size:cover;position:relative;width:100%;height:117px}.sc-message--contact-form{border-radius:12px;padding:10px;margin:10px 0 2px;max-width:100%;word-wrap:break-word;position:relative;background-color:#fff;box-shadow:0 2px 8px #0000001a}.sc-message--contact-form-content,.sc-message--contact-form-form{display:flex;flex-direction:column;gap:16px}.sc-message--contact-form-field{display:flex;flex-direction:column;gap:8px}.sc-message--contact-form-label{font-size:14px;font-weight:500;color:#666;margin-bottom:4px}.sc-message--contact-form-label.name-label{color:#007bff}.sc-message--contact-form-label.phone-label,.sc-message--contact-form-label.email-label,.sc-message--contact-form-label.message-label{color:#666}.sc-message--contact-form-input{padding:0 0 8px;border:none;border-bottom:1px solid #e0e0e0;border-radius:0;font-size:16px;background-color:transparent;color:#333;transition:border-color .2s ease;outline:none}.sc-message--contact-form-input:focus{border-bottom-color:#007bff}.sc-message--contact-form-input:disabled{opacity:.6;cursor:not-allowed}.sc-message--contact-form-authorization{font-size:12px;color:#666;line-height:1.4;margin:8px 0}.sc-message--contact-form-link{color:#007bff;text-decoration:none}.sc-message--contact-form-link:hover{text-decoration:underline}.sc-message--contact-form-submit{padding:12px 24px;background-color:#007bff;border:none;border-radius:8px;color:#fff;font-size:16px;font-weight:600;cursor:pointer;transition:all .2s ease;margin-top:8px;text-align:center;margin-left:auto;margin-right:auto}.sc-message--contact-form-submit:hover:not(:disabled){background-color:#0056b3}.sc-message--contact-form-submit:disabled{opacity:.6;cursor:not-allowed}.sc-message--contact-form-submitted{display:flex;flex-direction:column;gap:16px}.sc-message--contact-form-submitted-title{font-size:16px;font-weight:600;color:#4caf50;text-align:center;margin-bottom:8px}.sc-message--contact-form-submitted-info{display:flex;flex-direction:column;gap:12px}.sc-message--contact-form-submitted-item{display:flex;flex-direction:column;gap:4px;padding:12px;background-color:#f8f9fa;border-radius:8px;border-left:4px solid #007bff}.sc-message--contact-form-submitted-label{font-size:12px;font-weight:500;color:#666;text-transform:uppercase;letter-spacing:.5px}.sc-message--contact-form-submitted-value{font-size:14px;font-weight:500;color:#333;word-break:break-word}.sc-message--contact-form-submitted-text{font-size:14px;line-height:1.6;color:inherit;padding:12px;background-color:#ffffff1a;border-radius:8px;border-left:4px solid #007bff}.sc-message--contact-form-submitted-text strong{font-weight:600;color:inherit;opacity:.8}.sc-message--contact-form-phone-display{font-size:18px;font-weight:700;color:#007bff;text-align:center;padding:8px 12px;background-color:#007bff1a;border-radius:8px;margin-bottom:12px;border:2px solid #007bff;cursor:pointer;transition:all .2s ease}.sc-message--contact-form-phone-display:hover{background-color:#007bff33;transform:translateY(-1px);box-shadow:0 2px 8px #007bff4d}.sc-message--contact-form-phone-link{color:inherit;text-decoration:none;display:block;width:100%;height:100%}.sc-message--contact-form-phone-link:hover{color:inherit;text-decoration:none}.sc-message--contact-form-phone-link:focus{outline:none;color:inherit}.sc-message--contact-form-phone-link:active,.sc-message--contact-form-phone-link:visited{color:inherit}.sc-message--contact-form-response-text{font-size:14px;line-height:1.5;color:inherit;text-align:center;opacity:.9}.sc-message--contact-form-system{margin-top:8px}.sc-message--contact-form-user{margin-bottom:8px}.sc-message--contact-form-error{color:#dc3545;font-size:12px;margin-top:4px;display:block;line-height:1.4}a.chatLink{color:inherit!important}p.sc-message--text-content{margin:0!important;white-space:pre-line}.sc-message--contact-form-phone-display{padding-top:10px}.sc--status{display:flex;flex-direction:row}.sc--status .sc--status-read{margin-right:-6px}.sc-message-list{height:80%;overflow-y:auto;background-size:100%;padding:40px 0}.sc-typing-indicator{text-align:center;padding:.5rem;border-radius:2rem;width:50px;margin-left:2rem}.sc-typing-indicator span{display:inline-block;background-color:#b6b5ba;width:5px;height:5px;border-radius:100%;margin-right:3px;animation:bob 2s infinite}.sc-typing-indicator span:nth-child(1){animation-delay:-1s}.sc-typing-indicator span:nth-child(2){animation-delay:-.85s}.sc-typing-indicator span:nth-child(3){animation-delay:-.7s}@keyframes bob{10%{transform:translateY(-10px);background-color:#9e9da2}50%{transform:translateY(0);background-color:#b6b5ba}}.sc-message--contact-form-confirmation{margin:8px 0;padding:12px 16px;border-radius:8px;border:1px solid rgba(0,0,0,.1);width:70%}.sc-message--contact-form-confirmation .sc-message--contact-form-phone-display{margin-bottom:12px}.sc-message--contact-form-confirmation .sc-message--contact-form-phone-display .sc-message--contact-form-phone-link{color:#007bff;text-decoration:none;font-weight:600;font-size:16px}.sc-message--contact-form-confirmation .sc-message--contact-form-phone-display .sc-message--contact-form-phone-link:hover{text-decoration:underline}.sc-message--contact-form-confirmation .sc-message--contact-form-response-text h3{margin:0 0 8px;font-size:16px;font-weight:600;color:inherit}.sc-message--contact-form-confirmation .sc-message--contact-form-response-text p{margin:0;font-size:14px;line-height:1.4;color:inherit}.sc-emoji-picker{position:absolute;bottom:30px;right:0;min-width:200px;max-height:215px;box-shadow:0 7px 40px 2px #9495964d;background:#fff;border-radius:10px;outline:none}.sc-emoji-picker:after{content:"";width:14px;height:14px;background:#fff;position:absolute;bottom:-6px;right:55px;transform:rotate(45deg);border-radius:2px}.sc-emoji-picker--content{padding:.5rem;overflow:auto;width:100%;max-height:195px;margin-top:5px;box-sizing:border-box}.sc-emoji-picker--category{display:flex;flex-direction:row;flex-wrap:wrap}.sc-emoji-picker--category-title{min-width:100%;color:#b8c3ca;font-weight:200;font-size:1rem;margin:5px;letter-spacing:1px}.sc-emoji-picker--emoji{margin:5px;width:18px;text-align:center;cursor:pointer;vertical-align:middle;font-size:1.5rem;transition:transform 60ms ease-out,-webkit-transform 60ms ease-out}.sc-emoji-picker--emoji:hover{transform:scale(1.4)}.sc-user-input--emoji-icon-wrapper{background:none;border:none;padding:0;margin:0;outline:none;opacity:.5}.sc-user-input--emoji-icon-wrapper:focus{outline:none}.sc-user-input--emoji-icon{width:20px;height:20px;cursor:pointer;align-self:center;vertical-align:middle}.sc-user-input--emoji-icon-wrapper:focus,.sc-user-input--emoji-icon-wrapper:hover{opacity:1}.sc-user-input--file-wrapper{background:none;border:none;padding:0;margin:0;outline:none;position:relative;cursor:pointer;opacity:.5}.sc-user-input--file-icon-wrapper{background:none;border:none;padding:0;margin:0;outline:none;cursor:pointer!important}.sc-user-input--file-icon{width:16px;height:16px;align-self:center;outline:none;vertical-align:middle}.sc-user-input--file-wrapper:hover{opacity:1}.sc-user-input--location-icon-wrapper{background:none;border:none;padding:0;margin:0;outline:none;opacity:.5}.sc-user-input--location-icon-wrapper:focus{outline:none}.sc-user-input--location-icon{width:20px;height:20px;cursor:pointer;align-self:center;vertical-align:middle}.sc-user-input--location-icon-wrapper:hover{opacity:1}.sc-menu-element{position:relative;font-size:.9rem;cursor:pointer;min-width:100px;max-width:130px}.sc-menu-item{display:flex;flex-direction:row;align-items:center;justify-content:flex-start;padding:5px 10px;text-decoration:none;width:100%;background:transparent;border:none;border-radius:0;transition:all .2s ease;box-shadow:none;gap:8px}.sc-menu-item:hover{background:transparent;transform:none;box-shadow:none}.sc-menu-item:active{transform:none;box-shadow:none}.sc-menu-item:focus{outline:2px solid #007bff;outline-offset:2px}.sc-menu-item .sc-menu-item-emoji{font-size:1.2rem;flex-shrink:0}.sc-menu-item .sc-menu-item-text{font-size:.9rem;font-weight:500;text-align:left;line-height:1.3;color:#333;flex:1;padding:8px 12px;background:#f5f5f5;border:1px solid #e0e0e0;border-radius:12px;transition:all .2s ease;box-shadow:0 2px 6px #00000014}.sc-menu-item .sc-menu-item-text:hover{background:#eee;transform:translateY(-1px);box-shadow:0 4px 12px #0000001f}.sc-menu-item-button{display:none}@media (max-width: 480px){.sc-menu-element{min-width:100px;max-width:130px}.sc-menu-item{padding:8px 12px;min-height:44px;gap:6px}.sc-menu-item .sc-menu-item-emoji{font-size:1.1rem}.sc-menu-item .sc-menu-item-text{font-size:.8rem;padding:6px 10px}}.sc-user-input--menu{align-self:center;width:100%}.sc-user-input--menu-button,.sc-user-input--menu-img{display:none}.sc-menu-content{display:block;position:absolute;box-shadow:0 -8px 24px #00000026;width:95%;max-width:500px;bottom:55px;z-index:3;border-radius:16px;padding:20px;background:#fff;border:1px solid #f0f0f0}.sc-menu-content:active,.sc-menu-content:focus{outline:none}.sc-menu-always-visible{position:static;width:100%;max-width:none;bottom:auto;box-shadow:none;border:none;border-radius:0;background:transparent}.sc-header-submenu-content{position:relative;text-align:center;margin-bottom:20px}.sc-header-submenu-content .sc-title-submenu-title{font-weight:600;font-size:1.125rem;margin:0;color:#333}.sc-return-submenu-content{display:inline-block;position:absolute;left:0;top:50%;transform:translateY(-50%);font-size:1.5rem;padding:1rem;text-decoration:none;cursor:pointer;color:#666}.sc-return-submenu-content:hover{color:#333}.sc-menu-elements-horizontal{display:flex;gap:16px;flex-wrap:wrap}.sc-menu-elements-carousel{display:flex;justify-content:center;gap:8px;width:100%;overflow-x:auto;overflow-y:hidden;-webkit-overflow-scrolling:touch;scrollbar-width:thin;scrollbar-color:rgba(0,0,0,.12) transparent}.sc-menu-elements-carousel::-webkit-scrollbar{height:2px}.sc-menu-elements-carousel::-webkit-scrollbar-track{background:transparent}.sc-menu-elements-carousel::-webkit-scrollbar-thumb{background:#0000001f;border-radius:2px}.sc-menu-elements-carousel:hover::-webkit-scrollbar-thumb{background:#0000002e}.sc-menu-carousel-card{flex:0 0 auto}.sc-menu-carousel-card .sc-menu-element{width:100%;height:100%}.sc-menu-carousel-card .sc-menu-item{display:block;width:100%;text-decoration:none;color:inherit}.sc-menu-carousel-card .sc-menu-item-text{font-size:.8rem;font-weight:500;color:#333;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:block}@media (max-width: 480px){.sc-menu-carousel-card .sc-menu-item-text{font-size:.75rem}}.sc-user-input--button-icon-wrapper{background:none;border:none;padding:0;margin:0;outline:none;cursor:pointer}.sc-user-input--button-icon-wrapper:focus{outline:none}.sc-user-input--button-icon-wrapper svg{width:16px;height:16px;cursor:pointer;align-self:center;outline:none;display:inline-block;vertical-align:middle}.sc-user-input--button-icon-wrapper svg:hover path{filter:contrast(15%)}.sc-suggestions-row{text-align:center;padding:.5rem 0}.sc-suggestions-element{margin:0 0 .25rem .25rem;padding:.25rem .5rem;border:1px solid;border-radius:2rem;font-size:1rem;background:inherit;cursor:pointer;outline:0}.sc-user-input{min-height:55px;margin:0;position:relative;bottom:0;display:flex;background-color:#f4f7f9;border-bottom-left-radius:.5rem;border-bottom-right-radius:.5rem;transition:background-color .2s ease,box-shadow .2s ease;border-top:1px solid #eef2f4}.sc-user-input--text{flex-grow:1;resize:none;border:none;outline:none;border-bottom-left-radius:.5rem;box-sizing:border-box;padding:18px 8px;font-size:15px;font-weight:400;line-height:1.33;white-space:pre-wrap;word-wrap:break-word;color:#565867;-webkit-font-smoothing:antialiased;max-height:200px;overflow:scroll;bottom:0;overflow-x:hidden;overflow-y:auto}.sc-user-input--text:empty:before{content:attr(placeholder);display:block;color:#56586780;filter:contrast(15%);outline:none;cursor:text}.sc-user-input--text[contenteditable=true]:focus:empty:before{position:absolute}.sc-user-input--text[contenteditable=true]:focus:empty:after{content:" "}.sc-user-input--buttons{display:flex;gap:4px;margin:0 .5rem}.sc-user-input--button{display:flex;flex-direction:column;justify-content:center}.sc-user-input--button:not(:last-child){margin-right:2px}.sc-user-input.active{box-shadow:none;background-color:#fff;box-shadow:0 -5px 20px #96a5be33}.sc-user-input--button label{position:relative;height:24px;padding-left:3px;cursor:pointer}.sc-user-input--button label:hover path{fill:#565867}.sc-user-input--button input{position:absolute;left:0;top:0;width:100%;z-index:99999;height:100%;opacity:0;cursor:pointer;overflow:hidden}.sc-file-container{padding:5px 20px;display:flex;align-items:center}.sc-user-input--file-icon{vertical-align:bottom;width:16px;height:16px}.delete-file-message{font-style:normal;float:right;cursor:pointer;color:#c8cad0}.delete-file-message:hover{color:#5d5e6d}.icon-file-message{margin-right:5px}.sc-webview{border:0!important;position:relative;width:100%;height:100%;padding:0;margin:0}.sc-webview iframe{width:100%;height:calc(100% - 35px)}.sc-webview--footer{width:100%;height:35px;text-align:center;display:table}.sc-webview--button{cursor:pointer;display:table-cell;vertical-align:middle;margin:0;padding:0}.sc-webview--button img{vertical-align:middle}.sc-chat-window{width:370px;height:calc(100% - 120px);max-height:590px;position:fixed;right:25px;bottom:100px;box-sizing:border-box;box-shadow:0 7px 40px 2px #9495961a;background:#fff;display:flex;flex-direction:column;justify-content:space-between;border-radius:10px;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,sans-serif;animation:fadeIn;animation-duration:.3s;animation-timing-function:ease-in-out;z-index:10000}.sc-chat-window.closed{opacity:0;display:none;bottom:90px}@keyframes fadeIn{0%{display:none;opacity:0}to{display:flex;opacity:1}}.sc-message--me{text-align:right}.sc-message--them{text-align:left}@media (max-width: 450px){.sc-chat-window{width:100%;height:100%;max-height:100%;right:0;bottom:0;border-radius:0}.sc-chat-window{transition:.1s ease-in-out}.sc-chat-window.closed{bottom:0}}.sc-launcher{width:60px;height:60px;background-position:center;background-repeat:no-repeat;position:fixed;right:20px;bottom:20px;border-radius:50%;box-shadow:4px 4px 10px #0000004d;transition:box-shadow .2s ease-in-out;cursor:pointer}.sc-launcher:before{content:"";position:relative;display:block;width:60px;height:60px;border-radius:50%;transition:box-shadow .2s ease-in-out}.sc-launcher .sc-open-icon,.sc-launcher .sc-closed-icon{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);width:32px;height:32px;fill:#fff}.sc-launcher .sc-new-messages-count{position:absolute;top:-3px;left:41px;display:flex;justify-content:center;flex-direction:column;border-radius:50%;width:22px;height:22px;background:#ff4646;color:#fff;text-align:center;margin:auto;font-size:12px;font-weight:500}.sc-launcher.opened:before{box-shadow:0 0 400px 250px #94959633}.sc-launcher:hover{box-shadow:0 0 27px 1.5px #0003}.loading-image{position:absolute;top:50%;left:50%;transform:translate(-50%) translateY(-50%)}.user-subscription-wrapper{height:100%;width:100%;position:relative;text-align:center;align-content:center;display:flex;flex-direction:column}.user-subscription-wrapper .user-subscription{height:100%;max-height:520px;display:flex;flex-direction:column}.user-subscription-wrapper .user-subscription .user-subscription-title{margin:2rem;flex-shrink:0}.user-subscription-wrapper .user-subscription .user-subscription-form{height:calc(100vh - 20px);flex:1;display:flex;flex-direction:column;min-height:0}.user-subscription-wrapper .user-subscription .user-subscription-form .user-subscription-inputs{flex:1;overflow-y:auto;padding:0 1rem .5rem .5rem;display:flex;flex-direction:column;gap:1rem}.user-subscription-wrapper .user-subscription .user-subscription-form .user-subscription-inputs .user-subscription-form-field{display:flex;flex-direction:column;align-items:stretch}.user-subscription-wrapper .user-subscription .user-subscription-form .user-subscription-inputs .user-subscription-form-input{border:1px solid #dfe5e8;outline:0;padding:.75rem;border-radius:.75rem;width:100%;box-sizing:border-box;font-size:.95rem;transition:border-color .15s ease,box-shadow .15s ease}.user-subscription-wrapper .user-subscription .user-subscription-form .user-subscription-inputs .user-subscription-form-input:focus{border-color:#999;box-shadow:0 0 0 2px #0000000d}.user-subscription-wrapper .user-subscription .user-subscription-form .user-subscription-inputs .user-subscription-form-input.error{border-color:#ff4d4f}.user-subscription-wrapper .user-subscription .user-subscription-form .user-subscription-inputs .user-subscription-error{margin-top:.35rem;color:#ff4d4f;font-size:.8rem;text-align:left}.user-subscription-wrapper .user-subscription .user-subscription-form .user-subscription-button-section{flex-shrink:0;padding:1rem;background:#fff;border-top:1px solid #f0f0f0;position:sticky;bottom:0;z-index:10;box-shadow:0 -2px 10px #0000001a}.user-subscription-wrapper .user-subscription .user-subscription-form .user-subscription-button-section .user-subscription-form-button-submit{display:block;border-radius:2rem;border:0;width:100%;padding:1rem;cursor:pointer;font-size:1rem;font-weight:500}.user-subscription-wrapper .user-subscription .user-subscription-form .sc-message--contact-form-authorization{margin:.5rem 1rem 1rem;color:#737b80;font-size:.78rem;line-height:1.4;text-align:left}.user-subscription-wrapper .user-subscription .user-subscription-form .sc-message--contact-form-link{color:#1677ff;text-decoration:underline;cursor:pointer}.sc-launcher,.sc-chat-window{right:25px!important;bottom:25px!important;z-index:999!important;box-shadow:0 0 8px #c4c4c4!important}
|