PageSourceSearch

https://auvious.video/chunk-6SUCXGMB.js

js auvious.video collected 2026-10-08 04:38:39 UTC 89,793 bytes, 5 lines download raw bytes

vendor: 9,742 bytes, line 1
1import{g as xn,l as Un,m as g}from"./chunk-S4AJAS7N.js";var zt=xn((rt,At)=>{(function(K,U){"use strict";var ge="1.0.37",R="",Pe="?",J="function",oe="undefined",A="object",Z="string",w="major",v="model",p="name",s="type",E="vendor",b="version",j="architecture",ve="console",I="mobile",O="tablet",$="smarttv",le="wearable",Me="embedded",ze=500,Ce="Amazon",ye="Apple",ee="ASUS",Se="BlackBerry",re="Browser",xe="Chrome",Ot="Edge",ae="Firefox",Ue="Google",We="Huawei",ue="LG",Ge="Microsoft",$e="Motorola",fe="Opera",Ae="Samsung",Qe="Sharp",je="Sony",te="Xiaomi",qe="Zebra",at="Facebook",st="Chromium OS",ct="Mac OS",It=function(N,k){var S={};for(var x in N)k[x]&&k[x].length%2===0?S[x]=k[x].concat(N[x]):S[x]=N[x];return S},Le=function(N){for(var k={},S=0;S<N.length;S++)k[N[S].toUpperCase()]=N[S];return k},lt=function(N,k){return typeof N===Z?ne(k).indexOf(ne(N))!==-1:!1},ne=function(N){return N.toLowerCase()},Ke=function(N){return typeof N===Z?N.replace(/[^\d\.]/g,R).split(".")[0]:U},Oe=function(N,k){if(typeof N===Z)return N=N.replace(/^\s\s*/,R),typeof k===oe?N:N.substring(0,ze)},de=function(N,k){for(var S=0,x,se,H,D,y,Y;S<k.length&&!y;){var He=k[S],ut=k[S+1];for(x=se=0;x<He.length&&!y&&He[x];)if(y=He[x++].exec(N),y)for(H=0;H<ut.length;H++)Y=y[++se],D=ut[H],typeof D===A&&D.length>0?D.length===2?typeof D[1]==J?this[D[0]]=D[1].call(this,Y):this[D[0]]=D[1]:D.length===3?typeof D[1]===J&&!(D[1].exec&&D[1].test)?this[D[0]]=Y?D[1].call(this,Y,D[2]):U:this[D[0]]=Y?Y.replace(D[1],D[2]):U:D.length===4&&(this[D[0]]=Y?D[3].call(this,Y.replace(D[1],D[2])):U):this[D]=Y||U;S+=2}},Ie=function(N,k){for(var S in k)if(typeof k[S]===A&&k[S].length>0){for(var x=0;x<k[S].length;x++)if(lt(k[S][x],N))return S===Pe?U:S}else if(lt(k[S],N))return S===Pe?U:S;return N},Ye={"1.0":"/8","1.2":"/1","1.3":"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"},Xe={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2","8.1":"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},Je={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[b,[p,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[b,[p,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[p,b],[/opios[\/ ]+([\w\.]+)/i],[b,[p,fe+" Mini"]],[/\bopr\/([\w\.]+)/i],[b,[p,fe]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[b,[p,"Baidu"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/ ]?([\w\.]*)/i,/(avant|iemobile|slim)\s?(?:browser)?[\/ ]?([\w\.]*)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|qq|duckduckgo)\/([-\w\.]+)/i,/(heytap|ovi)browser\/([\d\.]+)/i,/(weibo)__([\d\.]+)/i],[p,b],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[b,[p,"UC"+re]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[b,[p,"WeChat"]],[/konqueror\/([\w\.]+)/i],[b,[p,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[b,[p,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[b,[p,"Yandex"]],[/slbrowser\/([\w\.]+)/i],[b,[p,"Smart Lenovo "+re]],[/(avast|avg)\/([\w\.]+)/i],[[p,/(.+)/,"$1 Secure "+re],b],[/\bfocus\/([\w\.]+)/i],[b,[p,ae+" Focus"]],[/\bopt\/([\w\.]+)/i],[b,[p,fe+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[b,[p,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[b,[p,"Dolphin"]],[/coast\/([\w\.]+)/i],[b,[p,fe+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[b,[p,"MIUI "+re]],[/fxios\/([-\w\.]+)/i],[b,[p,ae]],[/\bqihu|(qi?ho?o?|360)browser/i],[[p,"360 "+re]],[/(oculus|sailfish|huawei|vivo)browser\/([\w\.]+)/i],[[p,/(.+)/,"$1 "+re],b],[/samsungbrowser\/([\w\.]+)/i],[b,[p,Ae+" Internet"]],[/(comodo_dragon)\/([\w\.]+)/i],[[p,/_/g," "],b],[/metasr[\/ ]?([\d\.]+)/i],[b,[p,"Sogou Explorer"]],[/(sogou)mo\w+\/([\d\.]+)/i],[[p,"Sogou Mobile"],b],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345Explorer)[\/ ]?([\w\.]+)/i],[p,b],[/(lbbrowser)/i,/\[(linkedin)app\]/i],[p],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[p,at],b],[/(Klarna)\/([\w\.]+)/i,/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(alipay)client\/([\w\.]+)/i,/(chromium|instagram|snapchat)[\/ ]([-\w\.]+)/i],[p,b],[/\bgsa\/([\w\.]+) .*safari\//i],[b,[p,"GSA"]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[b,[p,"TikTok"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[b,[p,xe+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[p,xe+" WebView"],b],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[b,[p,"Android "+re]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[p,b],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[b,[p,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[b,p],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[p,[b,Ie,Ye]],[/(webkit|khtml)\/([\w\.]+)/i],[p,b],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[p,"Netscape"],b],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[b,[p,ae+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i,/panasonic;(viera)/i],[p,b],[/(cobalt)\/([\w\.]+)/i],[p,[b,/master.|lts./,""]]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[j,"amd64"]],[/(ia32(?=;))/i],[[j,ne]],[/((?:i[346]|x)86)[;\)]/i],[[j,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[j,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[j,"armhf"]],[/windows (ce|mobile); ppc;/i],[[j,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[j,/ower/,R,ne]],[/(sun4\w)[;\)]/i],[[j,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[j,ne]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[v,[E,Ae],[s,O]],[/\b((?:s[cgp]h|gt|sm)-\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[v,[E,Ae],[s,I]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[v,[E,ye],[s,I]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[v,[E,ye],[s,O]],[/(macintosh);/i],[v,[E,ye]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[v,[E,Qe],[s,I]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[v,[E,We],[s,O]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[v,[E,We],[s,I]],[/\b(poco[\w ]+|m2\d{3}j\d\d[a-z]{2})(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/oid[^\)]+; (m?[12][0-389][01]\w{3,6}[c-y])( bui|; wv|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i],[[v,/_/g," "],[E,te],[s,I]],[/oid[^\)]+; (2\d{4}(283|rpbf)[cgl])( bui|\))/i,/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[v,/_/g," "],[E,te],[s,O]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[v,[E,"OPPO"],[s,I]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[v,[E,"Vivo"],[s,I]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[v,[E,"Realme"],[s,I]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[v,[E,$e],[s,I]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[v,[E,$e],[s,O]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[v,[E,ue],[s,O]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[v,[E,ue],[s,I]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[v,[E,"Lenovo"],[s,O]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[v,/_/g," "],[E,"Nokia"],[s,I]],[/(pixel c)\b/i],[v,[E,Ue],[s,O]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[v,[E,Ue],[s,I]],[/droid.+ (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[v,[E,je],[s,I]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[v,"Xperia Tablet"],[E,je],[s,O]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[v,[E,"OnePlus"],[s,I]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[v,[E,Ce],[s,O]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[v,/(.+)/g,"Fire Phone $1"],[E,Ce],[s,I]],[/(playbook);[-\w\),; ]+(rim)/i],[v,E,[s,O]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[v,[E,Se],[s,I]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[v,[E,ee],[s,O]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[v,[E,ee],[s,I]],[/(nexus 9)/i],[v,[E,"HTC"],[s,O]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[E,[v,/_/g," "],[s,I]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[v,[E,"Acer"],[s,O]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[v,[E,"Meizu"],[s,I]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[v,[E,"Ulefone"],[s,I]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron|infinix|tecno)[-_ ]?([-\w]*)/i,/(hp) ([\w ]+\w)/i,/(asu
1s)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[E,v,[s,I]],[/(kobo)\s(ereader|touch)/i,/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[E,v,[s,O]],[/(surface duo)/i],[v,[E,Ge],[s,O]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[v,[E,"Fairphone"],[s,I]],[/(u304aa)/i],[v,[E,"AT&T"],[s,I]],[/\bsie-(\w*)/i],[v,[E,"Siemens"],[s,I]],[/\b(rct\w+) b/i],[v,[E,"RCA"],[s,O]],[/\b(venue[\d ]{2,7}) b/i],[v,[E,"Dell"],[s,O]],[/\b(q(?:mv|ta)\w+) b/i],[v,[E,"Verizon"],[s,O]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[v,[E,"Barnes & Noble"],[s,O]],[/\b(tm\d{3}\w+) b/i],[v,[E,"NuVision"],[s,O]],[/\b(k88) b/i],[v,[E,"ZTE"],[s,O]],[/\b(nx\d{3}j) b/i],[v,[E,"ZTE"],[s,I]],[/\b(gen\d{3}) b.+49h/i],[v,[E,"Swiss"],[s,I]],[/\b(zur\d{3}) b/i],[v,[E,"Swiss"],[s,O]],[/\b((zeki)?tb.*\b) b/i],[v,[E,"Zeki"],[s,O]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[E,"Dragon Touch"],v,[s,O]],[/\b(ns-?\w{0,9}) b/i],[v,[E,"Insignia"],[s,O]],[/\b((nxa|next)-?\w{0,9}) b/i],[v,[E,"NextBook"],[s,O]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[E,"Voice"],v,[s,I]],[/\b(lvtel\-)?(v1[12]) b/i],[[E,"LvTel"],v,[s,I]],[/\b(ph-1) /i],[v,[E,"Essential"],[s,I]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[v,[E,"Envizen"],[s,O]],[/\b(trio[-\w\. ]+) b/i],[v,[E,"MachSpeed"],[s,O]],[/\btu_(1491) b/i],[v,[E,"Rotor"],[s,O]],[/(shield[\w ]+) b/i],[v,[E,"Nvidia"],[s,O]],[/(sprint) (\w+)/i],[E,v,[s,I]],[/(kin\.[onetw]{3})/i],[[v,/\./g," "],[E,Ge],[s,I]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[v,[E,qe],[s,O]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[v,[E,qe],[s,I]],[/smart-tv.+(samsung)/i],[E,[s,$]],[/hbbtv.+maple;(\d+)/i],[[v,/^/,"SmartTV"],[E,Ae],[s,$]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[E,ue],[s,$]],[/(apple) ?tv/i],[E,[v,ye+" TV"],[s,$]],[/crkey/i],[[v,xe+"cast"],[E,Ue],[s,$]],[/droid.+aft(\w+)( bui|\))/i],[v,[E,Ce],[s,$]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[v,[E,Qe],[s,$]],[/(bravia[\w ]+)( bui|\))/i],[v,[E,je],[s,$]],[/(mitv-\w{5}) bui/i],[v,[E,te],[s,$]],[/Hbbtv.*(technisat) (.*);/i],[E,v,[s,$]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[E,Oe],[v,Oe],[s,$]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[s,$]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[E,v,[s,ve]],[/droid.+; (shield) bui/i],[v,[E,"Nvidia"],[s,ve]],[/(playstation [345portablevi]+)/i],[v,[E,je],[s,ve]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[v,[E,Ge],[s,ve]],[/((pebble))app/i],[E,v,[s,le]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[v,[E,ye],[s,le]],[/droid.+; (glass) \d/i],[v,[E,Ue],[s,le]],[/droid.+; (wt63?0{2,3})\)/i],[v,[E,qe],[s,le]],[/(quest( 2| pro)?)/i],[v,[E,at],[s,le]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[E,[s,Me]],[/(aeobc)\b/i],[v,[E,Ce],[s,Me]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+? mobile safari/i],[v,[s,I]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[v,[s,O]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[s,O]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[s,I]],[/(android[-\w\. ]{0,9});.+buil/i],[v,[E,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[b,[p,Ot+"HTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[b,[p,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[p,b],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[b,p]],os:[[/microsoft (windows) (vista|xp)/i],[p,b],[/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i],[p,[b,Ie,Xe]],[/windows nt 6\.2; (arm)/i,/windows[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i,/(?:win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[b,Ie,Xe],[p,"Windows"]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[b,/_/g,"."],[p,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[p,ct],[b,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[b,p],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[p,b],[/\(bb(10);/i],[b,[p,Se]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[b,[p,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[b,[p,ae+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[b,[p,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[b,[p,"watchOS"]],[/crkey\/([\d\.]+)/i],[b,[p,xe+"cast"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[p,st],b],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[p,b],[/(sunos) ?([\w\.\d]*)/i],[[p,"Solaris"],b],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[p,b]]},z=function(N,k){if(typeof N===A&&(k=N,N=U),!(this instanceof z))return new z(N,k).getResult();var S=typeof K!==oe&&K.navigator?K.navigator:U,x=N||(S&&S.userAgent?S.userAgent:R),se=S&&S.userAgentData?S.userAgentData:U,H=k?It(Je,k):Je,D=S&&S.userAgent==x;return this.getBrowser=function(){var y={};return y[p]=U,y[b]=U,de.call(y,x,H.browser),y[w]=Ke(y[b]),D&&S&&S.brave&&typeof S.brave.isBrave==J&&(y[p]="Brave"),y},this.getCPU=function(){var y={};return y[j]=U,de.call(y,x,H.cpu),y},this.getDevice=function(){var y={};return y[E]=U,y[v]=U,y[s]=U,de.call(y,x,H.device),D&&!y[s]&&se&&se.mobile&&(y[s]=I),D&&y[v]=="Macintosh"&&S&&typeof S.standalone!==oe&&S.maxTouchPoints&&S.maxTouchPoints>2&&(y[v]="iPad",y[s]=O),y},this.getEngine=function(){var y={};return y[p]=U,y[b]=U,de.call(y,x,H.engine),y},this.getOS=function(){var y={};return y[p]=U,y[b]=U,de.call(y,x,H.os),D&&!y[p]&&se&&se.platform!="Unknown"&&(y[p]=se.platform.replace(/chrome os/i,st).replace(/macos/i,ct)),y},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return x},this.setUA=function(y){return x=typeof y===Z&&y.length>ze?Oe(y,ze):y,this},this.setUA(x),this};z.VERSION=ge,z.BROWSER=Le([p,b,w]),z.CPU=Le([j]),z.DEVICE=Le([v,E,s,ve,I,$,O,le,Me]),z.ENGINE=z.OS=Le([p,b]),typeof rt!==oe?(typeof At!==oe&&At.exports&&(rt=At.exports=z),rt.UAParser=z):typeof define===J&&define.amd?define(function(){return z}):typeof K!==oe&&(K.UAParser=z);var he=typeof K!==oe&&(K.jQuery||K.Zepto);if(he&&!he.ua){var Ne=new z;he.ua=Ne.getResult(),he.ua.get=function(){return Ne.getUA()},he.ua.set=function(N){Ne.setUA(N);var k=Ne.getResult();for(var S in k)he.ua[S]=k[S]}}})(typeof window=="object"?window:rt)});var xi=xn((W,ie)=>{(function(K,U){if(typeof W=="object"&&typeof ie=="object")ie.exports=U(zt());else if(typeof define=="function"&&define.amd)define(["ua-parser-js"],U);else{var ge=U(typeof W=="object"?zt():K["ua-parser-js"]);for(var R in ge)(typeof W=="object"?W:K)[R]=ge[R]}})(self,K=>(()=>{"use strict";var U={555:(n,e,t)=>{e.TG=void 0,t(620),t(155),e.TG=function(i){var r=Date.parse(i);return isNaN(r)&&(r=(function(o){var l,u=/^(\d{4}-\d\d-\d\d([tT][\d:.]*)?)([zZ]|([+-])(\d\d):?(\d\d))?$/.exec(o)||[];if(u[1]){if((l=u[1].split(/\D/).map(function(d){return parseInt(d,10)||0}))[1]-=1,!(l=new Date(Date.UTC.apply(Date,l))).getDate())return NaN;if(u[5]){var a=60*parseInt(u[5],10);u[6]&&(a+=parseInt(u[6],10)),u[4]==="+"&&(a*=-1),a&&l.setUTCMinutes(l.getUTCMinutes()+a)}return l.getTime()}return NaN})(i)),new Date(r)}},155:(n,e)=>
1{Object.defineProperty(e,"__esModule",{value:!0}),e.getTimeInMinutes=e.getTimeInMilliseconds=e.getTimeInSeconds=e.padDateTimeUnit=void 0,e.padDateTimeUnit=function(t){var i=Math.abs(Math.floor(typeof t=="string"?Number(t):t));return(i<10?"0":"")+i},e.getTimeInSeconds=function(t){var i=t.hours,r=i===void 0?0:i,o=t.minutes,l=o===void 0?0:o,u=t.seconds;return 60*r*60+60*l+(u===void 0?0:u)},e.getTimeInMilliseconds=function(t){var i=t.hours,r=i===void 0?0:i,o=t.minutes,l=o===void 0?0:o,u=t.seconds,a=u===void 0?0:u,d=t.milliseconds,f=d===void 0?0:d;return 1e3*(0,e.getTimeInSeconds)({hours:r,minutes:l,seconds:a})+f},e.getTimeInMinutes=function(t){var i=t.hours,r=i===void 0?0:i,o=t.minutes,l=o===void 0?0:o,u=t.seconds,a=u===void 0?0:u;return(0,e.getTimeInSeconds)({hours:r,minutes:l,seconds:a})/60}},620:(n,e,t)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.getTimezoneISOOffset=void 0;var i=t(155);e.getTimezoneISOOffset=function(r){r===void 0&&(r=new Date);var o=r.getTimezoneOffset();return"".concat(o>0?"-":"+").concat((0,i.padDateTimeUnit)(o/60),":").concat((0,i.padDateTimeUnit)(o%60))}},10:(n,e)=>{e.C=void 0,e.C=function(t){return Object.keys(t).filter(function(i){return t[i]!==null}).map(function(i){return[i,t[i]].map(encodeURIComponent).join("=")}).join("&")}},802:(n,e)=>{var t;Object.defineProperty(e,"__esModule",{value:!0}),e.LogLevels=void 0,(t=e.LogLevels||(e.LogLevels={})).ERROR="error",t.INFO="info",t.WARN="warn"},764:(n,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.EventTargetPolyfill=void 0;var t=(function(){function i(){this.listeners={}}return i.prototype.addEventListener=function(r,o){r in this.listeners||(this.listeners[r]=[]),this.listeners[r].push(o)},i.prototype.removeEventListener=function(r,o){if(r in this.listeners){for(var l=this.listeners[r],u=0,a=l.length;u<a;u++)if(l[u]===o)return void l.splice(u,1)}},i.prototype.dispatchEvent=function(r){if(!(r.type in this.listeners))return!0;for(var o=this.listeners[r.type].slice(),l=0,u=o.length;l<u;l++)o[l].call(this,r);return!r.defaultPrevented},i})();e.EventTargetPolyfill=t},172:(n,e,t)=>{e.nF=void 0,t(547),t(764),t(272);var i=t(402);Object.defineProperty(e,"nF",{enumerable:!0,get:function(){return i.WebSocketClientEvent}})},720:function(n,e,t){var i=this&&this.__assign||function(){return i=Object.assign||function(c){for(var h,m=1,T=arguments.length;m<T;m++)for(var C in h=arguments[m])Object.prototype.hasOwnProperty.call(h,C)&&(c[C]=h[C]);return c},i.apply(this,arguments)},r=this&&this.__rest||function(c,h){var m={};for(var T in c)Object.prototype.hasOwnProperty.call(c,T)&&h.indexOf(T)<0&&(m[T]=c[T]);if(c!=null&&typeof Object.getOwnPropertySymbols=="function"){var C=0;for(T=Object.getOwnPropertySymbols(c);C<T.length;C++)h.indexOf(T[C])<0&&Object.prototype.propertyIsEnumerable.call(c,T[C])&&(m[T[C]]=c[T[C]])}return m};Object.defineProperty(e,"__esModule",{value:!0}),e.getPushUpdateWebSocket=e.setupSocketConnection=void 0;var o=t(892),l=t(734),u=t(521),a=t(272),d=null,f={forceSecureProtocol:!1,heartbeatAfterAuthorize:!1,maxRetries:20,maxReconnectionDelay:1e3};e.setupSocketConnection=function(c,h){if(h===void 0&&(h={}),typeof h!="object")throw new TypeError("Options parameter must be an object not a ".concat(typeof h));var m=i(i({},f),h),T=m.forceSecureProtocol,C=m.heartbeatAfterAuthorize,_=m.tenantId,B=m.userId,_e=m.brandId,be=r(m,["forceSecureProtocol","heartbeatAfterAuthorize","tenantId","userId","brandId"]),ke=(function(Q,q,ce){ce===void 0&&(ce={});var we=(0,o.createQueryParametersAsString)((0,u.removeEmptyValuesFromObject)(ce)),Te=q||window.location.protocol==="https:"?"wss:":"ws:";return we.length===0?"".concat(Te,"//").concat(Q):new URL("".concat(Te,"//").concat(Q)).search.length>0?"".concat(Te,"//").concat(Q,"&").concat(we):"".concat(Te,"//").concat(Q,"?").concat(we)})(c,T,{tenantId:_,userId:B,brandId:_e});return d=new a.WebSocketClient(ke,void 0,be),(0,l.initializeHeartbeat)(C,d,h),d},e.getPushUpdateWebSocket=function(){return d}},547:(n,e)=>{var t;Object.defineProperty(e,"__esModule",{value:!0}),e.HeartBeatState=void 0,(t=e.HeartBeatState||(e.HeartBeatState={})).DIED="died",t.DYING="dying",t.LIVING="living"},906:function(n,e){var t=this&&this.__values||function(u){var a=typeof Symbol=="function"&&Symbol.iterator,d=a&&u[a],f=0;if(d)return d.call(u);if(u&&typeof u.length=="number")return{next:function(){return u&&f>=u.length&&(u=void 0),{value:u&&u[f++],done:!u}}};throw new TypeError(a?"Object is not iterable.":"Symbol.iterator is not defined.")},i=this&&this.__read||function(u,a){var d=typeof Symbol=="function"&&u[Symbol.iterator];if(!d)return u;var f,c,h=d.call(u),m=[];try{for(;(a===void 0||a-- >0)&&!(f=h.next()).done;)m.push(f.value)}catch(T){c={error:T}}finally{try{f&&!f.done&&(d=h.return)&&d.call(h)}finally{if(c)throw c.error}}return m},r=this&&this.__spreadArray||function(u,a,d){if(d||arguments.length===2)for(var f,c=0,h=a.length;c<h;c++)!f&&c in a||(f||(f=Array.prototype.slice.call(a,0,c)),f[c]=a[c]);return u.concat(f||Array.prototype.slice.call(a))};
1Object.defineProperty(e,"__esModule",{value:!0}),e.ReconnectingWebSocket=void 0;var o={maxReconnectionDelay:1e4,minReconnectionDelay:1e3+4e3*Math.random(),minUptime:5e3,reconnectionDelayGrowFactor:1.3,connectionTimeout:4e3,maxRetries:1/0,maxEnqueuedMessages:1/0,startClosed:!1,debug:!1},l=(function(){function u(a,d,f){f===void 0&&(f={});var c=this;this.onclose=null,this.onerror=null,this.onmessage=null,this.onopen=null,this._listeners={error:[],message:[],open:[],close:[]},this._shouldReconnect=!0,this._connectLock=!1,this._closeCalled=!1,this._messageQueue=[],this._retryCount=-1,this._binaryType="blob",this._handleOpen=function(h){c._debug("open event");var m=c._options.minUptime,T=m===void 0?o.minUptime:m;clearTimeout(c._connectTimeout),c._uptimeTimeout=window.setTimeout(function(){return c._acceptOpen()},T),c._ws.binaryType=c._binaryType,c._messageQueue.forEach(function(C){var _;return(_=c._ws)===null||_===void 0?void 0:_.send(C)}),c._messageQueue=[],c.onopen&&c.onopen(h),c._listeners.open.forEach(function(C){return c._callEventListener(h,C)})},this._handleMessage=function(h){c._debug("message event"),c.onmessage&&c.onmessage(h),c._listeners.message.forEach(function(m){return c._callEventListener(h,m)})},this._handleError=function(h){c._debug("error event",h),c._disconnect(),c.onerror&&c.onerror(h),c._debug("exec error listeners"),c._listeners.error.forEach(function(m){return c._callEventListener(h,m)}),c._connect()},this._handleClose=function(h){c._debug("close event"),c._clearTimeouts(),c._shouldReconnect&&c._connect(),c.onclose&&c.onclose(h),c._listeners.close.forEach(function(m){return c._callEventListener(h,m)})},this._url=a,this._protocols=d,this._options=f,this._maxRetries=typeof f.maxRetries=="number"?f.maxRetries:o.maxRetries,this._options.startClosed&&(this._shouldReconnect=!1),this._connect()}return Object.defineProperty(u.prototype,"retryCount",{get:function(){return Math.max(this._retryCount,0)},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"binaryType",{get:function(){return this._ws?this._ws.binaryType:this._binaryType},set:function(a){this._binaryType=a,this._ws&&(this._ws.binaryType=a)},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"bufferedAmount",{get:function(){return this._messageQueue.reduce(function(a,d){return typeof d=="string"?a+=d.length:d instanceof Blob?a+=d.size:a+=d.byteLength,a},0)+(this._ws?this._ws.bufferedAmount:0)},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"extensions",{get:function(){return this._ws?this._ws.extensions:""},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"protocol",{get:function(){return this._ws?this._ws.protocol:""},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"readyState",{get:function(){return this._ws?this._ws.readyState:this._options.startClosed?WebSocket.CLOSED:WebSocket.CONNECTING},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"url",{get:function(){return this._ws?this._ws.url:""},enumerable:!1,configurable:!0}),u.prototype.close=function(a,d){a===void 0&&(a=1e3),this._closeCalled=!0,this._shouldReconnect=!1,this._clearTimeouts(),this._ws?this._ws.readyState!==WebSocket.CLOSED?this._ws.close(a,d):this._debug("close: already closed"):this._debug("close enqueued: no ws instance")},u.prototype.reconnect=function(a,d){this._shouldReconnect=!0,this._closeCalled=!1,this._retryCount=-1,this._ws&&this._ws.readyState!==WebSocket.CLOSED?(this._disconnect(a,d),this._connect()):this._connect()},u.prototype.send=function(a){if(this._ws&&this._ws.readyState===WebSocket.OPEN)this._debug("send",a),this._ws.send(a);else{var d=this._options.maxEnqueuedMessages,f=d===void 0?o.maxEnqueuedMessages:d;this._messageQueue.length<f&&(this._debug("enqueue",a),this._messageQueue.push(a))}},u.prototype.addEventListener=function(a,d){this._listeners[a]&&this._listeners[a].push(d)},u.prototype.dispatchEvent=function(a){var d,f,c=this._listeners[a.type];if(c)try{for(var h=t(c),m=h.next();!m.done;m=h.next()){var T=m.value;this._callEventListener(a,T)}}catch(C){d={error:C}}finally{try{m&&!m.done&&(f=h.return)&&f.call(h)}finally{if(d)throw d.error}}return!0},u.prototype.removeEventListener=function(a,d){this._listeners[a]&&(this._listeners[a]=this._listeners[a].filter(function(f){return f!==d}))},u.prototype.setMaxRetires=function(a){this._maxRetries=a},u.prototype._debug=function(){for(var a=[],d=0;d<arguments.length;d++)a[d]=arguments[d];this._options.debug&&console.log.apply(console,r(["RWS>"],i(a),!1))},u.prototype._getNextDelay=function(){var a=this._options,d=a.reconnectionDelayGrowFactor,f=d===void 0?o.reconnectionDelayGrowFactor:d,c=a.minReconnectionDelay,h=c===void 0?o.minReconnectionDelay:c,m=a.maxReconnectionDelay,T=m===void 0?o.maxReconnectionDelay:m,C=0;return this._retryCount>0&&(C=h*Math.pow(f,this._retryCount-1))>T&&(C=T),this._debug("next delay",C),C},u.prototype._wait=function(){var a=this;return new Promise(function(d){setTimeout(d,a._getNextDelay())})}
1,u.prototype._getNextUrl=function(a){if(typeof a=="string")return Promise.resolve(a);if(typeof a=="function"){var d=a();if(typeof d=="string")return Promise.resolve(d);if(d.then!==void 0)return d}throw Error("Invalid URL")},u.prototype._connect=function(){var a=this;if(!this._connectLock&&this._shouldReconnect){this._connectLock=!0;var d=this._options.connectionTimeout,f=d===void 0?o.connectionTimeout:d;this._retryCount>=this._maxRetries?this._debug("max retries reached",this._retryCount,">=",this._maxRetries):(this._retryCount++,this._debug("connect",this._retryCount),this._removeListeners(),this._wait().then(function(){return a._getNextUrl(a._url)}).then(function(c){a._closeCalled?a._connectLock=!1:(a._debug("connect",{url:c,protocols:a._protocols}),a._ws=a._protocols?new WebSocket(c,a._protocols):new WebSocket(c),a._ws.binaryType=a._binaryType,a._connectLock=!1,a._addListeners(),a._connectTimeout=window.setTimeout(function(){return a._handleTimeout()},f))}).catch(function(c){a._connectLock=!1,a._handleError(new ErrorEvent(c.message))}))}},u.prototype._handleTimeout=function(){this._debug("timeout event"),this._handleError(new ErrorEvent("TIMEOUT"))},u.prototype._disconnect=function(a,d){if(a===void 0&&(a=1e3),this._clearTimeouts(),this._ws){this._removeListeners();try{this._ws.close(a,d),this._handleClose(new CloseEvent("CLOSE",{code:a,reason:d}))}catch{}}},u.prototype._acceptOpen=function(){this._debug("accept open"),this._retryCount=0},u.prototype._callEventListener=function(a,d){"handleEvent"in d?d.handleEvent(a):d(a)},u.prototype._removeListeners=function(){this._ws&&(this._debug("removeListeners"),this._ws.removeEventListener("open",this._handleOpen),this._ws.removeEventListener("close",this._handleClose),this._ws.removeEventListener("message",this._handleMessage),this._ws.removeEventListener("error",this._handleError))},u.prototype._addListeners=function(){this._ws&&(this._debug("addListeners"),this._ws.addEventListener("open",this._handleOpen),this._ws.addEventListener("close",this._handleClose),this._ws.addEventListener("message",this._handleMessage),this._ws.addEventListener("error",this._handleError))},u.prototype._clearTimeouts=function(){clearTimeout(this._connectTimeout),clearTimeout(this._uptimeTimeout)},u})();e.ReconnectingWebSocket=l},272:function(n,e,t){var i,r=this&&this.__extends||(i=function(c,h){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(m,T){m.__proto__=T}||function(m,T){for(var C in T)Object.prototype.hasOwnProperty.call(T,C)&&(m[C]=T[C])},i(c,h)},function(c,h){if(typeof h!="function"&&h!==null)throw new TypeError("Class extends value "+String(h)+" is not a constructor or null");function m(){this.constructor=c}i(c,h),c.prototype=h===null?Object.create(h):(m.prototype=h.prototype,new m)});Object.defineProperty(e,"__esModule",{value:!0}),e.WebSocketClient=e.HEART_BEAT_CHECK_TIMEOUT=e.HEART_BEAT_INTERVAL=void 0;var o=t(802),l=t(906),u=t(764),a=t(547),d=t(402);e.HEART_BEAT_INTERVAL=15e3,e.HEART_BEAT_CHECK_TIMEOUT=3*e.HEART_BEAT_INTERVAL;var f=(function(c){function h(m,T,C){var _=c.call(this)||this;return _.heartBeatTimeout=null,_.heartBeatCheckTimeout=null,_.enableDebugMode=function(){_.debugMode||_.log(o.LogLevels.INFO,"websocket-push-updates--loggerEnabled"),_.debugMode=!0},_.disableDebugMode=function(){_.debugMode=!1},_.log=function(B,_e,be){_.debugMode&&_.logger&&_.logger[B](_e,be)},_.sendHeartBeat=function(){_.log(o.LogLevels.INFO,"websocket-push-updates--sendHeartBeat"),_.send(JSON.stringify({action:"heartbeat"}))},_.handleHeartBeatResponse=function(){_.heartBeatState===a.HeartBeatState.DYING&&(_.heartBeatState=a.HeartBeatState.LIVING,_.dispatchHeartBeatState()),_.setHeartBeatCheckTimeout()},_.setHeartBeatCheckTimeout=function(){_.heartBeatCheckTimeout!==null&&clearTimeout(_.heartBeatCheckTimeout),_.heartBeatCheckTimeout=setTimeout(function(){_.heartBeatState=a.HeartBeatState.DYING,_.dispatchHeartBeatState()},e.HEART_BEAT_CHECK_TIMEOUT)},_.dispatchHeartBeatState=function(){_.log(o.LogLevels.INFO,"websocket-push-updates--dispatchHeartBeatState",[{heartbeatState:_.heartBeatState}]),_.heartBeatState!==null&&_.dispatchEvent(new CustomEvent(_.heartBeatState))},_.isHeartBeatActive=function(){return _.heartBeatState!==null},_.heartBeatState=null,_.debugMode=!1,_.socket=new l.ReconnectingWebSocket(m,T,C),_.socket.onopen=function(){_.dispatchEvent(new CustomEvent(d.WebSocketClientEvent.OPEN))},C?.logger&&(_.logger=C.logger),_.socket.onclose=function(B){_.socket.retryCount===C?.maxRetries?_.heartBeatState=a.HeartBeatState.DIED:_.heartBeatState=a.HeartBeatState.DYING,_.dispatchHeartBeatState(),_.dispatchEvent(new CustomEvent(d.WebSocketClientEvent.CLOSE,{detail:B}))},_.socket.onmessage=function(B){_.handleHeartBeatResponse(),JSON.parse(B.data)!=="pong"&&(_.log(o.LogLevels.INFO,"websocket-push-updates--onmessage",[B]),_.dispatchEvent(new CustomEvent(d.WebSocketClientEvent.MESSAGE,{detail:B})))},_.socket.onerror=function(B){_.log(o.LogLevels.ERROR,"websocket-push-updates--onError",[B]),_.dispatchEvent(new CustomEvent(d.WebSocketClientEvent.ERROR,{detail:B}))},_}return r(h,c),h.prototype.send=function(m){this.socket.send(m)},h.prototype.startHeartBeat=function(){var m=this;this.log(o.LogLevels.INFO,"websocket-push-updates--startHeartBeat",[{interval:e.HEART_BEAT_INTERVAL}]);var T=function(){m.log(o.LogLevels.INFO,"websocket-push-updates--heartBeatCallback"),m.sendHeartBeat(),m.heartBeatTimeout=setTimeout(T,e.HEART_BEAT_INTERVAL)};this.setHeartBeatCheckTimeout(),T(),this.heartBeatState=a.HeartBeatState.LIVING},h.prototype.stopHeartBeat=function(){this.log(o.LogLevels.INFO,"websocket-push-updates--stopHeartBeat"),this.heartBeatTimeout!==null&&clearTimeout(this.heartBeatTimeout),this.heartBeatCheckTimeout!==null&&clearTimeout(this.heartBeatCheckTimeout),this.heartBeatState=null},h})(u.EventTargetPolyfill);e.WebSocketClient=f},402:(n,e)=>{var t;
1Object.defineProperty(e,"__esModule",{value:!0}),e.WebSocketClientEvent=void 0,(t=e.WebSocketClientEvent||(e.WebSocketClientEvent={})).CLOSE="close",t.ERROR="error",t.MESSAGE="message",t.OPEN="open"},734:(n,e,t)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.initializeHeartbeat=void 0;var i=t(402);e.initializeHeartbeat=function(r,o,l){if(r){var u=function(a){var d;try{var f=JSON.parse(a.detail.data);f?.authorizationStatus==="authorized"&&(o.startHeartBeat(),o.removeEventListener(i.WebSocketClientEvent.MESSAGE,u))}catch{(d=l?.logger)===null||d===void 0||d.warn("JSON cannot be parsed during the heartbeat initialization process.")}};o.addEventListener(i.WebSocketClientEvent.MESSAGE,u)}else o.startHeartBeat()}},521:(n,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.removeEmptyValuesFromObject=void 0,e.removeEmptyValuesFromObject=function(t){return Object.entries(t).filter(function(i){return i[0],i[1]!=null}).reduce(function(i,r){var o=r[0],l=r[1];return i[o]=l,i},{})}},892:(n,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.createQueryParametersAsString=void 0,e.createQueryParametersAsString=function(t){return Object.keys(t).filter(function(i){return t[i]!==null}).map(function(i){return[i,t[i]].map(encodeURIComponent).join("=")}).join("&")}},668:(n,e)=>{var t;(t=e.V||(e.V={})).CHAT_WINDOW_EVENT="chatWindowEvent",t.REGISTER="register"},482:(n,e)=>{var t,i;(i=e.ow||(e.ow={})).SENDER_TYPING_STARTED="SenderTypingStarted",i.SENDER_TYPING_ENDED="SenderTypingEnded",i.LOAD_MORE_MESSAGES="LoadMoreMessages",i.RECOVER_LIVECHAT="RecoverLivechat",i.RECOVER_THREAD="RecoverThread",i.SEND_MESSAGE="SendMessage",i.SEND_OUTBOUND="SendOutbound",i.SEND_OFFLINE_MESSAGE="SendOfflineMessage",i.SEND_PAGE_VIEWS="SendPageViews",i.SEND_CONSUMER_CUSTOM_FIELDS="SetConsumerCustomFields",i.SET_CONSUMER_CONTACT_CUSTOM_FIELD="SetConsumerContactCustomFields",i.MESSAGE_SEEN="MessageSeenByConsumer",i.SEND_TRANSCRIPT="SendTranscript",i.FETCH_THREAD_LIST="FetchThreadList",i.END_CONTACT="EndContact",i.EXECUTE_TRIGGER="ExecuteTrigger",i.AUTHORIZE_CONSUMER="AuthorizeConsumer",i.AUTHORIZE_CUSTOMER="AuthorizeCustomer",i.RECONNECT_CONSUMER="ReconnectConsumer",i.UPDATE_THREAD="UpdateThread",i.ARCHIVE_THREAD="ArchiveThread",i.LOAD_THREAD_METADATA="LoadThreadMetadata",i.REFRESH_TOKEN="RefreshToken",i.STORE_VISITOR="StoreVisitor",i.STORE_VISITOR_EVENTS="StoreVisitorEvents",i.CREATE_GROUP_CHAT_INVITE="CreateInvitationToGroupChat",i.SEND_EMAIL_INVITE_TO_GROUP_CHAT="SendEmailInvitationToGroupChat",i.JOIN_GROUP_CHAT="JoinGroupChat",i.LEAVE_GROUP_CHAT="LeaveGroupChat",i.GENERATE_AUTHORIZATION_TOKEN="GenerateAuthorizationToken",i.ADD_VISITOR_TAGS="AddVisitorTags",i.REMOVE_VISITOR_TAGS="RemoveVisitorTags",i.SEND_MESSAGE_PREVIEW="SendMessagePreview",(t=e.vc||(e.vc={})).LIVECHAT_RECOVERED="LivechatRecovered",t.MORE_MESSAGES_LOADED="MoreMessagesLoaded",t.OFFLINE_MESSAGE_SENT="OfflineMessageSent",t.THREAD_LIST_FETCHED="ThreadListFetched",t.THREAD_RECOVERED="ThreadRecovered",t.TRANSCRIPT_SENT="TranscriptSent",t.CONSUMER_AUTHORIZED="ConsumerAuthorized",t.THREAD_METADATA_LOADED="ThreadMetadataLoaded",t.SET_POSITION_IN_QUEUE="SetPositionInQueue",t.GROUP_CHAT_INVITE_CREATED="InvitationToGroupChatCreated",t.GROUP_CHAT_INVITE_SENT="EmailInvitationToGroupChatSent",t.GROUP_CHAT_JOINED="GroupChatJoined",t.TOKEN_REFRESHED="TokenRefreshed",t.AUTHORIZATION_TOKEN_GENERATED="AuthorizationTokenGenerated",t.THREAD_ARCHIVED="ThreadArchived"},369:(n,e)=>{var t;(t=e.F||(e.F={})).ONLINE="online",t.OFFLINE="offline"},442:(n,e)=>{var t;(t=e.bq||(e.bq={})).DESKTOP="desktop",t.MOBILE="mobile",t.OTHER="other",t.TABLET="tablet",(e.Xr||(e.Xr={})).BROWSER="browser"},168:(n,e,t)=>{var i=t(275);e.P=i.CaseStatus},796:(n,e)=>{e.Um="X-Caller-Service-ID"},953:(n,e)=>{(function(t){t.INBOUND="inbound",t.OUTBOUND="outbound"})(e.T||(e.T={}))},434:(n,e)=>{(function(t){t.TEXT="TEXT",t.FILE="FILE",t.FORM="FORM",t.PLUGIN="PLUGIN",t.POSTBACK="POSTBACK",t.QUICK_REPLIES="QUICK_REPL
1IES",t.RICH_LINK="RICH_LINK",t.LIST_PICKER="LIST_PICKER",t.ADAPTIVE_CARD="ADAPTIVE_CARD",t.TIME_PICKER="TIME_PICKER"})(e.G||(e.G={}))},275:(n,e)=>{var t;Object.defineProperty(e,"__esModule",{value:!0}),(t=e.CaseStatus||(e.CaseStatus={})).NEW="new",t.OPEN="open",t.PENDING="pending",t.ESCALATED="escalated",t.RESOLVED="resolved",t.CLOSED="closed",t.TRASHED="trashed"},0:(n,e)=>{(function(t){t.AUTHORIZE_CONSUMER="AuthorizeConsumer",t.CASE_CREATED="CaseCreated",t.CASE_INBOX_ASSIGNEE_CHANGED="CaseInboxAssigneeChanged",t.CASE_STATUS_CHANGED="CaseStatusChanged",t.CASE_TO_ROUTING_QUEUE_ASSIGNMENT_CHANGED="CaseToRoutingQueueAssignmentChanged",t.CONTACT_CREATED="CaseCreated",t.ASSIGNED_AGENT_CHANGED="CaseInboxAssigneeChanged",t.CONTACT_STATUS_CHANGED="CaseStatusChanged",t.CONTACT_TO_ROUTING_QUEUE_ASSIGNMENT_CHANGED="CaseToRoutingQueueAssignmentChanged",t.CONTACT_PREFERRED_USER_CHANGED="ContactPreferredUserChanged",t.CONTACT_PROFICIENCY_CHANGED="ContactProficiencyChanged",t.CONTACT_PRIORITY_CHANGED="ContactPriorityChanged",t.CONTACT_SYNC="ContactSync",t.CHANNEL_CREATED="ChannelCreated",t.CHANNEL_DELETED="ChannelDeleted",t.CHANNEL_UPDATED="ChannelUpdated",t.MESSAGE_ADDED_INTO_CASE="MessageAddedIntoCase",t.MESSAGE_CREATED="MessageCreated",t.MESSAGE_DELIVERED_TO_END_USER="MessageDeliveredToEndUser",t.MESSAGE_DELIVERED_TO_USER="MessageDeliveredToUser",t.MESSAGE_DELIVERY_STATUS_CHANGED="MessageDeliveryStatusChanged",t.MESSAGE_NOTE_CREATED="MessageNoteCreated",t.MESSAGE_NOTE_UPDATED="MessageNoteUpdated",t.MESSAGE_NOTE_DELETED="MessageNoteDeleted",t.MESSAGE_READ_CHANGED="MessageReadChanged",t.MESSAGE_SEEN_BY_END_USER="MessageSeenByEndUser",t.MESSAGE_SEEN_BY_USER="MessageSeenByUser",t.MESSAGE_SEEN_CHANGED="MessageSeenChanged",t.MESSAGE_SENT="MessageSent",t.MESSAGE_UPDATED="MessageUpdated",t.PAGE_VIEW_CREATED="PageViewCreated",t.ROUTING_QUEUE_CREATED="RoutingQueueCreated",t.ROUTING_QUEUE_DELETED="RoutingQueueDeleted",t.ROUTING_QUEUE_UPDATED="RoutingQueueUpdated",t.SUBQUEUE_ASSIGNED_TO_ROUTING_QUEUE="SubqueueAssignedToRoutingQueue",t.SUBQUEUE_UNASSIGNED_TO_ROUTING_QUEUE="SubqueueUnassignedFromRoutingQueue",t.USER_ASSIGNED_TO_ROUTING_QUEUE="UserAssignedToRoutingQueue",t.USER_STATUS_CHANGED="UserStatusChanged",t.USER_UNASSIGNED_FROM_ROUTING_QUEUE="UserUnassignedFromRoutingQueue",t.AGENT_CONTACT_STARTED="AgentContactStarted",t.AGENT_CONTACT_ENDED="AgentContactEnded",t.SENDER_TYPING_STARTED="SenderTypingStarted",t.SENDER_TYPING_ENDED="SenderTypingEnded",t.FIRE_PROACTIVE="FireProactiveAction",t.CONTACT_INBOX_PRE_ASSIGNEE_CHANGED="ConsumerContactInboxPreAssigneeChanged",t.CONTACT_RECIPIENTS_CHANGED="ContactRecipientsChanged",t.MESSAGE_PREVIEW_CREATED="MessagePreviewCreated",t.EVENT_IN_S3="EventInS3"})(e.m||(e.m={}))},198:n=>{n.exports=K}},ge={};function R(n){var e=ge[n];if(e!==void 0)return e.exports;var t=ge[n]={exports:{}};return U[n].call(t.exports,t,t.exports,R),t.exports}R.n=n=>{var e=n&&n.__esModule?()=>n.default:()=>n;return R.d(e,{a:e}),e},R.d=(n,e)=>{for(var t in e)R.o(e,t)&&!R.o(n,t)&&Object.defineProperty(n,t,{enumerable:!0,get:e[t]})},R.o=(n,e)=>Object.prototype.hasOwnProperty.call(n,e),R.r=n=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(n,"__esModule",{value:!0})};var Pe={};R.r(Pe),R.d(Pe,{AbortError:()=>gn,AbortablePromise:()=>ot,AuthorizationError:()=>E,CHAT_SDK_VERSION:()=>b,CacheStorage:()=>Ri,CacheStorageError:()=>Pn,ChannelAvailability:()=>Di.F,ChatEvent:()=>P,ChatSdk:()=>kn,ContactStatus:()=>pn.P,Customer:()=>V,EnvironmentName:()=>Fe,LivechatThread:()=>Ct,MessageType:()=>Re.G,SdkVersionNotSupported:()=>tt,SendMessageFailedError:()=>nt,Thread:()=>Ft,ThreadRecoverFailedError:()=>Ht,UploadAttachmentError:()=>Lt,WebSocketClientError:()=>wt,WebSocketClientEvent:()=>J.nF,createCreateInvitationToGroupChatPayloadData:()=>wi,createJoinGroupChatPayloadData:()=>Ci,createLeaveGroupChatPayloadData:()=>Si,createReconnectPayloadData:()=>rn,createSendEmailInvitationToGroupChatPayloadData:()=>Ii,default:()=>Pi,generateId:()=>j,getAuthor:()=>ri,getBrowserFingerprint:()=>et,getBrowserLanguage:()=>ft,getBrowserLocation:()=>cn,getDeviceType:()=>ln,isAgentTypingEndedEvent:()=>pi,isAgentTypingStartedEvent:()=>mi,isAssignedAgentChangedEvent:()=>fi,isAuthSuccessEvent:()=>an,isContactCreatedEvent:()=>bn,isContactRecipientsChangedEvent:()=>ni,isContactStatusChangedEvent:()=>_n,isContactToRoutingQueueAssignmentChangedEvent:()=>ti,isCustomerReconnectSuccessPayloadData:()=>ki,isLoadMetadataSuccessPayload:()=>Cn,isMessage:()=>ai,isMessageCreatedEvent:()=>si,isMessageReadChangedEvent:()=>li,isMessageSentEvent:()=>ci,isMoreMessagesLoadedEvent:()=>gt,isRecoverSuccessEvent:()=>pe,isSetPositionInQueueEvent:()=>_i,isThreadArchivedSuccessPayload:()=>yn,isThreadListFetchedPostbackData:()=>In,isTokenRefreshedSuccessResponse:()=>sn,sendChatEvent:()=>M,sendCreateInvitationToGroupChatEvent:()=>Ti,sendEmailInvitationToGroupChatEvent:()=>Ni,sendJoinGroupChatEvent:()=>yi,sendLeaveGroupChatEvent:()=>Ai,splitName:()=>Zt});var J=R(172),oe=R(668),A=R(482);let Z=function(n){return n===null},w={};function v(n){w.ACCESS_TOKEN=n.token,w.ACCESS_TOKEN_EXPIRES_IN=n.expiresIn}function p(){var n,e;let t=(n=w.ACCESS_TOKEN)!==null&&n!==void 0?n:null,i=(e=w.ACCESS_TOKEN_EXPIRES_IN)!==null&&e!==void 0?e:null;
1return Z(t)||Z(i)?null:{token:t,expiresIn:Number(i)}}class s extends Error{constructor(e,t){if(super(),this.name="ChatSDKError",this.data=t,e instanceof s)return this.message=e.message,this.stack=e.stack,void(this.cause=e.cause);this.message=`[ChatSDKError]: ${this._getErrorMessage(e)}`,e instanceof Error&&(this.stack=e.stack)}_getErrorMessage(e){return e instanceof Error?e.message:typeof e=="string"?e:JSON.stringify(e)}}class E extends s{constructor(e,t){super(e,t),t!==void 0&&(this.message=`${e} because of (${t.errorMessage})`)}}let b="1.20.0";function j(){return crypto.randomUUID?crypto.randomUUID():(function(){let n=new Uint8Array(16);return crypto.getRandomValues(n).reduce((e,t,i)=>([4,6,8,10].includes(i)&&(e+="-"),e+(i===6?15&t|64:i===8?63&t|128:t).toString(16).padStart(2,"0")),"")})()}function ve(n){return{visitor:{id:n}}}var I=Object.prototype;let O=function(n){var e=n&&n.constructor;return n===(typeof e=="function"&&e.prototype||I)},$=(le=Object.keys,Me=Object,function(n){return le(Me(n))});var le,Me,ze=Object.prototype.hasOwnProperty;let Ce=typeof global=="object"&&global&&global.Object===Object&&global;var ye=typeof self=="object"&&self&&self.Object===Object&&self;let ee=Ce||ye||Function("return this")(),Se=ee.Symbol;var re=Object.prototype,xe=re.hasOwnProperty,Ot=re.toString,ae=Se?Se.toStringTag:void 0,Ue=Object.prototype.toString,We=Se?Se.toStringTag:void 0;let ue=function(n){return n==null?n===void 0?"[object Undefined]":"[object Null]":We&&We in Object(n)?(function(e){var t=xe.call(e,ae),i=e[ae];try{e[ae]=void 0;var r=!0}catch{}var o=Ot.call(e);return r&&(t?e[ae]=i:delete e[ae]),o})(n):(function(e){return Ue.call(e)})(n)},Ge=function(n){var e=typeof n;return n!=null&&(e=="object"||e=="function")},$e=function(n){if(!Ge(n))return!1;var e=ue(n);return e=="[object Function]"||e=="[object GeneratorFunction]"||e=="[object AsyncFunction]"||e=="[object Proxy]"},fe=ee["__core-js_shared__"];var Ae,Qe=(Ae=/[^.]+$/.exec(fe&&fe.keys&&fe.keys.IE_PROTO||""))?"Symbol(src)_1."+Ae:"",je=Function.prototype.toString;let te=function(n){if(n!=null){try{return je.call(n)}catch{}try{return n+""}catch{}}return""};var qe=/^\[object .+?Constructor\]$/,at=Function.prototype,st=Object.prototype,ct=at.toString,It=st.hasOwnProperty,Le=RegExp("^"+ct.call(It).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");let lt=function(n){return!(!Ge(n)||(function(e){return!!Qe&&Qe in e})(n))&&($e(n)?Le:qe).test(te(n))},ne=function(n,e){var t=(function(i,r){return i?.[r]})(n,e);return lt(t)?t:void 0},Ke=ne(ee,"DataView"),Oe=ne(ee,"Map"),de=ne(ee,"Promise"),Ie=ne(ee,"Set"),Ye=ne(ee,"WeakMap");var Xe="[object Map]",Je="[object Promise]",z="[object Set]",he="[object WeakMap]",Ne="[object DataView]",N=te(Ke),k=te(Oe),S=te(de),x=te(Ie),se=te(Ye),H=ue;(Ke&&H(new Ke(new ArrayBuffer(1)))!=Ne||Oe&&H(new Oe)!=Xe||de&&H(de.resolve())!=Je||Ie&&H(new Ie)!=z||Ye&&H(new Ye)!=he)&&(H=function(n){var e=ue(n),t=e=="[object Object]"?n.constructor:void 0,i=t?te(t):"";if(i)switch(i){case N:return Ne;case k:return Xe;case S:return Je;case x:return z;case se:return he}return e});let D=H,y=function(n){return n!=null&&typeof n=="object"},Y=function(n){return y(n)&&ue(n)=="[object Arguments]"};var He=Object.prototype,ut=He.hasOwnProperty,Gn=He.propertyIsEnumerable;let jn=Y((function(){return arguments})())?Y:function(n){return y(n)&&ut.call(n,"callee")&&!Gn.call(n,"callee")},Ln=Array.isArray,Wt=function(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=9007199254740991};var $t=typeof W=="object"&&W&&!W.nodeType&&W,Qt=$t&&typeof ie=="object"&&ie&&!ie.nodeType&&ie,qt=Qt&&Qt.exports===$t?ee.Buffer:void 0;let Hn=(qt?qt.isBuffer:void 0)||function(){return!1};var G={};G["[object Float32Array]"]=G["[object Float64Array]"]=G["[object Int8Array]"]=G["[object Int16Array]"]=G["[object Int32Array]"]=G["[object Uint8Array]"]=G["[object Uint8ClampedArray]"]=G["[object Uint16Array]"]=G["[object Uint32Array]"]=!0,G["[object Arguments]"]=G["[object Array]"]=G["[object ArrayBuffer]"]=G["[object Boolean]"]=G["[object DataView]"]=G["[object Date]"]=G["[object Error]"]=G["[object Function]"]=G["[object Map]"]=G["[object Number]"]=G["[object Object]"]=G["[object RegExp]"]=G["[object Set]"]=G["[object String]"]=G["[object WeakMap]"]=!1;var Kt=typeof W=="object"&&W&&!W.nodeType&&W,Ze=Kt&&typeof ie=="object"&&ie&&!ie.nodeType&&ie,Nt=Ze&&Ze.exports===Kt&&Ce.process,Yt=(function(){try{return Ze&&Ze.require&&Ze.require("util").t
1ypes||Nt&&Nt.binding&&Nt.binding("util")}catch{}})(),Xt=Yt&&Yt.isTypedArray;let Fn=Xt?(function(n){return function(e){return n(e)}})(Xt):function(n){return y(n)&&Wt(n.length)&&!!G[ue(n)]};var Bn=Object.prototype.hasOwnProperty;let me=function(n){if(n==null)return!0;if((function(i){return i!=null&&Wt(i.length)&&!$e(i)})(n)&&(Ln(n)||typeof n=="string"||typeof n.splice=="function"||Hn(n)||Fn(n)||jn(n)))return!n.length;var e=D(n);if(e=="[object Map]"||e=="[object Set]")return!n.size;if(O(n))return!(function(i){if(!O(i))return $(i);var r=[];for(var o in Object(i))ze.call(i,o)&&o!="constructor"&&r.push(o);return r})(n).length;for(var t in n)if(Bn.call(n,t))return!1;return!0},dt=new Map,Jt=(n,e)=>g(null,null,function*(){if(Z(e))throw new s("WebSocketClient is not initialized");return me(n.eventId)&&(n.eventId=j()),new Promise(t=>{dt.set(n.eventId,t),e?.send(n)})});function Zt(n){let[e,...t]=n.split(" ");return[e,t.join(" ")]}function Rt(n,e={}){for(let t of Object.keys(e))n.set(t,e[t])}function Dt(n,e=[]){for(let{ident:t,value:i}of e)n.set(t,i)}function en(n){return Object.fromEntries(n)}function ht(n){return Array.from(n).map(([e,t])=>({ident:e,value:t}))}class V{constructor(e,t,i,r){this._customFields=new Map,this._exists=!1,this._websocketClient=r,V.setId(e),V.setName(t),V.setImage(i)}static setId(e){w.CUSTOMER_ID=e}static getId(){var e;return(e=w.CUSTOMER_ID)!==null&&e!==void 0?e:null}static getName(){return w.CUSTOMER_NAME}static setName(e){w.CUSTOMER_NAME=e}static getIdOrCreateNewOne(){let e=this.getId();return e||(e=j(),this.setId(e)),e}static getImage(){return w.CUSTOMER_IMAGE}static setImage(e){w.CUSTOMER_IMAGE=e}getId(){return V.getIdOrCreateNewOne()}getName(){return V.getName()}setName(e){V.setName(e)}setImage(e){V.setImage(e)}setExists(e){this._exists=e}setCustomField(e,t){return this.setCustomFields({[e]:t})}setCustomFields(e){if(Rt(this._customFields,e),this._exists)return this.sendCustomFields()}getCustomFields(){return en(this._customFields)}setCustomFieldsFromArray(e){Dt(this._customFields,e)}getCustomFieldsArray(){return ht(this._customFields)}sendCustomFields(){return g(this,null,function*(){var e;return M((e=ht(this._customFields),{eventType:A.ow.SEND_CONSUMER_CUSTOM_FIELDS,data:{customFields:e}}),this._websocketClient)})}destroy(){w.CUSTOMER_ID=void 0,w.CUSTOMER_NAME=void 0,w.CUSTOMER_IMAGE=void 0}}function tn(n,e){let t=n??V.getName(),i=e??V.getImage(),r={};if(typeof t=="string"&&t.length>0){let[o,l]=Zt(t);r={firstName:o,lastName:l}}return i&&(r.image=i),Object.assign({idOnExternalPlatform:V.getIdOrCreateNewOne()},r)}let Ee=function(n){return n==null};function Et(){let n=w.BRAND_ID,e=w.CHANNEL_ID;if(Ee(n)||isNaN(n)||Ee(e))throw new s(`Cannot get BrandId and ChannelId from SDKVariableStorage
2      brandId (${n}) |
3      channelId (${e})`);return{brandId:n,channelId:e}}let L=function(n){return n===void 0};function nn(n){let e=w.DESTINATION,t=w.VISIT_ID,i=w.VISITOR_ID,{eventType:r,data:o,consumerIdentity:l=tn(),destination:u=e?{id:e}:{},visitor:a=i?{id:i}:{},visit:d=t?{id:t}:{}}=n,{brandId:f,channelId:c}=Et();if(L(r))throw new s(`Cannot create an event payload because of missing eventType (${r})`);return{eventType:r,brand:{id:Number(f)},channel:{id:c},consumerIdentity:l,data:o,destination:u,visitor:a,visit:d}}function on(n,e=j(),t=oe.V.CHAT_WINDOW_EVENT){return{action:t,eventId:e,payload:n}}function M(n,e){return g(this,null,function*(){let t=on(nn(n));return Jt(t,e)})}function rn(n,e){return Object.assign(Object.assign(Object.assign({},ve(e)),tn()),{eventType:A.ow.RECONNECT_CONSUMER,data:{accessToken:{token:n.token}}})}let kt=null;function Pt(n,e){kt!==null&&clearTimeout(kt),kt=setTimeout(e,1e3*(function(t){let i=Math.round(.9*t);return i<20?20:i})(n.expiresIn))}let an=n=>{var e;let t=(e=n?.data)===null||e===void 0?void 0:e.status;return n?.type===A.vc.CONSUMER_AUTHORIZED&&t==="success"};function sn(n){var e,t;return n?.type===A.vc.TOKEN_REFRESHED&&((t=(e=n.data)===null||e===void 0?void 0:e.accessToken)===null||t===void 0?void 0:t.token)!==void 0}var Vn=R(198),zn=R.n(Vn),vt=R(442);let ft=()=>navigator.language,cn=()=>Intl.DateTimeFormat().resolvedOptions().timeZone;function ln(n){switch(n){case"mobile":return vt.bq.MOBILE;case"tablet":return vt.bq.TABLET;default:return vt.bq.DESKTOP}}let et=(n={})=>{var e,t,i,r;let o=new(zn())(navigator.userAgent),{country:l="",location:u=cn(),language:a=ft(),ip:d=null}=n;return{browser:(e=o.getBrowser().name)!==null&&e!==void 0?e:null,browserVersion:(t=o.getBrowser().version)!==null&&t!==void 0?t:null,country:l,ip:d,language:a,location:u,os:(i=o.getOS().name)!==null&&i!==void 0?i:null,osVersion:(r=o.getOS().version)!==null&&r!==void 0?r:null,deviceType:ln(o.getDevice().type),applicationType:vt.Xr.BROWSER}};var mt=R(796);let un="SdkVersionNotSupported";
3class tt extends Error{constructor(){super(...arguments),this.name=un,this.message="Please update to the latest ChatSDK version"}}function pt(n){var e;return((e=n?.error)===null||e===void 0?void 0:e.errorCode)===un}function Wn(n){if(pt(n))throw new tt;return n}function Mt(n){return g(this,null,function*(){let e;try{e=yield n.json()}catch{e=n.statusText}return e})}function dn(i,r){return g(this,arguments,function*(n,e,t=ft()){var o;let l=`${t}`.split("-").join("_"),u=w.ENDPOINT_CHAT,a=yield fetch(`${u}/chat/1.0/brand/${n}/channel/${e}?locale=${l}`,{method:"GET",headers:{Accept:"application/json","Content-Type":"application/json",[mt.Um]:(o=w.APP_NAME)!==null&&o!==void 0?o:"","x-sdk-platform":"web","x-sdk-version":b}});if(!a.ok)throw pt(yield Mt(a))?new tt:new s(`Failed to fetch channel info. Status (${a.status})`,{response:a});return a.json()})}var Fe;(function(n){n.AU1="AU1",n.CA1="CA1",n.EU1="EU1",n.JP1="JP1",n.NA1="NA1",n.UK1="UK1",n.custom="custom"})(Fe||(Fe={}));let hn=n=>{w.ENDPOINT_GATEWAY=n.gateway,w.ENDPOINT_CHAT=n.chat,w.ENDPOINT_AUTHORIZE=n.authorize};var Be=R(0);let P=Object.assign(Object.assign(Object.assign({},Be.m),A.vc),{AGENT_TYPING_STARTED:"AgentTypingStarted",AGENT_TYPING_ENDED:"AgentTypingEnded",ASSIGNED_AGENT_CHANGED:"AssignedAgentChanged",CONTACT_CREATED:"ContactCreated",CONTACT_STATUS_CHANGED:"ContactStatusChanged",CONTACT_TO_ROUTING_QUEUE_ASSIGNMENT_CHANGED:"ContactToRoutingQueueAssignmentChanged"});class xt extends CustomEvent{}class $n{constructor(){this.middlewares=[]}register(e){this.middlewares.push(e)}process(e){if(Ee(e))return null;let t=e;for(let i of this.middlewares){if(t===null)return null;t=i(t)}return t}}let Qn=EventTarget;function En(n){return!Ee(n?.user)}var _t=R(555),vn=function(n,e){var t={};for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&e.indexOf(i)<0&&(t[i]=n[i]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function"){var r=0;for(i=Object.getOwnPropertySymbols(n);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(n,i[r])&&(t[i[r]]=n[i[r]])}return t};let qn={id:"",data:null,type:void 0,createdAt:new Date};function bt(n){var e;if(!(o=>"eventId"in o)(n))return qn;if((o=>"error"in o)(n))return{createdAt:(0,_t.TG)((e=n.createdAt)!==null&&e!==void 0?e:new Date().toString()),data:null,error:n.error,id:n.eventId};let t=(o=>"eventType"in o)(n)?n.eventType:void 0;if((o=>"data"in o)(n))return{createdAt:(0,_t.TG)(n.createdAt),context:n.context,data:n.data,id:n.eventId,type:t};if((o=>{let l=o?.postback;return me(l)===!1}
3)(n)){let{postback:{data:o,eventType:l},eventId:u}=n,a=vn(n,["postback","eventId"]);return{type:l,data:Object.assign(Object.assign({},a),o),createdAt:(0,_t.TG)(n.createdAt),id:u}}let{eventId:i}=n,r=vn(n,["eventId"]);return Object.assign(Object.assign({data:void 0},r),{id:i,type:t,createdAt:(0,_t.TG)(n.createdAt)})}let fn={[P.SENDER_TYPING_STARTED]:function(n){return En(n.data)?Object.assign(Object.assign({},n),{type:P.AGENT_TYPING_STARTED}):n},[P.SENDER_TYPING_ENDED]:function(n){return En(n.data)?Object.assign(Object.assign({},n),{type:P.AGENT_TYPING_ENDED}):n},[P.CASE_INBOX_ASSIGNEE_CHANGED]:function(n){return Object.assign(Object.assign({},n),{type:P.ASSIGNED_AGENT_CHANGED})},[P.CASE_CREATED]:function(n){return Object.assign(Object.assign({},n),{type:P.CONTACT_CREATED})},[P.CASE_STATUS_CHANGED]:function(n){return Object.assign(Object.assign({},n),{type:P.CONTACT_STATUS_CHANGED})},[P.CASE_TO_ROUTING_QUEUE_ASSIGNMENT_CHANGED]:function(n){return Object.assign(Object.assign({},n),{type:P.CONTACT_TO_ROUTING_QUEUE_ASSIGNMENT_CHANGED})},[P.LIVECHAT_RECOVERED]:function(n){let e=n.data.contactHistory.map(bt);return Object.assign(Object.assign({},n),{data:Object.assign(Object.assign({},n.data),{contactHistory:e})})},[P.THREAD_RECOVERED]:function(n){let e=n.data.contactHistory.map(bt);return Object.assign(Object.assign({},n),{data:Object.assign(Object.assign({},n.data),{contactHistory:e})})}};function Kn(n){return n.type&&fn[n.type]!==void 0?fn[n.type](n):n}function Ut(n){let e=L(n?.id)===!1;return L(n.error)!==!1&&e}class nt extends s{}var Re=R(434);let Gt="sdkTransactionToken";var Yn=R(10),Xn=R(720);class wt extends Error{constructor(e,t=""){super(`[WebSocketClientError]: ${e}${t?` (${t})`:""}`),this.name="WebSocketClientError"}}let Jn=EventTarget;var Tt,X,Ve,jt,it,mn=function(n,e,t,i,r){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!r)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?n!==e||!r:!e.has(n))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?r.call(n,t):r?r.value=t:e.set(n,t),t},F=function(n,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?n!==e||!i:!e.has(n))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(n):i?i.value:e.get(n)};class Zn{constructor(e,t,i,r,o,l){this.brandId=e,this.channelId=t,this.customerId=i,this.options=r,this.onError=o,this.visitorId=l,Tt.add(this),X.set(this,null),Ve.set(this,void 0),it.set(this,u=>{F(this,Ve,"f").dispatchEvent(u)}),mn(this,Ve,new Jn,"f")}connect(e){return g(this,null,function*(){var t,i;F(this,Tt,"m",jt).call(this,e),(i=(t=F(this,X,"f"))===null||t===void 0?void 0:t.socket)===null||i===void 0||i.reconnect()})}disconnect(){var e;(e=F(this,X,"f"))===null||e===void 0||e.socket.close()}reconnect(e){var t;F(this,Tt,"m",jt).call(this,e),(t=F(this,X,"f"))===null||t===void 0||t.socket.reconnect()}send(e){var t;let i=JSON.stringify(e);(t=F(this,X,"f"))===null||t===void 0||t.send(i)}on(e,t){F(this,Ve,"f").addEventListener(e,t)}off(e,t){F(this,Ve,"f").removeEventListener(e,t)}_errorHandler(e){let t=e.detail,i;if(t instanceof ErrorEvent&&(i=new wt("Connection error",t.message)),t instanceof CloseEvent&&(i=new wt("Connection closed",t.reason)),i===void 0&&(i=new wt("Unknown error",t.type)),typeof this.onError!="function")throw i;this.onError(i)}}X=new WeakMap,Ve=new WeakMap,it=new WeakMap,Tt=new WeakSet,jt=function(n){var e,t,i,r,o,l,u,a,d,f,c,h,m;let T=!((e=this.options)===null||e===void 0)&&e.port?`:${(t=this.options)===null||t===void 0?void 0:t.port}`:"",C=!((i=this.options)===null||i===void 0)&&i.host?`${(r=this.options)===null||r===void 0?void 0:r.host}${T}`:"",_=(l=(o=this.options)===null||o===void 0?void 0:o.prefix)!==null&&l!==void 0?l:"",B=(a=(u=this.options)===null||u===void 0?void 0:u.forceSecureProtocol)===null||a===void 0||a,_e=(function(Q,q,ce){let we=w.APP_VERSION,Te=Object.assign({v:we},ce);return`${Q}/${q}?${(0,Yn.C)(Te)}`})(C,_,Object.assign({brandId:this.brandId,channelId:this.channelId,consumerId:this.customerId,visitorId:this.visitorId},n?{transactionToken:n}:{})),be=!n;mn(this,X,(0,Xn.setupSocketConnection)(_e,{startClosed:!0,forceSecureProtocol:B,heartbeatAfterAuthorize:be,maxRetries:0}),"f");let ke=this._errorHandler.bind(this);(d=F(this,X,"f"))===null||d===void 0||d.addEventListener(J.nF.CLOSE,ke),(f=F(this,X,"f"))===null||f===void 0||f.addEventListener(J.nF.ERROR,ke),(c=F(this,X,"f"))===null||c===void 0||c.addEventListener(J.nF.OPEN,Q=>{var q;(q=F(this,X,"f"))===null||q===void 0||q.socket.setMaxRetires(20),F(this,it,"f").call(this,Q)}),(h=F(this,X,"f"))===null||h===void 0||h.addEventListener(J.nF.CLOSE,F(this,it,"f")),(m=F(this,X,"f"))===null||m===void 0||m.addEventListener(J.nF.MESSAGE,F(this,it,"f"))};var pn=R(168);class Lt extends s{}let ei=(n,e,t)=>g(null,null,function*(){let i=yield(l=>g(null,null,function*(){let u=yield(function(a){return new Promise((d,f)=>{let c=new FileReader;c.onloadend=()=>{d(c)},c.onerror=h=>{var m,T;return f((T=(m=h.target)===null||m===void 0?void 0:m.error)===null||T===void 0?void 0:T.message)},c.readAsDataURL(a)})})(l);if(u.error!==null)throw new s(`Cannot create payload for attachment upload because of error (${u.error.message})`);if(typeof u.result!="string")throw new s(`Cannot create payload for attachment upload because of missing:
4      reader result (${u.result})`);return{url:u.result,name:l.name,mimeType:l.type}}))(n),r=yield(function(l,u,a){return g(this,null,function*(){var d;let{url:f,name:c,mimeType:h}=a,m={content:f.split(";base64,")[1],fileName:c,mimeType:h},T=yield fetch(`${w.ENDPOINT_CHAT}/chat/1.0/brand/${l}/channel/${u}/attachment`,{method:"POST",body:JSON.stringify(m),headers:{"Content-Type":"application/json",[mt.Um]:(d=w.APP_NAME)!==null&&d!==void 0?d:""}});if(!T.ok)throw pt(yield Mt(T))?new tt:new s(`Failed to upload Attachments. Status (${T.status})`);return T.json()})})(e,t,i);if(L((o=r)==null?void 0:o.fileUrl)===!1)return{url:r.fileUrl,friendlyName:i.name};var o;throw(function(l){return L(l?.allowedFileSize)===!1})(r)?new Lt("Upload attachment failed",r):new s(`Unknown file upload response 
4(${r})`)});function _n(n){var e,t;return n.type===P.CONTACT_STATUS_CHANGED&&((t=(e=n.data)===null||e===void 0?void 0:e.case)===null||t===void 0?void 0:t.id)!==void 0}function bn(n){var e,t;return n.type===P.CONTACT_CREATED&&((t=(e=n.data)===null||e===void 0?void 0:e.case)===null||t===void 0?void 0:t.id)!==void 0}function ti(n){var e,t;return n.type===P.CONTACT_TO_ROUTING_QUEUE_ASSIGNMENT_CHANGED&&((t=(e=n.data)===null||e===void 0?void 0:e.case)===null||t===void 0?void 0:t.id)!==void 0}function ni(n){return n.type===Be.m.CONTACT_RECIPIENTS_CHANGED}let wn=(n,e,t,i=et())=>({messageContent:n,browserFingerprint:i,idOnExternalPlatform:e,thread:{idOnExternalPlatform:t},consumer:{customFields:[]},consumerContact:{customFields:[]},attachments:[]});function gt(n){var e;return n.type===A.vc.MORE_MESSAGES_LOADED&&((e=n?.data)===null||e===void 0?void 0:e.messages)!==void 0}let Tn=n=>({eventType:A.ow.LOAD_MORE_MESSAGES,data:n});class gn extends Error{constructor(e="Aborted"){super(e),this.name="AbortError"}}let ot=(()=>{class n extends Promise{constructor(t){let i=new AbortController,r=i.signal;super((o,l)=>{r.addEventListener("abort",()=>{l(new gn(this.abortReason))}),t?.(o,l,r)}),this.abort=o=>{this._abortReason=o??"Aborted",i.abort()}}get abortReason(){return this._abortReason}}return n.from=e=>e instanceof n?e:new n((t,i)=>{e.then(t).catch(i)}),n})();class ii extends s{}var oi=R(953);let ri=n=>{var e,t,i,r,o,l;return n.direction===oi.T.INBOUND?(t=(e=n.authorEndUserIdentity)===null||e===void 0?void 0:e.fullName)!==null&&t!==void 0?t:"":`${(r=(i=n.authorUser)===null||i===void 0?void 0:i.firstName)!==null&&r!==void 0?r:""} ${(l=(o=n.authorUser)===null||o===void 0?void 0:o.surname)!==null&&l!==void 0?l:""}`.trim()};function ai(n){let e=L(n.id)===!1,t=L(n.direction)===!1,i=L(n.messageContent)===!1;return e&&t&&i}function si(n){return n.type===Be.m.MESSAGE_CREATED}function ci(n){return n.type===Be.m.MESSAGE_SENT}function li(n){return n.type===Be.m.MESSAGE_READ_CHANGED}class ui extends s{}let Cn=n=>n.type===A.vc.THREAD_METADATA_LOADED&&n.data.lastMessage!==void 0,pe=n=>{let e=n.data,t=L(e)===!1,i=L(e?.messages)===!1,r=n.type===A.vc.THREAD_RECOVERED||n.type===A.vc.LIVECHAT_RECOVERED,o=L(n.error);return t&&i&&o&&r};function yn(n){return n.type===A.vc.THREAD_ARCHIVED}class Sn extends s{}function An(n){let e={eventType:A.ow.RECOVER_THREAD,data:{}};return n===void 0?e:Object.assign(Object.assign({},e),{data:{thread:{idOnExternalPlatform:n}}})}class di extends s{}class Ht extends s{}class Ft{constructor(e,t,i,r,o={},l=!1){this._exists=!1,this._typingTimeoutID=void 0,this._isAuthorizationEnabled=!1,this._customFields=new Map,this._typingPreviewText="",this.idOnExternalPlatform=e,this._websocketClient=t,this._messageEmitter=i,this._customer=r,this._isAuthorizationEnabled=l,Rt(this._customFields,o),this._registerEventHandlers()}recover(){return new ot((e,t)=>g(this,null,function*(){let i=yield M(An(this.idOnExternalPlatform),this._websocketClient);if(pe(i)){let r=i.data,{contact:o,consumerContact:l}=r,u=(function(a,d){var f={};for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&d.indexOf(c)<0&&(f[c]=a[c]);if(a!=null&&typeof Object.getOwnPropertySymbols=="function"){var h=0;for(c=Object.getOwnPropertySymbols(a);h<c.length;h++)d.indexOf(c[h])<0&&Object.prototype.propertyIsEnumerable.call(a,c[h])&&(f[c[h]]=a[c[h]])}return f})(r,["contact","consumerContact"]);e(Object.assign(Object.assign({},u),{contact:o??l}))}else t(new Ht("Thread recover fail",i))}))}sendMessage(e){return g(this,null,function*(){return(function(t){if(t.messageContent.type===Re.G.TEXT&&!(t.attachments.length>0)&&me(t.messageContent.payload.text)!==!1)throw new nt("Message content cannot be empty for text message")})(e),((t,i)=>g(null,null,function*(){let r=(o=t,{eventType:A.ow.SEND_MESSAGE,data:o});var o;let l=yield M(r,i);if(Ut(l))return l;throw new nt("Send message failed",l)}))(this._mergeCustomFieldsAndAccessTokenWithMessageData(e,!1),this._websocketClient)})}sendTextMessage(i){return g(this,arguments,function*(e,t={}){let{messageId:r=j(),browserFingerprint:o=et()}=t,l=(function(a){return{payload:{text:a},type:Re.G.TEXT}})(e),u=wn(l,r,this.idOnExternalPlatform,o);return this.sendMessage(u)})}sendPostbackMessage(r,o){return g(this,arguments,function*(e,t,i={}){let{messageId:l=j(),browserFingerprint:u=et()}=i,a=(function(f,c){return{payload:{text:c,postback:f},postback:f,type:Re.G.TEXT}})(e,t),d=wn(a,l,this.idOnExternalPlatform,u);return this.sendMessage(d)})}sendOutboundMessage(e){return g(this,null,function*(){return((t,i)=>g(null,null,function*(){let r=(o=t,{eventType:A.ow.SEND_OUTBOUND,data:o});var o;let l=yield M(r,i);if(Ut(l))return l;throw new nt("Send Outbound message failed",l)}))(this._mergeCustomFieldsAndAccessTokenWithMessageData(e,!0),this._websocketClient)})}loadMoreMessages(){return g(this,null,function*(){var e;let{scrollToken:t,oldestMessageDatetime:i}=(e=w.THREAD_DATA)!==null&&e!==void 0?e:{};if(me(t))return null;let r={scrollToken:String(t),oldestMessageDatetime:i,thread:{idOnExternalPlatform:this.idOnExternalPlatform}},o=yield M(Tn(r),this._websocketClient);if(gt(o))return o;throw new Sn("Load more messages failed",o)})}lastMessageSeen(){return g(this,null,function*(){var e;return M((e=this.idOnExternalPlatform,{eventType:A.ow.MESSAGE_SEEN,data:{thread:{idOnExternalPlatform:e}}}),this._websocketClient)})}sendAttachments(i){return g(this,arguments,function*(e,t={}){if(L(e)||e.length===0)throw new s("FileList must be provided to sendAttachment method");let r=yield((a,d,...f)=>g(null,[a,d,...f],function*(o,l,u={}){let{brandId:c,channelId:h}=Et();try{let m=yield Promise.all(Array.from(o).map(_=>g(null,null,function*(){return ei(_,c,h)}))),{messageId:T=j(),browserFingerprint:C=et()}=u;return{messageContent:{type:Re.G.TEXT,payload:{text:""}}
4,attachments:m,browserFingerprint:C,thread:{idOnExternalPlatform:l},idOnExternalPlatform:T,consumer:{customFields:[]},consumerContact:{customFields:[]}}}catch(m){throw m instanceof Lt?m:m instanceof Error?new s(`Send attachment failed because of (${m.message})`):new s("Unknown error during file upload")}}))(e,this.idOnExternalPlatform,t);return this.sendMessage(r)})}keystroke(e=1e3,t){var i;this._typingTimeoutID||M((i=this.idOnExternalPlatform,{eventType:A.ow.SENDER_TYPING_STARTED,data:{thread:{idOnExternalPlatform:i}}}),this._websocketClient),clearTimeout(this._typingTimeoutID),this._typingTimeoutID=setTimeout(()=>{this._stopTypingCallback(t)},e)}stopTyping(){this._stopTypingCallback()}_stopTypingCallback(e){var t;clearTimeout(this._typingTimeoutID),this._typingTimeoutID=void 0,M((t=this.idOnExternalPlatform,{eventType:A.ow.SENDER_TYPING_ENDED,data:{thread:{idOnExternalPlatform:t}}}),this._websocketClient),typeof e=="function"&&e()}keystrokeForPreview(e,t=1250){this._typingPreviewText=e,this._typingForPreviewTimeoutID||(this._typingForPreviewTimeoutID=setTimeout(()=>{this.stopTypingForPreview()},t))}stopTypingForPreview(e=!0){clearTimeout(this._typingForPreviewTimeoutID),this._typingForPreviewTimeoutID=void 0;let t=this._typingPreviewText;this._typingPreviewText="",e!==!1&&this.sendMessagePreview(t)}getMetadata(){return g(this,null,function*(){let e=yield M((t=this.idOnExternalPlatform,{eventType:A.ow.LOAD_THREAD_METADATA,data:{thread:{idOnExternalPlatform:t}}}),this._websocketClient);var t;if(Cn(e))return e;throw new ui("Get metadata failed",e)})}onThreadEvent(e,t){let i=((r,o)=>l=>{(a=>{var d,f,c,h,m,T,C;let _=a;return(T=(h=(f=(d=_?.thread)===null||d===void 0?void 0:d.idOnExternalPlatform)!==null&&f!==void 0?f:(c=_?.case)===null||c===void 0?void 0:c.threadIdOnExternalPlatform)!==null&&h!==void 0?h:(m=_?.message)===null||m===void 0?void 0:m.threadIdOnExternalPlatform)!==null&&T!==void 0?T:(C=_?.messagePreview)===null||C===void 0?void 0:C.threadIdOnExternalPlatform})(l.detail.data)===r&&o(l)})(this.idOnExternalPlatform,t);return this._messageEmitter.addEventListener(e,i),()=>{this._messageEmitter.removeEventListener(e,i)}}sendCustomFields(e){return g(this,null,function*(){var t,i;return M((t=ht(this._customFields).filter(r=>!e||e.includes(r.ident)),i=this.idOnExternalPlatform,{eventType:A.ow.SET_CONSUMER_CONTACT_CUSTOM_FIELD,data:{customFields:t,thread:{idOnExternalPlatform:i}}}),this._websocketClient)})}setCustomFields(e){return g(this,null,function*(){Rt(this._customFields,e),this._exists!==!1&&(yield this.sendCustomFields(Object.keys(e)))})}setCustomField(e,t){return this.setCustomFields({[e]:t})}archive(){return g(this,null,function*(){let e=yield M((t=this.idOnExternalPlatform,{eventType:A.ow.ARCHIVE_THREAD,data:{thread:{idOnExternalPlatform:t}}}),this._websocketClient);var t;if(yn(e))return!0;throw new ii("Archive Thread failed",e)})}setName(e){return g(this,null,function*(){let t=(i=this.idOnExternalPlatform,r=e,{eventType:A.ow.UPDATE_THREAD,data:{thread:{idOnExternalPlatform:i,threadName:r}}});var i,r;let o=yield M(t,this._websocketClient);if((function(l){return L(l.error)})(o))return!0;throw new di("Set Thread name failed",o)})}sendMessagePreview(e){return g(this,null,function*(){let t=((i,r)=>({eventType:A.ow.SEND_MESSAGE_PREVIEW,data:{thread:{idOnExternalPlatform:i},messageContent:{payload:{text:r},type:Re.G.TEXT}}}))(this.idOnExternalPlatform,e);yield M(t,this._websocketClient)})}sendTranscript(e,t){return g(this,null,function*(){let i=((r,o)=>({eventType:A.ow.SEND_TRANSCRIPT,data:{consumerContact:{id:r},consumerRecipients:[{idOnExternalPlatform:o}]}}))(e,t);return M(i,this._websocketClient)})}_setThreadAndCustomerExists(){var e;this._exists=!0,(e=this._customer)===null||e===void 0||e.setExists(!0)}_clearCustomFieldsOnContactStatusChangedToClosed(e){let t=e.detail;_n(t)&&t.data.case.status===pn.P.CLOSED&&this._customFields.clear()}_mergeCustomFieldsAndAccessTokenWithMessageData(e,t){var i,r,o,l,u,a;let d,f=(i=this._isAuthorizationEnabled&&p())!==null&&i!==void 0&&i;f!==!1&&(d={token:f.token}),Dt(this._customFields,e.consumerContact.customFields);let c={customFields:ht(this._customFields)},h;return t||((r=this._customer)===null||r===void 0||r.setCustomFieldsFromArray((l=(o=e.consumer)===null||o===void 0?void 0:o.customFields)!==null&&l!==void 0?l:[]),h={customFields:(a=(u=this._customer)===null||u===void 0?void 0:u.getCustomFieldsArray())!==null&&a!==void 0?a:[]}),Object.assign(Object.assign({},e),{accessToken:d,consumer:h,consumerContact:c})}
4_registerEventHandlers(){this.onThreadEvent(P.CASE_CREATED,()=>this._setThreadAndCustomerExists()),this.onThreadEvent(P.CONTACT_CREATED,()=>this._setThreadAndCustomerExists()),this.onThreadEvent(P.THREAD_RECOVERED,()=>this._setThreadAndCustomerExists()),this.onThreadEvent(P.CONTACT_STATUS_CHANGED,e=>this._clearCustomFieldsOnContactStatusChangedToClosed(e))}}function On(n){let e={eventType:A.ow.RECOVER_LIVECHAT,data:{}};return n===void 0?e:Object.assign(Object.assign({},e),{data:{thread:{idOnExternalPlatform:n}}})}class Ct extends Ft{constructor(e,t,i,r,o={},l=!1){super(e,t,i,r,o,l),this._isInitialized=!1,this._canSendMessage=!0,this._registerLivechatEventHandlers()}recover(){return new ot((e,t)=>g(this,null,function*(){let i=yield M(On(this.idOnExternalPlatform),this._websocketClient);if(pe(i)){let r=i.data,{contact:o,consumerContact:l}=r,u=(function(a,d){var f={};for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&d.indexOf(c)<0&&(f[c]=a[c]);if(a!=null&&typeof Object.getOwnPropertySymbols=="function"){var h=0;for(c=Object.getOwnPropertySymbols(a);h<c.length;h++)d.indexOf(c[h])<0&&Object.prototype.propertyIsEnumerable.call(a,c[h])&&(f[c[h]]=a[c[h]])}return f})(r,["contact","consumerContact"]);e(Object.assign(Object.assign({},u),{contact:o??l}))}else t(new Ht("Thread recover fail",i))}))}sendMessage(e){return g(this,null,function*(){if(this._canSendMessage===!1)throw new s("Cannot send more messages to Contact");return Un(Ct.prototype,this,"sendMessage").call(this,e)})}startChat(e="Begin conversation"){return g(this,null,function*(){if(this._isInitialized)throw new s("Chat is already initialized");try{let t=yield this.sendTextMessage(e);return this._isInitialized=!0,t}catch(t){if(t instanceof Error)throw new s(`Sending initial message failed because of (${t.message})`);return}})}endChat(){return g(this,null,function*(){var e;let t=(e=w.THREAD_DATA)!==null&&e!==void 0?e:{},i=t?.contactId;if(L(i))throw new s("Cannot end Chat because of missing ContactId in the storage");yield M((function(r,o){return{eventType:A.ow.END_CONTACT,data:{thread:{idOnExternalPlatform:r},contact:{id:o}}}})(this.idOnExternalPlatform,i),this._websocketClient)})}loadMoreMessages(){return g(this,null,function*(){var e;let{scrollToken:t,oldestMessageDatetime:i,contactId:r}=(e=w.THREAD_DATA)!==null&&e!==void 0?e:{};if(me(t)||me(r))return null;let o={scrollToken:String(t),oldestMessageDatetime:i,thread:{idOnExternalPlatform:this.idOnExternalPlatform},contact:{id:r}},l=yield M(Tn(o),this._websocketClient);if(gt(l))return l;throw new Sn("Load more messages failed",l)})}_registerLivechatEventHandlers(){this.onThreadEvent(P.LIVECHAT_RECOVERED,e=>{pe(e.detail)&&this._setThreadAndCustomerExists()})}}let In=n=>!Z(n)&&"threads"in n;function Nn(n){var e;let t=(e=w.THREAD_DATA)!==null&&e!==void 0?e:{};w.THREAD_DATA=Object.assign(Object.assign({},t),{contactId:n})}function hi(n){var e,t,i;return bn(n)&&Nn(n.data.case.id),pe(n)&&Nn((t=(e=n.data.consumerContact)===null||e===void 0?void 0:e.caseId)!==null&&t!==void 0?t:(i=n.data.contact)===null||i===void 0?void 0:i.id),n}let Ei=function(n){var e=n==null?0:n.length;return e?n[e-1]:void 0};function Rn(n){var e,t;let i=(e=Ei(n.messages))===null||e===void 0?void 0:e.createdAt,r=(t=w.THREAD_DATA)!==null&&t!==void 0?t:{};w.THREAD_DATA=Object.assign(Object.assign({},r),{scrollToken:n.scrollToken,oldestMessageDatetime:L(i)?"":i})}function vi(n){if(pe(n)){let{messages:e,messagesScrollToken:t}=n.data;Rn({messages:e,scrollToken:t})}if(gt(n)){let{scrollToken:e,messages:t}=n.data;Rn({scrollToken:e,messages:t})}return n}function Bt(n){if(typeof n!="function")throw Error(`Expected a callable function, got ${n}`)}var yt,Vt,Dn=function(n,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?n!==e||!i:!e.has(n))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(n):i?i.value:e.get(n)};class kn{constructor(e){var t,i,r,o,l;if(yt.add(this),this.customer=null,this.channelId="",this.websocketClient=null,this._incomingChatEventMiddleware=new $n,this._threadCache=new Map,this._contactCustomFieldsQueue=new Map,this._sendRefreshTokenEvent=()=>g(this,null,function*(){let d=p();if(Z(d))return;let f=yield M((c=d.token,{eventType:A.ow.REFRESH_TOKEN,data:{accessToken:{token:c}}}),this.websocketClient);var c;if(sn(f))return v(f.data.accessToken),void Pt(f.data.accessToken,this._sendRefreshTokenEvent);throw new E("An error occurred while refreshing the access token",f.error)}),e===void 0)throw new s("No options was provided for initialization of ChatSdk");w.AUTHORIZATION_CODE=e.authorizationCode,w.BRAND_ID=e.brandId,w.CHANNEL_ID=e.channelId,w.APP_NAME=(t=e.appName)!==null&&t!==void 0?t:"chat-web-sdk",w.APP_VERSION=`${(i=e.appVersion)!==null&&i!==void 0?i:0}`,w.DESTINATION=e.destinationId,w.VISIT_ID=e.visitId,w.VISITOR_ID=e.visitorId,w.LANGUAGE=(r=e.language)!==null&&r!==void 0?r:ft(),w.SECURED_SESSION=(o=e.securedSession)!==null&&o!==void 0&&o,e.cacheStorage&&(Bt(e.cac
4heStorage.getItem),Bt(e.cacheStorage.setItem),Bt(e.cacheStorage.removeItem),w.CACHE_STORAGE=e.cacheStorage);let{brandId:u,channelId:a}=Et();this.onError=e.onError,this.onRawEvent=e.onRawEvent,this._incomingChatEventMiddleware.register(Kn),this._incomingChatEventMiddleware.register(Wn),this._incomingChatEventMiddleware.register(vi),this._incomingChatEventMiddleware.register(hi),this._messageEmitter=new Qn;try{if(isNaN(u))throw new Error("Missing BrandID");if(a===void 0)throw new Error("Missing ChannelId");if(e.customerId===void 0)throw new Error("Missing CustomerId");let d=(l=e.visitorId)!==null&&l!==void 0?l:"";this._initEnvironment(e),Dn(this,yt,"m",Vt).call(this,e.customerId,d),this.customer=new V(e.customerId,e.customerName,e.customerImage,this.websocketClient),this.channelId=a,this.isLivechat=e.isLivechat,this.isAuthorizationEnabled=e.isAuthorizationEnabled}catch(d){this.onErrorHandler(d)}}onErrorHandler(e){let t=new s(e);if(typeof this.onError!="function")throw t;this.onError(t)}getChannelInfo(){return g(this,null,function*(){return dn(w.BRAND_ID,w.CHANNEL_ID,w.LANGUAGE)})}getChannelAvailability(){return g(this,null,function*(){return(function(e,t){return g(this,null,function*(){var i;let r=w.ENDPOINT_CHAT,o=yield fetch(`${r}/chat/1.0/brand/${e}/channel/${t}/availability`,{method:"GET",headers:{Accept:"application/json","Content-Type":"application/json",[mt.Um]:(i=w.APP_NAME)!==null&&i!==void 0?i:"","x-sdk-platform":"web","x-sdk-version":b}});if(!o.ok)throw pt(yield Mt(o))?new tt:new s(`Failed to fetch channel availability. Status (${o.status})`,{response:o});return o.json()})})(w.BRAND_ID,w.CHANNEL_ID)})}authorize(e,t){return g(this,null,function*(){var i,r,o,l,u;let a=p();if(a!==null)try{return yield(function(q,ce,we,Te){return g(this,null,function*(){let Mi=rn(we,Te),Mn=yield M(Mi,q);if(Mn.error!==void 0)throw new E("Authorization reconnect failed",Mn.error);return Pt(we,ce),{reconnected:!0}})})(this.websocketClient,this._sendRefreshTokenEvent,a,t)}catch{}let d=(function(Q,q){return g(this,null,function*(){if(!L(Q)&&!L(q))return{isAuthorizationEnabled:Q,isLivechat:q};let ce=yield dn(w.BRAND_ID,w.CHANNEL_ID);return{isAuthorizationEnabled:ce.isAuthorizationEnabled,isLivechat:ce.isLiveChat}})})(this.isAuthorizationEnabled,this.isLivechat),f=(function(Q,q=j()){return Object.assign({eventType:A.ow.AUTHORIZE_CUSTOMER,data:{authorization:{authorizationCode:Q},disableChannelInfo:!0,sdkVersion:b,sdkPlatform:"web"}},ve(q))})((i=e??w.AUTHORIZATION_CODE)!==null&&i!==void 0?i:null,t),c=on(nn(f),j(),oe.V.REGISTER),h=Jt(c,this.websocketClient),[m,T]=yield Promise.all([h,d]);if(!an(m))throw(r=this.websocketClient)===null||r===void 0||r.disconnect(),new E("Authorization failed",m.error);let{consumerIdentity:C,customer:_,contact:B}=m.data,_e=C?.idOnExternalPlatform;if(Ee(be=_e)||be==="")throw(o=this.websocketClient)===null||o===void 0||o.disconnect(),new s("Invalid customer identity");var be;V.setId(_e),C.firstName===void 0&&C.lastName===void 0||V.setName(`${C.firstName} ${C.lastName}`);let ke=C.image;return ke!==void 0&&V.setImage(ke),_?.customFields&&((l=this.customer)===null||l===void 0||l.setCustomFieldsFromArray(_.customFields)),B?.customFields&&Dt(this._contactCustomFieldsQueue,B.customFields),this.isAuthorizationEnabled=T.isAuthorizationEnabled,this.isLivechat=T.isLivechat,((u=m.data.accessToken)===null||u===void 0?void 0:u.token)!==void 0&&(v(m.data.accessToken),Pt(m.data.accessToken,this._sendRefreshTokenEvent)),m.data})}generateAuthorizationToken(e,t){return g(this,null,function*(){let i=yield M((function(o,l){return{eventType:A.ow.GENERATE_AUTHORIZATION_TOKEN,data:{thread:{idOnExternalPlatform:o},url:l}}})(e,t),this.websocketClient);if(!("authorizationToken"in i.data))throw new s("Invalid response from generate authorization token (generateAuthorizationToken)");let{authorizationToken:r}=i.data;return r})}onChatEvent(e,t){return this._messageEmitter.addEventListener(e,t),()=>{this._messageEmitter.removeEventListener(e,t)}}getCustomer(){return this.customer}getThread(e){if(Z(this.websocketClient))throw new s("Cannot get thread because websocket is disconnected");if(Ee(e))throw new s("Cannot get thread because id is undefined");let t=this._threadCache.get(e);if(!L(t))return t;
4if(this.isLivechat===!0){let r=new Ct(e,this.websocketClient,this._messageEmitter,this.customer,this._getContactCustomFieldsFromQueue(),this.isAuthorizationEnabled);return this._threadCache.set(e,r),r}let i=new Ft(e,this.websocketClient,this._messageEmitter,this.customer,this._getContactCustomFieldsFromQueue(),this.isAuthorizationEnabled);return this._threadCache.set(e,i),i}getThreadList(){return g(this,null,function*(){if(Z(this.websocketClient))throw new s("Cannot get thread list because websocket is disconnected");let e={eventType:A.ow.FETCH_THREAD_LIST,data:{}},t=yield M(e,this.websocketClient);if(!In(t.data))throw new s("Invalid response from fetch thread list (getThreadList)");return t.data.threads})}getWebsocketClient(){return this.websocketClient}sendOfflineMessage(e){return g(this,null,function*(){return((t,i)=>g(null,null,function*(){let r=(l=>{let[u,...a]=l.name.split(" ").reverse(),d=a.reverse().join(" "),f={idOnExternalPlatform:l.email,firstName:d,lastName:u},c={messageContent:{type:Re.G.TEXT,payload:{text:l.message}},authorCustomerIdentity:f};return{eventType:A.ow.SEND_OFFLINE_MESSAGE,data:c}})(t),o=yield M(r,i);if(Ut(o))return o;throw new nt("Send offline message failed",o)}))(e,this.websocketClient)})}recoverThreadData(e=void 0){return new ot((t,i)=>g(this,null,function*(){let r=An(e),o=yield M(r,this.websocketClient);pe(o)?(this.getThread(o.data.thread.idOnExternalPlatform),this._messageEmitter.dispatchEvent(new xt(P.THREAD_RECOVERED,{detail:o})),t(o)):i(new s("Invalid response from recover livechat thread"))}))}recoverLivechatThreadData(e=void 0){return new ot((t,i)=>g(this,null,function*(){let r=On(e),o=yield M(r,this.websocketClient);pe(o)?(this.getThread(o.data.thread.idOnExternalPlatform),this._messageEmitter.dispatchEvent(new xt(P.LIVECHAT_RECOVERED,{detail:o})),t(o)):i(new s("Invalid response from recover livechat thread"))}))}_getContactCustomFieldsFromQueue(){if(this._contactCustomFieldsQueue.size>0){let e=en(this._contactCustomFieldsQueue);return this._contactCustomFieldsQueue.clear(),e}return{}}_initEnvironment(e){if(e.environment===Fe.custom){if(me(e.customEnvironment)||Ee(e.customEnvironment))throw new s('customEnvironment must be provided when environment is set to "custom"');return void hn(e.customEnvironment)}let t=(function(i){if(!(i in Fe))throw new s(`Unknown environment: ${i}`);if(i===Fe.custom)throw new s("The custom environment cannot be constructed using the built-in configuration");return{chat:`https://channels-de-${i}.niceincontact.com`.toLowerCase(),name:i,gateway:`wss://chat-gateway-de-${i}.niceincontact.com`.toLowerCase(),authorize:`https://digital-oauth-de-${i}.niceincontact.com`.toLowerCase()}})(e.environment);hn(t)}_initWS(e,t){let{brandId:i,channelId:r}=Et(),o=w.ENDPOINT_GATEWAY;(function(d){if(d==null)throw Error(`Expected non-nullish value, got ${d}`)})(o);let l=new URL(o),u=l.protocol,a={host:l.hostname,port:l.port,prefix:l.pathname.substring(1),forceSecureProtocol:u==="wss:"};this.websocketClient=new Zn(i,r,e,a,this.onError,t),this.websocketClient.on(J.nF.MESSAGE,d=>g(this,null,function*(){try{typeof this.onRawEvent=="function"&&this.onRawEvent(d);let f=yield(h=>
4g(this,null,function*(){if(Ee(h))return null;if(h.type!==Be.m.EVENT_IN_S3)return h;let m=h.data.s3Object.url,T=yield fetch(m);if(T.ok)return bt(yield T.json());throw new s("Failed to fetch S3 event data")}))((h=>{let m=h?.detail;if(!m)return;let T;try{T=JSON.parse(m.data)}catch{return}return bt(T)})(d)),c=this._incomingChatEventMiddleware.process(f);if(!Ee(c)){let{type:h}=c;(m=>{let{id:T}=m;if(dt.has(T)){let C=dt.get(T);typeof C=="function"&&C(m),dt.delete(T)}})(c),this._messageEmitter.dispatchEvent(new xt(h??"",{detail:c}))}}catch(f){this.onErrorHandler(f)}}))}resetSession(e=j(),t="",i="",r="",o=j()){var l;(l=this.websocketClient)===null||l===void 0||l.disconnect(),this.websocketClient=null,this._threadCache.clear(),this._contactCustomFieldsQueue.clear(),w.ACCESS_TOKEN=void 0,w.ACCESS_TOKEN_EXPIRES_IN=void 0,w.CACHE_STORAGE&&w.CACHE_STORAGE.removeItem(Gt),w.VISIT_ID=o,w.VISITOR_ID=r;try{Dn(this,yt,"m",Vt).call(this,e,r),this.customer=new V(e,t,i,this.websocketClient)}catch(u){this.onErrorHandler(u)}}}function fi(n){var e,t;return n.type===P.ASSIGNED_AGENT_CHANGED&&((t=(e=n.data)===null||e===void 0?void 0:e.case)===null||t===void 0?void 0:t.id)!==void 0}function mi(n){var e,t;return n.type===P.AGENT_TYPING_STARTED&&((t=(e=n.data)===null||e===void 0?void 0:e.thread)===null||t===void 0?void 0:t.idOnExternalPlatform)!==void 0}function pi(n){var e,t;return n.type===P.AGENT_TYPING_ENDED&&((t=(e=n.data)===null||e===void 0?void 0:e.thread)===null||t===void 0?void 0:t.idOnExternalPlatform)!==void 0}yt=new WeakSet,Vt=function(n,e){return g(this,null,function*(){var t,i;if(this._initWS(n,e),(()=>{var r;return(r=w.SECURED_SESSION)!==null&&r!==void 0&&r})()===!0)try{let r=yield g(this,null,function*(){var o,l,u;if(!w.ENDPOINT_AUTHORIZE)throw new s("Authorize hostname is not set");let a=new URL(w.ENDPOINT_AUTHORIZE);a.pathname="/token",a.searchParams.append("brandId",String(w.BRAND_ID)),a.searchParams.append("channelId",(o=w.CHANNEL_ID)!==null&&o!==void 0?o:""),a.searchParams.append("visitorId",(l=w.VISITOR_ID)!==null&&l!==void 0?l:"");let d=w.CACHE_STORAGE?w.CACHE_STORAGE.getItem(Gt):null;if(d)return d;try{let f=yield fetch(a.toString(),{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json",[mt.Um]:(u=w.APP_NAME)!==null&&u!==void 0?u:"","x-sdk-platform":"web","x-sdk-version":b},body:JSON.stringify({})});if(f.ok){let{accessToken:c,expiresIn:h}=yield f.json();return((m,T)=>{w.CACHE_STORAGE&&w.CACHE_STORAGE.setItem(Gt,m,T)})(c,h),c}throw new s("Failed to fetch transaction token",f)}catch(f){throw f instanceof s?f:new s("Failed to fetch transaction token",f)}});yield(i=this.websocketClient)===null||i===void 0?void 0:i.connect(r)}catch(r){this.onErrorHandler(r)}else try{(t=this.websocketClient)===null||t===void 0||t.connect()}catch(r){this.onErrorHandler(r)}})};let _i=n=>{let e=n;return Number.isInteger(e?.data.positionInQueue)&&me(e?.id)===!1&&e?.type===A.vc.SET_POSITION_IN_QUEUE};class bi extends s{}function wi(n){return{eventType:A.ow.CREATE_GROUP_CHAT_INVITE,data:{contact:{id:n}}}}function Ti(n,e){return g(this,null,function*(){let t=yield M(n,e);if((function(i){return i.type===P.GROUP_CHAT_INVITE_CREATED})(t))return t;throw new bi("Create invitation failed",t)})}class gi extends s{}function Ci(n){return{eventType:A.ow.JOIN_GROUP_CHAT,data:{invitation:{code:n}}}}function yi(n,e){return g(this,null,function*(){let t=yield M(n,e);if((function(i){return i.type===P.GROUP_CHAT_JOINED})(t))return t;throw new gi("Join Group chat failed",t)})}function Si(n){return{eventType:A.ow.LEAVE_GROUP_CHAT,data:{contact:{id:n}}}}function Ai(n,e){return g(this,null,function*(){return M(n,e)})}class Oi extends s{}function Ii(n,e,t){return{eventType:A.ow.SEND_EMAIL_INVITE_TO_GROUP_CHAT,data:{contact:{id:n},invitation:{code:e},recipients:[{idOnExternalPlatform:t}]}}}function Ni(n,e){return g(this,null,function*(){let t=yield M(n,e);if((function(i){return i.type===P.GROUP_CHAT_INVITE_SENT})(t))return t;throw new Oi("Send Email Invitation failed",t)})}class Pn extends Error{constructor(e){super(e),this.name="CacheStorageError"}}var De,St=function(n,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?n!==e||!i:!e.has(n))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(n):i?i.value:e.get(n)};class Ri{constructor(e){if(De.set(this,void 0),!(e&&e.getItem&&e.setItem&&e.removeItem))throw new Pn("CacheStorage: Storage is required");(function(t,i,r,o,l){if(o==="m")throw new TypeError("Private method is not writable");if(o==="a"&&!l)throw new TypeError("Private accessor was defined without a setter");if(typeof i=="function"?t!==i||!l:!i.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");o==="a"?l.call(t,r):l?l.value=r:i.set(t,r)})(this,De,e,"f")}getItem(e){let t=St(this,De,"f").getItem(e);if(!t)return null;let{data:i,expiresAt:r=0}=JSON.parse(t);return r<new Date().getTime()||L(i)?(St(this,De,"f").removeItem(e),null):i}removeItem(e){St(this,De,"f").removeItem(e)}setItem(e,t,i){let r={data:t,expiresAt:new Date().getTime()+i};St(this,De,"f").setItem(e,JSON.stringify(r))}}De=new WeakMap;var Di=R(369);function ki(n){return typeof n=="object"&&n!==null&&"reconnected"in n&&n.reconnected===!0}let Pi=kn;return Pe})())});export{xi as a};
5//# sourceMappingURL=chunk-6SUCXGMB.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.