").append(c.clone()).html()),g()):(d.html(c),g());else if(a.url){var v=function(){var t=l.callComEvent(r,"broken");t&&(d.html(t),g())};if(l.attr("ref",a.url),"iframe"===a.type){l.addClass("modal-iframe"),this.firstLoad=!0;var y="iframe-"+a.name;u.detach(),d.detach(),p.empty().append(u).append(d),d.css("padding",0).html('
'),a.waittime>0&&(r.waitTimeout=g(a.waittime,v));var b=document.getElementById(y);b.onload=b.onreadystatechange=function(){if(r.firstLoad&&l.addClass("modal-loading"),!this.readyState||"complete"==this.readyState){r.firstLoad=!1,a.waittime>0&&clearTimeout(r.waitTimeout);try{l.attr("ref",b.contentWindow.location.href);var t=e.frames[y].$;if(t&&"auto"===a.height&&"fullscreen"!=a.size){var i=t("body").addClass("body-modal");a.iframeBodyClass&&i.addClass(a.iframeBodyClass);var n=function(t){l.removeClass("fade"),console.log("$framebody.outerHeight()",i.outerHeight());var e=i.outerHeight();t===!0&&a.onlyIncreaseHeight&&(e=Math.max(e,d.data("minModalHeight")||0),d.data("minModalHeight",e)),d.css("height",e),a.fade&&l.addClass("fade"),g()};l.callComEvent(r,"loaded",{modalType:"iframe",jQuery:t}),setTimeout(n,100),i.off("resize."+s).on("resize."+s,f)}else g()}catch(o){g()}}}}else t.ajax(t.extend({url:a.url,success:function(i){try{var s=t(i);s.filter(".modal-dialog").length?h.replaceWith(s):s.filter(".modal-content").length?h.find(".modal-content").replaceWith(s):d.wrapInner(s)}catch(a){e.console&&e.console.warn&&console.warn("ZUI: Cannot recogernize remote content.",{error:a,data:i}),l.html(i)}l.callComEvent(r,"loaded",{modalType:n}),g()},error:v},a.ajaxOptions))}l.modal({show:"show",backdrop:a.backdrop,moveable:a.moveable,rememberPos:a.rememberPos,keyboard:a.keyboard})},r.prototype.close=function(i,s){(i||s)&&this.$modal.on("hidden"+a,function(){t.isFunction(i)&&i(),typeof s===o&&("this"===s?e.location.reload():e.location=s)}),this.$modal.modal("hide")},r.prototype.toggle=function(t){this.isShown?this.close():this.show(t)},r.prototype.ajustPosition=function(e){e=e===i?this.options.position:e,t.isFunction(e)&&(e=e(this)),this.$modal.modal("ajustPosition",e)},t.zui({ModalTrigger:r,modalTrigger:new r}),t.fn.modalTrigger=function(e,i){return t(this).each(function(){var n=t(this),a=n.data(s),l=t.extend({title:n.attr("title")||n.text(),url:n.attr("href"),type:n.hasClass("iframe")?"iframe":""},n.data(),t.isPlainObject(e)&&e);a||n.data(s,a=new r(l,n)),typeof e==o?a[e](i):l.show&&a.show(i),n.on((l.trigger||"click")+".toggle."+s,function(t){a.toggle(l),n.is("a")&&t.preventDefault()})})};var l=t.fn.modal;t.fn.modal=function(e,i){return t(this).each(function(){var s=t(this);s.hasClass("modal")?l.call(s,e,i):s.modalTrigger(e,i)})};var h=function(e){var i=typeof e;return"undefined"===i?e=t(".modal.modal-trigger"):i===o&&(e=t(e)),e&&e instanceof t?e:null},c=function(i,n,a){var o=i;if(t.isFunction(i)){var r=a;a=n,n=i,i=r}i=h(i),i&&i.length?i.each(function(){t(this).data(s).close(n,a)}):t("body").hasClass("body-modal")&&e.parent.$.zui.closeModal(o,n,a)},d=function(t,e){e=h(e),e&&e.length&&e.modal("ajustPosition",t)};t.zui({closeModal:c,ajustModalPosition:d}),t(document).on("click."+s+".data-api",'[data-toggle="modal"]',function(e){var i=t(this),n=i.attr("href"),a=null;try{a=t(i.attr("data-target")||n&&n.replace(/.*(?=#[^\s]+$)/,""))}catch(o){}a&&a.length||(i.data(s)?i.trigger(".toggle."+s):i.modalTrigger({show:!0})),i.is("a")&&e.preventDefault()}).on("click."+s+".data-api",'[data-dismiss="modal"]',function(){t.zui.closeModal()})}(window.jQuery,window,void 0),+function(t){"use strict";var e=function(t,e){this.type=null,this.options=null,this.enabled=null,this.timeout=null,this.hoverState=null,this.$element=null,this.init("tooltip",t,e)};e.DEFAULTS={animation:!0,placement:"top",selector:!1,template:'
',trigger:"hover focus",title:"",delay:0,html:!1,container:!1},e.prototype.init=function(e,i,s){this.enabled=!0,this.type=e,this.$element=t(i),this.options=this.getOptions(s);for(var n=this.options.trigger.split(" "),a=n.length;a--;){var o=n[a];if("click"==o)this.$element.on("click."+this.type,this.options.selector,t.proxy(this.toggle,this));else if("manual"!=o){var r="hover"==o?"mouseenter":"focus",l="hover"==o?"mouseleave":"blur";this.$element.on(r+"."+this.type,this.options.selector,t.proxy(this.enter,this)),this.$element.on(l+"."+this.type,this.options.selector,t.proxy(this.leave,this))}}this.options.selector?this._options=t.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},e.prototype.getDefaults=function(){return e.DEFAULTS},e.prototype.getOptions=function(e){return e=t.extend({},this.getDefaults(),this.$element.data(),e),e.delay&&"number"==typeof e.delay&&(e.delay={show:e.delay,hide:e.delay}),e},e.prototype.getDelegateOptions=function(){var e={},i=this.getDefaults();return this._options&&t.each(this._options,function(t,s){i[t]!=s&&(e[t]=s)}),e},e.prototype.enter=function(e){var i=e instanceof this.constructor?e:t(e.currentTarget)[this.type](this.getDelegateOptions()).data("zui."+this.type);return clearTimeout(i.timeout),i.hoverState="in",i.options.delay&&i.options.delay.show?void(i.timeout=setTimeout(function(){"in"==i.hoverState&&i.show()},i.options.delay.show)):i.show()},e.prototype.leave=function(e){var i=e instanceof this.constructor?e:t(e.currentTarget)[this.type](this.getDelegateOptions()).data("zui."+this.type);return clearTimeout(i.timeout),i.hoverState="out",i.options.delay&&i.options.delay.hide?void(i.timeout=setTimeout(function(){"out"==i.hoverState&&i.hide()},i.options.delay.hide)):i.hide()},e.prototype.show=function(e){var i=t.Event("show.zui."+this.type);if((e||this.hasContent())&&this.enabled){var s=this;if(s.$element.trigger(i),i.isDefaultPrevented())return;var n=s.tip();s.setContent(e),s.options.animation&&n.addClass("fade");var a="function"==typeof s.options.placement?s.options.placement.call(s,n[0],s.$element[0]):s.options.placement,o=/\s?auto?\s?/i,r=o.test(a);r&&(a=a.replace(o,"")||"top"),n.detach().css({top:0,left:0,display:"block"}).addClass(a),s.options.container?n.appendTo(s.options.container):n.insertAfter(s.$element);var l=s.getPosition(),h=n[0].offsetWidth,c=n[0].offsetHeight;if(r){var d=s.$element.parent(),u=a,p=document.documentElement.scrollTop||document.body.scrollTop,f="body"==s.options.container?window.innerWidth:d.outerWidth(),g="body"==s.options.container?window.innerHeight:d.outerHeight(),m="body"==s.options.container?0:d.offset().left;a="bottom"==a&&l.top+l.height+c-p>g?"top":"top"==a&&l.top-p-c<0?"bottom":"right"==a&&l.right+h>f?"left":"left"==a&&l.left-h
'}),e.prototype=t.extend({},t.fn.tooltip.Constructor.prototype),e.prototype.constructor=e,e.prototype.getDefaults=function(){return e.DEFAULTS},e.prototype.setContent=function(){var t=this.tip(),e=this.getTarget();if(e)return e.find(".arrow").length<1&&t.addClass("no-arrow"),void t.html(e.html());var i=this.getTitle(),s=this.getContent();t.find(".popover-title")[this.options.html?"html":"text"](i),t.find(".popover-content")[this.options.html?"html":"text"](s),t.removeClass("fade top bottom left right in"),this.options.tipId&&t.attr("id",this.options.tipId),this.options.tipClass&&t.addClass(this.options.tipClass),t.find(".popover-title").html()||t.find(".popover-title").hide()},e.prototype.hasContent=function(){return this.getTarget()||this.getTitle()||this.getContent();
-},e.prototype.getContent=function(){var t=this.$element,e=this.options;return t.attr("data-content")||("function"==typeof e.content?e.content.call(t[0]):e.content)},e.prototype.getTarget=function(){var e=this.$element,i=this.options,s=e.attr("data-target")||("function"==typeof i.target?i.target.call(e[0]):i.target);return!!s&&("$next"==s?e.next(".popover"):t(s))},e.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")},e.prototype.tip=function(){return this.$tip||(this.$tip=t(this.options.template)),this.$tip};var i=t.fn.popover;t.fn.popover=function(i){return this.each(function(){var s=t(this),n=s.data("zui.popover"),a="object"==typeof i&&i;n||s.data("zui.popover",n=new e(this,a)),"string"==typeof i&&n[i]()})},t.fn.popover.Constructor=e,t.fn.popover.noConflict=function(){return t.fn.popover=i,this}}(window.jQuery),+function(t){"use strict";function e(){t(n).remove(),t(a).each(function(e){var n=i(t(this));n.hasClass("open")&&(n.trigger(e=t.Event("hide."+s)),e.isDefaultPrevented()||n.removeClass("open").trigger("hidden."+s))})}function i(e){var i=e.attr("data-target");i||(i=e.attr("href"),i=i&&/#/.test(i)&&i.replace(/.*(?=#[^\s]*$)/,""));var s;try{s=i&&t(i)}catch(n){}return s&&s.length?s:e.parent()}var s="zui.dropdown",n=".dropdown-backdrop",a="[data-toggle=dropdown]",o=function(e){t(e).on("click."+s,this.toggle)};o.prototype.toggle=function(n){var a=t(this);if(!a.is(".disabled, :disabled")){var o=i(a),r=o.hasClass("open");if(e(),!r){if("ontouchstart"in document.documentElement&&!o.closest(".navbar-nav").length&&t('