{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///angular-bootstrap-confirm.min.js","webpack:///webpack/bootstrap 019a35dc38c2eb6fcdfd","webpack:///./src/angular-bootstrap-confirm.js","webpack:///external \"angular\"","webpack:///./src/angular-bootstrap-confirm.html","webpack:///external \"angular-sanitize\""],"names":["root","factory","exports","module","require","define","amd","this","__WEBPACK_EXTERNAL_MODULE_1__","__WEBPACK_EXTERNAL_MODULE_3__","modules","__webpack_require__","moduleId","installedModules","id","loaded","call","m","c","p","angular","defaultPopoverTemplate","DEFAULT_POPOVER_URL","run","$templateCache","put","controller","$scope","$rootScope","$element","$attrs","$compile","$document","$window","$timeout","$injector","$templateRequest","$parse","$log","$animate","confirmationPopoverDefaults","assignOuterScopeValue","attributeName","value","scopeName","isDefined","assign","warn","evaluateOuterScopeValue","defaultValue","locals","positionPopover","popoverLoaded","then","popover","position","positionService","positionElements","placement","vm","defaults","top","left","css","applyFocus","buttonToFocus","focusButton","targetButtonClass","getElementsByClassName","focus","showPopover","isVisible","isDisabled","display","animation","addClass","hidePopover","removeClass","togglePopover","documentClick","event","contains","target","positionServiceName","has","get","templateUrl","popoverScope","$new","template","element","find","append","onConfirm","callbackLocals","onCancel","$watch","isOpen","newIsOpenValue","bind","addEventListener","$on","remove","unbind","removeEventListener","$destroy","directive","restrict","confirmText","cancelText","confirmButtonType","cancelButtonType","hideConfirmButton","hideCancelButton","name"],"mappings":";;;;;;CAAA,SAAAA,EAAAC,GACA,gBAAAC,UAAA,gBAAAC,QACAA,OAAAD,QAAAD,EAAAG,QAAA,WAAAA,QAAA,qBACA,kBAAAC,gBAAAC,IACAD,QAAA,8BAAAJ,GACA,gBAAAC,SACAA,QAAA,kCAAAD,EAAAG,QAAA,WAAAA,QAAA,qBAEAJ,EAAA,kCAAAC,EAAAD,EAAA,QAAAA,EAAA,sBACCO,KAAA,SAAAC,EAAAC,GACD,MCMgB,UAAUC,GCZ1B,QAAAC,GAAAC,GAGA,GAAAC,EAAAD,GAC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AgBA,EAEnBnB,EAAGkC,UAAY,SAASC,GACtB9C,EAAwBlB,EAAO+D,UAAW,KAAMC,IAGlDnC,EAAGoC,SAAW,SAASD,GACrB9C,EAAwBlB,EAAOiE,SAAU,KAAMD,IAGjDnE,EAAOqE,OAAOlE,EAAOmE,OAAQ,SAASC,GACpChE,EAAS,WACHgE,EACF5B,IAEAM,QAKN/C,EAASsE,KAAK,QAASrB,GAEvB7C,EAAQmE,iBAAiB,SAAUjD,GAEnCnB,EAAUmE,KAAK,QAASpB,GACxB/C,EAAUmE,KAAK,WAAYpB,GAE3BpD,EAAO0E,IAAI,WAAY,WACrBjD,EAAcC,KAAK,SAASC,GAC1BA,EAAQgD,SACRzE,EAAS0E,OAAO,QAASzB,GACzB7C,EAAQuE,oBAAoB,SAAUrD,GACtCnB,EAAUuE,OAAO,QAASxB,GAC1B/C,EAAUuE,OAAO,WAAYxB,GAC7BQ,EAAakB,kBAMlBC,UAAU,aAAc,WAEvB,OACEC,SAAU,IACVjF,WAAY,wBAKfiB,MAAM,+BACLiE,YAAa,UACbC,WAAY,SACZC,kBAAmB,UACnBC,iBAAkB,UAClBrD,UAAW,MACXQ,YAAa,KACboB,YAAahE,EACb0F,mBAAmB,EACnBC,kBAAkB,EAClBvC,WAAW,IAGZwC,MFmEG,SAAS/G,EAAQD,GG9PvBC,EAAAD,QAAAM,GHoQM,SAASL,EAAQD,GIpQvBC,EAAAD,QAAA,mhDJ0QM,SAASC,EAAQD,GK1QvBC,EAAAD,QAAAO","file":"angular-bootstrap-confirm.min.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"angular\"), require(\"angular-sanitize\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"angular\", \"angular-sanitize\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"angularBootstrapConfirmModuleName\"] = factory(require(\"angular\"), require(\"angular-sanitize\"));\n\telse\n\t\troot[\"angularBootstrapConfirmModuleName\"] = factory(root[\"angular\"], root[\"angular-sanitize\"]);\n})(this, function(__WEBPACK_EXTERNAL_MODULE_1__, __WEBPACK_EXTERNAL_MODULE_3__) {\nreturn \n\n\n/** WEBPACK FOOTER **\n ** webpack/universalModuleDefinition\n **/","/**\n   * angular-bootstrap-confirm - Displays a bootstrap confirmation popover when clicking the given element.\n   * @version v2.5.0\n   * @link https://github.com/mattlewis92/angular-bootstrap-confirm\n   * @license MIT\n   */\n(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"angular\"), require(\"angular-sanitize\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"angular\", \"angular-sanitize\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"angularBootstrapConfirmModuleName\"] = factory(require(\"angular\"), require(\"angular-sanitize\"));\n\telse\n\t\troot[\"angularBootstrapConfirmModuleName\"] = factory(root[\"angular\"], root[\"angular-sanitize\"]);\n})(this, function(__WEBPACK_EXTERNAL_MODULE_1__, __WEBPACK_EXTERNAL_MODULE_3__) {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId])\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\texports: {},\n/******/ \t\t\tid: moduleId,\n/******/ \t\t\tloaded: false\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.loaded = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(0);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar angular = __webpack_require__(1);\n\tvar defaultPopoverTemplate = __webpack_require__(2);\n\t__webpack_require__(3);\n\t__webpack_require__(1);\n\tvar DEFAULT_POPOVER_URL = 'angular-bootstrap-confirm.html';\n\t\n\tmodule.exports = angular\n\t\n\t  .module('mwl.confirm', [\n\t    'ngSanitize',\n\t    'ui.bootstrap.position'\n\t  ])\n\t\n\t  .run([\"$templateCache\", function($templateCache) {\n\t    $templateCache.put(DEFAULT_POPOVER_URL, defaultPopoverTemplate);\n\t  }])\n\t\n\t  .controller('PopoverConfirmCtrl', [\"$scope\", \"$rootScope\", \"$element\", \"$attrs\", \"$compile\", \"$document\", \"$window\", \"$timeout\", \"$injector\", \"$templateRequest\", \"$parse\", \"$log\", \"$animate\", \"confirmationPopoverDefaults\", function($scope, $rootScope, $element, $attrs, $compile, $document, $window, $timeout,\n\t                                             $injector, $templateRequest, $parse, $log, $animate, confirmationPopoverDefaults) {\n\t    var vm = this;\n\t    vm.defaults = confirmationPopoverDefaults;\n\t    vm.$attrs = $attrs;\n\t    var positionServiceName = $injector.has('$uibPosition') ? '$uibPosition' : '$position';\n\t    var positionService = $injector.get(positionServiceName);\n\t    var templateUrl = $attrs.templateUrl || confirmationPopoverDefaults.templateUrl;\n\t    var popoverScope = $rootScope.$new(true);\n\t    var animation = vm.animation = $attrs.animation === 'true' || confirmationPopoverDefaults.animation;\n\t    popoverScope.vm = vm;\n\t\n\t    function assignOuterScopeValue(attributeName, value) {\n\t      var scopeName = $attrs[attributeName];\n\t      if (angular.isDefined(scopeName)) {\n\t        if ($parse(scopeName).assign) {\n\t          $parse(scopeName).assign($scope, value);\n\t        } else {\n\t          $log.warn('Could not set value of ' + attributeName + ' to ' + value + '. This is normally because the value is not a variable.');\n\t        }\n\t      }\n\t    }\n\t\n\t    function evaluateOuterScopeValue(scopeName, defaultValue, locals) {\n\t      if (angular.isDefined(scopeName)) {\n\t        return $parse(scopeName)($scope, locals);\n\t      } else {\n\t        return defaultValue;\n\t      }\n\t    }\n\t\n\t    var popoverLoaded = $templateRequest(templateUrl).then(function(template) {\n\t      var popover = angular.element(template);\n\t      popover.css('display', 'none');\n\t      $compile(popover)(popoverScope);\n\t      $document.find('body').append(popover);\n\t      return popover;\n\t    });\n\t\n\t    vm.isVisible = false;\n\t\n\t    function positionPopover() {\n\t      popoverLoaded.then(function(popover) {\n\t        var position = positionService.positionElements($element, popover, $attrs.placement || vm.defaults.placement, true);\n\t        position.top += 'px';\n\t        position.left += 'px';\n\t        popover.css(position);\n\t      });\n\t    }\n\t\n\t    function applyFocus() {\n\t      var buttonToFocus = $attrs.focusButton || vm.defaults.focusButton;\n\t      if (buttonToFocus) {\n\t        popoverLoaded.then(function(popover) {\n\t          var targetButtonClass = buttonToFocus + '-button';\n\t          popover[0].getElementsByClassName(targetButtonClass)[0].focus();\n\t        });\n\t      }\n\t    }\n\t\n\t    function showPopover() {\n\t      if (!vm.isVisible && !evaluateOuterScopeValue($attrs.isDisabled, false)) {\n\t        popoverLoaded.then(function(popover) {\n\t          popover.css({display: 'block'});\n\t          if (animation) {\n\t            $animate.addClass(popover, 'in');\n\t          }\n\t          positionPopover();\n\t          applyFocus();\n\t          vm.isVisible = true;\n\t          assignOuterScopeValue('isOpen', true);\n\t        });\n\t      }\n\t    }\n\t\n\t    function hidePopover() {\n\t      if (vm.isVisible) {\n\t        popoverLoaded.then(function(popover) {\n\t          if (animation) {\n\t            $animate.removeClass(popover, 'in');\n\t          }\n\t          popover.css({display: 'none'});\n\t          vm.isVisible = false;\n\t          assignOuterScopeValue('isOpen', false);\n\t        });\n\t      }\n\t    }\n\t\n\t    function togglePopover() {\n\t      if (!vm.isVisible) {\n\t        showPopover();\n\t      } else {\n\t        hidePopover();\n\t      }\n\t    }\n\t\n\t    function documentClick(event) {\n\t      popoverLoaded.then(function(popover) {\n\t        if (vm.isVisible && !popover[0].contains(event.target) && !$element[0].contains(event.target)) {\n\t          hidePopover();\n\t        }\n\t      });\n\t    }\n\t\n\t    vm.showPopover = showPopover;\n\t    vm.hidePopover = hidePopover;\n\t    vm.togglePopover = togglePopover;\n\t\n\t    vm.onConfirm = function(callbackLocals) {\n\t      evaluateOuterScopeValue($attrs.onConfirm, null, callbackLocals);\n\t    };\n\t\n\t    vm.onCancel = function(callbackLocals) {\n\t      evaluateOuterScopeValue($attrs.onCancel, null, callbackLocals);\n\t    };\n\t\n\t    $scope.$watch($attrs.isOpen, function(newIsOpenValue) {\n\t      $timeout(function() { //timeout required so that documentClick() event doesn't fire and close it\n\t        if (newIsOpenValue) {\n\t          showPopover();\n\t        } else {\n\t          hidePopover();\n\t        }\n\t      });\n\t    });\n\t\n\t    $element.bind('click', togglePopover);\n\t\n\t    $window.addEventListener('resize', positionPopover);\n\t\n\t    $document.bind('click', documentClick);\n\t    $document.bind('touchend', documentClick);\n\t\n\t    $scope.$on('$destroy', function() {\n\t      popoverLoaded.then(function(popover) {\n\t        popover.remove();\n\t        $element.unbind('click', togglePopover);\n\t        $window.removeEventListener('resize', positionPopover);\n\t        $document.unbind('click', documentClick);\n\t        $document.unbind('touchend', documentClick);\n\t        popoverScope.$destroy();\n\t      });\n\t    });\n\t\n\t  }])\n\t\n\t  .directive('mwlConfirm', function() {\n\t\n\t    return {\n\t      restrict: 'A',\n\t      controller: 'PopoverConfirmCtrl'\n\t    };\n\t\n\t  })\n\t\n\t  .value('confirmationPopoverDefaults', {\n\t    confirmText: 'Confirm',\n\t    cancelText: 'Cancel',\n\t    confirmButtonType: 'success',\n\t    cancelButtonType: 'default',\n\t    placement: 'top',\n\t    focusButton: null,\n\t    templateUrl: DEFAULT_POPOVER_URL,\n\t    hideConfirmButton: false,\n\t    hideCancelButton: false,\n\t    animation: false\n\t  })\n\t\n\t  .name;\n\n\n/***/ },\n/* 1 */\n/***/ function(module, exports) {\n\n\tmodule.exports = __WEBPACK_EXTERNAL_MODULE_1__;\n\n/***/ },\n/* 2 */\n/***/ function(module, exports) {\n\n\tmodule.exports = \"<div\\n  class=\\\"popover\\\"\\n  ng-class=\\\"[vm.$attrs.placement || vm.defaults.placement, 'popover-' + (vm.$attrs.placement || vm.defaults.placement), vm.$attrs.popoverClass || vm.defaults.popoverClass, {fade: vm.animation}]\\\">\\n  <div class=\\\"popover-arrow arrow\\\"></div>\\n  <h3 class=\\\"popover-title\\\" ng-bind-html=\\\"vm.$attrs.title\\\"></h3>\\n  <div class=\\\"popover-content\\\">\\n    <p ng-bind-html=\\\"vm.$attrs.message\\\"></p>\\n    <div class=\\\"row\\\">\\n      <div\\n        class=\\\"col-xs-6\\\"\\n        ng-if=\\\"!vm.$attrs.hideConfirmButton && !vm.defaults.hideConfirmButton\\\"\\n        ng-class=\\\"{'col-xs-offset-3': vm.$attrs.hideCancelButton || vm.defaults.hideCancelButton}\\\">\\n        <button\\n          class=\\\"btn btn-block confirm-button\\\"\\n          ng-class=\\\"'btn-' + (vm.$attrs.confirmButtonType || vm.defaults.confirmButtonType)\\\"\\n          ng-click=\\\"vm.onConfirm(); vm.hidePopover()\\\"\\n          ng-bind-html=\\\"vm.$attrs.confirmText || vm.defaults.confirmText\\\">\\n        </button>\\n      </div>\\n      <div\\n        class=\\\"col-xs-6\\\"\\n        ng-if=\\\"!vm.$attrs.hideCancelButton && !vm.defaults.hideCancelButton\\\"\\n        ng-class=\\\"{'col-xs-offset-3': vm.$attrs.hideConfirmButton || vm.defaults.hideConfirmButton}\\\">\\n        <button\\n          class=\\\"btn btn-block cancel-button\\\"\\n          ng-class=\\\"'btn-' + (vm.$attrs.cancelButtonType || vm.defaults.cancelButtonType)\\\"\\n          ng-click=\\\"vm.onCancel(); vm.hidePopover()\\\"\\n          ng-bind-html=\\\"vm.$attrs.cancelText || vm.defaults.cancelText\\\">\\n        </button>\\n      </div>\\n    </div>\\n  </div>\\n</div>\\n\"\n\n/***/ },\n/* 3 */\n/***/ function(module, exports) {\n\n\tmodule.exports = __WEBPACK_EXTERNAL_MODULE_3__;\n\n/***/ }\n/******/ ])\n});\n;\n\n\n/** WEBPACK FOOTER **\n ** angular-bootstrap-confirm.min.js\n **/"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\texports: {},\n \t\t\tid: moduleId,\n \t\t\tloaded: false\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.loaded = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(0);\n\n\n\n/** WEBPACK FOOTER **\n ** webpack/bootstrap 019a35dc38c2eb6fcdfd\n **/","'use strict';\n\nvar angular = require('angular');\nvar defaultPopoverTemplate = require('./angular-bootstrap-confirm.html');\nrequire('angular-sanitize');\nrequire('./ui-bootstrap-position');\nvar DEFAULT_POPOVER_URL = 'angular-bootstrap-confirm.html';\n\nmodule.exports = angular\n\n  .module('mwl.confirm', [\n    'ngSanitize',\n    'ui.bootstrap.position'\n  ])\n\n  .run(function($templateCache) {\n    $templateCache.put(DEFAULT_POPOVER_URL, defaultPopoverTemplate);\n  })\n\n  .controller('PopoverConfirmCtrl', function($scope, $rootScope, $element, $attrs, $compile, $document, $window, $timeout,\n                                             $injector, $templateRequest, $parse, $log, $animate, confirmationPopoverDefaults) {\n    var vm = this;\n    vm.defaults = confirmationPopoverDefaults;\n    vm.$attrs = $attrs;\n    var positionServiceName = $injector.has('$uibPosition') ? '$uibPosition' : '$position';\n    var positionService = $injector.get(positionServiceName);\n    var templateUrl = $attrs.templateUrl || confirmationPopoverDefaults.templateUrl;\n    var popoverScope = $rootScope.$new(true);\n    var animation = vm.animation = $attrs.animation === 'true' || confirmationPopoverDefaults.animation;\n    popoverScope.vm = vm;\n\n    function assignOuterScopeValue(attributeName, value) {\n      var scopeName = $attrs[attributeName];\n      if (angular.isDefined(scopeName)) {\n        if ($parse(scopeName).assign) {\n          $parse(scopeName).assign($scope, value);\n        } else {\n          $log.warn('Could not set value of ' + attributeName + ' to ' + value + '. This is normally because the value is not a variable.');\n        }\n      }\n    }\n\n    function evaluateOuterScopeValue(scopeName, defaultValue, locals) {\n      if (angular.isDefined(scopeName)) {\n        return $parse(scopeName)($scope, locals);\n      } else {\n        return defaultValue;\n      }\n    }\n\n    var popoverLoaded = $templateRequest(templateUrl).then(function(template) {\n      var popover = angular.element(template);\n      popover.css('display', 'none');\n      $compile(popover)(popoverScope);\n      $document.find('body').append(popover);\n      return popover;\n    });\n\n    vm.isVisible = false;\n\n    function positionPopover() {\n      popoverLoaded.then(function(popover) {\n        var position = positionService.positionElements($element, popover, $attrs.placement || vm.defaults.placement, true);\n        position.top += 'px';\n        position.left += 'px';\n        popover.css(position);\n      });\n    }\n\n    function applyFocus() {\n      var buttonToFocus = $attrs.focusButton || vm.defaults.focusButton;\n      if (buttonToFocus) {\n        popoverLoaded.then(function(popover) {\n          var targetButtonClass = buttonToFocus + '-button';\n          popover[0].getElementsByClassName(targetButtonClass)[0].focus();\n        });\n      }\n    }\n\n    function showPopover() {\n      if (!vm.isVisible && !evaluateOuterScopeValue($attrs.isDisabled, false)) {\n        popoverLoaded.then(function(popover) {\n          popover.css({display: 'block'});\n          if (animation) {\n            $animate.addClass(popover, 'in');\n          }\n          positionPopover();\n          applyFocus();\n          vm.isVisible = true;\n          assignOuterScopeValue('isOpen', true);\n        });\n      }\n    }\n\n    function hidePopover() {\n      if (vm.isVisible) {\n        popoverLoaded.then(function(popover) {\n          if (animation) {\n            $animate.removeClass(popover, 'in');\n          }\n          popover.css({display: 'none'});\n          vm.isVisible = false;\n          assignOuterScopeValue('isOpen', false);\n        });\n      }\n    }\n\n    function togglePopover() {\n      if (!vm.isVisible) {\n        showPopover();\n      } else {\n        hidePopover();\n      }\n    }\n\n    function documentClick(event) {\n      popoverLoaded.then(function(popover) {\n        if (vm.isVisible && !popover[0].contains(event.target) && !$element[0].contains(event.target)) {\n          hidePopover();\n        }\n      });\n    }\n\n    vm.showPopover = showPopover;\n    vm.hidePopover = hidePopover;\n    vm.togglePopover = togglePopover;\n\n    vm.onConfirm = function(callbackLocals) {\n      evaluateOuterScopeValue($attrs.onConfirm, null, callbackLocals);\n    };\n\n    vm.onCancel = function(callbackLocals) {\n      evaluateOuterScopeValue($attrs.onCancel, null, callbackLocals);\n    };\n\n    $scope.$watch($attrs.isOpen, function(newIsOpenValue) {\n      $timeout(function() { //timeout required so that documentClick() event doesn't fire and close it\n        if (newIsOpenValue) {\n          showPopover();\n        } else {\n          hidePopover();\n        }\n      });\n    });\n\n    $element.bind('click', togglePopover);\n\n    $window.addEventListener('resize', positionPopover);\n\n    $document.bind('click', documentClick);\n    $document.bind('touchend', documentClick);\n\n    $scope.$on('$destroy', function() {\n      popoverLoaded.then(function(popover) {\n        popover.remove();\n        $element.unbind('click', togglePopover);\n        $window.removeEventListener('resize', positionPopover);\n        $document.unbind('click', documentClick);\n        $document.unbind('touchend', documentClick);\n        popoverScope.$destroy();\n      });\n    });\n\n  })\n\n  .directive('mwlConfirm', function() {\n\n    return {\n      restrict: 'A',\n      controller: 'PopoverConfirmCtrl'\n    };\n\n  })\n\n  .value('confirmationPopoverDefaults', {\n    confirmText: 'Confirm',\n    cancelText: 'Cancel',\n    confirmButtonType: 'success',\n    cancelButtonType: 'default',\n    placement: 'top',\n    focusButton: null,\n    templateUrl: DEFAULT_POPOVER_URL,\n    hideConfirmButton: false,\n    hideCancelButton: false,\n    animation: false\n  })\n\n  .name;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/angular-bootstrap-confirm.js\n **/","module.exports = __WEBPACK_EXTERNAL_MODULE_1__;\n\n\n/*****************\n ** WEBPACK FOOTER\n ** external \"angular\"\n ** module id = 1\n ** module chunks = 0\n **/","module.exports = \"<div\\n  class=\\\"popover\\\"\\n  ng-class=\\\"[vm.$attrs.placement || vm.defaults.placement, 'popover-' + (vm.$attrs.placement || vm.defaults.placement), vm.$attrs.popoverClass || vm.defaults.popoverClass, {fade: vm.animation}]\\\">\\n  <div class=\\\"popover-arrow arrow\\\"></div>\\n  <h3 class=\\\"popover-title\\\" ng-bind-html=\\\"vm.$attrs.title\\\"></h3>\\n  <div class=\\\"popover-content\\\">\\n    <p ng-bind-html=\\\"vm.$attrs.message\\\"></p>\\n    <div class=\\\"row\\\">\\n      <div\\n        class=\\\"col-xs-6\\\"\\n        ng-if=\\\"!vm.$attrs.hideConfirmButton && !vm.defaults.hideConfirmButton\\\"\\n        ng-class=\\\"{'col-xs-offset-3': vm.$attrs.hideCancelButton || vm.defaults.hideCancelButton}\\\">\\n        <button\\n          class=\\\"btn btn-block confirm-button\\\"\\n          ng-class=\\\"'btn-' + (vm.$attrs.confirmButtonType || vm.defaults.confirmButtonType)\\\"\\n          ng-click=\\\"vm.onConfirm(); vm.hidePopover()\\\"\\n          ng-bind-html=\\\"vm.$attrs.confirmText || vm.defaults.confirmText\\\">\\n        </button>\\n      </div>\\n      <div\\n        class=\\\"col-xs-6\\\"\\n        ng-if=\\\"!vm.$attrs.hideCancelButton && !vm.defaults.hideCancelButton\\\"\\n        ng-class=\\\"{'col-xs-offset-3': vm.$attrs.hideConfirmButton || vm.defaults.hideConfirmButton}\\\">\\n        <button\\n          class=\\\"btn btn-block cancel-button\\\"\\n          ng-class=\\\"'btn-' + (vm.$attrs.cancelButtonType || vm.defaults.cancelButtonType)\\\"\\n          ng-click=\\\"vm.onCancel(); vm.hidePopover()\\\"\\n          ng-bind-html=\\\"vm.$attrs.cancelText || vm.defaults.cancelText\\\">\\n        </button>\\n      </div>\\n    </div>\\n  </div>\\n</div>\\n\"\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./src/angular-bootstrap-confirm.html\n ** module id = 2\n ** module chunks = 0\n **/","module.exports = __WEBPACK_EXTERNAL_MODULE_3__;\n\n\n/*****************\n ** WEBPACK FOOTER\n ** external \"angular-sanitize\"\n ** module id = 3\n ** module chunks = 0\n **/"],"sourceRoot":""}