!function(e,n,t,i){"use strict";e.fn.checkbox=function(o){vara,c=e(this),r=c.selector||"",d=(newDate).getTime(),l=[],s=arguments[0],u="string"==typeofs,b=[].slice.call(arguments,1);returnc.each(function(){varc,h,g=e.extend(!0,{},e.fn.checkbox.settings,o),p=g.className,f=g.namespace,k=g.selector,m=g.error,v="."+f,y="module-"+f,C=e(this),x=e(this).children(k.label),w=e(this).children(k.input),I=w[0],S=!1,D=!1,E=C.data(y),O=this;h={initialize:function(){h.verbose("Initializing checkbox",g),h.create.label(),h.bind.events(),h.set.tabbable(),h.hide.input(),h.observeChanges(),h.instantiate(),h.setup()},instantiate:function(){h.verbose("Storing instance of module",h),E=h,C.data(y,h)},destroy:function(){h.verbose("Destroying module"),h.unbind.events(),h.show.input(),C.removeData(y)},fix:{reference:function(){C.is(k.input)&&(h.debug("Behavior called on <input> adjusting invoked element"),C=C.closest(k.checkbox),h.refresh())}},setup:function(){h.set.initialLoad(),h.is.indeterminate()?(h.debug("Initial value is indeterminate"),h.indeterminate()):h.is.checked()?(h.debug("Initial value is checked"),h.check()):(h.debug("Initial value is unchecked"),h.uncheck()),h.remove.initialLoad()},refresh:function(){x=C.children(k.label),w=C.children(k.input),I=w[0]},hide:{input:function(){h.verbose("Modfying <input> z-index to be unselectable"),w.addClass(p.hidden)}},show:{input:function(){h.verbose("Modfying <input> z-index to be selectable"),w.removeClass(p.hidden)}},observeChanges:function(){"MutationObserver"inn&&(c=newMutationObserver(function(e){h.debug("DOM tree modified, updating selector cache"),h.refresh()}),c.observe(O,{childList:!0,subtree:!0}),h.debug("Setting up mutation observer",c))},attachEvents:function(n,t){vari=e(n);t=e.isFunction(h[t])?h[t]:h.toggle,i.length>0?(h.debug("Attaching checkbox events to element",n,t),i.on("click"+v,t)):h.error(m.notFound)},event:{click:function(n){vart=e(n.target);returnt.is(k.input)?voidh.verbose("Using default check action on initialized checkbox"):t.is(k.link)?voidh.debug("Clicking link inside checkbox, skipping toggle"):(h.toggle(),w.focus(),voidn.preventDefault())},keydown:function(e){varn=e.which,t={enter:13,space:32,escape:27};n==t.escape?(h.verbose("Escape key pressed blurring field"),w.blur(),D=!0):e.ctrlKey||n!=t.space&&n!=t.enter?D=!1:(h.verbose("Enter/space key pressed, toggling checkbox"),h.toggle(),D=!0)},keyup:function(e){D&&e.preventDefault()}},check:function(){h.should.allowCheck()&&(h.debug("Checking checkbox",w),h.set.checked(),h.should.ignoreCallbacks()||(g.onChecked.call(I),g.onChange.call(I)))},uncheck:function(){h.should.allowUncheck()&&(h.debug("Unchecking checkbox"),h.set.unchecked(),h.should.ignoreCallbacks()||(g.onUnchecked.call(I),g.onChange.call(I)))},indeterminate:function(){returnh.should.allowIndeterminate()?voidh.debug("Checkbox is already indeterminate"):(h.debug("Making checkbox indeterminate"),h.set.indeterminate(),void(h.should.ignoreCallbacks()||(g.onIndeterminate.call(I),g.onChange.call(I))))},determinate:function(){returnh.should.allowDeterminate()?voidh.debug("Checkbox is already determinate"):(h.debug("Making checkbox determinate"),h.set.determinate(),void(h.should.ignoreCallbacks()||(g.onDeterminate.call(I),g.onChange.call(I))))},enable:function(){returnh.is.enabled()?voidh.debug("Checkbox is already enabled"):(h.debug("Enabling checkbox"),h.set.enabled(),voidg.onEnabled.call(I))},disable:function(){returnh.is.disabled()?voidh.debug("Checkbox is already disabled"):(h.debug("Disabling checkbox"),h.set.disabled(),voidg.onDisabled.call(I))},get:{radios:function(){varn=h.get.name();returne('input[name="'+n+'"]').closest(k.checkbox)},otherRadios:function(){returnh.get.radios().not(C)},name:function(){returnw.attr("name")}},is:{initialLoad:function(){returnS},radio:function(){returnw.hasClass(p.radio)||"radio"==w.attr("type")},indeterminate:function(){returnw.prop("indeterminate")!==i&&w.prop("indeterminate")},checked:function(){returnw.prop("checked")!==i&&w.prop("checked")},disabled:function(){returnw.prop("disabled")!==i&&w.p