bootstrap.native
Advanced tools
Comparing version 3.0.5 to 3.0.6
// Native JavaScript for Bootstrap v3.0.5 | 2020 © dnp_theme | MIT-License | ||
function t(t,e){return t.classList.contains(e)}function e(t,e){t.classList.remove(e)}function i(t,e,i,n){n=n||!1,t.addEventListener(e,i,n)}function n(t,e,i,n){n=n||!1,t.removeEventListener(e,i,n)}function o(t,e,o,a){i(t,e,(function i(l){l.target===t&&(o(l),n(t,e,i,a))}),a)}var a="webkitTransition"in document.body.style?"webkitTransitionEnd":"transitionend",l="webkitTransition"in document.body.style||"transition"in document.body.style,r="webkitTransition"in document.body.style?"webkitTransitionDuration":"transitionDuration";function c(t){var e=l?window.getComputedStyle(t)[r]:0;return e="number"!=typeof(e=parseFloat(e))||isNaN(e)?0:1e3*e}function s(t,e){var i=0;c(t)?o(t,a,(function(t){!i&&e(t),i=1})):setTimeout((function(){!i&&e(),i=1}),17)}function d(t,e){var i=e&&e instanceof Element?e:document;return t instanceof Element?t:i.querySelector(t)}function u(t,e,i){var n=new CustomEvent(t+".bs."+e,{cancelable:!0});return n.relatedTarget=i,n}function f(t){this&&this.dispatchEvent(t)}function m(o){var a,l=this,r=u("close","alert"),c=u("closed","alert");function m(t){a=t&&t.target.closest(".alert"),(o=d('[data-dismiss="alert"]',a))&&a&&(o===t.target||o.contains(t.target))&&l.close()}function g(){n(o,"click",m),a.parentNode.removeChild(a),f.call(a,c)}l.close=function(){if(a&&o&&t(a,"show")){if(f.call(a,r),r.defaultPrevented)return;l.dispose(),e(a,"show"),t(a,"fade")?s(a,g):g()}},l.dispose=function(){n(o,"click",m),delete o.Alert},o=d(o),a=o.closest(".alert"),o.Alert&&o.Alert.dispose(),o.Alert||i(o,"click",m),l.element=o,o.Alert=l}function g(t,e){t.classList.add(e)}function h(o){var a,l=u("change","button");function r(i){var n,r="LABEL"===i.target.tagName?i.target:i.target.closest("LABEL")?i.target.closest("LABEL"):null;if(n=r&&r.getElementsByTagName("INPUT")[0]){if(f.call(n,l),f.call(o,l),"checkbox"===n.type){if(l.defaultPrevented)return;n.checked?(e(r,"active"),n.getAttribute("checked"),n.removeAttribute("checked"),n.checked=!1):(g(r,"active"),n.getAttribute("checked"),n.setAttribute("checked","checked"),n.checked=!0),o.toggled||(o.toggled=!0)}if("radio"===n.type&&!o.toggled){if(l.defaultPrevented)return;(!n.checked||0===i.screenX&&0==i.screenY)&&(g(r,"active"),g(r,"focus"),n.setAttribute("checked","checked"),n.checked=!0,o.toggled=!0,Array.from(a).map((function(i){var n=i.getElementsByTagName("INPUT")[0];i!==r&&t(i,"active")&&(f.call(n,l),e(i,"active"),n.removeAttribute("checked"),n.checked=!1)})))}setTimeout((function(){o.toggled=!1}),50)}}function c(t){32===(t.which||t.keyCode)&&t.target===document.activeElement&&r(t)}function s(t){32===(t.which||t.keyCode)&&t.preventDefault()}function m(t){var i="focusin"===t.type?g:e;"INPUT"===t.target.tagName&&i(t.target.closest(".btn"),"focus")}function h(t){t(o,"click",r),t(o,"keyup",c),t(o,"keydown",s),t(o,"focusin",m),t(o,"focusout",m)}this.dispose=function(){h(n),delete o.Button},(o=d(o)).Button&&o.Button.dispose(),(a=o.getElementsByClassName("btn")).length&&(o.Button||h(i),o.toggled=!1,o.Button=this,Array.from(a).map((function(i){!t(i,"active")&&d("input:checked",i)&&g(i,"active"),t(i,"active")&&!d("input:checked",i)&&e(i,"active")})))}var p="touchstart",v="touchend",b="touchmove",y="onmouseleave"in document?["mouseenter","mouseleave"]:["mouseover","mouseout"],w=!!function(){var t=!1;try{var e=Object.defineProperty({},"passive",{get:function(){t=!0}});o(document,"DOMContentLoaded",(function(){}),e)}catch(t){}return t}()&&{passive:!0};function A(o,a){a=a||{};var l,r,m,h,A,T,k,C,x,N=this;function E(){!1===r.interval||t(o,"paused")||(g(o,"paused"),!l.isSliding&&(clearInterval(l.timer),l.timer=null))}function P(){!1!==r.interval&&t(o,"paused")&&(e(o,"paused"),!l.isSliding&&(clearInterval(l.timer),l.timer=null),!l.isSliding&&N.cycle())}function S(e){if(e.preventDefault(),!l.isSliding){var i=e.target;if(!i||t(i,"active")||!i.getAttribute("data-slide-to"))return!1;l.index=parseInt(i.getAttribute("data-slide-to")),N.slideTo(l.index)}}function B(t){if(t.preventDefault(),!l.isSliding){var e=t.currentTarget||t.srcElement;e===k?l.index++:e===T&&l.index--,N.slideTo(l.index)}}function H(t){var e=t.which;if(!l.isSliding){switch(e){case 39:l.index++;break;case 37:l.index--;break;default:return}N.slideTo(l.index)}}function L(t){r.pause&&r.interval&&(t(o,y[0],E),t(o,y[1],P),t(o,p,E,w),t(o,v,P,w)),r.touch&&A.length>1&&t(o,p,I,w),k&&t(k,"click",B),T&&t(T,"click",B),C&&t(C,"click",S),r.keyboard&&t(window,"keydown",H)}function M(t){t(o,b,D,w),t(o,v,X,w)}function I(t){l.isTouch||(l.touchPosition.startX=t.changedTouches[0].pageX,o.contains(t.target)&&(l.isTouch=!0,M(i)))}function D(t){if(l.isTouch)return l.touchPosition.currentX=t.changedTouches[0].pageX,"touchmove"===t.type&&t.changedTouches.length>1?(t.preventDefault(),!1):void 0;t.preventDefault()}function X(t){if(l.isTouch&&!l.isSliding&&(l.touchPosition.endX=l.touchPosition.currentX||t.changedTouches[0].pageX,l.isTouch)){if((!o.contains(t.target)||!o.contains(t.relatedTarget))&&Math.abs(l.touchPosition.startX-l.touchPosition.endX)<75)return!1;l.touchPosition.currentX<l.touchPosition.startX?l.index++:l.touchPosition.currentX>l.touchPosition.startX&&l.index--,l.isTouch=!1,N.slideTo(l.index),M(n)}}function W(t){Array.from(x).map((function(t){e(t,"active")})),x[t]&&g(x[t],"active")}function O(i){if(l.touchPosition){var n=l.index,a=i&&i.target!==A[n]?1e3*i.elapsedTime+100:20,c=N.getActiveIndex(),s="left"===l.direction?"next":"prev";l.isSliding&&setTimeout((function(){l.touchPosition&&(l.isSliding=!1,g(A[n],"active"),e(A[c],"active"),e(A[n],"carousel-item-"+s),e(A[n],"carousel-item-"+l.direction),e(A[c],"carousel-item-"+l.direction),f.call(o,h),document.hidden||!r.interval||t(o,"paused")||N.cycle())}),a)}}if(N.cycle=function(){l.timer&&(clearInterval(l.timer),l.timer=null),l.timer=setInterval((function(){var t=l.index||N.getActiveIndex();(function(t){var e=t.getBoundingClientRect(),i=window.innerHeight||document.documentElement.clientHeight;return e.top<=i&&e.bottom>=0})(o)&&(t++,N.slideTo(t))}),r.interval)},N.slideTo=function(i){if(!l.isSliding){var n,a=N.getActiveIndex();a!==i&&(a<i||0===a&&i===A.length-1?l.direction="left":(a>i||a===A.length-1&&0===i)&&(l.direction="right"),i<0?i=A.length-1:i>=A.length&&(i=0),n="left"===l.direction?"next":"prev",m=u("slide","carousel",A[i]),h=u("slid","carousel",A[i]),f.call(o,m),m.defaultPrevented||(l.index=i,l.isSliding=!0,clearInterval(l.timer),l.timer=null,W(i),c(A[i])&&t(o,"slide")?(g(A[i],"carousel-item-"+n),A[i].offsetWidth,g(A[i],"carousel-item-"+l.direction),g(A[a],"carousel-item-"+l.direction),s(A[i],O)):(g(A[i],"active"),A[i].offsetWidth,e(A[a],"active"),setTimeout((function(){l.isSliding=!1,r.interval&&o&&!t(o,"paused")&&N.cycle(),f.call(o,h)}),100))))}},N.getActiveIndex=function(){return Array.from(A).indexOf(o.getElementsByClassName("carousel-item active")[0])||0},N.dispose=function(){var i=["left","right","prev","next"];Array.from(A).map((function(n,o){t(n,"active")&&W(o),i.map((function(t){return e(n,"carousel-item-"+t)}))})),clearInterval(l.timer),L(n),l={},r={},delete o.Carousel},(o=d(o)).Carousel&&o.Carousel.dispose(),A=o.getElementsByClassName("carousel-item"),T=o.getElementsByClassName("carousel-control-prev")[0],k=o.getElementsByClassName("carousel-control-next")[0],C=o.getElementsByClassName("carousel-indicators")[0],x=C&&C.getElementsByTagName("LI")||[],!(A.length<2)){var R=o.getAttribute("data-interval"),z="false"===R?0:parseInt(R),U="false"===o.getAttribute("data-touch")?0:1,q="hover"===o.getAttribute("data-pause")||!1,Y="true"===o.getAttribute("data-keyboard")||!1,j=a.interval,F=a.touch;(r={}).keyboard=!0===a.keyboard||Y,r.pause=!("hover"!==a.pause&&!q)&&"hover",r.touch=F||U,r.interval="number"==typeof j?j:!1===j||0===z||!1===z?0:isNaN(z)?5e3:z,N.getActiveIndex()<0&&(A.length&&g(A[0],"active"),x.length&&W(0)),(l={}).direction="left",l.index=0,l.timer=null,l.isSliding=!1,l.isTouch=!1,l.touchPosition={startX:0,currentX:0,endX:0},L(i),r.interval&&N.cycle(),o.Carousel=N}}function T(o,a){a=a||{};var l,r,c,m,h,p,v=this,b=null,y=null;function w(t,i){f.call(t,h),h.defaultPrevented||(t.isAnimating=!0,t.style.height=t.scrollHeight+"px",e(t,"collapse"),e(t,"show"),g(t,"collapsing"),t.offsetWidth,t.style.height="0px",s(t,(function(){t.isAnimating=!1,t.setAttribute("aria-expanded","false"),i.setAttribute("aria-expanded","false"),e(t,"collapsing"),g(t,"collapse"),t.style.height="",f.call(t,p)})))}v.toggle=function(e){(e&&"A"===e.target.tagName||"A"===o.tagName)&&e.preventDefault(),(o.contains(e.target)||e.target===o)&&(t(y,"show")?v.hide():v.show())},v.hide=function(){y.isAnimating||(w(y,o),g(o,"collapsed"))},v.show=function(){var t,i;b&&(l=b.getElementsByClassName("collapse show")[0],r=l&&(d('[data-target="#'+l.id+'"]',b)||d('[href="#'+l.id+'"]',b))),y.isAnimating||(r&&l!==y&&(w(l,r),g(r,"collapsed")),t=y,i=o,f.call(t,c),c.defaultPrevented||(t.isAnimating=!0,g(t,"collapsing"),e(t,"collapse"),t.style.height=t.scrollHeight+"px",s(t,(function(){t.isAnimating=!1,t.setAttribute("aria-expanded","true"),i.setAttribute("aria-expanded","true"),e(t,"collapsing"),g(t,"collapse"),g(t,"show"),t.style.height="",f.call(t,m)}))),e(o,"collapsed"))},v.dispose=function(){n(o,"click",v.toggle),delete o.Collapse},(o=d(o)).Collapse&&o.Collapse.dispose();var A=o.getAttribute("data-parent");c=u("show","collapse"),m=u("shown","collapse"),h=u("hide","collapse"),p=u("hidden","collapse"),(y=d(a.target||o.getAttribute("data-target")||o.getAttribute("href"))).isAnimating=!1,b=o.closest(a.parent||A),o.Collapse||i(o,"click",v.toggle),o.Collapse=v}var k="mousedown";"webkitPerspective"in document.body.style||document.body.style,"webkitTransform"in document.body.style||document.body.style;function C(t,e){try{t()}catch(t){console.error(e+": "+t)}}function x(t){t.focus?t.focus():t.setActive()}function N(){return{y:window.pageYOffset||document.documentElement.scrollTop,x:window.pageXOffset||document.documentElement.scrollLeft}}function E(e,i,n,o){var a,l,r,c,s,u,f=i.offsetWidth,m=i.offsetHeight,g=document.documentElement.clientWidth||document.body.clientWidth,h=document.documentElement.clientHeight||document.body.clientHeight,p=e.getBoundingClientRect(),v=o===document.body?N():{x:o.offsetLeft+o.scrollLeft,y:o.offsetTop+o.scrollTop},b=p.right-p.left,y=p.bottom-p.top,w=t(i,"popover"),A=d(".arrow",i),T=p.top+y/2-m/2<0,k=p.left+b/2-f/2<0,C=p.left+f/2+b/2>=g,x=p.top+m/2+y/2>=h,E=p.top-m<0,P=p.left-f<0,S=p.top+m+y>=h,B=p.left+f+b>=g;n="right"===(n="left"===(n="bottom"===(n="top"===(n=("left"===n||"right"===n)&&P&&B?"top":n)&&E?"bottom":n)&&S?"top":n)&&P?"right":n)&&B?"left":n,-1===i.className.indexOf(n)&&(i.className=i.className.replace(/\b(top|bottom|left|right)+/,n)),s=A.offsetWidth,u=A.offsetHeight,"left"===n||"right"===n?(l="left"===n?p.left+v.x-f-(w?s:0):p.left+v.x+b,T?(a=p.top+v.y,r=y/2-s):x?(a=p.top+v.y-m+y,r=m-y/2-s):(a=p.top+v.y-m/2+y/2,r=m/2-(w?.9*u:u/2))):"top"!==n&&"bottom"!==n||(a="top"===n?p.top+v.y-m-(w?u:0):p.top+v.y+y,k?(l=0,c=p.left+b/2-s):C?(l=g-1.01*f,c=f-(g-p.left)+b/2-s/2):(l=p.left+v.x-f/2+b/2,c=f/2-(w?s:s/2))),i.style.top=a+"px",i.style.left=l+"px",r&&(A.style.top=r+"px"),c&&(A.style.left=c+"px")}function P(o,a){var l,r,c,s,m,h,p,v=this,b=null,y=[];function w(t){(t.href&&"#"===t.href.slice(-1)||t.parentNode&&t.parentNode.href&&"#"===t.parentNode.href.slice(-1))&&this.preventDefault()}function A(){var t=o.open?i:n;t(document,"click",T),t(document,"keydown",C),t(document,"keyup",N),t(document,"focus",T,!0)}function T(t){var e=t.target,i=e&&(e.getAttribute("data-toggle")||e.parentNode&&e.parentNode.getAttribute&&e.parentNode.getAttribute("data-toggle"));("focus"!==t.type||e!==o&&e!==h&&!h.contains(e))&&(e!==h&&!h.contains(e)||!p&&!i)&&(b=e===o||o.contains(e)?o:null,v.hide(),w.call(t,e))}function k(t){b=o,v.show(),w.call(t,t.target)}function C(t){var e=t.which||t.keyCode;38!==e&&40!==e||t.preventDefault()}function N(t){var e=t.which,i=t.keyCode,n=e||i,a=document.activeElement,l=a===o,r=h.contains(a),c=a.parentNode===h||a.parentNode.parentNode===h,s=y.indexOf(a);c&&(s=l?0:38===n?s>1?s-1:0:40===n&&s<y.length-1?s+1:s,y[s]&&x(y[s])),(y.length&&c||!y.length&&(r||l)||!r)&&o.open&&27===n&&(v.toggle(),b=null)}v.show=function(){l=u("show","dropdown",b),f.call(m,l),l.defaultPrevented||(g(h,"show"),g(m,"show"),o.setAttribute("aria-expanded",!0),o.open=!0,n(o,"click",k),setTimeout((function(){x(h.getElementsByTagName("INPUT")[0]||o),A(),r=u("shown","dropdown",b),f.call(m,r)}),1))},v.hide=function(){c=u("hide","dropdown",b),f.call(m,c),c.defaultPrevented||(e(h,"show"),e(m,"show"),o.setAttribute("aria-expanded",!1),o.open=!1,A(),x(o),setTimeout((function(){o.Dropdown&&i(o,"click",k)}),1),s=u("hidden","dropdown",b),f.call(m,s))},v.toggle=function(){t(m,"show")&&o.open?v.hide():v.show()},v.dispose=function(){t(m,"show")&&o.open&&v.hide(),n(o,"click",k),delete o.Dropdown},(o=d(o)).Dropdown&&o.Dropdown.dispose(),m=o.parentNode,h=d(".dropdown-menu",m),Array.from(h.children).map((function(t){t.children.length&&"A"===t.children[0].tagName&&y.push(t.children[0]),"A"===t.tagName&&y.push(t)})),o.Dropdown||(!("tabindex"in h)&&h.setAttribute("tabindex","0"),i(o,"click",k)),p=!0===a||"true"===o.getAttribute("data-persist")||!1,o.open=!1,o.Dropdown=v}function S(o,a){a=a||{};var l,r,m,h,p,v,b,y,A,T=this,k=null,C={};function N(){var e,i,n=t(document.body,"modal-open"),o=parseInt(getComputedStyle(document.body).paddingRight),a=document.documentElement.clientHeight!==document.documentElement.scrollHeight||document.body.clientHeight!==document.body.scrollHeight,r=l.clientHeight!==l.scrollHeight;(i=document.createElement("div")).className="modal-scrollbar-measure",document.body.appendChild(i),e=i.offsetWidth-i.clientWidth,document.body.removeChild(i),v=e,l.style.paddingRight=!r&&v?v+"px":"",document.body.style.paddingRight=r||a?o+(n?0:v)+"px":"",A.length&&A.map((function(t){var e=getComputedStyle(t).paddingRight;t.style.paddingRight=r||a?parseInt(e)+(n?0:v)+"px":parseInt(e)+"px"}))}function E(){(b=d(".modal-backdrop"))&&!document.getElementsByClassName("modal show")[0]&&(document.body.removeChild(b),b=null),null===b&&(e(document.body,"modal-open"),document.body.style.paddingRight="",l.style.paddingRight="",A.length&&A.map((function(t){t.style.paddingRight=""})))}function P(t){t(window,"resize",T.update,w),t(l,"click",I),t(document,"keydown",M)}function S(){l.style.display="block",N(),!document.getElementsByClassName("modal show")[0]&&g(document.body,"modal-open"),g(l,"show"),l.setAttribute("aria-hidden",!1),t(l,"fade")?s(l,B):B()}function B(){x(l),l.isAnimating=!1,P(i),m=u("shown","modal",k),f.call(l,m)}function H(i){l.style.display="",o&&x(o),b=d(".modal-backdrop"),1!==i&&b&&t(b,"show")&&!document.getElementsByClassName("modal show")[0]?(e(b,"show"),s(b,E)):E(),P(n),l.isAnimating=!1,p=u("hidden","modal"),f.call(l,p)}function L(e){if(!l.isAnimating){var i=e.target,n="#"+l.getAttribute("id"),a=i.getAttribute("data-target")||i.getAttribute("href"),r=o.getAttribute("data-target")||o.getAttribute("href");!t(l,"show")&&(i===o&&a===n||o.contains(i)&&r===n)&&(l.modalTrigger=o,k=o,T.show(),e.preventDefault())}}function M(e){var i=e.which;!l.isAnimating&&C.keyboard&&27==i&&t(l,"show")&&T.hide()}function I(e){if(!l.isAnimating){var i=e.target,n="modal"===i.getAttribute("data-dismiss"),o=i.closest('[data-dismiss="modal"]');t(l,"show")&&(o||n||i===l&&"static"!==C.backdrop)&&(T.hide(),k=null,e.preventDefault())}}T.toggle=function(){t(l,"show")?T.hide():T.show()},T.show=function(){if(!(t(l,"show")&&l.isAnimating||(r=u("show","modal",k),f.call(l,r),r.defaultPrevented))){l.isAnimating=!0;var e,i=document.getElementsByClassName("modal show")[0];i&&i!==l&&(i.modalTrigger&&i.modalTrigger.Modal.hide(),i.Modal&&i.Modal.hide()),C.backdrop&&(e=document.createElement("div"),null===(b=d(".modal-backdrop"))&&(e.setAttribute("class","modal-backdrop"+(C.animation?" fade":"")),b=e,document.body.appendChild(b)),b=b),!b||i||t(b,"show")||(b.offsetWidth,y=c(b),g(b,"show")),i?S():setTimeout(S,b&&y?y:0)}},T.hide=function(i){t(l,"show")&&(h=u("hide","modal"),f.call(l,h),h.defaultPrevented||(l.isAnimating=!0,e(l,"show"),l.setAttribute("aria-hidden",!0),t(l,"fade")&&1!==i?s(l,H):H()))},T.setContent=function(t){d(".modal-content",l).innerHTML=t},T.update=function(){t(l,"show")&&N()},T.dispose=function(){T.hide(1),o?(n(o,"click",L),delete o.Modal):delete l.Modal},o=d(o);var D=d(o.getAttribute("data-target")||o.getAttribute("href"));l=t(o,"modal")?o:D,A=Array.from(document.getElementsByClassName("fixed-top")).concat(Array.from(document.getElementsByClassName("fixed-bottom"))),t(o,"modal")&&(o=null),o&&o.Modal&&o.Modal.dispose(),l&&l.Modal&&l.Modal.dispose(),C.keyboard=!1!==a.keyboard&&"false"!==l.getAttribute("data-keyboard"),C.backdrop="static"!==a.backdrop&&"static"!==l.getAttribute("data-backdrop")||"static",C.backdrop=!1!==a.backdrop&&"false"!==l.getAttribute("data-backdrop")&&C.backdrop,C.animation=!!t(l,"fade"),C.content=a.content,l.isAnimating=!1,o&&!o.Modal&&i(o,"click",L),C.content&&T.setContent(C.content.trim()),o?(l.modalTrigger=o,o.Modal=T):l.Modal=T}function B(o,a){a=a||{};var l,r,c,m,h,v,b,A,T,C,x,N,P,S,B,H,L,M,I,D=this,X=null,W=0,O=/(iPhone|iPod|iPad)/.test(navigator.userAgent),R={};function z(t){null!==X&&t.target===d(".close",X)&&D.hide()}function U(){return{0:a.title||o.getAttribute("data-title")||null,1:a.content||o.getAttribute("data-content")||null}}function q(){null===X&&o.focus()}function Y(t){"hover"===R.trigger?(t(o,k,D.show),t(o,y[0],D.show),R.dismissible||t(o,y[1],D.hide)):"click"==R.trigger?t(o,R.trigger,D.toggle):"focus"==R.trigger&&(O&&t(o,"click",q),t(o,R.trigger,D.toggle))}function j(t){X&&X.contains(t.target)||t.target===o||o.contains(t.target)||D.hide()}function F(t){R.dismissible?t(document,"click",z):("focus"==R.trigger&&t(o,"blur",D.hide),"hover"==R.trigger&&t(document,p,j,w)),t(window,"resize",D.hide,w)}function V(){F(i),f.call(o,x)}function G(){F(n),R.container.removeChild(X),W=null,X=null,f.call(o,P)}D.toggle=function(){null===X?D.show():D.hide()},D.show=function(){clearTimeout(W),W=setTimeout((function(){if(null===X){if(f.call(o,C),C.defaultPrevented)return;!function(){l=U()[0]||null,r=(r=U()[1])?r.trim():null,X=document.createElement("div");var e=document.createElement("div");if(g(e,"arrow"),X.appendChild(e),null!==r&&null===R.template){if(X.setAttribute("role","tooltip"),null!==l){var i=document.createElement("h3");g(i,"popover-header"),i.innerHTML=R.dismissible?l+T:l,X.appendChild(i)}var n=document.createElement("div");g(n,"popover-body"),n.innerHTML=R.dismissible&&null===l?r+T:r,X.appendChild(n)}else{var o=document.createElement("div");o.innerHTML=R.template.trim(),X.className=o.firstChild.className,X.innerHTML=o.firstChild.innerHTML;var a=d(".popover-header",X),c=d(".popover-body",X);l&&a&&(a.innerHTML=l.trim()),r&&c&&(c.innerHTML=r.trim())}R.container.appendChild(X),X.style.display="block",!t(X,"popover")&&g(X,"popover"),!t(X,R.animation)&&g(X,R.animation),!t(X,I)&&g(X,I)}(),E(o,X,R.placement,R.container),!t(X,"show")&&g(X,"show"),R.animation?s(X,V):V()}}),20)},D.hide=function(){clearTimeout(W),W=setTimeout((function(){if(X&&null!==X&&t(X,"show")){if(f.call(o,N),N.defaultPrevented)return;e(X,"show"),R.animation?s(X,G):G()}}),R.delay)},D.dispose=function(){D.hide(),Y(n),delete o.Popover},(o=d(o)).Popover&&o.Popover.dispose(),c=o.getAttribute("data-trigger"),m=o.getAttribute("data-animation"),h=o.getAttribute("data-placement"),v=o.getAttribute("data-dismissible"),b=o.getAttribute("data-delay"),A=o.getAttribute("data-container"),T='<button type="button" class="close">×</button>',C=u("show","popover"),x=u("shown","popover"),N=u("hide","popover"),P=u("hidden","popover"),S=d(a.container),B=d(A),H=o.closest(".modal"),L=o.closest(".fixed-top"),M=o.closest(".fixed-bottom"),R.template=a.template?a.template:null,R.trigger=a.trigger?a.trigger:c||"hover",R.animation=a.animation&&"fade"!==a.animation?a.animation:m||"fade",R.placement=a.placement?a.placement:h||"top",R.delay=parseInt(a.delay||b)||200,R.dismissible=!(!a.dismissible&&"true"!==v),R.container=S||(B||(L||(M||(H||document.body)))),I="bs-popover-"+R.placement;var J=U();l=J[0],((r=J[1])||R.template)&&(o.Popover||Y(i),o.Popover=D)}function H(o,a){a=a||{};var l,r,c,s,m,h=this,p={};function v(){var i;i=s.getElementsByTagName("A"),l.length!==i.length&&(l.items=[],l.targets=[],Array.from(i).map((function(t){var e=t.getAttribute("href"),i=e&&"#"===e.charAt(0)&&"#"!==e.slice(-1)&&d(e);i&&(l.items.push(t),l.targets.push(i))})),l.length=i.length),l.scrollOffset=l.isWindow?N().y:o.scrollTop,l.items.map((function(i,n){return function(i){var n=l.items[i],a=l.targets[i],r=t(n,"dropdown-item")&&n.closest(".dropdown-menu"),c=r&&r.previousElementSibling,s=n.nextElementSibling,d=s&&s.getElementsByClassName("active").length,m=l.isWindow&&a.getBoundingClientRect(),h=t(n,"active")||!1,v=(l.isWindow?m.top+l.scrollOffset:a.offsetTop)-p.offset,b=l.isWindow?m.bottom+l.scrollOffset-p.offset:l.targets[i+1]?l.targets[i+1].offsetTop-p.offset:o.scrollHeight,y=d||l.scrollOffset>=v&&b>l.scrollOffset;if(!h&&y)g(n,"active"),c&&!t(c,"active")&&g(c,"active"),f.call(o,u("activate","scrollspy",l.items[i]));else if(h&&!y)e(n,"active"),c&&t(c,"active")&&!n.parentNode.getElementsByClassName("active").length&&e(c,"active");else if(h&&y||!y&&!h)return}(n)}))}function b(t){t(m,"scroll",h.refresh,w),t(window,"resize",h.refresh,w)}h.refresh=function(){v()},h.dispose=function(){b(n),delete o.ScrollSpy},(o=d(o)).ScrollSpy&&o.ScrollSpy.dispose(),r=o.getAttribute("data-target"),c=o.getAttribute("data-offset"),s=d(a.target||r),m=o.offsetHeight<o.scrollHeight?o:window,s&&(p.target=s,p.offset=parseInt(a.offset||c)||10,(l={}).length=0,l.items=[],l.targets=[],l.isWindow=m===window,o.ScrollSpy||b(i),h.refresh(),o.ScrollSpy=h)}function L(o,a){a=a||{};var r,c,m,h,p,v,b,y,w,A,T,k,C,x,N,E=this,P=!1;function S(){P.style.height="",e(P,"collapsing"),c.isAnimating=!1}function B(){P?C?S():setTimeout((function(){P.style.height=x+"px",P.offsetWidth,s(P,S)}),50):c.isAnimating=!1,p=u("shown","tab",w),f.call(y,p)}function H(){P&&(A.style.float="left",T.style.float="left",k=A.scrollHeight),h=u("show","tab",w),b=u("hidden","tab",y),f.call(y,h),h.defaultPrevented||(g(T,"active"),e(A,"active"),P&&(x=T.scrollHeight,C=x===k,g(P,"collapsing"),P.style.height=k+"px",P.offsetHeight,A.style.float="",T.style.float=""),t(T,"fade")?setTimeout((function(){g(T,"show"),s(T,B)}),20):B(),f.call(w,b))}function L(){var e,i=c.getElementsByClassName("active");return 1!==i.length||t(i[0].parentNode,"dropdown")?i.length>1&&(e=i[i.length-1]):e=i[0],e}function M(){return d(L().getAttribute("href"))}function I(t){t.preventDefault(),y=t.currentTarget,!c.isAnimating&&E.show()}E.show=function(){if(!t(y=y||o,"active")){if(T=d(y.getAttribute("href")),w=L(),A=M(),v=u("hide","tab",y),f.call(w,v),v.defaultPrevented)return;c.isAnimating=!0,e(w,"active"),w.setAttribute("aria-selected","false"),g(y,"active"),y.setAttribute("aria-selected","true"),m&&(t(o.parentNode,"dropdown-menu")?t(m,"active")||g(m,"active"):t(m,"active")&&e(m,"active")),t(A,"fade")?(e(A,"show"),s(A,H)):H()}},E.dispose=function(){n(o,"click",I),delete o.Tab},(o=d(o)).Tab&&o.Tab.dispose(),r=o.getAttribute("data-height"),c=o.closest(".nav"),m=c&&d(".dropdown-toggle",c),N=!(!l||!1===a.height||"false"===r),c.isAnimating=!1,o.Tab||i(o,"click",I),N&&(P=M().parentNode),o.Tab=E}function M(o,a){a=a||{};var l,r,c,m,h,p,v,b,y=this,w=0,A={};function T(){e(l,"showing"),g(l,"show"),f.call(l,v),A.autohide&&y.hide()}function k(){g(l,"hide"),f.call(l,b)}function C(){e(l,"show"),A.animation?s(l,k):k()}function x(){clearTimeout(w),n(o,"click",y.hide),delete o.Toast}y.show=function(){if(l&&!t(l,"show")){if(f.call(l,h),h.defaultPrevented)return;A.animation&&g(l,"fade"),e(l,"hide"),l.offsetWidth,g(l,"showing"),A.animation?s(l,T):T()}},y.hide=function(e){if(l&&t(l,"show")){if(f.call(l,p),p.defaultPrevented)return;e?C():w=setTimeout(C,A.delay)}},y.dispose=function(){A.animation?s(l,x):x()},(o=d(o)).Toast&&o.Toast.dispose(),l=o.closest(".toast"),r=o.getAttribute("data-animation"),c=o.getAttribute("data-autohide"),m=o.getAttribute("data-delay"),h=u("show","toast"),p=u("hide","toast"),v=u("shown","toast"),b=u("hidden","toast"),A.animation=!1===a.animation||"false"===r?0:1,A.autohide=!1===a.autohide||"false"===c?0:1,A.delay=parseInt(a.delay||m)||500,o.Toast||i(o,"click",y.hide),o.Toast=y}function I(o,a){a=a||{};var l,r,c,m,h,v,b,A,T,C,x,N,P,S,B,H=this,L=null,M=0,I={};function D(){return o.getAttribute("title")||o.getAttribute("data-title")||o.getAttribute("data-original-title")}function X(t){L&&L.contains(t.target)||t.target===o||o.contains(t.target)||H.hide()}function W(){i(document,p,X,w),i(window,"resize",H.hide,w),f.call(o,b)}function O(){n(document,p,X,w),n(window,"resize",H.hide,w),I.container.removeChild(L),L=null,M=null,f.call(o,T)}function R(t){t(o,k,H.show),t(o,y[0],H.show),t(o,y[1],H.hide)}H.show=function(){clearTimeout(M),M=setTimeout((function(){if(null===L){if(f.call(o,v),v.defaultPrevented)return;!1!==function(){if(l=D()){if(L=document.createElement("div"),I.template){var e=document.createElement("div");e.innerHTML=I.template.trim(),L.className=e.firstChild.className,L.innerHTML=e.firstChild.innerHTML,d(".tooltip-inner",L).innerHTML=l.trim()}else{var i=document.createElement("div");g(i,"arrow"),L.appendChild(i);var n=document.createElement("div");g(n,"tooltip-inner"),L.appendChild(n),n.innerHTML=l}L.style.left="0",L.style.top="0",L.setAttribute("role","tooltip"),!t(L,"tooltip")&&g(L,"tooltip"),!t(L,I.animation)&&g(L,I.animation),!t(L,B)&&g(L,B),I.container.appendChild(L)}}()&&(E(o,L,I.placement,I.container),!t(L,"show")&&g(L,"show"),I.animation?s(L,W):W())}}),20)},H.hide=function(){clearTimeout(M),M=setTimeout((function(){if(L&&t(L,"show")){if(f.call(o,A),A.defaultPrevented)return;e(L,"show"),I.animation?s(L,O):O()}}),I.delay)},H.toggle=function(){L?H.hide():H.show()},H.dispose=function(){R(n),H.hide(),o.setAttribute("title",o.getAttribute("data-original-title")),o.removeAttribute("data-original-title"),delete o.Tooltip},(o=d(o)).Tooltip&&o.Tooltip.dispose(),r=o.getAttribute("data-animation"),c=o.getAttribute("data-placement"),m=o.getAttribute("data-delay"),h=o.getAttribute("data-container"),v=u("show","tooltip"),b=u("shown","tooltip"),A=u("hide","tooltip"),T=u("hidden","tooltip"),C=d(a.container),x=d(h),N=o.closest(".modal"),P=o.closest(".fixed-top"),S=o.closest(".fixed-bottom"),I.animation=a.animation&&"fade"!==a.animation?a.animation:r||"fade",I.placement=a.placement?a.placement:c||"top",I.template=a.template?a.template:null,I.delay=parseInt(a.delay||m)||200,I.container=C||(x||(P||(S||(N||document.body)))),B="bs-tooltip-"+I.placement,(l=D())&&(o.Tooltip||(o.setAttribute("data-original-title",l),o.removeAttribute("title"),R(i)),o.Tooltip=H)}var D={};function X(t){t=t||document;var e=function(e){C((function(){return i=D[e][0],n=t.querySelectorAll(D[e][1]),void Array.from(n).map((function(t){return new i(t)}));var i,n}),"BSN."+e)};for(var i in D)e(i)}D.Alert=[m,'[data-dismiss="alert"]'],D.Button=[h,'[data-toggle="buttons"]'],D.Carousel=[A,'[data-ride="carousel"]'],D.Collapse=[T,'[data-toggle="collapse"]'],D.Dropdown=[P,'[data-toggle="dropdown"]'],D.Modal=[S,'[data-toggle="modal"]'],D.Popover=[B,'[data-toggle="popover"],[data-tip="popover"]'],D.ScrollSpy=[H,'[data-spy="scroll"]'],D.Tab=[L,'[data-toggle="tab"]'],D.Toast=[M,'[data-dismiss="toast"]'],D.Tooltip=[I,'[data-toggle="tooltip"],[data-tip="tooltip"]'],document.body?X():o(document,"DOMContentLoaded",X);var W={Alert:m,Button:h,Carousel:A,Collapse:T,Dropdown:P,Modal:S,Popover:B,ScrollSpy:H,Tab:L,Toast:M,Tooltip:I,initCallback:X,removeDataAPI:function(t){t=t||document;var e=function(e){C((function(){return i=e,n=t.querySelectorAll(D[e][1]),void Array.from(n).map((function(t){return t[i].dispose()}));var i,n}),"BSN."+e)};for(var i in D)e(i)},componentsInit:D,Version:"3.0.5"};export default W; | ||
var t="webkitTransition"in document.body.style?"webkitTransitionEnd":"transitionend",e="webkitTransition"in document.body.style||"transition"in document.body.style,i="webkitTransition"in document.body.style?"webkitTransitionDuration":"transitionDuration";function n(t){var n=e?parseFloat(getComputedStyle(t)[i]):0;return n="number"!=typeof n||isNaN(n)?0:1e3*n}function s(e,i){var s=0;n(e)?e.addEventListener(t,(function n(a){!s&&i(a),s=1,e.removeEventListener(t,n)})):setTimeout((function(){!s&&i(),s=1}),17)}function a(t,e){var i=e&&e instanceof Element?e:document;return t instanceof Element?t:i.querySelector(t)}function o(t,e,i){var n=new CustomEvent(t+".bs."+e,{cancelable:!0});return n.relatedTarget=i,n}function l(t){this&&this.dispatchEvent(t)}function c(t){var e,i=this,n=o("close","alert"),c=o("closed","alert");function r(e){t[e=e?"addEventListener":"removeEventListener"]("click",d,!1)}function d(n){e=n&&n.target.closest(".alert"),(t=a('[data-dismiss="alert"]',e))&&e&&(t===n.target||t.contains(n.target))&&i.close()}function u(){r(),e.parentNode.removeChild(e),l.call(e,c)}i.close=function(){if(e&&t&&e.classList.contains("show")){if(l.call(e,n),n.defaultPrevented)return;i.dispose(),e.classList.remove("show"),e.classList.contains("fade")?s(e,u):u()}},i.dispose=function(){r(),delete t.Alert},t=a(t),e=t.closest(".alert"),t.Alert&&t.Alert.dispose(),t.Alert||r(1),i.element=t,t.Alert=i}function r(t){var e,i=o("change","button");function n(n){var s,a="LABEL"===n.target.tagName?n.target:n.target.closest("LABEL")?n.target.closest("LABEL"):null;if(s=a&&a.getElementsByTagName("INPUT")[0]){if(l.call(s,i),l.call(t,i),"checkbox"===s.type){if(i.defaultPrevented)return;s.checked?(a.classList.remove("active"),s.getAttribute("checked"),s.removeAttribute("checked"),s.checked=!1):(a.classList.add("active"),s.getAttribute("checked"),s.setAttribute("checked","checked"),s.checked=!0),t.toggled||(t.toggled=!0)}if("radio"===s.type&&!t.toggled){if(i.defaultPrevented)return;(!s.checked||0===n.screenX&&0==n.screenY)&&(a.classList.add("active"),a.classList.add("focus"),s.setAttribute("checked","checked"),s.checked=!0,t.toggled=!0,Array.from(e).map((function(t){var e=t.getElementsByTagName("INPUT")[0];t!==a&&t.classList.contains("active")&&(l.call(e,i),t.classList.remove("active"),e.removeAttribute("checked"),e.checked=!1)})))}setTimeout((function(){t.toggled=!1}),50)}}function s(t){32===(t.which||t.keyCode)&&t.target===document.activeElement&&n(t)}function c(t){32===(t.which||t.keyCode)&&t.preventDefault()}function r(t){if("INPUT"===t.target.tagName){var e="focusin"===t.type?"add":"remove";t.target.closest(".btn").classList[e]("focus")}}function d(e){t[e=e?"addEventListener":"removeEventListener"]("click",n,!1),t[e]("keyup",s,!1),t[e]("keydown",c,!1),t[e]("focusin",r,!1),t[e]("focusout",r,!1)}this.dispose=function(){d(),delete t.Button},(t=a(t)).Button&&t.Button.dispose(),(e=t.getElementsByClassName("btn")).length&&(t.Button||d(1),t.toggled=!1,t.Button=this,Array.from(e).map((function(t){!t.classList.contains("active")&&a("input:checked",t)&&t.classList.add("active"),t.classList.contains("active")&&!a("input:checked",t)&&t.classList.remove("active")})))}var d="onmouseleave"in document?["mouseenter","mouseleave"]:["mouseover","mouseout"],u=!!function(){var t=!1;try{var e=Object.defineProperty({},"passive",{get:function(){t=!0}});document.addEventListener("DOMContentLoaded",(function t(){document.removeEventListener("DOMContentLoaded",t,e)}),e)}catch(t){}return t}()&&{passive:!0};function m(t,e){e=e||{};var i,c,r,m,f,g,h,p,v,L=this;function b(){!1===c.interval||t.classList.contains("paused")||(t.classList.add("paused"),!i.isSliding&&(clearInterval(i.timer),i.timer=null))}function y(){!1!==c.interval&&t.classList.contains("paused")&&(t.classList.remove("paused"),!i.isSliding&&(clearInterval(i.timer),i.timer=null),!i.isSliding&&L.cycle())}function w(t){if(t.preventDefault(),!i.isSliding){var e=t.target;if(!e||e.classList.contains("active")||!e.getAttribute("data-slide-to"))return!1;i.index=parseInt(e.getAttribute("data-slide-to")),L.slideTo(i.index)}}function A(t){if(t.preventDefault(),!i.isSliding){var e=t.currentTarget||t.srcElement;e===h?i.index++:e===g&&i.index--,L.slideTo(i.index)}}function T(t){var e=t.which;if(!i.isSliding){switch(e){case 39:i.index++;break;case 37:i.index--;break;default:return}L.slideTo(i.index)}}function E(e){e=e?"addEventListener":"removeEventListener",c.pause&&c.interval&&(t[e](d[0],b,!1),t[e](d[1],y,!1),t[e]("touchstart",b,u),t[e]("touchend",y,u)),c.touch&&f.length>1&&t[e]("touchstart",C,u),h&&h[e]("click",A,!1),g&&g[e]("click",A,!1),p&&p[e]("click",w,!1),c.keyboard&&window[e]("keydown",T,!1)}function k(e){t[e=e?"addEventListener":"removeEventListener"]("touchmove",x,u),t[e]("touchend",N,u)}function C(e){i.isTouch||(i.touchPosition.startX=e.changedTouches[0].pageX,t.contains(e.target)&&(i.isTouch=!0,k(1)))}function x(t){if(i.isTouch)return i.touchPosition.currentX=t.changedTouches[0].pageX,"touchmove"===t.type&&t.changedTouches.length>1?(t.preventDefault(),!1):void 0;t.preventDefault()}function N(e){if(i.isTouch&&!i.isSliding&&(i.touchPosition.endX=i.touchPosition.currentX||e.changedTouches[0].pageX,i.isTouch)){if((!t.contains(e.target)||!t.contains(e.relatedTarget))&&Math.abs(i.touchPosition.startX-i.touchPosition.endX)<75)return!1;i.touchPosition.currentX<i.touchPosition.startX?i.index++:i.touchPosition.currentX>i.touchPosition.startX&&i.index--,i.isTouch=!1,L.slideTo(i.index),k()}}function P(t){Array.from(v).map((function(t){t.classList.remove("active")})),v[t]&&v[t].classList.add("active")}function B(e){if(i.touchPosition){var n=i.index,s=e&&e.target!==f[n]?1e3*e.elapsedTime+100:20,a=L.getActiveIndex(),o="left"===i.direction?"next":"prev";i.isSliding&&setTimeout((function(){i.touchPosition&&(i.isSliding=!1,f[n].classList.add("active"),f[a].classList.remove("active"),f[n].classList.remove("carousel-item-"+o),f[n].classList.remove("carousel-item-"+i.direction),f[a].classList.remove("carousel-item-"+i.direction),l.call(t,m),document.hidden||!c.interval||t.classList.contains("paused")||L.cycle())}),s)}}if(L.cycle=function(){i.timer&&(clearInterval(i.timer),i.timer=null),i.timer=setInterval((function(){var e=i.index||L.getActiveIndex();(function(t){var e=t.getBoundingClientRect(),i=window.innerHeight||document.documentElement.clientHeight;return e.top<=i&&e.bottom>=0})(t)&&(e++,L.slideTo(e))}),c.interval)},L.slideTo=function(e){if(!i.isSliding){var a,d=L.getActiveIndex();d!==e&&(d<e||0===d&&e===f.length-1?i.direction="left":(d>e||d===f.length-1&&0===e)&&(i.direction="right"),e<0?e=f.length-1:e>=f.length&&(e=0),a="left"===i.direction?"next":"prev",r=o("slide","carousel",f[e]),m=o("slid","carousel",f[e]),l.call(t,r),r.defaultPrevented||(i.index=e,i.isSliding=!0,clearInterval(i.timer),i.timer=null,P(e),n(f[e])&&t.classList.contains("slide")?(f[e].classList.add("carousel-item-"+a),f[e].offsetWidth,f[e].classList.add("carousel-item-"+i.direction),f[d].classList.add("carousel-item-"+i.direction),s(f[e],B)):(f[e].classList.add("active"),f[e].offsetWidth,f[d].classList.remove("active"),setTimeout((function(){i.isSliding=!1,c.interval&&t&&!t.classList.contains("paused")&&L.cycle(),l.call(t,m)}),100))))}},L.getActiveIndex=function(){return Array.from(f).indexOf(t.getElementsByClassName("carousel-item active")[0])||0},L.dispose=function(){var e=["left","right","prev","next"];Array.from(f).map((function(t,i){t.classList.contains("active")&&P(i),e.map((function(e){return t.classList.remove("carousel-item-"+e)}))})),clearInterval(i.timer),E(),i={},c={},delete t.Carousel},(t=a(t)).Carousel&&t.Carousel.dispose(),f=t.getElementsByClassName("carousel-item"),g=t.getElementsByClassName("carousel-control-prev")[0],h=t.getElementsByClassName("carousel-control-next")[0],p=t.getElementsByClassName("carousel-indicators")[0],v=p&&p.getElementsByTagName("LI")||[],!(f.length<2)){var S=t.getAttribute("data-interval"),H="false"===S?0:parseInt(S),M="false"===t.getAttribute("data-touch")?0:1,I="hover"===t.getAttribute("data-pause")||!1,D="true"===t.getAttribute("data-keyboard")||!1,X=e.interval,W=e.touch;(c={}).keyboard=!0===e.keyboard||D,c.pause=!("hover"!==e.pause&&!I)&&"hover",c.touch=W||M,c.interval="number"==typeof X?X:!1===X||0===H||!1===H?0:isNaN(H)?5e3:H,L.getActiveIndex()<0&&(f.length&&f[0].classList.add("active"),v.length&&P(0)),(i={}).direction="left",i.index=0,i.timer=null,i.isSliding=!1,i.isTouch=!1,i.touchPosition={startX:0,currentX:0,endX:0},E(1),c.interval&&L.cycle(),t.Carousel=L}}function f(t,e){e=e||{};var i,n,c,r,d,u,m=this,f=null,g=null;function h(t,e){l.call(t,d),d.defaultPrevented||(t.isAnimating=!0,t.style.height=t.scrollHeight+"px",t.classList.remove("collapse"),t.classList.remove("show"),t.classList.add("collapsing"),t.offsetWidth,t.style.height="0px",s(t,(function(){t.isAnimating=!1,t.setAttribute("aria-expanded","false"),e.setAttribute("aria-expanded","false"),t.classList.remove("collapsing"),t.classList.add("collapse"),t.style.height="",l.call(t,u)})))}m.toggle=function(e){(e&&"A"===e.target.tagName||"A"===t.tagName)&&e.preventDefault(),(t.contains(e.target)||e.target===t)&&(g.classList.contains("show")?m.hide():m.show())},m.hide=function(){g.isAnimating||(h(g,t),t.classList.add("collapsed"))},m.show=function(){var e,o;f&&(i=f.getElementsByClassName("collapse show")[0],n=i&&(a('[data-target="#'+i.id+'"]',f)||a('[href="#'+i.id+'"]',f))),g.isAnimating||(n&&i!==g&&(h(i,n),n.classList.add("collapsed")),e=g,o=t,l.call(e,c),c.defaultPrevented||(e.isAnimating=!0,e.classList.add("collapsing"),e.classList.remove("collapse"),e.style.height=e.scrollHeight+"px",s(e,(function(){e.isAnimating=!1,e.setAttribute("aria-expanded","true"),o.setAttribute("aria-expanded","true"),e.classList.remove("collapsing"),e.classList.add("collapse"),e.classList.add("show"),e.style.height="",l.call(e,r)}))),t.classList.remove("collapsed"))},m.dispose=function(){t.removeEventListener("click",m.toggle,!1),delete t.Collapse},(t=a(t)).Collapse&&t.Collapse.dispose();var p=t.getAttribute("data-parent");c=o("show","collapse"),r=o("shown","collapse"),d=o("hide","collapse"),u=o("hidden","collapse"),(g=a(e.target||t.getAttribute("data-target")||t.getAttribute("href"))).isAnimating=!1,f=t.closest(e.parent||p),t.Collapse||t.addEventListener("click",m.toggle,!1),t.Collapse=m}function g(t){t.focus?t.focus():t.setActive()}function h(t,e){var i,n,s,c,r,d,u,m=this,f=null,h=[];function p(t){(t.href&&"#"===t.href.slice(-1)||t.parentNode&&t.parentNode.href&&"#"===t.parentNode.href.slice(-1))&&this.preventDefault()}function v(){var e=t.open?"addEventListener":"removeEventListener";document[e]("click",L,!1),document[e]("keydown",y,!1),document[e]("keyup",w,!1),document[e]("focus",L,!1)}function L(e){var i=e.target,n=i&&(i.getAttribute("data-toggle")||i.parentNode&&i.parentNode.getAttribute&&i.parentNode.getAttribute("data-toggle"));("focus"!==e.type||i!==t&&i!==d&&!d.contains(i))&&(i!==d&&!d.contains(i)||!u&&!n)&&(f=i===t||t.contains(i)?t:null,m.hide(),p.call(e,i))}function b(e){f=t,m.show(),p.call(e,e.target)}function y(t){var e=t.which||t.keyCode;38!==e&&40!==e||t.preventDefault()}function w(e){var i=e.which||e.keyCode,n=document.activeElement,s=n===t,a=d.contains(n),o=n.parentNode===d||n.parentNode.parentNode===d,l=h.indexOf(n);o&&(l=s?0:38===i?l>1?l-1:0:40===i&&l<h.length-1?l+1:l,h[l]&&g(h[l])),(h.length&&o||!h.length&&(a||s)||!a)&&t.open&&27===i&&(m.toggle(),f=null)}m.show=function(){i=o("show","dropdown",f),l.call(r,i),i.defaultPrevented||(d.classList.add("show"),r.classList.add("show"),t.setAttribute("aria-expanded",!0),t.open=!0,t.removeEventListener("click",b,!1),setTimeout((function(){g(d.getElementsByTagName("INPUT")[0]||t),v(),n=o("shown","dropdown",f),l.call(r,n)}),1))},m.hide=function(){s=o("hide","dropdown",f),l.call(r,s),s.defaultPrevented||(d.classList.remove("show"),r.classList.remove("show"),t.setAttribute("aria-expanded",!1),t.open=!1,v(),g(t),setTimeout((function(){t.Dropdown&&t.addEventListener("click",b,!1)}),1),c=o("hidden","dropdown",f),l.call(r,c))},m.toggle=function(){r.classList.contains("show")&&t.open?m.hide():m.show()},m.dispose=function(){r.classList.contains("show")&&t.open&&m.hide(),t.removeEventListener("click",b,!1),delete t.Dropdown},(t=a(t)).Dropdown&&t.Dropdown.dispose(),r=t.parentNode,d=a(".dropdown-menu",r),Array.from(d.children).map((function(t){t.children.length&&"A"===t.children[0].tagName&&h.push(t.children[0]),"A"===t.tagName&&h.push(t)})),t.Dropdown||(!("tabindex"in d)&&d.setAttribute("tabindex","0"),t.addEventListener("click",b,!1)),u=!0===e||"true"===t.getAttribute("data-persist")||!1,t.open=!1,t.Dropdown=m}function p(t,e){e=e||{};var i,c,r,d,m,f,h,p,v,L=this,b=null,y={};function w(){var t,e,n=document.body.classList.contains("modal-open"),s=parseInt(getComputedStyle(document.body).paddingRight),a=document.documentElement.clientHeight!==document.documentElement.scrollHeight||document.body.clientHeight!==document.body.scrollHeight,o=i.clientHeight!==i.scrollHeight;(e=document.createElement("div")).className="modal-scrollbar-measure",document.body.appendChild(e),t=e.offsetWidth-e.clientWidth,document.body.removeChild(e),f=t,i.style.paddingRight=!o&&f?f+"px":"",document.body.style.paddingRight=o||a?s+(n?0:f)+"px":"",v.length&&v.map((function(t){var e=getComputedStyle(t).paddingRight;t.style.paddingRight=o||a?parseInt(e)+(n?0:f)+"px":parseInt(e)+"px"}))}function A(){(h=a(".modal-backdrop"))&&!document.getElementsByClassName("modal show")[0]&&(document.body.removeChild(h),h=null),null===h&&(document.body.classList.remove("modal-open"),document.body.style.paddingRight="",i.style.paddingRight="",v.length&&v.map((function(t){t.style.paddingRight=""})))}function T(t){t=t?"addEventListener":"removeEventListener",window[t]("resize",L.update,u),i[t]("click",P,!1),document[t]("keydown",N,!1)}function E(){i.style.display="block",w(),!document.getElementsByClassName("modal show")[0]&&document.body.classList.add("modal-open"),i.classList.add("show"),i.setAttribute("aria-hidden",!1),i.classList.contains("fade")?s(i,k):k()}function k(){g(i),i.isAnimating=!1,T(1),r=o("shown","modal",b),l.call(i,r)}function C(e){i.style.display="",t&&g(t),h=a(".modal-backdrop"),1!==e&&h&&h.classList.contains("show")&&!document.getElementsByClassName("modal show")[0]?(h.classList.remove("show"),s(h,A)):A(),T(),i.isAnimating=!1,m=o("hidden","modal"),l.call(i,m)}function x(e){if(!i.isAnimating){var n=e.target,s="#"+i.getAttribute("id"),a=n.getAttribute("data-target")||n.getAttribute("href"),o=t.getAttribute("data-target")||t.getAttribute("href");!i.classList.contains("show")&&(n===t&&a===s||t.contains(n)&&o===s)&&(i.modalTrigger=t,b=t,L.show(),e.preventDefault())}}function N(t){var e=t.which;!i.isAnimating&&y.keyboard&&27==e&&i.classList.contains("show")&&L.hide()}function P(t){if(!i.isAnimating){var e=t.target,n="modal"===e.getAttribute("data-dismiss"),s=e.closest('[data-dismiss="modal"]');i.classList.contains("show")&&(s||n||e===i&&"static"!==y.backdrop)&&(L.hide(),b=null,t.preventDefault())}}L.toggle=function(){i.classList.contains("show")?L.hide():L.show()},L.show=function(){if(!(i.classList.contains("show")&&i.isAnimating||(c=o("show","modal",b),l.call(i,c),c.defaultPrevented))){i.isAnimating=!0;var t,e=document.getElementsByClassName("modal show")[0];e&&e!==i&&(e.modalTrigger&&e.modalTrigger.Modal.hide(),e.Modal&&e.Modal.hide()),y.backdrop&&(t=document.createElement("div"),null===(h=a(".modal-backdrop"))&&(t.setAttribute("class","modal-backdrop"+(y.animation?" fade":"")),h=t,document.body.appendChild(h)),h=h),!h||e||h.classList.contains("show")||(h.offsetWidth,p=n(h),h.classList.add("show")),e?E():setTimeout(E,h&&p?p:0)}},L.hide=function(t){i.classList.contains("show")&&(d=o("hide","modal"),l.call(i,d),d.defaultPrevented||(i.isAnimating=!0,i.classList.remove("show"),i.setAttribute("aria-hidden",!0),i.classList.contains("fade")&&1!==t?s(i,C):C()))},L.setContent=function(t){a(".modal-content",i).innerHTML=t},L.update=function(){i.classList.contains("show")&&w()},L.dispose=function(){L.hide(1),t?(t.removeEventListener("click",x,!1),delete t.Modal):delete i.Modal},t=a(t);var B=a(t.getAttribute("data-target")||t.getAttribute("href"));i=t.classList.contains("modal")?t:B,v=Array.from(document.getElementsByClassName("fixed-top")).concat(Array.from(document.getElementsByClassName("fixed-bottom"))),t.classList.contains("modal")&&(t=null),t&&t.Modal&&t.Modal.dispose(),i&&i.Modal&&i.Modal.dispose(),y.keyboard=!1!==e.keyboard&&"false"!==i.getAttribute("data-keyboard"),y.backdrop="static"!==e.backdrop&&"static"!==i.getAttribute("data-backdrop")||"static",y.backdrop=!1!==e.backdrop&&"false"!==i.getAttribute("data-backdrop")&&y.backdrop,y.animation=!!i.classList.contains("fade"),y.content=e.content,i.isAnimating=!1,t&&!t.Modal&&t.addEventListener("click",x,!1),y.content&&L.setContent(y.content.trim()),t?(i.modalTrigger=t,t.Modal=L):i.Modal=L}var v="mousedown";function L(){return{y:window.pageYOffset||document.documentElement.scrollTop,x:window.pageXOffset||document.documentElement.scrollLeft}}function b(t,e,i,n){var s,a,o,l,c,r,d=e.offsetWidth,u=e.offsetHeight,m=document.documentElement.clientWidth||document.body.clientWidth,f=document.documentElement.clientHeight||document.body.clientHeight,g=t.getBoundingClientRect(),h=n===document.body?L():{x:n.offsetLeft+n.scrollLeft,y:n.offsetTop+n.scrollTop},p=g.right-g.left,v=g.bottom-g.top,b=e.classList.contains("popover"),y=e.getElementsByClassName("arrow")[0],w=g.top+v/2-u/2<0,A=g.left+p/2-d/2<0,T=g.left+d/2+p/2>=m,E=g.top+u/2+v/2>=f,k=g.top-u<0,C=g.left-d<0,x=g.top+u+v>=f,N=g.left+d+p>=m;i="right"===(i="left"===(i="bottom"===(i="top"===(i=("left"===i||"right"===i)&&C&&N?"top":i)&&k?"bottom":i)&&x?"top":i)&&C?"right":i)&&N?"left":i,-1===e.className.indexOf(i)&&(e.className=e.className.replace(/\b(top|bottom|left|right)+/,i)),c=y.offsetWidth,r=y.offsetHeight,"left"===i||"right"===i?(a="left"===i?g.left+h.x-d-(b?c:0):g.left+h.x+p,w?(s=g.top+h.y,o=v/2-c):E?(s=g.top+h.y-u+v,o=u-v/2-c):(s=g.top+h.y-u/2+v/2,o=u/2-(b?.9*r:r/2))):"top"!==i&&"bottom"!==i||(s="top"===i?g.top+h.y-u-(b?r:0):g.top+h.y+v,A?(a=0,l=g.left+p/2-c):T?(a=m-1.01*d,l=d-(m-g.left)+p/2-c/2):(a=g.left+h.x-d/2+p/2,l=d/2-(b?c:c/2))),e.style.top=s+"px",e.style.left=a+"px",o&&(y.style.top=o+"px"),l&&(y.style.left=l+"px")}function y(t,e){e=e||{};var i,n,c,r,m,f,g,h,p,L,y,w,A,T,E,k,C,x,N,P=this,B=null,S=0,H=/(iPhone|iPod|iPad)/.test(navigator.userAgent),M={};function I(t){null!==B&&t.target===a(".close",B)&&P.hide()}function D(){return{0:e.title||t.getAttribute("data-title")||null,1:e.content||t.getAttribute("data-content")||null}}function X(){null===B&&t.focus()}function W(e){e=e?"addEventListener":"removeEventListener","hover"===M.trigger?(t[e](v,P.show),t[e](d[0],P.show),M.dismissible||t[e](d[1],P.hide)):"click"==M.trigger?t[e](M.trigger,P.toggle):"focus"==M.trigger&&(H&&t[e]("click",X,!1),t[e](M.trigger,P.toggle))}function O(e){B&&B.contains(e.target)||e.target===t||t.contains(e.target)||P.hide()}function R(e){e=e?"addEventListener":"removeEventListener",M.dismissible?document[e]("click",I,!1):("focus"==M.trigger&&t[e]("blur",P.hide),"hover"==M.trigger&&document[e]("touchstart",O,u)),window[e]("resize",P.hide,u)}function z(){R(1),l.call(t,y)}function U(){R(),M.container.removeChild(B),S=null,B=null,l.call(t,A)}P.toggle=function(){null===B?P.show():P.hide()},P.show=function(){clearTimeout(S),S=setTimeout((function(){if(null===B){if(l.call(t,L),L.defaultPrevented)return;!function(){i=D()[0]||null,n=(n=D()[1])?n.trim():null,B=document.createElement("div");var t=document.createElement("div");if(t.classList.add("arrow"),B.appendChild(t),null!==n&&null===M.template){if(B.setAttribute("role","tooltip"),null!==i){var e=document.createElement("h3");e.classList.add("popover-header"),e.innerHTML=M.dismissible?i+p:i,B.appendChild(e)}var s=document.createElement("div");s.classList.add("popover-body"),s.innerHTML=M.dismissible&&null===i?n+p:n,B.appendChild(s)}else{var o=document.createElement("div");o.innerHTML=M.template.trim(),B.className=o.firstChild.className,B.innerHTML=o.firstChild.innerHTML;var l=a(".popover-header",B),c=a(".popover-body",B);i&&l&&(l.innerHTML=i.trim()),n&&c&&(c.innerHTML=n.trim())}M.container.appendChild(B),B.style.display="block",!B.classList.contains("popover")&&B.classList.add("popover"),!B.classList.contains(M.animation)&&B.classList.add(M.animation),!B.classList.contains(N)&&B.classList.add(N)}(),b(t,B,M.placement,M.container),!B.classList.contains("show")&&B.classList.add("show"),M.animation?s(B,z):z()}}),20)},P.hide=function(){clearTimeout(S),S=setTimeout((function(){if(B&&null!==B&&B.classList.contains("show")){if(l.call(t,w),w.defaultPrevented)return;B.classList.remove("show"),M.animation?s(B,U):U()}}),M.delay)},P.dispose=function(){P.hide(),W(),delete t.Popover},(t=a(t)).Popover&&t.Popover.dispose(),c=t.getAttribute("data-trigger"),r=t.getAttribute("data-animation"),m=t.getAttribute("data-placement"),f=t.getAttribute("data-dismissible"),g=t.getAttribute("data-delay"),h=t.getAttribute("data-container"),p='<button type="button" class="close">×</button>',L=o("show","popover"),y=o("shown","popover"),w=o("hide","popover"),A=o("hidden","popover"),T=a(e.container),E=a(h),k=t.closest(".modal"),C=t.closest(".fixed-top"),x=t.closest(".fixed-bottom"),M.template=e.template?e.template:null,M.trigger=e.trigger?e.trigger:c||"hover",M.animation=e.animation&&"fade"!==e.animation?e.animation:r||"fade",M.placement=e.placement?e.placement:m||"top",M.delay=parseInt(e.delay||g)||200,M.dismissible=!(!e.dismissible&&"true"!==f),M.container=T||(E||(C||(x||(k||document.body)))),N="bs-popover-"+M.placement;var q=D();i=q[0],((n=q[1])||M.template)&&(t.Popover||W(1),t.Popover=P)}function w(t,e){e=e||{};var i,n,s,c,r,d=this,m={};function f(){var e;e=c.getElementsByTagName("A"),i.length!==e.length&&(i.items=[],i.targets=[],Array.from(e).map((function(t){var e=t.getAttribute("href"),n=e&&"#"===e.charAt(0)&&"#"!==e.slice(-1)&&a(e);n&&(i.items.push(t),i.targets.push(n))})),i.length=e.length),i.scrollOffset=i.isWindow?L().y:t.scrollTop,i.items.map((function(e,n){return function(e){var n=i.items[e],s=i.targets[e],a=n.classList.contains("dropdown-item")&&n.closest(".dropdown-menu"),c=a&&a.previousElementSibling,r=n.nextElementSibling,d=r&&r.getElementsByClassName("active").length,u=i.isWindow&&s.getBoundingClientRect(),f=n.classList.contains("active")||!1,g=(i.isWindow?u.top+i.scrollOffset:s.offsetTop)-m.offset,h=i.isWindow?u.bottom+i.scrollOffset-m.offset:i.targets[e+1]?i.targets[e+1].offsetTop-m.offset:t.scrollHeight,p=d||i.scrollOffset>=g&&h>i.scrollOffset;if(!f&&p)n.classList.add("active"),c&&!c.classList.contains("active")&&c.classList.add("active"),l.call(t,o("activate","scrollspy",i.items[e]));else if(f&&!p)n.classList.remove("active"),c&&c.classList.contains("active")&&!n.parentNode.getElementsByClassName("active").length&&c.classList.remove("active");else if(f&&p||!p&&!f)return}(n)}))}function g(t){r[t=t?"addEventListener":"removeEventListener"]("scroll",d.refresh,u),window[t]("resize",d.refresh,u)}d.refresh=function(){f()},d.dispose=function(){g(),delete t.ScrollSpy},(t=a(t)).ScrollSpy&&t.ScrollSpy.dispose(),n=t.getAttribute("data-target"),s=t.getAttribute("data-offset"),c=a(e.target||n),r=t.offsetHeight<t.scrollHeight?t:window,c&&(m.target=c,m.offset=parseInt(e.offset||s)||10,(i={}).length=0,i.items=[],i.targets=[],i.isWindow=r===window,t.ScrollSpy||g(1),d.refresh(),t.ScrollSpy=d)}function A(t,i){i=i||{};var n,c,r,d,u,m,f,g,h,p,v,L,b,y,w,A=this,T=!1;function E(){T.style.height="",T.classList.remove("collapsing"),c.isAnimating=!1}function k(){T?b?E():setTimeout((function(){T.style.height=y+"px",T.offsetWidth,s(T,E)}),50):c.isAnimating=!1,u=o("shown","tab",h),l.call(g,u)}function C(){T&&(p.style.float="left",v.style.float="left",L=p.scrollHeight),d=o("show","tab",h),f=o("hidden","tab",g),l.call(g,d),d.defaultPrevented||(v.classList.add("active"),p.classList.remove("active"),T&&(y=v.scrollHeight,b=y===L,T.classList.add("collapsing"),T.style.height=L+"px",T.offsetHeight,p.style.float="",v.style.float=""),v.classList.contains("fade")?setTimeout((function(){v.classList.add("show"),s(v,k)}),20):k(),l.call(h,f))}function x(){var t,e=c.getElementsByClassName("active");return 1!==e.length||e[0].parentNode.classList.contains("dropdown")?e.length>1&&(t=e[e.length-1]):t=e[0],t}function N(){return a(x().getAttribute("href"))}function P(t){t.preventDefault(),g=t.currentTarget,!c.isAnimating&&A.show()}A.show=function(){if(!(g=g||t).classList.contains("active")){if(v=a(g.getAttribute("href")),h=x(),p=N(),m=o("hide","tab",g),l.call(h,m),m.defaultPrevented)return;c.isAnimating=!0,h.classList.remove("active"),h.setAttribute("aria-selected","false"),g.classList.add("active"),g.setAttribute("aria-selected","true"),r&&(t.parentNode.classList.contains("dropdown-menu")?r.classList.contains("active")||r.classList.add("active"):r.classList.contains("active")&&r.classList.remove("active")),p.classList.contains("fade")?(p.classList.remove("show"),s(p,C)):C()}},A.dispose=function(){t.removeEventListener("click",P,!1),delete t.Tab},(t=a(t)).Tab&&t.Tab.dispose(),n=t.getAttribute("data-height"),c=t.closest(".nav"),r=c&&a(".dropdown-toggle",c),w=!(!e||!1===i.height||"false"===n),c.isAnimating=!1,t.Tab||t.addEventListener("click",P,!1),w&&(T=N().parentNode),t.Tab=A}function T(t,e){e=e||{};var i,n,c,r,d,u,m,f,g=this,h=0,p={};function v(){i.classList.remove("showing"),i.classList.add("show"),l.call(i,m),p.autohide&&g.hide()}function L(){i.classList.add("hide"),l.call(i,f)}function b(){i.classList.remove("show"),p.animation?s(i,L):L()}function y(){clearTimeout(h),t.removeEventListener("click",g.hide,!1),delete t.Toast}g.show=function(){if(i&&!i.classList.contains("show")){if(l.call(i,d),d.defaultPrevented)return;p.animation&&i.classList.add("fade"),i.classList.remove("hide"),i.offsetWidth,i.classList.add("showing"),p.animation?s(i,v):v()}},g.hide=function(t){if(i&&i.classList.contains("show")){if(l.call(i,u),u.defaultPrevented)return;t?b():h=setTimeout(b,p.delay)}},g.dispose=function(){p.animation?s(i,y):y()},(t=a(t)).Toast&&t.Toast.dispose(),i=t.closest(".toast"),n=t.getAttribute("data-animation"),c=t.getAttribute("data-autohide"),r=t.getAttribute("data-delay"),d=o("show","toast"),u=o("hide","toast"),m=o("shown","toast"),f=o("hidden","toast"),p.animation=!1===e.animation||"false"===n?0:1,p.autohide=!1===e.autohide||"false"===c?0:1,p.delay=parseInt(e.delay||r)||500,t.Toast||t.addEventListener("click",g.hide,!1),t.Toast=g}function E(t,e){e=e||{};var i,n,c,r,m,f,g,h,p,L,y,w,A,T,E,k=this,C=null,x=0,N={};function P(){return t.getAttribute("title")||t.getAttribute("data-title")||t.getAttribute("data-original-title")}function B(e){C&&C.contains(e.target)||e.target===t||t.contains(e.target)||k.hide()}function S(t){t=t?"addEventListener":"removeEventListener",document[t]("touchstart",B,u),window[t]("resize",k.hide,u)}function H(){S(1),l.call(t,g)}function M(){S(),N.container.removeChild(C),C=null,x=null,l.call(t,p)}function I(e){t[e=e?"addEventListener":"removeEventListener"](v,k.show,!1),t[e](d[0],k.show,!1),t[e](d[1],k.hide,!1)}k.show=function(){clearTimeout(x),x=setTimeout((function(){if(null===C){if(l.call(t,f),f.defaultPrevented)return;!1!==function(){if(i=P()){if(C=document.createElement("div"),N.template){var t=document.createElement("div");t.innerHTML=N.template.trim(),C.className=t.firstChild.className,C.innerHTML=t.firstChild.innerHTML,a(".tooltip-inner",C).innerHTML=i.trim()}else{var e=document.createElement("div");e.classList.add("arrow"),C.appendChild(e);var n=document.createElement("div");n.classList.add("tooltip-inner"),C.appendChild(n),n.innerHTML=i}C.style.left="0",C.style.top="0",C.setAttribute("role","tooltip"),!C.classList.contains("tooltip")&&C.classList.add("tooltip"),!C.classList.contains(N.animation)&&C.classList.add(N.animation),!C.classList.contains(E)&&C.classList.add(E),N.container.appendChild(C)}}()&&(b(t,C,N.placement,N.container),!C.classList.contains("show")&&C.classList.add("show"),N.animation?s(C,H):H())}}),20)},k.hide=function(){clearTimeout(x),x=setTimeout((function(){if(C&&C.classList.contains("show")){if(l.call(t,h),h.defaultPrevented)return;C.classList.remove("show"),N.animation?s(C,M):M()}}),N.delay)},k.toggle=function(){C?k.hide():k.show()},k.dispose=function(){I(),k.hide(),t.setAttribute("title",t.getAttribute("data-original-title")),t.removeAttribute("data-original-title"),delete t.Tooltip},(t=a(t)).Tooltip&&t.Tooltip.dispose(),n=t.getAttribute("data-animation"),c=t.getAttribute("data-placement"),r=t.getAttribute("data-delay"),m=t.getAttribute("data-container"),f=o("show","tooltip"),g=o("shown","tooltip"),h=o("hide","tooltip"),p=o("hidden","tooltip"),L=a(e.container),y=a(m),w=t.closest(".modal"),A=t.closest(".fixed-top"),T=t.closest(".fixed-bottom"),N.animation=e.animation&&"fade"!==e.animation?e.animation:n||"fade",N.placement=e.placement?e.placement:c||"top",N.template=e.template?e.template:null,N.delay=parseInt(e.delay||r)||200,N.container=L||(y||(A||(T||(w||document.body)))),E="bs-tooltip-"+N.placement,(i=P())&&(t.Tooltip||(t.setAttribute("data-original-title",i),t.removeAttribute("title"),I(1)),t.Tooltip=k)}var k={};function C(t,e){Array.from(e).map((function(e){return new t(e)}))}function x(t){for(var e in t=t||document,k)C(k[e][0],t.querySelectorAll(k[e][1]))}function N(t,e){Array.from(e).map((function(e){return e[t].dispose()}))}k.Alert=[c,'[data-dismiss="alert"]'],k.Button=[r,'[data-toggle="buttons"]'],k.Carousel=[m,'[data-ride="carousel"]'],k.Collapse=[f,'[data-toggle="collapse"]'],k.Dropdown=[h,'[data-toggle="dropdown"]'],k.Modal=[p,'[data-toggle="modal"]'],k.Popover=[y,'[data-toggle="popover"],[data-tip="popover"]'],k.ScrollSpy=[w,'[data-spy="scroll"]'],k.Tab=[A,'[data-toggle="tab"]'],k.Toast=[T,'[data-dismiss="toast"]'],k.Tooltip=[E,'[data-toggle="tooltip"],[data-tip="tooltip"]'],document.body?x():document.addEventListener("DOMContentLoaded",(function t(){x(),document.removeEventListener("DOMContentLoaded",t,!1)}),!1);var P={Alert:c,Button:r,Carousel:m,Collapse:f,Dropdown:h,Modal:p,Popover:y,ScrollSpy:w,Tab:A,Toast:T,Tooltip:E,initCallback:x,removeDataAPI:function(t){for(var e in t=t||document,k)N(e,t.querySelectorAll(k[e][1]))},componentsInit:k,Version:"3.0.5"};export default P; |
// Native JavaScript for Bootstrap v3.0.5 | 2020 © dnp_theme | MIT-License | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t=t||self).BSN=e()}(this,(function(){"use strict";function t(t,e){return t.classList.contains(e)}function e(t,e){t.classList.remove(e)}function i(t,e,i,n){n=n||!1,t.addEventListener(e,i,n)}function n(t,e,i,n){n=n||!1,t.removeEventListener(e,i,n)}function o(t,e,o,a){i(t,e,(function i(l){l.target===t&&(o(l),n(t,e,i,a))}),a)}var a="webkitTransition"in document.body.style?"webkitTransitionEnd":"transitionend",l="webkitTransition"in document.body.style||"transition"in document.body.style,r="webkitTransition"in document.body.style?"webkitTransitionDuration":"transitionDuration";function c(t){var e=l?window.getComputedStyle(t)[r]:0;return e="number"!=typeof(e=parseFloat(e))||isNaN(e)?0:1e3*e}function s(t,e){var i=0;c(t)?o(t,a,(function(t){!i&&e(t),i=1})):setTimeout((function(){!i&&e(),i=1}),17)}function d(t,e){var i=e&&e instanceof Element?e:document;return t instanceof Element?t:i.querySelector(t)}function u(t,e,i){var n=new CustomEvent(t+".bs."+e,{cancelable:!0});return n.relatedTarget=i,n}function f(t){this&&this.dispatchEvent(t)}function m(o){var a,l=this,r=u("close","alert"),c=u("closed","alert");function m(t){a=t&&t.target.closest(".alert"),(o=d('[data-dismiss="alert"]',a))&&a&&(o===t.target||o.contains(t.target))&&l.close()}function g(){n(o,"click",m),a.parentNode.removeChild(a),f.call(a,c)}l.close=function(){if(a&&o&&t(a,"show")){if(f.call(a,r),r.defaultPrevented)return;l.dispose(),e(a,"show"),t(a,"fade")?s(a,g):g()}},l.dispose=function(){n(o,"click",m),delete o.Alert},o=d(o),a=o.closest(".alert"),o.Alert&&o.Alert.dispose(),o.Alert||i(o,"click",m),l.element=o,o.Alert=l}function g(t,e){t.classList.add(e)}function h(o){var a,l=u("change","button");function r(i){var n,r="LABEL"===i.target.tagName?i.target:i.target.closest("LABEL")?i.target.closest("LABEL"):null;if(n=r&&r.getElementsByTagName("INPUT")[0]){if(f.call(n,l),f.call(o,l),"checkbox"===n.type){if(l.defaultPrevented)return;n.checked?(e(r,"active"),n.getAttribute("checked"),n.removeAttribute("checked"),n.checked=!1):(g(r,"active"),n.getAttribute("checked"),n.setAttribute("checked","checked"),n.checked=!0),o.toggled||(o.toggled=!0)}if("radio"===n.type&&!o.toggled){if(l.defaultPrevented)return;(!n.checked||0===i.screenX&&0==i.screenY)&&(g(r,"active"),g(r,"focus"),n.setAttribute("checked","checked"),n.checked=!0,o.toggled=!0,Array.from(a).map((function(i){var n=i.getElementsByTagName("INPUT")[0];i!==r&&t(i,"active")&&(f.call(n,l),e(i,"active"),n.removeAttribute("checked"),n.checked=!1)})))}setTimeout((function(){o.toggled=!1}),50)}}function c(t){32===(t.which||t.keyCode)&&t.target===document.activeElement&&r(t)}function s(t){32===(t.which||t.keyCode)&&t.preventDefault()}function m(t){var i="focusin"===t.type?g:e;"INPUT"===t.target.tagName&&i(t.target.closest(".btn"),"focus")}function h(t){t(o,"click",r),t(o,"keyup",c),t(o,"keydown",s),t(o,"focusin",m),t(o,"focusout",m)}this.dispose=function(){h(n),delete o.Button},(o=d(o)).Button&&o.Button.dispose(),(a=o.getElementsByClassName("btn")).length&&(o.Button||h(i),o.toggled=!1,o.Button=this,Array.from(a).map((function(i){!t(i,"active")&&d("input:checked",i)&&g(i,"active"),t(i,"active")&&!d("input:checked",i)&&e(i,"active")})))}var p="touchstart",v="touchend",b="touchmove",y="onmouseleave"in document?["mouseenter","mouseleave"]:["mouseover","mouseout"],w=!!function(){var t=!1;try{var e=Object.defineProperty({},"passive",{get:function(){t=!0}});o(document,"DOMContentLoaded",(function(){}),e)}catch(t){}return t}()&&{passive:!0};function A(o,a){a=a||{};var l,r,m,h,A,T,k,x,C,N=this;function E(){!1===r.interval||t(o,"paused")||(g(o,"paused"),!l.isSliding&&(clearInterval(l.timer),l.timer=null))}function P(){!1!==r.interval&&t(o,"paused")&&(e(o,"paused"),!l.isSliding&&(clearInterval(l.timer),l.timer=null),!l.isSliding&&N.cycle())}function S(e){if(e.preventDefault(),!l.isSliding){var i=e.target;if(!i||t(i,"active")||!i.getAttribute("data-slide-to"))return!1;l.index=parseInt(i.getAttribute("data-slide-to")),N.slideTo(l.index)}}function B(t){if(t.preventDefault(),!l.isSliding){var e=t.currentTarget||t.srcElement;e===k?l.index++:e===T&&l.index--,N.slideTo(l.index)}}function H(t){var e=t.which;if(!l.isSliding){switch(e){case 39:l.index++;break;case 37:l.index--;break;default:return}N.slideTo(l.index)}}function L(t){r.pause&&r.interval&&(t(o,y[0],E),t(o,y[1],P),t(o,p,E,w),t(o,v,P,w)),r.touch&&A.length>1&&t(o,p,I,w),k&&t(k,"click",B),T&&t(T,"click",B),x&&t(x,"click",S),r.keyboard&&t(window,"keydown",H)}function M(t){t(o,b,D,w),t(o,v,X,w)}function I(t){l.isTouch||(l.touchPosition.startX=t.changedTouches[0].pageX,o.contains(t.target)&&(l.isTouch=!0,M(i)))}function D(t){if(l.isTouch)return l.touchPosition.currentX=t.changedTouches[0].pageX,"touchmove"===t.type&&t.changedTouches.length>1?(t.preventDefault(),!1):void 0;t.preventDefault()}function X(t){if(l.isTouch&&!l.isSliding&&(l.touchPosition.endX=l.touchPosition.currentX||t.changedTouches[0].pageX,l.isTouch)){if((!o.contains(t.target)||!o.contains(t.relatedTarget))&&Math.abs(l.touchPosition.startX-l.touchPosition.endX)<75)return!1;l.touchPosition.currentX<l.touchPosition.startX?l.index++:l.touchPosition.currentX>l.touchPosition.startX&&l.index--,l.isTouch=!1,N.slideTo(l.index),M(n)}}function W(t){Array.from(C).map((function(t){e(t,"active")})),C[t]&&g(C[t],"active")}function O(i){if(l.touchPosition){var n=l.index,a=i&&i.target!==A[n]?1e3*i.elapsedTime+100:20,c=N.getActiveIndex(),s="left"===l.direction?"next":"prev";l.isSliding&&setTimeout((function(){l.touchPosition&&(l.isSliding=!1,g(A[n],"active"),e(A[c],"active"),e(A[n],"carousel-item-"+s),e(A[n],"carousel-item-"+l.direction),e(A[c],"carousel-item-"+l.direction),f.call(o,h),document.hidden||!r.interval||t(o,"paused")||N.cycle())}),a)}}if(N.cycle=function(){l.timer&&(clearInterval(l.timer),l.timer=null),l.timer=setInterval((function(){var t=l.index||N.getActiveIndex();(function(t){var e=t.getBoundingClientRect(),i=window.innerHeight||document.documentElement.clientHeight;return e.top<=i&&e.bottom>=0})(o)&&(t++,N.slideTo(t))}),r.interval)},N.slideTo=function(i){if(!l.isSliding){var n,a=N.getActiveIndex();a!==i&&(a<i||0===a&&i===A.length-1?l.direction="left":(a>i||a===A.length-1&&0===i)&&(l.direction="right"),i<0?i=A.length-1:i>=A.length&&(i=0),n="left"===l.direction?"next":"prev",m=u("slide","carousel",A[i]),h=u("slid","carousel",A[i]),f.call(o,m),m.defaultPrevented||(l.index=i,l.isSliding=!0,clearInterval(l.timer),l.timer=null,W(i),c(A[i])&&t(o,"slide")?(g(A[i],"carousel-item-"+n),A[i].offsetWidth,g(A[i],"carousel-item-"+l.direction),g(A[a],"carousel-item-"+l.direction),s(A[i],O)):(g(A[i],"active"),A[i].offsetWidth,e(A[a],"active"),setTimeout((function(){l.isSliding=!1,r.interval&&o&&!t(o,"paused")&&N.cycle(),f.call(o,h)}),100))))}},N.getActiveIndex=function(){return Array.from(A).indexOf(o.getElementsByClassName("carousel-item active")[0])||0},N.dispose=function(){var i=["left","right","prev","next"];Array.from(A).map((function(n,o){t(n,"active")&&W(o),i.map((function(t){return e(n,"carousel-item-"+t)}))})),clearInterval(l.timer),L(n),l={},r={},delete o.Carousel},(o=d(o)).Carousel&&o.Carousel.dispose(),A=o.getElementsByClassName("carousel-item"),T=o.getElementsByClassName("carousel-control-prev")[0],k=o.getElementsByClassName("carousel-control-next")[0],x=o.getElementsByClassName("carousel-indicators")[0],C=x&&x.getElementsByTagName("LI")||[],!(A.length<2)){var R=o.getAttribute("data-interval"),z="false"===R?0:parseInt(R),U="false"===o.getAttribute("data-touch")?0:1,q="hover"===o.getAttribute("data-pause")||!1,j="true"===o.getAttribute("data-keyboard")||!1,Y=a.interval,F=a.touch;(r={}).keyboard=!0===a.keyboard||j,r.pause=!("hover"!==a.pause&&!q)&&"hover",r.touch=F||U,r.interval="number"==typeof Y?Y:!1===Y||0===z||!1===z?0:isNaN(z)?5e3:z,N.getActiveIndex()<0&&(A.length&&g(A[0],"active"),C.length&&W(0)),(l={}).direction="left",l.index=0,l.timer=null,l.isSliding=!1,l.isTouch=!1,l.touchPosition={startX:0,currentX:0,endX:0},L(i),r.interval&&N.cycle(),o.Carousel=N}}function T(o,a){a=a||{};var l,r,c,m,h,p,v=this,b=null,y=null;function w(t,i){f.call(t,h),h.defaultPrevented||(t.isAnimating=!0,t.style.height=t.scrollHeight+"px",e(t,"collapse"),e(t,"show"),g(t,"collapsing"),t.offsetWidth,t.style.height="0px",s(t,(function(){t.isAnimating=!1,t.setAttribute("aria-expanded","false"),i.setAttribute("aria-expanded","false"),e(t,"collapsing"),g(t,"collapse"),t.style.height="",f.call(t,p)})))}v.toggle=function(e){(e&&"A"===e.target.tagName||"A"===o.tagName)&&e.preventDefault(),(o.contains(e.target)||e.target===o)&&(t(y,"show")?v.hide():v.show())},v.hide=function(){y.isAnimating||(w(y,o),g(o,"collapsed"))},v.show=function(){var t,i;b&&(l=b.getElementsByClassName("collapse show")[0],r=l&&(d('[data-target="#'+l.id+'"]',b)||d('[href="#'+l.id+'"]',b))),y.isAnimating||(r&&l!==y&&(w(l,r),g(r,"collapsed")),t=y,i=o,f.call(t,c),c.defaultPrevented||(t.isAnimating=!0,g(t,"collapsing"),e(t,"collapse"),t.style.height=t.scrollHeight+"px",s(t,(function(){t.isAnimating=!1,t.setAttribute("aria-expanded","true"),i.setAttribute("aria-expanded","true"),e(t,"collapsing"),g(t,"collapse"),g(t,"show"),t.style.height="",f.call(t,m)}))),e(o,"collapsed"))},v.dispose=function(){n(o,"click",v.toggle),delete o.Collapse},(o=d(o)).Collapse&&o.Collapse.dispose();var A=o.getAttribute("data-parent");c=u("show","collapse"),m=u("shown","collapse"),h=u("hide","collapse"),p=u("hidden","collapse"),(y=d(a.target||o.getAttribute("data-target")||o.getAttribute("href"))).isAnimating=!1,b=o.closest(a.parent||A),o.Collapse||i(o,"click",v.toggle),o.Collapse=v}var k="mousedown";"webkitPerspective"in document.body.style||document.body.style,"webkitTransform"in document.body.style||document.body.style;function x(t,e){try{t()}catch(t){console.error(e+": "+t)}}function C(t){t.focus?t.focus():t.setActive()}function N(){return{y:window.pageYOffset||document.documentElement.scrollTop,x:window.pageXOffset||document.documentElement.scrollLeft}}function E(e,i,n,o){var a,l,r,c,s,u,f=i.offsetWidth,m=i.offsetHeight,g=document.documentElement.clientWidth||document.body.clientWidth,h=document.documentElement.clientHeight||document.body.clientHeight,p=e.getBoundingClientRect(),v=o===document.body?N():{x:o.offsetLeft+o.scrollLeft,y:o.offsetTop+o.scrollTop},b=p.right-p.left,y=p.bottom-p.top,w=t(i,"popover"),A=d(".arrow",i),T=p.top+y/2-m/2<0,k=p.left+b/2-f/2<0,x=p.left+f/2+b/2>=g,C=p.top+m/2+y/2>=h,E=p.top-m<0,P=p.left-f<0,S=p.top+m+y>=h,B=p.left+f+b>=g;n="right"===(n="left"===(n="bottom"===(n="top"===(n=("left"===n||"right"===n)&&P&&B?"top":n)&&E?"bottom":n)&&S?"top":n)&&P?"right":n)&&B?"left":n,-1===i.className.indexOf(n)&&(i.className=i.className.replace(/\b(top|bottom|left|right)+/,n)),s=A.offsetWidth,u=A.offsetHeight,"left"===n||"right"===n?(l="left"===n?p.left+v.x-f-(w?s:0):p.left+v.x+b,T?(a=p.top+v.y,r=y/2-s):C?(a=p.top+v.y-m+y,r=m-y/2-s):(a=p.top+v.y-m/2+y/2,r=m/2-(w?.9*u:u/2))):"top"!==n&&"bottom"!==n||(a="top"===n?p.top+v.y-m-(w?u:0):p.top+v.y+y,k?(l=0,c=p.left+b/2-s):x?(l=g-1.01*f,c=f-(g-p.left)+b/2-s/2):(l=p.left+v.x-f/2+b/2,c=f/2-(w?s:s/2))),i.style.top=a+"px",i.style.left=l+"px",r&&(A.style.top=r+"px"),c&&(A.style.left=c+"px")}function P(o,a){var l,r,c,s,m,h,p,v=this,b=null,y=[];function w(t){(t.href&&"#"===t.href.slice(-1)||t.parentNode&&t.parentNode.href&&"#"===t.parentNode.href.slice(-1))&&this.preventDefault()}function A(){var t=o.open?i:n;t(document,"click",T),t(document,"keydown",x),t(document,"keyup",N),t(document,"focus",T,!0)}function T(t){var e=t.target,i=e&&(e.getAttribute("data-toggle")||e.parentNode&&e.parentNode.getAttribute&&e.parentNode.getAttribute("data-toggle"));("focus"!==t.type||e!==o&&e!==h&&!h.contains(e))&&(e!==h&&!h.contains(e)||!p&&!i)&&(b=e===o||o.contains(e)?o:null,v.hide(),w.call(t,e))}function k(t){b=o,v.show(),w.call(t,t.target)}function x(t){var e=t.which||t.keyCode;38!==e&&40!==e||t.preventDefault()}function N(t){var e=t.which,i=t.keyCode,n=e||i,a=document.activeElement,l=a===o,r=h.contains(a),c=a.parentNode===h||a.parentNode.parentNode===h,s=y.indexOf(a);c&&(s=l?0:38===n?s>1?s-1:0:40===n&&s<y.length-1?s+1:s,y[s]&&C(y[s])),(y.length&&c||!y.length&&(r||l)||!r)&&o.open&&27===n&&(v.toggle(),b=null)}v.show=function(){l=u("show","dropdown",b),f.call(m,l),l.defaultPrevented||(g(h,"show"),g(m,"show"),o.setAttribute("aria-expanded",!0),o.open=!0,n(o,"click",k),setTimeout((function(){C(h.getElementsByTagName("INPUT")[0]||o),A(),r=u("shown","dropdown",b),f.call(m,r)}),1))},v.hide=function(){c=u("hide","dropdown",b),f.call(m,c),c.defaultPrevented||(e(h,"show"),e(m,"show"),o.setAttribute("aria-expanded",!1),o.open=!1,A(),C(o),setTimeout((function(){o.Dropdown&&i(o,"click",k)}),1),s=u("hidden","dropdown",b),f.call(m,s))},v.toggle=function(){t(m,"show")&&o.open?v.hide():v.show()},v.dispose=function(){t(m,"show")&&o.open&&v.hide(),n(o,"click",k),delete o.Dropdown},(o=d(o)).Dropdown&&o.Dropdown.dispose(),m=o.parentNode,h=d(".dropdown-menu",m),Array.from(h.children).map((function(t){t.children.length&&"A"===t.children[0].tagName&&y.push(t.children[0]),"A"===t.tagName&&y.push(t)})),o.Dropdown||(!("tabindex"in h)&&h.setAttribute("tabindex","0"),i(o,"click",k)),p=!0===a||"true"===o.getAttribute("data-persist")||!1,o.open=!1,o.Dropdown=v}function S(o,a){a=a||{};var l,r,m,h,p,v,b,y,A,T=this,k=null,x={};function N(){var e,i,n=t(document.body,"modal-open"),o=parseInt(getComputedStyle(document.body).paddingRight),a=document.documentElement.clientHeight!==document.documentElement.scrollHeight||document.body.clientHeight!==document.body.scrollHeight,r=l.clientHeight!==l.scrollHeight;(i=document.createElement("div")).className="modal-scrollbar-measure",document.body.appendChild(i),e=i.offsetWidth-i.clientWidth,document.body.removeChild(i),v=e,l.style.paddingRight=!r&&v?v+"px":"",document.body.style.paddingRight=r||a?o+(n?0:v)+"px":"",A.length&&A.map((function(t){var e=getComputedStyle(t).paddingRight;t.style.paddingRight=r||a?parseInt(e)+(n?0:v)+"px":parseInt(e)+"px"}))}function E(){(b=d(".modal-backdrop"))&&!document.getElementsByClassName("modal show")[0]&&(document.body.removeChild(b),b=null),null===b&&(e(document.body,"modal-open"),document.body.style.paddingRight="",l.style.paddingRight="",A.length&&A.map((function(t){t.style.paddingRight=""})))}function P(t){t(window,"resize",T.update,w),t(l,"click",I),t(document,"keydown",M)}function S(){l.style.display="block",N(),!document.getElementsByClassName("modal show")[0]&&g(document.body,"modal-open"),g(l,"show"),l.setAttribute("aria-hidden",!1),t(l,"fade")?s(l,B):B()}function B(){C(l),l.isAnimating=!1,P(i),m=u("shown","modal",k),f.call(l,m)}function H(i){l.style.display="",o&&C(o),b=d(".modal-backdrop"),1!==i&&b&&t(b,"show")&&!document.getElementsByClassName("modal show")[0]?(e(b,"show"),s(b,E)):E(),P(n),l.isAnimating=!1,p=u("hidden","modal"),f.call(l,p)}function L(e){if(!l.isAnimating){var i=e.target,n="#"+l.getAttribute("id"),a=i.getAttribute("data-target")||i.getAttribute("href"),r=o.getAttribute("data-target")||o.getAttribute("href");!t(l,"show")&&(i===o&&a===n||o.contains(i)&&r===n)&&(l.modalTrigger=o,k=o,T.show(),e.preventDefault())}}function M(e){var i=e.which;!l.isAnimating&&x.keyboard&&27==i&&t(l,"show")&&T.hide()}function I(e){if(!l.isAnimating){var i=e.target,n="modal"===i.getAttribute("data-dismiss"),o=i.closest('[data-dismiss="modal"]');t(l,"show")&&(o||n||i===l&&"static"!==x.backdrop)&&(T.hide(),k=null,e.preventDefault())}}T.toggle=function(){t(l,"show")?T.hide():T.show()},T.show=function(){if(!(t(l,"show")&&l.isAnimating||(r=u("show","modal",k),f.call(l,r),r.defaultPrevented))){l.isAnimating=!0;var e,i=document.getElementsByClassName("modal show")[0];i&&i!==l&&(i.modalTrigger&&i.modalTrigger.Modal.hide(),i.Modal&&i.Modal.hide()),x.backdrop&&(e=document.createElement("div"),null===(b=d(".modal-backdrop"))&&(e.setAttribute("class","modal-backdrop"+(x.animation?" fade":"")),b=e,document.body.appendChild(b)),b=b),!b||i||t(b,"show")||(b.offsetWidth,y=c(b),g(b,"show")),i?S():setTimeout(S,b&&y?y:0)}},T.hide=function(i){t(l,"show")&&(h=u("hide","modal"),f.call(l,h),h.defaultPrevented||(l.isAnimating=!0,e(l,"show"),l.setAttribute("aria-hidden",!0),t(l,"fade")&&1!==i?s(l,H):H()))},T.setContent=function(t){d(".modal-content",l).innerHTML=t},T.update=function(){t(l,"show")&&N()},T.dispose=function(){T.hide(1),o?(n(o,"click",L),delete o.Modal):delete l.Modal},o=d(o);var D=d(o.getAttribute("data-target")||o.getAttribute("href"));l=t(o,"modal")?o:D,A=Array.from(document.getElementsByClassName("fixed-top")).concat(Array.from(document.getElementsByClassName("fixed-bottom"))),t(o,"modal")&&(o=null),o&&o.Modal&&o.Modal.dispose(),l&&l.Modal&&l.Modal.dispose(),x.keyboard=!1!==a.keyboard&&"false"!==l.getAttribute("data-keyboard"),x.backdrop="static"!==a.backdrop&&"static"!==l.getAttribute("data-backdrop")||"static",x.backdrop=!1!==a.backdrop&&"false"!==l.getAttribute("data-backdrop")&&x.backdrop,x.animation=!!t(l,"fade"),x.content=a.content,l.isAnimating=!1,o&&!o.Modal&&i(o,"click",L),x.content&&T.setContent(x.content.trim()),o?(l.modalTrigger=o,o.Modal=T):l.Modal=T}function B(o,a){a=a||{};var l,r,c,m,h,v,b,A,T,x,C,N,P,S,B,H,L,M,I,D=this,X=null,W=0,O=/(iPhone|iPod|iPad)/.test(navigator.userAgent),R={};function z(t){null!==X&&t.target===d(".close",X)&&D.hide()}function U(){return{0:a.title||o.getAttribute("data-title")||null,1:a.content||o.getAttribute("data-content")||null}}function q(){null===X&&o.focus()}function j(t){"hover"===R.trigger?(t(o,k,D.show),t(o,y[0],D.show),R.dismissible||t(o,y[1],D.hide)):"click"==R.trigger?t(o,R.trigger,D.toggle):"focus"==R.trigger&&(O&&t(o,"click",q),t(o,R.trigger,D.toggle))}function Y(t){X&&X.contains(t.target)||t.target===o||o.contains(t.target)||D.hide()}function F(t){R.dismissible?t(document,"click",z):("focus"==R.trigger&&t(o,"blur",D.hide),"hover"==R.trigger&&t(document,p,Y,w)),t(window,"resize",D.hide,w)}function V(){F(i),f.call(o,C)}function G(){F(n),R.container.removeChild(X),W=null,X=null,f.call(o,P)}D.toggle=function(){null===X?D.show():D.hide()},D.show=function(){clearTimeout(W),W=setTimeout((function(){if(null===X){if(f.call(o,x),x.defaultPrevented)return;!function(){l=U()[0]||null,r=(r=U()[1])?r.trim():null,X=document.createElement("div");var e=document.createElement("div");if(g(e,"arrow"),X.appendChild(e),null!==r&&null===R.template){if(X.setAttribute("role","tooltip"),null!==l){var i=document.createElement("h3");g(i,"popover-header"),i.innerHTML=R.dismissible?l+T:l,X.appendChild(i)}var n=document.createElement("div");g(n,"popover-body"),n.innerHTML=R.dismissible&&null===l?r+T:r,X.appendChild(n)}else{var o=document.createElement("div");o.innerHTML=R.template.trim(),X.className=o.firstChild.className,X.innerHTML=o.firstChild.innerHTML;var a=d(".popover-header",X),c=d(".popover-body",X);l&&a&&(a.innerHTML=l.trim()),r&&c&&(c.innerHTML=r.trim())}R.container.appendChild(X),X.style.display="block",!t(X,"popover")&&g(X,"popover"),!t(X,R.animation)&&g(X,R.animation),!t(X,I)&&g(X,I)}(),E(o,X,R.placement,R.container),!t(X,"show")&&g(X,"show"),R.animation?s(X,V):V()}}),20)},D.hide=function(){clearTimeout(W),W=setTimeout((function(){if(X&&null!==X&&t(X,"show")){if(f.call(o,N),N.defaultPrevented)return;e(X,"show"),R.animation?s(X,G):G()}}),R.delay)},D.dispose=function(){D.hide(),j(n),delete o.Popover},(o=d(o)).Popover&&o.Popover.dispose(),c=o.getAttribute("data-trigger"),m=o.getAttribute("data-animation"),h=o.getAttribute("data-placement"),v=o.getAttribute("data-dismissible"),b=o.getAttribute("data-delay"),A=o.getAttribute("data-container"),T='<button type="button" class="close">×</button>',x=u("show","popover"),C=u("shown","popover"),N=u("hide","popover"),P=u("hidden","popover"),S=d(a.container),B=d(A),H=o.closest(".modal"),L=o.closest(".fixed-top"),M=o.closest(".fixed-bottom"),R.template=a.template?a.template:null,R.trigger=a.trigger?a.trigger:c||"hover",R.animation=a.animation&&"fade"!==a.animation?a.animation:m||"fade",R.placement=a.placement?a.placement:h||"top",R.delay=parseInt(a.delay||b)||200,R.dismissible=!(!a.dismissible&&"true"!==v),R.container=S||(B||(L||(M||(H||document.body)))),I="bs-popover-"+R.placement;var J=U();l=J[0],((r=J[1])||R.template)&&(o.Popover||j(i),o.Popover=D)}function H(o,a){a=a||{};var l,r,c,s,m,h=this,p={};function v(){var i;i=s.getElementsByTagName("A"),l.length!==i.length&&(l.items=[],l.targets=[],Array.from(i).map((function(t){var e=t.getAttribute("href"),i=e&&"#"===e.charAt(0)&&"#"!==e.slice(-1)&&d(e);i&&(l.items.push(t),l.targets.push(i))})),l.length=i.length),l.scrollOffset=l.isWindow?N().y:o.scrollTop,l.items.map((function(i,n){return function(i){var n=l.items[i],a=l.targets[i],r=t(n,"dropdown-item")&&n.closest(".dropdown-menu"),c=r&&r.previousElementSibling,s=n.nextElementSibling,d=s&&s.getElementsByClassName("active").length,m=l.isWindow&&a.getBoundingClientRect(),h=t(n,"active")||!1,v=(l.isWindow?m.top+l.scrollOffset:a.offsetTop)-p.offset,b=l.isWindow?m.bottom+l.scrollOffset-p.offset:l.targets[i+1]?l.targets[i+1].offsetTop-p.offset:o.scrollHeight,y=d||l.scrollOffset>=v&&b>l.scrollOffset;if(!h&&y)g(n,"active"),c&&!t(c,"active")&&g(c,"active"),f.call(o,u("activate","scrollspy",l.items[i]));else if(h&&!y)e(n,"active"),c&&t(c,"active")&&!n.parentNode.getElementsByClassName("active").length&&e(c,"active");else if(h&&y||!y&&!h)return}(n)}))}function b(t){t(m,"scroll",h.refresh,w),t(window,"resize",h.refresh,w)}h.refresh=function(){v()},h.dispose=function(){b(n),delete o.ScrollSpy},(o=d(o)).ScrollSpy&&o.ScrollSpy.dispose(),r=o.getAttribute("data-target"),c=o.getAttribute("data-offset"),s=d(a.target||r),m=o.offsetHeight<o.scrollHeight?o:window,s&&(p.target=s,p.offset=parseInt(a.offset||c)||10,(l={}).length=0,l.items=[],l.targets=[],l.isWindow=m===window,o.ScrollSpy||b(i),h.refresh(),o.ScrollSpy=h)}function L(o,a){a=a||{};var r,c,m,h,p,v,b,y,w,A,T,k,x,C,N,E=this,P=!1;function S(){P.style.height="",e(P,"collapsing"),c.isAnimating=!1}function B(){P?x?S():setTimeout((function(){P.style.height=C+"px",P.offsetWidth,s(P,S)}),50):c.isAnimating=!1,p=u("shown","tab",w),f.call(y,p)}function H(){P&&(A.style.float="left",T.style.float="left",k=A.scrollHeight),h=u("show","tab",w),b=u("hidden","tab",y),f.call(y,h),h.defaultPrevented||(g(T,"active"),e(A,"active"),P&&(C=T.scrollHeight,x=C===k,g(P,"collapsing"),P.style.height=k+"px",P.offsetHeight,A.style.float="",T.style.float=""),t(T,"fade")?setTimeout((function(){g(T,"show"),s(T,B)}),20):B(),f.call(w,b))}function L(){var e,i=c.getElementsByClassName("active");return 1!==i.length||t(i[0].parentNode,"dropdown")?i.length>1&&(e=i[i.length-1]):e=i[0],e}function M(){return d(L().getAttribute("href"))}function I(t){t.preventDefault(),y=t.currentTarget,!c.isAnimating&&E.show()}E.show=function(){if(!t(y=y||o,"active")){if(T=d(y.getAttribute("href")),w=L(),A=M(),v=u("hide","tab",y),f.call(w,v),v.defaultPrevented)return;c.isAnimating=!0,e(w,"active"),w.setAttribute("aria-selected","false"),g(y,"active"),y.setAttribute("aria-selected","true"),m&&(t(o.parentNode,"dropdown-menu")?t(m,"active")||g(m,"active"):t(m,"active")&&e(m,"active")),t(A,"fade")?(e(A,"show"),s(A,H)):H()}},E.dispose=function(){n(o,"click",I),delete o.Tab},(o=d(o)).Tab&&o.Tab.dispose(),r=o.getAttribute("data-height"),c=o.closest(".nav"),m=c&&d(".dropdown-toggle",c),N=!(!l||!1===a.height||"false"===r),c.isAnimating=!1,o.Tab||i(o,"click",I),N&&(P=M().parentNode),o.Tab=E}function M(o,a){a=a||{};var l,r,c,m,h,p,v,b,y=this,w=0,A={};function T(){e(l,"showing"),g(l,"show"),f.call(l,v),A.autohide&&y.hide()}function k(){g(l,"hide"),f.call(l,b)}function x(){e(l,"show"),A.animation?s(l,k):k()}function C(){clearTimeout(w),n(o,"click",y.hide),delete o.Toast}y.show=function(){if(l&&!t(l,"show")){if(f.call(l,h),h.defaultPrevented)return;A.animation&&g(l,"fade"),e(l,"hide"),l.offsetWidth,g(l,"showing"),A.animation?s(l,T):T()}},y.hide=function(e){if(l&&t(l,"show")){if(f.call(l,p),p.defaultPrevented)return;e?x():w=setTimeout(x,A.delay)}},y.dispose=function(){A.animation?s(l,C):C()},(o=d(o)).Toast&&o.Toast.dispose(),l=o.closest(".toast"),r=o.getAttribute("data-animation"),c=o.getAttribute("data-autohide"),m=o.getAttribute("data-delay"),h=u("show","toast"),p=u("hide","toast"),v=u("shown","toast"),b=u("hidden","toast"),A.animation=!1===a.animation||"false"===r?0:1,A.autohide=!1===a.autohide||"false"===c?0:1,A.delay=parseInt(a.delay||m)||500,o.Toast||i(o,"click",y.hide),o.Toast=y}function I(o,a){a=a||{};var l,r,c,m,h,v,b,A,T,x,C,N,P,S,B,H=this,L=null,M=0,I={};function D(){return o.getAttribute("title")||o.getAttribute("data-title")||o.getAttribute("data-original-title")}function X(t){L&&L.contains(t.target)||t.target===o||o.contains(t.target)||H.hide()}function W(){i(document,p,X,w),i(window,"resize",H.hide,w),f.call(o,b)}function O(){n(document,p,X,w),n(window,"resize",H.hide,w),I.container.removeChild(L),L=null,M=null,f.call(o,T)}function R(t){t(o,k,H.show),t(o,y[0],H.show),t(o,y[1],H.hide)}H.show=function(){clearTimeout(M),M=setTimeout((function(){if(null===L){if(f.call(o,v),v.defaultPrevented)return;!1!==function(){if(l=D()){if(L=document.createElement("div"),I.template){var e=document.createElement("div");e.innerHTML=I.template.trim(),L.className=e.firstChild.className,L.innerHTML=e.firstChild.innerHTML,d(".tooltip-inner",L).innerHTML=l.trim()}else{var i=document.createElement("div");g(i,"arrow"),L.appendChild(i);var n=document.createElement("div");g(n,"tooltip-inner"),L.appendChild(n),n.innerHTML=l}L.style.left="0",L.style.top="0",L.setAttribute("role","tooltip"),!t(L,"tooltip")&&g(L,"tooltip"),!t(L,I.animation)&&g(L,I.animation),!t(L,B)&&g(L,B),I.container.appendChild(L)}}()&&(E(o,L,I.placement,I.container),!t(L,"show")&&g(L,"show"),I.animation?s(L,W):W())}}),20)},H.hide=function(){clearTimeout(M),M=setTimeout((function(){if(L&&t(L,"show")){if(f.call(o,A),A.defaultPrevented)return;e(L,"show"),I.animation?s(L,O):O()}}),I.delay)},H.toggle=function(){L?H.hide():H.show()},H.dispose=function(){R(n),H.hide(),o.setAttribute("title",o.getAttribute("data-original-title")),o.removeAttribute("data-original-title"),delete o.Tooltip},(o=d(o)).Tooltip&&o.Tooltip.dispose(),r=o.getAttribute("data-animation"),c=o.getAttribute("data-placement"),m=o.getAttribute("data-delay"),h=o.getAttribute("data-container"),v=u("show","tooltip"),b=u("shown","tooltip"),A=u("hide","tooltip"),T=u("hidden","tooltip"),x=d(a.container),C=d(h),N=o.closest(".modal"),P=o.closest(".fixed-top"),S=o.closest(".fixed-bottom"),I.animation=a.animation&&"fade"!==a.animation?a.animation:r||"fade",I.placement=a.placement?a.placement:c||"top",I.template=a.template?a.template:null,I.delay=parseInt(a.delay||m)||200,I.container=x||(C||(P||(S||(N||document.body)))),B="bs-tooltip-"+I.placement,(l=D())&&(o.Tooltip||(o.setAttribute("data-original-title",l),o.removeAttribute("title"),R(i)),o.Tooltip=H)}var D={};function X(t){t=t||document;var e=function(e){x((function(){return i=D[e][0],n=t.querySelectorAll(D[e][1]),void Array.from(n).map((function(t){return new i(t)}));var i,n}),"BSN."+e)};for(var i in D)e(i)}D.Alert=[m,'[data-dismiss="alert"]'],D.Button=[h,'[data-toggle="buttons"]'],D.Carousel=[A,'[data-ride="carousel"]'],D.Collapse=[T,'[data-toggle="collapse"]'],D.Dropdown=[P,'[data-toggle="dropdown"]'],D.Modal=[S,'[data-toggle="modal"]'],D.Popover=[B,'[data-toggle="popover"],[data-tip="popover"]'],D.ScrollSpy=[H,'[data-spy="scroll"]'],D.Tab=[L,'[data-toggle="tab"]'],D.Toast=[M,'[data-dismiss="toast"]'],D.Tooltip=[I,'[data-toggle="tooltip"],[data-tip="tooltip"]'],document.body?X():o(document,"DOMContentLoaded",X);return{Alert:m,Button:h,Carousel:A,Collapse:T,Dropdown:P,Modal:S,Popover:B,ScrollSpy:H,Tab:L,Toast:M,Tooltip:I,initCallback:X,removeDataAPI:function(t){t=t||document;var e=function(e){x((function(){return i=e,n=t.querySelectorAll(D[e][1]),void Array.from(n).map((function(t){return t[i].dispose()}));var i,n}),"BSN."+e)};for(var i in D)e(i)},componentsInit:D,Version:"3.0.5"}})); | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t=t||self).BSN=e()}(this,(function(){"use strict";var t="webkitTransition"in document.body.style?"webkitTransitionEnd":"transitionend",e="webkitTransition"in document.body.style||"transition"in document.body.style,i="webkitTransition"in document.body.style?"webkitTransitionDuration":"transitionDuration";function n(t){var n=e?parseFloat(getComputedStyle(t)[i]):0;return n="number"!=typeof n||isNaN(n)?0:1e3*n}function s(e,i){var s=0;n(e)?e.addEventListener(t,(function n(o){!s&&i(o),s=1,e.removeEventListener(t,n)})):setTimeout((function(){!s&&i(),s=1}),17)}function o(t,e){var i=e&&e instanceof Element?e:document;return t instanceof Element?t:i.querySelector(t)}function a(t,e,i){var n=new CustomEvent(t+".bs."+e,{cancelable:!0});return n.relatedTarget=i,n}function l(t){this&&this.dispatchEvent(t)}function c(t){var e,i=this,n=a("close","alert"),c=a("closed","alert");function r(e){t[e=e?"addEventListener":"removeEventListener"]("click",d,!1)}function d(n){e=n&&n.target.closest(".alert"),(t=o('[data-dismiss="alert"]',e))&&e&&(t===n.target||t.contains(n.target))&&i.close()}function u(){r(),e.parentNode.removeChild(e),l.call(e,c)}i.close=function(){if(e&&t&&e.classList.contains("show")){if(l.call(e,n),n.defaultPrevented)return;i.dispose(),e.classList.remove("show"),e.classList.contains("fade")?s(e,u):u()}},i.dispose=function(){r(),delete t.Alert},t=o(t),e=t.closest(".alert"),t.Alert&&t.Alert.dispose(),t.Alert||r(1),i.element=t,t.Alert=i}function r(t){var e,i=a("change","button");function n(n){var s,o="LABEL"===n.target.tagName?n.target:n.target.closest("LABEL")?n.target.closest("LABEL"):null;if(s=o&&o.getElementsByTagName("INPUT")[0]){if(l.call(s,i),l.call(t,i),"checkbox"===s.type){if(i.defaultPrevented)return;s.checked?(o.classList.remove("active"),s.getAttribute("checked"),s.removeAttribute("checked"),s.checked=!1):(o.classList.add("active"),s.getAttribute("checked"),s.setAttribute("checked","checked"),s.checked=!0),t.toggled||(t.toggled=!0)}if("radio"===s.type&&!t.toggled){if(i.defaultPrevented)return;(!s.checked||0===n.screenX&&0==n.screenY)&&(o.classList.add("active"),o.classList.add("focus"),s.setAttribute("checked","checked"),s.checked=!0,t.toggled=!0,Array.from(e).map((function(t){var e=t.getElementsByTagName("INPUT")[0];t!==o&&t.classList.contains("active")&&(l.call(e,i),t.classList.remove("active"),e.removeAttribute("checked"),e.checked=!1)})))}setTimeout((function(){t.toggled=!1}),50)}}function s(t){32===(t.which||t.keyCode)&&t.target===document.activeElement&&n(t)}function c(t){32===(t.which||t.keyCode)&&t.preventDefault()}function r(t){if("INPUT"===t.target.tagName){var e="focusin"===t.type?"add":"remove";t.target.closest(".btn").classList[e]("focus")}}function d(e){t[e=e?"addEventListener":"removeEventListener"]("click",n,!1),t[e]("keyup",s,!1),t[e]("keydown",c,!1),t[e]("focusin",r,!1),t[e]("focusout",r,!1)}this.dispose=function(){d(),delete t.Button},(t=o(t)).Button&&t.Button.dispose(),(e=t.getElementsByClassName("btn")).length&&(t.Button||d(1),t.toggled=!1,t.Button=this,Array.from(e).map((function(t){!t.classList.contains("active")&&o("input:checked",t)&&t.classList.add("active"),t.classList.contains("active")&&!o("input:checked",t)&&t.classList.remove("active")})))}var d="onmouseleave"in document?["mouseenter","mouseleave"]:["mouseover","mouseout"],u=!!function(){var t=!1;try{var e=Object.defineProperty({},"passive",{get:function(){t=!0}});document.addEventListener("DOMContentLoaded",(function t(){document.removeEventListener("DOMContentLoaded",t,e)}),e)}catch(t){}return t}()&&{passive:!0};function m(t,e){e=e||{};var i,c,r,m,f,h,g,p,v,L=this;function b(){!1===c.interval||t.classList.contains("paused")||(t.classList.add("paused"),!i.isSliding&&(clearInterval(i.timer),i.timer=null))}function y(){!1!==c.interval&&t.classList.contains("paused")&&(t.classList.remove("paused"),!i.isSliding&&(clearInterval(i.timer),i.timer=null),!i.isSliding&&L.cycle())}function w(t){if(t.preventDefault(),!i.isSliding){var e=t.target;if(!e||e.classList.contains("active")||!e.getAttribute("data-slide-to"))return!1;i.index=parseInt(e.getAttribute("data-slide-to")),L.slideTo(i.index)}}function A(t){if(t.preventDefault(),!i.isSliding){var e=t.currentTarget||t.srcElement;e===g?i.index++:e===h&&i.index--,L.slideTo(i.index)}}function T(t){var e=t.which;if(!i.isSliding){switch(e){case 39:i.index++;break;case 37:i.index--;break;default:return}L.slideTo(i.index)}}function E(e){e=e?"addEventListener":"removeEventListener",c.pause&&c.interval&&(t[e](d[0],b,!1),t[e](d[1],y,!1),t[e]("touchstart",b,u),t[e]("touchend",y,u)),c.touch&&f.length>1&&t[e]("touchstart",C,u),g&&g[e]("click",A,!1),h&&h[e]("click",A,!1),p&&p[e]("click",w,!1),c.keyboard&&window[e]("keydown",T,!1)}function k(e){t[e=e?"addEventListener":"removeEventListener"]("touchmove",x,u),t[e]("touchend",N,u)}function C(e){i.isTouch||(i.touchPosition.startX=e.changedTouches[0].pageX,t.contains(e.target)&&(i.isTouch=!0,k(1)))}function x(t){if(i.isTouch)return i.touchPosition.currentX=t.changedTouches[0].pageX,"touchmove"===t.type&&t.changedTouches.length>1?(t.preventDefault(),!1):void 0;t.preventDefault()}function N(e){if(i.isTouch&&!i.isSliding&&(i.touchPosition.endX=i.touchPosition.currentX||e.changedTouches[0].pageX,i.isTouch)){if((!t.contains(e.target)||!t.contains(e.relatedTarget))&&Math.abs(i.touchPosition.startX-i.touchPosition.endX)<75)return!1;i.touchPosition.currentX<i.touchPosition.startX?i.index++:i.touchPosition.currentX>i.touchPosition.startX&&i.index--,i.isTouch=!1,L.slideTo(i.index),k()}}function P(t){Array.from(v).map((function(t){t.classList.remove("active")})),v[t]&&v[t].classList.add("active")}function B(e){if(i.touchPosition){var n=i.index,s=e&&e.target!==f[n]?1e3*e.elapsedTime+100:20,o=L.getActiveIndex(),a="left"===i.direction?"next":"prev";i.isSliding&&setTimeout((function(){i.touchPosition&&(i.isSliding=!1,f[n].classList.add("active"),f[o].classList.remove("active"),f[n].classList.remove("carousel-item-"+a),f[n].classList.remove("carousel-item-"+i.direction),f[o].classList.remove("carousel-item-"+i.direction),l.call(t,m),document.hidden||!c.interval||t.classList.contains("paused")||L.cycle())}),s)}}if(L.cycle=function(){i.timer&&(clearInterval(i.timer),i.timer=null),i.timer=setInterval((function(){var e=i.index||L.getActiveIndex();(function(t){var e=t.getBoundingClientRect(),i=window.innerHeight||document.documentElement.clientHeight;return e.top<=i&&e.bottom>=0})(t)&&(e++,L.slideTo(e))}),c.interval)},L.slideTo=function(e){if(!i.isSliding){var o,d=L.getActiveIndex();d!==e&&(d<e||0===d&&e===f.length-1?i.direction="left":(d>e||d===f.length-1&&0===e)&&(i.direction="right"),e<0?e=f.length-1:e>=f.length&&(e=0),o="left"===i.direction?"next":"prev",r=a("slide","carousel",f[e]),m=a("slid","carousel",f[e]),l.call(t,r),r.defaultPrevented||(i.index=e,i.isSliding=!0,clearInterval(i.timer),i.timer=null,P(e),n(f[e])&&t.classList.contains("slide")?(f[e].classList.add("carousel-item-"+o),f[e].offsetWidth,f[e].classList.add("carousel-item-"+i.direction),f[d].classList.add("carousel-item-"+i.direction),s(f[e],B)):(f[e].classList.add("active"),f[e].offsetWidth,f[d].classList.remove("active"),setTimeout((function(){i.isSliding=!1,c.interval&&t&&!t.classList.contains("paused")&&L.cycle(),l.call(t,m)}),100))))}},L.getActiveIndex=function(){return Array.from(f).indexOf(t.getElementsByClassName("carousel-item active")[0])||0},L.dispose=function(){var e=["left","right","prev","next"];Array.from(f).map((function(t,i){t.classList.contains("active")&&P(i),e.map((function(e){return t.classList.remove("carousel-item-"+e)}))})),clearInterval(i.timer),E(),i={},c={},delete t.Carousel},(t=o(t)).Carousel&&t.Carousel.dispose(),f=t.getElementsByClassName("carousel-item"),h=t.getElementsByClassName("carousel-control-prev")[0],g=t.getElementsByClassName("carousel-control-next")[0],p=t.getElementsByClassName("carousel-indicators")[0],v=p&&p.getElementsByTagName("LI")||[],!(f.length<2)){var S=t.getAttribute("data-interval"),H="false"===S?0:parseInt(S),M="false"===t.getAttribute("data-touch")?0:1,I="hover"===t.getAttribute("data-pause")||!1,D="true"===t.getAttribute("data-keyboard")||!1,X=e.interval,W=e.touch;(c={}).keyboard=!0===e.keyboard||D,c.pause=!("hover"!==e.pause&&!I)&&"hover",c.touch=W||M,c.interval="number"==typeof X?X:!1===X||0===H||!1===H?0:isNaN(H)?5e3:H,L.getActiveIndex()<0&&(f.length&&f[0].classList.add("active"),v.length&&P(0)),(i={}).direction="left",i.index=0,i.timer=null,i.isSliding=!1,i.isTouch=!1,i.touchPosition={startX:0,currentX:0,endX:0},E(1),c.interval&&L.cycle(),t.Carousel=L}}function f(t,e){e=e||{};var i,n,c,r,d,u,m=this,f=null,h=null;function g(t,e){l.call(t,d),d.defaultPrevented||(t.isAnimating=!0,t.style.height=t.scrollHeight+"px",t.classList.remove("collapse"),t.classList.remove("show"),t.classList.add("collapsing"),t.offsetWidth,t.style.height="0px",s(t,(function(){t.isAnimating=!1,t.setAttribute("aria-expanded","false"),e.setAttribute("aria-expanded","false"),t.classList.remove("collapsing"),t.classList.add("collapse"),t.style.height="",l.call(t,u)})))}m.toggle=function(e){(e&&"A"===e.target.tagName||"A"===t.tagName)&&e.preventDefault(),(t.contains(e.target)||e.target===t)&&(h.classList.contains("show")?m.hide():m.show())},m.hide=function(){h.isAnimating||(g(h,t),t.classList.add("collapsed"))},m.show=function(){var e,a;f&&(i=f.getElementsByClassName("collapse show")[0],n=i&&(o('[data-target="#'+i.id+'"]',f)||o('[href="#'+i.id+'"]',f))),h.isAnimating||(n&&i!==h&&(g(i,n),n.classList.add("collapsed")),e=h,a=t,l.call(e,c),c.defaultPrevented||(e.isAnimating=!0,e.classList.add("collapsing"),e.classList.remove("collapse"),e.style.height=e.scrollHeight+"px",s(e,(function(){e.isAnimating=!1,e.setAttribute("aria-expanded","true"),a.setAttribute("aria-expanded","true"),e.classList.remove("collapsing"),e.classList.add("collapse"),e.classList.add("show"),e.style.height="",l.call(e,r)}))),t.classList.remove("collapsed"))},m.dispose=function(){t.removeEventListener("click",m.toggle,!1),delete t.Collapse},(t=o(t)).Collapse&&t.Collapse.dispose();var p=t.getAttribute("data-parent");c=a("show","collapse"),r=a("shown","collapse"),d=a("hide","collapse"),u=a("hidden","collapse"),(h=o(e.target||t.getAttribute("data-target")||t.getAttribute("href"))).isAnimating=!1,f=t.closest(e.parent||p),t.Collapse||t.addEventListener("click",m.toggle,!1),t.Collapse=m}function h(t){t.focus?t.focus():t.setActive()}function g(t,e){var i,n,s,c,r,d,u,m=this,f=null,g=[];function p(t){(t.href&&"#"===t.href.slice(-1)||t.parentNode&&t.parentNode.href&&"#"===t.parentNode.href.slice(-1))&&this.preventDefault()}function v(){var e=t.open?"addEventListener":"removeEventListener";document[e]("click",L,!1),document[e]("keydown",y,!1),document[e]("keyup",w,!1),document[e]("focus",L,!1)}function L(e){var i=e.target,n=i&&(i.getAttribute("data-toggle")||i.parentNode&&i.parentNode.getAttribute&&i.parentNode.getAttribute("data-toggle"));("focus"!==e.type||i!==t&&i!==d&&!d.contains(i))&&(i!==d&&!d.contains(i)||!u&&!n)&&(f=i===t||t.contains(i)?t:null,m.hide(),p.call(e,i))}function b(e){f=t,m.show(),p.call(e,e.target)}function y(t){var e=t.which||t.keyCode;38!==e&&40!==e||t.preventDefault()}function w(e){var i=e.which||e.keyCode,n=document.activeElement,s=n===t,o=d.contains(n),a=n.parentNode===d||n.parentNode.parentNode===d,l=g.indexOf(n);a&&(l=s?0:38===i?l>1?l-1:0:40===i&&l<g.length-1?l+1:l,g[l]&&h(g[l])),(g.length&&a||!g.length&&(o||s)||!o)&&t.open&&27===i&&(m.toggle(),f=null)}m.show=function(){i=a("show","dropdown",f),l.call(r,i),i.defaultPrevented||(d.classList.add("show"),r.classList.add("show"),t.setAttribute("aria-expanded",!0),t.open=!0,t.removeEventListener("click",b,!1),setTimeout((function(){h(d.getElementsByTagName("INPUT")[0]||t),v(),n=a("shown","dropdown",f),l.call(r,n)}),1))},m.hide=function(){s=a("hide","dropdown",f),l.call(r,s),s.defaultPrevented||(d.classList.remove("show"),r.classList.remove("show"),t.setAttribute("aria-expanded",!1),t.open=!1,v(),h(t),setTimeout((function(){t.Dropdown&&t.addEventListener("click",b,!1)}),1),c=a("hidden","dropdown",f),l.call(r,c))},m.toggle=function(){r.classList.contains("show")&&t.open?m.hide():m.show()},m.dispose=function(){r.classList.contains("show")&&t.open&&m.hide(),t.removeEventListener("click",b,!1),delete t.Dropdown},(t=o(t)).Dropdown&&t.Dropdown.dispose(),r=t.parentNode,d=o(".dropdown-menu",r),Array.from(d.children).map((function(t){t.children.length&&"A"===t.children[0].tagName&&g.push(t.children[0]),"A"===t.tagName&&g.push(t)})),t.Dropdown||(!("tabindex"in d)&&d.setAttribute("tabindex","0"),t.addEventListener("click",b,!1)),u=!0===e||"true"===t.getAttribute("data-persist")||!1,t.open=!1,t.Dropdown=m}function p(t,e){e=e||{};var i,c,r,d,m,f,g,p,v,L=this,b=null,y={};function w(){var t,e,n=document.body.classList.contains("modal-open"),s=parseInt(getComputedStyle(document.body).paddingRight),o=document.documentElement.clientHeight!==document.documentElement.scrollHeight||document.body.clientHeight!==document.body.scrollHeight,a=i.clientHeight!==i.scrollHeight;(e=document.createElement("div")).className="modal-scrollbar-measure",document.body.appendChild(e),t=e.offsetWidth-e.clientWidth,document.body.removeChild(e),f=t,i.style.paddingRight=!a&&f?f+"px":"",document.body.style.paddingRight=a||o?s+(n?0:f)+"px":"",v.length&&v.map((function(t){var e=getComputedStyle(t).paddingRight;t.style.paddingRight=a||o?parseInt(e)+(n?0:f)+"px":parseInt(e)+"px"}))}function A(){(g=o(".modal-backdrop"))&&!document.getElementsByClassName("modal show")[0]&&(document.body.removeChild(g),g=null),null===g&&(document.body.classList.remove("modal-open"),document.body.style.paddingRight="",i.style.paddingRight="",v.length&&v.map((function(t){t.style.paddingRight=""})))}function T(t){t=t?"addEventListener":"removeEventListener",window[t]("resize",L.update,u),i[t]("click",P,!1),document[t]("keydown",N,!1)}function E(){i.style.display="block",w(),!document.getElementsByClassName("modal show")[0]&&document.body.classList.add("modal-open"),i.classList.add("show"),i.setAttribute("aria-hidden",!1),i.classList.contains("fade")?s(i,k):k()}function k(){h(i),i.isAnimating=!1,T(1),r=a("shown","modal",b),l.call(i,r)}function C(e){i.style.display="",t&&h(t),g=o(".modal-backdrop"),1!==e&&g&&g.classList.contains("show")&&!document.getElementsByClassName("modal show")[0]?(g.classList.remove("show"),s(g,A)):A(),T(),i.isAnimating=!1,m=a("hidden","modal"),l.call(i,m)}function x(e){if(!i.isAnimating){var n=e.target,s="#"+i.getAttribute("id"),o=n.getAttribute("data-target")||n.getAttribute("href"),a=t.getAttribute("data-target")||t.getAttribute("href");!i.classList.contains("show")&&(n===t&&o===s||t.contains(n)&&a===s)&&(i.modalTrigger=t,b=t,L.show(),e.preventDefault())}}function N(t){var e=t.which;!i.isAnimating&&y.keyboard&&27==e&&i.classList.contains("show")&&L.hide()}function P(t){if(!i.isAnimating){var e=t.target,n="modal"===e.getAttribute("data-dismiss"),s=e.closest('[data-dismiss="modal"]');i.classList.contains("show")&&(s||n||e===i&&"static"!==y.backdrop)&&(L.hide(),b=null,t.preventDefault())}}L.toggle=function(){i.classList.contains("show")?L.hide():L.show()},L.show=function(){if(!(i.classList.contains("show")&&i.isAnimating||(c=a("show","modal",b),l.call(i,c),c.defaultPrevented))){i.isAnimating=!0;var t,e=document.getElementsByClassName("modal show")[0];e&&e!==i&&(e.modalTrigger&&e.modalTrigger.Modal.hide(),e.Modal&&e.Modal.hide()),y.backdrop&&(t=document.createElement("div"),null===(g=o(".modal-backdrop"))&&(t.setAttribute("class","modal-backdrop"+(y.animation?" fade":"")),g=t,document.body.appendChild(g)),g=g),!g||e||g.classList.contains("show")||(g.offsetWidth,p=n(g),g.classList.add("show")),e?E():setTimeout(E,g&&p?p:0)}},L.hide=function(t){i.classList.contains("show")&&(d=a("hide","modal"),l.call(i,d),d.defaultPrevented||(i.isAnimating=!0,i.classList.remove("show"),i.setAttribute("aria-hidden",!0),i.classList.contains("fade")&&1!==t?s(i,C):C()))},L.setContent=function(t){o(".modal-content",i).innerHTML=t},L.update=function(){i.classList.contains("show")&&w()},L.dispose=function(){L.hide(1),t?(t.removeEventListener("click",x,!1),delete t.Modal):delete i.Modal},t=o(t);var B=o(t.getAttribute("data-target")||t.getAttribute("href"));i=t.classList.contains("modal")?t:B,v=Array.from(document.getElementsByClassName("fixed-top")).concat(Array.from(document.getElementsByClassName("fixed-bottom"))),t.classList.contains("modal")&&(t=null),t&&t.Modal&&t.Modal.dispose(),i&&i.Modal&&i.Modal.dispose(),y.keyboard=!1!==e.keyboard&&"false"!==i.getAttribute("data-keyboard"),y.backdrop="static"!==e.backdrop&&"static"!==i.getAttribute("data-backdrop")||"static",y.backdrop=!1!==e.backdrop&&"false"!==i.getAttribute("data-backdrop")&&y.backdrop,y.animation=!!i.classList.contains("fade"),y.content=e.content,i.isAnimating=!1,t&&!t.Modal&&t.addEventListener("click",x,!1),y.content&&L.setContent(y.content.trim()),t?(i.modalTrigger=t,t.Modal=L):i.Modal=L}var v="mousedown";function L(){return{y:window.pageYOffset||document.documentElement.scrollTop,x:window.pageXOffset||document.documentElement.scrollLeft}}function b(t,e,i,n){var s,o,a,l,c,r,d=e.offsetWidth,u=e.offsetHeight,m=document.documentElement.clientWidth||document.body.clientWidth,f=document.documentElement.clientHeight||document.body.clientHeight,h=t.getBoundingClientRect(),g=n===document.body?L():{x:n.offsetLeft+n.scrollLeft,y:n.offsetTop+n.scrollTop},p=h.right-h.left,v=h.bottom-h.top,b=e.classList.contains("popover"),y=e.getElementsByClassName("arrow")[0],w=h.top+v/2-u/2<0,A=h.left+p/2-d/2<0,T=h.left+d/2+p/2>=m,E=h.top+u/2+v/2>=f,k=h.top-u<0,C=h.left-d<0,x=h.top+u+v>=f,N=h.left+d+p>=m;i="right"===(i="left"===(i="bottom"===(i="top"===(i=("left"===i||"right"===i)&&C&&N?"top":i)&&k?"bottom":i)&&x?"top":i)&&C?"right":i)&&N?"left":i,-1===e.className.indexOf(i)&&(e.className=e.className.replace(/\b(top|bottom|left|right)+/,i)),c=y.offsetWidth,r=y.offsetHeight,"left"===i||"right"===i?(o="left"===i?h.left+g.x-d-(b?c:0):h.left+g.x+p,w?(s=h.top+g.y,a=v/2-c):E?(s=h.top+g.y-u+v,a=u-v/2-c):(s=h.top+g.y-u/2+v/2,a=u/2-(b?.9*r:r/2))):"top"!==i&&"bottom"!==i||(s="top"===i?h.top+g.y-u-(b?r:0):h.top+g.y+v,A?(o=0,l=h.left+p/2-c):T?(o=m-1.01*d,l=d-(m-h.left)+p/2-c/2):(o=h.left+g.x-d/2+p/2,l=d/2-(b?c:c/2))),e.style.top=s+"px",e.style.left=o+"px",a&&(y.style.top=a+"px"),l&&(y.style.left=l+"px")}function y(t,e){e=e||{};var i,n,c,r,m,f,h,g,p,L,y,w,A,T,E,k,C,x,N,P=this,B=null,S=0,H=/(iPhone|iPod|iPad)/.test(navigator.userAgent),M={};function I(t){null!==B&&t.target===o(".close",B)&&P.hide()}function D(){return{0:e.title||t.getAttribute("data-title")||null,1:e.content||t.getAttribute("data-content")||null}}function X(){null===B&&t.focus()}function W(e){e=e?"addEventListener":"removeEventListener","hover"===M.trigger?(t[e](v,P.show),t[e](d[0],P.show),M.dismissible||t[e](d[1],P.hide)):"click"==M.trigger?t[e](M.trigger,P.toggle):"focus"==M.trigger&&(H&&t[e]("click",X,!1),t[e](M.trigger,P.toggle))}function O(e){B&&B.contains(e.target)||e.target===t||t.contains(e.target)||P.hide()}function R(e){e=e?"addEventListener":"removeEventListener",M.dismissible?document[e]("click",I,!1):("focus"==M.trigger&&t[e]("blur",P.hide),"hover"==M.trigger&&document[e]("touchstart",O,u)),window[e]("resize",P.hide,u)}function z(){R(1),l.call(t,y)}function U(){R(),M.container.removeChild(B),S=null,B=null,l.call(t,A)}P.toggle=function(){null===B?P.show():P.hide()},P.show=function(){clearTimeout(S),S=setTimeout((function(){if(null===B){if(l.call(t,L),L.defaultPrevented)return;!function(){i=D()[0]||null,n=(n=D()[1])?n.trim():null,B=document.createElement("div");var t=document.createElement("div");if(t.classList.add("arrow"),B.appendChild(t),null!==n&&null===M.template){if(B.setAttribute("role","tooltip"),null!==i){var e=document.createElement("h3");e.classList.add("popover-header"),e.innerHTML=M.dismissible?i+p:i,B.appendChild(e)}var s=document.createElement("div");s.classList.add("popover-body"),s.innerHTML=M.dismissible&&null===i?n+p:n,B.appendChild(s)}else{var a=document.createElement("div");a.innerHTML=M.template.trim(),B.className=a.firstChild.className,B.innerHTML=a.firstChild.innerHTML;var l=o(".popover-header",B),c=o(".popover-body",B);i&&l&&(l.innerHTML=i.trim()),n&&c&&(c.innerHTML=n.trim())}M.container.appendChild(B),B.style.display="block",!B.classList.contains("popover")&&B.classList.add("popover"),!B.classList.contains(M.animation)&&B.classList.add(M.animation),!B.classList.contains(N)&&B.classList.add(N)}(),b(t,B,M.placement,M.container),!B.classList.contains("show")&&B.classList.add("show"),M.animation?s(B,z):z()}}),20)},P.hide=function(){clearTimeout(S),S=setTimeout((function(){if(B&&null!==B&&B.classList.contains("show")){if(l.call(t,w),w.defaultPrevented)return;B.classList.remove("show"),M.animation?s(B,U):U()}}),M.delay)},P.dispose=function(){P.hide(),W(),delete t.Popover},(t=o(t)).Popover&&t.Popover.dispose(),c=t.getAttribute("data-trigger"),r=t.getAttribute("data-animation"),m=t.getAttribute("data-placement"),f=t.getAttribute("data-dismissible"),h=t.getAttribute("data-delay"),g=t.getAttribute("data-container"),p='<button type="button" class="close">×</button>',L=a("show","popover"),y=a("shown","popover"),w=a("hide","popover"),A=a("hidden","popover"),T=o(e.container),E=o(g),k=t.closest(".modal"),C=t.closest(".fixed-top"),x=t.closest(".fixed-bottom"),M.template=e.template?e.template:null,M.trigger=e.trigger?e.trigger:c||"hover",M.animation=e.animation&&"fade"!==e.animation?e.animation:r||"fade",M.placement=e.placement?e.placement:m||"top",M.delay=parseInt(e.delay||h)||200,M.dismissible=!(!e.dismissible&&"true"!==f),M.container=T||(E||(C||(x||(k||document.body)))),N="bs-popover-"+M.placement;var q=D();i=q[0],((n=q[1])||M.template)&&(t.Popover||W(1),t.Popover=P)}function w(t,e){e=e||{};var i,n,s,c,r,d=this,m={};function f(){var e;e=c.getElementsByTagName("A"),i.length!==e.length&&(i.items=[],i.targets=[],Array.from(e).map((function(t){var e=t.getAttribute("href"),n=e&&"#"===e.charAt(0)&&"#"!==e.slice(-1)&&o(e);n&&(i.items.push(t),i.targets.push(n))})),i.length=e.length),i.scrollOffset=i.isWindow?L().y:t.scrollTop,i.items.map((function(e,n){return function(e){var n=i.items[e],s=i.targets[e],o=n.classList.contains("dropdown-item")&&n.closest(".dropdown-menu"),c=o&&o.previousElementSibling,r=n.nextElementSibling,d=r&&r.getElementsByClassName("active").length,u=i.isWindow&&s.getBoundingClientRect(),f=n.classList.contains("active")||!1,h=(i.isWindow?u.top+i.scrollOffset:s.offsetTop)-m.offset,g=i.isWindow?u.bottom+i.scrollOffset-m.offset:i.targets[e+1]?i.targets[e+1].offsetTop-m.offset:t.scrollHeight,p=d||i.scrollOffset>=h&&g>i.scrollOffset;if(!f&&p)n.classList.add("active"),c&&!c.classList.contains("active")&&c.classList.add("active"),l.call(t,a("activate","scrollspy",i.items[e]));else if(f&&!p)n.classList.remove("active"),c&&c.classList.contains("active")&&!n.parentNode.getElementsByClassName("active").length&&c.classList.remove("active");else if(f&&p||!p&&!f)return}(n)}))}function h(t){r[t=t?"addEventListener":"removeEventListener"]("scroll",d.refresh,u),window[t]("resize",d.refresh,u)}d.refresh=function(){f()},d.dispose=function(){h(),delete t.ScrollSpy},(t=o(t)).ScrollSpy&&t.ScrollSpy.dispose(),n=t.getAttribute("data-target"),s=t.getAttribute("data-offset"),c=o(e.target||n),r=t.offsetHeight<t.scrollHeight?t:window,c&&(m.target=c,m.offset=parseInt(e.offset||s)||10,(i={}).length=0,i.items=[],i.targets=[],i.isWindow=r===window,t.ScrollSpy||h(1),d.refresh(),t.ScrollSpy=d)}function A(t,i){i=i||{};var n,c,r,d,u,m,f,h,g,p,v,L,b,y,w,A=this,T=!1;function E(){T.style.height="",T.classList.remove("collapsing"),c.isAnimating=!1}function k(){T?b?E():setTimeout((function(){T.style.height=y+"px",T.offsetWidth,s(T,E)}),50):c.isAnimating=!1,u=a("shown","tab",g),l.call(h,u)}function C(){T&&(p.style.float="left",v.style.float="left",L=p.scrollHeight),d=a("show","tab",g),f=a("hidden","tab",h),l.call(h,d),d.defaultPrevented||(v.classList.add("active"),p.classList.remove("active"),T&&(y=v.scrollHeight,b=y===L,T.classList.add("collapsing"),T.style.height=L+"px",T.offsetHeight,p.style.float="",v.style.float=""),v.classList.contains("fade")?setTimeout((function(){v.classList.add("show"),s(v,k)}),20):k(),l.call(g,f))}function x(){var t,e=c.getElementsByClassName("active");return 1!==e.length||e[0].parentNode.classList.contains("dropdown")?e.length>1&&(t=e[e.length-1]):t=e[0],t}function N(){return o(x().getAttribute("href"))}function P(t){t.preventDefault(),h=t.currentTarget,!c.isAnimating&&A.show()}A.show=function(){if(!(h=h||t).classList.contains("active")){if(v=o(h.getAttribute("href")),g=x(),p=N(),m=a("hide","tab",h),l.call(g,m),m.defaultPrevented)return;c.isAnimating=!0,g.classList.remove("active"),g.setAttribute("aria-selected","false"),h.classList.add("active"),h.setAttribute("aria-selected","true"),r&&(t.parentNode.classList.contains("dropdown-menu")?r.classList.contains("active")||r.classList.add("active"):r.classList.contains("active")&&r.classList.remove("active")),p.classList.contains("fade")?(p.classList.remove("show"),s(p,C)):C()}},A.dispose=function(){t.removeEventListener("click",P,!1),delete t.Tab},(t=o(t)).Tab&&t.Tab.dispose(),n=t.getAttribute("data-height"),c=t.closest(".nav"),r=c&&o(".dropdown-toggle",c),w=!(!e||!1===i.height||"false"===n),c.isAnimating=!1,t.Tab||t.addEventListener("click",P,!1),w&&(T=N().parentNode),t.Tab=A}function T(t,e){e=e||{};var i,n,c,r,d,u,m,f,h=this,g=0,p={};function v(){i.classList.remove("showing"),i.classList.add("show"),l.call(i,m),p.autohide&&h.hide()}function L(){i.classList.add("hide"),l.call(i,f)}function b(){i.classList.remove("show"),p.animation?s(i,L):L()}function y(){clearTimeout(g),t.removeEventListener("click",h.hide,!1),delete t.Toast}h.show=function(){if(i&&!i.classList.contains("show")){if(l.call(i,d),d.defaultPrevented)return;p.animation&&i.classList.add("fade"),i.classList.remove("hide"),i.offsetWidth,i.classList.add("showing"),p.animation?s(i,v):v()}},h.hide=function(t){if(i&&i.classList.contains("show")){if(l.call(i,u),u.defaultPrevented)return;t?b():g=setTimeout(b,p.delay)}},h.dispose=function(){p.animation?s(i,y):y()},(t=o(t)).Toast&&t.Toast.dispose(),i=t.closest(".toast"),n=t.getAttribute("data-animation"),c=t.getAttribute("data-autohide"),r=t.getAttribute("data-delay"),d=a("show","toast"),u=a("hide","toast"),m=a("shown","toast"),f=a("hidden","toast"),p.animation=!1===e.animation||"false"===n?0:1,p.autohide=!1===e.autohide||"false"===c?0:1,p.delay=parseInt(e.delay||r)||500,t.Toast||t.addEventListener("click",h.hide,!1),t.Toast=h}function E(t,e){e=e||{};var i,n,c,r,m,f,h,g,p,L,y,w,A,T,E,k=this,C=null,x=0,N={};function P(){return t.getAttribute("title")||t.getAttribute("data-title")||t.getAttribute("data-original-title")}function B(e){C&&C.contains(e.target)||e.target===t||t.contains(e.target)||k.hide()}function S(t){t=t?"addEventListener":"removeEventListener",document[t]("touchstart",B,u),window[t]("resize",k.hide,u)}function H(){S(1),l.call(t,h)}function M(){S(),N.container.removeChild(C),C=null,x=null,l.call(t,p)}function I(e){t[e=e?"addEventListener":"removeEventListener"](v,k.show,!1),t[e](d[0],k.show,!1),t[e](d[1],k.hide,!1)}k.show=function(){clearTimeout(x),x=setTimeout((function(){if(null===C){if(l.call(t,f),f.defaultPrevented)return;!1!==function(){if(i=P()){if(C=document.createElement("div"),N.template){var t=document.createElement("div");t.innerHTML=N.template.trim(),C.className=t.firstChild.className,C.innerHTML=t.firstChild.innerHTML,o(".tooltip-inner",C).innerHTML=i.trim()}else{var e=document.createElement("div");e.classList.add("arrow"),C.appendChild(e);var n=document.createElement("div");n.classList.add("tooltip-inner"),C.appendChild(n),n.innerHTML=i}C.style.left="0",C.style.top="0",C.setAttribute("role","tooltip"),!C.classList.contains("tooltip")&&C.classList.add("tooltip"),!C.classList.contains(N.animation)&&C.classList.add(N.animation),!C.classList.contains(E)&&C.classList.add(E),N.container.appendChild(C)}}()&&(b(t,C,N.placement,N.container),!C.classList.contains("show")&&C.classList.add("show"),N.animation?s(C,H):H())}}),20)},k.hide=function(){clearTimeout(x),x=setTimeout((function(){if(C&&C.classList.contains("show")){if(l.call(t,g),g.defaultPrevented)return;C.classList.remove("show"),N.animation?s(C,M):M()}}),N.delay)},k.toggle=function(){C?k.hide():k.show()},k.dispose=function(){I(),k.hide(),t.setAttribute("title",t.getAttribute("data-original-title")),t.removeAttribute("data-original-title"),delete t.Tooltip},(t=o(t)).Tooltip&&t.Tooltip.dispose(),n=t.getAttribute("data-animation"),c=t.getAttribute("data-placement"),r=t.getAttribute("data-delay"),m=t.getAttribute("data-container"),f=a("show","tooltip"),h=a("shown","tooltip"),g=a("hide","tooltip"),p=a("hidden","tooltip"),L=o(e.container),y=o(m),w=t.closest(".modal"),A=t.closest(".fixed-top"),T=t.closest(".fixed-bottom"),N.animation=e.animation&&"fade"!==e.animation?e.animation:n||"fade",N.placement=e.placement?e.placement:c||"top",N.template=e.template?e.template:null,N.delay=parseInt(e.delay||r)||200,N.container=L||(y||(A||(T||(w||document.body)))),E="bs-tooltip-"+N.placement,(i=P())&&(t.Tooltip||(t.setAttribute("data-original-title",i),t.removeAttribute("title"),I(1)),t.Tooltip=k)}var k={};function C(t,e){Array.from(e).map((function(e){return new t(e)}))}function x(t){for(var e in t=t||document,k)C(k[e][0],t.querySelectorAll(k[e][1]))}function N(t,e){Array.from(e).map((function(e){return e[t].dispose()}))}k.Alert=[c,'[data-dismiss="alert"]'],k.Button=[r,'[data-toggle="buttons"]'],k.Carousel=[m,'[data-ride="carousel"]'],k.Collapse=[f,'[data-toggle="collapse"]'],k.Dropdown=[g,'[data-toggle="dropdown"]'],k.Modal=[p,'[data-toggle="modal"]'],k.Popover=[y,'[data-toggle="popover"],[data-tip="popover"]'],k.ScrollSpy=[w,'[data-spy="scroll"]'],k.Tab=[A,'[data-toggle="tab"]'],k.Toast=[T,'[data-dismiss="toast"]'],k.Tooltip=[E,'[data-toggle="tooltip"],[data-tip="tooltip"]'],document.body?x():document.addEventListener("DOMContentLoaded",(function t(){x(),document.removeEventListener("DOMContentLoaded",t,!1)}),!1);return{Alert:c,Button:r,Carousel:m,Collapse:f,Dropdown:g,Modal:p,Popover:y,ScrollSpy:w,Tab:A,Toast:T,Tooltip:E,initCallback:x,removeDataAPI:function(t){for(var e in t=t||document,k)N(e,t.querySelectorAll(k[e][1]))},componentsInit:k,Version:"3.0.5"}})); |
{ | ||
"name": "bootstrap.native", | ||
"version": "3.0.5", | ||
"version": "3.0.6", | ||
"description": "Native JavaScript for Bootstrap, the sweetest JavaScript library without jQuery.", | ||
@@ -8,3 +8,3 @@ "main": "dist/bootstrap-native.min.js", | ||
"jsnext": "src/index.js", | ||
"files" :[ | ||
"files": [ | ||
"dist/*.{js,map}", | ||
@@ -23,2 +23,24 @@ "src/*.{js,map}", | ||
"build-umd-min": "rollup --environment FORMAT:umd,MIN:true -c", | ||
"build-alert-esm": "rollup --environment INPUTFILE:src/components/alert-native.js,OUTPUTFILE:dist/components/alert-native.esm.js,FORMAT:esm,MIN:false -c", | ||
"build-button-esm": "rollup --environment INPUTFILE:src/components/button-native.js,OUTPUTFILE:dist/components/button-native.esm.js,FORMAT:esm,MIN:false -c", | ||
"build-carousel-esm": "rollup --environment INPUTFILE:src/components/carousel-native.js,OUTPUTFILE:dist/components/carousel-native.esm.js,FORMAT:esm,MIN:false -c", | ||
"build-collapse-esm": "rollup --environment INPUTFILE:src/components/collapse-native.js,OUTPUTFILE:dist/components/collapse-native.esm.js,FORMAT:esm,MIN:false -c", | ||
"build-dropdown-esm": "rollup --environment INPUTFILE:src/components/dropdown-native.js,OUTPUTFILE:dist/components/dropdown-native.esm.js,FORMAT:esm,MIN:false -c", | ||
"build-modal-esm": "rollup --environment INPUTFILE:src/components/modal-native.js,OUTPUTFILE:dist/components/modal-native.esm.js,FORMAT:esm,MIN:false -c", | ||
"build-popover-esm": "rollup --environment INPUTFILE:src/components/popover-native.js,OUTPUTFILE:dist/components/popover-native.esm.js,FORMAT:esm,MIN:false -c", | ||
"build-scrollspy-esm": "rollup --environment INPUTFILE:src/components/scrollspy-native.js,OUTPUTFILE:dist/components/scrollspy-native.esm.js,FORMAT:esm,MIN:false -c", | ||
"build-tab-esm": "rollup --environment INPUTFILE:src/components/tab-native.js,OUTPUTFILE:dist/components/tab-native.esm.js,FORMAT:esm,MIN:false -c", | ||
"build-toast-esm": "rollup --environment INPUTFILE:src/components/toast-native.js,OUTPUTFILE:dist/components/toast-native.esm.js,FORMAT:esm,MIN:false -c", | ||
"build-tooltip-esm": "rollup --environment INPUTFILE:src/components/tooltip-native.js,OUTPUTFILE:dist/components/tooltip-native.esm.js,FORMAT:esm,MIN:false -c", | ||
"build-alert-umd": "rollup --environment INPUTFILE:src/components/alert-native.js,OUTPUTFILE:dist/components/alert-native.js,FORMAT:umd,MIN:false -c", | ||
"build-button-umd": "rollup --environment INPUTFILE:src/components/button-native.js,OUTPUTFILE:dist/components/button-native.js,FORMAT:umd,MIN:false -c", | ||
"build-carousel-umd": "rollup --environment INPUTFILE:src/components/carousel-native.js,OUTPUTFILE:dist/components/carousel-native.js,FORMAT:umd,MIN:false -c", | ||
"build-collapse-umd": "rollup --environment INPUTFILE:src/components/collapse-native.js,OUTPUTFILE:dist/components/collapse-native.js,FORMAT:umd,MIN:false -c", | ||
"build-dropdown-umd": "rollup --environment INPUTFILE:src/components/dropdown-native.js,OUTPUTFILE:dist/components/dropdown-native.js,FORMAT:umd,MIN:false -c", | ||
"build-modal-umd": "rollup --environment INPUTFILE:src/components/modal-native.js,OUTPUTFILE:dist/components/modal-native.js,FORMAT:umd,MIN:false -c", | ||
"build-popover-umd": "rollup --environment INPUTFILE:src/components/popover-native.js,OUTPUTFILE:dist/components/popover-native.js,FORMAT:umd,MIN:false -c", | ||
"build-scrollspy-umd": "rollup --environment INPUTFILE:src/components/scrollspy-native.js,OUTPUTFILE:dist/components/scrollspy-native.js,FORMAT:umd,MIN:false -c", | ||
"build-tab-umd": "rollup --environment INPUTFILE:src/components/tab-native.js,OUTPUTFILE:dist/components/tab-native.js,FORMAT:umd,MIN:false -c", | ||
"build-toast-umd": "rollup --environment INPUTFILE:src/components/toast-native.js,OUTPUTFILE:dist/components/toast-native.js,FORMAT:umd,MIN:false -c", | ||
"build-tooltip-umd": "rollup --environment INPUTFILE:src/components/tooltip-native.js,OUTPUTFILE:dist/components/tooltip-native.js,FORMAT:umd,MIN:false -c", | ||
"polyfill": "npm-run-all --parallel pln plnm", | ||
@@ -52,3 +74,3 @@ "pln": "rollup --environment INPUTFILE:src/util/polyfill.js,OUTPUTFILE:dist/polyfill.js,FORMAT:esm,MIN:false,POLYFILL:true -c", | ||
"dependencies": { | ||
"shorter-js": "^0.0.5", | ||
"shorter-js": "^0.1.0", | ||
"minifill": "^0.0.7" | ||
@@ -58,3 +80,3 @@ }, | ||
"@rollup/plugin-buble": "^0.21.3", | ||
"@rollup/plugin-json": "^4.0.3", | ||
"@rollup/plugin-json": "^4.1.0", | ||
"@rollup/plugin-node-resolve": "^7.1.0", | ||
@@ -61,0 +83,0 @@ "npm-run-all": "^4.1.5", |
/* Native JavaScript for Bootstrap 4 | Alert | ||
-------------------------------------------- */ | ||
import { hasClass } from 'shorter-js/src/class/hasClass.js'; | ||
import { removeClass } from 'shorter-js/src/class/removeClass.js'; | ||
import { on } from 'shorter-js/src/event/on.js'; | ||
import { off } from 'shorter-js/src/event/off.js'; | ||
import { emulateTransitionEnd } from 'shorter-js/src/misc/emulateTransitionEnd.js'; | ||
import { queryElement } from 'shorter-js/src/misc/queryElement.js'; | ||
import emulateTransitionEnd from 'shorter-js/src/misc/emulateTransitionEnd.js'; | ||
import queryElement from 'shorter-js/src/misc/queryElement.js'; | ||
import { bootstrapCustomEvent, dispatchCustomEvent } from '../util/event.js'; | ||
import bootstrapCustomEvent from '../util/bootstrapCustomEvent.js'; | ||
import dispatchCustomEvent from '../util/dispatchCustomEvent.js'; | ||
@@ -30,4 +27,8 @@ // ALERT DEFINITION | ||
function triggerHandler() { | ||
hasClass(alert,'fade') ? emulateTransitionEnd(alert,transitionEndHandler) : transitionEndHandler(); | ||
alert.classList.contains('fade') ? emulateTransitionEnd(alert,transitionEndHandler) : transitionEndHandler(); | ||
} | ||
function toggleEvents(action){ | ||
action = action ? 'addEventListener' : 'removeEventListener'; | ||
element[action]('click',clickHandler,false); | ||
} | ||
@@ -41,3 +42,4 @@ // event handlers | ||
function transitionEndHandler() { | ||
off(element, 'click', clickHandler); // detach it's listener | ||
// off(element, 'click', clickHandler); // detach it's listener | ||
toggleEvents() | ||
alert.parentNode.removeChild(alert); | ||
@@ -49,7 +51,7 @@ dispatchCustomEvent.call(alert,closedCustomEvent); | ||
self.close = () => { | ||
if ( alert && element && hasClass(alert,'show') ) { | ||
if ( alert && element && alert.classList.contains('show') ) { | ||
dispatchCustomEvent.call(alert,closeCustomEvent); | ||
if ( closeCustomEvent.defaultPrevented ) return; | ||
self.dispose(); | ||
removeClass(alert,'show'); | ||
alert.classList.remove('show'); | ||
triggerHandler(); | ||
@@ -59,4 +61,5 @@ } | ||
self.dispose = () => { | ||
off(element, 'click', clickHandler); | ||
self.dispose = () => { | ||
// off(element, 'click', clickHandler); | ||
toggleEvents() | ||
delete element.Alert; | ||
@@ -77,3 +80,4 @@ } | ||
if ( !element.Alert ) { | ||
on(element, 'click', clickHandler); | ||
// on(element, 'click', clickHandler); | ||
toggleEvents(1) | ||
} | ||
@@ -80,0 +84,0 @@ |
/* Native JavaScript for Bootstrap 4 | Button | ||
---------------------------------------------*/ | ||
import { hasClass } from 'shorter-js/src/class/hasClass.js'; | ||
import { addClass } from 'shorter-js/src/class/addClass.js'; | ||
import { removeClass } from 'shorter-js/src/class/removeClass.js'; | ||
import { on } from 'shorter-js/src/event/on.js'; | ||
import { off } from 'shorter-js/src/event/off.js'; | ||
import { queryElement } from 'shorter-js/src/misc/queryElement.js'; | ||
import queryElement from 'shorter-js/src/misc/queryElement.js'; | ||
import { bootstrapCustomEvent, dispatchCustomEvent } from '../util/event.js'; | ||
import bootstrapCustomEvent from '../util/bootstrapCustomEvent.js'; | ||
import dispatchCustomEvent from '../util/dispatchCustomEvent.js'; | ||
@@ -44,3 +40,3 @@ // BUTTON DEFINITION | ||
if ( !input.checked ) { | ||
addClass(label,'active'); | ||
label.classList.add('active'); | ||
input.getAttribute('checked'); | ||
@@ -50,3 +46,3 @@ input.setAttribute('checked','checked'); | ||
} else { | ||
removeClass(label,'active'); | ||
label.classList.remove('active'); | ||
input.getAttribute('checked'); | ||
@@ -66,4 +62,4 @@ input.removeAttribute('checked'); | ||
if ( !input.checked || (e.screenX === 0 && e.screenY == 0) ) { | ||
addClass(label,'active'); | ||
addClass(label,'focus'); | ||
label.classList.add('active'); | ||
label.classList.add('focus'); | ||
input.setAttribute('checked','checked'); | ||
@@ -75,5 +71,5 @@ input.checked = true; | ||
let otherInput = otherLabel.getElementsByTagName('INPUT')[0]; | ||
if ( otherLabel !== label && hasClass(otherLabel,'active') ) { | ||
if ( otherLabel !== label && otherLabel.classList.contains('active') ) { | ||
dispatchCustomEvent.call(otherInput, changeCustomEvent); // trigger the change | ||
removeClass(otherLabel,'active'); | ||
otherLabel.classList.remove('active'); | ||
otherInput.removeAttribute('checked'); | ||
@@ -98,11 +94,12 @@ otherInput.checked = false; | ||
function focusToggle(e) { | ||
let action = e.type === 'focusin' ? addClass : removeClass; | ||
if (e.target.tagName === 'INPUT' ) { | ||
action(e.target.closest('.btn'),'focus'); | ||
let action = e.type === 'focusin' ? 'add' : 'remove'; | ||
e.target.closest('.btn').classList[action]('focus'); | ||
} | ||
} | ||
function toggleEvents(action) { | ||
action( element, 'click', toggle ); | ||
action( element, 'keyup', keyHandler ), action( element, 'keydown', preventScroll ); | ||
action( element, 'focusin', focusToggle), action( element, 'focusout', focusToggle); | ||
action = action ? 'addEventListener' : 'removeEventListener'; | ||
element[action]('click',toggle,false ); | ||
element[action]('keyup',keyHandler,false), element[action]('keydown',preventScroll,false); | ||
element[action]('focusin',focusToggle,false), element[action]('focusout',focusToggle,false); | ||
} | ||
@@ -112,3 +109,3 @@ | ||
self.dispose = () => { | ||
toggleEvents(off); | ||
toggleEvents(); | ||
delete element.Button; | ||
@@ -131,3 +128,3 @@ } | ||
if ( !element.Button ) { | ||
toggleEvents(on); | ||
toggleEvents(1); | ||
} | ||
@@ -144,10 +141,10 @@ | ||
Array.from(labels).map((btn)=>{ | ||
!hasClass(btn,'active') | ||
!btn.classList.contains('active') | ||
&& queryElement('input:checked',btn) | ||
&& addClass(btn,'active'); | ||
hasClass(btn,'active') | ||
&& btn.classList.add('active'); | ||
btn.classList.contains('active') | ||
&& !queryElement('input:checked',btn) | ||
&& removeClass(btn,'active'); | ||
&& btn.classList.remove('active'); | ||
}) | ||
} | ||
/* Native JavaScript for Bootstrap 4 | Carousel | ||
----------------------------------------------- */ | ||
import { hasClass } from 'shorter-js/src/class/hasClass.js'; | ||
import { addClass } from 'shorter-js/src/class/addClass.js'; | ||
import { removeClass } from 'shorter-js/src/class/removeClass.js'; | ||
import { on } from 'shorter-js/src/event/on.js'; | ||
import { off } from 'shorter-js/src/event/off.js'; | ||
import { touchEvents } from 'shorter-js/src/strings/touchEvents.js'; | ||
import { mouseHoverEvents } from 'shorter-js/src/strings/mouseHoverEvents.js'; | ||
import { passiveHandler } from 'shorter-js/src/misc/passiveHandler.js'; | ||
import { getElementTransitionDuration } from 'shorter-js/src/misc/getElementTransitionDuration.js'; | ||
import { emulateTransitionEnd } from 'shorter-js/src/misc/emulateTransitionEnd.js'; | ||
import { isElementInScrollRange } from 'shorter-js/src/misc/isElementInScrollRange.js'; | ||
import { queryElement } from 'shorter-js/src/misc/queryElement.js'; | ||
import mouseHoverEvents from 'shorter-js/src/strings/mouseHoverEvents.js'; | ||
import passiveHandler from 'shorter-js/src/misc/passiveHandler.js'; | ||
import getElementTransitionDuration from 'shorter-js/src/misc/getElementTransitionDuration.js'; | ||
import emulateTransitionEnd from 'shorter-js/src/misc/emulateTransitionEnd.js'; | ||
import isElementInScrollRange from 'shorter-js/src/misc/isElementInScrollRange.js'; | ||
import queryElement from 'shorter-js/src/misc/queryElement.js'; | ||
import { bootstrapCustomEvent, dispatchCustomEvent } from '../util/event.js'; | ||
import bootstrapCustomEvent from '../util/bootstrapCustomEvent.js'; | ||
import dispatchCustomEvent from '../util/dispatchCustomEvent.js'; | ||
@@ -41,4 +36,4 @@ // CAROUSEL DEFINITION | ||
function pauseHandler() { | ||
if ( ops.interval !==false && !hasClass(element,'paused') ) { | ||
addClass(element,'paused'); | ||
if ( ops.interval !==false && !element.classList.contains('paused') ) { | ||
element.classList.add('paused'); | ||
!vars.isSliding && ( clearInterval(vars.timer), vars.timer = null ); | ||
@@ -48,4 +43,4 @@ } | ||
function resumeHandler() { | ||
if ( ops.interval !== false && hasClass(element,'paused') ) { | ||
removeClass(element,'paused'); | ||
if ( ops.interval !== false && element.classList.contains('paused') ) { | ||
element.classList.remove('paused'); | ||
!vars.isSliding && ( clearInterval(vars.timer), vars.timer = null ); | ||
@@ -61,3 +56,3 @@ !vars.isSliding && self.cycle(); | ||
if ( eventTarget && !hasClass(eventTarget,'active') && eventTarget.getAttribute('data-slide-to') ) { | ||
if ( eventTarget && !eventTarget.classList.contains('active') && eventTarget.getAttribute('data-slide-to') ) { | ||
vars.index = parseInt( eventTarget.getAttribute('data-slide-to')); | ||
@@ -96,21 +91,23 @@ } else { return false; } | ||
function toggleEvents(action) { | ||
action = action ? 'addEventListener' : 'removeEventListener' | ||
if ( ops.pause && ops.interval ) { | ||
action( element, mouseHoverEvents[0], pauseHandler ); | ||
action( element, mouseHoverEvents[1], resumeHandler ); | ||
action( element, touchEvents.start, pauseHandler, passiveHandler ); | ||
action( element, touchEvents.end, resumeHandler, passiveHandler ); | ||
element[action]( mouseHoverEvents[0], pauseHandler, false ); | ||
element[action]( mouseHoverEvents[1], resumeHandler, false ); | ||
element[action]( 'touchstart', pauseHandler, passiveHandler ); | ||
element[action]( 'touchend', resumeHandler, passiveHandler ); | ||
} | ||
ops.touch && slides.length > 1 && action( element, touchEvents.start, touchDownHandler, passiveHandler ); | ||
ops.touch && slides.length > 1 && element[action]( 'touchstart', touchDownHandler, passiveHandler ); | ||
rightArrow && action( rightArrow, 'click', controlsHandler ); | ||
leftArrow && action( leftArrow, 'click', controlsHandler ); | ||
rightArrow && rightArrow[action]( 'click', controlsHandler,false ); | ||
leftArrow && leftArrow[action]( 'click', controlsHandler,false ); | ||
indicator && action( indicator, 'click', indicatorHandler ); | ||
ops.keyboard && action( window, 'keydown', keyHandler ); | ||
indicator && indicator[action]( 'click', indicatorHandler,false ); | ||
ops.keyboard && window[action]( 'keydown', keyHandler,false ); | ||
} | ||
// touch events | ||
function toggleTouchEvents(action) { | ||
action( element, touchEvents.move, touchMoveHandler, passiveHandler ); | ||
action( element, touchEvents.end, touchEndHandler, passiveHandler ); | ||
action = action ? 'addEventListener' : 'removeEventListener'; | ||
element[action]( 'touchmove', touchMoveHandler, passiveHandler ); | ||
element[action]( 'touchend', touchEndHandler, passiveHandler ); | ||
} | ||
@@ -124,3 +121,3 @@ function touchDownHandler(e) { | ||
vars.isTouch = true; | ||
toggleTouchEvents(on); | ||
toggleTouchEvents(1); | ||
} | ||
@@ -157,3 +154,3 @@ } | ||
} | ||
toggleTouchEvents(off); | ||
toggleTouchEvents(); // remove | ||
} | ||
@@ -163,4 +160,4 @@ } | ||
function setActivePage(pageIndex) { //indicators | ||
Array.from(indicators).map(x=>{removeClass(x,'active')}) | ||
indicators[pageIndex] && addClass(indicators[pageIndex], 'active'); | ||
Array.from(indicators).map(x=>{x.classList.remove('active')}) | ||
indicators[pageIndex] && indicators[pageIndex].classList.add('active'); | ||
} | ||
@@ -178,12 +175,12 @@ function transitionEndHandler(e){ | ||
addClass(slides[next],'active'); | ||
removeClass(slides[activeItem],'active'); | ||
slides[next].classList.add('active'); | ||
slides[activeItem].classList.remove('active'); | ||
removeClass(slides[next],`carousel-item-${orientation}`); | ||
removeClass(slides[next],`carousel-item-${vars.direction}`); | ||
removeClass(slides[activeItem],`carousel-item-${vars.direction}`); | ||
slides[next].classList.remove(`carousel-item-${orientation}`); | ||
slides[next].classList.remove(`carousel-item-${vars.direction}`); | ||
slides[activeItem].classList.remove(`carousel-item-${vars.direction}`); | ||
dispatchCustomEvent.call(element, slidCustomEvent); | ||
// check for element, might have been disposed | ||
if ( !document.hidden && ops.interval && !hasClass(element,'paused') ) { | ||
if ( !document.hidden && ops.interval && !element.classList.contains('paused') ) { | ||
self.cycle(); | ||
@@ -243,8 +240,8 @@ } | ||
if ( getElementTransitionDuration(slides[next]) && hasClass(element,'slide') ) { | ||
if ( getElementTransitionDuration(slides[next]) && element.classList.contains('slide') ) { | ||
addClass(slides[next],`carousel-item-${orientation}`); | ||
slides[next].classList.add(`carousel-item-${orientation}`); | ||
slides[next].offsetWidth; | ||
addClass(slides[next],`carousel-item-${vars.direction}`); | ||
addClass(slides[activeItem],`carousel-item-${vars.direction}`); | ||
slides[next].classList.add(`carousel-item-${vars.direction}`); | ||
slides[activeItem].classList.add(`carousel-item-${vars.direction}`); | ||
@@ -254,9 +251,9 @@ emulateTransitionEnd(slides[next], transitionEndHandler); | ||
} else { | ||
addClass(slides[next],'active'); | ||
slides[next].classList.add('active'); | ||
slides[next].offsetWidth; | ||
removeClass(slides[activeItem],'active'); | ||
slides[activeItem].classList.remove('active'); | ||
setTimeout(() => { | ||
vars.isSliding = false; | ||
// check for element, might have been disposed | ||
if ( ops.interval && element && !hasClass(element,'paused') ) { | ||
if ( ops.interval && element && !element.classList.contains('paused') ) { | ||
self.cycle(); | ||
@@ -275,8 +272,8 @@ } | ||
Array.from(slides).map((slide,idx) => { | ||
hasClass(slide,'active') && setActivePage( idx ) | ||
itemClasses.map(cls => removeClass(slide,`carousel-item-${cls}`)) | ||
slide.classList.contains('active') && setActivePage( idx ) | ||
itemClasses.map(cls => slide.classList.remove(`carousel-item-${cls}`)) | ||
}) | ||
clearInterval(vars.timer); | ||
toggleEvents(off); | ||
toggleEvents(); | ||
vars = {}; | ||
@@ -331,3 +328,3 @@ ops = {}; | ||
if (self.getActiveIndex()<0) { | ||
slides.length && addClass(slides[0],'active'); | ||
slides.length && slides[0].classList.add('active'); | ||
indicators.length && setActivePage(0); | ||
@@ -350,3 +347,3 @@ } | ||
// attach event handlers | ||
toggleEvents(on); | ||
toggleEvents(1); | ||
@@ -353,0 +350,0 @@ // start to cycle if interval is set |
/* Native JavaScript for Bootstrap 4 | Collapse | ||
----------------------------------------------- */ | ||
import { hasClass } from 'shorter-js/src/class/hasClass.js'; | ||
import { addClass } from 'shorter-js/src/class/addClass.js'; | ||
import { removeClass } from 'shorter-js/src/class/removeClass.js'; | ||
import { on } from 'shorter-js/src/event/on.js'; | ||
import { off } from 'shorter-js/src/event/off.js'; | ||
import { emulateTransitionEnd } from 'shorter-js/src/misc/emulateTransitionEnd.js'; | ||
import { queryElement } from 'shorter-js/src/misc/queryElement.js'; | ||
import emulateTransitionEnd from 'shorter-js/src/misc/emulateTransitionEnd.js'; | ||
import queryElement from 'shorter-js/src/misc/queryElement.js'; | ||
import { bootstrapCustomEvent, dispatchCustomEvent } from '../util/event.js'; | ||
import bootstrapCustomEvent from '../util/bootstrapCustomEvent.js'; | ||
import dispatchCustomEvent from '../util/dispatchCustomEvent.js'; | ||
@@ -41,4 +37,4 @@ // COLLAPSE DEFINITION | ||
collapseElement.isAnimating = true; | ||
addClass(collapseElement,'collapsing'); | ||
removeClass(collapseElement,'collapse'); | ||
collapseElement.classList.add('collapsing'); | ||
collapseElement.classList.remove('collapse'); | ||
collapseElement.style.height = `${collapseElement.scrollHeight}px`; | ||
@@ -50,5 +46,5 @@ | ||
toggle.setAttribute('aria-expanded','true'); | ||
removeClass(collapseElement,'collapsing'); | ||
addClass(collapseElement, 'collapse'); | ||
addClass(collapseElement,'show'); | ||
collapseElement.classList.remove('collapsing'); | ||
collapseElement.classList.add('collapse'); | ||
collapseElement.classList.add('show'); | ||
collapseElement.style.height = ''; | ||
@@ -63,5 +59,5 @@ dispatchCustomEvent.call(collapseElement, shownCustomEvent); | ||
collapseElement.style.height = `${collapseElement.scrollHeight}px`; // set height first | ||
removeClass(collapseElement,'collapse'); | ||
removeClass(collapseElement,'show'); | ||
addClass(collapseElement,'collapsing'); | ||
collapseElement.classList.remove('collapse'); | ||
collapseElement.classList.remove('show'); | ||
collapseElement.classList.add('collapsing'); | ||
collapseElement.offsetWidth; // force reflow to enable transition | ||
@@ -74,4 +70,4 @@ collapseElement.style.height = '0px'; | ||
toggle.setAttribute('aria-expanded','false'); | ||
removeClass(collapseElement,'collapsing'); | ||
addClass(collapseElement,'collapse'); | ||
collapseElement.classList.remove('collapsing'); | ||
collapseElement.classList.add('collapse'); | ||
collapseElement.style.height = ''; | ||
@@ -86,3 +82,3 @@ dispatchCustomEvent.call(collapseElement, hiddenCustomEvent); | ||
if (element.contains(e.target) || e.target === element) { | ||
if (!hasClass(collapse,'show')) { self.show(); } | ||
if (!collapse.classList.contains('show')) { self.show(); } | ||
else { self.hide(); } | ||
@@ -94,3 +90,3 @@ } | ||
closeAction(collapse,element); | ||
addClass(element,'collapsed'); | ||
element.classList.add('collapsed'); | ||
} | ||
@@ -107,10 +103,10 @@ self.show = () => { | ||
closeAction(activeCollapse,activeElement); | ||
addClass(activeElement,'collapsed'); | ||
activeElement.classList.add('collapsed'); | ||
} | ||
openAction(collapse,element); | ||
removeClass(element,'collapsed'); | ||
element.classList.remove('collapsed'); | ||
} | ||
} | ||
self.dispose = () => { | ||
off(element, 'click', self.toggle); | ||
element.removeEventListener('click',self.toggle,false); | ||
delete element.Collapse; | ||
@@ -144,3 +140,3 @@ } | ||
if ( !element.Collapse ) { | ||
on(element, 'click', self.toggle); | ||
element.addEventListener('click',self.toggle,false); | ||
} | ||
@@ -147,0 +143,0 @@ |
/* Native JavaScript for Bootstrap 4 | Dropdown | ||
----------------------------------------------- */ | ||
import { hasClass } from 'shorter-js/src/class/hasClass.js'; | ||
import { addClass } from 'shorter-js/src/class/addClass.js'; | ||
import { removeClass } from 'shorter-js/src/class/removeClass.js'; | ||
import { on } from 'shorter-js/src/event/on.js'; | ||
import { off } from 'shorter-js/src/event/off.js'; | ||
import { queryElement } from 'shorter-js/src/misc/queryElement.js'; | ||
import queryElement from 'shorter-js/src/misc/queryElement.js'; | ||
import { bootstrapCustomEvent, dispatchCustomEvent } from '../util/event.js'; | ||
import { setFocus } from '../util/misc.js'; | ||
import bootstrapCustomEvent from '../util/bootstrapCustomEvent.js'; | ||
import dispatchCustomEvent from '../util/dispatchCustomEvent.js'; | ||
import setFocus from '../util/setFocus.js'; | ||
@@ -40,7 +36,7 @@ // DROPDOWN DEFINITION | ||
function toggleDismiss() { | ||
let action = element.open ? on : off; | ||
action(document, 'click', dismissHandler); | ||
action(document, 'keydown', preventScroll); | ||
action(document, 'keyup', keyHandler); | ||
action(document, 'focus', dismissHandler, true); | ||
let action = element.open ? 'addEventListener' : 'removeEventListener'; | ||
document[action]('click',dismissHandler,false); | ||
document[action]('keydown',preventScroll,false); | ||
document[action]('keyup',keyHandler,false); | ||
document[action]('focus',dismissHandler,false); | ||
} | ||
@@ -72,9 +68,9 @@ // handlers | ||
} | ||
function keyHandler({which, keyCode}) { | ||
let key = which || keyCode, | ||
function keyHandler(e) { | ||
let key = e.which || e.keyCode, | ||
activeItem = document.activeElement, | ||
isSameElement = activeItem === element, | ||
isInsideMenu = menu.contains(activeItem), | ||
isMenuItem = activeItem.parentNode === menu || activeItem.parentNode.parentNode === menu; | ||
let idx = menuItems.indexOf(activeItem); | ||
isMenuItem = activeItem.parentNode === menu || activeItem.parentNode.parentNode === menu, | ||
idx = menuItems.indexOf(activeItem); | ||
@@ -103,7 +99,7 @@ if ( isMenuItem ) { // navigate up | down | ||
addClass(menu,'show'); | ||
addClass(parent,'show'); | ||
menu.classList.add('show'); | ||
parent.classList.add('show'); | ||
element.setAttribute('aria-expanded',true); | ||
element.open = true; | ||
off(element, 'click', clickHandler); | ||
element.removeEventListener('click',clickHandler,false); | ||
setTimeout(() => { | ||
@@ -121,4 +117,4 @@ setFocus( menu.getElementsByTagName('INPUT')[0] || element ); // focus the first input item | element | ||
removeClass(menu,'show'); | ||
removeClass(parent,'show'); | ||
menu.classList.remove('show'); | ||
parent.classList.remove('show'); | ||
element.setAttribute('aria-expanded',false); | ||
@@ -130,3 +126,3 @@ element.open = false; | ||
// only re-attach handler if the init is not disposed | ||
element.Dropdown && on(element, 'click', clickHandler); | ||
element.Dropdown && element.addEventListener('click',clickHandler,false); | ||
},1); | ||
@@ -138,8 +134,8 @@ | ||
self.toggle = () => { | ||
if (hasClass(parent,'show') && element.open) { self.hide(); } | ||
if (parent.classList.contains('show') && element.open) { self.hide(); } | ||
else { self.show(); } | ||
} | ||
self.dispose = () => { | ||
if (hasClass(parent,'show') && element.open) { self.hide(); } | ||
off(element, 'click', clickHandler); | ||
if (parent.classList.contains('show') && element.open) { self.hide(); } | ||
element.removeEventListener('click',clickHandler,false); | ||
delete element.Dropdown; | ||
@@ -168,3 +164,3 @@ } | ||
!('tabindex' in menu) && menu.setAttribute('tabindex', '0'); // Fix onblur on Chrome | Safari | ||
on(element, 'click', clickHandler); | ||
element.addEventListener('click',clickHandler,false); | ||
} | ||
@@ -171,0 +167,0 @@ |
/* Native JavaScript for Bootstrap 4 | Modal | ||
-------------------------------------------- */ | ||
import { hasClass } from 'shorter-js/src/class/hasClass.js'; | ||
import { addClass } from 'shorter-js/src/class/addClass.js'; | ||
import { removeClass } from 'shorter-js/src/class/removeClass.js'; | ||
import { on } from 'shorter-js/src/event/on.js'; | ||
import { off } from 'shorter-js/src/event/off.js'; | ||
import { passiveHandler } from 'shorter-js/src/misc/passiveHandler.js'; | ||
import { emulateTransitionEnd } from 'shorter-js/src/misc/emulateTransitionEnd.js'; | ||
import { getElementTransitionDuration } from 'shorter-js/src/misc/getElementTransitionDuration.js'; | ||
import { queryElement } from 'shorter-js/src/misc/queryElement.js'; | ||
import passiveHandler from 'shorter-js/src/misc/passiveHandler.js'; | ||
import emulateTransitionEnd from 'shorter-js/src/misc/emulateTransitionEnd.js'; | ||
import getElementTransitionDuration from 'shorter-js/src/misc/getElementTransitionDuration.js'; | ||
import queryElement from 'shorter-js/src/misc/queryElement.js'; | ||
import { bootstrapCustomEvent, dispatchCustomEvent } from '../util/event.js'; | ||
import { setFocus } from '../util/misc.js'; | ||
import bootstrapCustomEvent from '../util/bootstrapCustomEvent.js'; | ||
import dispatchCustomEvent from '../util/dispatchCustomEvent.js'; | ||
import setFocus from '../util/setFocus.js'; | ||
@@ -45,3 +41,3 @@ // MODAL DEFINITION | ||
function setScrollbar() { | ||
let openModal = hasClass(document.body,'modal-open'), | ||
let openModal = document.body.classList.contains('modal-open'), | ||
bodyPad = parseInt(getComputedStyle(document.body).paddingRight), | ||
@@ -97,8 +93,9 @@ bodyOverflow = document.documentElement.clientHeight !== document.documentElement.scrollHeight | ||
} | ||
overlay === null && (removeClass(document.body,'modal-open'), resetScrollbar()); | ||
overlay === null && (document.body.classList.remove('modal-open'), resetScrollbar()); | ||
} | ||
function toggleEvents(action) { | ||
action(window, 'resize', self.update, passiveHandler); | ||
action(modal, 'click', dismissHandler); | ||
action(document, 'keydown', keyHandler); | ||
action = action ? 'addEventListener' : 'removeEventListener'; | ||
window[action]( 'resize', self.update, passiveHandler); | ||
modal[action]( 'click',dismissHandler,false); | ||
document[action]( 'keydown',keyHandler,false); | ||
} | ||
@@ -110,8 +107,8 @@ // triggers | ||
setScrollbar(); | ||
!document.getElementsByClassName('modal show')[0] && addClass(document.body,'modal-open'); | ||
!document.getElementsByClassName('modal show')[0] && document.body.classList.add('modal-open'); | ||
addClass(modal,'show'); | ||
modal.classList.add('show'); | ||
modal.setAttribute('aria-hidden', false); | ||
hasClass(modal,'fade') ? emulateTransitionEnd(modal, triggerShow) : triggerShow(); | ||
modal.classList.contains('fade') ? emulateTransitionEnd(modal, triggerShow) : triggerShow(); | ||
} | ||
@@ -122,3 +119,3 @@ function triggerShow() { | ||
toggleEvents(on); | ||
toggleEvents(1); | ||
@@ -135,4 +132,4 @@ shownCustomEvent = bootstrapCustomEvent('shown', 'modal', relatedTarget); | ||
// force can also be the transitionEvent object, we wanna make sure it's not | ||
if (force !== 1 && overlay && hasClass(overlay,'show') && !document.getElementsByClassName('modal show')[0]) { | ||
removeClass(overlay,'show'); | ||
if (force !== 1 && overlay && overlay.classList.contains('show') && !document.getElementsByClassName('modal show')[0]) { | ||
overlay.classList.remove('show'); | ||
emulateTransitionEnd(overlay,removeOverlay); | ||
@@ -143,3 +140,3 @@ } else { | ||
toggleEvents(off); | ||
toggleEvents(); | ||
@@ -159,3 +156,3 @@ modal.isAnimating = false; | ||
if ( !hasClass(modal,'show') | ||
if ( !modal.classList.contains('show') | ||
&& (clickTarget === element && targetAttrValue === modalID | ||
@@ -170,3 +167,3 @@ || element.contains(clickTarget) && elemAttrValue === modalID) ) { | ||
function keyHandler({which}) { | ||
if (!modal.isAnimating && ops.keyboard && which == 27 && hasClass(modal,'show') ) { | ||
if (!modal.isAnimating && ops.keyboard && which == 27 && modal.classList.contains('show') ) { | ||
self.hide(); | ||
@@ -181,3 +178,3 @@ } | ||
if ( hasClass(modal,'show') && ( parentWithData || hasData | ||
if ( modal.classList.contains('show') && ( parentWithData || hasData | ||
|| clickTarget === modal && ops.backdrop !== 'static' ) ) { | ||
@@ -191,6 +188,6 @@ self.hide(); relatedTarget = null; | ||
self.toggle = () => { | ||
if ( hasClass(modal,'show') ) {self.hide();} else {self.show();} | ||
if ( modal.classList.contains('show') ) {self.hide();} else {self.show();} | ||
}; | ||
self.show = () => { | ||
if (hasClass(modal, 'show') && !!modal.isAnimating ) {return} | ||
if (modal.classList.contains('show') && !!modal.isAnimating ) {return} | ||
@@ -215,6 +212,6 @@ showCustomEvent = bootstrapCustomEvent('show', 'modal', relatedTarget); | ||
if ( overlay && !currentOpen && !hasClass(overlay,'show') ) { | ||
if ( overlay && !currentOpen && !overlay.classList.contains('show') ) { | ||
overlay.offsetWidth; // force reflow to enable trasition | ||
overlayDelay = getElementTransitionDuration(overlay); | ||
addClass(overlay, 'show'); | ||
overlay.classList.add('show'); | ||
} | ||
@@ -225,3 +222,3 @@ | ||
self.hide = (force) => { | ||
if ( !hasClass(modal,'show') ) {return} | ||
if ( !modal.classList.contains('show') ) {return} | ||
@@ -234,6 +231,6 @@ hideCustomEvent = bootstrapCustomEvent( 'hide', 'modal'); | ||
removeClass(modal,'show'); | ||
modal.classList.remove('show'); | ||
modal.setAttribute('aria-hidden', true); | ||
hasClass(modal,'fade') && force !== 1 ? emulateTransitionEnd(modal, triggerHide) : triggerHide(); | ||
modal.classList.contains('fade') && force !== 1 ? emulateTransitionEnd(modal, triggerHide) : triggerHide(); | ||
}; | ||
@@ -244,3 +241,3 @@ self.setContent = content => { | ||
self.update = () => { | ||
if (hasClass(modal,'show')) { | ||
if (modal.classList.contains('show')) { | ||
setScrollbar(); | ||
@@ -251,3 +248,3 @@ } | ||
self.hide(1); | ||
if (element) {off(element, 'click', clickHandler); delete element.Modal; } | ||
if (element) {element.removeEventListener('click',clickHandler,false); delete element.Modal; } | ||
else {delete modal.Modal;} | ||
@@ -263,3 +260,3 @@ }; | ||
let checkModal = queryElement( element.getAttribute('data-target') || element.getAttribute('href') ) | ||
modal = hasClass(element,'modal') ? element : checkModal | ||
modal = element.classList.contains('modal') ? element : checkModal | ||
@@ -270,3 +267,3 @@ // set fixed items | ||
if ( hasClass(element, 'modal') ) { element = null; } // modal is now independent of it's triggering element | ||
if ( element.classList.contains('modal') ) { element = null; } // modal is now independent of it's triggering element | ||
@@ -281,3 +278,3 @@ // reset on re-init | ||
ops.backdrop = options.backdrop === false || modal.getAttribute('data-backdrop') === 'false' ? false : ops.backdrop; | ||
ops.animation = hasClass(modal, 'fade') ? true : false; | ||
ops.animation = modal.classList.contains('fade') ? true : false; | ||
ops.content = options.content; // JavaScript only | ||
@@ -291,3 +288,3 @@ | ||
if ( element && !element.Modal ) { | ||
on(element, 'click', clickHandler); | ||
element.addEventListener('click',clickHandler,false); | ||
} | ||
@@ -294,0 +291,0 @@ |
/* Native JavaScript for Bootstrap 4 | Popover | ||
---------------------------------------------- */ | ||
import { hasClass } from 'shorter-js/src/class/hasClass.js'; | ||
import { addClass } from 'shorter-js/src/class/addClass.js'; | ||
import { removeClass } from 'shorter-js/src/class/removeClass.js'; | ||
import { on } from 'shorter-js/src/event/on.js'; | ||
import { off } from 'shorter-js/src/event/off.js'; | ||
import { mouseHoverEvents } from 'shorter-js/src/strings/mouseHoverEvents.js'; | ||
import { mouseClickEvents } from 'shorter-js/src/strings/mouseClickEvents.js'; | ||
import { touchEvents } from 'shorter-js/src/strings/touchEvents.js'; | ||
import { passiveHandler } from 'shorter-js/src/misc/passiveHandler.js'; | ||
import { emulateTransitionEnd } from 'shorter-js/src/misc/emulateTransitionEnd.js'; | ||
import { queryElement } from 'shorter-js/src/misc/queryElement.js'; | ||
// import { tryWrapper } from 'shorter-js/src/misc/tryWrapper.js'; | ||
import mouseHoverEvents from 'shorter-js/src/strings/mouseHoverEvents.js'; | ||
import mouseClickEvents from 'shorter-js/src/strings/mouseClickEvents.js'; | ||
import passiveHandler from 'shorter-js/src/misc/passiveHandler.js'; | ||
import emulateTransitionEnd from 'shorter-js/src/misc/emulateTransitionEnd.js'; | ||
import queryElement from 'shorter-js/src/misc/queryElement.js'; | ||
import { bootstrapCustomEvent, dispatchCustomEvent } from '../util/event.js'; | ||
import { styleTip } from '../util/misc.js'; | ||
import bootstrapCustomEvent from '../util/bootstrapCustomEvent.js'; | ||
import dispatchCustomEvent from '../util/dispatchCustomEvent.js'; | ||
import styleTip from '../util/styleTip.js'; | ||
@@ -99,3 +93,3 @@ // POPOVER DEFINITION | ||
let popoverArrow = document.createElement('div'); | ||
addClass(popoverArrow,'arrow'); | ||
popoverArrow.classList.add('arrow'); | ||
popover.appendChild(popoverArrow); | ||
@@ -109,3 +103,3 @@ | ||
let popoverTitle = document.createElement('h3'); | ||
addClass(popoverTitle,'popover-header'); | ||
popoverTitle.classList.add('popover-header'); | ||
popoverTitle.innerHTML = ops.dismissible ? titleString + closeBtn : titleString; | ||
@@ -117,3 +111,3 @@ popover.appendChild(popoverTitle); | ||
let popoverBodyMarkup = document.createElement('div'); | ||
addClass(popoverBodyMarkup,'popover-body'); | ||
popoverBodyMarkup.classList.add('popover-body'); | ||
popoverBodyMarkup.innerHTML = ops.dismissible && titleString === null ? contentString + closeBtn : contentString; | ||
@@ -139,8 +133,8 @@ popover.appendChild(popoverBodyMarkup); | ||
popover.style.display = 'block'; | ||
!hasClass(popover, 'popover') && addClass(popover, 'popover'); | ||
!hasClass(popover, ops.animation) && addClass(popover, ops.animation); | ||
!hasClass(popover, placementClass) && addClass(popover, placementClass); | ||
!popover.classList.contains( 'popover') && popover.classList.add('popover'); | ||
!popover.classList.contains( ops.animation) && popover.classList.add(ops.animation); | ||
!popover.classList.contains( placementClass) && popover.classList.add(placementClass); | ||
} | ||
function showPopover() { | ||
!hasClass(popover,'show') && ( addClass(popover,'show') ); | ||
!popover.classList.contains('show') && ( popover.classList.add('show') ); | ||
} | ||
@@ -154,11 +148,12 @@ function updatePopover() { | ||
function toggleEvents(action) { | ||
action = action ? 'addEventListener' : 'removeEventListener'; | ||
if (ops.trigger === 'hover') { | ||
action( element, mouseClickEvents.down, self.show ); | ||
action( element, mouseHoverEvents[0], self.show ); | ||
if (!ops.dismissible) { action( element, mouseHoverEvents[1], self.hide ); } // mouseHover = ('onmouseleave' in document) ? [ 'mouseenter', 'mouseleave'] : [ 'mouseover', 'mouseout' ] | ||
element[action]( mouseClickEvents.down, self.show ); | ||
element[action]( mouseHoverEvents[0], self.show ); | ||
if (!ops.dismissible) { element[action]( mouseHoverEvents[1], self.hide ); } // mouseHover = ('onmouseleave' in document) ? [ 'mouseenter', 'mouseleave'] : [ 'mouseover', 'mouseout' ] | ||
} else if ('click' == ops.trigger) { | ||
action( element, ops.trigger, self.toggle ); | ||
element[action]( ops.trigger, self.toggle ); | ||
} else if ('focus' == ops.trigger) { | ||
isIphone && action( element, 'click', forceFocus ); | ||
action( element, ops.trigger, self.toggle ); | ||
isIphone && element[action]( 'click', forceFocus, false ); | ||
element[action]( ops.trigger, self.toggle ); | ||
} | ||
@@ -175,17 +170,18 @@ } | ||
function dismissHandlerToggle(action) { | ||
action = action ? 'addEventListener' : 'removeEventListener'; | ||
if (ops.dismissible) { | ||
action( document, 'click', dismissibleHandler ); | ||
document[action]('click', dismissibleHandler, false ); | ||
} else { | ||
'focus' == ops.trigger && action( element, 'blur', self.hide ); | ||
'hover' == ops.trigger && action( document, touchEvents.start, touchHandler, passiveHandler ); | ||
'focus' == ops.trigger && element[action]( 'blur', self.hide ); | ||
'hover' == ops.trigger && document[action]( 'touchstart', touchHandler, passiveHandler ); | ||
} | ||
action( window, 'resize', self.hide, passiveHandler ); | ||
window[action]('resize', self.hide, passiveHandler ); | ||
} | ||
// triggers | ||
function showTrigger() { | ||
dismissHandlerToggle(on); | ||
dismissHandlerToggle(1); | ||
dispatchCustomEvent.call(element, shownCustomEvent); | ||
} | ||
function hideTrigger() { | ||
dismissHandlerToggle(off); | ||
dismissHandlerToggle(); | ||
removePopover(); | ||
@@ -217,6 +213,6 @@ dispatchCustomEvent.call(element, hiddenCustomEvent); | ||
timer = setTimeout( () => { | ||
if (popover && popover !== null && hasClass(popover,'show')) { | ||
if (popover && popover !== null && popover.classList.contains('show')) { | ||
dispatchCustomEvent.call(element, hideCustomEvent); | ||
if ( hideCustomEvent.defaultPrevented ) return; | ||
removeClass(popover,'show'); | ||
popover.classList.remove('show'); | ||
!!ops.animation ? emulateTransitionEnd(popover, hideTrigger) : hideTrigger(); | ||
@@ -228,3 +224,3 @@ } | ||
self.hide(); | ||
toggleEvents(off); | ||
toggleEvents(); | ||
delete element.Popover; | ||
@@ -294,3 +290,3 @@ }; | ||
if ( !element.Popover ) { // prevent adding event handlers twice | ||
toggleEvents(on); | ||
toggleEvents(1); | ||
} | ||
@@ -297,0 +293,0 @@ |
/* Native JavaScript for Bootstrap 4 | ScrollSpy | ||
------------------------------------------------ */ | ||
import { hasClass } from 'shorter-js/src/class/hasClass.js'; | ||
import { addClass } from 'shorter-js/src/class/addClass.js'; | ||
import { removeClass } from 'shorter-js/src/class/removeClass.js'; | ||
import { on } from 'shorter-js/src/event/on.js'; | ||
import { off } from 'shorter-js/src/event/off.js'; | ||
import { passiveHandler } from 'shorter-js/src/misc/passiveHandler.js'; | ||
import { queryElement } from 'shorter-js/src/misc/queryElement.js'; | ||
// import { tryWrapper } from 'shorter-js/src/misc/tryWrapper.js'; | ||
import passiveHandler from 'shorter-js/src/misc/passiveHandler.js'; | ||
import queryElement from 'shorter-js/src/misc/queryElement.js'; | ||
import { bootstrapCustomEvent, dispatchCustomEvent } from '../util/event.js'; | ||
import { getScroll } from '../util/misc.js'; | ||
import bootstrapCustomEvent from '../util/bootstrapCustomEvent.js'; | ||
import dispatchCustomEvent from '../util/dispatchCustomEvent.js'; | ||
import getScroll from '../util/getScroll.js'; | ||
@@ -65,5 +60,5 @@ // SCROLLSPY DEFINITION | ||
targetItem = vars.targets[index], | ||
// parent = hasClass(item,'dropdown-item') ? item.closest('.dropdown-menu') // child looking up | ||
// : hasClass(item,'nav-link') ? item.closest('.nav') : 0, | ||
dropmenu = hasClass(item,'dropdown-item') && item.closest('.dropdown-menu'), | ||
// parent = item.classList.contains('dropdown-item') ? item.closest('.dropdown-menu') // child looking up | ||
// : item.classList.contains('nav-link') ? item.closest('.nav') : 0, | ||
dropmenu = item.classList.contains('dropdown-item') && item.closest('.dropdown-menu'), | ||
dropLink = dropmenu && dropmenu.previousElementSibling, | ||
@@ -74,3 +69,3 @@ // parentLink = parent && parent.previousElementSibling, | ||
targetRect = vars.isWindow && targetItem.getBoundingClientRect(), | ||
isActive = hasClass(item,'active') || false, | ||
isActive = item.classList.contains('active') || false, | ||
topEdge = (vars.isWindow ? targetRect.top + vars.scrollOffset : targetItem.offsetTop) - ops.offset, | ||
@@ -83,12 +78,12 @@ bottomEdge = vars.isWindow ? targetRect.bottom + vars.scrollOffset - ops.offset | ||
if ( !isActive && inside ) { | ||
addClass(item,'active'); | ||
if (dropLink && !hasClass(dropLink,'active') ) { | ||
addClass(dropLink,'active'); | ||
item.classList.add('active'); | ||
if (dropLink && !dropLink.classList.contains('active') ) { | ||
dropLink.classList.add('active'); | ||
} | ||
dispatchCustomEvent.call(element, bootstrapCustomEvent( 'activate', 'scrollspy', vars.items[index])); | ||
} else if ( isActive && !inside ) { | ||
removeClass(item,'active'); | ||
item.classList.remove('active'); | ||
if (dropLink && hasClass(dropLink,'active') && !item.parentNode.getElementsByClassName('active').length ) { | ||
removeClass(dropLink,'active'); | ||
if (dropLink && dropLink.classList.contains('active') && !item.parentNode.getElementsByClassName('active').length ) { | ||
dropLink.classList.remove('active'); | ||
} | ||
@@ -106,4 +101,5 @@ } else if ( isActive && inside || !inside && !isActive ) { | ||
function toggleEvents(action) { | ||
action( scrollTarget, 'scroll', self.refresh, passiveHandler ); | ||
action( window, 'resize', self.refresh, passiveHandler ); | ||
action = action ? 'addEventListener' : 'removeEventListener' | ||
scrollTarget[action]('scroll', self.refresh, passiveHandler ); | ||
window[action]( 'resize', self.refresh, passiveHandler ); | ||
} | ||
@@ -116,3 +112,3 @@ | ||
self.dispose = () => { | ||
toggleEvents(off); | ||
toggleEvents(); | ||
delete element.ScrollSpy; | ||
@@ -153,3 +149,3 @@ } | ||
if ( !element.ScrollSpy ) { | ||
toggleEvents(on) | ||
toggleEvents(1) | ||
} | ||
@@ -156,0 +152,0 @@ self.refresh() |
/* Native JavaScript for Bootstrap 4 | Tab | ||
------------------------------------------ */ | ||
import { hasClass } from 'shorter-js/src/class/hasClass.js'; | ||
import { addClass } from 'shorter-js/src/class/addClass.js'; | ||
import { removeClass } from 'shorter-js/src/class/removeClass.js'; | ||
import { on } from 'shorter-js/src/event/on.js'; | ||
import { off } from 'shorter-js/src/event/off.js'; | ||
import { supportTransition } from 'shorter-js/src/boolean/supportTransition.js'; | ||
import { emulateTransitionEnd } from 'shorter-js/src/misc/emulateTransitionEnd.js'; | ||
import { queryElement } from 'shorter-js/src/misc/queryElement.js'; | ||
// import { tryWrapper } from 'shorter-js/src/misc/tryWrapper.js'; | ||
import supportTransition from 'shorter-js/src/boolean/supportTransition.js'; | ||
import emulateTransitionEnd from 'shorter-js/src/misc/emulateTransitionEnd.js'; | ||
import queryElement from 'shorter-js/src/misc/queryElement.js'; | ||
import { bootstrapCustomEvent, dispatchCustomEvent } from '../util/event.js'; | ||
import bootstrapCustomEvent from '../util/bootstrapCustomEvent.js'; | ||
import dispatchCustomEvent from '../util/dispatchCustomEvent.js'; | ||
@@ -52,3 +47,3 @@ // TAB DEFINITION | ||
tabsContentContainer.style.height = ''; | ||
removeClass(tabsContentContainer,'collapsing'); | ||
tabsContentContainer.classList.remove('collapsing'); | ||
tabs.isAnimating = false; | ||
@@ -86,5 +81,5 @@ } | ||
addClass(nextContent,'active'); | ||
nextContent.classList.add('active'); | ||
removeClass(activeContent,'active'); | ||
activeContent.classList.remove('active'); | ||
@@ -94,3 +89,3 @@ if (tabsContentContainer) { | ||
equalContents = nextHeight === containerHeight; | ||
addClass(tabsContentContainer,'collapsing'); | ||
tabsContentContainer.classList.add('collapsing'); | ||
tabsContentContainer.style.height = `${containerHeight}px`; // height animation | ||
@@ -102,5 +97,5 @@ tabsContentContainer.offsetHeight; | ||
if ( hasClass(nextContent, 'fade') ) { | ||
if ( nextContent.classList.contains('fade') ) { | ||
setTimeout(() => { | ||
addClass(nextContent,'show'); | ||
nextContent.classList.add('show'); | ||
emulateTransitionEnd(nextContent,triggerShow); | ||
@@ -115,3 +110,3 @@ },20); | ||
let activeTabs = tabs.getElementsByClassName('active'), activeTab; | ||
if ( activeTabs.length === 1 && !hasClass(activeTabs[0].parentNode,'dropdown') ) { | ||
if ( activeTabs.length === 1 && !activeTabs[0].parentNode.classList.contains('dropdown') ) { | ||
activeTab = activeTabs[0]; | ||
@@ -135,3 +130,3 @@ } else if ( activeTabs.length > 1 ) { | ||
if (!hasClass(next,'active')) { | ||
if (!next.classList.contains('active')) { | ||
nextContent = queryElement(next.getAttribute('href')); // this is the actual object, the next tab content to activate | ||
@@ -147,17 +142,17 @@ activeTab = getActiveTab(); | ||
tabs.isAnimating = true; | ||
removeClass(activeTab,'active'); | ||
activeTab.classList.remove('active'); | ||
activeTab.setAttribute('aria-selected','false'); | ||
addClass(next,'active'); | ||
next.classList.add('active'); | ||
next.setAttribute('aria-selected','true'); | ||
if ( dropdown ) { | ||
if ( !hasClass(element.parentNode,'dropdown-menu') ) { | ||
if (hasClass(dropdown,'active')) removeClass(dropdown,'active'); | ||
if ( !element.parentNode.classList.contains('dropdown-menu') ) { | ||
if (dropdown.classList.contains('active')) dropdown.classList.remove('active'); | ||
} else { | ||
if (!hasClass(dropdown,'active')) addClass(dropdown,'active'); | ||
if (!dropdown.classList.contains('active')) dropdown.classList.add('active'); | ||
} | ||
} | ||
if (hasClass(activeContent, 'fade')) { | ||
removeClass(activeContent,'show'); | ||
if (activeContent.classList.contains('fade')) { | ||
activeContent.classList.remove('show'); | ||
emulateTransitionEnd(activeContent, triggerHide); | ||
@@ -168,3 +163,3 @@ } else { triggerHide(); } | ||
self.dispose = () => { | ||
off(element, 'click', clickHandler); | ||
element.removeEventListener('click',clickHandler,false); | ||
delete element.Tab; | ||
@@ -194,3 +189,3 @@ } | ||
if ( !element.Tab ) { // prevent adding event handlers twice | ||
on(element, 'click', clickHandler); | ||
element.addEventListener('click',clickHandler,false); | ||
} | ||
@@ -197,0 +192,0 @@ |
/* Native JavaScript for Bootstrap 4 | Toast | ||
-------------------------------------------- */ | ||
import { hasClass } from 'shorter-js/src/class/hasClass.js'; | ||
import { addClass } from 'shorter-js/src/class/addClass.js'; | ||
import { removeClass } from 'shorter-js/src/class/removeClass.js'; | ||
import { on } from 'shorter-js/src/event/on.js'; | ||
import { off } from 'shorter-js/src/event/off.js'; | ||
import { emulateTransitionEnd } from 'shorter-js/src/misc/emulateTransitionEnd.js'; | ||
import { queryElement } from 'shorter-js/src/misc/queryElement.js'; | ||
// import { tryWrapper } from 'shorter-js/src/misc/tryWrapper.js'; | ||
import emulateTransitionEnd from 'shorter-js/src/misc/emulateTransitionEnd.js'; | ||
import queryElement from 'shorter-js/src/misc/queryElement.js'; | ||
import { bootstrapCustomEvent, dispatchCustomEvent } from '../util/event.js'; | ||
import bootstrapCustomEvent from '../util/bootstrapCustomEvent.js'; | ||
import dispatchCustomEvent from '../util/dispatchCustomEvent.js'; | ||
@@ -43,4 +38,4 @@ // TOAST DEFINITION | ||
function showComplete() { | ||
removeClass( toast, 'showing' ); | ||
addClass( toast, 'show' ); | ||
toast.classList.remove( 'showing' ); | ||
toast.classList.add( 'show' ); | ||
dispatchCustomEvent.call(toast,shownCustomEvent); | ||
@@ -50,7 +45,7 @@ if (ops.autohide) { self.hide(); } | ||
function hideComplete() { | ||
addClass( toast, 'hide' ); | ||
toast.classList.add( 'hide' ); | ||
dispatchCustomEvent.call(toast,hiddenCustomEvent); | ||
} | ||
function close () { | ||
removeClass( toast,'show' ); | ||
toast.classList.remove('show' ); | ||
ops.animation ? emulateTransitionEnd(toast, hideComplete) : hideComplete(); | ||
@@ -60,3 +55,4 @@ } | ||
clearTimeout(timer); | ||
off(element, 'click', self.hide); | ||
element.removeEventListener('click',self.hide,false); | ||
delete element.Toast; | ||
@@ -67,9 +63,9 @@ } | ||
self.show = () => { | ||
if (toast && !hasClass(toast,'show')) { | ||
if (toast && !toast.classList.contains('show')) { | ||
dispatchCustomEvent.call(toast,showCustomEvent); | ||
if (showCustomEvent.defaultPrevented) return; | ||
ops.animation && addClass( toast,'fade' ); | ||
removeClass( toast,'hide' ); | ||
ops.animation && toast.classList.add( 'fade' ); | ||
toast.classList.remove('hide' ); | ||
toast.offsetWidth; // force reflow | ||
addClass( toast,'showing' ); | ||
toast.classList.add('showing' ); | ||
@@ -80,3 +76,3 @@ ops.animation ? emulateTransitionEnd(toast, showComplete) : showComplete(); | ||
self.hide = noTimer => { | ||
if (toast && hasClass(toast,'show')) { | ||
if (toast && toast.classList.contains('show')) { | ||
dispatchCustomEvent.call(toast,hideCustomEvent); | ||
@@ -120,3 +116,3 @@ if(hideCustomEvent.defaultPrevented) return; | ||
if ( !element.Toast ) { // prevent adding event handlers twice | ||
on(element, 'click', self.hide); | ||
element.addEventListener('click',self.hide,false); | ||
} | ||
@@ -126,4 +122,3 @@ | ||
element.Toast = self; | ||
} | ||
/* Native JavaScript for Bootstrap 4 | Tooltip | ||
---------------------------------------------- */ | ||
import { hasClass } from 'shorter-js/src/class/hasClass.js'; | ||
import { addClass } from 'shorter-js/src/class/addClass.js'; | ||
import { removeClass } from 'shorter-js/src/class/removeClass.js'; | ||
import { on } from 'shorter-js/src/event/on.js'; | ||
import { off } from 'shorter-js/src/event/off.js'; | ||
import { mouseHoverEvents } from 'shorter-js/src/strings/mouseHoverEvents.js'; | ||
import { mouseClickEvents } from 'shorter-js/src/strings/mouseClickEvents.js'; | ||
import { touchEvents } from 'shorter-js/src/strings/touchEvents.js'; | ||
import { passiveHandler } from 'shorter-js/src/misc/passiveHandler.js'; | ||
import { emulateTransitionEnd } from 'shorter-js/src/misc/emulateTransitionEnd.js'; | ||
import { queryElement } from 'shorter-js/src/misc/queryElement.js'; | ||
// import { tryWrapper } from 'shorter-js/src/misc/tryWrapper.js'; | ||
import mouseHoverEvents from 'shorter-js/src/strings/mouseHoverEvents.js'; | ||
import mouseClickEvents from 'shorter-js/src/strings/mouseClickEvents.js'; | ||
import passiveHandler from 'shorter-js/src/misc/passiveHandler.js'; | ||
import emulateTransitionEnd from 'shorter-js/src/misc/emulateTransitionEnd.js'; | ||
import queryElement from 'shorter-js/src/misc/queryElement.js'; | ||
import { bootstrapCustomEvent, dispatchCustomEvent } from '../util/event.js'; | ||
import { styleTip } from '../util/misc.js'; | ||
import bootstrapCustomEvent from '../util/bootstrapCustomEvent.js'; | ||
import dispatchCustomEvent from '../util/dispatchCustomEvent.js'; | ||
import styleTip from '../util/styleTip.js'; | ||
@@ -87,7 +81,7 @@ // TOOLTIP DEFINITION | ||
let tooltipArrow = document.createElement('div'); | ||
addClass(tooltipArrow,'arrow'); | ||
tooltipArrow.classList.add('arrow'); | ||
tooltip.appendChild(tooltipArrow); | ||
// tooltip inner | ||
let tooltipInner = document.createElement('div'); | ||
addClass(tooltipInner,'tooltip-inner'); | ||
tooltipInner.classList.add('tooltip-inner'); | ||
tooltip.appendChild(tooltipInner); | ||
@@ -101,5 +95,5 @@ tooltipInner.innerHTML = titleString; | ||
tooltip.setAttribute('role','tooltip'); | ||
!hasClass(tooltip, 'tooltip') && addClass(tooltip, 'tooltip'); | ||
!hasClass(tooltip, ops.animation) && addClass(tooltip, ops.animation); | ||
!hasClass(tooltip, placementClass) && addClass(tooltip, placementClass); | ||
!tooltip.classList.contains('tooltip') && tooltip.classList.add('tooltip'); | ||
!tooltip.classList.contains(ops.animation) && tooltip.classList.add(ops.animation); | ||
!tooltip.classList.contains(placementClass) && tooltip.classList.add(placementClass); | ||
// append to container | ||
@@ -113,3 +107,3 @@ ops.container.appendChild(tooltip); | ||
function showTooltip() { | ||
!hasClass(tooltip,'show') && ( addClass(tooltip,'show') ); | ||
!tooltip.classList.contains('show') && ( tooltip.classList.add('show') ); | ||
} | ||
@@ -124,10 +118,13 @@ function touchHandler(e){ | ||
// triggers | ||
function toggleAction(action){ | ||
action = action ? 'addEventListener' : 'removeEventListener'; | ||
document[action]( 'touchstart', touchHandler, passiveHandler ); | ||
window[action]( 'resize', self.hide, passiveHandler ); | ||
} | ||
function showAction() { | ||
on( document, touchEvents.start, touchHandler, passiveHandler ); | ||
on( window, 'resize', self.hide, passiveHandler ); | ||
toggleAction(1) | ||
dispatchCustomEvent.call(element, shownCustomEvent); | ||
} | ||
function hideAction() { | ||
off( document, touchEvents.start, touchHandler, passiveHandler ); | ||
off( window, 'resize', self.hide, passiveHandler ); | ||
toggleAction(); | ||
removeToolTip(); | ||
@@ -137,5 +134,6 @@ dispatchCustomEvent.call(element, hiddenCustomEvent); | ||
function toggleEvents(action) { | ||
action(element, mouseClickEvents.down, self.show); | ||
action(element, mouseHoverEvents[0], self.show); | ||
action(element, mouseHoverEvents[1], self.hide); | ||
action = action ? 'addEventListener' : 'removeEventListener'; | ||
element[action](mouseClickEvents.down, self.show,false); | ||
element[action](mouseHoverEvents[0], self.show,false); | ||
element[action](mouseHoverEvents[1], self.hide,false); | ||
} | ||
@@ -162,6 +160,6 @@ | ||
timer = setTimeout( () => { | ||
if (tooltip && hasClass(tooltip,'show')) { | ||
if (tooltip && tooltip.classList.contains('show')) { | ||
dispatchCustomEvent.call(element, hideCustomEvent); | ||
if (hideCustomEvent.defaultPrevented) return; | ||
removeClass(tooltip,'show'); | ||
tooltip.classList.remove('show'); | ||
!!ops.animation ? emulateTransitionEnd(tooltip, hideAction) : hideAction(); | ||
@@ -176,3 +174,3 @@ } | ||
self.dispose = () => { | ||
toggleEvents(off); | ||
toggleEvents(); | ||
self.hide(); | ||
@@ -238,3 +236,3 @@ element.setAttribute('title', element.getAttribute('data-original-title')); | ||
element.removeAttribute('title'); | ||
toggleEvents(on); | ||
toggleEvents(1); | ||
} | ||
@@ -241,0 +239,0 @@ |
// use npm run custom INPUTFILE:src/index.yourFILE.js,OUTPUTFILE:dist/bootstrap-native-yourFileName.js,MIN:false,FORMAT:umd | ||
import {initCallback,removeDataAPI} from './util/callbacks.js' | ||
import {componentsInit} from './util/globals.js' | ||
import initCallback from './util/initCallback.js' | ||
// import removeDataAPI from './util/removeDataAPI.js' | ||
import componentsInit from './util/componentsInit.js' | ||
// import {Util} from './util/util.js' | ||
@@ -6,0 +8,0 @@ import {version as Version} from './../package.json' |
@@ -14,4 +14,5 @@ import Alert from './components/alert-native.js' | ||
import './util/init.js' | ||
import {initCallback,removeDataAPI} from './util/callbacks.js' | ||
import {componentsInit} from './util/globals.js' | ||
import initCallback from './util/initCallback.js' | ||
import removeDataAPI from './util/removeDataAPI.js' | ||
import componentsInit from './util/componentsInit.js' | ||
import {version as Version} from './../package.json' | ||
@@ -18,0 +19,0 @@ |
@@ -1,4 +0,3 @@ | ||
import { one } from 'shorter-js/src/event/one.js' | ||
import { initCallback } from './callbacks.js' | ||
import { componentsInit } from './globals.js' | ||
import initCallback from './initCallback.js' | ||
import componentsInit from './componentsInit.js' | ||
@@ -30,2 +29,5 @@ import Alert from '../components/alert-native.js' | ||
// bulk initialize all components | ||
document.body ? initCallback() : one( document, 'DOMContentLoaded', initCallback ); | ||
document.body ? initCallback() : document.addEventListener( 'DOMContentLoaded', function initWrapper(){ | ||
initCallback() | ||
document.removeEventListener('DOMContentLoaded',initWrapper,false) | ||
}, false ); |
// summon all utils together and export them to globals for better performance | ||
import {addClass,removeClass,hasClass,mouseClickEvents,mouseHoverEvents,touchEvents,getElementTransitionDuration,emulateTransitionEnd,on,off,one,passiveHandler,queryElement} from 'shorter-js' | ||
import {bootstrapCustomEvent, dispatchCustomEvent} from './event.js' | ||
import {setFocus,styleTip,getScroll} from './misc.js' | ||
import {mouseClickEvents,mouseHoverEvents,getElementTransitionDuration,emulateTransitionEnd,passiveHandler,queryElement} from 'shorter-js' | ||
import bootstrapCustomEvent from './bootstrapCustomEvent.js' | ||
import dispatchCustomEvent from './dispatchCustomEvent.js' | ||
import setFocus from './setFocus.js' | ||
import styleTip from './styleTip.js' | ||
import getScroll from './getScroll.js' | ||
// for faster execution | ||
// export this object to global | ||
export const Util = { | ||
// class | ||
addClass, | ||
removeClass, | ||
hasClass, | ||
export default Util = { | ||
// selector | ||
@@ -18,6 +17,2 @@ queryElement, | ||
emulateTransitionEnd, | ||
// event | ||
on, | ||
off, | ||
one, | ||
bootstrapCustomEvent, | ||
@@ -27,3 +22,2 @@ dispatchCustomEvent, | ||
mouseHoverEvents, | ||
touchEvents, | ||
passiveHandler, | ||
@@ -30,0 +24,0 @@ // misc |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
294611
33
5633
+ Addedshorter-js@0.1.9(transitive)
- Removedshorter-js@0.0.5(transitive)
Updatedshorter-js@^0.1.0