diff --git a/src/messenger/webim/js/compiled/chat/model_views/survey/base_survey_form.js b/src/messenger/webim/js/compiled/chat/model_views/survey/base_survey_form.js
index c599866d..a0ef4d16 100644
--- a/src/messenger/webim/js/compiled/chat/model_views/survey/base_survey_form.js
+++ b/src/messenger/webim/js/compiled/chat/model_views/survey/base_survey_form.js
@@ -5,5 +5,5 @@
Copyright (c) 2005-2011 Mibew Messenger Community
License: http://mibew.org/license.php
*/
-(function(c,d){c.Views.BaseSurveyForm=d.Marionette.ItemView.extend({events:{'change select[name="group"]':"changeGroupDescription","submit form":"preventSubmit"},ui:{groupSelect:'select[name="group"]',groupDescription:"#groupDescription",name:'input[name="name"]',email:'input[name="email"]',message:'textarea[name="message"]',errors:".errors"},modelEvents:{invalid:"showError","submit:error":"showError"},preventSubmit:function(b){b.preventDefault()},changeGroupDescription:function(){var b=this.ui.groupSelect.prop("selectedIndex"),
-a=this.model.get("groups").descriptions||[];this.ui.groupDescription.text(a[b]||"")},showError:function(b,a){this.ui.errors.html("string"==typeof a?a:a.message)}})})(Mibew,Backbone);
+(function(c,d){c.Views.BaseSurveyForm=d.Marionette.ItemView.extend({events:{'change select[name="group"]':"changeGroupDescription","submit form":"preventSubmit"},ui:{groupSelect:'select[name="group"]',groupDescription:"#groupDescription",name:'input[name="name"]',email:'input[name="email"]',message:'textarea[name="message"]',errors:".errors"},modelEvents:{invalid:"showError","submit:error":"showError"},preventSubmit:function(a){a.preventDefault()},changeGroupDescription:function(){var a=this.ui.groupSelect.prop("selectedIndex"),
+a=this.model.get("groups")[a].description||"";this.ui.groupDescription.text(a)},showError:function(a,b){this.ui.errors.html("string"==typeof b?b:b.message)}})})(Mibew,Backbone);
diff --git a/src/messenger/webim/js/compiled/chat_app.js b/src/messenger/webim/js/compiled/chat_app.js
index cc789d30..4cde48c5 100644
--- a/src/messenger/webim/js/compiled/chat_app.js
+++ b/src/messenger/webim/js/compiled/chat_app.js
@@ -164,8 +164,8 @@ a);this.trigger("multiple:add");return a}})})(Mibew,Backbone,_);
Copyright (c) 2005-2011 Mibew Messenger Community
License: http://mibew.org/license.php
*/
-(function(c,d){c.Views.BaseSurveyForm=d.Marionette.ItemView.extend({events:{'change select[name="group"]':"changeGroupDescription","submit form":"preventSubmit"},ui:{groupSelect:'select[name="group"]',groupDescription:"#groupDescription",name:'input[name="name"]',email:'input[name="email"]',message:'textarea[name="message"]',errors:".errors"},modelEvents:{invalid:"showError","submit:error":"showError"},preventSubmit:function(b){b.preventDefault()},changeGroupDescription:function(){var b=this.ui.groupSelect.prop("selectedIndex"),
-a=this.model.get("groups").descriptions||[];this.ui.groupDescription.text(a[b]||"")},showError:function(b,a){this.ui.errors.html("string"==typeof a?a:a.message)}})})(Mibew,Backbone);
+(function(c,d){c.Views.BaseSurveyForm=d.Marionette.ItemView.extend({events:{'change select[name="group"]':"changeGroupDescription","submit form":"preventSubmit"},ui:{groupSelect:'select[name="group"]',groupDescription:"#groupDescription",name:'input[name="name"]',email:'input[name="email"]',message:'textarea[name="message"]',errors:".errors"},modelEvents:{invalid:"showError","submit:error":"showError"},preventSubmit:function(a){a.preventDefault()},changeGroupDescription:function(){var a=this.ui.groupSelect.prop("selectedIndex"),
+a=this.model.get("groups")[a].description||"";this.ui.groupDescription.text(a)},showError:function(a,b){this.ui.errors.html("string"==typeof b?b:b.message)}})})(Mibew,Backbone);
/*
This file is part of Mibew Messenger project.
http://mibew.org
diff --git a/src/messenger/webim/js/source/chat/model_views/survey/base_survey_form.js b/src/messenger/webim/js/source/chat/model_views/survey/base_survey_form.js
index ea2d8eed..8a3263d8 100644
--- a/src/messenger/webim/js/source/chat/model_views/survey/base_survey_form.js
+++ b/src/messenger/webim/js/source/chat/model_views/survey/base_survey_form.js
@@ -56,9 +56,11 @@
* Change group description
*/
changeGroupDescription: function() {
- var groupId = this.ui.groupSelect.prop('selectedIndex');
- var descriptions = this.model.get('groups').descriptions || [];
- this.ui.groupDescription.text(descriptions[groupId] || '');
+ var selectedIndex = this.ui.groupSelect.prop('selectedIndex');
+ var description = this.model
+ .get('groups')[selectedIndex]
+ .description || '';
+ this.ui.groupDescription.text(description);
},
/**
diff --git a/src/messenger/webim/js/source/chat/models/survey/base_survey_form.js b/src/messenger/webim/js/source/chat/models/survey/base_survey_form.js
index 7d7b52d0..f516e4d4 100644
--- a/src/messenger/webim/js/source/chat/models/survey/base_survey_form.js
+++ b/src/messenger/webim/js/source/chat/models/survey/base_survey_form.js
@@ -58,14 +58,16 @@
/**
* Available groups list.
*
- * Contains following keys:
- * - 'select': string, HTML code for select box;
- * - 'descriptions': array, groups descriptions;
- * - 'defaultDescription': string, description for group that
- * selected by default.
+ * Contains objects with following keys:
+ * - 'id': int, group id;
+ * - 'name': string, group name;
+ * - 'description': string, group description;
+ * - 'online': boolean, indicates if group online;
+ * - 'selected': boolean, indicates if group selected
+ * by default.
*
* If there is no available groups this field is equal to null.
- * @type Object
+ * @type Array
* @todo Create HTML code at client side
*/
groups: null
diff --git a/src/messenger/webim/libs/chat.php b/src/messenger/webim/libs/chat.php
index 7228ab7b..55a05759 100644
--- a/src/messenger/webim/libs/chat.php
+++ b/src/messenger/webim/libs/chat.php
@@ -231,14 +231,8 @@ function setup_leavemessage($name, $email, $group_id, $info, $referrer) {
);
if (Settings::get('enablegroups') == '1') {
- $groups = setup_groups_select($group_id, false);
- if ($groups) {
- $data['leaveMessage']['leaveMessageForm']['groups'] = array(
- 'select' => $groups['select'],
- 'descriptions' => $groups['descriptions'],
- 'defaultDescription' => $groups['defaultdescription']
- );
- }
+ $data['leaveMessage']['leaveMessageForm']['groups']
+ = prepare_groups_select($group_id);
}
$data['startFrom'] = 'leaveMessage';
@@ -280,15 +274,8 @@ function setup_survey($name, $email, $group_id, $info, $referrer) {
if (Settings::get('enablegroups') == '1'
&& Settings::get('surveyaskgroup') == '1') {
-
- $groups = setup_groups_select($group_id, true);
- if ($groups) {
- $data['survey']['surveyForm']['groups'] = array(
- 'select' => $groups['select'],
- 'descriptions' => $groups['descriptions'],
- 'defaultDescription' => $groups['defaultdescription'],
- );
- }
+ $data['survey']['surveyForm']['groups']
+ = prepare_groups_select($group_id);
}
$data['startFrom'] = 'survey';
@@ -296,48 +283,81 @@ function setup_survey($name, $email, $group_id, $info, $referrer) {
return $data;
}
-function setup_groups_select($groupid, $markoffline)
-{
- $showgroups = ($groupid == '')?true:group_has_children($groupid);
- if (!$showgroups) {
+/**
+ * Prepare groups list to build group select box.
+ *
+ * If $group_id specified groups list will consist of group with id equals to
+ * $group_id and its children.
+ *
+ * @param int $group_id Id of selected group
+ * @return array|boolean Array of groups info arrays or boolean false if there
+ * are no suitable groups.
+ * Group info array contain following keys:
+ * - 'id': int, group id;
+ * - 'name': string, group name;
+ * - 'description': string, group description;
+ * - 'online': boolean, indicates if group online;
+ * - 'selected': boolean, indicates if group selected by default.
+ */
+function prepare_groups_select($group_id) {
+ $show_groups = ($group_id == '')
+ ? true
+ : group_has_children($group_id);
+
+ if (!$show_groups) {
return false;
}
- $allgroups = get_groups(false);
+ $all_groups = get_groups(false);
- if (empty($allgroups)) {
+ if (empty($all_groups)) {
return false;
}
- $val = "";
- $selectedgroupid = $groupid;
- $groupdescriptions = array();
- $defaultdescription = "";
- foreach ($allgroups as $k) {
- $groupname = $k['vclocalname'];
- if ($k['inumofagents'] == 0 || ($groupid && $k['parent'] != $groupid && $k['groupid'] != $groupid )) {
+ $groups_list = array();
+ $selected_group_id = $group_id;
+
+ foreach($all_groups as $group) {
+ $group_is_empty = (bool)($group['inumofagents'] == 0);
+ $group_related_with_specified = (empty($group_id)
+ || $group['parent'] == $group_id
+ || $group['groupid'] == $group_id);
+
+ if ($group_is_empty || !$group_related_with_specified) {
continue;
}
- if ($k['ilastseen'] !== NULL && $k['ilastseen'] < Settings::get('online_timeout')) {
- if (!$selectedgroupid) {
- $selectedgroupid = $k['groupid']; // select first online group
- }
- } else {
- $groupname .= $markoffline?" (offline)":"";
+
+ if (group_is_online($group) && !$selected_group_id) {
+ $selected_group_id = $group['groupid'];
}
- $isselected = $k['groupid'] == $selectedgroupid;
- if ($isselected) {
- $defaultdescription = $k['vclocaldescription'];
- }
- $val .= "";
- $groupdescriptions[] = $k['vclocaldescription'];
+
+ $groups_list[] = array(
+ 'id' => $group['groupid'],
+ 'name' => get_group_name($group),
+ 'description' => get_group_description($group),
+ 'online' => group_is_online($group),
+ 'selected' => (bool)($group['groupid'] == $selected_group_id)
+ );
}
- return array(
- 'select' => $val,
- 'descriptions' => $groupdescriptions,
- 'defaultdescription' => $defaultdescription
- );
+ // One group must be selected by default
+ if (! empty($groups_list)) {
+ // Check if there is selected group
+ $selected_group_present = false;
+ foreach($groups_list as $group) {
+ if ($group['selected']) {
+ $selected_group_present = true;
+ break;
+ }
+ }
+
+ // If there is no selected group select the first one
+ if (! $selected_group_present) {
+ $groups_list[0]['selected'] = true;
+ }
+ }
+
+ return $groups_list;
}
/**
diff --git a/src/messenger/webim/styles/dialogs/default/handlebars_templates/leave_message/form.handlebars b/src/messenger/webim/styles/dialogs/default/handlebars_templates/leave_message/form.handlebars
index cb12a115..e2fe15a8 100644
--- a/src/messenger/webim/styles/dialogs/default/handlebars_templates/leave_message/form.handlebars
+++ b/src/messenger/webim/styles/dialogs/default/handlebars_templates/leave_message/form.handlebars
@@ -18,11 +18,19 @@
{{#if groups}}
{{L10n "form.field.department"}} |
- |
+
+
+ |
{{L10n "form.field.department.description"}} |
- {{groups.defaultDescription}} |
+
+ {{#each groups}}{{#if this.selected}}{{this.description}}{{/if}}{{/each}}
+ |
{{/if}}
diff --git a/src/messenger/webim/styles/dialogs/default/handlebars_templates/survey/form.handlebars b/src/messenger/webim/styles/dialogs/default/handlebars_templates/survey/form.handlebars
index 47b43a5a..9a04eeac 100644
--- a/src/messenger/webim/styles/dialogs/default/handlebars_templates/survey/form.handlebars
+++ b/src/messenger/webim/styles/dialogs/default/handlebars_templates/survey/form.handlebars
@@ -13,11 +13,17 @@
{{#if groups}}
{{L10n "form.field.department"}} |
- |
+
+
+ |
{{L10n "form.field.department.description"}} |
- {{groups.defaultDescription}} |
+ {{#each groups}}{{#if this.selected}}{{this.description}}{{/if}}{{/each}} |
{{/if}}
diff --git a/src/messenger/webim/styles/dialogs/default/js/compiled/templates.js b/src/messenger/webim/styles/dialogs/default/js/compiled/templates.js
index 0281befe..de671152 100644
--- a/src/messenger/webim/styles/dialogs/default/js/compiled/templates.js
+++ b/src/messenger/webim/styles/dialogs/default/js/compiled/templates.js
@@ -4,58 +4,60 @@
Copyright (c) 2005-2011 Mibew Messenger Community
License: http://mibew.org/license.php
*/
-(function(){var r=Handlebars.template,s=Handlebars.templates=Handlebars.templates||{};s.chat_avatar=r(function(a,c,g,b,f){this.compilerInfo=[2,">= 1.0.0-rc.3"];g=g||a.helpers;f=f||{};var j=this.escapeExpression;return(a=g["if"].call(c,c.imageLink,{hash:{},inverse:this.program(3,function(){return''},f),fn:this.program(1,function(a,b){var f,c;f=''},f),data:f}))||0===a?a:""});s.chat_controls_close=r(function(a,c,g,b,f){this.compilerInfo=[2,">= 1.0.0-rc.3"];g=g||a.helpers;f=f||{};var j;a=g.helperMissing;b=this.escapeExpression;f={hash:{},data:f};return c='')});s.chat_controls_history=r(function(a,c,g,b,f){this.compilerInfo=[2,">= 1.0.0-rc.3"];g=g||a.helpers;f=f||{};var j;a=g.helperMissing;
-b=this.escapeExpression;f={hash:{},data:f};return c='')});s.chat_controls_redirect=r(function(a,c,g,b,f){this.compilerInfo=[2,">= 1.0.0-rc.3"];g=g||a.helpers;f=f||{};var j,k=g.helperMissing,l=this.escapeExpression;return(a=g["if"].call(c,(j=c.user,null==j||!1===j?j:j.canPost),{hash:{},inverse:this.noop,fn:this.program(1,function(a,b){var c,f;
-c={hash:{},data:b};return c='\n\n')},f),data:f}))||0===a?a:""});s.chat_controls_refresh=r(function(a,c,g,b,f){this.compilerInfo=[2,">= 1.0.0-rc.3"];g=g||a.helpers;f=f||{};var j;a=g.helperMissing;b=this.escapeExpression;f={hash:{},data:f};return c='')});s.chat_controls_secure_mode=r(function(){this.compilerInfo=[2,">= 1.0.0-rc.3"];return''});s.chat_controls_send_mail=r(function(a,c,g,b,f){this.compilerInfo=[2,">= 1.0.0-rc.3"];g=g||a.helpers;f=f||{};var j;a=g.helperMissing;b=this.escapeExpression;f={hash:{},data:f};return c='')});s.chat_controls_sound=r(function(a,c,g,b,f){this.compilerInfo=[2,">= 1.0.0-rc.3"];g=g||a.helpers;f=f||{};var j=g.helperMissing,k=this.escapeExpression;return(a=g["if"].call(c,c.enabled,{hash:{},inverse:this.program(3,function(a,b){var c,f;c={hash:{},data:b};return c='\n \n')},f),fn:this.program(1,function(a,
-b){var c,f;c={hash:{},data:b};return c='\n \n')},f),data:f}))||0===a?a:""});s.chat_controls_user_name=r(function(a,c,g,b,f){function j(a,c){var e,d,b;e=""+('\n \n \n '}function k(a,b){var e,d,c;c={hash:{},data:b};e='\n '+h((d=(d=a.user,null==d||!1===
-d?d:d.name),typeof d===p?d.apply(a):d))+'\n \n '}this.compilerInfo=[2,">= 1.0.0-rc.3"];g=g||a.helpers;f=f||{};var l,p="function",h=this.escapeExpression,m=g.helperMissing,n=this;return(a=g["if"].call(c,(l=c.user,null==l||!1===l?l:l.canChangeName),{hash:{},inverse:n.program(6,function(a,c){var e,d;
-e={hash:{},data:c};return e="\n"+(h((d=g.L10n,d?d.call(a,"chat.client.name",e):m.call(a,"L10n","chat.client.name",e)))+" "+h((d=(d=a.user,null==d||!1===d?d:d.name),typeof d===p?d.apply(a):d))+"\n")},f),fn:n.program(1,function(a,c){var e,d;e={hash:{},data:c};e='\n '+(h((d=g.L10n,d?d.call(a,"chat.client.name",e):m.call(a,"L10n","chat.client.name",e)))+"\n ");if((d=g["if"].call(a,a.nameInput,{hash:{},inverse:n.program(4,k,c),fn:n.program(2,j,c),
-data:c}))||0===d)e+=d;return e+="\n"},f),data:f}))||0===a?a:""});s.chat_layout=r(function(a,c,g,b,f){function j(e){var d;return e=""+('\n \n ')}function k(e){var d;return e=""+("\n \n \n \n ')}function l(e){var d;return e=""+("\n \n \n \n ')}function p(e){var d;return e=""+('\n \n ')}this.compilerInfo=[2,">= 1.0.0-rc.3"];g=g||a.helpers;f=f||{};var h,m,n="function",q=this.escapeExpression,t=this;b=g.helperMissing;
-a='\n\n
\n ';if((m=g["if"].call(c,(h=(h=c.page,null==h||!1===h?h:h.company),null==h||!1===h?h:h.chatLogoURL),{hash:{},inverse:t.program(6,function(e,d){var a,c,b;a="\n ";if((b=g["if"].call(e,(c=e.page,null==c||!1===c?c:c.webimHost),{hash:{},inverse:t.program(9,p,d),fn:t.program(7,l,d),data:d}))||0===b)a+=b;return a+"\n "},f),fn:t.program(1,function(e,d){var a,c,b;a="\n \n ";if((b=g.unless.call(e,(c=e.page,null==c||!1===
-c?c:c.webimHost),{hash:{},inverse:t.program(4,k,d),fn:t.program(2,j,d),data:d}))||0===b)a+=b;return a+"\n "},f),data:f}))||0===m)a+=m;a+='\n \n
'+q((h=(h=c.page,null==h||!1===h?h:h.title),typeof h===n?h.apply(c):h))+'
\n
\n
\n
\n\n\n\n\n\n\n
\n ';
-if((m=g.unless.call(c,(h=c.user,null==h||!1===h?h:h.isAgent),{hash:{},inverse:t.noop,fn:t.program(11,function(){return'\n
\n '},f),data:f}))||0===m)a+=m;f={hash:{},data:f};return a=a+'\n \n
\n \n
\n
\n
\n\n\n\n\n\n')});s.chat_message=r(function(a,c,g,b,f){this.compilerInfo=[2,">= 1.0.0-rc.3"];g=g||a.helpers;f=f||{};var j,k=this.escapeExpression,l=g.helperMissing;a={hash:{},data:f};a=""+(k((j=g.formatTime,j?j.call(c,c.created,a):l.call(c,"formatTime",c.created,a)))+" \n");if((j=g["if"].call(c,c.name,{hash:{},inverse:this.noop,fn:this.program(1,function(a,
-c){var b,f;b="";(f=g.name)?f=f.call(a,{hash:{},data:c}):(f=a.name,f="function"===typeof f?f.apply(a):f);return b+=k(f)+": "},f),data:f}))||0===j)a+=j;a+="\n";if((j=g["if"].call(c,c.allowFormatting,{hash:{},inverse:this.program(5,function(a,c){var b,
-f;f={hash:{},data:c};return k((b=g.apply,b?b.call(a,a.message,"urlReplace, nl2br",f):l.call(a,"apply",a.message,"urlReplace, nl2br",f)))},f),fn:this.program(3,function(a,c){var b,f;f={hash:{},data:c};return k((b=g.apply,b?b.call(a,a.message,"urlReplace, nl2br, allowTags",f):l.call(a,"apply",a.message,"urlReplace, nl2br, allowTags",f)))},f),data:f}))||0===j)a+=j;return a+="
"});s.chat_message_form=r(function(a,c,g,b,f){function j(a,c){var e,d;e={hash:{},data:c};e='\n \n "}function k(a){var c;return a=""+("\n \n ")}this.compilerInfo=[2,">= 1.0.0-rc.3"];g=g||
-a.helpers;f=f||{};var l,p="function",h=this.escapeExpression,m=g.helperMissing,n=this;a='\n';if((b=g["if"].call(c,(l=c.user,null==l||!1===l?l:l.canPost),{hash:{},inverse:n.noop,fn:n.program(1,function(){return'\n
\n'},f),data:f}))||0===b)a+=b;a+='\n
\n\n\n';if((b=g["if"].call(c,(l=c.user,
-null==l||!1===l?l:l.canPost),{hash:{},inverse:n.noop,fn:n.program(3,function(a,c){var e,d,b;e='\n
\n
\n ';if((b=g["if"].call(a,(d=a.user,null==d||!1===d?d:d.isAgent),{hash:{},inverse:n.noop,fn:n.program(4,j,c),data:c}))||0===b)e+=b;b={hash:{},data:c};e=e+'\n
\n
');b={hash:{},data:c};return e+=h((d=g.L10n,d?d.call(a,"chat.window.send_message_short_and_shortcut",b):m.call(a,"L10n","chat.window.send_message_short_and_shortcut",b)))+"\n
\n"},f),data:f}))||0===b)a+=b;return a+'\n
\n'});s.chat_status_base=r(function(a,c,g,b,f){this.compilerInfo=[2,">= 1.0.0-rc.3"];g=g||a.helpers;f=f||{};a=this.escapeExpression;(g=g.title)?g=g.call(c,{hash:{},data:f}):(g=c.title,g="function"===typeof g?g.apply(c):g);return a(g)});
-s.chat_status_message=r(function(a,c,g,b,f){this.compilerInfo=[2,">= 1.0.0-rc.3"];g=g||a.helpers;f=f||{};a=this.escapeExpression;(g=g.message)?g=g.call(c,{hash:{},data:f}):(g=c.message,g="function"===typeof g?g.apply(c):g);return a(g)});s.chat_status_typing=r(function(a,c,g,b,f){this.compilerInfo=[2,">= 1.0.0-rc.3"];g=g||a.helpers;f=f||{};var j;a=g.helperMissing;b=this.escapeExpression;f={hash:{},data:f};return b((j=g.L10n,j?j.call(c,"typing.remote",f):a.call(c,"L10n","typing.remote",f)))});s.leave_message_description=
-r(function(a,c,g,b,f){this.compilerInfo=[2,">= 1.0.0-rc.3"];g=g||a.helpers;f=f||{};var j,k=g.helperMissing,l=this.escapeExpression;b={hash:{},data:f};a='\n';b={hash:{},data:f};return a+=l((j=g.L10n,j?j.call(c,"leavemessage.descr",b):k.call(c,"L10n","leavemessage.descr",b)))+"
"});s.leave_message_form=r(function(a,c,g,b,f){function j(a,c){var b,e;b=''}this.compilerInfo=
-[2,">= 1.0.0-rc.3"];g=g||a.helpers;f=f||{};var k,l="function",p=this.escapeExpression,h=this,m=g.helperMissing;a=""+(''});
-s.leave_message_layout=r(function(a,c,g,b,f){function j(a){var e;return a=""+('\n \n ')}function k(a){var e;return a=""+("\n \n \n \n ')}function l(a){var e;return a=""+("\n \n \n \n ')}function p(a){var e;return a=""+('\n \n ')}this.compilerInfo=[2,">= 1.0.0-rc.3"];g=g||a.helpers;f=f||{};var h,m="function",n=this.escapeExpression,q=this;a='\n\n
\n ';if((f=g["if"].call(c,
-(h=(h=c.page,null==h||!1===h?h:h.company),null==h||!1===h?h:h.chatLogoURL),{hash:{},inverse:q.program(6,function(a,e){var d,c,b;d="\n ";if((b=g["if"].call(a,(c=a.page,null==c||!1===c?c:c.webimHost),{hash:{},inverse:q.program(9,p,e),fn:q.program(7,l,e),data:e}))||0===b)d+=b;return d+"\n "},f),fn:q.program(1,function(a,e){var d,c,b;d="\n \n ";if((b=g.unless.call(a,(c=a.page,null==c||!1===c?c:c.webimHost),{hash:{},inverse:q.program(4,k,e),fn:q.program(2,j,e),data:e}))||
-0===b)d+=b;return d+"\n "},f),data:f}))||0===f)a+=f;return a+='\n \n
'+n((h=(h=c.page,null==h||!1===h?h:h.title),typeof h===m?h.apply(c):h))+'
\n
\n
\n
\n\n\n\n\n\n'});
-s.leave_message_sent_description=r(function(a,c,g,b,f){this.compilerInfo=[2,">= 1.0.0-rc.3"];g=g||a.helpers;f=f||{};var j,k=g.helperMissing,l=this.escapeExpression;b={hash:{},data:f};a='\n';b={hash:{},data:f};return a+=l((j=g.L10n,j?j.call(c,"leavemessage.sent.message",b):k.call(c,"L10n","leavemessage.sent.message",b)))+"
"});s.survey_form=r(function(a,c,g,b,f){function j(a,c){var b,e;b=''}this.compilerInfo=[2,">= 1.0.0-rc.3"];g=g||a.helpers;f=f||{};var k,l="function",p=this.escapeExpression,h=this,m=g.helperMissing;a=""+(''});s.survey_layout=r(function(a,c,g,b,f){function j(a){var d;return a=""+('\n \n ')}function k(a){var d;return a=""+("\n \n \n \n ')}function l(a){var d;return a=""+("\n \n \n \n ')}function p(a){var d;return a=""+('\n \n ')}this.compilerInfo=[2,">= 1.0.0-rc.3"];g=g||a.helpers;f=f||{};var h,m,n="function",q=this.escapeExpression,r=this;b=g.helperMissing;
-a='\n\n
\n ';if((m=g["if"].call(c,(h=(h=c.page,null==h||!1===h?h:h.company),null==h||!1===h?h:h.chatLogoURL),{hash:{},inverse:r.program(6,function(a,d){var b,c,f;b="\n ";if((f=g["if"].call(a,(c=a.page,null==c||!1===c?c:c.webimHost),{hash:{},inverse:r.program(9,p,d),fn:r.program(7,l,d),data:d}))||0===f)b+=f;return b+"\n "},f),fn:r.program(1,function(a,b){var c,f,h;c="\n \n ";if((h=g.unless.call(a,(f=a.page,null==f||!1===
-f?f:f.webimHost),{hash:{},inverse:r.program(4,k,b),fn:r.program(2,j,b),data:b}))||0===h)c+=h;return c+"\n "},f),data:f}))||0===m)a+=m;a+='\n \n
'+q((h=(h=c.page,null==h||!1===h?h:h.title),typeof h===n?h.apply(c):h))+'
\n
\n
\n
\n\n\n\n\n\n'})})();
+(function(){var r=Handlebars.template,s=Handlebars.templates=Handlebars.templates||{};s.chat_avatar=r(function(b,c,f,a,d){this.compilerInfo=[2,">= 1.0.0-rc.3"];f=f||b.helpers;d=d||{};var g=this.escapeExpression;return(b=f["if"].call(c,c.imageLink,{hash:{},inverse:this.program(3,function(){return''},d),fn:this.program(1,function(b,a){var d,c;d=''},d),data:d}))||0===b?b:""});s.chat_controls_close=r(function(b,c,f,a,d){this.compilerInfo=[2,">= 1.0.0-rc.3"];f=f||b.helpers;d=d||{};var g;b=f.helperMissing;a=this.escapeExpression;d={hash:{},data:d};return c='')});s.chat_controls_history=r(function(b,c,f,a,d){this.compilerInfo=[2,">= 1.0.0-rc.3"];f=f||b.helpers;d=d||{};var g;b=f.helperMissing;
+a=this.escapeExpression;d={hash:{},data:d};return c='')});s.chat_controls_redirect=r(function(b,c,f,a,d){this.compilerInfo=[2,">= 1.0.0-rc.3"];f=f||b.helpers;d=d||{};var g,q=f.helperMissing,p=this.escapeExpression;return(b=f["if"].call(c,(g=c.user,null==g||!1===g?g:g.canPost),{hash:{},inverse:this.noop,fn:this.program(1,function(b,a){var c,d;
+c={hash:{},data:a};return c='\n\n')},d),data:d}))||0===b?b:""});s.chat_controls_refresh=r(function(b,c,f,a,d){this.compilerInfo=[2,">= 1.0.0-rc.3"];f=f||b.helpers;d=d||{};var g;b=f.helperMissing;a=this.escapeExpression;d={hash:{},data:d};return c='')});s.chat_controls_secure_mode=r(function(){this.compilerInfo=[2,">= 1.0.0-rc.3"];return''});s.chat_controls_send_mail=r(function(b,c,f,a,d){this.compilerInfo=[2,">= 1.0.0-rc.3"];f=f||b.helpers;d=d||{};var g;b=f.helperMissing;a=this.escapeExpression;d={hash:{},data:d};return c='')});s.chat_controls_sound=r(function(b,c,f,a,d){this.compilerInfo=[2,">= 1.0.0-rc.3"];f=f||b.helpers;d=d||{};var g=f.helperMissing,q=this.escapeExpression;return(b=f["if"].call(c,c.enabled,{hash:{},inverse:this.program(3,function(b,a){var c,d;c={hash:{},data:a};return c='\n \n')},d),fn:this.program(1,function(b,
+a){var c,d;c={hash:{},data:a};return c='\n \n')},d),data:d}))||0===b?b:""});s.chat_controls_user_name=r(function(b,c,f,a,d){function g(b,c){var j,e,a;j=""+('\n \n \n '}function q(b,a){var j,e,c;c={hash:{},data:a};j='\n '+h((e=(e=b.user,null==e||!1===
+e?e:e.name),typeof e===t?e.apply(b):e))+'\n \n '}this.compilerInfo=[2,">= 1.0.0-rc.3"];f=f||b.helpers;d=d||{};var p,t="function",h=this.escapeExpression,l=f.helperMissing,k=this;return(b=f["if"].call(c,(p=c.user,null==p||!1===p?p:p.canChangeName),{hash:{},inverse:k.program(6,function(b,c){var j,e;
+j={hash:{},data:c};return j="\n"+(h((e=f.L10n,e?e.call(b,"chat.client.name",j):l.call(b,"L10n","chat.client.name",j)))+" "+h((e=(e=b.user,null==e||!1===e?e:e.name),typeof e===t?e.apply(b):e))+"\n")},d),fn:k.program(1,function(b,c){var j,e;j={hash:{},data:c};j='\n '+(h((e=f.L10n,e?e.call(b,"chat.client.name",j):l.call(b,"L10n","chat.client.name",j)))+"\n ");if((e=f["if"].call(b,b.nameInput,{hash:{},inverse:k.program(4,q,c),fn:k.program(2,g,c),
+data:c}))||0===e)j+=e;return j+="\n"},d),data:d}))||0===b?b:""});s.chat_layout=r(function(b,c,f,a,d){function g(j){var e;return j=""+('\n \n ')}function q(j){var e;return j=""+("\n \n \n \n ')}function p(j){var e;return j=""+("\n \n \n \n ')}function t(j){var e;return j=""+('\n \n ')}this.compilerInfo=[2,">= 1.0.0-rc.3"];f=f||b.helpers;d=d||{};var h,l,k="function",m=this.escapeExpression,n=this;a=f.helperMissing;
+b='\n\n
\n ';if((l=f["if"].call(c,(h=(h=c.page,null==h||!1===h?h:h.company),null==h||!1===h?h:h.chatLogoURL),{hash:{},inverse:n.program(6,function(j,e){var b,c,a;b="\n ";if((a=f["if"].call(j,(c=j.page,null==c||!1===c?c:c.webimHost),{hash:{},inverse:n.program(9,t,e),fn:n.program(7,p,e),data:e}))||0===a)b+=a;return b+"\n "},d),fn:n.program(1,function(b,e){var c,a,d;c="\n \n ";if((d=f.unless.call(b,(a=b.page,null==a||!1===
+a?a:a.webimHost),{hash:{},inverse:n.program(4,q,e),fn:n.program(2,g,e),data:e}))||0===d)c+=d;return c+"\n "},d),data:d}))||0===l)b+=l;b+='\n \n
'+m((h=(h=c.page,null==h||!1===h?h:h.title),typeof h===k?h.apply(c):h))+'
\n
\n
\n
\n\n\n\n\n\n\n
\n ';
+if((l=f.unless.call(c,(h=c.user,null==h||!1===h?h:h.isAgent),{hash:{},inverse:n.noop,fn:n.program(11,function(){return'\n
\n '},d),data:d}))||0===l)b+=l;d={hash:{},data:d};return b=b+'\n \n
\n \n
\n
\n
\n\n\n\n\n\n')});s.chat_message=r(function(b,c,f,a,d){this.compilerInfo=[2,">= 1.0.0-rc.3"];f=f||b.helpers;d=d||{};var g,q=this.escapeExpression,p=f.helperMissing;b={hash:{},data:d};b=""+(q((g=f.formatTime,g?g.call(c,c.created,b):p.call(c,"formatTime",c.created,b)))+" \n");if((g=f["if"].call(c,c.name,{hash:{},inverse:this.noop,fn:this.program(1,function(b,
+c){var a,d;a="";(d=f.name)?d=d.call(b,{hash:{},data:c}):(d=b.name,d="function"===typeof d?d.apply(b):d);return a+=q(d)+": "},d),data:d}))||0===g)b+=g;b+="\n";if((g=f["if"].call(c,c.allowFormatting,{hash:{},inverse:this.program(5,function(b,c){var a,
+d;d={hash:{},data:c};return q((a=f.apply,a?a.call(b,b.message,"urlReplace, nl2br",d):p.call(b,"apply",b.message,"urlReplace, nl2br",d)))},d),fn:this.program(3,function(b,c){var a,d;d={hash:{},data:c};return q((a=f.apply,a?a.call(b,b.message,"urlReplace, nl2br, allowTags",d):p.call(b,"apply",b.message,"urlReplace, nl2br, allowTags",d)))},d),data:d}))||0===g)b+=g;return b+="
"});s.chat_message_form=r(function(b,c,f,a,d){function g(b,c){var j,e;j={hash:{},data:c};j='\n \n "}function q(b){var c;return b=""+("\n \n ")}this.compilerInfo=[2,">= 1.0.0-rc.3"];f=f||
+b.helpers;d=d||{};var p,r="function",h=this.escapeExpression,l=f.helperMissing,k=this;b='\n';if((a=f["if"].call(c,(p=c.user,null==p||!1===p?p:p.canPost),{hash:{},inverse:k.noop,fn:k.program(1,function(){return'\n
\n'},d),data:d}))||0===a)b+=a;b+='\n
\n\n\n';if((a=f["if"].call(c,(p=c.user,
+null==p||!1===p?p:p.canPost),{hash:{},inverse:k.noop,fn:k.program(3,function(b,c){var j,e,a;j='\n
\n
\n ';if((a=f["if"].call(b,(e=b.user,null==e||!1===e?e:e.isAgent),{hash:{},inverse:k.noop,fn:k.program(4,g,c),data:c}))||0===a)j+=a;a={hash:{},data:c};j=j+'\n
\n
');a={hash:{},data:c};return j+=h((e=f.L10n,e?e.call(b,"chat.window.send_message_short_and_shortcut",a):l.call(b,"L10n","chat.window.send_message_short_and_shortcut",a)))+"\n
\n"},d),data:d}))||0===a)b+=a;return b+'\n
\n'});s.chat_status_base=r(function(b,c,f,a,d){this.compilerInfo=[2,">= 1.0.0-rc.3"];f=f||b.helpers;d=d||{};b=this.escapeExpression;(f=f.title)?f=f.call(c,{hash:{},data:d}):(f=c.title,f="function"===typeof f?f.apply(c):f);return b(f)});
+s.chat_status_message=r(function(b,c,f,a,d){this.compilerInfo=[2,">= 1.0.0-rc.3"];f=f||b.helpers;d=d||{};b=this.escapeExpression;(f=f.message)?f=f.call(c,{hash:{},data:d}):(f=c.message,f="function"===typeof f?f.apply(c):f);return b(f)});s.chat_status_typing=r(function(b,c,f,a,d){this.compilerInfo=[2,">= 1.0.0-rc.3"];f=f||b.helpers;d=d||{};var g;b=f.helperMissing;a=this.escapeExpression;d={hash:{},data:d};return a((g=f.L10n,g?g.call(c,"typing.remote",d):b.call(c,"L10n","typing.remote",d)))});s.leave_message_description=
+r(function(b,c,f,a,d){this.compilerInfo=[2,">= 1.0.0-rc.3"];f=f||b.helpers;d=d||{};var g,q=f.helperMissing,p=this.escapeExpression;a={hash:{},data:d};b='\n';a={hash:{},data:d};return b+=p((g=f.L10n,g?g.call(c,"leavemessage.descr",a):q.call(c,"L10n","leavemessage.descr",a)))+"
"});s.leave_message_form=r(function(b,c,f,a,d){function g(e,b){var c,a;c=''}function q(e,
+b){var c,a,j;c=""+('\n \n "}function p(){return'selected="selected"'}function r(e,b){var a;return(a=f["if"].call(e,e.selected,{hash:{},inverse:n.noop,fn:n.program(9,h,b),data:b}))||0===a?a:""}function h(e){var b;return m((b=e.description,
+typeof b===k?b.apply(e):b))}this.compilerInfo=[2,">= 1.0.0-rc.3"];f=f||b.helpers;d=d||{};var l,k="function",m=this.escapeExpression,n=this,j=f.helperMissing;b=""+(''});s.leave_message_layout=r(function(b,c,f,a,d){function g(b){var a;return b=""+('\n \n ')}function q(b){var a;return b=""+("\n \n \n \n ')}function p(a){var b;return a=""+("\n \n \n \n ')}function r(b){var a;return b=""+('\n \n ')}this.compilerInfo=[2,">= 1.0.0-rc.3"];f=f||b.helpers;d=d||{};var h,l="function",k=this.escapeExpression,m=this;b=
+'\n\n
\n ';if((d=f["if"].call(c,(h=(h=c.page,null==h||!1===h?h:h.company),null==h||!1===h?h:h.chatLogoURL),{hash:{},inverse:m.program(6,function(a,b){var e,c,d;e="\n ";if((d=f["if"].call(a,(c=a.page,null==c||!1===c?c:c.webimHost),{hash:{},inverse:m.program(9,r,b),fn:m.program(7,p,b),data:b}))||0===d)e+=d;return e+"\n "},d),fn:m.program(1,function(a,b){var e,c,d;e="\n \n ";if((d=f.unless.call(a,(c=a.page,null==c||!1===
+c?c:c.webimHost),{hash:{},inverse:m.program(4,q,b),fn:m.program(2,g,b),data:b}))||0===d)e+=d;return e+"\n "},d),data:d}))||0===d)b+=d;return b+='\n \n
'+k((h=(h=c.page,null==h||!1===h?h:h.title),typeof h===l?h.apply(c):h))+'
\n
\n
\n
\n\n\n\n\n\n'});
+s.leave_message_sent_description=r(function(b,c,f,a,d){this.compilerInfo=[2,">= 1.0.0-rc.3"];f=f||b.helpers;d=d||{};var g,q=f.helperMissing,p=this.escapeExpression;a={hash:{},data:d};b='\n';a={hash:{},data:d};return b+=p((g=f.L10n,g?g.call(c,"leavemessage.sent.message",a):q.call(c,"L10n","leavemessage.sent.message",a)))+"
"});s.survey_form=r(function(b,c,f,a,d){function g(b,a){var e,c;e=''}function q(b,a){var e,c,d;e=""+('\n \n "}function p(){return'selected="selected"'}
+function r(){return" (offline)"}function h(b,a){var e;return(e=f["if"].call(b,b.selected,{hash:{},inverse:j.noop,fn:j.program(15,l,a),data:a}))||0===e?e:""}function l(b){var a;return n((a=b.description,typeof a===m?a.apply(b):a))}this.compilerInfo=[2,">= 1.0.0-rc.3"];f=f||b.helpers;d=d||{};var k,m="function",n=this.escapeExpression,j=this,e=f.helperMissing;b=""+(''});s.survey_layout=r(function(b,c,f,a,d){function g(b){var a;return b=""+('\n \n ')}
+function q(b){var a;return b=""+("\n \n \n \n ')}function p(a){var b;return a=""+("\n \n \n \n ')}function r(b){var a;return b=""+('\n \n ')}
+this.compilerInfo=[2,">= 1.0.0-rc.3"];f=f||b.helpers;d=d||{};var h,l,k="function",m=this.escapeExpression,n=this;a=f.helperMissing;b='\n\n
\n ';if((l=f["if"].call(c,(h=(h=c.page,null==h||!1===h?h:h.company),null==h||!1===h?h:h.chatLogoURL),{hash:{},inverse:n.program(6,function(a,b){var c,d,g;c="\n ";if((g=f["if"].call(a,(d=a.page,null==d||!1===d?d:d.webimHost),{hash:{},inverse:n.program(9,r,b),fn:n.program(7,p,b),data:b}))||0===g)c+=g;return c+"\n "},
+d),fn:n.program(1,function(a,b){var c,d,h;c="\n \n ";if((h=f.unless.call(a,(d=a.page,null==d||!1===d?d:d.webimHost),{hash:{},inverse:n.program(4,q,b),fn:n.program(2,g,b),data:b}))||0===h)c+=h;return c+"\n "},d),data:d}))||0===l)b+=l;b+='\n \n
'+m((h=(h=c.page,null==h||!1===h?h:h.title),typeof h===k?h.apply(c):h))+'
\n
\n
\n
\n\n\n\n\n\n'})})();