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SAC/B,GACF,EACA,EAAO,OAAS,SAAS,GACvB,IAAI,EACJ,IAAK,EAAI,SAAU,CACjB,GACO,aADC,EAAO,QAAQ,KAEf,EAAI,UACN,EAAK,EAAe,EAAO,MAAO,EAAI,KAAM,OAC5C,EAAO,MAAM,OAAO,EAAI,IAExB,EAAO,MAAM,KAAK,OAAO,EAAI,YAI/B,EAAO,MAAQ,EAAI,KAKvB,OAHI,EAAO,QAAQ,UACjB,EAAO,QAAQ,SAAS,EAAI,MAEvB,GACT,CACF,EACA,EAAO,iBAAiB,WAAW,SAAS,EAAY,GAEtD,OADA,IACO,GACT,IACA,IACA,IACQ,EAAO,QAAQ,MACrB,IAAK,WACH,EAAO,iBAAiB,SAAS,SAAS,EAAS,GACjD,OAAO,GACT,IACA,MACF,IAAK,SACH,EAAO,OAAO,SAAS,SAAS,EAAQ,GAItC,GAHK,OAAO,SAAS,KACnB,EAAS,OAAO,KAEb,GAAU,IAAW,EAAO,OAAO,EAAQ,OAK9C,OAJA,EAAO,MAAQ,EACX,IACF,EAAO,QAAQ,MAAQ,OAAO,IAEzB,GAEX,IAYJ,OAVA,EAAO,OAAO,UAAU,SAAS,EAAQ,GACvC,GAAI,IACG,OAAO,SAAS,KACnB,EAAS,OAAO,KAEb,EAAO,OAAO,EAAQ,QACzB,OAAO,GAGb,IACO,EAAO,OAAO,SAAS,SAAS,EAAQ,GAC7C,GAAI,IACG,OAAO,SAAS,KACnB,EAAS,OAAO,KAEb,EAAO,OAAO,EAAQ,QACzB,OAAO,GAGb,GACF,EAEJ,GAGH,GAAE,KAAK","file":"/npm/angular-mighty-datepicker@0.1.4/build/angular-mighty-datepicker.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/angular-mighty-datepicker@0.1.4/build/angular-mighty-datepicker.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","(function() {\n  angular.module(\"mightyDatepicker\", [\"pasvaz.bindonce\"]);\n\n  angular.module(\"mightyDatepicker\").directive(\"mightyDatepicker\", [\n    \"$compile\", function($compile) {\n      var options, pickerTemplate;\n      pickerTemplate = \"<div class=\\\"mighty-picker__wrapper\\\">\\n  <button type=\\\"button\\\" class=\\\"mighty-picker__prev-month\\\"\\n    ng-click=\\\"moveMonth(-1)\\\">\\n    <<\\n  </button>\\n  <div class=\\\"mighty-picker__month\\\"\\n    bindonce ng-repeat=\\\"month in months track by $index\\\">\\n    <div class=\\\"mighty-picker__month-name\\\" ng-bind=\\\"month.name\\\"></div>\\n    <table class=\\\"mighty-picker-calendar\\\">\\n      <tr class=\\\"mighty-picker-calendar__days\\\">\\n        <th bindonce ng-repeat=\\\"day in month.weeks[1]\\\"\\n          class=\\\"mighty-picker-calendar__weekday\\\"\\n          bo-text=\\\"day.date.format('dd')\\\">\\n        </th>\\n      </tr>\\n      <tr bindonce ng-repeat=\\\"week in month.weeks\\\">\\n        <td\\n            bo-class='{\\n              \\\"mighty-picker-calendar__day\\\": day,\\n              \\\"mighty-picker-calendar__day--selected\\\": day.selected,\\n              \\\"mighty-picker-calendar__day--disabled\\\": day.disabled,\\n              \\\"mighty-picker-calendar__day--in-range\\\": day.inRange,\\n              \\\"mighty-picker-calendar__day--marked\\\": day.marker\\n            }'\\n            ng-repeat=\\\"day in week track by $index\\\" ng-click=\\\"select(day)\\\">\\n            <div class=\\\"mighty-picker-calendar__day-wrapper\\\"\\n              bo-text=\\\"day.date.date()\\\"></div>\\n            <div class=\\\"mighty-picker-calendar__day-marker-wrapper\\\">\\n              <div class=\\\"mighty-picker-calendar__day-marker\\\"\\n                ng-if=\\\"day.marker\\\"\\n                ng-bind-template=\\\"\\\">\\n              </div>\\n            </div>\\n        </td>\\n      </tr>\\n    </table>\\n  </div>\\n  <button type=\\\"button\\\" class=\\\"mighty-picker__next-month\\\"\\n    ng-click=\\\"moveMonth(1)\\\">\\n    >>\\n  </button>\\n</div>\";\n      options = {\n        mode: \"simple\",\n        months: 1,\n        start: null,\n        filter: void 0,\n        callback: void 0,\n        markerTemplate: \"{{ day.marker }}\",\n        template: pickerTemplate\n      };\n      return {\n        restrict: \"AE\",\n        replace: true,\n        template: '<div class=\"mighty-picker__holder\"></div>',\n        scope: {\n          model: '=ngModel',\n          options: '=',\n          markers: '=',\n          after: '=',\n          before: '=',\n          rangeFrom: '=',\n          rangeTo: '='\n        },\n        link: function($scope, $element, $attrs) {\n          var _bake, _build, _buildMonth, _buildWeek, _getMarker, _indexMarkers, _indexOfMoment, _isInRange, _isSelected, _prepare, _setup, _withinLimits;\n          _bake = function() {\n            var domEl;\n            domEl = $compile(angular.element($scope.options.template))($scope);\n            return $element.append(domEl);\n          };\n          _indexOfMoment = function(array, element, match) {\n            var key, value;\n            for (key in array) {\n              value = array[key];\n              if (element.isSame(value, match)) {\n                return key;\n              }\n            }\n            return -1;\n          };\n          _indexMarkers = function() {\n            var marker;\n            if ($scope.markers) {\n              return $scope.markerIndex = (function() {\n                var _i, _len, _ref, _results;\n                _ref = $scope.markers;\n                _results = [];\n                for (_i = 0, _len = _ref.length; _i < _len; _i++) {\n                  marker = _ref[_i];\n                  _results.push(marker.day);\n                }\n                return _results;\n              })();\n            }\n          };\n          _withinLimits = function(day, month) {\n            var withinLimits;\n            withinLimits = true;\n            if ($scope.before) {\n              withinLimits && (withinLimits = day.isSameOrBefore($scope.before, 'day'));\n            }\n            if ($scope.after) {\n              withinLimits && (withinLimits = day.isSameOrAfter($scope.after, 'day'));\n            }\n            return withinLimits;\n          };\n          _getMarker = function(day) {\n            var ix;\n            ix = _indexOfMoment($scope.markerIndex, day, 'day');\n            if (ix > -1) {\n              return $scope.markers[ix].marker;\n            } else {\n              return void 0;\n            }\n          };\n          _isSelected = function(day) {\n            switch ($scope.options.mode) {\n              case \"multiple\":\n                return _indexOfMoment($scope.model, day, 'day') > -1;\n              default:\n                return $scope.model && day.isSame($scope.model, 'day');\n            }\n          };\n          _isInRange = function(day) {\n            if ($scope.options.rangeMode) {\n              if ($scope.options.rangeMode === \"from\") {\n                return moment.range($scope.model, $scope.before).contains(day) || day.isSame($scope.before, 'day');\n              } else {\n                return moment.range($scope.after, $scope.model).contains(day) || day.isSame($scope.after, 'day');\n              }\n            } else {\n              return false;\n            }\n          };\n          _buildWeek = function(time, month) {\n            var days, filter, start;\n            days = [];\n            filter = true;\n            start = time.startOf('week');\n            days = [0, 1, 2, 3, 4, 5, 6].map(function(d) {\n              var day, withinLimits, withinMonth;\n              day = moment(start).add(d, 'days');\n              withinMonth = day.month() === month;\n              withinLimits = _withinLimits(day, month);\n              if ($scope.options.filter) {\n                filter = $scope.options.filter(day);\n              }\n              return {\n                date: day,\n                selected: _isSelected(day) && withinMonth,\n                inRange: _isInRange(day),\n                disabled: !(withinLimits && withinMonth && filter),\n                marker: withinMonth ? _getMarker(day) : void 0\n              };\n            });\n            return days;\n          };\n          _buildMonth = function(time) {\n            var calendarEnd, calendarStart, start, w, weeks, weeksInMonth;\n            weeks = [];\n            calendarStart = moment(time).startOf('month');\n            calendarEnd = moment(time).endOf('month');\n            weeksInMonth = 5;\n            start = time.startOf('month');\n            weeks = (function() {\n              var _i, _results;\n              _results = [];\n              for (w = _i = 0; 0 <= weeksInMonth ? _i <= weeksInMonth : _i >= weeksInMonth; w = 0 <= weeksInMonth ? ++_i : --_i) {\n                _results.push(_buildWeek(moment(start).add(w, 'weeks'), moment(start).month()));\n              }\n              return _results;\n            })();\n            return {\n              weeks: weeks,\n              name: time.format(\"MMMM YYYY\")\n            };\n          };\n          _setup = function() {\n            var attr, dates, start, tempOptions, v, _ref;\n            tempOptions = {};\n            for (attr in options) {\n              v = options[attr];\n              tempOptions[attr] = v;\n            }\n            if ($scope.options) {\n              _ref = $scope.options;\n              for (attr in _ref) {\n                v = _ref[attr];\n                tempOptions[attr] = $scope.options[attr];\n              }\n            }\n            $scope.options = tempOptions;\n            switch ($scope.options.mode) {\n              case \"multiple\":\n                if ($scope.model && Array.isArray($scope.model) && $scope.model.length > 0) {\n                  if ($scope.model.length === 1) {\n                    start = moment($scope.model[0]);\n                  } else {\n                    dates = $scope.model.slice(0);\n                    start = moment(dates.sort().slice(-1)[0]);\n                  }\n                } else {\n                  $scope.model = [];\n                }\n                break;\n              default:\n                if ($scope.model) {\n                  start = moment($scope.model);\n                }\n            }\n            $scope.options.start = $scope.options.start || start || moment().startOf('day');\n            if ($scope.rangeFrom) {\n              $scope.options.rangeMode = \"from\";\n            } else if ($scope.rangeTo) {\n              $scope.options.rangeMode = \"to\";\n            }\n            _indexMarkers();\n            return $scope.options.template = $scope.options.template.replace('ng-bind-template=\"\"', 'ng-bind-template=\"' + $scope.options.markerTemplate + '\"');\n          };\n          _prepare = function() {\n            var m;\n            $scope.months = [];\n            return $scope.months = (function() {\n              var _i, _ref, _results;\n              _results = [];\n              for (m = _i = 0, _ref = $scope.options.months; 0 <= _ref ? _i < _ref : _i > _ref; m = 0 <= _ref ? ++_i : --_i) {\n                _results.push(_buildMonth(moment($scope.options.start).add(m, 'months')));\n              }\n              return _results;\n            })();\n          };\n          _build = function() {\n            _prepare();\n            return _bake();\n          };\n          $scope.moveMonth = function(step) {\n            $scope.options.start.add(step, 'month');\n            _prepare();\n          };\n          $scope.select = function(day) {\n            var ix;\n            if (!day.disabled) {\n              switch ($scope.options.mode) {\n                case \"multiple\":\n                  if (day.selected) {\n                    ix = _indexOfMoment($scope.model, day.date, 'day');\n                    $scope.model.splice(ix, 1);\n                  } else {\n                    $scope.model.push(moment(day.date));\n                  }\n                  break;\n                default:\n                  $scope.model = day.date;\n              }\n              if ($scope.options.callback) {\n                $scope.options.callback(day.date);\n              }\n              return _prepare();\n            }\n          };\n          $scope.$watchCollection('markers', function(newMarkers, oldMarkers) {\n            _indexMarkers();\n            return _prepare();\n          });\n          _setup();\n          _build();\n          switch ($scope.options.mode) {\n            case \"multiple\":\n              $scope.$watchCollection('model', function(newVals, oldVals) {\n                return _prepare();\n              });\n              break;\n            case \"simple\":\n              $scope.$watch('model', function(newVal, oldVal) {\n                if (!moment.isMoment(newVal)) {\n                  newVal = moment(newVal);\n                }\n                if (!oldVal || oldVal && !newVal.isSame(oldVal, 'day')) {\n                  $scope.model = newVal;\n                  if (oldVal) {\n                    $scope.options.start = moment(newVal);\n                  }\n                  return _prepare();\n                }\n              });\n          }\n          $scope.$watch('before', function(newVal, oldVal) {\n            if (newVal) {\n              if (!moment.isMoment(newVal)) {\n                newVal = moment(newVal);\n              }\n              if (!newVal.isSame(oldVal, 'day')) {\n                return _prepare();\n              }\n            }\n          });\n          return $scope.$watch('after', function(newVal, oldVal) {\n            if (newVal) {\n              if (!moment.isMoment(newVal)) {\n                newVal = moment(newVal);\n              }\n              if (!newVal.isSame(oldVal, 'day')) {\n                return _prepare();\n              }\n            }\n          });\n        }\n      };\n    }\n  ]);\n\n}).call(this);\n"]}