vue-wiguet-chatweb 0.1.10 → 0.1.11

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,6 +1,7 @@
1
- (function(ue,u){typeof exports=="object"&&typeof module<"u"?u(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],u):(ue=typeof globalThis<"u"?globalThis:ue||self,u(ue["vue-wiguet-chatweb"]={},ue.Vue))})(this,function(ue,u){"use strict";let tt;const yi=new Uint8Array(16);function gi(){if(!tt&&(tt=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!tt))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return tt(yi)}const B=[];for(let t=0;t<256;++t)B.push((t+256).toString(16).slice(1));function wi(t,e=0){return B[t[e+0]]+B[t[e+1]]+B[t[e+2]]+B[t[e+3]]+"-"+B[t[e+4]]+B[t[e+5]]+"-"+B[t[e+6]]+B[t[e+7]]+"-"+B[t[e+8]]+B[t[e+9]]+"-"+B[t[e+10]]+B[t[e+11]]+B[t[e+12]]+B[t[e+13]]+B[t[e+14]]+B[t[e+15]]}const In={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function Ei(t,e,n){if(In.randomUUID&&!e&&!t)return In.randomUUID();t=t||{};const s=t.random||(t.rng||gi)();return s[6]=s[6]&15|64,s[8]=s[8]&63|128,wi(s)}const X=(t,e)=>{const n=t.__vccOpts||t;for(const[s,r]of e)n[s]=r;return n},ki={},Si={width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Ti=[u.createElementVNode("path",{d:"M16 31C24.2843 31 31 24.2843 31 16C31 7.71573 24.2843 1 16 1C7.71573 1 1 7.71573 1 16C1 24.2843 7.71573 31 16 31Z",stroke:"#B3B3B3","stroke-miterlimit":"10"},null,-1),u.createElementVNode("path",{d:"M19.78 22.3L15.98 16.63H15.9601L12.2001 22.3H11.0701L15.37 15.8899L11.25 9.69995H12.38L15.98 15.08H16L19.67 9.69995H20.8L16.55 15.82L20.92 22.3H19.77H19.78Z",fill:"#B3B3B3"},null,-1)];function bi(t,e){return u.openBlock(),u.createElementBlock("svg",Si,Ti)}const Oi=X(ki,[["render",bi]]),Ni={},Ci={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},vi=[u.createElementVNode("path",{fill:"#F28B0C",d:"M16.1 260.2c-22.6 12.9-20.5 47.3 3.6 57.3L160 376V479.3c0 18.1 14.6 32.7 32.7 32.7c9.7 0 18.9-4.3 25.1-11.8l62-74.3 123.9 51.6c18.9 7.9 40.8-4.5 43.9-24.7l64-416c1.9-12.1-3.4-24.3-13.5-31.2s-23.3-7.5-34-1.4l-448 256zm52.1 25.5L409.7 90.6 190.1 336l1.2 1L68.2 285.7zM403.3 425.4L236.7 355.9 450.8 116.6 403.3 425.4z"},null,-1)];function _i(t,e){return u.openBlock(),u.createElementBlock("svg",Ci,vi)}const xi=X(Ni,[["render",_i]]);function Ln(t,e){return function(){return t.apply(e,arguments)}}const{toString:Ai}=Object.prototype,{getPrototypeOf:Ft}=Object,nt=(t=>e=>{const n=Ai.call(e);return t[n]||(t[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),re=t=>(t=t.toLowerCase(),e=>nt(e)===t),st=t=>e=>typeof e===t,{isArray:Te}=Array,Ue=st("undefined");function Mi(t){return t!==null&&!Ue(t)&&t.constructor!==null&&!Ue(t.constructor)&&Z(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const Vn=re("ArrayBuffer");function Ri(t){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&Vn(t.buffer),e}const Di=st("string"),Z=st("function"),Fn=st("number"),rt=t=>t!==null&&typeof t=="object",Ii=t=>t===!0||t===!1,it=t=>{if(nt(t)!=="object")return!1;const e=Ft(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)},Li=re("Date"),Vi=re("File"),Fi=re("Blob"),Bi=re("FileList"),$i=t=>rt(t)&&Z(t.pipe),Ui=t=>{let e;return t&&(typeof FormData=="function"&&t instanceof FormData||Z(t.append)&&((e=nt(t))==="formdata"||e==="object"&&Z(t.toString)&&t.toString()==="[object FormData]"))},Pi=re("URLSearchParams"),Wi=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Pe(t,e,{allOwnKeys:n=!1}={}){if(t===null||typeof t>"u")return;let s,r;if(typeof t!="object"&&(t=[t]),Te(t))for(s=0,r=t.length;s<r;s++)e.call(null,t[s],s,t);else{const i=n?Object.getOwnPropertyNames(t):Object.keys(t),o=i.length;let a;for(s=0;s<o;s++)a=i[s],e.call(null,t[a],a,t)}}function Bn(t,e){e=e.toLowerCase();const n=Object.keys(t);let s=n.length,r;for(;s-- >0;)if(r=n[s],e===r.toLowerCase())return r;return null}const $n=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Un=t=>!Ue(t)&&t!==$n;function Bt(){const{caseless:t}=Un(this)&&this||{},e={},n=(s,r)=>{const i=t&&Bn(e,r)||r;it(e[i])&&it(s)?e[i]=Bt(e[i],s):it(s)?e[i]=Bt({},s):Te(s)?e[i]=s.slice():e[i]=s};for(let s=0,r=arguments.length;s<r;s++)arguments[s]&&Pe(arguments[s],n);return e}const qi=(t,e,n,{allOwnKeys:s}={})=>(Pe(e,(r,i)=>{n&&Z(r)?t[i]=Ln(r,n):t[i]=r},{allOwnKeys:s}),t),Hi=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),zi=(t,e,n,s)=>{t.prototype=Object.create(e.prototype,s),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),n&&Object.assign(t.prototype,n)},Zi=(t,e,n,s)=>{let r,i,o;const a={};if(e=e||{},t==null)return e;do{for(r=Object.getOwnPropertyNames(t),i=r.length;i-- >0;)o=r[i],(!s||s(o,t,e))&&!a[o]&&(e[o]=t[o],a[o]=!0);t=n!==!1&&Ft(t)}while(t&&(!n||n(t,e))&&t!==Object.prototype);return e},ji=(t,e,n)=>{t=String(t),(n===void 0||n>t.length)&&(n=t.length),n-=e.length;const s=t.indexOf(e,n);return s!==-1&&s===n},Yi=t=>{if(!t)return null;if(Te(t))return t;let e=t.length;if(!Fn(e))return null;const n=new Array(e);for(;e-- >0;)n[e]=t[e];return n},Ji=(t=>e=>t&&e instanceof t)(typeof Uint8Array<"u"&&Ft(Uint8Array)),Gi=(t,e)=>{const s=(t&&t[Symbol.iterator]).call(t);let r;for(;(r=s.next())&&!r.done;){const i=r.value;e.call(t,i[0],i[1])}},Ki=(t,e)=>{let n;const s=[];for(;(n=t.exec(e))!==null;)s.push(n);return s},Xi=re("HTMLFormElement"),Qi=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,s,r){return s.toUpperCase()+r}),Pn=(({hasOwnProperty:t})=>(e,n)=>t.call(e,n))(Object.prototype),eo=re("RegExp"),Wn=(t,e)=>{const n=Object.getOwnPropertyDescriptors(t),s={};Pe(n,(r,i)=>{e(r,i,t)!==!1&&(s[i]=r)}),Object.defineProperties(t,s)},to=t=>{Wn(t,(e,n)=>{if(Z(t)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const s=t[n];if(Z(s)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},no=(t,e)=>{const n={},s=r=>{r.forEach(i=>{n[i]=!0})};return Te(t)?s(t):s(String(t).split(e)),n},so=()=>{},ro=(t,e)=>(t=+t,Number.isFinite(t)?t:e),$t="abcdefghijklmnopqrstuvwxyz",qn="0123456789",Hn={DIGIT:qn,ALPHA:$t,ALPHA_DIGIT:$t+$t.toUpperCase()+qn},io=(t=16,e=Hn.ALPHA_DIGIT)=>{let n="";const{length:s}=e;for(;t--;)n+=e[Math.random()*s|0];return n};function oo(t){return!!(t&&Z(t.append)&&t[Symbol.toStringTag]==="FormData"&&t[Symbol.iterator])}const ao=t=>{const e=new Array(10),n=(s,r)=>{if(rt(s)){if(e.indexOf(s)>=0)return;if(!("toJSON"in s)){e[r]=s;const i=Te(s)?[]:{};return Pe(s,(o,a)=>{const l=n(o,r+1);!Ue(l)&&(i[a]=l)}),e[r]=void 0,i}}return s};return n(t,0)},co=re("AsyncFunction"),h={isArray:Te,isArrayBuffer:Vn,isBuffer:Mi,isFormData:Ui,isArrayBufferView:Ri,isString:Di,isNumber:Fn,isBoolean:Ii,isObject:rt,isPlainObject:it,isUndefined:Ue,isDate:Li,isFile:Vi,isBlob:Fi,isRegExp:eo,isFunction:Z,isStream:$i,isURLSearchParams:Pi,isTypedArray:Ji,isFileList:Bi,forEach:Pe,merge:Bt,extend:qi,trim:Wi,stripBOM:Hi,inherits:zi,toFlatObject:Zi,kindOf:nt,kindOfTest:re,endsWith:ji,toArray:Yi,forEachEntry:Gi,matchAll:Ki,isHTMLForm:Xi,hasOwnProperty:Pn,hasOwnProp:Pn,reduceDescriptors:Wn,freezeMethods:to,toObjectSet:no,toCamelCase:Qi,noop:so,toFiniteNumber:ro,findKey:Bn,global:$n,isContextDefined:Un,ALPHABET:Hn,generateString:io,isSpecCompliantForm:oo,toJSONObject:ao,isAsyncFn:co,isThenable:t=>t&&(rt(t)||Z(t))&&Z(t.then)&&Z(t.catch)};function b(t,e,n,s,r){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=t,this.name="AxiosError",e&&(this.code=e),n&&(this.config=n),s&&(this.request=s),r&&(this.response=r)}h.inherits(b,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:h.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const zn=b.prototype,Zn={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(t=>{Zn[t]={value:t}}),Object.defineProperties(b,Zn),Object.defineProperty(zn,"isAxiosError",{value:!0}),b.from=(t,e,n,s,r,i)=>{const o=Object.create(zn);return h.toFlatObject(t,o,function(l){return l!==Error.prototype},a=>a!=="isAxiosError"),b.call(o,t.message,e,n,s,r),o.cause=t,o.name=t.name,i&&Object.assign(o,i),o};const lo=null;function Ut(t){return h.isPlainObject(t)||h.isArray(t)}function jn(t){return h.endsWith(t,"[]")?t.slice(0,-2):t}function Yn(t,e,n){return t?t.concat(e).map(function(r,i){return r=jn(r),!n&&i?"["+r+"]":r}).join(n?".":""):e}function uo(t){return h.isArray(t)&&!t.some(Ut)}const fo=h.toFlatObject(h,{},null,function(e){return/^is[A-Z]/.test(e)});function ot(t,e,n){if(!h.isObject(t))throw new TypeError("target must be an object");e=e||new FormData,n=h.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(g,x){return!h.isUndefined(x[g])});const s=n.metaTokens,r=n.visitor||f,i=n.dots,o=n.indexes,l=(n.Blob||typeof Blob<"u"&&Blob)&&h.isSpecCompliantForm(e);if(!h.isFunction(r))throw new TypeError("visitor must be a function");function c(p){if(p===null)return"";if(h.isDate(p))return p.toISOString();if(!l&&h.isBlob(p))throw new b("Blob is not supported. Use a Buffer instead.");return h.isArrayBuffer(p)||h.isTypedArray(p)?l&&typeof Blob=="function"?new Blob([p]):Buffer.from(p):p}function f(p,g,x){let C=p;if(p&&!x&&typeof p=="object"){if(h.endsWith(g,"{}"))g=s?g:g.slice(0,-2),p=JSON.stringify(p);else if(h.isArray(p)&&uo(p)||(h.isFileList(p)||h.endsWith(g,"[]"))&&(C=h.toArray(p)))return g=jn(g),C.forEach(function(le,S){!(h.isUndefined(le)||le===null)&&e.append(o===!0?Yn([g],S,i):o===null?g:g+"[]",c(le))}),!1}return Ut(p)?!0:(e.append(Yn(x,g,i),c(p)),!1)}const d=[],w=Object.assign(fo,{defaultVisitor:f,convertValue:c,isVisitable:Ut});function m(p,g){if(!h.isUndefined(p)){if(d.indexOf(p)!==-1)throw Error("Circular reference detected in "+g.join("."));d.push(p),h.forEach(p,function(C,R){(!(h.isUndefined(C)||C===null)&&r.call(e,C,h.isString(R)?R.trim():R,g,w))===!0&&m(C,g?g.concat(R):[R])}),d.pop()}}if(!h.isObject(t))throw new TypeError("data must be an object");return m(t),e}function Jn(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(s){return e[s]})}function Pt(t,e){this._pairs=[],t&&ot(t,this,e)}const Gn=Pt.prototype;Gn.append=function(e,n){this._pairs.push([e,n])},Gn.toString=function(e){const n=e?function(s){return e.call(this,s,Jn)}:Jn;return this._pairs.map(function(r){return n(r[0])+"="+n(r[1])},"").join("&")};function ho(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Kn(t,e,n){if(!e)return t;const s=n&&n.encode||ho,r=n&&n.serialize;let i;if(r?i=r(e,n):i=h.isURLSearchParams(e)?e.toString():new Pt(e,n).toString(s),i){const o=t.indexOf("#");o!==-1&&(t=t.slice(0,o)),t+=(t.indexOf("?")===-1?"?":"&")+i}return t}class Xn{constructor(){this.handlers=[]}use(e,n,s){return this.handlers.push({fulfilled:e,rejected:n,synchronous:s?s.synchronous:!1,runWhen:s?s.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){h.forEach(this.handlers,function(s){s!==null&&e(s)})}}const Qn={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},mo=typeof URLSearchParams<"u"?URLSearchParams:Pt,po=typeof FormData<"u"?FormData:null,yo=typeof Blob<"u"?Blob:null,go=(()=>{let t;return typeof navigator<"u"&&((t=navigator.product)==="ReactNative"||t==="NativeScript"||t==="NS")?!1:typeof window<"u"&&typeof document<"u"})(),wo=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",ie={isBrowser:!0,classes:{URLSearchParams:mo,FormData:po,Blob:yo},isStandardBrowserEnv:go,isStandardBrowserWebWorkerEnv:wo,protocols:["http","https","file","blob","url","data"]};function Eo(t,e){return ot(t,new ie.classes.URLSearchParams,Object.assign({visitor:function(n,s,r,i){return ie.isNode&&h.isBuffer(n)?(this.append(s,n.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)}},e))}function ko(t){return h.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}function So(t){const e={},n=Object.keys(t);let s;const r=n.length;let i;for(s=0;s<r;s++)i=n[s],e[i]=t[i];return e}function es(t){function e(n,s,r,i){let o=n[i++];const a=Number.isFinite(+o),l=i>=n.length;return o=!o&&h.isArray(r)?r.length:o,l?(h.hasOwnProp(r,o)?r[o]=[r[o],s]:r[o]=s,!a):((!r[o]||!h.isObject(r[o]))&&(r[o]=[]),e(n,s,r[o],i)&&h.isArray(r[o])&&(r[o]=So(r[o])),!a)}if(h.isFormData(t)&&h.isFunction(t.entries)){const n={};return h.forEachEntry(t,(s,r)=>{e(ko(s),r,n,0)}),n}return null}const To={"Content-Type":void 0};function bo(t,e,n){if(h.isString(t))try{return(e||JSON.parse)(t),h.trim(t)}catch(s){if(s.name!=="SyntaxError")throw s}return(n||JSON.stringify)(t)}const be={transitional:Qn,adapter:["xhr","http"],transformRequest:[function(e,n){const s=n.getContentType()||"",r=s.indexOf("application/json")>-1,i=h.isObject(e);if(i&&h.isHTMLForm(e)&&(e=new FormData(e)),h.isFormData(e))return r&&r?JSON.stringify(es(e)):e;if(h.isArrayBuffer(e)||h.isBuffer(e)||h.isStream(e)||h.isFile(e)||h.isBlob(e))return e;if(h.isArrayBufferView(e))return e.buffer;if(h.isURLSearchParams(e))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let a;if(i){if(s.indexOf("application/x-www-form-urlencoded")>-1)return Eo(e,this.formSerializer).toString();if((a=h.isFileList(e))||s.indexOf("multipart/form-data")>-1){const l=this.env&&this.env.FormData;return ot(a?{"files[]":e}:e,l&&new l,this.formSerializer)}}return i||r?(n.setContentType("application/json",!1),bo(e)):e}],transformResponse:[function(e){const n=this.transitional||be.transitional,s=n&&n.forcedJSONParsing,r=this.responseType==="json";if(e&&h.isString(e)&&(s&&!this.responseType||r)){const o=!(n&&n.silentJSONParsing)&&r;try{return JSON.parse(e)}catch(a){if(o)throw a.name==="SyntaxError"?b.from(a,b.ERR_BAD_RESPONSE,this,null,this.response):a}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:ie.classes.FormData,Blob:ie.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};h.forEach(["delete","get","head"],function(e){be.headers[e]={}}),h.forEach(["post","put","patch"],function(e){be.headers[e]=h.merge(To)});const Oo=h.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),No=t=>{const e={};let n,s,r;return t&&t.split(`
2
- `).forEach(function(o){r=o.indexOf(":"),n=o.substring(0,r).trim().toLowerCase(),s=o.substring(r+1).trim(),!(!n||e[n]&&Oo[n])&&(n==="set-cookie"?e[n]?e[n].push(s):e[n]=[s]:e[n]=e[n]?e[n]+", "+s:s)}),e},ts=Symbol("internals");function We(t){return t&&String(t).trim().toLowerCase()}function at(t){return t===!1||t==null?t:h.isArray(t)?t.map(at):String(t)}function Co(t){const e=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let s;for(;s=n.exec(t);)e[s[1]]=s[2];return e}const vo=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());function Wt(t,e,n,s,r){if(h.isFunction(s))return s.call(this,e,n);if(r&&(e=n),!!h.isString(e)){if(h.isString(s))return e.indexOf(s)!==-1;if(h.isRegExp(s))return s.test(e)}}function _o(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,n,s)=>n.toUpperCase()+s)}function xo(t,e){const n=h.toCamelCase(" "+e);["get","set","has"].forEach(s=>{Object.defineProperty(t,s+n,{value:function(r,i,o){return this[s].call(this,e,r,i,o)},configurable:!0})})}class j{constructor(e){e&&this.set(e)}set(e,n,s){const r=this;function i(a,l,c){const f=We(l);if(!f)throw new Error("header name must be a non-empty string");const d=h.findKey(r,f);(!d||r[d]===void 0||c===!0||c===void 0&&r[d]!==!1)&&(r[d||l]=at(a))}const o=(a,l)=>h.forEach(a,(c,f)=>i(c,f,l));return h.isPlainObject(e)||e instanceof this.constructor?o(e,n):h.isString(e)&&(e=e.trim())&&!vo(e)?o(No(e),n):e!=null&&i(n,e,s),this}get(e,n){if(e=We(e),e){const s=h.findKey(this,e);if(s){const r=this[s];if(!n)return r;if(n===!0)return Co(r);if(h.isFunction(n))return n.call(this,r,s);if(h.isRegExp(n))return n.exec(r);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,n){if(e=We(e),e){const s=h.findKey(this,e);return!!(s&&this[s]!==void 0&&(!n||Wt(this,this[s],s,n)))}return!1}delete(e,n){const s=this;let r=!1;function i(o){if(o=We(o),o){const a=h.findKey(s,o);a&&(!n||Wt(s,s[a],a,n))&&(delete s[a],r=!0)}}return h.isArray(e)?e.forEach(i):i(e),r}clear(e){const n=Object.keys(this);let s=n.length,r=!1;for(;s--;){const i=n[s];(!e||Wt(this,this[i],i,e,!0))&&(delete this[i],r=!0)}return r}normalize(e){const n=this,s={};return h.forEach(this,(r,i)=>{const o=h.findKey(s,i);if(o){n[o]=at(r),delete n[i];return}const a=e?_o(i):String(i).trim();a!==i&&delete n[i],n[a]=at(r),s[a]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const n=Object.create(null);return h.forEach(this,(s,r)=>{s!=null&&s!==!1&&(n[r]=e&&h.isArray(s)?s.join(", "):s)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,n])=>e+": "+n).join(`
3
- `)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...n){const s=new this(e);return n.forEach(r=>s.set(r)),s}static accessor(e){const s=(this[ts]=this[ts]={accessors:{}}).accessors,r=this.prototype;function i(o){const a=We(o);s[a]||(xo(r,o),s[a]=!0)}return h.isArray(e)?e.forEach(i):i(e),this}}j.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),h.freezeMethods(j.prototype),h.freezeMethods(j);function qt(t,e){const n=this||be,s=e||n,r=j.from(s.headers);let i=s.data;return h.forEach(t,function(a){i=a.call(n,i,r.normalize(),e?e.status:void 0)}),r.normalize(),i}function ns(t){return!!(t&&t.__CANCEL__)}function qe(t,e,n){b.call(this,t??"canceled",b.ERR_CANCELED,e,n),this.name="CanceledError"}h.inherits(qe,b,{__CANCEL__:!0});function Ao(t,e,n){const s=n.config.validateStatus;!n.status||!s||s(n.status)?t(n):e(new b("Request failed with status code "+n.status,[b.ERR_BAD_REQUEST,b.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}const Mo=ie.isStandardBrowserEnv?function(){return{write:function(n,s,r,i,o,a){const l=[];l.push(n+"="+encodeURIComponent(s)),h.isNumber(r)&&l.push("expires="+new Date(r).toGMTString()),h.isString(i)&&l.push("path="+i),h.isString(o)&&l.push("domain="+o),a===!0&&l.push("secure"),document.cookie=l.join("; ")},read:function(n){const s=document.cookie.match(new RegExp("(^|;\\s*)("+n+")=([^;]*)"));return s?decodeURIComponent(s[3]):null},remove:function(n){this.write(n,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}();function Ro(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function Do(t,e){return e?t.replace(/\/+$/,"")+"/"+e.replace(/^\/+/,""):t}function ss(t,e){return t&&!Ro(e)?Do(t,e):e}const Io=ie.isStandardBrowserEnv?function(){const e=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");let s;function r(i){let o=i;return e&&(n.setAttribute("href",o),o=n.href),n.setAttribute("href",o),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:n.pathname.charAt(0)==="/"?n.pathname:"/"+n.pathname}}return s=r(window.location.href),function(o){const a=h.isString(o)?r(o):o;return a.protocol===s.protocol&&a.host===s.host}}():function(){return function(){return!0}}();function Lo(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function Vo(t,e){t=t||10;const n=new Array(t),s=new Array(t);let r=0,i=0,o;return e=e!==void 0?e:1e3,function(l){const c=Date.now(),f=s[i];o||(o=c),n[r]=l,s[r]=c;let d=i,w=0;for(;d!==r;)w+=n[d++],d=d%t;if(r=(r+1)%t,r===i&&(i=(i+1)%t),c-o<e)return;const m=f&&c-f;return m?Math.round(w*1e3/m):void 0}}function rs(t,e){let n=0;const s=Vo(50,250);return r=>{const i=r.loaded,o=r.lengthComputable?r.total:void 0,a=i-n,l=s(a),c=i<=o;n=i;const f={loaded:i,total:o,progress:o?i/o:void 0,bytes:a,rate:l||void 0,estimated:l&&o&&c?(o-i)/l:void 0,event:r};f[e?"download":"upload"]=!0,t(f)}}const ct={http:lo,xhr:typeof XMLHttpRequest<"u"&&function(t){return new Promise(function(n,s){let r=t.data;const i=j.from(t.headers).normalize(),o=t.responseType;let a;function l(){t.cancelToken&&t.cancelToken.unsubscribe(a),t.signal&&t.signal.removeEventListener("abort",a)}h.isFormData(r)&&(ie.isStandardBrowserEnv||ie.isStandardBrowserWebWorkerEnv?i.setContentType(!1):i.setContentType("multipart/form-data;",!1));let c=new XMLHttpRequest;if(t.auth){const m=t.auth.username||"",p=t.auth.password?unescape(encodeURIComponent(t.auth.password)):"";i.set("Authorization","Basic "+btoa(m+":"+p))}const f=ss(t.baseURL,t.url);c.open(t.method.toUpperCase(),Kn(f,t.params,t.paramsSerializer),!0),c.timeout=t.timeout;function d(){if(!c)return;const m=j.from("getAllResponseHeaders"in c&&c.getAllResponseHeaders()),g={data:!o||o==="text"||o==="json"?c.responseText:c.response,status:c.status,statusText:c.statusText,headers:m,config:t,request:c};Ao(function(C){n(C),l()},function(C){s(C),l()},g),c=null}if("onloadend"in c?c.onloadend=d:c.onreadystatechange=function(){!c||c.readyState!==4||c.status===0&&!(c.responseURL&&c.responseURL.indexOf("file:")===0)||setTimeout(d)},c.onabort=function(){c&&(s(new b("Request aborted",b.ECONNABORTED,t,c)),c=null)},c.onerror=function(){s(new b("Network Error",b.ERR_NETWORK,t,c)),c=null},c.ontimeout=function(){let p=t.timeout?"timeout of "+t.timeout+"ms exceeded":"timeout exceeded";const g=t.transitional||Qn;t.timeoutErrorMessage&&(p=t.timeoutErrorMessage),s(new b(p,g.clarifyTimeoutError?b.ETIMEDOUT:b.ECONNABORTED,t,c)),c=null},ie.isStandardBrowserEnv){const m=(t.withCredentials||Io(f))&&t.xsrfCookieName&&Mo.read(t.xsrfCookieName);m&&i.set(t.xsrfHeaderName,m)}r===void 0&&i.setContentType(null),"setRequestHeader"in c&&h.forEach(i.toJSON(),function(p,g){c.setRequestHeader(g,p)}),h.isUndefined(t.withCredentials)||(c.withCredentials=!!t.withCredentials),o&&o!=="json"&&(c.responseType=t.responseType),typeof t.onDownloadProgress=="function"&&c.addEventListener("progress",rs(t.onDownloadProgress,!0)),typeof t.onUploadProgress=="function"&&c.upload&&c.upload.addEventListener("progress",rs(t.onUploadProgress)),(t.cancelToken||t.signal)&&(a=m=>{c&&(s(!m||m.type?new qe(null,t,c):m),c.abort(),c=null)},t.cancelToken&&t.cancelToken.subscribe(a),t.signal&&(t.signal.aborted?a():t.signal.addEventListener("abort",a)));const w=Lo(f);if(w&&ie.protocols.indexOf(w)===-1){s(new b("Unsupported protocol "+w+":",b.ERR_BAD_REQUEST,t));return}c.send(r||null)})}};h.forEach(ct,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch{}Object.defineProperty(t,"adapterName",{value:e})}});const Fo={getAdapter:t=>{t=h.isArray(t)?t:[t];const{length:e}=t;let n,s;for(let r=0;r<e&&(n=t[r],!(s=h.isString(n)?ct[n.toLowerCase()]:n));r++);if(!s)throw s===!1?new b(`Adapter ${n} is not supported by the environment`,"ERR_NOT_SUPPORT"):new Error(h.hasOwnProp(ct,n)?`Adapter '${n}' is not available in the build`:`Unknown adapter '${n}'`);if(!h.isFunction(s))throw new TypeError("adapter is not a function");return s},adapters:ct};function Ht(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new qe(null,t)}function is(t){return Ht(t),t.headers=j.from(t.headers),t.data=qt.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),Fo.getAdapter(t.adapter||be.adapter)(t).then(function(s){return Ht(t),s.data=qt.call(t,t.transformResponse,s),s.headers=j.from(s.headers),s},function(s){return ns(s)||(Ht(t),s&&s.response&&(s.response.data=qt.call(t,t.transformResponse,s.response),s.response.headers=j.from(s.response.headers))),Promise.reject(s)})}const os=t=>t instanceof j?t.toJSON():t;function Oe(t,e){e=e||{};const n={};function s(c,f,d){return h.isPlainObject(c)&&h.isPlainObject(f)?h.merge.call({caseless:d},c,f):h.isPlainObject(f)?h.merge({},f):h.isArray(f)?f.slice():f}function r(c,f,d){if(h.isUndefined(f)){if(!h.isUndefined(c))return s(void 0,c,d)}else return s(c,f,d)}function i(c,f){if(!h.isUndefined(f))return s(void 0,f)}function o(c,f){if(h.isUndefined(f)){if(!h.isUndefined(c))return s(void 0,c)}else return s(void 0,f)}function a(c,f,d){if(d in e)return s(c,f);if(d in t)return s(void 0,c)}const l={url:i,method:i,data:i,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:a,headers:(c,f)=>r(os(c),os(f),!0)};return h.forEach(Object.keys(Object.assign({},t,e)),function(f){const d=l[f]||r,w=d(t[f],e[f],f);h.isUndefined(w)&&d!==a||(n[f]=w)}),n}const as="1.4.0",zt={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{zt[t]=function(s){return typeof s===t||"a"+(e<1?"n ":" ")+t}});const cs={};zt.transitional=function(e,n,s){function r(i,o){return"[Axios v"+as+"] Transitional option '"+i+"'"+o+(s?". "+s:"")}return(i,o,a)=>{if(e===!1)throw new b(r(o," has been removed"+(n?" in "+n:"")),b.ERR_DEPRECATED);return n&&!cs[o]&&(cs[o]=!0,console.warn(r(o," has been deprecated since v"+n+" and will be removed in the near future"))),e?e(i,o,a):!0}};function Bo(t,e,n){if(typeof t!="object")throw new b("options must be an object",b.ERR_BAD_OPTION_VALUE);const s=Object.keys(t);let r=s.length;for(;r-- >0;){const i=s[r],o=e[i];if(o){const a=t[i],l=a===void 0||o(a,i,t);if(l!==!0)throw new b("option "+i+" must be "+l,b.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new b("Unknown option "+i,b.ERR_BAD_OPTION)}}const Zt={assertOptions:Bo,validators:zt},fe=Zt.validators;class ge{constructor(e){this.defaults=e,this.interceptors={request:new Xn,response:new Xn}}request(e,n){typeof e=="string"?(n=n||{},n.url=e):n=e||{},n=Oe(this.defaults,n);const{transitional:s,paramsSerializer:r,headers:i}=n;s!==void 0&&Zt.assertOptions(s,{silentJSONParsing:fe.transitional(fe.boolean),forcedJSONParsing:fe.transitional(fe.boolean),clarifyTimeoutError:fe.transitional(fe.boolean)},!1),r!=null&&(h.isFunction(r)?n.paramsSerializer={serialize:r}:Zt.assertOptions(r,{encode:fe.function,serialize:fe.function},!0)),n.method=(n.method||this.defaults.method||"get").toLowerCase();let o;o=i&&h.merge(i.common,i[n.method]),o&&h.forEach(["delete","get","head","post","put","patch","common"],p=>{delete i[p]}),n.headers=j.concat(o,i);const a=[];let l=!0;this.interceptors.request.forEach(function(g){typeof g.runWhen=="function"&&g.runWhen(n)===!1||(l=l&&g.synchronous,a.unshift(g.fulfilled,g.rejected))});const c=[];this.interceptors.response.forEach(function(g){c.push(g.fulfilled,g.rejected)});let f,d=0,w;if(!l){const p=[is.bind(this),void 0];for(p.unshift.apply(p,a),p.push.apply(p,c),w=p.length,f=Promise.resolve(n);d<w;)f=f.then(p[d++],p[d++]);return f}w=a.length;let m=n;for(d=0;d<w;){const p=a[d++],g=a[d++];try{m=p(m)}catch(x){g.call(this,x);break}}try{f=is.call(this,m)}catch(p){return Promise.reject(p)}for(d=0,w=c.length;d<w;)f=f.then(c[d++],c[d++]);return f}getUri(e){e=Oe(this.defaults,e);const n=ss(e.baseURL,e.url);return Kn(n,e.params,e.paramsSerializer)}}h.forEach(["delete","get","head","options"],function(e){ge.prototype[e]=function(n,s){return this.request(Oe(s||{},{method:e,url:n,data:(s||{}).data}))}}),h.forEach(["post","put","patch"],function(e){function n(s){return function(i,o,a){return this.request(Oe(a||{},{method:e,headers:s?{"Content-Type":"multipart/form-data"}:{},url:i,data:o}))}}ge.prototype[e]=n(),ge.prototype[e+"Form"]=n(!0)});class jt{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(i){n=i});const s=this;this.promise.then(r=>{if(!s._listeners)return;let i=s._listeners.length;for(;i-- >0;)s._listeners[i](r);s._listeners=null}),this.promise.then=r=>{let i;const o=new Promise(a=>{s.subscribe(a),i=a}).then(r);return o.cancel=function(){s.unsubscribe(i)},o},e(function(i,o,a){s.reason||(s.reason=new qe(i,o,a),n(s.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const n=this._listeners.indexOf(e);n!==-1&&this._listeners.splice(n,1)}static source(){let e;return{token:new jt(function(r){e=r}),cancel:e}}}function $o(t){return function(n){return t.apply(null,n)}}function Uo(t){return h.isObject(t)&&t.isAxiosError===!0}const Yt={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Yt).forEach(([t,e])=>{Yt[e]=t});function ls(t){const e=new ge(t),n=Ln(ge.prototype.request,e);return h.extend(n,ge.prototype,e,{allOwnKeys:!0}),h.extend(n,e,null,{allOwnKeys:!0}),n.create=function(r){return ls(Oe(t,r))},n}const L=ls(be);L.Axios=ge,L.CanceledError=qe,L.CancelToken=jt,L.isCancel=ns,L.VERSION=as,L.toFormData=ot,L.AxiosError=b,L.Cancel=L.CanceledError,L.all=function(e){return Promise.all(e)},L.spread=$o,L.isAxiosError=Uo,L.mergeConfig=Oe,L.AxiosHeaders=j,L.formToJSON=t=>es(h.isHTMLForm(t)?new FormData(t):t),L.HttpStatusCode=Yt,L.default=L;const lt=async function(t){const e=t,n=window.VITE_BACKEND_URL?window.VITE_BACKEND_URL:"https://chatadmin-gw.dev.mp.gob.bo",s={method:e.method,url:`${n}${e.url}`,headers:{Authorization:`Bearer ${t.token}`,"Content-Type":"application/json; charset=utf-8",...e.headers},data:e.data};return await L(s).then(async function(r){return await r.data}).catch(async function(r){console.error(r);const i=await r.response.data;if(i.statusCode==401&&i.message=="Unauthorized")localStorage.clear();else throw i})};async function Po(t){const e={url:"/v1/message/list-messages",method:"post",data:t.body,token:t.token},n=await lt(e).catch(r=>(console.error(r),null)),s=n==null?void 0:n.response;return s!=null&&s.data?{data:s.data,pagination:s.pagination}:{data:[],pagination:{total:0,limit:0,size:0}}}async function Wo(t,e){var r;const s=await lt({url:"/v1/message/send-message",method:"POST",data:t,token:e}).catch(i=>(console.error(i),null));return(r=s==null?void 0:s.response)==null?void 0:r.data}async function us(t){var s;const n=await lt({url:"/v1/app-chats/web-chat",method:"get",token:t}).catch(r=>(console.error(r),null));return(s=n==null?void 0:n.response)==null?void 0:s.data}async function fs(t,e){var i;const n={esCliente:!0,totalNoVistos:0,totalNoVistosCliente:0},s={url:`/v1/app-chats/update-vistos/${t}`,method:"PATCH",data:n,token:e},r=await lt(s).catch(o=>(console.error(o),null));return(i=r==null?void 0:r.response)==null?void 0:i.data}function qo(t){return u.getCurrentScope()?(u.onScopeDispose(t),!0):!1}function hs(t){return typeof t=="function"?t():u.unref(t)}const Ho=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const zo=t=>t!=null,Jt=()=>{};function Gt(t){var e;const n=hs(t);return(e=n==null?void 0:n.$el)!=null?e:n}const Zo=Ho?window:void 0;function jo(){const t=u.ref(!1),e=u.getCurrentInstance();return e&&u.onMounted(()=>{t.value=!0},e),t}function Yo(t){const e=jo();return u.computed(()=>(e.value,!!t()))}function Jo(t,e,n={}){const{root:s,rootMargin:r="0px",threshold:i=.1,window:o=Zo,immediate:a=!0}=n,l=Yo(()=>o&&"IntersectionObserver"in o),c=u.computed(()=>{const p=hs(t);return(Array.isArray(p)?p:[p]).map(Gt).filter(zo)});let f=Jt;const d=u.ref(a),w=l.value?u.watch(()=>[c.value,Gt(s),d.value],([p,g])=>{if(f(),!d.value||!p.length)return;const x=new IntersectionObserver(e,{root:Gt(g),rootMargin:r,threshold:i});p.forEach(C=>C&&x.observe(C)),f=()=>{x.disconnect(),f=Jt}},{immediate:a,flush:"post"}):Jt,m=()=>{f(),w(),d.value=!1};return qo(m),{isSupported:l,isActive:d,pause(){f(),d.value=!1},resume(){d.value=!0},stop:m}}class we extends Error{}class Go extends we{constructor(e){super(`Invalid DateTime: ${e.toMessage()}`)}}class Ko extends we{constructor(e){super(`Invalid Interval: ${e.toMessage()}`)}}class Xo extends we{constructor(e){super(`Invalid Duration: ${e.toMessage()}`)}}class Ne extends we{}class ds extends we{constructor(e){super(`Invalid unit ${e}`)}}class U extends we{}class he extends we{constructor(){super("Zone is an abstract class")}}const y="numeric",Q="short",H="long",ut={year:y,month:y,day:y},ms={year:y,month:Q,day:y},Qo={year:y,month:Q,day:y,weekday:Q},ps={year:y,month:H,day:y},ys={year:y,month:H,day:y,weekday:H},gs={hour:y,minute:y},ws={hour:y,minute:y,second:y},Es={hour:y,minute:y,second:y,timeZoneName:Q},ks={hour:y,minute:y,second:y,timeZoneName:H},Ss={hour:y,minute:y,hourCycle:"h23"},Ts={hour:y,minute:y,second:y,hourCycle:"h23"},bs={hour:y,minute:y,second:y,hourCycle:"h23",timeZoneName:Q},Os={hour:y,minute:y,second:y,hourCycle:"h23",timeZoneName:H},Ns={year:y,month:y,day:y,hour:y,minute:y},Cs={year:y,month:y,day:y,hour:y,minute:y,second:y},vs={year:y,month:Q,day:y,hour:y,minute:y},_s={year:y,month:Q,day:y,hour:y,minute:y,second:y},ea={year:y,month:Q,day:y,weekday:Q,hour:y,minute:y},xs={year:y,month:H,day:y,hour:y,minute:y,timeZoneName:Q},As={year:y,month:H,day:y,hour:y,minute:y,second:y,timeZoneName:Q},Ms={year:y,month:H,day:y,weekday:H,hour:y,minute:y,timeZoneName:H},Rs={year:y,month:H,day:y,weekday:H,hour:y,minute:y,second:y,timeZoneName:H};class He{get type(){throw new he}get name(){throw new he}get ianaName(){return this.name}get isUniversal(){throw new he}offsetName(e,n){throw new he}formatOffset(e,n){throw new he}offset(e){throw new he}equals(e){throw new he}get isValid(){throw new he}}let Kt=null;class ft extends He{static get instance(){return Kt===null&&(Kt=new ft),Kt}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(e,{format:n,locale:s}){return sr(e,n,s)}formatOffset(e,n){return Ye(this.offset(e),n)}offset(e){return-new Date(e).getTimezoneOffset()}equals(e){return e.type==="system"}get isValid(){return!0}}let ht={};function ta(t){return ht[t]||(ht[t]=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:t,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"})),ht[t]}const na={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function sa(t,e){const n=t.format(e).replace(/\u200E/g,""),s=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(n),[,r,i,o,a,l,c,f]=s;return[o,r,i,a,l,c,f]}function ra(t,e){const n=t.formatToParts(e),s=[];for(let r=0;r<n.length;r++){const{type:i,value:o}=n[r],a=na[i];i==="era"?s[a]=o:E(a)||(s[a]=parseInt(o,10))}return s}let dt={};class ce extends He{static create(e){return dt[e]||(dt[e]=new ce(e)),dt[e]}static resetCache(){dt={},ht={}}static isValidSpecifier(e){return this.isValidZone(e)}static isValidZone(e){if(!e)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:e}).format(),!0}catch{return!1}}constructor(e){super(),this.zoneName=e,this.valid=ce.isValidZone(e)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(e,{format:n,locale:s}){return sr(e,n,s,this.name)}formatOffset(e,n){return Ye(this.offset(e),n)}offset(e){const n=new Date(e);if(isNaN(n))return NaN;const s=ta(this.name);let[r,i,o,a,l,c,f]=s.formatToParts?ra(s,n):sa(s,n);a==="BC"&&(r=-Math.abs(r)+1);const w=wt({year:r,month:i,day:o,hour:l===24?0:l,minute:c,second:f,millisecond:0});let m=+n;const p=m%1e3;return m-=p>=0?p:1e3+p,(w-m)/(60*1e3)}equals(e){return e.type==="iana"&&e.name===this.name}get isValid(){return this.valid}}let Ds={};function ia(t,e={}){const n=JSON.stringify([t,e]);let s=Ds[n];return s||(s=new Intl.ListFormat(t,e),Ds[n]=s),s}let Xt={};function Qt(t,e={}){const n=JSON.stringify([t,e]);let s=Xt[n];return s||(s=new Intl.DateTimeFormat(t,e),Xt[n]=s),s}let en={};function oa(t,e={}){const n=JSON.stringify([t,e]);let s=en[n];return s||(s=new Intl.NumberFormat(t,e),en[n]=s),s}let tn={};function aa(t,e={}){const{base:n,...s}=e,r=JSON.stringify([t,s]);let i=tn[r];return i||(i=new Intl.RelativeTimeFormat(t,e),tn[r]=i),i}let ze=null;function ca(){return ze||(ze=new Intl.DateTimeFormat().resolvedOptions().locale,ze)}let Is={};function la(t){let e=Is[t];if(!e){const n=new Intl.Locale(t);e="getWeekInfo"in n?n.getWeekInfo():n.weekInfo,Is[t]=e}return e}function ua(t){const e=t.indexOf("-x-");e!==-1&&(t=t.substring(0,e));const n=t.indexOf("-u-");if(n===-1)return[t];{let s,r;try{s=Qt(t).resolvedOptions(),r=t}catch{const l=t.substring(0,n);s=Qt(l).resolvedOptions(),r=l}const{numberingSystem:i,calendar:o}=s;return[r,i,o]}}function fa(t,e,n){return(n||e)&&(t.includes("-u-")||(t+="-u"),n&&(t+=`-ca-${n}`),e&&(t+=`-nu-${e}`)),t}function ha(t){const e=[];for(let n=1;n<=12;n++){const s=k.utc(2009,n,1);e.push(t(s))}return e}function da(t){const e=[];for(let n=1;n<=7;n++){const s=k.utc(2016,11,13+n);e.push(t(s))}return e}function mt(t,e,n,s){const r=t.listingMode();return r==="error"?null:r==="en"?n(e):s(e)}function ma(t){return t.numberingSystem&&t.numberingSystem!=="latn"?!1:t.numberingSystem==="latn"||!t.locale||t.locale.startsWith("en")||new Intl.DateTimeFormat(t.intl).resolvedOptions().numberingSystem==="latn"}class pa{constructor(e,n,s){this.padTo=s.padTo||0,this.floor=s.floor||!1;const{padTo:r,floor:i,...o}=s;if(!n||Object.keys(o).length>0){const a={useGrouping:!1,...s};s.padTo>0&&(a.minimumIntegerDigits=s.padTo),this.inf=oa(e,a)}}format(e){if(this.inf){const n=this.floor?Math.floor(e):e;return this.inf.format(n)}else{const n=this.floor?Math.floor(e):un(e,3);return D(n,this.padTo)}}}class ya{constructor(e,n,s){this.opts=s,this.originalZone=void 0;let r;if(this.opts.timeZone)this.dt=e;else if(e.zone.type==="fixed"){const o=-1*(e.offset/60),a=o>=0?`Etc/GMT+${o}`:`Etc/GMT${o}`;e.offset!==0&&ce.create(a).valid?(r=a,this.dt=e):(r="UTC",this.dt=e.offset===0?e:e.setZone("UTC").plus({minutes:e.offset}),this.originalZone=e.zone)}else e.zone.type==="system"?this.dt=e:e.zone.type==="iana"?(this.dt=e,r=e.zone.name):(r="UTC",this.dt=e.setZone("UTC").plus({minutes:e.offset}),this.originalZone=e.zone);const i={...this.opts};i.timeZone=i.timeZone||r,this.dtf=Qt(n,i)}format(){return this.originalZone?this.formatToParts().map(({value:e})=>e).join(""):this.dtf.format(this.dt.toJSDate())}formatToParts(){const e=this.dtf.formatToParts(this.dt.toJSDate());return this.originalZone?e.map(n=>{if(n.type==="timeZoneName"){const s=this.originalZone.offsetName(this.dt.ts,{locale:this.dt.locale,format:this.opts.timeZoneName});return{...n,value:s}}else return n}):e}resolvedOptions(){return this.dtf.resolvedOptions()}}class ga{constructor(e,n,s){this.opts={style:"long",...s},!n&&Qs()&&(this.rtf=aa(e,s))}format(e,n){return this.rtf?this.rtf.format(e,n):Ua(n,e,this.opts.numeric,this.opts.style!=="long")}formatToParts(e,n){return this.rtf?this.rtf.formatToParts(e,n):[]}}const wa={firstDay:1,minimalDays:4,weekend:[6,7]};class _{static fromOpts(e){return _.create(e.locale,e.numberingSystem,e.outputCalendar,e.weekSettings,e.defaultToEN)}static create(e,n,s,r,i=!1){const o=e||A.defaultLocale,a=o||(i?"en-US":ca()),l=n||A.defaultNumberingSystem,c=s||A.defaultOutputCalendar,f=cn(r)||A.defaultWeekSettings;return new _(a,l,c,f,o)}static resetCache(){ze=null,Xt={},en={},tn={}}static fromObject({locale:e,numberingSystem:n,outputCalendar:s,weekSettings:r}={}){return _.create(e,n,s,r)}constructor(e,n,s,r,i){const[o,a,l]=ua(e);this.locale=o,this.numberingSystem=n||a||null,this.outputCalendar=s||l||null,this.weekSettings=r,this.intl=fa(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=i,this.fastNumbersCached=null}get fastNumbers(){return this.fastNumbersCached==null&&(this.fastNumbersCached=ma(this)),this.fastNumbersCached}listingMode(){const e=this.isEnglish(),n=(this.numberingSystem===null||this.numberingSystem==="latn")&&(this.outputCalendar===null||this.outputCalendar==="gregory");return e&&n?"en":"intl"}clone(e){return!e||Object.getOwnPropertyNames(e).length===0?this:_.create(e.locale||this.specifiedLocale,e.numberingSystem||this.numberingSystem,e.outputCalendar||this.outputCalendar,cn(e.weekSettings)||this.weekSettings,e.defaultToEN||!1)}redefaultToEN(e={}){return this.clone({...e,defaultToEN:!0})}redefaultToSystem(e={}){return this.clone({...e,defaultToEN:!1})}months(e,n=!1){return mt(this,e,or,()=>{const s=n?{month:e,day:"numeric"}:{month:e},r=n?"format":"standalone";return this.monthsCache[r][e]||(this.monthsCache[r][e]=ha(i=>this.extract(i,s,"month"))),this.monthsCache[r][e]})}weekdays(e,n=!1){return mt(this,e,lr,()=>{const s=n?{weekday:e,year:"numeric",month:"long",day:"numeric"}:{weekday:e},r=n?"format":"standalone";return this.weekdaysCache[r][e]||(this.weekdaysCache[r][e]=da(i=>this.extract(i,s,"weekday"))),this.weekdaysCache[r][e]})}meridiems(){return mt(this,void 0,()=>ur,()=>{if(!this.meridiemCache){const e={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[k.utc(2016,11,13,9),k.utc(2016,11,13,19)].map(n=>this.extract(n,e,"dayperiod"))}return this.meridiemCache})}eras(e){return mt(this,e,fr,()=>{const n={era:e};return this.eraCache[e]||(this.eraCache[e]=[k.utc(-40,1,1),k.utc(2017,1,1)].map(s=>this.extract(s,n,"era"))),this.eraCache[e]})}extract(e,n,s){const r=this.dtFormatter(e,n),i=r.formatToParts(),o=i.find(a=>a.type.toLowerCase()===s);return o?o.value:null}numberFormatter(e={}){return new pa(this.intl,e.forceSimple||this.fastNumbers,e)}dtFormatter(e,n={}){return new ya(e,this.intl,n)}relFormatter(e={}){return new ga(this.intl,this.isEnglish(),e)}listFormatter(e={}){return ia(this.intl,e)}isEnglish(){return this.locale==="en"||this.locale.toLowerCase()==="en-us"||new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith("en-us")}getWeekSettings(){return this.weekSettings?this.weekSettings:er()?la(this.locale):wa}getStartOfWeek(){return this.getWeekSettings().firstDay}getMinDaysInFirstWeek(){return this.getWeekSettings().minimalDays}getWeekendDays(){return this.getWeekSettings().weekend}equals(e){return this.locale===e.locale&&this.numberingSystem===e.numberingSystem&&this.outputCalendar===e.outputCalendar}toString(){return`Locale(${this.locale}, ${this.numberingSystem}, ${this.outputCalendar})`}}let nn=null;class W extends He{static get utcInstance(){return nn===null&&(nn=new W(0)),nn}static instance(e){return e===0?W.utcInstance:new W(e)}static parseSpecifier(e){if(e){const n=e.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(n)return new W(Et(n[1],n[2]))}return null}constructor(e){super(),this.fixed=e}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${Ye(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${Ye(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(e,n){return Ye(this.fixed,n)}get isUniversal(){return!0}offset(){return this.fixed}equals(e){return e.type==="fixed"&&e.fixed===this.fixed}get isValid(){return!0}}class Ea extends He{constructor(e){super(),this.zoneName=e}get type(){return"invalid"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(){return null}formatOffset(){return""}offset(){return NaN}equals(){return!1}get isValid(){return!1}}function de(t,e){if(E(t)||t===null)return e;if(t instanceof He)return t;if(Na(t)){const n=t.toLowerCase();return n==="default"?e:n==="local"||n==="system"?ft.instance:n==="utc"||n==="gmt"?W.utcInstance:W.parseSpecifier(n)||ce.create(t)}else return me(t)?W.instance(t):typeof t=="object"&&"offset"in t&&typeof t.offset=="function"?t:new Ea(t)}const sn={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},Ls={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},ka=sn.hanidec.replace(/[\[|\]]/g,"").split("");function Sa(t){let e=parseInt(t,10);if(isNaN(e)){e="";for(let n=0;n<t.length;n++){const s=t.charCodeAt(n);if(t[n].search(sn.hanidec)!==-1)e+=ka.indexOf(t[n]);else for(const r in Ls){const[i,o]=Ls[r];s>=i&&s<=o&&(e+=s-i)}}return parseInt(e,10)}else return e}let Ce={};function Ta(){Ce={}}function ee({numberingSystem:t},e=""){const n=t||"latn";return Ce[n]||(Ce[n]={}),Ce[n][e]||(Ce[n][e]=new RegExp(`${sn[n]}${e}`)),Ce[n][e]}let Vs=()=>Date.now(),Fs="system",Bs=null,$s=null,Us=null,Ps=60,Ws,qs=null;class A{static get now(){return Vs}static set now(e){Vs=e}static set defaultZone(e){Fs=e}static get defaultZone(){return de(Fs,ft.instance)}static get defaultLocale(){return Bs}static set defaultLocale(e){Bs=e}static get defaultNumberingSystem(){return $s}static set defaultNumberingSystem(e){$s=e}static get defaultOutputCalendar(){return Us}static set defaultOutputCalendar(e){Us=e}static get defaultWeekSettings(){return qs}static set defaultWeekSettings(e){qs=cn(e)}static get twoDigitCutoffYear(){return Ps}static set twoDigitCutoffYear(e){Ps=e%100}static get throwOnInvalid(){return Ws}static set throwOnInvalid(e){Ws=e}static resetCaches(){_.resetCache(),ce.resetCache(),k.resetCache(),Ta()}}class te{constructor(e,n){this.reason=e,this.explanation=n}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}const Hs=[0,31,59,90,120,151,181,212,243,273,304,334],zs=[0,31,60,91,121,152,182,213,244,274,305,335];function Y(t,e){return new te("unit out of range",`you specified ${e} (of type ${typeof e}) as a ${t}, which is invalid`)}function rn(t,e,n){const s=new Date(Date.UTC(t,e-1,n));t<100&&t>=0&&s.setUTCFullYear(s.getUTCFullYear()-1900);const r=s.getUTCDay();return r===0?7:r}function Zs(t,e,n){return n+(Ze(t)?zs:Hs)[e-1]}function js(t,e){const n=Ze(t)?zs:Hs,s=n.findIndex(i=>i<e),r=e-n[s];return{month:s+1,day:r}}function on(t,e){return(t-e+7)%7+1}function pt(t,e=4,n=1){const{year:s,month:r,day:i}=t,o=Zs(s,r,i),a=on(rn(s,r,i),n);let l=Math.floor((o-a+14-e)/7),c;return l<1?(c=s-1,l=je(c,e,n)):l>je(s,e,n)?(c=s+1,l=1):c=s,{weekYear:c,weekNumber:l,weekday:a,...St(t)}}function Ys(t,e=4,n=1){const{weekYear:s,weekNumber:r,weekday:i}=t,o=on(rn(s,1,e),n),a=_e(s);let l=r*7+i-o-7+e,c;l<1?(c=s-1,l+=_e(c)):l>a?(c=s+1,l-=_e(s)):c=s;const{month:f,day:d}=js(c,l);return{year:c,month:f,day:d,...St(t)}}function an(t){const{year:e,month:n,day:s}=t,r=Zs(e,n,s);return{year:e,ordinal:r,...St(t)}}function Js(t){const{year:e,ordinal:n}=t,{month:s,day:r}=js(e,n);return{year:e,month:s,day:r,...St(t)}}function Gs(t,e){if(!E(t.localWeekday)||!E(t.localWeekNumber)||!E(t.localWeekYear)){if(!E(t.weekday)||!E(t.weekNumber)||!E(t.weekYear))throw new Ne("Cannot mix locale-based week fields with ISO-based week fields");return E(t.localWeekday)||(t.weekday=t.localWeekday),E(t.localWeekNumber)||(t.weekNumber=t.localWeekNumber),E(t.localWeekYear)||(t.weekYear=t.localWeekYear),delete t.localWeekday,delete t.localWeekNumber,delete t.localWeekYear,{minDaysInFirstWeek:e.getMinDaysInFirstWeek(),startOfWeek:e.getStartOfWeek()}}else return{minDaysInFirstWeek:4,startOfWeek:1}}function ba(t,e=4,n=1){const s=yt(t.weekYear),r=J(t.weekNumber,1,je(t.weekYear,e,n)),i=J(t.weekday,1,7);return s?r?i?!1:Y("weekday",t.weekday):Y("week",t.weekNumber):Y("weekYear",t.weekYear)}function Oa(t){const e=yt(t.year),n=J(t.ordinal,1,_e(t.year));return e?n?!1:Y("ordinal",t.ordinal):Y("year",t.year)}function Ks(t){const e=yt(t.year),n=J(t.month,1,12),s=J(t.day,1,gt(t.year,t.month));return e?n?s?!1:Y("day",t.day):Y("month",t.month):Y("year",t.year)}function Xs(t){const{hour:e,minute:n,second:s,millisecond:r}=t,i=J(e,0,23)||e===24&&n===0&&s===0&&r===0,o=J(n,0,59),a=J(s,0,59),l=J(r,0,999);return i?o?a?l?!1:Y("millisecond",r):Y("second",s):Y("minute",n):Y("hour",e)}function E(t){return typeof t>"u"}function me(t){return typeof t=="number"}function yt(t){return typeof t=="number"&&t%1===0}function Na(t){return typeof t=="string"}function Ca(t){return Object.prototype.toString.call(t)==="[object Date]"}function Qs(){try{return typeof Intl<"u"&&!!Intl.RelativeTimeFormat}catch{return!1}}function er(){try{return typeof Intl<"u"&&!!Intl.Locale&&("weekInfo"in Intl.Locale.prototype||"getWeekInfo"in Intl.Locale.prototype)}catch{return!1}}function va(t){return Array.isArray(t)?t:[t]}function tr(t,e,n){if(t.length!==0)return t.reduce((s,r)=>{const i=[e(r),r];return s&&n(s[0],i[0])===s[0]?s:i},null)[1]}function _a(t,e){return e.reduce((n,s)=>(n[s]=t[s],n),{})}function ve(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function cn(t){if(t==null)return null;if(typeof t!="object")throw new U("Week settings must be an object");if(!J(t.firstDay,1,7)||!J(t.minimalDays,1,7)||!Array.isArray(t.weekend)||t.weekend.some(e=>!J(e,1,7)))throw new U("Invalid week settings");return{firstDay:t.firstDay,minimalDays:t.minimalDays,weekend:Array.from(t.weekend)}}function J(t,e,n){return yt(t)&&t>=e&&t<=n}function xa(t,e){return t-e*Math.floor(t/e)}function D(t,e=2){const n=t<0;let s;return n?s="-"+(""+-t).padStart(e,"0"):s=(""+t).padStart(e,"0"),s}function pe(t){if(!(E(t)||t===null||t===""))return parseInt(t,10)}function Ee(t){if(!(E(t)||t===null||t===""))return parseFloat(t)}function ln(t){if(!(E(t)||t===null||t==="")){const e=parseFloat("0."+t)*1e3;return Math.floor(e)}}function un(t,e,n=!1){const s=10**e;return(n?Math.trunc:Math.round)(t*s)/s}function Ze(t){return t%4===0&&(t%100!==0||t%400===0)}function _e(t){return Ze(t)?366:365}function gt(t,e){const n=xa(e-1,12)+1,s=t+(e-n)/12;return n===2?Ze(s)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][n-1]}function wt(t){let e=Date.UTC(t.year,t.month-1,t.day,t.hour,t.minute,t.second,t.millisecond);return t.year<100&&t.year>=0&&(e=new Date(e),e.setUTCFullYear(t.year,t.month-1,t.day)),+e}function nr(t,e,n){return-on(rn(t,1,e),n)+e-1}function je(t,e=4,n=1){const s=nr(t,e,n),r=nr(t+1,e,n);return(_e(t)-s+r)/7}function fn(t){return t>99?t:t>A.twoDigitCutoffYear?1900+t:2e3+t}function sr(t,e,n,s=null){const r=new Date(t),i={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};s&&(i.timeZone=s);const o={timeZoneName:e,...i},a=new Intl.DateTimeFormat(n,o).formatToParts(r).find(l=>l.type.toLowerCase()==="timezonename");return a?a.value:null}function Et(t,e){let n=parseInt(t,10);Number.isNaN(n)&&(n=0);const s=parseInt(e,10)||0,r=n<0||Object.is(n,-0)?-s:s;return n*60+r}function rr(t){const e=Number(t);if(typeof t=="boolean"||t===""||Number.isNaN(e))throw new U(`Invalid unit value ${t}`);return e}function kt(t,e){const n={};for(const s in t)if(ve(t,s)){const r=t[s];if(r==null)continue;n[e(s)]=rr(r)}return n}function Ye(t,e){const n=Math.trunc(Math.abs(t/60)),s=Math.trunc(Math.abs(t%60)),r=t>=0?"+":"-";switch(e){case"short":return`${r}${D(n,2)}:${D(s,2)}`;case"narrow":return`${r}${n}${s>0?`:${s}`:""}`;case"techie":return`${r}${D(n,2)}${D(s,2)}`;default:throw new RangeError(`Value format ${e} is out of range for property format`)}}function St(t){return _a(t,["hour","minute","second","millisecond"])}const Aa=["January","February","March","April","May","June","July","August","September","October","November","December"],ir=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Ma=["J","F","M","A","M","J","J","A","S","O","N","D"];function or(t){switch(t){case"narrow":return[...Ma];case"short":return[...ir];case"long":return[...Aa];case"numeric":return["1","2","3","4","5","6","7","8","9","10","11","12"];case"2-digit":return["01","02","03","04","05","06","07","08","09","10","11","12"];default:return null}}const ar=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],cr=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],Ra=["M","T","W","T","F","S","S"];function lr(t){switch(t){case"narrow":return[...Ra];case"short":return[...cr];case"long":return[...ar];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const ur=["AM","PM"],Da=["Before Christ","Anno Domini"],Ia=["BC","AD"],La=["B","A"];function fr(t){switch(t){case"narrow":return[...La];case"short":return[...Ia];case"long":return[...Da];default:return null}}function Va(t){return ur[t.hour<12?0:1]}function Fa(t,e){return lr(e)[t.weekday-1]}function Ba(t,e){return or(e)[t.month-1]}function $a(t,e){return fr(e)[t.year<0?0:1]}function Ua(t,e,n="always",s=!1){const r={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},i=["hours","minutes","seconds"].indexOf(t)===-1;if(n==="auto"&&i){const d=t==="days";switch(e){case 1:return d?"tomorrow":`next ${r[t][0]}`;case-1:return d?"yesterday":`last ${r[t][0]}`;case 0:return d?"today":`this ${r[t][0]}`}}const o=Object.is(e,-0)||e<0,a=Math.abs(e),l=a===1,c=r[t],f=s?l?c[1]:c[2]||c[1]:l?r[t][0]:t;return o?`${a} ${f} ago`:`in ${a} ${f}`}function hr(t,e){let n="";for(const s of t)s.literal?n+=s.val:n+=e(s.val);return n}const Pa={D:ut,DD:ms,DDD:ps,DDDD:ys,t:gs,tt:ws,ttt:Es,tttt:ks,T:Ss,TT:Ts,TTT:bs,TTTT:Os,f:Ns,ff:vs,fff:xs,ffff:Ms,F:Cs,FF:_s,FFF:As,FFFF:Rs};class P{static create(e,n={}){return new P(e,n)}static parseFormat(e){let n=null,s="",r=!1;const i=[];for(let o=0;o<e.length;o++){const a=e.charAt(o);a==="'"?(s.length>0&&i.push({literal:r||/^\s+$/.test(s),val:s}),n=null,s="",r=!r):r||a===n?s+=a:(s.length>0&&i.push({literal:/^\s+$/.test(s),val:s}),s=a,n=a)}return s.length>0&&i.push({literal:r||/^\s+$/.test(s),val:s}),i}static macroTokenToFormatOpts(e){return Pa[e]}constructor(e,n){this.opts=n,this.loc=e,this.systemLoc=null}formatWithSystemDefault(e,n){return this.systemLoc===null&&(this.systemLoc=this.loc.redefaultToSystem()),this.systemLoc.dtFormatter(e,{...this.opts,...n}).format()}dtFormatter(e,n={}){return this.loc.dtFormatter(e,{...this.opts,...n})}formatDateTime(e,n){return this.dtFormatter(e,n).format()}formatDateTimeParts(e,n){return this.dtFormatter(e,n).formatToParts()}formatInterval(e,n){return this.dtFormatter(e.start,n).dtf.formatRange(e.start.toJSDate(),e.end.toJSDate())}resolvedOptions(e,n){return this.dtFormatter(e,n).resolvedOptions()}num(e,n=0){if(this.opts.forceSimple)return D(e,n);const s={...this.opts};return n>0&&(s.padTo=n),this.loc.numberFormatter(s).format(e)}formatDateTimeFromString(e,n){const s=this.loc.listingMode()==="en",r=this.loc.outputCalendar&&this.loc.outputCalendar!=="gregory",i=(m,p)=>this.loc.extract(e,m,p),o=m=>e.isOffsetFixed&&e.offset===0&&m.allowZ?"Z":e.isValid?e.zone.formatOffset(e.ts,m.format):"",a=()=>s?Va(e):i({hour:"numeric",hourCycle:"h12"},"dayperiod"),l=(m,p)=>s?Ba(e,m):i(p?{month:m}:{month:m,day:"numeric"},"month"),c=(m,p)=>s?Fa(e,m):i(p?{weekday:m}:{weekday:m,month:"long",day:"numeric"},"weekday"),f=m=>{const p=P.macroTokenToFormatOpts(m);return p?this.formatWithSystemDefault(e,p):m},d=m=>s?$a(e,m):i({era:m},"era"),w=m=>{switch(m){case"S":return this.num(e.millisecond);case"u":case"SSS":return this.num(e.millisecond,3);case"s":return this.num(e.second);case"ss":return this.num(e.second,2);case"uu":return this.num(Math.floor(e.millisecond/10),2);case"uuu":return this.num(Math.floor(e.millisecond/100));case"m":return this.num(e.minute);case"mm":return this.num(e.minute,2);case"h":return this.num(e.hour%12===0?12:e.hour%12);case"hh":return this.num(e.hour%12===0?12:e.hour%12,2);case"H":return this.num(e.hour);case"HH":return this.num(e.hour,2);case"Z":return o({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return o({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return o({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return e.zone.offsetName(e.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return e.zone.offsetName(e.ts,{format:"long",locale:this.loc.locale});case"z":return e.zoneName;case"a":return a();case"d":return r?i({day:"numeric"},"day"):this.num(e.day);case"dd":return r?i({day:"2-digit"},"day"):this.num(e.day,2);case"c":return this.num(e.weekday);case"ccc":return c("short",!0);case"cccc":return c("long",!0);case"ccccc":return c("narrow",!0);case"E":return this.num(e.weekday);case"EEE":return c("short",!1);case"EEEE":return c("long",!1);case"EEEEE":return c("narrow",!1);case"L":return r?i({month:"numeric",day:"numeric"},"month"):this.num(e.month);case"LL":return r?i({month:"2-digit",day:"numeric"},"month"):this.num(e.month,2);case"LLL":return l("short",!0);case"LLLL":return l("long",!0);case"LLLLL":return l("narrow",!0);case"M":return r?i({month:"numeric"},"month"):this.num(e.month);case"MM":return r?i({month:"2-digit"},"month"):this.num(e.month,2);case"MMM":return l("short",!1);case"MMMM":return l("long",!1);case"MMMMM":return l("narrow",!1);case"y":return r?i({year:"numeric"},"year"):this.num(e.year);case"yy":return r?i({year:"2-digit"},"year"):this.num(e.year.toString().slice(-2),2);case"yyyy":return r?i({year:"numeric"},"year"):this.num(e.year,4);case"yyyyyy":return r?i({year:"numeric"},"year"):this.num(e.year,6);case"G":return d("short");case"GG":return d("long");case"GGGGG":return d("narrow");case"kk":return this.num(e.weekYear.toString().slice(-2),2);case"kkkk":return this.num(e.weekYear,4);case"W":return this.num(e.weekNumber);case"WW":return this.num(e.weekNumber,2);case"n":return this.num(e.localWeekNumber);case"nn":return this.num(e.localWeekNumber,2);case"ii":return this.num(e.localWeekYear.toString().slice(-2),2);case"iiii":return this.num(e.localWeekYear,4);case"o":return this.num(e.ordinal);case"ooo":return this.num(e.ordinal,3);case"q":return this.num(e.quarter);case"qq":return this.num(e.quarter,2);case"X":return this.num(Math.floor(e.ts/1e3));case"x":return this.num(e.ts);default:return f(m)}};return hr(P.parseFormat(n),w)}formatDurationFromString(e,n){const s=l=>{switch(l[0]){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":return"hour";case"d":return"day";case"w":return"week";case"M":return"month";case"y":return"year";default:return null}},r=l=>c=>{const f=s(c);return f?this.num(l.get(f),c.length):c},i=P.parseFormat(n),o=i.reduce((l,{literal:c,val:f})=>c?l:l.concat(f),[]),a=e.shiftTo(...o.map(s).filter(l=>l));return hr(i,r(a))}}const dr=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function xe(...t){const e=t.reduce((n,s)=>n+s.source,"");return RegExp(`^${e}$`)}function Ae(...t){return e=>t.reduce(([n,s,r],i)=>{const[o,a,l]=i(e,r);return[{...n,...o},a||s,l]},[{},null,1]).slice(0,2)}function Me(t,...e){if(t==null)return[null,null];for(const[n,s]of e){const r=n.exec(t);if(r)return s(r)}return[null,null]}function mr(...t){return(e,n)=>{const s={};let r;for(r=0;r<t.length;r++)s[t[r]]=pe(e[n+r]);return[s,null,n+r]}}const pr=/(?:(Z)|([+-]\d\d)(?::?(\d\d))?)/,Wa=`(?:${pr.source}?(?:\\[(${dr.source})\\])?)?`,hn=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,yr=RegExp(`${hn.source}${Wa}`),dn=RegExp(`(?:T${yr.source})?`),qa=/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,Ha=/(\d{4})-?W(\d\d)(?:-?(\d))?/,za=/(\d{4})-?(\d{3})/,Za=mr("weekYear","weekNumber","weekDay"),ja=mr("year","ordinal"),Ya=/(\d{4})-(\d\d)-(\d\d)/,gr=RegExp(`${hn.source} ?(?:${pr.source}|(${dr.source}))?`),Ja=RegExp(`(?: ${gr.source})?`);function Re(t,e,n){const s=t[e];return E(s)?n:pe(s)}function Ga(t,e){return[{year:Re(t,e),month:Re(t,e+1,1),day:Re(t,e+2,1)},null,e+3]}function De(t,e){return[{hours:Re(t,e,0),minutes:Re(t,e+1,0),seconds:Re(t,e+2,0),milliseconds:ln(t[e+3])},null,e+4]}function Je(t,e){const n=!t[e]&&!t[e+1],s=Et(t[e+1],t[e+2]),r=n?null:W.instance(s);return[{},r,e+3]}function Ge(t,e){const n=t[e]?ce.create(t[e]):null;return[{},n,e+1]}const Ka=RegExp(`^T?${hn.source}$`),Xa=/^-?P(?:(?:(-?\d{1,20}(?:\.\d{1,20})?)Y)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20}(?:\.\d{1,20})?)W)?(?:(-?\d{1,20}(?:\.\d{1,20})?)D)?(?:T(?:(-?\d{1,20}(?:\.\d{1,20})?)H)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20})(?:[.,](-?\d{1,20}))?S)?)?)$/;function Qa(t){const[e,n,s,r,i,o,a,l,c]=t,f=e[0]==="-",d=l&&l[0]==="-",w=(m,p=!1)=>m!==void 0&&(p||m&&f)?-m:m;return[{years:w(Ee(n)),months:w(Ee(s)),weeks:w(Ee(r)),days:w(Ee(i)),hours:w(Ee(o)),minutes:w(Ee(a)),seconds:w(Ee(l),l==="-0"),milliseconds:w(ln(c),d)}]}const ec={GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function mn(t,e,n,s,r,i,o){const a={year:e.length===2?fn(pe(e)):pe(e),month:ir.indexOf(n)+1,day:pe(s),hour:pe(r),minute:pe(i)};return o&&(a.second=pe(o)),t&&(a.weekday=t.length>3?ar.indexOf(t)+1:cr.indexOf(t)+1),a}const tc=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function nc(t){const[,e,n,s,r,i,o,a,l,c,f,d]=t,w=mn(e,r,s,n,i,o,a);let m;return l?m=ec[l]:c?m=0:m=Et(f,d),[w,new W(m)]}function sc(t){return t.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}const rc=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,ic=/^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,oc=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function wr(t){const[,e,n,s,r,i,o,a]=t;return[mn(e,r,s,n,i,o,a),W.utcInstance]}function ac(t){const[,e,n,s,r,i,o,a]=t;return[mn(e,a,n,s,r,i,o),W.utcInstance]}const cc=xe(qa,dn),lc=xe(Ha,dn),uc=xe(za,dn),fc=xe(yr),Er=Ae(Ga,De,Je,Ge),hc=Ae(Za,De,Je,Ge),dc=Ae(ja,De,Je,Ge),mc=Ae(De,Je,Ge);function pc(t){return Me(t,[cc,Er],[lc,hc],[uc,dc],[fc,mc])}function yc(t){return Me(sc(t),[tc,nc])}function gc(t){return Me(t,[rc,wr],[ic,wr],[oc,ac])}function wc(t){return Me(t,[Xa,Qa])}const Ec=Ae(De);function kc(t){return Me(t,[Ka,Ec])}const Sc=xe(Ya,Ja),Tc=xe(gr),bc=Ae(De,Je,Ge);function Oc(t){return Me(t,[Sc,Er],[Tc,bc])}const kr="Invalid Duration",Sr={weeks:{days:7,hours:7*24,minutes:7*24*60,seconds:7*24*60*60,milliseconds:7*24*60*60*1e3},days:{hours:24,minutes:24*60,seconds:24*60*60,milliseconds:24*60*60*1e3},hours:{minutes:60,seconds:60*60,milliseconds:60*60*1e3},minutes:{seconds:60,milliseconds:60*1e3},seconds:{milliseconds:1e3}},Nc={years:{quarters:4,months:12,weeks:52,days:365,hours:365*24,minutes:365*24*60,seconds:365*24*60*60,milliseconds:365*24*60*60*1e3},quarters:{months:3,weeks:13,days:91,hours:91*24,minutes:91*24*60,seconds:91*24*60*60,milliseconds:91*24*60*60*1e3},months:{weeks:4,days:30,hours:30*24,minutes:30*24*60,seconds:30*24*60*60,milliseconds:30*24*60*60*1e3},...Sr},G=146097/400,Ie=146097/4800,Cc={years:{quarters:4,months:12,weeks:G/7,days:G,hours:G*24,minutes:G*24*60,seconds:G*24*60*60,milliseconds:G*24*60*60*1e3},quarters:{months:3,weeks:G/28,days:G/4,hours:G*24/4,minutes:G*24*60/4,seconds:G*24*60*60/4,milliseconds:G*24*60*60*1e3/4},months:{weeks:Ie/7,days:Ie,hours:Ie*24,minutes:Ie*24*60,seconds:Ie*24*60*60,milliseconds:Ie*24*60*60*1e3},...Sr},ke=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],vc=ke.slice(0).reverse();function ye(t,e,n=!1){const s={values:n?e.values:{...t.values,...e.values||{}},loc:t.loc.clone(e.loc),conversionAccuracy:e.conversionAccuracy||t.conversionAccuracy,matrix:e.matrix||t.matrix};return new O(s)}function Tr(t,e){let n=e.milliseconds??0;for(const s of vc.slice(1))e[s]&&(n+=e[s]*t[s].milliseconds);return n}function br(t,e){const n=Tr(t,e)<0?-1:1;ke.reduceRight((s,r)=>{if(E(e[r]))return s;if(s){const i=e[s]*n,o=t[r][s],a=Math.floor(i/o);e[r]+=a*n,e[s]-=a*o*n}return r},null),ke.reduce((s,r)=>{if(E(e[r]))return s;if(s){const i=e[s]%1;e[s]-=i,e[r]+=i*t[s][r]}return r},null)}function _c(t){const e={};for(const[n,s]of Object.entries(t))s!==0&&(e[n]=s);return e}class O{constructor(e){const n=e.conversionAccuracy==="longterm"||!1;let s=n?Cc:Nc;e.matrix&&(s=e.matrix),this.values=e.values,this.loc=e.loc||_.create(),this.conversionAccuracy=n?"longterm":"casual",this.invalid=e.invalid||null,this.matrix=s,this.isLuxonDuration=!0}static fromMillis(e,n){return O.fromObject({milliseconds:e},n)}static fromObject(e,n={}){if(e==null||typeof e!="object")throw new U(`Duration.fromObject: argument expected to be an object, got ${e===null?"null":typeof e}`);return new O({values:kt(e,O.normalizeUnit),loc:_.fromObject(n),conversionAccuracy:n.conversionAccuracy,matrix:n.matrix})}static fromDurationLike(e){if(me(e))return O.fromMillis(e);if(O.isDuration(e))return e;if(typeof e=="object")return O.fromObject(e);throw new U(`Unknown duration argument ${e} of type ${typeof e}`)}static fromISO(e,n){const[s]=wc(e);return s?O.fromObject(s,n):O.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static fromISOTime(e,n){const[s]=kc(e);return s?O.fromObject(s,n):O.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static invalid(e,n=null){if(!e)throw new U("need to specify a reason the Duration is invalid");const s=e instanceof te?e:new te(e,n);if(A.throwOnInvalid)throw new Xo(s);return new O({invalid:s})}static normalizeUnit(e){const n={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[e&&e.toLowerCase()];if(!n)throw new ds(e);return n}static isDuration(e){return e&&e.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(e,n={}){const s={...n,floor:n.round!==!1&&n.floor!==!1};return this.isValid?P.create(this.loc,s).formatDurationFromString(this,e):kr}toHuman(e={}){if(!this.isValid)return kr;const n=ke.map(s=>{const r=this.values[s];return E(r)?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...e,unit:s.slice(0,-1)}).format(r)}).filter(s=>s);return this.loc.listFormatter({type:"conjunction",style:e.listStyle||"narrow",...e}).format(n)}toObject(){return this.isValid?{...this.values}:{}}toISO(){if(!this.isValid)return null;let e="P";return this.years!==0&&(e+=this.years+"Y"),(this.months!==0||this.quarters!==0)&&(e+=this.months+this.quarters*3+"M"),this.weeks!==0&&(e+=this.weeks+"W"),this.days!==0&&(e+=this.days+"D"),(this.hours!==0||this.minutes!==0||this.seconds!==0||this.milliseconds!==0)&&(e+="T"),this.hours!==0&&(e+=this.hours+"H"),this.minutes!==0&&(e+=this.minutes+"M"),(this.seconds!==0||this.milliseconds!==0)&&(e+=un(this.seconds+this.milliseconds/1e3,3)+"S"),e==="P"&&(e+="T0S"),e}toISOTime(e={}){if(!this.isValid)return null;const n=this.toMillis();return n<0||n>=864e5?null:(e={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...e,includeOffset:!1},k.fromMillis(n,{zone:"UTC"}).toISOTime(e))}toJSON(){return this.toISO()}toString(){return this.toISO()}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Duration { values: ${JSON.stringify(this.values)} }`:`Duration { Invalid, reason: ${this.invalidReason} }`}toMillis(){return this.isValid?Tr(this.matrix,this.values):NaN}valueOf(){return this.toMillis()}plus(e){if(!this.isValid)return this;const n=O.fromDurationLike(e),s={};for(const r of ke)(ve(n.values,r)||ve(this.values,r))&&(s[r]=n.get(r)+this.get(r));return ye(this,{values:s},!0)}minus(e){if(!this.isValid)return this;const n=O.fromDurationLike(e);return this.plus(n.negate())}mapUnits(e){if(!this.isValid)return this;const n={};for(const s of Object.keys(this.values))n[s]=rr(e(this.values[s],s));return ye(this,{values:n},!0)}get(e){return this[O.normalizeUnit(e)]}set(e){if(!this.isValid)return this;const n={...this.values,...kt(e,O.normalizeUnit)};return ye(this,{values:n})}reconfigure({locale:e,numberingSystem:n,conversionAccuracy:s,matrix:r}={}){const o={loc:this.loc.clone({locale:e,numberingSystem:n}),matrix:r,conversionAccuracy:s};return ye(this,o)}as(e){return this.isValid?this.shiftTo(e).get(e):NaN}normalize(){if(!this.isValid)return this;const e=this.toObject();return br(this.matrix,e),ye(this,{values:e},!0)}rescale(){if(!this.isValid)return this;const e=_c(this.normalize().shiftToAll().toObject());return ye(this,{values:e},!0)}shiftTo(...e){if(!this.isValid)return this;if(e.length===0)return this;e=e.map(o=>O.normalizeUnit(o));const n={},s={},r=this.toObject();let i;for(const o of ke)if(e.indexOf(o)>=0){i=o;let a=0;for(const c in s)a+=this.matrix[c][o]*s[c],s[c]=0;me(r[o])&&(a+=r[o]);const l=Math.trunc(a);n[o]=l,s[o]=(a*1e3-l*1e3)/1e3}else me(r[o])&&(s[o]=r[o]);for(const o in s)s[o]!==0&&(n[i]+=o===i?s[o]:s[o]/this.matrix[i][o]);return br(this.matrix,n),ye(this,{values:n},!0)}shiftToAll(){return this.isValid?this.shiftTo("years","months","weeks","days","hours","minutes","seconds","milliseconds"):this}negate(){if(!this.isValid)return this;const e={};for(const n of Object.keys(this.values))e[n]=this.values[n]===0?0:-this.values[n];return ye(this,{values:e},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(e){if(!this.isValid||!e.isValid||!this.loc.equals(e.loc))return!1;function n(s,r){return s===void 0||s===0?r===void 0||r===0:s===r}for(const s of ke)if(!n(this.values[s],e.values[s]))return!1;return!0}}const Le="Invalid Interval";function xc(t,e){return!t||!t.isValid?M.invalid("missing or invalid start"):!e||!e.isValid?M.invalid("missing or invalid end"):e<t?M.invalid("end before start",`The end of an interval must be after its start, but you had start=${t.toISO()} and end=${e.toISO()}`):null}class M{constructor(e){this.s=e.start,this.e=e.end,this.invalid=e.invalid||null,this.isLuxonInterval=!0}static invalid(e,n=null){if(!e)throw new U("need to specify a reason the Interval is invalid");const s=e instanceof te?e:new te(e,n);if(A.throwOnInvalid)throw new Ko(s);return new M({invalid:s})}static fromDateTimes(e,n){const s=Xe(e),r=Xe(n),i=xc(s,r);return i??new M({start:s,end:r})}static after(e,n){const s=O.fromDurationLike(n),r=Xe(e);return M.fromDateTimes(r,r.plus(s))}static before(e,n){const s=O.fromDurationLike(n),r=Xe(e);return M.fromDateTimes(r.minus(s),r)}static fromISO(e,n){const[s,r]=(e||"").split("/",2);if(s&&r){let i,o;try{i=k.fromISO(s,n),o=i.isValid}catch{o=!1}let a,l;try{a=k.fromISO(r,n),l=a.isValid}catch{l=!1}if(o&&l)return M.fromDateTimes(i,a);if(o){const c=O.fromISO(r,n);if(c.isValid)return M.after(i,c)}else if(l){const c=O.fromISO(s,n);if(c.isValid)return M.before(a,c)}}return M.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static isInterval(e){return e&&e.isLuxonInterval||!1}get start(){return this.isValid?this.s:null}get end(){return this.isValid?this.e:null}get isValid(){return this.invalidReason===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}length(e="milliseconds"){return this.isValid?this.toDuration(e).get(e):NaN}count(e="milliseconds",n){if(!this.isValid)return NaN;const s=this.start.startOf(e,n);let r;return n!=null&&n.useLocaleWeeks?r=this.end.reconfigure({locale:s.locale}):r=this.end,r=r.startOf(e,n),Math.floor(r.diff(s,e).get(e))+(r.valueOf()!==this.end.valueOf())}hasSame(e){return this.isValid?this.isEmpty()||this.e.minus(1).hasSame(this.s,e):!1}isEmpty(){return this.s.valueOf()===this.e.valueOf()}isAfter(e){return this.isValid?this.s>e:!1}isBefore(e){return this.isValid?this.e<=e:!1}contains(e){return this.isValid?this.s<=e&&this.e>e:!1}set({start:e,end:n}={}){return this.isValid?M.fromDateTimes(e||this.s,n||this.e):this}splitAt(...e){if(!this.isValid)return[];const n=e.map(Xe).filter(o=>this.contains(o)).sort((o,a)=>o.toMillis()-a.toMillis()),s=[];let{s:r}=this,i=0;for(;r<this.e;){const o=n[i]||this.e,a=+o>+this.e?this.e:o;s.push(M.fromDateTimes(r,a)),r=a,i+=1}return s}splitBy(e){const n=O.fromDurationLike(e);if(!this.isValid||!n.isValid||n.as("milliseconds")===0)return[];let{s}=this,r=1,i;const o=[];for(;s<this.e;){const a=this.start.plus(n.mapUnits(l=>l*r));i=+a>+this.e?this.e:a,o.push(M.fromDateTimes(s,i)),s=i,r+=1}return o}divideEqually(e){return this.isValid?this.splitBy(this.length()/e).slice(0,e):[]}overlaps(e){return this.e>e.s&&this.s<e.e}abutsStart(e){return this.isValid?+this.e==+e.s:!1}abutsEnd(e){return this.isValid?+e.e==+this.s:!1}engulfs(e){return this.isValid?this.s<=e.s&&this.e>=e.e:!1}equals(e){return!this.isValid||!e.isValid?!1:this.s.equals(e.s)&&this.e.equals(e.e)}intersection(e){if(!this.isValid)return this;const n=this.s>e.s?this.s:e.s,s=this.e<e.e?this.e:e.e;return n>=s?null:M.fromDateTimes(n,s)}union(e){if(!this.isValid)return this;const n=this.s<e.s?this.s:e.s,s=this.e>e.e?this.e:e.e;return M.fromDateTimes(n,s)}static merge(e){const[n,s]=e.sort((r,i)=>r.s-i.s).reduce(([r,i],o)=>i?i.overlaps(o)||i.abutsStart(o)?[r,i.union(o)]:[r.concat([i]),o]:[r,o],[[],null]);return s&&n.push(s),n}static xor(e){let n=null,s=0;const r=[],i=e.map(l=>[{time:l.s,type:"s"},{time:l.e,type:"e"}]),o=Array.prototype.concat(...i),a=o.sort((l,c)=>l.time-c.time);for(const l of a)s+=l.type==="s"?1:-1,s===1?n=l.time:(n&&+n!=+l.time&&r.push(M.fromDateTimes(n,l.time)),n=null);return M.merge(r)}difference(...e){return M.xor([this].concat(e)).map(n=>this.intersection(n)).filter(n=>n&&!n.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} – ${this.e.toISO()})`:Le}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Interval { start: ${this.s.toISO()}, end: ${this.e.toISO()} }`:`Interval { Invalid, reason: ${this.invalidReason} }`}toLocaleString(e=ut,n={}){return this.isValid?P.create(this.s.loc.clone(n),e).formatInterval(this):Le}toISO(e){return this.isValid?`${this.s.toISO(e)}/${this.e.toISO(e)}`:Le}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:Le}toISOTime(e){return this.isValid?`${this.s.toISOTime(e)}/${this.e.toISOTime(e)}`:Le}toFormat(e,{separator:n=" – "}={}){return this.isValid?`${this.s.toFormat(e)}${n}${this.e.toFormat(e)}`:Le}toDuration(e,n){return this.isValid?this.e.diff(this.s,e,n):O.invalid(this.invalidReason)}mapEndpoints(e){return M.fromDateTimes(e(this.s),e(this.e))}}class Tt{static hasDST(e=A.defaultZone){const n=k.now().setZone(e).set({month:12});return!e.isUniversal&&n.offset!==n.set({month:6}).offset}static isValidIANAZone(e){return ce.isValidZone(e)}static normalizeZone(e){return de(e,A.defaultZone)}static getStartOfWeek({locale:e=null,locObj:n=null}={}){return(n||_.create(e)).getStartOfWeek()}static getMinimumDaysInFirstWeek({locale:e=null,locObj:n=null}={}){return(n||_.create(e)).getMinDaysInFirstWeek()}static getWeekendWeekdays({locale:e=null,locObj:n=null}={}){return(n||_.create(e)).getWeekendDays().slice()}static months(e="long",{locale:n=null,numberingSystem:s=null,locObj:r=null,outputCalendar:i="gregory"}={}){return(r||_.create(n,s,i)).months(e)}static monthsFormat(e="long",{locale:n=null,numberingSystem:s=null,locObj:r=null,outputCalendar:i="gregory"}={}){return(r||_.create(n,s,i)).months(e,!0)}static weekdays(e="long",{locale:n=null,numberingSystem:s=null,locObj:r=null}={}){return(r||_.create(n,s,null)).weekdays(e)}static weekdaysFormat(e="long",{locale:n=null,numberingSystem:s=null,locObj:r=null}={}){return(r||_.create(n,s,null)).weekdays(e,!0)}static meridiems({locale:e=null}={}){return _.create(e).meridiems()}static eras(e="short",{locale:n=null}={}){return _.create(n,null,"gregory").eras(e)}static features(){return{relative:Qs(),localeWeek:er()}}}function Or(t,e){const n=r=>r.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),s=n(e)-n(t);return Math.floor(O.fromMillis(s).as("days"))}function Ac(t,e,n){const s=[["years",(l,c)=>c.year-l.year],["quarters",(l,c)=>c.quarter-l.quarter+(c.year-l.year)*4],["months",(l,c)=>c.month-l.month+(c.year-l.year)*12],["weeks",(l,c)=>{const f=Or(l,c);return(f-f%7)/7}],["days",Or]],r={},i=t;let o,a;for(const[l,c]of s)n.indexOf(l)>=0&&(o=l,r[l]=c(t,e),a=i.plus(r),a>e?(r[l]--,t=i.plus(r),t>e&&(a=t,r[l]--,t=i.plus(r))):t=a);return[t,r,a,o]}function Mc(t,e,n,s){let[r,i,o,a]=Ac(t,e,n);const l=e-r,c=n.filter(d=>["hours","minutes","seconds","milliseconds"].indexOf(d)>=0);c.length===0&&(o<e&&(o=r.plus({[a]:1})),o!==r&&(i[a]=(i[a]||0)+l/(o-r)));const f=O.fromObject(i,s);return c.length>0?O.fromMillis(l,s).shiftTo(...c).plus(f):f}const Rc="missing Intl.DateTimeFormat.formatToParts support";function N(t,e=n=>n){return{regex:t,deser:([n])=>e(Sa(n))}}const Nr="[  ]",Cr=new RegExp(Nr,"g");function Dc(t){return t.replace(/\./g,"\\.?").replace(Cr,Nr)}function vr(t){return t.replace(/\./g,"").replace(Cr," ").toLowerCase()}function ne(t,e){return t===null?null:{regex:RegExp(t.map(Dc).join("|")),deser:([n])=>t.findIndex(s=>vr(n)===vr(s))+e}}function _r(t,e){return{regex:t,deser:([,n,s])=>Et(n,s),groups:e}}function bt(t){return{regex:t,deser:([e])=>e}}function Ic(t){return t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function Lc(t,e){const n=ee(e),s=ee(e,"{2}"),r=ee(e,"{3}"),i=ee(e,"{4}"),o=ee(e,"{6}"),a=ee(e,"{1,2}"),l=ee(e,"{1,3}"),c=ee(e,"{1,6}"),f=ee(e,"{1,9}"),d=ee(e,"{2,4}"),w=ee(e,"{4,6}"),m=x=>({regex:RegExp(Ic(x.val)),deser:([C])=>C,literal:!0}),g=(x=>{if(t.literal)return m(x);switch(x.val){case"G":return ne(e.eras("short"),0);case"GG":return ne(e.eras("long"),0);case"y":return N(c);case"yy":return N(d,fn);case"yyyy":return N(i);case"yyyyy":return N(w);case"yyyyyy":return N(o);case"M":return N(a);case"MM":return N(s);case"MMM":return ne(e.months("short",!0),1);case"MMMM":return ne(e.months("long",!0),1);case"L":return N(a);case"LL":return N(s);case"LLL":return ne(e.months("short",!1),1);case"LLLL":return ne(e.months("long",!1),1);case"d":return N(a);case"dd":return N(s);case"o":return N(l);case"ooo":return N(r);case"HH":return N(s);case"H":return N(a);case"hh":return N(s);case"h":return N(a);case"mm":return N(s);case"m":return N(a);case"q":return N(a);case"qq":return N(s);case"s":return N(a);case"ss":return N(s);case"S":return N(l);case"SSS":return N(r);case"u":return bt(f);case"uu":return bt(a);case"uuu":return N(n);case"a":return ne(e.meridiems(),0);case"kkkk":return N(i);case"kk":return N(d,fn);case"W":return N(a);case"WW":return N(s);case"E":case"c":return N(n);case"EEE":return ne(e.weekdays("short",!1),1);case"EEEE":return ne(e.weekdays("long",!1),1);case"ccc":return ne(e.weekdays("short",!0),1);case"cccc":return ne(e.weekdays("long",!0),1);case"Z":case"ZZ":return _r(new RegExp(`([+-]${a.source})(?::(${s.source}))?`),2);case"ZZZ":return _r(new RegExp(`([+-]${a.source})(${s.source})?`),2);case"z":return bt(/[a-z_+-/]{1,256}?/i);case" ":return bt(/[^\S\n\r]/);default:return m(x)}})(t)||{invalidReason:Rc};return g.token=t,g}const Vc={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour12:{numeric:"h","2-digit":"hh"},hour24:{numeric:"H","2-digit":"HH"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"},timeZoneName:{long:"ZZZZZ",short:"ZZZ"}};function Fc(t,e,n){const{type:s,value:r}=t;if(s==="literal"){const l=/^\s+$/.test(r);return{literal:!l,val:l?" ":r}}const i=e[s];let o=s;s==="hour"&&(e.hour12!=null?o=e.hour12?"hour12":"hour24":e.hourCycle!=null?e.hourCycle==="h11"||e.hourCycle==="h12"?o="hour12":o="hour24":o=n.hour12?"hour12":"hour24");let a=Vc[o];if(typeof a=="object"&&(a=a[i]),a)return{literal:!1,val:a}}function Bc(t){return[`^${t.map(n=>n.regex).reduce((n,s)=>`${n}(${s.source})`,"")}$`,t]}function $c(t,e,n){const s=t.match(e);if(s){const r={};let i=1;for(const o in n)if(ve(n,o)){const a=n[o],l=a.groups?a.groups+1:1;!a.literal&&a.token&&(r[a.token.val[0]]=a.deser(s.slice(i,i+l))),i+=l}return[s,r]}else return[s,{}]}function Uc(t){const e=i=>{switch(i){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}};let n=null,s;return E(t.z)||(n=ce.create(t.z)),E(t.Z)||(n||(n=new W(t.Z)),s=t.Z),E(t.q)||(t.M=(t.q-1)*3+1),E(t.h)||(t.h<12&&t.a===1?t.h+=12:t.h===12&&t.a===0&&(t.h=0)),t.G===0&&t.y&&(t.y=-t.y),E(t.u)||(t.S=ln(t.u)),[Object.keys(t).reduce((i,o)=>{const a=e(o);return a&&(i[a]=t[o]),i},{}),n,s]}let pn=null;function Pc(){return pn||(pn=k.fromMillis(1555555555555)),pn}function Wc(t,e){if(t.literal)return t;const n=P.macroTokenToFormatOpts(t.val),s=Rr(n,e);return s==null||s.includes(void 0)?t:s}function xr(t,e){return Array.prototype.concat(...t.map(n=>Wc(n,e)))}class Ar{constructor(e,n){if(this.locale=e,this.format=n,this.tokens=xr(P.parseFormat(n),e),this.units=this.tokens.map(s=>Lc(s,e)),this.disqualifyingUnit=this.units.find(s=>s.invalidReason),!this.disqualifyingUnit){const[s,r]=Bc(this.units);this.regex=RegExp(s,"i"),this.handlers=r}}explainFromTokens(e){if(this.isValid){const[n,s]=$c(e,this.regex,this.handlers),[r,i,o]=s?Uc(s):[null,null,void 0];if(ve(s,"a")&&ve(s,"H"))throw new Ne("Can't include meridiem when specifying 24-hour format");return{input:e,tokens:this.tokens,regex:this.regex,rawMatches:n,matches:s,result:r,zone:i,specificOffset:o}}else return{input:e,tokens:this.tokens,invalidReason:this.invalidReason}}get isValid(){return!this.disqualifyingUnit}get invalidReason(){return this.disqualifyingUnit?this.disqualifyingUnit.invalidReason:null}}function Mr(t,e,n){return new Ar(t,n).explainFromTokens(e)}function qc(t,e,n){const{result:s,zone:r,specificOffset:i,invalidReason:o}=Mr(t,e,n);return[s,r,i,o]}function Rr(t,e){if(!t)return null;const s=P.create(e,t).dtFormatter(Pc()),r=s.formatToParts(),i=s.resolvedOptions();return r.map(o=>Fc(o,t,i))}const yn="Invalid DateTime",Dr=864e13;function Ke(t){return new te("unsupported zone",`the zone "${t.name}" is not supported`)}function gn(t){return t.weekData===null&&(t.weekData=pt(t.c)),t.weekData}function wn(t){return t.localWeekData===null&&(t.localWeekData=pt(t.c,t.loc.getMinDaysInFirstWeek(),t.loc.getStartOfWeek())),t.localWeekData}function Se(t,e){const n={ts:t.ts,zone:t.zone,c:t.c,o:t.o,loc:t.loc,invalid:t.invalid};return new k({...n,...e,old:n})}function Ir(t,e,n){let s=t-e*60*1e3;const r=n.offset(s);if(e===r)return[s,e];s-=(r-e)*60*1e3;const i=n.offset(s);return r===i?[s,r]:[t-Math.min(r,i)*60*1e3,Math.max(r,i)]}function Ot(t,e){t+=e*60*1e3;const n=new Date(t);return{year:n.getUTCFullYear(),month:n.getUTCMonth()+1,day:n.getUTCDate(),hour:n.getUTCHours(),minute:n.getUTCMinutes(),second:n.getUTCSeconds(),millisecond:n.getUTCMilliseconds()}}function Nt(t,e,n){return Ir(wt(t),e,n)}function Lr(t,e){const n=t.o,s=t.c.year+Math.trunc(e.years),r=t.c.month+Math.trunc(e.months)+Math.trunc(e.quarters)*3,i={...t.c,year:s,month:r,day:Math.min(t.c.day,gt(s,r))+Math.trunc(e.days)+Math.trunc(e.weeks)*7},o=O.fromObject({years:e.years-Math.trunc(e.years),quarters:e.quarters-Math.trunc(e.quarters),months:e.months-Math.trunc(e.months),weeks:e.weeks-Math.trunc(e.weeks),days:e.days-Math.trunc(e.days),hours:e.hours,minutes:e.minutes,seconds:e.seconds,milliseconds:e.milliseconds}).as("milliseconds"),a=wt(i);let[l,c]=Ir(a,n,t.zone);return o!==0&&(l+=o,c=t.zone.offset(l)),{ts:l,o:c}}function Ve(t,e,n,s,r,i){const{setZone:o,zone:a}=n;if(t&&Object.keys(t).length!==0||e){const l=e||a,c=k.fromObject(t,{...n,zone:l,specificOffset:i});return o?c:c.setZone(a)}else return k.invalid(new te("unparsable",`the input "${r}" can't be parsed as ${s}`))}function Ct(t,e,n=!0){return t.isValid?P.create(_.create("en-US"),{allowZ:n,forceSimple:!0}).formatDateTimeFromString(t,e):null}function En(t,e){const n=t.c.year>9999||t.c.year<0;let s="";return n&&t.c.year>=0&&(s+="+"),s+=D(t.c.year,n?6:4),e?(s+="-",s+=D(t.c.month),s+="-",s+=D(t.c.day)):(s+=D(t.c.month),s+=D(t.c.day)),s}function Vr(t,e,n,s,r,i){let o=D(t.c.hour);return e?(o+=":",o+=D(t.c.minute),(t.c.millisecond!==0||t.c.second!==0||!n)&&(o+=":")):o+=D(t.c.minute),(t.c.millisecond!==0||t.c.second!==0||!n)&&(o+=D(t.c.second),(t.c.millisecond!==0||!s)&&(o+=".",o+=D(t.c.millisecond,3))),r&&(t.isOffsetFixed&&t.offset===0&&!i?o+="Z":t.o<0?(o+="-",o+=D(Math.trunc(-t.o/60)),o+=":",o+=D(Math.trunc(-t.o%60))):(o+="+",o+=D(Math.trunc(t.o/60)),o+=":",o+=D(Math.trunc(t.o%60)))),i&&(o+="["+t.zone.ianaName+"]"),o}const Fr={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},Hc={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},zc={ordinal:1,hour:0,minute:0,second:0,millisecond:0},Br=["year","month","day","hour","minute","second","millisecond"],Zc=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],jc=["year","ordinal","hour","minute","second","millisecond"];function Yc(t){const e={year:"year",years:"year",month:"month",months:"month",day:"day",days:"day",hour:"hour",hours:"hour",minute:"minute",minutes:"minute",quarter:"quarter",quarters:"quarter",second:"second",seconds:"second",millisecond:"millisecond",milliseconds:"millisecond",weekday:"weekday",weekdays:"weekday",weeknumber:"weekNumber",weeksnumber:"weekNumber",weeknumbers:"weekNumber",weekyear:"weekYear",weekyears:"weekYear",ordinal:"ordinal"}[t.toLowerCase()];if(!e)throw new ds(t);return e}function $r(t){switch(t.toLowerCase()){case"localweekday":case"localweekdays":return"localWeekday";case"localweeknumber":case"localweeknumbers":return"localWeekNumber";case"localweekyear":case"localweekyears":return"localWeekYear";default:return Yc(t)}}function Jc(t){return _t[t]||(vt===void 0&&(vt=A.now()),_t[t]=t.offset(vt)),_t[t]}function Ur(t,e){const n=de(e.zone,A.defaultZone);if(!n.isValid)return k.invalid(Ke(n));const s=_.fromObject(e);let r,i;if(E(t.year))r=A.now();else{for(const l of Br)E(t[l])&&(t[l]=Fr[l]);const o=Ks(t)||Xs(t);if(o)return k.invalid(o);const a=Jc(n);[r,i]=Nt(t,a,n)}return new k({ts:r,zone:n,loc:s,o:i})}function Pr(t,e,n){const s=E(n.round)?!0:n.round,r=(o,a)=>(o=un(o,s||n.calendary?0:2,!0),e.loc.clone(n).relFormatter(n).format(o,a)),i=o=>n.calendary?e.hasSame(t,o)?0:e.startOf(o).diff(t.startOf(o),o).get(o):e.diff(t,o).get(o);if(n.unit)return r(i(n.unit),n.unit);for(const o of n.units){const a=i(o);if(Math.abs(a)>=1)return r(a,o)}return r(t>e?-0:0,n.units[n.units.length-1])}function Wr(t){let e={},n;return t.length>0&&typeof t[t.length-1]=="object"?(e=t[t.length-1],n=Array.from(t).slice(0,t.length-1)):n=Array.from(t),[e,n]}let vt,_t={};class k{constructor(e){const n=e.zone||A.defaultZone;let s=e.invalid||(Number.isNaN(e.ts)?new te("invalid input"):null)||(n.isValid?null:Ke(n));this.ts=E(e.ts)?A.now():e.ts;let r=null,i=null;if(!s)if(e.old&&e.old.ts===this.ts&&e.old.zone.equals(n))[r,i]=[e.old.c,e.old.o];else{const a=me(e.o)&&!e.old?e.o:n.offset(this.ts);r=Ot(this.ts,a),s=Number.isNaN(r.year)?new te("invalid input"):null,r=s?null:r,i=s?null:a}this._zone=n,this.loc=e.loc||_.create(),this.invalid=s,this.weekData=null,this.localWeekData=null,this.c=r,this.o=i,this.isLuxonDateTime=!0}static now(){return new k({})}static local(){const[e,n]=Wr(arguments),[s,r,i,o,a,l,c]=n;return Ur({year:s,month:r,day:i,hour:o,minute:a,second:l,millisecond:c},e)}static utc(){const[e,n]=Wr(arguments),[s,r,i,o,a,l,c]=n;return e.zone=W.utcInstance,Ur({year:s,month:r,day:i,hour:o,minute:a,second:l,millisecond:c},e)}static fromJSDate(e,n={}){const s=Ca(e)?e.valueOf():NaN;if(Number.isNaN(s))return k.invalid("invalid input");const r=de(n.zone,A.defaultZone);return r.isValid?new k({ts:s,zone:r,loc:_.fromObject(n)}):k.invalid(Ke(r))}static fromMillis(e,n={}){if(me(e))return e<-Dr||e>Dr?k.invalid("Timestamp out of range"):new k({ts:e,zone:de(n.zone,A.defaultZone),loc:_.fromObject(n)});throw new U(`fromMillis requires a numerical input, but received a ${typeof e} with value ${e}`)}static fromSeconds(e,n={}){if(me(e))return new k({ts:e*1e3,zone:de(n.zone,A.defaultZone),loc:_.fromObject(n)});throw new U("fromSeconds requires a numerical input")}static fromObject(e,n={}){e=e||{};const s=de(n.zone,A.defaultZone);if(!s.isValid)return k.invalid(Ke(s));const r=_.fromObject(n),i=kt(e,$r),{minDaysInFirstWeek:o,startOfWeek:a}=Gs(i,r),l=A.now(),c=E(n.specificOffset)?s.offset(l):n.specificOffset,f=!E(i.ordinal),d=!E(i.year),w=!E(i.month)||!E(i.day),m=d||w,p=i.weekYear||i.weekNumber;if((m||f)&&p)throw new Ne("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(w&&f)throw new Ne("Can't mix ordinal dates with month/day");const g=p||i.weekday&&!m;let x,C,R=Ot(l,c);g?(x=Zc,C=Hc,R=pt(R,o,a)):f?(x=jc,C=zc,R=an(R)):(x=Br,C=Fr);let le=!1;for(const q of x){const Be=i[q];E(Be)?le?i[q]=C[q]:i[q]=R[q]:le=!0}const S=g?ba(i,o,a):f?Oa(i):Ks(i),v=S||Xs(i);if(v)return k.invalid(v);const $=g?Ys(i,o,a):f?Js(i):i,[z,F]=Nt($,c,s),V=new k({ts:z,zone:s,o:F,loc:r});return i.weekday&&m&&e.weekday!==V.weekday?k.invalid("mismatched weekday",`you can't specify both a weekday of ${i.weekday} and a date of ${V.toISO()}`):V.isValid?V:k.invalid(V.invalid)}static fromISO(e,n={}){const[s,r]=pc(e);return Ve(s,r,n,"ISO 8601",e)}static fromRFC2822(e,n={}){const[s,r]=yc(e);return Ve(s,r,n,"RFC 2822",e)}static fromHTTP(e,n={}){const[s,r]=gc(e);return Ve(s,r,n,"HTTP",n)}static fromFormat(e,n,s={}){if(E(e)||E(n))throw new U("fromFormat requires an input string and a format");const{locale:r=null,numberingSystem:i=null}=s,o=_.fromOpts({locale:r,numberingSystem:i,defaultToEN:!0}),[a,l,c,f]=qc(o,e,n);return f?k.invalid(f):Ve(a,l,s,`format ${n}`,e,c)}static fromString(e,n,s={}){return k.fromFormat(e,n,s)}static fromSQL(e,n={}){const[s,r]=Oc(e);return Ve(s,r,n,"SQL",e)}static invalid(e,n=null){if(!e)throw new U("need to specify a reason the DateTime is invalid");const s=e instanceof te?e:new te(e,n);if(A.throwOnInvalid)throw new Go(s);return new k({invalid:s})}static isDateTime(e){return e&&e.isLuxonDateTime||!1}static parseFormatForOpts(e,n={}){const s=Rr(e,_.fromObject(n));return s?s.map(r=>r?r.val:null).join(""):null}static expandFormat(e,n={}){return xr(P.parseFormat(e),_.fromObject(n)).map(r=>r.val).join("")}static resetCache(){vt=void 0,_t={}}get(e){return this[e]}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}get outputCalendar(){return this.isValid?this.loc.outputCalendar:null}get zone(){return this._zone}get zoneName(){return this.isValid?this.zone.name:null}get year(){return this.isValid?this.c.year:NaN}get quarter(){return this.isValid?Math.ceil(this.c.month/3):NaN}get month(){return this.isValid?this.c.month:NaN}get day(){return this.isValid?this.c.day:NaN}get hour(){return this.isValid?this.c.hour:NaN}get minute(){return this.isValid?this.c.minute:NaN}get second(){return this.isValid?this.c.second:NaN}get millisecond(){return this.isValid?this.c.millisecond:NaN}get weekYear(){return this.isValid?gn(this).weekYear:NaN}get weekNumber(){return this.isValid?gn(this).weekNumber:NaN}get weekday(){return this.isValid?gn(this).weekday:NaN}get isWeekend(){return this.isValid&&this.loc.getWeekendDays().includes(this.weekday)}get localWeekday(){return this.isValid?wn(this).weekday:NaN}get localWeekNumber(){return this.isValid?wn(this).weekNumber:NaN}get localWeekYear(){return this.isValid?wn(this).weekYear:NaN}get ordinal(){return this.isValid?an(this.c).ordinal:NaN}get monthShort(){return this.isValid?Tt.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?Tt.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?Tt.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?Tt.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}get offset(){return this.isValid?+this.o:NaN}get offsetNameShort(){return this.isValid?this.zone.offsetName(this.ts,{format:"short",locale:this.locale}):null}get offsetNameLong(){return this.isValid?this.zone.offsetName(this.ts,{format:"long",locale:this.locale}):null}get isOffsetFixed(){return this.isValid?this.zone.isUniversal:null}get isInDST(){return this.isOffsetFixed?!1:this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset}getPossibleOffsets(){if(!this.isValid||this.isOffsetFixed)return[this];const e=864e5,n=6e4,s=wt(this.c),r=this.zone.offset(s-e),i=this.zone.offset(s+e),o=this.zone.offset(s-r*n),a=this.zone.offset(s-i*n);if(o===a)return[this];const l=s-o*n,c=s-a*n,f=Ot(l,o),d=Ot(c,a);return f.hour===d.hour&&f.minute===d.minute&&f.second===d.second&&f.millisecond===d.millisecond?[Se(this,{ts:l}),Se(this,{ts:c})]:[this]}get isInLeapYear(){return Ze(this.year)}get daysInMonth(){return gt(this.year,this.month)}get daysInYear(){return this.isValid?_e(this.year):NaN}get weeksInWeekYear(){return this.isValid?je(this.weekYear):NaN}get weeksInLocalWeekYear(){return this.isValid?je(this.localWeekYear,this.loc.getMinDaysInFirstWeek(),this.loc.getStartOfWeek()):NaN}resolvedLocaleOptions(e={}){const{locale:n,numberingSystem:s,calendar:r}=P.create(this.loc.clone(e),e).resolvedOptions(this);return{locale:n,numberingSystem:s,outputCalendar:r}}toUTC(e=0,n={}){return this.setZone(W.instance(e),n)}toLocal(){return this.setZone(A.defaultZone)}setZone(e,{keepLocalTime:n=!1,keepCalendarTime:s=!1}={}){if(e=de(e,A.defaultZone),e.equals(this.zone))return this;if(e.isValid){let r=this.ts;if(n||s){const i=e.offset(this.ts),o=this.toObject();[r]=Nt(o,i,e)}return Se(this,{ts:r,zone:e})}else return k.invalid(Ke(e))}reconfigure({locale:e,numberingSystem:n,outputCalendar:s}={}){const r=this.loc.clone({locale:e,numberingSystem:n,outputCalendar:s});return Se(this,{loc:r})}setLocale(e){return this.reconfigure({locale:e})}set(e){if(!this.isValid)return this;const n=kt(e,$r),{minDaysInFirstWeek:s,startOfWeek:r}=Gs(n,this.loc),i=!E(n.weekYear)||!E(n.weekNumber)||!E(n.weekday),o=!E(n.ordinal),a=!E(n.year),l=!E(n.month)||!E(n.day),c=a||l,f=n.weekYear||n.weekNumber;if((c||o)&&f)throw new Ne("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(l&&o)throw new Ne("Can't mix ordinal dates with month/day");let d;i?d=Ys({...pt(this.c,s,r),...n},s,r):E(n.ordinal)?(d={...this.toObject(),...n},E(n.day)&&(d.day=Math.min(gt(d.year,d.month),d.day))):d=Js({...an(this.c),...n});const[w,m]=Nt(d,this.o,this.zone);return Se(this,{ts:w,o:m})}plus(e){if(!this.isValid)return this;const n=O.fromDurationLike(e);return Se(this,Lr(this,n))}minus(e){if(!this.isValid)return this;const n=O.fromDurationLike(e).negate();return Se(this,Lr(this,n))}startOf(e,{useLocaleWeeks:n=!1}={}){if(!this.isValid)return this;const s={},r=O.normalizeUnit(e);switch(r){case"years":s.month=1;case"quarters":case"months":s.day=1;case"weeks":case"days":s.hour=0;case"hours":s.minute=0;case"minutes":s.second=0;case"seconds":s.millisecond=0;break}if(r==="weeks")if(n){const i=this.loc.getStartOfWeek(),{weekday:o}=this;o<i&&(s.weekNumber=this.weekNumber-1),s.weekday=i}else s.weekday=1;if(r==="quarters"){const i=Math.ceil(this.month/3);s.month=(i-1)*3+1}return this.set(s)}endOf(e,n){return this.isValid?this.plus({[e]:1}).startOf(e,n).minus(1):this}toFormat(e,n={}){return this.isValid?P.create(this.loc.redefaultToEN(n)).formatDateTimeFromString(this,e):yn}toLocaleString(e=ut,n={}){return this.isValid?P.create(this.loc.clone(n),e).formatDateTime(this):yn}toLocaleParts(e={}){return this.isValid?P.create(this.loc.clone(e),e).formatDateTimeParts(this):[]}toISO({format:e="extended",suppressSeconds:n=!1,suppressMilliseconds:s=!1,includeOffset:r=!0,extendedZone:i=!1}={}){if(!this.isValid)return null;const o=e==="extended";let a=En(this,o);return a+="T",a+=Vr(this,o,n,s,r,i),a}toISODate({format:e="extended"}={}){return this.isValid?En(this,e==="extended"):null}toISOWeekDate(){return Ct(this,"kkkk-'W'WW-c")}toISOTime({suppressMilliseconds:e=!1,suppressSeconds:n=!1,includeOffset:s=!0,includePrefix:r=!1,extendedZone:i=!1,format:o="extended"}={}){return this.isValid?(r?"T":"")+Vr(this,o==="extended",n,e,s,i):null}toRFC2822(){return Ct(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return Ct(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return this.isValid?En(this,!0):null}toSQLTime({includeOffset:e=!0,includeZone:n=!1,includeOffsetSpace:s=!0}={}){let r="HH:mm:ss.SSS";return(n||e)&&(s&&(r+=" "),n?r+="z":e&&(r+="ZZ")),Ct(this,r,!0)}toSQL(e={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(e)}`:null}toString(){return this.isValid?this.toISO():yn}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`DateTime { ts: ${this.toISO()}, zone: ${this.zone.name}, locale: ${this.locale} }`:`DateTime { Invalid, reason: ${this.invalidReason} }`}valueOf(){return this.toMillis()}toMillis(){return this.isValid?this.ts:NaN}toSeconds(){return this.isValid?this.ts/1e3:NaN}toUnixInteger(){return this.isValid?Math.floor(this.ts/1e3):NaN}toJSON(){return this.toISO()}toBSON(){return this.toJSDate()}toObject(e={}){if(!this.isValid)return{};const n={...this.c};return e.includeConfig&&(n.outputCalendar=this.outputCalendar,n.numberingSystem=this.loc.numberingSystem,n.locale=this.loc.locale),n}toJSDate(){return new Date(this.isValid?this.ts:NaN)}diff(e,n="milliseconds",s={}){if(!this.isValid||!e.isValid)return O.invalid("created by diffing an invalid DateTime");const r={locale:this.locale,numberingSystem:this.numberingSystem,...s},i=va(n).map(O.normalizeUnit),o=e.valueOf()>this.valueOf(),a=o?this:e,l=o?e:this,c=Mc(a,l,i,r);return o?c.negate():c}diffNow(e="milliseconds",n={}){return this.diff(k.now(),e,n)}until(e){return this.isValid?M.fromDateTimes(this,e):this}hasSame(e,n,s){if(!this.isValid)return!1;const r=e.valueOf(),i=this.setZone(e.zone,{keepLocalTime:!0});return i.startOf(n,s)<=r&&r<=i.endOf(n,s)}equals(e){return this.isValid&&e.isValid&&this.valueOf()===e.valueOf()&&this.zone.equals(e.zone)&&this.loc.equals(e.loc)}toRelative(e={}){if(!this.isValid)return null;const n=e.base||k.fromObject({},{zone:this.zone}),s=e.padding?this<n?-e.padding:e.padding:0;let r=["years","months","days","hours","minutes","seconds"],i=e.unit;return Array.isArray(e.unit)&&(r=e.unit,i=void 0),Pr(n,this.plus(s),{...e,numeric:"always",units:r,unit:i})}toRelativeCalendar(e={}){return this.isValid?Pr(e.base||k.fromObject({},{zone:this.zone}),this,{...e,numeric:"auto",units:["years","months","days"],calendary:!0}):null}static min(...e){if(!e.every(k.isDateTime))throw new U("min requires all arguments be DateTimes");return tr(e,n=>n.valueOf(),Math.min)}static max(...e){if(!e.every(k.isDateTime))throw new U("max requires all arguments be DateTimes");return tr(e,n=>n.valueOf(),Math.max)}static fromFormatExplain(e,n,s={}){const{locale:r=null,numberingSystem:i=null}=s,o=_.fromOpts({locale:r,numberingSystem:i,defaultToEN:!0});return Mr(o,e,n)}static fromStringExplain(e,n,s={}){return k.fromFormatExplain(e,n,s)}static buildFormatParser(e,n={}){const{locale:s=null,numberingSystem:r=null}=n,i=_.fromOpts({locale:s,numberingSystem:r,defaultToEN:!0});return new Ar(i,e)}static fromFormatParser(e,n,s={}){if(E(e)||E(n))throw new U("fromFormatParser requires an input string and a format parser");const{locale:r=null,numberingSystem:i=null}=s,o=_.fromOpts({locale:r,numberingSystem:i,defaultToEN:!0});if(!o.equals(n.locale))throw new U(`fromFormatParser called with a locale of ${o}, but the format parser was created for ${n.locale}`);const{result:a,zone:l,specificOffset:c,invalidReason:f}=n.explainFromTokens(e);return f?k.invalid(f):Ve(a,l,s,`format ${n.format}`,e,c)}static get DATE_SHORT(){return ut}static get DATE_MED(){return ms}static get DATE_MED_WITH_WEEKDAY(){return Qo}static get DATE_FULL(){return ps}static get DATE_HUGE(){return ys}static get TIME_SIMPLE(){return gs}static get TIME_WITH_SECONDS(){return ws}static get TIME_WITH_SHORT_OFFSET(){return Es}static get TIME_WITH_LONG_OFFSET(){return ks}static get TIME_24_SIMPLE(){return Ss}static get TIME_24_WITH_SECONDS(){return Ts}static get TIME_24_WITH_SHORT_OFFSET(){return bs}static get TIME_24_WITH_LONG_OFFSET(){return Os}static get DATETIME_SHORT(){return Ns}static get DATETIME_SHORT_WITH_SECONDS(){return Cs}static get DATETIME_MED(){return vs}static get DATETIME_MED_WITH_SECONDS(){return _s}static get DATETIME_MED_WITH_WEEKDAY(){return ea}static get DATETIME_FULL(){return xs}static get DATETIME_FULL_WITH_SECONDS(){return As}static get DATETIME_HUGE(){return Ms}static get DATETIME_HUGE_WITH_SECONDS(){return Rs}}function Xe(t){if(k.isDateTime(t))return t;if(t&&t.valueOf&&me(t.valueOf()))return k.fromJSDate(t);if(t&&typeof t=="object")return k.fromObject(t);throw new U(`Unknown datetime argument: ${t}, of type ${typeof t}`)}const Gc={},Kc={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},Xc=[u.createElementVNode("path",{fill:"rgb(248 113 113)",d:"M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zm0-384c13.3 0 24 10.7 24 24V264c0 13.3-10.7 24-24 24s-24-10.7-24-24V152c0-13.3 10.7-24 24-24zM224 352a32 32 0 1 1 64 0 32 32 0 1 1 -64 0z"},null,-1)];function Qc(t,e){return u.openBlock(),u.createElementBlock("svg",Kc,Xc)}const el=X(Gc,[["render",Qc]]),tl={class:"messages-container-list"},nl={class:"message-container"},sl={key:0,class:"btn-container-widget"},rl=["onClick"],il={class:"chat-message"},ol=["innerHTML"],al={class:"detail-message flex justify-content-between"},cl={key:0,class:"mr-5"},ll={key:1,class:"mr-5"},ul=X(u.defineComponent({__name:"MessageList",props:{messages:{type:Array,default:()=>[]},canLoadMoreMessages:{type:Boolean,default:!1}},emits:["loadMore","retry"],setup(t,{emit:e}){const n=t,s=u.ref(),{pause:r,resume:i}=Jo(s,([{isIntersecting:a}])=>{a&&e("loadMore")});u.onBeforeMount(()=>{n.canLoadMoreMessages||r()}),u.watch(()=>n.canLoadMoreMessages,a=>{if(a){i();return}r()});function o(a){const l=/(https?:\/\/[^\s]+)/g;return a.replace(l,c=>`<a href="${c}" target="_blank">${c}</a>`)}return(a,l)=>(u.openBlock(),u.createElementBlock(u.Fragment,null,[u.createElementVNode("div",{ref_key:"target",ref:s,class:"target"},null,512),u.createElementVNode("div",tl,[(u.openBlock(!0),u.createElementBlock(u.Fragment,null,u.renderList(n.messages,c=>{var f,d;return u.openBlock(),u.createElementBlock("div",{key:c.id,class:u.normalizeClass(["message",c.esCliente?"message-right":"message-left"])},[u.createElementVNode("div",nl,[c.error&&c.esCliente?(u.openBlock(),u.createElementBlock("div",sl,[u.createElementVNode("button",{text:"",rounded:"",class:"btn-danger",icon:"fa-solid fa-circle-exclamation","aria-label":"Cancel",onClick:w=>e("retry",c)},[u.createVNode(el)],8,rl)])):u.createCommentVNode("",!0),u.createElementVNode("div",il,[u.createElementVNode("div",{class:u.normalizeClass(["bubble",c.esCliente?"right":"left"])},[u.createElementVNode("div",{class:u.normalizeClass(c.esCliente?"content-right":"content-left")},[u.createElementVNode("div",{class:"message-text",innerHTML:o(c.message)},null,8,ol),u.createElementVNode("div",al,[(f=c.sender)!=null&&f.nombreCompleto?(u.openBlock(),u.createElementBlock("span",cl,u.toDisplayString(c.esCliente?(d=c.sender)==null?void 0:d.nombreCompleto:"ECOSISTEMA JL"),1)):(u.openBlock(),u.createElementBlock("span",ll)),u.createElementVNode("span",null,u.toDisplayString(u.unref(k).fromISO(c.createdAt).toFormat("dd-MM-yyyy HH:mm")),1)])],2)],2)])])],2)}),128))])],64))}}),[["__scopeId","data-v-c9967d67"]]),fl={},qr=t=>(u.pushScopeId("data-v-d9a6b2b7"),t=t(),u.popScopeId(),t),hl={viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",style:{width:"28px",height:"28px"}},dl=[qr(()=>u.createElementVNode("path",{d:"M12,1A11,11,0,1,0,23,12,11,11,0,0,0,12,1Zm0,19a8,8,0,1,1,8-8A8,8,0,0,1,12,20Z",opacity:".25"},null,-1)),qr(()=>u.createElementVNode("path",{d:"M10.14,1.16a11,11,0,0,0-9,8.92A1.59,1.59,0,0,0,2.46,12,1.52,1.52,0,0,0,4.11,10.7a8,8,0,0,1,6.66-6.61A1.42,1.42,0,0,0,12,2.69h0A1.57,1.57,0,0,0,10.14,1.16Z",class:"spinner_ajPY"},null,-1))];function ml(t,e){return u.openBlock(),u.createElementBlock("svg",hl,dl)}const pl=X(fl,[["render",ml],["__scopeId","data-v-d9a6b2b7"]]);function yl(t,e,n){for(let s=t.length-1;s>=0;s--)if(t[s][e]===n)return s;return-1}const oe=Object.create(null);oe.open="0",oe.close="1",oe.ping="2",oe.pong="3",oe.message="4",oe.upgrade="5",oe.noop="6";const xt=Object.create(null);Object.keys(oe).forEach(t=>{xt[oe[t]]=t});const kn={type:"error",data:"parser error"},Hr=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",zr=typeof ArrayBuffer=="function",Zr=t=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(t):t&&t.buffer instanceof ArrayBuffer,Sn=({type:t,data:e},n,s)=>Hr&&e instanceof Blob?n?s(e):jr(e,s):zr&&(e instanceof ArrayBuffer||Zr(e))?n?s(e):jr(new Blob([e]),s):s(oe[t]+(e||"")),jr=(t,e)=>{const n=new FileReader;return n.onload=function(){const s=n.result.split(",")[1];e("b"+(s||""))},n.readAsDataURL(t)};function Yr(t){return t instanceof Uint8Array?t:t instanceof ArrayBuffer?new Uint8Array(t):new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}let Tn;function gl(t,e){if(Hr&&t.data instanceof Blob)return t.data.arrayBuffer().then(Yr).then(e);if(zr&&(t.data instanceof ArrayBuffer||Zr(t.data)))return e(Yr(t.data));Sn(t,!1,n=>{Tn||(Tn=new TextEncoder),e(Tn.encode(n))})}const Jr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Qe=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let t=0;t<Jr.length;t++)Qe[Jr.charCodeAt(t)]=t;const wl=t=>{let e=t.length*.75,n=t.length,s,r=0,i,o,a,l;t[t.length-1]==="="&&(e--,t[t.length-2]==="="&&e--);const c=new ArrayBuffer(e),f=new Uint8Array(c);for(s=0;s<n;s+=4)i=Qe[t.charCodeAt(s)],o=Qe[t.charCodeAt(s+1)],a=Qe[t.charCodeAt(s+2)],l=Qe[t.charCodeAt(s+3)],f[r++]=i<<2|o>>4,f[r++]=(o&15)<<4|a>>2,f[r++]=(a&3)<<6|l&63;return c},El=typeof ArrayBuffer=="function",bn=(t,e)=>{if(typeof t!="string")return{type:"message",data:Gr(t,e)};const n=t.charAt(0);return n==="b"?{type:"message",data:kl(t.substring(1),e)}:xt[n]?t.length>1?{type:xt[n],data:t.substring(1)}:{type:xt[n]}:kn},kl=(t,e)=>{if(El){const n=wl(t);return Gr(n,e)}else return{base64:!0,data:t}},Gr=(t,e)=>{switch(e){case"blob":return t instanceof Blob?t:new Blob([t]);case"arraybuffer":default:return t instanceof ArrayBuffer?t:t.buffer}},Kr="",Sl=(t,e)=>{const n=t.length,s=new Array(n);let r=0;t.forEach((i,o)=>{Sn(i,!1,a=>{s[o]=a,++r===n&&e(s.join(Kr))})})},Tl=(t,e)=>{const n=t.split(Kr),s=[];for(let r=0;r<n.length;r++){const i=bn(n[r],e);if(s.push(i),i.type==="error")break}return s};function bl(){return new TransformStream({transform(t,e){gl(t,n=>{const s=n.length;let r;if(s<126)r=new Uint8Array(1),new DataView(r.buffer).setUint8(0,s);else if(s<65536){r=new Uint8Array(3);const i=new DataView(r.buffer);i.setUint8(0,126),i.setUint16(1,s)}else{r=new Uint8Array(9);const i=new DataView(r.buffer);i.setUint8(0,127),i.setBigUint64(1,BigInt(s))}t.data&&typeof t.data!="string"&&(r[0]|=128),e.enqueue(r),e.enqueue(n)})}})}let On;function At(t){return t.reduce((e,n)=>e+n.length,0)}function Mt(t,e){if(t[0].length===e)return t.shift();const n=new Uint8Array(e);let s=0;for(let r=0;r<e;r++)n[r]=t[0][s++],s===t[0].length&&(t.shift(),s=0);return t.length&&s<t[0].length&&(t[0]=t[0].slice(s)),n}function Ol(t,e){On||(On=new TextDecoder);const n=[];let s=0,r=-1,i=!1;return new TransformStream({transform(o,a){for(n.push(o);;){if(s===0){if(At(n)<1)break;const l=Mt(n,1);i=(l[0]&128)===128,r=l[0]&127,r<126?s=3:r===126?s=1:s=2}else if(s===1){if(At(n)<2)break;const l=Mt(n,2);r=new DataView(l.buffer,l.byteOffset,l.length).getUint16(0),s=3}else if(s===2){if(At(n)<8)break;const l=Mt(n,8),c=new DataView(l.buffer,l.byteOffset,l.length),f=c.getUint32(0);if(f>Math.pow(2,21)-1){a.enqueue(kn);break}r=f*Math.pow(2,32)+c.getUint32(4),s=3}else{if(At(n)<r)break;const l=Mt(n,r);a.enqueue(bn(i?l:On.decode(l),e)),s=0}if(r===0||r>t){a.enqueue(kn);break}}}})}const Xr=4;function I(t){if(t)return Nl(t)}function Nl(t){for(var e in I.prototype)t[e]=I.prototype[e];return t}I.prototype.on=I.prototype.addEventListener=function(t,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+t]=this._callbacks["$"+t]||[]).push(e),this},I.prototype.once=function(t,e){function n(){this.off(t,n),e.apply(this,arguments)}return n.fn=e,this.on(t,n),this},I.prototype.off=I.prototype.removeListener=I.prototype.removeAllListeners=I.prototype.removeEventListener=function(t,e){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var n=this._callbacks["$"+t];if(!n)return this;if(arguments.length==1)return delete this._callbacks["$"+t],this;for(var s,r=0;r<n.length;r++)if(s=n[r],s===e||s.fn===e){n.splice(r,1);break}return n.length===0&&delete this._callbacks["$"+t],this},I.prototype.emit=function(t){this._callbacks=this._callbacks||{};for(var e=new Array(arguments.length-1),n=this._callbacks["$"+t],s=1;s<arguments.length;s++)e[s-1]=arguments[s];if(n){n=n.slice(0);for(var s=0,r=n.length;s<r;++s)n[s].apply(this,e)}return this},I.prototype.emitReserved=I.prototype.emit,I.prototype.listeners=function(t){return this._callbacks=this._callbacks||{},this._callbacks["$"+t]||[]},I.prototype.hasListeners=function(t){return!!this.listeners(t).length};const K=typeof self<"u"?self:typeof window<"u"?window:Function("return this")();function Qr(t,...e){return e.reduce((n,s)=>(t.hasOwnProperty(s)&&(n[s]=t[s]),n),{})}const Cl=K.setTimeout,vl=K.clearTimeout;function Rt(t,e){e.useNativeTimers?(t.setTimeoutFn=Cl.bind(K),t.clearTimeoutFn=vl.bind(K)):(t.setTimeoutFn=K.setTimeout.bind(K),t.clearTimeoutFn=K.clearTimeout.bind(K))}const _l=1.33;function xl(t){return typeof t=="string"?Al(t):Math.ceil((t.byteLength||t.size)*_l)}function Al(t){let e=0,n=0;for(let s=0,r=t.length;s<r;s++)e=t.charCodeAt(s),e<128?n+=1:e<2048?n+=2:e<55296||e>=57344?n+=3:(s++,n+=4);return n}function Ml(t){let e="";for(let n in t)t.hasOwnProperty(n)&&(e.length&&(e+="&"),e+=encodeURIComponent(n)+"="+encodeURIComponent(t[n]));return e}function Rl(t){let e={},n=t.split("&");for(let s=0,r=n.length;s<r;s++){let i=n[s].split("=");e[decodeURIComponent(i[0])]=decodeURIComponent(i[1])}return e}class Dl extends Error{constructor(e,n,s){super(e),this.description=n,this.context=s,this.type="TransportError"}}class Nn extends I{constructor(e){super(),this.writable=!1,Rt(this,e),this.opts=e,this.query=e.query,this.socket=e.socket}onError(e,n,s){return super.emitReserved("error",new Dl(e,n,s)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(e){this.readyState==="open"&&this.write(e)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(e){const n=bn(e,this.socket.binaryType);this.onPacket(n)}onPacket(e){super.emitReserved("packet",e)}onClose(e){this.readyState="closed",super.emitReserved("close",e)}pause(e){}createUri(e,n={}){return e+"://"+this._hostname()+this._port()+this.opts.path+this._query(n)}_hostname(){const e=this.opts.hostname;return e.indexOf(":")===-1?e:"["+e+"]"}_port(){return this.opts.port&&(this.opts.secure&&+(this.opts.port!==443)||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(e){const n=Ml(e);return n.length?"?"+n:""}}const ei="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),Cn=64,Il={};let ti=0,Dt=0,ni;function si(t){let e="";do e=ei[t%Cn]+e,t=Math.floor(t/Cn);while(t>0);return e}function ri(){const t=si(+new Date);return t!==ni?(ti=0,ni=t):t+"."+si(ti++)}for(;Dt<Cn;Dt++)Il[ei[Dt]]=Dt;let ii=!1;try{ii=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const Ll=ii;function oi(t){const e=t.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!e||Ll))return new XMLHttpRequest}catch{}if(!e)try{return new K[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}function sf(){}function Vl(){}const Fl=function(){return new oi({xdomain:!1}).responseType!=null}();class Bl extends Nn{constructor(e){if(super(e),this.polling=!1,typeof location<"u"){const s=location.protocol==="https:";let r=location.port;r||(r=s?"443":"80"),this.xd=typeof location<"u"&&e.hostname!==location.hostname||r!==e.port}const n=e&&e.forceBase64;this.supportsBinary=Fl&&!n,this.opts.withCredentials&&(this.cookieJar=void 0)}get name(){return"polling"}doOpen(){this.poll()}pause(e){this.readyState="pausing";const n=()=>{this.readyState="paused",e()};if(this.polling||!this.writable){let s=0;this.polling&&(s++,this.once("pollComplete",function(){--s||n()})),this.writable||(s++,this.once("drain",function(){--s||n()}))}else n()}poll(){this.polling=!0,this.doPoll(),this.emitReserved("poll")}onData(e){const n=s=>{if(this.readyState==="opening"&&s.type==="open"&&this.onOpen(),s.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(s)};Tl(e,this.socket.binaryType).forEach(n),this.readyState!=="closed"&&(this.polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this.poll())}doClose(){const e=()=>{this.write([{type:"close"}])};this.readyState==="open"?e():this.once("open",e)}write(e){this.writable=!1,Sl(e,n=>{this.doWrite(n,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const e=this.opts.secure?"https":"http",n=this.query||{};return this.opts.timestampRequests!==!1&&(n[this.opts.timestampParam]=ri()),!this.supportsBinary&&!n.sid&&(n.b64=1),this.createUri(e,n)}request(e={}){return Object.assign(e,{xd:this.xd,cookieJar:this.cookieJar},this.opts),new ae(this.uri(),e)}doWrite(e,n){const s=this.request({method:"POST",data:e});s.on("success",n),s.on("error",(r,i)=>{this.onError("xhr post error",r,i)})}doPoll(){const e=this.request();e.on("data",this.onData.bind(this)),e.on("error",(n,s)=>{this.onError("xhr poll error",n,s)}),this.pollXhr=e}}class ae extends I{constructor(e,n){super(),Rt(this,n),this.opts=n,this.method=n.method||"GET",this.uri=e,this.data=n.data!==void 0?n.data:null,this.create()}create(){var e;const n=Qr(this.opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");n.xdomain=!!this.opts.xd;const s=this.xhr=new oi(n);try{s.open(this.method,this.uri,!0);try{if(this.opts.extraHeaders){s.setDisableHeaderCheck&&s.setDisableHeaderCheck(!0);for(let r in this.opts.extraHeaders)this.opts.extraHeaders.hasOwnProperty(r)&&s.setRequestHeader(r,this.opts.extraHeaders[r])}}catch{}if(this.method==="POST")try{s.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{s.setRequestHeader("Accept","*/*")}catch{}(e=this.opts.cookieJar)===null||e===void 0||e.addCookies(s),"withCredentials"in s&&(s.withCredentials=this.opts.withCredentials),this.opts.requestTimeout&&(s.timeout=this.opts.requestTimeout),s.onreadystatechange=()=>{var r;s.readyState===3&&((r=this.opts.cookieJar)===null||r===void 0||r.parseCookies(s)),s.readyState===4&&(s.status===200||s.status===1223?this.onLoad():this.setTimeoutFn(()=>{this.onError(typeof s.status=="number"?s.status:0)},0))},s.send(this.data)}catch(r){this.setTimeoutFn(()=>{this.onError(r)},0);return}typeof document<"u"&&(this.index=ae.requestsCount++,ae.requests[this.index]=this)}onError(e){this.emitReserved("error",e,this.xhr),this.cleanup(!0)}cleanup(e){if(!(typeof this.xhr>"u"||this.xhr===null)){if(this.xhr.onreadystatechange=Vl,e)try{this.xhr.abort()}catch{}typeof document<"u"&&delete ae.requests[this.index],this.xhr=null}}onLoad(){const e=this.xhr.responseText;e!==null&&(this.emitReserved("data",e),this.emitReserved("success"),this.cleanup())}abort(){this.cleanup()}}if(ae.requestsCount=0,ae.requests={},typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",ai);else if(typeof addEventListener=="function"){const t="onpagehide"in K?"pagehide":"unload";addEventListener(t,ai,!1)}}function ai(){for(let t in ae.requests)ae.requests.hasOwnProperty(t)&&ae.requests[t].abort()}const vn=typeof Promise=="function"&&typeof Promise.resolve=="function"?e=>Promise.resolve().then(e):(e,n)=>n(e,0),It=K.WebSocket||K.MozWebSocket,ci=!0,$l="arraybuffer",li=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class Ul extends Nn{constructor(e){super(e),this.supportsBinary=!e.forceBase64}get name(){return"websocket"}doOpen(){if(!this.check())return;const e=this.uri(),n=this.opts.protocols,s=li?{}:Qr(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(s.headers=this.opts.extraHeaders);try{this.ws=ci&&!li?n?new It(e,n):new It(e):new It(e,n,s)}catch(r){return this.emitReserved("error",r)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=e=>this.onClose({description:"websocket connection closed",context:e}),this.ws.onmessage=e=>this.onData(e.data),this.ws.onerror=e=>this.onError("websocket error",e)}write(e){this.writable=!1;for(let n=0;n<e.length;n++){const s=e[n],r=n===e.length-1;Sn(s,this.supportsBinary,i=>{const o={};try{ci&&this.ws.send(i)}catch{}r&&vn(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.close(),this.ws=null)}uri(){const e=this.opts.secure?"wss":"ws",n=this.query||{};return this.opts.timestampRequests&&(n[this.opts.timestampParam]=ri()),this.supportsBinary||(n.b64=1),this.createUri(e,n)}check(){return!!It}}class Pl extends Nn{get name(){return"webtransport"}doOpen(){typeof WebTransport=="function"&&(this.transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name]),this.transport.closed.then(()=>{this.onClose()}).catch(e=>{this.onError("webtransport error",e)}),this.transport.ready.then(()=>{this.transport.createBidirectionalStream().then(e=>{const n=Ol(Number.MAX_SAFE_INTEGER,this.socket.binaryType),s=e.readable.pipeThrough(n).getReader(),r=bl();r.readable.pipeTo(e.writable),this.writer=r.writable.getWriter();const i=()=>{s.read().then(({done:a,value:l})=>{a||(this.onPacket(l),i())}).catch(a=>{})};i();const o={type:"open"};this.query.sid&&(o.data=`{"sid":"${this.query.sid}"}`),this.writer.write(o).then(()=>this.onOpen())})}))}write(e){this.writable=!1;for(let n=0;n<e.length;n++){const s=e[n],r=n===e.length-1;this.writer.write(s).then(()=>{r&&vn(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var e;(e=this.transport)===null||e===void 0||e.close()}}const Wl={websocket:Ul,webtransport:Pl,polling:Bl},ql=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,Hl=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function _n(t){const e=t,n=t.indexOf("["),s=t.indexOf("]");n!=-1&&s!=-1&&(t=t.substring(0,n)+t.substring(n,s).replace(/:/g,";")+t.substring(s,t.length));let r=ql.exec(t||""),i={},o=14;for(;o--;)i[Hl[o]]=r[o]||"";return n!=-1&&s!=-1&&(i.source=e,i.host=i.host.substring(1,i.host.length-1).replace(/;/g,":"),i.authority=i.authority.replace("[","").replace("]","").replace(/;/g,":"),i.ipv6uri=!0),i.pathNames=zl(i,i.path),i.queryKey=Zl(i,i.query),i}function zl(t,e){const n=/\/{2,9}/g,s=e.replace(n,"/").split("/");return(e.slice(0,1)=="/"||e.length===0)&&s.splice(0,1),e.slice(-1)=="/"&&s.splice(s.length-1,1),s}function Zl(t,e){const n={};return e.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(s,r,i){r&&(n[r]=i)}),n}let ui=class $e extends I{constructor(e,n={}){super(),this.binaryType=$l,this.writeBuffer=[],e&&typeof e=="object"&&(n=e,e=null),e?(e=_n(e),n.hostname=e.host,n.secure=e.protocol==="https"||e.protocol==="wss",n.port=e.port,e.query&&(n.query=e.query)):n.host&&(n.hostname=_n(n.host).host),Rt(this,n),this.secure=n.secure!=null?n.secure:typeof location<"u"&&location.protocol==="https:",n.hostname&&!n.port&&(n.port=this.secure?"443":"80"),this.hostname=n.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=n.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=n.transports||["polling","websocket","webtransport"],this.writeBuffer=[],this.prevBufferLen=0,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},n),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=Rl(this.opts.query)),this.id=null,this.upgrades=null,this.pingInterval=null,this.pingTimeout=null,this.pingTimeoutTimer=null,typeof addEventListener=="function"&&(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"})},addEventListener("offline",this.offlineEventListener,!1))),this.open()}createTransport(e){const n=Object.assign({},this.opts.query);n.EIO=Xr,n.transport=e,this.id&&(n.sid=this.id);const s=Object.assign({},this.opts,{query:n,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[e]);return new Wl[e](s)}open(){let e;if(this.opts.rememberUpgrade&&$e.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1)e="websocket";else if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}else e=this.transports[0];this.readyState="opening";try{e=this.createTransport(e)}catch{this.transports.shift(),this.open();return}e.open(),this.setTransport(e)}setTransport(e){this.transport&&this.transport.removeAllListeners(),this.transport=e,e.on("drain",this.onDrain.bind(this)).on("packet",this.onPacket.bind(this)).on("error",this.onError.bind(this)).on("close",n=>this.onClose("transport close",n))}probe(e){let n=this.createTransport(e),s=!1;$e.priorWebsocketSuccess=!1;const r=()=>{s||(n.send([{type:"ping",data:"probe"}]),n.once("packet",d=>{if(!s)if(d.type==="pong"&&d.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",n),!n)return;$e.priorWebsocketSuccess=n.name==="websocket",this.transport.pause(()=>{s||this.readyState!=="closed"&&(f(),this.setTransport(n),n.send([{type:"upgrade"}]),this.emitReserved("upgrade",n),n=null,this.upgrading=!1,this.flush())})}else{const w=new Error("probe error");w.transport=n.name,this.emitReserved("upgradeError",w)}}))};function i(){s||(s=!0,f(),n.close(),n=null)}const o=d=>{const w=new Error("probe error: "+d);w.transport=n.name,i(),this.emitReserved("upgradeError",w)};function a(){o("transport closed")}function l(){o("socket closed")}function c(d){n&&d.name!==n.name&&i()}const f=()=>{n.removeListener("open",r),n.removeListener("error",o),n.removeListener("close",a),this.off("close",l),this.off("upgrading",c)};n.once("open",r),n.once("error",o),n.once("close",a),this.once("close",l),this.once("upgrading",c),this.upgrades.indexOf("webtransport")!==-1&&e!=="webtransport"?this.setTimeoutFn(()=>{s||n.open()},200):n.open()}onOpen(){if(this.readyState="open",$e.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush(),this.readyState==="open"&&this.opts.upgrade){let e=0;const n=this.upgrades.length;for(;e<n;e++)this.probe(this.upgrades[e])}}onPacket(e){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",e),this.emitReserved("heartbeat"),this.resetPingTimeout(),e.type){case"open":this.onHandshake(JSON.parse(e.data));break;case"ping":this.sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong");break;case"error":const n=new Error("server error");n.code=e.data,this.onError(n);break;case"message":this.emitReserved("data",e.data),this.emitReserved("message",e.data);break}}onHandshake(e){this.emitReserved("handshake",e),this.id=e.sid,this.transport.query.sid=e.sid,this.upgrades=this.filterUpgrades(e.upgrades),this.pingInterval=e.pingInterval,this.pingTimeout=e.pingTimeout,this.maxPayload=e.maxPayload,this.onOpen(),this.readyState!=="closed"&&this.resetPingTimeout()}resetPingTimeout(){this.clearTimeoutFn(this.pingTimeoutTimer),this.pingTimeoutTimer=this.setTimeoutFn(()=>{this.onClose("ping timeout")},this.pingInterval+this.pingTimeout),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 e=this.getWritablePackets();this.transport.send(e),this.prevBufferLen=e.length,this.emitReserved("flush")}}getWritablePackets(){if(!(this.maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let n=1;for(let s=0;s<this.writeBuffer.length;s++){const r=this.writeBuffer[s].data;if(r&&(n+=xl(r)),s>0&&n>this.maxPayload)return this.writeBuffer.slice(0,s);n+=2}return this.writeBuffer}write(e,n,s){return this.sendPacket("message",e,n,s),this}send(e,n,s){return this.sendPacket("message",e,n,s),this}sendPacket(e,n,s,r){if(typeof n=="function"&&(r=n,n=void 0),typeof s=="function"&&(r=s,s=null),this.readyState==="closing"||this.readyState==="closed")return;s=s||{},s.compress=s.compress!==!1;const i={type:e,data:n,options:s};this.emitReserved("packetCreate",i),this.writeBuffer.push(i),r&&this.once("flush",r),this.flush()}close(){const e=()=>{this.onClose("forced close"),this.transport.close()},n=()=>{this.off("upgrade",n),this.off("upgradeError",n),e()},s=()=>{this.once("upgrade",n),this.once("upgradeError",n)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?s():e()}):this.upgrading?s():e()),this}onError(e){$e.priorWebsocketSuccess=!1,this.emitReserved("error",e),this.onClose("transport error",e)}onClose(e,n){(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")&&(this.clearTimeoutFn(this.pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),typeof removeEventListener=="function"&&(removeEventListener("beforeunload",this.beforeunloadEventListener,!1),removeEventListener("offline",this.offlineEventListener,!1)),this.readyState="closed",this.id=null,this.emitReserved("close",e,n),this.writeBuffer=[],this.prevBufferLen=0)}filterUpgrades(e){const n=[];let s=0;const r=e.length;for(;s<r;s++)~this.transports.indexOf(e[s])&&n.push(e[s]);return n}};ui.protocol=Xr;function jl(t,e="",n){let s=t;n=n||typeof location<"u"&&location,t==null&&(t=n.protocol+"//"+n.host),typeof t=="string"&&(t.charAt(0)==="/"&&(t.charAt(1)==="/"?t=n.protocol+t:t=n.host+t),/^(https?|wss?):\/\//.test(t)||(typeof n<"u"?t=n.protocol+"//"+t:t="https://"+t),s=_n(t)),s.port||(/^(http|ws)$/.test(s.protocol)?s.port="80":/^(http|ws)s$/.test(s.protocol)&&(s.port="443")),s.path=s.path||"/";const i=s.host.indexOf(":")!==-1?"["+s.host+"]":s.host;return s.id=s.protocol+"://"+i+":"+s.port+e,s.href=s.protocol+"://"+i+(n&&n.port===s.port?"":":"+s.port),s}const Yl=typeof ArrayBuffer=="function",Jl=t=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(t):t.buffer instanceof ArrayBuffer,fi=Object.prototype.toString,Gl=typeof Blob=="function"||typeof Blob<"u"&&fi.call(Blob)==="[object BlobConstructor]",Kl=typeof File=="function"||typeof File<"u"&&fi.call(File)==="[object FileConstructor]";function xn(t){return Yl&&(t instanceof ArrayBuffer||Jl(t))||Gl&&t instanceof Blob||Kl&&t instanceof File}function Lt(t,e){if(!t||typeof t!="object")return!1;if(Array.isArray(t)){for(let n=0,s=t.length;n<s;n++)if(Lt(t[n]))return!0;return!1}if(xn(t))return!0;if(t.toJSON&&typeof t.toJSON=="function"&&arguments.length===1)return Lt(t.toJSON(),!0);for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&Lt(t[n]))return!0;return!1}function Xl(t){const e=[],n=t.data,s=t;return s.data=An(n,e),s.attachments=e.length,{packet:s,buffers:e}}function An(t,e){if(!t)return t;if(xn(t)){const n={_placeholder:!0,num:e.length};return e.push(t),n}else if(Array.isArray(t)){const n=new Array(t.length);for(let s=0;s<t.length;s++)n[s]=An(t[s],e);return n}else if(typeof t=="object"&&!(t instanceof Date)){const n={};for(const s in t)Object.prototype.hasOwnProperty.call(t,s)&&(n[s]=An(t[s],e));return n}return t}function Ql(t,e){return t.data=Mn(t.data,e),delete t.attachments,t}function Mn(t,e){if(!t)return t;if(t&&t._placeholder===!0){if(typeof t.num=="number"&&t.num>=0&&t.num<e.length)return e[t.num];throw new Error("illegal attachments")}else if(Array.isArray(t))for(let n=0;n<t.length;n++)t[n]=Mn(t[n],e);else if(typeof t=="object")for(const n in t)Object.prototype.hasOwnProperty.call(t,n)&&(t[n]=Mn(t[n],e));return t}const eu=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],tu=5;var T;(function(t){t[t.CONNECT=0]="CONNECT",t[t.DISCONNECT=1]="DISCONNECT",t[t.EVENT=2]="EVENT",t[t.ACK=3]="ACK",t[t.CONNECT_ERROR=4]="CONNECT_ERROR",t[t.BINARY_EVENT=5]="BINARY_EVENT",t[t.BINARY_ACK=6]="BINARY_ACK"})(T||(T={}));class nu{constructor(e){this.replacer=e}encode(e){return(e.type===T.EVENT||e.type===T.ACK)&&Lt(e)?this.encodeAsBinary({type:e.type===T.EVENT?T.BINARY_EVENT:T.BINARY_ACK,nsp:e.nsp,data:e.data,id:e.id}):[this.encodeAsString(e)]}encodeAsString(e){let n=""+e.type;return(e.type===T.BINARY_EVENT||e.type===T.BINARY_ACK)&&(n+=e.attachments+"-"),e.nsp&&e.nsp!=="/"&&(n+=e.nsp+","),e.id!=null&&(n+=e.id),e.data!=null&&(n+=JSON.stringify(e.data,this.replacer)),n}encodeAsBinary(e){const n=Xl(e),s=this.encodeAsString(n.packet),r=n.buffers;return r.unshift(s),r}}function hi(t){return Object.prototype.toString.call(t)==="[object Object]"}class Rn extends I{constructor(e){super(),this.reviver=e}add(e){let n;if(typeof e=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");n=this.decodeString(e);const s=n.type===T.BINARY_EVENT;s||n.type===T.BINARY_ACK?(n.type=s?T.EVENT:T.ACK,this.reconstructor=new su(n),n.attachments===0&&super.emitReserved("decoded",n)):super.emitReserved("decoded",n)}else if(xn(e)||e.base64)if(this.reconstructor)n=this.reconstructor.takeBinaryData(e),n&&(this.reconstructor=null,super.emitReserved("decoded",n));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+e)}decodeString(e){let n=0;const s={type:Number(e.charAt(0))};if(T[s.type]===void 0)throw new Error("unknown packet type "+s.type);if(s.type===T.BINARY_EVENT||s.type===T.BINARY_ACK){const i=n+1;for(;e.charAt(++n)!=="-"&&n!=e.length;);const o=e.substring(i,n);if(o!=Number(o)||e.charAt(n)!=="-")throw new Error("Illegal attachments");s.attachments=Number(o)}if(e.charAt(n+1)==="/"){const i=n+1;for(;++n&&!(e.charAt(n)===","||n===e.length););s.nsp=e.substring(i,n)}else s.nsp="/";const r=e.charAt(n+1);if(r!==""&&Number(r)==r){const i=n+1;for(;++n;){const o=e.charAt(n);if(o==null||Number(o)!=o){--n;break}if(n===e.length)break}s.id=Number(e.substring(i,n+1))}if(e.charAt(++n)){const i=this.tryParse(e.substr(n));if(Rn.isPayloadValid(s.type,i))s.data=i;else throw new Error("invalid payload")}return s}tryParse(e){try{return JSON.parse(e,this.reviver)}catch{return!1}}static isPayloadValid(e,n){switch(e){case T.CONNECT:return hi(n);case T.DISCONNECT:return n===void 0;case T.CONNECT_ERROR:return typeof n=="string"||hi(n);case T.EVENT:case T.BINARY_EVENT:return Array.isArray(n)&&(typeof n[0]=="number"||typeof n[0]=="string"&&eu.indexOf(n[0])===-1);case T.ACK:case T.BINARY_ACK:return Array.isArray(n)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class su{constructor(e){this.packet=e,this.buffers=[],this.reconPack=e}takeBinaryData(e){if(this.buffers.push(e),this.buffers.length===this.reconPack.attachments){const n=Ql(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const ru=Object.freeze(Object.defineProperty({__proto__:null,Decoder:Rn,Encoder:nu,get PacketType(){return T},protocol:tu},Symbol.toStringTag,{value:"Module"}));function se(t,e,n){return t.on(e,n),function(){t.off(e,n)}}const iu=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class di extends I{constructor(e,n,s){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=e,this.nsp=n,s&&s.auth&&(this.auth=s.auth),this._opts=Object.assign({},s),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const e=this.io;this.subs=[se(e,"open",this.onopen.bind(this)),se(e,"packet",this.onpacket.bind(this)),se(e,"error",this.onerror.bind(this)),se(e,"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(...e){return e.unshift("message"),this.emit.apply(this,e),this}emit(e,...n){if(iu.hasOwnProperty(e))throw new Error('"'+e.toString()+'" is a reserved event name');if(n.unshift(e),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(n),this;const s={type:T.EVENT,data:n};if(s.options={},s.options.compress=this.flags.compress!==!1,typeof n[n.length-1]=="function"){const o=this.ids++,a=n.pop();this._registerAckCallback(o,a),s.id=o}const r=this.io.engine&&this.io.engine.transport&&this.io.engine.transport.writable;return this.flags.volatile&&(!r||!this.connected)||(this.connected?(this.notifyOutgoingListeners(s),this.packet(s)):this.sendBuffer.push(s)),this.flags={},this}_registerAckCallback(e,n){var s;const r=(s=this.flags.timeout)!==null&&s!==void 0?s:this._opts.ackTimeout;if(r===void 0){this.acks[e]=n;return}const i=this.io.setTimeoutFn(()=>{delete this.acks[e];for(let o=0;o<this.sendBuffer.length;o++)this.sendBuffer[o].id===e&&this.sendBuffer.splice(o,1);n.call(this,new Error("operation has timed out"))},r);this.acks[e]=(...o)=>{this.io.clearTimeoutFn(i),n.apply(this,[null,...o])}}emitWithAck(e,...n){const s=this.flags.timeout!==void 0||this._opts.ackTimeout!==void 0;return new Promise((r,i)=>{n.push((o,a)=>s?o?i(o):r(a):r(o)),this.emit(e,...n)})}_addToQueue(e){let n;typeof e[e.length-1]=="function"&&(n=e.pop());const s={id:this._queueSeq++,tryCount:0,pending:!1,args:e,flags:Object.assign({fromQueue:!0},this.flags)};e.push((r,...i)=>s!==this._queue[0]?void 0:(r!==null?s.tryCount>this._opts.retries&&(this._queue.shift(),n&&n(r)):(this._queue.shift(),n&&n(null,...i)),s.pending=!1,this._drainQueue())),this._queue.push(s),this._drainQueue()}_drainQueue(e=!1){if(!this.connected||this._queue.length===0)return;const n=this._queue[0];n.pending&&!e||(n.pending=!0,n.tryCount++,this.flags=n.flags,this.emit.apply(this,n.args))}packet(e){e.nsp=this.nsp,this.io._packet(e)}onopen(){typeof this.auth=="function"?this.auth(e=>{this._sendConnectPacket(e)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(e){this.packet({type:T.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},e):e})}onerror(e){this.connected||this.emitReserved("connect_error",e)}onclose(e,n){this.connected=!1,delete this.id,this.emitReserved("disconnect",e,n)}onpacket(e){if(e.nsp===this.nsp)switch(e.type){case T.CONNECT:e.data&&e.data.sid?this.onconnect(e.data.sid,e.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 T.EVENT:case T.BINARY_EVENT:this.onevent(e);break;case T.ACK:case T.BINARY_ACK:this.onack(e);break;case T.DISCONNECT:this.ondisconnect();break;case T.CONNECT_ERROR:this.destroy();const s=new Error(e.data.message);s.data=e.data.data,this.emitReserved("connect_error",s);break}}onevent(e){const n=e.data||[];e.id!=null&&n.push(this.ack(e.id)),this.connected?this.emitEvent(n):this.receiveBuffer.push(Object.freeze(n))}emitEvent(e){if(this._anyListeners&&this._anyListeners.length){const n=this._anyListeners.slice();for(const s of n)s.apply(this,e)}super.emit.apply(this,e),this._pid&&e.length&&typeof e[e.length-1]=="string"&&(this._lastOffset=e[e.length-1])}ack(e){const n=this;let s=!1;return function(...r){s||(s=!0,n.packet({type:T.ACK,id:e,data:r}))}}onack(e){const n=this.acks[e.id];typeof n=="function"&&(n.apply(this,e.data),delete this.acks[e.id])}onconnect(e,n){this.id=e,this.recovered=n&&this._pid===n,this._pid=n,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(e=>this.emitEvent(e)),this.receiveBuffer=[],this.sendBuffer.forEach(e=>{this.notifyOutgoingListeners(e),this.packet(e)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(e=>e()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:T.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(e){return this.flags.compress=e,this}get volatile(){return this.flags.volatile=!0,this}timeout(e){return this.flags.timeout=e,this}onAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(e),this}prependAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(e),this}offAny(e){if(!this._anyListeners)return this;if(e){const n=this._anyListeners;for(let s=0;s<n.length;s++)if(e===n[s])return n.splice(s,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(e),this}prependAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(e),this}offAnyOutgoing(e){if(!this._anyOutgoingListeners)return this;if(e){const n=this._anyOutgoingListeners;for(let s=0;s<n.length;s++)if(e===n[s])return n.splice(s,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(e){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const n=this._anyOutgoingListeners.slice();for(const s of n)s.apply(this,e.data)}}}function Fe(t){t=t||{},this.ms=t.min||100,this.max=t.max||1e4,this.factor=t.factor||2,this.jitter=t.jitter>0&&t.jitter<=1?t.jitter:0,this.attempts=0}Fe.prototype.duration=function(){var t=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var e=Math.random(),n=Math.floor(e*this.jitter*t);t=Math.floor(e*10)&1?t+n:t-n}return Math.min(t,this.max)|0},Fe.prototype.reset=function(){this.attempts=0},Fe.prototype.setMin=function(t){this.ms=t},Fe.prototype.setMax=function(t){this.max=t},Fe.prototype.setJitter=function(t){this.jitter=t};class Dn extends I{constructor(e,n){var s;super(),this.nsps={},this.subs=[],e&&typeof e=="object"&&(n=e,e=void 0),n=n||{},n.path=n.path||"/socket.io",this.opts=n,Rt(this,n),this.reconnection(n.reconnection!==!1),this.reconnectionAttempts(n.reconnectionAttempts||1/0),this.reconnectionDelay(n.reconnectionDelay||1e3),this.reconnectionDelayMax(n.reconnectionDelayMax||5e3),this.randomizationFactor((s=n.randomizationFactor)!==null&&s!==void 0?s:.5),this.backoff=new Fe({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(n.timeout==null?2e4:n.timeout),this._readyState="closed",this.uri=e;const r=n.parser||ru;this.encoder=new r.Encoder,this.decoder=new r.Decoder,this._autoConnect=n.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(e){return arguments.length?(this._reconnection=!!e,this):this._reconnection}reconnectionAttempts(e){return e===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=e,this)}reconnectionDelay(e){var n;return e===void 0?this._reconnectionDelay:(this._reconnectionDelay=e,(n=this.backoff)===null||n===void 0||n.setMin(e),this)}randomizationFactor(e){var n;return e===void 0?this._randomizationFactor:(this._randomizationFactor=e,(n=this.backoff)===null||n===void 0||n.setJitter(e),this)}reconnectionDelayMax(e){var n;return e===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=e,(n=this.backoff)===null||n===void 0||n.setMax(e),this)}timeout(e){return arguments.length?(this._timeout=e,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(e){if(~this._readyState.indexOf("open"))return this;this.engine=new ui(this.uri,this.opts);const n=this.engine,s=this;this._readyState="opening",this.skipReconnect=!1;const r=se(n,"open",function(){s.onopen(),e&&e()}),i=a=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",a),e?e(a):this.maybeReconnectOnOpen()},o=se(n,"error",i);if(this._timeout!==!1){const a=this._timeout,l=this.setTimeoutFn(()=>{r(),i(new Error("timeout")),n.close()},a);this.opts.autoUnref&&l.unref(),this.subs.push(()=>{this.clearTimeoutFn(l)})}return this.subs.push(r),this.subs.push(o),this}connect(e){return this.open(e)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const e=this.engine;this.subs.push(se(e,"ping",this.onping.bind(this)),se(e,"data",this.ondata.bind(this)),se(e,"error",this.onerror.bind(this)),se(e,"close",this.onclose.bind(this)),se(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(e){try{this.decoder.add(e)}catch(n){this.onclose("parse error",n)}}ondecoded(e){vn(()=>{this.emitReserved("packet",e)},this.setTimeoutFn)}onerror(e){this.emitReserved("error",e)}socket(e,n){let s=this.nsps[e];return s?this._autoConnect&&!s.active&&s.connect():(s=new di(this,e,n),this.nsps[e]=s),s}_destroy(e){const n=Object.keys(this.nsps);for(const s of n)if(this.nsps[s].active)return;this._close()}_packet(e){const n=this.encoder.encode(e);for(let s=0;s<n.length;s++)this.engine.write(n[s],e.options)}cleanup(){this.subs.forEach(e=>e()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close"),this.engine&&this.engine.close()}disconnect(){return this._close()}onclose(e,n){this.cleanup(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",e,n),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const e=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const n=this.backoff.duration();this._reconnecting=!0;const s=this.setTimeoutFn(()=>{e.skipReconnect||(this.emitReserved("reconnect_attempt",e.backoff.attempts),!e.skipReconnect&&e.open(r=>{r?(e._reconnecting=!1,e.reconnect(),this.emitReserved("reconnect_error",r)):e.onreconnect()}))},n);this.opts.autoUnref&&s.unref(),this.subs.push(()=>{this.clearTimeoutFn(s)})}}onreconnect(){const e=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",e)}}const et={};function Vt(t,e){typeof t=="object"&&(e=t,t=void 0),e=e||{};const n=jl(t,e.path||"/socket.io"),s=n.source,r=n.id,i=n.path,o=et[r]&&i in et[r].nsps,a=e.forceNew||e["force new connection"]||e.multiplex===!1||o;let l;return a?l=new Dn(s,e):(et[r]||(et[r]=new Dn(s,e)),l=et[r]),n.query&&!e.query&&(e.query=n.queryKey),l.socket(n.path,e)}Object.assign(Vt,{Manager:Dn,Socket:di,io:Vt,connect:Vt});var mi=(t=>(t.WEBCHAT="webchat",t.CENTRAL="central",t.WHATSAPP="whatsapp",t.TELEGRAM="telegram",t.SMS="sms",t))(mi||{});const ou={class:"widget"},au={class:"header-widget"},cu={class:"title-chat"},lu={key:0,class:"loader"},uu={class:"w-full"},fu=["onSubmit"],hu={class:"form-message"},du={class:"jl-inputgroup-chat"},mu=["onKeyup"],pu={type:"submit",class:"pointer btn-primary"},yu=14,gu=X(u.defineComponent({__name:"Chat",props:{titlePrincipal:{type:String,default:"Comunicación en linea para consultas"},toggleChat:{type:Function,required:!0},tokenAuth:{type:String,required:!0},user:{type:Object,required:!0},visible:{type:Boolean,required:!0}},emits:["show-toast","show-confirm","new-message","clear-new-messages","not-viewed-total"],setup(t,{emit:e}){const n=t,s=u.ref(""),r=u.ref(0),i=u.ref({data:[],canLoadMoreMessages:!1}),o=u.ref(""),a=u.ref(!1),l=u.ref(null);u.watch(()=>n.visible,async S=>{if(!S||(e("clear-new-messages"),m(),r.value>0&&fs(o.value,n.tokenAuth),o.value))return;const v=await us(n.tokenAuth);v&&(o.value=v.appChat.id)});const c=async S=>{var z,F,V;if(((z=s.value)==null?void 0:z.length)>300){e("show-toast",{severity:"warn",summary:"Error",detail:"El mensaje no puede superar los 300 caracteres",life:5e3});return}if(!s.value.trim()){e("show-toast",{severity:"warn",summary:"Error",detail:"Por favor ingrese un mensaje",life:5e3});return}const v={id:Ei(),chatId:(V=(F=R.value)==null?void 0:F.chat)==null?void 0:V.id,message:s.value,visto:!0,multimedia:!1,esCliente:!0,appChatId:o.value,createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),sender:{nombreCompleto:n.user.nombreCompleto,ci:n.user.ci,msPersonaId:n.user.msPersonaId}},$=i.value.data.push(v)-1;f(s.value,o.value).then(q=>{var Be,pi;if(!q)i.value.data[$].error={error:!0,id:v.id},e("show-toast",{severity:"error",summary:"Error",detail:"Ocurrio un error al enviar el mensaje, intente nuevamente",life:5e3});else{i.value.data[$]=q;const qu={...q,chatId:v.chatId};(pi=C.value)==null||pi.emit("sendMessage",{roomId:(Be=R==null?void 0:R.value)==null?void 0:Be.appChat.id,message:qu},Hu=>{console.log("🚀 ~ socketService.value.emit ~ response:",Hu)})}}),s.value="",m(),g.value&&(g.value.style.height="20px")},f=async(S,v)=>Wo({esCliente:!0,message:S,appChatId:v},n.tokenAuth),d=async()=>{var z,F,V;const S=(z=i.value.data[0])==null?void 0:z.id,v={lastMessagesId:S,appChatId:o.value,limit:10};a.value=!0;const $=await Po({body:v,token:n.tokenAuth});a.value=!1,i.value.data.unshift(...$.data.sort((q,Be)=>-Be.createdAt.localeCompare(q.createdAt))),i.value.canLoadMoreMessages=$.pagination.total>$.pagination.size,S&&((F=l.value)!=null&&F.scrollHeight)&&p((V=l.value)==null?void 0:V.scrollHeight),S||m()},w=async S=>{e("show-confirm",async()=>{var $,z,F;if(!(($=S.error)!=null&&$.id))return;const v=await f(S.message,o.value);if(!v)e("show-toast",{severity:"error",summary:"Error",detail:"Ocurrio un error al enviar el mensaje, intente nuevamente",life:5e3});else{const V=yl(i.value.data,"id",S.error.id);i.value.data[V]={...v,error:void 0},(F=C.value)==null||F.emit("sendMessage",{roomId:(z=R==null?void 0:R.value)==null?void 0:z.appChat.id,message:S})}m()})},m=()=>{u.nextTick(()=>{l.value&&(l.value.scrollTop=l.value.scrollHeight)})},p=S=>{u.nextTick(()=>{const v=l.value;v&&(v.scrollTop=v.scrollHeight-S)})},g=u.ref();function x(){g.value&&(g.value.style.height=g.value.scrollHeight-yu+"px",g.value.scrollHeight!==g.value.clientHeight&&(g.value.style.height=g.value.scrollHeight+"px"))}const C=u.ref(),R=u.ref();function le(S,v=mi.WEBCHAT){var $,z;if(!S)throw new Error("user chat is required");C.value=Vt(window.VITE_SOCKET_URI,{query:{usuarioId:`${(z=($=S==null?void 0:S.chat)==null?void 0:$.persona)==null?void 0:z.funcionarioId}`,aplicacion:v},extraHeaders:{Authorization:n.tokenAuth}}),C.value.removeAllListeners(),C.value.on("connect",()=>{var F,V;console.log("Conectado al servidor de sockets"),(V=C.value)==null||V.emit("joinRoom",`${(F=S==null?void 0:S.appChat)==null?void 0:F.id}`)}),C.value.on("disconnect",()=>{console.log("Desconectado del servidor de sockets")}),C.value.on("receiveMessage",F=>{var V,q;console.log("Mensaje recibido:",F.message,S),F.message.sender.msPersonaId!==((q=(V=S==null?void 0:S.chat)==null?void 0:V.persona)==null?void 0:q.msPersonaId)&&(i.value.data.push(F.message),fs(F.message.appChatId,n.tokenAuth),m(),!n.visible&&e("new-message"))})}return u.onMounted(async()=>{if(o.value)return;const S=await us(n.tokenAuth);S&&(R.value=S,o.value=S.appChat.id,r.value=S.appChat.totalNoVistosCliente,le(S),d(),e("not-viewed-total",S.appChat.totalNoVistosCliente))}),u.onUnmounted(()=>{var S;(S=C.value)==null||S.off()}),(S,v)=>(u.openBlock(),u.createElementBlock("div",ou,[u.createElementVNode("div",au,[u.createElementVNode("h4",cu,u.toDisplayString(t.titlePrincipal),1),u.createElementVNode("button",{onClick:v[0]||(v[0]=()=>t.toggleChat()),class:"btn-close"},[u.createVNode(Oi,{class:"pointer"})])]),u.createElementVNode("div",{class:"messages-container",ref_key:"messageContainerRef",ref:l},[a.value?(u.openBlock(),u.createElementBlock("div",lu,[u.createVNode(pl)])):u.createCommentVNode("",!0),u.createVNode(ul,{messages:i.value.data,canLoadMoreMessages:i.value.canLoadMoreMessages,onLoadMore:d,onRetry:w},null,8,["messages","canLoadMoreMessages"])],512),u.createElementVNode("div",uu,[u.createElementVNode("form",{class:"message-send",onSubmit:u.withModifiers(c,["prevent"])},[u.createElementVNode("div",hu,[u.createElementVNode("div",du,[u.withDirectives(u.createElementVNode("textarea",{"onUpdate:modelValue":v[1]||(v[1]=$=>s.value=$),class:"jl2-input-chat",required:"",ref_key:"textAreaRef",ref:g,onInput:v[2]||(v[2]=()=>x()),onKeydown:v[3]||(v[3]=u.withKeys(u.withModifiers(()=>{},["prevent"]),["enter"])),onKeyup:u.withKeys(u.withModifiers(c,["prevent"]),["enter"])},null,40,mu),[[u.vModelText,s.value]]),u.createElementVNode("button",pu,[u.createVNode(xi,{style:{width:"20px",height:"20px"}})])])])],40,fu)])]))}}),[["__scopeId","data-v-30a13c2f"]]),wu={},Eu={width:"87",height:"87",viewBox:"0 0 87 87",fill:"none",xmlns:"http://www.w3.org/2000/svg"},ku=[u.createStaticVNode('<g filter="url(#filter0_d_4007_3488)"><path d="M43.5 77C64.2107 77 81 60.2107 81 39.5C81 18.7893 64.2107 2 43.5 2C22.7893 2 6 18.7893 6 39.5C6 60.2107 22.7893 77 43.5 77Z" fill="white" stroke="#F28B0C" stroke-width="3" stroke-miterlimit="10"></path><path d="M39.705 38.885C40.6908 38.885 41.49 38.0858 41.49 37.1C41.49 36.1142 40.6908 35.315 39.705 35.315C38.7192 35.315 37.92 36.1142 37.92 37.1C37.92 38.0858 38.7192 38.885 39.705 38.885Z" fill="#F28B0C"></path><path d="M45.075 38.885C46.0608 38.885 46.86 38.0858 46.86 37.1C46.86 36.1142 46.0608 35.315 45.075 35.315C44.0892 35.315 43.29 36.1142 43.29 37.1C43.29 38.0858 44.0892 38.885 45.075 38.885Z" fill="#F28B0C"></path><path d="M50.445 38.885C51.4308 38.885 52.23 38.0858 52.23 37.1C52.23 36.1142 51.4308 35.315 50.445 35.315C49.4592 35.315 48.66 36.1142 48.66 37.1C48.66 38.0858 49.4592 38.885 50.445 38.885Z" fill="#F28B0C"></path><path d="M63.27 58.235L58.755 47.78C61.125 44.765 62.415 40.97 62.415 37.175C62.415 26.435 52.665 18.185 41.925 20.12C39.99 19.325 37.98 18.905 35.835 18.905C26.955 18.905 19.785 26.135 19.785 34.955C19.785 38.54 21 41.975 23.145 44.765L18.99 54.44C18.84 54.8 18.915 55.235 19.2 55.445C19.485 55.73 19.92 55.73 20.205 55.595L30.6 50.15C31.89 50.585 33.255 50.87 34.68 50.945C39.48 54.53 45.57 55.25 50.655 53.45L61.905 59.33C62.265 59.48 62.625 59.48 62.91 59.18C63.345 58.97 63.405 58.61 63.27 58.25V58.235ZM51.24 51.71C51.03 51.56 50.745 51.56 50.52 51.635C48.795 52.28 46.935 52.64 45.15 52.64C36.69 52.64 29.61 45.755 29.61 37.1C29.61 29.72 34.845 23.345 42.075 21.845C51.75 19.91 60.705 27.29 60.705 37.1C60.705 40.685 59.415 44.27 57.12 46.985C56.91 47.27 56.835 47.63 56.97 47.915L60.69 56.585L51.24 51.71Z" fill="#F28B0C"></path></g><defs><filter id="filter0_d_4007_3488" x="0.5" y="0.5" width="86" height="86" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feFlood flood-opacity="0" result="BackgroundImageFix"></feFlood><feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"></feColorMatrix><feOffset dy="4"></feOffset><feGaussianBlur stdDeviation="2"></feGaussianBlur><feComposite in2="hardAlpha" operator="out"></feComposite><feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0"></feColorMatrix><feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_4007_3488"></feBlend><feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_4007_3488" result="shape"></feBlend></filter></defs>',2)];function Su(t,e){return u.openBlock(),u.createElementBlock("svg",Eu,ku)}const Tu=X(wu,[["render",Su]]),bu={},Ou={viewBox:"0 0 256 256",version:"1.1",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",preserveAspectRatio:"xMidYMid"},Nu=[u.createElementVNode("g",null,[u.createElementVNode("path",{d:"M128,0 C57.307,0 0,57.307 0,128 L0,128 C0,198.693 57.307,256 128,256 L128,256 C198.693,256 256,198.693 256,128 L256,128 C256,57.307 198.693,0 128,0 L128,0 Z",fill:"#40B3E0"}),u.createElementVNode("path",{d:"M190.2826,73.6308 L167.4206,188.8978 C167.4206,188.8978 164.2236,196.8918 155.4306,193.0548 L102.6726,152.6068 L83.4886,143.3348 L51.1946,132.4628 C51.1946,132.4628 46.2386,130.7048 45.7586,126.8678 C45.2796,123.0308 51.3546,120.9528 51.3546,120.9528 L179.7306,70.5928 C179.7306,70.5928 190.2826,65.9568 190.2826,73.6308",fill:"#FFFFFF"}),u.createElementVNode("path",{d:"M98.6178,187.6035 C98.6178,187.6035 97.0778,187.4595 95.1588,181.3835 C93.2408,175.3085 83.4888,143.3345 83.4888,143.3345 L161.0258,94.0945 C161.0258,94.0945 165.5028,91.3765 165.3428,94.0945 C165.3428,94.0945 166.1418,94.5735 163.7438,96.8115 C161.3458,99.0505 102.8328,151.6475 102.8328,151.6475",fill:"#D2E5F1"}),u.createElementVNode("path",{d:"M122.9015,168.1154 L102.0335,187.1414 C102.0335,187.1414 100.4025,188.3794 98.6175,187.6034 L102.6135,152.2624",fill:"#B5CFE4"})],-1)];function Cu(t,e){return u.openBlock(),u.createElementBlock("svg",Ou,Nu)}const vu=X(bu,[["render",Cu]]),_u={},xu={version:"1.1",id:"Capa_1",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 455.731 455.731","xml:space":"preserve"},Au=[u.createElementVNode("g",null,[u.createElementVNode("rect",{x:"0",y:"0",style:{fill:"#1bd741"},width:"455.731",height:"455.731"}),u.createElementVNode("g",null,[u.createElementVNode("path",{style:{fill:"#ffffff"},d:`M68.494,387.41l22.323-79.284c-14.355-24.387-21.913-52.134-21.913-80.638
1
+ (function(ue,u){typeof exports=="object"&&typeof module<"u"?u(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],u):(ue=typeof globalThis<"u"?globalThis:ue||self,u(ue["vue-wiguet-chatweb"]={},ue.Vue))})(this,function(ue,u){"use strict";let tt;const gi=new Uint8Array(16);function wi(){if(!tt&&(tt=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!tt))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return tt(gi)}const $=[];for(let t=0;t<256;++t)$.push((t+256).toString(16).slice(1));function Ei(t,e=0){return $[t[e+0]]+$[t[e+1]]+$[t[e+2]]+$[t[e+3]]+"-"+$[t[e+4]]+$[t[e+5]]+"-"+$[t[e+6]]+$[t[e+7]]+"-"+$[t[e+8]]+$[t[e+9]]+"-"+$[t[e+10]]+$[t[e+11]]+$[t[e+12]]+$[t[e+13]]+$[t[e+14]]+$[t[e+15]]}const Ln={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function ki(t,e,n){if(Ln.randomUUID&&!e&&!t)return Ln.randomUUID();t=t||{};const s=t.random||(t.rng||wi)();return s[6]=s[6]&15|64,s[8]=s[8]&63|128,Ei(s)}const X=(t,e)=>{const n=t.__vccOpts||t;for(const[s,r]of e)n[s]=r;return n},Si={},bi={width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Ti=[u.createElementVNode("path",{d:"M16 31C24.2843 31 31 24.2843 31 16C31 7.71573 24.2843 1 16 1C7.71573 1 1 7.71573 1 16C1 24.2843 7.71573 31 16 31Z",stroke:"#B3B3B3","stroke-miterlimit":"10"},null,-1),u.createElementVNode("path",{d:"M19.78 22.3L15.98 16.63H15.9601L12.2001 22.3H11.0701L15.37 15.8899L11.25 9.69995H12.38L15.98 15.08H16L19.67 9.69995H20.8L16.55 15.82L20.92 22.3H19.77H19.78Z",fill:"#B3B3B3"},null,-1)];function Oi(t,e){return u.openBlock(),u.createElementBlock("svg",bi,Ti)}const Ni=X(Si,[["render",Oi]]),Ci={},vi={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},_i=[u.createElementVNode("path",{fill:"#F28B0C",d:"M16.1 260.2c-22.6 12.9-20.5 47.3 3.6 57.3L160 376V479.3c0 18.1 14.6 32.7 32.7 32.7c9.7 0 18.9-4.3 25.1-11.8l62-74.3 123.9 51.6c18.9 7.9 40.8-4.5 43.9-24.7l64-416c1.9-12.1-3.4-24.3-13.5-31.2s-23.3-7.5-34-1.4l-448 256zm52.1 25.5L409.7 90.6 190.1 336l1.2 1L68.2 285.7zM403.3 425.4L236.7 355.9 450.8 116.6 403.3 425.4z"},null,-1)];function xi(t,e){return u.openBlock(),u.createElementBlock("svg",vi,_i)}const Ai=X(Ci,[["render",xi]]);function Vn(t,e){return function(){return t.apply(e,arguments)}}const{toString:Mi}=Object.prototype,{getPrototypeOf:Bt}=Object,nt=(t=>e=>{const n=Mi.call(e);return t[n]||(t[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),re=t=>(t=t.toLowerCase(),e=>nt(e)===t),st=t=>e=>typeof e===t,{isArray:be}=Array,$e=st("undefined");function Di(t){return t!==null&&!$e(t)&&t.constructor!==null&&!$e(t.constructor)&&Z(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const Fn=re("ArrayBuffer");function Ri(t){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&Fn(t.buffer),e}const Ii=st("string"),Z=st("function"),Bn=st("number"),rt=t=>t!==null&&typeof t=="object",Li=t=>t===!0||t===!1,it=t=>{if(nt(t)!=="object")return!1;const e=Bt(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)},Vi=re("Date"),Fi=re("File"),Bi=re("Blob"),$i=re("FileList"),Ui=t=>rt(t)&&Z(t.pipe),Pi=t=>{let e;return t&&(typeof FormData=="function"&&t instanceof FormData||Z(t.append)&&((e=nt(t))==="formdata"||e==="object"&&Z(t.toString)&&t.toString()==="[object FormData]"))},Wi=re("URLSearchParams"),qi=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Ue(t,e,{allOwnKeys:n=!1}={}){if(t===null||typeof t>"u")return;let s,r;if(typeof t!="object"&&(t=[t]),be(t))for(s=0,r=t.length;s<r;s++)e.call(null,t[s],s,t);else{const i=n?Object.getOwnPropertyNames(t):Object.keys(t),o=i.length;let a;for(s=0;s<o;s++)a=i[s],e.call(null,t[a],a,t)}}function $n(t,e){e=e.toLowerCase();const n=Object.keys(t);let s=n.length,r;for(;s-- >0;)if(r=n[s],e===r.toLowerCase())return r;return null}const Un=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Pn=t=>!$e(t)&&t!==Un;function $t(){const{caseless:t}=Pn(this)&&this||{},e={},n=(s,r)=>{const i=t&&$n(e,r)||r;it(e[i])&&it(s)?e[i]=$t(e[i],s):it(s)?e[i]=$t({},s):be(s)?e[i]=s.slice():e[i]=s};for(let s=0,r=arguments.length;s<r;s++)arguments[s]&&Ue(arguments[s],n);return e}const Hi=(t,e,n,{allOwnKeys:s}={})=>(Ue(e,(r,i)=>{n&&Z(r)?t[i]=Vn(r,n):t[i]=r},{allOwnKeys:s}),t),zi=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),Zi=(t,e,n,s)=>{t.prototype=Object.create(e.prototype,s),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),n&&Object.assign(t.prototype,n)},ji=(t,e,n,s)=>{let r,i,o;const a={};if(e=e||{},t==null)return e;do{for(r=Object.getOwnPropertyNames(t),i=r.length;i-- >0;)o=r[i],(!s||s(o,t,e))&&!a[o]&&(e[o]=t[o],a[o]=!0);t=n!==!1&&Bt(t)}while(t&&(!n||n(t,e))&&t!==Object.prototype);return e},Yi=(t,e,n)=>{t=String(t),(n===void 0||n>t.length)&&(n=t.length),n-=e.length;const s=t.indexOf(e,n);return s!==-1&&s===n},Ji=t=>{if(!t)return null;if(be(t))return t;let e=t.length;if(!Bn(e))return null;const n=new Array(e);for(;e-- >0;)n[e]=t[e];return n},Gi=(t=>e=>t&&e instanceof t)(typeof Uint8Array<"u"&&Bt(Uint8Array)),Ki=(t,e)=>{const s=(t&&t[Symbol.iterator]).call(t);let r;for(;(r=s.next())&&!r.done;){const i=r.value;e.call(t,i[0],i[1])}},Xi=(t,e)=>{let n;const s=[];for(;(n=t.exec(e))!==null;)s.push(n);return s},Qi=re("HTMLFormElement"),eo=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,s,r){return s.toUpperCase()+r}),Wn=(({hasOwnProperty:t})=>(e,n)=>t.call(e,n))(Object.prototype),to=re("RegExp"),qn=(t,e)=>{const n=Object.getOwnPropertyDescriptors(t),s={};Ue(n,(r,i)=>{e(r,i,t)!==!1&&(s[i]=r)}),Object.defineProperties(t,s)},no=t=>{qn(t,(e,n)=>{if(Z(t)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const s=t[n];if(Z(s)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},so=(t,e)=>{const n={},s=r=>{r.forEach(i=>{n[i]=!0})};return be(t)?s(t):s(String(t).split(e)),n},ro=()=>{},io=(t,e)=>(t=+t,Number.isFinite(t)?t:e),Ut="abcdefghijklmnopqrstuvwxyz",Hn="0123456789",zn={DIGIT:Hn,ALPHA:Ut,ALPHA_DIGIT:Ut+Ut.toUpperCase()+Hn},oo=(t=16,e=zn.ALPHA_DIGIT)=>{let n="";const{length:s}=e;for(;t--;)n+=e[Math.random()*s|0];return n};function ao(t){return!!(t&&Z(t.append)&&t[Symbol.toStringTag]==="FormData"&&t[Symbol.iterator])}const co=t=>{const e=new Array(10),n=(s,r)=>{if(rt(s)){if(e.indexOf(s)>=0)return;if(!("toJSON"in s)){e[r]=s;const i=be(s)?[]:{};return Ue(s,(o,a)=>{const l=n(o,r+1);!$e(l)&&(i[a]=l)}),e[r]=void 0,i}}return s};return n(t,0)},lo=re("AsyncFunction"),h={isArray:be,isArrayBuffer:Fn,isBuffer:Di,isFormData:Pi,isArrayBufferView:Ri,isString:Ii,isNumber:Bn,isBoolean:Li,isObject:rt,isPlainObject:it,isUndefined:$e,isDate:Vi,isFile:Fi,isBlob:Bi,isRegExp:to,isFunction:Z,isStream:Ui,isURLSearchParams:Wi,isTypedArray:Gi,isFileList:$i,forEach:Ue,merge:$t,extend:Hi,trim:qi,stripBOM:zi,inherits:Zi,toFlatObject:ji,kindOf:nt,kindOfTest:re,endsWith:Yi,toArray:Ji,forEachEntry:Ki,matchAll:Xi,isHTMLForm:Qi,hasOwnProperty:Wn,hasOwnProp:Wn,reduceDescriptors:qn,freezeMethods:no,toObjectSet:so,toCamelCase:eo,noop:ro,toFiniteNumber:io,findKey:$n,global:Un,isContextDefined:Pn,ALPHABET:zn,generateString:oo,isSpecCompliantForm:ao,toJSONObject:co,isAsyncFn:lo,isThenable:t=>t&&(rt(t)||Z(t))&&Z(t.then)&&Z(t.catch)};function O(t,e,n,s,r){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=t,this.name="AxiosError",e&&(this.code=e),n&&(this.config=n),s&&(this.request=s),r&&(this.response=r)}h.inherits(O,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:h.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const Zn=O.prototype,jn={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(t=>{jn[t]={value:t}}),Object.defineProperties(O,jn),Object.defineProperty(Zn,"isAxiosError",{value:!0}),O.from=(t,e,n,s,r,i)=>{const o=Object.create(Zn);return h.toFlatObject(t,o,function(l){return l!==Error.prototype},a=>a!=="isAxiosError"),O.call(o,t.message,e,n,s,r),o.cause=t,o.name=t.name,i&&Object.assign(o,i),o};const uo=null;function Pt(t){return h.isPlainObject(t)||h.isArray(t)}function Yn(t){return h.endsWith(t,"[]")?t.slice(0,-2):t}function Jn(t,e,n){return t?t.concat(e).map(function(r,i){return r=Yn(r),!n&&i?"["+r+"]":r}).join(n?".":""):e}function fo(t){return h.isArray(t)&&!t.some(Pt)}const ho=h.toFlatObject(h,{},null,function(e){return/^is[A-Z]/.test(e)});function ot(t,e,n){if(!h.isObject(t))throw new TypeError("target must be an object");e=e||new FormData,n=h.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(k,T){return!h.isUndefined(T[k])});const s=n.metaTokens,r=n.visitor||f,i=n.dots,o=n.indexes,l=(n.Blob||typeof Blob<"u"&&Blob)&&h.isSpecCompliantForm(e);if(!h.isFunction(r))throw new TypeError("visitor must be a function");function c(m){if(m===null)return"";if(h.isDate(m))return m.toISOString();if(!l&&h.isBlob(m))throw new O("Blob is not supported. Use a Buffer instead.");return h.isArrayBuffer(m)||h.isTypedArray(m)?l&&typeof Blob=="function"?new Blob([m]):Buffer.from(m):m}function f(m,k,T){let x=m;if(m&&!T&&typeof m=="object"){if(h.endsWith(k,"{}"))k=s?k:k.slice(0,-2),m=JSON.stringify(m);else if(h.isArray(m)&&fo(m)||(h.isFileList(m)||h.endsWith(k,"[]"))&&(x=h.toArray(m)))return k=Yn(k),x.forEach(function(W,et){!(h.isUndefined(W)||W===null)&&e.append(o===!0?Jn([k],et,i):o===null?k:k+"[]",c(W))}),!1}return Pt(m)?!0:(e.append(Jn(T,k,i),c(m)),!1)}const d=[],g=Object.assign(ho,{defaultVisitor:f,convertValue:c,isVisitable:Pt});function y(m,k){if(!h.isUndefined(m)){if(d.indexOf(m)!==-1)throw Error("Circular reference detected in "+k.join("."));d.push(m),h.forEach(m,function(x,D){(!(h.isUndefined(x)||x===null)&&r.call(e,x,h.isString(D)?D.trim():D,k,g))===!0&&y(x,k?k.concat(D):[D])}),d.pop()}}if(!h.isObject(t))throw new TypeError("data must be an object");return y(t),e}function Gn(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(s){return e[s]})}function Wt(t,e){this._pairs=[],t&&ot(t,this,e)}const Kn=Wt.prototype;Kn.append=function(e,n){this._pairs.push([e,n])},Kn.toString=function(e){const n=e?function(s){return e.call(this,s,Gn)}:Gn;return this._pairs.map(function(r){return n(r[0])+"="+n(r[1])},"").join("&")};function mo(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Xn(t,e,n){if(!e)return t;const s=n&&n.encode||mo,r=n&&n.serialize;let i;if(r?i=r(e,n):i=h.isURLSearchParams(e)?e.toString():new Wt(e,n).toString(s),i){const o=t.indexOf("#");o!==-1&&(t=t.slice(0,o)),t+=(t.indexOf("?")===-1?"?":"&")+i}return t}class Qn{constructor(){this.handlers=[]}use(e,n,s){return this.handlers.push({fulfilled:e,rejected:n,synchronous:s?s.synchronous:!1,runWhen:s?s.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){h.forEach(this.handlers,function(s){s!==null&&e(s)})}}const es={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},po=typeof URLSearchParams<"u"?URLSearchParams:Wt,yo=typeof FormData<"u"?FormData:null,go=typeof Blob<"u"?Blob:null,wo=(()=>{let t;return typeof navigator<"u"&&((t=navigator.product)==="ReactNative"||t==="NativeScript"||t==="NS")?!1:typeof window<"u"&&typeof document<"u"})(),Eo=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",ie={isBrowser:!0,classes:{URLSearchParams:po,FormData:yo,Blob:go},isStandardBrowserEnv:wo,isStandardBrowserWebWorkerEnv:Eo,protocols:["http","https","file","blob","url","data"]};function ko(t,e){return ot(t,new ie.classes.URLSearchParams,Object.assign({visitor:function(n,s,r,i){return ie.isNode&&h.isBuffer(n)?(this.append(s,n.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)}},e))}function So(t){return h.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}function bo(t){const e={},n=Object.keys(t);let s;const r=n.length;let i;for(s=0;s<r;s++)i=n[s],e[i]=t[i];return e}function ts(t){function e(n,s,r,i){let o=n[i++];const a=Number.isFinite(+o),l=i>=n.length;return o=!o&&h.isArray(r)?r.length:o,l?(h.hasOwnProp(r,o)?r[o]=[r[o],s]:r[o]=s,!a):((!r[o]||!h.isObject(r[o]))&&(r[o]=[]),e(n,s,r[o],i)&&h.isArray(r[o])&&(r[o]=bo(r[o])),!a)}if(h.isFormData(t)&&h.isFunction(t.entries)){const n={};return h.forEachEntry(t,(s,r)=>{e(So(s),r,n,0)}),n}return null}const To={"Content-Type":void 0};function Oo(t,e,n){if(h.isString(t))try{return(e||JSON.parse)(t),h.trim(t)}catch(s){if(s.name!=="SyntaxError")throw s}return(n||JSON.stringify)(t)}const Te={transitional:es,adapter:["xhr","http"],transformRequest:[function(e,n){const s=n.getContentType()||"",r=s.indexOf("application/json")>-1,i=h.isObject(e);if(i&&h.isHTMLForm(e)&&(e=new FormData(e)),h.isFormData(e))return r&&r?JSON.stringify(ts(e)):e;if(h.isArrayBuffer(e)||h.isBuffer(e)||h.isStream(e)||h.isFile(e)||h.isBlob(e))return e;if(h.isArrayBufferView(e))return e.buffer;if(h.isURLSearchParams(e))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let a;if(i){if(s.indexOf("application/x-www-form-urlencoded")>-1)return ko(e,this.formSerializer).toString();if((a=h.isFileList(e))||s.indexOf("multipart/form-data")>-1){const l=this.env&&this.env.FormData;return ot(a?{"files[]":e}:e,l&&new l,this.formSerializer)}}return i||r?(n.setContentType("application/json",!1),Oo(e)):e}],transformResponse:[function(e){const n=this.transitional||Te.transitional,s=n&&n.forcedJSONParsing,r=this.responseType==="json";if(e&&h.isString(e)&&(s&&!this.responseType||r)){const o=!(n&&n.silentJSONParsing)&&r;try{return JSON.parse(e)}catch(a){if(o)throw a.name==="SyntaxError"?O.from(a,O.ERR_BAD_RESPONSE,this,null,this.response):a}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:ie.classes.FormData,Blob:ie.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};h.forEach(["delete","get","head"],function(e){Te.headers[e]={}}),h.forEach(["post","put","patch"],function(e){Te.headers[e]=h.merge(To)});const No=h.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Co=t=>{const e={};let n,s,r;return t&&t.split(`
2
+ `).forEach(function(o){r=o.indexOf(":"),n=o.substring(0,r).trim().toLowerCase(),s=o.substring(r+1).trim(),!(!n||e[n]&&No[n])&&(n==="set-cookie"?e[n]?e[n].push(s):e[n]=[s]:e[n]=e[n]?e[n]+", "+s:s)}),e},ns=Symbol("internals");function Pe(t){return t&&String(t).trim().toLowerCase()}function at(t){return t===!1||t==null?t:h.isArray(t)?t.map(at):String(t)}function vo(t){const e=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let s;for(;s=n.exec(t);)e[s[1]]=s[2];return e}const _o=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());function qt(t,e,n,s,r){if(h.isFunction(s))return s.call(this,e,n);if(r&&(e=n),!!h.isString(e)){if(h.isString(s))return e.indexOf(s)!==-1;if(h.isRegExp(s))return s.test(e)}}function xo(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,n,s)=>n.toUpperCase()+s)}function Ao(t,e){const n=h.toCamelCase(" "+e);["get","set","has"].forEach(s=>{Object.defineProperty(t,s+n,{value:function(r,i,o){return this[s].call(this,e,r,i,o)},configurable:!0})})}class j{constructor(e){e&&this.set(e)}set(e,n,s){const r=this;function i(a,l,c){const f=Pe(l);if(!f)throw new Error("header name must be a non-empty string");const d=h.findKey(r,f);(!d||r[d]===void 0||c===!0||c===void 0&&r[d]!==!1)&&(r[d||l]=at(a))}const o=(a,l)=>h.forEach(a,(c,f)=>i(c,f,l));return h.isPlainObject(e)||e instanceof this.constructor?o(e,n):h.isString(e)&&(e=e.trim())&&!_o(e)?o(Co(e),n):e!=null&&i(n,e,s),this}get(e,n){if(e=Pe(e),e){const s=h.findKey(this,e);if(s){const r=this[s];if(!n)return r;if(n===!0)return vo(r);if(h.isFunction(n))return n.call(this,r,s);if(h.isRegExp(n))return n.exec(r);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,n){if(e=Pe(e),e){const s=h.findKey(this,e);return!!(s&&this[s]!==void 0&&(!n||qt(this,this[s],s,n)))}return!1}delete(e,n){const s=this;let r=!1;function i(o){if(o=Pe(o),o){const a=h.findKey(s,o);a&&(!n||qt(s,s[a],a,n))&&(delete s[a],r=!0)}}return h.isArray(e)?e.forEach(i):i(e),r}clear(e){const n=Object.keys(this);let s=n.length,r=!1;for(;s--;){const i=n[s];(!e||qt(this,this[i],i,e,!0))&&(delete this[i],r=!0)}return r}normalize(e){const n=this,s={};return h.forEach(this,(r,i)=>{const o=h.findKey(s,i);if(o){n[o]=at(r),delete n[i];return}const a=e?xo(i):String(i).trim();a!==i&&delete n[i],n[a]=at(r),s[a]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const n=Object.create(null);return h.forEach(this,(s,r)=>{s!=null&&s!==!1&&(n[r]=e&&h.isArray(s)?s.join(", "):s)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,n])=>e+": "+n).join(`
3
+ `)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...n){const s=new this(e);return n.forEach(r=>s.set(r)),s}static accessor(e){const s=(this[ns]=this[ns]={accessors:{}}).accessors,r=this.prototype;function i(o){const a=Pe(o);s[a]||(Ao(r,o),s[a]=!0)}return h.isArray(e)?e.forEach(i):i(e),this}}j.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),h.freezeMethods(j.prototype),h.freezeMethods(j);function Ht(t,e){const n=this||Te,s=e||n,r=j.from(s.headers);let i=s.data;return h.forEach(t,function(a){i=a.call(n,i,r.normalize(),e?e.status:void 0)}),r.normalize(),i}function ss(t){return!!(t&&t.__CANCEL__)}function We(t,e,n){O.call(this,t??"canceled",O.ERR_CANCELED,e,n),this.name="CanceledError"}h.inherits(We,O,{__CANCEL__:!0});function Mo(t,e,n){const s=n.config.validateStatus;!n.status||!s||s(n.status)?t(n):e(new O("Request failed with status code "+n.status,[O.ERR_BAD_REQUEST,O.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}const Do=ie.isStandardBrowserEnv?function(){return{write:function(n,s,r,i,o,a){const l=[];l.push(n+"="+encodeURIComponent(s)),h.isNumber(r)&&l.push("expires="+new Date(r).toGMTString()),h.isString(i)&&l.push("path="+i),h.isString(o)&&l.push("domain="+o),a===!0&&l.push("secure"),document.cookie=l.join("; ")},read:function(n){const s=document.cookie.match(new RegExp("(^|;\\s*)("+n+")=([^;]*)"));return s?decodeURIComponent(s[3]):null},remove:function(n){this.write(n,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}();function Ro(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function Io(t,e){return e?t.replace(/\/+$/,"")+"/"+e.replace(/^\/+/,""):t}function rs(t,e){return t&&!Ro(e)?Io(t,e):e}const Lo=ie.isStandardBrowserEnv?function(){const e=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");let s;function r(i){let o=i;return e&&(n.setAttribute("href",o),o=n.href),n.setAttribute("href",o),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:n.pathname.charAt(0)==="/"?n.pathname:"/"+n.pathname}}return s=r(window.location.href),function(o){const a=h.isString(o)?r(o):o;return a.protocol===s.protocol&&a.host===s.host}}():function(){return function(){return!0}}();function Vo(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function Fo(t,e){t=t||10;const n=new Array(t),s=new Array(t);let r=0,i=0,o;return e=e!==void 0?e:1e3,function(l){const c=Date.now(),f=s[i];o||(o=c),n[r]=l,s[r]=c;let d=i,g=0;for(;d!==r;)g+=n[d++],d=d%t;if(r=(r+1)%t,r===i&&(i=(i+1)%t),c-o<e)return;const y=f&&c-f;return y?Math.round(g*1e3/y):void 0}}function is(t,e){let n=0;const s=Fo(50,250);return r=>{const i=r.loaded,o=r.lengthComputable?r.total:void 0,a=i-n,l=s(a),c=i<=o;n=i;const f={loaded:i,total:o,progress:o?i/o:void 0,bytes:a,rate:l||void 0,estimated:l&&o&&c?(o-i)/l:void 0,event:r};f[e?"download":"upload"]=!0,t(f)}}const ct={http:uo,xhr:typeof XMLHttpRequest<"u"&&function(t){return new Promise(function(n,s){let r=t.data;const i=j.from(t.headers).normalize(),o=t.responseType;let a;function l(){t.cancelToken&&t.cancelToken.unsubscribe(a),t.signal&&t.signal.removeEventListener("abort",a)}h.isFormData(r)&&(ie.isStandardBrowserEnv||ie.isStandardBrowserWebWorkerEnv?i.setContentType(!1):i.setContentType("multipart/form-data;",!1));let c=new XMLHttpRequest;if(t.auth){const y=t.auth.username||"",m=t.auth.password?unescape(encodeURIComponent(t.auth.password)):"";i.set("Authorization","Basic "+btoa(y+":"+m))}const f=rs(t.baseURL,t.url);c.open(t.method.toUpperCase(),Xn(f,t.params,t.paramsSerializer),!0),c.timeout=t.timeout;function d(){if(!c)return;const y=j.from("getAllResponseHeaders"in c&&c.getAllResponseHeaders()),k={data:!o||o==="text"||o==="json"?c.responseText:c.response,status:c.status,statusText:c.statusText,headers:y,config:t,request:c};Mo(function(x){n(x),l()},function(x){s(x),l()},k),c=null}if("onloadend"in c?c.onloadend=d:c.onreadystatechange=function(){!c||c.readyState!==4||c.status===0&&!(c.responseURL&&c.responseURL.indexOf("file:")===0)||setTimeout(d)},c.onabort=function(){c&&(s(new O("Request aborted",O.ECONNABORTED,t,c)),c=null)},c.onerror=function(){s(new O("Network Error",O.ERR_NETWORK,t,c)),c=null},c.ontimeout=function(){let m=t.timeout?"timeout of "+t.timeout+"ms exceeded":"timeout exceeded";const k=t.transitional||es;t.timeoutErrorMessage&&(m=t.timeoutErrorMessage),s(new O(m,k.clarifyTimeoutError?O.ETIMEDOUT:O.ECONNABORTED,t,c)),c=null},ie.isStandardBrowserEnv){const y=(t.withCredentials||Lo(f))&&t.xsrfCookieName&&Do.read(t.xsrfCookieName);y&&i.set(t.xsrfHeaderName,y)}r===void 0&&i.setContentType(null),"setRequestHeader"in c&&h.forEach(i.toJSON(),function(m,k){c.setRequestHeader(k,m)}),h.isUndefined(t.withCredentials)||(c.withCredentials=!!t.withCredentials),o&&o!=="json"&&(c.responseType=t.responseType),typeof t.onDownloadProgress=="function"&&c.addEventListener("progress",is(t.onDownloadProgress,!0)),typeof t.onUploadProgress=="function"&&c.upload&&c.upload.addEventListener("progress",is(t.onUploadProgress)),(t.cancelToken||t.signal)&&(a=y=>{c&&(s(!y||y.type?new We(null,t,c):y),c.abort(),c=null)},t.cancelToken&&t.cancelToken.subscribe(a),t.signal&&(t.signal.aborted?a():t.signal.addEventListener("abort",a)));const g=Vo(f);if(g&&ie.protocols.indexOf(g)===-1){s(new O("Unsupported protocol "+g+":",O.ERR_BAD_REQUEST,t));return}c.send(r||null)})}};h.forEach(ct,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch{}Object.defineProperty(t,"adapterName",{value:e})}});const Bo={getAdapter:t=>{t=h.isArray(t)?t:[t];const{length:e}=t;let n,s;for(let r=0;r<e&&(n=t[r],!(s=h.isString(n)?ct[n.toLowerCase()]:n));r++);if(!s)throw s===!1?new O(`Adapter ${n} is not supported by the environment`,"ERR_NOT_SUPPORT"):new Error(h.hasOwnProp(ct,n)?`Adapter '${n}' is not available in the build`:`Unknown adapter '${n}'`);if(!h.isFunction(s))throw new TypeError("adapter is not a function");return s},adapters:ct};function zt(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new We(null,t)}function os(t){return zt(t),t.headers=j.from(t.headers),t.data=Ht.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),Bo.getAdapter(t.adapter||Te.adapter)(t).then(function(s){return zt(t),s.data=Ht.call(t,t.transformResponse,s),s.headers=j.from(s.headers),s},function(s){return ss(s)||(zt(t),s&&s.response&&(s.response.data=Ht.call(t,t.transformResponse,s.response),s.response.headers=j.from(s.response.headers))),Promise.reject(s)})}const as=t=>t instanceof j?t.toJSON():t;function Oe(t,e){e=e||{};const n={};function s(c,f,d){return h.isPlainObject(c)&&h.isPlainObject(f)?h.merge.call({caseless:d},c,f):h.isPlainObject(f)?h.merge({},f):h.isArray(f)?f.slice():f}function r(c,f,d){if(h.isUndefined(f)){if(!h.isUndefined(c))return s(void 0,c,d)}else return s(c,f,d)}function i(c,f){if(!h.isUndefined(f))return s(void 0,f)}function o(c,f){if(h.isUndefined(f)){if(!h.isUndefined(c))return s(void 0,c)}else return s(void 0,f)}function a(c,f,d){if(d in e)return s(c,f);if(d in t)return s(void 0,c)}const l={url:i,method:i,data:i,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:a,headers:(c,f)=>r(as(c),as(f),!0)};return h.forEach(Object.keys(Object.assign({},t,e)),function(f){const d=l[f]||r,g=d(t[f],e[f],f);h.isUndefined(g)&&d!==a||(n[f]=g)}),n}const cs="1.4.0",Zt={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{Zt[t]=function(s){return typeof s===t||"a"+(e<1?"n ":" ")+t}});const ls={};Zt.transitional=function(e,n,s){function r(i,o){return"[Axios v"+cs+"] Transitional option '"+i+"'"+o+(s?". "+s:"")}return(i,o,a)=>{if(e===!1)throw new O(r(o," has been removed"+(n?" in "+n:"")),O.ERR_DEPRECATED);return n&&!ls[o]&&(ls[o]=!0,console.warn(r(o," has been deprecated since v"+n+" and will be removed in the near future"))),e?e(i,o,a):!0}};function $o(t,e,n){if(typeof t!="object")throw new O("options must be an object",O.ERR_BAD_OPTION_VALUE);const s=Object.keys(t);let r=s.length;for(;r-- >0;){const i=s[r],o=e[i];if(o){const a=t[i],l=a===void 0||o(a,i,t);if(l!==!0)throw new O("option "+i+" must be "+l,O.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new O("Unknown option "+i,O.ERR_BAD_OPTION)}}const jt={assertOptions:$o,validators:Zt},fe=jt.validators;class ge{constructor(e){this.defaults=e,this.interceptors={request:new Qn,response:new Qn}}request(e,n){typeof e=="string"?(n=n||{},n.url=e):n=e||{},n=Oe(this.defaults,n);const{transitional:s,paramsSerializer:r,headers:i}=n;s!==void 0&&jt.assertOptions(s,{silentJSONParsing:fe.transitional(fe.boolean),forcedJSONParsing:fe.transitional(fe.boolean),clarifyTimeoutError:fe.transitional(fe.boolean)},!1),r!=null&&(h.isFunction(r)?n.paramsSerializer={serialize:r}:jt.assertOptions(r,{encode:fe.function,serialize:fe.function},!0)),n.method=(n.method||this.defaults.method||"get").toLowerCase();let o;o=i&&h.merge(i.common,i[n.method]),o&&h.forEach(["delete","get","head","post","put","patch","common"],m=>{delete i[m]}),n.headers=j.concat(o,i);const a=[];let l=!0;this.interceptors.request.forEach(function(k){typeof k.runWhen=="function"&&k.runWhen(n)===!1||(l=l&&k.synchronous,a.unshift(k.fulfilled,k.rejected))});const c=[];this.interceptors.response.forEach(function(k){c.push(k.fulfilled,k.rejected)});let f,d=0,g;if(!l){const m=[os.bind(this),void 0];for(m.unshift.apply(m,a),m.push.apply(m,c),g=m.length,f=Promise.resolve(n);d<g;)f=f.then(m[d++],m[d++]);return f}g=a.length;let y=n;for(d=0;d<g;){const m=a[d++],k=a[d++];try{y=m(y)}catch(T){k.call(this,T);break}}try{f=os.call(this,y)}catch(m){return Promise.reject(m)}for(d=0,g=c.length;d<g;)f=f.then(c[d++],c[d++]);return f}getUri(e){e=Oe(this.defaults,e);const n=rs(e.baseURL,e.url);return Xn(n,e.params,e.paramsSerializer)}}h.forEach(["delete","get","head","options"],function(e){ge.prototype[e]=function(n,s){return this.request(Oe(s||{},{method:e,url:n,data:(s||{}).data}))}}),h.forEach(["post","put","patch"],function(e){function n(s){return function(i,o,a){return this.request(Oe(a||{},{method:e,headers:s?{"Content-Type":"multipart/form-data"}:{},url:i,data:o}))}}ge.prototype[e]=n(),ge.prototype[e+"Form"]=n(!0)});class Yt{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(i){n=i});const s=this;this.promise.then(r=>{if(!s._listeners)return;let i=s._listeners.length;for(;i-- >0;)s._listeners[i](r);s._listeners=null}),this.promise.then=r=>{let i;const o=new Promise(a=>{s.subscribe(a),i=a}).then(r);return o.cancel=function(){s.unsubscribe(i)},o},e(function(i,o,a){s.reason||(s.reason=new We(i,o,a),n(s.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const n=this._listeners.indexOf(e);n!==-1&&this._listeners.splice(n,1)}static source(){let e;return{token:new Yt(function(r){e=r}),cancel:e}}}function Uo(t){return function(n){return t.apply(null,n)}}function Po(t){return h.isObject(t)&&t.isAxiosError===!0}const Jt={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Jt).forEach(([t,e])=>{Jt[e]=t});function us(t){const e=new ge(t),n=Vn(ge.prototype.request,e);return h.extend(n,ge.prototype,e,{allOwnKeys:!0}),h.extend(n,e,null,{allOwnKeys:!0}),n.create=function(r){return us(Oe(t,r))},n}const V=us(Te);V.Axios=ge,V.CanceledError=We,V.CancelToken=Yt,V.isCancel=ss,V.VERSION=cs,V.toFormData=ot,V.AxiosError=O,V.Cancel=V.CanceledError,V.all=function(e){return Promise.all(e)},V.spread=Uo,V.isAxiosError=Po,V.mergeConfig=Oe,V.AxiosHeaders=j,V.formToJSON=t=>ts(h.isHTMLForm(t)?new FormData(t):t),V.HttpStatusCode=Jt,V.default=V;const lt=async function(t){const e=t,n=window.VITE_BACKEND_URL?window.VITE_BACKEND_URL:"https://chatadmin-gw.dev.mp.gob.bo",s={method:e.method,url:`${n}${e.url}`,headers:{Authorization:`Bearer ${t.token}`,"Content-Type":"application/json; charset=utf-8",...e.headers},data:e.data};return await V(s).then(async function(r){return await r.data}).catch(async function(r){console.error(r);const i=await r.response.data;if(i.statusCode==401&&i.message=="Unauthorized")localStorage.clear();else throw i})};async function Wo(t){const e={url:"/v1/message/list-messages",method:"post",data:t.body,token:t.token},n=await lt(e).catch(r=>(console.error(r),null)),s=n==null?void 0:n.response;return s!=null&&s.data?{data:s.data,pagination:s.pagination}:{data:[],pagination:{total:0,limit:0,size:0}}}async function qo(t,e){var r;const s=await lt({url:"/v1/message/send-message",method:"POST",data:t,token:e}).catch(i=>(console.error(i),null));return(r=s==null?void 0:s.response)==null?void 0:r.data}async function fs(t){var s;const n=await lt({url:"/v1/app-chats/web-chat",method:"get",token:t}).catch(r=>(console.error(r),null));return(s=n==null?void 0:n.response)==null?void 0:s.data}async function hs(t,e){var i;const n={esCliente:!0,totalNoVistos:0,totalNoVistosCliente:0},s={url:`/v1/app-chats/update-vistos/${t}`,method:"PATCH",data:n,token:e},r=await lt(s).catch(o=>(console.error(o),null));return(i=r==null?void 0:r.response)==null?void 0:i.data}function Ho(t){return u.getCurrentScope()?(u.onScopeDispose(t),!0):!1}function ds(t){return typeof t=="function"?t():u.unref(t)}const zo=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const Zo=t=>t!=null,Gt=()=>{};function Kt(t){var e;const n=ds(t);return(e=n==null?void 0:n.$el)!=null?e:n}const jo=zo?window:void 0;function Yo(){const t=u.ref(!1),e=u.getCurrentInstance();return e&&u.onMounted(()=>{t.value=!0},e),t}function Jo(t){const e=Yo();return u.computed(()=>(e.value,!!t()))}function Go(t,e,n={}){const{root:s,rootMargin:r="0px",threshold:i=.1,window:o=jo,immediate:a=!0}=n,l=Jo(()=>o&&"IntersectionObserver"in o),c=u.computed(()=>{const m=ds(t);return(Array.isArray(m)?m:[m]).map(Kt).filter(Zo)});let f=Gt;const d=u.ref(a),g=l.value?u.watch(()=>[c.value,Kt(s),d.value],([m,k])=>{if(f(),!d.value||!m.length)return;const T=new IntersectionObserver(e,{root:Kt(k),rootMargin:r,threshold:i});m.forEach(x=>x&&T.observe(x)),f=()=>{T.disconnect(),f=Gt}},{immediate:a,flush:"post"}):Gt,y=()=>{f(),g(),d.value=!1};return Ho(y),{isSupported:l,isActive:d,pause(){f(),d.value=!1},resume(){d.value=!0},stop:y}}class we extends Error{}class Ko extends we{constructor(e){super(`Invalid DateTime: ${e.toMessage()}`)}}class Xo extends we{constructor(e){super(`Invalid Interval: ${e.toMessage()}`)}}class Qo extends we{constructor(e){super(`Invalid Duration: ${e.toMessage()}`)}}class Ne extends we{}class ms extends we{constructor(e){super(`Invalid unit ${e}`)}}class U extends we{}class he extends we{constructor(){super("Zone is an abstract class")}}const p="numeric",Q="short",H="long",ut={year:p,month:p,day:p},ps={year:p,month:Q,day:p},ea={year:p,month:Q,day:p,weekday:Q},ys={year:p,month:H,day:p},gs={year:p,month:H,day:p,weekday:H},ws={hour:p,minute:p},Es={hour:p,minute:p,second:p},ks={hour:p,minute:p,second:p,timeZoneName:Q},Ss={hour:p,minute:p,second:p,timeZoneName:H},bs={hour:p,minute:p,hourCycle:"h23"},Ts={hour:p,minute:p,second:p,hourCycle:"h23"},Os={hour:p,minute:p,second:p,hourCycle:"h23",timeZoneName:Q},Ns={hour:p,minute:p,second:p,hourCycle:"h23",timeZoneName:H},Cs={year:p,month:p,day:p,hour:p,minute:p},vs={year:p,month:p,day:p,hour:p,minute:p,second:p},_s={year:p,month:Q,day:p,hour:p,minute:p},xs={year:p,month:Q,day:p,hour:p,minute:p,second:p},ta={year:p,month:Q,day:p,weekday:Q,hour:p,minute:p},As={year:p,month:H,day:p,hour:p,minute:p,timeZoneName:Q},Ms={year:p,month:H,day:p,hour:p,minute:p,second:p,timeZoneName:Q},Ds={year:p,month:H,day:p,weekday:H,hour:p,minute:p,timeZoneName:H},Rs={year:p,month:H,day:p,weekday:H,hour:p,minute:p,second:p,timeZoneName:H};class qe{get type(){throw new he}get name(){throw new he}get ianaName(){return this.name}get isUniversal(){throw new he}offsetName(e,n){throw new he}formatOffset(e,n){throw new he}offset(e){throw new he}equals(e){throw new he}get isValid(){throw new he}}let Xt=null;class ft extends qe{static get instance(){return Xt===null&&(Xt=new ft),Xt}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(e,{format:n,locale:s}){return rr(e,n,s)}formatOffset(e,n){return je(this.offset(e),n)}offset(e){return-new Date(e).getTimezoneOffset()}equals(e){return e.type==="system"}get isValid(){return!0}}let ht={};function na(t){return ht[t]||(ht[t]=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:t,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"})),ht[t]}const sa={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function ra(t,e){const n=t.format(e).replace(/\u200E/g,""),s=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(n),[,r,i,o,a,l,c,f]=s;return[o,r,i,a,l,c,f]}function ia(t,e){const n=t.formatToParts(e),s=[];for(let r=0;r<n.length;r++){const{type:i,value:o}=n[r],a=sa[i];i==="era"?s[a]=o:w(a)||(s[a]=parseInt(o,10))}return s}let dt={};class le extends qe{static create(e){return dt[e]||(dt[e]=new le(e)),dt[e]}static resetCache(){dt={},ht={}}static isValidSpecifier(e){return this.isValidZone(e)}static isValidZone(e){if(!e)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:e}).format(),!0}catch{return!1}}constructor(e){super(),this.zoneName=e,this.valid=le.isValidZone(e)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(e,{format:n,locale:s}){return rr(e,n,s,this.name)}formatOffset(e,n){return je(this.offset(e),n)}offset(e){const n=new Date(e);if(isNaN(n))return NaN;const s=na(this.name);let[r,i,o,a,l,c,f]=s.formatToParts?ia(s,n):ra(s,n);a==="BC"&&(r=-Math.abs(r)+1);const g=wt({year:r,month:i,day:o,hour:l===24?0:l,minute:c,second:f,millisecond:0});let y=+n;const m=y%1e3;return y-=m>=0?m:1e3+m,(g-y)/(60*1e3)}equals(e){return e.type==="iana"&&e.name===this.name}get isValid(){return this.valid}}let Is={};function oa(t,e={}){const n=JSON.stringify([t,e]);let s=Is[n];return s||(s=new Intl.ListFormat(t,e),Is[n]=s),s}let Qt={};function en(t,e={}){const n=JSON.stringify([t,e]);let s=Qt[n];return s||(s=new Intl.DateTimeFormat(t,e),Qt[n]=s),s}let tn={};function aa(t,e={}){const n=JSON.stringify([t,e]);let s=tn[n];return s||(s=new Intl.NumberFormat(t,e),tn[n]=s),s}let nn={};function ca(t,e={}){const{base:n,...s}=e,r=JSON.stringify([t,s]);let i=nn[r];return i||(i=new Intl.RelativeTimeFormat(t,e),nn[r]=i),i}let He=null;function la(){return He||(He=new Intl.DateTimeFormat().resolvedOptions().locale,He)}let Ls={};function ua(t){let e=Ls[t];if(!e){const n=new Intl.Locale(t);e="getWeekInfo"in n?n.getWeekInfo():n.weekInfo,Ls[t]=e}return e}function fa(t){const e=t.indexOf("-x-");e!==-1&&(t=t.substring(0,e));const n=t.indexOf("-u-");if(n===-1)return[t];{let s,r;try{s=en(t).resolvedOptions(),r=t}catch{const l=t.substring(0,n);s=en(l).resolvedOptions(),r=l}const{numberingSystem:i,calendar:o}=s;return[r,i,o]}}function ha(t,e,n){return(n||e)&&(t.includes("-u-")||(t+="-u"),n&&(t+=`-ca-${n}`),e&&(t+=`-nu-${e}`)),t}function da(t){const e=[];for(let n=1;n<=12;n++){const s=E.utc(2009,n,1);e.push(t(s))}return e}function ma(t){const e=[];for(let n=1;n<=7;n++){const s=E.utc(2016,11,13+n);e.push(t(s))}return e}function mt(t,e,n,s){const r=t.listingMode();return r==="error"?null:r==="en"?n(e):s(e)}function pa(t){return t.numberingSystem&&t.numberingSystem!=="latn"?!1:t.numberingSystem==="latn"||!t.locale||t.locale.startsWith("en")||new Intl.DateTimeFormat(t.intl).resolvedOptions().numberingSystem==="latn"}class ya{constructor(e,n,s){this.padTo=s.padTo||0,this.floor=s.floor||!1;const{padTo:r,floor:i,...o}=s;if(!n||Object.keys(o).length>0){const a={useGrouping:!1,...s};s.padTo>0&&(a.minimumIntegerDigits=s.padTo),this.inf=aa(e,a)}}format(e){if(this.inf){const n=this.floor?Math.floor(e):e;return this.inf.format(n)}else{const n=this.floor?Math.floor(e):fn(e,3);return I(n,this.padTo)}}}class ga{constructor(e,n,s){this.opts=s,this.originalZone=void 0;let r;if(this.opts.timeZone)this.dt=e;else if(e.zone.type==="fixed"){const o=-1*(e.offset/60),a=o>=0?`Etc/GMT+${o}`:`Etc/GMT${o}`;e.offset!==0&&le.create(a).valid?(r=a,this.dt=e):(r="UTC",this.dt=e.offset===0?e:e.setZone("UTC").plus({minutes:e.offset}),this.originalZone=e.zone)}else e.zone.type==="system"?this.dt=e:e.zone.type==="iana"?(this.dt=e,r=e.zone.name):(r="UTC",this.dt=e.setZone("UTC").plus({minutes:e.offset}),this.originalZone=e.zone);const i={...this.opts};i.timeZone=i.timeZone||r,this.dtf=en(n,i)}format(){return this.originalZone?this.formatToParts().map(({value:e})=>e).join(""):this.dtf.format(this.dt.toJSDate())}formatToParts(){const e=this.dtf.formatToParts(this.dt.toJSDate());return this.originalZone?e.map(n=>{if(n.type==="timeZoneName"){const s=this.originalZone.offsetName(this.dt.ts,{locale:this.dt.locale,format:this.opts.timeZoneName});return{...n,value:s}}else return n}):e}resolvedOptions(){return this.dtf.resolvedOptions()}}class wa{constructor(e,n,s){this.opts={style:"long",...s},!n&&er()&&(this.rtf=ca(e,s))}format(e,n){return this.rtf?this.rtf.format(e,n):Pa(n,e,this.opts.numeric,this.opts.style!=="long")}formatToParts(e,n){return this.rtf?this.rtf.formatToParts(e,n):[]}}const Ea={firstDay:1,minimalDays:4,weekend:[6,7]};class _{static fromOpts(e){return _.create(e.locale,e.numberingSystem,e.outputCalendar,e.weekSettings,e.defaultToEN)}static create(e,n,s,r,i=!1){const o=e||A.defaultLocale,a=o||(i?"en-US":la()),l=n||A.defaultNumberingSystem,c=s||A.defaultOutputCalendar,f=ln(r)||A.defaultWeekSettings;return new _(a,l,c,f,o)}static resetCache(){He=null,Qt={},tn={},nn={}}static fromObject({locale:e,numberingSystem:n,outputCalendar:s,weekSettings:r}={}){return _.create(e,n,s,r)}constructor(e,n,s,r,i){const[o,a,l]=fa(e);this.locale=o,this.numberingSystem=n||a||null,this.outputCalendar=s||l||null,this.weekSettings=r,this.intl=ha(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=i,this.fastNumbersCached=null}get fastNumbers(){return this.fastNumbersCached==null&&(this.fastNumbersCached=pa(this)),this.fastNumbersCached}listingMode(){const e=this.isEnglish(),n=(this.numberingSystem===null||this.numberingSystem==="latn")&&(this.outputCalendar===null||this.outputCalendar==="gregory");return e&&n?"en":"intl"}clone(e){return!e||Object.getOwnPropertyNames(e).length===0?this:_.create(e.locale||this.specifiedLocale,e.numberingSystem||this.numberingSystem,e.outputCalendar||this.outputCalendar,ln(e.weekSettings)||this.weekSettings,e.defaultToEN||!1)}redefaultToEN(e={}){return this.clone({...e,defaultToEN:!0})}redefaultToSystem(e={}){return this.clone({...e,defaultToEN:!1})}months(e,n=!1){return mt(this,e,ar,()=>{const s=n?{month:e,day:"numeric"}:{month:e},r=n?"format":"standalone";return this.monthsCache[r][e]||(this.monthsCache[r][e]=da(i=>this.extract(i,s,"month"))),this.monthsCache[r][e]})}weekdays(e,n=!1){return mt(this,e,ur,()=>{const s=n?{weekday:e,year:"numeric",month:"long",day:"numeric"}:{weekday:e},r=n?"format":"standalone";return this.weekdaysCache[r][e]||(this.weekdaysCache[r][e]=ma(i=>this.extract(i,s,"weekday"))),this.weekdaysCache[r][e]})}meridiems(){return mt(this,void 0,()=>fr,()=>{if(!this.meridiemCache){const e={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[E.utc(2016,11,13,9),E.utc(2016,11,13,19)].map(n=>this.extract(n,e,"dayperiod"))}return this.meridiemCache})}eras(e){return mt(this,e,hr,()=>{const n={era:e};return this.eraCache[e]||(this.eraCache[e]=[E.utc(-40,1,1),E.utc(2017,1,1)].map(s=>this.extract(s,n,"era"))),this.eraCache[e]})}extract(e,n,s){const r=this.dtFormatter(e,n),i=r.formatToParts(),o=i.find(a=>a.type.toLowerCase()===s);return o?o.value:null}numberFormatter(e={}){return new ya(this.intl,e.forceSimple||this.fastNumbers,e)}dtFormatter(e,n={}){return new ga(e,this.intl,n)}relFormatter(e={}){return new wa(this.intl,this.isEnglish(),e)}listFormatter(e={}){return oa(this.intl,e)}isEnglish(){return this.locale==="en"||this.locale.toLowerCase()==="en-us"||new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith("en-us")}getWeekSettings(){return this.weekSettings?this.weekSettings:tr()?ua(this.locale):Ea}getStartOfWeek(){return this.getWeekSettings().firstDay}getMinDaysInFirstWeek(){return this.getWeekSettings().minimalDays}getWeekendDays(){return this.getWeekSettings().weekend}equals(e){return this.locale===e.locale&&this.numberingSystem===e.numberingSystem&&this.outputCalendar===e.outputCalendar}toString(){return`Locale(${this.locale}, ${this.numberingSystem}, ${this.outputCalendar})`}}let sn=null;class q extends qe{static get utcInstance(){return sn===null&&(sn=new q(0)),sn}static instance(e){return e===0?q.utcInstance:new q(e)}static parseSpecifier(e){if(e){const n=e.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(n)return new q(Et(n[1],n[2]))}return null}constructor(e){super(),this.fixed=e}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${je(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${je(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(e,n){return je(this.fixed,n)}get isUniversal(){return!0}offset(){return this.fixed}equals(e){return e.type==="fixed"&&e.fixed===this.fixed}get isValid(){return!0}}class ka extends qe{constructor(e){super(),this.zoneName=e}get type(){return"invalid"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(){return null}formatOffset(){return""}offset(){return NaN}equals(){return!1}get isValid(){return!1}}function de(t,e){if(w(t)||t===null)return e;if(t instanceof qe)return t;if(Ca(t)){const n=t.toLowerCase();return n==="default"?e:n==="local"||n==="system"?ft.instance:n==="utc"||n==="gmt"?q.utcInstance:q.parseSpecifier(n)||le.create(t)}else return me(t)?q.instance(t):typeof t=="object"&&"offset"in t&&typeof t.offset=="function"?t:new ka(t)}const rn={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},Vs={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},Sa=rn.hanidec.replace(/[\[|\]]/g,"").split("");function ba(t){let e=parseInt(t,10);if(isNaN(e)){e="";for(let n=0;n<t.length;n++){const s=t.charCodeAt(n);if(t[n].search(rn.hanidec)!==-1)e+=Sa.indexOf(t[n]);else for(const r in Vs){const[i,o]=Vs[r];s>=i&&s<=o&&(e+=s-i)}}return parseInt(e,10)}else return e}let Ce={};function Ta(){Ce={}}function ee({numberingSystem:t},e=""){const n=t||"latn";return Ce[n]||(Ce[n]={}),Ce[n][e]||(Ce[n][e]=new RegExp(`${rn[n]}${e}`)),Ce[n][e]}let Fs=()=>Date.now(),Bs="system",$s=null,Us=null,Ps=null,Ws=60,qs,Hs=null;class A{static get now(){return Fs}static set now(e){Fs=e}static set defaultZone(e){Bs=e}static get defaultZone(){return de(Bs,ft.instance)}static get defaultLocale(){return $s}static set defaultLocale(e){$s=e}static get defaultNumberingSystem(){return Us}static set defaultNumberingSystem(e){Us=e}static get defaultOutputCalendar(){return Ps}static set defaultOutputCalendar(e){Ps=e}static get defaultWeekSettings(){return Hs}static set defaultWeekSettings(e){Hs=ln(e)}static get twoDigitCutoffYear(){return Ws}static set twoDigitCutoffYear(e){Ws=e%100}static get throwOnInvalid(){return qs}static set throwOnInvalid(e){qs=e}static resetCaches(){_.resetCache(),le.resetCache(),E.resetCache(),Ta()}}class te{constructor(e,n){this.reason=e,this.explanation=n}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}const zs=[0,31,59,90,120,151,181,212,243,273,304,334],Zs=[0,31,60,91,121,152,182,213,244,274,305,335];function Y(t,e){return new te("unit out of range",`you specified ${e} (of type ${typeof e}) as a ${t}, which is invalid`)}function on(t,e,n){const s=new Date(Date.UTC(t,e-1,n));t<100&&t>=0&&s.setUTCFullYear(s.getUTCFullYear()-1900);const r=s.getUTCDay();return r===0?7:r}function js(t,e,n){return n+(ze(t)?Zs:zs)[e-1]}function Ys(t,e){const n=ze(t)?Zs:zs,s=n.findIndex(i=>i<e),r=e-n[s];return{month:s+1,day:r}}function an(t,e){return(t-e+7)%7+1}function pt(t,e=4,n=1){const{year:s,month:r,day:i}=t,o=js(s,r,i),a=an(on(s,r,i),n);let l=Math.floor((o-a+14-e)/7),c;return l<1?(c=s-1,l=Ze(c,e,n)):l>Ze(s,e,n)?(c=s+1,l=1):c=s,{weekYear:c,weekNumber:l,weekday:a,...St(t)}}function Js(t,e=4,n=1){const{weekYear:s,weekNumber:r,weekday:i}=t,o=an(on(s,1,e),n),a=_e(s);let l=r*7+i-o-7+e,c;l<1?(c=s-1,l+=_e(c)):l>a?(c=s+1,l-=_e(s)):c=s;const{month:f,day:d}=Ys(c,l);return{year:c,month:f,day:d,...St(t)}}function cn(t){const{year:e,month:n,day:s}=t,r=js(e,n,s);return{year:e,ordinal:r,...St(t)}}function Gs(t){const{year:e,ordinal:n}=t,{month:s,day:r}=Ys(e,n);return{year:e,month:s,day:r,...St(t)}}function Ks(t,e){if(!w(t.localWeekday)||!w(t.localWeekNumber)||!w(t.localWeekYear)){if(!w(t.weekday)||!w(t.weekNumber)||!w(t.weekYear))throw new Ne("Cannot mix locale-based week fields with ISO-based week fields");return w(t.localWeekday)||(t.weekday=t.localWeekday),w(t.localWeekNumber)||(t.weekNumber=t.localWeekNumber),w(t.localWeekYear)||(t.weekYear=t.localWeekYear),delete t.localWeekday,delete t.localWeekNumber,delete t.localWeekYear,{minDaysInFirstWeek:e.getMinDaysInFirstWeek(),startOfWeek:e.getStartOfWeek()}}else return{minDaysInFirstWeek:4,startOfWeek:1}}function Oa(t,e=4,n=1){const s=yt(t.weekYear),r=J(t.weekNumber,1,Ze(t.weekYear,e,n)),i=J(t.weekday,1,7);return s?r?i?!1:Y("weekday",t.weekday):Y("week",t.weekNumber):Y("weekYear",t.weekYear)}function Na(t){const e=yt(t.year),n=J(t.ordinal,1,_e(t.year));return e?n?!1:Y("ordinal",t.ordinal):Y("year",t.year)}function Xs(t){const e=yt(t.year),n=J(t.month,1,12),s=J(t.day,1,gt(t.year,t.month));return e?n?s?!1:Y("day",t.day):Y("month",t.month):Y("year",t.year)}function Qs(t){const{hour:e,minute:n,second:s,millisecond:r}=t,i=J(e,0,23)||e===24&&n===0&&s===0&&r===0,o=J(n,0,59),a=J(s,0,59),l=J(r,0,999);return i?o?a?l?!1:Y("millisecond",r):Y("second",s):Y("minute",n):Y("hour",e)}function w(t){return typeof t>"u"}function me(t){return typeof t=="number"}function yt(t){return typeof t=="number"&&t%1===0}function Ca(t){return typeof t=="string"}function va(t){return Object.prototype.toString.call(t)==="[object Date]"}function er(){try{return typeof Intl<"u"&&!!Intl.RelativeTimeFormat}catch{return!1}}function tr(){try{return typeof Intl<"u"&&!!Intl.Locale&&("weekInfo"in Intl.Locale.prototype||"getWeekInfo"in Intl.Locale.prototype)}catch{return!1}}function _a(t){return Array.isArray(t)?t:[t]}function nr(t,e,n){if(t.length!==0)return t.reduce((s,r)=>{const i=[e(r),r];return s&&n(s[0],i[0])===s[0]?s:i},null)[1]}function xa(t,e){return e.reduce((n,s)=>(n[s]=t[s],n),{})}function ve(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function ln(t){if(t==null)return null;if(typeof t!="object")throw new U("Week settings must be an object");if(!J(t.firstDay,1,7)||!J(t.minimalDays,1,7)||!Array.isArray(t.weekend)||t.weekend.some(e=>!J(e,1,7)))throw new U("Invalid week settings");return{firstDay:t.firstDay,minimalDays:t.minimalDays,weekend:Array.from(t.weekend)}}function J(t,e,n){return yt(t)&&t>=e&&t<=n}function Aa(t,e){return t-e*Math.floor(t/e)}function I(t,e=2){const n=t<0;let s;return n?s="-"+(""+-t).padStart(e,"0"):s=(""+t).padStart(e,"0"),s}function pe(t){if(!(w(t)||t===null||t===""))return parseInt(t,10)}function Ee(t){if(!(w(t)||t===null||t===""))return parseFloat(t)}function un(t){if(!(w(t)||t===null||t==="")){const e=parseFloat("0."+t)*1e3;return Math.floor(e)}}function fn(t,e,n=!1){const s=10**e;return(n?Math.trunc:Math.round)(t*s)/s}function ze(t){return t%4===0&&(t%100!==0||t%400===0)}function _e(t){return ze(t)?366:365}function gt(t,e){const n=Aa(e-1,12)+1,s=t+(e-n)/12;return n===2?ze(s)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][n-1]}function wt(t){let e=Date.UTC(t.year,t.month-1,t.day,t.hour,t.minute,t.second,t.millisecond);return t.year<100&&t.year>=0&&(e=new Date(e),e.setUTCFullYear(t.year,t.month-1,t.day)),+e}function sr(t,e,n){return-an(on(t,1,e),n)+e-1}function Ze(t,e=4,n=1){const s=sr(t,e,n),r=sr(t+1,e,n);return(_e(t)-s+r)/7}function hn(t){return t>99?t:t>A.twoDigitCutoffYear?1900+t:2e3+t}function rr(t,e,n,s=null){const r=new Date(t),i={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};s&&(i.timeZone=s);const o={timeZoneName:e,...i},a=new Intl.DateTimeFormat(n,o).formatToParts(r).find(l=>l.type.toLowerCase()==="timezonename");return a?a.value:null}function Et(t,e){let n=parseInt(t,10);Number.isNaN(n)&&(n=0);const s=parseInt(e,10)||0,r=n<0||Object.is(n,-0)?-s:s;return n*60+r}function ir(t){const e=Number(t);if(typeof t=="boolean"||t===""||Number.isNaN(e))throw new U(`Invalid unit value ${t}`);return e}function kt(t,e){const n={};for(const s in t)if(ve(t,s)){const r=t[s];if(r==null)continue;n[e(s)]=ir(r)}return n}function je(t,e){const n=Math.trunc(Math.abs(t/60)),s=Math.trunc(Math.abs(t%60)),r=t>=0?"+":"-";switch(e){case"short":return`${r}${I(n,2)}:${I(s,2)}`;case"narrow":return`${r}${n}${s>0?`:${s}`:""}`;case"techie":return`${r}${I(n,2)}${I(s,2)}`;default:throw new RangeError(`Value format ${e} is out of range for property format`)}}function St(t){return xa(t,["hour","minute","second","millisecond"])}const Ma=["January","February","March","April","May","June","July","August","September","October","November","December"],or=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Da=["J","F","M","A","M","J","J","A","S","O","N","D"];function ar(t){switch(t){case"narrow":return[...Da];case"short":return[...or];case"long":return[...Ma];case"numeric":return["1","2","3","4","5","6","7","8","9","10","11","12"];case"2-digit":return["01","02","03","04","05","06","07","08","09","10","11","12"];default:return null}}const cr=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],lr=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],Ra=["M","T","W","T","F","S","S"];function ur(t){switch(t){case"narrow":return[...Ra];case"short":return[...lr];case"long":return[...cr];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const fr=["AM","PM"],Ia=["Before Christ","Anno Domini"],La=["BC","AD"],Va=["B","A"];function hr(t){switch(t){case"narrow":return[...Va];case"short":return[...La];case"long":return[...Ia];default:return null}}function Fa(t){return fr[t.hour<12?0:1]}function Ba(t,e){return ur(e)[t.weekday-1]}function $a(t,e){return ar(e)[t.month-1]}function Ua(t,e){return hr(e)[t.year<0?0:1]}function Pa(t,e,n="always",s=!1){const r={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},i=["hours","minutes","seconds"].indexOf(t)===-1;if(n==="auto"&&i){const d=t==="days";switch(e){case 1:return d?"tomorrow":`next ${r[t][0]}`;case-1:return d?"yesterday":`last ${r[t][0]}`;case 0:return d?"today":`this ${r[t][0]}`}}const o=Object.is(e,-0)||e<0,a=Math.abs(e),l=a===1,c=r[t],f=s?l?c[1]:c[2]||c[1]:l?r[t][0]:t;return o?`${a} ${f} ago`:`in ${a} ${f}`}function dr(t,e){let n="";for(const s of t)s.literal?n+=s.val:n+=e(s.val);return n}const Wa={D:ut,DD:ps,DDD:ys,DDDD:gs,t:ws,tt:Es,ttt:ks,tttt:Ss,T:bs,TT:Ts,TTT:Os,TTTT:Ns,f:Cs,ff:_s,fff:As,ffff:Ds,F:vs,FF:xs,FFF:Ms,FFFF:Rs};class P{static create(e,n={}){return new P(e,n)}static parseFormat(e){let n=null,s="",r=!1;const i=[];for(let o=0;o<e.length;o++){const a=e.charAt(o);a==="'"?(s.length>0&&i.push({literal:r||/^\s+$/.test(s),val:s}),n=null,s="",r=!r):r||a===n?s+=a:(s.length>0&&i.push({literal:/^\s+$/.test(s),val:s}),s=a,n=a)}return s.length>0&&i.push({literal:r||/^\s+$/.test(s),val:s}),i}static macroTokenToFormatOpts(e){return Wa[e]}constructor(e,n){this.opts=n,this.loc=e,this.systemLoc=null}formatWithSystemDefault(e,n){return this.systemLoc===null&&(this.systemLoc=this.loc.redefaultToSystem()),this.systemLoc.dtFormatter(e,{...this.opts,...n}).format()}dtFormatter(e,n={}){return this.loc.dtFormatter(e,{...this.opts,...n})}formatDateTime(e,n){return this.dtFormatter(e,n).format()}formatDateTimeParts(e,n){return this.dtFormatter(e,n).formatToParts()}formatInterval(e,n){return this.dtFormatter(e.start,n).dtf.formatRange(e.start.toJSDate(),e.end.toJSDate())}resolvedOptions(e,n){return this.dtFormatter(e,n).resolvedOptions()}num(e,n=0){if(this.opts.forceSimple)return I(e,n);const s={...this.opts};return n>0&&(s.padTo=n),this.loc.numberFormatter(s).format(e)}formatDateTimeFromString(e,n){const s=this.loc.listingMode()==="en",r=this.loc.outputCalendar&&this.loc.outputCalendar!=="gregory",i=(y,m)=>this.loc.extract(e,y,m),o=y=>e.isOffsetFixed&&e.offset===0&&y.allowZ?"Z":e.isValid?e.zone.formatOffset(e.ts,y.format):"",a=()=>s?Fa(e):i({hour:"numeric",hourCycle:"h12"},"dayperiod"),l=(y,m)=>s?$a(e,y):i(m?{month:y}:{month:y,day:"numeric"},"month"),c=(y,m)=>s?Ba(e,y):i(m?{weekday:y}:{weekday:y,month:"long",day:"numeric"},"weekday"),f=y=>{const m=P.macroTokenToFormatOpts(y);return m?this.formatWithSystemDefault(e,m):y},d=y=>s?Ua(e,y):i({era:y},"era"),g=y=>{switch(y){case"S":return this.num(e.millisecond);case"u":case"SSS":return this.num(e.millisecond,3);case"s":return this.num(e.second);case"ss":return this.num(e.second,2);case"uu":return this.num(Math.floor(e.millisecond/10),2);case"uuu":return this.num(Math.floor(e.millisecond/100));case"m":return this.num(e.minute);case"mm":return this.num(e.minute,2);case"h":return this.num(e.hour%12===0?12:e.hour%12);case"hh":return this.num(e.hour%12===0?12:e.hour%12,2);case"H":return this.num(e.hour);case"HH":return this.num(e.hour,2);case"Z":return o({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return o({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return o({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return e.zone.offsetName(e.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return e.zone.offsetName(e.ts,{format:"long",locale:this.loc.locale});case"z":return e.zoneName;case"a":return a();case"d":return r?i({day:"numeric"},"day"):this.num(e.day);case"dd":return r?i({day:"2-digit"},"day"):this.num(e.day,2);case"c":return this.num(e.weekday);case"ccc":return c("short",!0);case"cccc":return c("long",!0);case"ccccc":return c("narrow",!0);case"E":return this.num(e.weekday);case"EEE":return c("short",!1);case"EEEE":return c("long",!1);case"EEEEE":return c("narrow",!1);case"L":return r?i({month:"numeric",day:"numeric"},"month"):this.num(e.month);case"LL":return r?i({month:"2-digit",day:"numeric"},"month"):this.num(e.month,2);case"LLL":return l("short",!0);case"LLLL":return l("long",!0);case"LLLLL":return l("narrow",!0);case"M":return r?i({month:"numeric"},"month"):this.num(e.month);case"MM":return r?i({month:"2-digit"},"month"):this.num(e.month,2);case"MMM":return l("short",!1);case"MMMM":return l("long",!1);case"MMMMM":return l("narrow",!1);case"y":return r?i({year:"numeric"},"year"):this.num(e.year);case"yy":return r?i({year:"2-digit"},"year"):this.num(e.year.toString().slice(-2),2);case"yyyy":return r?i({year:"numeric"},"year"):this.num(e.year,4);case"yyyyyy":return r?i({year:"numeric"},"year"):this.num(e.year,6);case"G":return d("short");case"GG":return d("long");case"GGGGG":return d("narrow");case"kk":return this.num(e.weekYear.toString().slice(-2),2);case"kkkk":return this.num(e.weekYear,4);case"W":return this.num(e.weekNumber);case"WW":return this.num(e.weekNumber,2);case"n":return this.num(e.localWeekNumber);case"nn":return this.num(e.localWeekNumber,2);case"ii":return this.num(e.localWeekYear.toString().slice(-2),2);case"iiii":return this.num(e.localWeekYear,4);case"o":return this.num(e.ordinal);case"ooo":return this.num(e.ordinal,3);case"q":return this.num(e.quarter);case"qq":return this.num(e.quarter,2);case"X":return this.num(Math.floor(e.ts/1e3));case"x":return this.num(e.ts);default:return f(y)}};return dr(P.parseFormat(n),g)}formatDurationFromString(e,n){const s=l=>{switch(l[0]){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":return"hour";case"d":return"day";case"w":return"week";case"M":return"month";case"y":return"year";default:return null}},r=l=>c=>{const f=s(c);return f?this.num(l.get(f),c.length):c},i=P.parseFormat(n),o=i.reduce((l,{literal:c,val:f})=>c?l:l.concat(f),[]),a=e.shiftTo(...o.map(s).filter(l=>l));return dr(i,r(a))}}const mr=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function xe(...t){const e=t.reduce((n,s)=>n+s.source,"");return RegExp(`^${e}$`)}function Ae(...t){return e=>t.reduce(([n,s,r],i)=>{const[o,a,l]=i(e,r);return[{...n,...o},a||s,l]},[{},null,1]).slice(0,2)}function Me(t,...e){if(t==null)return[null,null];for(const[n,s]of e){const r=n.exec(t);if(r)return s(r)}return[null,null]}function pr(...t){return(e,n)=>{const s={};let r;for(r=0;r<t.length;r++)s[t[r]]=pe(e[n+r]);return[s,null,n+r]}}const yr=/(?:(Z)|([+-]\d\d)(?::?(\d\d))?)/,qa=`(?:${yr.source}?(?:\\[(${mr.source})\\])?)?`,dn=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,gr=RegExp(`${dn.source}${qa}`),mn=RegExp(`(?:T${gr.source})?`),Ha=/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,za=/(\d{4})-?W(\d\d)(?:-?(\d))?/,Za=/(\d{4})-?(\d{3})/,ja=pr("weekYear","weekNumber","weekDay"),Ya=pr("year","ordinal"),Ja=/(\d{4})-(\d\d)-(\d\d)/,wr=RegExp(`${dn.source} ?(?:${yr.source}|(${mr.source}))?`),Ga=RegExp(`(?: ${wr.source})?`);function De(t,e,n){const s=t[e];return w(s)?n:pe(s)}function Ka(t,e){return[{year:De(t,e),month:De(t,e+1,1),day:De(t,e+2,1)},null,e+3]}function Re(t,e){return[{hours:De(t,e,0),minutes:De(t,e+1,0),seconds:De(t,e+2,0),milliseconds:un(t[e+3])},null,e+4]}function Ye(t,e){const n=!t[e]&&!t[e+1],s=Et(t[e+1],t[e+2]),r=n?null:q.instance(s);return[{},r,e+3]}function Je(t,e){const n=t[e]?le.create(t[e]):null;return[{},n,e+1]}const Xa=RegExp(`^T?${dn.source}$`),Qa=/^-?P(?:(?:(-?\d{1,20}(?:\.\d{1,20})?)Y)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20}(?:\.\d{1,20})?)W)?(?:(-?\d{1,20}(?:\.\d{1,20})?)D)?(?:T(?:(-?\d{1,20}(?:\.\d{1,20})?)H)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20})(?:[.,](-?\d{1,20}))?S)?)?)$/;function ec(t){const[e,n,s,r,i,o,a,l,c]=t,f=e[0]==="-",d=l&&l[0]==="-",g=(y,m=!1)=>y!==void 0&&(m||y&&f)?-y:y;return[{years:g(Ee(n)),months:g(Ee(s)),weeks:g(Ee(r)),days:g(Ee(i)),hours:g(Ee(o)),minutes:g(Ee(a)),seconds:g(Ee(l),l==="-0"),milliseconds:g(un(c),d)}]}const tc={GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function pn(t,e,n,s,r,i,o){const a={year:e.length===2?hn(pe(e)):pe(e),month:or.indexOf(n)+1,day:pe(s),hour:pe(r),minute:pe(i)};return o&&(a.second=pe(o)),t&&(a.weekday=t.length>3?cr.indexOf(t)+1:lr.indexOf(t)+1),a}const nc=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function sc(t){const[,e,n,s,r,i,o,a,l,c,f,d]=t,g=pn(e,r,s,n,i,o,a);let y;return l?y=tc[l]:c?y=0:y=Et(f,d),[g,new q(y)]}function rc(t){return t.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}const ic=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,oc=/^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,ac=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function Er(t){const[,e,n,s,r,i,o,a]=t;return[pn(e,r,s,n,i,o,a),q.utcInstance]}function cc(t){const[,e,n,s,r,i,o,a]=t;return[pn(e,a,n,s,r,i,o),q.utcInstance]}const lc=xe(Ha,mn),uc=xe(za,mn),fc=xe(Za,mn),hc=xe(gr),kr=Ae(Ka,Re,Ye,Je),dc=Ae(ja,Re,Ye,Je),mc=Ae(Ya,Re,Ye,Je),pc=Ae(Re,Ye,Je);function yc(t){return Me(t,[lc,kr],[uc,dc],[fc,mc],[hc,pc])}function gc(t){return Me(rc(t),[nc,sc])}function wc(t){return Me(t,[ic,Er],[oc,Er],[ac,cc])}function Ec(t){return Me(t,[Qa,ec])}const kc=Ae(Re);function Sc(t){return Me(t,[Xa,kc])}const bc=xe(Ja,Ga),Tc=xe(wr),Oc=Ae(Re,Ye,Je);function Nc(t){return Me(t,[bc,kr],[Tc,Oc])}const Sr="Invalid Duration",br={weeks:{days:7,hours:7*24,minutes:7*24*60,seconds:7*24*60*60,milliseconds:7*24*60*60*1e3},days:{hours:24,minutes:24*60,seconds:24*60*60,milliseconds:24*60*60*1e3},hours:{minutes:60,seconds:60*60,milliseconds:60*60*1e3},minutes:{seconds:60,milliseconds:60*1e3},seconds:{milliseconds:1e3}},Cc={years:{quarters:4,months:12,weeks:52,days:365,hours:365*24,minutes:365*24*60,seconds:365*24*60*60,milliseconds:365*24*60*60*1e3},quarters:{months:3,weeks:13,days:91,hours:91*24,minutes:91*24*60,seconds:91*24*60*60,milliseconds:91*24*60*60*1e3},months:{weeks:4,days:30,hours:30*24,minutes:30*24*60,seconds:30*24*60*60,milliseconds:30*24*60*60*1e3},...br},G=146097/400,Ie=146097/4800,vc={years:{quarters:4,months:12,weeks:G/7,days:G,hours:G*24,minutes:G*24*60,seconds:G*24*60*60,milliseconds:G*24*60*60*1e3},quarters:{months:3,weeks:G/28,days:G/4,hours:G*24/4,minutes:G*24*60/4,seconds:G*24*60*60/4,milliseconds:G*24*60*60*1e3/4},months:{weeks:Ie/7,days:Ie,hours:Ie*24,minutes:Ie*24*60,seconds:Ie*24*60*60,milliseconds:Ie*24*60*60*1e3},...br},ke=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],_c=ke.slice(0).reverse();function ye(t,e,n=!1){const s={values:n?e.values:{...t.values,...e.values||{}},loc:t.loc.clone(e.loc),conversionAccuracy:e.conversionAccuracy||t.conversionAccuracy,matrix:e.matrix||t.matrix};return new N(s)}function Tr(t,e){let n=e.milliseconds??0;for(const s of _c.slice(1))e[s]&&(n+=e[s]*t[s].milliseconds);return n}function Or(t,e){const n=Tr(t,e)<0?-1:1;ke.reduceRight((s,r)=>{if(w(e[r]))return s;if(s){const i=e[s]*n,o=t[r][s],a=Math.floor(i/o);e[r]+=a*n,e[s]-=a*o*n}return r},null),ke.reduce((s,r)=>{if(w(e[r]))return s;if(s){const i=e[s]%1;e[s]-=i,e[r]+=i*t[s][r]}return r},null)}function xc(t){const e={};for(const[n,s]of Object.entries(t))s!==0&&(e[n]=s);return e}class N{constructor(e){const n=e.conversionAccuracy==="longterm"||!1;let s=n?vc:Cc;e.matrix&&(s=e.matrix),this.values=e.values,this.loc=e.loc||_.create(),this.conversionAccuracy=n?"longterm":"casual",this.invalid=e.invalid||null,this.matrix=s,this.isLuxonDuration=!0}static fromMillis(e,n){return N.fromObject({milliseconds:e},n)}static fromObject(e,n={}){if(e==null||typeof e!="object")throw new U(`Duration.fromObject: argument expected to be an object, got ${e===null?"null":typeof e}`);return new N({values:kt(e,N.normalizeUnit),loc:_.fromObject(n),conversionAccuracy:n.conversionAccuracy,matrix:n.matrix})}static fromDurationLike(e){if(me(e))return N.fromMillis(e);if(N.isDuration(e))return e;if(typeof e=="object")return N.fromObject(e);throw new U(`Unknown duration argument ${e} of type ${typeof e}`)}static fromISO(e,n){const[s]=Ec(e);return s?N.fromObject(s,n):N.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static fromISOTime(e,n){const[s]=Sc(e);return s?N.fromObject(s,n):N.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static invalid(e,n=null){if(!e)throw new U("need to specify a reason the Duration is invalid");const s=e instanceof te?e:new te(e,n);if(A.throwOnInvalid)throw new Qo(s);return new N({invalid:s})}static normalizeUnit(e){const n={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[e&&e.toLowerCase()];if(!n)throw new ms(e);return n}static isDuration(e){return e&&e.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(e,n={}){const s={...n,floor:n.round!==!1&&n.floor!==!1};return this.isValid?P.create(this.loc,s).formatDurationFromString(this,e):Sr}toHuman(e={}){if(!this.isValid)return Sr;const n=ke.map(s=>{const r=this.values[s];return w(r)?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...e,unit:s.slice(0,-1)}).format(r)}).filter(s=>s);return this.loc.listFormatter({type:"conjunction",style:e.listStyle||"narrow",...e}).format(n)}toObject(){return this.isValid?{...this.values}:{}}toISO(){if(!this.isValid)return null;let e="P";return this.years!==0&&(e+=this.years+"Y"),(this.months!==0||this.quarters!==0)&&(e+=this.months+this.quarters*3+"M"),this.weeks!==0&&(e+=this.weeks+"W"),this.days!==0&&(e+=this.days+"D"),(this.hours!==0||this.minutes!==0||this.seconds!==0||this.milliseconds!==0)&&(e+="T"),this.hours!==0&&(e+=this.hours+"H"),this.minutes!==0&&(e+=this.minutes+"M"),(this.seconds!==0||this.milliseconds!==0)&&(e+=fn(this.seconds+this.milliseconds/1e3,3)+"S"),e==="P"&&(e+="T0S"),e}toISOTime(e={}){if(!this.isValid)return null;const n=this.toMillis();return n<0||n>=864e5?null:(e={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...e,includeOffset:!1},E.fromMillis(n,{zone:"UTC"}).toISOTime(e))}toJSON(){return this.toISO()}toString(){return this.toISO()}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Duration { values: ${JSON.stringify(this.values)} }`:`Duration { Invalid, reason: ${this.invalidReason} }`}toMillis(){return this.isValid?Tr(this.matrix,this.values):NaN}valueOf(){return this.toMillis()}plus(e){if(!this.isValid)return this;const n=N.fromDurationLike(e),s={};for(const r of ke)(ve(n.values,r)||ve(this.values,r))&&(s[r]=n.get(r)+this.get(r));return ye(this,{values:s},!0)}minus(e){if(!this.isValid)return this;const n=N.fromDurationLike(e);return this.plus(n.negate())}mapUnits(e){if(!this.isValid)return this;const n={};for(const s of Object.keys(this.values))n[s]=ir(e(this.values[s],s));return ye(this,{values:n},!0)}get(e){return this[N.normalizeUnit(e)]}set(e){if(!this.isValid)return this;const n={...this.values,...kt(e,N.normalizeUnit)};return ye(this,{values:n})}reconfigure({locale:e,numberingSystem:n,conversionAccuracy:s,matrix:r}={}){const o={loc:this.loc.clone({locale:e,numberingSystem:n}),matrix:r,conversionAccuracy:s};return ye(this,o)}as(e){return this.isValid?this.shiftTo(e).get(e):NaN}normalize(){if(!this.isValid)return this;const e=this.toObject();return Or(this.matrix,e),ye(this,{values:e},!0)}rescale(){if(!this.isValid)return this;const e=xc(this.normalize().shiftToAll().toObject());return ye(this,{values:e},!0)}shiftTo(...e){if(!this.isValid)return this;if(e.length===0)return this;e=e.map(o=>N.normalizeUnit(o));const n={},s={},r=this.toObject();let i;for(const o of ke)if(e.indexOf(o)>=0){i=o;let a=0;for(const c in s)a+=this.matrix[c][o]*s[c],s[c]=0;me(r[o])&&(a+=r[o]);const l=Math.trunc(a);n[o]=l,s[o]=(a*1e3-l*1e3)/1e3}else me(r[o])&&(s[o]=r[o]);for(const o in s)s[o]!==0&&(n[i]+=o===i?s[o]:s[o]/this.matrix[i][o]);return Or(this.matrix,n),ye(this,{values:n},!0)}shiftToAll(){return this.isValid?this.shiftTo("years","months","weeks","days","hours","minutes","seconds","milliseconds"):this}negate(){if(!this.isValid)return this;const e={};for(const n of Object.keys(this.values))e[n]=this.values[n]===0?0:-this.values[n];return ye(this,{values:e},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(e){if(!this.isValid||!e.isValid||!this.loc.equals(e.loc))return!1;function n(s,r){return s===void 0||s===0?r===void 0||r===0:s===r}for(const s of ke)if(!n(this.values[s],e.values[s]))return!1;return!0}}const Le="Invalid Interval";function Ac(t,e){return!t||!t.isValid?M.invalid("missing or invalid start"):!e||!e.isValid?M.invalid("missing or invalid end"):e<t?M.invalid("end before start",`The end of an interval must be after its start, but you had start=${t.toISO()} and end=${e.toISO()}`):null}class M{constructor(e){this.s=e.start,this.e=e.end,this.invalid=e.invalid||null,this.isLuxonInterval=!0}static invalid(e,n=null){if(!e)throw new U("need to specify a reason the Interval is invalid");const s=e instanceof te?e:new te(e,n);if(A.throwOnInvalid)throw new Xo(s);return new M({invalid:s})}static fromDateTimes(e,n){const s=Ke(e),r=Ke(n),i=Ac(s,r);return i??new M({start:s,end:r})}static after(e,n){const s=N.fromDurationLike(n),r=Ke(e);return M.fromDateTimes(r,r.plus(s))}static before(e,n){const s=N.fromDurationLike(n),r=Ke(e);return M.fromDateTimes(r.minus(s),r)}static fromISO(e,n){const[s,r]=(e||"").split("/",2);if(s&&r){let i,o;try{i=E.fromISO(s,n),o=i.isValid}catch{o=!1}let a,l;try{a=E.fromISO(r,n),l=a.isValid}catch{l=!1}if(o&&l)return M.fromDateTimes(i,a);if(o){const c=N.fromISO(r,n);if(c.isValid)return M.after(i,c)}else if(l){const c=N.fromISO(s,n);if(c.isValid)return M.before(a,c)}}return M.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static isInterval(e){return e&&e.isLuxonInterval||!1}get start(){return this.isValid?this.s:null}get end(){return this.isValid?this.e:null}get isValid(){return this.invalidReason===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}length(e="milliseconds"){return this.isValid?this.toDuration(e).get(e):NaN}count(e="milliseconds",n){if(!this.isValid)return NaN;const s=this.start.startOf(e,n);let r;return n!=null&&n.useLocaleWeeks?r=this.end.reconfigure({locale:s.locale}):r=this.end,r=r.startOf(e,n),Math.floor(r.diff(s,e).get(e))+(r.valueOf()!==this.end.valueOf())}hasSame(e){return this.isValid?this.isEmpty()||this.e.minus(1).hasSame(this.s,e):!1}isEmpty(){return this.s.valueOf()===this.e.valueOf()}isAfter(e){return this.isValid?this.s>e:!1}isBefore(e){return this.isValid?this.e<=e:!1}contains(e){return this.isValid?this.s<=e&&this.e>e:!1}set({start:e,end:n}={}){return this.isValid?M.fromDateTimes(e||this.s,n||this.e):this}splitAt(...e){if(!this.isValid)return[];const n=e.map(Ke).filter(o=>this.contains(o)).sort((o,a)=>o.toMillis()-a.toMillis()),s=[];let{s:r}=this,i=0;for(;r<this.e;){const o=n[i]||this.e,a=+o>+this.e?this.e:o;s.push(M.fromDateTimes(r,a)),r=a,i+=1}return s}splitBy(e){const n=N.fromDurationLike(e);if(!this.isValid||!n.isValid||n.as("milliseconds")===0)return[];let{s}=this,r=1,i;const o=[];for(;s<this.e;){const a=this.start.plus(n.mapUnits(l=>l*r));i=+a>+this.e?this.e:a,o.push(M.fromDateTimes(s,i)),s=i,r+=1}return o}divideEqually(e){return this.isValid?this.splitBy(this.length()/e).slice(0,e):[]}overlaps(e){return this.e>e.s&&this.s<e.e}abutsStart(e){return this.isValid?+this.e==+e.s:!1}abutsEnd(e){return this.isValid?+e.e==+this.s:!1}engulfs(e){return this.isValid?this.s<=e.s&&this.e>=e.e:!1}equals(e){return!this.isValid||!e.isValid?!1:this.s.equals(e.s)&&this.e.equals(e.e)}intersection(e){if(!this.isValid)return this;const n=this.s>e.s?this.s:e.s,s=this.e<e.e?this.e:e.e;return n>=s?null:M.fromDateTimes(n,s)}union(e){if(!this.isValid)return this;const n=this.s<e.s?this.s:e.s,s=this.e>e.e?this.e:e.e;return M.fromDateTimes(n,s)}static merge(e){const[n,s]=e.sort((r,i)=>r.s-i.s).reduce(([r,i],o)=>i?i.overlaps(o)||i.abutsStart(o)?[r,i.union(o)]:[r.concat([i]),o]:[r,o],[[],null]);return s&&n.push(s),n}static xor(e){let n=null,s=0;const r=[],i=e.map(l=>[{time:l.s,type:"s"},{time:l.e,type:"e"}]),o=Array.prototype.concat(...i),a=o.sort((l,c)=>l.time-c.time);for(const l of a)s+=l.type==="s"?1:-1,s===1?n=l.time:(n&&+n!=+l.time&&r.push(M.fromDateTimes(n,l.time)),n=null);return M.merge(r)}difference(...e){return M.xor([this].concat(e)).map(n=>this.intersection(n)).filter(n=>n&&!n.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} – ${this.e.toISO()})`:Le}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Interval { start: ${this.s.toISO()}, end: ${this.e.toISO()} }`:`Interval { Invalid, reason: ${this.invalidReason} }`}toLocaleString(e=ut,n={}){return this.isValid?P.create(this.s.loc.clone(n),e).formatInterval(this):Le}toISO(e){return this.isValid?`${this.s.toISO(e)}/${this.e.toISO(e)}`:Le}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:Le}toISOTime(e){return this.isValid?`${this.s.toISOTime(e)}/${this.e.toISOTime(e)}`:Le}toFormat(e,{separator:n=" – "}={}){return this.isValid?`${this.s.toFormat(e)}${n}${this.e.toFormat(e)}`:Le}toDuration(e,n){return this.isValid?this.e.diff(this.s,e,n):N.invalid(this.invalidReason)}mapEndpoints(e){return M.fromDateTimes(e(this.s),e(this.e))}}class bt{static hasDST(e=A.defaultZone){const n=E.now().setZone(e).set({month:12});return!e.isUniversal&&n.offset!==n.set({month:6}).offset}static isValidIANAZone(e){return le.isValidZone(e)}static normalizeZone(e){return de(e,A.defaultZone)}static getStartOfWeek({locale:e=null,locObj:n=null}={}){return(n||_.create(e)).getStartOfWeek()}static getMinimumDaysInFirstWeek({locale:e=null,locObj:n=null}={}){return(n||_.create(e)).getMinDaysInFirstWeek()}static getWeekendWeekdays({locale:e=null,locObj:n=null}={}){return(n||_.create(e)).getWeekendDays().slice()}static months(e="long",{locale:n=null,numberingSystem:s=null,locObj:r=null,outputCalendar:i="gregory"}={}){return(r||_.create(n,s,i)).months(e)}static monthsFormat(e="long",{locale:n=null,numberingSystem:s=null,locObj:r=null,outputCalendar:i="gregory"}={}){return(r||_.create(n,s,i)).months(e,!0)}static weekdays(e="long",{locale:n=null,numberingSystem:s=null,locObj:r=null}={}){return(r||_.create(n,s,null)).weekdays(e)}static weekdaysFormat(e="long",{locale:n=null,numberingSystem:s=null,locObj:r=null}={}){return(r||_.create(n,s,null)).weekdays(e,!0)}static meridiems({locale:e=null}={}){return _.create(e).meridiems()}static eras(e="short",{locale:n=null}={}){return _.create(n,null,"gregory").eras(e)}static features(){return{relative:er(),localeWeek:tr()}}}function Nr(t,e){const n=r=>r.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),s=n(e)-n(t);return Math.floor(N.fromMillis(s).as("days"))}function Mc(t,e,n){const s=[["years",(l,c)=>c.year-l.year],["quarters",(l,c)=>c.quarter-l.quarter+(c.year-l.year)*4],["months",(l,c)=>c.month-l.month+(c.year-l.year)*12],["weeks",(l,c)=>{const f=Nr(l,c);return(f-f%7)/7}],["days",Nr]],r={},i=t;let o,a;for(const[l,c]of s)n.indexOf(l)>=0&&(o=l,r[l]=c(t,e),a=i.plus(r),a>e?(r[l]--,t=i.plus(r),t>e&&(a=t,r[l]--,t=i.plus(r))):t=a);return[t,r,a,o]}function Dc(t,e,n,s){let[r,i,o,a]=Mc(t,e,n);const l=e-r,c=n.filter(d=>["hours","minutes","seconds","milliseconds"].indexOf(d)>=0);c.length===0&&(o<e&&(o=r.plus({[a]:1})),o!==r&&(i[a]=(i[a]||0)+l/(o-r)));const f=N.fromObject(i,s);return c.length>0?N.fromMillis(l,s).shiftTo(...c).plus(f):f}const Rc="missing Intl.DateTimeFormat.formatToParts support";function v(t,e=n=>n){return{regex:t,deser:([n])=>e(ba(n))}}const Cr="[  ]",vr=new RegExp(Cr,"g");function Ic(t){return t.replace(/\./g,"\\.?").replace(vr,Cr)}function _r(t){return t.replace(/\./g,"").replace(vr," ").toLowerCase()}function ne(t,e){return t===null?null:{regex:RegExp(t.map(Ic).join("|")),deser:([n])=>t.findIndex(s=>_r(n)===_r(s))+e}}function xr(t,e){return{regex:t,deser:([,n,s])=>Et(n,s),groups:e}}function Tt(t){return{regex:t,deser:([e])=>e}}function Lc(t){return t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function Vc(t,e){const n=ee(e),s=ee(e,"{2}"),r=ee(e,"{3}"),i=ee(e,"{4}"),o=ee(e,"{6}"),a=ee(e,"{1,2}"),l=ee(e,"{1,3}"),c=ee(e,"{1,6}"),f=ee(e,"{1,9}"),d=ee(e,"{2,4}"),g=ee(e,"{4,6}"),y=T=>({regex:RegExp(Lc(T.val)),deser:([x])=>x,literal:!0}),k=(T=>{if(t.literal)return y(T);switch(T.val){case"G":return ne(e.eras("short"),0);case"GG":return ne(e.eras("long"),0);case"y":return v(c);case"yy":return v(d,hn);case"yyyy":return v(i);case"yyyyy":return v(g);case"yyyyyy":return v(o);case"M":return v(a);case"MM":return v(s);case"MMM":return ne(e.months("short",!0),1);case"MMMM":return ne(e.months("long",!0),1);case"L":return v(a);case"LL":return v(s);case"LLL":return ne(e.months("short",!1),1);case"LLLL":return ne(e.months("long",!1),1);case"d":return v(a);case"dd":return v(s);case"o":return v(l);case"ooo":return v(r);case"HH":return v(s);case"H":return v(a);case"hh":return v(s);case"h":return v(a);case"mm":return v(s);case"m":return v(a);case"q":return v(a);case"qq":return v(s);case"s":return v(a);case"ss":return v(s);case"S":return v(l);case"SSS":return v(r);case"u":return Tt(f);case"uu":return Tt(a);case"uuu":return v(n);case"a":return ne(e.meridiems(),0);case"kkkk":return v(i);case"kk":return v(d,hn);case"W":return v(a);case"WW":return v(s);case"E":case"c":return v(n);case"EEE":return ne(e.weekdays("short",!1),1);case"EEEE":return ne(e.weekdays("long",!1),1);case"ccc":return ne(e.weekdays("short",!0),1);case"cccc":return ne(e.weekdays("long",!0),1);case"Z":case"ZZ":return xr(new RegExp(`([+-]${a.source})(?::(${s.source}))?`),2);case"ZZZ":return xr(new RegExp(`([+-]${a.source})(${s.source})?`),2);case"z":return Tt(/[a-z_+-/]{1,256}?/i);case" ":return Tt(/[^\S\n\r]/);default:return y(T)}})(t)||{invalidReason:Rc};return k.token=t,k}const Fc={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour12:{numeric:"h","2-digit":"hh"},hour24:{numeric:"H","2-digit":"HH"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"},timeZoneName:{long:"ZZZZZ",short:"ZZZ"}};function Bc(t,e,n){const{type:s,value:r}=t;if(s==="literal"){const l=/^\s+$/.test(r);return{literal:!l,val:l?" ":r}}const i=e[s];let o=s;s==="hour"&&(e.hour12!=null?o=e.hour12?"hour12":"hour24":e.hourCycle!=null?e.hourCycle==="h11"||e.hourCycle==="h12"?o="hour12":o="hour24":o=n.hour12?"hour12":"hour24");let a=Fc[o];if(typeof a=="object"&&(a=a[i]),a)return{literal:!1,val:a}}function $c(t){return[`^${t.map(n=>n.regex).reduce((n,s)=>`${n}(${s.source})`,"")}$`,t]}function Uc(t,e,n){const s=t.match(e);if(s){const r={};let i=1;for(const o in n)if(ve(n,o)){const a=n[o],l=a.groups?a.groups+1:1;!a.literal&&a.token&&(r[a.token.val[0]]=a.deser(s.slice(i,i+l))),i+=l}return[s,r]}else return[s,{}]}function Pc(t){const e=i=>{switch(i){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}};let n=null,s;return w(t.z)||(n=le.create(t.z)),w(t.Z)||(n||(n=new q(t.Z)),s=t.Z),w(t.q)||(t.M=(t.q-1)*3+1),w(t.h)||(t.h<12&&t.a===1?t.h+=12:t.h===12&&t.a===0&&(t.h=0)),t.G===0&&t.y&&(t.y=-t.y),w(t.u)||(t.S=un(t.u)),[Object.keys(t).reduce((i,o)=>{const a=e(o);return a&&(i[a]=t[o]),i},{}),n,s]}let yn=null;function Wc(){return yn||(yn=E.fromMillis(1555555555555)),yn}function qc(t,e){if(t.literal)return t;const n=P.macroTokenToFormatOpts(t.val),s=Rr(n,e);return s==null||s.includes(void 0)?t:s}function Ar(t,e){return Array.prototype.concat(...t.map(n=>qc(n,e)))}class Mr{constructor(e,n){if(this.locale=e,this.format=n,this.tokens=Ar(P.parseFormat(n),e),this.units=this.tokens.map(s=>Vc(s,e)),this.disqualifyingUnit=this.units.find(s=>s.invalidReason),!this.disqualifyingUnit){const[s,r]=$c(this.units);this.regex=RegExp(s,"i"),this.handlers=r}}explainFromTokens(e){if(this.isValid){const[n,s]=Uc(e,this.regex,this.handlers),[r,i,o]=s?Pc(s):[null,null,void 0];if(ve(s,"a")&&ve(s,"H"))throw new Ne("Can't include meridiem when specifying 24-hour format");return{input:e,tokens:this.tokens,regex:this.regex,rawMatches:n,matches:s,result:r,zone:i,specificOffset:o}}else return{input:e,tokens:this.tokens,invalidReason:this.invalidReason}}get isValid(){return!this.disqualifyingUnit}get invalidReason(){return this.disqualifyingUnit?this.disqualifyingUnit.invalidReason:null}}function Dr(t,e,n){return new Mr(t,n).explainFromTokens(e)}function Hc(t,e,n){const{result:s,zone:r,specificOffset:i,invalidReason:o}=Dr(t,e,n);return[s,r,i,o]}function Rr(t,e){if(!t)return null;const s=P.create(e,t).dtFormatter(Wc()),r=s.formatToParts(),i=s.resolvedOptions();return r.map(o=>Bc(o,t,i))}const gn="Invalid DateTime",Ir=864e13;function Ge(t){return new te("unsupported zone",`the zone "${t.name}" is not supported`)}function wn(t){return t.weekData===null&&(t.weekData=pt(t.c)),t.weekData}function En(t){return t.localWeekData===null&&(t.localWeekData=pt(t.c,t.loc.getMinDaysInFirstWeek(),t.loc.getStartOfWeek())),t.localWeekData}function Se(t,e){const n={ts:t.ts,zone:t.zone,c:t.c,o:t.o,loc:t.loc,invalid:t.invalid};return new E({...n,...e,old:n})}function Lr(t,e,n){let s=t-e*60*1e3;const r=n.offset(s);if(e===r)return[s,e];s-=(r-e)*60*1e3;const i=n.offset(s);return r===i?[s,r]:[t-Math.min(r,i)*60*1e3,Math.max(r,i)]}function Ot(t,e){t+=e*60*1e3;const n=new Date(t);return{year:n.getUTCFullYear(),month:n.getUTCMonth()+1,day:n.getUTCDate(),hour:n.getUTCHours(),minute:n.getUTCMinutes(),second:n.getUTCSeconds(),millisecond:n.getUTCMilliseconds()}}function Nt(t,e,n){return Lr(wt(t),e,n)}function Vr(t,e){const n=t.o,s=t.c.year+Math.trunc(e.years),r=t.c.month+Math.trunc(e.months)+Math.trunc(e.quarters)*3,i={...t.c,year:s,month:r,day:Math.min(t.c.day,gt(s,r))+Math.trunc(e.days)+Math.trunc(e.weeks)*7},o=N.fromObject({years:e.years-Math.trunc(e.years),quarters:e.quarters-Math.trunc(e.quarters),months:e.months-Math.trunc(e.months),weeks:e.weeks-Math.trunc(e.weeks),days:e.days-Math.trunc(e.days),hours:e.hours,minutes:e.minutes,seconds:e.seconds,milliseconds:e.milliseconds}).as("milliseconds"),a=wt(i);let[l,c]=Lr(a,n,t.zone);return o!==0&&(l+=o,c=t.zone.offset(l)),{ts:l,o:c}}function Ve(t,e,n,s,r,i){const{setZone:o,zone:a}=n;if(t&&Object.keys(t).length!==0||e){const l=e||a,c=E.fromObject(t,{...n,zone:l,specificOffset:i});return o?c:c.setZone(a)}else return E.invalid(new te("unparsable",`the input "${r}" can't be parsed as ${s}`))}function Ct(t,e,n=!0){return t.isValid?P.create(_.create("en-US"),{allowZ:n,forceSimple:!0}).formatDateTimeFromString(t,e):null}function kn(t,e){const n=t.c.year>9999||t.c.year<0;let s="";return n&&t.c.year>=0&&(s+="+"),s+=I(t.c.year,n?6:4),e?(s+="-",s+=I(t.c.month),s+="-",s+=I(t.c.day)):(s+=I(t.c.month),s+=I(t.c.day)),s}function Fr(t,e,n,s,r,i){let o=I(t.c.hour);return e?(o+=":",o+=I(t.c.minute),(t.c.millisecond!==0||t.c.second!==0||!n)&&(o+=":")):o+=I(t.c.minute),(t.c.millisecond!==0||t.c.second!==0||!n)&&(o+=I(t.c.second),(t.c.millisecond!==0||!s)&&(o+=".",o+=I(t.c.millisecond,3))),r&&(t.isOffsetFixed&&t.offset===0&&!i?o+="Z":t.o<0?(o+="-",o+=I(Math.trunc(-t.o/60)),o+=":",o+=I(Math.trunc(-t.o%60))):(o+="+",o+=I(Math.trunc(t.o/60)),o+=":",o+=I(Math.trunc(t.o%60)))),i&&(o+="["+t.zone.ianaName+"]"),o}const Br={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},zc={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},Zc={ordinal:1,hour:0,minute:0,second:0,millisecond:0},$r=["year","month","day","hour","minute","second","millisecond"],jc=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],Yc=["year","ordinal","hour","minute","second","millisecond"];function Jc(t){const e={year:"year",years:"year",month:"month",months:"month",day:"day",days:"day",hour:"hour",hours:"hour",minute:"minute",minutes:"minute",quarter:"quarter",quarters:"quarter",second:"second",seconds:"second",millisecond:"millisecond",milliseconds:"millisecond",weekday:"weekday",weekdays:"weekday",weeknumber:"weekNumber",weeksnumber:"weekNumber",weeknumbers:"weekNumber",weekyear:"weekYear",weekyears:"weekYear",ordinal:"ordinal"}[t.toLowerCase()];if(!e)throw new ms(t);return e}function Ur(t){switch(t.toLowerCase()){case"localweekday":case"localweekdays":return"localWeekday";case"localweeknumber":case"localweeknumbers":return"localWeekNumber";case"localweekyear":case"localweekyears":return"localWeekYear";default:return Jc(t)}}function Gc(t){return _t[t]||(vt===void 0&&(vt=A.now()),_t[t]=t.offset(vt)),_t[t]}function Pr(t,e){const n=de(e.zone,A.defaultZone);if(!n.isValid)return E.invalid(Ge(n));const s=_.fromObject(e);let r,i;if(w(t.year))r=A.now();else{for(const l of $r)w(t[l])&&(t[l]=Br[l]);const o=Xs(t)||Qs(t);if(o)return E.invalid(o);const a=Gc(n);[r,i]=Nt(t,a,n)}return new E({ts:r,zone:n,loc:s,o:i})}function Wr(t,e,n){const s=w(n.round)?!0:n.round,r=(o,a)=>(o=fn(o,s||n.calendary?0:2,!0),e.loc.clone(n).relFormatter(n).format(o,a)),i=o=>n.calendary?e.hasSame(t,o)?0:e.startOf(o).diff(t.startOf(o),o).get(o):e.diff(t,o).get(o);if(n.unit)return r(i(n.unit),n.unit);for(const o of n.units){const a=i(o);if(Math.abs(a)>=1)return r(a,o)}return r(t>e?-0:0,n.units[n.units.length-1])}function qr(t){let e={},n;return t.length>0&&typeof t[t.length-1]=="object"?(e=t[t.length-1],n=Array.from(t).slice(0,t.length-1)):n=Array.from(t),[e,n]}let vt,_t={};class E{constructor(e){const n=e.zone||A.defaultZone;let s=e.invalid||(Number.isNaN(e.ts)?new te("invalid input"):null)||(n.isValid?null:Ge(n));this.ts=w(e.ts)?A.now():e.ts;let r=null,i=null;if(!s)if(e.old&&e.old.ts===this.ts&&e.old.zone.equals(n))[r,i]=[e.old.c,e.old.o];else{const a=me(e.o)&&!e.old?e.o:n.offset(this.ts);r=Ot(this.ts,a),s=Number.isNaN(r.year)?new te("invalid input"):null,r=s?null:r,i=s?null:a}this._zone=n,this.loc=e.loc||_.create(),this.invalid=s,this.weekData=null,this.localWeekData=null,this.c=r,this.o=i,this.isLuxonDateTime=!0}static now(){return new E({})}static local(){const[e,n]=qr(arguments),[s,r,i,o,a,l,c]=n;return Pr({year:s,month:r,day:i,hour:o,minute:a,second:l,millisecond:c},e)}static utc(){const[e,n]=qr(arguments),[s,r,i,o,a,l,c]=n;return e.zone=q.utcInstance,Pr({year:s,month:r,day:i,hour:o,minute:a,second:l,millisecond:c},e)}static fromJSDate(e,n={}){const s=va(e)?e.valueOf():NaN;if(Number.isNaN(s))return E.invalid("invalid input");const r=de(n.zone,A.defaultZone);return r.isValid?new E({ts:s,zone:r,loc:_.fromObject(n)}):E.invalid(Ge(r))}static fromMillis(e,n={}){if(me(e))return e<-Ir||e>Ir?E.invalid("Timestamp out of range"):new E({ts:e,zone:de(n.zone,A.defaultZone),loc:_.fromObject(n)});throw new U(`fromMillis requires a numerical input, but received a ${typeof e} with value ${e}`)}static fromSeconds(e,n={}){if(me(e))return new E({ts:e*1e3,zone:de(n.zone,A.defaultZone),loc:_.fromObject(n)});throw new U("fromSeconds requires a numerical input")}static fromObject(e,n={}){e=e||{};const s=de(n.zone,A.defaultZone);if(!s.isValid)return E.invalid(Ge(s));const r=_.fromObject(n),i=kt(e,Ur),{minDaysInFirstWeek:o,startOfWeek:a}=Ks(i,r),l=A.now(),c=w(n.specificOffset)?s.offset(l):n.specificOffset,f=!w(i.ordinal),d=!w(i.year),g=!w(i.month)||!w(i.day),y=d||g,m=i.weekYear||i.weekNumber;if((y||f)&&m)throw new Ne("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(g&&f)throw new Ne("Can't mix ordinal dates with month/day");const k=m||i.weekday&&!y;let T,x,D=Ot(l,c);k?(T=jc,x=zc,D=pt(D,o,a)):f?(T=Yc,x=Zc,D=cn(D)):(T=$r,x=Br);let W=!1;for(const B of T){const ce=i[B];w(ce)?W?i[B]=x[B]:i[B]=D[B]:W=!0}const et=k?Oa(i,o,a):f?Na(i):Xs(i),S=et||Qs(i);if(S)return E.invalid(S);const C=k?Js(i,o,a):f?Gs(i):i,[F,z]=Nt(C,c,s),R=new E({ts:F,zone:s,o:z,loc:r});return i.weekday&&y&&e.weekday!==R.weekday?E.invalid("mismatched weekday",`you can't specify both a weekday of ${i.weekday} and a date of ${R.toISO()}`):R.isValid?R:E.invalid(R.invalid)}static fromISO(e,n={}){const[s,r]=yc(e);return Ve(s,r,n,"ISO 8601",e)}static fromRFC2822(e,n={}){const[s,r]=gc(e);return Ve(s,r,n,"RFC 2822",e)}static fromHTTP(e,n={}){const[s,r]=wc(e);return Ve(s,r,n,"HTTP",n)}static fromFormat(e,n,s={}){if(w(e)||w(n))throw new U("fromFormat requires an input string and a format");const{locale:r=null,numberingSystem:i=null}=s,o=_.fromOpts({locale:r,numberingSystem:i,defaultToEN:!0}),[a,l,c,f]=Hc(o,e,n);return f?E.invalid(f):Ve(a,l,s,`format ${n}`,e,c)}static fromString(e,n,s={}){return E.fromFormat(e,n,s)}static fromSQL(e,n={}){const[s,r]=Nc(e);return Ve(s,r,n,"SQL",e)}static invalid(e,n=null){if(!e)throw new U("need to specify a reason the DateTime is invalid");const s=e instanceof te?e:new te(e,n);if(A.throwOnInvalid)throw new Ko(s);return new E({invalid:s})}static isDateTime(e){return e&&e.isLuxonDateTime||!1}static parseFormatForOpts(e,n={}){const s=Rr(e,_.fromObject(n));return s?s.map(r=>r?r.val:null).join(""):null}static expandFormat(e,n={}){return Ar(P.parseFormat(e),_.fromObject(n)).map(r=>r.val).join("")}static resetCache(){vt=void 0,_t={}}get(e){return this[e]}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}get outputCalendar(){return this.isValid?this.loc.outputCalendar:null}get zone(){return this._zone}get zoneName(){return this.isValid?this.zone.name:null}get year(){return this.isValid?this.c.year:NaN}get quarter(){return this.isValid?Math.ceil(this.c.month/3):NaN}get month(){return this.isValid?this.c.month:NaN}get day(){return this.isValid?this.c.day:NaN}get hour(){return this.isValid?this.c.hour:NaN}get minute(){return this.isValid?this.c.minute:NaN}get second(){return this.isValid?this.c.second:NaN}get millisecond(){return this.isValid?this.c.millisecond:NaN}get weekYear(){return this.isValid?wn(this).weekYear:NaN}get weekNumber(){return this.isValid?wn(this).weekNumber:NaN}get weekday(){return this.isValid?wn(this).weekday:NaN}get isWeekend(){return this.isValid&&this.loc.getWeekendDays().includes(this.weekday)}get localWeekday(){return this.isValid?En(this).weekday:NaN}get localWeekNumber(){return this.isValid?En(this).weekNumber:NaN}get localWeekYear(){return this.isValid?En(this).weekYear:NaN}get ordinal(){return this.isValid?cn(this.c).ordinal:NaN}get monthShort(){return this.isValid?bt.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?bt.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?bt.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?bt.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}get offset(){return this.isValid?+this.o:NaN}get offsetNameShort(){return this.isValid?this.zone.offsetName(this.ts,{format:"short",locale:this.locale}):null}get offsetNameLong(){return this.isValid?this.zone.offsetName(this.ts,{format:"long",locale:this.locale}):null}get isOffsetFixed(){return this.isValid?this.zone.isUniversal:null}get isInDST(){return this.isOffsetFixed?!1:this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset}getPossibleOffsets(){if(!this.isValid||this.isOffsetFixed)return[this];const e=864e5,n=6e4,s=wt(this.c),r=this.zone.offset(s-e),i=this.zone.offset(s+e),o=this.zone.offset(s-r*n),a=this.zone.offset(s-i*n);if(o===a)return[this];const l=s-o*n,c=s-a*n,f=Ot(l,o),d=Ot(c,a);return f.hour===d.hour&&f.minute===d.minute&&f.second===d.second&&f.millisecond===d.millisecond?[Se(this,{ts:l}),Se(this,{ts:c})]:[this]}get isInLeapYear(){return ze(this.year)}get daysInMonth(){return gt(this.year,this.month)}get daysInYear(){return this.isValid?_e(this.year):NaN}get weeksInWeekYear(){return this.isValid?Ze(this.weekYear):NaN}get weeksInLocalWeekYear(){return this.isValid?Ze(this.localWeekYear,this.loc.getMinDaysInFirstWeek(),this.loc.getStartOfWeek()):NaN}resolvedLocaleOptions(e={}){const{locale:n,numberingSystem:s,calendar:r}=P.create(this.loc.clone(e),e).resolvedOptions(this);return{locale:n,numberingSystem:s,outputCalendar:r}}toUTC(e=0,n={}){return this.setZone(q.instance(e),n)}toLocal(){return this.setZone(A.defaultZone)}setZone(e,{keepLocalTime:n=!1,keepCalendarTime:s=!1}={}){if(e=de(e,A.defaultZone),e.equals(this.zone))return this;if(e.isValid){let r=this.ts;if(n||s){const i=e.offset(this.ts),o=this.toObject();[r]=Nt(o,i,e)}return Se(this,{ts:r,zone:e})}else return E.invalid(Ge(e))}reconfigure({locale:e,numberingSystem:n,outputCalendar:s}={}){const r=this.loc.clone({locale:e,numberingSystem:n,outputCalendar:s});return Se(this,{loc:r})}setLocale(e){return this.reconfigure({locale:e})}set(e){if(!this.isValid)return this;const n=kt(e,Ur),{minDaysInFirstWeek:s,startOfWeek:r}=Ks(n,this.loc),i=!w(n.weekYear)||!w(n.weekNumber)||!w(n.weekday),o=!w(n.ordinal),a=!w(n.year),l=!w(n.month)||!w(n.day),c=a||l,f=n.weekYear||n.weekNumber;if((c||o)&&f)throw new Ne("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(l&&o)throw new Ne("Can't mix ordinal dates with month/day");let d;i?d=Js({...pt(this.c,s,r),...n},s,r):w(n.ordinal)?(d={...this.toObject(),...n},w(n.day)&&(d.day=Math.min(gt(d.year,d.month),d.day))):d=Gs({...cn(this.c),...n});const[g,y]=Nt(d,this.o,this.zone);return Se(this,{ts:g,o:y})}plus(e){if(!this.isValid)return this;const n=N.fromDurationLike(e);return Se(this,Vr(this,n))}minus(e){if(!this.isValid)return this;const n=N.fromDurationLike(e).negate();return Se(this,Vr(this,n))}startOf(e,{useLocaleWeeks:n=!1}={}){if(!this.isValid)return this;const s={},r=N.normalizeUnit(e);switch(r){case"years":s.month=1;case"quarters":case"months":s.day=1;case"weeks":case"days":s.hour=0;case"hours":s.minute=0;case"minutes":s.second=0;case"seconds":s.millisecond=0;break}if(r==="weeks")if(n){const i=this.loc.getStartOfWeek(),{weekday:o}=this;o<i&&(s.weekNumber=this.weekNumber-1),s.weekday=i}else s.weekday=1;if(r==="quarters"){const i=Math.ceil(this.month/3);s.month=(i-1)*3+1}return this.set(s)}endOf(e,n){return this.isValid?this.plus({[e]:1}).startOf(e,n).minus(1):this}toFormat(e,n={}){return this.isValid?P.create(this.loc.redefaultToEN(n)).formatDateTimeFromString(this,e):gn}toLocaleString(e=ut,n={}){return this.isValid?P.create(this.loc.clone(n),e).formatDateTime(this):gn}toLocaleParts(e={}){return this.isValid?P.create(this.loc.clone(e),e).formatDateTimeParts(this):[]}toISO({format:e="extended",suppressSeconds:n=!1,suppressMilliseconds:s=!1,includeOffset:r=!0,extendedZone:i=!1}={}){if(!this.isValid)return null;const o=e==="extended";let a=kn(this,o);return a+="T",a+=Fr(this,o,n,s,r,i),a}toISODate({format:e="extended"}={}){return this.isValid?kn(this,e==="extended"):null}toISOWeekDate(){return Ct(this,"kkkk-'W'WW-c")}toISOTime({suppressMilliseconds:e=!1,suppressSeconds:n=!1,includeOffset:s=!0,includePrefix:r=!1,extendedZone:i=!1,format:o="extended"}={}){return this.isValid?(r?"T":"")+Fr(this,o==="extended",n,e,s,i):null}toRFC2822(){return Ct(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return Ct(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return this.isValid?kn(this,!0):null}toSQLTime({includeOffset:e=!0,includeZone:n=!1,includeOffsetSpace:s=!0}={}){let r="HH:mm:ss.SSS";return(n||e)&&(s&&(r+=" "),n?r+="z":e&&(r+="ZZ")),Ct(this,r,!0)}toSQL(e={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(e)}`:null}toString(){return this.isValid?this.toISO():gn}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`DateTime { ts: ${this.toISO()}, zone: ${this.zone.name}, locale: ${this.locale} }`:`DateTime { Invalid, reason: ${this.invalidReason} }`}valueOf(){return this.toMillis()}toMillis(){return this.isValid?this.ts:NaN}toSeconds(){return this.isValid?this.ts/1e3:NaN}toUnixInteger(){return this.isValid?Math.floor(this.ts/1e3):NaN}toJSON(){return this.toISO()}toBSON(){return this.toJSDate()}toObject(e={}){if(!this.isValid)return{};const n={...this.c};return e.includeConfig&&(n.outputCalendar=this.outputCalendar,n.numberingSystem=this.loc.numberingSystem,n.locale=this.loc.locale),n}toJSDate(){return new Date(this.isValid?this.ts:NaN)}diff(e,n="milliseconds",s={}){if(!this.isValid||!e.isValid)return N.invalid("created by diffing an invalid DateTime");const r={locale:this.locale,numberingSystem:this.numberingSystem,...s},i=_a(n).map(N.normalizeUnit),o=e.valueOf()>this.valueOf(),a=o?this:e,l=o?e:this,c=Dc(a,l,i,r);return o?c.negate():c}diffNow(e="milliseconds",n={}){return this.diff(E.now(),e,n)}until(e){return this.isValid?M.fromDateTimes(this,e):this}hasSame(e,n,s){if(!this.isValid)return!1;const r=e.valueOf(),i=this.setZone(e.zone,{keepLocalTime:!0});return i.startOf(n,s)<=r&&r<=i.endOf(n,s)}equals(e){return this.isValid&&e.isValid&&this.valueOf()===e.valueOf()&&this.zone.equals(e.zone)&&this.loc.equals(e.loc)}toRelative(e={}){if(!this.isValid)return null;const n=e.base||E.fromObject({},{zone:this.zone}),s=e.padding?this<n?-e.padding:e.padding:0;let r=["years","months","days","hours","minutes","seconds"],i=e.unit;return Array.isArray(e.unit)&&(r=e.unit,i=void 0),Wr(n,this.plus(s),{...e,numeric:"always",units:r,unit:i})}toRelativeCalendar(e={}){return this.isValid?Wr(e.base||E.fromObject({},{zone:this.zone}),this,{...e,numeric:"auto",units:["years","months","days"],calendary:!0}):null}static min(...e){if(!e.every(E.isDateTime))throw new U("min requires all arguments be DateTimes");return nr(e,n=>n.valueOf(),Math.min)}static max(...e){if(!e.every(E.isDateTime))throw new U("max requires all arguments be DateTimes");return nr(e,n=>n.valueOf(),Math.max)}static fromFormatExplain(e,n,s={}){const{locale:r=null,numberingSystem:i=null}=s,o=_.fromOpts({locale:r,numberingSystem:i,defaultToEN:!0});return Dr(o,e,n)}static fromStringExplain(e,n,s={}){return E.fromFormatExplain(e,n,s)}static buildFormatParser(e,n={}){const{locale:s=null,numberingSystem:r=null}=n,i=_.fromOpts({locale:s,numberingSystem:r,defaultToEN:!0});return new Mr(i,e)}static fromFormatParser(e,n,s={}){if(w(e)||w(n))throw new U("fromFormatParser requires an input string and a format parser");const{locale:r=null,numberingSystem:i=null}=s,o=_.fromOpts({locale:r,numberingSystem:i,defaultToEN:!0});if(!o.equals(n.locale))throw new U(`fromFormatParser called with a locale of ${o}, but the format parser was created for ${n.locale}`);const{result:a,zone:l,specificOffset:c,invalidReason:f}=n.explainFromTokens(e);return f?E.invalid(f):Ve(a,l,s,`format ${n.format}`,e,c)}static get DATE_SHORT(){return ut}static get DATE_MED(){return ps}static get DATE_MED_WITH_WEEKDAY(){return ea}static get DATE_FULL(){return ys}static get DATE_HUGE(){return gs}static get TIME_SIMPLE(){return ws}static get TIME_WITH_SECONDS(){return Es}static get TIME_WITH_SHORT_OFFSET(){return ks}static get TIME_WITH_LONG_OFFSET(){return Ss}static get TIME_24_SIMPLE(){return bs}static get TIME_24_WITH_SECONDS(){return Ts}static get TIME_24_WITH_SHORT_OFFSET(){return Os}static get TIME_24_WITH_LONG_OFFSET(){return Ns}static get DATETIME_SHORT(){return Cs}static get DATETIME_SHORT_WITH_SECONDS(){return vs}static get DATETIME_MED(){return _s}static get DATETIME_MED_WITH_SECONDS(){return xs}static get DATETIME_MED_WITH_WEEKDAY(){return ta}static get DATETIME_FULL(){return As}static get DATETIME_FULL_WITH_SECONDS(){return Ms}static get DATETIME_HUGE(){return Ds}static get DATETIME_HUGE_WITH_SECONDS(){return Rs}}function Ke(t){if(E.isDateTime(t))return t;if(t&&t.valueOf&&me(t.valueOf()))return E.fromJSDate(t);if(t&&typeof t=="object")return E.fromObject(t);throw new U(`Unknown datetime argument: ${t}, of type ${typeof t}`)}const Kc={},Xc={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},Qc=[u.createElementVNode("path",{fill:"rgb(248 113 113)",d:"M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zm0-384c13.3 0 24 10.7 24 24V264c0 13.3-10.7 24-24 24s-24-10.7-24-24V152c0-13.3 10.7-24 24-24zM224 352a32 32 0 1 1 64 0 32 32 0 1 1 -64 0z"},null,-1)];function el(t,e){return u.openBlock(),u.createElementBlock("svg",Xc,Qc)}const tl=X(Kc,[["render",el]]),nl={class:"messages-container-list"},sl={class:"message-container"},rl={key:0,class:"btn-container-widget"},il=["onClick"],ol={class:"chat-message"},al=["innerHTML"],cl={class:"detail-message flex justify-content-between"},ll={key:0,class:"mr-5"},ul={key:1,class:"mr-5"},fl=X(u.defineComponent({__name:"MessageList",props:{messages:{type:Array,default:()=>[]},canLoadMoreMessages:{type:Boolean,default:!1}},emits:["loadMore","retry"],setup(t,{emit:e}){const n=t,s=u.ref(),{pause:r,resume:i}=Go(s,([{isIntersecting:a}])=>{a&&e("loadMore")});u.onBeforeMount(()=>{n.canLoadMoreMessages||r()}),u.watch(()=>n.canLoadMoreMessages,a=>{if(a){i();return}r()});function o(a){const l=/(https?:\/\/[^\s]+)/g;return a.replace(l,c=>`<a href="${c}" target="_blank">${c}</a>`)}return(a,l)=>(u.openBlock(),u.createElementBlock(u.Fragment,null,[u.createElementVNode("div",{ref_key:"target",ref:s,class:"target"},null,512),u.createElementVNode("div",nl,[(u.openBlock(!0),u.createElementBlock(u.Fragment,null,u.renderList(n.messages,c=>{var f,d;return u.openBlock(),u.createElementBlock("div",{key:c.id,class:u.normalizeClass(["message",c.esCliente?"message-right":"message-left"])},[u.createElementVNode("div",sl,[c.error&&c.esCliente?(u.openBlock(),u.createElementBlock("div",rl,[u.createElementVNode("button",{text:"",rounded:"",class:"btn-danger",icon:"fa-solid fa-circle-exclamation","aria-label":"Cancel",onClick:g=>e("retry",c)},[u.createVNode(tl)],8,il)])):u.createCommentVNode("",!0),u.createElementVNode("div",ol,[u.createElementVNode("div",{class:u.normalizeClass(["bubble",c.esCliente?"right":"left"])},[u.createElementVNode("div",{class:u.normalizeClass(c.esCliente?"content-right":"content-left")},[u.createElementVNode("div",{class:"message-text",style:{"white-space":"pre-line"},innerHTML:o(c.message)},null,8,al),u.createElementVNode("div",cl,[(f=c.sender)!=null&&f.nombreCompleto?(u.openBlock(),u.createElementBlock("span",ll,u.toDisplayString(c.esCliente?(d=c.sender)==null?void 0:d.nombreCompleto:"ECOSISTEMA JL"),1)):(u.openBlock(),u.createElementBlock("span",ul)),u.createElementVNode("span",null,u.toDisplayString(u.unref(E).fromISO(c.createdAt).toFormat("dd-MM-yyyy HH:mm")),1)])],2)],2)])])],2)}),128))])],64))}}),[["__scopeId","data-v-f24d4510"]]),hl={},Hr=t=>(u.pushScopeId("data-v-d9a6b2b7"),t=t(),u.popScopeId(),t),dl={viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",style:{width:"28px",height:"28px"}},ml=[Hr(()=>u.createElementVNode("path",{d:"M12,1A11,11,0,1,0,23,12,11,11,0,0,0,12,1Zm0,19a8,8,0,1,1,8-8A8,8,0,0,1,12,20Z",opacity:".25"},null,-1)),Hr(()=>u.createElementVNode("path",{d:"M10.14,1.16a11,11,0,0,0-9,8.92A1.59,1.59,0,0,0,2.46,12,1.52,1.52,0,0,0,4.11,10.7a8,8,0,0,1,6.66-6.61A1.42,1.42,0,0,0,12,2.69h0A1.57,1.57,0,0,0,10.14,1.16Z",class:"spinner_ajPY"},null,-1))];function pl(t,e){return u.openBlock(),u.createElementBlock("svg",dl,ml)}const yl=X(hl,[["render",pl],["__scopeId","data-v-d9a6b2b7"]]);function gl(t,e,n){for(let s=t.length-1;s>=0;s--)if(t[s][e]===n)return s;return-1}const oe=Object.create(null);oe.open="0",oe.close="1",oe.ping="2",oe.pong="3",oe.message="4",oe.upgrade="5",oe.noop="6";const xt=Object.create(null);Object.keys(oe).forEach(t=>{xt[oe[t]]=t});const Sn={type:"error",data:"parser error"},zr=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",Zr=typeof ArrayBuffer=="function",jr=t=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(t):t&&t.buffer instanceof ArrayBuffer,bn=({type:t,data:e},n,s)=>zr&&e instanceof Blob?n?s(e):Yr(e,s):Zr&&(e instanceof ArrayBuffer||jr(e))?n?s(e):Yr(new Blob([e]),s):s(oe[t]+(e||"")),Yr=(t,e)=>{const n=new FileReader;return n.onload=function(){const s=n.result.split(",")[1];e("b"+(s||""))},n.readAsDataURL(t)};function Jr(t){return t instanceof Uint8Array?t:t instanceof ArrayBuffer?new Uint8Array(t):new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}let Tn;function wl(t,e){if(zr&&t.data instanceof Blob)return t.data.arrayBuffer().then(Jr).then(e);if(Zr&&(t.data instanceof ArrayBuffer||jr(t.data)))return e(Jr(t.data));bn(t,!1,n=>{Tn||(Tn=new TextEncoder),e(Tn.encode(n))})}const Gr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Xe=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let t=0;t<Gr.length;t++)Xe[Gr.charCodeAt(t)]=t;const El=t=>{let e=t.length*.75,n=t.length,s,r=0,i,o,a,l;t[t.length-1]==="="&&(e--,t[t.length-2]==="="&&e--);const c=new ArrayBuffer(e),f=new Uint8Array(c);for(s=0;s<n;s+=4)i=Xe[t.charCodeAt(s)],o=Xe[t.charCodeAt(s+1)],a=Xe[t.charCodeAt(s+2)],l=Xe[t.charCodeAt(s+3)],f[r++]=i<<2|o>>4,f[r++]=(o&15)<<4|a>>2,f[r++]=(a&3)<<6|l&63;return c},kl=typeof ArrayBuffer=="function",On=(t,e)=>{if(typeof t!="string")return{type:"message",data:Kr(t,e)};const n=t.charAt(0);return n==="b"?{type:"message",data:Sl(t.substring(1),e)}:xt[n]?t.length>1?{type:xt[n],data:t.substring(1)}:{type:xt[n]}:Sn},Sl=(t,e)=>{if(kl){const n=El(t);return Kr(n,e)}else return{base64:!0,data:t}},Kr=(t,e)=>{switch(e){case"blob":return t instanceof Blob?t:new Blob([t]);case"arraybuffer":default:return t instanceof ArrayBuffer?t:t.buffer}},Xr="",bl=(t,e)=>{const n=t.length,s=new Array(n);let r=0;t.forEach((i,o)=>{bn(i,!1,a=>{s[o]=a,++r===n&&e(s.join(Xr))})})},Tl=(t,e)=>{const n=t.split(Xr),s=[];for(let r=0;r<n.length;r++){const i=On(n[r],e);if(s.push(i),i.type==="error")break}return s};function Ol(){return new TransformStream({transform(t,e){wl(t,n=>{const s=n.length;let r;if(s<126)r=new Uint8Array(1),new DataView(r.buffer).setUint8(0,s);else if(s<65536){r=new Uint8Array(3);const i=new DataView(r.buffer);i.setUint8(0,126),i.setUint16(1,s)}else{r=new Uint8Array(9);const i=new DataView(r.buffer);i.setUint8(0,127),i.setBigUint64(1,BigInt(s))}t.data&&typeof t.data!="string"&&(r[0]|=128),e.enqueue(r),e.enqueue(n)})}})}let Nn;function At(t){return t.reduce((e,n)=>e+n.length,0)}function Mt(t,e){if(t[0].length===e)return t.shift();const n=new Uint8Array(e);let s=0;for(let r=0;r<e;r++)n[r]=t[0][s++],s===t[0].length&&(t.shift(),s=0);return t.length&&s<t[0].length&&(t[0]=t[0].slice(s)),n}function Nl(t,e){Nn||(Nn=new TextDecoder);const n=[];let s=0,r=-1,i=!1;return new TransformStream({transform(o,a){for(n.push(o);;){if(s===0){if(At(n)<1)break;const l=Mt(n,1);i=(l[0]&128)===128,r=l[0]&127,r<126?s=3:r===126?s=1:s=2}else if(s===1){if(At(n)<2)break;const l=Mt(n,2);r=new DataView(l.buffer,l.byteOffset,l.length).getUint16(0),s=3}else if(s===2){if(At(n)<8)break;const l=Mt(n,8),c=new DataView(l.buffer,l.byteOffset,l.length),f=c.getUint32(0);if(f>Math.pow(2,21)-1){a.enqueue(Sn);break}r=f*Math.pow(2,32)+c.getUint32(4),s=3}else{if(At(n)<r)break;const l=Mt(n,r);a.enqueue(On(i?l:Nn.decode(l),e)),s=0}if(r===0||r>t){a.enqueue(Sn);break}}}})}const Qr=4;function L(t){if(t)return Cl(t)}function Cl(t){for(var e in L.prototype)t[e]=L.prototype[e];return t}L.prototype.on=L.prototype.addEventListener=function(t,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+t]=this._callbacks["$"+t]||[]).push(e),this},L.prototype.once=function(t,e){function n(){this.off(t,n),e.apply(this,arguments)}return n.fn=e,this.on(t,n),this},L.prototype.off=L.prototype.removeListener=L.prototype.removeAllListeners=L.prototype.removeEventListener=function(t,e){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var n=this._callbacks["$"+t];if(!n)return this;if(arguments.length==1)return delete this._callbacks["$"+t],this;for(var s,r=0;r<n.length;r++)if(s=n[r],s===e||s.fn===e){n.splice(r,1);break}return n.length===0&&delete this._callbacks["$"+t],this},L.prototype.emit=function(t){this._callbacks=this._callbacks||{};for(var e=new Array(arguments.length-1),n=this._callbacks["$"+t],s=1;s<arguments.length;s++)e[s-1]=arguments[s];if(n){n=n.slice(0);for(var s=0,r=n.length;s<r;++s)n[s].apply(this,e)}return this},L.prototype.emitReserved=L.prototype.emit,L.prototype.listeners=function(t){return this._callbacks=this._callbacks||{},this._callbacks["$"+t]||[]},L.prototype.hasListeners=function(t){return!!this.listeners(t).length};const K=typeof self<"u"?self:typeof window<"u"?window:Function("return this")();function ei(t,...e){return e.reduce((n,s)=>(t.hasOwnProperty(s)&&(n[s]=t[s]),n),{})}const vl=K.setTimeout,_l=K.clearTimeout;function Dt(t,e){e.useNativeTimers?(t.setTimeoutFn=vl.bind(K),t.clearTimeoutFn=_l.bind(K)):(t.setTimeoutFn=K.setTimeout.bind(K),t.clearTimeoutFn=K.clearTimeout.bind(K))}const xl=1.33;function Al(t){return typeof t=="string"?Ml(t):Math.ceil((t.byteLength||t.size)*xl)}function Ml(t){let e=0,n=0;for(let s=0,r=t.length;s<r;s++)e=t.charCodeAt(s),e<128?n+=1:e<2048?n+=2:e<55296||e>=57344?n+=3:(s++,n+=4);return n}function Dl(t){let e="";for(let n in t)t.hasOwnProperty(n)&&(e.length&&(e+="&"),e+=encodeURIComponent(n)+"="+encodeURIComponent(t[n]));return e}function Rl(t){let e={},n=t.split("&");for(let s=0,r=n.length;s<r;s++){let i=n[s].split("=");e[decodeURIComponent(i[0])]=decodeURIComponent(i[1])}return e}class Il extends Error{constructor(e,n,s){super(e),this.description=n,this.context=s,this.type="TransportError"}}class Cn extends L{constructor(e){super(),this.writable=!1,Dt(this,e),this.opts=e,this.query=e.query,this.socket=e.socket}onError(e,n,s){return super.emitReserved("error",new Il(e,n,s)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(e){this.readyState==="open"&&this.write(e)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(e){const n=On(e,this.socket.binaryType);this.onPacket(n)}onPacket(e){super.emitReserved("packet",e)}onClose(e){this.readyState="closed",super.emitReserved("close",e)}pause(e){}createUri(e,n={}){return e+"://"+this._hostname()+this._port()+this.opts.path+this._query(n)}_hostname(){const e=this.opts.hostname;return e.indexOf(":")===-1?e:"["+e+"]"}_port(){return this.opts.port&&(this.opts.secure&&+(this.opts.port!==443)||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(e){const n=Dl(e);return n.length?"?"+n:""}}const ti="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),vn=64,Ll={};let ni=0,Rt=0,si;function ri(t){let e="";do e=ti[t%vn]+e,t=Math.floor(t/vn);while(t>0);return e}function ii(){const t=ri(+new Date);return t!==si?(ni=0,si=t):t+"."+ri(ni++)}for(;Rt<vn;Rt++)Ll[ti[Rt]]=Rt;let oi=!1;try{oi=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const Vl=oi;function ai(t){const e=t.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!e||Vl))return new XMLHttpRequest}catch{}if(!e)try{return new K[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}function rf(){}function Fl(){}const Bl=function(){return new ai({xdomain:!1}).responseType!=null}();class $l extends Cn{constructor(e){if(super(e),this.polling=!1,typeof location<"u"){const s=location.protocol==="https:";let r=location.port;r||(r=s?"443":"80"),this.xd=typeof location<"u"&&e.hostname!==location.hostname||r!==e.port}const n=e&&e.forceBase64;this.supportsBinary=Bl&&!n,this.opts.withCredentials&&(this.cookieJar=void 0)}get name(){return"polling"}doOpen(){this.poll()}pause(e){this.readyState="pausing";const n=()=>{this.readyState="paused",e()};if(this.polling||!this.writable){let s=0;this.polling&&(s++,this.once("pollComplete",function(){--s||n()})),this.writable||(s++,this.once("drain",function(){--s||n()}))}else n()}poll(){this.polling=!0,this.doPoll(),this.emitReserved("poll")}onData(e){const n=s=>{if(this.readyState==="opening"&&s.type==="open"&&this.onOpen(),s.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(s)};Tl(e,this.socket.binaryType).forEach(n),this.readyState!=="closed"&&(this.polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this.poll())}doClose(){const e=()=>{this.write([{type:"close"}])};this.readyState==="open"?e():this.once("open",e)}write(e){this.writable=!1,bl(e,n=>{this.doWrite(n,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const e=this.opts.secure?"https":"http",n=this.query||{};return this.opts.timestampRequests!==!1&&(n[this.opts.timestampParam]=ii()),!this.supportsBinary&&!n.sid&&(n.b64=1),this.createUri(e,n)}request(e={}){return Object.assign(e,{xd:this.xd,cookieJar:this.cookieJar},this.opts),new ae(this.uri(),e)}doWrite(e,n){const s=this.request({method:"POST",data:e});s.on("success",n),s.on("error",(r,i)=>{this.onError("xhr post error",r,i)})}doPoll(){const e=this.request();e.on("data",this.onData.bind(this)),e.on("error",(n,s)=>{this.onError("xhr poll error",n,s)}),this.pollXhr=e}}class ae extends L{constructor(e,n){super(),Dt(this,n),this.opts=n,this.method=n.method||"GET",this.uri=e,this.data=n.data!==void 0?n.data:null,this.create()}create(){var e;const n=ei(this.opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");n.xdomain=!!this.opts.xd;const s=this.xhr=new ai(n);try{s.open(this.method,this.uri,!0);try{if(this.opts.extraHeaders){s.setDisableHeaderCheck&&s.setDisableHeaderCheck(!0);for(let r in this.opts.extraHeaders)this.opts.extraHeaders.hasOwnProperty(r)&&s.setRequestHeader(r,this.opts.extraHeaders[r])}}catch{}if(this.method==="POST")try{s.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{s.setRequestHeader("Accept","*/*")}catch{}(e=this.opts.cookieJar)===null||e===void 0||e.addCookies(s),"withCredentials"in s&&(s.withCredentials=this.opts.withCredentials),this.opts.requestTimeout&&(s.timeout=this.opts.requestTimeout),s.onreadystatechange=()=>{var r;s.readyState===3&&((r=this.opts.cookieJar)===null||r===void 0||r.parseCookies(s)),s.readyState===4&&(s.status===200||s.status===1223?this.onLoad():this.setTimeoutFn(()=>{this.onError(typeof s.status=="number"?s.status:0)},0))},s.send(this.data)}catch(r){this.setTimeoutFn(()=>{this.onError(r)},0);return}typeof document<"u"&&(this.index=ae.requestsCount++,ae.requests[this.index]=this)}onError(e){this.emitReserved("error",e,this.xhr),this.cleanup(!0)}cleanup(e){if(!(typeof this.xhr>"u"||this.xhr===null)){if(this.xhr.onreadystatechange=Fl,e)try{this.xhr.abort()}catch{}typeof document<"u"&&delete ae.requests[this.index],this.xhr=null}}onLoad(){const e=this.xhr.responseText;e!==null&&(this.emitReserved("data",e),this.emitReserved("success"),this.cleanup())}abort(){this.cleanup()}}if(ae.requestsCount=0,ae.requests={},typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",ci);else if(typeof addEventListener=="function"){const t="onpagehide"in K?"pagehide":"unload";addEventListener(t,ci,!1)}}function ci(){for(let t in ae.requests)ae.requests.hasOwnProperty(t)&&ae.requests[t].abort()}const _n=typeof Promise=="function"&&typeof Promise.resolve=="function"?e=>Promise.resolve().then(e):(e,n)=>n(e,0),It=K.WebSocket||K.MozWebSocket,li=!0,Ul="arraybuffer",ui=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class Pl extends Cn{constructor(e){super(e),this.supportsBinary=!e.forceBase64}get name(){return"websocket"}doOpen(){if(!this.check())return;const e=this.uri(),n=this.opts.protocols,s=ui?{}:ei(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(s.headers=this.opts.extraHeaders);try{this.ws=li&&!ui?n?new It(e,n):new It(e):new It(e,n,s)}catch(r){return this.emitReserved("error",r)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=e=>this.onClose({description:"websocket connection closed",context:e}),this.ws.onmessage=e=>this.onData(e.data),this.ws.onerror=e=>this.onError("websocket error",e)}write(e){this.writable=!1;for(let n=0;n<e.length;n++){const s=e[n],r=n===e.length-1;bn(s,this.supportsBinary,i=>{const o={};try{li&&this.ws.send(i)}catch{}r&&_n(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.close(),this.ws=null)}uri(){const e=this.opts.secure?"wss":"ws",n=this.query||{};return this.opts.timestampRequests&&(n[this.opts.timestampParam]=ii()),this.supportsBinary||(n.b64=1),this.createUri(e,n)}check(){return!!It}}class Wl extends Cn{get name(){return"webtransport"}doOpen(){typeof WebTransport=="function"&&(this.transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name]),this.transport.closed.then(()=>{this.onClose()}).catch(e=>{this.onError("webtransport error",e)}),this.transport.ready.then(()=>{this.transport.createBidirectionalStream().then(e=>{const n=Nl(Number.MAX_SAFE_INTEGER,this.socket.binaryType),s=e.readable.pipeThrough(n).getReader(),r=Ol();r.readable.pipeTo(e.writable),this.writer=r.writable.getWriter();const i=()=>{s.read().then(({done:a,value:l})=>{a||(this.onPacket(l),i())}).catch(a=>{})};i();const o={type:"open"};this.query.sid&&(o.data=`{"sid":"${this.query.sid}"}`),this.writer.write(o).then(()=>this.onOpen())})}))}write(e){this.writable=!1;for(let n=0;n<e.length;n++){const s=e[n],r=n===e.length-1;this.writer.write(s).then(()=>{r&&_n(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var e;(e=this.transport)===null||e===void 0||e.close()}}const ql={websocket:Pl,webtransport:Wl,polling:$l},Hl=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,zl=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function xn(t){const e=t,n=t.indexOf("["),s=t.indexOf("]");n!=-1&&s!=-1&&(t=t.substring(0,n)+t.substring(n,s).replace(/:/g,";")+t.substring(s,t.length));let r=Hl.exec(t||""),i={},o=14;for(;o--;)i[zl[o]]=r[o]||"";return n!=-1&&s!=-1&&(i.source=e,i.host=i.host.substring(1,i.host.length-1).replace(/;/g,":"),i.authority=i.authority.replace("[","").replace("]","").replace(/;/g,":"),i.ipv6uri=!0),i.pathNames=Zl(i,i.path),i.queryKey=jl(i,i.query),i}function Zl(t,e){const n=/\/{2,9}/g,s=e.replace(n,"/").split("/");return(e.slice(0,1)=="/"||e.length===0)&&s.splice(0,1),e.slice(-1)=="/"&&s.splice(s.length-1,1),s}function jl(t,e){const n={};return e.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(s,r,i){r&&(n[r]=i)}),n}let fi=class Be extends L{constructor(e,n={}){super(),this.binaryType=Ul,this.writeBuffer=[],e&&typeof e=="object"&&(n=e,e=null),e?(e=xn(e),n.hostname=e.host,n.secure=e.protocol==="https"||e.protocol==="wss",n.port=e.port,e.query&&(n.query=e.query)):n.host&&(n.hostname=xn(n.host).host),Dt(this,n),this.secure=n.secure!=null?n.secure:typeof location<"u"&&location.protocol==="https:",n.hostname&&!n.port&&(n.port=this.secure?"443":"80"),this.hostname=n.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=n.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=n.transports||["polling","websocket","webtransport"],this.writeBuffer=[],this.prevBufferLen=0,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},n),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=Rl(this.opts.query)),this.id=null,this.upgrades=null,this.pingInterval=null,this.pingTimeout=null,this.pingTimeoutTimer=null,typeof addEventListener=="function"&&(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"})},addEventListener("offline",this.offlineEventListener,!1))),this.open()}createTransport(e){const n=Object.assign({},this.opts.query);n.EIO=Qr,n.transport=e,this.id&&(n.sid=this.id);const s=Object.assign({},this.opts,{query:n,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[e]);return new ql[e](s)}open(){let e;if(this.opts.rememberUpgrade&&Be.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1)e="websocket";else if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}else e=this.transports[0];this.readyState="opening";try{e=this.createTransport(e)}catch{this.transports.shift(),this.open();return}e.open(),this.setTransport(e)}setTransport(e){this.transport&&this.transport.removeAllListeners(),this.transport=e,e.on("drain",this.onDrain.bind(this)).on("packet",this.onPacket.bind(this)).on("error",this.onError.bind(this)).on("close",n=>this.onClose("transport close",n))}probe(e){let n=this.createTransport(e),s=!1;Be.priorWebsocketSuccess=!1;const r=()=>{s||(n.send([{type:"ping",data:"probe"}]),n.once("packet",d=>{if(!s)if(d.type==="pong"&&d.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",n),!n)return;Be.priorWebsocketSuccess=n.name==="websocket",this.transport.pause(()=>{s||this.readyState!=="closed"&&(f(),this.setTransport(n),n.send([{type:"upgrade"}]),this.emitReserved("upgrade",n),n=null,this.upgrading=!1,this.flush())})}else{const g=new Error("probe error");g.transport=n.name,this.emitReserved("upgradeError",g)}}))};function i(){s||(s=!0,f(),n.close(),n=null)}const o=d=>{const g=new Error("probe error: "+d);g.transport=n.name,i(),this.emitReserved("upgradeError",g)};function a(){o("transport closed")}function l(){o("socket closed")}function c(d){n&&d.name!==n.name&&i()}const f=()=>{n.removeListener("open",r),n.removeListener("error",o),n.removeListener("close",a),this.off("close",l),this.off("upgrading",c)};n.once("open",r),n.once("error",o),n.once("close",a),this.once("close",l),this.once("upgrading",c),this.upgrades.indexOf("webtransport")!==-1&&e!=="webtransport"?this.setTimeoutFn(()=>{s||n.open()},200):n.open()}onOpen(){if(this.readyState="open",Be.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush(),this.readyState==="open"&&this.opts.upgrade){let e=0;const n=this.upgrades.length;for(;e<n;e++)this.probe(this.upgrades[e])}}onPacket(e){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",e),this.emitReserved("heartbeat"),this.resetPingTimeout(),e.type){case"open":this.onHandshake(JSON.parse(e.data));break;case"ping":this.sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong");break;case"error":const n=new Error("server error");n.code=e.data,this.onError(n);break;case"message":this.emitReserved("data",e.data),this.emitReserved("message",e.data);break}}onHandshake(e){this.emitReserved("handshake",e),this.id=e.sid,this.transport.query.sid=e.sid,this.upgrades=this.filterUpgrades(e.upgrades),this.pingInterval=e.pingInterval,this.pingTimeout=e.pingTimeout,this.maxPayload=e.maxPayload,this.onOpen(),this.readyState!=="closed"&&this.resetPingTimeout()}resetPingTimeout(){this.clearTimeoutFn(this.pingTimeoutTimer),this.pingTimeoutTimer=this.setTimeoutFn(()=>{this.onClose("ping timeout")},this.pingInterval+this.pingTimeout),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 e=this.getWritablePackets();this.transport.send(e),this.prevBufferLen=e.length,this.emitReserved("flush")}}getWritablePackets(){if(!(this.maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let n=1;for(let s=0;s<this.writeBuffer.length;s++){const r=this.writeBuffer[s].data;if(r&&(n+=Al(r)),s>0&&n>this.maxPayload)return this.writeBuffer.slice(0,s);n+=2}return this.writeBuffer}write(e,n,s){return this.sendPacket("message",e,n,s),this}send(e,n,s){return this.sendPacket("message",e,n,s),this}sendPacket(e,n,s,r){if(typeof n=="function"&&(r=n,n=void 0),typeof s=="function"&&(r=s,s=null),this.readyState==="closing"||this.readyState==="closed")return;s=s||{},s.compress=s.compress!==!1;const i={type:e,data:n,options:s};this.emitReserved("packetCreate",i),this.writeBuffer.push(i),r&&this.once("flush",r),this.flush()}close(){const e=()=>{this.onClose("forced close"),this.transport.close()},n=()=>{this.off("upgrade",n),this.off("upgradeError",n),e()},s=()=>{this.once("upgrade",n),this.once("upgradeError",n)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?s():e()}):this.upgrading?s():e()),this}onError(e){Be.priorWebsocketSuccess=!1,this.emitReserved("error",e),this.onClose("transport error",e)}onClose(e,n){(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")&&(this.clearTimeoutFn(this.pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),typeof removeEventListener=="function"&&(removeEventListener("beforeunload",this.beforeunloadEventListener,!1),removeEventListener("offline",this.offlineEventListener,!1)),this.readyState="closed",this.id=null,this.emitReserved("close",e,n),this.writeBuffer=[],this.prevBufferLen=0)}filterUpgrades(e){const n=[];let s=0;const r=e.length;for(;s<r;s++)~this.transports.indexOf(e[s])&&n.push(e[s]);return n}};fi.protocol=Qr;function Yl(t,e="",n){let s=t;n=n||typeof location<"u"&&location,t==null&&(t=n.protocol+"//"+n.host),typeof t=="string"&&(t.charAt(0)==="/"&&(t.charAt(1)==="/"?t=n.protocol+t:t=n.host+t),/^(https?|wss?):\/\//.test(t)||(typeof n<"u"?t=n.protocol+"//"+t:t="https://"+t),s=xn(t)),s.port||(/^(http|ws)$/.test(s.protocol)?s.port="80":/^(http|ws)s$/.test(s.protocol)&&(s.port="443")),s.path=s.path||"/";const i=s.host.indexOf(":")!==-1?"["+s.host+"]":s.host;return s.id=s.protocol+"://"+i+":"+s.port+e,s.href=s.protocol+"://"+i+(n&&n.port===s.port?"":":"+s.port),s}const Jl=typeof ArrayBuffer=="function",Gl=t=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(t):t.buffer instanceof ArrayBuffer,hi=Object.prototype.toString,Kl=typeof Blob=="function"||typeof Blob<"u"&&hi.call(Blob)==="[object BlobConstructor]",Xl=typeof File=="function"||typeof File<"u"&&hi.call(File)==="[object FileConstructor]";function An(t){return Jl&&(t instanceof ArrayBuffer||Gl(t))||Kl&&t instanceof Blob||Xl&&t instanceof File}function Lt(t,e){if(!t||typeof t!="object")return!1;if(Array.isArray(t)){for(let n=0,s=t.length;n<s;n++)if(Lt(t[n]))return!0;return!1}if(An(t))return!0;if(t.toJSON&&typeof t.toJSON=="function"&&arguments.length===1)return Lt(t.toJSON(),!0);for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&Lt(t[n]))return!0;return!1}function Ql(t){const e=[],n=t.data,s=t;return s.data=Mn(n,e),s.attachments=e.length,{packet:s,buffers:e}}function Mn(t,e){if(!t)return t;if(An(t)){const n={_placeholder:!0,num:e.length};return e.push(t),n}else if(Array.isArray(t)){const n=new Array(t.length);for(let s=0;s<t.length;s++)n[s]=Mn(t[s],e);return n}else if(typeof t=="object"&&!(t instanceof Date)){const n={};for(const s in t)Object.prototype.hasOwnProperty.call(t,s)&&(n[s]=Mn(t[s],e));return n}return t}function eu(t,e){return t.data=Dn(t.data,e),delete t.attachments,t}function Dn(t,e){if(!t)return t;if(t&&t._placeholder===!0){if(typeof t.num=="number"&&t.num>=0&&t.num<e.length)return e[t.num];throw new Error("illegal attachments")}else if(Array.isArray(t))for(let n=0;n<t.length;n++)t[n]=Dn(t[n],e);else if(typeof t=="object")for(const n in t)Object.prototype.hasOwnProperty.call(t,n)&&(t[n]=Dn(t[n],e));return t}const tu=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],nu=5;var b;(function(t){t[t.CONNECT=0]="CONNECT",t[t.DISCONNECT=1]="DISCONNECT",t[t.EVENT=2]="EVENT",t[t.ACK=3]="ACK",t[t.CONNECT_ERROR=4]="CONNECT_ERROR",t[t.BINARY_EVENT=5]="BINARY_EVENT",t[t.BINARY_ACK=6]="BINARY_ACK"})(b||(b={}));class su{constructor(e){this.replacer=e}encode(e){return(e.type===b.EVENT||e.type===b.ACK)&&Lt(e)?this.encodeAsBinary({type:e.type===b.EVENT?b.BINARY_EVENT:b.BINARY_ACK,nsp:e.nsp,data:e.data,id:e.id}):[this.encodeAsString(e)]}encodeAsString(e){let n=""+e.type;return(e.type===b.BINARY_EVENT||e.type===b.BINARY_ACK)&&(n+=e.attachments+"-"),e.nsp&&e.nsp!=="/"&&(n+=e.nsp+","),e.id!=null&&(n+=e.id),e.data!=null&&(n+=JSON.stringify(e.data,this.replacer)),n}encodeAsBinary(e){const n=Ql(e),s=this.encodeAsString(n.packet),r=n.buffers;return r.unshift(s),r}}function di(t){return Object.prototype.toString.call(t)==="[object Object]"}class Rn extends L{constructor(e){super(),this.reviver=e}add(e){let n;if(typeof e=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");n=this.decodeString(e);const s=n.type===b.BINARY_EVENT;s||n.type===b.BINARY_ACK?(n.type=s?b.EVENT:b.ACK,this.reconstructor=new ru(n),n.attachments===0&&super.emitReserved("decoded",n)):super.emitReserved("decoded",n)}else if(An(e)||e.base64)if(this.reconstructor)n=this.reconstructor.takeBinaryData(e),n&&(this.reconstructor=null,super.emitReserved("decoded",n));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+e)}decodeString(e){let n=0;const s={type:Number(e.charAt(0))};if(b[s.type]===void 0)throw new Error("unknown packet type "+s.type);if(s.type===b.BINARY_EVENT||s.type===b.BINARY_ACK){const i=n+1;for(;e.charAt(++n)!=="-"&&n!=e.length;);const o=e.substring(i,n);if(o!=Number(o)||e.charAt(n)!=="-")throw new Error("Illegal attachments");s.attachments=Number(o)}if(e.charAt(n+1)==="/"){const i=n+1;for(;++n&&!(e.charAt(n)===","||n===e.length););s.nsp=e.substring(i,n)}else s.nsp="/";const r=e.charAt(n+1);if(r!==""&&Number(r)==r){const i=n+1;for(;++n;){const o=e.charAt(n);if(o==null||Number(o)!=o){--n;break}if(n===e.length)break}s.id=Number(e.substring(i,n+1))}if(e.charAt(++n)){const i=this.tryParse(e.substr(n));if(Rn.isPayloadValid(s.type,i))s.data=i;else throw new Error("invalid payload")}return s}tryParse(e){try{return JSON.parse(e,this.reviver)}catch{return!1}}static isPayloadValid(e,n){switch(e){case b.CONNECT:return di(n);case b.DISCONNECT:return n===void 0;case b.CONNECT_ERROR:return typeof n=="string"||di(n);case b.EVENT:case b.BINARY_EVENT:return Array.isArray(n)&&(typeof n[0]=="number"||typeof n[0]=="string"&&tu.indexOf(n[0])===-1);case b.ACK:case b.BINARY_ACK:return Array.isArray(n)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class ru{constructor(e){this.packet=e,this.buffers=[],this.reconPack=e}takeBinaryData(e){if(this.buffers.push(e),this.buffers.length===this.reconPack.attachments){const n=eu(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const iu=Object.freeze(Object.defineProperty({__proto__:null,Decoder:Rn,Encoder:su,get PacketType(){return b},protocol:nu},Symbol.toStringTag,{value:"Module"}));function se(t,e,n){return t.on(e,n),function(){t.off(e,n)}}const ou=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class mi extends L{constructor(e,n,s){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=e,this.nsp=n,s&&s.auth&&(this.auth=s.auth),this._opts=Object.assign({},s),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const e=this.io;this.subs=[se(e,"open",this.onopen.bind(this)),se(e,"packet",this.onpacket.bind(this)),se(e,"error",this.onerror.bind(this)),se(e,"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(...e){return e.unshift("message"),this.emit.apply(this,e),this}emit(e,...n){if(ou.hasOwnProperty(e))throw new Error('"'+e.toString()+'" is a reserved event name');if(n.unshift(e),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(n),this;const s={type:b.EVENT,data:n};if(s.options={},s.options.compress=this.flags.compress!==!1,typeof n[n.length-1]=="function"){const o=this.ids++,a=n.pop();this._registerAckCallback(o,a),s.id=o}const r=this.io.engine&&this.io.engine.transport&&this.io.engine.transport.writable;return this.flags.volatile&&(!r||!this.connected)||(this.connected?(this.notifyOutgoingListeners(s),this.packet(s)):this.sendBuffer.push(s)),this.flags={},this}_registerAckCallback(e,n){var s;const r=(s=this.flags.timeout)!==null&&s!==void 0?s:this._opts.ackTimeout;if(r===void 0){this.acks[e]=n;return}const i=this.io.setTimeoutFn(()=>{delete this.acks[e];for(let o=0;o<this.sendBuffer.length;o++)this.sendBuffer[o].id===e&&this.sendBuffer.splice(o,1);n.call(this,new Error("operation has timed out"))},r);this.acks[e]=(...o)=>{this.io.clearTimeoutFn(i),n.apply(this,[null,...o])}}emitWithAck(e,...n){const s=this.flags.timeout!==void 0||this._opts.ackTimeout!==void 0;return new Promise((r,i)=>{n.push((o,a)=>s?o?i(o):r(a):r(o)),this.emit(e,...n)})}_addToQueue(e){let n;typeof e[e.length-1]=="function"&&(n=e.pop());const s={id:this._queueSeq++,tryCount:0,pending:!1,args:e,flags:Object.assign({fromQueue:!0},this.flags)};e.push((r,...i)=>s!==this._queue[0]?void 0:(r!==null?s.tryCount>this._opts.retries&&(this._queue.shift(),n&&n(r)):(this._queue.shift(),n&&n(null,...i)),s.pending=!1,this._drainQueue())),this._queue.push(s),this._drainQueue()}_drainQueue(e=!1){if(!this.connected||this._queue.length===0)return;const n=this._queue[0];n.pending&&!e||(n.pending=!0,n.tryCount++,this.flags=n.flags,this.emit.apply(this,n.args))}packet(e){e.nsp=this.nsp,this.io._packet(e)}onopen(){typeof this.auth=="function"?this.auth(e=>{this._sendConnectPacket(e)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(e){this.packet({type:b.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},e):e})}onerror(e){this.connected||this.emitReserved("connect_error",e)}onclose(e,n){this.connected=!1,delete this.id,this.emitReserved("disconnect",e,n)}onpacket(e){if(e.nsp===this.nsp)switch(e.type){case b.CONNECT:e.data&&e.data.sid?this.onconnect(e.data.sid,e.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 b.EVENT:case b.BINARY_EVENT:this.onevent(e);break;case b.ACK:case b.BINARY_ACK:this.onack(e);break;case b.DISCONNECT:this.ondisconnect();break;case b.CONNECT_ERROR:this.destroy();const s=new Error(e.data.message);s.data=e.data.data,this.emitReserved("connect_error",s);break}}onevent(e){const n=e.data||[];e.id!=null&&n.push(this.ack(e.id)),this.connected?this.emitEvent(n):this.receiveBuffer.push(Object.freeze(n))}emitEvent(e){if(this._anyListeners&&this._anyListeners.length){const n=this._anyListeners.slice();for(const s of n)s.apply(this,e)}super.emit.apply(this,e),this._pid&&e.length&&typeof e[e.length-1]=="string"&&(this._lastOffset=e[e.length-1])}ack(e){const n=this;let s=!1;return function(...r){s||(s=!0,n.packet({type:b.ACK,id:e,data:r}))}}onack(e){const n=this.acks[e.id];typeof n=="function"&&(n.apply(this,e.data),delete this.acks[e.id])}onconnect(e,n){this.id=e,this.recovered=n&&this._pid===n,this._pid=n,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(e=>this.emitEvent(e)),this.receiveBuffer=[],this.sendBuffer.forEach(e=>{this.notifyOutgoingListeners(e),this.packet(e)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(e=>e()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:b.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(e){return this.flags.compress=e,this}get volatile(){return this.flags.volatile=!0,this}timeout(e){return this.flags.timeout=e,this}onAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(e),this}prependAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(e),this}offAny(e){if(!this._anyListeners)return this;if(e){const n=this._anyListeners;for(let s=0;s<n.length;s++)if(e===n[s])return n.splice(s,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(e),this}prependAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(e),this}offAnyOutgoing(e){if(!this._anyOutgoingListeners)return this;if(e){const n=this._anyOutgoingListeners;for(let s=0;s<n.length;s++)if(e===n[s])return n.splice(s,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(e){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const n=this._anyOutgoingListeners.slice();for(const s of n)s.apply(this,e.data)}}}function Fe(t){t=t||{},this.ms=t.min||100,this.max=t.max||1e4,this.factor=t.factor||2,this.jitter=t.jitter>0&&t.jitter<=1?t.jitter:0,this.attempts=0}Fe.prototype.duration=function(){var t=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var e=Math.random(),n=Math.floor(e*this.jitter*t);t=Math.floor(e*10)&1?t+n:t-n}return Math.min(t,this.max)|0},Fe.prototype.reset=function(){this.attempts=0},Fe.prototype.setMin=function(t){this.ms=t},Fe.prototype.setMax=function(t){this.max=t},Fe.prototype.setJitter=function(t){this.jitter=t};class In extends L{constructor(e,n){var s;super(),this.nsps={},this.subs=[],e&&typeof e=="object"&&(n=e,e=void 0),n=n||{},n.path=n.path||"/socket.io",this.opts=n,Dt(this,n),this.reconnection(n.reconnection!==!1),this.reconnectionAttempts(n.reconnectionAttempts||1/0),this.reconnectionDelay(n.reconnectionDelay||1e3),this.reconnectionDelayMax(n.reconnectionDelayMax||5e3),this.randomizationFactor((s=n.randomizationFactor)!==null&&s!==void 0?s:.5),this.backoff=new Fe({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(n.timeout==null?2e4:n.timeout),this._readyState="closed",this.uri=e;const r=n.parser||iu;this.encoder=new r.Encoder,this.decoder=new r.Decoder,this._autoConnect=n.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(e){return arguments.length?(this._reconnection=!!e,this):this._reconnection}reconnectionAttempts(e){return e===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=e,this)}reconnectionDelay(e){var n;return e===void 0?this._reconnectionDelay:(this._reconnectionDelay=e,(n=this.backoff)===null||n===void 0||n.setMin(e),this)}randomizationFactor(e){var n;return e===void 0?this._randomizationFactor:(this._randomizationFactor=e,(n=this.backoff)===null||n===void 0||n.setJitter(e),this)}reconnectionDelayMax(e){var n;return e===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=e,(n=this.backoff)===null||n===void 0||n.setMax(e),this)}timeout(e){return arguments.length?(this._timeout=e,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(e){if(~this._readyState.indexOf("open"))return this;this.engine=new fi(this.uri,this.opts);const n=this.engine,s=this;this._readyState="opening",this.skipReconnect=!1;const r=se(n,"open",function(){s.onopen(),e&&e()}),i=a=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",a),e?e(a):this.maybeReconnectOnOpen()},o=se(n,"error",i);if(this._timeout!==!1){const a=this._timeout,l=this.setTimeoutFn(()=>{r(),i(new Error("timeout")),n.close()},a);this.opts.autoUnref&&l.unref(),this.subs.push(()=>{this.clearTimeoutFn(l)})}return this.subs.push(r),this.subs.push(o),this}connect(e){return this.open(e)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const e=this.engine;this.subs.push(se(e,"ping",this.onping.bind(this)),se(e,"data",this.ondata.bind(this)),se(e,"error",this.onerror.bind(this)),se(e,"close",this.onclose.bind(this)),se(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(e){try{this.decoder.add(e)}catch(n){this.onclose("parse error",n)}}ondecoded(e){_n(()=>{this.emitReserved("packet",e)},this.setTimeoutFn)}onerror(e){this.emitReserved("error",e)}socket(e,n){let s=this.nsps[e];return s?this._autoConnect&&!s.active&&s.connect():(s=new mi(this,e,n),this.nsps[e]=s),s}_destroy(e){const n=Object.keys(this.nsps);for(const s of n)if(this.nsps[s].active)return;this._close()}_packet(e){const n=this.encoder.encode(e);for(let s=0;s<n.length;s++)this.engine.write(n[s],e.options)}cleanup(){this.subs.forEach(e=>e()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close"),this.engine&&this.engine.close()}disconnect(){return this._close()}onclose(e,n){this.cleanup(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",e,n),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const e=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const n=this.backoff.duration();this._reconnecting=!0;const s=this.setTimeoutFn(()=>{e.skipReconnect||(this.emitReserved("reconnect_attempt",e.backoff.attempts),!e.skipReconnect&&e.open(r=>{r?(e._reconnecting=!1,e.reconnect(),this.emitReserved("reconnect_error",r)):e.onreconnect()}))},n);this.opts.autoUnref&&s.unref(),this.subs.push(()=>{this.clearTimeoutFn(s)})}}onreconnect(){const e=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",e)}}const Qe={};function Vt(t,e){typeof t=="object"&&(e=t,t=void 0),e=e||{};const n=Yl(t,e.path||"/socket.io"),s=n.source,r=n.id,i=n.path,o=Qe[r]&&i in Qe[r].nsps,a=e.forceNew||e["force new connection"]||e.multiplex===!1||o;let l;return a?l=new In(s,e):(Qe[r]||(Qe[r]=new In(s,e)),l=Qe[r]),n.query&&!e.query&&(e.query=n.queryKey),l.socket(n.path,e)}Object.assign(Vt,{Manager:In,Socket:mi,io:Vt,connect:Vt});var pi=(t=>(t.WEBCHAT="webchat",t.CENTRAL="central",t.WHATSAPP="whatsapp",t.TELEGRAM="telegram",t.SMS="sms",t))(pi||{});const au={class:"widget"},cu={class:"header-widget"},lu={class:"title-chat"},uu={key:0,class:"loader"},fu={class:"w-full"},hu=["onSubmit"],du={class:"form-message"},mu={class:"jl-inputgroup-chat"},pu=["onKeyup"],yu={type:"submit",class:"pointer btn-primary"},gu=14,wu=X(u.defineComponent({__name:"Chat",props:{titlePrincipal:{type:String,default:"Comunicación en linea para consultas"},toggleChat:{type:Function,required:!0},tokenAuth:{type:String,required:!0},user:{type:Object,required:!0},visible:{type:Boolean,required:!0}},emits:["show-toast","show-confirm","new-message","clear-new-messages","not-viewed-total"],setup(t,{emit:e}){const n=t,s=u.ref(""),r=u.ref(0),i=u.ref({data:[],canLoadMoreMessages:!1}),o=u.ref(""),a=u.ref(!1),l=u.ref(null);u.watch(()=>n.visible,async S=>{if(!S||(e("clear-new-messages"),m(),r.value>0&&hs(o.value,n.tokenAuth),o.value))return;const C=await fs(n.tokenAuth);C&&(o.value=C.appChat.id)});function c(S){var C;if(S.key==="Enter"&&S.shiftKey){const F=((C=S.target)==null?void 0:C.value)||"";S.target.value=F+`
4
+ `,x();return}f()}const f=async S=>{var z,R,B;if(((z=s.value)==null?void 0:z.length)>300){e("show-toast",{severity:"warn",summary:"Error",detail:"El mensaje no puede superar los 300 caracteres",life:5e3});return}if(!s.value.trim()){e("show-toast",{severity:"warn",summary:"Error",detail:"Por favor ingrese un mensaje",life:5e3});return}const C={id:ki(),chatId:(B=(R=W.value)==null?void 0:R.chat)==null?void 0:B.id,message:s.value,visto:!0,multimedia:!1,esCliente:!0,appChatId:o.value,createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),sender:{nombreCompleto:n.user.nombreCompleto,ci:n.user.ci,msPersonaId:n.user.msPersonaId}},F=i.value.data.push(C)-1;d(s.value,o.value).then(ce=>{var Ft,yi;if(!ce)i.value.data[F].error={error:!0,id:C.id},e("show-toast",{severity:"error",summary:"Error",detail:"Ocurrio un error al enviar el mensaje, intente nuevamente",life:5e3});else{i.value.data[F]=ce;const Hu={...ce,chatId:C.chatId};(yi=D.value)==null||yi.emit("sendMessage",{roomId:(Ft=W==null?void 0:W.value)==null?void 0:Ft.appChat.id,message:Hu},zu=>{console.log("🚀 ~ socketService.value.emit ~ response:",zu)})}}),s.value="",m(),T.value&&(T.value.style.height="20px")},d=async(S,C)=>qo({esCliente:!0,message:S,appChatId:C},n.tokenAuth),g=async()=>{var z,R,B;const S=(z=i.value.data[0])==null?void 0:z.id,C={lastMessagesId:S,appChatId:o.value,limit:10};a.value=!0;const F=await Wo({body:C,token:n.tokenAuth});a.value=!1,i.value.data.unshift(...F.data.sort((ce,Ft)=>-Ft.createdAt.localeCompare(ce.createdAt))),i.value.canLoadMoreMessages=F.pagination.total>F.pagination.size,S&&((R=l.value)!=null&&R.scrollHeight)&&k((B=l.value)==null?void 0:B.scrollHeight),S||m()},y=async S=>{e("show-confirm",async()=>{var F,z,R;if(!((F=S.error)!=null&&F.id))return;const C=await d(S.message,o.value);if(!C)e("show-toast",{severity:"error",summary:"Error",detail:"Ocurrio un error al enviar el mensaje, intente nuevamente",life:5e3});else{const B=gl(i.value.data,"id",S.error.id);i.value.data[B]={...C,error:void 0},(R=D.value)==null||R.emit("sendMessage",{roomId:(z=W==null?void 0:W.value)==null?void 0:z.appChat.id,message:S})}m()})},m=()=>{u.nextTick(()=>{l.value&&(l.value.scrollTop=l.value.scrollHeight)})},k=S=>{u.nextTick(()=>{const C=l.value;C&&(C.scrollTop=C.scrollHeight-S)})},T=u.ref();function x(){T.value&&(T.value.style.height=T.value.scrollHeight-gu+"px",T.value.scrollHeight!==T.value.clientHeight&&(T.value.style.height=T.value.scrollHeight+"px"))}const D=u.ref(),W=u.ref();function et(S,C=pi.WEBCHAT){var F,z;if(!S)throw new Error("user chat is required");D.value=Vt(window.VITE_SOCKET_URI,{query:{usuarioId:`${(z=(F=S==null?void 0:S.chat)==null?void 0:F.persona)==null?void 0:z.funcionarioId}`,aplicacion:C},extraHeaders:{Authorization:n.tokenAuth}}),D.value.removeAllListeners(),D.value.on("connect",()=>{var R,B;console.log("Conectado al servidor de sockets"),(B=D.value)==null||B.emit("joinRoom",`${(R=S==null?void 0:S.appChat)==null?void 0:R.id}`)}),D.value.on("disconnect",()=>{console.log("Desconectado del servidor de sockets")}),D.value.on("receiveMessage",R=>{var B,ce;console.log("Mensaje recibido:",R.message,S),R.message.sender.msPersonaId!==((ce=(B=S==null?void 0:S.chat)==null?void 0:B.persona)==null?void 0:ce.msPersonaId)&&(i.value.data.push(R.message),hs(R.message.appChatId,n.tokenAuth),m(),!n.visible&&e("new-message"))})}return u.onMounted(async()=>{if(o.value)return;const S=await fs(n.tokenAuth);S&&(W.value=S,o.value=S.appChat.id,r.value=S.appChat.totalNoVistosCliente,et(S),g(),e("not-viewed-total",S.appChat.totalNoVistosCliente))}),u.onUnmounted(()=>{var S;(S=D.value)==null||S.off()}),(S,C)=>(u.openBlock(),u.createElementBlock("div",au,[u.createElementVNode("div",cu,[u.createElementVNode("h4",lu,u.toDisplayString(t.titlePrincipal),1),u.createElementVNode("button",{onClick:C[0]||(C[0]=()=>t.toggleChat()),class:"btn-close"},[u.createVNode(Ni,{class:"pointer"})])]),u.createElementVNode("div",{class:"messages-container",ref_key:"messageContainerRef",ref:l},[a.value?(u.openBlock(),u.createElementBlock("div",uu,[u.createVNode(yl)])):u.createCommentVNode("",!0),u.createVNode(fl,{messages:i.value.data,canLoadMoreMessages:i.value.canLoadMoreMessages,onLoadMore:g,onRetry:y},null,8,["messages","canLoadMoreMessages"])],512),u.createElementVNode("div",fu,[u.createElementVNode("form",{class:"message-send",onSubmit:u.withModifiers(f,["prevent"])},[u.createElementVNode("div",du,[u.createElementVNode("div",mu,[u.withDirectives(u.createElementVNode("textarea",{"onUpdate:modelValue":C[1]||(C[1]=F=>s.value=F),class:"jl2-input-chat",required:"",ref_key:"textAreaRef",ref:T,onInput:C[2]||(C[2]=()=>x()),onKeydown:C[3]||(C[3]=u.withKeys(u.withModifiers(()=>{},["prevent"]),["enter"])),onKeyup:u.withKeys(c,["enter"])},null,40,pu),[[u.vModelText,s.value]]),u.createElementVNode("button",yu,[u.createVNode(Ai,{style:{width:"20px",height:"20px"}})])])])],40,hu)])]))}}),[["__scopeId","data-v-7b739220"]]),Eu={},ku={width:"87",height:"87",viewBox:"0 0 87 87",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Su=[u.createStaticVNode('<g filter="url(#filter0_d_4007_3488)"><path d="M43.5 77C64.2107 77 81 60.2107 81 39.5C81 18.7893 64.2107 2 43.5 2C22.7893 2 6 18.7893 6 39.5C6 60.2107 22.7893 77 43.5 77Z" fill="white" stroke="#F28B0C" stroke-width="3" stroke-miterlimit="10"></path><path d="M39.705 38.885C40.6908 38.885 41.49 38.0858 41.49 37.1C41.49 36.1142 40.6908 35.315 39.705 35.315C38.7192 35.315 37.92 36.1142 37.92 37.1C37.92 38.0858 38.7192 38.885 39.705 38.885Z" fill="#F28B0C"></path><path d="M45.075 38.885C46.0608 38.885 46.86 38.0858 46.86 37.1C46.86 36.1142 46.0608 35.315 45.075 35.315C44.0892 35.315 43.29 36.1142 43.29 37.1C43.29 38.0858 44.0892 38.885 45.075 38.885Z" fill="#F28B0C"></path><path d="M50.445 38.885C51.4308 38.885 52.23 38.0858 52.23 37.1C52.23 36.1142 51.4308 35.315 50.445 35.315C49.4592 35.315 48.66 36.1142 48.66 37.1C48.66 38.0858 49.4592 38.885 50.445 38.885Z" fill="#F28B0C"></path><path d="M63.27 58.235L58.755 47.78C61.125 44.765 62.415 40.97 62.415 37.175C62.415 26.435 52.665 18.185 41.925 20.12C39.99 19.325 37.98 18.905 35.835 18.905C26.955 18.905 19.785 26.135 19.785 34.955C19.785 38.54 21 41.975 23.145 44.765L18.99 54.44C18.84 54.8 18.915 55.235 19.2 55.445C19.485 55.73 19.92 55.73 20.205 55.595L30.6 50.15C31.89 50.585 33.255 50.87 34.68 50.945C39.48 54.53 45.57 55.25 50.655 53.45L61.905 59.33C62.265 59.48 62.625 59.48 62.91 59.18C63.345 58.97 63.405 58.61 63.27 58.25V58.235ZM51.24 51.71C51.03 51.56 50.745 51.56 50.52 51.635C48.795 52.28 46.935 52.64 45.15 52.64C36.69 52.64 29.61 45.755 29.61 37.1C29.61 29.72 34.845 23.345 42.075 21.845C51.75 19.91 60.705 27.29 60.705 37.1C60.705 40.685 59.415 44.27 57.12 46.985C56.91 47.27 56.835 47.63 56.97 47.915L60.69 56.585L51.24 51.71Z" fill="#F28B0C"></path></g><defs><filter id="filter0_d_4007_3488" x="0.5" y="0.5" width="86" height="86" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feFlood flood-opacity="0" result="BackgroundImageFix"></feFlood><feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"></feColorMatrix><feOffset dy="4"></feOffset><feGaussianBlur stdDeviation="2"></feGaussianBlur><feComposite in2="hardAlpha" operator="out"></feComposite><feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0"></feColorMatrix><feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_4007_3488"></feBlend><feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_4007_3488" result="shape"></feBlend></filter></defs>',2)];function bu(t,e){return u.openBlock(),u.createElementBlock("svg",ku,Su)}const Tu=X(Eu,[["render",bu]]),Ou={},Nu={viewBox:"0 0 256 256",version:"1.1",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",preserveAspectRatio:"xMidYMid"},Cu=[u.createElementVNode("g",null,[u.createElementVNode("path",{d:"M128,0 C57.307,0 0,57.307 0,128 L0,128 C0,198.693 57.307,256 128,256 L128,256 C198.693,256 256,198.693 256,128 L256,128 C256,57.307 198.693,0 128,0 L128,0 Z",fill:"#40B3E0"}),u.createElementVNode("path",{d:"M190.2826,73.6308 L167.4206,188.8978 C167.4206,188.8978 164.2236,196.8918 155.4306,193.0548 L102.6726,152.6068 L83.4886,143.3348 L51.1946,132.4628 C51.1946,132.4628 46.2386,130.7048 45.7586,126.8678 C45.2796,123.0308 51.3546,120.9528 51.3546,120.9528 L179.7306,70.5928 C179.7306,70.5928 190.2826,65.9568 190.2826,73.6308",fill:"#FFFFFF"}),u.createElementVNode("path",{d:"M98.6178,187.6035 C98.6178,187.6035 97.0778,187.4595 95.1588,181.3835 C93.2408,175.3085 83.4888,143.3345 83.4888,143.3345 L161.0258,94.0945 C161.0258,94.0945 165.5028,91.3765 165.3428,94.0945 C165.3428,94.0945 166.1418,94.5735 163.7438,96.8115 C161.3458,99.0505 102.8328,151.6475 102.8328,151.6475",fill:"#D2E5F1"}),u.createElementVNode("path",{d:"M122.9015,168.1154 L102.0335,187.1414 C102.0335,187.1414 100.4025,188.3794 98.6175,187.6034 L102.6135,152.2624",fill:"#B5CFE4"})],-1)];function vu(t,e){return u.openBlock(),u.createElementBlock("svg",Nu,Cu)}const _u=X(Ou,[["render",vu]]),xu={},Au={version:"1.1",id:"Capa_1",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 455.731 455.731","xml:space":"preserve"},Mu=[u.createElementVNode("g",null,[u.createElementVNode("rect",{x:"0",y:"0",style:{fill:"#1bd741"},width:"455.731",height:"455.731"}),u.createElementVNode("g",null,[u.createElementVNode("path",{style:{fill:"#ffffff"},d:`M68.494,387.41l22.323-79.284c-14.355-24.387-21.913-52.134-21.913-80.638
4
5
  c0-87.765,71.402-159.167,159.167-159.167s159.166,71.402,159.166,159.167c0,87.765-71.401,159.167-159.166,159.167
5
6
  c-27.347,0-54.125-7-77.814-20.292L68.494,387.41z M154.437,337.406l4.872,2.975c20.654,12.609,44.432,19.274,68.762,19.274
6
7
  c72.877,0,132.166-59.29,132.166-132.167S300.948,95.321,228.071,95.321S95.904,154.611,95.904,227.488
@@ -9,7 +10,7 @@
9
10
  c15.575,4.404,27.827,1.435,37.28-4.612c7.487-4.789,12.648-12.476,14.508-21.166l1.649-7.702c0.524-2.448-0.719-4.932-2.993-5.98
10
11
  l-34.905-16.089c-2.266-1.044-4.953-0.384-6.477,1.591l-13.703,17.764c-1.035,1.342-2.807,1.874-4.407,1.312
11
12
  c-9.384-3.298-40.818-16.463-58.066-49.687c-0.748-1.441-0.562-3.19,0.499-4.419l13.096-15.15
12
- c1.338-1.547,1.676-3.722,0.872-5.602l-15.046-35.201C187.187,154.774,185.392,153.518,183.359,153.407z`})])],-1)];function Mu(t,e){return u.openBlock(),u.createElementBlock("svg",xu,Au)}const Ru=X(_u,[["render",Mu]]),Du={},Iu={version:"1.1",id:"Capa_1",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"-10 -10 78 78","xml:space":"preserve"},Lu=[u.createElementVNode("g",null,[u.createElementVNode("path",{style:{fill:"orange"},d:`M29,1.5c-16.016,0-29,11.641-29,26c0,5.292,1.768,10.211,4.796,14.318
13
+ c1.338-1.547,1.676-3.722,0.872-5.602l-15.046-35.201C187.187,154.774,185.392,153.518,183.359,153.407z`})])],-1)];function Du(t,e){return u.openBlock(),u.createElementBlock("svg",Au,Mu)}const Ru=X(xu,[["render",Du]]),Iu={},Lu={version:"1.1",id:"Capa_1",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"-10 -10 78 78","xml:space":"preserve"},Vu=[u.createElementVNode("g",null,[u.createElementVNode("path",{style:{fill:"orange"},d:`M29,1.5c-16.016,0-29,11.641-29,26c0,5.292,1.768,10.211,4.796,14.318
13
14
  C4.398,46.563,3.254,53.246,0,56.5c0,0,9.943-1.395,16.677-5.462c0.007,0.003,0.015,0.006,0.022,0.009
14
15
  c2.764-1.801,5.532-3.656,6.105-4.126c0.3-0.421,0.879-0.548,1.33-0.277c0.296,0.178,0.483,0.503,0.489,0.848
15
- c0.01,0.622-0.005,0.784-5.585,4.421C22.146,52.933,25.498,53.5,29,53.5c16.016,0,29-11.641,29-26S45.016,1.5,29,1.5z`}),u.createElementVNode("circle",{style:{fill:"#ffffff"},cx:"15",cy:"27.5",r:"3"}),u.createElementVNode("circle",{style:{fill:"#ffffff"},cx:"29",cy:"27.5",r:"3"}),u.createElementVNode("circle",{style:{fill:"#ffffff"},cx:"43",cy:"27.5",r:"3"})],-1)];function Vu(t,e){return u.openBlock(),u.createElementBlock("svg",Iu,Lu)}const Fu=X(Du,[["render",Vu]]),Bu={id:"chat-circle",class:"widget-container"},$u={key:0,class:"new-message-badge"},Uu={class:"chat-box"},Pu=X(u.defineComponent({__name:"Widget",props:{tokenAuth:{type:String,required:!0},titlePrincipal:{type:String},user:{type:Object,required:!0},isDarkMode:{type:Boolean,default:!1}},emits:["show-toast","show-confirm"],setup(t,{emit:e}){const n=t;function s(l){var d;const c=((d=window.VITE_CELLPHONE_NUMBERS)==null?void 0:d.split(","))??[];if(c.length===0){console.warn("not found cellphone numbers");return}o.value=!1;const f=Math.floor(Math.random()*c.length);if(l===0){window.open("https://wa.me/"+c[f],"WhatsApp","noopener");return}window.open("https://t.me/+"+c[f],"Telegram","noopener")}const r=u.ref(!1),i=u.ref(0),o=u.ref(!1),a=()=>{r.value=!r.value};return(l,c)=>(u.openBlock(),u.createElementBlock("div",{class:u.normalizeClass(["widget-css-reset widget-container",t.isDarkMode?"chat-dark-mode":""])},[u.withDirectives(u.createElementVNode("div",Bu,[u.createElementVNode("div",{class:u.normalizeClass(["container-buttons-chat",{active:o.value}])},[u.createElementVNode("a",{href:"javascript:;",class:"button whatsapp",onClick:c[0]||(c[0]=f=>s(0))},[u.createVNode(Ru)]),u.createElementVNode("a",{href:"javascript:;",class:"button telegram",onClick:c[1]||(c[1]=f=>s(1))},[u.createVNode(vu)]),u.createElementVNode("a",{href:"javascript:;",class:u.normalizeClass(["button webchat",{disabled:n.tokenAuth.length<10}]),title:"Debe estar autenticado",onClick:c[2]||(c[2]=f=>o.value&&n.tokenAuth.length>10&&a())},[u.createVNode(Fu)],2)],2),i.value?(u.openBlock(),u.createElementBlock("div",$u,u.toDisplayString(i.value>9?"9+":i.value),1)):u.createCommentVNode("",!0),u.createElementVNode("a",{href:"javascript:;",onClick:c[3]||(c[3]=f=>o.value=!o.value)},[u.createVNode(Tu)])],512),[[u.vShow,!r.value]]),u.withDirectives(u.createElementVNode("div",Uu,[t.tokenAuth?(u.openBlock(),u.createBlock(gu,{key:0,visible:r.value,titlePrincipal:t.titlePrincipal,toggleChat:a,tokenAuth:t.tokenAuth,user:t.user,onShowToast:c[4]||(c[4]=f=>e("show-toast",f)),onShowConfirm:c[5]||(c[5]=f=>e("show-confirm",f)),onClearNewMessages:c[6]||(c[6]=f=>i.value=0),onNewMessage:c[7]||(c[7]=()=>i.value++),onNotViewedTotal:c[8]||(c[8]=f=>i.value=f)},null,8,["visible","titlePrincipal","tokenAuth","user"])):u.createCommentVNode("",!0)],512),[[u.vShow,r.value]])],2))}}),[["__scopeId","data-v-e2e1f135"]]),Wu={install(t,e){window.VITE_BACKEND_URL=e.VITE_BACKEND_URL,window.VITE_SOCKET_URI=e.VITE_SOCKET_URI,window.VITE_CELLPHONE_NUMBERS=e.VITE_CELLPHONE_NUMBERS}};ue.Widget=Pu,ue.default=Wu,Object.defineProperties(ue,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
16
+ c0.01,0.622-0.005,0.784-5.585,4.421C22.146,52.933,25.498,53.5,29,53.5c16.016,0,29-11.641,29-26S45.016,1.5,29,1.5z`}),u.createElementVNode("circle",{style:{fill:"#ffffff"},cx:"15",cy:"27.5",r:"3"}),u.createElementVNode("circle",{style:{fill:"#ffffff"},cx:"29",cy:"27.5",r:"3"}),u.createElementVNode("circle",{style:{fill:"#ffffff"},cx:"43",cy:"27.5",r:"3"})],-1)];function Fu(t,e){return u.openBlock(),u.createElementBlock("svg",Lu,Vu)}const Bu=X(Iu,[["render",Fu]]),$u={id:"chat-circle",class:"widget-container"},Uu={key:0,class:"new-message-badge"},Pu={class:"chat-box"},Wu=X(u.defineComponent({__name:"Widget",props:{tokenAuth:{type:String,required:!0},titlePrincipal:{type:String},user:{type:Object,required:!0},isDarkMode:{type:Boolean,default:!1}},emits:["show-toast","show-confirm"],setup(t,{emit:e}){const n=t;function s(l){var d;const c=((d=window.VITE_CELLPHONE_NUMBERS)==null?void 0:d.split(","))??[];if(c.length===0){console.warn("not found cellphone numbers");return}o.value=!1;const f=Math.floor(Math.random()*c.length);if(l===0){window.open("https://wa.me/"+c[f],"WhatsApp","noopener");return}window.open("https://t.me/+"+c[f],"Telegram","noopener")}const r=u.ref(!1),i=u.ref(0),o=u.ref(!1),a=()=>{r.value=!r.value};return(l,c)=>(u.openBlock(),u.createElementBlock("div",{class:u.normalizeClass(["widget-css-reset widget-container",t.isDarkMode?"chat-dark-mode":""])},[u.withDirectives(u.createElementVNode("div",$u,[u.createElementVNode("div",{class:u.normalizeClass(["container-buttons-chat",{active:o.value}])},[u.createElementVNode("a",{href:"javascript:;",class:"button whatsapp",onClick:c[0]||(c[0]=f=>s(0))},[u.createVNode(Ru)]),u.createElementVNode("a",{href:"javascript:;",class:"button telegram",onClick:c[1]||(c[1]=f=>s(1))},[u.createVNode(_u)]),u.createElementVNode("a",{href:"javascript:;",class:u.normalizeClass(["button webchat",{disabled:n.tokenAuth.length<10}]),title:"Debe estar autenticado",onClick:c[2]||(c[2]=f=>o.value&&n.tokenAuth.length>10&&a())},[u.createVNode(Bu)],2)],2),i.value?(u.openBlock(),u.createElementBlock("div",Uu,u.toDisplayString(i.value>9?"9+":i.value),1)):u.createCommentVNode("",!0),u.createElementVNode("a",{href:"javascript:;",onClick:c[3]||(c[3]=f=>n.tokenAuth.length>10&&a())},[u.createVNode(Tu)])],512),[[u.vShow,!r.value]]),u.withDirectives(u.createElementVNode("div",Pu,[t.tokenAuth?(u.openBlock(),u.createBlock(wu,{key:0,visible:r.value,titlePrincipal:t.titlePrincipal,toggleChat:a,tokenAuth:t.tokenAuth,user:t.user,onShowToast:c[4]||(c[4]=f=>e("show-toast",f)),onShowConfirm:c[5]||(c[5]=f=>e("show-confirm",f)),onClearNewMessages:c[6]||(c[6]=f=>i.value=0),onNewMessage:c[7]||(c[7]=()=>i.value++),onNotViewedTotal:c[8]||(c[8]=f=>i.value=f)},null,8,["visible","titlePrincipal","tokenAuth","user"])):u.createCommentVNode("",!0)],512),[[u.vShow,r.value]])],2))}}),[["__scopeId","data-v-ca19c81b"]]),qu={install(t,e){window.VITE_BACKEND_URL=e.VITE_BACKEND_URL,window.VITE_SOCKET_URI=e.VITE_SOCKET_URI,window.VITE_CELLPHONE_NUMBERS=e.VITE_CELLPHONE_NUMBERS}};ue.Widget=Wu,ue.default=qu,Object.defineProperties(ue,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});