!function(a,b,c,d){a.fn.modal=function(e){var f,g=a(this),h=a(b),i=a(c),j=(new Date).getTime(),k=[],l=arguments[0],m="string"==typeof l,n=[].slice.call(arguments,1);return g.each(function(){var o,p,q,r,s=a.isPlainObject(e)?a.extend(!0,{},a.fn.modal.settings,e):a.extend({},a.fn.modal.settings),t=s.selector,u=s.className,v=s.namespace,w=s.error,x="."+v,y="module-"+v,z=g.selector||"",A=a(this),B=a(s.context),C=g.not(A),D=A.find(t.close),E=this,F=A.data(y);r={initialize:function(){return r.verbose("Initializing dimmer",B),typeof a.fn.dimmer===d?(r.error(w.dimmer),void 0):(p=B.dimmer({closable:!1,show:.95*s.duration,hide:1.05*s.duration}).dimmer("add content",A),q=p.dimmer("get dimmer"),r.verbose("Attaching close events",D),D.on("click"+x,r.event.close),h.on("resize",function(){r.event.debounce(r.refresh,50)}),r.instantiate(),void 0)},instantiate:function(){r.verbose("Storing instance of modal"),F=r,A.data(y,F)},destroy:function(){r.verbose("Destroying previous modal"),A.removeData(y).off(x),D.off(x),B.dimmer("destroy")},refresh:function(){r.remove.scrolling(),r.cacheSizes(),r.set.type(),r.set.position()},attachEvents:function(b,c){var d=a(b);c=a.isFunction(r[c])?r[c]:r.toggle,d.size()>0?(r.debug("Attaching modal events to element",b,c),d.off(x).on("click"+x,c)):r.error(w.notFound)},event:{close:function(){r.verbose("Closing element pressed"),a(this).is(t.approve)&&(a.proxy(s.onApprove,E)()?r.hide():r.verbose("Approve callback returned false cancelling hide")),a(this).is(t.deny)?a.proxy(s.onDeny,E)()?r.hide():r.verbose("Deny callback returned false cancelling hide"):r.hide()},click:function(a){r.verbose("Determining if event occured on dimmer",a),0===q.find(a.target).size()&&(r.hide(),a.stopImmediatePropagation())},debounce:function(a,b){clearTimeout(r.timer),r.timer=setTimeout(a,b)},keyboard:function(a){var b=a.which,c=27;b==c&&(s.closable?(r.debug("Escape key pressed hiding modal"),r.hide()):r.debug("Escape key pressed, but closable is set to false"),a.preventDefault())},resize:function(){p.dimmer("is active")&&r.refresh()}},toggle:function(){r.is.active()?r.hide():r.show()},show:function(){r.showDimmer(),r.cacheSizes(),r.set.position(),r.hideAll(),s.transition&&a.fn.transition!==d?A.transition(s.transition+" in",s.duration,r.set.active):A.fadeIn(s.duration,s.easing,r.set.active),r.debug("Triggering dimmer"),a.proxy(s.onShow,E)()},showDimmer:function(){r.debug("Showing modal"),p.dimmer("show")},hide:function(){s.closable&&q.off("click"+x),p.dimmer("is active")&&p.dimmer("hide"),r.is.active()?(r.hideModal(),a.proxy(s.onHide,E)()):r.debug("Cannot hide modal, modal is not visible")},hideDimmer:function(){r.debug("Hiding dimmer"),p.dimmer("hide")},hideModal:function(){r.debug("Hiding modal"),r.remove.keyboardShortcuts(),s.transition&&a.fn.transition!==d?A.transition(s.transition+" out",s.duration,function(){r.remove.active(),r.restore.focus()}):A.fadeOut(s.duration,s.easing,function(){r.remove.active(),r.restore.focus()})},hideAll:function(){C.filter(":visible").modal("hide")},add:{keyboardShortcuts:function(){r.verbose("Adding keyboard shortcuts"),i.on("keyup"+x,r.event.keyboard)}},save:{focus:function(){o=a(c.activeElement).blur()}},restore:{focus:function(){o&&o.size()>0&&o.focus()}},remove:{active:function(){A.removeClass(u.active)},keyboardShortcuts:function(){r.verbose("Removing keyboard shortcuts"),i.off("keyup"+x)},scrolling:function(){p.removeClass(u.scrolling),A.removeClass(u.scrolling)}},cacheSizes:function(){r.cache={height:A.outerHeight()+s.offset,contextHeight:"body"==s.context?a(b).height():p.height()},r.debug("Caching modal and container sizes",r.cache)},can:{fit:function(){return r.cache.height0&&(console.groupCollapsed(b),console.table?console.table(k):a.each(k,function(a,b){console.log(b.Name+": "+b["Execution Time"]+"ms")}),console.groupEnd()),k=[]}},invoke:function(b,c,e){var g,h,i;return c=c||n,e=E||e,"string"==typeof b&&F!==d&&(b=b.split(/[\. ]/),g=b.length-1,a.each(b,function(c,e){var f=c!=g?e+b[c+1].charAt(0).toUpperCase()+b[c+1].slice(1):b;if(a.isPlainObject(F[e])&&c!=g)F=F[e];else{if(!a.isPlainObject(F[f])||c==g)return F[e]!==d?(h=F[e],!1):F[f]!==d?(h=F[f],!1):(r.error(w.method),!1);F=F[f]}})),a.isFunction(h)?i=h.apply(e,c):h!==d&&(i=h),a.isArray(f)?f.push(i):f!==d?f=[f,i]:i!==d&&(f=i),h}},m?(F===d&&r.initialize(),r.invoke(l)):(F!==d&&r.destroy(),r.initialize())}),f!==d?f:this},a.fn.modal.settings={name:"Modal",namespace:"modal",verbose:!0,debug:!0,performance:!0,closable:!0,context:"body",duration:500,easing:"easeOutExpo",offset:0,transition:"scale",onShow:function(){},onHide:function(){},onApprove:function(){return!0},onDeny:function(){return!0},selector:{close:".close, .actions .button",approve:".actions .positive, .actions .approve",deny:".actions .negative, .actions .cancel"},error:{dimmer:"UI Dimmer, a required component is not included in this page",method:"The method you called is not defined."},className:{active:"active",scrolling:"scrolling"}}}(jQuery,window,document);