!function(a,b,c,d){a.fn.modal=function(e){var f,g=a(this),h=a(b),i=a(c),j=a.isPlainObject(e)?a.extend(!0,{},a.fn.modal.settings,e):a.fn.modal.settings,k=j.selector,l=j.className,m=j.namespace,n=j.error,o="."+m,p="module-"+m,q=g.selector||"",r=(new Date).getTime(),s=[],t=arguments[0],u="string"==typeof t,v=[].slice.call(arguments,1);return g.each(function(){var c,e,w=a(this),x=a(j.context),y=g.not(w),z=w.find(k.close),A=this,B=w.data(p);e={initialize:function(){e.verbose("Initializing dimmer",x),c=x.dimmer("add content",w).dimmer("get dimmer"),e.verbose("Attaching close events",z),z.on("click"+o,e.event.close),h.on("resize",function(){e.event.debounce(e.refresh,50)}),e.instantiate()},instantiate:function(){e.verbose("Storing instance of modal"),B=e,w.data(p,B)},destroy:function(){e.verbose("Destroying previous modal"),w.off(o)},refresh:function(){e.remove.scrolling(),e.cacheSizes(),e.set.type(),e.set.position()},event:{close:function(){e.verbose("Close button pressed"),x.dimmer("hide")},debounce:function(a,b){clearTimeout(e.timer),e.timer=setTimeout(a,b)},keyboard:function(a){var b=a.which,c=27;b==c&&(e.debug("Escape key pressed hiding modal"),x.dimmer("hide"),a.preventDefault())},resize:function(){x.dimmer("is active")&&e.refresh()}},toggle:function(){e.is.active()?e.hide():e.show()},show:function(){e.showDimmer(),e.cacheSizes(),e.set.position(),e.hideAll(),j.transition&&a.fn.transition!==d?w.transition(j.transition+" in",j.duration,function(){e.set.active(),e.set.type()}):w.fadeIn(j.duration,j.easing,e.set.active),e.debug("Triggering dimmer"),a.proxy(j.onShow,A)()},showDimmer:function(){e.debug("Showing modal"),e.set.dimmerSettings(),x.dimmer("show")},hideDimmer:function(){x.dimmer("hide")},hide:function(){e.debug("Hiding modal"),i.off("keyup."+m),j.transition&&a.fn.transition!==d?w.transition(j.transition+" out",j.duration,function(){e.remove.active()}):w.fadeOut(j.duration,j.easing,e.remove.active),a.proxy(j.onHide,A)()},hideAll:function(){y.filter(":visible").modal("hide")},add:{keyboardShortcuts:function(){e.verbose("Adding keyboard shortcuts"),i.on("keyup"+o,e.event.keyboard)}},remove:{active:function(){w.removeClass(l.active)},keyboardShortcuts:function(){e.verbose("Removing keyboard shortcuts"),i.off("keyup"+o)},scrolling:function(){c.removeClass(l.scrolling),w.removeClass(l.scrolling)}},cacheSizes:function(){e.cache={height:w.outerHeight()+j.offset,contextHeight:"body"==j.context?a(b).height():x.height()},e.debug("Caching modal and container sizes",e.cache)},can:{fit:function(){return e.cache.height0&&(console.groupCollapsed(b),console.table?console.table(s):a.each(s,function(a,b){console.log(b.Name+": "+b["Execution Time"]+"ms")}),console.groupEnd()),s=[]}},invoke:function(b,c,g){var h,i,j;return c=c||v,g=A||g,"string"==typeof b&&B!==d&&(b=b.split(/[\. ]/),h=b.length-1,a.each(b,function(c,f){var g=c!=h?f+b[c+1].charAt(0).toUpperCase()+b[c+1].slice(1):b;if(a.isPlainObject(B[f])&&c!=h)B=B[f];else{if(!a.isPlainObject(B[g])||c==h)return B[f]!==d?(i=B[f],!1):B[g]!==d?(i=B[g],!1):(e.error(n.method),!1);B=B[g]}})),a.isFunction(i)?j=i.apply(g,c):i!==d&&(j=i),a.isArray(f)?f.push(j):"string"==typeof f?f=[f,j]:j!==d&&(f=j),i}},u?(B===d&&e.initialize(),e.invoke(t)):(B!==d&&e.destroy(),e.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(){},selector:{close:".close, .actions .button"},error:{method:"The method you called is not defined."},className:{active:"active",scrolling:"scrolling"}}}(jQuery,window,document);