Current section

Files

Jump to
ex_effective_bootstrap priv static ex_effective_bootstrap.js
Raw

priv/static/ex_effective_bootstrap.js

!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.ExEffectiveBootstrap=t():e.ExEffectiveBootstrap=t()}(this,(function(){return function(e){var t={};function i(s){if(t[s])return t[s].exports;var n=t[s]={i:s,l:!1,exports:{}};return e[s].call(n.exports,n,n.exports,i),n.l=!0,n.exports}return i.m=e,i.c=t,i.d=function(e,t,s){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:s})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var s=Object.create(null);if(i.r(s),Object.defineProperty(s,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)i.d(s,n,function(t){return e[t]}.bind(null,n));return s},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="",i(i.s=6)}([function(e,t,i){},function(e,t){!function(e){var t,i=navigator.userAgent,s=/iphone/i.test(i),n=/chrome/i.test(i),o=/android/i.test(i);e.mask={definitions:{9:"[0-9]",a:"[A-Za-z]","*":"[A-Za-z0-9]"},autoclear:!0,dataName:"rawMaskFn",placeholder:"_"},e.fn.extend({caret:function(e,t){var i;if(0!==this.length&&!this.is(":hidden"))return"number"==typeof e?(t="number"==typeof t?t:e,this.each((function(){this.setSelectionRange?this.setSelectionRange(e,t):this.createTextRange&&((i=this.createTextRange()).collapse(!0),i.moveEnd("character",t),i.moveStart("character",e),i.select())}))):(this[0].setSelectionRange?(e=this[0].selectionStart,t=this[0].selectionEnd):document.selection&&document.selection.createRange&&(i=document.selection.createRange(),e=0-i.duplicate().moveStart("character",-1e5),t=e+i.text.length),{begin:e,end:t})},unmask:function(){return this.trigger("unmask")},mask:function(i,r){var l,a,c,d,h,p,u;if(!i&&this.length>0){var f=e(this[0]).data(e.mask.dataName);return f?f():void 0}return r=e.extend({autoclear:e.mask.autoclear,placeholder:e.mask.placeholder,completed:null},r),l=e.mask.definitions,a=[],c=p=i.length,d=null,e.each(i.split(""),(function(e,t){"?"==t?(p--,c=e):l[t]?(a.push(new RegExp(l[t])),null===d&&(d=a.length-1),c>e&&(h=a.length-1)):a.push(null)})),this.trigger("unmask").each((function(){function f(){if(r.completed){for(var e=d;h>=e;e++)if(a[e]&&$[e]===m(e))return;r.completed.call(k)}}function m(e){return r.placeholder.charAt(e<r.placeholder.length?e:0)}function v(e){for(;++e<p&&!a[e];);return e}function g(e,t){var i,s;if(!(0>e)){for(i=e,s=v(t);p>i;i++)if(a[i]){if(!(p>s&&a[i].test($[s])))break;$[i]=$[s],$[s]=m(s),s=v(s)}I(),k.caret(Math.max(d,e))}}function b(){x(),k.val()!=S&&k.change()}function w(e,t){var i;for(i=e;t>i&&p>i;i++)a[i]&&($[i]=m(i))}function I(){k.val($.join(""))}function x(e){var t,i,s,n=k.val(),o=-1;for(t=0,s=0;p>t;t++)if(a[t]){for($[t]=m(t);s++<n.length;)if(i=n.charAt(s-1),a[t].test(i)){$[t]=i,o=t;break}if(s>n.length){w(t+1,p);break}}else $[t]===n.charAt(s)&&s++,c>t&&(o=t);return e?I():c>o+1?r.autoclear||$.join("")===y?(k.val()&&k.val(""),w(0,p)):I():(I(),k.val(k.val().substring(0,o+1))),c?t:d}var k=e(this),$=e.map(i.split(""),(function(e,t){return"?"!=e?l[e]?m(t):e:void 0})),y=$.join(""),S=k.val();k.data(e.mask.dataName,(function(){return e.map($,(function(e,t){return a[t]&&e!=m(t)?e:null})).join("")})),k.one("unmask",(function(){k.off(".mask").removeData(e.mask.dataName)})).on("focus.mask",(function(){var e;k.prop("readonly")||(clearTimeout(t),S=k.val(),e=x(),t=setTimeout((function(){I(),e==i.replace("?","").length?k.caret(0,e):k.caret(e)}),10))})).on("blur.mask",b).on("keydown.mask",(function(e){if(!k.prop("readonly")){var t,i,n,o=e.which||e.keyCode;u=k.val(),8===o||46===o||s&&127===o?(i=(t=k.caret()).begin,(n=t.end)-i==0&&(i=46!==o?function(e){for(;--e>=0&&!a[e];);return e}(i):n=v(i-1),n=46===o?v(n):n),w(i,n),g(i,n-1),e.preventDefault()):13===o?b.call(this,e):27===o&&(k.val(S),k.caret(0,x()),e.preventDefault())}})).on("keypress.mask",(function(t){if(!k.prop("readonly")){var i,s,n,r=t.which||t.keyCode,l=k.caret();if(!(t.ctrlKey||t.altKey||t.metaKey||32>r)&&r&&13!==r){if(l.end-l.begin!=0&&(w(l.begin,l.end),g(l.begin,l.end-1)),i=v(l.begin-1),p>i&&(s=String.fromCharCode(r),a[i].test(s))){if(function(e){var t,i,s,n;for(t=e,i=m(e);p>t;t++)if(a[t]){if(s=v(t),n=$[t],$[t]=i,!(p>s&&a[s].test(n)))break;i=n}}(i),$[i]=s,I(),n=v(i),o){setTimeout((function(){e.proxy(e.fn.caret,k,n)()}),0)}else k.caret(n);l.begin<=h&&f()}t.preventDefault()}}})).on("input.mask paste.mask",(function(){k.prop("readonly")||setTimeout((function(){var e=x(!0);k.caret(e),f()}),0)})),n&&o&&k.off("input.mask").on("input.mask",(function(){var e=k.val(),t=k.caret();if(e.length<u.length){for(x(!0);t.begin>0&&!a[t.begin-1];)t.begin--;if(0===t.begin)for(;t.begin<d&&!a[t.begin];)t.begin++;k.caret(t.begin,t.begin)}else{for(x(!0);t.begin<p&&!a[t.begin];)t.begin++;k.caret(t.begin,t.begin)}f()})),x()}))}})}($)},function(e,t){!function(e){"use strict";var t=["sanitize","whiteList","sanitizeFn"],i=["background","cite","href","itemtype","longdesc","poster","src","xlink:href"],s={"*":["class","dir","id","lang","role","tabindex","style",/^aria-[\w-]*$/i],a:["target","href","title","rel"],area:[],b:[],br:[],col:[],code:[],div:[],em:[],hr:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],i:[],img:["src","alt","title","width","height"],li:[],ol:[],p:[],pre:[],s:[],small:[],span:[],sub:[],sup:[],strong:[],u:[],ul:[]},n=/^(?:(?:https?|mailto|ftp|tel|file):|[^&:/?#]*(?:[/?#]|$))/gi,o=/^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[a-z0-9+/]+=*$/i;function r(t,s){var r=t.nodeName.toLowerCase();if(-1!==e.inArray(r,s))return-1===e.inArray(r,i)||Boolean(t.nodeValue.match(n)||t.nodeValue.match(o));for(var l=e(s).filter((function(e,t){return t instanceof RegExp})),a=0,c=l.length;a<c;a++)if(r.match(l[a]))return!0;return!1}function l(e,t,i){if(i&&"function"==typeof i)return i(e);for(var s=Object.keys(t),n=0,o=e.length;n<o;n++)for(var l=e[n].querySelectorAll("*"),a=0,c=l.length;a<c;a++){var d=l[a],h=d.nodeName.toLowerCase();if(-1!==s.indexOf(h))for(var p=[].slice.call(d.attributes),u=[].concat(t["*"]||[],t[h]||[]),f=0,m=p.length;f<m;f++){var v=p[f];r(v,u)||d.removeAttribute(v.nodeName)}else d.parentNode.removeChild(d)}}"classList"in document.createElement("_")||function(t){if("Element"in t){var i=t.Element.prototype,s=Object,n=function(){var t=e(this);return{add:function(e){return e=Array.prototype.slice.call(arguments).join(" "),t.addClass(e)},remove:function(e){return e=Array.prototype.slice.call(arguments).join(" "),t.removeClass(e)},toggle:function(e,i){return t.toggleClass(e,i)},contains:function(e){return t.hasClass(e)}}};if(s.defineProperty){var o={get:n,enumerable:!0,configurable:!0};try{s.defineProperty(i,"classList",o)}catch(e){void 0!==e.number&&-2146823252!==e.number||(o.enumerable=!1,s.defineProperty(i,"classList",o))}}else s.prototype.__defineGetter__&&i.__defineGetter__("classList",n)}}(window);var a,c,d,h=document.createElement("_");if(h.classList.add("c1","c2"),!h.classList.contains("c2")){var p=DOMTokenList.prototype.add,u=DOMTokenList.prototype.remove;DOMTokenList.prototype.add=function(){Array.prototype.forEach.call(arguments,p.bind(this))},DOMTokenList.prototype.remove=function(){Array.prototype.forEach.call(arguments,u.bind(this))}}if(h.classList.toggle("c3",!1),h.classList.contains("c3")){var f=DOMTokenList.prototype.toggle;DOMTokenList.prototype.toggle=function(e,t){return 1 in arguments&&!this.contains(e)==!t?t:f.call(this,e)}}function m(e,t){var i,s=e.selectedOptions,n=[];if(t){for(var o=0,r=s.length;o<r;o++)(i=s[o]).disabled||"OPTGROUP"===i.parentNode.tagName&&i.parentNode.disabled||n.push(i);return n}return s}function v(e,t){for(var i,s=[],n=t||e.selectedOptions,o=0,r=n.length;o<r;o++)(i=n[o]).disabled||"OPTGROUP"===i.parentNode.tagName&&i.parentNode.disabled||s.push(i.value);return e.multiple?s:s.length?s[0]:null}h=null,String.prototype.startsWith||(a=function(){try{var e={},t=Object.defineProperty,i=t(e,e,e)&&t}catch(e){}return i}(),c={}.toString,d=function(e){if(null==this)throw new TypeError;var t=String(this);if(e&&"[object RegExp]"==c.call(e))throw new TypeError;var i=t.length,s=String(e),n=s.length,o=arguments.length>1?arguments[1]:void 0,r=o?Number(o):0;r!=r&&(r=0);var l=Math.min(Math.max(r,0),i);if(n+l>i)return!1;for(var a=-1;++a<n;)if(t.charCodeAt(l+a)!=s.charCodeAt(a))return!1;return!0},a?a(String.prototype,"startsWith",{value:d,configurable:!0,writable:!0}):String.prototype.startsWith=d),Object.keys||(Object.keys=function(e,t,i){for(t in i=[],e)i.hasOwnProperty.call(e,t)&&i.push(t);return i}),HTMLSelectElement&&!HTMLSelectElement.prototype.hasOwnProperty("selectedOptions")&&Object.defineProperty(HTMLSelectElement.prototype,"selectedOptions",{get:function(){return this.querySelectorAll(":checked")}});var g={useDefault:!1,_set:e.valHooks.select.set};e.valHooks.select.set=function(t,i){return i&&!g.useDefault&&e(t).data("selected",!0),g._set.apply(this,arguments)};var b=null,w=function(){try{return new Event("change"),!0}catch(e){return!1}}();function I(e,t,i,s){for(var n=["display","subtext","tokens"],o=!1,r=0;r<n.length;r++){var l=n[r],a=e[l];if(a&&(a=a.toString(),"display"===l&&(a=a.replace(/<[^>]+>/g,"")),s&&(a=E(a)),a=a.toUpperCase(),o="contains"===i?a.indexOf(t)>=0:a.startsWith(t)))break}return o}function x(e){return parseInt(e,10)||0}e.fn.triggerNative=function(e){var t,i=this[0];i.dispatchEvent?(w?t=new Event(e,{bubbles:!0}):(t=document.createEvent("Event")).initEvent(e,!0,!1),i.dispatchEvent(t)):i.fireEvent?((t=document.createEventObject()).eventType=e,i.fireEvent("on"+e,t)):this.trigger(e)};var k={"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"},$=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,y=RegExp("[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\u1ab0-\\u1aff\\u1dc0-\\u1dff]","g");function S(e){return k[e]}function E(e){return(e=e.toString())&&e.replace($,S).replace(y,"")}var C,O,z,T,A,L=(C={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"},O=function(e){return C[e]},z="(?:"+Object.keys(C).join("|")+")",T=RegExp(z),A=RegExp(z,"g"),function(e){return e=null==e?"":""+e,T.test(e)?e.replace(A,O):e}),N={32:" ",48:"0",49:"1",50:"2",51:"3",52:"4",53:"5",54:"6",55:"7",56:"8",57:"9",59:";",65:"A",66:"B",67:"C",68:"D",69:"E",70:"F",71:"G",72:"H",73:"I",74:"J",75:"K",76:"L",77:"M",78:"N",79:"O",80:"P",81:"Q",82:"R",83:"S",84:"T",85:"U",86:"V",87:"W",88:"X",89:"Y",90:"Z",96:"0",97:"1",98:"2",99:"3",100:"4",101:"5",102:"6",103:"7",104:"8",105:"9"},D=27,H=13,P=32,W=9,R=38,M=40,B={success:!1,major:"3"};try{B.full=(e.fn.dropdown.Constructor.VERSION||"").split(" ")[0].split("."),B.major=B.full[0],B.success=!0}catch(e){}var j=0,U=".bs.select",F={DISABLED:"disabled",DIVIDER:"divider",SHOW:"open",DROPUP:"dropup",MENU:"dropdown-menu",MENURIGHT:"dropdown-menu-right",MENULEFT:"dropdown-menu-left",BUTTONCLASS:"btn-default",POPOVERHEADER:"popover-title",ICONBASE:"glyphicon",TICKICON:"glyphicon-ok"},V={MENU:"."+F.MENU},_={span:document.createElement("span"),i:document.createElement("i"),subtext:document.createElement("small"),a:document.createElement("a"),li:document.createElement("li"),whitespace:document.createTextNode(" "),fragment:document.createDocumentFragment()};_.a.setAttribute("role","option"),"4"===B.major&&(_.a.className="dropdown-item"),_.subtext.className="text-muted",_.text=_.span.cloneNode(!1),_.text.className="text",_.checkMark=_.span.cloneNode(!1);var G=new RegExp(R+"|"+M),K=new RegExp("^"+W+"$|"+D),q={li:function(e,t,i){var s=_.li.cloneNode(!1);return e&&(1===e.nodeType||11===e.nodeType?s.appendChild(e):s.innerHTML=e),void 0!==t&&""!==t&&(s.className=t),null!=i&&s.classList.add("optgroup-"+i),s},a:function(e,t,i){var s=_.a.cloneNode(!0);return e&&(11===e.nodeType?s.appendChild(e):s.insertAdjacentHTML("beforeend",e)),void 0!==t&&""!==t&&s.classList.add.apply(s.classList,t.split(" ")),i&&s.setAttribute("style",i),s},text:function(e,t){var i,s,n=_.text.cloneNode(!1);if(e.content)n.innerHTML=e.content;else{if(n.textContent=e.text,e.icon){var o=_.whitespace.cloneNode(!1);(s=(!0===t?_.i:_.span).cloneNode(!1)).className=this.options.iconBase+" "+e.icon,_.fragment.appendChild(s),_.fragment.appendChild(o)}e.subtext&&((i=_.subtext.cloneNode(!1)).textContent=e.subtext,n.appendChild(i))}if(!0===t)for(;n.childNodes.length>0;)_.fragment.appendChild(n.childNodes[0]);else _.fragment.appendChild(n);return _.fragment},label:function(e){var t,i,s=_.text.cloneNode(!1);if(s.innerHTML=e.display,e.icon){var n=_.whitespace.cloneNode(!1);(i=_.span.cloneNode(!1)).className=this.options.iconBase+" "+e.icon,_.fragment.appendChild(i),_.fragment.appendChild(n)}return e.subtext&&((t=_.subtext.cloneNode(!1)).textContent=e.subtext,s.appendChild(t)),_.fragment.appendChild(s),_.fragment}},Z=function(t,i){var s=this;g.useDefault||(e.valHooks.select.set=g._set,g.useDefault=!0),this.$element=e(t),this.$newElement=null,this.$button=null,this.$menu=null,this.options=i,this.selectpicker={main:{},search:{},current:{},view:{},isSearching:!1,keydown:{keyHistory:"",resetKeyHistory:{start:function(){return setTimeout((function(){s.selectpicker.keydown.keyHistory=""}),800)}}}},this.sizeInfo={},null===this.options.title&&(this.options.title=this.$element.attr("title"));var n=this.options.windowPadding;"number"==typeof n&&(this.options.windowPadding=[n,n,n,n]),this.val=Z.prototype.val,this.render=Z.prototype.render,this.refresh=Z.prototype.refresh,this.setStyle=Z.prototype.setStyle,this.selectAll=Z.prototype.selectAll,this.deselectAll=Z.prototype.deselectAll,this.destroy=Z.prototype.destroy,this.remove=Z.prototype.remove,this.show=Z.prototype.show,this.hide=Z.prototype.hide,this.init()};function Y(i){var s,n=arguments,o=i;if([].shift.apply(n),!B.success){try{B.full=(e.fn.dropdown.Constructor.VERSION||"").split(" ")[0].split(".")}catch(e){Z.BootstrapVersion?B.full=Z.BootstrapVersion.split(" ")[0].split("."):(B.full=[B.major,"0","0"],console.warn("There was an issue retrieving Bootstrap's version. Ensure Bootstrap is being loaded before bootstrap-select and there is no namespace collision. If loading Bootstrap asynchronously, the version may need to be manually specified via $.fn.selectpicker.Constructor.BootstrapVersion.",e))}B.major=B.full[0],B.success=!0}if("4"===B.major){var r=[];Z.DEFAULTS.style===F.BUTTONCLASS&&r.push({name:"style",className:"BUTTONCLASS"}),Z.DEFAULTS.iconBase===F.ICONBASE&&r.push({name:"iconBase",className:"ICONBASE"}),Z.DEFAULTS.tickIcon===F.TICKICON&&r.push({name:"tickIcon",className:"TICKICON"}),F.DIVIDER="dropdown-divider",F.SHOW="show",F.BUTTONCLASS="btn-light",F.POPOVERHEADER="popover-header",F.ICONBASE="",F.TICKICON="bs-ok-default";for(var l=0;l<r.length;l++){i=r[l];Z.DEFAULTS[i.name]=F[i.className]}}var a=this.each((function(){var i=e(this);if(i.is("select")){var r=i.data("selectpicker"),l="object"==typeof o&&o;if(r){if(l)for(var a in l)l.hasOwnProperty(a)&&(r.options[a]=l[a])}else{var c=i.data();for(var d in c)c.hasOwnProperty(d)&&-1!==e.inArray(d,t)&&delete c[d];var h=e.extend({},Z.DEFAULTS,e.fn.selectpicker.defaults||{},c,l);h.template=e.extend({},Z.DEFAULTS.template,e.fn.selectpicker.defaults?e.fn.selectpicker.defaults.template:{},c.template,l.template),i.data("selectpicker",r=new Z(this,h))}"string"==typeof o&&(s=r[o]instanceof Function?r[o].apply(r,n):r.options[o])}}));return void 0!==s?s:a}Z.VERSION="1.13.12",Z.DEFAULTS={noneSelectedText:"Nothing selected",noneResultsText:"No results matched {0}",countSelectedText:function(e,t){return 1==e?"{0} item selected":"{0} items selected"},maxOptionsText:function(e,t){return[1==e?"Limit reached ({n} item max)":"Limit reached ({n} items max)",1==t?"Group limit reached ({n} item max)":"Group limit reached ({n} items max)"]},selectAllText:"Select All",deselectAllText:"Deselect All",doneButton:!1,doneButtonText:"Close",multipleSeparator:", ",styleBase:"btn",style:F.BUTTONCLASS,size:"auto",title:null,selectedTextFormat:"values",width:!1,container:!1,hideDisabled:!1,showSubtext:!1,showIcon:!0,showContent:!0,dropupAuto:!0,header:!1,liveSearch:!1,liveSearchPlaceholder:null,liveSearchNormalize:!1,liveSearchStyle:"contains",actionsBox:!1,iconBase:F.ICONBASE,tickIcon:F.TICKICON,showTick:!1,template:{caret:'<span class="caret"></span>'},maxOptions:!1,mobile:!1,selectOnTab:!1,dropdownAlignRight:!1,windowPadding:0,virtualScroll:600,display:!1,sanitize:!0,sanitizeFn:null,whiteList:s},Z.prototype={constructor:Z,init:function(){var e=this,t=this.$element.attr("id");j++,this.selectId="bs-select-"+j,this.$element[0].classList.add("bs-select-hidden"),this.multiple=this.$element.prop("multiple"),this.autofocus=this.$element.prop("autofocus"),this.$element[0].classList.contains("show-tick")&&(this.options.showTick=!0),this.$newElement=this.createDropdown(),this.buildData(),this.$element.after(this.$newElement).prependTo(this.$newElement),this.$button=this.$newElement.children("button"),this.$menu=this.$newElement.children(V.MENU),this.$menuInner=this.$menu.children(".inner"),this.$searchbox=this.$menu.find("input"),this.$element[0].classList.remove("bs-select-hidden"),!0===this.options.dropdownAlignRight&&this.$menu[0].classList.add(F.MENURIGHT),void 0!==t&&this.$button.attr("data-id",t),this.checkDisabled(),this.clickListener(),this.options.liveSearch?(this.liveSearchListener(),this.focusedParent=this.$searchbox[0]):this.focusedParent=this.$menuInner[0],this.setStyle(),this.render(),this.setWidth(),this.options.container?this.selectPosition():this.$element.on("hide.bs.select",(function(){if(e.isVirtual()){var t=e.$menuInner[0],i=t.firstChild.cloneNode(!1);t.replaceChild(i,t.firstChild),t.scrollTop=0}})),this.$menu.data("this",this),this.$newElement.data("this",this),this.options.mobile&&this.mobile(),this.$newElement.on({"hide.bs.dropdown":function(t){e.$element.trigger("hide.bs.select",t)},"hidden.bs.dropdown":function(t){e.$element.trigger("hidden.bs.select",t)},"show.bs.dropdown":function(t){e.$element.trigger("show.bs.select",t)},"shown.bs.dropdown":function(t){e.$element.trigger("shown.bs.select",t)}}),e.$element[0].hasAttribute("required")&&this.$element.on("invalid.bs.select",(function(){e.$button[0].classList.add("bs-invalid"),e.$element.on("shown.bs.select.invalid",(function(){e.$element.val(e.$element.val()).off("shown.bs.select.invalid")})).on("rendered.bs.select",(function(){this.validity.valid&&e.$button[0].classList.remove("bs-invalid"),e.$element.off("rendered.bs.select")})),e.$button.on("blur.bs.select",(function(){e.$element.trigger("focus").trigger("blur"),e.$button.off("blur.bs.select")}))})),setTimeout((function(){e.buildList(),e.$element.trigger("loaded.bs.select")}))},createDropdown:function(){var t=this.multiple||this.options.showTick?" show-tick":"",i=this.multiple?' aria-multiselectable="true"':"",s="",n=this.autofocus?" autofocus":"";B.major<4&&this.$element.parent().hasClass("input-group")&&(s=" input-group-btn");var o,r="",l="",a="",c="";return this.options.header&&(r='<div class="'+F.POPOVERHEADER+'"><button type="button" class="close" aria-hidden="true">&times;</button>'+this.options.header+"</div>"),this.options.liveSearch&&(l='<div class="bs-searchbox"><input type="search" class="form-control" autocomplete="off"'+(null===this.options.liveSearchPlaceholder?"":' placeholder="'+L(this.options.liveSearchPlaceholder)+'"')+' role="combobox" aria-label="Search" aria-controls="'+this.selectId+'" aria-autocomplete="list"></div>'),this.multiple&&this.options.actionsBox&&(a='<div class="bs-actionsbox"><div class="btn-group btn-group-sm btn-block"><button type="button" class="actions-btn bs-select-all btn '+F.BUTTONCLASS+'">'+this.options.selectAllText+'</button><button type="button" class="actions-btn bs-deselect-all btn '+F.BUTTONCLASS+'">'+this.options.deselectAllText+"</button></div></div>"),this.multiple&&this.options.doneButton&&(c='<div class="bs-donebutton"><div class="btn-group btn-block"><button type="button" class="btn btn-sm '+F.BUTTONCLASS+'">'+this.options.doneButtonText+"</button></div></div>"),o='<div class="dropdown bootstrap-select'+t+s+'"><button type="button" class="'+this.options.styleBase+' dropdown-toggle" '+("static"===this.options.display?'data-display="static"':"")+'data-toggle="dropdown"'+n+' role="combobox" aria-owns="'+this.selectId+'" aria-haspopup="listbox" aria-expanded="false"><div class="filter-option"><div class="filter-option-inner"><div class="filter-option-inner-inner"></div></div> </div>'+("4"===B.major?"":'<span class="bs-caret">'+this.options.template.caret+"</span>")+'</button><div class="'+F.MENU+" "+("4"===B.major?"":F.SHOW)+'">'+r+l+a+'<div class="inner '+F.SHOW+'" role="listbox" id="'+this.selectId+'" tabindex="-1" '+i+'><ul class="'+F.MENU+" inner "+("4"===B.major?F.SHOW:"")+'" role="presentation"></ul></div>'+c+"</div></div>",e(o)},setPositionData:function(){this.selectpicker.view.canHighlight=[],this.selectpicker.view.size=0;for(var e=0;e<this.selectpicker.current.data.length;e++){var t=this.selectpicker.current.data[e],i=!0;"divider"===t.type?(i=!1,t.height=this.sizeInfo.dividerHeight):"optgroup-label"===t.type?(i=!1,t.height=this.sizeInfo.dropdownHeaderHeight):t.height=this.sizeInfo.liHeight,t.disabled&&(i=!1),this.selectpicker.view.canHighlight.push(i),i&&(this.selectpicker.view.size++,t.posinset=this.selectpicker.view.size),t.position=(0===e?0:this.selectpicker.current.data[e-1].position)+t.height}},isVirtual:function(){return!1!==this.options.virtualScroll&&this.selectpicker.main.elements.length>=this.options.virtualScroll||!0===this.options.virtualScroll},createView:function(t,i,s){var n,o,r=this,a=0,c=[];if(this.selectpicker.isSearching=t,this.selectpicker.current=t?this.selectpicker.search:this.selectpicker.main,this.setPositionData(),i)if(s)a=this.$menuInner[0].scrollTop;else if(!r.multiple){var d=r.$element[0],h=(d.options[d.selectedIndex]||{}).liIndex;if("number"==typeof h&&!1!==r.options.size){var p=r.selectpicker.main.data[h],u=p&&p.position;u&&(a=u-(r.sizeInfo.menuInnerHeight+r.sizeInfo.liHeight)/2)}}function f(e,i){var s,a,d,h,p,u,f,m,v,g,b=r.selectpicker.current.elements.length,w=[],I=!0,x=r.isVirtual();r.selectpicker.view.scrollTop=e,s=Math.ceil(r.sizeInfo.menuInnerHeight/r.sizeInfo.liHeight*1.5),a=Math.round(b/s)||1;for(var k=0;k<a;k++){var $=(k+1)*s;if(k===a-1&&($=b),w[k]=[k*s+(k?1:0),$],!b)break;void 0===p&&e-1<=r.selectpicker.current.data[$-1].position-r.sizeInfo.menuInnerHeight&&(p=k)}if(void 0===p&&(p=0),u=[r.selectpicker.view.position0,r.selectpicker.view.position1],d=Math.max(0,p-1),h=Math.min(a-1,p+1),r.selectpicker.view.position0=!1===x?0:Math.max(0,w[d][0])||0,r.selectpicker.view.position1=!1===x?b:Math.min(b,w[h][1])||0,f=u[0]!==r.selectpicker.view.position0||u[1]!==r.selectpicker.view.position1,void 0!==r.activeIndex&&(o=r.selectpicker.main.elements[r.prevActiveIndex],c=r.selectpicker.main.elements[r.activeIndex],n=r.selectpicker.main.elements[r.selectedIndex],i&&(r.activeIndex!==r.selectedIndex&&r.defocusItem(c),r.activeIndex=void 0),r.activeIndex&&r.activeIndex!==r.selectedIndex&&r.defocusItem(n)),void 0!==r.prevActiveIndex&&r.prevActiveIndex!==r.activeIndex&&r.prevActiveIndex!==r.selectedIndex&&r.defocusItem(o),(i||f)&&(m=r.selectpicker.view.visibleElements?r.selectpicker.view.visibleElements.slice():[],r.selectpicker.view.visibleElements=!1===x?r.selectpicker.current.elements:r.selectpicker.current.elements.slice(r.selectpicker.view.position0,r.selectpicker.view.position1),r.setOptionStatus(),(t||!1===x&&i)&&(v=m,g=r.selectpicker.view.visibleElements,I=!(v.length===g.length&&v.every((function(e,t){return e===g[t]})))),(i||!0===x)&&I)){var y,S,E=r.$menuInner[0],C=document.createDocumentFragment(),O=E.firstChild.cloneNode(!1),z=r.selectpicker.view.visibleElements,T=[];E.replaceChild(O,E.firstChild);k=0;for(var A=z.length;k<A;k++){var L,N,D=z[k];r.options.sanitize&&(L=D.lastChild)&&(N=r.selectpicker.current.data[k+r.selectpicker.view.position0])&&N.content&&!N.sanitized&&(T.push(L),N.sanitized=!0),C.appendChild(D)}if(r.options.sanitize&&T.length&&l(T,r.options.whiteList,r.options.sanitizeFn),!0===x?(y=0===r.selectpicker.view.position0?0:r.selectpicker.current.data[r.selectpicker.view.position0-1].position,S=r.selectpicker.view.position1>b-1?0:r.selectpicker.current.data[b-1].position-r.selectpicker.current.data[r.selectpicker.view.position1-1].position,E.firstChild.style.marginTop=y+"px",E.firstChild.style.marginBottom=S+"px"):(E.firstChild.style.marginTop=0,E.firstChild.style.marginBottom=0),E.firstChild.appendChild(C),!0===x&&r.sizeInfo.hasScrollBar){var H=E.firstChild.offsetWidth;if(i&&H<r.sizeInfo.menuInnerInnerWidth&&r.sizeInfo.totalMenuWidth>r.sizeInfo.selectWidth)E.firstChild.style.minWidth=r.sizeInfo.menuInnerInnerWidth+"px";else if(H>r.sizeInfo.menuInnerInnerWidth){r.$menu[0].style.minWidth=0;var P=E.firstChild.offsetWidth;P>r.sizeInfo.menuInnerInnerWidth&&(r.sizeInfo.menuInnerInnerWidth=P,E.firstChild.style.minWidth=r.sizeInfo.menuInnerInnerWidth+"px"),r.$menu[0].style.minWidth=""}}}if(r.prevActiveIndex=r.activeIndex,r.options.liveSearch){if(t&&i){var W,R=0;r.selectpicker.view.canHighlight[R]||(R=1+r.selectpicker.view.canHighlight.slice(1).indexOf(!0)),W=r.selectpicker.view.visibleElements[R],r.defocusItem(r.selectpicker.view.currentActive),r.activeIndex=(r.selectpicker.current.data[R]||{}).index,r.focusItem(W)}}else r.$menuInner.trigger("focus")}f(a,!0),this.$menuInner.off("scroll.createView").on("scroll.createView",(function(e,t){r.noScroll||f(this.scrollTop,t),r.noScroll=!1})),e(window).off("resize.bs.select."+this.selectId+".createView").on("resize.bs.select."+this.selectId+".createView",(function(){r.$newElement.hasClass(F.SHOW)&&f(r.$menuInner[0].scrollTop)}))},focusItem:function(e,t,i){if(e){t=t||this.selectpicker.main.data[this.activeIndex];var s=e.firstChild;s&&(s.setAttribute("aria-setsize",this.selectpicker.view.size),s.setAttribute("aria-posinset",t.posinset),!0!==i&&(this.focusedParent.setAttribute("aria-activedescendant",s.id),e.classList.add("active"),s.classList.add("active")))}},defocusItem:function(e){e&&(e.classList.remove("active"),e.firstChild&&e.firstChild.classList.remove("active"))},setPlaceholder:function(){var t=!1;if(this.options.title&&!this.multiple){this.selectpicker.view.titleOption||(this.selectpicker.view.titleOption=document.createElement("option")),t=!0;var i=this.$element[0],s=!1,n=!this.selectpicker.view.titleOption.parentNode;if(n)this.selectpicker.view.titleOption.className="bs-title-option",this.selectpicker.view.titleOption.value="",s=void 0===e(i.options[i.selectedIndex]).attr("selected")&&void 0===this.$element.data("selected");(n||0!==this.selectpicker.view.titleOption.index)&&i.insertBefore(this.selectpicker.view.titleOption,i.firstChild),s&&(i.selectedIndex=0)}return t},buildData:function(){var e=':not([hidden]):not([data-hidden="true"])',t=[],i=0,s=this.setPlaceholder()?1:0;this.options.hideDisabled&&(e+=":not(:disabled)");var n=this.$element[0].querySelectorAll("select > *"+e);function o(e){var i=t[t.length-1];i&&"divider"===i.type&&(i.optID||e.optID)||((e=e||{}).type="divider",t.push(e))}function r(e,i){if((i=i||{}).divider="true"===e.getAttribute("data-divider"),i.divider)o({optID:i.optID});else{var s=t.length,n=e.style.cssText,r=n?L(n):"",l=(e.className||"")+(i.optgroupClass||"");i.optID&&(l="opt "+l),i.optionClass=l.trim(),i.inlineStyle=r,i.text=e.textContent,i.content=e.getAttribute("data-content"),i.tokens=e.getAttribute("data-tokens"),i.subtext=e.getAttribute("data-subtext"),i.icon=e.getAttribute("data-icon"),e.liIndex=s,i.display=i.content||i.text,i.type="option",i.index=s,i.option=e,i.selected=!!e.selected,i.disabled=i.disabled||!!e.disabled,t.push(i)}}function l(s,n){var l=n[s],a=n[s-1],c=n[s+1],d=l.querySelectorAll("option"+e);if(d.length){var h,p,u={display:L(l.label),subtext:l.getAttribute("data-subtext"),icon:l.getAttribute("data-icon"),type:"optgroup-label",optgroupClass:" "+(l.className||"")};i++,a&&o({optID:i}),u.optID=i,t.push(u);for(var f=0,m=d.length;f<m;f++){var v=d[f];0===f&&(p=(h=t.length-1)+m),r(v,{headerIndex:h,lastIndex:p,optID:u.optID,optgroupClass:u.optgroupClass,disabled:l.disabled})}c&&o({optID:i})}}for(var a=n.length;s<a;s++){var c=n[s];"OPTGROUP"!==c.tagName?r(c,{}):l(s,n)}this.selectpicker.main.data=this.selectpicker.current.data=t},buildList:function(){var e=this,t=this.selectpicker.main.data,i=[],s=0;function n(t){var n,o=0;switch(t.type){case"divider":n=q.li(!1,F.DIVIDER,t.optID?t.optID+"div":void 0);break;case"option":(n=q.li(q.a(q.text.call(e,t),t.optionClass,t.inlineStyle),"",t.optID)).firstChild&&(n.firstChild.id=e.selectId+"-"+t.index);break;case"optgroup-label":n=q.li(q.label.call(e,t),"dropdown-header"+t.optgroupClass,t.optID)}i.push(n),t.display&&(o+=t.display.length),t.subtext&&(o+=t.subtext.length),t.icon&&(o+=1),o>s&&(s=o,e.selectpicker.view.widestOption=i[i.length-1])}!e.options.showTick&&!e.multiple||_.checkMark.parentNode||(_.checkMark.className=this.options.iconBase+" "+e.options.tickIcon+" check-mark",_.a.appendChild(_.checkMark));for(var o=t.length,r=0;r<o;r++){n(t[r])}this.selectpicker.main.elements=this.selectpicker.current.elements=i},findLis:function(){return this.$menuInner.find(".inner > li")},render:function(){var e,t,i=this.setPlaceholder()?1:0,s=this.$element[0],n=m(s,this.options.hideDisabled),o=n.length,r=this.$button[0],a=r.querySelector(".filter-option-inner-inner"),c=document.createTextNode(this.options.multipleSeparator),d=_.fragment.cloneNode(!1),h=!1;if(r.classList.toggle("bs-placeholder",this.multiple?!o:!v(s,n)),this.tabIndex(),"static"===this.options.selectedTextFormat)d=q.text.call(this,{text:this.options.title},!0);else if((e=this.multiple&&-1!==this.options.selectedTextFormat.indexOf("count")&&o>1)&&(e=(t=this.options.selectedTextFormat.split(">")).length>1&&o>t[1]||1===t.length&&o>=2),!1===e){for(var p=i;p<o&&p<50;p++){var u=n[p],f=this.selectpicker.main.data[u.liIndex],g={};this.multiple&&p>0&&d.appendChild(c.cloneNode(!1)),u.title?g.text=u.title:f.content&&this.options.showContent?(g.content=f.content.toString(),h=!0):(this.options.showIcon&&(g.icon=f.icon),this.options.showSubtext&&!this.multiple&&f.subtext&&(g.subtext=" "+f.subtext),g.text=u.textContent.trim()),d.appendChild(q.text.call(this,g,!0))}o>49&&d.appendChild(document.createTextNode("..."))}else{var b=':not([hidden]):not([data-hidden="true"]):not([data-divider="true"])';this.options.hideDisabled&&(b+=":not(:disabled)");var w=this.$element[0].querySelectorAll("select > option"+b+", optgroup"+b+" option"+b).length,I="function"==typeof this.options.countSelectedText?this.options.countSelectedText(o,w):this.options.countSelectedText;d=q.text.call(this,{text:I.replace("{0}",o.toString()).replace("{1}",w.toString())},!0)}if(null==this.options.title&&(this.options.title=this.$element.attr("title")),d.childNodes.length||(d=q.text.call(this,{text:void 0!==this.options.title?this.options.title:this.options.noneSelectedText},!0)),r.title=d.textContent.replace(/<[^>]*>?/g,"").trim(),this.options.sanitize&&h&&l([d],this.options.whiteList,this.options.sanitizeFn),a.innerHTML="",a.appendChild(d),B.major<4&&this.$newElement[0].classList.contains("bs3-has-addon")){var x=r.querySelector(".filter-expand"),k=a.cloneNode(!0);k.className="filter-expand",x?r.replaceChild(k,x):r.appendChild(k)}this.$element.trigger("rendered.bs.select")},setStyle:function(e,t){var i,s=this.$button[0],n=this.$newElement[0],o=this.options.style.trim();this.$element.attr("class")&&this.$newElement.addClass(this.$element.attr("class").replace(/selectpicker|mobile-device|bs-select-hidden|validate\[.*\]/gi,"")),B.major<4&&(n.classList.add("bs3"),n.parentNode.classList.contains("input-group")&&(n.previousElementSibling||n.nextElementSibling)&&(n.previousElementSibling||n.nextElementSibling).classList.contains("input-group-addon")&&n.classList.add("bs3-has-addon")),i=e?e.trim():o,"add"==t?i&&s.classList.add.apply(s.classList,i.split(" ")):"remove"==t?i&&s.classList.remove.apply(s.classList,i.split(" ")):(o&&s.classList.remove.apply(s.classList,o.split(" ")),i&&s.classList.add.apply(s.classList,i.split(" ")))},liHeight:function(t){if(t||!1!==this.options.size&&!Object.keys(this.sizeInfo).length){var i=document.createElement("div"),s=document.createElement("div"),n=document.createElement("div"),o=document.createElement("ul"),r=document.createElement("li"),l=document.createElement("li"),a=document.createElement("li"),c=document.createElement("a"),d=document.createElement("span"),h=this.options.header&&this.$menu.find("."+F.POPOVERHEADER).length>0?this.$menu.find("."+F.POPOVERHEADER)[0].cloneNode(!0):null,p=this.options.liveSearch?document.createElement("div"):null,u=this.options.actionsBox&&this.multiple&&this.$menu.find(".bs-actionsbox").length>0?this.$menu.find(".bs-actionsbox")[0].cloneNode(!0):null,f=this.options.doneButton&&this.multiple&&this.$menu.find(".bs-donebutton").length>0?this.$menu.find(".bs-donebutton")[0].cloneNode(!0):null,m=this.$element.find("option")[0];if(this.sizeInfo.selectWidth=this.$newElement[0].offsetWidth,d.className="text",c.className="dropdown-item "+(m?m.className:""),i.className=this.$menu[0].parentNode.className+" "+F.SHOW,i.style.width=0,"auto"===this.options.width&&(s.style.minWidth=0),s.className=F.MENU+" "+F.SHOW,n.className="inner "+F.SHOW,o.className=F.MENU+" inner "+("4"===B.major?F.SHOW:""),r.className=F.DIVIDER,l.className="dropdown-header",d.appendChild(document.createTextNode("​")),c.appendChild(d),a.appendChild(c),l.appendChild(d.cloneNode(!0)),this.selectpicker.view.widestOption&&o.appendChild(this.selectpicker.view.widestOption.cloneNode(!0)),o.appendChild(a),o.appendChild(r),o.appendChild(l),h&&s.appendChild(h),p){var v=document.createElement("input");p.className="bs-searchbox",v.className="form-control",p.appendChild(v),s.appendChild(p)}u&&s.appendChild(u),n.appendChild(o),s.appendChild(n),f&&s.appendChild(f),i.appendChild(s),document.body.appendChild(i);var g,b=a.offsetHeight,w=l?l.offsetHeight:0,I=h?h.offsetHeight:0,k=p?p.offsetHeight:0,$=u?u.offsetHeight:0,y=f?f.offsetHeight:0,S=e(r).outerHeight(!0),E=!!window.getComputedStyle&&window.getComputedStyle(s),C=s.offsetWidth,O=E?null:e(s),z={vert:x(E?E.paddingTop:O.css("paddingTop"))+x(E?E.paddingBottom:O.css("paddingBottom"))+x(E?E.borderTopWidth:O.css("borderTopWidth"))+x(E?E.borderBottomWidth:O.css("borderBottomWidth")),horiz:x(E?E.paddingLeft:O.css("paddingLeft"))+x(E?E.paddingRight:O.css("paddingRight"))+x(E?E.borderLeftWidth:O.css("borderLeftWidth"))+x(E?E.borderRightWidth:O.css("borderRightWidth"))},T={vert:z.vert+x(E?E.marginTop:O.css("marginTop"))+x(E?E.marginBottom:O.css("marginBottom"))+2,horiz:z.horiz+x(E?E.marginLeft:O.css("marginLeft"))+x(E?E.marginRight:O.css("marginRight"))+2};n.style.overflowY="scroll",g=s.offsetWidth-C,document.body.removeChild(i),this.sizeInfo.liHeight=b,this.sizeInfo.dropdownHeaderHeight=w,this.sizeInfo.headerHeight=I,this.sizeInfo.searchHeight=k,this.sizeInfo.actionsHeight=$,this.sizeInfo.doneButtonHeight=y,this.sizeInfo.dividerHeight=S,this.sizeInfo.menuPadding=z,this.sizeInfo.menuExtras=T,this.sizeInfo.menuWidth=C,this.sizeInfo.menuInnerInnerWidth=C-z.horiz,this.sizeInfo.totalMenuWidth=this.sizeInfo.menuWidth,this.sizeInfo.scrollBarWidth=g,this.sizeInfo.selectHeight=this.$newElement[0].offsetHeight,this.setPositionData()}},getSelectPosition:function(){var t,i=e(window),s=this.$newElement.offset(),n=e(this.options.container);this.options.container&&n.length&&!n.is("body")?((t=n.offset()).top+=parseInt(n.css("borderTopWidth")),t.left+=parseInt(n.css("borderLeftWidth"))):t={top:0,left:0};var o=this.options.windowPadding;this.sizeInfo.selectOffsetTop=s.top-t.top-i.scrollTop(),this.sizeInfo.selectOffsetBot=i.height()-this.sizeInfo.selectOffsetTop-this.sizeInfo.selectHeight-t.top-o[2],this.sizeInfo.selectOffsetLeft=s.left-t.left-i.scrollLeft(),this.sizeInfo.selectOffsetRight=i.width()-this.sizeInfo.selectOffsetLeft-this.sizeInfo.selectWidth-t.left-o[1],this.sizeInfo.selectOffsetTop-=o[0],this.sizeInfo.selectOffsetLeft-=o[3]},setMenuSize:function(e){this.getSelectPosition();var t,i,s,n,o,r,l,a,c=this.sizeInfo.selectWidth,d=this.sizeInfo.liHeight,h=this.sizeInfo.headerHeight,p=this.sizeInfo.searchHeight,u=this.sizeInfo.actionsHeight,f=this.sizeInfo.doneButtonHeight,m=this.sizeInfo.dividerHeight,v=this.sizeInfo.menuPadding,g=0;if(this.options.dropupAuto&&(l=d*this.selectpicker.current.elements.length+v.vert,a=this.sizeInfo.selectOffsetTop-this.sizeInfo.selectOffsetBot>this.sizeInfo.menuExtras.vert&&l+this.sizeInfo.menuExtras.vert+50>this.sizeInfo.selectOffsetBot,!0===this.selectpicker.isSearching&&(a=this.selectpicker.dropup),this.$newElement.toggleClass(F.DROPUP,a),this.selectpicker.dropup=a),"auto"===this.options.size)n=this.selectpicker.current.elements.length>3?3*this.sizeInfo.liHeight+this.sizeInfo.menuExtras.vert-2:0,i=this.sizeInfo.selectOffsetBot-this.sizeInfo.menuExtras.vert,s=n+h+p+u+f,r=Math.max(n-v.vert,0),this.$newElement.hasClass(F.DROPUP)&&(i=this.sizeInfo.selectOffsetTop-this.sizeInfo.menuExtras.vert),o=i,t=i-h-p-u-f-v.vert;else if(this.options.size&&"auto"!=this.options.size&&this.selectpicker.current.elements.length>this.options.size){for(var b=0;b<this.options.size;b++)"divider"===this.selectpicker.current.data[b].type&&g++;t=(i=d*this.options.size+g*m+v.vert)-v.vert,o=i+h+p+u+f,s=r=""}this.$menu.css({"max-height":o+"px",overflow:"hidden","min-height":s+"px"}),this.$menuInner.css({"max-height":t+"px","overflow-y":"auto","min-height":r+"px"}),this.sizeInfo.menuInnerHeight=Math.max(t,1),this.selectpicker.current.data.length&&this.selectpicker.current.data[this.selectpicker.current.data.length-1].position>this.sizeInfo.menuInnerHeight&&(this.sizeInfo.hasScrollBar=!0,this.sizeInfo.totalMenuWidth=this.sizeInfo.menuWidth+this.sizeInfo.scrollBarWidth),"auto"===this.options.dropdownAlignRight&&this.$menu.toggleClass(F.MENURIGHT,this.sizeInfo.selectOffsetLeft>this.sizeInfo.selectOffsetRight&&this.sizeInfo.selectOffsetRight<this.sizeInfo.totalMenuWidth-c),this.dropdown&&this.dropdown._popper&&this.dropdown._popper.update()},setSize:function(t){if(this.liHeight(t),this.options.header&&this.$menu.css("padding-top",0),!1!==this.options.size){var i=this,s=e(window);this.setMenuSize(),this.options.liveSearch&&this.$searchbox.off("input.setMenuSize propertychange.setMenuSize").on("input.setMenuSize propertychange.setMenuSize",(function(){return i.setMenuSize()})),"auto"===this.options.size?s.off("resize.bs.select."+this.selectId+".setMenuSize scroll"+U+"."+this.selectId+".setMenuSize").on("resize.bs.select."+this.selectId+".setMenuSize scroll"+U+"."+this.selectId+".setMenuSize",(function(){return i.setMenuSize()})):this.options.size&&"auto"!=this.options.size&&this.selectpicker.current.elements.length>this.options.size&&s.off("resize.bs.select."+this.selectId+".setMenuSize scroll"+U+"."+this.selectId+".setMenuSize")}this.createView(!1,!0,t)},setWidth:function(){var e=this;"auto"===this.options.width?requestAnimationFrame((function(){e.$menu.css("min-width","0"),e.$element.on("loaded.bs.select",(function(){e.liHeight(),e.setMenuSize();var t=e.$newElement.clone().appendTo("body"),i=t.css("width","auto").children("button").outerWidth();t.remove(),e.sizeInfo.selectWidth=Math.max(e.sizeInfo.totalMenuWidth,i),e.$newElement.css("width",e.sizeInfo.selectWidth+"px")}))})):"fit"===this.options.width?(this.$menu.css("min-width",""),this.$newElement.css("width","").addClass("fit-width")):this.options.width?(this.$menu.css("min-width",""),this.$newElement.css("width",this.options.width)):(this.$menu.css("min-width",""),this.$newElement.css("width","")),this.$newElement.hasClass("fit-width")&&"fit"!==this.options.width&&this.$newElement[0].classList.remove("fit-width")},selectPosition:function(){this.$bsContainer=e('<div class="bs-container" />');var t,i,s,n=this,o=e(this.options.container),r=function(r){var l={},a=n.options.display||!!e.fn.dropdown.Constructor.Default&&e.fn.dropdown.Constructor.Default.display;n.$bsContainer.addClass(r.attr("class").replace(/form-control|fit-width/gi,"")).toggleClass(F.DROPUP,r.hasClass(F.DROPUP)),t=r.offset(),o.is("body")?i={top:0,left:0}:((i=o.offset()).top+=parseInt(o.css("borderTopWidth"))-o.scrollTop(),i.left+=parseInt(o.css("borderLeftWidth"))-o.scrollLeft()),s=r.hasClass(F.DROPUP)?0:r[0].offsetHeight,(B.major<4||"static"===a)&&(l.top=t.top-i.top+s,l.left=t.left-i.left),l.width=r[0].offsetWidth,n.$bsContainer.css(l)};this.$button.on("click.bs.dropdown.data-api",(function(){n.isDisabled()||(r(n.$newElement),n.$bsContainer.appendTo(n.options.container).toggleClass(F.SHOW,!n.$button.hasClass(F.SHOW)).append(n.$menu))})),e(window).off("resize.bs.select."+this.selectId+" scroll"+U+"."+this.selectId).on("resize.bs.select."+this.selectId+" scroll"+U+"."+this.selectId,(function(){n.$newElement.hasClass(F.SHOW)&&r(n.$newElement)})),this.$element.on("hide.bs.select",(function(){n.$menu.data("height",n.$menu.height()),n.$bsContainer.detach()}))},setOptionStatus:function(e){if(this.noScroll=!1,this.selectpicker.view.visibleElements&&this.selectpicker.view.visibleElements.length)for(var t=0;t<this.selectpicker.view.visibleElements.length;t++){var i=this.selectpicker.current.data[t+this.selectpicker.view.position0],s=i.option;s&&(!0!==e&&this.setDisabled(i.index,i.disabled),this.setSelected(i.index,s.selected))}},setSelected:function(e,t){var i,s,n=this.selectpicker.main.elements[e],o=this.selectpicker.main.data[e],r=void 0!==this.activeIndex,l=this.activeIndex===e||t&&!this.multiple&&!r;o.selected=t,s=n.firstChild,t&&(this.selectedIndex=e),n.classList.toggle("selected",t),l?(this.focusItem(n,o),this.selectpicker.view.currentActive=n,this.activeIndex=e):this.defocusItem(n),s&&(s.classList.toggle("selected",t),t?s.setAttribute("aria-selected",!0):this.multiple?s.setAttribute("aria-selected",!1):s.removeAttribute("aria-selected")),l||r||!t||void 0===this.prevActiveIndex||(i=this.selectpicker.main.elements[this.prevActiveIndex],this.defocusItem(i))},setDisabled:function(e,t){var i,s=this.selectpicker.main.elements[e];this.selectpicker.main.data[e].disabled=t,i=s.firstChild,s.classList.toggle(F.DISABLED,t),i&&("4"===B.major&&i.classList.toggle(F.DISABLED,t),t?(i.setAttribute("aria-disabled",t),i.setAttribute("tabindex",-1)):(i.removeAttribute("aria-disabled"),i.setAttribute("tabindex",0)))},isDisabled:function(){return this.$element[0].disabled},checkDisabled:function(){this.isDisabled()?(this.$newElement[0].classList.add(F.DISABLED),this.$button.addClass(F.DISABLED).attr("tabindex",-1).attr("aria-disabled",!0)):(this.$button[0].classList.contains(F.DISABLED)&&(this.$newElement[0].classList.remove(F.DISABLED),this.$button.removeClass(F.DISABLED).attr("aria-disabled",!1)),-1!=this.$button.attr("tabindex")||this.$element.data("tabindex")||this.$button.removeAttr("tabindex"))},tabIndex:function(){this.$element.data("tabindex")!==this.$element.attr("tabindex")&&-98!==this.$element.attr("tabindex")&&"-98"!==this.$element.attr("tabindex")&&(this.$element.data("tabindex",this.$element.attr("tabindex")),this.$button.attr("tabindex",this.$element.data("tabindex"))),this.$element.attr("tabindex",-98)},clickListener:function(){var t=this,i=e(document);function s(){t.options.liveSearch?t.$searchbox.trigger("focus"):t.$menuInner.trigger("focus")}function n(){t.dropdown&&t.dropdown._popper&&t.dropdown._popper.state.isCreated?s():requestAnimationFrame(n)}i.data("spaceSelect",!1),this.$button.on("keyup",(function(e){/(32)/.test(e.keyCode.toString(10))&&i.data("spaceSelect")&&(e.preventDefault(),i.data("spaceSelect",!1))})),this.$newElement.on("show.bs.dropdown",(function(){B.major>3&&!t.dropdown&&(t.dropdown=t.$button.data("bs.dropdown"),t.dropdown._menu=t.$menu[0])})),this.$button.on("click.bs.dropdown.data-api",(function(){t.$newElement.hasClass(F.SHOW)||t.setSize()})),this.$element.on("shown.bs.select",(function(){t.$menuInner[0].scrollTop!==t.selectpicker.view.scrollTop&&(t.$menuInner[0].scrollTop=t.selectpicker.view.scrollTop),B.major>3?requestAnimationFrame(n):s()})),this.$menuInner.on("mouseenter","li a",(function(e){var i=this.parentElement,s=t.isVirtual()?t.selectpicker.view.position0:0,n=Array.prototype.indexOf.call(i.parentElement.children,i),o=t.selectpicker.current.data[n+s];t.focusItem(i,o,!0)})),this.$menuInner.on("click","li a",(function(i,s){var n=e(this),o=t.$element[0],r=t.isVirtual()?t.selectpicker.view.position0:0,l=t.selectpicker.current.data[n.parent().index()+r],a=l.index,c=v(o),d=o.selectedIndex,h=o.options[d],p=!0;if(t.multiple&&1!==t.options.maxOptions&&i.stopPropagation(),i.preventDefault(),!t.isDisabled()&&!n.parent().hasClass(F.DISABLED)){var u=l.option,f=e(u),g=u.selected,w=f.parent("optgroup"),I=w.find("option"),x=t.options.maxOptions,k=w.data("maxOptions")||!1;if(a===t.activeIndex&&(s=!0),s||(t.prevActiveIndex=t.activeIndex,t.activeIndex=void 0),t.multiple){if(u.selected=!g,t.setSelected(a,!g),n.trigger("blur"),!1!==x||!1!==k){var $=x<m(o).length,y=k<w.find("option:selected").length;if(x&&$||k&&y)if(x&&1==x)o.selectedIndex=-1,u.selected=!0,t.setOptionStatus(!0);else if(k&&1==k){for(var S=0;S<I.length;S++){var E=I[S];E.selected=!1,t.setSelected(E.liIndex,!1)}u.selected=!0,t.setSelected(a,!0)}else{var C="string"==typeof t.options.maxOptionsText?[t.options.maxOptionsText,t.options.maxOptionsText]:t.options.maxOptionsText,O="function"==typeof C?C(x,k):C,z=O[0].replace("{n}",x),T=O[1].replace("{n}",k),A=e('<div class="notify"></div>');O[2]&&(z=z.replace("{var}",O[2][x>1?0:1]),T=T.replace("{var}",O[2][k>1?0:1])),u.selected=!1,t.$menu.append(A),x&&$&&(A.append(e("<div>"+z+"</div>")),p=!1,t.$element.trigger("maxReached.bs.select")),k&&y&&(A.append(e("<div>"+T+"</div>")),p=!1,t.$element.trigger("maxReachedGrp.bs.select")),setTimeout((function(){t.setSelected(a,!1)}),10),A[0].classList.add("fadeOut"),setTimeout((function(){A.remove()}),1050)}}}else h&&(h.selected=!1),u.selected=!0,t.setSelected(a,!0);!t.multiple||t.multiple&&1===t.options.maxOptions?t.$button.trigger("focus"):t.options.liveSearch&&t.$searchbox.trigger("focus"),p&&(t.multiple||d!==o.selectedIndex)&&(b=[u.index,f.prop("selected"),c],t.$element.triggerNative("change"))}})),this.$menu.on("click","li."+F.DISABLED+" a, ."+F.POPOVERHEADER+", ."+F.POPOVERHEADER+" :not(.close)",(function(i){i.currentTarget==this&&(i.preventDefault(),i.stopPropagation(),t.options.liveSearch&&!e(i.target).hasClass("close")?t.$searchbox.trigger("focus"):t.$button.trigger("focus"))})),this.$menuInner.on("click",".divider, .dropdown-header",(function(e){e.preventDefault(),e.stopPropagation(),t.options.liveSearch?t.$searchbox.trigger("focus"):t.$button.trigger("focus")})),this.$menu.on("click","."+F.POPOVERHEADER+" .close",(function(){t.$button.trigger("click")})),this.$searchbox.on("click",(function(e){e.stopPropagation()})),this.$menu.on("click",".actions-btn",(function(i){t.options.liveSearch?t.$searchbox.trigger("focus"):t.$button.trigger("focus"),i.preventDefault(),i.stopPropagation(),e(this).hasClass("bs-select-all")?t.selectAll():t.deselectAll()})),this.$element.on("change.bs.select",(function(){t.render(),t.$element.trigger("changed.bs.select",b),b=null})).on("focus.bs.select",(function(){t.options.mobile||t.$button.trigger("focus")}))},liveSearchListener:function(){var e=this,t=document.createElement("li");this.$button.on("click.bs.dropdown.data-api",(function(){e.$searchbox.val()&&e.$searchbox.val("")})),this.$searchbox.on("click.bs.dropdown.data-api focus.bs.dropdown.data-api touchend.bs.dropdown.data-api",(function(e){e.stopPropagation()})),this.$searchbox.on("input propertychange",(function(){var i=e.$searchbox.val();if(e.selectpicker.search.elements=[],e.selectpicker.search.data=[],i){var s=[],n=i.toUpperCase(),o={},r=[],l=e._searchStyle(),a=e.options.liveSearchNormalize;a&&(n=E(n));for(var c=0;c<e.selectpicker.main.data.length;c++){var d=e.selectpicker.main.data[c];o[c]||(o[c]=I(d,n,l,a)),o[c]&&void 0!==d.headerIndex&&-1===r.indexOf(d.headerIndex)&&(d.headerIndex>0&&(o[d.headerIndex-1]=!0,r.push(d.headerIndex-1)),o[d.headerIndex]=!0,r.push(d.headerIndex),o[d.lastIndex+1]=!0),o[c]&&"optgroup-label"!==d.type&&r.push(c)}c=0;for(var h=r.length;c<h;c++){var p=r[c],u=r[c-1],f=(d=e.selectpicker.main.data[p],e.selectpicker.main.data[u]);("divider"!==d.type||"divider"===d.type&&f&&"divider"!==f.type&&h-1!==c)&&(e.selectpicker.search.data.push(d),s.push(e.selectpicker.main.elements[p]))}e.activeIndex=void 0,e.noScroll=!0,e.$menuInner.scrollTop(0),e.selectpicker.search.elements=s,e.createView(!0),s.length||(t.className="no-results",t.innerHTML=e.options.noneResultsText.replace("{0}",'"'+L(i)+'"'),e.$menuInner[0].firstChild.appendChild(t))}else e.$menuInner.scrollTop(0),e.createView(!1)}))},_searchStyle:function(){return this.options.liveSearchStyle||"contains"},val:function(e){var t=this.$element[0];if(void 0!==e){var i=v(t);if(b=[null,null,i],this.$element.val(e).trigger("changed.bs.select",b),this.$newElement.hasClass(F.SHOW))if(this.multiple)this.setOptionStatus(!0);else{var s=(t.options[t.selectedIndex]||{}).liIndex;"number"==typeof s&&(this.setSelected(this.selectedIndex,!1),this.setSelected(s,!0))}return this.render(),b=null,this.$element}return this.$element.val()},changeAll:function(e){if(this.multiple){void 0===e&&(e=!0);var t=this.$element[0],i=0,s=0,n=v(t);t.classList.add("bs-select-hidden");for(var o=0,r=this.selectpicker.current.data,l=r.length;o<l;o++){var a=r[o],c=a.option;c&&!a.disabled&&"divider"!==a.type&&(a.selected&&i++,c.selected=e,!0===e&&s++)}t.classList.remove("bs-select-hidden"),i!==s&&(this.setOptionStatus(),b=[null,null,n],this.$element.triggerNative("change"))}},selectAll:function(){return this.changeAll(!0)},deselectAll:function(){return this.changeAll(!1)},toggle:function(e){(e=e||window.event)&&e.stopPropagation(),this.$button.trigger("click.bs.dropdown.data-api")},keydown:function(t){var i,s,n,o,r,l=e(this),a=l.hasClass("dropdown-toggle"),c=(a?l.closest(".dropdown"):l.closest(V.MENU)).data("this"),d=c.findLis(),h=!1,p=t.which===W&&!a&&!c.options.selectOnTab,u=G.test(t.which)||p,f=c.$menuInner[0].scrollTop,m=!0===c.isVirtual()?c.selectpicker.view.position0:0;if(!(t.which>=112&&t.which<=123))if(!(s=c.$newElement.hasClass(F.SHOW))&&(u||t.which>=48&&t.which<=57||t.which>=96&&t.which<=105||t.which>=65&&t.which<=90)&&(c.$button.trigger("click.bs.dropdown.data-api"),c.options.liveSearch))c.$searchbox.trigger("focus");else{if(t.which===D&&s&&(t.preventDefault(),c.$button.trigger("click.bs.dropdown.data-api").trigger("focus")),u){if(!d.length)return;-1!==(i=(n=c.selectpicker.main.elements[c.activeIndex])?Array.prototype.indexOf.call(n.parentElement.children,n):-1)&&c.defocusItem(n),t.which===R?(-1!==i&&i--,i+m<0&&(i+=d.length),c.selectpicker.view.canHighlight[i+m]||-1===(i=c.selectpicker.view.canHighlight.slice(0,i+m).lastIndexOf(!0)-m)&&(i=d.length-1)):(t.which===M||p)&&(++i+m>=c.selectpicker.view.canHighlight.length&&(i=0),c.selectpicker.view.canHighlight[i+m]||(i=i+1+c.selectpicker.view.canHighlight.slice(i+m+1).indexOf(!0))),t.preventDefault();var v=m+i;t.which===R?0===m&&i===d.length-1?(c.$menuInner[0].scrollTop=c.$menuInner[0].scrollHeight,v=c.selectpicker.current.elements.length-1):h=(r=(o=c.selectpicker.current.data[v]).position-o.height)<f:(t.which===M||p)&&(0===i?(c.$menuInner[0].scrollTop=0,v=0):h=(r=(o=c.selectpicker.current.data[v]).position-c.sizeInfo.menuInnerHeight)>f),n=c.selectpicker.current.elements[v],c.activeIndex=c.selectpicker.current.data[v].index,c.focusItem(n),c.selectpicker.view.currentActive=n,h&&(c.$menuInner[0].scrollTop=r),c.options.liveSearch?c.$searchbox.trigger("focus"):l.trigger("focus")}else if(!l.is("input")&&!K.test(t.which)||t.which===P&&c.selectpicker.keydown.keyHistory){var g,b,w=[];t.preventDefault(),c.selectpicker.keydown.keyHistory+=N[t.which],c.selectpicker.keydown.resetKeyHistory.cancel&&clearTimeout(c.selectpicker.keydown.resetKeyHistory.cancel),c.selectpicker.keydown.resetKeyHistory.cancel=c.selectpicker.keydown.resetKeyHistory.start(),b=c.selectpicker.keydown.keyHistory,/^(.)\1+$/.test(b)&&(b=b.charAt(0));for(var x=0;x<c.selectpicker.current.data.length;x++){var k=c.selectpicker.current.data[x];I(k,b,"startsWith",!0)&&c.selectpicker.view.canHighlight[x]&&w.push(k.index)}if(w.length){var $=0;d.removeClass("active").find("a").removeClass("active"),1===b.length&&(-1===($=w.indexOf(c.activeIndex))||$===w.length-1?$=0:$++),g=w[$],f-(o=c.selectpicker.main.data[g]).position>0?(r=o.position-o.height,h=!0):(r=o.position-c.sizeInfo.menuInnerHeight,h=o.position>f+c.sizeInfo.menuInnerHeight),n=c.selectpicker.main.elements[g],c.activeIndex=w[$],c.focusItem(n),n&&n.firstChild.focus(),h&&(c.$menuInner[0].scrollTop=r),l.trigger("focus")}}s&&(t.which===P&&!c.selectpicker.keydown.keyHistory||t.which===H||t.which===W&&c.options.selectOnTab)&&(t.which!==P&&t.preventDefault(),c.options.liveSearch&&t.which===P||(c.$menuInner.find(".active a").trigger("click",!0),l.trigger("focus"),c.options.liveSearch||(t.preventDefault(),e(document).data("spaceSelect",!0))))}},mobile:function(){this.$element[0].classList.add("mobile-device")},refresh:function(){var t=e.extend({},this.options,this.$element.data());this.options=t,this.checkDisabled(),this.setStyle(),this.render(),this.buildData(),this.buildList(),this.setWidth(),this.setSize(!0),this.$element.trigger("refreshed.bs.select")},hide:function(){this.$newElement.hide()},show:function(){this.$newElement.show()},remove:function(){this.$newElement.remove(),this.$element.remove()},destroy:function(){this.$newElement.before(this.$element).remove(),this.$bsContainer?this.$bsContainer.remove():this.$menu.remove(),this.$element.off(U).removeData("selectpicker").removeClass("bs-select-hidden selectpicker"),e(window).off(".bs.select."+this.selectId)}};var J=e.fn.selectpicker;e.fn.selectpicker=Y,e.fn.selectpicker.Constructor=Z,e.fn.selectpicker.noConflict=function(){return e.fn.selectpicker=J,this},e(document).off("keydown.bs.dropdown.data-api",'.bootstrap-select [data-toggle="dropdown"], .bootstrap-select .dropdown-menu').on("keydown.bs.select",'.bootstrap-select [data-toggle="dropdown"], .bootstrap-select [role="listbox"], .bootstrap-select .bs-searchbox input',Z.prototype.keydown).on("focusin.modal",'.bootstrap-select [data-toggle="dropdown"], .bootstrap-select [role="listbox"], .bootstrap-select .bs-searchbox input',(function(e){e.stopPropagation()})),e(window).on("load.bs.select.data-api",(function(){e(".selectpicker").each((function(){var t=e(this);Y.call(t,t.data())}))}))}($)},function(e,t){$(document).ready((function(){let e=$(".form-group.has-error").first().closest(".tab-pane");if(e.length>0)$(".nav.nav-tabs").find("a[href^='#"+e.attr("id")+"-']").tab("show");else if(document.location.hash.length>0){let e=$(".nav.nav-tabs").find("a[href^='"+document.location.hash+"-']");e.length>0&&(document.location.hash="",e.tab("show"))}}))},function(e,t){$(document).on("click","[data-effective-inputs-for-add]",(function(e){e.preventDefault();let t=$(e.currentTarget).closest(".effective-inputs-for");if(0==t.length)return!1;let i=(new Date).valueOf(),s=t.data("template").replace(/EIFINDEX/g,i),n=$(s).hide();return window.EffectiveForm&&window.EffectiveForm.initialize(n),$(e.currentTarget).before(n.fadeIn("slow")),!1})),$(document).on("click","[data-effective-inputs-for-delete]",(function(e){e.preventDefault();let t=$(e.currentTarget),i=t.siblings("input[type='hidden']").first(),s=t.closest(".nested-fields").first();return i.length>0?(i.val("true"),s.fadeOut("slow")):s.fadeOut("slow",(function(){this.remove()})),!1})),$(document).ready((function(){$(document).find("div.effective-inputs-for:not(.initialized)").each((function(e,t){let i=$(t),s=$(t).children(".effective-inputs-for-template").first(),n=s.children(".nested-fields").first(),o=n.find("input").first().attr("name").match(/^(.*)\[0\]\[/),r=n.find("input").first().attr("id").match(/^(.*)_0_/),l=o[0].replace("0","EIFINDEX"),a=r[0].replace("0","EIFINDEX"),c=new RegExp(o[0].replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"g"),d=new RegExp(r[0],"g"),h=n[0].outerHTML.replace(c,l).replace(d,a);s.remove(),i.data("template",h),i.addClass("initialized")}))}))},function(e,t){$(document).on("change",".effective-radios input",(function(e){let t=$(e.currentTarget),i=t.closest(".effective-radios");if(0==(i.hasClass("is-valid")||i.hasClass("is-invalid")))return!1;t.is(":valid")?i.addClass("is-valid").removeClass("is-invalid"):i.addClass("is-invalid").removeClass("is-valid")}))},function(e,t,i){"use strict";i.r(t);i(0),i(1);i(2);$(document).on("change","select.initialized",(function(e){$(e.currentTarget).closest("form").hasClass("was-validated")&&window.EffectiveForm.validateSelect($(e.currentTarget))}));const s={telephone_input:class{initialize(e,t){let i=t.mask;delete t.mask,e.mask(i,t)}},select:class{initialize(e,t){e.selectpicker(t)}}};class n{constructor(){this.currentSubmit=""}good(){return"you good"}initialize(e){return $(e||document).find("[data-input-js-options]:not(.initialized)").each((function(e,t){let i=$(t),n=JSON.parse(i.attr("data-input-js-options")),o=n.method_name;if(delete n.method_name,!s[o])return console.error("EffectiveForm "+o+" has not been implemented");(new s[o]).initialize(i,n),i.addClass("initialized")})),!0}onSubmitClick(e){return this.currentSubmit=$(e),!0}validate(e){let t=e.checkValidity(),i=$(e);return t?this.submitting(i):this.invalidate(i),t}submitting(e){return e.addClass("form-is-valid"),e.removeClass("form-is-invalid"),this.disable(e),e.attr("phx-submit")?this.flashLiveViewSuccess():this.flashSuccess(),!0}validateSelect(e){e.each((function(){$(this).is("select:invalid")?$(this).closest(".bootstrap-select").addClass("is-invalid").removeClass("is-valid"):$(this).closest(".bootstrap-select").addClass("is-valid").removeClass("is-invalid")}))}validateCustomControl(e){e.each((function(){$(this).find("input:invalid").length>0?$(this).addClass("is-invalid").removeClass("is-valid"):$(this).addClass("is-valid").removeClass("is-invalid")}))}invalidate(e){return this.reset(e),e.addClass("was-validated"),e.addClass("form-is-invalid"),e.find(".effective-current-submit").removeClass(".effective-current-submit"),this.validateSelect(e.find("select.initialized")),this.validateCustomControl(e.find(".effective-radios,.effective-checks")),this.flashError(),!0}spin(e){return this.currentSubmit.addClass("effective-current-submit"),!0}disable(e){return e.find("[type=submit]").prop("disabled",!0),!0}reset(e){return e.removeClass("was-validated"),e.removeClass("form-is-invalid"),e.removeClass("form-is-valid"),e.find(".effective-current-submit").removeClass(".effective-current-submit"),e.find("[type=submit]").removeAttr("disabled"),e.find(".alert.is-invalid").remove(),e.find(".is-invalid").removeClass("is-invalid"),e.find(".is-valid").removeClass("is-valid"),!0}flashSuccess(){this.flash("form-success",1e3,(function(){window.EffectiveForm.flashSpin()}))}flashLiveViewSuccess(){this.flash("form-success",0,(function(){window.EffectiveForm.flash("form-success")}))}flashError(){this.flash("form-error",1e3)}flashSpin(){this.flash("spinner",5e3)}flash(e,t=1e3,i){return 0!=this.currentSubmit.length&&this.currentSubmit.addClass("effective-current-submit").find(".eb-icon-"+e).show().delay(t).fadeOut("slow",(function(){$(".effective-current-submit").removeClass("effective-current-submit"),i&&i()}))}}class o{constructor(){return{updated(){$(this.el).find("select").selectpicker("init")},mounted(){$(this.el).trigger("effective-form:initialize")}}}}i(3),i(4),i(5);i.d(t,"EffectiveForm",(function(){return n})),i.d(t,"EffectiveFormLiveSocketHooks",(function(){return o})),
/*!
* --------------------------------------------------------------------------
* ExEffectiveBootstrap
* https://github.com/code-and-effect/ex_effective_bootstrap/
* --------------------------------------------------------------------------
*/
window.EffectiveForm||(window.EffectiveForm=new n),$(document).ready(window.EffectiveForm.initialize),$(document).on("turbolinks:load",window.EffectiveForm.initialize),$(document).on("effective-form:initialize",(function(e){window.EffectiveForm.initialize(e.currentTarget)}))}])}));
//# sourceMappingURL=ex_effective_bootstrap.js.map