!function(N,V,W,M){"use strict";V=void 0!==V&&V.Math==Math?V:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),N.fn.popup=function(x){var k,t=N(this),E=N(W),S=N(V),A=N("body"),F=t.selector||"",O=(new Date).getTime(),D=[],j=x,H="string"==typeof j,R=[].slice.call(arguments,1);return t.each(function(){var u,p,t,e,o,c,d=N.isPlainObject(x)?N.extend(!0,{},N.fn.popup.settings,x):N.extend({},N.fn.popup.settings),i=d.selector,f=d.className,g=d.error,h=d.metadata,n=d.namespace,r="."+d.namespace,a="module-"+n,m=N(this),s=N(d.context),l=N(d.scrollContext),v=N(d.boundary),b=d.target?N(d.target):m,w=0,y=!1,P=!1,C=this,T=m.data(a);c={initialize:function(){c.debug("Initializing",m),c.createID(),c.bind.events(),!c.exists()&&d.preserve&&c.create(),d.observeChanges&&c.observeChanges(),c.instantiate()},instantiate:function(){c.verbose("Storing instance",c),T=c,m.data(a,T)},observeChanges:function(){"MutationObserver"in V&&((t=new MutationObserver(c.event.documentChanged)).observe(W,{childList:!0,subtree:!0}),c.debug("Setting up mutation observer",t))},refresh:function(){d.popup?u=N(d.popup).eq(0):d.inline&&(u=b.nextAll(i.popup).eq(0),d.popup=u),d.popup?(u.addClass(f.loading),p=c.get.offsetParent(),u.removeClass(f.loading),d.movePopup&&c.has.popup()&&c.get.offsetParent(u)[0]!==p[0]&&(c.debug("Moving popup to the same offset parent as target"),u.detach().appendTo(p))):p=d.inline?c.get.offsetParent(b):c.has.popup()?c.get.offsetParent(u):A,p.is("html")&&p[0]!==A[0]&&(c.debug("Setting page as offset parent"),p=A),c.get.variation()&&c.set.variation()},reposition:function(){c.refresh(),c.set.position()},destroy:function(){c.debug("Destroying previous module"),t&&t.disconnect(),u&&!d.preserve&&c.removePopup(),clearTimeout(c.hideTimer),clearTimeout(c.showTimer),c.unbind.close(),c.unbind.events(),m.removeData(a)},event:{start:function(t){var e=N.isPlainObject(d.delay)?d.delay.show:d.delay;clearTimeout(c.hideTimer),P||(c.showTimer=setTimeout(c.show,e))},end:function(){var t=N.isPlainObject(d.delay)?d.delay.hide:d.delay;clearTimeout(c.showTimer),c.hideTimer=setTimeout(c.hide,t)},touchstart:function(t){P=!0,c.show()},resize:function(){c.is.visible()&&c.set.position()},documentChanged:function(t){[].forEach.call(t,function(t){t.removedNodes&&[].forEach.call(t.removedNodes,function(t){(t==C||0").addClass(f.popup).data(h.activator,m).html(t),d.inline?(c.verbose("Inserting popup element inline",u),u.insertAfter(m)):(c.verbose("Appending popup element to body",u),u.appendTo(s)),c.refresh(),c.set.variation(),d.hoverable&&c.bind.popup(),d.onCreate.call(u,C)):0!==b.next(i.popup).length?(c.verbose("Pre-existing popup found"),d.inline=!0,d.popup=b.next(i.popup).data(h.activator,m),c.refresh(),d.hoverable&&c.bind.popup()):d.popup?(N(d.popup).data(h.activator,m),c.verbose("Used popup specified in settings"),c.refresh(),d.hoverable&&c.bind.popup()):c.debug("No content specified skipping display",C)},createID:function(){o=(Math.random().toString(16)+"000000000").substr(2,8),e="."+o,c.verbose("Creating unique id for element",o)},toggle:function(){c.debug("Toggling pop-up"),c.is.hidden()?(c.debug("Popup is hidden, showing pop-up"),c.unbind.close(),c.show()):(c.debug("Popup is visible, hiding pop-up"),c.hide())},show:function(t){if(t=t||function(){},c.debug("Showing pop-up",d.transition),c.is.hidden()&&(!c.is.active()||!c.is.dropdown())){if(c.exists()||c.create(),!1===d.onShow.call(u,C))return void c.debug("onShow callback returned false, cancelling popup animation");d.preserve||d.popup||c.refresh(),u&&c.set.position()&&(c.save.conditions(),d.exclusive&&c.hideAll(),c.animate.show(t))}},hide:function(t){if(t=t||function(){},c.is.visible()||c.is.animating()){if(!1===d.onHide.call(u,C))return void c.debug("onHide callback returned false, cancelling popup animation");c.remove.visible(),c.unbind.close(),c.restore.conditions(),c.animate.hide(t)}},hideAll:function(){N(i.popup).filter("."+f.popupVisible).each(function(){N(this).data(h.activator).popup("hide")})},exists:function(){return!!u&&(d.inline||d.popup?c.has.popup():1<=u.closest(s).length)},removePopup:function(){c.has.popup()&&!d.popup&&(c.debug("Removing popup",u),u.remove(),u=M,d.onRemove.call(u,C))},save:{conditions:function(){c.cache={title:m.attr("title")},c.cache.title&&m.removeAttr("title"),c.verbose("Saving original attributes",c.cache.title)}},restore:{conditions:function(){return c.cache&&c.cache.title&&(m.attr("title",c.cache.title),c.verbose("Restoring original attributes",c.cache.title)),!0}},supports:{svg:function(){return"undefined"==typeof SVGGraphicsElement}},animate:{show:function(t){t=N.isFunction(t)?t:function(){},d.transition&&N.fn.transition!==M&&m.transition("is supported")?(c.set.visible(),u.transition({animation:d.transition+" in",queue:!1,debug:d.debug,verbose:d.verbose,duration:d.duration,onComplete:function(){c.bind.close(),t.call(u,C),d.onVisible.call(u,C)}})):c.error(g.noTransition)},hide:function(t){t=N.isFunction(t)?t:function(){},c.debug("Hiding pop-up"),!1!==d.onHide.call(u,C)?d.transition&&N.fn.transition!==M&&m.transition("is supported")?u.transition({animation:d.transition+" out",queue:!1,duration:d.duration,debug:d.debug,verbose:d.verbose,onComplete:function(){c.reset(),t.call(u,C),d.onHidden.call(u,C)}}):c.error(g.noTransition):c.debug("onHide callback returned false, cancelling popup animation")}},change:{content:function(t){u.html(t)}},get:{html:function(){return m.removeData(h.html),m.data(h.html)||d.html},title:function(){return m.removeData(h.title),m.data(h.title)||d.title},content:function(){return m.removeData(h.content),m.data(h.content)||d.content||m.attr("title")},variation:function(){return m.removeData(h.variation),m.data(h.variation)||d.variation},popup:function(){return u},popupOffset:function(){return u.offset()},calculations:function(){var t,e=c.get.offsetParent(u),o=b[0],n=v[0]==V,i=d.inline||d.popup&&d.movePopup?b.position():b.offset(),r=n?{top:0,left:0}:v.offset(),a={},s=n?{top:S.scrollTop(),left:S.scrollLeft()}:{top:0,left:0};if(a={target:{element:b[0],width:b.outerWidth(),height:b.outerHeight(),top:i.top,left:i.left,margin:{}},popup:{width:u.outerWidth(),height:u.outerHeight()},parent:{width:p.outerWidth(),height:p.outerHeight()},screen:{top:r.top,left:r.left,scroll:{top:s.top,left:s.left},width:v.width(),height:v.height()}},e.get(0)!==p.get(0)){var l=e.offset();a.target.top-=l.top,a.target.left-=l.left,a.parent.width=e.outerWidth(),a.parent.height=e.outerHeight()}return d.setFluidWidth&&c.is.fluid()&&(a.container={width:u.parent().outerWidth()},a.popup.width=a.container.width),a.target.margin.top=d.inline?parseInt(V.getComputedStyle(o).getPropertyValue("margin-top"),10):0,a.target.margin.left=d.inline?c.is.rtl()?parseInt(V.getComputedStyle(o).getPropertyValue("margin-right"),10):parseInt(V.getComputedStyle(o).getPropertyValue("margin-left"),10):0,t=a.screen,a.boundary={top:t.top+t.scroll.top,bottom:t.top+t.scroll.top+t.height,left:t.left+t.scroll.left,right:t.left+t.scroll.left+t.width},a},id:function(){return o},startEvent:function(){return"hover"==d.on?"mouseenter":"focus"==d.on&&"focus"},scrollEvent:function(){return"scroll"},endEvent:function(){return"hover"==d.on?"mouseleave":"focus"==d.on&&"blur"},distanceFromBoundary:function(t,e){var o,n,i={};return o=(e=e||c.get.calculations()).popup,n=e.boundary,t&&(i={top:t.top-n.top,left:t.left-n.left,right:n.right-(t.left+o.width),bottom:n.bottom-(t.top+o.height)},c.verbose("Distance from boundaries determined",t,i)),i},offsetParent:function(t){var e=(t!==M?t[0]:b[0]).parentNode,o=N(e);if(e)for(var n="none"===o.css("transform"),i="static"===o.css("position"),r=o.is("body");e&&!r&&i&&n;)e=e.parentNode,n="none"===(o=N(e)).css("transform"),i="static"===o.css("position"),r=o.is("body");return o&&0",notFound:"The target or popup you specified does not exist on the page"},metadata:{activator:"activator",content:"content",html:"html",offset:"offset",position:"position",title:"title",variation:"variation"},className:{active:"active",basic:"basic",animating:"animating",dropdown:"dropdown",fluid:"fluid",loading:"loading",popup:"ui popup",position:"top left center bottom right",visible:"visible",popupVisible:"visible"},selector:{popup:".ui.popup"},templates:{escape:function(t){var e={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"};return/[&<>"'`]/.test(t)?t.replace(/[&<>"'`]/g,function(t){return e[t]}):t},popup:function(t){var e="",o=N.fn.popup.settings.templates.escape;return typeof t!==M&&(typeof t.title!==M&&t.title&&(t.title=o(t.title),e+='
'+t.title+"
"),typeof t.content!==M&&t.content&&(t.content=o(t.content),e+='
'+t.content+"
")),e}}}}(jQuery,window,document);