PageSourceSearch

https://static.joguinesibicisgaspar.com/CACHE/js/core.90d315817e28.js?v=818eb

js joguinesibicisgaspar.com collected 2026-09-27 12:15:01 UTC 296,275 bytes, 507 lines download raw bytes

1var cookie_policy_url="/p/politica-de-cookies/";$(document).ready(function(){const M_BREAKPOINT=768;let currentWidth=$(window).width();function setVideosSource(){$('video.layout-video').each(function(index,element){const $video=$(this);let video_src=$video.data('src-l');if($(window).width()<M_BREAKPOINT&&$video.data('src-m')){video_src=$video.data('src-m');}
2const video_data_src=$video.attr('data-src')||"";if(($video.hasClass('loaded')||!$video.hasClass('lazy'))&&!this.src.endsWith(video_src)){this.src=video_src;}else if(($video.hasClass('lazy'))&&!video_data_src.endsWith(video_src)){$video.attr('data-src',video_src);}});}
3$(window).resize(function(){const newWidth=$(window).width();if((currentWidth<M_BREAKPOINT&&newWidth>=M_BREAKPOINT)||(currentWidth>=M_BREAKPOINT&&newWidth<M_BREAKPOINT)){setVideosSource();}
4currentWidth=newWidth;});setVideosSource();});;function _extends(){return(_extends=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t}).apply(this,arguments)}function _typeof(t){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}!function(t,e){"object"===("undefined"==typeof exports?"undefined":_typeof(exports))&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.LazyLoad=e()}(this,function(){"use strict";var t="undefined"!=typeof window,e=t&&!("onscroll"in window)||"undefined"!=typeof navigator&&/(gle|ing|ro)bot|crawl|spider/i.test(navigator.userAgent),n=t&&"IntersectionObserver"in window,o=t&&"classList"in document.createElement("p"),r={elements_selector:"img",container:e||t?document:null,threshold:300,thresholds:null,data_src:"src",data_srcset:"srcset",data_sizes:"sizes",data_bg:"bg",class_loading:"loading",class_loaded:"loaded",class_error:"error",load_delay:0,auto_unobserve:!0,callback_enter:null,callback_exit:null,callback_reveal:null,callback_loaded:null,callback_error:null,callback_finish:null,use_native:!1},a=function(t,e){var n,o=new t(e);try{n=new CustomEvent("LazyLoad::Initialized",{detail:{instance:o}})}catch(t){(n=document.createEvent("CustomEvent")).initCustomEvent("LazyLoad::Initialized",!1,!1,{instance:o})}window.dispatchEvent(n)};var i=function(t,e){return t.getAttribute("data-"+e)},s=function(t,e,n){var o="data-"+e;null!==n?t.setAttribute(o,n):t.removeAttribute(o)},c=function(t){return"true"===i(t,"was-processed")},l=function(t,e){return s(t,"ll-timeout",e)},u=function(t){return i(t,"ll-timeout")},d=function(t,e){t&&t(e)},f=function(t,e){t._loadingCount+=e,0===t._elements.length&&0===t._loadingCount&&d(t._settings.callback_finish)},_=function(t){for(var e,n=[],o=0;e=t.children[o];o+=1)"SOURCE"===e.tagName&&n.push(e);return n},v=function(t,e,n){n&&t.setAttribute(e,n)},g=function(t,e){v(t,"sizes",i(t,e.data_sizes)),v(t,"srcset",i(t,e.data_srcset)),v(t,"src",i(t,e.data_src))},m={IMG:function(t,e){var n=t.parentNode;n&&"PICTURE"===n.tagName&&_(n).forEach(function(t){g(t,e)});g(t,e)},IFRAME:function(t,e){v(t,"src",i(t,e.data_src))},VIDEO:function(t,e){_(t).forEach(function(t){v(t,"src",i(t,e.data_src))}),v(t,"src",i(t,e.data_src)),t.load()}},b=function(t,e){var n,o,r=e._settings,a=t.tagName,s=m[a];if(s)return s(t,r),f(e,1),void(e._elements=(n=e._elements,o=t,n.filter(function(t){return t!==o})));!function(t,e){var n=i(t,e.data_src),o=i(t,e.data_bg);n&&(t.style.backgroundImage='url("'.concat(n,'")')),o&&(t.style.backgroundImage=o)}(t,r)},h=function(t,e){o?t.classList.add(e):t.className+=(t.className?" ":"")+e},p=function(t,e,n){t.addEventListener(e,n)},y=function(t,e,n){t.removeEventListener(e,n)},E=function(t,e,n){y(t,"load",e),y(t,"loadeddata",e),y(t,"error",n)},w=function(t,e,n){var r=n._settings,a=e?r.class_loaded:r.class_error,i=e?r.callback_loaded:r.callback_error,s=t.target;!function(t,e){o?t.classList.remove(e):t.className=t.className.replace(new RegExp("(^|\\s+)"+e+"(\\s+|$)")," ").replace(/^\s+/,"").replace(/\s+$/,"")}(s,r.class_loading),h(s,a),d(i,s),f(n,-1)},I=function(t,e){var n=function n(r){w(r,!0,e),E(t,n,o)},o=function o(r){w(r,!1,e),E(t,n,o)};!function(t,e,n){p(t,"load",e),p(t,"loadeddata",e),p(t,"error",n)}(t,n,o)},k=["IMG","IFRAME","VIDEO"],A=function(t,e){var n=e._observer;z(t,e),n&&e._settings.auto_unobserve&&n.unobserve(t)},L=function(t){var e=u(t);e&&(clearTimeout(e),l(t,null))},x=function(t,e){var n=e._settings.load_delay,o=u(t);o||(o=setTimeout(function(){A(t,e),L(t)},n),l(t,o))},z=function(t,e,n){var o=e._settings;!n&&c(t)||(k.indexOf(t.tagName)>-1&&(I(t,e),h(t,o.class_loading)),b(t,e),function(t){s(t,"was-processed","true")}(t),d(o.callback_reveal,t),d(o.callback_set,t))},O=function(t){return!!n&&(t._observer=new IntersectionObserver(function(e){e.forEach(function(e){return function(t){return t.isIntersecting||t.intersectionRatio>0}(e)?function(t,e){var n=e._settings;d(n.callback_enter,t),n.load_delay?x(t,e):A(t,e)}(e.target,t):function(t,e){var n=e._settings;d(n.callback_exit,t),n.load_delay&&L(t)}(e.target,t)})},{root:(e=t._settings).container===document?null:e.container,rootMargin:e.thresholds||e.threshold+"px"}),!0);var e},N=["IMG","IFRAME"],C=function(t,e){return function(t){return t.filter(function(t){return!c(t)})}((n=t||function(t){return t.container.querySelectorAll(t.elements_selector)}(e),Array.prototype.slice.call(n)));var n},M=function(t,e){this._settings=function(t){return _extends({},r,t)}(t),this._loadingCount=0,O(this),this.update(e)};return M.prototype={update:function(t){var n,o=this,r=this._settings;(this._elements=C(t,r),!e&&this._observer)?(function(t){return t.use_native&&"loading"in HTMLImageElement.prototype}
4(r)&&((n=this)._elements.forEach(function(t){-1!==N.indexOf(t.tagName)&&(t.setAttribute("loading","lazy"),z(t,n))}),this._elements=C(t,r)),this._elements.forEach(function(t){o._observer.observe(t)})):this.loadAll()},destroy:function(){var t=this;this._observer&&(this._elements.forEach(function(e){t._observer.unobserve(e)}),this._observer=null),this._elements=null,this._settings=null},load:function(t,e){z(t,this,e)},loadAll:function(){var t=this;this._elements.forEach(function(e){A(e,t)})}},t&&function(t,e){if(e)if(e.length)for(var n,o=0;n=e[o];o+=1)a(t,n);else a(t,e)}(M,window.lazyLoadOptions),M});;/*!
5  * Bootstrap v4.5.0 (https://getbootstrap.com/)
6  * Copyright 2011-2020 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
7  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
8  */!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("jquery")):"function"==typeof define&&define.amd?define(["exports","jquery"],e):e((t=t||self).bootstrap={},t.jQuery)}(this,(function(t,e){"use strict";function n(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function i(t,e,i){return e&&n(t.prototype,e),i&&n(t,i),t}function o(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function r(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function s(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?r(Object(n),!0).forEach((function(e){o(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}e=e&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e;function a(t){var n=this,i=!1;return e(this).one(l.TRANSITION_END,(function(){i=!0})),setTimeout((function(){i||l.triggerTransitionEnd(n)}),t),this}var l={TRANSITION_END:"bsTransitionEnd",getUID:function(t){do{t+=~~(1e6*Math.random())}while(document.getElementById(t));return t},getSelectorFromElement:function(t){var e=t.getAttribute("data-target");if(!e||"#"===e){var n=t.getAttribute("href");e=n&&"#"!==n?n.trim():""}try{return document.querySelector(e)?e:null}catch(t){return null}},getTransitionDurationFromElement:function(t){if(!t)return 0;var n=e(t).css("transition-duration"),i=e(t).css("transition-delay"),o=parseFloat(n),r=parseFloat(i);return o||r?(n=n.split(",")[0],i=i.split(",")[0],1e3*(parseFloat(n)+parseFloat(i))):0},reflow:function(t){return t.offsetHeight},triggerTransitionEnd:function(t){e(t).trigger("transitionend")},supportsTransitionEnd:function(){return Boolean("transitionend")},isElement:function(t){return(t[0]||t).nodeType},typeCheckConfig:function(t,e,n){for(var i in n)if(Object.prototype.hasOwnProperty.call(n,i)){var o=n[i],r=e[i],s=r&&l.isElement(r)?"element":null===(a=r)||"undefined"==typeof a?""+a:{}.toString.call(a).match(/\s([a-z]+)/i)[1].toLowerCase();if(!new RegExp(o).test(s))throw new Error(t.toUpperCase()+': Option "'+i+'" provided type "'+s+'" but expected type "'+o+'".')}var a},findShadowRoot:function(t){if(!document.documentElement.attachShadow)return null;if("function"==typeof t.getRootNode){var e=t.getRootNode();return e instanceof ShadowRoot?e:null}return t instanceof ShadowRoot?t:t.parentNode?l.findShadowRoot(t.parentNode):null},jQueryDetection:function(){if("undefined"==typeof e)throw new TypeError("Bootstrap's JavaScript requires jQuery. jQuery must be included before Bootstrap's JavaScript.");var t=e.fn.jquery.split(" ")[0].split(".");if(t[0]<2&&t[1]<9||1===t[0]&&9===t[1]&&t[2]<1||t[0]>=4)throw new Error("Bootstrap's JavaScript requires at least jQuery v1.9.1 but less than v4.0.0")}};l.jQueryDetection(),e.fn.emulateTransitionEnd=a,e.event.special[l.TRANSITION_END]={bindType:"transitionend",delegateType:"transitionend",handle:function(t){if(e(t.target).is(this))return t.handleObj.handler.apply(this,arguments)}};var c="alert",u=e.fn[c],h=function(){function t(t){this._element=t}var n=t.prototype;return n.close=function(t){var e=this._element;t&&(e=this._getRootElement(t)),this._triggerCloseEvent(e).isDefaultPrevented()||this._removeElement(e)}
8,n.dispose=function(){e.removeData(this._element,"bs.alert"),this._element=null},n._getRootElement=function(t){var n=l.getSelectorFromElement(t),i=!1;return n&&(i=document.querySelector(n)),i||(i=e(t).closest(".alert")[0]),i},n._triggerCloseEvent=function(t){var n=e.Event("close.bs.alert");return e(t).trigger(n),n},n._removeElement=function(t){var n=this;if(e(t).removeClass("show"),e(t).hasClass("fade")){var i=l.getTransitionDurationFromElement(t);e(t).one(l.TRANSITION_END,(function(e){return n._destroyElement(t,e)})).emulateTransitionEnd(i)}else this._destroyElement(t)},n._destroyElement=function(t){e(t).detach().trigger("closed.bs.alert").remove()},t._jQueryInterface=function(n){return this.each((function(){var i=e(this),o=i.data("bs.alert");o||(o=new t(this),i.data("bs.alert",o)),"close"===n&&o[n](this)}))},t._handleDismiss=function(t){return function(e){e&&e.preventDefault(),t.close(this)}},i(t,null,[{key:"VERSION",get:function(){return"4.5.0"}}]),t}();e(document).on("click.bs.alert.data-api",'[data-dismiss="alert"]',h._handleDismiss(new h)),e.fn[c]=h._jQueryInterface,e.fn[c].Constructor=h,e.fn[c].noConflict=function(){return e.fn[c]=u,h._jQueryInterface};var f=e.fn.button,d=function(){function t(t){this._element=t}var n=t.prototype;return n.toggle=function(){var t=!0,n=!0,i=e(this._element).closest('[data-toggle="buttons"]')[0];if(i){var o=this._element.querySelector('input:not([type="hidden"])');if(o){if("radio"===o.type)if(o.checked&&this._element.classList.contains("active"))t=!1;else{var r=i.querySelector(".active");r&&e(r).removeClass("active")}t&&("checkbox"!==o.type&&"radio"!==o.type||(o.checked=!this._element.classList.contains("active")),e(o).trigger("change")),o.focus(),n=!1}}this._element.hasAttribute("disabled")||this._element.classList.contains("disabled")||(n&&this._element.setAttribute("aria-pressed",!this._element.classList.contains("active")),t&&e(this._element).toggleClass("active"))},n.dispose=function(){e.removeData(this._element,"bs.button"),this._element=null},t._jQueryInterface=function(n){return this.each((function(){var i=e(this).data("bs.button");i||(i=new t(this),e(this).data("bs.button",i)),"toggle"===n&&i[n]()}))},i(t,null,[{key:"VERSION",get:function(){return"4.5.0"}}]),t}();e(document).on("click.bs.button.data-api",'[data-toggle^="button"]',(function(t){var n=t.target,i=n;if(e(n).hasClass("btn")||(n=e(n).closest(".btn")[0]),!n||n.hasAttribute("disabled")||n.classList.contains("disabled"))t.preventDefault();else{var o=n.querySelector('input:not([type="hidden"])');if(o&&(o.hasAttribute("disabled")||o.classList.contains("disabled")))return void t.preventDefault();"LABEL"===i.tagName&&o&&"checkbox"===o.type&&t.preventDefault(),d._jQueryInterface.call(e(n),"toggle")}})).on("focus.bs.button.data-api blur.bs.button.data-api",'[data-toggle^="button"]',(function(t){var n=e(t.target).closest(".btn")[0];e(n).toggleClass("focus",/^focus(in)?$/.test(t.type))})),e(window).on("load.bs.button.data-api",(function(){for(var t=[].slice.call(document.querySelectorAll('[data-toggle="buttons"] .btn')),e=0,n=t.length;e<n;e++){var i=t[e],o=i.querySelector('input:not([type="hidden"])');o.checked||o.hasAttribute("checked")?i.classList.add("active"):i.classList.remove("active")}for(var r=0,s=(t=[].slice.call(document.querySelectorAll('[data-toggle="button"]'))).length;r<s;r++){var a=t[r];"true"===a.getAttribute("aria-pressed")?a.classList.add("active"):a.classList.remove("active")}})),e.fn.button=d._jQueryInterface,e.fn.button.Constructor=d,e.fn.button.noConflict=function(){return e.fn.button=f,d._jQueryInterface};var p="carousel",m=".bs.carousel",g=e.fn[p],v={interval:5e3,keyboard:!0,slide:!1,pause:"hover",wrap:!0,touch:!0},_={interval:"(number|boolean)",keyboard:"boolean",slide:"(boolean|string)",pause:"(string|boolean)",wrap:"boolean",touch:"boolean"},b={TOUCH:"touch",PEN:"pen"},y=function(){function t(t,e){this._items=null,this._interval=null,this._activeElement=null,this._isPaused=!1,this._isSliding=!1,this.touchTimeout=null,this.touchStartX=0,this.touchDeltaX=0,this._config=this._getConfig(e),this._element=t,this._indicatorsElement=this._element.querySelector(".carousel-indicators"),this._touchSupported="ontouchstart"in document.documentElement||navigator.maxTouchPoints>0,this._pointerEvent=Boolean(window.PointerEvent||window.MSPointerEvent),this._addEventListeners()}var n=t.prototype;return n.next=function(){this._isSliding||this._slide("next")},n.nextWhenVisible=function(){!document.hidden&&e(this._element).is(":visible")&&"hidden"
8!==e(this._element).css("visibility")&&this.next()},n.prev=function(){this._isSliding||this._slide("prev")},n.pause=function(t){t||(this._isPaused=!0),this._element.querySelector(".carousel-item-next, .carousel-item-prev")&&(l.triggerTransitionEnd(this._element),this.cycle(!0)),clearInterval(this._interval),this._interval=null},n.cycle=function(t){t||(this._isPaused=!1),this._interval&&(clearInterval(this._interval),this._interval=null),this._config.interval&&!this._isPaused&&(this._interval=setInterval((document.visibilityState?this.nextWhenVisible:this.next).bind(this),this._config.interval))},n.to=function(t){var n=this;this._activeElement=this._element.querySelector(".active.carousel-item");var i=this._getItemIndex(this._activeElement);if(!(t>this._items.length-1||t<0))if(this._isSliding)e(this._element).one("slid.bs.carousel",(function(){return n.to(t)}));else{if(i===t)return this.pause(),void this.cycle();var o=t>i?"next":"prev";this._slide(o,this._items[t])}},n.dispose=function(){e(this._element).off(m),e.removeData(this._element,"bs.carousel"),this._items=null,this._config=null,this._element=null,this._interval=null,this._isPaused=null,this._isSliding=null,this._activeElement=null,this._indicatorsElement=null},n._getConfig=function(t){return t=s(s({},v),t),l.typeCheckConfig(p,t,_),t},n._handleSwipe=function(){var t=Math.abs(this.touchDeltaX);if(!(t<=40)){var e=t/this.touchDeltaX;this.touchDeltaX=0,e>0&&this.prev(),e<0&&this.next()}},n._addEventListeners=function(){var t=this;this._config.keyboard&&e(this._element).on("keydown.bs.carousel",(function(e){return t._keydown(e)})),"hover"===this._config.pause&&e(this._element).on("mouseenter.bs.carousel",(function(e){return t.pause(e)})).on("mouseleave.bs.carousel",(function(e){return t.cycle(e)})),this._config.touch&&this._addTouchEventListeners()},n._addTouchEventListeners=function(){var t=this;if(this._touchSupported){var n=function(e){t._pointerEvent&&b[e.originalEvent.pointerType.toUpperCase()]?t.touchStartX=e.originalEvent.clientX:t._pointerEvent||(t.touchStartX=e.originalEvent.touches[0].clientX)},i=function(e){t._pointerEvent&&b[e.originalEvent.pointerType.toUpperCase()]&&(t.touchDeltaX=e.originalEvent.clientX-t.touchStartX),t._handleSwipe(),"hover"===t._config.pause&&(t.pause(),t.touchTimeout&&clearTimeout(t.touchTimeout),t.touchTimeout=setTimeout((function(e){return t.cycle(e)}),500+t._config.interval))};e(this._element.querySelectorAll(".carousel-item img")).on("dragstart.bs.carousel",(function(t){return t.preventDefault()})),this._pointerEvent?(e(this._element).on("pointerdown.bs.carousel",(function(t){return n(t)})),e(this._element).on("pointerup.bs.carousel",(function(t){return i(t)})),this._element.classList.add("pointer-event")):(e(this._element).on("touchstart.bs.carousel",(function(t){return n(t)})),e(this._element).on("touchmove.bs.carousel",(function(e){return function(e){e.originalEvent.touches&&e.originalEvent.touches.length>1?t.touchDeltaX=0:t.touchDeltaX=e.originalEvent.touches[0].clientX-t.touchStartX}(e)})),e(this._element).on("touchend.bs.carousel",(function(t){return i(t)})))}},n._keydown=function(t){if(!/input|textarea/i.test(t.target.tagName))switch(t.which){case 37:t.preventDefault(),this.prev();break;case 39:t.preventDefault(),this.next()}},n._getItemIndex=function(t){return this._items=t&&t.parentNode?[].slice.call(t.parentNode.querySelectorAll(".carousel-item")):[],this._items.indexOf(t)},n._getItemByDirection=function(t,e){var n="next"===t,i="prev"===t,o=this._getItemIndex(e),r=this._items.length-1;if((i&&0===o||n&&o===r)&&!this._config.wrap)return e;var s=(o+("prev"===t?-1:1))%this._items.length;return-1===s?this._items[this._items.length-1]:this._items[s]},n._triggerSlideEvent=function(t,n){var i=this._getItemIndex(t),o=this._getItemIndex(this._element.querySelector(".active.carousel-item")),r=e.Event("slide.bs.carousel",{relatedTarget:t,direction:n,from:o,to:i});return e(this._element).trigger(r),r},n._setActiveIndicatorElement=function(t){if(this._indicatorsElement){var n=[].slice.call(this._indicatorsElement.querySelectorAll(".active"));e(n).removeClass("active");var i=this._indicatorsElement.children[this._getItemIndex(t)];i&&e(i).addClass("active")}},n._slide=function(t,n){var i,o,r,s=this,a=this._element.querySelector(".active.carousel-item"),c=this._getItemIndex(a),u=n||a&&this._getItemByDirection(t,a),h=this._getItemIndex(u),f=B
8oolean(this._interval);if("next"===t?(i="carousel-item-left",o="carousel-item-next",r="left"):(i="carousel-item-right",o="carousel-item-prev",r="right"),u&&e(u).hasClass("active"))this._isSliding=!1;else if(!this._triggerSlideEvent(u,r).isDefaultPrevented()&&a&&u){this._isSliding=!0,f&&this.pause(),this._setActiveIndicatorElement(u);var d=e.Event("slid.bs.carousel",{relatedTarget:u,direction:r,from:c,to:h});if(e(this._element).hasClass("slide")){e(u).addClass(o),l.reflow(u),e(a).addClass(i),e(u).addClass(i);var p=parseInt(u.getAttribute("data-interval"),10);p?(this._config.defaultInterval=this._config.defaultInterval||this._config.interval,this._config.interval=p):this._config.interval=this._config.defaultInterval||this._config.interval;var m=l.getTransitionDurationFromElement(a);e(a).one(l.TRANSITION_END,(function(){e(u).removeClass(i+" "+o).addClass("active"),e(a).removeClass("active "+o+" "+i),s._isSliding=!1,setTimeout((function(){return e(s._element).trigger(d)}),0)})).emulateTransitionEnd(m)}else e(a).removeClass("active"),e(u).addClass("active"),this._isSliding=!1,e(this._element).trigger(d);f&&this.cycle()}},t._jQueryInterface=function(n){return this.each((function(){var i=e(this).data("bs.carousel"),o=s(s({},v),e(this).data());"object"==typeof n&&(o=s(s({},o),n));var r="string"==typeof n?n:o.slide;if(i||(i=new t(this,o),e(this).data("bs.carousel",i)),"number"==typeof n)i.to(n);else if("string"==typeof r){if("undefined"==typeof i[r])throw new TypeError('No method named "'+r+'"');i[r]()}else o.interval&&o.ride&&(i.pause(),i.cycle())}))},t._dataApiClickHandler=function(n){var i=l.getSelectorFromElement(this);if(i){var o=e(i)[0];if(o&&e(o).hasClass("carousel")){var r=s(s({},e(o).data()),e(this).data()),a=this.getAttribute("data-slide-to");a&&(r.interval=!1),t._jQueryInterface.call(e(o),r),a&&e(o).data("bs.carousel").to(a),n.preventDefault()}}},i(t,null,[{key:"VERSION",get:function(){return"4.5.0"}},{key:"Default",get:function(){return v}}]),t}();e(document).on("click.bs.carousel.data-api","[data-slide], [data-slide-to]",y._dataApiClickHandler),e(window).on("load.bs.carousel.data-api",(function(){for(var t=[].slice.call(document.querySelectorAll('[data-ride="carousel"]')),n=0,i=t.length;n<i;n++){var o=e(t[n]);y._jQueryInterface.call(o,o.data())}})),e.fn[p]=y._jQueryInterface,e.fn[p].Constructor=y,e.fn[p].noConflict=function(){return e.fn[p]=g,y._jQueryInterface};var w="collapse",E=e.fn[w],T={toggle:!0,parent:""},C={toggle:"boolean",parent:"(string|element)"},S=function(){function t(t,e){this._isTransitioning=!1,this._element=t,this._config=this._getConfig(e),this._triggerArray=[].slice.call(document.querySelectorAll('[data-toggle="collapse"][href="#'+t.id+'"],[data-toggle="collapse"][data-target="#'+t.id+'"]'));for(var n=[].slice.call(document.querySelectorAll('[data-toggle="collapse"]')),i=0,o=n.length;i<o;i++){var r=n[i],s=l.getSelectorFromElement(r),a=[].slice.call(document.querySelectorAll(s)).filter((function(e){return e===t}));null!==s&&a.length>0&&(this._selector=s,this._triggerArray.push(r))}this._parent=this._config.parent?this._getParent():null,this._config.parent||this._addAriaAndCollapsedClass(this._element,this._triggerArray),this._config.toggle&&this.toggle()}var n=t.prototype;return n.toggle=function(){e(this._element).hasClass("show")?this.hide():this.show()},n.show=function(){var n,i,o=this;if(!this._isTransitioning&&!e(this._element).hasClass("show")&&(this._parent&&0===(n=[].slice.call(this._parent.querySelectorAll(".show, .collapsing")).filter((function(t){return"string"==typeof o._config.parent?t.getAttribute("data-parent")===o._config.parent:t.classList.contains("collapse")}))).length&&(n=null),!(n&&(i=e(n).not(this._selector).data("bs.collapse"))&&i._isTransitioning))){var r=e.Event("show.bs.collapse");if(e(this._element).trigger(r),!r.isDefaultPrevented()){n&&(t._jQueryInterface.call(e(n).not(this._selector),"hide"),i||e(n).data("bs.collapse",null));var s=this._getDimension();e(this._element).removeClass("collapse").addClass("collapsing"),this._element.style[s]=0,this._triggerArray.length&&e(this._triggerArray).removeClass("collapsed").attr("aria-expanded",!0),this.setTransitioning(!0);var a="scroll"+(s[0].toUpperCase()+s.slice(1)),c=l.getTransitionDurationFromElement(this._element);e(this._element).one(l.TRANSITION_END,(function(){e(o._element).removeClass("collapsing").addClass("collapse show"),o._element.style[s]="",o.setTransitioning(!1),e(o._element).trigger("shown.bs.collapse")})).emulateTransitionEnd(c),this._element.style[s]=this._element[a]+"px"}}},n.hide=function(){var t=this;if(!this._isTransitioning&&e(this._element).hasClass("show")){var n=e.Event("hide.bs.collapse");if(e(this._element).trigger(n),!n.isDefaultPrevented()){var i=this._getDimension();this._element.style[i]=this._element.getBoundingClientRect()[i]+"px",l.reflow(this._element),e(this._element).addClass("collapsing").removeClass("collapse show");var o=this._triggerArray.length;if(o>0)for(var r=0;r<o;r++){var s=this._triggerArray[r],a=l.getSelectorFromElement(s);if(null!==a)e([].slice.call(document.querySelectorAll(a))).hasClass("show")||e(s).addClass("collapsed").attr("aria-expanded",!1)}this.setTransitioning(!0);this._element.style[i]="";var c=l.getTransitionDurationFromElement(this._element);e(this._element).one(l.TRANSITION_END,(function(){t.setTransitioning(!1),e(t._element).removeClass("collapsing").addClass("collapse").trigger("hidden.bs.collapse")})).emulateTransitionEnd(c)}}},n.setTransitioning=function(t){this._isTransitioning=t}
vendor: 12,094 bytes, line 8
8,n.dispose=function(){e.removeData(this._element,"bs.collapse"),this._config=null,this._parent=null,this._element=null,this._triggerArray=null,this._isTransitioning=null},n._getConfig=function(t){return(t=s(s({},T),t)).toggle=Boolean(t.toggle),l.typeCheckConfig(w,t,C),t},n._getDimension=function(){return e(this._element).hasClass("width")?"width":"height"},n._getParent=function(){var n,i=this;l.isElement(this._config.parent)?(n=this._config.parent,"undefined"!=typeof this._config.parent.jquery&&(n=this._config.parent[0])):n=document.querySelector(this._config.parent);var o='[data-toggle="collapse"][data-parent="'+this._config.parent+'"]',r=[].slice.call(n.querySelectorAll(o));return e(r).each((function(e,n){i._addAriaAndCollapsedClass(t._getTargetFromElement(n),[n])})),n},n._addAriaAndCollapsedClass=function(t,n){var i=e(t).hasClass("show");n.length&&e(n).toggleClass("collapsed",!i).attr("aria-expanded",i)},t._getTargetFromElement=function(t){var e=l.getSelectorFromElement(t);return e?document.querySelector(e):null},t._jQueryInterface=function(n){return this.each((function(){var i=e(this),o=i.data("bs.collapse"),r=s(s(s({},T),i.data()),"object"==typeof n&&n?n:{});if(!o&&r.toggle&&"string"==typeof n&&/show|hide/.test(n)&&(r.toggle=!1),o||(o=new t(this,r),i.data("bs.collapse",o)),"string"==typeof n){if("undefined"==typeof o[n])throw new TypeError('No method named "'+n+'"');o[n]()}}))},i(t,null,[{key:"VERSION",get:function(){return"4.5.0"}},{key:"Default",get:function(){return T}}]),t}();e(document).on("click.bs.collapse.data-api",'[data-toggle="collapse"]',(function(t){"A"===t.currentTarget.tagName&&t.preventDefault();var n=e(this),i=l.getSelectorFromElement(this),o=[].slice.call(document.querySelectorAll(i));e(o).each((function(){var t=e(this),i=t.data("bs.collapse")?"toggle":n.data();S._jQueryInterface.call(t,i)}))})),e.fn[w]=S._jQueryInterface,e.fn[w].Constructor=S,e.fn[w].noConflict=function(){return e.fn[w]=E,S._jQueryInterface};var D="undefined"!=typeof window&&"undefined"!=typeof document&&"undefined"!=typeof navigator,k=function(){for(var t=["Edge","Trident","Firefox"],e=0;e<t.length;e+=1)if(D&&navigator.userAgent.indexOf(t[e])>=0)return 1;return 0}();var N=D&&window.Promise?function(t){var e=!1;return function(){e||(e=!0,window.Promise.resolve().then((function(){e=!1,t()})))}}:function(t){var e=!1;return function(){e||(e=!0,setTimeout((function(){e=!1,t()}),k))}};function O(t){return t&&"[object Function]"==={}.toString.call(t)}function A(t,e){if(1!==t.nodeType)return[];var n=t.ownerDocument.defaultView.getComputedStyle(t,null);return e?n[e]:n}function I(t){return"HTML"===t.nodeName?t:t.parentNode||t.host}function x(t){if(!t)return document.body;switch(t.nodeName){case"HTML":case"BODY":return t.ownerDocument.body;case"#document":return t.body}var e=A(t),n=e.overflow,i=e.overflowX,o=e.overflowY;return/(auto|scroll|overlay)/.test(n+o+i)?t:x(I(t))}function j(t){return t&&t.referenceNode?t.referenceNode:t}var L=D&&!(!window.MSInputMethodContext||!document.documentMode),P=D&&/MSIE 10/.test(navigator.userAgent);function F(t){return 11===t?L:10===t?P:L||P}function R(t){if(!t)return document.documentElement;for(var e=F(10)?document.body:null,n=t.offsetParent||null;n===e&&t.nextElementSibling;)n=(t=t.nextElementSibling).offsetParent;var i=n&&n.nodeName;return i&&"BODY"!==i&&"HTML"!==i?-1!==["TH","TD","TABLE"].indexOf(n.nodeName)&&"static"===A(n,"position")?R(n):n:t?t.ownerDocument.documentElement:document.documentElement}function M(t){return null!==t.parentNode?M(t.parentNode):t}function B(t,e){if(!(t&&t.nodeType&&e&&e.nodeType))return document.documentElement;var n=t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_FOLLOWING,i=n?t:e,o=n?e:t,r=document.createRange();r.setStart(i,0),r.setEnd(o,0);var s,a,l=r.commonAncestorContainer;if(t!==l&&e!==l||i.contains(o))return"BODY"===(a=(s=l).nodeName)||"HTML"!==a&&R(s.firstElementChild)!==s?R(l):l;var c=M(t);return c.host?B(c.host,e):B(t,M(e).host)}function q(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"top",n="top"===e?"scrollTop":"scrollLeft",i=t.nodeName;if("BODY"===i||"HTML"===i){var o=t.ownerDocument.documentElement,r=t.ownerDocument.scrollingElement||o;return r[n]}return t[n]}function H(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=q(e,"top"),o=q(e,"left"),r=n?-1:1;return t.top+=i*r,t.bottom+=i*r,t.left+=o*r,t.right+=o*r,t}function Q(t,e){var n="x"===e?"Left":"Top",i="Left"===n?"Right":"Bottom";return parseFloat(t["border"+n+"Width"],10)+parseFloat(t["border"+i+"Width"],10)}function W(t,e,n,i){return Math.max(e["offset"+t],e["scroll"+t],n["client"+t],n["offset"+t],n["scroll"+t],F(10)?parseInt(n["offset"+t])+parseInt(i["margin"+("Height"===t?"Top":"Left")])+parseInt(i["margin"+("Height"===t?"Bottom":"Right")]):0)}function U(t){var e=t.body,n=t.documentElement,i=F(10)&&getComputedStyle(n);return{height:W("Height",e,n,i),width:W("Width",e,n,i)}}var V=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},Y=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),z=function(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t},X=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t};function K(t){return X({},t,{right:t.left+t.width,bottom:t.top+t.height})}function G(t){var e={};try{if(F(10)){e=t.getBoundingClientRect();var n=q(t,"top"),i=q(t,"left");e.top+=n,e.left+=i,e.bottom+=n,e.right+=i}else e=t.getBoundingClientRect()}catch(t){}var o={left:e.left,top:e.top,width:e.right-e.left,height:e.bottom-e.top},r="HTML"===t.nodeName?U(t.ownerDocument):{},s=r.width||t.clientWidth||o.width,a=r.height||t.clientHeight||o.height,l=t.offsetWidth-s,c=t.offsetHeight-a;if(l||c){var u=A(t);l-=Q(u,"x"),c-=Q(u,"y"),o.width-=l,o.height-=c}return K(o)}function $(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=F(10),o="HTML"===e.nodeName,r=G(t),s=G(e),a=x(t),l=A(e),c=parseFloat(l.borderTopWidth,10),u=parseFloat(l.borderLeftWidth,10);n&&o&&(s.top=Math.max(s.top,0),s.left=Math.max(s.left,0));var h=K({top:r.top-s.top-c,left:r.left-s.left-u,width:r.width,height:r.height});if(h.marginTop=0,h.marginLeft=0,!i&&o){var f=parseFloat(l.marginTop,10),d=parseFloat(l.marginLeft,10);h.top-=c-f,h.bottom-=c-f,h.left-=u-d,h.right-=u-d,h.marginTop=f,h.marginLeft=d}return(i&&!n?e.contains(a):e===a&&"BODY"!==a.nodeName)&&(h=H(h,e)),h}function J(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=t.ownerDocument.documentElement,i=$(t,n),o=Math.max(n.clientWidth,window.innerWidth||0),r=Math.max(n.clientHeight,window.innerHeight||0),s=e?0:q(n),a=e?0:q(n,"left"),l={top:s-i.top+i.marginTop,left:a-i.left+i.marginLeft,width:o,height:r};return K(l)}function Z(t){var e=t.nodeName;if("BODY"===e||"HTML"===e)return!1;if("fixed"===A(t,"position"))return!0;var n=I(t);return!!n&&Z(n)}function tt(t){if(!t||!t.parentElement||F())return document.documentElement;for(var e=t.parentElement;e&&"none"===A(e,"transform");)e=e.parentElement;return e||document.documentElement}function et(t,e,n,i){var o=arguments.length>4&&void 0!==arguments[4]&&arguments[4],r={top:0,left:0},s=o?tt(t):B(t,j(e));if("viewport"===i)r=J(s,o);else{var a=void 0;"scrollParent"===i?"BODY"===(a=x(I(e))).nodeName&&(a=t.ownerDocument.documentElement):a="window"===i?t.ownerDocument.documentElement:i;var l=$(a,s,o);if("HTML"!==a.nodeName||Z(s))r=l;else{var c=U(t.ownerDocument),u=c.height,h=c.width;r.top+=l.top-l.marginTop,r.bottom=u+l.top,r.left+=l.left-l.marginLeft,r.right=h+l.left}}var f="number"==typeof(n=n||0);return r.left+=f?n:n.left||0,r.top+=f?n:n.top||0,r.right-=f?n:n.right||0,r.bottom-=f?n:n.bottom||0,r}function nt(t){return t.width*t.height}function it(t,e,n,i,o){var r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;if(-1===t.indexOf("auto"))return t;var s=et(n,i,r,o),a={top:{width:s.width,height:e.top-s.top},right:{width:s.right-e.right,height:s.height},bottom:{width:s.width,height:s.bottom-e.bottom},left:{width:e.left-s.left,height:s.height}},l=Object.keys(a).map((function(t){return X({key:t},a[t],{area:nt(a[t])})})).sort((function(t,e){return e.area-t.area})),c=l.filter((function(t){var e=t.width,i=t.height;return e>=n.clientWidth&&i>=n.clientHeight})),u=c.length>0?c[0].key:l[0].key,h=t.split("-")[1];return u+(h?"-"+h:"")}function ot(t,e,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,o=i?tt(e):B(e,j(n));return $(n,o,i)}function rt(t){var e=t.ownerDocument.defaultView.getComputedStyle(t),n=parseFloat(e.marginTop||0)+parseFloat(e.marginBottom||0),i=parseFloat(e.marginLeft||0)+parseFloat(e.marginRight||0);return{width:t.offsetWidth+i,height:t.offsetHeight+n}}function st(t){var e={left:"right",right:"left",bottom:"top",top:"bottom"};return t.replace(/left|right|bottom|top/g,(function(t){return e[t]}))}function at(t,e,n){n=n.split("-")[0];var i=rt(t),o={width:i.width,height:i.height},r=-1!==["right","left"].indexOf(n),s=r?"top":"left",a=r?"left":"top",l=r?"height":"width",c=r?"width":"height";return o[s]=e[s]+e[l]/2-i[l]/2,o[a]=n===a?e[a]-i[c]:e[st(a)],o}function lt(t,e){return Array.prototype.find?t.find(e):t.filter(e)[0]}function ct(t,e,n){return(void 0===n?t:t.slice(0,function(t,e,n){if(Array.prototype.findIndex)return t.findIndex((function(t){return t[e]===n}));var i=lt(t,(function(t){return t[e]===n}));return t.indexOf(i)}(t,"name",n))).forEach((function(t){t.function&&console.warn("`modifier.function` is deprecated, use `modifier.fn`!");var n=t.function||t.fn;t.enabled&&O(n)&&(e.offsets.popper=K(e.offsets.popper),e.offsets.reference=K(e.offsets.reference),e=n(e,t))})),e}function ut(){if(!this.state.isDestroyed){var t={instance:this,styles:{},arrowStyles:{},attributes:{},flipped:!1,offsets:{}};t.offsets.reference=ot(this.state,this.popper,this.reference,this.options.positionFixed),t.placement=it(this.options.placement,t.offsets.reference,this.popper,this.reference,this.options.modifiers.flip.boundariesElement,this.options.modifiers.flip.padding),t.originalPlacement=t.placement,t.positionFixed=this.options.positionFixed,t.offsets.popper=at(this.popper,t.offsets.reference,t.placement),t.offsets.popper.position=this.options.positionFixed?"fixed":"absolute",t=ct(this.modifiers,t),this.state.isCreated?this.options.onUpdate(t):(this.state.isCreated=!0,this.options.onCreate(t))}}function ht(t,e){return t.some((function(t){var n=t.name;return t.enabled&&n===e}))}function ft(t){for(var e=[!1,"ms","Webkit","Moz","O"],n=t.charAt(0).toUpperCase()+t.slice(1),i=0;i<e.length;i++){var o=e[i],r=o?""+o+n:t;if("undefined"!=typeof document.body.style[r])return r}return null}function dt(){return this.state.isDestroyed=!0,ht(this.modifiers,"applyStyle")&&(this.popper.removeAttribute("x-placement"),this.popper.style.position="",this.popper.style.top="",this.popper.style.left="",this.popper.style.right="",this.popper.style.bottom="",this.popper.style.willChange="",this.popper.style[ft("transform")]=""),this.disableEventListeners(),this.options.removeOnDestroy&&this.popper.parentNode.removeChild(this.popper),this}function pt(t){var e=t.ownerDocument;return e?e.defaultView:window}function mt(t,e,n,i){n.updateBound=i,pt(t).addEventListener("resize",n.updateBound,{passive:!0});var o=x(t);return function t(e,n,i,o){var r="BODY"===e.nodeName,s=r?e.ownerDocument.defaultView:e;s.addEventListener(n,i,{passive:!0}),r||t(x(s.parentNode),n,i,o),o.push(s)}(o,"scroll",n.updateBound,n.scrollParents),n.scrollElement=o,n.eventsEnabled=!0,n}function gt(){this.state.eventsEnabled||(this.state=mt(this.reference,this.options,this.state,this.scheduleUpdate))}function vt(){var t,e;this.state.eventsEnabled&&(cancelAnimationFrame(this.scheduleUpdate),this.state=(t=this.reference,e=this.state,pt(t).removeEventListener("resize",e.updateBound),e.scrollParents.forEac
vendor: 4,098 bytes, line 8
8h((function(t){t.removeEventListener("scroll",e.updateBound)})),e.updateBound=null,e.scrollParents=[],e.scrollElement=null,e.eventsEnabled=!1,e))}function _t(t){return""!==t&&!isNaN(parseFloat(t))&&isFinite(t)}function bt(t,e){Object.keys(e).forEach((function(n){var i="";-1!==["width","height","top","right","bottom","left"].indexOf(n)&&_t(e[n])&&(i="px"),t.style[n]=e[n]+i}))}var yt=D&&/Firefox/i.test(navigator.userAgent);function wt(t,e,n){var i=lt(t,(function(t){return t.name===e})),o=!!i&&t.some((function(t){return t.name===n&&t.enabled&&t.order<i.order}));if(!o){var r="`"+e+"`",s="`"+n+"`";console.warn(s+" modifier is required by "+r+" modifier in order to work, be sure to include it before "+r+"!")}return o}var Et=["auto-start","auto","auto-end","top-start","top","top-end","right-start","right","right-end","bottom-end","bottom","bottom-start","left-end","left","left-start"],Tt=Et.slice(3);function Ct(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=Tt.indexOf(t),i=Tt.slice(n+1).concat(Tt.slice(0,n));return e?i.reverse():i}var St="flip",Dt="clockwise",kt="counterclockwise";function Nt(t,e,n,i){var o=[0,0],r=-1!==["right","left"].indexOf(i),s=t.split(/(\+|\-)/).map((function(t){return t.trim()})),a=s.indexOf(lt(s,(function(t){return-1!==t.search(/,|\s/)})));s[a]&&-1===s[a].indexOf(",")&&console.warn("Offsets separated by white space(s) are deprecated, use a comma (,) instead.");var l=/\s*,\s*|\s+/,c=-1!==a?[s.slice(0,a).concat([s[a].split(l)[0]]),[s[a].split(l)[1]].concat(s.slice(a+1))]:[s];return(c=c.map((function(t,i){var o=(1===i?!r:r)?"height":"width",s=!1;return t.reduce((function(t,e){return""===t[t.length-1]&&-1!==["+","-"].indexOf(e)?(t[t.length-1]=e,s=!0,t):s?(t[t.length-1]+=e,s=!1,t):t.concat(e)}),[]).map((function(t){return function(t,e,n,i){var o=t.match(/((?:\-|\+)?\d*\.?\d*)(.*)/),r=+o[1],s=o[2];if(!r)return t;if(0===s.indexOf("%")){var a=void 0;switch(s){case"%p":a=n;break;case"%":case"%r":default:a=i}return K(a)[e]/100*r}if("vh"===s||"vw"===s){return("vh"===s?Math.max(document.documentElement.clientHeight,window.innerHeight||0):Math.max(document.documentElement.clientWidth,window.innerWidth||0))/100*r}return r}(t,o,e,n)}))}))).forEach((function(t,e){t.forEach((function(n,i){_t(n)&&(o[e]+=n*("-"===t[i-1]?-1:1))}))})),o}var Ot={placement:"bottom",positionFixed:!1,eventsEnabled:!0,removeOnDestroy:!1,onCreate:function(){},onUpdate:function(){},modifiers:{shift:{order:100,enabled:!0,fn:function(t){var e=t.placement,n=e.split("-")[0],i=e.split("-")[1];if(i){var o=t.offsets,r=o.reference,s=o.popper,a=-1!==["bottom","top"].indexOf(n),l=a?"left":"top",c=a?"width":"height",u={start:z({},l,r[l]),end:z({},l,r[l]+r[c]-s[c])};t.offsets.popper=X({},s,u[i])}return t}},offset:{order:200,enabled:!0,fn:function(t,e){var n=e.offset,i=t.placement,o=t.offsets,r=o.popper,s=o.reference,a=i.split("-")[0],l=void 0;return l=_t(+n)?[+n,0]:Nt(n,r,s,a),"left"===a?(r.top+=l[0],r.left-=l[1]):"right"===a?(r.top+=l[0],r.left+=l[1]):"top"===a?(r.left+=l[0],r.top-=l[1]):"bottom"===a&&(r.left+=l[0],r.top+=l[1]),t.popper=r,t},offset:0},preventOverflow:{order:300,enabled:!0,fn:function(t,e){var n=e.boundariesElement||R(t.instance.popper);t.instance.reference===n&&(n=R(n));var i=ft("transform"),o=t.instance.popper.style,r=o.top,s=o.left,a=o[i];o.top="",o.left="",o[i]="";var l=et(t.instance.popper,t.instance.reference,e.padding,n,t.positionFixed);o.top=r,o.left=s,o[i]=a,e.boundaries=l;var c=e.priority,u=t.offsets.popper,h={primary:function(t){var n=u[t];return u[t]<l[t]&&!e.escapeWithReference&&(n=Math.max(u[t],l[t])),z({},t,n)},secondary:function(t){var n="right"===t?"left":"top",i=u[n];return u[t]>l[t]&&!e.escapeWithReference&&(i=Math.min(u[n],l[t]-("right"===t?u.width:u.height))),z({},n,i)}};return c.forEach((function(t){var e=-1!==["left","top"].indexOf(t)?"primary":"secondary";u=X({},u,h[e](t))})),t.offsets.popper=u,t},priority:["left","right","top","bottom"],padding:5,boundariesElement:"scrollParent"},keepTogether:{order:400,enabled:!0,fn:function(t){var e=t.offsets,n=e.popper,i=e.reference,o=t.placement.split("-")[0],r=M
vendor: 4,146 bytes, line 8
8ath.floor,s=-1!==["top","bottom"].indexOf(o),a=s?"right":"bottom",l=s?"left":"top",c=s?"width":"height";return n[a]<r(i[l])&&(t.offsets.popper[l]=r(i[l])-n[c]),n[l]>r(i[a])&&(t.offsets.popper[l]=r(i[a])),t}},arrow:{order:500,enabled:!0,fn:function(t,e){var n;if(!wt(t.instance.modifiers,"arrow","keepTogether"))return t;var i=e.element;if("string"==typeof i){if(!(i=t.instance.popper.querySelector(i)))return t}else if(!t.instance.popper.contains(i))return console.warn("WARNING: `arrow.element` must be child of its popper element!"),t;var o=t.placement.split("-")[0],r=t.offsets,s=r.popper,a=r.reference,l=-1!==["left","right"].indexOf(o),c=l?"height":"width",u=l?"Top":"Left",h=u.toLowerCase(),f=l?"left":"top",d=l?"bottom":"right",p=rt(i)[c];a[d]-p<s[h]&&(t.offsets.popper[h]-=s[h]-(a[d]-p)),a[h]+p>s[d]&&(t.offsets.popper[h]+=a[h]+p-s[d]),t.offsets.popper=K(t.offsets.popper);var m=a[h]+a[c]/2-p/2,g=A(t.instance.popper),v=parseFloat(g["margin"+u],10),_=parseFloat(g["border"+u+"Width"],10),b=m-t.offsets.popper[h]-v-_;return b=Math.max(Math.min(s[c]-p,b),0),t.arrowElement=i,t.offsets.arrow=(z(n={},h,Math.round(b)),z(n,f,""),n),t},element:"[x-arrow]"},flip:{order:600,enabled:!0,fn:function(t,e){if(ht(t.instance.modifiers,"inner"))return t;if(t.flipped&&t.placement===t.originalPlacement)return t;var n=et(t.instance.popper,t.instance.reference,e.padding,e.boundariesElement,t.positionFixed),i=t.placement.split("-")[0],o=st(i),r=t.placement.split("-")[1]||"",s=[];switch(e.behavior){case St:s=[i,o];break;case Dt:s=Ct(i);break;case kt:s=Ct(i,!0);break;default:s=e.behavior}return s.forEach((function(a,l){if(i!==a||s.length===l+1)return t;i=t.placement.split("-")[0],o=st(i);var c=t.offsets.popper,u=t.offsets.reference,h=Math.floor,f="left"===i&&h(c.right)>h(u.left)||"right"===i&&h(c.left)<h(u.right)||"top"===i&&h(c.bottom)>h(u.top)||"bottom"===i&&h(c.top)<h(u.bottom),d=h(c.left)<h(n.left),p=h(c.right)>h(n.right),m=h(c.top)<h(n.top),g=h(c.bottom)>h(n.bottom),v="left"===i&&d||"right"===i&&p||"top"===i&&m||"bottom"===i&&g,_=-1!==["top","bottom"].indexOf(i),b=!!e.flipVariations&&(_&&"start"===r&&d||_&&"end"===r&&p||!_&&"start"===r&&m||!_&&"end"===r&&g),y=!!e.flipVariationsByContent&&(_&&"start"===r&&p||_&&"end"===r&&d||!_&&"start"===r&&g||!_&&"end"===r&&m),w=b||y;(f||v||w)&&(t.flipped=!0,(f||v)&&(i=s[l+1]),w&&(r=function(t){return"end"===t?"start":"start"===t?"end":t}(r)),t.placement=i+(r?"-"+r:""),t.offsets.popper=X({},t.offsets.popper,at(t.instance.popper,t.offsets.reference,t.placement)),t=ct(t.instance.modifiers,t,"flip"))})),t},behavior:"flip",padding:5,boundariesElement:"viewport",flipVariations:!1,flipVariationsByContent:!1},inner:{order:700,enabled:!1,fn:function(t){var e=t.placement,n=e.split("-")[0],i=t.offsets,o=i.popper,r=i.reference,s=-1!==["left","right"].indexOf(n),a=-1===["top","left"].indexOf(n);return o[s?"left":"top"]=r[n]-(a?o[s?"width":"height"]:0),t.placement=st(e),t.offsets.popper=K(o),t}},hide:{order:800,enabled:!0,fn:function(t){if(!wt(t.instance.modifiers,"hide","preventOverflow"))return t;var e=t.offsets.reference,n=lt(t.instance.modifiers,(function(t){return"preventOverflow"===t.name})).boundaries;if(e.bottom<n.top||e.left>n.right||e.top>n.bottom||e.right<n.left){if(!0===t.hide)return t;t.hide=!0,t.attributes["x-out-of-boundaries"]=""}else{if(!1===t.hide)return t;t.hide=!1,t.attributes["x-out-of-boundaries"]=!1}return t}},computeStyle:{order:850,enabled:!0,fn:function(t,e){var n=e.x,i=e.y,o=t.offsets.popper,r=lt(t.instance.modifiers,(function(t){return"applyStyle"===t.name})).gpuAcceleration;void 0!==r&&console.warn("WARNING: `gpuAcceleration` option moved to `computeStyle` modifier and will not be supported in future versions of Popper.js!");var s=void 0!==r?r:e.gpuAcceleration,a=R(t.instance.popper),l=G(a),c={position:o.position},u=function(t,e){var n=t.offsets,i=n.popper,o=n.reference,r=Math.round,s=Math.floor,a=function(t){return t},l=r(o.width),c=r(i.width),u=-1!==["left","right"].indexOf(t.placement),h=-1!==t.placement.indexOf("-"),f=e?u||h||l%2==c%2?r:s:a,d=e?r:a;return{left:f(l%2==1&&c%2==1&&!h&&e?i.left-1:i.left),top:d(i.top),bottom:d(i.bottom),right:f(i.r
8ight)}}(t,window.devicePixelRatio<2||!yt),h="bottom"===n?"top":"bottom",f="right"===i?"left":"right",d=ft("transform"),p=void 0,m=void 0;if(m="bottom"===h?"HTML"===a.nodeName?-a.clientHeight+u.bottom:-l.height+u.bottom:u.top,p="right"===f?"HTML"===a.nodeName?-a.clientWidth+u.right:-l.width+u.right:u.left,s&&d)c[d]="translate3d("+p+"px, "+m+"px, 0)",c[h]=0,c[f]=0,c.willChange="transform";else{var g="bottom"===h?-1:1,v="right"===f?-1:1;c[h]=m*g,c[f]=p*v,c.willChange=h+", "+f}var _={"x-placement":t.placement};return t.attributes=X({},_,t.attributes),t.styles=X({},c,t.styles),t.arrowStyles=X({},t.offsets.arrow,t.arrowStyles),t},gpuAcceleration:!0,x:"bottom",y:"right"},applyStyle:{order:900,enabled:!0,fn:function(t){var e,n;return bt(t.instance.popper,t.styles),e=t.instance.popper,n=t.attributes,Object.keys(n).forEach((function(t){!1!==n[t]?e.setAttribute(t,n[t]):e.removeAttribute(t)})),t.arrowElement&&Object.keys(t.arrowStyles).length&&bt(t.arrowElement,t.arrowStyles),t},onLoad:function(t,e,n,i,o){var r=ot(o,e,t,n.positionFixed),s=it(n.placement,r,e,t,n.modifiers.flip.boundariesElement,n.modifiers.flip.padding);return e.setAttribute("x-placement",s),bt(e,{position:n.positionFixed?"fixed":"absolute"}),n},gpuAcceleration:void 0}}},At=function(){function t(e,n){var i=this,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};V(this,t),this.scheduleUpdate=function(){return requestAnimationFrame(i.update)},this.update=N(this.update.bind(this)),this.options=X({},t.Defaults,o),this.state={isDestroyed:!1,isCreated:!1,scrollParents:[]},this.reference=e&&e.jquery?e[0]:e,this.popper=n&&n.jquery?n[0]:n,this.options.modifiers={},Object.keys(X({},t.Defaults.modifiers,o.modifiers)).forEach((function(e){i.options.modifiers[e]=X({},t.Defaults.modifiers[e]||{},o.modifiers?o.modifiers[e]:{})})),this.modifiers=Object.keys(this.options.modifiers).map((function(t){return X({name:t},i.options.modifiers[t])})).sort((function(t,e){return t.order-e.order})),this.modifiers.forEach((function(t){t.enabled&&O(t.onLoad)&&t.onLoad(i.reference,i.popper,i.options,t,i.state)})),this.update();var r=this.options.eventsEnabled;r&&this.enableEventListeners(),this.state.eventsEnabled=r}return Y(t,[{key:"update",value:function(){return ut.call(this)}},{key:"destroy",value:function(){return dt.call(this)}},{key:"enableEventListeners",value:function(){return gt.call(this)}},{key:"disableEventListeners",value:function(){return vt.call(this)}}]),t}();At.Utils=("undefined"!=typeof window?window:global).PopperUtils,At.placements=Et,At.Defaults=Ot;var It="dropdown",xt=e.fn[It],jt=new RegExp("38|40|27"),Lt={offset:0,flip:!0,boundary:"scrollParent",reference:"toggle",display:"dynamic",popperConfig:null},Pt={offset:"(number|string|function)",flip:"boolean",boundary:"(string|element)",reference:"(string|element)",display:"string",popperConfig:"(null|object)"},Ft=function(){function t(t,e){this._element=t,this._popper=null,this._config=this._getConfig(e),this._menu=this._getMenuElement(),this._inNavbar=this._detectNavbar(),this._addEventListeners()}var n=t.prototype;return n.toggle=function(){if(!this._element.disabled&&!e(this._element).hasClass("disabled")){var n=e(this._menu).hasClass("show");t._clearMenus(),n||this.show(!0)}},n.show=function(n){if(void 0===n&&(n=!1),!(this._element.disabled||e(this._element).hasClass("disabled")||e(this._menu).hasClass("show"))){var i={relatedTarget:this._element},o=e.Event("show.bs.dropdown",i),r=t._getParentFromElement(this._element);if(e(r).trigger(o),!o.isDefaultPrevented()){if(!this._inNavbar&&n){if("undefined"==typeof At)throw new TypeError("Bootstrap's dropdowns require Popper.js (https://popper.js.org/)");var s=this._element;"parent"===this._config.reference?s=r:l.isElement(this._config.reference)&&(s=this._config.reference,"undefined"!=typeof this._config.reference.jquery&&(s=this._config.reference[0])),"scrollParent"!==this._config.boundary&&e(r).addClass("position-static"),this._popper=new At(s,this._menu,this._getPopperConfig())}"ontouchstart"in document.documentElement&&0===e(r).closest(".navbar-nav").length&&e(document.body).children().on("mouseover",null,e.noop),this._element.focus(),this._element.setAttribute("aria-expanded",!0),e(this._menu).toggleClass("show"),e(r).toggleClass("show").trigger(e.Event("shown.bs.dropdown",i))}}},n.hide=function(){if(!this._element.disabled&&!e(this._element).hasClass("disabled")&&e(this._menu).hasClass("show")){var n={relatedTarget:this._element},i=e.Event("hide.bs.dropdown",n),o=t._getParentFromElement(this._element);e(o).trigger(i),i.isDefaultPrevented()||(this._popper&&this._popper.destroy(),e(this._menu).toggleClass("show"),e(o).toggleClass("show").trigger(e.Event("hidden.bs.dropdown",n)))}}
8,n.dispose=function(){e.removeData(this._element,"bs.dropdown"),e(this._element).off(".bs.dropdown"),this._element=null,this._menu=null,null!==this._popper&&(this._popper.destroy(),this._popper=null)},n.update=function(){this._inNavbar=this._detectNavbar(),null!==this._popper&&this._popper.scheduleUpdate()},n._addEventListeners=function(){var t=this;e(this._element).on("click.bs.dropdown",(function(e){e.preventDefault(),e.stopPropagation(),t.toggle()}))},n._getConfig=function(t){return t=s(s(s({},this.constructor.Default),e(this._element).data()),t),l.typeCheckConfig(It,t,this.constructor.DefaultType),t},n._getMenuElement=function(){if(!this._menu){var e=t._getParentFromElement(this._element);e&&(this._menu=e.querySelector(".dropdown-menu"))}return this._menu},n._getPlacement=function(){var t=e(this._element.parentNode),n="bottom-start";return t.hasClass("dropup")?n=e(this._menu).hasClass("dropdown-menu-right")?"top-end":"top-start":t.hasClass("dropright")?n="right-start":t.hasClass("dropleft")?n="left-start":e(this._menu).hasClass("dropdown-menu-right")&&(n="bottom-end"),n},n._detectNavbar=function(){return e(this._element).closest(".navbar").length>0},n._getOffset=function(){var t=this,e={};return"function"==typeof this._config.offset?e.fn=function(e){return e.offsets=s(s({},e.offsets),t._config.offset(e.offsets,t._element)||{}),e}:e.offset=this._config.offset,e},n._getPopperConfig=function(){var t={placement:this._getPlacement(),modifiers:{offset:this._getOffset(),flip:{enabled:this._config.flip},preventOverflow:{boundariesElement:this._config.boundary}}};return"static"===this._config.display&&(t.modifiers.applyStyle={enabled:!1}),s(s({},t),this._config.popperConfig)},t._jQueryInterface=function(n){return this.each((function(){var i=e(this).data("bs.dropdown");if(i||(i=new t(this,"object"==typeof n?n:null),e(this).data("bs.dropdown",i)),"string"==typeof n){if("undefined"==typeof i[n])throw new TypeError('No method named "'+n+'"');i[n]()}}))},t._clearMenus=function(n){if(!n||3!==n.which&&("keyup"!==n.type||9===n.which))for(var i=[].slice.call(document.querySelectorAll('[data-toggle="dropdown"]')),o=0,r=i.length;o<r;o++){var s=t._getParentFromElement(i[o]),a=e(i[o]).data("bs.dropdown"),l={relatedTarget:i[o]};if(n&&"click"===n.type&&(l.clickEvent=n),a){var c=a._menu;if(e(s).hasClass("show")&&!(n&&("click"===n.type&&/input|textarea/i.test(n.target.tagName)||"keyup"===n.type&&9===n.which)&&e.contains(s,n.target))){var u=e.Event("hide.bs.dropdown",l);e(s).trigger(u),u.isDefaultPrevented()||("ontouchstart"in document.documentElement&&e(document.body).children().off("mouseover",null,e.noop),i[o].setAttribute("aria-expanded","false"),a._popper&&a._popper.destroy(),e(c).removeClass("show"),e(s).removeClass("show").trigger(e.Event("hidden.bs.dropdown",l)))}}}},t._getParentFromElement=function(t){var e,n=l.getSelectorFromElement(t);return n&&(e=document.querySelector(n)),e||t.parentNode},t._dataApiKeydownHandler=function(n){if(!(/input|textarea/i.test(n.target.tagName)?32===n.which||27!==n.which&&(40!==n.which&&38!==n.which||e(n.target).closest(".dropdown-menu").length):!jt.test(n.which))&&!this.disabled&&!e(this).hasClass("disabled")){var i=t._getParentFromElement(this),o=e(i).hasClass("show");if(o||27!==n.which){if(n.preventDefault(),n.stopPropagation(),!o||o&&(27===n.which||32===n.which))return 27===n.which&&e(i.querySelector('[data-toggle="dropdown"]')).trigger("focus"),void e(this).trigger("click");var r=[].slice.call(i.querySelectorAll(".dropdown-menu .dropdown-item:not(.disabled):not(:disabled)")).filter((function(t){return e(t).is(":visible")}));if(0!==r.length){var s=r.indexOf(n.target);38===n.which&&s>0&&s--,40===n.which&&s<r.length-1&&s++,s<0&&(s=0),r[s].focus()}}}},i(t,null,[{key:"VERSION",get:function(){return"4.5.0"}},{key:"Default",get:function(){return Lt}},{key:"DefaultType",get:function(){return Pt}}]),t}();e(document).on("keydown.bs.dropdown.data-api",'[data-toggle="dropdown"]',Ft._dataApiKeydownHandler).on("keydown.bs.dropdown.data-api",".dropdown-menu",Ft._dataApiKeydownHandler).on("click.bs.dropdown.data-api keyup.bs.dropdown.data-api",Ft._clearMenus).on("click.bs.dropdown.data-api",'[data-toggle="dropdown"]',(function(t){t.preventDefault(),t.stopPropagation(),Ft._jQueryInterface.call(e(this),"toggle")})).on("click.bs.dropdown.data-api",".dropdown form",(function(t){t.stopPropagation()})),e.fn[It]=Ft._jQueryInterface,e.fn[It].Constructor=Ft,e.fn[It].noConflict=function(){return e.fn[It]=xt,Ft._jQueryInterface};var Rt=e.fn.modal,Mt={backdrop:!0,keyboard:!0,focus:!0,show:!0},Bt={backdrop:"(boolean|string)",keyboard:"boolean",focus:"boolean",show:"boolean"},qt=function(){function t(t,e){this._config=this._getConfig(e),this._element=t,this._dialog=t.querySelector(".modal-dialog"),this._backdrop=null,this._isShown=!1,this._isBodyOverflowing=!1,this._ignoreBackdropClick=!1,this._isTransitioning=!1,this._scrollbarWidth=0}var n=t.prototype;return n.toggle=function(t){return this._isShown?this.hide():this.show(t)},n.show=function(t){var n=this;if(!this._isShown&&!this._isTransitioning){e(this._element).hasClass("fade")&&(this._isTransitioning=!0);var i=e.Event("show.bs.modal",{relatedTarget:t});e(this._element).trigger(i),this._isShown||i.isDefaultPrevented()||(this._isShown=!0,this._checkScrollbar(),this._setScrollbar(),this._adjustDialog(),this._setEscapeEvent(),this._setResizeEvent(),e(this._element).on("click.dismiss.bs.modal",'[data-dismiss="modal"]',(function(t){return n.hide(t)})),e(this._dialog).on("mousedown.dismiss.bs.modal",(function(){e(n._element).one("mouseup.dismiss.bs.modal",(function(t){e(t.target).is(n._element)&&(n._ignoreBackdropClick=!0)}))})),this._showBackdrop((function(){return n._showElement(t)})))}},n.hide=function(t){var n=this;if(t&&t.preventDefault(),this._isShown&&!this._isTransitioning){var i=e.Event("hide.bs.modal");if(e(this._element).trigger(i),this._isShown&&!i.isDefaultPrevented()){this._isShown=!1;var o=e(this._element).hasClass("fade");if(o&&(this._isTransitioning=!0),this._setEscapeEvent(),this._setResizeEvent(),e(document).off("focusin.bs.modal"),e(this._element).removeClass("show"),e(this._element).off("
8click.dismiss.bs.modal"),e(this._dialog).off("mousedown.dismiss.bs.modal"),o){var r=l.getTransitionDurationFromElement(this._element);e(this._element).one(l.TRANSITION_END,(function(t){return n._hideModal(t)})).emulateTransitionEnd(r)}else this._hideModal()}}},n.dispose=function(){[window,this._element,this._dialog].forEach((function(t){return e(t).off(".bs.modal")})),e(document).off("focusin.bs.modal"),e.removeData(this._element,"bs.modal"),this._config=null,this._element=null,this._dialog=null,this._backdrop=null,this._isShown=null,this._isBodyOverflowing=null,this._ignoreBackdropClick=null,this._isTransitioning=null,this._scrollbarWidth=null},n.handleUpdate=function(){this._adjustDialog()},n._getConfig=function(t){return t=s(s({},Mt),t),l.typeCheckConfig("modal",t,Bt),t},n._triggerBackdropTransition=function(){var t=this;if("static"===this._config.backdrop){var n=e.Event("hidePrevented.bs.modal");if(e(this._element).trigger(n),n.defaultPrevented)return;this._element.classList.add("modal-static");var i=l.getTransitionDurationFromElement(this._element);e(this._element).one(l.TRANSITION_END,(function(){t._element.classList.remove("modal-static")})).emulateTransitionEnd(i),this._element.focus()}else this.hide()},n._showElement=function(t){var n=this,i=e(this._element).hasClass("fade"),o=this._dialog?this._dialog.querySelector(".modal-body"):null;this._element.parentNode&&this._element.parentNode.nodeType===Node.ELEMENT_NODE||document.body.appendChild(this._element),this._element.style.display="block",this._element.removeAttribute("aria-hidden"),this._element.setAttribute("aria-modal",!0),e(this._dialog).hasClass("modal-dialog-scrollable")&&o?o.scrollTop=0:this._element.scrollTop=0,i&&l.reflow(this._element),e(this._element).addClass("show"),this._config.focus&&this._enforceFocus();var r=e.Event("shown.bs.modal",{relatedTarget:t}),s=function(){n._config.focus&&n._element.focus(),n._isTransitioning=!1,e(n._element).trigger(r)};if(i){var a=l.getTransitionDurationFromElement(this._dialog);e(this._dialog).one(l.TRANSITION_END,s).emulateTransitionEnd(a)}else s()},n._enforceFocus=function(){var t=this;e(document).off("focusin.bs.modal").on("focusin.bs.modal",(function(n){document!==n.target&&t._element!==n.target&&0===e(t._element).has(n.target).length&&t._element.focus()}))},n._setEscapeEvent=function(){var t=this;this._isShown?e(this._element).on("keydown.dismiss.bs.modal",(function(e){t._config.keyboard&&27===e.which?(e.preventDefault(),t.hide()):t._config.keyboard||27!==e.which||t._triggerBackdropTransition()})):this._isShown||e(this._element).off("keydown.dismiss.bs.modal")},n._setResizeEvent=function(){var t=this;this._isShown?e(window).on("resize.bs.modal",(function(e){return t.handleUpdate(e)})):e(window).off("resize.bs.modal")},n._hideModal=function(){var t=this;this._element.style.display="none",this._element.setAttribute("aria-hidden",!0),this._element.removeAttribute("aria-modal"),this._isTransitioning=!1,this._showBackdrop((function(){e(document.body).removeClass("modal-open"),t._resetAdjustments(),t._resetScrollbar(),e(t._element).trigger("hidden.bs.modal")}))},n._removeBackdrop=function(){this._backdrop&&(e(this._backdrop).remove(),this._backdrop=null)},n._showBackdrop=function(t){var n=this,i=e(this._element).hasClass("fade")?"fade":"";if(this._isShown&&this._config.backdrop){if(this._backdrop=document.createElement("div"),this._backdrop.className="modal-backdrop",i&&this._backdrop.classList.add(i),e(this._backdrop).appendTo(document.body),e(this._element).on("click.dismiss.bs.modal",(function(t){n._ignoreBackdropClick?n._ignoreBackdropClick=!1:t.target===t.currentTarget&&n._triggerBackdropTransition()})),i&&l.reflow(this._backdrop),e(this._backdrop).addClass("show"),!t)return;if(!i)return void t();var o=l.getTransitionDurationFromElement(this._backdrop);e(this._backdrop).one(l.TRANSITION_END,t).emulateTransitionEnd(o)}else if(!this._isShown&&this._backdrop){e(this._backdrop).removeClass("show");var r=function(){n._removeBackdrop(),t&&t()};if(e(this._element).hasClass("fade")){var s=l.getTransitionDurationFromElement(this._backdrop);e(this._backdrop).one(l.TRANSITION_END,r).emulateTransitionEnd(s)}else r()}else t&&t()},n._adjustDialog=function(){var t=this._element.scrollHeight>document.documentElement.clientHeight;!this._isBodyOverflowing&&t&&(this._element.style.paddingLeft=this._scrollbarWidth+"px"),this._isBodyOverflowing&&!t&&(this._element.style.paddingRight=this._scrollbarWidth+"px")},n._resetAdjustments=function(){this._element.style.paddingLeft="",this._element.style.paddingRight=""},n._checkScrollbar=function(){var t=document.body.getBoundingClientRect();this._isBodyOverflowing=Math.round(t.left+t.right)<window.innerWidth,this._scrollbarWidth=this._getScrollbarWidth()},n._setScrollbar=function(){var t=this;if(this._isBodyOverflowing){var n=[].slice.call(document.querySelectorAll(".fixed-top, .fixed-bottom, .is-fixed, .sticky-top")),i=[].slice.call(document.querySelectorAll(".sticky-top"));e(n).each((function(n,i){var o=i.style.paddingRight,r=e(i).css("padding-right");e(i).data("padding-right",o).css("padding-right",parseFloat(r)+t._scrollbarWidth+"px")})),e(i).each((function(n,i){var o=i.style.marginRight,r=e(i).css("margin-right");e(i).data("margin-right",o).css("margin-right",parseFloat(r)-t._scrollbarWidth+"px")}));var o=document.body.style.paddingRight,r=e(document.body).css("padding-right");e(document.body).data("padding-right",o).css("padding-right",parseFloat(r)+this._scrollbarWidth+"px")}e(document.body).addClass("modal-open")},n._resetScrollbar=function(){var t=[].slice.call(document.querySelectorAll(".fixed-top, .fixed-bottom, .is-fixed, .sticky-top"));e(t).each((function(t,n){var i=e(n).data("padding-right");e(n).removeData("padding-right"),n.style.paddingRight=i||""}));var n=[].slice.call(document.querySelectorAll(".sticky-top"));e(n).each((function(t,n){var i=e(n).data("margin-right");"undefined"!=typeof i&&e(n).css("margin-right",i).removeData("margin-right")}));
8var i=e(document.body).data("padding-right");e(document.body).removeData("padding-right"),document.body.style.paddingRight=i||""},n._getScrollbarWidth=function(){var t=document.createElement("div");t.className="modal-scrollbar-measure",document.body.appendChild(t);var e=t.getBoundingClientRect().width-t.clientWidth;return document.body.removeChild(t),e},t._jQueryInterface=function(n,i){return this.each((function(){var o=e(this).data("bs.modal"),r=s(s(s({},Mt),e(this).data()),"object"==typeof n&&n?n:{});if(o||(o=new t(this,r),e(this).data("bs.modal",o)),"string"==typeof n){if("undefined"==typeof o[n])throw new TypeError('No method named "'+n+'"');o[n](i)}else r.show&&o.show(i)}))},i(t,null,[{key:"VERSION",get:function(){return"4.5.0"}},{key:"Default",get:function(){return Mt}}]),t}();e(document).on("click.bs.modal.data-api",'[data-toggle="modal"]',(function(t){var n,i=this,o=l.getSelectorFromElement(this);o&&(n=document.querySelector(o));var r=e(n).data("bs.modal")?"toggle":s(s({},e(n).data()),e(this).data());"A"!==this.tagName&&"AREA"!==this.tagName||t.preventDefault();var a=e(n).one("show.bs.modal",(function(t){t.isDefaultPrevented()||a.one("hidden.bs.modal",(function(){e(i).is(":visible")&&i.focus()}))}));qt._jQueryInterface.call(e(n),r,this)})),e.fn.modal=qt._jQueryInterface,e.fn.modal.Constructor=qt,e.fn.modal.noConflict=function(){return e.fn.modal=Rt,qt._jQueryInterface};var Ht=["background","cite","href","itemtype","longdesc","poster","src","xlink:href"],Qt={"*":["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","srcset","alt","title","width","height"],li:[],ol:[],p:[],pre:[],s:[],small:[],span:[],sub:[],sup:[],strong:[],u:[],ul:[]},Wt=/^(?:(?:https?|mailto|ftp|tel|file):|[^#&/:?]*(?:[#/?]|$))/gi,Ut=/^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[\d+/a-z]+=*$/i;function Vt(t,e,n){if(0===t.length)return t;if(n&&"function"==typeof n)return n(t);for(var i=(new window.DOMParser).parseFromString(t,"text/html"),o=Object.keys(e),r=[].slice.call(i.body.querySelectorAll("*")),s=function(t,n){var i=r[t],s=i.nodeName.toLowerCase();if(-1===o.indexOf(i.nodeName.toLowerCase()))return i.parentNode.removeChild(i),"continue";var a=[].slice.call(i.attributes),l=[].concat(e["*"]||[],e[s]||[]);a.forEach((function(t){(function(t,e){var n=t.nodeName.toLowerCase();if(-1!==e.indexOf(n))return-1===Ht.indexOf(n)||Boolean(t.nodeValue.match(Wt)||t.nodeValue.match(Ut));for(var i=e.filter((function(t){return t instanceof RegExp})),o=0,r=i.length;o<r;o++)if(n.match(i[o]))return!0;return!1})(t,l)||i.removeAttribute(t.nodeName)}))},a=0,l=r.length;a<l;a++)s(a);return i.body.innerHTML}var Yt="tooltip",zt=e.fn[Yt],Xt=new RegExp("(^|\\s)bs-tooltip\\S+","g"),Kt=["sanitize","whiteList","sanitizeFn"],Gt={animation:"boolean",template:"string",title:"(string|element|function)",trigger:"string",delay:"(number|object)",html:"boolean",selector:"(string|boolean)",placement:"(string|function)",offset:"(number|string|function)",container:"(string|element|boolean)",fallbackPlacement:"(string|array)",boundary:"(string|element)",sanitize:"boolean",sanitizeFn:"(null|function)",whiteList:"object",popperConfig:"(null|object)"},$t={AUTO:"auto",TOP:"top",RIGHT:"right",BOTTOM:"bottom",LEFT:"left"},Jt={animation:!0,template:'<div class="tooltip" role="tooltip"><div class="arrow"></div><div class="tooltip-inner"></div></div>',trigger:"hover focus",title:"",delay:0,html:!1,selector:!1,placement:"top",offset:0,container:!1,fallbackPlacement:"flip",boundary:"scrollParent",sanitize:!0,sanitizeFn:null,whiteList:Qt,popperConfig:null},Zt={HIDE:"hide.bs.tooltip",HIDDEN:"hidden.bs.tooltip",SHOW:"show.bs.tooltip",SHOWN:"shown.bs.tooltip",INSERTED:"inserted.bs.tooltip",CLICK:"click.bs.tooltip",FOCUSIN:"focusin.bs.tooltip",FOCUSOUT:"focusout.bs.tooltip",MOUSEENTER:"mouseenter.bs.tooltip",MOUSELEAVE:"mouseleave.bs.tooltip"},te=function(){function t(t,e){if("undefined"==typeof At)throw new TypeError("Bootstrap's tooltips require Popper.js (https://popper.js.org/)");this._isEnabled=!0,this._timeout=0,this._hoverState="",this._activeTrigger={},this._popper=null,this.element=t,this.config=this._getConfig(e),this.tip=null,this._setListeners()}var n=t.prototype;return n.enable=function(){this._isEnabled=!0},n.disable=function(){this._isEnabled=!1},n.toggleEnabled=function(){this._isEnabled=!this._isEnabled},n.toggle=function(t){if(this._isEnabled)if(t){var n=this.constructor.DATA_KEY,i=e(t.currentTarget).data(n);i||(i=new this.constructor(t.currentTarget,this._getDelegateConfig()),e(t.currentTarget).data(n,i)),i._activeTrigger.click=!i._activeTrigger.click,i._isWithActiveTrigger()?i._enter(null,i):i._leave(null,i)}else{if(e(this.getTipElement()).hasClass("show"))return void this._leave(null,this);this._enter(null,this)}},n.dispose=function(){clearTimeout(this._timeout),e.removeData(this.element,this.constructor.DATA_KEY),e(this.element).off(this.constructor.EVENT_KEY),e(this.element).closest(".modal").off("hide.bs.modal",this._hideModalHandler),this.tip&&e(this.tip).remove(),this._isEnabled=null,this._timeout=null,this._hoverState=null,this._activeTrigger=null,this._popper&&this._popper.destroy(),this._popper=null,this.element=null,this.config=null,this.tip=null},n.show=function(){var t=this;if("none"===e(this.element).css("display"))throw new Error("Please use show on visible elements");var n=e.Event(this.constructor.Event.SHOW);if(this.isWithContent()&&this._isEnabled){e(this.element).trigger(n);var i=l.findShadowRoot(this.element),o=e.contains(null!==i?i:this.element.ownerDocument.documentElement,this.element);if(n.isDefaultPrevented()||!o)return;var r=this.getTipElement(),s=l.getUID(this.constructor.NAME);r.setAttribute("id",s),this.element.setAttribute("aria-describedby",s),this.setContent(),this.config.animation&&e(r).addClass("fade");var a="function"==typeof this.config.placement?this.config.placement.call(this,r,this.element):this.config.placement,c=this._getAttachment(a);this.addAttachmentClass(c);var u=this._getContainer();e(r).data(this.constructor.DATA_KEY,this),e.contains(this.element.ownerDocument.documentElement,this.tip)||e(r).appendTo(u),e(this.element).trigger(this.constructor.Event.INSERTED),this._popper=new At(this.element,r,this._getPopperConfig(c)),e(r).addClass("show"),"ontouchstart"in document.documentElement&&e(document.body).children().on("mouseover",null,e.noop);var h=function(){t.config.animation&&t._fixTransition();var n=t._hoverState;t._hoverState=null,e(t.element).trigger(t.constructor.Event.SHOWN),"out"===n&&t._leave(null,t)};if(e(this.tip).hasClass("fade")){var f=l.getTransitionDurationFromElement(this.tip);e(this.tip).one(l.TRANSITION_END,h).emulateTransitionEnd(f)}else h()}},n.hide=function(t){var n=this,i=this.getTipElement(),o=e.Event(this.constructor.Event.HIDE),r=function(){"show"!==n._hoverState&&i.parentNode&&i.parentNode.removeChild(i),n._cleanTipClass(),n.element.removeAttribute("aria-describedby"),e(n.element).trigger(n.constructor.Event.HIDDEN),null!==n._popper&&n._popper.destroy(),t&&t()};
8if(e(this.element).trigger(o),!o.isDefaultPrevented()){if(e(i).removeClass("show"),"ontouchstart"in document.documentElement&&e(document.body).children().off("mouseover",null,e.noop),this._activeTrigger.click=!1,this._activeTrigger.focus=!1,this._activeTrigger.hover=!1,e(this.tip).hasClass("fade")){var s=l.getTransitionDurationFromElement(i);e(i).one(l.TRANSITION_END,r).emulateTransitionEnd(s)}else r();this._hoverState=""}},n.update=function(){null!==this._popper&&this._popper.scheduleUpdate()},n.isWithContent=function(){return Boolean(this.getTitle())},n.addAttachmentClass=function(t){e(this.getTipElement()).addClass("bs-tooltip-"+t)},n.getTipElement=function(){return this.tip=this.tip||e(this.config.template)[0],this.tip},n.setContent=function(){var t=this.getTipElement();this.setElementContent(e(t.querySelectorAll(".tooltip-inner")),this.getTitle()),e(t).removeClass("fade show")},n.setElementContent=function(t,n){"object"!=typeof n||!n.nodeType&&!n.jquery?this.config.html?(this.config.sanitize&&(n=Vt(n,this.config.whiteList,this.config.sanitizeFn)),t.html(n)):t.text(n):this.config.html?e(n).parent().is(t)||t.empty().append(n):t.text(e(n).text())},n.getTitle=function(){var t=this.element.getAttribute("data-original-title");return t||(t="function"==typeof this.config.title?this.config.title.call(this.element):this.config.title),t},n._getPopperConfig=function(t){var e=this;return s(s({},{placement:t,modifiers:{offset:this._getOffset(),flip:{behavior:this.config.fallbackPlacement},arrow:{element:".arrow"},preventOverflow:{boundariesElement:this.config.boundary}},onCreate:function(t){t.originalPlacement!==t.placement&&e._handlePopperPlacementChange(t)},onUpdate:function(t){return e._handlePopperPlacementChange(t)}}),this.config.popperConfig)},n._getOffset=function(){var t=this,e={};return"function"==typeof this.config.offset?e.fn=function(e){return e.offsets=s(s({},e.offsets),t.config.offset(e.offsets,t.element)||{}),e}:e.offset=this.config.offset,e},n._getContainer=function(){return!1===this.config.container?document.body:l.isElement(this.config.container)?e(this.config.container):e(document).find(this.config.container)},n._getAttachment=function(t){return $t[t.toUpperCase()]},n._setListeners=function(){var t=this;this.config.trigger.split(" ").forEach((function(n){if("click"===n)e(t.element).on(t.constructor.Event.CLICK,t.config.selector,(function(e){return t.toggle(e)}));else if("manual"!==n){var i="hover"===n?t.constructor.Event.MOUSEENTER:t.constructor.Event.FOCUSIN,o="hover"===n?t.constructor.Event.MOUSELEAVE:t.constructor.Event.FOCUSOUT;e(t.element).on(i,t.config.selector,(function(e){return t._enter(e)})).on(o,t.config.selector,(function(e){return t._leave(e)}))}})),this._hideModalHandler=function(){t.element&&t.hide()},e(this.element).closest(".modal").on("hide.bs.modal",this._hideModalHandler),this.config.selector?this.config=s(s({},this.config),{},{trigger:"manual",selector:""}):this._fixTitle()},n._fixTitle=function(){var t=typeof this.element.getAttribute("data-original-title");(this.element.getAttribute("title")||"string"!==t)&&(this.element.setAttribute("data-original-title",this.element.getAttribute("title")||""),this.element.setAttribute("title",""))},n._enter=function(t,n){var i=this.constructor.DATA_KEY;(n=n||e(t.currentTarget).data(i))||(n=new this.constructor(t.currentTarget,this._getDelegateConfig()),e(t.currentTarget).data(i,n)),t&&(n._activeTrigger["focusin"===t.type?"focus":"hover"]=!0),e(n.getTipElement()).hasClass("show")||"show"===n._hoverState?n._hoverState="show":(clearTimeout(n._timeout),n._hoverState="show",n.config.delay&&n.config.delay.show?n._timeout=setTimeout((function(){"show"===n._hoverState&&n.show()}),n.config.delay.show):n.show())},n._leave=function(t,n){var i=this.constructor.DATA_KEY;(n=n||e(t.currentTarget).data(i))||(n=new this.constructor(t.currentTarget,this._getDelegateConfig()),e(t.currentTarget).data(i,n)),t&&(n._activeTrigger["focusout"===t.type?"focus":"hover"]=!1),n._isWithActiveTrigger()||(clearTimeout(n._timeout),n._hoverState="out",n.config.delay&&n.config.delay.hide?n._timeout=setTimeout((function(){"out"===n._hoverState&&n.hide()}),n.config.delay.hide):n.hide())},n._isWithActiveTrigger=function(){for(var t in this._activeTrigger)if(this._activeTrigger[t])return!0;return!1},n._getConfig=function(t){var n=e(this.element).data();
8return Object.keys(n).forEach((function(t){-1!==Kt.indexOf(t)&&delete n[t]})),"number"==typeof(t=s(s(s({},this.constructor.Default),n),"object"==typeof t&&t?t:{})).delay&&(t.delay={show:t.delay,hide:t.delay}),"number"==typeof t.title&&(t.title=t.title.toString()),"number"==typeof t.content&&(t.content=t.content.toString()),l.typeCheckConfig(Yt,t,this.constructor.DefaultType),t.sanitize&&(t.template=Vt(t.template,t.whiteList,t.sanitizeFn)),t},n._getDelegateConfig=function(){var t={};if(this.config)for(var e in this.config)this.constructor.Default[e]!==this.config[e]&&(t[e]=this.config[e]);return t},n._cleanTipClass=function(){var t=e(this.getTipElement()),n=t.attr("class").match(Xt);null!==n&&n.length&&t.removeClass(n.join(""))},n._handlePopperPlacementChange=function(t){this.tip=t.instance.popper,this._cleanTipClass(),this.addAttachmentClass(this._getAttachment(t.placement))},n._fixTransition=function(){var t=this.getTipElement(),n=this.config.animation;null===t.getAttribute("x-placement")&&(e(t).removeClass("fade"),this.config.animation=!1,this.hide(),this.show(),this.config.animation=n)},t._jQueryInterface=function(n){return this.each((function(){var i=e(this).data("bs.tooltip"),o="object"==typeof n&&n;if((i||!/dispose|hide/.test(n))&&(i||(i=new t(this,o),e(this).data("bs.tooltip",i)),"string"==typeof n)){if("undefined"==typeof i[n])throw new TypeError('No method named "'+n+'"');i[n]()}}))},i(t,null,[{key:"VERSION",get:function(){return"4.5.0"}},{key:"Default",get:function(){return Jt}},{key:"NAME",get:function(){return Yt}},{key:"DATA_KEY",get:function(){return"bs.tooltip"}},{key:"Event",get:function(){return Zt}},{key:"EVENT_KEY",get:function(){return".bs.tooltip"}},{key:"DefaultType",get:function(){return Gt}}]),t}();e.fn[Yt]=te._jQueryInterface,e.fn[Yt].Constructor=te,e.fn[Yt].noConflict=function(){return e.fn[Yt]=zt,te._jQueryInterface};var ee="popover",ne=e.fn[ee],ie=new RegExp("(^|\\s)bs-popover\\S+","g"),oe=s(s({},te.Default),{},{placement:"right",trigger:"click",content:"",template:'<div class="popover" role="tooltip"><div class="arrow"></div><h3 class="popover-header"></h3><div class="popover-body"></div></div>'}),re=s(s({},te.DefaultType),{},{content:"(string|element|function)"}),se={HIDE:"hide.bs.popover",HIDDEN:"hidden.bs.popover",SHOW:"show.bs.popover",SHOWN:"shown.bs.popover",INSERTED:"inserted.bs.popover",CLICK:"click.bs.popover",FOCUSIN:"focusin.bs.popover",FOCUSOUT:"focusout.bs.popover",MOUSEENTER:"mouseenter.bs.popover",MOUSELEAVE:"mouseleave.bs.popover"},ae=function(t){var n,o;function r(){return t.apply(this,arguments)||this}o=t,(n=r).prototype=Object.create(o.prototype),n.prototype.constructor=n,n.__proto__=o;var s=r.prototype;return s.isWithContent=function(){return this.getTitle()||this._getContent()},s.addAttachmentClass=function(t){e(this.getTipElement()).addClass("bs-popover-"+t)},s.getTipElement=function(){return this.tip=this.tip||e(this.config.template)[0],this.tip},s.setContent=function(){var t=e(this.getTipElement());this.setElementContent(t.find(".popover-header"),this.getTitle());var n=this._getContent();"function"==typeof n&&(n=n.call(this.element)),this.setElementContent(t.find(".popover-body"),n),t.removeClass("fade show")},s._getContent=function(){return this.element.getAttribute("data-content")||this.config.content},s._cleanTipClass=function(){var t=e(this.getTipElement()),n=t.attr("class").match(ie);null!==n&&n.length>0&&t.removeClass(n.join(""))},r._jQueryInterface=function(t){return this.each((function(){var n=e(this).data("bs.popover"),i="object"==typeof t?t:null;if((n||!/dispose|hide/.test(t))&&(n||(n=new r(this,i),e(this).data("bs.popover",n)),"string"==typeof t)){if("undefined"==typeof n[t])throw new TypeError('No method named "'+t+'"');n[t]()}}))},i(r,null,[{key:"VERSION",get:function(){return"4.5.0"}},{key:"Default",get:function(){return oe}},{key:"NAME",get:function(){return ee}},{key:"DATA_KEY",get:function(){return"bs.popover"}},{key:"Event",get:function(){return se}},{key:"EVENT_KEY",get:function(){return".bs.popover"}},{key:"DefaultType",get:function(){return re}}]),r}(te);
8e.fn[ee]=ae._jQueryInterface,e.fn[ee].Constructor=ae,e.fn[ee].noConflict=function(){return e.fn[ee]=ne,ae._jQueryInterface};var le="scrollspy",ce=e.fn[le],ue={offset:10,method:"auto",target:""},he={offset:"number",method:"string",target:"(string|element)"},fe=function(){function t(t,n){var i=this;this._element=t,this._scrollElement="BODY"===t.tagName?window:t,this._config=this._getConfig(n),this._selector=this._config.target+" .nav-link,"+this._config.target+" .list-group-item,"+this._config.target+" .dropdown-item",this._offsets=[],this._targets=[],this._activeTarget=null,this._scrollHeight=0,e(this._scrollElement).on("scroll.bs.scrollspy",(function(t){return i._process(t)})),this.refresh(),this._process()}var n=t.prototype;return n.refresh=function(){var t=this,n=this._scrollElement===this._scrollElement.window?"offset":"position",i="auto"===this._config.method?n:this._config.method,o="position"===i?this._getScrollTop():0;this._offsets=[],this._targets=[],this._scrollHeight=this._getScrollHeight(),[].slice.call(document.querySelectorAll(this._selector)).map((function(t){var n,r=l.getSelectorFromElement(t);if(r&&(n=document.querySelector(r)),n){var s=n.getBoundingClientRect();if(s.width||s.height)return[e(n)[i]().top+o,r]}return null})).filter((function(t){return t})).sort((function(t,e){return t[0]-e[0]})).forEach((function(e){t._offsets.push(e[0]),t._targets.push(e[1])}))},n.dispose=function(){e.removeData(this._element,"bs.scrollspy"),e(this._scrollElement).off(".bs.scrollspy"),this._element=null,this._scrollElement=null,this._config=null,this._selector=null,this._offsets=null,this._targets=null,this._activeTarget=null,this._scrollHeight=null},n._getConfig=function(t){if("string"!=typeof(t=s(s({},ue),"object"==typeof t&&t?t:{})).target&&l.isElement(t.target)){var n=e(t.target).attr("id");n||(n=l.getUID(le),e(t.target).attr("id",n)),t.target="#"+n}return l.typeCheckConfig(le,t,he),t},n._getScrollTop=function(){return this._scrollElement===window?this._scrollElement.pageYOffset:this._scrollElement.scrollTop},n._getScrollHeight=function(){return this._scrollElement.scrollHeight||Math.max(document.body.scrollHeight,document.documentElement.scrollHeight)},n._getOffsetHeight=function(){return this._scrollElement===window?window.innerHeight:this._scrollElement.getBoundingClientRect().height},n._process=function(){var t=this._getScrollTop()+this._config.offset,e=this._getScrollHeight(),n=this._config.offset+e-this._getOffsetHeight();if(this._scrollHeight!==e&&this.refresh(),t>=n){var i=this._targets[this._targets.length-1];this._activeTarget!==i&&this._activate(i)}else{if(this._activeTarget&&t<this._offsets[0]&&this._offsets[0]>0)return this._activeTarget=null,void this._clear();for(var o=this._offsets.length;o--;){this._activeTarget!==this._targets[o]&&t>=this._offsets[o]&&("undefined"==typeof this._offsets[o+1]||t<this._offsets[o+1])&&this._activate(this._targets[o])}}},n._activate=function(t){this._activeTarget=t,this._clear();var n=this._selector.split(",").map((function(e){return e+'[data-target="'+t+'"],'+e+'[href="'+t+'"]'})),i=e([].slice.call(document.querySelectorAll(n.join(","))));i.hasClass("dropdown-item")?(i.closest(".dropdown").find(".dropdown-toggle").addClass("active"),i.addClass("active")):(i.addClass("active"),i.parents(".nav, .list-group").prev(".nav-link, .list-group-item").addClass("active"),i.parents(".nav, .list-group").prev(".nav-item").children(".nav-link").addClass("active")),e(this._scrollElement).trigger("activate.bs.scrollspy",{relatedTarget:t})},n._clear=function(){[].slice.call(document.querySelectorAll(this._selector)).filter((function(t){return t.classList.contains("active")})).forEach((function(t){return t.classList.remove("active")}))},t._jQueryInterface=function(n){return this.each((function(){var i=e(this).data("bs.scrollspy");if(i||(i=new t(this,"object"==typeof n&&n),e(this).data("bs.scrollspy",i)),"string"==typeof n){if("undefined"==typeof i[n])throw new TypeError('No method named "'+n+'"');i[n]()}}))},i(t,null,[{key:"VERSION",get:function(){return"4.5.0"}},{key:"Default",get:function(){return ue}}]),t}();e(window).on("load.bs.scrollspy.data-api",(function(){for(var t=[].slice.call(document.querySelectorAll('[data-spy="scroll"]')),n=t.length;n--;){var i=e(t[n]);fe._jQueryInterface.call(i,i.data())}})),e.fn[le]=fe._jQueryInterface,e.fn[le].Constructor=fe,e.fn[le].noConflict=function(){return e.fn[le]=ce,fe._jQueryInterface};var de=e.fn.tab,pe=function(){function t(t){this._element=t}var n=t.prototype;return n.show=function(){var t=this;if(!(this._element.parentNode&&this._element.parentNode.nodeType===Node.ELEMENT_NODE&&e(this._element).hasClass("active")||e(this._element).hasClass("disabled"))){var n,i,o=e(this._element).closest(".
8nav, .list-group")[0],r=l.getSelectorFromElement(this._element);if(o){var s="UL"===o.nodeName||"OL"===o.nodeName?"> li > .active":".active";i=(i=e.makeArray(e(o).find(s)))[i.length-1]}var a=e.Event("hide.bs.tab",{relatedTarget:this._element}),c=e.Event("show.bs.tab",{relatedTarget:i});if(i&&e(i).trigger(a),e(this._element).trigger(c),!c.isDefaultPrevented()&&!a.isDefaultPrevented()){r&&(n=document.querySelector(r)),this._activate(this._element,o);var u=function(){var n=e.Event("hidden.bs.tab",{relatedTarget:t._element}),o=e.Event("shown.bs.tab",{relatedTarget:i});e(i).trigger(n),e(t._element).trigger(o)};n?this._activate(n,n.parentNode,u):u()}}},n.dispose=function(){e.removeData(this._element,"bs.tab"),this._element=null},n._activate=function(t,n,i){var o=this,r=(!n||"UL"!==n.nodeName&&"OL"!==n.nodeName?e(n).children(".active"):e(n).find("> li > .active"))[0],s=i&&r&&e(r).hasClass("fade"),a=function(){return o._transitionComplete(t,r,i)};if(r&&s){var c=l.getTransitionDurationFromElement(r);e(r).removeClass("show").one(l.TRANSITION_END,a).emulateTransitionEnd(c)}else a()},n._transitionComplete=function(t,n,i){if(n){e(n).removeClass("active");var o=e(n.parentNode).find("> .dropdown-menu .active")[0];o&&e(o).removeClass("active"),"tab"===n.getAttribute("role")&&n.setAttribute("aria-selected",!1)}if(e(t).addClass("active"),"tab"===t.getAttribute("role")&&t.setAttribute("aria-selected",!0),l.reflow(t),t.classList.contains("fade")&&t.classList.add("show"),t.parentNode&&e(t.parentNode).hasClass("dropdown-menu")){var r=e(t).closest(".dropdown")[0];if(r){var s=[].slice.call(r.querySelectorAll(".dropdown-toggle"));e(s).addClass("active")}t.setAttribute("aria-expanded",!0)}i&&i()},t._jQueryInterface=function(n){return this.each((function(){var i=e(this),o=i.data("bs.tab");if(o||(o=new t(this),i.data("bs.tab",o)),"string"==typeof n){if("undefined"==typeof o[n])throw new TypeError('No method named "'+n+'"');o[n]()}}))},i(t,null,[{key:"VERSION",get:function(){return"4.5.0"}}]),t}();e(document).on("click.bs.tab.data-api",'[data-toggle="tab"], [data-toggle="pill"], [data-toggle="list"]',(function(t){t.preventDefault(),pe._jQueryInterface.call(e(this),"show")})),e.fn.tab=pe._jQueryInterface,e.fn.tab.Constructor=pe,e.fn.tab.noConflict=function(){return e.fn.tab=de,pe._jQueryInterface};var me=e.fn.toast,ge={animation:"boolean",autohide:"boolean",delay:"number"},ve={animation:!0,autohide:!0,delay:500},_e=function(){function t(t,e){this._element=t,this._config=this._getConfig(e),this._timeout=null,this._setListeners()}var n=t.prototype;return n.show=function(){var t=this,n=e.Event("show.bs.toast");if(e(this._element).trigger(n),!n.isDefaultPrevented()){this._config.animation&&this._element.classList.add("fade");var i=function(){t._element.classList.remove("showing"),t._element.classList.add("show"),e(t._element).trigger("shown.bs.toast"),t._config.autohide&&(t._timeout=setTimeout((function(){t.hide()}),t._config.delay))};if(this._element.classList.remove("hide"),l.reflow(this._element),this._element.classList.add("showing"),this._config.animation){var o=l.getTransitionDurationFromElement(this._element);e(this._element).one(l.TRANSITION_END,i).emulateTransitionEnd(o)}else i()}},n.hide=function(){if(this._element.classList.contains("show")){var t=e.Event("hide.bs.toast");e(this._element).trigger(t),t.isDefaultPrevented()||this._close()}},n.dispose=function(){clearTimeout(this._timeout),this._timeout=null,this._element.classList.contains("show")&&this._element.classList.remove("show"),e(this._element).off("click.dismiss.bs.toast"),e.removeData(this._element,"bs.toast"),this._element=null,this._config=null},n._getConfig=function(t){return t=s(s(s({},ve),e(this._element).data()),"object"==typeof t&&t?t:{}),l.typeCheckConfig("toast",t,this.constructor.DefaultType),t},n._setListeners=function(){var t=this;e(this._element).on("click.dismiss.bs.toast",'[data-dismiss="toast"]',(function(){return t.hide()}))},n._close=function(){var t=this,n=function(){t._element.classList.add("hide"),e(t._element).trigger("hidden.bs.toast")};if(this._element.classList.remove("show"),this._config.animation){var i=l.getTransitionDurationFromElement(this._element);e(this._element).one(l.TRANSITION_END,n).emulateTransitionEnd(i)}else n()},t._jQueryInterface=function(n){return this.each((function(){var i=e(this),o=i.data("bs.toast");if(o||(o=new t(this,"object"==typeof n&&n),i.data("bs.toast",o)),"string"==typeof n){if("undefined"==typeof o[n])throw new TypeError('No method n
vendor: 7,830 bytes, lines 8-13
8amed "'+n+'"');o[n](this)}}))},i(t,null,[{key:"VERSION",get:function(){return"4.5.0"}},{key:"DefaultType",get:function(){return ge}},{key:"Default",get:function(){return ve}}]),t}();e.fn.toast=_e._jQueryInterface,e.fn.toast.Constructor=_e,e.fn.toast.noConflict=function(){return e.fn.toast=me,_e._jQueryInterface},t.Alert=h,t.Button=d,t.Carousel=y,t.Collapse=S,t.Dropdown=Ft,t.Modal=qt,t.Popover=ae,t.Scrollspy=fe,t.Tab=pe,t.Toast=_e,t.Tooltip=te,t.Util=l,Object.defineProperty(t,"__esModule",{value:!0})}));;/*!
9 * Bootstrap-select v1.13.9 (https://developer.snapappointments.com/bootstrap-select)
10 *
11 * Copyright 2012-2019 SnapAppointments, LLC
12 * Licensed under MIT (https://github.com/snapappointments/bootstrap-select/blob/master/LICENSE)
13 */!function(e,t){void 0===e&&void 0!==window&&(e=window),"function"==typeof define&&define.amd?define(["jquery"],function(e){return t(e)}):"object"==typeof module&&module.exports?module.exports=t(require("jquery")):t(e.jQuery)}(this,function(e){!function(z){"use strict";var d=["sanitize","whiteList","sanitizeFn"],l=["background","cite","href","itemtype","longdesc","poster","src","xlink:href"],e={"*":["class","dir","id","lang","role","tabindex","style",/^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,a=/^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 v(e,t){var i=e.nodeName.toLowerCase();if(-1!==z.inArray(i,t))return-1===z.inArray(i,l)||Boolean(e.nodeValue.match(r)||e.nodeValue.match(a));for(var s=z(t).filter(function(e,t){return t instanceof RegExp}),n=0,o=s.length;n<o;n++)if(i.match(s[n]))return!0;return!1}function B(e,t,i){if(i&&"function"==typeof i)return i(e);for(var s=Object.keys(t),n=0,o=e.length;n<o;n++)for(var l=e[n].querySelectorAll("*"),r=0,a=l.length;r<a;r++){var c=l[r],d=c.nodeName.toLowerCase();if(-1!==s.indexOf(d))for(var h=[].slice.call(c.attributes),p=[].concat(t["*"]||[],t[d]||[]),u=0,f=h.length;u<f;u++){var m=h[u];v(m,p)||c.removeAttribute(m.nodeName)}else c.parentNode.removeChild(c)}}"classList"in document.createElement("_")||function(e){if("Element"in e){var t="classList",i="prototype",s=e.Element[i],n=Object,o=function(){var i=z(this);return{add:function(e){return e=Array.prototype.slice.call(arguments).join(" "),i.addClass(e)},remove:function(e){return e=Array.prototype.slice.call(arguments).join(" "),i.removeClass(e)},toggle:function(e,t){return i.toggleClass(e,t)},contains:function(e){return i.hasClass(e)}}};if(n.defineProperty){var l={get:o,enumerable:!0,configurable:!0};try{n.defineProperty(s,t,l)}catch(e){void 0!==e.number&&-2146823252!==e.number||(l.enumerable=!1,n.defineProperty(s,t,l))}}else n[i].__defineGetter__&&s.__defineGetter__(t,o)}}(window);var t,c,i,s=document.createElement("_");if(s.classList.add("c1","c2"),!s.classList.contains("c2")){var n=DOMTokenList.prototype.add,o=DOMTokenList.prototype.remove;DOMTokenList.prototype.add=function(){Array.prototype.forEach.call(arguments,n.bind(this))},DOMTokenList.prototype.remove=function(){Array.prototype.forEach.call(arguments,o.bind(this))}}if(s.classList.toggle("c3",!1),s.classList.contains("c3")){var h=DOMTokenList.prototype.toggle;DOMTokenList.prototype.toggle=function(e,t){return 1 in arguments&&!this.contains(e)==!t?t:h.call(this,e)}}function E(e){var t,i=[],s=e.selectedOptions;if(e.multiple)for(var n=0,o=s.length;n<o;n++)t=s[n],i.push(t.value||t.text);else i=e.value;return i}s=null,String.prototype.startsWith||(t=function(){try{var e={},t=Object.defineProperty,i=t(e,e,e)&&t}catch(e){}return i}(),c={}.toString,i=function(e){if(null==this)throw new TypeError;var t=String(this);if(e&&"[object RegExp]"==c.call(e))throw new TypeError;var i=t.length,s=String(e),n=s.length,o=1<arguments.length?arguments[1]:void 0,l=o?Number(o):0;l!=l&&(l=0);var r=Math.min(Math.max(l,0),i);if(i<n+r)return!1;for(var a=-1;++a<n;)if(t.charCodeAt(r+a)!=s.charCodeAt(a))return!1;return!0},t?t(String.prototype,"startsWith",{value:i,configurable:!0,writable:!0}):String.prototype.startsWith=i),Object.keys||(Object.keys=function(e,t,i){for(t in i=[],e)i.hasOwnProperty.call(e,t)&&i.push(t);return i}),HTMLSelectElement&&!HTMLSelectElement.prototype.hasOwnProperty("selectedOptions")&&Object.defineProperty(HTMLSelectElement.prototype,"selectedOptions",{get:function(){return this.querySelectorAll(":checked")}});var p={useDefault:!1,_set:z.valHooks.select.set};z.valHooks.select.set=function(e,t){return t&&!p.useDefault&&z(e).data("selected",!0),p._set.apply(this,arguments)};var C=null,u=function(){try{return new Event("change"),!0}catch(e){return!1}}();function $(e,t,i,s){for(var n=["display","subtext","tokens"],o=!1,l=0;l<n.length;l++){var r=n[l],a=e[r];if(a&&(a=a.toString(),"display"===r&&(a=a.replace(/<[^>]+>/g,"")),s&&(a=w(a)),a=a.toUpperCase(),o="contains"===i?0<=a.indexOf(t):a.startsWith(t)))break}return o}function L(e){return parseInt(e,10)||0}z.fn.triggerNative=function(e){var t,i=this[0];i.dispatchEvent?(u?t=new Event(e,{bubbles:!0}):(t=document.createEvent("Event")).initEvent(e,!0,!1),i.dispatchEvent(t)):i.fireEvent?((t=document.createEventObject()).eventType=e,i.fireEvent("on"+e,t)):this.trigger(e)};var f={"\xc0":"A","\xc1":"A","\xc2":"A","\xc3":"A","\xc4":"A","\xc5":"A","\xe0":"a","\xe1":"a","\xe2":"a","\xe3":"a","\xe4":"a","\xe5":"a","\xc7":"C","\xe7":"c","\xd0":"D","\xf0":"d","\xc8":"E","\xc9":"E","\xca":"E","\xcb":"E","\xe8":"e","\xe9":"e","\xea":"e","\xeb":"e","\xcc":"I","\xcd":"I","\xce":"I","\xcf":"I","\xec":"i","\xed":"i","\xee":"i","\xef":"i","\xd1":"N","\xf1":"n","\xd2":"O","\xd3":"O","\xd4":"O","\xd5":"O","\xd6":"O","\xd8":"O","\xf2":"o","\xf3":"o","\xf4":"o","\xf5":"o","\xf6":"o","\xf8":"o","\xd9":"U","\xda":"U","\xdb":"U","\xdc":"U","\xf9":"u","\xfa":"u","\xfb":"u","\xfc":"u","\xdd":"Y","\xfd":"y","\xff":"y","\xc6":"Ae","\xe6":"ae","\xde":"Th","\xfe":"th","\xdf":"ss","\u0100":"A","\u0102":"A","\u0104":"A","\u0101":"a","\u0103":"a","\u0105":"a","\u0106":"C","\u0108":"C","\u010a":"C","\u010c":"C","\u0107":"c","\u0109":"c","\u010b":"c","\u010d":"c","\u010e":"D","\u0110":"D","\u010f":"d","\u0111":"d","\u0112":"E","\u0114":"E","\u0116":"E","\u0118":"E","\u011a":"E","\u0113":"e","\u0115":"e","\u0117":"e","\u0119":"e","\u011b":"e","\u011c":"G","\u011e":"G","\u0120":"G","\u0122":"G","\u011d":"g","\u011f":"g","\u0121":"g","\u0123":"g","\u0124":"H","\u0126":"H","\u0125":"h","\u0127":"h","\u0128":"I","\u012a":"I","\u012c":"I","\u012e":"I","\u0130":"I","\u0129":"i","\u012b":"i","\u012d":"i","\u012f":"i","\u0131":"i","\u0134":"J","\u0135":"j","\u0136":"K","\u0137":"k","\u0138":"k","\u0139":"L","\u013b":"L","\u013d":"L","\u013f":"L","\u0141":"L","\u013a":"l","\u013c":"l","\u013e":"l","\u0140":"l","\u0142":"l","\u0143":"N","\u0145":"N","\u0147":"N","\u014a":"N","\u0144":"n","\u0146":"n","\u0148":"n","\u014b":"n","\u014c":"O","\u014e":"O","\u0150":"O","\u014d":"o","\u014f":"o","\u0151":"o","\u0154":"R","\u0156":"R","\u0158":"R","\u0155":"r","\u0157":"r","\u0159":"r","\u015a":"S","\u015c":"S","\u015e":"S","\u0160":"S","\u015b":"s","\u015d":"s","\u015f":"s","\u0161":"s","\u0162":"T","\u0164":"T","\u0166":"T","\u0163":"t","\u0165":"t","\u0167":"t","\u0168":"U","\u016a":"U","\u016c":"U","\u016e":"U","\u0170":"U","\u0172":"U","\u0169":"u","\u016b":"u","\u016d":"u","\u016f":"u","\u0171":"u","\u0173":"u","\u0174":"W","\u0175":"w","\u0176":"Y","\u0177":"y","\u0178":"Y","\u0179":"Z","\u017b":"Z","\u017d":"Z","\u017a":"z","\u017c":"z","\u017e":"z","\u0132":"IJ","\u0133":"ij","\u0152":"Oe","\u0153":"oe","\u0149":"'n","\u017f":"s"}
13,m=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,g=RegExp("[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\u1ab0-\\u1aff\\u1dc0-\\u1dff]","g");function b(e){return f[e]}function w(e){return(e=e.toString())&&e.replace(m,b).replace(g,"")}var x,I,k,y,S,O=(x={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"},I=function(e){return x[e]},k="(?:"+Object.keys(x).join("|")+")",y=RegExp(k),S=RegExp(k,"g"),function(e){return e=null==e?"":""+e,y.test(e)?e.replace(S,I):e}),T={32:" ",48:"0",49:"1",50:"2",51:"3",52:"4",53:"5",54:"6",55:"7",56:"8",57:"9",59:";",65:"A",66:"B",67:"C",68:"D",69:"E",70:"F",71:"G",72:"H",73:"I",74:"J",75:"K",76:"L",77:"M",78:"N",79:"O",80:"P",81:"Q",82:"R",83:"S",84:"T",85:"U",86:"V",87:"W",88:"X",89:"Y",90:"Z",96:"0",97:"1",98:"2",99:"3",100:"4",101:"5",102:"6",103:"7",104:"8",105:"9"},A=27,N=13,D=32,H=9,P=38,W=40,M={success:!1,major:"3"};try{M.full=(z.fn.dropdown.Constructor.VERSION||"").split(" ")[0].split("."),M.major=M.full[0],M.success=!0}catch(e){}var R=0,U=".bs.select",j={DISABLED:"disabled",DIVIDER:"divider",SHOW:"open",DROPUP:"dropup",MENU:"dropdown-menu",MENURIGHT:"dropdown-menu-right",MENULEFT:"dropdown-menu-left",BUTTONCLASS:"btn-default",POPOVERHEADER:"popover-title",ICONBASE:"glyphicon",TICKICON:"glyphicon-ok"},V={MENU:"."+j.MENU},F={span:document.createElement("span"),i:document.createElement("i"),subtext:document.createElement("small"),a:document.createElement("a"),li:document.createElement("li"),whitespace:document.createTextNode("\xa0"),fragment:document.createDocumentFragment()};F.a.setAttribute("role","option"),F.subtext.className="text-muted",F.text=F.span.cloneNode(!1),F.text.className="text",F.checkMark=F.span.cloneNode(!1);
13var _=new RegExp(P+"|"+W),q=new RegExp("^"+H+"$|"+A),G=function(e,t,i){var s=F.li.cloneNode(!1);return e&&(1===e.nodeType||11===e.nodeType?s.appendChild(e):s.innerHTML=e),void 0!==t&&""!==t&&(s.className=t),null!=i&&s.classList.add("optgroup-"+i),s},K=function(e,t,i){var s=F.a.cloneNode(!0);return e&&(11===e.nodeType?s.appendChild(e):s.insertAdjacentHTML("beforeend",e)),void 0!==t&&""!==t&&(s.className=t),"4"===M.major&&s.classList.add("dropdown-item"),i&&s.setAttribute("style",i),s},Y=function(e,t){var i,s,n=F.text.cloneNode(!1);if(e.content)n.innerHTML=e.content;else{if(n.textContent=e.text,e.icon){var o=F.whitespace.cloneNode(!1);(s=(!0===t?F.i:F.span).cloneNode(!1)).className=e.iconBase+" "+e.icon,F.fragment.appendChild(s),F.fragment.appendChild(o)}e.subtext&&((i=F.subtext.cloneNode(!1)).textContent=e.subtext,n.appendChild(i))}if(!0===t)for(;0<n.childNodes.length;)F.fragment.appendChild(n.childNodes[0]);else F.fragment.appendChild(n);return F.fragment},Z=function(e){var t,i,s=F.text.cloneNode(!1);if(s.innerHTML=e.label,e.icon){var n=F.whitespace.cloneNode(!1);(i=F.span.cloneNode(!1)).className=e.iconBase+" "+e.icon,F.fragment.appendChild(i),F.fragment.appendChild(n)}return e.subtext&&((t=F.subtext.cloneNode(!1)).textContent=e.subtext,s.appendChild(t)),F.fragment.appendChild(s),F.fragment},J=function(e,t){var i=this;p.useDefault||(z.valHooks.select.set=p._set,p.useDefault=!0),this.$element=z(e),this.$newElement=null,this.$button=null,this.$menu=null,this.options=t,this.selectpicker={main:{},current:{},search:{},view:{},keydown:{keyHistory:"",resetKeyHistory:{start:function(){return setTimeout(function(){i.selectpicker.keydown.keyHistory=""},800)}}}},null===this.options.title&&(this.options.title=this.$element.attr("title"));var s=this.options.windowPadding;"number"==typeof s&&(this.options.windowPadding=[s,s,s,s]),this.val=J.prototype.val,this.render=J.prototype.render,this.refresh=J.prototype.refresh,this.setStyle=J.prototype.setStyle,this.selectAll=J.prototype.selectAll,this.deselectAll=J.prototype.deselectAll,this.destroy=J.prototype.destroy,this.remove=J.prototype.remove,this.show=J.prototype.show,this.hide=J.prototype.hide,this.init()};function Q(e){var r,a=arguments,c=e;if([].shift.apply(a),!M.success){try{M.full=(z.fn.dropdown.Constructor.VERSION||"").split(" ")[0].split(".")}catch(e){J.BootstrapVersion?M.full=J.BootstrapVersion.split(" ")[0].split("."):(M.full=[M.major,"0","0"],console.warn("There was an issue retrieving Bootstrap's version. Ensure Bootstrap is being loaded before bootstrap-select and there is no namespace collision. If loading Bootstrap asynchronously, the version may need to be manually specified via $.fn.selectpicker.Constructor.BootstrapVersion.",e))}M.major=M.full[0],M.success=!0}if("4"===M.major){var t=[];J.DEFAULTS.style===j.BUTTONCLASS&&t.push({name:"style",className:"BUTTONCLASS"}),J.DEFAULTS.iconBase===j.ICONBASE&&t.push({name:"iconBase",className:"ICONBASE"}),J.DEFAULTS.tickIcon===j.TICKICON&&t.push({name:"tickIcon",className:"TICKICON"}),j.DIVIDER="dropdown-divider",j.SHOW="show",j.BUTTONCLASS="btn-light",j.POPOVERHEADER="popover-header",j.ICONBASE="",j.TICKICON="bs-ok-default";for(var i=0;i<t.length;i++){e=t[i];J.DEFAULTS[e.name]=j[e.className]}}var s=this.each(function(){var e=z(this);if(e.is("select")){var t=e.data("selectpicker"),i="object"==typeof c&&c;if(t){if(i)for(var s in i)i.hasOwnProperty(s)&&(t.options[s]=i[s])}else{var n=e.data();for(var o in n)n.hasOwnProperty(o)&&-1!==z.inArray(o,d)&&delete n[o];var l=z.extend({},J.DEFAULTS,z.fn.selectpicker.defaults||{},n,i);l.template=z.extend({},J.DEFAULTS.template,z.fn.selectpicker.defaults?z.fn.selectpicker.defaults.template:{},n.template,i.template),e.data("selectpicker",t=new J(this,l))}"string"==typeof c&&(r=t[c]instanceof Function?t[c].apply(t,a):t.options[c])}});return void 0!==r?r:s}J.VERSION="1.13.9",J.DEFAULTS={noneSelectedText:"Nothing selected",noneResultsText:"No results matched {0}",countSelectedText:function(e,t){return 1==e?"{0} item selected":"{0} items selected"},maxOptionsText:function(e,t){return[1==e?"Limit reached ({n} item max)":"Limit reached ({n} items max)",1==t?"Group limit reached ({n} item max)":"Group limit reached ({n} items max)"]},selectAllText:"Select All",deselectAllText:"Deselect All",doneButton:!1,doneButtonText:"Close",multipleSeparator:", ",styleBase:"btn",style:j.BUTTONCLASS,size:"auto",title:null,selectedTextFormat:"values",width:!1,container:!1,hideDisabled:!1,showSubtext:!1,showIcon:!0,showContent:!0,dropupAuto:!0,header:!1,liveSearch:!1,liveSearchPlaceholder:null,liveSearchNormalize:!1,liveSearchStyle:"contains",actionsBox:!1,iconBase:j.ICONBASE,tickIcon:j.TICKICON,showTick:!1,template:{caret:'<span class="caret"></span>'},maxOptions:!1,mobile:!1,selectOnTab:!1,dropdownAlignRight:!1,windowPadding:0,virtualScroll:600,display:!1,sanitize:!0,sanitizeFn:null,whiteList:e},J.prototype={constructor:J,init:function(){var i=this,e=this.$element.attr("id");this.selectId=R++,this.$element[0].classList.add("bs-select-hidden"),this.multiple=this.$element.prop("multiple"),this.autofocus=this.$element.prop("autofocus"),this.options.showTick=this.$element[0].classList.contains("show-tick"),this.$newElement=this.createDropdown(),this.$element.after(this.$newElement).prependTo(this.$newElement),this.$button=this.$newElement.children("button"),this.$menu=this.$newElement.children(V.MENU),this.$menuInner=this.$menu.children(".inner"),this.$searchbox=this.$menu.find("input"),this.$element[0].classList.remove("bs-select-hidden"),!0===this.options.dropdownAlignRight&&this.$menu[0].classList.add(j.MENUR
13IGHT),void 0!==e&&this.$button.attr("data-id",e),this.checkDisabled(),this.clickListener(),this.options.liveSearch&&this.liveSearchListener(),this.setStyle(),this.render(),this.setWidth(),this.options.container?this.selectPosition():this.$element.on("hide"+U,function(){if(i.isVirtual()){var e=i.$menuInner[0],t=e.firstChild.cloneNode(!1);e.replaceChild(t,e.firstChild),e.scrollTop=0}}),this.$menu.data("this",this),this.$newElement.data("this",this),this.options.mobile&&this.mobile(),this.$newElement.on({"hide.bs.dropdown":function(e){i.$menuInner.attr("aria-expanded",!1),i.$element.trigger("hide"+U,e)},"hidden.bs.dropdown":function(e){i.$element.trigger("hidden"+U,e)},"show.bs.dropdown":function(e){i.$menuInner.attr("aria-expanded",!0),i.$element.trigger("show"+U,e)},"shown.bs.dropdown":function(e){i.$element.trigger("shown"+U,e)}}),i.$element[0].hasAttribute("required")&&this.$element.on("invalid"+U,function(){i.$button[0].classList.add("bs-invalid"),i.$element.on("shown"+U+".invalid",function(){i.$element.val(i.$element.val()).off("shown"+U+".invalid")}).on("rendered"+U,function(){this.validity.valid&&i.$button[0].classList.remove("bs-invalid"),i.$element.off("rendered"+U)}),i.$button.on("blur"+U,function(){i.$element.trigger("focus").trigger("blur"),i.$button.off("blur"+U)})}),setTimeout(function(){i.createLi(),i.$element.trigger("loaded"+U)})},createDropdown:function(){var e=this.multiple||this.options.showTick?" show-tick":"",t="",i=this.autofocus?" autofocus":"";M.major<4&&this.$element.parent().hasClass("input-group")&&(t=" input-group-btn");var s,n="",o="",l="",r="";return this.options.header&&(n='<div class="'+j.POPOVERHEADER+'"><button type="button" class="close" aria-hidden="true">&times;</button>'+this.options.header+"</div>"),this.options.liveSearch&&(o='<div class="bs-searchbox"><input type="text" class="form-control" autocomplete="off"'+(null===this.options.liveSearchPlaceholder?"":' placeholder="'+O(this.options.liveSearchPlaceholder)+'"')+' role="textbox" aria-label="Search"></div>'),this.multiple&&this.options.actionsBox&&(l='<div class="bs-actionsbox"><div class="btn-group btn-group-sm btn-block"><button type="button" class="actions-btn bs-select-all btn '+j.BUTTONCLASS+'">'+this.options.selectAllText+'</button><button type="button" class="actions-btn bs-deselect-all btn '+j.BUTTONCLASS+'">'+this.options.deselectAllText+"</button></div></div>"),this.multiple&&this.options.doneButton&&(r='<div class="bs-donebutton"><div class="btn-group btn-block"><button type="button" class="btn btn-sm '+j.BUTTONCLASS+'">'+this.options.doneButtonText+"</button></div></div>"),s='<div class="dropdown bootstrap-select'+e+t+'"><button type="button" class="'+this.options.styleBase+' dropdown-toggle" '+("static"===this.options.display?'data-display="static"':"")+'data-toggle="dropdown"'+i+' role="button"><div class="filter-option"><div class="filter-option-inner"><div class="filter-option-inner-inner"></div></div> </div>'+("4"===M.major?"":'<span class="bs-caret">'+this.options.template.caret+"</span>")+'</button><div class="'+j.MENU+" "+("4"===M.major?"":j.SHOW)+'" role="combobox">'+n+o+l+'<div class="inner '+j.SHOW+'" role="listbox" aria-expanded="false" tabindex="-1"><ul class="'+j.MENU+" inner "+("4"===M.major?j.SHOW:"")+'"></ul></div>'+r+"</div></div>",z(s)},setPositionData:function(){this.selectpicker.view.canHighlight=[];for(var e=0;e<this.selectpicker.current.data.length;e++){var t=this.selectpicker.current.data[e],i=!0;"divider"===t.type?(i=!1,t.height=this.sizeInfo.dividerHeight):"optgroup-label"===t.type?(i=!1,t.height=this.sizeInfo.dropdownHeaderHeight):t.height=this.sizeInfo.liHeight,t.disabled&&(i=!1),this.selectpicker.view.canHighlight.push(i),t.position=(0===e?0:this.selectpicker.current.data[e-1].position)+t.height}},isVirtual:function(){return!1!==this.options.virtualScroll&&this.selectpicker.main.elements.length>=this.options.virtualScroll||!0===this.options.virtualScroll},createView:function(T,e){e=e||0;var A=this;this.selectpicker.current=T?this.selectpicker.search:this.selectpicker.main;var N,D,H=[];function i(e,t){var i,s,n,o,l,r,a,c,d,h,p=A.selectpicker.current.elements.length,u=[],f=!0,m=A.isVirtual();A.selectpicker.view.scrollTop=e,!0===m&&A.sizeInfo.hasScrollBar&&A.$menu[0].offsetWidth>A.sizeInfo.totalMenuWidth&&(A.sizeInfo.menuWidth=A.$menu[0].offsetWidth,A.sizeInfo.totalMenuWidth=A.sizeInfo.menuWidth+A.sizeInfo.scrollBarWidth,A.$menu.css("min-width",A.sizeInfo.menuWidth)),i=Math.ceil(A.sizeInfo.menuInnerHeight/A.sizeInfo.liHeight*1.5),s=Math.round(p/i)||1;for(var v=0;v<s;v++){var g=(v+1)*i;if(v===s-1&&(g=p),u[v]=[v*i+(v?1:0),g],!p)break;void 0===l&&e<=A.selectpicker.current.data[g-1].position-A.sizeInfo.menuInnerHeight&&(l=v)}if(void 0===l&&(l=0),r=[A.selectpicker.view.position0,A.selectpicker.view.position1],n=Math.max(0,l-1),o=Math.min(s-1,l+1),A.selectpicker.view.position0=!1===m?0:Math.max(0,u[n][0])||0,A.selectpicker.view.position1=!1===m?p:Math.min(p,u[o][1])||0,a=r[0]!==A.selectpicker.view.position0||r[1]!==A.selectpicker.view.position1,void 0!==A.activeIndex&&(D=A.selectpicker.main.elements[A.prevActiveIndex],H=A.selectpicker.main.elements[A.activeIndex],N=A.selectpicker.main.elements[A.selectedIndex],t&&(A.activeIndex!==A.selectedIndex&&H&&H.length&&(H.classList.remove("active"),H.firstChild&&H.firstChild.classList.remove("active")),A.activeIndex=void 0),A.activeIndex&&A.activeIndex!==A.selectedIndex&&N&&N.length&&(N.classList.remove("active"),N.firstChild&&N.firstChild.classList.remove("active"))),void 0!==A.prevActiveIndex&&A.prevActiveIndex!==A.activeIndex&&A.prevActiveIndex!==A.selectedIndex&&D&&D.length&&(D.classList.remove("active"),D.firstChild&&D.firstChild.classList.remove("active")),(t||a)&&(c=A.selectpicker.view.visibleElements?A.selectpicker.view.visibleElements.slice():[],A.selectpicker.view.visibleElements=!1===m?A.selectpicker.current.elements:A.selectpicker.current.elements.slice(A.selectpicker.view.position0,A.selectpicker.view.position1),A.setOptionStatus(),(T||!1===m&&t)&&(d=c,h=A.selectpicker.view.visibleElements,f=!(d.length===
13h.length&&d.every(function(e,t){return e===h[t]}))),(t||!0===m)&&f)){var b,w,x=A.$menuInner[0],I=document.createDocumentFragment(),k=x.firstChild.cloneNode(!1),$=A.selectpicker.view.visibleElements,y=[];x.replaceChild(k,x.firstChild);v=0;for(var S=$.length;v<S;v++){var E,C,O=$[v];A.options.sanitize&&(E=O.lastChild)&&(C=A.selectpicker.current.data[v+A.selectpicker.view.position0])&&C.content&&!C.sanitized&&(y.push(E),C.sanitized=!0),I.appendChild(O)}A.options.sanitize&&y.length&&B(y,A.options.whiteList,A.options.sanitizeFn),!0===m&&(b=0===A.selectpicker.view.position0?0:A.selectpicker.current.data[A.selectpicker.view.position0-1].position,w=A.selectpicker.view.position1>p-1?0:A.selectpicker.current.data[p-1].position-A.selectpicker.current.data[A.selectpicker.view.position1-1].position,x.firstChild.style.marginTop=b+"px",x.firstChild.style.marginBottom=w+"px"),x.firstChild.appendChild(I)}if(A.prevActiveIndex=A.activeIndex,A.options.liveSearch){if(T&&t){var z,L=0;A.selectpicker.view.canHighlight[L]||(L=1+A.selectpicker.view.canHighlight.slice(1).indexOf(!0)),z=A.selectpicker.view.visibleElements[L],A.selectpicker.view.currentActive&&(A.selectpicker.view.currentActive.classList.remove("active"),A.selectpicker.view.currentActive.firstChild&&A.selectpicker.view.currentActive.firstChild.classList.remove("active")),z&&(z.classList.add("active"),z.firstChild&&z.firstChild.classList.add("active")),A.activeIndex=(A.selectpicker.current.data[L]||{}).index}}else A.$menuInner.trigger("focus")}this.setPositionData(),i(e,!0),this.$menuInner.off("scroll.createView").on("scroll.createView",function(e,t){A.noScroll||i(this.scrollTop,t),A.noScroll=!1}),z(window).off("resize"+U+"."+this.selectId+".createView").on("resize"+U+"."+this.selectId+".createView",function(){A.$newElement.hasClass(j.SHOW)&&i(A.$menuInner[0].scrollTop)})},setPlaceholder:function(){var e=!1;if(this.options.title&&!this.multiple){this.selectpicker.view.titleOption||(this.selectpicker.view.titleOption=document.createElement("option")),e=!0;var t=this.$element[0],i=!1,s=!this.selectpicker.view.titleOption.parentNode;if(s)this.selectpicker.view.titleOption.className="bs-title-option",this.selectpicker.view.titleOption.value="",i=void 0===z(t.options[t.selectedIndex]).attr("selected")&&void 0===this.$element.data("selected");(s||0!==this.selectpicker.view.titleOption.index)&&t.insertBefore(this.selectpicker.view.titleOption,t.firstChild),i&&(t.selectedIndex=0)}return e},createLi:function(){var a=this,f=this.options.iconBase,m=':not([hidden]):not([data-hidden="true"])',v=[],g=[],c=0,b=0,e=this.setPlaceholder()?1:0;this.options.hideDisabled&&(m+=":not(:disabled)"),!a.options.showTick&&!a.multiple||F.checkMark.parentNode||(F.checkMark.className=f+" "+a.options.tickIcon+" check-mark",F.a.appendChild(F.checkMark));var t=this.$element[0].querySelectorAll("select > *"+m);function w(e){var t=g[g.length-1];t&&"divider"===t.type&&(t.optID||e.optID)||((e=e||{}).type="divider",v.push(G(!1,j.DIVIDER,e.optID?e.optID+"div":void 0)),g.push(e))}function x(e,t){if((t=t||{}).divider="true"===e.getAttribute("data-divider"),t.divider)w({optID:t.optID});else{var i=g.length,s=e.style.cssText,n=s?O(s):"",o=(e.className||"")+(t.optgroupClass||"");t.optID&&(o="opt "+o),t.text=e.textContent,t.content=e.getAttribute("data-content"),t.tokens=e.getAttribute("data-tokens"),t.subtext=e.getAttribute("data-subtext"),t.icon=e.getAttribute("data-icon"),t.iconBase=f;var l=Y(t);v.push(G(K(l,o,n),"",t.optID)),e.liIndex=i,t.display=t.content||t.text,t.type="option",t.index=i,t.option=e,t.disabled=t.disabled||e.disabled,g.push(t);var r=0;t.display&&(r+=t.display.length),t.subtext&&(r+=t.subtext.length),t.icon&&(r+=1),c<r&&(c=r,a.selectpicker.view.widestOption=v[v.length-1])}}function i(e,t){var i=t[e],s=t[e-1],n=t[e+1],o=i.querySelectorAll("option"+m);if(o.length){var l,r,a={label:O(i.label),subtext:i.getAttribute("data-subtext"),icon:i.getAttribute("data-icon"),iconBase:f},c=" "+(i.className||"");b++,s&&w({optID:b});var d=Z(a);v.push(G(d,"dropdown-header"+c,b)),g.push({display:a.label,subtext:a.subtext,type:"optgroup-label",optID:b});for(var h=0,p=o.length;h<p;h++){var u=o[h];0===h&&(r=(l=g.length-1)+p),x(u,{headerIndex:l,lastIndex:r,optID:b,optgroupClass:c,disabled:i.disabled})}n&&w({optID:b})}}for(var s=t.length;e<s;e++){var n=t[e];"OPTGROUP"!==n.tagName?x(n,{}):i(e,t)}this.selectpicker.main.elements=v,this.selectpicker.main.data=g,this.selectpicker.current=this.selectpicker.main}
13,findLis:function(){return this.$menuInner.find(".inner > li")},render:function(){this.setPlaceholder();var e,t,i=this,s=this.$element[0].selectedOptions,n=s.length,o=this.$button[0],l=o.querySelector(".filter-option-inner-inner"),r=document.createTextNode(this.options.multipleSeparator),a=F.fragment.cloneNode(!1),c=!1;if(this.togglePlaceholder(),this.tabIndex(),"static"===this.options.selectedTextFormat)a=Y({text:this.options.title},!0);else if((e=this.multiple&&-1!==this.options.selectedTextFormat.indexOf("count")&&1<n)&&(e=1<(t=this.options.selectedTextFormat.split(">")).length&&n>t[1]||1===t.length&&2<=n),!1===e){for(var d=0;d<n&&d<50;d++){var h=s[d],p={},u={content:h.getAttribute("data-content"),subtext:h.getAttribute("data-subtext"),icon:h.getAttribute("data-icon")};this.multiple&&0<d&&a.appendChild(r.cloneNode(!1)),h.title?p.text=h.title:u.content&&i.options.showContent?(p.content=u.content.toString(),c=!0):(i.options.showIcon&&(p.icon=u.icon,p.iconBase=this.options.iconBase),i.options.showSubtext&&!i.multiple&&u.subtext&&(p.subtext=" "+u.subtext),p.text=h.textContent.trim()),a.appendChild(Y(p,!0))}49<n&&a.appendChild(document.createTextNode("..."))}else{var f=':not([hidden]):not([data-hidden="true"]):not([data-divider="true"])';this.options.hideDisabled&&(f+=":not(:disabled)");var m=this.$element[0].querySelectorAll("select > option"+f+", optgroup"+f+" option"+f).length,v="function"==typeof this.options.countSelectedText?this.options.countSelectedText(n,m):this.options.countSelectedText;a=Y({text:v.replace("{0}",n.toString()).replace("{1}",m.toString())},!0)}if(null==this.options.title&&(this.options.title=this.$element.attr("title")),a.childNodes.length||(a=Y({text:void 0!==this.options.title?this.options.title:this.options.noneSelectedText},!0)),o.title=a.textContent.replace(/<[^>]*>?/g,"").trim(),this.options.sanitize&&c&&B([a],i.options.whiteList,i.options.sanitizeFn),l.innerHTML="",l.appendChild(a),M.major<4&&this.$newElement[0].classList.contains("bs3-has-addon")){var g=o.querySelector(".filter-expand"),b=l.cloneNode(!0);b.className="filter-expand",g?o.replaceChild(b,g):o.appendChild(b)}this.$element.trigger("rendered"+U)},setStyle:function(e,t){var i,s=this.$button[0],n=this.$newElement[0],o=this.options.style.trim();this.$element.attr("class")&&this.$newElement.addClass(this.$element.attr("class").replace(/selectpicker|mobile-device|bs-select-hidden|validate\[.*\]/gi,"")),M.major<4&&(n.classList.add("bs3"),n.parentNode.classList.contains("input-group")&&(n.previousElementSibling||n.nextElementSibling)&&(n.previousElementSibling||n.nextElementSibling).classList.contains("input-group-addon")&&n.classList.add("bs3-has-addon")),i=e?e.trim():o,"add"==t?i&&s.classList.add.apply(s.classList,i.split(" ")):"remove"==t?i&&s.classList.remove.apply(s.classList,i.split(" ")):(o&&s.classList.remove.apply(s.classList,o.split(" ")),i&&s.classList.add.apply(s.classList,i.split(" ")))},liHeight:function(e){if(e||!1!==this.options.size&&!this.sizeInfo){this.sizeInfo||(this.sizeInfo={});var t=document.createElement("div"),i=document.createElement("div"),s=document.createElement("div"),n=document.createElement("ul"),o=document.createElement("li"),l=document.createElement("li"),r=document.createElement("li"),a=document.createElement("a"),c=document.createElement("span"),d=this.options.header&&0<this.$menu.find("."+j.POPOVERHEADER).length?this.$menu.find("."+j.POPOVERHEADER)[0].cloneNode(!0):null,h=this.options.liveSearch?document.createElement("div"):null,p=this.options.actionsBox&&this.multiple&&0<this.$menu.find(".bs-actionsbox").length?this.$menu.find(".bs-actionsbox")[0].cloneNode(!0):null,u=this.options.doneButton&&this.multiple&&0<this.$menu.find(".bs-donebutton").length?this.$menu.find(".bs-donebutton")[0].cloneNode(!0):null,f=this.$element.find("option")[0];if(this.sizeInfo.selectWidth=this.$newElement[0].offsetWidth,c.className="text",a.className="dropdown-item "+(f?f.className:""),t.className=this.$menu[0].parentNode.className+" "+j.SHOW,t.style.width=this.sizeInfo.selectWidth+"px","auto"===this.options.width&&(i.style.minWidth=0),i.className=j.MENU+" "+j.SHOW,s.className="inner "+j.SHOW,n.className=j.MENU+" inner "+("4"===M.major?j.SHOW:""),o.className=j.DIVIDER,l.className="dropdown-header",c.appendChild(document.createTextNode("\u200b")),a.appendChild(c),r.appendChild(a),l.appendChild(c.cloneNode(!0)),this.selectpicker.view.widestOption&&n.appendChild(this.selectpicker.view.widestOption.cloneNode(!0)),n.appendChild(r),n.appendChild(o),n.appendChild(l),d&&i.appendChild(d),h){var m=document.createElement("input");h.className="bs-searchbox",m.className="form-control",h.appendChild(m),i.appendChild(h)}p&&i.appendChild(p),s.appendChild(n),i.appendChild(s),u&&i.appendChild(u),t.appendChild(i),document.body.appendChild(t);var v,g=r.offsetHeight,b=l?l.offsetHeight:0,w=d?d.offsetHeight:0,x=h?h.offsetHeight:0,I=p?p.offsetHeight:0,k=u?u.offsetHeight:0,$=z(o).outerHeight(!0),y=!!window.getComputedStyle&&window.getComputedStyle(i),S=i.offsetWidth,E=y?null:z(i),C={vert:L(y?y.paddingTop:E.css("paddingTop"))+L(y?y.paddingBottom:E.css("paddingBottom"))+L(y?y.borderTopWidth:E.css("borderTopWidth"))+L(y?y.borderBottomWidth:E.css("borderBottomWidth")),horiz:L(y?y.paddingLeft:E.css("paddingLeft"))+L(y?y.paddingRight:E.css("paddingRight"))+L(y?y.borderLeftWidth:E.css("borderLeftWidth"))+L(y?y.borderRightWidth:E.css("borderRightWidth"))},O={vert:C.vert+L(y?y.marginTop:E.css("marginTop"))+L(y?y.marginBottom:E.css("marginBottom"))+2,horiz:C.horiz+L(y?y.marginLeft:E.css("marginLeft"))+L(y?y.marginRight:E.css("marginRight"))+2};s.style.overflowY="scroll",v=i.offsetWidth-S,document.body.removeChild(t),this.sizeInfo.liHeight=g,this.sizeInfo.dropdownHeaderHeight=b,this.sizeInfo.headerHeight=w,this.sizeInfo.searchHeight=x,this.sizeInfo.actionsHeight=I,this.sizeInfo.doneButtonHeight=k,this.sizeInfo.dividerHeight=$,this.sizeInfo.menuPadding=C,this.sizeInfo.menuExtras=O,this.sizeInfo.menuWidth=S,this.sizeInfo.totalMenuWidth=this.sizeInfo.menuWidth,this.sizeInfo.scrollBarWidth=v,this.sizeInfo.selectHeight=this.$newElement[0].offsetHeight,this.setPositionData()}},getSelectPosition:function(){var e,t=z(window),i=this.$newElement.offset(),s=z(this.options.container);this.options.container&&s.length&&!s.is("body")?((e=s.offset()).top+=parseInt(s.css("borderTopWidth")),e.left+=parseInt(s.css("borderLeftWidth"))):e={top:0,left:0};var n=this.options.windowPadding;this.sizeInfo.selectOffsetTop=i.top-e.top-t.scrollTop(),this.sizeInfo.selectOffsetBot=t.height()-this.sizeInfo.selectOffsetTop-this.sizeInfo.selectHeight-e.top-n[2],this.sizeInfo.selectOffsetLeft=i.left-e.left-t.scrollLeft(),this.sizeInfo.selectOffsetRight=t.width()-this.sizeInfo.selectOffsetLeft-this.sizeInfo.selectWidth-e.left-n[1],this.sizeInfo.selectOffsetTop-=n[0],this.sizeInfo.selectOffsetLeft-=n[3]}
13,setMenuSize:function(e){this.getSelectPosition();var t,i,s,n,o,l,r,a=this.sizeInfo.selectWidth,c=this.sizeInfo.liHeight,d=this.sizeInfo.headerHeight,h=this.sizeInfo.searchHeight,p=this.sizeInfo.actionsHeight,u=this.sizeInfo.doneButtonHeight,f=this.sizeInfo.dividerHeight,m=this.sizeInfo.menuPadding,v=0;if(this.options.dropupAuto&&(r=c*this.selectpicker.current.elements.length+m.vert,this.$newElement.toggleClass(j.DROPUP,this.sizeInfo.selectOffsetTop-this.sizeInfo.selectOffsetBot>this.sizeInfo.menuExtras.vert&&r+this.sizeInfo.menuExtras.vert+50>this.sizeInfo.selectOffsetBot)),"auto"===this.options.size)n=3<this.selectpicker.current.elements.length?3*this.sizeInfo.liHeight+this.sizeInfo.menuExtras.vert-2:0,i=this.sizeInfo.selectOffsetBot-this.sizeInfo.menuExtras.vert,s=n+d+h+p+u,l=Math.max(n-m.vert,0),this.$newElement.hasClass(j.DROPUP)&&(i=this.sizeInfo.selectOffsetTop-this.sizeInfo.menuExtras.vert),t=(o=i)-d-h-p-u-m.vert;else if(this.options.size&&"auto"!=this.options.size&&this.selectpicker.current.elements.length>this.options.size){for(var g=0;g<this.options.size;g++)"divider"===this.selectpicker.current.data[g].type&&v++;t=(i=c*this.options.size+v*f+m.vert)-m.vert,o=i+d+h+p+u,s=l=""}"auto"===this.options.dropdownAlignRight&&this.$menu.toggleClass(j.MENURIGHT,this.sizeInfo.selectOffsetLeft>this.sizeInfo.selectOffsetRight&&this.sizeInfo.selectOffsetRight<this.sizeInfo.totalMenuWidth-a),this.$menu.css({"max-height":o+"px",overflow:"hidden","min-height":s+"px"}),this.$menuInner.css({"max-height":t+"px","overflow-y":"auto","min-height":l+"px"}),this.sizeInfo.menuInnerHeight=Math.max(t,1),this.selectpicker.current.data.length&&this.selectpicker.current.data[this.selectpicker.current.data.length-1].position>this.sizeInfo.menuInnerHeight&&(this.sizeInfo.hasScrollBar=!0,this.sizeInfo.totalMenuWidth=this.sizeInfo.menuWidth+this.sizeInfo.scrollBarWidth,this.$menu.css("min-width",this.sizeInfo.totalMenuWidth)),this.dropdown&&this.dropdown._popper&&this.dropdown._popper.update()},setSize:function(e){if(this.liHeight(e),this.options.header&&this.$menu.css("padding-top",0),!1!==this.options.size){var t,i=this,s=z(window),n=0;if(this.setMenuSize(),this.options.liveSearch&&this.$searchbox.off("input.setMenuSize propertychange.setMenuSize").on("input.setMenuSize propertychange.setMenuSize",function(){return i.setMenuSize()}),"auto"===this.options.size?s.off("resize"+U+"."+this.selectId+".setMenuSize scroll"+U+"."+this.selectId+".setMenuSize").on("resize"+U+"."+this.selectId+".setMenuSize scroll"+U+"."+this.selectId+".setMenuSize",function(){return i.setMenuSize()}):this.options.size&&"auto"!=this.options.size&&this.selectpicker.current.elements.length>this.options.size&&s.off("resize"+U+"."+this.selectId+".setMenuSize scroll"+U+"."+this.selectId+".setMenuSize"),e)n=this.$menuInner[0].scrollTop;else if(!i.multiple){var o=i.$element[0];"number"==typeof(t=(o.options[o.selectedIndex]||{}).liIndex)&&!1!==i.options.size&&(n=(n=i.sizeInfo.liHeight*t)-i.sizeInfo.menuInnerHeight/2+i.sizeInfo.liHeight/2)}i.createView(!1,n)}},setWidth:function(){var i=this;"auto"===this.options.width?requestAnimationFrame(function(){i.$menu.css("min-width","0"),i.$element.on("loaded"+U,function(){i.liHeight(),i.setMenuSize();var e=i.$newElement.clone().appendTo("body"),t=e.css("width","auto").children("button").outerWidth();e.remove(),i.sizeInfo.selectWidth=Math.max(i.sizeInfo.totalMenuWidth,t),i.$newElement.css("width",i.sizeInfo.selectWidth+"px")})}):"fit"===this.options.width?(this.$menu.css("min-width",""),this.$newElement.css("width","").addClass("fit-width")):this.options.width?(this.$menu.css("min-width",""),this.$newElement.css("width",this.options.width)):(this.$menu.css("min-width",""),this.$newElement.css("width","")),this.$newElement.hasClass("fit-width")&&"fit"!==this.options.width&&this.$newElement[0].classList.remove("fit-width")},selectPosition:function(){this.$bsContainer=z('<div class="bs-container" />');var s,n,o,l=this,r=z(this.options.container),e=function(e){var t={},i=l.options.display||!!z.fn.dropdown.Constructor.Default&&z.fn.dropdown.Constructor.Default.display;l.$bsContainer.addClass(e.attr("class").replace(/form-control|fit-width/gi,"")).toggleClass(j.DROPUP,e.hasClass(j.DROPUP)),s=e.offset(),r.is("body")?n={top:0,left:0}:((n=r.offset()).top+=parseInt(r.css("borderTopWidth"))-r.scrollTop(),n.left+=parseInt(r.css("borderLeftWidth"))-r.scrollLeft()),o=e.hasClass(j.DROPUP)?0:e[0].offsetHeight,(M.major<4||"static"===i)&&(t.top=s.top-n.top+o,t.left=s.left-n.left),t.width=e[0].offsetWidth,l.$bsContainer.css(t)};this.$button.on("click.bs.dropdown.data-api",function(){l.isDisabled()||(e(l.$newElement),l.$bsContainer.appendTo(l.options.container).toggleClass(j.SHOW,!l.$button.hasClass(j.SHOW)).append(l.$menu))}),z(window).off("resize"+U+"."+this.selectId+" scroll"+U+"."+this.selectId).on("resize"+U+"."+this.selectId+" scroll"+U+"."+this.selectId,function(){l.$newElement.hasClass(j.SHOW)&&e(l.$newElement)}),this.$element.on("hide"+U,function(){l.$menu.data("height",l.$menu.height()),l.$bsContainer.detach()})},setOptionStatus:function(){var e=this;if(e.noScroll=!1,e.selectpicker.view.visibleElements&&e.selectpicker.view.visibleElements.length)for(var t=0;t<e.selectpicker.view.visibleElements.length;t++){var i=e.selectpicker.current.data[t+e.selectpicker.view.position0],s=i.option;s&&(e.setDisabled(i.index,i.disabled),e.setSelected(i.index,s.selected))}},setSelected:function(e,t){var i,s,n=this.selectpicker.main.elements[e],o=this.selectpicker.main.data[e],l=void 0!==this.activeIndex,r=this.activeIndex===e||t&&!this.multiple&&!l;o.selected=t,s=n.firstChild,t&&(this.selectedIndex=e),n.classList.toggle("selected",t),n.classList.toggle("active",r),r&&(this.selectpicker.view.currentActive=n,this.activeIndex=e),s&&(s.classList.toggle("selected",t),s.classList.toggle("active",r),s.setAttribute("aria-selected",t)),r||!l&&t&&void 0!==this.prevActiveIndex&&((i=this.selectpicker.main.elements[this.prevActiveIndex]).classList.remove("active"),i.firstChild&&i.firstChild.classList.remove("active"))},setDisabled:function(e,t){var i,s=this.selectpicker.main.elements[e];this.selectpicker.main.data[e].disabled=t,i=s.firstChild,s.classList.toggle(j.DISABLED,t),i&&("4"===M.major&&i.classList.toggle(j.DISABLED,t),i.setAttribute("aria-disabled",t),t?i.setAttribute("tabindex",-1):i.setAttribute("tabindex",0))},isDisabled:function(){return this.$element[0].disabled},checkDisabled:function(){var e=this;this.isDisabled()?(this.$newElement[0].classList.add(j.DISABLED),this.$button.addClass(j.DISABLED).attr("tabindex",-1).attr("aria-disabled",!0)):(this.$button[0].classList.contains(j.DISABLED)&&(this.$newElement[0].classList.remove(j.DISABLED),this.$button.removeClass(j.DISABLED).attr("aria-disabled",!1)),-1!=this.$button.attr("tabindex")||this.$element.data("tabindex")||this.$button.removeAttr("tabindex")),this.$button.on("click",function(){return!e.isDisabled()})},togglePlaceholder:function(){var e=this.$element[0],t=e.selectedIndex,i=-1===t;i||e.options[t].value||(i=!0),this.$button.toggleClass("bs-placeholder",i)},tabIndex:function(){this.$element.data("tabindex")!==this.$element.attr("tabindex")&&-98!==this.$element.attr("tabindex")&&"-98"!==this.$element.attr("tabindex")&&(this.$element.data("tabindex",this.$element.attr("tabindex")),this.$button.attr("tabindex",this.$element.data("tabindex"))),this.$element.attr("tabindex",-98)},clickListener:function(){var S=this,t=z(document);function e(){S.options.liveSearch?S.$searchbox.trigger("focus"):S.$menuInner.trigger("focus")}function i(){S.dropdown&&S.dropdown._popper&&S.dropdown._popper.state.isCreated?e():requestAnimationFrame(i)}t.data("spaceSelect",!1),this.$button.on("keyup",function(e){/(32)/.test(e.keyCode.toString(10))&&t.data("spaceSelect")&&(e.preventDefault(),t.data("spaceSelect",!1))}),this.$newElement.on("show.bs.dropdown",function(){3<M.major&&!S.dropdown&&(S.dropdown=S.$button.data("bs.dropdown"),S.dropdown._menu=S.$menu[0])}),this.$button.on("click.bs.dropdown.data-api",function(){S.$newElement.hasClass(j.SHOW)||S.setSize()}),this.$element.on("shown"+U,function(){S.$menuInner[0].scrollTop!==S.selectpicker.view.scrollTop&&(S.$menuInner[0].scrollTop=S.selectpicker.view.scrollTop),3<M.major?requestAnimationFrame(i):e()}),this.$menuInner.on("click","li a",function(e,t){var i=z(this),s=S.isVirtual()?S.selectpicker.view.position0:0,n=S.selectpicker.current.data[i.parent().index()+s],o=n.index,l=E(S.$element[0]),r=S.$element.prop("selectedIndex"),a=!0;if(S.multiple&&1!==S.options.maxOptions&&e.stopPropagation(),e.preventDefault(),!S.isDisabled()&&!i.parent().hasClass(j.DISABLED)){var c=S.$element.find("option"),d=n.option,h=z(d),p=d.selected,u=h.parent("optgroup"),f=u.find("option"),m=S.options.maxOptions,v=u.data("maxOptions")||!1;if(o===S.activeIndex&&(t=!0),t||(S.prevActiveIndex=S.activeIndex,S.activeIndex=void 0),S.multiple){if(d.selected=!p,S.setSelected(o,!p),i.trigger("blur"),!1!==m||!1!==v){var g=m<c.filter(":selected").length,b=v<u.find("option:selected").length;if(m&&g||v&&b)if(m&&1==m){c.prop("selected",!1),h.prop("selected",!0);for(var w=0;w<c.length;w++)S.setSelected(w,!1);S.setSelected(o,!0)}else if(v&&1==v){u.find("option:selected").prop("selected",!1),h.prop("selected",!0);for(w=0;w<f.length;w++){d=f[w];S.setSelected(c.index(d),!1)}S.setSelected(o,!0)}else{var x="string"==typeof S.options.maxOptionsText?[S.options.maxOptionsText,S.options.maxOptionsText]:S.options.maxOptionsText,I="function"==typeof x?x(m,v):x,k=I[0].replace("{n}",m),$=I[1].replace("{n}",v),y=z('<div class="notify"></div>');I[2]&&(k=k.replace("{var}",I[2][1<m?0:1]),$=$.replace("{var}",I[2][1<v?0:1])),h.prop("selected",!1),S.$menu.append(y),m&&g&&(y.append(z("<div>"+k+"</div>")),a=!1,S.$element.trigger("maxReached"+U)),v&&b&&(y.append(z("<div>"+$+"</div>")),a=!1,S.$element.trigger("maxReachedGrp"+U)),setTimeout(function(){S.setSelected(o,!1)},10),y.delay(750).fadeOut(300,function(){z(this).remove()})}}}else c.prop("selected",!1),d.selected=!0,S.setSelected(o,!0);!S.multiple||S.multiple&&1===S.options.maxOptions?S.$button.trigger("focus"):S.options.liveSearch&&S.$searchbox.trigger("focus"),a&&(l!=E(S.$element[0])&&S.multiple||r!=S.$element.prop("selectedIndex")&&!S.multiple)&&(C=[d.index,h.prop("selected"),l],S.$element.triggerNative("change"))}}),this.$menu.on("click","li."+j.DISABLED+" a, ."+j.POPOVERHEADER+", ."+j.POPOVERHEADER+" :not(.close)",function(e){e.currentTarget==this&&(e.preventDefault(),e.stopPropagation(),S.options.liveSearch&&!z(e.target).hasClass("close")?S.$searchbox.trigger("focus"):S.$button.trigger("focus"))}
13),this.$menuInner.on("click",".divider, .dropdown-header",function(e){e.preventDefault(),e.stopPropagation(),S.options.liveSearch?S.$searchbox.trigger("focus"):S.$button.trigger("focus")}),this.$menu.on("click","."+j.POPOVERHEADER+" .close",function(){S.$button.trigger("click")}),this.$searchbox.on("click",function(e){e.stopPropagation()}),this.$menu.on("click",".actions-btn",function(e){S.options.liveSearch?S.$searchbox.trigger("focus"):S.$button.trigger("focus"),e.preventDefault(),e.stopPropagation(),z(this).hasClass("bs-select-all")?S.selectAll():S.deselectAll()}),this.$element.on("change"+U,function(){S.render(),S.$element.trigger("changed"+U,C),C=null}).on("focus"+U,function(){S.options.mobile||S.$button.trigger("focus")})},liveSearchListener:function(){var u=this,f=document.createElement("li");this.$button.on("click.bs.dropdown.data-api",function(){u.$searchbox.val()&&u.$searchbox.val("")}),this.$searchbox.on("click.bs.dropdown.data-api focus.bs.dropdown.data-api touchend.bs.dropdown.data-api",function(e){e.stopPropagation()}),this.$searchbox.on("input propertychange",function(){var e=u.$searchbox.val();if(u.selectpicker.search.elements=[],u.selectpicker.search.data=[],e){var t=[],i=e.toUpperCase(),s={},n=[],o=u._searchStyle(),l=u.options.liveSearchNormalize;l&&(i=w(i)),u._$lisSelected=u.$menuInner.find(".selected");for(var r=0;r<u.selectpicker.main.data.length;r++){var a=u.selectpicker.main.data[r];s[r]||(s[r]=$(a,i,o,l)),s[r]&&void 0!==a.headerIndex&&-1===n.indexOf(a.headerIndex)&&(0<a.headerIndex&&(s[a.headerIndex-1]=!0,n.push(a.headerIndex-1)),s[a.headerIndex]=!0,n.push(a.headerIndex),s[a.lastIndex+1]=!0),s[r]&&"optgroup-label"!==a.type&&n.push(r)}r=0;for(var c=n.length;r<c;r++){var d=n[r],h=n[r-1],p=(a=u.selectpicker.main.data[d],u.selectpicker.main.data[h]);("divider"!==a.type||"divider"===a.type&&p&&"divider"!==p.type&&c-1!==r)&&(u.selectpicker.search.data.push(a),t.push(u.selectpicker.main.elements[d]))}u.activeIndex=void 0,u.noScroll=!0,u.$menuInner.scrollTop(0),u.selectpicker.search.elements=t,u.createView(!0),t.length||(f.className="no-results",f.innerHTML=u.options.noneResultsText.replace("{0}",'"'+O(e)+'"'),u.$menuInner[0].firstChild.appendChild(f))}else u.$menuInner.scrollTop(0),u.createView(!1)})},_searchStyle:function(){return this.options.liveSearchStyle||"contains"},val:function(e){if(void 0===e)return this.$element.val();var t=E(this.$element[0]);return C=[null,null,t],this.$element.val(e).trigger("changed"+U,C),this.render(),C=null,this.$element},changeAll:function(e){if(this.multiple){void 0===e&&(e=!0);var t=this.$element[0],i=0,s=0,n=E(t);t.classList.add("bs-select-hidden");for(var o=0,l=this.selectpicker.current.elements.length;o<l;o++){var r=this.selectpicker.current.data[o],a=r.option;a&&!r.disabled&&"divider"!==r.type&&(r.selected&&i++,(a.selected=e)&&s++)}t.classList.remove("bs-select-hidden"),i!==s&&(this.setOptionStatus(),this.togglePlaceholder(),C=[null,null,n],this.$element.triggerNative("change"))}},selectAll:function(){return this.changeAll(!0)},deselectAll:function(){return this.changeAll(!1)},toggle:function(e){(e=e||window.event)&&e.stopPropagation(),this.$button.trigger("click.bs.dropdown.data-api")},keydown:function(e){var t,i,s,n,o,l=z(this),r=l.hasClass("dropdown-toggle"),a=(r?l.closest(".dropdown"):l.closest(V.MENU)).data("this"),c=a.findLis(),d=!1,h=e.which===H&&!r&&!a.options.selectOnTab,p=_.test(e.which)||h,u=a.$menuInner[0].scrollTop,f=a.isVirtual(),m=!0===f?a.selectpicker.view.position0:0;if(!(i=a.$newElement.hasClass(j.SHOW))&&(p||48<=e.which&&e.which<=57||96<=e.which&&e.which<=105||65<=e.which&&e.which<=90)&&(a.$button.trigger("click.bs.dropdown.data-api"),a.options.liveSearch))a.$searchbox.trigger("focus");else{if(e.which===A&&i&&(e.preventDefault(),a.$button.trigger("click.bs.dropdown.data-api").trigger("focus")),p){if(!c.length)return;void 0===(t=!0===f?c.index(c.filter(".active")):a.activeIndex)&&(t=-1),-1!==t&&((s=a.selectpicker.current.elements[t+m]).classList.remove("active"),s.firstChild&&s.firstChild.classList.remove("active")),e.which===P?(-1!==t&&t--,t+m<0&&(t+=c.length),a.selectpicker.view.canHighlight[t+m]||-1===(t=a.selectpicker.view.canHighlight.slice(0,t+m).lastIndexOf(!0)-m)&&(t=c.length-1)):(e.which===W||h)&&(++t+m>=a.selectpicker.view.canHighlight.length&&(t=0),a.selectpicker.view.canHighlight[t+m]||(t=t+1+a.selectpicker.view.canHighlight.slice(t+m+1).indexOf(!0))),e.preventDefault();var v=m+t;e.which===P?0===m&&t===c.length-1?(a.$menuInner[0].scrollTop=a.$menuInner[0].scrollHeight,v=a.selectpicker.current.elements.length-1):d=(o=(n=a.selectpicker.current.data[v]).position-n.height)<u:(e.which===W||h)&&(0===t?v=a.$menuInner[0].scrollTop=0:d=u<(o=(n=a.selectpicker.current.data[v]).position-a.sizeInfo.menuInnerHeight)),(s=a.selectpicker.current.elements[v])&&(s.classList.add("active"),s.firstChild&&s.firstChild.classList.add("active")),a.activeIndex=a.selectpicker.current.data[v].index,a.selectpicker.view.currentActive=s,d&&(a.$menuInner[0].scrollTop=o),a.options.liveSearch?a.$searchbox.trigger("focus"):l.trigger("focus")}else if(!l.is("input")&&!q.test(e.which)||e.which===D&&a.selectpicker.keydown.keyHistory){var g,b,w=[];e.preventDefault(),a.selectpicker.keydown.keyHistory+=T[e.which],a.selectpicker.keydown.resetKeyHistory.cancel&&clearTimeout(a.selectpicker.keydown.resetKeyHistory.cancel),a.selectpicker.keydown.resetKeyHistory.cancel=a.selectpicker.keydown.resetKeyHistory.start(),b=a.selectpicker.keydown.keyHistory,/^(.)\1+$/.test(b)&&(b=b.charAt(0));for(var x=0;x<a.selectpicker.current.data.length;x++){var I=a.selectpicker.current.data[x];$(I,b,"startsWith",!0)&&a.selectpicker.view.canHighlight[x]&&w.push(I.index)}if(w.length){var k=0;c.removeClass("active").find("a").removeClass("active"),1===b.length&&(-1===(k=w.indexOf(a.activeIndex))||k===w.length-1?k=0:k++),g=w[k],d=0<u-(n=a.selectpicker.main.data[g]).position?(o=n.position-n.height,!0):(o=n.position-a.sizeInfo.menuInnerHeight,n.position>u+a.sizeInfo.menuInnerHeight),(s=a.selectpicker.main.elements[g]).classList.add("active"),s.firstChild&&s.firstChild.classList.add("active"),a.activeIndex=w[k],s.firstChild.focus(),d&&(a.$menuInner[0].scrollTop=o),l.trigger("focus")}}
13i&&(e.which===D&&!a.selectpicker.keydown.keyHistory||e.which===N||e.which===H&&a.options.selectOnTab)&&(e.which!==D&&e.preventDefault(),a.options.liveSearch&&e.which===D||(a.$menuInner.find(".active a").trigger("click",!0),l.trigger("focus"),a.options.liveSearch||(e.preventDefault(),z(document).data("spaceSelect",!0))))}},mobile:function(){this.$element[0].classList.add("mobile-device")},refresh:function(){var e=z.extend({},this.options,this.$element.data());this.options=e,this.checkDisabled(),this.setStyle(),this.render(),this.createLi(),this.setWidth(),this.setSize(!0),this.$element.trigger("refreshed"+U)},hide:function(){this.$newElement.hide()},show:function(){this.$newElement.show()},remove:function(){this.$newElement.remove(),this.$element.remove()},destroy:function(){this.$newElement.before(this.$element).remove(),this.$bsContainer?this.$bsContainer.remove():this.$menu.remove(),this.$element.off(U).removeData("selectpicker").removeClass("bs-select-hidden selectpicker"),z(window).off(U+"."+this.selectId)}};var X=z.fn.selectpicker;z.fn.selectpicker=Q,z.fn.selectpicker.Constructor=J,z.fn.selectpicker.noConflict=function(){return z.fn.selectpicker=X,this},z(document).off("keydown.bs.dropdown.data-api").on("keydown"+U,'.bootstrap-select [data-toggle="dropdown"], .bootstrap-select [role="listbox"], .bootstrap-select .bs-searchbox input',J.prototype.keydown).on("focusin.modal",'.bootstrap-select [data-toggle="dropdown"], .bootstrap-select [role="listbox"], .bootstrap-select .bs-searchbox input',function(e){e.stopPropagation()}),z(window).on("load"+U+".data-api",function(){z(".selectpicker").each(function(){var e=z(this);Q.call(e,e.data())})})}(e)});!function(e){e(["jquery"],function(e){return function(){function t(e,t,n){return g({type:O.error,iconClass:m().iconClasses.error,message:e,optionsOverride:n,title:t})}function n(t,n){return t||(t=m()),v=e("#"+t.containerId),v.length?v:(n&&(v=d(t)),v)}function o(e,t,n){return g({type:O.info,iconClass:m().iconClasses.info,message:e,optionsOverride:n,title:t})}function s(e){C=e}function i(e,t,n){return g({type:O.success,iconClass:m().iconClasses.success,message:e,optionsOverride:n,title:t})}function a(e,t,n){return g({type:O.warning,iconClass:m().iconClasses.warning,message:e,optionsOverride:n,title:t})}function r(e,t){var o=m();v||n(o),u(e,o,t)||l(o)}function c(t){var o=m();return v||n(o),t&&0===e(":focus",t).length?void h(t):void(v.children().length&&v.remove())}function l(t){for(var n=v.children(),o=n.length-1;o>=0;o--)u(e(n[o]),t)}function u(t,n,o){var s=!(!o||!o.force)&&o.force;return!(!t||!s&&0!==e(":focus",t).length)&&(t[n.hideMethod]({duration:n.hideDuration,easing:n.hideEasing,complete:function(){h(t)}}),!0)}function d(t){return v=e("<div/>").attr("id",t.containerId).addClass(t.positionClass),v.appendTo(e(t.target)),v}function p(){return{tapToDismiss:!0,toastClass:"toast",containerId:"toast-container",debug:!1,showMethod:"fadeIn",showDuration:300,showEasing:"swing",onShown:void 0,hideMethod:"fadeOut",hideDuration:1e3,hideEasing:"swing",onHidden:void 0,closeMethod:!1,closeDuration:!1,closeEasing:!1,closeOnHover:!0,extendedTimeOut:1e3,iconClasses:{error:"toast-error",info:"toast-info",success:"toast-success",warning:"toast-warning"},iconClass:"toast-info",positionClass:"toast-top-right",timeOut:5e3,titleClass:"toast-title",messageClass:"toast-message",escapeHtml:!1,target:"body",closeHtml:'<button type="button">&times;</button>',closeClass:"toast-close-button",newestOnTop:!0,preventDuplicates:!1,progressBar:!1,progressClass:"toast-progress",rtl:!1}}function f(e){C&&C(e)}function g(t){function o(e){return null==e&&(e=""),e.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&#39;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function s(){c(),u(),d(),p(),g(),C(),l(),i()}function i(){var e="";switch(t.iconClass){case"toast-success":case"toast-info":e="polite";break;default:e="assertive"}I.attr("aria-live",e)}function a(){E.closeOnHover&&I.hover(H,D),!E.onclick&&E.tapToDismiss&&I.click(b),E.closeButton&&j&&j.click(function(e){e.stopPropagation?e.stopPropagation():void 0!==e.cancelBubble&&e.cancelBubble!==!0&&(e.cancelBubble=!0),E.onCloseClick&&E.onCloseClick(e),b(!0)}),E.onclick&&I.click(function(e){E.onclick(e),b()})}function r(){I.hide(),I[E.showMethod]({duration:E.showDuration,easing:E.showEasing,complete:E.onShown}),E.timeOut>0&&(k=setTimeout(b,E.timeOut),F.maxHideTime=parseFloat(E.timeOut),F.hideEta=(new Date).getTime()+F.maxHideTime,E.progressBar&&(F.intervalId=setInterval(x,10)))}function c(){t.iconClass&&I.addClass(E.toastClass).addClass(y)}
13function l(){E.newestOnTop?v.prepend(I):v.append(I)}function u(){if(t.title){var e=t.title;E.escapeHtml&&(e=o(t.title)),M.append(e).addClass(E.titleClass),I.append(M)}}function d(){if(t.message){var e=t.message;E.escapeHtml&&(e=o(t.message)),B.append(e).addClass(E.messageClass),I.append(B)}}function p(){E.closeButton&&(j.addClass(E.closeClass).attr("role","button"),I.prepend(j))}function g(){E.progressBar&&(q.addClass(E.progressClass),I.prepend(q))}function C(){E.rtl&&I.addClass("rtl")}function O(e,t){if(e.preventDuplicates){if(t.message===w)return!0;w=t.message}return!1}function b(t){var n=t&&E.closeMethod!==!1?E.closeMethod:E.hideMethod,o=t&&E.closeDuration!==!1?E.closeDuration:E.hideDuration,s=t&&E.closeEasing!==!1?E.closeEasing:E.hideEasing;if(!e(":focus",I).length||t)return clearTimeout(F.intervalId),I[n]({duration:o,easing:s,complete:function(){h(I),clearTimeout(k),E.onHidden&&"hidden"!==P.state&&E.onHidden(),P.state="hidden",P.endTime=new Date,f(P)}})}function D(){(E.timeOut>0||E.extendedTimeOut>0)&&(k=setTimeout(b,E.extendedTimeOut),F.maxHideTime=parseFloat(E.extendedTimeOut),F.hideEta=(new Date).getTime()+F.maxHideTime)}function H(){clearTimeout(k),F.hideEta=0,I.stop(!0,!0)[E.showMethod]({duration:E.showDuration,easing:E.showEasing})}function x(){var e=(F.hideEta-(new Date).getTime())/F.maxHideTime*100;q.width(e+"%")}var E=m(),y=t.iconClass||E.iconClass;if("undefined"!=typeof t.optionsOverride&&(E=e.extend(E,t.optionsOverride),y=t.optionsOverride.iconClass||y),!O(E,t)){T++,v=n(E,!0);var k=null,I=e("<div/>"),M=e("<div/>"),B=e("<div/>"),q=e("<div/>"),j=e(E.closeHtml),F={intervalId:null,hideEta:null,maxHideTime:null},P={toastId:T,state:"visible",startTime:new Date,options:E,map:t};return s(),r(),a(),f(P),E.debug&&console&&console.log(P),I}}function m(){return e.extend({},p(),b.options)}function h(e){v||(v=n()),e.is(":visible")||(e.remove(),e=null,0===v.children().length&&(v.remove(),w=void 0))}var v,C,w,T=0,O={error:"error",info:"info",success:"success",warning:"warning"},b={clear:r,remove:c,error:t,getContainer:n,info:o,options:{},subscribe:s,success:i,version:"2.1.3",warning:a};return b}()})}("function"==typeof define&&define.amd?define:function(e,t){"undefined"!=typeof module&&module.exports?module.exports=t(require("jquery")):window.toastr=t(window.jQuery)});;!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof exports?module.exports=a(require("jquery")):a(jQuery)}(function(a){function i(){var b,c,d={height:f.innerHeight,width:f.innerWidth};return d.height||(b=e.compatMode,(b||!a.support.boxModel)&&(c="CSS1Compat"===b?g:e.body,d={height:c.clientHeight,width:c.clientWidth})),d}function j(){return{top:f.pageYOffset||g.scrollTop||e.body.scrollTop,left:f.pageXOffset||g.scrollLeft||e.body.scrollLeft}}function k(){if(b.length){var e=0,f=a.map(b,function(a){var b=a.data.selector,c=a.$element;return b?c.find(b):c});for(c=c||i(),d=d||j();e<b.length;e++)if(a.contains(g,f[e][0])){var h=a(f[e]),k={height:h[0].offsetHeight,width:h[0].offsetWidth},l=h.offset(),m=h.data("inview");if(!d||!c)return;l.top+k.height>d.top&&l.top<d.top+c.height&&l.left+k.width>d.left&&l.left<d.left+c.width?m||h.data("inview",!0).trigger("inview",[!0]):m&&h.data("inview",!1).trigger("inview",[!1])}}}var c,d,h,b=[],e=document,f=window,g=e.documentElement;a.event.special.inview={add:function(c){b.push({data:c,$element:a(this),element:this}),!h&&b.length&&(h=setInterval(k,250))},remove:function(a){for(var c=0;c<b.length;c++){var d=b[c];if(d.element===this&&d.data.guid===a.guid){b.splice(c,1);break}}b.length||(clearInterval(h),h=null)}},a(f).on("scroll resize scrollstop",function(){c=d=null}),!g.addEventListener&&g.attachEvent&&g.attachEvent("onfocusin",function(){d=null})});;var ResponsiveApp=function(){var SIZES_BT={'sm':576,'md':768,'lg':992,'xl':1200}
14var copy_html_elements=function(){function copy_html_in_elements(){$('[data-copy-html=true]').each(function(){var target=$(this).data('html-target');var target_size=$(this).data('copy-html-size')||'md';if($(window).width()<=SIZES_BT[target_size]){var html=$(this).data('insert-html');
14var actual_html=$(this).html();if(typeof html!=typeof undefined&&!actual_html){$(this).html(html);}else if(typeof target!=typeof undefined){$(target).html(actual_html);}}});}
15$(window).resize(function(){copy_html_in_elements();});copy_html_in_elements();}
16var responsive_toggle=function(){$("[data-responsive-toggle]").click(function(){var target=$(this).data('responsive-toggle');var size=$(this).data('responsive-toggle-size')||'md';var icon_toggle=$(this).data('responsive-toggle-icon')||'';if($(window).width()<=SIZES_BT[size]){$(target).toggleClass('d-none');if(icon_toggle){$(this).find('i').toggleClass(icon_toggle);}}})}
17return{sizes_bt:function(size){size=typeof size!=typeof undefined?size:'md';size=size in SIZES_BT?size:'md';return SIZES_BT[size];},init:function(){copy_html_elements();responsive_toggle();}}}();$(document).ready(function(){ResponsiveApp.init();});;$.ajaxSetup({beforeSend:function(xhr,settings){if(!(/^(GET|HEAD|OPTIONS|TRACE)$/.test(settings.type))&&!this.crossDomain){let cookieValue=ot4.get_cookie("csrftoken");if(cookieValue){xhr.setRequestHeader("X-CSRFToken",cookieValue);}else{console.log("CSRFToken not found");}}}});var ot4={};ot4.declare_package=function(name,initializer){var parts=name.split('.');var pkg=this;for(var i=0;i<parts.length;i++){var key=parts[i];var obj=pkg[key];if(!obj){pkg[key]=obj={};}
18pkg=obj;}
19if(initializer){initializer(pkg);}
20return pkg;}
21ot4.ajax=function(parameters){var headers={};if(parameters.headers){for(var key in headers){headers[key]=parameters[key];}}
22var show_success=(parameters.show_success===undefined||parameters.show_success);var show_error=(parameters.show_error===undefined||parameters.show_error);return $.ajax({method:parameters.method||"GET",url:parameters.url,headers:headers,data:parameters.data,success:function(data,textStatus,jqXHR){var successful=true;if(jqXHR.responseJSON){successful=data.status=='ok';if(successful&&show_success&&data.message){if(parameters.toastr_timeout){toastr.success(data.message,{timeout:parameters.toastr_timeout,closeButton:true});}else{toastr.success(data.message);}}}
23if(successful&&parameters.success){parameters.success(data);}},error:function(jqXHR,textStatus,errorThrown){try{var data=jQuery.parseJSON(jqXHR.responseText);}catch(error){var data=null;}
24if(show_error){if(data&&data.message){if(parameters.toastr_timeout){toastr.error(data.message,{timeout:parameters.toastr_timeout,closeButton:true});}else{toastr.error(data.message);}}
25else{toastr.error(gettext("Ha habido algún problema, inténtalo de nuevo y si el problema persiste contacta con tu asesor en OpenTiendas.")
26+' ('+jqXHR.status+')');}}}});}
27ot4.dispatch_event=function(name,detail){try{window.dispatchEvent(new CustomEvent('ot:'+name,{detail:detail||{}}));}catch(e){}};ot4.get_cookie=function(name){if(document.cookie&&document.cookie!==''){let cookies=document.cookie.split(';');for(let i=0;i<cookies.length;i++){let cookie=jQuery.trim(cookies[i]);if(cookie.substring(0,name.length+1)===(name+'=')){return decodeURIComponent(cookie.substring(name.length+1));}}}
28return null;}
29ot4.set_cookie=function(name,value,expire_days){var d=new Date();d.setDate(d.getDate()+expire_days);var expires="expires="+d.toUTCString();document.cookie=name+"="+value+";"+expires+";path=/";}
30ot4.delete_cookie=function(name){ot4.set_cookie(name,'',-1);}
31ot4.add_disable_condition=function($element,condition,title){var conditions=$element.data('ot4.disable_conditions');if(!conditions){conditions={};$element.data('ot4.disable_original_title',$element.attr('title')||'');$element.data('ot4.disable_conditions',conditions);}
32conditions[condition]=title;$element.prop('disabled',true);if(title){$element.attr('title',title);}}
33ot4.remove_disable_condition=function($element,condition){var conditions=$element.data('ot4.disable_conditions');var disabled=false;var title=null;if(conditions){delete conditions[condition];for(var c in conditions){title=conditions[c];disabled=true;break;}}
34$element.prop('disabled',disabled);$element.prop('title',title||$element.data('ot4.disable_original_title'));}
35ot4.render_template=function(name,data){var $template=$('[data-js-template="'+name+'"]');var $element=$template.clone().removeAttr('data-js-template');var regexp=/\{js:([^}]+)\}/g;function injectValuesIntoNode(node){node.nodeValue=node.nodeValue.replace(regexp,function(){return data[arguments[1]];});}
36function descend(node){for(var i=0;i<node.attributes.length;i++){injectValuesIntoNode(node.attributes[i]);}
37for(var i=0;i<node.childNodes.length;i++){var child=node.childNodes[i];if(child.nodeType==1){descend(child);}
38else if(child.nodeType==3){injectValuesIntoNode(child);}}}
39descend($element[0]);return $element;}
40ot4.escape_html=function(text){return(text.replace(/</g,'&lt;').replace(/>/g,'&gt;').replace(/\n/g,'<br>'));}
41ot4.truncate_decimals=function(number,digits){var multiplier=Math.pow(10,digits),adjustedNum=number*multiplier,truncatedNum=Math[adjustedNum<0?'ceil':'floor'](adjustedNum);return truncatedNum/multiplier;};ot4.init_admin_toolbar=function(){var clear_cache_btn=$("#clear_cache");var clear_cache_form=$("#clear_cache_form");if(!window.location.pathname.includes('dashboard')){clear_cache_btn.removeClass('d-none');}
42clear_cache_form.on('submit',function(e){e.preventDefault();var action=this.action;ot4.ajax({method:"POST",url:action,data:{url:window.location.href},toastr_timeout:8000});});ot4.dismiss_modal=function(modal_selector){$(modal_selector).modal('hide');$('body').removeClass('modal-open');$('.modal-backdrop').remove();}
43$('#get_pedido_form').on('submit',function(){var num_pedido=document.getElementById('num_pedido_bottom_bar').value;var placeholder=this.getAttribute('data-order-id-placerholder');var url=this.getAttribute('action');if(num_pedido&&url){window.location.href=url.replace(placeholder,num_pedido);}
44return false;});$('#close_bottom_bar').on('click',function(){var helper_bottom_bar=document.getElementById('helper_bottom_bar');var helper_bottom_bar=document.querySelector('#helper_bottom_bar');var complete_bar=document.querySelector(".complete-bar");var small_bar=document.querySelector(".small-bar");complete_bar.classList.add('d-none');small_bar.classList.remove('d-none');helper_bottom_bar.classList.add('collapsed');});$('#open_bottom_bar').on('click',function(){var helper_bottom_bar=document.getElementById('helper_bottom_bar');var complete_bar=document.querySelector(".complete-bar");var small_bar=document.querySelector(".small-bar");complete_bar.classList.remove('d-none');small_bar.classList.add('d-none');helper_bottom_bar.classList.remove('collapsed');});$('#recalc_product_view_data').on('click',function(e){e.preventDefault();ot4.ajax({url:$(this).data('xhr-url')});});}
45ot4.auth_cookie=ot4.get_cookie('ot4u');ot4.authenticated=(ot4.auth_cookie=='1'||ot4.auth_cookie=='2');ot4.can_enter_dashboard=(ot4.auth_cookie=='2');$(function(){ls_logged_in_as_user_key='ot_logged_in_as_user';username=localStorage.getItem(ls_logged_in_as_user_key)||null;if(username){$('#logged_in_user_holder').removeClass('d-none').find(".logged_in_as_message").html(interpolate(gettext('Te has autenticado como %(username)s'),{username:'<b>'+username+'</b>'},true));$('#close_session_btn').removeClass('d-inline-block');$('#close_session_btn').addClass('d-none');}
46$('#logout_logged_in_as_user').on('click',function(event){localStorage.removeItem(ls_logged_in_as_user_key);});});ot4.is_bot=navigator.userAgent.toLowerCase().indexOf('bot')!=-1;ot4.is_dev=(navigator.userAgent=='guellco'||navigator.userAgent=='guellco_no_cache');ot4.is_repeat_hit=(function(){return(window.performance&&performance.navigation&&(performance.navigation.type==performance.navigation.TYPE_BACK_FORWARD||performance.navigation.type==performance.navigation.TYPE_RELOAD));})();ot4.beaconGET=function(url){const req=new Request(atob(url),{headers:{"Cache-Control":"no-cache","Connection":"keep-alive"}});window.fetch(req);}
47ot4.beacon=function(url,data){url=atob(url);if(navigator.sendBeacon&&window.FormData){if(!data){data=new FormData();}
48if(!data.has("csrfmiddlewaretoken")){data.set("csrfmiddlewaretoken",ot4.get_cookie('csrftoken'));}
49navigator.sendBeacon(url,data);}
50else{$.ajax({url:url,data:data});}}
51ot4.reset_form_errors=function(idForm){form=$("#"+idForm);form.find('.text-danger').remove();form.find('.alert').remove();form.find('.is-invalid').removeClass("is-invalid");}
52ot4.handle_form_errors=function(idForm,errors){ot4.reset_form_errors(idForm);let form=$("#"+idForm);try{for(const[key,value]of Object.entries(JSON.parse(errors))){if(key=='__all__'){general=$('<div class="alert alert-danger alert-dismissible collapse show" role="alert"><button type="button" class="close" data-dismiss="alert" aria-label="Cerrar"></button><span><i class="fa fa-exclamation-circle"></i> <span>'+value[0].message+'</span></span></div>');form.prepend(general);}else{let input=form.find("#id_"+key).closest("[class^='form-']");input.addClass("is-invalid");if(value.constructor===Array){for(let i=0;i<value.length;i++){input.after($('<span class="text-danger"><small>'+value[i].message+'</small></span>'));}}else{input.after($('<span class="text-danger"><small>'+value+'</small></span>'));}}}
53firstError=form[0].getElementsByClassName('text-danger');if(firstError.length){firstError[0].parentNode.scrollIntoView();}}catch(error){toastr.error(gettext("Ha habido algún problema, inténtalo de nuevo y si el problema persiste contacta con tu asesor en OpenTiendas."));}}
54ot4.load_form_csrf=function(form,callback){let csrfUrl=form.data('xhr-csrf')
55if(csrfUrl){$.ajax({method:"GET",url:csrfUrl,success:function(data){let csrfTokenInput
55=form.find("input[name='csrfmiddlewaretoken']");if(!csrfTokenInput.length){csrfTokenInput=$(`<input type="hidden" name="csrfmiddlewaretoken", value="">`);csrfTokenInput.prependTo(form);}
56csrfTokenInput.val(data.token);callback();},error:function(xhr){console.error("[CSRF-ERROR] Unexpected token error ");}});}else{console.error("[Misconfiguration error] xhr-csrf required for this form")}}
57ot4.fixedRightOverlay=function(overlay_selector,title,content){const AUTO_CLOSE_DELAY_MILLIS=5000;const $overlay=$(overlay_selector);const closeOverlay=function(){$overlay.removeClass("fixed-right-overlay-visible");if(this.close_timeout_id){clearTimeout(this.close_timeout_id);}};const closeOverlayIfNotHover=function(){if($(overlay_selector+":hover").length==0){closeOverlay();}else{this.close_timeout_id=setTimeout(closeOverlayIfNotHover,AUTO_CLOSE_DELAY_MILLIS);}};$overlay.find(".fixed-right-overlay-title").html(title);$overlay.find(".fixed-right-overlay-body").html(content);CommonFunctions.initProductsInList();$overlay.find(".fixed-right-overlay-btn-close").click(function(){closeOverlay();});$overlay.on("DOMMouseScroll mousewheel",function(ev){const $this=$(this),scrollTop=this.scrollTop,scrollHeight=this.scrollHeight,height=$this.height(),delta=ev.originalEvent.wheelDelta,up=delta>0;const prevent=function(){ev.stopPropagation();ev.preventDefault();ev.returnValue=false;return false;};if(!up&&-delta>scrollHeight-height-scrollTop){$this.scrollTop(scrollHeight);return prevent();}else if(up&&delta>scrollTop){$this.scrollTop(0);return prevent();}});if(window.ontouchstart===undefined){this.close_timeout_id=setTimeout(closeOverlayIfNotHover,AUTO_CLOSE_DELAY_MILLIS);}
58$overlay.addClass("fixed-right-overlay-visible");};if(!Array.prototype.includes){Array.prototype.includes=function(searchElement){'use strict';var O=Object(this);var len=parseInt(O.length)||0;if(len===0){return false;}
59var n=parseInt(arguments[1])||0;var k;if(n>=0){k=n;}else{k=len+n;if(k<0){k=0;}}
60var currentElement;while(k<len){currentElement=O[k];if(searchElement===currentElement||(searchElement!==searchElement&&currentElement!==currentElement)){return true;}
61k++;}
62return false;};}
63$(document).on("click","#btn_administrative_issue_ok",function(e){$("#main_content").removeClass("blur");$(".top-alert").remove();});$(document).on("click",".ot-toast-dismiss",function(e){$(this).closest(".ot-toast-container").fadeOut();});$(document).on('switchChange.bootstrapSwitch',".autosave-switch",function(event,state){let $this=$(this);let form=$this.closest('form');let key=$this.attr("name")
64ot4.ajax({method:"POST",url:form.attr("action"),data:{[key]:$this.get(0).checked}})});$(document).on("click",".dashboard-title-link",function(){window.location=$("#dashboard_title").data("url");})
65$(document).on("click",".aside-left-minimize",function(){var $this=$(this);var $minimized_logo=$(".logo-minimize-active");if($("#m_aside_left_minimize_toggle").hasClass("m-brand__toggler--active")){$this.addClass("minimize-active");$minimized_logo.removeClass("d-none");}else{$this.removeClass("minimize-active");$minimized_logo.addClass("d-none");}});(function($){$.fn.bcSwipe=function(settings){var config={threshold:50};if(settings){$.extend(config,settings);}
66this.each(function(){var stillMoving=false;var start;if('ontouchstart'in document.documentElement){this.addEventListener('touchstart',onTouchStart,{passive:true});}
67function onTouchStart(e){if(e.touches.length==1){start=e.touches[0].pageX;stillMoving=true;this.addEventListener('touchmove',onTouchMove,{passive:true});}}
68function onTouchMove(e){if(stillMoving){var x=e.touches[0].pageX;var difference=start-x;if(Math.abs(difference)>=config.threshold){cancelTouch();if(difference>0){$(this).carousel('next');}
69else{$(this).carousel('prev');}}}}
70function cancelTouch(){this.removeEventListener('touchmove',onTouchMove);start=null;stillMoving=false;}});return this;};$.fn.preventDoubleSubmission=function(){$(this).on('submit',function(e){var $form=$(this);if($form.data('submitted')===true){e.preventDefault();}else{$form.data('submitted',true);}});return this;};})(jQuery);$(function(){$('.btn-loading-on-click').on('click',function(e){var btn=$(this);if(btn.prop('disabled')){e.preventDefault();return;}
71btn.prop('disabled',true);btn.html('<i class="fa fa-circle-o-notch fa-spin"></i>');var formSelector=btn.data('form');var form;if(formSelector){form=$(formSelector);if(form.length){form.trigger('submit');}}});});const PriceVisibilityFunctions=function(){const CARD_PRODUCT_BATCH=8;const PRODUCT_WITH_TABLE_BATCH=8;const PRICING_PLAN_BAR_DISMISS='pricing_plan_bar_dismiss'
72const pricing_plan_bar_reset_login=function(){let current_item_ls=JSON.parse(localStorage.getItem(cookieStorageKey))
73if($('#user_login_form').length&&!$.isEmptyObject(current_item_ls)&&PRICING_PLAN_BAR_DISMISS in current_item_ls){delete current_item_ls[PRICING_PLAN_BAR_DISMISS]
74localStorage.setItem(cookieStorageKey,JSON.stringify(current_item_ls))}}
75const pricing_plan_bar=function(){const $cookiebar_holder=$('#cookiebar_holder')
76let current_item_ls=JSON.parse(localStorage.getItem(cookieStorageKey))
77if(!$.isEmptyObject(current_item_ls)&&PRICING_PLAN_BAR_DISMISS in current_item_ls&&current_item_ls[PRICING_PLAN_BAR_DISMISS]){return null}
78$.ajax({url:$('body').data('pricing-plan-xhr-url'),type:'json',method:'POST',data:{get_pricing_plan_bar:true},success:function(result){if(result.html){$cookiebar_holder.after(result.html)
79$('#pricing_plan_bar .dismiss-bar').one('click',function(){current_item_ls=JSON.parse(localStorage.getItem(cookieStorageKey))
80current_item_ls[PRICING_PLAN_BAR_DISMISS]=true
81localStorage.setItem(cookieStorageKey,JSON.stringify(current_item_ls))
82$('#pricing_plan_bar').remove()})}}})}
83const update_quantity_input=function(data,sellable_id=null){if(data.valid_min_quantity){const $widget=$('.QuantityInput');const input_name=sellable_id?`quantity_${sellable_id}`:'quantity';const $input=$widget.find(`input[type=number][name=${input_name}]`);$input.attr('min',data.valid_min_quantity);$input.attr('step',data.quantity_factor);$input.val(data.valid_min_quantity);if(data.min_quantity>1&&data.quantity_factor>1&&data.min_quantity!=data.quantity_factor){message=interpolate(gettext('Cantidad mínima de %(min)s uds y múltiple de %(factor)s'),{min:data.valid_min_quantity,factor:data.quantity_factor},true);}
84else if(data.quantity_factor>1){message=interpolate(gettext('Cantidad múltiple de %(factor)s'),{factor:data.quantity_factor},true);}
85else if(data.min_quantity>1){message=interpolate(gettext('Cantidad mínima de %(min)s uds'),{min:data.valid_min_quantity},true);}
86else{message='';}
87$input.parents('.QuantityInput').find('.quantity-constraints-label').text(message);$input.parents('.QuantityInput').find('.quantity-constraints-popover').attr('data-content',message);}}
88const load_next_listing_products_batch=function(){let listing_product_ids=new Set();$(`.card-product-pricing .${ot4Placeholder.PLACEHOLDER_CLASSNAME}`).each((index,element)=>{if(listing_product_ids.size<CARD_PRODUCT_BATCH)
89listing_product_ids.add($(element).parents('.product-in-list').data('product-id'))});if(listing_product_ids.size)
90send_ajax({listing_products:JSON.stringify(Array.from(listing_product_ids))},undefined);}
91const load_next_products_in_table_batch=function(){let sellable_ids=new Set();$(`.sellables-in-table-prices .${ot4Placeholder.PLACEHOLDER_CLASSNAME}`).each((index,element)=>{if(sellable_ids.size<PRODUCT_WITH_TABLE_BATCH){sellable_ids.add($(element).parents('.sellables-in-table-cell').find('.add-to-cart-with-table').data('sellable-id'));}});if(sellable_ids.size)
92send_ajax({sellables:JSON.stringify(Array.from(sellable_ids))},'table');}
93const send_ajax=function(data,product_view_type){if(data){if(product_view_type!==undefined){data.type=product_view_type;}
94$.ajax({url:$('body').data('pricing-plan-xhr-url'),type:'json',method:'POST',data:data,success:function(result){if(result){if(result.no_prices===true){$(`.${ot4Placeholder.PLACEHOLDER_CLASSNAME}`).each((index,elem)=>elem.remove());}else if(!$.isEmptyObject(result.product)||result.sellables.length||result.listing_products.length){$(".prices-b2b-only").remove();$(".no-prices").removeClass('no-prices');if(!$.isEmptyObject(result.product)){$('.sellable-pricing').html(result.product.html);update_quantity_input(result.product);if(result.product.per_quantity_discounts){$(".discounts-per-quantity-container").html(result.product.per_quantity_discounts);}else{$(".discounts-per-quantity-container").html("");}
95result.product.services.forEach((service)=>{$(`.service-option[data-id=${service.id}] .service-option-price`).html(service.html);});PriceVisibility.LABEL_SELECTORS.forEach((selector)=>{if(result.has_pricing_plan){$(selector).remove();}else{$(selector).find(`.${ot4Placeholder.PLACEHOLDER_CLASSNAME}`).remove();}})
96PriceVisibility.SECTIONS_SELECTOR.forEach((selector)=>{if(result.has_pricing_plan){$(selector).remove();}else{$(selector).find(`.${ot4Placeholder.PLACEHOLDER_CLASSNAME}`).remove();}})}
97if(result.sellables.length){if(product_view_type=='table'){result.sellables.forEach((sellable_data)=>{$(`.add-to-cart-with-table[data-sellable-id=${sellable_data.id}]`).parents(".sellables-prices").find(".sellables-in-table-prices").html(sellable_data.html);update_quantity_input(sellable_data,sellable_data.id);});load_next_products_in_table_batch();}
98else if(product_view_type=='select'){$("#id_sellable").trigger("change");}}
99if(result.listing_products.length){result.listing_products.forEach((price)=>{$(`.product-in-list[data-product-id=${price.id}]`).find(".card-product-pricing").html(price.html);PriceVisibility.CARD_SELECTORS.forEach((selector)=>{if(price.has_pricing_plan){$(`.product-in-list[data-product-id=${price.id}]`).find(selector).remove();}else{$(`.product-in-list[data-product-id=${price.id}]`).find(`.${ot4Placeholder.PLACEHOLDER_CLASSNAME}`).remove();}});});}
100if(product_view_type===undefined){load_next_listing_products_batch();}}}else{if(data.listing_products){let parsed_listing_products=JSON.parse(data.listing_products)
101parsed_listing_products.forEach((id)=>$(`.card-product[data-product-id=${id}] .${ot4Placeholder.PLACEHOLDER_CLASSNAME}`).remove())}else{$(`.${ot4Placeholder.PLACEHOLDER_CLASSNAME}`).each((index,elem)=>elem.remove());}}},error:function(result){}});}}
102const check_products=function(html){let $current_html=$(html);if($current_html.length&&ot4.authenticated&&$(".footer.check-pricing").length){let listing_product_ids=Array();$current_html.find(".product-in-list").each((index,element)=>listing_product_ids.push($(element).data("product-id")))
103let data={listing_products:JSON.stringify(listing_product_ids)}
104$.ajax({url:$('body').data('pricing-plan-xhr-url'),type:'json',async:false,method:'POST',data:data,success:function(result){if(result&&result.listing_products&&result.listing_products.length){result.listing_products.forEach((price)=>{$current_html.find(`.product-in-list[data-product-id=${price.id}]`).find(".card-product-pricing").html(price.html);PriceVisibility.CARD_SELECTORS.forEach((selector)=>{if(price.has_pricing_plan){$current_html.find(`.product-in-list[data-product-id=${price.id}]`).find(selector).remove();}else{$current_html.find(`.product-in-list[data-product-id=${price.id}]`).find(`.${ot4Placeholder.PLACEHOLDER_CLASSNAME}`).remove();}});});}}});}
105return $current_html.length?$current_html.prop('outerHTML'):html}
106const init=function(){pricing_plan_bar_reset_login()
107if(ot4.authenticated&&$(".footer.check-pricing").length){pricing_plan_bar()
108const is_product_view=Boolean($("#productview").length);const product_view_type=$("#productview").data("product-view-type");let data={};if(is_product_view){data.product=$("#productview").data("product-id");const selected_sellable_id=$("#id_sellable").val();if(selected_sellable_id){data.sellables=JSON.stringify([selected_sellable_id]);}
109send_ajax(data,product_view_type);if(product_view_type=='table'){$(`.sellables-in-table-prices .${ot4Placeholder.PLACEHOLDER_CLASSNAME}`).on('inview',function(){$(`.sellables-in-table-prices .${ot4Placeholder.PLACEHOLDER_CLASSNAME}`).unbind('inview');load_next_products_in_table_batch();})}}
110$(`.card-product .${ot4Placeholder.PLACEHOLDER_CLASSNAME}`).on('inview',function(){$(`.card-product .${ot4Placeholder.PLACEHOLDER_CLASSNAME}`).unbind("inview");load_next_listing_products_batch();})}}
111return{check_products:check_products,init:init}}();const relatedAndSimilarProductsFunctions=function(){const container_selector='.related-and-similar-products-container';const load_data=function(){$.ajax({url:atob($(container_selector).data('xhr-url')),type:'json',method:'POST',data:{payload:$(container_selector).data('xhr-data')},success:function(result){result.data.forEach((price)=>{$(`${container_selector} .product-in-list[data-product-id=${price.id}]`).find(".card-product-pricing").html(price.html);});$(`${container_selector} .card-product .${ot4Placeholder.PLACEHOLDER_CLASSNAME}`).parents('.card-product').parent().remove();}});};return{init:function(){$(container_selector).on('inview',function(){$(container_selector).unbind('inview');load_data();});}}}();const localStorageDisplaySettings=function(){const ls_display_settings_key='display_settings'
112const get=function(setting){let ls_display_setting=JSON.parse(localStorage.getItem(ls_display_settings_key))
113return ls_display_setting[setting]}
114const set=function(setting,value){let ls_display_setting=JSON.parse(localStorage.getItem(ls_display_settings_key))
115ls_display_setting[setting]=value
116localStorage.setItem(ls_display_settings_key,JSON.stringify(ls_display_setting))}
117const del=function(setting){let ls_display_setting=JSON.parse(localStorage.getItem(ls_display_settings_key))
118delete ls_display_setting[setting]
119localStorage.setItem(ls_display_settings_key,JSON.stringify(ls_display_setting))}
120const init=function(){let ls_display_setting=localStorage.getItem(ls_display_settings_key)
121if(!ls_display_setting){localStorage.setItem(ls_display_settings_key,JSON.stringify({subscription_popup_last_date:'',}))}}
122return{init:init,get:get,set:set,del:del,}}();const LazyRecaptcha=function(){const is_recaptcha_enabled=function(){return document.querySelector("#recaptcha_script")!==null;}
123const get_recaptcha_key=function(){const recaptcha_script=document.querySelector("#recaptcha_script")
124return recaptcha_script?recaptcha_script.dataset.key:'';}
125const include_script_id="recaptcha_delayed_script";const is_script_included=function(){return document.querySelector(`#${include_script_id}`)!==null;}
126const include_script=function(){if(is_recaptcha_enabled()&&!is_script_included()){const script=document.createElement('script');script.src=`https://www.google.com/recaptcha/api.js?render=${get_recaptcha_key()}`;script.id=include_script_id;document.head.appendChild(script);}}
127const onScriptLoad=function(callback){const script=document.querySelector(`#${include_script_id}`);script.addEventListener('load',callback());}
128return{is_recaptcha_enabled:is_recaptcha_enabled,include_script_id:include_script_id,include_script:include_script,get_recaptcha_key:get_recaptcha_key,onScriptLoad:onScriptLoad,}}();const EstimatedDeliveryDate=function(){var holidays_loaded=false;var holidays=[];function get_holidays(){if(!holidays_loaded&&ot4.delivery_info){ot4.delivery_info.shop_holidays.forEach(function(holiday){var holiday_obj=new Date(holiday);holidays.push(holiday_obj.setHours(0,0,0,0));});holidays_loaded=true;}
129return holidays;}
130function is_working_day(date){var _date=new Date(date);_date.setHours(0,0,0,0);var day=_date.getDay();var is_weekend=(day===6)||(day===0);return!(is_weekend||$.inArray(_date.getTime(),get_holidays())>-1);}
131function get_days_without_logistics(delivery_time,start_date){var days_without_logistics=0;var _start_date=new Date(start_date);let _max_date=new Date(start_date);let _max_hours=13;let _max_minutes=0;try{let _max_time=ot4.delivery_info.max_management_hour.split(':');_max_hours=_max_time[0];_max_minutes=_max_time[1];}catch(error){}
132_max_date.setHours(_max_hours);_max_date.setMinutes(_max_minutes);_max_date.setSeconds(0);if(_start_date>=_max_date){_start_date.setDate(_start_date.getDate()+1);days_without_logistics++;}
133while(!is_working_day(_start_date)){_start_date.setDate(_start_date.getDate()+1);days_without_logistics++;}
134var working_days=0;var day_to_check=new Date(_start_date);day_to_check.setDate(day_to_check.getDate()+1);while(working_days<delivery_time){if(is_working_day(day_to_check)){working_days++;}else{days_without_logistics++;}
135day_to_check.setDate(day_to_check.getDate()+1);}
136return days_without_logistics;}
137function calculate_estimated_delivery_date(working_days,stock_replenishment_date){now=new Date();days_in_range=null;if(stock_replenishment_date){now_aux=new Date();delivery_dt=now_aux.setDate(now_aux.getDate()+working_days);working_days_from_stock_rep_dt=Math.round((delivery_dt-stock_replenishment_date)/(1000*60*60*24));natural_days=working_days+get_days_without_logistics(working_days_from_stock_rep_dt,stock_replenishment_date);is_slow=working_days_from_stock_rep_dt>=ot4.delivery_info.slow_delivery.threshold;if(is_slow){days_in_range=Math.round(working_days_from_stock_rep_dt*ot4.delivery_info.slow_delivery.lower_bound_percentage/100);}}else{natural_days=working_days+get_days_without_logistics(working_days,now);is_slow=working_days>=ot4.delivery_info.slow_delivery.threshold;if(is_slow){days_in_range=Math.round(working_days*ot4.delivery_info.slow_delivery.lower_bound_percentage/100);}}
138date=new Date(now);date.setDate(date.getDate()+natural_days);var estimate={date:date,working_days:working_days,natural_days:natural_days,is_slow:is_slow,stock_replenishment_date:stock_replenishment_date};if(estimate.is_slow){estimate.days_in_range=days_in_range;}
139return estimate;}
140function get_message(estimate){if(ot4.delivery_info.date_format==ot4.delivery_info.DATE_FORMAT_DEFAULT||(ot4.delivery_info.date_format==ot4.delivery_info.DATE_FORMAT_SMART&&estimate.working_days>ot4.delivery_info.smart_date_format_threshold)){var date_str;if(estimate.is_slow){function format_date(date){return(date.toLocaleDateString?date.toLocaleDateString(ot4.delivery_info.locale,{month:'short','day':'numeric'}):date.toString());}
141early_date=new Date(estimate.date);days_in_range=estimate.days_in_range;stock_replenishment_date=estimate.stock_replenishment_date;while(days_in_range){early_date.setDate(early_date.getDate()-1);if(stock_replenishment_date&&early_date<=stock_replenishment_date){early_date=stock_replenishment_date;while(!is_working_day(early_date)){early_date.setDate(early_date.getDate()+1);}
142break;}else if(is_working_day(early_date)){days_in_range-=1}}
143if(early_date.getMonth()==estimate.date.getMonth()){date_str=early_date.getDate()+' - '+format_date(estimate.date);}
144else{date_str=format_date(early_date)+' - '+format_date(estimate.date);}}
145else{date_str=CommonFunctions.naturalday(estimate.date,ot4.delivery_info.locale);}
146return interpolate(ngettext('Recíbelo %(date)s','Recíbelo el %(date)s',estimate.natural_days),{date:date_str},true);}
147var days_str;if(estimate.is_slow){days_str=((estimate.working_days-estimate.days_in_range)
148+' - '
149+estimate.working_days);}
150else{days_str=estimate.working_days.toString();}
151var text=ngettext('Recíbelo en %(days)s día laborable','Recíbelo en %(days)s días laborables',estimate.working_days);return interpolate(text,{days:days_str},true);}
152return{calculate_estimated_delivery_date:calculate_estimated_delivery_date,get_message:get_message,}}();
152var CommonFunctions=function(){var products_others_interested_in_promise,product_history_promise,products_may_interest_you_promise;function updateStars(){$('.star-rating .fa').each(function(){if(parseInt($(this).siblings('input.rating-value').val())>=parseInt($(this).data('rating'))){return $(this).removeClass('fa-star-o').addClass('fa-star');}else{return $(this).removeClass('fa-star').addClass('fa-star-o');}});}
153var header_search_toggler=function(){var SHOWING_CLASS='showing';$('.is-mobile-search button.btn-outline-secondary').click(function(e){e.preventDefault();var form_parent=$(this).parents('form.is-mobile-search');var input_search=form_parent.find('input[name="q"]');var navbar_list_items=form_parent.parents('.navbar-list-items');if(!form_parent.hasClass(SHOWING_CLASS)){navbar_list_items.css('z-index','99');input_search.css('visibility','visible').trigger('focus');form_parent.addClass(SHOWING_CLASS);}else{if(input_search.val()){form_parent.submit();}else{navbar_list_items.css('z-index','1');input_search.css('visibility','hidden');form_parent.removeClass(SHOWING_CLASS);}}});$('.navbar-list-items').on('focusout','.is-mobile-search:not(.'+SHOWING_CLASS+') input[name="q"]',function(){if(!$(this).val()){$(this).siblings('.input-group-append').children('.btn-outline-secondary').trigger('click');}})}
154var header_shipping_country_selector=function(){const desktop="#shipping_country_selector";const mobile="#shipping_country_selector_mobile";if(ot4.country_selector_info!==undefined&&ot4.country_selector_info.length>1){[desktop,mobile].forEach(selector=>{let $select=$(selector+" select");ot4.country_selector_info.forEach(country_link=>{let option=$('<option/>',{value:country_link.url,text:country_link.name});option.attr("data-country-code",country_link.country);if(country_link.is_selected){option.attr("selected","selected");}
155$select.append(option);});$select.selectpicker("refresh");});}else{$(desktop).removeClass("d-lg-block");$(mobile).addClass("d-none");}
156$("body").on("change",`${desktop} select, ${mobile} select`,function(){const value=$(this).val();if(value){window.location.href=atob(value);}});}
157var header_navbar_dropdown=function(){function toggleDropdown(e){var $dropdown=$(e.target).closest('.dropdown');var $dropdown_menu=$('.dropdown-menu',$dropdown);setTimeout(function(){var shouldOpen=e.type!=='click'&&$dropdown.filter(':hover').length>0;$dropdown_menu.toggleClass('hover show',shouldOpen);$dropdown.toggleClass('hover show',shouldOpen);$('[data-toggle="dropdown"]',$dropdown).attr('aria-expanded',shouldOpen);},e.type==='mouseleave'?200:0);}
158$('body').on('mouseenter mouseleave','#navbar-header-group .dropdown',toggleDropdown).on('click','#navbar-header-group .dropdown-menu a',toggleDropdown);$('#navbar-header-group .dropdown-aux').click(function(e){e.stopPropagation();e.preventDefault();var target=$(this).data('target-aux');$(this).toggleClass('fa-angle-down').toggleClass('fa-angle-up');$(target).trigger('click');});}
159var header_fixed_on_scroll=function(){var $header_menu=$('#navbar-header-group');var $next_header_visible_element=$header_menu.parents('header').nextAll(':visible').first();var $top_bar=$('header .top-bar');var initial_header_element_padding=$next_header_visible_element.css('padding-top');function scroll_handler(){if($(window).scrollTop()>$top_bar.height()){$next_header_visible_element.css('padding-top',$header_menu.height()+parseInt(initial_header_element_padding));$header_menu.addClass('sticky');}else{$next_header_visible_element.css('padding-top',initial_header_element_padding);$header_menu.removeClass('sticky');}}
160function anchor_links_fix_menu(){$("a.anchor").click(function(e){e.preventDefault();$('html, body').animate({scrollTop:$($.attr(this,'href')).offset().top-$header_menu.height()});});}
161function fix_menu(){$(window).scroll(scroll_handler);anchor_links_fix_menu();$('#product-table').css('scroll-margin-top',$header_menu.height()+10);$('#productview_extrainfo').css('scroll-margin-top',$header_menu.height()+10);}
162function fix_menu_desktop_only(){if($(window).width()>ResponsiveApp.sizes_bt('lg')){fix_menu();}else{$(window).off("scroll",scroll_handler);}}
163function fix_menu_mobile_only(){if($(window).width()<=ResponsiveApp.sizes_bt('lg')){fix_menu();}else{$(window).off("scroll",scroll_handler);}}
164var is_menu_fixed=CommonFunctions.is_menu_fixed();if(is_menu_fixed.desktop&&is_menu_fixed.mobile){fix_menu();}else if(is_menu_fixed.desktop&&!is_menu_fixed.mobile){fix_menu_desktop_only();$(window).resize(function(){fix_menu_desktop_only();});}else if(!is_menu_fixed.desktop&&is_menu_fixed.mobile){fix_menu_mobile_only();$(window).resize(function(){fix_menu_mobile_only();});}}
165var lazyload_bg=function(){$('.image-wrapper').on('inview',function(){var CLASS_LOADED='bg-loaded';var style=$(this).data('style')||null;var is_loaded=$(this).hasClass(CLASS_LOADED);var max_width=$(this).data('max-width')||null;if(max_width&&window.innerWidth<ResponsiveApp.sizes_bt(max_width)){return false;}
166if(style&&!is_loaded){this.setAttribute('style',style);$(this).addClass(CLASS_LOADED);}});}
167var popover_init=function(){$("[data-image-hover]").popover({html:true,sanitize:false,trigger:'hover',content:function(){return'<img src="'+$(this).data('image-hover')+'" />';}});}
168var second_img_hover=function(){$(".card-product-img").on("mouseenter",function(){const $this=$(this);const $first_img=$this.find("[data-second-img-src]");if($first_img.length){let $second_img=$this.find(".second-img");if(!$second_img.length){$second_img=$("<img />",{class:"second-img position-absolute",src:$first_img.data("second-img-src"),alt:$first_img.attr("alt")});$second_img.hide();$second_img.insertAfter($first_img);}
169$first_img.fadeOut({duration:200,queue:true});$second_img.fadeIn({duration:300,queue:true});}});$(".card-product-img").on("mouseleave",function(){const $this=$(this);const $first_img=$this.find("[data-second-img-src]");if($first_img.length){const $second_img=$this.find(".second-img");$second_img.fadeOut({duration:200,queue:true});$first_img.fadeIn({duration:300,queue:true});}});}
170var collapsed_with_bt_classes=function(){$('body').on('click','[data-collapse-custom]',function(e){e.preventDefault();var $this=$(this);var element=$this.data('collapse-custom');$(element).toggleClass('d-none');$this.find('span').toggleClass('d-none');})}
171var smooth_anchor=function(){$('a.smooth-anchor[href^="#"]').on('click',function(e){e.preventDefault();var trigger_click=$(this).data('trigger-click');var trigger_event=$(this).data('trigger-click-event')||'on';var trigger_click_responsive_size=$(this).data('trigger-click-responsive-size')||'';var trigger_click_responsive=$(this).data('trigger-click-responsive')||'';var trigger_event_responsive=$(this).data('trigger-click-event-responsive')||'on';if(trigger_click_responsive&&trigger_click_responsive_size&&$(window).width()<=ResponsiveApp.sizes_bt(trigger_click_responsive_size)){if(trigger_event_responsive=='on'){$(trigger_click_responsive).trigger('click');}
172$('html, body').animate({scrollTop:$(trigger_click_responsive).offset().top-30},500);}else if(trigger_click){if(trigger_event=='on'){$(trigger_click).trigger('click');}
173$('html, body').animate({scrollTop:$($(this).attr('href')).offset().top},500);}});}
174var set_search_input_value_from_querystring=function(){const url_params=new URLSearchParams(window.location.search);const search_value=url_params.get('q');const desktop_input=$("#search_input_desktop");const mobile_input=$("#search_input_mobile");if(search_value){const visible_input=(desktop_input.closest("form").is(":visible"))?desktop_input:mobile_input;visible_input.val(search_value);}}
175var quantity_input=function(){$('.QuantityInput').each(function(){var $widget=$(this);var $input=$widget.find('input[type="number"]');var $buttons=$widget.find('.btn-number');var $minus_button=$buttons.filter('[data-type="minus"]');var $plus_button=$buttons.filter('[data-type="plus"]');var $popover=$widget.find('.quantity-constraints-popover');var $label=$widget.find('.quantity-constraints-label');var message;this.set_quantity_constraints=function(constraints){var changed;var value=null;var current_value=get_value();if(constraints.min_quantity!=undefined&&constraints.min_quantity!=get_min()){changed=true;$input.attr('min',constraints.min_quantity);value=constraints.min_quantity;}
176if(constraints.quantity_factor!==undefined&&constraints.quantity_factor!=get_step()){changed=true;$input.attr('step',constraints.quantity_factor);function nearestMultiple(value){var remainder=value%constraints.quantity_factor;if(remainder){value+=constraints.quantity_factor-remainder;}
177return value;}
178if(value===null||value%constraints.quantity_factor){value=nearestMultiple(constraints.min_quantity||1);}}
179if(changed){update_constraints();if(value!==current_value){$input.val(value);$input.change();}}}
180function get_value(){return parseInt($input.val());}
181function get_step(){return parseInt($input.attr('step'))||1;}
182function get_min(){return parseInt($input.attr('min'));}
183function get_max(){return parseInt($input.attr('max'));}
184function update_constraints(){toggle_buttons();update_explanation();}
185function handle_button_click(){var value=get_value();if(!isNaN(value)){var step=get_step();if($(this).data('type')=='minus'){step*=-1;}
186$input.val(value+step).change();toggle_buttons();}}
187function toggle_buttons(){var value=get_value();var step=get_step();var min=get_min();var max=get_max();$minus_button.prop('disabled',isNaN(value)||(!isNaN(min)&&value-step<min));$plus_button.prop('disabled',isNaN(value)||(!isNaN(max)&&value+step>max));}
188function update_explanation(){var min=get_min();var step=get_step();if(min>1&&step>1&&min!=step){message=interpolate(gettext('Cantidad mínima de %(min)s uds y múltiple de %(factor)s'),{min:min,factor:step},true);}
189else if(step>1){message=interpolate(gettext('Cantidad múltiple de %(factor)s'),{factor:step},true);}
190else if(min>1){message=interpolate(gettext('Cantidad mínima de %(min)s uds'),{min:min},true);}
191else{message='';}
192$widget.toggleClass('quantity-constraints',Boolean(message));$label.text(message);$popover.popover('hide');}
193$popover.popover({trigger:'focus',content:function(){return message;}});$buttons.on('click',handle_button_click);update_constraints();});}
194const carousel_init=function(){const $carousel=$('.carousel');if($carousel.length>0){$carousel.carousel();$carousel.bcSwipe({threshold:50});$carousel.filter('.lazy-carousel').on('slide.bs.carousel',function(e){var lazy;lazy=$(e.relatedTarget).find("img[data-src]");lazy.attr("src",lazy.data('src'));lazy.removeAttr("data-src");}).on('slid.bs.carousel',function(e){const num_image_container=$(this).find('.carousel-num-image');if(num_image_container.length>0){const totalItems=$(this).find('.carousel-item[data-thumb]').length;const currentIndex=$(this).find('.carousel-item.active[data-thumb]').data('thumb')+1;num_image_container.html(''+currentIndex+' / '+totalItems+'');}});const $carousel_video_anchor=$carousel.find('.carousel-num-video');const animation_duration=200;$carousel_video_anchor.on('click',function(){const $tab_video=$('#productview_extrainfo a[role="tab"][href="#videos"]:not(.active)');const $target_video_section=$('#videos');$tab_video.trigger('click');$('html, body').animate({scrollTop:$target_video_section.offset().top-10},{duration:animation_duration,complete:function(){setTimeout(function(){$target_video_section.find('.tab-panel-mobile-heading.can-slide:not(.opened)').trigger('click');},animation_duration+150);}});});}}
195var collapsed_lists=function(){$("[data-collapse]").on("click",function(e){e.preventDefault();var element=$(this);var list=element.data('collapse');element.siblings(list).toggle();if(element.hasClass('hide-after')){element.hide();}})}
196var toggle_filter=function(){$(".btn-show-filters").click(function(e){e.preventDefault();var opentarget=$(this).data('opentarget');if(typeof opentarget!=typeof undefined){$(".dark-bg-aux").addClass("active");$(opentarget).addClass("dark-bg-used").css('display','block !important');$(opentarget).animate({width:'toggle'},'90%');}});$(".dark-bg-aux").on("click",function(){var dark_bg=$(this);$(".dark-bg-used").animate({width:'toggle'},'90%',function(){$(this).css('display','none');dark_bg.removeClass("active");});});$(".collapse-filter .filter-title").click(function(){var IS_COLLAPSED_CLASS='is_collapsed';
196var filter_title=$(this);var filter_icon=filter_title.find('.collapse-filter-icon');var filter=filter_title.parents('.collapse-filter');if(!filter.hasClass(IS_COLLAPSED_CLASS)){filter.find('.filter-list').slideUp(function(){filter_icon.addClass(filter_icon.data('class-hiding')).removeClass(filter_icon.data('class-showing'));filter.addClass(IS_COLLAPSED_CLASS);});}else{filter.find('.filter-list').slideDown(function(){filter_icon.addClass(filter_icon.data('class-showing')).removeClass(filter_icon.data('class-hiding'));filter.removeClass(IS_COLLAPSED_CLASS);});}});$(".extra-options-btn").click(function(e){e.preventDefault();let $this=$(this);let options_container=$this.closest("div.filter-list");let hidden_options=options_container.find("li.d-none");if(hidden_options.length>0){hidden_options.addClass("to-hide");hidden_options.removeClass("d-none");$this.text(gettext("Ver menos"));}else{let options_to_hide=options_container.find("li.to-hide");if(options_to_hide.length>0){options_to_hide.addClass("d-none");options_to_hide.removeClass("to-hide");$this.text(gettext("Ver más"));}}});}
197var product_availailability_alert_functions=function(){modal=$("#product_availability_alert_modal");$(document).on('click','#btn_submit_alert_form',function(){$this=this;form=$("#product_availability_alert_form");$.ajax({method:"POST",url:form.attr("action"),data:form.serialize(),success:function(data){form.trigger("reset");ot4.reset_form_errors("product_availability_alert_form");modal.modal("hide");$("body").append(data);$("#modal_product_availability_alert").modal();},error:function(xhr){ot4.handle_form_errors("product_availability_alert_form",xhr.responseText);}});});function loadModal(sellable_product_id){modal_body=$("#product_availability_alert_modal .modal-body");modal_body.load(btn_alert_pushed.dataset.xhrUrl,function(data){modal_body.find("#id_sellable_product").val(sellable_product_id);modal.modal();});}
198modal.on('shown.bs.modal',function(){$("#product_availability_alert_form").find("#id_email").focus();});$(".btn-product-availability-alert").click(function(){btn_alert_pushed=this;add_sellable_to_cart_form=$('#add_sellable_to_cart_form');if(add_sellable_to_cart_form.length){sellable_product_id=$("#id_sellable").val();}else if(this.dataset.sellableId){sellable_product_id=this.dataset.sellableId}else{sellable_product_id=modal.data("sellable")}
199if(add_sellable_to_cart_form.length){add_sellable_to_cart_form=$('#add_sellable_to_cart_form')[0];if(add_sellable_to_cart_form.checkValidity()){loadModal(sellable_product_id);}else{add_sellable_to_cart_form.reportValidity();}}else{loadModal(sellable_product_id);}});}
200var review_functions=function(){$('.btn-review').on('click',function(){var element=$(this);var product_name=element.data('product-name');var product_id=element.data('product-id');$('.create-review-submit.d-none').removeClass('d-none');$('#review_modal_label').text(product_name);var $this=$(this);$.ajax({url:$this.data('xhr-url'),data:{product_id:product_id},success:function(html){$('#review_modal .modal-body').html(html);$('#review_modal #id_product').val(product_id);updateStars();LazyRecaptcha.include_script();},error:function(jqXHR,textStatus,errorThrown){if(jqXHR.status==400){$('#review_modal .modal-body').html(jqXHR.responseText);$('.create-review-submit').addClass("d-none");}else{toastr.error(gettext("Ha habido algún problema, inténtalo de nuevo y si el problema persiste contacta con tu asesor en OpenTiendas."));}},complete:function(xhr){$('#review_modal').modal('show');},});});$('body').on('click','.star-rating .fa',function(){$(this).siblings('input.rating-value').val($(this).data('rating'));updateStars();});$('body').on('mouseover','.star-rating .fa',function(){var parent=$(this).parents('.star-rating');var rating=$(this).data('rating');parent.find('.fa[data-rating]').each(function(){var this_rating=$(this).data('rating');if(parseInt(this_rating)>parseInt(rating)){$(this).removeClass('fa-star').addClass('fa-star-o');}else{$(this).removeClass('fa-star-o').addClass('fa-star');}});});$('body').on('mouseout','.star-rating',function(){var value=$(this).find('input.rating-value').val();$(this).find('.fa[data-rating]').each(function(){var this_rating=$(this).data('rating');
200if(parseInt(this_rating)>parseInt(value)){$(this).removeClass('fa-star').addClass('fa-star-o');}else{$(this).removeClass('fa-star-o').addClass('fa-star');}});});$('body').on('submit','.product_review_form',function(e){e.preventDefault();var element=$(this);var form=element.serialize();var url=element.data('xhr-url');$(element).find("[type=submit]").prop('disabled',true);$.ajax({method:"POST",url:url,data:form,success:function(json){if(json.status=='ok'){element.find('.star-rating').html("<div class='alert alert-info' role='alert'>"+json.message+"</div>");element.find('.new-review').remove();let $next_form=element.next();if(!$next_form.length){const $next_container=element.closest(".container").next();if($next_container.length){$next_form=$next_container.first('.product_review_form');}}
201if($next_form.length){$("html, body").scrollTop($next_form.offset().top-30);}}},error:function(jqXHR,textStatus,errorThrown){if(jqXHR.status==409){element.html("<div class='alert alert-info' role='alert'>"+jqXHR.responseJSON.message+"</div>")
202updateStars();}},complete:function(data){$(element).find("[type=submit]").prop('disabled',false);}});});$('body').on('click','.create-review-submit',function(){var element=$(this);var form=$(element.data('form-target'));var url=form.data('xhr-url');$(element).prop('disabled',true);const manage_form=()=>{$.ajax({method:"POST",url:url,data:form.serialize(),success:function(json){if(json.status=='ok'){$('.review-success').css('display','block');form.remove();$('.create-review-submit').remove();}
203else{toastr.error('Ha habido algún error');}},error:function(jqXHR,textStatus,errorThrown){if(jqXHR.status==400){$('#review_modal .modal-body').html(jqXHR.responseText);updateStars();}else{toastr.error(gettext("Ha habido algún problema, inténtalo de nuevo y si el problema persiste contacta con tu asesor en OpenTiendas."));}},complete:function(data){$(element).prop('disabled',false);}});}
204if(LazyRecaptcha.is_recaptcha_enabled()){LazyRecaptcha.onScriptLoad(function(){grecaptcha.ready(function(){grecaptcha.execute(LazyRecaptcha.get_recaptcha_key(),{action:'create_review'}).then(function(token){form.find('#id_g_recaptcha_response').val(token);manage_form();});});})}else{manage_form();}});}
205var question_functions=function(){$('.btn-question').on('click',function(){var element=$(this);var product_name=element.data('product-name');var product_id=element.data('product-id');$('#question_modal_label').text(product_name);var $this=$(this);$.ajax({url:$this.data('xhr-url'),data:{product_id:product_id},success:function(html){$('#question_modal .modal-body').html(html);$('#question_modal #id_product').val(product_id);$('.create-question-submit').css('display','block');LazyRecaptcha.include_script();},error:function(jqXHR,textStatus,errorThrown){if(jqXHR.status==400){$('#question_modal .modal-body').html(jqXHR.responseText);$('.create-question-submit').css('display','none');}else{toastr.error(gettext("Ha habido algún problema, inténtalo de nuevo y si el problema persiste contacta con tu asesor en OpenTiendas."));}},complete:function(xhr){$('#question_modal').modal('show');},});});$('body').on('click','.create-question-submit',function(){var element=$(this);var form=$(element.data('form-target'));var url=form.data('xhr-url');$(element).prop('disabled',true);const manage_form=()=>{$.ajax({method:"POST",url:url,data:form.serialize(),success:function(json){if(json.status=='ok'){$('.question-success').css('display','block');form.remove();$('.create-question-submit').css('display','none');}
206else{toastr.error('Ha habido algún error');}},error:function(jqXHR,textStatus,errorThrown){if(jqXHR.status==400){$('#question_modal .modal-body').html(jqXHR.responseText);}else{toastr.error(gettext("Ha habido algún problema, inténtalo de nuevo y si el problema persiste contacta con tu asesor en OpenTiendas."));}},complete:function(data){$(element).prop('disabled',false);}});}
207if(LazyRecaptcha.is_recaptcha_enabled()){LazyRecaptcha.onScriptLoad(function(){grecaptcha.ready(function(){grecaptcha.execute(LazyRecaptcha.get_recaptcha_key(),{action:'create_question'}).then(function(token){form.find('#id_g_recaptcha_response').val(token);manage_form();});});});}else{manage_form();}});}
208var keep_selection_after_quantity_change=function(input_element,new_quantity=null){let value=0;value=new_quantity||input_element.val();let id_sellable=$("#id_sellable").val();let selected_quantity_discount=select_used_discount_after_quantity_change(id_sellable,value);$("#discounts_product_list .discount-box").removeClass('active');$("#discounts_product_list .discount-box[data-quantity='"+selected_quantity_discount+"']").addClass('active');}
209var select_used_discount_after_quantity_change=function(sellable_id=null,new_quantity){let quantity_discounts=null;if(sellable_id){quantity_discounts=$("#discounts_product_list .discount-sellable[data-sellable-id='"+sellable_id+"'] .discount-box").map(function(){return $(this).data("quantity");}).get();}else{quantity_discounts=$("#discounts_product_list .discount-sellable").first().find(".discount-box").map(function(){return $(this).data("quantity");}).get();}
210quantity_discounts.sort(function(a,b){return b-a;});let selected_quantity=null;let should_skip=false;quantity_discounts.forEach(qty_discount=>{if(!should_skip&&(new_quantity>=qty_discount)){selected_quantity=qty_discount;should_skip=true;return;}});return selected_quantity;}
211var product_functions=function(){function cheapest_sellable_price(){var cheapest_price=undefined;const $sellable_pricing=$('.sellable-specific.sellable-pricing');if($sellable_pricing.length>1){$sellable_pricing.each(function(index,sellable){const $selling_price=$(sellable).data('selling-price');if(cheapest_price==undefined){cheapest_price=$selling_price;}
212cheapest_price=Math.min(cheapest_price,$selling_price);});const $cheapest_sellable=$sellable_pricing.filter('[data-selling-price='+cheapest_price+']').first();$cheapest_sellable.prependTo($cheapest_sellable.parent());}}
213cheapest_sellable_price();$('.btn-better-price').on('click',function(){var element=$(this);var product_name=element.data('product-name');var product_id=element.data('product-id');$('#better_price_modal_label').text(product_name);var $this=$(this);$.ajax({url:$this.data('xhr-url'),data:{product_id:product_id},success:function(html){$('#better_price_modal .modal-body').html(html);$('#better_price_modal #id_product').val(product_id);$('.report-better-price-submit').css('display','block');LazyRecaptcha.include_script();},error:function(jqXHR,textStatus,errorThrown){if(jqXHR.status==400){$('#better_price_modal .modal-body').html(jqXHR.responseText);$('.report-better-price-submit').css('display','none');}else{toastr.error(gettext("Ha habido algún problema, inténtalo de nuevo y si el problema persiste contacta con tu asesor en OpenTiendas."));}},complete:function(xhr){$('#better_price_modal').modal('show');},});});$('#superuser-actions').on('click','.show-product-owner-info',function(){var $button=$(this);var $info=$('.product-owner-info');if($info.css('display')=='none'){var $this=$(this);$.ajax({url:$this.data('xhr-url'),success:function(html){$button.find('i').removeClass('fa-eye').addClass('fa-eye-slash');$info.html(html);$('.product-owner-info-popover').popover({html:true,sanitize:false,trigger:'focus',container:'body'});$('[data-toggle="tooltip"]').tooltip()
214$('.product_predictive_analysis').on('click',function(){var $this=$(this);$.ajax({url:$this.data('xhr-url'),success:function(html){$('#modal_product_predictive_analysis .modal-title').html($this.data('title'));$('#modal_product_predictive_analysis .modal-body').html(html);$('#modal_product_predictive_analysis').modal('show');},error:function(jqXHR,textStatus,errorThrown){if(jqXHR.status==400){$('#modal_product_predictive_analysis .modal-body').html(jqXHR.responseText);}else{$('#modal_product_predictive_analysis .modal-body').html(gettext("Ha habido algún problema, inténtalo de nuevo y si el problema persiste contacta con tu asesor en OpenTiendas."));}}});});},error:function(jqXHR,textStatus,errorThrown){$info.html(gettext("Ha habido algún problema, inténtalo de nuevo y si el problema persiste contacta con tu asesor en OpenTiendas."));}});}else{$button.find('i').removeClass('fa-eye-slash').addClass('fa-eye');}
215$info.toggle();});$('body').on('click','.report-better-price-submit',function(){var element=$(this);var form=$(element.data('form-target'));var url=form.data('xhr-url');const manage_form=()=>{$.ajax({method:"POST",url:url,data:form.serialize(),success:function(json){if(json.status=='ok'){$('.question-success').css('display','block');form.remove();$('.report-better-price-submit').css('display','none');}
216else{toastr.error('Ha habido algún error');}},error:function(jqXHR,textStatus,errorThrown){if(jqXHR.status==400){$('#better_price_modal .modal-body').html(jqXHR.responseText);}else{toastr.error(gettext("Ha habido algún problema, inténtalo de nuevo y si el problema persiste contacta con tu asesor en OpenTiendas."));}}});}
217if(LazyRecaptcha.is_recaptcha_enabled()){LazyRecaptcha.onScriptLoad(function(){grecaptcha.ready(function(){grecaptcha.execute(LazyRecaptcha.get_recaptcha_key(),{action:'better_price'}).then(function(token){form.find('#id_g_recaptcha_response').val(token);manage_form();});});});}else{manage_form();}});$("#id_sellable").change(function(){const val=$(this).val();const $sequra_holder=$('.sequra-promotion-widget');const $paypal_holder=$('.paypal-promotion-widget');const product_data_script=$("#product-data");const SELLABLES_DATA=product_data_script.length?$.parseJSON(product_data_script.text()):{};var sellable_target=$(this).data('sellabletarget');var images_target=$(this).data('imagestarget');var images_sellable=$(this).data('sellable-images');var current_quantity=$('.product-view #id_quantity').val();if(val&&(typeof sellable_target!=typeof undefined)){let data=SELLABLES_DATA[val];if(typeof data==typeof undefined){return;}
218if(ot4.authenticated&&$(".footer.check-pricing").length){let pricing_plan_data={product:$('#productview').data('product-id'),sellables:JSON.stringify([val]),type:$('#productview').data('product-view-type')}
219$.ajax({url:$('body').data('pricing-plan-xhr-url'),type:'json',async:false,method:'POST',data:pricing_plan_data,success:function(result){if(result&&result.sellables&&result.sellables.length){Object.assign(data,result.sellables[0].data);}}});}
220$(".sellable-pricing .price-offer-text").text(data.offer_text);$(".sellable-pricing .price-text").text(data.price);$(".sellable-pricing .without-vat").text(data.price_without_vat);$(".sellable-pricing .unit_pricing_measure").text(data.unit_pricing_measure);if(data.unit_pricing_measure&&data.price_without_vat){$(".sellable-pricing .unit_pricing_measure").addClass("d-block");$(".sellable-pricing .without-vat").addClass("d-none");}else{$(".sellable-pricing .unit_pricing_measure").removeClass("d-block");$(".sellable-pricing .without-vat").removeClass("d-none");}
221if(data.offer_price){$(".sellable-pricing .offer-price .js-money").text(data.offer_price);$(".sellable-pricing .offer-price").removeClass("d-none");}else{$(".sellable-pricing .offer-price").addClass("d-none");$(".sellable-pricing .offer-price .js-money").text("");}
222if(data.original_price){$(".sellable-pricing .original-price .js-money").text(data.original_price);$(".sellable-pricing .original-price").removeClass("d-none");}else{$(".sellable-pricing .original-price").addClass("d-none");$(".sellable-pricing .original-price .js-money").text("");}
223$(".discounts-per-quantity-container").html(data.per_quantity_discounts);if($sequra_holder.length){$sequra_holder.attr('data-amount',parseInt(data.selling_price*100));try{Sequra.onLoad(function(){Sequra.refreshComponents();});}catch(e){}}else if($paypal_holder.length){$paypal_holder.attr('data-pp-amount',data.selling_price_usr);if(data.selling_price_usr>=parseFloat($paypal_holder.data("pp-min-amount"))&&data.selling_price_usr<=parseFloat($paypal_holder.data("pp-max-amount"))){$paypal_holder.removeClass("d-none");}else{$paypal_holder.addClass("d-none");}}
224$(".product-allinfo .product-detail-sku").text(data.sku);if(this.selectedOptions.length){stock_replenishment_date=this.selectedOptions[0].dataset.stockReplenishmentDateRepr;if(stock_replenishment_date){$("#stock_replenishment_date_alert").removeClass("d-none");$("#stock_replenishment_date").text(stock_replenishment_date);}else{$("#stock_replenishment_date_alert").addClass("d-none");}}
225$('.sellable-specific[data-sellable-id='+val+']').each(function(){$(this).prependTo(this.parentNode);});var quantities=$(this).data('quantities')[val];var quantity_constraints={min_quantity:quantities[0],quantity_factor:quantities[1]};$(this).parents('form').find('.QuantityInput').each(function(){this.set_quantity_constraints(quantity_constraints);});var $m2_calc_input=$(this).parents('form').find('.m2-calc');if($m2_calc_input){var unit_pricing_measure=$(this).data('unit-pricing-measures')[val];if(unit_pricing_measure){$m2_calc_input.parent().addClass('d-inline-flex');$m2_calc_input.parent().removeClass('d-none');$m2_calc_input.data('unit-pricing-measure',unit_pricing_measure.quantity);$m2_calc_input.val(unit_pricing_measure.quantity);$m2_calc_input.siblings("span").html(unit_pricing_measure.unit);$(this).parents('form').find('input[name^=quantity]').trigger('change');}else{$m2_calc_input.parent().addClass('d-none');$m2_calc_input.parent().removeClass('d-inline-flex');}}
226if(data.available_stock_description){$(".product-availability-message small").text(data.available_stock_description);$(".product-availability-message").show();}else{$(".product-availability-message").prop("style","display: none !important");}
227$(".delivery-date-message").html(data.delivery_date_message);if(data.free_shipping){$(".free-shipping-label-zone").text(data.free_shipping);$(".free-shipping-label").show();}else{$(".free-shipping-label").prop("style","display: none !important");}
228if($('#discounts_product_list').length>0){$('#discounts_product_list .discount-sellable').addClass('d-none');$('#discounts_product_list .discount-sellable[data-sellable-id="'+val+'"]').removeClass('d-none');let input_element=$('.product-view #id_quantity');input_element.val(current_quantity);input_element.trigger("change");}}
229if(val&&(typeof images_sellable!=typeof undefined)){var image_id=images_sellable[val];$(images_target+'[data-image-id='+image_id+'] .thumb').trigger('click');}});$('.add-to-cart-with-table').on('click',function(e){e.preventDefault();$("#sellables_with_table_form input[name=quantity]").val($(this).prev('input[name*=quantity_]').val());$("#sellables_with_table_form [name=sellable]").val($(this).data('sellable-id'));$("#sellables_with_table_form").submit();});function selectBestMatchingImage(selectedAttrs){const $sellableSelector=$('#id_sellable');const imageMap=$sellableSelector.data('images-attrs')||[];if(!Array.isArray(imageMap)||!imageMap.length){return;}
230const selected={};Object.entries(selectedAttrs||{}
230).forEach(([attrId,attrValue])=>{if(attrValue!==null&&attrValue!==undefined&&attrValue!==''){selected[String(attrId)]=String(attrValue);}});const selectedEntries=Object.entries(selected);if(!selectedEntries.length){return;}
231let bestImageId=null;let bestScore=-1;imageMap.forEach((image)=>{if(!image||image.id===undefined||!Array.isArray(image.values)){return;}
232let imageBestScore=0;image.values.forEach((combo)=>{if(!combo||typeof combo!=='object'){return;}
233let comboScore=0;selectedEntries.forEach(([attrId,attrValue])=>{if(String(combo[attrId])===attrValue){comboScore+=1;}});if(comboScore>imageBestScore){imageBestScore=comboScore;}});if(imageBestScore>bestScore){bestScore=imageBestScore;bestImageId=image.id;}});if(bestScore>0&&bestImageId!==null){$($sellableSelector.data('imagestarget')+'[data-image-id='+Number(bestImageId)+'] .thumb').trigger('click');}}
234(function(){var drilldown=$(".sellable-drilldown");if(!drilldown.length){return;}
235var sellable_selector=drilldown.find("[name='sellable']");var attribute_choices=sellable_selector.data('attribute-choices');var attribute_row_template=drilldown.find(".attribute-row");attribute_row_template.remove();function create_attribute_selector(attribute){let id_el="select_attr_"+attribute.id;var row=attribute_row_template.clone();row.find("label").html(attribute.name).attr("for",id_el);var select=row.find("select").attr({"data-attribute":attribute.id,"id":id_el}).data("attribute",attribute);drilldown.append(row);return select;}
236function create_attribute_values(select,selected_value){var attribute=select.data("attribute");add_select_option(select,"","--");var eligible_options=get_eligible_sellables();for(var i=0;i<attribute.values.length;i++){var attr_value=attribute.values[i];if(eligible_options.filter("[data-attr-"+attribute.id+"='"+attr_value.id+"']").length){add_select_option(select,attr_value.id,attr_value.name);}}
237select.val(selected_value||'');}
238function add_select_option(select,value,text){var option=document.createElement("option");option.value=value;option.innerText=text;select.append(option);}
239function get_eligible_sellables(){var eligible_options=sellable_selector.find("option");drilldown.find(".attribute-row select").each(function(){var select=$(this);var attr_choice=select.val();if(attr_choice){var attr=select.attr("data-attribute");eligible_options=eligible_options.filter("[data-attr-"+attr+"='"+attr_choice+"']");}});return eligible_options;}
240if(sellable_selector.val()){var selected_option=(sellable_selector.find("option[value='"+sellable_selector.val()+"']"));for(var i=0;i<attribute_choices.length;i++){var attribute=attribute_choices[i];var attr_value=selected_option.attr("data-attr-"+attribute.id);var select=create_attribute_selector(attribute);create_attribute_values(select,attr_value);}}
241else{for(var i=0;i<attribute_choices.length;i++){var attribute=attribute_choices[i];var select=create_attribute_selector(attribute);if(!i){create_attribute_values(select);}}}
242var attr_selects=drilldown.find(".attribute-row select");attr_selects.on("change",function(){$(this).parents(".attribute-row").nextAll(".attribute-row").find("select").empty().each(function(){create_attribute_values($(this));});let selectedAttrs={};attr_selects.find("option[value!='']:selected").each(function(){var attr_id=$(this).parent().attr("data-attribute");selectedAttrs[attr_id]=$(this).val();});selectBestMatchingImage(selectedAttrs);if(attr_selects.find("option[value!='']:selected").length==attr_selects.length){var sellable_id=get_eligible_sellables().attr("value");sellable_selector.val(sellable_id).trigger("change");}
243else{sellable_selector.val('');}});})();var report_first_missing_attribute_group=function(){return false;};(function(){const $sellableSelector=$('.sellable-attribute-values-buttons [name="sellable"]');const $attributeGroups=$('.sellable-attribute-values-buttons .attribute-group');function syncNativeGroupControls(){$attributeGroups.each(function(){var $group=$(this);var $checkedButton=$group.find('.attribute-value[aria-checked="true"]').first();var selectedValueId=$checkedButton.length?String($checkedButton.data('attr-value-id')):'';var $groupControls=$group.find('.attribute-group-control');
243$groupControls.prop('checked',false);if(selectedValueId){$groupControls.filter('[value="'+selectedValueId+'"]').prop('checked',true);}
244if($groupControls.length){$groupControls[0].setCustomValidity('');}});}
245report_first_missing_attribute_group=function(){var $firstMissingGroup=$attributeGroups.filter(function(){return!$(this).find('.attribute-value[aria-checked="true"]').length;}).first();if(!$firstMissingGroup.length){return false;}
246var $firstControl=$firstMissingGroup.find('.attribute-group-control').first();if(!$firstControl.length){return false;}
247$firstMissingGroup[0].scrollIntoView({block:'center',behavior:'smooth'});$firstControl[0].reportValidity();return true;};var availableSellables={};$sellableSelector.find('option').each(function(){if(this.value!=''){var optionData=$(this).data();var attributes={};Object.entries(optionData).forEach(([key,value])=>{if(key.startsWith('attr')){var attrId=key.replace('attr-','');attributes[attrId]=value;}});availableSellables[this.value]=attributes;}});function getSelectedAttrs(){var selected={};$('.sellable-attribute-values-buttons .attribute-value[aria-checked="true"]').each(function(){selected[String($(this).data('attr-id'))]=String($(this).data('attr-value-id'));});return selected;}
248function isCompatible(constraints){return Object.values(availableSellables).some(function(attrs){return Object.entries(constraints).every(function(entry){var attrId=entry[0];var attrValueId=entry[1];return String(attrs[attrId])===String(attrValueId);});});}
249function updateUnavailableStates(selectedAttrs){$('.sellable-attribute-values-buttons .attribute-value').each(function(){var $btn=$(this);var btnAttrId=String($btn.data('attr-id'));var btnValueId=String($btn.data('attr-value-id'));var constraints=Object.assign({},selectedAttrs);constraints[btnAttrId]=btnValueId;var possible=isCompatible(constraints);$btn.toggleClass('is-unavailable',!possible);});}
250function isSelectionComplete(){return $attributeGroups.filter(function(){return!$(this).find('.attribute-value[aria-checked="true"]').length;}).length===0;}
251function getSelectedSellableId(selectedAttrs){if(!isSelectionComplete()){return null;}
252var selectedSellableId=null;Object.entries(availableSellables).some(function(entry){var sellableId=entry[0];var attributes=entry[1];var isSame=Object.entries(selectedAttrs).every(function(selectedEntry){var attrId=selectedEntry[0];var attrValueId=selectedEntry[1];return String(attributes[attrId])===String(attrValueId);});if(isSame){selectedSellableId=sellableId;}
253return isSame;});return selectedSellableId;}
254function updateAttributeLabel($button){const $attributeLabel=$button.parents('.attribute-group').find('.attribute-label');if($button.attr('aria-checked')==='true'){$attributeLabel.text($button.attr('aria-label'));}else{$attributeLabel.text($attributeLabel.data('attr-name'));}}
255function syncButtonsFromSelectedSellable(){var selectedSellableId=String($sellableSelector.val()||'');var selectedAttributes=availableSellables[selectedSellableId]||null;if(!selectedAttributes){syncNativeGroupControls();return;}
256$('.sellable-attribute-values-buttons .attribute-value').each(function(){var $button=$(this);var attrId=String($button.data('attr-id'));var attrValueId=String($button.data('attr-value-id'));var isSelected=String(selectedAttributes[attrId])===attrValueId;$button.attr('aria-checked',isSelected?'true':'false');$button.toggleClass('is-selected',isSelected);updateAttributeLabel($button);});syncNativeGroupControls();}
257$('.sellable-attribute-values-buttons .attribute-value').on('click',function(){const $button=$(this);const isSelected=$button.attr('aria-checked')==='true';$button.siblings().attr('aria-checked','false');$button.siblings().removeClass('is-selected');$button.attr('aria-checked',isSelected?'false':'true');$button.toggleClass('is-selected',!isSelected);updateAttributeLabel($button);var selectedAttrs=getSelectedAttrs();updateUnavailableStates(selectedAttrs);syncNativeGroupControls();selectBestMatchingImage(selectedAttrs);var selected_sellable_id=null;var isComplete=isSelectionComplete();if(isComplete){selected_sellable_id=getSelectedSellableId(selectedAttrs);}
258var hasId=!!selected_sellable_id;var shouldShowElements=!isComplete||hasId;if($('.add-to-cart-container').length){$('#quantity_input_container').toggleClass('d-inline-flex',shouldShowElements).toggleClass('d-none',!shouldShowElements);$('.product-delivery-info').toggleClass('d-none',!shouldShowElements);$('#product_out_of_stock_alert').toggleClass('d-none',!isComplete||hasId);$('.add-to-cart-container').toggleClass('d-none',!shouldShowElements);}else{$('.btn-toggle-wishlist').toggleClass('d-none',!shouldShowElements);$('#btn_product_availability_alert').toggleClass('d-none',!shouldShowElements);}
259if(!hasId){$("#stock_replenishment_date_alert").addClass("d-none");}
260if(isComplete){$sellableSelector.val(selected_sellable_id||'').trigger('change');}});syncButtonsFromSelectedSellable();updateUnavailableStates(getSelectedAttrs());syncNativeGroupControls();})();$('.add-to-cart').on("click",function(e){if($("#attribute_choices_form").length>0){if(!$("#attribute_choices_form")[0].checkValidity()){$("#attribute_choices_form")[0].reportValidity();e.preventDefault();return false;}}
261var $sellables_form=$("#add_sellable_to_cart_form");if($sellables_form.length>0&&!$sellables_form[0].checkValidity()){if($(".attribute-group").length>0){if(report_first_missing_attribute_group()){e.preventDefault();return false;}
262e.preventDefault();return false;}else{var $target_select=$sellables_form.find(".select-attribute")[1];$target_select.scrollIntoView();}}
263$('[data-add-cart-form]').find('input[name="is_sample"]').val('');});$('[data-add-cart-form]').submit(function(e){e.preventDefault();var $form=$(this);var url=$form.attr('action');var add_to_cart_btn=$form.find('.add-to-cart');const btn_content=add_to_cart_btn.html();const is_sample=$form.find('input[name="is_sample"]').val()==='on';const quantityField=$form.find('input[name="quantity"]');const originalQtyMin=quantityField.attr('min');const originalQtyStep=quantityField.attr('step');if(add_to_cart_btn.length==0){var sellable_id=$form.find('[name=sellable]').val();add_to_cart_btn=$(`.add-to-cart-with-table[data-sellable-id=${sellable_id}]`)}
264function restoreQtyFieldAttributes(){quantityField.attr('min',originalQtyMin);quantityField.attr('step',originalQtyStep);}
265if(is_sample){quantityField.attr('min',1);quantityField.attr('step',1);}
266if(!$form[0].checkValidity()){$form[0].reportValidity();restoreQtyFieldAttributes();return false;}
267restoreQtyFieldAttributes();let gclid=localStorageDisplaySettings.get("gclid");if(gclid){let gclid_date=Date.parse(localStorageDisplaySettings.get("gclid_date"));const difference_days=Math.abs(new Date()-gclid_date)/(1000*60*60*24);if(difference_days<4){$form.find('[name=gclid]').val(gclid);}
268localStorageDisplaySettings.del("gclid");localStorageDisplaySettings.del("gclid_date");}
269let additional_services=[];$('.service-option input:checked').each((index,element)=>{additional_services.push(serviceOptionId($(element)));});let data=$form.serializeArray();data.push({name:'additional_services',value:JSON.stringify(additional_services)});if(is_sample){data=data.map(function(item){if(item.name==='quantity'){item.value=1;}
270return item;});}
271$.ajax({url:url,data:data,method:'POST',beforeSend:function(){add_to_cart_btn.prop("disabled",true)},success:function(data){if(data.status=='ok'){ot4.dispatch_event
271('add_to_cart_success',{fb_event:data.fb_event||null,google_events:data['g'+'tag_events']||null,kla_event:data.kla_event||null});if(data.message){add_to_cart_btn.popover({content:data.message});add_to_cart_btn.popover('show');$('.popover').removeClass('popover-danger').addClass('popover-success');setTimeout(function(){add_to_cart_btn.popover('hide');},2000);}
272if(data.reload_url){window.location.href=data.reload_url}else{$(".cart-icon span.cart-label").text(data.units);let html=PriceVisibilityFunctions.check_products(`<div>${data.overlay_content}</div>`);ot4.fixedRightOverlay("#add-to-cart-overlay",data.overlay_title,html);init_wishlist_in_product_cards();}}},error:function(xhrResponse){data=xhrResponse.responseJSON;if(data.status=='failed'){var errors='';var last_item='';data.messages.forEach(function(item){if(item!=last_item){errors+=item+'<br>';last_item=item;}});add_to_cart_btn.popover({content:errors,html:true,sanitize:false,placement:'bottom'}).on("show.bs.popover",function(){$($(this).data("bs.popover").getTipElement()).css("max-width","300px");});add_to_cart_btn.popover('show');$('.popover').addClass('popover-danger').removeClass('popover-success');setTimeout(function(){add_to_cart_btn.popover('dispose');},10000);}},complete:function(){add_to_cart_btn.prop("disabled",false);add_to_cart_btn.html(btn_content);}})});var serviceOptionId=($element)=>{return $element.closest('.service-option').data('id');};$('.service-option input').change(function(){const selectedOptionID=serviceOptionId($(this));const $container=$(this).parents('.service-options-container');if(!$container.data("multiple-choice")){$container.find('input').each(function(){if(serviceOptionId($(this))!==selectedOptionID){$(this).prop('checked',false);}});}});$('.service-option-details').click(function(e){e.preventDefault();const $this=$(this);$.ajax({url:$this.prop('href'),success:function(html){$('#service_option_details_modal .modal-title').html($this.parents('.service-container').find('span,summary').text());$('#service_option_details_modal .modal-body-title').removeClass('d-none');$('#service_option_details_modal .modal-body-title').html($this.siblings('label').text());$('#service_option_details_modal .modal-body-content').html(html);$('#service_option_details_modal').modal('show');}});});$('.btn-request-product-sample').on("click",function(e){if($("#attribute_choices_form").length>0){if(!$("#attribute_choices_form")[0].checkValidity()){$("#attribute_choices_form")[0].reportValidity();e.preventDefault();return false;}}
273var $sellables_form=$("#add_sellable_to_cart_form");if($sellables_form.length>0&&!$sellables_form[0].checkValidity()){if($(".attribute-group").length>0){if(report_first_missing_attribute_group()){e.preventDefault();return false;}
274e.preventDefault();return false;}
275var $target_select=$sellables_form.find(".select-attribute")[1];$target_select.scrollIntoView();}
276let $form=$("#sellables_with_table_form");if($form.length){$form.find("[name=sellable]").val($('select.sample-sellable').val());}else{$form=$('[data-add-cart-form]');}
277$form.find('input[name="is_sample"]').val('on');$form.submit();});$('.product-sample-more-info').click(function(e){e.preventDefault();const $this=$(this);$.ajax({url:$this.prop('href'),success:function(html){$('#service_option_details_modal .modal-title').html($this.parents('.ifc-product-sample-container').find('.product-sample-title').text().trim());$('#service_option_details_modal .modal-body-title').addClass('d-none');$('#service_option_details_modal .modal-body-content').html(html);$('#service_option_details_modal').modal('show');}});});$("body").on("click","#discounts_product_list .discount-box",function(){var quantity_input=$('.product-view #id_quantity');var quantity_inputs_table=$(".sellables-in-table-cell .sellables-prices input[name*='quantity_']");var value=$(this).data('quantity');var is_table_view=$(this).parent('.discount-sellable').hasClass('is-table');var $quantity_container=$('.QuantityInput')
278var $quantity_input=$quantity_container.find('input[type="number"]');var step=parseInt($quantity_input.attr('step'))||1;var min=parseInt($quantity_input.attr('min'));var $minus_button=$quantity_container.find('.btn-number').filter('[data-type="minus"]');$minus_button.prop('disabled',value-step<min);if(is_table_view){quantity_inputs_table.val(value).trigger('change');}else{quantity_input.val(value).trigger('change');keep_selection_after_quantity_change(quantity_input,value);}});$('.product-view #id_quantity').change(function(){keep_selection_after_quantity_change($(this));});$('.product-view #id_quantity').on('input',function(){$(this).trigger('change');});if($("#discounts_product_list .discount-box .active").length==0){$("#discounts_product_list .discount-box[data-quantity=1]").addClass("active");}
279$(".sellables-in-table-cell .sellables-prices input[name*='quantity_']").change(function(){var value=$(this).val();var parent_row=$(this).parents('.sellables-prices');var discounts=parent_row.find('.table-discount');var sellable_id=parent_row.data('sellable-id');var selected_quantity_discount=select_used_discount_after_quantity_change(sellable_id,value);discounts.addClass('d-none');discounts.each(function(){var $discount=$(this);if($discount.data('quantity')>=selected_quantity_discount){$discount.removeClass('d-none');}});$("#discounts_product_list .discount-box").removeClass('active');$("#discounts_product_list .discount-box[data-quantity='"+selected_quantity_discount+"']").addClass('active');});$(".sellables-in-table-cell .sellables-prices input[name*='quantity_']").on('input',function(){$(this).trigger('change');});$("#id_sellable").trigger("change");if($("#discounts_product_list .discount-sellable.is-table").length>0&&$("#discounts_product_list .discount-sellable.is-table.d-none").length!=$("#discounts_product_list .discount-sellable.is-table").length){$("#discounts_product_list .discount-sellable.is-table").each(function(){if($(this).find('.discount-box').length>0){$(this).removeClass('d-none');return false;}});}
280const $sellables_table_filter_container=$(".sellables-in-table-filter");const $sellables_table_filter_attr_select=$(".sellables-in-table-filter select.table-filter-attr");const $sellables_table_filter_attr_vals_select=$(".sellables-in-table-filter select.table-filter-attr-vals");let table_filter_attrs=undefined;if($sellables_table_filter_container.length){table_filter_attrs=$sellables_table_filter_container.data("attrs");$sellables_table_filter_attr_select.append(`<option value="_all_">${gettext("Filtrar por")}</option>`);for(const[attr_id,attr_name]of Object.entries(table_filter_attrs.attributes)){$sellables_table_filter_attr_select.append(`<option value="${attr_id}">${attr_name}</option>`);}}
281$sellables_table_filter_attr_select.change(function(){const attr_id=$(this).val();$sellables_table_filter_attr_vals_select.empty();$(".sellables-in-table-cell").each(function(){$(this).removeClass("d-none");});if(attr_id=="_all_"){$sellables_table_filter_attr_vals_select.addClass("invisible");$(this).addClass("radius-top-bottom-right");}else{if(table_filter_attrs!==undefined){$sellables_table_filter_attr_vals_select.append(`<option value="_all_">${gettext("Todos")}</option>`);for(const[attr_val_id,attr_val_name]of Object.entries(table_filter_attrs.attribute_values[attr_id])){$sellables_table_filter_attr_vals_select.append(`<option value="${attr_val_id}">${attr_val_name}</option>`);}}
282$(this).removeClass("radius-top-bottom-right");$sellables_table_filter_attr_vals_select.removeClass("invisible");}});$sellables_table_filter_attr_vals_select.change(function(){const attr_val_id=$(this).val();let selected_rows=Array();$(`.sellables-in-table-cell[data-attr-val=${attr_val_id}]`).each(function(){selected_rows.push($(this).data("row"));});$(".sellables-in-table-cell").each(function(){$(this).removeClass("d-none");if(attr_val_id!="_all_"&&this.hasAttribute("data-row")&&selected_rows.indexOf($(this).data("row"))==-1){$(this).addClass("d-none");}});});let $wishlist_buttons=$('.btn-toggle-wishlist');if($wishlist_buttons.length){let product_ids=Array();let are_favs_url;$('.btn-toggle-wishlist').each(function(index,element){product_ids.push($(element).data('product-id'));are_favs_url=$(element).data('xhr-url');});$.ajax({data:{product_ids:JSON.stringify(product_ids)},url:are_favs_url,method:'POST',success:function(data){$wishlist_buttons.each(function(index,element){const $element=$(element);const icon=$element.find('.fa');const product_id=$element.data('product-id');if(data[parseInt(product_id)]){icon.removeClass('fa-heart-o');icon.addClass('fa-heart');}else{icon.removeClass('fa-heart');icon.addClass('fa-heart-o');}});},error:function(data){}});}
283$('.btn-wishlist-remove-fav').click(function(e){const $element=$(this);const modal_id='#wishlist-remove-fav-modal';const $modal=$(modal_id);let title=interpolate(gettext('¿Quieres eliminar el producto \"%(product_name)s\" de la lista de favoritos?'),{product_name:$element.data('product-name')},true);
283$modal.find('.modal-title').text(title);$modal.modal();$(modal_id+' .btn').click(function(e){$modal.modal('hide');});$(modal_id+' .btn-primary').click(function(e){$.ajax({data:{product_id:$element.data('product-id'),add:false},url:$element.data('xhr-manage-url'),method:'POST',success:function(data){location.reload();},error:function(data){}});});});}
284var init_wishlist_in_product_cards=function(){if(ot4.favorites){$(".card-product").each(function(index,product){const $product=$(product);const $icon=$product.find('.card-wishlist-btn .fa');const product_id=$product.data('product-id');if(ot4.favorites.includes(parseInt(product_id))){$icon.removeClass('fa-heart-o');$icon.addClass('fa-heart');}else{$icon.removeClass('fa-heart');$icon.addClass('fa-heart-o');}});}
285$('.btn-toggle-wishlist, .card-wishlist-btn').click(function(e){e.preventDefault();const $element=$(this);const icon=$element.find('.fa');const product_id=$element.data('product-id');$element.prop('disabled',true);let add_fav=icon.hasClass('fa-heart-o');$.ajax({data:{product_id:product_id,add:add_fav},url:$element.data('xhr-manage-url'),method:'POST',success:function(data){if(add_fav){icon.removeClass('fa-heart-o');icon.addClass('fa-heart');}else{icon.removeClass('fa-heart');icon.addClass('fa-heart-o');}
286let $toast=$('.wishlist-toast-container');$toast.find('.wishlist-toast-title').html(data.toast_title);if(data.toast_text){$toast.find('.wishlist-toast-text').html(data.toast_text);}else{$toast.find('.wishlist-toast-text').html('');}
287$toast.fadeIn(80,'linear');function fade_toast(){if($('.wishlist-toast-container:hover').length==0){$toast.fadeOut(1000);}else{setTimeout(fade_toast,5000);}}
288setTimeout(fade_toast,5000);},error:function(data){},complete:function(data){$element.prop('disabled',false);}});});}
289var product_extrainfo_toggle_content=function(){var OPEN_CLASS='opened';var mobile_heading=$('.product-extrainfo .tab-panel-mobile-heading.can-slide, .product-extrainfo .inner-more-info-toggle, .product-extrainfo .inner-package-info-toggle');mobile_heading.click(function(){if($(this).hasClass(OPEN_CLASS)){$(this).removeClass(OPEN_CLASS).siblings('.inner-content').slideUp();}else{$(this).addClass(OPEN_CLASS).siblings('.inner-content').slideDown();}});$(window).on('orientationchange',function(){$(window).one('resize',function(){if($(window).width()>ResponsiveApp.sizes_bt('md')){mobile_heading.siblings('.inner-content').css('display','block');mobile_heading.find('.inner-content').css('display','block');}else{mobile_heading.siblings('.inner-content:not(.opened-content)').css('display','none');mobile_heading.find('.inner-content:not(.opened-content)').css('display','none');}});});}
290var product_estimated_delivery_date_fn=function(){if(ot4.delivery_info){const product_data_script=$("#product-data");const SELLABLES_DATA=product_data_script.length?$.parseJSON(product_data_script.text()):{};const is_table_view=$(".product-view.main-section").data("product-view-type")=="table";var working_days=0;let shortest_estimate=null,longest_estimate=null;$.each(ot4.delivery_info.sellables_delivery_time,function(sellable_id,sellable_working_days){sellable_el=$('[data-sellable-id="'+sellable_id+'"]');if($(".sellable-drilldown").length){stock_replenishment_date=$('#id_sellable option[value="'+sellable_id+'"]').data("stock-replenishment-date");}else{stock_replenishment_date=sellable_el.data("stock-replenishment-date");}
291if(stock_replenishment_date){stock_replenishment_date=new Date(stock_replenishment_date);}
292let is_bundle=$(".product-view.main-section").data("product-view-type")=="bundle";if(is_bundle){if(working_days==0){working_days=sellable_working_days;}else{working_days=Math.max(working_days,sellable_working_days);}}else{working_days=sellable_working_days;}
293if(working_days){var estimate=EstimatedDeliveryDate.calculate_estimated_delivery_date(working_days,stock_replenishment_date);var message=EstimatedDeliveryDate.get_message(estimate);if(typeof SELLABLES_DATA[sellable_id]!=="undefined"){SELLABLES_DATA[sellable_id].delivery_date_message=message;}
294if(is_bundle){if(!longest_estimate||estimate.date>longest_estimate.date){longest_estimate=estimate;SELLABLES_DATA["_default_"].delivery_date_message=message;}}else{if(!shortest_estimate||estimate.date<shortest_estimate.date){shortest_estimate=estimate;SELLABLES_DATA["_default_"].delivery_date_message=message;}}
295if(is_table_view){$("[data-sellable-id="+sellable_id+"] .delivery-date-message").html(message);}}});if(!is_table_view){$(".delivery-date-message").html(SELLABLES_DATA["_default_"].delivery_date_message);}
296product_data_script.text(JSON.stringify(SELLABLES_DATA));}}
297var bundle_functions=function(){$("#bundle_add_cart_form select[name*=bundle_component]").on("change",function(){var form=$("#bundle_add_cart_form");var send_form=true;
297let component_images=$(this).data('images');let component_value=$(this).val();let component_image=(component_images&&component_value in component_images)?component_images[component_value]:''
298if(component_image){$(`.image-thumb-sellable[data-image-id='${component_image}'] .thumb`).trigger('click');}
299form.find('select[name*=bundle_component]').each(function(){if(!$(this).val()){send_form=false;}});if(send_form){var data=form.serializeArray();form.find('[name*=bundle_component]').each(function(){data.push({name:'bundle_quantity_'+$(this).attr('name').replace('bundle_component_',''),value:$(this).data('quantity')||''});});handle_free_shipping=$(".free-shipping-label").data("calculate-free-shipping");if(handle_free_shipping){data.push({name:'shipping-zone',value:form.data("shipping-zone")});}
300$.ajax({data:data,url:form.data('xhr-update-prices'),method:"POST",success:function(data){if(data.status=='ok'){var price_item=$('.product-view .price');if(data.prices.selling_price){price_item.children('.current').find('.js-money').html(data.prices.selling_price);pp_price=data.prices.selling_price.replace(",",".").replace("€","").replace("£","");$('.paypal-promotion-widget').attr("data-pp-amount",pp_price);}
301if(data.prices.pvp){price_item.children('.original').find('.js-money').html(data.prices.pvp);}
302if(data.prices.offer_price){price_item.children('.alternative').find('.js-money').html(data.prices.offer_price);}
303if(handle_free_shipping&&data.free_shipping){$(".free-shipping-label-zone").text(data.free_shipping);$(".free-shipping-label").show();}else{$(".free-shipping-label").prop("style","display: none !important");}
304$(".delivery-date-message").html(EstimatedDeliveryDate.get_message(EstimatedDeliveryDate.calculate_estimated_delivery_date(data.working_days,data.stock_replenishment_date)));}},error:function(data){}});}});}
305var add_to_cart_btn_behaviour=function(){var $button_add_to_cart=$(".add-to-cart-helper");var is_product_view=$('section.product-view').length>0;if(is_product_view&&$(window).width()<ResponsiveApp.sizes_bt('md')){$(window).scroll(function(){var products_extra_info=$('#productview_extrainfo');var products_extra_info_position=products_extra_info.offset().top+products_extra_info.height();var offset=300;if(($(window).scrollTop()+offset)>products_extra_info_position){$button_add_to_cart.slideUp();}else{$button_add_to_cart.slideDown();}});}}
306var view_products_btn_behaviour=function(){var is_product_view=$('section.product-view').length>0;var $table=$('#product-table');if(is_product_view&&$table.length&&$(window).width()<ResponsiveApp.sizes_bt('md')){var $view_products_btn=$(".view-products-helper");var $product_extra_info=$('section.product-extrainfo');const offset=100;$(window).scroll(function(){var table_end=$table.offset().top+$table.height()-offset;var extra_info_end=$product_extra_info.offset().top+$product_extra_info.height()-$(window).innerHeight()+offset;var scroll_top=$(window).scrollTop();if(scroll_top>table_end&&scroll_top<extra_info_end){$view_products_btn.slideDown();}else{$view_products_btn.slideUp();}});}}
307var address_cards_checkout_behaviour=function(){var SHIPPING_FORM_DATA=$('[name^=shipping-]').serialize();const $use_different_address_for_billing=$("#id_billing-use_different_address_for_billing");if($use_different_address_for_billing.prop("checked")){$(".billing_new_address").show();}
308$("#checkout_addresses_form [name=billing-use_different_address_for_billing]").click(function(){const $shipping_intra_vat_checkbox=$("#id_shipping-apply_intra_community_vat");const $billing_intra_vat_checkbox=$("#id_billing-apply_intra_community_vat");const $shipping_intra_vat_container=$shipping_intra_vat_checkbox.closest(".row");const $billing_intra_vat_container=$billing_intra_vat_checkbox.closest(".row");if($(this).prop("checked")){$billing_intra_vat_checkbox.prop("checked",$shipping_intra_vat_checkbox.is(":checked"));if(!$shipping_intra_vat_container.hasClass("d-none")){$billing_intra_vat_container.removeClass("d-none");$shipping_intra_vat_container.addClass("previously-visible");$shipping_intra_vat_container.addClass("d-none");}
309$(".billing_new_address").css('opacity',0).slideDown('slow').animate({opacity:1},{queue:false,duration:'slow'});}else{$shipping_intra_vat_checkbox.prop("checked",$billing_intra_vat_checkbox.is(":checked"));if($shipping_intra_vat_container.hasClass("previously-visible")){$shipping_intra_vat_container.removeClass("d-none");$shipping_intra_vat_container.removeClass("previously-visible");}
310$(".billing_new_address").css('opacity',1).slideUp('slow').animate({opacity:0}
310,{queue:false,duration:'slow'});}});$('.btn-pick-sending-address').click(()=>{$("#modal-address-picker").modal("show");});$(".address-data-btn").click(function(e){let $this=$(this);$(".address-data-btn").removeClass("active");$this.addClass("active");let address_json=$this.data("address-json");$("#modal-address-picker").modal("hide");$.each(address_json,(key,value)=>{let field=$(`[name='shipping-${key}']`);field.val(value);});AddressFunctions.change($('[name=shipping-country'),address_json.province,address_json.subzone);$("#save-address-container").addClass("d-none");SHIPPING_FORM_DATA=$('[name^=shipping-]').serialize();})
311$('[name^=shipping-]').not('[name=shipping-apply_intra_community_vat]').blur(function(e){let current_form_data=$('[name^=shipping-]').serialize();if(current_form_data!=SHIPPING_FORM_DATA){$("#save-address-container").removeClass("d-none");}else{$("#save-address-container").addClass("d-none");$("input[name='save_address']").prop("checked",false);}})}
312var cart_functions=function(){var subtotal_price=$("#cartview_subtotal_price");var total_price=$("#cartview_total_price");var shipping_cost=$("#cartview_shipping_cost");var quantity=$("#cartview_quantity");var quantity_icon=$(".cart-label");var gateway=$("#cartview_gateway");var total_discount=$("#cartview_discount");var total_discount_row=$("#total_discount_row");var discounts_container=$("#discounts_container");var errors_alerts=$("#cartview-errors");var quantity_buttons=$(".btn-number");var inputs_quantity=$("input[name=quantity]");var delete_buttons=$(".delete-sellable");function loadingData(){var loading_icon=gateway.data('loading-icon');gateway.empty().append($('<i/>',{'class':loading_icon}));gateway.prop('disabled',true);quantity_buttons.css('pointer-events','none');delete_buttons.css('pointer-events','none');inputs_quantity.prop('readonly',true);}
313function loadedData(trigger_events){var original_title=gateway.data('original-title');var quantity_val=quantity_icon.text();gateway.html(original_title);if(quantity_val!=0){gateway.prop('disabled',false);}
314quantity_buttons.css('pointer-events','auto');delete_buttons.css('pointer-events','auto');inputs_quantity.prop('readonly',false);var trigger_events_prevent=typeof trigger_events==typeof undefined||trigger_events;if(trigger_events_prevent){$("#change_shipping_zone_cart #btn_change_shipping_zone").trigger('click');}}
315function block_cart_products($cartview_item_actions){const $input_quantity=$cartview_item_actions.find('input[name$=quantity]');const $btn_number=$cartview_item_actions.find('.btn-number');$(".cartview-summary .quantity-group input[name$='quantity']").not($input_quantity[0]).prop('readonly',true);$(".cartview-summary .quantity-group .btn-number").not($btn_number).css('pointer-events','none');$(".cartview-summary .delete-sellable").css('pointer-events','none');$(".cartview-summary .service-option input[type=checkbox]").prop('disabled',true);}
316function unblock_cart_products(){$(".cartview-summary .quantity-group input[name='quantity']").prop('readonly',false);$(".cartview-summary .quantity-group .btn-number").css('pointer-events','auto');$(".cartview-summary .delete-sellable").css('pointer-events','auto');$(".cartview-summary .service-option input[type=checkbox]").prop('disabled',false);}
317function fill_data(data){subtotal_price.html(data.subtotal);total_price.html(data.total);quantity.html(data.quantity);quantity_icon.html(data.quantity);CommonFunctions.update_shipping_messages(data);total_discount.html('- '+data.discounts);if(typeof data.discounts==typeof null){total_discount_row.addClass('d-none');}else{total_discount_row.removeClass('d-none');}
318$('.cartview-summary').attr('data-has-voucher',data.has_voucher?'true':'false');discounts_container.find('.discount-row').remove();if(data.detailed_discounts){$.each(data.detailed_discounts,function(key,value){var cln_discount_row=discounts_container.find('.discount-row-example').clone();cln_discount_row.find('.discount-title').html(this.name);cln_discount_row.find('.discount-quantity').html('- '+this.amount);cln_discount_row.removeClass('discount-row-example d-none').addClass('discount-row');discounts_container.append(cln_discount_row);});}}
319gateway.on('click',function(){$('#checkout_gateway_form').submit();})
320$(".cartview-summary .remove-cart-line").click(function(){var article=$(this).parents('.cartview-item');var hr=article.prev('hr');loadingData();$.ajax({url:$(this).data('xhr-url'),type:'json',method:'GET',success:function(data){ot4.dispatch_event
320('cart_line_removed',{google_events:data['g'+'tag_events']||null});if(data.reload_page){location.reload();}
321if(data.status=='ok'){article.remove();hr.remove();fill_data(data);}
322loadedData();},error:function(data){loadedData();}})});let timeout_submit;function populate_services_input($cart_item){let additional_services=[];$cart_item.find('.service-option input:checked').each((index,element)=>{additional_services.push($(element).closest('.service-option').data('id'));});$cart_item.find('input[name$=service_options_json]').val(JSON.stringify(additional_services));}
323$(".cartview-summary .quantity-group input[name*='quantity'], .service-option input").change(function(){const $element=$(this);const $cartview_item_actions=$element.parents('.cartview-item-actions');populate_services_input($cartview_item_actions);clearTimeout(timeout_submit);block_cart_products($cartview_item_actions);timeout_submit=setTimeout(function(){$element.parents('form').submit();},1000);});$('.cartview-item-actions').each((index,element)=>{populate_services_input($(element));});function pre_update_cart_form(){loadingData();}
324function update_cart_form(form){return $.ajax({data:form.serialize(),url:form.attr('action'),method:form.attr('method')});}
325function update_cart_form_success(data,unblock_elements){if(data.reload_page){location.reload();}else if(data.status=='ok'){fill_data(data);errors_alerts.addClass('d-none');}
326if(unblock_elements){loadedData();unblock_cart_products();}}
327function update_cart_form_failed(xhrResponse){data=xhrResponse.responseJSON;if(data.status=='failed'){if(data.reload_page){location.reload();}else{errors_alerts.removeClass('d-none').find('.info').html(data.message);}}
328loadedData();unblock_cart_products();}
329$(".cartview-summary .update_cart_form").submit(function(e){e.preventDefault();var form=$(this);pre_update_cart_form();$.when(update_cart_form(form)).done(function(data){update_cart_form_success(data,true);set_cart_delayed_info(data)}).fail(function(xhrResponse){update_cart_form_failed(xhrResponse);});});$(".btn-as-link").click(function(e){e.preventDefault();if(!$(this).prop('disabled')){var href=$(this).data('href');if(typeof href!=typeof undefined){window.location.href=href;}}});$('.payment_method').on('click',function(){var element=$(this);element.find('input:radio').prop('checked',true).trigger('change');});$('.cartview-summary #add_voucher_form').on('submit',function(e){e.preventDefault();var form=$(this);var btn=form.find('button');try{btn.popover('dispose');}catch(error){}
330$.ajax({url:form.attr('action'),method:form.attr('method'),data:form.serialize(),success:function(data){if(data.status=='ok'){if(data.message){toastr.success(data.message);}
331if(data.reload_url){window.location.href=data.reload_url;}
332$(".cartview-summary .update_cart_form").first().trigger('submit');const code=form.find("input[name=voucher_code").val();$(".automatic-discount").find(`.btn-apply-voucher[data-code=${code}]`).html(`<i class="fa fa-check"></i> ${gettext("Aplicado")}`).removeClass("btn-dark").addClass("btn-success").attr("disabled","");}else if(data.status=='failed'){toastr.error(data.message);}},error:function(xhrResponse){data=xhrResponse.responseJSON;if(data.status=='failed'){var errors='';var last_item='';data.messages.forEach(function(item){if(item!=last_item){errors+=item+'<br>';last_item=item;}})
333toastr.error(errors);$(".cartview-summary .update_cart_form").first().trigger('submit');}},complete:function(){$('#add_voucher_collapse').trigger('click');}})});$("#remove_voucher_button").on('click',function(){var $this=$(this);$.ajax({url:this.getAttribute('data-xhr-url'),method:"POST",success:function(data){if(data.status=='ok'){$(".cartview-summary .update_cart_form").first().trigger('submit');toastr.success(data.message);$(".automatic-discount").find(".btn-apply-voucher").html(gettext("Aplicar")).removeClass("btn-success").addClass("btn-dark").removeAttr("disabled");}}});});$(".btn-apply-voucher").click(function(e){e.preventDefault();const $this=$(this);$.ajax({method:"POST",url:$("#add_voucher_form").attr("action"),data:{voucher_code:$this.data("c
333ode"),replace_current_voucher:true},headers:{"X-CSRFToken":ot4.get_cookie("csrftoken")},success:function(data){if(data.status=='ok'){if(data.message){toastr.success(data.message);}
334if(data.reload_url){window.location.href=data.reload_url;}
335$(".cartview-summary .update_cart_form").first().trigger('submit');$(".automatic-discount").find(".btn-apply-voucher").html(gettext("Aplicar")).removeClass("btn-success").addClass("btn-dark").removeAttr("disabled");$this.html(`<i class="fa fa-check"></i> ${gettext("Aplicado")}`).removeClass("btn-dark").addClass("btn-success").attr("disabled","");}else if(data.status=='failed'){toastr.error(data.message);}},error:function(xhrResponse){data=xhrResponse.responseJSON;if(data.status=='failed'){var errors='';var last_item='';data.messages.forEach(function(item){if(item!=last_item){errors+=item+'<br>';last_item=item;}})
336toastr.error(errors);}}});});$(".cart_pay_button").on('click',function(){var $this=$(this);if(!$("#accept_lopd").prop('checked')){$([document.documentElement,document.body]).animate({scrollTop:$("#accept_lopd").offset().top-75},500).promise().then(function(){var element=$this.data('trigger-element');var type_trigger=$this.data('trigger-type');if(typeof element!=typeof undefined&&typeof type_trigger!=typeof undefined){$(element).trigger(type_trigger);}});}});function update_delivery_method(){const $shipping_zone_form=$("#checkout_gateway_form");loadingData();$.ajax({type:'POST',url:$shipping_zone_form.data('xhr-update-shipping'),data:{cart_id:$shipping_zone_form.data('cart'),country_id:$shipping_zone_form.find("select[name=country]").val(),province_id:$shipping_zone_form.find("select[name=province]").val(),subzone_id:$shipping_zone_form.find("select[name=subzone]").val(),delivery_mode:$shipping_zone_form.find('input[name=delivery_mode]:checked').val()||'',pick_up_store:$shipping_zone_form.find('input[name=pick_up_store]:checked').val()||''},success:function(data){if(data.status=='ok'){$shipping_zone_form.find('input[name=shipping_zone]').val(data.shipping_zone);shipping_cost.html(data.shipping_cost);total_price.html(data.total);$shipping_zone_form.find("#change_shipping_zone_cart").collapse('hide');if(data.hide_store_pick_up_container){$(".delivery_mode_store_pick_up_container").addClass("d-none");}
337$(".estimated-delivery-message").html(data.estimated_delivery_message);CommonFunctions.update_shipping_messages(data);}
338if(data.reload_page){location.reload();}
339loadedData(false);},error:function(data){loadedData(false);}})}
340$('#btn_change_shipping_zone').on('click',function(){$('#gateway_collapse[aria-expanded=true]').trigger('click');})
341$("#checkout_gateway_form input[name=delivery_mode]").change(function(e){$("#cart_summary_delivery_mode_shipment_container").collapse('toggle');$("#cart_summary_delivery_mode_store_pick_up_container").collapse('toggle');shipping_zone_form=$("#checkout_gateway_form");switch(this.id){case"delivery_mode_shipment":shipping_zone_form.find('input[name=pick_up_store]').attr({"checked":false,"required":false});break;case"delivery_mode_store_pick_up":pick_up_radios=shipping_zone_form.find('input[name=pick_up_store]')
342shipping_zone_form.find('input[name=pick_up_store]').attr("required",true);shipping_zone_form.find('input[name=pick_up_store]:first').attr("checked",true);break;}
343update_delivery_method();});$("#change_shipping_zone_cart #btn_change_shipping_zone").click(function(){update_delivery_method();});$("#checkout_gateway_form input[name=pick_up_store]").change(function(){update_delivery_method();});$("#checkout_gateway_form").submit(function(e){e.preventDefault();const $this=$(this);const $form=$(".cartview-summary .update_cart_form");if(!FreeProductsFunctions.check_all_free_products_are_chosen($form)){return false;}
344pre_update_cart_form();$.when(update_cart_form($form)).done(function(data){if(data["reload_page"]==true){location.reload();}else{update_cart_form_success(data,false);$this.unbind('submit').submit();}}).fail(function(xhrResponse){update_cart_form_failed(xhrResponse);});});const must_check_restricted_promos=Boolean(ot4.authenticated&&$("#productview.check-data").length);if(ot4.get_cookie('cart')||ot4.authenticated||ot4.get_cookie('favorite_products')||ot4.get_cookie('ot_fbc')||must_check_restricted_promos){$.ajax({url:$('body').data('customer-data-xhr-url'),type:'json',data:{check_data:must_check_restricted_promos},method:'GET',success:function(data){if(data.status=='ok'){if(data.cart){quantity_icon.html(data.cart.quantity);}
345if(data.fav_products_id){ot4.favorites=data.fav_products_id;}
346ot4.dispatch_event('customer_data_loaded',{fb_events:data.fb_events||[],google_events:data['g'+'tag_events']||[],kla_user:data.kla_user||null,kla_events:data.kla_events||[]});if(data.automatic_discounts){const $discounts_container=$(".automatic-discounts");data.automatic_discounts.forEach((discount_html)=>{$discounts_container.append(discount_html);});}
347ot4.is_newsletter_subscriber=data.is_newsletter_subscriber;}},error:function(data){quantity_icon.html('0');},complete:function(data){init_wishlist_in_product_cards();}});}
348else{init_wishlist_in_product_cards();quantity_icon.html('0');}
349var $free_shipping_amount_left_explanation=$("#free_shipping_amount_left_explanation");$free_shipping_amount_left_explanation.popover({placement:"bottom",trigger:"focus",content:$free_shipping_amount_left_explanation.data("content")});function set_cart_delayed_info(data){if(data){informed_lines=[]
350cart_delivery_delayed_info=data.cart_delivery_delayed_info;if(!$.isEmptyObject(cart_delivery_delayed_info)){for(line_id in cart_delivery_delayed_info){informed_lines.push(line_id)
351let cartview=$(".cartview-item[data-line='"+line_id+"']");let delivery_delayed=cartview.find(".delivery_delayed");delivery_delayed.find("summary").text(cart_delivery_delayed_info[line_id]["short_info"]);delivery_delayed.find("span").html(cart_delivery_delayed_info[line_id]["large_info"]);delivery_delayed.removeClass("d-none");}
352$(".cartview-item").each(function(){if(informed_lines.indexOf(this.dataset.line)<0){$(this).find(".delivery_delayed").addClass("d-none");}});}else{$(".delivery_delayed").addClass("d-none");}}
353window.onpageshow=function(event){if(event.persisted){let $btn_cart_gateway=$("#cartview_gateway");$btn_cart_gateway.removeAttr("disabled");let button_original_title=$btn_cart_gateway.data("original-title");$btn_cart_gateway.html(button_original_title);}}}
354function calculate_delivery_delay(){let url=$(".update_cart_form").data("xhr-delivery-time");$.get(url).done(function(data){set_cart_delayed_info(data);});}
355if($(".update_cart_form").length){calculate_delivery_delay();}}
356var order_functions=function(){var total_price=$("#cartview_total_price");var commission_price=$("#cartview_commission_price");var unpaid_price=$("#cartview_unpaid_price");var gateway=$(".cartview_pay");function loadingData(){var loading_icon=gateway.data('loading-icon');gateway.empty().append($('<i/>',{'class':loading_icon}));gateway.prop('disabled',true);}
357function loadedData(){var original_title=gateway.data('original-title');gateway.html(original_title);gateway.prop('disabled',false);}
358$(".cartview-summary .cartview-list input[name='payment_method']").change(function(){var element=$(this);var url=element.parents('.cartview-list').data('xhr-url');if(url){loadingData();$.ajax({data:{payment_method_id:element.val()},url:url,method:'GET',success:function(data){if(data.status=='ok'){total_price.html(data.total);commission_price.html(data.commission);unpaid_price.html(data.unpaid);}
359loadedData();},error:function(data){loadedData();}});}});}
360var paypal_widget=function(){var sequra_widget=$(".sequra-promotion-widget");if(sequra_widget.length){$(".paypal-promotion-widget").addClass("d-none");}}
361var lightcase_init=function(){if($('a[data-rel^=lightcase]').length>0){$('a[data-rel^=lightcase]').lightcase({swipe:true,showCaption:false,maxHeight:1200,maxWidth:1200,type:'image',});}}
362var flex_boxes_functions=function(){var animation_flex_complete=true;function scroll_box($this){animation_flex_complete=false;var box_related=$this.closest('.row.position-relative').find('.box-flex');var item_width=box_related.find('.flex-item').first().outerWidth();var direction=$this.data('direction');var container_flex=box_related.find('.container-flex');var scroll_size=container_flex.scrollLeft()+item_width;if(direction=='left'){scroll_size=container_flex.scrollLeft()-item_width;}
363container_flex.animate({scrollLeft:scroll_size},{duration:500,complete:function(){animation_flex_complete=true;}});}
364$('body').on('click','.arrow-flex',function(e){e.preventDefault();if(animation_flex_complete){scroll_box($(this));}});var animation_thumbcarousel_complete=true;$("#thumbcarousel .arrow-thumb").on('click',function(e){var item_width=$("#thumbcarousel .image-thumb-sellable").first().outerWidth();item_width=CommonFunctions.roundUp(item_width,0)*2;var container_flex=$("#thumbcarousel .carousel-inner");var direction=$(this).data('direction');if(animation_thumbcarousel_complete){animation_thumbcarousel_complete=false;var scroll_size=container_flex.scrollLeft()+item_width;if(direction=='left'){scroll_size=container_flex.scrollLeft()-item_width;}
365container_flex.animate({scrollLeft:scroll_size},{duration:500,complete:function(){animation_thumbcarousel_complete=true;}});}});}
366var category_functions=function(){$('.filter .filter-list a').on('click',function(){var filters=$('.filter .filter-loader');filters.addClass('active');});$('#product_listing_get_filters_form').find(':input').filter(function(){return!$(this).attr('disabled');}).prop('disabled',false);$('#product_listing_get_filters_form').submit(function(){$(this).find(':input').filter(function(){return!this.value;}).attr('disabled','disabled');$('#product_listing_get_filters_form').find('input,select').filter(function(){return $(this).val()==$(this).data('default');}).attr('disabled','disabled');$('#product_listing_get_filters_form input[name^="min_"]').each(function(i,element){const $min_input=$(element);
366const $max_input=$('#product_listing_get_filters_form input[name="'+$min_input.attr("name").replace("min_","max_")+'"]');if($min_input.attr('disabled')&&!$max_input.attr('disabled')){$min_input.removeAttr('disabled');}else if($max_input.attr('disabled')&&!$min_input.attr('disabled')){$max_input.removeAttr('disabled');}});if(!$(this).serialize()){window.location=this.action.split('?')[0];return false;}
367return true;});$('#product_listing_get_filters_form select[name=order]').on('change',function(){$('#product_listing_get_filters_form').submit();});$('.order-filter-mobile span').on('click',function(){const $form=$('#product_listing_get_filters_form');$form.find('select[name=order]').val($(this).data("value"));$form.submit();});$('#product_listing_get_filters_form .getopt').on('click',function(){const $field=$('#product_listing_get_filters_form #'+$(this).data('field-id'));$field.val($field.val()?'':'1');$('#product_listing_get_filters_form').submit();});$('.fs-link').on('click',function(){window.location=atob($(this).data('url'));});window.onpageshow=function(event){if(event.persisted){$('.filter .filter-loader').hide();}}}
368var search_functions=function(){$('.search-form').submit(function(event){var form=$(this);var clean_q=form.find('input[name=q]').val().replace(/^\s+|\s+$| +(?= )/gm,'')
369form.find('input[name=q]').val(clean_q);$('<input />').attr('type','hidden').attr('name','u').attr('value',true).appendTo('.search-form');});}
370var trigger_elements=function(){$('body').on('click','[data-trigger-element]',function(){var element=$(this).data('trigger-element');var type_trigger=$(this).data('trigger-type')||'click';if(typeof element!=typeof undefined&&typeof type_trigger!=typeof undefined){$(element).trigger(type_trigger);}});}
371var lazy_video_functions=function(){$('.lazy-video-holder:not(.loaded)').on('click',function(){var height=$(this).height();var video_url=$(this).data('video');var iframe=$('<iframe>',{'src':video_url,'width':'100%','height':height,'allow':'accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share','referrerpolicy':'strict-origin-when-cross-origin','allowfullscreen':''});$(this).html(iframe).addClass('loaded');});}
372var customer_others_interested_in=function(){function ajax_others_interested_in(products_others_interested_in,element){if(!CommonFunctions.isEmptyObject(products_others_interested_in)){products_others_interested_in_promise=$.ajax({method:'POST',url:element.data('xhr-url'),data:{'products_others_interested_in':JSON.stringify(products_others_interested_in),'object_in_view_name':element.data('object-in-view-name')},success:function(html){if(html){element.removeClass('row');html=PriceVisibilityFunctions.check_products(html);element.html(html);CommonFunctions.initProductsInList();init_wishlist_in_product_cards();}else{element.addClass('d-none');}},error:function(jqXHR,textStatus,errorThrown){element.addClass('d-none');}});}else{element.addClass('d-none');}
373element.addClass('loaded')}
374$('.carousel-others-interested-in').on('inview',function(event,isInView){var element=$(this);var cartview=$('#cartview');var productview=$('#productview');var is_cartview=cartview.length>0;var is_productview=productview.length>0;var is_loaded=element.hasClass('loaded');if(isInView&&!is_loaded){var products_others_interested_in={};if(is_cartview){cartview.find('.cartview-list-items .cartview-item').each(function(){var product_id=$(this).data('product');var price=$(this).find('.selling-price-holder').text();if(product_id&&price){products_others_interested_in[product_id]=price;}});}else if(is_productview){var is_bundleview=productview.data('product-view-type')=='bundle';if(is_bundleview){productview.find('.bundle-products .product-in-list').each(function(){var product_id=$(this).data('product-id');var price=$(this).find('.current_price span:first-of-type').text();if(product_id&&price){products_others_interested_in[product_id]=price;}});}else{var product_id=productview.data('product-id');var price=productview.find('.price .current .js-money').first().clone();price=price.children().remove().end().text();if(!price){try{price=price.text();}catch(e){price=null;}}
375if(product_id&&price){products_others_interested_in[product_id]=price;}}}
376ajax_others_interested_in(products_others_interested_in,element);}});}
377var customer_product_history=function(){var PRODUCTS_HISTORY_LOCALSTORAGE_KEY='product_history';var PRODUCTS_HISTORY_LENGTH=-9;function update_and_return_product_history(product){var product_history=localStorage.getItem(PRODUCTS_HISTORY_LOCALSTORAGE_KEY);var product_history_updated=[];if(product_history){product_history=JSON.parse(product_history);for(let i=0;i<product_history.length;i++){var element=product_history[i];if(element['id']!=product['id']){product_history_updated.push(element);}}}
378product_history_updated.push(product);product_history_updated=product_history_updated.slice(PRODUCTS_HISTORY_LENGTH);localStorage.setItem(PRODUCTS_HISTORY_LOCALSTORAGE_KEY,JSON.stringify(product_history_updated));return JSON.stringify(product_history_updated);}
379function ajax_history_products(product_history_updated,element){product_history_promise=$.ajax({method:'POST',url:element.data('xhr-url'),data:{'product_history_data':product_history_updated,'product_in_view_name':element.data('product-in-view-name'),},success:function(html){element.removeClass('row');html=PriceVisibilityFunctions.check_products(html);element.html(html);CommonFunctions.initProductsInList();init_wishlist_in_product_cards();},error:function(jqXHR,textStatus,errorThrown){element.addClass('d-none');},});element.addClass('loaded');}
380if(CommonFunctions.hasLocalStorage()){$('.carousel-history-products').on('inview',function(event,
380isInView){var product_history_updated=update_and_return_product_history(PRODUCT_DATA);var element=$(this);var is_loaded=element.hasClass('loaded');if(isInView&&!is_loaded){$.when(products_others_interested_in_promise).done(function(){ajax_history_products(product_history_updated,element);}).fail(function(){ajax_history_products(product_history_updated,element);});}});}}
381var customer_may_interest_items=function(){if(CommonFunctions.hasLocalStorage()){var MAY_INTEREST_LOCALSTORAGE='products_may_interest';var MAY_INTEREST_PRODUCTS_LENGTH=10;var MAY_INTEREST_CATEGORIES_LENGTH=5;var MAY_INTEREST_BRANDS_LENGTH=5;var init_items={'products':[],'categories':[],'brands':[]}
382var may_interest_items=localStorage.getItem(MAY_INTEREST_LOCALSTORAGE)||JSON.stringify(init_items);may_interest_items=JSON.parse(may_interest_items);if(typeof PRODUCT_DATA!=typeof undefined){may_interest_items['products']=CommonFunctions.appendAndRotate(parseInt(PRODUCT_DATA['id']),may_interest_items['products'],MAY_INTEREST_PRODUCTS_LENGTH);}
383if(typeof CATEGORY_DATA!=typeof undefined){may_interest_items['categories']=CommonFunctions.appendAndRotate(parseInt(CATEGORY_DATA['id']),may_interest_items['categories'],MAY_INTEREST_CATEGORIES_LENGTH);}
384if(typeof BRAND_DATA!=typeof undefined){may_interest_items['brands']=CommonFunctions.appendAndRotate(parseInt(BRAND_DATA['id']),may_interest_items['brands'],MAY_INTEREST_BRANDS_LENGTH);}
385localStorage.setItem(MAY_INTEREST_LOCALSTORAGE,JSON.stringify(may_interest_items));function ajax_products_may_interest_you(products_may_interest_you,element){products_may_interest_you_promise=$.ajax({method:'POST',url:element.data('xhr-url'),data:{'products_may_interest_you':products_may_interest_you,'product_in_view_name':element.data('product-in-view-name')},success:function(html){if(html){element.removeClass('row');html=PriceVisibilityFunctions.check_products(html);element.html(html);CommonFunctions.initProductsInList();init_wishlist_in_product_cards();}else{element.addClass('d-none');}},error:function(jqXHR,textStatus,errorThrown){element.addClass('d-none');}});element.addClass('loaded');}
386$('.carousel-products-may-interest').on('inview',function(event,isInView){var element=$(this);var products_may_interest_you=localStorage.getItem(MAY_INTEREST_LOCALSTORAGE);var is_loaded=element.hasClass('loaded');if(isInView&&!is_loaded){$.when(products_others_interested_in_promise,product_history_promise).done(function(){ajax_products_may_interest_you(products_may_interest_you,element);}).fail(function(){ajax_products_may_interest_you(products_may_interest_you,element);});}});}}
387var subscriber_newsletter_functions=function(){const display_subscription_popup=$('body').data('display-subscription-popup-form')
388const $newsletter_subscription_popup=$('#newsletter_subscription_popup')
389const max_delay_time=10000
390const max_percentage_scrolled=60
391const max_days=1
392function get_popup_has_been_displayed(){let has_been_displayed=false
393let subscription_popup_last_date=localStorageDisplaySettings.get('subscription_popup_last_date')
394if(subscription_popup_last_date){let last_date=Date.parse(subscription_popup_last_date)
395let now=new Date()
396const difference_days=Math.abs(now-last_date)/(1000*60*60*24)
397has_been_displayed=difference_days<max_days}
398return has_been_displayed}
399let popup_has_been_displayed=get_popup_has_been_displayed()
400function set_popup_newsletter_last_date(){let subscription_popup_last_date=localStorageDisplaySettings.get('subscription_popup_last_date')
401if(subscription_popup_last_date){let last_date=Date.parse(subscription_popup_last_date)
402let now=new Date()
403const difference_days=Math.abs(now-last_date)/(1000*60*60*24)
404if(difference_days>=max_days){localStorageDisplaySettings.set('subscription_popup_last_date',now)}}else{localStorageDisplaySettings.set('subscription_popup_last_date',new Date())}}
405if(display_subscription_popup&&$newsletter_subscription_popup.length){if(!ot4.is_newsletter_subscriber){const accepted_legal_conditions=!$('#legal_conditions_popup').length||localStorageDisplaySettings.get('accepted_legal_conditions');function show_popup(){if(!popup_has_been_displayed){if(!accepted_legal_conditions){setTimeout(show_popup,max_delay_time);}else{$newsletter_subscription_popup.modal('show')}}}
406setTimeout(show_popup,max_delay_time);$(window).on('scroll',function(){const scroll_top=window.scrollY||document.documentElement.scrollTop;const window_height=window.innerHeight;const document_height=document.documentElement.scrollHeight;const scrolled_percentage=(scroll_top+window_height)/document_height*100;if(scrolled_percentage>max_percentage_scrolled&&!popup_has_been_displayed&&accepted_legal_conditions){$newsletter_subscription_popup.modal('show')}})}
407$newsletter_subscription_popup.on('show.bs.modal',function(){set_popup_newsletter_last_date()
408popup_has_been_displayed=true
409let $newsletter_form=$('#newsletter_form').clone()
410$newsletter_form.attr('id','newsletter_form_popup')
411$newsletter_form.find('input#id_origin').val('subscription_popup')
412$newsletter_form.find('input#id_conditions').attr('id','id_conditions_popup')
413$newsletter_form.find('label[for="id_conditions"]').attr('for','id_conditions_popup')
414$newsletter_form.find('.submit-location').addClass('d-none')
415$newsletter_form.find('a[data-collapse-custom="#_help_text"]').data('collapse-custom','#_help_text_popup')
416$newsletter_form.find('#_help_text').attr('id','_help_text_popup')
417$newsletter_subscription_popup.find('.fill-form').append($newsletter_form)})
418$newsletter_subscription_popup.find('.popup-form-submit').on('click',function(){if(!$newsletter_subscription_popup.find('form')[0].checkValidity()){$newsletter_subscription_popup.find('form')[0].reportValidity()}else{$(this).prop('disabled',true);$newsletter_subscription_popup.find('#newsletter_form_popup').trigger('submit')}})}
419$('body').on('focusin','#newsletter_form input[name="email"], #newsletter_form_popup input[name="email"]',function(e){LazyRecaptcha.include_script();});$('body').on('submit','#newsletter_form, #newsletter_form_popup',function(e){e.preventDefault();const $form=$(this);const $submit_button=$form.find('button[type=submit]');const form_id=$form.attr('id');const manage_form=()=>{$submit_button.prop('disabled',true);ot4.load_form_csrf($form,()=>{$.ajax({method:$form.attr('method'),url:$form.attr('action'),data:$form.serialize(),success:function(data){$form.trigger("reset");ot4.reset_form_errors(form_id);if($newsletter_subscription_popup.length){$newsletter_subscription_popup.modal('hide')}
420$("#modal_newsletter_email_sent").modal();},error:function(xhr){ot4.handle_form_errors(form_id,xhr.responseText);},complete:function(){$submit_button.prop('disabled',false);}});});}
421if(LazyRecaptcha.is_recaptcha_enabled()){LazyRecaptcha.onScriptLoad(function(){gre
421captcha.ready(function(){grecaptcha.execute(LazyRecaptcha.get_recaptcha_key(),{action:'newsletter_form'}).then(function(token){$form.find('#id_g_recaptcha_response').val(token);manage_form();});});})}else{manage_form();}});}
422var navbar_check_active_element=function(){var header_nav_items=$("header #navbar-header-group > nav.navbar");var section_nav_items=$('section[data-nav-item]');if(section_nav_items.length<1){return;}
423section_nav_items=section_nav_items.first().data('nav-item').split(' ');section_nav_items.forEach(function(section){header_nav_items.find('[data-nav-item="'+section+'"]').addClass('active');});}
424var classification_drilldown=function(){$('#classification_search_box').each(function(){var $box=$(this);var $hidden=$('input[name="model"]');var $button=$box.find('button');function load_level(level){$level=$(level);$level.nextAll('.classification-level').addBack().find('select option:not([value=""])').remove();var level_values='';$box.find('.classification-level select').each(function(){var value=$(this).val();if(!value){return false;}
425level_values+=value+'/';});$.ajax({url:$box.data('drilldown-url')+level_values,type:'GET',success:function(data){if(data.model){$hidden.val(data.model);}
426else{fill_level($level,null,data.values);}}});}
427function fill_level($level,selected_value_id,level_values){var $select=$level.find('select');for(var i=0;i<level_values.length;i++){var value=level_values[i];$select.append($('<option>').attr('value',value.id).text(value.value).prop('selected',value.id==selected_value_id));}}
428$box.on('change','select',function(){var $level=$(this).parents('.classification-level');load_level($level.next('.classification-level'));});var data=$box.data('values');if(data){var $level=$box.find('.classification-level').first();for(var i=0;i<data.length;i++){fill_level($level,data[i][0],data[i][1])
429$level=$level.next('.classification-level');}}});window.onpageshow=function(event){if(event.persisted){let $btn_search_attribute=$("#search_attribute");$btn_search_attribute.removeAttr("disabled");}}}
430function unsupported_currency_info(){$('.unsupported-currency-info').popover({html:true,sanitize:false});}
431var contact_form_functions=function(){if($('#contact_form').length){LazyRecaptcha.include_script();}
432$("#contact_form #id_subject").change(function(){let $this=$(this);const non_required_value=$this.data('non-required-value');let $order_num=$("#contact_form #id_order_num");let label=$("label[for='id_order_num']")[0];if(!$this.val()||$this.val()==non_required_value){$order_num.prop('required',false);label.innerText=label.innerText.replace(" *","");}else{if(!$order_num.prop('required')){label.innerText=label.innerText+" *";}
433$order_num.prop('required',true);}});$("#contact_form #id_subject").trigger('change');$('#contact_form input[type="submit"]').on("click",(e)=>{e.preventDefault();let form=$("#contact_form")
434ot4.load_form_csrf(form,()=>{if(!form.get(0).checkValidity()){form.get(0).reportValidity()}else{form.trigger("submit")}})});$("#contact_form").on('click','#add_attachment',function(){let main_input_attachment=$('input#id_attachments')
435const max_files=parseInt(main_input_attachment.data('max-files'))
436let attachment_inputs=$('input[name=attachments]')
437if(attachment_inputs.length==max_files){toastr.error(interpolate(gettext("El número máximo de ficheros adjuntos es %(max_files)s"),{max_files:max_files},true))
438return}
439attachment_inputs.last().after(main_input_attachment.clone().prop('id',`clone_${attachment_inputs.length}`).val(''))});$("#contact_form").on('change','input[name=attachments]',function(){let $this=$(this)
440let main_input_attachment=$('input#id_attachments')
441const max_size=parseInt(main_input_attachment.data('max-size'))
442if($this.get(0).files[0].size>max_size){toastr.error(interpolate(gettext("File %(file_name)s is larger than %(max_size)s"),{file_name:$this.get(0).files[0].name,max_size:`${max_size / 1024 / 1024}Mb`},true))
443$this.val('')
444return}});$("#contact_form").on('submit',function(e){e.preventDefault();const form=$(this);if(LazyRecaptcha.is_recaptcha_enabled()){LazyRecaptcha.onScriptLoad(function(){gre
444captcha.ready(function(){grecaptcha.execute(LazyRecaptcha.get_recaptcha_key(),{action:'contactform'}).then(function(token){form.find('#id_g_recaptcha_response').val(token);form[0].submit();});});});}else{form[0].submit();}});}
445var right_of_withdrawal_form_functions=function(){if($('#right_of_withdrawal_form').length){LazyRecaptcha.include_script();}
446$("#right_of_withdrawal_form").on('change','input[name=withdrawal_scope]',function(){const $textarea=$('textarea[name=products_description]');if($(this).val()=='partial'){$textarea.closest('.row').show();$textarea.prop('required',true);}else{$textarea.closest('.row').hide();$textarea.prop('required',false);}});$("#right_of_withdrawal_form").on('submit',function(e){e.preventDefault();const form=$(this);if(LazyRecaptcha.is_recaptcha_enabled()){LazyRecaptcha.onScriptLoad(function(){grecaptcha.ready(function(){grecaptcha.execute(LazyRecaptcha.get_recaptcha_key(),{action:'rightofwithdrawalform'}).then(function(token){form.find('#id_g_recaptcha_response').val(token);form[0].submit();});});});}else{form[0].submit();}});}
447var user_forms_functions=function(){const form_ids=["user_login_form","pwd_reset_form","join_form"];form_ids.forEach(form_id=>{const $form=$(`#${form_id}`);if($form.length){LazyRecaptcha.include_script();$form.on('submit',function(e){e.preventDefault();const form=$(this);if(LazyRecaptcha.is_recaptcha_enabled()){LazyRecaptcha.onScriptLoad(function(){grecaptcha.ready(function(){grecaptcha.execute(LazyRecaptcha.get_recaptcha_key(),{action:'passwordresetform'}).then(function(token){form.find('#id_g_recaptcha_response').val(token);form[0].submit();});});});}else{form[0].submit();}});}});}
448var customer_data_functions=function(){const $customer_type_input=$('#id_customer_type, #my_data_customer_type');const company_options_list=$customer_type_input.data("company-options");if(company_options_list){const $company_cif_form_group=$('#id_company_cif, #my_data_company_cif').closest('.form-group');const $company_name_form_group=$('#id_company_name, #my_data_company_name').closest('.form-group');let customer_type_input_value=$customer_type_input.val();if(customer_type_input_value!=""&&company_options_list.includes(customer_type_input_value)){$company_cif_form_group.removeClass("d-none");$company_name_form_group.removeClass("d-none");}else{$company_cif_form_group.addClass("d-none");$company_name_form_group.addClass("d-none");}
449$customer_type_input.on('change',function(){let value=$(this).val();if(value!=""&&company_options_list.includes(value)){$company_cif_form_group.removeClass("d-none");$company_name_form_group.removeClass("d-none");}else{$company_cif_form_group.addClass("d-none");$company_name_form_group.addClass("d-none");}})}}
450var address_form_functions=function(){$("#checkout_gateway_form select[name=country]").change(function(){AddressFunctions.manage_country_change($(this));});$("#address_form_modal").on("change","#address_form select[name*=country]",function(){AddressFunctions.manage_country_change($(this));});$("#checkout_gateway_form select[name=province]").change(function(){AddressFunctions.manage_province_change($(this));});$("#address_form_modal").on("change","#address_form select[name*=province]",function(){AddressFunctions.manage_province_change($(this));});$('#checkout_addresses_form').on("change","input[name*=postal_code]",function(){AddressFunctions.manage_postal_code_change($(this));});}
451var authentication_buttons=function(){if(ot4.authenticated){var $link=$('#user_session_link');$link.attr('href',$link.data('logout-url'));$link.find('span').html($link.data('logout-text'));$link.find('.fa').removeClass('fa-sign-in').addClass('fa-sign-out');}
452$('#user_session_link').on('click',function(e){const url=$(this).attr('href');if(ot4.authenticated&&url!='#'){e.preventDefault();var $form=$('<form>',{method:'POST',action:url});var csrfToken=ot4.get_cookie('csrftoken');if(csrfToken){$form.append($('<input>',{type:'hidden',name:'csrfmiddlewaretoken',value:csrfToken}));}
453$(this).after($form);$form.trigger('submit');}});var $login_message=$('#login_message');if(ot4.authenticated){$login_message.text($login_message.data('authenticated-text'));}
454var $dashboard_icon=$('.user-dashboard-icon').on('click',function(){location.href=$(this).data('url');});var title_key;if(!ot4.authenticated){title_key='anonymous';}
455else if(ot4.can_enter_dashboard){title_key='ced';}
456else{title_key='customer';}
457$dashboard_icon.attr('title',$dashboard_icon.data(title_key+'-title'));if(ot4.can_enter_dashboard){$('#unpublished_products_warning').removeClass('d-none');}}
458var dashboard_overlay=function(){var url=$(document.body).data('dashboard-overlay-xhr');$.ajax({url:url,success:function(content){var $container=$('<div>').html(content);$container.find('[data-overlay-target]').each(function(){var $element=$(this);var id=$element.data('overlay-target');$element.removeAttr('data-overlay-target');$('#'+id).append($element);});ot4.init_admin_toolbar();}})}
459var customer_dashboard=function(){var quantity_icon=$(".cart-label");$(".repeat-order-line").click(function(){ot4.ajax({url:$(this).data('xhr-url'),method:'POST',data:{pk:this.dataset.orderLine},success:function(data){if(data.quantity_cart){quantity_icon.text(data.quantity_cart)}},})});$(".repeat-full-order").click(function(e){e.preventDefault();var quantity_icon=$(".cart-label");ot4.ajax({url:$(this).data('xhr-url'),method:'POST',data:{pk:this.dataset.order},success:function(data){if(data.quantity_cart){quantity_icon.text(data.quantity_cart)}},})});}
460var initialize_transparent_header=function(){const $header=$('header');const is_desktop=$(window).width()>ResponsiveApp.sizes_bt('lg')
461if($header.hasClass("transparent-header-container")){const scrollOffsetToChange=1
462const $form=$header.find("form.search-form");const $nav_toggler=$header.find("button.navbar-toggler");const make_solid=()=>$header.removeClass("transparent-header");const make_transparent=()=>$header.addClass("transparent-header");$(".transparent-header-container").on("mouseenter",function(e){if($(window).scrollTop()<scrollOffsetToChange){make_solid();}});$(".transparent-header-container").on("mouseleave",function(e){if($(window).scrollTop()<scrollOffsetToChange){make_transparent
462();}});$(window).scroll(function(e){let position=$(window).scrollTop();let is_fixed_menu=false;if(is_desktop){is_fixed_menu=$("body").data("menu-is-fixed-desktop")==true;}
463else{is_fixed_menu=$("body").data("menu-is-fixed-mobile")==true;}
464if(is_fixed_menu){if(position>scrollOffsetToChange&&$header.hasClass("transparent-header")){make_solid();$header.addClass("transparent-header-sticky");}else if(position<scrollOffsetToChange&&!$header.hasClass("transparent-header")){make_transparent();$header.removeClass("transparent-header-sticky");}}})
465$nav_toggler.on("click",function(e){const is_search_form_expanded=$form.hasClass("showing");const is_sticky=$header.hasClass("transparent-header-sticky");setTimeout(()=>{const is_menu_expanded=$nav_toggler.attr("aria-expanded")=="true";if(is_menu_expanded||is_search_form_expanded){make_solid();}else{if(!is_sticky){make_transparent();}}},50)});$header.find("button[aria-label='Buscar']").on("click",function(){const is_menu_expanded=$nav_toggler.attr("aria-expanded")=="true";const is_search_form_expanded=$form.hasClass("showing");const is_sticky=$header.hasClass("transparent-header-sticky");setTimeout(()=>{if(is_search_form_expanded||is_menu_expanded){make_solid()}else{if(!is_sticky){make_transparent()}}},100);});}}
466var m2_calc_functions=function(){$(".product-view input.m2-calc").keyup(function(){const $this=$(this);const $qty_input=$this.parents("form").find("input[name^=quantity]");const qty_per_unit=$this.data("unit-pricing-measure");$qty_input.val(Math.ceil($this.val()/qty_per_unit));});$(".product-view input[name^=quantity]").change(function(){const $this=$(this);const $m2_input=$this.parents("form").find("input.m2-calc");const qty_per_unit=$m2_input.data("unit-pricing-measure");$m2_input.val(ot4.truncate_decimals($this.val()*qty_per_unit,2));});$(".product-view input[name^=quantity]").trigger("change");}
467var cookies_policy_functions=function(){$(".cookies-policy #cookiebar_fully_accept_btn").click(function(){Cookiebar.set_user_conf_accept_reject_all(true);window.location=atob($(".cookies-policy").data('url'));});$(".cookies-policy .btn-cookiebar-reject-all").click(function(e){e.preventDefault();Cookiebar.set_user_conf_accept_reject_all(false);window.location=atob($(".cookies-policy").data('url'));});$(".cookies-policy .cookiebar-set-prefs-btn").click(function(){const $cookiebar_holder=$("#cookiebar_holder");Cookiebar.$cookiebar_modal.data("redirect",atob($(".cookies-policy").data('url')));$.get($cookiebar_holder.data('xhr-url'),function(html){const $form=$("#cookiebar_user_conf");let user_conf=Cookiebar.get_user_conf();$form.html(html);if(user_conf&&user_conf[Cookiebar.ANALYTIC]){$form.find('input[name="'+Cookiebar.ANALYTIC+'"]').attr("checked","checked");}
468if(user_conf&&user_conf[Cookiebar.MARKETING]){$form.find('input[name="'+Cookiebar.MARKETING+'"]').attr("checked","checked");}
469Cookiebar.$cookiebar_modal.modal();});});}
470var init_legal_conditions_popup=function(){const $legal_conditions_popup=$('#legal_conditions_popup');if($legal_conditions_popup.length){const decline_url=atob($legal_conditions_popup.data('decline-url'));$('.legal-conditions-popup-accept-btn').click(function(){localStorageDisplaySettings.set('accepted_legal_conditions',true);$legal_conditions_popup.modal('hide');});$('.legal-conditions-popup-decline-btn').click(function(){window.location=decline_url;});$legal_conditions_popup.on('show.bs.modal hidden.bs.modal',function(){$('body').toggleClass('legal-conditions-popup');});if(!window.location.href.startsWith(decline_url)&&!localStorageDisplaySettings.get('accepted_legal_conditions')){$legal_conditions_popup.modal('show');}}}
471return{isEmptyObject:function(obj){return Object.keys(obj).length===0;},initProductsInList:function(){new LazyLoad({elements_selector:".lazy"});var countdown_element='.flash-countdown';if($(countdown_element).length>0){CommonFunctions.flash_countdown(countdown_element);setInterval(function(){CommonFunctions.flash_countdown(countdown_element);},1000);}},appendAndRotate:function(item,list,max_length){if($.inArray(item,list)==-1){if(list.length==max_length){list.shift();}
472list.push(item);}
473return list;},hasLocalStorage:function(){try{localStorage.setItem('mod','mod');localStorage.removeItem('mod');return true;}catch(exception){return false;}},getLocalStorage:function(lsname){try{return localStorage.getItem(lsname);}catch(e){return CommonFunctions.getCookie(lsname);}},getCookie:function(cname){var name=cname+"=";var decodedCookie=decodeURIComponent(document.cookie);var ca=decodedCookie.split(';');for(var i=0;i<ca.length;i++){var c=ca[i];while(c.charAt(0)==' '){c=c.substring(1);}
474if(c.indexOf(name)==0){return c.substring(name.length,c.length);}}
475return null;},roundUp:function(num,precision){precision=Math.pow(10,precision);return Math.ceil(num*precision)/precision;},getTimeRemaining:function(startTime,endTime){function str2date(str){var parts=str.split("/");var e_day=parseInt(parts[0]);var e_month=parseInt(parts[1])-1;var e_year=parseInt(parts[2]);return new Date(e_year,e_month,e_day);}
476var starttime_date=str2date(startTime);starttime_date.setHours(0,0,0);var endtime_date=str2date(endTime);endtime_date.setHours(23,59,59);var today=new Date();var t=Date.parse(endtime_date)-Date.parse(today);var seconds=Math.floor((t/1000)%60);var minutes=Math.floor((t/1000/60)%60);var hours=Math.floor((t/(1000*60*60))%24);var days=Math.floor(t/(1000*60*60*24));if(hours<10){hours="0"+hours;}
477if(minutes<10){minutes="0"+minutes;}
478if(seconds<10){seconds="0"+seconds;}
479return{'total':t,'days':days,'hours':hours,'minutes':minutes,'seconds':seconds,'has_started':Date.parse(starttime_date)<=Date.parse(today),'is_expired':t<=0};},flash_countdown:function(countdown_element){$(countdown_element).each(function(){var $this=$(this);var flash_time_from=$this.data('flash-time-from');var flash_time_until=$this.data('flash-time-until');var countdown=CommonFunctions.getTimeRemaining(flash_time_from,flash_time_until);var html='';if(countdown.has_started&&!countdown.is_expired){$this.parents('.flash-offer-horizontal').removeClass('d-none');$this.parents('.product-in-list').find('.label-flash-offer').removeClass('d-none');$this.parents('.flash-container').removeClass('d-none');$this.parents('.carousel').find('.is-flash-offer, .flash-offer-discount, .is-black-friday-flash, .black-friday-discount').removeClass('d-none');if(countdown.days>0){html=countdown.days+' '+ngettext('día','días',countdown.days)+' '+countdown.hours+':'+countdown.minutes+':'+countdown.seconds;}else{html=countdown.hours+':'+countdown.minutes+':'+countdown.seconds;}
480$this.html(html);}else if(countdown.is_expired){$this.parents('.flash-offer-horizontal').remove();$this.parents('.product-in-list').find('.label-flash-offer').remove();$this.parents('.carousel').find('.is-flash-offer, .flash-offer-discount, .is-black-friday-flash, .black-friday-discount').remove();$this.parents('.flash-container').remove();$this.parents('.product-in-list').find('.is-flash').remove();}else{$this.parents('.flash-offer-horizontal').addClass('d-none');$this.parents('.product-in-list').find('.label-flash-offer').addClass('d-none');$this.parents('.carousel').find('.is-flash-offer, .flash-offer-discount, .is-black-friday-flash, .black-friday-discount').addClass('d-none');$this.parents('.flash-container').addClass('d-none');$this.parents('.product-in-list').find('.is-flash').remove();}});},update_shipping_messages:function(data){var $shipping_cost=$("#cartview_shipping_cost");var $free_shipping_row=$("#shipping_cost_free");var $extra_fee_row=$("#shipping_cost_extra_fee");var has_cart_lines=$('.cartview-list-items .cartview-item').length>0;if(data.free_shipping&&has_cart_lines){$shipping_cost.html(data.empty_money);$free_shipping_row.removeClass('d-none');$(".quantity-discount-free-shipping").addClass("d-none");if(data.shipping_cost!=data.empty_money){$("#shipping_cost_extra_fee_amount").html(data.shipping_cost);$extra_fee_row.removeClass("d-none");}else{$("#shipping_cost_extra_fee_amount").html(data.empty_money);$extra_fee_row.addClass("d-none");}}
481else{$shipping_cost.html(data.shipping_cost);$free_shipping_row.addClass('d-none');$(".quantity-discount-free-shipping").removeClass("d-none");$extra_fee_row.addClass("d-none");}
482var free_shipping_amount_left_label=$("#shipping_cost_amount_left");if(data.free_shipping_amount_left.is_visible&&$free_shipping_row.hasClass('d-none')){free_shipping_amount_left_label.find('.text-shipping-amount').html(data.free_shipping_amount_left.text);free_shipping_amount_left_label.removeClass('d-none');}
483else{free_shipping_amount_left_label.addClass('d-none');}
484$(".stackable-product-notice").each(function(){var line_id=parseInt($(this).closest("[data-line]").data("line"));$(this).toggleClass("d-none",(data.shipping_cost==data.empty_money||data.lines_with_free_shipping.includes(line_id)));});$("[data-line='"+ +"']")},is_menu_fixed:function(){return{'mobile':$('body[data-menu-is-fixed-mobile="true"]').length>0,'desktop':$('body[data-menu-is-fixed-desktop="true"]').length>0}},diff_in_days:function(start_date,end_date){var _start_date=new Date(start_date);var _end_date=new Date(end_date);_start_date.setHours(0,0,0,0);_end_date.setHours(0,0,0,0);var diff_time=Math.abs(_end_date-_start_date);return Math.ceil(diff_time/(1000*60*60*24));},naturalday:function(date,locale){var today=new Date();var delta=CommonFunctions.diff_in_days(today,date);if(delta==0){return gettext('hoy');}else if(delta==1){return gettext('mañana');}
485var options={weekday:"long",month:"short",day:"numeric"};try{return date.toLocaleDateString(locale,options);}catch(e){return date.toLocaleDateString("es-ES",options);}},CUSTOMER_ORIGIN_CHOICES:{NOT_DEFINED:'not_defined',SEM:'sem',ORGANIC:'organic',PROMOTION:'promotion',SOCIAL_NETWORKS:'social_networks',SEESTOCKS_WEB:"seestocks_web"},save_referer_customer_origin:function(){var EXPIRE_DAYS=1;var SEM=CommonFunctions.CUSTOMER_ORIGIN_CHOICES['SEM'];var ORGANIC=CommonFunctions.CUSTOMER_ORIGIN_CHOICES['ORGANIC'];var PROMOTION=CommonFunctions.CUSTOMER_ORIGIN_CHOICES['PROMOTION'];var SOCIAL_NETWORKS=CommonFunctions.CUSTOMER_ORIGIN_CHOICES['SOCIAL_NETWORKS'];var SEESTOCKS_WEB=CommonFunctions.CUSTOMER_ORIGIN_CHOICES['SEESTOCKS_WEB'];var referer=ORGANIC;var promotion='';var search_location=window.location.search;var url_location=new URL(window.location.toString());if(search_location.indexOf('gclid=')!==-1){referer=SEM;}
486else if(search_location.indexOf('promos')!==-1){referer=PROMOTION;promotion=url_location.searchParams.get('pid');}
487else if(url_location.searchParams.get('utm_source')==='seestocks'){referer=SEESTOCKS_WEB;}
488else if(document.referrer){var referrer_domain=document.referrer;var pos=referrer_domain.indexOf("://");if(pos!=-1){referrer_domain=referrer_domain.substr(pos+3);}
489pos=referrer_domain.indexOf("/");if(pos!=-1){referrer_domain=referrer_domain.substr(0,pos);}
490var social_network_patterns=[/facebook/,/instagram/,/twitter/,/^t\.co$/];if(/seestocks/.test(referrer_domain)){referer=SEESTOCKS_WEB;}
491for(var i=0;i<social_network_patterns.length;i++){if(social_network_patterns[i].test(referrer_domain)){referer=SOCIAL_NETWORKS;}}}
492try{var ls_customer_origin=localStorage.getItem('customer_origin');var ls_customer_origin_date=localStorage.getItem('customer_origin_date');var today=new Date();var first_day=new Date(ls_customer_origin_date);first_day.setDate(first_day.getDate()+EXPIRE_DAYS);if(ls_customer_origin==null||first_day<today){localStorage.setItem('customer_origin',referer);localStorage.setItem('customer_origin_date',today);if(promotion){localStorage.setItem('customer_origin_promotion',promotion);}}}catch(e){localStorage.setItem('customer_origin',referer);localStorage.setItem('customer_origin_date',today);if(promotion){localStorage.setItem('customer_origin_promotion',promotion);}}
493var ls_anon_customer=localStorage.getItem('anon_customer');if(ls_anon_customer==null){localStorage.setItem('anon_customer',true);}
494var user_cookie_conf=Cookiebar.get_user_conf();if(user_cookie_conf&&user_cookie_conf[Cookiebar.ANALYTIC]){localStorage.setItem('anon_customer',false);}
495function set_customer_origin(){var CUSTOMER_ORIGIN_INPUT=$('input#customer_origin');var CUSTOMER_PROMOTION_INPUT=$('input#customer_promotion');var ANON_CUSTOMER_INPUT=$('input#anon_customer');if(CUSTOMER_ORIGIN_INPUT.length>0){var customer_origin=CommonFunctions.getLocalStorage('customer_origin')||CommonFunctions.CUSTOMER_ORIGIN_CHOICES['NOT_DEFINED'];var customer_promotion=CommonFunctions.getLocalStorage('customer_origin_promotion');var anon_customer=CommonFunctions.getLocalStorage('anon_customer');if(customer_origin!==null){CUSTOMER_ORIGIN_INPUT.val(customer_origin);}
496if(customer_promotion!==null){CUSTOMER_PROMOTION_INPUT.val(customer_promotion);}
497if(anon_customer!==null){ANON_CUSTOMER_INPUT.val(anon_customer);}}}
498set_customer_origin();},init_select2:function(){$(".select2-normal").each(function(){var element=$(this);var allow_clear=element.data('select2-allowclear');element.select2({language:'es',width:'100%',escapeMarkup:function(markup){return markup;},allowClear:allow_clear||false,placeholder:element.data('select2-placeholder')||'Selecciona una opción',closeOnSelect:element.data('select2-close-on-select')||false});});},init:function(){header_search_toggler();header_shipping_country_selector();header_navbar_dropdown();
498header_fixed_on_scroll();lazyload_bg();popover_init();second_img_hover();collapsed_with_bt_classes();smooth_anchor();quantity_input();carousel_init();collapsed_lists();toggle_filter();product_availailability_alert_functions();review_functions();question_functions();product_functions();product_extrainfo_toggle_content();product_estimated_delivery_date_fn();bundle_functions();add_to_cart_btn_behaviour();view_products_btn_behaviour();address_cards_checkout_behaviour();cart_functions();lightcase_init();order_functions();flex_boxes_functions();category_functions();search_functions();trigger_elements();lazy_video_functions();subscriber_newsletter_functions();navbar_check_active_element();classification_drilldown();unsupported_currency_info();contact_form_functions();right_of_withdrawal_form_functions();user_forms_functions();authentication_buttons();customer_dashboard();initialize_transparent_header();set_search_input_value_from_querystring();paypal_widget();customer_data_functions();address_form_functions();m2_calc_functions();cookies_policy_functions();init_legal_conditions_popup();CommonFunctions.save_referer_customer_origin();CommonFunctions.init_select2();if(ot4.can_enter_dashboard){dashboard_overlay();}
499customer_others_interested_in();customer_product_history();customer_may_interest_items();var countdown_element='.flash-countdown';if($(countdown_element).length>0){CommonFunctions.flash_countdown(countdown_element);setInterval(function(){CommonFunctions.flash_countdown(countdown_element);},1000);}
500var myLazyLoad=new LazyLoad({elements_selector:".lazy"});$("form[data-prevent-double-submission]").preventDoubleSubmission();$('[data-toggle="tooltip"]').tooltip();$('[data-toggle="popover"]').popover();$('.popover-dismiss').popover({trigger:'focus'});}};}();$(document).ready(function(){localStorageDisplaySettings.init();CommonFunctions.init();PriceVisibilityFunctions.init();relatedAndSimilarProductsFunctions.init();});;var Cookiebar=function(){const ESSENTIAL='essential';const MARKETING='marketing';const ANALYTIC='analytic';let default_conf={};default_conf[ESSENTIAL]=true;default_conf[ANALYTIC]=false;default_conf[MARKETING]=false;function save_user_conf(conf){localStorage.setItem(cookieStorageKey,JSON.stringify(conf));}
501function set_opentiendas_user_conf(client_conf){function remove_cookies_or_localstorage(items){ANALYTIC_CHOICES=["customer_origin","customer_origin_date","customer_origin_promotion"]
502items.forEach(function(value){ot4.delete_cookie(value);if(!(ANALYTIC_CHOICES.includes(value))){localStorage.removeItem(value);}});}
503if(client_conf[ANALYTIC]){CommonFunctions.save_referer_customer_origin();}else{remove_cookies_or_localstorage(Cookiebar.OT_COOKIES_NON_ESSENTIAL[ANALYTIC]);}
504if(!client_conf[MARKETING]){remove_cookies_or_localstorage(Cookiebar.OT_COOKIES_NON_ESSENTIAL[MARKETING]);}}
505function apply_user_conf(client_conf){set_opentiendas_user_conf(client_conf);var event_detail={client_conf:client_conf,cookie_services:Cookiebar.cookie_services};Cookiebar.last_user_conf_event=event_detail;ot4.dispatch_event('cookie_preferences_updated',event_detail);}
506function init_cookiebar(){const $cookiebar_holder=$("#cookiebar_holder");Cookiebar.cookie_services=$cookiebar_holder.data('cookie-services');Cookiebar.$cookiebar_modal=$('#cookiebar_modal');const CLIENT_CONF=Cookiebar.get_user_conf();Cookiebar.OT_COOKIES_NON_ESSENTIAL=$cookiebar_holder.data('cookie-non-essential');let cookieListContentLoaded=false;$cookiebar_holder.on('click','#cookiebar_fully_accept_btn',function(){Cookiebar.set_user_conf_accept_reject_all(true);$cookiebar_holder.html('');});$cookiebar_holder.on('click','.btn-cookiebar-reject-all',function(e){e.preventDefault();Cookiebar.set_user_conf_accept_reject_all(false);$cookiebar_holder.html('');});Cookiebar.$cookiebar_modal.on('click','#cookiebar_modal_save_btn',function(){const $form=Cookiebar.$cookiebar_modal.find('form#cookiebar_user_conf');var conf=default_conf;conf[ANALYTIC]=$form.find('input[name="'+ANALYTIC+'"]').is(':checked');conf[MARKETING]=$form.find('input[name="'+MARKETING+'"]').is(':checked');save_user_conf(conf);apply_user_conf(conf,true);const redirect_url=Cookiebar.$cookiebar_modal.data("redirect");if(redirect_url==null){Cookiebar.$cookiebar_modal.modal('hide');Cookiebar.$cookiebar_modal.on('hidden.bs.modal',function(){$cookiebar_holder.html('');});}else{window.location=redirect_url;}});Cookiebar.$cookiebar_modal.on('click','#cookiebar_modal_accept_all_btn',function(){var conf=default_conf;conf[ANALYTIC]=true;conf[MARKETING]=true;save_user_conf(conf);apply_user_conf(conf,true);const redirect_url=Cookiebar.$cookiebar_modal.data("redirect");if(redirect_url==null){Cookiebar.$cookiebar_modal.modal('hide');Cookiebar.$cookiebar_modal.on('hidden.bs.modal',function(){$cookiebar_holder.html('');});}else{window.location=redirect_url;}});$cookiebar_holder.on('click','.cookiebar-set-prefs-btn',function(){Cookiebar.$cookiebar_modal.data("redirect",null);if(!cookieListContentLoaded){$.get($cookiebar_holder.data('xhr-url'),function(html){cookieListContentLoaded=true;$("#cookiebar_user_conf").html(html);Cookiebar.$cookiebar_modal.modal();});}else{Cookiebar.$cookiebar_modal.modal();}});if(CLIENT_CONF){apply_user_conf(CLIENT_CONF,true);}else{apply_user_conf(default_conf,false);}}
507return{ESSENTIAL:ESSENTIAL,MARKETING:MARKETING,ANALYTIC:ANALYTIC,last_user_conf_event:null,get_user_conf:function(){try{return JSON.parse(localStorage.getItem(cookieStorageKey));}catch(e){return null;}},init:function(){init_cookiebar();},set_user_conf_accept_reject_all(is_accept_all){var conf=default_conf;conf[ANALYTIC]=is_accept_all;
507conf[MARKETING]=is_accept_all;save_user_conf(conf);apply_user_conf(conf,true);}}}();$(function(){Cookiebar.init();});;

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.