vendor: 39,680 bytes, lines 1-6
1/*! 2 * Bootstrap v3.4.1 (https://getbootstrap.com/) 3 * Copyright 2011-2019 Twitter, Inc. 4 * Licensed under the MIT license 5 */ 6if("undefined"==typeof jQuery)throw new Error("Bootstrap's JavaScript requires jQuery");!function(t){"use strict";var e=jQuery.fn.jquery.split(" ")[0].split(".");if(e[0]<2&&e[1]<9||1==e[0]&&9==e[1]&&e[2]<1||3<e[0])throw new Error("Bootstrap's JavaScript requires jQuery version 1.9.1 or higher, but lower than version 4")}(),function(n){"use strict";n.fn.emulateTransitionEnd=function(t){var e=!1,i=this;n(this).one("bsTransitionEnd",function(){e=!0});return setTimeout(function(){e||n(i).trigger(n.support.transition.end)},t),this},n(function(){n.support.transition=function o(){var t=document.createElement("bootstrap"),e={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var i in e)if(t.style[i]!==undefined)return{end:e[i]};return!1}(),n.support.transition&&(n.event.special.bsTransitionEnd={bindType:n.support.transition.end,delegateType:n.support.transition.end,handle:function(t){if(n(t.target).is(this))return t.handleObj.handler.apply(this,arguments)}})})}(jQuery),function(s){"use strict";var e='[data-dismiss="alert"]',a=function(t){s(t).on("click",e,this.close)};a.VERSION="3.4.1",a.TRANSITION_DURATION=150,a.prototype.close=function(t){var e=s(this),i=e.attr("data-target");i||(i=(i=e.attr("href"))&&i.replace(/.*(?=#[^\s]*$)/,"")),i="#"===i?[]:i;var o=s(document).find(i);function n(){o.detach().trigger("closed.bs.alert").remove()}t&&t.preventDefault(),o.length||(o=e.closest(".alert")),o.trigger(t=s.Event("close.bs.alert")),t.isDefaultPrevented()||(o.removeClass("in"),s.support.transition&&o.hasClass("fade")?o.one("bsTransitionEnd",n).emulateTransitionEnd(a.TRANSITION_DURATION):n())};var t=s.fn.alert;s.fn.alert=function o(i){return this.each(function(){var t=s(this),e=t.data("bs.alert");e||t.data("bs.alert",e=new a(this)),"string"==typeof i&&e[i].call(t)})},s.fn.alert.Constructor=a,s.fn.alert.noConflict=function(){return s.fn.alert=t,this},s(document).on("click.bs.alert.data-api",e,a.prototype.close)}(jQuery),function(s){"use strict";var n=function(t,e){this.$element=s(t),this.options=s.extend({},n.DEFAULTS,e),this.isLoading=!1};function i(o){return this.each(function(){var t=s(this),e=t.data("bs.button"),i="object"==typeof o&&o;e||t.data("bs.button",e=new n(this,i)),"toggle"==o?e.toggle():o&&e.setState(o)})}n.VERSION="3.4.1",n.DEFAULTS={loadingText:"loading..."},n.prototype.setState=function(t){var e="disabled",i=this.$element,o=i.is("input")?"val":"html",n=i.data();t+="Text",null==n.resetText&&i.data("resetText",i[o]()),setTimeout(s.proxy(function(){i[o](null==n[t]?this.options[t]:n[t]),"loadingText"==t?(this.isLoading=!0,i.addClass(e).attr(e,e).prop(e,!0)):this.isLoading&&(this.isLoading=!1,i.removeClass(e).removeAttr(e).prop(e,!1))},this),0)},n.prototype.toggle=function(){var t=!0,e=this.$element.closest('[data-toggle="buttons"]');if(e.length){var i=this.$element.find("input");"radio"==i.prop("type")?(i.prop("checked")&&(t=!1),e.find(".active").removeClass("active"),this.$element.addClass("active")):"checkbox"==i.prop("type")&&(i.prop("checked")!==this.$element.hasClass("active")&&(t=!1),this.$element.toggleClass("active")),i.prop("checked",this.$element.hasClass("active")),t&&i.trigger("change")}else this.$element.attr("aria-pressed",!this.$element.hasClass("active")),this.$element.toggleClass("active")};var t=s.fn.button;s.fn.button=i,s.fn.button.Constructor=n,s.fn.button.noConflict=function(){return s.fn.button=t,this},s(document).on("click.bs.button.data-api",'[data-toggle^="button"]',function(t){var e=s(t.target).closest(".btn");i.call(e,"toggle"),s(t.target).is('input[type="radio"], input[type="checkbox"]')||(t.preventDefault(),e.is("input,button")?e.trigger("focus"):e.find("input:visible,button:visible").first().trigger("focus"))}).on("focus.bs.button.data-api blur.bs.button.data-api",'[data-toggle^="button"]',function(t){s(t.target).closest(".btn").toggleClass("focus",/^focus(in)?$/.test(t.type))})}(jQuery),function(p){"use strict";var c=function(t,e){this.$element=p(t),this.$indicators=this.$element.find(".carousel-indicators"),this.options=e,this.paused=null,this.sliding=null,this.interval=null,this.$active=null,this.$items=null,this.options.keyboard&&this.$element.on("keydown.bs.carousel",p.proxy(this.keydown,this)),"hover"==this.options.pause&&!("ontouchstart"in document.documentElement)&&this.$element.on("mouseenter.bs.carousel",p.proxy(this.pause,this)).on("mouseleave.bs.carousel",p.proxy(this.cycle,this))};function r(n){return this.each(function(){var t=p(this),e=t.data("bs.carousel"),i=p.extend({},c.DEFAULTS,t.data(),"object"==typeof n&&n),o="string"==typeof n?n:i.slide;e||t.data("bs.carousel",e=new c(this,i)),"number"==typeof n?e.to(n):o?e[o]():i.interval&&e.pause().cycle()})}c.VERSION="3.4.1",c.TRANSITION_DURATION=600,c.DEFAULTS={interval:5e3,pause:"hover",wrap:!0,keyboard:!0},c.prototype.keydown=function(t){if(!/input|textarea/i.test(t.target.tagName)){switch(t.which){case 37:this.prev();break;case 39:this.next();break;default:return}t.preventDefault()}},c.prototype.cycle=function(t){return t||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(p.proxy(this.next,this),this.options.interval)),this},c.prototype.getItemIndex=function(t){return this.$items=t.parent().children(".item"),this.$items.index(t||this.$active)},c.prototype.getItemForDirection=function(t,e){var i=this.getItemIndex(e);if(("prev"==t&&0===i||"next"==t&&i==this.$items.length-1)&&!this.options.wrap)return e;var o=(i+("prev"==t?-1:1))%this.$items.length;return this.$items.eq(o)},c.prototype.to=function(t){var e=this,i=this.getItemIndex(this.$active=this.$element.find(".item.active"));if(!(t>this.$items.length-1||t<0))return this.sliding?this.$element.one("slid.bs.carousel",function(){e.to(t)}):i==t?this.pause().cycle():this.slide(i<t?"next":"prev",this.$items.eq(t))},c.prototype.pause=function(t){return t||(this.paused=!0),this.$element.find(".next, .prev").length&&p.support.transition&&(this.$element.trigger(p.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this},c.prototype.next=function(){if(!this.sliding)return this.slide("next")},c.prototype.prev=function(){if(!this.sliding)return this.slide("prev")},c.prototype.slide=function(t,e){var i=this.$element.find(".item.active"),o=e||this.getItemForDirection(t,i),n=this.interval,s="next"==t?"left":"right",a=this;if(o.hasClass("active"))return this.sliding=!1;var r=o[0],l=p.Event("slide.bs.carousel",{relatedTarget:r,direction:s});if(this.$element.trigger(l),!l.isDefaultPrevented()){if(this.sliding=!0,n&&this.pause(),this.$indicators.length){this.$indicators.find(".active").removeClass("active");var h=p(this.$indicators.children()[this.getItemIndex(o)]);h&&h.addClass("active")}var d=p.Event("slid.bs.carousel",{relatedTarget:r,direction:s});return p.support.transition&&this.$element.hasClass("slide")?(o.addClass(t),"object"==typeof o&&o.length&&o[0].offsetWidth,i.addClass(s),o.addClass(s),i.one("bsTransitionEnd",function(){o.removeClass([t,s].join(" ")).addClass("active"),i.removeClass(["active",s].join(" ")),a.sliding=!1,setTimeout(function(){a.$element.trigger(d)},0)}).emulateTransitionEnd(c.TRANSITION_DURATION)):(i.removeClass("active"),o.addClass("active"),this.sliding=!1,this.$element.trigger(d)),n&&this.cycle(),this}};var t=p.fn.carousel;p.fn.carousel=r,p.fn.carousel.Constructor=c,p.fn.carousel.noConflict=function(){return p.fn.carousel=t,this};var e=function(t){var e=p(this),i=e.attr("href");i&&(i=i.replace(/.*(?=#[^\s]+$)/,""));var o=e.attr("data-target")||i,n=p(document).find(o);if(n.hasClass("carousel")){var s=p.extend({},n.data(),e.data()),a=e.attr("data-slide-to");a&&(s.interval=!1),r.call(n,s),a&&n.data("bs.carousel").to(a),t.preventDefault()}};p(document).on("click.bs.carousel.data-api","[data-slide]",e).on("click.bs.carousel.data-api","[data-slide-to]",e),p(window).on("load",function(){p('[data-ride="carousel"]').each(function(){var t=p(this);r.call(t,t.data())})})}(jQuery),function(a){"use strict";var r=function(t,e){this.$element=a(t),this.options=a.extend({},r.DEFAULTS,e),this.$trigger=a('[data-toggle="collapse"][href="#'+t.id+'"],[data-toggle="collapse"][data-target="#'+t.id+'"]'),this.transitioning=null,this.options.parent?this.$parent=this.getParent():this.addAriaAndCollapsedClass(this.$element,this.$trigger),this.options.toggle&&this.toggle()};function n(t){var e,i=t.attr("data-target")||(e=t.attr("href"))&&e.replace(/.*(?=#[^\s]+$)/,"");return a(document).find(i)}function l(o){return this.each(function(){var t=a(this),e=t.data("bs.collapse"),i=a.extend({},r.DEFAULTS,t.data(),"object"==typeof o&&o);!e&&i.toggle&&/show|hide/.test(o)&&(i.toggle=!1),e||t.data("bs.collapse",e=new r(this,i)),"string"==typeof o&&e[o]()})}r.VERSION="3.4.1",r.TRANSITION_DURATION=350,r.DEFAULTS={toggle:!0},r.prototype.dimension=function(){return this.$element.hasClass("width")?"width":"height"},r.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var t,e=this.$parent&&this.$parent.children(".panel").children(".in, .collapsing");if(!(e&&e.length&&(t=e.data("bs.collapse"))&&t.transitioning)){var i=a.Event("show.bs.collapse");if(this.$element.trigger(i),!i.isDefaultPrevented()){e&&e.length&&(l.call(e,"hide"),t||e.data("bs.collapse",null));var o=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[o](0).attr("aria-expanded",!0),this.$trigger.removeClass("collapsed").attr("aria-expanded",!0),this.transitioning=1;var n=function(){this.$element.removeClass("collapsing").addClass("collapse in")[o](""),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!a.support.transition)return n.call(this);var s=a.camelCase(["scroll",o].join("-"));this.$element.one("bsTransitionEnd",a.proxy(n,this)).emulateTransitionEnd(r.TRANSITION_DURATION)[o](this.$element[0][s])}}}},r.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var t=a.Event("hide.bs.collapse");if(this.$element.trigger(t),!t.isDefaultPrevented()){var e=this.dimension();this.$element[e](this.$element[e]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse in").attr("aria-expanded",!1),this.$trigger.addClass("collapsed").attr("aria-expanded",!1),this.transitioning=1;var i=function(){this.transitioning=0,this.$element.removeClass("collapsing").addClass("collapse").trigger("hidden.bs.collapse")};if(!a.support.transition)return i.call(this);this.$element[e](0).one("bsTransitionEnd",a.proxy(i,this)).emulateTransitionEnd(r.TRANSITION_DURATION)}}},r.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()},r.prototype.getParent=function(){return a(document).find(this.options.parent).find('[data-toggle="collapse"][data-parent="'+this.options.parent+'"]').each(a.proxy(function(t,e){var i=a(e);this.addAriaAndCollapsedClass(n(i),i)},this)).end()},r.prototype.addAriaAndCollapsedClass=function(t,e){var i=t.hasClass("in");t.attr("aria-expanded",i),e.toggleClass("collapsed",!i).attr("aria-expanded",i)};var t=a.fn.collapse;a.fn.collapse=l,a.fn.collapse.Constructor=r,a.fn.collapse.noConflict=function(){return a.fn.collapse=t,this},a(document).on("click.bs.collapse.data-api",'[data-toggle="collapse"]',function(t){var e=a(this);e.attr("data-target")||t.preventDefault();var i=n(e),o=i.data("bs.collapse")?"toggle":e.data();l.call(i,o)})}(jQuery),function(a){"use strict";var r='[data-toggle="dropdown"]',o=function(t){a(t).on("click.bs.dropdown",this.toggle)};function l(t){var e=t.attr("data-target");e||(e=(e=t.attr("href"))&&/#[A-Za-z]/.test(e)&&e.replace(/.*(?=#[^\s]*$)/,""));var i="#"!==e?a(document).find(e):null;return i&&i.length?i:t.parent()}function s(o){o&&3===o.which||(a(".dropdown-backdrop").remove(),a(r).each(function(){var t=a(this),e=l(t),i={relatedTarget:this};e.hasClass("open")&&(o&&"click"==o.type&&/input|textarea/i.test(o.target.tagName)&&a.contains(e[0],o.target)||(e.trigger(o=a.Event("hide.bs.dropdown",i)),o.isDefaultPrevented()||(t.attr("aria-expanded","false"),e.removeClass("open").trigger(a.Event("hidden.bs.dropdown",i)))))}))}o.VERSION="3.4.1",o.prototype.toggle=function(t){var e=a(this);if(!e.is(".disabled, :disabled")){var i=l(e),o=i.hasClass("open");if(s(),!o){"ontouchstart"in document.documentElement&&!i.closest(".navbar-nav").length&&a(document.createElement("div")).addClass("dropdown-backdrop").insertAfter(a(this)).on("click",s);var n={relatedTarget:this};if(i.trigger(t=a.Event("show.bs.dropdown",n)),t.isDefaultPrevented())return;e.trigger("focus").attr("aria-expanded","true"),i.toggleClass("open").trigger(a.Event("shown.bs.dropdown",n))}return!1}},o.prototype.keydown=function(t){if(/(38|40|27|32)/.test(t.which)&&!/input|textarea/i.test(t.target.tagName)){var e=a(this);if(t.preventDefault(),t.stopPropagation(),!e.is(".disabled, :disabled")){var i=l(e),o=i.hasClass("open");if(!o&&27!=t.which||o&&27==t.which)return 27==t.which&&i.find(r).trigger("focus"),e.trigger("click");var n=i.find(".dropdown-menu li:not(.disabled):visible a");if(n.length){var s=n.index(t.target);38==t.which&&0<s&&s--,40==t.which&&s<n.length-1&&s++,~s||(s=0),n.eq(s).trigger("focus")}}}};var t=a.fn.dropdown;a.fn.dropdown=function e(i){return this.each(function(){var t=a(this),e=t.data("bs.dropdown");e||t.data("bs.dropdown",e=new o(this)),"string"==typeof i&&e[i].call(t)})},a.fn.dropdown.Constructor=o,a.fn.dropdown.noConflict=function(){return a.fn.dropdown=t,this},a(document).on("click.bs.dropdown.data-api",s).on("click.bs.dropdown.data-api",".dropdown form",function(t){t.stopPropagation()}).on("click.bs.dropdown.data-api",r,o.prototype.toggle).on("keydown.bs.dropdown.data-api",r,o.prototype.keydown).on("keydown.bs.dropdown.data-api",".dropdown-menu",o.prototype.keydown)}(jQuery),function(a){"use strict";var s=function(t,e){this.options=e,this.$body=a(document.body),this.$element=a(t),this.$dialog=this.$element.find(".modal-dialog"),this.$backdrop=null,this.isShown=null,this.originalBodyPad=null,this.scrollbarWidth=0,this.ignoreBackdropClick=!1,this.fixedContent=".navbar-fixed-top, .navbar-fixed-bottom",this.options.remote&&this.$element.find(".modal-content").load(this.options.remote,a.proxy(function(){this.$element.trigger("loaded.bs.modal")},this))};function r(o,n){return this.each(function(){var t=a(this),e=t.data("bs.modal"),i=a.extend({},s.DEFAULTS,t.data(),"object"==typeof o&&o);e||t.data("bs.modal",e=new s(this,i)),"string"==typeof o?e[o](n):i.show&&e.show(n)})}s.VERSION="3.4.1",s.TRANSITION_DURATION=300,s.BACKDROP_TRANSITION_DURATION=150,s.DEFAULTS={backdrop:!0,keyboard:!0,show:!0},s.prototype.toggle=function(t){return this.isShown?this.hide():this.show(t)},s.prototype.show=function(i){var o=this,t=a.Event("show.bs.modal",{relatedTarget:i});this.$element.trigger(t),this.isShown||t.isDefaultPrevented()||(this.isShown=!0,this.checkScrollbar(),this.setScrollbar(),this.$body.addClass("modal-open"),this.escape(),this.resize(),this.$element.on("click.dismiss.bs.modal",'[data-dismiss="modal"]',a.proxy(this.hide,this)),this.$dialog.on("mousedown.dismiss.bs.modal",function(){o.$element.one("mouseup.dismiss.bs.modal",function(t){a(t.target).is(o.$element)&&(o.ignoreBackdropClick=!0)})}),this.backdrop(function(){var t=a.support.transition&&o.$element.hasClass("fade");o.$element.parent().length||o.$element.appendTo(o.$body),o.$element.show().scrollTop(0),o.adjustDialog(),t&&o.$element[0].offsetWidth,o.$element.addClass("in"),o.enforceFocus();var e=a.Event("shown.bs.modal",{relatedTarget:i});t?o.$dialog.one("bsTransitionEnd",function(){o.$element.trigger("focus").trigger(e)}).emulateTransitionEnd(s.TRANSITION_DURATION):o.$element.trigger("focus").trigger(e)}))},s.prototype.hide=function(t){t&&t.preventDefault(),t=a.Event("hide.bs.modal"),this.$element.trigger(t),this.isShown&&!t.isDefaultPrevented()&&(this.isShown=!1,this.escape(),this.resize(),a(document).off("focusin.bs.modal"),this.$element.removeClass("in").off("click.dismiss.bs.modal").off("mouseup.dismiss.bs.modal"),this.$dialog.off("mousedown.dismiss.bs.modal"),a.support.transition&&this.$element.hasClass("fade")?this.$element.one("bsTransitionEnd",a.proxy(this.hideModal,this)).emulateTransitionEnd(s.TRANSITION_DURATION):this.hideModal())},s.prototype.enforceFocus=function(){a(document).off("focusin.bs.modal").on("focusin.bs.modal",a.proxy(function(t){document===t.target||this.$element[0]===t.target||this.$element.has(t.target).length||this.$element.trigger("focus")},this))},s.prototype.escape=function(){this.isShown&&this.options.keyboard?this.$element.on("keydown.dismiss.bs.modal",a.proxy(function(t){27==t.which&&this.hide()},this)):this.isShown||this.$element.off("keydown.dismiss.bs.modal")},s.prototype.resize=function(){this.isShown?a(window).on("resize.bs.modal",a.proxy(this.handleUpdate,this)):a(window).off("resize.bs.modal")},s.prototype.hideModal=function(){var t=this;this.$element.hide(),this.backdrop(function(){t.$body.removeClass("modal-open"),t.resetAdjustments(),t.resetScrollbar(),t.$element.trigger("hidden.bs.modal")})},s.prototype.removeBackdrop=function(){this.$backdrop&&this.$backdrop.remove(),this.$backdrop=null},s.prototype.backdrop=function(t){var e=this,i=this.$element.hasClass("fade")?"fade":"";if(this.isShown&&this.options.backdrop){var o=a.support.transition&&i;if(this.$backdrop=a(document.createElement("div")).addClass("modal-backdrop "+i).appendTo(this.$body),this.$element.on("click.dismiss.bs.modal",a.proxy(function(t){this.ignoreBackdropClick?this.ignoreBackdropClick=!1:t.target===t.currentTarget&&("static"==this.options.backdrop?this.$element[0].focus():this.hide())},this)),o&&this.$backdrop[0].offsetWidth,this.$backdrop.addClass("in"),!t)return;o?this.$backdrop.one("bsTransitionEnd",t).emulateTransitionEnd(s.BACKDROP_TRANSITION_DURATION):t()}else if(!this.isShown&&this.$backdrop){this.$backdrop.removeClass("in");var n=function(){e.removeBackdrop(),t&&t()};a.support.transition&&this.$element.hasClass("fade")?this.$backdrop.one("bsTransitionEnd",n).emulateTransitionEnd(s.BACKDROP_TRANSITION_DURATION):n()}else t&&t()},s.prototype.handleUpdate=function(){this.adjustDialog()},s.prototype.adjustDialog=function(){var t=this.$element[0].scrollHeight>document.documentElement.clientHeight;this.$element.css({paddingLeft:!this.bodyIsOverflowing&&t?this.scrollbarWidth:"",paddingRight:this.bodyIsOverflowing&&!t?this.scrollbarWidth:""})},s.prototype.resetAdjustments=function(){this.$element.css({paddingLeft:"",paddingRight:""})},s.prototype.checkScrollbar=function(){var t=window.innerWidth;if(!t){var e=document.documentElement.getBoundingClientRect();t=e.right-Math.abs(e.left)}this.bodyIsOverflowing=document.body.clientWidth<t,this.scrollbarWidth=this.measureScrollbar()},s.prototype.setScrollbar=function(){var t=parseInt(this.$body.css("padding-right")||0,10);this.originalBodyPad=document.body.style.paddingRight||"";var n=this.scrollbarWidth;this.bodyIsOverflowing&&(this.$body.css("padding-right",t+n),a(this.fixedContent).each(function(t,e){var i=e.style.paddingRight,o=a(e).css("padding-right");a(e).data("padding-right",i).css("padding-right",parseFloat(o)+n+"px")}))},s.prototype.resetScrollbar=function(){this.$body.css("padding-right",this.originalBodyPad),a(this.fixedContent).each(function(t,e){var i=a(e).data("padding-right");a(e).removeData("padding-right"),e.style.paddingRight=i||""})},s.prototype.measureScrollbar=function(){var t=document.createElement("div");t.className="modal-scrollbar-measure",this.$body.append(t);var e=t.offsetWidth-t.clientWidth;return this.$body[0].removeChild(t),e};var t=a.fn.modal;a.fn.modal=r,a.fn.modal.Constructor=s,a.fn.modal.noConflict=function(){return a.fn.modal=t,this},a(document).on("click.bs.modal.data-api",'[data-toggle="modal"]',function(t){var e=a(this),i=e.attr("href"),o=e.attr("data-target")||i&&i.replace(/.*(?=#[^\s]+$)/,""),n=a(document).find(o),s=n.data("bs.modal")?"toggle":a.extend({remote:!/#/.test(i)&&i},n.data(),e.data());e.is("a")&&t.preventDefault(),n.one("show.bs.modal",function(t){t.isDefaultPrevented()||n.one("hidden.bs.modal",function(){e.is(":visible")&&e.trigger("focus")})}),r.call(n,s,this)})}(jQuery),function(g){"use strict";var o=["sanitize","whiteList","sanitizeFn"],a=["background","cite","href","itemtype","longdesc","poster","src","xlink:href"],t={"*":["class","dir","id","lang","role",/^aria-[\w-]*$/i],a:["target","href","title","rel"],area:[],b:[],br:[],col:[],code:[],div:[],em:[],hr:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],i:[],img:["src","alt","title","width","height"],li:[],ol:[],p:[],pre:[],s:[],small:[],span:[],sub:[],sup:[],strong:[],u:[],ul:[]},r=/^(?:(?:https?|mailto|ftp|tel|file):|[^&:/?#]*(?:[/?#]|$))/gi,l=/^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[a-z0-9+/]+=*$/i;function u(t,e){var i=t.nodeName.toLowerCase();if(-1!==g.inArray(i,e))return-1===g.inArray(i,a)||Boolean(t.nodeValue.match(r)||t.nodeValue.match(l));for(var o=g(e).filter(function(t,e){return e instanceof RegExp}),n=0,s=o.length;n<s;n++)if(i.match(o[n]))return!0;return!1}function n(t,e,i){if(0===t.length)return t;if(i&&"function"==typeof i)return i(t);if(!document.implementation||!document.implementation.createHTMLDocument)return t;var o=document.implementation.createHTMLDocument("sanitization");o.body.innerHTML=t;for(var n=g.map(e,function(t,e){return e}),s=g(o.body).find("*"),a=0,r=s.length;a<r;a++){var l=s[a],h=l.nodeName.toLowerCase();if(-1!==g.inArray(h,n))for(var d=g.map(l.attributes,function(t){return t}),p=[].concat(e["*"]||[],e[h]||[]),c=0,f=d.length;c<f;c++)u(d[c],p)||l.removeAttribute(d[c].nodeName);else l.parentNode.removeChild(l)}return o.body.innerHTML}var m=function(t,e){this.type=null,this.options=null,this.enabled=null,this.timeout=null,this.hoverState=null,this.$element=null,this.inState=null,this.init("tooltip",t,e)};m.VERSION="3.4.1",m.TRANSITION_DURATION=150,m.DEFAULTS={animation:!0,placement:"top",selector:!1,template:'<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',trigger:"hover focus",title:"",delay:0,html:!1,container:!1,viewport:{selector:"body",padding:0},sanitize:!0,sanitizeFn:null,whiteList:t},m.prototype.init=function(t,e,i){if(this.enabled=!0,this.type=t,this.$element=g(e),this.options=this.getOptions(i),this.$viewport=this.options.viewport&&g(document).find(g.isFunction(this.options.viewport)?this.options.viewport.call(this,this.$element):this.options.viewport.selector||this.options.viewport),this.inState={click:!1,hover:!1,focus:!1},this.$element[0]instanceof document.constructor&&!this.options.selector)throw new Error("`selector` option must be specified when initializing "+this.type+" on the window.document object!");for(var o=this.options.trigger.split(" "),n=o.length;n--;){var s=o[n];if("click"==s)this.$element.on("click."+this.type,this.options.selector,g.proxy(this.toggle,this));else if("manual"!=s){var a="hover"==s?"mouseenter":"focusin",r="hover"==s?"mouseleave":"focusout";this.$element.on(a+"."+this.type,this.options.selector,g.proxy(this.enter,this)),this.$element.on(r+"."+this.type,this.options.selector,g.proxy(this.leave,this))}}this.options.selector?this._options=g.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},m.prototype.getDefaults=function(){return m.DEFAULTS},m.prototype.getOptions=function(t){var e=this.$element.data();for(var i in e)e.hasOwnProperty(i)&&-1!==g.inArray(i,o)&&delete e[i];return(t=g.extend({},this.getDefaults(),e,t)).delay&&"number"==typeof t.delay&&(t.delay={show:t.delay,hide:t.delay}),t.sanitize&&(t.template=n(t.template,t.whiteList,t.sanitizeFn)),t},m.prototype.getDelegateOptions=function(){var i={},o=this.getDefaults();return this._options&&g.each(this._options,function(t,e){o[t]!=e&&(i[t]=e)}),i},m.prototype.enter=function(t){var e=t instanceof this.constructor?t:g(t.currentTarget).data("bs."+this.type);if(e||(e=new this.constructor(t.currentTarget,this.getDelegateOptions()),g(t.currentTarget).data("bs."+this.type,e)),t instanceof g.Event&&(e.inState["focusin"==t.type?"focus":"hover"]=!0),e.tip().hasClass("in")||"in"==e.hoverState)e.hoverState="in";else{if(clearTimeout(e.timeout),e.hoverState="in",!e.options.delay||!e.options.delay.show)return e.show();e.timeout=setTimeout(function(){"in"==e.hoverState&&e.show()},e.options.delay.show)}},m.prototype.isInStateTrue=function(){for(var t in this.inState)if(this.inState[t])return!0;return!1},m.prototype.leave=function(t){var e=t instanceof this.constructor?t:g(t.currentTarget).data("bs."+this.type);if(e||(e=new this.constructor(t.currentTarget,this.getDelegateOptions()),g(t.currentTarget).data("bs."+this.type,e)),t instanceof g.Event&&(e.inState["focusout"==t.type?"focus":"hover"]=!1),!e.isInStateTrue()){if(clearTimeout(e.timeout),e.hoverState="out",!e.options.delay||!e.options.delay.hide)return e.hide();e.timeout=setTimeout(function(){"out"==e.hoverState&&e.hide()},e.options.delay.hide)}},m.prototype.show=function(){var t=g.Event("show.bs."+this.type);if(this.hasContent()&&this.enabled){this.$element.trigger(t);var e=g.contains(this.$element[0].ownerDocument.documentElement,this.$element[0]);if(t.isDefaultPrevented()||!e)return;var i=this,o=this.tip(),n=this.getUID(this.type);this.setContent(),o.attr("id",n),this.$element.attr("aria-describedby",n),this.options.animation&&o.addClass("fade");var s="function"==typeof this.options.placement?this.options.placement.call(this,o[0],this.$element[0]):this.options.placement,a=/\s?auto?\s?/i,r=a.test(s);r&&(s=s.replace(a,"")||"top"),o.detach().css({top:0,left:0,display:"block"}).addClass(s).data("bs."+this.type,this),this.options.container?o.appendTo(g(document).find(this.options.container)):o.insertAfter(this.$element),this.$element.trigger("inserted.bs."+this.type);var l=this.getPosition(),h=o[0].offsetWidth,d=o[0].offsetHeight;if(r){var p=s,c=this.getPosition(this.$viewport);s="bottom"==s&&l.bottom+d>c.bottom?"top":"top"==s&&l.top-d<c.top?"bottom":"right"==s&&l.right+h>c.width?"left":"left"==s&&l.left-h<c.left?"right":s,o.removeClass(p).addClass(s)}var f=this.getCalculatedOffset(s,l,h,d);this.applyPlacement(f,s);var u=function(){var t=i.hoverState;i.$element.trigger("shown.bs."+i.type),i.hoverState=null,"out"==t&&i.leave(i)};g.support.transition&&this.$tip.hasClass("fade")?o.one("bsTransitionEnd",u).emulateTransitionEnd(m.TRANSITION_DURATION):u()}},m.prototype.applyPlacement=function(t,e){var i=this.tip(),o=i[0].offsetWidth,n=i[0].offsetHeight,s=parseInt(i.css("margin-top"),10),a=parseInt(i.css("margin-left"),10);isNaN(s)&&(s=0),isNaN(a)&&(a=0),t.top+=s,t.left+=a,g.offset.setOffset(i[0],g.extend({using:function(t){i.css({top:Math.round(t.top),left:Math.round(t.left)})}},t),0),i.addClass("in");var r=i[0].offsetWidth,l=i[0].offsetHeight;"top"==e&&l!=n&&(t.top=t.top+n-l);var h=this.getViewportAdjustedDelta(e,t,r,l);h.left?t.left+=h.left:t.top+=h.top;var d=/top|bottom/.test(e),p=d?2*h.left-o+r:2*h.top-n+l,c=d?"offsetWidth":"offsetHeight";i.offset(t),this.replaceArrow(p,i[0][c],d)},m.prototype.replaceArrow=function(t,e,i){this.arrow().css(i?"left":"top",50*(1-t/e)+"%").css(i?"top":"left","")},m.prototype.setContent=function(){var t=this.tip(),e=this.getTitle();this.options.html?(this.options.sanitize&&(e=n(e,this.options.whiteList,this.options.sanitizeFn)),t.find(".tooltip-inner").html(e)):t.find(".tooltip-inner").text(e),t.removeClass("fade in top bottom left right")},m.prototype.hide=function(t){var e=this,i=g(this.$tip),o=g.Event("hide.bs."+this.type);function n(){"in"!=e.hoverState&&i.detach(),e.$element&&e.$element.removeAttr("aria-describedby").trigger("hidden.bs."+e.type),t&&t()}if(this.$element.trigger(o),!o.isDefaultPrevented())return i.removeClass("in"),g.support.transition&&i.hasClass("fade")?i.one("bsTransitionEnd",n).emulateTransitionEnd(m.TRANSITION_DURATION):n(),this.hoverState=null,this},m.prototype.fixTitle=function(){var t=this.$element;(t.attr("title")||"string"!=typeof t.attr("data-original-title"))&&t.attr("data-original-title",t.attr("title")||"").attr("title","")},m.prototype.hasContent=function(){return this.getTitle()},m.prototype.getPosition=function(t){var e=(t=t||this.$element)[0],i="BODY"==e.tagName,o=e.getBoundingClientRect();null==o.width&&(o=g.extend({},o,{width:o.right-o.left,height:o.bottom-o.top}));var n=window.SVGElement&&e instanceof window.SVGElement,s=i?{top:0,left:0}:n?null:t.offset(),a={scroll:i?document.documentElement.scrollTop||document.body.scrollTop:t.scrollTop()},r=i?{width:g(window).width(),height:g(window).height()}:null;return g.extend({},o,a,r,s)},m.prototype.getCalculatedOffset=function(t,e,i,o){return"bottom"==t?{top:e.top+e.height,left:e.left+e.width/2-i/2}:"top"==t?{top:e.top-o,left:e.left+e.width/2-i/2}:"left"==t?{top:e.top+e.height/2-o/2,left:e.left-i}:{top:e.top+e.height/2-o/2,left:e.left+e.width}},m.prototype.getViewportAdjustedDelta=function(t,e,i,o){var n={top:0,left:0};if(!this.$viewport)return n;var s=this.options.viewport&&this.options.viewport.padding||0,a=this.getPosition(this.$viewport);if(/right|left/.test(t)){var r=e.top-s-a.scroll,l=e.top+s-a.scroll+o;r<a.top?n.top=a.top-r:l>a.top+a.height&&(n.top=a.top+a.height-l)}else{var h=e.left-s,d=e.left+s+i;h<a.left?n.left=a.left-h:d>a.right&&(n.left=a.left+a.width-d)}return n},m.prototype.getTitle=function(){var t=this.$element,e=this.options;return t.attr("data-original-title")||("function"==typeof e.title?e.title.call(t[0]):e.title)},m.prototype.getUID=function(t){for(;t+=~~(1e6*Math.random()),document.getElementById(t););return t},m.prototype.tip=function(){if(!this.$tip&&(this.$tip=g(this.options.template),1!=this.$tip.length))throw new Error(this.type+" `template` option must consist of exactly 1 top-level element!");return this.$tip},m.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")},m.prototype.enable=function(){this.enabled=!0},m.prototype.disable=function(){this.enabled=!1},m.prototype.toggleEnabled=function(){this.enabled=!this.enabled},m.prototype.toggle=function(t){var e=this;t&&((e=g(t.currentTarget).data("bs."+this.type))||(e=new this.constructor(t.currentTarget,this.getDelegateOptions()),g(t.currentTarget).data("bs."+this.type,e))),t?(e.inState.click=!e.inState.click,e.isInStateTrue()?e.enter(e):e.leave(e)):e.tip().hasClass("in")?e.leave(e):e.enter(e)},m.prototype.destroy=function(){var t=this;clearTimeout(this.timeout),this.hide(function(){t.$element.off("."+t.type).removeData("bs."+t.type),t.$tip&&t.$tip.detach(),t.$tip=null,t.$arrow=null,t.$viewport=null,t.$element=null})},m.prototype.sanitizeHtml=function(t){return n(t,this.options.whiteList,this.options.sanitizeFn)};var e=g.fn.tooltip;g.fn.tooltip=function i(o){return this.each(function(){var t=g(this),e=t.data("bs.tooltip"),i="object"==typeof o&&o;!e&&/destroy|hide/.test(o)||(e||t.data("bs.tooltip",e=new m(this,i)),"string"==typeof o&&e[o]())})},g.fn.tooltip.Constructor=m,g.fn.tooltip.noConflict=function(){return g.fn.tooltip=e,this}}(jQuery),function(n){"use strict";var s=function(t,e){this.init("popover",t,e)};if(!n.fn.tooltip)throw new Error("Popover requires tooltip.js");s.VERSION="3.4.1",s.DEFAULTS=n.extend({},n.fn.tooltip.Constructor.DEFAULTS,{placement:"right",trigger:"click",content:"",template:'<div class="popover" role="tooltip"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'}),((s.prototype=n.extend({},n.fn.tooltip.Constructor.prototype)).constructor=s).prototype.getDefaults=function(){return s.DEFAULTS},s.prototype.setContent=function(){var t=this.tip(),e=this.getTitle(),i=this.getContent();if(this.options.html){var o=typeof i;this.options.sanitize&&(e=this.sanitizeHtml(e),"string"===o&&(i=this.sanitizeHtml(i))),t.find(".popover-title").html(e),t.find(".popover-content").children().detach().end()["string"===o?"html":"append"](i)}else t.find(".popover-title").text(e),t.find(".popover-content").children().detach().end().text(i);t.removeClass("fade top bottom left right in"),t.find(".popover-title").html()||t.find(".popover-title").hide()},s.prototype.hasContent=function(){return this.getTitle()||this.getContent()},s.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)},s.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")};var t=n.fn.popover;n.fn.popover=function e(o){return this.each(function(){var t=n(this),e=t.data("bs.popover"),i="object"==typeof o&&o;!e&&/destroy|hide/.test(o)||(e||t.data("bs.popover",e=new s(this,i)),"string"==typeof o&&e[o]())})},n.fn.popover.Constructor=s,n.fn.popover.noConflict=function(){return n.fn.popover=t,this}}(jQuery),function(s){"use strict";function n(t,e){this.$body=s(document.body),this.$scrollElement=s(t).is(document.body)?s(window):s(t),this.options=s.extend({},n.DEFAULTS,e),this.selector=(this.options.target||"")+" .nav li > a",this.offsets=[],this.targets=[],this.activeTarget=null,this.scrollHeight=0,this.$scrollElement.on("scroll.bs.scrollspy",s.proxy(this.process,this)),this.refresh(),this.process()}function e(o){return this.each(function(){var t=s(this),e=t.data("bs.scrollspy"),i="object"==typeof o&&o;e||t.data("bs.scrollspy",e=new n(this,i)),"string"==typeof o&&e[o]()})}n.VERSION="3.4.1",n.DEFAULTS={offset:10},n.prototype.getScrollHeight=function(){return this.$scrollElement[0].scrollHeight||Math.max(this.$body[0].scrollHeight,document.documentElement.scrollHeight)},n.prototype.refresh=function(){var t=this,o="offset",n=0;this.offsets=[],this.targets=[],this.scrollHeight=this.getScrollHeight(),s.isWindow(this.$scrollElement[0])||(o="position",n=this.$scrollElement.scrollTop()),this.$body.find(this.selector).map(function(){var t=s(this),e=t.data("target")||t.attr("href"),i=/^#./.test(e)&&s(e);return i&&i.length&&i.is(":visible")&&[[i[o]().top+n,e]]||null}).sort(function(t,e){return t[0]-e[0]}).each(function(){t.offsets.push(this[0]),t.targets.push(this[1])})},n.prototype.process=function(){var t,e=this.$scrollElement.scrollTop()+this.options.offset,i=this.getScrollHeight(),o=this.options.offset+i-this.$scrollElement.height(),n=this.offsets,s=this.targets,a=this.activeTarget;if(this.scrollHeight!=i&&this.refresh(),o<=e)return a!=(t=s[s.length-1])&&this.activate(t);if(a&&e<n[0])return this.activeTarget=null,this.clear();for(t=n.length;t--;)a!=s[t]&&e>=n[t]&&(n[t+1]===undefined||e<n[t+1])&&this.activate(s[t])},n.prototype.activate=function(t){this.activeTarget=t,this.clear();var e=this.selector+'[data-target="'+t+'"],'+this.selector+'[href="'+t+'"]',i=s(e).parents("li").addClass("active");i.parent(".dropdown-menu").length&&(i=i.closest("li.dropdown").addClass("active")),i.trigger("activate.bs.scrollspy")},n.prototype.clear=function(){s(this.selector).parentsUntil(this.options.target,".active").removeClass("active")};var t=s.fn.scrollspy;s.fn.scrollspy=e,s.fn.scrollspy.Constructor=n,s.fn.scrollspy.noConflict=function(){return s.fn.scrollspy=t,this},s(window).on("load.bs.scrollspy.data-api",function(){s('[data-spy="scroll"]').each(function(){var t=s(this);e.call(t,t.data())})})}(jQuery),function(r){"use strict";var a=function(t){this.element=r(t)};function e(i){return this.each(function(){var t=r(this),e=t.data("bs.tab");e||t.data("bs.tab",e=new a(this)),"string"==typeof i&&e[i]()})}a.VERSION="3.4.1",a.TRANSITION_DURATION=150,a.prototype.show=function(){var t=this.element,e=t.closest("ul:not(.dropdown-menu)"),i=t.data("target");if(i||(i=(i=t.attr("href"))&&i.replace(/.*(?=#[^\s]*$)/,"")),!t.parent("li").hasClass("active")){var o=e.find(".active:last a"),n=r.Event("hide.bs.tab",{relatedTarget:t[0]}),s=r.Event("show.bs.tab",{relatedTarget:o[0]});if(o.trigger(n),t.trigger(s),!s.isDefaultPrevented()&&!n.isDefaultPrevented()){var a=r(document).find(i);this.activate(t.closest("li"),e),this.activate(a,a.parent(),function(){o.trigger({type:"hidden.bs.tab",relatedTarget:t[0]}),t.trigger({type:"shown.bs.tab",relatedTarget:o[0]})})}}},a.prototype.activate=function(t,e,i){var o=e.find("> .active"),n=i&&r.support.transition&&(o.length&&o.hasClass("fade")||!!e.find("> .fade").length);function s(){o.removeClass("active").find("> .dropdown-menu > .active").removeClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!1),t.addClass("active").find('[data-toggle="tab"]').attr("aria-expanded",!0),n?(t[0].offsetWidth,t.addClass("in")):t.removeClass("fade"),t.parent(".dropdown-menu").length&&t.closest("li.dropdown").addClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!0),i&&i()}o.length&&n?o.one("bsTransitionEnd",s).emulateTransitionEnd(a.TRANSITION_DURATION):s(),o.removeClass("in")};var t=r.fn.tab;r.fn.tab=e,r.fn.tab.Constructor=a,r.fn.tab.noConflict=function(){return r.fn.tab=t,this};var i=function(t){t.preventDefault(),e.call(r(this),"show")};r(document).on("click.bs.tab.data-api",'[data-toggle="tab"]',i).on("click.bs.tab.data-api",'[data-toggle="pill"]',i)}(jQuery),function(l){"use strict";var h=function(t,e){this.options=l.extend({},h.DEFAULTS,e);var i=this.options.target===h.DEFAULTS.target?l(this.options.target):l(document).find(this.options.target);this.$target=i.on("scroll.bs.affix.data-api",l.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",l.proxy(this.checkPositionWithEventLoop,this)),this.$element=l(t),this.affixed=null,this.unpin=null,this.pinnedOffset=null,this.checkPosition()};function i(o){return this.each(function(){var t=l(this),e=t.data("bs.affix"),i="object"==typeof o&&o;e||t.data("bs.affix",e=new h(this,i)),"string"==typeof o&&e[o]()})}h.VERSION="3.4.1",h.RESET="affix affix-top affix-bottom",h.DEFAULTS={offset:0,target:window},h.prototype.getState=function(t,e,i,o){var n=this.$target.scrollTop(),s=this.$element.offset(),a=this.$target.height();if(null!=i&&"top"==this.affixed)return n<i&&"top";if("bottom"==this.affixed)return null!=i?!(n+this.unpin<=s.top)&&"bottom":!(n+a<=t-o)&&"bottom";var r=null==this.affixed,l=r?n:s.top;return null!=i&&n<=i?"top":null!=o&&t-o<=l+(r?a:e)&&"bottom"},h.prototype.getPinnedOffset=function(){if(this.pinnedOffset)return this.pinnedOffset;this.$element.removeClass(h.RESET).addClass("affix");var t=this.$target.scrollTop(),e=this.$element.offset();return this.pinnedOffset=e.top-t},h.prototype.checkPositionWithEventLoop=function(){setTimeout(l.proxy(this.checkPosition,this),1)},h.prototype.checkPosition=function(){if(this.$element.is(":visible")){var t=this.$element.height(),e=this.options.offset,i=e.top,o=e.bottom,n=Math.max(l(document).height(),l(document.body).height());"object"!=typeof e&&(o=i=e),"function"==typeof i&&(i=e.top(this.$element)),"function"==typeof o&&(o=e.bottom(this.$element));var s=this.getState(n,t,i,o);if(this.affixed!=s){null!=this.unpin&&this.$element.css("top","");var a="affix"+(s?"-"+s:""),r=l.Event(a+".bs.affix");if(this.$element.trigger(r),r.isDefaultPrevented())return;this.affixed=s,this.unpin="bottom"==s?this.getPinnedOffset():null,this.$element.removeClass(h.RESET).addClass(a).trigger(a.replace("affix","affixed")+".bs.affix")}"bottom"==s&&this.$element.offset({top:n-t-o})}};var t=l.fn.affix;l.fn.affix=i,l.fn.affix.Constructor=h,l.fn.affix.noConflict=function(){return l.fn.affix=t,this},l(window).on("load",function(){l('[data-spy="affix"]').each(function(){var t=l(this),e=t.data();e.offset=e.offset||{},null!=e.offsetBottom&&(e.offset.bottom=e.offsetBottom),null!=e.offsetTop&&(e.offset.top=e.offsetTop),i.call(t,e)})})}(jQuery);
6; 7/** 8 * @file 9 * Drupal Bootstrap object. 10 */ 11 12/** 13 * All Drupal Bootstrap JavaScript APIs are contained in this namespace. 14 * 15 * @param {underscore} _ 16 * @param {jQuery} $ 17 * @param {Drupal} Drupal 18 * @param {drupalSettings} drupalSettings 19 */ 20(function (_, $, Drupal, drupalSettings) { 21 'use strict'; 22 23 /** 24 * @typedef Drupal.bootstrap 25 */ 26 var Bootstrap = { 27 processedOnce: {}, 28 settings: drupalSettings.bootstrap || {} 29 }; 30 31 /** 32 * Wraps Drupal.checkPlain() to ensure value passed isn't empty. 33 * 34 * Encodes special characters in a plain-text string for display as HTML. 35 * 36 * @param {string} str 37 * The string to be encoded. 38 * 39 * @return {string} 40 * The encoded string. 41 * 42 * @ingroup sanitization 43 */ 44 Bootstrap.checkPlain = function (str) { 45 return str && Drupal.checkPlain(str) || ''; 46 }; 47 48 /** 49 * Creates a jQuery plugin. 50 * 51 * @param {String} id 52 * A jQuery plugin identifier located in $.fn. 53 * @param {Function} plugin 54 * A constructor function used to initialize the for the jQuery plugin. 55 * @param {Boolean} [noConflict] 56 * Flag indicating whether or not to create a ".noConflict()" helper method 57 * for the plugin. 58 */ 59 Bootstrap.createPlugin = function (id, plugin, noConflict) { 60 // Immediately return if plugin doesn't exist. 61 if ($.fn[id] !== void 0) { 62 return this.fatal('Specified jQuery plugin identifier already exists: @id. Use Drupal.bootstrap.replacePlugin() instead.', {'@id': id}); 63 } 64 65 // Immediately return if plugin isn't a function. 66 if (typeof plugin !== 'function') { 67 return this.fatal('You must provide a constructor function to create a jQuery plugin "@id": @plugin', {'@id': id, '@plugin': plugin}); 68 } 69 70 // Add a ".noConflict()" helper method. 71 this.pluginNoConflict(id, plugin, noConflict); 72 73 $.fn[id] = plugin; 74 }; 75 76 /** 77 * Diff object properties. 78 * 79 * @param {...Object} objects 80 * Two or more objects. The first object will be used to return properties 81 * values. 82 * 83 * @return {Object} 84 * Returns the properties of the first passed object that are not present 85 * in all other passed objects. 86 */ 87 Bootstrap.diffObjects = function (objects) { 88 var args = Array.prototype.slice.call(arguments); 89 return _.pick(args[0], _.difference.apply(_, _.map(args, function (obj) { 90 return Object.keys(obj); 91 }))); 92 }; 93 94 /** 95 * Map of supported events by regular expression. 96 * 97 * @type {Object<Event|MouseEvent|KeyboardEvent|TouchEvent,RegExp>} 98 */ 99 Bootstrap.eventMap = { 100 Event: /^(?:load|unload|abort|error|select|change|submit|reset|focus|blur|resize|scroll)$/, 101 MouseEvent: /^(?:click|dblclick|mouse(?:down|enter|leave|up|over|move|out))$/, 102 KeyboardEvent: /^(?:key(?:down|press|up))$/, 103 TouchEvent: /^(?:touch(?:start|end|move|cancel))$/ 104 }; 105 106 /** 107 * Extends a jQuery Plugin. 108 * 109 * @param {String} id 110 * A jQuery plugin identifier located in $.fn. 111 * @param {Function} callback 112 * A constructor function used to initialize the for the jQuery plugin. 113 * 114 * @return {Function|Boolean} 115 * The jQuery plugin constructor or FALSE if the plugin does not exist. 116 */ 117 Bootstrap.extendPlugin = function (id, callback) { 118 // Immediately return if plugin doesn't exist. 119 if (typeof $.fn[id] !== 'function') { 120 return this.fatal('Specified jQuery plugin identifier does not exist: @id', {'@id': id}); 121 } 122 123 // Immediately return if callback isn't a function. 124 if (typeof callback !== 'function') { 125 return this.fatal('You must provide a callback function to extend the jQuery plugin "@id": @callback', {'@id': id, '@callback': callback}); 126 } 127 128 // Determine existing plugin constructor. 129 var constructor = $.fn[id] && $.fn[id].Constructor || $.fn[id]; 130 var plugin = callback.apply(constructor, [this.settings]); 131 if (!$.isPlainObject(plugin)) { 132 return this.fatal('Returned value from callback is not a plain object that can be used to extend the jQuery plugin "@id": @obj', {'@obj': plugin}); 133 } 134 135 this.wrapPluginConstructor(constructor, plugin, true); 136 137 return $.fn[id]; 138 }; 139 140 Bootstrap.superWrapper = function (parent, fn) { 141 return function () { 142 var previousSuper = this.super; 143 this.super = parent; 144 var ret = fn.apply(this, arguments); 145 if (previousSuper) { 146 this.super = previousSuper; 147 } 148 else { 149 delete this.super; 150 } 151 return ret; 152 }; 153 }; 154 155 /** 156 * Provide a helper method for displaying when something is went wrong. 157 * 158 * @param {String} message 159 * The message to display. 160 * @param {Object} [args] 161 * An arguments to use in message. 162 * 163 * @return {Boolean} 164 * Always returns FALSE. 165 */
166 Bootstrap.fatal = function (message, args) { 167 if (this.settings.dev && console.warn) { 168 for (var name in args) { 169 if (args.hasOwnProperty(name) && typeof args[name] === 'object') { 170 args[name] = JSON.stringify(args[name]); 171 } 172 } 173 Drupal.throwError(new Error(Drupal.formatString(message, args))); 174 } 175 return false; 176 }; 177 178 /** 179 * Intersects object properties. 180 * 181 * @param {...Object} objects 182 * Two or more objects. The first object will be used to return properties 183 * values. 184 * 185 * @return {Object} 186 * Returns the properties of first passed object that intersects with all 187 * other passed objects. 188 */ 189 Bootstrap.intersectObjects = function (objects) { 190 var args = Array.prototype.slice.call(arguments); 191 return _.pick(args[0], _.intersection.apply(_, _.map(args, function (obj) { 192 return Object.keys(obj); 193 }))); 194 }; 195 196 /** 197 * Normalizes an object's values. 198 * 199 * @param {Object} obj 200 * The object to normalize. 201 * 202 * @return {Object} 203 * The normalized object. 204 */ 205 Bootstrap.normalizeObject = function (obj) { 206 if (!$.isPlainObject(obj)) { 207 return obj; 208 } 209 210 for (var k in obj) { 211 if (typeof obj[k] === 'string') { 212 if (obj[k] === 'true') { 213 obj[k] = true; 214 } 215 else if (obj[k] === 'false') { 216 obj[k] = false; 217 } 218 else if (obj[k].match(/^[\d-.]$/)) { 219 obj[k] = parseFloat(obj[k]); 220 } 221 } 222 else if ($.isPlainObject(obj[k])) { 223 obj[k] = Bootstrap.normalizeObject(obj[k]); 224 } 225 } 226 227 return obj; 228 }; 229 230 /** 231 * An object based once plugin (similar to jquery.once, but without the DOM). 232 * 233 * @param {String} id 234 * A unique identifier. 235 * @param {Function} callback 236 * The callback to invoke if the identifier has not yet been seen. 237 * 238 * @return {Bootstrap} 239 */ 240 Bootstrap.once = function (id, callback) { 241 // Immediately return if identifier has already been processed. 242 if (this.processedOnce[id]) { 243 return this; 244 } 245 callback.call(this, this.settings); 246 this.processedOnce[id] = true; 247 return this; 248 }; 249 250 /** 251 * Provide jQuery UI like ability to get/set options for Bootstrap plugins. 252 * 253 * @param {string|object} key 254 * A string value of the option to set, can be dot like to a nested key. 255 * An object of key/value pairs. 256 * @param {*} [value] 257 * (optional) A value to set for key. 258 * 259 * @returns {*} 260 * - Returns nothing if key is an object or both key and value parameters 261 * were provided to set an option. 262 * - Returns the a value for a specific setting if key was provided. 263 * - Returns an object of key/value pairs of all the options if no key or 264 * value parameter was provided. 265 * 266 * @see https://github.com/jquery/jquery-ui/blob/master/ui/widget.js 267 */ 268 Bootstrap.option = function (key, value) { 269 var options = $.isPlainObject(key) ? $.extend({}, key) : {}; 270 271 // Get all options (clone so it doesn't reference the internal object). 272 if (arguments.length === 0) { 273 return $.extend({}, this.options); 274 } 275 276 // Get/set single option. 277 if (typeof key === "string") { 278 // Handle nested keys in dot notation. 279 // e.g., "foo.bar" => { foo: { bar: true } } 280 var parts = key.split('.'); 281 key = parts.shift(); 282 var obj = options; 283 if (parts.length) { 284 for (var i = 0; i < parts.length - 1; i++) { 285 obj[parts[i]] = obj[parts[i]] || {}; 286 obj = obj[parts[i]]; 287 } 288 key = parts.pop(); 289 } 290 291 // Get. 292 if (arguments.length === 1) { 293 return obj[key] === void 0 ? null : obj[key]; 294 } 295 296 // Set. 297 obj[key] = value; 298 } 299 300 // Set multiple options. 301 $.extend(true, this.options, options); 302 }; 303 304 /** 305 * Adds a ".noConflict()" helper method if needed. 306 * 307 * @param {String} id 308 * A jQuery plugin identifier located in $.fn. 309 * @param {Function} plugin 310 * @param {Function} plugin 311 * A constructor function used to initialize the for the jQuery plugin. 312 * @param {Boolean} [noConflict]
313 * Flag indicating whether or not to create a ".noConflict()" helper method 314 * for the plugin. 315 */ 316 Bootstrap.pluginNoConflict = function (id, plugin, noConflict) { 317 if (plugin.noConflict === void 0 && (noConflict === void 0 || noConflict)) { 318 var old = $.fn[id]; 319 plugin.noConflict = function () { 320 $.fn[id] = old; 321 return this; 322 }; 323 } 324 }; 325 326 /** 327 * Creates a handler that relays to another event name. 328 * 329 * @param {HTMLElement|jQuery} target 330 * A target element. 331 * @param {String} name 332 * The name of the event to trigger. 333 * @param {Boolean} [stopPropagation=true] 334 * Flag indicating whether to stop the propagation of the event, defaults 335 * to true. 336 * 337 * @return {Function} 338 * An even handler callback function. 339 */ 340 Bootstrap.relayEvent = function (target, name, stopPropagation) { 341 return function (e) { 342 if (stopPropagation === void 0 || stopPropagation) { 343 e.stopPropagation(); 344 } 345 var $target = $(target); 346 var parts = name.split('.').filter(Boolean); 347 var type = parts.shift(); 348 e.target = $target[0]; 349 e.currentTarget = $target[0]; 350 e.namespace = parts.join('.'); 351 e.type = type; 352 $target.trigger(e); 353 }; 354 }; 355 356 /** 357 * Replaces a Bootstrap jQuery plugin definition. 358 * 359 * @param {String} id 360 * A jQuery plugin identifier located in $.fn. 361 * @param {Function} callback 362 * A callback function that is immediately invoked and must return a 363 * function that will be used as the plugin constructor. 364 * @param {Boolean} [noConflict] 365 * Flag indicating whether or not to create a ".noConflict()" helper method 366 * for the plugin. 367 */ 368 Bootstrap.replacePlugin = function (id, callback, noConflict) { 369 // Immediately return if plugin doesn't exist. 370 if (typeof $.fn[id] !== 'function') { 371 return this.fatal('Specified jQuery plugin identifier does not exist: @id', {'@id': id}); 372 } 373 374 // Immediately return if callback isn't a function. 375 if (typeof callback !== 'function') { 376 return this.fatal('You must provide a valid callback function to replace a jQuery plugin: @callback', {'@callback': callback}); 377 } 378 379 // Determine existing plugin constructor. 380 var constructor = $.fn[id] && $.fn[id].Constructor || $.fn[id]; 381 var plugin = callback.apply(constructor, [this.settings]); 382 383 // Immediately return if plugin isn't a function. 384 if (typeof plugin !== 'function') { 385 return this.fatal('Returned value from callback is not a usable function to replace a jQuery plugin "@id": @plugin', {'@id': id, '@plugin': plugin}); 386 } 387 388 this.wrapPluginConstructor(constructor, plugin); 389 390 // Add a ".noConflict()" helper method. 391 this.pluginNoConflict(id, plugin, noConflict); 392 393 $.fn[id] = plugin; 394 }; 395 396 /** 397 * Simulates a native event on an element in the browser. 398 * 399 * Note: This is a fairly complete modern implementation. If things aren't 400 * working quite the way you intend (in older browsers), you may wish to use 401 * the jQuery.simulate plugin. If it's available, this method will defer to 402 * that plugin. 403 * 404 * @see https://github.com/jquery/jquery-simulate 405 * 406 * @param {HTMLElement|jQuery} element 407 * A DOM element to dispatch event on. Note: this may be a jQuery object, 408 * however be aware that this will trigger the same event for each element 409 * inside the jQuery collection; use with caution. 410 * @param {String|String[]} type 411 * The type(s) of event to simulate. 412 * @param {Object} [options] 413 * An object of options to pass to the event constructor. Typically, if 414 * an event is being proxied, you should just pass the original event 415 * object here. This allows, if the browser supports it, to be a truly 416 * simulated event. 417 * 418 * @return {Boolean} 419 * The return value is false if event is cancelable and at least one of the 420 * event handlers which handled this event called Event.preventDefault(). 421 * Otherwise it returns true. 422 */ 423 Bootstrap.simulate = function (element, type, options) { 424 // Handle jQuery object wrappers so it triggers on each element. 425 var ret = true; 426 if (element instanceof $) { 427 element.each(function () { 428 if (!Bootstrap.simulate(this, type, options)) { 429 ret = false;
430 } 431 }); 432 return ret; 433 } 434 435 if (!(element instanceof HTMLElement)) { 436 this.fatal('Passed element must be an instance of HTMLElement, got "@type" instead.', { 437 '@type': typeof element, 438 }); 439 } 440 441 // Defer to the jQuery.simulate plugin, if it's available. 442 if (typeof $.simulate === 'function') { 443 new $.simulate(element, type, options); 444 return true; 445 } 446 447 var event; 448 var ctor; 449 var types = [].concat(type); 450 for (var i = 0, l = types.length; i < l; i++) { 451 type = types[i]; 452 for (var name in this.eventMap) { 453 if (this.eventMap[name].test(type)) { 454 ctor = name; 455 break; 456 } 457 } 458 if (!ctor) { 459 throw new SyntaxError('Only rudimentary HTMLEvents, KeyboardEvents and MouseEvents are supported: ' + type); 460 } 461 var opts = {bubbles: true, cancelable: true}; 462 if (ctor === 'KeyboardEvent' || ctor === 'MouseEvent') { 463 $.extend(opts, {ctrlKey: !1, altKey: !1, shiftKey: !1, metaKey: !1}); 464 } 465 if (ctor === 'MouseEvent') { 466 $.extend(opts, {button: 0, pointerX: 0, pointerY: 0, view: window}); 467 } 468 if (options) { 469 $.extend(opts, options); 470 } 471 if (typeof window[ctor] === 'function') { 472 event = new window[ctor](type, opts); 473 if (!element.dispatchEvent(event)) { 474 ret = false;
475 } 476 } 477 else if (document.createEvent) { 478 event = document.createEvent(ctor); 479 event.initEvent(type, opts.bubbles, opts.cancelable); 480 if (!element.dispatchEvent(event)) { 481 ret = false; 482 } 483 } 484 else if (typeof element.fireEvent === 'function') { 485 event = $.extend(document.createEventObject(), opts); 486 if (!element.fireEvent('on' + type, event)) { 487 ret = false; 488 } 489 } 490 else if (typeof element[type]) { 491 element[type](); 492 } 493 } 494 return ret; 495 }; 496 497 /** 498 * Strips HTML and returns just text. 499 * 500 * @param {String|Element|jQuery} html 501 * A string of HTML content, an Element DOM object or a jQuery object. 502 * 503 * @return {String} 504 * The text without HTML tags. 505 * 506 * @todo Replace with http://locutus.io/php/strings/strip_tags/ 507 */ 508 Bootstrap.stripHtml = function (html) { 509 if (html instanceof $) { 510 html = html.html(); 511 } 512 else if (html instanceof Element) { 513 html = html.innerHTML; 514 } 515 var tmp = document.createElement('DIV'); 516 tmp.innerHTML = html; 517 return (tmp.textContent || tmp.innerText || '').replace(/^[\s\n\t]*|[\s\n\t]*$/, ''); 518 }; 519 520 /** 521 * Provide a helper method for displaying when something is unsupported. 522 * 523 * @param {String} type 524 * The type of unsupported object, e.g. method or option. 525 * @param {String} name 526 * The name of the unsupported object. 527 * @param {*} [value] 528 * The value of the unsupported object. 529 */ 530 Bootstrap.unsupported = function (type, name, value) { 531 Bootstrap.warn('Unsupported by Drupal Bootstrap: (@type) @name -> @value', { 532 '@type': type, 533 '@name': name, 534 '@value': typeof value === 'object' ? JSON.stringify(value) : value 535 }); 536 }; 537 538 /** 539 * Provide a helper method to display a warning. 540 * 541 * @param {String} message 542 * The message to display. 543 * @param {Object} [args] 544 * Arguments to use as replacements in Drupal.formatString. 545 */ 546 Bootstrap.warn = function (message, args) { 547 if (this.settings.dev && console.warn) { 548 console.warn(Drupal.formatString(message, args)); 549 } 550 }; 551 552 /** 553 * Wraps a plugin with common functionality. 554 * 555 * @param {Function} constructor 556 * A plugin constructor being wrapped. 557 * @param {Object|Function} plugin 558 * The plugin being wrapped. 559 * @param {Boolean} [extend = false] 560 * Whether to add super extensibility. 561 */ 562 Bootstrap.wrapPluginConstructor = function (constructor, plugin, extend) { 563 var proto = constructor.prototype; 564 565 // Add a jQuery UI like option getter/setter method. 566 var option = this.option; 567 if (proto.option === void(0)) { 568 proto.option = function () { 569 return option.apply(this, arguments); 570 }; 571 } 572 573 if (extend) { 574 // Handle prototype properties separately. 575 if (plugin.prototype !== void 0) { 576 for (var key in plugin.prototype) { 577 if (!plugin.prototype.hasOwnProperty(key)) continue; 578 var value = plugin.prototype[key]; 579 if (typeof value === 'function') { 580 proto[key] = this.superWrapper(proto[key] || function () {}, value); 581 } 582 else { 583 proto[key] = $.isPlainObject(value) ? $.extend(true, {}, proto[key], value) : value; 584 } 585 } 586 } 587 delete plugin.prototype; 588 589 // Handle static properties. 590 for (key in plugin) { 591 if (!plugin.hasOwnProperty(key)) continue; 592 value = plugin[key]; 593 if (typeof value === 'function') { 594 constructor[key] = this.superWrapper(constructor[key] || function () {}, value); 595 } 596 else { 597 constructor[key] = $.isPlainObject(value) ? $.extend(true, {}, constructor[key], value) : value; 598 } 599 } 600 } 601 }; 602 603 // Add Bootstrap to the global Drupal object. 604 Drupal.bootstrap = Drupal.bootstrap || Bootstrap; 605 606})(window._, window.jQuery, window.Drupal, window.drupalSettings); 607; 608(function ($, _) { 609 610 /** 611 * @class Attributes 612 * 613 * Modifies attributes. 614 * 615 * @param {Object|Attributes} attributes 616 * An object to initialize attributes with. 617 */ 618 var Attributes = function (attributes) { 619 this.data = {}; 620 this.data['class'] = [];
621 this.merge(attributes); 622 }; 623 624 /** 625 * Renders the attributes object as a string to inject into an HTML element. 626 * 627 * @return {String} 628 * A rendered string suitable for inclusion in HTML markup. 629 */ 630 Attributes.prototype.toString = function () { 631 var output = ''; 632 var name, value; 633 var checkPlain = function (str) { 634 return str && str.toString().replace(/&/g, '&').replace(/"/g, '"').replace(/</g, '<').replace(/>/g, '>') || ''; 635 }; 636 var data = this.getData(); 637 for (name in data) { 638 if (!data.hasOwnProperty(name)) continue; 639 value = data[name]; 640 if (_.isFunction(value)) value = value(); 641 if (_.isObject(value)) value = _.values(value); 642 if (_.isArray(value)) value = value.join(' '); 643 output += ' ' + checkPlain(name) + '="' + checkPlain(value) + '"'; 644 } 645 return output; 646 }; 647 648 /** 649 * Renders the Attributes object as a plain object. 650 * 651 * @return {Object} 652 * A plain object suitable for inclusion in DOM elements. 653 */ 654 Attributes.prototype.toPlainObject = function () { 655 var object = {}; 656 var name, value; 657 var data = this.getData(); 658 for (name in data) { 659 if (!data.hasOwnProperty(name)) continue; 660 value = data[name]; 661 if (_.isFunction(value)) value = value(); 662 if (_.isObject(value)) value = _.values(value); 663 if (_.isArray(value)) value = value.join(' '); 664 object[name] = value; 665 } 666 return object; 667 }; 668 669 /** 670 * Add class(es) to the array. 671 * 672 * @param {string|Array} value 673 * An individual class or an array of classes to add. 674 * 675 * @return {Attributes} 676 * 677 * @chainable 678 */ 679 Attributes.prototype.addClass = function (value) { 680 var args = Array.prototype.slice.call(arguments); 681 this.data['class'] = this.sanitizeClasses(this.data['class'].concat(args)); 682 return this; 683 }; 684 685 /** 686 * Returns whether the requested attribute exists. 687 * 688 * @param {string} name 689 * An attribute name to check. 690 * 691 * @return {boolean} 692 * TRUE or FALSE 693 */ 694 Attributes.prototype.exists = function (name) { 695 return this.data[name] !== void(0) && this.data[name] !== null; 696 }; 697 698 /** 699 * Retrieve a specific attribute from the array. 700 * 701 * @param {string} name 702 * The specific attribute to retrieve. 703 * @param {*} defaultValue 704 * (optional) The default value to set if the attribute does not exist. 705 * 706 * @return {*} 707 * A specific attribute value, passed by reference. 708 */ 709 Attributes.prototype.get = function (name, defaultValue) { 710 if (!this.exists(name)) this.data[name] = defaultValue; 711 return this.data[name]; 712 }; 713 714 /** 715 * Retrieves a cloned copy of the internal attributes data object. 716 * 717 * @return {Object} 718 */ 719 Attributes.prototype.getData = function () { 720 return _.extend({}, this.data); 721 }; 722 723 /** 724 * Retrieves classes from the array. 725 * 726 * @return {Array} 727 * The classes array. 728 */ 729 Attributes.prototype.getClasses = function () { 730 return this.get('class', []); 731 }; 732 733 /** 734 * Indicates whether a class is present in the array. 735 * 736 * @param {string|Array} className 737 * The class(es) to search for. 738 * 739 * @return {boolean} 740 * TRUE or FALSE 741 */ 742 Attributes.prototype.hasClass = function (className) { 743 className = this.sanitizeClasses(Array.prototype.slice.call(arguments)); 744 var classes = this.getClasses(); 745 for (var i = 0, l = className.length; i < l; i++) { 746 // If one of the classes fails, immediately return false. 747 if (_.indexOf(classes, className[i]) === -1) { 748 return false; 749 } 750 } 751 return true; 752 }; 753 754 /** 755 * Merges multiple values into the array. 756 * 757 * @param {Attributes|Node|jQuery|Object} object 758 * An Attributes object with existing data, a Node DOM element, a jQuery 759 * instance or a plain object where the key is the attribute name and the 760 * value is the attribute value. 761 * @param {boolean} [recursive] 762 * Flag determining whether or not to recursively merge key/value pairs. 763 * 764 * @return {Attributes} 765 * 766 * @chainable 767 */ 768 Attributes.prototype.merge = function (object, recursive) { 769 // Immediately return if there is nothing to merge. 770 if (!object) { 771 return this; 772 } 773 774 // Get attributes from a jQuery element. 775 if (object instanceof $) { 776 object = object[0]; 777 } 778 779 // Get attributes from a DOM element. 780 if (object instanceof Node) { 781 object = Array.prototype.slice.call(object.attributes).reduce(function (attributes, attribute) { 782 attributes[attribute.name] = attribute.value; 783 return attributes; 784 }, {}); 785 } 786 // Get attributes from an Attributes instance. 787 else if (object instanceof Attributes) { 788 object = object.getData(); 789 } 790 // Otherwise, clone the object. 791 else { 792 object = _.extend({}, object); 793 } 794 795 // By this point, there should be a valid plain object. 796 if (!$.isPlainObject(object)) { 797 setTimeout(function () { 798 throw new Error('Passed object is not supported: ' + object); 799 }); 800 return this; 801 } 802 803 // Handle classes separately. 804 if (object && object['class'] !== void 0) { 805 this.addClass(object['class']); 806 delete object['class']; 807 } 808 809 if (recursive === void 0 || recursive) { 810 this.data = $.extend(true, {}, this.data, object); 811 } 812 else { 813 this.data = $.extend({}, this.data, object); 814 } 815 816 return this; 817 }; 818 819 /** 820 * Removes an attribute from the array. 821 * 822 * @param {string} name 823 * The name of the attribute to remove. 824 * 825 * @return {Attributes} 826 * 827 * @chainable 828 */ 829 Attributes.prototype.remove = function (name) { 830 if (this.exists(name)) delete this.data[name]; 831 return this; 832 }; 833 834 /** 835 * Removes a class from the attributes array. 836 * 837 * @param {...string|Array} className 838 * An individual class or an array of classes to remove. 839 * 840 * @return {Attributes} 841 * 842 * @chainable 843 */ 844 Attributes.prototype.removeClass = function (className) { 845 var remove = this.sanitizeClasses(Array.prototype.slice.apply(arguments)); 846 this.data['class'] = _.without(this.getClasses(), remove); 847 return this; 848 }; 849 850 /** 851 * Replaces a class in the attributes array. 852 * 853 * @param {string} oldValue 854 * The old class to remove. 855 * @param {string} newValue 856 * The new class. It will not be added if the old class does not exist. 857 * 858 * @return {Attributes} 859 * 860 * @chainable 861 */ 862 Attributes.prototype.replaceClass = function (oldValue, newValue) { 863 var classes = this.getClasses(); 864 var i = _.indexOf(this.sanitizeClasses(oldValue), classes); 865 if (i >= 0) { 866 classes[i] = newValue; 867 this.set('class', classes); 868 } 869 return this; 870 }; 871 872 /** 873 * Ensures classes are flattened into a single is an array and sanitized. 874 * 875 * @param {...String|Array} classes 876 * The class or classes to sanitize. 877 * 878 * @return {Array} 879 * A sanitized array of classes. 880 */ 881 Attributes.prototype.sanitizeClasses = function (classes) { 882 return _.chain(Array.prototype.slice.call(arguments)) 883 // Flatten in case there's a mix of strings and arrays. 884 .flatten() 885 886 // Split classes that may have been added with a space as a separator. 887 .map(function (string) { 888 return string.split(' '); 889 }) 890 891 // Flatten again since it was just split into arrays. 892 .flatten() 893 894 // Filter out empty items. 895 .filter() 896
897 // Clean the class to ensure it's a valid class name. 898 .map(function (value) { 899 return Attributes.cleanClass(value); 900 }) 901 902 // Ensure classes are unique. 903 .uniq() 904 905 // Retrieve the final value. 906 .value(); 907 }; 908 909 /** 910 * Sets an attribute on the array. 911 * 912 * @param {string} name 913 * The name of the attribute to set. 914 * @param {*} value 915 * The value of the attribute to set. 916 * 917 * @return {Attributes} 918 * 919 * @chainable 920 */ 921 Attributes.prototype.set = function (name, value) { 922 var obj = $.isPlainObject(name) ? name : {}; 923 if (typeof name === 'string') { 924 obj[name] = value; 925 } 926 return this.merge(obj); 927 }; 928 929 /** 930 * Prepares a string for use as a CSS identifier (element, class, or ID name). 931 * 932 * Note: this is essentially a direct copy from 933 * \Drupal\Component\Utility\Html::cleanCssIdentifier 934 * 935 * @param {string} identifier 936 * The identifier to clean. 937 * @param {Object} [filter] 938 * An object of string replacements to use on the identifier. 939 * 940 * @return {string} 941 * The cleaned identifier. 942 */ 943 Attributes.cleanClass = function (identifier, filter) { 944 filter = filter || { 945 ' ': '-', 946 '_': '-', 947 '/': '-', 948 '[': '-', 949 ']': '' 950 }; 951 952 identifier = identifier.toLowerCase(); 953 954 if (filter['__'] === void 0) { 955 identifier = identifier.replace('__', '#DOUBLE_UNDERSCORE#'); 956 } 957 958 identifier = identifier.replace(Object.keys(filter), Object.keys(filter).map(function(key) { return filter[key]; })); 959 960 if (filter['__'] === void 0) { 961 identifier = identifier.replace('#DOUBLE_UNDERSCORE#', '__'); 962 } 963
964 identifier = identifier.replace(/[^\u002D\u0030-\u0039\u0041-\u005A\u005F\u0061-\u007A\u00A1-\uFFFF]/g, ''); 965 identifier = identifier.replace(['/^[0-9]/', '/^(-[0-9])|^(--)/'], ['_', '__']); 966 967 return identifier; 968 }; 969 970 /** 971 * Creates an Attributes instance. 972 * 973 * @param {object|Attributes} [attributes] 974 * An object to initialize attributes with. 975 * 976 * @return {Attributes} 977 * An Attributes instance. 978 * 979 * @constructor 980 */ 981 Attributes.create = function (attributes) { 982 return new Attributes(attributes); 983 }; 984 985 window.Attributes = Attributes; 986 987})(window.jQuery, window._); 988; 989/** 990 * @file 991 * Theme hooks for the Drupal Bootstrap base theme. 992 */ 993(function ($, Drupal, Bootstrap, Attributes) { 994 995 /** 996 * Fallback for theming an icon if the Icon API module is not installed. 997 */ 998 if (!Drupal.icon) Drupal.icon = { bundles: {} }; 999 if (!Drupal.theme.icon || Drupal.theme.prototype.icon) { 1000 $.extend(Drupal.theme, /** @lends Drupal.theme */ { 1001 /** 1002 * Renders an icon. 1003 * 1004 * @param {string} bundle 1005 * The bundle which the icon belongs to. 1006 * @param {string} icon 1007 * The name of the icon to render. 1008 * @param {object|Attributes} [attributes] 1009 * An object of attributes to also apply to the icon. 1010 * 1011 * @returns {string} 1012 */ 1013 icon: function (bundle, icon, attributes) { 1014 if (!Drupal.icon.bundles[bundle]) return ''; 1015 attributes = Attributes.create(attributes).addClass('icon').set('aria-hidden', 'true'); 1016 icon = Drupal.icon.bundles[bundle](icon, attributes); 1017 return '<span' + attributes + '></span>'; 1018 } 1019 }); 1020 } 1021 1022 /** 1023 * Callback for modifying an icon in the "bootstrap" icon bundle. 1024 * 1025 * @param {string} icon 1026 * The icon being rendered. 1027 * @param {Attributes} attributes 1028 * Attributes object for the icon. 1029 */ 1030 Drupal.icon.bundles.bootstrap = function (icon, attributes) { 1031 attributes.addClass(['glyphicon', 'glyphicon-' + icon]); 1032 }; 1033 1034 /** 1035 * Add necessary theming hooks. 1036 */ 1037 $.extend(Drupal.theme, /** @lends Drupal.theme */ { 1038 1039 /** 1040 * Renders a Bootstrap AJAX glyphicon throbber. 1041 * 1042 * @returns {string} 1043 */ 1044 ajaxThrobber: function () { 1045 return Drupal.theme('bootstrapIcon', 'refresh', {'class': ['ajax-throbber', 'glyphicon-spin'] }); 1046 }, 1047 1048 /** 1049 * Renders a button element. 1050 * 1051 * @param {object|Attributes} attributes 1052 * An object of attributes to apply to the button. If it contains one of: 1053 * - value: The label of the button. 1054 * - context: The context type of Bootstrap button, can be one of: 1055 * - default 1056 * - primary 1057 * - success 1058 * - info 1059 * - warning 1060 * - danger 1061 * - link 1062 * 1063 * @returns {string} 1064 */ 1065 button: function (attributes) { 1066 attributes = Attributes.create(attributes).addClass('btn'); 1067 var context = attributes.get('context', 'default'); 1068 var label = attributes.get('value', ''); 1069 attributes.remove('context').remove('value'); 1070 if (!attributes.hasClass(['btn-default', 'btn-primary', 'btn-success', 'btn-info', 'btn-warning', 'btn-danger', 'btn-link'])) { 1071 attributes.addClass('btn-' + Bootstrap.checkPlain(context)); 1072 } 1073 1074 // Attempt to, intelligently, provide a default button "type". 1075 if (!attributes.exists('type')) { 1076 attributes.set('type', attributes.hasClass('form-submit') ? 'submit' : 'button'); 1077 } 1078 1079 return '<button' + attributes + '>' + label + '</button>'; 1080 }, 1081 1082 /** 1083 * Alias for "button" theme hook. 1084 * 1085 * @param {object|Attributes} attributes 1086 * An object of attributes to apply to the button. 1087 * 1088 * @see Drupal.theme.button() 1089 * 1090 * @returns {string} 1091 */ 1092 btn: function (attributes) { 1093 return Drupal.theme('button', attributes); 1094 }, 1095 1096 /** 1097 * Renders a button block element. 1098 * 1099 * @param {object|Attributes} attributes 1100 * An object of attributes to apply to the button. 1101 * 1102 * @see Drupal.theme.button() 1103 * 1104 * @returns {string} 1105 */ 1106 'btn-block': function (attributes) { 1107 return Drupal.theme('button', Attributes.create(attributes).addClass('btn-block')); 1108 }, 1109 1110 /**
1111 * Renders a large button element. 1112 * 1113 * @param {object|Attributes} attributes 1114 * An object of attributes to apply to the button. 1115 * 1116 * @see Drupal.theme.button() 1117 * 1118 * @returns {string} 1119 */ 1120 'btn-lg': function (attributes) { 1121 return Drupal.theme('button', Attributes.create(attributes).addClass('btn-lg')); 1122 }, 1123 1124 /** 1125 * Renders a small button element. 1126 * 1127 * @param {object|Attributes} attributes 1128 * An object of attributes to apply to the button. 1129 * 1130 * @see Drupal.theme.button() 1131 * 1132 * @returns {string} 1133 */ 1134 'btn-sm': function (attributes) { 1135 return Drupal.theme('button', Attributes.create(attributes).addClass('btn-sm')); 1136 }, 1137 1138 /** 1139 * Renders an extra small button element. 1140 * 1141 * @param {object|Attributes} attributes 1142 * An object of attributes to apply to the button. 1143 * 1144 * @see Drupal.theme.button() 1145 * 1146 * @returns {string} 1147 */ 1148 'btn-xs': function (attributes) { 1149 return Drupal.theme('button', Attributes.create(attributes).addClass('btn-xs')); 1150 }, 1151 1152 /** 1153 * Renders a glyphicon. 1154 * 1155 * @param {string} name 1156 * The name of the glyphicon. 1157 * @param {object|Attributes} [attributes] 1158 * An object of attributes to apply to the icon. 1159 * 1160 * @returns {string} 1161 */ 1162 bootstrapIcon: function (name, attributes) { 1163 return Drupal.theme('icon', 'bootstrap', name, attributes); 1164 } 1165 1166 }); 1167 1168})(window.jQuery, window.Drupal, window.Drupal.bootstrap, window.Attributes); 1169; 1170/** 1171 * @file 1172 * Webform behaviors. 1173 */ 1174 1175(function ($, Drupal) { 1176 1177 'use strict'; 1178 1179 // Trigger Drupal's attaching of behaviors after the page is 1180 // completely loaded. 1181 // @see https://stackoverflow.com/questions/37838430/detect-if-page-is-load-from-back-button 1182 // @see https://stackoverflow.com/questions/20899274/how-to-refresh-page-on-back-button-click/20899422#20899422 1183 var isChrome = (/chrom(e|ium)/.test(window.navigator.userAgent.toLowerCase())); 1184 if (isChrome) { 1185 // Track back button in navigation. 1186 // @see https://stackoverflow.com/questions/37838430/detect-if-page-is-load-from-back-button 1187 var backButton = false; 1188 if (window.performance) { 1189 var navEntries = window.performance.getEntriesByType('navigation'); 1190 if (navEntries.length > 0 && navEntries[0].type === 'back_forward') { 1191 backButton = true; 1192 } 1193 else if (window.performance.navigation 1194 && window.performance.navigation.type === window.performance.navigation.TYPE_BACK_FORWARD) { 1195 backButton = true; 1196 } 1197 } 1198 1199 // If the back button is pressed, delay Drupal's attaching of behaviors. 1200 if (backButton) { 1201 var attachBehaviors = Drupal.attachBehaviors; 1202 Drupal.attachBehaviors = function (context, settings) { 1203 setTimeout(function (context, settings) { 1204 attachBehaviors(context, settings); 1205 }, 300); 1206 }; 1207 } 1208 } 1209 1210})(jQuery, Drupal); 1211; 1212/** 1213* DO NOT EDIT THIS FILE. 1214* See the following change record for more information, 1215* https://www.drupal.org/node/2815083 1216* @preserve 1217**/ 1218 1219(function ($, once) { 1220 var deprecatedMessageSuffix = "is deprecated in Drupal 9.3.0 and will be removed in Drupal 10.0.0. Use the core/once library instead. See https://www.drupal.org/node/3158256"; 1221 var originalJQOnce = $.fn.once; 1222 var originalJQRemoveOnce = $.fn.removeOnce; 1223 1224 $.fn.once = function jQueryOnce(id) { 1225 Drupal.deprecationError({ 1226 message: "jQuery.once() ".concat(deprecatedMessageSuffix) 1227 }); 1228 return originalJQOnce.apply(this, [id]); 1229 }; 1230 1231 $.fn.removeOnce = function jQueryRemoveOnce(id) { 1232 Drupal.deprecationError({ 1233 message: "jQuery.removeOnce() ".concat(deprecatedMessageSuffix) 1234 }); 1235 return originalJQRemoveOnce.apply(this, [id]); 1236 }; 1237 1238 var drupalOnce = once; 1239 1240 function augmentedOnce(id, selector, context) { 1241 originalJQOnce.apply($(selector, context), [id]); 1242 return drupalOnce(id, selector, context); 1243 } 1244 1245 function remove(id, selector, context) { 1246 originalJQRemoveOnce.apply($(selector, context), [id]); 1247 return drupalOnce.remove(id, selector, context); 1248 } 1249 1250 window.once = Object.assign(augmentedOnce, drupalOnce, { 1251 remove: remove 1252 }); 1253})(jQuery, once);; 1254/** 1255* DO NOT EDIT THIS FILE. 1256* See the following change record for more information, 1257* https://www.drupal.org/node/2815083 1258* @preserve 1259**/ 1260 1261(function ($, Drupal) { 1262 var states = { 1263 postponed: [] 1264 }; 1265 Drupal.states = states; 1266 1267 function invert(a, invertState) { 1268 return invertState && typeof a !== 'undefined' ? !a : a; 1269 } 1270 1271 function _compare2(a, b) { 1272 if (a === b) { 1273 return typeof a === 'undefined' ? a : true; 1274 } 1275 1276 return typeof a === 'undefined' || typeof b === 'undefined'; 1277 } 1278 1279 function ternary(a, b) { 1280 if (typeof a === 'undefined') { 1281 return b; 1282 } 1283 1284 if (typeof b === 'undefined') { 1285 return a; 1286 } 1287 1288 return a && b; 1289 } 1290 1291 Drupal.behaviors.states = { 1292 attach: function attach(context, settings) { 1293 var $states = $(context).find('[data-drupal-states]'); 1294 var il = $states.length; 1295 1296 var _loop = function _loop(i) { 1297 var config = JSON.parse($states[i].getAttribute('data-drupal-states')); 1298 Object.keys(config || {}
1298).forEach(function (state) { 1299 new states.Dependent({ 1300 element: $($states[i]), 1301 state: states.State.sanitize(state), 1302 constraints: config[state] 1303 }); 1304 }); 1305 }; 1306 1307 for (var i = 0; i < il; i++) { 1308 _loop(i); 1309 } 1310 1311 while (states.postponed.length) { 1312 states.postponed.shift()(); 1313 } 1314 } 1315 }; 1316 1317 states.Dependent = function (args) { 1318 var _this = this; 1319 1320 $.extend(this, { 1321 values: {}, 1322 oldValue: null 1323 }, args); 1324 this.dependees = this.getDependees(); 1325 Object.keys(this.dependees || {}).forEach(function (selector) { 1326 _this.initializeDependee(selector, _this.dependees[selector]); 1327 }); 1328 }; 1329 1330 states.Dependent.comparisons = { 1331 RegExp: function RegExp(reference, value) { 1332 return reference.test(value); 1333 }, 1334 Function: function Function(reference, value) { 1335 return reference(value); 1336 }, 1337 Number: function Number(reference, value) { 1338 return typeof value === 'string' ? _compare2(reference.toString(), value) : _compare2(reference, value); 1339 } 1340 }; 1341 states.Dependent.prototype = { 1342 initializeDependee: function initializeDependee(selector, dependeeStates) { 1343 var _this2 = this; 1344 1345 this.values[selector] = {}; 1346 Object.keys(dependeeStates).forEach(function (i) { 1347 var state = dependeeStates[i]; 1348 1349 if ($.inArray(state, dependeeStates) === -1) { 1350 return; 1351 } 1352 1353 state = states.State.sanitize(state); 1354 _this2.values[selector][state.name] = null; 1355 $(selector).on("state:".concat(state), { 1356 selector: selector, 1357 state: state 1358 }, function (e) { 1359 _this2.update(e.data.selector, e.data.state, e.value); 1360 }); 1361 new states.Trigger({ 1362 selector: selector, 1363 state: state 1364 }); 1365 }); 1366 }, 1367 compare: function compare(reference, selector, state) { 1368 var value = this.values[selector][state.name]; 1369 1370 if (reference.constructor.name in states.Dependent.comparisons) { 1371 return states.Dependent.comparisons[reference.constructor.name](reference, value); 1372 } 1373 1374 return _compare2(reference, value); 1375 }, 1376 update: function update(selector, state, value) { 1377 if (value !== this.values[selector][state.name]) { 1378 this.values[selector][state.name] = value; 1379 this.reevaluate(); 1380 } 1381 }, 1382 reevaluate: function reevaluate() { 1383 var value = this.verifyConstraints(this.constraints); 1384 1385 if (value !== this.oldValue) { 1386 this.oldValue = value; 1387 value = invert(value, this.state.invert); 1388 this.element.trigger({ 1389 type: "state:".concat(this.state), 1390 value: value, 1391 trigger: true 1392 }); 1393 } 1394 }, 1395 verifyConstraints: function verifyConstraints(constraints, selector) { 1396 var result; 1397 1398 if ($.isArray(constraints)) { 1399 var hasXor = $.inArray('xor', constraints) === -1; 1400 var len = constraints.length; 1401 1402 for (var i = 0; i < len; i++) { 1403 if (constraints[i] !== 'xor') { 1404 var constraint = this.checkConstraints(constraints[i], selector, i); 1405 1406 if (constraint && (hasXor || result)) { 1407 return hasXor; 1408 } 1409 1410 result = result || constraint; 1411 } 1412 } 1413 } else if ($.isPlainObject(constraints)) { 1414 for (var n in constraints) { 1415 if (constraints.hasOwnProperty(n)) { 1416 result = ternary(result, this.checkConstraints(constraints[n], selector, n)); 1417 1418 if (result === false) { 1419 return false; 1420 } 1421 } 1422 } 1423 } 1424 1425 return result; 1426 }, 1427 checkConstraints: function checkConstraints(value, selector, state) { 1428 if (typeof state !== 'string' || /[0-9]/.test(state[0])) { 1429 state = null; 1430 } else if (typeof selector === 'undefined') { 1431 selector = state; 1432 state = null; 1433 } 1434 1435 if (state !== null) { 1436 state = states.State.sanitize(state); 1437 return invert(this.compare(value, selector, state), state.invert); 1438 } 1439 1440 return this.verifyConstraints(value, selector); 1441 }, 1442 getDependees: function getDependees() { 1443 var cache = {}; 1444 var _compare = this.compare; 1445 1446 this.compare = function (reference, selector, state) { 1447 (cache[selector] || (cache[selector] = [])).push(state.name); 1448 }; 1449 1450 this.verifyConstraints(this.constraints); 1451 this.compare = _compare; 1452 return cache; 1453 } 1454 }; 1455 1456 states.Trigger = function (args) { 1457 $.extend(this, args); 1458 1459 if (this.state in states.Trigger.states) { 1460 this.element = $(this.selector); 1461 1462 if (!this.element.data("trigger:".concat(this.state))) { 1463 this.initialize(); 1464 } 1465 } 1466 }; 1467 1468 states.Trigger.prototype = { 1469 initialize: function initialize() { 1470 var _this3 = this; 1471 1472 var trigger = states.Trigger.states[this.state]; 1473 1474 if (typeof trigger === 'function') { 1475 trigger.call(window, this.element); 1476 } else { 1477 Object.keys(trigger || {}
1477).forEach(function (event) { 1478 _this3.defaultTrigger(event, trigger[event]); 1479 }); 1480 } 1481 1482 this.element.data("trigger:".concat(this.state), true); 1483 }, 1484 defaultTrigger: function defaultTrigger(event, valueFn) { 1485 var oldValue = valueFn.call(this.element); 1486 this.element.on(event, $.proxy(function (e) { 1487 var value = valueFn.call(this.element, e); 1488 1489 if (oldValue !== value) { 1490 this.element.trigger({ 1491 type: "state:".concat(this.state), 1492 value: value, 1493 oldValue: oldValue 1494 }); 1495 oldValue = value; 1496 } 1497 }, this)); 1498 states.postponed.push($.proxy(function () { 1499 this.element.trigger({ 1500 type: "state:".concat(this.state), 1501 value: oldValue, 1502 oldValue: null 1503 }); 1504 }, this)); 1505 } 1506 }; 1507 states.Trigger.states = { 1508 empty: { 1509 keyup: function keyup() { 1510 return this.val() === ''; 1511 } 1512 }, 1513 checked: { 1514 change: function change() { 1515 var checked = false; 1516 this.each(function () { 1517 checked = $(this).prop('checked'); 1518 return !checked; 1519 }); 1520 return checked; 1521 } 1522 }, 1523 value: { 1524 keyup: function keyup() { 1525 if (this.length > 1) { 1526 return this.filter(':checked').val() || false; 1527 } 1528 1529 return this.val(); 1530 }, 1531 change: function change() { 1532 if (this.length > 1) { 1533 return this.filter(':checked').val() || false; 1534 } 1535 1536 return this.val(); 1537 } 1538 }, 1539 collapsed: { 1540 collapsed: function collapsed(e) { 1541 return typeof e !== 'undefined' && 'value' in e ? e.value : !this.is('[open]'); 1542 } 1543 } 1544 }; 1545 1546 states.State = function (state) { 1547 this.pristine = state; 1548 this.name = state; 1549 var process = true; 1550 1551 do { 1552 while (this.name.charAt(0) === '!') { 1553 this.name = this.name.substring(1); 1554 this.invert = !this.invert; 1555 } 1556 1557 if (this.name in states.State.aliases) { 1558 this.name = states.State.aliases[this.name]; 1559 } else { 1560 process = false; 1561 } 1562 } while (process); 1563 }; 1564 1565 states.State.sanitize = function (state) { 1566 if (state instanceof states.State) { 1567 return state; 1568 } 1569 1570 return new states.State(state); 1571 }; 1572 1573 states.State.aliases = { 1574 enabled: '!disabled', 1575 invisible: '!visible', 1576 invalid: '!valid', 1577 untouched: '!touched', 1578 optional: '!required', 1579 filled: '!empty', 1580 unchecked: '!checked', 1581 irrelevant: '!relevant', 1582 expanded: '!collapsed', 1583 open: '!collapsed', 1584 closed: 'collapsed', 1585 readwrite: '!readonly' 1586 }; 1587 states.State.prototype = { 1588 invert: false, 1589 toString: function toString() { 1590 return this.name; 1591 } 1592 }; 1593 var $document = $(document); 1594 $document.on('state:disabled', function (e) { 1595 if (e.trigger) { 1596 $(e.target).prop('disabled', e.value).closest('.js-form-item, .js-form-submit, .js-form-wrapper').toggleClass('form-disabled', e.value).find('select, input, textarea').prop('disabled', e.value); 1597 } 1598 }); 1599 $document.on('state:required', function (e) { 1600 if (e.trigger) { 1601 if (e.value) { 1602 var label = "label".concat(e.target.id ? "[for=".concat(e.target.id, "]") : ''); 1603 var $label = $(e.target).attr({ 1604 required: 'required', 1605 'aria-required': 'true' 1606 }).closest('.js-form-item, .js-form-wrapper').find(label); 1607 1608 if (!$label.hasClass('js-form-required').length) { 1609 $label.addClass('js-form-required form-required'); 1610 } 1611 } else { 1612 $(e.target).removeAttr('required aria-required').closest('.js-form-item, .js-form-wrapper').find('label.js-form-required').removeClass('js-form-required form-required'); 1613 } 1614 } 1615 }); 1616 $document.on('state:visible', function (e) { 1617 if (e.trigger) { 1618 $(e.target).closest('.js-form-item, .js-form-submit, .js-form-wrapper').toggle(e.value); 1619 } 1620 }); 1621 $document.on('state:checked', function (e) { 1622 if (e.trigger) { 1623 $(e.target).prop('checked', e.value); 1624 } 1625 }); 1626 $document.on('state:collapsed', function (e) { 1627 if (e.trigger) { 1628 if ($(e.target).is('[open]') === e.value) { 1629 $(e.target).find('> summary').trigger('click'); 1630 } 1631 } 1632 }); 1633})(jQuery, Drupal);; 1634/** 1635 * @file 1636 * Extends core/misc/states.js. 1637 */ 1638(function($) { 1639 1640 // Unbind core state.js from document first so we can then override below. 1641 $(document).unbind('state:disabled'); 1642 1643 /** 1644 * Global state change handlers. These are bound to "document" to cover all 1645 * elements whose state changes. Events sent to elements within the page 1646 * bubble up to these handlers. We use this system so that themes and modules 1647 * can override these state change handlers for particular parts of a page. 1648 */ 1649 $(document).bind('state:disabled', function(e) { 1650 // Only act when this change was triggered by a dependency and not by the 1651 // element monitoring itself. 1652 if (e.trigger) { 1653 $(e.target) 1654 .attr('disabled', e.value) 1655 .closest('.form-item, .form-submit, .form-wrapper').toggleClass('form-disabled', e.value) 1656 .find(':input').attr('disabled', e.value); 1657 1658 // Note: WebKit nightlies don't reflect that change correctly. 1659 // See https://bugs.webkit.org/show_bug.cgi?id=23789 1660 } 1661 }); 1662 1663})(jQuery); 1664; 1665/** 1666 * @file 1667 * JavaScript behaviors for custom webform #states. 1668 */ 1669 1670(function ($, Drupal) { 1671 1672 'use strict'; 1673 1674 Drupal.webform = Drupal.webform || {}; 1675 Drupal.webform.states = Drupal.webform.states || {}; 1676 Drupal.webform.states.slideDown = Drupal.webform.states.slideDown || {}; 1677 Drupal.webform.states.slideDown.duration = 'slow'; 1678 Drupal.webform.states.slideUp = Drupal.webform.states.slideUp || {}; 1679 Drupal.webform.states.slideUp.duration = 'fast'; 1680 1681 /* ************************************************************************ */ 1682 // jQuery functions. 1683 /* ************************************************************************ */ 1684 1685 /** 1686 * Check if an element has a specified data attribute. 1687 * 1688 * @param {string} data 1689 * The data attribute name. 1690 * 1691 * @return {boolean} 1692 * TRUE if an element has a specified data attribute. 1693 */ 1694 $.fn.hasData = function (data) { 1695 return (typeof this.data(data) !== 'undefined'); 1696 }; 1697 1698 /**
1699 * Check if element is within the webform or not. 1700 * 1701 * @return {boolean} 1702 * TRUE if element is within the webform. 1703 */ 1704 $.fn.isWebform = function () { 1705 return $(this).closest('form.webform-submission-form, form[id^="webform"], form[data-is-webform]').length ? true : false; 1706 }; 1707 1708 /** 1709 * Check if element is to be treated as a webform element. 1710 * 1711 * @return {boolean} 1712 * TRUE if element is to be treated as a webform element. 1713 */ 1714 $.fn.isWebformElement = function () { 1715 return ($(this).isWebform() || $(this).closest('[data-is-webform-element]').length) ? true : false; 1716 }; 1717 1718 /* ************************************************************************ */ 1719 // Trigger. 1720 /* ************************************************************************ */ 1721 1722 // The change event is triggered by cut-n-paste and select menus. 1723 // Issue #2445271: #states element empty check not triggered on mouse 1724 // based paste. 1725 // @see https://www.drupal.org/node/2445271 1726 Drupal.states.Trigger.states.empty.change = function change() { 1727 return this.val() === ''; 1728 }; 1729 1730 /* ************************************************************************ */ 1731 // Dependents. 1732 /* ************************************************************************ */ 1733 1734 // Apply solution included in #1962800 patch. 1735 // Issue #1962800: Form #states not working with literal integers as 1736 // values in IE11. 1737 // @see https://www.drupal.org/project/drupal/issues/1962800 1738 // @see https://www.drupal.org/files/issues/core-states-not-working-with-integers-ie11_1962800_46.patch 1739 // 1740 // This issue causes pattern, less than, and greater than support to break. 1741 // @see https://www.drupal.org/project/webform/issues/2981724 1742 var states = Drupal.states; 1743 Drupal.states.Dependent.prototype.compare = function compare(reference, selector, state) { 1744 var value = this.values[selector][state.name]; 1745 1746 var name = reference.constructor.name; 1747 if (!name) { 1748 name = $.type(reference); 1749 1750 name = name.charAt(0).toUpperCase() + name.slice(1); 1751 } 1752 if (name in states.Dependent.comparisons) { 1753 return states.Dependent.comparisons[name](reference, value); 1754 } 1755 1756 if (reference.constructor.name in states.Dependent.comparisons) { 1757 return states.Dependent.comparisons[reference.constructor.name](reference, value); 1758 } 1759 1760 return _compare2(reference, value); 1761 }; 1762 function _compare2(a, b) { 1763 if (a === b) { 1764 return typeof a === 'undefined' ? a : true; 1765 } 1766 1767 return typeof a === 'undefined' || typeof b === 'undefined'; 1768 } 1769 1770 // Adds pattern, less than, and greater than support to #state API. 1771 // @see http://drupalsun.com/julia-evans/2012/03/09/extending-form-api-states-regular-expressions 1772 Drupal.states.Dependent.comparisons.Object = function (reference, value) { 1773 if ('pattern' in reference) { 1774 return (new RegExp(reference['pattern'])).test(value); 1775 } 1776 else if ('!pattern' in reference) { 1777 return !((new RegExp(reference['!pattern'])).test(value)); 1778 } 1779 else if ('less' in reference) { 1780 return (value !== '' && parseFloat(reference['less']) > parseFloat(value)); 1781 } 1782 else if ('less_equal' in reference) { 1783 return (value !== '' && parseFloat(reference['less_equal']) >= parseFloat(value)); 1784 } 1785 else if ('greater' in reference) { 1786 return (value !== '' && parseFloat(reference['greater']) < parseFloat(value)); 1787 } 1788 else if ('greater_equal' in reference) { 1789 return (value !== '' && parseFloat(reference['greater_equal']) <= parseFloat(value)); 1790 } 1791 else if ('between' in reference || '!between' in reference) { 1792 if (value === '') { 1793 return false; 1794 } 1795 1796 var between = reference['between'] || reference['!between']; 1797 var betweenParts = between.split(':'); 1798 var greater = betweenParts[0]; 1799 var less = (typeof betweenParts[1] !== 'undefined') ? betweenParts[1] : null; 1800 var isGreaterThan = (greater === null || greater === '' || parseFloat(value) >= parseFloat(greater)); 1801 var isLessThan = (less === null || less === '' || parseFloat(value) <= parseFloat(less)); 1802 var result = (isGreaterThan && isLessThan); 1803 return (reference['!between']) ? !result : result; 1804 } 1805 else { 1806 return reference.indexOf(value) !== false; 1807 } 1808 }; 1809 1810 /* ************************************************************************ */ 1811 // States events. 1812 /* ************************************************************************ */ 1813 1814 var $document = $(document); 1815 1816 $document.on('state:required', function (e) { 1817 if (e.trigger && $(e.target).isWebformElement()) { 1818 var $target = $(e.target); 1819 // Fix #required file upload. 1820 // @see Issue #2860529: Conditional required File upload field don't work. 1821 toggleRequired($target.find('input[type="file"]'), e.value); 1822 1823 // Fix #required for radios and likert. 1824 // @see Issue #2856795: If radio buttons are required but not filled form is nevertheless submitted. 1825 if ($target.is('.js-form-type-radios, .js-form-type-webform-radios-other, .js-webform-type-radios, .js-webform-type-webform-radios-other, .js-webform-type-webform-entity-radios, .webform-likert-table')) { 1826 $target.toggleClass('required', e.value); 1827 toggleRequired($target.find('input[type="radio"]'), e.value); 1828 } 1829 1830 // Fix #required for checkboxes. 1831 // @see Issue #2938414: Checkboxes don't support #states required. 1832 // @see checkboxRequiredhandler 1833 if ($target.is('.js-form-type-checkboxes, .js-form-type-webform-checkboxes-other, .js-webform-type-checkboxes, .js-webform-type-webform-checkboxes-other')) { 1834 $target.toggleClass('required', e.value); 1835 var $checkboxes = $target.find('input[type="checkbox"]'); 1836 if (e.value) { 1837 // Add event handler. 1838 $checkboxes.on('click', statesCheckboxesRequiredEventHandler); 1839 // Initialize and add required attribute. 1840 checkboxesRequired($target); 1841 } 1842 else { 1843 // Remove event handler. 1844 $checkboxes.off('click', statesCheckboxesRequiredEventHandler); 1845 // Remove required attribute. 1846 toggleRequired($checkboxes, false); 1847 } 1848 } 1849 1850 // Fix #required for tableselect. 1851 // @see Issue #3212581: Table select does not trigger client side validation 1852 if ($target.is('.js-webform-tableselect')) { 1853 $target.toggleClass('required', e.value); 1854 var isMultiple = $target.is('[multiple]'); 1855 if (isMultiple) { 1856 // Checkboxes. 1857 var $tbody = $target.find('tbody'); 1858 var $checkboxes = $tbody.find('input[type="checkbox"]'); 1859 copyRequireMessage($target, $checkboxes); 1860 if (e.value) { 1861 $checkboxes.on('click change', statesCheckboxesRequiredEventHandler); 1862 checkboxesRequired($tbody); 1863 } 1864 else { 1865 $checkboxes.off('click change ', statesCheckboxesRequiredEventHandler); 1866 toggleRequired($tbody, false); 1867 } 1868 } 1869 else { 1870 // Radios. 1871 var $radios = $target.find('input[type="radio"]'); 1872 copyRequireMessage($target, $radios); 1873 toggleRequired($radios, e.value); 1874 } 1875 } 1876 1877 // Fix required label for elements without the for attribute. 1878 // @see Issue #3145300: Conditional Visible Select Other not working. 1879 if ($target.is('.js-form-type-webform-select-other, .js-webform-type-webform-select-other')) { 1880 var $select = $target.find('select'); 1881 toggleRequired($select, e.value); 1882 copyRequireMessage($target, $select); 1883 } 1884 if ($target.find('> label:not([for])').length) { 1885 $target.find('> label').toggleClass('js-form-required form-required', e.value); 1886 } 1887 1888 // Fix required label for checkboxes and radios. 1889 // @see Issue #2938414: Checkboxes don't support #states required 1890 // @see Issue #2731991: Setting required on radios marks all options required. 1891 // @see Issue #2856315: Conditional Logic - Requiring Radios in a Fieldset. 1892 // Fix #required for fieldsets. 1893 // @see Issue #2977569: Hidden fieldsets that become visible with conditional logic cannot be made required. 1894 if ($target.is('.js-webform-type-radios, .js-webform-type-checkboxes, fieldset')) { 1895 $target.find('legend span.fieldset-legend:not(.visually-hidden)').toggleClass('js-form-required form-required', e.value); 1896 } 1897 1898 // Issue #2986017: Fieldsets shouldn't have required attribute. 1899 if ($target.is('fieldset')) { 1900 $target.removeAttr('required aria-required'); 1901 } 1902 } 1903 }); 1904 1905 $document.on('state:checked', function (e) { 1906 if (e.trigger) { 1907 $(e.target).trigger('change'); 1908 } 1909 }); 1910 1911 $document.on('state:readonly', function (e) { 1912 if (e.trigger && $(e.target).isWebformElement()) { 1913 $(e.target).prop('readonly', e.value).closest('.js-form-item, .js-form-wrapper').toggleClass('webform-readonly', e.value).find('input, textarea').prop('readonly', e.value); 1914 1915 // Trigger webform:readonly. 1916 $(e.target).trigger('webform:readonly') 1917 .find('select, input, textarea, button').trigger('webform:readonly'); 1918 } 1919 }); 1920 1921 $document.on('state:visible state:visible-slide', function (e) { 1922 if (e.trigger && $(e.target).isWebformElement()) { 1923 if (e.value) { 1924 $(':input', e.target).addBack().each(function () { 1925 restoreValueAndRequired(this); 1926 triggerEventHandlers(this); 1927 }); 1928 } 1929 else { 1930 // @see https://www.sitepoint.com/jquery-function-clear-form-data/ 1931 $(':input', e.target).addBack().each(function () { 1932 backupValueAndRequired(this); 1933 clearValueAndRequired(this); 1934 triggerEventHandlers(this); 1935 }); 1936 } 1937 } 1938 }); 1939 1940 $document.on('state:visible-slide', function (e) { 1941 if (e.trigger && $(e.target).isWebformElement()) { 1942 var effect = e.value ? 'slideDown' : 'slideUp'; 1943 var duration = Drupal.webform.states[effect].duration; 1944 $(e.target).closest('.js-form-item, .js-form-submit, .js-form-wrapper')[effect](duration); 1945 } 1946 }); 1947 Drupal.states.State.aliases['invisible-slide'] = '!visible-slide'; 1948 1949 $document.on('state:disabled', function (e) { 1950 if (e.trigger && $(e.target).isWebformElement()) { 1951 // Make sure disabled property is set before triggering webform:disabled. 1952 // Copied from: core/misc/states.js 1953 $(e.target) 1954 .prop('disabled', e.value) 1955 .closest('.js-form-item, .js-form-submit, .js-form-wrapper').toggleClass('form-disabled', e.value) 1956 .find('select, input, textarea, button').prop('disabled', e.value); 1957 1958 // Never disable hidden file[fids] because the existing values will 1959 // be completely lost when the webform is submitted. 1960 var fileElements = $(e.target) 1961 .find(':input[type="hidden"][name$="[fids]"]'); 1962 if (fileElements.length) { 1963 // Remove 'disabled' attribute from fieldset which will block 1964 // all disabled elements from being submitted. 1965 if ($(e.target).is('fieldset')) { 1966 $(e.target).prop('disabled', false); 1967 } 1968 fileElements.removeAttr('disabled'); 1969 } 1970 1971 // Trigger webform:disabled. 1972 $(e.target).trigger('webform:disabled') 1973 .find('select, input, textarea, button').trigger('webform:disabled'); 1974 } 1975 }); 1976 1977 /* ************************************************************************ */ 1978 // Behaviors. 1979 /* ************************************************************************ */ 1980 1981 /** 1982 * Adds HTML5 validation to required checkboxes. 1983 * 1984 * @type {Drupal~behavior} 1985 * 1986 * @see https://www.drupal.org/project/webform/issues/3068998 1987 */ 1988 Drupal.behaviors.webformCheckboxesRequired = { 1989 attach: function (context) { 1990 $('.js-form-type-checkboxes.required, .js-form-type-webform-checkboxes-other.required, .js-webform-type-checkboxes.required, .js-webform-type-webform-checkboxes-other.required, .js-webform-type-webform-radios-other.checkboxes', context) 1991 .once('webform-checkboxes-required') 1992 .each(function () { 1993 var $element = $(this); 1994 $element.find('input[type="checkbox"]').on('click', statesCheckboxesRequiredEventHandler); 1995 setTimeout(function () {checkboxesRequired($element);}); 1996 }); 1997 } 1998 }; 1999 2000 /** 2001 * Adds HTML5 validation to required radios. 2002 * 2003 * @type {Drupal~behavior} 2004 * 2005 * @see https://www.drupal.org/project/webform/issues/2856795 2006 */ 2007 Drupal.behaviors.webformRadiosRequired = { 2008 attach: function (context) { 2009 $('.js-form-type-radios, .js-form-type-webform-radios-other, .js-webform-type-radios, .js-webform-type-webform-radios-other, .js-webform-type-webform-entity-radios, .js-webform-type-webform-scale', context) 2010 .once('webform-radios-required') 2011 .each(function () { 2012 var $element = $(this); 2013 setTimeout(function () {radiosRequired($element);}); 2014 }); 2015 } 2016 }; 2017 2018 /** 2019 * Adds HTML5 validation to required table select. 2020 * 2021 * @type {Drupal~behavior} 2022 * 2023 * @see https://www.drupal.org/project/webform/issues/2856795 2024 */ 2025 Drupal.behaviors.webformTableSelectRequired = { 2026 attach: function (context) { 2027 $('.js-webform-tableselect.required', context) 2028 .once('webform-tableselect-required') 2029 .each(function () { 2030 var $element = $(this); 2031 var $tbody = $element.find('tbody'); 2032 var isMultiple = $element.is('[multiple]'); 2033 2034 if (isMultiple) { 2035 // Check all checkbox triggers checkbox 'change' event on 2036 // select and deselect all. 2037 // @see Drupal.tableSelect 2038 $tbody.find('input[type="checkbox"]').on('click change', function () { 2039 checkboxesRequired($tbody); 2040 }); 2041 } 2042 2043 setTimeout(function () { 2044 isMultiple ? checkboxesRequired($tbody) : radiosRequired($element); 2045 }); 2046 }); 2047 } 2048 }; 2049 2050 /** 2051 * Add HTML5 multiple checkboxes required validation. 2052 * 2053 * @param {jQuery} $element
2054 * An jQuery object containing HTML5 radios. 2055 * 2056 * @see https://stackoverflow.com/a/37825072/145846 2057 */ 2058 function checkboxesRequired($element) { 2059 var $firstCheckbox = $element.find('input[type="checkbox"]').first(); 2060 var isChecked = $element.find('input[type="checkbox"]').is(':checked'); 2061 toggleRequired($firstCheckbox, !isChecked); 2062 copyRequireMessage($element, $firstCheckbox); 2063 } 2064 2065 /** 2066 * Add HTML5 radios required validation. 2067 * 2068 * @param {jQuery} $element 2069 * An jQuery object containing HTML5 radios. 2070 * 2071 * @see https://www.drupal.org/project/webform/issues/2856795 2072 */ 2073 function radiosRequired($element) { 2074 var $radios = $element.find('input[type="radio"]'); 2075 var isRequired = $element.hasClass('required'); 2076 toggleRequired($radios, isRequired); 2077 copyRequireMessage($element, $radios); 2078 } 2079 2080 /* ************************************************************************ */ 2081 // Event handlers. 2082 /* ************************************************************************ */ 2083 2084 /** 2085 * Trigger #states API HTML5 multiple checkboxes required validation. 2086 * 2087 * @see https://stackoverflow.com/a/37825072/145846 2088 */ 2089 function statesCheckboxesRequiredEventHandler() { 2090 var $element = $(this).closest('.js-webform-type-checkboxes, .js-webform-type-webform-checkboxes-other'); 2091 checkboxesRequired($element); 2092 } 2093 2094 /** 2095 * Trigger an input's event handlers. 2096 * 2097 * @param {element} input 2098 * An input. 2099 */ 2100 function triggerEventHandlers(input) { 2101 var $input = $(input); 2102 var type = input.type; 2103 var tag = input.tagName.toLowerCase(); 2104 // Add 'webform.states' as extra parameter to event handlers. 2105 // @see Drupal.behaviors.webformUnsaved 2106 var extraParameters = ['webform.states']; 2107 if (type === 'checkbox' || type === 'radio') { 2108 $input 2109 .trigger('change', extraParameters) 2110 .trigger('blur', extraParameters); 2111 } 2112 else if (tag === 'select') { 2113 // Do not trigger the onchange event for Address element's country code 2114 // when it is initialized. 2115 // @see \Drupal\address\Element\Country 2116 if ($input.closest('.webform-type-address').length) { 2117 if (!$input.data('webform-states-address-initialized') 2118 && $input.attr('autocomplete') === 'country' 2119 && $input.val() === $input.find("option[selected]").attr('value')) { 2120 return; 2121 } 2122 $input.data('webform-states-address-initialized', true); 2123 } 2124 2125 $input 2126 .trigger('change', extraParameters) 2127 .trigger('blur', extraParameters); 2128 } 2129 else if (type !== 'submit' && type !== 'button' && type !== 'file') { 2130 // Make sure input mask is removed and then reset when value is restored. 2131 // @see https://www.drupal.org/project/webform/issues/3124155 2132 // @see https://www.drupal.org/project/webform/issues/3202795 2133 var hasInputMask = ($.fn.inputmask && $input.hasClass('js-webform-input-mask')); 2134 hasInputMask && $input.inputmask('remove'); 2135 2136 $input 2137 .trigger('input', extraParameters) 2138 .trigger('change', extraParameters) 2139 .trigger('keydown', extraParameters) 2140 .trigger('keyup', extraParameters) 2141 .trigger('blur', extraParameters); 2142 2143 hasInputMask && $input.inputmask(); 2144 } 2145 } 2146 2147 /* ************************************************************************ */ 2148 // Backup and restore value functions. 2149 /* ************************************************************************ */ 2150 2151 /** 2152 * Backup an input's current value and required attribute 2153 * 2154 * @param {element} input 2155 * An input. 2156 */ 2157 function backupValueAndRequired(input) { 2158 var $input = $(input); 2159 var type = input.type; 2160 var tag = input.tagName.toLowerCase(); // Normalize case. 2161 2162 // Backup required. 2163 if ($input.prop('required') && !$input.hasData('webform-required')) { 2164 $input.data('webform-required', true); 2165 } 2166 2167 // Backup value. 2168 if (!$input.hasData('webform-value')) { 2169 if (type === 'checkbox' || type === 'radio') { 2170 $input.data('webform-value', $input.prop('checked')); 2171 } 2172 else if (tag === 'select') { 2173 var values = []; 2174 $input.find('option:selected').each(function (i, option) { 2175 values[i] = option.value; 2176 }); 2177 $input.data('webform-value', values); 2178 } 2179 else if (type !== 'submit' && type !== 'button') { 2180 $input.data('webform-value', input.value); 2181 } 2182 } 2183 } 2184 2185 /** 2186 * Restore an input's value and required attribute. 2187 * 2188 * @param {element} input 2189 * An input. 2190 */ 2191 function restoreValueAndRequired(input) { 2192 var $input = $(input); 2193 2194 // Restore value. 2195 var value = $input.data('webform-value'); 2196 if (typeof value !== 'undefined') { 2197 var type = input.type; 2198 var tag = input.tagName.toLowerCase(); // Normalize case. 2199 2200 if (type === 'checkbox' || type === 'radio') { 2201 $input.prop('checked', value); 2202 } 2203 else if (tag === 'select') { 2204 $.each(value, function (i, option_value) { 2205 // Prevent "Syntax error, unrecognized expression" error by 2206 // escaping single quotes. 2207 // @see https://forum.jquery.com/topic/escape-characters-prior-to-using-selector 2208 option_value = option_value.replace(/'/g, "\\\'"); 2209 $input.find("option[value='" + option_value + "']").prop('selected', true); 2210 }); 2211 } 2212 else if (type !== 'submit' && type !== 'button') { 2213 input.value = value; 2214 } 2215 $input.removeData('webform-value'); 2216 } 2217 2218 // Restore required. 2219 var required = $input.data('webform-required'); 2220 if (typeof required !== 'undefined') { 2221 if (required) { 2222 $input.prop('required', true); 2223 } 2224 $input.removeData('webform-required'); 2225 } 2226 } 2227 2228 /** 2229 * Clear an input's value and required attributes. 2230 * 2231 * @param {element} input 2232 * An input. 2233 */ 2234 function clearValueAndRequired(input) { 2235 var $input = $(input); 2236 2237 // Check for #states no clear attribute.
2238 // @see https://css-tricks.com/snippets/jquery/make-an-jquery-hasattr/ 2239 if ($input.closest('[data-webform-states-no-clear]').length) { 2240 return; 2241 } 2242 2243 // Clear value. 2244 var type = input.type; 2245 var tag = input.tagName.toLowerCase(); // Normalize case. 2246 if (type === 'checkbox' || type === 'radio') { 2247 $input.prop('checked', false); 2248 } 2249 else if (tag === 'select') { 2250 if ($input.find('option[value=""]').length) { 2251 $input.val(''); 2252 } 2253 else { 2254 input.selectedIndex = -1; 2255 } 2256 } 2257 else if (type !== 'submit' && type !== 'button') { 2258 input.value = (type === 'color') ? '#000000' : ''; 2259 } 2260 2261 // Clear required. 2262 $input.prop('required', false); 2263 } 2264 2265 /* ************************************************************************ */ 2266 // Helper functions. 2267 /* ************************************************************************ */ 2268 2269 /** 2270 * Toggle an input's required attributes. 2271 * 2272 * @param {element} $input 2273 * An input. 2274 * @param {boolean} required 2275 * Is input required. 2276 */ 2277 function toggleRequired($input, required) { 2278 var isCheckboxOrRadio = ($input.attr('type') === 'radio' || $input.attr('type') === 'checkbox'); 2279 if (required) { 2280 if (isCheckboxOrRadio) { 2281 $input.attr({'required': 'required'}); 2282 } 2283 else { 2284 $input.attr({'required': 'required', 'aria-required': 'true'}); 2285 } 2286 } 2287 else { 2288 if (isCheckboxOrRadio) { 2289 $input.removeAttr('required'); 2290 } 2291 else { 2292 $input.removeAttr('required aria-required'); 2293 } 2294 } 2295 } 2296 2297 /** 2298 * Copy the clientside_validation.module's message. 2299 * 2300 * @param {jQuery} $source 2301 * The source element. 2302 * @param {jQuery} $destination 2303 * The destination element. 2304 */ 2305 function copyRequireMessage($source, $destination) { 2306 if ($source.attr('data-msg-required')) { 2307 $destination.attr('data-msg-required', $source.attr('data-msg-required')); 2308 } 2309 } 2310 2311})(jQuery, Drupal); 2312; 2313/** 2314 * @file 2315 * JavaScript behaviors for custom webform #states. 2316 */ 2317 2318(function ($, Drupal) { 2319 2320 'use strict'; 2321 2322 $(document).on('state:required', function (e) { 2323 if (e.trigger && $(e.target).isWebform()) { 2324 var $target = $(e.target); 2325 2326 // @see Issue #2856315: Conditional Logic - Requiring Radios in a Fieldset. 2327 // Fix #required for fieldsets. 2328 if ($target.is('.js-form-wrapper.panel')) { 2329 if (e.value) { 2330 $target.find('.panel-heading .panel-title').addClass('js-form-required form-required'); 2331 } 2332 else { 2333 $target.find('.panel-heading .panel-title').removeClass('js-form-required form-required'); 2334 } 2335 } 2336 2337 } 2338 }); 2339 2340})(jQuery, Drupal); 2341; 2342/** 2343 * @file 2344 * Bootstrap Popovers. 2345 */ 2346 2347var Drupal = Drupal || {}; 2348 2349(function ($, Drupal, Bootstrap) { 2350 "use strict"; 2351 2352 var $document = $(document); 2353 2354 /** 2355 * Extend the Bootstrap Popover plugin constructor class. 2356 */ 2357 Bootstrap.extendPlugin('popover', function (settings) { 2358 return { 2359 DEFAULTS: { 2360 animation: !!settings.popover_animation, 2361 autoClose: !!settings.popover_auto_close, 2362 enabled: settings.popover_enabled, 2363 html: !!settings.popover_html, 2364 placement: settings.popover_placement, 2365 selector: settings.popover_selector, 2366 trigger: settings.popover_trigger, 2367 title: settings.popover_title, 2368 content: settings.popover_content, 2369 delay: parseInt(settings.popover_delay, 10), 2370 container: settings.popover_container 2371 } 2372 }; 2373 }); 2374 2375 /** 2376 * Bootstrap Popovers. 2377 * 2378 * @todo This should really be properly delegated if selector option is set. 2379 */ 2380 Drupal.behaviors.bootstrapPopovers = { 2381 $activePopover: null, 2382 attach: function (context) { 2383 // Immediately return if popovers are not available. 2384 if (!$.fn.popover || !$.fn.popover.Constructor.DEFAULTS.enabled) { 2385 return; 2386 } 2387 2388 var _this = this; 2389 2390 $document 2391 .on('show.bs.popover', '[data-toggle=popover]', function () { 2392 var $trigger = $(this); 2393 var popover = $trigger.data('bs.popover'); 2394 2395 // Only keep track of clicked triggers that we're manually handling. 2396 if (popover.options.originalTrigger === 'click') { 2397 if (_this.$activePopover && _this.getOption('autoClose') && !_this.$activePopover.is($trigger)) { 2398 _this.$activePopover.popover('hide'); 2399 } 2400 _this.$activePopover = $trigger; 2401 } 2402 }) 2403 // Unfortunately, :focusable is only made available when using jQuery 2404 // UI. While this would be the most semantic pseudo selector to use 2405 // here, jQuery UI may not always be loaded. Instead, just use :visible 2406 // here as this just needs some sort of selector here. This activates 2407 // delegate binding to elements in jQuery so it can work it's bubbling 2408 // focus magic since elements don't really propagate their focus events. 2409 // @see https://www.drupal.org/project/bootstrap/issues/3013236 2410 .on('focus.bs.popover', ':visible', function (e) { 2411 var $target = $(e.target); 2412 if (_this.$activePopover && _this.getOption('autoClose') && !_this.$activePopover.is($target) && !$target.closest('.popover.in')[0]) { 2413 _this.$activePopover.popover('hide'); 2414 _this.$activePopover = null; 2415 } 2416 }) 2417 .on('click.bs.popover', function (e) { 2418 var $target = $(e.target); 2419 if (_this.$activePopover && _this.getOption('autoClose') && !$target.is('[data-toggle=popover]') && !$target.closest('.popover.in')[0]) { 2420 _this.$activePopover.popover('hide'); 2421 _this.$activePopover = null; 2422 } 2423 }) 2424 .on('keyup.bs.popover', function (e) { 2425 if (_this.$activePopover && _this.getOption('autoClose') && e.which === 27) { 2426 _this.$activePopover.popover('hide'); 2427 _this.$activePopover = null; 2428 } 2429 }) 2430 ; 2431 2432 var elements = $(context).find('[data-toggle=popover]').toArray(); 2433 for (var i = 0; i < elements.length; i++) { 2434 var $element = $(elements[i]); 2435 var options = $.extend({}, $.fn.popover.Constructor.DEFAULTS, $element.data()); 2436 2437 // Store the original trigger. 2438 options.originalTrigger = options.trigger; 2439 2440 // If the trigger is "click", then we'll handle it manually here. 2441 if (options.trigger === 'click') { 2442 options.trigger = 'manual'; 2443 } 2444 2445 // Retrieve content from a target element. 2446 var target = options.target || $element.is('a[href^="#"]') && $element.attr('href'); 2447 var $target = $document.find(target).clone(); 2448 if (!options.content && $target[0]) { 2449 $target.removeClass('visually-hidden hidden').removeAttr('aria-hidden'); 2450 options.content = $target.wrap('<div/>').parent()[options.html ? 'html' : 'text']() || ''; 2451 } 2452 2453 // Initialize the popover. 2454 $element.popover(options); 2455 2456 // Handle clicks manually. 2457 if (options.originalTrigger === 'click') { 2458 // To ensure the element is bound multiple times, remove any 2459 // previously set event handler before adding another one. 2460 $element 2461 .off('click.drupal.bootstrap.popover') 2462 .on('click.drupal.bootstrap.popover', function (e) { 2463 $(this).popover('toggle'); 2464 e.preventDefault(); 2465 e.stopPropagation(); 2466 }) 2467 ; 2468 } 2469 } 2470 }, 2471 detach: function (context) { 2472 // Immediately return if popovers are not available. 2473 if (!$.fn.popover || !$.fn.popover.Constructor.DEFAULTS.enabled) { 2474 return; 2475 } 2476 2477 // Destroy all popovers. 2478 $(context).find('[data-toggle="popover"]') 2479 .off('click.drupal.bootstrap.popover') 2480 .popover('destroy') 2481 ; 2482 }, 2483 getOption: function(name, defaultValue, element) { 2484 var $element = element ? $(element) : this.$activePopover; 2485 var options = $.extend(true, {}, $.fn.popover.Constructor.DEFAULTS, ($element && $element.data('bs.popover') || {}).options); 2486 if (options[name] !== void 0) { 2487 return options[name]; 2488 } 2489 return defaultValue !== void 0 ? defaultValue : void 0; 2490 } 2491 }; 2492 2493})(window.jQuery, window.Drupal, window.Drupal.bootstrap); 2494; 2495/** 2496 * @file 2497 * Bootstrap Tooltips. 2498 */ 2499 2500var Drupal = Drupal || {}; 2501 2502(function ($, Drupal, Bootstrap) { 2503 "use strict"; 2504 2505 /** 2506 * Extend the Bootstrap Tooltip plugin constructor class. 2507 */ 2508 Bootstrap.extendPlugin('tooltip', function (settings) { 2509 return { 2510 DEFAULTS: { 2511 animation: !!settings.tooltip_animation, 2512 enabled: settings.tooltip_enabled, 2513 html: !!settings.tooltip_html, 2514 placement: settings.tooltip_placement, 2515 selector: settings.tooltip_selector, 2516 trigger: settings.tooltip_trigger, 2517 delay: parseInt(settings.tooltip_delay, 10), 2518 container: settings.tooltip_container 2519 } 2520 }; 2521 }); 2522 2523 /** 2524 * Bootstrap Tooltips. 2525 * 2526 * @todo This should really be properly delegated if selector option is set. 2527 */ 2528 Drupal.behaviors.bootstrapTooltips = { 2529 attach: function (context) { 2530 // Immediately return if tooltips are not available. 2531 if (!$.fn.tooltip || !$.fn.tooltip.Constructor.DEFAULTS.enabled) { 2532 return; 2533 } 2534 2535 var elements = $(context).find('[data-toggle="tooltip"]').toArray(); 2536 for (var i = 0; i < elements.length; i++) { 2537 var $element = $(elements[i]); 2538 var options = $.extend({}, $.fn.tooltip.Constructor.DEFAULTS, $element.data()); 2539 $element.tooltip(options); 2540 } 2541 }, 2542 detach: function (context) { 2543 // Immediately return if tooltips are not available. 2544 if (!$.fn.tooltip || !$.fn.tooltip.Constructor.DEFAULTS.enabled) { 2545 return; 2546 } 2547 2548 // Destroy all tooltips. 2549 $(context).find('[data-toggle="tooltip"]').tooltip('destroy'); 2550 } 2551 }; 2552 2553})(window.jQuery, window.Drupal, window.Drupal.bootstrap); 2554; 2555/*! 2556 * jQuery Form Plugin 2557 * version: 4.3.0 2558 * Requires jQuery v1.7.2 or later 2559 * Project repository: https://github.com/jquery-form/form 2560 2561 * Copyright 2017 Kevin Morris 2562 * Copyright 2006 M. Alsup 2563 2564 * Dual licensed under the LGPL-2.1+ or MIT licenses 2565 * https://github.com/jquery-form/form#license 2566 2567 * This library is free software; you can redistribute it and/or 2568 * modify it under the terms of the GNU Lesser General Public
vendor: 16,397 bytes, lines 2569-2576
2569 * License as published by the Free Software Foundation; either 2570 * version 2.1 of the License, or (at your option) any later version. 2571 * This library is distributed in the hope that it will be useful, 2572 * but WITHOUT ANY WARRANTY; without even the implied warranty of 2573 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 2574 * Lesser General Public License for more details. 2575 */ 2576!function(r){"function"==typeof define&&define.amd?define(["jquery"],r):"object"==typeof module&&module.exports?module.exports=function(e,t){return void 0===t&&(t="undefined"!=typeof window?require("jquery"):require("jquery")(e)),r(t),t}:r(jQuery)}(function(q){"use strict";var m=/\r?\n/g,S={};S.fileapi=void 0!==q('<input type="file">').get(0).files,S.formdata=void 0!==window.FormData;var _=!!q.fn.prop;function o(e){var t=e.data;e.isDefaultPrevented()||(e.preventDefault(),q(e.target).closest("form").ajaxSubmit(t))}function i(e){var t=e.target,r=q(t);if(!r.is("[type=submit],[type=image]")){var a=r.closest("[type=submit]");if(0===a.length)return;t=a[0]}var n,o=t.form;"image"===(o.clk=t).type&&(void 0!==e.offsetX?(o.clk_x=e.offsetX,o.clk_y=e.offsetY):"function"==typeof q.fn.offset?(n=r.offset(),o.clk_x=e.pageX-n.left,o.clk_y=e.pageY-n.top):(o.clk_x=e.pageX-t.offsetLeft,o.clk_y=e.pageY-t.offsetTop)),setTimeout(function(){o.clk=o.clk_x=o.clk_y=null},100)}function N(){var e;q.fn.ajaxSubmit.debug&&(e="[jquery.form] "+Array.prototype.join.call(arguments,""),window.console&&window.console.log?window.console.log(e):window.opera&&window.opera.postError&&window.opera.postError(e))}q.fn.attr2=function(){if(!_)return this.attr.apply(this,arguments);var e=this.prop.apply(this,arguments);return e&&e.jquery||"string"==typeof e?e:this.attr.apply(this,arguments)},q.fn.ajaxSubmit=function(M,e,t,r){if(!this.length)return N("ajaxSubmit: skipping submit process - no element selected"),this;var O,a,n,o,X=this;"function"==typeof M?M={success:M}:"string"==typeof M||!1===M&&0<arguments.length?(M={url:M,data:e,dataType:t},"function"==typeof r&&(M.success=r)):void 0===M&&(M={}),O=M.method||M.type||this.attr2("method"),n=(n=(n="string"==typeof(a=M.url||this.attr2("action"))?q.trim(a):"")||window.location.href||"")&&(n.match(/^([^#]+)/)||[])[1],o=/(MSIE|Trident)/.test(navigator.userAgent||"")&&/^https/i.test(window.location.href||"")?"javascript:false":"about:blank",M=q.extend(!0,{url:n,success:q.ajaxSettings.success,type:O||q.ajaxSettings.type,iframeSrc:o},M);var i={};if(this.trigger("form-pre-serialize",[this,M,i]),i.veto)return N("ajaxSubmit: submit vetoed via form-pre-serialize trigger"),this;if(M.beforeSerialize&&!1===M.beforeSerialize(this,M))return N("ajaxSubmit: submit aborted via beforeSerialize callback"),this;var s=M.traditional;void 0===s&&(s=q.ajaxSettings.traditional);var u,c,C=[],l=this.formToArray(M.semantic,C,M.filtering);if(M.data&&(c=q.isFunction(M.data)?M.data(l):M.data,M.extraData=c,u=q.param(c,s)),M.beforeSubmit&&!1===M.beforeSubmit(l,this,M))return N("ajaxSubmit: submit aborted via beforeSubmit callback"),this;if(this.trigger("form-submit-validate",[l,this,M,i]),i.veto)return N("ajaxSubmit: submit vetoed via form-submit-validate trigger"),this;var f=q.param(l,s);u&&(f=f?f+"&"+u:u),"GET"===M.type.toUpperCase()?(M.url+=(0<=M.url.indexOf("?")?"&":"?")+f,M.data=null):M.data=f;var d,m,p,h=[];M.resetForm&&h.push(function(){X.resetForm()}),M.clearForm&&h.push(function(){X.clearForm(M.includeHidden)}),!M.dataType&&M.target?(d=M.success||function(){},h.push(function(e,t,r){var a=arguments,n=M.replaceTarget?"replaceWith":"html";q(M.target)[n](e).each(function(){d.apply(this,a)})})):M.success&&(q.isArray(M.success)?q.merge(h,M.success):h.push(M.success)),M.success=function(e,t,r){for(var a=M.context||this,n=0,o=h.length;n<o;n++)h[n].apply(a,[e,t,r||X,X])},M.error&&(m=M.error,M.error=function(e,t,r){var a=M.context||this;m.apply(a,[e,t,r,X])}),M.complete&&(p=M.complete,M.complete=function(e,t){var r=M.context||this;p.apply(r,[e,t,X])});var v=0<q("input[type=file]:enabled",this).filter(function(){return""!==q(this).val()}).length,g="multipart/form-data",x=X.attr("enctype")===g||X.attr("encoding")===g,y=S.fileapi&&S.formdata;N("fileAPI :"+y);var b,T=(v||x)&&!y;!1!==M.iframe&&(M.iframe||T)?M.closeKeepAlive?q.get(M.closeKeepAlive,function(){b=w(l)}):b=w(l):b=(v||x)&&y?function(e){for(var r=new FormData,t=0;t<e.length;t++)r.append(e[t].name,e[t].value);if(M.extraData){var a=function(e){var t,r,a=q.param(e,M.traditional).split("&"),n=a.length,o=[];for(t=0;t<n;t++)a[t]=a[t].replace(/\+/g," "),r=a[t].split("="),o.push([decodeURIComponent(r[0]),decodeURIComponent(r[1])]);return o}(M.extraData);for(t=0;t<a.length;t++)a[t]&&r.append(a[t][0],a[t][1])}M.data=null;var n=q.extend(!0,{},q.ajaxSettings,M,{contentType:!1,processData:!1,cache:!1,type:O||"POST"});M.uploadProgress&&(n.xhr=function(){var e=q.ajaxSettings.xhr();return e.upload&&e.upload.addEventListener("progress",function(e){var t=0,r=e.loaded||e.position,a=e.total;e.lengthComputable&&(t=Math.ceil(r/a*100)),M.uploadProgress(e,r,a,t)},!1),e});n.data=null;var o=n.beforeSend;return n.beforeSend=function(e,t){M.formData?t.data=M.formData:t.data=r,o&&o.call(this,e,t)},q.ajax(n)}(l):q.ajax(M),X.removeData("jqxhr").data("jqxhr",b);for(var j=0;j<C.length;j++)C[j]=null;return this.trigger("form-submit-notify",[this,M]),this;function w(e){var t,r,l,f,o,d,m,p,a,n,h,v,i=X[0],g=q.Deferred();if(g.abort=function(e){p.abort(e)},e)for(r=0;r<C.length;r++)t=q(C[r]),_?t.prop("disabled",!1):t.removeAttr("disabled");(l=q.extend(!0,{},q.ajaxSettings,M)).context=l.context||l,o="jqFormIO"+(new Date).getTime();var s=i.ownerDocument,u=X.closest("body");if(l.iframeTarget?(n=(d=q(l.iframeTarget,s)).attr2("name"))?o=n:d.attr2("name",o):(d=q('<iframe name="'+o+'" src="'+l.iframeSrc+'" />',s)).css({position:"absolute",top:"-1000px",left:"-1000px"}),m=d[0],p={aborted:0,responseText:null,responseXML:null,status:0,statusText:"n/a",getAllResponseHeaders:function(){},getResponseHeader:function(){},setRequestHeader:function(){},abort:function(e){var t="timeout"===e?"timeout":"aborted";N("aborting upload... "+t),this.aborted=1;try{m.contentWindow.document.execCommand&&m.contentWindow.document.execCommand("Stop")}catch(e){}d.attr("src",l.iframeSrc),p.error=t,l.error&&l.error.call(l.context,p,t,e),f&&q.event.trigger("ajaxError",[p,l,t]),l.complete&&l.complete.call(l.context,p,t)}},(f=l.global)&&0==q.active++&&q.event.trigger("ajaxStart"),f&&q.event.trigger("ajaxSend",[p,l]),l.beforeSend&&!1===l.beforeSend.call(l.context,p,l))return l.global&&q.active--,g.reject(),g;if(p.aborted)return g.reject(),g;(a=i.clk)&&(n=a.name)&&!a.disabled&&(l.extraData=l.extraData||{},l.extraData[n]=a.value,"image"===a.type&&(l.extraData[n+".x"]=i.clk_x,l.extraData[n+".y"]=i.clk_y));var x=1,y=2;function b(t){var r=null;try{t.contentWindow&&(r=t.contentWindow.document)}catch(e){N("cannot get iframe.contentWindow document: "+e)}if(r)return r;try{r=t.contentDocument?t.contentDocument:t.document}catch(e){N("cannot get iframe.contentDocument: "+e),r=t.document}return r}var c=q("meta[name=csrf-token]").attr("content"),T=q("meta[name=csrf-param]").attr("content");function j(){var e=X.attr2("target"),t=X.attr2("action"),r=X.attr("enctype")||X.attr("encoding")||"multipart/form-data";i.setAttribute("target",o),O&&!/post/i.test(O)||i.setAttribute("method","POST"),t!==l.url&&i.setAttribute("action",l.url),l.skipEncodingOverride||O&&!/post/i.test(O)||X.attr({encoding:"multipart/form-data",enctype:"multipart/form-data"}),l.timeout&&(v=setTimeout(function(){h=!0,A(x)},l.timeout));var a=[];try{if(l.extraData)for(var n in l.extraData)l.extraData.hasOwnProperty(n)&&(q.isPlainObject(l.extraData[n])&&l.extraData[n].hasOwnProperty("name")&&l.extraData[n].hasOwnProperty("value")?a.push(q('<input type="hidden" name="'+l.extraData[n].name+'">',s).val(l.extraData[n].value).appendTo(i)[0]):a.push(q('<input type="hidden" name="'+n+'">',s).val(l.extraData[n]).appendTo(i)[0]));l.iframeTarget||d.appendTo(u),m.attachEvent?m.attachEvent("onload",A):m.addEventListener("load",A,!1),setTimeout(function e(){try{var t=b(m).readyState;N("state = "+t),t&&"uninitialized"===t.toLowerCase()&&setTimeout(e,50)}catch(e){N("Server abort: ",e," (",e.name,")"),A(y),v&&clearTimeout(v),v=void 0}},15);try{i.submit()}catch(e){document.createElement("form").submit.apply(i)}}finally{i.setAttribute("action",t),i.setAttribute("enctype",r),e?i.setAttribute("target",e):X.removeAttr("target"),q(a).remove()}}T&&c&&(l.extraData=l.extraData||{},l.extraData[T]=c),l.forceSync?j():setTimeout(j,10);var w,S,k,D=50;function A(e){if(!p.aborted&&!k){if((S=b(m))||(N("cannot access response document"),e=y),e===x&&p)return p.abort("timeout"),void g.reject(p,"timeout");if(e===y&&p)return p.abort("server abort"),void g.reject(p,"error","server abort");if(S&&S.location.href!==l.iframeSrc||h){m.detachEvent?m.detachEvent("onload",A):m.removeEventListener("load",A,!1);var t,r="success";try{if(h)throw"timeout";var a="xml"===l.dataType||S.XMLDocument||q.isXMLDoc(S);if(N("isXml="+a),!a&&window.opera&&(null===S.body||!S.body.innerHTML)&&--D)return N("requeing onLoad callback, DOM not available"),void setTimeout(A,250);var n=S.body?S.body:S.documentElement;p.responseText=n?n.innerHTML:null,p.responseXML=S.XMLDocument?S.XMLDocument:S,a&&(l.dataType="xml"),p.getResponseHeader=function(e){return{"content-type":l.dataType}[e.toLowerCase()]},n&&(p.status=Number(n.getAttribute("status"))||p.status,p.statusText=n.getAttribute("statusText")||p.statusText);var o,i,s,u=(l.dataType||"").toLowerCase(),c=/(json|script|text)/.test(u);c||l.textarea?(o=S.getElementsByTagName("textarea")[0])?(p.responseText=o.value,p.status=Number(o.getAttribute("status"))||p.status,p.statusText=o.getAttribute("statusText")||p.statusText):c&&(i=S.getElementsByTagName("pre")[0],s=S.getElementsByTagName("body")[0],i?p.responseText=i.textContent?i.textContent:i.innerText:s&&(p.responseText=s.textContent?s.textContent:s.innerText)):"xml"===u&&!p.responseXML&&p.responseText&&(p.responseXML=F(p.responseText));try{w=E(p,u,l)}catch(e){r="parsererror",p.error=t=e||r}}catch(e){N("error caught: ",e),r="error",p.error=t=e||r}p.aborted&&(N("upload aborted"),r=null),p.status&&(r=200<=p.status&&p.status<300||304===p.status?"success":"error"),"success"===r?(l.success&&l.success.call(l.context,w,"success",p),g.resolve(p.responseText,"success",p),f&&q.event.trigger("ajaxSuccess",[p,l])):r&&(void 0===t&&(t=p.statusText),l.error&&l.error.call(l.context,p,r,t),g.reject(p,"error",t),f&&q.event.trigger("ajaxError",[p,l,t])),f&&q.event.trigger("ajaxComplete",[p,l]),f&&!--q.active&&q.event.trigger("ajaxStop"),l.complete&&l.complete.call(l.context,p,r),k=!0,l.timeout&&clearTimeout(v),setTimeout(function(){l.iframeTarget?d.attr("src",l.iframeSrc):d.remove(),p.responseXML=null},100)}}}var F=q.parseXML||function(e,t){return window.ActiveXObject?((t=new ActiveXObject("Microsoft.XMLDOM")).async="false",t.loadXML(e)):t=(new DOMParser).parseFromString(e,"text/xml"),t&&t.documentElement&&"parsererror"!==t.documentElement.nodeName?t:null},L=q.parseJSON||function(e){return window.eval("("+e+")")},E=function(e,t,r){var a=e.getResponseHeader("content-type")||"",n=("xml"===t||!t)&&0<=a.indexOf("xml"),o=n?e.responseXML:e.responseText;return n&&"parsererror"===o.documentElement.nodeName&&q.error&&q.error("parsererror"),r&&r.dataFilter&&(o=r.dataFilter(o,t)),"string"==typeof o&&(("json"===t||!t)&&0<=a.indexOf("json")?o=L(o):("script"===t||!t)&&0<=a.indexOf("javascript")&&q.globalEval(o)),o};return g}},q.fn.ajaxForm=function(e,t,r,a){if(("string"==typeof e||!1===e&&0<arguments.length)&&(e={url:e,data:t,dataType:r},"function"==typeof a&&(e.success=a)),(e=e||{}).delegation=e.delegation&&q.isFunction(q.fn.on),e.delegation||0!==this.length)return e.delegation?(q(document).off("submit.form-plugin",this.selector,o).off("click.form-plugin",this.selector,i).on("submit.form-plugin",this.selector,e,o).on("click.form-plugin",this.selector,e,i),this):(e.beforeFormUnbind&&e.beforeFormUnbind(this,e),this.ajaxFormUnbind().on("submit.form-plugin",e,o).on("click.form-plugin",e,i));var n={s:this.selector,c:this.context};return!q.isReady&&n.s?(N("DOM not ready, queuing ajaxForm"),q(function(){q(n.s,n.c).ajaxForm(e)})):N("terminating; zero elements found by selector"+(q.isReady?"":" (DOM not ready)")),this},q.fn.ajaxFormUnbind=function(){return this.off("submit.form-plugin click.form-plugin")},q.fn.formToArray=function(e,t,r){var a=[];if(0===this.length)return a;var n,o,i,s,u,c,l,f,d,m,p=this[0],h=this.attr("id"),v=(v=e||void 0===p.elements?p.getElementsByTagName("*"):p.elements)&&q.makeArray(v);if(h&&(e||/(Edge|Trident)\//.test(navigator.userAgent))&&(n=q(':input[form="'+h+'"]').get()).length&&(v=(v||[]).concat(n)),!v||!v.length)return a;for(q.isFunction(r)&&(v=q.map(v,r)),o=0,c=v.length;o<c;o++)if((m=(u=v[o]).name)&&!u.disabled)if(e&&p.clk&&"image"===u.type)p.clk===u&&(a.push({name:m,value:q(u).val(),type:u.type}),a.push({name:m+".x",value:p.clk_x},{name:m+".y",value:p.clk_y}));else if((s=q.fieldValue(u,!0))&&s.constructor===Array)for(t&&t.push(u),i=0,l=s.length;i<l;i++)a.push({name:m,value:s[i]});else if(S.fileapi&&"file"===u.type){t&&t.push(u);var g=u.files;if(g.length)for(i=0;i<g.length;i++)a.push({name:m,value:g[i],type:u.type});else a.push({name:m,value:"",type:u.type})}else null!=s&&(t&&t.push(u),a.push({name:m,value:s,type:u.type,required:u.required}));return e||!p.clk||(m=(d=(f=q(p.clk))[0]).name)&&!d.disabled&&"image"===d.type&&(a.push({name:m,value:f.val()}),a.push({name:m+".x",value:p.clk_x},{name:m+".y",value:p.clk_y})),a},q.fn.formSerialize=function(e){return q.param(this.formToArray(e))},q.fn.fieldSerialize=function(n){var o=[];return this.each(function(){var e=this.name;if(e){var t=q.fieldValue(this,n);if(t&&t.constructor===Array)for(var r=0,a=t.length;r<a;r++)o.push({name:e,value:t[r]});else null!=t&&o.push({name:this.name,value:t})}}),q.param(o)},q.fn.fieldValue=function(e){for(var t=[],r=0,a=this.length;r<a;r++){var n=this[r],o=q.fieldValue(n,e);null==o||o.constructor===Array&&!o.length||(o.constructor===Array?q.merge(t,o):t.push(o))}return t},q.fieldValue=function(e,t){var r=e.name,a=e.type,n=e.tagName.toLowerCase();if(void 0===t&&(t=!0),t&&(!r||e.disabled||"reset"===a||"button"===a||("checkbox"===a||"radio"===a)&&!e.checked||("submit"===a||"image"===a)&&e.form&&e.form.clk!==e||"select"===n&&-1===e.selectedIndex))return null;if("select"!==n)return q(e).val().replace(m,"\r\n");var o=e.selectedIndex;if(o<0)return null;for(var i=[],s=e.options,u="select-one"===a,c=u?o+1:s.length,l=u?o:0;l<c;l++){var f=s[l];if(f.selected&&!f.disabled){var d=(d=f.value)||(f.attributes&&f.attributes.value&&!f.attributes.value.specified?f.text:f.value);if(u)return d;i.push(d)}}return i},q.fn.clearForm=function(e){return this.each(function(){q("input,select,textarea",this).clearFields(e)})},q.fn.clearFields=q.fn.clearInputs=function(r){var a=/^(?:color|date|datetime|email|month|number|password|range|search|tel|text|time|url|week)$/i;return this.each(function(){var e=this.type,t=this.tagName.toLowerCase();a.test(e)||"textarea"===t?this.value="":"checkbox"===e||"radio"===e?this.checked=!1:"select"===t?this.selectedIndex=-1:"file"===e?/MSIE/.test(navigator.userAgent)?q(this).replaceWith(q(this).clone(!0)):q(this).val(""):r&&(!0===r&&/hidden/.test(e)||"string"==typeof r&&q(this).is(r))&&(this.value="")})},q.fn.resetForm=function(){return this.each(function(){var t=q(this),e=this.tagName.toLowerCase();switch(e){case"input":this.checked=this.defaultChecked;case"textarea":return this.value=this.defaultValue,!0;case"option":case"optgroup":var r=t.parents("select");return r.length&&r[0].multiple?"option"===e?this.selected=this.defaultSelected:t.find("option").resetForm():r.resetForm(),!0;case"select":return t.find("option").each(function(e){if(this.selected=this.defaultSelected,this.defaultSelected&&!t[0].multiple)return t[0].selectedIndex=e,!1}),!0;case"label":var a=q(t.attr("for")),n=t.find("input,select,textarea");return a[0]&&n.unshift(a[0]),n.resetForm(),!0;case"form":return"function"!=typeof this.reset&&("object"!=typeof this.reset||this.reset.nodeType)||this.reset(),!0;default:return t.find("form,input,label,select,textarea").resetForm(),!0}})},q.fn.enable=function(e){return void 0===e&&(e=!0),this.each(function(){this.disabled=!e})},q.fn.selected=function(r){return void 0===r&&(r=!0),this.each(function(){var e,t=this.t
2576ype;"checkbox"===t||"radio"===t?this.checked=r:"option"===this.tagName.toLowerCase()&&(e=q(this).parent("select"),r&&e[0]&&"select-one"===e[0].type&&e.find("option").selected(!1),this.selected=r)})},q.fn.ajaxSubmit.debug=!1}); 2577 2578; 2579/** 2580* DO NOT EDIT THIS FILE. 2581* See the following change record for more information, 2582* https://www.drupal.org/node/2815083 2583* @preserve 2584**/ 2585 2586(function ($, Drupal) { 2587 Drupal.theme.progressBar = function (id) { 2588 return "<div id=\"".concat(id, "\" class=\"progress\" aria-live=\"polite\">") + '<div class="progress__label"> </div>' + '<div class="progress__track"><div class="progress__bar"></div></div>' + '<div class="progress__percentage"></div>' + '<div class="progress__description"> </div>' + '</div>'; 2589 }; 2590 2591 Drupal.ProgressBar = function (id, updateCallback, method, errorCallback) { 2592 this.id = id; 2593 this.method = method || 'GET'; 2594 this.updateCallback = updateCallback; 2595 this.errorCallback = errorCallback; 2596 this.element = $(Drupal.theme('progressBar', id)); 2597 }; 2598 2599 $.extend(Drupal.ProgressBar.prototype, { 2600 setProgress: function setProgress(percentage, message, label) { 2601 if (percentage >= 0 && percentage <= 100) { 2602 $(this.element).find('div.progress__bar').css('width', "".concat(percentage, "%")); 2603 $(this.element).find('div.progress__percentage').html("".concat(percentage, "%")); 2604 } 2605 2606 $('div.progress__description', this.element).html(message); 2607 $('div.progress__label', this.element).html(label); 2608 2609 if (this.updateCallback) { 2610 this.updateCallback(percentage, message, this); 2611 } 2612 }, 2613 startMonitoring: function startMonitoring(uri, delay) { 2614 this.delay = delay; 2615 this.uri = uri; 2616 this.sendPing(); 2617 }, 2618 stopMonitoring: function stopMonitoring() { 2619 clearTimeout(this.timer); 2620 this.uri = null; 2621 }, 2622 sendPing: function sendPing() { 2623 if (this.timer) { 2624 clearTimeout(this.timer); 2625 } 2626 2627 if (this.uri) { 2628 var pb = this; 2629 var uri = this.uri; 2630 2631 if (uri.indexOf('?') === -1) { 2632 uri += '?'; 2633 } else { 2634 uri += '&'; 2635 } 2636 2637 uri += '_format=json'; 2638 $.ajax({ 2639 type: this.method, 2640 url: uri, 2641 data: '', 2642 dataType: 'json', 2643 success: function success(progress) { 2644 if (progress.status === 0) { 2645 pb.displayError(progress.data); 2646 return; 2647 } 2648 2649 pb.setProgress(progress.percentage, progress.message, progress.label); 2650 pb.timer = setTimeout(function () { 2651 pb.sendPing(); 2652 }, pb.delay); 2653 }, 2654 error: function error(xmlhttp) { 2655 var e = new Drupal.AjaxError(xmlhttp, pb.uri); 2656 pb.displayError("<pre>".concat(e.message, "</pre>")); 2657 } 2658 }); 2659 } 2660 }, 2661 displayError: function displayError(string) { 2662 var error = $('<div class="messages messages--error"></div>').html(string); 2663 $(this.element).before(error).hide(); 2664 2665 if (this.errorCallback) { 2666 this.errorCallback(this); 2667 } 2668 } 2669 }); 2670})(jQuery, Drupal);; 2671/** 2672 * @file 2673 * Extends methods from core/misc/progress.js. 2674 */ 2675 2676(function ($, Drupal) { 2677 2678 'use strict'; 2679 2680 /** 2681 * Theme function for the progress bar. 2682 * 2683 * @param {string} id 2684 * 2685 * @return {string} 2686 * The HTML for the progress bar. 2687 */ 2688 Drupal.theme.progressBar = function (id) { 2689 return '<div class="progress-wrapper" aria-live="polite">' + 2690 '<div class="message"></div>'+ 2691 '<div id ="' + id + '" class="progress progress-striped active">' + 2692 '<div class="progress-bar" role="progressbar" aria-valuemin="0" aria-valuemax="100" aria-valuenow="0">' + 2693 '<span class="percentage"></span>' + 2694 '</div>' + 2695 '</div>' + 2696 '<div class="progress-label"></div>' + 2697 '</div>'; 2698 }; 2699 2700 $.extend(Drupal.ProgressBar.prototype, /** @lends Drupal.ProgressBar */{ 2701 2702 /** 2703 * Set the percentage and status message for the progressbar. 2704 * 2705 * @param {number} percentage 2706 * @param {string} message 2707 * @param {string} label 2708 */ 2709 setProgress: function (percentage, message, label) { 2710 if (percentage >= 0 && percentage <= 100) {
2711 $(this.element).find('.progress-bar').css('width', percentage + '%').attr('aria-valuenow', percentage); 2712 $(this.element).find('.percentage').html(percentage + '%'); 2713 } 2714 if (message) { 2715 // Remove the unnecessary whitespace at the end of the message. 2716 message = message.replace(/<br\/> |\s*$/, ''); 2717 2718 $('.message', this.element).html(message); 2719 } 2720 if (label) { 2721 $('.progress-label', this.element).html(label); 2722 } 2723 if (this.updateCallback) { 2724 this.updateCallback(percentage, message, this); 2725 } 2726 }, 2727 2728 /** 2729 * Display errors on the page. 2730 * 2731 * @param {string} string 2732 */ 2733 displayError: function (string) { 2734 var error = $('<div class="alert alert-block alert-error"><button class="close" data-dismiss="alert">×</button><h4>' + Drupal.t('Error message') + '</h4></div>').append(string); 2735 $(this.element).before(error).hide(); 2736 2737 if (this.errorCallback) { 2738 this.errorCallback(this); 2739 } 2740 } 2741 }); 2742 2743})(jQuery, Drupal); 2744; 2745/** 2746* DO NOT EDIT THIS FILE. 2747* See the following change record for more information, 2748* https://www.drupal.org/node/2815083 2749* @preserve 2750**/ 2751 2752(function (Drupal) { 2753 Drupal.behaviors.responsiveImageAJAX = { 2754 attach: function attach() { 2755 if (window.picturefill) { 2756 window.picturefill(); 2757 } 2758 } 2759 }; 2760})(Drupal);; 2761/** 2762* DO NOT EDIT THIS FILE. 2763* See the following change record for more information, 2764* https://www.drupal.org/node/2815083 2765* @preserve 2766**/ 2767 2768function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } 2769 2770function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } 2771 2772function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } 2773 2774function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } 2775 2776function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } 2777 2778function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } 2779 2780(function ($, window, Drupal, drupalSettings, _ref) { 2781 var isFocusable = _ref.isFocusable, 2782 tabbable = _ref.tabbable; 2783 Drupal.behaviors.AJAX = { 2784 attach: function attach(context, settings) { 2785 function loadAjaxBehavior(base) { 2786 var elementSettings = settings.ajax[base]; 2787 2788 if (typeof elementSettings.selector === 'undefined') { 2789 elementSettings.selector = "#".concat(base); 2790 } 2791 2792 once('drupal-ajax', $(elementSettings.selector)).forEach(function (el) { 2793 elementSettings.element = el; 2794 elementSettings.base = base; 2795 Drupal.ajax(elementSettings); 2796 }); 2797 } 2798 2799 Object.keys(settings.ajax || {}).forEach(function (base) { 2800 return loadAjaxBehavior(base); 2801 }); 2802 Drupal.ajax.bindAjaxLinks(document.body); 2803 once('ajax', '.use-ajax-submit').forEach(function (el) { 2804 var elementSettings = {}; 2805 elementSettings.url = $(el.form).attr('action'); 2806 elementSettings.setClick = true; 2807 elementSettings.event = 'click'; 2808 elementSettings.progress = { 2809 type: 'throbber' 2810 }; 2811 elementSettings.base = el.id; 2812 elementSettings.element = el; 2813 Drupal.ajax(elementSettings); 2814 }); 2815 }, 2816 detach: function detach(context, settings, trigger) { 2817 if (trigger === 'unload') {
2818 Drupal.ajax.expired().forEach(function (instance) { 2819 Drupal.ajax.instances[instance.instanceIndex] = null; 2820 }); 2821 } 2822 } 2823 }; 2824 2825 Drupal.AjaxError = function (xmlhttp, uri, customMessage) { 2826 var statusCode; 2827 var statusText; 2828 var responseText; 2829 2830 if (xmlhttp.status) { 2831 statusCode = "\n".concat(Drupal.t('An AJAX HTTP error occurred.'), "\n").concat(Drupal.t('HTTP Result Code: !status', { 2832 '!status': xmlhttp.status 2833 })); 2834 } else { 2835 statusCode = "\n".concat(Drupal.t('An AJAX HTTP request terminated abnormally.')); 2836 } 2837 2838 statusCode += "\n".concat(Drupal.t('Debugging information follows.')); 2839 var pathText = "\n".concat(Drupal.t('Path: !uri', { 2840 '!uri': uri 2841 })); 2842 statusText = ''; 2843 2844 try { 2845 statusText = "\n".concat(Drupal.t('StatusText: !statusText', { 2846 '!statusText': xmlhttp.statusText.trim() 2847 })); 2848 } catch (e) {} 2849 2850 responseText = ''; 2851 2852 try { 2853 responseText = "\n".concat(Drupal.t('ResponseText: !responseText', { 2854 '!responseText': xmlhttp.responseText.trim() 2855 })); 2856 } catch (e) {} 2857 2858 responseText = responseText.replace(/<("[^"]*"|'[^']*'|[^'">])*>/gi, ''); 2859 responseText = responseText.replace(/[\n]+\s+/g, '\n'); 2860 var readyStateText = xmlhttp.status === 0 ? "\n".concat(Drupal.t('ReadyState: !readyState', { 2861 '!readyState': xmlhttp.readyState 2862 })) : ''; 2863 customMessage = customMessage ? "\n".concat(Drupal.t('CustomMessage: !customMessage', { 2864 '!customMessage': customMessage 2865 })) : ''; 2866 this.message = statusCode + pathText + statusText + customMessage + responseText + readyStateText; 2867 this.name = 'AjaxError'; 2868 }; 2869 2870 Drupal.AjaxError.prototype = new Error(); 2871 Drupal.AjaxError.prototype.constructor = Drupal.AjaxError; 2872 2873 Drupal.ajax = function (settings) { 2874 if (arguments.length !== 1) { 2875 throw new Error('Drupal.ajax() function must be called with one configuration object only'); 2876 } 2877 2878 var base = settings.base || false; 2879 var element = settings.element || false; 2880 delete settings.base; 2881 delete settings.element; 2882 2883 if (!settings.progress && !element) { 2884 settings.progress = false; 2885 } 2886 2887 var ajax = new Drupal.Ajax(base, element, settings); 2888 ajax.instanceIndex = Drupal.ajax.instances.length; 2889 Drupal.ajax.instances.push(ajax); 2890 return ajax; 2891 }; 2892 2893 Drupal.ajax.instances = []; 2894 2895 Drupal.ajax.expired = function () { 2896 return Drupal.ajax.instances.filter(function (instance) { 2897 return instance && instance.element !== false && !document.body.contains(instance.element); 2898 }); 2899 }; 2900 2901 Drupal.ajax.bindAjaxLinks = function (element) { 2902 once('ajax', '.use-ajax', element).forEach(function (ajaxLink) { 2903 var $linkElement = $(ajaxLink); 2904 var elementSettings = { 2905 progress: { 2906 type: 'throbber' 2907 }, 2908 dialogType: $linkElement.data('dialog-type'), 2909 dialog: $linkElement.data('dialog-options'), 2910 dialogRenderer: $linkElement.data('dialog-renderer'), 2911 base: $linkElement.attr('id'), 2912 element: ajaxLink 2913 }; 2914 var href = $linkElement.attr('href'); 2915 2916 if (href) { 2917 elementSettings.url = href; 2918 elementSettings.event = 'click'; 2919 } 2920 2921 Drupal.ajax(elementSettings); 2922 }); 2923 }; 2924 2925 Drupal.Ajax = function (base, element, elementSettings) { 2926 var defaults = { 2927 event: element ? 'mousedown' : null, 2928 keypress: true, 2929 selector: base ? "#".concat(base) : null, 2930 effect: 'none', 2931 speed: 'none', 2932 method: 'replaceWith', 2933 progress: { 2934 type: 'throbber', 2935 message: Drupal.t('Please wait...') 2936 }, 2937 submit: { 2938 js: true 2939 } 2940 }; 2941 $.extend(this, defaults, elementSettings); 2942 this.commands = new Drupal.AjaxCommands(); 2943 this.instanceIndex = false; 2944 2945 if (this.wrapper) { 2946 this.wrapper = "#".concat(this.wrapper); 2947 } 2948 2949 this.element = element; 2950 this.element_settings = elementSettings; 2951 this.elementSettings = elementSettings; 2952 2953 if (this.element && this.element.form) { 2954 this.$form = $(this.element.form); 2955 } 2956 2957 if (!this.url) { 2958 var $element = $(this.element); 2959 2960 if ($element.is('a')) { 2961 this.url = $element.attr('href'); 2962 } else if (this.element && element.form) { 2963 this.url = this.$form.attr('action'); 2964 } 2965 } 2966 2967 var originalUrl = this.url; 2968 this.url = this.url.replace(/\/nojs(\/|$|\?|#)/, '/ajax$1'); 2969 2970 if (drupalSettings.ajaxTrustedUrl[originalUrl]) { 2971 drupalSettings.ajaxTrustedUrl[this.url] = true; 2972 } 2973 2974 var ajax = this; 2975 ajax.options = { 2976 url: ajax.url, 2977 data: ajax.submit, 2978 beforeSerialize: function beforeSerialize(elementSettings, options) { 2979 return ajax.beforeSerialize(elementSettings, options); 2980 }, 2981 beforeSubmit: function beforeSubmit(formValues, elementSettings, options) { 2982 ajax.ajaxing = true; 2983 return ajax.beforeSubmit(formValues, elementSettings, options); 2984 }, 2985 beforeSend: function beforeSend(xmlhttprequest, options) { 2986 ajax.ajaxing = true; 2987 return ajax.beforeSend(xmlhttprequest, options); 2988 }, 2989 success: function success(response, status, xmlhttprequest) { 2990 if (typeof response === 'string') { 2991 response = $.parseJSON(response); 2992 } 2993 2994 if (response !== null && !drupalSettings.ajaxTrustedUrl[ajax.url]) { 2995 if (xmlhttprequest.getResponseHeader('X-Drupal-Ajax-Token') !== '1') { 2996 var customMessage = Drupal.t('The response failed verification so will not be processed.'); 2997 return ajax.error(xmlhttprequest, ajax.url, customMessage); 2998 } 2999 } 3000 3001 return ajax.success(response, status); 3002 }, 3003 complete: function complete(xmlhttprequest, status) { 3004 ajax.ajaxing = false;
3005 3006 if (status === 'error' || status === 'parsererror') { 3007 return ajax.error(xmlhttprequest, ajax.url); 3008 } 3009 }, 3010 dataType: 'json', 3011 jsonp: false, 3012 type: 'POST' 3013 }; 3014 3015 if (elementSettings.dialog) { 3016 ajax.options.data.dialogOptions = elementSettings.dialog; 3017 } 3018 3019 if (ajax.options.url.indexOf('?') === -1) { 3020 ajax.options.url += '?'; 3021 } else { 3022 ajax.options.url += '&'; 3023 } 3024 3025 var wrapper = "drupal_".concat(elementSettings.dialogType || 'ajax'); 3026 3027 if (elementSettings.dialogRenderer) { 3028 wrapper += ".".concat(elementSettings.dialogRenderer); 3029 } 3030 3031 ajax.options.url += "".concat(Drupal.ajax.WRAPPER_FORMAT, "=").concat(wrapper); 3032 $(ajax.element).on(elementSettings.event, function (event) { 3033 if (!drupalSettings.ajaxTrustedUrl[ajax.url] && !Drupal.url.isLocal(ajax.url)) { 3034 throw new Error(Drupal.t('The callback URL is not local and not trusted: !url', { 3035 '!url': ajax.url 3036 })); 3037 } 3038 3039 return ajax.eventResponse(this, event); 3040 }); 3041 3042 if (elementSettings.keypress) { 3043 $(ajax.element).on('keypress', function (event) { 3044 return ajax.keypressResponse(this, event); 3045 }); 3046 } 3047 3048 if (elementSettings.prevent) { 3049 $(ajax.element).on(elementSettings.prevent, false); 3050 } 3051 }; 3052 3053 Drupal.ajax.WRAPPER_FORMAT = '_wrapper_format'; 3054 Drupal.Ajax.AJAX_REQUEST_PARAMETER = '_drupal_ajax'; 3055 3056 Drupal.Ajax.prototype.execute = function () { 3057 if (this.ajaxing) { 3058 return; 3059 } 3060 3061 try { 3062 this.beforeSerialize(this.element, this.options); 3063 return $.ajax(this.options); 3064 } catch (e) { 3065 this.ajaxing = false; 3066 window.alert("An error occurred while attempting to process ".concat(this.options.url, ": ").concat(e.message)); 3067 return $.Deferred().reject(); 3068 } 3069 }; 3070 3071 Drupal.Ajax.prototype.keypressResponse = function (element, event) { 3072 var ajax = this; 3073 3074 if (event.which === 13 || event.which === 32 && element.type !== 'text' && element.type !== 'textarea' && element.type !== 'tel' && element.type !== 'number') { 3075 event.preventDefault(); 3076 event.stopPropagation(); 3077 $(element).trigger(ajax.elementSettings.event); 3078 } 3079 }; 3080 3081 Drupal.Ajax.prototype.eventResponse = function (element, event) { 3082 event.preventDefault(); 3083 event.stopPropagation(); 3084 var ajax = this; 3085 3086 if (ajax.ajaxing) { 3087 return; 3088 } 3089 3090 try { 3091 if (ajax.$form) { 3092 if (ajax.setClick) { 3093 element.form.clk = element; 3094 } 3095 3096 ajax.$form.ajaxSubmit(ajax.options); 3097 } else { 3098 ajax.beforeSerialize(ajax.element, ajax.options); 3099 $.ajax(ajax.options); 3100 } 3101 } catch (e) { 3102 ajax.ajaxing = false; 3103 window.alert("An error occurred while attempting to process ".concat(ajax.options.url, ": ").concat(e.message)); 3104 } 3105 }; 3106 3107 Drupal.Ajax.prototype.beforeSerialize = function (element, options) { 3108 if (this.$form && document.body.contains(this.$form.get(0))) { 3109 var settings = this.settings || drupalSettings; 3110 Drupal.detachBehaviors(this.$form.get(0), settings, 'serialize'); 3111 } 3112 3113 options.data[Drupal.Ajax.AJAX_REQUEST_PARAMETER] = 1; 3114 var pageState = drupalSettings.ajaxPageState; 3115 options.data['ajax_page_state[theme]'] = pageState.theme; 3116 options.data['ajax_page_state[theme_token]'] = pageState.theme_token; 3117 options.data['ajax_page_state[libraries]'] = pageState.libraries; 3118 }; 3119 3120 Drupal.Ajax.prototype.beforeSubmit = function (formValues, element, options) {}; 3121 3122 Drupal.Ajax.prototype.beforeSend = function (xmlhttprequest, options) { 3123 if (this.$form) { 3124 options.extraData = options.extraData || {}; 3125 options.extraData.ajax_iframe_upload = '1'; 3126 var v = $.fieldValue(this.element); 3127 3128 if (v !== null) { 3129 options.extraData[this.element.name] = v; 3130 } 3131 } 3132 3133 $(this.element).prop('disabled', true); 3134 3135 if (!this.progress || !this.progress.type) { 3136 return; 3137 } 3138 3139 var progressIndicatorMethod = "setProgressIndicator".concat(this.progress.type.slice(0, 1).toUpperCase()).concat(this.progress.type.slice(1).toLowerCase()); 3140 3141 if (progressIndicatorMethod in this && typeof this[progressIndicatorMethod] === 'function') { 3142 this[progressIndicatorMethod].call(this); 3143 } 3144 }; 3145 3146 Drupal.theme.ajaxProgressThrobber = function (message) { 3147 var messageMarkup = typeof message === 'string' ? Drupal.theme('ajaxProgressMessage', message) : ''; 3148 var throbber = '<div class="throbber"> </div>'; 3149 return "<div class=\"ajax-progress ajax-progress-throbber\">".concat(throbber).concat(messageMarkup, "</div>"); 3150 }; 3151 3152 Drupal.theme.ajaxProgressIndicatorFullscreen = function () { 3153 return '<div class="ajax-progress ajax-progress-fullscreen"> </div>'; 3154 }; 3155 3156 Drupal.theme.ajaxProgressMessage = function (message) { 3157 return "<div class=\"message\">".concat(message, "</div>"); 3158 }; 3159 3160 Drupal.theme.ajaxProgressBar = function ($element) { 3161 return $('<div class="ajax-progress ajax-progress-bar"></div>').append($element); 3162 }; 3163 3164 Drupal.Ajax.prototype.setProgressIndicatorBar = function () { 3165 var progressBar = new Drupal.ProgressBar("ajax-progress-".concat(this.element.i
3165d), $.noop, this.progress.method, $.noop); 3166 3167 if (this.progress.message) { 3168 progressBar.setProgress(-1, this.progress.message); 3169 } 3170 3171 if (this.progress.url) { 3172 progressBar.startMonitoring(this.progress.url, this.progress.interval || 1500); 3173 } 3174 3175 this.progress.element = $(Drupal.theme('ajaxProgressBar', progressBar.element)); 3176 this.progress.object = progressBar; 3177 $(this.element).after(this.progress.element); 3178 }; 3179 3180 Drupal.Ajax.prototype.setProgressIndicatorThrobber = function () { 3181 this.progress.element = $(Drupal.theme('ajaxProgressThrobber', this.progress.message)); 3182 $(this.element).after(this.progress.element); 3183 }; 3184 3185 Drupal.Ajax.prototype.setProgressIndicatorFullscreen = function () { 3186 this.progress.element = $(Drupal.theme('ajaxProgressIndicatorFullscreen')); 3187 $('body').append(this.progress.element); 3188 }; 3189 3190 Drupal.Ajax.prototype.success = function (response, status) { 3191 var _this = this; 3192 3193 if (this.progress.element) { 3194 $(this.progress.element).remove(); 3195 } 3196 3197 if (this.progress.object) { 3198 this.progress.object.stopMonitoring(); 3199 } 3200 3201 $(this.element).prop('disabled', false); 3202 var elementParents = $(this.element).parents('[data-drupal-selector]').addBack().toArray(); 3203 var focusChanged = false; 3204 Object.keys(response || {}).forEach(function (i) { 3205 if (response[i].command && _this.commands[response[i].command]) { 3206 _this.commands[response[i].command](_this, response[i], status); 3207 3208 if (response[i].command === 'invoke' && response[i].method === 'focus' || response[i].command === 'focusFirst') { 3209 focusChanged = true; 3210 } 3211 } 3212 }); 3213 3214 if (!focusChanged && this.element && !$(this.element).data('disable-refocus')) { 3215 var target = false;
3216 3217 for (var n = elementParents.length - 1; !target && n >= 0; n--) { 3218 target = document.querySelector("[data-drupal-selector=\"".concat(elementParents[n].getAttribute('data-drupal-selector'), "\"]")); 3219 } 3220 3221 if (target) { 3222 $(target).trigger('focus'); 3223 } 3224 } 3225 3226 if (this.$form && document.body.contains(this.$form.get(0))) { 3227 var settings = this.settings || drupalSettings; 3228 Drupal.attachBehaviors(this.$form.get(0), settings); 3229 } 3230 3231 this.settings = null; 3232 }; 3233 3234 Drupal.Ajax.prototype.getEffect = function (response) { 3235 var type = response.effect || this.effect; 3236 var speed = response.speed || this.speed; 3237 var effect = {}; 3238 3239 if (type === 'none') { 3240 effect.showEffect = 'show'; 3241 effect.hideEffect = 'hide'; 3242 effect.showSpeed = ''; 3243 } else if (type === 'fade') { 3244 effect.showEffect = 'fadeIn'; 3245 effect.hideEffect = 'fadeOut'; 3246 effect.showSpeed = speed; 3247 } else { 3248 effect.showEffect = "".concat(type, "Toggle"); 3249 effect.hideEffect = "".concat(type, "Toggle"); 3250 effect.showSpeed = speed; 3251 } 3252 3253 return effect; 3254 }; 3255 3256 Drupal.Ajax.prototype.error = function (xmlhttprequest, uri, customMessage) { 3257 if (this.progress.element) { 3258 $(this.progress.element).remove(); 3259 } 3260 3261 if (this.progress.object) { 3262 this.progress.object.stopMonitoring(); 3263 } 3264 3265 $(this.wrapper).show(); 3266 $(this.element).prop('disabled', false); 3267 3268 if (this.$form && document.body.contains(this.$form.get(0))) { 3269 var settings = this.settings || drupalSettings; 3270 Drupal.attachBehaviors(this.$form.get(0), settings); 3271 } 3272 3273 throw new Drupal.AjaxError(xmlhttprequest, uri, customMessage); 3274 }; 3275 3276 Drupal.theme.ajaxWrapperNewContent = function ($newContent, ajax, response) { 3277 return (response.effect || ajax.effect) !== 'none' && $newContent.filter(function (i) { 3278 return !($newContent[i].nodeName === '#comment' || $newContent[i].nodeName === '#text' && /^(\s|\n|\r)*$/.test($newContent[i].textContent)); 3279 }).length > 1 ? Drupal.theme('ajaxWrapperMultipleRootElements', $newContent) : $newContent; 3280 }; 3281 3282 Drupal.theme.ajaxWrapperMultipleRootElements = function ($elements) { 3283 return $('<div></div>').append($elements); 3284 }; 3285 3286 Drupal.AjaxCommands = function () {}; 3287 3288 Drupal.AjaxCommands.prototype = { 3289 insert: function insert(ajax, response) { 3290 var $wrapper = response.selector ? $(response.selector) : $(ajax.wrapper); 3291 var method = response.method || ajax.method; 3292 var effect = ajax.getEffect(response); 3293 var settings = response.settings || ajax.settings || drupalSettings; 3294 var $newContent = $($.parseHTML(response.data, document, true)); 3295 $newContent = Drupal.theme('ajaxWrapperNewContent', $newContent, ajax, response); 3296 3297 switch (method) { 3298 case 'html': 3299 case 'replaceWith': 3300 case 'replaceAll': 3301 case 'empty': 3302 case 'remove': 3303 Drupal.detachBehaviors($wrapper.get(0), settings); 3304 break; 3305 3306 default: 3307 break; 3308 } 3309 3310 $wrapper[method]($newContent); 3311 3312 if (effect.showEffect !== 'show') { 3313 $newContent.hide(); 3314 } 3315 3316 var $ajaxNewContent = $newContent.find('.ajax-new-content'); 3317 3318 if ($ajaxNewContent.length) { 3319 $ajaxNewContent.hide(); 3320 $newContent.show(); 3321 $ajaxNewContent[effect.showEffect](effect.showSpeed); 3322 } else if (effect.showEffect !== 'show') { 3323 $newContent[effect.showEffect](effect.showSpeed); 3324 } 3325 3326 if ($newContent.parents('html').length) { 3327 $newContent.each(function (index, element) { 3328 if (element.nodeType === Node.ELEMENT_NODE) { 3329 Drupal.attachBehaviors(element, settings); 3330 } 3331 }); 3332 } 3333 }, 3334 remove: function remove(ajax, response, status) { 3335 var settings = response.settings || ajax.settings || drupalSettings; 3336 $(response.selector).each(function () { 3337 Drupal.detachBehaviors(this, settings); 3338 }).remove(); 3339 }, 3340 changed: function changed(ajax, response, status) { 3341 var $element = $(response.selector); 3342 3343 if (!$element.hasClass('ajax-changed')) { 3344 $element.addClass('ajax-changed'); 3345 3346 if (response.asterisk) { 3347 $element.find(response.asterisk).append(" <abbr class=\"ajax-changed\" title=\"".concat(Drupal.t('Changed'), "\">*</abbr> ")); 3348 } 3349 } 3350 }, 3351 alert: function alert(ajax, response, status) { 3352 window.alert(response.text); 3353 }, 3354 announce: function announce(ajax, response) { 3355 if (response.priority) { 3356 Drupal.announce(response.text, response.priority); 3357 } else { 3358 Drupal.announce(response.text); 3359 } 3360 }, 3361 redirect: function redirect(ajax, response, status) { 3362 window.location = response.url; 3363 }, 3364 css: function css(ajax, response, status) { 3365 $(response.selector).css(response.argument); 3366 }, 3367 settings: function settings(ajax, response, status) { 3368 var ajaxSettings = drupalSettings.ajax; 3369 3370 if (ajaxSettings) {
3371 Drupal.ajax.expired().forEach(function (instance) { 3372 if (instance.selector) { 3373 var selector = instance.selector.replace('#', ''); 3374 3375 if (selector in ajaxSettings) { 3376 delete ajaxSettings[selector]; 3377 } 3378 } 3379 }); 3380 } 3381 3382 if (response.merge) { 3383 $.extend(true, drupalSettings, response.settings); 3384 } else { 3385 ajax.settings = response.settings; 3386 } 3387 }, 3388 data: function data(ajax, response, status) { 3389 $(response.selector).data(response.name, response.value); 3390 }, 3391 focusFirst: function focusFirst(ajax, response, status) { 3392 var focusChanged = false; 3393 var container = document.querySelector(response.selector); 3394 3395 if (container) { 3396 var tabbableElements = tabbable(container); 3397 3398 if (tabbableElements.length) { 3399 tabbableElements[0].focus(); 3400 focusChanged = true; 3401 } else if (isFocusable(container)) { 3402 container.focus(); 3403 focusChanged = true; 3404 } 3405 } 3406 3407 if (ajax.hasOwnProperty('element') && !focusChanged) { 3408 ajax.element.focus(); 3409 } 3410 }, 3411 invoke: function invoke(ajax, response, status) { 3412 var $element = $(response.selector); 3413 $element[response.method].apply($element, _toConsumableArray(response.args)); 3414 }, 3415 restripe: function restripe(ajax, response, status) { 3416 $(response.selector).find('> tbody > tr:visible, > tr:visible').removeClass('odd even').filter(':even').addClass('odd').end().filter(':odd').addClass('even'); 3417 }, 3418 update_build_id: function update_build_id(ajax, response, status) { 3419 document.querySelectorAll("input[name=\"form_build_id\"][value=\"".concat(response.old, "\"]")).forEach(function (item) { 3420 item.value = response.new; 3421 }); 3422 }, 3423 add_css: function add_css(ajax, response, status) { 3424 $('head').prepend(response.data); 3425 }, 3426 message: function message(ajax, response) { 3427 var messages = new Drupal.Message(document.querySelector(response.messageWrapperQuerySelector)); 3428 3429 if (response.clearPrevious) { 3430 messages.clear(); 3431 } 3432 3433 messages.add(response.message, response.messageOptions); 3434 } 3435 }; 3436})(jQuery, window, Drupal, drupalSettings, window.tabbable);; 3437/** 3438 * @file 3439 * Extends methods from core/misc/ajax.js. 3440 */ 3441 3442(function ($, window, Drupal, drupalSettings) { 3443 3444 /** 3445 * Attempts to find the closest glyphicon progress indicator. 3446 * 3447 * @param {jQuery|Element} element 3448 * A DOM element. 3449 * 3450 * @returns {jQuery} 3451 * A jQuery object. 3452 */ 3453 Drupal.Ajax.prototype.findGlyphicon = function (element) { 3454 return $(element).closest('.form-item').find('.ajax-progress.glyphicon') 3455 }; 3456 3457 /** 3458 * Starts the spinning of the glyphicon progress indicator. 3459 * 3460 * @param {jQuery|Element} element 3461 * A DOM element. 3462 * @param {string} [message] 3463 * An optional message to display (tooltip) for the progress. 3464 * 3465 * @returns {jQuery} 3466 * A jQuery object. 3467 */ 3468 Drupal.Ajax.prototype.glyphiconStart = function (element, message) { 3469 var $glyphicon = this.findGlyphicon(element); 3470 if ($glyphicon[0]) { 3471 $glyphicon.addClass('glyphicon-spin'); 3472 3473 // Add any message as a tooltip to the glyphicon. 3474 if ($.fn.tooltip && drupalSettings.bootstrap.tooltip_enabled) { 3475 $glyphicon 3476 .removeAttr('data-toggle') 3477 .removeAttr('data-original-title') 3478 .removeAttr('title') 3479 .tooltip('destroy') 3480 ; 3481 3482 if (message) { 3483 $glyphicon.attr('data-toggle', 'tooltip').attr('title', message).tooltip(); 3484 } 3485 } 3486 3487 // Append a message for screen readers. 3488 if (message) { 3489 $glyphicon.parent().append('<div class="sr-only message">' + message + '</div>'); 3490 } 3491 } 3492 return $glyphicon; 3493 }; 3494 3495 /** 3496 * Stop the spinning of a glyphicon progress indicator. 3497 * 3498 * @param {jQuery|Element} element 3499 * A DOM element. 3500 */ 3501 Drupal.Ajax.prototype.glyphiconStop = function (element) { 3502 var $glyphicon = this.findGlyphicon(element); 3503 if ($glyphicon[0]) { 3504 $glyphicon.removeClass('glyphicon-spin'); 3505 if ($.fn.tooltip && drupalSettings.bootstrap.tooltip_enabled) { 3506 $glyphicon 3507 .removeAttr('data-toggle') 3508 .removeAttr('data-original-title') 3509 .removeAttr('title') 3510 .tooltip('destroy') 3511 ; 3512 } 3513 } 3514 }; 3515 3516 /** 3517 * Sets the throbber progress indicator. 3518 */ 3519 Drupal.Ajax.prototype.setProgressIndicatorThrobber = function () { 3520 var $element = $(this.element); 3521 3522 // Find an existing glyphicon progress indicator. 3523 var $glyphicon = this.glyphiconStart($element, this.progress.message); 3524 if ($glyphicon[0]) { 3525 this.progress.element = $glyphicon.parent(); 3526 this.progress.glyphicon = true; 3527 return; 3528 } 3529 3530 // Otherwise, add a glyphicon throbber after the element. 3531 if (!this.progress.element) { 3532 this.progress.element = $(Drupal.theme('ajaxThrobber')); 3533 } 3534 if (this.progress.message) { 3535 this.progress.element.after('<div class="message">' + this.progress.message + '</div>'); 3536 } 3537 3538 // If element is an input DOM element type (not :input), append after. 3539 if ($element.is('input')) { 3540 $element.after(this.progress.element); 3541 } 3542 // Otherwise append the throbber inside the element. 3543 else { 3544 $element.append(this.progress.element); 3545 } 3546 }; 3547 3548 3549 /** 3550 * Handler for the form redirection completion. 3551 * 3552 * @param {Array.<Drupal.AjaxCommands~commandDefinition>} response 3553 * @param {number} status 3554 */ 3555 var success = Drupal.Ajax.prototype.success; 3556 Drupal.Ajax.prototype.success = function (response, status) { 3557 if (this.progress.element) { 3558 3559 // Stop a glyphicon throbber. 3560 if (this.progress.glyphicon) { 3561 this.glyphiconStop(this.progress.element); 3562 } 3563 // Remove the progress element. 3564 else { 3565 this.progress.element.remove(); 3566 } 3567 3568 // Remove any message set. 3569 this.progress.element.parent().find('.message').remove(); 3570 } 3571 3572 // Invoke the original success handler. 3573 return success.apply(this, [response, status]); 3574 }; 3575 3576})(jQuery, this, Drupal, drupalSettings); 3577; 3578/** 3579* DO NOT EDIT THIS FILE. 3580* See the following change record for more information, 3581* https://www.drupal.org/node/2815083 3582* @preserve 3583**/ 3584 3585(function ($, Drupal, drupalSettings) { 3586 Drupal.Views = {}; 3587 3588 Drupal.Views.parseQueryString = function (query) { 3589 var args = {}; 3590 var pos = query.indexOf('?'); 3591 3592 if (pos !== -1) { 3593 query = query.substring(pos + 1); 3594 } 3595 3596 var pair; 3597 var pairs = query.split('&'); 3598 3599 for (var i = 0; i < pairs.length; i++) { 3600 pair = pairs[i].split('='); 3601 3602 if (pair[0] !== 'q' && pair[1]) { 3603 args[decodeURIComponent(pair[0].replace(/\+/g, ' '))] = decodeURIComponent(pair[1].replace(/\+/g, ' ')); 3604 } 3605 } 3606 3607 return args; 3608 }; 3609 3610 Drupal.Views.parseViewArgs = function (href, viewPath) { 3611 var returnObj = {}; 3612 var path = Drupal.Views.getPath(href); 3613 var viewHref = Drupal.url(viewPath).substring(drupalSettings.path.baseUrl.length); 3614 3615 if (viewHref && path.substring(0, viewHref.length + 1) === "".concat(viewHref, "/")) { 3616 returnObj.view_args = decodeURIComponent(path.substring(viewHref.length + 1, path.length)); 3617 returnObj.view_path = path; 3618 } 3619 3620 return returnObj; 3621 }; 3622 3623 Drupal.Views.pathPortion = function (href) { 3624 var protocol = window.location.protocol; 3625 3626 if (href.substring(0, protocol.length) === protocol) { 3627 href = href.substring(href.indexOf('/', protocol.length + 2)); 3628 } 3629 3630 return href; 3631 }; 3632 3633 Drupal.Views.getPath = function (href) { 3634 href = Drupal.Views.pathPortion(href); 3635 href = href.substring(drupalSettings.path.baseUrl.length, href.length); 3636 3637 if (href.substring(0, 3) === '?q=') { 3638 href = href.substring(3, href.length); 3639 } 3640 3641 var chars = ['#', '?', '&']; 3642 3643 for (var i = 0; i < chars.length; i++) { 3644 if (href.indexOf(chars[i]) > -1) { 3645 href = href.substr(0, href.indexOf(chars[i])); 3646 } 3647 } 3648 3649 return href; 3650 }; 3651})(jQuery, Drupal, drupalSettings);;
3652/** 3653* DO NOT EDIT THIS FILE. 3654* See the following change record for more information, 3655* https://www.drupal.org/node/2815083 3656* @preserve 3657**/ 3658 3659(function ($, Drupal, drupalSettings) { 3660 Drupal.behaviors.ViewsAjaxView = {}; 3661 3662 Drupal.behaviors.ViewsAjaxView.attach = function (context, settings) { 3663 if (settings && settings.views && settings.views.ajaxViews) { 3664 var ajaxViews = settings.views.ajaxViews; 3665 Object.keys(ajaxViews || {}).forEach(function (i) { 3666 Drupal.views.instances[i] = new Drupal.views.ajaxView(ajaxViews[i]); 3667 }); 3668 } 3669 }; 3670 3671 Drupal.behaviors.ViewsAjaxView.detach = function (context, settings, trigger) { 3672 if (trigger === 'unload') { 3673 if (settings && settings.views && settings.views.ajaxViews) { 3674 var ajaxViews = settings.views.ajaxViews; 3675 Object.keys(ajaxViews || {}).forEach(function (i) { 3676 var selector = ".js-view-dom-id-".concat(ajaxViews[i].view_dom_id); 3677 3678 if ($(selector, context).length) { 3679 delete Drupal.views.instances[i]; 3680 delete settings.views.ajaxViews[i]; 3681 } 3682 }); 3683 } 3684 } 3685 }; 3686 3687 Drupal.views = {}; 3688 Drupal.views.instances = {}; 3689 3690 Drupal.views.ajaxView = function (settings) { 3691 var selector = ".js-view-dom-id-".concat(settings.view_dom_id); 3692 this.$view = $(selector); 3693 var ajaxPath = drupalSettings.views.ajax_path; 3694 3695 if (ajaxPath.constructor.toString().indexOf('Array') !== -1) { 3696 ajaxPath = ajaxPath[0]; 3697 } 3698 3699 var queryString = window.location.search || ''; 3700 3701 if (queryString !== '') { 3702 queryString = queryString.slice(1).replace(/q=[^&]+&?|&?render=[^&]+/, ''); 3703 3704 if (queryString !== '') { 3705 queryString = (/\?/.test(ajaxPath) ? '&' : '?') + queryString; 3706 } 3707 } 3708 3709 this.element_settings = { 3710 url: ajaxPath + queryString, 3711 submit: settings, 3712 setClick: true, 3713 event: 'click', 3714 selector: selector, 3715 progress: { 3716 type: 'fullscreen' 3717 } 3718 }; 3719 this.settings = settings; 3720 this.$exposed_form = $("form#views-exposed-form-".concat(settings.view_name.replace(/_/g, '-'), "-").concat(settings.view_display_id.replace(/_/g, '-'))); 3721 once('exposed-form', this.$exposed_form).forEach($.proxy(this.attachExposedFormAjax, this)); 3722 once('ajax-pager', this.$view.filter($.proxy(this.filterNestedViews, this))).forEach($.proxy(this.attachPagerAjax, this)); 3723 var selfSettings = $.extend({}, this.element_settings, { 3724 event: 'RefreshView', 3725 base: this.selector, 3726 element: this.$view.get(0) 3727 }); 3728 this.refreshViewAjax = Drupal.ajax(selfSettings); 3729 }; 3730 3731 Drupal.views.ajaxView.prototype.attachExposedFormAjax = function () { 3732 var that = this; 3733 this.exposedFormAjax = []; 3734 $('input[type=submit], button[type=submit], input[type=image]', this.$exposed_form).not('[data-drupal-selector=edit-reset]').each(function (index) { 3735 var selfSettings = $.extend({}, that.element_settings, { 3736 base: $(this).attr('id'), 3737 element: this 3738 }); 3739 that.exposedFormAjax[index] = Drupal.ajax(selfSettings); 3740 }); 3741 }; 3742 3743 Drupal.views.ajaxView.prototype.filterNestedViews = function () { 3744 return !this.$view.parents('.view').length; 3745 }; 3746 3747 Drupal.views.ajaxView.prototype.attachPagerAjax = function () { 3748 this.$view.find('ul.js-pager__items > li > a, th.views-field a, .attachment .views-summary a').each($.proxy(this.attachPagerLinkAjax, this)); 3749 }; 3750 3751 Drupal.views.ajaxView.prototype.attachPagerLinkAjax = function (id, link) { 3752 var $link = $(link); 3753 var viewData = {}; 3754 var href = $link.attr('href'); 3755 $.extend(viewData, this.settings, Drupal.Views.parseQueryString(href), Drupal.Views.parseViewArgs(href, this.settings.view_base_path)); 3756 var selfSettings = $.extend({}, this.element_settings, {
3757 submit: viewData, 3758 base: false, 3759 element: link 3760 }); 3761 this.pagerAjax = Drupal.ajax(selfSettings); 3762 }; 3763 3764 Drupal.AjaxCommands.prototype.viewsScrollTop = function (ajax, response) { 3765 var offset = $(response.selector).offset(); 3766 var scrollTarget = response.selector; 3767 3768 while ($(scrollTarget).scrollTop() === 0 && $(scrollTarget).parent()) { 3769 scrollTarget = $(scrollTarget).parent(); 3770 } 3771 3772 if (offset.top - 10 < $(scrollTarget).scrollTop()) { 3773 $(scrollTarget).animate({ 3774 scrollTop: offset.top - 10 3775 }, 500); 3776 } 3777 }; 3778})(jQuery, Drupal, drupalSettings);; 3779/** 3780 * @file 3781 * Extends core ajax_view.js. 3782 */ 3783 3784(function ($, Drupal) { 3785 'use strict'; 3786 3787 /** 3788 * @method 3789 */ 3790 Drupal.views.ajaxView.prototype.attachExposedFormAjax = function () { 3791 var that = this; 3792 this.exposedFormAjax = []; 3793 $('button[type=submit], input[type=submit], input[type=image]', this.$exposed_form).not('[data-drupal-selector=edit-reset]').each(function (index) { 3794 var self_settings = $.extend({}, that.element_settings, { 3795 base: $(this).attr('id'), 3796 element: this 3797 }); 3798 that.exposedFormAjax[index] = Drupal.ajax(self_settings); 3799 }); 3800 }; 3801 3802})(jQuery, Drupal); 3803; 3804/* 3805 * Superfish v1.4.8 - jQuery menu widget 3806 * Copyright (c) 2008 Joel Birch 3807 * 3808 * Dual licensed under the MIT and GPL licenses: 3809 * http://www.opensource.org/licenses/mit-license.php 3810 * http://www.gnu.org/licenses/gpl.html 3811 * 3812 * CHANGELOG: http://users.tpg.com.au/j_birch/plugins/superfish/changelog.txt 3813 */ 3814/* 3815 * This is not the original jQuery Superfish plugin. 3816 * Please refer to the README for more information. 3817 */ 3818 3819(function($){ 3820 $.fn.superfish = function(op){ 3821 var sf = $.fn.superfish, 3822 c = sf.c, 3823 $arrow = $(['<span class="',c.arrowClass,'"> »</span>'].join('')), 3824 over = function(){ 3825 var $$ = $(this), menu = getMenu($$); 3826 clearTimeout(menu.sfTimer); 3827 $$.showSuperfishUl().siblings().hideSuperfishUl(); 3828 }, 3829 out = function(){ 3830 var $$ = $(this), menu = getMenu($$), o = sf.op; 3831 clearTimeout(menu.sfTimer); 3832 menu.sfTimer=setTimeout(function(){ 3833 if ($$.children('.sf-clicked').length == 0){ 3834 o.retainPath=($.inArray($$[0],o.$path)>-1); 3835 $$.hideSuperfishUl(); 3836 if (o.$path.length && $$.parents(['li.',o.hoverClass].join('')).length<1){over.call(o.$path);} 3837 } 3838 },o.delay); 3839 }, 3840 getMenu = function($menu){ 3841 var menu = $menu.parents(['ul.',c.menuClass,':first'].join(''))[0]; 3842 sf.op = sf.o[menu.serial]; 3843 return menu; 3844 }, 3845 addArrow = function($a){ $a.addClass(c.anchorClass).append($arrow.clone()); }; 3846 3847 return this.each(function() { 3848 var s = this.serial = sf.o.length; 3849 var o = $.extend({},sf.defaults,op); 3850 o.$path = $('li.'+o.pathClass,this).slice(0,o.pathLevels), 3851 p = o.$path; 3852 for (var l = 0; l < p.length; l++){ 3853 p.eq(l).addClass([o.hoverClass,c.bcClass].join(' ')).filter('li:has(ul)').removeClass(o.pathClass); 3854 } 3855 sf.o[s] = sf.op = o; 3856 3857 $('li:has(ul)',this)[($.fn.hoverIntent && !o.disableHI) ? 'hoverIntent' : 'hover'](over,out).each(function() { 3858 if (o.autoArrows) addArrow( $(this).children('a:first-child, span.nolink:first-child') ); 3859 }) 3860 .not('.'+c.bcClass) 3861 .hideSuperfishUl(); 3862 3863 var $a = $('a, span.nolink',this); 3864 $a.each(function(i){ 3865 var $li = $a.eq(i).parents('li'); 3866 $a.eq(i).focus(function(){over.call($li);}).blur(function(){out.call($li);}); 3867 }); 3868 o.onInit.call(this); 3869 3870 }).each(function() { 3871 var menuClasses = [c.menuClass]; 3872 if (sf.op.dropShadows){ 3873 menuClasses.push(c.shadowClass); 3874 } 3875 $(this).addClass(menuClasses.join(' ')); 3876 }); 3877 }; 3878 3879 var sf = $.fn.superfish; 3880 sf.o = []; 3881 sf.op = {}; 3882 3883 sf.c = { 3884 bcClass: 'sf-breadcrumb', 3885 menuClass: 'sf-js-enabled', 3886 anchorClass: 'sf-with-ul', 3887 arrowClass: 'sf-sub-indicator', 3888 shadowClass: 'sf-shadow' 3889 }; 3890 sf.defaults = { 3891 hoverClass: 'sfHover', 3892 pathClass: 'overideThisToUse', 3893 pathLevels: 1, 3894 delay: 800, 3895 animation: {opacity:'show'}, 3896 speed: 'fast', 3897 autoArrows: true, 3898 dropShadows: true, 3899 disableHI: false, // true disables hoverIntent detection 3900 onInit: function(){}, // callback functions 3901 onBeforeShow: function(){}, 3902 onShow: function(){}, 3903 onHide: function(){} 3904 }; 3905 $.fn.extend({ 3906 hideSuperfishUl : function(){ 3907 var o = sf.op, 3908 not = (o.retainPath===true) ? o.$path : ''; 3909 o.retainPath = false;
3910 var $ul = $(['li.',o.hoverClass].join(''),this).add(this).not(not).removeClass(o.hoverClass) 3911 .children('ul').addClass('sf-hidden'); 3912 o.onHide.call($ul); 3913 return this; 3914 }, 3915 showSuperfishUl : function(){ 3916 var o = sf.op, 3917 sh = sf.c.shadowClass+'-off', 3918 $ul = this.addClass(o.hoverClass) 3919 .children('ul.sf-hidden').hide().removeClass('sf-hidden'); 3920 o.onBeforeShow.call($ul); 3921 $ul.animate(o.animation,o.speed,function(){ o.onShow.call($ul); }); 3922 return this; 3923 } 3924 }); 3925})(jQuery);; 3926/*! 3927 * hoverIntent v1.10.1 // 2019.10.05 // jQuery v1.7.0+ 3928 * http://briancherne.github.io/jquery-hoverIntent/ 3929 * 3930 * You may use hoverIntent under the terms of the MIT license. Basically that 3931 * means you are free to use hoverIntent as long as this header is left intact. 3932 * Copyright 2007-2019 Brian Cherne 3933 */ 3934!function(factory){"use strict";"function"==typeof define&&define.amd?define(["jquery"],factory):"object"==typeof module&&module.exports?module.exports=factory(require("jquery")):jQuery&&!jQuery.fn.hoverIntent&&factory(jQuery)}(function($){"use strict";function track(ev){cX=ev.pageX,cY=ev.pageY}var cX,cY,_cfg={interval:100,sensitivity:6,timeout:0},INSTANCE_COUNT=0,compare=function(ev,$el,s,cfg){if(Math.sqrt((s.pX-cX)*(s.pX-cX)+(s.pY-cY)*(s.pY-cY))<cfg.sensitivity)return $el.off(s.event,track),delete s.timeoutId,s.isActive=!0,ev.pageX=cX,ev.pageY=cY,delete s.pX,delete s.pY,cfg.over.apply($el[0],[ev]);s.pX=cX,s.pY=cY,s.timeoutId=setTimeout(function(){compare(ev,$el,s,cfg)},cfg.interval)};$.fn.hoverIntent=function(handlerIn,handlerOut,selector){var instanceId=INSTANCE_COUNT++,cfg=$.extend({},_cfg);$.isPlainObject(handlerIn)?(cfg=$.extend(cfg,handlerIn),$.isFunction(cfg.out)||(cfg.out=cfg.over)):cfg=$.isFunction(handlerOut)?$.extend(cfg,{over:handlerIn,out:handlerOut,selector:selector}):$.extend(cfg,{over:handlerIn,out:handlerIn,selector:handlerOut});function handleHover(e){var ev=$.extend({},e),$el=$(this),hoverIntentData=$el.data("hoverIntent");hoverIntentData||$el.data("hoverIntent",hoverIntentData={});var state=hoverIntentData[instanceId];state||(hoverIntentData[instanceId]=state={id:instanceId}),state.timeoutId&&(state.timeoutId=clearTimeout(state.timeoutId));var mousemove=state.event="mousemove.hoverIntent.hoverIntent"+instanceId;if("mouseenter"===e.type){if(state.isActive)return;state.pX=ev.pageX,state.pY=ev.pageY,$el.off(mousemove,track).on(mousemove,track),state.timeoutId=setTimeout(function(){compare(ev,$el,state,cfg)},cfg.interval)}else{if(!state.isActive)return;$el.off(mousemove,track),state.timeoutId=setTimeout(function(){!function(ev,$el,s,out){var data=$el.data("hoverIntent");data&&delete data[s.id],out.apply($el[0],[ev])}(ev,$el,state,cfg.out)},cfg.timeout)}}return this.on({"mouseenter.hoverIntent":handleHover,"mouseleave.hoverIntent":handleHover},cfg.selector)}});; 3935/* 3936 * sf-Smallscreen v1.3b - Provides small-screen compatibility for the jQuery Superfish plugin. 3937 * 3938 * Developer's note: 3939 * Built as a part of the Superfish project for Drupal (http://drupal.org/project/superfish) 3940 * Found any bug? have any cool ideas? contact me right away! http://drupal.org/user/619294/contact 3941 * 3942 * jQuery version: 1.3.x or higher. 3943 * 3944 * Dual licensed under the MIT and GPL licenses: 3945 * http://www.opensource.org/licenses/mit-license.php 3946 * http://www.gnu.org/licenses/gpl.html 3947 */ 3948 3949(function($){ 3950 $.fn.sfsmallscreen = function(options){ 3951 options = $.extend({ 3952 mode: 'inactive', 3953 type: 'accordion', 3954 breakpoint: 768, 3955 breakpointUnit: 'px', 3956 useragent: '', 3957 title: '', 3958 addSelected: false, 3959 menuClasses: false, 3960 hyperlinkClasses: false, 3961 excludeClass_menu: '', 3962 excludeClass_hyperlink: '', 3963 includeClass_menu: '', 3964 includeClass_hyperlink: '', 3965 accordionButton: 1, 3966 expandText: 'Expand', 3967 collapseText: 'Collapse' 3968 }, options); 3969 3970 // We need to clean up the menu from anything unnecessary. 3971 function refine(menu){ 3972 var 3973 refined = menu.clone(), 3974 // Things that should not be in the small-screen menus. 3975 rm = refined.find('span.sf-sub-indicator'), 3976 // This is a helper class for those who need to add extra markup that shouldn't exist 3977 // in the small-screen versions. 3978 rh = refined.find('.sf-smallscreen-remove'), 3979 // Mega-menus has to be removed too. 3980 mm = refined.find('ul.sf-multicolumn'); 3981 for (var a = 0; a < rh.length; a++){ 3982 rh.eq(a).replaceWith(rh.eq(a).html()); 3983 } 3984 if (options.accordionButton == 2 || options.type == 'select'){ 3985 for (var b = 0; b < rm.length; b++){ 3986 rm.eq(b).remove(); 3987 } 3988 } 3989 if (mm.length > 0){ 3990 mm.removeClass('sf-multicolumn'); 3991 var ol = refined.find('div.sf-multicolumn-column > ol'); 3992 for (var o = 0; o < ol.length; o++){ 3993 ol.eq(o).replaceWith('<ul>' + ol.eq(o).html() + '</ul>'); 3994 } 3995 var elements = ['div.sf-multicolumn-column','.sf-multicolumn-wrapper > ol','li.sf-multicolumn-wrapper']; 3996 for (var i = 0; i < elements.length; i++){ 3997 obj = refined.find(elements[i]); 3998 for (var t = 0; t < obj.length; t++){ 3999 obj.eq(t).replaceWith(obj.eq(t).html()); 4000 } 4001 } 4002 refined.find('.sf-multicolumn-column').removeClass('sf-multicolumn-column'); 4003 } 4004 refined.add(refined.find('*')).css({width:''}); 4005 return refined; 4006 } 4007 4008 // Creating <option> elements out of the menu. 4009 function toSelect(menu, level){ 4010 var 4011 items = '', 4012 childLI = $(menu).children('li'); 4013 for (var a = 0; a < childLI.length; a++){ 4014 var list = childLI.eq(a), parent = list.children('a, span'); 4015 for (var b = 0; b < parent.length; b++){ 4016 var 4017 item = parent.eq(b), 4018 path = (item.is('a') && !!item.attr('href')) ? item.attr('href') : '', 4019 // Class names modification. 4020 itemClone = item.clone(), 4021 classes = (options.hyperlinkClasses) ? ((options.excludeClass_hyperlink && itemClone.hasClass(options.excludeClass_hyperlink)) ? itemClone.removeClass(options.excludeClass_hyperlink).attr('class') : itemClone.attr('class')) : '', 4022 classes = (options.includeClass_hyperlink && !itemClone.hasClass(options.includeClass_hyperlink)) ? ((options.hyperlinkClasses) ? itemClone.addClass(options.includeClass_hyperlink).attr('class') : options.includeClass_hyperlink) : classes; 4023 // Retaining the active class if requested. 4024 if (options.addSelected && item.hasClass('active')){ 4025 classes += ' active'; 4026 } 4027 classes = (classes) ? ' class="' + classes + '"' : ''; 4028 // <option> has to be disabled if the item is not a link. 4029 disable = (path == '') || (path == '#') ? ' disabled="disabled"' : '', 4030 // Crystal clear. 4031 subIndicator = 1 < level ? Array(level).join('-') + ' ' : ''; 4032 // Preparing the <option> element. 4033 items += '<option value="' + path + '"' + classes + disable + '>' + subIndicator + $.trim(item.text()) +'</option>', 4034 childUL = list.find('> ul'); 4035 // Using the function for the sub-menu of this item. 4036 for (var u = 0; u < childUL.length; u++){
4037 items += toSelect(childUL.eq(u), level + 1); 4038 } 4039 } 4040 } 4041 return items; 4042 } 4043 4044 // Create the new version, hide the original. 4045 function convert(menu){ 4046 var menuID = menu.attr('id'), 4047 // Creating a refined version of the menu. 4048 refinedMenu = refine(menu); 4049 // Currently the plugin provides two reactions to small screens. 4050 // Converting the menu to a <select> element, and converting to an accordion version of the menu. 4051 if (options.type == 'accordion'){ 4052 var 4053 toggleID = menuID + '-toggle', 4054 accordionID = menuID + '-accordion'; 4055 // Making sure the accordion does not exist. 4056 if ($('#' + accordionID).length == 0){ 4057 var 4058 // Getting the style class. 4059 styleClass = menu.attr('class').split(' ').filter(function(item){ 4060 return item.indexOf('sf-style-') > -1 ? item : ''; 4061 }), 4062 // Creating the accordion. 4063 accordion = $(refinedMenu).attr('id', accordionID); 4064 // Removing unnecessary classes. 4065 accordion.removeClass('sf-horizontal sf-vertical sf-navbar sf-shadow sf-js-enabled'); 4066 // Adding necessary classes. 4067 accordion.addClass('sf-accordion sf-hidden'); 4068 // Removing style attributes and any unnecessary class. 4069 accordion.find('li').each(function(){ 4070 $(this).removeAttr('style').removeClass('sfHover').attr('id', $(this).attr('id') + '-accordion'); 4071 }); 4072 // Doing the same and making sure all the sub-menus are off-screen (hidden). 4073 accordion.children('ul').removeAttr('style').not('.sf-hidden').addClass('sf-hidden'); 4074 // Creating the accordion toggle switch. 4075 var toggle = '<div class="sf-accordion-toggle ' + styleClass + '"><a href="#" id="' + toggleID + '"><span>' + options.title + '</span></a></div>'; 4076 4077 // Adding Expand\Collapse buttons if requested. 4078 if (options.accordionButton == 2){ 4079 accordion.addClass('sf-accordion-with-buttons'); 4080 var parent = accordion.find('li.menuparent'); 4081 for (var i = 0; i < parent.length; i++){ 4082 parent.eq(i).prepend('<a href="#" class="sf-accordion-button">' + options.expandText + '</a>'); 4083 } 4084 } 4085 // Inserting the according and hiding the original menu. 4086 menu.before(toggle).before(accordion).hide(); 4087 4088 var 4089 accordionElement = $('#' + accordionID), 4090 // Deciding what should be used as accordion buttons. 4091 buttonElement = (options.accordionButton < 2) ? 'a.menuparent,span.nolink.menuparent' : 'a.sf-accordion-button', 4092 button = accordionElement.find(buttonElement); 4093 4094 // Attaching a click event to the toggle switch. 4095 $('#' + toggleID).on('click', function(e){ 4096 // Preventing the click. 4097 e.preventDefault(); 4098 // Adding the sf-expanded class. 4099 $(this).toggleClass('sf-expanded'); 4100 4101 if (accordionElement.hasClass('sf-expanded')){ 4102 // If the accordion is already expanded: 4103 // Hiding its expanded sub-menus and then the accordion itself as well. 4104 accordionElement.add(accordionElement.find('li.sf-expanded')).removeClass('sf-expanded') 4105 .end().children('ul').hide() 4106 // This is a bit tricky, it's the same trick that has been in use in the main plugin for some time. 4107 // Basically we'll add a class that keeps the sub-menu off-screen and still visible, 4108 // and make it invisible and removing the class one moment before showing or hiding it. 4109 // This helps screen reader software access all the menu items. 4110 .end().hide().addClass('sf-hidden').show(); 4111 // Changing the caption of any existing accordion buttons to 'Expand'. 4112 if (options.accordionButton == 2){ 4113 accordionElement.find('a.sf-accordion-button').text(options.expandText); 4114 } 4115 } 4116 else { 4117 // But if it's collapsed, 4118 accordionElement.addClass('sf-expanded').hide().removeClass('sf-hidden').show(); 4119 } 4120 }); 4121 4122 // Attaching a click event to the buttons. 4123 button.on('click', function(e){ 4124 // Making sure the buttons does not exist already. 4125 if ($(this).closest('li').children('ul').length > 0){ 4126 e.preventDefault(); 4127 // Selecting the parent menu items. 4128 var parent = $(this).closest('li'); 4129 // Creating and inserting Expand\Collapse buttons to the parent menu items, 4130 // of course only if not already happened.
4131 if (options.accordionButton == 1 && parent.children('a.menuparent,span.nolink.menuparent').length > 0 && parent.children('ul').children('li.sf-clone-parent').length == 0){ 4132 var 4133 // Cloning the hyperlink of the parent menu item. 4134 cloneLink = parent.children('a.menuparent').clone(); 4135 // Removing unnecessary classes and element(s). 4136 cloneLink.removeClass('menuparent sf-with-ul').children('.sf-sub-indicator').remove(); 4137 // Wrapping the hyerplinks in <li>. 4138 cloneLink = $('<li class="sf-clone-parent" />').html(cloneLink); 4139 // Adding a helper class and attaching them to the sub-menus. 4140 parent.children('ul').addClass('sf-has-clone-parent').prepend(cloneLink); 4141 } 4142 // Once the button is clicked, collapse the sub-menu if it's expanded. 4143 if (parent.hasClass('sf-expanded')){ 4144 parent.children('ul').slideUp('fast', function(){ 4145 // Doing the accessibility trick after hiding the sub-menu. 4146 $(this).closest('li').removeClass('sf-expanded').end().addClass('sf-hidden').show(); 4147 }); 4148 // Changing the caption of the inserted Collapse link to 'Expand', if any is inserted. 4149 if (options.accordionButton == 2 && parent.children('.sf-accordion-button').length > 0){ 4150 parent.children('.sf-accordion-button').text(options.expandText); 4151 } 4152 } 4153 // Otherwise, expand the sub-menu. 4154 else { 4155 // Doing the accessibility trick and then showing the sub-menu. 4156 parent.children('ul').hide().removeClass('sf-hidden').slideDown('fast') 4157 // Changing the caption of the inserted Expand link to 'Collape', if any is inserted. 4158 .end().addClass('sf-expanded').children('a.sf-accordion-button').text(options.collapseText) 4159 // Hiding any expanded sub-menu of the same level. 4160 .end().siblings('li.sf-expanded').children('ul') 4161 .slideUp('fast', function(){ 4162 // Doing the accessibility trick after hiding it. 4163 $(this).closest('li').removeClass('sf-expanded').end().addClass('sf-hidden').show(); 4164 }) 4165 // Assuming Expand\Collapse buttons do exist, resetting captions, in those hidden sub-menus. 4166 .parent().children('a.sf-accordion-button').text(options.expandText); 4167 } 4168 } 4169 }); 4170 } 4171 } 4172 else { 4173 var 4174 // Class names modification. 4175 menuClone = menu.clone(), classes = (options.menuClasses) ? ((options.excludeClass_menu && menuClone.hasClass(options.excludeClass_menu)) ? menuClone.removeClass(options.excludeClass_menu).attr('class') : menuClone.attr('class')) : '', 4176 classes = (options.includeClass_menu && !menuClone.hasClass(options.includeClass_menu)) ? ((options.menuClasses) ? menuClone.addClass(options.includeClass_menu).attr('class') : options.includeClass_menu) : classes, 4177 classes = (classes) ? ' class="' + classes + '"' : ''; 4178 4179 // Making sure the <select> element does not exist already. 4180 if ($('#' + menuID + '-select').length == 0){ 4181 // Creating the <option> elements. 4182 var newMenu = toSelect(refinedMenu, 1), 4183 // Creating the <select> element and assigning an ID and class name. 4184 selectList = $('<select' + classes + ' id="' + menuID + '-select"/>') 4185 // Attaching the title and the items to the <select> element. 4186 .html('<option>' + options.title + '</option>' + newMenu) 4187 // Attaching an event then. 4188 .change(function(){ 4189 // Except for the first option that is the menu title and not a real menu item. 4190 if ($('option:selected', this).index()){ 4191 window.location = selectList.val(); 4192 } 4193 }); 4194 // Applying the addSelected option to it. 4195 if (options.addSelected){ 4196 selectList.find('.active').attr('selected', !0); 4197 } 4198 // Finally inserting the <select> element into the document then hiding the original menu. 4199 menu.before(selectList).hide(); 4200 } 4201 } 4202 } 4203 4204 // Turn everything back to normal. 4205 function turnBack(menu){ 4206 var 4207 id = '#' + menu.attr('id'); 4208 // Removing the small screen version. 4209 $(id + '-' + options.type).remove(); 4210 // Removing the accordion toggle switch as well. 4211 if (options.type == 'accordion'){ 4212 $(id + '-toggle').parent('div').remove(); 4213 } 4214 // Remove inline CSS display property; less clear than simply using .show(), but respects stylesheet 4215 $(id).css('display', ''); 4216 } 4217
4218 // Return original object to support chaining. 4219 // Although this is unnecessary because of the way the module uses these plugins. 4220 for (var s = 0; s < this.length; s++){ 4221 var 4222 menu = $(this).eq(s), 4223 mode = options.mode; 4224 // The rest is crystal clear, isn't it? :) 4225 if (menu.children('li').length == 0){ 4226 // Skip empty menu which will not be visible and don't want to suddenly make it visible. 4227 } 4228 else if (mode == 'always_active'){ 4229 convert(menu); 4230 } 4231 else if (mode == 'window_width'){ 4232 var breakpoint = (options.breakpointUnit == 'em') ? (options.breakpoint * parseFloat($('body').css('font-size'))) : options.breakpoint, 4233 windowWidth = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth, 4234 timer; 4235 if ((typeof Modernizr === 'undefined' || typeof Modernizr.mq !== 'function') && windowWidth < breakpoint){ 4236 convert(menu); 4237 } 4238 else if (typeof Modernizr !== 'undefined' && typeof Modernizr.mq === 'function' && Modernizr.mq('(max-width:' + (breakpoint - 1) + 'px)')) { 4239 convert(menu); 4240 } 4241 $(window).resize(function(){ 4242 clearTimeout(timer); 4243 timer = setTimeout(function(){ 4244 var windowWidth = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth; 4245 if ((typeof Modernizr === 'undefined' || typeof Modernizr.mq !== 'function') && windowWidth < breakpoint){ 4246 convert(menu); 4247 } 4248 else if (typeof Modernizr !== 'undefined' && typeof Modernizr.mq === 'function' && Modernizr.mq('(max-width:' + (breakpoint - 1) + 'px)')) { 4249 convert(menu); 4250 } 4251 else { 4252 turnBack(menu); 4253 } 4254 }, 50); 4255 }); 4256 } 4257 else if (mode == 'useragent_custom'){ 4258 if (options.useragent != ''){ 4259 var ua = RegExp(options.useragent, 'i'); 4260 if (navigator.userAgent.match(ua)){ 4261 convert(menu); 4262 } 4263 } 4264 } 4265 else if (mode == 'useragent_predefined' && navigator.userAgent.match(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od|ad)|iris|kindle|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i)){ 4266 convert(menu); 4267 } 4268 } 4269 return this; 4270 } 4271})(jQuery); 4272; 4273/* 4274 * Supposition v0.2 - an optional enhancer for Superfish jQuery menu widget. 4275 * 4276 * Copyright (c) 2008 Joel Birch - based mostly on work by Jesse Klaasse and credit goes largely to him. 4277 * Special thanks to Karl Swedberg for valuable input. 4278 * 4279 * Dual licensed under the MIT and GPL licenses: 4280 * http://www.opensource.org/licenses/mit-license.php 4281 * http://www.gnu.org/licenses/gpl.html 4282 */ 4283/* 4284 * This is not the original jQuery Supposition plugin. 4285 * Please refer to the README for more information. 4286 */ 4287 4288(function($){ 4289 $.fn.supposition = function(){ 4290 var $w = $(window), /*do this once instead of every onBeforeShow call*/ 4291 _offset = function(dir) { 4292 return window[dir == 'y' ? 'pageYOffset' : 'pageXOffset'] 4293 || document.documentElement && document.documentElement[dir=='y' ? 'scrollTop' : 'scrollLeft'] 4294 || document.body[dir=='y' ? 'scrollTop' : 'scrollLeft']; 4295 }, 4296 onHide = function(){ 4297 this.css({bottom:''}); 4298 }, 4299 onBeforeShow = function(){ 4300 this.each(function(){ 4301 var $u = $(this); 4302 $u.css('display','block'); 4303 var $mul = $u.closest('.sf-menu'), 4304 level = $u.parents('ul').length, 4305 menuWidth = $u.width(), 4306 menuParentWidth = $u.closest('li').outerWidth(true), 4307 menuParentLeft = $u.closest('li').offset().left, 4308 totalRight = $w.width() + _offset('x'), 4309 menuRight = $u.offset().left + menuWidth, 4310 exactMenuWidth = (menuRight > (menuParentWidth + menuParentLeft)) ? menuWidth - (menuRight - (menuParentWidth + menuParentLeft)) : menuWidth; 4311 if ($u.parents('.sf-js-enabled').hasClass('rtl')) { 4312 if (menuParentLeft < exactMenuWidth) { 4313 if (($mul.hasClass('sf-horizontal') && level == 1) || ($mul.hasClass('sf-navbar') && level == 2)){ 4314 $u.css({left:0,right:'auto'}); 4315 } 4316 else { 4317 $u.css({left:menuParentWidth + 'px',right:'auto'}); 4318 } 4319 $u.parent().addClass('sf-supposition-active'); 4320 } 4321 } 4322 else { 4323 if (menuRight > totalRight && menuParentLeft > menuWidth) { 4324 if (($mul.hasClass('sf-horizontal') && level == 1) || ($mul.hasClass('sf-navbar') && level == 2)){ 4325 $u.css({right:0,left:'auto'}); 4326 } 4327 else { 4328 $u.css({right:menuParentWidth + 'px',left:'auto'}); 4329 } 4330 $u.parent().addClass('sf-supposition-active'); 4331 } 4332 } 4333 var windowHeight = $w.height(), 4334 offsetTop = $u.offset().top, 4335 menuParentShadow = ($mul.hasClass('sf-shadow') && $u.css('padding-bottom').length > 0) ? parseInt($u.css('padding-bottom').slice(0,-2)) : 0, 4336 menuParentHeight = ($mul.hasClass('sf-vertical')) ? '-' + menuParentShadow : $u.parent().outerHeight(true) - menuParentShadow, 4337 menuHeight = $u.height(), 4338 baseline = windowHeight + _offset('y'); 4339 var expandUp = ((offsetTop + menuHeight > baseline) && (offsetTop > menuHeight)); 4340 if (expandUp) { 4341 $u.css({bottom:menuParentHeight + 'px',top:'auto'}); 4342 } 4343 $u.css('display','none'); 4344 }); 4345 }; 4346 4347 return this.each(function() { 4348 var o = $.fn.superfish.o[this.serial]; /* get this menu's options */ 4349 4350 /* if callbacks already set, store them */ 4351 var _onBeforeShow = o.onBeforeShow, 4352 _onHide = o.onHide; 4353 4354 $.extend($.fn.superfish.o[this.serial],{ 4355 onBeforeShow: function() { 4356 onBeforeShow.call(this); /* fire our Supposition callback */ 4357 _onBeforeShow.call(this); /* fire stored callbacks */ 4358 }, 4359 onHide: function() { 4360 onHide.call(this); /* fire our Supposition callback */ 4361 _onHide.call(this); /* fire stored callbacks */ 4362 } 4363 }); 4364 }); 4365 }; 4366})(jQuery);; 4367/* 4368 * Supersubs v0.4b - jQuery plugin 4369 * Copyright (c) 2013 Joel Birch 4370 * 4371 * Dual licensed under the MIT and GPL licenses: 4372 * http://www.opensource.org/licenses/mit-license.php 4373 * http://www.gnu.org/licenses/gpl.html 4374 * 4375 * This plugin automatically adjusts submenu widths of suckerfish-style menus to that of 4376 * their longest list item children. If you use this, please expect bugs and report them 4377 * to the jQuery Google Group with the word 'Superfish' in the subject line. 4378 * 4379 */ 4380/* 4381 * This is not the original jQuery Supersubs plugin. 4382 * Please refer to the README for more information. 4383 */ 4384 4385(function($){ // $ will refer to jQuery within this closure 4386 $.fn.supersubs = function(options){ 4387 var opts = $.extend({}, $.fn.supersubs.defaults, options);
4388 // return original object to support chaining 4389 // Although this is unnecessary due to the way the module uses these plugins. 4390 for (var a = 0; a < this.length; a++) { 4391 // cache selections 4392 var $$ = $(this).eq(a), 4393 // support metadata 4394 o = $.meta ? $.extend({}, opts, $$.data()) : opts; 4395 // Jump one level if it's a "NavBar" 4396 if ($$.hasClass('sf-navbar')) { 4397 $$ = $$.children('li').children('ul'); 4398 } 4399 // cache all ul elements 4400 var $ULs = $$.find('ul'); 4401 if ($ULs.length) { 4402 // get the font size of menu. 4403 // .css('fontSize') returns various results cross-browser, so measure an em dash instead 4404 var fontsize = $('<li id="menu-fontsize">—</li>'), 4405 size = fontsize.attr('style','padding:0;position:absolute;top:-99999em;width:auto;') 4406 .appendTo($$)[0].clientWidth; //clientWidth is faster than width() 4407 // remove em dash 4408 fontsize.remove(); 4409 4410 // loop through each ul in menu 4411 for (var b = 0; b < $ULs.length; b++) { 4412 var 4413 // cache this ul 4414 $ul = $ULs.eq(b); 4415 // If a multi-column sub-menu, and only if correctly configured. 4416 if (o.multicolumn && $ul.hasClass('sf-multicolumn') && $ul.find('.sf-multicolumn-column').length > 0){ 4417 // Look through each column. 4418 var $column = $ul.find('div.sf-multicolumn-column > ol'), 4419 // Overall width. 4420 mwWidth = 0; 4421 for (var d = 0; d < $column.length; d++){ 4422 resize($column.eq(d)); 4423 // New column width, in pixels. 4424 var colWidth = Math.ceil($column.width()); 4425 // Just a trick to convert em unit to px. 4426 $column.css({width:colWidth}) 4427 // Making column parents the same size. 4428 .parents('.sf-multicolumn-column').css({width:colWidth}); 4429 // Overall width. 4430 mwWidth += colWidth; 4431 } 4432 // Resizing the columns container too. 4433 $ul.add($ul.find('li.sf-multicolumn-wrapper, li.sf-multicolumn-wrapper > ol')).css({width:mwWidth}); 4434 } 4435 else { 4436 resize($ul); 4437 } 4438 } 4439 } 4440 } 4441 function resize($ul){ 4442 var 4443 // get all (li) children of this ul 4444 $LIs = $ul.children(), 4445 // get all anchor grand-children 4446 $As = $LIs.children('a'); 4447 // force content to one line and save current float property 4448 $LIs.css('white-space','nowrap'); 4449 // remove width restrictions and floats so elements remain vertically stacked 4450 $ul.add($LIs).add($As).css({float:'none',width:'auto'}); 4451 // this ul will now be shrink-wrapped to longest li due to position:absolute 4452 // so save its width as ems. 4453 var emWidth = $ul.get(0).clientWidth / size; 4454 // add more width to ensure lines don't turn over at certain sizes in various browsers 4455 emWidth += o.extraWidth; 4456 // restrict to at least minWidth and at most maxWidth 4457 if (emWidth > o.maxWidth) {emWidth = o.maxWidth;} 4458 else if (emWidth < o.minWidth) {emWidth = o.minWidth;} 4459 emWidth += 'em'; 4460 // set ul to width in ems 4461 $ul.css({width:emWidth}); 4462 // restore li floats to avoid IE bugs 4463 // set li width to full width of this ul 4464 // revert white-space to normal 4465 $LIs.add($As).css({float:'',width:'',whiteSpace:''}); 4466 // update offset position of descendant ul to reflect new width of parent. 4467 // set it to 100% in case it isn't already set to this in the CSS 4468 for (var c = 0; c < $LIs.length; c++) { 4469 var $childUl = $LIs.eq(c).children('ul'); 4470 var offsetDirection = $childUl.css('left') !== undefined ? 'left' : 'right'; 4471 $childUl.css(offsetDirection,'100%'); 4472 } 4473 } 4474 return this; 4475 }; 4476 // expose defaults 4477 $.fn.supersubs.defaults = { 4478 multicolumn: true, // define width for multi-column sub-menus and their columns. 4479 minWidth: 12, // requires em unit. 4480 maxWidth: 27, // requires em unit. 4481 extraWidth: 1 // extra width can ensure lines don't sometimes turn over due to slight browser differences in how they round-off values 4482 }; 4483})(jQuery); // plugin code ends 4484; 4485/** 4486 * @file 4487 * The Superfish Drupal Behavior to apply the Superfish jQuery plugin to lists. 4488 */ 4489 4490(function ($, Drupal, drupalSettings) { 4491 4492 'use strict'; 4493 4494 /** 4495 * jQuery Superfish plugin. 4496 * 4497 * @type {Drupal~behavior} 4498 * 4499 * @prop {Drupal~behaviorAttach} attach 4500 * Attaches the behavior to an applicable <ul> element. 4501 */ 4502 Drupal.behaviors.superfish = { 4503 attach: function (context, drupalSettings) { 4504 // Take a look at each menu to apply Superfish to. 4505 $.each(drupalSettings.superfish || {}, function (index, options) { 4506 var $menu = $('ul#' + options.id, context); 4507 4508 // Check if we are to apply the Supersubs plug-in to it. 4509 if (options.plugins || false) { 4510 if (options.plugins.supersubs || false) { 4511 $menu.supersubs(options.plugins.supersubs); 4512 } 4513 } 4514 4515 // Apply Superfish to the menu. 4516 $menu.superfish(options.sf); 4517 4518 // Check if we are to apply any other plug-in to it. 4519 if (options.plugins || false) { 4520 if (options.plugins.touchscreen || false) { 4521 $menu.sftouchscreen(options.plugins.touchscreen); 4522 } 4523 if (options.plugins.smallscreen || false) { 4524 $menu.sfsmallscreen(options.plugins.smallscreen); 4525 } 4526 if (options.plugins.supposition || false) { 4527 $menu.supposition(); 4528 } 4529 } 4530 }); 4531 } 4532 }; 4533})(jQuery, Drupal, drupalSettings); 4534;
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.