@telia-ace/ace-chat-flamingo 1.1.123-rc.13 → 1.1.123-rc.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +1 -1
- package/index.mjs +146 -136
- package/package.json +3 -3
- package/provider.d.ts +1 -0
package/index.js
CHANGED
|
@@ -2239,4 +2239,4 @@ Please report this to https://github.com/markedjs/marked.`,n){const i="<p>An err
|
|
|
2239
2239
|
border: 1px solid var(--border-color-medium);
|
|
2240
2240
|
box-sizing: border-box;
|
|
2241
2241
|
}
|
|
2242
|
-
`];let en=Xs;hp([de({context:ae}),k({attribute:!1})],en.prototype,"application");window.customElements.get("ace-video-iframe")||window.customElements.define("ace-video-iframe",en);class Ts extends wc{constructor(e,t){var i,s,r,o,a,c;super(e,t),this.pendingMessages=[],this.texts=this.component.application.texts,this.headerComponent=this.component.application.getComponent("widget-header"),this.isThirdPartyParticipant=this.component.properties.chat.isThirdPartyWidget,this.agent=this.createAgent(((i=this.component.application.storage.get("agentInfo"))==null?void 0:i.name)||""),this.user=this.createUser(((s=this.component.application.storage.get("userInfo"))==null?void 0:s.name)||""),this.params=new URLSearchParams(document.location.search),this.invitationUid=this.params.get("invitationUid"),this.customerName=this.params.get("customerName")||void 0,this.idHubUrl="https://idhub.dev-se.telia-ck8s.com/idhub-gateway/public",this.disconnected$=new P,this.agentUsername=null,this.conversationOption=null,this._conversationOptions={},this.sessionId=null,this.contactId=null,this.errand=null,this.entrance=null,this.guestId=null,this.chatOverlayActive=!1,this.inVideoCall=!1,this.onQueueStatusReceived=l=>{this.setQueueStatus(l.text||null)},this.onEstablished=l=>{this.contactId=l.contactId,this.errand=l.errand,this.entrance=l.entrance,this.agentUsername=l.agentUsername;const u={contactId:this.contactId,errand:this.errand,entrance:this.entrance,agentUsername:this.agentUsername};this.save({survey:u}),this.setQueueStatus(null),this.agent.name=l.agentAlias,this.component.application.storage.set("agentInfo",{name:this.agent.name}),l.videoEnded&&this.removeVideo()},this.onPrepareVideo=()=>{this.showVideoConfirmDialog()},this.onVideoPrepared=l=>{this.showVideoIFrame(l.userUrl)},this.onChatButtonClicked=l=>{this.showChatOverVideo(l.guestId)},this.onEndVideoButtonClicked=l=>{this.guestId&&(l==null?void 0:l.guestId)===this.guestId&&this.removeVideo()},this.onPenStatusChange=l=>{l.penStatus==="on"?this.setTypingState(!0):this.setTypingState(!1)},this.onChatEnded=async l=>{var p,d;this.shouldUseAuth&&this.endAuthenticatedSession(),this.setToastMessage(null),this.setTypingState(!1),this.videoConfirmDialogEntry&&this.videoConfirmDialogEntry.remove(),this.component.disableInput(),l.showForm&&this.showConversationEndedForm();const u=this.component.application.settings;(p=u==null?void 0:u.survey)!=null&&p.shouldUseSurvey&&((d=u==null?void 0:u.survey)!=null&&d.surveyBaseUrl)&&this.showSurvey(),this.isThirdPartyParticipant?this.removeHeaderOptions():this.setStartNewChatOption(),this.complete()},this.properties=t.properties,this.shouldUseAuth=(o=(r=this.component.application.settings)==null?void 0:r.auth)==null?void 0:o.shouldUseAuth,this.idHubEidType=(c=(a=this.component.application.settings)==null?void 0:a.auth)==null?void 0:c.idHubEidType.toLowerCase()}connect(e={}){super.connect(),this.setupAuthenticationListeners(),this._conversationOptions=e;const t={...this.properties.chat??{},...e},i=!!this.sessionId;if(!i){const r=Ki();this.setSessionId(r)}this.save({chatSessionId:this.sessionId}),this.engine=new Gd(t,this.sessionId),this.engine.messages().subscribe(r=>{switch(r.source){case"agent":this.printAgent(r.text);break;case"customer":this.clearPendingMessages(),this.isThirdPartyParticipant?r.source==="customer"&&r.invitationNo==="0"?this.printAgent(r.text,r.alias):this.printUser(r.text):r.source==="customer"&&Number(r.invitationNo)>0?this.printAgent(r.text,r.alias):this.printUser(r.text);break;case"system":this.printSystem(r.text);break}}),this.engine.actions().pipe(z(this.disconnected$),J(Ud)).subscribe(this.onQueueStatusReceived),this.engine.actions().pipe(z(this.disconnected$),J(Dd)).subscribe(this.onEstablished),this.engine.actions().pipe(z(this.disconnected$),J(Hd)).subscribe(this.onPrepareVideo),this.engine.actions().pipe(z(this.disconnected$),J(jd)).subscribe(this.onVideoPrepared),this.engine.actions().pipe(z(this.disconnected$),J(Fd)).subscribe(this.onChatButtonClicked),this.engine.actions().pipe(z(this.disconnected$),J(Bd)).subscribe(this.onEndVideoButtonClicked),this.engine.actions().pipe(z(this.disconnected$),J(zd)).subscribe(this.onPenStatusChange),this.engine.actions().pipe(z(this.disconnected$),J(qd)).subscribe(this.onChatEnded),this.setHeaderOption();const s=this.component.application.trigger;s&&s.widgetActive$.pipe(z(s.componentIsDestroyed$)).subscribe(r=>{r&&(this.conversationOption=null,this.setHeaderOption())}),this.component.userTyping$.pipe(z(this.disconnected$)).subscribe(r=>{var o;(o=this.engine)==null||o.sendPenStatusOn(r)}),i?this.engine.rehydrate().then(r=>{var o;r?(o=this.engine)==null||o.reconnect().pipe(z(this.disconnected$)).subscribe({error:a=>{console.error("Failed to reconnect to the engine:",a)}}):this.initializeChat(t).catch(a=>{console.error("Failed to initialize chat during rehydration:",a)})}):this.initializeChat(t).catch(r=>{console.error("Failed to initialize chat:",r)})}disconnected(){super.disconnected(),this.disconnected$.next()}onUserSubmit(e){const t=this.printUser(e.text);t.setStatus("pending"),this.pendingMessages.push(t),(async()=>{var i;try{await((i=this.engine)==null?void 0:i.chatWrite(e.text))}catch(s){s instanceof Fn?t.setStatus("failed"):(t.setStatus("failed"),console.warn("Unhandled error:",s))}})()}save(e){this.component.stateMachine.session().pipe(Oe(t=>(t==null?void 0:t.data$)||tt),Ee(1)).subscribe(t=>{this.saveToCurrentSession$.next({...t,...e})})}async rehydrate(e){if(e.chatSessionId&&this.setSessionId(e.chatSessionId),e.survey&&(this.contactId=e.survey.contactId,this.errand=e.survey.errand,this.entrance=e.survey.entrance,this.agentUsername=e.survey.agentUsername),this.shouldUseAuth){const t=this.component.application.storage.get("auth");t!=null&&t.authenticated?this.component.setAuthenticationBannerStatus(ee.Authenticated):this.component.setAuthenticationBannerStatus(ee.NonAuthenticated)}}static getInstance(e,t){return t.providerInstance??(t.providerInstance=new Ts(e,t)),t.providerInstance}async initializeChat(e){this.shouldUseAuth&&this.idHubEidType?(this.component.setAuthenticationBannerStatus(ee.NonAuthenticated),this.setupIDHubAuth(),this.idHubClient&&await this.startAuthenticationFlow()):this.handleWelcomeForm(e)}setupAuthenticationListeners(){var e;this.shouldUseAuth&&this.headerComponent&&this.headerComponent.actions$&&((e=this.headerComponent)==null||e.actions$.pipe(J(t=>t.key==="start-auth"),z(this.disconnected$)).subscribe(t=>{t.key==="start-auth"&&this.handleAuthentication()}))}setupIDHubAuth(){var e;this.idHubClient=new Bt({...(e=this.component.application.settings)==null?void 0:e.auth,idHubUrl:this.idHubUrl})}async startAuthenticationFlow(){this.component.disableInput(),this.resetAuthState(ee.NonAuthenticated);const e=await this.idHubClient.auth();if(e.status===H.Error){this.printSystem(this.texts.getOrFallback("auth.setup.error-message","An error occurred while setting up authentication.")),this.headerComponent.showAuthOptions=!1;return}switch(this.idHubEidType){case Te.Tunnistus:if(!e.tunnistusURL){this.printSystem(this.texts.getOrFallback("auth.setup.tunnistus.url-error-message","Unable to retrieve the Tunnistus authentication URL.")),this.headerComponent.showAuthOptions=!1;return}this.authURL=e.tunnistusURL,this.headerComponent.authUrl=e.tunnistusURL,this.headerComponent.authState=ee.NonAuthenticated,this.authenticationCardEntry=this.showTunnistusAuthCard(Ze.Initial,e.tunnistusURL),this.authenticationCardEntry.actions$.pipe(J(t=>t.key==="start-auth"),Ee(1)).subscribe(()=>{this.handleAuthentication()});break;case Te.BankId:break}}async handleWelcomeForm(e,t){let i=!0;e.webApiUrl&&(i=await this.isEntranceOpen(e.webApiUrl,e.entrance)),i?this.customerName?(this.user.name=this.customerName,this.startChat({customerName:this.customerName,customData:{}},t)):this.showWelcomeForm(t):this.showEntranceClosedDialog()}startChat(e,t){if(!this.engine)return;const i=e.customData.errand??this.engine.config.defaultErrand;if(!i)throw new Error("Errand is required but was not configured");this.isThirdPartyParticipant?(this.component.application.root.style.visibility="visible",this.engine.chatJoin({invitationUid:this.invitationUid,customerName:this.customerName??e.customerName}).pipe(z(this.disconnected$)).subscribe()):this.engine.chatRequest({customerName:e.customerName,customerEmailAddress:e.customerEmailAddress??"",visitorQuestion:e.visitorQuestion??"",customData:e.customData,errand:i,...t&&{authToken:t}}).pipe(z(this.disconnected$)).subscribe(),this.component.enableInput(),this.component.enableSkipToLatestMessage(),this.setEndConversationOption()}restartNewChat(){this.engine&&(this.setSessionId(null),this.component.clearMessages(),this.removeHeaderOptions(),this.connect(this._conversationOptions))}setQueueStatus(e){this.setToastMessage(e)}async endConversation(){var e;this.shouldUseAuth&&this.resetAuthState(ee.ChatEnded),await((e=this.engine)==null?void 0:e.chatQuit())}async sendConversationEmail(e){var t;try{await((t=this.engine)==null?void 0:t.chatEmailSession(e)),this.printSystem(this.texts.getOrFallback("email-form.email-sent-label","An email with the conversation was sent."))}catch(i){this.printSystem(this.texts.getOrFallback("email-form.error-message","Unable to send email with the conversation.")),i instanceof Fn||console.warn("Unhandled error:",i)}}clearPendingMessages(){this.pendingMessages.forEach(e=>{e.remove()})}setSessionId(e){this.sessionId=e}async isEntranceOpen(e,t){var s;let i=!1;try{const r=await fetch(`${e}/1/entrances/${t}/is-open`),o=await r.json();r.ok?i=(s=o==null?void 0:o.resultData)==null?void 0:s.isOpen:console.log(`Problem when fetching open status for entrance ${t}:`,o==null?void 0:o.resultMessage)}catch(r){console.log(`Failed to fetch open status for ${t}:`,r)}return i}resetAuthState(e){this.headerComponent.authState=e,this.headerComponent.userName="",this.headerComponent.authUrl="",this.authURL="",this.component.application.storage.removeItem("auth")}async handleAuthentication(){var t,i,s,r;this.headerComponent.userName=this.texts.getOrFallback("widget-header.authenticating","Authenticating..."),this.headerComponent.authState=ee.Authenticating;const e=await this.idHubClient.collect();switch(this.authenticationCardEntry&&this.authenticationCardEntry.remove(),this.idHubEidType){case Te.Tunnistus:if(e.status===H.Error){this.headerComponent.userName=this.texts.getOrFallback("widget-header.not-authenticated","Not authenticated"),this.headerComponent.authState=ee.NonAuthenticated,this.authenticationCardEntry=this.showTunnistusAuthCard(Ze.Error,this.authURL);return}else if(e.status===H.Authenticated){const o=Wd(((t=e==null?void 0:e.idhubEIDToken)==null?void 0:t.split(".")[1])??""),a=JSON.parse(o),c=((s=(i=a==null?void 0:a.completionData)==null?void 0:i.user)==null?void 0:s.name)??"";this.headerComponent.userName=c,this.headerComponent.authState=ee.Authenticated,this.component.application.storage.set("auth",{name:c,authenticated:!0}),this.component.setAuthenticationBannerStatus(ee.Authenticated),(r=this.authenticationCardEntry)==null||r.remove(),this.handleWelcomeForm(this.engine.config,e.idhubEIDToken)}break;case Te.BankId:break}}printAgent(e,t=""){const i=t.length>0?this.agent.print(e,"markdown",t):this.agent.print(e,"markdown");return this.setTypingState(!1),i}printUser(e){const t=Ni(Or(e));return this.user.print(t)}printSystem(e){const t=Ni(Or(e));return this.system.print(t)}showSurvey(){const e=new ie(q.System,{name:""},[{items:[["ace-survey",{content:""},{agentUsername:this.agentUsername??"",entrance:this.entrance??this.engine.config.entrance,errand:this.errand??this.engine.config.defaultErrand,contactId:this.contactId??""}]]}]);this.printEntry(e)}showTunnistusAuthCard(e,t,i){const s=new ie(q.System,{name:""},[{items:[["ace-tunnistus-auth-card",{content:""},{state:e,tunnistusURL:t??"",errorMessage:i??""}]]}]);return this.printEntry(s),s}showWelcomeForm(e){this.component.disableInput(),this.component.disableSkipToLatestMessage();let t;this.isThirdPartyParticipant?t=new ie(q.System,{name:""},[{items:[["ace-welcome-form-third-party",{content:""}]]}]):t=new ie(q.System,{name:""},[{items:[["ace-welcome-form",{content:""}]]}]),this.printEntry(t),t.actions$.pipe(J(i=>i.key==="submitted"),Ee(1)).subscribe(i=>{t.remove(),this.user.name=i.data.name,this.component.application.storage.set("userInfo",{name:this.user.name}),this.startChat({customerName:i.data.name,customerEmailAddress:i.data.email,visitorQuestion:i.data.question,customData:i.data.customData},e)})}showEntranceClosedDialog(){this.component.disableInput();const e=new ie(q.System,{name:""},[{items:[["ace-entrance-closed-dialog",{content:""}]]}]);this.printEntry(e)}showQuitConfirmDialog(){var e;(e=this.quitConfirmDialogEntry)==null||e.remove(),this.quitConfirmDialogEntry=new ie(q.System,{name:""},[{items:[["ace-quit-confirm-dialog",{content:""}]]}]),this.printEntry(this.quitConfirmDialogEntry),this.quitConfirmDialogEntry.actions$.pipe(J(t=>t.key==="quit-chat"),Ee(1)).subscribe(t=>{var i,s,r,o;((i=t.data)==null?void 0:i.result)==="quit"?(this.endConversation(),(s=this.quitConfirmDialogEntry)==null||s.remove()):((r=t.data)==null?void 0:r.result)==="cancel"&&((o=this.quitConfirmDialogEntry)==null||o.remove())})}showConversationEndedForm(){const e=new ie(q.System,{name:""},[{items:[["ace-conversation-ended-form",{content:""}]]}]);this.printEntry(e),e.actions$.pipe(J(t=>t.key==="submitted"),Ee(1)).subscribe(t=>{e.remove(),t.data.email&&this.sendConversationEmail(t.data.email)})}showVideoConfirmDialog(){this.videoConfirmDialogEntry=new ie(q.System,{name:""},[{items:[["ace-video-confirm-dialog",{content:""}]]}]),this.printEntry(this.videoConfirmDialogEntry),this.videoConfirmDialogEntry.actions$.pipe(J(e=>e.key==="video-confirm"),Ee(1)).subscribe(e=>{var t;this.videoConfirmDialogEntry&&this.videoConfirmDialogEntry.remove(),e.data.result==="declined"&&(this.guestId=null),(t=this.engine)==null||t.videoPrepared(e.data.result),this.printSystem(e.data.text)})}showVideoIFrame(e){var i;this.guestId=Ki(),this.videoIFrameElement=new en(e,this.guestId);const t=this.component.application.root;(i=t==null?void 0:t.shadowRoot)==null||i.prepend(this.videoIFrameElement),this.inVideoCall=!0,this.setHeaderOption()}showChatOverVideo(e){this.guestId&&e===this.guestId&&(this.chatOverlayActive=!0,this.showChatOverlay$.next(this.chatOverlayActive))}async endAuthenticatedSession(){this.component.setAuthenticationBannerStatus(ee.NonAuthenticated),await this.engine.getChatStatus()==="noSession"?(this.resetAuthState(ee.NonAuthenticated),this.setSessionId(null),this.component.clearMessages(),this.shouldUseAuth&&this.startAuthenticationFlow()):this.endConversation()}removeVideo(){var e;(e=this.videoIFrameElement)==null||e.remove(),this.guestId=null,this.chatOverlayActive&&(this.chatOverlayActive=!1,this.showChatOverlay$.next(this.chatOverlayActive)),this.inVideoCall=!1,this.setHeaderOption()}addHeaderOptions(e,t,i,s,r=!0){const o=this.component.application.getComponent("widget-header");if(o)return this.conversationOption?(this.conversationOption.label=e,this.conversationOption.key=t,this.conversationOption.icon=i,this.conversationOption.onClick=s,this.conversationOption.enabled=r,o.requestUpdate(),this.conversationOption):o.addOption({label:e,icon:i,closeOnClick:!0,key:t,onClick:s,enabled:r})}removeHeaderOptions(){const e=this.component.application.getComponent("widget-header");e&&e.removeOption(this.conversationOption)}setStartNewChatOption(){this.conversationOption=this.addHeaderOptions(this.texts.getOrFallback("widget-header.start-new-chat","Start new chat"),"start-new-chat-button",sa.svg,()=>{this.restartNewChat()})}setEndConversationOption(){this.conversationOption=this.addHeaderOptions(this.texts.getOrFallback("widget-header.end-conversation","End conversation"),"end-conversation-button",us.svg,()=>{this.showQuitConfirmDialog()},!this.inVideoCall)}async setHeaderOption(){switch(await this.engine.getChatStatus()){case"finished":this.isThirdPartyParticipant?this.removeHeaderOptions():this.setStartNewChatOption();break;case"active":this.setEndConversationOption();break;case"noSession":this.conversationOption=null}}}const dp=async n=>{(await rs.getInstance(n.container)).registerProvider("ace-chat",t=>Ts.getInstance("ace-chat",t))};exports.ChatProviderPlugin=dp;
|
|
2242
|
+
`];let en=Xs;hp([de({context:ae}),k({attribute:!1})],en.prototype,"application");window.customElements.get("ace-video-iframe")||window.customElements.define("ace-video-iframe",en);class Ts extends wc{constructor(e,t){var i,s,r,o,a,c;super(e,t),this.pendingMessages=[],this.texts=this.component.application.texts,this.headerComponent=this.component.application.getComponent("widget-header"),this.isThirdPartyParticipant=this.component.properties.chat.isThirdPartyWidget,this.agent=this.createAgent(((i=this.component.application.storage.get("agentInfo"))==null?void 0:i.name)||""),this.user=this.createUser(((s=this.component.application.storage.get("userInfo"))==null?void 0:s.name)||""),this.params=new URLSearchParams(document.location.search),this.invitationUid=this.params.get("invitationUid"),this.customerName=this.params.get("customerName")||void 0,this.idHubUrl="https://idhub.dev-se.telia-ck8s.com/idhub-gateway/public",this.disconnected$=new P,this.agentUsername=null,this.conversationOption=null,this._conversationOptions={},this.sessionId=null,this.contactId=null,this.errand=null,this.entrance=null,this.guestId=null,this.chatOverlayActive=!1,this.inVideoCall=!1,this.onQueueStatusReceived=l=>{this.setQueueStatus(l.text||null)},this.onEstablished=l=>{this.contactId=l.contactId,this.errand=l.errand,this.entrance=l.entrance,this.agentUsername=l.agentUsername;const u={contactId:this.contactId,errand:this.errand,entrance:this.entrance,agentUsername:this.agentUsername};this.save({survey:u}),this.setQueueStatus(null),this.agent.name=l.agentAlias,this.component.application.storage.set("agentInfo",{name:this.agent.name}),l.videoEnded&&this.removeVideo()},this.onPrepareVideo=()=>{this.showVideoConfirmDialog()},this.onVideoPrepared=l=>{this.showVideoIFrame(l.userUrl)},this.onChatButtonClicked=l=>{this.showChatOverVideo(l.guestId)},this.onEndVideoButtonClicked=l=>{this.guestId&&(l==null?void 0:l.guestId)===this.guestId&&this.removeVideo()},this.onPenStatusChange=l=>{l.penStatus==="on"?this.setTypingState(!0):this.setTypingState(!1)},this.onChatEnded=async l=>{var p,d;this.shouldUseAuth&&this.endAuthenticatedSession(),this.setToastMessage(null),this.setTypingState(!1),this.videoConfirmDialogEntry&&this.videoConfirmDialogEntry.remove(),this.component.disableInput(),l.showForm&&this.showConversationEndedForm();const u=this.component.application.settings;(p=u==null?void 0:u.survey)!=null&&p.shouldUseSurvey&&((d=u==null?void 0:u.survey)!=null&&d.surveyBaseUrl)&&this.showSurvey(),this.isThirdPartyParticipant?this.removeHeaderOptions():this.setStartNewChatOption(),this.complete()},this.properties=t.properties,this.shouldUseAuth=(o=(r=this.component.application.settings)==null?void 0:r.auth)==null?void 0:o.shouldUseAuth,this.idHubEidType=(c=(a=this.component.application.settings)==null?void 0:a.auth)==null?void 0:c.idHubEidType.toLowerCase()}connect(e={}){super.connect(),this.setupAuthenticationListeners(),this._conversationOptions=e;const t={...this.properties.chat??{},...e},i=!!this.sessionId;if(!i){const r=Ki();this.setSessionId(r)}this.save({chatSessionId:this.sessionId}),this.engine=new Gd(t,this.sessionId),this.engine.messages().subscribe(r=>{switch(r.source){case"agent":this.printAgent(r.text);break;case"customer":this.clearPendingMessages(),this.isThirdPartyParticipant?r.source==="customer"&&r.invitationNo==="0"?this.printAgent(r.text,r.alias):this.printUser(r.text):r.source==="customer"&&Number(r.invitationNo)>0?this.printAgent(r.text,r.alias):this.printUser(r.text);break;case"system":this.printSystem(r.text);break}}),this.engine.actions().pipe(z(this.disconnected$),J(Ud)).subscribe(this.onQueueStatusReceived),this.engine.actions().pipe(z(this.disconnected$),J(Dd)).subscribe(this.onEstablished),this.engine.actions().pipe(z(this.disconnected$),J(Hd)).subscribe(this.onPrepareVideo),this.engine.actions().pipe(z(this.disconnected$),J(jd)).subscribe(this.onVideoPrepared),this.engine.actions().pipe(z(this.disconnected$),J(Fd)).subscribe(this.onChatButtonClicked),this.engine.actions().pipe(z(this.disconnected$),J(Bd)).subscribe(this.onEndVideoButtonClicked),this.engine.actions().pipe(z(this.disconnected$),J(zd)).subscribe(this.onPenStatusChange),this.engine.actions().pipe(z(this.disconnected$),J(qd)).subscribe(this.onChatEnded),this.setHeaderOption();const s=this.component.application.trigger;s&&s.widgetActive$.pipe(z(s.componentIsDestroyed$)).subscribe(r=>{r&&(this.conversationOption=null,this.setHeaderOption())}),this.component.userTyping$.pipe(z(this.disconnected$)).subscribe(r=>{var o;(o=this.engine)==null||o.sendPenStatusOn(r)}),i?this.engine.rehydrate().then(r=>{var o;r?(o=this.engine)==null||o.reconnect().pipe(z(this.disconnected$)).subscribe({error:a=>{console.error("Failed to reconnect to the engine:",a)}}):this.initializeChat(t).catch(a=>{console.error("Failed to initialize chat during rehydration:",a)})}):this.initializeChat(t).catch(r=>{console.error("Failed to initialize chat:",r)})}disconnected(){super.disconnected(),this.disconnected$.next()}onUserSubmit(e){const t=this.printUser(e.text);t.setStatus("pending"),this.pendingMessages.push(t),(async()=>{var i;try{await((i=this.engine)==null?void 0:i.chatWrite(e.text))}catch(s){s instanceof Fn?t.setStatus("failed"):(t.setStatus("failed"),console.warn("Unhandled error:",s))}})()}save(e){this.component.stateMachine.session().pipe(Oe(t=>(t==null?void 0:t.data$)||tt),Ee(1)).subscribe(t=>{this.saveToCurrentSession$.next({...t,...e})})}async rehydrate(e){if(e.chatSessionId&&this.setSessionId(e.chatSessionId),e.survey&&(this.contactId=e.survey.contactId,this.errand=e.survey.errand,this.entrance=e.survey.entrance,this.agentUsername=e.survey.agentUsername),this.shouldUseAuth){const t=this.component.application.storage.get("auth");t!=null&&t.authenticated?this.component.setAuthenticationBannerStatus(ee.Authenticated):this.component.setAuthenticationBannerStatus(ee.NonAuthenticated)}}static getInstance(e,t){return t.providerInstance??(t.providerInstance=new Ts(e,t)),t.providerInstance}async initializeChat(e){this.shouldUseAuth&&this.idHubEidType?(this.component.setAuthenticationBannerStatus(ee.NonAuthenticated),this.setupIDHubAuth(),this.idHubClient&&await this.startAuthenticationFlow()):this.handleWelcomeForm(e)}setupAuthenticationListeners(){var e;this.shouldUseAuth&&this.headerComponent&&this.headerComponent.actions$&&((e=this.headerComponent)==null||e.actions$.pipe(J(t=>t.key==="start-auth"),z(this.disconnected$)).subscribe(t=>{t.key==="start-auth"&&this.handleAuthentication()}))}setupIDHubAuth(){var e;this.idHubClient=new Bt({...(e=this.component.application.settings)==null?void 0:e.auth,idHubUrl:this.idHubUrl})}async startAuthenticationFlow(){this.component.disableInput(),this.resetAuthState(ee.NonAuthenticated);const e=await this.idHubClient.auth();if(e.status===H.Error){this.printSystem(this.texts.getOrFallback("auth.setup.error-message","An error occurred while setting up authentication.")),this.headerComponent.showAuthOptions=!1;return}switch(this.idHubEidType){case Te.Tunnistus:if(!e.tunnistusURL){this.printSystem(this.texts.getOrFallback("auth.setup.tunnistus.url-error-message","Unable to retrieve the Tunnistus authentication URL.")),this.headerComponent.showAuthOptions=!1;return}this.authURL=e.tunnistusURL,this.headerComponent.authUrl=e.tunnistusURL,this.headerComponent.authState=ee.NonAuthenticated,this.authenticationCardEntry=this.showTunnistusAuthCard(Ze.Initial,e.tunnistusURL),this.authenticationCardEntry.actions$.pipe(J(t=>t.key==="start-auth"),Ee(1)).subscribe(()=>{this.handleAuthentication()});break;case Te.BankId:break}}async handleWelcomeForm(e,t){let i=!0;if(e.webApiUrl)try{i=await this.isEntranceOpen(e.webApiUrl,e.entrance)}catch(s){console.error("Error checking entrance status:",s),i=!1}i?this.customerName?(this.user.name=this.customerName,this.startChat({customerName:this.customerName,customData:{}},t)):this.showWelcomeForm(t):this.showEntranceClosedDialog()}startChat(e,t){if(!this.engine)return;const i=e.customData.errand??this.engine.config.defaultErrand;if(!i)throw new Error("Errand is required but was not configured");this.isThirdPartyParticipant?(this.component.application.root.style.visibility="visible",this.engine.chatJoin({invitationUid:this.invitationUid,customerName:this.customerName??e.customerName}).pipe(z(this.disconnected$)).subscribe()):this.engine.chatRequest({customerName:e.customerName,customerEmailAddress:e.customerEmailAddress??"",visitorQuestion:e.visitorQuestion??"",customData:e.customData,errand:i,...t&&{authToken:t}}).pipe(z(this.disconnected$)).subscribe(),this.component.enableInput(),this.component.enableSkipToLatestMessage(),this.setEndConversationOption()}restartNewChat(){this.engine&&(this.setSessionId(null),this.component.clearMessages(),this.removeHeaderOptions(),this.connect(this._conversationOptions))}setQueueStatus(e){this.setToastMessage(e)}async endConversation(){var e;this.shouldUseAuth&&this.resetAuthState(ee.ChatEnded),await((e=this.engine)==null?void 0:e.chatQuit())}async sendConversationEmail(e){var t;try{await((t=this.engine)==null?void 0:t.chatEmailSession(e)),this.printSystem(this.texts.getOrFallback("email-form.email-sent-label","An email with the conversation was sent."))}catch(i){this.printSystem(this.texts.getOrFallback("email-form.error-message","Unable to send email with the conversation.")),i instanceof Fn||console.warn("Unhandled error:",i)}}clearPendingMessages(){this.pendingMessages.forEach(e=>{e.remove()})}setSessionId(e){this.sessionId=e}async isEntranceOpen(e,t){var s;let i=!1;try{const r=await fetch(`${e}/1/entrances/${t}/is-open`),o=await r.json();r.ok?i=(s=o==null?void 0:o.resultData)==null?void 0:s.isOpen:console.log(`Problem when fetching open status for entrance ${t}:`,o==null?void 0:o.resultMessage)}catch(r){console.log(`Failed to fetch open status for ${t}:`,r)}return i}resetAuthState(e){this.headerComponent.authState=e,this.headerComponent.userName="",this.headerComponent.authUrl="",this.authURL="",this.component.application.storage.removeItem("auth")}unescapeHtml(e){const t=document.createElement("textarea");return t.innerHTML=e,t.value}async handleAuthentication(){var t,i,s,r;this.headerComponent.userName=this.texts.getOrFallback("widget-header.authenticating","Authenticating..."),this.headerComponent.authState=ee.Authenticating;const e=await this.idHubClient.collect();switch(this.authenticationCardEntry&&this.authenticationCardEntry.remove(),this.idHubEidType){case Te.Tunnistus:if(e.status===H.Error){this.headerComponent.userName=this.texts.getOrFallback("widget-header.not-authenticated","Not authenticated"),this.headerComponent.authState=ee.NonAuthenticated,this.authenticationCardEntry=this.showTunnistusAuthCard(Ze.Error,this.authURL);return}else if(e.status===H.Authenticated){const o=Wd(((t=e==null?void 0:e.idhubEIDToken)==null?void 0:t.split(".")[1])??""),a=JSON.parse(o),c=((s=(i=a==null?void 0:a.completionData)==null?void 0:i.user)==null?void 0:s.name)??"";this.headerComponent.userName=c,this.headerComponent.authState=ee.Authenticated,this.component.application.storage.set("auth",{name:c,authenticated:!0}),this.component.setAuthenticationBannerStatus(ee.Authenticated),(r=this.authenticationCardEntry)==null||r.remove(),this.handleWelcomeForm(this.engine.config,e.idhubEIDToken)}break;case Te.BankId:break}}printAgent(e,t=""){const i=t.length>0?this.agent.print(e,"markdown",t):this.agent.print(e,"markdown");return this.setTypingState(!1),i}printUser(e){const t=this.unescapeHtml(e),i=Ni(Or(t));return this.user.print(i)}printSystem(e){const t=Ni(Or(e));return this.system.print(t)}showSurvey(){const e=new ie(q.System,{name:""},[{items:[["ace-survey",{content:""},{agentUsername:this.agentUsername??"",entrance:this.entrance??this.engine.config.entrance,errand:this.errand??this.engine.config.defaultErrand,contactId:this.contactId??""}]]}]);this.printEntry(e)}showTunnistusAuthCard(e,t,i){const s=new ie(q.System,{name:""},[{items:[["ace-tunnistus-auth-card",{content:""},{state:e,tunnistusURL:t??"",errorMessage:i??""}]]}]);return this.printEntry(s),s}showWelcomeForm(e){this.component.disableInput(),this.component.disableSkipToLatestMessage();let t;this.isThirdPartyParticipant?t=new ie(q.System,{name:""},[{items:[["ace-welcome-form-third-party",{content:""}]]}]):t=new ie(q.System,{name:""},[{items:[["ace-welcome-form",{content:""}]]}]),this.printEntry(t),t.actions$.pipe(J(i=>i.key==="submitted"),Ee(1)).subscribe(i=>{t.remove(),this.user.name=i.data.name,this.component.application.storage.set("userInfo",{name:this.user.name}),this.startChat({customerName:i.data.name,customerEmailAddress:i.data.email,visitorQuestion:i.data.question,customData:i.data.customData},e)})}showEntranceClosedDialog(){this.component.disableInput();const e=new ie(q.System,{name:""},[{items:[["ace-entrance-closed-dialog",{content:""}]]}]);this.printEntry(e)}showQuitConfirmDialog(){var e;(e=this.quitConfirmDialogEntry)==null||e.remove(),this.quitConfirmDialogEntry=new ie(q.System,{name:""},[{items:[["ace-quit-confirm-dialog",{content:""}]]}]),this.printEntry(this.quitConfirmDialogEntry),this.quitConfirmDialogEntry.actions$.pipe(J(t=>t.key==="quit-chat"),Ee(1)).subscribe(t=>{var i,s,r,o;((i=t.data)==null?void 0:i.result)==="quit"?(this.endConversation(),(s=this.quitConfirmDialogEntry)==null||s.remove()):((r=t.data)==null?void 0:r.result)==="cancel"&&((o=this.quitConfirmDialogEntry)==null||o.remove())})}showConversationEndedForm(){const e=new ie(q.System,{name:""},[{items:[["ace-conversation-ended-form",{content:""}]]}]);this.printEntry(e),e.actions$.pipe(J(t=>t.key==="submitted"),Ee(1)).subscribe(t=>{e.remove(),t.data.email&&this.sendConversationEmail(t.data.email)})}showVideoConfirmDialog(){this.videoConfirmDialogEntry=new ie(q.System,{name:""},[{items:[["ace-video-confirm-dialog",{content:""}]]}]),this.printEntry(this.videoConfirmDialogEntry),this.videoConfirmDialogEntry.actions$.pipe(J(e=>e.key==="video-confirm"),Ee(1)).subscribe(e=>{var t;this.videoConfirmDialogEntry&&this.videoConfirmDialogEntry.remove(),e.data.result==="declined"&&(this.guestId=null),(t=this.engine)==null||t.videoPrepared(e.data.result),this.printSystem(e.data.text)})}showVideoIFrame(e){var i;this.guestId=Ki(),this.videoIFrameElement=new en(e,this.guestId);const t=this.component.application.root;(i=t==null?void 0:t.shadowRoot)==null||i.prepend(this.videoIFrameElement),this.inVideoCall=!0,this.setHeaderOption()}showChatOverVideo(e){this.guestId&&e===this.guestId&&(this.chatOverlayActive=!0,this.showChatOverlay$.next(this.chatOverlayActive))}async endAuthenticatedSession(){this.component.setAuthenticationBannerStatus(ee.NonAuthenticated),await this.engine.getChatStatus()==="noSession"?(this.resetAuthState(ee.NonAuthenticated),this.setSessionId(null),this.component.clearMessages(),this.shouldUseAuth&&this.startAuthenticationFlow()):this.endConversation()}removeVideo(){var e;(e=this.videoIFrameElement)==null||e.remove(),this.guestId=null,this.chatOverlayActive&&(this.chatOverlayActive=!1,this.showChatOverlay$.next(this.chatOverlayActive)),this.inVideoCall=!1,this.setHeaderOption()}addHeaderOptions(e,t,i,s,r=!0){const o=this.component.application.getComponent("widget-header");if(o)return this.conversationOption?(this.conversationOption.label=e,this.conversationOption.key=t,this.conversationOption.icon=i,this.conversationOption.onClick=s,this.conversationOption.enabled=r,o.requestUpdate(),this.conversationOption):o.addOption({label:e,icon:i,closeOnClick:!0,key:t,onClick:s,enabled:r})}removeHeaderOptions(){const e=this.component.application.getComponent("widget-header");e&&e.removeOption(this.conversationOption)}setStartNewChatOption(){this.conversationOption=this.addHeaderOptions(this.texts.getOrFallback("widget-header.start-new-chat","Start new chat"),"start-new-chat-button",sa.svg,()=>{this.restartNewChat()})}setEndConversationOption(){this.conversationOption=this.addHeaderOptions(this.texts.getOrFallback("widget-header.end-conversation","End conversation"),"end-conversation-button",us.svg,()=>{this.showQuitConfirmDialog()},!this.inVideoCall)}async setHeaderOption(){switch(await this.engine.getChatStatus()){case"finished":this.isThirdPartyParticipant?this.removeHeaderOptions():this.setStartNewChatOption();break;case"active":this.setEndConversationOption();break;case"noSession":this.conversationOption=null}}}const dp=async n=>{(await rs.getInstance(n.container)).registerProvider("ace-chat",t=>Ts.getInstance("ace-chat",t))};exports.ChatProviderPlugin=dp;
|
package/index.mjs
CHANGED
|
@@ -335,14 +335,14 @@ function Ro(n) {
|
|
|
335
335
|
}
|
|
336
336
|
function En() {
|
|
337
337
|
}
|
|
338
|
-
function
|
|
338
|
+
function xn(n) {
|
|
339
339
|
n();
|
|
340
340
|
}
|
|
341
341
|
var es = (function(n) {
|
|
342
342
|
Ie(e, n);
|
|
343
343
|
function e(t) {
|
|
344
344
|
var i = n.call(this) || this;
|
|
345
|
-
return i.isStopped = !1, t ? (i.destination = t, Lo(t) && t.add(i)) : i.destination =
|
|
345
|
+
return i.isStopped = !1, t ? (i.destination = t, Lo(t) && t.add(i)) : i.destination = wl, i;
|
|
346
346
|
}
|
|
347
347
|
return e.create = function(t, i, s) {
|
|
348
348
|
return new Ri(t, i, s);
|
|
@@ -415,13 +415,13 @@ var es = (function(n) {
|
|
|
415
415
|
function mn(n) {
|
|
416
416
|
Ro(n);
|
|
417
417
|
}
|
|
418
|
-
function
|
|
418
|
+
function xl(n) {
|
|
419
419
|
throw n;
|
|
420
420
|
}
|
|
421
|
-
var
|
|
421
|
+
var wl = {
|
|
422
422
|
closed: !0,
|
|
423
423
|
next: En,
|
|
424
|
-
error:
|
|
424
|
+
error: xl,
|
|
425
425
|
complete: En
|
|
426
426
|
}, ts = (function() {
|
|
427
427
|
return typeof Symbol == "function" && Symbol.observable || "@@observable";
|
|
@@ -445,7 +445,7 @@ var F = (function() {
|
|
|
445
445
|
return t.source = this, t.operator = e, t;
|
|
446
446
|
}, n.prototype.subscribe = function(e, t, i) {
|
|
447
447
|
var s = this, r = Cl(e) ? e : new Ri(e, t, i);
|
|
448
|
-
return
|
|
448
|
+
return xn(function() {
|
|
449
449
|
var o = s, a = o.operator, c = o.source;
|
|
450
450
|
r.add(a ? a.call(r, c) : c ? s._subscribe(r) : s._trySubscribe(r));
|
|
451
451
|
}), r;
|
|
@@ -578,7 +578,7 @@ var _l = (function(n) {
|
|
|
578
578
|
throw new Al();
|
|
579
579
|
}, e.prototype.next = function(t) {
|
|
580
580
|
var i = this;
|
|
581
|
-
|
|
581
|
+
xn(function() {
|
|
582
582
|
var s, r;
|
|
583
583
|
if (i._throwIfClosed(), !i.isStopped) {
|
|
584
584
|
i.currentObservers || (i.currentObservers = Array.from(i.observers));
|
|
@@ -600,7 +600,7 @@ var _l = (function(n) {
|
|
|
600
600
|
});
|
|
601
601
|
}, e.prototype.error = function(t) {
|
|
602
602
|
var i = this;
|
|
603
|
-
|
|
603
|
+
xn(function() {
|
|
604
604
|
if (i._throwIfClosed(), !i.isStopped) {
|
|
605
605
|
i.hasError = i.isStopped = !0, i.thrownError = t;
|
|
606
606
|
for (var s = i.observers; s.length; )
|
|
@@ -609,7 +609,7 @@ var _l = (function(n) {
|
|
|
609
609
|
});
|
|
610
610
|
}, e.prototype.complete = function() {
|
|
611
611
|
var t = this;
|
|
612
|
-
|
|
612
|
+
xn(function() {
|
|
613
613
|
if (t._throwIfClosed(), !t.isStopped) {
|
|
614
614
|
t.isStopped = !0;
|
|
615
615
|
for (var i = t.observers; i.length; )
|
|
@@ -1534,7 +1534,7 @@ class $c {
|
|
|
1534
1534
|
return this.print$.asObservable();
|
|
1535
1535
|
}
|
|
1536
1536
|
}
|
|
1537
|
-
class
|
|
1537
|
+
class xc {
|
|
1538
1538
|
constructor(e, t) {
|
|
1539
1539
|
this.name = e, this.component = t, this.print$ = new P(), this.typingState$ = new he(!1), this.complete$ = new P(), this.system = this.createSystem(), this.rehydrate$ = new P(), this.saveToCurrentSession$ = new P(), this.showChatOverlay$ = new he(!1), this.onComplete = () => this.complete$.asObservable();
|
|
1540
1540
|
}
|
|
@@ -1616,7 +1616,7 @@ class wc {
|
|
|
1616
1616
|
* Copyright 2019 Google LLC
|
|
1617
1617
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
1618
1618
|
*/
|
|
1619
|
-
const
|
|
1619
|
+
const wn = globalThis, os = wn.ShadowRoot && (wn.ShadyCSS === void 0 || wn.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, as = Symbol(), Lr = /* @__PURE__ */ new WeakMap();
|
|
1620
1620
|
let Yo = class {
|
|
1621
1621
|
constructor(e, t, i) {
|
|
1622
1622
|
if (this._$cssResult$ = !0, i !== as) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
|
|
@@ -1635,7 +1635,7 @@ let Yo = class {
|
|
|
1635
1635
|
return this.cssText;
|
|
1636
1636
|
}
|
|
1637
1637
|
};
|
|
1638
|
-
const
|
|
1638
|
+
const wc = (n) => new Yo(typeof n == "string" ? n : n + "", void 0, as), L = (n, ...e) => {
|
|
1639
1639
|
const t = n.length === 1 ? n[0] : e.reduce(((i, s, r) => i + ((o) => {
|
|
1640
1640
|
if (o._$cssResult$ === !0) return o.cssText;
|
|
1641
1641
|
if (typeof o == "number") return o;
|
|
@@ -1645,13 +1645,13 @@ const xc = (n) => new Yo(typeof n == "string" ? n : n + "", void 0, as), L = (n,
|
|
|
1645
1645
|
}, kc = (n, e) => {
|
|
1646
1646
|
if (os) n.adoptedStyleSheets = e.map(((t) => t instanceof CSSStyleSheet ? t : t.styleSheet));
|
|
1647
1647
|
else for (const t of e) {
|
|
1648
|
-
const i = document.createElement("style"), s =
|
|
1648
|
+
const i = document.createElement("style"), s = wn.litNonce;
|
|
1649
1649
|
s !== void 0 && i.setAttribute("nonce", s), i.textContent = t.cssText, n.appendChild(i);
|
|
1650
1650
|
}
|
|
1651
1651
|
}, Rr = os ? (n) => n : (n) => n instanceof CSSStyleSheet ? ((e) => {
|
|
1652
1652
|
let t = "";
|
|
1653
1653
|
for (const i of e.cssRules) t += i.cssText;
|
|
1654
|
-
return
|
|
1654
|
+
return wc(t);
|
|
1655
1655
|
})(n) : n;
|
|
1656
1656
|
/**
|
|
1657
1657
|
* @license
|
|
@@ -1899,7 +1899,7 @@ ht.elementStyles = [], ht.shadowRootOptions = { mode: "open" }, ht[zt("elementPr
|
|
|
1899
1899
|
*/
|
|
1900
1900
|
const Ht = globalThis, On = Ht.trustedTypes, Mr = On ? On.createPolicy("lit-html", { createHTML: (n) => n }) : void 0, Qo = "$lit$", Me = `lit$${Math.random().toFixed(9).slice(2)}$`, Xo = "?" + Me, Lc = `<${Xo}>`, Ke = document, Vt = () => Ke.createComment(""), Wt = (n) => n === null || typeof n != "object" && typeof n != "function", cs = Array.isArray, Rc = (n) => cs(n) || typeof (n == null ? void 0 : n[Symbol.iterator]) == "function", yi = `[
|
|
1901
1901
|
\f\r]`, Lt = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, Nr = /-->/g, Ur = />/g, Ve = RegExp(`>|${yi}(?:([^\\s"'>=/]+)(${yi}*=${yi}*(?:[^
|
|
1902
|
-
\f\r"'\`<>=]|("|')|))|$)`, "g"), Dr = /'/g, zr = /"/g, Ko = /^(?:script|style|textarea|title)$/i, Ic = (n) => (e, ...t) => ({ _$litType$: n, strings: e, values: t }), y = Ic(1), Le = Symbol.for("lit-noChange"),
|
|
1902
|
+
\f\r"'\`<>=]|("|')|))|$)`, "g"), Dr = /'/g, zr = /"/g, Ko = /^(?:script|style|textarea|title)$/i, Ic = (n) => (e, ...t) => ({ _$litType$: n, strings: e, values: t }), y = Ic(1), Le = Symbol.for("lit-noChange"), x = Symbol.for("lit-nothing"), Hr = /* @__PURE__ */ new WeakMap(), Ge = Ke.createTreeWalker(Ke, 129);
|
|
1903
1903
|
function Jo(n, e) {
|
|
1904
1904
|
if (!cs(n) || !n.hasOwnProperty("raw")) throw Error("invalid template strings array");
|
|
1905
1905
|
return Mr !== void 0 ? Mr.createHTML(e) : e;
|
|
@@ -1994,7 +1994,7 @@ class nn {
|
|
|
1994
1994
|
return ((e = this._$AM) == null ? void 0 : e._$AU) ?? this._$Cv;
|
|
1995
1995
|
}
|
|
1996
1996
|
constructor(e, t, i, s) {
|
|
1997
|
-
this.type = 2, this._$AH =
|
|
1997
|
+
this.type = 2, this._$AH = x, this._$AN = void 0, this._$AA = e, this._$AB = t, this._$AM = i, this.options = s, this._$Cv = (s == null ? void 0 : s.isConnected) ?? !0;
|
|
1998
1998
|
}
|
|
1999
1999
|
get parentNode() {
|
|
2000
2000
|
let e = this._$AA.parentNode;
|
|
@@ -2008,7 +2008,7 @@ class nn {
|
|
|
2008
2008
|
return this._$AB;
|
|
2009
2009
|
}
|
|
2010
2010
|
_$AI(e, t = this) {
|
|
2011
|
-
e = $t(this, e, t), Wt(e) ? e ===
|
|
2011
|
+
e = $t(this, e, t), Wt(e) ? e === x || e == null || e === "" ? (this._$AH !== x && this._$AR(), this._$AH = x) : e !== this._$AH && e !== Le && this._(e) : e._$litType$ !== void 0 ? this.$(e) : e.nodeType !== void 0 ? this.T(e) : Rc(e) ? this.k(e) : this._(e);
|
|
2012
2012
|
}
|
|
2013
2013
|
O(e) {
|
|
2014
2014
|
return this._$AA.parentNode.insertBefore(e, this._$AB);
|
|
@@ -2017,7 +2017,7 @@ class nn {
|
|
|
2017
2017
|
this._$AH !== e && (this._$AR(), this._$AH = this.O(e));
|
|
2018
2018
|
}
|
|
2019
2019
|
_(e) {
|
|
2020
|
-
this._$AH !==
|
|
2020
|
+
this._$AH !== x && Wt(this._$AH) ? this._$AA.nextSibling.data = e : this.T(Ke.createTextNode(e)), this._$AH = e;
|
|
2021
2021
|
}
|
|
2022
2022
|
$(e) {
|
|
2023
2023
|
var r;
|
|
@@ -2059,7 +2059,7 @@ class Zn {
|
|
|
2059
2059
|
return this._$AM._$AU;
|
|
2060
2060
|
}
|
|
2061
2061
|
constructor(e, t, i, s, r) {
|
|
2062
|
-
this.type = 1, this._$AH =
|
|
2062
|
+
this.type = 1, this._$AH = x, this._$AN = void 0, this.element = e, this.name = t, this._$AM = s, this.options = r, i.length > 2 || i[0] !== "" || i[1] !== "" ? (this._$AH = Array(i.length - 1).fill(new String()), this.strings = i) : this._$AH = x;
|
|
2063
2063
|
}
|
|
2064
2064
|
_$AI(e, t = this, i, s) {
|
|
2065
2065
|
const r = this.strings;
|
|
@@ -2068,12 +2068,12 @@ class Zn {
|
|
|
2068
2068
|
else {
|
|
2069
2069
|
const a = e;
|
|
2070
2070
|
let c, l;
|
|
2071
|
-
for (e = r[0], c = 0; c < r.length - 1; c++) l = $t(this, a[i + c], t, c), l === Le && (l = this._$AH[c]), o || (o = !Wt(l) || l !== this._$AH[c]), l ===
|
|
2071
|
+
for (e = r[0], c = 0; c < r.length - 1; c++) l = $t(this, a[i + c], t, c), l === Le && (l = this._$AH[c]), o || (o = !Wt(l) || l !== this._$AH[c]), l === x ? e = x : e !== x && (e += (l ?? "") + r[c + 1]), this._$AH[c] = l;
|
|
2072
2072
|
}
|
|
2073
2073
|
o && !s && this.j(e);
|
|
2074
2074
|
}
|
|
2075
2075
|
j(e) {
|
|
2076
|
-
e ===
|
|
2076
|
+
e === x ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, e ?? "");
|
|
2077
2077
|
}
|
|
2078
2078
|
}
|
|
2079
2079
|
let Nc = class extends Zn {
|
|
@@ -2081,7 +2081,7 @@ let Nc = class extends Zn {
|
|
|
2081
2081
|
super(...arguments), this.type = 3;
|
|
2082
2082
|
}
|
|
2083
2083
|
j(e) {
|
|
2084
|
-
this.element[this.name] = e ===
|
|
2084
|
+
this.element[this.name] = e === x ? void 0 : e;
|
|
2085
2085
|
}
|
|
2086
2086
|
};
|
|
2087
2087
|
class Uc extends Zn {
|
|
@@ -2089,7 +2089,7 @@ class Uc extends Zn {
|
|
|
2089
2089
|
super(...arguments), this.type = 4;
|
|
2090
2090
|
}
|
|
2091
2091
|
j(e) {
|
|
2092
|
-
this.element.toggleAttribute(this.name, !!e && e !==
|
|
2092
|
+
this.element.toggleAttribute(this.name, !!e && e !== x);
|
|
2093
2093
|
}
|
|
2094
2094
|
}
|
|
2095
2095
|
class Dc extends Zn {
|
|
@@ -2097,8 +2097,8 @@ class Dc extends Zn {
|
|
|
2097
2097
|
super(e, t, i, s, r), this.type = 5;
|
|
2098
2098
|
}
|
|
2099
2099
|
_$AI(e, t = this) {
|
|
2100
|
-
if ((e = $t(this, e, t, 0) ??
|
|
2101
|
-
const i = this._$AH, s = e ===
|
|
2100
|
+
if ((e = $t(this, e, t, 0) ?? x) === Le) return;
|
|
2101
|
+
const i = this._$AH, s = e === x && i !== x || e.capture !== i.capture || e.once !== i.once || e.passive !== i.passive, r = e !== x && (i === x || s);
|
|
2102
2102
|
s && this.element.removeEventListener(this.name, this, i), r && this.element.addEventListener(this.name, this, e), this._$AH = e;
|
|
2103
2103
|
}
|
|
2104
2104
|
handleEvent(e) {
|
|
@@ -2161,8 +2161,8 @@ let A = class extends ht {
|
|
|
2161
2161
|
};
|
|
2162
2162
|
var _o;
|
|
2163
2163
|
A._$litElement$ = !0, A.finalized = !0, (_o = Qe.litElementHydrateSupport) == null || _o.call(Qe, { LitElement: A });
|
|
2164
|
-
const
|
|
2165
|
-
|
|
2164
|
+
const xi = Qe.litElementPolyfillSupport;
|
|
2165
|
+
xi == null || xi({ LitElement: A });
|
|
2166
2166
|
(Qe.litElementVersions ?? (Qe.litElementVersions = [])).push("4.2.1");
|
|
2167
2167
|
const Fc = { svg: '<svg viewBox="0 0 64 64" xmlns="http://www.w3.org/2000/svg" fill="currentColor"><path fill-rule="evenodd" clip-rule="evenodd" d="M32 60C47.464 60 60 47.464 60 32C60 16.536 47.464 4 32 4C16.536 4 4 16.536 4 32C4.01731 47.4568 16.5432 59.9827 32 60ZM32 8.30769C45.0849 8.30769 55.6923 18.9151 55.6923 32C55.6923 45.0849 45.0849 55.6923 32 55.6923C18.9151 55.6923 8.30769 45.0849 8.30769 32C8.32247 18.9212 18.9212 8.32247 32 8.30769Z"/><path d="M29.3491 38.6031V20.6807C29.348 19.8662 29.4903 19.0598 29.7675 18.3096C29.9945 17.6371 30.3484 17.0302 30.804 16.5322C31.1251 16.1524 31.5593 15.9246 32.0204 15.894C32.6852 15.894 33.3496 16.471 34.0134 17.625C34.3738 18.1337 34.5955 18.7525 34.6509 19.4042V37.3267C34.6509 37.9947 34.2454 38.6329 33.4345 39.2414C32.6632 39.835 31.7547 40.1521 30.825 40.1523C29.8423 40.1524 29.3503 39.636 29.3491 38.6031Z"/><path d="M33.66 44.6959C33.9649 45.0866 34.161 45.551 34.2284 46.0419C34.2284 46.5397 33.8893 47.0083 33.2109 47.4476C32.5638 47.8771 31.8043 48.1062 31.0275 48.1061C30.1902 48.1061 29.7716 47.7271 29.7716 46.9693C29.7703 46.3788 29.8874 45.7941 30.116 45.2496C30.3064 44.7579 30.6022 44.3138 30.9826 43.9487C31.2626 43.6591 31.6427 43.4875 32.045 43.4692C32.5635 43.4692 33.1019 43.8781 33.66 44.6959Z"/></svg>' }, ta = { svg: '<svg viewBox="0 0 64 64" xmlns="http://www.w3.org/2000/svg" fill="currentColor"><path fill-rule="evenodd" clip-rule="evenodd" d="M52 7H24C19.5838 7.00505 16.0051 10.5838 16 15V23H12C7.58382 23.0051 4.00505 26.5838 4 31V43C4.00505 47.4162 7.58382 50.9949 12 51H19.1699L24.8789 56.7075C25.737 57.5654 27.0273 57.8219 28.1482 57.3575C29.2692 56.8931 30 55.7993 30 54.5859V51H39.999C44.4152 50.995 47.994 47.4162 47.999 43V35H52C56.4162 34.9949 59.9949 31.4162 60 27V15C59.9949 10.5838 56.4162 7.00505 52 7ZM43.999 43C43.9967 45.2082 42.2072 46.9977 39.999 47H26V52.1724L20.8262 47H12C9.79184 46.9976 8.00235 45.2082 8 43V31C8.00235 28.7918 9.79184 27.0024 12 27H16C16.0051 31.4162 19.5838 34.9949 24 35H30V38.5859C29.999 39.7998 30.7298 40.8945 31.8512 41.359C32.9726 41.8236 34.2634 41.5664 35.1211 40.7075L40.8291 35H43.999V43ZM56 27C55.9977 29.2082 54.2082 30.9976 52 31H39.1729L34 36.1719V31H24C21.7918 30.9976 20.0024 29.2082 20 27V15C20.0024 12.7918 21.7918 11.0024 24 11H52C54.2082 11.0024 55.9977 12.7918 56 15V27Z"/></svg>' }, jc = { svg: '<svg viewBox="0 0 64 64" xmlns="http://www.w3.org/2000/svg" fill="currentColor"><path fill-rule="evenodd" clip-rule="evenodd" d="M32 4C16.536 4 4 16.536 4 32C4 47.464 16.536 60 32 60C47.464 60 60 47.464 60 32C59.9829 16.5431 47.4569 4.01712 32 4ZM44.5613 24.5793L31.6382 43.9639C31.2806 44.5011 30.7008 44.8493 30.0586 44.9126C29.988 44.9197 29.9171 44.9232 29.8462 44.9231C29.275 44.9229 28.7272 44.696 28.3233 44.2921L19.7079 35.6767C19.1639 35.1326 18.9514 34.3396 19.1505 33.5964C19.3497 32.8533 19.9302 32.2728 20.6734 32.0736C21.4166 31.8745 22.2095 32.087 22.7536 32.631L29.5117 39.3881L40.9772 22.1899C41.4016 21.5439 42.1396 21.1749 42.9111 21.2229C43.6825 21.2709 44.3691 21.7286 44.7101 22.4223C45.0511 23.1159 44.9944 23.9391 44.5613 24.5793Z"/></svg>' }, na = { svg: '<svg viewBox="0 0 64 64" xmlns="http://www.w3.org/2000/svg" fill="currentColor"><path fill-rule="evenodd" clip-rule="evenodd" d="M31.9998 4C16.5358 4 3.99976 16.536 3.99976 32C3.99976 47.464 16.5358 60 31.9998 60C47.4637 60 59.9998 47.464 59.9998 32C59.9826 16.5431 47.4566 4.01712 31.9998 4ZM31.9998 55.6923C18.9149 55.6923 8.30745 45.0849 8.30745 32C8.30745 18.9151 18.9149 8.30769 31.9998 8.30769C45.0847 8.30769 55.6921 18.9151 55.6921 32C55.6773 45.0788 45.0785 55.6775 31.9998 55.6923ZM44.5611 24.5793L31.638 43.9639C31.2804 44.5011 30.7005 44.8493 30.0584 44.9126C29.9878 44.9197 29.9169 44.9232 29.8459 44.9231C29.2747 44.9229 28.727 44.696 28.3231 44.2921L19.7077 35.6767C19.1636 35.1326 18.9512 34.3396 19.1503 33.5964C19.3494 32.8533 19.9299 32.2728 20.6731 32.0736C21.4163 31.8745 22.2093 32.087 22.7534 32.631L29.5115 39.3881L40.9769 22.1899C41.4013 21.5439 42.1394 21.1749 42.9108 21.2229C43.6823 21.2709 44.3688 21.7286 44.7099 22.4223C45.0509 23.1159 44.9941 23.9391 44.5611 24.5793Z"/></svg>' }, Bc = { svg: '<svg viewBox="0 0 64 64" xmlns="http://www.w3.org/2000/svg" fill="currentColor"><path fill-rule="evenodd" clip-rule="evenodd" d="M57.5438 13.4967L28.717 50.5596C27.9537 51.5407 26.8061 52.147 25.5654 52.2248C25.4755 52.2301 25.3856 52.2332 25.2967 52.2332C24.1476 52.233 23.0455 51.7763 22.233 50.9637L6.63458 35.3654C6.08729 34.8181 5.87354 34.0204 6.07387 33.2728C6.27419 32.5252 6.85815 31.9412 7.60577 31.7409C8.35339 31.5406 9.15109 31.7543 9.69838 32.3016L25.2967 47.8999L54.1225 10.837C54.5976 10.2258 55.3626 9.91453 56.1295 10.0204C56.8963 10.1263 57.5484 10.6332 57.8402 11.3502C58.1319 12.0673 58.0189 12.8855 57.5438 13.4967Z"/></svg>' }, ia = { svg: '<svg viewBox="0 0 64 64" xmlns="http://www.w3.org/2000/svg" fill="currentColor"><path fill-rule="evenodd" clip-rule="evenodd" d="M53.0318 24.8653L33.5318 44.3653C33.1256 44.7717 32.5745 45.0001 31.9999 45.0001C31.4253 45.0001 30.8742 44.7717 30.468 44.3653L10.968 24.8653C10.122 24.0193 10.122 22.6476 10.968 21.8015C11.8141 20.9555 13.1858 20.9555 14.0318 21.8015L31.9999 39.7696L49.968 21.8015C50.8141 20.9555 52.1858 20.9555 53.0318 21.8015C53.8779 22.6476 53.8779 24.0193 53.0318 24.8653Z"/></svg>' }, qc = { svg: '<svg viewBox="0 0 64 64" xmlns="http://www.w3.org/2000/svg" fill="currentColor"><path fill-rule="evenodd" clip-rule="evenodd" d="M32 56C45.2548 56 56 45.2548 56 32C56 18.7452 45.2548 8 32 8C18.7452 8 8 18.7452 8 32C8 45.2548 18.7452 56 32 56ZM32 60C47.464 60 60 47.464 60 32C60 16.536 47.464 4 32 4C16.536 4 4 16.536 4 32C4 47.464 16.536 60 32 60Z"/><path d="M25.2772 22.695C24.5164 21.8942 23.2505 21.8617 22.4497 22.6225C21.6488 23.3833 21.6164 24.6492 22.3772 25.45L29.2411 32.6752L22.4773 39.795C21.7166 40.5958 21.749 41.8617 22.5498 42.6225C23.3507 43.3833 24.6166 43.3508 25.3773 42.55L31.9998 35.5791L38.6222 42.55C39.3829 43.3508 40.6488 43.3833 41.4497 42.6225C42.2505 41.8617 42.2829 40.5958 41.5222 39.795L34.7584 32.6752L41.6223 25.45C42.3831 24.6492 42.3507 23.3833 41.5498 22.6225C40.749 21.8617 39.4831 21.8942 38.7224 22.695L31.9998 29.7714L25.2772 22.695Z"/></svg>' }, us = { svg: '<svg viewBox="0 0 64 64" xmlns="http://www.w3.org/2000/svg" fill="currentColor"><path fill-rule="evenodd" clip-rule="evenodd" d="M51.365 48.3012C51.9123 48.8485 52.1261 49.6462 51.9258 50.3939C51.7254 51.1415 51.1415 51.7254 50.3939 51.9258C49.6462 52.1261 48.8485 51.9123 48.3012 51.365L32.4998 35.5636L16.6984 51.365C16.1511 51.9123 15.3534 52.1261 14.6058 51.9258C13.8581 51.7254 13.2742 51.1415 13.0739 50.3939C12.8735 49.6462 13.0873 48.8485 13.6346 48.3012L29.436 32.4998L13.6346 16.6984C13.0873 16.1511 12.8735 15.3534 13.0739 14.6058C13.2742 13.8581 13.8581 13.2742 14.6058 13.0739C15.3534 12.8735 16.1511 13.0873 16.6984 13.6346L32.4998 29.436L48.3012 13.6346C49.1473 12.7885 50.519 12.7885 51.365 13.6346C52.2111 14.4806 52.2111 15.8523 51.365 16.6984L35.5636 32.4998L51.365 48.3012Z"/></svg>' }, Vc = { svg: '<svg viewBox="0 0 64 64" xmlns="http://www.w3.org/2000/svg" fill="currentColor"><path fill-rule="evenodd" clip-rule="evenodd" d="M58.2618 43.8838L38.8585 11.5469C37.4136 9.13651 34.8097 7.66134 31.9994 7.66113C29.1891 7.66093 26.585 9.13572 25.1397 11.5459L5.73642 43.8838C4.25367 46.3552 4.21482 49.4331 5.6347 51.9411C7.05459 54.4492 9.71372 55.9997 12.5958 56H51.4024C54.2845 55.9997 56.9436 54.4492 58.3635 51.9411C59.7834 49.4331 59.7446 46.3552 58.2618 43.8838ZM29.9991 36.9772V25.1569C29.9983 24.6198 30.1056 24.0879 30.3148 23.5932C30.486 23.1496 30.753 22.7494 31.0968 22.4209C31.339 22.1704 31.6666 22.0202 32.0145 22C32.5161 22 33.0173 22.3805 33.5182 23.1416C33.7901 23.4771 33.9573 23.8852 33.9991 24.3151V36.1354C33.9991 36.5759 33.6932 36.9969 33.0814 37.3982C32.4994 37.7897 31.814 37.9988 31.1126 37.999C30.3712 37.999 30 37.6584 29.9991 36.9772ZM34.2408 43.9236C34.173 43.4297 33.9757 42.9626 33.669 42.5696C33.1076 41.7469 32.566 41.3355 32.0444 41.3355C31.6396 41.354 31.2573 41.5266 30.9757 41.8179C30.593 42.1852 30.2954 42.6319 30.1039 43.1266C29.874 43.6743 29.7562 44.2625 29.7574 44.8565C29.7574 45.6189 30.1786 46 31.0208 46C31.8022 46.0001 32.5662 45.7697 33.2173 45.3377C33.8996 44.8957 34.2408 44.4243 34.2408 43.9236Z"/></svg>' }, zi = { svg: '<svg viewBox="0 0 64 64" xmlns="http://www.w3.org/2000/svg" fill="currentColor"><path d="M59.9139 23.8477V7.90923C59.902 5.75094 58.1522 4.00588 55.9939 4H40.0554C38.8659 4 37.9016 4.96431 37.9016 6.15385C37.9016 7.34338 38.8659 8.30769 40.0554 8.30769H52.4616L29.8462 30.9231C29.4417 31.3271 29.2145 31.8753 29.2145 32.4469C29.2145 33.0186 29.4417 33.5668 29.8462 33.9708C30.2394 34.3609 30.7677 34.5846 31.3216 34.5954C31.8941 34.5987 32.4443 34.3739 32.8508 33.9708L55.6062 11.2046V23.8477C55.6062 25.0372 56.5705 26.0015 57.76 26.0015C58.9495 26.0015 59.9139 25.0372 59.9139 23.8477Z"/><path d="M12.217 60H47.4001C51.9189 59.9942 55.5874 56.3449 55.617 51.8262V38.4615C55.617 37.272 54.6527 36.3077 53.4631 36.3077C52.2736 36.3077 51.3093 37.272 51.3093 38.4615V51.7831C51.3034 53.9396 49.5566 55.6864 47.4001 55.6923H12.217C10.0771 55.6866 8.33714 53.9659 8.30776 51.8262V16.5569C8.29914 15.5145 8.7072 14.5119 9.44126 13.7718C10.1753 13.0316 11.1746 12.6153 12.217 12.6154H25.5385C26.7281 12.6154 27.6924 11.6511 27.6924 10.4615C27.6924 9.272 26.7281 8.30769 25.5385 8.30769H12.217C10.0321 8.30767 7.9372 9.17782 6.39529 10.7258C4.85339 12.2738 3.99147 14.3721 4.00006 16.5569V51.8262C4.02963 56.3449 7.6981 59.9942 12.217 60Z"/></svg>' }, Fr = { svg: '<svg viewBox="0 0 64 64" xmlns="http://www.w3.org/2000/svg" fill="currentColor"><path fill-rule="evenodd" clip-rule="evenodd" d="M51.4283 11.6761L53.1768 9.53891C53.9347 8.61282 53.7982 7.24774 52.8722 6.48993C51.9461 5.73211 50.581 5.86852 49.8232 6.79461L36.3333 23.2822V13.3972C36.3332 11.6447 35.2774 10.0648 33.6583 9.39418C32.0391 8.72356 30.1755 9.09425 28.9362 10.3334L18.1029 21.1668H14.6667C9.88247 21.1722 6.00547 25.0492 6 29.8334V34.1668C6.00547 38.951 9.88247 42.828 14.6667 42.8334H18.1029L19.3315 44.0621L10.8232 54.4613C10.0653 55.3874 10.2018 56.7525 11.1279 57.5103C12.0539 58.2681 13.419 58.1317 14.1768 57.2056L22.411 47.1416L28.9362 53.6668C30.1755 54.9059 32.0391 55.2766 33.6583 54.606C35.2774 53.9354 36.3332 52.3555 36.3333 50.603V30.1254L42.6092 22.4549C44.2201 25.3756 45.044 28.6649 45 32.0001C45.1184 36.1899 43.7698 40.2896 41.1872 43.5909C40.409 44.5001 40.5152 45.8679 41.4243 46.6461C42.3334 47.4243 43.7012 47.3183 44.4795 46.4093C47.7313 42.3208 49.4486 37.2227 49.3333 32.0001C49.403 27.3538 48.067 22.7949 45.5005 18.9211L48.6119 15.1182C52.019 20.0793 53.7867 25.9829 53.6667 32.0001C53.6667 39.0587 51.4873 45.6518 47.6872 50.0909C46.909 51.0001 47.0152 52.3679 47.9243 53.1461C48.8334 53.9243 50.2012 53.8183 50.9795 52.9093C55.4408 47.6968 58 40.0764 58 32.0001C58 24.21 55.6006 16.8662 51.4283 11.6761ZM19.8971 38.5H14.6667C12.2744 38.4977 10.3357 36.559 10.3333 34.1667V29.8334C10.3357 27.4411 12.2744 25.5024 14.6667 25.5H19.8971L32 13.3972V28.5784L22.089 40.6919L19.8971 38.5ZM31.9997 50.603L25.1682 43.7715L31.9997 35.4218V50.603Z"/></svg>' }, Wc = { name: "question", svg: '<svg viewBox="0 0 64 64" xmlns="http://www.w3.org/2000/svg" fill="currentColor"><path fill-rule="evenodd" clip-rule="evenodd" d="M32 4C16.536 4 4 16.536 4 32C4 47.464 16.536 60 32 60C47.464 60 60 47.464 60 32C59.9827 16.5432 47.4568 4.01731 32 4ZM32 55.6923C18.9151 55.6923 8.30769 45.0849 8.30769 32C8.30769 18.9151 18.9151 8.30769 32 8.30769C45.0849 8.30769 55.6923 18.9151 55.6923 32C55.6775 45.0788 45.0788 55.6775 32 55.6923Z"/><path fill-rule="evenodd" clip-rule="evenodd" d="M31.9423 37.5723L36.311 32.9068L36.7354 32.4448C39.7555 29.1161 40.7645 27.0647 40.7645 24.5087C40.7645 23.1091 40.4251 21.7942 39.7041 20.6491C38.3044 18.3587 35.6323 16.9166 32.2816 16.9166C28.7565 16.9166 25.3125 18.7414 23.2581 21.6772L23.1201 21.8791C22.8232 22.3032 22.696 22.6849 22.696 22.9818C22.696 23.7029 23.926 25.9932 25.2833 25.9932C25.5378 25.9932 25.7922 25.9084 26.0467 25.7388C26.2588 25.5691 26.5981 25.2298 27.0647 24.7208C28.8885 22.6849 30.1185 21.9215 31.7726 21.9215C33.6813 21.9215 35.081 23.1939 35.081 24.8905C35.081 26.375 34.2751 27.7746 32.3664 29.8529L28.2523 34.2216C27.9554 34.6033 27.7857 34.9426 27.7857 35.282C27.7857 35.6213 27.9978 36.1726 28.4219 36.8937C29.0581 37.8692 29.7368 38.3782 30.4578 38.3782C30.9244 38.3782 31.3909 38.1237 31.9423 37.5723ZM30.882 47.4972C29.2278 47.4972 27.6585 44.7403 27.6585 43.6799C27.6585 42.1954 30.0761 40.6261 32.4089 40.6261C33.6389 40.6261 34.2751 41.1775 34.2751 42.3227C34.2751 44.0616 33.4692 45.843 32.4513 46.7761C31.9423 47.2427 31.4334 47.4972 30.882 47.4972Z"/></svg>' }, sa = { svg: '<svg viewBox="0 0 64 64" xmlns="http://www.w3.org/2000/svg" fill="currentColor"><path fill-rule="evenodd" clip-rule="evenodd" d="M8.41642 6.29292C5.99705 5.18016 3.38612 7.41823 4.12858 9.96847L10.5427 32L4.12858 54.0315C3.38612 56.5818 5.99704 58.8198 8.41642 57.7071L58.1942 34.8125C60.6019 33.7051 60.6019 30.2949 58.1942 29.1875L8.41642 6.29292ZM14.2569 29.9351L8.74174 10.9913L49.9295 29.9351H14.2569ZM14.2568 34.0651L8.74174 53.0087L49.9291 34.0651H14.2568Z"/></svg>' }, jr = { svg: '<svg viewBox="0 0 64 64" xmlns="http://www.w3.org/2000/svg" fill="currentColor"><path fill-rule="evenodd" clip-rule="evenodd" d="M33.6578 9.3322C32.0391 8.65799 30.1735 9.02919 28.9362 10.2717L18.1029 21.105H14.6667C9.88247 21.1105 6.00547 24.9875 6 29.7717V34.105C6.00547 38.8892 9.88247 42.7662 14.6667 42.7717H18.1029L28.9362 53.605C30.1755 54.8442 32.0391 55.2149 33.6583 54.5442C35.2774 53.8736 36.3332 52.2937 36.3333 50.5412V13.3355C36.3365 11.5817 35.2794 10.0001 33.6578 9.3322ZM32 50.5411L19.8971 38.4382H14.6667C12.2744 38.4358 10.3357 36.4971 10.3333 34.1049V29.7716C10.3357 27.3793 12.2744 25.4406 14.6667 25.4382H19.8971L32 13.3353V50.5411ZM49.3334 31.9383C49.4487 37.161 47.7314 42.2591 44.4796 46.3475C43.7013 47.2565 42.3335 47.3625 41.4244 46.5843C40.5153 45.8061 40.4092 44.4383 41.1873 43.5291C43.7699 40.2278 45.1185 36.1282 45.0001 31.9383C45.1185 27.7485 43.7699 23.6488 41.1873 20.3475C40.4092 19.4383 40.5153 18.0705 41.4244 17.2923C42.3335 16.5141 43.7013 16.6201 44.4796 17.5291C47.7314 21.6176 49.4487 26.7157 49.3334 31.9383ZM58.0001 31.9383C58.0001 40.0147 55.441 47.635 50.9796 52.8475C50.2013 53.7565 48.8335 53.8625 47.9244 53.0843C47.0153 52.3061 46.9092 50.9383 47.6873 50.0291C51.4874 45.59 53.6668 38.9969 53.6668 31.9383C53.6668 24.8797 51.4874 18.2866 47.6873 13.8475C46.9092 12.9383 47.0153 11.5705 47.9244 10.7923C48.8335 10.0141 50.2013 10.1201 50.9796 11.0291C55.441 16.2416 58.0001 23.862 58.0001 31.9383Z"/></svg>' }, Gc = { svg: '<svg viewBox="0 0 64 64" xmlns="http://www.w3.org/2000/svg" fill="currentColor"><path fill-rule="evenodd" clip-rule="evenodd" d="M27.2561 39.1924C27.3201 40.5364 28.0241 41.1764 29.3681 41.1764C32.1201 41.1764 34.8081 39.3844 34.8721 37.5924L35.8961 12.3764C35.8961 10.6484 35.0001 9.81641 33.1441 9.81641C29.6241 9.81641 25.9761 12.1844 25.9761 14.4244L27.2561 39.1924ZM30.9041 55.3847C28.4081 55.3847 26.0401 51.2247 26.0401 49.6247C26.0401 47.3847 29.6881 45.0167 33.2081 45.0167C35.0641 45.0167 36.0241 45.8487 36.0241 47.5767C36.0241 50.2007 34.8081 52.8887 33.2721 54.2967C32.5041 55.0007 31.7361 55.3847 30.9041 55.3847Z"/></svg>' }, dt = {
|
|
2168
2168
|
allRenderFn: !1,
|
|
@@ -2549,9 +2549,9 @@ const Qn = typeof window < "u" ? window : {}, be = Qn.document || { head: {} },
|
|
|
2549
2549
|
} catch (i) {
|
|
2550
2550
|
sn(i);
|
|
2551
2551
|
}
|
|
2552
|
-
}, Xr = (n, e) => n && n.then ? n.then(e) : e(),
|
|
2552
|
+
}, Xr = (n, e) => n && n.then ? n.then(e) : e(), xu = (n, e) => n != null && !ds(n) ? e & 4 ? n === "false" ? !1 : n === "" || !!n : e & 2 ? parseFloat(n) : e & 1 ? String(n) : n : n, wu = (n, e) => Xn(n).$instanceValues$.get(e), ku = (n, e, t, i) => {
|
|
2553
2553
|
const s = Xn(n), r = n, o = s.$instanceValues$.get(e), a = s.$flags$, c = r;
|
|
2554
|
-
t =
|
|
2554
|
+
t = xu(t, i.$members$[e][0]);
|
|
2555
2555
|
const l = Number.isNaN(o) && Number.isNaN(t);
|
|
2556
2556
|
if (t !== o && !l) {
|
|
2557
2557
|
s.$instanceValues$.set(e, t);
|
|
@@ -2580,7 +2580,7 @@ const Qn = typeof window < "u" ? window : {}, be = Qn.document || { head: {} },
|
|
|
2580
2580
|
i.map(([r, [o]]) => {
|
|
2581
2581
|
(o & 31 || o & 32) && Object.defineProperty(s, r, {
|
|
2582
2582
|
get() {
|
|
2583
|
-
return
|
|
2583
|
+
return wu(this, r);
|
|
2584
2584
|
},
|
|
2585
2585
|
set(a) {
|
|
2586
2586
|
ku(this, r, a, e);
|
|
@@ -2717,7 +2717,7 @@ const zu = "telia-vst{display:none}", Hu = /* @__PURE__ */ ba(class extends aa {
|
|
|
2717
2717
|
}, [0, "telia-vst", {
|
|
2718
2718
|
dataTrackingId: [1, "data-tracking-id"]
|
|
2719
2719
|
}]);
|
|
2720
|
-
function
|
|
2720
|
+
function xa() {
|
|
2721
2721
|
if (typeof customElements > "u")
|
|
2722
2722
|
return;
|
|
2723
2723
|
["telia-vst"].forEach((e) => {
|
|
@@ -2728,7 +2728,7 @@ function wa() {
|
|
|
2728
2728
|
}
|
|
2729
2729
|
});
|
|
2730
2730
|
}
|
|
2731
|
-
|
|
2731
|
+
xa();
|
|
2732
2732
|
function ji() {
|
|
2733
2733
|
return typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : { vocadsIcons: void 0, vocadsIconsRegistered: !1 };
|
|
2734
2734
|
}
|
|
@@ -2789,7 +2789,7 @@ function Vu() {
|
|
|
2789
2789
|
customElements.get(e) || customElements.define(e, qu);
|
|
2790
2790
|
break;
|
|
2791
2791
|
case "telia-vst":
|
|
2792
|
-
customElements.get(e) ||
|
|
2792
|
+
customElements.get(e) || xa();
|
|
2793
2793
|
break;
|
|
2794
2794
|
}
|
|
2795
2795
|
});
|
|
@@ -2880,7 +2880,7 @@ const Ft = (n, e) => {
|
|
|
2880
2880
|
if ((e = n._$AM) === void 0) break;
|
|
2881
2881
|
t = e._$AN, t.delete(n), n = e;
|
|
2882
2882
|
} while ((t == null ? void 0 : t.size) === 0);
|
|
2883
|
-
},
|
|
2883
|
+
}, wa = (n) => {
|
|
2884
2884
|
for (let e; e = n._$AM; n = e) {
|
|
2885
2885
|
let t = e._$AN;
|
|
2886
2886
|
if (t === void 0) e._$AN = t = /* @__PURE__ */ new Set();
|
|
@@ -2889,7 +2889,7 @@ const Ft = (n, e) => {
|
|
|
2889
2889
|
}
|
|
2890
2890
|
};
|
|
2891
2891
|
function Yu(n) {
|
|
2892
|
-
this._$AN !== void 0 ? (Mn(this), this._$AM = n,
|
|
2892
|
+
this._$AN !== void 0 ? (Mn(this), this._$AM = n, wa(this)) : this._$AM = n;
|
|
2893
2893
|
}
|
|
2894
2894
|
function Qu(n, e = !1, t = 0) {
|
|
2895
2895
|
const i = this._$AH, s = this._$AN;
|
|
@@ -2905,7 +2905,7 @@ let ka = class extends Kn {
|
|
|
2905
2905
|
super(...arguments), this._$AN = void 0;
|
|
2906
2906
|
}
|
|
2907
2907
|
_$AT(e, t, i) {
|
|
2908
|
-
super._$AT(e, t, i),
|
|
2908
|
+
super._$AT(e, t, i), wa(this), this.isConnected = e._$AU;
|
|
2909
2909
|
}
|
|
2910
2910
|
_$AO(e, t = !0) {
|
|
2911
2911
|
var i, s;
|
|
@@ -2931,25 +2931,25 @@ let ka = class extends Kn {
|
|
|
2931
2931
|
const me = () => new Ku();
|
|
2932
2932
|
class Ku {
|
|
2933
2933
|
}
|
|
2934
|
-
const
|
|
2934
|
+
const wi = /* @__PURE__ */ new WeakMap(), ve = on(class extends ka {
|
|
2935
2935
|
render(n) {
|
|
2936
|
-
return
|
|
2936
|
+
return x;
|
|
2937
2937
|
}
|
|
2938
2938
|
update(n, [e]) {
|
|
2939
2939
|
var i;
|
|
2940
2940
|
const t = e !== this.G;
|
|
2941
|
-
return t && this.G !== void 0 && this.rt(void 0), (t || this.lt !== this.ct) && (this.G = e, this.ht = (i = n.options) == null ? void 0 : i.host, this.rt(this.ct = n.element)),
|
|
2941
|
+
return t && this.G !== void 0 && this.rt(void 0), (t || this.lt !== this.ct) && (this.G = e, this.ht = (i = n.options) == null ? void 0 : i.host, this.rt(this.ct = n.element)), x;
|
|
2942
2942
|
}
|
|
2943
2943
|
rt(n) {
|
|
2944
2944
|
if (this.isConnected || (n = void 0), typeof this.G == "function") {
|
|
2945
2945
|
const e = this.ht ?? globalThis;
|
|
2946
|
-
let t =
|
|
2947
|
-
t === void 0 && (t = /* @__PURE__ */ new WeakMap(),
|
|
2946
|
+
let t = wi.get(e);
|
|
2947
|
+
t === void 0 && (t = /* @__PURE__ */ new WeakMap(), wi.set(e, t)), t.get(this.G) !== void 0 && this.G.call(this.ht, void 0), t.set(this.G, n), n !== void 0 && this.G.call(this.ht, n);
|
|
2948
2948
|
} else this.G.value = n;
|
|
2949
2949
|
}
|
|
2950
2950
|
get lt() {
|
|
2951
2951
|
var n, e;
|
|
2952
|
-
return typeof this.G == "function" ? (n =
|
|
2952
|
+
return typeof this.G == "function" ? (n = wi.get(this.ht ?? globalThis)) == null ? void 0 : n.get(this.G) : (e = this.G) == null ? void 0 : e.value;
|
|
2953
2953
|
}
|
|
2954
2954
|
disconnected() {
|
|
2955
2955
|
this.lt === this.ct && this.rt(void 0);
|
|
@@ -2963,7 +2963,7 @@ const xi = /* @__PURE__ */ new WeakMap(), ve = on(class extends ka {
|
|
|
2963
2963
|
* Copyright 2018 Google LLC
|
|
2964
2964
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
2965
2965
|
*/
|
|
2966
|
-
const
|
|
2966
|
+
const xt = on(class extends Kn {
|
|
2967
2967
|
constructor(n) {
|
|
2968
2968
|
var e;
|
|
2969
2969
|
if (super(n), n.type !== rn.ATTRIBUTE || n.name !== "class" || ((e = n.strings) == null ? void 0 : e.length) > 2) throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.");
|
|
@@ -3001,7 +3001,7 @@ const Os = class Os extends A {
|
|
|
3001
3001
|
return (t = this.shadowRoot) == null || t.appendChild(e), e;
|
|
3002
3002
|
}
|
|
3003
3003
|
render() {
|
|
3004
|
-
return this.anchor === "BottomLeft" ? this.renderRoot.host.classList.add("bottom-left") : this.anchor === "BottomRight" && this.renderRoot.host.classList.add("bottom-right"),
|
|
3004
|
+
return this.anchor === "BottomLeft" ? this.renderRoot.host.classList.add("bottom-left") : this.anchor === "BottomRight" && this.renderRoot.host.classList.add("bottom-right"), x;
|
|
3005
3005
|
}
|
|
3006
3006
|
};
|
|
3007
3007
|
Os.styles = [
|
|
@@ -3068,7 +3068,7 @@ class oh extends ka {
|
|
|
3068
3068
|
(e = this.l) == null || e.call(this), this.l = void 0;
|
|
3069
3069
|
}
|
|
3070
3070
|
render(e) {
|
|
3071
|
-
return
|
|
3071
|
+
return x;
|
|
3072
3072
|
}
|
|
3073
3073
|
getController() {
|
|
3074
3074
|
return th.get(this.u);
|
|
@@ -3308,7 +3308,7 @@ const Ls = class Ls extends A {
|
|
|
3308
3308
|
return y` <img src=${t} class="trigger-icon" alt="" /> `;
|
|
3309
3309
|
const i = (l = this.application) == null ? void 0 : l.triggerIcon;
|
|
3310
3310
|
if (!i)
|
|
3311
|
-
return
|
|
3311
|
+
return x;
|
|
3312
3312
|
const s = async (u) => Wc, { type: r, content: o } = i;
|
|
3313
3313
|
switch (r) {
|
|
3314
3314
|
case "Telia": {
|
|
@@ -3317,7 +3317,7 @@ const Ls = class Ls extends A {
|
|
|
3317
3317
|
class="trigger-icon"
|
|
3318
3318
|
svg=${u.svg}
|
|
3319
3319
|
size="lg"
|
|
3320
|
-
></telia-icon>` :
|
|
3320
|
+
></telia-icon>` : x;
|
|
3321
3321
|
}
|
|
3322
3322
|
// case 'FontAwesome':
|
|
3323
3323
|
// return html`<i class="trigger-fa-icon fa fa-${content}"></i>`;
|
|
@@ -3327,7 +3327,7 @@ const Ls = class Ls extends A {
|
|
|
3327
3327
|
// style="background: url(${content}) no-repeat center center;background-size: contain;"
|
|
3328
3328
|
// ></i>`;
|
|
3329
3329
|
default:
|
|
3330
|
-
return
|
|
3330
|
+
return x;
|
|
3331
3331
|
}
|
|
3332
3332
|
}
|
|
3333
3333
|
hideTrigger() {
|
|
@@ -3339,7 +3339,7 @@ const Ls = class Ls extends A {
|
|
|
3339
3339
|
render() {
|
|
3340
3340
|
var e, t, i, s, r, o, a;
|
|
3341
3341
|
return y`<div
|
|
3342
|
-
class=${
|
|
3342
|
+
class=${xt({
|
|
3343
3343
|
"trigger-container": !0,
|
|
3344
3344
|
hidden: !this.triggerVisible
|
|
3345
3345
|
})}
|
|
@@ -3360,12 +3360,12 @@ const Ls = class Ls extends A {
|
|
|
3360
3360
|
>
|
|
3361
3361
|
${this.application.settings.branding.other.buttonLabelText ?? "Widget trigger"}
|
|
3362
3362
|
</button>
|
|
3363
|
-
` :
|
|
3363
|
+
` : x}
|
|
3364
3364
|
|
|
3365
3365
|
<button
|
|
3366
3366
|
type="button"
|
|
3367
3367
|
aria-label="${((a = (o = (r = this.application) == null ? void 0 : r.settings) == null ? void 0 : o.branding.other) == null ? void 0 : a.buttonLabelText) ?? "Widget trigger"}"
|
|
3368
|
-
class=${
|
|
3368
|
+
class=${xt({
|
|
3369
3369
|
trigger: !0,
|
|
3370
3370
|
active: this.active,
|
|
3371
3371
|
rendered: this.loaded
|
|
@@ -4037,7 +4037,7 @@ const Ps = class Ps extends A {
|
|
|
4037
4037
|
}
|
|
4038
4038
|
render() {
|
|
4039
4039
|
if (!this.widget || this.status !== "activated")
|
|
4040
|
-
return
|
|
4040
|
+
return x;
|
|
4041
4041
|
if (this.widget.renderStrategy === gs.Trigger) {
|
|
4042
4042
|
const e = new Re();
|
|
4043
4043
|
return e.application = this.widget, e;
|
|
@@ -4052,21 +4052,21 @@ Ps.styles = [
|
|
|
4052
4052
|
}
|
|
4053
4053
|
`
|
|
4054
4054
|
];
|
|
4055
|
-
let
|
|
4055
|
+
let wt = Ps;
|
|
4056
4056
|
ms([
|
|
4057
4057
|
k({ attribute: !0 })
|
|
4058
|
-
],
|
|
4058
|
+
], wt.prototype, "name");
|
|
4059
4059
|
ms([
|
|
4060
4060
|
T()
|
|
4061
|
-
],
|
|
4061
|
+
], wt.prototype, "widget");
|
|
4062
4062
|
ms([
|
|
4063
4063
|
T()
|
|
4064
|
-
],
|
|
4064
|
+
], wt.prototype, "status");
|
|
4065
4065
|
customElements.get("ace-trigger-slot") || customElements.define("ace-trigger-slot", Nn);
|
|
4066
4066
|
customElements.get("ace-trigger") || customElements.define("ace-trigger", Re);
|
|
4067
4067
|
customElements.get("ace-unresolved-component") || customElements.define("ace-unresolved-component", qi);
|
|
4068
4068
|
customElements.get("ace-wrapper") || customElements.define("ace-wrapper", Zt);
|
|
4069
|
-
customElements.get("ace-widget") || customElements.define("ace-widget",
|
|
4069
|
+
customElements.get("ace-widget") || customElements.define("ace-widget", wt);
|
|
4070
4070
|
class gh {
|
|
4071
4071
|
constructor(e) {
|
|
4072
4072
|
this._message = null, this._host = e, e.addController(this);
|
|
@@ -4309,7 +4309,7 @@ const Ms = class Ms extends A {
|
|
|
4309
4309
|
}
|
|
4310
4310
|
_renderTimestamp(e, t) {
|
|
4311
4311
|
if (!e && !t)
|
|
4312
|
-
return
|
|
4312
|
+
return x;
|
|
4313
4313
|
let i = "";
|
|
4314
4314
|
e ? t ? i = `${e}: ${this._getTimestamp(t)}` : i = e : t && (i = this._getTimestamp(t));
|
|
4315
4315
|
const s = this.application.texts.getOrFallback(
|
|
@@ -4359,14 +4359,14 @@ const Ms = class Ms extends A {
|
|
|
4359
4359
|
`;
|
|
4360
4360
|
case q.Agent:
|
|
4361
4361
|
return y`<div
|
|
4362
|
-
class=${
|
|
4362
|
+
class=${xt({
|
|
4363
4363
|
"conversation-agent-message": !0,
|
|
4364
4364
|
"has-avatar": !!((e = this.entry.sender) != null && e.avatar)
|
|
4365
4365
|
})}
|
|
4366
4366
|
>
|
|
4367
4367
|
${typeof ((t = this.entry.sender) == null ? void 0 : t.avatar) == "string" ? y`<div class="avatar">
|
|
4368
4368
|
<img src=${this.entry.sender.avatar} />
|
|
4369
|
-
</div>` :
|
|
4369
|
+
</div>` : x}
|
|
4370
4370
|
|
|
4371
4371
|
<div class="entry-content">
|
|
4372
4372
|
${this.entry.messages.map(
|
|
@@ -4388,7 +4388,7 @@ const Ms = class Ms extends A {
|
|
|
4388
4388
|
</div>`;
|
|
4389
4389
|
case q.User:
|
|
4390
4390
|
return y`<div
|
|
4391
|
-
class=${
|
|
4391
|
+
class=${xt({
|
|
4392
4392
|
"conversation-user-message": !0,
|
|
4393
4393
|
"has-error": this.entry.status === "failed"
|
|
4394
4394
|
})}
|
|
@@ -4413,7 +4413,7 @@ const Ms = class Ms extends A {
|
|
|
4413
4413
|
</div>
|
|
4414
4414
|
</div>`;
|
|
4415
4415
|
default:
|
|
4416
|
-
return
|
|
4416
|
+
return x;
|
|
4417
4417
|
}
|
|
4418
4418
|
}
|
|
4419
4419
|
};
|
|
@@ -4597,7 +4597,7 @@ const Ns = class Ns extends A {
|
|
|
4597
4597
|
stabilizeOut: !0,
|
|
4598
4598
|
skipInitial: !1
|
|
4599
4599
|
})}
|
|
4600
|
-
></ace-typing-state>` :
|
|
4600
|
+
></ace-typing-state>` : x}
|
|
4601
4601
|
</div>`;
|
|
4602
4602
|
}
|
|
4603
4603
|
};
|
|
@@ -4636,10 +4636,10 @@ const $h = (n, e, t) => {
|
|
|
4636
4636
|
for (const i of e) if (i[0] === n) return (0, i[1])();
|
|
4637
4637
|
return t == null ? void 0 : t();
|
|
4638
4638
|
};
|
|
4639
|
-
var
|
|
4639
|
+
var xh = Object.defineProperty, wh = (n, e, t, i) => {
|
|
4640
4640
|
for (var s = void 0, r = n.length - 1, o; r >= 0; r--)
|
|
4641
4641
|
(o = n[r]) && (s = o(e, t, s) || s);
|
|
4642
|
-
return s &&
|
|
4642
|
+
return s && xh(e, t, s), s;
|
|
4643
4643
|
};
|
|
4644
4644
|
const Us = class Us extends A {
|
|
4645
4645
|
render() {
|
|
@@ -4659,7 +4659,7 @@ const Us = class Us extends A {
|
|
|
4659
4659
|
() => {
|
|
4660
4660
|
const s = customElements.get(e);
|
|
4661
4661
|
if (!s)
|
|
4662
|
-
return
|
|
4662
|
+
return x;
|
|
4663
4663
|
const r = new s(i || null);
|
|
4664
4664
|
return y`${r}`;
|
|
4665
4665
|
}
|
|
@@ -4687,7 +4687,7 @@ Us.styles = [
|
|
|
4687
4687
|
`
|
|
4688
4688
|
];
|
|
4689
4689
|
let Un = Us;
|
|
4690
|
-
|
|
4690
|
+
wh([
|
|
4691
4691
|
k({ attribute: !1 })
|
|
4692
4692
|
], Un.prototype, "group");
|
|
4693
4693
|
const Ds = class Ds extends A {
|
|
@@ -4744,10 +4744,10 @@ let Vi = Ds;
|
|
|
4744
4744
|
*/
|
|
4745
4745
|
class Wi extends Kn {
|
|
4746
4746
|
constructor(e) {
|
|
4747
|
-
if (super(e), this.it =
|
|
4747
|
+
if (super(e), this.it = x, e.type !== rn.CHILD) throw Error(this.constructor.directiveName + "() can only be used in child bindings");
|
|
4748
4748
|
}
|
|
4749
4749
|
render(e) {
|
|
4750
|
-
if (e ===
|
|
4750
|
+
if (e === x || e == null) return this._t = void 0, this.it = e;
|
|
4751
4751
|
if (e === Le) return e;
|
|
4752
4752
|
if (typeof e != "string") throw Error(this.constructor.directiveName + "() called with a non-string value");
|
|
4753
4753
|
if (e === this.it) return this._t;
|
|
@@ -4802,7 +4802,7 @@ function Lh(n) {
|
|
|
4802
4802
|
return Zi(n, t);
|
|
4803
4803
|
};
|
|
4804
4804
|
}
|
|
4805
|
-
function
|
|
4805
|
+
function w(n, e) {
|
|
4806
4806
|
let t = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : kn;
|
|
4807
4807
|
ho && ho(n, null);
|
|
4808
4808
|
let i = e.length;
|
|
@@ -4951,9 +4951,9 @@ function Pa() {
|
|
|
4951
4951
|
let {
|
|
4952
4952
|
IS_ALLOWED_URI: Js
|
|
4953
4953
|
} = yo, N = null;
|
|
4954
|
-
const er =
|
|
4954
|
+
const er = w({}, [...go, ...Ei, ..._i, ...Ai, ...mo]);
|
|
4955
4955
|
let D = null;
|
|
4956
|
-
const tr =
|
|
4956
|
+
const tr = w({}, [...vo, ...Ti, ...bo, ...yn]);
|
|
4957
4957
|
let R = Object.seal(La(null, {
|
|
4958
4958
|
tagNameCheck: {
|
|
4959
4959
|
writable: !0,
|
|
@@ -4976,15 +4976,15 @@ function Pa() {
|
|
|
4976
4976
|
})), _t = null, si = null, nr = !0, ri = !0, ir = !1, sr = !0, st = !1, cn = !0, qe = !1, oi = !1, ai = !1, rt = !1, un = !1, hn = !1, rr = !0, or = !1;
|
|
4977
4977
|
const rl = "user-content-";
|
|
4978
4978
|
let li = !0, At = !1, ot = {}, at = null;
|
|
4979
|
-
const ar =
|
|
4979
|
+
const ar = w({}, ["annotation-xml", "audio", "colgroup", "desc", "foreignobject", "head", "iframe", "math", "mi", "mn", "mo", "ms", "mtext", "noembed", "noframes", "noscript", "plaintext", "script", "style", "svg", "template", "thead", "title", "video", "xmp"]);
|
|
4980
4980
|
let lr = null;
|
|
4981
|
-
const cr =
|
|
4981
|
+
const cr = w({}, ["audio", "video", "img", "source", "image", "track"]);
|
|
4982
4982
|
let ci = null;
|
|
4983
|
-
const ur =
|
|
4983
|
+
const ur = w({}, ["alt", "class", "for", "id", "label", "name", "pattern", "placeholder", "role", "summary", "title", "value", "style", "xmlns"]), dn = "http://www.w3.org/1998/Math/MathML", pn = "http://www.w3.org/2000/svg", $e = "http://www.w3.org/1999/xhtml";
|
|
4984
4984
|
let lt = $e, ui = !1, hi = null;
|
|
4985
|
-
const ol =
|
|
4986
|
-
let fn =
|
|
4987
|
-
const al =
|
|
4985
|
+
const ol = w({}, [dn, pn, $e], Ci);
|
|
4986
|
+
let fn = w({}, ["mi", "mo", "mn", "ms", "mtext"]), gn = w({}, ["annotation-xml"]);
|
|
4987
|
+
const al = w({}, ["title", "style", "font", "a", "script"]);
|
|
4988
4988
|
let Tt = null;
|
|
4989
4989
|
const ll = ["application/xhtml+xml", "text/html"], cl = "text/html";
|
|
4990
4990
|
let U = null, ct = null;
|
|
@@ -4994,7 +4994,7 @@ function Pa() {
|
|
|
4994
4994
|
let h = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
4995
4995
|
if (!(ct && ct === h)) {
|
|
4996
4996
|
if ((!h || typeof h != "object") && (h = {}), h = Ce(h), Tt = // eslint-disable-next-line unicorn/prefer-includes
|
|
4997
|
-
ll.indexOf(h.PARSER_MEDIA_TYPE) === -1 ? cl : h.PARSER_MEDIA_TYPE, U = Tt === "application/xhtml+xml" ? Ci : kn, N = ce(h, "ALLOWED_TAGS") ?
|
|
4997
|
+
ll.indexOf(h.PARSER_MEDIA_TYPE) === -1 ? cl : h.PARSER_MEDIA_TYPE, U = Tt === "application/xhtml+xml" ? Ci : kn, N = ce(h, "ALLOWED_TAGS") ? w({}, h.ALLOWED_TAGS, U) : er, D = ce(h, "ALLOWED_ATTR") ? w({}, h.ALLOWED_ATTR, U) : tr, hi = ce(h, "ALLOWED_NAMESPACES") ? w({}, h.ALLOWED_NAMESPACES, Ci) : ol, ci = ce(h, "ADD_URI_SAFE_ATTR") ? w(Ce(ur), h.ADD_URI_SAFE_ATTR, U) : ur, lr = ce(h, "ADD_DATA_URI_TAGS") ? w(Ce(cr), h.ADD_DATA_URI_TAGS, U) : cr, at = ce(h, "FORBID_CONTENTS") ? w({}, h.FORBID_CONTENTS, U) : ar, _t = ce(h, "FORBID_TAGS") ? w({}, h.FORBID_TAGS, U) : Ce({}), si = ce(h, "FORBID_ATTR") ? w({}, h.FORBID_ATTR, U) : Ce({}), ot = ce(h, "USE_PROFILES") ? h.USE_PROFILES : !1, nr = h.ALLOW_ARIA_ATTR !== !1, ri = h.ALLOW_DATA_ATTR !== !1, ir = h.ALLOW_UNKNOWN_PROTOCOLS || !1, sr = h.ALLOW_SELF_CLOSE_IN_ATTR !== !1, st = h.SAFE_FOR_TEMPLATES || !1, cn = h.SAFE_FOR_XML !== !1, qe = h.WHOLE_DOCUMENT || !1, rt = h.RETURN_DOM || !1, un = h.RETURN_DOM_FRAGMENT || !1, hn = h.RETURN_TRUSTED_TYPE || !1, ai = h.FORCE_BODY || !1, rr = h.SANITIZE_DOM !== !1, or = h.SANITIZE_NAMED_PROPS || !1, li = h.KEEP_CONTENT !== !1, At = h.IN_PLACE || !1, Js = h.ALLOWED_URI_REGEXP || Ra, lt = h.NAMESPACE || $e, fn = h.MATHML_TEXT_INTEGRATION_POINTS || fn, gn = h.HTML_INTEGRATION_POINTS || gn, R = h.CUSTOM_ELEMENT_HANDLING || {}, h.CUSTOM_ELEMENT_HANDLING && hr(h.CUSTOM_ELEMENT_HANDLING.tagNameCheck) && (R.tagNameCheck = h.CUSTOM_ELEMENT_HANDLING.tagNameCheck), h.CUSTOM_ELEMENT_HANDLING && hr(h.CUSTOM_ELEMENT_HANDLING.attributeNameCheck) && (R.attributeNameCheck = h.CUSTOM_ELEMENT_HANDLING.attributeNameCheck), h.CUSTOM_ELEMENT_HANDLING && typeof h.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements == "boolean" && (R.allowCustomizedBuiltInElements = h.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements), st && (ri = !1), un && (rt = !0), ot && (N = w({}, mo), D = [], ot.html === !0 && (w(N, go), w(D, vo)), ot.svg === !0 && (w(N, Ei), w(D, Ti), w(D, yn)), ot.svgFilters === !0 && (w(N, _i), w(D, Ti), w(D, yn)), ot.mathMl === !0 && (w(N, Ai), w(D, bo), w(D, yn))), h.ADD_TAGS && (N === er && (N = Ce(N)), w(N, h.ADD_TAGS, U)), h.ADD_ATTR && (D === tr && (D = Ce(D)), w(D, h.ADD_ATTR, U)), h.ADD_URI_SAFE_ATTR && w(ci, h.ADD_URI_SAFE_ATTR, U), h.FORBID_CONTENTS && (at === ar && (at = Ce(at)), w(at, h.FORBID_CONTENTS, U)), li && (N["#text"] = !0), qe && w(N, ["html", "head", "body"]), N.table && (w(N, ["tbody"]), delete _t.tbody), h.TRUSTED_TYPES_POLICY) {
|
|
4998
4998
|
if (typeof h.TRUSTED_TYPES_POLICY.createHTML != "function")
|
|
4999
4999
|
throw Pt('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
|
|
5000
5000
|
if (typeof h.TRUSTED_TYPES_POLICY.createScriptURL != "function")
|
|
@@ -5004,7 +5004,7 @@ function Pa() {
|
|
|
5004
5004
|
M === void 0 && (M = qh(g, s)), M !== null && typeof Fe == "string" && (Fe = M.createHTML(""));
|
|
5005
5005
|
Q && Q(h), ct = h;
|
|
5006
5006
|
}
|
|
5007
|
-
}, dr =
|
|
5007
|
+
}, dr = w({}, [...Ei, ..._i, ...Ih]), pr = w({}, [...Ai, ...Ph]), hl = function(h) {
|
|
5008
5008
|
let f = He(h);
|
|
5009
5009
|
(!f || !f.tagName) && (f = {
|
|
5010
5010
|
namespaceURI: lt,
|
|
@@ -5081,17 +5081,17 @@ function Pa() {
|
|
|
5081
5081
|
}, mr = function(h) {
|
|
5082
5082
|
return typeof a == "function" && h instanceof a;
|
|
5083
5083
|
};
|
|
5084
|
-
function
|
|
5084
|
+
function xe(b, h, f) {
|
|
5085
5085
|
bn(b, (v) => {
|
|
5086
5086
|
v.call(e, h, f, ct);
|
|
5087
5087
|
});
|
|
5088
5088
|
}
|
|
5089
5089
|
const vr = function(h) {
|
|
5090
5090
|
let f = null;
|
|
5091
|
-
if (
|
|
5091
|
+
if (xe(V.beforeSanitizeElements, h, null), pi(h))
|
|
5092
5092
|
return fe(h), !0;
|
|
5093
5093
|
const v = U(h.nodeName);
|
|
5094
|
-
if (
|
|
5094
|
+
if (xe(V.uponSanitizeElement, h, {
|
|
5095
5095
|
tagName: v,
|
|
5096
5096
|
allowedTags: N
|
|
5097
5097
|
}), cn && h.hasChildNodes() && !mr(h.firstElementChild) && W(/<[/\w!]/g, h.innerHTML) && W(/<[/\w!]/g, h.textContent) || h.nodeType === Nt.progressingInstruction || cn && h.nodeType === Nt.comment && W(/<[/\w]/g, h.data))
|
|
@@ -5104,8 +5104,8 @@ function Pa() {
|
|
|
5104
5104
|
if (j && O) {
|
|
5105
5105
|
const I = j.length;
|
|
5106
5106
|
for (let K = I - 1; K >= 0; --K) {
|
|
5107
|
-
const
|
|
5108
|
-
|
|
5107
|
+
const we = $(j[K], !0);
|
|
5108
|
+
we.__removalCount = (h.__removalCount || 0) + 1, O.insertBefore(we, le(h));
|
|
5109
5109
|
}
|
|
5110
5110
|
}
|
|
5111
5111
|
}
|
|
@@ -5115,7 +5115,7 @@ function Pa() {
|
|
|
5115
5115
|
f = It(f, O, " ");
|
|
5116
5116
|
}), h.textContent !== f && (Rt(e.removed, {
|
|
5117
5117
|
element: h.cloneNode()
|
|
5118
|
-
}), h.textContent = f)),
|
|
5118
|
+
}), h.textContent = f)), xe(V.afterSanitizeElements, h, null), !1);
|
|
5119
5119
|
}, br = function(h, f, v) {
|
|
5120
5120
|
if (rr && (f === "id" || f === "name") && (v in t || v in ul))
|
|
5121
5121
|
return !1;
|
|
@@ -5146,7 +5146,7 @@ function Pa() {
|
|
|
5146
5146
|
}, yr = function(h) {
|
|
5147
5147
|
return h !== "annotation-xml" && fo(h, sl);
|
|
5148
5148
|
}, $r = function(h) {
|
|
5149
|
-
|
|
5149
|
+
xe(V.beforeSanitizeAttributes, h, null);
|
|
5150
5150
|
const {
|
|
5151
5151
|
attributes: f
|
|
5152
5152
|
} = h;
|
|
@@ -5164,10 +5164,10 @@ function Pa() {
|
|
|
5164
5164
|
const j = f[O], {
|
|
5165
5165
|
name: I,
|
|
5166
5166
|
namespaceURI: K,
|
|
5167
|
-
value:
|
|
5168
|
-
} = j, Ot = U(I), fi =
|
|
5167
|
+
value: we
|
|
5168
|
+
} = j, Ot = U(I), fi = we;
|
|
5169
5169
|
let B = I === "value" ? fi : Oh(fi);
|
|
5170
|
-
if (v.attrName = Ot, v.attrValue = B, v.keepAttr = !0, v.forceKeepAttr = void 0,
|
|
5170
|
+
if (v.attrName = Ot, v.attrValue = B, v.keepAttr = !0, v.forceKeepAttr = void 0, xe(V.uponSanitizeAttribute, h, v), B = v.attrValue, or && (Ot === "id" || Ot === "name") && (ut(I, h), B = rl + B), cn && W(/((--!?|])>)|<\/(style|title)/i, B)) {
|
|
5171
5171
|
ut(I, h);
|
|
5172
5172
|
continue;
|
|
5173
5173
|
}
|
|
@@ -5181,16 +5181,16 @@ function Pa() {
|
|
|
5181
5181
|
ut(I, h);
|
|
5182
5182
|
continue;
|
|
5183
5183
|
}
|
|
5184
|
-
st && bn([ti, ni, ii], (
|
|
5185
|
-
B = It(B,
|
|
5184
|
+
st && bn([ti, ni, ii], (wr) => {
|
|
5185
|
+
B = It(B, wr, " ");
|
|
5186
5186
|
});
|
|
5187
|
-
const
|
|
5188
|
-
if (!br(
|
|
5187
|
+
const xr = U(h.nodeName);
|
|
5188
|
+
if (!br(xr, Ot, B)) {
|
|
5189
5189
|
ut(I, h);
|
|
5190
5190
|
continue;
|
|
5191
5191
|
}
|
|
5192
5192
|
if (M && typeof g == "object" && typeof g.getAttributeType == "function" && !K)
|
|
5193
|
-
switch (g.getAttributeType(
|
|
5193
|
+
switch (g.getAttributeType(xr, Ot)) {
|
|
5194
5194
|
case "TrustedHTML": {
|
|
5195
5195
|
B = M.createHTML(B);
|
|
5196
5196
|
break;
|
|
@@ -5207,13 +5207,13 @@ function Pa() {
|
|
|
5207
5207
|
ut(I, h);
|
|
5208
5208
|
}
|
|
5209
5209
|
}
|
|
5210
|
-
|
|
5210
|
+
xe(V.afterSanitizeAttributes, h, null);
|
|
5211
5211
|
}, dl = function b(h) {
|
|
5212
5212
|
let f = null;
|
|
5213
5213
|
const v = gr(h);
|
|
5214
|
-
for (
|
|
5215
|
-
|
|
5216
|
-
|
|
5214
|
+
for (xe(V.beforeSanitizeShadowDOM, h, null); f = v.nextNode(); )
|
|
5215
|
+
xe(V.uponSanitizeShadowNode, f, null), vr(f), $r(f), f.content instanceof r && b(f.content);
|
|
5216
|
+
xe(V.afterSanitizeShadowDOM, h, null);
|
|
5217
5217
|
};
|
|
5218
5218
|
return e.sanitize = function(b) {
|
|
5219
5219
|
let h = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, f = null, v = null, O = null, j = null;
|
|
@@ -5227,8 +5227,8 @@ function Pa() {
|
|
|
5227
5227
|
return b;
|
|
5228
5228
|
if (oi || di(h), e.removed = [], typeof b == "string" && (At = !1), At) {
|
|
5229
5229
|
if (b.nodeName) {
|
|
5230
|
-
const
|
|
5231
|
-
if (!N[
|
|
5230
|
+
const we = U(b.nodeName);
|
|
5231
|
+
if (!N[we] || _t[we])
|
|
5232
5232
|
throw Pt("root node is forbidden and cannot be sanitized in-place");
|
|
5233
5233
|
}
|
|
5234
5234
|
} else if (b instanceof a)
|
|
@@ -5256,8 +5256,8 @@ function Pa() {
|
|
|
5256
5256
|
}
|
|
5257
5257
|
let K = qe ? f.outerHTML : f.innerHTML;
|
|
5258
5258
|
return qe && N["!doctype"] && f.ownerDocument && f.ownerDocument.doctype && f.ownerDocument.doctype.name && W(Ia, f.ownerDocument.doctype.name) && (K = "<!DOCTYPE " + f.ownerDocument.doctype.name + `>
|
|
5259
|
-
` + K), st && bn([ti, ni, ii], (
|
|
5260
|
-
K = It(K,
|
|
5259
|
+
` + K), st && bn([ti, ni, ii], (we) => {
|
|
5260
|
+
K = It(K, we, " ");
|
|
5261
5261
|
}), M && hn ? M.createHTML(K) : K;
|
|
5262
5262
|
}, e.setConfig = function() {
|
|
5263
5263
|
let b = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
@@ -5422,10 +5422,10 @@ var G = {
|
|
|
5422
5422
|
fencesBeginRegex: (n) => new RegExp(`^ {0,${Math.min(3, n - 1)}}(?:\`\`\`|~~~)`),
|
|
5423
5423
|
headingBeginRegex: (n) => new RegExp(`^ {0,${Math.min(3, n - 1)}}#`),
|
|
5424
5424
|
htmlBeginRegex: (n) => new RegExp(`^ {0,${Math.min(3, n - 1)}}<(?:[a-z].*>|!--)`, "i")
|
|
5425
|
-
}, Gh = /^(?:[ \t]*(?:\n|$))+/, Zh = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/, Yh = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, ln = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, Qh = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, bs = /(?:[*+-]|\d{1,9}[.)])/, Ua = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/, Da = C(Ua).replace(/bull/g, bs).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/\|table/g, "").getRegex(), Xh = C(Ua).replace(/bull/g, bs).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/table/g, / {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(), ys = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/, Kh = /^[^\n]+/, $s = /(?!\s*\])(?:\\.|[^\[\]\\])+/, Jh = C(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", $s).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), ed = C(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g, bs).getRegex(), Jn = "address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",
|
|
5425
|
+
}, Gh = /^(?:[ \t]*(?:\n|$))+/, Zh = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/, Yh = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, ln = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, Qh = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, bs = /(?:[*+-]|\d{1,9}[.)])/, Ua = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/, Da = C(Ua).replace(/bull/g, bs).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/\|table/g, "").getRegex(), Xh = C(Ua).replace(/bull/g, bs).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/table/g, / {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(), ys = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/, Kh = /^[^\n]+/, $s = /(?!\s*\])(?:\\.|[^\[\]\\])+/, Jh = C(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", $s).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), ed = C(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g, bs).getRegex(), Jn = "address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul", xs = /<!--(?:-?>|[\s\S]*?(?:-->|$))/, td = C(
|
|
5426
5426
|
"^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))",
|
|
5427
5427
|
"i"
|
|
5428
|
-
).replace("comment",
|
|
5428
|
+
).replace("comment", xs).replace("tag", Jn).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), za = C(ys).replace("hr", ln).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("|table", "").replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", Jn).getRegex(), nd = C(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", za).getRegex(), ws = {
|
|
5429
5429
|
blockquote: nd,
|
|
5430
5430
|
code: Zh,
|
|
5431
5431
|
def: Jh,
|
|
@@ -5439,18 +5439,18 @@ var G = {
|
|
|
5439
5439
|
paragraph: za,
|
|
5440
5440
|
table: jt,
|
|
5441
5441
|
text: Kh
|
|
5442
|
-
},
|
|
5442
|
+
}, xo = C(
|
|
5443
5443
|
"^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"
|
|
5444
5444
|
).replace("hr", ln).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("blockquote", " {0,3}>").replace("code", "(?: {4}| {0,3} )[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", Jn).getRegex(), id = {
|
|
5445
|
-
...
|
|
5445
|
+
...ws,
|
|
5446
5446
|
lheading: Xh,
|
|
5447
|
-
table:
|
|
5448
|
-
paragraph: C(ys).replace("hr", ln).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table",
|
|
5447
|
+
table: xo,
|
|
5448
|
+
paragraph: C(ys).replace("hr", ln).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", xo).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", Jn).getRegex()
|
|
5449
5449
|
}, sd = {
|
|
5450
|
-
...
|
|
5450
|
+
...ws,
|
|
5451
5451
|
html: C(
|
|
5452
5452
|
`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`
|
|
5453
|
-
).replace("comment",
|
|
5453
|
+
).replace("comment", xs).replace(/tag/g, "(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),
|
|
5454
5454
|
def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,
|
|
5455
5455
|
heading: /^(#{1,6})(.*)(?:\n+|$)/,
|
|
5456
5456
|
fences: jt,
|
|
@@ -5461,9 +5461,9 @@ var G = {
|
|
|
5461
5461
|
}, rd = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, od = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, Ha = /^( {2,}|\\)\n(?!\s*$)/, ad = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, ei = /[\p{P}\p{S}]/u, ks = /[\s\p{P}\p{S}]/u, Fa = /[^\s\p{P}\p{S}]/u, ld = C(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, ks).getRegex(), ja = /(?!~)[\p{P}\p{S}]/u, cd = /(?!~)[\s\p{P}\p{S}]/u, ud = /(?:[^\s\p{P}\p{S}]|~)/u, hd = /\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g, Ba = /^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/, dd = C(Ba, "u").replace(/punct/g, ei).getRegex(), pd = C(Ba, "u").replace(/punct/g, ja).getRegex(), qa = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)", fd = C(qa, "gu").replace(/notPunctSpace/g, Fa).replace(/punctSpace/g, ks).replace(/punct/g, ei).getRegex(), gd = C(qa, "gu").replace(/notPunctSpace/g, ud).replace(/punctSpace/g, cd).replace(/punct/g, ja).getRegex(), md = C(
|
|
5462
5462
|
"^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)",
|
|
5463
5463
|
"gu"
|
|
5464
|
-
).replace(/notPunctSpace/g, Fa).replace(/punctSpace/g, ks).replace(/punct/g, ei).getRegex(), vd = C(/\\(punct)/, "gu").replace(/punct/g, ei).getRegex(), bd = C(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme", /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email", /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(), yd = C(
|
|
5464
|
+
).replace(/notPunctSpace/g, Fa).replace(/punctSpace/g, ks).replace(/punct/g, ei).getRegex(), vd = C(/\\(punct)/, "gu").replace(/punct/g, ei).getRegex(), bd = C(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme", /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email", /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(), yd = C(xs).replace("(?:-->|$)", "-->").getRegex(), $d = C(
|
|
5465
5465
|
"^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>"
|
|
5466
|
-
).replace("comment", yd).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), zn = /(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,
|
|
5466
|
+
).replace("comment", yd).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), zn = /(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/, xd = C(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label", zn).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), Va = C(/^!?\[(label)\]\[(ref)\]/).replace("label", zn).replace("ref", $s).getRegex(), Wa = C(/^!?\[(ref)\](?:\[\])?/).replace("ref", $s).getRegex(), wd = C("reflink|nolink(?!\\()", "g").replace("reflink", Va).replace("nolink", Wa).getRegex(), Ss = {
|
|
5467
5467
|
_backpedal: jt,
|
|
5468
5468
|
// only used for GFM url
|
|
5469
5469
|
anyPunctuation: vd,
|
|
@@ -5476,11 +5476,11 @@ var G = {
|
|
|
5476
5476
|
emStrongRDelimAst: fd,
|
|
5477
5477
|
emStrongRDelimUnd: md,
|
|
5478
5478
|
escape: rd,
|
|
5479
|
-
link:
|
|
5479
|
+
link: xd,
|
|
5480
5480
|
nolink: Wa,
|
|
5481
5481
|
punctuation: ld,
|
|
5482
5482
|
reflink: Va,
|
|
5483
|
-
reflinkSearch:
|
|
5483
|
+
reflinkSearch: wd,
|
|
5484
5484
|
tag: $d,
|
|
5485
5485
|
text: ad,
|
|
5486
5486
|
url: jt
|
|
@@ -5501,7 +5501,7 @@ var G = {
|
|
|
5501
5501
|
br: C(Ha).replace("{2,}", "*").getRegex(),
|
|
5502
5502
|
text: C(Yi.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex()
|
|
5503
5503
|
}, $n = {
|
|
5504
|
-
normal:
|
|
5504
|
+
normal: ws,
|
|
5505
5505
|
gfm: id,
|
|
5506
5506
|
pedantic: sd
|
|
5507
5507
|
}, Ut = {
|
|
@@ -5515,13 +5515,13 @@ var G = {
|
|
|
5515
5515
|
">": ">",
|
|
5516
5516
|
'"': """,
|
|
5517
5517
|
"'": "'"
|
|
5518
|
-
},
|
|
5518
|
+
}, wo = (n) => Cd[n];
|
|
5519
5519
|
function ge(n, e) {
|
|
5520
5520
|
if (e) {
|
|
5521
5521
|
if (G.escapeTest.test(n))
|
|
5522
|
-
return n.replace(G.escapeReplace,
|
|
5522
|
+
return n.replace(G.escapeReplace, wo);
|
|
5523
5523
|
} else if (G.escapeTestNoEncode.test(n))
|
|
5524
|
-
return n.replace(G.escapeReplaceNoEncode,
|
|
5524
|
+
return n.replace(G.escapeReplaceNoEncode, wo);
|
|
5525
5525
|
return n;
|
|
5526
5526
|
}
|
|
5527
5527
|
function ko(n) {
|
|
@@ -7327,12 +7327,12 @@ const Eo = Ca(A), js = class js extends Eo {
|
|
|
7327
7327
|
class="auth-banner__icon"
|
|
7328
7328
|
size="sm"
|
|
7329
7329
|
svg=${na.svg}
|
|
7330
|
-
></telia-icon>` :
|
|
7330
|
+
></telia-icon>` : x}
|
|
7331
7331
|
<span>${this.getAuthBannerMessage()}</span>
|
|
7332
|
-
</div>` :
|
|
7332
|
+
</div>` : x}
|
|
7333
7333
|
<div
|
|
7334
7334
|
@action=${this.actionHandler}
|
|
7335
|
-
class=${
|
|
7335
|
+
class=${xt({
|
|
7336
7336
|
conversation: !0,
|
|
7337
7337
|
disabled: this.disabledInput,
|
|
7338
7338
|
"conversation--has-toast": this.toast.hasMessage(),
|
|
@@ -7347,9 +7347,9 @@ const Eo = Ca(A), js = class js extends Eo {
|
|
|
7347
7347
|
>
|
|
7348
7348
|
<telia-icon svg=${ia.svg}></telia-icon>
|
|
7349
7349
|
</button>
|
|
7350
|
-
</div>` :
|
|
7350
|
+
</div>` : x}
|
|
7351
7351
|
<div
|
|
7352
|
-
class=${
|
|
7352
|
+
class=${xt({
|
|
7353
7353
|
"conversation-content": !0,
|
|
7354
7354
|
"conversation-overlay-mode": this.chatOverlayActive
|
|
7355
7355
|
})}
|
|
@@ -7357,7 +7357,7 @@ const Eo = Ca(A), js = class js extends Eo {
|
|
|
7357
7357
|
aria-live="polite"
|
|
7358
7358
|
${ve(this.conversationContentRef)}
|
|
7359
7359
|
>
|
|
7360
|
-
${this.toast.hasMessage() ? y`<div class="conversation__toast">${this.toast.message}</div>` :
|
|
7360
|
+
${this.toast.hasMessage() ? y`<div class="conversation__toast">${this.toast.message}</div>` : x}
|
|
7361
7361
|
<ace-conversation-feed
|
|
7362
7362
|
.entries=${this.entries}
|
|
7363
7363
|
.loading=${this.typing}
|
|
@@ -7411,7 +7411,7 @@ const Eo = Ca(A), js = class js extends Eo {
|
|
|
7411
7411
|
${this.textAreaLength > this.messageMaxLength ? this.messageMaxLengthLabel : ""}
|
|
7412
7412
|
</div>
|
|
7413
7413
|
</form>
|
|
7414
|
-
${this.disabledSkipToLatest ?
|
|
7414
|
+
${this.disabledSkipToLatest ? x : y`<button
|
|
7415
7415
|
class="skip-to-latest-message-button"
|
|
7416
7416
|
@click=${this.skipToLatestMessage}
|
|
7417
7417
|
>
|
|
@@ -8387,7 +8387,7 @@ let it = (bt = class extends A {
|
|
|
8387
8387
|
}
|
|
8388
8388
|
render() {
|
|
8389
8389
|
if (this.submitted)
|
|
8390
|
-
return
|
|
8390
|
+
return x;
|
|
8391
8391
|
const e = this.application.texts;
|
|
8392
8392
|
return y`<div class="container">
|
|
8393
8393
|
<form class="form" @submit=${this._onStartChat}>
|
|
@@ -8579,7 +8579,7 @@ const Bs = class Bs extends A {
|
|
|
8579
8579
|
const t = (o = this.application.branding().graphics) == null ? void 0 : o.logotype, i = this.application.texts;
|
|
8580
8580
|
this.application.root.style.getPropertyValue("visibility") === "" && (this.application.root.style.visibility = "hidden");
|
|
8581
8581
|
const r = new URLSearchParams(document.location.search).get("invitationUid");
|
|
8582
|
-
return this.submitted ?
|
|
8582
|
+
return this.submitted ? x : r ? y`<div class="container">
|
|
8583
8583
|
<img class="logotype" src="${t}" />
|
|
8584
8584
|
<p>
|
|
8585
8585
|
${i.getOrFallback(
|
|
@@ -9231,7 +9231,7 @@ const Zs = class Zs extends A {
|
|
|
9231
9231
|
}
|
|
9232
9232
|
renderRequiredIndicator(e) {
|
|
9233
9233
|
if (!e)
|
|
9234
|
-
return
|
|
9234
|
+
return x;
|
|
9235
9235
|
const t = this.application.texts;
|
|
9236
9236
|
return y`
|
|
9237
9237
|
<span aria-hidden="true">*</span>
|
|
@@ -9802,7 +9802,7 @@ hp([
|
|
|
9802
9802
|
k({ attribute: !1 })
|
|
9803
9803
|
], en.prototype, "application");
|
|
9804
9804
|
window.customElements.get("ace-video-iframe") || window.customElements.define("ace-video-iframe", en);
|
|
9805
|
-
class Ts extends
|
|
9805
|
+
class Ts extends xc {
|
|
9806
9806
|
constructor(e, t) {
|
|
9807
9807
|
var i, s, r, o, a, c;
|
|
9808
9808
|
super(e, t), this.pendingMessages = [], this.texts = this.component.application.texts, this.headerComponent = this.component.application.getComponent("widget-header"), this.isThirdPartyParticipant = this.component.properties.chat.isThirdPartyWidget, this.agent = this.createAgent(
|
|
@@ -9999,10 +9999,16 @@ class Ts extends wc {
|
|
|
9999
9999
|
}
|
|
10000
10000
|
async handleWelcomeForm(e, t) {
|
|
10001
10001
|
let i = !0;
|
|
10002
|
-
e.webApiUrl
|
|
10003
|
-
|
|
10004
|
-
|
|
10005
|
-
|
|
10002
|
+
if (e.webApiUrl)
|
|
10003
|
+
try {
|
|
10004
|
+
i = await this.isEntranceOpen(
|
|
10005
|
+
e.webApiUrl,
|
|
10006
|
+
e.entrance
|
|
10007
|
+
);
|
|
10008
|
+
} catch (s) {
|
|
10009
|
+
console.error("Error checking entrance status:", s), i = !1;
|
|
10010
|
+
}
|
|
10011
|
+
i ? this.customerName ? (this.user.name = this.customerName, this.startChat(
|
|
10006
10012
|
{
|
|
10007
10013
|
customerName: this.customerName,
|
|
10008
10014
|
customData: {}
|
|
@@ -10083,6 +10089,10 @@ class Ts extends wc {
|
|
|
10083
10089
|
resetAuthState(e) {
|
|
10084
10090
|
this.headerComponent.authState = e, this.headerComponent.userName = "", this.headerComponent.authUrl = "", this.authURL = "", this.component.application.storage.removeItem("auth");
|
|
10085
10091
|
}
|
|
10092
|
+
unescapeHtml(e) {
|
|
10093
|
+
const t = document.createElement("textarea");
|
|
10094
|
+
return t.innerHTML = e, t.value;
|
|
10095
|
+
}
|
|
10086
10096
|
async handleAuthentication() {
|
|
10087
10097
|
var t, i, s, r;
|
|
10088
10098
|
this.headerComponent.userName = this.texts.getOrFallback(
|
|
@@ -10126,8 +10136,8 @@ class Ts extends wc {
|
|
|
10126
10136
|
return this.setTypingState(!1), i;
|
|
10127
10137
|
}
|
|
10128
10138
|
printUser(e) {
|
|
10129
|
-
const t = Ni(Or(
|
|
10130
|
-
return this.user.print(
|
|
10139
|
+
const t = this.unescapeHtml(e), i = Ni(Or(t));
|
|
10140
|
+
return this.user.print(i);
|
|
10131
10141
|
}
|
|
10132
10142
|
printSystem(e) {
|
|
10133
10143
|
const t = Ni(Or(e));
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@telia-ace/ace-chat-flamingo",
|
|
3
|
-
"version": "1.1.123-rc.
|
|
3
|
+
"version": "1.1.123-rc.15",
|
|
4
4
|
"dependencies": {
|
|
5
|
-
"@telia-ace/widget-core-flamingo": "1.1.123-rc.
|
|
6
|
-
"@telia-ace/widget-conversation-flamingo": "1.1.123-rc.
|
|
5
|
+
"@telia-ace/widget-core-flamingo": "1.1.123-rc.15",
|
|
6
|
+
"@telia-ace/widget-conversation-flamingo": "1.1.123-rc.15",
|
|
7
7
|
"rxjs": "^7.8.2",
|
|
8
8
|
"lit": "^3.0.2",
|
|
9
9
|
"@teliads/icons": "^8.4.0",
|
package/provider.d.ts
CHANGED
|
@@ -54,6 +54,7 @@ export declare class ChatProvider extends ConversationProvider {
|
|
|
54
54
|
private setSessionId;
|
|
55
55
|
private isEntranceOpen;
|
|
56
56
|
private resetAuthState;
|
|
57
|
+
private unescapeHtml;
|
|
57
58
|
private readonly onQueueStatusReceived;
|
|
58
59
|
private readonly onEstablished;
|
|
59
60
|
private readonly onPrepareVideo;
|