!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 e,m,w,x=a(this),y=a(j.context),z=g.not(x),A=x.find(k.close),B=this,C=x.data(p);w={initialize:function(){w.verbose("Initializing dimmer",y),m=y.dimmer("add content",x).dimmer("get dimmer"),w.verbose("Attaching close events",A),A.on("click"+o,w.event.close),h.on("resize",function(){w.event.debounce(w.refresh,50)}),w.instantiate()},instantiate:function(){w.verbose("Storing instance of modal"),C=w,x.data(p,C)},destroy:function(){w.verbose("Destroying previous modal"),x.off(o)},refresh:function(){w.remove.scrolling(),w.cacheSizes(),w.set.type(),w.set.position()},attachEvents:function(b,c){var d=a(b);c=a.isFunction(w[c])?w[c]:w.show,d.size()>0?(w.debug("Attaching modal events to element",b,c),d.off(o).on("click"+o,c)):w.error(n.notFound)},event:{close:function(){w.verbose("Close button pressed"),y.dimmer("hide")},debounce:function(a,b){clearTimeout(w.timer),w.timer=setTimeout(a,b)},keyboard:function(a){var b=a.which,c=27;b==c&&(w.debug("Escape key pressed hiding modal"),y.dimmer("hide"),a.preventDefault())},resize:function(){y.dimmer("is active")&&w.refresh()}},toggle:function(){w.is.active()?w.hide():w.show()},show:function(){w.showDimmer(),w.cacheSizes(),w.set.position(),w.hideAll(),j.transition&&a.fn.transition!==d?x.transition(j.transition+" in",j.duration,function(){w.set.active(),w.save.focus(),w.set.type()}):x.fadeIn(j.duration,j.easing,function(){w.set.active(),w.save.focus(),w.set.type()}),w.debug("Triggering dimmer"),a.proxy(j.onShow,B)()},showDimmer:function(){w.debug("Showing modal"),w.set.dimmerSettings(),y.dimmer("show")},hideDimmer:function(){y.dimmer("hide")},hide:function(){w.debug("Hiding modal"),i.off("keyup."+o),j.transition&&a.fn.transition!==d?x.transition(j.transition+" out",j.duration,function(){w.remove.active(),w.restore.focus()}):x.fadeOut(j.duration,j.easing,function(){w.remove.active(),w.restore.focus()}),a.proxy(j.onHide,B)()},hideAll:function(){z.filter(":visible").modal("hide")},add:{keyboardShortcuts:function(){w.verbose("Adding keyboard shortcuts"),i.on("keyup"+o,w.event.keyboard)}},save:{focus:function(){e=a(c.activeElement).blur()}},restore:{focus:function(){e.focus()}},remove:{active:function(){x.removeClass(l.active)},keyboardShortcuts:function(){w.verbose("Removing keyboard shortcuts"),i.off("keyup"+o)},scrolling:function(){m.removeClass(l.scrolling),x.removeClass(l.scrolling)}},cacheSizes:function(){w.cache={height:x.outerHeight()+j.offset,contextHeight:"body"==j.context?a(b).height():y.height()},w.debug("Caching modal and container sizes",w.cache)},can:{fit:function(){return w.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,e){var g,h,i;return c=c||v,e=B||e,"string"==typeof b&&C!==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(C[e])&&c!=g)C=C[e];else{if(!a.isPlainObject(C[f])||c==g)return C[e]!==d?(h=C[e],!1):C[f]!==d?(h=C[f],!1):(w.error(n.method),!1);C=C[f]}})),a.isFunction(h)?i=h.apply(e,c):h!==d&&(i=h),a.isArray(f)?f.push(i):"string"==typeof f?f=[f,i]:i!==d&&(f=i),h}},u?(C===d&&w.initialize(),w.invoke(t)):(C!==d&&w.destroy(),w.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);