diff --git a/UPGRADING.md b/UPGRADING.md
index c22ac8ee..d836e6ac 100644
--- a/UPGRADING.md
+++ b/UPGRADING.md
@@ -28,10 +28,16 @@ New permissions are available. If you configured custom permissions in `local.ya
- `view_tag` - view all tags
- `delete_tag` - delete tags
- `edit_exported_timesheet` - allows to edit records which were exported
+- `role_permissions` - view calculated permissions for user roles
+
+Removed permission:
+- `system_actions` - removed experimental feature to flush your cache from the about screen
### BC BREAKS
- API: Format for queries including a datetime object fixed, finally using the HTML5 format (previously `2019-03-02 14:23` - now `2019-03-02T14:23:00`)
+- **Permission config**: the `permissions` definition in your `local.yaml` needs to be verified/changed, as the internal structure was highly optimized to simplify the definition.
+Thanks to the new structure, you should be able to remove almost everything from your `local.yaml`: please read [the updated permission docu](https://www.kimai.org/documentation/permissions.html).
## [0.9](https://github.com/kevinpapst/kimai2/releases/tag/0.9)
diff --git a/assets/js/plugins/KimaiAPILink.js b/assets/js/plugins/KimaiAPILink.js
index 4fd3ea90..406e1441 100644
--- a/assets/js/plugins/KimaiAPILink.js
+++ b/assets/js/plugins/KimaiAPILink.js
@@ -39,8 +39,10 @@ export default class KimaiAPILink extends KimaiClickHandlerReducedInTableRow {
}
if (attributes.question !== undefined) {
- self.getContainer().getPlugin('alert').question(attributes.question, function() {
- self._callApi(url, attributes);
+ self.getContainer().getPlugin('alert').question(attributes.question, function(value) {
+ if (value) {
+ self._callApi(url, attributes);
+ }
});
} else {
self._callApi(url, attributes);
diff --git a/assets/js/plugins/KimaiAlert.js b/assets/js/plugins/KimaiAlert.js
index c6fb51d1..6b2527f8 100644
--- a/assets/js/plugins/KimaiAlert.js
+++ b/assets/js/plugins/KimaiAlert.js
@@ -41,8 +41,6 @@ export default class KimaiAlert extends KimaiPlugin {
}
Swal.fire({
- //toast: true,
- //timer: 3000,
timer: 1500,
position: 'top-end',
showConfirmButton: false,
@@ -71,9 +69,7 @@ export default class KimaiAlert extends KimaiPlugin {
confirmButtonText: translation.get('confirm'),
cancelButtonText: translation.get('cancel')
}).then((result) => {
- if (result.value) {
- callback(result.value);
- }
+ callback(result.value);
});
}
diff --git a/config/packages/kimai.yaml b/config/packages/kimai.yaml
index 521d131a..9648ac0b 100644
--- a/config/packages/kimai.yaml
+++ b/config/packages/kimai.yaml
@@ -75,34 +75,38 @@ kimai:
# https://www.kimai.org/documentation/permissions.html
# --------------------------------------------------------------------------------
permissions:
+ # mapping complex rule sets of single permissions to named "sets" ("set name" = [array of "permissions and sets"])
sets:
- # mapping complex rule sets of single permissions to named "sets" ("set name" = [array of "permissions"])
- ACTIVITIES: [view_activity,create_activity,edit_activity,delete_activity]
- PROJECTS: [view_project,create_project,edit_project,delete_project]
- CUSTOMERS: [view_customer,create_customer,edit_customer,delete_customer]
- INVOICE: [view_invoice,create_invoice]
- INVOICE_TEMPLATE: [view_invoice_template,create_invoice_template,edit_invoice_template,delete_invoice_template]
- TIMESHEET: [view_own_timesheet,start_own_timesheet,stop_own_timesheet,create_own_timesheet,edit_own_timesheet,export_own_timesheet,delete_own_timesheet]
- TIMESHEET_OTHER: [view_other_timesheet,start_other_timesheet,stop_other_timesheet,create_other_timesheet,edit_other_timesheet,export_other_timesheet,delete_other_timesheet]
- PROFILE: [view_own_profile,edit_own_profile,password_own_profile,preferences_own_profile,api-token_own_profile]
- PROFILE_OTHER: [view_other_profile,edit_other_profile,delete_other_profile,password_other_profile,roles_other_profile,preferences_other_profile,api-token_other_profile]
- TAGS: [view_tag,delete_tag]
- USER: [view_user,create_user,delete_user]
- RATE: [view_rate_own_timesheet,edit_rate_own_timesheet]
- RATE_OTHER: [view_rate_other_timesheet,edit_rate_other_timesheet]
- EXPORT: [view_export,create_export,edit_export_own_timesheet,edit_export_other_timesheet]
+ ACTIVITIES: ['view_activity','create_activity','edit_activity','delete_activity']
+ PROJECTS: ['view_project','create_project','edit_project','delete_project']
+ CUSTOMERS: ['view_customer','create_customer','edit_customer','delete_customer']
+ INVOICE: ['view_invoice','create_invoice']
+ INVOICE_TEMPLATE: ['view_invoice_template','create_invoice_template','edit_invoice_template','delete_invoice_template']
+ TIMESHEET: ['view_own_timesheet','start_own_timesheet','stop_own_timesheet','create_own_timesheet','edit_own_timesheet','export_own_timesheet','delete_own_timesheet']
+ TIMESHEET_OTHER: ['view_other_timesheet','start_other_timesheet','stop_other_timesheet','create_other_timesheet','edit_other_timesheet','export_other_timesheet','delete_other_timesheet']
+ PROFILE: ['view_own_profile','edit_own_profile','password_own_profile','preferences_own_profile','api-token_own_profile']
+ PROFILE_OTHER: ['view_other_profile','edit_other_profile','delete_other_profile','password_other_profile','roles_other_profile','preferences_other_profile','api-token_other_profile']
+ TAGS: ['view_tag','delete_tag']
+ USER: ['view_user','create_user','delete_user','role_permissions']
+ RATE: ['view_rate_own_timesheet','edit_rate_own_timesheet']
+ RATE_OTHER: ['view_rate_other_timesheet','edit_rate_other_timesheet']
+ EXPORT: ['view_export','create_export','edit_export_own_timesheet','edit_export_other_timesheet']
+ ROLE_USER: ['@TIMESHEET','@PROFILE']
+ ROLE_TEAMLEAD: ['@INVOICE','@TIMESHEET','@TIMESHEET_OTHER','@PROFILE','@EXPORT','@TAGS','@INVOICE_TEMPLATE','!delete_invoice_template','view_rate_own_timesheet','view_rate_other_timesheet','hourly-rate_own_profile']
+ ROLE_ADMIN: ['@ACTIVITIES','@PROJECTS','@CUSTOMERS','@INVOICE','@INVOICE_TEMPLATE','@TIMESHEET','@TIMESHEET_OTHER','@PROFILE','@RATE','@RATE_OTHER','@EXPORT','@TAGS','hourly-rate_own_profile','edit_exported_timesheet']
+ ROLE_SUPER_ADMIN: ['@ACTIVITIES','@PROJECTS','@CUSTOMERS','@INVOICE','@INVOICE_TEMPLATE','@TIMESHEET','@TIMESHEET_OTHER','@PROFILE','@PROFILE_OTHER','@USER','@RATE','@RATE_OTHER','@EXPORT','@TAGS','hourly-rate_own_profile','hourly-rate_other_profile','delete_own_profile','roles_own_profile','system_information','system_configuration','plugins','edit_exported_timesheet']
+ # mapping "sets" or permissions to user roles ("role name" = [array of "set names"])
maps:
- # mapping "sets" or permissions to user roles ("role name" = [array of "set names"])
- ROLE_USER: [TIMESHEET,PROFILE]
- ROLE_TEAMLEAD: [INVOICE,TIMESHEET,TIMESHEET_OTHER,PROFILE,EXPORT,TAGS]
- ROLE_ADMIN: [ACTIVITIES,PROJECTS,CUSTOMERS,INVOICE,INVOICE_TEMPLATE,TIMESHEET,TIMESHEET_OTHER,PROFILE,RATE,RATE_OTHER,EXPORT,TAGS]
- ROLE_SUPER_ADMIN: [ACTIVITIES,PROJECTS,CUSTOMERS,INVOICE,INVOICE_TEMPLATE,TIMESHEET,TIMESHEET_OTHER,PROFILE,PROFILE_OTHER,USER,RATE,RATE_OTHER,EXPORT,TAGS]
+ ROLE_USER: ['ROLE_USER']
+ ROLE_TEAMLEAD: ['ROLE_TEAMLEAD']
+ ROLE_ADMIN: ['ROLE_ADMIN']
+ ROLE_SUPER_ADMIN: ['ROLE_SUPER_ADMIN']
+ # add or remove single permissions
roles:
- # adding single permissions to user roles, extending the definition from "sets" ("role name" = [array of "permissions"])
ROLE_USER: []
- ROLE_TEAMLEAD: [view_invoice_template,create_invoice_template,edit_invoice_template,view_rate_own_timesheet,view_rate_other_timesheet,hourly-rate_own_profile]
- ROLE_ADMIN: [hourly-rate_own_profile,edit_exported_timesheet]
- ROLE_SUPER_ADMIN: [hourly-rate_own_profile,hourly-rate_other_profile,delete_own_profile,roles_own_profile,system_information,system_actions,system_configuration,plugins,edit_exported_timesheet]
+ ROLE_TEAMLEAD: []
+ ROLE_ADMIN: []
+ ROLE_SUPER_ADMIN: []
# --------------------------------------------------------------------------------
diff --git a/public/build/app.js b/public/build/app.js
index ff6040b2..c790dd59 100644
--- a/public/build/app.js
+++ b/public/build/app.js
@@ -69,12 +69,12 @@ if(void 0===t)throw new Error("AdminLTE requires jQuery");+function(t){"use stri
* Released under the MIT license.
* http://jquery.org/license
*/
-!function(a){o=[n("7t+N"),n("WLoA"),n("Up1f"),n("Nnp9"),n("DYUE"),n("UZ9c"),n("z1kw")],i=a,void 0!==(r="function"==typeof i?i.apply(e,o):i)&&(t.exports=r)}(function(t){return t.widget("ui.menu",{version:"1.12.1",defaultElement:"
",delay:300,options:{icons:{submenu:"ui-icon-caret-1-e"},items:"> *",menus:"ul",position:{my:"left top",at:"right top"},role:"menu",blur:null,focus:null,select:null},_create:function(){this.activeMenu=this.element,this.mouseHandled=!1,this.element.uniqueId().attr({role:this.options.role,tabIndex:0}),this._addClass("ui-menu","ui-widget ui-widget-content"),this._on({"mousedown .ui-menu-item":function(t){t.preventDefault()},"click .ui-menu-item":function(e){var n=t(e.target),i=t(t.ui.safeActiveElement(this.document[0]));!this.mouseHandled&&n.not(".ui-state-disabled").length&&(this.select(e),e.isPropagationStopped()||(this.mouseHandled=!0),n.has(".ui-menu").length?this.expand(e):!this.element.is(":focus")&&i.closest(".ui-menu").length&&(this.element.trigger("focus",[!0]),this.active&&1===this.active.parents(".ui-menu").length&&clearTimeout(this.timer)))},"mouseenter .ui-menu-item":function(e){if(!this.previousFilter){var n=t(e.target).closest(".ui-menu-item"),i=t(e.currentTarget);n[0]===i[0]&&(this._removeClass(i.siblings().children(".ui-state-active"),null,"ui-state-active"),this.focus(e,i))}},mouseleave:"collapseAll","mouseleave .ui-menu":"collapseAll",focus:function(t,e){var n=this.active||this.element.find(this.options.items).eq(0);e||this.focus(t,n)},blur:function(e){this._delay(function(){!t.contains(this.element[0],t.ui.safeActiveElement(this.document[0]))&&this.collapseAll(e)})},keydown:"_keydown"}),this.refresh(),this._on(this.document,{click:function(t){this._closeOnDocumentClick(t)&&this.collapseAll(t),this.mouseHandled=!1}})},_destroy:function(){var e=this.element.find(".ui-menu-item").removeAttr("role aria-disabled"),n=e.children(".ui-menu-item-wrapper").removeUniqueId().removeAttr("tabIndex role aria-haspopup");this.element.removeAttr("aria-activedescendant").find(".ui-menu").addBack().removeAttr("role aria-labelledby aria-expanded aria-hidden aria-disabled tabIndex").removeUniqueId().show(),n.children().each(function(){var e=t(this);e.data("ui-menu-submenu-caret")&&e.remove()})},_keydown:function(e){var n,i,o,r,a=!0;switch(e.keyCode){case t.ui.keyCode.PAGE_UP:this.previousPage(e);break;case t.ui.keyCode.PAGE_DOWN:this.nextPage(e);break;case t.ui.keyCode.HOME:this._move("first","first",e);break;case t.ui.keyCode.END:this._move("last","last",e);break;case t.ui.keyCode.UP:this.previous(e);break;case t.ui.keyCode.DOWN:this.next(e);break;case t.ui.keyCode.LEFT:this.collapse(e);break;case t.ui.keyCode.RIGHT:this.active&&!this.active.is(".ui-state-disabled")&&this.expand(e);break;case t.ui.keyCode.ENTER:case t.ui.keyCode.SPACE:this._activate(e);break;case t.ui.keyCode.ESCAPE:this.collapse(e);break;default:a=!1,i=this.previousFilter||"",r=!1,o=e.keyCode>=96&&e.keyCode<=105?(e.keyCode-96).toString():String.fromCharCode(e.keyCode),clearTimeout(this.filterTimer),o===i?r=!0:o=i+o,n=this._filterMenuItems(o),n=r&&-1!==n.index(this.active.next())?this.active.nextAll(".ui-menu-item"):n,n.length||(o=String.fromCharCode(e.keyCode),n=this._filterMenuItems(o)),n.length?(this.focus(e,n),this.previousFilter=o,this.filterTimer=this._delay(function(){delete this.previousFilter},1e3)):delete this.previousFilter}a&&e.preventDefault()},_activate:function(t){this.active&&!this.active.is(".ui-state-disabled")&&(this.active.children("[aria-haspopup='true']").length?this.expand(t):this.select(t))},refresh:function(){var e,n,i,o,r,a=this,s=this.options.icons.submenu,l=this.element.find(this.options.menus);this._toggleClass("ui-menu-icons",null,!!this.element.find(".ui-icon").length),i=l.filter(":not(.ui-menu)").hide().attr({role:this.options.role,"aria-hidden":"true","aria-expanded":"false"}).each(function(){var e=t(this),n=e.prev(),i=t("").data("ui-menu-submenu-caret",!0);a._addClass(i,"ui-menu-icon","ui-icon "+s),n.attr("aria-haspopup","true").prepend(i),e.attr("aria-labelledby",n.attr("id"))}),this._addClass(i,"ui-menu","ui-widget ui-widget-content ui-front"),e=l.add(this.element),n=e.find(this.options.items),n.not(".ui-menu-item").each(function(){var e=t(this);a._isDivider(e)&&a._addClass(e,"ui-menu-divider","ui-widget-content")}),o=n.not(".ui-menu-item, .ui-menu-divider"),r=o.children().not(".ui-menu").uniqueId().attr({tabIndex:-1,role:this._itemRole()}),this._addClass(o,"ui-menu-item")._addClass(r,"ui-menu-item-wrapper"),n.filter(".ui-state-disabled").attr("aria-disabled","true"),this.active&&!t.contains(this.element[0],this.active[0])&&this.blur()},_itemRole:function(){return{menu:"menuitem",listbox:"option"}[this.options.role]},_setOption:function(t,e){if("icons"===t){var n=this.element.find(".ui-menu-icon");this._removeClass(n,null,this.options.icons.submenu)._addClass(n,null,e.submenu)}this._super(t,e)},_setOptionDisabled:function(t){this._super(t),this.element.attr("aria-disabled",String(t)),this._toggleClass(null,"ui-state-disabled",!!t)},focus:function(t,e){var n,i,o;this.blur(t,t&&"focus"===t.type),this._scrollIntoView(e),this.active=e.first(),i=this.active.children(".ui-menu-item-wrapper"),this._addClass(i,null,"ui-state-active"),this.options.role&&this.element.attr("aria-activedescendant",i.attr("id")),o=this.active.parent().closest(".ui-menu-item").children(".ui-menu-item-wrapper"),this._addClass(o,null,"ui-state-active"),t&&"keydown"===t.type?this._close():this.timer=this._delay(function(){this._close()},this.delay),n=e.children(".ui-menu"),n.length&&t&&/^mouse/.test(t.type)&&this._startOpening(n),this.activeMenu=e.parent(),this._trigger("focus",t,{item:e})},_scrollIntoView:function(e){var n,i,o,r,a,s;this._hasScroll()&&(n=parseFloat(t.css(this.activeMenu[0],"borderTopWidth"))||0,i=parseFloat(t.css(this.activeMenu[0],"paddingTop"))||0,o=e.offset().top-this.activeMenu.offset().top-n-i,r=this.activeMenu.scrollTop(),a=this.activeMenu.height(),s=e.outerHeight(),o<0?this.activeMenu.scrollTop(r+o):o+s>a&&this.activeMenu.scrollTop(r+o-a+s))},blur:function(t,e){e||clearTimeout(this.timer),this.active&&(this._removeClass(this.active.children(".ui-menu-item-wrapper"),null,"ui-state-active"),this._trigger("blur",t,{item:this.active}),this.active=null)},_startOpening:function(t){clearTimeout(this.timer),"true"===t.attr("aria-hidden")&&(this.timer=this._delay(function(){this._close(),this._open(t)},this.delay))},_open:function(e){var n=t.extend({of:this.active},this.options.position);clearTimeout(this.timer),this.element.find(".ui-menu").not(e.parents(".ui-menu")).hide().attr("aria-hidden","true"),e.show().removeAttr("aria-hidden").attr("aria-expanded","true").position(n)},collapseAll:function(e,n){clearTimeout(this.timer),this.timer=this._delay(function(){var i=n?this.element:t(e&&e.target).closest(this.element.find(".ui-menu"));i.length||(i=this.element),this._close(i),this.blur(e),this._removeClass(i.find(".ui-state-active"),null,"ui-state-active"),this.activeMenu=i},this.delay)},_close:function(t){t||(t=this.active?this.active.parent():this.element),t.find(".ui-menu").hide().attr("aria-hidden","true").attr("aria-expanded","false")},_closeOnDocumentClick:function(e){return!t(e.target).closest(".ui-menu").length},_isDivider:function(t){return!/[^\-\u2014\u2013\s]/.test(t.text())},collapse:function(t){var e=this.active&&this.active.parent().closest(".ui-menu-item",this.element);e&&e.length&&(this._close(),this.focus(t,e))},expand:function(t){var e=this.active&&this.active.children(".ui-menu ").find(this.options.items).first();e&&e.length&&(this._open(e.parent()),this._delay(function(){this.focus(t,e)}))},next:function(t){this._move("next","first",t)},previous:function(t){this._move("prev","last",t)},isFirstItem:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length},isLastItem:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length},_move:function(t,e,n){var i;this.active&&(i="first"===t||"last"===t?this.active["first"===t?"prevAll":"nextAll"](".ui-menu-item").eq(-1):this.active[t+"All"](".ui-menu-item").eq(0)),i&&i.length&&this.active||(i=this.activeMenu.find(this.options.items)[e]()),this.focus(n,i)},nextPage:function(e){var n,i,o;if(!this.active)return void this.next(e);this.isLastItem()||(this._hasScroll()?(i=this.active.offset().top,o=this.element.height(),this.active.nextAll(".ui-menu-item").each(function(){return n=t(this),n.offset().top-i-o<0}),this.focus(e,n)):this.focus(e,this.activeMenu.find(this.options.items)[this.active?"last":"first"]()))},previousPage:function(e){var n,i,o;if(!this.active)return void this.next(e);this.isFirstItem()||(this._hasScroll()?(i=this.active.offset().top,o=this.element.height(),this.active.prevAll(".ui-menu-item").each(function(){return n=t(this),n.offset().top-i+o>0}),this.focus(e,n)):this.focus(e,this.activeMenu.find(this.options.items).first()))},_hasScroll:function(){return this.element.outerHeight()",delay:300,options:{icons:{submenu:"ui-icon-caret-1-e"},items:"> *",menus:"ul",position:{my:"left top",at:"right top"},role:"menu",blur:null,focus:null,select:null},_create:function(){this.activeMenu=this.element,this.mouseHandled=!1,this.element.uniqueId().attr({role:this.options.role,tabIndex:0}),this._addClass("ui-menu","ui-widget ui-widget-content"),this._on({"mousedown .ui-menu-item":function(t){t.preventDefault()},"click .ui-menu-item":function(e){var n=t(e.target),i=t(t.ui.safeActiveElement(this.document[0]));!this.mouseHandled&&n.not(".ui-state-disabled").length&&(this.select(e),e.isPropagationStopped()||(this.mouseHandled=!0),n.has(".ui-menu").length?this.expand(e):!this.element.is(":focus")&&i.closest(".ui-menu").length&&(this.element.trigger("focus",[!0]),this.active&&1===this.active.parents(".ui-menu").length&&clearTimeout(this.timer)))},"mouseenter .ui-menu-item":function(e){if(!this.previousFilter){var n=t(e.target).closest(".ui-menu-item"),i=t(e.currentTarget);n[0]===i[0]&&(this._removeClass(i.siblings().children(".ui-state-active"),null,"ui-state-active"),this.focus(e,i))}},mouseleave:"collapseAll","mouseleave .ui-menu":"collapseAll",focus:function(t,e){var n=this.active||this.element.find(this.options.items).eq(0);e||this.focus(t,n)},blur:function(e){this._delay(function(){!t.contains(this.element[0],t.ui.safeActiveElement(this.document[0]))&&this.collapseAll(e)})},keydown:"_keydown"}),this.refresh(),this._on(this.document,{click:function(t){this._closeOnDocumentClick(t)&&this.collapseAll(t),this.mouseHandled=!1}})},_destroy:function(){var e=this.element.find(".ui-menu-item").removeAttr("role aria-disabled"),n=e.children(".ui-menu-item-wrapper").removeUniqueId().removeAttr("tabIndex role aria-haspopup");this.element.removeAttr("aria-activedescendant").find(".ui-menu").addBack().removeAttr("role aria-labelledby aria-expanded aria-hidden aria-disabled tabIndex").removeUniqueId().show(),n.children().each(function(){var e=t(this);e.data("ui-menu-submenu-caret")&&e.remove()})},_keydown:function(e){var n,i,o,r,a=!0;switch(e.keyCode){case t.ui.keyCode.PAGE_UP:this.previousPage(e);break;case t.ui.keyCode.PAGE_DOWN:this.nextPage(e);break;case t.ui.keyCode.HOME:this._move("first","first",e);break;case t.ui.keyCode.END:this._move("last","last",e);break;case t.ui.keyCode.UP:this.previous(e);break;case t.ui.keyCode.DOWN:this.next(e);break;case t.ui.keyCode.LEFT:this.collapse(e);break;case t.ui.keyCode.RIGHT:this.active&&!this.active.is(".ui-state-disabled")&&this.expand(e);break;case t.ui.keyCode.ENTER:case t.ui.keyCode.SPACE:this._activate(e);break;case t.ui.keyCode.ESCAPE:this.collapse(e);break;default:a=!1,i=this.previousFilter||"",r=!1,o=e.keyCode>=96&&e.keyCode<=105?(e.keyCode-96).toString():String.fromCharCode(e.keyCode),clearTimeout(this.filterTimer),o===i?r=!0:o=i+o,n=this._filterMenuItems(o),n=r&&-1!==n.index(this.active.next())?this.active.nextAll(".ui-menu-item"):n,n.length||(o=String.fromCharCode(e.keyCode),n=this._filterMenuItems(o)),n.length?(this.focus(e,n),this.previousFilter=o,this.filterTimer=this._delay(function(){delete this.previousFilter},1e3)):delete this.previousFilter}a&&e.preventDefault()},_activate:function(t){this.active&&!this.active.is(".ui-state-disabled")&&(this.active.children("[aria-haspopup='true']").length?this.expand(t):this.select(t))},refresh:function(){var e,n,i,o,r,a=this,s=this.options.icons.submenu,l=this.element.find(this.options.menus);this._toggleClass("ui-menu-icons",null,!!this.element.find(".ui-icon").length),i=l.filter(":not(.ui-menu)").hide().attr({role:this.options.role,"aria-hidden":"true","aria-expanded":"false"}).each(function(){var e=t(this),n=e.prev(),i=t("").data("ui-menu-submenu-caret",!0);a._addClass(i,"ui-menu-icon","ui-icon "+s),n.attr("aria-haspopup","true").prepend(i),e.attr("aria-labelledby",n.attr("id"))}),this._addClass(i,"ui-menu","ui-widget ui-widget-content ui-front"),e=l.add(this.element),n=e.find(this.options.items),n.not(".ui-menu-item").each(function(){var e=t(this);a._isDivider(e)&&a._addClass(e,"ui-menu-divider","ui-widget-content")}),o=n.not(".ui-menu-item, .ui-menu-divider"),r=o.children().not(".ui-menu").uniqueId().attr({tabIndex:-1,role:this._itemRole()}),this._addClass(o,"ui-menu-item")._addClass(r,"ui-menu-item-wrapper"),n.filter(".ui-state-disabled").attr("aria-disabled","true"),this.active&&!t.contains(this.element[0],this.active[0])&&this.blur()},_itemRole:function(){return{menu:"menuitem",listbox:"option"}[this.options.role]},_setOption:function(t,e){if("icons"===t){var n=this.element.find(".ui-menu-icon");this._removeClass(n,null,this.options.icons.submenu)._addClass(n,null,e.submenu)}this._super(t,e)},_setOptionDisabled:function(t){this._super(t),this.element.attr("aria-disabled",String(t)),this._toggleClass(null,"ui-state-disabled",!!t)},focus:function(t,e){var n,i,o;this.blur(t,t&&"focus"===t.type),this._scrollIntoView(e),this.active=e.first(),i=this.active.children(".ui-menu-item-wrapper"),this._addClass(i,null,"ui-state-active"),this.options.role&&this.element.attr("aria-activedescendant",i.attr("id")),o=this.active.parent().closest(".ui-menu-item").children(".ui-menu-item-wrapper"),this._addClass(o,null,"ui-state-active"),t&&"keydown"===t.type?this._close():this.timer=this._delay(function(){this._close()},this.delay),n=e.children(".ui-menu"),n.length&&t&&/^mouse/.test(t.type)&&this._startOpening(n),this.activeMenu=e.parent(),this._trigger("focus",t,{item:e})},_scrollIntoView:function(e){var n,i,o,r,a,s;this._hasScroll()&&(n=parseFloat(t.css(this.activeMenu[0],"borderTopWidth"))||0,i=parseFloat(t.css(this.activeMenu[0],"paddingTop"))||0,o=e.offset().top-this.activeMenu.offset().top-n-i,r=this.activeMenu.scrollTop(),a=this.activeMenu.height(),s=e.outerHeight(),o<0?this.activeMenu.scrollTop(r+o):o+s>a&&this.activeMenu.scrollTop(r+o-a+s))},blur:function(t,e){e||clearTimeout(this.timer),this.active&&(this._removeClass(this.active.children(".ui-menu-item-wrapper"),null,"ui-state-active"),this._trigger("blur",t,{item:this.active}),this.active=null)},_startOpening:function(t){clearTimeout(this.timer),"true"===t.attr("aria-hidden")&&(this.timer=this._delay(function(){this._close(),this._open(t)},this.delay))},_open:function(e){var n=t.extend({of:this.active},this.options.position);clearTimeout(this.timer),this.element.find(".ui-menu").not(e.parents(".ui-menu")).hide().attr("aria-hidden","true"),e.show().removeAttr("aria-hidden").attr("aria-expanded","true").position(n)},collapseAll:function(e,n){clearTimeout(this.timer),this.timer=this._delay(function(){var i=n?this.element:t(e&&e.target).closest(this.element.find(".ui-menu"));i.length||(i=this.element),this._close(i),this.blur(e),this._removeClass(i.find(".ui-state-active"),null,"ui-state-active"),this.activeMenu=i},this.delay)},_close:function(t){t||(t=this.active?this.active.parent():this.element),t.find(".ui-menu").hide().attr("aria-hidden","true").attr("aria-expanded","false")},_closeOnDocumentClick:function(e){return!t(e.target).closest(".ui-menu").length},_isDivider:function(t){return!/[^\-\u2014\u2013\s]/.test(t.text())},collapse:function(t){var e=this.active&&this.active.parent().closest(".ui-menu-item",this.element);e&&e.length&&(this._close(),this.focus(t,e))},expand:function(t){var e=this.active&&this.active.children(".ui-menu ").find(this.options.items).first();e&&e.length&&(this._open(e.parent()),this._delay(function(){this.focus(t,e)}))},next:function(t){this._move("next","first",t)},previous:function(t){this._move("prev","last",t)},isFirstItem:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length},isLastItem:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length},_move:function(t,e,n){var i;this.active&&(i="first"===t||"last"===t?this.active["first"===t?"prevAll":"nextAll"](".ui-menu-item").eq(-1):this.active[t+"All"](".ui-menu-item").eq(0)),i&&i.length&&this.active||(i=this.activeMenu.find(this.options.items)[e]()),this.focus(n,i)},nextPage:function(e){var n,i,o;if(!this.active)return void this.next(e);this.isLastItem()||(this._hasScroll()?(i=this.active.offset().top,o=this.element.height(),this.active.nextAll(".ui-menu-item").each(function(){return n=t(this),n.offset().top-i-o<0}),this.focus(e,n)):this.focus(e,this.activeMenu.find(this.options.items)[this.active?"last":"first"]()))},previousPage:function(e){var n,i,o;if(!this.active)return void this.next(e);this.isFirstItem()||(this._hasScroll()?(i=this.active.offset().top,o=this.element.height(),this.active.prevAll(".ui-menu-item").each(function(){return n=t(this),n.offset().top-i+o>0}),this.focus(e,n)):this.focus(e,this.activeMenu.find(this.options.items).first()))},_hasScroll:function(){return this.element.outerHeight() ul.menu");var n=this,i=function(){n.reloadRecentActivities()};setTimeout(i,500),document.addEventListener("kimai.timesheetStop",i),document.addEventListener("kimai.activityUpdate",i),document.addEventListener("kimai.projectUpdate",i),document.addEventListener("kimai.customerUpdate",i)}}},{key:"emptyList",value:function(){this.itemList.innerHTML=""}},{key:"setEntries",value:function(t){if(0===t.length)return void this.emptyList();var e="",n=!0,i=!1,o=void 0;try{for(var r,a=t[Symbol.iterator]();!(n=(r=a.next()).done);n=!0){var s=r.value,l=this.attributes.template.replace("%customer%",s.project.customer.name).replace("%project%",s.project.name).replace("%activity%",s.activity.name);e+='- '+l+"
"}}catch(t){i=!0,o=t}finally{try{!n&&a.return&&a.return()}finally{if(i)throw o}}this.itemList.innerHTML=e}},{key:"reloadRecentActivities",value:function(){var t=this;this.getContainer().getPlugin("api").get(this.attributes.api,{},function(e){t.setEntries(e)})}}]),e}(a.a);e.a=l},ORgI:function(t,e,n){!function(t,e){e(n("PJh5"))}(0,function(t){"use strict";return t.defineLocale("ja",{months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"日曜日_月曜日_火曜日_水曜日_木曜日_金曜日_土曜日".split("_"),weekdaysShort:"日_月_火_水_木_金_土".split("_"),weekdaysMin:"日_月_火_水_木_金_土".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日 HH:mm",LLLL:"YYYY年M月D日 dddd HH:mm",l:"YYYY/MM/DD",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日(ddd) HH:mm"},meridiemParse:/午前|午後/i,isPM:function(t){return"午後"===t},meridiem:function(t,e,n){return t<12?"午前":"午後"},calendar:{sameDay:"[今日] LT",nextDay:"[明日] LT",nextWeek:function(t){return t.week()0)for(n=0;n0?"future":"past"];return S(n)?n(e):n.replace(/%s/i,e)}function A(t,e){var n=t.toLowerCase();zi[n]=zi[n+"s"]=zi[e]=t}function H(t){return"string"==typeof t?zi[t]||zi[t.toLowerCase()]:void 0}function N(t){var e,n,i={};for(n in t)u(t,n)&&(e=H(n))&&(i[e]=t[n]);return i}function F(t,e){Bi[t]=e}function Y(t){var e=[];for(var n in t)e.push({unit:n,priority:Bi[n]});return e.sort(function(t,e){return t.priority-e.priority}),e}function j(t,e,n){var i=""+Math.abs(t),o=e-i.length;return(t>=0?n?"+":"":"-")+Math.pow(10,Math.max(0,o)).toString().substr(1)+i}function z(t,e,n,i){var o=i;"string"==typeof i&&(o=function(){return this[i]()}),t&&(Ui[t]=o),e&&(Ui[e[0]]=function(){return j(o.apply(this,arguments),e[1],e[2])}),n&&(Ui[n]=function(){return this.localeData().ordinal(o.apply(this,arguments),t)})}function B(t){return t.match(/\[[\s\S]/)?t.replace(/^\[|\]$/g,""):t.replace(/\\/g,"")}function W(t){var e,n,i=t.match(Wi);for(e=0,n=i.length;e=0&&Vi.test(t);)t=t.replace(Vi,n),Vi.lastIndex=0,i-=1;return t}function U(t,e,n){co[t]=S(e)?e:function(t,i){return t&&n?n:e}}function q(t,e){return u(co,t)?co[t](e._strict,e._locale):new RegExp(G(t))}function G(t){return J(t.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(t,e,n,i,o){return e||n||i||o}))}function J(t){return t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function Z(t,e){var n,i=e;for("string"==typeof t&&(t=[t]),a(e)&&(i=function(t,n){n[e]=w(t)}),n=0;n=0?(s=new Date(t+400,e,n,i,o,r,a),isFinite(s.getFullYear())&&s.setFullYear(t)):s=new Date(t,e,n,i,o,r,a),s}function wt(t){var e;if(t<100&&t>=0){var n=Array.prototype.slice.call(arguments);n[0]=t+400,e=new Date(Date.UTC.apply(null,n)),isFinite(e.getUTCFullYear())&&e.setUTCFullYear(t)}else e=new Date(Date.UTC.apply(null,arguments));return e}function xt(t,e,n){var i=7+e-n;return-(7+wt(t,0,i).getUTCDay()-e)%7+i-1}function _t(t,e,n,i,o){var r,a,s=(7+n-i)%7,l=xt(t,i,o),u=1+7*(e-1)+s+l;return u<=0?(r=t-1,a=Q(r)+u):u>Q(t)?(r=t+1,a=u-Q(t)):(r=t,a=u),{year:r,dayOfYear:a}}function Dt(t,e,n){var i,o,r=xt(t.year(),e,n),a=Math.floor((t.dayOfYear()-r-1)/7)+1;return a<1?(o=t.year()-1,i=a+kt(o,e,n)):a>kt(t.year(),e,n)?(i=a-kt(t.year(),e,n),o=t.year()+1):(o=t.year(),i=a),{week:i,year:o}}function kt(t,e,n){var i=xt(t,e,n),o=xt(t+1,e,n);return(Q(t)-i+o)/7}function St(t){return Dt(t,this._week.dow,this._week.doy).week}function Ct(){return this._week.dow}function Mt(){return this._week.doy}function Tt(t){var e=this.localeData().week(this);return null==t?e:this.add(7*(t-e),"d")}function Et(t){var e=Dt(this,1,4).week;return null==t?e:this.add(7*(t-e),"d")}function Pt(t,e){return"string"!=typeof t?t:isNaN(t)?(t=e.weekdaysParse(t),"number"==typeof t?t:null):parseInt(t,10)}function It(t,e){return"string"==typeof t?e.weekdaysParse(t)%7||7:isNaN(t)?null:t}function Ot(t,e){return t.slice(e,7).concat(t.slice(0,e))}function Lt(t,e){var i=n(this._weekdays)?this._weekdays:this._weekdays[t&&!0!==t&&this._weekdays.isFormat.test(e)?"format":"standalone"];return!0===t?Ot(i,this._week.dow):t?i[t.day()]:i}function Rt(t){return!0===t?Ot(this._weekdaysShort,this._week.dow):t?this._weekdaysShort[t.day()]:this._weekdaysShort}function At(t){return!0===t?Ot(this._weekdaysMin,this._week.dow):t?this._weekdaysMin[t.day()]:this._weekdaysMin}function Ht(t,e,n){var i,o,r,a=t.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],i=0;i<7;++i)r=d([2e3,1]).day(i),this._minWeekdaysParse[i]=this.weekdaysMin(r,"").toLocaleLowerCase(),this._shortWeekdaysParse[i]=this.weekdaysShort(r,"").toLocaleLowerCase(),this._weekdaysParse[i]=this.weekdays(r,"").toLocaleLowerCase();return n?"dddd"===e?(o=_o.call(this._weekdaysParse,a),-1!==o?o:null):"ddd"===e?(o=_o.call(this._shortWeekdaysParse,a),-1!==o?o:null):(o=_o.call(this._minWeekdaysParse,a),-1!==o?o:null):"dddd"===e?-1!==(o=_o.call(this._weekdaysParse,a))?o:-1!==(o=_o.call(this._shortWeekdaysParse,a))?o:(o=_o.call(this._minWeekdaysParse,a),-1!==o?o:null):"ddd"===e?-1!==(o=_o.call(this._shortWeekdaysParse,a))?o:-1!==(o=_o.call(this._weekdaysParse,a))?o:(o=_o.call(this._minWeekdaysParse,a),-1!==o?o:null):-1!==(o=_o.call(this._minWeekdaysParse,a))?o:-1!==(o=_o.call(this._weekdaysParse,a))?o:(o=_o.call(this._shortWeekdaysParse,a),-1!==o?o:null)}function Nt(t,e,n){var i,o,r;if(this._weekdaysParseExact)return Ht.call(this,t,e,n);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),i=0;i<7;i++){if(o=d([2e3,1]).day(i),n&&!this._fullWeekdaysParse[i]&&(this._fullWeekdaysParse[i]=new RegExp("^"+this.weekdays(o,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[i]=new RegExp("^"+this.weekdaysShort(o,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[i]=new RegExp("^"+this.weekdaysMin(o,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[i]||(r="^"+this.weekdays(o,"")+"|^"+this.weekdaysShort(o,"")+"|^"+this.weekdaysMin(o,""),this._weekdaysParse[i]=new RegExp(r.replace(".",""),"i")),n&&"dddd"===e&&this._fullWeekdaysParse[i].test(t))return i;if(n&&"ddd"===e&&this._shortWeekdaysParse[i].test(t))return i;if(n&&"dd"===e&&this._minWeekdaysParse[i].test(t))return i;if(!n&&this._weekdaysParse[i].test(t))return i}}function Ft(t){if(!this.isValid())return null!=t?this:NaN;var e=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=t?(t=Pt(t,this.localeData()),this.add(t-e,"d")):e}function Yt(t){if(!this.isValid())return null!=t?this:NaN;var e=(this.day()+7-this.localeData()._week.dow)%7;return null==t?e:this.add(t-e,"d")}function jt(t){if(!this.isValid())return null!=t?this:NaN;if(null!=t){var e=It(t,this.localeData());return this.day(this.day()%7?e:e-7)}return this.day()||7}function zt(t){return this._weekdaysParseExact?(u(this,"_weekdaysRegex")||Vt.call(this),t?this._weekdaysStrictRegex:this._weekdaysRegex):(u(this,"_weekdaysRegex")||(this._weekdaysRegex=Lo),this._weekdaysStrictRegex&&t?this._weekdaysStrictRegex:this._weekdaysRegex)}function Bt(t){return this._weekdaysParseExact?(u(this,"_weekdaysRegex")||Vt.call(this),t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(u(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=Ro),this._weekdaysShortStrictRegex&&t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function Wt(t){return this._weekdaysParseExact?(u(this,"_weekdaysRegex")||Vt.call(this),t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(u(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=Ao),this._weekdaysMinStrictRegex&&t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function Vt(){function t(t,e){return e.length-t.length}var e,n,i,o,r,a=[],s=[],l=[],u=[];for(e=0;e<7;e++)n=d([2e3,1]).day(e),i=this.weekdaysMin(n,""),o=this.weekdaysShort(n,""),r=this.weekdays(n,""),a.push(i),s.push(o),l.push(r),u.push(i),u.push(o),u.push(r);for(a.sort(t),s.sort(t),l.sort(t),u.sort(t),e=0;e<7;e++)s[e]=J(s[e]),l[e]=J(l[e]),u[e]=J(u[e]);this._weekdaysRegex=new RegExp("^("+u.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+l.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+s.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+a.join("|")+")","i")}function $t(){return this.hours()%12||12}function Ut(){return this.hours()||24}function qt(t,e){z(t,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),e)})}function Gt(t,e){return e._meridiemParse}function Jt(t){return"p"===(t+"").toLowerCase().charAt(0)}function Zt(t,e,n){return t>11?n?"pm":"PM":n?"am":"AM"}function Xt(t){return t?t.toLowerCase().replace("_","-"):t}function Kt(t){for(var e,n,i,o,r=0;r0;){if(i=Qt(o.slice(0,e).join("-")))return i;if(n&&n.length>=e&&x(o,n,!0)>=e-1)break;e--}r++}return Ho}function Qt(e){var n=null;if(!jo[e]&&void 0!==t&&t&&t.exports)try{n=Ho._abbr;!function(){var t=new Error('Cannot find module "./locale"');throw t.code="MODULE_NOT_FOUND",t}(),te(n)}catch(t){}return jo[e]}function te(t,e){var n;return t&&(n=r(e)?ie(t):ee(t,e),n?Ho=n:"undefined"!=typeof console&&console.warn&&console.warn("Locale "+t+" not found. Did you forget to load it?")),Ho._abbr}function ee(t,e){if(null!==e){var n,i=Yo;if(e.abbr=t,null!=jo[t])k("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),i=jo[t]._config;else if(null!=e.parentLocale)if(null!=jo[e.parentLocale])i=jo[e.parentLocale]._config;else{if(null==(n=Qt(e.parentLocale)))return zo[e.parentLocale]||(zo[e.parentLocale]=[]),zo[e.parentLocale].push({name:t,config:e}),null;i=n._config}return jo[t]=new T(M(i,e)),zo[t]&&zo[t].forEach(function(t){ee(t.name,t.config)}),te(t),jo[t]}return delete jo[t],null}function ne(t,e){if(null!=e){var n,i,o=Yo;i=Qt(t),null!=i&&(o=i._config),e=M(o,e),n=new T(e),n.parentLocale=jo[t],jo[t]=n,te(t)}else null!=jo[t]&&(null!=jo[t].parentLocale?jo[t]=jo[t].parentLocale:null!=jo[t]&&delete jo[t]);return jo[t]}function ie(t){var e;if(t&&t._locale&&t._locale._abbr&&(t=t._locale._abbr),!t)return Ho;if(!n(t)){if(e=Qt(t))return e;t=[t]}return Kt(t)}function oe(){return Hi(jo)}function re(t){var e,n=t._a;return n&&-2===f(t).overflow&&(e=n[po]<0||n[po]>11?po:n[mo]<1||n[mo]>lt(n[fo],n[po])?mo:n[go]<0||n[go]>24||24===n[go]&&(0!==n[vo]||0!==n[yo]||0!==n[bo])?go:n[vo]<0||n[vo]>59?vo:n[yo]<0||n[yo]>59?yo:n[bo]<0||n[bo]>999?bo:-1,f(t)._overflowDayOfYear&&(emo)&&(e=mo),f(t)._overflowWeeks&&-1===e&&(e=wo),f(t)._overflowWeekday&&-1===e&&(e=xo),f(t).overflow=e),t}function ae(t,e,n){return null!=t?t:null!=e?e:n}function se(t){var n=new Date(e.now());return t._useUTC?[n.getUTCFullYear(),n.getUTCMonth(),n.getUTCDate()]:[n.getFullYear(),n.getMonth(),n.getDate()]}function le(t){var e,n,i,o,r,a=[];if(!t._d){for(i=se(t),t._w&&null==t._a[mo]&&null==t._a[po]&&ue(t),null!=t._dayOfYear&&(r=ae(t._a[fo],i[fo]),(t._dayOfYear>Q(r)||0===t._dayOfYear)&&(f(t)._overflowDayOfYear=!0),n=wt(r,0,t._dayOfYear),t._a[po]=n.getUTCMonth(),t._a[mo]=n.getUTCDate()),e=0;e<3&&null==t._a[e];++e)t._a[e]=a[e]=i[e];for(;e<7;e++)t._a[e]=a[e]=null==t._a[e]?2===e?1:0:t._a[e];24===t._a[go]&&0===t._a[vo]&&0===t._a[yo]&&0===t._a[bo]&&(t._nextDay=!0,t._a[go]=0),t._d=(t._useUTC?wt:bt).apply(null,a),o=t._useUTC?t._d.getUTCDay():t._d.getDay(),null!=t._tzm&&t._d.setUTCMinutes(t._d.getUTCMinutes()-t._tzm),t._nextDay&&(t._a[go]=24),t._w&&void 0!==t._w.d&&t._w.d!==o&&(f(t).weekdayMismatch=!0)}}function ue(t){var e,n,i,o,r,a,s,l;if(e=t._w,null!=e.GG||null!=e.W||null!=e.E)r=1,a=4,n=ae(e.GG,t._a[fo],Dt(Ce(),1,4).year),i=ae(e.W,1),((o=ae(e.E,1))<1||o>7)&&(l=!0);else{r=t._locale._week.dow,a=t._locale._week.doy;var u=Dt(Ce(),r,a);n=ae(e.gg,t._a[fo],u.year),i=ae(e.w,u.week),null!=e.d?((o=e.d)<0||o>6)&&(l=!0):null!=e.e?(o=e.e+r,(e.e<0||e.e>6)&&(l=!0)):o=r}i<1||i>kt(n,r,a)?f(t)._overflowWeeks=!0:null!=l?f(t)._overflowWeekday=!0:(s=_t(n,i,o,r,a),t._a[fo]=s.year,t._dayOfYear=s.dayOfYear)}function ce(t){var e,n,i,o,r,a,s=t._i,l=Bo.exec(s)||Wo.exec(s);if(l){for(f(t).iso=!0,e=0,n=$o.length;e0&&f(t).unusedInput.push(a),s=s.slice(s.indexOf(i)+i.length),u+=i.length),Ui[r]?(i?f(t).empty=!1:f(t).unusedTokens.push(r),K(r,i,t)):t._strict&&!i&&f(t).unusedTokens.push(r);f(t).charsLeftOver=l-u,s.length>0&&f(t).unusedInput.push(s),t._a[go]<=12&&!0===f(t).bigHour&&t._a[go]>0&&(f(t).bigHour=void 0),f(t).parsedDateParts=t._a.slice(0),f(t).meridiem=t._meridiem,t._a[go]=be(t._locale,t._a[go],t._meridiem),le(t),re(t)}function be(t,e,n){var i;return null==n?e:null!=t.meridiemHour?t.meridiemHour(e,n):null!=t.isPM?(i=t.isPM(n),i&&e<12&&(e+=12),i||12!==e||(e=0),e):e}function we(t){var e,n,i,o,r;if(0===t._f.length)return f(t).invalidFormat=!0,void(t._d=new Date(NaN));for(o=0;othis.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function qe(){if(!r(this._isDSTShifted))return this._isDSTShifted;var t={};if(g(t,this),t=De(t),t._a){var e=t._isUTC?d(t._a):Ce(t._a);this._isDSTShifted=this.isValid()&&x(t._a,e.toArray())>0}else this._isDSTShifted=!1;return this._isDSTShifted}function Ge(){return!!this.isValid()&&!this._isUTC}function Je(){return!!this.isValid()&&this._isUTC}function Ze(){return!!this.isValid()&&(this._isUTC&&0===this._offset)}function Xe(t,e){var n,i,o,r=t,s=null;return Re(t)?r={ms:t._milliseconds,d:t._days,M:t._months}:a(t)?(r={},e?r[e]=t:r.milliseconds=t):(s=er.exec(t))?(n="-"===s[1]?-1:1,r={y:0,d:w(s[mo])*n,h:w(s[go])*n,m:w(s[vo])*n,s:w(s[yo])*n,ms:w(Ae(1e3*s[bo]))*n}):(s=nr.exec(t))?(n="-"===s[1]?-1:1,r={y:Ke(s[2],n),M:Ke(s[3],n),w:Ke(s[4],n),d:Ke(s[5],n),h:Ke(s[6],n),m:Ke(s[7],n),s:Ke(s[8],n)}):null==r?r={}:"object"==typeof r&&("from"in r||"to"in r)&&(o=tn(Ce(r.from),Ce(r.to)),r={},r.ms=o.milliseconds,r.M=o.months),i=new Le(r),Re(t)&&u(t,"_locale")&&(i._locale=t._locale),i}function Ke(t,e){var n=t&&parseFloat(t.replace(",","."));return(isNaN(n)?0:n)*e}function Qe(t,e){var n={};return n.months=e.month()-t.month()+12*(e.year()-t.year()),t.clone().add(n.months,"M").isAfter(e)&&--n.months,n.milliseconds=+e-+t.clone().add(n.months,"M"),n}function tn(t,e){var n;return t.isValid()&&e.isValid()?(e=Fe(e,t),t.isBefore(e)?n=Qe(t,e):(n=Qe(e,t),n.milliseconds=-n.milliseconds,n.months=-n.months),n):{milliseconds:0,months:0}}function en(t,e){return function(n,i){var o,r;return null===i||isNaN(+i)||(k(e,"moment()."+e+"(period, number) is deprecated. Please use moment()."+e+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),r=n,n=i,i=r),n="string"==typeof n?+n:n,o=Xe(n,i),nn(this,o,t),this}}function nn(t,n,i,o){var r=n._milliseconds,a=Ae(n._days),s=Ae(n._months);t.isValid()&&(o=null==o||o,s&&ft(t,it(t,"Month")+s*i),a&&ot(t,"Date",it(t,"Date")+a*i),r&&t._d.setTime(t._d.valueOf()+r*i),o&&e.updateOffset(t,a||s))}function on(t,e){var n=t.diff(e,"days",!0);return n<-6?"sameElse":n<-1?"lastWeek":n<0?"lastDay":n<1?"sameDay":n<2?"nextDay":n<7?"nextWeek":"sameElse"}function rn(t,n){var i=t||Ce(),o=Fe(i,this).startOf("day"),r=e.calendarFormat(this,o)||"sameElse",a=n&&(S(n[r])?n[r].call(this,i):n[r]);return this.format(a||this.localeData().calendar(r,this,Ce(i)))}function an(){return new v(this)}function sn(t,e){var n=y(t)?t:Ce(t);return!(!this.isValid()||!n.isValid())&&(e=H(e)||"millisecond","millisecond"===e?this.valueOf()>n.valueOf():n.valueOf()9999?V(n,e?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):S(Date.prototype.toISOString)?e?this.toDate().toISOString():new Date(this.valueOf()+60*this.utcOffset()*1e3).toISOString().replace("Z",V(n,"Z")):V(n,e?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function vn(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var t="moment",e="";this.isLocal()||(t=0===this.utcOffset()?"moment.utc":"moment.parseZone",e="Z");var n="["+t+'("]',i=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",o=e+'[")]';return this.format(n+i+"-MM-DD[T]HH:mm:ss.SSS"+o)}function yn(t){t||(t=this.isUtc()?e.defaultFormatUtc:e.defaultFormat);var n=V(this,t);return this.localeData().postformat(n)}function bn(t,e){return this.isValid()&&(y(t)&&t.isValid()||Ce(t).isValid())?Xe({to:this,from:t}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()}function wn(t){return this.from(Ce(),t)}function xn(t,e){return this.isValid()&&(y(t)&&t.isValid()||Ce(t).isValid())?Xe({from:this,to:t}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()}function _n(t){return this.to(Ce(),t)}function Dn(t){var e;return void 0===t?this._locale._abbr:(e=ie(t),null!=e&&(this._locale=e),this)}function kn(){return this._locale}function Sn(t,e){return(t%e+e)%e}function Cn(t,e,n){return t<100&&t>=0?new Date(t+400,e,n)-ur:new Date(t,e,n).valueOf()}function Mn(t,e,n){return t<100&&t>=0?Date.UTC(t+400,e,n)-ur:Date.UTC(t,e,n)}function Tn(t){var n;if(void 0===(t=H(t))||"millisecond"===t||!this.isValid())return this;var i=this._isUTC?Mn:Cn;switch(t){case"year":n=i(this.year(),0,1);break;case"quarter":n=i(this.year(),this.month()-this.month()%3,1);break;case"month":n=i(this.year(),this.month(),1);break;case"week":n=i(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":n=i(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":n=i(this.year(),this.month(),this.date());break;case"hour":n=this._d.valueOf(),n-=Sn(n+(this._isUTC?0:this.utcOffset()*sr),lr);break;case"minute":n=this._d.valueOf(),n-=Sn(n,sr);break;case"second":n=this._d.valueOf(),n-=Sn(n,ar)}return this._d.setTime(n),e.updateOffset(this,!0),this}function En(t){var n;if(void 0===(t=H(t))||"millisecond"===t||!this.isValid())return this;var i=this._isUTC?Mn:Cn;switch(t){case"year":n=i(this.year()+1,0,1)-1;break;case"quarter":n=i(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":n=i(this.year(),this.month()+1,1)-1;break;case"week":n=i(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":n=i(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":n=i(this.year(),this.month(),this.date()+1)-1;break;case"hour":n=this._d.valueOf(),n+=lr-Sn(n+(this._isUTC?0:this.utcOffset()*sr),lr)-1;break;case"minute":n=this._d.valueOf(),n+=sr-Sn(n,sr)-1;break;case"second":n=this._d.valueOf(),n+=ar-Sn(n,ar)-1}return this._d.setTime(n),e.updateOffset(this,!0),this}function Pn(){return this._d.valueOf()-6e4*(this._offset||0)}function In(){return Math.floor(this.valueOf()/1e3)}function On(){return new Date(this.valueOf())}function Ln(){var t=this;return[t.year(),t.month(),t.date(),t.hour(),t.minute(),t.second(),t.millisecond()]}function Rn(){var t=this;return{years:t.year(),months:t.month(),date:t.date(),hours:t.hours(),minutes:t.minutes(),seconds:t.seconds(),milliseconds:t.milliseconds()}}function An(){return this.isValid()?this.toISOString():null}function Hn(){return p(this)}function Nn(){return c({},f(this))}function Fn(){return f(this).overflow}function Yn(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}function jn(t,e){z(0,[t,t.length],0,e)}function zn(t){return $n.call(this,t,this.week(),this.weekday(),this.localeData()._week.dow,this.localeData()._week.doy)}function Bn(t){return $n.call(this,t,this.isoWeek(),this.isoWeekday(),1,4)}function Wn(){return kt(this.year(),1,4)}function Vn(){var t=this.localeData()._week;return kt(this.year(),t.dow,t.doy)}function $n(t,e,n,i,o){var r;return null==t?Dt(this,i,o).year:(r=kt(t,i,o),e>r&&(e=r),Un.call(this,t,e,n,i,o))}function Un(t,e,n,i,o){var r=_t(t,e,n,i,o),a=wt(r.year,0,r.dayOfYear);return this.year(a.getUTCFullYear()),this.month(a.getUTCMonth()),this.date(a.getUTCDate()),this}function qn(t){return null==t?Math.ceil((this.month()+1)/3):this.month(3*(t-1)+this.month()%3)}function Gn(t){var e=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==t?e:this.add(t-e,"d")}function Jn(t,e){e[bo]=w(1e3*("0."+t))}function Zn(){return this._isUTC?"UTC":""}function Xn(){return this._isUTC?"Coordinated Universal Time":""}function Kn(t){return Ce(1e3*t)}function Qn(){return Ce.apply(null,arguments).parseZone()}function ti(t){return t}function ei(t,e,n,i){var o=ie(),r=d().set(i,e);return o[n](r,t)}function ni(t,e,n){if(a(t)&&(e=t,t=void 0),t=t||"",null!=e)return ei(t,e,n,"month");var i,o=[];for(i=0;i<12;i++)o[i]=ei(t,i,n,"month");return o}function ii(t,e,n,i){"boolean"==typeof t?(a(e)&&(n=e,e=void 0),e=e||""):(e=t,n=e,t=!1,a(e)&&(n=e,e=void 0),e=e||"");var o=ie(),r=t?o._week.dow:0;if(null!=n)return ei(e,(n+r)%7,i,"day");var s,l=[];for(s=0;s<7;s++)l[s]=ei(e,(s+r)%7,i,"day");return l}function oi(t,e){return ni(t,e,"months")}function ri(t,e){return ni(t,e,"monthsShort")}function ai(t,e,n){return ii(t,e,n,"weekdays")}function si(t,e,n){return ii(t,e,n,"weekdaysShort")}function li(t,e,n){return ii(t,e,n,"weekdaysMin")}function ui(){var t=this._data;return this._milliseconds=vr(this._milliseconds),this._days=vr(this._days),this._months=vr(this._months),t.milliseconds=vr(t.milliseconds),t.seconds=vr(t.seconds),t.minutes=vr(t.minutes),t.hours=vr(t.hours),t.months=vr(t.months),t.years=vr(t.years),this}function ci(t,e,n,i){var o=Xe(e,n);return t._milliseconds+=i*o._milliseconds,t._days+=i*o._days,t._months+=i*o._months,t._bubble()}function di(t,e){return ci(this,t,e,1)}function hi(t,e){return ci(this,t,e,-1)}function fi(t){return t<0?Math.floor(t):Math.ceil(t)}function pi(){var t,e,n,i,o,r=this._milliseconds,a=this._days,s=this._months,l=this._data;return r>=0&&a>=0&&s>=0||r<=0&&a<=0&&s<=0||(r+=864e5*fi(gi(s)+a),a=0,s=0),l.milliseconds=r%1e3,t=b(r/1e3),l.seconds=t%60,e=b(t/60),l.minutes=e%60,n=b(e/60),l.hours=n%24,a+=b(n/24),o=b(mi(a)),s+=o,a-=fi(gi(o)),i=b(s/12),s%=12,l.days=a,l.months=s,l.years=i,this}function mi(t){return 4800*t/146097}function gi(t){return 146097*t/4800}function vi(t){if(!this.isValid())return NaN;var e,n,i=this._milliseconds;if("month"===(t=H(t))||"quarter"===t||"year"===t)switch(e=this._days+i/864e5,n=this._months+mi(e),t){case"month":return n;case"quarter":return n/3;case"year":return n/12}else switch(e=this._days+Math.round(gi(this._months)),t){case"week":return e/7+i/6048e5;case"day":return e+i/864e5;case"hour":return 24*e+i/36e5;case"minute":return 1440*e+i/6e4;case"second":return 86400*e+i/1e3;case"millisecond":return Math.floor(864e5*e)+i;default:throw new Error("Unknown unit "+t)}}function yi(){return this.isValid()?this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*w(this._months/12):NaN}function bi(t){return function(){return this.as(t)}}function wi(){return Xe(this)}function xi(t){return t=H(t),this.isValid()?this[t+"s"]():NaN}function _i(t){return function(){return this.isValid()?this._data[t]:NaN}}function Di(){return b(this.days()/7)}function ki(t,e,n,i,o){return o.relativeTime(e||1,!!n,t,i)}function Si(t,e,n){var i=Xe(t).abs(),o=Rr(i.as("s")),r=Rr(i.as("m")),a=Rr(i.as("h")),s=Rr(i.as("d")),l=Rr(i.as("M")),u=Rr(i.as("y")),c=o<=Ar.ss&&["s",o]||o0,c[4]=n,ki.apply(null,c)}function Ci(t){return void 0===t?Rr:"function"==typeof t&&(Rr=t,!0)}function Mi(t,e){return void 0!==Ar[t]&&(void 0===e?Ar[t]:(Ar[t]=e,"s"===t&&(Ar.ss=e-1),!0))}function Ti(t){if(!this.isValid())return this.localeData().invalidDate();var e=this.localeData(),n=Si(this,!t,e);return t&&(n=e.pastFuture(+this,n)),e.postformat(n)}function Ei(t){return(t>0)-(t<0)||+t}function Pi(){if(!this.isValid())return this.localeData().invalidDate();var t,e,n,i=Hr(this._milliseconds)/1e3,o=Hr(this._days),r=Hr(this._months);t=b(i/60),e=b(t/60),i%=60,t%=60,n=b(r/12),r%=12;var a=n,s=r,l=o,u=e,c=t,d=i?i.toFixed(3).replace(/\.?0+$/,""):"",h=this.asSeconds();if(!h)return"P0D";var f=h<0?"-":"",p=Ei(this._months)!==Ei(h)?"-":"",m=Ei(this._days)!==Ei(h)?"-":"",g=Ei(this._milliseconds)!==Ei(h)?"-":"";return f+"P"+(a?p+a+"Y":"")+(s?p+s+"M":"")+(l?m+l+"D":"")+(u||c||d?"T":"")+(u?g+u+"H":"")+(c?g+c+"M":"")+(d?g+d+"S":"")}var Ii,Oi;Oi=Array.prototype.some?Array.prototype.some:function(t){for(var e=Object(this),n=e.length>>>0,i=0;i68?1900:2e3)};var _o,Do=nt("FullYear",!0);_o=Array.prototype.indexOf?Array.prototype.indexOf:function(t){var e;for(e=0;ethis?this:t:m()}),Ko=function(){return Date.now?Date.now():+new Date},Qo=["year","quarter","month","week","day","hour","minute","second","millisecond"];He("Z",":"),He("ZZ",""),U("Z",so),U("ZZ",so),Z(["Z","ZZ"],function(t,e,n){n._useUTC=!0,n._tzm=Ne(so,t)});var tr=/([\+\-]|\d\d)/gi;e.updateOffset=function(){};var er=/^(\-|\+)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)(\.\d*)?)?$/,nr=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;Xe.fn=Le.prototype,Xe.invalid=Oe;var ir=en(1,"add"),or=en(-1,"subtract");e.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",e.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";var rr=D("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(t){return void 0===t?this.localeData():this.locale(t)}),ar=1e3,sr=60*ar,lr=60*sr,ur=3506328*lr;z(0,["gg",2],0,function(){return this.weekYear()%100}),z(0,["GG",2],0,function(){return this.isoWeekYear()%100}),jn("gggg","weekYear"),jn("ggggg","weekYear"),jn("GGGG","isoWeekYear"),jn("GGGGG","isoWeekYear"),A("weekYear","gg"),A("isoWeekYear","GG"),F("weekYear",1),F("isoWeekYear",1),U("G",ro),U("g",ro),U("GG",Ki,Gi),U("gg",Ki,Gi),U("GGGG",no,Zi),U("gggg",no,Zi),U("GGGGG",io,Xi),U("ggggg",io,Xi),X(["gggg","ggggg","GGGG","GGGGG"],function(t,e,n,i){e[i.substr(0,2)]=w(t)}),X(["gg","GG"],function(t,n,i,o){n[o]=e.parseTwoDigitYear(t)}),z("Q",0,"Qo","quarter"),A("quarter","Q"),F("quarter",7),U("Q",qi),Z("Q",function(t,e){e[po]=3*(w(t)-1)}),z("D",["DD",2],"Do","date"),A("date","D"),F("date",9),U("D",Ki),U("DD",Ki,Gi),U("Do",function(t,e){return t?e._dayOfMonthOrdinalParse||e._ordinalParse:e._dayOfMonthOrdinalParseLenient}),Z(["D","DD"],mo),Z("Do",function(t,e){e[mo]=w(t.match(Ki)[0])});var cr=nt("Date",!0);z("DDD",["DDDD",3],"DDDo","dayOfYear"),A("dayOfYear","DDD"),F("dayOfYear",4),U("DDD",eo),U("DDDD",Ji),Z(["DDD","DDDD"],function(t,e,n){n._dayOfYear=w(t)}),z("m",["mm",2],0,"minute"),A("minute","m"),F("minute",14),U("m",Ki),U("mm",Ki,Gi),Z(["m","mm"],vo);var dr=nt("Minutes",!1);z("s",["ss",2],0,"second"),A("second","s"),F("second",15),U("s",Ki),U("ss",Ki,Gi),Z(["s","ss"],yo);var hr=nt("Seconds",!1);z("S",0,0,function(){return~~(this.millisecond()/100)}),z(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),z(0,["SSS",3],0,"millisecond"),z(0,["SSSS",4],0,function(){return 10*this.millisecond()}),z(0,["SSSSS",5],0,function(){return 100*this.millisecond()}),z(0,["SSSSSS",6],0,function(){return 1e3*this.millisecond()}),z(0,["SSSSSSS",7],0,function(){return 1e4*this.millisecond()}),z(0,["SSSSSSSS",8],0,function(){return 1e5*this.millisecond()}),z(0,["SSSSSSSSS",9],0,function(){return 1e6*this.millisecond()}),A("millisecond","ms"),F("millisecond",16),U("S",eo,qi),U("SS",eo,Gi),U("SSS",eo,Ji);var fr;for(fr="SSSS";fr.length<=9;fr+="S")U(fr,oo);for(fr="S";fr.length<=9;fr+="S")Z(fr,Jn);var pr=nt("Milliseconds",!1);z("z",0,0,"zoneAbbr"),z("zz",0,0,"zoneName");var mr=v.prototype;mr.add=ir,mr.calendar=rn,mr.clone=an,mr.diff=fn,mr.endOf=En,mr.format=yn,mr.from=bn,mr.fromNow=wn,mr.to=xn,mr.toNow=_n,mr.get=rt,mr.invalidAt=Fn,mr.isAfter=sn,mr.isBefore=ln,mr.isBetween=un,mr.isSame=cn,mr.isSameOrAfter=dn,mr.isSameOrBefore=hn,mr.isValid=Hn,mr.lang=rr,mr.locale=Dn,mr.localeData=kn,mr.max=Xo,mr.min=Zo,mr.parsingFlags=Nn,mr.set=at,mr.startOf=Tn,mr.subtract=or,mr.toArray=Ln,mr.toObject=Rn,mr.toDate=On,mr.toISOString=gn,mr.inspect=vn,mr.toJSON=An,mr.toString=mn,mr.unix=In,mr.valueOf=Pn,mr.creationData=Yn,mr.year=Do,mr.isLeapYear=et,mr.weekYear=zn,mr.isoWeekYear=Bn,mr.quarter=mr.quarters=qn,mr.month=pt,mr.daysInMonth=mt,mr.week=mr.weeks=Tt,mr.isoWeek=mr.isoWeeks=Et,mr.weeksInYear=Vn,mr.isoWeeksInYear=Wn,mr.date=cr,mr.day=mr.days=Ft,mr.weekday=Yt,mr.isoWeekday=jt,mr.dayOfYear=Gn,mr.hour=mr.hours=Fo,mr.minute=mr.minutes=dr,mr.second=mr.seconds=hr,mr.millisecond=mr.milliseconds=pr,mr.utcOffset=je,mr.utc=Be,mr.local=We,mr.parseZone=Ve,mr.hasAlignedHourOffset=$e,mr.isDST=Ue,mr.isLocal=Ge,mr.isUtcOffset=Je,mr.isUtc=Ze,mr.isUTC=Ze,mr.zoneAbbr=Zn,mr.zoneName=Xn,mr.dates=D("dates accessor is deprecated. Use date instead.",cr),mr.months=D("months accessor is deprecated. Use month instead",pt),mr.years=D("years accessor is deprecated. Use year instead",Do),mr.zone=D("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",ze),mr.isDSTShifted=D("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",qe);var gr=T.prototype;gr.calendar=E,gr.longDateFormat=P,gr.invalidDate=I,gr.ordinal=O,gr.preparse=ti,gr.postformat=ti,gr.relativeTime=L,gr.pastFuture=R,gr.set=C,gr.months=ut,gr.monthsShort=ct,gr.monthsParse=ht,gr.monthsRegex=vt,gr.monthsShortRegex=gt,gr.week=St,gr.firstDayOfYear=Mt,gr.firstDayOfWeek=Ct,gr.weekdays=Lt,gr.weekdaysMin=At,gr.weekdaysShort=Rt,gr.weekdaysParse=Nt,gr.weekdaysRegex=zt,gr.weekdaysShortRegex=Bt,gr.weekdaysMinRegex=Wt,gr.isPM=Jt,gr.meridiem=Zt,te("en",{dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(t){var e=t%10;return t+(1===w(t%100/10)?"th":1===e?"st":2===e?"nd":3===e?"rd":"th")}}),e.lang=D("moment.lang is deprecated. Use moment.locale instead.",te),e.langData=D("moment.langData is deprecated. Use moment.localeData instead.",ie);var vr=Math.abs,yr=bi("ms"),br=bi("s"),wr=bi("m"),xr=bi("h"),_r=bi("d"),Dr=bi("w"),kr=bi("M"),Sr=bi("Q"),Cr=bi("y"),Mr=_i("milliseconds"),Tr=_i("seconds"),Er=_i("minutes"),Pr=_i("hours"),Ir=_i("days"),Or=_i("months"),Lr=_i("years"),Rr=Math.round,Ar={ss:44,s:45,m:45,h:22,d:26,M:11},Hr=Math.abs,Nr=Le.prototype;return Nr.isValid=Ie,Nr.abs=ui,Nr.add=di,Nr.subtract=hi,Nr.as=vi,Nr.asMilliseconds=yr,Nr.asSeconds=br,Nr.asMinutes=wr,Nr.asHours=xr,Nr.asDays=_r,Nr.asWeeks=Dr,Nr.asMonths=kr,Nr.asQuarters=Sr,Nr.asYears=Cr,Nr.valueOf=yi,Nr._bubble=pi,Nr.clone=wi,Nr.get=xi,Nr.milliseconds=Mr,Nr.seconds=Tr,Nr.minutes=Er,Nr.hours=Pr,Nr.days=Ir,Nr.weeks=Di,Nr.months=Or,Nr.years=Lr,Nr.humanize=Ti,Nr.toISOString=Pi,Nr.toString=Pi,Nr.toJSON=Pi,Nr.locale=Dn,Nr.localeData=kn,Nr.toIsoString=D("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Pi),Nr.lang=rr,z("X",0,0,"unix"),z("x",0,0,"valueOf"),U("x",ro),U("X",lo),Z("X",function(t,e,n){n._d=new Date(1e3*parseFloat(t,10))}),Z("x",function(t,e,n){n._d=new Date(w(t))}),e.version="2.24.0",function(t){Ii=t}(Ce),e.fn=mr,e.min=Te,e.max=Ee,e.now=Ko,e.utc=d,e.unix=Kn,e.months=oi,e.isDate=s,e.locale=te,e.invalid=m,e.duration=Xe,e.isMoment=y,e.weekdays=ai,e.parseZone=Qn,e.localeData=ie,e.isDuration=Re,e.monthsShort=ri,e.weekdaysMin=li,e.defineLocale=ee,e.updateLocale=ne,e.locales=oe,e.weekdaysShort=si,e.normalizeUnits=H,e.relativeTimeRounding=Ci,e.relativeTimeThreshold=Mi,e.calendarFormat=on,e.prototype=mr,e.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"},e})}).call(e,n("3IRH")(t))},"PL/P":function(t,e,n){var i,o;/**
+!function(e,i){t.exports=i(n("olwm"),n("7t+N"))}("undefined"!=typeof self&&self,function(t,e){return function(t){function e(i){if(n[i])return n[i].exports;var o=n[i]={i:i,l:!1,exports:{}};return t[i].call(o.exports,o,o.exports,e),o.l=!0,o.exports}var n={};return e.m=t,e.c=n,e.d=function(t,n,i){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:i})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=270)}({1:function(e,n){e.exports=t},2:function(t,e){var n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};e.__extends=function(t,e){function i(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}},270:function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0});var i=n(1),o=n(271);i.EventSourceParser.registerClass(o.default),i.GcalEventSource=o.default},271:function(t,e,n){function i(t){var e;return/^[^\/]+@([^\/\.]+\.)*(google|googlemail|gmail)\.com$/.test(t)?t:(e=/^https:\/\/www.googleapis.com\/calendar\/v3\/calendars\/([^\/]*)/.exec(t))||(e=/^https?:\/\/www.google.com\/calendar\/feeds\/([^\/]*)/.exec(t))?decodeURIComponent(e[1]):void 0}function o(t,e){return t.replace(/(\?.*?)?(#|$)/,function(t,n,i){return(n?n+"&":"?")+e+i})}Object.defineProperty(e,"__esModule",{value:!0});var r=n(2),a=n(3),s=n(1),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e.parse=function(t,e){var n;return"object"==typeof t?n=t:"string"==typeof t&&(n={url:t}),!!n&&s.EventSource.parse.call(this,n,e)},e.prototype.fetch=function(t,e,n){var i=this,o=this.buildUrl(),r=this.buildRequestParams(t,e,n),l=this.ajaxSettings||{},u=l.success;return r?(this.calendar.pushLoading(),s.Promise.construct(function(t,e){a.ajax(a.extend({},s.JsonFeedEventSource.AJAX_DEFAULTS,l,{url:o,data:r,success:function(n,o,l){var c,d;i.calendar.popLoading(),n.error?(i.reportError("Google Calendar API: "+n.error.message,n.error.errors),e()):n.items&&(c=i.gcalItemsToRawEventDefs(n.items,r.timeZone),d=s.applyAll(u,i,[n,o,l]),a.isArray(d)&&(c=d),t(i.parseEventDefs(c)))},error:function(t,n,o){i.reportError("Google Calendar network failure: "+n,[t,o]),i.calendar.popLoading(),e()}}))})):s.Promise.reject()},e.prototype.gcalItemsToRawEventDefs=function(t,e){var n=this;return t.map(function(t){return n.gcalItemToRawEventDef(t,e)})},e.prototype.gcalItemToRawEventDef=function(t,e){var n=t.htmlLink||null;n&&e&&(n=o(n,"ctz="+e));var i={};return"object"==typeof t.extendedProperties&&"object"==typeof t.extendedProperties.shared&&(i=t.extendedProperties.shared),{id:t.id,title:t.summary,start:t.start.dateTime||t.start.date,end:t.end.dateTime||t.end.date,url:n,location:t.location,description:t.description,extendedProperties:i}},e.prototype.buildUrl=function(){return e.API_BASE+"/"+encodeURIComponent(this.googleCalendarId)+"/events?callback=?"},e.prototype.buildRequestParams=function(t,e,n){var i,o=this.googleCalendarApiKey||this.calendar.opt("googleCalendarApiKey");return o?(t.hasZone()||(t=t.clone().utc().add(-1,"day")),e.hasZone()||(e=e.clone().utc().add(1,"day")),i=a.extend(this.ajaxSettings.data||{},{key:o,timeMin:t.format(),timeMax:e.format(),singleEvents:!0,maxResults:9999}),n&&"local"!==n&&(i.timeZone=n.replace(" ","_")),i):(this.reportError("Specify a googleCalendarApiKey. See http://fullcalendar.io/docs/google_calendar/"),null)},e.prototype.reportError=function(t,e){var n=this.calendar,i=n.opt("googleCalendarError"),o=e||[{message:t}];this.googleCalendarError&&this.googleCalendarError.apply(n,o),i&&i.apply(n,o),s.warn.apply(null,[t].concat(e||[]))},e.prototype.getPrimitive=function(){return this.googleCalendarId},e.prototype.applyManualStandardProps=function(t){var e=s.EventSource.prototype.applyManualStandardProps.apply(this,arguments),n=t.googleCalendarId;return null==n&&t.url&&(n=i(t.url)),null!=n&&(this.googleCalendarId=n,e)},e.prototype.applyMiscProps=function(t){this.ajaxSettings||(this.ajaxSettings={}),a.extend(this.ajaxSettings,t)},e.API_BASE="https://www.googleapis.com/calendar/v3/calendars",e}(s.EventSource);e.default=l,l.defineStandardProps({url:!1,googleCalendarId:!1,googleCalendarApiKey:!0,googleCalendarError:!0})},3:function(t,n){t.exports=e}})})},IArr:function(t,e,n){"use strict";function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function r(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var a=n("7t+N"),s=(n.n(a),n("ITav")),l=function(){function t(t,e){for(var n=0;n ul.menu");var n=this,i=function(){n.reloadRecentActivities()};setTimeout(i,500),document.addEventListener("kimai.timesheetStop",i),document.addEventListener("kimai.activityUpdate",i),document.addEventListener("kimai.projectUpdate",i),document.addEventListener("kimai.customerUpdate",i)}}},{key:"emptyList",value:function(){this.itemList.innerHTML=""}},{key:"setEntries",value:function(t){if(0===t.length)return void this.emptyList();var e="",n=!0,i=!1,o=void 0;try{for(var r,a=t[Symbol.iterator]();!(n=(r=a.next()).done);n=!0){var s=r.value,l=this.attributes.template.replace("%customer%",s.project.customer.name).replace("%project%",s.project.name).replace("%activity%",s.activity.name);e+='- '+l+"
"}}catch(t){i=!0,o=t}finally{try{!n&&a.return&&a.return()}finally{if(i)throw o}}this.itemList.innerHTML=e}},{key:"reloadRecentActivities",value:function(){var t=this;this.getContainer().getPlugin("api").get(this.attributes.api,{},function(e){t.setEntries(e)})}}]),e}(a.a);e.a=l},ORgI:function(t,e,n){!function(t,e){e(n("PJh5"))}(0,function(t){"use strict";return t.defineLocale("ja",{months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"日曜日_月曜日_火曜日_水曜日_木曜日_金曜日_土曜日".split("_"),weekdaysShort:"日_月_火_水_木_金_土".split("_"),weekdaysMin:"日_月_火_水_木_金_土".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日 HH:mm",LLLL:"YYYY年M月D日 dddd HH:mm",l:"YYYY/MM/DD",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日(ddd) HH:mm"},meridiemParse:/午前|午後/i,isPM:function(t){return"午後"===t},meridiem:function(t,e,n){return t<12?"午前":"午後"},calendar:{sameDay:"[今日] LT",nextDay:"[明日] LT",nextWeek:function(t){return t.week()0)for(n=0;n0?"future":"past"];return S(n)?n(e):n.replace(/%s/i,e)}function A(t,e){var n=t.toLowerCase();zi[n]=zi[n+"s"]=zi[e]=t}function H(t){return"string"==typeof t?zi[t]||zi[t.toLowerCase()]:void 0}function N(t){var e,n,i={};for(n in t)u(t,n)&&(e=H(n))&&(i[e]=t[n]);return i}function F(t,e){Bi[t]=e}function Y(t){var e=[];for(var n in t)e.push({unit:n,priority:Bi[n]});return e.sort(function(t,e){return t.priority-e.priority}),e}function j(t,e,n){var i=""+Math.abs(t),o=e-i.length;return(t>=0?n?"+":"":"-")+Math.pow(10,Math.max(0,o)).toString().substr(1)+i}function z(t,e,n,i){var o=i;"string"==typeof i&&(o=function(){return this[i]()}),t&&(Ui[t]=o),e&&(Ui[e[0]]=function(){return j(o.apply(this,arguments),e[1],e[2])}),n&&(Ui[n]=function(){return this.localeData().ordinal(o.apply(this,arguments),t)})}function B(t){return t.match(/\[[\s\S]/)?t.replace(/^\[|\]$/g,""):t.replace(/\\/g,"")}function W(t){var e,n,i=t.match(Wi);for(e=0,n=i.length;e=0&&Vi.test(t);)t=t.replace(Vi,n),Vi.lastIndex=0,i-=1;return t}function U(t,e,n){co[t]=S(e)?e:function(t,i){return t&&n?n:e}}function q(t,e){return u(co,t)?co[t](e._strict,e._locale):new RegExp(G(t))}function G(t){return J(t.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(t,e,n,i,o){return e||n||i||o}))}function J(t){return t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function Z(t,e){var n,i=e;for("string"==typeof t&&(t=[t]),a(e)&&(i=function(t,n){n[e]=w(t)}),n=0;n=0?(s=new Date(t+400,e,n,i,o,r,a),isFinite(s.getFullYear())&&s.setFullYear(t)):s=new Date(t,e,n,i,o,r,a),s}function wt(t){var e;if(t<100&&t>=0){var n=Array.prototype.slice.call(arguments);n[0]=t+400,e=new Date(Date.UTC.apply(null,n)),isFinite(e.getUTCFullYear())&&e.setUTCFullYear(t)}else e=new Date(Date.UTC.apply(null,arguments));return e}function xt(t,e,n){var i=7+e-n;return-(7+wt(t,0,i).getUTCDay()-e)%7+i-1}function _t(t,e,n,i,o){var r,a,s=(7+n-i)%7,l=xt(t,i,o),u=1+7*(e-1)+s+l;return u<=0?(r=t-1,a=Q(r)+u):u>Q(t)?(r=t+1,a=u-Q(t)):(r=t,a=u),{year:r,dayOfYear:a}}function Dt(t,e,n){var i,o,r=xt(t.year(),e,n),a=Math.floor((t.dayOfYear()-r-1)/7)+1;return a<1?(o=t.year()-1,i=a+kt(o,e,n)):a>kt(t.year(),e,n)?(i=a-kt(t.year(),e,n),o=t.year()+1):(o=t.year(),i=a),{week:i,year:o}}function kt(t,e,n){var i=xt(t,e,n),o=xt(t+1,e,n);return(Q(t)-i+o)/7}function St(t){return Dt(t,this._week.dow,this._week.doy).week}function Ct(){return this._week.dow}function Mt(){return this._week.doy}function Tt(t){var e=this.localeData().week(this);return null==t?e:this.add(7*(t-e),"d")}function Et(t){var e=Dt(this,1,4).week;return null==t?e:this.add(7*(t-e),"d")}function Pt(t,e){return"string"!=typeof t?t:isNaN(t)?(t=e.weekdaysParse(t),"number"==typeof t?t:null):parseInt(t,10)}function It(t,e){return"string"==typeof t?e.weekdaysParse(t)%7||7:isNaN(t)?null:t}function Ot(t,e){return t.slice(e,7).concat(t.slice(0,e))}function Lt(t,e){var i=n(this._weekdays)?this._weekdays:this._weekdays[t&&!0!==t&&this._weekdays.isFormat.test(e)?"format":"standalone"];return!0===t?Ot(i,this._week.dow):t?i[t.day()]:i}function Rt(t){return!0===t?Ot(this._weekdaysShort,this._week.dow):t?this._weekdaysShort[t.day()]:this._weekdaysShort}function At(t){return!0===t?Ot(this._weekdaysMin,this._week.dow):t?this._weekdaysMin[t.day()]:this._weekdaysMin}function Ht(t,e,n){var i,o,r,a=t.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],i=0;i<7;++i)r=d([2e3,1]).day(i),this._minWeekdaysParse[i]=this.weekdaysMin(r,"").toLocaleLowerCase(),this._shortWeekdaysParse[i]=this.weekdaysShort(r,"").toLocaleLowerCase(),this._weekdaysParse[i]=this.weekdays(r,"").toLocaleLowerCase();return n?"dddd"===e?(o=_o.call(this._weekdaysParse,a),-1!==o?o:null):"ddd"===e?(o=_o.call(this._shortWeekdaysParse,a),-1!==o?o:null):(o=_o.call(this._minWeekdaysParse,a),-1!==o?o:null):"dddd"===e?-1!==(o=_o.call(this._weekdaysParse,a))?o:-1!==(o=_o.call(this._shortWeekdaysParse,a))?o:(o=_o.call(this._minWeekdaysParse,a),-1!==o?o:null):"ddd"===e?-1!==(o=_o.call(this._shortWeekdaysParse,a))?o:-1!==(o=_o.call(this._weekdaysParse,a))?o:(o=_o.call(this._minWeekdaysParse,a),-1!==o?o:null):-1!==(o=_o.call(this._minWeekdaysParse,a))?o:-1!==(o=_o.call(this._weekdaysParse,a))?o:(o=_o.call(this._shortWeekdaysParse,a),-1!==o?o:null)}function Nt(t,e,n){var i,o,r;if(this._weekdaysParseExact)return Ht.call(this,t,e,n);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),i=0;i<7;i++){if(o=d([2e3,1]).day(i),n&&!this._fullWeekdaysParse[i]&&(this._fullWeekdaysParse[i]=new RegExp("^"+this.weekdays(o,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[i]=new RegExp("^"+this.weekdaysShort(o,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[i]=new RegExp("^"+this.weekdaysMin(o,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[i]||(r="^"+this.weekdays(o,"")+"|^"+this.weekdaysShort(o,"")+"|^"+this.weekdaysMin(o,""),this._weekdaysParse[i]=new RegExp(r.replace(".",""),"i")),n&&"dddd"===e&&this._fullWeekdaysParse[i].test(t))return i;if(n&&"ddd"===e&&this._shortWeekdaysParse[i].test(t))return i;if(n&&"dd"===e&&this._minWeekdaysParse[i].test(t))return i;if(!n&&this._weekdaysParse[i].test(t))return i}}function Ft(t){if(!this.isValid())return null!=t?this:NaN;var e=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=t?(t=Pt(t,this.localeData()),this.add(t-e,"d")):e}function Yt(t){if(!this.isValid())return null!=t?this:NaN;var e=(this.day()+7-this.localeData()._week.dow)%7;return null==t?e:this.add(t-e,"d")}function jt(t){if(!this.isValid())return null!=t?this:NaN;if(null!=t){var e=It(t,this.localeData());return this.day(this.day()%7?e:e-7)}return this.day()||7}function zt(t){return this._weekdaysParseExact?(u(this,"_weekdaysRegex")||Vt.call(this),t?this._weekdaysStrictRegex:this._weekdaysRegex):(u(this,"_weekdaysRegex")||(this._weekdaysRegex=Lo),this._weekdaysStrictRegex&&t?this._weekdaysStrictRegex:this._weekdaysRegex)}function Bt(t){return this._weekdaysParseExact?(u(this,"_weekdaysRegex")||Vt.call(this),t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(u(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=Ro),this._weekdaysShortStrictRegex&&t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function Wt(t){return this._weekdaysParseExact?(u(this,"_weekdaysRegex")||Vt.call(this),t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(u(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=Ao),this._weekdaysMinStrictRegex&&t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function Vt(){function t(t,e){return e.length-t.length}var e,n,i,o,r,a=[],s=[],l=[],u=[];for(e=0;e<7;e++)n=d([2e3,1]).day(e),i=this.weekdaysMin(n,""),o=this.weekdaysShort(n,""),r=this.weekdays(n,""),a.push(i),s.push(o),l.push(r),u.push(i),u.push(o),u.push(r);for(a.sort(t),s.sort(t),l.sort(t),u.sort(t),e=0;e<7;e++)s[e]=J(s[e]),l[e]=J(l[e]),u[e]=J(u[e]);this._weekdaysRegex=new RegExp("^("+u.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+l.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+s.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+a.join("|")+")","i")}function $t(){return this.hours()%12||12}function Ut(){return this.hours()||24}function qt(t,e){z(t,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),e)})}function Gt(t,e){return e._meridiemParse}function Jt(t){return"p"===(t+"").toLowerCase().charAt(0)}function Zt(t,e,n){return t>11?n?"pm":"PM":n?"am":"AM"}function Xt(t){return t?t.toLowerCase().replace("_","-"):t}function Kt(t){for(var e,n,i,o,r=0;r0;){if(i=Qt(o.slice(0,e).join("-")))return i;if(n&&n.length>=e&&x(o,n,!0)>=e-1)break;e--}r++}return Ho}function Qt(e){var n=null;if(!jo[e]&&void 0!==t&&t&&t.exports)try{n=Ho._abbr;!function(){var t=new Error('Cannot find module "./locale"');throw t.code="MODULE_NOT_FOUND",t}(),te(n)}catch(t){}return jo[e]}function te(t,e){var n;return t&&(n=r(e)?ie(t):ee(t,e),n?Ho=n:"undefined"!=typeof console&&console.warn&&console.warn("Locale "+t+" not found. Did you forget to load it?")),Ho._abbr}function ee(t,e){if(null!==e){var n,i=Yo;if(e.abbr=t,null!=jo[t])k("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),i=jo[t]._config;else if(null!=e.parentLocale)if(null!=jo[e.parentLocale])i=jo[e.parentLocale]._config;else{if(null==(n=Qt(e.parentLocale)))return zo[e.parentLocale]||(zo[e.parentLocale]=[]),zo[e.parentLocale].push({name:t,config:e}),null;i=n._config}return jo[t]=new T(M(i,e)),zo[t]&&zo[t].forEach(function(t){ee(t.name,t.config)}),te(t),jo[t]}return delete jo[t],null}function ne(t,e){if(null!=e){var n,i,o=Yo;i=Qt(t),null!=i&&(o=i._config),e=M(o,e),n=new T(e),n.parentLocale=jo[t],jo[t]=n,te(t)}else null!=jo[t]&&(null!=jo[t].parentLocale?jo[t]=jo[t].parentLocale:null!=jo[t]&&delete jo[t]);return jo[t]}function ie(t){var e;if(t&&t._locale&&t._locale._abbr&&(t=t._locale._abbr),!t)return Ho;if(!n(t)){if(e=Qt(t))return e;t=[t]}return Kt(t)}function oe(){return Hi(jo)}function re(t){var e,n=t._a;return n&&-2===f(t).overflow&&(e=n[po]<0||n[po]>11?po:n[mo]<1||n[mo]>lt(n[fo],n[po])?mo:n[go]<0||n[go]>24||24===n[go]&&(0!==n[vo]||0!==n[yo]||0!==n[bo])?go:n[vo]<0||n[vo]>59?vo:n[yo]<0||n[yo]>59?yo:n[bo]<0||n[bo]>999?bo:-1,f(t)._overflowDayOfYear&&(emo)&&(e=mo),f(t)._overflowWeeks&&-1===e&&(e=wo),f(t)._overflowWeekday&&-1===e&&(e=xo),f(t).overflow=e),t}function ae(t,e,n){return null!=t?t:null!=e?e:n}function se(t){var n=new Date(e.now());return t._useUTC?[n.getUTCFullYear(),n.getUTCMonth(),n.getUTCDate()]:[n.getFullYear(),n.getMonth(),n.getDate()]}function le(t){var e,n,i,o,r,a=[];if(!t._d){for(i=se(t),t._w&&null==t._a[mo]&&null==t._a[po]&&ue(t),null!=t._dayOfYear&&(r=ae(t._a[fo],i[fo]),(t._dayOfYear>Q(r)||0===t._dayOfYear)&&(f(t)._overflowDayOfYear=!0),n=wt(r,0,t._dayOfYear),t._a[po]=n.getUTCMonth(),t._a[mo]=n.getUTCDate()),e=0;e<3&&null==t._a[e];++e)t._a[e]=a[e]=i[e];for(;e<7;e++)t._a[e]=a[e]=null==t._a[e]?2===e?1:0:t._a[e];24===t._a[go]&&0===t._a[vo]&&0===t._a[yo]&&0===t._a[bo]&&(t._nextDay=!0,t._a[go]=0),t._d=(t._useUTC?wt:bt).apply(null,a),o=t._useUTC?t._d.getUTCDay():t._d.getDay(),null!=t._tzm&&t._d.setUTCMinutes(t._d.getUTCMinutes()-t._tzm),t._nextDay&&(t._a[go]=24),t._w&&void 0!==t._w.d&&t._w.d!==o&&(f(t).weekdayMismatch=!0)}}function ue(t){var e,n,i,o,r,a,s,l;if(e=t._w,null!=e.GG||null!=e.W||null!=e.E)r=1,a=4,n=ae(e.GG,t._a[fo],Dt(Ce(),1,4).year),i=ae(e.W,1),((o=ae(e.E,1))<1||o>7)&&(l=!0);else{r=t._locale._week.dow,a=t._locale._week.doy;var u=Dt(Ce(),r,a);n=ae(e.gg,t._a[fo],u.year),i=ae(e.w,u.week),null!=e.d?((o=e.d)<0||o>6)&&(l=!0):null!=e.e?(o=e.e+r,(e.e<0||e.e>6)&&(l=!0)):o=r}i<1||i>kt(n,r,a)?f(t)._overflowWeeks=!0:null!=l?f(t)._overflowWeekday=!0:(s=_t(n,i,o,r,a),t._a[fo]=s.year,t._dayOfYear=s.dayOfYear)}function ce(t){var e,n,i,o,r,a,s=t._i,l=Bo.exec(s)||Wo.exec(s);if(l){for(f(t).iso=!0,e=0,n=$o.length;e0&&f(t).unusedInput.push(a),s=s.slice(s.indexOf(i)+i.length),u+=i.length),Ui[r]?(i?f(t).empty=!1:f(t).unusedTokens.push(r),K(r,i,t)):t._strict&&!i&&f(t).unusedTokens.push(r);f(t).charsLeftOver=l-u,s.length>0&&f(t).unusedInput.push(s),t._a[go]<=12&&!0===f(t).bigHour&&t._a[go]>0&&(f(t).bigHour=void 0),f(t).parsedDateParts=t._a.slice(0),f(t).meridiem=t._meridiem,t._a[go]=be(t._locale,t._a[go],t._meridiem),le(t),re(t)}function be(t,e,n){var i;return null==n?e:null!=t.meridiemHour?t.meridiemHour(e,n):null!=t.isPM?(i=t.isPM(n),i&&e<12&&(e+=12),i||12!==e||(e=0),e):e}function we(t){var e,n,i,o,r;if(0===t._f.length)return f(t).invalidFormat=!0,void(t._d=new Date(NaN));for(o=0;othis.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function qe(){if(!r(this._isDSTShifted))return this._isDSTShifted;var t={};if(g(t,this),t=De(t),t._a){var e=t._isUTC?d(t._a):Ce(t._a);this._isDSTShifted=this.isValid()&&x(t._a,e.toArray())>0}else this._isDSTShifted=!1;return this._isDSTShifted}function Ge(){return!!this.isValid()&&!this._isUTC}function Je(){return!!this.isValid()&&this._isUTC}function Ze(){return!!this.isValid()&&(this._isUTC&&0===this._offset)}function Xe(t,e){var n,i,o,r=t,s=null;return Re(t)?r={ms:t._milliseconds,d:t._days,M:t._months}:a(t)?(r={},e?r[e]=t:r.milliseconds=t):(s=er.exec(t))?(n="-"===s[1]?-1:1,r={y:0,d:w(s[mo])*n,h:w(s[go])*n,m:w(s[vo])*n,s:w(s[yo])*n,ms:w(Ae(1e3*s[bo]))*n}):(s=nr.exec(t))?(n="-"===s[1]?-1:1,r={y:Ke(s[2],n),M:Ke(s[3],n),w:Ke(s[4],n),d:Ke(s[5],n),h:Ke(s[6],n),m:Ke(s[7],n),s:Ke(s[8],n)}):null==r?r={}:"object"==typeof r&&("from"in r||"to"in r)&&(o=tn(Ce(r.from),Ce(r.to)),r={},r.ms=o.milliseconds,r.M=o.months),i=new Le(r),Re(t)&&u(t,"_locale")&&(i._locale=t._locale),i}function Ke(t,e){var n=t&&parseFloat(t.replace(",","."));return(isNaN(n)?0:n)*e}function Qe(t,e){var n={};return n.months=e.month()-t.month()+12*(e.year()-t.year()),t.clone().add(n.months,"M").isAfter(e)&&--n.months,n.milliseconds=+e-+t.clone().add(n.months,"M"),n}function tn(t,e){var n;return t.isValid()&&e.isValid()?(e=Fe(e,t),t.isBefore(e)?n=Qe(t,e):(n=Qe(e,t),n.milliseconds=-n.milliseconds,n.months=-n.months),n):{milliseconds:0,months:0}}function en(t,e){return function(n,i){var o,r;return null===i||isNaN(+i)||(k(e,"moment()."+e+"(period, number) is deprecated. Please use moment()."+e+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),r=n,n=i,i=r),n="string"==typeof n?+n:n,o=Xe(n,i),nn(this,o,t),this}}function nn(t,n,i,o){var r=n._milliseconds,a=Ae(n._days),s=Ae(n._months);t.isValid()&&(o=null==o||o,s&&ft(t,it(t,"Month")+s*i),a&&ot(t,"Date",it(t,"Date")+a*i),r&&t._d.setTime(t._d.valueOf()+r*i),o&&e.updateOffset(t,a||s))}function on(t,e){var n=t.diff(e,"days",!0);return n<-6?"sameElse":n<-1?"lastWeek":n<0?"lastDay":n<1?"sameDay":n<2?"nextDay":n<7?"nextWeek":"sameElse"}function rn(t,n){var i=t||Ce(),o=Fe(i,this).startOf("day"),r=e.calendarFormat(this,o)||"sameElse",a=n&&(S(n[r])?n[r].call(this,i):n[r]);return this.format(a||this.localeData().calendar(r,this,Ce(i)))}function an(){return new v(this)}function sn(t,e){var n=y(t)?t:Ce(t);return!(!this.isValid()||!n.isValid())&&(e=H(e)||"millisecond","millisecond"===e?this.valueOf()>n.valueOf():n.valueOf()9999?V(n,e?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):S(Date.prototype.toISOString)?e?this.toDate().toISOString():new Date(this.valueOf()+60*this.utcOffset()*1e3).toISOString().replace("Z",V(n,"Z")):V(n,e?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function vn(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var t="moment",e="";this.isLocal()||(t=0===this.utcOffset()?"moment.utc":"moment.parseZone",e="Z");var n="["+t+'("]',i=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",o=e+'[")]';return this.format(n+i+"-MM-DD[T]HH:mm:ss.SSS"+o)}function yn(t){t||(t=this.isUtc()?e.defaultFormatUtc:e.defaultFormat);var n=V(this,t);return this.localeData().postformat(n)}function bn(t,e){return this.isValid()&&(y(t)&&t.isValid()||Ce(t).isValid())?Xe({to:this,from:t}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()}function wn(t){return this.from(Ce(),t)}function xn(t,e){return this.isValid()&&(y(t)&&t.isValid()||Ce(t).isValid())?Xe({from:this,to:t}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()}function _n(t){return this.to(Ce(),t)}function Dn(t){var e;return void 0===t?this._locale._abbr:(e=ie(t),null!=e&&(this._locale=e),this)}function kn(){return this._locale}function Sn(t,e){return(t%e+e)%e}function Cn(t,e,n){return t<100&&t>=0?new Date(t+400,e,n)-ur:new Date(t,e,n).valueOf()}function Mn(t,e,n){return t<100&&t>=0?Date.UTC(t+400,e,n)-ur:Date.UTC(t,e,n)}function Tn(t){var n;if(void 0===(t=H(t))||"millisecond"===t||!this.isValid())return this;var i=this._isUTC?Mn:Cn;switch(t){case"year":n=i(this.year(),0,1);break;case"quarter":n=i(this.year(),this.month()-this.month()%3,1);break;case"month":n=i(this.year(),this.month(),1);break;case"week":n=i(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":n=i(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":n=i(this.year(),this.month(),this.date());break;case"hour":n=this._d.valueOf(),n-=Sn(n+(this._isUTC?0:this.utcOffset()*sr),lr);break;case"minute":n=this._d.valueOf(),n-=Sn(n,sr);break;case"second":n=this._d.valueOf(),n-=Sn(n,ar)}return this._d.setTime(n),e.updateOffset(this,!0),this}function En(t){var n;if(void 0===(t=H(t))||"millisecond"===t||!this.isValid())return this;var i=this._isUTC?Mn:Cn;switch(t){case"year":n=i(this.year()+1,0,1)-1;break;case"quarter":n=i(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":n=i(this.year(),this.month()+1,1)-1;break;case"week":n=i(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":n=i(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":n=i(this.year(),this.month(),this.date()+1)-1;break;case"hour":n=this._d.valueOf(),n+=lr-Sn(n+(this._isUTC?0:this.utcOffset()*sr),lr)-1;break;case"minute":n=this._d.valueOf(),n+=sr-Sn(n,sr)-1;break;case"second":n=this._d.valueOf(),n+=ar-Sn(n,ar)-1}return this._d.setTime(n),e.updateOffset(this,!0),this}function Pn(){return this._d.valueOf()-6e4*(this._offset||0)}function In(){return Math.floor(this.valueOf()/1e3)}function On(){return new Date(this.valueOf())}function Ln(){var t=this;return[t.year(),t.month(),t.date(),t.hour(),t.minute(),t.second(),t.millisecond()]}function Rn(){var t=this;return{years:t.year(),months:t.month(),date:t.date(),hours:t.hours(),minutes:t.minutes(),seconds:t.seconds(),milliseconds:t.milliseconds()}}function An(){return this.isValid()?this.toISOString():null}function Hn(){return p(this)}function Nn(){return c({},f(this))}function Fn(){return f(this).overflow}function Yn(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}function jn(t,e){z(0,[t,t.length],0,e)}function zn(t){return $n.call(this,t,this.week(),this.weekday(),this.localeData()._week.dow,this.localeData()._week.doy)}function Bn(t){return $n.call(this,t,this.isoWeek(),this.isoWeekday(),1,4)}function Wn(){return kt(this.year(),1,4)}function Vn(){var t=this.localeData()._week;return kt(this.year(),t.dow,t.doy)}function $n(t,e,n,i,o){var r;return null==t?Dt(this,i,o).year:(r=kt(t,i,o),e>r&&(e=r),Un.call(this,t,e,n,i,o))}function Un(t,e,n,i,o){var r=_t(t,e,n,i,o),a=wt(r.year,0,r.dayOfYear);return this.year(a.getUTCFullYear()),this.month(a.getUTCMonth()),this.date(a.getUTCDate()),this}function qn(t){return null==t?Math.ceil((this.month()+1)/3):this.month(3*(t-1)+this.month()%3)}function Gn(t){var e=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==t?e:this.add(t-e,"d")}function Jn(t,e){e[bo]=w(1e3*("0."+t))}function Zn(){return this._isUTC?"UTC":""}function Xn(){return this._isUTC?"Coordinated Universal Time":""}function Kn(t){return Ce(1e3*t)}function Qn(){return Ce.apply(null,arguments).parseZone()}function ti(t){return t}function ei(t,e,n,i){var o=ie(),r=d().set(i,e);return o[n](r,t)}function ni(t,e,n){if(a(t)&&(e=t,t=void 0),t=t||"",null!=e)return ei(t,e,n,"month");var i,o=[];for(i=0;i<12;i++)o[i]=ei(t,i,n,"month");return o}function ii(t,e,n,i){"boolean"==typeof t?(a(e)&&(n=e,e=void 0),e=e||""):(e=t,n=e,t=!1,a(e)&&(n=e,e=void 0),e=e||"");var o=ie(),r=t?o._week.dow:0;if(null!=n)return ei(e,(n+r)%7,i,"day");var s,l=[];for(s=0;s<7;s++)l[s]=ei(e,(s+r)%7,i,"day");return l}function oi(t,e){return ni(t,e,"months")}function ri(t,e){return ni(t,e,"monthsShort")}function ai(t,e,n){return ii(t,e,n,"weekdays")}function si(t,e,n){return ii(t,e,n,"weekdaysShort")}function li(t,e,n){return ii(t,e,n,"weekdaysMin")}function ui(){var t=this._data;return this._milliseconds=vr(this._milliseconds),this._days=vr(this._days),this._months=vr(this._months),t.milliseconds=vr(t.milliseconds),t.seconds=vr(t.seconds),t.minutes=vr(t.minutes),t.hours=vr(t.hours),t.months=vr(t.months),t.years=vr(t.years),this}function ci(t,e,n,i){var o=Xe(e,n);return t._milliseconds+=i*o._milliseconds,t._days+=i*o._days,t._months+=i*o._months,t._bubble()}function di(t,e){return ci(this,t,e,1)}function hi(t,e){return ci(this,t,e,-1)}function fi(t){return t<0?Math.floor(t):Math.ceil(t)}function pi(){var t,e,n,i,o,r=this._milliseconds,a=this._days,s=this._months,l=this._data;return r>=0&&a>=0&&s>=0||r<=0&&a<=0&&s<=0||(r+=864e5*fi(gi(s)+a),a=0,s=0),l.milliseconds=r%1e3,t=b(r/1e3),l.seconds=t%60,e=b(t/60),l.minutes=e%60,n=b(e/60),l.hours=n%24,a+=b(n/24),o=b(mi(a)),s+=o,a-=fi(gi(o)),i=b(s/12),s%=12,l.days=a,l.months=s,l.years=i,this}function mi(t){return 4800*t/146097}function gi(t){return 146097*t/4800}function vi(t){if(!this.isValid())return NaN;var e,n,i=this._milliseconds;if("month"===(t=H(t))||"quarter"===t||"year"===t)switch(e=this._days+i/864e5,n=this._months+mi(e),t){case"month":return n;case"quarter":return n/3;case"year":return n/12}else switch(e=this._days+Math.round(gi(this._months)),t){case"week":return e/7+i/6048e5;case"day":return e+i/864e5;case"hour":return 24*e+i/36e5;case"minute":return 1440*e+i/6e4;case"second":return 86400*e+i/1e3;case"millisecond":return Math.floor(864e5*e)+i;default:throw new Error("Unknown unit "+t)}}function yi(){return this.isValid()?this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*w(this._months/12):NaN}function bi(t){return function(){return this.as(t)}}function wi(){return Xe(this)}function xi(t){return t=H(t),this.isValid()?this[t+"s"]():NaN}function _i(t){return function(){return this.isValid()?this._data[t]:NaN}}function Di(){return b(this.days()/7)}function ki(t,e,n,i,o){return o.relativeTime(e||1,!!n,t,i)}function Si(t,e,n){var i=Xe(t).abs(),o=Rr(i.as("s")),r=Rr(i.as("m")),a=Rr(i.as("h")),s=Rr(i.as("d")),l=Rr(i.as("M")),u=Rr(i.as("y")),c=o<=Ar.ss&&["s",o]||o0,c[4]=n,ki.apply(null,c)}function Ci(t){return void 0===t?Rr:"function"==typeof t&&(Rr=t,!0)}function Mi(t,e){return void 0!==Ar[t]&&(void 0===e?Ar[t]:(Ar[t]=e,"s"===t&&(Ar.ss=e-1),!0))}function Ti(t){if(!this.isValid())return this.localeData().invalidDate();var e=this.localeData(),n=Si(this,!t,e);return t&&(n=e.pastFuture(+this,n)),e.postformat(n)}function Ei(t){return(t>0)-(t<0)||+t}function Pi(){if(!this.isValid())return this.localeData().invalidDate();var t,e,n,i=Hr(this._milliseconds)/1e3,o=Hr(this._days),r=Hr(this._months);t=b(i/60),e=b(t/60),i%=60,t%=60,n=b(r/12),r%=12;var a=n,s=r,l=o,u=e,c=t,d=i?i.toFixed(3).replace(/\.?0+$/,""):"",h=this.asSeconds();if(!h)return"P0D";var f=h<0?"-":"",p=Ei(this._months)!==Ei(h)?"-":"",m=Ei(this._days)!==Ei(h)?"-":"",g=Ei(this._milliseconds)!==Ei(h)?"-":"";return f+"P"+(a?p+a+"Y":"")+(s?p+s+"M":"")+(l?m+l+"D":"")+(u||c||d?"T":"")+(u?g+u+"H":"")+(c?g+c+"M":"")+(d?g+d+"S":"")}var Ii,Oi;Oi=Array.prototype.some?Array.prototype.some:function(t){for(var e=Object(this),n=e.length>>>0,i=0;i68?1900:2e3)};var _o,Do=nt("FullYear",!0);_o=Array.prototype.indexOf?Array.prototype.indexOf:function(t){var e;for(e=0;ethis?this:t:m()}),Ko=function(){return Date.now?Date.now():+new Date},Qo=["year","quarter","month","week","day","hour","minute","second","millisecond"];He("Z",":"),He("ZZ",""),U("Z",so),U("ZZ",so),Z(["Z","ZZ"],function(t,e,n){n._useUTC=!0,n._tzm=Ne(so,t)});var tr=/([\+\-]|\d\d)/gi;e.updateOffset=function(){};var er=/^(\-|\+)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)(\.\d*)?)?$/,nr=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;Xe.fn=Le.prototype,Xe.invalid=Oe;var ir=en(1,"add"),or=en(-1,"subtract");e.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",e.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";var rr=D("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(t){return void 0===t?this.localeData():this.locale(t)}),ar=1e3,sr=60*ar,lr=60*sr,ur=3506328*lr;z(0,["gg",2],0,function(){return this.weekYear()%100}),z(0,["GG",2],0,function(){return this.isoWeekYear()%100}),jn("gggg","weekYear"),jn("ggggg","weekYear"),jn("GGGG","isoWeekYear"),jn("GGGGG","isoWeekYear"),A("weekYear","gg"),A("isoWeekYear","GG"),F("weekYear",1),F("isoWeekYear",1),U("G",ro),U("g",ro),U("GG",Ki,Gi),U("gg",Ki,Gi),U("GGGG",no,Zi),U("gggg",no,Zi),U("GGGGG",io,Xi),U("ggggg",io,Xi),X(["gggg","ggggg","GGGG","GGGGG"],function(t,e,n,i){e[i.substr(0,2)]=w(t)}),X(["gg","GG"],function(t,n,i,o){n[o]=e.parseTwoDigitYear(t)}),z("Q",0,"Qo","quarter"),A("quarter","Q"),F("quarter",7),U("Q",qi),Z("Q",function(t,e){e[po]=3*(w(t)-1)}),z("D",["DD",2],"Do","date"),A("date","D"),F("date",9),U("D",Ki),U("DD",Ki,Gi),U("Do",function(t,e){return t?e._dayOfMonthOrdinalParse||e._ordinalParse:e._dayOfMonthOrdinalParseLenient}),Z(["D","DD"],mo),Z("Do",function(t,e){e[mo]=w(t.match(Ki)[0])});var cr=nt("Date",!0);z("DDD",["DDDD",3],"DDDo","dayOfYear"),A("dayOfYear","DDD"),F("dayOfYear",4),U("DDD",eo),U("DDDD",Ji),Z(["DDD","DDDD"],function(t,e,n){n._dayOfYear=w(t)}),z("m",["mm",2],0,"minute"),A("minute","m"),F("minute",14),U("m",Ki),U("mm",Ki,Gi),Z(["m","mm"],vo);var dr=nt("Minutes",!1);z("s",["ss",2],0,"second"),A("second","s"),F("second",15),U("s",Ki),U("ss",Ki,Gi),Z(["s","ss"],yo);var hr=nt("Seconds",!1);z("S",0,0,function(){return~~(this.millisecond()/100)}),z(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),z(0,["SSS",3],0,"millisecond"),z(0,["SSSS",4],0,function(){return 10*this.millisecond()}),z(0,["SSSSS",5],0,function(){return 100*this.millisecond()}),z(0,["SSSSSS",6],0,function(){return 1e3*this.millisecond()}),z(0,["SSSSSSS",7],0,function(){return 1e4*this.millisecond()}),z(0,["SSSSSSSS",8],0,function(){return 1e5*this.millisecond()}),z(0,["SSSSSSSSS",9],0,function(){return 1e6*this.millisecond()}),A("millisecond","ms"),F("millisecond",16),U("S",eo,qi),U("SS",eo,Gi),U("SSS",eo,Ji);var fr;for(fr="SSSS";fr.length<=9;fr+="S")U(fr,oo);for(fr="S";fr.length<=9;fr+="S")Z(fr,Jn);var pr=nt("Milliseconds",!1);z("z",0,0,"zoneAbbr"),z("zz",0,0,"zoneName");var mr=v.prototype;mr.add=ir,mr.calendar=rn,mr.clone=an,mr.diff=fn,mr.endOf=En,mr.format=yn,mr.from=bn,mr.fromNow=wn,mr.to=xn,mr.toNow=_n,mr.get=rt,mr.invalidAt=Fn,mr.isAfter=sn,mr.isBefore=ln,mr.isBetween=un,mr.isSame=cn,mr.isSameOrAfter=dn,mr.isSameOrBefore=hn,mr.isValid=Hn,mr.lang=rr,mr.locale=Dn,mr.localeData=kn,mr.max=Xo,mr.min=Zo,mr.parsingFlags=Nn,mr.set=at,mr.startOf=Tn,mr.subtract=or,mr.toArray=Ln,mr.toObject=Rn,mr.toDate=On,mr.toISOString=gn,mr.inspect=vn,mr.toJSON=An,mr.toString=mn,mr.unix=In,mr.valueOf=Pn,mr.creationData=Yn,mr.year=Do,mr.isLeapYear=et,mr.weekYear=zn,mr.isoWeekYear=Bn,mr.quarter=mr.quarters=qn,mr.month=pt,mr.daysInMonth=mt,mr.week=mr.weeks=Tt,mr.isoWeek=mr.isoWeeks=Et,mr.weeksInYear=Vn,mr.isoWeeksInYear=Wn,mr.date=cr,mr.day=mr.days=Ft,mr.weekday=Yt,mr.isoWeekday=jt,mr.dayOfYear=Gn,mr.hour=mr.hours=Fo,mr.minute=mr.minutes=dr,mr.second=mr.seconds=hr,mr.millisecond=mr.milliseconds=pr,mr.utcOffset=je,mr.utc=Be,mr.local=We,mr.parseZone=Ve,mr.hasAlignedHourOffset=$e,mr.isDST=Ue,mr.isLocal=Ge,mr.isUtcOffset=Je,mr.isUtc=Ze,mr.isUTC=Ze,mr.zoneAbbr=Zn,mr.zoneName=Xn,mr.dates=D("dates accessor is deprecated. Use date instead.",cr),mr.months=D("months accessor is deprecated. Use month instead",pt),mr.years=D("years accessor is deprecated. Use year instead",Do),mr.zone=D("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",ze),mr.isDSTShifted=D("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",qe);var gr=T.prototype;gr.calendar=E,gr.longDateFormat=P,gr.invalidDate=I,gr.ordinal=O,gr.preparse=ti,gr.postformat=ti,gr.relativeTime=L,gr.pastFuture=R,gr.set=C,gr.months=ut,gr.monthsShort=ct,gr.monthsParse=ht,gr.monthsRegex=vt,gr.monthsShortRegex=gt,gr.week=St,gr.firstDayOfYear=Mt,gr.firstDayOfWeek=Ct,gr.weekdays=Lt,gr.weekdaysMin=At,gr.weekdaysShort=Rt,gr.weekdaysParse=Nt,gr.weekdaysRegex=zt,gr.weekdaysShortRegex=Bt,gr.weekdaysMinRegex=Wt,gr.isPM=Jt,gr.meridiem=Zt,te("en",{dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(t){var e=t%10;return t+(1===w(t%100/10)?"th":1===e?"st":2===e?"nd":3===e?"rd":"th")}}),e.lang=D("moment.lang is deprecated. Use moment.locale instead.",te),e.langData=D("moment.langData is deprecated. Use moment.localeData instead.",ie);var vr=Math.abs,yr=bi("ms"),br=bi("s"),wr=bi("m"),xr=bi("h"),_r=bi("d"),Dr=bi("w"),kr=bi("M"),Sr=bi("Q"),Cr=bi("y"),Mr=_i("milliseconds"),Tr=_i("seconds"),Er=_i("minutes"),Pr=_i("hours"),Ir=_i("days"),Or=_i("months"),Lr=_i("years"),Rr=Math.round,Ar={ss:44,s:45,m:45,h:22,d:26,M:11},Hr=Math.abs,Nr=Le.prototype;return Nr.isValid=Ie,Nr.abs=ui,Nr.add=di,Nr.subtract=hi,Nr.as=vi,Nr.asMilliseconds=yr,Nr.asSeconds=br,Nr.asMinutes=wr,Nr.asHours=xr,Nr.asDays=_r,Nr.asWeeks=Dr,Nr.asMonths=kr,Nr.asQuarters=Sr,Nr.asYears=Cr,Nr.valueOf=yi,Nr._bubble=pi,Nr.clone=wi,Nr.get=xi,Nr.milliseconds=Mr,Nr.seconds=Tr,Nr.minutes=Er,Nr.hours=Pr,Nr.days=Ir,Nr.weeks=Di,Nr.months=Or,Nr.years=Lr,Nr.humanize=Ti,Nr.toISOString=Pi,Nr.toString=Pi,Nr.toJSON=Pi,Nr.locale=Dn,Nr.localeData=kn,Nr.toIsoString=D("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Pi),Nr.lang=rr,z("X",0,0,"unix"),z("x",0,0,"valueOf"),U("x",ro),U("X",lo),Z("X",function(t,e,n){n._d=new Date(1e3*parseFloat(t,10))}),Z("x",function(t,e,n){n._d=new Date(w(t))}),e.version="2.24.0",function(t){Ii=t}(Ce),e.fn=mr,e.min=Te,e.max=Ee,e.now=Ko,e.utc=d,e.unix=Kn,e.months=oi,e.isDate=s,e.locale=te,e.invalid=m,e.duration=Xe,e.isMoment=y,e.weekdays=ai,e.parseZone=Qn,e.localeData=ie,e.isDuration=Re,e.monthsShort=ri,e.weekdaysMin=li,e.defineLocale=ee,e.updateLocale=ne,e.locales=oe,e.weekdaysShort=si,e.normalizeUnits=H,e.relativeTimeRounding=Ci,e.relativeTimeThreshold=Mi,e.calendarFormat=on,e.prototype=mr,e.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"},e})}).call(e,n("3IRH")(t))},"PL/P":function(t,e,n){var i,o;/**
* @version: 3.0.5
* @author: Dan Grossman http://www.dangrossman.info/
* @copyright: Copyright (c) 2012-2019 Dan Grossman. All rights reserved.
diff --git a/public/build/manifest.json b/public/build/manifest.json
index 3088a47b..6d5a7b4f 100644
--- a/public/build/manifest.json
+++ b/public/build/manifest.json
@@ -1,5 +1,5 @@
{
- "build/app.js": "./app.js?376d50667e3784222761",
+ "build/app.js": "./app.js?7f61ab551431df41b451",
"build/app.css": "./app.css?954c34ace3717cfb9d9c80d2be5f8c68",
"build/fonts/fa-solid-900.woff2": "./fonts/fa-solid-900.woff2?e8a92a29",
"build/images/fa-solid-900.svg": "./images/fa-solid-900.svg?666a82cb",
diff --git a/src/Controller/AboutController.php b/src/Controller/AboutController.php
index ed4ffa8e..5146d8a8 100644
--- a/src/Controller/AboutController.php
+++ b/src/Controller/AboutController.php
@@ -11,10 +11,6 @@ namespace App\Controller;
use App\Constants;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security;
-use Symfony\Bundle\FrameworkBundle\Console\Application;
-use Symfony\Component\Console\Input\ArrayInput;
-use Symfony\Component\Console\Output\BufferedOutput;
-use Symfony\Component\HttpKernel\KernelInterface;
use Symfony\Component\Routing\Annotation\Route;
/**
@@ -43,11 +39,6 @@ class AboutController extends AbstractController
* @return \Symfony\Component\HttpFoundation\Response
*/
public function debugAction()
- {
- return $this->getAboutView();
- }
-
- protected function getAboutView(array $additional = [])
{
$phpInfo = $this->getPhpInfo();
unset($phpInfo[0]);
@@ -89,8 +80,7 @@ class AboutController extends AbstractController
],
'info' => $phpInfo,
'settings' => $settings,
- ],
- $additional
+ ]
));
}
@@ -119,28 +109,6 @@ class AboutController extends AbstractController
]);
}
- /**
- * @Route(path="/flush-cache", name="system_flush_cache", methods={"GET"})
- *
- * @Security("is_granted('system_actions')")
- */
- public function rebuildContainer(KernelInterface $kernel)
- {
- $application = new Application($kernel);
- $application->setAutoExit(false);
-
- $input = new ArrayInput([
- 'command' => 'cache:clear',
- '--env' => $kernel->getEnvironment(),
- '-n',
- ]);
-
- $output = new BufferedOutput();
- $application->run($input, $output);
-
- return $this->getAboutView(['content_action' => $output->fetch()]);
- }
-
/**
* @author https://php.net/manual/en/function.phpinfo.php#117961
* @return array
diff --git a/src/Controller/UserController.php b/src/Controller/UserController.php
index 58f249fe..ec8a243f 100644
--- a/src/Controller/UserController.php
+++ b/src/Controller/UserController.php
@@ -14,6 +14,7 @@ use App\Entity\User;
use App\Form\Toolbar\UserToolbarForm;
use App\Form\UserCreateType;
use App\Repository\Query\UserQuery;
+use App\Security\RolePermissionManager;
use Pagerfanta\Pagerfanta;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security;
use Symfony\Component\HttpFoundation\Request;
@@ -173,6 +174,22 @@ class UserController extends AbstractController
);
}
+ /**
+ * @Route(path="/permissions", name="admin_user_permissions", methods={"GET", "POST"})
+ * @Security("is_granted('role_permissions')")
+ *
+ * @param RolePermissionManager $manager
+ * @return \Symfony\Component\HttpFoundation\Response
+ */
+ public function permissions(RolePermissionManager $manager)
+ {
+ return $this->render('user/permissions.html.twig', [
+ 'roles' => $manager->getRoles(),
+ 'permissions' => $manager->getPermissions(),
+ 'manager' => $manager,
+ ]);
+ }
+
/**
* @param UserQuery $query
* @return \Symfony\Component\Form\FormInterface
diff --git a/src/DependencyInjection/AppExtension.php b/src/DependencyInjection/AppExtension.php
index 2dd35149..34280e27 100644
--- a/src/DependencyInjection/AppExtension.php
+++ b/src/DependencyInjection/AppExtension.php
@@ -71,14 +71,8 @@ class AppExtension extends Extension
*/
protected function createPermissionParameter(array $config, ContainerBuilder $container)
{
+ $roles = [];
foreach ($config['maps'] as $role => $sets) {
- if (!isset($config['roles'][$role])) {
- $exception = new InvalidConfigurationException(
- 'Configured permission set includes unknown role "' . $role . '"'
- );
- $exception->setPath('kimai.permissions.maps.' . $role);
- throw $exception;
- }
foreach ($sets as $set) {
if (!isset($config['sets'][$set])) {
$exception = new InvalidConfigurationException(
@@ -87,12 +81,59 @@ class AppExtension extends Extension
$exception->setPath('kimai.permissions.maps.' . $role);
throw $exception;
}
- $config['roles'][$role] = array_unique(array_merge($config['roles'][$role], $config['sets'][$set]));
+ $roles[$role] = array_merge($roles[$role] ?? [], $this->getFilteredPermissions(
+ $this->extractSinglePermissionsFromSet($config, $set)
+ ));
}
}
+
+ // delete forbidden permissions from roles
+ foreach (array_keys($config['maps']) as $name) {
+ $config['roles'][$name] = $this->getFilteredPermissions(
+ array_unique(array_merge($roles[$name], $config['roles'][$name] ?? []))
+ );
+ }
+
$container->setParameter('kimai.permissions', $config['roles']);
}
+ protected function getFilteredPermissions(array $permissions): array
+ {
+ $deleteFromArray = array_filter($permissions, function ($permission) {
+ return $permission[0] == '!';
+ });
+
+ return array_filter($permissions, function ($permission) use ($deleteFromArray) {
+ if ($permission[0] == '!') {
+ return false;
+ }
+
+ return !in_array('!' . $permission, $deleteFromArray);
+ });
+ }
+
+ protected function extractSinglePermissionsFromSet(array $permissions, string $name): array
+ {
+ if (!isset($permissions['sets'][$name])) {
+ throw new InvalidConfigurationException('Unknown permission set "' . $name . '"');
+ }
+
+ $result = [];
+
+ foreach ($permissions['sets'][$name] as $permissionName) {
+ if ($permissionName[0] == '@') {
+ $result = array_merge(
+ $result,
+ $this->extractSinglePermissionsFromSet($permissions, substr($permissionName, 1))
+ );
+ } else {
+ $result[] = $permissionName;
+ }
+ }
+
+ return $result;
+ }
+
/**
* @param array $config
* @param ContainerBuilder $container
diff --git a/src/DependencyInjection/Configuration.php b/src/DependencyInjection/Configuration.php
index cb5816a1..f53af8e6 100644
--- a/src/DependencyInjection/Configuration.php
+++ b/src/DependencyInjection/Configuration.php
@@ -434,7 +434,6 @@ class Configuration implements ConfigurationInterface
->arrayNode('sets')
->requiresAtLeastOneElement()
->useAttributeAsKey('key')
- ->performNoDeepMerging()
->arrayPrototype()
->useAttributeAsKey('key')
->isRequired()
@@ -445,7 +444,6 @@ class Configuration implements ConfigurationInterface
->arrayNode('maps')
->requiresAtLeastOneElement()
->useAttributeAsKey('key')
- ->performNoDeepMerging()
->arrayPrototype()
->useAttributeAsKey('key')
->isRequired()
@@ -456,13 +454,18 @@ class Configuration implements ConfigurationInterface
->arrayNode('roles')
->requiresAtLeastOneElement()
->useAttributeAsKey('key')
- ->performNoDeepMerging()
->arrayPrototype()
->useAttributeAsKey('key')
->isRequired()
->prototype('scalar')->end()
->defaultValue([])
->end()
+ ->defaultValue([
+ 'ROLE_USER' => [],
+ 'ROLE_TEAMLEAD' => [],
+ 'ROLE_ADMIN' => [],
+ 'ROLE_SUPER_ADMIN' => [],
+ ])
->end()
->end()
;
diff --git a/src/Form/UserCreateType.php b/src/Form/UserCreateType.php
index bc12bc9d..d8440be0 100644
--- a/src/Form/UserCreateType.php
+++ b/src/Form/UserCreateType.php
@@ -9,6 +9,7 @@
namespace App\Form;
+use App\Entity\User;
use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
use Symfony\Component\Form\Extension\Core\Type\PasswordType;
use Symfony\Component\Form\Extension\Core\Type\RepeatedType;
@@ -55,7 +56,7 @@ class UserCreateType extends UserEditType
public function __configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults([
- 'class' => 'Kimai:User',
+ 'class' => User::class,
]);
}
}
diff --git a/src/Security/RolePermissionManager.php b/src/Security/RolePermissionManager.php
index 38c2fb2a..96875d59 100644
--- a/src/Security/RolePermissionManager.php
+++ b/src/Security/RolePermissionManager.php
@@ -16,13 +16,10 @@ class RolePermissionManager
*/
protected $permissions = [];
/**
- * @var array
+ * @var string[]
*/
protected $knownPermissions = [];
- /**
- * @param array $permissions
- */
public function __construct(array $permissions)
{
$this->permissions = $permissions;
@@ -33,30 +30,12 @@ class RolePermissionManager
$this->knownPermissions = array_unique($this->knownPermissions);
}
- /**
- * @param string $permission
- * @return bool
- */
- public function isRegisteredPermission($permission)
+ public function isRegisteredPermission(string $permission): bool
{
return in_array($permission, $this->knownPermissions);
}
- /**
- * @param string $role
- * @return bool
- */
- public function roleHasPermission($role)
- {
- return isset($this->permissions[$role]);
- }
-
- /**
- * @param string $role
- * @param string $permission
- * @return bool
- */
- public function hasPermission($role, $permission)
+ public function hasPermission(string $role, string $permission): bool
{
if (!isset($this->permissions[$role])) {
return false;
@@ -64,4 +43,19 @@ class RolePermissionManager
return in_array($permission, $this->permissions[$role]);
}
+
+ public function getRoles(): array
+ {
+ return array_keys($this->permissions);
+ }
+
+ public function roleHasPermission(string $role): bool
+ {
+ return isset($this->permissions[$role]);
+ }
+
+ public function getPermissions(): array
+ {
+ return $this->knownPermissions;
+ }
}
diff --git a/src/Twig/Extensions.php b/src/Twig/Extensions.php
index 356ce832..91cb807c 100644
--- a/src/Twig/Extensions.php
+++ b/src/Twig/Extensions.php
@@ -94,6 +94,8 @@ class Extensions extends AbstractExtension
'profile-stats' => 'far fa-chart-bar',
'profile' => 'fas fa-user-edit',
'warning' => 'fas fa-exclamation-triangle',
+ 'permissions' => 'fas fa-user-lock',
+ 'back' => 'fas fa-long-arrow-alt-left',
];
/**
diff --git a/templates/about/system.html.twig b/templates/about/system.html.twig
index 144f27d7..e900135f 100644
--- a/templates/about/system.html.twig
+++ b/templates/about/system.html.twig
@@ -4,22 +4,6 @@
{% block page_subtitle %}{{ 'about.subtitle'|trans({}, 'about') }}{% endblock %}
{% block about_box %}
- {% if is_granted('system_actions') %}
- {% embed '@AdminLTE/Widgets/box-widget.html.twig' with {'boxtype': 'warning'} %}
- {% block box_title %}{{ 'label.actions'|trans }}{% endblock %}
- {% block box_body %}
- {% if content_action is defined and content_action is not empty %}
-
- {{ content_action }}
-
- {% endif %}
-
-
- Clear cache
-
- {% endblock %}
- {% endembed %}
- {% endif %}
{% endblock %}
{% block about %}
diff --git a/templates/export/index.html.twig b/templates/export/index.html.twig
index 162caa95..cca23c8e 100644
--- a/templates/export/index.html.twig
+++ b/templates/export/index.html.twig
@@ -131,6 +131,9 @@
}
ALERT.question(message, function(value) {
+ if (!value) {
+ return;
+ }
var btn = $(button);
var exportButtons = $('.exportBtn');
// disabling does not yet work...
diff --git a/templates/invoice/index.html.twig b/templates/invoice/index.html.twig
index bbe153fe..ae383ad4 100644
--- a/templates/invoice/index.html.twig
+++ b/templates/invoice/index.html.twig
@@ -2,6 +2,7 @@
{% import "macros/widgets.html.twig" as widgets %}
{% import "macros/toolbar.html.twig" as toolbar %}
{% import "macros/datatables.html.twig" as tables %}
+{% import "macros/actions.html.twig" as actions %}
{% set columns = {
'date': 'alwaysVisible',
@@ -16,16 +17,7 @@
{% block page_title %}{{ 'invoice.title'|trans }}{% endblock %}
{% block page_subtitle %}{{ 'invoice.subtitle'|trans }}{% endblock %}
-{% block page_actions %}
- {% set actions = {'filter': '#collapseInvoice', 'visibility': '#modal_invoice'} %}
- {% if is_granted('create_invoice_template') %}
- {% set actions = actions|merge({'create': path('admin_invoice_template_create')}) %}
- {% endif %}
- {% if is_granted('view_invoice_template') %}
- {% set actions = actions|merge({'list': path('admin_invoice_template')}) %}
- {% endif %}
- {{ widgets.page_actions(actions) }}
-{% endblock %}
+{% block page_actions %}{{ actions.invoices('index') }}{% endblock %}
{% block main_before %}
{{ toolbar.toolbar(form, 'collapseInvoice', true) }}
diff --git a/templates/invoice/templates.html.twig b/templates/invoice/templates.html.twig
index 2efaf5b0..5a5db648 100644
--- a/templates/invoice/templates.html.twig
+++ b/templates/invoice/templates.html.twig
@@ -1,21 +1,11 @@
{% extends 'base.html.twig' %}
{% import "macros/widgets.html.twig" as widgets %}
{% import "macros/datatables.html.twig" as tables %}
+{% import "macros/actions.html.twig" as actions %}
{% block page_title %}{{ 'admin_invoice_template.title'|trans }}{% endblock %}
{% block page_subtitle %}{{ 'admin_invoice_template.subtitle'|trans }}{% endblock %}
-{% block page_actions %}
- {# TODO move me to actions macro #}
- {% set actions = {} %}
- {% if is_granted('create_invoice_template') %}
- {% set actions = actions|merge({'create': path('admin_invoice_template_create')}) %}
- {% endif %}
- {% if is_granted('view_invoice') %}
- {% set actions = actions|merge({'invoice': path('invoice')}) %}
- {% endif %}
- {% set event = trigger('actions.invoice_templates', {'actions': actions, 'view': 'index'}) %}
- {{ widgets.page_actions(actions) }}
-{% endblock %}
+{% block page_actions %}{{ actions.invoice_templates('index') }}{% endblock %}
{% block main %}
{% if entries.count == 0 %}
diff --git a/templates/macros/actions.html.twig b/templates/macros/actions.html.twig
index d35c050c..9a456dc7 100644
--- a/templates/macros/actions.html.twig
+++ b/templates/macros/actions.html.twig
@@ -48,16 +48,43 @@
{% macro users(view) %}
{% import "macros/widgets.html.twig" as widgets %}
- {% set actions = {'filter': '#collapseUserAdmin', 'visibility': '#modal_user_admin'} %}
+ {% set actions = {} %}
+
+ {% if view == 'index' %}
+ {% set actions = actions|merge({'filter': '#collapseUserAdmin', 'visibility': '#modal_user_admin'}) %}
+ {% else %}
+ {% set actions = actions|merge({'back': path('admin_user')}) %}
+ {% endif %}
+
+ {% if view != 'permissions' and is_granted('role_permissions') %}
+ {% set actions = actions|merge({'permissions': path('admin_user_permissions')}) %}
+ {% endif %}
{% if is_granted('create_user') %}
{% set actions = actions|merge({'create': path('admin_user_create')}) %}
{% endif %}
+ {% if view == 'index' %}
+ {% set actions = actions|merge({'help': {'url': 'users.html'|docu_link, 'target': '_blank'}}) %}
+ {% elseif view == 'permissions' %}
+ {% set actions = actions|merge({'help': {'url': 'permissions.html'|docu_link, 'target': '_blank'}}) %}
+ {% endif %}
+
{% set event = trigger('actions.users', {'actions': actions, 'view': view}) %}
{{ widgets.page_actions(event.payload.actions) }}
{% endmacro %}
+{% macro user_permissions(view) %}
+ {% import "macros/widgets.html.twig" as widgets %}
+ {% set actions = {} %}
+
+ {% set actions = actions|merge({'back': path('admin_user')}) %}
+ {% set actions = actions|merge({'help': {'url': 'permissions.html'|docu_link, 'target': '_blank'}}) %}
+
+ {% set event = trigger('actions.user_permissions', {'actions': actions, 'view': view}) %}
+ {{ widgets.page_actions(event.payload.actions) }}
+{% endmacro %}
+
{% macro user(user, view) %}
{% import "macros/widgets.html.twig" as widgets %}
{% set actions = {} %}
@@ -371,3 +398,39 @@
{% set event = trigger('actions.tag', {'actions': actions, 'view': view, 'tag': tag}) %}
{{ widgets.table_actions(event.payload.actions) }}
{% endmacro %}
+
+{% macro invoices(view) %}
+ {% import "macros/widgets.html.twig" as widgets %}
+
+ {% set actions = {'filter': '#collapseInvoice', 'visibility': '#modal_invoice'} %}
+ {% if is_granted('create_invoice_template') %}
+ {% set actions = actions|merge({'create': path('admin_invoice_template_create')}) %}
+ {% endif %}
+ {% if is_granted('view_invoice_template') %}
+ {% set actions = actions|merge({'list': path('admin_invoice_template')}) %}
+ {% endif %}
+
+ {% set actions = actions|merge({'help': {'url': 'invoices.html'|docu_link, 'target': '_blank'}}) %}
+
+ {% set event = trigger('actions.invoices', {'actions': actions, 'view': view}) %}
+ {{ widgets.page_actions(event.payload.actions) }}
+{% endmacro %}
+
+{% macro invoice_templates(view) %}
+ {% import "macros/widgets.html.twig" as widgets %}
+
+ {% set actions = {} %}
+ {% if is_granted('view_invoice') %}
+ {% set actions = actions|merge({'back': path('invoice')}) %}
+ {% endif %}
+
+ {% if is_granted('create_invoice_template') %}
+ {% set actions = actions|merge({'create': path('admin_invoice_template_create')}) %}
+ {% endif %}
+
+ {% set actions = actions|merge({'help': {'url': 'invoices.html'|docu_link, 'target': '_blank'}}) %}
+
+ {% set event = trigger('actions.invoice_templates', {'actions': actions, 'view': 'index'}) %}
+ {{ widgets.page_actions(actions) }}
+{% endmacro %}
+
diff --git a/templates/macros/datatables.html.twig b/templates/macros/datatables.html.twig
index c36fb39b..2e2afd54 100644
--- a/templates/macros/datatables.html.twig
+++ b/templates/macros/datatables.html.twig
@@ -70,22 +70,36 @@
{% endspaceless %}
{% endmacro %}
+{% macro data_table_header_options(name, columns, options) %}
+ {% set skipStripped = options.skipStripped|default(false) %}
+ {% set reloadEvent = options.reloadEvent|default('') %}
+ {% set translationDomain = options.translationDomain|default('messages') %}
+ {# |default does not work here, as the prefix might be an empty string #}
+ {% set translationPrefix = 'label.' %}
+ {% if options.translationPrefix is defined %}
+ {% set translationPrefix = options.translationPrefix %}
+ {% endif %}
+
+ {% import _self as macro %}
+