function _setup(t,i){this.$element=t;this.options=e.extend({},Reveal.defaults,this.$element.data(),i);this.className="Reveal";this._init();f.init(e);k.init(e);l.register("Reveal",{ESCAPE:"close"})}},{key:"_init",value:function _init(){var t=this;i._init();this.id=this.$element.attr("id");this.isActive=false;this.cached={mq:i.current};this.$anchor=e('[data-open="'.concat(this.id,'"]')).length?e('[data-open="'.concat(this.id,'"]')):e('[data-toggle="'.concat(this.id,'"]'));this.$anchor.attr({"aria-controls":this.id,"aria-haspopup":"dialog",tabindex:0});if(this.options.fullScreen||this.$element.hasClass("full")){this.options.fullScreen=true;this.options.overlay=false}this.options.overlay&&!this.$overlay&&(this.$overlay=this._makeOverlay(this.id));this.$element.attr({role:"dialog","aria-hidden":true,"data-yeti-box":this.id,"data-resize":this.id});if(this.$overlay)this.$element.detach().appendTo(this.$overlay);else{this.$element.detach().appendTo(e(this.options.appendTo));this.$element.addClass("without-overlay")}this._events();this.options.deepLink&&window.location.hash==="#".concat(this.id)&&(this.onLoadListener=onLoad(e(window),(function(){return t.open()})))}},{key:"_makeOverlay",value:function _makeOverlay(){var t="";this.options.additionalOverlayClasses&&(t=" "+this.options.additionalOverlayClasses);return e("<div></div>").addClass("reveal-overlay"+t).appendTo(this.options.appendTo)}},{key:"_updatePosition",value:function _updatePosition(){var t=this.$element.outerWidth();var i=e(window).width();var n=this.$element.outerHeight();var s=e(window).height();var a,o=null;a="auto"===this.options.hOffset?parseInt((i-t)/2,10):parseInt(this.options.hOffset,10);"auto"===this.options.vOffset?o=n>s?parseInt(Math.min(100,s/10),10):parseInt((s-n)/4,10):null!==this.options.vOffset&&(o=parseInt(this.options.vOffset,10));null!==o&&this.$element.css({top:o+"px"});if(!this.$overlay||"auto"!==this.options.hOffset){this.$element.css({left:a+"px"});this.$element.css({margin:"0px"})}}},{key:"_events",value:function _events(){var t=this;var i=this;this.$element.on({"open.zf.trigger":this.open.bind(this),"close.zf.trigger":function closeZfTrigger(n,s){if(n.target===i.$element[0]||e(n.target).parents("[data-closable]")[0]===s)return t.close.apply(t)},"toggle.zf.trigger":this.toggle.bind(this),"resizeme.zf.trigger":function resizemeZfTrigger(){i._updatePosition()}});this.options.closeOnClick&&this.options.overlay&&this.$overlay.off(".zf.reveal").on("click.zf.dropdown tap.zf.dropdown",(function(t){t.target!==i.$element[0]&&!e.contains(i.$element[0],t.target)&&e.contains(document,t.target)&&i.close()}));this.options.deepLink&&e(window).on("hashchange.zf.reveal:".concat(this.id),this._handleState.bind(this))}},{key:"_handleState",value:function _handleState(){window.location.hash!=="#"+this.id||this.isActive?this.close():this.open()}