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