diff --git a/app/organization/views/organizationBilling.html b/app/organization/views/organizationBilling.html index 31fe781c..fe693558 100644 --- a/app/organization/views/organizationBilling.html +++ b/app/organization/views/organizationBilling.html @@ -119,7 +119,7 @@ You plan currently has a total of {{plan.seats}} seats. - ');t.find("body").append(a),n=a[0].offsetWidth-a[0].clientWidth,n=isFinite(n)?n:0,a.remove()}return n},scrollbarPadding:function(t){t=this.getRawNode(t);var n=e.getComputedStyle(t),r=this.parseStyle(n.paddingRight),i=this.parseStyle(n.paddingBottom),o=this.scrollParent(t,!1,!0),s=this.scrollbarWidth(a.test(o.tagName));return{scrollbarWidth:s,widthOverflow:o.scrollWidth>o.clientWidth,right:r+s,originalRight:r,heightOverflow:o.scrollHeight>o.clientHeight,bottom:i+s,originalBottom:i}},isScrollable:function(t,n){t=this.getRawNode(t);var r=n?i.hidden:i.normal,o=e.getComputedStyle(t);return r.test(o.overflow+o.overflowY+o.overflowX)},scrollParent:function(n,r,o){n=this.getRawNode(n);var a=r?i.hidden:i.normal,s=t[0].documentElement,u=e.getComputedStyle(n);if(o&&a.test(u.overflow+u.overflowY+u.overflowX))return n;var l="absolute"===u.position,c=n.parentElement||s;if(c===s||"fixed"===u.position)return s;for(;c.parentElement&&c!==s;){var p=e.getComputedStyle(c);if(l&&"static"!==p.position&&(l=!1),!l&&a.test(p.overflow+p.overflowY+p.overflowX))break;c=c.parentElement}return c},position:function(n,r){n=this.getRawNode(n);var i=this.offset(n);if(r){var o=e.getComputedStyle(n);i.top-=this.parseStyle(o.marginTop),i.left-=this.parseStyle(o.marginLeft)}var a=this.offsetParent(n),s={top:0,left:0};return a!==t[0].documentElement&&((s=this.offset(a)).top+=a.clientTop-a.scrollTop,s.left+=a.clientLeft-a.scrollLeft),{width:Math.round(angular.isNumber(i.width)?i.width:n.offsetWidth),height:Math.round(angular.isNumber(i.height)?i.height:n.offsetHeight),top:Math.round(i.top-s.top),left:Math.round(i.left-s.left)}},offset:function(n){var r=(n=this.getRawNode(n)).getBoundingClientRect();return{width:Math.round(angular.isNumber(r.width)?r.width:n.offsetWidth),height:Math.round(angular.isNumber(r.height)?r.height:n.offsetHeight),top:Math.round(r.top+(e.pageYOffset||t[0].documentElement.scrollTop)),left:Math.round(r.left+(e.pageXOffset||t[0].documentElement.scrollLeft))}},viewportOffset:function(n,r,i){i=!1!==i;var o=(n=this.getRawNode(n)).getBoundingClientRect(),a={top:0,left:0,bottom:0,right:0},s=r?t[0].documentElement:this.scrollParent(n),u=s.getBoundingClientRect();if(a.top=u.top+s.clientTop,a.left=u.left+s.clientLeft,s===t[0].documentElement&&(a.top+=e.pageYOffset,a.left+=e.pageXOffset),a.bottom=a.top+s.clientHeight,a.right=a.left+s.clientWidth,i){var l=e.getComputedStyle(s);a.top+=this.parseStyle(l.paddingTop),a.bottom-=this.parseStyle(l.paddingBottom),a.left+=this.parseStyle(l.paddingLeft),a.right-=this.parseStyle(l.paddingRight)}return{top:Math.round(o.top-a.top),bottom:Math.round(a.bottom-o.bottom),left:Math.round(o.left-a.left),right:Math.round(a.right-o.right)}},parsePlacement:function(t){var e=o.auto.test(t);return e&&(t=t.replace(o.auto,"")),t=t.split("-"),t[0]=t[0]||"top",o.primary.test(t[0])||(t[0]="top"),t[1]=t[1]||"center",o.secondary.test(t[1])||(t[1]="center"),t[2]=!!e,t},positionElements:function(t,n,r,i){t=this.getRawNode(t),n=this.getRawNode(n);var a=angular.isDefined(n.offsetWidth)?n.offsetWidth:n.prop("offsetWidth"),s=angular.isDefined(n.offsetHeight)?n.offsetHeight:n.prop("offsetHeight");r=this.parsePlacement(r);var u=i?this.offset(t):this.position(t),l={top:0,left:0,placement:""};if(r[2]){var c=this.viewportOffset(t,i),p=e.getComputedStyle(n),d={width:a+Math.round(Math.abs(this.parseStyle(p.marginLeft)+this.parseStyle(p.marginRight))),height:s+Math.round(Math.abs(this.parseStyle(p.marginTop)+this.parseStyle(p.marginBottom)))};if(r[0]="top"===r[0]&&d.height>c.top&&d.height<=c.bottom?"bottom":"bottom"===r[0]&&d.height>c.bottom&&d.height<=c.top?"top":"left"===r[0]&&d.width>c.left&&d.width<=c.right?"right":"right"===r[0]&&d.width>c.right&&d.width<=c.left?"left":r[0],r[1]="top"===r[1]&&d.height-u.height>c.bottom&&d.height-u.height<=c.top?"bottom":"bottom"===r[1]&&d.height-u.height>c.top&&d.height-u.height<=c.bottom?"top":"left"===r[1]&&d.width-u.width>c.right&&d.width-u.width<=c.left?"right":"right"===r[1]&&d.width-u.width>c.left&&d.width-u.width<=c.right?"left":r[1],"center"===r[1])if(o.vertical.test(r[0])){var f=u.width/2-a/2;c.left+f<0&&d.width-u.width<=c.right?r[1]="left":c.right+f<0&&d.width-u.width<=c.left&&(r[1]="right")}else{var h=u.height/2-d.height/2;c.top+h<0&&d.height-u.height<=c.bottom?r[1]="top":c.bottom+h<0&&d.height-u.height<=c.top&&(r[1]="bottom")}}switch(r[0]){case"top":l.top=u.top-s;break;case"bottom":l.top=u.top+u.height;break;case"left":l.left=u.left-a;break;case"right":l.left=u.left+u.width}switch(r[1]){case"top":l.top=u.top;break;case"bottom":l.top=u.top+u.height-s;break;case"left":l.left=u.left;break;case"right":l.left=u.left+u.width-a;break;case"center":o.vertical.test(r[0])?l.left=u.left+u.width/2-a/2:l.top=u.top+u.height/2-s/2}return l.top=Math.round(l.top),l.left=Math.round(l.left),l.placement="center"===r[1]?r[0]:r[0]+"-"+r[1],l},adjustTop:function(t,e,n,r){if(-1!==t.indexOf("top")&&n!==r)return{top:e.top-r+"px"}},positionArrow:function(t,n){var r=(t=this.getRawNode(t)).querySelector(".tooltip-inner, .popover-inner");if(r){var i=angular.element(r).hasClass("tooltip-inner"),a=i?t.querySelector(".tooltip-arrow"):t.querySelector(".arrow");if(a){var s={top:"",bottom:"",left:"",right:""};if("center"!==(n=this.parsePlacement(n))[1]){var u="border-"+n[0]+"-width",l=e.getComputedStyle(a)[u],c="border-";o.vertical.test(n[0])?c+=n[0]+"-"+n[1]:c+=n[1]+"-"+n[0],c+="-radius";var p=e.getComputedStyle(i?r:t)[c];switch(n[0]){case"top":s.bottom=i?"0":"-"+l;break;case"bottom":s.top=i?"0":"-"+l;break;case"left":s.right=i?"0":"-"+l;break;case"right":s.left=i?"0":"-"+l}s[n[1]]=p,angular.element(a).css(s)}else angular.element(a).css(s)}}}}}]),angular.module("ui.bootstrap.datepickerPopup",["ui.bootstrap.datepicker","ui.bootstrap.position"]).value("$datepickerPopupLiteralWarning",!0).constant("uibDatepickerPopupConfig",{altInputFormats:[],appendToBody:!1,clearText:"Clear",closeOnDateSelection:!0,closeText:"Done",currentText:"Today",datepickerPopup:"yyyy-MM-dd",datepickerPopupTemplateUrl:"uib/template/datepickerPopup/popup.html",datepickerTemplateUrl:"uib/template/datepicker/datepicker.html",html5Types:{date:"yyyy-MM-dd","datetime-local":"yyyy-MM-ddTHH:mm:ss.sss",month:"yyyy-MM"},onOpenFocus:!0,showButtonBar:!0,placement:"auto bottom-left"}).controller("UibDatepickerPopupController",["$scope","$element","$attrs","$compile","$log","$parse","$window","$document","$rootScope","$uibPosition","dateFilter","uibDateParser","uibDatepickerPopupConfig","$timeout","uibDatepickerConfig","$datepickerPopupLiteralWarning",function(t,e,n,r,i,o,a,s,u,l,c,p,d,f,h,g){function m(e){var n=p.parse(e,C,t.date);if(isNaN(n))for(var r=0;r<_.length;r++)if(n=p.parse(e,_[r],t.date),!isNaN(n))return n;return n}function v(t){if(angular.isNumber(t)&&(t=new Date(t)),!t)return null;if(angular.isDate(t)&&!isNaN(t))return t;if(angular.isString(t)){var e=m(t);if(!isNaN(e))return p.toTimezone(e,M.getOption("timezone"))}return M.getOption("allowInvalid")?t:void 0}function y(t,e){var r=t||e;return!n.ngRequired&&!r||(angular.isNumber(r)&&(r=new Date(r)),!r||(!(!angular.isDate(r)||isNaN(r))||!!angular.isString(r)&&!isNaN(m(r))))}function b(n){if(t.isOpen||!t.disabled){var r=P[0],i=e[0].contains(n.target),o=void 0!==r.contains&&r.contains(n.target);!t.isOpen||i||o||t.$apply(function(){t.isOpen=!1})}}function w(n){27===n.which&&t.isOpen?(n.preventDefault(),n.stopPropagation(),t.$apply(function(){t.isOpen=!1}),e[0].focus()):40!==n.which||t.isOpen||(n.preventDefault(),n.stopPropagation(),t.$apply(function(){t.isOpen=!0}))}function $(){if(t.isOpen){var r=angular.element(P[0].querySelector(".uib-datepicker-popup")),i=n.popupPlacement?n.popupPlacement:d.placement,o=l.positionElements(e,r,i,T);r.css({top:o.top+"px",left:o.left+"px"}),r.hasClass("uib-position-measure")&&r.removeClass("uib-position-measure")}}function k(t){var e;return angular.version.minor<6?(e=angular.isObject(t.$options)?t.$options:{timezone:null}).getOption=function(t){return e[t]}:e=t.$options,e}var C,x,T,S,E,D,A,B,I,O,M,P,_,R=!1,L=[];this.init=function(i){if(O=i,M=k(O),x=angular.isDefined(n.closeOnDateSelection)?t.$parent.$eval(n.closeOnDateSelection):d.closeOnDateSelection,T=angular.isDefined(n.datepickerAppendToBody)?t.$parent.$eval(n.datepickerAppendToBody):d.appendToBody,S=angular.isDefined(n.onOpenFocus)?t.$parent.$eval(n.onOpenFocus):d.onOpenFocus,E=angular.isDefined(n.datepickerPopupTemplateUrl)?n.datepickerPopupTemplateUrl:d.datepickerPopupTemplateUrl,D=angular.isDefined(n.datepickerTemplateUrl)?n.datepickerTemplateUrl:d.datepickerTemplateUrl,_=angular.isDefined(n.altInputFormats)?t.$parent.$eval(n.altInputFormats):d.altInputFormats,t.showButtonBar=angular.isDefined(n.showButtonBar)?t.$parent.$eval(n.showButtonBar):d.showButtonBar,d.html5Types[n.type]?(C=d.html5Types[n.type],R=!0):(C=n.uibDatepickerPopup||d.datepickerPopup,n.$observe("uibDatepickerPopup",function(t,e){var n=t||d.datepickerPopup;if(n!==C&&(C=n,O.$modelValue=null,!C))throw new Error("uibDatepickerPopup must have a date format specified.")})),!C)throw new Error("uibDatepickerPopup must have a date format specified.");if(R&&n.uibDatepickerPopup)throw new Error("HTML5 date input types do not support custom formats.");(A=angular.element("
")).attr({"ng-model":"date","ng-change":"dateSelection(date)","template-url":E}),(B=angular.element(A.children()[0])).attr("template-url",D),t.datepickerOptions||(t.datepickerOptions={}),R&&"month"===n.type&&(t.datepickerOptions.datepickerMode="month",t.datepickerOptions.minMode="month"),B.attr("datepicker-options","datepickerOptions"),R?O.$formatters.push(function(e){return t.date=p.fromTimezone(e,M.getOption("timezone")),e}):(O.$$parserName="date",O.$validators.date=y,O.$parsers.unshift(v),O.$formatters.push(function(e){return O.$isEmpty(e)?(t.date=e,e):(angular.isNumber(e)&&(e=new Date(e)),t.date=p.fromTimezone(e,M.getOption("timezone")),p.filter(t.date,C))})),O.$viewChangeListeners.push(function(){t.date=m(O.$viewValue)}),e.on("keydown",w),P=r(A)(t),A.remove(),T?s.find("body").append(P):e.after(P),t.$on("$destroy",function(){for(!0===t.isOpen&&(u.$$phase||t.$apply(function(){t.isOpen=!1})),P.remove(),e.off("keydown",w),s.off("click",b),I&&I.off("scroll",$),angular.element(a).off("resize",$);L.length;)L.shift()()})},t.getText=function(e){return t[e+"Text"]||d[e+"Text"]},t.isDisabled=function(e){"today"===e&&(e=p.fromTimezone(new Date,M.getOption("timezone")));var n={};return angular.forEach(["minDate","maxDate"],function(e){t.datepickerOptions[e]?angular.isDate(t.datepickerOptions[e])?n[e]=new Date(t.datepickerOptions[e]):(g&&i.warn("Literal date support has been deprecated, please switch to date object usage"),n[e]=new Date(c(t.datepickerOptions[e],"medium"))):n[e]=null}),t.datepickerOptions&&n.minDate&&t.compare(e,n.minDate)<0||n.maxDate&&t.compare(e,n.maxDate)>0},t.compare=function(t,e){return new Date(t.getFullYear(),t.getMonth(),t.getDate())-new Date(e.getFullYear(),e.getMonth(),e.getDate())},t.dateSelection=function(n){t.date=n;var r=t.date?p.filter(t.date,C):null;e.val(r),O.$setViewValue(r),x&&(t.isOpen=!1,e[0].focus())},t.keydown=function(n){27===n.which&&(n.stopPropagation(),t.isOpen=!1,e[0].focus())},t.select=function(e,n){if(n.stopPropagation(),"today"===e){var r=new Date;angular.isDate(t.date)?(e=new Date(t.date)).setFullYear(r.getFullYear(),r.getMonth(),r.getDate()):(e=p.fromTimezone(r,M.getOption("timezone"))).setHours(0,0,0,0)}t.dateSelection(e)},t.close=function(n){n.stopPropagation(),t.isOpen=!1,e[0].focus()},t.disabled=angular.isDefined(n.disabled)||!1,n.ngDisabled&&L.push(t.$parent.$watch(o(n.ngDisabled),function(e){t.disabled=e})),t.$watch("isOpen",function(r){r?t.disabled?t.isOpen=!1:f(function(){$(),S&&t.$broadcast("uib:datepicker.focus"),s.on("click",b);var r=n.popupPlacement?n.popupPlacement:d.placement;T||l.parsePlacement(r)[2]?(I=I||angular.element(l.scrollParent(e)))&&I.on("scroll",$):I=null,angular.element(a).on("resize",$)},0,!1):(s.off("click",b),I&&I.off("scroll",$),angular.element(a).off("resize",$))}),t.$on("uib:datepicker.mode",function(){f($,0,!1)})}]).directive("uibDatepickerPopup",function(){return{require:["ngModel","uibDatepickerPopup"],controller:"UibDatepickerPopupController",scope:{datepickerOptions:"=?",isOpen:"=?",currentText:"@",clearText:"@",closeText:"@"},link:function(t,e,n,r){var i=r[0];r[1].init(i)}}}).directive("uibDatepickerPopupWrap",function(){return{restrict:"A",transclude:!0,templateUrl:function(t,e){return e.templateUrl||"uib/template/datepickerPopup/popup.html"}}}),angular.module("ui.bootstrap.debounce",[]).factory("$$debounce",["$timeout",function(t){return function(e,n){var r;return function(){var i=this,o=Array.prototype.slice.call(arguments);r&&t.cancel(r),r=t(function(){e.apply(i,o)},n)}}}]),angular.module("ui.bootstrap.multiMap",[]).factory("$$multiMap",function(){return{createNew:function(){var t={};return{entries:function(){return Object.keys(t).map(function(e){return{key:e,value:t[e]}})},get:function(e){return t[e]},hasKey:function(e){return!!t[e]},keys:function(){return Object.keys(t)},put:function(e,n){t[e]||(t[e]=[]),t[e].push(n)},remove:function(e,n){var r=t[e];if(r){var i=r.indexOf(n);-1!==i&&r.splice(i,1),r.length||delete t[e]}}}}}}),angular.module("ui.bootstrap.dropdown",["ui.bootstrap.multiMap","ui.bootstrap.position"]).constant("uibDropdownConfig",{appendToOpenClass:"uib-dropdown-open",openClass:"open"}).service("uibDropdownService",["$document","$rootScope","$$multiMap",function(t,e,n){var r=null,i=n.createNew();this.isOnlyOpen=function(t,e){var n=i.get(e);return!(!n||!n.reduce(function(e,n){return n.scope===t?n:e},{}))&&1===n.length},this.open=function(e,n,a){if(r||t.on("click",o),r&&r!==e&&(r.isOpen=!1),r=e,a){var s=i.get(a);s?-1===s.map(function(t){return t.scope}).indexOf(e)&&i.put(a,{scope:e}):i.put(a,{scope:e})}},this.close=function(e,n,a){if(r===e&&(t.off("click",o),t.off("keydown",this.keybindFilter),r=null),a){var s=i.get(a);if(s){var u=s.reduce(function(t,n){return n.scope===e?n:t},{});u&&i.remove(a,u)}}};var o=function(t){if(r&&r.isOpen&&!(t&&"disabled"===r.getAutoClose()||t&&3===t.which)){var n=r.getToggleElement();if(!(t&&n&&n[0].contains(t.target))){var i=r.getDropdownElement();t&&"outsideClick"===r.getAutoClose()&&i&&i[0].contains(t.target)||(r.focusToggleElement(),r.isOpen=!1,e.$$phase||r.$apply())}}};this.keybindFilter=function(t){if(r){var e=r.getDropdownElement(),n=r.getToggleElement(),i=e&&e[0].contains(t.target),a=n&&n[0].contains(t.target);27===t.which?(t.stopPropagation(),r.focusToggleElement(),o()):r.isKeynavEnabled()&&-1!==[38,40].indexOf(t.which)&&r.isOpen&&(i||a)&&(t.preventDefault(),t.stopPropagation(),r.focusDropdownEntry(t.which))}}}]).controller("UibDropdownController",["$scope","$element","$attrs","$parse","uibDropdownConfig","uibDropdownService","$animate","$uibPosition","$document","$compile","$templateRequest",function(t,e,n,r,i,o,a,s,u,l,c){function p(){e.append(h.dropdownMenu)}var d,f,h=this,g=t.$new(),m=i.appendToOpenClass,v=i.openClass,y=angular.noop,b=n.onToggle?r(n.onToggle):angular.noop,w=!1,$=u.find("body");e.addClass("dropdown"),this.init=function(){n.isOpen&&(f=r(n.isOpen),y=f.assign,t.$watch(f,function(t){g.isOpen=!!t})),w=angular.isDefined(n.keyboardNav)},this.toggle=function(t){return g.isOpen=arguments.length?!!t:!g.isOpen,angular.isFunction(y)&&y(g,g.isOpen),g.isOpen},this.isOpen=function(){return g.isOpen},g.getToggleElement=function(){return h.toggleElement},g.getAutoClose=function(){return n.autoClose||"always"},g.getElement=function(){return e},g.isKeynavEnabled=function(){return w},g.focusDropdownEntry=function(t){var n=h.dropdownMenu?angular.element(h.dropdownMenu).find("a"):e.find("ul").eq(0).find("a");switch(t){case 40:angular.isNumber(h.selectedOption)?h.selectedOption=h.selectedOption===n.length-1?h.selectedOption:h.selectedOption+1:h.selectedOption=0;break;case 38:angular.isNumber(h.selectedOption)?h.selectedOption=0===h.selectedOption?0:h.selectedOption-1:h.selectedOption=n.length-1}n[h.selectedOption].focus()},g.getDropdownElement=function(){return h.dropdownMenu},g.focusToggleElement=function(){h.toggleElement&&h.toggleElement[0].focus()},g.$watch("isOpen",function(i,f){var w=null,k=!1;if(angular.isDefined(n.dropdownAppendTo)){var C=r(n.dropdownAppendTo)(g);C&&(w=angular.element(C))}if(angular.isDefined(n.dropdownAppendToBody)&&!1!==r(n.dropdownAppendToBody)(g)&&(k=!0),k&&!w&&(w=$),w&&h.dropdownMenu&&(i?(w.append(h.dropdownMenu),e.on("$destroy",p)):(e.off("$destroy",p),p())),w&&h.dropdownMenu){var x,T,S,E=s.positionElements(e,h.dropdownMenu,"bottom-left",!0),D=0;if(x={top:E.top+"px",display:i?"block":"none"},(T=h.dropdownMenu.hasClass("dropdown-menu-right"))?(x.left="auto",(S=s.scrollbarPadding(w)).heightOverflow&&S.scrollbarWidth&&(D=S.scrollbarWidth),x.right=window.innerWidth-D-(E.left+e.prop("offsetWidth"))+"px"):(x.left=E.left+"px",x.right="auto"),!k){var A=s.offset(w);x.top=E.top-A.top+"px",T?x.right=window.innerWidth-(E.left-A.left+e.prop("offsetWidth"))+"px":x.left=E.left-A.left+"px"}h.dropdownMenu.css(x)}var B=w||e,I=w?m:v,O=B.hasClass(I),M=o.isOnlyOpen(t,w);if(O===!i){a[w?M?"removeClass":"addClass":i?"addClass":"removeClass"](B,I).then(function(){angular.isDefined(i)&&i!==f&&b(t,{open:!!i})})}if(i)h.dropdownMenuTemplateUrl?c(h.dropdownMenuTemplateUrl).then(function(t){d=g.$new(),l(t.trim())(d,function(t){var e=t;h.dropdownMenu.replaceWith(e),h.dropdownMenu=e,u.on("keydown",o.keybindFilter)})}):u.on("keydown",o.keybindFilter),g.focusToggleElement(),o.open(g,e,w);else{if(o.close(g,e,w),h.dropdownMenuTemplateUrl){d&&d.$destroy();var P=angular.element('');h.dropdownMenu.replaceWith(P),h.dropdownMenu=P}h.selectedOption=null}angular.isFunction(y)&&y(t,i)})}]).directive("uibDropdown",function(){return{controller:"UibDropdownController",link:function(t,e,n,r){r.init()}}}).directive("uibDropdownMenu",function(){return{restrict:"A",require:"?^uibDropdown",link:function(t,e,n,r){if(r&&!angular.isDefined(n.dropdownNested)){e.addClass("dropdown-menu");var i=n.templateUrl;i&&(r.dropdownMenuTemplateUrl=i),r.dropdownMenu||(r.dropdownMenu=e)}}}}).directive("uibDropdownToggle",function(){return{require:"?^uibDropdown",link:function(t,e,n,r){if(r){e.addClass("dropdown-toggle"),r.toggleElement=e;var i=function(i){i.preventDefault(),e.hasClass("disabled")||n.disabled||t.$apply(function(){r.toggle()})};e.on("click",i),e.attr({"aria-haspopup":!0,"aria-expanded":!1}),t.$watch(r.isOpen,function(t){e.attr("aria-expanded",!!t)}),t.$on("$destroy",function(){e.off("click",i)})}}}}),angular.module("ui.bootstrap.stackedMap",[]).factory("$$stackedMap",function(){return{createNew:function(){var t=[];return{add:function(e,n){t.push({key:e,value:n})},get:function(e){for(var n=0;n-1&&t0&&(e=C.top().value).modalDomEl.toggleClass(e.windowTopClass||"",t)}function h(){if(b&&-1===p()){var t=w;g(b,w,function(){t=null}),b=void 0,w=void 0}}function g(e,n,r,i){function a(){a.done||(a.done=!0,t.leave(e).then(function(){r&&r(),e.remove(),i&&i.resolve()}),n.$destroy())}var s,u=null;return n.$broadcast(T.NOW_CLOSING_EVENT,function(){return s||(s=o.defer(),u=s.promise),function(){s.resolve()}}),o.when(u).then(a)}function m(t){if(t.isDefaultPrevented())return t;var e=C.top();if(e)switch(t.which){case 27:e.value.keyboard&&(t.preventDefault(),i.$apply(function(){T.dismiss(e.key,"escape key press")}));break;case 9:var n=T.loadFocusElementList(e),r=!1;t.shiftKey?(T.isFocusInFirstItem(t,n)||T.isModalFocused(t,e))&&(r=T.focusLastFocusableElement(n)):T.isFocusInLastItem(t,n)&&(r=T.focusFirstFocusableElement(n)),r&&(t.preventDefault(),t.stopPropagation())}}function v(t,e,n){return!t.value.modalScope.$broadcast("modal.closing",e,n).defaultPrevented}function y(){Array.prototype.forEach.call(document.querySelectorAll("["+D+"]"),function(t){var e=parseInt(t.getAttribute(D),10)-1;t.setAttribute(D,e),e||(t.removeAttribute(D),t.removeAttribute("aria-hidden"))})}var b,w,$,k="modal-open",C=s.createNew(),x=a.createNew(),T={NOW_CLOSING_EVENT:"modal.stack.now-closing"},S=0,E=null,D="data-bootstrap-modal-aria-hidden-count",A=/[A-Z]/g;return i.$watch(p,function(t){w&&(w.index=t)}),n.on("keydown",m),i.$on("$destroy",function(){n.off("keydown",m)}),T.open=function(e,o){function a(t){if(t&&"BODY"!==t[0].tagName)return function(t){var e=t.parent()?t.parent().children():[];return Array.prototype.filter.call(e,function(e){return e!==t[0]})}(t).forEach(function(t){var e="true"===t.getAttribute("aria-hidden"),n=parseInt(t.getAttribute(D),10);n||(n=e?1:0),t.setAttribute(D,n+1),t.setAttribute("aria-hidden","true")}),a(t.parent())}var s=n[0].activeElement,c=o.openedClass||k;f(!1),E=C.top(),C.add(e,{deferred:o.deferred,renderDeferred:o.renderDeferred,closedDeferred:o.closedDeferred,modalScope:o.scope,backdrop:o.backdrop,keyboard:o.keyboard,openedClass:o.openedClass,windowTopClass:o.windowTopClass,animation:o.animation,appendTo:o.appendTo}),x.put(c,e);var d=o.appendTo,h=p();h>=0&&!b&&((w=i.$new(!0)).modalOptions=o,w.index=h,(b=angular.element('
')).attr({class:"modal-backdrop","ng-style":"{'z-index': 1040 + (index && 1 || 0) + index*10}","uib-modal-animation-class":"fade","modal-in-class":"in"}),o.backdropClass&&b.addClass(o.backdropClass),o.animation&&b.attr("modal-animation","true"),r(b)(w),t.enter(b,d),u.isScrollable(d)&&($=u.scrollbarPadding(d)).heightOverflow&&$.scrollbarWidth&&d.css({paddingRight:$.right+"px"}));var g;o.component?(g=document.createElement(l(o.component.name)),(g=angular.element(g)).attr({resolve:"$resolve","modal-instance":"$uibModalInstance",close:"$close($value)",dismiss:"$dismiss($value)"})):g=o.content,S=E?parseInt(E.value.modalDomEl.attr("index"),10)+1:0;var m=angular.element('
');m.attr({class:"modal","template-url":o.windowTemplateUrl,"window-top-class":o.windowTopClass,role:"dialog","aria-labelledby":o.ariaLabelledBy,"aria-describedby":o.ariaDescribedBy,size:o.size,index:S,animate:"animate","ng-style":"{'z-index': 1050 + $$topModalIndex*10, display: 'block'}",tabindex:-1,"uib-modal-animation-class":"fade","modal-in-class":"in"}).append(g),o.windowClass&&m.addClass(o.windowClass),o.animation&&m.attr("modal-animation","true"),d.addClass(c),o.scope&&(o.scope.$$topModalIndex=S),t.enter(r(m)(o.scope),d),C.top().value.modalDomEl=m,C.top().value.modalOpener=s,a(m)},T.close=function(t,e){var n=C.get(t);return y(),n&&v(n,e,!0)?(n.value.modalScope.$$uibDestructionScheduled=!0,n.value.deferred.resolve(e),d(t,n.value.modalOpener),!0):!n},T.dismiss=function(t,e){var n=C.get(t);return y(),n&&v(n,e,!1)?(n.value.modalScope.$$uibDestructionScheduled=!0,n.value.deferred.reject(e),d(t,n.value.modalOpener),!0):!n},T.dismissAll=function(t){for(var e=this.getTop();e&&this.dismiss(e.key,t);)e=this.getTop()},T.getTop=function(){return C.top()},T.modalRendered=function(t){var e=C.get(t);e&&e.value.renderDeferred.resolve()},T.focusFirstFocusableElement=function(t){return t.length>0&&(t[0].focus(),!0)},T.focusLastFocusableElement=function(t){return t.length>0&&(t[t.length-1].focus(),!0)},T.isModalFocused=function(t,e){if(t&&e){var n=e.value.modalDomEl;if(n&&n.length)return(t.target||t.srcElement)===n[0]}return!1},T.isFocusInFirstItem=function(t,e){return e.length>0&&(t.target||t.srcElement)===e[0]},T.isFocusInLastItem=function(t,e){return e.length>0&&(t.target||t.srcElement)===e[e.length-1]},T.loadFocusElementList=function(t){if(t){var e=t.value.modalDomEl;if(e&&e.length){var n=e[0].querySelectorAll("a[href], area[href], input:not([disabled]):not([tabindex='-1']), button:not([disabled]):not([tabindex='-1']),select:not([disabled]):not([tabindex='-1']), textarea:not([disabled]):not([tabindex='-1']), iframe, object, embed, *[tabindex]:not([tabindex='-1']), *[contenteditable=true]");return n?Array.prototype.filter.call(n,function(t){return c(t)}):n}}},T}]).provider("$uibModal",function(){var t={options:{animation:!0,backdrop:!0,keyboard:!0},$get:["$rootScope","$q","$document","$templateRequest","$controller","$uibResolve","$uibModalStack",function(e,n,r,i,o,a,s){function u(t){return t.template?n.when(t.template):i(angular.isFunction(t.templateUrl)?t.templateUrl():t.templateUrl)}var l={},c=null;return l.getPromiseChain=function(){return c},l.open=function(i){function l(){return m}var p=n.defer(),d=n.defer(),f=n.defer(),h=n.defer(),g={result:p.promise,opened:d.promise,closed:f.promise,rendered:h.promise,close:function(t){return s.close(g,t)},dismiss:function(t){return s.dismiss(g,t)}};if(i=angular.extend({},t.options,i),i.resolve=i.resolve||{},i.appendTo=i.appendTo||r.find("body").eq(0),!i.appendTo.length)throw new Error("appendTo element not found. Make sure that the element passed is in DOM.");if(!i.component&&!i.template&&!i.templateUrl)throw new Error("One of component or template or templateUrl options is required.");var m;m=i.component?n.when(a.resolve(i.resolve,{},null,null)):n.all([u(i),a.resolve(i.resolve,{},null,null)]);var v;return v=c=n.all([c]).then(l,l).then(function(t){function n(e,n,r,i){e.$scope=a,e.$scope.$resolve={},r?e.$scope.$uibModalInstance=g:e.$uibModalInstance=g;var o=n?t[1]:t;angular.forEach(o,function(t,n){i&&(e[n]=t),e.$scope.$resolve[n]=t})}var r=i.scope||e,a=r.$new();a.$close=g.close,a.$dismiss=g.dismiss,a.$on("$destroy",function(){a.$$uibDestructionScheduled||a.$dismiss("$uibUnscheduledDestruction")});var u,l,c={scope:a,deferred:p,renderDeferred:h,closedDeferred:f,animation:i.animation,backdrop:i.backdrop,keyboard:i.keyboard,backdropClass:i.backdropClass,windowTopClass:i.windowTopClass,windowClass:i.windowClass,windowTemplateUrl:i.windowTemplateUrl,ariaLabelledBy:i.ariaLabelledBy,ariaDescribedBy:i.ariaDescribedBy,size:i.size,openedClass:i.openedClass,appendTo:i.appendTo},m={},v={};i.component?(n(m,!1,!0,!1),m.name=i.component,c.component=m):i.controller&&(n(v,!0,!1,!0),l=o(i.controller,v,!0,i.controllerAs),i.controllerAs&&i.bindToController&&((u=l.instance).$close=a.$close,u.$dismiss=a.$dismiss,angular.extend(u,{$resolve:v.$scope.$resolve},r)),u=l(),angular.isFunction(u.$onInit)&&u.$onInit()),i.component||(c.content=t[0]),s.open(g,c),d.resolve(!0)},function(t){d.reject(t),p.reject(t)}).finally(function(){c===v&&(c=null)}),g},l}]};return t}),angular.module("ui.bootstrap.paging",[]).factory("uibPaging",["$parse",function(t){return{create:function(e,n,r){e.setNumPages=r.numPages?t(r.numPages).assign:angular.noop,e.ngModelCtrl={$setViewValue:angular.noop},e._watchers=[],e.init=function(t,i){e.ngModelCtrl=t,e.config=i,t.$render=function(){e.render()},r.itemsPerPage?e._watchers.push(n.$parent.$watch(r.itemsPerPage,function(t){e.itemsPerPage=parseInt(t,10),n.totalPages=e.calculateTotalPages(),e.updatePage()})):e.itemsPerPage=i.itemsPerPage,n.$watch("totalItems",function(t,r){(angular.isDefined(t)||t!==r)&&(n.totalPages=e.calculateTotalPages(),e.updatePage())})},e.calculateTotalPages=function(){var t=e.itemsPerPage<1?1:Math.ceil(n.totalItems/e.itemsPerPage);return Math.max(t||0,1)},e.render=function(){n.page=parseInt(e.ngModelCtrl.$viewValue,10)||1},n.selectPage=function(t,r){r&&r.preventDefault(),(!n.ngDisabled||!r)&&n.page!==t&&t>0&&t<=n.totalPages&&(r&&r.target&&r.target.blur(),e.ngModelCtrl.$setViewValue(t),e.ngModelCtrl.$render())},n.getText=function(t){return n[t+"Text"]||e.config[t+"Text"]},n.noPrevious=function(){return 1===n.page},n.noNext=function(){return n.page===n.totalPages},e.updatePage=function(){e.setNumPages(n.$parent,n.totalPages),n.page>n.totalPages?n.selectPage(n.totalPages):e.ngModelCtrl.$render()},n.$on("$destroy",function(){for(;e._watchers.length;)e._watchers.shift()()})}}}]),angular.module("ui.bootstrap.pager",["ui.bootstrap.paging","ui.bootstrap.tabindex"]).controller("UibPagerController",["$scope","$attrs","uibPaging","uibPagerConfig",function(t,e,n,r){t.align=angular.isDefined(e.align)?t.$parent.$eval(e.align):r.align,n.create(this,t,e)}]).constant("uibPagerConfig",{itemsPerPage:10,previousText:"« Previous",nextText:"Next »",align:!0}).directive("uibPager",["uibPagerConfig",function(t){return{scope:{totalItems:"=",previousText:"@",nextText:"@",ngDisabled:"="},require:["uibPager","?ngModel"],restrict:"A",controller:"UibPagerController",controllerAs:"pager",templateUrl:function(t,e){return e.templateUrl||"uib/template/pager/pager.html"},link:function(e,n,r,i){n.addClass("pager");var o=i[0],a=i[1];a&&o.init(a,t)}}}]),angular.module("ui.bootstrap.pagination",["ui.bootstrap.paging","ui.bootstrap.tabindex"]).controller("UibPaginationController",["$scope","$attrs","$parse","uibPaging","uibPaginationConfig",function(t,e,n,r,i){function o(t,e,n){return{number:t,text:e,active:n}}function a(t,e){var n=[],r=1,i=e,a=angular.isDefined(u)&&ue&&(r=(i=e)-u+1):(r=(Math.ceil(t/u)-1)*u+1,i=Math.min(r+u-1,e)));for(var s=r;s<=i;s++){var f=o(s,d(s),s===t);n.push(f)}if(a&&u>0&&(!l||c||p)){if(r>1){if(!p||r>3){var h=o(r-1,"...",!1);n.unshift(h)}if(p){if(3===r){var g=o(2,"2",!1);n.unshift(g)}var m=o(1,"1",!1);n.unshift(m)}}if(i0&&t.page<=t.totalPages&&(t.pages=a(t.page,t.totalPages))}}]).constant("uibPaginationConfig",{itemsPerPage:10,boundaryLinks:!1,boundaryLinkNumbers:!1,directionLinks:!0,firstText:"First",previousText:"Previous",nextText:"Next",lastText:"Last",rotate:!0,forceEllipses:!1}).directive("uibPagination",["$parse","uibPaginationConfig",function(t,e){return{scope:{totalItems:"=",firstText:"@",previousText:"@",nextText:"@",lastText:"@",ngDisabled:"="},require:["uibPagination","?ngModel"],restrict:"A",controller:"UibPaginationController",controllerAs:"pagination",templateUrl:function(t,e){return e.templateUrl||"uib/template/pagination/pagination.html"},link:function(t,n,r,i){n.addClass("pagination");var o=i[0],a=i[1];a&&o.init(a,e)}}}]),angular.module("ui.bootstrap.tooltip",["ui.bootstrap.position","ui.bootstrap.stackedMap"]).provider("$uibTooltip",function(){function t(t){var e=/[A-Z]/g;return t.replace(e,function(t,e){return(e?"-":"")+t.toLowerCase()})}var e={placement:"top",placementClassPrefix:"",animation:!0,popupDelay:0,popupCloseDelay:0,useContentExp:!1},n={mouseenter:"mouseleave",click:"click",outsideClick:"outsideClick",focus:"blur",none:""},r={};this.options=function(t){angular.extend(r,t)},this.setTriggers=function(t){angular.extend(n,t)},this.$get=["$window","$compile","$timeout","$document","$uibPosition","$interpolate","$rootScope","$parse","$$stackedMap",function(i,o,a,s,u,l,c,p,d){function f(t){if(27===t.which){var e=h.top();e&&(e.value.close(),e=null)}}var h=d.createNew();return s.on("keyup",f),c.$on("$destroy",function(){s.off("keyup",f)}),function(i,c,d,f){function g(t){var e=(t||f.trigger||d).split(" ");return{show:e,hide:e.map(function(t){return n[t]||t})}}f=angular.extend({},e,r,f);var m=t(i),v=l.startSymbol(),y=l.endSymbol(),b="
';return{compile:function(t,e){var n=o(b);return function(t,e,r,o){function l(){q.isOpen?m():d()}function d(){U&&!t.$eval(r[c+"Enable"])||(w(),C(),q.popupDelay?O||(O=a(v,q.popupDelay,!1)):v())}function m(){y(),q.popupCloseDelay?M||(M=a(b,q.popupCloseDelay,!1)):b()}function v(){if(y(),w(),!q.content)return angular.noop;$(),q.$evalAsync(function(){q.isOpen=!0,x(!0),H()})}function y(){O&&(a.cancel(O),O=null),P&&(a.cancel(P),P=null)}function b(){q&&q.$evalAsync(function(){q&&(q.isOpen=!1,x(!1),q.animation?I||(I=a(k,150,!1)):k())})}function w(){M&&(a.cancel(M),M=null),I&&(a.cancel(I),I=null)}function $(){A||(B=q.$new(),A=n(B,function(t){L?s.find("body").append(t):e.after(t)}),h.add(q,{close:b}),T())}function k(){y(),w(),S(),A&&(A.remove(),A=null,_&&a.cancel(_)),h.remove(q),B&&(B.$destroy(),B=null)}function C(){q.title=r[c+"Title"],q.content=V?V(t):r[i],q.popupClass=r[c+"Class"],q.placement=angular.isDefined(r[c+"Placement"])?r[c+"Placement"]:f.placement;var e=u.parsePlacement(q.placement);R=e[1]?e[0]+"-"+e[1]:e[0];var n=parseInt(r[c+"PopupDelay"],10),o=parseInt(r[c+"PopupCloseDelay"],10);q.popupDelay=isNaN(n)?f.popupDelay:n,q.popupCloseDelay=isNaN(o)?f.popupCloseDelay:o}function x(e){F&&angular.isFunction(F.assign)&&F.assign(t,e)}function T(){z.length=0,V?(z.push(t.$watch(V,function(t){q.content=t,!t&&q.isOpen&&b()})),z.push(B.$watch(function(){j||(j=!0,B.$$postDigest(function(){j=!1,q&&q.isOpen&&H()}))}))):z.push(r.$observe(i,function(t){q.content=t,!t&&q.isOpen?b():H()})),z.push(r.$observe(c+"Title",function(t){q.title=t,q.isOpen&&H()})),z.push(r.$observe(c+"Placement",function(t){q.placement=t||f.placement,q.isOpen&&H()}))}function S(){z.length&&(angular.forEach(z,function(t){t()}),z.length=0)}function E(t){q&&q.isOpen&&A&&(e[0].contains(t.target)||A[0].contains(t.target)||m())}function D(t){27===t.which&&m()}var A,B,I,O,M,P,_,R,L=!!angular.isDefined(f.appendToBody)&&f.appendToBody,N=g(void 0),U=angular.isDefined(r[c+"Enable"]),q=t.$new(!0),j=!1,F=!!angular.isDefined(r[c+"IsOpen"])&&p(r[c+"IsOpen"]),V=!!f.useContentExp&&p(r[i]),z=[],H=function(){A&&A.html()&&(P||(P=a(function(){var t=u.positionElements(e,A,q.placement,L),n=angular.isDefined(A.offsetHeight)?A.offsetHeight:A.prop("offsetHeight"),r=L?u.offset(e):u.position(e);A.css({top:t.top+"px",left:t.left+"px"});var i=t.placement.split("-");A.hasClass(i[0])||(A.removeClass(R.split("-")[0]),A.addClass(i[0])),A.hasClass(f.placementClassPrefix+t.placement)||(A.removeClass(f.placementClassPrefix+R),A.addClass(f.placementClassPrefix+t.placement)),_=a(function(){var t=angular.isDefined(A.offsetHeight)?A.offsetHeight:A.prop("offsetHeight"),e=u.adjustTop(i,r,n,t);e&&A.css(e),_=null},0,!1),A.hasClass("uib-position-measure")?(u.positionArrow(A,t.placement),A.removeClass("uib-position-measure")):R!==t.placement&&u.positionArrow(A,t.placement),R=t.placement,P=null},0,!1)))};q.origScope=t,q.isOpen=!1,q.contentExp=function(){return q.content},r.$observe("disabled",function(t){t&&y(),t&&q.isOpen&&b()}),F&&t.$watch(F,function(t){q&&!t===q.isOpen&&l()});var K=function(){N.show.forEach(function(t){"outsideClick"===t?e.off("click",l):(e.off(t,d),e.off(t,l)),e.off("keypress",D)}),N.hide.forEach(function(t){"outsideClick"===t?s.off("click",E):e.off(t,m)})};!function(){var n=[],i=[],o=t.$eval(r[c+"Trigger"]);K(),angular.isObject(o)?(Object.keys(o).forEach(function(t){n.push(t),i.push(o[t])}),N={show:n,hide:i}):N=g(o),"none"!==N.show&&N.show.forEach(function(t,n){"outsideClick"===t?(e.on("click",l),s.on("click",E)):t===N.hide[n]?e.on(t,l):t&&(e.on(t,d),e.on(N.hide[n],m)),e.on("keypress",D)})}();var W=t.$eval(r[c+"Animation"]);q.animation=angular.isDefined(W)?!!W:f.animation;var G,Y=c+"AppendToBody";G=Y in r&&void 0===r[Y]||t.$eval(r[Y]),L=angular.isDefined(G)?G:L,t.$on("$destroy",function(){K(),k(),q=null})}}}}}]}).directive("uibTooltipTemplateTransclude",["$animate","$sce","$compile","$templateRequest",function(t,e,n,r){return{link:function(i,o,a){var s,u,l,c=i.$eval(a.tooltipTemplateTranscludeScope),p=0,d=function(){u&&(u.remove(),u=null),s&&(s.$destroy(),s=null),l&&(t.leave(l).then(function(){u=null}),u=l,l=null)};i.$watch(e.parseAsResourceUrl(a.uibTooltipTemplateTransclude),function(e){var a=++p;e?(r(e,!0).then(function(r){if(a===p){var i=c.$new(),u=n(r)(i,function(e){d(),t.enter(e,o)});l=u,(s=i).$emit("$includeContentLoaded",e)}},function(){a===p&&(d(),i.$emit("$includeContentError",e))}),i.$emit("$includeContentRequested",e)):d()}),i.$on("$destroy",d)}}}]).directive("uibTooltipClasses",["$uibPosition",function(t){return{restrict:"A",link:function(e,n,r){if(e.placement){var i=t.parsePlacement(e.placement);n.addClass(i[0])}e.popupClass&&n.addClass(e.popupClass),e.animation&&n.addClass(r.tooltipAnimationClass)}}}]).directive("uibTooltipPopup",function(){return{restrict:"A",scope:{content:"@"},templateUrl:"uib/template/tooltip/tooltip-popup.html"}}).directive("uibTooltip",["$uibTooltip",function(t){return t("uibTooltip","tooltip","mouseenter")}]).directive("uibTooltipTemplatePopup",function(){return{restrict:"A",scope:{contentExp:"&",originScope:"&"},templateUrl:"uib/template/tooltip/tooltip-template-popup.html"}}).directive("uibTooltipTemplate",["$uibTooltip",function(t){return t("uibTooltipTemplate","tooltip","mouseenter",{useContentExp:!0})}]).directive("uibTooltipHtmlPopup",function(){return{restrict:"A",scope:{contentExp:"&"},templateUrl:"uib/template/tooltip/tooltip-html-popup.html"}}).directive("uibTooltipHtml",["$uibTooltip",function(t){return t("uibTooltipHtml","tooltip","mouseenter",{useContentExp:!0})}]),angular.module("ui.bootstrap.popover",["ui.bootstrap.tooltip"]).directive("uibPopoverTemplatePopup",function(){return{restrict:"A",scope:{uibTitle:"@",contentExp:"&",originScope:"&"},templateUrl:"uib/template/popover/popover-template.html"}}).directive("uibPopoverTemplate",["$uibTooltip",function(t){return t("uibPopoverTemplate","popover","click",{useContentExp:!0})}]).directive("uibPopoverHtmlPopup",function(){return{restrict:"A",scope:{contentExp:"&",uibTitle:"@"},templateUrl:"uib/template/popover/popover-html.html"}}).directive("uibPopoverHtml",["$uibTooltip",function(t){return t("uibPopoverHtml","popover","click",{useContentExp:!0})}]).directive("uibPopoverPopup",function(){return{restrict:"A",scope:{uibTitle:"@",content:"@"},templateUrl:"uib/template/popover/popover.html"}}).directive("uibPopover",["$uibTooltip",function(t){return t("uibPopover","popover","click")}]),angular.module("ui.bootstrap.progressbar",[]).constant("uibProgressConfig",{animate:!0,max:100}).controller("UibProgressController",["$scope","$attrs","uibProgressConfig",function(t,e,n){function r(){return angular.isDefined(t.maxParam)?t.maxParam:n.max}var i=this,o=angular.isDefined(e.animate)?t.$parent.$eval(e.animate):n.animate;this.bars=[],t.max=r(),this.addBar=function(t,e,n){o||e.css({transition:"none"}),this.bars.push(t),t.max=r(),t.title=n&&angular.isDefined(n.title)?n.title:"progressbar",t.$watch("value",function(e){t.recalculatePercentage()}),t.recalculatePercentage=function(){var e=i.bars.reduce(function(t,e){return e.percent=+(100*e.value/e.max).toFixed(2),t+e.percent},0);e>100&&(t.percent-=e-100)},t.$on("$destroy",function(){e=null,i.removeBar(t)})},this.removeBar=function(t){this.bars.splice(this.bars.indexOf(t),1),this.bars.forEach(function(t){t.recalculatePercentage()})},t.$watch("maxParam",function(t){i.bars.forEach(function(t){t.max=r(),t.recalculatePercentage()})})}]).directive("uibProgress",function(){return{replace:!0,transclude:!0,controller:"UibProgressController",require:"uibProgress",scope:{maxParam:"=?max"},templateUrl:"uib/template/progressbar/progress.html"}}).directive("uibBar",function(){return{replace:!0,transclude:!0,require:"^uibProgress",scope:{value:"=",type:"@"},templateUrl:"uib/template/progressbar/bar.html",link:function(t,e,n,r){r.addBar(t,e,n)}}}).directive("uibProgressbar",function(){return{replace:!0,transclude:!0,controller:"UibProgressController",scope:{value:"=",maxParam:"=?max",type:"@"},templateUrl:"uib/template/progressbar/progressbar.html",link:function(t,e,n,r){r.addBar(t,angular.element(e.children()[0]),{title:n.title})}}}),angular.module("ui.bootstrap.rating",[]).constant("uibRatingConfig",{max:5,stateOn:null,stateOff:null,enableReset:!0,titles:["one","two","three","four","five"]}).controller("UibRatingController",["$scope","$attrs","uibRatingConfig",function(t,e,n){var r={$setViewValue:angular.noop},i=this;this.init=function(i){(r=i).$render=this.render,r.$formatters.push(function(t){return angular.isNumber(t)&&t<<0!==t&&(t=Math.round(t)),t}),this.stateOn=angular.isDefined(e.stateOn)?t.$parent.$eval(e.stateOn):n.stateOn,this.stateOff=angular.isDefined(e.stateOff)?t.$parent.$eval(e.stateOff):n.stateOff,this.enableReset=angular.isDefined(e.enableReset)?t.$parent.$eval(e.enableReset):n.enableReset;var o=angular.isDefined(e.titles)?t.$parent.$eval(e.titles):n.titles;this.titles=angular.isArray(o)&&o.length>0?o:n.titles;var a=angular.isDefined(e.ratingStates)?t.$parent.$eval(e.ratingStates):new Array(angular.isDefined(e.max)?t.$parent.$eval(e.max):n.max);t.range=this.buildTemplateObjects(a)},this.buildTemplateObjects=function(t){for(var e=0,n=t.length;e=this.titles.length?t+1:this.titles[t]},t.rate=function(e){if(!t.readonly&&e>=0&&e<=t.range.length){var n=i.enableReset&&r.$viewValue===e?0:e;r.$setViewValue(n),r.$render()}},t.enter=function(e){t.readonly||(t.value=e),t.onHover({value:e})},t.reset=function(){t.value=r.$viewValue,t.onLeave()},t.onKeydown=function(e){/(37|38|39|40)/.test(e.which)&&(e.preventDefault(),e.stopPropagation(),t.rate(t.value+(38===e.which||39===e.which?1:-1)))},this.render=function(){t.value=r.$viewValue,t.title=i.getTitle(t.value-1)}}]).directive("uibRating",function(){return{require:["uibRating","ngModel"],restrict:"A",scope:{readonly:"=?readOnly",onHover:"&",onLeave:"&"},controller:"UibRatingController",templateUrl:"uib/template/rating/rating.html",link:function(t,e,n,r){var i=r[0],o=r[1];i.init(o)}}}),angular.module("ui.bootstrap.tabs",[]).controller("UibTabsetController",["$scope",function(t){function e(t){for(var e=0;ee.index?1:t.index0&&e<13:e>=0&&e<24)&&""!==t.hours)return t.showMeridian&&(12===e&&(e=0),t.meridian===x[1]&&(e+=12)),e}function u(){var e=+t.minutes;if(e>=0&&e<60&&""!==t.minutes)return e}function l(){var e=+t.seconds;return e>=0&&e<60?e:void 0}function c(t,e){return null===t?"":angular.isDefined(t)&&t.toString().length<2&&!e?"0"+t:t.toString()}function p(t){d(),C.$setViewValue(new Date($)),f(t)}function d(){y&&y.$setValidity("hours",!0),b&&b.$setValidity("minutes",!0),w&&w.$setValidity("seconds",!0),C.$setValidity("time",!0),t.invalidHours=!1,t.invalidMinutes=!1,t.invalidSeconds=!1}function f(e){if(C.$modelValue){var n=$.getHours(),r=$.getMinutes(),i=$.getSeconds();t.showMeridian&&(n=0===n||12===n?12:n%12),t.hours="h"===e?n:c(n,!T),"m"!==e&&(t.minutes=c(r)),t.meridian=$.getHours()<12?x[0]:x[1],"s"!==e&&(t.seconds=c(i)),t.meridian=$.getHours()<12?x[0]:x[1]}else t.hours=null,t.minutes=null,t.seconds=null,t.meridian=x[0]}function h(t){$=m($,t),p()}function g(t,e){return m(t,60*e)}function m(t,e){var n=new Date(t.getTime()+1e3*e),r=new Date(t);return r.setHours(n.getHours(),n.getMinutes(),n.getSeconds()),r}function v(){return(null===t.hours||""===t.hours)&&(null===t.minutes||""===t.minutes)&&(!t.showSeconds||t.showSeconds&&(null===t.seconds||""===t.seconds))}var y,b,w,$=new Date,k=[],C={$setViewValue:angular.noop},x=angular.isDefined(n.meridians)?t.$parent.$eval(n.meridians):a.meridians||o.DATETIME_FORMATS.AMPMS,T=!angular.isDefined(n.padHours)||t.$parent.$eval(n.padHours);t.tabindex=angular.isDefined(n.tabindex)?n.tabindex:0,e.removeAttr("tabindex"),this.init=function(e,r){(C=e).$render=this.render,C.$formatters.unshift(function(t){return t?new Date(t):null});var i=r.eq(0),o=r.eq(1),s=r.eq(2);y=i.controller("ngModel"),b=o.controller("ngModel"),w=s.controller("ngModel"),(angular.isDefined(n.mousewheel)?t.$parent.$eval(n.mousewheel):a.mousewheel)&&this.setupMousewheelEvents(i,o,s),(angular.isDefined(n.arrowkeys)?t.$parent.$eval(n.arrowkeys):a.arrowkeys)&&this.setupArrowkeyEvents(i,o,s),t.readonlyInput=angular.isDefined(n.readonlyInput)?t.$parent.$eval(n.readonlyInput):a.readonlyInput,this.setupInputEvents(i,o,s)};var S=a.hourStep;n.hourStep&&k.push(t.$parent.$watch(r(n.hourStep),function(t){S=+t}));var E=a.minuteStep;n.minuteStep&&k.push(t.$parent.$watch(r(n.minuteStep),function(t){E=+t}));var D;k.push(t.$parent.$watch(r(n.min),function(t){var e=new Date(t);D=isNaN(e)?void 0:e}));var A;k.push(t.$parent.$watch(r(n.max),function(t){var e=new Date(t);A=isNaN(e)?void 0:e}));var B=!1;n.ngDisabled&&k.push(t.$parent.$watch(r(n.ngDisabled),function(t){B=t})),t.noIncrementHours=function(){var t=g($,60*S);return B||t>A||t<$&&t$&&t>A},t.noIncrementMinutes=function(){var t=g($,E);return B||t>A||t<$&&t$&&t>A},t.noIncrementSeconds=function(){var t=m($,I);return B||t>A||t<$&&t$&&t>A},t.noToggleMeridian=function(){return $.getHours()<12?B||g($,720)>A:B||g($,-720)0};e.on("mousewheel wheel",function(e){B||t.$apply(i(e)?t.incrementHours():t.decrementHours()),e.preventDefault()}),n.on("mousewheel wheel",function(e){B||t.$apply(i(e)?t.incrementMinutes():t.decrementMinutes()),e.preventDefault()}),r.on("mousewheel wheel",function(e){B||t.$apply(i(e)?t.incrementSeconds():t.decrementSeconds()),e.preventDefault()})},this.setupArrowkeyEvents=function(e,n,r){e.on("keydown",function(e){B||(38===e.which?(e.preventDefault(),t.incrementHours(),t.$apply()):40===e.which&&(e.preventDefault(),t.decrementHours(),t.$apply()))}),n.on("keydown",function(e){B||(38===e.which?(e.preventDefault(),t.incrementMinutes(),t.$apply()):40===e.which&&(e.preventDefault(),t.decrementMinutes(),t.$apply()))}),r.on("keydown",function(e){B||(38===e.which?(e.preventDefault(),t.incrementSeconds(),t.$apply()):40===e.which&&(e.preventDefault(),t.decrementSeconds(),t.$apply()))})},this.setupInputEvents=function(e,n,r){if(t.readonlyInput)return t.updateHours=angular.noop,t.updateMinutes=angular.noop,void(t.updateSeconds=angular.noop);var i=function(e,n,r){C.$setViewValue(null),C.$setValidity("time",!1),angular.isDefined(e)&&(t.invalidHours=e,y&&y.$setValidity("hours",!1)),angular.isDefined(n)&&(t.invalidMinutes=n,b&&b.$setValidity("minutes",!1)),angular.isDefined(r)&&(t.invalidSeconds=r,w&&w.$setValidity("seconds",!1))};t.updateHours=function(){var t=s(),e=u();C.$setDirty(),angular.isDefined(t)&&angular.isDefined(e)?($.setHours(t),$.setMinutes(e),$A?i(!0):p("h")):i(!0)},e.on("blur",function(e){C.$setTouched(),v()?d():null===t.hours||""===t.hours?i(!0):!t.invalidHours&&t.hours<10&&t.$apply(function(){t.hours=c(t.hours,!T)})}),t.updateMinutes=function(){var t=u(),e=s();C.$setDirty(),angular.isDefined(t)&&angular.isDefined(e)?($.setHours(e),$.setMinutes(t),$A?i(void 0,!0):p("m")):i(void 0,!0)},n.on("blur",function(e){C.$setTouched(),v()?d():null===t.minutes?i(void 0,!0):!t.invalidMinutes&&t.minutes<10&&t.$apply(function(){t.minutes=c(t.minutes)})}),t.updateSeconds=function(){var t=l();C.$setDirty(),angular.isDefined(t)?($.setSeconds(t),p("s")):i(void 0,void 0,!0)},r.on("blur",function(e){v()?d():!t.invalidSeconds&&t.seconds<10&&t.$apply(function(){t.seconds=c(t.seconds)})})},this.render=function(){var e=C.$viewValue;isNaN(e)?(C.$setValidity("time",!1),i.error('Timepicker directive: "ng-model" value must be a Date object, a number of milliseconds since 01.01.1970 or a string representing an RFC2822 or ISO 8601 date.')):(e&&($=e),$A?(C.$setValidity("time",!1),t.invalidHours=!0,t.invalidMinutes=!0):d(),f())},t.showSpinners=angular.isDefined(n.showSpinners)?t.$parent.$eval(n.showSpinners):a.showSpinners,t.incrementHours=function(){t.noIncrementHours()||h(60*S*60)},t.decrementHours=function(){t.noDecrementHours()||h(60*-S*60)},t.incrementMinutes=function(){t.noIncrementMinutes()||h(60*E)},t.decrementMinutes=function(){t.noDecrementMinutes()||h(60*-E)},t.incrementSeconds=function(){t.noIncrementSeconds()||h(I)},t.decrementSeconds=function(){t.noDecrementSeconds()||h(-I)},t.toggleMeridian=function(){var e=u(),n=s();t.noToggleMeridian()||(angular.isDefined(e)&&angular.isDefined(n)?h(720*($.getHours()<12?60:-60)):t.meridian=t.meridian===x[0]?x[1]:x[0])},t.blur=function(){C.$setTouched()},t.$on("$destroy",function(){for(;k.length;)k.shift()()})}]).directive("uibTimepicker",["uibTimepickerConfig",function(t){return{require:["uibTimepicker","?^ngModel"],restrict:"A",controller:"UibTimepickerController",controllerAs:"timepicker",scope:{},templateUrl:function(e,n){return n.templateUrl||t.templateUrl},link:function(t,e,n,r){var i=r[0],o=r[1];o&&i.init(o,e.find("input"))}}}]),angular.module("ui.bootstrap.typeahead",["ui.bootstrap.debounce","ui.bootstrap.position"]).factory("uibTypeaheadParser",["$parse",function(t){var e=/^\s*([\s\S]+?)(?:\s+as\s+([\s\S]+?))?\s+for\s+(?:([\$\w][\$\w\d]*))\s+in\s+([\s\S]+?)$/;return{parse:function(n){var r=n.match(e);if(!r)throw new Error('Expected typeahead specification in form of "_modelValue_ (as _label_)? for _item_ in _collection_" but got "'+n+'".');return{itemName:r[3],source:t(r[4]),viewMapper:t(r[2]||r[1]),modelMapper:t(r[1])}}}}]).controller("UibTypeaheadController",["$scope","$element","$attrs","$compile","$parse","$q","$timeout","$document","$window","$rootScope","$$debounce","$uibPosition","uibTypeaheadParser",function(t,e,n,r,i,o,a,s,u,l,c,p,d){function f(){q.moveInProgress||(q.moveInProgress=!0,q.$digest()),Z()}function h(){q.position=B?p.offset(e):p.position(e),q.position.top+=e.prop("offsetHeight")}function g(t){var e;return angular.version.minor<6?(e=t.$options||{}).getOption=function(t){return e[t]}:e=t.$options,e}var m,v,y=[9,13,27,38,40],b=t.$eval(n.typeaheadMinLength);b||0===b||(b=1),t.$watch(n.typeaheadMinLength,function(t){b=t||0===t?t:1});var w=t.$eval(n.typeaheadWaitMs)||0,$=!1!==t.$eval(n.typeaheadEditable);t.$watch(n.typeaheadEditable,function(t){$=!1!==t});var k,C,x=i(n.typeaheadLoading).assign||angular.noop,T=n.typeaheadShouldSelect?i(n.typeaheadShouldSelect):function(t,e){var n=e.$event;return 13===n.which||9===n.which},S=i(n.typeaheadOnSelect),E=!!angular.isDefined(n.typeaheadSelectOnBlur)&&t.$eval(n.typeaheadSelectOnBlur),D=i(n.typeaheadNoResults).assign||angular.noop,A=n.typeaheadInputFormatter?i(n.typeaheadInputFormatter):void 0,B=!!n.typeaheadAppendToBody&&t.$eval(n.typeaheadAppendToBody),I=n.typeaheadAppendTo?t.$eval(n.typeaheadAppendTo):null,O=!1!==t.$eval(n.typeaheadFocusFirst),M=!!n.typeaheadSelectOnExact&&t.$eval(n.typeaheadSelectOnExact),P=i(n.typeaheadIsOpen).assign||angular.noop,_=t.$eval(n.typeaheadShowHint)||!1,R=i(n.ngModel),L=i(n.ngModel+"($$$p)"),N=function(e,n){return angular.isFunction(R(t))&&v.getOption("getterSetter")?L(e,{$$$p:n}):R.assign(e,n)},U=d.parse(n.uibTypeahead),q=t.$new(),j=t.$on("$destroy",function(){q.$destroy()});q.$on("$destroy",j);var F="typeahead-"+q.$id+"-"+Math.floor(1e4*Math.random());e.attr({"aria-autocomplete":"list","aria-expanded":!1,"aria-owns":F});var V,z;_&&((V=angular.element("
")).css("position","relative"),e.after(V),(z=e.clone()).attr("placeholder",""),z.attr("tabindex","-1"),z.val(""),z.css({position:"absolute",top:"0px",left:"0px","border-color":"transparent","box-shadow":"none",opacity:1,background:"none 0% 0% / auto repeat scroll padding-box border-box rgb(255, 255, 255)",color:"#999"}),e.css({position:"relative","vertical-align":"top","background-color":"transparent"}),z.attr("id")&&z.removeAttr("id"),V.append(z),z.after(e));var H=angular.element("
");H.attr({id:F,matches:"matches",active:"activeIdx",select:"select(activeIdx, evt)","move-in-progress":"moveInProgress",query:"query",position:"position","assign-is-open":"assignIsOpen(isOpen)",debounce:"debounceUpdate"}),angular.isDefined(n.typeaheadTemplateUrl)&&H.attr("template-url",n.typeaheadTemplateUrl),angular.isDefined(n.typeaheadPopupTemplateUrl)&&H.attr("popup-template-url",n.typeaheadPopupTemplateUrl);var K=function(){_&&z.val("")},W=function(){q.matches=[],q.activeIdx=-1,e.attr("aria-expanded",!1),K()},G=function(t){return F+"-option-"+t};q.$watch("activeIdx",function(t){t<0?e.removeAttr("aria-activedescendant"):e.attr("aria-activedescendant",G(t))});var Y=function(t,e){return!!(q.matches.length>e&&t)&&t.toUpperCase()===q.matches[e].label.toUpperCase()},Q=function(n,r){var i={$viewValue:n};x(t,!0),D(t,!1),o.when(U.source(t,i)).then(function(o){var a=n===m.$viewValue;if(a&&k)if(o&&o.length>0){q.activeIdx=O?0:-1,D(t,!1),q.matches.length=0;for(var s=0;s0&&u.slice(0,n.length).toUpperCase()===n.toUpperCase()?z.val(n+u.slice(n.length)):z.val("")}}else W(),D(t,!0);a&&x(t,!1)},function(){W(),x(t,!1),D(t,!0)})};B&&(angular.element(u).on("resize",f),s.find("body").on("scroll",f));var Z=c(function(){q.matches.length&&h(),q.moveInProgress=!1},200);q.moveInProgress=!1,q.query=void 0;var J,X=function(t){J=a(function(){Q(t)},w)},tt=function(){J&&a.cancel(J)};W(),q.assignIsOpen=function(e){P(t,e)},q.select=function(r,i){var o,s,u={};C=!0,u[U.itemName]=s=q.matches[r].model,o=U.modelMapper(t,u),N(t,o),m.$setValidity("editable",!0),m.$setValidity("parse",!0),S(t,{$item:s,$model:o,$label:U.viewMapper(t,u),$event:i}),W(),!1!==q.$eval(n.typeaheadFocusOnSelect)&&a(function(){e[0].focus()},0,!1)},e.on("keydown",function(e){if(0!==q.matches.length&&-1!==y.indexOf(e.which)){var n=T(t,{$event:e});if(-1===q.activeIdx&&n||9===e.which&&e.shiftKey)return W(),void q.$digest();e.preventDefault();var r;switch(e.which){case 27:e.stopPropagation(),W(),t.$digest();break;case 38:q.activeIdx=(q.activeIdx>0?q.activeIdx:q.matches.length)-1,q.$digest(),(r=H[0].querySelectorAll(".uib-typeahead-match")[q.activeIdx]).parentNode.scrollTop=r.offsetTop;break;case 40:q.activeIdx=(q.activeIdx+1)%q.matches.length,q.$digest(),(r=H[0].querySelectorAll(".uib-typeahead-match")[q.activeIdx]).parentNode.scrollTop=r.offsetTop;break;default:n&&q.$apply(function(){angular.isNumber(q.debounceUpdate)||angular.isObject(q.debounceUpdate)?c(function(){q.select(q.activeIdx,e)},angular.isNumber(q.debounceUpdate)?q.debounceUpdate:q.debounceUpdate.default):q.select(q.activeIdx,e)})}}}),e.on("focus",function(t){k=!0,0!==b||m.$viewValue||a(function(){Q(m.$viewValue,t)},0)}),e.on("blur",function(t){E&&q.matches.length&&-1!==q.activeIdx&&!C&&(C=!0,q.$apply(function(){angular.isObject(q.debounceUpdate)&&angular.isNumber(q.debounceUpdate.blur)?c(function(){q.select(q.activeIdx,t)},q.debounceUpdate.blur):q.select(q.activeIdx,t)})),!$&&m.$error.editable&&(m.$setViewValue(),q.$apply(function(){m.$setValidity("editable",!0),m.$setValidity("parse",!0)}),e.val("")),k=!1,C=!1});var et=function(n){e[0]!==n.target&&3!==n.which&&0!==q.matches.length&&(W(),l.$$phase||t.$digest())};s.on("click",et),t.$on("$destroy",function(){s.off("click",et),(B||I)&&nt.remove(),B&&(angular.element(u).off("resize",f),s.find("body").off("scroll",f)),H.remove(),_&&V.remove()});var nt=r(H)(q);B?s.find("body").append(nt):I?angular.element(I).eq(0).append(nt):e.after(nt),this.init=function(e){v=g(m=e),q.debounceUpdate=i(v.getOption("debounce"))(t),m.$parsers.unshift(function(e){return k=!0,0===b||e&&e.length>=b?w>0?(tt(),X(e)):Q(e):(x(t,!1),tt(),W()),$?e:e?void m.$setValidity("editable",!1):(m.$setValidity("editable",!0),null)}),m.$formatters.push(function(e){var n,r,i={};return $||m.$setValidity("editable",!0),A?(i.$model=e,A(t,i)):(i[U.itemName]=e,n=U.viewMapper(t,i),i[U.itemName]=void 0,r=U.viewMapper(t,i),n!==r?n:e)})}}]).directive("uibTypeahead",function(){return{controller:"UibTypeaheadController",require:["ngModel","uibTypeahead"],link:function(t,e,n,r){r[1].init(r[0])}}}).directive("uibTypeaheadPopup",["$$debounce",function(t){return{scope:{matches:"=",query:"=",active:"=",position:"&",moveInProgress:"=",select:"&",assignIsOpen:"&",debounce:"&"},replace:!0,templateUrl:function(t,e){return e.popupTemplateUrl||"uib/template/typeahead/typeahead-popup.html"},link:function(e,n,r){e.templateUrl=r.templateUrl,e.isOpen=function(){var t=e.matches.length>0;return e.assignIsOpen({isOpen:t}),t},e.isActive=function(t){return e.active===t},e.selectActive=function(t){e.active=t},e.selectMatch=function(n,r){var i=e.debounce();angular.isNumber(i)||angular.isObject(i)?t(function(){e.select({activeIdx:n,evt:r})},angular.isNumber(i)?i:i.default):e.select({activeIdx:n,evt:r})}}}}]).directive("uibTypeaheadMatch",["$templateRequest","$compile","$parse",function(t,e,n){return{scope:{index:"=",match:"=",query:"="},link:function(r,i,o){var a=n(o.templateUrl)(r.$parent)||"uib/template/typeahead/typeahead-match.html";t(a).then(function(t){var n=angular.element(t.trim());i.replaceWith(n),e(n)(r)})}}}]).filter("uibTypeaheadHighlight",["$sce","$injector","$log",function(t,e,n){function r(t){return t.replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1")}function i(t){return/<.*>/g.test(t)}var o;return o=e.has("$sanitize"),function(e,a){return!o&&i(e)&&n.warn("Unsafe use of typeahead please use ngSanitize"),e=a?(""+e).replace(new RegExp(r(a),"gi"),"$&"):e,o||(e=t.trustAsHtml(e)),e}}]),angular.module("uib/template/accordion/accordion-group.html",[]).run(["$templateCache",function(t){t.put("uib/template/accordion/accordion-group.html",'\n
\n
\n
\n')}]),angular.module("uib/template/accordion/accordion.html",[]).run(["$templateCache",function(t){t.put("uib/template/accordion/accordion.html",'
')}]),angular.module("uib/template/alert/alert.html",[]).run(["$templateCache",function(t){t.put("uib/template/alert/alert.html",'\n
\n')}]),angular.module("uib/template/carousel/carousel.html",[]).run(["$templateCache",function(t){t.put("uib/template/carousel/carousel.html",'\n\n \n previous\n\n\n \n next\n\n\n')}]),angular.module("uib/template/carousel/slide.html",[]).run(["$templateCache",function(t){t.put("uib/template/carousel/slide.html",'
\n')}]),angular.module("uib/template/datepicker/datepicker.html",[]).run(["$templateCache",function(t){t.put("uib/template/datepicker/datepicker.html",'
\n
\n
\n
\n
\n')}]),angular.module("uib/template/datepicker/day.html",[]).run(["$templateCache",function(t){t.put("uib/template/datepicker/day.html",'\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
{{::label.abbr}}
{{ weekNumbers[$index] }}\n \n
\n')}]),angular.module("uib/template/datepicker/month.html",[]).run(["$templateCache",function(t){t.put("uib/template/datepicker/month.html",'\n \n \n \n \n \n \n \n \n \n \n \n \n
\n \n
\n')}]),angular.module("uib/template/datepicker/year.html",[]).run(["$templateCache",function(t){t.put("uib/template/datepicker/year.html",'\n \n \n \n \n \n \n \n \n \n \n \n \n
\n \n
\n')}]),angular.module("uib/template/datepickerPopup/popup.html",[]).run(["$templateCache",function(t){t.put("uib/template/datepickerPopup/popup.html",'\n')}]),angular.module("uib/template/modal/window.html",[]).run(["$templateCache",function(t){t.put("uib/template/modal/window.html","
\n")}]),angular.module("uib/template/pager/pager.html",[]).run(["$templateCache",function(t){t.put("uib/template/pager/pager.html",'
  • {{::getText(\'previous\')}}
  • \n
  • {{::getText(\'next\')}}
  • \n')}]),angular.module("uib/template/pagination/pagination.html",[]).run(["$templateCache",function(t){t.put("uib/template/pagination/pagination.html",'\n\n\n\n\n')}]),angular.module("uib/template/tooltip/tooltip-html-popup.html",[]).run(["$templateCache",function(t){t.put("uib/template/tooltip/tooltip-html-popup.html",'
    \n
    \n')}]),angular.module("uib/template/tooltip/tooltip-popup.html",[]).run(["$templateCache",function(t){t.put("uib/template/tooltip/tooltip-popup.html",'
    \n
    \n')}]),angular.module("uib/template/tooltip/tooltip-template-popup.html",[]).run(["$templateCache",function(t){t.put("uib/template/tooltip/tooltip-template-popup.html",'
    \n
    \n')}]),angular.module("uib/template/popover/popover-html.html",[]).run(["$templateCache",function(t){t.put("uib/template/popover/popover-html.html",'
    \n\n
    \n

    \n
    \n
    \n')}]),angular.module("uib/template/popover/popover-template.html",[]).run(["$templateCache",function(t){t.put("uib/template/popover/popover-template.html",'
    \n\n
    \n

    \n
    \n
    \n')}]),angular.module("uib/template/popover/popover.html",[]).run(["$templateCache",function(t){t.put("uib/template/popover/popover.html",'
    \n\n
    \n

    \n
    \n
    \n')}]),angular.module("uib/template/progressbar/bar.html",[]).run(["$templateCache",function(t){t.put("uib/template/progressbar/bar.html",'
    \n')}]),angular.module("uib/template/progressbar/progress.html",[]).run(["$templateCache",function(t){t.put("uib/template/progressbar/progress.html",'
    ')}]),angular.module("uib/template/progressbar/progressbar.html",[]).run(["$templateCache",function(t){t.put("uib/template/progressbar/progressbar.html",'
    \n
    \n
    \n')}]),angular.module("uib/template/rating/rating.html",[]).run(["$templateCache",function(t){t.put("uib/template/rating/rating.html",'\n ({{ $index < value ? \'*\' : \' \' }})\n \n\n')}]),angular.module("uib/template/tabs/tab.html",[]).run(["$templateCache",function(t){t.put("uib/template/tabs/tab.html",'\n')}]),angular.module("uib/template/tabs/tabset.html",[]).run(["$templateCache",function(t){t.put("uib/template/tabs/tabset.html",'
    \n \n
    \n
    \n
    \n
    \n
    \n')}]),angular.module("uib/template/timepicker/timepicker.html",[]).run(["$templateCache",function(t){t.put("uib/template/timepicker/timepicker.html",'\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
      
    \n \n :\n \n :\n \n
      
    \n')}]),angular.module("uib/template/typeahead/typeahead-match.html",[]).run(["$templateCache",function(t){t.put("uib/template/typeahead/typeahead-match.html",'\n')}]),angular.module("uib/template/typeahead/typeahead-popup.html",[]).run(["$templateCache",function(t){t.put("uib/template/typeahead/typeahead-popup.html",'\n')}]),angular.module("ui.bootstrap.carousel").run(function(){!angular.$$csp().noInlineStyle&&!angular.$$uibCarouselCss&&angular.element(document).find("head").prepend(''),angular.$$uibCarouselCss=!0}),angular.module("ui.bootstrap.datepicker").run(function(){!angular.$$csp().noInlineStyle&&!angular.$$uibDatepickerCss&&angular.element(document).find("head").prepend(''),angular.$$uibDatepickerCss=!0}),angular.module("ui.bootstrap.position").run(function(){!angular.$$csp().noInlineStyle&&!angular.$$uibPositionCss&&angular.element(document).find("head").prepend(''),angular.$$uibPositionCss=!0}),angular.module("ui.bootstrap.datepickerPopup").run(function(){!angular.$$csp().noInlineStyle&&!angular.$$uibDatepickerpopupCss&&angular.element(document).find("head").prepend(''),angular.$$uibDatepickerpopupCss=!0}),angular.module("ui.bootstrap.tooltip").run(function(){!angular.$$csp().noInlineStyle&&!angular.$$uibTooltipCss&&angular.element(document).find("head").prepend(''),angular.$$uibTooltipCss=!0}),angular.module("ui.bootstrap.timepicker").run(function(){!angular.$$csp().noInlineStyle&&!angular.$$uibTimepickerCss&&angular.element(document).find("head").prepend(''),angular.$$uibTimepickerCss=!0}),angular.module("ui.bootstrap.typeahead").run(function(){!angular.$$csp().noInlineStyle&&!angular.$$uibTypeaheadCss&&angular.element(document).find("head").prepend(''),angular.$$uibTypeaheadCss=!0}),"undefined"!=typeof module&&"undefined"!=typeof exports&&module.exports===exports&&(module.exports="ui.router"),function(t,e,n){"use strict";function r(t,e){return V(new(V(function(){},{prototype:t})),e)}function i(t){return F(arguments,function(e){e!==t&&F(e,function(e,n){t.hasOwnProperty(n)||(t[n]=e)})}),t}function o(t,e){var n=[];for(var r in t.path){if(t.path[r]!==e.path[r])break;n.push(t.path[r])}return n}function a(t){if(Object.keys)return Object.keys(t);var e=[];return F(t,function(t,n){e.push(n)}),e}function s(t,e){if(Array.prototype.indexOf)return t.indexOf(e,Number(arguments[2])||0);var n=t.length>>>0,r=Number(arguments[2])||0;for((r=r<0?Math.ceil(r):Math.floor(r))<0&&(r+=n);r=0||(c.push(i[d]),l[i[d]]=t[i[d]]);return V({},l,e)}function l(t,e,n){if(!n){n=[];for(var r in t)n.push(r)}for(var i=0;i "));if(b[n]=r,U(t))v.push(n,[function(){return e.get(t)}],l);else{var i=e.annotate(t);F(i,function(t){t!==n&&u.hasOwnProperty(t)&&f(u[t],t)}),v.push(n,t,i)}y.pop(),b[n]=o}}function h(t){return q(t)&&t.then&&t.$$promises}if(!q(u))throw new Error("'invocables' must be an object");var m=a(u||{}),v=[],y=[],b={};return F(u,f),u=y=b=null,function(r,o,a){function s(){--w||($||i(b,o.$$values),f.$$values=b,f.$$promises=f.$$promises||!0,delete f.$$inheritedValues,l.resolve(b))}function u(t){f.$$failure=t,l.reject(t)}if(h(r)&&a===n&&(a=o,o=r,r=null),r){if(!q(r))throw new Error("'locals' must be an object")}else r=c;if(o){if(!h(o))throw new Error("'parent' must be a promise returned by $resolve.resolve()")}else o=p;var l=t.defer(),f=g(l.promise),y=f.$$promises={},b=V({},r),w=1+v.length/3,$=!1;if(g(f),L(o.$$failure))return u(o.$$failure),f;o.$$inheritedValues&&i(b,d(o.$$inheritedValues,m)),V(y,o.$$promises),o.$$values?($=i(b,d(o.$$values,m)),f.$$inheritedValues=d(o.$$values,m),s()):(o.$$inheritedValues&&(f.$$inheritedValues=d(o.$$inheritedValues,m)),o.then(s,u));for(var k=0,C=v.length;k=0);)y=o(v.id,v.type,v.cfg,"path"),p+=a(v.segment,y.type.pattern.source,y.squash,y.isOptional),f.push(v.segment),d=l.lastIndex;var w=(b=t.substring(d)).indexOf("?");if(w>=0){var $=this.sourceSearch=b.substring(w);if(b=b.substring(0,w),this.sourcePath=t.substring(0,d+w),$.length>0)for(d=0;u=c.exec($);)y=o((v=s(u,!0)).id,v.type,v.cfg,"search"),d=l.lastIndex}else this.sourcePath=t,this.sourceSearch="";p+=a(b)+(!1===e.strict?"/?":"")+"$",f.push(b),this.regexp=new RegExp(p,e.caseInsensitive?"i":n),this.prefix=f[0],this.$$paramNames=m}function b(t){V(this,t)}function w(){function t(t){return null!=t?t.toString().replace(/(~|\/)/g,function(t){return{"~":"~~","/":"~2F"}[t]}):t}function i(){return{strict:d,caseInsensitive:p}}function o(t){return N(t)||j(t)&&N(t[t.length-1])}function u(){for(;$.length;){var t=$.shift();if(t.pattern)throw new Error("You cannot override a type's .pattern at runtime.");e.extend(m[t.name],c.invoke(t.def))}}function l(t){V(this,t||{})}K=this;var c,p=!1,d=!0,g=!1,m={},v=!0,$=[],k={string:{encode:t,decode:function(t){return null!=t?t.toString().replace(/(~~|~2F)/g,function(t){return{"~~":"~","~2F":"/"}[t]}):t},is:function(t){return null==t||!L(t)||"string"==typeof t},pattern:/[^/]*/},int:{encode:t,decode:function(t){return parseInt(t,10)},is:function(t){return t!==n&&null!==t&&this.decode(t.toString())===t},pattern:/\d+/},bool:{encode:function(t){return t?1:0},decode:function(t){return 0!==parseInt(t,10)},is:function(t){return!0===t||!1===t},pattern:/0|1/},date:{encode:function(t){return this.is(t)?[t.getFullYear(),("0"+(t.getMonth()+1)).slice(-2),("0"+t.getDate()).slice(-2)].join("-"):n},decode:function(t){if(this.is(t))return t;var e=this.capture.exec(t);return e?new Date(e[1],e[2]-1,e[3]):n},is:function(t){return t instanceof Date&&!isNaN(t.valueOf())},equals:function(t,e){return this.is(t)&&this.is(e)&&t.toISOString()===e.toISOString()},pattern:/[0-9]{4}-(?:0[1-9]|1[0-2])-(?:0[1-9]|[1-2][0-9]|3[0-1])/,capture:/([0-9]{4})-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])/},json:{encode:e.toJson,decode:e.fromJson,is:e.isObject,equals:e.equals,pattern:/[^/]*/},any:{encode:e.identity,decode:e.identity,equals:e.equals,pattern:/.*/}};w.$$getDefaultValue=function(t){if(!o(t.value))return t.value;if(!c)throw new Error("Injectable functions cannot be called at configuration time");return c.invoke(t.value)},this.caseInsensitive=function(t){return L(t)&&(p=t),p},this.strictMode=function(t){return L(t)&&(d=t),d},this.defaultSquashPolicy=function(t){if(!L(t))return g;if(!0!==t&&!1!==t&&!U(t))throw new Error("Invalid squash policy: "+t+". Valid policies: false, true, arbitrary-string");return g=t,t},this.compile=function(t,e){return new y(t,V(i(),e))},this.isMatcher=function(t){if(!q(t))return!1;var e=!0;return F(y.prototype,function(n,r){N(n)&&(e=e&&L(t[r])&&N(t[r]))}),e},this.type=function(t,e,n){if(!L(e))return m[t];if(m.hasOwnProperty(t))throw new Error("A type named '"+t+"' has already been defined.");return m[t]=new b(V({name:t},e)),n&&($.push({name:t,def:n}),v||u()),this},F(k,function(t,e){m[e]=new b(V({name:e},t))}),m=r(m,{}),this.$get=["$injector",function(t){return c=t,v=!1,u(),F(k,function(t,e){m[e]||(m[e]=new b(t))}),this}],this.Param=function(t,r,i,u){function l(){if(!c)throw new Error("Injectable functions cannot be called at configuration time");var t=c.invoke(i.$$fn);if(null!==t&&t!==n&&!p.type.is(t))throw new Error("Default value ("+t+") for parameter '"+p.id+"' is not an instance of Type ("+p.type.name+")");return t}var p=this;i=function(t){var e=q(t)?a(t):[];return-1===s(e,"value")&&-1===s(e,"type")&&-1===s(e,"squash")&&-1===s(e,"array")&&(t={value:t}),t.$$fn=o(t.value)?t.value:function(){return t.value},t}(i),r=function(n,r,i){if(n.type&&r)throw new Error("Param '"+t+"' has two type configurations.");return r||(n.type?e.isString(n.type)?m[n.type]:n.type instanceof b?n.type:new b(n.type):"config"===i?m.any:m.string)}(i,r,u);var d=function(){var e={array:"search"===u&&"auto"},n=t.match(/\[\]$/)?{array:!0}:{};return V(e,n,i).array}();"string"!==(r=d?r.$asArray(d,"search"===u):r).name||d||"path"!==u||i.value!==n||(i.value="");var v=i.value!==n,y=function(t,e){var n=t.squash;if(!e||!1===n)return!1;if(!L(n)||null==n)return g;if(!0===n||U(n))return n;throw new Error("Invalid squash policy: '"+n+"'. Valid policies: false, true, or arbitrary string")}(i,v),w=function(t,e,r,i){var o,a,u=[{from:"",to:r||e?n:""},{from:null,to:r||e?n:""}];return o=j(t.replace)?t.replace:[],U(i)&&o.push({from:i,to:n}),a=h(o,function(t){return t.from}),f(u,function(t){return-1===s(a,t.from)}).concat(o)}(i,d,v,y);V(this,{id:t,type:r,location:u,array:d,squash:y,replace:w,isOptional:v,value:function(t){function e(t){return function(e){return e.from===t}}return t=function(t){var n=h(f(p.replace,e(t)),function(t){return t.to});return n.length?n[0]:t}(t),L(t)?p.type.$normalize(t):l()},dynamic:n,config:i,toString:function(){return"{Param:"+t+" "+r+" squash: '"+y+"' optional: "+v+"}"}})},l.prototype={$$new:function(){return r(this,V(new l,{$$parent:this}))},$$keys:function(){for(var t=[],e=[],n=this,r=a(l.prototype);n;)e.push(n),n=n.$$parent;return e.reverse(),F(e,function(e){F(a(e),function(e){-1===s(t,e)&&-1===s(r,e)&&t.push(e)})}),t},$$values:function(t){var e={},n=this;return F(n.$$keys(),function(r){e[r]=n[r].value(t&&t[r])}),e},$$equals:function(t,e){var n=!0,r=this;return F(r.$$keys(),function(i){var o=t&&t[i],a=e&&e[i];r[i].type.equals(o,a)||(n=!1)}),n},$$validates:function(t){var r,i,o,a,s,u=this.$$keys();for(r=0;r=0)throw new Error("State must have a valid name");if(x.hasOwnProperty(n))throw new Error("State '"+n+"' is already defined");var i=-1!==n.indexOf(".")?n.substring(0,n.lastIndexOf(".")):U(e.parent)?e.parent:q(e.parent)&&U(e.parent.name)?e.parent.name:"";if(i&&!x[i])return f(i,e.self);for(var o in E)N(E[o])&&(e[o]=E[o](e,E.$delegates[o]));return x[n]=e,!e[S]&&e.url&&t.when(e.url,["$match","$stateParams",function(t,n){C.$current.navigable==e&&l(t,n)||C.transitionTo(e,t,{inherit:!0,location:!1})}]),m(n),e}function y(t){return t.indexOf("*")>-1}function b(t){for(var e=t.split("."),n=C.$current.name.split("."),r=0,i=e.length;r=O;r--)(a=m[r]).self.onExit&&s.invoke(a.self.onExit,a.self,a.locals.globals),a.locals=null;for(r=O;r2?l.enter(t,null,n).then(r):l.enter(t,null,n,r)},leave:function(t,n){e.version.minor>2?l.leave(t).then(n):l.leave(t,n)}};if(u){var r=u&&u(n,t);return{enter:function(t,e,n){r.enter(t,null,e),n()},leave:function(t,e){r.leave(t),e()}}}return{enter:function(t,e,n){e.after(t),n()},leave:function(t,e){t.remove(),e()}}}var s=n.has?function(t){return n.has(t)?n.get(t):null}:function(t){try{return n.get(t)}catch(t){return null}},u=s("$animator"),l=s("$animate");return{restrict:"ECA",terminal:!0,priority:400,transclude:"element",compile:function(n,s,u){return function(n,s,l){function c(){if(d&&(d.remove(),d=null),h&&(h.$destroy(),h=null),f){var t=f.data("$uiViewAnim");y.leave(f,function(){t.$$animLeave.resolve(),d=null}),d=f,f=null}}function p(a){var p,d=S(n,l,s,i),b=d&&t.$current&&t.$current.locals[d];if(a||b!==g){p=n.$new(),g=t.$current.locals[d],p.$emit("$viewContentLoading",d);var w=u(p,function(t){var i=o.defer(),a=o.defer(),u={$animEnter:i.promise,$animLeave:a.promise,$$animLeave:a};t.data("$uiViewAnim",u),y.enter(t,s,function(){i.resolve(),h&&h.$emit("$viewContentAnimationEnded"),(e.isDefined(v)&&!v||n.$eval(v))&&r(t)}),c()});f=w,(h=p).$emit("$viewContentLoaded",d),h.$eval(m)}}var d,f,h,g,m=l.onload||"",v=l.autoscroll,y=a(l,n);s.inheritedData("$uiView");n.$on("$stateChangeSuccess",function(){p(!1)}),p(!0)}}}}function T(t,n,r,i){return{restrict:"ECA",priority:-400,compile:function(o){var a=o.html();return o.empty?o.empty():o[0].innerHTML=null,function(o,s,u){var l=r.$current,c=S(o,u,s,i),p=l&&l.locals[c];if(!p)return s.html(a),void t(s.contents())(o);s.data("$uiView",{name:c,state:p.$$state}),s.html(p.$template?p.$template:a);var d=e.extend({},p);o[p.$$resolveAs]=d;var f=t(s.contents());if(p.$$controller){p.$scope=o,p.$element=s;var h=n(p.$$controller,p);p.$$controllerAs&&(o[p.$$controllerAs]=h,o[p.$$controllerAs][p.$$resolveAs]=d),N(h.$onInit)&&h.$onInit(),s.data("$ngControllerController",h),s.children().data("$ngControllerController",h)}f(o)}}}}function S(t,e,n,r){var i=r(e.uiView||e.name||"")(t),o=n.inheritedData("$uiView");return i.indexOf("@")>=0?i:i+"@"+(o?o.state.name:"")}function E(t,e){var n,r=t.match(/^\s*({[^}]*})\s*$/);if(r&&(t=e+"("+r[1]+")"),!(n=t.replace(/\n/g," ").match(/^([^(]+?)\s*(\((.*)\))?$/))||4!==n.length)throw new Error("Invalid state ref '"+t+"'");return{state:n[1],paramExpr:n[3]||null}}function D(t){var e=t.parent().inheritedData("$uiView");if(e&&e.state&&e.state.name)return e.state}function A(t){var e="[object SVGAnimatedString]"===Object.prototype.toString.call(t.prop("href")),n="FORM"===t[0].nodeName;return{attr:n?"action":e?"xlink:href":"href",isAnchor:"A"===t.prop("tagName").toUpperCase(),clickable:!n}}function B(t,e,n,r,i){return function(o){var a=o.which||o.button,s=i();if(!(a>1||o.ctrlKey||o.metaKey||o.shiftKey||t.attr("target"))){var u=n(function(){e.go(s.state,s.params,s.options)});o.preventDefault();var l=r.isAnchor&&!s.href?1:0;o.preventDefault=function(){l--<=0&&n.cancel(u)}}}}function I(t,e){return{relative:D(t)||e.$current,inherit:!0}}function O(t,n){return{restrict:"A",require:["?^uiSrefActive","?^uiSrefActiveEq"],link:function(r,i,o,a){var s,u=E(o.uiSref,t.current.name),l={state:u.state,href:null,params:null},c=A(i),p=a[1]||a[0],d=null;l.options=V(I(i,t),o.uiSrefOpts?r.$eval(o.uiSrefOpts):{});var f=function(n){n&&(l.params=e.copy(n)),l.href=t.href(u.state,l.params,l.options),d&&d(),p&&(d=p.$$addStateInfo(u.state,l.params)),null!==l.href&&o.$set(c.attr,l.href)};u.paramExpr&&(r.$watch(u.paramExpr,function(t){t!==l.params&&f(t)},!0),l.params=e.copy(r.$eval(u.paramExpr))),f(),c.clickable&&(s=B(i,t,n,c,function(){return l}),i[i.on?"on":"bind"]("click",s),r.$on("$destroy",function(){i[i.off?"off":"unbind"]("click",s)}))}}}function M(t,e){return{restrict:"A",require:["?^uiSrefActive","?^uiSrefActiveEq"],link:function(n,r,i,o){function a(e){p.state=e[0],p.params=e[1],p.options=e[2],p.href=t.href(p.state,p.params,p.options),d&&d(),l&&(d=l.$$addStateInfo(p.state,p.params)),p.href&&i.$set(u.attr,p.href)}var s,u=A(r),l=o[1]||o[0],c="["+[i.uiState,i.uiStateParams||null,i.uiStateOpts||null].map(function(t){return t||"null"}).join(", ")+"]",p={state:null,params:null,options:null,href:null},d=null;n.$watch(c,a,!0),a(n.$eval(c)),u.clickable&&(s=B(r,t,e,u,function(){return p}),r[r.on?"on":"bind"]("click",s),n.$on("$destroy",function(){r[r.off?"off":"unbind"]("click",s)}))}}}function P(t,e,n){return{restrict:"A",controller:["$scope","$element","$attrs","$timeout",function(e,r,i,o){function a(e,n,i){var o=t.get(e,D(r)),a=s(e,n),u={state:o||{name:e},params:n,hash:a};return g.push(u),m[a]=i,function(){var t=g.indexOf(u);-1!==t&&g.splice(t,1)}}function s(t,n){if(!U(t))throw new Error("state should be a string");return q(n)?t+H(n):(n=e.$eval(n),q(n)?t+H(n):t)}function u(){for(var t=0;t0)){var n=a(t,e,h);return u(),n}},e.$on("$stateChangeSuccess",u),u()}]}}function _(t){var e=function(e,n){return t.is(e,n)};return e.$stateful=!0,e}function R(t){var e=function(e,n,r){return t.includes(e,n,r)};return e.$stateful=!0,e}var L=e.isDefined,N=e.isFunction,U=e.isString,q=e.isObject,j=e.isArray,F=e.forEach,V=e.extend,z=e.copy,H=e.toJson;e.module("ui.router.util",["ng"]),e.module("ui.router.router",["ui.router.util"]),e.module("ui.router.state",["ui.router.router","ui.router.util"]),e.module("ui.router",["ui.router.state"]),e.module("ui.router.compat",["ui.router"]),m.$inject=["$q","$injector"],e.module("ui.router.util").service("$resolve",m),e.module("ui.router.util").provider("$templateFactory",function(){var t=e.version.minor<3;this.shouldUnsafelyUseHttp=function(e){t=!!e},this.$get=["$http","$templateCache","$injector",function(e,n,r){return new v(e,n,r,t)}]});var K;y.prototype.concat=function(t,e){var n={caseInsensitive:K.caseInsensitive(),strict:K.strictMode(),squash:K.defaultSquashPolicy()};return new y(this.sourcePath+t+this.sourceSearch,V(n,e),this)},y.prototype.toString=function(){return this.source},y.prototype.exec=function(t,e){var n=this.regexp.exec(t);if(!n)return null;e=e||{};var r,i,o,a=this.parameters(),s=a.length,u=this.segments.length-1,l={};if(u!==n.length-1)throw new Error("Unbalanced capture group in route '"+this.source+"'");var c,p;for(r=0;r-1&&n.settings.ga.enhancedEcommerce)switch(t){case"ecommerce:addTransaction":t=["ec:setAction","purchase"];break;case"ecommerce:addItem":t="ec:addProduct",r.id=r.sku;break;case"ecommerce:send":t="send",r.hitType="event",r.eventCategory="Angulartics Enhanced Ecommerce",r.eventAction="Purchase",r.nonInteraction=!0}o(t instanceof Array?t.concat(r):[t,r],i)}),a?function(t,e,r){var i=n.settings.ga.additionalAccountHitTypes[t];a(e,r,i)}:e.noop}()}])}(window,window.angular),function(t,e){if("function"==typeof define&&define.amd)define([],e);else if("object"==typeof module&&module.exports)module.exports=e();else{var n=e();n._onReady(n.init),t.Duo=n}}(this,function(){function t(t,e){throw new Error("Duo Web SDK error: "+t+(e?"\nSee "+e+" for more information":""))}function e(t){return t.replace(/([a-z])([A-Z])/,"$1-$2").toLowerCase()}function n(t,n){return"dataset"in t?t.dataset[n]:t.getAttribute("data-"+e(n))}function r(t,e,n,r){"addEventListener"in window?t.addEventListener(e,r,!1):t.attachEvent(n,r)}function i(t,e,n,r){"removeEventListener"in window?t.removeEventListener(e,r,!1):t.detachEvent(n,r)}function o(t){r(document,"DOMContentLoaded","onreadystatechange",t)}function a(t){i(document,"DOMContentLoaded","onreadystatechange",t)}function s(t){r(window,"message","onmessage",t)}function u(t){i(window,"message","onmessage",t)}function l(e){if(e){0===e.indexOf("ERR|")&&t(e.split("|")[1]),-1!==e.indexOf(":")&&2===e.split(":").length||t("Duo was given a bad token. This might indicate a configuration problem with one of Duo's client libraries.","https://www.duosecurity.com/docs/duoweb#first-steps");var n=e.split(":");return y=e,b=n[0],w=n[1],{sigRequest:e,duoSig:n[0],appSig:n[1]}}}function c(){if(!($=document.getElementById(E)))throw new Error('This page does not contain an iframe for Duo to use.Add an element like to this page. See https://www.duosecurity.com/docs/duoweb#3.-show-the-iframe for more information.');g(),a(c)}function p(t){return Boolean(t.origin==="https://"+v&&"string"==typeof t.data&&(t.data.match(C)||t.data.match(x)||t.data.match(T)))}function d(t){t&&(t.host&&(v=t.host),t.sig_request&&l(t.sig_request),t.post_action&&(D=t.post_action),t.post_argument&&(A=t.post_argument),t.iframe&&(t.iframe.tagName?$=t.iframe:"string"==typeof t.iframe&&(E=t.iframe)),"function"==typeof t.submit_callback&&(k=t.submit_callback)),($=document.getElementById(E))?g():o(c),a(d)}function f(t){if(p(t))if(t.data.match(T)){var e=t.data.substring("DUO_OPEN_WINDOW|".length);h(e)&&window.open(e,"_self")}else m(t.data),u(f)}function h(t){if(!t)return!1;var e=document.createElement("a");if(e.href=t,"duotrustedendpoints:"===e.protocol)return!0;if("https:"!==e.protocol)return!1;for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{};this.action=t.action,this.container=t.container,this.emitter=t.emitter,this.target=t.target,this.text=t.text,this.trigger=t.trigger,this.selectedText=""}},{key:"initSelection",value:function(){this.text?this.selectFake():this.target&&this.selectTarget()}},{key:"selectFake",value:function(){var t=this,e="rtl"==document.documentElement.getAttribute("dir");this.removeFake(),this.fakeHandlerCallback=function(){return t.removeFake()},this.fakeHandler=this.container.addEventListener("click",this.fakeHandlerCallback)||!0,this.fakeElem=document.createElement("textarea"),this.fakeElem.style.fontSize="12pt",this.fakeElem.style.border="0",this.fakeElem.style.padding="0",this.fakeElem.style.margin="0",this.fakeElem.style.position="absolute",this.fakeElem.style[e?"right":"left"]="-9999px";var n=window.pageYOffset||document.documentElement.scrollTop;this.fakeElem.style.top=n+"px",this.fakeElem.setAttribute("readonly",""),this.fakeElem.value=this.text,this.container.appendChild(this.fakeElem),this.selectedText=(0,r.default)(this.fakeElem),this.copyText()}},{key:"removeFake",value:function(){this.fakeHandler&&(this.container.removeEventListener("click",this.fakeHandlerCallback),this.fakeHandler=null,this.fakeHandlerCallback=null),this.fakeElem&&(this.container.removeChild(this.fakeElem),this.fakeElem=null)}},{key:"selectTarget",value:function(){this.selectedText=(0,r.default)(this.target),this.copyText()}},{key:"copyText",value:function(){var t=void 0;try{t=document.execCommand(this.action)}catch(e){t=!1}this.handleResult(t)}},{key:"handleResult",value:function(t){this.emitter.emit(t?"success":"error",{action:this.action,text:this.selectedText,trigger:this.trigger,clearSelection:this.clearSelection.bind(this)})}},{key:"clearSelection",value:function(){this.trigger&&this.trigger.focus(),window.getSelection().removeAllRanges()}},{key:"destroy",value:function(){this.removeFake()}},{key:"action",set:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"copy";if(this._action=t,"copy"!==this._action&&"cut"!==this._action)throw new Error('Invalid "action" value, use either "copy" or "cut"')},get:function(){return this._action}},{key:"target",set:function(t){if(void 0!==t){if(!t||"object"!==(void 0===t?"undefined":i(t))||1!==t.nodeType)throw new Error('Invalid "target" value, use a valid Element');if("copy"===this.action&&t.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');if("cut"===this.action&&(t.hasAttribute("readonly")||t.hasAttribute("disabled")))throw new Error('Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes');this._target=t}},get:function(){return this._target}}]),t}();t.exports=a})},{select:5}],8:[function(t,e,n){!function(r,i){if(void 0!==n)i(e,t("./clipboard-action"),t("tiny-emitter"),t("good-listener"));else{var o={exports:{}};i(o,r.clipboardAction,r.tinyEmitter,r.goodListener),r.clipboard=o.exports}}(this,function(t,e,n,r){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a(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 s(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)}function u(t,e){var n="data-clipboard-"+t;if(e.hasAttribute(n))return e.getAttribute(n)}var l=i(e),c=i(n),p=i(r),d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},f=function(){function t(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{};this.action="function"==typeof t.action?t.action:this.defaultAction,this.target="function"==typeof t.target?t.target:this.defaultTarget,this.text="function"==typeof t.text?t.text:this.defaultText,this.container="object"===d(t.container)?t.container:document.body}},{key:"listenClick",value:function(t){var e=this;this.listener=(0,p.default)(t,"click",function(t){return e.onClick(t)})}},{key:"onClick",value:function(t){var e=t.delegateTarget||t.currentTarget;this.clipboardAction&&(this.clipboardAction=null),this.clipboardAction=new l.default({action:this.action(e),target:this.target(e),text:this.text(e),container:this.container,trigger:e,emitter:this})}},{key:"defaultAction",value:function(t){return u("action",t)}},{key:"defaultTarget",value:function(t){var e=u("target",t);if(e)return document.querySelector(e)}},{key:"defaultText",value:function(t){return u("text",t)}},{key:"destroy",value:function(){this.listener.destroy(),this.clipboardAction&&(this.clipboardAction.destroy(),this.clipboardAction=null)}}],[{key:"isSupported",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:["copy","cut"],e="string"==typeof t?[t]:t,n=!!document.queryCommandSupported;return e.forEach(function(t){n=n&&!!document.queryCommandSupported(t)}),n}}]),e}();t.exports=h})},{"./clipboard-action":7,"good-listener":4,"tiny-emitter":6}]},{},[8])(8)}),function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.forge=e():t.forge=e()}(this,function(){return function(t){function e(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,e),i.l=!0,i.exports}var n={};return e.m=t,e.c=n,e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:r})},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=10)}([function(t,e){t.exports={options:{usePureJavaScript:!1}}},function(t,e,n){function r(t){if(8!==t&&16!==t&&24!==t&&32!==t)throw new Error("Only 8, 16, 24, or 32 bits supported: "+t)}function i(t){if(this.data="",this.read=0,"string"==typeof t)this.data=t;else if(a.isArrayBuffer(t)||a.isArrayBufferView(t)){var e=new Uint8Array(t);try{this.data=String.fromCharCode.apply(null,e)}catch(t){for(var n=0;n15?(n=Date.now(),o(t)):(e.push(t),1===e.length&&i.setAttribute("a",r=!r))}}a.nextTick=a.setImmediate}(),a.isNodejs="undefined"!=typeof process&&process.versions&&process.versions.node,a.isArray=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)},a.isArrayBuffer=function(t){return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer},a.isArrayBufferView=function(t){return t&&a.isArrayBuffer(t.buffer)&&void 0!==t.byteLength},a.ByteBuffer=i,a.ByteStringBuffer=i;a.ByteStringBuffer.prototype._optimizeConstructedString=function(t){this._constructedStringLength+=t,this._constructedStringLength>4096&&(this.data.substr(0,1),this._constructedStringLength=0)},a.ByteStringBuffer.prototype.length=function(){return this.data.length-this.read},a.ByteStringBuffer.prototype.isEmpty=function(){return this.length()<=0},a.ByteStringBuffer.prototype.putByte=function(t){return this.putBytes(String.fromCharCode(t))},a.ByteStringBuffer.prototype.fillWithByte=function(t,e){t=String.fromCharCode(t);for(var n=this.data;e>0;)1&e&&(n+=t),(e>>>=1)>0&&(t+=t);return this.data=n,this._optimizeConstructedString(e),this},a.ByteStringBuffer.prototype.putBytes=function(t){return this.data+=t,this._optimizeConstructedString(t.length),this},a.ByteStringBuffer.prototype.putString=function(t){return this.putBytes(a.encodeUtf8(t))},a.ByteStringBuffer.prototype.putInt16=function(t){return this.putBytes(String.fromCharCode(t>>8&255)+String.fromCharCode(255&t))},a.ByteStringBuffer.prototype.putInt24=function(t){return this.putBytes(String.fromCharCode(t>>16&255)+String.fromCharCode(t>>8&255)+String.fromCharCode(255&t))},a.ByteStringBuffer.prototype.putInt32=function(t){return this.putBytes(String.fromCharCode(t>>24&255)+String.fromCharCode(t>>16&255)+String.fromCharCode(t>>8&255)+String.fromCharCode(255&t))},a.ByteStringBuffer.prototype.putInt16Le=function(t){return this.putBytes(String.fromCharCode(255&t)+String.fromCharCode(t>>8&255))},a.ByteStringBuffer.prototype.putInt24Le=function(t){return this.putBytes(String.fromCharCode(255&t)+String.fromCharCode(t>>8&255)+String.fromCharCode(t>>16&255))},a.ByteStringBuffer.prototype.putInt32Le=function(t){return this.putBytes(String.fromCharCode(255&t)+String.fromCharCode(t>>8&255)+String.fromCharCode(t>>16&255)+String.fromCharCode(t>>24&255))},a.ByteStringBuffer.prototype.putInt=function(t,e){r(e);var n="";do{e-=8,n+=String.fromCharCode(t>>e&255)}while(e>0);return this.putBytes(n)},a.ByteStringBuffer.prototype.putSignedInt=function(t,e){return t<0&&(t+=2<0);return e},a.ByteStringBuffer.prototype.getSignedInt=function(t){var e=this.getInt(t),n=2<=n&&(e-=n<<1),e},a.ByteStringBuffer.prototype.getBytes=function(t){var e;return t?(t=Math.min(this.length(),t),e=this.data.slice(this.read,this.read+t),this.read+=t):0===t?e="":(e=0===this.read?this.data:this.data.slice(this.read),this.clear()),e},a.ByteStringBuffer.prototype.bytes=function(t){return void 0===t?this.data.slice(this.read):this.data.slice(this.read,this.read+t)},a.ByteStringBuffer.prototype.at=function(t){return this.data.charCodeAt(this.read+t)},a.ByteStringBuffer.prototype.setAt=function(t,e){return this.data=this.data.substr(0,this.read+t)+String.fromCharCode(e)+this.data.substr(this.read+t+1),this},a.ByteStringBuffer.prototype.last=function(){return this.data.charCodeAt(this.data.length-1)},a.ByteStringBuffer.prototype.copy=function(){var t=a.createBuffer(this.data);return t.read=this.read,t},a.ByteStringBuffer.prototype.compact=function(){return this.read>0&&(this.data=this.data.slice(this.read),this.read=0),this},a.ByteStringBuffer.prototype.clear=function(){return this.data="",this.read=0,this},a.ByteStringBuffer.prototype.truncate=function(t){var e=Math.max(0,this.length()-t);return this.data=this.data.substr(this.read,e),this.read=0,this},a.ByteStringBuffer.prototype.toHex=function(){for(var t="",e=this.read;e=t)return this;e=Math.max(e||this.growSize,t);var n=new Uint8Array(this.data.buffer,this.data.byteOffset,this.data.byteLength),r=new Uint8Array(this.length()+e);return r.set(n),this.data=new DataView(r.buffer),this},a.DataBuffer.prototype.putByte=function(t){return this.accommodate(1),this.data.setUint8(this.write++,t),this},a.DataBuffer.prototype.fillWithByte=function(t,e){this.accommodate(e);for(var n=0;n>8&65535),this.data.setInt8(this.write,t>>16&255),this.write+=3,this},a.DataBuffer.prototype.putInt32=function(t){return this.accommodate(4),this.data.setInt32(this.write,t),this.write+=4,this},a.DataBuffer.prototype.putInt16Le=function(t){return this.accommodate(2),this.data.setInt16(this.write,t,!0),this.write+=2,this},a.DataBuffer.prototype.putInt24Le=function(t){return this.accommodate(3),this.data.setInt8(this.write,t>>16&255),this.data.setInt16(this.write,t>>8&65535,!0),this.write+=3,this},a.DataBuffer.prototype.putInt32Le=function(t){return this.accommodate(4),this.data.setInt32(this.write,t,!0),this.write+=4,this},a.DataBuffer.prototype.putInt=function(t,e){r(e),this.accommodate(e/8);do{e-=8,this.data.setInt8(this.write++,t>>e&255)}while(e>0);return this},a.DataBuffer.prototype.putSignedInt=function(t,e){return r(e),this.accommodate(e/8),t<0&&(t+=2<0);return e},a.DataBuffer.prototype.getSignedInt=function(t){var e=this.getInt(t),n=2<=n&&(e-=n<<1),e},a.DataBuffer.prototype.getBytes=function(t){var e;return t?(t=Math.min(this.length(),t),e=this.data.slice(this.read,this.read+t),this.read+=t):0===t?e="":(e=0===this.read?this.data:this.data.slice(this.read),this.clear()),e},a.DataBuffer.prototype.bytes=function(t){return void 0===t?this.data.slice(this.read):this.data.slice(this.read,this.read+t)},a.DataBuffer.prototype.at=function(t){return this.data.getUint8(this.read+t)},a.DataBuffer.prototype.setAt=function(t,e){return this.data.setUint8(t,e),this},a.DataBuffer.prototype.last=function(){return this.data.getUint8(this.write-1)},a.DataBuffer.prototype.copy=function(){return new a.DataBuffer(this)},a.DataBuffer.prototype.compact=function(){if(this.read>0){var t=new Uint8Array(this.data.buffer,this.read),e=new Uint8Array(t.byteLength);e.set(t),this.data=new DataView(e),this.write-=this.read,this.read=0}return this},a.DataBuffer.prototype.clear=function(){return this.data=new DataView(new ArrayBuffer(0)),this.read=this.write=0,this},a.DataBuffer.prototype.truncate=function(t){return this.write=Math.max(0,this.length()-t),this.read=Math.min(this.read,this.write),this},a.DataBuffer.prototype.toHex=function(){for(var t="",e=this.read;e0;)1&e&&(n+=t),(e>>>=1)>0&&(t+=t);return n},a.xorBytes=function(t,e,n){for(var r="",i="",o="",a=0,s=0;n>0;--n,++a)i=t.charCodeAt(a)^e.charCodeAt(a),s>=10&&(r+=o,o="",s=0),o+=String.fromCharCode(i),++s;return r+=o},a.hexToBytes=function(t){var e="",n=0;for(!0&t.length&&(n=1,e+=String.fromCharCode(parseInt(t[0],16)));n>24&255)+String.fromCharCode(t>>16&255)+String.fromCharCode(t>>8&255)+String.fromCharCode(255&t)};var s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",u=[62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,64,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51];a.encode64=function(t,e){for(var n,r,i,o="",a="",u=0;u>2),o+=s.charAt((3&n)<<4|r>>4),isNaN(r)?o+="==":(o+=s.charAt((15&r)<<2|i>>6),o+=isNaN(i)?"=":s.charAt(63&i)),e&&o.length>e&&(a+=o.substr(0,e)+"\r\n",o=o.substr(e));return a+=o},a.decode64=function(t){t=t.replace(/[^A-Za-z0-9\+\/\=]/g,"");for(var e,n,r,i,o="",a=0;a>4),64!==r&&(o+=String.fromCharCode((15&n)<<4|r>>2),64!==i&&(o+=String.fromCharCode((3&r)<<6|i)));return o},a.encodeUtf8=function(t){return unescape(encodeURIComponent(t))},a.decodeUtf8=function(t){return decodeURIComponent(escape(t))},a.binary={raw:{},hex:{},base64:{}},a.binary.raw.encode=function(t){return String.fromCharCode.apply(null,t)},a.binary.raw.decode=function(t,e,n){var r=e;r||(r=new Uint8Array(t.length));for(var i=n=n||0,o=0;o>2),o+=s.charAt((3&n)<<4|r>>4),isNaN(r)?o+="==":(o+=s.charAt((15&r)<<2|i>>6),o+=isNaN(i)?"=":s.charAt(63&i)),e&&o.length>e&&(a+=o.substr(0,e)+"\r\n",o=o.substr(e));return a+=o},a.binary.base64.decode=function(t,e,n){var r=e;r||(r=new Uint8Array(3*Math.ceil(t.length/4))),t=t.replace(/[^A-Za-z0-9\+\/\=]/g,"");for(var i,o,a,s,l=0,c=n=n||0;l>4,64!==a&&(r[c++]=(15&o)<<4|a>>2,64!==s&&(r[c++]=(3&a)<<6|s));return e?c-n:r.subarray(0,c)},a.text={utf8:{},utf16:{}},a.text.utf8.encode=function(t,e,n){t=a.encodeUtf8(t);var r=e;r||(r=new Uint8Array(t.length));for(var i=n=n||0,o=0;o0?(i=n[r].substring(0,a),o=n[r].substring(a+1)):(i=n[r],o=null),i in e||(e[i]=[]),i in Object.prototype||null===o||e[i].push(unescape(o))}return e};return void 0===t?(null===m&&(m="undefined"!=typeof window&&window.location&&window.location.search?n(window.location.search.substring(1)):{}),e=m):e=n(t),e},a.parseFragment=function(t){var e=t,n="",r=t.indexOf("?");r>0&&(e=t.substring(0,r),n=t.substring(r+1));var i=e.split("/");return i.length>0&&""===i[0]&&i.shift(),{pathString:e,queryString:n,path:i,query:""===n?{}:a.getQueryVariables(n)}},a.makeRequest=function(t){var e=a.parseFragment(t),n={path:e.pathString,query:e.queryString,getPath:function(t){return void 0===t?e.path:e.path[t]},getQuery:function(t,n){var r;return void 0===t?r=e.query:(r=e.query[t])&&void 0!==n&&(r=r[n]),r},getQueryLast:function(t,e){var r=n.getQuery(t);return r?r[r.length-1]:e}};return n},a.makeLink=function(t,e,n){t=jQuery.isArray(t)?t.join("/"):t;var r=jQuery.param(e||{});return n=n||"",t+(r.length>0?"?"+r:"")+(n.length>0?"#"+n:"")},a.setPath=function(t,e,n){if("object"==typeof t&&null!==t)for(var r=0,i=e.length;r0&&o.push(n),a=r.lastIndex;var s=e[0][1];switch(s){case"s":case"o":i");break;case"%":o.push("%");break;default:o.push("<%"+s+"?>")}}return o.push(t.substring(a)),o.join("")},a.formatNumber=function(t,e,n,r){var i=t,o=isNaN(e=Math.abs(e))?2:e,a=void 0===n?",":n,s=void 0===r?".":r,u=i<0?"-":"",l=parseInt(i=Math.abs(+i||0).toFixed(o),10)+"",c=l.length>3?l.length%3:0;return u+(c?l.substr(0,c)+s:"")+l.substr(c).replace(/(\d{3})(?=\d)/g,"$1"+s)+(o?a+Math.abs(i-l).toFixed(o).slice(2):"")},a.formatSize=function(t){return t=t>=1073741824?a.formatNumber(t/1073741824,2,".","")+" GiB":t>=1048576?a.formatNumber(t/1048576,2,".","")+" MiB":t>=1024?a.formatNumber(t/1024,0)+" KiB":a.formatNumber(t,0)+" bytes"},a.bytesFromIP=function(t){return-1!==t.indexOf(".")?a.bytesFromIPv4(t):-1!==t.indexOf(":")?a.bytesFromIPv6(t):null},a.bytesFromIPv4=function(t){if(4!==(t=t.split(".")).length)return null;for(var e=a.createBuffer(),n=0;nn[r].end-n[r].start&&(r=n.length-1)):n.push({start:u,end:u})}e.push(o)}if(n.length>0){var l=n[r];l.end-l.start>0&&(e.splice(l.start,l.end-l.start+1,""),0===l.start&&e.unshift(""),7===l.end&&e.push(""))}return e.join(":")},a.estimateCores=function(t,e){function n(t,s,u){if(0===s){var l=Math.floor(t.reduce(function(t,e){return t+e},0)/t.length);return a.cores=Math.max(1,l),URL.revokeObjectURL(o),e(null,a.cores)}r(u,function(e,r){t.push(i(u,r)),n(t,s-1,u)})}function r(t,e){for(var n=[],r=[],i=0;is.st&&i.sti.st&&s.st0)return a.cores=navigator.hardwareConcurrency,e(null,a.cores);if("undefined"==typeof Worker)return a.cores=1,e(null,a.cores);if("undefined"==typeof Blob)return a.cores=2,e(null,a.cores);var o=URL.createObjectURL(new Blob(["(",function(){self.addEventListener("message",function(t){for(var e=Date.now(),n=e+4;Date.now()e.blockLength&&(e.start(),e.update(a.bytes()),a=e.digest()),n=r.util.createBuffer(),i=r.util.createBuffer(),s=a.length();for(l=0;l>8^255&o^99,l[g]=o,c[o]=g,s=(a=t[o])<<24^o<<16^o<<8^o^a,u=((n=t[g])^(r=t[n])^(i=t[r]))<<24^(g^i)<<16^(g^r^i)<<8^g^n^i;for(var v=0;v<4;++v)d[v][g]=s,f[v][o]=u,s=s<<24|s>>>8,u=u<<24|u>>>8;0===g?g=m=1:(g=n^t[t[t[n^i]]],m^=t[t[m]])}}function o(t,e){for(var n,r=t.slice(0),i=1,o=r.length,a=g*(o+6+1),s=o;s>>16&255]<<24^l[n>>>8&255]<<16^l[255&n]<<8^l[n>>>24]^p[i]<<24,i++):o>6&&s%o==4&&(n=l[n>>>24]<<24^l[n>>>16&255]<<16^l[n>>>8&255]<<8^l[255&n]),r[s]=r[s-o]^n;if(e){for(var u,c=f[0],d=f[1],h=f[2],m=f[3],v=r.slice(0),s=0,y=(a=r.length)-g;s>>24]]^d[l[u>>>16&255]]^h[l[u>>>8&255]]^m[l[255&u]];r=v}return r}function a(t,e,n,r){var i,o,a,s,u,p=t.length/4-1;r?(i=f[0],o=f[1],a=f[2],s=f[3],u=c):(i=d[0],o=d[1],a=d[2],s=d[3],u=l);var h,g,m,v,y,b,w;h=e[0]^t[0],g=e[r?3:1]^t[1],m=e[2]^t[2],v=e[r?1:3]^t[3];for(var $=3,k=1;k>>24]^o[g>>>16&255]^a[m>>>8&255]^s[255&v]^t[++$],b=i[g>>>24]^o[m>>>16&255]^a[v>>>8&255]^s[255&h]^t[++$],w=i[m>>>24]^o[v>>>16&255]^a[h>>>8&255]^s[255&g]^t[++$],v=i[v>>>24]^o[h>>>16&255]^a[g>>>8&255]^s[255&m]^t[++$],h=y,g=b,m=w;n[0]=u[h>>>24]<<24^u[g>>>16&255]<<16^u[m>>>8&255]<<8^u[255&v]^t[++$],n[r?3:1]=u[g>>>24]<<24^u[m>>>16&255]<<16^u[v>>>8&255]<<8^u[255&h]^t[++$],n[2]=u[m>>>24]<<24^u[v>>>16&255]<<16^u[h>>>8&255]<<8^u[255&g]^t[++$],n[r?1:3]=u[v>>>24]<<24^u[h>>>16&255]<<16^u[g>>>8&255]<<8^u[255&m]^t[++$]}function s(t){var e,n="AES-"+((t=t||{}).mode||"CBC").toUpperCase(),r=(e=t.decrypt?u.cipher.createDecipher(n,t.key):u.cipher.createCipher(n,t.key)).start;return e.start=function(t,n){var i=null;n instanceof u.util.ByteBuffer&&(i=n,n={}),(n=n||{}).output=i,n.iv=t,r.call(e,n)},e}var u=n(0);n(12),n(13),n(1),t.exports=u.aes=u.aes||{},u.aes.startEncrypting=function(t,e,n,r){var i=s({key:t,output:n,decrypt:!1,mode:r});return i.start(e),i},u.aes.createEncryptionCipher=function(t,e){return s({key:t,output:null,decrypt:!1,mode:e})},u.aes.startDecrypting=function(t,e,n,r){var i=s({key:t,output:n,decrypt:!0,mode:r});return i.start(e),i},u.aes.createDecryptionCipher=function(t,e){return s({key:t,output:null,decrypt:!0,mode:e})},u.aes.Algorithm=function(t,e){h||i();var n=this;n.name=t,n.mode=new e({blockSize:16,cipher:{encrypt:function(t,e){return a(n._w,t,e,!1)},decrypt:function(t,e){return a(n._w,t,e,!0)}}}),n._init=!1},u.aes.Algorithm.prototype.initialize=function(t){if(!this._init){var e,n=t.key;if("string"!=typeof n||16!==n.length&&24!==n.length&&32!==n.length){if(u.util.isArray(n)&&(16===n.length||24===n.length||32===n.length)){e=n,n=u.util.createBuffer();for(i=0;i>>=2;for(var i=0;i>14;--o>=0;){var u=16383&this.data[t],l=this.data[t++]>>14,c=s*u+l*a;i=((u=a*u+((16383&c)<<14)+n.data[r]+i)>>28)+(c>>14)+s*l,n.data[r++]=268435455&u}return i}function a(t){return S.charAt(t)}function s(t,e){var n=E[t.charCodeAt(e)];return null==n?-1:n}function u(t){var e=i();return e.fromInt(t),e}function l(t){var e,n=1;return 0!=(e=t>>>16)&&(t=e,n+=16),0!=(e=t>>8)&&(t=e,n+=8),0!=(e=t>>4)&&(t=e,n+=4),0!=(e=t>>2)&&(t=e,n+=2),0!=(e=t>>1)&&(t=e,n+=1),n}function c(t){this.m=t}function p(t){this.m=t,this.mp=t.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<>=16,e+=16),0==(255&t)&&(t>>=8,e+=8),0==(15&t)&&(t>>=4,e+=4),0==(3&t)&&(t>>=2,e+=2),0==(1&t)&&++e,e}function v(t){for(var e=0;0!=t;)t&=t-1,++e;return e}function y(){}function b(t){return t}function w(t){this.r2=i(),this.q3=i(),r.ONE.dlShiftTo(2*t.t,this.r2),this.mu=this.r2.divide(t),this.m=t}function $(){return{nextBytes:function(t){for(var e=0;e>15;--o>=0;){var u=32767&this.data[t],l=this.data[t++]>>15,c=s*u+l*a;i=((u=a*u+((32767&c)<<15)+n.data[r]+(1073741823&i))>>>30)+(c>>>15)+s*l+(i>>>30),n.data[r++]=1073741823&u}return i},C=30):"Netscape"!=navigator.appName?(r.prototype.am=function(t,e,n,r,i,o){for(;--o>=0;){var a=e*this.data[t++]+n.data[r]+i;i=Math.floor(a/67108864),n.data[r++]=67108863&a}return i},C=26):(r.prototype.am=o,C=28),r.prototype.DB=C,r.prototype.DM=(1<=0?t.mod(this.m):t},c.prototype.revert=function(t){return t},c.prototype.reduce=function(t){t.divRemTo(this.m,null,t)},c.prototype.mulTo=function(t,e,n){t.multiplyTo(e,n),this.reduce(n)},c.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)},p.prototype.convert=function(t){var e=i();return t.abs().dlShiftTo(this.m.t,e),e.divRemTo(this.m,null,e),t.s<0&&e.compareTo(r.ZERO)>0&&this.m.subTo(e,e),e},p.prototype.revert=function(t){var e=i();return t.copyTo(e),this.reduce(e),e},p.prototype.reduce=function(t){for(;t.t<=this.mt2;)t.data[t.t++]=0;for(var e=0;e>15)*this.mpl&this.um)<<15)&t.DM;for(n=e+this.m.t,t.data[n]+=this.m.am(0,r,t,e,0,this.m.t);t.data[n]>=t.DV;)t.data[n]-=t.DV,t.data[++n]++}t.clamp(),t.drShiftTo(this.m.t,t),t.compareTo(this.m)>=0&&t.subTo(this.m,t)},p.prototype.mulTo=function(t,e,n){t.multiplyTo(e,n),this.reduce(n)},p.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)},r.prototype.copyTo=function(t){for(var e=this.t-1;e>=0;--e)t.data[e]=this.data[e];t.t=this.t,t.s=this.s},r.prototype.fromInt=function(t){this.t=1,this.s=t<0?-1:0,t>0?this.data[0]=t:t<-1?this.data[0]=t+this.DV:this.t=0},r.prototype.fromString=function(t,e){var n;if(16==e)n=4;else if(8==e)n=3;else if(256==e)n=8;else if(2==e)n=1;else if(32==e)n=5;else{if(4!=e)return void this.fromRadix(t,e);n=2}this.t=0,this.s=0;for(var i=t.length,o=!1,a=0;--i>=0;){var u=8==n?255&t[i]:s(t,i);u<0?"-"==t.charAt(i)&&(o=!0):(o=!1,0==a?this.data[this.t++]=u:a+n>this.DB?(this.data[this.t-1]|=(u&(1<>this.DB-a):this.data[this.t-1]|=u<=this.DB&&(a-=this.DB))}8==n&&0!=(128&t[0])&&(this.s=-1,a>0&&(this.data[this.t-1]|=(1<0&&this.data[this.t-1]==t;)--this.t},r.prototype.dlShiftTo=function(t,e){var n;for(n=this.t-1;n>=0;--n)e.data[n+t]=this.data[n];for(n=t-1;n>=0;--n)e.data[n]=0;e.t=this.t+t,e.s=this.s},r.prototype.drShiftTo=function(t,e){for(var n=t;n=0;--n)e.data[n+a+1]=this.data[n]>>i|s,s=(this.data[n]&o)<=0;--n)e.data[n]=0;e.data[a]=s,e.t=this.t+a+1,e.s=this.s,e.clamp()},r.prototype.rShiftTo=function(t,e){e.s=this.s;var n=Math.floor(t/this.DB);if(n>=this.t)e.t=0;else{var r=t%this.DB,i=this.DB-r,o=(1<>r;for(var a=n+1;a>r;r>0&&(e.data[this.t-n-1]|=(this.s&o)<>=this.DB;if(t.t>=this.DB;r+=this.s}else{for(r+=this.s;n>=this.DB;r-=t.s}e.s=r<0?-1:0,r<-1?e.data[n++]=this.DV+r:r>0&&(e.data[n++]=r),e.t=n,e.clamp()},r.prototype.multiplyTo=function(t,e){var n=this.abs(),i=t.abs(),o=n.t;for(e.t=o+i.t;--o>=0;)e.data[o]=0;for(o=0;o=0;)t.data[n]=0;for(n=0;n=e.DV&&(t.data[n+e.t]-=e.DV,t.data[n+e.t+1]=1)}t.t>0&&(t.data[t.t-1]+=e.am(n,e.data[n],t,2*n,0,1)),t.s=0,t.clamp()},r.prototype.divRemTo=function(t,e,n){var o=t.abs();if(!(o.t<=0)){var a=this.abs();if(a.t0?(o.lShiftTo(p,s),a.lShiftTo(p,n)):(o.copyTo(s),a.copyTo(n));var d=s.t,f=s.data[d-1];if(0!=f){var h=f*(1<1?s.data[d-2]>>this.F2:0),g=this.FV/h,m=(1<=0&&(n.data[n.t++]=1,n.subTo(w,n)),r.ONE.dlShiftTo(d,w),w.subTo(s,s);s.t=0;){var $=n.data[--y]==f?this.DM:Math.floor(n.data[y]*g+(n.data[y-1]+v)*m);if((n.data[y]+=s.am(0,$,n,b,0,d))<$)for(s.dlShiftTo(b,w),n.subTo(w,n);n.data[y]<--$;)n.subTo(w,n)}null!=e&&(n.drShiftTo(d,e),u!=c&&r.ZERO.subTo(e,e)),n.t=d,n.clamp(),p>0&&n.rShiftTo(p,n),u<0&&r.ZERO.subTo(n,n)}}},r.prototype.invDigit=function(){if(this.t<1)return 0;var t=this.data[0];if(0==(1&t))return 0;var e=3&t;return e=e*(2-(15&t)*e)&15,e=e*(2-(255&t)*e)&255,e=e*(2-((65535&t)*e&65535))&65535,(e=e*(2-t*e%this.DV)%this.DV)>0?this.DV-e:-e},r.prototype.isEven=function(){return 0==(this.t>0?1&this.data[0]:this.s)},r.prototype.exp=function(t,e){if(t>4294967295||t<1)return r.ONE;var n=i(),o=i(),a=e.convert(this),s=l(t)-1;for(a.copyTo(n);--s>=0;)if(e.sqrTo(n,o),(t&1<0)e.mulTo(o,a,n);else{var u=n;n=o,o=u}return e.revert(n)},r.prototype.toString=function(t){if(this.s<0)return"-"+this.negate().toString(t);var e;if(16==t)e=4;else if(8==t)e=3;else if(2==t)e=1;else if(32==t)e=5;else{if(4!=t)return this.toRadix(t);e=2}var n,r=(1<0)for(u>u)>0&&(i=!0,o=a(n));s>=0;)u>(u+=this.DB-e)):(n=this.data[s]>>(u-=e)&r,u<=0&&(u+=this.DB,--s)),n>0&&(i=!0),i&&(o+=a(n));return i?o:"0"},r.prototype.negate=function(){var t=i();return r.ZERO.subTo(this,t),t},r.prototype.abs=function(){return this.s<0?this.negate():this},r.prototype.compareTo=function(t){var e=this.s-t.s;if(0!=e)return e;var n=this.t;if(0!=(e=n-t.t))return this.s<0?-e:e;for(;--n>=0;)if(0!=(e=this.data[n]-t.data[n]))return e;return 0},r.prototype.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+l(this.data[this.t-1]^this.s&this.DM)},r.prototype.mod=function(t){var e=i();return this.abs().divRemTo(t,null,e),this.s<0&&e.compareTo(r.ZERO)>0&&t.subTo(e,e),e},r.prototype.modPowInt=function(t,e){var n;return n=t<256||e.isEven()?new c(e):new p(e),this.exp(t,n)},r.ZERO=u(0),r.ONE=u(1),y.prototype.convert=b,y.prototype.revert=b,y.prototype.mulTo=function(t,e,n){t.multiplyTo(e,n)},y.prototype.sqrTo=function(t,e){t.squareTo(e)},w.prototype.convert=function(t){if(t.s<0||t.t>2*this.m.t)return t.mod(this.m);if(t.compareTo(this.m)<0)return t;var e=i();return t.copyTo(e),this.reduce(e),e},w.prototype.revert=function(t){return t},w.prototype.reduce=function(t){for(t.drShiftTo(this.m.t-1,this.r2),t.t>this.m.t+1&&(t.t=this.m.t+1,t.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);t.compareTo(this.r2)<0;)t.dAddOffset(1,this.m.t+1);for(t.subTo(this.r2,t);t.compareTo(this.m)>=0;)t.subTo(this.m,t)},w.prototype.mulTo=function(t,e,n){t.multiplyTo(e,n),this.reduce(n)},w.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)};var D=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509],A=(1<<26)/D[D.length-1];r.prototype.chunkSize=function(t){return Math.floor(Math.LN2*this.DB/Math.log(t))},r.prototype.toRadix=function(t){if(null==t&&(t=10),0==this.signum()||t<2||t>36)return"0";var e=this.chunkSize(t),n=Math.pow(t,e),r=u(n),o=i(),a=i(),s="";for(this.divRemTo(r,o,a);o.signum()>0;)s=(n+a.intValue()).toString(t).substr(1)+s,o.divRemTo(r,o,a);return a.intValue().toString(t)+s},r.prototype.fromRadix=function(t,e){this.fromInt(0),null==e&&(e=10);for(var n=this.chunkSize(e),i=Math.pow(e,n),o=!1,a=0,u=0,l=0;l=n&&(this.dMultiply(i),this.dAddOffset(u,0),a=0,u=0))}a>0&&(this.dMultiply(Math.pow(e,a)),this.dAddOffset(u,0)),o&&r.ZERO.subTo(this,this)},r.prototype.fromNumber=function(t,e,n){if("number"==typeof e)if(t<2)this.fromInt(1);else for(this.fromNumber(t,n),this.testBit(t-1)||this.bitwiseTo(r.ONE.shiftLeft(t-1),f,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(e);)this.dAddOffset(2,0),this.bitLength()>t&&this.subTo(r.ONE.shiftLeft(t-1),this);else{var i=new Array,o=7&t;i.length=1+(t>>3),e.nextBytes(i),o>0?i[0]&=(1<>=this.DB;if(t.t>=this.DB;r+=this.s}else{for(r+=this.s;n>=this.DB;r+=t.s}e.s=r<0?-1:0,r>0?e.data[n++]=r:r<-1&&(e.data[n++]=this.DV+r),e.t=n,e.clamp()},r.prototype.dMultiply=function(t){this.data[this.t]=this.am(0,t-1,this,0,0,this.t),++this.t,this.clamp()},r.prototype.dAddOffset=function(t,e){if(0!=t){for(;this.t<=e;)this.data[this.t++]=0;for(this.data[e]+=t;this.data[e]>=this.DV;)this.data[e]-=this.DV,++e>=this.t&&(this.data[this.t++]=0),++this.data[e]}},r.prototype.multiplyLowerTo=function(t,e,n){var r=Math.min(this.t+t.t,e);for(n.s=0,n.t=r;r>0;)n.data[--r]=0;var i;for(i=n.t-this.t;r=0;)n.data[r]=0;for(r=Math.max(e-this.t,0);r0)if(0==e)n=this.data[0]%t;else for(var r=this.t-1;r>=0;--r)n=(e*n+this.data[r])%t;return n},r.prototype.millerRabin=function(t){var e=this.subtract(r.ONE),n=e.getLowestSetBit();if(n<=0)return!1;for(var i,o=e.shiftRight(n),a=$(),s=0;s=0);var u=i.modPow(o,this);if(0!=u.compareTo(r.ONE)&&0!=u.compareTo(e)){for(var l=1;l++>24},r.prototype.shortValue=function(){return 0==this.t?this.s:this.data[0]<<16>>16},r.prototype.signum=function(){return this.s<0?-1:this.t<=0||1==this.t&&this.data[0]<=0?0:1},r.prototype.toByteArray=function(){var t=this.t,e=new Array;e[0]=this.s;var n,r=this.DB-t*this.DB%8,i=0;if(t-- >0)for(r>r)!=(this.s&this.DM)>>r&&(e[i++]=n|this.s<=0;)r<8?(n=(this.data[t]&(1<>(r+=this.DB-8)):(n=this.data[t]>>(r-=8)&255,r<=0&&(r+=this.DB,--t)),0!=(128&n)&&(n|=-256),0==i&&(128&this.s)!=(128&n)&&++i,(i>0||n!=this.s)&&(e[i++]=n);return e},r.prototype.equals=function(t){return 0==this.compareTo(t)},r.prototype.min=function(t){return this.compareTo(t)<0?this:t},r.prototype.max=function(t){return this.compareTo(t)>0?this:t},r.prototype.and=function(t){var e=i();return this.bitwiseTo(t,d,e),e},r.prototype.or=function(t){var e=i();return this.bitwiseTo(t,f,e),e},r.prototype.xor=function(t){var e=i();return this.bitwiseTo(t,h,e),e},r.prototype.andNot=function(t){var e=i();return this.bitwiseTo(t,g,e),e},r.prototype.not=function(){for(var t=i(),e=0;e=this.t?0!=this.s:0!=(this.data[e]&1<1){var g=i();for(r.sqrTo(s[1],g);d<=h;)s[d]=i(),r.mulTo(g,s[d-2],s[d]),d+=2}var m,v,y=t.t-1,b=!0,$=i();for(o=l(t.data[y])-1;y>=0;){for(o>=f?m=t.data[y]>>o-f&h:(m=(t.data[y]&(1<0&&(m|=t.data[y-1]>>this.DB+o-f)),d=n;0==(1&m);)m>>=1,--d;if((o-=d)<0&&(o+=this.DB,--y),b)s[m].copyTo(a),b=!1;else{for(;d>1;)r.sqrTo(a,$),r.sqrTo($,a),d-=2;d>0?r.sqrTo(a,$):(v=a,a=$,$=v),r.mulTo($,s[m],a)}for(;y>=0&&0==(t.data[y]&1<=0?(n.subTo(i,n),e&&o.subTo(s,o),a.subTo(l,a)):(i.subTo(n,i),e&&s.subTo(o,s),l.subTo(a,l))}return 0!=i.compareTo(r.ONE)?r.ZERO:l.compareTo(t)>=0?l.subtract(t):l.signum()<0?(l.addTo(t,l),l.signum()<0?l.add(t):l):l},r.prototype.pow=function(t){return this.exp(t,new y)},r.prototype.gcd=function(t){var e=this.s<0?this.negate():this.clone(),n=t.s<0?t.negate():t.clone();if(e.compareTo(n)<0){var r=e;e=n,n=r}var i=e.getLowestSetBit(),o=n.getLowestSetBit();if(o<0)return e;for(i0&&(e.rShiftTo(o,e),n.rShiftTo(o,n));e.signum()>0;)(i=e.getLowestSetBit())>0&&e.rShiftTo(i,e),(i=n.getLowestSetBit())>0&&n.rShiftTo(i,n),e.compareTo(n)>=0?(e.subTo(n,e),e.rShiftTo(1,e)):(n.subTo(e,n),n.rShiftTo(1,n));return o>0&&n.lShiftTo(o,n),n},r.prototype.isProbablePrime=function(t){var e,n=this.abs();if(1==n.t&&n.data[0]<=D[D.length-1]){for(e=0;e=64;){for(s=0;s<16;++s)e[s]=n.getInt32();for(;s<64;++s)r=((r=e[s-2])>>>17|r<<15)^(r>>>19|r<<13)^r>>>10,i=((i=e[s-15])>>>7|i<<25)^(i>>>18|i<<14)^i>>>3,e[s]=r+e[s-7]+i+e[s-16]|0;for(u=t.h0,c=t.h1,p=t.h2,d=t.h3,f=t.h4,h=t.h5,g=t.h6,m=t.h7,s=0;s<64;++s)o=(u>>>2|u<<30)^(u>>>13|u<<19)^(u>>>22|u<<10),a=u&c|p&(u^c),r=m+((f>>>6|f<<26)^(f>>>11|f<<21)^(f>>>25|f<<7))+(g^f&(h^g))+l[s]+e[s],m=g,g=h,h=f,f=d+r>>>0,d=p,p=c,c=u,u=r+(i=o+a)>>>0;t.h0=t.h0+u|0,t.h1=t.h1+c|0,t.h2=t.h2+p|0,t.h3=t.h3+d|0,t.h4=t.h4+f|0,t.h5=t.h5+h|0,t.h6=t.h6+g|0,t.h7=t.h7+m|0,v-=64}}var o=n(0);n(2),n(1);var a=t.exports=o.sha256=o.sha256||{};o.md.sha256=o.md.algorithms.sha256=a,a.create=function(){u||r();var t=null,e=o.util.createBuffer(),n=new Array(64),a={algorithm:"sha256",blockLength:64,digestLength:32,messageLength:0,fullMessageLength:null,messageLengthSize:8};return a.start=function(){a.messageLength=0,a.fullMessageLength=a.messageLength64=[];for(var n=a.messageLengthSize/4,r=0;r>>0,u>>>0];for(var l=a.fullMessageLength.length-1;l>=0;--l)a.fullMessageLength[l]+=u[1],u[1]=u[0]+(a.fullMessageLength[l]/4294967296>>>0),a.fullMessageLength[l]=a.fullMessageLength[l]>>>0,u[0]=u[1]/4294967296>>>0;return e.putBytes(r),i(t,n,e),(e.read>2048||0===e.length())&&e.compact(),a},a.digest=function(){var r=o.util.createBuffer();r.putBytes(e.bytes());var u=a.fullMessageLength[a.fullMessageLength.length-1]+a.messageLengthSize&a.blockLength-1;r.putBytes(s.substr(0,a.blockLength-u));for(var l,c=8*a.fullMessageLength[0],p=0;p>>0,r.putInt32(c>>>0),c=l>>>0;r.putInt32(c);var d={h0:t.h0,h1:t.h1,h2:t.h2,h3:t.h3,h4:t.h4,h5:t.h5,h6:t.h6,h7:t.h7};i(d,n,r);var f=o.util.createBuffer();return f.putInt32(d.h0),f.putInt32(d.h1),f.putInt32(d.h2),f.putInt32(d.h3),f.putInt32(d.h4),f.putInt32(d.h5),f.putInt32(d.h6),f.putInt32(d.h7),f},a};var s=null,u=!1,l=null},function(t,e,n){n(11),n(6),n(14),n(4),n(9),n(3),t.exports=n(0)},function(t,e,n){var r=n(0);n(4),n(2),n(1);var i,o=r.pkcs5=r.pkcs5||{};r.util.isNodejs&&!r.options.usePureJavaScript&&(i=n(5)),t.exports=r.pbkdf2=o.pbkdf2=function(t,e,n,o,a,s){function u(){if(w>d)return s(null,y);h.start(null,null),h.update(e),h.update(r.util.int32ToBytes(w)),g=v=h.digest().getBytes(),b=2,l()}function l(){if(b<=n)return h.start(null,null),h.update(v),m=h.digest().getBytes(),g=r.util.xorBytes(g,m,c),v=m,++b,r.util.setImmediate(l);y+=w4||!a||"sha1"===a))return"string"!=typeof a&&(a="sha1"),t=new Buffer(t,"binary"),e=new Buffer(e,"binary"),s?4===i.pbkdf2Sync.length?i.pbkdf2(t,e,n,o,function(t,e){if(t)return s(t);s(null,e.toString("binary"))}):i.pbkdf2(t,e,n,o,a,function(t,e){if(t)return s(t);s(null,e.toString("binary"))}):4===i.pbkdf2Sync.length?i.pbkdf2Sync(t,e,n,o).toString("binary"):i.pbkdf2Sync(t,e,n,o,a).toString("binary");if(void 0!==a&&null!==a||(a="sha1"),"string"==typeof a){if(!(a in r.md.algorithms))throw new Error("Unknown hash algorithm: "+a);a=r.md[a].create()}var c=a.digestLength;if(o>4294967295*c){var p=new Error("Derived key is too long.");if(s)return s(p);throw p}var d=Math.ceil(o/c),f=o-(d-1)*c,h=r.hmac.create();h.start(a,t);var g,m,v,y="";if(!s){for(w=1;w<=d;++w){h.start(null,null),h.update(e),h.update(r.util.int32ToBytes(w)),g=v=h.digest().getBytes();for(b=2;b<=n;++b)h.start(null,null),h.update(v),m=h.digest().getBytes(),g=r.util.xorBytes(g,m,c),v=m;y+=w4){var e=t;t=a.util.createBuffer();for(var n=0;n0))return!0;for(r=0;r0))return!0;for(r=0;r0)return!1;var n=t.length(),r=t.at(n-1);return!(r>this.blockSize<<2)&&(t.truncate(r),!0)},s.cbc=function(t){t=t||{},this.name="CBC",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints)},s.cbc.prototype.start=function(t){if(null===t.iv){if(!this._prev)throw new Error("Invalid IV parameter.");this._iv=this._prev.slice(0)}else{if(!("iv"in t))throw new Error("Invalid IV parameter.");this._iv=r(t.iv),this._prev=this._iv.slice(0)}},s.cbc.prototype.encrypt=function(t,e,n){if(t.length()0))return!0;for(r=0;r0))return!0;for(r=0;r0)return!1;var n=t.length(),r=t.at(n-1);return!(r>this.blockSize<<2)&&(t.truncate(r),!0)},s.cfb=function(t){t=t||{},this.name="CFB",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialBlock=new Array(this._ints),this._partialOutput=a.util.createBuffer(),this._partialBytes=0},s.cfb.prototype.start=function(t){if(!("iv"in t))throw new Error("Invalid IV parameter.");this._iv=r(t.iv),this._inBlock=this._iv.slice(0),this._partialBytes=0},s.cfb.prototype.encrypt=function(t,e,n){var r=t.length();if(0===r)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&r>=this.blockSize)for(o=0;o0&&(i=this.blockSize-i),this._partialOutput.clear();for(o=0;o0)t.read-=this.blockSize;else for(var o=0;o0&&this._partialOutput.getBytes(this._partialBytes),i>0&&!n)return e.putBytes(this._partialOutput.getBytes(i-this._partialBytes)),this._partialBytes=i,!0;e.putBytes(this._partialOutput.getBytes(r-this._partialBytes)),this._partialBytes=0}},s.cfb.prototype.decrypt=function(t,e,n){var r=t.length();if(0===r)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&r>=this.blockSize)for(o=0;o0&&(i=this.blockSize-i),this._partialOutput.clear();for(o=0;o0)t.read-=this.blockSize;else for(var o=0;o0&&this._partialOutput.getBytes(this._partialBytes),i>0&&!n)return e.putBytes(this._partialOutput.getBytes(i-this._partialBytes)),this._partialBytes=i,!0;e.putBytes(this._partialOutput.getBytes(r-this._partialBytes)),this._partialBytes=0}},s.ofb=function(t){t=t||{},this.name="OFB",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialOutput=a.util.createBuffer(),this._partialBytes=0},s.ofb.prototype.start=function(t){if(!("iv"in t))throw new Error("Invalid IV parameter.");this._iv=r(t.iv),this._inBlock=this._iv.slice(0),this._partialBytes=0},s.ofb.prototype.encrypt=function(t,e,n){var r=t.length();if(0===t.length())return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&r>=this.blockSize)for(o=0;o0&&(i=this.blockSize-i),this._partialOutput.clear();for(o=0;o0)t.read-=this.blockSize;else for(var o=0;o0&&this._partialOutput.getBytes(this._partialBytes),i>0&&!n)return e.putBytes(this._partialOutput.getBytes(i-this._partialBytes)),this._partialBytes=i,!0;e.putBytes(this._partialOutput.getBytes(r-this._partialBytes)),this._partialBytes=0}},s.ofb.prototype.decrypt=s.ofb.prototype.encrypt,s.ctr=function(t){t=t||{},this.name="CTR",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialOutput=a.util.createBuffer(),this._partialBytes=0},s.ctr.prototype.start=function(t){if(!("iv"in t))throw new Error("Invalid IV parameter.");this._iv=r(t.iv),this._inBlock=this._iv.slice(0),this._partialBytes=0},s.ctr.prototype.encrypt=function(t,e,n){var r=t.length();if(0===r)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&r>=this.blockSize)for(a=0;a0&&(o=this.blockSize-o),this._partialOutput.clear();for(var a=0;a0&&(t.read-=this.blockSize),this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),o>0&&!n)return e.putBytes(this._partialOutput.getBytes(o-this._partialBytes)),this._partialBytes=o,!0;e.putBytes(this._partialOutput.getBytes(r-this._partialBytes)),this._partialBytes=0}i(this._inBlock)},s.ctr.prototype.decrypt=s.ctr.prototype.encrypt,s.gcm=function(t){t=t||{},this.name="GCM",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints),this._partialOutput=a.util.createBuffer(),this._partialBytes=0,this._R=3774873600},s.gcm.prototype.start=function(t){if(!("iv"in t))throw new Error("Invalid IV parameter.");var e=a.util.createBuffer(t.iv);this._cipherLength=0;var n;if(n="additionalData"in t?a.util.createBuffer(t.additionalData):a.util.createBuffer(),this._tagLength="tagLength"in t?t.tagLength:128,this._tag=null,t.decrypt&&(this._tag=a.util.createBuffer(t.tag).getBytes(),this._tag.length!==this._tagLength/8))throw new Error("Authentication tag does not match tag length.");this._hashBlock=new Array(this._ints),this.tag=null,this._hashSubkey=new Array(this._ints),this.cipher.encrypt([0,0,0,0],this._hashSubkey),this.componentBits=4,this._m=this.generateHashTable(this._hashSubkey,this.componentBits);var r=e.length();if(12===r)this._j0=[e.getInt32(),e.getInt32(),e.getInt32(),1];else{for(this._j0=[0,0,0,0];e.length()>0;)this._j0=this.ghash(this._hashSubkey,this._j0,[e.getInt32(),e.getInt32(),e.getInt32(),e.getInt32()]);this._j0=this.ghash(this._hashSubkey,this._j0,[0,0].concat(o(8*r)))}this._inBlock=this._j0.slice(0),i(this._inBlock),this._partialBytes=0,n=a.util.createBuffer(n),this._aDataLength=o(8*n.length());var s=n.length()%this.blockSize;for(s&&n.fillWithByte(0,this.blockSize-s),this._s=[0,0,0,0];n.length()>0;)this._s=this.ghash(this._hashSubkey,this._s,[n.getInt32(),n.getInt32(),n.getInt32(),n.getInt32()])},s.gcm.prototype.encrypt=function(t,e,n){var r=t.length();if(0===r)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&r>=this.blockSize){for(s=0;s0&&(o=this.blockSize-o),this._partialOutput.clear();for(s=0;s0&&this._partialOutput.getBytes(this._partialBytes),o>0&&!n)return t.read-=this.blockSize,e.putBytes(this._partialOutput.getBytes(o-this._partialBytes)),this._partialBytes=o,!0;e.putBytes(this._partialOutput.getBytes(r-this._partialBytes)),this._partialBytes=0}this._s=this.ghash(this._hashSubkey,this._s,this._outBlock),i(this._inBlock)},s.gcm.prototype.decrypt=function(t,e,n){var r=t.length();if(r0))return!0;this.cipher.encrypt(this._inBlock,this._outBlock),i(this._inBlock),this._hashBlock[0]=t.getInt32(),this._hashBlock[1]=t.getInt32(),this._hashBlock[2]=t.getInt32(),this._hashBlock[3]=t.getInt32(),this._s=this.ghash(this._hashSubkey,this._s,this._hashBlock);for(var o=0;o0;--r)e[r]=t[r]>>>1|(1&t[r-1])<<31;e[0]=t[0]>>>1,n&&(e[0]^=this._R)},s.gcm.prototype.tableMultiply=function(t){for(var e=[0,0,0,0],n=0;n<32;++n){var r=t[n/8|0]>>>4*(7-n%8)&15,i=this._m[n][r];e[0]^=i[0],e[1]^=i[1],e[2]^=i[2],e[3]^=i[3]}return e},s.gcm.prototype.ghash=function(t,e,n){return e[0]^=n[0],e[1]^=n[1],e[2]^=n[2],e[3]^=n[3],this.tableMultiply(e)},s.gcm.prototype.generateHashTable=function(t,e){for(var n=8/e,r=4*n,i=16*n,o=new Array(i),a=0;a>>1,i=new Array(n);i[r]=t.slice(0);for(var o=r>>>1;o>0;)this.pow(i[2*o],i[o]=[]),o>>=1;for(o=2;oi-11){var o=new Error("Message is too long for PKCS#1 v1.5 padding.");throw o.length=t.length,o.max=i-11,o}r.putByte(0),r.putByte(n);var a,s=i-3-t.length;if(0===n||1===n){a=0===n?0:255;for(c=0;c0;){for(var u=0,l=p.random.getBytes(s),c=0;c1;){if(255!==o.getByte()){--o.read;break}++u}else if(2===s)for(u=0;o.length()>1;){if(0===o.getByte()){--o.read;break}++u}if(0!==o.getByte()||u!==i-3-o.length())throw new Error("Encryption block is invalid.");return o.getBytes()}function o(t,e,n){function r(){i(t.pBits,function(e,r){return e?n(e):(t.p=r,null!==t.q?o(e,t.q):void i(t.qBits,o))})}function i(t,e){p.prime.generateProbablePrime(t,a,e)}function o(e,a){if(e)return n(e);if(t.q=a,t.p.compareTo(t.q)<0){var s=t.p;t.p=t.q,t.q=s}if(0!==t.p.subtract(d.ONE).gcd(t.e).compareTo(d.ONE))return t.p=null,void r();if(0!==t.q.subtract(d.ONE).gcd(t.e).compareTo(d.ONE))return t.q=null,void i(t.qBits,o);if(t.p1=t.p.subtract(d.ONE),t.q1=t.q.subtract(d.ONE),t.phi=t.p1.multiply(t.q1),0!==t.phi.gcd(t.e).compareTo(d.ONE))return t.p=t.q=null,void r();if(t.n=t.p.multiply(t.q),t.n.bitLength()!==t.bits)return t.q=null,void i(t.qBits,o);var u=t.e.modInverse(t.phi);t.keys={privateKey:h.rsa.setPrivateKey(t.n,t.e,u,t.p,t.q,u.mod(t.p1),u.mod(t.q1),t.q.modInverse(t.p)),publicKey:h.rsa.setPublicKey(t.n,t.e)},n(null,t.keys)}"function"==typeof e&&(n=e,e={});var a={algorithm:{name:(e=e||{}).algorithm||"PRIMEINC",options:{workers:e.workers||2,workLoad:e.workLoad||100,workerScript:e.workerScript}}};"prng"in e&&(a.prng=e.prng),r()}function a(t){var e=t.toString(16);e[0]>="8"&&(e="00"+e);var n=p.util.hexToBytes(e);return n.length>1&&(0===n.charCodeAt(0)&&0==(128&n.charCodeAt(1))||255===n.charCodeAt(0)&&128==(128&n.charCodeAt(1)))?n.substr(1):n}function s(t){return t<=100?27:t<=150?18:t<=200?15:t<=250?12:t<=300?9:t<=350?8:t<=400?7:t<=500?6:t<=600?5:t<=800?4:t<=1250?3:2}function u(t){return"undefined"!=typeof window&&"object"==typeof window.crypto&&"object"==typeof window.crypto.subtle&&"function"==typeof window.crypto.subtle[t]}function l(t){return"undefined"!=typeof window&&"object"==typeof window.msCrypto&&"object"==typeof window.msCrypto.subtle&&"function"==typeof window.msCrypto.subtle[t]}function c(t){for(var e=p.util.hexToBytes(t.toString(16)),n=new Uint8Array(e.length),r=0;r=0||!r.gcd(e.n).equals(d.ONE));for(var i=(t=t.multiply(r.modPow(e.e,e.n)).mod(e.n)).mod(e.p).modPow(e.dP,e.p),o=t.mod(e.q).modPow(e.dQ,e.q);i.compareTo(o)<0;)i=i.add(e.p);var a=i.subtract(o).multiply(e.qInv).mod(e.p).multiply(e.q).add(o);return a=a.multiply(r.modInverse(e.n)).mod(e.n)};h.rsa.encrypt=function(t,e,n){var i,o=n,a=Math.ceil(e.n.bitLength()/8);!1!==n&&!0!==n?(o=2===n,i=r(t,e,n)):(i=p.util.createBuffer()).putBytes(t);for(var s=new d(i.toHex(),16),u=$(s,e,o).toString(16),l=p.util.createBuffer(),c=a-Math.ceil(u.length/2);c>0;)l.putByte(0),--c;return l.putBytes(p.util.hexToBytes(u)),l.getBytes()},h.rsa.decrypt=function(t,e,n,r){var o=Math.ceil(e.n.bitLength()/8);if(t.length!==o){var a=new Error("Encrypted message length is invalid.");throw a.length=t.length,a.expected=o,a}var s=new d(p.util.createBuffer(t).toHex(),16);if(s.compareTo(e.n)>=0)throw new Error("Encrypted message is invalid.");for(var u=$(s,e,n).toString(16),l=p.util.createBuffer(),c=o-Math.ceil(u.length/2);c>0;)l.putByte(0),--c;return l.putBytes(p.util.hexToBytes(u)),!1!==r?i(l.getBytes(),e,n):l.getBytes()},h.rsa.createKeyPairGenerationState=function(t,e,n){"string"==typeof t&&(t=parseInt(t,10)),t=t||2048;var r,i=(n=n||{}).prng||p.random,o={nextBytes:function(t){for(var e=i.getBytesSync(t.length),n=0;n>1,pBits:t-(t>>1),pqState:0,num:null,keys:null}).e.fromInt(r.eInt),r},h.rsa.stepKeyPairGenerationState=function(t,e){"algorithm"in t||(t.algorithm="PRIMEINC");var n=new d(null);n.fromInt(30);for(var r,i=0,o=+new Date,a=0;null===t.keys&&(e<=0||au?t.pqState=0:t.num.isProbablePrime(s(t.num.bitLength()))?++t.pqState:t.num.dAddOffset(g[i++%8],0):2===t.pqState?t.pqState=0===t.num.subtract(d.ONE).gcd(t.e).compareTo(d.ONE)?3:0:3===t.pqState&&(t.pqState=0,null===t.p?t.p=t.num:t.q=t.num,null!==t.p&&null!==t.q&&++t.state,t.num=null)}else if(1===t.state)t.p.compareTo(t.q)<0&&(t.num=t.p,t.p=t.q,t.q=t.num),++t.state;else if(2===t.state)t.p1=t.p.subtract(d.ONE),t.q1=t.q.subtract(d.ONE),t.phi=t.p1.multiply(t.q1),++t.state;else if(3===t.state)0===t.phi.gcd(t.e).compareTo(d.ONE)?++t.state:(t.p=null,t.q=null,t.state=0);else if(4===t.state)t.n=t.p.multiply(t.q),t.n.bitLength()===t.bits?++t.state:(t.q=null,t.state=0);else if(5===t.state){var c=t.e.modInverse(t.phi);t.keys={privateKey:h.rsa.setPrivateKey(t.n,t.e,c,t.p,t.q,c.mod(t.p1),c.mod(t.q1),t.q.modInverse(t.p)),publicKey:h.rsa.setPublicKey(t.n,t.e)}}a+=(r=+new Date)-o,o=r}return null!==t.keys},h.rsa.generateKeyPair=function(t,e,n,r){if(1===arguments.length?"object"==typeof t?(n=t,t=void 0):"function"==typeof t&&(r=t,t=void 0):2===arguments.length?"number"==typeof t?"function"==typeof e?(r=e,e=void 0):"number"!=typeof e&&(n=e,e=void 0):(n=t,r=e,t=void 0,e=void 0):3===arguments.length&&("number"==typeof e?"function"==typeof n&&(r=n,n=void 0):(r=n,n=e,e=void 0)),n=n||{},void 0===t&&(t=n.bits||2048),void 0===e&&(e=n.e||65537),!p.options.usePureJavaScript&&r&&t>=256&&t<=16384&&(65537===e||3===e)){if(u("generateKey")&&u("exportKey"))return window.crypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:t,publicExponent:c(e),hash:{name:"SHA-256"}},!0,["sign","verify"]).then(function(t){return window.crypto.subtle.exportKey("pkcs8",t.privateKey)}).then(void 0,function(t){r(t)}).then(function(t){if(t){var e=h.privateKeyFromAsn1(f.fromDer(p.util.createBuffer(t)));r(null,{privateKey:e,publicKey:h.setRsaPublicKey(e.n,e.e)})}});if(l("generateKey")&&l("exportKey")){var i=window.msCrypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:t,publicExponent:c(e),hash:{name:"SHA-256"}},!0,["sign","verify"]);return i.oncomplete=function(t){var e=t.target.result,n=window.msCrypto.subtle.exportKey("pkcs8",e.privateKey);n.oncomplete=function(t){var e=t.target.result,n=h.privateKeyFromAsn1(f.fromDer(p.util.createBuffer(e)));r(null,{privateKey:n,publicKey:h.setRsaPublicKey(n.n,n.e)})},n.onerror=function(t){r(t)}},void(i.onerror=function(t){r(t)})}}var a=h.rsa.createKeyPairGenerationState(t,e,n);if(!r)return h.rsa.stepKeyPairGenerationState(a,0),a.keys;o(a,n,r)},h.setRsaPublicKey=h.rsa.setPublicKey=function(t,e){var n={n:t,e:e};return n.encrypt=function(t,e,i){if("string"==typeof e?e=e.toUpperCase():void 0===e&&(e="RSAES-PKCS1-V1_5"),"RSAES-PKCS1-V1_5"===e)e={encode:function(t,e,n){return r(t,e,2).getBytes()}};else if("RSA-OAEP"===e||"RSAES-OAEP"===e)e={encode:function(t,e){return p.pkcs1.encode_rsa_oaep(e,t,i)}};else if(-1!==["RAW","NONE","NULL",null].indexOf(e))e={encode:function(t){return t}};else if("string"==typeof e)throw new Error('Unsupported encryption scheme: "'+e+'".');var o=e.encode(t,n,!0);return h.rsa.encrypt(o,n,!0)},n.verify=function(t,e,r){"string"==typeof r?r=r.toUpperCase():void 0===r&&(r="RSASSA-PKCS1-V1_5"),"RSASSA-PKCS1-V1_5"===r?r={verify:function(t,e){return e=i(e,n,!0),t===f.fromDer(e).value[1].value}}:"NONE"!==r&&"NULL"!==r&&null!==r||(r={verify:function(t,e){return e=i(e,n,!0),t===e}});var o=h.rsa.decrypt(e,n,!0,!1);return r.verify(t,o,n.n.bitLength())},n},h.setRsaPrivateKey=h.rsa.setPrivateKey=function(t,e,n,r,o,a,s,u){var l={n:t,e:e,d:n,p:r,q:o,dP:a,dQ:s,qInv:u};return l.decrypt=function(t,e,n){"string"==typeof e?e=e.toUpperCase():void 0===e&&(e="RSAES-PKCS1-V1_5");var r=h.rsa.decrypt(t,l,!1,!1);if("RSAES-PKCS1-V1_5"===e)e={decode:i};else if("RSA-OAEP"===e||"RSAES-OAEP"===e)e={decode:function(t,e){return p.pkcs1.decode_rsa_oaep(e,t,n)}};else{if(-1===["RAW","NONE","NULL",null].indexOf(e))throw new Error('Unsupported encryption scheme: "'+e+'".');e={decode:function(t){return t}}}return e.decode(r,l,!1)},l.sign=function(t,e){var n=!1;"string"==typeof e&&(e=e.toUpperCase()),void 0===e||"RSASSA-PKCS1-V1_5"===e?(e={encode:w},n=1):"NONE"!==e&&"NULL"!==e&&null!==e||(e={encode:function(){return t}},n=1);var r=e.encode(t,l.n.bitLength());return h.rsa.encrypt(r,l,n)},l},h.wrapRsaPrivateKey=function(t){return f.create(f.Class.UNIVERSAL,f.Type.SEQUENCE,!0,[f.create(f.Class.UNIVERSAL,f.Type.INTEGER,!1,f.integerToDer(0).getBytes()),f.create(f.Class.UNIVERSAL,f.Type.SEQUENCE,!0,[f.create(f.Class.UNIVERSAL,f.Type.OID,!1,f.oidToDer(h.oids.rsaEncryption).getBytes()),f.create(f.Class.UNIVERSAL,f.Type.NULL,!1,"")]),f.create(f.Class.UNIVERSAL,f.Type.OCTETSTRING,!1,f.toDer(t).getBytes())])},h.privateKeyFromAsn1=function(t){var e={},n=[];if(f.validate(t,m,e,n)&&(t=f.fromDer(p.util.createBuffer(e.privateKey))),e={},n=[],!f.validate(t,v,e,n)){var r=new Error("Cannot read private key. ASN.1 object does not contain an RSAPrivateKey.");throw r.errors=n,r}var i,o,a,s,u,l,c,g;return i=p.util.createBuffer(e.privateKeyModulus).toHex(),o=p.util.createBuffer(e.privateKeyPublicExponent).toHex(),a=p.util.createBuffer(e.privateKeyPrivateExponent).toHex(),s=p.util.createBuffer(e.privateKeyPrime1).toHex(),u=p.util.createBuffer(e.privateKeyPrime2).toHex(),l=p.util.createBuffer(e.privateKeyExponent1).toHex(),c=p.util.createBuffer(e.privateKeyExponent2).toHex(),g=p.util.createBuffer(e.privateKeyCoefficient).toHex(),h.setRsaPrivateKey(new d(i,16),new d(o,16),new d(a,16),new d(s,16),new d(u,16),new d(l,16),new d(c,16),new d(g,16))},h.privateKeyToAsn1=h.privateKeyToRSAPrivateKey=function(t){return f.create(f.Class.UNIVERSAL,f.Type.SEQUENCE,!0,[f.create(f.Class.UNIVERSAL,f.Type.INTEGER,!1,f.integerToDer(0).getBytes()),f.create(f.Class.UNIVERSAL,f.Type.INTEGER,!1,a(t.n)),f.create(f.Class.UNIVERSAL,f.Type.INTEGER,!1,a(t.e)),f.create(f.Class.UNIVERSAL,f.Type.INTEGER,!1,a(t.d)),f.create(f.Class.UNIVERSAL,f.Type.INTEGER,!1,a(t.p)),f.create(f.Class.UNIVERSAL,f.Type.INTEGER,!1,a(t.q)),f.create(f.Class.UNIVERSAL,f.Type.INTEGER,!1,a(t.dP)),f.create(f.Class.UNIVERSAL,f.Type.INTEGER,!1,a(t.dQ)),f.create(f.Class.UNIVERSAL,f.Type.INTEGER,!1,a(t.qInv))])},h.publicKeyFromAsn1=function(t){var e={},n=[];if(f.validate(t,b,e,n)){var r=f.derToOid(e.publicKeyOid);if(r!==h.oids.rsaEncryption)throw(i=new Error("Cannot read public key. Unknown OID.")).oid=r,i;t=e.rsaPublicKey}if(n=[],!f.validate(t,y,e,n)){var i=new Error("Cannot read public key. ASN.1 object does not contain an RSAPublicKey.");throw i.errors=n,i}var o=p.util.createBuffer(e.publicKeyModulus).toHex(),a=p.util.createBuffer(e.publicKeyExponent).toHex();return h.setRsaPublicKey(new d(o,16),new d(a,16))},h.publicKeyToAsn1=h.publicKeyToSubjectPublicKeyInfo=function(t){return f.create(f.Class.UNIVERSAL,f.Type.SEQUENCE,!0,[f.create(f.Class.UNIVERSAL,f.Type.SEQUENCE,!0,[f.create(f.Class.UNIVERSAL,f.Type.OID,!1,f.oidToDer(h.oids.rsaEncryption).getBytes()),f.create(f.Class.UNIVERSAL,f.Type.NULL,!1,"")]),f.create(f.Class.UNIVERSAL,f.Type.BITSTRING,!1,[h.publicKeyToRSAPublicKey(t)])])},h.publicKeyToRSAPublicKey=function(t){return f.create(f.Class.UNIVERSAL,f.Type.SEQUENCE,!0,[f.create(f.Class.UNIVERSAL,f.Type.INTEGER,!1,a(t.n)),f.create(f.Class.UNIVERSAL,f.Type.INTEGER,!1,a(t.e))])}},function(t,e,n){function r(t,e,n){if(n>e){var r=new Error("Too few bytes to parse DER.");throw r.available=t.length(),r.remaining=e,r.requested=n,r}}function i(t,e,n,o){var u;r(t,e,2);var l=t.getByte();e--;var c=192&l,p=31&l;u=t.length();var d=s(t,e);if(e-=u-t.length(),void 0!==d&&d>e){if(o.strict){var f=new Error("Too few bytes to read ASN.1 value.");throw f.available=t.length(),f.remaining=e,f.requested=d,f}d=e}var h,g,m=32==(32&l);if(m)if(h=[],void 0===d)for(;;){if(r(t,e,2),t.bytes(2)===String.fromCharCode(0,0)){t.getBytes(2),e-=2;break}u=t.length(),h.push(i(t,e,n+1,o)),e-=u-t.length()}else for(;d>0;)u=t.length(),h.push(i(t,d,n+1,o)),e-=u-t.length(),d-=u-t.length();if(void 0===h&&c===a.Class.UNIVERSAL&&p===a.Type.BITSTRING&&(g=t.bytes(d)),void 0===h&&o.decodeBitStrings&&c===a.Class.UNIVERSAL&&p===a.Type.BITSTRING&&d>1){var v=t.read,y=e,b=0;if(p===a.Type.BITSTRING&&(r(t,e,1),b=t.getByte(),e--),0===b)try{u=t.length();var w=i(t,e,n+1,{verbose:o.verbose,strict:!0,decodeBitStrings:!0}),$=u-t.length();e-=$,p==a.Type.BITSTRING&&$++;var k=w.tagClass;$!==d||k!==a.Class.UNIVERSAL&&k!==a.Class.CONTEXT_SPECIFIC||(h=[w])}catch(t){}void 0===h&&(t.read=v,e=y)}if(void 0===h){if(void 0===d){if(o.strict)throw new Error("Non-constructed ASN.1 object of indefinite length.");d=e}if(p===a.Type.BMPSTRING)for(h="";d>0;d-=2)r(t,e,2),h+=String.fromCharCode(t.getInt16()),e-=2;else h=t.getBytes(d)}var C=void 0===g?null:{bitStringContents:g};return a.create(c,p,m,h,C)}var o=n(0);n(1),n(7);var a=t.exports=o.asn1=o.asn1||{};a.Class={UNIVERSAL:0,APPLICATION:64,CONTEXT_SPECIFIC:128,PRIVATE:192},a.Type={NONE:0,BOOLEAN:1,INTEGER:2,BITSTRING:3,OCTETSTRING:4,NULL:5,OID:6,ODESC:7,EXTERNAL:8,REAL:9,ENUMERATED:10,EMBEDDED:11,UTF8:12,ROID:13,SEQUENCE:16,SET:17,PRINTABLESTRING:19,IA5STRING:22,UTCTIME:23,GENERALIZEDTIME:24,BMPSTRING:30},a.create=function(t,e,n,r,i){if(o.util.isArray(r)){for(var s=[],u=0;u1&&(0===t.value.charCodeAt(0)&&0==(128&t.value.charCodeAt(1))||255===t.value.charCodeAt(0)&&128==(128&t.value.charCodeAt(1)))?r.putBytes(t.value.substr(1)):r.putBytes(t.value);if(e.putByte(n),r.length()<=127)e.putByte(127&r.length());else{var s=r.length(),u="";do{u+=String.fromCharCode(255&s),s>>>=8}while(s>0);e.putByte(128|u.length);for(var l=u.length-1;l>=0;--l)e.putByte(u.charCodeAt(l))}return e.putBuffer(r),e},a.oidToDer=function(t){var e=t.split("."),n=o.util.createBuffer();n.putByte(40*parseInt(e[0],10)+parseInt(e[1],10));for(var r,i,a,s,u=2;u>>=7,r||(s|=128),i.push(s),r=!1}while(a>0);for(var l=i.length-1;l>=0;--l)n.putByte(i[l])}return n},a.derToOid=function(t){var e;"string"==typeof t&&(t=o.util.createBuffer(t));var n=t.getByte();e=Math.floor(n/40)+"."+n%40;for(var r=0;t.length()>0;)r<<=7,128&(n=t.getByte())?r+=127&n:(e+="."+(r+n),r=0);return e},a.utcTimeToDate=function(t){var e=new Date,n=parseInt(t.substr(0,2),10);n=n>=50?1900+n:2e3+n;var r=parseInt(t.substr(2,2),10)-1,i=parseInt(t.substr(4,2),10),o=parseInt(t.substr(6,2),10),a=parseInt(t.substr(8,2),10),s=0;if(t.length>11){var u=t.charAt(10),l=10;"+"!==u&&"-"!==u&&(s=parseInt(t.substr(10,2),10),l+=2)}if(e.setUTCFullYear(n,r,i),e.setUTCHours(o,a,s,0),l&&("+"===(u=t.charAt(l))||"-"===u)){var c=60*parseInt(t.substr(l+1,2),10)+parseInt(t.substr(l+4,2),10);c*=6e4,"+"===u?e.setTime(+e-c):e.setTime(+e+c)}return e},a.generalizedTimeToDate=function(t){var e=new Date,n=parseInt(t.substr(0,4),10),r=parseInt(t.substr(4,2),10)-1,i=parseInt(t.substr(6,2),10),o=parseInt(t.substr(8,2),10),a=parseInt(t.substr(10,2),10),s=parseInt(t.substr(12,2),10),u=0,l=0,c=!1;"Z"===t.charAt(t.length-1)&&(c=!0);var p=t.length-5,d=t.charAt(p);return"+"!==d&&"-"!==d||(l=60*parseInt(t.substr(p+1,2),10)+parseInt(t.substr(p+4,2),10),l*=6e4,"+"===d&&(l*=-1),c=!0),"."===t.charAt(14)&&(u=1e3*parseFloat(t.substr(14),10)),c?(e.setUTCFullYear(n,r,i),e.setUTCHours(o,a,s,u),e.setTime(+e+l)):(e.setFullYear(n,r,i),e.setHours(o,a,s,u)),e},a.dateToUtcTime=function(t){if("string"==typeof t)return t;var e="",n=[];n.push((""+t.getUTCFullYear()).substr(2)),n.push(""+(t.getUTCMonth()+1)),n.push(""+t.getUTCDate()),n.push(""+t.getUTCHours()),n.push(""+t.getUTCMinutes()),n.push(""+t.getUTCSeconds());for(var r=0;r=-128&&t<128)return e.putSignedInt(t,8);if(t>=-32768&&t<32768)return e.putSignedInt(t,16);if(t>=-8388608&&t<8388608)return e.putSignedInt(t,24);if(t>=-2147483648&&t<2147483648)return e.putSignedInt(t,32);var n=new Error("Integer too large; max is 32-bits.");throw n.integer=t,n},a.derToInteger=function(t){"string"==typeof t&&(t=o.util.createBuffer(t));var e=8*t.length();if(e>32)throw new Error("Integer too large; max is 32-bits.");return t.getSignedInt(e)},a.validate=function(t,e,n,r){var i=!1;if(t.tagClass!==e.tagClass&&void 0!==e.tagClass||t.type!==e.type&&void 0!==e.type)r&&(t.tagClass!==e.tagClass&&r.push("["+e.name+'] Expected tag class "'+e.tagClass+'", got "'+t.tagClass+'"'),t.type!==e.type&&r.push("["+e.name+'] Expected type "'+e.type+'", got "'+t.type+'"'));else if(t.constructed===e.constructed||void 0===e.constructed){if(i=!0,e.value&&o.util.isArray(e.value))for(var s=0,u=0;i&&u0&&(r+="\n");for(var i="",s=0;s1?r+="0x"+o.util.bytesToHex(t.value.slice(1)):r+="(none)",t.value.length>0){var d=t.value.charCodeAt(0);1==d?r+=" (1 unused bit shown)":d>1&&(r+=" ("+d+" unused bits shown)")}}else t.type===a.Type.OCTETSTRING?(u.test(t.value)||(r+="("+t.value+") "),r+="0x"+o.util.bytesToHex(t.value)):t.type===a.Type.UTF8?r+=o.util.decodeUtf8(t.value):t.type===a.Type.PRINTABLESTRING||t.type===a.Type.IA5String?r+=t.value:u.test(t.value)?r+="0x"+o.util.bytesToHex(t.value):0===t.value.length?r+="[null]":r+=t.value}return r}},function(t,e,n){function r(t,e,n){n||(n=i.md.sha1.create());for(var r="",o=Math.ceil(e/n.digestLength),a=0;a>24&255,a>>16&255,a>>8&255,255&a);n.start(),n.update(t+s),r+=n.digest().getBytes()}return r.substring(0,e)}var i=n(0);n(1),n(3),n(18);var o=t.exports=i.pkcs1=i.pkcs1||{};o.encode_rsa_oaep=function(t,e,n){var o,a,s,u;"string"==typeof n?(o=n,a=arguments[3]||void 0,s=arguments[4]||void 0):n&&(o=n.label||void 0,a=n.seed||void 0,s=n.md||void 0,n.mgf1&&n.mgf1.md&&(u=n.mgf1.md)),s?s.start():s=i.md.sha1.create(),u||(u=s);var l=Math.ceil(t.n.bitLength()/8),c=l-2*s.digestLength-2;if(e.length>c)throw(m=new Error("RSAES-OAEP input message length is too long.")).length=e.length,m.maxLength=c,m;o||(o=""),s.update(o,"raw");for(var p=s.digest(),d="",f=c-e.length,h=0;h=32)return o(),t();var e=32-s.pools[0].messageLength<<5;s.seedFile(e,function(e,n){if(e)return t(e);s.collect(n),o(),t()})}function n(){if(s.pools[0].messageLength>=32)return o();var t=32-s.pools[0].messageLength<<5;s.collect(s.seedFileSync(t)),o()}function o(){var t=s.plugin.md.create();t.update(s.pools[0].digest().getBytes()),s.pools[0].start();for(var e=1,n=1;n<32;++n)(e=31===e?2147483648:e<<2)%s.reseeds==0&&(t.update(s.pools[n].digest().getBytes()),s.pools[n].start());var r=t.digest().getBytes();t.start(),t.update(r);var i=t.digest().getBytes();s.key=s.plugin.formatKey(r),s.seed=s.plugin.formatSeed(i),s.reseeds=4294967295===s.reseeds?0:s.reseeds+1,s.generated=0}function a(t){var e=null;if("undefined"!=typeof window){var n=window.crypto||window.msCrypto;n&&n.getRandomValues&&(e=function(t){return n.getRandomValues(t)})}var i=r.util.createBuffer();if(e)for(;i.length()>16)))<<16,c=4294967295&(u=(2147483647&(u+=s>>15))+(u>>31));for(var p=0;p<3;++p)l=c>>>(p<<3),l^=Math.floor(256*Math.random()),i.putByte(String.fromCharCode(255&l))}return i.getBytes(t)}for(var s={plugin:t,key:null,seed:null,time:null,reseeds:0,generated:0},u=t.md,l=new Array(32),c=0;c<32;++c)l[c]=u.create();return s.pools=l,s.pool=0,s.generate=function(t,n){function i(p){if(p)return n(p);if(c.length()>=t)return n(null,c.getBytes(t));if(s.generated>1048575&&(s.key=null),null===s.key)return r.util.nextTick(function(){e(i)});var d=o(s.key,s.seed);s.generated+=d.length,c.putBytes(d),s.key=u(o(s.key,a(s.seed))),s.seed=l(o(s.key,s.seed)),r.util.setImmediate(i)}if(!n)return s.generateSync(t);var o=s.plugin.cipher,a=s.plugin.increment,u=s.plugin.formatKey,l=s.plugin.formatSeed,c=r.util.createBuffer();s.key=null,i()},s.generateSync=function(t){var e=s.plugin.cipher,i=s.plugin.increment,o=s.plugin.formatKey,a=s.plugin.formatSeed;s.key=null;for(var u=r.util.createBuffer();u.length()1048575&&(s.key=null),null===s.key&&n();var l=e(s.key,s.seed);s.generated+=l.length,u.putBytes(l),s.key=o(e(s.key,i(s.seed))),s.seed=a(e(s.key,s.seed))}return u.getBytes(t)},i?(s.seedFile=function(t,e){i.randomBytes(t,function(t,n){if(t)return e(t);e(null,n.toString())})},s.seedFileSync=function(t){return i.randomBytes(t).toString()}):(s.seedFile=function(t,e){try{e(null,a(t))}catch(t){e(t)}},s.seedFileSync=a),s.collect=function(t){for(var e=t.length,n=0;n>r&255);s.collect(n)},s.registerWorker=function(t){if(t===self)s.seedFile=function(t,e){function n(t){var r=t.data;r.forge&&r.forge.prng&&(self.removeEventListener("message",n),e(r.forge.prng.err,r.forge.prng.bytes))}self.addEventListener("message",n),self.postMessage({forge:{prng:{needed:t}}})};else{t.addEventListener("message",function(e){var n=e.data;n.forge&&n.forge.prng&&s.seedFile(n.forge.prng.needed,function(e,n){t.postMessage({forge:{prng:{err:e,bytes:n}}})})})}},s}},function(t,e,n){function r(){s=String.fromCharCode(128),s+=o.util.fillString(String.fromCharCode(0),64),u=!0}function i(t,e,n){for(var r,i,o,a,s,u,l,c=n.length();c>=64;){for(i=t.h0,o=t.h1,a=t.h2,s=t.h3,u=t.h4,l=0;l<16;++l)r=n.getInt32(),e[l]=r,r=(i<<5|i>>>27)+(s^o&(a^s))+u+1518500249+r,u=s,s=a,a=(o<<30|o>>>2)>>>0,o=i,i=r;for(;l<20;++l)r=(r=e[l-3]^e[l-8]^e[l-14]^e[l-16])<<1|r>>>31,e[l]=r,r=(i<<5|i>>>27)+(s^o&(a^s))+u+1518500249+r,u=s,s=a,a=(o<<30|o>>>2)>>>0,o=i,i=r;for(;l<32;++l)r=(r=e[l-3]^e[l-8]^e[l-14]^e[l-16])<<1|r>>>31,e[l]=r,r=(i<<5|i>>>27)+(o^a^s)+u+1859775393+r,u=s,s=a,a=(o<<30|o>>>2)>>>0,o=i,i=r;for(;l<40;++l)r=(r=e[l-6]^e[l-16]^e[l-28]^e[l-32])<<2|r>>>30,e[l]=r,r=(i<<5|i>>>27)+(o^a^s)+u+1859775393+r,u=s,s=a,a=(o<<30|o>>>2)>>>0,o=i,i=r;for(;l<60;++l)r=(r=e[l-6]^e[l-16]^e[l-28]^e[l-32])<<2|r>>>30,e[l]=r,r=(i<<5|i>>>27)+(o&a|s&(o^a))+u+2400959708+r,u=s,s=a,a=(o<<30|o>>>2)>>>0,o=i,i=r;for(;l<80;++l)r=(r=e[l-6]^e[l-16]^e[l-28]^e[l-32])<<2|r>>>30,e[l]=r,r=(i<<5|i>>>27)+(o^a^s)+u+3395469782+r,u=s,s=a,a=(o<<30|o>>>2)>>>0,o=i,i=r;t.h0=t.h0+i|0,t.h1=t.h1+o|0,t.h2=t.h2+a|0,t.h3=t.h3+s|0,t.h4=t.h4+u|0,c-=64}}var o=n(0);n(2),n(1);var a=t.exports=o.sha1=o.sha1||{};o.md.sha1=o.md.algorithms.sha1=a,a.create=function(){u||r();var t=null,e=o.util.createBuffer(),n=new Array(80),a={algorithm:"sha1",blockLength:64,digestLength:20,messageLength:0,fullMessageLength:null,messageLengthSize:8};return a.start=function(){a.messageLength=0,a.fullMessageLength=a.messageLength64=[];for(var n=a.messageLengthSize/4,r=0;r>>0,u>>>0];for(var l=a.fullMessageLength.length-1;l>=0;--l)a.fullMessageLength[l]+=u[1],u[1]=u[0]+(a.fullMessageLength[l]/4294967296>>>0),a.fullMessageLength[l]=a.fullMessageLength[l]>>>0,u[0]=u[1]/4294967296>>>0;return e.putBytes(r),i(t,n,e),(e.read>2048||0===e.length())&&e.compact(),a},a.digest=function(){var r=o.util.createBuffer();r.putBytes(e.bytes());var u=a.fullMessageLength[a.fullMessageLength.length-1]+a.messageLengthSize&a.blockLength-1;r.putBytes(s.substr(0,a.blockLength-u));for(var l,c=8*a.fullMessageLength[0],p=0;p>>0,r.putInt32(c>>>0),c=l>>>0;r.putInt32(c);var d={h0:t.h0,h1:t.h1,h2:t.h2,h3:t.h3,h4:t.h4};i(d,n,r);var f=o.util.createBuffer();return f.putInt32(d.h0),f.putInt32(d.h1),f.putInt32(d.h2),f.putInt32(d.h3),f.putInt32(d.h4),f},a};var s=null,u=!1},function(t,e,n){var r=n(0);n(1),n(8),n(3),function(){function e(t,e,r,i){return"workers"in r?o(t,e,r,i):n(t,e,r,i)}function n(t,e,n,r){var o=a(t,e),u=s(o.bitLength());"millerRabinTests"in n&&(u=n.millerRabinTests);var l=10;"maxBlockTime"in n&&(l=n.maxBlockTime),i(o,t,e,0,u,l,r)}function i(t,e,n,o,s,u,l){var p=+new Date;do{if(t.bitLength()>e&&(t=a(e,n)),t.isProbablePrime(s))return l(null,t);t.dAddOffset(c[o++%8],0)}while(u<0||+new Date-pt&&(u=a(t,e));var h=u.toString(16);r.target.postMessage({hex:h,workLoad:p}),u.dAddOffset(d,0)}});var s=!1}if("undefined"==typeof Worker)return n(t,e,i,o);var u=a(t,e),c=i.workers,p=i.workLoad||100,d=30*p/8,f=i.workerScript||"forge/prime.worker.js";if(-1===c)return r.util.estimateCores(function(t,e){t&&(e=2),c=e-1,s()});s()}function a(t,e){var n=new l(t,e),r=t-1;return n.testBit(r)||n.bitwiseTo(l.ONE.shiftLeft(r),d,n),n.dAddOffset(31-n.mod(p).byteValue(),0),n}function s(t){return t<=100?27:t<=150?18:t<=200?15:t<=250?12:t<=300?9:t<=350?8:t<=400?7:t<=500?6:t<=600?5:t<=800?4:t<=1250?3:2}if(r.prime)t.exports=r.prime;else{var u=t.exports=r.prime=r.prime||{},l=r.jsbn.BigInteger,c=[6,4,2,4,2,4,6,2],p=new l(null);p.fromInt(30);var d=function(t,e){return t|e};u.generateProbablePrime=function(t,n,i){"function"==typeof n&&(i=n,n={});var o=(n=n||{}).algorithm||"PRIMEINC";"string"==typeof o&&(o={name:o}),o.options=o.options||{};var a=n.prng||r.random,s={nextBytes:function(t){for(var e=a.getBytesSync(t.length),n=0;n=this._config.preview;if(v)g.postMessage({results:r,workerId:$.WORKER_ID,finished:o});else if(f(this._config.chunk)){if(this._config.chunk(r,this._handle),this._paused)return;r=void 0,this._completeResults=void 0}return this._config.step||this._config.chunk||(this._completeResults.data=this._completeResults.data.concat(r.data),this._completeResults.errors=this._completeResults.errors.concat(r.errors),this._completeResults.meta=r.meta),!o||!f(this._config.complete)||r&&r.meta.aborted||this._config.complete(this._completeResults,this._input),o||r&&r.meta.paused||this._nextChunk(),r}},this._sendError=function(t){f(this._config.error)?this._config.error(t):v&&this._config.error&&g.postMessage({workerId:$.WORKER_ID,error:t,finished:!1})}}function e(e){function n(t){var e=t.getResponseHeader("Content-Range");return null===e?-1:parseInt(e.substr(e.lastIndexOf("/")+1))}(e=e||{}).chunkSize||(e.chunkSize=$.RemoteChunkSize),t.call(this,e);var r;this._nextChunk=m?function(){this._readChunk(),this._chunkLoaded()}:function(){this._readChunk()},this.stream=function(t){this._input=t,this._nextChunk()},this._readChunk=function(){if(this._finished)this._chunkLoaded();else{if(r=new XMLHttpRequest,this._config.withCredentials&&(r.withCredentials=this._config.withCredentials),m||(r.onload=d(this._chunkLoaded,this),r.onerror=d(this._chunkError,this)),r.open("GET",this._input,!m),this._config.downloadRequestHeaders){var t=this._config.downloadRequestHeaders;for(var e in t)r.setRequestHeader(e,t[e])}if(this._config.chunkSize){var n=this._start+this._config.chunkSize-1;r.setRequestHeader("Range","bytes="+this._start+"-"+n),r.setRequestHeader("If-None-Match","webkit-no-cache")}try{r.send()}catch(t){this._chunkError(t.message)}m&&0===r.status?this._chunkError():this._start+=this._config.chunkSize}},this._chunkLoaded=function(){4==r.readyState&&(r.status<200||r.status>=400?this._chunkError():(this._finished=!this._config.chunkSize||this._start>n(r),this.parseChunk(r.responseText)))},this._chunkError=function(t){var e=r.statusText||t;this._sendError(e)}}function n(e){(e=e||{}).chunkSize||(e.chunkSize=$.LocalChunkSize),t.call(this,e);var n,r,i="undefined"!=typeof FileReader;this.stream=function(t){this._input=t,r=t.slice||t.webkitSlice||t.mozSlice,i?((n=new FileReader).onload=d(this._chunkLoaded,this),n.onerror=d(this._chunkError,this)):n=new FileReaderSync,this._nextChunk()},this._nextChunk=function(){this._finished||this._config.preview&&!(this._rowCount=this._input.size,this.parseChunk(t.target.result)},this._chunkError=function(){this._sendError(n.error)}}function r(e){e=e||{},t.call(this,e);var n,r;this.stream=function(t){return n=t,r=t,this._nextChunk()},this._nextChunk=function(){if(!this._finished){var t=this._config.chunkSize,e=t?r.substr(0,t):r;return r=t?r.substr(t):"",this._finished=!r,this.parseChunk(e)}}}function i(e){e=e||{},t.call(this,e);var n=[],r=!0;this.stream=function(t){this._input=t,this._input.on("data",this._streamData),this._input.on("end",this._streamEnd),this._input.on("error",this._streamError)},this._nextChunk=function(){n.length?this.parseChunk(n.shift()):r=!0},this._streamData=d(function(t){try{n.push("string"==typeof t?t:t.toString(this._config.encoding)),r&&(r=!1,this.parseChunk(n.shift()))}catch(t){this._streamError(t)}},this),this._streamError=d(function(t){this._streamCleanUp(),this._sendError(t.message)},this),this._streamEnd=d(function(){this._streamCleanUp(),this._finished=!0,this._streamData("")},this),this._streamCleanUp=d(function(){this._input.removeListener("data",this._streamData),this._input.removeListener("end",this._streamEnd),this._input.removeListener("error",this._streamError)},this)}function o(t){function e(){if(x&&m&&(d("Delimiter","UndetectableDelimiter","Unable to auto-detect delimiting character; defaulted to '"+$.DefaultDelimiter+"'"),m=!1),t.skipEmptyLines)for(var e=0;e=C.length?"__parsed_extra":C[r]),a=o(i,a),"__parsed_extra"===i?(n[i]=n[i]||[],n[i].push(a)):n[i]=a}x.data[e]=n,t.header&&(r>C.length?d("FieldMismatch","TooManyFields","Too many fields: expected "+C.length+" fields but parsed "+r,e):r1&&(p+=Math.abs(m-s),s=m):s=m}h.data.length>0&&(d/=h.data.length-f),(void 0===o||p1.99&&(o=p,i=c)}return t.delimiter=i,{successful:!!i,bestDelimiter:i}}function l(t){var e=(t=t.substr(0,1048576)).split("\r"),n=t.split("\n"),r=n.length>1&&n[0].length=e.length/2?"\r\n":"\r"}function c(t){return v.test(t)?parseFloat(t):t}function d(t,e,n,r){x.errors.push({type:t,code:e,message:n,row:r})}var h,g,m,v=/^\s*-?(\d*\.?\d+|\d+\.?\d*)(e[-+]?\d+)?\s*$/i,y=this,b=0,w=!1,k=!1,C=[],x={data:[],errors:[],meta:{}};if(f(t.step)){var T=t.step;t.step=function(r){if(x=r,n())e();else{if(e(),0===x.data.length)return;b+=r.data.length,t.preview&&b>t.preview?g.abort():T(x,y)}}}this.parse=function(n,r,i){if(t.newline||(t.newline=l(n)),m=!1,t.delimiter)f(t.delimiter)&&(t.delimiter=t.delimiter(n),x.meta.delimiter=t.delimiter);else{var o=u(n,t.newline,t.skipEmptyLines);o.successful?t.delimiter=o.bestDelimiter:(m=!0,t.delimiter=$.DefaultDelimiter),x.meta.delimiter=t.delimiter}var s=p(t);return t.preview&&t.header&&s.preview++,h=n,g=new a(s),x=g.parse(h,r,i),e(),w?{meta:{paused:!0}}:x||{meta:{paused:!1}}},this.paused=function(){return w},this.pause=function(){w=!0,g.abort(),h=h.substr(g.getCharIndex())},this.resume=function(){w=!1,y.streamer.parseChunk(h)},this.aborted=function(){return k},this.abort=function(){k=!0,g.abort(),x.meta.aborted=!0,f(t.complete)&&t.complete(x),h=""}}function a(t){var e=(t=t||{}).delimiter,n=t.newline,r=t.comments,i=t.step,o=t.preview,a=t.fastMode,s=t.quoteChar||'"';if(("string"!=typeof e||$.BAD_DELIMITERS.indexOf(e)>-1)&&(e=","),r===e)throw"Comment character same as delimiter";!0===r?r="#":("string"!=typeof r||$.BAD_DELIMITERS.indexOf(r)>-1)&&(r=!1),"\n"!=n&&"\r"!=n&&"\r\n"!=n&&(n="\n");var u=0,l=!1;this.parse=function(t,c,p){function d(t){C.push(t),S=u}function h(e){return p?m():(void 0===e&&(e=t.substr(u)),T.push(e),u=y,d(T),k&&v(),m())}function g(e){u=e,d(T),T=[],B=t.indexOf(n,u)}function m(t){return{data:C,errors:x,meta:{delimiter:e,linebreak:n,aborted:l,truncated:!!t,cursor:S+(c||0)}}}function v(){i(m()),C=[],x=[]}if("string"!=typeof t)throw"Input must be a string";var y=t.length,b=e.length,w=n.length,$=r.length,k=f(i);u=0;var C=[],x=[],T=[],S=0;if(!t)return m();if(a||!1!==a&&-1===t.indexOf(s)){for(var E=t.split(n),D=0;D=o)return C=C.slice(0,o),m(!0)}}return m()}for(var A=t.indexOf(e,u),B=t.indexOf(n,u),I=new RegExp(s+s,"g");;)if(t[u]!==s)if(r&&0===T.length&&t.substr(u,$)===r){if(-1===B)return m();u=B+w,B=t.indexOf(n,u),A=t.indexOf(e,u)}else if(-1!==A&&(A=o)return m(!0)}else{var O=u;for(u++;;){if(-1===(O=t.indexOf(s,O+1)))return p||x.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:C.length,index:u}),h();if(O===y-1)return h(t.substring(u,O).replace(I,s));if(t[O+1]!==s){if(t[O+1]===e){T.push(t.substring(u,O).replace(I,s)),u=O+1+b,A=t.indexOf(e,u),B=t.indexOf(n,u);break}if(t.substr(O+1,w)===n){if(T.push(t.substring(u,O).replace(I,s)),g(O+1+w),A=t.indexOf(e,u),k&&(v(),l))return m();if(o&&C.length>=o)return m(!0);break}}else O++}}return h()},this.abort=function(){l=!0},this.getCharIndex=function(){return u}}function s(){if(!$.WORKERS_SUPPORTED)return!1;if(!y&&null===$.SCRIPT_PATH)throw new Error("Script path cannot be determined automatically when Papa Parse is loaded asynchronously. You need to set Papa.SCRIPT_PATH manually.");var t=$.SCRIPT_PATH||h;t+=(-1!==t.indexOf("?")?"&":"?")+"papaworker";var e=new g.Worker(t);return e.onmessage=u,e.id=w++,b[e.id]=e,e}function u(t){var e=t.data,n=b[e.workerId],r=!1;if(e.error)n.userError(e.error,e.file);else if(e.results&&e.results.data){var i={abort:function(){r=!0,l(e.workerId,{data:[],errors:[],meta:{aborted:!0}})},pause:c,resume:c};if(f(n.userStep)){for(var o=0;o0,o=!(e[0]instanceof Array);if(r&&s){for(var a=0;a0&&(n+=u),n+=i(t[a],a);e.length>0&&(n+=l)}for(var c=0;c0&&(n+=u);var f=r&&o?t[d]:d;n+=i(e[c][f],d)}c-1||" "===t.charAt(0)||" "===t.charAt(t.length-1)?c+t+c:t)}function o(t,e){for(var n=0;n-1)return!0;return!1}var a=!1,s=!0,u=",",l="\r\n",c='"';"object"==typeof e&&("string"==typeof e.delimiter&&1===e.delimiter.length&&-1===$.BAD_DELIMITERS.indexOf(e.delimiter)&&(u=e.delimiter),("boolean"==typeof e.quotes||e.quotes instanceof Array)&&(a=e.quotes),"string"==typeof e.newline&&(l=e.newline),"string"==typeof e.quoteChar&&(c=e.quoteChar),"boolean"==typeof e.header&&(s=e.header));var p=new RegExp(c,"g");if("string"==typeof t&&(t=JSON.parse(t)),t instanceof Array){if(!t.length||t[0]instanceof Array)return r(null,t);if("object"==typeof t[0])return r(n(t[0]),t)}else if("object"==typeof t)return"string"==typeof t.data&&(t.data=JSON.parse(t.data)),t.data instanceof Array&&(t.fields||(t.fields=t.meta&&t.meta.fields),t.fields||(t.fields=t.data[0]instanceof Array?t.fields:n(t.data[0])),t.data[0]instanceof Array||"object"==typeof t.data[0]||(t.data=[t.data])),r(t.fields||[],t.data||[]);throw"exception: Unable to serialize unrecognized input"},$.RECORD_SEP=String.fromCharCode(30),$.UNIT_SEP=String.fromCharCode(31),$.BYTE_ORDER_MARK="\ufeff",$.BAD_DELIMITERS=["\r","\n",'"',$.BYTE_ORDER_MARK],$.WORKERS_SUPPORTED=!m&&!!g.Worker,$.SCRIPT_PATH=null,$.LocalChunkSize=10485760,$.RemoteChunkSize=5242880,$.DefaultDelimiter=",",$.Parser=a,$.ParserHandle=o,$.NetworkStreamer=e,$.FileStreamer=n,$.StringStreamer=r,$.ReadableStreamStreamer=i,g.jQuery){var k=g.jQuery;k.fn.parse=function(t){function e(){if(0!==o.length){var e=o[0];if(f(t.before)){var i=t.before(e.file,e.inputElem);if("object"==typeof i){if("abort"===i.action)return void n("AbortError",e.file,e.inputElem,i.reason);if("skip"===i.action)return void r();"object"==typeof i.config&&(e.instanceConfig=k.extend(e.instanceConfig,i.config))}else if("skip"===i)return void r()}var a=e.instanceConfig.complete;e.instanceConfig.complete=function(t){f(a)&&a(t,e.file,e.inputElem),r()},$.parse(e.file,e.instanceConfig)}else f(t.complete)&&t.complete()}function n(e,n,r,i){f(t.error)&&t.error({name:e},n,r,i)}function r(){o.splice(0,1),e()}var i=t.config||{},o=[];return this.each(function(t){if(!("INPUT"===k(this).prop("tagName").toUpperCase()&&"file"===k(this).attr("type").toLowerCase()&&g.FileReader)||!this.files||0===this.files.length)return!0;for(var e=0;e
    ');return this.each(function(){if(""!==i.source){var e=t(this);e.find(i.trigger).first().on("click",function(t){t.preventDefault(),n(e),e.find(".box-body").load(i.source,function(){r(e)})})}else window.console&&window.console.log("Please specify a source first - boxRefresh()")})}}(jQuery),function(t){"use strict";t.fn.activateBox=function(){t.AdminLTE.boxWidget.activate(this)},t.fn.toggleBox=function(){var e=t(t.AdminLTE.boxWidget.selectors.collapse,this);t.AdminLTE.boxWidget.collapse(e)},t.fn.removeBox=function(){var e=t(t.AdminLTE.boxWidget.selectors.remove,this);t.AdminLTE.boxWidget.remove(e)}}(jQuery),function(t){"use strict";t.fn.todolist=function(e){var n=t.extend({onCheck:function(t){return t},onUncheck:function(t){return t}},e);return this.each(function(){void 0!==t.fn.iCheck?(t("input",this).on("ifChecked",function(){var e=t(this).parents("li").first();e.toggleClass("done"),n.onCheck.call(e)}),t("input",this).on("ifUnchecked",function(){var e=t(this).parents("li").first();e.toggleClass("done"),n.onUncheck.call(e)})):t("input",this).on("change",function(){var e=t(this).parents("li").first();e.toggleClass("done"),t("input",e).is(":checked")?n.onCheck.call(e):n.onUncheck.call(e)})})}}(jQuery); \ No newline at end of file diff --git a/u2f-connector.html b/u2f-connector.html index 0f7634a4..fd135857 100644 --- a/u2f-connector.html +++ b/u2f-connector.html @@ -5,6 +5,6 @@ U2F Connector - +