{"version":3,"names":["async","GetConfiguration","baseUrl","language","languagePart","middlemanUrl","window","location","href","result","SendGetRequestToMiddleman","url","response","fetch","method","then","res","json","error","console","Promise","resolve","pnlChatbotTriggerCss","PnlChatbotTrigger","this","authData","authenticated","undefined","accessToken","portal","businessPortal","TriggerReloadWhenBaseUrlChanges","chatbotAvailable","componentWillLoad","firstTimeComponentWillLoad","addEventListener","event","updateAuthentication","detail","handleChatbotToggled","autoOpenScroll","checkIfShadowRootIsCorrectlySet","Error","configuration","parameters","getParamaters","TranslationService","defaultLanguage","translationsBaseUrl","translations$","subscribe","translations","SoundService","callToAction","_a","callToActions","find","c","priority","showSecondary","ChatbotCallToActionPriority","secondary","primary","isAvailable","dialogFlowAgent","tunnel","ChatbotTunnel","tunnelPageUrl","postMessageRetrieveCurrentData","sessionDataFound","data","startIntent","welcomeIntent","setTimeout","querySelectorAll","document","length","dispatchEvent","CustomEvent","minimizedChatbot","body","classList","remove","closeChatWindow","chatbotToggled","emit","openChatWindow","add","authEvent","customerFirstName","user_info","given_name","customerMiddleName","middle_name","customerLastName","family_name","id_token","access_token","node","selector","nodes","nodeIterator","createNodeIterator","Node","ELEMENT_NODE","currentNode","nextNode","shadowRoot","push","isActive","winheight","innerHeight","scrollTop","pageYOffset","trackLength","getDocHeight","pctScrolled","Math","floor","totalAmountScrolled","previousScrollPosition","diff","scrollPercentage","isAutoOpenedByScroll","triggerButtonClicked","buttonText","D","max","scrollHeight","documentElement","offsetHeight","clientHeight","element","s","createElement","setAttribute","innerHTML","d","attachShadow","mode","delegatesFocus","appendChild","createParam","customerEmail","barcode","postalCode","countryCode","businessUserId","businessPortalName","businessModuleName","businessCustomerId","businessPhoneNumber","companyName","authenticationToken","caseDetailsApiUrl","caseId","caseStatus","caseTitle","caseDescription","orderNumber","visitorId","loginEnabled","chatbotCanBeTriggered","addAdobeAnalyticsUpdateToDatalayer","intel","in_page","name","category","chatbotButtonUpdate","render","h","id","triggerType","ChatbotTriggerType","defaultCallToAction","autoOpen","autoOpenForApp","banner","aurora","contactCard"],"sources":["./src/components/pnl-chatbot-trigger/middleman-configuration-service.ts","./src/components/pnl-chatbot-trigger/pnl-chatbot-trigger.scss?tag=pnl-chatbot-trigger&encapsulation=shadow","./src/components/pnl-chatbot-trigger/pnl-chatbot-trigger.tsx"],"sourcesContent":["import { ChatbotConfiguration } from '../pnl-chatbot-container/models/chatbot.models';\n\n\nexport async function GetConfiguration(baseUrl: string, language: string): Promise {\n let languagePart = '';\n if(language) {\n languagePart = `?language=${language}`;\n }\n const middlemanUrl = `${baseUrl}/api/chatbotConfiguration?url=${window.location.href}${languagePart}`;\n var result = SendGetRequestToMiddleman(middlemanUrl)\n\n return result;\n}\n\n\nfunction SendGetRequestToMiddleman(url: string): Promise {\n var response = fetch(url, {\n method: 'GET',\n }).then((res) =>\n res.json(),\n error => {\n console.error(error);\n });\n\n return Promise.resolve(response);\n}\n\n","@import '../../../node_modules/@postnl/pci/postnl-styles/settings';\n@import '../../assets/styles/typography';\n@import '../../assets/styles/variables';\n\n$postnl-blue: #3440b6;\n$banner-grey: #f1f2f9;\n$contact-cards-grey: #f1f2f9;\n$aurora-grey: #f1f2f9;\n$contact-cards-dark-grey: #1f1e2f;\n$black: rgb(39, 50, 76);\n\n:host(*) {\n all: initial;\n font-family: $font-family-bodytext, sans-serif;\n font-size: 16px;\n box-sizing: border-box !important;\n}\n","import { Component, h, Event, State, EventEmitter, Listen, Prop, Element, Watch } from '@stencil/core';\nimport { ChatbotCallToAction, ChatbotCallToActionPriority, ChatbotConfiguration, ChatbotStartIntent, ChatbotTriggerType } from '../pnl-chatbot-container/models/chatbot.models';\nimport { GetConfiguration } from './middleman-configuration-service';\nimport { ChatbotTunnel, sessionData } from './chatbot-tunnel';\nimport { AuthenticationChangedEvent } from '../../services/authentication/authenticationchanged.event';\nimport { AuthenticationData } from '../pnl-chatbot-container/models/authentication.models';\nimport { TranslationService } from '../../helpers/translation';\nimport { SoundService } from '../../helpers/sound.service';\nimport { addAdobeAnalyticsUpdateToDatalayer } from '../../helpers/analytics.service';\nimport { createParam } from '../../helpers/chatbot-param.service';\n\n@Component({\n tag: 'pnl-chatbot-trigger',\n styleUrl: 'pnl-chatbot-trigger.scss',\n shadow: true,\n})\nexport class PnlChatbotTrigger {\n private authData: AuthenticationData = { authenticated: undefined, accessToken: null, portal: null }\n private readonly businessPortal = 'businessportal';\n @Element() element: HTMLElement;\n @State() tunnel: ChatbotTunnel;\n @State() chatbotAvailable: boolean = false;\n @State() configuration: ChatbotConfiguration;\n @State() parameters: any;\n @State() callToAction: ChatbotCallToAction;\n @State() dialogFlowAgent: string;\n @State() translations: any = {};\n @State() chatbotCanBeTriggered: boolean = true;\n @State() totalAmountScrolled: number = 0;\n @State() previousScrollPosition: number;\n @State() isAutoOpenedByScroll: boolean = false;\n @State() firstTimeComponentWillLoad = true;\n\n /**\n * Optional:\n * The barcode which belongs to the track and trace information shown at the current page.\n * If the current page contains Track and trace information you can tell the chatbot which shipment it is about.\n * When the barcode is filled, you should also fill the postalCode and countryCode.\n */\n @Prop() barcode: string;\n\n /**\n * Optional:\n * The postal code which belongs to the track and trace information shown at the current page.\n * If the current page contains Track and trace information you can tell the chatbot which shipment it is about.\n * When the postal code is filled, you should also fill the barcode and countryCode.\n */\n @Prop() postalCode: string;\n\n /**\n * Optional:\n * The country code which belongs to the track and trace information shown at the current page.\n * If the current page contains Track and trace information you can tell the chatbot which shipment it is about.\n * When the country code is filled, you should also fill the barcode and postalCode.\n */\n @Prop() countryCode: string;\n\n /**\n * Optional:\n * The firstname of the customer which will be talking to the bot.\n */\n @Prop() customerFirstName: string;\n\n /**\n * Optional:\n * The middleName of the customer which will be talking to the bot.\n */\n @Prop() customerMiddleName: string;\n\n /**\n * Optional:\n * The lastname of the customer which will be talking to the bot.\n */\n @Prop() customerLastName: string;\n\n /**\n * Optional:\n * The emailadress of the customer which will be talking to the bot.\n */\n @Prop() customerEmail: string;\n\n /**\n * Optional:\n * If true the seconary view will be shown. This can be used to show a smaller chatbottrigger in things like menu's.\n * */\n @Prop() showSecondary: boolean;\n\n /**\n * Optional:\n * The name of the startintent in Google DialogFlow for the chatbot. When this property is given, the chatbot-window will be opened immediately after initialization.\n * Note: This one should always be used in combination with the welcomeIntent.\n */\n @Prop({mutable: true}) startIntent: string;\n\n /**\n * Optional:\n * The name of the welcomeIntent in Google DialogFlow for the chatbot. When this property is given, the chatbot-window will be opened immediately after initialization.\n * Note: This one should always be used in combination with the startIntent.\n */\n @Prop({mutable: true}) welcomeIntent: string;\n\n /**\n * Optional:\n * The userId of the user if the user is a business user\n */\n @Prop() businessUserId: string;\n\n /**\n * Optional:\n * Only for business users.\n * This property contains the name of the business portal the bot is shown in.\n */\n @Prop() businessPortalName: string;\n\n /**\n * Optional:\n * Only for business users.\n * This property contains the name of the business module the bot is shown in.\n */\n @Prop() businessModuleName: string;\n\n /**\n * Optional:\n * Only for business users.\n * The customerId of the user which will be talking to the bot.\n */\n @Prop() businessCustomerId: string;\n\n /**\n * Optional:\n * Only for business users.\n * The phonenumber which will be showed at the end of the conversation.\n */\n @Prop() businessPhoneNumber: string;\n\n /**\n * Optional:\n * Only for business users.\n * The company name of the user who is now talking to the chatbot.\n */\n @Prop() companyName: string;\n\n /**\n * Optional:\n * If a user has an SSO token to validate its identity\n */\n @Prop() authenticationToken: string;\n\n /**\n * Optional:\n * caseDetailsApiUrl is used to give the detailsApiUrl for the case to the chatbotComponent\n */\n @Prop() caseDetailsApiUrl: string;\n\n /**\n * Optional:\n * caseId is used to give the caseId for the case to the chatbotComponent\n */\n @Prop() caseId: string;\n\n /**\n * Optional:\n * caseStatus is used to give the status for the caseStatus to the chatbotComponent\n */\n @Prop() caseStatus: string;\n\n /**\n * Optional:\n * caseTitle is used to give the caseTitle for the case to the chatbotComponent\n */\n @Prop() caseTitle: string;\n\n /**\n * Optional:\n * caseDescription is used to give the caseDescription for the case to the chatbotComponent\n */\n @Prop() caseDescription: string;\n\n /**\n * Optional:\n * orderNumber is used to give the orderNumber for the order to the chatbotComponent\n */\n @Prop() orderNumber: string;\n\n /**\n * Optional:\n * language is used to override the default language of the chatbotComponent\n */\n @Prop() language: string;\n\n /**\n * Optional:\n * VisitorId is used to give the visitorId for the order to the chatbotComponent\n */\n @Prop() visitorId: string;\n\n /**\n * Optional:\n * loginEnabled is used to enable login in flow default is true\n */\n @Prop() loginEnabled = true;\n\n /**\n * BaseUrl(required) for the used backend service of the chatBot.\n * With this uri you can connect the chatBot with the different enviroments\n * Current FAT (Test) enviroment https://jouw.fat.postnl.nl/services/swp/middleman.\n * Current PAT (Acceptance) enviroment https://jouw.pat.postnl.nl/services/swp/middleman.\n * Current Production enviroment https://jouw.postnl.nl/services/swp/middleman.\n */\n @Prop() baseUrl: string;\n\n /**\n * Emits an event when the chatbot is toggled. Event.detail will contains true if the chatbot was opened, or false when it was closed.\n */\n @Event() chatbotToggled: EventEmitter;\n\n /**\n * Emits an event when a chatbot-start-button is pressed\n */\n @Event() chatbotButtonUpdate: EventEmitter;\n\n @Watch('baseUrl')\n TriggerReloadWhenBaseUrlChanges()\n {\n if (!this.chatbotAvailable) {\n this.componentWillLoad();\n }\n }\n\n async componentWillLoad() {\n if (this.firstTimeComponentWillLoad) {\n window.addEventListener('onAuthenticationChange', (event: any) => this.updateAuthentication(event.detail));\n window.addEventListener('chatbotToggled', (event: any) => this.handleChatbotToggled(event));\n window.addEventListener('scroll', () => this.autoOpenScroll());\n this.checkIfShadowRootIsCorrectlySet();\n\n this.firstTimeComponentWillLoad = false;\n }\n\n try {\n if (!this.baseUrl) {\n throw new Error('No base-url specified in pnl-chatbot-trigger');\n }\n this.configuration = await GetConfiguration(this.baseUrl, this.language);\n\n this.parameters = this.getParamaters();\n\n //Initialize translations\n TranslationService('chatbot', this.configuration.defaultLanguage, this.configuration.translationsBaseUrl);\n TranslationService('chatbot').translations$.subscribe(translations => this.translations = translations);\n\n //Initialize soundservice\n SoundService('chatbot', this.configuration.translationsBaseUrl);\n\n this.callToAction = this.configuration.callToActions\n .find(c => c.priority === (this.showSecondary ? ChatbotCallToActionPriority.secondary : ChatbotCallToActionPriority.primary)) ??\n this.configuration.callToActions[0];\n\n this.chatbotAvailable = this.configuration.isAvailable;\n this.dialogFlowAgent = this.configuration.dialogFlowAgent;\n this.tunnel = new ChatbotTunnel(this.configuration.tunnelPageUrl);\n this.tunnel.postMessageRetrieveCurrentData();\n this.tunnel.sessionDataFound.then((data: sessionData) => {\n if (data.startIntent) {\n this.welcomeIntent = data.welcomeIntent;\n this.startIntent = data.startIntent;\n this.dialogFlowAgent = data.dialogFlowAgent;\n }\n });\n\n if (this.parameters.authenticated === undefined) {\n setTimeout(() => {\n if (this.querySelectorAll(document, 'pnl-consumer-user-menu')?.length > 0) {\n window.dispatchEvent(new CustomEvent('postnl:identity:refreshuserinformation'));\n }\n else {\n this.authData.authenticated = false;\n this.parameters = this.getParamaters();\n }\n }, 500);\n }\n }\n catch (error) {\n this.chatbotAvailable = false;\n console.error(error)\n }\n }\n\n @Listen('chatWindowMinimized')\n minimizedChatbot() {\n window.document.body.classList.remove('chatbot-open')\n }\n\n @Listen('chatWindowClosed')\n closeChatWindow() {\n this.startIntent = null;\n this.chatbotToggled.emit(false);\n window.document.body.classList.remove('chatbot-open')\n }\n\n @Listen('chatWindowOpened')\n openChatWindow() {\n this.chatbotToggled.emit(true);\n window.document.body.classList.add('chatbot-open')\n }\n\n @Listen('chatbotOnAuthenticationChange')\n updateAuthentication(authEvent: AuthenticationChangedEvent) {\n if (authEvent.authenticated) {\n this.authData.authenticated = true;\n this.customerFirstName = authEvent.user_info.given_name;\n this.customerMiddleName = authEvent.user_info.middle_name;\n this.customerLastName = authEvent.user_info.family_name;\n this.authData.portal = authEvent.portal;\n\n if (authEvent.portal === this.businessPortal) {\n this.authData.accessToken = authEvent.id_token;\n } else {\n this.authData.accessToken = authEvent.access_token;\n }\n } else {\n this.authData.authenticated = false;\n }\n\n this.parameters = this.getParamaters();\n }\n\n private querySelectorAll(node, selector) {\n const nodes = [...node.querySelectorAll(selector)],\n nodeIterator = document.createNodeIterator(node, Node.ELEMENT_NODE);\n let currentNode;\n while (currentNode = nodeIterator.nextNode()) {\n if(currentNode.shadowRoot) {\n nodes.push(...this.querySelectorAll(currentNode.shadowRoot,selector));\n }\n }\n return nodes;\n }\n\n private autoOpenScroll() : void{\n if (!this.callToAction?.autoOpenScroll || !this.callToAction.autoOpenScroll.isActive) {\n return;\n }\n\n var winheight= window.innerHeight;\n var scrollTop = window.pageYOffset;\n var trackLength = this.getDocHeight() - winheight;\n var pctScrolled = Math.floor(scrollTop/trackLength * 100);\n\n if (this.totalAmountScrolled) {\n if (this.previousScrollPosition > pctScrolled) {\n const diff = this.previousScrollPosition - pctScrolled;\n this.totalAmountScrolled += diff;\n this.previousScrollPosition = pctScrolled;\n }\n\n if (this.previousScrollPosition < pctScrolled) {\n const diff = pctScrolled - this.previousScrollPosition;\n this.totalAmountScrolled += diff;\n this.previousScrollPosition = pctScrolled;\n }\n } else {\n this.previousScrollPosition = pctScrolled;\n this.totalAmountScrolled = pctScrolled;\n }\n\n if (this.totalAmountScrolled > this.callToAction.autoOpenScroll.scrollPercentage\n && !this.isAutoOpenedByScroll)\n {\n this.isAutoOpenedByScroll = true;\n this.triggerButtonClicked({detail:{ startIntent: this.callToAction.autoOpenScroll.startIntent,\n welcomeIntent: this.callToAction.autoOpenScroll.welcomeIntent, buttonText: 'todo'}} as CustomEvent);\n }\n }\n\n private getDocHeight() : number {\n var D = document;\n return Math.max(\n D.body.scrollHeight, D.documentElement.scrollHeight,\n D.body.offsetHeight, D.documentElement.offsetHeight,\n D.body.clientHeight, D.documentElement.clientHeight\n );\n }\n\n // We need to check if the shadowRoot is correctly set. In the Aurora bussiness portal the setting \"shadow: true\" is not working.\n // When the shadow is not set we need to attach the shadow and at the styles for the shadow. Because we need to add the styles we now have the styles duplicated unfortunately.\n private checkIfShadowRootIsCorrectlySet(): void{\n if (!this.element.shadowRoot) {\n const s = document.createElement('style');\n s.setAttribute('sty-id', 'sc-pnl-chatbot-trigger')\n s.innerHTML = `html{text-size-adjust:100%;text-rendering:optimizeSpeed;-moz-osx-font-smoothing:grayscale}@media (min-width: 30em){html{text-rendering:optimizeLegibility}}@media (min-device-pixel-ratio: 2), (min-resolution: 192dpi){html{-webkit-font-smoothing:antialiased}}*,*::before,*::after{box-sizing:inherit}html{box-sizing:border-box}:host(*){all:initial;font-family:\"Post-sans\", sans-serif;font-size:16px;box-sizing:border-box !important}`;\n const d = this.element.attachShadow({mode: 'open', delegatesFocus: false})\n d.appendChild(s);\n }\n }\n\n private getParamaters(): any {\n return createParam(this.authData, this.configuration?.defaultLanguage, this.customerFirstName,\n this.customerMiddleName, this.customerLastName, this.customerEmail, this.barcode,\n this.postalCode, this.countryCode, this.businessUserId, this.businessPortalName,\n this.businessModuleName, this.businessCustomerId, this.businessPhoneNumber, this.companyName,\n this.authenticationToken, this.caseDetailsApiUrl, this.caseId, this.caseStatus,\n this.caseTitle, this.caseDescription, this.orderNumber, this.visitorId, this.loginEnabled);\n }\n\n @Listen('callToActionButtonClicked')\n private triggerButtonClicked(event: CustomEvent) {\n if (this.chatbotCanBeTriggered) {\n if (!this.startIntent) {\n addAdobeAnalyticsUpdateToDatalayer({ intel: { in_page: { name: event.detail.buttonText, category: 'link_button_click', location: 'chatbot start' }, name: 'in_page_interaction' }}, this.chatbotButtonUpdate, null, true)\n }\n this.startIntent = event.detail.startIntent;\n this.welcomeIntent = event.detail.welcomeIntent;\n }\n }\n\n private handleChatbotToggled(event: CustomEvent) {\n this.chatbotCanBeTriggered = !event.detail;\n }\n\n render() {\n if (!this.chatbotAvailable) {\n return \n }\n\n return (\n
\n {!!this.translations &&\n
\n {this.callToAction.triggerType === ChatbotTriggerType.defaultCallToAction &&\n \n }\n {(this.callToAction.triggerType === ChatbotTriggerType.autoOpen || this.callToAction.triggerType === ChatbotTriggerType.autoOpenForApp) &&\n \n }\n {this.callToAction.triggerType === ChatbotTriggerType.banner &&\n \n }\n {this.callToAction.triggerType === ChatbotTrigger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