fenix-ui-filter
Version:
2 lines • 195 kB
JavaScript
define(["loglevel","underscore","jquery","fenix-ui-bridge","q","validate.js","fenix-ui-converter","bootstrap","selectize","moment","ion-rangeslider","sortablejs","eonasdan-bootstrap-datetimepicker","jstree"],function(t,e,n,i,s,r,a,o,l,c,u,h,p,d){return function(t){function e(i){if(n[i])return n[i].exports;var s=n[i]={exports:{},id:i,loaded:!1};return t[i].call(s.exports,s,s.exports,e),s.loaded=!0,s.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){t.exports=n(1)},function(t,e,n){var i,s;i=[n(8),n(5),n(4),n(6),n(7),n(3),n(44),n(38),n(2),n(30),n(45),n(46),n(47)],s=function(t,e,i,s,r,a,o,l,c,u,h,p){"use strict";function d(e){i.info("FENIX filter"),i.info(e),n(48),t.extend(!0,this,a,{initial:e},m),this._parseInput(e);var s=this._validateInput();return s===!0?(this._attach(),this._initVariables(),this._renderFilter(),this):(i.error("Impossible to create Filter!"),void i.error(s))}var f="./selectors/",m={summaryRender:function(t){return this._summaryRender(t)}},v={SUMMARY_SELECTOR:"[data-code]",REMOVE_BTN:"[data-role='remove']"};return d.prototype.validate=function(){var t=this.getValues(),e={valid:t.valid};return t.errors&&(e.errors=t.errors),e},d.prototype.getValues=function(e,n){var s=e||this.outputFormat,r=this["_format_"+s];return t.isFunction(r)?r.call(this,this._getValues(n)):void i.error("Impossible to find the output format: "+s)},d.prototype.setValues=function(t,e){return i.info("Set filter values. Silent? "+!!e),i.info(t),this._setValues(t,!!e)},d.prototype.setSources=function(t){return i.info("Set selectors sources"),this._setSources(t)},d.prototype.deselectAll=function(t){return i.info("Deselect all the selection"),this._deselectAll(t)},d.prototype.unsetValues=function(t){return i.info("Unset selectors sources"),this._unsetValues(t)},d.prototype.reset=function(){this._destroyDependencies(),e.each(this.selectors,e.bind(function(t,e){this._callSelectorInstanceMethod(e,"reset")},this)),this._initDependencies(),this._updateSummary(),i.info("Filter reset")},d.prototype.printDefaultSelection=function(){e.each(this.selectors,e.bind(function(t,e){this._callSelectorInstanceMethod(e,"printDefaultSelection")},this)),i.info("Printed default selection")},d.prototype.add=function(t){e.each(t,e.bind(function(t,e){this._addSelector(e,t)},this))},d.prototype.remove=function(t){var n;n=Array.isArray(t)?t:[t],e.each(n,e.bind(function(t){this._removeSelector(t)},this)),this._updateSummary(),this._trigger("remove",{id:n[0]})},d.prototype.clear=function(){return e.each(this.selectors,e.bind(function(t,e){this.remove(e)},this)),i.info("Filter "+this.id+" cleared successfully"),this},d.prototype.on=function(t,e,n){var i=n||this;return this.channels[t]||(this.channels[t]=[]),this.channels[t].push({context:i,callback:e}),this},d.prototype._parseInput=function(){this._selectors=this.initial.selectors||{},this.$el=t(this.initial.el),this.template=this.initial.template,this.summary$el=this.initial.summaryEl,this.values=this.initial.values,this.cache="boolean"==typeof this.initial.cache?this.initial.cache:a.cache,t.isFunction(this.initial.summaryRender)&&(this.summaryRender=this.initial.summaryRender),this.direction=this.initial.direction||a.direction,this.ensureAtLeast=parseInt(this.initial.ensureAtLeast||a.ensureAtLeast,10),this.common=this.initial.common||a.common,this.languages=this.initial.languages||a.languages,this.environment=this.initial.environment,this.lang=this.initial.lang||a.lang,this.lang=this.lang.toLowerCase(),this.dependencies=this.initial.dependencies||{},this.serviceProvider=this.initial.serviceProvider||void 0},d.prototype._validateInput=function(){var e=!0,n=[];return this.id||(window.fx_filter_id>=0?window.fx_filter_id++:window.fx_filter_id=0,this.id=String(window.fx_filter_id),i.info("Set filter id: "+this.id)),0===this.$el.length&&(n.push({code:s.MISSING_CONTAINER}),i.warn("Impossible to find filter container")),this._selectors||(i.warn("Imposerrors.length sible to find 'selectors' for filter: "+this.id),i.warn("Filer will wait for selectors dynamically")),this.summary$el&&(this.summary$el=t(this.summary$el),0===this.summary$el.length&&(n.push({code:s.MISSING_SUMMARY_CONTAINER}),i.warn("Impossible to find summary container"))),n.length>0?n:e},d.prototype._attach=function(){this.$el.append(this.template)},d.prototype._initVariables=function(){return this.selectors={},this.selectorsId=[],this.selectorTypes=[],this.dependeciesToDestory=[],this.constraints={},this.hasSummary=(this.summary$el&&this.summary$el.length)>0,this.channels={},e.each(this._selectors,e.bind(function(t,e){this._evaluateSelectorConfiguration(t,e)},this)),n(54)(f+this.corePlugins[0]+".js")},d.prototype._evaluateSelectorConfiguration=function(t,e){return this.selectors.hasOwnProperty(e)?void i.error("Duplication of selector id not allowed: "+e):(t.id=e,t.mode="object"==typeof t.selectors?"group":"selector",this.selectors[e]=t,"selector"===t.mode&&this._evaluateModeSelector(t),"group"===t.mode&&this._evaluateModeGroup(t),void(this.selectorsId=Object.keys(this.selectors)))},d.prototype._evaluateModeSelector=function(t){"selector"!==t.mode||t.hasOwnProperty("selector")||alert(t.id+": does not have a valid configuration. Missing 'selector'configuration "),t.selector&&!t.selector.hasOwnProperty("id")&&alert(t.id+": does not have a valid configuration. Missing 'selector.id' configuration.");var n=t.selector.id.toLowerCase();if(e.contains(this.selectorTypes,n)||this.selectorTypes.push(n),t.hasOwnProperty("constraints")){var i=t.parent?t.parent+"."+t.id:t.id;this.constraints[i]=t.constraints}},d.prototype._evaluateModeGroup=function(t){"group"===t.mode&&0===Object.keys(t.selectors).length&&alert(t.id+": is configured to be a group but not selectors are provided. Check the 'selectors' parameter"),e.each(t.selectors,e.bind(function(e,n){return"object"!=typeof e?void alert("Invalid selector configuration for: ["+n+"] of selector ["+t.id+"]"):(e.mode="selector",e.id=n,e.parent=t.id,void this._evaluateModeSelector(e))},this))},d.prototype._renderFilter=function(){this._renderSelectors()},d.prototype._renderSelectors=function(){i.info("Render selectors"),this.ready=!1,this.selectorsReady=0,this.selectorsId.length>0?this.validTimeout=window.setTimeout(function(){i.error(s.READY_TIMEOUT)},a.validityTimeout):(i.warn("No selectors found for filter: "+this.id),window.setTimeout(e.bind(function(){this._onReady()},this),100)),e.each(this.selectors,e.bind(function(t,e){this._renderSelector(t,e)},this))},d.prototype._renderSelector=function(n,s){if(i.info("Render selector: "+s),n.initialized){i.info(s+" selector is already initialized.");var a=this._callSelectorInstanceMethod(s,"getStatus");a.ready===!0?this._onSelectorReady():i.warn(s+" selector was previously initialized but its inner status was not set to ready.")}else n.initialized=!0,this._getSelectorRenders(n,e.bind(function(i){var a=this._getMode(n),o=t.extend(!0,{},this.common,n,{id:s,controller:this,lang:this.lang,languages:this.languages,plugins:i,el:this.$el,cache:this.cache,environment:this.environment,serviceProvider:this.serviceProvider}),l=new a(o);l.on(r.SELECTOR_READY,e.bind(this._onSelectorReady,this)),l.on(r.SELECTOR_REMOVED,e.bind(this._onSelectorRemoved,this)),l.on(r.SELECTOR_DISABLED,e.bind(this._onSelectorChange,this)),l.on(r.SELECTOR_ENABLED,e.bind(this._onSelectorChange,this)),l.on(r.SELECTOR_SELECTED,e.bind(this._onSelectorSelected,this)),this.selectors[s].instance=l},this))},d.prototype._onSelectorReady=function(){this.selectorsReady++,i.info("Ready event listened from filter: "+this.id),this.selectorsReady===this.selectorsId.length&&this._onReady()},d.prototype._onReady=function(){this._initDependencies(),this._checkSelectorsAmount(),window.clearTimeout(this.validTimeout),t.isEmptyObject(this.values)||this.setValues(this.values,!0),this._disableDisabledSelectorsByDefault(),this.ready=!0,this._updateSummary(),this._configureSelectorAfterDependency(),i.info("~~~~ Filter ["+this.id+"] is ready"),this._trigger("ready")},d.prototype._configureSelectorAfterDependency=function(){var t=this,n=this.getValues();e.each(this.events2selectors,function(i,s){e.each(i,function(e){t._trigger("dep_"+s+"_"+e,{id:e,values:n.values[e],labels:n.labels[e]})})})},d.prototype._disableDisabledSelectorsByDefault=function(){e.each(this.selectors,e.bind(function(t,e){t.selector&&t.selector.disabled===!0&&this._callSelectorInstanceMethod(e,"disable")},this))},d.prototype._lockRemoveButtons=function(){this.$el.find(v.REMOVE_BTN).attr("disabled",!0)},d.prototype._unlockRemoveButtons=function(){this.$el.find(v.REMOVE_BTN).attr("disabled",!1)},d.prototype._checkSelectorsAmount=function(){this.ensureAtLeast<0||(Object.keys(this._selectors).length<=this.ensureAtLeast?this._lockRemoveButtons():this._unlockRemoveButtons())},d.prototype._summaryRender=function(t){return t.label+"<span class='code-brk'>["+t.code+"]</span>"},d.prototype._updateSummary=function(){function n(t){var n=t.values,a=t.labels,o=[];try{e.each(n,e.bind(function(t,n){if(Array.isArray(t)&&t.length>0){var i=this.selectors[n],s={label:i.template?i.template.title:"",id:n,values:[]};e.each(t,e.bind(function(t){var e="object"==typeof t?t.value:t,i={code:e,label:a[n][e],selector:n};i.value=r.summaryRender(i),s.values.push(i)},this)),o.push(s)}},r))}catch(t){i.error(s.SUMMARY_MODEL_CREATION),i.error(t)}return o}if(this.hasSummary){i.info("Update filter summary");var r=this,a={summary:n(this.getValues())};this.summary$el.find(v.SUMMARY_SELECTOR).each(function(){t(this).off()}),this.summary$el.html(o(a)),this.summary$el.find(v.SUMMARY_SELECTOR).each(function(){var e=t(this);e.on("click",function(){r._unsetSelectorValue({code:e.data("code"),selector:e.data("selector")})})})}},d.prototype._unsetSelectorValue=function(t){this._callSelectorInstanceMethod(t.selector,"unsetValue",t.code)},d.prototype._removeSelectorReferences=function(t){delete this.selectors[t],delete this._selectors[t],this.selectorsId=e.without(this.selectorsId,t)},d.prototype._getValues=function(n){var s={valid:!0,labels:{},values:{},errors:{}};return this.ready!==!0?(i.warn("Abort getValues() because filter is not ready"),s):(e.each(this.selectors,e.bind(function(r,a){if(!n||e.contains(n,a)){var o=this._callSelectorInstanceMethod(a,"getStatus");if(o.disabled)i.warn("Disabled selector not included in result: "+a);else{var l=this._callSelectorInstanceMethod(a,"getValues");s.values[a]=l.values,s.labels[a]=l.labels,s.valid=s.valid&&!!l.valid,t.extend(!0,s.errors,l.errors)}}},this)),0===Object.keys(s.errors).length&&delete s.errors,s)},d.prototype._setValues=function(t,n){var s=t.values||t;e.each(s,e.bind(function(t,e){this._getSelectorInstance(e)?this._callSelectorInstanceMethod(e,"setValue",t,n):i.info(e+" skipped")},this)),window.setTimeout(e.bind(function(){this._configureSelectorAfterDependency()},this),100),i.info("Filter values set")},d.prototype._setSources=function(t){e.each(t,e.bind(function(t,e){this._getSelectorInstance(e)?this._callSelectorInstanceMethod(e,"setSource",t):i.info(e+" skipped")},this)),i.info("Selectors sources set")},d.prototype._deselectAll=function(t){this._getSelectorInstance(t)?this._callSelectorInstanceMethod(t,"deselectAll",t):i.info(key+" skipped"),i.info("Selectors deselect all")},d.prototype._unsetValues=function(t,n){var s=t.values||t;e.each(s,e.bind(function(t,e){this._getSelectorInstance(e)?this._callSelectorInstanceMethod(e,"unsetValue",t,n):i.info(e+" skipped")},this)),i.info("Filter values unset")},d.prototype._getEnabledSelectors=function(){var t=[];return e.each(this.selectors,e.bind(function(e){var n=this._callSelectorInstanceMethod(e,"getStatus");!n.disabled==!0&&t.push(e)},this)),t},d.prototype._initDependencies=function(){this.events2selectors={},e.each(this.dependencies,e.bind(function(t,e){this["_dep_"+e]=t},this)),e.each(this.selectors,e.bind(function(t,e){t.hasOwnProperty("dependencies")&&this._processSelectDependencies(t.dependencies,e)},this))},d.prototype._resolveDependencySelectors=function(t){if(t.indexOf("@")<0)return[t];switch(t=t.substring(1),t.toLowerCase()){case"all":return this.selectorsId;default:return t.split(",")}},d.prototype._processSelectDependencies=function(n,s){var r=this;e.each(n,e.bind(function(n,a){Array.isArray(n)||(n=[n]);var o=this._resolveDependencySelectors(a);e.each(o,e.bind(function(a){e.each(n,e.bind(function(n){if("object"!=typeof n)return void i.warn(JSON.stringify(n)+" is not a valid dependency configuration");var o={event:"dep_"+n.event+"_"+a,callback:function(e){var o=r["_dep_"+n.id];if(n.args&&n.args.payloadIncludes){var l=r._getModelValues(n.args.payloadIncludes);e=r.getValues(null,l)}t.isFunction(o)?o.call(r,e,{src:a,target:s,args:n.args}):i.error("Impossible to find : _dep_"+n.id)}};this.events2selectors[n.event]||(this.events2selectors[n.event]=[]),this.events2selectors[n.event].push(a),this.events2selectors[n.event]=e.uniq(this.events2selectors[n.event]),this.dependeciesToDestory.push(o),this.on(o.event,o.callback,this)},this))},this))},this))},d.prototype._destroyDependencies=function(){e.each(this.dependeciesToDestory,e.bind(function(t){delete this.channels[t.event]},this))},d.prototype._dep_min=function(t,e){i.info("_dep_min invokation"),i.info(t),i.info(e),this._callSelectorInstanceMethod(e.target,"_dep_min",{data:t})},d.prototype._dep_parent=function(n,s){var r=s.args||{},a=r.body||{},o=r.exclude||[];if(this.selectors[s.target]){var l=this.selectors[s.target].cl;l&&(i.info("_dep_parent invokation"),i.info(s),delete l.level,t.extend(!0,l,a),l.codes=[],e.each(n.values,function(t){e.contains(o,t)||l.codes.push(t)}),this._callSelectorInstanceMethod(s.target,"_dep_parent",l))}},d.prototype._dep_process=function(n,s){function r(t){var e=t.map(function(t){return"object"==typeof t?t.value:t});return e=e.join('","')}if(this.selectors[s.target]){var a=t.extend(!0,{},s.args);if(a){if(i.info("_dep_process invokation"),i.info(n),i.info(s),!a.body)return void i.error("Impossible to find args.body for "+s.target+" `process` dependency configuration.");if(!a.uid)return void i.error("Impossible to find args.uid for "+s.target+" `process` dependency configuration.");var o,l=JSON.stringify(Array.isArray(a.body)?a.body:[a.body]),c={};if(o=p.compile(l),a.hasOwnProperty("payloadIncludes")){var u=e.without(this._getModelValues(a.payloadIncludes),s.target);i.info("Selectors included in process: "+JSON.stringify(u));var h=this.getValues(null,u)||{};c=h.values}else Array.isArray(n)||(n=[n]),c[s.src]=n;e.each(c,function(t,e){c[e]=r(t)}),i.info("Model for the process:"),i.info(c),a.body=JSON.parse(o(c)),a.params||(a.params={}),a.params.language=this.lang,this._callSelectorInstanceMethod(s.target,"_dep_process",a)}else i.warn("Impossible to find process.body configuration.")}else i.warn("Impossible to find _dep_process target selector: "+s.target)},d.prototype._dep_ensure_unset=function(t,e){i.info("_dep_ensure_unset invokation"),i.info(e),this.selectors[e.target]&&this._callSelectorInstanceMethod(e.target,"_dep_ensure_unset",{value:this.selector2group[e.src],enabled:this._getEnabledSelectors()})},d.prototype._dep_disable=function(t,e){i.info("_dep_disable invokation"),i.info(e),this.selectors[e.target]&&(t.value?this._callSelectorInstanceMethod(e.target,"enable"):this._callSelectorInstanceMethod(e.target,"disable"))},d.prototype._dep_disableIfValue=function(t,n){i.info("_dep_disableIfValue invokation"),i.info(n);var s=n.args.value,r=t.values||[];e.contains(r,s)?this._callSelectorInstanceMethod(n.target,"disable"):this._callSelectorInstanceMethod(n.target,"enable")},d.prototype._dep_enableIfValue=function(t,n){i.info("_dep_enableIfValue invokation"),i.info(n);var s=n.args.value,r=t.values||[];e.contains(r,s)?this._callSelectorInstanceMethod(n.target,"enable"):this._callSelectorInstanceMethod(n.target,"disable")},d.prototype._dep_readOnlyIfNotValue=function(t,n){i.info("_dep_readOnlyIfNotValue invokation"),i.info(n);var s=n.args.value,r=t.values||[],a=this.selectors[n.target]||{},o=a.instance;o&&(e.contains(r,s)?o.disableReadOnly():o.enableReadOnly())},d.prototype._dep_mandatoryIfOtherValue=function(t,n){i.info("_dep_mandatoryIfOtherValue invokation"),i.info(n);var s=n.args.value,r=t.values||[],a=this.selectors[n.target]||{},o=a.instance;o&&(e.contains(r,s)?(null!=o.constraints&&"undefined"!=typeof o.constraints?o.constraints.presence=!0:o.constraints={presence:!0},this.getValues()):(null!=o.constraints&&"undefined"!=typeof o.constraints&&delete o.constraints.presence,this.getValues()))},d.prototype._getModelValues=function(t){if(!Array.isArray(t))return i.error("`args.payloadIncludes` configuration has to be an array"),{};var n=[];return e.each(t,e.bind(function(t){n=n.concat(this._resolveDependencySelectors(t))},this)),n=e.uniq(n)},d.prototype._onSelectorChange=function(t){this.ready===!0&&(this._trigger("change",t),t&&this._trigger("dep_change_"+t.id,t),this._updateSummary())},d.prototype._onSelectorSelected=function(t){this.ready===!0&&(this._trigger("select",t),t&&this._trigger("dep_select_"+t.id,t),this._updateSummary())},d.prototype._addSelector=function(t,e){this._evaluateSelectorConfiguration(e,t),this._selectors[t]=e,this._destroyDependencies(),this._renderFilter(),this._checkSelectorsAmount()},d.prototype._onSelectorRemoved=function(t){t&&(this.remove(t.id),this._trigger("dep_change_"+t.id,t),this._checkSelectorsAmount())},d.prototype._removeSelector=function(t){delete this._selectors[t],this._removeSelectorReferences(t)},d.prototype._callSelectorInstanceMethod=function(e,n,s,r){var a=this._getSelectorInstance(e);return a?t.isFunction(a[n])?a[n](s,r):void i.error(e+" selector does not implement the mandatory "+n+"() fn"):void i.warn(e+" is not a current selector.")},d.prototype._getSelectorRenders=function(t,i){var s=0,r={},a=[];t.selector&&t.selector.id&&a.push(t.selector.id),t.selectors&&e.each(t.selectors,function(t){t.selector&&t.selector.id&&a.push(t.selector.id)}),a=e.unique(a),e.each(a,e.bind(function(t){var e=this._getSelectorScriptPath(t);!function(){var o=[n(54)(e+".js")];(function(e){s++,r[t]=e,s===a.length&&i(r)}).apply(null,o)}()},this))},d.prototype._getMode=function(t){var e;switch(t.mode.toLowerCase()){case"group":e=c;break;default:e=l}return i.info("Selector mode: "+t.mode),e},d.prototype._getSelectorInstance=function(t){var e=this.selectors[t];if(!e)return void i.warn("Impossible to find selector obj "+t);var n=e.instance;return n||i.warn("Impossible to find selector instance for "+t),n},d.prototype._getSelectorScriptPath=function(n){var s,r,a,o=this.corePlugins,l=t.extend(!0,{},this.pluginRegistry);return(a=e.contains(o,n))?f+n:(r=l[n],r||i.error('Registration not found for "'+n+' selector".'),r.path?s=r.path:i.error('Impossible to find path configuration for "'+n+' tab".'),s)},d.prototype._trigger=function(t){if(!this.channels[t])return!1;for(var e=Array.prototype.slice.call(arguments,1),n=0,i=this.channels[t].length;n<i;n++){var s=this.channels[t][n];s.callback.apply(s.context,e)}return this},d.prototype.dispose=function(){e.each(this.selectors,e.bind(function(t,e){this._callSelectorInstanceMethod(e,"dispose")},this)),this.$el.remove(),this.hasSummary&&this.summary$el.remove()},d.prototype._format_plain=function(t){return t},d.prototype._format_fenix=function(t){return!!t.valid==!1?t:h.toD3P(this._selectors,t)},d.prototype._format_catalog=function(t){return!!t.valid==!1?t:h.toFilter(this._selectors,t)},d}.apply(e,i),!(void 0!==s&&(t.exports=s))},function(t,e,n){var i,s;i=[n(4),n(8),n(5),n(6),n(7),n(3),n(9),n(29),n(30),n(38)],s=function(t,e,n,i,s,r,a,o,l,c){"use strict";function u(t){return e.extend(!0,this,r,{initial:t||{},$filterEl:e(t.el)}),this._initVariables(),this._attach(),this._render(),this}var h={SWITCH:"input[data-role='switch'][name='disable-selector']",REMOVE_BTN:"[data-role='remove']",ADD_BTN:"[data-role='add']",GROUPS_CONTAINER:'[data-role="groups"]'};return u.prototype.dispose=function(){this._unbindEventListeners(),n.each(this.groups,n.bind(function(t){n.each(t,function(t,e){t&&t.instance&&"function"==typeof t.instance.dispose&&t.instance.dispose()})},this)),this._destroyDependencies(),this.$el.remove()},u.prototype.printDefaultSelection=function(){n.each(this.groups,n.bind(function(t){n.each(t,function(t,e){t&&t.instance&&"function"==typeof t.instance.printDefaultSelection&&t.instance.printDefaultSelection()})},this))},u.prototype.reset=function(){n.each(this.groups,n.bind(function(t){n.each(t,function(t,e){t&&t.instance&&"function"==typeof t.instance.reset&&t.instance.reset()})},this))},u.prototype.getValues=function(i){var s,r,a={values:{},labels:{},errors:{},valid:!0},o={};if(this.incremental)r=[],n.each(this.groups,n.bind(function(t){var i={};n.each(t,n.bind(function(t){var n=t.instance;if(n){var s=n.getValues();i[t.id]=1===s.values.length?s.values[0]:s.values,o[t.id]=e.extend(!0,o[t.id],s.labels)}},this)),r.push(i)},this));else{r={};var l=Object.keys(this.groups)[0];n.each(this.groups[l],n.bind(function(n,l){var c=n.instance;c?(s=c.getValues(i),r[l]=s.values,o[l]=s.labels,a.valid=a.valid&&!!s.valid,e.extend(!0,a.errors,s.errors)):t.warn(l+" skip language")},this))}return a.values=r,a.labels=o,a},u.prototype.setSource=function(t){console.log("TODO setSource()")},u.prototype.setValue=function(e){this.incremental?Array.isArray(e)?n.each(e,n.bind(function(t,e){var i=this.groups["group_"+(e+1)];i?n.each(t,function(t,e){i[e]&&i[e].instance&&i[e].instance.setValue(t)}):this._addGroup(t)},this)):t.warn("Group is incremental and values should be an array of object"):n.each(this.groups,function(t){n.each(t,function(t){var n=t.id;e.hasOwnProperty(n)&&t.instance.setValue(e[n])})})},u.prototype.unsetValue=function(t){console.log("TODO unsetValue()")},u.prototype.enable=function(t){n.each(this.groups,n.bind(function(t){n.each(t,n.bind(function(t){var e=t.instance;e&&e.enable(!0)},this))},this)),this.status.disabled=!1,this.$el.find(h.SWITCH).prop("checked",!0),this.$el.find(h.ADD_BTN).prop("disabled",!1),t||this._trigger(s.SELECTOR_ENABLED)},u.prototype.disable=function(t){n.each(this.groups,n.bind(function(t){n.each(t,n.bind(function(t){var e=t.instance;e&&e.disable(!0)},this))},this)),this.status.disabled=!0,this.$el.find(h.SWITCH).prop("checked",!1),this.$el.find(h.ADD_BTN).prop("disabled",!0),t||this._trigger(s.SELECTOR_DISABLED)},u.prototype.tagAsInvalid=function(){this.$el.find(".form-group").addClass("has-error")},u.prototype.tagAsValid=function(){this.$el.find(".form-group").addClass("has-success")},u.prototype.untag=function(){this.$el.find(".form-group").removeClass("has-error"),this.$el.find(".form-group").removeClass("has-success")},u.prototype._initVariables=function(){this.channels={},this.id=this.initial.id,this.controller=this.initial.controller,this.template=this.initial.template,this.lang=this.initial.lang,this.environment=this.initial.environment,this.cache=this.initial.cache,this.plugins=this.initial.plugins,this.constraints=this.initial.constraints,this.groups={},this._selectors=this.initial.selectors,this.incremental=!!this.initial.incremental,this.classNames=this.initial.classNames,this.incremental?this.initialAmount=isNaN(this.initial.initialAmount)?0:this.initial.initialAmount:this.initialAmount=1,this.amount=0,this.status={disable:!1},this.dependeciesToDestory=[]},u.prototype.getStatus=function(){return this.status},u.prototype._attach=function(){this.$el=this._getGroupContainer(this.id),this._bindEventListeners()},u.prototype._getGroupContainer=function(n){var i,s=this.$filterEl.find('[data-group="'+n+'"]'),r=this;return 0===s.length&&(t.warn("Impossible to find selector container: "+n),i=e.extend(!0,{classNames:r.classNames,id:n,incremental:this.incremental},r.template,l[this.lang]),s=e(o(i)),"append"===this.direction?this.$filterEl.append(s):this.$filterEl.prepend(s)),s},u.prototype._createSelectorContainer=function(n){t.info("Create container for selector: "+n);var i,s=e.extend(!0,{id:n,classNames:this.incremental?"fx-group-item fx-boxed":"fx-group-item",incremental:this.incremental,hideHeader:!this.incremental,hideRemoveButton:!this.incremental,hideSwitch:!this.incremental||this.template.hideSwitch},l[this.lang]);return i=e(a(s))},u.prototype._render=function(){this.ready=!1,this.selectorsReady=0;for(var t=0;t<this.initialAmount;t++)this._addGroup();0===this.initialAmount&&window.setTimeout(n.bind(function(){this._trigger(s.SELECTOR_READY,{id:this.id})},this),100)},u.prototype._addGroup=function(t){this.amount++;var i="group_"+this.amount;this.groups[i]={};var r;r=this._createSelectorContainer(i),this.groups[i].$el=r,this._bindSelectorEventListeners(r,i),this.$el.find(h.GROUPS_CONTAINER).prepend(r),n.each(this._selectors,n.bind(function(a){var o=e.extend(!0,{id:a.id,controller:this.controller,lang:this.lang,languages:this.languages,plugins:this.plugins,el:r,values:t?t[a.id]:void 0,cache:this.cache,environment:this.environment,template:{hideRemoveButton:!0,hideSwitch:!0}},a);o.instance=new c(o),o.instance.on(s.SELECTOR_READY,n.bind(this._onSelectorReady,this,i)),o.instance.on(s.SELECTOR_ENABLED,n.bind(this._onSelectorEnabled,this,i)),o.instance.on(s.SELECTOR_SELECTED,n.bind(this._onSelectorSelected,this,i)),this.groups[i][o.id]=o},this)),this._initDependencies()},u.prototype._initDependencies=function(){n.each(this.groups,n.bind(function(t,e){n.each(t,n.bind(function(t,n){t.hasOwnProperty("dependencies")&&this._processSelectDependencies(t.dependencies,n,e)},this))},this))},u.prototype._processSelectDependencies=function(i,s,r){var a=this;n.each(i,n.bind(function(i,o){Array.isArray(i)||(i=[i]);var l=[o];n.each(l,n.bind(function(o){n.each(i,n.bind(function(n){if("object"!=typeof n)return void t.warn(JSON.stringify(n)+" is not a valid dependency configuration");var i={event:"dep_"+n.event+"_"+o+"_"+r,callback:function(i){var l=a["_dep_"+n.id];e.isFunction(l)?l.call(a,i,{src:o,target:s,group:r,args:n.args}):t.error("Impossible to find : _dep_"+n.id)}};this.dependeciesToDestory.push(i),this.on(i.event,i.callback,this)},this))},this))},this))},u.prototype._onSelectorSelected=function(t,e){e&&this._trigger("dep_select_"+e.id+"_"+t,e),this._trigger(s.SELECTOR_SELECTED,e)},u.prototype._onSelectorEnabled=function(){this.enable()},u.prototype._onSelectorReady=function(){this.selectorsReady++,t.info("Ready event listened from group: "+this.id),this.selectorsReady===Object.keys(this._selectors).length&&this._onReady()},u.prototype._onReady=function(){t.info("Group is ready: "+this.id),this._trigger(s.SELECTOR_READY,{id:this.id})},u.prototype._unbindEventListeners=function(){this.$el.find(h.SWITCH).off(),this.$el.find(h.REMOVE_BTN).off(),this.$el.find(h.ADD_BTN).off()},u.prototype._bindEventListeners=function(){this.$el.find(h.SWITCH).on("click",n.bind(this._onSwitchClick,this)),this.$el.find(h.REMOVE_BTN).on("click",n.bind(this._onRemoveClick,this)),this.$el.find(h.ADD_BTN).on("click",n.bind(this._onAddClick,this))},u.prototype._bindSelectorEventListeners=function(t,e){t.find(h.SWITCH).on("click",n.bind(this._onSelectorSwitchClick,this,e)),t.find(h.REMOVE_BTN).on("click",n.bind(this._onSelectorRemoveClick,this,e))},u.prototype._unbindSelectorEventListeners=function(t){t.find(h.SWITCH).off(),t.find(h.REMOVE_BTN).off()},u.prototype._onSelectorSwitchClick=function(t,i){var s=e(i.target).is(":checked"),r=this.groups[t];r&&n.each(r,n.bind(function(t){var e=t.instance;e&&(s?t.instance.enable():t.instance.disable())},this))},u.prototype._onSelectorRemoveClick=function(t){var e=this.groups[t];e&&n.each(e,n.bind(function(t){var e=t.instance;e&&t.instance.dispose()},this)),this._unbindSelectorEventListeners(this.groups[t].$el),this._destroyGroupDependencies(t),this.groups[t].$el.remove(),delete this.groups[t]},u.prototype._destroyDependencies=function(){n.each(this.groups,n.bind(function(t,e){this._destroyGroupDependencies(e)},this))},u.prototype._destroyGroupDependencies=function(t){n.each(this.dependeciesToDestory,n.bind(function(e){e.event.endsWith(t)&&delete this.channels[e.event]},this))},u.prototype._onSwitchClick=function(t){var n=e(t.target).is(":checked");n?this.enable():this.disable()},u.prototype._onRemoveClick=function(){this.dispose(),this._trigger(s.SELECTOR_REMOVED,{id:this.id})},u.prototype._onAddClick=function(){this.enable(),this._addGroup()},u.prototype._getEventName=function(t){return this.controller.id+t},u.prototype.on=function(t,e,n){var i=n||this;return this.channels[t]||(this.channels[t]=[]),this.channels[t].push({context:i,callback:e}),this},u.prototype._trigger=function(t){if(!this.channels[t])return!1;for(var e=Array.prototype.slice.call(arguments,1),n=0,i=this.channels[t].length;n<i;n++){var s=this.channels[t][n];s.callback.apply(s.context,e)}return this},u}.apply(e,i),!(void 0!==s&&(t.exports=s))},function(t,e,n){var i;i=function(){"use strict";return{validityTimeout:1e4,corePlugins:["dropdown","tree","input","range","time","sortable","textarea"],languages:["EN","FR","ES","PR","AR","CZ"],pluginRegistry:{},focusedSelectorClassName:"focused",mandatorySelectorClassName:"mandatory",disabledSelectorClassName:"disabled",outputFormat:"plain",common:{template:{hideRemoveButton:!0,hideSwitch:!0,hideHeaderIcon:!0}},direction:"append",ensureAtLeast:-1,cache:!1,lang:"EN"}}.call(e,n,e,t),!(void 0!==i&&(t.exports=i))},function(e,n){e.exports=t},function(t,n){t.exports=e},function(t,e,n){var i;i=function(){"use strict";var t="";return{MISSING_CONTAINER:t+"missing_container",MISSING_SUMMARY_CONTAINER:t+"missing_summary_container",MISSING_SELECTORS:t+"missing_selectors",INVALID_DATA:t+"invalid_data",READY_TIMEOUT:t+"ready_timeout",SUMMARY_MODEL_CREATION:t+"summary_model_creation",UNKNOWN_DEPENDENCY_EVENT:t+"unknown_dependency_event",UNKNOWN_DEPENDENCY_ID:t+"unknown_dependency_id"}}.call(e,n,e,t),!(void 0!==i&&(t.exports=i))},function(t,e,n){var i;i=function(){"use strict";var t="fx.filter.";return{FILTER_READY:t+"selectors.ready",SELECTOR_CLICKED:t+"selectors.clicked",SELECTOR_SELECTED:t+"selectors.selected",SELECTOR_READY:t+"selector.ready",SELECTOR_DISABLED:t+"selector.disabled",SELECTOR_ENABLED:t+"selector.enabled",SELECTOR_REMOVED:t+"selector.removed"}}.call(e,n,e,t),!(void 0!==i&&(t.exports=i))},function(t,e){t.exports=n},function(t,e,n){var i=n(10);t.exports=(i.default||i).template({1:function(t,e,n,i,s){var r,a=null!=e?e:{};return'\r\n <div data-selector-header class="selector-header clearfix">\r\n\r\n'+(null!=(r=n.unless.call(a,null!=e?e.hideTitle:e,{name:"unless",hash:{},fn:t.program(2,s,0),inverse:t.noop,data:s}))?r:"")+"\r\n"+(null!=(r=n.unless.call(a,null!=e?e.hideDescription:e,{name:"unless",hash:{},fn:t.program(8,s,0),inverse:t.noop,data:s}))?r:"")+'\r\n <div class="btn-group controller" role="group">\r\n\r\n'+(null!=(r=n.unless.call(a,null!=e?e.hideSwitch:e,{name:"unless",hash:{},fn:t.program(10,s,0),inverse:t.noop,data:s}))?r:"")+"\r\n"+(null!=(r=n.unless.call(a,null!=e?e.hideRemoveButton:e,{name:"unless",hash:{},fn:t.program(12,s,0),inverse:t.noop,data:s}))?r:"")+"\r\n </div>\r\n\r\n </div>\r\n\r\n"},2:function(t,e,n,i,s){var r,a,o=null!=e?e:{};return'\r\n <h5 class="truncate fx-selector-title">'+t.escapeExpression((a=null!=(a=n.title||(null!=e?e.title:e))?a:n.helperMissing,"function"==typeof a?a.call(o,{name:"title",hash:{},data:s}):a))+"\r\n\r\n"+(null!=(r=n.unless.call(o,null!=e?e.hideHeaderIcon:e,{name:"unless",hash:{},fn:t.program(3,s,0),inverse:t.noop,data:s}))?r:"")+"\r\n </h5>\r\n\r\n"},3:function(t,e,n,i,s){var r;return"\r\n"+(null!=(r=n.if.call(null!=e?e:{},null!=e?e.headerIconTooltip:e,{name:"if",hash:{},fn:t.program(4,s,0),inverse:t.program(6,s,0),data:s}))?r:"")+"\r\n"},4:function(t,e,n,i,s){var r,a=null!=e?e:{},o=n.helperMissing,l="function",c=t.escapeExpression;return' <span class="'+c((r=null!=(r=n.headerIconClassName||(null!=e?e.headerIconClassName:e))?r:o,typeof r===l?r.call(a,{name:"headerIconClassName",hash:{},data:s}):r))+'" title="'+c((r=null!=(r=n.headerIconTooltip||(null!=e?e.headerIconTooltip:e))?r:o,
typeof r===l?r.call(a,{name:"headerIconTooltip",hash:{},data:s}):r))+'"></span>\r\n'},6:function(t,e,n,i,s){var r;return' <span class="'+t.escapeExpression((r=null!=(r=n.headerIconClassName||(null!=e?e.headerIconClassName:e))?r:n.helperMissing,"function"==typeof r?r.call(null!=e?e:{},{name:"headerIconClassName",hash:{},data:s}):r))+'"></span>\r\n'},8:function(t,e,n,i,s){var r,a;return"\r\n <small> "+(null!=(a=null!=(a=n.description||(null!=e?e.description:e))?a:n.helperMissing,r="function"==typeof a?a.call(null!=e?e:{},{name:"description",hash:{},data:s}):a)?r:"")+" </small>\r\n\r\n"},10:function(t,e,n,i,s){var r,a=null!=e?e:{},o=n.helperMissing,l="function",c=t.escapeExpression;return'\r\n <div class="btn-group" role="group">\r\n <input type="checkbox" id="switch-'+c((r=null!=(r=n.id||(null!=e?e.id:e))?r:o,typeof r===l?r.call(a,{name:"id",hash:{},data:s}):r))+'" name="disable-selector" data-target="'+c((r=null!=(r=n.id||(null!=e?e.id:e))?r:o,typeof r===l?r.call(a,{name:"id",hash:{},data:s}):r))+'"\r\n data-type="switch" data-role="switch" checked>\r\n <label class="filter-enabled-label" for="switch-'+c((r=null!=(r=n.id||(null!=e?e.id:e))?r:o,typeof r===l?r.call(a,{name:"id",hash:{},data:s}):r))+'">'+c((r=null!=(r=n.enable_filter||(null!=e?e.enable_filter:e))?r:o,typeof r===l?r.call(a,{name:"enable_filter",hash:{},data:s}):r))+"</label>\r\n </div>\r\n\r\n"},12:function(t,e,n,i,s){var r;return'\r\n <button data-role="remove" class="btn btn-default btn-round" type="button"\r\n title="'+t.escapeExpression((r=null!=(r=n.tooltip_remove_selector||(null!=e?e.tooltip_remove_selector:e))?r:n.helperMissing,"function"==typeof r?r.call(null!=e?e:{},{name:"tooltip_remove_selector",hash:{},data:s}):r))+'">\r\n <span class="fx-icon fx-icon-close" aria-hidden="true"></span>\r\n </button>\r\n\r\n'},14:function(t,e,n,i,s){var r,a;return"\r\n <small> "+(null!=(a=null!=(a=n.footer||(null!=e?e.footer:e))?a:n.helperMissing,r="function"==typeof a?a.call(null!=e?e:{},{name:"footer",hash:{},data:s}):a)?r:"")+" </small>\r\n\r\n"},compiler:[7,">= 4.0.0"],main:function(t,e,n,i,s){var r,a,o=null!=e?e:{};return'<div class="fx-selector '+t.escapeExpression((a=null!=(a=n.classNames||(null!=e?e.classNames:e))?a:n.helperMissing,"function"==typeof a?a.call(o,{name:"classNames",hash:{},data:s}):a))+'">\r\n\r\n'+(null!=(r=n.unless.call(o,null!=e?e.hideHeader:e,{name:"unless",hash:{},fn:t.program(1,s,0),inverse:t.noop,data:s}))?r:"")+"\r\n <div data-el></div>\r\n\r\n"+(null!=(r=n.unless.call(o,null!=e?e.hideFooter:e,{name:"unless",hash:{},fn:t.program(14,s,0),inverse:t.noop,data:s}))?r:"")+"\r\n</div>"},useData:!0})},function(t,e,n){t.exports=n(11).default},function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}function s(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}function r(){var t=new o.HandlebarsEnvironment;return d.extend(t,o),t.SafeString=c.default,t.Exception=h.default,t.Utils=d,t.escapeExpression=d.escapeExpression,t.VM=m,t.template=function(e){return m.template(e,t)},t}e.__esModule=!0;var a=n(12),o=s(a),l=n(26),c=i(l),u=n(14),h=i(u),p=n(13),d=s(p),f=n(27),m=s(f),v=n(28),y=i(v),g=r();g.create=r,y.default(g),g.default=g,e.default=g,t.exports=e.default},function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}function s(t,e,n){this.helpers=t||{},this.partials=e||{},this.decorators=n||{},l.registerDefaultHelpers(this),c.registerDefaultDecorators(this)}e.__esModule=!0,e.HandlebarsEnvironment=s;var r=n(13),a=n(14),o=i(a),l=n(15),c=n(23),u=n(25),h=i(u),p="4.0.5";e.VERSION=p;var d=7;e.COMPILER_REVISION=d;var f={1:"<= 1.0.rc.2",2:"== 1.0.0-rc.3",3:"== 1.0.0-rc.4",4:"== 1.x.x",5:"== 2.0.0-alpha.x",6:">= 2.0.0-beta.1",7:">= 4.0.0"};e.REVISION_CHANGES=f;var m="[object Object]";s.prototype={constructor:s,logger:h.default,log:h.default.log,registerHelper:function(t,e){if(r.toString.call(t)===m){if(e)throw new o.default("Arg not supported with multiple helpers");r.extend(this.helpers,t)}else this.helpers[t]=e},unregisterHelper:function(t){delete this.helpers[t]},registerPartial:function(t,e){if(r.toString.call(t)===m)r.extend(this.partials,t);else{if("undefined"==typeof e)throw new o.default('Attempting to register a partial called "'+t+'" as undefined');this.partials[t]=e}},unregisterPartial:function(t){delete this.partials[t]},registerDecorator:function(t,e){if(r.toString.call(t)===m){if(e)throw new o.default("Arg not supported with multiple decorators");r.extend(this.decorators,t)}else this.decorators[t]=e},unregisterDecorator:function(t){delete this.decorators[t]}};var v=h.default.log;e.log=v,e.createFrame=r.createFrame,e.logger=h.default},function(t,e){"use strict";function n(t){return u[t]}function i(t){for(var e=1;e<arguments.length;e++)for(var n in arguments[e])Object.prototype.hasOwnProperty.call(arguments[e],n)&&(t[n]=arguments[e][n]);return t}function s(t,e){for(var n=0,i=t.length;n<i;n++)if(t[n]===e)return n;return-1}function r(t){if("string"!=typeof t){if(t&&t.toHTML)return t.toHTML();if(null==t)return"";if(!t)return t+"";t=""+t}return p.test(t)?t.replace(h,n):t}function a(t){return!t&&0!==t||!(!m(t)||0!==t.length)}function o(t){var e=i({},t);return e._parent=t,e}function l(t,e){return t.path=e,t}function c(t,e){return(t?t+".":"")+e}e.__esModule=!0,e.extend=i,e.indexOf=s,e.escapeExpression=r,e.isEmpty=a,e.createFrame=o,e.blockParams=l,e.appendContextPath=c;var u={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`","=":"="},h=/[&<>"'`=]/g,p=/[&<>"'`=]/,d=Object.prototype.toString;e.toString=d;var f=function(t){return"function"==typeof t};f(/x/)&&(e.isFunction=f=function(t){return"function"==typeof t&&"[object Function]"===d.call(t)}),e.isFunction=f;var m=Array.isArray||function(t){return!(!t||"object"!=typeof t)&&"[object Array]"===d.call(t)};e.isArray=m},function(t,e){"use strict";function n(t,e){var s=e&&e.loc,r=void 0,a=void 0;s&&(r=s.start.line,a=s.start.column,t+=" - "+r+":"+a);for(var o=Error.prototype.constructor.call(this,t),l=0;l<i.length;l++)this[i[l]]=o[i[l]];Error.captureStackTrace&&Error.captureStackTrace(this,n),s&&(this.lineNumber=r,this.column=a)}e.__esModule=!0;var i=["description","fileName","lineNumber","message","name","number","stack"];n.prototype=new Error,e.default=n,t.exports=e.default},function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}function s(t){a.default(t),l.default(t),u.default(t),p.default(t),f.default(t),v.default(t),g.default(t)}e.__esModule=!0,e.registerDefaultHelpers=s;var r=n(16),a=i(r),o=n(17),l=i(o),c=n(18),u=i(c),h=n(19),p=i(h),d=n(20),f=i(d),m=n(21),v=i(m),y=n(22),g=i(y)},function(t,e,n){"use strict";e.__esModule=!0;var i=n(13);e.default=function(t){t.registerHelper("blockHelperMissing",function(e,n){var s=n.inverse,r=n.fn;if(e===!0)return r(this);if(e===!1||null==e)return s(this);if(i.isArray(e))return e.length>0?(n.ids&&(n.ids=[n.name]),t.helpers.each(e,n)):s(this);if(n.data&&n.ids){var a=i.createFrame(n.data);a.contextPath=i.appendContextPath(n.data.contextPath,n.name),n={data:a}}return r(e,n)})},t.exports=e.default},function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}e.__esModule=!0;var s=n(13),r=n(14),a=i(r);e.default=function(t){t.registerHelper("each",function(t,e){function n(e,n,r){c&&(c.key=e,c.index=n,c.first=0===n,c.last=!!r,u&&(c.contextPath=u+e)),l+=i(t[e],{data:c,blockParams:s.blockParams([t[e],e],[u+e,null])})}if(!e)throw new a.default("Must pass iterator to #each");var i=e.fn,r=e.inverse,o=0,l="",c=void 0,u=void 0;if(e.data&&e.ids&&(u=s.appendContextPath(e.data.contextPath,e.ids[0])+"."),s.isFunction(t)&&(t=t.call(this)),e.data&&(c=s.createFrame(e.data)),t&&"object"==typeof t)if(s.isArray(t))for(var h=t.length;o<h;o++)o in t&&n(o,o,o===t.length-1);else{var p=void 0;for(var d in t)t.hasOwnProperty(d)&&(void 0!==p&&n(p,o-1),p=d,o++);void 0!==p&&n(p,o-1,!0)}return 0===o&&(l=r(this)),l})},t.exports=e.default},function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}e.__esModule=!0;var s=n(14),r=i(s);e.default=function(t){t.registerHelper("helperMissing",function(){if(1!==arguments.length)throw new r.default('Missing helper: "'+arguments[arguments.length-1].name+'"')})},t.exports=e.default},function(t,e,n){"use strict";e.__esModule=!0;var i=n(13);e.default=function(t){t.registerHelper("if",function(t,e){return i.isFunction(t)&&(t=t.call(this)),!e.hash.includeZero&&!t||i.isEmpty(t)?e.inverse(this):e.fn(this)}),t.registerHelper("unless",function(e,n){return t.helpers.if.call(this,e,{fn:n.inverse,inverse:n.fn,hash:n.hash})})},t.exports=e.default},function(t,e){"use strict";e.__esModule=!0,e.default=function(t){t.registerHelper("log",function(){for(var e=[void 0],n=arguments[arguments.length-1],i=0;i<arguments.length-1;i++)e.push(arguments[i]);var s=1;null!=n.hash.level?s=n.hash.level:n.data&&null!=n.data.level&&(s=n.data.level),e[0]=s,t.log.apply(t,e)})},t.exports=e.default},function(t,e){"use strict";e.__esModule=!0,e.default=function(t){t.registerHelper("lookup",function(t,e){return t&&t[e]})},t.exports=e.default},function(t,e,n){"use strict";e.__esModule=!0;var i=n(13);e.default=function(t){t.registerHelper("with",function(t,e){i.isFunction(t)&&(t=t.call(this));var n=e.fn;if(i.isEmpty(t))return e.inverse(this);var s=e.data;return e.data&&e.ids&&(s=i.createFrame(e.data),s.contextPath=i.appendContextPath(e.data.contextPath,e.ids[0])),n(t,{data:s,blockParams:i.blockParams([t],[s&&s.contextPath])})})},t.exports=e.default},function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}function s(t){a.default(t)}e.__esModule=!0,e.registerDefaultDecorators=s;var r=n(24),a=i(r)},function(t,e,n){"use strict";e.__esModule=!0;var i=n(13);e.default=function(t){t.registerDecorator("inline",function(t,e,n,s){var r=t;return e.partials||(e.partials={},r=function(s,r){var a=n.partials;n.partials=i.extend({},a,e.partials);var o=t(s,r);return n.partials=a,o}),e.partials[s.args[0]]=s.fn,r})},t.exports=e.default},function(t,e,n){"use strict";e.__esModule=!0;var i=n(13),s={methodMap:["debug","info","warn","error"],level:"info",lookupLevel:function(t){if("string"==typeof t){var e=i.indexOf(s.methodMap,t.toLowerCase());t=e>=0?e:parseInt(t,10)}return t},log:function(t){if(t=s.lookupLevel(t),"undefined"!=typeof console&&s.lookupLevel(s.level)<=t){var e=s.methodMap[t];console[e]||(e="log");for(var n=arguments.length,i=Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];console[e].apply(console,i)}}};e.default=s,t.exports=e.default},function(t,e){"use strict";function n(t){this.string=t}e.__esModule=!0,n.prototype.toString=n.prototype.toHTML=function(){return""+this.string},e.default=n,t.exports=e.default},function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}function s(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}function r(t){var e=t&&t[0]||1,n=y.COMPILER_REVISION;if(e!==n){if(e<n){var i=y.REVISION_CHANGES[n],s=y.REVISION_CHANGES[e];throw new v.default("Template was precompiled with an older version of Handlebars than the current runtime. Please update your precompiler to a newer version ("+i+") or downgrade your runtime to an older version ("+s+").")}throw new v.default("Template was precompiled with a newer version of Handlebars than the current runtime. Please update your runtime to a newer version ("+t[1]+").")}}function a(t,e){function n(n,i,s){s.hash&&(i=f.extend({},i,s.hash),s.ids&&(s.ids[0]=!0)),n=e.VM.resolvePartial.call(this,n,i,s);var r=e.VM.invokePartial.call(this,n,i,s);if(null==r&&e.compile&&(s.partials[s.name]=e.compile(n,t.compilerOptions,e),r=s.partials[s.name](i,s)),null!=r){if(s.indent){for(var a=r.split("\n"),o=0,l=a.length;o<l&&(a[o]||o+1!==l);o++)a[o]=s.indent+a[o];r=a.join("\n")}return r}throw new v.default("The partial "+s.name+" could not be compiled when running in runtime-only mode")}function i(e){function n(e){return""+t.main(s,e,s.helpers,s.partials,a,l,o)}var r=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],a=r.data;i._setup(r),!r.partial&&t.useData&&(a=h(e,a));var o=void 0,l=t.useBlockParams?[]:void 0;return t.useDepths&&(o=r.depths?e!==r.depths[0]?[e].concat(r.depths):r.depths:[e]),(n=p(t.main,n,s,r.depths||[],a,l))(e,r)}if(!e)throw new v.default("No environment passed to template");if(!t||!t.main)throw new v.default("Unknown template object: "+typeof t);t.main.decorator=t.main_d,e.VM.checkRevision(t.compiler);var s={strict:function(t,e){if(!(e in t))throw new v.default('"'+e+'" not defined in '+t);return t[e]},lookup:function(t,e){for(var n=t.length,i=0;i<n;i++)if(t[i]&&null!=t[i][e])return t[i][e]},lambda:function(t,e){return"function"==typeof t?t.call(e):t},escapeExpression:f.escapeExpression,invokePartial:n,fn:function(e){var n=t[e];return n.decorator=t[e+"_d"],n},programs:[],program:function(t,e,n,i,s){var r=this.programs[t],a=this.fn(t);return e||s||i||n?r=o(this,t,a,e,n,i,s):r||(r=this.programs[t]=o(this,t,a)),r},data:function(t,e){for(;t&&e--;)t=t._parent;return t},merge:function(t,e){var n=t||e;return t&&e&&t!==e&&(n=f.extend({},e,t)),n},noop:e.VM.noop,compilerInfo:t.compiler};return i.isTop=!0,i._setup=function(n){n.partial?(s.helpers=n.helpers,s.partials=n.partials,s.decorators=n.decorators):(s.helpers=s.merge(n.helpers,e.helpers),t.usePartial&&(s.partials=s.merge(n.partials,e.partials)),(t.usePartial||t.useDecorators)&&(s.decorators=s.merge(n.decorators,e.decorators)))},i._child=function(e,n,i,r){if(t.useBlockParams&&!i)throw new v.default("must pass block params");if(t.useDepths&&!r)throw new v.default("must pass parent depths");return o(s,e,t[e],n,0,i,r)},i}function o(t,e,n,i,s,r,a){function o(e){var s=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],o=a;return a&&e!==a[0]&&(o=[e].concat(a)),n(t,e,t.helpers,t.partials,s.data||i,r&&[s.blockParams].concat(r),o)}return o=p(n,o,t,a,i,r),o.program=e,o.depth=a?a.length:0,o.blockParams=s||0,o}function l(t,e,n){return t?t.call||n.name||(n.name=t,t=n.partials[t]):t="@partial-block"===n.name?n.data["partial-block"]:n.partials[n.name],t}function c(t,e,n){n.partial=!0,n.ids&&(n.data.contextPath=n.ids[0]||n.data.contextPath);var i=void 0;if(n.fn&&n.fn!==u&&(n.data=y.createFrame(n.data),i=n.data["partial-block"]=n.fn,i.partials&&(n.partials=f.extend({},n.partials,i.partials))),void 0===t&&i&&(t=i),void 0===t)throw new v.default("The partial "+n.name+" could not be found");if(t instanceof Function)return t(e,n)}function u(){return""}function h(t,e){return e&&"root"in e||(e=e?y.createFrame(e):{},e.root=t),e}function p(t,e,n,i,s,r){if(t.decorator){var a={};e=t.decorator(e,a,n,i&&i[0],s,r,i),f.extend(e,a)}return e}e.__esModule=!0,e.checkRevision=r,e.template=a,e.wrapProgram=o,e.resolvePartial=l,e.invokePartial=c,e.noop=u;var d=n(13),f=s(d),m=n(14),v=i(m),y=n(12)},function(t,e){(function(n){"use strict";e.__esModule=!0,e.default=function(t){var e="undefined"!=typeof n?n:window,i=e.Handlebars;t.noConflict=function(){return e.Handlebars===t&&(e.Handlebars=i),t}},t.exports=e.default}).call(e,function(){return this}())},function(t,e,n){var i=n(10);t.exports=(i.default||i).template({1:function(t,e,n,i,s){var r,a=null!=e?e:{};return'\r\n <div data-selector-header class="selector-header clearfix">\r\n\r\n'+(null!=(r=n.unless.call(a,null!=e?e.hideTitle:e,{name:"unless",hash:{},fn:t.program(2,s,0),inverse:t.noop,data:s}))?r:"")+"\r\n"+(null!=(r=n.unless.call(a,null!=e?e.hideDescription:e,{name:"unless",hash:{},fn:t.program(8,s,0),inverse:t.noop,data:s}))?r:"")+'\r\n <div class="btn-group controller" role="group">\r\n\r\n'+(null!=(r=n.if.call(a,null!=e?e.incremental:e,{name:"if",hash:{},fn:t.program(10,s,0),inverse:t.noop,data:s}))?r:"")+"\r\n"+(null!=(r=n.unless.call(a,null!=e?e.hideSwitch:e,{name:"unless",hash:{},fn:t.program(12,s,0),inverse:t.noop,data:s}))?r:"")+"\r\n"+(null!=(r=n.unless.call(a,null!=e?e.hideRemoveButton:e,{name:"unless",hash:{},fn:t.program(14,s,0),inverse:t.noop,data:s}))?r:"")+"\r\n </div>\r\n\r\n </div>\r\n\r\n"},2:function(t,e,n,i,s){var r,a,o=null!=e?e:{};return'\r\n <h5 class="truncate fx-selector-title">'+t.escapeExpression((a=null!=(a=n.title||(null!=e?e.title:e))?a:n.helperMissing,"function"==typeof a?a.call(o,{name:"title",hash:{},data:s}):a))+"\r\n\r\n"+(null!=(r=n.unless.call(o,null!=e?e.hideHeaderIcon:e,{name:"unless",hash:{},fn:t.program(3,s,0),inverse:t.noop,data:s}))?r:"")+"\r\n </h5>\r\n\r\n"},3:function(t,e,n,i,s){var r;return"\r\n"+(null!=(r=n.if.call(null!=e?e:{},null!=e?e.headerIconTooltip:e,{name:"if",hash:{},fn:t.program(4,s,0),inverse:t.program(6,s,0),data:s}))?r:"")+"\r\n"},4:function(t,e,n,i,s){var r,a=null!=e?e:{},o=n.helperMissing,l="function",c=t.escapeExpression;return' <span class="'+c((r=null!=(r=n.headerIconClassName||(null!=e?e.headerIconClassName:e))?r:o,typeof r===l?r.call(a,{name:"headerIconClassName",hash:{},data:s}):r))+'" title="'+c((r=null!=(r=n.headerIconTooltip||(null!=e?e.headerIconTooltip:e))?r:o,typeof r===l?r.call(a,{name:"headerIconTooltip",hash:{},data:s}):r))+'"></span>\r\n'},6:function(t,e,n,i,s){var r;return' <span class="'+t.escapeExpression((r=null!=(r=n.headerIconClassName||(null!=e?e.headerIconClassName:e))?r:n.helperMissing,"function"==typeof r?r.call(null!=e?e:{},{name:"headerIconClassName",hash:{},data:s}):r))+'"></span>\r\n'},8:function(t,e,n,i,s){var r,a;return"\r\n "+(null!=(a=null!=(a=n.description||(null!=e?e.description:e))?a:n.helperMissing,r="function"==typeof a?a.call(null!=e?e:{},{name:"description",hash:{},d