!function () {
"use strict";
angular.module("angularjs-datetime-picker", []);
var e = function (e) {
"string" == typeof e && (e = new Date(e));
var t = new Date(e.getFullYear(), 0, 1), a = new Date(e.getFullYear(), 6, 1), n = Math.max(t.getTimezoneOffset(), a.getTimezoneOffset()), l = e.getTimezoneOffset() < n, r = l ? n - 60 : n, i = r >= 0 ? "-" : "+";
return i + ("0" + r / 60).slice(-2) + ":" + ("0" + r % 60).slice(-2)
}, t = function (e, t, a) {
var n = a("DatetimePickerCtrl");
return {
open: function (e) {
n.openDatetimePicker(e)
}, close: function () {
n.closeDatetimePicker()
}
}
};
t.$inject = ["$compile", "$document", "$controller"], angular.module("angularjs-datetime-picker").factory("DatetimePicker", t);
var a = function (e, t) {
var a, n = this, l = function (e) {
e && e.remove(), t[0].body.removeEventListener("click", n.closeDatetimePicker)
};
this.openDatetimePicker = function (n) {
this.closeDatetimePicker();
var l = angular.element("
");
n.dateFormat && l.attr("date-format", n.dateFormat), n.ngModel && l.attr("ng-model", n.ngModel), n.year && l.attr("year", parseInt(n.year)), n.month && l.attr("month", parseInt(n.month)), n.day && l.attr("day", parseInt(n.day)), n.hour && l.attr("hour", parseInt(n.hour)), n.minute && l.attr("minute", parseInt(n.minute)), ("" === n.dateOnly || n.dateOnly === !0) && l.attr("date-only", "true"), "false" === n.closeOnSelect && l.attr("close-on-select", "false");
var r = n.triggerEl;
n.scope = n.scope || angular.element(r).scope(), a = e(l)(n.scope)[0], a.triggerEl = n.triggerEl, t[0].body.appendChild(a);
var i = r.getBoundingClientRect();
a.style.position = "absolute", a.style.left = i.left + window.scrollX + "px", n.scope.$apply();
var o = a.getBoundingClientRect();
i.top < 300 || window.innerHeight - i.bottom > 300 ? a.style.top = i.bottom + window.scrollY + "px" : a.style.top = i.top - o.height + window.scrollY + "px", t[0].body.addEventListener("click", this.closeDatetimePicker)
}, this.closeDatetimePicker = function (e) {
var a = e && e.target, n = t[0].querySelector("div[datetime-picker-popup]");
e && a ? a.hasAttribute("datetime-picker") || n && n.contains(a) || l(n) : l(n)
}
};
a.$inject = ["$compile", "$document"], angular.module("angularjs-datetime-picker").controller("DatetimePickerCtrl", a);
var n = ['