diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 00000000..a4672446 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,3 @@ +dist/*.js -diff +dist/*.css -diff +dist/*.map -diff diff --git a/CHANGELOG.md b/CHANGELOG.md index e7ae0797..c04915ae 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,86 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). +## [0.8.0] - 2017-07-24 +This release makes it easier to include the chatbot UI into existing +sites. The project now distributes a pre-built library in the dist +directory. This allows to use the chatbot UI without having to build the +application. The root directory of the repo now contains a package.json +file to make it easier to npm install it. + +There are a few breaking changes regarding the supported URL parameters +which now use the `lexWebUi` prefix to avoid conflicts when including +the component in an existing site. + +### Changed +- **[BREAKING]** Changed config passing URL query parameter from `config` + to `lexWebUiConfig` +- **[BREAKING]** Changed URL query parameter to run in embedded mode from + `embed` to `lexWebUiEmbed` +- The `parentOrigin` config variable now defaults to + `window.location.origin` to support single origin iframe setups + without having to set it in the the JSON config file +- Restructured Vuex store including: + * Split state, mutations and actions to individual files + * Moved audio, recorder, aws credentials/clients out of the state. + Those now exist as module variables visible from the store actions + * AWS credentials from parent are now manually recreated to avoid + including the AWS SDK as part of the store +- Changed from using vuex mapGetter in components to instead use the + store state variables. This was done to avoid redistributing vuex + in the built library and to support vuex being loaded outside of the + chatbot ui. +- Moved Vue component initialization from LexApp.vue to LexWeb.vue +- Moved Page component to LexApp.vue from LexWeb.vue +- Moved webpack related import config from recorder to the general + webpack config +- Commented out webrtc-adapter import in preparation to deprecating it +- Changed constructor arguments of lex client to accept a + lexRuntime client instead of AWS credentials or SDK config. This allows + redistributing without having to include AWS SDK as a direct dependency +- Changed iframe container class name +- Rearranged the README files. The main README contains info about the + npm package and instructions to use the library. The CloudFormation and + application details where move to different README files. + +### Added +- Created a Vue plugin that can be used to instantiate the chatbot ui + both as an import in a webpack based project or by directly sourcing + the library in a script tag. The plugin registers itself and adds + a property named `$lexWebUi` to the Vue class. It adds a global Vue + component name `LexWebUi` +- Added a distribution build config and related scripts +- Added an example on how to encode the URL query parameter config +- Added a new config object key `urlQueryParams` holding the url query + parameters + +## [0.7.1] - 2017-07-17 +This release adds basic unit and e2e testing. Various components were +refactored to enable this. + +### Changed +- Synched vue build environment with latest vue cli template +- Refactored store to make it more modular and easier to test including: + * It no longer exports a Vuex object but instead exports an object that + can be used as a vuex constructor argument + * It no longer uses the global AWS object. It now creates its own AWS + Config object + * It no longer creates the bot audio element. The Audio element is set + with an action +- Moved Vuex store instantiation to the LexApp component +- Refactored the lex run time client library to accept an AWS SDK Config + object to avoid using the global one + +### Added +- Added setup for running e2e test including: + * Added nightwatch chrome options to fake devices for mocking mic + * Changed nightwatch runner to connect dev server if already running + * Basic e2e test for stand-alone and iframe +- Added setup to run unit tests including an initial set of basic tests + for the vuex store and the LexWeb Vue component +- Added version from package.js to vuex store state +- Added babel-polyfill as an npm dev dependency for unit testing + ## [0.7.0] - 2017-07-14 ### Added - Added capability to send messages from parent page to iframe using diff --git a/README.md b/README.md index d4b1bd03..296bda8d 100644 --- a/README.md +++ b/README.md @@ -1,263 +1,69 @@ # Sample Amazon Lex Web Interface -## Overview -This repository provides a set of -[AWS CloudFormation](https://aws.amazon.com/cloudformation/) templates to -automatically build and deploy a sample -[Amazon Lex](https://aws.amazon.com/lex/) -web interface. - -## Web UI Application -The sample chatbot web user interface can be used to interact with an -Amazon Lex bot using text or voice with a webRTC capable browser. - -The interface interacts with AWS services directly from the browser. Here -is a diagram of how the application works: - - - -For details about the web app, see the accompanying -[README](lex-web-ui/README.md) file and the source under the -[lex-web-ui](lex-web-ui) directory. +> Sample Amazon Lex Web Interface +## Overview +This repository provides a sample [Amazon Lex](https://aws.amazon.com/lex/) +web interface that can be integrated in your website. This web interface +allows to interact with a Lex bot directly from a browser using by text +or voice (from a webRTC capable browser). Here is a screenshot of it: - - -## Launching -To deploy a CloudFormation stack with a working demo of the application, -follow the steps below: - -1. Click the following CloudFormation button to launch your own copy of -the sample application stack in the us-east-1 (N. Virginia) AWS region: -[![cloudformation-launch-stack](https://s3.amazonaws.com/cloudformation-examples/cloudformation-launch-stack.png)](https://console.aws.amazon.com/cloudformation/home?region=us-east-1#/stacks/new?stackName=lex-web-ui&templateURL=https://s3.amazonaws.com/aws-bigdata-blog/artifacts/aws-lex-web-ui/artifacts/templates/master.yaml). -You can accept the defaults in the CloudFormation Create Stack Wizard up -until the last step. At the last step, when prompted to create the stack, -select the checkmark that says: "I acknowledge that AWS CloudFormation -might create IAM resources with custom names". It takes about 10 minutes -for the CloudFormation stacks to got to `CREATE_COMPLETE` status. -2. Once the status of all the CloudFormation stacks -is `CREATE_COMPLETE`, click on the `PipelineUrl` link in the output -section of the master stack. This will take you to the CodePipeline -console. You can monitor the progress of the deployment pipeline from -there. It takes about 10 minutes to build and deploy the application. -3. Once the pipeline has deployed successfully, go back to the -output section of the master CloudFormation stack and click on the -`ParentPageUrl` link. You can also browse to the `WebAppUrl` link. Those -links will take you to the sample application running as an embedded -iframe or as a stand-alone web application respectively. - -## CloudFormation Stack -### Diagram -Here is a diagram of the CloudFormation stack created by this project: - - - -### CloudFormation Resources -The CloudFormation stack creates the following resources in your AWS account: - -- A [Amazon Lex](http://docs.aws.amazon.com/lex/latest/dg/what-is.html) -bot. You can optionally pass the bot name of an existing one to avoid -creating a new one. -- A [Cognito Identity Pool](http://docs.aws.amazon.com/cognito/latest/developerguide/identity-pools.html) -used to pass temporary AWS credentials to the web app. You can optionally -pass the ID of an existing Cognito Identity Pool to avoid creating a -new one. -- A [CodeCommit](https://aws.amazon.com/codecommit/) -repository loaded with the source code in this project -- A continuous delivery pipeline using [CodePipeline](https://aws.amazon.com/codepipeline/) -and [CodeBuild](https://aws.amazon.com/codebuild/). -The pipeline automatically builds and deploys changes to the app committed - to the CodeCommit repo. -- An [S3](https://aws.amazon.com/s3/) bucket to store build artifacts -- Two S3 buckets to host the web application (parent and iframe). The - pipeline deploys to this bucket. -- [Lambda](https://aws.amazon.com/lambda/) functions used as CloudFormation -[Custom Resources](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-custom-resources.html) -to facilitate custom provisioning logic -- [CloudWatch Logs](http://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/WhatIsCloudWatchLogs.html) -groups automatically created to log the output of Lambda the functions -- Associated [IAM roles](http://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles.html) -for all of the above - -### CloudFormation Templates -The CloudFormation launch button above launches a master stack that in -turn creates various nested stacks. The following table lists the -CloudFormation templates used to create these stacks: - -| Template | Description | -| --- | --- | -| [templates/master.yaml](templates/master.yaml) | This is the master template used to deploy all the stacks. It uses nested sub-templates to include the ones listed below. | -| [templates/lexbot.yaml](templates/lexbot.yaml) | Lex bot and associated resources (i.e. intents and slot types). | -| [templates/cognito.yaml](templates/cognito.yaml) | Cognito Identity Pool and IAM role for unauthenticated identity access. | -| [templates/coderepo.yaml](templates/coderepo.yaml) | CodeCommit repo dynamically initialized with the files in this repo using CodeBuild and a custom resource. | -| [templates/pipeline.yaml](templates/pipeline.yaml) | Continuous deployment pipeline of the Lex Web UI Application using CodePipeline and CodeBuild. The pipeline takes the source from CodeCommit, builds the Lex web UI application using CodeBuild and deploys the app to an S3 bucket. | - -### Parameters -When launching the stack, you will see a list of available parameters -and a brief explanation of each one. You can take the default values of -most of the CloudFormation parameters. The parameters that you may need -to modify are: - -- `BotName`: Name of pre-existing Lex bot. This is an optional parameter. - If left empty, a sample bot will be created based on the - [OrderFlowers](http://docs.aws.amazon.com/lex/latest/dg/gs-bp.html) - bot in the Lex - [Getting Started](http://docs.aws.amazon.com/lex/latest/dg/gs-console.html) - documentation. -- `CognitoIdentityPoolId`: Id of an existing Cognito Identity Pool. - This is an optional parameter. If left empty, a Cognito Identity Pool - will be automatically created. The pool ID is used by the web ui to - get AWS credentials for making calls to Lex and Polly. -- `ParentOrigin`: [Origin](https://developer.mozilla.org/en-US/docs/Web/Security/Same-origin_policy) - of the parent window. Only needed if you wish to embed the web app - into an existing site using an iframe. The origin is used to control - which sites can communicate with the iframe - -### Output -Once the CloudFormation stack is successfully launched, the status of -all nested stacks will be in the `CREATE_COMPLETE` green status. At -this point, the master stack will reference the resources in the output -section. Here is a list of the output variables: - -- `PipelineUrl`: Link to CodePipeline in the AWS console. After the stack -is successfully launched, the pipeline automatically starts the build and -deployment process. You can click on this link to monitor the pipeline. -- `CodeCommitRepoUrl`: CodeCommit repository clone URL. You can clone -the repo using this link and push changes to it to have the pipeline -build and deploy the web app -- `WebAppUrl`: URL of the web app running on a full page. The -web app will be available once the pipeline has completed deploying -- `ParentPageUrl`: URL of the web app running in an iframe. This is an -optional output that is returned only when the stack creates the sample -when page. It is not returned if an existing origin is passed as a -parameter to the stack during creation. -- `CognitoIdentityPoolId`: Pool ID of the Cognito Identity Pool created -by the stack. This is an optional output that is returned only when the -stack creates a Cognito Identity Pool. It is not returned if an existing -pool ID was passed as a parameter to the stack during creation. - -## Deployment Pipeline -When the stacks have completed launching, you can see the status of -the pipeline as it builds and deploys the application. The link to the -pipeline in the AWS console can be found in the `PipelineUrl` output -variable of the master stack. - -Once the pipeline successfully finishes deploying, you should be able to -browse to the web app. The web app URL can be found in the `WebAppUrl` -output variable. - -The source of this project is automatically forked into a CodeCommit -repository created by the CloudFormation stack. Any changes pushed to -the master branch of this forked repo will automatically kick off the -pipeline which runs a CodeBuild job to build and deploy a new version -of the web app. You will need to -[setup](http://docs.aws.amazon.com/codecommit/latest/userguide/setting-up.html) -CodeCommit to push changes to this repo. You can obtain the CodeCommit -git clone URL from the `CodeCommitRepoUrl` output variable of the -master stack. - -Here is a diagram of the deployment pipeline: - - - -## Directory Structure -This project contains the following main directories: - -``` - . - |__ build # Makefile used for uploading the project sources into S3 - |__ lex-web-ui # sample Lex web ui application source - |__ templates # cloudformation templates and related lambda functions - |__ custom-resources # lambda functions used in cfn custom resources -``` -# How do I ...? - -## Use or deploy my own bot? -The `BotName` CloudFormation parameter can be used to point the -stack to an existing bot. In the application, you can also change -the configuration files or pass parameters to it (see the application -[README](lex-web-ui/README.md) file for details). - -If you want to make changes to the sample -bot deployed by the stack, you can edit the -[bot-definition.json](templates/custom-resources/bot-definition.json) -file. This file is used by the -[lex-manager.py](templates/custom-resources/lex-manager.py) which is -run in Lambda by a CloudFormation Custom Resource in the bot stack -created by the -[lexbot.yaml](templates/lexbot.yaml) template. -The bot definition is in a JSON file that contains all the resources -associated with the bot including intents and slot types. - -The lex-manager.py script can be also used as a stand-alone shell script. -It allows to export existing bots (including associated resources like -intents and slot types) into a JSON file. The same script can be -used to import a bot definition into an account or to recursively delete -a bot and associated resources. Here is the script usage: + + +## Integrating into your Site +You can consume this project as a library that renders the chatbot +UI component in your site. The library can be included in your web +application by importing it as a module in a +[webpack](https://webpack.github.io/) +based project or by directly sourcing it in an HTML ` + + + + + + + + + diff --git a/dist/lex-web-ui.css b/dist/lex-web-ui.css new file mode 100644 index 00000000..5d859460 --- /dev/null +++ b/dist/lex-web-ui.css @@ -0,0 +1,2 @@ +#lex-web{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;width:100%}.message-list[data-v-20b8f18d]{background-color:#fafafa;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-flex:1;-ms-flex:1;flex:1;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;margin-right:0;margin-left:0;overflow-y:auto;padding-top:.3em;padding-bottom:.5em;width:100%}.message-bot[data-v-20b8f18d]{-ms-flex-item-align:start;align-self:flex-start}.message-human[data-v-20b8f18d]{-ms-flex-item-align:end;align-self:flex-end}.message[data-v-290c8f4f]{max-width:66vw}.audio-label[data-v-290c8f4f]{padding-left:.8em}.message-bot .chip[data-v-290c8f4f]{background-color:#ffebee}.message-human .chip[data-v-290c8f4f]{background-color:#e8eaf6}.chip[data-v-290c8f4f]{height:auto;margin:5px;font-size:calc(1em + .25vmin)}.play-button[data-v-290c8f4f]{font-size:2em}.response-card[data-v-290c8f4f]{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;margin:.8em;width:90vw}.message-text[data-v-d69cb2c8]{white-space:normal;padding:.8em}.card[data-v-799b9a4e]{width:75vw;position:inherit;padding-bottom:.5em}.card__title[data-v-799b9a4e]{padding:.5em;padding-top:.75em}.card__text[data-v-799b9a4e]{padding:.33em}.card__actions.button-row[data-v-799b9a4e]{-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;padding-bottom:.15em}.status-bar[data-v-2df12d09]{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column}.status-text[data-v-2df12d09]{-ms-flex-item-align:center;align-self:center;display:-webkit-box;display:-ms-flexbox;display:flex;text-align:center}.volume-meter[data-v-2df12d09]{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center}.volume-meter meter[data-v-2df12d09]{height:.75rem;width:33vw}.input-container[data-v-6dd14e82]{display:-webkit-box;display:-ms-flexbox;display:flex}.input-group[data-v-6dd14e82]{margin-top:.5em;margin-bottom:0;margin-right:.25em} +/*# sourceMappingURL=lex-web-ui.css.map*/ \ No newline at end of file diff --git a/dist/lex-web-ui.css.map b/dist/lex-web-ui.css.map new file mode 100644 index 00000000..0e97a3a2 --- /dev/null +++ b/dist/lex-web-ui.css.map @@ -0,0 +1 @@ +{"version":3,"sources":["webpack:///./src/components/LexWeb.vue","webpack:///./src/components/MessageList.vue","webpack:///./src/components/Message.vue","webpack:///./src/components/MessageText.vue","webpack:///./src/components/ResponseCard.vue","webpack:///./src/components/StatusBar.vue","webpack:///./src/components/InputContainer.vue"],"names":[],"mappings":"AACA,SACE,oBACA,oBACA,aACA,4BACA,6BACI,0BACI,sBACR,UAAY,CCRd,+BACE,yBACA,oBACA,oBACA,aACA,mBACI,WACI,OACR,4BACA,6BACI,0BACI,sBACR,eACA,cACA,gBACA,iBACA,oBACA,UAAY,CAEd,8BACE,0BACI,qBAAuB,CAE7B,gCACE,wBACI,mBAAqB,CCzB3B,0BACE,cAAgB,CAElB,8BACE,iBAAoB,CAEtB,oCACE,wBAA0B,CAE5B,sCACE,wBAA0B,CAE5B,uBACE,YACA,WACA,6BAAgC,CAElC,8BACE,aAAe,CAEjB,gCACE,oBACA,oBACA,aACA,wBACI,qBACI,uBACR,YACA,UAAY,CC5Bd,+BACE,mBACA,YAAe,CCFjB,uBACE,WACA,iBACA,mBAAsB,CAExB,8BACE,aACA,iBAAoB,CAEtB,6BACE,aAAgB,CAElB,2CACE,wBACI,qBACI,uBACR,oBAAuB,CChBzB,6BACE,oBACA,oBACA,aACA,4BACA,6BACI,0BACI,qBAAuB,CAEjC,8BACE,2BACI,kBACJ,oBACA,oBACA,aACA,iBAAmB,CAErB,+BACE,oBACA,oBACA,aACA,wBACI,qBACI,sBAAwB,CAElC,qCACE,cACA,UAAY,CC3Bd,kCACE,oBACA,oBACA,YAAc,CAEhB,8BACE,gBACA,gBACA,kBAAqB","file":"bundle/lex-web-ui.css","sourcesContent":["\n#lex-web {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-orient: vertical;\n -webkit-box-direction: normal;\n -ms-flex-direction: column;\n flex-direction: column;\n width: 100%;\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/components/LexWeb.vue","\n.message-list[data-v-20b8f18d] {\n background-color: #FAFAFA; /* gray-50 from material palette */\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-flex: 1;\n -ms-flex: 1;\n flex: 1;\n -webkit-box-orient: vertical;\n -webkit-box-direction: normal;\n -ms-flex-direction: column;\n flex-direction: column;\n margin-right: 0px;\n margin-left: 0px;\n overflow-y: auto;\n padding-top: 0.3em;\n padding-bottom: 0.5em;\n width: 100%;\n}\n.message-bot[data-v-20b8f18d] {\n -ms-flex-item-align: start;\n align-self: flex-start;\n}\n.message-human[data-v-20b8f18d] {\n -ms-flex-item-align: end;\n align-self: flex-end;\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/components/MessageList.vue","\n.message[data-v-290c8f4f] {\n max-width: 66vw;\n}\n.audio-label[data-v-290c8f4f] {\n padding-left: 0.8em;\n}\n.message-bot .chip[data-v-290c8f4f] {\n background-color: #FFEBEE; /* red-50 from material palette */\n}\n.message-human .chip[data-v-290c8f4f] {\n background-color: #E8EAF6; /* indigo-50 from material palette */\n}\n.chip[data-v-290c8f4f] {\n height: auto;\n margin: 5px;\n font-size: calc(1em + 0.25vmin);\n}\n.play-button[data-v-290c8f4f] {\n font-size: 2em;\n}\n.response-card[data-v-290c8f4f] {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-pack: center;\n -ms-flex-pack: center;\n justify-content: center;\n margin: 0.8em;\n width: 90vw;\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/components/Message.vue","\n.message-text[data-v-d69cb2c8] {\n white-space: normal;\n padding: 0.8em;\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/components/MessageText.vue","\n.card[data-v-799b9a4e] {\n width: 75vw;\n position: inherit; /* workaround to card being displayed on top of toolbar shadow */\n padding-bottom: 0.5em;\n}\n.card__title[data-v-799b9a4e] {\n padding: 0.5em;\n padding-top: 0.75em;\n}\n.card__text[data-v-799b9a4e] {\n padding: 0.33em;\n}\n.card__actions.button-row[data-v-799b9a4e] {\n -webkit-box-pack: center;\n -ms-flex-pack: center;\n justify-content: center;\n padding-bottom: 0.15em;\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/components/ResponseCard.vue","\n.status-bar[data-v-2df12d09] {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-orient: vertical;\n -webkit-box-direction: normal;\n -ms-flex-direction: column;\n flex-direction: column;\n}\n.status-text[data-v-2df12d09] {\n -ms-flex-item-align: center;\n align-self: center;\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n text-align: center;\n}\n.volume-meter[data-v-2df12d09] {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-pack: center;\n -ms-flex-pack: center;\n justify-content: center;\n}\n.volume-meter meter[data-v-2df12d09] {\n height: 0.75rem;\n width: 33vw;\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/components/StatusBar.vue","\n.input-container[data-v-6dd14e82] {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n}\n.input-group[data-v-6dd14e82] {\n margin-top: 0.5em;\n margin-bottom: 0;\n margin-right: 0.25em;\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/components/InputContainer.vue"],"sourceRoot":""} \ No newline at end of file diff --git a/dist/lex-web-ui.js b/dist/lex-web-ui.js new file mode 100644 index 00000000..1ee81422 --- /dev/null +++ b/dist/lex-web-ui.js @@ -0,0 +1,6875 @@ +(function webpackUniversalModuleDefinition(root, factory) { + if(typeof exports === 'object' && typeof module === 'object') + module.exports = factory(require("vue"), require("vuex"), require("aws-sdk/global"), require("aws-sdk/clients/lexruntime"), require("aws-sdk/clients/polly")); + else if(typeof define === 'function' && define.amd) + define(["vue", "vuex", "aws-sdk/global", "aws-sdk/clients/lexruntime", "aws-sdk/clients/polly"], factory); + else if(typeof exports === 'object') + exports["LexWebUi"] = factory(require("vue"), require("vuex"), require("aws-sdk/global"), require("aws-sdk/clients/lexruntime"), require("aws-sdk/clients/polly")); + else + root["LexWebUi"] = factory(root["vue"], root["vuex"], root["aws-sdk/global"], root["aws-sdk/clients/lexruntime"], root["aws-sdk/clients/polly"]); +})(this, function(__WEBPACK_EXTERNAL_MODULE_84__, __WEBPACK_EXTERNAL_MODULE_85__, __WEBPACK_EXTERNAL_MODULE_86__, __WEBPACK_EXTERNAL_MODULE_87__, __WEBPACK_EXTERNAL_MODULE_88__) { +return /******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) { +/******/ return installedModules[moduleId].exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ i: moduleId, +/******/ l: false, +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __webpack_require__.d = function(exports, name, getter) { +/******/ if(!__webpack_require__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { +/******/ configurable: false, +/******/ enumerable: true, +/******/ get: getter +/******/ }); +/******/ } +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __webpack_require__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = "/"; +/******/ +/******/ // Load entry module and return exports +/******/ return __webpack_require__(__webpack_require__.s = 60); +/******/ }) +/************************************************************************/ +/******/ ([ +/* 0 */ +/***/ (function(module, exports) { + +var core = module.exports = {version: '2.4.0'}; +if(typeof __e == 'number')__e = core; // eslint-disable-line no-undef + +/***/ }), +/* 1 */ +/***/ (function(module, exports, __webpack_require__) { + +var store = __webpack_require__(35)('wks') + , uid = __webpack_require__(21) + , Symbol = __webpack_require__(2).Symbol + , USE_SYMBOL = typeof Symbol == 'function'; + +var $exports = module.exports = function(name){ + return store[name] || (store[name] = + USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : uid)('Symbol.' + name)); +}; + +$exports.store = store; + +/***/ }), +/* 2 */ +/***/ (function(module, exports) { + +// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028 +var global = module.exports = typeof window != 'undefined' && window.Math == Math + ? window : typeof self != 'undefined' && self.Math == Math ? self : Function('return this')(); +if(typeof __g == 'number')__g = global; // eslint-disable-line no-undef + +/***/ }), +/* 3 */ +/***/ (function(module, exports, __webpack_require__) { + +var anObject = __webpack_require__(4) + , IE8_DOM_DEFINE = __webpack_require__(45) + , toPrimitive = __webpack_require__(30) + , dP = Object.defineProperty; + +exports.f = __webpack_require__(5) ? Object.defineProperty : function defineProperty(O, P, Attributes){ + anObject(O); + P = toPrimitive(P, true); + anObject(Attributes); + if(IE8_DOM_DEFINE)try { + return dP(O, P, Attributes); + } catch(e){ /* empty */ } + if('get' in Attributes || 'set' in Attributes)throw TypeError('Accessors not supported!'); + if('value' in Attributes)O[P] = Attributes.value; + return O; +}; + +/***/ }), +/* 4 */ +/***/ (function(module, exports, __webpack_require__) { + +var isObject = __webpack_require__(16); +module.exports = function(it){ + if(!isObject(it))throw TypeError(it + ' is not an object!'); + return it; +}; + +/***/ }), +/* 5 */ +/***/ (function(module, exports, __webpack_require__) { + +// Thank's IE8 for his funny defineProperty +module.exports = !__webpack_require__(11)(function(){ + return Object.defineProperty({}, 'a', {get: function(){ return 7; }}).a != 7; +}); + +/***/ }), +/* 6 */ +/***/ (function(module, exports) { + +/* globals __VUE_SSR_CONTEXT__ */ + +// this module is a runtime utility for cleaner component module output and will +// be included in the final webpack user bundle + +module.exports = function normalizeComponent ( + rawScriptExports, + compiledTemplate, + injectStyles, + scopeId, + moduleIdentifier /* server only */ +) { + var esModule + var scriptExports = rawScriptExports = rawScriptExports || {} + + // ES6 modules interop + var type = typeof rawScriptExports.default + if (type === 'object' || type === 'function') { + esModule = rawScriptExports + scriptExports = rawScriptExports.default + } + + // Vue.extend constructor export interop + var options = typeof scriptExports === 'function' + ? scriptExports.options + : scriptExports + + // render functions + if (compiledTemplate) { + options.render = compiledTemplate.render + options.staticRenderFns = compiledTemplate.staticRenderFns + } + + // scopedId + if (scopeId) { + options._scopeId = scopeId + } + + var hook + if (moduleIdentifier) { // server build + hook = function (context) { + // 2.3 injection + context = + context || // cached call + (this.$vnode && this.$vnode.ssrContext) || // stateful + (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional + // 2.2 with runInNewContext: true + if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') { + context = __VUE_SSR_CONTEXT__ + } + // inject component styles + if (injectStyles) { + injectStyles.call(this, context) + } + // register component module identifier for async chunk inferrence + if (context && context._registeredComponents) { + context._registeredComponents.add(moduleIdentifier) + } + } + // used by ssr in case component is cached and beforeCreate + // never gets called + options._ssrRegister = hook + } else if (injectStyles) { + hook = injectStyles + } + + if (hook) { + var functional = options.functional + var existing = functional + ? options.render + : options.beforeCreate + if (!functional) { + // inject component registration as beforeCreate hook + options.beforeCreate = existing + ? [].concat(existing, hook) + : [hook] + } else { + // register for functioal component in vue file + options.render = function renderWithStyleInjection (h, context) { + hook.call(context) + return existing(h, context) + } + } + } + + return { + esModule: esModule, + exports: scriptExports, + options: options + } +} + + +/***/ }), +/* 7 */ +/***/ (function(module, exports, __webpack_require__) { + +var global = __webpack_require__(2) + , core = __webpack_require__(0) + , ctx = __webpack_require__(15) + , hide = __webpack_require__(8) + , PROTOTYPE = 'prototype'; + +var $export = function(type, name, source){ + var IS_FORCED = type & $export.F + , IS_GLOBAL = type & $export.G + , IS_STATIC = type & $export.S + , IS_PROTO = type & $export.P + , IS_BIND = type & $export.B + , IS_WRAP = type & $export.W + , exports = IS_GLOBAL ? core : core[name] || (core[name] = {}) + , expProto = exports[PROTOTYPE] + , target = IS_GLOBAL ? global : IS_STATIC ? global[name] : (global[name] || {})[PROTOTYPE] + , key, own, out; + if(IS_GLOBAL)source = name; + for(key in source){ + // contains in native + own = !IS_FORCED && target && target[key] !== undefined; + if(own && key in exports)continue; + // export native or passed + out = own ? target[key] : source[key]; + // prevent global pollution for namespaces + exports[key] = IS_GLOBAL && typeof target[key] != 'function' ? source[key] + // bind timers to global for call from export context + : IS_BIND && own ? ctx(out, global) + // wrap global constructors for prevent change them in library + : IS_WRAP && target[key] == out ? (function(C){ + var F = function(a, b, c){ + if(this instanceof C){ + switch(arguments.length){ + case 0: return new C; + case 1: return new C(a); + case 2: return new C(a, b); + } return new C(a, b, c); + } return C.apply(this, arguments); + }; + F[PROTOTYPE] = C[PROTOTYPE]; + return F; + // make static versions for prototype methods + })(out) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out; + // export proto methods to core.%CONSTRUCTOR%.methods.%NAME% + if(IS_PROTO){ + (exports.virtual || (exports.virtual = {}))[key] = out; + // export proto methods to core.%CONSTRUCTOR%.prototype.%NAME% + if(type & $export.R && expProto && !expProto[key])hide(expProto, key, out); + } + } +}; +// type bitmap +$export.F = 1; // forced +$export.G = 2; // global +$export.S = 4; // static +$export.P = 8; // proto +$export.B = 16; // bind +$export.W = 32; // wrap +$export.U = 64; // safe +$export.R = 128; // real proto method for `library` +module.exports = $export; + +/***/ }), +/* 8 */ +/***/ (function(module, exports, __webpack_require__) { + +var dP = __webpack_require__(3) + , createDesc = __webpack_require__(17); +module.exports = __webpack_require__(5) ? function(object, key, value){ + return dP.f(object, key, createDesc(1, value)); +} : function(object, key, value){ + object[key] = value; + return object; +}; + +/***/ }), +/* 9 */ +/***/ (function(module, exports) { + +var hasOwnProperty = {}.hasOwnProperty; +module.exports = function(it, key){ + return hasOwnProperty.call(it, key); +}; + +/***/ }), +/* 10 */ +/***/ (function(module, exports, __webpack_require__) { + +// to indexed object, toObject with fallback for non-array-like ES3 strings +var IObject = __webpack_require__(47) + , defined = __webpack_require__(31); +module.exports = function(it){ + return IObject(defined(it)); +}; + +/***/ }), +/* 11 */ +/***/ (function(module, exports) { + +module.exports = function(exec){ + try { + return !!exec(); + } catch(e){ + return true; + } +}; + +/***/ }), +/* 12 */ +/***/ (function(module, exports, __webpack_require__) { + +// 19.1.2.14 / 15.2.3.14 Object.keys(O) +var $keys = __webpack_require__(46) + , enumBugKeys = __webpack_require__(36); + +module.exports = Object.keys || function keys(O){ + return $keys(O, enumBugKeys); +}; + +/***/ }), +/* 13 */ +/***/ (function(module, exports, __webpack_require__) { + +module.exports = { "default": __webpack_require__(68), __esModule: true }; + +/***/ }), +/* 14 */ +/***/ (function(module, exports) { + +module.exports = {}; + +/***/ }), +/* 15 */ +/***/ (function(module, exports, __webpack_require__) { + +// optional / simple context binding +var aFunction = __webpack_require__(28); +module.exports = function(fn, that, length){ + aFunction(fn); + if(that === undefined)return fn; + switch(length){ + case 1: return function(a){ + return fn.call(that, a); + }; + case 2: return function(a, b){ + return fn.call(that, a, b); + }; + case 3: return function(a, b, c){ + return fn.call(that, a, b, c); + }; + } + return function(/* ...args */){ + return fn.apply(that, arguments); + }; +}; + +/***/ }), +/* 16 */ +/***/ (function(module, exports) { + +module.exports = function(it){ + return typeof it === 'object' ? it !== null : typeof it === 'function'; +}; + +/***/ }), +/* 17 */ +/***/ (function(module, exports) { + +module.exports = function(bitmap, value){ + return { + enumerable : !(bitmap & 1), + configurable: !(bitmap & 2), + writable : !(bitmap & 4), + value : value + }; +}; + +/***/ }), +/* 18 */ +/***/ (function(module, exports) { + +var toString = {}.toString; + +module.exports = function(it){ + return toString.call(it).slice(8, -1); +}; + +/***/ }), +/* 19 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $at = __webpack_require__(69)(true); + +// 21.1.3.27 String.prototype[@@iterator]() +__webpack_require__(49)(String, 'String', function(iterated){ + this._t = String(iterated); // target + this._i = 0; // next index +// 21.1.5.2.1 %StringIteratorPrototype%.next() +}, function(){ + var O = this._t + , index = this._i + , point; + if(index >= O.length)return {value: undefined, done: true}; + point = $at(O, index); + this._i += point.length; + return {value: point, done: false}; +}); + +/***/ }), +/* 20 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +exports.__esModule = true; + +var _assign = __webpack_require__(44); + +var _assign2 = _interopRequireDefault(_assign); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +exports.default = _assign2.default || function (target) { + for (var i = 1; i < arguments.length; i++) { + var source = arguments[i]; + + for (var key in source) { + if (Object.prototype.hasOwnProperty.call(source, key)) { + target[key] = source[key]; + } + } + } + + return target; +}; + +/***/ }), +/* 21 */ +/***/ (function(module, exports) { + +var id = 0 + , px = Math.random(); +module.exports = function(key){ + return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36)); +}; + +/***/ }), +/* 22 */ +/***/ (function(module, exports) { + +exports.f = {}.propertyIsEnumerable; + +/***/ }), +/* 23 */ +/***/ (function(module, exports, __webpack_require__) { + +// 7.1.13 ToObject(argument) +var defined = __webpack_require__(31); +module.exports = function(it){ + return Object(defined(it)); +}; + +/***/ }), +/* 24 */ +/***/ (function(module, exports) { + +module.exports = true; + +/***/ }), +/* 25 */ +/***/ (function(module, exports, __webpack_require__) { + +var def = __webpack_require__(3).f + , has = __webpack_require__(9) + , TAG = __webpack_require__(1)('toStringTag'); + +module.exports = function(it, tag, stat){ + if(it && !has(it = stat ? it : it.prototype, TAG))def(it, TAG, {configurable: true, value: tag}); +}; + +/***/ }), +/* 26 */ +/***/ (function(module, exports, __webpack_require__) { + +__webpack_require__(73); +var global = __webpack_require__(2) + , hide = __webpack_require__(8) + , Iterators = __webpack_require__(14) + , TO_STRING_TAG = __webpack_require__(1)('toStringTag'); + +for(var collections = ['NodeList', 'DOMTokenList', 'MediaList', 'StyleSheetList', 'CSSRuleList'], i = 0; i < 5; i++){ + var NAME = collections[i] + , Collection = global[NAME] + , proto = Collection && Collection.prototype; + if(proto && !proto[TO_STRING_TAG])hide(proto, TO_STRING_TAG, NAME); + Iterators[NAME] = Iterators.Array; +} + +/***/ }), +/* 27 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (immutable) */ __webpack_exports__["b"] = mergeConfig; +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return config; }); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_core_js_object_keys__ = __webpack_require__(122); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_core_js_object_keys___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_core_js_object_keys__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_extends__ = __webpack_require__(20); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_extends___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_extends__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_defineProperty__ = __webpack_require__(126); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_defineProperty___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_defineProperty__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_slicedToArray__ = __webpack_require__(57); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_slicedToArray___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_slicedToArray__); + + + + +/* + Copyright 2017-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. + + Licensed under the Amazon Software License (the "License"). You may not use this file + except in compliance with the License. A copy of the License is located at + + http://aws.amazon.com/asl/ + + or in the "license" file accompanying this file. This file is distributed on an "AS IS" + BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, express or implied. See the + License for the specific language governing permissions and limitations under the License. + */ + +/** + * Application configuration management. + * This file contains default config values and merges the environment + * and URL configs. + * + * The environment dependent values are loaded from files + * with the config..json naming syntax (where is a NODE_ENV value + * such as 'prod' or 'dev') located in the same directory as this file. + * + * The URL configuration is parsed from the `config` URL parameter as + * a JSON object + * + * NOTE: To avoid having to manually merge future changes to this file, you + * probably want to modify default values in the config..js files instead + * of this one. + */ + +/* eslint no-console: ["error", { allow: ["warn", "error"] }] */ + +// TODO turn this into a class + +// Search for logo image files in ../assets/ +// if not found, assigns the default flower logo. +var toolbarLogoRequire = +// Logo loading depends on the webpack require.context API: +// https://webpack.github.io/docs/context.html +__webpack_require__(133); +var toolbarLogoRequireKey = toolbarLogoRequire.keys().pop(); + +var toolbarLogo = toolbarLogoRequireKey ? toolbarLogoRequire(toolbarLogoRequireKey) : __webpack_require__(134); + +// search for favicon in assets directory - use toolbar logo if not found +var favIconRequire = __webpack_require__(135); +var favIconRequireKey = favIconRequire.keys().pop(); +var favIcon = favIconRequireKey ? favIconRequire(favIconRequireKey) : toolbarLogo; + +// get env shortname to require file +var envShortName = ['dev', 'prod', 'test'].find(function (env) { + return "production".startsWith(env); +}); + +if (!envShortName) { + console.error('unknown environment in config: ', "production"); +} + +// eslint-disable-next-line import/no-dynamic-require +var configEnvFile = __webpack_require__(136)("./config." + envShortName + '.json'); + +// default config used to provide a base structure for +// environment and dynamic configs +var configDefault = { + // AWS region + region: 'us-east-1', + + cognito: { + // Cognito pool id used to obtain credentials + // e.g. poolId: 'us-east-1:deadbeef-cac0-babe-abcd-abcdef01234', + poolId: '' + }, + + lex: { + // Lex bot name + botName: 'WebUiOrderFlowers', + + // Lex bot alias/version + botAlias: '$LATEST', + + // instruction message shown in the UI + initialText: 'You can ask me for help ordering flowers. ' + 'Just type "order flowers" or click on the mic and say it.', + + // instructions spoken when mic is clicked + initialSpeechInstruction: 'Say "Order Flowers" to get started', + + // Lex initial sessionAttributes + sessionAttributes: {}, + + // controls if the session attributes are reinitialized a + // after the bot dialog is done (i.e. fail or fulfilled) + reInitSessionAttributesOnRestart: true, + + // allow to interrupt playback of lex responses by talking over playback + // XXX experimental + enablePlaybackInterrupt: false, + + // microphone volume level (in dB) to cause an interrupt in the bot + // playback. Lower (negative) values makes interrupt more likely + // may need to adjusted down if using low_latency preset or band pass filter + playbackInterruptVolumeThreshold: -60, + + // microphone slow sample level to cause an interrupt in the bot + // playback. Lower values makes interrupt more likely + // may need to adjusted down if using low_latency preset or band pass filter + playbackInterruptLevelThreshold: 0.0075, + + // microphone volume level (in dB) to cause enable interrupt of bot + // playback. This is used to prevent interrupts when there's noise + // For interrupt to be enabled, the volume level should be lower than this + // value. Lower (negative) values makes interrupt more likely + // may need to adjusted down if using low_latency preset or band pass filter + playbackInterruptNoiseThreshold: -75, + + // only allow to interrupt playback longer than this value (in seconds) + playbackInterruptMinDuration: 2 + }, + + polly: { + voiceId: 'Joanna' + }, + + ui: { + // title of HTML page added dynamically to index.html + pageTitle: 'Order Flowers Bot', + + // when running as an embedded iframe, this will be used as the + // be the parent origin used to send/receive messages + // NOTE: this is also a security control + // this parameter should not be dynamically overriden + // avoid making it '*' + // if left as an empty string, it will be set to window.location.window + // to allow runing embedded in a single origin setup + parentOrigin: '', + + // chat window text placeholder + textInputPlaceholder: 'Type here', + + toolbarColor: 'red', + + // chat window title + toolbarTitle: 'Order Flowers', + + // logo used in toolbar - also used as favicon not specificied + toolbarLogo: toolbarLogo, + + // fav icon + favIcon: favIcon, + + // controls if the Lex initialText will be pushed into the message + // list after the bot dialog is done (i.e. fail or fulfilled) + pushInitialTextOnRestart: true, + + // controls if the Lex sessionAttributes should be re-initialized + // to the config value (i.e. lex.sessionAttributes) + // after the bot dialog is done (i.e. fail or fulfilled) + reInitSessionAttributesOnRestart: false, + + // controls whether URLs in bot responses will be converted to links + convertUrlToLinksInBotMessages: true, + + // controls whether tags (e.g. SSML or HTML) should be stripped out + // of bot messages received from Lex + stripTagsFromBotMessages: true + }, + + /* Configuration to enable voice and to pass options to the recorder + * see ../lib/recorder.js for details about all the available options. + * You can override any of the defaults in recorder.js by adding them + * to the corresponding JSON config file (config..json) + * or alternatively here + */ + recorder: { + // if set to true, voice interaction would be enabled on supported browsers + // set to false if you don't want voice enabled + enable: true, + + // maximum recording time in seconds + recordingTimeMax: 10, + + // Minimum recording time in seconds. + // Used before evaluating if the line is quiet to allow initial pauses + // before speech + recordingTimeMin: 2.5, + + // Sound sample threshold to determine if there's silence. + // This is measured against a value of a sample over a period of time + // If set too high, it may falsely detect quiet recordings + // If set too low, it could take long pauses before detecting silence or + // not detect it at all. + // Reasonable values seem to be between 0.001 and 0.003 + quietThreshold: 0.002, + + // time before automatically stopping the recording when + // there's silence. This is compared to a slow decaying + // sample level so its's value is relative to sound over + // a period of time. Reasonable times seem to be between 0.2 and 0.5 + quietTimeMin: 0.3, + + // volume threshold in db to determine if there's silence. + // Volume levels lower than this would trigger a silent event + // Works in conjuction with `quietThreshold`. Lower (negative) values + // cause the silence detection to converge faster + // Reasonable values seem to be between -75 and -55 + volumeThreshold: -65, + + // use automatic mute detection + useAutoMuteDetect: false + }, + + converser: { + // used to control maximum number of consecutive silent recordings + // before the conversation is ended + silentConsecutiveRecordingMax: 3 + }, + + // URL query parameters are put in here at run time + urlQueryParams: {} +}; + +/** + * Obtains the URL query params and returns it as an object + * This can be used before the router has been setup + */ +function getUrlQueryParams(url) { + try { + return url.split('?', 2) // split query string up to a max of 2 elems + .slice(1, 2) // grab what's after the '?' char + // split params separated by '&' + .reduce(function (params, queryString) { + return queryString.split('&'); + }, []) + // further split into key value pairs separated by '=' + .map(function (params) { + return params.split('='); + }) + // turn into an object representing the URL query key/vals + .reduce(function (queryObj, param) { + var _param = __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_slicedToArray___default()(param, 2), + key = _param[0], + _param$ = _param[1], + value = _param$ === undefined ? true : _param$; + + var paramObj = __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_defineProperty___default()({}, key, decodeURIComponent(value)); + return __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_extends___default()({}, queryObj, paramObj); + }, {}); + } catch (e) { + console.error('error obtaining URL query parameters', e); + return {}; + } +} + +/** + * Obtains and parses the config URL parameter + */ +function getConfigFromQuery(query) { + try { + return query.lexWebUiConfig ? JSON.parse(query.lexWebUiConfig) : {}; + } catch (e) { + console.error('error parsing config from URL query', e); + return {}; + } +} + +/** + * Merge two configuration objects + * The merge process takes the base config as the source for keys to be merged + * The values in srcConfig take precedence in the merge. + * Merges down to the second level + */ +function mergeConfig(configBase, configSrc) { + // iterate over the keys of the config base + return __WEBPACK_IMPORTED_MODULE_0_babel_runtime_core_js_object_keys___default()(configBase).map(function (key) { + // only grab keys that already exist in the config base + var value = key in configSrc ? + // merge the second level key/values + // overriding the base values with the ones from the source + __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_extends___default()({}, configBase[key], configSrc[key]) : configBase[key]; + return __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_defineProperty___default()({}, key, value); + }) + // merge the first level key values back into a single object + .reduce(function (merged, configItem) { + return __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_extends___default()({}, merged, configItem); + }, {}); +} + +// merge build time parameters +var configFromFiles = mergeConfig(configDefault, configEnvFile); + +// run time config from url query parameter +var queryParams = getUrlQueryParams(window.location.href); +var configFromQuery = getConfigFromQuery(queryParams); +// security: delete origin from dynamic parameter +if (configFromQuery.ui && configFromQuery.ui.parentOrigin) { + delete configFromQuery.ui.parentOrigin; +} + +var configFromMerge = mergeConfig(configFromFiles, configFromQuery); + +// if parent origin is empty, assume to be running in the same origin +configFromMerge.ui.parentOrigin = configFromMerge.ui.parentOrigin || window.location.origin; + +var config = __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_extends___default()({}, configFromMerge, { + urlQueryParams: queryParams +}); + +/***/ }), +/* 28 */ +/***/ (function(module, exports) { + +module.exports = function(it){ + if(typeof it != 'function')throw TypeError(it + ' is not a function!'); + return it; +}; + +/***/ }), +/* 29 */ +/***/ (function(module, exports, __webpack_require__) { + +var isObject = __webpack_require__(16) + , document = __webpack_require__(2).document + // in old IE typeof document.createElement is 'object' + , is = isObject(document) && isObject(document.createElement); +module.exports = function(it){ + return is ? document.createElement(it) : {}; +}; + +/***/ }), +/* 30 */ +/***/ (function(module, exports, __webpack_require__) { + +// 7.1.1 ToPrimitive(input [, PreferredType]) +var isObject = __webpack_require__(16); +// instead of the ES6 spec version, we didn't implement @@toPrimitive case +// and the second argument - flag - preferred type is a string +module.exports = function(it, S){ + if(!isObject(it))return it; + var fn, val; + if(S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it)))return val; + if(typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it)))return val; + if(!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it)))return val; + throw TypeError("Can't convert object to primitive value"); +}; + +/***/ }), +/* 31 */ +/***/ (function(module, exports) { + +// 7.2.1 RequireObjectCoercible(argument) +module.exports = function(it){ + if(it == undefined)throw TypeError("Can't call method on " + it); + return it; +}; + +/***/ }), +/* 32 */ +/***/ (function(module, exports, __webpack_require__) { + +// 7.1.15 ToLength +var toInteger = __webpack_require__(33) + , min = Math.min; +module.exports = function(it){ + return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991 +}; + +/***/ }), +/* 33 */ +/***/ (function(module, exports) { + +// 7.1.4 ToInteger +var ceil = Math.ceil + , floor = Math.floor; +module.exports = function(it){ + return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it); +}; + +/***/ }), +/* 34 */ +/***/ (function(module, exports, __webpack_require__) { + +var shared = __webpack_require__(35)('keys') + , uid = __webpack_require__(21); +module.exports = function(key){ + return shared[key] || (shared[key] = uid(key)); +}; + +/***/ }), +/* 35 */ +/***/ (function(module, exports, __webpack_require__) { + +var global = __webpack_require__(2) + , SHARED = '__core-js_shared__' + , store = global[SHARED] || (global[SHARED] = {}); +module.exports = function(key){ + return store[key] || (store[key] = {}); +}; + +/***/ }), +/* 36 */ +/***/ (function(module, exports) { + +// IE 8- don't enum bug keys +module.exports = ( + 'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf' +).split(','); + +/***/ }), +/* 37 */ +/***/ (function(module, exports) { + +exports.f = Object.getOwnPropertySymbols; + +/***/ }), +/* 38 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +exports.__esModule = true; + +exports.default = function (instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } +}; + +/***/ }), +/* 39 */ +/***/ (function(module, exports, __webpack_require__) { + +module.exports = { "default": __webpack_require__(66), __esModule: true }; + +/***/ }), +/* 40 */ +/***/ (function(module, exports, __webpack_require__) { + +// getting tag from 19.1.3.6 Object.prototype.toString() +var cof = __webpack_require__(18) + , TAG = __webpack_require__(1)('toStringTag') + // ES3 wrong here + , ARG = cof(function(){ return arguments; }()) == 'Arguments'; + +// fallback for IE11 Script Access Denied error +var tryGet = function(it, key){ + try { + return it[key]; + } catch(e){ /* empty */ } +}; + +module.exports = function(it){ + var O, T, B; + return it === undefined ? 'Undefined' : it === null ? 'Null' + // @@toStringTag case + : typeof (T = tryGet(O = Object(it), TAG)) == 'string' ? T + // builtinTag case + : ARG ? cof(O) + // ES3 arguments fallback + : (B = cof(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : B; +}; + +/***/ }), +/* 41 */ +/***/ (function(module, exports, __webpack_require__) { + +var classof = __webpack_require__(40) + , ITERATOR = __webpack_require__(1)('iterator') + , Iterators = __webpack_require__(14); +module.exports = __webpack_require__(0).getIteratorMethod = function(it){ + if(it != undefined)return it[ITERATOR] + || it['@@iterator'] + || Iterators[classof(it)]; +}; + +/***/ }), +/* 42 */ +/***/ (function(module, exports, __webpack_require__) { + +exports.f = __webpack_require__(1); + +/***/ }), +/* 43 */ +/***/ (function(module, exports, __webpack_require__) { + +var global = __webpack_require__(2) + , core = __webpack_require__(0) + , LIBRARY = __webpack_require__(24) + , wksExt = __webpack_require__(42) + , defineProperty = __webpack_require__(3).f; +module.exports = function(name){ + var $Symbol = core.Symbol || (core.Symbol = LIBRARY ? {} : global.Symbol || {}); + if(name.charAt(0) != '_' && !(name in $Symbol))defineProperty($Symbol, name, {value: wksExt.f(name)}); +}; + +/***/ }), +/* 44 */ +/***/ (function(module, exports, __webpack_require__) { + +module.exports = { "default": __webpack_require__(61), __esModule: true }; + +/***/ }), +/* 45 */ +/***/ (function(module, exports, __webpack_require__) { + +module.exports = !__webpack_require__(5) && !__webpack_require__(11)(function(){ + return Object.defineProperty(__webpack_require__(29)('div'), 'a', {get: function(){ return 7; }}).a != 7; +}); + +/***/ }), +/* 46 */ +/***/ (function(module, exports, __webpack_require__) { + +var has = __webpack_require__(9) + , toIObject = __webpack_require__(10) + , arrayIndexOf = __webpack_require__(64)(false) + , IE_PROTO = __webpack_require__(34)('IE_PROTO'); + +module.exports = function(object, names){ + var O = toIObject(object) + , i = 0 + , result = [] + , key; + for(key in O)if(key != IE_PROTO)has(O, key) && result.push(key); + // Don't enum bug & hidden keys + while(names.length > i)if(has(O, key = names[i++])){ + ~arrayIndexOf(result, key) || result.push(key); + } + return result; +}; + +/***/ }), +/* 47 */ +/***/ (function(module, exports, __webpack_require__) { + +// fallback for non-array-like ES3 and non-enumerable old V8 strings +var cof = __webpack_require__(18); +module.exports = Object('z').propertyIsEnumerable(0) ? Object : function(it){ + return cof(it) == 'String' ? it.split('') : Object(it); +}; + +/***/ }), +/* 48 */ +/***/ (function(module, exports) { + + + +/***/ }), +/* 49 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var LIBRARY = __webpack_require__(24) + , $export = __webpack_require__(7) + , redefine = __webpack_require__(50) + , hide = __webpack_require__(8) + , has = __webpack_require__(9) + , Iterators = __webpack_require__(14) + , $iterCreate = __webpack_require__(70) + , setToStringTag = __webpack_require__(25) + , getPrototypeOf = __webpack_require__(72) + , ITERATOR = __webpack_require__(1)('iterator') + , BUGGY = !([].keys && 'next' in [].keys()) // Safari has buggy iterators w/o `next` + , FF_ITERATOR = '@@iterator' + , KEYS = 'keys' + , VALUES = 'values'; + +var returnThis = function(){ return this; }; + +module.exports = function(Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED){ + $iterCreate(Constructor, NAME, next); + var getMethod = function(kind){ + if(!BUGGY && kind in proto)return proto[kind]; + switch(kind){ + case KEYS: return function keys(){ return new Constructor(this, kind); }; + case VALUES: return function values(){ return new Constructor(this, kind); }; + } return function entries(){ return new Constructor(this, kind); }; + }; + var TAG = NAME + ' Iterator' + , DEF_VALUES = DEFAULT == VALUES + , VALUES_BUG = false + , proto = Base.prototype + , $native = proto[ITERATOR] || proto[FF_ITERATOR] || DEFAULT && proto[DEFAULT] + , $default = $native || getMethod(DEFAULT) + , $entries = DEFAULT ? !DEF_VALUES ? $default : getMethod('entries') : undefined + , $anyNative = NAME == 'Array' ? proto.entries || $native : $native + , methods, key, IteratorPrototype; + // Fix native + if($anyNative){ + IteratorPrototype = getPrototypeOf($anyNative.call(new Base)); + if(IteratorPrototype !== Object.prototype){ + // Set @@toStringTag to native iterators + setToStringTag(IteratorPrototype, TAG, true); + // fix for some old engines + if(!LIBRARY && !has(IteratorPrototype, ITERATOR))hide(IteratorPrototype, ITERATOR, returnThis); + } + } + // fix Array#{values, @@iterator}.name in V8 / FF + if(DEF_VALUES && $native && $native.name !== VALUES){ + VALUES_BUG = true; + $default = function values(){ return $native.call(this); }; + } + // Define iterator + if((!LIBRARY || FORCED) && (BUGGY || VALUES_BUG || !proto[ITERATOR])){ + hide(proto, ITERATOR, $default); + } + // Plug for library + Iterators[NAME] = $default; + Iterators[TAG] = returnThis; + if(DEFAULT){ + methods = { + values: DEF_VALUES ? $default : getMethod(VALUES), + keys: IS_SET ? $default : getMethod(KEYS), + entries: $entries + }; + if(FORCED)for(key in methods){ + if(!(key in proto))redefine(proto, key, methods[key]); + } else $export($export.P + $export.F * (BUGGY || VALUES_BUG), NAME, methods); + } + return methods; +}; + +/***/ }), +/* 50 */ +/***/ (function(module, exports, __webpack_require__) { + +module.exports = __webpack_require__(8); + +/***/ }), +/* 51 */ +/***/ (function(module, exports, __webpack_require__) { + +// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties]) +var anObject = __webpack_require__(4) + , dPs = __webpack_require__(71) + , enumBugKeys = __webpack_require__(36) + , IE_PROTO = __webpack_require__(34)('IE_PROTO') + , Empty = function(){ /* empty */ } + , PROTOTYPE = 'prototype'; + +// Create object with fake `null` prototype: use iframe Object with cleared prototype +var createDict = function(){ + // Thrash, waste and sodomy: IE GC bug + var iframe = __webpack_require__(29)('iframe') + , i = enumBugKeys.length + , lt = '<' + , gt = '>' + , iframeDocument; + iframe.style.display = 'none'; + __webpack_require__(52).appendChild(iframe); + iframe.src = 'javascript:'; // eslint-disable-line no-script-url + // createDict = iframe.contentWindow.Object; + // html.removeChild(iframe); + iframeDocument = iframe.contentWindow.document; + iframeDocument.open(); + iframeDocument.write(lt + 'script' + gt + 'document.F=Object' + lt + '/script' + gt); + iframeDocument.close(); + createDict = iframeDocument.F; + while(i--)delete createDict[PROTOTYPE][enumBugKeys[i]]; + return createDict(); +}; + +module.exports = Object.create || function create(O, Properties){ + var result; + if(O !== null){ + Empty[PROTOTYPE] = anObject(O); + result = new Empty; + Empty[PROTOTYPE] = null; + // add "__proto__" for Object.getPrototypeOf polyfill + result[IE_PROTO] = O; + } else result = createDict(); + return Properties === undefined ? result : dPs(result, Properties); +}; + + +/***/ }), +/* 52 */ +/***/ (function(module, exports, __webpack_require__) { + +module.exports = __webpack_require__(2).document && document.documentElement; + +/***/ }), +/* 53 */ +/***/ (function(module, exports, __webpack_require__) { + +// call something on iterator step with safe closing on error +var anObject = __webpack_require__(4); +module.exports = function(iterator, fn, value, entries){ + try { + return entries ? fn(anObject(value)[0], value[1]) : fn(value); + // 7.4.6 IteratorClose(iterator, completion) + } catch(e){ + var ret = iterator['return']; + if(ret !== undefined)anObject(ret.call(iterator)); + throw e; + } +}; + +/***/ }), +/* 54 */ +/***/ (function(module, exports, __webpack_require__) { + +// check on default Array iterator +var Iterators = __webpack_require__(14) + , ITERATOR = __webpack_require__(1)('iterator') + , ArrayProto = Array.prototype; + +module.exports = function(it){ + return it !== undefined && (Iterators.Array === it || ArrayProto[ITERATOR] === it); +}; + +/***/ }), +/* 55 */ +/***/ (function(module, exports, __webpack_require__) { + +var ctx = __webpack_require__(15) + , invoke = __webpack_require__(80) + , html = __webpack_require__(52) + , cel = __webpack_require__(29) + , global = __webpack_require__(2) + , process = global.process + , setTask = global.setImmediate + , clearTask = global.clearImmediate + , MessageChannel = global.MessageChannel + , counter = 0 + , queue = {} + , ONREADYSTATECHANGE = 'onreadystatechange' + , defer, channel, port; +var run = function(){ + var id = +this; + if(queue.hasOwnProperty(id)){ + var fn = queue[id]; + delete queue[id]; + fn(); + } +}; +var listener = function(event){ + run.call(event.data); +}; +// Node.js 0.9+ & IE10+ has setImmediate, otherwise: +if(!setTask || !clearTask){ + setTask = function setImmediate(fn){ + var args = [], i = 1; + while(arguments.length > i)args.push(arguments[i++]); + queue[++counter] = function(){ + invoke(typeof fn == 'function' ? fn : Function(fn), args); + }; + defer(counter); + return counter; + }; + clearTask = function clearImmediate(id){ + delete queue[id]; + }; + // Node.js 0.8- + if(__webpack_require__(18)(process) == 'process'){ + defer = function(id){ + process.nextTick(ctx(run, id, 1)); + }; + // Browsers with MessageChannel, includes WebWorkers + } else if(MessageChannel){ + channel = new MessageChannel; + port = channel.port2; + channel.port1.onmessage = listener; + defer = ctx(port.postMessage, port, 1); + // Browsers with postMessage, skip WebWorkers + // IE8 has postMessage, but it's sync & typeof its postMessage is 'object' + } else if(global.addEventListener && typeof postMessage == 'function' && !global.importScripts){ + defer = function(id){ + global.postMessage(id + '', '*'); + }; + global.addEventListener('message', listener, false); + // IE8- + } else if(ONREADYSTATECHANGE in cel('script')){ + defer = function(id){ + html.appendChild(cel('script'))[ONREADYSTATECHANGE] = function(){ + html.removeChild(this); + run.call(id); + }; + }; + // Rest old browsers + } else { + defer = function(id){ + setTimeout(ctx(run, id, 1), 0); + }; + } +} +module.exports = { + set: setTask, + clear: clearTask +}; + +/***/ }), +/* 56 */ +/***/ (function(module, exports, __webpack_require__) { + +var ITERATOR = __webpack_require__(1)('iterator') + , SAFE_CLOSING = false; + +try { + var riter = [7][ITERATOR](); + riter['return'] = function(){ SAFE_CLOSING = true; }; + Array.from(riter, function(){ throw 2; }); +} catch(e){ /* empty */ } + +module.exports = function(exec, skipClosing){ + if(!skipClosing && !SAFE_CLOSING)return false; + var safe = false; + try { + var arr = [7] + , iter = arr[ITERATOR](); + iter.next = function(){ return {done: safe = true}; }; + arr[ITERATOR] = function(){ return iter; }; + exec(arr); + } catch(e){ /* empty */ } + return safe; +}; + +/***/ }), +/* 57 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +exports.__esModule = true; + +var _isIterable2 = __webpack_require__(127); + +var _isIterable3 = _interopRequireDefault(_isIterable2); + +var _getIterator2 = __webpack_require__(130); + +var _getIterator3 = _interopRequireDefault(_getIterator2); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +exports.default = function () { + function sliceIterator(arr, i) { + var _arr = []; + var _n = true; + var _d = false; + var _e = undefined; + + try { + for (var _i = (0, _getIterator3.default)(arr), _s; !(_n = (_s = _i.next()).done); _n = true) { + _arr.push(_s.value); + + if (i && _arr.length === i) break; + } + } catch (err) { + _d = true; + _e = err; + } finally { + try { + if (!_n && _i["return"]) _i["return"](); + } finally { + if (_d) throw _e; + } + } + + return _arr; + } + + return function (arr, i) { + if (Array.isArray(arr)) { + return arr; + } else if ((0, _isIterable3.default)(Object(arr))) { + return sliceIterator(arr, i); + } else { + throw new TypeError("Invalid attempt to destructure non-iterable instance"); + } + }; +}(); + +/***/ }), +/* 58 */ +/***/ (function(module, exports, __webpack_require__) { + +// 19.1.2.7 / 15.2.3.4 Object.getOwnPropertyNames(O) +var $keys = __webpack_require__(46) + , hiddenKeys = __webpack_require__(36).concat('length', 'prototype'); + +exports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O){ + return $keys(O, hiddenKeys); +}; + +/***/ }), +/* 59 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +exports.__esModule = true; + +var _defineProperty = __webpack_require__(39); + +var _defineProperty2 = _interopRequireDefault(_defineProperty); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +exports.default = function () { + function defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + (0, _defineProperty2.default)(target, descriptor.key, descriptor); + } + } + + return function (Constructor, protoProps, staticProps) { + if (protoProps) defineProperties(Constructor.prototype, protoProps); + if (staticProps) defineProperties(Constructor, staticProps); + return Constructor; + }; +}(); + +/***/ }), +/* 60 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Store", function() { return Store; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Loader", function() { return Loader; }); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends__ = __webpack_require__(20); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_classCallCheck__ = __webpack_require__(38); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_classCallCheck___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_classCallCheck__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_babel_runtime_core_js_object_define_property__ = __webpack_require__(39); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_babel_runtime_core_js_object_define_property___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_babel_runtime_core_js_object_define_property__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_babel_runtime_core_js_promise__ = __webpack_require__(13); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_babel_runtime_core_js_promise___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_babel_runtime_core_js_promise__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_vue__ = __webpack_require__(84); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_vue__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_vuex__ = __webpack_require__(85); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_vuex___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5_vuex__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_aws_sdk_global__ = __webpack_require__(86); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_aws_sdk_global___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_6_aws_sdk_global__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_aws_sdk_clients_lexruntime__ = __webpack_require__(87); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_aws_sdk_clients_lexruntime___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_7_aws_sdk_clients_lexruntime__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8_aws_sdk_clients_polly__ = __webpack_require__(88); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8_aws_sdk_clients_polly___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_8_aws_sdk_clients_polly__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__components_LexWeb__ = __webpack_require__(89); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__store__ = __webpack_require__(120); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__config__ = __webpack_require__(27); + + + + +/* +Copyright 2017-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. + +Licensed under the Amazon Software License (the "License"). You may not use this file +except in compliance with the License. A copy of the License is located at + +http://aws.amazon.com/asl/ + +or in the "license" file accompanying this file. This file is distributed on an "AS IS" +BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, express or implied. See the +License for the specific language governing permissions and limitations under the License. +*/ + +/** + * Entry point to the lex-web-ui Vue plugin + * Exports Loader as the plugin constructor + * and Store as store that can be used with Vuex.Store() + */ + + + + + + + + + + +/** + * Vue Component + */ +var Component = { + name: 'lex-web-ui', + template: '', + components: { LexWeb: __WEBPACK_IMPORTED_MODULE_9__components_LexWeb__["a" /* default */] } +}; + +var loadingComponent = { + template: '

Loading. Please wait...

' +}; +var errorComponent = { + template: '

An error ocurred...

' +}; + +/** + * Vue Asynchonous Component + */ +var AsyncComponent = function AsyncComponent(_ref) { + var _ref$component = _ref.component, + component = _ref$component === undefined ? __WEBPACK_IMPORTED_MODULE_3_babel_runtime_core_js_promise___default.a.resolve(Component) : _ref$component, + _ref$loading = _ref.loading, + loading = _ref$loading === undefined ? loadingComponent : _ref$loading, + _ref$error = _ref.error, + error = _ref$error === undefined ? errorComponent : _ref$error, + _ref$delay = _ref.delay, + delay = _ref$delay === undefined ? 200 : _ref$delay, + _ref$timeout = _ref.timeout, + timeout = _ref$timeout === undefined ? 10000 : _ref$timeout; + return { + // must be a promise + component: component, + // A component to use while the async component is loading + loading: loading, + // A component to use if the load fails + error: error, + // Delay before showing the loading component. Default: 200ms. + delay: delay, + // The error component will be displayed if a timeout is + // provided and exceeded. Default: 10000ms. + timeout: timeout + }; +}; + +/** + * Vue Plugin + */ +var Plugin = { + install: function install(VueConstructor, _ref2) { + var _ref2$name = _ref2.name, + name = _ref2$name === undefined ? '$lexWebUi' : _ref2$name, + _ref2$componentName = _ref2.componentName, + componentName = _ref2$componentName === undefined ? 'lex-web-ui' : _ref2$componentName, + awsConfig = _ref2.awsConfig, + lexRuntimeClient = _ref2.lexRuntimeClient, + pollyClient = _ref2.pollyClient, + _ref2$component = _ref2.component, + component = _ref2$component === undefined ? AsyncComponent : _ref2$component, + _ref2$config = _ref2.config, + config = _ref2$config === undefined ? __WEBPACK_IMPORTED_MODULE_11__config__["a" /* config */] : _ref2$config; + + // values to be added to custom vue property + var value = { + awsConfig: awsConfig, + lexRuntimeClient: lexRuntimeClient, + pollyClient: pollyClient, + config: config + }; + // add custom property to Vue + // for example, access this in a component via this.$lexWebUi + __WEBPACK_IMPORTED_MODULE_2_babel_runtime_core_js_object_define_property___default()(VueConstructor.prototype, name, { value: value }); + // register as a global component + VueConstructor.component(componentName, component); + } +}; + +var Store = __WEBPACK_IMPORTED_MODULE_10__store__["a" /* default */]; + +/** + * Main Class + */ +var Loader = function Loader(config) { + __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_classCallCheck___default()(this, Loader); + + // TODO deep merge configs + this.config = __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, __WEBPACK_IMPORTED_MODULE_11__config__["a" /* config */], config); + + // TODO move this to a function (possibly a reducer) + var AWSConfigConstructor = window.AWS && window.AWS.Config ? window.AWS.Config : __WEBPACK_IMPORTED_MODULE_6_aws_sdk_global__["Config"]; + + var CognitoConstructor = window.AWS && window.AWS.CognitoIdentityCredentials ? window.AWS.CognitoIdentityCredentials : __WEBPACK_IMPORTED_MODULE_6_aws_sdk_global__["CognitoIdentityCredentials"]; + + var PollyConstructor = window.AWS && window.AWS.Polly ? window.AWS.Polly : __WEBPACK_IMPORTED_MODULE_8_aws_sdk_clients_polly___default.a; + + var LexRuntimeConstructor = window.AWS && window.AWS.LexRuntime ? window.AWS.LexRuntime : __WEBPACK_IMPORTED_MODULE_7_aws_sdk_clients_lexruntime___default.a; + + if (!AWSConfigConstructor || !CognitoConstructor || !PollyConstructor || !LexRuntimeConstructor) { + throw new Error('unable to find AWS SDK'); + } + + var credentials = new CognitoConstructor({ IdentityPoolId: this.config.cognito.poolId }, { region: this.config.region }); + + var awsConfig = new AWSConfigConstructor({ + region: this.config.region, + credentials: credentials + }); + + var lexRuntimeClient = new LexRuntimeConstructor(awsConfig); + var pollyClient = this.config.recorder.enable ? new PollyConstructor(awsConfig) : null; + + var VueConstructor = window.Vue ? window.Vue : __WEBPACK_IMPORTED_MODULE_4_vue___default.a; + if (!VueConstructor) { + throw new Error('unable to find Vue'); + } + + var VuexConstructor = window.Vuex ? window.Vuex : __WEBPACK_IMPORTED_MODULE_5_vuex___default.a; + if (!VuexConstructor) { + throw new Error('unable to find Vue'); + } + + // TODO name space store + this.store = new VuexConstructor.Store(__WEBPACK_IMPORTED_MODULE_10__store__["a" /* default */]); + + VueConstructor.use(Plugin, { + awsConfig: awsConfig, + lexRuntimeClient: lexRuntimeClient, + pollyClient: pollyClient + }); +}; + +/***/ }), +/* 61 */ +/***/ (function(module, exports, __webpack_require__) { + +__webpack_require__(62); +module.exports = __webpack_require__(0).Object.assign; + +/***/ }), +/* 62 */ +/***/ (function(module, exports, __webpack_require__) { + +// 19.1.3.1 Object.assign(target, source) +var $export = __webpack_require__(7); + +$export($export.S + $export.F, 'Object', {assign: __webpack_require__(63)}); + +/***/ }), +/* 63 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// 19.1.2.1 Object.assign(target, source, ...) +var getKeys = __webpack_require__(12) + , gOPS = __webpack_require__(37) + , pIE = __webpack_require__(22) + , toObject = __webpack_require__(23) + , IObject = __webpack_require__(47) + , $assign = Object.assign; + +// should work with symbols and should have deterministic property order (V8 bug) +module.exports = !$assign || __webpack_require__(11)(function(){ + var A = {} + , B = {} + , S = Symbol() + , K = 'abcdefghijklmnopqrst'; + A[S] = 7; + K.split('').forEach(function(k){ B[k] = k; }); + return $assign({}, A)[S] != 7 || Object.keys($assign({}, B)).join('') != K; +}) ? function assign(target, source){ // eslint-disable-line no-unused-vars + var T = toObject(target) + , aLen = arguments.length + , index = 1 + , getSymbols = gOPS.f + , isEnum = pIE.f; + while(aLen > index){ + var S = IObject(arguments[index++]) + , keys = getSymbols ? getKeys(S).concat(getSymbols(S)) : getKeys(S) + , length = keys.length + , j = 0 + , key; + while(length > j)if(isEnum.call(S, key = keys[j++]))T[key] = S[key]; + } return T; +} : $assign; + +/***/ }), +/* 64 */ +/***/ (function(module, exports, __webpack_require__) { + +// false -> Array#indexOf +// true -> Array#includes +var toIObject = __webpack_require__(10) + , toLength = __webpack_require__(32) + , toIndex = __webpack_require__(65); +module.exports = function(IS_INCLUDES){ + return function($this, el, fromIndex){ + var O = toIObject($this) + , length = toLength(O.length) + , index = toIndex(fromIndex, length) + , value; + // Array#includes uses SameValueZero equality algorithm + if(IS_INCLUDES && el != el)while(length > index){ + value = O[index++]; + if(value != value)return true; + // Array#toIndex ignores holes, Array#includes - not + } else for(;length > index; index++)if(IS_INCLUDES || index in O){ + if(O[index] === el)return IS_INCLUDES || index || 0; + } return !IS_INCLUDES && -1; + }; +}; + +/***/ }), +/* 65 */ +/***/ (function(module, exports, __webpack_require__) { + +var toInteger = __webpack_require__(33) + , max = Math.max + , min = Math.min; +module.exports = function(index, length){ + index = toInteger(index); + return index < 0 ? max(index + length, 0) : min(index, length); +}; + +/***/ }), +/* 66 */ +/***/ (function(module, exports, __webpack_require__) { + +__webpack_require__(67); +var $Object = __webpack_require__(0).Object; +module.exports = function defineProperty(it, key, desc){ + return $Object.defineProperty(it, key, desc); +}; + +/***/ }), +/* 67 */ +/***/ (function(module, exports, __webpack_require__) { + +var $export = __webpack_require__(7); +// 19.1.2.4 / 15.2.3.6 Object.defineProperty(O, P, Attributes) +$export($export.S + $export.F * !__webpack_require__(5), 'Object', {defineProperty: __webpack_require__(3).f}); + +/***/ }), +/* 68 */ +/***/ (function(module, exports, __webpack_require__) { + +__webpack_require__(48); +__webpack_require__(19); +__webpack_require__(26); +__webpack_require__(76); +module.exports = __webpack_require__(0).Promise; + +/***/ }), +/* 69 */ +/***/ (function(module, exports, __webpack_require__) { + +var toInteger = __webpack_require__(33) + , defined = __webpack_require__(31); +// true -> String#at +// false -> String#codePointAt +module.exports = function(TO_STRING){ + return function(that, pos){ + var s = String(defined(that)) + , i = toInteger(pos) + , l = s.length + , a, b; + if(i < 0 || i >= l)return TO_STRING ? '' : undefined; + a = s.charCodeAt(i); + return a < 0xd800 || a > 0xdbff || i + 1 === l || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff + ? TO_STRING ? s.charAt(i) : a + : TO_STRING ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000; + }; +}; + +/***/ }), +/* 70 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var create = __webpack_require__(51) + , descriptor = __webpack_require__(17) + , setToStringTag = __webpack_require__(25) + , IteratorPrototype = {}; + +// 25.1.2.1.1 %IteratorPrototype%[@@iterator]() +__webpack_require__(8)(IteratorPrototype, __webpack_require__(1)('iterator'), function(){ return this; }); + +module.exports = function(Constructor, NAME, next){ + Constructor.prototype = create(IteratorPrototype, {next: descriptor(1, next)}); + setToStringTag(Constructor, NAME + ' Iterator'); +}; + +/***/ }), +/* 71 */ +/***/ (function(module, exports, __webpack_require__) { + +var dP = __webpack_require__(3) + , anObject = __webpack_require__(4) + , getKeys = __webpack_require__(12); + +module.exports = __webpack_require__(5) ? Object.defineProperties : function defineProperties(O, Properties){ + anObject(O); + var keys = getKeys(Properties) + , length = keys.length + , i = 0 + , P; + while(length > i)dP.f(O, P = keys[i++], Properties[P]); + return O; +}; + +/***/ }), +/* 72 */ +/***/ (function(module, exports, __webpack_require__) { + +// 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O) +var has = __webpack_require__(9) + , toObject = __webpack_require__(23) + , IE_PROTO = __webpack_require__(34)('IE_PROTO') + , ObjectProto = Object.prototype; + +module.exports = Object.getPrototypeOf || function(O){ + O = toObject(O); + if(has(O, IE_PROTO))return O[IE_PROTO]; + if(typeof O.constructor == 'function' && O instanceof O.constructor){ + return O.constructor.prototype; + } return O instanceof Object ? ObjectProto : null; +}; + +/***/ }), +/* 73 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var addToUnscopables = __webpack_require__(74) + , step = __webpack_require__(75) + , Iterators = __webpack_require__(14) + , toIObject = __webpack_require__(10); + +// 22.1.3.4 Array.prototype.entries() +// 22.1.3.13 Array.prototype.keys() +// 22.1.3.29 Array.prototype.values() +// 22.1.3.30 Array.prototype[@@iterator]() +module.exports = __webpack_require__(49)(Array, 'Array', function(iterated, kind){ + this._t = toIObject(iterated); // target + this._i = 0; // next index + this._k = kind; // kind +// 22.1.5.2.1 %ArrayIteratorPrototype%.next() +}, function(){ + var O = this._t + , kind = this._k + , index = this._i++; + if(!O || index >= O.length){ + this._t = undefined; + return step(1); + } + if(kind == 'keys' )return step(0, index); + if(kind == 'values')return step(0, O[index]); + return step(0, [index, O[index]]); +}, 'values'); + +// argumentsList[@@iterator] is %ArrayProto_values% (9.4.4.6, 9.4.4.7) +Iterators.Arguments = Iterators.Array; + +addToUnscopables('keys'); +addToUnscopables('values'); +addToUnscopables('entries'); + +/***/ }), +/* 74 */ +/***/ (function(module, exports) { + +module.exports = function(){ /* empty */ }; + +/***/ }), +/* 75 */ +/***/ (function(module, exports) { + +module.exports = function(done, value){ + return {value: value, done: !!done}; +}; + +/***/ }), +/* 76 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var LIBRARY = __webpack_require__(24) + , global = __webpack_require__(2) + , ctx = __webpack_require__(15) + , classof = __webpack_require__(40) + , $export = __webpack_require__(7) + , isObject = __webpack_require__(16) + , aFunction = __webpack_require__(28) + , anInstance = __webpack_require__(77) + , forOf = __webpack_require__(78) + , speciesConstructor = __webpack_require__(79) + , task = __webpack_require__(55).set + , microtask = __webpack_require__(81)() + , PROMISE = 'Promise' + , TypeError = global.TypeError + , process = global.process + , $Promise = global[PROMISE] + , process = global.process + , isNode = classof(process) == 'process' + , empty = function(){ /* empty */ } + , Internal, GenericPromiseCapability, Wrapper; + +var USE_NATIVE = !!function(){ + try { + // correct subclassing with @@species support + var promise = $Promise.resolve(1) + , FakePromise = (promise.constructor = {})[__webpack_require__(1)('species')] = function(exec){ exec(empty, empty); }; + // unhandled rejections tracking support, NodeJS Promise without it fails @@species test + return (isNode || typeof PromiseRejectionEvent == 'function') && promise.then(empty) instanceof FakePromise; + } catch(e){ /* empty */ } +}(); + +// helpers +var sameConstructor = function(a, b){ + // with library wrapper special case + return a === b || a === $Promise && b === Wrapper; +}; +var isThenable = function(it){ + var then; + return isObject(it) && typeof (then = it.then) == 'function' ? then : false; +}; +var newPromiseCapability = function(C){ + return sameConstructor($Promise, C) + ? new PromiseCapability(C) + : new GenericPromiseCapability(C); +}; +var PromiseCapability = GenericPromiseCapability = function(C){ + var resolve, reject; + this.promise = new C(function($$resolve, $$reject){ + if(resolve !== undefined || reject !== undefined)throw TypeError('Bad Promise constructor'); + resolve = $$resolve; + reject = $$reject; + }); + this.resolve = aFunction(resolve); + this.reject = aFunction(reject); +}; +var perform = function(exec){ + try { + exec(); + } catch(e){ + return {error: e}; + } +}; +var notify = function(promise, isReject){ + if(promise._n)return; + promise._n = true; + var chain = promise._c; + microtask(function(){ + var value = promise._v + , ok = promise._s == 1 + , i = 0; + var run = function(reaction){ + var handler = ok ? reaction.ok : reaction.fail + , resolve = reaction.resolve + , reject = reaction.reject + , domain = reaction.domain + , result, then; + try { + if(handler){ + if(!ok){ + if(promise._h == 2)onHandleUnhandled(promise); + promise._h = 1; + } + if(handler === true)result = value; + else { + if(domain)domain.enter(); + result = handler(value); + if(domain)domain.exit(); + } + if(result === reaction.promise){ + reject(TypeError('Promise-chain cycle')); + } else if(then = isThenable(result)){ + then.call(result, resolve, reject); + } else resolve(result); + } else reject(value); + } catch(e){ + reject(e); + } + }; + while(chain.length > i)run(chain[i++]); // variable length - can't use forEach + promise._c = []; + promise._n = false; + if(isReject && !promise._h)onUnhandled(promise); + }); +}; +var onUnhandled = function(promise){ + task.call(global, function(){ + var value = promise._v + , abrupt, handler, console; + if(isUnhandled(promise)){ + abrupt = perform(function(){ + if(isNode){ + process.emit('unhandledRejection', value, promise); + } else if(handler = global.onunhandledrejection){ + handler({promise: promise, reason: value}); + } else if((console = global.console) && console.error){ + console.error('Unhandled promise rejection', value); + } + }); + // Browsers should not trigger `rejectionHandled` event if it was handled here, NodeJS - should + promise._h = isNode || isUnhandled(promise) ? 2 : 1; + } promise._a = undefined; + if(abrupt)throw abrupt.error; + }); +}; +var isUnhandled = function(promise){ + if(promise._h == 1)return false; + var chain = promise._a || promise._c + , i = 0 + , reaction; + while(chain.length > i){ + reaction = chain[i++]; + if(reaction.fail || !isUnhandled(reaction.promise))return false; + } return true; +}; +var onHandleUnhandled = function(promise){ + task.call(global, function(){ + var handler; + if(isNode){ + process.emit('rejectionHandled', promise); + } else if(handler = global.onrejectionhandled){ + handler({promise: promise, reason: promise._v}); + } + }); +}; +var $reject = function(value){ + var promise = this; + if(promise._d)return; + promise._d = true; + promise = promise._w || promise; // unwrap + promise._v = value; + promise._s = 2; + if(!promise._a)promise._a = promise._c.slice(); + notify(promise, true); +}; +var $resolve = function(value){ + var promise = this + , then; + if(promise._d)return; + promise._d = true; + promise = promise._w || promise; // unwrap + try { + if(promise === value)throw TypeError("Promise can't be resolved itself"); + if(then = isThenable(value)){ + microtask(function(){ + var wrapper = {_w: promise, _d: false}; // wrap + try { + then.call(value, ctx($resolve, wrapper, 1), ctx($reject, wrapper, 1)); + } catch(e){ + $reject.call(wrapper, e); + } + }); + } else { + promise._v = value; + promise._s = 1; + notify(promise, false); + } + } catch(e){ + $reject.call({_w: promise, _d: false}, e); // wrap + } +}; + +// constructor polyfill +if(!USE_NATIVE){ + // 25.4.3.1 Promise(executor) + $Promise = function Promise(executor){ + anInstance(this, $Promise, PROMISE, '_h'); + aFunction(executor); + Internal.call(this); + try { + executor(ctx($resolve, this, 1), ctx($reject, this, 1)); + } catch(err){ + $reject.call(this, err); + } + }; + Internal = function Promise(executor){ + this._c = []; // <- awaiting reactions + this._a = undefined; // <- checked in isUnhandled reactions + this._s = 0; // <- state + this._d = false; // <- done + this._v = undefined; // <- value + this._h = 0; // <- rejection state, 0 - default, 1 - handled, 2 - unhandled + this._n = false; // <- notify + }; + Internal.prototype = __webpack_require__(82)($Promise.prototype, { + // 25.4.5.3 Promise.prototype.then(onFulfilled, onRejected) + then: function then(onFulfilled, onRejected){ + var reaction = newPromiseCapability(speciesConstructor(this, $Promise)); + reaction.ok = typeof onFulfilled == 'function' ? onFulfilled : true; + reaction.fail = typeof onRejected == 'function' && onRejected; + reaction.domain = isNode ? process.domain : undefined; + this._c.push(reaction); + if(this._a)this._a.push(reaction); + if(this._s)notify(this, false); + return reaction.promise; + }, + // 25.4.5.1 Promise.prototype.catch(onRejected) + 'catch': function(onRejected){ + return this.then(undefined, onRejected); + } + }); + PromiseCapability = function(){ + var promise = new Internal; + this.promise = promise; + this.resolve = ctx($resolve, promise, 1); + this.reject = ctx($reject, promise, 1); + }; +} + +$export($export.G + $export.W + $export.F * !USE_NATIVE, {Promise: $Promise}); +__webpack_require__(25)($Promise, PROMISE); +__webpack_require__(83)(PROMISE); +Wrapper = __webpack_require__(0)[PROMISE]; + +// statics +$export($export.S + $export.F * !USE_NATIVE, PROMISE, { + // 25.4.4.5 Promise.reject(r) + reject: function reject(r){ + var capability = newPromiseCapability(this) + , $$reject = capability.reject; + $$reject(r); + return capability.promise; + } +}); +$export($export.S + $export.F * (LIBRARY || !USE_NATIVE), PROMISE, { + // 25.4.4.6 Promise.resolve(x) + resolve: function resolve(x){ + // instanceof instead of internal slot check because we should fix it without replacement native Promise core + if(x instanceof $Promise && sameConstructor(x.constructor, this))return x; + var capability = newPromiseCapability(this) + , $$resolve = capability.resolve; + $$resolve(x); + return capability.promise; + } +}); +$export($export.S + $export.F * !(USE_NATIVE && __webpack_require__(56)(function(iter){ + $Promise.all(iter)['catch'](empty); +})), PROMISE, { + // 25.4.4.1 Promise.all(iterable) + all: function all(iterable){ + var C = this + , capability = newPromiseCapability(C) + , resolve = capability.resolve + , reject = capability.reject; + var abrupt = perform(function(){ + var values = [] + , index = 0 + , remaining = 1; + forOf(iterable, false, function(promise){ + var $index = index++ + , alreadyCalled = false; + values.push(undefined); + remaining++; + C.resolve(promise).then(function(value){ + if(alreadyCalled)return; + alreadyCalled = true; + values[$index] = value; + --remaining || resolve(values); + }, reject); + }); + --remaining || resolve(values); + }); + if(abrupt)reject(abrupt.error); + return capability.promise; + }, + // 25.4.4.4 Promise.race(iterable) + race: function race(iterable){ + var C = this + , capability = newPromiseCapability(C) + , reject = capability.reject; + var abrupt = perform(function(){ + forOf(iterable, false, function(promise){ + C.resolve(promise).then(capability.resolve, reject); + }); + }); + if(abrupt)reject(abrupt.error); + return capability.promise; + } +}); + +/***/ }), +/* 77 */ +/***/ (function(module, exports) { + +module.exports = function(it, Constructor, name, forbiddenField){ + if(!(it instanceof Constructor) || (forbiddenField !== undefined && forbiddenField in it)){ + throw TypeError(name + ': incorrect invocation!'); + } return it; +}; + +/***/ }), +/* 78 */ +/***/ (function(module, exports, __webpack_require__) { + +var ctx = __webpack_require__(15) + , call = __webpack_require__(53) + , isArrayIter = __webpack_require__(54) + , anObject = __webpack_require__(4) + , toLength = __webpack_require__(32) + , getIterFn = __webpack_require__(41) + , BREAK = {} + , RETURN = {}; +var exports = module.exports = function(iterable, entries, fn, that, ITERATOR){ + var iterFn = ITERATOR ? function(){ return iterable; } : getIterFn(iterable) + , f = ctx(fn, that, entries ? 2 : 1) + , index = 0 + , length, step, iterator, result; + if(typeof iterFn != 'function')throw TypeError(iterable + ' is not iterable!'); + // fast case for arrays with default iterator + if(isArrayIter(iterFn))for(length = toLength(iterable.length); length > index; index++){ + result = entries ? f(anObject(step = iterable[index])[0], step[1]) : f(iterable[index]); + if(result === BREAK || result === RETURN)return result; + } else for(iterator = iterFn.call(iterable); !(step = iterator.next()).done; ){ + result = call(iterator, f, step.value, entries); + if(result === BREAK || result === RETURN)return result; + } +}; +exports.BREAK = BREAK; +exports.RETURN = RETURN; + +/***/ }), +/* 79 */ +/***/ (function(module, exports, __webpack_require__) { + +// 7.3.20 SpeciesConstructor(O, defaultConstructor) +var anObject = __webpack_require__(4) + , aFunction = __webpack_require__(28) + , SPECIES = __webpack_require__(1)('species'); +module.exports = function(O, D){ + var C = anObject(O).constructor, S; + return C === undefined || (S = anObject(C)[SPECIES]) == undefined ? D : aFunction(S); +}; + +/***/ }), +/* 80 */ +/***/ (function(module, exports) { + +// fast apply, http://jsperf.lnkit.com/fast-apply/5 +module.exports = function(fn, args, that){ + var un = that === undefined; + switch(args.length){ + case 0: return un ? fn() + : fn.call(that); + case 1: return un ? fn(args[0]) + : fn.call(that, args[0]); + case 2: return un ? fn(args[0], args[1]) + : fn.call(that, args[0], args[1]); + case 3: return un ? fn(args[0], args[1], args[2]) + : fn.call(that, args[0], args[1], args[2]); + case 4: return un ? fn(args[0], args[1], args[2], args[3]) + : fn.call(that, args[0], args[1], args[2], args[3]); + } return fn.apply(that, args); +}; + +/***/ }), +/* 81 */ +/***/ (function(module, exports, __webpack_require__) { + +var global = __webpack_require__(2) + , macrotask = __webpack_require__(55).set + , Observer = global.MutationObserver || global.WebKitMutationObserver + , process = global.process + , Promise = global.Promise + , isNode = __webpack_require__(18)(process) == 'process'; + +module.exports = function(){ + var head, last, notify; + + var flush = function(){ + var parent, fn; + if(isNode && (parent = process.domain))parent.exit(); + while(head){ + fn = head.fn; + head = head.next; + try { + fn(); + } catch(e){ + if(head)notify(); + else last = undefined; + throw e; + } + } last = undefined; + if(parent)parent.enter(); + }; + + // Node.js + if(isNode){ + notify = function(){ + process.nextTick(flush); + }; + // browsers with MutationObserver + } else if(Observer){ + var toggle = true + , node = document.createTextNode(''); + new Observer(flush).observe(node, {characterData: true}); // eslint-disable-line no-new + notify = function(){ + node.data = toggle = !toggle; + }; + // environments with maybe non-completely correct, but existent Promise + } else if(Promise && Promise.resolve){ + var promise = Promise.resolve(); + notify = function(){ + promise.then(flush); + }; + // for other environments - macrotask based on: + // - setImmediate + // - MessageChannel + // - window.postMessag + // - onreadystatechange + // - setTimeout + } else { + notify = function(){ + // strange IE + webpack dev server bug - use .call(global) + macrotask.call(global, flush); + }; + } + + return function(fn){ + var task = {fn: fn, next: undefined}; + if(last)last.next = task; + if(!head){ + head = task; + notify(); + } last = task; + }; +}; + +/***/ }), +/* 82 */ +/***/ (function(module, exports, __webpack_require__) { + +var hide = __webpack_require__(8); +module.exports = function(target, src, safe){ + for(var key in src){ + if(safe && target[key])target[key] = src[key]; + else hide(target, key, src[key]); + } return target; +}; + +/***/ }), +/* 83 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var global = __webpack_require__(2) + , core = __webpack_require__(0) + , dP = __webpack_require__(3) + , DESCRIPTORS = __webpack_require__(5) + , SPECIES = __webpack_require__(1)('species'); + +module.exports = function(KEY){ + var C = typeof core[KEY] == 'function' ? core[KEY] : global[KEY]; + if(DESCRIPTORS && C && !C[SPECIES])dP.f(C, SPECIES, { + configurable: true, + get: function(){ return this; } + }); +}; + +/***/ }), +/* 84 */ +/***/ (function(module, exports) { + +module.exports = __WEBPACK_EXTERNAL_MODULE_84__; + +/***/ }), +/* 85 */ +/***/ (function(module, exports) { + +module.exports = __WEBPACK_EXTERNAL_MODULE_85__; + +/***/ }), +/* 86 */ +/***/ (function(module, exports) { + +module.exports = __WEBPACK_EXTERNAL_MODULE_86__; + +/***/ }), +/* 87 */ +/***/ (function(module, exports) { + +module.exports = __WEBPACK_EXTERNAL_MODULE_87__; + +/***/ }), +/* 88 */ +/***/ (function(module, exports) { + +module.exports = __WEBPACK_EXTERNAL_MODULE_88__; + +/***/ }), +/* 89 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_LexWeb_vue__ = __webpack_require__(91); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_4973da9d_hasScoped_false_transformToRequire_video_src_source_src_img_src_image_xlink_href_node_modules_vue_loader_lib_selector_type_template_index_0_LexWeb_vue__ = __webpack_require__(119); +function injectStyle (ssrContext) { + __webpack_require__(90) +} +var normalizeComponent = __webpack_require__(6) +/* script */ + +/* template */ + +/* styles */ +var __vue_styles__ = injectStyle +/* scopeId */ +var __vue_scopeId__ = null +/* moduleIdentifier (server only) */ +var __vue_module_identifier__ = null +var Component = normalizeComponent( + __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_LexWeb_vue__["a" /* default */], + __WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_4973da9d_hasScoped_false_transformToRequire_video_src_source_src_img_src_image_xlink_href_node_modules_vue_loader_lib_selector_type_template_index_0_LexWeb_vue__["a" /* default */], + __vue_styles__, + __vue_scopeId__, + __vue_module_identifier__ +) + +/* harmony default export */ __webpack_exports__["a"] = (Component.exports); + + +/***/ }), +/* 90 */ +/***/ (function(module, exports) { + +// removed by extract-text-webpack-plugin + +/***/ }), +/* 91 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_core_js_promise__ = __webpack_require__(13); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_core_js_promise___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_core_js_promise__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__components_ToolbarContainer__ = __webpack_require__(92); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__components_MessageList__ = __webpack_require__(95); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__components_StatusBar__ = __webpack_require__(111); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__components_InputContainer__ = __webpack_require__(115); + +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// + +/* +Copyright 2017-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. + +Licensed under the Amazon Software License (the "License"). You may not use this file +except in compliance with the License. A copy of the License is located at + +http://aws.amazon.com/asl/ + +or in the "license" file accompanying this file. This file is distributed on an "AS IS" +BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, express or implied. See the +License for the specific language governing permissions and limitations under the License. +*/ + +/* eslint no-console: ["error", { allow: ["warn", "error", "info"] }] */ + + + + + +/* harmony default export */ __webpack_exports__["a"] = ({ + name: 'lex-web', + components: { + ToolbarContainer: __WEBPACK_IMPORTED_MODULE_1__components_ToolbarContainer__["a" /* default */], + MessageList: __WEBPACK_IMPORTED_MODULE_2__components_MessageList__["a" /* default */], + StatusBar: __WEBPACK_IMPORTED_MODULE_3__components_StatusBar__["a" /* default */], + InputContainer: __WEBPACK_IMPORTED_MODULE_4__components_InputContainer__["a" /* default */] + }, + computed: { + initialSpeechInstruction: function initialSpeechInstruction() { + return this.$store.state.config.lex.initialSpeechInstruction; + }, + initialText: function initialText() { + return this.$store.state.config.lex.initialText; + }, + textInputPlaceholder: function textInputPlaceholder() { + return this.$store.state.config.ui.textInputPlaceholder; + }, + toolbarColor: function toolbarColor() { + return this.$store.state.config.ui.toolbarColor; + }, + toolbarTitle: function toolbarTitle() { + return this.$store.state.config.ui.toolbarTitle; + }, + toolbarLogo: function toolbarLogo() { + return this.$store.state.config.ui.toolbarLogo; + }, + isUiMinimized: function isUiMinimized() { + return this.$store.state.isUiMinimized; + } + }, + beforeMount: function beforeMount() { + if (this.$store.state.config.urlQueryParams.lexWebUiEmbed !== 'true') { + console.info('running in standalone mode'); + this.$store.commit('setIsRunningEmbedded', false); + this.$store.commit('setAwsCredsProvider', 'cognito'); + } else { + console.info('running in embedded mode from URL: ', location.href); + console.info('referrer (possible parent) URL: ', document.referrer); + console.info('config parentOrigin:', this.$store.state.config.ui.parentOrigin); + if (!document.referrer.startsWith(this.$store.state.config.ui.parentOrigin)) { + console.warn('referrer origin: [%s] does not match configured parent origin: [%s]', document.referrer, this.$store.state.config.ui.parentOrigin); + } + + window.addEventListener('message', this.messageHandler, false); + this.$store.commit('setIsRunningEmbedded', true); + this.$store.commit('setAwsCredsProvider', 'parentWindow'); + } + }, + mounted: function mounted() { + var _this = this; + + this.$store.dispatch('getConfigFromParent').then(function (config) { + return _this.$store.dispatch('initConfig', config); + }).then(function () { + return __WEBPACK_IMPORTED_MODULE_0_babel_runtime_core_js_promise___default.a.all([_this.$store.dispatch('initCredentials', _this.$lexWebUi.awsConfig.credentials), _this.$store.dispatch('initRecorder'), _this.$store.dispatch('initBotAudio', new Audio())]); + }).then(function () { + return __WEBPACK_IMPORTED_MODULE_0_babel_runtime_core_js_promise___default.a.all([_this.$store.dispatch('initMessageList'), _this.$store.dispatch('initPollyClient', _this.$lexWebUi.pollyClient), _this.$store.dispatch('initLexClient', _this.$lexWebUi.lexRuntimeClient)]); + }).then(function () { + return _this.$store.state.isRunningEmbedded ? _this.$store.dispatch('sendMessageToParentWindow', { event: 'ready' }) : __WEBPACK_IMPORTED_MODULE_0_babel_runtime_core_js_promise___default.a.resolve(); + }).then(function () { + return console.info('sucessfully initialized lex web ui version: ', _this.$store.state.version); + }).catch(function (error) { + console.error('could not initialize application while mounting:', error); + }); + }, + + methods: { + toggleMinimizeUi: function toggleMinimizeUi() { + return this.$store.dispatch('toggleIsUiMinimized'); + }, + + // messages from parent + messageHandler: function messageHandler(evt) { + // security check + if (evt.origin !== this.$store.state.config.ui.parentOrigin) { + console.warn('ignoring event - invalid origin:', evt.origin); + return; + } + if (!evt.ports) { + console.warn('postMessage not sent over MessageChannel', evt); + return; + } + switch (evt.data.event) { + case 'ping': + console.info('pong - ping received from parent'); + evt.ports[0].postMessage({ + event: 'resolve', + type: evt.data.event + }); + break; + // received when the parent page has loaded the iframe + case 'parentReady': + evt.ports[0].postMessage({ event: 'resolve', type: evt.data.event }); + break; + case 'toggleMinimizeUi': + this.$store.dispatch('toggleIsUiMinimized').then(function () { + evt.ports[0].postMessage({ event: 'resolve', type: evt.data.event }); + }); + break; + case 'postText': + if (!evt.data.message) { + evt.ports[0].postMessage({ + event: 'reject', + type: evt.data.event, + error: 'missing message field' + }); + return; + } + + this.$store.dispatch('postTextMessage', { type: 'human', text: evt.data.message }).then(function () { + evt.ports[0].postMessage({ event: 'resolve', type: evt.data.event }); + }); + break; + default: + console.warn('unknown message in messageHanlder', evt); + break; + } + } + } +}); + +/***/ }), +/* 92 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_ToolbarContainer_vue__ = __webpack_require__(93); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_59f58ea4_hasScoped_false_transformToRequire_video_src_source_src_img_src_image_xlink_href_node_modules_vue_loader_lib_selector_type_template_index_0_ToolbarContainer_vue__ = __webpack_require__(94); +var normalizeComponent = __webpack_require__(6) +/* script */ + +/* template */ + +/* styles */ +var __vue_styles__ = null +/* scopeId */ +var __vue_scopeId__ = null +/* moduleIdentifier (server only) */ +var __vue_module_identifier__ = null +var Component = normalizeComponent( + __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_ToolbarContainer_vue__["a" /* default */], + __WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_59f58ea4_hasScoped_false_transformToRequire_video_src_source_src_img_src_image_xlink_href_node_modules_vue_loader_lib_selector_type_template_index_0_ToolbarContainer_vue__["a" /* default */], + __vue_styles__, + __vue_scopeId__, + __vue_module_identifier__ +) + +/* harmony default export */ __webpack_exports__["a"] = (Component.exports); + + +/***/ }), +/* 93 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// + +/* +Copyright 2017-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. + +Licensed under the Amazon Software License (the "License"). You may not use this file +except in compliance with the License. A copy of the License is located at + +http://aws.amazon.com/asl/ + +or in the "license" file accompanying this file. This file is distributed on an "AS IS" +BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, express or implied. See the +License for the specific language governing permissions and limitations under the License. +*/ +/* harmony default export */ __webpack_exports__["a"] = ({ + name: 'toolbar-container', + props: ['toolbarTitle', 'toolbarColor', 'toolbarLogo', 'isUiMinimized'], + computed: { + toolTipMinimize: function toolTipMinimize() { + return { + html: this.isUiMinimized ? 'maximize' : 'minimize' + }; + } + }, + methods: { + toggleMinimize: function toggleMinimize() { + this.$emit('toggleMinimizeUi'); + } + } +}); + +/***/ }), +/* 94 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h; + return _c('v-toolbar', { + class: _vm.toolbarColor, + attrs: { + "dark": "", + "dense": "" + } + }, [_c('img', { + attrs: { + "src": _vm.toolbarLogo + } + }), _vm._v(" "), _c('v-toolbar-title', { + staticClass: "hidden-xs-and-down" + }, [_vm._v("\n " + _vm._s(_vm.toolbarTitle) + "\n ")]), _vm._v(" "), _c('v-spacer'), _vm._v(" "), (_vm.$store.state.isRunningEmbedded) ? _c('v-btn', { + directives: [{ + name: "tooltip", + rawName: "v-tooltip:left", + value: (_vm.toolTipMinimize), + expression: "toolTipMinimize", + arg: "left" + }], + attrs: { + "icon": "", + "light": "" + }, + nativeOn: { + "click": function($event) { + _vm.toggleMinimize($event) + } + } + }, [_c('v-icon', [_vm._v("\n " + _vm._s(_vm.isUiMinimized ? 'arrow_drop_up' : 'arrow_drop_down') + "\n ")])], 1) : _vm._e()], 1) +} +var staticRenderFns = [] +var esExports = { render: render, staticRenderFns: staticRenderFns } +/* harmony default export */ __webpack_exports__["a"] = (esExports); + +/***/ }), +/* 95 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_MessageList_vue__ = __webpack_require__(97); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_20b8f18d_hasScoped_true_transformToRequire_video_src_source_src_img_src_image_xlink_href_node_modules_vue_loader_lib_selector_type_template_index_0_MessageList_vue__ = __webpack_require__(110); +function injectStyle (ssrContext) { + __webpack_require__(96) +} +var normalizeComponent = __webpack_require__(6) +/* script */ + +/* template */ + +/* styles */ +var __vue_styles__ = injectStyle +/* scopeId */ +var __vue_scopeId__ = "data-v-20b8f18d" +/* moduleIdentifier (server only) */ +var __vue_module_identifier__ = null +var Component = normalizeComponent( + __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_MessageList_vue__["a" /* default */], + __WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_20b8f18d_hasScoped_true_transformToRequire_video_src_source_src_img_src_image_xlink_href_node_modules_vue_loader_lib_selector_type_template_index_0_MessageList_vue__["a" /* default */], + __vue_styles__, + __vue_scopeId__, + __vue_module_identifier__ +) + +/* harmony default export */ __webpack_exports__["a"] = (Component.exports); + + +/***/ }), +/* 96 */ +/***/ (function(module, exports) { + +// removed by extract-text-webpack-plugin + +/***/ }), +/* 97 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Message__ = __webpack_require__(98); +// +// +// +// +// +// +// +// +// +// +// + +/* +Copyright 2017-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. + +Licensed under the Amazon Software License (the "License"). You may not use this file +except in compliance with the License. A copy of the License is located at + +http://aws.amazon.com/asl/ + +or in the "license" file accompanying this file. This file is distributed on an "AS IS" +BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, express or implied. See the +License for the specific language governing permissions and limitations under the License. +*/ + + +/* harmony default export */ __webpack_exports__["a"] = ({ + name: 'message-list', + components: { + Message: __WEBPACK_IMPORTED_MODULE_0__Message__["a" /* default */] + }, + computed: { + messages: function messages() { + return this.$store.state.messages; + } + }, + watch: { + // autoscroll message list to the bottom when messages change + messages: function messages() { + var _this = this; + + this.$nextTick(function () { + _this.$el.scrollTop = _this.$el.scrollHeight; + }); + } + } +}); + +/***/ }), +/* 98 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_Message_vue__ = __webpack_require__(100); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_290c8f4f_hasScoped_true_transformToRequire_video_src_source_src_img_src_image_xlink_href_node_modules_vue_loader_lib_selector_type_template_index_0_Message_vue__ = __webpack_require__(109); +function injectStyle (ssrContext) { + __webpack_require__(99) +} +var normalizeComponent = __webpack_require__(6) +/* script */ + +/* template */ + +/* styles */ +var __vue_styles__ = injectStyle +/* scopeId */ +var __vue_scopeId__ = "data-v-290c8f4f" +/* moduleIdentifier (server only) */ +var __vue_module_identifier__ = null +var Component = normalizeComponent( + __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_Message_vue__["a" /* default */], + __WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_290c8f4f_hasScoped_true_transformToRequire_video_src_source_src_img_src_image_xlink_href_node_modules_vue_loader_lib_selector_type_template_index_0_Message_vue__["a" /* default */], + __vue_styles__, + __vue_scopeId__, + __vue_module_identifier__ +) + +/* harmony default export */ __webpack_exports__["a"] = (Component.exports); + + +/***/ }), +/* 99 */ +/***/ (function(module, exports) { + +// removed by extract-text-webpack-plugin + +/***/ }), +/* 100 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__MessageText__ = __webpack_require__(101); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__ResponseCard__ = __webpack_require__(105); +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// + +/* +Copyright 2017-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. + +Licensed under the Amazon Software License (the "License"). You may not use this file +except in compliance with the License. A copy of the License is located at + +http://aws.amazon.com/asl/ + +or in the "license" file accompanying this file. This file is distributed on an "AS IS" +BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, express or implied. See the +License for the specific language governing permissions and limitations under the License. +*/ + + + +/* harmony default export */ __webpack_exports__["a"] = ({ + name: 'message', + props: ['message'], + components: { + MessageText: __WEBPACK_IMPORTED_MODULE_0__MessageText__["a" /* default */], + ResponseCard: __WEBPACK_IMPORTED_MODULE_1__ResponseCard__["a" /* default */] + }, + computed: { + botDialogState: function botDialogState() { + if (!('dialogState' in this.message)) { + return null; + } + switch (this.message.dialogState) { + case 'Failed': + return { icon: 'error', color: 'red' }; + case 'Fulfilled': + case 'ReadyForFulfillment': + return { icon: 'done', color: 'green' }; + default: + return null; + } + }, + shouldDisplayResponseCard: function shouldDisplayResponseCard() { + return this.message.responseCard && (this.message.responseCard.version === '1' || this.message.responseCard.version === 1) && this.message.responseCard.contentType === 'application/vnd.amazonaws.card.generic' && 'genericAttachments' in this.message.responseCard && this.message.responseCard.genericAttachments instanceof Array; + } + }, + methods: { + playAudio: function playAudio() { + // XXX doesn't play in Firefox or Edge + /* XXX also tried: + const audio = new Audio(this.message.audio); + audio.play(); + */ + var audioElem = this.$el.querySelector('audio'); + if (audioElem) { + audioElem.play(); + } + } + } +}); + +/***/ }), +/* 101 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_MessageText_vue__ = __webpack_require__(103); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_d69cb2c8_hasScoped_true_transformToRequire_video_src_source_src_img_src_image_xlink_href_node_modules_vue_loader_lib_selector_type_template_index_0_MessageText_vue__ = __webpack_require__(104); +function injectStyle (ssrContext) { + __webpack_require__(102) +} +var normalizeComponent = __webpack_require__(6) +/* script */ + +/* template */ + +/* styles */ +var __vue_styles__ = injectStyle +/* scopeId */ +var __vue_scopeId__ = "data-v-d69cb2c8" +/* moduleIdentifier (server only) */ +var __vue_module_identifier__ = null +var Component = normalizeComponent( + __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_MessageText_vue__["a" /* default */], + __WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_d69cb2c8_hasScoped_true_transformToRequire_video_src_source_src_img_src_image_xlink_href_node_modules_vue_loader_lib_selector_type_template_index_0_MessageText_vue__["a" /* default */], + __vue_styles__, + __vue_scopeId__, + __vue_module_identifier__ +) + +/* harmony default export */ __webpack_exports__["a"] = (Component.exports); + + +/***/ }), +/* 102 */ +/***/ (function(module, exports) { + +// removed by extract-text-webpack-plugin + +/***/ }), +/* 103 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// + +/* +Copyright 2017-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. + +Licensed under the Amazon Software License (the "License"). You may not use this file +except in compliance with the License. A copy of the License is located at + +http://aws.amazon.com/asl/ + +or in the "license" file accompanying this file. This file is distributed on an "AS IS" +BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, express or implied. See the +License for the specific language governing permissions and limitations under the License. +*/ +/* harmony default export */ __webpack_exports__["a"] = ({ + name: 'message-text', + props: ['message'], + computed: { + shouldConvertUrlToLinks: function shouldConvertUrlToLinks() { + return this.$store.state.config.ui.convertUrlToLinksInBotMessages; + }, + shouldStripTags: function shouldStripTags() { + return this.$store.state.config.ui.stripTagsFromBotMessages; + }, + shouldRenderAsHtml: function shouldRenderAsHtml() { + return this.message.type === 'bot' && this.shouldConvertUrlToLinks; + }, + botMessageAsHtml: function botMessageAsHtml() { + // Security Note: Make sure that the content is escaped according + // to context (e.g. URL, HTML). This is rendered as HTML + var messageText = this.stripTagsFromMessage(this.message.text); + var messageWithLinks = this.botMessageWithLinks(messageText); + return messageWithLinks; + } + }, + methods: { + encodeAsHtml: function encodeAsHtml(value) { + return value.replace(/&/g, '&').replace(/"/g, '"').replace(/'/g, ''').replace(//g, '>'); + }, + botMessageWithLinks: function botMessageWithLinks(messageText) { + var _this = this; + + var linkReplacers = [ + // The regex in the objects of linkReplacers should return a single + // reference (from parenthesis) with the whole address + // The replace function takes a matched url and returns the + // hyperlink that will be replaced in the message + { + type: 'web', + regex: new RegExp('\\b((?:https?://\\w{1}|www\\.)(?:[\\w-.]){2,256}' + '(?:[\\w._~:/?#@!$&()*+,;=[\'\\]-]){0,256})', 'im'), + replace: function replace(item) { + var url = !/^https?:\/\//.test(item) ? 'http://' + item : item; + return '' + _this.encodeAsHtml(item) + ''); + } + }]; + // TODO avoid double HTML encoding when there's more than 1 linkReplacer + return linkReplacers.reduce(function (message, replacer) { + return ( + // splits the message into an array containing content chunks and links. + // Content chunks will be the even indexed items in the array + // (or empty string when applicable). + // Links (if any) will be the odd members of the array since the + // regex keeps references. + message.split(replacer.regex).reduce(function (messageAccum, item, index, array) { + var messageResult = ''; + if (index % 2 === 0) { + var urlItem = index + 1 === array.length ? '' : replacer.replace(array[index + 1]); + messageResult = '' + _this.encodeAsHtml(item) + urlItem; + } + return messageAccum + messageResult; + }, '') + ); + }, messageText); + }, + + // used for stripping SSML (and other) tags from bot responses + stripTagsFromMessage: function stripTagsFromMessage(messageText) { + var doc = document.implementation.createHTMLDocument('').body; + doc.innerHTML = messageText; + return doc.textContent || doc.innerText || ''; + } + } +}); + +/***/ }), +/* 104 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h; + return (_vm.message.text && _vm.message.type === 'human') ? _c('div', { + staticClass: "message-text" + }, [_vm._v("\n " + _vm._s(_vm.message.text) + "\n")]) : (_vm.message.text && _vm.shouldRenderAsHtml) ? _c('div', { + staticClass: "message-text", + domProps: { + "innerHTML": _vm._s(_vm.botMessageAsHtml) + } + }) : (_vm.message.text && _vm.message.type === 'bot') ? _c('div', { + staticClass: "message-text" + }, [_vm._v("\n " + _vm._s((_vm.shouldStripTags) ? _vm.stripTagsFromMessage(_vm.message.text) : _vm.message.text) + "\n")]) : _vm._e() +} +var staticRenderFns = [] +var esExports = { render: render, staticRenderFns: staticRenderFns } +/* harmony default export */ __webpack_exports__["a"] = (esExports); + +/***/ }), +/* 105 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_ResponseCard_vue__ = __webpack_require__(107); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_799b9a4e_hasScoped_true_transformToRequire_video_src_source_src_img_src_image_xlink_href_node_modules_vue_loader_lib_selector_type_template_index_0_ResponseCard_vue__ = __webpack_require__(108); +function injectStyle (ssrContext) { + __webpack_require__(106) +} +var normalizeComponent = __webpack_require__(6) +/* script */ + +/* template */ + +/* styles */ +var __vue_styles__ = injectStyle +/* scopeId */ +var __vue_scopeId__ = "data-v-799b9a4e" +/* moduleIdentifier (server only) */ +var __vue_module_identifier__ = null +var Component = normalizeComponent( + __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_ResponseCard_vue__["a" /* default */], + __WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_799b9a4e_hasScoped_true_transformToRequire_video_src_source_src_img_src_image_xlink_href_node_modules_vue_loader_lib_selector_type_template_index_0_ResponseCard_vue__["a" /* default */], + __vue_styles__, + __vue_scopeId__, + __vue_module_identifier__ +) + +/* harmony default export */ __webpack_exports__["a"] = (Component.exports); + + +/***/ }), +/* 106 */ +/***/ (function(module, exports) { + +// removed by extract-text-webpack-plugin + +/***/ }), +/* 107 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// + +/* +Copyright 2017-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. + +Licensed under the Amazon Software License (the "License"). You may not use this file +except in compliance with the License. A copy of the License is located at + +http://aws.amazon.com/asl/ + +or in the "license" file accompanying this file. This file is distributed on an "AS IS" +BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, express or implied. See the +License for the specific language governing permissions and limitations under the License. +*/ +/* harmony default export */ __webpack_exports__["a"] = ({ + name: 'response-card', + props: ['response-card'], + data: function data() { + return { + hasButtonBeenClicked: false + }; + }, + + computed: {}, + methods: { + onButtonClick: function onButtonClick(value) { + this.hasButtonBeenClicked = true; + var message = { + type: 'human', + text: value + }; + + this.$store.dispatch('postTextMessage', message); + } + } +}); + +/***/ }), +/* 108 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h; + return _c('v-card', [(_vm.responseCard.title.trim()) ? _c('v-card-title', { + staticClass: "red lighten-5", + attrs: { + "primary-title": "" + } + }, [_c('span', { + staticClass: "headline" + }, [_vm._v(_vm._s(_vm.responseCard.title))])]) : _vm._e(), _vm._v(" "), (_vm.responseCard.subTitle) ? _c('v-card-text', [_c('span', [_vm._v(_vm._s(_vm.responseCard.subTitle))])]) : _vm._e(), _vm._v(" "), (_vm.responseCard.imageUrl) ? _c('v-card-media', { + attrs: { + "src": _vm.responseCard.imageUrl, + "contain": "", + "height": "33vh" + } + }) : _vm._e(), _vm._v(" "), _vm._l((_vm.responseCard.buttons), function(button, index) { + return _c('v-card-actions', { + key: index, + staticClass: "button-row", + attrs: { + "actions": "" + } + }, [(button.text && button.value) ? _c('v-btn', { + attrs: { + "disabled": _vm.hasButtonBeenClicked, + "default": "" + }, + nativeOn: { + "~click": function($event) { + _vm.onButtonClick(button.value) + } + } + }, [_vm._v("\n " + _vm._s(button.text) + "\n ")]) : _vm._e()], 1) + }), _vm._v(" "), (_vm.responseCard.attachmentLinkUrl) ? _c('v-card-actions', [_c('v-btn', { + staticClass: "red lighten-5", + attrs: { + "flat": "", + "tag": "a", + "href": _vm.responseCard.attachmentLinkUrl, + "target": "_blank" + } + }, [_vm._v("\n Open Link\n ")])], 1) : _vm._e()], 2) +} +var staticRenderFns = [] +var esExports = { render: render, staticRenderFns: staticRenderFns } +/* harmony default export */ __webpack_exports__["a"] = (esExports); + +/***/ }), +/* 109 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h; + return _c('div', { + staticClass: "message" + }, [_c('v-chip', [('text' in _vm.message && _vm.message.text !== null && _vm.message.text.length) ? _c('message-text', { + attrs: { + "message": _vm.message + } + }) : _vm._e(), _vm._v(" "), (_vm.message.type === 'human' && _vm.message.audio) ? _c('div', [_c('audio', [_c('source', { + attrs: { + "src": _vm.message.audio, + "type": "audio/wav" + } + })]), _vm._v(" "), _c('v-btn', { + staticClass: "black--text", + attrs: { + "left": "", + "icon": "" + }, + nativeOn: { + "click": function($event) { + _vm.playAudio($event) + } + } + }, [_c('v-icon', { + staticClass: "play-button" + }, [_vm._v("play_circle_outline")])], 1)], 1) : _vm._e(), _vm._v(" "), (_vm.message.type === 'bot' && _vm.botDialogState) ? _c('v-icon', { + class: _vm.botDialogState.color + '--text', + attrs: { + "medium": "" + } + }, [_vm._v("\n " + _vm._s(_vm.botDialogState.icon) + "\n ")]) : _vm._e()], 1), _vm._v(" "), (_vm.shouldDisplayResponseCard) ? _c('div', { + staticClass: "response-card" + }, _vm._l((_vm.message.responseCard.genericAttachments), function(card, index) { + return _c('response-card', { + key: index, + attrs: { + "response-card": card + } + }) + })) : _vm._e()], 1) +} +var staticRenderFns = [] +var esExports = { render: render, staticRenderFns: staticRenderFns } +/* harmony default export */ __webpack_exports__["a"] = (esExports); + +/***/ }), +/* 110 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h; + return _c('v-layout', { + staticClass: "message-list" + }, _vm._l((_vm.messages), function(message) { + return _c('message', { + key: message.id, + class: ("message-" + (message.type)), + attrs: { + "message": message + } + }) + })) +} +var staticRenderFns = [] +var esExports = { render: render, staticRenderFns: staticRenderFns } +/* harmony default export */ __webpack_exports__["a"] = (esExports); + +/***/ }), +/* 111 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_StatusBar_vue__ = __webpack_require__(113); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_2df12d09_hasScoped_true_transformToRequire_video_src_source_src_img_src_image_xlink_href_node_modules_vue_loader_lib_selector_type_template_index_0_StatusBar_vue__ = __webpack_require__(114); +function injectStyle (ssrContext) { + __webpack_require__(112) +} +var normalizeComponent = __webpack_require__(6) +/* script */ + +/* template */ + +/* styles */ +var __vue_styles__ = injectStyle +/* scopeId */ +var __vue_scopeId__ = "data-v-2df12d09" +/* moduleIdentifier (server only) */ +var __vue_module_identifier__ = null +var Component = normalizeComponent( + __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_StatusBar_vue__["a" /* default */], + __WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_2df12d09_hasScoped_true_transformToRequire_video_src_source_src_img_src_image_xlink_href_node_modules_vue_loader_lib_selector_type_template_index_0_StatusBar_vue__["a" /* default */], + __vue_styles__, + __vue_scopeId__, + __vue_module_identifier__ +) + +/* harmony default export */ __webpack_exports__["a"] = (Component.exports); + + +/***/ }), +/* 112 */ +/***/ (function(module, exports) { + +// removed by extract-text-webpack-plugin + +/***/ }), +/* 113 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// + +/* +Copyright 2017-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. + +Licensed under the Amazon Software License (the "License"). You may not use this file +except in compliance with the License. A copy of the License is located at + +http://aws.amazon.com/asl/ + +or in the "license" file accompanying this file. This file is distributed on an "AS IS" +BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, express or implied. See the +License for the specific language governing permissions and limitations under the License. +*/ + +/* harmony default export */ __webpack_exports__["a"] = ({ + name: 'status-bar', + data: function data() { + return { + volume: 0, + volumeIntervalId: null + }; + }, + + computed: { + isSpeechConversationGoing: function isSpeechConversationGoing() { + return this.isConversationGoing; + }, + isProcessing: function isProcessing() { + return this.isSpeechConversationGoing && !this.isRecording && !this.isBotSpeaking; + }, + statusText: function statusText() { + if (this.isInterrupting) { + return 'Interrupting...'; + } + if (this.canInterruptBotPlayback) { + return 'Say "skip" and I\'ll listen for your answer...'; + } + if (this.isMicMuted) { + return 'Microphone seems to be muted...'; + } + if (this.isRecording) { + return 'Listening...'; + } + if (this.isBotSpeaking) { + return 'Playing audio...'; + } + if (this.isSpeechConversationGoing) { + return 'Processing...'; + } + if (this.isRecorderSupported) { + return 'Type or click on the mic'; + } + return ''; + }, + canInterruptBotPlayback: function canInterruptBotPlayback() { + return this.$store.state.botAudio.canInterrupt; + }, + isBotSpeaking: function isBotSpeaking() { + return this.$store.state.botAudio.isSpeaking; + }, + isConversationGoing: function isConversationGoing() { + return this.$store.state.recState.isConversationGoing; + }, + isMicMuted: function isMicMuted() { + return this.$store.state.recState.isMicMuted; + }, + isRecorderSupported: function isRecorderSupported() { + return this.$store.state.recState.isRecorderSupported; + }, + isRecording: function isRecording() { + return this.$store.state.recState.isRecording; + } + }, + methods: { + enterMeter: function enterMeter() { + var _this = this; + + var intervalTime = 50; + var max = 0; + this.volumeIntervalId = setInterval(function () { + _this.$store.dispatch('getRecorderVolume').then(function (volume) { + _this.volume = volume.instant.toFixed(4); + max = Math.max(_this.volume, max); + }); + }, intervalTime); + }, + leaveMeter: function leaveMeter() { + if (this.volumeIntervalId) { + clearInterval(this.volumeIntervalId); + } + } + } +}); + +/***/ }), +/* 114 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h; + return _c('div', { + staticClass: "status-bar white" + }, [_c('v-divider'), _vm._v(" "), _c('div', { + staticClass: "status-text" + }, [_c('span', [_vm._v(_vm._s(_vm.statusText))])]), _vm._v(" "), _c('div', { + staticClass: "voice-controls" + }, [_c('transition', { + attrs: { + "css": false + }, + on: { + "enter": _vm.enterMeter, + "leave": _vm.leaveMeter + } + }, [(_vm.isRecording) ? _c('div', { + staticClass: "ml-2 volume-meter" + }, [_c('meter', { + attrs: { + "value": _vm.volume, + "min": "0.0001", + "low": "0.005", + "optimum": "0.04", + "high": "0.07", + "max": "0.09" + } + })]) : _vm._e()])], 1)], 1) +} +var staticRenderFns = [] +var esExports = { render: render, staticRenderFns: staticRenderFns } +/* harmony default export */ __webpack_exports__["a"] = (esExports); + +/***/ }), +/* 115 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_InputContainer_vue__ = __webpack_require__(117); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_6dd14e82_hasScoped_true_transformToRequire_video_src_source_src_img_src_image_xlink_href_node_modules_vue_loader_lib_selector_type_template_index_0_InputContainer_vue__ = __webpack_require__(118); +function injectStyle (ssrContext) { + __webpack_require__(116) +} +var normalizeComponent = __webpack_require__(6) +/* script */ + +/* template */ + +/* styles */ +var __vue_styles__ = injectStyle +/* scopeId */ +var __vue_scopeId__ = "data-v-6dd14e82" +/* moduleIdentifier (server only) */ +var __vue_module_identifier__ = null +var Component = normalizeComponent( + __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_InputContainer_vue__["a" /* default */], + __WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_6dd14e82_hasScoped_true_transformToRequire_video_src_source_src_img_src_image_xlink_href_node_modules_vue_loader_lib_selector_type_template_index_0_InputContainer_vue__["a" /* default */], + __vue_styles__, + __vue_scopeId__, + __vue_module_identifier__ +) + +/* harmony default export */ __webpack_exports__["a"] = (Component.exports); + + +/***/ }), +/* 116 */ +/***/ (function(module, exports) { + +// removed by extract-text-webpack-plugin + +/***/ }), +/* 117 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_core_js_promise__ = __webpack_require__(13); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_core_js_promise___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_core_js_promise__); + +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// + +/* +Copyright 2017-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. + +Licensed under the Amazon Software License (the "License"). You may not use this file +except in compliance with the License. A copy of the License is located at + +http://aws.amazon.com/asl/ + +or in the "license" file accompanying this file. This file is distributed on an "AS IS" +BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, express or implied. See the +License for the specific language governing permissions and limitations under the License. +*/ +/* eslint no-console: ["error", { allow: ["warn", "error"] }] */ + +/* harmony default export */ __webpack_exports__["a"] = ({ + name: 'input-container', + data: function data() { + return { + textInput: '' + }; + }, + + computed: { + micButtonIcon: function micButtonIcon() { + if (this.isMicMuted) { + return 'mic_off'; + } + if (this.isBotSpeaking) { + return 'stop'; + } + return 'mic'; + }, + isMicButtonDisabled: function isMicButtonDisabled() { + return this.isMicMuted; + }, + isBotSpeaking: function isBotSpeaking() { + return this.$store.state.botAudio.isSpeaking; + }, + isConversationGoing: function isConversationGoing() { + return this.$store.state.recState.isConversationGoing; + }, + isMicMuted: function isMicMuted() { + return this.$store.state.recState.isMicMuted; + }, + isRecorderSupported: function isRecorderSupported() { + return this.$store.state.recState.isRecorderSupported; + } + }, + props: ['textInputPlaceholder', 'initialSpeechInstruction', 'initialText'], + methods: { + postTextMessage: function postTextMessage() { + var _this = this; + + // empty string + if (!this.textInput.length) { + return __WEBPACK_IMPORTED_MODULE_0_babel_runtime_core_js_promise___default.a.resolve(); + } + var message = { + type: 'human', + text: this.textInput + }; + + return this.$store.dispatch('postTextMessage', message).then(function () { + _this.textInput = ''; + }); + }, + onMicClick: function onMicClick() { + if (!this.isConversationGoing) { + return this.startSpeechConversation(); + } else if (this.isBotSpeaking) { + return this.$store.dispatch('interruptSpeechConversation'); + } + + return __WEBPACK_IMPORTED_MODULE_0_babel_runtime_core_js_promise___default.a.resolve(); + }, + startSpeechConversation: function startSpeechConversation() { + var _this2 = this; + + if (this.isMicMuted) { + return __WEBPACK_IMPORTED_MODULE_0_babel_runtime_core_js_promise___default.a.resolve(); + } + return this.setAutoPlay().then(function () { + return _this2.playInitialInstruction(); + }).then(function () { + return _this2.$store.dispatch('startConversation'); + }).catch(function (error) { + console.error('error in startSpeechConversation', error); + _this2.$store.dispatch('pushErrorMessage', 'I couldn\'t start the conversation. Please try again. (' + error + ')'); + }); + }, + playInitialInstruction: function playInitialInstruction() { + var _this3 = this; + + var isInitialState = ['', 'Fulfilled', 'Failed'].some(function (initialState) { + return _this3.$store.state.lex.dialogState === initialState; + }); + + return isInitialState ? this.$store.dispatch('pollySynthesizeSpeech', this.initialSpeechInstruction) : __WEBPACK_IMPORTED_MODULE_0_babel_runtime_core_js_promise___default.a.resolve(); + }, + + /** + * Set auto-play attribute on audio element + * On mobile, Audio nodes do not autoplay without user interaction. + * To workaround that requirement, this plays a short silent audio mp3/ogg + * as a reponse to a click. This silent audio is initialized as the src + * of the audio node. Subsequent play on the same audio now + * don't require interaction so this is only done once. + */ + setAutoPlay: function setAutoPlay() { + if (this.$store.state.botAudio.autoPlay) { + return __WEBPACK_IMPORTED_MODULE_0_babel_runtime_core_js_promise___default.a.resolve(); + } + return this.$store.dispatch('setAudioAutoPlay'); + } + } +}); + +/***/ }), +/* 118 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h; + return _c('div', { + staticClass: "input-container white" + }, [_c('v-text-field', { + staticClass: "black--text ml-2", + attrs: { + "id": "text-input", + "name": "text-input", + "label": _vm.textInputPlaceholder, + "single-line": "" + }, + nativeOn: { + "keyup": function($event) { + if (!('button' in $event) && _vm._k($event.keyCode, "enter", 13)) { return null; } + $event.stopPropagation(); + _vm.postTextMessage($event) + } + }, + model: { + value: (_vm.textInput), + callback: function($$v) { + _vm.textInput = (typeof $$v === 'string' ? $$v.trim() : $$v) + }, + expression: "textInput" + } + }), _vm._v(" "), (_vm.isRecorderSupported) ? _c('v-btn', { + directives: [{ + name: "tooltip", + rawName: "v-tooltip:left", + value: ({ + html: 'click to use voice' + }), + expression: "{html: 'click to use voice'}", + arg: "left" + }], + staticClass: "black--text mic-button", + attrs: { + "icon": "", + "disabled": _vm.isMicButtonDisabled + }, + nativeOn: { + "click": function($event) { + _vm.onMicClick($event) + } + } + }, [_c('v-icon', { + attrs: { + "medium": "" + } + }, [_vm._v(_vm._s(_vm.micButtonIcon))])], 1) : _vm._e()], 1) +} +var staticRenderFns = [] +var esExports = { render: render, staticRenderFns: staticRenderFns } +/* harmony default export */ __webpack_exports__["a"] = (esExports); + +/***/ }), +/* 119 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h; + return _c('div', { + attrs: { + "id": "lex-web" + } + }, [_c('toolbar-container', { + attrs: { + "toolbar-title": _vm.toolbarTitle, + "toolbar-color": _vm.toolbarColor, + "toolbar-logo": _vm.toolbarLogo, + "is-ui-minimized": _vm.isUiMinimized + }, + on: { + "toggleMinimizeUi": _vm.toggleMinimizeUi + } + }), _vm._v(" "), _c('message-list'), _vm._v(" "), _c('status-bar'), _vm._v(" "), _c('input-container', { + attrs: { + "text-input-placeholder": _vm.textInputPlaceholder, + "initial-text": _vm.initialText, + "initial-speech-instruction": _vm.initialSpeechInstruction + } + })], 1) +} +var staticRenderFns = [] +var esExports = { render: render, staticRenderFns: staticRenderFns } +/* harmony default export */ __webpack_exports__["a"] = (esExports); + +/***/ }), +/* 120 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__store_state__ = __webpack_require__(121); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__store_getters__ = __webpack_require__(140); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__store_mutations__ = __webpack_require__(141); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__store_actions__ = __webpack_require__(156); +/* + Copyright 2017-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. + + Licensed under the Amazon Software License (the "License"). You may not use this file + except in compliance with the License. A copy of the License is located at + + http://aws.amazon.com/asl/ + + or in the "license" file accompanying this file. This file is distributed on an "AS IS" + BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, express or implied. See the + License for the specific language governing permissions and limitations under the License. + */ + +/* global atob Blob URL */ +/* eslint no-console: ["error", { allow: ["info", "warn", "error"] }] */ +/* eslint no-param-reassign: off */ + + + + + + +/* harmony default export */ __webpack_exports__["a"] = ({ + // prevent changes outside of mutation handlers + strict: "production" === 'development', + state: __WEBPACK_IMPORTED_MODULE_0__store_state__["a" /* default */], + getters: __WEBPACK_IMPORTED_MODULE_1__store_getters__["a" /* default */], + mutations: __WEBPACK_IMPORTED_MODULE_2__store_mutations__["a" /* default */], + actions: __WEBPACK_IMPORTED_MODULE_3__store_actions__["a" /* default */] +}); + +/***/ }), +/* 121 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__config__ = __webpack_require__(27); +/* +Copyright 2017-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. + +Licensed under the Amazon Software License (the "License"). You may not use this file +except in compliance with the License. A copy of the License is located at + +http://aws.amazon.com/asl/ + +or in the "license" file accompanying this file. This file is distributed on an "AS IS" +BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, express or implied. See the +License for the specific language governing permissions and limitations under the License. +*/ + +/** + * Sets up the initial state of the store + */ + + +/* harmony default export */ __webpack_exports__["a"] = ({ + version: true ? "0.8.0" : '0.0.0', + lex: { + acceptFormat: 'audio/ogg', + dialogState: '', + isInterrupting: false, + isProcessing: false, + inputTranscript: '', + intentName: '', + message: '', + responseCard: null, + sessionAttributes: __WEBPACK_IMPORTED_MODULE_0__config__["a" /* config */].lex.sessionAttributes, + slotToElicit: '', + slots: {} + }, + messages: [], + polly: { + outputFormat: 'ogg_vorbis', + voiceId: __WEBPACK_IMPORTED_MODULE_0__config__["a" /* config */].polly.voiceId + }, + botAudio: { + canInterrupt: false, + interruptIntervalId: null, + autoPlay: false, + isInterrupting: false, + isSpeaking: false + }, + recState: { + isConversationGoing: false, + isInterrupting: false, + isMicMuted: false, + isMicQuiet: true, + isRecorderSupported: false, + isRecorderEnabled: __WEBPACK_IMPORTED_MODULE_0__config__["a" /* config */].recorder.enable, + isRecording: false, + silentRecordingCount: 0 + }, + + isRunningEmbedded: false, // am I running in an iframe? + isUiMinimized: false, // when running embedded, is the iframe minimized? + config: __WEBPACK_IMPORTED_MODULE_0__config__["a" /* config */], + + awsCreds: { + provider: 'cognito' // cognito|parentWindow + } +}); + +/***/ }), +/* 122 */ +/***/ (function(module, exports, __webpack_require__) { + +module.exports = { "default": __webpack_require__(123), __esModule: true }; + +/***/ }), +/* 123 */ +/***/ (function(module, exports, __webpack_require__) { + +__webpack_require__(124); +module.exports = __webpack_require__(0).Object.keys; + +/***/ }), +/* 124 */ +/***/ (function(module, exports, __webpack_require__) { + +// 19.1.2.14 Object.keys(O) +var toObject = __webpack_require__(23) + , $keys = __webpack_require__(12); + +__webpack_require__(125)('keys', function(){ + return function keys(it){ + return $keys(toObject(it)); + }; +}); + +/***/ }), +/* 125 */ +/***/ (function(module, exports, __webpack_require__) { + +// most Object methods by ES6 should accept primitives +var $export = __webpack_require__(7) + , core = __webpack_require__(0) + , fails = __webpack_require__(11); +module.exports = function(KEY, exec){ + var fn = (core.Object || {})[KEY] || Object[KEY] + , exp = {}; + exp[KEY] = exec(fn); + $export($export.S + $export.F * fails(function(){ fn(1); }), 'Object', exp); +}; + +/***/ }), +/* 126 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +exports.__esModule = true; + +var _defineProperty = __webpack_require__(39); + +var _defineProperty2 = _interopRequireDefault(_defineProperty); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +exports.default = function (obj, key, value) { + if (key in obj) { + (0, _defineProperty2.default)(obj, key, { + value: value, + enumerable: true, + configurable: true, + writable: true + }); + } else { + obj[key] = value; + } + + return obj; +}; + +/***/ }), +/* 127 */ +/***/ (function(module, exports, __webpack_require__) { + +module.exports = { "default": __webpack_require__(128), __esModule: true }; + +/***/ }), +/* 128 */ +/***/ (function(module, exports, __webpack_require__) { + +__webpack_require__(26); +__webpack_require__(19); +module.exports = __webpack_require__(129); + +/***/ }), +/* 129 */ +/***/ (function(module, exports, __webpack_require__) { + +var classof = __webpack_require__(40) + , ITERATOR = __webpack_require__(1)('iterator') + , Iterators = __webpack_require__(14); +module.exports = __webpack_require__(0).isIterable = function(it){ + var O = Object(it); + return O[ITERATOR] !== undefined + || '@@iterator' in O + || Iterators.hasOwnProperty(classof(O)); +}; + +/***/ }), +/* 130 */ +/***/ (function(module, exports, __webpack_require__) { + +module.exports = { "default": __webpack_require__(131), __esModule: true }; + +/***/ }), +/* 131 */ +/***/ (function(module, exports, __webpack_require__) { + +__webpack_require__(26); +__webpack_require__(19); +module.exports = __webpack_require__(132); + +/***/ }), +/* 132 */ +/***/ (function(module, exports, __webpack_require__) { + +var anObject = __webpack_require__(4) + , get = __webpack_require__(41); +module.exports = __webpack_require__(0).getIterator = function(it){ + var iterFn = get(it); + if(typeof iterFn != 'function')throw TypeError(it + ' is not iterable!'); + return anObject(iterFn.call(it)); +}; + +/***/ }), +/* 133 */ +/***/ (function(module, exports) { + +function webpackEmptyContext(req) { + throw new Error("Cannot find module '" + req + "'."); +} +webpackEmptyContext.keys = function() { return []; }; +webpackEmptyContext.resolve = webpackEmptyContext; +module.exports = webpackEmptyContext; +webpackEmptyContext.id = 133; + +/***/ }), +/* 134 */ +/***/ (function(module, exports) { + +module.exports = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAQAAABLCVATAAAB4ElEQVRIDeXBz0uTcQDH8c8xLe2SpDVb9AMV7RZCUIdEodAZQrH/oCC65II6FAhu4Oi4sfoPjI6BwU4J/QGKEUQ/NLcYM29pkI/0vJvbHp7vnm19Z0GXXi/pX2GIae5xTn+HWVz2uMT155jANK79o4MeiXlMzySOcVitIkwWF/hIDlOeVcAlS1h2HGIVm08clA23acUt2ZDB5JAmwjgpHEwp2fAQn8OIqriMg+++bDjBNp60DKTxbHFcdozxlYqIDExQscGIWsEVNqmYlIEIFZuMyY4w3/FkZCCDZ5uQbHiEz2FUVYyyi++BbHiKyeEJk0TIsIspJRvu0IqbsqGDNWw+0C47wmRxgXesY1rnPeDykl41xyViROlTGZ0clXiOaV6im06V0U+UGBcVRIyKHHOEVEYE01WV0UuSPBV3FUQU3w5J2lTCLC57fjKjEtp5jIPvuoLoo9YKp1TCEDGmGVQJZ3hLrbOqR55aRQZkYJANaq2pEeYIytGlKrr5QlBCjRBih6AFVZEl6Ac9aowk9aZUwg3qxdUMbawQtKwS3hC0xAE1x2mKBA1zgaACJ/V7DJCjVoIktT7TLzu6WMC0yGtMLziiVjHFMp4CRTxLXNN+MUyCRQp8Y4sCr4hzXv+jX+Z26XqyE0SfAAAAAElFTkSuQmCC" + +/***/ }), +/* 135 */ +/***/ (function(module, exports) { + +function webpackEmptyContext(req) { + throw new Error("Cannot find module '" + req + "'."); +} +webpackEmptyContext.keys = function() { return []; }; +webpackEmptyContext.resolve = webpackEmptyContext; +module.exports = webpackEmptyContext; +webpackEmptyContext.id = 135; + +/***/ }), +/* 136 */ +/***/ (function(module, exports, __webpack_require__) { + +var map = { + "./config.dev.json": 137, + "./config.prod.json": 138, + "./config.test.json": 139 +}; +function webpackContext(req) { + return __webpack_require__(webpackContextResolve(req)); +}; +function webpackContextResolve(req) { + var id = map[req]; + if(!(id + 1)) // check for number or string + throw new Error("Cannot find module '" + req + "'."); + return id; +}; +webpackContext.keys = function webpackContextKeys() { + return Object.keys(map); +}; +webpackContext.resolve = webpackContextResolve; +module.exports = webpackContext; +webpackContext.id = 136; + +/***/ }), +/* 137 */ +/***/ (function(module, exports) { + +module.exports = { + "cognito": { + "poolId": "" + }, + "lex": { + "botName": "WebUiOrderFlowers", + "initialText": "You can ask me for help ordering flowers. Just type \"order flowers\" or click on the mic and say it.", + "initialSpeechInstruction": "Say 'Order Flowers' to get started." + }, + "polly": { + "voiceId": "Salli" + }, + "ui": { + "parentOrigin": "http://localhost:8080", + "pageTitle": "Order Flowers Bot", + "toolbarTitle": "Order Flowers" + }, + "recorder": { + "preset": "speech_recognition" + } +}; + +/***/ }), +/* 138 */ +/***/ (function(module, exports) { + +module.exports = { + "cognito": { + "poolId": "" + }, + "lex": { + "botName": "WebUiOrderFlowers", + "initialText": "You can ask me for help ordering flowers. Just type \"order flowers\" or click on the mic and say it.", + "initialSpeechInstruction": "Say 'Order Flowers' to get started." + }, + "polly": { + "voiceId": "Salli" + }, + "ui": { + "parentOrigin": "", + "pageTitle": "Order Flowers Bot", + "toolbarTitle": "Order Flowers" + }, + "recorder": { + "preset": "speech_recognition" + } +}; + +/***/ }), +/* 139 */ +/***/ (function(module, exports) { + +module.exports = { + "cognito": { + "poolId": "" + }, + "lex": { + "botName": "WebUiOrderFlowers", + "initialText": "You can ask me for help ordering flowers. Just type \"order flowers\" or click on the mic and say it.", + "initialSpeechInstruction": "Say 'Order Flowers' to get started." + }, + "polly": { + "voiceId": "Salli" + }, + "ui": { + "parentOrigin": "http://localhost:8080", + "pageTitle": "Order Flowers Bot", + "toolbarTitle": "Order Flowers" + }, + "recorder": { + "preset": "speech_recognition" + } +}; + +/***/ }), +/* 140 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* +Copyright 2017-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. + +Licensed under the Amazon Software License (the "License"). You may not use this file +except in compliance with the License. A copy of the License is located at + +http://aws.amazon.com/asl/ + +or in the "license" file accompanying this file. This file is distributed on an "AS IS" +BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, express or implied. See the +License for the specific language governing permissions and limitations under the License. +*/ + +/* harmony default export */ __webpack_exports__["a"] = ({ + canInterruptBotPlayback: function canInterruptBotPlayback(state) { + return state.botAudio.canInterrupt; + }, + isBotSpeaking: function isBotSpeaking(state) { + return state.botAudio.isSpeaking; + }, + isConversationGoing: function isConversationGoing(state) { + return state.recState.isConversationGoing; + }, + isLexInterrupting: function isLexInterrupting(state) { + return state.lex.isInterrupting; + }, + isLexProcessing: function isLexProcessing(state) { + return state.lex.isProcessing; + }, + isMicMuted: function isMicMuted(state) { + return state.recState.isMicMuted; + }, + isMicQuiet: function isMicQuiet(state) { + return state.recState.isMicQuiet; + }, + isRecorderSupported: function isRecorderSupported(state) { + return state.recState.isRecorderSupported; + }, + isRecording: function isRecording(state) { + return state.recState.isRecording; + } +}); + +/***/ }), +/* 141 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_typeof__ = __webpack_require__(142); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_typeof___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_typeof__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_extends__ = __webpack_require__(20); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_extends___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_extends__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__config__ = __webpack_require__(27); + + +/* +Copyright 2017-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. + +Licensed under the Amazon Software License (the "License"). You may not use this file +except in compliance with the License. A copy of the License is located at + +http://aws.amazon.com/asl/ + +or in the "license" file accompanying this file. This file is distributed on an "AS IS" +BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, express or implied. See the +License for the specific language governing permissions and limitations under the License. +*/ + +/** + * Store mutations + */ + +/* eslint no-console: ["error", { allow: ["info", "warn", "error"] }] */ +/* eslint no-param-reassign: ["error", { "props": false }] */ +/* eslint spaced-comment: ["error", "always", { "exceptions": ["*"] }] */ + + + +/* harmony default export */ __webpack_exports__["a"] = ({ + /*********************************************************************** + * + * Recorder State Mutations + * + **********************************************************************/ + + /** + * true if recorder seems to be muted + */ + setIsMicMuted: function setIsMicMuted(state, bool) { + if (typeof bool !== 'boolean') { + console.error('setIsMicMuted status not boolean', bool); + return; + } + if (state.config.recorder.useAutoMuteDetect) { + state.recState.isMicMuted = bool; + } + }, + + /** + * set to true if mic if sound from mic is not loud enough + */ + setIsMicQuiet: function setIsMicQuiet(state, bool) { + if (typeof bool !== 'boolean') { + console.error('setIsMicQuiet status not boolean', bool); + return; + } + state.recState.isMicQuiet = bool; + }, + + /** + * set to true while speech conversation is going + */ + setIsConversationGoing: function setIsConversationGoing(state, bool) { + if (typeof bool !== 'boolean') { + console.error('setIsConversationGoing status not boolean', bool); + return; + } + state.recState.isConversationGoing = bool; + }, + + /** + * Signals recorder to start and sets recoding state to true + */ + startRecording: function startRecording(state, recorder) { + console.info('start recording'); + if (state.recState.isRecording === false) { + recorder.start(); + state.recState.isRecording = true; + } + }, + + /** + * Set recording state to false + */ + stopRecording: function stopRecording(state, recorder) { + if (state.recState.isRecording === true) { + state.recState.isRecording = false; + if (recorder.isRecording) { + recorder.stop(); + } + } + }, + + /** + * Increase consecutive silent recordings count + * This is used to bail out from the conversation + * when too many recordings are silent + */ + increaseSilentRecordingCount: function increaseSilentRecordingCount(state) { + state.recState.silentRecordingCount += 1; + }, + + /** + * Reset the number of consecutive silent recordings + */ + resetSilentRecordingCount: function resetSilentRecordingCount(state) { + state.recState.silentRecordingCount = 0; + }, + + /** + * Set to true if audio recording should be enabled + */ + setIsRecorderEnabled: function setIsRecorderEnabled(state, bool) { + if (typeof bool !== 'boolean') { + console.error('setIsRecorderEnabled status not boolean', bool); + return; + } + state.recState.isRecorderEnabled = bool; + }, + + /** + * Set to true if audio recording is supported + */ + setIsRecorderSupported: function setIsRecorderSupported(state, bool) { + if (typeof bool !== 'boolean') { + console.error('setIsRecorderSupported status not boolean', bool); + return; + } + state.recState.isRecorderSupported = bool; + }, + + + /*********************************************************************** + * + * Bot Audio Mutations + * + **********************************************************************/ + + /** + * set to true while audio from Lex is playing + */ + setIsBotSpeaking: function setIsBotSpeaking(state, bool) { + if (typeof bool !== 'boolean') { + console.error('setIsBotSpeaking status not boolean', bool); + return; + } + state.botAudio.isSpeaking = bool; + }, + + /** + * Set to true when the Lex audio is ready to autoplay + * after it has already played audio on user interaction (click) + */ + setAudioAutoPlay: function setAudioAutoPlay(state, audio, bool) { + if (typeof bool !== 'boolean') { + console.error('setAudioAutoPlay status not boolean', bool); + return; + } + state.botAudio.autoPlay = bool; + audio.autoplay = bool; + }, + + /** + * set to true if bot playback can be interrupted + */ + setCanInterruptBotPlayback: function setCanInterruptBotPlayback(state, bool) { + if (typeof bool !== 'boolean') { + console.error('setCanInterruptBotPlayback status not boolean', bool); + return; + } + state.botAudio.canInterrupt = bool; + }, + + /** + * set to true if bot playback is being interrupted + */ + setIsBotPlaybackInterrupting: function setIsBotPlaybackInterrupting(state, bool) { + if (typeof bool !== 'boolean') { + console.error('setIsBotPlaybackInterrupting status not boolean', bool); + return; + } + state.botAudio.isInterrupting = bool; + }, + + /** + * used to set the setInterval Id for bot playback interruption + */ + setBotPlaybackInterruptIntervalId: function setBotPlaybackInterruptIntervalId(state, id) { + if (typeof id !== 'number') { + console.error('setIsBotPlaybackInterruptIntervalId id is not a number', id); + return; + } + state.botAudio.interruptIntervalId = id; + }, + + + /*********************************************************************** + * + * Lex and Polly Mutations + * + **********************************************************************/ + + /** + * Updates Lex State from Lex responses + */ + updateLexState: function updateLexState(state, lexState) { + state.lex = __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_extends___default()({}, state.lex, lexState); + }, + + /** + * Sets the Lex session attributes + */ + setLexSessionAttributes: function setLexSessionAttributes(state, sessionAttributes) { + if ((typeof sessionAttributes === 'undefined' ? 'undefined' : __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_typeof___default()(sessionAttributes)) !== 'object') { + console.error('sessionAttributes is not an object', sessionAttributes); + return; + } + state.lex.sessionAttributes = sessionAttributes; + }, + + /** + * set to true while calling lexPost{Text,Content} + * to mark as processing + */ + setIsLexProcessing: function setIsLexProcessing(state, bool) { + if (typeof bool !== 'boolean') { + console.error('setIsLexProcessing status not boolean', bool); + return; + } + state.lex.isProcessing = bool; + }, + + /** + * set to true if lex is being interrupted while speaking + */ + setIsLexInterrupting: function setIsLexInterrupting(state, bool) { + if (typeof bool !== 'boolean') { + console.error('setIsLexInterrupting status not boolean', bool); + return; + } + state.lex.isInterrupting = bool; + }, + + /** + * Set the supported content types to be used with Lex/Polly + */ + setAudioContentType: function setAudioContentType(state, type) { + switch (type) { + case 'mp3': + case 'mpg': + case 'mpeg': + state.polly.outputFormat = 'mp3'; + state.lex.acceptFormat = 'audio/mpeg'; + break; + case 'ogg': + case 'ogg_vorbis': + case 'x-cbr-opus-with-preamble': + default: + state.polly.outputFormat = 'ogg_vorbis'; + state.lex.acceptFormat = 'audio/ogg'; + break; + } + }, + + /** + * Set the Polly voice to be used by the client + */ + setPollyVoiceId: function setPollyVoiceId(state, voiceId) { + if (typeof voiceId !== 'string') { + console.error('polly voiceId is not a string', voiceId); + return; + } + state.polly.voiceId = voiceId; + }, + + + /*********************************************************************** + * + * UI and General Mutations + * + **********************************************************************/ + + /** + * Merges the general config of the web ui + * with a dynamic config param and merges it with + * the existing config (e.g. initialized from ../config) + */ + mergeConfig: function mergeConfig(state, configObj) { + if ((typeof configObj === 'undefined' ? 'undefined' : __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_typeof___default()(configObj)) !== 'object') { + console.error('config is not an object', configObj); + return; + } + + // security: do not accept dynamic parentOrigin + if (configObj.ui && configObj.ui.parentOrigin) { + delete configObj.ui.parentOrigin; + } + state.config = Object(__WEBPACK_IMPORTED_MODULE_2__config__["b" /* mergeConfig */])(state.config, configObj); + }, + + /** + * Set to true if running embedded in an iframe + */ + setIsRunningEmbedded: function setIsRunningEmbedded(state, bool) { + if (typeof bool !== 'boolean') { + console.error('setIsRunningEmbedded status not boolean', bool); + return; + } + state.isRunningEmbedded = bool; + }, + + /** + * used to track the expand/minimize status of the window when + * running embedded in an iframe + */ + toggleIsUiMinimized: function toggleIsUiMinimized(state) { + state.isUiMinimized = !state.isUiMinimized; + }, + + /** + * Push new message into messages array + */ + pushMessage: function pushMessage(state, message) { + state.messages.push(__WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_extends___default()({ + id: state.messages.length + }, message)); + }, + + /** + * Set the AWS credentials provider + */ + setAwsCredsProvider: function setAwsCredsProvider(state, provider) { + state.awsCreds.provider = provider; + } +}); + +/***/ }), +/* 142 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +exports.__esModule = true; + +var _iterator = __webpack_require__(143); + +var _iterator2 = _interopRequireDefault(_iterator); + +var _symbol = __webpack_require__(145); + +var _symbol2 = _interopRequireDefault(_symbol); + +var _typeof = typeof _symbol2.default === "function" && typeof _iterator2.default === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof _symbol2.default === "function" && obj.constructor === _symbol2.default && obj !== _symbol2.default.prototype ? "symbol" : typeof obj; }; + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +exports.default = typeof _symbol2.default === "function" && _typeof(_iterator2.default) === "symbol" ? function (obj) { + return typeof obj === "undefined" ? "undefined" : _typeof(obj); +} : function (obj) { + return obj && typeof _symbol2.default === "function" && obj.constructor === _symbol2.default && obj !== _symbol2.default.prototype ? "symbol" : typeof obj === "undefined" ? "undefined" : _typeof(obj); +}; + +/***/ }), +/* 143 */ +/***/ (function(module, exports, __webpack_require__) { + +module.exports = { "default": __webpack_require__(144), __esModule: true }; + +/***/ }), +/* 144 */ +/***/ (function(module, exports, __webpack_require__) { + +__webpack_require__(19); +__webpack_require__(26); +module.exports = __webpack_require__(42).f('iterator'); + +/***/ }), +/* 145 */ +/***/ (function(module, exports, __webpack_require__) { + +module.exports = { "default": __webpack_require__(146), __esModule: true }; + +/***/ }), +/* 146 */ +/***/ (function(module, exports, __webpack_require__) { + +__webpack_require__(147); +__webpack_require__(48); +__webpack_require__(154); +__webpack_require__(155); +module.exports = __webpack_require__(0).Symbol; + +/***/ }), +/* 147 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// ECMAScript 6 symbols shim +var global = __webpack_require__(2) + , has = __webpack_require__(9) + , DESCRIPTORS = __webpack_require__(5) + , $export = __webpack_require__(7) + , redefine = __webpack_require__(50) + , META = __webpack_require__(148).KEY + , $fails = __webpack_require__(11) + , shared = __webpack_require__(35) + , setToStringTag = __webpack_require__(25) + , uid = __webpack_require__(21) + , wks = __webpack_require__(1) + , wksExt = __webpack_require__(42) + , wksDefine = __webpack_require__(43) + , keyOf = __webpack_require__(149) + , enumKeys = __webpack_require__(150) + , isArray = __webpack_require__(151) + , anObject = __webpack_require__(4) + , toIObject = __webpack_require__(10) + , toPrimitive = __webpack_require__(30) + , createDesc = __webpack_require__(17) + , _create = __webpack_require__(51) + , gOPNExt = __webpack_require__(152) + , $GOPD = __webpack_require__(153) + , $DP = __webpack_require__(3) + , $keys = __webpack_require__(12) + , gOPD = $GOPD.f + , dP = $DP.f + , gOPN = gOPNExt.f + , $Symbol = global.Symbol + , $JSON = global.JSON + , _stringify = $JSON && $JSON.stringify + , PROTOTYPE = 'prototype' + , HIDDEN = wks('_hidden') + , TO_PRIMITIVE = wks('toPrimitive') + , isEnum = {}.propertyIsEnumerable + , SymbolRegistry = shared('symbol-registry') + , AllSymbols = shared('symbols') + , OPSymbols = shared('op-symbols') + , ObjectProto = Object[PROTOTYPE] + , USE_NATIVE = typeof $Symbol == 'function' + , QObject = global.QObject; +// Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173 +var setter = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild; + +// fallback for old Android, https://code.google.com/p/v8/issues/detail?id=687 +var setSymbolDesc = DESCRIPTORS && $fails(function(){ + return _create(dP({}, 'a', { + get: function(){ return dP(this, 'a', {value: 7}).a; } + })).a != 7; +}) ? function(it, key, D){ + var protoDesc = gOPD(ObjectProto, key); + if(protoDesc)delete ObjectProto[key]; + dP(it, key, D); + if(protoDesc && it !== ObjectProto)dP(ObjectProto, key, protoDesc); +} : dP; + +var wrap = function(tag){ + var sym = AllSymbols[tag] = _create($Symbol[PROTOTYPE]); + sym._k = tag; + return sym; +}; + +var isSymbol = USE_NATIVE && typeof $Symbol.iterator == 'symbol' ? function(it){ + return typeof it == 'symbol'; +} : function(it){ + return it instanceof $Symbol; +}; + +var $defineProperty = function defineProperty(it, key, D){ + if(it === ObjectProto)$defineProperty(OPSymbols, key, D); + anObject(it); + key = toPrimitive(key, true); + anObject(D); + if(has(AllSymbols, key)){ + if(!D.enumerable){ + if(!has(it, HIDDEN))dP(it, HIDDEN, createDesc(1, {})); + it[HIDDEN][key] = true; + } else { + if(has(it, HIDDEN) && it[HIDDEN][key])it[HIDDEN][key] = false; + D = _create(D, {enumerable: createDesc(0, false)}); + } return setSymbolDesc(it, key, D); + } return dP(it, key, D); +}; +var $defineProperties = function defineProperties(it, P){ + anObject(it); + var keys = enumKeys(P = toIObject(P)) + , i = 0 + , l = keys.length + , key; + while(l > i)$defineProperty(it, key = keys[i++], P[key]); + return it; +}; +var $create = function create(it, P){ + return P === undefined ? _create(it) : $defineProperties(_create(it), P); +}; +var $propertyIsEnumerable = function propertyIsEnumerable(key){ + var E = isEnum.call(this, key = toPrimitive(key, true)); + if(this === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key))return false; + return E || !has(this, key) || !has(AllSymbols, key) || has(this, HIDDEN) && this[HIDDEN][key] ? E : true; +}; +var $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(it, key){ + it = toIObject(it); + key = toPrimitive(key, true); + if(it === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key))return; + var D = gOPD(it, key); + if(D && has(AllSymbols, key) && !(has(it, HIDDEN) && it[HIDDEN][key]))D.enumerable = true; + return D; +}; +var $getOwnPropertyNames = function getOwnPropertyNames(it){ + var names = gOPN(toIObject(it)) + , result = [] + , i = 0 + , key; + while(names.length > i){ + if(!has(AllSymbols, key = names[i++]) && key != HIDDEN && key != META)result.push(key); + } return result; +}; +var $getOwnPropertySymbols = function getOwnPropertySymbols(it){ + var IS_OP = it === ObjectProto + , names = gOPN(IS_OP ? OPSymbols : toIObject(it)) + , result = [] + , i = 0 + , key; + while(names.length > i){ + if(has(AllSymbols, key = names[i++]) && (IS_OP ? has(ObjectProto, key) : true))result.push(AllSymbols[key]); + } return result; +}; + +// 19.4.1.1 Symbol([description]) +if(!USE_NATIVE){ + $Symbol = function Symbol(){ + if(this instanceof $Symbol)throw TypeError('Symbol is not a constructor!'); + var tag = uid(arguments.length > 0 ? arguments[0] : undefined); + var $set = function(value){ + if(this === ObjectProto)$set.call(OPSymbols, value); + if(has(this, HIDDEN) && has(this[HIDDEN], tag))this[HIDDEN][tag] = false; + setSymbolDesc(this, tag, createDesc(1, value)); + }; + if(DESCRIPTORS && setter)setSymbolDesc(ObjectProto, tag, {configurable: true, set: $set}); + return wrap(tag); + }; + redefine($Symbol[PROTOTYPE], 'toString', function toString(){ + return this._k; + }); + + $GOPD.f = $getOwnPropertyDescriptor; + $DP.f = $defineProperty; + __webpack_require__(58).f = gOPNExt.f = $getOwnPropertyNames; + __webpack_require__(22).f = $propertyIsEnumerable; + __webpack_require__(37).f = $getOwnPropertySymbols; + + if(DESCRIPTORS && !__webpack_require__(24)){ + redefine(ObjectProto, 'propertyIsEnumerable', $propertyIsEnumerable, true); + } + + wksExt.f = function(name){ + return wrap(wks(name)); + } +} + +$export($export.G + $export.W + $export.F * !USE_NATIVE, {Symbol: $Symbol}); + +for(var symbols = ( + // 19.4.2.2, 19.4.2.3, 19.4.2.4, 19.4.2.6, 19.4.2.8, 19.4.2.9, 19.4.2.10, 19.4.2.11, 19.4.2.12, 19.4.2.13, 19.4.2.14 + 'hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables' +).split(','), i = 0; symbols.length > i; )wks(symbols[i++]); + +for(var symbols = $keys(wks.store), i = 0; symbols.length > i; )wksDefine(symbols[i++]); + +$export($export.S + $export.F * !USE_NATIVE, 'Symbol', { + // 19.4.2.1 Symbol.for(key) + 'for': function(key){ + return has(SymbolRegistry, key += '') + ? SymbolRegistry[key] + : SymbolRegistry[key] = $Symbol(key); + }, + // 19.4.2.5 Symbol.keyFor(sym) + keyFor: function keyFor(key){ + if(isSymbol(key))return keyOf(SymbolRegistry, key); + throw TypeError(key + ' is not a symbol!'); + }, + useSetter: function(){ setter = true; }, + useSimple: function(){ setter = false; } +}); + +$export($export.S + $export.F * !USE_NATIVE, 'Object', { + // 19.1.2.2 Object.create(O [, Properties]) + create: $create, + // 19.1.2.4 Object.defineProperty(O, P, Attributes) + defineProperty: $defineProperty, + // 19.1.2.3 Object.defineProperties(O, Properties) + defineProperties: $defineProperties, + // 19.1.2.6 Object.getOwnPropertyDescriptor(O, P) + getOwnPropertyDescriptor: $getOwnPropertyDescriptor, + // 19.1.2.7 Object.getOwnPropertyNames(O) + getOwnPropertyNames: $getOwnPropertyNames, + // 19.1.2.8 Object.getOwnPropertySymbols(O) + getOwnPropertySymbols: $getOwnPropertySymbols +}); + +// 24.3.2 JSON.stringify(value [, replacer [, space]]) +$JSON && $export($export.S + $export.F * (!USE_NATIVE || $fails(function(){ + var S = $Symbol(); + // MS Edge converts symbol values to JSON as {} + // WebKit converts symbol values to JSON as null + // V8 throws on boxed symbols + return _stringify([S]) != '[null]' || _stringify({a: S}) != '{}' || _stringify(Object(S)) != '{}'; +})), 'JSON', { + stringify: function stringify(it){ + if(it === undefined || isSymbol(it))return; // IE8 returns string on undefined + var args = [it] + , i = 1 + , replacer, $replacer; + while(arguments.length > i)args.push(arguments[i++]); + replacer = args[1]; + if(typeof replacer == 'function')$replacer = replacer; + if($replacer || !isArray(replacer))replacer = function(key, value){ + if($replacer)value = $replacer.call(this, key, value); + if(!isSymbol(value))return value; + }; + args[1] = replacer; + return _stringify.apply($JSON, args); + } +}); + +// 19.4.3.4 Symbol.prototype[@@toPrimitive](hint) +$Symbol[PROTOTYPE][TO_PRIMITIVE] || __webpack_require__(8)($Symbol[PROTOTYPE], TO_PRIMITIVE, $Symbol[PROTOTYPE].valueOf); +// 19.4.3.5 Symbol.prototype[@@toStringTag] +setToStringTag($Symbol, 'Symbol'); +// 20.2.1.9 Math[@@toStringTag] +setToStringTag(Math, 'Math', true); +// 24.3.3 JSON[@@toStringTag] +setToStringTag(global.JSON, 'JSON', true); + +/***/ }), +/* 148 */ +/***/ (function(module, exports, __webpack_require__) { + +var META = __webpack_require__(21)('meta') + , isObject = __webpack_require__(16) + , has = __webpack_require__(9) + , setDesc = __webpack_require__(3).f + , id = 0; +var isExtensible = Object.isExtensible || function(){ + return true; +}; +var FREEZE = !__webpack_require__(11)(function(){ + return isExtensible(Object.preventExtensions({})); +}); +var setMeta = function(it){ + setDesc(it, META, {value: { + i: 'O' + ++id, // object ID + w: {} // weak collections IDs + }}); +}; +var fastKey = function(it, create){ + // return primitive with prefix + if(!isObject(it))return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it; + if(!has(it, META)){ + // can't set metadata to uncaught frozen object + if(!isExtensible(it))return 'F'; + // not necessary to add metadata + if(!create)return 'E'; + // add missing metadata + setMeta(it); + // return object ID + } return it[META].i; +}; +var getWeak = function(it, create){ + if(!has(it, META)){ + // can't set metadata to uncaught frozen object + if(!isExtensible(it))return true; + // not necessary to add metadata + if(!create)return false; + // add missing metadata + setMeta(it); + // return hash weak collections IDs + } return it[META].w; +}; +// add metadata on freeze-family methods calling +var onFreeze = function(it){ + if(FREEZE && meta.NEED && isExtensible(it) && !has(it, META))setMeta(it); + return it; +}; +var meta = module.exports = { + KEY: META, + NEED: false, + fastKey: fastKey, + getWeak: getWeak, + onFreeze: onFreeze +}; + +/***/ }), +/* 149 */ +/***/ (function(module, exports, __webpack_require__) { + +var getKeys = __webpack_require__(12) + , toIObject = __webpack_require__(10); +module.exports = function(object, el){ + var O = toIObject(object) + , keys = getKeys(O) + , length = keys.length + , index = 0 + , key; + while(length > index)if(O[key = keys[index++]] === el)return key; +}; + +/***/ }), +/* 150 */ +/***/ (function(module, exports, __webpack_require__) { + +// all enumerable object keys, includes symbols +var getKeys = __webpack_require__(12) + , gOPS = __webpack_require__(37) + , pIE = __webpack_require__(22); +module.exports = function(it){ + var result = getKeys(it) + , getSymbols = gOPS.f; + if(getSymbols){ + var symbols = getSymbols(it) + , isEnum = pIE.f + , i = 0 + , key; + while(symbols.length > i)if(isEnum.call(it, key = symbols[i++]))result.push(key); + } return result; +}; + +/***/ }), +/* 151 */ +/***/ (function(module, exports, __webpack_require__) { + +// 7.2.2 IsArray(argument) +var cof = __webpack_require__(18); +module.exports = Array.isArray || function isArray(arg){ + return cof(arg) == 'Array'; +}; + +/***/ }), +/* 152 */ +/***/ (function(module, exports, __webpack_require__) { + +// fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window +var toIObject = __webpack_require__(10) + , gOPN = __webpack_require__(58).f + , toString = {}.toString; + +var windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames + ? Object.getOwnPropertyNames(window) : []; + +var getWindowNames = function(it){ + try { + return gOPN(it); + } catch(e){ + return windowNames.slice(); + } +}; + +module.exports.f = function getOwnPropertyNames(it){ + return windowNames && toString.call(it) == '[object Window]' ? getWindowNames(it) : gOPN(toIObject(it)); +}; + + +/***/ }), +/* 153 */ +/***/ (function(module, exports, __webpack_require__) { + +var pIE = __webpack_require__(22) + , createDesc = __webpack_require__(17) + , toIObject = __webpack_require__(10) + , toPrimitive = __webpack_require__(30) + , has = __webpack_require__(9) + , IE8_DOM_DEFINE = __webpack_require__(45) + , gOPD = Object.getOwnPropertyDescriptor; + +exports.f = __webpack_require__(5) ? gOPD : function getOwnPropertyDescriptor(O, P){ + O = toIObject(O); + P = toPrimitive(P, true); + if(IE8_DOM_DEFINE)try { + return gOPD(O, P); + } catch(e){ /* empty */ } + if(has(O, P))return createDesc(!pIE.f.call(O, P), O[P]); +}; + +/***/ }), +/* 154 */ +/***/ (function(module, exports, __webpack_require__) { + +__webpack_require__(43)('asyncIterator'); + +/***/ }), +/* 155 */ +/***/ (function(module, exports, __webpack_require__) { + +__webpack_require__(43)('observable'); + +/***/ }), +/* 156 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends__ = __webpack_require__(20); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_core_js_promise__ = __webpack_require__(13); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_core_js_promise___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_babel_runtime_core_js_promise__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__config__ = __webpack_require__(27); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__lib_lex_recorder__ = __webpack_require__(157); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__store_recorder_handlers__ = __webpack_require__(165); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__assets_silent_ogg__ = __webpack_require__(166); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__assets_silent_ogg___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5__assets_silent_ogg__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__assets_silent_mp3__ = __webpack_require__(167); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__assets_silent_mp3___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_6__assets_silent_mp3__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__lib_lex_client__ = __webpack_require__(168); + + +/* +Copyright 2017-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. + +Licensed under the Amazon Software License (the "License"). You may not use this file +except in compliance with the License. A copy of the License is located at + +http://aws.amazon.com/asl/ + +or in the "license" file accompanying this file. This file is distributed on an "AS IS" +BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, express or implied. See the +License for the specific language governing permissions and limitations under the License. +*/ + +/** + * Asynchronous store actions + */ + +/* eslint no-console: ["error", { allow: ["info", "warn", "error"] }] */ +/* eslint spaced-comment: ["error", "always", { "exceptions": ["*"] }] */ + + + + + + + + + + +// non-state variables that may be mutated outside of store +// set via initializers at run time +var awsCredentials = void 0; +var pollyClient = void 0; +var lexClient = void 0; +var audio = void 0; +var recorder = void 0; + +/* harmony default export */ __webpack_exports__["a"] = ({ + + /*********************************************************************** + * + * Initialization Actions + * + **********************************************************************/ + + initCredentials: function initCredentials(context, credentials) { + switch (context.state.awsCreds.provider) { + case 'cognito': + awsCredentials = credentials; + return context.dispatch('getCredentials'); + case 'parentWindow': + return context.dispatch('getCredentials'); + default: + return __WEBPACK_IMPORTED_MODULE_1_babel_runtime_core_js_promise___default.a.reject('unknown credential provider'); + } + }, + getConfigFromParent: function getConfigFromParent(context) { + if (!context.state.isRunningEmbedded) { + return __WEBPACK_IMPORTED_MODULE_1_babel_runtime_core_js_promise___default.a.resolve({}); + } + + return context.dispatch('sendMessageToParentWindow', { event: 'initIframeConfig' }).then(function (configResponse) { + if (configResponse.event === 'resolve' && configResponse.type === 'initIframeConfig') { + return __WEBPACK_IMPORTED_MODULE_1_babel_runtime_core_js_promise___default.a.resolve(configResponse.data); + } + return __WEBPACK_IMPORTED_MODULE_1_babel_runtime_core_js_promise___default.a.reject('invalid config event from parent'); + }); + }, + initConfig: function initConfig(context, configObj) { + context.commit('mergeConfig', configObj); + }, + initMessageList: function initMessageList(context) { + context.commit('pushMessage', { + type: 'bot', + text: context.state.config.lex.initialText + }); + }, + initLexClient: function initLexClient(context, lexRuntimeClient) { + lexClient = new __WEBPACK_IMPORTED_MODULE_7__lib_lex_client__["a" /* default */]({ + botName: context.state.config.lex.botName, + botAlias: context.state.config.lex.botAlias, + lexRuntimeClient: lexRuntimeClient + }); + + context.commit('setLexSessionAttributes', context.state.config.lex.sessionAttributes); + return context.dispatch('getCredentials').then(function () { + lexClient.initCredentials(awsCredentials); + }); + }, + initPollyClient: function initPollyClient(context, client) { + if (!context.state.recState.isRecorderEnabled) { + return __WEBPACK_IMPORTED_MODULE_1_babel_runtime_core_js_promise___default.a.resolve(); + } + pollyClient = client; + context.commit('setPollyVoiceId', context.state.config.polly.voiceId); + return context.dispatch('getCredentials').then(function (creds) { + pollyClient.config.credentials = creds; + }); + }, + initRecorder: function initRecorder(context) { + if (!context.state.recState.isRecorderEnabled) { + return __WEBPACK_IMPORTED_MODULE_1_babel_runtime_core_js_promise___default.a.resolve(); + } + recorder = new __WEBPACK_IMPORTED_MODULE_3__lib_lex_recorder__["a" /* default */](context.state.config.recorder); + + return recorder.init().then(function () { + return recorder.initOptions(context.state.config.recorder); + }).then(function () { + return Object(__WEBPACK_IMPORTED_MODULE_4__store_recorder_handlers__["a" /* default */])(context, recorder); + }).then(function () { + return context.commit('setIsRecorderSupported', true); + }).then(function () { + return context.commit('setIsMicMuted', recorder.isMicMuted); + }).catch(function (error) { + if (['PermissionDeniedError', 'NotAllowedError'].indexOf(error.name) >= 0) { + console.warn('get user media permission denied'); + context.dispatch('pushErrorMessage', 'It seems like the microphone access has been denied. ' + 'If you want to use voice, please allow mic usage in your browser.'); + } else { + console.error('error while initRecorder', error); + } + }); + }, + initBotAudio: function initBotAudio(context, audioElement) { + if (!context.state.recState.isRecorderEnabled) { + return; + } + audio = audioElement; + + var silentSound = void 0; + + // Ogg is the preferred format as it seems to be generally smaller. + // Detect if ogg is supported (MS Edge doesn't). + // Can't default to mp3 as it is not supported by some Android browsers + if (audio.canPlayType('audio/ogg') !== '') { + context.commit('setAudioContentType', 'ogg'); + silentSound = __WEBPACK_IMPORTED_MODULE_5__assets_silent_ogg___default.a; + } else if (audio.canPlayType('audio/mp3') !== '') { + context.commit('setAudioContentType', 'mp3'); + silentSound = __WEBPACK_IMPORTED_MODULE_6__assets_silent_mp3___default.a; + } else { + console.error('init audio could not find supportted audio type'); + console.warn('init audio can play mp3 [%s]', audio.canPlayType('audio/mp3')); + console.warn('init audio can play ogg [%s]', audio.canPlayType('audio/ogg')); + } + + console.info('recorder content types: %s', recorder.mimeType); + + audio.preload = 'auto'; + audio.autoplay = true; + // Load a silent sound as the initial audio. This is used to workaround + // the requirement of mobile browsers that would only play a + // sound in direct response to a user action (e.g. click). + // This audio should be explicitly played as a response to a click + // in the UI + audio.src = silentSound; + }, + reInitBot: function reInitBot(context) { + return __WEBPACK_IMPORTED_MODULE_1_babel_runtime_core_js_promise___default.a.resolve().then(function () { + return context.state.config.ui.pushInitialTextOnRestart ? context.dispatch('pushMessage', { + text: context.state.config.lex.initialText, + type: 'bot' + }) : __WEBPACK_IMPORTED_MODULE_1_babel_runtime_core_js_promise___default.a.resolve(); + }).then(function () { + return context.state.config.lex.reInitSessionAttributesOnRestart ? context.commit('setLexSessionAttributes', context.state.config.lex.sessionAttributes) : __WEBPACK_IMPORTED_MODULE_1_babel_runtime_core_js_promise___default.a.resolve(); + }); + }, + + + /*********************************************************************** + * + * Audio Actions + * + **********************************************************************/ + + getAudioUrl: function getAudioUrl(context, blob) { + var url = void 0; + + try { + url = URL.createObjectURL(blob); + } catch (error) { + console.error('getAudioUrl createObjectURL error', error); + return __WEBPACK_IMPORTED_MODULE_1_babel_runtime_core_js_promise___default.a.reject('There was an error processing the audio response (' + error + ')'); + } + + return __WEBPACK_IMPORTED_MODULE_1_babel_runtime_core_js_promise___default.a.resolve(url); + }, + setAudioAutoPlay: function setAudioAutoPlay(context) { + var audioElem = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : audio; + + if (audioElem.autoplay) { + return __WEBPACK_IMPORTED_MODULE_1_babel_runtime_core_js_promise___default.a.resolve(); + } + return new __WEBPACK_IMPORTED_MODULE_1_babel_runtime_core_js_promise___default.a(function (resolve, reject) { + audio.play(); + // eslint-disable-next-line no-param-reassign + audioElem.onended = function () { + context.commit('setAudioAutoPlay', audioElem, true); + resolve(); + }; + // eslint-disable-next-line no-param-reassign + audioElem.onerror = function (err) { + context.commit('setAudioAutoPlay', audioElem, false); + reject('setting audio autoplay failed: ' + err); + }; + }); + }, + playAudio: function playAudio(context, url) { + return new __WEBPACK_IMPORTED_MODULE_1_babel_runtime_core_js_promise___default.a(function (resolve) { + audio.onloadedmetadata = function () { + context.commit('setIsBotSpeaking', true); + context.dispatch('playAudioHandler').then(function () { + return resolve(); + }); + }; + audio.src = url; + }); + }, + playAudioHandler: function playAudioHandler(context) { + return new __WEBPACK_IMPORTED_MODULE_1_babel_runtime_core_js_promise___default.a(function (resolve, reject) { + var enablePlaybackInterrupt = context.state.config.lex.enablePlaybackInterrupt; + + + var clearPlayback = function clearPlayback() { + context.commit('setIsBotSpeaking', false); + var intervalId = context.state.botAudio.interruptIntervalId; + if (intervalId && enablePlaybackInterrupt) { + clearInterval(intervalId); + context.commit('setBotPlaybackInterruptIntervalId', 0); + context.commit('setIsLexInterrupting', false); + context.commit('setCanInterruptBotPlayback', false); + context.commit('setIsBotPlaybackInterrupting', false); + } + }; + + audio.onerror = function (error) { + clearPlayback(); + reject('There was an error playing the response (' + error + ')'); + }; + audio.onended = function () { + clearPlayback(); + resolve(); + }; + audio.onpause = audio.onended; + + if (enablePlaybackInterrupt) { + context.dispatch('playAudioInterruptHandler'); + } + }); + }, + playAudioInterruptHandler: function playAudioInterruptHandler(context) { + var isSpeaking = context.state.botAudio.isSpeaking; + var _context$state$config = context.state.config.lex, + enablePlaybackInterrupt = _context$state$config.enablePlaybackInterrupt, + playbackInterruptMinDuration = _context$state$config.playbackInterruptMinDuration, + playbackInterruptVolumeThreshold = _context$state$config.playbackInterruptVolumeThreshold, + playbackInterruptLevelThreshold = _context$state$config.playbackInterruptLevelThreshold, + playbackInterruptNoiseThreshold = _context$state$config.playbackInterruptNoiseThreshold; + + var intervalTimeInMs = 200; + + if (!enablePlaybackInterrupt && !isSpeaking && context.state.lex.isInterrupting && audio.duration < playbackInterruptMinDuration) { + return; + } + + var intervalId = setInterval(function () { + var duration = audio.duration; + var end = audio.played.end(0); + var canInterrupt = context.state.botAudio.canInterrupt; + + + if (!canInterrupt && + // allow to be interrupt free in the beginning + end > playbackInterruptMinDuration && + // don't interrupt towards the end + duration - end > 0.5 && + // only interrupt if the volume seems to be low noise + recorder.volume.max < playbackInterruptNoiseThreshold) { + context.commit('setCanInterruptBotPlayback', true); + } else if (canInterrupt && duration - end < 0.5) { + context.commit('setCanInterruptBotPlayback', false); + } + + if (canInterrupt && recorder.volume.max > playbackInterruptVolumeThreshold && recorder.volume.slow > playbackInterruptLevelThreshold) { + clearInterval(intervalId); + context.commit('setIsBotPlaybackInterrupting', true); + setTimeout(function () { + audio.pause(); + }, 500); + } + }, intervalTimeInMs); + + context.commit('setBotPlaybackInterruptIntervalId', intervalId); + }, + + + /*********************************************************************** + * + * Recorder Actions + * + **********************************************************************/ + + startConversation: function startConversation(context) { + context.commit('setIsConversationGoing', true); + return context.dispatch('startRecording'); + }, + stopConversation: function stopConversation(context) { + context.commit('setIsConversationGoing', false); + }, + startRecording: function startRecording(context) { + // don't record if muted + if (context.state.recState.isMicMuted === true) { + console.warn('recording while muted'); + context.dispatch('stopConversation'); + return __WEBPACK_IMPORTED_MODULE_1_babel_runtime_core_js_promise___default.a.reject('The microphone seems to be muted.'); + } + + context.commit('startRecording', recorder); + return __WEBPACK_IMPORTED_MODULE_1_babel_runtime_core_js_promise___default.a.resolve(); + }, + stopRecording: function stopRecording(context) { + context.commit('stopRecording', recorder); + }, + getRecorderVolume: function getRecorderVolume(context) { + if (!context.state.recState.isRecorderEnabled) { + return __WEBPACK_IMPORTED_MODULE_1_babel_runtime_core_js_promise___default.a.resolve(); + } + return recorder.volume; + }, + + + /*********************************************************************** + * + * Lex and Polly Actions + * + **********************************************************************/ + + pollyGetBlob: function pollyGetBlob(context, text) { + var synthReq = pollyClient.synthesizeSpeech({ + Text: text, + VoiceId: context.state.polly.voiceId, + OutputFormat: context.state.polly.outputFormat + }); + return context.dispatch('getCredentials').then(function () { + return synthReq.promise(); + }).then(function (data) { + return __WEBPACK_IMPORTED_MODULE_1_babel_runtime_core_js_promise___default.a.resolve(new Blob([data.AudioStream], { type: data.ContentType })); + }); + }, + pollySynthesizeSpeech: function pollySynthesizeSpeech(context, text) { + return context.dispatch('pollyGetBlob', text).then(function (blob) { + return context.dispatch('getAudioUrl', blob); + }).then(function (audioUrl) { + return context.dispatch('playAudio', audioUrl); + }); + }, + interruptSpeechConversation: function interruptSpeechConversation(context) { + if (!context.state.recState.isConversationGoing) { + return __WEBPACK_IMPORTED_MODULE_1_babel_runtime_core_js_promise___default.a.resolve(); + } + + return new __WEBPACK_IMPORTED_MODULE_1_babel_runtime_core_js_promise___default.a(function (resolve, reject) { + context.dispatch('stopConversation').then(function () { + return context.dispatch('stopRecording'); + }).then(function () { + if (context.state.botAudio.isSpeaking) { + audio.pause(); + } + }).then(function () { + var count = 0; + var countMax = 20; + var intervalTimeInMs = 250; + context.commit('setIsLexInterrupting', true); + var intervalId = setInterval(function () { + if (!context.state.lex.isProcessing) { + clearInterval(intervalId); + context.commit('setIsLexInterrupting', false); + resolve(); + } + if (count > countMax) { + clearInterval(intervalId); + context.commit('setIsLexInterrupting', false); + reject('interrupt interval exceeded'); + } + count += 1; + }, intervalTimeInMs); + }); + }); + }, + postTextMessage: function postTextMessage(context, message) { + context.dispatch('interruptSpeechConversation').then(function () { + return context.dispatch('pushMessage', message); + }).then(function () { + return context.dispatch('lexPostText', message.text); + }).then(function (response) { + return context.dispatch('pushMessage', { + text: response.message, + type: 'bot', + dialogState: context.state.lex.dialogState, + responseCard: context.state.lex.responseCard + }); + }).then(function () { + if (context.state.lex.dialogState === 'Fulfilled') { + context.dispatch('reInitBot'); + } + }).catch(function (error) { + console.error('error in postTextMessage', error); + context.dispatch('pushErrorMessage', 'I was unable to process your message. ' + error); + }); + }, + lexPostText: function lexPostText(context, text) { + context.commit('setIsLexProcessing', true); + return context.dispatch('getCredentials').then(function () { + return lexClient.postText(text, context.state.lex.sessionAttributes); + }).then(function (data) { + context.commit('setIsLexProcessing', false); + return context.dispatch('updateLexState', data).then(function () { + return __WEBPACK_IMPORTED_MODULE_1_babel_runtime_core_js_promise___default.a.resolve(data); + }); + }); + }, + lexPostContent: function lexPostContent(context, audioBlob) { + var offset = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0; + + context.commit('setIsLexProcessing', true); + console.info('audio blob size:', audioBlob.size); + var timeStart = void 0; + + return context.dispatch('getCredentials').then(function () { + timeStart = performance.now(); + return lexClient.postContent(audioBlob, context.state.lex.sessionAttributes, context.state.lex.acceptFormat, offset); + }).then(function (lexResponse) { + var timeEnd = performance.now(); + console.info('lex postContent processing time:', ((timeEnd - timeStart) / 1000).toFixed(2)); + context.commit('setIsLexProcessing', false); + return context.dispatch('updateLexState', lexResponse).then(function () { + return context.dispatch('processLexContentResponse', lexResponse); + }).then(function (blob) { + return __WEBPACK_IMPORTED_MODULE_1_babel_runtime_core_js_promise___default.a.resolve(blob); + }); + }); + }, + processLexContentResponse: function processLexContentResponse(context, lexData) { + var audioStream = lexData.audioStream, + contentType = lexData.contentType, + dialogState = lexData.dialogState; + + + return __WEBPACK_IMPORTED_MODULE_1_babel_runtime_core_js_promise___default.a.resolve().then(function () { + if (!audioStream || !audioStream.length) { + var text = dialogState === 'ReadyForFulfillment' ? 'All done' : 'There was an error'; + return context.dispatch('pollyGetBlob', text); + } + + return __WEBPACK_IMPORTED_MODULE_1_babel_runtime_core_js_promise___default.a.resolve(new Blob([audioStream], { type: contentType })); + }); + }, + updateLexState: function updateLexState(context, lexState) { + var lexStateDefault = { + dialogState: '', + inputTranscript: '', + intentName: '', + message: '', + responseCard: null, + sessionAttributes: {}, + slotToElicit: '', + slots: {} + }; + // simulate response card in sessionAttributes + // used mainly for postContent which doesn't support response cards + if ('sessionAttributes' in lexState && 'appContext' in lexState.sessionAttributes) { + try { + var appContext = JSON.parse(lexState.sessionAttributes.appContext); + if ('responseCard' in appContext) { + lexStateDefault.responseCard = appContext.responseCard; + } + } catch (e) { + return __WEBPACK_IMPORTED_MODULE_1_babel_runtime_core_js_promise___default.a.reject('error parsing appContext in sessionAttributes'); + } + } + context.commit('updateLexState', __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, lexStateDefault, lexState)); + if (context.state.isRunningEmbedded) { + context.dispatch('sendMessageToParentWindow', { event: 'updateLexState', state: context.state.lex }); + } + return __WEBPACK_IMPORTED_MODULE_1_babel_runtime_core_js_promise___default.a.resolve(); + }, + + + /*********************************************************************** + * + * Message List Actions + * + **********************************************************************/ + + pushMessage: function pushMessage(context, message) { + context.commit('pushMessage', message); + }, + pushErrorMessage: function pushErrorMessage(context, text) { + var dialogState = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'Failed'; + + context.commit('pushMessage', { + type: 'bot', + text: text, + dialogState: dialogState + }); + }, + + + /*********************************************************************** + * + * Credentials Actions + * + **********************************************************************/ + + getCredentialsFromParent: function getCredentialsFromParent(context) { + var credsExpirationDate = new Date(awsCredentials && awsCredentials.expireTime ? awsCredentials.expireTime : 0); + var now = Date.now(); + if (credsExpirationDate > now) { + return __WEBPACK_IMPORTED_MODULE_1_babel_runtime_core_js_promise___default.a.resolve(awsCredentials); + } + return context.dispatch('sendMessageToParentWindow', { event: 'getCredentials' }).then(function (credsResponse) { + if (credsResponse.event === 'resolve' && credsResponse.type === 'getCredentials') { + return __WEBPACK_IMPORTED_MODULE_1_babel_runtime_core_js_promise___default.a.resolve(credsResponse.data); + } + return __WEBPACK_IMPORTED_MODULE_1_babel_runtime_core_js_promise___default.a.reject('invalid credential event from parent'); + }).then(function (creds) { + var _creds$data$Credentia = creds.data.Credentials, + AccessKeyId = _creds$data$Credentia.AccessKeyId, + SecretKey = _creds$data$Credentia.SecretKey, + SessionToken = _creds$data$Credentia.SessionToken; + + var IdentityId = creds.data.IdentityId; + // recreate as a static credential + awsCredentials = { + accessKeyId: AccessKeyId, + secretAccessKey: SecretKey, + sessionToken: SessionToken, + identityId: IdentityId, + getPromise: function getPromise() { + return __WEBPACK_IMPORTED_MODULE_1_babel_runtime_core_js_promise___default.a.resolve(); + } + }; + + return awsCredentials; + }); + }, + getCredentials: function getCredentials(context) { + if (context.state.awsCreds.provider === 'parentWindow') { + return context.dispatch('getCredentialsFromParent'); + } + return awsCredentials.getPromise().then(function () { + return awsCredentials; + }); + }, + + + /*********************************************************************** + * + * UI and Parent Communication Actions + * + **********************************************************************/ + + toggleIsUiMinimized: function toggleIsUiMinimized(context) { + context.commit('toggleIsUiMinimized'); + return context.dispatch('sendMessageToParentWindow', { event: 'toggleMinimizeUi' }); + }, + sendMessageToParentWindow: function sendMessageToParentWindow(context, message) { + if (!context.state.isRunningEmbedded) { + var error = 'sendMessage called when not running embedded'; + console.warn(error); + return __WEBPACK_IMPORTED_MODULE_1_babel_runtime_core_js_promise___default.a.reject(error); + } + + return new __WEBPACK_IMPORTED_MODULE_1_babel_runtime_core_js_promise___default.a(function (resolve, reject) { + var messageChannel = new MessageChannel(); + messageChannel.port1.onmessage = function (evt) { + messageChannel.port1.close(); + messageChannel.port2.close(); + if (evt.data.event === 'resolve') { + resolve(evt.data); + } else { + reject('error in sendMessageToParentWindow ' + evt.data.error); + } + }; + parent.postMessage(message, __WEBPACK_IMPORTED_MODULE_2__config__["a" /* config */].ui.parentOrigin, [messageChannel.port2]); + }); + } +}); + +/***/ }), +/* 157 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_toConsumableArray__ = __webpack_require__(158); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_toConsumableArray___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_toConsumableArray__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_core_js_promise__ = __webpack_require__(13); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_core_js_promise___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_babel_runtime_core_js_promise__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_babel_runtime_core_js_object_assign__ = __webpack_require__(44); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_babel_runtime_core_js_object_assign___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_babel_runtime_core_js_object_assign__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_classCallCheck__ = __webpack_require__(38); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_classCallCheck___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_classCallCheck__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_createClass__ = __webpack_require__(59); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_createClass___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_createClass__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__wav_worker__ = __webpack_require__(163); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__wav_worker___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5__wav_worker__); + + + + + +/* + Copyright 2017-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. + + Licensed under the Amazon Software License (the "License"). You may not use this file + except in compliance with the License. A copy of the License is located at + + http://aws.amazon.com/asl/ + + or in the "license" file accompanying this file. This file is distributed on an "AS IS" + BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, express or implied. See the + License for the specific language governing permissions and limitations under the License. + */ + +/* eslint no-console: ["error", { allow: ["info", "warn", "error"] }] */ +/* global AudioContext CustomEvent document Event navigator window */ + +// XXX do we need webrtc-adapter? +// XXX npm uninstall it after testing +// XXX import 'webrtc-adapter'; + +// wav encoder worker - uses webpack worker loader + + +/** + * Lex Recorder Module + * Based on Recorderjs. It sort of mimics the MediaRecorder API. + * @see {@link https://github.com/mattdiamond/Recorderjs} + * @see {@https://github.com/chris-rudmin/Recorderjs} + * @see {@https://developer.mozilla.org/en-US/docs/Web/API/MediaRecorder} + */ + +/** + * Class for Lex audio recording management. + * + * This class is used for microphone initialization and recording + * management. It encodes the mic input into wav format. + * It also monitors the audio input stream (e.g keeping track of volume) + * filtered around human voice speech frequencies to look for silence + */ + +var _class = function () { + /* eslint no-underscore-dangle: ["error", { "allowAfterThis": true }] */ + + /** + * Constructs the recorder object + * + * @param {object} - options object + * + * @param {string} options.mimeType - Mime type to use on recording. + * Only 'audio/wav' is supported for now. Default: 'aduio/wav'. + * + * @param {boolean} options.autoStopRecording - Controls if the recording + * should automatically stop on silence detection. Default: true. + * + * @param {number} options.recordingTimeMax - Maximum recording time in + * seconds. Recording will stop after going for this long. Default: 8. + * + * @param {number} options.recordingTimeMin - Minimum recording time in + * seconds. Used before evaluating if the line is quiet to allow initial + * pauses before speech. Default: 2. + * + * @param {boolean} options.recordingTimeMinAutoIncrease - Controls if the + * recordingTimeMin should be automatically increased (exponentially) + * based on the number of consecutive silent recordings. + * Default: true. + * + * @param {number} options.quietThreshold - Threshold of mic input level + * to consider quiet. Used to determine pauses in input this is measured + * using the "slow" mic volume. Default: 0.001. + * + * @param {number} options.quietTimeMin - Minimum mic quiet time (normally in + * fractions of a second) before automatically stopping the recording when + * autoStopRecording is true. In reality it takes a bit more time than this + * value given that the slow volume value is a decay. Reasonable times seem + * to be between 0.2 and 0.5. Default: 0.4. + * + * @param {number} options.volumeThreshold - Threshold of mic db level + * to consider quiet. Used to determine pauses in input this is measured + * using the "max" mic volume. Smaller values make the recorder auto stop + * faster. Default: -75 + * + * @param {bool} options.useBandPass - Controls if a band pass filter is used + * for the microphone input. If true, the input is passed through a second + * order bandpass filter using AudioContext.createBiquadFilter: + * https://developer.mozilla.org/en-US/docs/Web/API/AudioContext/createBiquadFilter + * The bandpass filter helps to reduce noise, improve silence detection and + * produce smaller audio blobs. However, it may produce audio with lower + * fidelity. Default: true + * + * @param {number} options.bandPassFrequency - Frequency of bandpass filter in + * Hz. Mic input is passed through a second order bandpass filter to remove + * noise and improve quality/speech silence detection. Reasonable values + * should be around 3000 - 5000. Default: 4000. + * + * @param {number} options.bandPassQ - Q factor of bandpass filter. + * The higher the vaue, the narrower the pass band and steeper roll off. + * Reasonable values should be between 0.5 and 1.5. Default: 0.707 + * + * @param {number} options.bufferLength - Length of buffer used in audio + * processor. Should be in powers of two between 512 to 8196. Passed to + * script processor and audio encoder. Lower values have lower latency. + * Default: 2048. + * + * @param {number} options.numChannels- Number of channels to record. + * Default: 1 (mono). + * + * @param {number} options.requestEchoCancellation - Request to use echo + * cancellation in the getUserMedia call: + * https://developer.mozilla.org/en-US/docs/Web/API/MediaTrackConstraints/echoCancellation + * Default: true. + * + * @param {bool} options.useAutoMuteDetect - Controls if the recorder utilizes + * automatic mute detection. + * Default: true. + * + * @param {number} options.muteThreshold - Threshold level when mute values + * are detected when useAutoMuteDetect is enabled. The higher the faster + * it reports the mic to be in a muted state but may cause it to flap + * between mute/unmute. The lower the values the slower it is to report + * the mic as mute. Too low of a value may cause it to never report the + * line as muted. Works in conjuction with options.quietTreshold. + * Reasonable values seem to be between: 1e-5 and 1e-8. Default: 1e-7. + * + * @param {bool} options.encoderUseTrim - Controls if the encoder should + * attempt to trim quiet samples from the beginning and end of the buffer + * Default: true. + * + * @param {number} options.encoderQuietTrimThreshold - Threshold when quiet + * levels are detected. Only applicable when encoderUseTrim is enabled. The + * encoder will trim samples below this value at the beginnig and end of the + * buffer. Lower value trim less silence resulting in larger WAV files. + * Reasonable values seem to be between 0.005 and 0.0005. Default: 0.0008. + * + * @param {number} options.encoderQuietTrimSlackBack - How many samples to + * add back to the encoded buffer before/after the + * encoderQuietTrimThreshold. Higher values trim less silence resulting in + * larger WAV files. + * Reasonable values seem to be between 3500 and 5000. Default: 4000. + */ + function _class() { + var _this = this; + + var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + + __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_classCallCheck___default()(this, _class); + + this.initOptions(options); + + // event handler used for events similar to MediaRecorder API (e.g. onmute) + this._eventTarget = document.createDocumentFragment(); + + // encoder worker + this._encoderWorker = new __WEBPACK_IMPORTED_MODULE_5__wav_worker___default.a(); + + // worker uses this event listener to signal back + // when wav has finished encoding + this._encoderWorker.addEventListener('message', function (evt) { + return _this._exportWav(evt.data); + }); + } + + /** + * Initialize general recorder options + * + * @param {object} options - object with various options controlling the + * recorder behavior. See the constructor for details. + */ + + + __WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_createClass___default()(_class, [{ + key: 'initOptions', + value: function initOptions() { + var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + + // TODO break this into functions, avoid side-effects, break into this.options.* + if (options.preset) { + __WEBPACK_IMPORTED_MODULE_2_babel_runtime_core_js_object_assign___default()(options, this._getPresetOptions(options.preset)); + } + + this.mimeType = options.mimeType || 'audio/wav'; + + this.recordingTimeMax = options.recordingTimeMax || 8; + this.recordingTimeMin = options.recordingTimeMin || 2; + this.recordingTimeMinAutoIncrease = typeof options.recordingTimeMinAutoIncrease !== 'undefined' ? !!options.recordingTimeMinAutoIncrease : true; + + // speech detection configuration + this.autoStopRecording = typeof options.autoStopRecording !== 'undefined' ? !!options.autoStopRecording : true; + this.quietThreshold = options.quietThreshold || 0.001; + this.quietTimeMin = options.quietTimeMin || 0.4; + this.volumeThreshold = options.volumeThreshold || -75; + + // band pass configuration + this.useBandPass = typeof options.useBandPass !== 'undefined' ? !!options.useBandPass : true; + // https://developer.mozilla.org/en-US/docs/Web/API/BiquadFilterNode + this.bandPassFrequency = options.bandPassFrequency || 4000; + // Butterworth 0.707 [sqrt(1/2)] | Chebyshev < 1.414 + this.bandPassQ = options.bandPassQ || 0.707; + + // parameters passed to script processor and also used in encoder + // https://developer.mozilla.org/en-US/docs/Web/API/AudioContext/createScriptProcessor + this.bufferLength = options.bufferLength || 2048; + this.numChannels = options.numChannels || 1; + + this.requestEchoCancellation = typeof options.requestEchoCancellation !== 'undefined' ? !!options.requestEchoCancellation : true; + + // automatic mute detection options + this.useAutoMuteDetect = typeof options.useAutoMuteDetect !== 'undefined' ? !!options.useAutoMuteDetect : true; + this.muteThreshold = options.muteThreshold || 1e-7; + + // encoder options + this.encoderUseTrim = typeof options.encoderUseTrim !== 'undefined' ? !!options.encoderUseTrim : true; + this.encoderQuietTrimThreshold = options.encoderQuietTrimThreshold || 0.0008; + this.encoderQuietTrimSlackBack = options.encoderQuietTrimSlackBack || 4000; + } + }, { + key: '_getPresetOptions', + value: function _getPresetOptions() { + var preset = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'low_latency'; + + this._presets = ['low_latency', 'speech_recognition']; + + if (this._presets.indexOf(preset) === -1) { + console.error('invalid preset'); + return {}; + } + + var presets = { + low_latency: { + encoderUseTrim: true, + useBandPass: true + }, + speech_recognition: { + encoderUseTrim: false, + useBandPass: false, + useAutoMuteDetect: false + } + }; + + return presets[preset]; + } + + /** + * General init. This function should be called to initialize the recorder. + * + * @param {object} options - Optional parameter to reinitialize the + * recorder behavior. See the constructor for details. + * + * @return {Promise} - Returns a promise that resolves when the recorder is + * ready. + */ + + }, { + key: 'init', + value: function init() { + var _this2 = this; + + this._state = 'inactive'; + + this._instant = 0.0; + this._slow = 0.0; + this._clip = 0.0; + this._maxVolume = -Infinity; + + this._isMicQuiet = true; + this._isMicMuted = false; + + this._isSilentRecording = true; + this._silentRecordingConsecutiveCount = 0; + + // sets this._audioContext AudioContext object + return this._initAudioContext().then(function () { + return ( + // inits AudioContext.createScriptProcessor object + // used to process mic audio input volume + // sets this._micVolumeProcessor + _this2._initMicVolumeProcessor() + ); + }).then(function () { + return _this2._initStream(); + }); + } + + /** + * Start recording + */ + + }, { + key: 'start', + value: function start() { + if (this._state !== 'inactive' || typeof this._stream === 'undefined') { + console.warn('recorder start called out of state'); + return; + } + + this._state = 'recording'; + + this._recordingStartTime = this._audioContext.currentTime; + this._eventTarget.dispatchEvent(new Event('start')); + + this._encoderWorker.postMessage({ + command: 'init', + config: { + sampleRate: this._audioContext.sampleRate, + numChannels: this.numChannels, + useTrim: this.encoderUseTrim, + quietTrimThreshold: this.encoderQuietTrimThreshold, + quietTrimSlackBack: this.encoderQuietTrimSlackBack + } + }); + } + + /** + * Stop recording + */ + + }, { + key: 'stop', + value: function stop() { + if (this._state !== 'recording') { + console.warn('recorder stop called out of state'); + return; + } + + if (this._recordingStartTime > this._quietStartTime) { + this._isSilentRecording = true; + this._silentRecordingConsecutiveCount += 1; + this._eventTarget.dispatchEvent(new Event('silentrecording')); + } else { + this._isSilentRecording = false; + this._silentRecordingConsecutiveCount = 0; + this._eventTarget.dispatchEvent(new Event('unsilentrecording')); + } + + this._state = 'inactive'; + this._recordingStartTime = 0; + + this._encoderWorker.postMessage({ + command: 'exportWav', + type: 'audio/wav' + }); + + this._eventTarget.dispatchEvent(new Event('stop')); + } + }, { + key: '_exportWav', + value: function _exportWav(evt) { + this._eventTarget.dispatchEvent(new CustomEvent('dataavailable', { detail: evt.data })); + this._encoderWorker.postMessage({ command: 'clear' }); + } + }, { + key: '_recordBuffers', + value: function _recordBuffers(inputBuffer) { + if (this._state !== 'recording') { + console.warn('recorder _recordBuffers called out of state'); + return; + } + var buffer = []; + for (var i = 0; i < inputBuffer.numberOfChannels; i++) { + buffer[i] = inputBuffer.getChannelData(i); + } + + this._encoderWorker.postMessage({ + command: 'record', + buffer: buffer + }); + } + }, { + key: '_setIsMicMuted', + value: function _setIsMicMuted() { + if (!this.useAutoMuteDetect) { + return; + } + // TODO incorporate _maxVolume + if (this._instant >= this.muteThreshold) { + if (this._isMicMuted) { + this._isMicMuted = false; + this._eventTarget.dispatchEvent(new Event('unmute')); + } + return; + } + + if (!this._isMicMuted && this._slow < this.muteThreshold) { + this._isMicMuted = true; + this._eventTarget.dispatchEvent(new Event('mute')); + console.info('mute - instant: %s - slow: %s - track muted: %s', this._instant, this._slow, this._tracks[0].muted); + + if (this._state === 'recording') { + this.stop(); + console.info('stopped recording on _setIsMicMuted'); + } + } + } + }, { + key: '_setIsMicQuiet', + value: function _setIsMicQuiet() { + var now = this._audioContext.currentTime; + + var isMicQuiet = this._maxVolume < this.volumeThreshold || this._slow < this.quietThreshold; + + // start record the time when the line goes quiet + // fire event + if (!this._isMicQuiet && isMicQuiet) { + this._quietStartTime = this._audioContext.currentTime; + this._eventTarget.dispatchEvent(new Event('quiet')); + } + // reset quiet timer when there's enough sound + if (this._isMicQuiet && !isMicQuiet) { + this._quietStartTime = 0; + this._eventTarget.dispatchEvent(new Event('unquiet')); + } + this._isMicQuiet = isMicQuiet; + + // if autoincrease is enabled, exponentially increase the mimimun recording + // time based on consecutive silent recordings + var recordingTimeMin = this.recordingTimeMinAutoIncrease ? this.recordingTimeMin - 1 + Math.pow(this.recordingTimeMax, 1 - 1 / (this._silentRecordingConsecutiveCount + 1)) : this.recordingTimeMin; + + // detect voice pause and stop recording + if (this.autoStopRecording && this._isMicQuiet && this._state === 'recording' && + // have I been recording longer than the minimum recording time? + now - this._recordingStartTime > recordingTimeMin && + // has the slow sample value been below the quiet threshold longer than + // the minimum allowed quiet time? + now - this._quietStartTime > this.quietTimeMin) { + this.stop(); + } + } + + /** + * Initializes the AudioContext + * Aassigs it to this._audioContext. Adds visibitily change event listener + * to suspend the audio context when the browser tab is hidden. + * @return {Promise} resolution of AudioContext + */ + + }, { + key: '_initAudioContext', + value: function _initAudioContext() { + var _this3 = this; + + window.AudioContext = window.AudioContext || window.webkitAudioContext; + if (!window.AudioContext) { + return __WEBPACK_IMPORTED_MODULE_1_babel_runtime_core_js_promise___default.a.reject('Web Audio API not supported.'); + } + this._audioContext = new AudioContext(); + document.addEventListener('visibilitychange', function () { + console.info('visibility change triggered in recorder. hidden:', document.hidden); + if (document.hidden) { + _this3._audioContext.suspend(); + } else { + _this3._audioContext.resume(); + } + }); + return __WEBPACK_IMPORTED_MODULE_1_babel_runtime_core_js_promise___default.a.resolve(); + } + + /** + * Private initializer of the audio buffer processor + * It manages the volume variables and sends the buffers to the worker + * when recording. + * Some of this came from: + * https://webrtc.github.io/samples/src/content/getusermedia/volume/js/soundmeter.js + */ + + }, { + key: '_initMicVolumeProcessor', + value: function _initMicVolumeProcessor() { + var _this4 = this; + + /* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */ + // assumes a single channel - XXX does it need to handle 2 channels? + var processor = this._audioContext.createScriptProcessor(this.bufferLength, this.numChannels, this.numChannels); + processor.onaudioprocess = function (evt) { + if (_this4._state === 'recording') { + // send buffers to worker + _this4._recordBuffers(evt.inputBuffer); + + // stop recording if over the maximum time + if (_this4._audioContext.currentTime - _this4._recordingStartTime > _this4.recordingTimeMax) { + console.warn('stopped recording due to maximum time'); + _this4.stop(); + } + } + + // XXX assumes mono channel + var input = evt.inputBuffer.getChannelData(0); + var sum = 0.0; + var clipCount = 0; + for (var i = 0; i < input.length; ++i) { + // square to calculate signal power + sum += input[i] * input[i]; + if (Math.abs(input[i]) > 0.99) { + clipCount += 1; + } + } + _this4._instant = Math.sqrt(sum / input.length); + _this4._slow = 0.95 * _this4._slow + 0.05 * _this4._instant; + _this4._clip = input.length ? clipCount / input.length : 0; + + _this4._setIsMicMuted(); + _this4._setIsMicQuiet(); + + _this4._analyser.getFloatFrequencyData(_this4._analyserData); + _this4._maxVolume = Math.max.apply(Math, __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_toConsumableArray___default()(_this4._analyserData)); + }; + + this._micVolumeProcessor = processor; + return __WEBPACK_IMPORTED_MODULE_1_babel_runtime_core_js_promise___default.a.resolve(); + } + + /* + * Private initializers + */ + + /** + * Sets microphone using getUserMedia + * @return {Promise} returns a promise that resolves when the audio input + * has been connected + */ + + }, { + key: '_initStream', + value: function _initStream() { + var _this5 = this; + + // TODO obtain with navigator.mediaDevices.getSupportedConstraints() + var constraints = { + audio: { + optional: [{ + echoCancellation: this.requestEchoCancellation + }] + } + }; + + return navigator.mediaDevices.getUserMedia(constraints).then(function (stream) { + _this5._stream = stream; + + _this5._tracks = stream.getAudioTracks(); + console.info('using media stream track labeled: ', _this5._tracks[0].label); + // assumes single channel + _this5._tracks[0].onmute = _this5._setIsMicMuted; + _this5._tracks[0].onunmute = _this5._setIsMicMuted; + + var source = _this5._audioContext.createMediaStreamSource(stream); + var gainNode = _this5._audioContext.createGain(); + var analyser = _this5._audioContext.createAnalyser(); + + if (_this5.useBandPass) { + // bandpass filter around human voice + // https://developer.mozilla.org/en-US/docs/Web/API/BiquadFilterNode + var biquadFilter = _this5._audioContext.createBiquadFilter(); + biquadFilter.type = 'bandpass'; + + biquadFilter.frequency.value = _this5.bandPassFrequency; + biquadFilter.gain.Q = _this5.bandPassQ; + + source.connect(biquadFilter); + biquadFilter.connect(gainNode); + analyser.smoothingTimeConstant = 0.5; + } else { + source.connect(gainNode); + analyser.smoothingTimeConstant = 0.9; + } + analyser.fftSize = _this5.bufferLength; + analyser.minDecibels = -90; + analyser.maxDecibels = -30; + + gainNode.connect(analyser); + analyser.connect(_this5._micVolumeProcessor); + _this5._analyserData = new Float32Array(analyser.frequencyBinCount); + _this5._analyser = analyser; + + _this5._micVolumeProcessor.connect(_this5._audioContext.destination); + + _this5._eventTarget.dispatchEvent(new Event('streamReady')); + }); + } + + /* + * getters used to expose internal vars while avoiding issues when using with + * a reactive store (e.g. vuex). + */ + + /** + * Getter of recorder state. Based on MediaRecorder API. + * @return {string} state of recorder (inactive | recording | paused) + */ + + }, { + key: 'state', + get: function get() { + return this._state; + } + + /** + * Getter of stream object. Based on MediaRecorder API. + * @return {MediaStream} media stream object obtain from getUserMedia + */ + + }, { + key: 'stream', + get: function get() { + return this._stream; + } + }, { + key: 'isMicQuiet', + get: function get() { + return this._isMicQuiet; + } + }, { + key: 'isMicMuted', + get: function get() { + return this._isMicMuted; + } + }, { + key: 'isSilentRecording', + get: function get() { + return this._isSilentRecording; + } + }, { + key: 'isRecording', + get: function get() { + return this._state === 'recording'; + } + + /** + * Getter of mic volume levels. + * instant: root mean square of levels in buffer + * slow: time decaying level + * clip: count of samples at the top of signals (high noise) + */ + + }, { + key: 'volume', + get: function get() { + return { + instant: this._instant, + slow: this._slow, + clip: this._clip, + max: this._maxVolume + }; + } + + /* + * Private initializer of event target + * Set event handlers that mimic MediaRecorder events plus others + */ + + // TODO make setters replace the listener insted of adding + + }, { + key: 'onstart', + set: function set(cb) { + this._eventTarget.addEventListener('start', cb); + } + }, { + key: 'onstop', + set: function set(cb) { + this._eventTarget.addEventListener('stop', cb); + } + }, { + key: 'ondataavailable', + set: function set(cb) { + this._eventTarget.addEventListener('dataavailable', cb); + } + }, { + key: 'onerror', + set: function set(cb) { + this._eventTarget.addEventListener('error', cb); + } + }, { + key: 'onstreamready', + set: function set(cb) { + this._eventTarget.addEventListener('streamready', cb); + } + }, { + key: 'onmute', + set: function set(cb) { + this._eventTarget.addEventListener('mute', cb); + } + }, { + key: 'onunmute', + set: function set(cb) { + this._eventTarget.addEventListener('unmute', cb); + } + }, { + key: 'onsilentrecording', + set: function set(cb) { + this._eventTarget.addEventListener('silentrecording', cb); + } + }, { + key: 'onunsilentrecording', + set: function set(cb) { + this._eventTarget.addEventListener('unsilentrecording', cb); + } + }, { + key: 'onquiet', + set: function set(cb) { + this._eventTarget.addEventListener('quiet', cb); + } + }, { + key: 'onunquiet', + set: function set(cb) { + this._eventTarget.addEventListener('unquiet', cb); + } + }]); + + return _class; +}(); + +/* harmony default export */ __webpack_exports__["a"] = (_class); + +/***/ }), +/* 158 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +exports.__esModule = true; + +var _from = __webpack_require__(159); + +var _from2 = _interopRequireDefault(_from); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +exports.default = function (arr) { + if (Array.isArray(arr)) { + for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { + arr2[i] = arr[i]; + } + + return arr2; + } else { + return (0, _from2.default)(arr); + } +}; + +/***/ }), +/* 159 */ +/***/ (function(module, exports, __webpack_require__) { + +module.exports = { "default": __webpack_require__(160), __esModule: true }; + +/***/ }), +/* 160 */ +/***/ (function(module, exports, __webpack_require__) { + +__webpack_require__(19); +__webpack_require__(161); +module.exports = __webpack_require__(0).Array.from; + +/***/ }), +/* 161 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var ctx = __webpack_require__(15) + , $export = __webpack_require__(7) + , toObject = __webpack_require__(23) + , call = __webpack_require__(53) + , isArrayIter = __webpack_require__(54) + , toLength = __webpack_require__(32) + , createProperty = __webpack_require__(162) + , getIterFn = __webpack_require__(41); + +$export($export.S + $export.F * !__webpack_require__(56)(function(iter){ Array.from(iter); }), 'Array', { + // 22.1.2.1 Array.from(arrayLike, mapfn = undefined, thisArg = undefined) + from: function from(arrayLike/*, mapfn = undefined, thisArg = undefined*/){ + var O = toObject(arrayLike) + , C = typeof this == 'function' ? this : Array + , aLen = arguments.length + , mapfn = aLen > 1 ? arguments[1] : undefined + , mapping = mapfn !== undefined + , index = 0 + , iterFn = getIterFn(O) + , length, result, step, iterator; + if(mapping)mapfn = ctx(mapfn, aLen > 2 ? arguments[2] : undefined, 2); + // if object isn't iterable or it's array with default iterator - use simple case + if(iterFn != undefined && !(C == Array && isArrayIter(iterFn))){ + for(iterator = iterFn.call(O), result = new C; !(step = iterator.next()).done; index++){ + createProperty(result, index, mapping ? call(iterator, mapfn, [step.value, index], true) : step.value); + } + } else { + length = toLength(O.length); + for(result = new C(length); length > index; index++){ + createProperty(result, index, mapping ? mapfn(O[index], index) : O[index]); + } + } + result.length = index; + return result; + } +}); + + +/***/ }), +/* 162 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $defineProperty = __webpack_require__(3) + , createDesc = __webpack_require__(17); + +module.exports = function(object, index, value){ + if(index in object)$defineProperty.f(object, index, createDesc(0, value)); + else object[index] = value; +}; + +/***/ }), +/* 163 */ +/***/ (function(module, exports, __webpack_require__) { + +module.exports = function () { + return __webpack_require__(164)("/******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId]) {\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/ \t\t}\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\ti: moduleId,\n/******/ \t\t\tl: false,\n/******/ \t\t\texports: {}\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.l = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// define getter function for harmony exports\n/******/ \t__webpack_require__.d = function(exports, name, getter) {\n/******/ \t\tif(!__webpack_require__.o(exports, name)) {\n/******/ \t\t\tObject.defineProperty(exports, name, {\n/******/ \t\t\t\tconfigurable: false,\n/******/ \t\t\t\tenumerable: true,\n/******/ \t\t\t\tget: getter\n/******/ \t\t\t});\n/******/ \t\t}\n/******/ \t};\n/******/\n/******/ \t// getDefaultExport function for compatibility with non-harmony modules\n/******/ \t__webpack_require__.n = function(module) {\n/******/ \t\tvar getter = module && module.__esModule ?\n/******/ \t\t\tfunction getDefault() { return module['default']; } :\n/******/ \t\t\tfunction getModuleExports() { return module; };\n/******/ \t\t__webpack_require__.d(getter, 'a', getter);\n/******/ \t\treturn getter;\n/******/ \t};\n/******/\n/******/ \t// Object.prototype.hasOwnProperty.call\n/******/ \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"/\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(__webpack_require__.s = 0);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ (function(module, exports) {\n\n// based on https://github.com/mattdiamond/Recorderjs/blob/master/src/recorder.js\n// with a few optimizations including downsampling and trimming quiet samples\n\n/* global Blob self */\n/* eslint prefer-arrow-callback: [\"error\", { \"allowNamedFunctions\": true }] */\n/* eslint no-param-reassign: [\"error\", { \"props\": false }] */\n/* eslint no-use-before-define: [\"error\", { \"functions\": false }] */\n/* eslint no-plusplus: off */\n/* eslint comma-dangle: [\"error\", {\"functions\": \"never\", \"objects\": \"always-multiline\"}] */\nconst bitDepth = 16;\nconst bytesPerSample = bitDepth / 8;\nconst outSampleRate = 16000;\nconst outNumChannels = 1;\n\nlet recLength = 0;\nlet recBuffers = [];\n\nconst options = {\n sampleRate: 44000,\n numChannels: 1,\n useDownsample: true,\n // controls if the encoder will trim silent samples at begining and end of buffer\n useTrim: true,\n // trim samples below this value at the beginnig and end of the buffer\n // lower the value trim less silence (larger file size)\n // reasonable values seem to be between 0.005 and 0.0005\n quietTrimThreshold: 0.0008,\n // how many samples to add back to the buffer before/after the quiet threshold\n // higher values result in less silence trimming (larger file size)\n // reasonable values seem to be between 3500 and 5000\n quietTrimSlackBack: 4000,\n};\n\nself.onmessage = (evt) => {\n switch (evt.data.command) {\n case 'init':\n init(evt.data.config);\n break;\n case 'record':\n record(evt.data.buffer);\n break;\n case 'exportWav':\n exportWAV(evt.data.type);\n break;\n case 'getBuffer':\n getBuffer();\n break;\n case 'clear':\n clear();\n break;\n case 'close':\n self.close();\n break;\n default:\n break;\n }\n};\n\nfunction init(config) {\n Object.assign(options, config);\n initBuffers();\n}\n\nfunction record(inputBuffer) {\n for (let channel = 0; channel < options.numChannels; channel++) {\n recBuffers[channel].push(inputBuffer[channel]);\n }\n recLength += inputBuffer[0].length;\n}\n\nfunction exportWAV(type) {\n const buffers = [];\n for (let channel = 0; channel < options.numChannels; channel++) {\n buffers.push(mergeBuffers(recBuffers[channel], recLength));\n }\n let interleaved;\n if (options.numChannels === 2 && outNumChannels === 2) {\n interleaved = interleave(buffers[0], buffers[1]);\n } else {\n interleaved = buffers[0];\n }\n const downsampledBuffer = downsampleTrimBuffer(interleaved, outSampleRate);\n const dataview = encodeWAV(downsampledBuffer);\n const audioBlob = new Blob([dataview], { type });\n\n self.postMessage({\n command: 'exportWAV',\n data: audioBlob,\n });\n}\n\nfunction getBuffer() {\n const buffers = [];\n for (let channel = 0; channel < options.numChannels; channel++) {\n buffers.push(mergeBuffers(recBuffers[channel], recLength));\n }\n self.postMessage({ command: 'getBuffer', data: buffers });\n}\n\nfunction clear() {\n recLength = 0;\n recBuffers = [];\n initBuffers();\n}\n\nfunction initBuffers() {\n for (let channel = 0; channel < options.numChannels; channel++) {\n recBuffers[channel] = [];\n }\n}\n\nfunction mergeBuffers(recBuffer, length) {\n const result = new Float32Array(length);\n let offset = 0;\n for (let i = 0; i < recBuffer.length; i++) {\n result.set(recBuffer[i], offset);\n offset += recBuffer[i].length;\n }\n return result;\n}\n\nfunction interleave(inputL, inputR) {\n const length = inputL.length + inputR.length;\n const result = new Float32Array(length);\n\n let index = 0;\n let inputIndex = 0;\n\n while (index < length) {\n result[index++] = inputL[inputIndex];\n result[index++] = inputR[inputIndex];\n inputIndex++;\n }\n return result;\n}\n\nfunction floatTo16BitPCM(output, offset, input) {\n for (let i = 0, o = offset; i < input.length; i++, o += 2) {\n const s = Math.max(-1, Math.min(1, input[i]));\n output.setInt16(o, s < 0 ? s * 0x8000 : s * 0x7FFF, true);\n }\n}\n\n// Lex doesn't require proper wav header\n// still inserting wav header for playing on client side\nfunction addHeader(view, length) {\n // RIFF identifier 'RIFF'\n view.setUint32(0, 1380533830, false);\n // file length minus RIFF identifier length and file description length\n view.setUint32(4, 36 + length, true);\n // RIFF type 'WAVE'\n view.setUint32(8, 1463899717, false);\n // format chunk identifier 'fmt '\n view.setUint32(12, 1718449184, false);\n // format chunk length\n view.setUint32(16, 16, true);\n // sample format (raw)\n view.setUint16(20, 1, true);\n // channel count\n view.setUint16(22, outNumChannels, true);\n // sample rate\n view.setUint32(24, outSampleRate, true);\n // byte rate (sample rate * block align)\n view.setUint32(28, outSampleRate * bytesPerSample * outNumChannels, true);\n // block align (channel count * bytes per sample)\n view.setUint16(32, bytesPerSample * outNumChannels, true);\n // bits per sample\n view.setUint16(34, bitDepth, true);\n // data chunk identifier 'data'\n view.setUint32(36, 1684108385, false);\n}\n\nfunction encodeWAV(samples) {\n const buffer = new ArrayBuffer(44 + (samples.length * 2));\n const view = new DataView(buffer);\n\n addHeader(view, samples.length);\n floatTo16BitPCM(view, 44, samples);\n\n return view;\n}\n\nfunction downsampleTrimBuffer(buffer, rate) {\n if (rate === options.sampleRate) {\n return buffer;\n }\n\n const length = buffer.length;\n const sampleRateRatio = options.sampleRate / rate;\n const newLength = Math.round(length / sampleRateRatio);\n\n const result = new Float32Array(newLength);\n let offsetResult = 0;\n let offsetBuffer = 0;\n let firstNonQuiet = 0;\n let lastNonQuiet = length;\n while (offsetResult < result.length) {\n const nextOffsetBuffer = Math.round((offsetResult + 1) * sampleRateRatio);\n let accum = 0;\n let count = 0;\n for (let i = offsetBuffer; (i < nextOffsetBuffer) && (i < length); i++) {\n accum += buffer[i];\n count++;\n }\n // mark first and last sample over the quiet threshold\n if (accum > options.quietTrimThreshold) {\n if (firstNonQuiet === 0) {\n firstNonQuiet = offsetResult;\n }\n lastNonQuiet = offsetResult;\n }\n result[offsetResult] = accum / count;\n offsetResult++;\n offsetBuffer = nextOffsetBuffer;\n }\n\n /*\n console.info('encoder trim size reduction',\n (Math.min(newLength, lastNonQuiet + options.quietTrimSlackBack) -\n Math.max(0, firstNonQuiet - options.quietTrimSlackBack)) / result.length\n );\n */\n return (options.useTrim) ?\n // slice based on quiet threshold and put slack back into the buffer\n result.slice(\n Math.max(0, firstNonQuiet - options.quietTrimSlackBack),\n Math.min(newLength, lastNonQuiet + options.quietTrimSlackBack)\n ) :\n result;\n}\n\n\n/***/ })\n/******/ ]);\n//# sourceMappingURL=wav-worker.js.map", __webpack_require__.p + "bundle/wav-worker.js"); +}; + +/***/ }), +/* 164 */ +/***/ (function(module, exports) { + +// http://stackoverflow.com/questions/10343913/how-to-create-a-web-worker-from-a-string + +var URL = window.URL || window.webkitURL; +module.exports = function(content, url) { + try { + try { + var blob; + try { // BlobBuilder = Deprecated, but widely implemented + var BlobBuilder = window.BlobBuilder || window.WebKitBlobBuilder || window.MozBlobBuilder || window.MSBlobBuilder; + blob = new BlobBuilder(); + blob.append(content); + blob = blob.getBlob(); + } catch(e) { // The proposed API + blob = new Blob([content]); + } + return new Worker(URL.createObjectURL(blob)); + } catch(e) { + return new Worker('data:application/javascript,' + encodeURIComponent(content)); + } + } catch(e) { + if (!url) { + throw Error('Inline worker is not supported'); + } + return new Worker(url); + } +} + + +/***/ }), +/* 165 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_slicedToArray__ = __webpack_require__(57); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_slicedToArray___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_slicedToArray__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_core_js_promise__ = __webpack_require__(13); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_core_js_promise___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_babel_runtime_core_js_promise__); + + +/* + Copyright 2017-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. + + Licensed under the Amazon Software License (the "License"). You may not use this file + except in compliance with the License. A copy of the License is located at + + http://aws.amazon.com/asl/ + + or in the "license" file accompanying this file. This file is distributed on an "AS IS" + BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, express or implied. See the + License for the specific language governing permissions and limitations under the License. + */ + +/** + * Vuex store recorder handlers + */ + +/* eslint no-console: ["error", { allow: ["info", "warn", "error", "time", "timeEnd"] }] */ +/* eslint no-param-reassign: ["error", { "props": false }] */ + +var initRecorderHandlers = function initRecorderHandlers(context, recorder) { + /* global Blob */ + + recorder.onstart = function () { + console.info('recorder start event triggered'); + console.time('recording time'); + }; + recorder.onstop = function () { + context.dispatch('stopRecording'); + console.timeEnd('recording time'); + console.time('recording processing time'); + console.info('recorder stop event triggered'); + }; + recorder.onsilentrecording = function () { + console.info('recorder silent recording triggered'); + context.commit('increaseSilentRecordingCount'); + }; + recorder.onunsilentrecording = function () { + if (context.state.recState.silentRecordingCount > 0) { + context.commit('resetSilentRecordingCount'); + } + }; + recorder.onerror = function (e) { + console.error('recorder onerror event triggered', e); + }; + recorder.onstreamready = function () { + console.info('recorder stream ready event triggered'); + }; + recorder.onmute = function () { + console.info('recorder mute event triggered'); + context.commit('setIsMicMuted', true); + }; + recorder.onunmute = function () { + console.info('recorder unmute event triggered'); + context.commit('setIsMicMuted', false); + }; + recorder.onquiet = function () { + console.info('recorder quiet event triggered'); + context.commit('setIsMicQuiet', true); + }; + recorder.onunquiet = function () { + console.info('recorder unquiet event triggered'); + context.commit('setIsMicQuiet', false); + }; + + // TODO need to change recorder event setter to support + // replacing handlers instead of adding + recorder.ondataavailable = function (e) { + var mimeType = recorder.mimeType; + console.info('recorder data available event triggered'); + var audioBlob = new Blob([e.detail], { type: mimeType }); + // XXX not used for now since only encoding WAV format + var offset = 0; + // offset is only needed for opus encoded ogg files + // extract the offset where the opus frames are found + // leaving for future reference + // https://tools.ietf.org/html/rfc7845 + // https://tools.ietf.org/html/rfc6716 + // https://www.xiph.org/ogg/doc/framing.html + if (mimeType.startsWith('audio/ogg')) { + offset = 125 + e.detail[125] + 1; + } + console.timeEnd('recording processing time'); + + context.dispatch('lexPostContent', audioBlob, offset).then(function (lexAudioBlob) { + if (context.state.recState.silentRecordingCount >= context.state.config.converser.silentConsecutiveRecordingMax) { + return __WEBPACK_IMPORTED_MODULE_1_babel_runtime_core_js_promise___default.a.reject('Too many consecutive silent recordings: ' + (context.state.recState.silentRecordingCount + '.')); + } + return __WEBPACK_IMPORTED_MODULE_1_babel_runtime_core_js_promise___default.a.all([context.dispatch('getAudioUrl', audioBlob), context.dispatch('getAudioUrl', lexAudioBlob)]); + }).then(function (audioUrls) { + // handle being interrupted by text + if (context.state.lex.dialogState !== 'Fulfilled' && !context.state.recState.isConversationGoing) { + return __WEBPACK_IMPORTED_MODULE_1_babel_runtime_core_js_promise___default.a.resolve(); + } + + var _audioUrls = __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_slicedToArray___default()(audioUrls, 2), + humanAudioUrl = _audioUrls[0], + lexAudioUrl = _audioUrls[1]; + + context.dispatch('pushMessage', { + type: 'human', + audio: humanAudioUrl, + text: context.state.lex.inputTranscript + }); + context.dispatch('pushMessage', { + type: 'bot', + audio: lexAudioUrl, + text: context.state.lex.message, + dialogState: context.state.lex.dialogState, + responseCard: context.state.lex.responseCard + }); + return context.dispatch('playAudio', lexAudioUrl, {}, offset); + }).then(function () { + if (['Fulfilled', 'ReadyForFulfillment', 'Failed'].indexOf(context.state.lex.dialogState) >= 0) { + return context.dispatch('stopConversation').then(function () { + return context.dispatch('reInitBot'); + }); + } + + if (context.state.recState.isConversationGoing) { + return context.dispatch('startRecording'); + } + return __WEBPACK_IMPORTED_MODULE_1_babel_runtime_core_js_promise___default.a.resolve(); + }).catch(function (error) { + console.error('converser error:', error); + context.dispatch('stopConversation'); + context.dispatch('pushErrorMessage', 'I had an error. ' + error); + context.commit('resetSilentRecordingCount'); + }); + }; +}; +/* harmony default export */ __webpack_exports__["a"] = (initRecorderHandlers); + +/***/ }), +/* 166 */ +/***/ (function(module, exports) { + +module.exports = "data:audio/ogg;base64,T2dnUwACAAAAAAAAAADGYgAAAAAAADXh79kBHgF2b3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0o5KCWEUEopKXNOSkqlpJRaSplzUlIqJaWWUuogpNRaSi211loHJaXWUmqttdY6CKW01FprrbXYQUgppdZaiy3GUEpKrbXYYow1hlJSaq3F2GKsMaTSUmwtxhhjrKGU1lprMcYYay0ptdZijLXGWmtJqbXWYos11loLAOBucACASLBxhpWks8LR4EJDVgIAIQEABEKMOeeccxBCCCFSijHnoIMQQgghREox5hx0EEIIIYSMMeeggxBCCCGEkDHmHHQQQgghhBA65xyEEEIIoYRSSuccdBBCCCGUUELpIIQQQgihhFJKKR2EEEIooYRSSiklhBBCCaWUUkoppYQQQgihhBJKKaWUEEIIpZRSSimllBJCCCGUUkoppZRSQgihlFBKKaWUUkoIIYRSSimllFJKCSGEUEoppZRSSikhhBJKKaWUUkoppQAAgAMHAIAAI+gko8oibDThwgNQaMhKAIAMAABx2GrrKdbIIMWchJZLhJByEGIuEVKKOUexZUgZxRjVlDGlFFNSa+icYoxRT51jSjHDrJRWSiiRgtJyrLV2zAEAACAIADAQITOBQAEUGMgAgAOEBCkAoLDA0DFcBATkEjIKDArHhHPSaQMAEITIDJGIWAwSE6qBomI6AFhcYMgHgAyNjbSLC+gywAVd3HUghCAEIYjFARSQgIMTbnjiDU+4wQk6RaUOAgAAAAAAAQAeAACSDSAiIpo5jg6PD5AQkRGSEpMTlAAAAAAA4AGADwCAJAWIiIhmjqPD4wMkRGSEpMTkBCUAAAAAAAAAAAAICAgAAAAAAAQAAAAICE9nZ1MABE8EAAAAAAAAxmIAAAIAAAAVfZeWAwEBAQAKDg==" + +/***/ }), +/* 167 */ +/***/ (function(module, exports) { + +module.exports = "data:audio/mpeg;base64,//uQxAAAAAAAAAAAAAAAAAAAAAAAWGluZwAAAA8AAAACAAACcQCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA//////////////////////////////////////////////////////////////////8AAAA8TEFNRTMuOTlyBK8AAAAAAAAAADUgJAJxQQABzAAAAnEsm4LsAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//sQxAABgAAB/gAAACBLAGZ8AAAEAOAAAHG7///////////qWy3+NQOB//////////+RTEFNRTMuOTkuM1VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVX/+xDEIAOAAAH+AAAAICwAJQwAAARVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVQ==" + +/***/ }), +/* 168 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_classCallCheck__ = __webpack_require__(38); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_classCallCheck___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_classCallCheck__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_createClass__ = __webpack_require__(59); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_createClass___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_createClass__); + + + +/* + Copyright 2017-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. + + Licensed under the Amazon Software License (the "License"). You may not use this file + except in compliance with the License. A copy of the License is located at + + http://aws.amazon.com/asl/ + + or in the "license" file accompanying this file. This file is distributed on an "AS IS" + BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, express or implied. See the + License for the specific language governing permissions and limitations under the License. + */ + +/* eslint no-console: ["error", { allow: ["warn", "error"] }] */ + +var _class = function () { + function _class(_ref) { + var botName = _ref.botName, + _ref$botAlias = _ref.botAlias, + botAlias = _ref$botAlias === undefined ? '$LATEST' : _ref$botAlias, + userId = _ref.userId, + lexRuntimeClient = _ref.lexRuntimeClient; + + __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_classCallCheck___default()(this, _class); + + if (!botName || !lexRuntimeClient) { + throw new Error('invalid lex client constructor arguments'); + } + + this.botName = botName; + this.botAlias = botAlias; + this.userId = userId || 'lex-web-ui-' + ('' + Math.floor((1 + Math.random()) * 0x10000).toString(16).substring(1)); + + this.lexRuntimeClient = lexRuntimeClient; + this.credentials = this.lexRuntimeClient.config.credentials; + } + + __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_createClass___default()(_class, [{ + key: 'initCredentials', + value: function initCredentials(credentials) { + this.credentials = credentials; + this.lexRuntimeClient.config.credentials = this.credentials; + this.userId = credentials.identityId ? credentials.identityId : this.userId; + } + }, { + key: 'postText', + value: function postText(inputText) { + var sessionAttributes = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + + var postTextReq = this.lexRuntimeClient.postText({ + botAlias: this.botAlias, + botName: this.botName, + userId: this.userId, + inputText: inputText, + sessionAttributes: sessionAttributes + }); + return this.credentials.getPromise().then(function () { + return postTextReq.promise(); + }); + } + }, { + key: 'postContent', + value: function postContent(blob) { + var sessionAttributes = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + var acceptFormat = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'audio/ogg'; + var offset = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0; + + var mediaType = blob.type; + var contentType = mediaType; + + if (mediaType.startsWith('audio/wav')) { + contentType = 'audio/x-l16; sample-rate=16000; channel-count=1'; + } else if (mediaType.startsWith('audio/ogg')) { + contentType = 'audio/x-cbr-opus-with-preamble; bit-rate=32000;' + (' frame-size-milliseconds=20; preamble-size=' + offset); + } else { + console.warn('unknown media type in lex client'); + } + + var postContentReq = this.lexRuntimeClient.postContent({ + accept: acceptFormat, + botAlias: this.botAlias, + botName: this.botName, + userId: this.userId, + contentType: contentType, + inputStream: blob, + sessionAttributes: sessionAttributes + }); + + return this.credentials.getPromise().then(function () { + return postContentReq.promise(); + }); + } + }]); + + return _class; +}(); + +/* harmony default export */ __webpack_exports__["a"] = (_class); + +/***/ }) +/******/ ]); +}); +//# sourceMappingURL=lex-web-ui.js.map \ No newline at end of file diff --git a/dist/lex-web-ui.js.map b/dist/lex-web-ui.js.map new file mode 100644 index 00000000..fd0ecc56 --- /dev/null +++ b/dist/lex-web-ui.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///webpack/bootstrap ba67ebd61468a336e9ee","webpack:///./node_modules/core-js/library/modules/_core.js","webpack:///./node_modules/core-js/library/modules/_wks.js","webpack:///./node_modules/core-js/library/modules/_global.js","webpack:///./node_modules/core-js/library/modules/_object-dp.js","webpack:///./node_modules/core-js/library/modules/_an-object.js","webpack:///./node_modules/core-js/library/modules/_descriptors.js","webpack:///./node_modules/vue-loader/lib/component-normalizer.js","webpack:///./node_modules/core-js/library/modules/_export.js","webpack:///./node_modules/core-js/library/modules/_hide.js","webpack:///./node_modules/core-js/library/modules/_has.js","webpack:///./node_modules/core-js/library/modules/_to-iobject.js","webpack:///./node_modules/core-js/library/modules/_fails.js","webpack:///./node_modules/core-js/library/modules/_object-keys.js","webpack:///./node_modules/babel-runtime/core-js/promise.js","webpack:///./node_modules/core-js/library/modules/_iterators.js","webpack:///./node_modules/core-js/library/modules/_ctx.js","webpack:///./node_modules/core-js/library/modules/_is-object.js","webpack:///./node_modules/core-js/library/modules/_property-desc.js","webpack:///./node_modules/core-js/library/modules/_cof.js","webpack:///./node_modules/core-js/library/modules/es6.string.iterator.js","webpack:///./node_modules/babel-runtime/helpers/extends.js","webpack:///./node_modules/core-js/library/modules/_uid.js","webpack:///./node_modules/core-js/library/modules/_object-pie.js","webpack:///./node_modules/core-js/library/modules/_to-object.js","webpack:///./node_modules/core-js/library/modules/_library.js","webpack:///./node_modules/core-js/library/modules/_set-to-string-tag.js","webpack:///./node_modules/core-js/library/modules/web.dom.iterable.js","webpack:///./src/config/index.js","webpack:///./node_modules/core-js/library/modules/_a-function.js","webpack:///./node_modules/core-js/library/modules/_dom-create.js","webpack:///./node_modules/core-js/library/modules/_to-primitive.js","webpack:///./node_modules/core-js/library/modules/_defined.js","webpack:///./node_modules/core-js/library/modules/_to-length.js","webpack:///./node_modules/core-js/library/modules/_to-integer.js","webpack:///./node_modules/core-js/library/modules/_shared-key.js","webpack:///./node_modules/core-js/library/modules/_shared.js","webpack:///./node_modules/core-js/library/modules/_enum-bug-keys.js","webpack:///./node_modules/core-js/library/modules/_object-gops.js","webpack:///./node_modules/babel-runtime/helpers/classCallCheck.js","webpack:///./node_modules/babel-runtime/core-js/object/define-property.js","webpack:///./node_modules/core-js/library/modules/_classof.js","webpack:///./node_modules/core-js/library/modules/core.get-iterator-method.js","webpack:///./node_modules/core-js/library/modules/_wks-ext.js","webpack:///./node_modules/core-js/library/modules/_wks-define.js","webpack:///./node_modules/babel-runtime/core-js/object/assign.js","webpack:///./node_modules/core-js/library/modules/_ie8-dom-define.js","webpack:///./node_modules/core-js/library/modules/_object-keys-internal.js","webpack:///./node_modules/core-js/library/modules/_iobject.js","webpack:///./node_modules/core-js/library/modules/_iter-define.js","webpack:///./node_modules/core-js/library/modules/_redefine.js","webpack:///./node_modules/core-js/library/modules/_object-create.js","webpack:///./node_modules/core-js/library/modules/_html.js","webpack:///./node_modules/core-js/library/modules/_iter-call.js","webpack:///./node_modules/core-js/library/modules/_is-array-iter.js","webpack:///./node_modules/core-js/library/modules/_task.js","webpack:///./node_modules/core-js/library/modules/_iter-detect.js","webpack:///./node_modules/babel-runtime/helpers/slicedToArray.js","webpack:///./node_modules/core-js/library/modules/_object-gopn.js","webpack:///./node_modules/babel-runtime/helpers/createClass.js","webpack:///./src/lex-web-ui.js","webpack:///./node_modules/core-js/library/fn/object/assign.js","webpack:///./node_modules/core-js/library/modules/es6.object.assign.js","webpack:///./node_modules/core-js/library/modules/_object-assign.js","webpack:///./node_modules/core-js/library/modules/_array-includes.js","webpack:///./node_modules/core-js/library/modules/_to-index.js","webpack:///./node_modules/core-js/library/fn/object/define-property.js","webpack:///./node_modules/core-js/library/modules/es6.object.define-property.js","webpack:///./node_modules/core-js/library/fn/promise.js","webpack:///./node_modules/core-js/library/modules/_string-at.js","webpack:///./node_modules/core-js/library/modules/_iter-create.js","webpack:///./node_modules/core-js/library/modules/_object-dps.js","webpack:///./node_modules/core-js/library/modules/_object-gpo.js","webpack:///./node_modules/core-js/library/modules/es6.array.iterator.js","webpack:///./node_modules/core-js/library/modules/_add-to-unscopables.js","webpack:///./node_modules/core-js/library/modules/_iter-step.js","webpack:///./node_modules/core-js/library/modules/es6.promise.js","webpack:///./node_modules/core-js/library/modules/_an-instance.js","webpack:///./node_modules/core-js/library/modules/_for-of.js","webpack:///./node_modules/core-js/library/modules/_species-constructor.js","webpack:///./node_modules/core-js/library/modules/_invoke.js","webpack:///./node_modules/core-js/library/modules/_microtask.js","webpack:///./node_modules/core-js/library/modules/_redefine-all.js","webpack:///./node_modules/core-js/library/modules/_set-species.js","webpack:///external \"vue\"","webpack:///external \"vuex\"","webpack:///external \"aws-sdk/global\"","webpack:///external \"aws-sdk/clients/lexruntime\"","webpack:///external \"aws-sdk/clients/polly\"","webpack:///./src/components/LexWeb.vue?b19d","webpack:///./src/components/LexWeb.vue?c6c4","webpack:///LexWeb.vue","webpack:///./src/components/ToolbarContainer.vue","webpack:///ToolbarContainer.vue","webpack:///./src/components/ToolbarContainer.vue?a416","webpack:///./src/components/MessageList.vue?1c68","webpack:///./src/components/MessageList.vue?a09a","webpack:///MessageList.vue","webpack:///./src/components/Message.vue?3319","webpack:///./src/components/Message.vue?633a","webpack:///Message.vue","webpack:///./src/components/MessageText.vue?588c","webpack:///./src/components/MessageText.vue?a9a5","webpack:///MessageText.vue","webpack:///./src/components/MessageText.vue?0813","webpack:///./src/components/ResponseCard.vue?b224","webpack:///./src/components/ResponseCard.vue?94ef","webpack:///ResponseCard.vue","webpack:///./src/components/ResponseCard.vue?150e","webpack:///./src/components/Message.vue?aae4","webpack:///./src/components/MessageList.vue?5dce","webpack:///./src/components/StatusBar.vue?8ae9","webpack:///./src/components/StatusBar.vue?a8cb","webpack:///StatusBar.vue","webpack:///./src/components/StatusBar.vue?aadb","webpack:///./src/components/InputContainer.vue?8884","webpack:///./src/components/InputContainer.vue?19af","webpack:///InputContainer.vue","webpack:///./src/components/InputContainer.vue?efec","webpack:///./src/components/LexWeb.vue?0575","webpack:///./src/store/index.js","webpack:///./src/store/state.js","webpack:///./node_modules/babel-runtime/core-js/object/keys.js","webpack:///./node_modules/core-js/library/fn/object/keys.js","webpack:///./node_modules/core-js/library/modules/es6.object.keys.js","webpack:///./node_modules/core-js/library/modules/_object-sap.js","webpack:///./node_modules/babel-runtime/helpers/defineProperty.js","webpack:///./node_modules/babel-runtime/core-js/is-iterable.js","webpack:///./node_modules/core-js/library/fn/is-iterable.js","webpack:///./node_modules/core-js/library/modules/core.is-iterable.js","webpack:///./node_modules/babel-runtime/core-js/get-iterator.js","webpack:///./node_modules/core-js/library/fn/get-iterator.js","webpack:///./node_modules/core-js/library/modules/core.get-iterator.js","webpack:///./src/assets nonrecursive ^\\.\\/logo.(png|jpe","webpack:///./node_modules/material-design-icons/maps/2x_web/ic_local_florist_white_18dp.png","webpack:///./src/assets nonrecursive ^\\.\\/favicon.(png|jpe","webpack:///./src/config ^\\.\\/config\\..*\\.json$","webpack:///./src/config/config.dev.json","webpack:///./src/config/config.prod.json","webpack:///./src/config/config.test.json","webpack:///./src/store/getters.js","webpack:///./src/store/mutations.js","webpack:///./node_modules/babel-runtime/helpers/typeof.js","webpack:///./node_modules/babel-runtime/core-js/symbol/iterator.js","webpack:///./node_modules/core-js/library/fn/symbol/iterator.js","webpack:///./node_modules/babel-runtime/core-js/symbol.js","webpack:///./node_modules/core-js/library/fn/symbol/index.js","webpack:///./node_modules/core-js/library/modules/es6.symbol.js","webpack:///./node_modules/core-js/library/modules/_meta.js","webpack:///./node_modules/core-js/library/modules/_keyof.js","webpack:///./node_modules/core-js/library/modules/_enum-keys.js","webpack:///./node_modules/core-js/library/modules/_is-array.js","webpack:///./node_modules/core-js/library/modules/_object-gopn-ext.js","webpack:///./node_modules/core-js/library/modules/_object-gopd.js","webpack:///./node_modules/core-js/library/modules/es7.symbol.async-iterator.js","webpack:///./node_modules/core-js/library/modules/es7.symbol.observable.js","webpack:///./src/store/actions.js","webpack:///./src/lib/lex/recorder.js","webpack:///./node_modules/babel-runtime/helpers/toConsumableArray.js","webpack:///./node_modules/babel-runtime/core-js/array/from.js","webpack:///./node_modules/core-js/library/fn/array/from.js","webpack:///./node_modules/core-js/library/modules/es6.array.from.js","webpack:///./node_modules/core-js/library/modules/_create-property.js","webpack:///./src/lib/lex/wav-worker.js","webpack:///./node_modules/worker-loader/createInlineWorker.js","webpack:///./src/store/recorder-handlers.js","webpack:///./src/assets/silent.ogg","webpack:///./src/assets/silent.mp3","webpack:///./src/lib/lex/client.js"],"names":["toolbarLogoRequire","toolbarLogoRequireKey","keys","pop","toolbarLogo","require","favIconRequire","favIconRequireKey","favIcon","envShortName","find","startsWith","env","console","error","configEnvFile","configDefault","region","cognito","poolId","lex","botName","botAlias","initialText","initialSpeechInstruction","sessionAttributes","reInitSessionAttributesOnRestart","enablePlaybackInterrupt","playbackInterruptVolumeThreshold","playbackInterruptLevelThreshold","playbackInterruptNoiseThreshold","playbackInterruptMinDuration","polly","voiceId","ui","pageTitle","parentOrigin","textInputPlaceholder","toolbarColor","toolbarTitle","pushInitialTextOnRestart","convertUrlToLinksInBotMessages","stripTagsFromBotMessages","recorder","enable","recordingTimeMax","recordingTimeMin","quietThreshold","quietTimeMin","volumeThreshold","useAutoMuteDetect","converser","silentConsecutiveRecordingMax","urlQueryParams","getUrlQueryParams","url","split","slice","reduce","params","queryString","map","queryObj","param","key","value","paramObj","decodeURIComponent","e","getConfigFromQuery","query","lexWebUiConfig","JSON","parse","mergeConfig","configBase","configSrc","merged","configItem","configFromFiles","queryParams","window","location","href","configFromQuery","configFromMerge","origin","config","Component","name","template","components","LexWeb","loadingComponent","errorComponent","AsyncComponent","component","resolve","loading","delay","timeout","Plugin","install","VueConstructor","componentName","awsConfig","lexRuntimeClient","pollyClient","prototype","Store","Loader","AWSConfigConstructor","AWS","Config","CognitoConstructor","CognitoIdentityCredentials","PollyConstructor","Polly","LexRuntimeConstructor","LexRuntime","Error","credentials","IdentityPoolId","Vue","VuexConstructor","Vuex","store","use","strict","state","getters","mutations","actions","version","acceptFormat","dialogState","isInterrupting","isProcessing","inputTranscript","intentName","message","responseCard","slotToElicit","slots","messages","outputFormat","botAudio","canInterrupt","interruptIntervalId","autoPlay","isSpeaking","recState","isConversationGoing","isMicMuted","isMicQuiet","isRecorderSupported","isRecorderEnabled","isRecording","silentRecordingCount","isRunningEmbedded","isUiMinimized","awsCreds","provider","canInterruptBotPlayback","isBotSpeaking","isLexInterrupting","isLexProcessing","setIsMicMuted","bool","setIsMicQuiet","setIsConversationGoing","startRecording","info","start","stopRecording","stop","increaseSilentRecordingCount","resetSilentRecordingCount","setIsRecorderEnabled","setIsRecorderSupported","setIsBotSpeaking","setAudioAutoPlay","audio","autoplay","setCanInterruptBotPlayback","setIsBotPlaybackInterrupting","setBotPlaybackInterruptIntervalId","id","updateLexState","lexState","setLexSessionAttributes","setIsLexProcessing","setIsLexInterrupting","setAudioContentType","type","setPollyVoiceId","configObj","setIsRunningEmbedded","toggleIsUiMinimized","pushMessage","push","length","setAwsCredsProvider","awsCredentials","lexClient","initCredentials","context","dispatch","reject","getConfigFromParent","event","then","configResponse","data","initConfig","commit","initMessageList","text","initLexClient","initPollyClient","client","creds","initRecorder","init","initOptions","initRecorderHandlers","catch","indexOf","warn","initBotAudio","audioElement","silentSound","canPlayType","mimeType","preload","src","reInitBot","getAudioUrl","blob","URL","createObjectURL","audioElem","play","onended","onerror","err","playAudio","onloadedmetadata","playAudioHandler","clearPlayback","intervalId","clearInterval","onpause","playAudioInterruptHandler","intervalTimeInMs","duration","setInterval","end","played","volume","max","slow","setTimeout","pause","startConversation","stopConversation","getRecorderVolume","pollyGetBlob","synthReq","synthesizeSpeech","Text","VoiceId","OutputFormat","promise","Blob","AudioStream","ContentType","pollySynthesizeSpeech","audioUrl","interruptSpeechConversation","count","countMax","postTextMessage","response","lexPostText","postText","lexPostContent","audioBlob","offset","size","timeStart","performance","now","postContent","lexResponse","timeEnd","toFixed","processLexContentResponse","lexData","audioStream","contentType","lexStateDefault","appContext","pushErrorMessage","getCredentialsFromParent","credsExpirationDate","Date","expireTime","credsResponse","Credentials","AccessKeyId","SecretKey","SessionToken","IdentityId","accessKeyId","secretAccessKey","sessionToken","identityId","getPromise","getCredentials","sendMessageToParentWindow","messageChannel","MessageChannel","port1","onmessage","evt","close","port2","parent","postMessage","options","_eventTarget","document","createDocumentFragment","_encoderWorker","addEventListener","_exportWav","preset","_getPresetOptions","recordingTimeMinAutoIncrease","autoStopRecording","useBandPass","bandPassFrequency","bandPassQ","bufferLength","numChannels","requestEchoCancellation","muteThreshold","encoderUseTrim","encoderQuietTrimThreshold","encoderQuietTrimSlackBack","_presets","presets","low_latency","speech_recognition","_state","_instant","_slow","_clip","_maxVolume","Infinity","_isMicQuiet","_isMicMuted","_isSilentRecording","_silentRecordingConsecutiveCount","_initAudioContext","_initMicVolumeProcessor","_initStream","_stream","_recordingStartTime","_audioContext","currentTime","dispatchEvent","Event","command","sampleRate","useTrim","quietTrimThreshold","quietTrimSlackBack","_quietStartTime","CustomEvent","detail","inputBuffer","buffer","i","numberOfChannels","getChannelData","_tracks","muted","AudioContext","webkitAudioContext","hidden","suspend","resume","processor","createScriptProcessor","onaudioprocess","_recordBuffers","input","sum","clipCount","Math","abs","sqrt","_setIsMicMuted","_setIsMicQuiet","_analyser","getFloatFrequencyData","_analyserData","_micVolumeProcessor","constraints","optional","echoCancellation","navigator","mediaDevices","getUserMedia","stream","getAudioTracks","label","onmute","onunmute","source","createMediaStreamSource","gainNode","createGain","analyser","createAnalyser","biquadFilter","createBiquadFilter","frequency","gain","Q","connect","smoothingTimeConstant","fftSize","minDecibels","maxDecibels","Float32Array","frequencyBinCount","destination","instant","clip","cb","module","exports","__webpack_public_path__","onstart","time","onstop","onsilentrecording","onunsilentrecording","onstreamready","onquiet","onunquiet","ondataavailable","lexAudioBlob","all","audioUrls","humanAudioUrl","lexAudioUrl","userId","floor","random","toString","substring","inputText","postTextReq","mediaType","postContentReq","accept","inputStream"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;ACVA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAK;AACL;AACA;;AAEA;AACA;AACA;AACA,mCAA2B,0BAA0B,EAAE;AACvD,yCAAiC,eAAe;AAChD;AACA;AACA;;AAEA;AACA,8DAAsD,+DAA+D;;AAErH;AACA;;AAEA;AACA;;;;;;;AC7DA,6BAA6B;AAC7B,qCAAqC,gC;;;;;;ACDrC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,uB;;;;;;ACVA;AACA;AACA;AACA,uCAAuC,gC;;;;;;ACHvC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG,UAAU;AACb;AACA;AACA;AACA,E;;;;;;ACfA;AACA;AACA;AACA;AACA,E;;;;;;ACJA;AACA;AACA,iCAAiC,QAAQ,gBAAgB,UAAU,GAAG;AACtE,CAAC,E;;;;;;ACHD;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;;;;;;AC1FA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mEAAmE;AACnE;AACA,qFAAqF;AACrF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX,SAAS;AACT;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,+CAA+C;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,eAAe;AACf,eAAe;AACf,eAAe;AACf,gBAAgB;AAChB,yB;;;;;;AC5DA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA,E;;;;;;ACPA,uBAAuB;AACvB;AACA;AACA,E;;;;;;ACHA;AACA;AACA;AACA;AACA;AACA,E;;;;;;ACLA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,E;;;;;;ACNA;AACA;AACA;;AAEA;AACA;AACA,E;;;;;;ACNA,kBAAkB,wD;;;;;;ACAlB,oB;;;;;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,E;;;;;;ACXA;AACA;AACA;AACA;AACA,E;;;;;;ACJA;AACA;AACA;AACA;AACA,2DAA2D;AAC3D,E;;;;;;ACLA;AACA;AACA;AACA;AACA;AACA,E;;;;;;ACLA;AACA;AACA;AACA;AACA,E;;;;;;ACJA;AACA;AACA,mDAAmD;AACnD;AACA,uCAAuC;AACvC,E;;;;;;ACLA;AACA;AACA;AACA,a;;;;;;ACHA,yC;;;;;;;ACAA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,E;;;;;;ACRA,kBAAkB,wD;;;;;;ACAlB;AACA;AACA;AACA;AACA,yBAAyB,kBAAkB,EAAE;;AAE7C;AACA;AACA;AACA;AACA,GAAG,UAAU;AACb;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,E;;;;;;ACtBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,E;;;;;;ACPA,mC;;;;;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA,0DAA0D,sBAAsB;AAChF,gFAAgF,sBAAsB;AACtG,E;;;;;;ACRA,kBAAkB,wD;;;;;;ACAlB;AACA,qEAAsE,gBAAgB,UAAU,GAAG;AACnG,CAAC,E;;;;;;ACFD;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,E;;;;;;AChBA;AACA;AACA;AACA;AACA,E;;;;;;;;;;;;;ACJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,4BAA4B,aAAa;;AAEzC;AACA;AACA;AACA;AACA;AACA,wCAAwC,oCAAoC;AAC5E,4CAA4C,oCAAoC;AAChF,KAAK,2BAA2B,oCAAoC;AACpE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,mBAAmB;AACnC;AACA;AACA,iCAAiC,2BAA2B;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,E;;;;;;ACrEA,wC;;;;;;ACAA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;;;;;;ACxCA,6E;;;;;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,E;;;;;;ACXA;AACA;AACA;AACA;;AAEA;AACA;AACA,E;;;;;;ACPA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,E;;;;;;AC1EA;AACA;;AAEA;AACA;AACA,+BAA+B,qBAAqB;AACpD,+BAA+B,SAAS,EAAE;AAC1C,CAAC,UAAU;;AAEX;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,SAAS,mBAAmB;AACvD,+BAA+B,aAAa;AAC5C;AACA,GAAG,UAAU;AACb;AACA,E;;;;;;;ACpBA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA,sCAAsC,uCAAuC,gBAAgB;;AAE7F;AACA;AACA;AAC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A0C,gCAAoC,E;;;;;;;ACH9E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,UAAU,EAAE;AAC9C,mBAAmB,sCAAsC;AACzD,CAAC,oCAAoC;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH,CAAC,W;;;;;;AChCD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK,WAAW,eAAe;AAC/B;AACA,KAAK;AACL;AACA,E;;;;;;ACpBA;AACA;AACA;AACA;AACA;AACA;AACA,E;;;;;;ACNA;AACA;AACA;AACA;AACA,E;;;;;;ACJA;AACA;AACA,oEAAuE,yCAA0C,E;;;;;;ACFjH;AACA;AACA;AACA;AACA,gD;;;;;;ACJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,E;;;;;;;AChBA;AACA;AACA;AACA;AACA;;AAEA;AACA,yFAAgF,aAAa,EAAE;;AAE/F;AACA,qDAAqD,0BAA0B;AAC/E;AACA,E;;;;;;ACZA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,E;;;;;;ACZA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH,E;;;;;;;ACZA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,gCAAgC;AAChC,cAAc;AACd,iBAAiB;AACjB;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;;AAEA;AACA;AACA,4B;;;;;;ACjCA,4BAA4B,e;;;;;;ACA5B;AACA,UAAU;AACV,E;;;;;;;ACFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC;AACpC;;AAEA;AACA;AACA;AACA;AACA,+CAA+C,sDAAiD,oBAAoB;AACpH;AACA;AACA,GAAG,UAAU;AACb,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA,WAAW;AACX,SAAS;AACT,OAAO;AACP;AACA;AACA;AACA,2CAA2C;AAC3C;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,mBAAmB,gCAAgC;AACnD,SAAS;AACT;AACA;AACA,OAAO;AACP;AACA;AACA,KAAK;AACL;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,eAAe,qCAAqC;AACpD;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,kCAAkC;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC;AAClC;AACA;AACA;AACA;AACA,uBAAuB,wBAAwB;AAC/C;AACA;AACA,SAAS;AACT;AACA;AACA,OAAO;AACP,KAAK;AACL;AACA;AACA;AACA;AACA,GAAG;AACH,kBAAkB,uBAAuB,KAAK;AAC9C;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,iBAAiB;AACjB,wBAAwB;AACxB,gBAAgB;AAChB,oBAAoB;AACpB,wBAAwB;AACxB,gBAAgB;AAChB,oBAAoB;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,0DAA0D,kBAAkB;AAC5E;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,OAAO;AACP;AACA,KAAK;AACL;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP,KAAK;AACL;AACA;AACA;AACA,CAAC,E;;;;;;AC1SD;AACA;AACA;AACA,GAAG;AACH,E;;;;;;ACJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC,iBAAiB,EAAE;AACxD;AACA;AACA;AACA;AACA;AACA,gEAAgE,gBAAgB;AAChF;AACA;AACA,GAAG,2CAA2C,gCAAgC;AAC9E;AACA;AACA;AACA;AACA;AACA,wB;;;;;;ACxBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,E;;;;;;ACPA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH,E;;;;;;ACfA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,uCAAuC,oBAAoB,EAAE;AAC7D;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,E;;;;;;ACnEA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH,E;;;;;;;ACNA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,oBAAoB,aAAa;AACjC,GAAG;AACH,E;;;;;;ACbA,gD;;;;;;ACAA,gD;;;;;;ACAA,gD;;;;;;ACAA,gD;;;;;;ACAA,gD;;;;;;;;ACAA;AAAA;AACA,wBAAsT;AACtT;AACA;AACA;AACA;AACA;AACiP;AACjP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;ACtBA,yC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACiCA;;;;;;;;;;;;;AAEA;AACA;AACA;AACA;AACA;;AAEA;QAEA;;AAEA;AACA;AACA;AAEA;AALA;;kEAOA;0CACA;AACA;wCACA;0CACA;AACA;0DACA;yCACA;AACA;0CACA;yCACA;AACA;0CACA;yCACA;AACA;wCACA;yCACA;AACA;4CACA;+BACA;AAEA;AAtBA;sCAuBA;0EACA;mBACA;iDACA;gDACA;WACA;mEACA;gEACA;mBACA,oDAEA;oBACA,gDACA,eACA;gBACA,KACA,sHAEA;AAEA;;8DACA;iDACA;gDACA;AACA;AACA;;AACA;;yBACA;iDACA;;AACA,uFACA,oEACA,oCACA,2DAGA;;AACA,uFACA,uBACA,6EACA,qEAGA;;AACA,gCACA,0CACA,sCAEA,mFAEA;;AACA,0BACA,mEAGA;8BACA;wEACA;AACA;AACA;;;kDAEA;kCACA;AACA;;AACA;iDACA;AACA;mEACA;6DACA;AACA;AACA;sBACA;iEACA;AACA;AACA;uBACA;aACA;uBACA;;mBAEA;2BAEA;AAHA;AAIA;AACA;aACA;sEACA;AACA;aACA;+BACA,wCACA;yBACA,+CAEA;AACA;AACA;aACA;iCACA;;qBAEA;6BACA;qBAEA;AAJA;AAKA;AAEA;;+BACA,mDAEA,4BACA;yBACA,+CAEA;AACA;AACA;AACA;4DACA;AAEA;;AAEA;AA3DA;AAzFA,G;;;;;;;;AC1CA;AAAA;AACA;AACA;AACA;AACiP;AACjP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACcA;;;;;;;;;;;;AACA;QAEA;yDACA;;gDAEA;;gDAGA;AAFA;AAIA;AANA;;8CAQA;iBACA;AAEA;AAJA;AAVA,G;;;;;;;ACnCA,0BAA0B,aAAa,0BAA0B;AACjE;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,iBAAiB;AACjB,kE;;;;;;;;AClCA;AAAA;AACA,wBAAqT;AACrT;AACA;AACA;AACA;AACA;AACgP;AAChP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;ACtBA,yC;;;;;;;;;;;;;;;;;;;;ACuBA;;;;;;;;;;;;AACA;;AAEA;QAEA;;AAGA;AAFA;;kCAIA;+BACA;AAEA;AAJA;;AAMA;;AACA;;iCACA;wCACA;AACA;AAEA;AAPA;AAVA,G;;;;;;;;AC3BA;AAAA;AACA,wBAAqT;AACrT;AACA;AACA;AACA;AACA;AACgP;AAChP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;ACtBA,yC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AC8CA;;;;;;;;;;;;AACA;AACA;;AAEA;QAEA;UACA;;AAEA;AAEA;AAHA;;8CAKA;4CACA;eACA;AACA;2BACA;aACA;yCACA;aACA;aACA;wCACA;AACA;iBAEA;;AACA;oEACA;AACA,0BACA,uDACA,6CACA,gDACA,iFACA,wEAEA;AAEA;AAzBA;;oCA2BA;AACA;AAIA;;;;6CACA;qBACA;kBACA;AACA;AAEA;AAZA;AAjCA,G;;;;;;;;ACnDA;AAAA;AACA,yBAAqT;AACrT;AACA;AACA;AACA;AACA;AACgP;AAChP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;ACtBA,yC;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACgCA;;;;;;;;;;;;AACA;QAEA;UACA;;gEAEA;yCACA;AACA;gDACA;yCACA;AACA;sDACA;iDACA;AACA;kDACA;AACA;AACA;+DACA;sDACA;aACA;AAEA;AAjBA;;+CAmBA;aACA,oBACA,uBACA,wBACA,uBACA,sBACA;AACA;;AACA;;;AAEA;AACA;AACA;AACA;AACA;cACA;mBACA,OACA,qDACA,8CAEA;wCACA;oEACA;iBACA,+EACA;AAGA;OAlBA;AAmBA;qDAEA;;AACA;AACA;AACA;AACA;AACA;iCACA,0DACA;gCACA;iCACA;gDACA,6CACA;8DACA;AACA;kCACA;aACA;;OAhBA,EAiBA;AACA;;AACA;qEACA;+DACA;sBACA;iDACA;AAEA;AAvDA;AArBA,G;;;;;;;AClCA,0BAA0B,aAAa,0BAA0B;AACjE;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA;AACA,iBAAiB;AACjB,kE;;;;;;;;ACdA;AAAA;AACA,yBAAqT;AACrT;AACA;AACA;AACA;AACA;AACgP;AAChP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;ACtBA,yC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACuDA;;;;;;;;;;;;AACA;QAEA;UACA;wBACA;;4BAGA;AAFA;AAGA;;YAEA;;iDAEA;kCACA;;cAEA;cAGA;AAJA;;8CAKA;AAEA;AAVA;AAVA,G;;;;;;;ACzDA,0BAA0B,aAAa,0BAA0B;AACjE;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,iBAAiB;AACjB,kE;;;;;;;AC5CA,0BAA0B,aAAa,0BAA0B;AACjE;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,GAAG;AACH;AACA;AACA,iBAAiB;AACjB,kE;;;;;;;AC3CA,0BAA0B,aAAa,0BAA0B;AACjE;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,GAAG;AACH;AACA;AACA,iBAAiB;AACjB,kE;;;;;;;;ACfA;AAAA;AACA,yBAAqT;AACrT;AACA;AACA;AACA;AACA;AACgP;AAChP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;ACtBA,yC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACsCA;;;;;;;;;;;;;AAEA;QAEA;wBACA;;cAEA;wBAEA;AAHA;AAIA;;;oEAEA;kBACA;AACA;0CACA;AACA,kBACA,mCACA,qBAEA;AACA;sCACA;+BACA;eACA;AACA;wCACA;eACA;AACA;2BACA;eACA;AACA;4BACA;eACA;AACA;8BACA;eACA;AACA;0CACA;eACA;AACA;oCACA;eACA;AACA;aACA;AACA;gEACA;wCACA;AACA;4CACA;wCACA;AACA;wDACA;wCACA;AACA;sCACA;wCACA;AACA;wDACA;wCACA;AACA;wCACA;wCACA;AAEA;AArDA;;;AAuDA;;yBACA;gBACA;sDACA;8BACA,4CACA;gDACA;uCACA;AACA;SACA;AACA;sCACA;iCACA;2BACA;AACA;AAEA;AAjBA;AA9DA,G;;;;;;;ACzCA,0BAA0B,aAAa,0BAA0B;AACjE;AACA;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,iBAAiB;AACjB,kE;;;;;;;;AC9BA;AAAA;AACA,yBAAqT;AACrT;AACA;AACA;AACA;AACA;AACgP;AAChP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;ACtBA,yC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACqCA;;;;;;;;;;;;AACA;;AAEA;QAEA;wBACA;;iBAGA;AAFA;AAGA;;;4CAEA;2BACA;eACA;AACA;8BACA;eACA;AACA;aACA;AACA;wDACA;kBACA;AACA;4CACA;wCACA;AACA;wDACA;wCACA;AACA;sCACA;wCACA;AACA;wDACA;wCACA;AAEA;AAzBA;8DA0BA;;;AAEA;;AACA;kCACA;qFACA;AACA;;cAEA;mBAGA;AAJA;;qDAKA,0BACA;0BACA;AACA;AACA;sCACA;qCACA;oBACA;qCACA;oCACA;AAEA;;mFACA;AACA;;AACA;;2BACA;qFACA;AACA;kBACA;sBACA;;sCACA;gCACA;0DACA;+BACA,gFAEA;AACA;AACA;;AACA;;6CACA;AACA,uDAGA;;;aACA,sCACA,8BAEA,kGACA;AACA;;AAQA;;;;;;;;wCACA;+CACA;q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EA;;AAEA;;AAEA;;AAEA;;AAEA,iHAAiH,mBAAmB,EAAE,mBAAmB,4JAA4J;;AAErT,sCAAsC,uCAAuC,gBAAgB;;AAE7F;AACA;AACA,CAAC;AACD;AACA,E;;;;;;ACpBA,kBAAkB,yD;;;;;;ACAlB;AACA;AACA,uD;;;;;;ACFA,kBAAkB,yD;;;;;;ACAlB;AACA;AACA;AACA;AACA,+C;;;;;;;ACJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,sBAAsB;AACtB,oBAAoB,uBAAuB,SAAS,IAAI;AACxD,GAAG;AACH,CAAC;AACD;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,CAAC;AACD;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yDAAyD;AACzD;AACA,KAAK;AACL;AACA,sBAAsB,iCAAiC;AACvD,KAAK;AACL,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8DAA8D,8BAA8B;AAC5F;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,0DAA0D,gBAAgB;;AAE1E;AACA;AACA;AACA,oBAAoB,oBAAoB;;AAExC,0CAA0C,oBAAoB;;AAE9D;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,GAAG;AACH,wBAAwB,eAAe,EAAE;AACzC,wBAAwB,gBAAgB;AACxC,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA,oDAAoD,KAAK,QAAQ,iCAAiC;AAClG,CAAC;AACD;AACA,+CAA+C;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0C;;;;;;AC1OA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD;AACjD,CAAC;AACD;AACA,qBAAqB;AACrB;AACA,SAAS;AACT,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,E;;;;;;ACpDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,E;;;;;;ACTA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH,E;;;;;;ACdA;AACA;AACA;AACA;AACA,E;;;;;;ACJA;AACA;AACA;AACA,kBAAkB;;AAElB;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;;;;;;;AClBA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG,UAAU;AACb;AACA,E;;;;;;ACfA,yC;;;;;;ACAA,sC;;;;;;;;;;;;;;;;;;;;;ACAA;;;;;;;;;;;;;AAaA;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versalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"vue\"), require(\"vuex\"), require(\"aws-sdk/global\"), require(\"aws-sdk/clients/lexruntime\"), require(\"aws-sdk/clients/polly\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"vue\", \"vuex\", \"aws-sdk/global\", \"aws-sdk/clients/lexruntime\", \"aws-sdk/clients/polly\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"LexWebUi\"] = factory(require(\"vue\"), require(\"vuex\"), require(\"aws-sdk/global\"), require(\"aws-sdk/clients/lexruntime\"), require(\"aws-sdk/clients/polly\"));\n\telse\n\t\troot[\"LexWebUi\"] = factory(root[\"vue\"], root[\"vuex\"], root[\"aws-sdk/global\"], root[\"aws-sdk/clients/lexruntime\"], root[\"aws-sdk/clients/polly\"]);\n})(this, function(__WEBPACK_EXTERNAL_MODULE_84__, __WEBPACK_EXTERNAL_MODULE_85__, __WEBPACK_EXTERNAL_MODULE_86__, __WEBPACK_EXTERNAL_MODULE_87__, __WEBPACK_EXTERNAL_MODULE_88__) {\nreturn \n\n\n// WEBPACK FOOTER //\n// webpack/universalModuleDefinition"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"/\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 60);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap ba67ebd61468a336e9ee","var core = module.exports = {version: '2.4.0'};\nif(typeof __e == 'number')__e = core; // eslint-disable-line no-undef\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/library/modules/_core.js\n// module id = 0\n// module chunks = 0","var store = require('./_shared')('wks')\n , uid = require('./_uid')\n , Symbol = require('./_global').Symbol\n , USE_SYMBOL = typeof Symbol == 'function';\n\nvar $exports = module.exports = function(name){\n return store[name] || (store[name] =\n USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : uid)('Symbol.' + name));\n};\n\n$exports.store = store;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/library/modules/_wks.js\n// module id = 1\n// module chunks = 0","// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028\nvar global = module.exports = typeof window != 'undefined' && window.Math == Math\n ? window : typeof self != 'undefined' && self.Math == Math ? self : Function('return this')();\nif(typeof __g == 'number')__g = global; // eslint-disable-line no-undef\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/library/modules/_global.js\n// module id = 2\n// module chunks = 0","var anObject = require('./_an-object')\n , IE8_DOM_DEFINE = require('./_ie8-dom-define')\n , toPrimitive = require('./_to-primitive')\n , dP = Object.defineProperty;\n\nexports.f = require('./_descriptors') ? Object.defineProperty : function defineProperty(O, P, Attributes){\n anObject(O);\n P = toPrimitive(P, true);\n anObject(Attributes);\n if(IE8_DOM_DEFINE)try {\n return dP(O, P, Attributes);\n } catch(e){ /* empty */ }\n if('get' in Attributes || 'set' in Attributes)throw TypeError('Accessors not supported!');\n if('value' in Attributes)O[P] = Attributes.value;\n return O;\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/library/modules/_object-dp.js\n// module id = 3\n// module chunks = 0","var isObject = require('./_is-object');\nmodule.exports = function(it){\n if(!isObject(it))throw TypeError(it + ' is not an object!');\n return it;\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/library/modules/_an-object.js\n// module id = 4\n// module chunks = 0","// Thank's IE8 for his funny defineProperty\nmodule.exports = !require('./_fails')(function(){\n return Object.defineProperty({}, 'a', {get: function(){ return 7; }}).a != 7;\n});\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/library/modules/_descriptors.js\n// module id = 5\n// module chunks = 0","/* globals __VUE_SSR_CONTEXT__ */\n\n// this module is a runtime utility for cleaner component module output and will\n// be included in the final webpack user bundle\n\nmodule.exports = function normalizeComponent (\n rawScriptExports,\n compiledTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier /* server only */\n) {\n var esModule\n var scriptExports = rawScriptExports = rawScriptExports || {}\n\n // ES6 modules interop\n var type = typeof rawScriptExports.default\n if (type === 'object' || type === 'function') {\n esModule = rawScriptExports\n scriptExports = rawScriptExports.default\n }\n\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // render functions\n if (compiledTemplate) {\n options.render = compiledTemplate.render\n options.staticRenderFns = compiledTemplate.staticRenderFns\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = injectStyles\n }\n\n if (hook) {\n var functional = options.functional\n var existing = functional\n ? options.render\n : options.beforeCreate\n if (!functional) {\n // inject component registration as beforeCreate hook\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n } else {\n // register for functioal component in vue file\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return existing(h, context)\n }\n }\n }\n\n return {\n esModule: esModule,\n exports: scriptExports,\n options: options\n }\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/vue-loader/lib/component-normalizer.js\n// module id = 6\n// module chunks = 0","var global = require('./_global')\n , core = require('./_core')\n , ctx = require('./_ctx')\n , hide = require('./_hide')\n , PROTOTYPE = 'prototype';\n\nvar $export = function(type, name, source){\n var IS_FORCED = type & $export.F\n , IS_GLOBAL = type & $export.G\n , IS_STATIC = type & $export.S\n , IS_PROTO = type & $export.P\n , IS_BIND = type & $export.B\n , IS_WRAP = type & $export.W\n , exports = IS_GLOBAL ? core : core[name] || (core[name] = {})\n , expProto = exports[PROTOTYPE]\n , target = IS_GLOBAL ? global : IS_STATIC ? global[name] : (global[name] || {})[PROTOTYPE]\n , key, own, out;\n if(IS_GLOBAL)source = name;\n for(key in source){\n // contains in native\n own = !IS_FORCED && target && target[key] !== undefined;\n if(own && key in exports)continue;\n // export native or passed\n out = own ? target[key] : source[key];\n // prevent global pollution for namespaces\n exports[key] = IS_GLOBAL && typeof target[key] != 'function' ? source[key]\n // bind timers to global for call from export context\n : IS_BIND && own ? ctx(out, global)\n // wrap global constructors for prevent change them in library\n : IS_WRAP && target[key] == out ? (function(C){\n var F = function(a, b, c){\n if(this instanceof C){\n switch(arguments.length){\n case 0: return new C;\n case 1: return new C(a);\n case 2: return new C(a, b);\n } return new C(a, b, c);\n } return C.apply(this, arguments);\n };\n F[PROTOTYPE] = C[PROTOTYPE];\n return F;\n // make static versions for prototype methods\n })(out) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out;\n // export proto methods to core.%CONSTRUCTOR%.methods.%NAME%\n if(IS_PROTO){\n (exports.virtual || (exports.virtual = {}))[key] = out;\n // export proto methods to core.%CONSTRUCTOR%.prototype.%NAME%\n if(type & $export.R && expProto && !expProto[key])hide(expProto, key, out);\n }\n }\n};\n// type bitmap\n$export.F = 1; // forced\n$export.G = 2; // global\n$export.S = 4; // static\n$export.P = 8; // proto\n$export.B = 16; // bind\n$export.W = 32; // wrap\n$export.U = 64; // safe\n$export.R = 128; // real proto method for `library` \nmodule.exports = $export;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/library/modules/_export.js\n// module id = 7\n// module chunks = 0","var dP = require('./_object-dp')\n , createDesc = require('./_property-desc');\nmodule.exports = require('./_descriptors') ? function(object, key, value){\n return dP.f(object, key, createDesc(1, value));\n} : function(object, key, value){\n object[key] = value;\n return object;\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/library/modules/_hide.js\n// module id = 8\n// module chunks = 0","var hasOwnProperty = {}.hasOwnProperty;\nmodule.exports = function(it, key){\n return hasOwnProperty.call(it, key);\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/library/modules/_has.js\n// module id = 9\n// module chunks = 0","// to indexed object, toObject with fallback for non-array-like ES3 strings\nvar IObject = require('./_iobject')\n , defined = require('./_defined');\nmodule.exports = function(it){\n return IObject(defined(it));\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/library/modules/_to-iobject.js\n// module id = 10\n// module chunks = 0","module.exports = function(exec){\n try {\n return !!exec();\n } catch(e){\n return true;\n }\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/library/modules/_fails.js\n// module id = 11\n// module chunks = 0","// 19.1.2.14 / 15.2.3.14 Object.keys(O)\nvar $keys = require('./_object-keys-internal')\n , enumBugKeys = require('./_enum-bug-keys');\n\nmodule.exports = Object.keys || function keys(O){\n return $keys(O, enumBugKeys);\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/library/modules/_object-keys.js\n// module id = 12\n// module chunks = 0","module.exports = { \"default\": require(\"core-js/library/fn/promise\"), __esModule: true };\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/babel-runtime/core-js/promise.js\n// module id = 13\n// module chunks = 0","module.exports = {};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/library/modules/_iterators.js\n// module id = 14\n// module chunks = 0","// optional / simple context binding\nvar aFunction = require('./_a-function');\nmodule.exports = function(fn, that, length){\n aFunction(fn);\n if(that === undefined)return fn;\n switch(length){\n case 1: return function(a){\n return fn.call(that, a);\n };\n case 2: return function(a, b){\n return fn.call(that, a, b);\n };\n case 3: return function(a, b, c){\n return fn.call(that, a, b, c);\n };\n }\n return function(/* ...args */){\n return fn.apply(that, arguments);\n };\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/library/modules/_ctx.js\n// module id = 15\n// module chunks = 0","module.exports = function(it){\n return typeof it === 'object' ? it !== null : typeof it === 'function';\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/library/modules/_is-object.js\n// module id = 16\n// module chunks = 0","module.exports = function(bitmap, value){\n return {\n enumerable : !(bitmap & 1),\n configurable: !(bitmap & 2),\n writable : !(bitmap & 4),\n value : value\n };\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/library/modules/_property-desc.js\n// module id = 17\n// module chunks = 0","var toString = {}.toString;\n\nmodule.exports = function(it){\n return toString.call(it).slice(8, -1);\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/library/modules/_cof.js\n// module id = 18\n// module chunks = 0","'use strict';\nvar $at = require('./_string-at')(true);\n\n// 21.1.3.27 String.prototype[@@iterator]()\nrequire('./_iter-define')(String, 'String', function(iterated){\n this._t = String(iterated); // target\n this._i = 0; // next index\n// 21.1.5.2.1 %StringIteratorPrototype%.next()\n}, function(){\n var O = this._t\n , index = this._i\n , point;\n if(index >= O.length)return {value: undefined, done: true};\n point = $at(O, index);\n this._i += point.length;\n return {value: point, done: false};\n});\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/library/modules/es6.string.iterator.js\n// module id = 19\n// module chunks = 0","\"use strict\";\n\nexports.__esModule = true;\n\nvar _assign = require(\"../core-js/object/assign\");\n\nvar _assign2 = _interopRequireDefault(_assign);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nexports.default = _assign2.default || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/babel-runtime/helpers/extends.js\n// module id = 20\n// module chunks = 0","var id = 0\n , px = Math.random();\nmodule.exports = function(key){\n return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36));\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/library/modules/_uid.js\n// module id = 21\n// module chunks = 0","exports.f = {}.propertyIsEnumerable;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/library/modules/_object-pie.js\n// module id = 22\n// module chunks = 0","// 7.1.13 ToObject(argument)\nvar defined = require('./_defined');\nmodule.exports = function(it){\n return Object(defined(it));\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/library/modules/_to-object.js\n// module id = 23\n// module chunks = 0","module.exports = true;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/library/modules/_library.js\n// module id = 24\n// module chunks = 0","var def = require('./_object-dp').f\n , has = require('./_has')\n , TAG = require('./_wks')('toStringTag');\n\nmodule.exports = function(it, tag, stat){\n if(it && !has(it = stat ? it : it.prototype, TAG))def(it, TAG, {configurable: true, value: tag});\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/library/modules/_set-to-string-tag.js\n// module id = 25\n// module chunks = 0","require('./es6.array.iterator');\nvar global = require('./_global')\n , hide = require('./_hide')\n , Iterators = require('./_iterators')\n , TO_STRING_TAG = require('./_wks')('toStringTag');\n\nfor(var collections = ['NodeList', 'DOMTokenList', 'MediaList', 'StyleSheetList', 'CSSRuleList'], i = 0; i < 5; i++){\n var NAME = collections[i]\n , Collection = global[NAME]\n , proto = Collection && Collection.prototype;\n if(proto && !proto[TO_STRING_TAG])hide(proto, TO_STRING_TAG, NAME);\n Iterators[NAME] = Iterators.Array;\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/library/modules/web.dom.iterable.js\n// module id = 26\n// module chunks = 0","/*\n Copyright 2017-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n\n Licensed under the Amazon Software License (the \"License\"). You may not use this file\n except in compliance with the License. A copy of the License is located at\n\n http://aws.amazon.com/asl/\n\n or in the \"license\" file accompanying this file. This file is distributed on an \"AS IS\"\n BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, express or implied. See the\n License for the specific language governing permissions and limitations under the License.\n */\n\n/**\n * Application configuration management.\n * This file contains default config values and merges the environment\n * and URL configs.\n *\n * The environment dependent values are loaded from files\n * with the config..json naming syntax (where is a NODE_ENV value\n * such as 'prod' or 'dev') located in the same directory as this file.\n *\n * The URL configuration is parsed from the `config` URL parameter as\n * a JSON object\n *\n * NOTE: To avoid having to manually merge future changes to this file, you\n * probably want to modify default values in the config..js files instead\n * of this one.\n */\n\n/* eslint no-console: [\"error\", { allow: [\"warn\", \"error\"] }] */\n\n// TODO turn this into a class\n\n// Search for logo image files in ../assets/\n// if not found, assigns the default flower logo.\nconst toolbarLogoRequire =\n // Logo loading depends on the webpack require.context API:\n // https://webpack.github.io/docs/context.html\n require.context('../assets', false, /^\\.\\/logo.(png|jpe?g|svg)$/);\nconst toolbarLogoRequireKey = toolbarLogoRequire.keys().pop();\n\nconst toolbarLogo = (toolbarLogoRequireKey) ?\n toolbarLogoRequire(toolbarLogoRequireKey) :\n require('../../node_modules/material-design-icons/maps/2x_web/ic_local_florist_white_18dp.png');\n\n// search for favicon in assets directory - use toolbar logo if not found\nconst favIconRequire =\n require.context('../assets', false, /^\\.\\/favicon.(png|jpe?g|svg|ico)$/);\nconst favIconRequireKey = favIconRequire.keys().pop();\nconst favIcon = (favIconRequireKey) ?\n favIconRequire(favIconRequireKey) :\n toolbarLogo;\n\n// get env shortname to require file\nconst envShortName = [\n 'dev',\n 'prod',\n 'test',\n].find(env => process.env.NODE_ENV.startsWith(env));\n\nif (!envShortName) {\n console.error('unknown environment in config: ', process.env.NODE_ENV);\n}\n\n// eslint-disable-next-line import/no-dynamic-require\nconst configEnvFile = require(`./config.${envShortName}.json`);\n\n// default config used to provide a base structure for\n// environment and dynamic configs\nconst configDefault = {\n // AWS region\n region: 'us-east-1',\n\n cognito: {\n // Cognito pool id used to obtain credentials\n // e.g. poolId: 'us-east-1:deadbeef-cac0-babe-abcd-abcdef01234',\n poolId: '',\n },\n\n lex: {\n // Lex bot name\n botName: 'WebUiOrderFlowers',\n\n // Lex bot alias/version\n botAlias: '$LATEST',\n\n // instruction message shown in the UI\n initialText: 'You can ask me for help ordering flowers. ' +\n 'Just type \"order flowers\" or click on the mic and say it.',\n\n // instructions spoken when mic is clicked\n initialSpeechInstruction: 'Say \"Order Flowers\" to get started',\n\n // Lex initial sessionAttributes\n sessionAttributes: {},\n\n // controls if the session attributes are reinitialized a\n // after the bot dialog is done (i.e. fail or fulfilled)\n reInitSessionAttributesOnRestart: true,\n\n // allow to interrupt playback of lex responses by talking over playback\n // XXX experimental\n enablePlaybackInterrupt: false,\n\n // microphone volume level (in dB) to cause an interrupt in the bot\n // playback. Lower (negative) values makes interrupt more likely\n // may need to adjusted down if using low_latency preset or band pass filter\n playbackInterruptVolumeThreshold: -60,\n\n // microphone slow sample level to cause an interrupt in the bot\n // playback. Lower values makes interrupt more likely\n // may need to adjusted down if using low_latency preset or band pass filter\n playbackInterruptLevelThreshold: 0.0075,\n\n // microphone volume level (in dB) to cause enable interrupt of bot\n // playback. This is used to prevent interrupts when there's noise\n // For interrupt to be enabled, the volume level should be lower than this\n // value. Lower (negative) values makes interrupt more likely\n // may need to adjusted down if using low_latency preset or band pass filter\n playbackInterruptNoiseThreshold: -75,\n\n // only allow to interrupt playback longer than this value (in seconds)\n playbackInterruptMinDuration: 2,\n },\n\n polly: {\n voiceId: 'Joanna',\n },\n\n ui: {\n // title of HTML page added dynamically to index.html\n pageTitle: 'Order Flowers Bot',\n\n // when running as an embedded iframe, this will be used as the\n // be the parent origin used to send/receive messages\n // NOTE: this is also a security control\n // this parameter should not be dynamically overriden\n // avoid making it '*'\n // if left as an empty string, it will be set to window.location.window\n // to allow runing embedded in a single origin setup\n parentOrigin: '',\n\n // chat window text placeholder\n textInputPlaceholder: 'Type here',\n\n toolbarColor: 'red',\n\n // chat window title\n toolbarTitle: 'Order Flowers',\n\n // logo used in toolbar - also used as favicon not specificied\n toolbarLogo,\n\n // fav icon\n favIcon,\n\n // controls if the Lex initialText will be pushed into the message\n // list after the bot dialog is done (i.e. fail or fulfilled)\n pushInitialTextOnRestart: true,\n\n // controls if the Lex sessionAttributes should be re-initialized\n // to the config value (i.e. lex.sessionAttributes)\n // after the bot dialog is done (i.e. fail or fulfilled)\n reInitSessionAttributesOnRestart: false,\n\n // controls whether URLs in bot responses will be converted to links\n convertUrlToLinksInBotMessages: true,\n\n // controls whether tags (e.g. SSML or HTML) should be stripped out\n // of bot messages received from Lex\n stripTagsFromBotMessages: true,\n },\n\n /* Configuration to enable voice and to pass options to the recorder\n * see ../lib/recorder.js for details about all the available options.\n * You can override any of the defaults in recorder.js by adding them\n * to the corresponding JSON config file (config..json)\n * or alternatively here\n */\n recorder: {\n // if set to true, voice interaction would be enabled on supported browsers\n // set to false if you don't want voice enabled\n enable: true,\n\n // maximum recording time in seconds\n recordingTimeMax: 10,\n\n // Minimum recording time in seconds.\n // Used before evaluating if the line is quiet to allow initial pauses\n // before speech\n recordingTimeMin: 2.5,\n\n // Sound sample threshold to determine if there's silence.\n // This is measured against a value of a sample over a period of time\n // If set too high, it may falsely detect quiet recordings\n // If set too low, it could take long pauses before detecting silence or\n // not detect it at all.\n // Reasonable values seem to be between 0.001 and 0.003\n quietThreshold: 0.002,\n\n // time before automatically stopping the recording when\n // there's silence. This is compared to a slow decaying\n // sample level so its's value is relative to sound over\n // a period of time. Reasonable times seem to be between 0.2 and 0.5\n quietTimeMin: 0.3,\n\n // volume threshold in db to determine if there's silence.\n // Volume levels lower than this would trigger a silent event\n // Works in conjuction with `quietThreshold`. Lower (negative) values\n // cause the silence detection to converge faster\n // Reasonable values seem to be between -75 and -55\n volumeThreshold: -65,\n\n // use automatic mute detection\n useAutoMuteDetect: false,\n },\n\n converser: {\n // used to control maximum number of consecutive silent recordings\n // before the conversation is ended\n silentConsecutiveRecordingMax: 3,\n },\n\n // URL query parameters are put in here at run time\n urlQueryParams: {},\n};\n\n/**\n * Obtains the URL query params and returns it as an object\n * This can be used before the router has been setup\n */\nfunction getUrlQueryParams(url) {\n try {\n return url\n .split('?', 2) // split query string up to a max of 2 elems\n .slice(1, 2) // grab what's after the '?' char\n // split params separated by '&'\n .reduce((params, queryString) => queryString.split('&'), [])\n // further split into key value pairs separated by '='\n .map(params => params.split('='))\n // turn into an object representing the URL query key/vals\n .reduce((queryObj, param) => {\n const [key, value = true] = param;\n const paramObj = {\n [key]: decodeURIComponent(value),\n };\n return { ...queryObj, ...paramObj };\n }, {});\n } catch (e) {\n console.error('error obtaining URL query parameters', e);\n return {};\n }\n}\n\n/**\n * Obtains and parses the config URL parameter\n */\nfunction getConfigFromQuery(query) {\n try {\n return (query.lexWebUiConfig) ? JSON.parse(query.lexWebUiConfig) : {};\n } catch (e) {\n console.error('error parsing config from URL query', e);\n return {};\n }\n}\n\n/**\n * Merge two configuration objects\n * The merge process takes the base config as the source for keys to be merged\n * The values in srcConfig take precedence in the merge.\n * Merges down to the second level\n */\nexport function mergeConfig(configBase, configSrc) {\n // iterate over the keys of the config base\n return Object.keys(configBase)\n .map((key) => {\n // only grab keys that already exist in the config base\n const value = (key in configSrc) ?\n // merge the second level key/values\n // overriding the base values with the ones from the source\n { ...configBase[key], ...configSrc[key] } :\n configBase[key];\n return { [key]: value };\n })\n // merge the first level key values back into a single object\n .reduce((merged, configItem) => ({ ...merged, ...configItem }), {});\n}\n\n// merge build time parameters\nconst configFromFiles = mergeConfig(configDefault, configEnvFile);\n\n// run time config from url query parameter\nconst queryParams = getUrlQueryParams(window.location.href);\nconst configFromQuery = getConfigFromQuery(queryParams);\n// security: delete origin from dynamic parameter\nif (configFromQuery.ui && configFromQuery.ui.parentOrigin) {\n delete configFromQuery.ui.parentOrigin;\n}\n\nconst configFromMerge = mergeConfig(configFromFiles, configFromQuery);\n\n// if parent origin is empty, assume to be running in the same origin\nconfigFromMerge.ui.parentOrigin = configFromMerge.ui.parentOrigin ||\n window.location.origin;\n\nexport const config = {\n ...configFromMerge,\n urlQueryParams: queryParams,\n};\n\n\n\n// WEBPACK FOOTER //\n// ./src/config/index.js","module.exports = function(it){\n if(typeof it != 'function')throw TypeError(it + ' is not a function!');\n return it;\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/library/modules/_a-function.js\n// module id = 28\n// module chunks = 0","var isObject = require('./_is-object')\n , document = require('./_global').document\n // in old IE typeof document.createElement is 'object'\n , is = isObject(document) && isObject(document.createElement);\nmodule.exports = function(it){\n return is ? document.createElement(it) : {};\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/library/modules/_dom-create.js\n// module id = 29\n// module chunks = 0","// 7.1.1 ToPrimitive(input [, PreferredType])\nvar isObject = require('./_is-object');\n// instead of the ES6 spec version, we didn't implement @@toPrimitive case\n// and the second argument - flag - preferred type is a string\nmodule.exports = function(it, S){\n if(!isObject(it))return it;\n var fn, val;\n if(S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it)))return val;\n if(typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it)))return val;\n if(!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it)))return val;\n throw TypeError(\"Can't convert object to primitive value\");\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/library/modules/_to-primitive.js\n// module id = 30\n// module chunks = 0","// 7.2.1 RequireObjectCoercible(argument)\nmodule.exports = function(it){\n if(it == undefined)throw TypeError(\"Can't call method on \" + it);\n return it;\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/library/modules/_defined.js\n// module id = 31\n// module chunks = 0","// 7.1.15 ToLength\nvar toInteger = require('./_to-integer')\n , min = Math.min;\nmodule.exports = function(it){\n return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/library/modules/_to-length.js\n// module id = 32\n// module chunks = 0","// 7.1.4 ToInteger\nvar ceil = Math.ceil\n , floor = Math.floor;\nmodule.exports = function(it){\n return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it);\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/library/modules/_to-integer.js\n// module id = 33\n// module chunks = 0","var shared = require('./_shared')('keys')\n , uid = require('./_uid');\nmodule.exports = function(key){\n return shared[key] || (shared[key] = uid(key));\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/library/modules/_shared-key.js\n// module id = 34\n// module chunks = 0","var global = require('./_global')\n , SHARED = '__core-js_shared__'\n , store = global[SHARED] || (global[SHARED] = {});\nmodule.exports = function(key){\n return store[key] || (store[key] = {});\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/library/modules/_shared.js\n// module id = 35\n// module chunks = 0","// IE 8- don't enum bug keys\nmodule.exports = (\n 'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf'\n).split(',');\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/library/modules/_enum-bug-keys.js\n// module id = 36\n// module chunks = 0","exports.f = Object.getOwnPropertySymbols;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/library/modules/_object-gops.js\n// module id = 37\n// module chunks = 0","\"use strict\";\n\nexports.__esModule = true;\n\nexports.default = function (instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/babel-runtime/helpers/classCallCheck.js\n// module id = 38\n// module chunks = 0","module.exports = { \"default\": require(\"core-js/library/fn/object/define-property\"), __esModule: true };\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/babel-runtime/core-js/object/define-property.js\n// module id = 39\n// module chunks = 0","// getting tag from 19.1.3.6 Object.prototype.toString()\nvar cof = require('./_cof')\n , TAG = require('./_wks')('toStringTag')\n // ES3 wrong here\n , ARG = cof(function(){ return arguments; }()) == 'Arguments';\n\n// fallback for IE11 Script Access Denied error\nvar tryGet = function(it, key){\n try {\n return it[key];\n } catch(e){ /* empty */ }\n};\n\nmodule.exports = function(it){\n var O, T, B;\n return it === undefined ? 'Undefined' : it === null ? 'Null'\n // @@toStringTag case\n : typeof (T = tryGet(O = Object(it), TAG)) == 'string' ? T\n // builtinTag case\n : ARG ? cof(O)\n // ES3 arguments fallback\n : (B = cof(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : B;\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/library/modules/_classof.js\n// module id = 40\n// module chunks = 0","var classof = require('./_classof')\n , ITERATOR = require('./_wks')('iterator')\n , Iterators = require('./_iterators');\nmodule.exports = require('./_core').getIteratorMethod = function(it){\n if(it != undefined)return it[ITERATOR]\n || it['@@iterator']\n || Iterators[classof(it)];\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/library/modules/core.get-iterator-method.js\n// module id = 41\n// module chunks = 0","exports.f = require('./_wks');\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/library/modules/_wks-ext.js\n// module id = 42\n// module chunks = 0","var global = require('./_global')\n , core = require('./_core')\n , LIBRARY = require('./_library')\n , wksExt = require('./_wks-ext')\n , defineProperty = require('./_object-dp').f;\nmodule.exports = function(name){\n var $Symbol = core.Symbol || (core.Symbol = LIBRARY ? {} : global.Symbol || {});\n if(name.charAt(0) != '_' && !(name in $Symbol))defineProperty($Symbol, name, {value: wksExt.f(name)});\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/library/modules/_wks-define.js\n// module id = 43\n// module chunks = 0","module.exports = { \"default\": require(\"core-js/library/fn/object/assign\"), __esModule: true };\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/babel-runtime/core-js/object/assign.js\n// module id = 44\n// module chunks = 0","module.exports = !require('./_descriptors') && !require('./_fails')(function(){\n return Object.defineProperty(require('./_dom-create')('div'), 'a', {get: function(){ return 7; }}).a != 7;\n});\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/library/modules/_ie8-dom-define.js\n// module id = 45\n// module chunks = 0","var has = require('./_has')\n , toIObject = require('./_to-iobject')\n , arrayIndexOf = require('./_array-includes')(false)\n , IE_PROTO = require('./_shared-key')('IE_PROTO');\n\nmodule.exports = function(object, names){\n var O = toIObject(object)\n , i = 0\n , result = []\n , key;\n for(key in O)if(key != IE_PROTO)has(O, key) && result.push(key);\n // Don't enum bug & hidden keys\n while(names.length > i)if(has(O, key = names[i++])){\n ~arrayIndexOf(result, key) || result.push(key);\n }\n return result;\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/library/modules/_object-keys-internal.js\n// module id = 46\n// module chunks = 0","// fallback for non-array-like ES3 and non-enumerable old V8 strings\nvar cof = require('./_cof');\nmodule.exports = Object('z').propertyIsEnumerable(0) ? Object : function(it){\n return cof(it) == 'String' ? it.split('') : Object(it);\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/library/modules/_iobject.js\n// module id = 47\n// module chunks = 0","'use strict';\nvar LIBRARY = require('./_library')\n , $export = require('./_export')\n , redefine = require('./_redefine')\n , hide = require('./_hide')\n , has = require('./_has')\n , Iterators = require('./_iterators')\n , $iterCreate = require('./_iter-create')\n , setToStringTag = require('./_set-to-string-tag')\n , getPrototypeOf = require('./_object-gpo')\n , ITERATOR = require('./_wks')('iterator')\n , BUGGY = !([].keys && 'next' in [].keys()) // Safari has buggy iterators w/o `next`\n , FF_ITERATOR = '@@iterator'\n , KEYS = 'keys'\n , VALUES = 'values';\n\nvar returnThis = function(){ return this; };\n\nmodule.exports = function(Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED){\n $iterCreate(Constructor, NAME, next);\n var getMethod = function(kind){\n if(!BUGGY && kind in proto)return proto[kind];\n switch(kind){\n case KEYS: return function keys(){ return new Constructor(this, kind); };\n case VALUES: return function values(){ return new Constructor(this, kind); };\n } return function entries(){ return new Constructor(this, kind); };\n };\n var TAG = NAME + ' Iterator'\n , DEF_VALUES = DEFAULT == VALUES\n , VALUES_BUG = false\n , proto = Base.prototype\n , $native = proto[ITERATOR] || proto[FF_ITERATOR] || DEFAULT && proto[DEFAULT]\n , $default = $native || getMethod(DEFAULT)\n , $entries = DEFAULT ? !DEF_VALUES ? $default : getMethod('entries') : undefined\n , $anyNative = NAME == 'Array' ? proto.entries || $native : $native\n , methods, key, IteratorPrototype;\n // Fix native\n if($anyNative){\n IteratorPrototype = getPrototypeOf($anyNative.call(new Base));\n if(IteratorPrototype !== Object.prototype){\n // Set @@toStringTag to native iterators\n setToStringTag(IteratorPrototype, TAG, true);\n // fix for some old engines\n if(!LIBRARY && !has(IteratorPrototype, ITERATOR))hide(IteratorPrototype, ITERATOR, returnThis);\n }\n }\n // fix Array#{values, @@iterator}.name in V8 / FF\n if(DEF_VALUES && $native && $native.name !== VALUES){\n VALUES_BUG = true;\n $default = function values(){ return $native.call(this); };\n }\n // Define iterator\n if((!LIBRARY || FORCED) && (BUGGY || VALUES_BUG || !proto[ITERATOR])){\n hide(proto, ITERATOR, $default);\n }\n // Plug for library\n Iterators[NAME] = $default;\n Iterators[TAG] = returnThis;\n if(DEFAULT){\n methods = {\n values: DEF_VALUES ? $default : getMethod(VALUES),\n keys: IS_SET ? $default : getMethod(KEYS),\n entries: $entries\n };\n if(FORCED)for(key in methods){\n if(!(key in proto))redefine(proto, key, methods[key]);\n } else $export($export.P + $export.F * (BUGGY || VALUES_BUG), NAME, methods);\n }\n return methods;\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/library/modules/_iter-define.js\n// module id = 49\n// module chunks = 0","module.exports = require('./_hide');\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/library/modules/_redefine.js\n// module id = 50\n// module chunks = 0","// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])\nvar anObject = require('./_an-object')\n , dPs = require('./_object-dps')\n , enumBugKeys = require('./_enum-bug-keys')\n , IE_PROTO = require('./_shared-key')('IE_PROTO')\n , Empty = function(){ /* empty */ }\n , PROTOTYPE = 'prototype';\n\n// Create object with fake `null` prototype: use iframe Object with cleared prototype\nvar createDict = function(){\n // Thrash, waste and sodomy: IE GC bug\n var iframe = require('./_dom-create')('iframe')\n , i = enumBugKeys.length\n , lt = '<'\n , gt = '>'\n , iframeDocument;\n iframe.style.display = 'none';\n require('./_html').appendChild(iframe);\n iframe.src = 'javascript:'; // eslint-disable-line no-script-url\n // createDict = iframe.contentWindow.Object;\n // html.removeChild(iframe);\n iframeDocument = iframe.contentWindow.document;\n iframeDocument.open();\n iframeDocument.write(lt + 'script' + gt + 'document.F=Object' + lt + '/script' + gt);\n iframeDocument.close();\n createDict = iframeDocument.F;\n while(i--)delete createDict[PROTOTYPE][enumBugKeys[i]];\n return createDict();\n};\n\nmodule.exports = Object.create || function create(O, Properties){\n var result;\n if(O !== null){\n Empty[PROTOTYPE] = anObject(O);\n result = new Empty;\n Empty[PROTOTYPE] = null;\n // add \"__proto__\" for Object.getPrototypeOf polyfill\n result[IE_PROTO] = O;\n } else result = createDict();\n return Properties === undefined ? result : dPs(result, Properties);\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/library/modules/_object-create.js\n// module id = 51\n// module chunks = 0","module.exports = require('./_global').document && document.documentElement;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/library/modules/_html.js\n// module id = 52\n// module chunks = 0","// call something on iterator step with safe closing on error\nvar anObject = require('./_an-object');\nmodule.exports = function(iterator, fn, value, entries){\n try {\n return entries ? fn(anObject(value)[0], value[1]) : fn(value);\n // 7.4.6 IteratorClose(iterator, completion)\n } catch(e){\n var ret = iterator['return'];\n if(ret !== undefined)anObject(ret.call(iterator));\n throw e;\n }\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/library/modules/_iter-call.js\n// module id = 53\n// module chunks = 0","// check on default Array iterator\nvar Iterators = require('./_iterators')\n , ITERATOR = require('./_wks')('iterator')\n , ArrayProto = Array.prototype;\n\nmodule.exports = function(it){\n return it !== undefined && (Iterators.Array === it || ArrayProto[ITERATOR] === it);\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/library/modules/_is-array-iter.js\n// module id = 54\n// module chunks = 0","var ctx = require('./_ctx')\n , invoke = require('./_invoke')\n , html = require('./_html')\n , cel = require('./_dom-create')\n , global = require('./_global')\n , process = global.process\n , setTask = global.setImmediate\n , clearTask = global.clearImmediate\n , MessageChannel = global.MessageChannel\n , counter = 0\n , queue = {}\n , ONREADYSTATECHANGE = 'onreadystatechange'\n , defer, channel, port;\nvar run = function(){\n var id = +this;\n if(queue.hasOwnProperty(id)){\n var fn = queue[id];\n delete queue[id];\n fn();\n }\n};\nvar listener = function(event){\n run.call(event.data);\n};\n// Node.js 0.9+ & IE10+ has setImmediate, otherwise:\nif(!setTask || !clearTask){\n setTask = function setImmediate(fn){\n var args = [], i = 1;\n while(arguments.length > i)args.push(arguments[i++]);\n queue[++counter] = function(){\n invoke(typeof fn == 'function' ? fn : Function(fn), args);\n };\n defer(counter);\n return counter;\n };\n clearTask = function clearImmediate(id){\n delete queue[id];\n };\n // Node.js 0.8-\n if(require('./_cof')(process) == 'process'){\n defer = function(id){\n process.nextTick(ctx(run, id, 1));\n };\n // Browsers with MessageChannel, includes WebWorkers\n } else if(MessageChannel){\n channel = new MessageChannel;\n port = channel.port2;\n channel.port1.onmessage = listener;\n defer = ctx(port.postMessage, port, 1);\n // Browsers with postMessage, skip WebWorkers\n // IE8 has postMessage, but it's sync & typeof its postMessage is 'object'\n } else if(global.addEventListener && typeof postMessage == 'function' && !global.importScripts){\n defer = function(id){\n global.postMessage(id + '', '*');\n };\n global.addEventListener('message', listener, false);\n // IE8-\n } else if(ONREADYSTATECHANGE in cel('script')){\n defer = function(id){\n html.appendChild(cel('script'))[ONREADYSTATECHANGE] = function(){\n html.removeChild(this);\n run.call(id);\n };\n };\n // Rest old browsers\n } else {\n defer = function(id){\n setTimeout(ctx(run, id, 1), 0);\n };\n }\n}\nmodule.exports = {\n set: setTask,\n clear: clearTask\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/library/modules/_task.js\n// module id = 55\n// module chunks = 0","var ITERATOR = require('./_wks')('iterator')\n , SAFE_CLOSING = false;\n\ntry {\n var riter = [7][ITERATOR]();\n riter['return'] = function(){ SAFE_CLOSING = true; };\n Array.from(riter, function(){ throw 2; });\n} catch(e){ /* empty */ }\n\nmodule.exports = function(exec, skipClosing){\n if(!skipClosing && !SAFE_CLOSING)return false;\n var safe = false;\n try {\n var arr = [7]\n , iter = arr[ITERATOR]();\n iter.next = function(){ return {done: safe = true}; };\n arr[ITERATOR] = function(){ return iter; };\n exec(arr);\n } catch(e){ /* empty */ }\n return safe;\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/library/modules/_iter-detect.js\n// module id = 56\n// module chunks = 0","\"use strict\";\n\nexports.__esModule = true;\n\nvar _isIterable2 = require(\"../core-js/is-iterable\");\n\nvar _isIterable3 = _interopRequireDefault(_isIterable2);\n\nvar _getIterator2 = require(\"../core-js/get-iterator\");\n\nvar _getIterator3 = _interopRequireDefault(_getIterator2);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nexports.default = function () {\n function sliceIterator(arr, i) {\n var _arr = [];\n var _n = true;\n var _d = false;\n var _e = undefined;\n\n try {\n for (var _i = (0, _getIterator3.default)(arr), _s; !(_n = (_s = _i.next()).done); _n = true) {\n _arr.push(_s.value);\n\n if (i && _arr.length === i) break;\n }\n } catch (err) {\n _d = true;\n _e = err;\n } finally {\n try {\n if (!_n && _i[\"return\"]) _i[\"return\"]();\n } finally {\n if (_d) throw _e;\n }\n }\n\n return _arr;\n }\n\n return function (arr, i) {\n if (Array.isArray(arr)) {\n return arr;\n } else if ((0, _isIterable3.default)(Object(arr))) {\n return sliceIterator(arr, i);\n } else {\n throw new TypeError(\"Invalid attempt to destructure non-iterable instance\");\n }\n };\n}();\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/babel-runtime/helpers/slicedToArray.js\n// module id = 57\n// module chunks = 0","// 19.1.2.7 / 15.2.3.4 Object.getOwnPropertyNames(O)\nvar $keys = require('./_object-keys-internal')\n , hiddenKeys = require('./_enum-bug-keys').concat('length', 'prototype');\n\nexports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O){\n return $keys(O, hiddenKeys);\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/library/modules/_object-gopn.js\n// module id = 58\n// module chunks = 0","\"use strict\";\n\nexports.__esModule = true;\n\nvar _defineProperty = require(\"../core-js/object/define-property\");\n\nvar _defineProperty2 = _interopRequireDefault(_defineProperty);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nexports.default = function () {\n function defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n (0, _defineProperty2.default)(target, descriptor.key, descriptor);\n }\n }\n\n return function (Constructor, protoProps, staticProps) {\n if (protoProps) defineProperties(Constructor.prototype, protoProps);\n if (staticProps) defineProperties(Constructor, staticProps);\n return Constructor;\n };\n}();\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/babel-runtime/helpers/createClass.js\n// module id = 59\n// module chunks = 0","/*\nCopyright 2017-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n\nLicensed under the Amazon Software License (the \"License\"). You may not use this file\nexcept in compliance with the License. A copy of the License is located at\n\nhttp://aws.amazon.com/asl/\n\nor in the \"license\" file accompanying this file. This file is distributed on an \"AS IS\"\nBASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, express or implied. See the\nLicense for the specific language governing permissions and limitations under the License.\n*/\n\n/**\n * Entry point to the lex-web-ui Vue plugin\n * Exports Loader as the plugin constructor\n * and Store as store that can be used with Vuex.Store()\n */\nimport Vue from 'vue';\nimport Vuex from 'vuex';\nimport { Config as AWSConfig, CognitoIdentityCredentials }\n from 'aws-sdk/global';\nimport LexRuntime from 'aws-sdk/clients/lexruntime';\nimport Polly from 'aws-sdk/clients/polly';\n\nimport LexWeb from '@/components/LexWeb';\nimport VuexStore from '@/store';\nimport { config as defaultConfig } from '@/config';\n\n/**\n * Vue Component\n */\nconst Component = {\n name: 'lex-web-ui',\n template: '',\n components: { LexWeb },\n};\n\nconst loadingComponent = {\n template: '

Loading. Please wait...

',\n};\nconst errorComponent = {\n template: '

An error ocurred...

',\n};\n\n/**\n * Vue Asynchonous Component\n */\nconst AsyncComponent = ({\n component = Promise.resolve(Component),\n loading = loadingComponent,\n error = errorComponent,\n delay = 200,\n timeout = 10000,\n}) => ({\n // must be a promise\n component,\n // A component to use while the async component is loading\n loading,\n // A component to use if the load fails\n error,\n // Delay before showing the loading component. Default: 200ms.\n delay,\n // The error component will be displayed if a timeout is\n // provided and exceeded. Default: 10000ms.\n timeout,\n});\n\n/**\n * Vue Plugin\n */\nconst Plugin = {\n install(VueConstructor, {\n name = '$lexWebUi',\n componentName = 'lex-web-ui',\n awsConfig,\n lexRuntimeClient,\n pollyClient,\n component = AsyncComponent,\n config = defaultConfig,\n }) {\n // values to be added to custom vue property\n const value = {\n awsConfig,\n lexRuntimeClient,\n pollyClient,\n config,\n };\n // add custom property to Vue\n // for example, access this in a component via this.$lexWebUi\n Object.defineProperty(VueConstructor.prototype, name, { value });\n // register as a global component\n VueConstructor.component(componentName, component);\n },\n};\n\nexport const Store = VuexStore;\n\n/**\n * Main Class\n */\nexport class Loader {\n constructor(config) {\n // TODO deep merge configs\n this.config = {\n ...defaultConfig,\n ...config,\n };\n\n // TODO move this to a function (possibly a reducer)\n const AWSConfigConstructor = (window.AWS && window.AWS.Config) ?\n window.AWS.Config :\n AWSConfig;\n\n const CognitoConstructor =\n (window.AWS && window.AWS.CognitoIdentityCredentials) ?\n window.AWS.CognitoIdentityCredentials :\n CognitoIdentityCredentials;\n\n const PollyConstructor = (window.AWS && window.AWS.Polly) ?\n window.AWS.Polly :\n Polly;\n\n const LexRuntimeConstructor = (window.AWS && window.AWS.LexRuntime) ?\n window.AWS.LexRuntime :\n LexRuntime;\n\n if (!AWSConfigConstructor || !CognitoConstructor || !PollyConstructor\n || !LexRuntimeConstructor) {\n throw new Error('unable to find AWS SDK');\n }\n\n const credentials = new CognitoConstructor(\n { IdentityPoolId: this.config.cognito.poolId },\n { region: this.config.region },\n );\n\n const awsConfig = new AWSConfigConstructor({\n region: this.config.region,\n credentials,\n });\n\n const lexRuntimeClient = new LexRuntimeConstructor(awsConfig);\n const pollyClient = (this.config.recorder.enable) ?\n new PollyConstructor(awsConfig) : null;\n\n const VueConstructor = (window.Vue) ? window.Vue : Vue;\n if (!VueConstructor) {\n throw new Error('unable to find Vue');\n }\n\n const VuexConstructor = (window.Vuex) ? window.Vuex : Vuex;\n if (!VuexConstructor) {\n throw new Error('unable to find Vue');\n }\n\n // TODO name space store\n this.store = new VuexConstructor.Store(VuexStore);\n\n VueConstructor.use(Plugin, {\n awsConfig,\n lexRuntimeClient,\n pollyClient,\n });\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/lex-web-ui.js","require('../../modules/es6.object.assign');\nmodule.exports = require('../../modules/_core').Object.assign;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/library/fn/object/assign.js\n// module id = 61\n// module chunks = 0","// 19.1.3.1 Object.assign(target, source)\nvar $export = require('./_export');\n\n$export($export.S + $export.F, 'Object', {assign: require('./_object-assign')});\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/library/modules/es6.object.assign.js\n// module id = 62\n// module chunks = 0","'use strict';\n// 19.1.2.1 Object.assign(target, source, ...)\nvar getKeys = require('./_object-keys')\n , gOPS = require('./_object-gops')\n , pIE = require('./_object-pie')\n , toObject = require('./_to-object')\n , IObject = require('./_iobject')\n , $assign = Object.assign;\n\n// should work with symbols and should have deterministic property order (V8 bug)\nmodule.exports = !$assign || require('./_fails')(function(){\n var A = {}\n , B = {}\n , S = Symbol()\n , K = 'abcdefghijklmnopqrst';\n A[S] = 7;\n K.split('').forEach(function(k){ B[k] = k; });\n return $assign({}, A)[S] != 7 || Object.keys($assign({}, B)).join('') != K;\n}) ? function assign(target, source){ // eslint-disable-line no-unused-vars\n var T = toObject(target)\n , aLen = arguments.length\n , index = 1\n , getSymbols = gOPS.f\n , isEnum = pIE.f;\n while(aLen > index){\n var S = IObject(arguments[index++])\n , keys = getSymbols ? getKeys(S).concat(getSymbols(S)) : getKeys(S)\n , length = keys.length\n , j = 0\n , key;\n while(length > j)if(isEnum.call(S, key = keys[j++]))T[key] = S[key];\n } return T;\n} : $assign;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/library/modules/_object-assign.js\n// module id = 63\n// module chunks = 0","// false -> Array#indexOf\n// true -> Array#includes\nvar toIObject = require('./_to-iobject')\n , toLength = require('./_to-length')\n , toIndex = require('./_to-index');\nmodule.exports = function(IS_INCLUDES){\n return function($this, el, fromIndex){\n var O = toIObject($this)\n , length = toLength(O.length)\n , index = toIndex(fromIndex, length)\n , value;\n // Array#includes uses SameValueZero equality algorithm\n if(IS_INCLUDES && el != el)while(length > index){\n value = O[index++];\n if(value != value)return true;\n // Array#toIndex ignores holes, Array#includes - not\n } else for(;length > index; index++)if(IS_INCLUDES || index in O){\n if(O[index] === el)return IS_INCLUDES || index || 0;\n } return !IS_INCLUDES && -1;\n };\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/library/modules/_array-includes.js\n// module id = 64\n// module chunks = 0","var toInteger = require('./_to-integer')\n , max = Math.max\n , min = Math.min;\nmodule.exports = function(index, length){\n index = toInteger(index);\n return index < 0 ? max(index + length, 0) : min(index, length);\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/library/modules/_to-index.js\n// module id = 65\n// module chunks = 0","require('../../modules/es6.object.define-property');\nvar $Object = require('../../modules/_core').Object;\nmodule.exports = function defineProperty(it, key, desc){\n return $Object.defineProperty(it, key, desc);\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/library/fn/object/define-property.js\n// module id = 66\n// module chunks = 0","var $export = require('./_export');\n// 19.1.2.4 / 15.2.3.6 Object.defineProperty(O, P, Attributes)\n$export($export.S + $export.F * !require('./_descriptors'), 'Object', {defineProperty: require('./_object-dp').f});\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/library/modules/es6.object.define-property.js\n// module id = 67\n// module chunks = 0","require('../modules/es6.object.to-string');\nrequire('../modules/es6.string.iterator');\nrequire('../modules/web.dom.iterable');\nrequire('../modules/es6.promise');\nmodule.exports = require('../modules/_core').Promise;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/library/fn/promise.js\n// module id = 68\n// module chunks = 0","var toInteger = require('./_to-integer')\n , defined = require('./_defined');\n// true -> String#at\n// false -> String#codePointAt\nmodule.exports = function(TO_STRING){\n return function(that, pos){\n var s = String(defined(that))\n , i = toInteger(pos)\n , l = s.length\n , a, b;\n if(i < 0 || i >= l)return TO_STRING ? '' : undefined;\n a = s.charCodeAt(i);\n return a < 0xd800 || a > 0xdbff || i + 1 === l || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff\n ? TO_STRING ? s.charAt(i) : a\n : TO_STRING ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000;\n };\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/library/modules/_string-at.js\n// module id = 69\n// module chunks = 0","'use strict';\nvar create = require('./_object-create')\n , descriptor = require('./_property-desc')\n , setToStringTag = require('./_set-to-string-tag')\n , IteratorPrototype = {};\n\n// 25.1.2.1.1 %IteratorPrototype%[@@iterator]()\nrequire('./_hide')(IteratorPrototype, require('./_wks')('iterator'), function(){ return this; });\n\nmodule.exports = function(Constructor, NAME, next){\n Constructor.prototype = create(IteratorPrototype, {next: descriptor(1, next)});\n setToStringTag(Constructor, NAME + ' Iterator');\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/library/modules/_iter-create.js\n// module id = 70\n// module chunks = 0","var dP = require('./_object-dp')\n , anObject = require('./_an-object')\n , getKeys = require('./_object-keys');\n\nmodule.exports = require('./_descriptors') ? Object.defineProperties : function defineProperties(O, Properties){\n anObject(O);\n var keys = getKeys(Properties)\n , length = keys.length\n , i = 0\n , P;\n while(length > i)dP.f(O, P = keys[i++], Properties[P]);\n return O;\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/library/modules/_object-dps.js\n// module id = 71\n// module chunks = 0","// 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O)\nvar has = require('./_has')\n , toObject = require('./_to-object')\n , IE_PROTO = require('./_shared-key')('IE_PROTO')\n , ObjectProto = Object.prototype;\n\nmodule.exports = Object.getPrototypeOf || function(O){\n O = toObject(O);\n if(has(O, IE_PROTO))return O[IE_PROTO];\n if(typeof O.constructor == 'function' && O instanceof O.constructor){\n return O.constructor.prototype;\n } return O instanceof Object ? ObjectProto : null;\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/library/modules/_object-gpo.js\n// module id = 72\n// module chunks = 0","'use strict';\nvar addToUnscopables = require('./_add-to-unscopables')\n , step = require('./_iter-step')\n , Iterators = require('./_iterators')\n , toIObject = require('./_to-iobject');\n\n// 22.1.3.4 Array.prototype.entries()\n// 22.1.3.13 Array.prototype.keys()\n// 22.1.3.29 Array.prototype.values()\n// 22.1.3.30 Array.prototype[@@iterator]()\nmodule.exports = require('./_iter-define')(Array, 'Array', function(iterated, kind){\n this._t = toIObject(iterated); // target\n this._i = 0; // next index\n this._k = kind; // kind\n// 22.1.5.2.1 %ArrayIteratorPrototype%.next()\n}, function(){\n var O = this._t\n , kind = this._k\n , index = this._i++;\n if(!O || index >= O.length){\n this._t = undefined;\n return step(1);\n }\n if(kind == 'keys' )return step(0, index);\n if(kind == 'values')return step(0, O[index]);\n return step(0, [index, O[index]]);\n}, 'values');\n\n// argumentsList[@@iterator] is %ArrayProto_values% (9.4.4.6, 9.4.4.7)\nIterators.Arguments = Iterators.Array;\n\naddToUnscopables('keys');\naddToUnscopables('values');\naddToUnscopables('entries');\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/library/modules/es6.array.iterator.js\n// module id = 73\n// module chunks = 0","module.exports = function(){ /* empty */ };\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/library/modules/_add-to-unscopables.js\n// module id = 74\n// module chunks = 0","module.exports = function(done, value){\n return {value: value, done: !!done};\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/library/modules/_iter-step.js\n// module id = 75\n// module chunks = 0","'use strict';\nvar LIBRARY = require('./_library')\n , global = require('./_global')\n , ctx = require('./_ctx')\n , classof = require('./_classof')\n , $export = require('./_export')\n , isObject = require('./_is-object')\n , aFunction = require('./_a-function')\n , anInstance = require('./_an-instance')\n , forOf = require('./_for-of')\n , speciesConstructor = require('./_species-constructor')\n , task = require('./_task').set\n , microtask = require('./_microtask')()\n , PROMISE = 'Promise'\n , TypeError = global.TypeError\n , process = global.process\n , $Promise = global[PROMISE]\n , process = global.process\n , isNode = classof(process) == 'process'\n , empty = function(){ /* empty */ }\n , Internal, GenericPromiseCapability, Wrapper;\n\nvar USE_NATIVE = !!function(){\n try {\n // correct subclassing with @@species support\n var promise = $Promise.resolve(1)\n , FakePromise = (promise.constructor = {})[require('./_wks')('species')] = function(exec){ exec(empty, empty); };\n // unhandled rejections tracking support, NodeJS Promise without it fails @@species test\n return (isNode || typeof PromiseRejectionEvent == 'function') && promise.then(empty) instanceof FakePromise;\n } catch(e){ /* empty */ }\n}();\n\n// helpers\nvar sameConstructor = function(a, b){\n // with library wrapper special case\n return a === b || a === $Promise && b === Wrapper;\n};\nvar isThenable = function(it){\n var then;\n return isObject(it) && typeof (then = it.then) == 'function' ? then : false;\n};\nvar newPromiseCapability = function(C){\n return sameConstructor($Promise, C)\n ? new PromiseCapability(C)\n : new GenericPromiseCapability(C);\n};\nvar PromiseCapability = GenericPromiseCapability = function(C){\n var resolve, reject;\n this.promise = new C(function($$resolve, $$reject){\n if(resolve !== undefined || reject !== undefined)throw TypeError('Bad Promise constructor');\n resolve = $$resolve;\n reject = $$reject;\n });\n this.resolve = aFunction(resolve);\n this.reject = aFunction(reject);\n};\nvar perform = function(exec){\n try {\n exec();\n } catch(e){\n return {error: e};\n }\n};\nvar notify = function(promise, isReject){\n if(promise._n)return;\n promise._n = true;\n var chain = promise._c;\n microtask(function(){\n var value = promise._v\n , ok = promise._s == 1\n , i = 0;\n var run = function(reaction){\n var handler = ok ? reaction.ok : reaction.fail\n , resolve = reaction.resolve\n , reject = reaction.reject\n , domain = reaction.domain\n , result, then;\n try {\n if(handler){\n if(!ok){\n if(promise._h == 2)onHandleUnhandled(promise);\n promise._h = 1;\n }\n if(handler === true)result = value;\n else {\n if(domain)domain.enter();\n result = handler(value);\n if(domain)domain.exit();\n }\n if(result === reaction.promise){\n reject(TypeError('Promise-chain cycle'));\n } else if(then = isThenable(result)){\n then.call(result, resolve, reject);\n } else resolve(result);\n } else reject(value);\n } catch(e){\n reject(e);\n }\n };\n while(chain.length > i)run(chain[i++]); // variable length - can't use forEach\n promise._c = [];\n promise._n = false;\n if(isReject && !promise._h)onUnhandled(promise);\n });\n};\nvar onUnhandled = function(promise){\n task.call(global, function(){\n var value = promise._v\n , abrupt, handler, console;\n if(isUnhandled(promise)){\n abrupt = perform(function(){\n if(isNode){\n process.emit('unhandledRejection', value, promise);\n } else if(handler = global.onunhandledrejection){\n handler({promise: promise, reason: value});\n } else if((console = global.console) && console.error){\n console.error('Unhandled promise rejection', value);\n }\n });\n // Browsers should not trigger `rejectionHandled` event if it was handled here, NodeJS - should\n promise._h = isNode || isUnhandled(promise) ? 2 : 1;\n } promise._a = undefined;\n if(abrupt)throw abrupt.error;\n });\n};\nvar isUnhandled = function(promise){\n if(promise._h == 1)return false;\n var chain = promise._a || promise._c\n , i = 0\n , reaction;\n while(chain.length > i){\n reaction = chain[i++];\n if(reaction.fail || !isUnhandled(reaction.promise))return false;\n } return true;\n};\nvar onHandleUnhandled = function(promise){\n task.call(global, function(){\n var handler;\n if(isNode){\n process.emit('rejectionHandled', promise);\n } else if(handler = global.onrejectionhandled){\n handler({promise: promise, reason: promise._v});\n }\n });\n};\nvar $reject = function(value){\n var promise = this;\n if(promise._d)return;\n promise._d = true;\n promise = promise._w || promise; // unwrap\n promise._v = value;\n promise._s = 2;\n if(!promise._a)promise._a = promise._c.slice();\n notify(promise, true);\n};\nvar $resolve = function(value){\n var promise = this\n , then;\n if(promise._d)return;\n promise._d = true;\n promise = promise._w || promise; // unwrap\n try {\n if(promise === value)throw TypeError(\"Promise can't be resolved itself\");\n if(then = isThenable(value)){\n microtask(function(){\n var wrapper = {_w: promise, _d: false}; // wrap\n try {\n then.call(value, ctx($resolve, wrapper, 1), ctx($reject, wrapper, 1));\n } catch(e){\n $reject.call(wrapper, e);\n }\n });\n } else {\n promise._v = value;\n promise._s = 1;\n notify(promise, false);\n }\n } catch(e){\n $reject.call({_w: promise, _d: false}, e); // wrap\n }\n};\n\n// constructor polyfill\nif(!USE_NATIVE){\n // 25.4.3.1 Promise(executor)\n $Promise = function Promise(executor){\n anInstance(this, $Promise, PROMISE, '_h');\n aFunction(executor);\n Internal.call(this);\n try {\n executor(ctx($resolve, this, 1), ctx($reject, this, 1));\n } catch(err){\n $reject.call(this, err);\n }\n };\n Internal = function Promise(executor){\n this._c = []; // <- awaiting reactions\n this._a = undefined; // <- checked in isUnhandled reactions\n this._s = 0; // <- state\n this._d = false; // <- done\n this._v = undefined; // <- value\n this._h = 0; // <- rejection state, 0 - default, 1 - handled, 2 - unhandled\n this._n = false; // <- notify\n };\n Internal.prototype = require('./_redefine-all')($Promise.prototype, {\n // 25.4.5.3 Promise.prototype.then(onFulfilled, onRejected)\n then: function then(onFulfilled, onRejected){\n var reaction = newPromiseCapability(speciesConstructor(this, $Promise));\n reaction.ok = typeof onFulfilled == 'function' ? onFulfilled : true;\n reaction.fail = typeof onRejected == 'function' && onRejected;\n reaction.domain = isNode ? process.domain : undefined;\n this._c.push(reaction);\n if(this._a)this._a.push(reaction);\n if(this._s)notify(this, false);\n return reaction.promise;\n },\n // 25.4.5.1 Promise.prototype.catch(onRejected)\n 'catch': function(onRejected){\n return this.then(undefined, onRejected);\n }\n });\n PromiseCapability = function(){\n var promise = new Internal;\n this.promise = promise;\n this.resolve = ctx($resolve, promise, 1);\n this.reject = ctx($reject, promise, 1);\n };\n}\n\n$export($export.G + $export.W + $export.F * !USE_NATIVE, {Promise: $Promise});\nrequire('./_set-to-string-tag')($Promise, PROMISE);\nrequire('./_set-species')(PROMISE);\nWrapper = require('./_core')[PROMISE];\n\n// statics\n$export($export.S + $export.F * !USE_NATIVE, PROMISE, {\n // 25.4.4.5 Promise.reject(r)\n reject: function reject(r){\n var capability = newPromiseCapability(this)\n , $$reject = capability.reject;\n $$reject(r);\n return capability.promise;\n }\n});\n$export($export.S + $export.F * (LIBRARY || !USE_NATIVE), PROMISE, {\n // 25.4.4.6 Promise.resolve(x)\n resolve: function resolve(x){\n // instanceof instead of internal slot check because we should fix it without replacement native Promise core\n if(x instanceof $Promise && sameConstructor(x.constructor, this))return x;\n var capability = newPromiseCapability(this)\n , $$resolve = capability.resolve;\n $$resolve(x);\n return capability.promise;\n }\n});\n$export($export.S + $export.F * !(USE_NATIVE && require('./_iter-detect')(function(iter){\n $Promise.all(iter)['catch'](empty);\n})), PROMISE, {\n // 25.4.4.1 Promise.all(iterable)\n all: function all(iterable){\n var C = this\n , capability = newPromiseCapability(C)\n , resolve = capability.resolve\n , reject = capability.reject;\n var abrupt = perform(function(){\n var values = []\n , index = 0\n , remaining = 1;\n forOf(iterable, false, function(promise){\n var $index = index++\n , alreadyCalled = false;\n values.push(undefined);\n remaining++;\n C.resolve(promise).then(function(value){\n if(alreadyCalled)return;\n alreadyCalled = true;\n values[$index] = value;\n --remaining || resolve(values);\n }, reject);\n });\n --remaining || resolve(values);\n });\n if(abrupt)reject(abrupt.error);\n return capability.promise;\n },\n // 25.4.4.4 Promise.race(iterable)\n race: function race(iterable){\n var C = this\n , capability = newPromiseCapability(C)\n , reject = capability.reject;\n var abrupt = perform(function(){\n forOf(iterable, false, function(promise){\n C.resolve(promise).then(capability.resolve, reject);\n });\n });\n if(abrupt)reject(abrupt.error);\n return capability.promise;\n }\n});\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/library/modules/es6.promise.js\n// module id = 76\n// module chunks = 0","module.exports = function(it, Constructor, name, forbiddenField){\n if(!(it instanceof Constructor) || (forbiddenField !== undefined && forbiddenField in it)){\n throw TypeError(name + ': incorrect invocation!');\n } return it;\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/library/modules/_an-instance.js\n// module id = 77\n// module chunks = 0","var ctx = require('./_ctx')\n , call = require('./_iter-call')\n , isArrayIter = require('./_is-array-iter')\n , anObject = require('./_an-object')\n , toLength = require('./_to-length')\n , getIterFn = require('./core.get-iterator-method')\n , BREAK = {}\n , RETURN = {};\nvar exports = module.exports = function(iterable, entries, fn, that, ITERATOR){\n var iterFn = ITERATOR ? function(){ return iterable; } : getIterFn(iterable)\n , f = ctx(fn, that, entries ? 2 : 1)\n , index = 0\n , length, step, iterator, result;\n if(typeof iterFn != 'function')throw TypeError(iterable + ' is not iterable!');\n // fast case for arrays with default iterator\n if(isArrayIter(iterFn))for(length = toLength(iterable.length); length > index; index++){\n result = entries ? f(anObject(step = iterable[index])[0], step[1]) : f(iterable[index]);\n if(result === BREAK || result === RETURN)return result;\n } else for(iterator = iterFn.call(iterable); !(step = iterator.next()).done; ){\n result = call(iterator, f, step.value, entries);\n if(result === BREAK || result === RETURN)return result;\n }\n};\nexports.BREAK = BREAK;\nexports.RETURN = RETURN;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/library/modules/_for-of.js\n// module id = 78\n// module chunks = 0","// 7.3.20 SpeciesConstructor(O, defaultConstructor)\nvar anObject = require('./_an-object')\n , aFunction = require('./_a-function')\n , SPECIES = require('./_wks')('species');\nmodule.exports = function(O, D){\n var C = anObject(O).constructor, S;\n return C === undefined || (S = anObject(C)[SPECIES]) == undefined ? D : aFunction(S);\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/library/modules/_species-constructor.js\n// module id = 79\n// module chunks = 0","// fast apply, http://jsperf.lnkit.com/fast-apply/5\nmodule.exports = function(fn, args, that){\n var un = that === undefined;\n switch(args.length){\n case 0: return un ? fn()\n : fn.call(that);\n case 1: return un ? fn(args[0])\n : fn.call(that, args[0]);\n case 2: return un ? fn(args[0], args[1])\n : fn.call(that, args[0], args[1]);\n case 3: return un ? fn(args[0], args[1], args[2])\n : fn.call(that, args[0], args[1], args[2]);\n case 4: return un ? fn(args[0], args[1], args[2], args[3])\n : fn.call(that, args[0], args[1], args[2], args[3]);\n } return fn.apply(that, args);\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/library/modules/_invoke.js\n// module id = 80\n// module chunks = 0","var global = require('./_global')\n , macrotask = require('./_task').set\n , Observer = global.MutationObserver || global.WebKitMutationObserver\n , process = global.process\n , Promise = global.Promise\n , isNode = require('./_cof')(process) == 'process';\n\nmodule.exports = function(){\n var head, last, notify;\n\n var flush = function(){\n var parent, fn;\n if(isNode && (parent = process.domain))parent.exit();\n while(head){\n fn = head.fn;\n head = head.next;\n try {\n fn();\n } catch(e){\n if(head)notify();\n else last = undefined;\n throw e;\n }\n } last = undefined;\n if(parent)parent.enter();\n };\n\n // Node.js\n if(isNode){\n notify = function(){\n process.nextTick(flush);\n };\n // browsers with MutationObserver\n } else if(Observer){\n var toggle = true\n , node = document.createTextNode('');\n new Observer(flush).observe(node, {characterData: true}); // eslint-disable-line no-new\n notify = function(){\n node.data = toggle = !toggle;\n };\n // environments with maybe non-completely correct, but existent Promise\n } else if(Promise && Promise.resolve){\n var promise = Promise.resolve();\n notify = function(){\n promise.then(flush);\n };\n // for other environments - macrotask based on:\n // - setImmediate\n // - MessageChannel\n // - window.postMessag\n // - onreadystatechange\n // - setTimeout\n } else {\n notify = function(){\n // strange IE + webpack dev server bug - use .call(global)\n macrotask.call(global, flush);\n };\n }\n\n return function(fn){\n var task = {fn: fn, next: undefined};\n if(last)last.next = task;\n if(!head){\n head = task;\n notify();\n } last = task;\n };\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/library/modules/_microtask.js\n// module id = 81\n// module chunks = 0","var hide = require('./_hide');\nmodule.exports = function(target, src, safe){\n for(var key in src){\n if(safe && target[key])target[key] = src[key];\n else hide(target, key, src[key]);\n } return target;\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/library/modules/_redefine-all.js\n// module id = 82\n// module chunks = 0","'use strict';\nvar global = require('./_global')\n , core = require('./_core')\n , dP = require('./_object-dp')\n , DESCRIPTORS = require('./_descriptors')\n , SPECIES = require('./_wks')('species');\n\nmodule.exports = function(KEY){\n var C = typeof core[KEY] == 'function' ? core[KEY] : global[KEY];\n if(DESCRIPTORS && C && !C[SPECIES])dP.f(C, SPECIES, {\n configurable: true,\n get: function(){ return this; }\n });\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/library/modules/_set-species.js\n// module id = 83\n// module chunks = 0","module.exports = __WEBPACK_EXTERNAL_MODULE_84__;\n\n\n//////////////////\n// WEBPACK FOOTER\n// external \"vue\"\n// module id = 84\n// module chunks = 0","module.exports = __WEBPACK_EXTERNAL_MODULE_85__;\n\n\n//////////////////\n// WEBPACK FOOTER\n// external \"vuex\"\n// module id = 85\n// module chunks = 0","module.exports = __WEBPACK_EXTERNAL_MODULE_86__;\n\n\n//////////////////\n// WEBPACK FOOTER\n// external \"aws-sdk/global\"\n// module id = 86\n// module chunks = 0","module.exports = __WEBPACK_EXTERNAL_MODULE_87__;\n\n\n//////////////////\n// WEBPACK FOOTER\n// external \"aws-sdk/clients/lexruntime\"\n// module id = 87\n// module chunks = 0","module.exports = __WEBPACK_EXTERNAL_MODULE_88__;\n\n\n//////////////////\n// WEBPACK FOOTER\n// external \"aws-sdk/clients/polly\"\n// module id = 88\n// module chunks = 0","function injectStyle (ssrContext) {\n require(\"!!../../node_modules/extract-text-webpack-plugin/dist/loader.js?{\\\"omit\\\":1,\\\"remove\\\":true}!vue-style-loader!css-loader?{\\\"minimize\\\":true,\\\"sourceMap\\\":true}!../../node_modules/vue-loader/lib/style-compiler/index?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-4973da9d\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!../../node_modules/vue-loader/lib/selector?type=styles&index=0!./LexWeb.vue\")\n}\nvar normalizeComponent = require(\"!../../node_modules/vue-loader/lib/component-normalizer\")\n/* script */\nimport __vue_script__ from \"!!babel-loader!../../node_modules/vue-loader/lib/selector?type=script&index=0!./LexWeb.vue\"\n/* template */\nimport __vue_template__ from \"!!../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-4973da9d\\\",\\\"hasScoped\\\":false,\\\"transformToRequire\\\":{\\\"video\\\":\\\"src\\\",\\\"source\\\":\\\"src\\\",\\\"img\\\":\\\"src\\\",\\\"image\\\":\\\"xlink:href\\\"}}!../../node_modules/vue-loader/lib/selector?type=template&index=0!./LexWeb.vue\"\n/* styles */\nvar __vue_styles__ = injectStyle\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_template__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/components/LexWeb.vue\n// module id = 89\n// module chunks = 0","// removed by extract-text-webpack-plugin\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/extract-text-webpack-plugin/dist/loader.js?{\"omit\":1,\"remove\":true}!./node_modules/vue-style-loader!./node_modules/css-loader?{\"minimize\":true,\"sourceMap\":true}!./node_modules/vue-loader/lib/style-compiler?{\"vue\":true,\"id\":\"data-v-4973da9d\",\"scoped\":false,\"hasInlineConfig\":false}!./node_modules/vue-loader/lib/selector.js?type=styles&index=0!./src/components/LexWeb.vue\n// module id = 90\n// module chunks = 0","\n\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// LexWeb.vue?70766478","var normalizeComponent = require(\"!../../node_modules/vue-loader/lib/component-normalizer\")\n/* script */\nimport __vue_script__ from \"!!babel-loader!../../node_modules/vue-loader/lib/selector?type=script&index=0!./ToolbarContainer.vue\"\n/* template */\nimport __vue_template__ from \"!!../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-59f58ea4\\\",\\\"hasScoped\\\":false,\\\"transformToRequire\\\":{\\\"video\\\":\\\"src\\\",\\\"source\\\":\\\"src\\\",\\\"img\\\":\\\"src\\\",\\\"image\\\":\\\"xlink:href\\\"}}!../../node_modules/vue-loader/lib/selector?type=template&index=0!./ToolbarContainer.vue\"\n/* styles */\nvar __vue_styles__ = null\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_template__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/components/ToolbarContainer.vue\n// module id = 92\n// module chunks = 0","\n\n\n\n\n\n// WEBPACK FOOTER //\n// ToolbarContainer.vue?afb1d408","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;\n return _c('v-toolbar', {\n class: _vm.toolbarColor,\n attrs: {\n \"dark\": \"\",\n \"dense\": \"\"\n }\n }, [_c('img', {\n attrs: {\n \"src\": _vm.toolbarLogo\n }\n }), _vm._v(\" \"), _c('v-toolbar-title', {\n staticClass: \"hidden-xs-and-down\"\n }, [_vm._v(\"\\n \" + _vm._s(_vm.toolbarTitle) + \"\\n \")]), _vm._v(\" \"), _c('v-spacer'), _vm._v(\" \"), (_vm.$store.state.isRunningEmbedded) ? _c('v-btn', {\n directives: [{\n name: \"tooltip\",\n rawName: \"v-tooltip:left\",\n value: (_vm.toolTipMinimize),\n expression: \"toolTipMinimize\",\n arg: \"left\"\n }],\n attrs: {\n \"icon\": \"\",\n \"light\": \"\"\n },\n nativeOn: {\n \"click\": function($event) {\n _vm.toggleMinimize($event)\n }\n }\n }, [_c('v-icon', [_vm._v(\"\\n \" + _vm._s(_vm.isUiMinimized ? 'arrow_drop_up' : 'arrow_drop_down') + \"\\n \")])], 1) : _vm._e()], 1)\n}\nvar staticRenderFns = []\nvar esExports = { render: render, staticRenderFns: staticRenderFns }\nexport default esExports\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/vue-loader/lib/template-compiler?{\"id\":\"data-v-59f58ea4\",\"hasScoped\":false,\"transformToRequire\":{\"video\":\"src\",\"source\":\"src\",\"img\":\"src\",\"image\":\"xlink:href\"}}!./node_modules/vue-loader/lib/selector.js?type=template&index=0!./src/components/ToolbarContainer.vue\n// module id = 94\n// module chunks = 0","function injectStyle (ssrContext) {\n require(\"!!../../node_modules/extract-text-webpack-plugin/dist/loader.js?{\\\"omit\\\":1,\\\"remove\\\":true}!vue-style-loader!css-loader?{\\\"minimize\\\":true,\\\"sourceMap\\\":true}!../../node_modules/vue-loader/lib/style-compiler/index?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-20b8f18d\\\",\\\"scoped\\\":true,\\\"hasInlineConfig\\\":false}!../../node_modules/vue-loader/lib/selector?type=styles&index=0!./MessageList.vue\")\n}\nvar normalizeComponent = require(\"!../../node_modules/vue-loader/lib/component-normalizer\")\n/* script */\nimport __vue_script__ from \"!!babel-loader!../../node_modules/vue-loader/lib/selector?type=script&index=0!./MessageList.vue\"\n/* template */\nimport __vue_template__ from \"!!../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-20b8f18d\\\",\\\"hasScoped\\\":true,\\\"transformToRequire\\\":{\\\"video\\\":\\\"src\\\",\\\"source\\\":\\\"src\\\",\\\"img\\\":\\\"src\\\",\\\"image\\\":\\\"xlink:href\\\"}}!../../node_modules/vue-loader/lib/selector?type=template&index=0!./MessageList.vue\"\n/* styles */\nvar __vue_styles__ = injectStyle\n/* scopeId */\nvar __vue_scopeId__ = \"data-v-20b8f18d\"\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_template__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/components/MessageList.vue\n// module id = 95\n// module chunks = 0","// removed by extract-text-webpack-plugin\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/extract-text-webpack-plugin/dist/loader.js?{\"omit\":1,\"remove\":true}!./node_modules/vue-style-loader!./node_modules/css-loader?{\"minimize\":true,\"sourceMap\":true}!./node_modules/vue-loader/lib/style-compiler?{\"vue\":true,\"id\":\"data-v-20b8f18d\",\"scoped\":true,\"hasInlineConfig\":false}!./node_modules/vue-loader/lib/selector.js?type=styles&index=0!./src/components/MessageList.vue\n// module id = 96\n// module chunks = 0","\n\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// MessageList.vue?6d850226","function injectStyle (ssrContext) {\n require(\"!!../../node_modules/extract-text-webpack-plugin/dist/loader.js?{\\\"omit\\\":1,\\\"remove\\\":true}!vue-style-loader!css-loader?{\\\"minimize\\\":true,\\\"sourceMap\\\":true}!../../node_modules/vue-loader/lib/style-compiler/index?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-290c8f4f\\\",\\\"scoped\\\":true,\\\"hasInlineConfig\\\":false}!../../node_modules/vue-loader/lib/selector?type=styles&index=0!./Message.vue\")\n}\nvar normalizeComponent = require(\"!../../node_modules/vue-loader/lib/component-normalizer\")\n/* script */\nimport __vue_script__ from \"!!babel-loader!../../node_modules/vue-loader/lib/selector?type=script&index=0!./Message.vue\"\n/* template */\nimport __vue_template__ from \"!!../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-290c8f4f\\\",\\\"hasScoped\\\":true,\\\"transformToRequire\\\":{\\\"video\\\":\\\"src\\\",\\\"source\\\":\\\"src\\\",\\\"img\\\":\\\"src\\\",\\\"image\\\":\\\"xlink:href\\\"}}!../../node_modules/vue-loader/lib/selector?type=template&index=0!./Message.vue\"\n/* styles */\nvar __vue_styles__ = injectStyle\n/* scopeId */\nvar __vue_scopeId__ = \"data-v-290c8f4f\"\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_template__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/components/Message.vue\n// module id = 98\n// module chunks = 0","// removed by extract-text-webpack-plugin\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/extract-text-webpack-plugin/dist/loader.js?{\"omit\":1,\"remove\":true}!./node_modules/vue-style-loader!./node_modules/css-loader?{\"minimize\":true,\"sourceMap\":true}!./node_modules/vue-loader/lib/style-compiler?{\"vue\":true,\"id\":\"data-v-290c8f4f\",\"scoped\":true,\"hasInlineConfig\":false}!./node_modules/vue-loader/lib/selector.js?type=styles&index=0!./src/components/Message.vue\n// module id = 99\n// module chunks = 0","\n\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// Message.vue?399feb3b","function injectStyle (ssrContext) {\n require(\"!!../../node_modules/extract-text-webpack-plugin/dist/loader.js?{\\\"omit\\\":1,\\\"remove\\\":true}!vue-style-loader!css-loader?{\\\"minimize\\\":true,\\\"sourceMap\\\":true}!../../node_modules/vue-loader/lib/style-compiler/index?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-d69cb2c8\\\",\\\"scoped\\\":true,\\\"hasInlineConfig\\\":false}!../../node_modules/vue-loader/lib/selector?type=styles&index=0!./MessageText.vue\")\n}\nvar normalizeComponent = require(\"!../../node_modules/vue-loader/lib/component-normalizer\")\n/* script */\nimport __vue_script__ from \"!!babel-loader!../../node_modules/vue-loader/lib/selector?type=script&index=0!./MessageText.vue\"\n/* template */\nimport __vue_template__ from \"!!../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-d69cb2c8\\\",\\\"hasScoped\\\":true,\\\"transformToRequire\\\":{\\\"video\\\":\\\"src\\\",\\\"source\\\":\\\"src\\\",\\\"img\\\":\\\"src\\\",\\\"image\\\":\\\"xlink:href\\\"}}!../../node_modules/vue-loader/lib/selector?type=template&index=0!./MessageText.vue\"\n/* styles */\nvar __vue_styles__ = injectStyle\n/* scopeId */\nvar __vue_scopeId__ = \"data-v-d69cb2c8\"\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_template__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/components/MessageText.vue\n// module id = 101\n// module chunks = 0","// removed by extract-text-webpack-plugin\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/extract-text-webpack-plugin/dist/loader.js?{\"omit\":1,\"remove\":true}!./node_modules/vue-style-loader!./node_modules/css-loader?{\"minimize\":true,\"sourceMap\":true}!./node_modules/vue-loader/lib/style-compiler?{\"vue\":true,\"id\":\"data-v-d69cb2c8\",\"scoped\":true,\"hasInlineConfig\":false}!./node_modules/vue-loader/lib/selector.js?type=styles&index=0!./src/components/MessageText.vue\n// module id = 102\n// module chunks = 0","\n\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// MessageText.vue?290ab3c0","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;\n return (_vm.message.text && _vm.message.type === 'human') ? _c('div', {\n staticClass: \"message-text\"\n }, [_vm._v(\"\\n \" + _vm._s(_vm.message.text) + \"\\n\")]) : (_vm.message.text && _vm.shouldRenderAsHtml) ? _c('div', {\n staticClass: \"message-text\",\n domProps: {\n \"innerHTML\": _vm._s(_vm.botMessageAsHtml)\n }\n }) : (_vm.message.text && _vm.message.type === 'bot') ? _c('div', {\n staticClass: \"message-text\"\n }, [_vm._v(\"\\n \" + _vm._s((_vm.shouldStripTags) ? _vm.stripTagsFromMessage(_vm.message.text) : _vm.message.text) + \"\\n\")]) : _vm._e()\n}\nvar staticRenderFns = []\nvar esExports = { render: render, staticRenderFns: staticRenderFns }\nexport default esExports\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/vue-loader/lib/template-compiler?{\"id\":\"data-v-d69cb2c8\",\"hasScoped\":true,\"transformToRequire\":{\"video\":\"src\",\"source\":\"src\",\"img\":\"src\",\"image\":\"xlink:href\"}}!./node_modules/vue-loader/lib/selector.js?type=template&index=0!./src/components/MessageText.vue\n// module id = 104\n// module chunks = 0","function injectStyle (ssrContext) {\n require(\"!!../../node_modules/extract-text-webpack-plugin/dist/loader.js?{\\\"omit\\\":1,\\\"remove\\\":true}!vue-style-loader!css-loader?{\\\"minimize\\\":true,\\\"sourceMap\\\":true}!../../node_modules/vue-loader/lib/style-compiler/index?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-799b9a4e\\\",\\\"scoped\\\":true,\\\"hasInlineConfig\\\":false}!../../node_modules/vue-loader/lib/selector?type=styles&index=0!./ResponseCard.vue\")\n}\nvar normalizeComponent = require(\"!../../node_modules/vue-loader/lib/component-normalizer\")\n/* script */\nimport __vue_script__ from \"!!babel-loader!../../node_modules/vue-loader/lib/selector?type=script&index=0!./ResponseCard.vue\"\n/* template */\nimport __vue_template__ from \"!!../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-799b9a4e\\\",\\\"hasScoped\\\":true,\\\"transformToRequire\\\":{\\\"video\\\":\\\"src\\\",\\\"source\\\":\\\"src\\\",\\\"img\\\":\\\"src\\\",\\\"image\\\":\\\"xlink:href\\\"}}!../../node_modules/vue-loader/lib/selector?type=template&index=0!./ResponseCard.vue\"\n/* styles */\nvar __vue_styles__ = injectStyle\n/* scopeId */\nvar __vue_scopeId__ = \"data-v-799b9a4e\"\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_template__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/components/ResponseCard.vue\n// module id = 105\n// module chunks = 0","// removed by extract-text-webpack-plugin\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/extract-text-webpack-plugin/dist/loader.js?{\"omit\":1,\"remove\":true}!./node_modules/vue-style-loader!./node_modules/css-loader?{\"minimize\":true,\"sourceMap\":true}!./node_modules/vue-loader/lib/style-compiler?{\"vue\":true,\"id\":\"data-v-799b9a4e\",\"scoped\":true,\"hasInlineConfig\":false}!./node_modules/vue-loader/lib/selector.js?type=styles&index=0!./src/components/ResponseCard.vue\n// module id = 106\n// module chunks = 0","\n\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// ResponseCard.vue?84bcfc60","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;\n return _c('v-card', [(_vm.responseCard.title.trim()) ? _c('v-card-title', {\n staticClass: \"red lighten-5\",\n attrs: {\n \"primary-title\": \"\"\n }\n }, [_c('span', {\n staticClass: \"headline\"\n }, [_vm._v(_vm._s(_vm.responseCard.title))])]) : _vm._e(), _vm._v(\" \"), (_vm.responseCard.subTitle) ? _c('v-card-text', [_c('span', [_vm._v(_vm._s(_vm.responseCard.subTitle))])]) : _vm._e(), _vm._v(\" \"), (_vm.responseCard.imageUrl) ? _c('v-card-media', {\n attrs: {\n \"src\": _vm.responseCard.imageUrl,\n \"contain\": \"\",\n \"height\": \"33vh\"\n }\n }) : _vm._e(), _vm._v(\" \"), _vm._l((_vm.responseCard.buttons), function(button, index) {\n return _c('v-card-actions', {\n key: index,\n staticClass: \"button-row\",\n attrs: {\n \"actions\": \"\"\n }\n }, [(button.text && button.value) ? _c('v-btn', {\n attrs: {\n \"disabled\": _vm.hasButtonBeenClicked,\n \"default\": \"\"\n },\n nativeOn: {\n \"~click\": function($event) {\n _vm.onButtonClick(button.value)\n }\n }\n }, [_vm._v(\"\\n \" + _vm._s(button.text) + \"\\n \")]) : _vm._e()], 1)\n }), _vm._v(\" \"), (_vm.responseCard.attachmentLinkUrl) ? _c('v-card-actions', [_c('v-btn', {\n staticClass: \"red lighten-5\",\n attrs: {\n \"flat\": \"\",\n \"tag\": \"a\",\n \"href\": _vm.responseCard.attachmentLinkUrl,\n \"target\": \"_blank\"\n }\n }, [_vm._v(\"\\n Open Link\\n \")])], 1) : _vm._e()], 2)\n}\nvar staticRenderFns = []\nvar esExports = { render: render, staticRenderFns: staticRenderFns }\nexport default esExports\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/vue-loader/lib/template-compiler?{\"id\":\"data-v-799b9a4e\",\"hasScoped\":true,\"transformToRequire\":{\"video\":\"src\",\"source\":\"src\",\"img\":\"src\",\"image\":\"xlink:href\"}}!./node_modules/vue-loader/lib/selector.js?type=template&index=0!./src/components/ResponseCard.vue\n// module id = 108\n// module chunks = 0","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;\n return _c('div', {\n staticClass: \"message\"\n }, [_c('v-chip', [('text' in _vm.message && _vm.message.text !== null && _vm.message.text.length) ? _c('message-text', {\n attrs: {\n \"message\": _vm.message\n }\n }) : _vm._e(), _vm._v(\" \"), (_vm.message.type === 'human' && _vm.message.audio) ? _c('div', [_c('audio', [_c('source', {\n attrs: {\n \"src\": _vm.message.audio,\n \"type\": \"audio/wav\"\n }\n })]), _vm._v(\" \"), _c('v-btn', {\n staticClass: \"black--text\",\n attrs: {\n \"left\": \"\",\n \"icon\": \"\"\n },\n nativeOn: {\n \"click\": function($event) {\n _vm.playAudio($event)\n }\n }\n }, [_c('v-icon', {\n staticClass: \"play-button\"\n }, [_vm._v(\"play_circle_outline\")])], 1)], 1) : _vm._e(), _vm._v(\" \"), (_vm.message.type === 'bot' && _vm.botDialogState) ? _c('v-icon', {\n class: _vm.botDialogState.color + '--text',\n attrs: {\n \"medium\": \"\"\n }\n }, [_vm._v(\"\\n \" + _vm._s(_vm.botDialogState.icon) + \"\\n \")]) : _vm._e()], 1), _vm._v(\" \"), (_vm.shouldDisplayResponseCard) ? _c('div', {\n staticClass: \"response-card\"\n }, _vm._l((_vm.message.responseCard.genericAttachments), function(card, index) {\n return _c('response-card', {\n key: index,\n attrs: {\n \"response-card\": card\n }\n })\n })) : _vm._e()], 1)\n}\nvar staticRenderFns = []\nvar esExports = { render: render, staticRenderFns: staticRenderFns }\nexport default esExports\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/vue-loader/lib/template-compiler?{\"id\":\"data-v-290c8f4f\",\"hasScoped\":true,\"transformToRequire\":{\"video\":\"src\",\"source\":\"src\",\"img\":\"src\",\"image\":\"xlink:href\"}}!./node_modules/vue-loader/lib/selector.js?type=template&index=0!./src/components/Message.vue\n// module id = 109\n// module chunks = 0","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;\n return _c('v-layout', {\n staticClass: \"message-list\"\n }, _vm._l((_vm.messages), function(message) {\n return _c('message', {\n key: message.id,\n class: (\"message-\" + (message.type)),\n attrs: {\n \"message\": message\n }\n })\n }))\n}\nvar staticRenderFns = []\nvar esExports = { render: render, staticRenderFns: staticRenderFns }\nexport default esExports\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/vue-loader/lib/template-compiler?{\"id\":\"data-v-20b8f18d\",\"hasScoped\":true,\"transformToRequire\":{\"video\":\"src\",\"source\":\"src\",\"img\":\"src\",\"image\":\"xlink:href\"}}!./node_modules/vue-loader/lib/selector.js?type=template&index=0!./src/components/MessageList.vue\n// module id = 110\n// module chunks = 0","function injectStyle (ssrContext) {\n require(\"!!../../node_modules/extract-text-webpack-plugin/dist/loader.js?{\\\"omit\\\":1,\\\"remove\\\":true}!vue-style-loader!css-loader?{\\\"minimize\\\":true,\\\"sourceMap\\\":true}!../../node_modules/vue-loader/lib/style-compiler/index?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-2df12d09\\\",\\\"scoped\\\":true,\\\"hasInlineConfig\\\":false}!../../node_modules/vue-loader/lib/selector?type=styles&index=0!./StatusBar.vue\")\n}\nvar normalizeComponent = require(\"!../../node_modules/vue-loader/lib/component-normalizer\")\n/* script */\nimport __vue_script__ from \"!!babel-loader!../../node_modules/vue-loader/lib/selector?type=script&index=0!./StatusBar.vue\"\n/* template */\nimport __vue_template__ from \"!!../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-2df12d09\\\",\\\"hasScoped\\\":true,\\\"transformToRequire\\\":{\\\"video\\\":\\\"src\\\",\\\"source\\\":\\\"src\\\",\\\"img\\\":\\\"src\\\",\\\"image\\\":\\\"xlink:href\\\"}}!../../node_modules/vue-loader/lib/selector?type=template&index=0!./StatusBar.vue\"\n/* styles */\nvar __vue_styles__ = injectStyle\n/* scopeId */\nvar __vue_scopeId__ = \"data-v-2df12d09\"\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_template__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/components/StatusBar.vue\n// module id = 111\n// module chunks = 0","// removed by extract-text-webpack-plugin\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/extract-text-webpack-plugin/dist/loader.js?{\"omit\":1,\"remove\":true}!./node_modules/vue-style-loader!./node_modules/css-loader?{\"minimize\":true,\"sourceMap\":true}!./node_modules/vue-loader/lib/style-compiler?{\"vue\":true,\"id\":\"data-v-2df12d09\",\"scoped\":true,\"hasInlineConfig\":false}!./node_modules/vue-loader/lib/selector.js?type=styles&index=0!./src/components/StatusBar.vue\n// module id = 112\n// module chunks = 0","\n\n\n\n\n\n// WEBPACK FOOTER //\n// StatusBar.vue?6a736d08","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;\n return _c('div', {\n staticClass: \"status-bar white\"\n }, [_c('v-divider'), _vm._v(\" \"), _c('div', {\n staticClass: \"status-text\"\n }, [_c('span', [_vm._v(_vm._s(_vm.statusText))])]), _vm._v(\" \"), _c('div', {\n staticClass: \"voice-controls\"\n }, [_c('transition', {\n attrs: {\n \"css\": false\n },\n on: {\n \"enter\": _vm.enterMeter,\n \"leave\": _vm.leaveMeter\n }\n }, [(_vm.isRecording) ? _c('div', {\n staticClass: \"ml-2 volume-meter\"\n }, [_c('meter', {\n attrs: {\n \"value\": _vm.volume,\n \"min\": \"0.0001\",\n \"low\": \"0.005\",\n \"optimum\": \"0.04\",\n \"high\": \"0.07\",\n \"max\": \"0.09\"\n }\n })]) : _vm._e()])], 1)], 1)\n}\nvar staticRenderFns = []\nvar esExports = { render: render, staticRenderFns: staticRenderFns }\nexport default esExports\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/vue-loader/lib/template-compiler?{\"id\":\"data-v-2df12d09\",\"hasScoped\":true,\"transformToRequire\":{\"video\":\"src\",\"source\":\"src\",\"img\":\"src\",\"image\":\"xlink:href\"}}!./node_modules/vue-loader/lib/selector.js?type=template&index=0!./src/components/StatusBar.vue\n// module id = 114\n// module chunks = 0","function injectStyle (ssrContext) {\n require(\"!!../../node_modules/extract-text-webpack-plugin/dist/loader.js?{\\\"omit\\\":1,\\\"remove\\\":true}!vue-style-loader!css-loader?{\\\"minimize\\\":true,\\\"sourceMap\\\":true}!../../node_modules/vue-loader/lib/style-compiler/index?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-6dd14e82\\\",\\\"scoped\\\":true,\\\"hasInlineConfig\\\":false}!../../node_modules/vue-loader/lib/selector?type=styles&index=0!./InputContainer.vue\")\n}\nvar normalizeComponent = require(\"!../../node_modules/vue-loader/lib/component-normalizer\")\n/* script */\nimport __vue_script__ from \"!!babel-loader!../../node_modules/vue-loader/lib/selector?type=script&index=0!./InputContainer.vue\"\n/* template */\nimport __vue_template__ from \"!!../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-6dd14e82\\\",\\\"hasScoped\\\":true,\\\"transformToRequire\\\":{\\\"video\\\":\\\"src\\\",\\\"source\\\":\\\"src\\\",\\\"img\\\":\\\"src\\\",\\\"image\\\":\\\"xlink:href\\\"}}!../../node_modules/vue-loader/lib/selector?type=template&index=0!./InputContainer.vue\"\n/* styles */\nvar __vue_styles__ = injectStyle\n/* scopeId */\nvar __vue_scopeId__ = \"data-v-6dd14e82\"\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_template__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/components/InputContainer.vue\n// module id = 115\n// module chunks = 0","// removed by extract-text-webpack-plugin\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/extract-text-webpack-plugin/dist/loader.js?{\"omit\":1,\"remove\":true}!./node_modules/vue-style-loader!./node_modules/css-loader?{\"minimize\":true,\"sourceMap\":true}!./node_modules/vue-loader/lib/style-compiler?{\"vue\":true,\"id\":\"data-v-6dd14e82\",\"scoped\":true,\"hasInlineConfig\":false}!./node_modules/vue-loader/lib/selector.js?type=styles&index=0!./src/components/InputContainer.vue\n// module id = 116\n// module chunks = 0","\n\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// InputContainer.vue?3f9ae987","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;\n return _c('div', {\n staticClass: \"input-container white\"\n }, [_c('v-text-field', {\n staticClass: \"black--text ml-2\",\n attrs: {\n \"id\": \"text-input\",\n \"name\": \"text-input\",\n \"label\": _vm.textInputPlaceholder,\n \"single-line\": \"\"\n },\n nativeOn: {\n \"keyup\": function($event) {\n if (!('button' in $event) && _vm._k($event.keyCode, \"enter\", 13)) { return null; }\n $event.stopPropagation();\n _vm.postTextMessage($event)\n }\n },\n model: {\n value: (_vm.textInput),\n callback: function($$v) {\n _vm.textInput = (typeof $$v === 'string' ? $$v.trim() : $$v)\n },\n expression: \"textInput\"\n }\n }), _vm._v(\" \"), (_vm.isRecorderSupported) ? _c('v-btn', {\n directives: [{\n name: \"tooltip\",\n rawName: \"v-tooltip:left\",\n value: ({\n html: 'click to use voice'\n }),\n expression: \"{html: 'click to use voice'}\",\n arg: \"left\"\n }],\n staticClass: \"black--text mic-button\",\n attrs: {\n \"icon\": \"\",\n \"disabled\": _vm.isMicButtonDisabled\n },\n nativeOn: {\n \"click\": function($event) {\n _vm.onMicClick($event)\n }\n }\n }, [_c('v-icon', {\n attrs: {\n \"medium\": \"\"\n }\n }, [_vm._v(_vm._s(_vm.micButtonIcon))])], 1) : _vm._e()], 1)\n}\nvar staticRenderFns = []\nvar esExports = { render: render, staticRenderFns: staticRenderFns }\nexport default esExports\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/vue-loader/lib/template-compiler?{\"id\":\"data-v-6dd14e82\",\"hasScoped\":true,\"transformToRequire\":{\"video\":\"src\",\"source\":\"src\",\"img\":\"src\",\"image\":\"xlink:href\"}}!./node_modules/vue-loader/lib/selector.js?type=template&index=0!./src/components/InputContainer.vue\n// module id = 118\n// module chunks = 0","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;\n return _c('div', {\n attrs: {\n \"id\": \"lex-web\"\n }\n }, [_c('toolbar-container', {\n attrs: {\n \"toolbar-title\": _vm.toolbarTitle,\n \"toolbar-color\": _vm.toolbarColor,\n \"toolbar-logo\": _vm.toolbarLogo,\n \"is-ui-minimized\": _vm.isUiMinimized\n },\n on: {\n \"toggleMinimizeUi\": _vm.toggleMinimizeUi\n }\n }), _vm._v(\" \"), _c('message-list'), _vm._v(\" \"), _c('status-bar'), _vm._v(\" \"), _c('input-container', {\n attrs: {\n \"text-input-placeholder\": _vm.textInputPlaceholder,\n \"initial-text\": _vm.initialText,\n \"initial-speech-instruction\": _vm.initialSpeechInstruction\n }\n })], 1)\n}\nvar staticRenderFns = []\nvar esExports = { render: render, staticRenderFns: staticRenderFns }\nexport default esExports\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/vue-loader/lib/template-compiler?{\"id\":\"data-v-4973da9d\",\"hasScoped\":false,\"transformToRequire\":{\"video\":\"src\",\"source\":\"src\",\"img\":\"src\",\"image\":\"xlink:href\"}}!./node_modules/vue-loader/lib/selector.js?type=template&index=0!./src/components/LexWeb.vue\n// module id = 119\n// module chunks = 0","/*\n Copyright 2017-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n\n Licensed under the Amazon Software License (the \"License\"). You may not use this file\n except in compliance with the License. A copy of the License is located at\n\n http://aws.amazon.com/asl/\n\n or in the \"license\" file accompanying this file. This file is distributed on an \"AS IS\"\n BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, express or implied. See the\n License for the specific language governing permissions and limitations under the License.\n */\n\n/* global atob Blob URL */\n/* eslint no-console: [\"error\", { allow: [\"info\", \"warn\", \"error\"] }] */\n/* eslint no-param-reassign: off */\n\nimport initialState from '@/store/state';\nimport getters from '@/store/getters';\nimport mutations from '@/store/mutations';\nimport actions from '@/store/actions';\n\nexport default {\n // prevent changes outside of mutation handlers\n strict: (process.env.NODE_ENV === 'development'),\n state: initialState,\n getters,\n mutations,\n actions,\n};\n\n\n\n// WEBPACK FOOTER //\n// ./src/store/index.js","/*\nCopyright 2017-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n\nLicensed under the Amazon Software License (the \"License\"). You may not use this file\nexcept in compliance with the License. A copy of the License is located at\n\nhttp://aws.amazon.com/asl/\n\nor in the \"license\" file accompanying this file. This file is distributed on an \"AS IS\"\nBASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, express or implied. See the\nLicense for the specific language governing permissions and limitations under the License.\n*/\n\n/**\n * Sets up the initial state of the store\n */\nimport { config } from '@/config';\n\nexport default {\n version: (process.env.PACKAGE_VERSION) ?\n process.env.PACKAGE_VERSION : '0.0.0',\n lex: {\n acceptFormat: 'audio/ogg',\n dialogState: '',\n isInterrupting: false,\n isProcessing: false,\n inputTranscript: '',\n intentName: '',\n message: '',\n responseCard: null,\n sessionAttributes: config.lex.sessionAttributes,\n slotToElicit: '',\n slots: {},\n },\n messages: [],\n polly: {\n outputFormat: 'ogg_vorbis',\n voiceId: config.polly.voiceId,\n },\n botAudio: {\n canInterrupt: false,\n interruptIntervalId: null,\n autoPlay: false,\n isInterrupting: false,\n isSpeaking: false,\n },\n recState: {\n isConversationGoing: false,\n isInterrupting: false,\n isMicMuted: false,\n isMicQuiet: true,\n isRecorderSupported: false,\n isRecorderEnabled: config.recorder.enable,\n isRecording: false,\n silentRecordingCount: 0,\n },\n\n isRunningEmbedded: false, // am I running in an iframe?\n isUiMinimized: false, // when running embedded, is the iframe minimized?\n config,\n\n awsCreds: {\n provider: 'cognito', // cognito|parentWindow\n },\n};\n\n\n\n// WEBPACK FOOTER //\n// ./src/store/state.js","module.exports = { \"default\": require(\"core-js/library/fn/object/keys\"), __esModule: true };\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/babel-runtime/core-js/object/keys.js\n// module id = 122\n// module chunks = 0","require('../../modules/es6.object.keys');\nmodule.exports = require('../../modules/_core').Object.keys;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/library/fn/object/keys.js\n// module id = 123\n// module chunks = 0","// 19.1.2.14 Object.keys(O)\nvar toObject = require('./_to-object')\n , $keys = require('./_object-keys');\n\nrequire('./_object-sap')('keys', function(){\n return function keys(it){\n return $keys(toObject(it));\n };\n});\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/library/modules/es6.object.keys.js\n// module id = 124\n// module chunks = 0","// most Object methods by ES6 should accept primitives\nvar $export = require('./_export')\n , core = require('./_core')\n , fails = require('./_fails');\nmodule.exports = function(KEY, exec){\n var fn = (core.Object || {})[KEY] || Object[KEY]\n , exp = {};\n exp[KEY] = exec(fn);\n $export($export.S + $export.F * fails(function(){ fn(1); }), 'Object', exp);\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/library/modules/_object-sap.js\n// module id = 125\n// module chunks = 0","\"use strict\";\n\nexports.__esModule = true;\n\nvar _defineProperty = require(\"../core-js/object/define-property\");\n\nvar _defineProperty2 = _interopRequireDefault(_defineProperty);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nexports.default = function (obj, key, value) {\n if (key in obj) {\n (0, _defineProperty2.default)(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/babel-runtime/helpers/defineProperty.js\n// module id = 126\n// module chunks = 0","module.exports = { \"default\": require(\"core-js/library/fn/is-iterable\"), __esModule: true };\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/babel-runtime/core-js/is-iterable.js\n// module id = 127\n// module chunks = 0","require('../modules/web.dom.iterable');\nrequire('../modules/es6.string.iterator');\nmodule.exports = require('../modules/core.is-iterable');\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/library/fn/is-iterable.js\n// module id = 128\n// module chunks = 0","var classof = require('./_classof')\n , ITERATOR = require('./_wks')('iterator')\n , Iterators = require('./_iterators');\nmodule.exports = require('./_core').isIterable = function(it){\n var O = Object(it);\n return O[ITERATOR] !== undefined\n || '@@iterator' in O\n || Iterators.hasOwnProperty(classof(O));\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/library/modules/core.is-iterable.js\n// module id = 129\n// module chunks = 0","module.exports = { \"default\": require(\"core-js/library/fn/get-iterator\"), __esModule: true };\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/babel-runtime/core-js/get-iterator.js\n// module id = 130\n// module chunks = 0","require('../modules/web.dom.iterable');\nrequire('../modules/es6.string.iterator');\nmodule.exports = require('../modules/core.get-iterator');\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/library/fn/get-iterator.js\n// module id = 131\n// module chunks = 0","var anObject = require('./_an-object')\n , get = require('./core.get-iterator-method');\nmodule.exports = require('./_core').getIterator = function(it){\n var iterFn = get(it);\n if(typeof iterFn != 'function')throw TypeError(it + ' is not iterable!');\n return anObject(iterFn.call(it));\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/library/modules/core.get-iterator.js\n// module id = 132\n// module chunks = 0","function webpackEmptyContext(req) {\n\tthrow new Error(\"Cannot find module '\" + req + \"'.\");\n}\nwebpackEmptyContext.keys = function() { return []; };\nwebpackEmptyContext.resolve = webpackEmptyContext;\nmodule.exports = webpackEmptyContext;\nwebpackEmptyContext.id = 133;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/assets nonrecursive ^\\.\\/logo.(png|jpe?g|svg)$\n// module id = 133\n// module chunks = 0","module.exports = \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAQAAABLCVATAAAB4ElEQVRIDeXBz0uTcQDH8c8xLe2SpDVb9AMV7RZCUIdEodAZQrH/oCC65II6FAhu4Oi4sfoPjI6BwU4J/QGKEUQ/NLcYM29pkI/0vJvbHp7vnm19Z0GXXi/pX2GIae5xTn+HWVz2uMT155jANK79o4MeiXlMzySOcVitIkwWF/hIDlOeVcAlS1h2HGIVm08clA23acUt2ZDB5JAmwjgpHEwp2fAQn8OIqriMg+++bDjBNp60DKTxbHFcdozxlYqIDExQscGIWsEVNqmYlIEIFZuMyY4w3/FkZCCDZ5uQbHiEz2FUVYyyi++BbHiKyeEJk0TIsIspJRvu0IqbsqGDNWw+0C47wmRxgXesY1rnPeDykl41xyViROlTGZ0clXiOaV6im06V0U+UGBcVRIyKHHOEVEYE01WV0UuSPBV3FUQU3w5J2lTCLC57fjKjEtp5jIPvuoLoo9YKp1TCEDGmGVQJZ3hLrbOqR55aRQZkYJANaq2pEeYIytGlKrr5QlBCjRBih6AFVZEl6Ac9aowk9aZUwg3qxdUMbawQtKwS3hC0xAE1x2mKBA1zgaACJ/V7DJCjVoIktT7TLzu6WMC0yGtMLziiVjHFMp4CRTxLXNN+MUyCRQp8Y4sCr4hzXv+jX+Z26XqyE0SfAAAAAElFTkSuQmCC\"\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/material-design-icons/maps/2x_web/ic_local_florist_white_18dp.png\n// module id = 134\n// module chunks = 0","function webpackEmptyContext(req) {\n\tthrow new Error(\"Cannot find module '\" + req + \"'.\");\n}\nwebpackEmptyContext.keys = function() { return []; };\nwebpackEmptyContext.resolve = webpackEmptyContext;\nmodule.exports = webpackEmptyContext;\nwebpackEmptyContext.id = 135;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/assets nonrecursive ^\\.\\/favicon.(png|jpe?g|svg|ico)$\n// module id = 135\n// module chunks = 0","var map = {\n\t\"./config.dev.json\": 137,\n\t\"./config.prod.json\": 138,\n\t\"./config.test.json\": 139\n};\nfunction webpackContext(req) {\n\treturn __webpack_require__(webpackContextResolve(req));\n};\nfunction webpackContextResolve(req) {\n\tvar id = map[req];\n\tif(!(id + 1)) // check for number or string\n\t\tthrow new Error(\"Cannot find module '\" + req + \"'.\");\n\treturn id;\n};\nwebpackContext.keys = function webpackContextKeys() {\n\treturn Object.keys(map);\n};\nwebpackContext.resolve = webpackContextResolve;\nmodule.exports = webpackContext;\nwebpackContext.id = 136;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/config ^\\.\\/config\\..*\\.json$\n// module id = 136\n// module chunks = 0","module.exports = {\n\t\"cognito\": {\n\t\t\"poolId\": \"\"\n\t},\n\t\"lex\": {\n\t\t\"botName\": \"WebUiOrderFlowers\",\n\t\t\"initialText\": \"You can ask me for help ordering flowers. Just type \\\"order flowers\\\" or click on the mic and say it.\",\n\t\t\"initialSpeechInstruction\": \"Say 'Order Flowers' to get started.\"\n\t},\n\t\"polly\": {\n\t\t\"voiceId\": \"Salli\"\n\t},\n\t\"ui\": {\n\t\t\"parentOrigin\": \"http://localhost:8080\",\n\t\t\"pageTitle\": \"Order Flowers Bot\",\n\t\t\"toolbarTitle\": \"Order Flowers\"\n\t},\n\t\"recorder\": {\n\t\t\"preset\": \"speech_recognition\"\n\t}\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/config/config.dev.json\n// module id = 137\n// module chunks = 0","module.exports = {\n\t\"cognito\": {\n\t\t\"poolId\": \"\"\n\t},\n\t\"lex\": {\n\t\t\"botName\": \"WebUiOrderFlowers\",\n\t\t\"initialText\": \"You can ask me for help ordering flowers. Just type \\\"order flowers\\\" or click on the mic and say it.\",\n\t\t\"initialSpeechInstruction\": \"Say 'Order Flowers' to get started.\"\n\t},\n\t\"polly\": {\n\t\t\"voiceId\": \"Salli\"\n\t},\n\t\"ui\": {\n\t\t\"parentOrigin\": \"\",\n\t\t\"pageTitle\": \"Order Flowers Bot\",\n\t\t\"toolbarTitle\": \"Order Flowers\"\n\t},\n\t\"recorder\": {\n\t\t\"preset\": \"speech_recognition\"\n\t}\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/config/config.prod.json\n// module id = 138\n// module chunks = 0","module.exports = {\n\t\"cognito\": {\n\t\t\"poolId\": \"\"\n\t},\n\t\"lex\": {\n\t\t\"botName\": \"WebUiOrderFlowers\",\n\t\t\"initialText\": \"You can ask me for help ordering flowers. Just type \\\"order flowers\\\" or click on the mic and say it.\",\n\t\t\"initialSpeechInstruction\": \"Say 'Order Flowers' to get started.\"\n\t},\n\t\"polly\": {\n\t\t\"voiceId\": \"Salli\"\n\t},\n\t\"ui\": {\n\t\t\"parentOrigin\": \"http://localhost:8080\",\n\t\t\"pageTitle\": \"Order Flowers Bot\",\n\t\t\"toolbarTitle\": \"Order Flowers\"\n\t},\n\t\"recorder\": {\n\t\t\"preset\": \"speech_recognition\"\n\t}\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/config/config.test.json\n// module id = 139\n// module chunks = 0","/*\nCopyright 2017-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n\nLicensed under the Amazon Software License (the \"License\"). You may not use this file\nexcept in compliance with the License. A copy of the License is located at\n\nhttp://aws.amazon.com/asl/\n\nor in the \"license\" file accompanying this file. This file is distributed on an \"AS IS\"\nBASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, express or implied. See the\nLicense for the specific language governing permissions and limitations under the License.\n*/\n\nexport default {\n canInterruptBotPlayback: state => state.botAudio.canInterrupt,\n isBotSpeaking: state => state.botAudio.isSpeaking,\n isConversationGoing: state => state.recState.isConversationGoing,\n isLexInterrupting: state => state.lex.isInterrupting,\n isLexProcessing: state => state.lex.isProcessing,\n isMicMuted: state => state.recState.isMicMuted,\n isMicQuiet: state => state.recState.isMicQuiet,\n isRecorderSupported: state => state.recState.isRecorderSupported,\n isRecording: state => state.recState.isRecording,\n};\n\n\n\n// WEBPACK FOOTER //\n// ./src/store/getters.js","/*\nCopyright 2017-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n\nLicensed under the Amazon Software License (the \"License\"). You may not use this file\nexcept in compliance with the License. A copy of the License is located at\n\nhttp://aws.amazon.com/asl/\n\nor in the \"license\" file accompanying this file. This file is distributed on an \"AS IS\"\nBASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, express or implied. See the\nLicense for the specific language governing permissions and limitations under the License.\n*/\n\n/**\n * Store mutations\n */\n\n/* eslint no-console: [\"error\", { allow: [\"info\", \"warn\", \"error\"] }] */\n/* eslint no-param-reassign: [\"error\", { \"props\": false }] */\n/* eslint spaced-comment: [\"error\", \"always\", { \"exceptions\": [\"*\"] }] */\n\nimport { mergeConfig } from '@/config';\n\nexport default {\n /***********************************************************************\n *\n * Recorder State Mutations\n *\n **********************************************************************/\n\n /**\n * true if recorder seems to be muted\n */\n setIsMicMuted(state, bool) {\n if (typeof bool !== 'boolean') {\n console.error('setIsMicMuted status not boolean', bool);\n return;\n }\n if (state.config.recorder.useAutoMuteDetect) {\n state.recState.isMicMuted = bool;\n }\n },\n /**\n * set to true if mic if sound from mic is not loud enough\n */\n setIsMicQuiet(state, bool) {\n if (typeof bool !== 'boolean') {\n console.error('setIsMicQuiet status not boolean', bool);\n return;\n }\n state.recState.isMicQuiet = bool;\n },\n /**\n * set to true while speech conversation is going\n */\n setIsConversationGoing(state, bool) {\n if (typeof bool !== 'boolean') {\n console.error('setIsConversationGoing status not boolean', bool);\n return;\n }\n state.recState.isConversationGoing = bool;\n },\n /**\n * Signals recorder to start and sets recoding state to true\n */\n startRecording(state, recorder) {\n console.info('start recording');\n if (state.recState.isRecording === false) {\n recorder.start();\n state.recState.isRecording = true;\n }\n },\n /**\n * Set recording state to false\n */\n stopRecording(state, recorder) {\n if (state.recState.isRecording === true) {\n state.recState.isRecording = false;\n if (recorder.isRecording) {\n recorder.stop();\n }\n }\n },\n /**\n * Increase consecutive silent recordings count\n * This is used to bail out from the conversation\n * when too many recordings are silent\n */\n increaseSilentRecordingCount(state) {\n state.recState.silentRecordingCount += 1;\n },\n /**\n * Reset the number of consecutive silent recordings\n */\n resetSilentRecordingCount(state) {\n state.recState.silentRecordingCount = 0;\n },\n /**\n * Set to true if audio recording should be enabled\n */\n setIsRecorderEnabled(state, bool) {\n if (typeof bool !== 'boolean') {\n console.error('setIsRecorderEnabled status not boolean', bool);\n return;\n }\n state.recState.isRecorderEnabled = bool;\n },\n /**\n * Set to true if audio recording is supported\n */\n setIsRecorderSupported(state, bool) {\n if (typeof bool !== 'boolean') {\n console.error('setIsRecorderSupported status not boolean', bool);\n return;\n }\n state.recState.isRecorderSupported = bool;\n },\n\n /***********************************************************************\n *\n * Bot Audio Mutations\n *\n **********************************************************************/\n\n /**\n * set to true while audio from Lex is playing\n */\n setIsBotSpeaking(state, bool) {\n if (typeof bool !== 'boolean') {\n console.error('setIsBotSpeaking status not boolean', bool);\n return;\n }\n state.botAudio.isSpeaking = bool;\n },\n /**\n * Set to true when the Lex audio is ready to autoplay\n * after it has already played audio on user interaction (click)\n */\n setAudioAutoPlay(state, audio, bool) {\n if (typeof bool !== 'boolean') {\n console.error('setAudioAutoPlay status not boolean', bool);\n return;\n }\n state.botAudio.autoPlay = bool;\n audio.autoplay = bool;\n },\n /**\n * set to true if bot playback can be interrupted\n */\n setCanInterruptBotPlayback(state, bool) {\n if (typeof bool !== 'boolean') {\n console.error('setCanInterruptBotPlayback status not boolean', bool);\n return;\n }\n state.botAudio.canInterrupt = bool;\n },\n /**\n * set to true if bot playback is being interrupted\n */\n setIsBotPlaybackInterrupting(state, bool) {\n if (typeof bool !== 'boolean') {\n console.error('setIsBotPlaybackInterrupting status not boolean', bool);\n return;\n }\n state.botAudio.isInterrupting = bool;\n },\n /**\n * used to set the setInterval Id for bot playback interruption\n */\n setBotPlaybackInterruptIntervalId(state, id) {\n if (typeof id !== 'number') {\n console.error('setIsBotPlaybackInterruptIntervalId id is not a number', id);\n return;\n }\n state.botAudio.interruptIntervalId = id;\n },\n\n /***********************************************************************\n *\n * Lex and Polly Mutations\n *\n **********************************************************************/\n\n /**\n * Updates Lex State from Lex responses\n */\n updateLexState(state, lexState) {\n state.lex = { ...state.lex, ...lexState };\n },\n /**\n * Sets the Lex session attributes\n */\n setLexSessionAttributes(state, sessionAttributes) {\n if (typeof sessionAttributes !== 'object') {\n console.error('sessionAttributes is not an object', sessionAttributes);\n return;\n }\n state.lex.sessionAttributes = sessionAttributes;\n },\n /**\n * set to true while calling lexPost{Text,Content}\n * to mark as processing\n */\n setIsLexProcessing(state, bool) {\n if (typeof bool !== 'boolean') {\n console.error('setIsLexProcessing status not boolean', bool);\n return;\n }\n state.lex.isProcessing = bool;\n },\n /**\n * set to true if lex is being interrupted while speaking\n */\n setIsLexInterrupting(state, bool) {\n if (typeof bool !== 'boolean') {\n console.error('setIsLexInterrupting status not boolean', bool);\n return;\n }\n state.lex.isInterrupting = bool;\n },\n /**\n * Set the supported content types to be used with Lex/Polly\n */\n setAudioContentType(state, type) {\n switch (type) {\n case 'mp3':\n case 'mpg':\n case 'mpeg':\n state.polly.outputFormat = 'mp3';\n state.lex.acceptFormat = 'audio/mpeg';\n break;\n case 'ogg':\n case 'ogg_vorbis':\n case 'x-cbr-opus-with-preamble':\n default:\n state.polly.outputFormat = 'ogg_vorbis';\n state.lex.acceptFormat = 'audio/ogg';\n break;\n }\n },\n /**\n * Set the Polly voice to be used by the client\n */\n setPollyVoiceId(state, voiceId) {\n if (typeof voiceId !== 'string') {\n console.error('polly voiceId is not a string', voiceId);\n return;\n }\n state.polly.voiceId = voiceId;\n },\n\n /***********************************************************************\n *\n * UI and General Mutations\n *\n **********************************************************************/\n\n /**\n * Merges the general config of the web ui\n * with a dynamic config param and merges it with\n * the existing config (e.g. initialized from ../config)\n */\n mergeConfig(state, configObj) {\n if (typeof configObj !== 'object') {\n console.error('config is not an object', configObj);\n return;\n }\n\n // security: do not accept dynamic parentOrigin\n if (configObj.ui && configObj.ui.parentOrigin) {\n delete configObj.ui.parentOrigin;\n }\n state.config = mergeConfig(state.config, configObj);\n },\n /**\n * Set to true if running embedded in an iframe\n */\n setIsRunningEmbedded(state, bool) {\n if (typeof bool !== 'boolean') {\n console.error('setIsRunningEmbedded status not boolean', bool);\n return;\n }\n state.isRunningEmbedded = bool;\n },\n /**\n * used to track the expand/minimize status of the window when\n * running embedded in an iframe\n */\n toggleIsUiMinimized(state) {\n state.isUiMinimized = !state.isUiMinimized;\n },\n /**\n * Push new message into messages array\n */\n pushMessage(state, message) {\n state.messages.push({\n id: state.messages.length,\n ...message,\n });\n },\n /**\n * Set the AWS credentials provider\n */\n setAwsCredsProvider(state, provider) {\n state.awsCreds.provider = provider;\n },\n};\n\n\n\n// WEBPACK FOOTER //\n// ./src/store/mutations.js","\"use strict\";\n\nexports.__esModule = true;\n\nvar _iterator = require(\"../core-js/symbol/iterator\");\n\nvar _iterator2 = _interopRequireDefault(_iterator);\n\nvar _symbol = require(\"../core-js/symbol\");\n\nvar _symbol2 = _interopRequireDefault(_symbol);\n\nvar _typeof = typeof _symbol2.default === \"function\" && typeof _iterator2.default === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof _symbol2.default === \"function\" && obj.constructor === _symbol2.default && obj !== _symbol2.default.prototype ? \"symbol\" : typeof obj; };\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nexports.default = typeof _symbol2.default === \"function\" && _typeof(_iterator2.default) === \"symbol\" ? function (obj) {\n return typeof obj === \"undefined\" ? \"undefined\" : _typeof(obj);\n} : function (obj) {\n return obj && typeof _symbol2.default === \"function\" && obj.constructor === _symbol2.default && obj !== _symbol2.default.prototype ? \"symbol\" : typeof obj === \"undefined\" ? \"undefined\" : _typeof(obj);\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/babel-runtime/helpers/typeof.js\n// module id = 142\n// module chunks = 0","module.exports = { \"default\": require(\"core-js/library/fn/symbol/iterator\"), __esModule: true };\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/babel-runtime/core-js/symbol/iterator.js\n// module id = 143\n// module chunks = 0","require('../../modules/es6.string.iterator');\nrequire('../../modules/web.dom.iterable');\nmodule.exports = require('../../modules/_wks-ext').f('iterator');\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/library/fn/symbol/iterator.js\n// module id = 144\n// module chunks = 0","module.exports = { \"default\": require(\"core-js/library/fn/symbol\"), __esModule: true };\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/babel-runtime/core-js/symbol.js\n// module id = 145\n// module chunks = 0","require('../../modules/es6.symbol');\nrequire('../../modules/es6.object.to-string');\nrequire('../../modules/es7.symbol.async-iterator');\nrequire('../../modules/es7.symbol.observable');\nmodule.exports = require('../../modules/_core').Symbol;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/library/fn/symbol/index.js\n// module id = 146\n// module chunks = 0","'use strict';\n// ECMAScript 6 symbols shim\nvar global = require('./_global')\n , has = require('./_has')\n , DESCRIPTORS = require('./_descriptors')\n , $export = require('./_export')\n , redefine = require('./_redefine')\n , META = require('./_meta').KEY\n , $fails = require('./_fails')\n , shared = require('./_shared')\n , setToStringTag = require('./_set-to-string-tag')\n , uid = require('./_uid')\n , wks = require('./_wks')\n , wksExt = require('./_wks-ext')\n , wksDefine = require('./_wks-define')\n , keyOf = require('./_keyof')\n , enumKeys = require('./_enum-keys')\n , isArray = require('./_is-array')\n , anObject = require('./_an-object')\n , toIObject = require('./_to-iobject')\n , toPrimitive = require('./_to-primitive')\n , createDesc = require('./_property-desc')\n , _create = require('./_object-create')\n , gOPNExt = require('./_object-gopn-ext')\n , $GOPD = require('./_object-gopd')\n , $DP = require('./_object-dp')\n , $keys = require('./_object-keys')\n , gOPD = $GOPD.f\n , dP = $DP.f\n , gOPN = gOPNExt.f\n , $Symbol = global.Symbol\n , $JSON = global.JSON\n , _stringify = $JSON && $JSON.stringify\n , PROTOTYPE = 'prototype'\n , HIDDEN = wks('_hidden')\n , TO_PRIMITIVE = wks('toPrimitive')\n , isEnum = {}.propertyIsEnumerable\n , SymbolRegistry = shared('symbol-registry')\n , AllSymbols = shared('symbols')\n , OPSymbols = shared('op-symbols')\n , ObjectProto = Object[PROTOTYPE]\n , USE_NATIVE = typeof $Symbol == 'function'\n , QObject = global.QObject;\n// Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173\nvar setter = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild;\n\n// fallback for old Android, https://code.google.com/p/v8/issues/detail?id=687\nvar setSymbolDesc = DESCRIPTORS && $fails(function(){\n return _create(dP({}, 'a', {\n get: function(){ return dP(this, 'a', {value: 7}).a; }\n })).a != 7;\n}) ? function(it, key, D){\n var protoDesc = gOPD(ObjectProto, key);\n if(protoDesc)delete ObjectProto[key];\n dP(it, key, D);\n if(protoDesc && it !== ObjectProto)dP(ObjectProto, key, protoDesc);\n} : dP;\n\nvar wrap = function(tag){\n var sym = AllSymbols[tag] = _create($Symbol[PROTOTYPE]);\n sym._k = tag;\n return sym;\n};\n\nvar isSymbol = USE_NATIVE && typeof $Symbol.iterator == 'symbol' ? function(it){\n return typeof it == 'symbol';\n} : function(it){\n return it instanceof $Symbol;\n};\n\nvar $defineProperty = function defineProperty(it, key, D){\n if(it === ObjectProto)$defineProperty(OPSymbols, key, D);\n anObject(it);\n key = toPrimitive(key, true);\n anObject(D);\n if(has(AllSymbols, key)){\n if(!D.enumerable){\n if(!has(it, HIDDEN))dP(it, HIDDEN, createDesc(1, {}));\n it[HIDDEN][key] = true;\n } else {\n if(has(it, HIDDEN) && it[HIDDEN][key])it[HIDDEN][key] = false;\n D = _create(D, {enumerable: createDesc(0, false)});\n } return setSymbolDesc(it, key, D);\n } return dP(it, key, D);\n};\nvar $defineProperties = function defineProperties(it, P){\n anObject(it);\n var keys = enumKeys(P = toIObject(P))\n , i = 0\n , l = keys.length\n , key;\n while(l > i)$defineProperty(it, key = keys[i++], P[key]);\n return it;\n};\nvar $create = function create(it, P){\n return P === undefined ? _create(it) : $defineProperties(_create(it), P);\n};\nvar $propertyIsEnumerable = function propertyIsEnumerable(key){\n var E = isEnum.call(this, key = toPrimitive(key, true));\n if(this === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key))return false;\n return E || !has(this, key) || !has(AllSymbols, key) || has(this, HIDDEN) && this[HIDDEN][key] ? E : true;\n};\nvar $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(it, key){\n it = toIObject(it);\n key = toPrimitive(key, true);\n if(it === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key))return;\n var D = gOPD(it, key);\n if(D && has(AllSymbols, key) && !(has(it, HIDDEN) && it[HIDDEN][key]))D.enumerable = true;\n return D;\n};\nvar $getOwnPropertyNames = function getOwnPropertyNames(it){\n var names = gOPN(toIObject(it))\n , result = []\n , i = 0\n , key;\n while(names.length > i){\n if(!has(AllSymbols, key = names[i++]) && key != HIDDEN && key != META)result.push(key);\n } return result;\n};\nvar $getOwnPropertySymbols = function getOwnPropertySymbols(it){\n var IS_OP = it === ObjectProto\n , names = gOPN(IS_OP ? OPSymbols : toIObject(it))\n , result = []\n , i = 0\n , key;\n while(names.length > i){\n if(has(AllSymbols, key = names[i++]) && (IS_OP ? has(ObjectProto, key) : true))result.push(AllSymbols[key]);\n } return result;\n};\n\n// 19.4.1.1 Symbol([description])\nif(!USE_NATIVE){\n $Symbol = function Symbol(){\n if(this instanceof $Symbol)throw TypeError('Symbol is not a constructor!');\n var tag = uid(arguments.length > 0 ? arguments[0] : undefined);\n var $set = function(value){\n if(this === ObjectProto)$set.call(OPSymbols, value);\n if(has(this, HIDDEN) && has(this[HIDDEN], tag))this[HIDDEN][tag] = false;\n setSymbolDesc(this, tag, createDesc(1, value));\n };\n if(DESCRIPTORS && setter)setSymbolDesc(ObjectProto, tag, {configurable: true, set: $set});\n return wrap(tag);\n };\n redefine($Symbol[PROTOTYPE], 'toString', function toString(){\n return this._k;\n });\n\n $GOPD.f = $getOwnPropertyDescriptor;\n $DP.f = $defineProperty;\n require('./_object-gopn').f = gOPNExt.f = $getOwnPropertyNames;\n require('./_object-pie').f = $propertyIsEnumerable;\n require('./_object-gops').f = $getOwnPropertySymbols;\n\n if(DESCRIPTORS && !require('./_library')){\n redefine(ObjectProto, 'propertyIsEnumerable', $propertyIsEnumerable, true);\n }\n\n wksExt.f = function(name){\n return wrap(wks(name));\n }\n}\n\n$export($export.G + $export.W + $export.F * !USE_NATIVE, {Symbol: $Symbol});\n\nfor(var symbols = (\n // 19.4.2.2, 19.4.2.3, 19.4.2.4, 19.4.2.6, 19.4.2.8, 19.4.2.9, 19.4.2.10, 19.4.2.11, 19.4.2.12, 19.4.2.13, 19.4.2.14\n 'hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables'\n).split(','), i = 0; symbols.length > i; )wks(symbols[i++]);\n\nfor(var symbols = $keys(wks.store), i = 0; symbols.length > i; )wksDefine(symbols[i++]);\n\n$export($export.S + $export.F * !USE_NATIVE, 'Symbol', {\n // 19.4.2.1 Symbol.for(key)\n 'for': function(key){\n return has(SymbolRegistry, key += '')\n ? SymbolRegistry[key]\n : SymbolRegistry[key] = $Symbol(key);\n },\n // 19.4.2.5 Symbol.keyFor(sym)\n keyFor: function keyFor(key){\n if(isSymbol(key))return keyOf(SymbolRegistry, key);\n throw TypeError(key + ' is not a symbol!');\n },\n useSetter: function(){ setter = true; },\n useSimple: function(){ setter = false; }\n});\n\n$export($export.S + $export.F * !USE_NATIVE, 'Object', {\n // 19.1.2.2 Object.create(O [, Properties])\n create: $create,\n // 19.1.2.4 Object.defineProperty(O, P, Attributes)\n defineProperty: $defineProperty,\n // 19.1.2.3 Object.defineProperties(O, Properties)\n defineProperties: $defineProperties,\n // 19.1.2.6 Object.getOwnPropertyDescriptor(O, P)\n getOwnPropertyDescriptor: $getOwnPropertyDescriptor,\n // 19.1.2.7 Object.getOwnPropertyNames(O)\n getOwnPropertyNames: $getOwnPropertyNames,\n // 19.1.2.8 Object.getOwnPropertySymbols(O)\n getOwnPropertySymbols: $getOwnPropertySymbols\n});\n\n// 24.3.2 JSON.stringify(value [, replacer [, space]])\n$JSON && $export($export.S + $export.F * (!USE_NATIVE || $fails(function(){\n var S = $Symbol();\n // MS Edge converts symbol values to JSON as {}\n // WebKit converts symbol values to JSON as null\n // V8 throws on boxed symbols\n return _stringify([S]) != '[null]' || _stringify({a: S}) != '{}' || _stringify(Object(S)) != '{}';\n})), 'JSON', {\n stringify: function stringify(it){\n if(it === undefined || isSymbol(it))return; // IE8 returns string on undefined\n var args = [it]\n , i = 1\n , replacer, $replacer;\n while(arguments.length > i)args.push(arguments[i++]);\n replacer = args[1];\n if(typeof replacer == 'function')$replacer = replacer;\n if($replacer || !isArray(replacer))replacer = function(key, value){\n if($replacer)value = $replacer.call(this, key, value);\n if(!isSymbol(value))return value;\n };\n args[1] = replacer;\n return _stringify.apply($JSON, args);\n }\n});\n\n// 19.4.3.4 Symbol.prototype[@@toPrimitive](hint)\n$Symbol[PROTOTYPE][TO_PRIMITIVE] || require('./_hide')($Symbol[PROTOTYPE], TO_PRIMITIVE, $Symbol[PROTOTYPE].valueOf);\n// 19.4.3.5 Symbol.prototype[@@toStringTag]\nsetToStringTag($Symbol, 'Symbol');\n// 20.2.1.9 Math[@@toStringTag]\nsetToStringTag(Math, 'Math', true);\n// 24.3.3 JSON[@@toStringTag]\nsetToStringTag(global.JSON, 'JSON', true);\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/library/modules/es6.symbol.js\n// module id = 147\n// module chunks = 0","var META = require('./_uid')('meta')\n , isObject = require('./_is-object')\n , has = require('./_has')\n , setDesc = require('./_object-dp').f\n , id = 0;\nvar isExtensible = Object.isExtensible || function(){\n return true;\n};\nvar FREEZE = !require('./_fails')(function(){\n return isExtensible(Object.preventExtensions({}));\n});\nvar setMeta = function(it){\n setDesc(it, META, {value: {\n i: 'O' + ++id, // object ID\n w: {} // weak collections IDs\n }});\n};\nvar fastKey = function(it, create){\n // return primitive with prefix\n if(!isObject(it))return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it;\n if(!has(it, META)){\n // can't set metadata to uncaught frozen object\n if(!isExtensible(it))return 'F';\n // not necessary to add metadata\n if(!create)return 'E';\n // add missing metadata\n setMeta(it);\n // return object ID\n } return it[META].i;\n};\nvar getWeak = function(it, create){\n if(!has(it, META)){\n // can't set metadata to uncaught frozen object\n if(!isExtensible(it))return true;\n // not necessary to add metadata\n if(!create)return false;\n // add missing metadata\n setMeta(it);\n // return hash weak collections IDs\n } return it[META].w;\n};\n// add metadata on freeze-family methods calling\nvar onFreeze = function(it){\n if(FREEZE && meta.NEED && isExtensible(it) && !has(it, META))setMeta(it);\n return it;\n};\nvar meta = module.exports = {\n KEY: META,\n NEED: false,\n fastKey: fastKey,\n getWeak: getWeak,\n onFreeze: onFreeze\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/library/modules/_meta.js\n// module id = 148\n// module chunks = 0","var getKeys = require('./_object-keys')\n , toIObject = require('./_to-iobject');\nmodule.exports = function(object, el){\n var O = toIObject(object)\n , keys = getKeys(O)\n , length = keys.length\n , index = 0\n , key;\n while(length > index)if(O[key = keys[index++]] === el)return key;\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/library/modules/_keyof.js\n// module id = 149\n// module chunks = 0","// all enumerable object keys, includes symbols\nvar getKeys = require('./_object-keys')\n , gOPS = require('./_object-gops')\n , pIE = require('./_object-pie');\nmodule.exports = function(it){\n var result = getKeys(it)\n , getSymbols = gOPS.f;\n if(getSymbols){\n var symbols = getSymbols(it)\n , isEnum = pIE.f\n , i = 0\n , key;\n while(symbols.length > i)if(isEnum.call(it, key = symbols[i++]))result.push(key);\n } return result;\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/library/modules/_enum-keys.js\n// module id = 150\n// module chunks = 0","// 7.2.2 IsArray(argument)\nvar cof = require('./_cof');\nmodule.exports = Array.isArray || function isArray(arg){\n return cof(arg) == 'Array';\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/library/modules/_is-array.js\n// module id = 151\n// module chunks = 0","// fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window\nvar toIObject = require('./_to-iobject')\n , gOPN = require('./_object-gopn').f\n , toString = {}.toString;\n\nvar windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames\n ? Object.getOwnPropertyNames(window) : [];\n\nvar getWindowNames = function(it){\n try {\n return gOPN(it);\n } catch(e){\n return windowNames.slice();\n }\n};\n\nmodule.exports.f = function getOwnPropertyNames(it){\n return windowNames && toString.call(it) == '[object Window]' ? getWindowNames(it) : gOPN(toIObject(it));\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/library/modules/_object-gopn-ext.js\n// module id = 152\n// module chunks = 0","var pIE = require('./_object-pie')\n , createDesc = require('./_property-desc')\n , toIObject = require('./_to-iobject')\n , toPrimitive = require('./_to-primitive')\n , has = require('./_has')\n , IE8_DOM_DEFINE = require('./_ie8-dom-define')\n , gOPD = Object.getOwnPropertyDescriptor;\n\nexports.f = require('./_descriptors') ? gOPD : function getOwnPropertyDescriptor(O, P){\n O = toIObject(O);\n P = toPrimitive(P, true);\n if(IE8_DOM_DEFINE)try {\n return gOPD(O, P);\n } catch(e){ /* empty */ }\n if(has(O, P))return createDesc(!pIE.f.call(O, P), O[P]);\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/library/modules/_object-gopd.js\n// module id = 153\n// module chunks = 0","require('./_wks-define')('asyncIterator');\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/library/modules/es7.symbol.async-iterator.js\n// module id = 154\n// module chunks = 0","require('./_wks-define')('observable');\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/library/modules/es7.symbol.observable.js\n// module id = 155\n// module chunks = 0","/*\nCopyright 2017-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n\nLicensed under the Amazon Software License (the \"License\"). You may not use this file\nexcept in compliance with the License. A copy of the License is located at\n\nhttp://aws.amazon.com/asl/\n\nor in the \"license\" file accompanying this file. This file is distributed on an \"AS IS\"\nBASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, express or implied. See the\nLicense for the specific language governing permissions and limitations under the License.\n*/\n\n/**\n * Asynchronous store actions\n */\n\n/* eslint no-console: [\"error\", { allow: [\"info\", \"warn\", \"error\"] }] */\n/* eslint spaced-comment: [\"error\", \"always\", { \"exceptions\": [\"*\"] }] */\n\nimport { config } from '@/config';\n\nimport LexAudioRecorder from '@/lib/lex/recorder';\nimport initRecorderHandlers from '@/store/recorder-handlers';\nimport silentOgg from '@/assets/silent.ogg';\nimport silentMp3 from '@/assets/silent.mp3';\n\nimport LexClient from '@/lib/lex/client';\n\n// non-state variables that may be mutated outside of store\n// set via initializers at run time\nlet awsCredentials;\nlet pollyClient;\nlet lexClient;\nlet audio;\nlet recorder;\n\nexport default {\n\n /***********************************************************************\n *\n * Initialization Actions\n *\n **********************************************************************/\n\n initCredentials(context, credentials) {\n switch (context.state.awsCreds.provider) {\n case 'cognito':\n awsCredentials = credentials;\n return context.dispatch('getCredentials');\n case 'parentWindow':\n return context.dispatch('getCredentials');\n default:\n return Promise.reject('unknown credential provider');\n }\n },\n getConfigFromParent(context) {\n if (!context.state.isRunningEmbedded) {\n return Promise.resolve({});\n }\n\n return context.dispatch('sendMessageToParentWindow',\n { event: 'initIframeConfig' },\n )\n .then((configResponse) => {\n if (configResponse.event === 'resolve' &&\n configResponse.type === 'initIframeConfig') {\n return Promise.resolve(configResponse.data);\n }\n return Promise.reject('invalid config event from parent');\n });\n },\n initConfig(context, configObj) {\n context.commit('mergeConfig', configObj);\n },\n initMessageList(context) {\n context.commit('pushMessage', {\n type: 'bot',\n text: context.state.config.lex.initialText,\n });\n },\n initLexClient(context, lexRuntimeClient) {\n lexClient = new LexClient({\n botName: context.state.config.lex.botName,\n botAlias: context.state.config.lex.botAlias,\n lexRuntimeClient,\n });\n\n context.commit('setLexSessionAttributes',\n context.state.config.lex.sessionAttributes,\n );\n return context.dispatch('getCredentials')\n .then(() => {\n lexClient.initCredentials(\n awsCredentials,\n );\n });\n },\n initPollyClient(context, client) {\n if (!context.state.recState.isRecorderEnabled) {\n return Promise.resolve();\n }\n pollyClient = client;\n context.commit('setPollyVoiceId', context.state.config.polly.voiceId);\n return context.dispatch('getCredentials')\n .then((creds) => {\n pollyClient.config.credentials = creds;\n });\n },\n initRecorder(context) {\n if (!context.state.recState.isRecorderEnabled) {\n return Promise.resolve();\n }\n recorder = new LexAudioRecorder(\n context.state.config.recorder,\n );\n\n return recorder.init()\n .then(() => recorder.initOptions(context.state.config.recorder))\n .then(() => initRecorderHandlers(context, recorder))\n .then(() => context.commit('setIsRecorderSupported', true))\n .then(() => context.commit('setIsMicMuted', recorder.isMicMuted))\n .catch((error) => {\n if (['PermissionDeniedError', 'NotAllowedError'].indexOf(error.name)\n >= 0) {\n console.warn('get user media permission denied');\n context.dispatch('pushErrorMessage',\n 'It seems like the microphone access has been denied. ' +\n 'If you want to use voice, please allow mic usage in your browser.',\n );\n } else {\n console.error('error while initRecorder', error);\n }\n });\n },\n initBotAudio(context, audioElement) {\n if (!context.state.recState.isRecorderEnabled) {\n return;\n }\n audio = audioElement;\n\n let silentSound;\n\n // Ogg is the preferred format as it seems to be generally smaller.\n // Detect if ogg is supported (MS Edge doesn't).\n // Can't default to mp3 as it is not supported by some Android browsers\n if (audio.canPlayType('audio/ogg') !== '') {\n context.commit('setAudioContentType', 'ogg');\n silentSound = silentOgg;\n } else if (audio.canPlayType('audio/mp3') !== '') {\n context.commit('setAudioContentType', 'mp3');\n silentSound = silentMp3;\n } else {\n console.error('init audio could not find supportted audio type');\n console.warn('init audio can play mp3 [%s]',\n audio.canPlayType('audio/mp3'));\n console.warn('init audio can play ogg [%s]',\n audio.canPlayType('audio/ogg'));\n }\n\n console.info('recorder content types: %s',\n recorder.mimeType,\n );\n\n audio.preload = 'auto';\n audio.autoplay = true;\n // Load a silent sound as the initial audio. This is used to workaround\n // the requirement of mobile browsers that would only play a\n // sound in direct response to a user action (e.g. click).\n // This audio should be explicitly played as a response to a click\n // in the UI\n audio.src = silentSound;\n },\n reInitBot(context) {\n return Promise.resolve()\n .then(() => (\n (context.state.config.ui.pushInitialTextOnRestart) ?\n context.dispatch('pushMessage', {\n text: context.state.config.lex.initialText,\n type: 'bot',\n }) :\n Promise.resolve()\n ))\n .then(() => (\n (context.state.config.lex.reInitSessionAttributesOnRestart) ?\n context.commit('setLexSessionAttributes',\n context.state.config.lex.sessionAttributes,\n ) :\n Promise.resolve()\n ));\n },\n\n /***********************************************************************\n *\n * Audio Actions\n *\n **********************************************************************/\n\n getAudioUrl(context, blob) {\n let url;\n\n try {\n url = URL.createObjectURL(blob);\n } catch (error) {\n console.error('getAudioUrl createObjectURL error', error);\n return Promise.reject(\n `There was an error processing the audio response (${error})`,\n );\n }\n\n return Promise.resolve(url);\n },\n setAudioAutoPlay(context, audioElem = audio) {\n if (audioElem.autoplay) {\n return Promise.resolve();\n }\n return new Promise((resolve, reject) => {\n audio.play();\n // eslint-disable-next-line no-param-reassign\n audioElem.onended = () => {\n context.commit('setAudioAutoPlay', audioElem, true);\n resolve();\n };\n // eslint-disable-next-line no-param-reassign\n audioElem.onerror = (err) => {\n context.commit('setAudioAutoPlay', audioElem, false);\n reject(`setting audio autoplay failed: ${err}`);\n };\n });\n },\n playAudio(context, url) {\n return new Promise((resolve) => {\n audio.onloadedmetadata = () => {\n context.commit('setIsBotSpeaking', true);\n context.dispatch('playAudioHandler')\n .then(() => resolve());\n };\n audio.src = url;\n });\n },\n playAudioHandler(context) {\n return new Promise((resolve, reject) => {\n const { enablePlaybackInterrupt } = context.state.config.lex;\n\n const clearPlayback = () => {\n context.commit('setIsBotSpeaking', false);\n const intervalId = context.state.botAudio.interruptIntervalId;\n if (intervalId && enablePlaybackInterrupt) {\n clearInterval(intervalId);\n context.commit('setBotPlaybackInterruptIntervalId', 0);\n context.commit('setIsLexInterrupting', false);\n context.commit('setCanInterruptBotPlayback', false);\n context.commit('setIsBotPlaybackInterrupting', false);\n }\n };\n\n audio.onerror = (error) => {\n clearPlayback();\n reject(`There was an error playing the response (${error})`);\n };\n audio.onended = () => {\n clearPlayback();\n resolve();\n };\n audio.onpause = audio.onended;\n\n if (enablePlaybackInterrupt) {\n context.dispatch('playAudioInterruptHandler');\n }\n });\n },\n playAudioInterruptHandler(context) {\n const { isSpeaking } = context.state.botAudio;\n const {\n enablePlaybackInterrupt,\n playbackInterruptMinDuration,\n playbackInterruptVolumeThreshold,\n playbackInterruptLevelThreshold,\n playbackInterruptNoiseThreshold,\n } = context.state.config.lex;\n const intervalTimeInMs = 200;\n\n if (!enablePlaybackInterrupt &&\n !isSpeaking &&\n context.state.lex.isInterrupting &&\n audio.duration < playbackInterruptMinDuration\n ) {\n return;\n }\n\n const intervalId = setInterval(() => {\n const duration = audio.duration;\n const end = audio.played.end(0);\n const { canInterrupt } = context.state.botAudio;\n\n if (!canInterrupt &&\n // allow to be interrupt free in the beginning\n end > playbackInterruptMinDuration &&\n // don't interrupt towards the end\n (duration - end) > 0.5 &&\n // only interrupt if the volume seems to be low noise\n recorder.volume.max < playbackInterruptNoiseThreshold\n ) {\n context.commit('setCanInterruptBotPlayback', true);\n } else if (canInterrupt && (duration - end) < 0.5) {\n context.commit('setCanInterruptBotPlayback', false);\n }\n\n if (canInterrupt &&\n recorder.volume.max > playbackInterruptVolumeThreshold &&\n recorder.volume.slow > playbackInterruptLevelThreshold\n ) {\n clearInterval(intervalId);\n context.commit('setIsBotPlaybackInterrupting', true);\n setTimeout(() => {\n audio.pause();\n }, 500);\n }\n }, intervalTimeInMs);\n\n context.commit('setBotPlaybackInterruptIntervalId', intervalId);\n },\n\n /***********************************************************************\n *\n * Recorder Actions\n *\n **********************************************************************/\n\n startConversation(context) {\n context.commit('setIsConversationGoing', true);\n return context.dispatch('startRecording');\n },\n stopConversation(context) {\n context.commit('setIsConversationGoing', false);\n },\n startRecording(context) {\n // don't record if muted\n if (context.state.recState.isMicMuted === true) {\n console.warn('recording while muted');\n context.dispatch('stopConversation');\n return Promise.reject('The microphone seems to be muted.');\n }\n\n context.commit('startRecording', recorder);\n return Promise.resolve();\n },\n stopRecording(context) {\n context.commit('stopRecording', recorder);\n },\n getRecorderVolume(context) {\n if (!context.state.recState.isRecorderEnabled) {\n return Promise.resolve();\n }\n return recorder.volume;\n },\n\n /***********************************************************************\n *\n * Lex and Polly Actions\n *\n **********************************************************************/\n\n pollyGetBlob(context, text) {\n const synthReq = pollyClient.synthesizeSpeech({\n Text: text,\n VoiceId: context.state.polly.voiceId,\n OutputFormat: context.state.polly.outputFormat,\n });\n return context.dispatch('getCredentials')\n .then(() => synthReq.promise())\n .then(data =>\n Promise.resolve(\n new Blob(\n [data.AudioStream], { type: data.ContentType },\n ),\n ),\n );\n },\n pollySynthesizeSpeech(context, text) {\n return context.dispatch('pollyGetBlob', text)\n .then(blob => context.dispatch('getAudioUrl', blob))\n .then(audioUrl => context.dispatch('playAudio', audioUrl));\n },\n interruptSpeechConversation(context) {\n if (!context.state.recState.isConversationGoing) {\n return Promise.resolve();\n }\n\n return new Promise((resolve, reject) => {\n context.dispatch('stopConversation')\n .then(() => context.dispatch('stopRecording'))\n .then(() => {\n if (context.state.botAudio.isSpeaking) {\n audio.pause();\n }\n })\n .then(() => {\n let count = 0;\n const countMax = 20;\n const intervalTimeInMs = 250;\n context.commit('setIsLexInterrupting', true);\n const intervalId = setInterval(() => {\n if (!context.state.lex.isProcessing) {\n clearInterval(intervalId);\n context.commit('setIsLexInterrupting', false);\n resolve();\n }\n if (count > countMax) {\n clearInterval(intervalId);\n context.commit('setIsLexInterrupting', false);\n reject('interrupt interval exceeded');\n }\n count += 1;\n }, intervalTimeInMs);\n });\n });\n },\n postTextMessage(context, message) {\n context.dispatch('interruptSpeechConversation')\n .then(() => context.dispatch('pushMessage', message))\n .then(() => context.dispatch('lexPostText', message.text))\n .then(response => context.dispatch('pushMessage',\n {\n text: response.message,\n type: 'bot',\n dialogState: context.state.lex.dialogState,\n responseCard: context.state.lex.responseCard,\n },\n ))\n .then(() => {\n if (context.state.lex.dialogState === 'Fulfilled') {\n context.dispatch('reInitBot');\n }\n })\n .catch((error) => {\n console.error('error in postTextMessage', error);\n context.dispatch('pushErrorMessage',\n `I was unable to process your message. ${error}`,\n );\n });\n },\n lexPostText(context, text) {\n context.commit('setIsLexProcessing', true);\n return context.dispatch('getCredentials')\n .then(() =>\n lexClient.postText(text, context.state.lex.sessionAttributes),\n )\n .then((data) => {\n context.commit('setIsLexProcessing', false);\n return context.dispatch('updateLexState', data)\n .then(() => Promise.resolve(data));\n });\n },\n lexPostContent(context, audioBlob, offset = 0) {\n context.commit('setIsLexProcessing', true);\n console.info('audio blob size:', audioBlob.size);\n let timeStart;\n\n return context.dispatch('getCredentials')\n .then(() => {\n timeStart = performance.now();\n return lexClient.postContent(\n audioBlob,\n context.state.lex.sessionAttributes,\n context.state.lex.acceptFormat,\n offset,\n );\n })\n .then((lexResponse) => {\n const timeEnd = performance.now();\n console.info('lex postContent processing time:',\n ((timeEnd - timeStart) / 1000).toFixed(2),\n );\n context.commit('setIsLexProcessing', false);\n return context.dispatch('updateLexState', lexResponse)\n .then(() =>\n context.dispatch('processLexContentResponse', lexResponse),\n )\n .then(blob => Promise.resolve(blob));\n });\n },\n processLexContentResponse(context, lexData) {\n const { audioStream, contentType, dialogState } = lexData;\n\n return Promise.resolve()\n .then(() => {\n if (!audioStream || !audioStream.length) {\n const text = (dialogState === 'ReadyForFulfillment') ?\n 'All done' :\n 'There was an error';\n return context.dispatch('pollyGetBlob', text);\n }\n\n return Promise.resolve(\n new Blob([audioStream], { type: contentType }),\n );\n });\n },\n updateLexState(context, lexState) {\n const lexStateDefault = {\n dialogState: '',\n inputTranscript: '',\n intentName: '',\n message: '',\n responseCard: null,\n sessionAttributes: {},\n slotToElicit: '',\n slots: {},\n };\n // simulate response card in sessionAttributes\n // used mainly for postContent which doesn't support response cards\n if ('sessionAttributes' in lexState &&\n 'appContext' in lexState.sessionAttributes\n ) {\n try {\n const appContext = JSON.parse(lexState.sessionAttributes.appContext);\n if ('responseCard' in appContext) {\n lexStateDefault.responseCard =\n appContext.responseCard;\n }\n } catch (e) {\n return Promise.reject('error parsing appContext in sessionAttributes');\n }\n }\n context.commit('updateLexState', { ...lexStateDefault, ...lexState });\n if (context.state.isRunningEmbedded) {\n context.dispatch('sendMessageToParentWindow',\n { event: 'updateLexState', state: context.state.lex },\n );\n }\n return Promise.resolve();\n },\n\n /***********************************************************************\n *\n * Message List Actions\n *\n **********************************************************************/\n\n pushMessage(context, message) {\n context.commit('pushMessage', message);\n },\n pushErrorMessage(context, text, dialogState = 'Failed') {\n context.commit('pushMessage', {\n type: 'bot',\n text,\n dialogState,\n });\n },\n\n /***********************************************************************\n *\n * Credentials Actions\n *\n **********************************************************************/\n\n getCredentialsFromParent(context) {\n const credsExpirationDate = new Date(\n (awsCredentials && awsCredentials.expireTime) ?\n awsCredentials.expireTime :\n 0,\n );\n const now = Date.now();\n if (credsExpirationDate > now) {\n return Promise.resolve(awsCredentials);\n }\n return context.dispatch('sendMessageToParentWindow', { event: 'getCredentials' })\n .then((credsResponse) => {\n if (credsResponse.event === 'resolve' &&\n credsResponse.type === 'getCredentials') {\n return Promise.resolve(credsResponse.data);\n }\n return Promise.reject('invalid credential event from parent');\n })\n .then((creds) => {\n const { AccessKeyId, SecretKey, SessionToken } = creds.data.Credentials;\n const IdentityId = creds.data.IdentityId;\n // recreate as a static credential\n awsCredentials = {\n accessKeyId: AccessKeyId,\n secretAccessKey: SecretKey,\n sessionToken: SessionToken,\n identityId: IdentityId,\n getPromise() { return Promise.resolve(); },\n };\n\n return awsCredentials;\n });\n },\n getCredentials(context) {\n if (context.state.awsCreds.provider === 'parentWindow') {\n return context.dispatch('getCredentialsFromParent');\n }\n return awsCredentials.getPromise()\n .then(() => awsCredentials);\n },\n\n /***********************************************************************\n *\n * UI and Parent Communication Actions\n *\n **********************************************************************/\n\n toggleIsUiMinimized(context) {\n context.commit('toggleIsUiMinimized');\n return context.dispatch(\n 'sendMessageToParentWindow',\n { event: 'toggleMinimizeUi' },\n );\n },\n sendMessageToParentWindow(context, message) {\n if (!context.state.isRunningEmbedded) {\n const error = 'sendMessage called when not running embedded';\n console.warn(error);\n return Promise.reject(error);\n }\n\n return new Promise((resolve, reject) => {\n const messageChannel = new MessageChannel();\n messageChannel.port1.onmessage = (evt) => {\n messageChannel.port1.close();\n messageChannel.port2.close();\n if (evt.data.event === 'resolve') {\n resolve(evt.data);\n } else {\n reject(`error in sendMessageToParentWindow ${evt.data.error}`);\n }\n };\n parent.postMessage(message,\n config.ui.parentOrigin, [messageChannel.port2]);\n });\n },\n};\n\n\n\n// WEBPACK FOOTER //\n// ./src/store/actions.js","/*\n Copyright 2017-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n\n Licensed under the Amazon Software License (the \"License\"). You may not use this file\n except in compliance with the License. A copy of the License is located at\n\n http://aws.amazon.com/asl/\n\n or in the \"license\" file accompanying this file. This file is distributed on an \"AS IS\"\n BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, express or implied. See the\n License for the specific language governing permissions and limitations under the License.\n */\n\n/* eslint no-console: [\"error\", { allow: [\"info\", \"warn\", \"error\"] }] */\n/* global AudioContext CustomEvent document Event navigator window */\n\n// XXX do we need webrtc-adapter?\n// XXX npm uninstall it after testing\n// XXX import 'webrtc-adapter';\n\n// wav encoder worker - uses webpack worker loader\nimport WavWorker from './wav-worker';\n\n/**\n * Lex Recorder Module\n * Based on Recorderjs. It sort of mimics the MediaRecorder API.\n * @see {@link https://github.com/mattdiamond/Recorderjs}\n * @see {@https://github.com/chris-rudmin/Recorderjs}\n * @see {@https://developer.mozilla.org/en-US/docs/Web/API/MediaRecorder}\n */\n\n/**\n * Class for Lex audio recording management.\n *\n * This class is used for microphone initialization and recording\n * management. It encodes the mic input into wav format.\n * It also monitors the audio input stream (e.g keeping track of volume)\n * filtered around human voice speech frequencies to look for silence\n */\nexport default class {\n /* eslint no-underscore-dangle: [\"error\", { \"allowAfterThis\": true }] */\n\n /**\n * Constructs the recorder object\n *\n * @param {object} - options object\n *\n * @param {string} options.mimeType - Mime type to use on recording.\n * Only 'audio/wav' is supported for now. Default: 'aduio/wav'.\n *\n * @param {boolean} options.autoStopRecording - Controls if the recording\n * should automatically stop on silence detection. Default: true.\n *\n * @param {number} options.recordingTimeMax - Maximum recording time in\n * seconds. Recording will stop after going for this long. Default: 8.\n *\n * @param {number} options.recordingTimeMin - Minimum recording time in\n * seconds. Used before evaluating if the line is quiet to allow initial\n * pauses before speech. Default: 2.\n *\n * @param {boolean} options.recordingTimeMinAutoIncrease - Controls if the\n * recordingTimeMin should be automatically increased (exponentially)\n * based on the number of consecutive silent recordings.\n * Default: true.\n *\n * @param {number} options.quietThreshold - Threshold of mic input level\n * to consider quiet. Used to determine pauses in input this is measured\n * using the \"slow\" mic volume. Default: 0.001.\n *\n * @param {number} options.quietTimeMin - Minimum mic quiet time (normally in\n * fractions of a second) before automatically stopping the recording when\n * autoStopRecording is true. In reality it takes a bit more time than this\n * value given that the slow volume value is a decay. Reasonable times seem\n * to be between 0.2 and 0.5. Default: 0.4.\n *\n * @param {number} options.volumeThreshold - Threshold of mic db level\n * to consider quiet. Used to determine pauses in input this is measured\n * using the \"max\" mic volume. Smaller values make the recorder auto stop\n * faster. Default: -75\n *\n * @param {bool} options.useBandPass - Controls if a band pass filter is used\n * for the microphone input. If true, the input is passed through a second\n * order bandpass filter using AudioContext.createBiquadFilter:\n * https://developer.mozilla.org/en-US/docs/Web/API/AudioContext/createBiquadFilter\n * The bandpass filter helps to reduce noise, improve silence detection and\n * produce smaller audio blobs. However, it may produce audio with lower\n * fidelity. Default: true\n *\n * @param {number} options.bandPassFrequency - Frequency of bandpass filter in\n * Hz. Mic input is passed through a second order bandpass filter to remove\n * noise and improve quality/speech silence detection. Reasonable values\n * should be around 3000 - 5000. Default: 4000.\n *\n * @param {number} options.bandPassQ - Q factor of bandpass filter.\n * The higher the vaue, the narrower the pass band and steeper roll off.\n * Reasonable values should be between 0.5 and 1.5. Default: 0.707\n *\n * @param {number} options.bufferLength - Length of buffer used in audio\n * processor. Should be in powers of two between 512 to 8196. Passed to\n * script processor and audio encoder. Lower values have lower latency.\n * Default: 2048.\n *\n * @param {number} options.numChannels- Number of channels to record.\n * Default: 1 (mono).\n *\n * @param {number} options.requestEchoCancellation - Request to use echo\n * cancellation in the getUserMedia call:\n * https://developer.mozilla.org/en-US/docs/Web/API/MediaTrackConstraints/echoCancellation\n * Default: true.\n *\n * @param {bool} options.useAutoMuteDetect - Controls if the recorder utilizes\n * automatic mute detection.\n * Default: true.\n *\n * @param {number} options.muteThreshold - Threshold level when mute values\n * are detected when useAutoMuteDetect is enabled. The higher the faster\n * it reports the mic to be in a muted state but may cause it to flap\n * between mute/unmute. The lower the values the slower it is to report\n * the mic as mute. Too low of a value may cause it to never report the\n * line as muted. Works in conjuction with options.quietTreshold.\n * Reasonable values seem to be between: 1e-5 and 1e-8. Default: 1e-7.\n *\n * @param {bool} options.encoderUseTrim - Controls if the encoder should\n * attempt to trim quiet samples from the beginning and end of the buffer\n * Default: true.\n *\n * @param {number} options.encoderQuietTrimThreshold - Threshold when quiet\n * levels are detected. Only applicable when encoderUseTrim is enabled. The\n * encoder will trim samples below this value at the beginnig and end of the\n * buffer. Lower value trim less silence resulting in larger WAV files.\n * Reasonable values seem to be between 0.005 and 0.0005. Default: 0.0008.\n *\n * @param {number} options.encoderQuietTrimSlackBack - How many samples to\n * add back to the encoded buffer before/after the\n * encoderQuietTrimThreshold. Higher values trim less silence resulting in\n * larger WAV files.\n * Reasonable values seem to be between 3500 and 5000. Default: 4000.\n */\n constructor(options = {}) {\n this.initOptions(options);\n\n // event handler used for events similar to MediaRecorder API (e.g. onmute)\n this._eventTarget = document.createDocumentFragment();\n\n // encoder worker\n this._encoderWorker = new WavWorker();\n\n // worker uses this event listener to signal back\n // when wav has finished encoding\n this._encoderWorker.addEventListener('message',\n evt => this._exportWav(evt.data),\n );\n }\n\n /**\n * Initialize general recorder options\n *\n * @param {object} options - object with various options controlling the\n * recorder behavior. See the constructor for details.\n */\n initOptions(options = {}) {\n // TODO break this into functions, avoid side-effects, break into this.options.*\n if (options.preset) {\n Object.assign(options, this._getPresetOptions(options.preset));\n }\n\n this.mimeType = options.mimeType || 'audio/wav';\n\n this.recordingTimeMax = options.recordingTimeMax || 8;\n this.recordingTimeMin = options.recordingTimeMin || 2;\n this.recordingTimeMinAutoIncrease =\n (typeof options.recordingTimeMinAutoIncrease !== 'undefined') ?\n !!options.recordingTimeMinAutoIncrease :\n true;\n\n // speech detection configuration\n this.autoStopRecording =\n (typeof options.autoStopRecording !== 'undefined') ?\n !!options.autoStopRecording :\n true;\n this.quietThreshold = options.quietThreshold || 0.001;\n this.quietTimeMin = options.quietTimeMin || 0.4;\n this.volumeThreshold = options.volumeThreshold || -75;\n\n // band pass configuration\n this.useBandPass =\n (typeof options.useBandPass !== 'undefined') ?\n !!options.useBandPass :\n true;\n // https://developer.mozilla.org/en-US/docs/Web/API/BiquadFilterNode\n this.bandPassFrequency = options.bandPassFrequency || 4000;\n // Butterworth 0.707 [sqrt(1/2)] | Chebyshev < 1.414\n this.bandPassQ = options.bandPassQ || 0.707;\n\n // parameters passed to script processor and also used in encoder\n // https://developer.mozilla.org/en-US/docs/Web/API/AudioContext/createScriptProcessor\n this.bufferLength = options.bufferLength || 2048;\n this.numChannels = options.numChannels || 1;\n\n this.requestEchoCancellation =\n (typeof options.requestEchoCancellation !== 'undefined') ?\n !!options.requestEchoCancellation :\n true;\n\n // automatic mute detection options\n this.useAutoMuteDetect =\n (typeof options.useAutoMuteDetect !== 'undefined') ?\n !!options.useAutoMuteDetect :\n true;\n this.muteThreshold = options.muteThreshold || 1e-7;\n\n // encoder options\n this.encoderUseTrim =\n (typeof options.encoderUseTrim !== 'undefined') ?\n !!options.encoderUseTrim :\n true;\n this.encoderQuietTrimThreshold =\n options.encoderQuietTrimThreshold || 0.0008;\n this.encoderQuietTrimSlackBack = options.encoderQuietTrimSlackBack || 4000;\n }\n\n _getPresetOptions(preset = 'low_latency') {\n this._presets = ['low_latency', 'speech_recognition'];\n\n if (this._presets.indexOf(preset) === -1) {\n console.error('invalid preset');\n return {};\n }\n\n const presets = {\n low_latency: {\n encoderUseTrim: true,\n useBandPass: true,\n },\n speech_recognition: {\n encoderUseTrim: false,\n useBandPass: false,\n useAutoMuteDetect: false,\n },\n };\n\n return presets[preset];\n }\n\n /**\n * General init. This function should be called to initialize the recorder.\n *\n * @param {object} options - Optional parameter to reinitialize the\n * recorder behavior. See the constructor for details.\n *\n * @return {Promise} - Returns a promise that resolves when the recorder is\n * ready.\n */\n init() {\n this._state = 'inactive';\n\n this._instant = 0.0;\n this._slow = 0.0;\n this._clip = 0.0;\n this._maxVolume = -Infinity;\n\n this._isMicQuiet = true;\n this._isMicMuted = false;\n\n this._isSilentRecording = true;\n this._silentRecordingConsecutiveCount = 0;\n\n // sets this._audioContext AudioContext object\n return this._initAudioContext()\n .then(() =>\n // inits AudioContext.createScriptProcessor object\n // used to process mic audio input volume\n // sets this._micVolumeProcessor\n this._initMicVolumeProcessor(),\n )\n .then(() =>\n this._initStream(),\n );\n }\n\n /**\n * Start recording\n */\n start() {\n if (this._state !== 'inactive' ||\n typeof this._stream === 'undefined') {\n console.warn('recorder start called out of state');\n return;\n }\n\n this._state = 'recording';\n\n this._recordingStartTime = this._audioContext.currentTime;\n this._eventTarget.dispatchEvent(new Event('start'));\n\n this._encoderWorker.postMessage({\n command: 'init',\n config: {\n sampleRate: this._audioContext.sampleRate,\n numChannels: this.numChannels,\n useTrim: this.encoderUseTrim,\n quietTrimThreshold: this.encoderQuietTrimThreshold,\n quietTrimSlackBack: this.encoderQuietTrimSlackBack,\n },\n });\n }\n\n /**\n * Stop recording\n */\n stop() {\n if (this._state !== 'recording') {\n console.warn('recorder stop called out of state');\n return;\n }\n\n if (this._recordingStartTime > this._quietStartTime) {\n this._isSilentRecording = true;\n this._silentRecordingConsecutiveCount += 1;\n this._eventTarget.dispatchEvent(new Event('silentrecording'));\n } else {\n this._isSilentRecording = false;\n this._silentRecordingConsecutiveCount = 0;\n this._eventTarget.dispatchEvent(new Event('unsilentrecording'));\n }\n\n this._state = 'inactive';\n this._recordingStartTime = 0;\n\n this._encoderWorker.postMessage({\n command: 'exportWav',\n type: 'audio/wav',\n });\n\n this._eventTarget.dispatchEvent(new Event('stop'));\n }\n\n _exportWav(evt) {\n this._eventTarget.dispatchEvent(\n new CustomEvent('dataavailable', { detail: evt.data }),\n );\n this._encoderWorker.postMessage({ command: 'clear' });\n }\n\n _recordBuffers(inputBuffer) {\n if (this._state !== 'recording') {\n console.warn('recorder _recordBuffers called out of state');\n return;\n }\n const buffer = [];\n for (let i = 0; i < inputBuffer.numberOfChannels; i++) {\n buffer[i] = inputBuffer.getChannelData(i);\n }\n\n this._encoderWorker.postMessage({\n command: 'record',\n buffer,\n });\n }\n\n _setIsMicMuted() {\n if (!this.useAutoMuteDetect) {\n return;\n }\n // TODO incorporate _maxVolume\n if (this._instant >= this.muteThreshold) {\n if (this._isMicMuted) {\n this._isMicMuted = false;\n this._eventTarget.dispatchEvent(new Event('unmute'));\n }\n return;\n }\n\n if (!this._isMicMuted && (this._slow < this.muteThreshold)) {\n this._isMicMuted = true;\n this._eventTarget.dispatchEvent(new Event('mute'));\n console.info('mute - instant: %s - slow: %s - track muted: %s',\n this._instant, this._slow, this._tracks[0].muted,\n );\n\n if (this._state === 'recording') {\n this.stop();\n console.info('stopped recording on _setIsMicMuted');\n }\n }\n }\n\n _setIsMicQuiet() {\n const now = this._audioContext.currentTime;\n\n const isMicQuiet = (this._maxVolume < this.volumeThreshold ||\n this._slow < this.quietThreshold);\n\n // start record the time when the line goes quiet\n // fire event\n if (!this._isMicQuiet && isMicQuiet) {\n this._quietStartTime = this._audioContext.currentTime;\n this._eventTarget.dispatchEvent(new Event('quiet'));\n }\n // reset quiet timer when there's enough sound\n if (this._isMicQuiet && !isMicQuiet) {\n this._quietStartTime = 0;\n this._eventTarget.dispatchEvent(new Event('unquiet'));\n }\n this._isMicQuiet = isMicQuiet;\n\n // if autoincrease is enabled, exponentially increase the mimimun recording\n // time based on consecutive silent recordings\n const recordingTimeMin =\n (this.recordingTimeMinAutoIncrease) ?\n (this.recordingTimeMin - 1) +\n (this.recordingTimeMax **\n (1 - (1 / (this._silentRecordingConsecutiveCount + 1)))) :\n this.recordingTimeMin;\n\n // detect voice pause and stop recording\n if (this.autoStopRecording &&\n this._isMicQuiet && this._state === 'recording' &&\n // have I been recording longer than the minimum recording time?\n now - this._recordingStartTime > recordingTimeMin &&\n // has the slow sample value been below the quiet threshold longer than\n // the minimum allowed quiet time?\n now - this._quietStartTime > this.quietTimeMin\n ) {\n this.stop();\n }\n }\n\n /**\n * Initializes the AudioContext\n * Aassigs it to this._audioContext. Adds visibitily change event listener\n * to suspend the audio context when the browser tab is hidden.\n * @return {Promise} resolution of AudioContext\n */\n _initAudioContext() {\n window.AudioContext = window.AudioContext || window.webkitAudioContext;\n if (!window.AudioContext) {\n return Promise.reject('Web Audio API not supported.');\n }\n this._audioContext = new AudioContext();\n document.addEventListener('visibilitychange', () => {\n console.info('visibility change triggered in recorder. hidden:', document.hidden);\n if (document.hidden) {\n this._audioContext.suspend();\n } else {\n this._audioContext.resume();\n }\n });\n return Promise.resolve();\n }\n\n /**\n * Private initializer of the audio buffer processor\n * It manages the volume variables and sends the buffers to the worker\n * when recording.\n * Some of this came from:\n * https://webrtc.github.io/samples/src/content/getusermedia/volume/js/soundmeter.js\n */\n _initMicVolumeProcessor() {\n /* eslint no-plusplus: [\"error\", { \"allowForLoopAfterthoughts\": true }] */\n // assumes a single channel - XXX does it need to handle 2 channels?\n const processor = this._audioContext.createScriptProcessor(\n this.bufferLength,\n this.numChannels,\n this.numChannels,\n );\n processor.onaudioprocess = (evt) => {\n if (this._state === 'recording') {\n // send buffers to worker\n this._recordBuffers(evt.inputBuffer);\n\n // stop recording if over the maximum time\n if ((this._audioContext.currentTime - this._recordingStartTime)\n > this.recordingTimeMax\n ) {\n console.warn('stopped recording due to maximum time');\n this.stop();\n }\n }\n\n // XXX assumes mono channel\n const input = evt.inputBuffer.getChannelData(0);\n let sum = 0.0;\n let clipCount = 0;\n for (let i = 0; i < input.length; ++i) {\n // square to calculate signal power\n sum += input[i] * input[i];\n if (Math.abs(input[i]) > 0.99) {\n clipCount += 1;\n }\n }\n this._instant = Math.sqrt(sum / input.length);\n this._slow = (0.95 * this._slow) + (0.05 * this._instant);\n this._clip = (input.length) ? clipCount / input.length : 0;\n\n this._setIsMicMuted();\n this._setIsMicQuiet();\n\n this._analyser.getFloatFrequencyData(this._analyserData);\n this._maxVolume = Math.max(...this._analyserData);\n };\n\n this._micVolumeProcessor = processor;\n return Promise.resolve();\n }\n\n /*\n * Private initializers\n */\n\n /**\n * Sets microphone using getUserMedia\n * @return {Promise} returns a promise that resolves when the audio input\n * has been connected\n */\n _initStream() {\n // TODO obtain with navigator.mediaDevices.getSupportedConstraints()\n const constraints = {\n audio: {\n optional: [{\n echoCancellation: this.requestEchoCancellation,\n }],\n },\n };\n\n return navigator.mediaDevices.getUserMedia(constraints)\n .then((stream) => {\n this._stream = stream;\n\n this._tracks = stream.getAudioTracks();\n console.info('using media stream track labeled: ', this._tracks[0].label);\n // assumes single channel\n this._tracks[0].onmute = this._setIsMicMuted;\n this._tracks[0].onunmute = this._setIsMicMuted;\n\n const source = this._audioContext.createMediaStreamSource(stream);\n const gainNode = this._audioContext.createGain();\n const analyser = this._audioContext.createAnalyser();\n\n if (this.useBandPass) {\n // bandpass filter around human voice\n // https://developer.mozilla.org/en-US/docs/Web/API/BiquadFilterNode\n const biquadFilter = this._audioContext.createBiquadFilter();\n biquadFilter.type = 'bandpass';\n\n biquadFilter.frequency.value = this.bandPassFrequency;\n biquadFilter.gain.Q = this.bandPassQ;\n\n source.connect(biquadFilter);\n biquadFilter.connect(gainNode);\n analyser.smoothingTimeConstant = 0.5;\n } else {\n source.connect(gainNode);\n analyser.smoothingTimeConstant = 0.9;\n }\n analyser.fftSize = this.bufferLength;\n analyser.minDecibels = -90;\n analyser.maxDecibels = -30;\n\n gainNode.connect(analyser);\n analyser.connect(this._micVolumeProcessor);\n this._analyserData = new Float32Array(analyser.frequencyBinCount);\n this._analyser = analyser;\n\n this._micVolumeProcessor.connect(\n this._audioContext.destination,\n );\n\n this._eventTarget.dispatchEvent(new Event('streamReady'));\n });\n }\n\n /*\n * getters used to expose internal vars while avoiding issues when using with\n * a reactive store (e.g. vuex).\n */\n\n /**\n * Getter of recorder state. Based on MediaRecorder API.\n * @return {string} state of recorder (inactive | recording | paused)\n */\n get state() {\n return this._state;\n }\n\n /**\n * Getter of stream object. Based on MediaRecorder API.\n * @return {MediaStream} media stream object obtain from getUserMedia\n */\n get stream() {\n return this._stream;\n }\n\n get isMicQuiet() {\n return this._isMicQuiet;\n }\n\n get isMicMuted() {\n return this._isMicMuted;\n }\n\n get isSilentRecording() {\n return this._isSilentRecording;\n }\n\n get isRecording() {\n return (this._state === 'recording');\n }\n\n /**\n * Getter of mic volume levels.\n * instant: root mean square of levels in buffer\n * slow: time decaying level\n * clip: count of samples at the top of signals (high noise)\n */\n get volume() {\n return ({\n instant: this._instant,\n slow: this._slow,\n clip: this._clip,\n max: this._maxVolume,\n });\n }\n\n /*\n * Private initializer of event target\n * Set event handlers that mimic MediaRecorder events plus others\n */\n\n // TODO make setters replace the listener insted of adding\n set onstart(cb) {\n this._eventTarget.addEventListener('start', cb);\n }\n set onstop(cb) {\n this._eventTarget.addEventListener('stop', cb);\n }\n set ondataavailable(cb) {\n this._eventTarget.addEventListener('dataavailable', cb);\n }\n set onerror(cb) {\n this._eventTarget.addEventListener('error', cb);\n }\n set onstreamready(cb) {\n this._eventTarget.addEventListener('streamready', cb);\n }\n set onmute(cb) {\n this._eventTarget.addEventListener('mute', cb);\n }\n set onunmute(cb) {\n this._eventTarget.addEventListener('unmute', cb);\n }\n set onsilentrecording(cb) {\n this._eventTarget.addEventListener('silentrecording', cb);\n }\n set onunsilentrecording(cb) {\n this._eventTarget.addEventListener('unsilentrecording', cb);\n }\n set onquiet(cb) {\n this._eventTarget.addEventListener('quiet', cb);\n }\n set onunquiet(cb) {\n this._eventTarget.addEventListener('unquiet', cb);\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/lib/lex/recorder.js","\"use strict\";\n\nexports.__esModule = true;\n\nvar _from = require(\"../core-js/array/from\");\n\nvar _from2 = _interopRequireDefault(_from);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nexports.default = function (arr) {\n if (Array.isArray(arr)) {\n for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) {\n arr2[i] = arr[i];\n }\n\n return arr2;\n } else {\n return (0, _from2.default)(arr);\n }\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/babel-runtime/helpers/toConsumableArray.js\n// module id = 158\n// module chunks = 0","module.exports = { \"default\": require(\"core-js/library/fn/array/from\"), __esModule: true };\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/babel-runtime/core-js/array/from.js\n// module id = 159\n// module chunks = 0","require('../../modules/es6.string.iterator');\nrequire('../../modules/es6.array.from');\nmodule.exports = require('../../modules/_core').Array.from;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/library/fn/array/from.js\n// module id = 160\n// module chunks = 0","'use strict';\nvar ctx = require('./_ctx')\n , $export = require('./_export')\n , toObject = require('./_to-object')\n , call = require('./_iter-call')\n , isArrayIter = require('./_is-array-iter')\n , toLength = require('./_to-length')\n , createProperty = require('./_create-property')\n , getIterFn = require('./core.get-iterator-method');\n\n$export($export.S + $export.F * !require('./_iter-detect')(function(iter){ Array.from(iter); }), 'Array', {\n // 22.1.2.1 Array.from(arrayLike, mapfn = undefined, thisArg = undefined)\n from: function from(arrayLike/*, mapfn = undefined, thisArg = undefined*/){\n var O = toObject(arrayLike)\n , C = typeof this == 'function' ? this : Array\n , aLen = arguments.length\n , mapfn = aLen > 1 ? arguments[1] : undefined\n , mapping = mapfn !== undefined\n , index = 0\n , iterFn = getIterFn(O)\n , length, result, step, iterator;\n if(mapping)mapfn = ctx(mapfn, aLen > 2 ? arguments[2] : undefined, 2);\n // if object isn't iterable or it's array with default iterator - use simple case\n if(iterFn != undefined && !(C == Array && isArrayIter(iterFn))){\n for(iterator = iterFn.call(O), result = new C; !(step = iterator.next()).done; index++){\n createProperty(result, index, mapping ? call(iterator, mapfn, [step.value, index], true) : step.value);\n }\n } else {\n length = toLength(O.length);\n for(result = new C(length); length > index; index++){\n createProperty(result, index, mapping ? mapfn(O[index], index) : O[index]);\n }\n }\n result.length = index;\n return result;\n }\n});\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/library/modules/es6.array.from.js\n// module id = 161\n// module chunks = 0","'use strict';\nvar $defineProperty = require('./_object-dp')\n , createDesc = require('./_property-desc');\n\nmodule.exports = function(object, index, value){\n if(index in object)$defineProperty.f(object, index, createDesc(0, value));\n else object[index] = value;\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/library/modules/_create-property.js\n// module id = 162\n// module chunks = 0","module.exports = function() {\n\treturn require(\"!!C:\\\\Users\\\\oatoa\\\\Desktop\\\\ProServ\\\\Projects\\\\AHA\\\\aws-lex-web-ui\\\\lex-web-ui\\\\node_modules\\\\worker-loader\\\\createInlineWorker.js\")(\"/******/ (function(modules) { // webpackBootstrap\\n/******/ \\t// The module cache\\n/******/ \\tvar installedModules = {};\\n/******/\\n/******/ \\t// The require function\\n/******/ \\tfunction __webpack_require__(moduleId) {\\n/******/\\n/******/ \\t\\t// Check if module is in cache\\n/******/ \\t\\tif(installedModules[moduleId]) {\\n/******/ \\t\\t\\treturn installedModules[moduleId].exports;\\n/******/ \\t\\t}\\n/******/ \\t\\t// Create a new module (and put it into the cache)\\n/******/ \\t\\tvar module = installedModules[moduleId] = {\\n/******/ \\t\\t\\ti: moduleId,\\n/******/ \\t\\t\\tl: false,\\n/******/ \\t\\t\\texports: {}\\n/******/ \\t\\t};\\n/******/\\n/******/ \\t\\t// Execute the module function\\n/******/ \\t\\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\\n/******/\\n/******/ \\t\\t// Flag the module as loaded\\n/******/ \\t\\tmodule.l = true;\\n/******/\\n/******/ \\t\\t// Return the exports of the module\\n/******/ \\t\\treturn module.exports;\\n/******/ \\t}\\n/******/\\n/******/\\n/******/ \\t// expose the modules object (__webpack_modules__)\\n/******/ \\t__webpack_require__.m = modules;\\n/******/\\n/******/ \\t// expose the module cache\\n/******/ \\t__webpack_require__.c = installedModules;\\n/******/\\n/******/ \\t// define getter function for harmony exports\\n/******/ \\t__webpack_require__.d = function(exports, name, getter) {\\n/******/ \\t\\tif(!__webpack_require__.o(exports, name)) {\\n/******/ \\t\\t\\tObject.defineProperty(exports, name, {\\n/******/ \\t\\t\\t\\tconfigurable: false,\\n/******/ \\t\\t\\t\\tenumerable: true,\\n/******/ \\t\\t\\t\\tget: getter\\n/******/ \\t\\t\\t});\\n/******/ \\t\\t}\\n/******/ \\t};\\n/******/\\n/******/ \\t// getDefaultExport function for compatibility with non-harmony modules\\n/******/ \\t__webpack_require__.n = function(module) {\\n/******/ \\t\\tvar getter = module && module.__esModule ?\\n/******/ \\t\\t\\tfunction getDefault() { return module['default']; } :\\n/******/ \\t\\t\\tfunction getModuleExports() { return module; };\\n/******/ \\t\\t__webpack_require__.d(getter, 'a', getter);\\n/******/ \\t\\treturn getter;\\n/******/ \\t};\\n/******/\\n/******/ \\t// Object.prototype.hasOwnProperty.call\\n/******/ \\t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\\n/******/\\n/******/ \\t// __webpack_public_path__\\n/******/ \\t__webpack_require__.p = \\\"/\\\";\\n/******/\\n/******/ \\t// Load entry module and return exports\\n/******/ \\treturn __webpack_require__(__webpack_require__.s = 0);\\n/******/ })\\n/************************************************************************/\\n/******/ ([\\n/* 0 */\\n/***/ (function(module, exports) {\\n\\n// based on https://github.com/mattdiamond/Recorderjs/blob/master/src/recorder.js\\n// with a few optimizations including downsampling and trimming quiet samples\\n\\n/* global Blob self */\\n/* eslint prefer-arrow-callback: [\\\"error\\\", { \\\"allowNamedFunctions\\\": true }] */\\n/* eslint no-param-reassign: [\\\"error\\\", { \\\"props\\\": false }] */\\n/* eslint no-use-before-define: [\\\"error\\\", { \\\"functions\\\": false }] */\\n/* eslint no-plusplus: off */\\n/* eslint comma-dangle: [\\\"error\\\", {\\\"functions\\\": \\\"never\\\", \\\"objects\\\": \\\"always-multiline\\\"}] */\\nconst bitDepth = 16;\\nconst bytesPerSample = bitDepth / 8;\\nconst outSampleRate = 16000;\\nconst outNumChannels = 1;\\n\\nlet recLength = 0;\\nlet recBuffers = [];\\n\\nconst options = {\\n sampleRate: 44000,\\n numChannels: 1,\\n useDownsample: true,\\n // controls if the encoder will trim silent samples at begining and end of buffer\\n useTrim: true,\\n // trim samples below this value at the beginnig and end of the buffer\\n // lower the value trim less silence (larger file size)\\n // reasonable values seem to be between 0.005 and 0.0005\\n quietTrimThreshold: 0.0008,\\n // how many samples to add back to the buffer before/after the quiet threshold\\n // higher values result in less silence trimming (larger file size)\\n // reasonable values seem to be between 3500 and 5000\\n quietTrimSlackBack: 4000,\\n};\\n\\nself.onmessage = (evt) => {\\n switch (evt.data.command) {\\n case 'init':\\n init(evt.data.config);\\n break;\\n case 'record':\\n record(evt.data.buffer);\\n break;\\n case 'exportWav':\\n exportWAV(evt.data.type);\\n break;\\n case 'getBuffer':\\n getBuffer();\\n break;\\n case 'clear':\\n clear();\\n break;\\n case 'close':\\n self.close();\\n break;\\n default:\\n break;\\n }\\n};\\n\\nfunction init(config) {\\n Object.assign(options, config);\\n initBuffers();\\n}\\n\\nfunction record(inputBuffer) {\\n for (let channel = 0; channel < options.numChannels; channel++) {\\n recBuffers[channel].push(inputBuffer[channel]);\\n }\\n recLength += inputBuffer[0].length;\\n}\\n\\nfunction exportWAV(type) {\\n const buffers = [];\\n for (let channel = 0; channel < options.numChannels; channel++) {\\n buffers.push(mergeBuffers(recBuffers[channel], recLength));\\n }\\n let interleaved;\\n if (options.numChannels === 2 && outNumChannels === 2) {\\n interleaved = interleave(buffers[0], buffers[1]);\\n } else {\\n interleaved = buffers[0];\\n }\\n const downsampledBuffer = downsampleTrimBuffer(interleaved, outSampleRate);\\n const dataview = encodeWAV(downsampledBuffer);\\n const audioBlob = new Blob([dataview], { type });\\n\\n self.postMessage({\\n command: 'exportWAV',\\n data: audioBlob,\\n });\\n}\\n\\nfunction getBuffer() {\\n const buffers = [];\\n for (let channel = 0; channel < options.numChannels; channel++) {\\n buffers.push(mergeBuffers(recBuffers[channel], recLength));\\n }\\n self.postMessage({ command: 'getBuffer', data: buffers });\\n}\\n\\nfunction clear() {\\n recLength = 0;\\n recBuffers = [];\\n initBuffers();\\n}\\n\\nfunction initBuffers() {\\n for (let channel = 0; channel < options.numChannels; channel++) {\\n recBuffers[channel] = [];\\n }\\n}\\n\\nfunction mergeBuffers(recBuffer, length) {\\n const result = new Float32Array(length);\\n let offset = 0;\\n for (let i = 0; i < recBuffer.length; i++) {\\n result.set(recBuffer[i], offset);\\n offset += recBuffer[i].length;\\n }\\n return result;\\n}\\n\\nfunction interleave(inputL, inputR) {\\n const length = inputL.length + inputR.length;\\n const result = new Float32Array(length);\\n\\n let index = 0;\\n let inputIndex = 0;\\n\\n while (index < length) {\\n result[index++] = inputL[inputIndex];\\n result[index++] = inputR[inputIndex];\\n inputIndex++;\\n }\\n return result;\\n}\\n\\nfunction floatTo16BitPCM(output, offset, input) {\\n for (let i = 0, o = offset; i < input.length; i++, o += 2) {\\n const s = Math.max(-1, Math.min(1, input[i]));\\n output.setInt16(o, s < 0 ? s * 0x8000 : s * 0x7FFF, true);\\n }\\n}\\n\\n// Lex doesn't require proper wav header\\n// still inserting wav header for playing on client side\\nfunction addHeader(view, length) {\\n // RIFF identifier 'RIFF'\\n view.setUint32(0, 1380533830, false);\\n // file length minus RIFF identifier length and file description length\\n view.setUint32(4, 36 + length, true);\\n // RIFF type 'WAVE'\\n view.setUint32(8, 1463899717, false);\\n // format chunk identifier 'fmt '\\n view.setUint32(12, 1718449184, false);\\n // format chunk length\\n view.setUint32(16, 16, true);\\n // sample format (raw)\\n view.setUint16(20, 1, true);\\n // channel count\\n view.setUint16(22, outNumChannels, true);\\n // sample rate\\n view.setUint32(24, outSampleRate, true);\\n // byte rate (sample rate * block align)\\n view.setUint32(28, outSampleRate * bytesPerSample * outNumChannels, true);\\n // block align (channel count * bytes per sample)\\n view.setUint16(32, bytesPerSample * outNumChannels, true);\\n // bits per sample\\n view.setUint16(34, bitDepth, true);\\n // data chunk identifier 'data'\\n view.setUint32(36, 1684108385, false);\\n}\\n\\nfunction encodeWAV(samples) {\\n const buffer = new ArrayBuffer(44 + (samples.length * 2));\\n const view = new DataView(buffer);\\n\\n addHeader(view, samples.length);\\n floatTo16BitPCM(view, 44, samples);\\n\\n return view;\\n}\\n\\nfunction downsampleTrimBuffer(buffer, rate) {\\n if (rate === options.sampleRate) {\\n return buffer;\\n }\\n\\n const length = buffer.length;\\n const sampleRateRatio = options.sampleRate / rate;\\n const newLength = Math.round(length / sampleRateRatio);\\n\\n const result = new Float32Array(newLength);\\n let offsetResult = 0;\\n let offsetBuffer = 0;\\n let firstNonQuiet = 0;\\n let lastNonQuiet = length;\\n while (offsetResult < result.length) {\\n const nextOffsetBuffer = Math.round((offsetResult + 1) * sampleRateRatio);\\n let accum = 0;\\n let count = 0;\\n for (let i = offsetBuffer; (i < nextOffsetBuffer) && (i < length); i++) {\\n accum += buffer[i];\\n count++;\\n }\\n // mark first and last sample over the quiet threshold\\n if (accum > options.quietTrimThreshold) {\\n if (firstNonQuiet === 0) {\\n firstNonQuiet = offsetResult;\\n }\\n lastNonQuiet = offsetResult;\\n }\\n result[offsetResult] = accum / count;\\n offsetResult++;\\n offsetBuffer = nextOffsetBuffer;\\n }\\n\\n /*\\n console.info('encoder trim size reduction',\\n (Math.min(newLength, lastNonQuiet + options.quietTrimSlackBack) -\\n Math.max(0, firstNonQuiet - options.quietTrimSlackBack)) / result.length\\n );\\n */\\n return (options.useTrim) ?\\n // slice based on quiet threshold and put slack back into the buffer\\n result.slice(\\n Math.max(0, firstNonQuiet - options.quietTrimSlackBack),\\n Math.min(newLength, lastNonQuiet + options.quietTrimSlackBack)\\n ) :\\n result;\\n}\\n\\n\\n/***/ })\\n/******/ ]);\\n//# sourceMappingURL=wav-worker.js.map\", __webpack_public_path__ + \"bundle/wav-worker.js\");\n};\n\n\n// WEBPACK FOOTER //\n// ./src/lib/lex/wav-worker.js","// http://stackoverflow.com/questions/10343913/how-to-create-a-web-worker-from-a-string\r\n\r\nvar URL = window.URL || window.webkitURL;\r\nmodule.exports = function(content, url) {\r\n try {\r\n try {\r\n var blob;\r\n try { // BlobBuilder = Deprecated, but widely implemented\r\n var BlobBuilder = window.BlobBuilder || window.WebKitBlobBuilder || window.MozBlobBuilder || window.MSBlobBuilder;\r\n blob = new BlobBuilder();\r\n blob.append(content);\r\n blob = blob.getBlob();\r\n } catch(e) { // The proposed API\r\n blob = new Blob([content]);\r\n }\r\n return new Worker(URL.createObjectURL(blob));\r\n } catch(e) {\r\n return new Worker('data:application/javascript,' + encodeURIComponent(content));\r\n }\r\n } catch(e) {\r\n if (!url) {\r\n throw Error('Inline worker is not supported');\r\n }\r\n return new Worker(url);\r\n }\r\n}\r\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/worker-loader/createInlineWorker.js\n// module id = 164\n// module chunks = 0","/*\n Copyright 2017-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n\n Licensed under the Amazon Software License (the \"License\"). You may not use this file\n except in compliance with the License. A copy of the License is located at\n\n http://aws.amazon.com/asl/\n\n or in the \"license\" file accompanying this file. This file is distributed on an \"AS IS\"\n BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, express or implied. See the\n License for the specific language governing permissions and limitations under the License.\n */\n\n/**\n * Vuex store recorder handlers\n */\n\n/* eslint no-console: [\"error\", { allow: [\"info\", \"warn\", \"error\", \"time\", \"timeEnd\"] }] */\n/* eslint no-param-reassign: [\"error\", { \"props\": false }] */\n\nconst initRecorderHandlers = (context, recorder) => {\n /* global Blob */\n\n recorder.onstart = () => {\n console.info('recorder start event triggered');\n console.time('recording time');\n };\n recorder.onstop = () => {\n context.dispatch('stopRecording');\n console.timeEnd('recording time');\n console.time('recording processing time');\n console.info('recorder stop event triggered');\n };\n recorder.onsilentrecording = () => {\n console.info('recorder silent recording triggered');\n context.commit('increaseSilentRecordingCount');\n };\n recorder.onunsilentrecording = () => {\n if (context.state.recState.silentRecordingCount > 0) {\n context.commit('resetSilentRecordingCount');\n }\n };\n recorder.onerror = (e) => {\n console.error('recorder onerror event triggered', e);\n };\n recorder.onstreamready = () => {\n console.info('recorder stream ready event triggered');\n };\n recorder.onmute = () => {\n console.info('recorder mute event triggered');\n context.commit('setIsMicMuted', true);\n };\n recorder.onunmute = () => {\n console.info('recorder unmute event triggered');\n context.commit('setIsMicMuted', false);\n };\n recorder.onquiet = () => {\n console.info('recorder quiet event triggered');\n context.commit('setIsMicQuiet', true);\n };\n recorder.onunquiet = () => {\n console.info('recorder unquiet event triggered');\n context.commit('setIsMicQuiet', false);\n };\n\n // TODO need to change recorder event setter to support\n // replacing handlers instead of adding\n recorder.ondataavailable = (e) => {\n const mimeType = recorder.mimeType;\n console.info('recorder data available event triggered');\n const audioBlob = new Blob(\n [e.detail], { type: mimeType },\n );\n // XXX not used for now since only encoding WAV format\n let offset = 0;\n // offset is only needed for opus encoded ogg files\n // extract the offset where the opus frames are found\n // leaving for future reference\n // https://tools.ietf.org/html/rfc7845\n // https://tools.ietf.org/html/rfc6716\n // https://www.xiph.org/ogg/doc/framing.html\n if (mimeType.startsWith('audio/ogg')) {\n offset = 125 + e.detail[125] + 1;\n }\n console.timeEnd('recording processing time');\n\n context.dispatch('lexPostContent', audioBlob, offset)\n .then((lexAudioBlob) => {\n if (context.state.recState.silentRecordingCount >=\n context.state.config.converser.silentConsecutiveRecordingMax\n ) {\n return Promise.reject(\n 'Too many consecutive silent recordings: ' +\n `${context.state.recState.silentRecordingCount}.`,\n );\n }\n return Promise.all([\n context.dispatch('getAudioUrl', audioBlob),\n context.dispatch('getAudioUrl', lexAudioBlob),\n ]);\n })\n .then((audioUrls) => {\n // handle being interrupted by text\n if (context.state.lex.dialogState !== 'Fulfilled' &&\n !context.state.recState.isConversationGoing\n ) {\n return Promise.resolve();\n }\n const [humanAudioUrl, lexAudioUrl] = audioUrls;\n context.dispatch('pushMessage', {\n type: 'human',\n audio: humanAudioUrl,\n text: context.state.lex.inputTranscript,\n });\n context.dispatch('pushMessage', {\n type: 'bot',\n audio: lexAudioUrl,\n text: context.state.lex.message,\n dialogState: context.state.lex.dialogState,\n responseCard: context.state.lex.responseCard,\n });\n return context.dispatch('playAudio', lexAudioUrl, {}, offset);\n })\n .then(() => {\n if (\n ['Fulfilled', 'ReadyForFulfillment', 'Failed'].indexOf(\n context.state.lex.dialogState,\n ) >= 0\n ) {\n return context.dispatch('stopConversation')\n .then(() => context.dispatch('reInitBot'));\n }\n\n if (context.state.recState.isConversationGoing) {\n return context.dispatch('startRecording');\n }\n return Promise.resolve();\n })\n .catch((error) => {\n console.error('converser error:', error);\n context.dispatch('stopConversation');\n context.dispatch('pushErrorMessage',\n `I had an error. ${error}`,\n );\n context.commit('resetSilentRecordingCount');\n });\n };\n};\nexport default initRecorderHandlers;\n\n\n\n// WEBPACK FOOTER //\n// ./src/store/recorder-handlers.js","module.exports = \"data:audio/ogg;base64,T2dnUwACAAAAAAAAAADGYgAAAAAAADXh79kBHgF2b3JiaXMAAAAAAUSsAAAAAAAAAHcBAAAAAAC4AU9nZ1MAAAAAAAAAAAAAxmIAAAEAAAC79cpMEDv//////////////////8kDdm9yYmlzKwAAAFhpcGguT3JnIGxpYlZvcmJpcyBJIDIwMTIwMjAzIChPbW5pcHJlc2VudCkAAAAAAQV2b3JiaXMpQkNWAQAIAAAAMUwgxYDQkFUAABAAAGAkKQ6TZkkppZShKHmYlEhJKaWUxTCJmJSJxRhjjDHGGGOMMcYYY4wgNGQVAAAEAIAoCY6j5klqzjlnGCeOcqA5aU44pyAHilHgOQnC9SZjbqa0pmtuziklCA1ZBQAAAgBASCGFFFJIIYUUYoghhhhiiCGHHHLIIaeccgoqqKCCCjLIIINMMumkk0466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oppZRSSikhhBJKKaWUUkoppQAAgAMHAIAAI+gko8oibDThwgNQaMhKAIAMAABx2GrrKdbIIMWchJZLhJByEGIuEVKKOUexZUgZxRjVlDGlFFNSa+icYoxRT51jSjHDrJRWSiiRgtJyrLV2zAEAACAIADAQITOBQAEUGMgAgAOEBCkAoLDA0DFcBATkEjIKDArHhHPSaQMAEITIDJGIWAwSE6qBomI6AFhcYMgHgAyNjbSLC+gywAVd3HUghCAEIYjFARSQgIMTbnjiDU+4wQk6RaUOAgAAAAAAAQAeAACSDSAiIpo5jg6PD5AQkRGSEpMTlAAAAAAA4AGADwCAJAWIiIhmjqPD4wMkRGSEpMTkBCUAAAAAAAAAAAAICAgAAAAAAAQAAAAICE9nZ1MABE8EAAAAAAAAxmIAAAIAAAAVfZeWAwEBAQAKDg==\"\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/assets/silent.ogg\n// module id = 166\n// module chunks = 0","module.exports = \"data:audio/mpeg;base64,//uQxAAAAAAAAAAAAAAAAAAAAAAAWGluZwAAAA8AAAACAAACcQCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA//////////////////////////////////////////////////////////////////8AAAA8TEFNRTMuOTlyBK8AAAAAAAAAADUgJAJxQQABzAAAAnEsm4LsAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//sQxAABgAAB/gAAACBLAGZ8AAAEAOAAAHG7///////////qWy3+NQOB//////////+RTEFNRTMuOTkuM1VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVX/+xDEIAOAAAH+AAAAICwAJQwAAARVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVQ==\"\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/assets/silent.mp3\n// module id = 167\n// module chunks = 0","/*\n Copyright 2017-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n\n Licensed under the Amazon Software License (the \"License\"). You may not use this file\n except in compliance with the License. A copy of the License is located at\n\n http://aws.amazon.com/asl/\n\n or in the \"license\" file accompanying this file. This file is distributed on an \"AS IS\"\n BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, express or implied. See the\n License for the specific language governing permissions and limitations under the License.\n */\n\n/* eslint no-console: [\"error\", { allow: [\"warn\", \"error\"] }] */\n\nexport default class {\n constructor({\n botName,\n botAlias = '$LATEST',\n userId,\n lexRuntimeClient,\n }) {\n if (!botName || !lexRuntimeClient) {\n throw new Error('invalid lex client constructor arguments');\n }\n\n this.botName = botName;\n this.botAlias = botAlias;\n this.userId = userId ||\n 'lex-web-ui-' +\n `${Math.floor((1 + Math.random()) * 0x10000).toString(16).substring(1)}`;\n\n this.lexRuntimeClient = lexRuntimeClient;\n this.credentials = this.lexRuntimeClient.config.credentials;\n }\n\n initCredentials(credentials) {\n this.credentials = credentials;\n this.lexRuntimeClient.config.credentials = this.credentials;\n this.userId = (credentials.identityId) ?\n credentials.identityId :\n this.userId;\n }\n\n postText(inputText, sessionAttributes = {}) {\n const postTextReq = this.lexRuntimeClient.postText({\n botAlias: this.botAlias,\n botName: this.botName,\n userId: this.userId,\n inputText,\n sessionAttributes,\n });\n return this.credentials.getPromise()\n .then(() => postTextReq.promise());\n }\n\n postContent(\n blob,\n sessionAttributes = {},\n acceptFormat = 'audio/ogg',\n offset = 0,\n ) {\n const mediaType = blob.type;\n let contentType = mediaType;\n\n if (mediaType.startsWith('audio/wav')) {\n contentType = 'audio/x-l16; sample-rate=16000; channel-count=1';\n } else if (mediaType.startsWith('audio/ogg')) {\n contentType =\n 'audio/x-cbr-opus-with-preamble; bit-rate=32000;' +\n ` frame-size-milliseconds=20; preamble-size=${offset}`;\n } else {\n console.warn('unknown media type in lex client');\n }\n\n const postContentReq = this.lexRuntimeClient.postContent({\n accept: acceptFormat,\n botAlias: this.botAlias,\n botName: this.botName,\n userId: this.userId,\n contentType,\n inputStream: blob,\n sessionAttributes,\n });\n\n return this.credentials.getPromise()\n .then(() => postContentReq.promise());\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/lib/lex/client.js"],"sourceRoot":""} \ No newline at end of file diff --git a/dist/lex-web-ui.min.css b/dist/lex-web-ui.min.css new file mode 100644 index 00000000..3ac96b19 --- /dev/null +++ b/dist/lex-web-ui.min.css @@ -0,0 +1,5 @@ +/*! +* lex-web-ui v"0.8.0" +* (c) 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. +* Released under the Amazon Software License. +*/#lex-web{-ms-flex-direction:column;flex-direction:column}#lex-web,.message-list[data-v-20b8f18d]{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;width:100%}.message-list[data-v-20b8f18d]{background-color:#fafafa;-webkit-box-flex:1;-ms-flex:1;flex:1;-ms-flex-direction:column;flex-direction:column;margin-right:0;margin-left:0;overflow-y:auto;padding-top:.3em;padding-bottom:.5em}.message-bot[data-v-20b8f18d]{-ms-flex-item-align:start;align-self:flex-start}.message-human[data-v-20b8f18d]{-ms-flex-item-align:end;align-self:flex-end}.message[data-v-290c8f4f]{max-width:66vw}.audio-label[data-v-290c8f4f]{padding-left:.8em}.message-bot .chip[data-v-290c8f4f]{background-color:#ffebee}.message-human .chip[data-v-290c8f4f]{background-color:#e8eaf6}.chip[data-v-290c8f4f]{height:auto;margin:5px;font-size:calc(1em + .25vmin)}.play-button[data-v-290c8f4f]{font-size:2em}.response-card[data-v-290c8f4f]{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;margin:.8em;width:90vw}.message-text[data-v-d69cb2c8]{white-space:normal;padding:.8em}.card[data-v-799b9a4e]{width:75vw;position:inherit;padding-bottom:.5em}.card__title[data-v-799b9a4e]{padding:.5em;padding-top:.75em}.card__text[data-v-799b9a4e]{padding:.33em}.card__actions.button-row[data-v-799b9a4e]{-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;padding-bottom:.15em}.status-bar[data-v-2df12d09]{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column}.status-text[data-v-2df12d09]{-ms-flex-item-align:center;align-self:center;display:-webkit-box;display:-ms-flexbox;display:flex;text-align:center}.volume-meter[data-v-2df12d09]{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center}.volume-meter meter[data-v-2df12d09]{height:.75rem;width:33vw}.input-container[data-v-6dd14e82]{display:-webkit-box;display:-ms-flexbox;display:flex}.input-group[data-v-6dd14e82]{margin-top:.5em;margin-bottom:0;margin-right:.25em} \ No newline at end of file diff --git a/dist/lex-web-ui.min.js b/dist/lex-web-ui.min.js new file mode 100644 index 00000000..c9502d52 --- /dev/null +++ b/dist/lex-web-ui.min.js @@ -0,0 +1,6 @@ +/*! +* lex-web-ui v"0.8.0" +* (c) 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. +* Released under the Amazon Software License. +*/ +!(function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("vue"),require("vuex"),require("aws-sdk/global"),require("aws-sdk/clients/lexruntime"),require("aws-sdk/clients/polly")):"function"==typeof define&&define.amd?define(["vue","vuex","aws-sdk/global","aws-sdk/clients/lexruntime","aws-sdk/clients/polly"],t):"object"==typeof exports?exports.LexWebUi=t(require("vue"),require("vuex"),require("aws-sdk/global"),require("aws-sdk/clients/lexruntime"),require("aws-sdk/clients/polly")):e.LexWebUi=t(e.vue,e.vuex,e["aws-sdk/global"],e["aws-sdk/clients/lexruntime"],e["aws-sdk/clients/polly"])})(this,(function(e,t,n,i,r){return (function(e){function t(i){if(n[i])return n[i].exports;var r=n[i]={i:i,l:!1,exports:{}};return e[i].call(r.exports,r,r.exports,t),r.l=!0,r.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,i){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:i})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="/",t(t.s=59)})([(function(e,t){var n=e.exports={version:"2.4.0"};"number"==typeof __e&&(__e=n)}),(function(e,t,n){var i=n(34)("wks"),r=n(21),o=n(2).Symbol,s="function"==typeof o;(e.exports=function(e){return i[e]||(i[e]=s&&o[e]||(s?o:r)("Symbol."+e))}).store=i}),(function(e,t){var n=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)}),(function(e,t,n){var i=n(4),r=n(44),o=n(29),s=Object.defineProperty;t.f=n(5)?Object.defineProperty:function(e,t,n){if(i(e),t=o(t,!0),i(n),r)try{return s(e,t,n)}catch(e){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(e[t]=n.value),e}}),(function(e,t,n){var i=n(16);e.exports=function(e){if(!i(e))throw TypeError(e+" is not an object!");return e}}),(function(e,t,n){e.exports=!n(11)((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}))}),(function(e,t){e.exports=function(e,t,n,i,r){var o,s=e=e||{},a=typeof e.default;"object"!==a&&"function"!==a||(o=e,s=e.default);var u="function"==typeof s?s.options:s;t&&(u.render=t.render,u.staticRenderFns=t.staticRenderFns),i&&(u._scopeId=i);var c;if(r?(c=function(e){e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,e||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),n&&n.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(r)},u._ssrRegister=c):n&&(c=n),c){var l=u.functional,d=l?u.render:u.beforeCreate;l?u.render=function(e,t){return c.call(t),d(e,t)}:u.beforeCreate=d?[].concat(d,c):[c]}return{esModule:o,exports:s,options:u}}}),(function(e,t,n){var i=n(2),r=n(0),o=n(15),s=n(8),a=function(e,t,n){var u,c,l,d=e&a.F,f=e&a.G,p=e&a.S,h=e&a.P,A=e&a.B,m=e&a.W,g=f?r:r[t]||(r[t]={}),v=g.prototype,y=f?i:p?i[t]:(i[t]||{}).prototype;f&&(n=t);for(u in n)(c=!d&&y&&void 0!==y[u])&&u in g||(l=c?y[u]:n[u],g[u]=f&&"function"!=typeof y[u]?n[u]:A&&c?o(l,i):m&&y[u]==l?(function(e){var t=function(t,n,i){if(this instanceof e){switch(arguments.length){case 0:return new e;case 1:return new e(t);case 2:return new e(t,n)}return new e(t,n,i)}return e.apply(this,arguments)};return t.prototype=e.prototype,t})(l):h&&"function"==typeof l?o(Function.call,l):l,h&&((g.virtual||(g.virtual={}))[u]=l,e&a.R&&v&&!v[u]&&s(v,u,l)))};a.F=1,a.G=2,a.S=4,a.P=8,a.B=16,a.W=32,a.U=64,a.R=128,e.exports=a}),(function(e,t,n){var i=n(3),r=n(17);e.exports=n(5)?function(e,t,n){return i.f(e,t,r(1,n))}:function(e,t,n){return e[t]=n,e}}),(function(e,t){var n={}.hasOwnProperty;e.exports=function(e,t){return n.call(e,t)}}),(function(e,t,n){var i=n(46),r=n(30);e.exports=function(e){return i(r(e))}}),(function(e,t){e.exports=function(e){try{return!!e()}catch(e){return!0}}}),(function(e,t,n){var i=n(45),r=n(35);e.exports=Object.keys||function(e){return i(e,r)}}),(function(e,t,n){e.exports={default:n(67),__esModule:!0}}),(function(e,t){e.exports={}}),(function(e,t,n){var i=n(27);e.exports=function(e,t,n){if(i(e),void 0===t)return e;switch(n){case 1:return function(n){return e.call(t,n)};case 2:return function(n,i){return e.call(t,n,i)};case 3:return function(n,i,r){return e.call(t,n,i,r)}}return function(){return e.apply(t,arguments)}}}),(function(e,t){e.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}}),(function(e,t){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}}),(function(e,t){var n={}.toString;e.exports=function(e){return n.call(e).slice(8,-1)}}),(function(e,t,n){"use strict";var i=n(68)(!0);n(48)(String,"String",(function(e){this._t=String(e),this._i=0}),(function(){var e,t=this._t,n=this._i;return n>=t.length?{value:void 0,done:!0}:(e=i(t,n),this._i+=e.length,{value:e,done:!1})}))}),(function(e,t,n){"use strict";t.__esModule=!0;var i=n(43),r=(function(e){return e&&e.__esModule?e:{default:e}})(i);t.default=r.default||function(e){for(var t=1;t0?r(i(e),9007199254740991):0}}),(function(e,t){var n=Math.ceil,i=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?i:n)(e)}}),(function(e,t,n){var i=n(34)("keys"),r=n(21);e.exports=function(e){return i[e]||(i[e]=r(e))}}),(function(e,t,n){var i=n(2),r=i["__core-js_shared__"]||(i["__core-js_shared__"]={});e.exports=function(e){return r[e]||(r[e]={})}}),(function(e,t){e.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")}),(function(e,t){t.f=Object.getOwnPropertySymbols}),(function(e,t,n){"use strict";t.__esModule=!0,t.default=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}}),(function(e,t,n){e.exports={default:n(65),__esModule:!0}}),(function(e,t,n){var i=n(18),r=n(1)("toStringTag"),o="Arguments"==i(function(){return arguments}()),s=function(e,t){try{return e[t]}catch(e){}};e.exports=function(e){var t,n,a;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=s(t=Object(e),r))?n:o?i(t):"Object"==(a=i(t))&&"function"==typeof t.callee?"Arguments":a}}),(function(e,t,n){var i=n(39),r=n(1)("iterator"),o=n(14);e.exports=n(0).getIteratorMethod=function(e){if(void 0!=e)return e[r]||e["@@iterator"]||o[i(e)]}}),(function(e,t,n){t.f=n(1)}),(function(e,t,n){var i=n(2),r=n(0),o=n(24),s=n(41),a=n(3).f;e.exports=function(e){var t=r.Symbol||(r.Symbol=o?{}:i.Symbol||{});"_"==e.charAt(0)||e in t||a(t,e,{value:s.f(e)})}}),(function(e,t,n){e.exports={default:n(60),__esModule:!0}}),(function(e,t,n){e.exports=!n(5)&&!n(11)((function(){return 7!=Object.defineProperty(n(28)("div"),"a",{get:function(){return 7}}).a}))}),(function(e,t,n){var i=n(9),r=n(10),o=n(63)(!1),s=n(33)("IE_PROTO");e.exports=function(e,t){var n,a=r(e),u=0,c=[];for(n in a)n!=s&&i(a,n)&&c.push(n);for(;t.length>u;)i(a,n=t[u++])&&(~o(c,n)||c.push(n));return c}}),(function(e,t,n){var i=n(18);e.exports=Object("z").propertyIsEnumerable(0)?Object:function(e){return"String"==i(e)?e.split(""):Object(e)}}),(function(e,t){}),(function(e,t,n){"use strict";var i=n(24),r=n(7),o=n(49),s=n(8),a=n(9),u=n(14),c=n(69),l=n(25),d=n(71),f=n(1)("iterator"),p=!([].keys&&"next"in[].keys()),h=function(){return this};e.exports=function(e,t,n,A,m,g,v){c(n,t,A);var y,b,x,w=function(e){if(!p&&e in I)return I[e];switch(e){case"keys":case"values":return function(){return new n(this,e)}}return function(){return new n(this,e)}},V=t+" Iterator",_="values"==m,C=!1,I=e.prototype,M=I[f]||I["@@iterator"]||m&&I[m],S=M||w(m),k=m?_?w("entries"):S:void 0,T="Array"==t?I.entries||M:M;if(T&&(x=d(T.call(new e)))!==Object.prototype&&(l(x,V,!0),i||a(x,f)||s(x,f,h)),_&&M&&"values"!==M.name&&(C=!0,S=function(){return M.call(this)}),i&&!v||!p&&!C&&I[f]||s(I,f,S),u[t]=S,u[V]=h,m)if(y={values:_?S:w("values"),keys:g?S:w("keys"),entries:k},v)for(b in y)b in I||o(I,b,y[b]);else r(r.P+r.F*(p||C),t,y);return y}}),(function(e,t,n){e.exports=n(8)}),(function(e,t,n){var i=n(4),r=n(70),o=n(35),s=n(33)("IE_PROTO"),a=function(){},u=function(){var e,t=n(28)("iframe"),i=o.length;for(t.style.display="none",n(51).appendChild(t),t.src="javascript:",e=t.contentWindow.document,e.open(),e.write(" diff --git a/lex-web-ui/src/components/InputContainer.vue b/lex-web-ui/src/components/InputContainer.vue index d69b416f..fe76ea74 100644 --- a/lex-web-ui/src/components/InputContainer.vue +++ b/lex-web-ui/src/components/InputContainer.vue @@ -37,7 +37,6 @@ BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, express or implied. See the License for the specific language governing permissions and limitations under the License. */ /* eslint no-console: ["error", { allow: ["warn", "error"] }] */ -import { mapGetters } from 'vuex'; export default { name: 'input-container', @@ -59,44 +58,51 @@ export default { isMicButtonDisabled() { return this.isMicMuted; }, - // vuex state getters - ...mapGetters([ - 'isBotSpeaking', - 'isConversationGoing', - 'isMicMuted', - 'isRecorderSupported', - ]), + isBotSpeaking() { + return this.$store.state.botAudio.isSpeaking; + }, + isConversationGoing() { + return this.$store.state.recState.isConversationGoing; + }, + isMicMuted() { + return this.$store.state.recState.isMicMuted; + }, + isRecorderSupported() { + return this.$store.state.recState.isRecorderSupported; + }, }, props: ['textInputPlaceholder', 'initialSpeechInstruction', 'initialText'], methods: { postTextMessage() { // empty string if (!this.textInput.length) { - return; + return Promise.resolve(); } const message = { type: 'human', text: this.textInput, }; - this.$store.dispatch('postTextMessage', message); - this.textInput = ''; + return this.$store.dispatch('postTextMessage', message) + .then(() => { + this.textInput = ''; + }); }, onMicClick() { if (!this.isConversationGoing) { - this.startSpeechConversation(); + return this.startSpeechConversation(); } else if (this.isBotSpeaking) { - this.$store.dispatch('interruptSpeechConversation'); + return this.$store.dispatch('interruptSpeechConversation'); } + + return Promise.resolve(); }, startSpeechConversation() { if (this.isMicMuted) { - return; + return Promise.resolve(); } - - this.setAutoPlay(); - - this.playInitialInstruction() + return this.setAutoPlay() + .then(() => this.playInitialInstruction()) .then(() => this.$store.dispatch('startConversation')) .catch((error) => { console.error('error in startSpeechConversation', error); @@ -126,11 +132,10 @@ export default { * don't require interaction so this is only done once. */ setAutoPlay() { - // TODO make this return a promise that resolves when audio is played - if (!this.$store.state.botAudio.autoPlay) { - this.$store.state.botAudio.audio.play(); - this.$store.commit('setAudioAutoPlay', true); + if (this.$store.state.botAudio.autoPlay) { + return Promise.resolve(); } + return this.$store.dispatch('setAudioAutoPlay'); }, }, }; diff --git a/lex-web-ui/src/components/LexWeb.vue b/lex-web-ui/src/components/LexWeb.vue index 192fac70..d51487ef 100644 --- a/lex-web-ui/src/components/LexWeb.vue +++ b/lex-web-ui/src/components/LexWeb.vue @@ -1,6 +1,5 @@