UNPKG

44.1 kBJavaScriptView Raw
1/**
2 * multiple-select - Multiple select is a jQuery plugin to select multiple elements with checkboxes :).
3 *
4 * @version v1.4.0
5 * @homepage http://multiple-select.wenzhixin.net.cn
6 * @author wenzhixin <wenzhixin2010@gmail.com> (http://wenzhixin.net.cn/)
7 * @license MIT
8 */
9
10(function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(require("jquery")):"function"==typeof define&&define.amd?define(["jquery"],t):(e=e||self,t(e.jQuery))})(this,function(t){'use strict';var M=Math.max,N=Math.min,D=Math.floor;function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e(t)}function l(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function n(e,t){for(var l,n=0;n<t.length;n++)l=t[n],l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(e,l.key,l)}function s(e,t,l){return t&&n(e.prototype,t),l&&n(e,l),e}function o(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function i(e,t){return t={exports:{}},e(t,t.exports),t.exports}function a(){var e=o(["[data-group=\"","\"]"]);return a=function(){return e},e}function c(){var e=o(["[value=\"","\"]"]);return c=function(){return e},e}function r(){var e=o(["[value=\"","\"]"]);return r=function(){return e},e}function d(){var e=o(["[","][data-group=\"","\"]"]);return d=function(){return e},e}function p(){var e=o(["input[","]:checked"]);return p=function(){return e},e}function u(){var e=o(["[data-group=\"","\"]"]);return u=function(){return e},e}function h(){var e=o(["[data-group=\"","\"]"]);return h=function(){return e},e}function g(){var e=o(["<span>","</span>"]);return g=function(){return e},e}function m(){var e=o([" data-group=\"","\""]);return m=function(){return e},e}function b(){var e=o(["<input type=\"","\" value=\"","\" ","","","",">"]);return b=function(){return e},e}function y(){var e=o(["<label class=\"","\">"]);return y=function(){return e},e}function k(){var e=o(["<li class=\""," ","\" "," ",">"]);return k=function(){return e},e}function A(){var e=o(["style=\"","\""]);return A=function(){return e},e}function S(){var e=o(["<input type=\"checkbox\" "," ",">"]);return S=function(){return e},e}function v(){var e=o(["<label class=\"optgroup ","\" data-group=\"","\">"]);return v=function(){return e},e}function x(){var e=o(["title=\"","\""]);return x=function(){return e},e}function I(){var e=o(["<li class=\"ms-no-results\">","</li>"]);return I=function(){return e},e}function E(){var e=o(["<input type=\"checkbox\" "," />"]);return E=function(){return e},e}function C(){var e=o(["placeholder=\"","\""]);return C=function(){return e},e}function L(){var e=o(["<div class=\"ms-drop ","\"></div>"]);return L=function(){return e},e}function T(){var e=o(["\n <button type=\"button\" class=\"ms-choice\">\n <span class=\"placeholder\">","</span>\n <div></div>\n </button>\n "]);return T=function(){return e},e}function w(){var e=o(["title=\"","\""]);return w=function(){return e},e}function P(){var e=o(["<div class=\"ms-parent ","\" ","/>"]);return P=function(){return e},e}t=t&&t.hasOwnProperty("default")?t["default"]:t;var G,R,_,H="undefined"==typeof globalThis?"undefined"==typeof window?"undefined"==typeof global?"undefined"==typeof self?{}:self:global:window:globalThis,F="object",O=function(e){return e&&e.Math==Math&&e},j=O(typeof globalThis==F&&globalThis)||O(typeof window==F&&window)||O(typeof self==F&&self)||O(typeof H==F&&H)||Function("return this")(),U=function(e){try{return!!e()}catch(e){return!0}},V=!U(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}),Y={}.propertyIsEnumerable,z=Object.getOwnPropertyDescriptor,W=z&&!Y.call({1:2},1),B=W?function(e){var t=z(this,e);return!!t&&t.enumerable}:Y,f={f:B},q=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},K={}.toString,J=function(e){return K.call(e).slice(8,-1)},Z="".split,Q=U(function(){return!Object("z").propertyIsEnumerable(0)})?function(e){return"String"==J(e)?Z.call(e,""):Object(e)}:Object,X=function(e){if(e==null)throw TypeError("Can't call method on "+e);return e},ee=function(e){return Q(X(e))},te=function(e){return"object"==typeof e?null!==e:"function"==typeof e},le=function(e,t){if(!te(e))return e;var l,n;if(t&&"function"==typeof(l=e.toString)&&!te(n=l.call(e)))return n;if("function"==typeof(l=e.valueOf)&&!te(n=l.call(e)))return n;if(!t&&"function"==typeof(l=e.toString)&&!te(n=l.call(e)))return n;throw TypeError("Can't convert object to primitive value")},ne={}.hasOwnProperty,se=function(e,t){return ne.call(e,t)},oe=j.document,ie=te(oe)&&te(oe.createElement),ae=function(e){return ie?oe.createElement(e):{}},ce=!V&&!U(function(){return 7!=Object.defineProperty(ae("div"),"a",{get:function(){return 7}}).a}),re=Object.getOwnPropertyDescriptor,de=V?re:function(e,t){if(e=ee(e),t=le(t,!0),ce)try{return re(e,t)}catch(e){}return se(e,t)?q(!f.f.call(e,t),e[t]):void 0},pe={f:de},ue=function(e){if(!te(e))throw TypeError(e+" is not an object");return e},fe=Object.defineProperty,he=V?fe:function(e,t,l){if(ue(e),t=le(t,!0),ue(l),ce)try{return fe(e,t,l)}catch(e){}if("get"in l||"set"in l)throw TypeError("Accessors not supported");return"value"in l&&(e[t]=l.value),e},ge={f:he},me=V?function(e,t,l){return ge.f(e,t,q(1,l))}:function(e,t,l){return e[t]=l,e},be=function(e,t){try{me(j,e,t)}catch(l){j[e]=t}return t},ye=i(function(e){var t=j["__core-js_shared__"]||be("__core-js_shared__",{});(e.exports=function(e,l){return t[e]||(t[e]=l===void 0?{}:l)})("versions",[]).push({version:"3.2.1",mode:"global",copyright:"\xA9 2019 Denis Pushkarev (zloirock.ru)"})}),ke=ye("native-function-to-string",Function.toString),$e=j.WeakMap,Ae="function"==typeof $e&&/native code/.test(ke.call($e)),Se=0,ve=Math.random(),Oe=function(e){return"Symbol("+((e===void 0?"":e)+"")+")_"+(++Se+ve).toString(36)},xe=ye("keys"),Ie=function(e){return xe[e]||(xe[e]=Oe(e))},Ee={},Ce=j.WeakMap,Le=function(e){return _(e)?R(e):G(e,{})};if(Ae){var Te=new Ce,we=Te.get,Pe=Te.has,Me=Te.set;G=function(e,t){return Me.call(Te,e,t),t},R=function(e){return we.call(Te,e)||{}},_=function(e){return Pe.call(Te,e)}}else{var je=Ie("state");Ee[je]=!0,G=function(e,t){return me(e,je,t),t},R=function(e){return se(e,je)?e[je]:{}},_=function(e){return se(e,je)}}var Ne={set:G,get:R,has:_,enforce:Le,getterFor:function(e){return function(t){var l;if(!te(t)||(l=R(t)).type!==e)throw TypeError("Incompatible receiver, "+e+" required");return l}}},De=i(function(e){var t=Ne.get,l=Ne.enforce,n=(ke+"").split("toString");ye("inspectSource",function(e){return ke.call(e)}),(e.exports=function(e,t,s,o){var i=!!o&&!!o.unsafe,a=!!o&&!!o.enumerable,c=!!o&&!!o.noTargetGet;return("function"==typeof s&&("string"==typeof t&&!se(s,"name")&&me(s,"name",t),l(s).source=n.join("string"==typeof t?t:"")),e===j)?void(a?e[t]=s:be(t,s)):void(i?!c&&e[t]&&(a=!0):delete e[t],a?e[t]=s:me(e,t,s))})(Function.prototype,"toString",function(){return"function"==typeof this&&t(this).source||ke.call(this)})}),Ge=j,Re=function(e){return"function"==typeof e?e:void 0},_e=function(e,t){return 2>arguments.length?Re(Ge[e])||Re(j[e]):Ge[e]&&Ge[e][t]||j[e]&&j[e][t]},He=Math.ceil,Fe=function(e){return isNaN(e=+e)?0:(0<e?D:He)(e)},Ue=function(e){return 0<e?N(Fe(e),9007199254740991):0},Ve=function(e,t){var l=Fe(e);return 0>l?M(l+t,0):N(l,t)},Ye=function(e){return function(t,l,n){var s,o=ee(t),i=Ue(o.length),a=Ve(n,i);if(e&&l!=l){for(;i>a;)if(s=o[a++],s!=s)return!0;}else for(;i>a;a++)if((e||a in o)&&o[a]===l)return e||a||0;return!e&&-1}},ze={includes:Ye(!0),indexOf:Ye(!1)},We=ze.indexOf,Be=function(e,t){var l,n=ee(e),s=0,o=[];for(l in n)!se(Ee,l)&&se(n,l)&&o.push(l);for(;t.length>s;)se(n,l=t[s++])&&(~We(o,l)||o.push(l));return o},qe=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],Ke=qe.concat("length","prototype"),Je=Object.getOwnPropertyNames||function(e){return Be(e,Ke)},Ze={f:Je},Qe=Object.getOwnPropertySymbols,Xe={f:Qe},et=_e("Reflect","ownKeys")||function(e){var t=Ze.f(ue(e)),l=Xe.f;return l?t.concat(l(e)):t},tt=function(e,t){for(var l,n=et(t),s=ge.f,o=pe.f,a=0;a<n.length;a++)l=n[a],se(e,l)||s(e,l,o(t,l))},lt=/#|\.prototype\./,nt=function(e,t){var l=ot[st(e)];return!(l!=at)||l!=it&&("function"==typeof t?U(t):!!t)},st=nt.normalize=function(e){return(e+"").replace(lt,".").toLowerCase()},ot=nt.data={},it=nt.NATIVE="N",at=nt.POLYFILL="P",ct=pe.f,rt=function(e,t){var l,n,s,o,i,a,c=e.target,r=e.global,d=e.stat;if(n=r?j:d?j[c]||be(c,{}):(j[c]||{}).prototype,n)for(s in t){if(i=t[s],e.noTargetGet?(a=ct(n,s),o=a&&a.value):o=n[s],l=nt(r?s:c+(d?".":"#")+s,e.forced),!l&&void 0!==o){if(typeof i==typeof o)continue;tt(i,o)}(e.sham||o&&o.sham)&&me(i,"sham",!0),De(n,s,i,e)}},dt=Object.keys||function(e){return Be(e,qe)},pt=function(e){return Object(X(e))},ut=Object.assign,ft=!ut||U(function(){var e={},t={},l=Symbol(),n="abcdefghijklmnopqrst";return e[l]=7,n.split("").forEach(function(e){t[e]=e}),7!=ut({},e)[l]||dt(ut({},t)).join("")!=n})?function(e){for(var t=pt(e),l=arguments.length,n=1,s=Xe.f,o=f.f;l>n;)for(var i,a=Q(arguments[n++]),c=s?dt(a).concat(s(a)):dt(a),r=c.length,d=0;r>d;)i=c[d++],(!V||o.call(a,i))&&(t[i]=a[i]);return t}:ut;rt({target:"Object",stat:!0,forced:Object.assign!==ft},{assign:ft});var ht={name:"",placeholder:"",data:void 0,locale:void 0,selectAll:!0,single:!1,singleRadio:!1,multiple:!1,hideOptgroupCheckboxes:!1,multipleWidth:80,width:void 0,dropWidth:void 0,maxHeight:250,position:"bottom",displayValues:!1,displayTitle:!1,displayDelimiter:", ",minimumCountSelected:3,ellipsis:!1,isOpen:!1,keepOpen:!1,openOnHover:!1,container:null,filter:!1,filterGroup:!1,filterPlaceholder:"",filterAcceptOnEnter:!1,animate:void 0,styler:function(){return!1},textTemplate:function(e){return e[0].innerHTML},labelTemplate:function(e){return e[0].getAttribute("label")},onOpen:function(){return!1},onClose:function(){return!1},onCheckAll:function(){return!1},onUncheckAll:function(){return!1},onFocus:function(){return!1},onBlur:function(){return!1},onOptgroupClick:function(){return!1},onClick:function(){return!1},onFilter:function(){return!1},onAfterCreate:function(){return!1}},gt={formatSelectAll:function(){return"[Select all]"},formatAllSelected:function(){return"All selected"},formatCountSelected:function(e,t){return e+" of "+t+" selected"},formatNoMatchesFound:function(){return"No matches found"}};Object.assign(ht,gt);var mt={VERSION:"1.4.0",DEFAULTS:ht,METHODS:["getOptions","refreshOptions","getSelects","setSelects","enable","disable","open","close","checkAll","uncheckAll","focus","blur","refresh","destroy"],LOCALES:{en:gt,"en-US":gt}},bt=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function");return e},yt=function(e,t,l){return(bt(e),void 0===t)?e:0===l?function(){return e.call(t)}:1===l?function(l){return e.call(t,l)}:2===l?function(l,n){return e.call(t,l,n)}:3===l?function(l,n,s){return e.call(t,l,n,s)}:function(){return e.apply(t,arguments)}},kt=Array.isArray||function(e){return"Array"==J(e)},$t=!!Object.getOwnPropertySymbols&&!U(function(){return!(Symbol()+"")}),At=j.Symbol,St=ye("wks"),vt=function(e){return St[e]||(St[e]=$t&&At[e]||($t?At:Oe)("Symbol."+e))},Ot=vt("species"),xt=function(e,t){var l;return kt(e)&&(l=e.constructor,"function"==typeof l&&(l===Array||kt(l.prototype))?l=void 0:te(l)&&(l=l[Ot],null===l&&(l=void 0))),new(void 0===l?Array:l)(0===t?0:t)},It=[].push,Et=function(e){var t=1==e,l=4==e,n=6==e;return function(s,o,i,a){for(var c,r,d=pt(s),p=Q(d),u=yt(o,i,3),f=Ue(p.length),h=0,g=a||xt,m=t?g(s,f):2==e?g(s,0):void 0;f>h;h++)if((5==e||n||h in p)&&(c=p[h],r=u(c,h,d),e))if(t)m[h]=r;else if(r)switch(e){case 3:return!0;case 5:return c;case 6:return h;case 2:It.call(m,c);}else if(l)return!1;return n?-1:3==e||l?l:m}},Ct={forEach:Et(0),map:Et(1),filter:Et(2),some:Et(3),every:Et(4),find:Et(5),findIndex:Et(6)},Lt=vt("species"),Tt=function(e){return!U(function(){var t=[],l=t.constructor={};return l[Lt]=function(){return{foo:1}},1!==t[e](Boolean).foo})},wt=Ct.filter;rt({target:"Array",proto:!0,forced:!Tt("filter")},{filter:function(e){return wt(this,e,1<arguments.length?arguments[1]:void 0)}});var Pt=V?Object.defineProperties:function(e,t){ue(e);for(var l,n=dt(t),s=n.length,o=0;s>o;)ge.f(e,l=n[o++],t[l]);return e},Mt=_e("document","documentElement"),jt=Ie("IE_PROTO"),Nt="prototype",Dt=function(){},Gt=function(){var e,t=ae("iframe"),l=qe.length,n="<",s="script",o=">";for(t.style.display="none",Mt.appendChild(t),t.src="java"+s+":"+"",e=t.contentWindow.document,e.open(),e.write(n+s+o+"document.F=Object"+n+"/"+s+o),e.close(),Gt=e.F;l--;)delete Gt[Nt][qe[l]];return Gt()},Rt=Object.create||function(e,t){var l;return null===e?l=Gt():(Dt[Nt]=ue(e),l=new Dt,Dt[Nt]=null,l[jt]=e),void 0===t?l:Pt(l,t)};Ee[jt]=!0;var _t=vt("unscopables"),Ht=Array.prototype;Ht[_t]==null&&me(Ht,_t,Rt(null));var Ft=function(e){Ht[_t][e]=!0},Ut=Ct.find,Vt="find",Yt=!0;Vt in[]&&[,][Vt](function(){Yt=!1}),rt({target:"Array",proto:!0,forced:Yt},{find:function(e){return Ut(this,e,1<arguments.length?arguments[1]:void 0)}}),Ft(Vt);var zt=ze.includes;rt({target:"Array",proto:!0},{includes:function(e){return zt(this,e,1<arguments.length?arguments[1]:void 0)}}),Ft("includes");var Wt=function(e,t){var l=[][e];return!l||!U(function(){l.call(null,t||function(){throw 1},1)})},Bt=[].join,qt=Q!=Object,Kt=Wt("join",",");rt({target:"Array",proto:!0,forced:qt||Kt},{join:function(e){return Bt.call(ee(this),e===void 0?",":e)}});var Jt=Ct.map;rt({target:"Array",proto:!0,forced:!Tt("map")},{map:function(e){return Jt(this,e,1<arguments.length?arguments[1]:void 0)}});var Zt=function(e,t,l){var n=le(t);n in e?ge.f(e,n,q(0,l)):e[n]=l},Qt=vt("species"),Xt=[].slice;rt({target:"Array",proto:!0,forced:!Tt("slice")},{slice:function(e,t){var l,s,o,i=ee(this),a=Ue(i.length),c=Ve(e,a),r=Ve(void 0===t?a:t,a);if(kt(i)&&(l=i.constructor,"function"==typeof l&&(l===Array||kt(l.prototype))?l=void 0:te(l)&&(l=l[Qt],null===l&&(l=void 0)),l===Array||void 0===l))return Xt.call(i,c,r);for(s=new(void 0===l?Array:l)(M(r-c,0)),o=0;c<r;c++,o++)c in i&&Zt(s,o,i[c]);return s.length=o,s}});var el=ge.f,tl=Function.prototype,ll=tl.toString,nl=/^\s*function ([^ (]*)/,sl="name";V&&!(sl in tl)&&el(tl,sl,{configurable:!0,get:function(){try{return ll.call(this).match(nl)[1]}catch(e){return""}}});var ol=vt("match"),il=function(e){var t;return te(e)&&((t=e[ol])===void 0?"RegExp"==J(e):!!t)},al=function(e){if(il(e))throw TypeError("The method doesn't accept regular expressions");return e},cl=vt("match");rt({target:"String",proto:!0,forced:!function(e){var t=/./;try{"/./"[e](t)}catch(l){try{return t[cl]=!1,"/./"[e](t)}catch(e){}}return!1}("includes")},{includes:function(e){return!!~(X(this)+"").indexOf(al(e),1<arguments.length?arguments[1]:void 0)}});var rl=function(){var e=ue(this),t="";return e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.sticky&&(t+="y"),t},dl=RegExp.prototype.exec,pl=String.prototype.replace,ul=dl,fl=function(){var e=/a/,t=/b*/g;return dl.call(e,"a"),dl.call(t,"a"),0!==e.lastIndex||0!==t.lastIndex}(),hl=/()??/.exec("")[1]!==void 0;(fl||hl)&&(ul=function(e){var t,l,n,s,o=this;return hl&&(l=new RegExp("^"+o.source+"$(?!\\s)",rl.call(o))),fl&&(t=o.lastIndex),n=dl.call(o,e),fl&&n&&(o.lastIndex=o.global?n.index+n[0].length:t),hl&&n&&1<n.length&&pl.call(n[0],l,function(){for(s=1;s<arguments.length-2;s++)void 0===arguments[s]&&(n[s]=void 0)}),n});var gl=ul,ml=vt("species"),bl=!U(function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$<a>")}),yl=!U(function(){var e=/(?:)/,t=e.exec;e.exec=function(){return t.apply(this,arguments)};var l="ab".split(e);return 2!==l.length||"a"!==l[0]||"b"!==l[1]}),kl=function(e,t,l,n){var s=vt(e),o=!U(function(){var t={};return t[s]=function(){return 7},7!=""[e](t)}),i=o&&!U(function(){var t=!1,l=/a/;return l.exec=function(){return t=!0,null},"split"===e&&(l.constructor={},l.constructor[ml]=function(){return l}),l[s](""),!t});if(!o||!i||"replace"===e&&!bl||"split"===e&&!yl){var a=/./[s],c=l(s,""[e],function(e,t,l,n,s){return t.exec===gl?o&&!s?{done:!0,value:a.call(t,l,n)}:{done:!0,value:e.call(l,t,n)}:{done:!1}}),r=c[0],d=c[1];De(String.prototype,e,r),De(RegExp.prototype,s,2==t?function(e,t){return d.call(e,this,t)}:function(e){return d.call(e,this)}),n&&me(RegExp.prototype[s],"sham",!0)}},$l=vt("species"),Al=function(e,t){var l,n=ue(e).constructor;return n===void 0||(l=ue(n)[$l])==null?t:bt(l)},Sl=function(e){return function(t,l){var n,s,o=X(t)+"",i=Fe(l),a=o.length;return 0>i||i>=a?e?"":void 0:(n=o.charCodeAt(i),55296>n||56319<n||i+1===a||56320>(s=o.charCodeAt(i+1))||57343<s?e?o.charAt(i):n:e?o.slice(i,i+2):(n-55296<<10)+(s-56320)+65536)}},vl={codeAt:Sl(!1),charAt:Sl(!0)},Ol=vl.charAt,xl=function(e,t,l){return t+(l?Ol(e,t).length:1)},Il=function(e,t){var l=e.exec;if("function"==typeof l){var n=l.call(e,t);if("object"!=typeof n)throw TypeError("RegExp exec method returned something other than an Object or null");return n}if("RegExp"!==J(e))throw TypeError("RegExp#exec called on incompatible receiver");return gl.call(e,t)},El=[].push,Cl=4294967295,Ll=!U(function(){return!RegExp(Cl,"y")});kl("split",2,function(e,t,l){var n;return n="c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1).length||2!="ab".split(/(?:ab)*/).length||4!=".".split(/(.?)(.?)/).length||1<".".split(/()()/).length||"".split(/.?/).length?function(e,l){var n=X(this)+"",s=void 0===l?Cl:l>>>0;if(0===s)return[];if(void 0===e)return[n];if(!il(e))return t.call(n,e,s);for(var o,i,a,c=[],r=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")+(e.sticky?"y":""),d=0,p=new RegExp(e.source,r+"g");(o=gl.call(p,n))&&(i=p.lastIndex,!(i>d&&(c.push(n.slice(d,o.index)),1<o.length&&o.index<n.length&&El.apply(c,o.slice(1)),a=o[0].length,d=i,c.length>=s)));)p.lastIndex===o.index&&p.lastIndex++;return d===n.length?(a||!p.test(""))&&c.push(""):c.push(n.slice(d)),c.length>s?c.slice(0,s):c}:function(e,l){return void 0===e&&0===l?[]:t.call(this,e,l)},[function(t,l){var s=X(this),o=null==t?void 0:t[e];return void 0===o?n.call(s+"",t,l):o.call(t,s,l)},function(s,o){var a=l(n,s,this,o,n!==t);if(a.done)return a.value;var c=ue(s),r=this+"",d=Al(c,RegExp),u=c.unicode,f=(c.ignoreCase?"i":"")+(c.multiline?"m":"")+(c.unicode?"u":"")+(Ll?"y":"g"),h=new d(Ll?c:"^(?:"+c.source+")",f),g=void 0===o?Cl:o>>>0;if(0===g)return[];if(0===r.length)return null===Il(h,r)?[r]:[];for(var m=0,b=0,y=[];b<r.length;){h.lastIndex=Ll?b:0;var k,$=Il(h,Ll?r:r.slice(b));if(null===$||(k=N(Ue(h.lastIndex+(Ll?0:b)),r.length))===m)b=xl(r,b,u);else{if(y.push(r.slice(m,b)),y.length===g)return y;for(var A=1;A<=$.length-1;A++)if(y.push($[A]),y.length===g)return y;b=m=k}}return y.push(r.slice(m)),y}]},!Ll);var Tl="[\t\n\x0B\f\r \xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]",wl=RegExp("^"+Tl+Tl+"*"),Pl=RegExp(Tl+Tl+"*$"),Ml=function(e){return function(t){var l=X(t)+"";return 1&e&&(l=l.replace(wl,"")),2&e&&(l=l.replace(Pl,"")),l}},jl={start:Ml(1),end:Ml(2),trim:Ml(3)},Nl="\u200B\x85\u180E",Dl=jl.trim;rt({target:"String",proto:!0,forced:function(e){return U(function(){return!!"\t\n\x0B\f\r \xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF"[e]()||Nl[e]()!=Nl||"\t\n\x0B\f\r \xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF"[e].name!==e})}("trim")},{trim:function(){return Dl(this)}});var Gl={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},Rl=Ct.forEach,_l=Wt("forEach")?function(e){return Rl(this,e,1<arguments.length?arguments[1]:void 0)}:[].forEach;for(var Hl in Gl){var Fl=j[Hl],Ul=Fl&&Fl.prototype;if(Ul&&Ul.forEach!==_l)try{me(Ul,"forEach",_l)}catch(e){Ul.forEach=_l}}var Vl=U(function(){dt(1)});rt({target:"Object",stat:!0,forced:Vl},{keys:function(e){return dt(pt(e))}});var Yl=/\$([$&'`]|\d\d?|<[^>]*>)/g,zl=/\$([$&'`]|\d\d?)/g,Wl=function(e){return e===void 0?e:e+""};kl("replace",2,function(e,t,l){function n(e,l,s,o,i,a){var c=s+e.length,r=o.length,n=zl;return void 0!==i&&(i=pt(i),n=Yl),t.call(a,n,function(t,a){var d;switch(a.charAt(0)){case"$":return"$";case"&":return e;case"`":return l.slice(0,s);case"'":return l.slice(c);case"<":d=i[a.slice(1,-1)];break;default:var p=+a;if(0==p)return t;if(p>r){var n=D(p/10);return 0===n?t:n<=r?void 0===o[n-1]?a.charAt(1):o[n-1]+a.charAt(1):t}d=o[p-1];}return void 0===d?"":d})}return[function(l,n){var s=X(this),o=l==null?void 0:l[e];return o===void 0?t.call(s+"",l,n):o.call(l,s,n)},function(e,s){var o=l(t,e,this,s);if(o.done)return o.value;var a=ue(e),c=this+"",r="function"==typeof s;r||(s=s+"");var d=a.global;if(d){var p=a.unicode;a.lastIndex=0}for(var u,f=[];(u=Il(a,c),null!==u)&&!(f.push(u),!d);){var h=u[0]+"";""==h&&(a.lastIndex=xl(c,Ue(a.lastIndex),p))}for(var g="",m=0,b=0;b<f.length;b++){u=f[b];for(var y=u[0]+"",k=M(N(Fe(u.index),c.length),0),$=[],A=1;A<u.length;A++)$.push(Wl(u[A]));var S=u.groups;if(r){var v=[y].concat($,k,c);S!==void 0&&v.push(S);var O=s.apply(void 0,v)+""}else O=n(y,c,k,$,S,s);k>=m&&(g+=c.slice(m,k)+O,m=k+y.length)}return g+c.slice(m)}]});var Bl=function(e){for(var t=arguments.length,l=Array(1<t?t-1:0),n=1;n<t;n++)l[n-1]=arguments[n];return function(){for(var t=arguments.length,n=Array(t),s=0;s<t;s++)n[s]=arguments[s];var o="";return e.slice(0,-1).some(function(e,t){switch(l[t]){default:throw new TypeError("Unrecognized sprintf format");case"s":{var s=n[t];if(null===s||s===void 0)return!0;return o+=e+s,!1}}})?"":o+e.slice(-1)}},ql=function(e,t,l){var n=Object.keys(e),s=Object.keys(t);if(l&&n.length!==s.length)return!1;for(var o,i=0,a=n;i<a.length;i++)if(o=a[i],s.includes(o)&&e[o]!==t[o])return!1;return!0},Kl=function(e){if(e.normalize)return e.normalize("NFD").replace(/[\u0300-\u036F]/g,"");var t=[{base:"A",letters:/[\u0041\u24B6\uFF21\u00C0\u00C1\u00C2\u1EA6\u1EA4\u1EAA\u1EA8\u00C3\u0100\u0102\u1EB0\u1EAE\u1EB4\u1EB2\u0226\u01E0\u00C4\u01DE\u1EA2\u00C5\u01FA\u01CD\u0200\u0202\u1EA0\u1EAC\u1EB6\u1E00\u0104\u023A\u2C6F]/g},{base:"AA",letters:/[\uA732]/g},{base:"AE",letters:/[\u00C6\u01FC\u01E2]/g},{base:"AO",letters:/[\uA734]/g},{base:"AU",letters:/[\uA736]/g},{base:"AV",letters:/[\uA738\uA73A]/g},{base:"AY",letters:/[\uA73C]/g},{base:"B",letters:/[\u0042\u24B7\uFF22\u1E02\u1E04\u1E06\u0243\u0182\u0181]/g},{base:"C",letters:/[\u0043\u24B8\uFF23\u0106\u0108\u010A\u010C\u00C7\u1E08\u0187\u023B\uA73E]/g},{base:"D",letters:/[\u0044\u24B9\uFF24\u1E0A\u010E\u1E0C\u1E10\u1E12\u1E0E\u0110\u018B\u018A\u0189\uA779]/g},{base:"DZ",letters:/[\u01F1\u01C4]/g},{base:"Dz",letters:/[\u01F2\u01C5]/g},{base:"E",letters:/[\u0045\u24BA\uFF25\u00C8\u00C9\u00CA\u1EC0\u1EBE\u1EC4\u1EC2\u1EBC\u0112\u1E14\u1E16\u0114\u0116\u00CB\u1EBA\u011A\u0204\u0206\u1EB8\u1EC6\u0228\u1E1C\u0118\u1E18\u1E1A\u0190\u018E]/g},{base:"F",letters:/[\u0046\u24BB\uFF26\u1E1E\u0191\uA77B]/g},{base:"G",letters:/[\u0047\u24BC\uFF27\u01F4\u011C\u1E20\u011E\u0120\u01E6\u0122\u01E4\u0193\uA7A0\uA77D\uA77E]/g},{base:"H",letters:/[\u0048\u24BD\uFF28\u0124\u1E22\u1E26\u021E\u1E24\u1E28\u1E2A\u0126\u2C67\u2C75\uA78D]/g},{base:"I",letters:/[\u0049\u24BE\uFF29\u00CC\u00CD\u00CE\u0128\u012A\u012C\u0130\u00CF\u1E2E\u1EC8\u01CF\u0208\u020A\u1ECA\u012E\u1E2C\u0197]/g},{base:"J",letters:/[\u004A\u24BF\uFF2A\u0134\u0248]/g},{base:"K",letters:/[\u004B\u24C0\uFF2B\u1E30\u01E8\u1E32\u0136\u1E34\u0198\u2C69\uA740\uA742\uA744\uA7A2]/g},{base:"L",letters:/[\u004C\u24C1\uFF2C\u013F\u0139\u013D\u1E36\u1E38\u013B\u1E3C\u1E3A\u0141\u023D\u2C62\u2C60\uA748\uA746\uA780]/g},{base:"LJ",letters:/[\u01C7]/g},{base:"Lj",letters:/[\u01C8]/g},{base:"M",letters:/[\u004D\u24C2\uFF2D\u1E3E\u1E40\u1E42\u2C6E\u019C]/g},{base:"N",letters:/[\u004E\u24C3\uFF2E\u01F8\u0143\u00D1\u1E44\u0147\u1E46\u0145\u1E4A\u1E48\u0220\u019D\uA790\uA7A4]/g},{base:"NJ",letters:/[\u01CA]/g},{base:"Nj",letters:/[\u01CB]/g},{base:"O",letters:/[\u004F\u24C4\uFF2F\u00D2\u00D3\u00D4\u1ED2\u1ED0\u1ED6\u1ED4\u00D5\u1E4C\u022C\u1E4E\u014C\u1E50\u1E52\u014E\u022E\u0230\u00D6\u022A\u1ECE\u0150\u01D1\u020C\u020E\u01A0\u1EDC\u1EDA\u1EE0\u1EDE\u1EE2\u1ECC\u1ED8\u01EA\u01EC\u00D8\u01FE\u0186\u019F\uA74A\uA74C]/g},{base:"OI",letters:/[\u01A2]/g},{base:"OO",letters:/[\uA74E]/g},{base:"OU",letters:/[\u0222]/g},{base:"P",letters:/[\u0050\u24C5\uFF30\u1E54\u1E56\u01A4\u2C63\uA750\uA752\uA754]/g},{base:"Q",letters:/[\u0051\u24C6\uFF31\uA756\uA758\u024A]/g},{base:"R",letters:/[\u0052\u24C7\uFF32\u0154\u1E58\u0158\u0210\u0212\u1E5A\u1E5C\u0156\u1E5E\u024C\u2C64\uA75A\uA7A6\uA782]/g},{base:"S",letters:/[\u0053\u24C8\uFF33\u1E9E\u015A\u1E64\u015C\u1E60\u0160\u1E66\u1E62\u1E68\u0218\u015E\u2C7E\uA7A8\uA784]/g},{base:"T",letters:/[\u0054\u24C9\uFF34\u1E6A\u0164\u1E6C\u021A\u0162\u1E70\u1E6E\u0166\u01AC\u01AE\u023E\uA786]/g},{base:"TZ",letters:/[\uA728]/g},{base:"U",letters:/[\u0055\u24CA\uFF35\u00D9\u00DA\u00DB\u0168\u1E78\u016A\u1E7A\u016C\u00DC\u01DB\u01D7\u01D5\u01D9\u1EE6\u016E\u0170\u01D3\u0214\u0216\u01AF\u1EEA\u1EE8\u1EEE\u1EEC\u1EF0\u1EE4\u1E72\u0172\u1E76\u1E74\u0244]/g},{base:"V",letters:/[\u0056\u24CB\uFF36\u1E7C\u1E7E\u01B2\uA75E\u0245]/g},{base:"VY",letters:/[\uA760]/g},{base:"W",letters:/[\u0057\u24CC\uFF37\u1E80\u1E82\u0174\u1E86\u1E84\u1E88\u2C72]/g},{base:"X",letters:/[\u0058\u24CD\uFF38\u1E8A\u1E8C]/g},{base:"Y",letters:/[\u0059\u24CE\uFF39\u1EF2\u00DD\u0176\u1EF8\u0232\u1E8E\u0178\u1EF6\u1EF4\u01B3\u024E\u1EFE]/g},{base:"Z",letters:/[\u005A\u24CF\uFF3A\u0179\u1E90\u017B\u017D\u1E92\u1E94\u01B5\u0224\u2C7F\u2C6B\uA762]/g},{base:"a",letters:/[\u0061\u24D0\uFF41\u1E9A\u00E0\u00E1\u00E2\u1EA7\u1EA5\u1EAB\u1EA9\u00E3\u0101\u0103\u1EB1\u1EAF\u1EB5\u1EB3\u0227\u01E1\u00E4\u01DF\u1EA3\u00E5\u01FB\u01CE\u0201\u0203\u1EA1\u1EAD\u1EB7\u1E01\u0105\u2C65\u0250]/g},{base:"aa",letters:/[\uA733]/g},{base:"ae",letters:/[\u00E6\u01FD\u01E3]/g},{base:"ao",letters:/[\uA735]/g},{base:"au",letters:/[\uA737]/g},{base:"av",letters:/[\uA739\uA73B]/g},{base:"ay",letters:/[\uA73D]/g},{base:"b",letters:/[\u0062\u24D1\uFF42\u1E03\u1E05\u1E07\u0180\u0183\u0253]/g},{base:"c",letters:/[\u0063\u24D2\uFF43\u0107\u0109\u010B\u010D\u00E7\u1E09\u0188\u023C\uA73F\u2184]/g},{base:"d",letters:/[\u0064\u24D3\uFF44\u1E0B\u010F\u1E0D\u1E11\u1E13\u1E0F\u0111\u018C\u0256\u0257\uA77A]/g},{base:"dz",letters:/[\u01F3\u01C6]/g},{base:"e",letters:/[\u0065\u24D4\uFF45\u00E8\u00E9\u00EA\u1EC1\u1EBF\u1EC5\u1EC3\u1EBD\u0113\u1E15\u1E17\u0115\u0117\u00EB\u1EBB\u011B\u0205\u0207\u1EB9\u1EC7\u0229\u1E1D\u0119\u1E19\u1E1B\u0247\u025B\u01DD]/g},{base:"f",letters:/[\u0066\u24D5\uFF46\u1E1F\u0192\uA77C]/g},{base:"g",letters:/[\u0067\u24D6\uFF47\u01F5\u011D\u1E21\u011F\u0121\u01E7\u0123\u01E5\u0260\uA7A1\u1D79\uA77F]/g},{base:"h",letters:/[\u0068\u24D7\uFF48\u0125\u1E23\u1E27\u021F\u1E25\u1E29\u1E2B\u1E96\u0127\u2C68\u2C76\u0265]/g},{base:"hv",letters:/[\u0195]/g},{base:"i",letters:/[\u0069\u24D8\uFF49\u00EC\u00ED\u00EE\u0129\u012B\u012D\u00EF\u1E2F\u1EC9\u01D0\u0209\u020B\u1ECB\u012F\u1E2D\u0268\u0131]/g},{base:"j",letters:/[\u006A\u24D9\uFF4A\u0135\u01F0\u0249]/g},{base:"k",letters:/[\u006B\u24DA\uFF4B\u1E31\u01E9\u1E33\u0137\u1E35\u0199\u2C6A\uA741\uA743\uA745\uA7A3]/g},{base:"l",letters:/[\u006C\u24DB\uFF4C\u0140\u013A\u013E\u1E37\u1E39\u013C\u1E3D\u1E3B\u017F\u0142\u019A\u026B\u2C61\uA749\uA781\uA747]/g},{base:"lj",letters:/[\u01C9]/g},{base:"m",letters:/[\u006D\u24DC\uFF4D\u1E3F\u1E41\u1E43\u0271\u026F]/g},{base:"n",letters:/[\u006E\u24DD\uFF4E\u01F9\u0144\u00F1\u1E45\u0148\u1E47\u0146\u1E4B\u1E49\u019E\u0272\u0149\uA791\uA7A5]/g},{base:"nj",letters:/[\u01CC]/g},{base:"o",letters:/[\u006F\u24DE\uFF4F\u00F2\u00F3\u00F4\u1ED3\u1ED1\u1ED7\u1ED5\u00F5\u1E4D\u022D\u1E4F\u014D\u1E51\u1E53\u014F\u022F\u0231\u00F6\u022B\u1ECF\u0151\u01D2\u020D\u020F\u01A1\u1EDD\u1EDB\u1EE1\u1EDF\u1EE3\u1ECD\u1ED9\u01EB\u01ED\u00F8\u01FF\u0254\uA74B\uA74D\u0275]/g},{base:"oi",letters:/[\u01A3]/g},{base:"ou",letters:/[\u0223]/g},{base:"oo",letters:/[\uA74F]/g},{base:"p",letters:/[\u0070\u24DF\uFF50\u1E55\u1E57\u01A5\u1D7D\uA751\uA753\uA755]/g},{base:"q",letters:/[\u0071\u24E0\uFF51\u024B\uA757\uA759]/g},{base:"r",letters:/[\u0072\u24E1\uFF52\u0155\u1E59\u0159\u0211\u0213\u1E5B\u1E5D\u0157\u1E5F\u024D\u027D\uA75B\uA7A7\uA783]/g},{base:"s",letters:/[\u0073\u24E2\uFF53\u00DF\u015B\u1E65\u015D\u1E61\u0161\u1E67\u1E63\u1E69\u0219\u015F\u023F\uA7A9\uA785\u1E9B]/g},{base:"t",letters:/[\u0074\u24E3\uFF54\u1E6B\u1E97\u0165\u1E6D\u021B\u0163\u1E71\u1E6F\u0167\u01AD\u0288\u2C66\uA787]/g},{base:"tz",letters:/[\uA729]/g},{base:"u",letters:/[\u0075\u24E4\uFF55\u00F9\u00FA\u00FB\u0169\u1E79\u016B\u1E7B\u016D\u00FC\u01DC\u01D8\u01D6\u01DA\u1EE7\u016F\u0171\u01D4\u0215\u0217\u01B0\u1EEB\u1EE9\u1EEF\u1EED\u1EF1\u1EE5\u1E73\u0173\u1E77\u1E75\u0289]/g},{base:"v",letters:/[\u0076\u24E5\uFF56\u1E7D\u1E7F\u028B\uA75F\u028C]/g},{base:"vy",letters:/[\uA761]/g},{base:"w",letters:/[\u0077\u24E6\uFF57\u1E81\u1E83\u0175\u1E87\u1E85\u1E98\u1E89\u2C73]/g},{base:"x",letters:/[\u0078\u24E7\uFF58\u1E8B\u1E8D]/g},{base:"y",letters:/[\u0079\u24E8\uFF59\u1EF3\u00FD\u0177\u1EF9\u0233\u1E8F\u00FF\u1EF7\u1E99\u1EF5\u01B4\u024F\u1EFF]/g},{base:"z",letters:/[\u007A\u24E9\uFF5A\u017A\u1E91\u017C\u017E\u1E93\u1E95\u01B6\u0225\u0240\u2C6C\uA763]/g}];return t.reduce(function(e,t){var l=t.letters,n=t.base;return e.replace(l,n)},e)},Jl=function(){function e(n,s){l(this,e),this.$el=n,this.options=t.extend({},mt.DEFAULTS,s)}return s(e,[{key:"init",value:function(){this.initLocale(),this.initContainer(),this.initData(),this.initDrop()}},{key:"initLocale",value:function(){if(this.options.locale){var e=t.fn.multipleSelect.locales,l=this.options.locale.split(/-|_/);l[0]=l[0].toLowerCase(),l[1]&&(l[1]=l[1].toUpperCase()),e[this.options.locale]?t.extend(this.options,e[this.options.locale]):e[l.join("-")]?t.extend(this.options,e[l.join("-")]):e[l[0]]&&t.extend(this.options,e[l[0]])}}},{key:"initContainer",value:function(){var l=this,n=this.$el[0],e=n.getAttribute("name")||this.options.name||"";this.$el=this.$el.hide(),this.$label=this.$el.closest("label"),!this.$label.length&&this.$el.attr("id")&&(this.$label=t("label[for=\"".concat(this.$el.attr("id"),"\"]"))),this.$parent=t(Bl(P(),"s","s")(n.getAttribute("class")||"",Bl(w(),"s")(n.getAttribute("title")))),this.options.placeholder=this.options.placeholder||n.getAttribute("placeholder")||"",this.$choice=t(Bl(T(),"s")(this.options.placeholder)),this.$drop=t(Bl(L(),"s")(this.options.position)),this.options.dropWidth&&this.$drop.css("width",this.options.dropWidth),this.$el.after(this.$parent),this.$parent.append(this.$choice),this.$parent.append(this.$drop),n.disabled&&this.$choice.addClass("disabled"),this.$parent.css("width",this.options.width||this.$el.css("width")||this.$el.outerWidth()+20),this.selectAllName="data-name=\"selectAll".concat(e,"\""),this.selectGroupName="data-name=\"selectGroup".concat(e,"\""),this.selectItemName="data-name=\"selectItem".concat(e,"\""),this.options.keepOpen||t(document).click(function(s){t(s.target)[0]===l.$choice[0]||t(s.target).parents(".ms-choice")[0]===l.$choice[0]||(t(s.target)[0]===l.$drop[0]||t(s.target).parents(".ms-drop")[0]!==l.$drop[0]&&s.target!==n)&&l.options.isOpen&&l.close()}),this.options.onAfterCreate()}},{key:"initData",value:function(){var e=this,l=[];return this.options.data?(this.options.data.forEach(function(e,t){"optgroup"===e.type&&(e.group=e.group||"group_".concat(t),e.children.forEach(function(t){t.group=t.group||e.group}))}),void(this.data=this.options.data)):void(t.each(this.$el.children(),function(t,n){var s=e.initRow(t,n);s&&l.push(e.initRow(t,n))}),this.options.data=l,this.data=l)}},{key:"initRow",value:function(e,l,n,s){var o=this,i={},a=t(l);return a.is("option")?(i.type="option",i.group=n,i.text=this.options.textTemplate(a),i.value=l.value,i.selected=l.selected,i.disabled=s||l.disabled,i.classes=l.getAttribute("class")||"",i.title=l.getAttribute("title"),i):a.is("optgroup")?(i.type="optgroup",i.group="group_".concat(e),i.label=this.options.labelTemplate(a),i.disabled=l.disabled,i.children=[],t.each(a.children(),function(e,t){i.children.push(o.initRow(e,t,i.group,i.disabled))}),i):null}},{key:"initDrop",value:function(){var e=this;this.initList(),this.events(),this.updateSelectAll(),this.update(!0),this.updateOptGroupSelect(!0),this.options.isOpen&&this.open(),this.options.openOnHover&&this.$parent.hover(function(){e.open()},function(){e.close()})}},{key:"initList",value:function(){var e=this,t=[];this.options.filter&&t.push("\n <div class=\"ms-search\">\n <input type=\"text\" autocomplete=\"off\" autocorrect=\"off\"\n autocapitalize=\"off\" spellcheck=\"false\"\n ".concat(Bl(C(),"s")(this.options.filterPlaceholder),">\n </div>\n ")),t.push("<ul>"),this.options.selectAll&&!this.options.single&&t.push(["<li class=\"ms-select-all\">","<label>",Bl(E(),"s")(this.selectAllName),"<span>".concat(this.options.formatSelectAll(),"</span>"),"</label>","</li>"].join("")),t.push(this.data.map(function(t){return e.initListItem(t)}).join("")),t.push(Bl(I(),"s")(this.options.formatNoMatchesFound())),t.push("</ul>"),this.$drop.html(t.join("")),this.$drop.find("ul").css("max-height","".concat(this.options.maxHeight,"px")),this.$drop.find(".multiple").css("width","".concat(this.options.multipleWidth,"px")),this.$searchInput=this.$drop.find(".ms-search input"),this.$selectAll=this.$drop.find("input[".concat(this.selectAllName,"]")),this.$selectGroups=this.$drop.find("input[".concat(this.selectGroupName,"]")),this.$selectItems=this.$drop.find("input[".concat(this.selectItemName,"]:enabled")),this.$disableItems=this.$drop.find("input[".concat(this.selectItemName,"]:disabled")),this.$noResults=this.$drop.find(".ms-no-results")}},{key:"initListItem",value:function(e){var t=this,l=Bl(x(),"s")(e.title),n=this.options.multiple?"multiple":"",s=this.options.single?"radio":"checkbox";if("optgroup"===e.type){var o=[["<li class=\"group\">",Bl(v(),"s","s")(e.disabled?"disabled":"",e.group),this.options.hideOptgroupCheckboxes||this.options.single?"":Bl(S(),"s","s")(this.selectGroupName,e.disabled?"disabled=\"disabled\"":""),e.label,"</label>","</li>"].join(""),e.children.map(function(e){return t.initListItem(e)}).join("")];return o.join("")}var i=this.options.styler(e.value),a=i?Bl(A(),"s")(i):"",c=e.classes;return this.options.single&&!this.options.singleRadio&&(c+=" hide-radio"),[Bl(k(),"s","s","s","s")(n,c||"",l,a),Bl(y(),"s")(e.disabled?"disabled":""),Bl(b(),"s","s","s","s","s","s")(s,e.value,this.selectItemName,e.selected?" checked=\"checked\"":"",e.disabled?" disabled=\"disabled\"":"",Bl(m(),"s")(e.group)),Bl(g(),"s")(e.text),"</label>","</li>"].join("")}},{key:"events",value:function(){var l=this,n=function(t){t.preventDefault(),l[l.options.isOpen?"close":"open"]()};this.$label.length&&this.$label.off("click").on("click",function(t){"label"!==t.target.nodeName.toLowerCase()||(n(t),(!l.options.filter||!l.options.isOpen)&&l.focus(),t.stopPropagation())}),this.$choice.off("click").on("click",n).off("focus").on("focus",this.options.onFocus).off("blur").on("blur",this.options.onBlur),this.$parent.off("keydown").on("keydown",function(t){27===t.which&&(l.close(),l.$choice.focus())}),this.$searchInput.off("keydown").on("keydown",function(t){9===t.keyCode&&t.shiftKey&&l.close()}).off("keyup").on("keyup",function(t){return l.options.filterAcceptOnEnter&&[13,32].includes(t.which)&&l.$searchInput.val()?(l.$selectAll.click(),l.close(),void l.focus()):void l.filter()}),this.$selectAll.off("click").on("click",function(n){var e=t(n.currentTarget).prop("checked"),s=l.$selectItems.filter(":visible");s.length===l.$selectItems.length?l[e?"checkAll":"uncheckAll"]():(l.$selectGroups.prop("checked",e),s.prop("checked",e),l.options[e?"onCheckAll":"onUncheckAll"](),l.update())}),this.$selectGroups.off("click").on("click",function(n){var e=t(n.currentTarget),s=e.parent()[0].getAttribute("data-group"),o=l.$selectItems.filter(":visible"),i=o.filter(Bl(h(),"s")(s)),a=i.length!==i.filter(":checked").length;i.prop("checked",a),l.updateSelectAll(!0),l.update(),l.options.onOptgroupClick({label:e.parent().text(),checked:a,children:i.get().map(function(e){return{label:t(e).parent().text(),value:t(e).val(),check:t(e).prop("checked")}})})}),this.$selectItems.off("click").on("click",function(n){var e=t(n.currentTarget);if(l.options.single){var s=e.val();l.$selectItems.filter(function(e,l){return t(l).val()!==s}).each(function(e,l){t(l).prop("checked",!1)})}l.updateSelectAll(!0),l.update(),l.updateOptGroupSelect(),l.options.onClick({label:e.parent().text(),value:e.val(),checked:e.prop("checked")}),l.options.single&&l.options.isOpen&&!l.options.keepOpen&&l.close()})}},{key:"open",value:function(){if(!this.$choice.hasClass("disabled")){if(this.options.isOpen=!0,this.$choice.find(">div").addClass("open"),this.$drop[this.animateMethod("show")](),this.$selectAll.parent().show(),this.$noResults.hide(),this.data.length||(this.$selectAll.parent().hide(),this.$noResults.show()),this.options.container){var e=this.$drop.offset();this.$drop.appendTo(t(this.options.container)),this.$drop.offset({top:e.top,left:e.left}),this.$drop.outerWidth(this.$parent.outerWidth())}this.data.length&&this.options.filter&&(this.$searchInput.val(""),this.$searchInput.focus(),this.filter()),this.options.onOpen()}}},{key:"close",value:function(){this.options.isOpen=!1,this.$choice.find(">div").removeClass("open"),this.$drop[this.animateMethod("hide")](),this.options.container&&(this.$parent.append(this.$drop),this.$drop.css({top:"auto",left:"auto"})),this.options.onClose()}},{key:"animateMethod",value:function(e){return{show:{fade:"fadeIn",slide:"slideDown"},hide:{fade:"fadeOut",slide:"slideUp"}}[e][this.options.animate]||e}},{key:"update",value:function(e){var l=this.getSelects(),n=this.options.displayValues?l:this.getSelects("text"),s=this.$choice.find(">span"),o=l.length,i="";0===o?s.addClass("placeholder").html(this.options.placeholder):o<this.options.minimumCountSelected?i=n.join(this.options.displayDelimiter):this.options.formatAllSelected()&&o===this.$selectItems.length+this.$disableItems.length?i=this.options.formatAllSelected():this.options.ellipsis&&o>this.options.minimumCountSelected?i="".concat(n.slice(0,this.options.minimumCountSelected).join(this.options.displayDelimiter),"..."):this.options.formatCountSelected()&&o>this.options.minimumCountSelected?i=this.options.formatCountSelected(o,this.$selectItems.length+this.$disableItems.length):i=n.join(this.options.displayDelimiter),i&&s.removeClass("placeholder").html(i),this.options.displayTitle&&s.prop("title",this.getSelects("text")),this.$el.val(this.getSelects()),this.$drop.find("li").removeClass("selected"),this.$drop.find("input:checked").each(function(e,l){t(l).parents("li").first().addClass("selected")}),e||this.$el.trigger("change")}},{key:"updateSelectAll",value:function(e){var t=this.$selectItems.filter(":visible");if(t.length){var l=t.filter(":checked").length;this.$selectAll.prop("checked",l===t.length),e&&(l===t.length?this.options.onCheckAll():0===l&&this.options.onUncheckAll())}}},{key:"updateOptGroupSelect",value:function(e){var l=this.$selectItems;e||(l=l.filter(":visible")),t.each(this.$selectGroups,function(e,n){var s=t(n).parent()[0].getAttribute("data-group"),o=l.filter(Bl(u(),"s")(s));t(n).prop("checked",o.length&&o.length===o.filter(":checked").length)})}},{key:"getOptions",value:function(){var e=t.extend({},this.options);return delete e.data,t.extend(!0,{},e)}},{key:"refreshOptions",value:function(e){ql(this.options,e,!0)||(this.options=t.extend(this.options,e),this.destroy(),this.init())}},{key:"getSelects",value:function(e){var l=this,n=[],s=[];return this.$drop.find(Bl(p(),"s")(this.selectItemName)).each(function(e,l){n.push(t(l).parents("li").first().text()),s.push(t(l).val())}),"text"===e&&this.$selectGroups.length&&(n=[],this.$selectGroups.each(function(e,s){var o=[],i=t.trim(t(s).parent().text()),a=t(s).parent().data("group"),c=l.$drop.find(Bl(d(),"s","s")(l.selectItemName,a)),r=c.filter(":checked");if(r.length){if(o.push("["),o.push(i),c.length>r.length){var p=[];r.each(function(e,l){p.push(t(l).parent().text())}),o.push(": ".concat(p.join(", ")))}o.push("]"),n.push(o.join(""))}})),"text"===e?n:s}},{key:"setSelects",value:function(e){var l=this;this.$selectItems.prop("checked",!1),this.$disableItems.prop("checked",!1),t.each(e,function(e,t){l.$selectItems.filter(Bl(r(),"s")(t)).prop("checked",!0),l.$disableItems.filter(Bl(c(),"s")(t)).prop("checked",!0)}),this.$selectAll.prop("checked",this.$selectItems.length===this.$selectItems.filter(":checked").length+this.$disableItems.filter(":checked").length),t.each(this.$selectGroups,function(e,n){var s=t(n).parent()[0].getAttribute("data-group"),o=l.$selectItems.filter("[data-group=\"".concat(s,"\"]"));t(n).prop("checked",o.length&&o.length===o.filter(":checked").length)}),this.update(!1)}},{key:"enable",value:function(){this.$choice.removeClass("disabled")}},{key:"disable",value:function(){this.$choice.addClass("disabled")}},{key:"checkAll",value:function(){this.$selectItems.prop("checked",!0),this.$selectGroups.prop("checked",!0),this.$selectAll.prop("checked",!0),this.update(),this.options.onCheckAll()}},{key:"uncheckAll",value:function(){this.$selectItems.prop("checked",!1),this.$selectGroups.prop("checked",!1),this.$selectAll.prop("checked",!1),this.update(),this.options.onUncheckAll()}},{key:"focus",value:function(){this.$choice.focus(),this.options.onFocus()}},{key:"blur",value:function(){this.$choice.blur(),this.options.onBlur()}},{key:"refresh",value:function(){this.init()}},{key:"filter",value:function(){var e=this,l=t.trim(this.$searchInput.val()).toLowerCase();0===l.length?(this.$selectAll.closest("li").show(),this.$selectItems.closest("li").show(),this.$disableItems.closest("li").show(),this.$selectGroups.closest("li").show(),this.$noResults.hide()):(!this.options.filterGroup&&this.$selectItems.each(function(e,n){var s=t(n).parent(),o=Kl(s.text().toLowerCase()).includes(Kl(l));s.closest("li")[o?"show":"hide"]()}),this.$disableItems.closest("li").hide(),this.$selectGroups.each(function(n,s){var o=t(s).parent(),i=o[0].getAttribute("data-group");if(e.options.filterGroup){var c=Kl(o.text().toLowerCase()).includes(Kl(l)),r=c?"show":"hide";o.closest("li")[r](),e.$selectItems.filter("[data-group=\"".concat(i,"\"]")).closest("li")[r]()}else{var d=e.$selectItems.filter(":visible"),p=d.filter(Bl(a(),"s")(i)).length;o.closest("li")[p?"show":"hide"]()}}),this.$selectItems.closest("li").filter(":visible").length?(this.$selectAll.closest("li").show(),this.$noResults.hide()):(this.$selectAll.closest("li").hide(),this.$noResults.show())),this.updateOptGroupSelect(),this.updateSelectAll(),this.options.onFilter(l)}},{key:"destroy",value:function(){this.$parent&&(this.$el.before(this.$parent).show(),this.$parent.remove())}}]),e}();t.fn.multipleSelect=function(l){for(var n=arguments.length,s=Array(1<n?n-1:0),o=1;o<n;o++)s[o-1]=arguments[o];var i;return this.each(function(n,o){var a=t(o),c=a.data("multipleSelect"),r=t.extend({},a.data(),"object"===e(l)&&l);if(c||(c=new Jl(a,r),a.data("multipleSelect",c)),"string"==typeof l){var d;if(0>t.inArray(l,mt.METHODS))throw new Error("Unknown method: ".concat(l));i=(d=c)[l].apply(d,s),"destroy"==l&&a.removeData("multipleSelect")}else c.init()}),"undefined"==typeof i?this:i},t.fn.multipleSelect.defaults=mt.DEFAULTS,t.fn.multipleSelect.locales=mt.LOCALES,t.fn.multipleSelect.methods=mt.METHODS});