id: S.visitor.interaction.id
}).$promise.then(function(e) {
delete S.errors.getInteraction, e.closed && (S.visitor.interaction.closed = !0, d.set(u, S.visitor), n.enableClose = !1, n.enableDownload = !1, "unmanaged" === e.disposition ? r.go("app.unmanaged") : r.go("app.closing"))
- }).catch(f("interaction"))
+ }).catch(function(e) {
+ switch (d.remove(u), e.status) {
+ case 403:
+ r.go("app.closing");
+ break;
+ case 405:
+ r.go("app.unmanaged");
+ break;
+ default:
+ console.error(e)
+ }
+ })
}
function f(e) {
for (var t = 0; t < e.rows.length; t++) S.messages[e.rows[t].id] = e.rows[t], "out" === e.rows[t].direction && x(e.rows[t].id);
y()
}
- }).catch(f("interaction"))
+ }).catch(function(e) {
+ switch (d.remove(u), e.status) {
+ case 403:
+ r.go("app.closing");
+ break;
+ case 405:
+ r.go("app.unmanaged");
+ break;
+ default:
+ console.error(e)
+ }
+ })
}
function x(e) {
function y() {
t(function() {
var e = o[0].getElementById("chat-content");
- e.scrollTop = e.scrollHeight
+ e && (e.scrollTop = e.scrollHeight)
})
}
var w, T, $, S = this,
link: !0,
linkTarget: "_blank"
}, S.$onInit = function() {
- n.loading = !1, n.settings.showMenu = !0, S.replyMessage = "", S.visitor.interaction && S.visitor.interaction.closed ? (d.remove(u), g()) : (p(), w = i(h, 2e3), T = i(p, 1e4), y())
+ n.loading = !1, n.settings.showMenu = !0, S.replyMessage = "", S.visitor.interaction && S.visitor.interaction.closed ? (d.remove(u), g()) : (p(), w = i(h, 2e3), T = i(p, 3e3), y())
}, S.reply = function(e) {
var n = A.value.replace(/\n$/, "");
e && 13 === e.keyCode && e.shiftKey ? S.textareaGrow = !0 : e && 13 !== e.keyCode || ("" !== n ? v(_.merge({
}, S.visitor)) : b())
}, S.fileAdded = function(e) {
var t = new FormData;
- t.append("file", e.file), m.attachment.upload(t).$promise.then(function(e) {
- e.id ? (delete S.errors.sendAttachment, v(_.merge({
- body: '<a href="' + n.settings.remote + "/api/attachments/" + e.id + "?token=" + n.settings.token + '" target="_blank">' + e.name + "</a>",
+ t.append("file", e.file), a.post(n.settings.remote + "/api/chat/interactions/" + S.visitor.interaction.id + "/attachment_upload", t, {
+ transformRequest: angular.identity,
+ headers: {
+ "Content-Type": void 0
+ }
+ }).then(function(e) {
+ (e = e.data).id ? (delete S.errors.sendAttachment, v(_.merge({
+ body: '<a href="' + n.settings.remote + "/api/chat/interactions/" + S.visitor.interaction.id + "/attachment_download?attachId=" + e.id + "&token=" + n.settings.token + '" target="_blank">' + e.name + "</a>",
AttachmentId: e.id
}, S.visitor))) : f("sendAttachment")
- }).catch(function(e) {
- console.error(e)
- })
+ }, f("sendAttachment"))
}, e.$on("$destroy", function() {
i.cancel(w), i.cancel(T), w = null, T = null
}), n.$on("$download", function(e, n) {
}
var d = this;
d.$onInit = function() {
- d.visitor = i.get(r) || {}, console.log(d.visitor)
+ d.visitor = i.get(r) || {}
}, d.submit = function() {
n.loading = !0, d.visitor.interaction && d.visitor.interaction.id ? o.chatInteraction.close(_.merge({
- id: d.visitor.interaction.id
+ id: d.visitor.interaction.id,
+ ratingType: n.settings.ratingType
}, d.form)).$promise.then(function(e) {
delete d.errors.submit
}).then(s).then(a).catch(l("submit")).finally(c) : (c(), l("submit"))
getMessages: {
method: "GET",
url: t.baseUrl + "chat/interactions/:id/messages"
- }
- }), t.chatMessage = n(t.baseUrl + "chat/messages/:id", i, {
- update: {
- method: "PUT",
- url: t.baseUrl + "chat/messages/:id"
- }
- }), t.attachment = n(t.baseUrl + "attachments", i, {
- upload: {
+ },
+ uploadAttachment: {
method: "POST",
- url: t.baseUrl + "attachments",
+ url: t.baseUrl + "chat/interactions/:id/attachment_upload",
headers: {
"Content-Type": void 0
},
transformRequest: angular.identity
+ },
+ downloadAttachment: {
+ method: "GET",
+ url: t.baseUrl + "chat/interactions/:id/attachment_download"
+ }
+ }), t.chatMessage = n(t.baseUrl + "chat/messages/:id", i, {
+ update: {
+ method: "PUT",
+ url: t.baseUrl + "chat/messages/:id"
}
}), t
}
var t = g.fields[e];
t.props && g.form.hasOwnProperty(t.props.title) && (_.isNil(t.variable) || (g.visitor[t.variable] = _.isArray(g.form[t.props.title]) ? g.form[t.props.title].join() : g.form[t.props.title]), _.isNil(t.cmField) || (g.visitor[t.cmField] = _.isArray(g.form[t.props.title]) ? g.form[t.props.title].join() : g.form[t.props.title]), e === p && (_.isNil(n.settings.mapKey) || (g.visitor.mapKey = n.settings.mapKey, g.visitor.from = _.isArray(g.form[t.props.title]) ? g.form[t.props.title].join() : g.form[t.props.title])))
}
+ var i = "";
+ for (var o in g.form) g.form.hasOwnProperty(o) && (i += o + ": " + g.form[o] + "\n");
m(_.merge({
- body: "Starting message..."
+ body: i,
+ referer: n.settings.referer,
+ customerIp: n.settings.customerIp
}, g.visitor))
}, g.toggle = function(e, n) {
g.form[e] || (g.form[e] = []);
}).$promise.then(function(e) {
e.closed && (l.visitor.interaction.closed = !0, i.set(r, l.visitor), "unmanaged" === e.disposition && n.go("app.unmanaged")), e.UserId && (l.visitor.interaction.UserId = e.UserId, i.set(r, l.visitor), n.go("app.chat"))
}).catch(function(e) {
- console.error(e)
+ switch (e.status) {
+ case 403:
+ n.go("app.closing");
+ break;
+ case 405:
+ n.go("app.unmanaged");
+ break;
+ default:
+ console.error(e)
+ }
})
}
var s, l = this;
e.$inject = ["$interval", "$state", "$scope", "localStorageService", "api", "STORAGE_VISITOR"], angular.module("motion").controller("WaitingController", e)
}(), angular.module("motion").run(["$templateCache", function(e) {
"use strict";
- e.put("app/chat/index.html", '\x3c!-- CHAT CONTENT --\x3e\n<md-content id="chat-content" flex>\n \x3c!-- CHAT MESSAGES --\x3e\n <div layout="row" ng-if="!$first" ng-repeat="(key, message) in vm.messages track by message.id" class="md-padding message-row" ng-class="{\'in\': message.direction === \'in\', \'out\': message.direction === \'out\' && message.UserId, \'auto\': message.direction === \'out\' && !message.UserId}">\n\n <img ng-if="message.direction ===\'out\' && !message.UserId" ng-src="assets/images/avatars/robot0.png" class="avatar" alt="system" />\n <img ng-if="message.direction ===\'out\' && message.UserId" ng-src="assets/images/avatars/agent0.png" class="avatar" alt="agent" />\n <img ng-if="message.direction ===\'in\'" ng-src="assets/images/avatars/customer0.png" class="avatar" alt="customer">\n\n <div class="bubble">\n <div class="time secondary-text">\n <span>\n {{message.direction === \'out\' ? (message.UserId ? (settings.agentAlias || \'Agent\') + message.UserId : \'System\') : (vm.visitor.from || \'Visitor\' + message.ContactId)}} - {{message.createdAt | date : \'h:mm\'}}\n </span>\n </div>\n <div ng-class="{\'in\': message.direction === \'in\', \'out\': message.direction ===\'out\' && message.UserId, \'auto\': message.direction ===\'out\' && !message.UserId}">\n <div ng-if="message.AttachmentId" ng-bind-html="message.body" class="message"></div>\n <div ng-if="!message.AttachmentId" ng-bind-html="message.body | embed:vm.emojiOptions" class="message"></div>\n </div>\n </div>\n\n </div>\n \x3c!-- CHAT MESSAGES --\x3e\n\n \x3c!-- CHAT ERROR --\x3e\n <div class="chat-error" ng-repeat="error in vm.errors" layout="row" layout-align="center end" layout-margin>\n <i class="mdi mdi-alert mdi-24px mdi-light"></i>\n <md-tooltip md-direction="top">{{error.message || \'Service temporarily unavailable.\'}}</md-tooltip>\n <span class="chat-error-message">{{error.message || \'Service temporarily unavailable.\'}}</span>\n </div>\n \x3c!-- CHAT ERROR --\x3e\n\n</md-content>\n\x3c!-- / CHAT CONTENT --\x3e\n\n\x3c!-- CHAT FOOTER --\x3e\n<div class="chat-footer flex-noshrink" layout="row" layout-align="center center">\n \x3c!-- REPLY FORM --\x3e\n <form ng-submit="vm.reply()" class="reply-form" layout="row" flex>\n <md-input-container md-no-float flex>\n <textarea id="emoji-area" ng-keyup="vm.reply($event)" md-no-autogrow ng-model="vm.replyMessage" ng-class="{\'grow\': vm.textareaGrow}" placeholder="Type and hit enter to send message" emoji-picker emoji-attachment-location="bottom right" emoji-menu-location="top left"\n emoji-popup-button-classes="mdi mdi-emoticon mdi-24px" emoji-assets-path="assets/images/ng-emoji-picker">\n </textarea>\n </md-input-container>\n\n <div layout="column" flex="10">\n <md-button class="md-fab md-mini" type="submit" aria-label="Send message" translate translate-attr-aria-label="CHAT.SEND_MESSAGE" ng-style="{\'background-color\': \'{{settings.color_button}}\', \'margin-bottom\': \'2px\'}">\n <i class="mdi mdi-send mdi-24px mdi-light"></i>\n </md-button>\n\n <md-button class="md-fab md-mini md-warn" type="button" aria-label="Send message" translate translate-attr-aria-label="CHAT.SEND_MESSAGE" ng-style="{\'margin-top\': \'2px\'}" flow-init="{singleFile: true}" flow-btn flow-file-added="vm.fileAdded($file, $event, $flow)">\n <i class="mdi mdi-attachment mdi-24px mdi-light"></i>\n </md-button>\n </div>\n </form>\n \x3c!-- / REPLY FORM --\x3e\n</div>\n\x3c!-- / CHAT FOOTER--\x3e\n'), e.put("app/closing/index.html", '\x3c!-- CHAT CONTENT --\x3e\n<md-content id="chat-content-form" flex ms-scroll>\n \x3c!-- CHAT ERROR --\x3e\n <div class="chat-error" ng-repeat="error in vm.errors" layout="row" layout-margin>\n <i class="mdi mdi-alert mdi-24px mdi-light"></i>\n <md-tooltip md-direction="top">{{error.message || \'Service temporarily unavailable.\'}}</md-tooltip>\n <span class="chat-error-message">{{error.message || \'Service temporarily unavailable.\'}}</span>\n </div>\n \x3c!-- CHAT ERROR --\x3e\n\n <md-content layout="row" layout-align="center end">\n {{ settings.closingMessage }}\n </md-content>\n\n <form name="vm.userForm" layout="column" ng-submit="vm.submit()" novalidate>\n <md-input-container ng-if="settings.enableRating" class="md-block" ng-switch="settings.ratingType">\n \x3c!-- START thumb rating --\x3e\n <md-radio-group name="ratingValue" ng-switch-when="thumb" ng-model="vm.form.ratingValue" ng-change="vm.upColor = vm.form.ratingValue ? \'green\' : null; vm.downColor = !vm.form.ratingValue ? \'red\' : null;" layout="row" layout-align="center center">\n <md-radio-button ng-value="1" class="thumb">\n <div class="{{vm.upColor}}">\n <i class="mdi mdi-48px mdi-thumb-up-outline"></i>\n </div>\n </md-radio-button>\n <md-radio-button ng-value="0" class="thumb">\n <div class="{{vm.downColor}}">\n <i class="mdi mdi-48px mdi-thumb-down-outline"></i>\n </div>\n </md-radio-button>\n </md-radio-group>\n \x3c!-- END thumb rating --\x3e\n\n \x3c!-- START star rating --\x3e\n <div ng-switch-when="star" layout="row" layout-align="center center">\n <ng-rate-it name="ratingValue" ng-model="vm.form.ratingValue" min="0" max="settings.ratingStarsNumber" step="1" star-width="32" star-height="32" class="bigstar rate" resetable="false"></ng-rate-it>\n </div>\n \x3c!-- END star rating --\x3e\n </md-input-container>\n\n <md-input-container ng-if="settings.enableFeedback" class="md-block">\n \x3c!-- START textarea --\x3e\n <label>Feedback</label>\n <textarea name="message" ng-model="vm.form.ratingMessage" md-maxlength="150" rows="5"></textarea>\n \x3c!-- END textarea --\x3e\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="settings.forwardTranscript">\n <span ng-if="settings.forwardTranscriptMessage">{{settings.forwardTranscriptMessage}}</span>\n <label ng-if="!settings.forwardTranscriptMessage">Email</label>\n \x3c!-- START email --\x3e\n <input type="email" name="mailTranscript" ng-model="vm.form.mailTranscript">\n <div ng-messages="vm.userForm[\'mailTranscript\'].$error" ng-show="vm.userForm[\'mailTranscript\'].$touched" role="alert">\n <div ng-message="email">\n <span>Email must be a valid e-mail address</span>\n </div>\n </div>\n \x3c!-- END email --\x3e\n </md-input-container>\n\n <md-button ng-if="settings.enableRating || settings.enableFeedback || settings.forwardTranscript" type="submit" class="md-raised" ng-disabled="vm.userForm.$invalid" ng-style="{\'background-color\': \'{{settings.color_button}}\'}">{{settings.closingMessageButton}}</md-button>\n <md-button class="md-raised" ng-style="{\'background-color\': \'{{settings.color_button}}\'}" ng-click="vm.skip()">{{settings.skipMessageButton}}</md-button>\n </form>\n\n <md-content layout="row" layout-align="center end">\n {{ (settings.custom && !settings.defaultWhiteLabel) ? \'Powered By XCALLY\' : settings.whiteLabel }}\n </md-content>\n\n</md-content>\n\x3c!-- / CHAT CONTENT --\x3e\n'), e.put("app/offline/index.html", '\x3c!-- CHAT CONTENT --\x3e\n<md-content id="chat-content-form" flex ms-scroll>\n <form ng-if="vm.fields.length" name="vm.userForm" layout="column" ng-submit="vm.submit()" novalidate>\n <div ng-repeat="field in vm.fields | orderBy:\'index\'" layout="column">\n <label>{{field.props.title}}</label>\n <span style="font-size: 13px; line-height: 14px; color: grey;">\n <div ng-bind-html="field.props.helpText | embed:{linkTarget:\'_blank\'}"></div>\n </span>\n\n \x3c!-- CHAT ERROR --\x3e\n <div class="chat-error" ng-repeat="error in vm.errors" layout="row" layout-margin>\n <i class="mdi mdi-alert mdi-24px mdi-light"></i>\n <md-tooltip md-direction="top">{{error.message || \'Service temporarily unavailable.\'}}</md-tooltip>\n <span class="chat-error-message">{{error.message || \'Service temporarily unavailable.\'}}</span>\n </div>\n \x3c!-- CHAT ERROR --\x3e\n\n <md-input-container class="md-block" ng-switch="field.type">\n \x3c!-- START label --\x3e\n <div ng-switch-when="label">\n <md-content flex layout-padding layout="row" layout-align="center center">\n <span>{{field.value}}</span>\n </md-content>\n </div>\n \x3c!-- END label --\x3e\n\n \x3c!-- START textinput --\x3e\n <div ng-switch-when="input">\n <input name="{{field.props.title}}" ng-model="vm.form[field.props.title]" type="{{field.config.type}}" placeholder="{{field.config.placeholder}}" ng-required="field.config.required">\n </div>\n \x3c!-- END textinput --\x3e\n\n \x3c!-- START textarea --\x3e\n <div ng-switch-when="textarea">\n <textarea name="{{field.props.title}}" ng-model="vm.form[field.props.title]" md-maxlength="150" rows="5"></textarea>\n </div>\n \x3c!-- END textarea --\x3e\n\n \x3c!-- START select --\x3e\n <div ng-switch-when="chooseFromList">\n <md-select name="{{field.props.title}}"ng-model="vm.form[field.props.title]" placeholder="{{field.config.placeholder}}" ng-required="field.config.required">\n <md-option ng-repeat="option in field.options" ng-value="option.value">{{option.value}}</md-option>\n </md-select>\n </div>\n \x3c!-- END select --\x3e\n\n \x3c!-- START radio --\x3e\n <div ng-switch-when="multipleChoices" layout="column">\n <md-radio-group name="{{field.props.title}}" ng-model="vm.form[field.props.title]" ng-required="field.config.required" layout="{{field.config.direction === \'vertical\' ? \'column\' : \'row\'}}">\n <md-radio-button ng-repeat="option in field.options" value="{{option.value}}" class="md-primary">{{option.value}}</md-radio-button>\n </md-radio-group>\n </div>\n \x3c!-- END radio --\x3e\n\n \x3c!-- START checkbox --\x3e\n <div ng-switch-when="checkboxes" layout="column">\n <div layout="{{field.config.direction === \'vertical\' ? \'column\' : \'row\'}}">\n <md-checkbox\n aria-label="{{field.props.title}}"\n ng-repeat="option in field.options"\n ng-checked="vm.exists(field.props.title, option.value)"\n ng-disabled="!vm.exists(field.props.title, option.value) && field.config.maxSelections === vm.form[field.props.title].length"\n ng-click="vm.toggle(field.props.title, option.value)"\n flex>\n {{option.value}}\n </md-checkbox>\n </div>\n </div>\n \x3c!-- END checkbox --\x3e\n\n \x3c!-- START agreement --\x3e\n <div ng-switch-when="agreement" layout="column">\n <md-checkbox\n ng-model="vm.form[field.props.title]"\n aria-label="{{field.props.title}}"\n ng-required="field.config.required">\n {{field.options[0].value}}\n </md-checkbox>\n </div>\n \x3c!-- END agreement --\x3e\n </md-input-container>\n </div>\n\n <md-button type="submit" class="md-raised" ng-disabled="vm.userForm.$invalid || vm.userForm.$pristine" ng-style="{\'background-color\': \'{{settings.color_button}}\'}">SEND</md-button>\n </form>\n\n <md-content layout="row" layout-align="center end">\n {{ (settings.custom && !settings.defaultWhiteLabel) ? \'Powered By XCALLY\' : settings.whiteLabel }}\n </md-content>\n\n</md-content>\n\x3c!-- / CHAT CONTENT --\x3e\n'), e.put("app/online/index.html", '\x3c!-- CHAT CONTENT --\x3e\n<md-content id="chat-content-form" flex ms-scroll>\n <form ng-if="vm.fields.length" name="vm.userForm" layout="column" ng-submit="vm.submit()" novalidate>\n <div ng-repeat="field in vm.fields | orderBy:\'index\'" layout="column">\n <label>{{field.props.title}}</label>\n <span style="font-size: 13px; line-height: 14px; color: grey;">\n <div ng-bind-html="field.props.helpText | embed:{linkTarget:\'_blank\'}"></div>\n </span>\n\n <md-input-container class="md-block" ng-switch="field.type">\n \x3c!-- START label --\x3e\n <div ng-switch-when="label">\n <md-content flex layout-padding layout="row" layout-align="center center">\n <span>{{field.value}}</span>\n </md-content>\n </div>\n \x3c!-- END label --\x3e\n\n \x3c!-- START textinput --\x3e\n <div ng-switch-when="input">\n <input name="{{field.props.title}}" ng-model="vm.form[field.props.title]" type="{{field.config.type}}" placeholder="{{field.config.placeholder}}" ng-required="field.config.required">\n </div>\n \x3c!-- END textinput --\x3e\n\n \x3c!-- START textarea --\x3e\n <div ng-switch-when="textarea">\n <textarea name="{{field.props.title}}" ng-model="vm.form[field.props.title]" md-maxlength="150" rows="5"></textarea>\n </div>\n \x3c!-- END textarea --\x3e\n\n \x3c!-- START select --\x3e\n <div ng-switch-when="chooseFromList">\n <md-select name="{{field.props.title}}"ng-model="vm.form[field.props.title]" placeholder="{{field.config.placeholder}}" ng-required="field.config.required">\n <md-option ng-repeat="option in field.options" ng-value="option.value">{{option.value}}</md-option>\n </md-select>\n </div>\n \x3c!-- END select --\x3e\n\n \x3c!-- START radio --\x3e\n <div ng-switch-when="multipleChoices" layout="column">\n <md-radio-group name="{{field.props.title}}" ng-model="vm.form[field.props.title]" ng-required="field.config.required" layout="{{field.config.direction === \'vertical\' ? \'column\' : \'row\'}}">\n <md-radio-button ng-repeat="option in field.options" value="{{option.value}}" class="md-primary">{{option.value}}</md-radio-button>\n </md-radio-group>\n </div>\n \x3c!-- END radio --\x3e\n\n \x3c!-- START checkbox --\x3e\n <div ng-switch-when="checkboxes" layout="{{field.config.direction === \'vertical\' ? \'column\' : \'row\'}}">\n <md-checkbox\n aria-label="{{field.props.title}}"\n ng-repeat="option in field.options"\n ng-checked="vm.exists(field.props.title, option.value)"\n ng-disabled="!vm.exists(field.props.title, option.value) && field.config.maxSelections === vm.form[field.props.title].length"\n ng-click="vm.toggle(field.props.title, option.value)">\n {{option.value}}\n </md-checkbox>\n </div>\n \x3c!-- END checkbox --\x3e\n\n \x3c!-- START agreement --\x3e\n <div ng-switch-when="agreement" layout="column">\n <md-checkbox\n ng-model="vm.form[field.props.title]"\n aria-label="{{field.props.title}}"\n ng-required="field.config.required">\n {{field.options[0].value}}\n </md-checkbox>\n </div>\n \x3c!-- END agreement --\x3e\n </md-input-container>\n </div>\n\n <md-button type="submit" class="md-raised" ng-disabled="vm.userForm.$invalid || vm.userForm.$pristine" ng-style="{\'background-color\': \'{{settings.color_button}}\'}">{{settings.start_chat_button}}</md-button>\n </form>\n\n <md-content layout="row" layout-align="center end" style="background: transparent;">\n {{ (settings.custom && !settings.defaultWhiteLabel) ? settings.whiteLabel : \'Powered By XCALLY\' }}\n </md-content>\n\n</md-content>\n\x3c!-- / CHAT CONTENT --\x3e\n'), e.put("app/unmanaged/index.html", '\x3c!-- CHAT CONTENT --\x3e\n<md-content id="chat-content-form" flex ms-scroll>\n \x3c!-- CHAT ERROR --\x3e\n <div class="chat-error" ng-repeat="error in vm.errors" layout="row" layout-margin>\n <i class="mdi mdi-alert mdi-24px mdi-light"></i>\n <md-tooltip md-direction="top">{{error.message || \'Service temporarily unavailable.\'}}</md-tooltip>\n <span class="chat-error-message">{{error.message || \'Service temporarily unavailable.\'}}</span>\n </div>\n \x3c!-- CHAT ERROR --\x3e\n\n <md-content layout="row" layout-align="center end">\n {{ settings.unmanagedMessage }}\n </md-content>\n\n <form name="vm.userForm" layout="column" ng-submit="vm.submit()" novalidate>\n <md-input-container ng-if="settings.enableUnmanagedNote" class="md-block">\n \x3c!-- START textarea --\x3e\n <label>Note</label>\n <textarea name="note" ng-model="vm.form.note" md-maxlength="255" rows="5"></textarea>\n \x3c!-- END textarea --\x3e\n </md-input-container>\n\n <md-button ng-if="settings.enableUnmanagedNote" type="submit" class="md-raised" ng-disabled="vm.userForm.$invalid" ng-style="{\'background-color\': \'{{settings.color_button}}\'}">{{settings.sendUnmanaged}}</md-button>\n <md-button class="md-raised" ng-style="{\'background-color\': \'{{settings.color_button}}\'}" ng-click="vm.skip()">{{settings.skipUnmanaged}}</md-button>\n </form>\n\n <md-content layout="row" layout-align="center end">\n {{ (settings.custom && !settings.defaultWhiteLabel) ? \'Powered By XCALLY\' : settings.whiteLabel }}\n </md-content>\n\n</md-content>\n\x3c!-- / CHAT CONTENT --\x3e\n'), e.put("app/waiting/index.html", '\x3c!-- WAITING CONTENT --\x3e\n<md-content id="waiting" layout="column" layout-align="center center" flex>\n <div layout="row" layout-align="center center" class="md-accent-bg" flex="50">\n <md-progress-circular md-diameter="100"></md-progress-circular>\n </div>\n <div layout="row" layout-align="center end" class="title" flex="25">\n {{settings.waitingTitle}}\n </div>\n <div layout="row" layout-align="center start" class="subtitle" flex="25">\n {{settings.waitingMessage}}\n </div>\n</md-content>\n\x3c!-- / WAITING CONTENT --\x3e\n')
+ e.put("app/chat/index.html", '\x3c!-- CHAT CONTENT --\x3e\n<md-content id="chat-content" flex>\n \x3c!-- CHAT MESSAGES --\x3e\n <div layout="row" ng-if="!$first" ng-repeat="(key, message) in vm.messages track by message.id" class="md-padding message-row" ng-class="{\'in\': message.direction === \'in\', \'out\': message.direction === \'out\' && message.UserId, \'auto\': message.direction === \'out\' && !message.UserId}">\n\n <img ng-if="message.direction ===\'out\' && !message.UserId" ng-src="assets/images/avatars/robot0.png" class="avatar" alt="system" />\n <img ng-if="message.direction ===\'out\' && message.UserId" ng-src="assets/images/avatars/agent0.png" class="avatar" alt="agent" />\n <img ng-if="message.direction ===\'in\'" ng-src="assets/images/avatars/customer0.png" class="avatar" alt="customer">\n\n <div class="bubble">\n <div class="time secondary-text">\n <span>\n {{message.direction === \'out\' ? (message.UserId ? (settings.agentAlias || \'Agent\') + message.UserId : \'System\') : (vm.visitor.from || \'Visitor\' + message.ContactId)}} - {{message.createdAt | date : \'h:mm\'}}\n </span>\n </div>\n <div ng-class="{\'in\': message.direction === \'in\', \'out\': message.direction ===\'out\' && message.UserId, \'auto\': message.direction ===\'out\' && !message.UserId}">\n <div ng-if="message.AttachmentId" ng-bind-html="message.body" class="message"></div>\n <div ng-if="!message.AttachmentId" ng-bind-html="message.body | embed:vm.emojiOptions" class="message"></div>\n </div>\n </div>\n\n </div>\n \x3c!-- CHAT MESSAGES --\x3e\n\n \x3c!-- CHAT ERROR --\x3e\n <div class="chat-error" ng-repeat="error in vm.errors" layout="row" layout-align="center end" layout-margin>\n <i class="mdi mdi-alert mdi-24px mdi-light"></i>\n <md-tooltip md-direction="top">{{error.message || \'Service temporarily unavailable.\'}}</md-tooltip>\n <span class="chat-error-message">{{error.message || \'Service temporarily unavailable.\'}}</span>\n </div>\n \x3c!-- CHAT ERROR --\x3e\n\n</md-content>\n\x3c!-- / CHAT CONTENT --\x3e\n\n\x3c!-- CHAT FOOTER --\x3e\n<div class="chat-footer flex-noshrink" layout="row" layout-align="center center">\n \x3c!-- REPLY FORM --\x3e\n <form ng-submit="vm.reply()" class="reply-form" layout="row" flex>\n <md-input-container md-no-float flex>\n <textarea id="emoji-area" ng-keyup="vm.reply($event)" md-no-autogrow ng-model="vm.replyMessage" ng-class="{\'grow\': vm.textareaGrow}" placeholder="Type and hit enter to send message" emoji-picker emoji-attachment-location="bottom right" emoji-menu-location="top left"\n emoji-popup-button-classes="mdi mdi-emoticon mdi-24px" emoji-assets-path="assets/images/ng-emoji-picker">\n </textarea>\n </md-input-container>\n\n <div layout="column" flex="10">\n <md-button class="md-fab md-mini" type="submit" aria-label="Send message" translate translate-attr-aria-label="CHAT.SEND_MESSAGE" ng-style="{\'background-color\': \'{{settings.color_button}}\', \'margin-bottom\': \'2px\'}">\n <i class="mdi mdi-send mdi-24px mdi-light"></i>\n </md-button>\n\n <md-button ng-if="settings.enableCustomerAttachment" class="md-fab md-mini md-warn" type="button" aria-label="Send message" translate translate-attr-aria-label="CHAT.SEND_MESSAGE" ng-style="{\'margin-top\': \'2px\'}" flow-init flow-btn flow-file-added="vm.fileAdded($file, $event, $flow)">\n <i class="mdi mdi-attachment mdi-24px mdi-light"></i>\n </md-button>\n </div>\n </form>\n \x3c!-- / REPLY FORM --\x3e\n</div>\n\x3c!-- / CHAT FOOTER--\x3e\n'), e.put("app/closing/index.html", '\x3c!-- CHAT CONTENT --\x3e\n<md-content id="chat-content-form" flex ms-scroll>\n \x3c!-- CHAT ERROR --\x3e\n <div class="chat-error" ng-repeat="error in vm.errors" layout="row" layout-margin>\n <i class="mdi mdi-alert mdi-24px mdi-light"></i>\n <md-tooltip md-direction="top">{{error.message || \'Service temporarily unavailable.\'}}</md-tooltip>\n <span class="chat-error-message">{{error.message || \'Service temporarily unavailable.\'}}</span>\n </div>\n \x3c!-- CHAT ERROR --\x3e\n\n <md-content layout="row" layout-align="center end">\n {{ settings.closingMessage }}\n </md-content>\n\n <form name="vm.userForm" layout="column" ng-submit="vm.submit()" novalidate>\n <md-input-container ng-if="settings.enableRating" class="md-block" ng-switch="settings.ratingType">\n \x3c!-- START thumb rating --\x3e\n <md-radio-group name="ratingValue" ng-switch-when="thumb" ng-model="vm.form.ratingValue" ng-change="vm.upColor = vm.form.ratingValue ? \'green\' : null; vm.downColor = !vm.form.ratingValue ? \'red\' : null;" layout="row" layout-align="center center">\n <md-radio-button ng-value="1" class="thumb">\n <div class="{{vm.upColor}}">\n <i class="mdi mdi-48px mdi-thumb-up-outline"></i>\n </div>\n </md-radio-button>\n <md-radio-button ng-value="0" class="thumb">\n <div class="{{vm.downColor}}">\n <i class="mdi mdi-48px mdi-thumb-down-outline"></i>\n </div>\n </md-radio-button>\n </md-radio-group>\n \x3c!-- END thumb rating --\x3e\n\n \x3c!-- START star rating --\x3e\n <div ng-switch-when="star" layout="row" layout-align="center center">\n <ng-rate-it name="ratingValue" ng-model="vm.form.ratingValue" min="0" max="settings.ratingStarsNumber" step="1" star-width="32" star-height="32" class="bigstar rate" resetable="false"></ng-rate-it>\n </div>\n \x3c!-- END star rating --\x3e\n </md-input-container>\n\n <md-input-container ng-if="settings.enableFeedback" class="md-block">\n \x3c!-- START textarea --\x3e\n <label>Feedback</label>\n <textarea name="message" ng-model="vm.form.ratingMessage" md-maxlength="150" rows="5"></textarea>\n \x3c!-- END textarea --\x3e\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="settings.forwardTranscript">\n <span ng-if="settings.forwardTranscriptMessage">{{settings.forwardTranscriptMessage}}</span>\n <label ng-if="!settings.forwardTranscriptMessage">Email</label>\n \x3c!-- START email --\x3e\n <input type="email" name="mailTranscript" ng-model="vm.form.mailTranscript">\n <div ng-messages="vm.userForm[\'mailTranscript\'].$error" ng-show="vm.userForm[\'mailTranscript\'].$touched" role="alert">\n <div ng-message="email">\n <span>Email must be a valid e-mail address</span>\n </div>\n </div>\n \x3c!-- END email --\x3e\n </md-input-container>\n\n <md-button ng-if="settings.enableRating || settings.enableFeedback || settings.forwardTranscript" type="submit" class="md-raised" ng-disabled="vm.userForm.$invalid" ng-style="{\'background-color\': \'{{settings.color_button}}\'}">{{settings.closingMessageButton}}</md-button>\n <md-button class="md-raised" ng-style="{\'background-color\': \'{{settings.color_button}}\'}" ng-click="vm.skip()">{{settings.skipMessageButton}}</md-button>\n </form>\n\n <md-content layout="row" layout-align="center end">\n {{ (settings.custom && !settings.defaultWhiteLabel) ? \'Powered By XCALLY\' : settings.whiteLabel }}\n </md-content>\n\n</md-content>\n\x3c!-- / CHAT CONTENT --\x3e\n'), e.put("app/offline/index.html", '\x3c!-- CHAT CONTENT --\x3e\n<md-content id="chat-content-form" flex ms-scroll>\n <form ng-if="vm.fields.length" name="vm.userForm" layout="column" ng-submit="vm.submit()" novalidate>\n <div ng-repeat="field in vm.fields | orderBy:\'index\'" layout="column">\n <label>{{field.props.title}}</label>\n <span style="font-size: 13px; line-height: 14px; color: grey;">\n <div ng-bind-html="field.props.helpText | embed:{linkTarget:\'_blank\'}"></div>\n </span>\n\n \x3c!-- CHAT ERROR --\x3e\n <div class="chat-error" ng-repeat="error in vm.errors" layout="row" layout-margin>\n <i class="mdi mdi-alert mdi-24px mdi-light"></i>\n <md-tooltip md-direction="top">{{error.message || \'Service temporarily unavailable.\'}}</md-tooltip>\n <span class="chat-error-message">{{error.message || \'Service temporarily unavailable.\'}}</span>\n </div>\n \x3c!-- CHAT ERROR --\x3e\n\n <md-input-container class="md-block" ng-switch="field.type">\n \x3c!-- START label --\x3e\n <div ng-switch-when="label">\n <md-content flex layout-padding layout="row" layout-align="center center">\n <span>{{field.value}}</span>\n </md-content>\n </div>\n \x3c!-- END label --\x3e\n\n \x3c!-- START textinput --\x3e\n <div ng-switch-when="input">\n <input name="{{field.props.title}}" ng-model="vm.form[field.props.title]" type="{{field.config.type}}" placeholder="{{field.config.placeholder}}" ng-required="field.config.required">\n </div>\n \x3c!-- END textinput --\x3e\n\n \x3c!-- START textarea --\x3e\n <div ng-switch-when="textarea">\n <textarea name="{{field.props.title}}" ng-model="vm.form[field.props.title]" md-maxlength="150" rows="5"></textarea>\n </div>\n \x3c!-- END textarea --\x3e\n\n \x3c!-- START select --\x3e\n <div ng-switch-when="chooseFromList">\n <md-select name="{{field.props.title}}"ng-model="vm.form[field.props.title]" placeholder="{{field.config.placeholder}}" ng-required="field.config.required">\n <md-option ng-repeat="option in field.options" ng-value="option.value">{{option.value}}</md-option>\n </md-select>\n </div>\n \x3c!-- END select --\x3e\n\n \x3c!-- START radio --\x3e\n <div ng-switch-when="multipleChoices" layout="{{field.config.direction === \'vertical\' ? \'row\' : \'column\'}}">\n <md-radio-group name="{{field.props.title}}" ng-model="vm.form[field.props.title]" ng-required="field.config.required" layout="{{field.config.direction === \'vertical\' ? \'column\' : \'row\'}}">\n <md-radio-button ng-repeat="option in field.options" value="{{option.value}}" class="md-primary">{{option.value}}</md-radio-button>\n </md-radio-group>\n </div>\n \x3c!-- END radio --\x3e\n\n \x3c!-- START checkbox --\x3e\n <div ng-switch-when="checkboxes" layout="{{field.config.direction === \'vertical\' ? \'row\' : \'column\'}}">\n <div layout="{{field.config.direction === \'vertical\' ? \'column\' : \'row\'}}">\n <md-checkbox\n aria-label="{{field.props.title}}"\n ng-repeat="option in field.options"\n ng-checked="vm.exists(field.props.title, option.value)"\n ng-disabled="!vm.exists(field.props.title, option.value) && field.config.maxSelections === vm.form[field.props.title].length"\n ng-click="vm.toggle(field.props.title, option.value)"\n flex>\n {{option.value}}\n </md-checkbox>\n </div>\n </div>\n \x3c!-- END checkbox --\x3e\n\n \x3c!-- START agreement --\x3e\n <div ng-switch-when="agreement" layout="column">\n <md-checkbox\n ng-model="vm.form[field.props.title]"\n aria-label="{{field.props.title}}"\n ng-required="field.config.required">\n {{field.options[0].value}}\n </md-checkbox>\n </div>\n \x3c!-- END agreement --\x3e\n </md-input-container>\n </div>\n\n <md-button type="submit" class="md-raised" ng-disabled="vm.userForm.$invalid || vm.userForm.$pristine" ng-style="{\'background-color\': \'{{settings.color_button}}\'}">{{settings.offline_chat_button}}</md-button>\n </form>\n\n <md-content layout="row" layout-align="center end">\n {{ (settings.custom && !settings.defaultWhiteLabel) ? \'Powered By XCALLY\' : settings.whiteLabel }}\n </md-content>\n\n</md-content>\n\x3c!-- / CHAT CONTENT --\x3e\n'), e.put("app/online/index.html", '\x3c!-- CHAT CONTENT --\x3e\n<md-content id="chat-content-form" flex ms-scroll>\n <form ng-if="vm.fields.length" name="vm.userForm" layout="column" ng-submit="vm.submit()" novalidate>\n <div ng-repeat="field in vm.fields | orderBy:\'index\'" layout="column">\n <label>{{field.props.title}}</label>\n <span style="font-size: 13px; line-height: 14px; color: grey;">\n <div ng-bind-html="field.props.helpText | embed:{linkTarget:\'_blank\'}"></div>\n </span>\n\n <md-input-container class="md-block" ng-switch="field.type">\n \x3c!-- START label --\x3e\n <div ng-switch-when="label">\n <md-content flex layout-padding layout="row" layout-align="center center">\n <span>{{field.value}}</span>\n </md-content>\n </div>\n \x3c!-- END label --\x3e\n\n \x3c!-- START textinput --\x3e\n <div ng-switch-when="input">\n <input name="{{field.props.title}}" ng-model="vm.form[field.props.title]" type="{{field.config.type}}" placeholder="{{field.config.placeholder}}" ng-required="field.config.required">\n </div>\n \x3c!-- END textinput --\x3e\n\n \x3c!-- START textarea --\x3e\n <div ng-switch-when="textarea">\n <textarea name="{{field.props.title}}" ng-model="vm.form[field.props.title]" md-maxlength="150" rows="5"></textarea>\n </div>\n \x3c!-- END textarea --\x3e\n\n \x3c!-- START select --\x3e\n <div ng-switch-when="chooseFromList">\n <md-select name="{{field.props.title}}" ng-model="vm.form[field.props.title]" placeholder="{{field.config.placeholder}}" ng-required="field.config.required">\n <md-option ng-repeat="option in field.options" ng-value="option.value">{{option.value}}</md-option>\n </md-select>\n </div>\n \x3c!-- END select --\x3e\n\n \x3c!-- START radio --\x3e\n <div ng-switch-when="multipleChoices" layout="column">\n <md-radio-group name="{{field.props.title}}" ng-model="vm.form[field.props.title]" ng-required="field.config.required" layout="{{field.config.direction === \'vertical\' ? \'column\' : \'row\'}}">\n <md-radio-button ng-repeat="option in field.options" value="{{option.value}}" class="md-primary">{{option.value}}</md-radio-button>\n </md-radio-group>\n </div>\n \x3c!-- END radio --\x3e\n\n \x3c!-- START checkbox --\x3e\n <div ng-switch-when="checkboxes" layout="{{field.config.direction === \'vertical\' ? \'row\' : \'column\'}}">\n <md-checkbox\n aria-label="{{field.props.title}}"\n ng-repeat="option in field.options"\n ng-checked="vm.exists(field.props.title, option.value)"\n ng-disabled="!vm.exists(field.props.title, option.value) && field.config.maxSelections === vm.form[field.props.title].length"\n ng-required="vm.getSelected()"\n ng-click="vm.toggle(field.props.title, option.value)">\n {{option.value}}\n </md-checkbox>\n </div>\n \x3c!-- END checkbox --\x3e\n\n \x3c!-- START agreement --\x3e\n <div ng-switch-when="agreement" layout="{{field.config.direction === \'vertical\' ? \'row\' : \'column\'}}">\n <md-checkbox\n ng-model="vm.form[field.props.title]"\n aria-label="{{field.props.title}}"\n ng-required="field.config.required">\n {{field.options[0].value}}\n </md-checkbox>\n </div>\n \x3c!-- END agreement --\x3e\n </md-input-container>\n </div>\n\n <md-button type="submit" class="md-raised" ng-disabled="vm.userForm.$invalid || vm.userForm.$pristine" ng-style="{\'background-color\': \'{{settings.color_button}}\'}">{{settings.start_chat_button}}</md-button>\n </form>\n\n <md-content layout="row" layout-align="center end" style="background: transparent;">\n {{ (settings.custom && !settings.defaultWhiteLabel) ? settings.whiteLabel : \'Powered By XCALLY\' }}\n </md-content>\n\n</md-content>\n\x3c!-- / CHAT CONTENT --\x3e\n'), e.put("app/unmanaged/index.html", '\x3c!-- CHAT CONTENT --\x3e\n<md-content id="chat-content-form" flex ms-scroll>\n \x3c!-- CHAT ERROR --\x3e\n <div class="chat-error" ng-repeat="error in vm.errors" layout="row" layout-margin>\n <i class="mdi mdi-alert mdi-24px mdi-light"></i>\n <md-tooltip md-direction="top">{{error.message || \'Service temporarily unavailable.\'}}</md-tooltip>\n <span class="chat-error-message">{{error.message || \'Service temporarily unavailable.\'}}</span>\n </div>\n \x3c!-- CHAT ERROR --\x3e\n\n <md-content layout="row" layout-align="center end">\n {{ settings.unmanagedMessage }}\n </md-content>\n\n <form name="vm.userForm" layout="column" ng-submit="vm.submit()" novalidate>\n <md-input-container ng-if="settings.enableUnmanagedNote" class="md-block">\n \x3c!-- START textarea --\x3e\n <label>Note</label>\n <textarea name="note" ng-model="vm.form.note" md-maxlength="255" rows="5"></textarea>\n \x3c!-- END textarea --\x3e\n </md-input-container>\n\n <md-button ng-if="settings.enableUnmanagedNote" type="submit" class="md-raised" ng-disabled="vm.userForm.$invalid" ng-style="{\'background-color\': \'{{settings.color_button}}\'}">{{settings.sendUnmanaged}}</md-button>\n <md-button class="md-raised" ng-style="{\'background-color\': \'{{settings.color_button}}\'}" ng-click="vm.skip()">{{settings.skipUnmanaged}}</md-button>\n </form>\n\n <md-content layout="row" layout-align="center end">\n {{ (settings.custom && !settings.defaultWhiteLabel) ? \'Powered By XCALLY\' : settings.whiteLabel }}\n </md-content>\n\n</md-content>\n\x3c!-- / CHAT CONTENT --\x3e\n'), e.put("app/waiting/index.html", '\x3c!-- WAITING CONTENT --\x3e\n<md-content id="waiting" layout="column" layout-align="center center" flex>\n <div layout="row" layout-align="center center" class="md-accent-bg" flex="50">\n <md-progress-circular md-diameter="100"></md-progress-circular>\n </div>\n <div layout="row" layout-align="center end" class="title" flex="25">\n {{settings.waitingTitle}}\n </div>\n <div layout="row" layout-align="center start" class="subtitle" flex="25">\n {{settings.waitingMessage}}\n </div>\n</md-content>\n\x3c!-- / WAITING CONTENT --\x3e\n')
}]);
\ No newline at end of file