!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["msg-v1-static-assets"]=t():e["msg-v1-static-assets"]=t()}(this,(()=>(this.webpackChunkmsg_v1_static_assets=this.webpackChunkmsg_v1_static_assets||[]).push([[686],{205:(e,t)=>{t.cM=(e,t="INFO")=>{const i="ERROR".toUpperCase();"INFO"!==t||"INFO"!==i?"WARN"!==t||"INFO"!==i&&"WARN"!==i?"ERROR"!==t||"INFO"!==i&&"WARN"!==i&&"ERROR"!==i||console.error("[msg-v1-static-assets] ",e):console.warn("[msg-v1-static-assets] ",e):console.log("[msg-v1-static-assets] ",e)},t.H_="INFO",t.u_="WARN",t.pn="ERROR"},264:(e,t,i)=>{"use strict";i.d(t,{Z:()=>s});var a=i(81),o=i.n(a),n=i(645),r=i.n(n)()(o());r.push([e.id,".fab-open{cursor:pointer;z-index:99999;display:flex;justify-content:space-around;align-items:center;position:fixed;height:48px;padding:12px 20px 12px 16px;background-color:#fff;border-style:solid;border-color:#121212;font-weight:590;font-size:16px;line-height:20px}.fab-open.disabled{cursor:not-allowed}.fab-open .icon{width:24px;height:24px;fill:currentColor;transition:fill .3s}.fab-open:hover{background-color:#121212;color:#fbfbfb}.fab-open:hover .icon{fill:#fbfbfb}@media(min-width: 599px){.fab-open .icon{width:32px;height:32px}}.fab-open-default{width:110px;top:calc(100vh - 200px - 48px);right:90px;color:#1c1c1c;border-width:1.5px;box-shadow:0px 8px 24px rgba(65,65,65,.1),0px 8px 24px rgba(65,65,65,.1);border-radius:40px}@media only screen and (min-width: 320px)and (max-width: 374px){.fab-open-default{top:calc(100vh - 100px - 48px);right:30px}}@media only screen and (min-width: 375px)and (max-width: 389px){.fab-open-default{top:calc(100vh - 100px - 48px);right:30px}}@media only screen and (min-width: 390px)and (max-width: 414px){.fab-open-default{top:calc(100vh - 100px - 48px);right:30px}}@media only screen and (min-width: 375px)and (max-width: 389px){.fab-open-default{top:calc(100vh - 100px - 48px);right:30px}}@media only screen and (min-width: 414px)and (max-width: 427px){.fab-open-default{top:calc(100vh - 100px - 48px);right:30px}}@media only screen and (min-width: 390px)and (max-width: 399px){.fab-open-default{top:calc(100vh - 100px - 48px);right:30px}}@media only screen and (min-width: 428px)and (max-width: 429px){.fab-open-default{top:calc(100vh - 100px - 48px);right:30px}}@media only screen and (min-width: 393px)and (max-width: 429px){.fab-open-default{top:calc(100vh - 100px - 48px);right:30px}}@media only screen and (min-width: 430px){.fab-open-default{top:calc(100vh - 100px - 48px);right:30px}}@media only screen and (min-width: 431px)and (max-width: 600px){.fab-open-default{top:calc(100vh - 45px - 32px);left:calc(100vw - 110px - 24px)}}@media(min-width: 599px){.fab-open-default{width:126px;height:56px;top:calc(100vh - 56px - 32px);left:calc(100vw - 126px - 24px);border:2px solid #121212;font-size:20px;line-height:24px}}.fab-open-active{width:251px;height:48px;top:calc(100vh - 48px);left:calc(100vw - 251px - 24px);color:#121212;border-width:1px 1px 0px 1px;box-shadow:0px -3px 10px rgba(65,65,65,.1),0px -3px 10px rgba(65,65,65,.1)}.fab-open-active .badge{position:absolute;width:6px;height:6px;left:50px;top:12px;background:#e20074;border-radius:6px;border:solid #fff 2px}.fab-open-active:hover .badge{border-color:#121212}@media only screen and (min-width: 320px)and (max-width: 374px){.fab-open-active{top:calc(100vh - 100px - 48px);right:30px}}@media only screen and (min-width: 375px)and (max-width: 389px){.fab-open-active{top:calc(100vh - 100px - 48px);right:30px}}@media only screen and (min-width: 390px)and (max-width: 414px){.fab-open-active{top:calc(100vh - 100px - 48px);right:30px}}@media only screen and (min-width: 375px)and (max-width: 389px){.fab-open-active{top:calc(100vh - 100px - 48px);right:30px}}@media only screen and (min-width: 414px)and (max-width: 427px){.fab-open-active{top:calc(100vh - 100px - 48px);right:30px}}@media only screen and (min-width: 390px)and (max-width: 399px){.fab-open-active{top:calc(100vh - 100px - 48px);right:30px}}@media only screen and (min-width: 428px)and (max-width: 429px){.fab-open-active{top:calc(100vh - 100px - 48px);right:30px}}@media only screen and (min-width: 393px)and (max-width: 429px){.fab-open-active{top:calc(100vh - 100px - 48px);right:30px}}@media only screen and (min-width: 430px){.fab-open-active{top:calc(100vh - 100px - 48px);right:30px}}@media(min-width: 599px){.fab-open-active{width:282px;font-size:20px;line-height:24px;left:calc(100vw - 282px - 24px)}.fab-open-active .badge{left:57px;top:9px}}.ccass-fab-close{display:none}@media(min-width: 599px){.ccass-fab-close{position:fixed;z-index:99999;bottom:32px;right:24px;flex-direction:row;justify-content:center;align-items:center;padding:16px;width:56px;height:56px;background-color:#fff;color:#1c1c1c;border:1.5px solid #121212;box-shadow:0px 3px 10px rgba(65,65,65,.19);border-radius:56px;cursor:pointer}.ccass-fab-close .icon{width:32px;height:32px;fill:currentColor;transition:fill .3s}.ccass-fab-close:hover{background-color:#121212;color:#fbfbfb}.ccass-fab-close:hover .icon{fill:#fbfbfb}}.loader-container{display:flex;justify-content:center;align-items:center}.loader-container span{font-size:14px;font-weight:600;margin-left:6px}@media(min-width: 599px){.loader-container span{font-size:16px;margin-left:8px}}.loader{border:3px solid #e4e4e7;border-top:3px solid #a1a1aa;border-radius:50%;width:15px;height:15px;animation:spin 1s linear infinite}@media(min-width: 599px){.loader{border:4px solid #e4e4e7;border-top:4px solid #a1a1aa;width:20px;height:20px}}@keyframes spin{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}",""]);const s=r},619:(e,t,i)=>{"use strict";i.d(t,{Z:()=>s});var a=i(81),o=i.n(a),n=i(645),r=i.n(n)()(o());r.push([e.id,"#ujet-widget{--launcher-size: 70px;--ujet-right: 20px;--ujet-bottom: 100px;--accent-1: #fff0f8;--accent-2: #ffe4f4;--accent-3: #ffd0ea;--accent-4: #ffb8df;--accent-5: #ff9ed2;--accent-6: #ff7cc2;--accent-7: #ff51ae;--accent-8: #e20074;--accent-9: #e20074;--accent-10: #e20074;--accent-11: #a30057;--accent-12: #550033;--accent-9-contrast: white;--chat-bubble-agent-background: #F5F5F5;--confirmation-icon-color: #008110;--confirmation-icon-size: 2.25rem}",""]);const s=r},90:(e,t,i)=>{"use strict";i.d(t,{Z:()=>s});var a=i(81),o=i.n(a),n=i(645),r=i.n(n)()(o());r.push([e.id,"a{color:#e20074}.ujet-head_info strong{font-weight:600;color:#121212}@media(max-width: 600px){.ujet-minimize{background-color:#2b2b2b;height:44px;padding:6px 8px;font-style:normal;font-weight:400}}.ujet-head_info{color:#121212}.message_content{font-style:normal;font-weight:400}[data-from=system] .message_bubble{color:#121212}[data-from=end_user] .message_bubble{color:#f5f5f5}.message_bubble{border:0;border-radius:12px;padding:12px}.message-time{font-weight:400;color:#6a6a6a}.message-item[data-from=system] .message_bubble{background-color:#f5f5f5}.message-item[data-from=system] .notice-content{color:#6a6a6a}[data-from=end_user] .message_bubble{border:0;border-radius:12px;padding:12px;background-color:#1c1c1c}.chat-input-area{background-color:#fbfbfb;border-top:1px solid #6a6a6a;min-height:37.33px;padding:.675rem 1rem}.chat-input-area textarea{color:#2b2b2b;caret-color:#e20074;font-weight:400}.chat-input-area textarea::placeholder{font-weight:400;color:#2b2b2b}.chat-input-area form{margin:0}.chat-input-area .chat-input-buttons{height:48px;width:48px}.chat-input-area button svg{fill:#1c1c1c;height:28px;width:28px}.chat-input-area button.submit svg{fill:#e20074}.dialog_close{display:none}.dialog_content h2{font-weight:400;color:#121212}.button-2{box-sizing:border-box;display:flex;flex-direction:row;justify-content:center;align-items:center;gap:8px;width:327px;height:48px;min-height:48px;border:2px solid #121212;border-radius:4px;color:#121212;padding:8px 0}@media(min-width: 599px){.button-2{padding:14px 8px}}.dialog_buttons button.primary{background:inherit;color:#121212;border:2px solid #121212;outline:none}.dialog_buttons button.primary:hover{background:#6a6a6a;border:2px solid #6a6a6a;outline:none;color:#f8f8f8}.dialog_buttons button.secondary{background:inherit;color:#121212;border:2px solid #121212;outline:none}.dialog_buttons button.secondary:hover{background:#6a6a6a;border:2px solid #6a6a6a;outline:none;color:#f8f8f8}.rate-page{background-color:#fff;color:#121212}.rate-page .rating-field{--rating-color-1: #cccccc;--rating-color-2: #e20074}.rate-page h1{font-weight:700}@media(min-width: 599px){.rate-page h1{font-weight:700}}.rate-page h2{font-weight:400}@media(min-width: 599px){.rate-page h2{font-weight:400}}.rate-page_check{margin-top:0}.rating-field svg{fill:var(--rating-color-1)}.rate-form legend{width:100%}.rate-form h1{color:#121212;font-weight:700}.rate-form textarea{border:1px solid #6a6a6a;border-radius:4px}.rate-form textarea::placeholder{font-weight:400;color:#6a6a6a}.rate-form_submit{width:100%}.rate-form_submit button{width:100%;height:48px;background:#e20074;border-radius:4px;font-weight:590;color:#fff}.rate-form_submit button:hover{background:#a7005a;border:#a7005a;outline:#a7005a;color:#f5f5f5}.rate-form_submit button:disabled{opacity:1;background-color:#f5f5f5;color:#8c8c8c}.icon-button.close-rating{color:#8c8c8c}.confirmation-icon svg{height:32px;width:32px}@media(min-width: 599px){.confirmation-icon svg{height:38px;width:38px}}.chat-messages .inline-button-group>button{box-sizing:border-box;flex-direction:row;align-items:center;gap:8px;height:48px;min-height:48px;border:2px solid #121212 !important;background:#fff !important;color:#121212 !important;padding:8px 0 !important}.chat-messages .inline-button-group>button:first-child{border-top-left-radius:4px !important;border-top-right-radius:4px !important}.chat-messages .inline-button-group>button:last-child{border-bottom-left-radius:4px !important;border-bottom-right-radius:4px !important}.chat-messages .inline-button-group>button:hover{outline:none;background:#6a6a6a !important;border:2px solid #6a6a6a !important;color:#f8f8f8 !important}@media(min-width: 599px){.chat-messages .inline-button-group>button{padding:14px 8px}}.chat-messages button.sticky-button{background:#000;color:#fff;border:2px solid #121212;outline:none;border-radius:4px;display:flex;flex-direction:row;justify-content:center;align-items:center}.dropdown-menu{font-size:initial}.rate-page_transcript button{color:#121212;background:none}.rate-page_transcript button:hover{color:#e20074}.rate-page_transcript button:disabled{color:#8c8c8c}",""]);const s=r},645:e=>{"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var i="",a=void 0!==t[5];return t[4]&&(i+="@supports (".concat(t[4],") {")),t[2]&&(i+="@media ".concat(t[2]," {")),a&&(i+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),i+=e(t),a&&(i+="}"),t[2]&&(i+="}"),t[4]&&(i+="}"),i})).join("")},t.i=function(e,i,a,o,n){"string"==typeof e&&(e=[[null,e,void 0]]);var r={};if(a)for(var s=0;s0?" ".concat(d[5]):""," {").concat(d[1],"}")),d[5]=n),i&&(d[2]?(d[1]="@media ".concat(d[2]," {").concat(d[1],"}"),d[2]=i):d[2]=i),o&&(d[4]?(d[1]="@supports (".concat(d[4],") {").concat(d[1],"}"),d[4]=o):d[4]="".concat(o)),t.push(d))}},t}},81:e=>{"use strict";e.exports=function(e){return e[1]}},238:function(e,t,i){var a;!function(o,n){"use strict";var r="function",s="undefined",c="object",l="string",d="major",p="model",h="name",b="type",u="vendor",g="version",w="architecture",m="console",f="mobile",x="tablet",v="smarttv",y="wearable",k="embedded",_="Amazon",C="Apple",S="ASUS",A="BlackBerry",M="Browser",T="Chrome",E="Firefox",L="Google",j="Huawei",O="LG",R="Microsoft",I="Motorola",N="Opera",U="Samsung",z="Sharp",V="Sony",P="Xiaomi",H="Zebra",q="Facebook",D="Chromium OS",B="Mac OS",J=" Browser",W=function(e){for(var t={},i=0;i0?2===s.length?typeof s[1]==r?this[s[0]]=s[1].call(this,d):this[s[0]]=s[1]:3===s.length?typeof s[1]!==r||s[1].exec&&s[1].test?this[s[0]]=d?d.replace(s[1],s[2]):n:this[s[0]]=d?s[1].call(this,d,s[2]):n:4===s.length&&(this[s[0]]=d?s[3].call(this,d.replace(s[1],s[2])):n):this[s]=d||n;p+=2}},X=function(e,t){for(var i in t)if(typeof t[i]===c&&t[i].length>0){for(var a=0;a2&&(e[p]="iPad",e[b]=x),e},this.getEngine=function(){var e={};return e[h]=n,e[g]=n,G.call(e,a,v.engine),e},this.getOS=function(){var e={};return e[h]=n,e[g]=n,G.call(e,a,v.os),y&&!e[h]&&m&&m.platform&&"Unknown"!=m.platform&&(e[h]=m.platform.replace(/chrome os/i,D).replace(/macos/i,B)),e},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 a},this.setUA=function(e){return a=typeof e===l&&e.length>500?Z(e,500):e,this},this.setUA(a),this};Q.VERSION="1.0.39",Q.BROWSER=W([h,g,d]),Q.CPU=W([w]),Q.DEVICE=W([p,u,b,m,f,v,x,y,k]),Q.ENGINE=Q.OS=W([h,g]),typeof t!==s?(e.exports&&(t=e.exports=Q),t.UAParser=Q):i.amdO?(a=function(){return Q}.call(t,i,t,e))===n||(e.exports=a):typeof o!==s&&(o.UAParser=Q);var ee=typeof o!==s&&(o.jQuery||o.Zepto);if(ee&&!ee.ua){var te=new Q;ee.ua=te.getResult(),ee.ua.get=function(){return te.getUA()},ee.ua.set=function(e){te.setUA(e);var t=te.getResult();for(var i in t)ee.ua[i]=t[i]}}}("object"==typeof window?window:this)},899:(e,t,i)=>{"use strict";i.r(t),i.d(t,{performSilentAuthForAtlas:()=>r,performSilentAuthForChatStart:()=>n});var a=i(205);const{httpPopPost:o}=i(602),n=async e=>s({clientId:"VA_CVA_CHAT",redirectUri:"https://localhost",scope:"MISSING_ENV_VAR".CHAT_IAM_CLIENT_SCOPE},e),r=async e=>s({clientId:"Atlas_CC",redirectUri:"https://localhost",scope:"MISSING_ENV_VAR".ATLAS_IAM_CLIENT_SCOPE},e),s=async(e,t)=>((0,a.cM)("Returning a fake auth code."),"not-a-real-auth-code")},186:(e,t,i)=>{"use strict";i.r(t),i.d(t,{getSignedAuthJwt:()=>n,getSignedAuthJwt_Backup:()=>r,getSignedAuthJwt_Primary:()=>s});var a=i(602),o=i(205);const n=async(e,t,i)=>r(),r=async()=>{try{const e=document.cookie.match("(^|;)\\s*id_token\\s*=\\s*([^;]+)")?.pop()||"",t=await fetch("https://www.t-mobile.com/self-service-flex/v1/cobrowse/signing-token",{method:"POST",headers:{accept:"application/json",authorization:"Bearer "+e,"content-type":"application/json"},body:"{}"}),i=await t.json(),{token:a}=i;if(!a)throw new Error("Token missing in response from the signing api.");return(0,o.cM)("Successfully called the signing api."),a}catch(e){return void(0,o.cM)(`[ERROR] Failed signing auth token: ${e}`,o.pn)}},s=async(e,t,i)=>{let n=new Map;n.set("Content-Type","application/json");const r={key:"value"};try{const e=await(0,a.httpPopPost)("https://ccvado-ccaip-signing-api.prd01.aedge.adn-gw.t-mobile.com/ccvado-ccaip-signing-api/dev01/v1/ccaip-signing-api/token",n,r,"https://api.t-mobile.com/oauth2/v6/tokens","dqcJHdtEXs5mCtvbohXZbjc6RB7Js4jG"),t=await e.json(),{token:i}=t;if(!i)throw new Error("Token missing in response from the signing api.");return(0,o.cM)("Successfully called the signing api."),i}catch(e){return void(0,o.cM)(`[ERROR] Failed signing auth token: ${e}`,o.pn)}}},93:(e,t,i)=>{"use strict";i.r(t);var a=i(602),o=i(205);const{performSilentAuthForChatStart:n}=i(899),{getSignedAuthJwt:r}=i(186),{getCachedJWT:s,persistJwt:c}=i(697),l=async()=>{(0,o.cM)("Getting auth token.");const e=s();if(e)return(0,o.cM)("Using cached JWT"),e;const t=crypto.randomUUID(),i=await n(t);if(!i)return void(0,o.cM)("[ERROR] Not calling signing api because auth code is missing.",o.pn);const a=await r(i,t,{});return c(a),(0,o.cM)("Successfully received an auth token."),a};var d=i(238);const p=()=>{let e={customerId:""};try{const t=(e=>{const t=decodeURIComponent(document.cookie).split(";");for(let i=0;i{let t=p(),i=(()=>{const e=(new d.UAParser).getResult(),t=e.browser.name+" "+e.browser.version,i=e.os.name+" "+e.os.version,a="mobile"===e.device.type?"Mobile":"Desktop",o=(e.device.vendor||"Android"!==e.os.name?e.device.vendor:e.os.name)??"";return{userAgent:window.navigator.userAgent,browser:t,browserName:e.browser.name,browserVersion:e.browser.version,os:i,osName:e.os.name,osVersion:e.os.version,deviceType:a,device:o,language:window.navigator.language}})(),a=(()=>{let e={isp:"",ip:"",country:"",region:"",city:"",postal:""};const t=sessionStorage.getItem("IPC");if(t){const i=JSON.parse(t);i&&(e.isp=i.isp??"",e.ip=i.ip??"",e.country=i.country??"",e.region=i.region??"",e.city=i.city??"",e.postal=i.postal??"")}return e})(),o=e?.VERSION??"";return{customData:{customerId:{label:"Customer ID",value:t.customerId,invisible_to_agent:!1},webUrl:{label:"Web URL",value:window.location.href,invisible_to_agent:!1},webPageName:{label:"Web Page",value:document.title,invisible_to_agent:!1},publicIpAddress:{label:"IP Address",value:a.ip,invisible_to_agent:!1},browser:{label:"Browser",value:i.browser,invisible_to_agent:!1},os:{label:"OS",value:i.os,invisible_to_agent:!1},device:{label:"Device",value:i.device,invisible_to_agent:!1},deviceType:{label:"Device Type",value:i.deviceType,invisible_to_agent:!1},navigatorUserAgent:{label:"Navigator User Agent",value:i.userAgent,invisible_to_agent:!1},language:{label:"Language",value:i.language,invisible_to_agent:!1},webSdkVersion:{label:"Web SDK Version",value:o,invisible_to_agent:!1},country:{label:"Country",value:a.country,invisible_to_agent:!1},region:{label:"Region",value:a.region,invisible_to_agent:!1},city:{label:"City",value:a.city,invisible_to_agent:!1},postal:{label:"Postal Code",value:a.postal,invisible_to_agent:!1},isp:{label:"ISP",value:a.isp,invisible_to_agent:!1}}}};var b=i(619);const u=(e,t)=>{const i=document.createElement("style");i.textContent=t,e.shadowRoot.appendChild(i)};var g=i(90);const w={en:{home:{start:"",support:"",minimize:"TAP TO MINIMIZE"},menu:{deflectionAfterhourMessage:"You have reached us after hours or agents are busy assisting other customers. Self-service options are available at https://t-mobile.com/support or look for the chat icon on https:/www.t-mobile.com/contact-us or the T-Life App, between 4 am to 12 pm PST.",greeting:"",channelsMessage:"",queueMessage:""},channel:{chat:"",selectChat:""},chat:{startMessage:"Welcome to T-Mobile, home of the largest 5G network in America!",endButton:"End chat",inputPlaceholder:"Type your message here",withMultipleAgents:"Chatting with Multiple Agents",dismissedHint:"We have not heard from you in a while. If you still need assistance, click below to continue chatting."},event:{chatDismissed:"We have not heard from you in a while. If you still need assistance, click below to continue chatting."},rating:{formTitle:"Rate Your Experience",formFeedback:"Anything else to share? [optional]",resultTitle:"Thank you!",resultSubtitle:"Feedback only makes us stronger"},deflection:{closed:"You have reached us after hours or agents are busy assisting other customers. Self-service options are available at https://t-mobile.com/support or look for the chat icon on https:/www.t-mobile.com/contact-us or the T-Life App, between 4 am to 12 pm PST."}}},m=()=>{const e=new UJET({companyId:"169082303299086280fbccd387b802fbc",host:"https://ccaip-prd-1-oqoazyb.uw1.ccaiplatform.com",authenticate:async()=>({token:await l()})});e.config({menuKey:"prd-web-consumer-steering-direct-access-point",preferredChannel:"chat",accent:"#e20074",disableLauncher:!0,cobrowse:{license:"Z1os2788gKMTxA",trustedOrigins:"https://www.t-mobile.com/".split(","),api:"https://ccaip-prd-1-oqoazyb.cobrowse.uw1.ccaiplatform.com"},logo:"https://secure.message.t-mobile.com/msg/v1/static-assets/generic-avatar-messaging.png",messages:w});let t=(e=>h(e))(e);e.config(t),window.UJETTarget=e;const i=new Event("ujetInitialized");window.dispatchEvent(i);e.on("chat.updated",(e=>{(0,o.cM)("Test Chat log",e)}));const a=(e=>{const t=document.createElement("div");return t.id="ujet-widget",t.style.position="fixed",t.style.zIndex="9999",document.body.appendChild(t),e.mount(t),t})(e);return u(a,g.Z),e},f=e=>{if(0===e.length)return"";if(1===e.length)return e[0];const t=e.pop();let i=e.join(", ")+" & "+t;return i.length>12&&(i=i.slice(0,9)+"..."),i};function x(e){localStorage.setItem("ongoingChat",JSON.stringify(e))}function v(){return JSON.parse(localStorage.getItem("ongoingChat"))||!1}var y=i(899);const k="open-btn",_=Object.freeze({OPEN:"open",CLOSE:"close"});class C extends HTMLElement{constructor(){super(),this.ujet=m(),this.setupEventListeners(),this._state={chat:null,isUjetReady:!1,type:_.CLOSE,hasUnseenMessage:!1,isUjetWindowLoading:!1},this.setUpClickHandler=this.setUpClickHandler.bind(this),this.setUpClickHandler(),this.attachShadow({mode:"open"}),this.createElementsContainer()}setState(e,t){this._state[e]!==t&&(this._state={...this._state,[e]:t},this.render())}updateChat(e){if((0,o.cM)("updateChat"),e&&e.state){const t="finished"===e.state.status?null:{all_agents:e.state.all_agents,all_virtual_agents:e.state.all_virtual_agents,status:e.state.status};this.setState("chat",t)}else this.setState("chat",null)}connectedCallback(){this.render()}attributeChangedCallback(e,t,i){this.setState(e,i)}createElementsContainer(){const e=document.createElement("div");this.shadowRoot.appendChild(e),this.containerDiv=e}updateAriaProps(){const e=document.getElementById("ujet-widget").shadowRoot.querySelector(".ujet-avatar");e&&(e.ariaHidden=!0)}handleUjetOnVisible(){this.updateAriaProps()}setUpClickHandler(){document.addEventListener("click",(e=>{e.target&&e.target.id===M&&(this._state.type==_.OPEN?this.ujet.hide():(this.setState("isUjetWindowLoading",!0),this.ujet.show()))}),!0)}setupEventListeners(){const e=this.ujet.client;this.ujet.on("ready",(()=>{this.setState("isUjetReady",!0)})),this.ujet.on("visible",(e=>{this.setState("isUjetWindowLoading",!1),e?(this.setState("hasUnseenMessage",!1),this.setState("type",_.OPEN),setTimeout((()=>{this.handleUjetOnVisible()}))):this.setState("type",_.CLOSE)})),this.ujet.on("chat.updated",(e=>{(0,o.cM)("chat.updated"),(0,o.cM)(e)})),e.on("chat.message",(()=>{this._state.type==_.CLOSE&&this.setState("hasUnseenMessage",!0)})),e.on("chat.memberJoined",(e=>{(0,o.cM)(e);const t=e.match(/virtual_agent-(\d+)-/);if(t){const e=t[1];(0,o.cM)(`Virtual Agent joined: ${e}`);if(e==="36"){const e=crypto.randomUUID();(0,y.performSilentAuthForAtlas)(e)}}else(0,o.cM)("No virtual agent found")})),e.on("chat.connected",(()=>{window._taq.push(["trackEvent",{"cdl.page.interaction.vendorName":"Jarvis Web Chat","cdl.page.interaction.pageEvent":"chatEngaged"}]),(0,o.cM)("CCAAS: first engagement started, analytics logged.")})),e.on("chat.memberLeft",(e=>{(0,o.cM)(e)})),e.on("chat.ongoing",(e=>{(0,o.cM)("chat.ongoing"),(0,o.cM)(e),this.updateChat(e),x(!0)})),e.on("chat.updated",(e=>{(0,o.cM)("chat.updated"),(0,o.cM)(e),this.updateChat(e),e&&"finished"!==e.state.status&&x(!0)})),e.on("chat.ended",(()=>{(0,o.cM)("ended"),this.updateChat(null),x(!1)})),e.on("chat.dismissed",(()=>{(0,o.cM)("dismissed")})),e.on("chat.disconnected",(()=>{(0,o.cM)("disconnected"),this.updateChat(null),x(!1)}))}getDefaultChatHTML(){return this._state.isUjetWindowLoading?`\n \n `}getActiveChatHTML(){const e=this._state.hasUnseenMessage?'
':"",t=(e=>{if(e){if(e.all_agents&&e.all_agents.length>0){const t=e.all_agents.map((e=>e.name));return f(t)}if(e.all_virtual_agents&&e.all_virtual_agents.length>0){const t=e.all_virtual_agents.map((e=>e.name));return f(t)}}return"Virtual Assistant"})(this._state.chat),i=this._state.hasUnseenMessage?`New message. Show chat with ${t}`:`Show chat with ${t}`;return`\n \n \n \n \n ${e}\n ${t}\n \n \n \n \n `}getCloseButtonHTML(){return'\n \n '}render(){if(!this._state.isUjetReady)return;(0,o.cM)("rendering "),(0,o.cM)(this._state);const e="true"===this.getAttribute("restricted-page-ongoing-chat");if(this._state.type===_.OPEN)this.containerDiv.innerHTML=this.getCloseButtonHTML();else{this.containerDiv.innerHTML=this._state.chat?this.getActiveChatHTML():e?"":this.getDefaultChatHTML();this.containerDiv.querySelectorAll(".fab-open.fab-open-default").forEach((e=>{e.addEventListener("click",(()=>{window._taq.push(["trackEvent",{"cdl.page.interaction.vendorName":"Jarvis Web Chat","cdl.page.interaction.pageEvent":"chatClicked"}]),(0,o.cM)("CCAAS: open button clicked, analytics logged.")}))}))}}}const S=C;var A=i(264);const M="ccaas-fab-widget",T=(e=!0)=>{customElements.define("ccaas-fab",S);const t=document.createElement("ccaas-fab");if(t.id=M,t.className=M,!e){v()?((0,o.cM)("CCAAS: Ongoing chat found. Showing the chat icon."),t.setAttribute("restricted-page-ongoing-chat","true")):((0,o.cM)("CCAAS: Disable conditions set, no ongoing chat found. Hiding the chat icon."),t.style.display="none")}return document.body.appendChild(t),u(t,A.Z),t};(()=>{const e=document.createElement("style");e.textContent=b.Z,document.body.appendChild(e)})();const E=!!"MISSING_ENV_VAR".IS_LOCAL;"prod"!=="prod".toLowerCase()&&console.log("%c CCAAS v1.4.6","color: #e20074; font-size: 16px; background-color: lightgray; padding: 4px; border-radius: 5px;");((e,t)=>{const i=document.createElement("script");i.src=e,i.type="text/javascript",i.async=!0,i.onload=t,i.onerror=()=>{(0,o.cM)("Error loading script:",o.pn),(0,o.cM)(e,o.pn)},document.head.appendChild(i)})("https://websdk.ujet.co/v3/widget.js",(()=>{L()}));const L=()=>{E?R():j((e=>{e?(!0===v()&&(window.lpTag.section.push("suppressChat"),(0,o.cM)("CCAAS: ongoing chat detected, disabling Liveperson chat",o.H_)),setTimeout((()=>{O()}),5e3)):((0,o.cM)("CCAAS: lpTag not detected, initializing UJET with default configuration",o.u_),R())}))},j=(e,t=100,i=1e4)=>{const a=(new Date).getTime(),o=()=>{window.lpTag&&window.lpTag.section?e(!0):(new Date).getTime()-a{let e=!0;if("undefined"!=typeof lpTag&&lpTag.chatStateVars){const{current:t}=lpTag.chatStateVars;t&&""!==t&&"ended"!==t&&((0,o.cM)("CCAAS: LP Chat ongoing chat detected, disabling CCAAS chat bubble"),e=!1)}else(0,o.cM)("CCAAS: lpTag.chatStateVars is not available, proceeding with default UJET initialization",o.pn);R(e)},R=(e=!0)=>{if(e&&function(){const e=window.location.href,t="https://www.t-mobile.com/devices/tech-gifts?MessagingTeamTest,https://www.t-mobile.com/orders/check-order?MessagingTeamTest".split(","),i=1===t.filter((t=>e===t)).length;return i?(0,o.cM)("URL is in allowlist"):(0,o.cM)(`URL is not in allowlist, CCAAS chat disabled. URL=${e} ENABLED_PAGES=${t}`),i}()&&(navigator.language||navigator.userLanguage).toLowerCase().startsWith("en")){const e="https://api.t-mobile.com/oauth2/v6/tokens",t="dqcJHdtEXs5mCtvbohXZbjc6RB7Js4jG",i="https://adn.t-mobile.com/ccaiva-msg-ccaip-proxy/prd06/msg/v1/ccaip-proxy/chat-availability";(0,a.httpPopGet)(i,new Map,e,t).then((e=>{if(200!==e.status)throw new Error(`HTTP Error: ${e.status}`);return e.json()})).then((e=>{const t=e.lowWaitTimes&&e.inOperationHours&&e.webEnabled;T(t)})).catch((e=>{(0,o.cM)(`Failed to determine chat availability status. The Chat icon will be disabled. ERROR=${e}`,o.pn),T(!1)}))}else T(!1)}},697:(e,t,i)=>{"use strict";i.r(t),i.d(t,{getCachedJWT:()=>r,persistJwt:()=>s});var a=i(205);const o="cached_jwt",n="jwt_expiry",r=()=>{const e=localStorage.getItem(o),t=localStorage.getItem(n);if(e&&t){const i=Math.floor(Date.now()/1e3),r=new Date(1e3*i),s=new Date(1e3*parseInt(t,10));if((0,a.cM)(`Current time: ${r.toISOString()}, Token expiry: ${s.toISOString()}`),i{const t=(e=>{const t=e.split(".")[1].replace(/-/g,"+").replace(/_/g,"/"),i=decodeURIComponent(atob(t).split("").map((function(e){return"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)})).join(""));return JSON.parse(i)})(e),i=t.exp;if(!i)throw(0,a.cM)("Expiry missing in JWT"),new Error("Invalid expiry in JWT");((e,t)=>{localStorage.setItem(o,e),localStorage.setItem(n,t.toString()),(0,a.cM)(`Cached JWT set. Expiry: ${t}`)})(e,i)}}},e=>(e.O(0,[898],(()=>{return t=93,e(e.s=t);var t})),e.O())])));