1var base2={name:"base2",version:"1.0",exports:"Base,Package,Abstract,Module,Enumerable,Map,Collection,RegGrp,Undefined,Null,This,True,False,assignID,detect,global",namespace:""};new function(_no_shrink_){var Undefined=K(),Null=K(null),True=K(!0),False=K(!1),This=function(){return this},global=This(),base2=global.base2,_FORMAT=/%([1-9])/g,_LTRIM=/^\s\s*/,_RTRIM=/\s\s*$/,_RESCAPE=/([\/()[\]{}|*+-.,^$?\\])/g,_BASE=/try/.test(detect)?/\bbase\b/:/.*/,_HIDDEN=["constructor","toString","valueOf"],_MSIE_NATIVE_FUNCTION=detect("(jscript)")?new RegExp("^"+rescape(isNaN).replace(/isNaN/,"\\w+")+"$"):{test:False},_counter=1,_slice=Array.prototype.slice;function assignID(e){return e.base2ID||(e.base2ID="b2_"+_counter++),e.base2ID}_Function_forEach();var _subclass=function(e,t){base2.__prototyping=this.prototype;var n=new this;e&&extend(n,e),delete base2.__prototyping;var i,a=n.constructor;function r(){if(!base2.__prototyping){if(this.constructor!=arguments.callee&&!this.__constructing)return extend(arguments[0],n);this.__constructing=!0,a.apply(this,arguments),delete this.__constructing}return this}for(i in n.constructor=r,Base)r[i]=this[i];return r.ancestor=this,r.base=Undefined,t&&extend(r,t),r.prototype=n,r.init&&r.init(),r["#implements"]=[],r["#implemented_by"]=[],r},Base=_subclass.call(Object,{constructor:function(){0<arguments.length&&this.extend(arguments[0])},base:function(){},extend:delegate(extend)},Base={ancestorOf:function(e){return _ancestorOf(this,e)},extend:_subclass,forEach:function(e,t,n){_Function_forEach(this,e,t,n)},implement:function(e){return"function"==typeof e&&(_ancestorOf(Base,e)&&(this["#implements"].push(e),e["#implemented_by"].push(this)),e=e.prototype),extend(this.prototype,e),this}}),Package=Base.extend({constructor:function(e,t){var n,i;function a(e){e=e.split(".");for(var t=base2,n=0;t&&null!=e[n];)t=t[e[n++]];return t}this.extend(t),this.init&&this.init(),this.name&&"base2"!=this.name&&(this.parent||(this.parent=base2),this.parent.addName(this.name,this),this.namespace=format("var %1=%2;",this.name,String2.slice(this,1,-1))),e&&(t=base2.JavaScript?base2.JavaScript.namespace:"",e.imports=Array2.reduce(csv(this.imports),function(e,t){var n=a(t)||a("JavaScript."+t);return assert(n,format("Object not found: '%1'.",t),ReferenceError),e+n.namespace},"var base2=(function(){return this.base2})();"+base2.namespace+t)+lang.namespace,e.exports=Array2.reduce(csv(this.exports),function(e,t){var n=this.name+"."+t;return this.namespace+="var "+t+"="+n+";",e+"if(!"+n+")"+n+"="+t+";"},"",this)+"this._label_"+this.name+"();",i=String2.slice(n=this,1,-1),e["_label_"+this.name]=function(){Package.forEach(n,function(e,t){e&&e.ancestorOf==Base.ancestorOf&&(e.toString=K(format("[%1.%2]",i,t)),e.prototype.toString==Base.prototype.toString&&(e.prototype.toString=K(format("[object %1.%2]",i,t))))})})},exports:"",imports:"",name:"",namespace:"",parent:null,addName:function(e,t){this[e]||(this[e]=t,this.exports+=","+e,this.namespace+=format("var %1=%2.%1;",e,this.name))},addPackage:function(e){this.addName(e,new Package(null,{name:e,parent:this}))},toString:function(){return format("[%1]",this.parent?String2.slice(this.parent,1,-1)+"."+this.name:this.name)}}),Abstract=Base.extend({constructor:function(){throw new TypeError("Abstract class cannot be instantiated.")}}),_moduleCount=0,Module=Abstract.extend(null,{namespace:"",extend:function(e,t){var n=this.base(),i=_moduleCount++;return n.namespace="",n.partial=this.partial,n.toString=K("[base2.Module["+i+"]]"),(Module[i]=n).implement(this),e&&n.implement(e),t&&(extend(n,t),n.init&&n.init()),n},forEach:function(n,i){_Function_forEach(Module,this.prototype,function(e,t){"function"==typeOf(e)&&n.call(i,this[t],t,this)},this)},implement:function(e){var t,n=this,i=n.toString().slice(1,-1);if("function"==typeof e){if(_ancestorOf(e,n)||this.base(e),_ancestorOf(Module,e)){for(var a in e)void 0===n[a]&&("function"==typeof(t=e[a])&&t.call&&e.prototype[a]&&(t=_staticModuleMethod(e,a)),n[a]=t);n.namespace+=e.namespace.replace(/base2\.Module\[\d+\]/g,i)}}else extend(n,e),_extendModule(n,e);return n},partial:function(){var n=Module.extend(),e=n.toString().slice(1,-1);return n.namespace=this.namespace.replace(/(\w+)=b[^\)]+\)/g,"$1="+e+".$1"),this.forEach(function(e,t){n[t]=partial(bind(e,n))}),n}});function _extendModule(e,t){var n,i=e.prototype,a=e.toString().slice(1,-1);for(n in t){var r=t[n],s="";"@"==n.charAt(0)?detect(n.slice(1))&&_extendModule(e,r):i[n]||(n==n.toUpperCase()?s="var "+n+"="+a+"."+n+";":"function"==typeof r&&r.call&&(s="var "+n+"=base2.lang.bind('"+n+"',"+a+");",i[n]=_moduleMethod(e,n),i[n]._module=e),-1==e.namespace.indexOf(s)&&(e.namespace+=s))}}function _staticModuleMethod(e,t){return function(){return e[t].apply(e,arguments)}}function _moduleMethod(t,n){return function(){var e=_slice.call(arguments);return e.unshift(this),t[n].apply(t,e)}}var Enumerable=Module.extend({every:function(n,i,a){var r=!0;try{forEach(n,function(e,t){if(!(r=i.call(a,e,t,n)))throw StopIteration})}catch(e){if(e!=StopIteration)throw e}return!!r},filter:function(i,a,r){var s=0;return this.reduce(i,function(e,t,n){return a.call(r,t,n,i)&&(e[s++]=t),e},[])},invoke:function(e,t){var n=_slice.call(arguments,2);return this.map(e,"function"==typeof t?function(e){return null==e?void 0:t.apply(e,n)}:function(e){return null==e?void 0:e[t].apply(e,n)})},map:function(n,i,a){var r=[],s=0;return forEach(n,function(e,t){r[s++]=i.call(a,e,t,n)}),r},pluck:function(e,t){return this.map(e,function(e){return null==e?void 0:e[t]})},reduce:function(n,i,a,r){var s=2<arguments.length;return forEach(n,function(e,t){s?a=i.call(r,a,e,t,n):(a=e,s=!0)}),a},some:function(e,t,n){return!this.every(e,not(t),n)}}),_HASH="#",Map=Base.extend({constructor:function(e){e&&this.merge
1(e)},clear:function(){for(var e in this)0==e.indexOf(_HASH)&&delete this[e]},copy:function(){base2.__prototyping=!0;var e,t=new this.constructor;for(e in delete base2.__prototyping,this)this[e]!==t[e]&&(t[e]=this[e]);return t},forEach:function(e,t){for(var n in this)0==n.indexOf(_HASH)&&e.call(t,this[n],n.slice(1),this)},get:function(e){return this[_HASH+e]},getKeys:function(){return this.map(II)},getValues:function(){return this.map(I)},has:function(e){return _HASH+e in this},merge:function(e){var t=flip(this.put);return forEach(arguments,function(e){forEach(e,t,this)},this),this},put:function(e,t){this[_HASH+e]=t},remove:function(e){delete this[_HASH+e]},size:function(){var e,t=0;for(e in this)0==e.indexOf(_HASH)&&t++;return t},union:function(e){return this.merge.apply(this.copy(),arguments)}});Map.implement(Enumerable),Map.prototype.filter=function(i,a){return this.reduce(function(e,t,n){return i.call(a,t,n,this)||e.remove(n),e},this.copy(),this)};var _KEYS="~",Collection=Map.extend({constructor:function(e){this[_KEYS]=new Array2,this.base(e)},add:function(e,t){assert(!this.has(e),"Duplicate key '"+e+"'."),this.put.apply(this,arguments)},clear:function(){this.base(),this[_KEYS].length=0},copy:function(){var e=this.base();return e[_KEYS]=this[_KEYS].copy(),e},forEach:function(e,t){for(var n=this[_KEYS],i=n.length,a=0;a<i;a++)e.call(t,this[_HASH+n[a]],n[a],this)},getAt:function(e){e=this[_KEYS].item(e);return void 0===e?void 0:this[_HASH+e]},getKeys:function(){return this[_KEYS].copy()},indexOf:function(e){return this[_KEYS].indexOf(String(e))},insertAt:function(e,t,n){assert(void 0!==this[_KEYS].item(e),"Index out of bounds."),assert(!this.has(t),"Duplicate key '"+t+"'."),this[_KEYS].insertAt(e,String(t)),this[_HASH+t]=null,this.put.apply(this,_slice.call(arguments,1))},item:function(e){return this["number"==typeof e?"getAt":"get"](e)},put:function(e,t){this.has(e)||this[_KEYS].push(String(e));var n=this.constructor;n.Item&&!instanceOf(t,n.Item)&&(t=n.create.apply(n,arguments)),this[_HASH+e]=t},putAt:function(e,t){arguments[0]=this[_KEYS].item(e),assert(void 0!==arguments[0],"Index out of bounds."),this.put.apply(this,arguments)},remove:function(e){this.has(e)&&(this[_KEYS].remove(String(e)),delete this[_HASH+e])},removeAt:function(e){var t=this[_KEYS].item(e);void 0!==t&&(this[_KEYS].removeAt(e),delete this[_HASH+t])},reverse:function(){return this[_KEYS].reverse(),this},size:function(){return this[_KEYS].length},slice:function(e,t){var n=this.copy();if(0<arguments.length){var i=this[_KEYS],a=i;n[_KEYS]=Array2(_slice.apply(i,arguments)),n[_KEYS].length&&(a=a.slice(0,e),1<arguments.length&&(a=a.concat(i.slice(t))));for(var r=0;r<a.length;r++)delete n[_HASH+a[r]]}return n},sort:function(n){return n?this[_KEYS].sort(bind(function(e,t){return n(this[_HASH+e],this[_HASH+t],e,t)},this)):this[_KEYS].sort(),this},toString:function(){return"("+(this[_KEYS]||"")+")"}},{Item:null,create:function(e,t){return this.Item?new this.Item(e,t):t},extend:function(e,t){e=this.base(e);return e.create=this.create,t&&extend(e,t),e.Item?"function"!=typeof e.Item&&(e.Item=(this.Item||Base).extend(e.Item)):e.Item=this.Item,e.init&&e.init(),e}}),_RG_BACK_REF=/\\(\d+)/g,_RG_ESCAPE_CHARS=/\\./g,_RG_ESCAPE_BRACKETS=/\(\?[:=!]|\[[^\]]+\]/g,_RG_BRACKETS=/\(/g,_RG_LOOKUP=/\$(\d+)/,_RG_LOOKUP_SIMPLE=/^\$\d+$/,RegGrp=Collection.extend({constructor:function(e,t){this.base(e),this.ignoreCase=!!t},ignoreCase:!1,exec:function(e,s){e+="";var o=this,l=this[_KEYS];return l.length?(s==RegGrp.IGNORE&&(s=0),e.replace(new RegExp(this,this.ignoreCase?"gi":"g"),function(e){for(var t,n=1,i=0;t=o[_HASH+l[i++]];){var a=n+t.length+1;if(arguments[n]){var r=null==s?t.replacement:s;switch(typeof r){case"function":return r.apply(o,_slice.call(arguments,n,a));case"number":return arguments[n+r];default:return r}}n=a}return e})):e},insertAt:function(e,t,n){return instanceOf(t,RegExp)&&(arguments[1]=t.source),base(this,arguments)},test:function(e){return this.exec(e)!=e},toString:function(){var n=1;return"("+this.map(function(e){var t=(e+"").replace(_RG_BACK_REF,function(e,t){return"\\"+(n+Number(t))});return n+=e.length+1,t}).join(")|(")+")"}},{IGNORE:"$0",init:function(){forEach("add,get,has,put,remove".split(","),function(e){_override(this,e,function(e){return instanceOf(e,RegExp)&&(arguments[0]=e.source),base(this,arguments)})},this.prototype)},Item:{constructor:function(e,t){null==t?t=RegGrp.IGNORE:null!=t.replacement?t=t.replacement:"function"!=typeof t&&(t=String(t)),"string"==typeof t&&_RG_LOOKUP.test(t)&&(t=_RG_LOOKUP_SIMPLE.test(t)?parseInt(t.slice(1)):(t=t.replace(/\\/g,"\\\\").replace(/"/g,"\\x22").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\$(\d+)/g,'"+(arguments[$1]||"")+"').replace(/(['"])\1\+(.*)\+\1\1$/,"$1"),new Function('return "'+t+'"'))),this.length=RegGrp.count(e),this.replacement=t,this.toString=K(e+"")},length:0,replacement:""},count:function(e){return match(e=(e+"").replace(_RG_ESCAPE_CHARS,"").replace(_RG_ESCAPE_BRACKETS,""),_RG_BRACKETS).length}}),lang={name:"lang",version:base2.version,exports:"assert,assertArity,assertType,base,bind,copy,extend,forEac
1h,format,instanceOf,match,pcopy,rescape,trim,typeOf",namespace:""};function assert(e,t,n){if(!e)throw new(n||Error)(t||"Assertion failed.")}function assertArity(e,t,n){if(null==t&&(t=e.callee.length),e.length<t)throw new SyntaxError(n||"Not enough arguments.")}function assertType(e,t,n){if(t&&("function"==typeof t?!instanceOf(e,t):typeOf(e)!=t))throw new TypeError(n||"Invalid type.")}function copy(e){var t,n={};for(t in e)n[t]=e[t];return n}function pcopy(e){return _dummy.prototype=e,new _dummy}function _dummy(){}function base(e,t){return e.base.apply(e,t)}function extend(e,t){if(e&&t){2<arguments.length&&(a=t,(t={})[a]=arguments[2]);var n,i=global["function"==typeof t?"Function":"Object"].prototype;if(base2.__prototyping)for(var a,r,s=_HIDDEN.length;a=_HIDDEN[--s];)(r=t[a])!=i[a]&&(_BASE.test(r)?_override(e,a,r):e[a]=r);for(a in t)void 0===i[a]&&(r=t[a],"@"==a.charAt(0)?detect(a.slice(1))&&extend(e,r):(n=e[a])&&"function"==typeof r?r!=n&&(_BASE.test(r)?_override(e,a,r):(r.ancestor=n,e[a]=r)):e[a]=r)}return e}function _ancestorOf(e,t){for(;t;){if(!t.ancestor)return!1;if((t=t.ancestor)==e)return!0}return!1}function _override(e,n,i){var a=e[n],r=base2.__prototyping;function t(){var e=this.base;this.base=r?r[n]:a;var t=i.apply(this,arguments);return this.base=e,t}
1r&&a!=r[n]&&(r=null),t.method=i,t.ancestor=a,(e[n]=t).toString=K(i+"")}function forEach(e,t,n,i){if(null!=e){if(!i)if("function"==typeof e&&e.call)i=Function;else{if("function"==typeof e.forEach&&e.forEach!=arguments.callee)return void e.forEach(t,n);if("number"==typeof e.length)return void _Array_forEach(e,t,n)}_Function_forEach(i||Object,e,t,n)}}function _Array_forEach(e,t,n){var i,a=(e=null==e?global:e).length||0;if("string"==typeof e)for(i=0;i<a;i++)t.call(n,e.charAt(i),i,e);else for(i=0;i<a;i++)i in e&&t.call(n,e[i],i,e)}function _Function_forEach(e,t,n,i){function a(){this.i=1}a.prototype={i:1};var r,s=0;for(r in new a)s++;(_Function_forEach=1<s?function(e,t,n,i){var a,r={};for(a in t)r[a]||void 0!==e.prototype[a]||(r[a]=!0,n.call(i,t[a],a,t))}:function(e,t,n,i){for(var a in t)void 0===e.prototype[a]&&n.call(i,t[a],a,t)})(e,t,n,i)}function instanceOf(e,t){if("function"!=typeof t)throw new TypeError("Invalid 'instanceOf' operand.");if(null!=e){if(e.constructor==t)return 1;if(t.ancestorOf)return t.ancestorOf(e.constructor);if(e instanceof t)return 1;if(Base.ancestorOf!=t.ancestorOf){if(Base.ancestorOf==e.constructor.ancestorOf)return t==Object;switch(t){case Array:return"object"==typeof e&&e.join&&e.splice;case Function:return"function"==typeOf(e);case RegExp:return"string"==typeof e.constructor.$1;case Date:return e.getTimezoneOffset;case String:case Number:case Boolean:return typeOf(e)==typeof t.prototype.valueOf();case Object:return 1}}}}function typeOf(e){var t=typeof e;switch(t){case"object":return null==e?"null":void 0===e.constructor?_MSIE_NATIVE_FUNCTION.test(e)?"function":t:typeof e.constructor.prototype.valueOf();case"function":return"function"==typeof e.call?t:"object";default:return t}}"undefined"==typeof StopIteration&&(StopIteration=new Error("StopIteration")),forEach.csv=function(e,t,n){forEach(csv(e),t,n)},forEach.detect=function(n,i,a){forEach(n,function(e,t){"@"==t.charAt(0)?detect(t.slice(1))&&forEach(e,arguments.callee):i.call(a,e,t,n)})};var JavaScript={name:"JavaScript",version:base2.version,exports:"Array2,Date2,Function2,String2",namespace:"",bind:function(n){var e=global;return global=n,forEach.csv(this.exports,function(e){var t=e.slice(0,-1);extend(n[t],this[e]),this[e](n[t].prototype)},this),global=e,n}};function _createObject2(t,e,n,i){var a=Module.extend(),r=a.toString().slice(1,-1);forEach.csv(n,function(e){a[e]=unbind(t.prototype[e]),a.namespace+=format("var %1=%2.%1;",e,r)}),forEach(_slice.call(arguments,3),a.implement,a);function s(){return a(this.constructor==a?e.apply(null,arguments):arguments[0])}for(var o in s.prototype=a.prototype,a)"prototype"!=o&&t[o]&&(a[o]=t[o],delete a.prototype[o]),s[o]=a[o];return s.ancestor=Object,delete s.extend,s.namespace=s.namespace.replace(/(var (\w+)=)[^,;]+,([^\)]+)\)/g,"$1$3.$2"),s}1900<(new Date).getYear()&&(Date.prototype.getYear=function(){return this.getFullYear()-1900},Date.prototype.setYear=function(e){return this.setFullYear(e+1900)});var _testDate=new Date(Date.UTC(2006,1,20));_testDate.setUTCDate(15),0!=_testDate.getUTCHours()&&forEach.csv("FullYear,Month,Date,Hours,Minutes,Seconds,Milliseconds",function(e){extend(Date.prototype,"setUTC"+e,function(){var e=base(this,arguments);return 57722401e3<=e&&this.setTime(e-=36e5),e})}),Function.prototype.prototype={},"$"=="".replace(/^/,K("$$"))&&extend(String.prototype,"replace",function(e,t){var n;return"function"==typeof t&&(n=t,t=function(){return String(n.apply(null,arguments)).split("$").join("$$")}),this.base(e,t)});var Array2=_createObject2(Array,Array,"concat,join,pop,push,reverse,shift,slice,sort,splice,unshift",Enumerable,{combine:function(e,i){return i=i||e,Array2.reduce(e,function(e,t,n){return e[t]=i[n],e},{})},contains:function(e,t){return-1!=Array2.indexOf(e,t)},copy:function(e){e=_slice.call(e);return e.swap||Array2(e),e},flatten:function(e){var n=0;return Array2.reduce(e,function(e,t){return Array2.like(t)?Array2.reduce(t,arguments.callee,e):e[n++]=t,e},[])},forEach:_Array_forEach,indexOf:function(e,t,n){var i=e.length;null==n?n=0:n<0&&(n=Math.max(0,i+n));for(var a=n;a<i;a++)if(e[a]===t)return a;return-1},insertAt:function(e,t,n){return Array2.splice(e,t,0,n),n},item:function(e,t){return t<0&&(t+=e.length),e[t]},lastIndexOf:function(e,t,n){var i=e.length;null==n?n=i-1:n<0&&(n=Math.max(0,i+n));for(var a=n;0<=a;a--)if(e[a]===t)return a;return-1},map:function(n,i,a){var r=[];return Array2.forEach(n,function(e,t){r[t]=i.call(a,e,t,n)}),r},remove:function(e,t){t=Array2.indexOf(e,t);-1!=t&&Array2.removeAt(e,t)},removeAt:function(e,t){Array2.splice(e,t,1)},swap:function(e,t,n){t<0&&(t+=e.length),n<0&&(n+=e.length);var i=e[t];return e[t]=e[n],e[n]=i,e}});Array2.reduce=Enumerable.reduce,Array2.like=function(e){return"object"==typeOf(e)&&"number"==typeof e.length},Enumerable["#implemented_by"].pop(),Enumerable["#implemented_by"].push(Array2);var _DATE_PATTERN=/^((-\d+|\d{4,})(-(\d{2})(-(\d{2}))?)?)?T((\d{2})(:(\d{2})(:(\d{2})(\.(\d{1,3})(\d)?\d*)?)?)?)?(([+-])(\d{2})(:(\d{2}))?|Z)?$/,_DATE_PARTS={FullYear:2,Month:4,Date:6,Hours:8,Minutes:10,Seconds:12,Milliseconds:14},_TIMEZONE_PARTS={Hectomicroseconds:15,UTC:16,Sign:17,Hours:18,Minutes:20},_TRIM_ZEROES=/(((00)?:0+)?:0+)?\.0+$/,_TRIM_TIMEZONE=/(T[0-9:.]+)$/,Date2=_createObject2(Date,function(e,t,n,i,a,r,s){switch(arguments.length){case 0:return new Date;case 1:return"number"==typeof e?new Date(e):Date2.parse(e);default:return new Date(e,t,2==arguments.length?1:n,i||0,a||0,r||0,s||0)}},"",{toISOString:function(n){var i,e="####-##-##T##:##:##.###";for(i in _DATE_PARTS)e=e.replace(/#+/,function(e){var t=n["getUTC"+i]();return"Month"==i&&t++,("000"+t).slice(-e.length)});return e.replace(_TRIM_ZEROES,"").replace(_TRIM_TIMEZONE,"$1Z")}});delete Date2.forEach,Date2.now=function(){return(new Date).valueOf()},Date2.parse=function(e,t){1<arguments.length&&assertType(t,"number","default date should be of type 'number'.");var n=match(e,_DATE_PATTERN);if(n.length){n[_DATE_PARTS.Month]&&n[_DATE_PARTS.Month]--,5<=n[_TIMEZONE_PARTS.Hectomicroseconds]&&n[_DATE_PARTS.Milliseconds]++;var i,a,r,s=new Date(t||0),o=n[_TIMEZONE_PARTS.UTC]||n[_TIMEZONE_PARTS.Hours]?"UTC":"";for(i in _DATE_PARTS){var l=n[_DATE_PARTS[i]];if(l&&(s["set"+o+i](l),s["get"+o+i]()!=n[_DATE_PARTS[i]]))return NaN}return n[_TIMEZONE_PARTS.Hours]&&(a=Number(n[_TIMEZONE_PARTS.Sign]+n[_TIMEZONE_PARTS.Hours]),r=Number(n[_TIMEZONE_PARTS.Sign]+(n[_TIMEZONE_PARTS.Minutes]||0)),s.setUTCMinutes(s.getUTCMinutes()+60*a+r)),s.valueOf()}return Date.parse(e)};var String2=_createObject2(String,function(e){return new String(0==arguments.length?"":e)},"charAt,charCodeAt,concat,indexOf,lastIndexOf,match,replace,search,slice,split,substr,substring,toLowerCase,toUpperCase",{csv:csv,format:format,rescape:rescape,trim:trim});function trim(e){return String(e).replace(_LTRIM,"").replace(_RTRIM,"")}function csv(e){return e?(e+"").split(/\s*,\s*/):[]}function format(e){var n=arguments,t=new RegExp("%([1-"+(arguments.length-1)+"])","g");return(e+"").replace(t,function(e,t){return n[t]})}function match(e,t){return(e+"").match(t)||[]}function rescape(e){return(e+"").replace(_RESCAPE,"\\$1")}delete String2.forEach;var Function2=_createObject2(Function,Function,"",{I:I,II:II,K:K,bind:bind,compose:compose,delegate:delegate,flip:flip,not:not,partial:partial,unbind:unbind});function I(e){return e}function II(e,t){return t}function K(e){return function(){return e}}function bind(e,t){var n="function"!=typeof e;if(2<arguments.length){var i=_slice.call(arguments,2);return function(){return(n?t[e]:e).apply(t,i.concat.apply(i,arguments))}}return function(){return(n?t[e]:e).apply(t,arguments)}}function compose(){var n=_slice.call(arguments);return function(){for(var e=n.length,t=n[--e].apply(this,arguments);e--;)t=n[e].call(this,t);return t}}function delegate(t,n){return function(){var e=_slice.call(arguments);return e.unshift(this),t.apply(n,e)}}function flip(e){return function(){return e.apply(this,Array2.swap(arguments,0,1))}}function not(e){return function(){return!e.apply(this,arguments)}}
1function partial(i){var a=_slice.call(arguments,1);return function(){for(var e=a.concat(),t=0,n=0;t<a.length&&n<arguments.length;)void 0===e[t]&&(e[t]=arguments[n++]),t++;for(;n<arguments.length;)e[t++]=arguments[n++];return Array2.contains(e,void 0)?(e.unshift(i),partial.apply(null,e)):i.apply(this,e)}}function unbind(t){return function(e){return t.apply(e,_slice.call(arguments,1))}}function detect(){var e,a,t,r=NaN,s=!!global.java;global.navigator&&(e=/MSIE[\d.]+/g,a=document.createElement("span"),t=navigator.userAgent.replace(/([a-z])[\s\/](\d)/gi,"$1$2"),r||(t=t.replace(e,"")),e.test(t)&&(t=t.match(e)[0]+" "+t.replace(e,"")),base2.userAgent=navigator.platform+" "+t.replace(/like \w+/gi,""),s&=navigator.javaEnabled());var o={};return(detect=function(e){if(null==o[e]){var t=!1,n=e,i="!"==n.charAt(0);if("("==(n=i?n.slice(1):n).charAt(0))try{t=new Function("element,jscript,java,global","return !!"+n)(a,r,s,global)}catch(e){}else t=new RegExp("("+n+")","i").test(base2.userAgent);o[e]=!!(i^t)}return o[e]})(arguments[0])}var base2=global.base2=new Package(this,base2),exports=this.exports,lang=new Package(this,lang);exports+=this.exports,JavaScript=new Package(this,JavaScript),eval(exports+this.exports),lang.base=base,lang.extend=extend},new function(_no_shrink_){var DOM=new base2.Package(this,{name:"DOM",version:"1.0.1",imports:"Function2",exports:"Interface,Binding,Node,Document,Element,AbstractView,HTMLDocument,HTMLElement,Selector,Traversal,CSSParser,XPathParser,NodeSelector,DocumentSelector,ElementSelector,StaticNodeList,Event,EventTarget,DocumentEvent,ViewCSS,CSSStyleDeclaration,ClassList",bind:function(e){if(e&&e.nodeType){var t=assignID(e);if(!DOM.bind[t]){switch(e.nodeType){case 1:("string"==typeof e.className?HTMLElement.bindings[e.tagName]||HTMLElement:Element).bind(e);break;case 9:(e.writeln?HTMLDocument:Document).bind(e);break;default:Node.bind(e)}DOM.bind[t]=!0}}return e},"@MSIE5.+win":{bind:function(e){return e&&e.writeln&&(e.nodeType=9),this.base(e)}}});eval(this.imports);var _MSIE=detect("MSIE"),_MSIE5=detect("MSIE5"),Interface=Module.extend(null,{forEach:function(n,i){forEach(this,function(e,t){"function"==typeOf(e)&&(this.prototype[t]||e._delegate)&&n.call(i,e,t,this)},this,Module)},implement:function(e){if("object"==typeof e)_createDelegates(this,e);else if(Interface.ancestorOf(e))for(var t in e)e[t]&&e[t]._delegate&&(this[t]=bind(t,e),this[t]._delegate=t);return this.base(e)}});function _createDelegates(e,t){var n,i=e.toString().slice(1,-1);for(n in t){var a=t[n];"@"==n.charAt(0)?_createDelegates(e,a):!e[n]&&"function"==typeof a&&a.call&&(a="abcdefghij".slice(0,a.length).split(""),e[(a=new Function(a.join(","),format("%2.base=%2.%1.ancestor;var m=%2.base?'base':'%1';return %2[m](%3)",n,a[0],a.slice(1))))._delegate=n]=a,e.namespace+="var "+n+"=base2.lang.bind('"+n+"',"+i+");")}}var Binding=Interface.extend(null,{extend:function(e,t){var n;t&&t.bind!=Function.bind&&(n=t.bind,delete t.bind);t=this.base(e,t);return t.bind=this.bind,n&&extend(t,"bind",n),t},bind:function(e){return extend(e,this.prototype)}}),Node=Binding.extend({"@!(element.compareDocumentPosition)":{compareDocumentPosition:function(e,t){if(Traversal.contains(e,t))return 20;if(Traversal.contains(t,e))return 10;e=_getSourceIndex(e),t=_getSourceIndex(t);return e<t?4:t<e?2:0}}},{"@Gecko":{bind:function(e){return extend(this.base(e),"removeEventListener",function(){var e=Array2.slice(arguments);e.unshift(this),EventTarget.removeEventListener.apply(EventTarget,e)})}}}),_getSourceIndex=document.documentElement.sourceIndex?function(e){return e.sourceIndex}:function(e){for(var t=0;e;)t=Traversal.getNodeIndex(e)+"."+t,e=e.parentNode;return t},Document=Node.extend(null,{bind:function(e){return extend(e,"createElement",function(e){return DOM.bind(this.base(e))}),AbstractView.bind(e.defaultView),e!=window.document&&new DOMContentLoadedEvent(e),this.base(e)},"@!(document.defaultView)":{bind:function(e){return e.defaultView=Traversal.getDefaultView(e),this.base(e)}}}),_ATTRIBUTES={class:"className",for:"htmlFor"},Element=Node.extend({"@MSIE.+win":{getAttribute:function(element,name){if(void 0===element.className)return this.base(element,name);var attribute=_getAttributeNode(element,name);if(attribute&&(attribute.specified||"value"==name))return"href"==name||"src"==name?(element.base=element.getAttribute.ancestor,element[element.base?"base":"getAttribute"](name,2)):"style"==name?element.style.cssText.toLowerCase():attribute.no
1deValue;if("type"!=name||"INPUT"!=element.nodeName)return null;var outerHTML=element.outerHTML;with(outerHTML)outerHTML=slice(0,indexOf(">")+1);return match(outerHTML,/type="?([^\s">]*)"?/i)[1]||null},removeAttribute:function(e,t){void 0!==e.className&&(t=_ATTRIBUTES[t.toLowerCase()]||t),this.base(e,t)},setAttribute:function(e,t,n){var i;void 0===e.className?this.base(e,t,n):"style"==t?e.style.cssText=n:(n=String(n),(i=_getAttributeNode(e,t))?i.nodeValue=n:this.base(e,_ATTRIBUTES[t.toLowerCase()]||t,n))}},"@!(element.hasAttribute)":{hasAttribute:function(e,t){return void 0===e.className?this.base(e,t):null!=this.getAttribute(e,t)}}});detect("MSIE.+win")&&extend(Element.prototype,"cloneNode",function(e){e=this.base(e||!1);return e.base2ID=void 0,e});var _HTML_ATTRIBUTES="colSpan,rowSpan,vAlign,dateTime,accessKey,tabIndex,encType,maxLength,readOnly,longDesc";extend(_ATTRIBUTES,Array2.combine(_HTML_ATTRIBUTES.toLowerCase().split(","),_HTML_ATTRIBUTES.split(",")));var _getAttributeNode=document.documentElement.getAttributeNode?function(e,t){return e.getAttributeNode(t)}:function(e,t){return e.attributes[t]||e.attributes[_ATTRIBUTES[t.toLowerCase()]]},TEXT=detect("(element.textContent===undefined)")?"innerText":"textContent",Traversal=Module.extend({getDefaultView:function(e){return this.getDocument(e).defaultView},getNextElementSibling:function(e){for(;(e=e&&e.nextSibling)&&!this.isElement(e);)continue;return e},getNodeIndex:function(e){for(var t=0;e=e&&e.previousSibling;)t++;return t},getOwnerDocument:function(e){return e.ownerDocument},getPreviousElementSibling:function(e){for(;(e=e&&e.previousSibling)&&!this.isElement(e);)continue;return e},getTextContent:function(e,t){return e[t?"innerHTML":TEXT]},isEmpty:function(e){for(e=e.firstChild;e;){if(3==e.nodeType||this.isElement(e))return!1;e=e.nextSibling}return!0},setTextContent:function(e,t,n){return e[n?"innerHTML":TEXT]=t},"@!MSIE":{setTextContent:function(node,text,isHTML){with(node)for(;lastChild;)parentNode.removeChild(lastChild);return this.base(node,text,isHTML)}},"@MSIE":{getDefaultView:function(e){return(e.document||e).parentWindow},"@MSIE5":{getOwnerDocument:function(e){return e.ownerDocument||e.document}}}},{contains:function(e,t){for(e.nodeType;(t=t&&t.parentNode)&&e!=t;)continue;return!!t},getDocument:function(e){return this.isDocument(e)?e:e.ownerDocument||e.document},isDocument:function(e){return!(!e||!e.documentElement)},isElement:function(e){return!(!e||1!=e.nodeType)},"@(element.contains)":{contains:function(e,t){return e!=t&&(this.isDocument(e)?e==this.getOwnerDocument(t):e.contains(t))}},"@MSIE5":{isElement:function(e){return!(!e||1!=e.nodeType||"!"==e.nodeName)}}}),AbstractView=Binding.extend(),_CAPTURE_TYPE={},_TYPE_MAP={2:2,4:1},_CAPTURING_PHASE=1,_AT_TARGET=2,_BUBBLING_PHASE=3,_MOUSE_BUTTON=/^mouse(up|down)|click$/,_MOUSE_CLICK=/click$/,_BUBBLES="abort|error|select|change|resize|scroll|",_CANCELABLE="(dbl)?click|mouse(down|up|over|move|out|wheel)|key(down|up)|submit|reset",_W3C_EVENT_TYPE,_CAPTURE_TYPE,_BUBBLES=new RegExp("^("+_BUBBLES+_CANCELABLE+")$"),_CANCELABLE=new RegExp("^("+_CANCELABLE+")$");_MSIE&&(_W3C_EVENT_TYPE={focusin:"focus",focusout:"blur"},_CAPTURE_TYPE={focus:"focusin",blur:"focusout"});var _CAN_DELEGATE=/^(blur|submit|reset|change|select)$|^(mouse|key|focus)|click$/,Event=Binding.extend({"@!(document.createEvent)":{initEvent:function(e,t,n,i){e.type=String(t),e.bubbles=!!n,e.cancelable=!!i},preventDefault:function(e){!1!==e.cancelable&&(e.returnValue=!1)},stopPropagation:function(e){e.cancelBubble=!0},"@MSIE":{preventDefault:function(e){var t,n;this.base(e),"mousedown"==e.type&&(t="onbeforedeactivate",(n=Traversal.getDocument(e.target)).attachEvent(t,function(e){e.returnValue=!1,n.detachEvent(t,arguments.callee)}))}}}},{CAPTURING_PHASE:_CAPTURING_PHASE,AT_TARGET:_AT_TARGET,BUBBLING_PHASE:_BUBBLING_PHASE,"@!(document.createEvent)":{"@MSIE":{bind:function(e){var t=e.type;return e.timeStamp||(e.bubbles=_BUBBLES.test(t),e.cancelable=_CANCELABLE.test(t),e.timeStamp=(new Date).valueOf()),e.relatedTarget=e[(e.target==e.fromElement?"to":"from")+"Element"],this.base(e)}}},cloneEvent:function(e){var t=copy(e);return t.stopPropagation=function(){e.stopPropagation()},t.preventDefault=function(){e.preventDefault()},t},"@MSIE":{cloneEvent:copy}}),EventDispatcher=Base.extend({constructor:function(e){this.state=e,this.events=e.events},dispatch:function(e,t,n){t.eventPhase=n;var i=this.events[t.type][n];if(i)for(var a=e.length;a--&&!t.cancelBubble;){var r=e[a],s=i[r.base2ID];if(s)for(var o in s=copy(s),t.currentTarget=r,t.eventPhase=r==t.target?_AT_TARGET:n,s){o=s[o];"function"==typeof o?o.call(r,t):o.handleEvent(t)}}},handleEvent:function(e,t){Event.bind(e);var n=e.type,i=_W3C_EVENT_TYPE[n];if(i&&(n=(e=copy(e)).type=i),this.events[n]){_MOUSE_BUTTON.test(n)&&(n=_MOUSE_CLICK.test(n)?this.state._button:e.button,n=_TYPE_MAP[n]||0,e.button!=n&&((e=copy(e)).button=n));for(var a=e.target,r=[],s=0;a;)a=(r[s++]=a).parentNode;this.dispatch(r,e,_CAPTURING_PHASE),e.cancelBubble||(e.bubbles||(r.length=1),r.reverse(),this.dispatch(r,e,_BUBBLING_PHASE))}return!1!==e.returnValue},"@MSIE.+win":{handleEvent:function(e){return"scroll"==e.type?(setTimeout(bind(this.base,this,copy(e),!0),0),!0):this.base(e)},"@MSIE5":{dispatch:function(e,t,n){n!=_CAPTURING_PHASE||Array2.item(e,-1).documentElement||e.push(e[0].document),this.base(e,t,n)}}}}),_wrappedListeners={},EventTarget=Interface.extend({"@!(element.addEventListener)":{addEventListener:function(e,t,n,i){var a=DocumentState.getInstance(e),r=assignID(e),s=assignID(n),o=i?_CAPTURING_PHASE:_BUBBLING_PHASE,a=a.registerEvent(t,e),e=(e=a[o])||(a[o]={});i&&(t=_CAPTURE_TYPE[t]||t),(e[r]||(e[r]={}))[s]=n},dispatchEvent:function(e,t){return t.target=e,DocumentState.getInstance(e).handleEvent(t)},removeEventListener:function(e,t,n,i){t=DocumentState.getInstance(e).events[t];t&&(!(i=t[i?_CAPTURING_PHASE:_BUBBLING_PHASE])||(e=i[e.base2ID])&&delete e[n.base2ID])}},"@(element.addEventListener)":{"@Gecko":{addEventListener:function(t,e,n,i){var a;"mousewheel"==e&&(e="DOMMouseScroll",a=n,n=_wrappedListeners[assignID(n)]=function(e){(e=Event.cloneEvent(e)).type="mousewheel",e.wheelDelta=40*-e.detail||0,_handleEvent(t,a,e)}),this.base(t,e,n,i)}},"@webkit[1-4]|KHTML[34]":{addEventListener:function(n,e,t,i){var a;_MOUSE_BUTTON.test(e)?(a=t,t=_wrappedListeners[assignID(t)]=function(e){var t=_TYPE_MAP[e.button]||0;e.button!=t&&((e=Event.cloneEvent(e)).button=t),_handleEvent(n,a,e)}):"object"==typeof t&&(t=_wrappedListeners[assignID(t)]=bind("handleEvent",t)),this.base(n,e,t,i)}},"@Linux|Mac|opera":{addEventListener:function(a,e,t,n){var r;"keydown"==e&&(r=t,t=_wrappedListeners[assignID(t)]=function(t){var n=0,i=!1;function e(e){i&&e.preventDefault(),(e==t||1<n)&&_handleEvent(a,r,t),n++}extend(t,"preventDefault",function(){this.base(),i=!0}),e(t),a.addEventListener("keyup",function(){a.removeEventListener("keypress",e,!0),a.removeEventListener("keyup",arguments.callee,!0)},!0),a.addEventListener("keypress",e,!0)}),this.base(a,e,t,n)}},removeEventListener:function(e,t,n,i){this.base(e,t,_wrappedListeners[n.base2ID]||n,i)}}});function _handleEvent(e,t,n){"function"==typeof t?t.call(e,n):t.handleEvent(n)}detect("Gecko")&&(EventTarget.removeEventListener._delegate="removeEventListener",delete EventTarget.prototype.removeEventListener);var DocumentEvent=Interface.extend({"@!(document.createEvent)":{createEvent:function(e,t){var n=e.createEventObject?e.createEventObject():{};return n.bubbles=!1,n.cancelable=!1,n.eventPhase=0,n.target=e,n.currentTarget=null,n.relatedTarget=null,n.timeStamp=(new Date).valueOf(),Event(n)}},"@(document.createEvent)":{"@!(document.createEvent('Events'))":{createEvent:function(e,t){return this.base(e,"Events"==t?"UIEvents":t)}}}}),DOMContentLoadedEvent=Base.extend({constructor:function(t){var e=!1;this.fire=function(){e||(e=!0,setTimeout(function(){var e=DocumentEvent.createEvent(t,"Events");Event.initEvent(e,"DOMContentLoaded",!0,!1),EventTarget.dispatchEvent(t,e)},1))},EventTarget.addEventListener(t,"DOMContentLoaded",function(){e=!0},!1),this.listen(t)},listen:Undefined,"@!Gecko20([^0]|0[3-9])|Webkit52[5-9]|Webkit5[3-9]|Webkit[6-9]|Opera[19]|MSIE.+mac":{listen:function(e){EventTarget.addEventListener(Traversal.getDefaultView(e),"load",this.fire,!1)},"@MSIE.+win":{listen:function(t){try{t.body.doScroll("left"),this.__constructing||this.fire()}catch(e){setTimeout(bind(this.listen,this,t),10)}}},"@KHTML":{listen:function(e){/loaded|complete/.test(e.readyState)?this.__constructing||this.fire():setTimeout(bind(this.listen,this,e),10)}}}});Document.implement(DocumentEvent),Document.implement(EventTarget),Element.implement(EventTarget);var _PIXEL=/^\d+(px)?$/i,_METRICS=/(width|height|top|bottom|left|right|fontSize)$/,_COLOR=/^(color|backgroundColor)$/,_RGB_BLACK="rgb(0, 0, 0)",_BLACK={black:1,"#000":1,"#000000":1},ViewCSS=Interface.extend({"@!(document.defaultView.getComputedStyle)":{"@MSIE":{getComputedStyle:function(e,t,n){var i,a=t.currentStyle,r={};for(i in a)_METRICS.test(i)||_COLOR.test(i)?r[i]=this.getComputedPropertyValue(e,t,i):0!=i.indexOf("ruby")&&(r[i]=a[i]);return r}}},getComputedStyle:function(e,t,n){return _CSSStyleDeclaration_ReadOnly.bind(this.base(e,t,n))}},{getComputedPropertyValue:function(e,t,n){return CSSStyleDeclaration.getPropertyValue(this.getComputedStyle(e,t,null),n)},"@MSIE":{getComputedPropertyValue:function(e,t,n){n=this.toCamelCase(n);var i=t.currentStyle[n];if(_METRICS.test(n))return _MSIE_getPixelValue(t,i)+"px";if(_MSIE5||!_COLOR.test(n))return i;n=_MSIE_getColorValue(t,"color"==n?"ForeColor":"BackColor");return n!=_RGB_BLACK||_BLACK[i]?n:i}},toCamelCase:function(e){return e.replace(/\-([a-z])/g,flip(String2.toUpperCase))}});function _MSIE_getPixelValue(e,t){if(_PIXEL.test(t))return parseInt(t);var n=e.style.left,i=e.runtimeStyle.left;return e.runtimeStyle.left=e.currentStyle.left,e.style.left=t||0,t=e.style.pixelLeft,e.style.left=n,e.runtimeStyle.left=i,t}function _MSIE_getColorValue(e,t){var n;e.createTextRange?n=e.createTextRange():(n=e.document.body.createTextRange()).moveToElementText(e);try{var i=n.queryCommandValue("type")}catch(e){i=0}return format("rgb(%1, %2, %3)",255&i,(65280&i)>>8,(16711680&i)>>16)}var _CSSStyleDeclaration_ReadOnly=Binding.extend({getPropertyValue:function(e,t){return this.base(e,_CSSPropertyNameMap[t]||t)},"@MSIE.+win":{getPropertyValue:function(e,t){return"float"==t?e.styleFloat:e[ViewCSS.toCamelCase(t)]}}}),CSSStyleDeclaration=_CSSStyleDeclaration_ReadOnly.extend({setProperty:function(e,t,n,i){return this.base(e,_CSSPropertyNameMap[t]||t,n,i)},"@MSIE.+win":{setProperty:function(e,t,n,i){"opacity"==t?(e.opacity=n*=100,e.zoom=1,e.filter="Alpha(opacity="+n+")"):"important"==i?e.cssText+=format(";%1:%2!important;",t,n):e.setAttribute(ViewCSS.toCamelCase(t),n)}}},{"@MSIE":{bind:function(e){return e.getPropertyValue=this.prototype.getPropertyValue,e.setProperty=this.prototype.setProperty,e}}}),_CSSPropertyNameMap=new Base({"@Gecko":{opacity:"-moz-opacity"},"@KHTML":{opacity:"-khtml-opacity"}});with(CSSStyleDeclaration.prototype)getPropertyValue.toString=setProperty.toString=K("[base2]");AbstractView.implement(ViewCSS);var NodeSelector=Interface.extend({"@(element.querySelector)":{querySelector:function(e,t){try{var n=this.base(e,trim(t));if(n)return n}catch(e){}return new Selector(t).exec(e,1)},querySelectorAll:function(e,t){try{var n=this.base(e,trim(t));if(n)return new StaticNodeList(n)}catch(e){}return new Selector(t).exec(e)}},"@!(element.querySelector)":{querySelector:function(e,t){return new Selector(t).exec(e,1)},querySelectorAll:function(e,t){return new Selector(t).exec(e)}}});extend(NodeSelector.prototype,{querySelector:function(e){return DOM.bind(this.base(e))},querySelectorAll:function(e){return extend(this.base(e),"item",function(e){return DOM.bind(this.base(e))})}});var DocumentSelector=NodeSelector.extend(),ElementSelector=NodeSelector.extend({"@!(element.matchesSelector)":{matchesSelector:function(e,t){return new Selector(t).test(e)}}}),_CSS_ESCAPE=/'(\\.|[^'\\])*'|"(\\.|[^"\\])*"/g,_CSS_IMPLIED_ASTERISK=/([\s>+~,]|[^(]\+|^)([#.:\[])/g,_CSS_IMPLIED_SPACE=/(^|,)([^\s>+~])/g,_CSS_WHITESPACE=/\s*([\s>+~,]|^|$)\s*/g,_CSS_WILD_CARD=/\s\*\s/g,_CSS_UNESCAPE=/\x01(\d+)/g,_QUOTE=/'/g,CSSParser=RegGrp.extend({constructor:function(e){this.base(e),this.cache={},this.sorter=new RegGrp,this.sorter.add(/:not\([^)]*\)/,RegGrp.IGNORE),this.sorter.add(/([ >](\*|[\w-]+))([^: >+~]*)(:\w+-child(\([^)]+\))?)([^: >+~]*)/,"$1$3$6$4")},cache:null,ignoreCase:!0,escape:function(e,t){var n=this._strings=[];return e=this.optimise(this.format(String(e).replace(_CSS_ESCAPE,function(e){return"�"+n.push(e.slice(1,-1).replace(_QUOTE,"\\'"))}))),e=t?e.replace(/^ \*?/,""):e},format:function(e){return e.replace(_CSS_WHITESPACE,"$1").replace(_CSS_IMPLIED_SPACE,"$1 $2").replace(_CSS_IMPLIED_ASTERISK,"$1*$2")},optimise:function(e){return this.sorter.exec(e.replace(_CSS_WILD_CARD,">* "))},parse:function(e,t){return this.cache[e]||(this.cache[e]=this.unescape(this.exec(this.escape(e,t))))},unescape:function(e){var n=this._strings;return e.replace(_CSS_UNESCAPE,function(e,t){return n[t-1]})}});function _nthChild(e,t,n,i,a,r,s,o){i=/last/i.test(e)?i+"+1-":"",isNaN(t)?"even"==t?t="2n":"odd"==t&&(t="2n+1"):t="0n+"+t;var l=(t=t.split("n"))[0]?"-"==t[0]?-1:parseInt(t[0]):1,e=parseInt(t[1])||0,t=l<0;t&&1==(l=-l)&&e++;o=format(0==l?"%3%7"+(i+e):"(%4%3-%2)%6%1%70%5%4%3>=%2",l,e,n,i,r,s,o);return o=t?a+"("+o+")":o}var XPathParser=CSSParser.extend({constructor:function(){this.base(XPathParser.build()),this.sorter.putAt(1,"$1$4$3$6")},escape:function(e,t){return this.base(e,t).replace(/,/g,"�")},unescape:function(e){return this.base(e.replace(/\[self::\*\]/g,"").replace(/(^|\x02)\//g,"$1./").replace(/\x02/g," | ")).replace(/'[^'\\]*\\'(\\.|[^'\\])*'/g,function(e){return"concat("+e.split("\\'").join("',\"'\",'")+")"})},"@opera(7|8|9\\.[1-4])":{unescape:function(e){return this.base(e.replace(/last\(\)/g,"count(preceding-sibling::*)+count(following-sibling::*)+1"))}}},{build:function(){return this.values.attributes[""]="[@$1]",forEach(this.types,function(e,t){forEach(this.values[t],e,this.rules)},this),this.build=K(this.rules),this.rules},optimised:{pseudoClasses:{"first-child":"[1]","last-child":"[last()]","only-child":"[last()=1]"}},rules:extend({},{"@!KHTML|opera":{"(^|\\x02) (\\*|[\\w-]+)#([\\w-]+)":"$1id('$3')[self::$2]"},"@!KHTML":{"([ >])(\\*|[\\w-]+):([\\w-]+-child(\\(([^)]+)\\))?)":function(e,t,n,i,a,r){t=" "==t?"//*":"/*";return/^nth/i.test(i)?t+=_xpath_nthChild(i,r,"position()"):t+=XPathParser.optimised.pseudoClasses[i],t+"[self::"+n+"]"}}}),types:{identifiers:function(e,t){this[rescape(t)+"([\\w-]+)"]=e},combinators:function(e,t){this[rescape(t)+"(\\*|[\\w-]+)"]=e},attributes:function(e,t){this["\\[\\s*([\\w-]+)\\s*"+rescape(t)+"\\s*([^\\]\\s]*)\\s*\\]"]=e},pseudoClasses:function(e,t){this[":"+t.replace(/\(\)$/,"\\(([^)]+)\\)")]=e}},values:{identifiers:{"#":"[@id='$1'][1]",".":"[contains(concat(' ',@class,' '),' $1 ')]"},combinators:{" ":"/descendant::$1",">":"/child::$1","+":"/following-sibling::*[1][self::$1]","~":"/following-sibling::$1"},attributes:{"*=":"[contains(@$1,'$2')]","^=":"[starts-with(@$1,'$2')]","$=":"[substring(@$1,string-length(@$1)-string-length('$2')+1)='$2']","~=":"[contains(concat(' ',@$1,' '),' $2 ')]","|=":"[contains(concat('-',@$1,'-'),'-$2-')]","!=":"[not(@$1='$2')]","=":"[@$1='$2']"},pseudoClasses:{link:"[false]",visited:"[false]",empty:"[not(child::*) and not(text())]","first-child":"[not(preceding-sibling::*)]","last-child":"[not(following-sibling::*)]","not()":_xpath_not,"nth-child()":_xpath_nthChild,"nth-last-child()":_xpath_nthChild,"only-child":"[not(preceding-sibling::*) and not(following-sibling::*)]",root:"[not(parent::*)]"}},"@opera(7|8|9\\.[1-4])":{build:function(){return this.optimised.pseudoClasses["last-child"]=this.values.pseudoClasses["last-child"],this.optimised.pseudoClasses["only-child"]=this.values.pseudoClasses["only-child"],this.base()}}}),_notParser;
1function _xpath_not(e,t){return"[not("+(_notParser=_notParser||new XPathParser).exec(trim(t)).replace(/\[1\]/g,"").replace(/^(\*|[\w-]+)/,"[self::$1]").replace(/\]\[/g," and ").slice(1,-1)+")]"}function _xpath_nthChild(e,t,n){return"["+_nthChild(e,t,n||"count(preceding-sibling::*)+1","last()","not"," and "," mod ","=")+"]"}var Selector=Base.extend({constructor:function(e){this.toString=K(trim(e))},exec:function(e,t,n){return Selector.parse(this,n)(e,t)},isSimple:function(){return _parser.exec||(_parser=new CSSParser(_parser)),!_COMBINATOR.test(trim(_parser.escape(this)))},test:function(e){if(this.isSimple())return!!Selector.parse(this,!0)(e,1);e.setAttribute("b2-test",!0);var t=new Selector(this+"[b2-test]").exec(Traversal.getOwnerDocument(e),1);return e.removeAttribute("b2-test"),t==e},toXPath:function(e){return Selector.toXPath(this,e)},"@(XPathResult)":{exec:function(e,t,n){if(_NOT_XPATH.test(this))return this.base(e,t,n);var i=1==t?9:7,i=Traversal.getDocument(e).evaluate(this.toXPath(n),e,null,i,null);return 1==t?i.singleNodeValue:i}},"@MSIE":{exec:function(e,t,n){return void 0===e.selectNodes||_NOT_XPATH.test(this)?this.base(e,t,n):e[single?"selectSingleNode":"selectNodes"](this.toXPath(n))}},"@(true)":{exec:function(e,t,n){try{var i=this.base(e||document,t,n)}catch(e){throw new SyntaxError(format("'%1' is not a valid CSS selector.",this))}return 1==t?i:new StaticNodeList(i)}}},{toXPath:function(e,t){return(_xpathParser=_xpathParser||new XPathParser).parse(e,t)}}),_COMBINATOR=/[^,]\s|[+>~]/,_NOT_XPATH=":(checked|disabled|enabled|contains|hover|active|focus)|^(#[\\w-]+\\s*)?\\w+$";detect("KHTML")&&(detect("WebKit5")?_NOT_XPATH+="|nth\\-|,":_NOT_XPATH="."),_NOT_XPATH=new RegExp(_NOT_XPATH),Selector.operators={"=":"%1=='%2'","~=":/(^| )%1( |$)/,"|=":/^%1(-|$)/,"^=":/^%1/,"$=":/%1$/,"*=":/%1/},Selector.operators[""]="%1!=null",Selector.pseudoClasses={checked:"e%1.checked",contains:"e%1[TEXT].indexOf('%2')!=-1",disabled:"e%1.disabled",empty:"Traversal.isEmpty(e%1)",enabled:"e%1.disabled===false","first-child":"!Traversal.getPreviousElementSibling(e%1)","last-child":"!Traversal.getNextElementSibling(e%1)","only-child":"!Traversal.getPreviousElementSibling(e%1)&&!Traversal.getNextElementSibling(e%1)",root:"e%1==Traversal.getDocument(e%1).documentElement",target:"e%1.id&&e%1.id==location.hash.slice(1)",hover:"DocumentState.getInstance(d).isHover(e%1)",active:"DocumentState.getInstance(d).isActive(e%1)",focus:"DocumentState.getInstance(d).hasFocus(e%1)",link:"false",visited:"false"};var _INDEXED=void 0!==document.documentElement.sourceIndex,_VAR="var p%2=0,i%2,e%3,n%2=e%1.",_ID=_INDEXED?"e%1.sourceIndex":"assignID(e%1)",_TEST="var g="+_ID+";if(!p[g]){p[g]=1;",_STORE="r[k++]=e%1;if(s==1)return e%1;if(k===s){_query.state=[%2];_query.complete=%3;return r;",_FN="var _query=function(e0,s%1){_indexed++;var r=[],p={},p0=0,reg=[%4],d=Traversal.getDocument(e0),c=d.writeln?'toUpperCase':'toString',k=0;",_xpathParser,_reg,_index,_wild,_list,_group,_listAll,_duplicate,_cache={},_simple={};function sum(e){for(var t=0,n=0;n<e.length;n++)t+=e[n];return t}var _parser={"^(\\*|[\\w-]+)":function(e,t){return"*"==t?"":format("if(e0.nodeName=='%1'[c]()){",t)},"^ \\*:root":function(e){_wild=!1;return format("e%2=d.documentElement;if(Traversal.contains(e%1,e%2)){",_index++,_index)}," (\\*|[\\w-]+)#([\\w-]+)":function(e,t,n){_wild=!1;var i="var e%2=_byId(d,'%4');if(e%2&&";return"*"!=t&&(i+="e%2.nodeName=='%3'[c]()&&"),i+="Traversal.contains(e%1,e%2)){",_list[_group]&&(i+=format("i%1=n%1.length;",sum(_list))),format(i,_index++,_index,t,n)}," (\\*|[\\w-]+)":function(e,t){_duplicate++,_wild="*"==t;var n=format(_VAR,_index++,"%2",_index);return n+=_wild&&_MSIE5?"all":"getElementsByTagName('%3')",n+=";for(i%2=a%2||0;(e%1=n%2[i%2]);i%2++){",_list[_group]++,format(n,_index,sum(_list),t)},">(\\*|[\\w-]+)":function(e,t){var n=_MSIE&&_index;_wild="*"==t;var i=_VAR+(n?"children":"childNodes"),i=format(i,_index++,"%2",_index);return!_wild&&_MSIE&&n&&(i+=".tags('%3')"),i+=";for(i%2=a%2||0;(e%1=n%2[i%2]);i%2++){",_wild?(i+="if(e%1.nodeType==1){",_wild=_MSIE5):_MSIE&&n||(i+="if(e%1.nodeName=='%3'[c]()){"),_list[_group]++,format(i,_index,sum(_list),t)},"\\+(\\*|[\\w-]+)":function(e,t){var n="";return _wild&&_MSIE&&(n+="if(e%1.nodeName!='!'){"),_wild=!1,n+="e%1=Traversal.getNextElementSibling(e%1);if(e%1","*"!=t&&(n+="&&e%1.nodeName=='%2'[c]()"),n+="){",format(n,_index,t)},"~(\\*|[\\w-]+)":function(e,t){var n="";return _wild&&_MSIE&&(n+="if(e%1.nodeName!='!'){"),_wild=!1,_duplicate=2,n+="while(e%1=e%1.nextSibling){if(e%1.b2_adjacent==_indexed)break;if(","*"==t?(n+="e%1.nodeType==1",_MSIE5&&(n+="&&e%1.nodeName!='!'")):n+="e%1.nodeName=='%2'[c]()",n+="){e%1.b2_adjacent=_indexed;",format(n,_index,t)},"#([\\w-]+)":function(e,t){_wild=!1;var n="if(e%1.id=='%2'){";return _list[_group]&&(n+=format("i%1=n%1.length;",sum(_list))),format(n,_index,t)},"\\.([\\w-]+)":function(e,t){return _wild=!1,_reg.push(new RegExp("(^|\\s)"+rescape(t)+"(\\s|$)")),format("if(e%1.className&®[%2].test(e%1.
1className)){",_index,_reg.length-1)},":not\\((\\*|[\\w-]+)?([^)]*)\\)":function(e,t,n){t=t&&"*"!=t?format("if(e%1.nodeName=='%2'[c]()){",_index,t):"";return"if(!"+(t+=_parser.exec(n)).slice(2,-1).replace(/\)\{if\(/g,"&&")+"){"},":nth(-last)?-child\\(([^)]+)\\)":function(e,t,n){_wild=!1,t=format("e%1.parentNode.b2_length",_index);return format("if(p%1!==e%1.parentNode)p%1=_register(e%1.parentNode);var i=e%1[p%1.b2_lookup];if(p%1.b2_lookup!='b2_index')i++;if(",_index)+_nthChild(e,n,"i",t,"!","&&","% ","==")+"){"},":([\\w-]+)(\\(([^)]+)\\))?":function(e,t,n,i){return"if("+format(Selector.pseudoClasses[t]||"throw",_index,i||"")+"){"},"\\[\\s*([\\w-]+)\\s*([^=]?=)?\\s*([^\\]\\s]*)\\s*\\]":function(e,t,n,i){i=trim(i),a=_MSIE?"Element.getAttribute(e%1,'%2')":"e%1.getAttribute('%2')";var a=format(a,_index,t),n=Selector.operators[n||""];return instanceOf(n,RegExp)&&(_reg.push(new RegExp(format(n.source,rescape(_parser.unescape(i))))),n="reg[%2].test(%1)",i=_reg.length-1),"if("+format(n,a,i)+"){"}};!function(_no_shrink_){var _byId=detect("MSIE[5-7]")?function(e,t){var n=e.all[t]||null;if(!n||n.id==t)return n;for(var i=0;i<n.length;i++)if(n[i].id==t)return n[i];return null}:function(e,t){return e.getElementById(t)},_indexed=1;function _register(e){if(e.rows)e.b2_length=e.rows.length,e.b2_lookup="rowIndex";else if(e.cells)e.b2_length=e.cells.length,e.b2_lookup="cellIndex";else if(e.b2_indexed!=_indexed){for(var t=0,n=e.firstChild;n;)1==n.nodeType&&"!"!=n.nodeName&&(n.b2_index=++t),n=n.nextSibling;e.b2_length=t,e.b2_lookup="b2_index"}return e.b2_indexed=_indexed,e}Selector.parse=function(selector,simple){var cache=simple?_simple:_cache;if(!cache[selector]){_parser.exec||(_parser=new CSSParser(_parser)),_reg=[],_list=[];var fn="",selectors=_parser.escape(selector,simple).split(",");for(_group=0;_group<selectors.length;_group++){_wild=_index=_list[_group]=0,_duplicate=1<selectors.length?2:0;var block=_parser.exec(selectors[_group])||"throw;";_wild&&_MSIE&&(block+=format("if(e%1.tagName!='!'){",_index));var store=1<_duplicate?_TEST:"";block+=format(store+_STORE,_index,"%2"),block+=Array(match(block,/\{/g).length+1).join("}"),fn+=block}fn=_parser.unescape(fn),1<selectors.length&&(fn+="r.unsorted=1;");for(var args="",state=[],total=sum(_list),i=1;i<=total;i++)args+=",a"+i,state.push("i"+i+"?(i"+i+"-1):0");if(total)for(var complete=[],k=0,i=0;i<_group;i++)k+=_list[i],_list[i]&&complete.push(format("n%1&&i%1==n%1.length",k));fn+="_query.state=[%2];_query.complete=%3;return s==1?null:r}",eval(format(_FN+fn,args,state.join(","),!total||complete.join("&&"),_reg)),cache[selector]=_query}return cache[selector]}}();var StaticNodeList=Base.extend({constructor:function(t){t=t||[],this.length=t.length,this.item=function(e){return e<0&&(e+=this.length),t[e]},t.unsorted&&t.sort(_SORTER)},length:0,forEach:function(e,t){for(var n=0;n<this.length;n++)e.call(t,this.item(n),n,this)},item:Undefined,not:function(e,t){return this.filter(not(e),t)},slice:function(e,t){return new StaticNodeList(this.map(I).slice(e,t))},"@(XPathResult)":{constructor:function(t){t&&t.snapshotItem?(this.length=t.snapshotLength,this.item=function(e){return e<0&&(e+=this.length),t.snapshotItem(e)}):this.base(t)}}});StaticNodeList.implement(Enumerable);var _matchesSelector=function(e,t){return"function"!=typeof e&&(e=bind("test",new Selector(e))),this.base(e,t)};StaticNodeList.implement({every:_matchesSelector,filter:_matchesSelector,not:_matchesSelector,some:_matchesSelector}),StaticNodeList.implement({filter:function(e,t){return new StaticNodeList(this.base(e,t))}});var _SORTER=_INDEXED?function(e,t){return e.sourceIndex-t.sourceIndex}:function(e,t){return(2&Node.compareDocumentPosition(e,t))-1};Document.implement(DocumentSelector),Element.implement(ElementSelector);var HTMLDocument=Document.extend(null,{bind:function(e){return DocumentState.createState(e),this.base(e)}}),HTMLElement=Element.extend(null,{bindings:{},tags:"*",bind:function(e){return e.classList||(e.classList=new _ElementClassList(e)),e.ownerDocument||(e.ownerDocument=Traversal.getOwnerDocument(e)),this.base(e)},extend:function(){var t=base(this,arguments);return forEach.csv(t.tags,function(e){HTMLElement.bindings[e]=t}),t}});HTMLElement.extend(null,{tags:"APPLET,EMBED",bind:I});var ClassList=Module.extend({add:function(e,t){this.has(e,t)||(e.className+=(e.className?" ":"")+t)},has:function(e,t){return new RegExp("(^|\\s)"+t+"(\\s|$)").test(e.className)},remove:function(e,t){t=new RegExp("(^|\\s)"+t+"(\\s|$)","g");e.className=trim(e.className.replace(t,"$2"))},toggle:function(e,t){this[this.has(e,t)?"remove":"add"](e,t)}});function _ElementClassList(t){this.add=function(e){ClassList.add(t,e)},this.has=function(e){return ClassList.has(t,e)},this.remove=function(e){ClassList.remove(t,e)}}_ElementClassList.prototype.toggle=function(e){this[this.has(e)?"remove":"add"](e)};var DocumentState=Base.extend({constructor:function(e){this.document=e,this.events={},this._hoverElement=e.documentElement,this.isBound=function(){return!!DOM.bind[e.base2ID]}
1,forEach(this,function(e,t,n){/^on((DOM)?\w+|[a-z]+)$/.test(t)&&n.registerEvent(t.slice(2))})},includes:function(e,t){return t&&(e==t||Traversal.contains(e,t))},hasFocus:function(e){return e==this._focusElement},isActive:function(e){return this.includes(e,this._activeElement)},isHover:function(e){return this.includes(e,this._hoverElement)},handleEvent:function(e){return this["on"+e.type](e)},onblur:function(e){delete this._focusElement},onmouseover:function(e){this._hoverElement=e.target},onmouseout:function(e){delete this._hoverElement},onmousedown:function(e){this._activeElement=e.target},onfocus:function(e){this._focusElement=e.target},onmouseup:function(e){delete this._activeElement},registerEvent:function(e){this.document.addEventListener(e,this,!0),this.events[e]=!0},"@(document.activeElement===undefined)":{constructor:function(e){this.base(e),this.isBound()&&(e.activeElement=e.body)},onfocus:function(e){this.base(e),this.isBound()&&(this.document.activeElement=this._focusElement)},onblur:function(e){this.base(e),this.isBound()&&(this.document.activeElement=this.document.body)}},"@!(element.addEventListener)":{constructor:function(t){this.base(t);var n=new EventDispatcher(this);this._dispatch=function(e){e.target=e.target||e.srcElement||t,n.handleEvent(e)},this.handleEvent=function(e){return this["on"+e.type]&&this["on"+e.type](e),n.handleEvent(e)}},registerEvent:function(e,t){var n,i=this.events[e],a=_CAN_DELEGATE.test(e);return i&&a||(i=i||(this.events[e]={}),!a&&t||(t=this.document),n=this,t["on"+e]=function(e){(e=e||Traversal.getDefaultView(this).event)&&n.handleEvent(e)}),i},"@MSIE.+win":{constructor:function(e){this.base(e);var n={};this._registerForm=function(e){var t=assignID(e);n[t]||(n[t]=!0,e.attachEvent("onsubmit",this._dispatch),e.attachEvent("onreset",this._dispatch))}},fireEvent:function(e,t){(t=copy(t)).type=e,this.handleEvent(t)},registerEvent:function(t,e){var n,i=this.events[t],a=_CAN_DELEGATE.test(t);return i&&a||(i=i||(this.events[t]={}),!a&&e||(e=this.document),n=this,e.attachEvent("on"+t,function(e){e.target=e.srcElement||n.document,n.handleEvent(e),n["after"+t]&&n["after"+t](e)})),i},onDOMContentLoaded:function(e){forEach(e.target.forms,this._registerForm,this);try{this.setFocus(this.document.activeElement)}catch(e){}},onmousedown:function(e){this.base(e),this._button=e.button},onmouseup:function(e){this.base(e),null==this._button&&this.fireEvent("mousedown",e),delete this._button},aftermouseup:function(){this._selectEvent&&(this._dispatch(this._selectEvent),delete this._selectEvent)},onfocusin:function(e){this.setFocus(e.target),this.onfocus(e)},setFocus:function(t){var n,i,e,a=this.events.change,r=this.events.select;(a||r)&&(n=this._dispatch,a&&t.attachEvent("onchange",n),r&&(i=this,e=function(e){i._activeElement==t?i._selectEvent=copy(e):n(e)},t.attachEvent("onselect",e)),t.attachEvent("onblur",function(){t.detachEvent("onblur",arguments.callee),a&&t.detachEvent("onchange",n),r&&t.detachEvent("onselect",e)}))},onfocusout:function(e){this.onblur(e)},onclick:function(e){e=e.target;e.form&&this._registerForm(e.form)},ondblclick:function(e){this.fireEvent("click",e)}}}},{init:function(){assignID(document),(DocumentState=this).createState(document),new DOMContentLoadedEvent(document)},createState:function(e){var t=e.base2ID;return this[t]||(this[t]=new this(e)),this[t]},getInstance:function(e){return this[Traversal.getDocument(e).base2ID]}});eval(this.exports)},function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).IMask={})}(this,function(e){"use strict";function s(e){return"string"==typeof e||e instanceof String}function a(e){var t;return"object"==typeof e&&null!=e&&"Object"===(null==e||null==(t=e.constructor)?void 0:t.name)}const c={NONE:"NONE",LEFT:"LEFT",FORCE_LEFT:"FORCE_LEFT",RIGHT:"RIGHT",FORCE_RIGHT:"FORCE_RIGHT"};function d(e){switch(e){case c.LEFT:return c.FORCE_LEFT;case c.RIGHT:return c.FORCE_RIGHT;default:return e}}function n(e){return e.replace(/([.*+?^=!:${}()|[\]/\\])/g,"\\$1")}function o(e,t){if(t===e)return!0;var n=Array.isArray(t),i=Array.isArray(e);let a;if(n&&i){if(t.length!=e.length)return!1;for(a=0;a<t.length;a++)if(!o(t[a],e[a]))return!1;return!0}if(n!=i)return!1;if(t&&e&&"object"==typeof t&&"object"==typeof e){n=t instanceof Date,i=e instanceof Date;if(n&&i)return t.getTime()==e.getTime();if(n!=i)return!1;n=t instanceof RegExp,i=e instanceof RegExp;if(n&&i)return t.toString()==e.toString();if(n!=i)return!1;var r=Object.keys(t);for(a=0;a<r.length;a++)if(!Object.prototype.hasOwnProperty.call(e,r[a]))return!1;for(a=0;a<r.length;a++)if(!o(e[r[a]],t[r[a]]))return!1;return!0}return!(!t||!e||"function"!=typeof t||"function"!=typeof e)&&t.toString()===e.toString()}
1class r{constructor(e){for(Object.assign(this,e);this.value.slice(0,this.startChangePos)!==this.oldValue.slice(0,this.startChangePos);)--this.oldSelection.start;if(this.insertedCount)for(;this.value.slice(this.cursorPos)!==this.oldValue.slice(this.oldSelection.end);)this.value.length-this.cursorPos<this.oldValue.length-this.oldSelection.end?++this.oldSelection.end:++this.cursorPos}get startChangePos(){return Math.min(this.cursorPos,this.oldSelection.start)}get insertedCount(){return this.cursorPos-this.startChangePos}get inserted(){return this.value.substr(this.startChangePos,this.insertedCount)}get removedCount(){return Math.max(this.oldSelection.end-this.startChangePos||this.oldValue.length-this.value.length,0)}get removed(){return this.oldValue.substr(this.startChangePos,this.removedCount)}get head(){return this.value.substring(0,this.startChangePos)}get tail(){return this.value.substring(this.startChangePos+this.insertedCount)}get removeDirection(){return!this.removedCount||this.insertedCount?c.NONE:this.oldSelection.end!==this.cursorPos&&this.oldSelection.start!==this.cursorPos||this.oldSelection.end!==this.oldSelection.start?c.LEFT:c.RIGHT}}function g(e,t){return new g.InputMask(e,t)}function i(e){if(null==e)throw new Error("mask property should be defined");return e instanceof RegExp?g.MaskedRegExp:s(e)?g.MaskedPattern:e===Date?g.MaskedDate:e===Number?g.MaskedNumber:Array.isArray(e)||e===Array?g.MaskedDynamic:g.Masked&&e.prototype instanceof g.Masked?e:g.Masked&&e instanceof g.Masked?e.constructor:e instanceof Function?g.MaskedFunction:(console.warn("Mask not found for mask",e),g.Masked)}function f(e){if(!e)throw new Error("Options in not defined");if(g.Masked){if(e.prototype instanceof g.Masked)return{mask:e};const{mask:n=void 0,...i}=e instanceof g.Masked?{mask:e}:a(e)&&e.mask instanceof g.Masked?e:{};if(n){var t=n.mask;return{...function e(t,i){return Array.isArray(i)?e(t,(e,t)=>i.includes(t)):Object.entries(t).reduce((e,t)=>{var[n,t]=t;return i(t,n)&&(e[n]=t),e},{})}(n,(e,t)=>!t.startsWith("_")),mask:n.constructor,_mask:t,...i}}}return a(e)?{...e}:{mask:e}}function v(e){if(g.Masked&&e instanceof g.Masked)return e;const t=f(e),n=i(t.mask);if(!n)throw new Error("Masked class is not found for provided mask "+t.mask+", appropriate module needs to be imported manually before creating mask.");return t.mask===n&&delete t.mask,t._mask&&(t.mask=t._mask,delete t._mask),new n(t)}g.createMask=v;class l{get selectionStart(){let e;try{e=this._unsafeSelectionStart}catch{}return null!=e?e:this.value.length}get selectionEnd(){let e;try{e=this._unsafeSelectionEnd}catch{}return null!=e?e:this.value.length}select(e,t){if(null!=e&&null!=t&&(e!==this.selectionStart||t!==this.selectionEnd))try{this._unsafeSelect(e,t)}catch{}}get isActive(){return!1}}g.MaskElement=l;class t extends l{constructor(e){super(),this.input=e,this._onKeydown=this._onKeydown.bind(this),this._onInput=this._onInput.bind(this),this._onBeforeinput=this._onBeforeinput.bind(this),this._onCompositionEnd=this._onCompositionEnd.bind(this)}get rootElement(){var e,t;return null!=(t=null==(e=(t=this.input).getRootNode)?void 0:e.call(t))?t:document}get isActive(){return this.input===this.rootElement.activeElement}bindEvents(e){this.input.addEventListener("keydown",this._onKeydown),this.input.addEventListener("input",this._onInput),this.input.addEventListener("beforeinput",this._onBeforeinput),this.input.addEventListener("compositionend",this._onCompositionEnd),this.input.addEventListener("drop",e.drop),this.input.addEventListener("click",e.click),this.input.addEventListener("focus",e.focus),this.input.addEventListener("blur",e.commit),this._handlers=e}_onKeydown(e){return this._handlers.redo&&(90===e.keyCode&&e.shiftKey&&(e.metaKey||e.ctrlKey)||89===e.keyCode&&e.ctrlKey)?(e.preventDefault(),this._handlers.redo(e)):this._handlers.undo&&90===e.keyCode&&(e.metaKey||e.ctrlKey)?(e.preventDefault(),this._handlers.undo(e)):void(e.isComposing||this._handlers.selectionChange(e))}_onBeforeinput(e){return"historyUndo"===e.inputType&&this._handlers.undo?(e.preventDefault(),this._handlers.undo(e)):"historyRedo"===e.inputType&&this._handlers.redo?(e.preventDefault(),this._handlers.redo(e)):void 0}_onCompositionEnd(e){this._handlers.input(e)}_onInput(e){e.isComposing||this._handlers.input(e)}unbindEvents(){this.input.removeEventListener("keydown",this._onKeydown),this.input.removeEventListener("input",this._onInput),this.input.removeEventListener("beforeinput",this._onBeforeinput),this.input.removeEventListener("compositionend",this._onCompositionEnd),this.input.removeEventListener("drop",this._handlers.drop),this.input.removeEventListener("click",this._handlers.click),this.input.removeEventListener("focus",this._handlers.focus),this.input.removeEventListener("blur",this._handlers.commit),this._handlers={}}}class u extends(g.HTMLMaskElement=t){constructor(e){super(e),this.input=e}get _unsafeSelectionStart(){return null!=this.input.selectionStart?this.input.selectionStart:this.value.length}get _unsafeSelectionEnd(){return this.input.selectionEnd}_unsafeSelect(e,t){this.input.setSelectionRange(e,t)}get value(){return this.input.value}set value(e){this.input.value=e}}class h extends(g.HTMLMaskElement=t){get _unsafeSelectionStart(){const e=this.rootElement;var t=e.getSelection&&e.getSelection(),n=t&&t.anchorOffset,t=t&&t.focusOffset;return null==t||null==n||n<t?n:t}get _unsafeSelectionEnd(){const e=this.rootElement;var t=e.getSelection&&e.getSelection(),n=t&&t.anchorOffset,t=t&&t.focusOffset;return null==t||null==n||t<n?n:t}_unsafeSelect(e,t){if(this.rootElement.createRange){const n=this.rootElement.createRange();n.setStart(this.input.firstChild||this.input,e),n.setEnd(this.input.last
1Child||this.input,t);const i=this.rootElement,a=i.getSelection&&i.getSelection();a&&(a.removeAllRanges(),a.addRange(n))}}get value(){return this.input.textContent||""}set value(e){this.input.textContent=e}}g.HTMLContenteditableMaskElement=h;class p{constructor(){this.states=[],this.currentIndex=0}get currentState(){return this.states[this.currentIndex]}get isEmpty(){return 0===this.states.length}push(e){this.currentIndex<this.states.length-1&&(this.states.length=this.currentIndex+1),this.states.push(e),this.states.length>p.MAX_LENGTH&&this.states.shift(),this.currentIndex=this.states.length-1}go(e){return this.currentIndex=Math.min(Math.max(this.currentIndex+e,0),this.states.length-1),this.currentState}undo(){return this.go(-1)}redo(){return this.go(1)}clear(){this.states.length=0,this.currentIndex=0}}p.MAX_LENGTH=100;class m{constructor(e,t){this.el=e instanceof l?e:new(e.isContentEditable&&"INPUT"!==e.tagName&&"TEXTAREA"!==e.tagName?h:u)(e),this.masked=v(t),this._listeners={},this._value="",this._unmaskedValue="",this._rawInputValue="",this.history=new p,this._saveSelection=this._saveSelection.bind(this),this._onInput=this._onInput.bind(this),this._onChange=this._onChange.bind(this),this._onDrop=this._onDrop.bind(this),this._onFocus=this._onFocus.bind(this),this._onClick=this._onClick.bind(this),this._onUndo=this._onUndo.bind(this),this._onRedo=this._onRedo.bind(this),this.alignCursor=this.alignCursor.bind(this),this.alignCursorFriendly=this.alignCursorFriendly.bind(this),this._bindEvents(),this._onChange()}maskEquals(e){var t;return null==e||(null==(t=this.masked)?void 0:t.maskEquals(e))}get mask(){return this.masked.mask}set mask(e){if(!this.maskEquals(e))if(e instanceof g.Masked||this.masked.constructor!==i(e)){const t=e instanceof g.Masked?e:v({mask:e});t.unmaskedValue=this.masked.unmaskedValue,this.masked=t}else this.masked.updateOptions({mask:e})}get value(){return this._value}set value(e){this.value!==e&&(this.masked.value=e,this.updateControl("auto"))}get unmaskedValue(){return this._unmaskedValue}set unmaskedValue(e){this.unmaskedValue!==e&&(this.masked.unmaskedValue=e,this.updateControl("auto"))}get rawInputValue(){return this._rawInputValue}set rawInputValue(e){this.rawInputValue!==e&&(this.masked.rawInputValue=e,this.updateControl(),this.alignCursor())}get typedValue(){return this.masked.typedValue}set typedValue(e){this.masked.typedValueEquals(e)||(this.masked.typedValue=e,this.updateControl("auto"))}get displayValue(){return this.masked.displayValue}_bindEvents(){this.el.bindEvents({selectionChange:this._saveSelection,input:this._onInput,drop:this._onDrop,click:this._onClick,focus:this._onFocus,commit:this._onChange,undo:this._onUndo,redo:this._onRedo})}_unbindEvents(){this.el&&this.el.unbindEvents()}_fireEvent(e,t){const n=this._listeners[e];n&&n.forEach(e=>e(t))}get selectionStart(){return this._cursorChanging?this._changingCursorPos:this.el.selectionStart}get cursorPos(){return this._cursorChanging?this._changingCursorPos:this.el.selectionEnd}set cursorPos(e){this.el&&this.el.isActive&&(this.el.select(e,e),this._saveSelection())}_saveSelection(){this.displayValue!==this.el.value&&console.warn("Element value was changed outside of mask. Syncronize mask using `mask.updateValue()` to work properly."),this._selection={start:this.selectionStart,end:this.cursorPos}}updateValue(){this.masked.value=this.el.value,this._value=this.masked.value,this._unmaskedValue=this.masked.unmaskedValue,this._rawInputValue=this.masked.rawInputValue}updateControl(e){var t=this.masked.unmaskedValue,n=this.masked.value,i=this.masked.rawInputValue,a=this.displayValue,r=this.unmaskedValue!==t||this.value!==n||this._rawInputValue!==i;this._unmaskedValue=t,this._value=n,this._rawInputValue=i,this.el.value!==a&&(this.el.value=a),"auto"===e?this.alignCursor():null!=e&&(this.cursorPos=e),r&&this._fireChangeEvents(),this._historyChanging||!r&&!this.history.isEmpty||this.history.push({unmaskedValue:t,selection:{start:this.selectionStart,end:this.cursorPos}})}updateOptions(e){const{mask:t,...n}=e;var i=!this.maskEquals(t),e=this.masked.optionsIsChanged(n);i&&(this.mask=t),e&&this.masked.updateOptions(n),(i||e)&&this.updateControl()}updateCursor(e){null!=e&&(this.cursorPos=e,this._delayUpdateCursor(e))}
1_delayUpdateCursor(e){this._abortUpdateCursor(),this._changingCursorPos=e,this._cursorChanging=setTimeout(()=>{this.el&&(this.cursorPos=this._changingCursorPos,this._abortUpdateCursor())},10)}_fireChangeEvents(){this._fireEvent("accept",this._inputEvent),this.masked.isComplete&&this._fireEvent("complete",this._inputEvent)}_abortUpdateCursor(){this._cursorChanging&&(clearTimeout(this._cursorChanging),delete this._cursorChanging)}alignCursor(){this.cursorPos=this.masked.nearestInputPos(this.masked.nearestInputPos(this.cursorPos,c.LEFT))}alignCursorFriendly(){this.selectionStart===this.cursorPos&&this.alignCursor()}on(e,t){return this._listeners[e]||(this._listeners[e]=[]),this._listeners[e].push(t),this}off(e,t){if(!this._listeners[e])return this;if(!t)return delete this._listeners[e],this;t=this._listeners[e].indexOf(t);return 0<=t&&this._listeners[e].splice(t,1),this}_onInput(e){this._inputEvent=e,this._abortUpdateCursor();var t=new r({value:this.el.value,cursorPos:this.cursorPos,oldValue:this.displayValue,oldSelection:this._selection}),n=this.masked.rawInputValue,e=this.masked.splice(t.startChangePos,t.removed.length,t.inserted,t.removeDirection,{input:!0,raw:!0}).offset,n=n===this.masked.rawInputValue?t.removeDirection:c.NONE;let i=this.masked.nearestInputPos(t.startChangePos+e,n);n!==c.NONE&&(i=this.masked.nearestInputPos(i,c.NONE)),this.updateControl(i),delete this._inputEvent}_onChange(){this.displayValue!==this.el.value&&this.updateValue(),this.masked.doCommit(),this.updateControl(),this._saveSelection()}_onDrop(e){e.preventDefault(),e.stopPropagation()}_onFocus(e){this.alignCursorFriendly()}_onClick(e){this.alignCursorFriendly()}_onUndo(){this._applyHistoryState(this.history.undo())}_onRedo(){this._applyHistoryState(this.history.redo())}_applyHistoryState(e){e&&(this._historyChanging=!0,this.unmaskedValue=e.unmaskedValue,this.el.select(e.selection.start,e.selection.end),this._saveSelection(),this._historyChanging=!1)}destroy(){this._unbindEvents(),this._listeners.length=0,delete this.el}}g.InputMask=m;class S{static normalize(e){return Array.isArray(e)?e:[e,new S]}constructor(e){Object.assign(this,{inserted:"",rawInserted:"",tailShift:0,skip:!1},e)}aggregate(e){return this.inserted+=e.inserted,this.rawInserted+=e.rawInserted,this.tailShift+=e.tailShift,this.skip=this.skip||e.skip,this}get offset(){return this.tailShift+this.inserted.length}get consumed(){return Boolean(this.rawInserted)||this.skip}equals(e){return this.inserted===e.inserted&&this.tailShift===e.tailShift&&this.rawInserted===e.rawInserted&&this.skip===e.skip}}g.ChangeDetails=S;class b{constructor(e,t,n){void 0===t&&(t=0),this.value=e=void 0===e?"":e,this.from=t,this.stop=n}toString(){return this.value}extend(e){this.value+=String(e)}appendTo(e){return e.append(this.toString(),{tail:!0}).aggregate(e._appendPlaceholder())}get state(){return{value:this.value,from:this.from,stop:this.stop}}set state(e){Object.assign(this,e)}unshift(e){if(!this.value.length||null!=e&&this.from>=e)return"";e=this.value[0];return this.value=this.value.slice(1),e}shift(){if(!this.value.length)return"";var e=this.value[this.value.length-1];return this.value=this.value.slice(0,-1),e}}class E{constructor(e){this._value="",this._update({...E.DEFAULTS,...e}),this._initialized=!0}updateOptions(e){this.optionsIsChanged(e)&&this.withValueRefresh(this._update.bind(this,e))}_update(e){Object.assign(this,e)}get state(){return{_value:this.value,_rawInputValue:this.rawInputValue}}set state(e){this._value=e._value}reset(){this._value=""}get value(){return this._value}set value(e){this.resolve(e,{input:!0})}resolve(e,t){void 0===t&&(t={input:!0}),this.reset(),this.append(e,t,""),this.doCommit()}get unmaskedValue(){return this.value}set unmaskedValue(e){this.resolve(e,{})}get typedValue(){return this.parse?this.parse(this.value,this):this.unmaskedValue}set typedValue(e){this.format?this.value=this.format(e,this):this.unmaskedValue=String(e)}get rawInputValue(){return this.extractInput(0,this.displayValue.length,{raw:!0})}set rawInputValue(e){this.resolve(e,{raw:!0})}get displayValue(){return this.value}get isComplete(){return!0}get isFilled(){return this.isComplete}nearestInputPos(e,t){return e}totalInputPositions(e,t){return void 0===e&&(e=0),void 0===t&&(t=this.displayValue.length),Math.min(this.displayValue.length,t-e)}extractInput(e,t,n){return void 0===t&&(t=this.displayValue.length),this.displayValue.slice(e=void 0===e?0:e,t)}extractTail(e,t){return void 0===e&&(e=0),void 0===t&&(t=this.displayValue.length),new b(this.extractInput(e,t),e)}appendTail(e){return(e=s(e)?new b(String(e)):e).appendTo(this)}_appendCharRaw(e,t){return e?(this._value+=e,new S({inserted:e,rawInserted:e})):new S}_appendChar(t,i,a){void 0===i&&(i={});var r=this.state;let s;if([t,s]=this.doPrepareChar(t,i),t&&(s=s.aggregate(this._appendCharRaw(t,i)),!s.rawInserted&&"pad"===this.autofix)){var n=this.state;this.state=r;let e=this.pad(i);t=this._appendCharRaw(t,i);e=e.aggregate(t),t.rawInserted||e.equals(s)?s=e:this.state=n}if(s.inserted){let t,n=!1!==this.doValidate(i);if(n&&null!=a){i=this.state;if(!0===this.overwrite){t=a.state;for(let e=0;e<s.rawInserted.length;++e)a.unshift(this.displayValue.length-s.tailShift)}let e=this.appendTail(a);if(n=e.rawInserted.length===a.toString().length,!(n&&e.inserted||"shift"!==this.overwrite)){this.state=i,t=a.state;for(let e=0;e<s.rawInserted.length;++e)a.shift();e=this.appendTail(a),n=e.rawInserted.length===a.toString().length}n&&e.inserted&&(this.state=i)}n||(s=new S,this.state=r,a&&t&&(a.state=t))}return s}_appendPlaceholder(){return new S}_appendEager(){return new S}append(t,n,e){if(!s(t))throw new Error("value should be string");var i=s(e)?new b(String(e)):e;null!=n&&n.tail&&(n._beforeTailState=this.state);let a;[t,a]=this.doPrepare(t,n);for(let e=0;e<t.length;++e){var r=this._appendChar(t[e],n,i);if(!r.rawInserted&&!this.doSkipInvalid(t[e],n,i))break;a.aggregate(r)}return(!0===this.eager||"append"===this.eager)&&null!=n&&n.input&&t&&a.aggregate(this._appendEager()),null!=i&&(a.tailShift+=this.appendTail(i).tailShift),a}remove(e,t){return void 0===t&&(t=this.displayValue.length),this._value=this.displayValue.slice(0,e=void 0===e?0:e)+this.displayValue.slice(t),new S}withValueRefresh(e){if(this._refreshing||!this._initialized)return e();this._refreshing=!0;var t=this.rawInputValue;const n=this.value;e=e();return this.rawInputValue=t,this.value&&this.value!==n&&0===n.indexOf(this.value)&&(this.append(n.slice(this.displayValue.length),{},""),this.doCommit()),delete this._refreshing,e}runIsolated(e){if(this._isolated||!this._initialized)return e(this);this._isolated=!0;var t=this.state,e=e(this);return this.state=t,delete this._isolated,e}doSkipInvalid(e,t,n){return Boolean(this.skipInvalid)}doPrepare(e,t){return void 0===t&&(t={}),S.normalize(this.prepare?this.prepare(e,this,t):e)}doPrepareChar(e,t){return void 0===t&&(t={}),S.normalize(this.prepareChar?this.prepareChar(e,this,t):e)}doValidate(e){return(!this.validate||this.validate(this.value,this,e))&&(!this.parent||this.parent.doValidate(e))}doCommit(){this.commit&&this.commit(this.value,this)}splice(e,t,n,i,a){void 0===n&&(n=""),void 0===i&&(i=c.NONE),void 0===a&&(a={input:!0});var r=e+t;const s=this.extractTail(r);var o=!0===this.eager||"remove"===this.eager;let l;o&&(i=d(i),l=this.extractInput(0,r,{raw:!0}));let u=e;const h=new S;if(i!==c.NONE&&(u=this.nearestInputPos(e,1<t&&0!==e&&!o?c.NONE:i),h.tailShift=u-e),h.aggregate(this.remove(u)),o&&i!==c.NONE&&l===this.rawInputValue)if(i===c.FORCE_LEFT){let e;for(;l===this.rawInputValue&&(e=this.displayValue.length);)h.aggregate(new S({tailShift:-1})).aggregate(this.remove(e-1))}else i===c.FORCE_RIGHT&&s.unshift();return h.aggregate(this.append(n,a,s))}maskEquals(e){return this.mask===e}optionsIsChanged(e){return!o(this,e)}
1typedValueEquals(e){var t=this.typedValue;return e===t||E.EMPTY_VALUES.includes(e)&&E.EMPTY_VALUES.includes(t)||!!this.format&&this.format(e,this)===this.format(this.typedValue,this)}pad(e){return new S}}E.DEFAULTS={skipInvalid:!0},E.EMPTY_VALUES=[void 0,null,""],g.Masked=E;class _{constructor(e,t){void 0===t&&(t=0),this.chunks=e=void 0===e?[]:e,this.from=t}toString(){return this.chunks.map(String).join("")}extend(t){if(String(t)){t=s(t)?new b(String(t)):t;const n=this.chunks[this.chunks.length-1];var e=n&&(n.stop===t.stop||null==t.stop)&&t.from===n.from+n.toString().length;if(t instanceof b)e?n.extend(t.toString()):this.chunks.push(t);else if(t instanceof _){if(null==t.stop){let e;for(;t.chunks.length&&null==t.chunks[0].stop;)e=t.chunks.shift(),e.from+=t.from,this.extend(e)}t.toString()&&(t.stop=t.blockIndex,this.chunks.push(t))}}}appendTo(n){if(!(n instanceof g.MaskedPattern)){const e=new b(this.toString());return e.appendTo(n)}const i=new S;for(let t=0;t<this.chunks.length;++t){const s=this.chunks[t];var a=n._mapPosToBlock(n.displayValue.length),r=s.stop;let e;null!=r&&(!a||a.index<=r)&&((s instanceof _||0<=n._stops.indexOf(r))&&i.aggregate(n._appendPlaceholder(r)),e=s instanceof _&&n._blocks[r]),e?(r=e.appendTail(s),i.aggregate(r),(r=s.toString().slice(r.rawInserted.length))&&i.aggregate(n.append(r,{tail:!0}))):i.aggregate(n.append(s.toString(),{tail:!0}))}return i}get state(){return{chunks:this.chunks.map(e=>e.state),from:this.from,stop:this.stop,blockIndex:this.blockIndex}}set state(e){const{chunks:t,...n}=e;Object.assign(this,n),this.chunks=t.map(e=>{const t=new("chunks"in e?_:b);return t.state=e,t})}unshift(e){if(!this.chunks.length||null!=e&&this.from>=e)return"";var t=null!=e?e-this.from:e;let n=0;for(;n<this.chunks.length;){const a=this.chunks[n];var i=a.unshift(t);if(a.toString()){if(!i)break;++n}else this.chunks.splice(n,1);if(i)return i}return""}shift(){if(!this.chunks.length)return"";let e=this.chunks.length-1;for(;0<=e;){const n=this.chunks[e];var t=n.shift();if(n.toString()){if(!t)break;--e}else this.chunks.splice(e,1);if(t)return t}return""}}class R{constructor(e,t){this.masked=e,this._log=[];var{offset:e,index:t}=e._mapPosToBlock(t)||(t<0?{index:0,offset:0}:{index:this.masked._blocks.length,offset:0});this.offset=e,this.index=t,this.ok=!1}get block(){return this.masked._blocks[this.index]}get pos(){return this.masked._blockStartPos(this.index)+this.offset}get state(){return{index:this.index,offset:this.offset,ok:this.ok}}set state(e){Object.assign(this,e)}pushState(){this._log.push(this.state)}popState(){var e=this._log.pop();return e&&(this.state=e),e}bindBlock(){this.block||(this.index<0&&(this.index=0,this.offset=0),this.index>=this.masked._blocks.length&&(this.index=this.masked._blocks.length-1,this.offset=this.block.displayValue.length))}_pushLeft(e){for(this.pushState(),this.bindBlock();0<=this.index;--this.index,this.offset=(null==(t=this.block)?void 0:t.displayValue.length)||0){var t;if(e())return this.ok=!0}return this.ok=!1}_pushRight(e){for(this.pushState(),this.bindBlock();this.index<this.masked._blocks.length;++this.index,this.offset=0)if(e())return this.ok=!0;return this.ok=!1}pushLeftBeforeFilled(){return this._pushLeft(()=>{if(!this.block.isFixed&&this.block.value)return this.offset=this.block.nearestInputPos(this.offset,c.FORCE_LEFT),0!==this.offset||void 0})}pushLeftBeforeInput(){return this._pushLeft(()=>{if(!this.block.isFixed)return this.offset=this.block.nearestInputPos(this.offset,c.LEFT),!0})}pushLeftBeforeRequired(){return this._pushLeft(()=>{if(!(this.block.isFixed||this.block.isOptional&&!this.block.value))return this.offset=this.block.nearestInputPos(this.offset,c.LEFT),!0})}pushRightBeforeFilled(){return this._pushRight(()=>{if(!this.block.isFixed&&this.block.value)return this.offset=this.block.nearestInputPos(this.offset,c.FORCE_RIGHT),this.offset!==this.block.value.length||void 0})}pushRightBeforeInput(){return this._pushRight(()=>{if(!this.block.isFixed)return this.offset=this.block.nearestInputPos(this.offset,c.NONE),!0})}pushRightBeforeRequired(){return this._pushRight(()=>{if(!(this.block.isFixed||this.block.isOptional&&!this.block.value))return this.offset=this.block.nearestInputPos(this.offset,c.NONE),!0})}}class O{constructor(e){Object.assign(this,e),this._value="",this.isFixed=!0}get value(){return this._value}get unmaskedValue(){return this.isUnmasking?this.value:""}get rawInputValue(){return this._isRawInput?this.value:""}get displayValue(){return this.value}reset(){this._isRawInput=!1,this._value=""}remove(e,t){return void 0===t&&(t=this._value.length),this._value=this._value.slice(0,e=void 0===e?0:e)+this._value.slice(t),this._value||(this._isRawInput=!1),new S}nearestInputPos(e,t){void 0===t&&(t=c.NONE);var n=this._value.length;switch(t){case c.LEFT:case c.FORCE_LEFT:return 0;case c.NONE:case c.RIGHT:case c.FORCE_RIGHT:default:return n}}totalInputPositions(e,t){return void 0===e&&(e=0),void 0===t&&(t=this._value.length),this._isRawInput?t-e:0}extractInput(e,t,n){return void 0===e&&(e=0),void 0===t&&(t=this._value.length),(n=void 0===n?{}:n).raw&&this._isRawInput&&this._value.slice(e,t)||""}get isComplete(){return!0}get isFilled(){return Boolean(this._value)}_appendChar(e,t){if(void 0===t&&(t={}),this.isFilled)return new S;var n=!0===this.eager||"append"===this.eager,e=this.char===e&&(this.isUnmasking||t.input||t.raw)&&(!t.raw||!n)&&
1!t.tail,n=new S({inserted:this.char,rawInserted:e?this.char:""});return this._value=this.char,this._isRawInput=e&&(t.raw||t.input),n}_appendEager(){return this._appendChar(this.char,{tail:!0})}_appendPlaceholder(){const e=new S;return this.isFilled||(this._value=e.inserted=this.char),e}extractTail(){return new b("")}appendTail(e){return(e=s(e)?new b(String(e)):e).appendTo(this)}append(e,t,n){const i=this._appendChar(e[0],t);return null!=n&&(i.tailShift+=this.appendTail(n).tailShift),i}doCommit(){}get state(){return{_value:this._value,_rawInputValue:this.rawInputValue}}set state(e){this._value=e._value,this._isRawInput=Boolean(e._rawInputValue)}pad(e){return this._appendPlaceholder()}}class w{constructor(e){const{parent:t,isOptional:n,placeholderChar:i,displayChar:a,lazy:r,eager:s,...o}=e;this.masked=v(o),Object.assign(this,{parent:t,isOptional:n,placeholderChar:i,displayChar:a,lazy:r,eager:s})}reset(){this.isFilled=!1,this.masked.reset()}remove(e,t){return void 0===t&&(t=this.value.length),0===(e=void 0===e?0:e)&&1<=t?(this.isFilled=!1,this.masked.remove(e,t)):new S}get value(){return this.masked.value||(this.isFilled&&!this.isOptional?this.placeholderChar:"")}get unmaskedValue(){return this.masked.unmaskedValue}get rawInputValue(){return this.masked.rawInputValue}get displayValue(){return this.masked.value&&this.displayChar||this.value}get isComplete(){return Boolean(this.masked.value)||this.isOptional}_appendChar(e,t){if(void 0===t&&(t={}),this.isFilled)return new S;var n=this.masked.state;let i=this.masked._appendChar(e,this.currentMaskFlags(t));return i.inserted&&!1===this.doValidate(t)&&(i=new S,this.masked.state=n),i.inserted||this.isOptional||this.lazy||t.input||(i.inserted=this.placeholderChar),i.skip=!i.inserted&&!this.isOptional,this.isFilled=Boolean(i.inserted),i}append(e,t,n){return this.masked.append(e,this.currentMaskFlags(t),n)}_appendPlaceholder(){return this.isFilled||this.isOptional?new S:(this.isFilled=!0,new S({inserted:this.placeholderChar}))}_appendEager(){return new S}extractTail(e,t){return this.masked.extractTail(e,t)}appendTail(e){return this.masked.appendTail(e)}extractInput(e,t,n){return void 0===t&&(t=this.value.length),this.masked.extractInput(e=void 0===e?0:e,t,n)}nearestInputPos(e,t){void 0===t&&(t=c.NONE);var n=this.value.length,i=Math.min(Math.max(e,0),n);switch(t){case c.LEFT:case c.FORCE_LEFT:return this.isComplete?i:0;case c.RIGHT:case c.FORCE_RIGHT:return this.isComplete?i:n;default:c.NONE;return i}}totalInputPositions(e,t){return void 0===t&&(t=this.value.length),this.value.slice(e=void 0===e?0:e,t).length}doValidate(e){return this.masked.doValidate(this.currentMaskFlags(e))&&(!this.parent||this.parent.doValidate(this.currentMaskFlags(e)))}doCommit(){this.masked.doCommit()}get state(){return{_value:this.value,_rawInputValue:this.rawInputValue,masked:this.masked.state,isFilled:this.isFilled}}set state(e){this.masked.state=e.masked,this.isFilled=e.isFilled}currentMaskFlags(e){var t;return{...e,_beforeTailState:(null==e||null==(t=e._beforeTailState)?void 0:t.masked)||(null==e?void 0:e._beforeTailState)}}pad(e){return new S}}w.DEFAULT_DEFINITIONS={0:/\d/,a:/[\u0041-\u005A\u0061-\u007A\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u
10EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/,"*":/./};class M extends E{updateOptions(e){super.updateOptions(e)}_update(e){const t=e.mask;t&&(e.validate=e=>0<=e.search(t)),super._update(e)}}g.MaskedRegExp=M;class y extends E{constructor(e){super({...y.DEFAULTS,...e,definitions:Object.assign({},w.DEFAULT_DEFINITIONS,null==e?void 0:e.definitions)})}updateOptions(e){super.updateOptions(e)}_update(e){e.definitions=Object.assign({},this.definitions,e.definitions),super._update(e),this._rebuildMask()}_rebuildMask(){var r=this.definitions;this._blocks=[],this.exposeBlock=void 0,this._stops=[],this._maskedBlocks={};const s=this.mask;if(s&&r){let i=!1,a=!1;for(let n=0;n<s.length;++n){if(this.blocks){const u=s.slice(n),h=Object.keys(this.blocks).filter(e=>0===u.indexOf(e));h.sort((e,t)=>t.length-e.length);var o=h[0];if(o){const{expose:c,repeat:d,...p}=f(this.blocks[o]);var l={lazy:this.lazy,eager:this.eager,placeholderChar:this.placeholderChar,displayChar:this.displayChar,overwrite:this.overwrite,autofix:this.autofix,...p,repeat:d,parent:this},l=null!=d?new g.RepeatBlock(l):v(l);l&&(this._blocks.push(l),c&&(this.exposeBlock=l),this._maskedBlocks[o]||(this._maskedBlocks[o]=[]),this._maskedBlocks[o].push(this._blocks.length-1)),n+=o.length-1;continue}}let e=s[n],t=e in r;if(e!==y.STOP_CHAR)if("{"!==e&&"}"!==e)if("["!==e&&"]"!==e){if(e===y.ESCAPE_CHAR){if(++n,e=s[n],!e)break;t=!1}o=t?new w({isOptional:a,lazy:this.lazy,eager:this.eager,placeholderChar:this.placeholderChar,displayChar:this.displayChar,...f(r[e]),parent:this}):new O({char:e,eager:this.eager,isUnmasking:i});this._blocks.push(o)}else a=!a;else i=!i;else this._stops.push(this._blocks.length)}}}get state(){return{...super.state,_blocks:this._blocks.map(e=>e.state)}}set state(e){if(e){const{_blocks:n,...t}=e;this._blocks.forEach((e,t)=>e.state=n[t]),super.state=t}else this.reset()}
1reset(){super.reset(),this._blocks.forEach(e=>e.reset())}get isComplete(){return this.exposeBlock?this.exposeBlock.isComplete:this._blocks.every(e=>e.isComplete)}get isFilled(){return this._blocks.every(e=>e.isFilled)}get isFixed(){return this._blocks.every(e=>e.isFixed)}get isOptional(){return this._blocks.every(e=>e.isOptional)}doCommit(){this._blocks.forEach(e=>e.doCommit()),super.doCommit()}get unmaskedValue(){return this.exposeBlock?this.exposeBlock.unmaskedValue:this._blocks.reduce((e,t)=>e+=t.unmaskedValue,"")}set unmaskedValue(e){var t;this.exposeBlock?(t=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length),this.exposeBlock.unmaskedValue=e,this.appendTail(t),this.doCommit()):super.unmaskedValue=e}get value(){return this.exposeBlock?this.exposeBlock.value:this._blocks.reduce((e,t)=>e+=t.value,"")}set value(e){var t;this.exposeBlock?(t=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length),this.exposeBlock.value=e,this.appendTail(t),this.doCommit()):super.value=e}get typedValue(){return this.exposeBlock?this.exposeBlock.typedValue:super.typedValue}set typedValue(e){var t;this.exposeBlock?(t=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length),this.exposeBlock.typedValue=e,this.appendTail(t),this.doCommit()):super.typedValue=e}get displayValue(){return this._blocks.reduce((e,t)=>e+=t.displayValue,"")}appendTail(e){return super.appendTail(e).aggregate(this._appendPlaceholder())}_appendEager(){var e;const t=new S;let n=null==(e=this._mapPosToBlock(this.displayValue.length))?void 0:e.index;if(null==n)return t;this._blocks[n].isFilled&&++n;for(let e=n;e<this._blocks.length;++e){var i=this._blocks[e]._appendEager();if(!i.inserted)break;t.aggregate(i)}return t}_appendCharRaw(n,i){void 0===i&&(i={});var a=this._mapPosToBlock(this.displayValue.length);const r=new S;if(!a)return r;for(let e=a.index,t;t=this._blocks[e];++e){var s=t._appendChar(n,{...i,_beforeTailState:null==(s=i._beforeTailState)||null==(s=s._blocks)?void 0:s[e]});if(r.aggregate(s),s.consumed)break}return r}extractTail(e,t){void 0===e&&(e=0),void 0===t&&(t=this.displayValue.length);const r=new _;return e===t||this._forEachBlocksInRange(e,t,(e,t,n,i)=>{const a=e.extractTail(n,i);a.stop=this._findStopBefore(t),a.from=this._blockStartPos(t),a instanceof _&&(a.blockIndex=t),r.extend(a)}),r}extractInput(e,t,a){if(void 0===t&&(t=this.displayValue.length),void 0===a&&(a={}),(e=void 0===e?0:e)===t)return"";let r="";return this._forEachBlocksInRange(e,t,(e,t,n,i)=>{r+=e.extractInput(n,i,a)}),r}_findStopBefore(t){let n;for(let e=0;e<this._stops.length;++e){var i=this._stops[e];if(!(i<=t))break;n=i}return n}_appendPlaceholder(t){const n=new S;if(this.lazy&&null==t)return n;var e=this._mapPosToBlock(this.displayValue.length);if(!e)return n;var i=e.index,e=null!=t?t:this._blocks.length;return this._blocks.slice(i,e).forEach(e=>{e.lazy&&null==t||n.aggregate(e._appendPlaceholder(null==(e=e._blocks)?void 0:e.length))}),n}_mapPosToBlock(t){let n="";for(let e=0;e<this._blocks.length;++e){var i=this._blocks[e],a=n.length;if(n+=i.displayValue,t<=n.length)return{index:e,offset:t-a}}}_blockStartPos(e){return this._blocks.slice(0,e).reduce((e,t)=>e+=t.displayValue.length,0)}_forEachBlocksInRange(e,t,n){void 0===t&&(t=this.displayValue.length);var i=this._mapPosToBlock(e);if(i){var a=this._mapPosToBlock(t),r=a&&i.index===a.index,e=i.offset,t=a&&r?a.offset:this._blocks[i.index].displayValue.length;if(n(this._blocks[i.index],i.index,e,t),a&&!r){for(let e=i.index+1;e<a.index;++e)n(this._blocks[e],e,0,this._blocks[e].displayValue.length);n(this._blocks[a.index],a.index,0,a.offset)}}}remove(e,t){void 0===t&&(t=this.displayValue.length);const a=super.remove(e=void 0===e?0:e,t);return this._forEachBlocksInRange(e,t,(e,t,n,i)=>{a.aggregate(e.remove(n,i))}),a}nearestInputPos(e,t){if(void 0===t&&(t=c.NONE),!this._blocks.length)return 0;const n=new R(this,e);if(t===c.NONE)return n.pushRightBeforeInput()?n.pos:(n.popState(),n.pushLeftBeforeInput()?n.pos:this.displayValue.length);if(t!==c.LEFT&&t!==c.FORCE_LEFT)return t===c.RIGHT||t===c.FORCE_RIGHT?(n.pushRightBeforeInput(),n.pushRightBeforeRequired(),n.pushRightBeforeFilled()?n.pos:t===c.FORCE_RIGHT?this.displayValue.length:(n.popState(),n.ok?n.pos:(n.popState(),n.ok?n.pos:this.nearestInputPos(e,c.LEFT)))):e;if(t===c.LEFT){if(n.pushRightBeforeFilled(),n.ok&&n.pos===e)return e;n.popState()}if(n.pushLeftBeforeInput(),n.pushLeftBeforeRequired(),n.pushLeftBeforeFilled(),t===c.LEFT){if(n.pushRightBeforeInput(),n.pushRightBeforeRequired(),n.ok&&n.pos<=e)return n.pos;if(n.popState(),n.ok&&n.pos<=e)return n.pos;n.popState()}return n.ok?n.pos:t===c.FORCE_LEFT?0:(n.popState(),n.ok?n.pos:(n.popState(),n.ok?n.pos:0))}totalInputPositions(e,t){void 0===t&&(t=this.displayValue.length);let a=0;
1return this._forEachBlocksInRange(e=void 0===e?0:e,t,(e,t,n,i)=>{a+=e.totalInputPositions(n,i)}),a}maskedBlock(e){return this.maskedBlocks(e)[0]}maskedBlocks(e){const t=this._maskedBlocks[e];return t?t.map(e=>this._blocks[e]):[]}pad(t){const n=new S;return this._forEachBlocksInRange(0,this.displayValue.length,e=>n.aggregate(e.pad(t))),n}}y.DEFAULTS={...E.DEFAULTS,lazy:!0,placeholderChar:"_"},y.STOP_CHAR="`",y.ESCAPE_CHAR="\\",y.InputDefinition=w,y.FixedDefinition=O,g.MaskedPattern=y;class C extends y{get _matchFrom(){return this.maxLength-String(this.from).length}constructor(e){super(e)}updateOptions(e){super.updateOptions(e)}_update(e){const{to:t=this.to||0,from:n=this.from||0,maxLength:i=this.maxLength||0,autofix:a=this.autofix,...r}=e;this.to=t,this.from=n,this.maxLength=Math.max(String(t).length,i),this.autofix=a;var s=String(this.from).padStart(this.maxLength,"0");const o=String(this.to).padStart(this.maxLength,"0");let l=0;for(;l<o.length&&o[l]===s[l];)++l;r.mask=o.slice(0,l).replace(/0/g,"\\0")+"0".repeat(this.maxLength-l),super._update(r)}get isComplete(){return super.isComplete&&Boolean(this.value)}boundaries(e){let t="",n="";var[,i,e]=e.match(/^(\D*)(\d*)(\D*)/)||[];return e&&(t="0".repeat(i.length)+e,n="9".repeat(i.length)+e),t=t.padEnd(this.maxLength,"0"),n=n.padEnd(this.maxLength,"9"),[t,n]}doPrepareChar(e,t){void 0===t&&(t={});let n;return[e,n]=super.doPrepareChar(e.replace(/\D/g,""),t),e||(n.skip=!this.isComplete),[e,n]}_appendCharRaw(e,t){if(void 0===t&&(t={}),!this.autofix||this.value.length+1>this.maxLength)return super._appendCharRaw(e,t);var n=String(this.from).padStart(this.maxLength,"0"),i=String(this.to).padStart(this.maxLength,"0"),[a,r]=this.boundaries(this.value+e);return Number(r)<this.from?super._appendCharRaw(n[this.value.length],t):Number(a)>this.to?!t.tail&&"pad"===this.autofix&&this.value.length+1<this.maxLength?super._appendCharRaw(n[this.value.length],t).aggregate(this._appendCharRaw(e,t)):super._appendCharRaw(i[this.value.length],t):super._appendCharRaw(e,t)}doValidate(e){const t=this.value;if(-1===t.search(/[^0]/)&&t.length<=this._matchFrom)return!0;var[n,i]=this.boundaries(t);return this.from<=Number(i)&&Number(n)<=this.to&&super.doValidate(e)}pad(t){const n=new S;if(this.value.length===this.maxLength)return n;const e=this.value;var i=this.maxLength-this.value.length;if(i){this.reset();for(let e=0;e<i;++e)n.aggregate(super._appendCharRaw("0",t));e.split("").forEach(e=>this._appendCharRaw(e))}return n}}g.MaskedRange=C;class A extends y{static extractPatternOptions(e){const{mask:t,pattern:n,...i}=e;return{...i,mask:s(t)?t:n}}constructor(e){super(A.extractPatternOptions({...A.DEFAULTS,...e}))}updateOptions(e){super.updateOptions(e)}_update(e){const{mask:t,pattern:n,blocks:i,...a}={...A.DEFAULTS,...e},r=Object.assign({},A.GET_DEFAULT_BLOCKS());e.min&&(r.Y.from=e.min.getFullYear()),e.max&&(r.Y.to=e.max.getFullYear()),e.min&&e.max&&r.Y.from===r.Y.to&&(r.m.from=e.min.getMonth()+1,r.m.to=e.max.getMonth()+1,r.m.from===r.m.to&&(r.d.from=e.min.getDate(),r.d.to=e.max.getDate())),Object.assign(r,this.blocks,i),super._update({...a,mask:s(t)?t:n,blocks:r})}doValidate(e){var t=this.date;return super.doValidate(e)&&(!this.isComplete||this.isDateExist(this.value)&&null!=t&&(null==this.min||this.min<=t)&&(null==this.max||t<=this.max))}isDateExist(e){return 0<=this.format(this.parse(e,this),this).indexOf(e)}get date(){return this.typedValue}set date(e){this.typedValue=e}get typedValue(){return this.isComplete?super.typedValue:null}set typedValue(e){super.typedValue=e}maskEquals(e){return e===Date||super.maskEquals(e)}optionsIsChanged(e){return super.optionsIsChanged(A.extractPatternOptions(e))}}A.GET_DEFAULT_BLOCKS=()=>({d:{mask:C,from:1,to:31,maxLength:2},m:{mask:C,from:1,to:12,maxLength:2},Y:{mask:C,from:1900,to:9999}}),A.DEFAULTS={...y.DEFAULTS,mask:Date,pattern:"d{.}`m{.}`Y",format:(e,t)=>{if(!e)return"";const n=String(e.getDate()).padStart(2,"0"),i=String(e.getMonth()+1).padStart(2,"0"),a=e.getFullYear();return[n,i,a].join(".")},parse:(e,t)=>{var[n,i,e]=e.split(".").map(Number);return new Date(e,i-1,n)}},g.MaskedDate=A;
1class F extends E{constructor(e){super({...F.DEFAULTS,...e}),this.currentMask=void 0}updateOptions(e){super.updateOptions(e)}_update(e){super._update(e),"mask"in e&&(this.exposeMask=void 0,this.compiledMasks=Array.isArray(e.mask)?e.mask.map(e=>{const{expose:t,...n}=f(e);e=v({overwrite:this._overwrite,eager:this._eager,skipInvalid:this._skipInvalid,...n});return t&&(this.exposeMask=e),e}):[])}_appendCharRaw(e,t){const n=this._applyDispatch(e,t=void 0===t?{}:t);return this.currentMask&&n.aggregate(this.currentMask._appendChar(e,this.currentMaskFlags(t))),n}_applyDispatch(e,t,n){void 0===e&&(e=""),void 0===n&&(n="");var i=(t=void 0===t?{}:t).tail&&null!=t._beforeTailState?t._beforeTailState._value:this.value;const a=this.rawInputValue;var r=t.tail&&null!=t._beforeTailState?t._beforeTailState._rawInputValue:a,s=a.slice(r.length),o=this.currentMask;const l=new S;var u=null==o?void 0:o.state;return this.currentMask=this.doDispatch(e,{...t},n),this.currentMask&&(this.currentMask!==o?(this.currentMask.reset(),r&&(this.currentMask.append(r,{raw:!0}),l.tailShift=this.currentMask.value.length-i.length),s&&(l.tailShift+=this.currentMask.append(s,{raw:!0,tail:!0}).tailShift)):u&&(this.currentMask.state=u)),l}_appendPlaceholder(){const e=this._applyDispatch();return this.currentMask&&e.aggregate(this.currentMask._appendPlaceholder()),e}_appendEager(){const e=this._applyDispatch();return this.currentMask&&e.aggregate(this.currentMask._appendEager()),e}appendTail(e){const t=new S;return e&&t.aggregate(this._applyDispatch("",{},e)),t.aggregate(this.currentMask?this.currentMask.appendTail(e):super.appendTail(e))}currentMaskFlags(e){var t;return{...e,_beforeTailState:(null==(t=e._beforeTailState)?void 0:t.currentMaskRef)===this.currentMask&&(null==(t=e._beforeTailState)?void 0:t.currentMask)||e._beforeTailState}}doDispatch(e,t,n){return this.dispatch(e,this,t=void 0===t?{}:t,n=void 0===n?"":n)}doValidate(e){return super.doValidate(e)&&(!this.currentMask||this.currentMask.doValidate(this.currentMaskFlags(e)))}doPrepare(e,t){let[n,i]=super.doPrepare(e,t=void 0===t?{}:t);return this.currentMask&&([n,t]=super.doPrepare(n,this.currentMaskFlags(t)),i=i.aggregate(t)),[n,i]}doPrepareChar(e,t){let[n,i]=super.doPrepareChar(e,t=void 0===t?{}:t);return this.currentMask&&([n,t]=super.doPrepareChar(n,this.currentMaskFlags(t)),i=i.aggregate(t)),[n,i]}reset(){var e;null==(e=this.currentMask)||e.reset(),this.compiledMasks.forEach(e=>e.reset())}get value(){return this.exposeMask?this.exposeMask.value:this.currentMask?this.currentMask.value:""}set value(e){this.exposeMask?(this.exposeMask.value=e,this.currentMask=this.exposeMask,this._applyDispatch()):super.value=e}get unmaskedValue(){return this.exposeMask?this.exposeMask.unmaskedValue:this.currentMask?this.currentMask.unmaskedValue:""}set unmaskedValue(e){this.exposeMask?(this.exposeMask.unmaskedValue=e,this.currentMask=this.exposeMask,this._applyDispatch()):super.unmaskedValue=e}get typedValue(){return this.exposeMask?this.exposeMask.typedValue:this.currentMask?this.currentMask.typedValue:""}set typedValue(e){if(this.exposeMask)return this.exposeMask.typedValue=e,this.currentMask=this.exposeMask,void this._applyDispatch();let t=String(e);this.currentMask&&(this.currentMask.typedValue=e,t=this.currentMask.unmaskedValue),this.unmaskedValue=t}get displayValue(){return this.currentMask?this.currentMask.displayValue:""}get isComplete(){var e;return Boolean(null==(e=this.currentMask)?void 0:e.isComplete)}get isFilled(){var e;return Boolean(null==(e=this.currentMask)?void 0:e.isFilled)}remove(e,t){const n=new S;return this.currentMask&&n.aggregate(this.currentMask.remove(e,t)).aggregate(this._applyDispatch()),n}get state(){var e;return{...super.state,_rawInputValue:this.rawInputValue,compiledMasks:this.compiledMasks.map(e=>e.state),currentMaskRef:this.currentMask,currentMask:null==(e=this.currentMask)?void 0:e.state}}set state(e){const{compiledMasks:n,currentMaskRef:t,currentMask:i,...a}=e;n&&this.compiledMasks.forEach((e,t)=>e.state=n[t]),null!=t&&(this.currentMask=t,this.currentMask.state=i),super.state=a}extractInput(e,t,n){return this.currentMask?this.currentMask.extractInput(e,t,n):""}extractTail(e,t){return this.currentMask?this.currentMask.extractTail(e,t):super.extractTail(e,t)}doCommit(){this.currentMask&&this.currentMask.doCommit(),super.doCommit()}nearestInputPos(e,t){return this.currentMask?this.currentMask.nearestInputPos(e,t):super.nearestInputPos(e,t)}get overwrite(){return this.currentMask?this.currentMask.overwrite:this._overwrite}set overwrite(e){this._overwrite=e}get eager(){return this.currentMask?this.currentMask.eager:this._eager}set eager(e){this._eager=e}get skipInvalid(){return this.currentMask?this.currentMask.skipInvalid:this._skipInvalid}set skipInvalid(e){this._skipInvalid=e}get autofix(){return this.currentMask?this.currentMask.autofix:this._autofix}set autofix(e){this._autofix=e}maskEquals(a){return Array.isArray(a)?this.compiledMasks.every((e,t)=>{if(a[t]){const{mask:n,...i}=a[t];return o(e,i)&&e.maskEquals(n)}}):super.maskEquals(a)}typedValueEquals(e){var t;return Boolean(null==(t=this.currentMask)?void 0:t.typedValueEquals(e))}}F.DEFAULTS={...E.DEFAULTS,dispatch:(a,r,s,o)=>
1{if(r.compiledMasks.length){const l=r.rawInputValue,e=r.compiledMasks.map((e,t)=>{var n=r.currentMask===e,i=n?e.displayValue.length:e.nearestInputPos(e.displayValue.length,c.FORCE_LEFT);return e.rawInputValue!==l?(e.reset(),e.append(l,{raw:!0})):n||e.remove(i),e.append(a,r.currentMaskFlags(s)),e.appendTail(o),{index:t,weight:e.rawInputValue.length,totalInputPositions:e.totalInputPositions(0,Math.max(i,e.nearestInputPos(e.displayValue.length,c.FORCE_LEFT)))}});return e.sort((e,t)=>t.weight-e.weight||t.totalInputPositions-e.totalInputPositions),r.compiledMasks[e[0].index]}}},g.MaskedDynamic=F;class T extends y{constructor(e){super({...T.DEFAULTS,...e})}updateOptions(e){super.updateOptions(e)}_update(e){const{enum:t,...n}=e;var i;t&&(i=t.map(e=>e.length),e=Math.min(...i),i=Math.max(...i)-e,n.mask="*".repeat(e),i&&(n.mask+="["+"*".repeat(i)+"]"),this.enum=t),super._update(n)}_appendCharRaw(t,i){void 0===i&&(i={});const n=Math.min(this.nearestInputPos(0,c.FORCE_RIGHT),this.value.length),a=this.enum.filter(e=>this.matchValue(e,this.unmaskedValue+t,n));if(a.length){1===a.length&&this._forEachBlocksInRange(0,this.value.length,(e,t)=>{var n=a[0][t];t>=this.value.length||n===e.value||(e.reset(),e._appendChar(n,i))});const r=super._appendCharRaw(a[0][this.value.length],i);return 1===a.length&&a[0].slice(this.unmaskedValue.length).split("").forEach(e=>r.aggregate(super._appendCharRaw(e))),r}return new S({skip:!this.isComplete})}extractTail(e,t){return void 0===e&&(e=0),void 0===t&&(t=this.displayValue.length),new b("",e)}remove(e,t){if((e=void 0===e?0:e)===(t=void 0===t?this.displayValue.length:t))return new S;const n=Math.min(super.nearestInputPos(0,c.FORCE_RIGHT),this.value.length);let i;for(i=e;0<=i;--i)if(1<this.enum.filter(e=>this.matchValue(e,this.value.slice(n,i),n)).length)break;const a=super.remove(i,t);return a.tailShift+=i-e,a}get isComplete(){return 0<=this.enum.indexOf(this.value)}}T.DEFAULTS={...y.DEFAULTS,matchValue:(e,t,n)=>e.indexOf(t,n)===n},g.MaskedEnum=T;class I extends E{updateOptions(e){super.updateOptions(e)}_update(e){super._update({...e,validate:e.mask})}}var D;g.MaskedFunction=I;class k extends E{constructor(e){super({...k.DEFAULTS,...e})}updateOptions(e){super.updateOptions(e)}_update(e){super._update(e),this._updateRegExps()}_updateRegExps(){var e="^"+(this.allowNegative?"[+|\\-]?":""),t=(this.scale?"("+n(this.radix)+"\\d{0,"+this.scale+"})?":"")+"$";this._numberRegExp=new RegExp(e+"\\d*"+t),this._mapToRadixRegExp=new RegExp("["+this.mapToRadix.map(n).join("")+"]","g"),this._thousandsSeparatorRegExp=new RegExp(n(this.thousandsSeparator),"g")}_removeThousandsSeparators(e){return e.replace(this._thousandsSeparatorRegExp,"")}_insertThousandsSeparators(e){const t=e.split(this.radix);return t[0]=t[0].replace(/\B(?=(\d{3})+(?!\d))/g,this.thousandsSeparator),t.join(this.radix)}doPrepareChar(e,t){void 0===t&&(t={});const[n,i]=super.doPrepareChar(this._removeThousandsSeparators(this.scale&&this.mapToRadix.length&&(t.input&&t.raw||!t.input&&!t.raw)?e.replace(this._mapToRadixRegExp,this.radix):e),t);return e&&!n&&(i.skip=!0),!n||this.allowPositive||this.value||"-"===n||i.aggregate(this._appendChar("-")),[n,i]}_separatorsCount(t,n){void 0===n&&(n=!1);let i=0;for(let e=0;e<t;++e)this._value.indexOf(this.thousandsSeparator,e)===e&&(++i,n&&(t+=this.thousandsSeparator.length));return i}_separatorsCountFromSlice(e){return void 0===e&&(e=this._value),this._separatorsCount(this._removeThousandsSeparators(e).length,!0)}extractInput(e,t,n){return void 0===e&&(e=0),void 0===t&&(t=this.displayValue.length),[e,t]=this._adjustRangeWithSeparators(e,t),this._removeThousandsSeparators(super.extractInput(e,t,n))}_appendCharRaw(e,t){var n=((t=void 0===t?{}:t).tail&&t._beforeTailState?t._beforeTailState:this)._value,i=this._separatorsCountFromSlice(n);this._value=this._removeThousandsSeparators(this.value);var a=this._value;this._value+=e;n=this.number;let r=!isNaN(n),s=!1;if(r){let e;null!=this.min&&this.min<0&&this.number<this.min&&(e=this.min),null!=this.max&&0<this.max&&this.number>this.max&&(e=this.max),null!=e&&(this.autofix?(this._value=this.format(e,this).replace(k.UNMASKED_RADIX,this.radix),s=s||a===this._value&&!t.tail):r=!1),r=r&&Boolean(this._value.match(this._numberRegExp))}let o;o=r?new S({inserted:this._value.slice(a.length),rawInserted:s?"":e,skip:s}):(this._value=a,new S),this._value=this._insertThousandsSeparators(this._value);t=(t.tail&&t._beforeTailState?t._beforeTailState:this)._value,t=this._separatorsCountFromSlice(t);return o.tailShift+=(t-i)*this.thousandsSeparator.length,o}_findSeparatorAround(e){if(this.thousandsSeparator){var t=e-this.thousandsSeparator.length+1,t=this.value.indexOf(this.thousandsSeparator,t);if(t<=e)return t}return-1}_adjustRangeWithSeparators(e,t){var n=this._findSeparatorAround(e);0<=n&&(e=n);n=this._findSeparatorAround(t);return[e,t=0<=n?n+this.thousandsSeparator.length:t]}remove(e,t){void 0===e&&(e=0),void 0===t&&(t=this.displayValue.length),[e,t]=this._adjustRangeWithSeparators(e,t);var n=this.value.slice(0,e),e=this.value.slice(t),t=this._separatorsCount(n.length);this._value=this._insertThousandsSeparators(this._removeThousandsSeparators(n+e));n=this._separatorsCountFromSlice(n);return new S({tailShift:(n-t)*this.thousandsSeparator.length})}nearestInputPos(e,t){if(!this.thousandsSeparator)return e;switch(t){case c.NONE:case c.LEFT:case c.FORCE_LEFT:var n=this._findSeparatorAround(e-1);if(0<=n){var i=n+this.thousandsSeparator.length;if(e<i||this.value.length<=i||t===c.FORCE_LEFT)return n}break;case c.RIGHT:case c.FORCE_RIGHT:n=this._findSeparatorAround(e);if(0<=n)return n+this.thousandsSeparator.length}return e}doCommit(){if(this.value){var n=this.number;let e=n;null!=this.min&&(e=Math.max(e,this.min)),null!=this.max&&(e=Math.min(e,this.max)),e!==n&&(this.unmaskedValue=this.format(e,this));let t=this.value;this.normalizeZeros&&(t=this._normalizeZeros(t)),this.padFractionalZeros&&0<this.scale&&(t=this._padFractionalZeros(t)),this._value=t}super.doCommit()}_normalizeZeros(e){const t=this._removeThousandsSeparators(e).split(this.radix);return t[0]=t[0].replace(/^(\D*)(0*)(\d*)/,(e,t,n,i)=>t+i),e.length&&!/\d$/.test(t[0])&&(t[0]=t[0]+"0"),1<t.length&&(t[1]=t[1].replace(/0*$/,""),t[1].length||(t.length=1)),this._insertThousandsSeparators(t.join(this.radix))}_padFractionalZeros(e){if(!e)return e;const t=e.split(this.radix);return t.length<2&&t.push(""),t[1]=t[1].padEnd(this.scale,"0"),t.join(this.radix)}doSkipInvalid(e,t,n){void 0===t&&(t={});var i=0===this.scale&&e!==this.thousandsSeparator&&(e===this.radix||e===k.UNMASKED_RADIX||this.mapToRadix.includes(e));return super.doSkipInvalid(e,t,n)&&!i}get unmaskedValue(){return this._removeThousandsSeparators(this._normalizeZeros(this.value)).replace(this.radix,k.UNMASKED_RADIX)}set unmaskedValue(e){super.unmaskedValue=e}get typedValue(){return this.parse(this.unmaskedValue,this)}set typedValue(e){this.rawInputValue=this.format(e,this).replace(k.UNMASKED_RADIX,this.radix)}get number(){return this.typedValue}set number(e){this.typedValue=e}get allowNegative(){return null!=this.min&&this.min<0||null!=this.max&&this.max<0}get allowPositive(){return null!=this.min&&0<this.min||null!=this.max&&0<this.max}typedValueEquals(e){return(super.typedValueEquals(e)||k.EMPTY_VALUES.includes(e)&&k.EMPTY_VALUES.includes(this.typedValue))&&!(0===e&&""===this.value)}}D=k,k.UNMASKED_RADIX=".",k.EMPTY_VALUES=[...E.EMPTY_VALUES,0],k.DEFAULTS={...E.DEFAULTS,mask:Number,radix:",",thousandsSeparator:"",mapToRadix:[D.UNMASKED_RADIX],min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER,scale:2,normalizeZeros:!0,padFractionalZeros:!1,parse:Number,format:e=>
1e.toLocaleString("en-US",{useGrouping:!1,maximumFractionDigits:20})},g.MaskedNumber=k;const N={MASKED:"value",UNMASKED:"unmaskedValue",TYPED:"typedValue"};function L(e,n,i){void 0===n&&(n=N.MASKED),void 0===i&&(i=N.MASKED);const a=v(e);return t=>a.runIsolated(e=>(e[n]=t,e[i]))}function P(e,t,n,i){return L(t,n,i)(e)}g.PIPE_TYPE=N,g.createPipe=L,g.pipe=P;class x extends y{get repeatFrom(){var e;return null!=(e=Array.isArray(this.repeat)?this.repeat[0]:this.repeat===1/0?0:this.repeat)?e:0}get repeatTo(){var e;return null!=(e=Array.isArray(this.repeat)?this.repeat[1]:this.repeat)?e:1/0}constructor(e){super(e)}updateOptions(e){super.updateOptions(e)}_update(e){const{repeat:t,...n}=f(e);this._blockOpts=Object.assign({},this._blockOpts,n);var i=v(this._blockOpts);this.repeat=null!=(e=null!=(e=null!=t?t:i.repeat)?e:this.repeat)?e:1/0,super._update({mask:"m".repeat(Math.max(this.repeatTo===1/0&&(null==(e=this._blocks)?void 0:e.length)||0,this.repeatFrom)),blocks:{m:i},eager:i.eager,overwrite:i.overwrite,skipInvalid:i.skipInvalid,lazy:i.lazy,placeholderChar:i.placeholderChar,displayChar:i.displayChar})}_allocateBlock(e){return e<this._blocks.length?this._blocks[e]:this.repeatTo===1/0||this._blocks.length<this.repeatTo?(this._blocks.push(v(this._blockOpts)),this.mask+="m",this._blocks[this._blocks.length-1]):void 0}_appendCharRaw(i,a){void 0===a&&(a={});const r=new S;for(let e=null!=(s=null==(s=this._mapPosToBlock(this.displayValue.length))?void 0:s.index)?s:Math.max(this._blocks.length-1,0),t,n;t=null!=(o=this._blocks[e])?o:n=!n&&this._allocateBlock(e);++e){var s,o=t._appendChar(i,{...a,_beforeTailState:null==(o=a._beforeTailState)||null==(o=o._blocks)?void 0:o[e]});if(o.skip&&n){this._blocks.pop(),this.mask=this.mask.slice(1);break}if(r.aggregate(o),o.consumed)break}return r}_trimEmptyTail(e,t){void 0===e&&(e=0);var n=Math.max((null==(e=this._mapPosToBlock(e))?void 0:e.index)||0,this.repeatFrom,0);let i;null!=t&&(i=null==(t=this._mapPosToBlock(t))?void 0:t.index),null==i&&(i=this._blocks.length-1);let a=0;for(let e=i;n<=e&&!this._blocks[e].unmaskedValue;--e,++a);a&&(this._blocks.splice(i-a+1,a),this.mask=this.mask.slice(a))}reset(){super.reset(),this._trimEmptyTail()}remove(e,t){void 0===t&&(t=this.displayValue.length);var n=super.remove(e=void 0===e?0:e,t);return this._trimEmptyTail(e,t),n}totalInputPositions(e,t){return void 0===e&&(e=0),null==t&&this.repeatTo===1/0?1/0:super.totalInputPositions(e,t)}get state(){return super.state}set state(e){this._blocks.length=e._blocks.length,this.mask=this.mask.slice(0,this._blocks.length),super.state=e}}g.RepeatBlock=x;try{globalThis.IMask=g}catch{}e.ChangeDetails=S,e.ChunksTailDetails=_,e.DIRECTION=c,e.HTMLContenteditableMaskElement=h,e.HTMLInputMaskElement=u,e.HTMLMaskElement=t,e.InputMask=m,e.MaskElement=l,e.Masked=E,e.MaskedDate=A,e.MaskedDynamic=F,e.MaskedEnum=T,e.MaskedFunction=I,e.MaskedNumber=k,e.MaskedPattern=y,e.MaskedRange=C,e.MaskedRegExp=M,e.PIPE_TYPE=N,e.PatternFixedDefinition=O,e.PatternInputDefinition=w,e.RepeatBlock=x,e.createMask=v,e.createPipe=L,e.default=g,e.forceDirection=d,e.normalizeOpts=f,e.pipe=P,Object.defineProperty(e,"__esModule",{value:!0})});try{NodeList&&!NodeList.prototype.forEach&&(NodeList.prototype.forEach=function(e,t){for(var n=0;n<this.length;n++)e.call(t,this.item(n),n,this)})}catch(e){}try{"undefined"==typeof StaticNodeList||StaticNodeList.prototype.forEach||(StaticNodeList.prototype.forEach=function(e,t){for(var n=0;n<this.length;n++)e.call(t,this.item(n),n,this)})}catch(e){}try{!function(e){"window"in e&&"document"in e&&"TextRectangle"in this&&!("width"in TextRectangle.prototype)&&Object.defineProperties(TextRectangle.prototype,{width:{get:function(){return this.right-this.left}},height:{get:function(){return this.bottom-this.top}}})}(this)}catch(e){}if(void 0===base2)throw new Error("Base2 not found. wForms 3 depends on the base2 library.");base2.DOM.HTMLElement.implement({hasClass:function(e,t){return e.classList&&e.classList.contains?e.classList.contains(t):e.className.match(new RegExp("(\\s|^)"+t+"(\\s|$)"))},removeClass:function(e,t){base2.DOM.HTMLElement.hasClass(e,t)&&(t=new RegExp("(\\s|^)"+t+"(\\s|$)"),e.className=e.className.replace(t," ").replace(/^\s+|\s+$/g,""))},addClass:function(e,t){base2.DOM.HTMLElement.hasClass(e,t)||(e.className=(e.className+" "+t).replace(/^\s+|\s+$/g,""))}}),"undefined"==typeof wFORMS&&(wFORMS={}),wFORMS.NAME="wFORMS",wFORMS.VERSION="3.11.0",wFORMS.__repr__=function(){return"["+this.NAME+" "+this.VERSION+"]"},wFORMS.toString=function(){return this.__repr__()},wFORMS.behaviors={},wFORMS.helpers={},wFORMS.instances=[],wFORMS.initialized=!1,wFORMS.helpers.dispatchCustomEvent=function(e,t,n){try{t&&"function"==typeof t.dispatchEvent||(t=wFORMS.helpers.getForm(t));var i=new CustomEvent(e+".formassembly",{detail:n,bubbles:!0,cancelable:!0,composed:!1});
1t&&"function"==typeof t.dispatchEvent&&t.dispatchEvent(i)}catch(e){console&&"function"==typeof console.error&&console.error(e)}},wFORMS.helpers.randomId=function(){for(var e=(e=(new Date).getTime()).toString().substr(6),t=0;t<6;t++)e+=String.fromCharCode(48+Math.floor(10*Math.random()));return"id_"+e},wFORMS.helpers.getFieldValue=function(e){switch(e.tagName){case"INPUT":return"checkbox"==e.type?e.checked?e.value:null:"radio"!=e.type||e.checked?e.value:null;case"SELECT":if(-1==e.selectedIndex)return null;if(e.getAttribute("multiple")){for(var t=[],n=0;n<e.options.length;n++)e.options[n].selected&&t.push(e.options[n].value);return t}return e.options[e.selectedIndex].value;case"TEXTAREA":return e.value;default:return null}},wFORMS.helpers.escapeQuerySelector=function(e){return e&&""!==e?e.replace(/\[(\d+)\]/g,function(e,t){return"\\["+t+"\\]"}):null},wFORMS.helpers.getLabel=function(e){if(!e||!e.form)return null;if(!e.form.querySelectorAll)return null;var t=e.getAttribute("id"),t=this.escapeQuerySelector(t);return l=e.form.querySelectorAll("label[for="+t+"]"),l&&1<=l.length?l.item(0).innerHTML:null},wFORMS.helpers.detectLocaleDecimalSeparator=function(){return 1.1.toLocaleString().substring(1,2)},wFORMS.helpers.normalizeNumberToUSLocale=function(e){return e=","==wFORMS.helpers.detectLocaleDecimalSeparator()?String(e).replace(",","."):String(e).replace(",","")},wFORMS.helpers.isNumericValue=function(e){return e=wFORMS.helpers.normalizeNumberToUSLocale(e),!(""===String(e)||!String(e).match(/^\s*(\+|-)?[0-9]*[\.]?[0-9]*\s*$/))},wFORMS.helpers.isEmptyValue=function(e){return""===(e=(e=String(e)).replace(/^\s+|\s+$/g,""))},wFORMS.helpers.getNumericValue=function(e){var t=wFORMS.helpers;t.isNumericValue(e)&&(e=t.normalizeNumberToUSLocale(e));e=parseFloat(e);return e=isNaN(e)?0:e},wFORMS.helpers.getComputedStyle=function(e,t){return document.defaultView.getComputedStyle(e,"").getPropertyValue(t)},wFORMS.helpers.getForm=function(e){return e&&e.tagName&&"form"==e.tagName.toLowerCase()?(wFORMS.standardizeElement(e),e):e.form?(wFORMS.standardizeElement(e.form),e.form):e.parentNode?"form"==e.parentNode.tagName.toLowerCase()?(wFORMS.standardizeElement(e.parentNode),e.parentNode):this.getForm(e.parentNode):null},wFORMS.helpers.getLeft=function(e){for(var t=0;e.offsetParent;){try{if("relative"==document.defaultView.getComputedStyle(e,"").getPropertyValue("position"))return t;if(0<t&&"absolute"==document.defaultView.getComputedStyle(e,"").getPropertyValue("position"))return t}catch(e){}t+=e.offsetLeft,e=e.offsetParent}return!window.opera&&document.all&&document.compatMode&&"BackCompat"!=document.compatMode&&(t+=parseInt(document.body.currentStyle.marginTop)),t},wFORMS.helpers.getTop=function(e){for(var t=0;e.offsetParent;){try{if("relative"==document.defaultView.getComputedStyle(e,"").getPropertyValue("position"))return t;if(0<t&&"absolute"==document.defaultView.getComputedStyle(e,"").getPropertyValue("position"))return t}catch(e){}t+=e.offsetTop,e=e.offsetParent}return!window.opera&&document.all&&document.compatMode&&"BackCompat"!=document.compatMode&&(t+=parseInt(document.body.currentStyle.marginLeft)+1),t},wFORMS.helpers.position=function(e){var t=e.offsetLeft,n=e.offsetTop;return e.offsetParent&&(t+=(e=this.position(e.offsetParent)).left,n+=e.top),{left:t,top:n}},wFORMS.helpers.useSpotlight=!1,wFORMS.helpers.spotlight=function(e){},wFORMS.helpers.activateStylesheet=function(e){var t;document.getElementsByTagName?t=document.getElementsByTagName("link"):document.styleSheets&&(t=document.styleSheets);for(var n=0;t[n];n++)-1!=t[n].href.indexOf(e)&&(t[n].rel="stylesheet",t[n].title="",t[n].disabled=!0,t[n].disabled=!1)},wFORMS.helpers.contains=function(e,t){for(var n=e.length,i=0;i<n;i++)if(e[i]===t)return!0;return!1},wFORMS.helpers.isHTMLElement=function(e){return"object"==typeof HTMLElement?e instanceof HTMLElement:e&&"object"==typeof e&&1===e.nodeType&&"string"==typeof e.nodeName},wFORMS.helpers.deleteResumedFiles=function(e){var t=document.getElementById("tfa_uploadDelete_"+e),e=document.getElementById("tfa_uploadedFile_"+e);return t.checked=!t.checked,e.className=t.checked?"uploadedFile uploadDelete":"uploadedFile uploadKeep",!1},wFORMS.helpers.deleteResumedFilesFinder=function(e){return e=e||document,base2.DOM.HTMLElement.querySelectorAll(e,".deleteUploadedFileCb")},wFORMS.helpers.objectDeepEqual=function(n,i){return n&&i&&"object"==typeof n&&"object"==typeof i?Object.keys(n).length===Object.keys(i).length&&Object.keys(n).reduce(function(e,t){return e&&wFORMS.helpers.objectDeepEqual(n[t],i[t])},!0):n===i},wFORMS.LOADER={},wFORMS.LOADER.enabled=!1,wFORMS.LOADER.message="Please wait...",wFORMS.LOADER.spinner="",wFORMS.LOADER.speed=2,wFORMS.LOADER.show=function(e){var t,n;wFORMS.LOADER.enabled&&((t=wFORMS.LOADER.create()).style.visibility="hidden",t.style.overflow="hidden",n="above"==arguments[1]?e:e.nextSibling,(t=e.parentNode.insertBefore(t,n)).id="wfLoader_"+e.id,wFORMS.LOADER._id=t.id,n=t.clientHeight,t.style.height=n+"px",wFORMS.LOADER._padding=t.clientHeight-n,t.style.height=n-wFORMS.LOADER._padding+"px",t.style.visibility="visible")},wFORMS.LOADER.hide=function(e){var t;wFORMS.LOADER.enabled&&wFORMS.LOADER._id&&((t=document.getElementById(wFORMS.LOADER._id))&&(arguments[1]?t.parentNode.removeChild(t):wFORMS.LOADER._interval=setInterval(function(){var e=t.clientHeight-wFORMS.LOADER.speed-wFORMS.LOADER._padding;t.style.height=(e=e<0?0:e)+"px",!t||t.clientHeight-wFORMS.LOADER._padding||(t.parentNode.removeChild(t),clearInterval(wFORMS.LOADER._interval))},10)),wFORMS.LOADER._id=null)},wFORMS.LOADER.create=function(){var e=document.createElement("DIV");e.className="wfLoader";var t=e.appendChild(document.createElement("DIV"));return t.className="inner",wFORMS.LOADER.spinner&&(t.appendChild(document.createElement("IMG")).src=wFORMS.LOADER.spinner),wFORMS.LOADER.message&&t.appendChild(document.createTextNode(wFORMS.LOADER.message)),e},wFORMS.onLoadHandler=function(){for(var e=document.getElementsByTagName("FORM"),n=[],t=0;t<e.length;t++)!function(t){"no-behavior"!=t.getAttribute("rel")&&n.push(function(){var e;e=t,wFORMS.LOADER.show(e,"above"),setTimeout(function(){wFORMS.applyBehaviors(e),wFORMS.LOADER.hide(e),i()},1)})}(e[t]);function i(){0!=n.length&&n.shift()()}function a(e,t){t=t||{bubbles:!1,cancelable:!1,detail:void 0};var n=document.createEvent("CustomEvent");
1return n.initCustomEvent(e,t.bubbles,t.cancelable,t.detail),n}"function"!=typeof window.CustomEvent&&(a.prototype=window.Event.prototype,window.CustomEvent=a),n.push(function(){wFORMS.initialized=!0;var e=new CustomEvent("wFORMSLoaded");document.dispatchEvent(e)}),i()},wFORMS.standardizeElement=function(e){"HTML"!=e.tagName&&(e.addEventListener||(e.addEventListener=function(e,t,n){base2.DOM.Element.addEventListener(this,e,t,n)}),e.hasClass||(e.hasClass=function(e){return-1!=(" "+this.className+" ").indexOf(" "+e+" ")}),e.removeClass||(e.removeClass=function(e){return base2.DOM.HTMLElement.removeClass(this,e)}),e.addClass||(e.addClass=function(e){return base2.DOM.HTMLElement.addClass(this,e)}))},wFORMS.applyBehaviors=function(e){base2.DOM.bind(e),wFORMS.behaviors.switch&&(o=wFORMS.behaviors.switch.applyTo(e),wFORMS.instances.switch?(wFORMS.removeBehavior(e,"switch"),wFORMS.instances.switch.push(o)):wFORMS.instances.switch=[o]);var t,n=[];for(t in wFORMS.behaviors)n.push(t);var i,a=n.indexOf("validation"),r=n.indexOf("calculation");-1<a&&-1<r&&a<r&&(i=Math.min(a,r),r=Math.max(a,r),r=n.splice(r,1),n.splice(i,0,r[0]));for(var s=0;s<n.length;s++){var o,l=n[s];if("switch"!=l&&wFORMS.behaviors[l].applyTo){(o=wFORMS.behaviors[l].applyTo(e))&&o.constructor!=Array&&(o=[o]);for(var u=0;o&&u<o.length;u++)wFORMS.instances[l]?(wFORMS.removeBehavior(e,l),wFORMS.instances[l].push(o[u])):wFORMS.instances[l]=[o[u]]}}wFORMS.behaviors.onApplyAll&&wFORMS.behaviors.onApplyAll(e),wFORMS.helpers.dispatchCustomEvent("form.behaviors",e,{moduleName:this.NAME,statusText:"applied"})},wFORMS.removeBehavior=function(e,t){return null},wFORMS.getBehaviorInstance=function(e,t){if(!e||!wFORMS.instances[t])return null;for(var n=0;n<wFORMS.instances[t].length;n++)if(wFORMS.instances[t][n].target==e)return wFORMS.instances[t][n];return null};var loadIE=!1;if(loadIE||(document.querySelector('script[data-for="FA__DOMContentLoadedEventDispatch"]')?base2.DOM.Element.addEventListener(document,"FA__DOMContentLoaded",wFORMS.onLoadHandler,!1):base2.DOM.Element.addEventListener(document,"DOMContentLoaded",wFORMS.onLoadHandler,!1)),wFORMS.helpers.activateStylesheet("wforms-jsonly.css"),"undefined"==typeof wFORMS)throw new Error("wFORMS core not found. This behavior depends on the wFORMS core.");if(wFORMS.behaviors.hint={CSS_INACTIVE:"field-hint-inactive",CSS_ACTIVE:"field-hint",HINT_SELECTOR:'*[id$="-H"]',HINT_SUFFIX:"-H",CLOSED_HINTS:[],instance:function(e){this.behavior=wFORMS.behaviors.hint,this.target=e}},wFORMS.behaviors.hint.applyTo=function(e){var i=new wFORMS.behaviors.hint.instance(e);e.querySelectorAll||base2.DOM.bind(e);e=e.querySelectorAll(wFORMS.behaviors.hint.HINT_SELECTOR);return e.forEach||(e.forEach=NodeList.prototype.forEach),e.forEach(function(e){var t=e.querySelector('*[id$="-HH-close-button"]');null!==t&&t.addEventListener("mousedown",function(){i.closeTooltipForHint(e)});var n=i.getElementByHintId(e.id);n&&(n.addEventListener||base2.DOM.bind(n),"SELECT"==n.tagName||"TEXTAREA"==n.tagName||"INPUT"==n.tagName&&"radio"!=n.type&&"checkbox"!=n.type?(n.addEventListener("focus",function(e){i.run(e,this)},!1),n.addEventListener("blur",function(e){t&&e.relatedTarget===t||i.run(e,this)},!1),n.addEventListener("keydown",function(e){27===e.keyCode&&i.run(e,this)},!1)):(n.addEventListener("mouseover",function(e){i.run(e,n)},!1),n.addEventListener("mouseout",function(e){i.run(e,n)},!1)))}),i.onApply(),i},wFORMS.behaviors.hint.instance.prototype.onApply=function(){},wFORMS.behaviors.hint.instance.prototype.run=function(e,t){var n;this.behavior.skip||(n=this.getHintElement(t))&&(n.removeClass||base2.DOM.bind(n),"focus"!=e.type&&"mouseover"!=e.type||-1!==this.behavior.CLOSED_HINTS.indexOf(n.getAttribute("id"))?(n.addClass(wFORMS.behaviors.hint.CSS_INACTIVE),n.removeClass(wFORMS.behaviors.hint.CSS_ACTIVE)):(n.removeClass(wFORMS.behaviors.hint.CSS_INACTIVE),n.addClass(wFORMS.behaviors.hint.CSS_ACTIVE),wFORMS.helpers.getForm(t).hasClass("hintsSide")||this.setup(n,t)))},wFORMS.behaviors.hint.instance.prototype.getElementByHintId=function(e){e=e.substr(0,e.length-wFORMS.behaviors.hint.HINT_SUFFIX.length);return document.getElementById(e)},wFORMS.behaviors.hint.instance.prototype.getHintElement=function(e){e=document.getElementById(e.id+this.behavior.HINT_SUFFIX);return e&&!e.hasClass&&base2.DOM.bind(e),e&&""!=e?e:null},wFORMS.behaviors.hint.instance.prototype.setup=function(e,t){var n=wFORMS.helpers.position(t),i=wFORMS.helpers.position(e),i={left:n.left-i.left,top:n.top-i.top};"select"==t.tagName.toLowerCase()?(e.style.left=e.offsetLeft+i.left+t.offsetWidth+"px",e.style.top=e.offsetTop+i.top+"px"):("span"==t.tagName.toLowerCase()&&(wFORMS.standardizeElement(t),t.hasClass("vertical")?i.left+=t.getBoundingClientRect().width:i.top+=t.getBoundingClientRect().height),e.style.left=e.offsetLeft+i.left+"px",e.style.top=e.offsetTop+i.top+t.offsetHeight+"px")},wFORMS.behaviors.hint.isHintId=function(e){return null!=e.match(new RegExp(wFORMS.behaviors.hint.HINT_SUFFIX+"$"))},wFORMS.behaviors.hint.instance.prototype.closeTooltipForHint=function(e){var t=e.getAttribute("id");-1===this.behavior.CLOSED_HINTS.indexOf(t)&&(this.behavior.CLOSED_HINTS=this.behavior.CLOSED_HINTS.concat(t),e.addClass(wFORMS.behaviors.hint.CSS_INACTIVE),e.removeClass(wFORMS.behaviors.hint.CSS_ACTIVE))},"undefined"==typeof wFORMS)throw new Error("wFORMS core not found. This behavior depends on the wFORMS core.");if(wFORMS.behaviors.paging={SELECTOR:".wfPage, .wfCurrentPage",CSS_PAGE:"wfPage",CSS_CURRENT_PAGE:"wfCurrentPage",CSS_BUTTON_NEXT:"wfPageNextButton",CSS_BUTTON_PREVIOUS:"wfPagePreviousButton",CSS_BUTTON_PLACEHOLDER:"wfPagingButtons",CSS_PAGETAB:"wfPageTab",CSS_TABS:"wfTab",CSS_HIDDENTABS:"wfHiddenTab",CSS_TABSID:"wfTabNav",CSS_TABNAVLABEL:"wfTabNavLabel",CSS_TABSCURRENT:"wfTabCurrentPage",CSS_TABSEPARATOR_SPAN:"wfTabSep",CSS_TABSEPARATOR:" | ",CSS_PROGRESS_BAR_CLASS:"wfProgressBar",ID_BUTTON_NEXT_PREFIX:"wfPageNextId",ID_BUTTON_PREVIOUS_PREFIX:"wfPagePreviousId",CSS_SUBMIT_HIDDEN:"wfHideSubmit",ID_PAGE_PREFIX:"wfPgIndex-",ID_PLACEHOLDER_SUFFIX:"-buttons",ATTR_INDEX:"wfPageIndex_activate",CAPTCHA_ERROR:"#tfa_captcha_text-E",MESSAGES:{CAPTION_NEXT:"Next Page",CAPTION_PREVIOUS:"Previous Page",CAPTION_UNLOAD:"Any data entered on ANY PAGE of this form will be LOST.",NAV_LABEL:"Page: ",TAB_LABEL:"Page "},showTabNavigation:!1,showProgressBar:!1,runValidationOnPageNext:!0,warnOnUnload:!0,onPageNext:function(){},onPagePrevious:function(){},onPageChange:function(){},instance:function(e){this.behavior=wFORMS.behaviors.paging,this.target=e,this.currentPageIndex=1}},wFORMS.behaviors.paging.applyTo=function(l){var u=null,h=wFORMS.behaviors.paging;h.showTabNavigation&&(h.runValidationOnPageNext=!1);
1var t,n,e,i,c=wFORMS.behaviors.validation&&wFORMS.behaviors.paging.runValidationOnPageNext;return base2.DOM.Element.querySelectorAll(l,wFORMS.behaviors.paging.SELECTOR).forEach(function(t){u=u||new wFORMS.behaviors.paging.instance(l);var e,n,i,a=wFORMS.behaviors.paging.getPageIndex(t),r=h.getNextButton(a),s=h.getPreviousButton(a),o=r||s;o||(e=wFORMS.behaviors.paging.isLastPageIndex(a,!0)?u.getOrCreatePlaceHolderForLastPage(t):u.getOrCreatePlaceHolder(t)),1==a?(n=r||base2.DOM.bind(e.appendChild(h._createNextPageButton(a))),c?n.addEventListener("click",function(e){wFORMS.getBehaviorInstance(u.target,"validation").run(e,t)&&u.run(e,n)},!1):n.addEventListener("click",function(e){u.run(e,n)},!1),o||wFORMS.behaviors.paging.showPage(t)):(s?n=s:(n=base2.DOM.bind(h._createPreviousPageButton(a)),e.insertBefore(n,e.firstChild)),n.addEventListener("click",function(e){u.run(e,n)},!1),wFORMS.behaviors.paging.isLastPageIndex(a,!0)||(i=r||base2.DOM.bind(e.appendChild(h._createNextPageButton(a))),c?i.addEventListener("click",function(e){wFORMS.getBehaviorInstance(u.target,"validation").run(e,t)&&u.run(e,i)},!1):i.addEventListener("click",function(e){u.run(e,i)},!1)))}),u&&(p=u.findNextPage(0),u.currentPageIndex=0,u.activatePage(wFORMS.behaviors.paging.getPageIndex(p),!1),window.onbeforeunload||(window.onbeforeunload=function(){if(u.behavior.warnOnUnload)return u.behavior.MESSAGES.CAPTION_UNLOAD}),u.behavior.showTabNavigation&&(t=wFORMS.behaviors.condition.onHide,wFORMS.behaviors.condition.onHide=function(e){t(),u.generateTabs()},n=wFORMS.behaviors.condition.onShow,wFORMS.behaviors.condition.onShow=function(e){n(),u.generateTabs()},u.generateTabs()),(e=document.querySelector('[data-contentid="submit_button"]'))&&e.classList.add("multipage"),u.behavior.showProgressBar&&u.setupProgressBar(),u.onApply(),base2.DOM.Element.querySelector(document,wFORMS.behaviors.paging.CAPTCHA_ERROR)&&(i=wFORMS.behaviors.condition.onSetupFinish,wFORMS.behaviors.condition.onSetupFinish=function(e){i(e);for(var t=1,n=1;n<100;n++)if(u.behavior.isLastPageIndex(n)){t=n;break}u.jumpTo(t)}),base2.DOM.Element.addEventListener(l,"submit",function(e){u.onSubmit(e,u)})),u},wFORMS.behaviors.paging.instance.prototype.onApply=function(){},wFORMS.behaviors.paging.instance.prototype.onSubmit=function(e,t){var n,i;!wFORMS.behaviors.paging.isLastPageIndex(t.currentPageIndex)&&wFORMS.behaviors.paging.runValidationOnPageNext?(n=wFORMS.behaviors.paging.getPageByIndex(t.currentPageIndex),i=t.findNextPage(t.currentPageIndex),wFORMS.getBehaviorInstance(t.target,"validation").run(e,n)&&(t.activatePage(t.currentPageIndex+1),(i=base2.DOM.Element.querySelector(i,"input, textarea, select"))&&i.focus()),e.stopPropagation(),e.preventDefault(),e.pagingStopPropagation=!0):window.onbeforeunload&&(window.onbeforeunload=null)},wFORMS.behaviors.paging.instance.prototype.onPageNext=function(e){this.behavior.onPageNext(e)},wFORMS.behaviors.paging.instance.prototype.onPagePrevious=function(e){this.behavior.onPagePrevious(e)},wFORMS.behaviors.paging.instance.prototype.onPageChange=function(e){if(this.behavior.onPageChange(e),wFORMS.instances.responsive&&wFORMS.instances.responsive[0])for(i=0;i<wFORMS.instances.responsive.length;i++)wFORMS.instances.responsive[i].handleAllMatrixLayouts(),wFORMS.instances.responsive[i].handleAllGridLayouts();this.behavior.showProgressBar&&this.updateProgressBar()},wFORMS.behaviors.paging.instance.prototype.setupProgressBar=function(){var e,t=wFORMS.behaviors.paging.CSS_PROGRESS_BAR_CLASS+"Wrapper";document.getElementsByClassName(t)[0]||(this.target.insertBefore(this.createProgressBar(),this.target.firstChild),e=this,document.addEventListener("wFORMSLoaded",function(){e.updateProgressBar()}))},wFORMS.behaviors.paging.instance.prototype.createProgressBar=function(){var e=this.target.insertBefore(document.createElement("div"),this.target.firstChild);e.classList.add(wFORMS.behaviors.paging.CSS_PROGRESS_BAR_CLASS+"Wrapper");var t=e.appendChild(document.createElement("div"));return t.classList.add(wFORMS.behaviors.paging.CSS_PROGRESS_BAR_CLASS),t.innerHTML="0%",e},wFORMS.behaviors.paging.instance.prototype.updateProgressBar=function(){var e=this.target,t=wFORMS.getBehaviorInstance(e,"validation");t&&(e=this.calculateCompletionByRequiredFields(e,t),(t=document.getElementsByClassName(wFORMS.behaviors.paging.CSS_PROGRESS_BAR_CLASS)[0])&&(t.style.width=e+"%",t.innerHTML=e+"%"))},wFORMS.behaviors.paging.instance.prototype.calculateCompletionByRequiredFields=function(e,i){var a=0,r=0;e.querySelectorAll(".wfPage, .wfCurrentPage").map(e=>{0;
1var n=wFORMS.behaviors.validation.rules.isRequired;e.querySelectorAll(n.selector).map(e=>{var t;i.isSwitchedOff(e)||(t=wFORMS.helpers.getFieldValue(e),i[n.check].call(i,e,t)?r++:a++)})});e=r+a;return 0===e?0:Math.ceil(r/e*100)},wFORMS.behaviors.paging.getPageIndex=function(e){if(e&&e.id){e=e.id.replace(new RegExp(wFORMS.behaviors.paging.ID_PAGE_PREFIX+"(\\d+)"),"$1"),e=parseInt(e);return!isNaN(e)&&e}return!1},wFORMS.behaviors.paging.isElementVisible=function(e){for(;e&&"BODY"!=e.tagName;){if(e.className){if(-1!=e.className.indexOf(this.CSS_CURRENT_PAGE))return!0;if(-1!=e.className.indexOf(this.CSS_PAGE))return!1}e=e.parentNode}return!0},wFORMS.behaviors.paging._createNextPageButton=function(e){var t=this.createNextPageButton();return t.setAttribute(this.ATTR_INDEX,e+1),t.id=this.ID_BUTTON_NEXT_PREFIX+e,t},wFORMS.behaviors.paging.createNextPageButton=function(){var e=document.createElement("input");return e.setAttribute("value",this.MESSAGES.CAPTION_NEXT),e.type="button",e.className=this.CSS_BUTTON_NEXT,e},wFORMS.behaviors.paging._createPreviousPageButton=function(e){var t=this.createPreviousPageButton();return t.setAttribute(this.ATTR_INDEX,e-1),t.id=this.ID_BUTTON_PREVIOUS_PREFIX+e,t},wFORMS.behaviors.paging.createPreviousPageButton=function(){var e=document.createElement("input");return e.setAttribute("value",this.MESSAGES.CAPTION_PREVIOUS),e.type="button",e.className=this.CSS_BUTTON_PREVIOUS,e},wFORMS.behaviors.paging.instance.prototype.getOrCreatePlaceHolder=function(e){var t=e.id+this.behavior.ID_PLACEHOLDER_SUFFIX,n=document.getElementById(t);return n||((n=e.appendChild(document.createElement("div"))).id=t,n.className=this.behavior.CSS_BUTTON_PLACEHOLDER),n},wFORMS.behaviors.paging.instance.prototype.getOrCreatePlaceHolderForLastPage=function(e){var t=e.id+this.behavior.ID_PLACEHOLDER_SUFFIX,n=document.getElementById(t);return n||(e=document.querySelector('[data-contentid="submit_button"]'),(n=document.createElement("div")).id=t,n.classList.add(this.behavior.CSS_BUTTON_PLACEHOLDER,"last-page-previous-button",this.behavior.CSS_SUBMIT_HIDDEN),e.before(n)),n},wFORMS.behaviors.paging.hidePage=function(e){e&&(e.removeClass||(e.removeClass=function(e){return base2.DOM.HTMLElement.removeClass(this,e)}),e.addClass||(e.addClass=function(e){return base2.DOM.HTMLElement.addClass(this,e)}),e.removeClass(wFORMS.behaviors.paging.CSS_CURRENT_PAGE),e.addClass(wFORMS.behaviors.paging.CSS_PAGE))},wFORMS.behaviors.paging.showPage=function(e){e&&(e.removeClass||(e.removeClass=function(e){return base2.DOM.HTMLElement.removeClass(this,e)}),e.removeClass(wFORMS.behaviors.paging.CSS_PAGE),e.addClass||(e.addClass=function(e){return base2.DOM.HTMLElement.addClass(this,e)}),e.addClass(wFORMS.behaviors.paging.CSS_CURRENT_PAGE))},wFORMS.behaviors.paging.instance.prototype.activatePage=function(e){var t;if(t=!(1<arguments.length)||arguments[1],e==this.currentPageIndex)return!1;var n,a,r,s,o=0===this.currentPageIndex;(n=(e=parseInt(e))>this.currentPageIndex?this.findNextPage(this.currentPageIndex):this.findPreviousPage(this.currentPageIndex))&&(e=(a=this).behavior.getPageIndex(n),a.setupManagedControls(e),a.behavior.hidePage(a.behavior.getPageByIndex(a.currentPageIndex)),a.behavior.showPage(n),r=a.currentPageIndex,a.currentPageIndex=e,t&&(n.scrollIntoView?n.scrollIntoView():location.hash="#"+wFORMS.behaviors.paging.ID_PAGE_PREFIX+e),!1==o&&(s=function(e){return!(e instanceof HTMLInputElement&&"hidden"===e.type)&&(!e.classList.contains("offstate")&&!1===e.hidden)},null!==(o=function(e){for(i=0,l=e.length;i<l;i++)if(s(e[i]))return e[i];return null}(n.firstElementChild?n.firstElementChild.children:[]))&&(o.tabIndex=-1,o.focus({preventScroll:!0}))),a.labelCurrentPageTab(n),a.onPageChange(n),r<e?a.onPageNext(n):a.onPagePrevious(n))},wFORMS.behaviors.paging.instance.prototype.setupManagedControls=function(e){e=e||this.currentPageIndex;var t=wFORMS.behaviors.paging;t.isFirstPageIndex(e)?(ctrl=t.getPreviousButton(e))&&(ctrl.style.visibility="hidden"):(ctrl=t.getPreviousButton(e))&&(ctrl.style.visibility="visible"),t.isLastPageIndex(e)?((ctrl=t.getNextButton(e))&&(ctrl.style.visibility="hidden"),this.showSubmitButtons(),this.showCaptchas(document.getElementById(t.ID_PAGE_PREFIX+e+t.ID_PLACEHOLDER_SUFFIX)),this.toggleDisplayMessage(!0),t.isLastPageIndex(e,!0)&&this.toggleLastPagePreviousButton(!0)):((ctrl=t.getNextButton(e))&&(ctrl.style.visibility="visible"),this.hideSubmitButtons(),this.hideCaptchas(),this.toggleDisplayMessage(!1),this.toggleLastPagePreviousButton(!1))},wFORMS.behaviors.paging.instance.prototype.showSubmitButtons=function(){this.target.querySelectorAll('input[type="submit"]').forEach(e
1=>{e.className=e.className.replace(new RegExp("(^|\\s)"+this.behavior.CSS_SUBMIT_HIDDEN+"(\\s|$)","g"),"$2"),this.toggleActionsSection(!0)})},wFORMS.behaviors.paging.instance.prototype.hideSubmitButtons=function(){this.target.querySelectorAll('input[type="submit"]').forEach(e=>{new RegExp("(^|\\s)"+this.behavior.CSS_SUBMIT_HIDDEN+"(\\s|$)").test(e.className)||(e.className+=" "+this.behavior.CSS_SUBMIT_HIDDEN),this.toggleActionsSection(!1)})},wFORMS.behaviors.paging.instance.prototype.hideCaptchas=function(){var e=document.getElementById("google-captcha"),t=document.getElementById("captcha");null!=e&&(e.style.display="none"),null!=t&&(t.style.display="none")},wFORMS.behaviors.paging.instance.prototype.showCaptchas=function(e){var t,n=document.getElementById("submit_button");Object.prototype.hasOwnProperty.call(wFORMS.behaviors,"condition")&&n&&n.hasAttribute("data-condition")&&!wFORMS.behaviors.condition.isConditionalSubmitConditionMet||(t=document.getElementById("google-captcha"),n=document.getElementById("captcha"),null!=t&&(null!=e&&e.parentNode.insertBefore(t,e),t.style.display="block"),null!=n&&(n.style.display="block"))},wFORMS.behaviors.paging.instance.prototype.toggleActionsSection=function(e){var t=document.querySelector('[data-contentid="submit_button"]');t&&(e?t.classList.remove(this.behavior.CSS_SUBMIT_HIDDEN):t.classList.add(this.behavior.CSS_SUBMIT_HIDDEN))},wFORMS.behaviors.paging.instance.prototype.toggleDisplayMessage=function(e){var t=document.getElementsByClassName("action-display-message")[0];t&&(e?t.classList.remove(this.behavior.CSS_SUBMIT_HIDDEN):t.classList.add(this.behavior.CSS_SUBMIT_HIDDEN))},wFORMS.behaviors.paging.instance.prototype.toggleLastPagePreviousButton=function(e){var t=document.getElementsByClassName("last-page-previous-button")[0];t&&(e?t.classList.remove(this.behavior.CSS_SUBMIT_HIDDEN):t.classList.add(this.behavior.CSS_SUBMIT_HIDDEN))},wFORMS.behaviors.paging.getPageByIndex=function(e){e=document.getElementById(wFORMS.behaviors.paging.ID_PAGE_PREFIX+e);return!!e&&base2.DOM.bind(e)},wFORMS.behaviors.paging.getNextButton=function(e){return document.getElementById(wFORMS.behaviors.paging.ID_BUTTON_NEXT_PREFIX+e)},wFORMS.behaviors.paging.getPreviousButton=function(e){return document.getElementById(wFORMS.behaviors.paging.ID_BUTTON_PREVIOUS_PREFIX+e)},wFORMS.behaviors.paging.isLastPageIndex=function(e,t){e=parseInt(e)+1;var n=wFORMS.behaviors.paging,i=n.getPageByIndex(e);if((_b=wFORMS.behaviors.condition)&&!t)for(;i&&_b.hasOffState(i);)i=n.getPageByIndex(++e);return!i},wFORMS.behaviors.paging.isFirstPageIndex=function(e,t){e=parseInt(e)-1;var n=wFORMS.behaviors.paging,i=n.getPageByIndex(e);if((_b=wFORMS.behaviors.condition)&&!t)for(;i&&_b.hasOffState(i);)i=n.getPageByIndex(--e);return!i},wFORMS.behaviors.paging.instance.prototype.findNextPage=function(e){e=parseInt(e)+1;var t=wFORMS.behaviors.paging,n=t.getPageByIndex(e);if(_b=wFORMS.behaviors.condition)for(;n&&_b.hasOffState(n);)n=t.getPageByIndex(++e);return n},wFORMS.behaviors.paging.instance.prototype.findPreviousPage=function(e){e=parseInt(e)-1;var t=wFORMS.behaviors.paging,n=t.getPageByIndex(e);if(_b=wFORMS.behaviors.condition)for(;n&&_b.hasOffState(n);)n=t.getPageByIndex(--e);return n||!1},wFORMS.behaviors.paging.instance.prototype.jumpTo=function(e){var t,n=this,i=e;n.currentPageIndex!=i&&(n.behavior.hidePage(n.behavior.getPageByIndex(n.currentPageIndex)),n.setupManagedControls(i),n.behavior.showPage(n.behavior.getPageByIndex(i)),n.currentPageIndex=i),vInstance=wFORMS.getBehaviorInstance(n.target,"validation"),vInstance&&vInstance.errorPages&&vInstance.errorPages[i]&&!arguments[1]&&((t=document.getElementById(vInstance.errorPages[i][0])).scrollIntoView&&setTimeout(function(){t.scrollIntoView()},1));i=n.behavior.getPageByIndex(i);this.labelCurrentPageTab(i),this.onPageChange(i)},wFORMS.behaviors.paging.instance.prototype.generateTabs=function(e){var r=this;document.getElementById(this.behavior.CSS_TABSID)&&(n=document.getElementById(this.behavior.CSS_TABSID)).parentNode.removeChild(n);var s=document.createElement("div");s.id=this.behavior.CSS_TABSID,s.className=this.behavior.CSS_TABSID;var t=document.createTextNode(this.behavior.MESSAGES.NAV_LABEL),n=document.createElement("span");n.className=this.behavior.CSS_TABNAVLABEL,n.appendChild(t),s.appendChild(n),e?e.appendChild(s):this.target.parentNode.insertBefore(s,this.target);var o=base2.DOM.Element.querySelectorAll(this.target,"."+this.behavior.CSS_PAGE+", ."+this.behavior.CSS_CURRENT_PAGE);o.forEach(function(e,t){var n;wFORMS.behaviors.condition.hasOffState(e)?((n=document.createElement("span")).setAttribute("class",r.behavior.CSS_TABS+" "+r.behavior.CSS_HIDDENTABS),n.setAttribute("id",r.behavior.CSS_PAGETAB+"_"+(t+1))):((n=document.createElement("a")).setAttribute("class",r.behavior.CSS_TABS),n.setAttribute("id",r.behavior.CSS_PAGETAB+"_"+(t+1)),n.setAttribute("href","#"),base2.DOM.Element.addEventListener(n,"click",function(e){return r.jumpTo(t+1),e.preventDefault(),!1}));var i=base2.DOM.Element.querySelector(e,"h4"),e=null;i&&(e=i.innerText||i.textContent),n.setAttribute("title",e||r.behavior.MESSAGES.TAB_LABEL+(t+1));var a,e=document.createTextNode(t+1);n.appendChild(e),t<o.length-1&&((a=document.createElement("span")).className=r.behavior.CSS_TABSEPARATOR_SPAN,e=document.createTextNode(r.behavior.CSS_TABSEPARATOR),a.appendChild(e)),s.appendChild(n),a&&s.appendChild(a)});e=r.behavior.getPageByIndex(1);return this.labelCurrentPageTab(e),this.onPageChange(e),o},wFORMS.behaviors.paging.instance.prototype.labelCurrentPageTab=function(e){currentIndex=(_b=this).currentPageIndex,base2.DOM.Element.querySelectorAll(this.target.parentNode,'a[id^="'+this.behavior.CSS_PAGETAB+'"]').forEach(function(e){e.removeClass&&e.hasClass&&e.addClass||wFORMS.standardizeElement(e),e.removeClass(_b.behavior.CSS_TABSCURRENT),e.getAttribute("id")==_b.behavior.CSS_PAGETAB+"_"+currentIndex&&e.addClass(_b.behavior.CSS_TABSCURRENT)})},wFORMS.behaviors.paging.instance.prototype.run=function(e,t){this.activatePage(t.getAttribute(wFORMS.behaviors.paging.ATTR_INDEX))},wFORMS.behaviors.paging.helpers={},wFORMS.behaviors.paging.helpers.findPage=function(e){return e&&(e.className.match("wfPage")||e.className.match("wfCurrentPage"))?(wFORMS.standardizeElement(e),e):e&&e.parentNode?e.parentNode.className.match("wfPage")||e.parentNode.className.match("wfCurrentPage")?(wFORMS.standardizeElement(e.parentNode),e.parentNode):wFORMS.behaviors.paging.helpers.findPage(e.parentNode):null},"undefined"==typeof wFORMS)throw new Error("wFORMS core not found. This behavior depends on the wFORMS core.");wFORMS.behaviors.repeat={SELECTOR_REPEAT:'*[class~="repeat"]',SELECTOR_REMOVEABLE:'*[class~="removeable"]',ID_SUFFIX_DUPLICATE_LINK:"-wfDL",ID_SUFFIX_COUNTER:"-RC",CSS_DUPLICATE_LINK:"duplicateLink",CSS_DUPLICATE_SPAN:"duplicateSpan",CSS_DELETE_LINK:"removeLink",CSS_DELETE_SPAN:"removeSpan",CSS_REMOVEABLE:"removeable",CSS_REPEATABLE:"repeat",ATTR_DUPLICATE:"wfr__dup",ATTR_DUPLICATE_ELEM:"wfr__dup_elem",ATTR_LABEL:"data-repeatlabel",ATTR_HANDLED:"wfr_handled",ATTR_MASTER_SECTION:"wfr__master_sec",ATTR_LINK_SECTION_ID:"wfr_sec_id",MESSAGES:{ADD_CAPTION:"Add another response",ADD_TITLE:"Will duplicate this question or section.",REMOVE_CAPTION:"Remove",REMOVE_TITLE:"Will remove this question or section",REMOVE_WARNING:"Are you sure you want to remove this section? All data in this section will be lost."},UPDATEABLE_ATTR_ARRAY:["id","name","for"],preserveRadioName:!1,CSS_PRESERVE_RADIO_NAME:"preserveRadioName",onRepeat:function(e){},onRemove:function(e){},allowRepeat:function(e,t){return!0},_callbacks:{onRepeatStart:[],onRepeat:[],onRemove:[],onMasterIdChange:[],onRepeatIdCreate:[]},instance:function(e){this.behavior=wFORMS.behaviors.repeat,this.target=e,this._idUpdates={master:{},repeat:{}}}};var _b=wFORMS.behaviors.repeat,_i=wFORMS.behaviors.repeat.instance;if(_b.applyTo=function(e){var t,a=this,r=new Array;e.querySelectorAll||base2.DOM.bind(e),wFORMS.behaviors.repeat.getMasterSection(e)&&(Array(),(t=wFORMS.behaviors.repeat.getMasterSection(e)).querySelectorAll||base2.DOM.bind(t)),e.querySelectorAll(this.SELECTOR_REPEAT).forEach(function(e,t){var n,i;a.isHandled(e)||(e.id||(e.id=wFORMS.helpers.randomId()),n=new a.instance(e),
1(i=n.getOrCreateRepeatLink(e)).addEventListener("click",function(e){n.run(e,i)},!1),n.setElementHandled(e),r.push(n))}),e.hasClass||(e.hasClass=function(e){return base2.DOM.HTMLElement.hasClass(this,e)}),e.hasClass(this.CSS_REMOVEABLE)&&(t=this.getMasterSection(e),(t=wFORMS.getBehaviorInstance(t,"repeat"))?t.getOrCreateRemoveLink(e):r[0]&&r[0].getOrCreateRemoveLink(e)),e.querySelectorAll(this.SELECTOR_REMOVEABLE).forEach(function(e){var t=wFORMS.behaviors.repeat.getMasterSection(e),t=wFORMS.getBehaviorInstance(t,"repeat");t?t.getOrCreateRemoveLink(e):r[0]&&r[0].getOrCreateRemoveLink(e)});for(var n=0;n<r.length;n++)r[n].onApply();return r},_i.prototype.onApply=function(){var e=this.doesCounterFieldExist(this.target)?this.getSectionsCount():1;1<e&&(this.counterRepeatedFields=e);e=parseInt(this.target.getAttribute("data-repeatlimit"));isNaN(e)||null==e||this.counterRepeatedFields>=e&&(e=this.target.id+this.behavior.ID_SUFFIX_DUPLICATE_LINK,document.getElementById(e).style.display="none")},_i.prototype.counterRepeatedFields=1,_i.prototype.getOrCreateRepeatLink=function(e){var t=e.id+this.behavior.ID_SUFFIX_DUPLICATE_LINK;if(!(n=document.getElementById(t))||""==n){var n=this.createRepeatLink(t),i=document.createElement("div");if(i.className=this.behavior.CSS_DUPLICATE_SPAN,n=i.appendChild(n),"TR"==e.tagName.toUpperCase()){t=e.parentNode.parentNode;t.style.marginBottom="0px";for(var a=t.nextSibling;a&&1!=a.nodeType;)a=a.nextSibling;a?t.parentNode.insertBefore(i,a):t.parentNode.appendChild(i)}else e.parentNode.insertBefore(i,this.getLastRepeat(e).nextSibling);e.classList.contains("wf-acl-hidden")&&i.classList.add("wf-acl-hidden")}return base2.DOM.bind(n)},_i.prototype.getLastRepeat=function(e){var t=e.parentNode;t.querySelectorAll||base2.DOM.bind(t);var n=e.id.match("^.[^[]+")[0],n=t.querySelectorAll(wFORMS.behaviors.repeat.SELECTOR_REMOVEABLE+"[id^="+n+"]");return 0<n.length?n.item(n.length-1):e},_i.prototype.createRepeatLink=function(e){var t=document.createElement("A");t.id=e,t.setAttribute("href","#"),t.className=this.behavior.CSS_DUPLICATE_LINK,t.setAttribute("title",this.behavior.MESSAGES.ADD_TITLE);e=this.target.getAttribute(wFORMS.behaviors.repeat.ATTR_LABEL);return t.innerHTML=e||this.behavior.MESSAGES.ADD_CAPTION,t},_i.prototype.getOrCreateRemoveLink=function(e){var t=this.createRemoveLink(e.id);"TR"==e.tagName?e.getElementsByClassName("repeatRemoveLink")[0].appendChild(t):e.insertBefore(t,e.children[0])},_i.prototype.createRemoveLink=function(e){var t=document.createElement("a");t.id=e+this.behavior.ID_SUFFIX_DUPLICATE_LINK,t.setAttribute("href","#"),t.className=this.behavior.CSS_DELETE_LINK,t.setAttribute("title",this.behavior.MESSAGES.REMOVE_TITLE),t.setAttribute(this.behavior.ATTR_LINK_SECTION_ID,e);e=document.createElement("span");e.appendChild(document.createTextNode(this.behavior.MESSAGES.REMOVE_CAPTION)),t.appendChild(e);var n=this;return t.onclick=function(e){return n.onRemoveLinkClick(e,t),!1},(e=document.createElement("span")).className=this.behavior.CSS_DELETE_SPAN,e.appendChild(t),e},_i.prototype.counterRepeatedFields=1,_i.prototype.duplicateSection=function(e){if(!this.behavior.allowRepeat(e,this))return!1;this.callRepeatStartObservers(e),this.updateMasterSection(e);var t=e.cloneNode(!0),n=this.getNextDuplicateIndex(this.target),i=this.createSuffix(e,n);this.updateDuplicatedSection(t,n,i),t=e.parentNode.insertBefore(t,this.getInsertNode(e)),this.callRepeatCompleteObservers(e,t),wFORMS.applyBehaviors(t),this.counterRepeatedFields++;i=e.getAttribute("data-repeatlimit"),e=e.id+this.behavior.ID_SUFFIX_DUPLICATE_LINK;null!=i&&this.counterRepeatedFields>=i&&(document.getElementById(e).style.display="none"),this.behavior.onRepeat(t),wFORMS.helpers.spotlight(t)},_i.prototype.removeSection=function(e){var t,n;e&&(n=this.behavior.getMasterSection(e),this.logRemovedSection(e),e=e.parentNode.removeChild(e),this.callRemoveCompleteObservers(e),this.counterRepeatedFields--,t=e.getAttribute("data-repeatlimit"),n=n.id+this.behavior.ID_SUFFIX_DUPLICATE_LINK,null!=t&&this.counterRepeatedFields<=t&&(document.getElementById(n).style.display=""),this.behavior.onRemove(e))},_i.prototype.logRemovedSection=function(e){var t,n,i;e&&e.id&&(t=e.id,i=this.behavior.getMasterSection(e),(n=this.getOrCreateCounterField(i))&&(e=[],(i=n.value.split("|"))[1]&&(e=i[1].split(",")),i=i[0],e.push(t),n.value=i+"|"+e.join(",")))},_i.prototype.getInsertNode=function(e){var t=e.nextSibling;for(t&&1==t.nodeType&&!t.hasClass&&(t.hasClass=function(e){return base2.DOM.HTMLElement.hasClass(this,e)});t&&(1!=t.nodeType||t.hasClass(this.behavior.CSS_REMOVEABLE));)(t=t.nextSibling)&&1==t.nodeType&&!t.hasClass&&(t.hasClass=function(e){return base2.DOM.HTMLElement.hasClass(this,e)});return t},_i.prototype.onRemoveLinkClick=function(e,t){confirm(this.behavior.MESSAGES.REMOVE_WARNING)&&(t=document.getElementById(t.getAttribute(this.behavior.ATTR_LINK_SECTION_ID)),this.removeSection(t),e&&e.preventDefault())},_i.prototype.updateMasterSection=function(e){if(1==e.doItOnce)return!0;e.doItOnce=!0;var t=e.id,n=this.createSuffix(e);e.id=this.clearSuffix(e.id)+n,e.id!=t&&this.callMasterIdChangeObservers(t,e.id),this.updateMasterElements(e,n,t)},_i.prototype.updateMasterElements=function(e,t,n){if(e&&1==e.nodeType){e.hasClass||(e.hasClass=function(e){return base2.DOM.HTMLElement.hasClass(this,e)}),e.hasClass(this.behavior.CSS_REPEATABLE)&&n!=e.id&&(document.getElementById(n+this.behavior.ID_SUFFIX_DUPLICATE_LINK).id=n+t+this.behavior.ID_SUFFIX_DUPLICATE_LINK);for(var i=e.childNodes,a=0;a<i.length;a++){var r=i[a];if(1==r.nodeType){r.hasClass||(r.hasClass=function(e){return base2.DOM.HTMLElement.hasClass(this,e)});var s=t;r.hasClass(this.behavior.CSS_REPEATABLE)&&(t+="[0]");n=r.id;if(!r.hasClass(this.behavior.CSS_REMOVEABLE)){for(var o=0;o<this.behavior.UPDATEABLE_ATTR_ARRAY.length;o++){var l,u,h=this.behavior.UPDATEABLE_ATTR_ARRAY[o],c=this.clearSuffix(r.getAttribute(h));c&&("id"==h&&wFORMS.behaviors.hint&&wFORMS.behaviors.hint.isHintId(r.i
1d)?r.id=c.replace(new RegExp("(.*)("+wFORMS.behaviors.hint.HINT_SUFFIX+")$"),"$1"+t+"$2"):"id"==h&&wFORMS.behaviors.validation&&wFORMS.behaviors.validation.isErrorPlaceholderId(r.id)?r.id=c.replace(new RegExp("(.*)("+wFORMS.behaviors.validation.ERROR_PLACEHOLDER_SUFFIX+")$"),"$1"+t+"$2"):"id"==h?(l=c.substr(-2),u=c.substr(-5),"-L"==l||"-D"==l||"-R"==l?r.id=c.substr(0,c.length-2)+t+l:"-wfDL"!==u&&(r.id=c+t)):"name"==h?"[]"==c.substr(-2)?r.name=c.substr(0,c.length-2)+t+"[]":r.name=c+t:r.setAttribute(h,c+t))}this.updateMasterElements(r,t,n)}r.id!=n&&this.callMasterIdChangeObservers(n,r.id),t=s}}}},_i.prototype.updateDuplicatedSection=function(e,t,n){e[this.behavior.ATTR_MASTER_SECTION]=e.id;var i,a=e.id;e.id=this.clearSuffix(e.id)+n,e.className=e.className.replace(this.behavior.CSS_REPEATABLE,this.behavior.CSS_REMOVEABLE),e.hasClass||(e.hasClass=function(e){return base2.DOM.HTMLElement.hasClass(this,e)}),i=!!e.hasClass(this.behavior.CSS_PRESERVE_RADIO_NAME)||this.behavior.preserveRadioName,e.id!=a&&this.callRepeatIdCreateObservers(a,e.id),this.updateSectionChildNodes(e,n,i)},_i.prototype.updateSectionChildNodes=function(e,t,n){e.doItOnce&&(e.doItOnce=null);for(var i=new Array,a=0;e&&e.childNodes&&e.childNodes[a];){var r=e.childNodes[a];if(a++,1==r.nodeType)if(r.hasClass||(r.hasClass=function(e){return base2.DOM.HTMLElement.hasClass(this,e)}),this.behavior.isDuplicate(r))i.push(r);else if(r.hasClass(this.behavior.CSS_DUPLICATE_SPAN))i.push(r);else if(r.hasClass(this.behavior.CSS_DUPLICATE_LINK))i.push(r);else if(!r.id.match("-R$")||"hidden"!=r.type||r.hasAttribute("data-wforms-repeat-generated"))if(r.hasClass("uploadedFile"))i.push(r);else{"INPUT"==r.tagName&&"file"==r.type&&"none"==r.style.display&&(r.style.display="");var s=r.getAttribute("default");if(!s&&("radio"==r.type||"checkbox"==r.type||"SELECT"==r.tagName))if("SELECT"==r.tagName)for(var o=0;o<r.options.length;o++){var l=r.options[o];l.selected=l.getAttribute("data-default-value")&&""!==l.getAttribute("value")}else r.getAttribute("data-default-value")&&(s=r.getAttribute("value"));"INPUT"==r.tagName&&!r.hasAttribute("data-wforms-repeat-generated")&&"button"!=r.type||"TEXTAREA"==r.tagName?"radio"!=r.type&&"checkbox"!=r.type?(r.value=s||"","TEXTAREA"==r.tagName&&(r.innerHTML=null==s?"":s,r.innerText=null==s?"":s)):r.checked=r.value===s:"SELECT"==r.tagName&&r.setAttribute("selected",s?"selected":"");s=r.id;"INPUT"==r.tagName&&r.type,this.updateAttributes(r,t,n),r.hasClass(this.behavior.CSS_REPEATABLE)?("-D"==r.id.substr(-2)?r.id=r.id.substr(0,r.id.length-2)+"[0]-D":r.id=r.id+"[0]",this.updateSectionChildNodes(r,t+"[0]",n)):this.updateSectionChildNodes(r,t,n),r.id!=s&&this.callRepeatIdCreateObservers(s,r.id)}else i.push(r)}for(a=0;a<i.length;a++)(r=i[a]).clearAttributes&&r.clearAttributes(!1),r.parentNode&&r.parentNode.removeChild(r)},_i.prototype.createSuffix=function(e,t){var n,i="["+(t||"0")+"]",a=/\[(\d+)\]$/;for(e=e.parentNode;e&&e.tagName;)e.hasClass||(e.hasClass=function(e){return base2.DOM.HTMLElement.hasClass(this,e)}),(e.hasClass(this.behavior.CSS_REPEATABLE)||e.hasClass(this.behavior.CSS_REMOVEABLE))&&(i="["+((n=(n=a.exec(e.id))&&n[1])||"0")+"]"+i),e=e.parentNode;return i},_i.prototype.clearSuffix=function(e){if(e)return e=e.replace(/(\[\d+])+(\[])?(-[RHELD])?$/,"$2$3")},_i.prototype.getParentMultipleChoiceWithDefaultValue=function(e){for(var t=e;null!==t.parentElement&&-1===(t=t.parentElement).className.indexOf("oneField"););if(-1===t.className.indexOf("oneField"))return null;for(var n=t.querySelectorAll("option, input"),i=!1,a=0;a<n.length;a++)n[a].getAttribute("data-default-value")&&(i=!0);return i?t:null},_i.prototype.updateAttributes=function(e,t,n){var i=wFORMS.behaviors.hint&&wFORMS.behaviors.hint.isHintId(e.id),a=wFORMS.behaviors.validation&&wFORMS.behaviors.validation.isErrorPlaceholderId(e.id),r=wFORMS.behaviors.calculation&&wFORMS.behaviors.calculation.isHandled(e);if(this.setInDuplicateGroup(e),this.behavior.isHandled(e)&&this.removeHandled(e),e.hasAttribute("disabled")&&"disabled"===e.getAttribute("data-wforms-nooverwrite")){var s=this.getParentMultipleChoiceWithDefaultValue(e);if(s){var o=s.id.split("-")[0];if("INPUT"===e.tagName&&e.getAttribute("data-default-value"))(p=document.createElement("input")).setAttribute("type","hidden"),p.setAttribute("id",o+"-R"),p.setAttribute("name",e.getAttribute("name")),p.setAttribute("value",e.getAttribute("value")),p.setAttribute("data-wforms-repeat-generated",!0),e.parentElement.appendChild(p);else if("SELECT"===e.tagName){for(var l=e.getAttribute("multiple"),u=e.options,h=[],c=0;c<u.length;c++){var d=u[c];d.selected&&h.push(d.value)}for(var p,g=0;g<h.length;g++)(p=document.createElement("input")).setAttribute("type","hidden"),p.setAttribute("id",o+"-R"),p.setAttribute("name",e.getAttribute("name")+(l?"[]":"")),p.value=h[g],p.setAttribute("data-wforms-repeat-generated",!0),e.parentElement.appendChild(p)}}else e.removeAttribute("data-wforms-nooverwrite"),e.removeAttribute("disabled")}"disabled"!==e.getAttribute("data-wforms-nooverwrite")||r||!e.hasAttribute("readonly")||e.value||(e.removeAttribute("data-wforms-nooverwrite"),e.removeAttribute("readonly")),wFORMS.behaviors.switch&&wFORMS.behaviors.switch.isHandled(e)&&wFORMS.behaviors.switch.removeHandle(e),r&&wFORMS.behaviors.calculation.removeHandledFlag(e);for(var f=this.behavior.UPDATEABLE_ATTR_ARRAY.length,v=0;v<f;v++){var m,S=this.behavior.UPDATEABLE_ATTR_ARRAY[v],b=this.clearSuffix(e.getAttribute(S));b&&("name"==S&&"INPUT"==e.tagName&&n||(a&&"id"==S?e.id=b.replace(new RegExp("(.*)("+wFORMS.behaviors.val
1idation.ERROR_PLACEHOLDER_SUFFIX+")$"),"$1"+t+"$2"):i&&"id"==S?e.id=b.replace(new RegExp("(.*)("+wFORMS.behaviors.hint.HINT_SUFFIX+")$"),"$1"+t+"$2"):"id"==S?(m=b.substr(-2),e.id="-L"==m||"-D"==m||"-R"==m?b.substr(0,b.length-2)+t+m:b+t):"name"==S?"[]"==b.substr(-2)?e.name=b.substr(0,b.length-2)+t+"[]":e.name=b+t:e.setAttribute(S,b+t)))}},_i.prototype.getNextDuplicateIndex=function(e){var t=this.getOrCreateCounterField(e),n=[];(e=t.value.split("|"))[1]&&(n=e[1].split(","));e=e[0],e=parseInt(e)+1;return t.value=e+(0<n.length?"|"+n.join(","):""),e},_i.prototype.doesCounterFieldExist=function(e){e=e.id+this.behavior.ID_SUFFIX_COUNTER,e=document.getElementById(e);return!(!e||""==e)},_i.prototype.getOrCreateCounterField=function(e){var t=e.id+this.behavior.ID_SUFFIX_COUNTER;if(!(n=document.getElementById(t))||""==n){for(var n=this.createCounterField(t),i=e.parentNode;i&&"FORM"!=i.tagName.toUpperCase();)i=i.parentNode;i.appendChild(n)}return n},_i.prototype.createCounterField=function(e){return cElem=document.createElement("input"),cElem.id=e,cElem.setAttribute("type","hidden"),cElem.setAttribute("name",e),cElem.value="0",cElem},_i.prototype.getSectionsCount=function(){if(this.behavior.isDuplicate(this.target))return!1;var e=this.getOrCreateCounterField(this.target).value.split("|"),t=parseInt(e[0]);return 1<e.length&&(t-=e[1].split(",").length),t+1},_i.prototype.setInDuplicateGroup=function(e){return e.setAttribute(this.behavior.ATTR_DUPLICATE_ELEM,!0)},_i.prototype.setElementHandled=function(e){return e.setAttribute(this.behavior.ATTR_HANDLED,!0)},_i.prototype.removeHandled=function(e){return e.removeAttribute(this.behavior.ATTR_HANDLED)},_b.isDuplicate=function(e){return e.hasClass||(e.hasClass=function(e){return base2.DOM.HTMLElement.hasClass(this,e)}),e.hasClass(this.CSS_REMOVEABLE)},_b.isMaster=function(e){return e.hasClass||(e.hasClass=function(e){return base2.DOM.HTMLElement.hasClass(this,e)}),e.hasClass(this.CSS_REPEATABLE)},_b.isInDuplicateGroup=function(e){return!!e.getAttribute(this.ATTR_DUPLICATE_ELEM)},_b.getRepeatedElement=function(e){for(;e&&1==e.nodeType&&"BODY"!=e.tagName;){if(base2.DOM.HTMLElement.hasClass(e,this.CSS_REMOVEABLE)||base2.DOM.HTMLElement.hasClass(e,this.CSS_REPEATABLE))return e;e=e.parentNode}return null},_b.isHandled=function(e){return e.getAttribute(this.ATTR_HANDLED)},_b.getMasterSection=function(e){if(!this.isDuplicate(e))return!1;if(e[this.ATTR_MASTER_SECTION])return document.getElementById(e[this.ATTR_MASTER_SECTION]);for(e=e.previousSibling;
1e&&(1!=e.nodeType||!this.isMaster(e));)e=e.previousSibling;return e},_b.observeMasterIdChange=function(e){this.stopObservingMasterIdChange(e),this._callbacks.onMasterIdChange.push(e)},_b.stopObservingMasterIdChange=function(e){for(var t=0;t<this._callbacks.onMasterIdChange.length;t++)if(this._callbacks.onMasterIdChange[t].toString()==e.toString())return void this._callbacks.onMasterIdChange.splice(t,1)},_i.prototype.callMasterIdChangeObservers=function(e,t){this._idUpdates.master[e]=t;for(var n=0;n<this.behavior._callbacks.onMasterIdChange.length;n++)this.behavior._callbacks.onMasterIdChange[n].call(window,e,t)},_b.observeRepeatIdCreate=function(e){this.stopObservingRepeatIdCreate(e),this._callbacks.onRepeatIdCreate.push(e)},_b.stopObservingRepeatIdCreate=function(e){for(var t=0;t<this._callbacks.onRepeatIdCreate.length;t++)if(this._callbacks.onRepeatIdCreate[t].toString()==e.toString())return void this._callbacks.onRepeatIdCreate.splice(t,1)},_i.prototype.callRepeatIdCreateObservers=function(e,t){this._idUpdates.repeat[e]=t;for(var n=0;n<this.behavior._callbacks.onRepeatIdCreate.length;n++)this.behavior._callbacks.onRepeatIdCreate[n].call(window,e,t)},_b.observeRepeatStart=function(e){this.stopObservingRepeatStart(e),this._callbacks.onRepeatStart.push(e)},_b.stopObservingRepeatStart=function(e){for(var t=0;t<this._callbacks.onRepeatStart.length;t++)if(this._callbacks.onRepeatStart[t].toString()==e.toString())return void this._callbacks.onRepeatStart.splice(t,1)},_i.prototype.callRepeatStartObservers=function(e){for(var t=0;t<this.behavior._callbacks.onRepeatStart.length;t++)this.behavior._callbacks.onRepeatStart[t].call(window,e)},_b.observeRepeatComplete=function(e){this.stopObservingRepeatComplete(e),this._callbacks.onRepeat.push(e)},_b.stopObservingRepeatComplete=function(e){for(var t=0;t<this._callbacks.onRepeat.length;t++)if(this._callbacks.onRepeat[t].toString()==e.toString())return void this._callbacks.onRepeat.splice(t,1)},_i.prototype.callRepeatCompleteObservers=function(e,t){for(var n=0;n<this.behavior._callbacks.onRepeat.length;n++)this.behavior._callbacks.onRepeat[n].call(window,e,t,function e(t){if(null==t||"object"!=typeof t)return t;var n,i=t.constructor();for(n in t)t.hasOwnProperty(n)&&(i[n]=e(t[n]));return i}(this._idUpdates));this._idUpdates={master:{},repeat:{}}},_b.observeRemoveComplete=function(e){this.stopObservingRemoveComplete(e),this._callbacks.onRemove.push(e)},_b.stopObservingRemoveComplete=function(e){for(var t=0;t<this._callbacks.onRemove.length;t++)if(this._callbacks.onRemove[t].toString()==e.toString())return void this._callbacks.onRemove.splice(t,1)},_i.prototype.callRemoveCompleteObservers=function(e){for(var t=0;t<this.behavior._callbacks.onRemove.length;t++)this.behavior._callbacks.onRemove[t].call(window,e)},_i.prototype.run=function(e){var t;wFORMS.LOADER.enabled?(t=this,wFORMS.LOADER.show(t.target),setTimeout(function(){t.duplicateSection(t.target),wFORMS.LOADER.hide(t.target,!0)},1)):this.duplicateSection(this.target),e&&e.preventDefault()},"undefined"==typeof wFORMS)throw new Error("wFORMS core not found. This behavior depends on the wFORMS core.");if(wFORMS.behaviors.condition=function(){"use strict";var DELIMITER="`",CONDITIONAL_ATTRIBUTE_NAME="data-condition",TRIGGER_CONDITIONALS="data-conditionals",TRIGGER_DEFAULT_ENABLED=!0,DEFAULT_NON_EXIST_TRIGGER_VALUE=!1,isConditionalSubmitConditionMet=!1;function _renameTriggers(e,r,s){s=s||[];var t=reduce(e,function(e,t,n){return new Trigger(e).isValid()&&(n[t]=e),n},{}),o=reduce(e,function(e,t,n){return new Conditional(e).isValid()&&(n[t]=e),n},{});map(t,function(i,a){map(new Trigger(i).getConditionals(),function(t){var e=o[t.getIdentifier()]||t.getIdentifier(),n=[e];
1r[e]&&n.push(r[e]),map(n,function(e){(t=new Conditional(e)).isValid()&&(t.unlinkTriggers(),t.replaceTrigger(a,i),s.push(e),t.linkTriggers())})})})}function _renameConditionals(e,n){var t=reduce(e.repeat,function(e,t,n){return new Conditional(e).isValid()&&(n[t]=e),n},{}),i=map(t,function(e,t){return e});isObjectEmpty(e.master)||(i=i.concat(map(t,function(e,t){return t}))),map(i,function(e){var t=new Conditional(e);t.unlinkTriggers(),t.linkTriggers(),n.push(e)})}function _consolidateTriggers(e,a,r,s){s=s||[],map(reduce(e,function(e,t,n){return new Trigger(t).isValid()&&(n[t]=e),n},{}),function(n,i){map(new Trigger(i).getConditionals(),function(e){var t;!e.isValid()||(t=e.getConditionalElement())&&(isDescendantOf(t,a)||(t=isDescendantOf(t,r)?n:{OR:[i,n]},e.unlinkTriggers(),e.replaceTrigger(i,t),e.linkTriggers(),s.push(e.getIdentifier())))})})}function _detachConditionals(t){var e=base2.DOM.Element.querySelectorAll(t,"["+CONDITIONAL_ATTRIBUTE_NAME+"]"),n=[];e.forEach(function(e){n.push(new Conditional(e,t))}),map(n,function(e){e.unlinkTriggers()})}function _detachTriggers(n){var e=base2.DOM.Element.querySelectorAll(n,"["+TRIGGER_CONDITIONALS+"]"),t=[];e.forEach(function(e){t.push(new Trigger(e,n))}),map(t,function(t){map(t.getConditionals(),function(e){e.isValid()&&(isDescendantOf(e.getConditionalElement(),n)||e.detach(t.getIdentifier()))})})}function _preprocessParameter(e){function t(e,t,n){return n[_escapeQuerySelector("#"+t)]=_escapeQuerySelector("#"+e),n}return e.master=reduce(e.master,t,{}),e.repeat=reduce(e.repeat,t,{}),e}function _escapeQuerySelector(e){return e&&""!==e?e.replace(/\[(\d+)\]/g,function(e,t){return"\\["+t+"\\]"}):null}function map(e,t){if(!e)return null;var n=[];if(e instanceof Array)for(var i=0,a=e.length;i<a;i++)n.push(t(e[i],i));else{if("object"!=typeof e)return null;for(var r in e)void 0!==r&&n.push(t(e[r],r))}return n}function filter(e,t){var n=[];return map(e,function(e){t.apply(null,arguments)&&n.push(e)}),n}function extend(){for(var e=arguments[0],t=1;t<arguments.length;t++){var n,i=arguments[t];for(n in i)e[n]=i[n]}return e}function trim(e){return e.replace(/(^\s+)|(\s+$)/g,"")}function reduce(e,n,i){return i=i||{},map(e,function(e,t){i=n.call(window,e,t,i)}),i}function removeDuplicates(e){var t={},n=[];return map(e,function(e){t[e]||(n.push(e),t[e]=1)}),n}function getOrAssignID(e){if(!isHTMLElement(e))throw new Error("not a dom element");var t;return e.getAttribute("id")||wFORMS.helpers.randomId()&&(e.setAttribute("id",t)||t)}function isDescendantOf(e,t){for(;e;){if(e.parentNode===t)return 1;e=e.parentNode}}function isObjectEmpty(e){return 0===filter(e,function(){return!0}).length}function isRecaptchaCompleted(){try{if("undefined"==typeof grecaptcha)return;const e=grecaptcha.enterprise||grecaptcha;return"object"==typeof e&&e.hasOwnProperty("getResponse")&&"function"==typeof e.getResponse?e.getResponse():void 0}catch(e){return}}var inArray=wFORMS.helpers.contains,isHTMLElement=wFORMS.helpers.isHTMLElement,Conditional=function(){function Conditional(e,t){if("string"!=typeof(this._conditionalDomIdentifier=e)){e=e;if(this._conditionalDomIdentifier="#"+getOrAssignID(e),!isHTMLElement(e)||!e.hasAttribute(CONDITIONAL_ATTRIBUTE_NAME))throw new Error("this element doesn't have a \""+CONDITIONAL_ATTRIBUTE_NAME+'" attribute')}this._conditionalDomIdentifier=_escapeQuerySelector(this._conditionalDomIdentifier),this.referenceDOMTree=t||document}function PolishExpression(e,t){this.operator=(e+"").toUpperCase(),this.operands=t}extend(PolishExpression.prototype,{toStringy:function(){var e=map(this.operands,function(e){return e instanceof PolishExpression?e.toStringy():" "+e+" "});return"NOT"!==this.operator?1<e.length?" ("+e.join(this.operator)+") ":e[0]:this.operands[0]instanceof PolishExpression?" ( NOT"+e[0]+") ":" ( NOT ("+e[0]+") ) "}});var COMPONENT_PATTERN=new RegExp(DELIMITER+"(.+?)"+DELIMITER+"(?=\\)* OR|\\)* AND|$|\\)+$)","g"),COMPOUND_COMPONENT_PATTERN=new RegExp("((AND)|(OR))\\s*"+DELIMITER+"([^"+DELIMITER+"]+)"+DELIMITER,"g"),BRACKETED_SINGLE_TRIGGER_PATTERN=new RegExp("\\(\\s*"+DELIMITER+"([^"+DELIMITER+"]+)"+DELIMITER+"\\s*\\)","g");function _getActiveTriggers(e){return filter(e.getTriggers(),function(e){return null!==e.getTr
1iggerElement()})}function _mergeImplicitRules(){for(var e=this.getConditionRuleString(),t=!1,n=this.getConditionalElement(),i=n.parentNode;i&&1==i.nodeType;){var a=i.getAttribute(CONDITIONAL_ATTRIBUTE_NAME);a&&-1===e.indexOf("AND ("+a+")")&&(e="("+e+") AND ("+a+")",t=!0),i=i.parentNode}t&&(this.unlinkTriggers(),n.setAttribute(CONDITIONAL_ATTRIBUTE_NAME,e),this.linkTriggers())}return extend(Conditional.prototype,{getConditionRuleString:function(){var e=this.getConditionalElement();return e?e.getAttribute(CONDITIONAL_ATTRIBUTE_NAME):null},getTriggers:function(){var e=this.getConditionRuleString();if(!e)return null;var t,n=[];for(COMPONENT_PATTERN.lastIndex=0;t=COMPONENT_PATTERN.exec(e);)n.push(t[1]);return map(n,function(e){try{return new Trigger(e)}catch(e){return null}})},getConditionalElement:function(){try{var e=base2.DOM.Element.querySelector(this.referenceDOMTree,this._conditionalDomIdentifier);return e||"#submit_button"!==this._conditionalDomIdentifier?e:base2.DOM.Element.querySelector(this.referenceDOMTree,"#primaryAction")}catch(e){return null}},getIdentifier:function(){return this._conditionalDomIdentifier},equals:function(e){if(this.getIdentifier()===e.getIdentifier())return!0;var t=this.getConditionalElement(),e=e.getConditionalElement();return!(!e||!t)&&e===t},linkTriggers:function(){var t;map(_getActiveTriggers(this),(t=this,function(e){e.addConditional(t)}))},unlinkTriggers:function(){var t;map(_getActiveTriggers(this),(t=this,function(e){e.removeConditional(t)}))},refresh:function(){var e=document.getElementById("submit-button-display-message"),t=this.getConditionalElement()&&("submit_button"===this.getConditionalElement().id||"primaryAction"===this.getConditionalElement().id),n=this.getConditionalElement().getAttribute("data-conditional-mode")??"disabled";this.isConditionMet()?(t&&(wFORMS.behaviors.condition.isConditionalSubmitConditionMet=!0),this.show(),t&&e&&e.classList.add("offstate")):(t&&(wFORMS.behaviors.condition.isConditionalSubmitConditionMet=!1),t&&e&&e.classList.remove("offstate"),t&&"disabled"===n?this.getConditionalElement().setAttribute("disabled","disabled"):this.hide());n=wFORMS.getBehaviorInstance(wFORMS.helpers.getForm(this.getConditionalElement()),"paging");n&&n.setupManagedControls()},isConditionMet:function(){_mergeImplicitRules.call(this);var conditionRuleString=this.getConditionRuleString();if(!conditionRuleString)throw new Error("The inferred DOM element doesn't have a rule string");COMPONENT_PATTERN.lastIndex=0;var rawBooleanExpression=conditionRuleString.replace(COMPONENT_PATTERN,function(e,t){return new Trigger(t.split(",")[0]).getValue(t)?"true":"false"}),booleanExpression=rawBooleanExpression.replace(/AND/g," && ").replace(/OR/g," || ").replace(/NOT/g," ! ");return eval(booleanExpression)},show:function(){var e=this.getConditionalElement(),t="submit_button"===e.id||"primaryAction"===e.id,a=e.getAttribute("data-conditional-mode")??"disabled",r=!!document.getElementById("google-captcha")||!!document.getElementById("captcha"),n=e.id;if("INPUT"==e.tagName||"SELECT"==e.tagName||"TEXTAREA"==e.tagName||base2.DOM.HTMLElement.hasClass(e,"choices")){for(var i=e.parentNode;i&&1==i.nodeType&&!base2.DOM.HTMLElement.hasClass(i,"oneField");)i=i.parentNode;i&&1==i.nodeType&&base2.DOM.HTMLElement.hasClass(i,"oneField")?e=i:"INPUT"==e.tagName&&(e._wforms_disabled?t&&!r&&"disabled"===a&&e.removeAttribute("disabled"):t&&r&&"disabled"===a&&(isRecaptchaCompleted()?e.removeAttribute("disabled"):e.setAttribute("disabled","disabled")),e.getAttribute(TRIGGER_CONDITIONALS)&&new Trigger(e).trigger(),this.flagCalculationForUpdate(e))}else base2.DOM.HTMLElement.hasClass(e,"pageSection")&&(e=e.parentNode);var s=this,o=function(e){switch(e.tagName){case"INPUT":(e._wforms_disabled&&"disabled"!==e.getAttribute("data-wforms-nooverwrite")||"radio"!==e.type&&"checkbox"!==e.type&&"submit"!==e.type)&&e.removeAttribute("disabled"),"submit"!==e.type||r||"disabled"!==a||e.removeAttribute("disabled"),e.getAttribute(TRIGGER_CONDITIONALS)&&new Trigger(e).trigger(),s.flagCalculationForUpdate(e);break;case"TEXTAREA":e._wforms_disabled&&e.removeAttribute("disabled"),s.flagCalculationForUpdate(e);break;case"SELECT":e._wforms_disabled&&"disabled"!==e.getAttribute("data-wforms-nooverwrite")&&e.removeAttribute("disabled");for(var t=e.getElementsByTagName("OPTION"),n=0;n<t.length;
1n++)t[n].getAttribute(TRIGGER_CONDITIONALS)&&new Trigger(t[n]).trigger();s.flagCalculationForUpdate(e);break;default:for(var i=0;i<e.childNodes.length;i++)1!=e.childNodes[i].nodeType||wFORMS.behaviors.condition.hasOffState(e.childNodes[i])||o(e.childNodes[i])}};o(e);var l,u,h=document.getElementById("tfa_switchedoff");if(h)for(u in l=h.value?h.value.split(","):[])if(l[u]==n){l.splice(u,1),h.value=l.join(",");break}base2.DOM.HTMLElement.removeClass(e,"offstate");t=wFORMS.getBehaviorInstance(e,"repeat");t&&t.behavior.isHandled(e)&&base2.DOM.HTMLElement.removeClass(t.getOrCreateRepeatLink(e),"offstate"),wFORMS.behaviors.condition.onShow&&wFORMS.behaviors.condition.onShow(this)},hide:function(){var e=this.getConditionalElement(),t=e.id;if("INPUT"==e.tagName||"SELECT"==e.tagName||"TEXTAREA"==e.tagName||base2.DOM.HTMLElement.hasClass(e,"choices")){for(var n=e.parentNode;n&&1==n.nodeType&&!base2.DOM.HTMLElement.hasClass(n,"oneField");)n=n.parentNode;n&&1==n.nodeType&&base2.DOM.HTMLElement.hasClass(n,"oneField")?e=n:"INPUT"==e.tagName&&(e.disabled=!0,e._wforms_disabled=!0,e.getAttribute(TRIGGER_CONDITIONALS)&&new Trigger(e).trigger(),this.flagCalculationForUpdate(e))}else base2.DOM.HTMLElement.hasClass(e,"pageSection")&&(e=e.parentNode);for(var i=e.getElementsByTagName("INPUT"),a=0;a<i.length;a++)i[a].disabled=!0,i[a]._wforms_disabled=!0,i[a].getAttribute(TRIGGER_CONDITIONALS)&&new Trigger(i[a]).trigger(),this.flagCalculationForUpdate(i[a]);for(i=e.getElementsByTagName("TEXTAREA"),a=0;a<i.length;a++)i[a].disabled=!0,i[a]._wforms_disabled=!0,this.flagCalculationForUpdate(i[a]);for(i=e.getElementsByTagName("SELECT"),a=0;a<i.length;a++){i[a].disabled=!0,i[a]._wforms_disabled=!0;for(var r=i[a].getElementsByTagName("OPTION"),s=0;s<r.length;s++)r[s].getAttribute(TRIGGER_CONDITIONALS)&&new Trigger(r[s]).trigger();this.flagCalculationForUpdate(i[a])}var o,l=document.getElementById("tfa_switchedoff");if(l){for(a in o=l.value?l.value.split(","):[])if(o[a]==t){o.splice(a,1);break}o.push(t),l.value=o.join(",")}base2.DOM.HTMLElement.addClass(e,"offstate");l=wFORMS.getBehaviorInstance(e,"repeat");l&&l.behavior.isHandled(e)&&base2.DOM.HTMLElement.addClass(l.getOrCreateRepeatLink(e),"offstate"),wFORMS.behaviors.condition.onHide&&wFORMS.behaviors.condition.onHide(this)},isValid:function(){return this.getConditionalElement()&&this.getConditionRuleString()},replaceTrigger:function(i,a){"string"==typeof a&&(a={AND:a}),a=Conditional.makeConditionRules(a);var e=this.getConditionRuleString();if(!e)throw new Error("The inferred DOM element doesn't have a rule string");COMPONENT_PATTERN.lastIndex=0,e=e.replace(COMPONENT_PATTERN,function(e,t){var n=t.split(",")[0];return n===i?a.includes(" OR ")?t.replace(n,"("+a.slice(3,-3)+")"):e.replace(n,a.slice(2,-2)):e}),this.getConditionalElement().setAttribute(CONDITIONAL_ATTRIBUTE_NAME,e)},detach:function(t){var e=this.getConditionRuleString();if(!e)throw new Error("The inferred DOM element doesn't have a rule string");COMPOUND_COMPONENT_PATTERN.lastIndex=0,e=e.replace(COMPOUND_COMPONENT_PATTERN,function(e){return _escapeQuerySelector(arguments[4])===t?"":e}),BRACKETED_SINGLE_TRIGGER_PATTERN.lastIndex=0,e=e.replace(BRACKETED_SINGLE_TRIGGER_PATTERN,function(e,t){return DELIMITER+t+DELIMITER}),this.getConditionalElement().setAttribute(CONDITIONAL_ATTRIBUTE_NAME,e)},flagCalculationForUpdate:function(e){wFORMS.behaviors.condition.calculationInstance||(wFORMS.behaviors.condition.calculationInstance=wFORMS.getBehaviorInstance(wFORMS.helpers.getForm(e),"calculation"));var t=wFORMS.behaviors.condition.calculationInstance;if(t&&t.isVariable(e))for(var n=t.getCalculatedFields(e),i=0;i<n.length;i++)wFORMS.behaviors.condition._dirtyCalculations[n[i].id]=n[i]}}),extend(Conditional,{makeConditionRules:function(e){e=function t(e){if("string"==typeof(i=e=e||{})||isHTMLElement(i)||!(i=filter(i||{},function(e,t){return inArray(["NOT","AND","OR"],(t||"").toUpperCase())}))||0===i.length)return isHTMLElement(r=n=e)&&(r="#"+(n.getAttribute("id")||(i=wFORMS.helpers.randomId())&&(n.setAttribute("id",i)||i))),DELIMITER+r+DELIMITER;var n,i;if((r=e)instanceof Array||r.constructor===Object&&1<map(r,function(e,t){return t}).length)return new PolishExpression("AND",map(filter(map(e,function(e,t){var n={};return n[(t||"").toUpperCase()]=e,n}),function(e){return e=map(e,function(e,t){return t}),inArray(["NOT","AND","OR"],e[0])}),t));var a,r=(a={},map(e,function(e,t){a.name=t,a.value=e}),a),e=r.value;e instanceof Array||(e=[e]);var s=[];return map(e,function(e){(e=t(e))instanceof Array?s=s.concat(e):s.push(e)}),new PolishExpression(r.name,s)}(e);return e&&e.toStringy()||null}})}(),Trigger=(extend(SG.prototype,{attachedConditionals:[],_getConditionalsPattern:function(){return UG(this.getConditionals())},setEventListener:function(){var e=this.getTriggerElement();if(e&&"OPTION"==e.tagName)for(;e&&"SELECT"!=e.tagName;)e=e.parentNode;if(e&&!e.__wforms_event_handled)if("INPUT"==e.tagName&&"radio"==e.getAttribute("type")){var t=e.form[e.getAttribute("name")];t.length||(t=[t]);for(var n=0;n<t.length;n++){var i=t[n];base2.DOM.Element.addEventListener(i,"click",EventHandlers.onChange,!1),i.__wforms_event_handled=!0}}else{var a="blur";"INPUT"===e.tagName&&"checkbox"===e.getAttribute("type")&&(a="click"),"SELECT"===e.tagName&&(a="change"),base2.DOM.Element.addEventListener(e,a,EventHandlers.onChange,!1),e.__wforms_event_handled=!0}},getIdentifier:function(){return this._triggerElementIdentifier},getTriggerElement:function(){try{return this.getIdentifier().includes(",")?base2.DOM.Element.querySelector(this.referenceDOMTree,this.getIdentifier().split(",")[0]):base2.DOM.Element.querySelector(this.referenceDOMTree,this.getIdentifier())}catch(e){return null}},getValue:function(e=null){var t=this.getTriggerElement();if(!t)return DEFAULT_NON_EXIST_TRIGGER_VALUE;if(t.disabled&&"disabled"!=t.getAttribute("data-wforms-nooverwrite"))return!1;if("OPTION"===t.tagName){for(var n=t.parentNode;n&&"SELECT"!=n.tagName;)n=n.parentNode;if(n&&n.disabled&&"disabled"!=n.getAttribute("data-wforms-nooverwrite"))return!1}if("INPUT"===t.tagName){var i=base2.DOM.Element.getAttribute(t,"type");if("checkbox"===i||"radio"===i)return!!t.checked;if("text"===i){var a=t.value;if(!e)return 0!==trim(t.value).length;var[,e,...r]=e.split(","),r=r.join(",");switch(e){case"equals":return a===r;case"notEquals":return a.length?a!==r:!1;case"contains":return a.includes(r);case"notContains":return a.length?!a.includes(r):!1;case"startsWith":return a.length?a.startsWith(r):!1;case"notStartsWith":return a.length?!a.startsWith(r):!1;case"endsWith":return a.length?a.endsWith(r):!1;case"notEndsWith":return a.length?!a.endsWith(r):!1;case"before":return a.length?WG(a)<new Date(r):!1;case"after":if(a.length){var s=WG(a);return new Date(r)<s}return!1;case"same":if(a.length){let e=WG(a),t=new Date(r);return e.toString()===t.toString()}return!1;case"eq":return a.length?Number(a)===Number(r):!1;case"neq":return a.length?Number(a)!==Number(r):!1;case"gt":return a.length?Number(a)>Number(r):!1;case"gte":return a.length?Number(a)>=Number(r):!1;case"lt":return a.length?Number(a)<Number(r):!1;case"lte":return a.length?Number(a)<=Number(r):!1;default:return!1}}}else{if("TEXTAREA"===t.tagName)return 0!==trim(t.value).length;if("OPTION"===t.tagName)return t.selected;if("SELECT"===t.tagName){if(0<t.selectedIndex)return!0;for(var o=0,l=t.options.length;o<l;o++){var u=t.options[o];if(u.selected&&0<trim(u.value).length)return!0}return!1}}return!1}
1,getConditionals:function(){return(e=(e=this).getTriggerElement())&&(e=e.getAttribute(TRIGGER_CONDITIONALS))?map(e.split(","),function(e){try{return new Conditional(trim(e))}catch(e){return null}}):[];var e},replaceConditionals:function(e){return VG(this,e)},addConditional:function(t){var e=this.getConditionals();return 0!==filter(e,function(e){return e.equals(t)}).length?null:(e.push(t),VG(this,e))},removeConditional:function(n){var e=this.getConditionals();return VG(this,filter(e,function(e,t){return!e.equals(n)}))},trigger:function(){var e=this.getTriggerElement();wFORMS.behaviors.condition._triggerChain&&e.id in wFORMS.behaviors.condition._triggerChain||(wFORMS.behaviors.condition._triggerChain[e.id]=!0,map(filter(this.getConditionals(),function(e){return e&&e.getConditionalElement()}),function(e){e.refresh()}))},isValid:function(){var e;return(e=this.getTriggerElement())&&e.getAttribute(TRIGGER_CONDITIONALS)}}),SG);function SG(e,t){var n=e;"string"!=typeof e&&(n="#"+getOrAssignID(e)),this._triggerElementIdentifier=_escapeQuerySelector(n),this.referenceDOMTree=t||document}function UG(e){return map(e,function(e){return e.getIdentifier()}).join(",")}function VG(e,t){if(!(t=filter(t,function(e){return e instanceof Conditional})))return null;e=e.getTriggerElement();if(!isHTMLElement(e))throw new Error("Cannot store Conditionals to this Trigger object. The inferred DOM object doesn't exist");t=UG(t);return e.setAttribute(TRIGGER_CONDITIONALS,t),t}function WG(t){var e=document.getElementsByClassName("wForm")[0].dataset.language,n=["/","-","."].find(e=>t.includes(e)),n=t.split(n);let i,a,r;return 2<n[0].length?(a=parseInt(n[1]),r=parseInt(n[2]),i=parseInt(n[0])):3===n.length&&"en_US"!==e?(a=parseInt(n[1]),r=parseInt(n[0]),i=parseInt(n[2])):3===n.length&&"en_US"===e&&(a=parseInt(n[0]),r=parseInt(n[1]),i=parseInt(n[2])),new Date(i,a-1,r)}var EventHandlers={onChange:function(e){var t=e.target||e;if(t){if(wFORMS.behaviors.condition.resetTriggerExecutionChain(),"SELECT"===t.tagName)for(var n=0;n<t.options.length;n++){var i=t.options[n];i.getAttribute(TRIGGER_CONDITIONALS)&&new Trigger(i).trigger()}else if("INPUT"===t.tagName&&"radio"===t.getAttribute("type")){var e=t.getAttribute("name"),a=t.form[e];a.length||(a=[a]);for(n=0;n<a.length;n++){var r=a[n];new Trigger(r).trigger()}}else t.getAttribute(TRIGGER_CONDITIONALS)&&new Trigger(t).trigger();if(wFORMS.instances.responsive&&wFORMS.instances.responsive[0])for(n=0;n<wFORMS.instances.responsive.length;n++)wFORMS.instances.responsive[n].handleAllMatrixLayouts(),wFORMS.instances.responsive[n].handleAllGridLayouts();wFORMS.behaviors.condition.updateCalculations()}},onRepeatableDuplicated:function(e,t,n){var i=[];wFORMS.behaviors.condition.resetTriggerExecutionChain();var a=reduce((n=_preprocessParameter(n)).repeat,function(e,t,n){return new Conditional(t).isValid()&&(n[t]=e),n},{});_renameTriggers(n.master,a,i),_renameConditionals(n,i),_consolidateTriggers(n.repeat,e,t,i),map(removeDuplicates(i),function(e){new Conditional(e).refresh()}),wFORMS.behaviors.condition.updateCalculations()},onRepeatableRemoved:function(e){_detachConditionals(e),_detachTriggers(e),wFORMS.behaviors.condition.updateCalculations()}};return{skip:!1,onHide:function(e){},onShow:function(e){},onSetupFinish:function(e){},applyTo:function(e){if(this.target=e,wFORMS.behaviors.condition.skip)return null;this.resetTriggerExecutionChain();var t=base2.DOM.Element.querySelectorAll(e,"["+TRIGGER_CONDITIONALS+"]");return t.forEach(function(e){e=new Trigger(e);e.trigger(),e.setEventListener()}),wFORMS.behaviors.condition.updateCalculations(),0<t.length&&wFORMS.behaviors.repeat&&(wFORMS.behaviors.repeat.observeRepeatComplete(EventHandlers.onRepeatableDuplicated),wFORMS.behaviors.repeat.observeRemoveComplete(EventHandlers.onRepeatableRemoved)),this.onSetupFinish(e),this},getConditional:function(e){return new Conditional(e)},getTrigger:function(e){return new Trigger(e)},Conditional:Conditional,Trigger:Trigger,mockup:function(){},refresh:EventHandlers.onChange,isInitialized:function(){return initialized},hasOffState:function(e){return base2.DOM.HTMLElement.hasClass(e,"offstate")},resetTriggerExecutionChain:function(){wFORMS.behaviors.condition._triggerChain={},wFORMS.behaviors.condition._dirtyCalculations={}},updateCalculations:function(){for(var e in wFORMS.behaviors.condition._dirtyCalculations){e=wFORMS.behaviors.condition._dirtyCalculations[e];wFORMS.behaviors.condition.calculationInstance||(wFORMS.behaviors.condition.calculationInstance=wFORMS.getBehaviorInstance(wFORMS.helpers.getForm(e),"calculation")),wFORMS.behaviors.condition.calculationInstance.refresh(null,e)}wFORMS.behaviors.condition._dirtyCalculations={}}}}(),"undefined"==typeof wFORMS)throw new Error("wFORMS core not found. This behavior depends on the wFORMS core.");
1function wformsMergeDescribedByErrorId(e,t,n){if(e){for(var i=e.getAttribute("aria-describedby"),a=i?i.split(/\s+/).filter(function(e){return e.length}):[],r=0;r<a.length&&a[r]!==t;r++);n?r===a.length&&a.push(t):r<a.length&&a.splice(r,1),0===a.length?e.removeAttribute("aria-describedby"):e.setAttribute("aria-describedby",a.join(" "))}}function wformsAriaDescribedByHasErrorRef(e){if(!e||!e.getAttribute)return!1;e=e.getAttribute("aria-describedby");if(!e)return!1;for(var t=e.split(/\s+/).filter(function(e){return e.length}),n=0;n<t.length;n++){var i=t[n];if(0===i.indexOf("tfa-banner-error-"))return!0;if(2<=i.length&&"-E"===i.slice(-2))return!0}return!1}if(wFORMS.behaviors.validation={NAME:"wFORMS_validation",skip:!1,ERROR_PLACEHOLDER_SUFFIX:"-E",LOWER_BOUND_ATTRIBUTE:"min",UPPER_BOUND_ATTRIBUTE:"max",rules:{oneRequired:{selector:".required-one",check:"validateOneRequired"},isRequired:{selector:".required",check:"validateRequired"},isAlpha:{selector:".validate-alpha",check:"validateAlpha"},isAlphanum:{selector:".validate-alphanum",check:"validateAlphanum"},isDateTime:{selector:".validate-datetime",check:"validateDateTime"},isDate:{selector:".validate-date, .validate-datecal",check:"validateDate",range_verifier:"dateRangeTest",range_error_message:"rangeDate"},isTime:{selector:".validate-time",check:"validateTime",range_verifier:"timeRangeTest",range_error_message:"rangeTime"},isEmail:{selector:".validate-email",check:"validateEmail"},isInteger:{selector:".validate-integer",check:"validateInteger",range_verifier:"numberRangeTest",range_error_message:"rangeNumber"},isFloat:{selector:".validate-float",check:"validateFloat",range_verifier:"numberRangeTest",range_error_message:"rangeNumber"},isPhone:{selector:".validate-phone",check:"validatePhone"},isCustom:{selector:".validate-custom",check:"validateCustom"},wordCount:{selector:".count-words",check:"validateWordCount"},isHostname:{selector:".validate-hostname",check:"validateHostname"},restrictAutosuggest:{selector:'.wfAutosuggest[data-dataset-allow-free-responses="0"][id]',check:"validateRestrictAutosuggest"}},styling:{fieldError:"errFld",errorMessage:"errMsg",linkedErrorMessage:"linkedErrMsg",errorLink:"errLink"},messages:{oneRequired:"This section is required.",isRequired:"This field is required.",isAlpha:"The text must use alphabetic characters only (a-z, A-Z). Numbers are not allowed.",isEmail:"This does not appear to be a valid email address.",isInteger:"Please enter an integer.",isFloat:"Please enter a number (ex. 1.9).",isAlphanum:"Please use alpha-numeric characters only [a-z 0-9].",isDateTime:"This does not appear to be a valid date/time.",isDate:"This does not appear to be a valid date.",isTime:"This does not appear to be a valid time.",isPhone:"Please enter a valid phone number.",isCustom:"Please enter a valid value.",wordCount:"This field is over the word limit.",wordsRemPos:"words remaining",wordsRemNeg:"words over the limit",notification:"The form is not complete and has not been submitted yet. There was %% problem(s) with your submission.",rangeNumber:{max:"The value must be smaller than the upper bound %1",min:"The value must be greater than the lower bound %1",both:"The entered value must be between %1 - %2"},rangeDate:{max:"The date must be on or before %1.",min:"The date must be on or after %1.",both:"This date must be between %1 - %2.",cont:"This field determines the date range for %1.",dep:"Could not validated date. This field is dependent on %1.",link:"another field"},rangeTime:{max:"The time must be on or before %1.",min:"The time must be on or after %1.",both:"This time must be between %1 - %2.",cont:"This field determines the time range for %1.",dep:"Could not validated time. This field is dependent on %1.",link:"another field"},restrictAutosuggest:"You must select an item from the list",wait:"Please wait..."},instance:function(e){this.behavior=wFORMS.behaviors.validation,this.target=e;var t=this;e.__wFormsValidationHandled||(e.addEventListener||wFORMS.standardizeElement(e),e.addEventListener("submit",function(e){wFORMS.behaviors.validation.saveButtonIsEnabled()?(e.preventDefault(),wFORMS.behaviors.val
1idation.saveCheckFunc(e,document.getElementById("tfa_resumeLater"))):(t.run(e,this),document.getElementsByClassName("errorMessage errMsg")[0]&&(document.getElementsByClassName("errorMessage errMsg")[0].style.visibility="hidden"))},!1),e.__wFormsValidationHandled=!0)},onPass:function(e,t){},onFail:function(n,e){let t=Object.entries(n.elementsInError).map(function([e,t]){return{id:e,element:document.getElementById(e),rule:t.rule}});function a(e){let t=e.getBoundingClientRect();const n=document.querySelector(`label[for="${e.id}"]`);return n&&(e=n.getBoundingClientRect(),t={top:Math.min(t.top,e.top),left:Math.min(t.left,e.left)}),t}t.sort(function(e,t){var n=a(e.element),i=a(t.element);return n.top!==i.top?n.top-i.top:e.element.compareDocumentPosition(t.element)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1});let i=0<t.length?t[0].id:null;t.forEach(function(e){n.elementsInError[e.id]={id:e.id,rule:e.rule}});var r,s=0;for(o in n.elementsInError)s++,i=i||o;if(r=(r=1==s?wFORMS.behaviors.validation.messages.notification_0:wFORMS.behaviors.validation.messages.notification).replace("%%",s),wFORMS.behaviors.paging&&wFORMS.behaviors.paging.showTabNavigation){n.errorPages=new Array;var o,l=9999;for(o in n.elementsInError){var u=wFORMS.behaviors.paging.helpers.findPage(document.getElementById(o));u&&((u=wFORMS.behaviors.paging.getPageIndex(u))<l&&(l=u),"object"==typeof n.errorPages[u]||(n.errorPages[u]=new Array),n.errorPages[u].push(o))}var h=wFORMS.getBehaviorInstance(n.target,"paging");h.jumpTo(l);var c=base2.DOM.Element.querySelectorAll(n.target.parentNode,'a[id^="'+h.behavior.CSS_PAGETAB+'"]');(c=!c.forEach?base2.JavaScript.Array2(c):c).forEach(function(e){e.removeClass&&e.hasClass&&e.addClass||wFORMS.standardizeElement(e),e.removeClass("errMsg")}),n.errorPages.forEach||(n.errorPages=base2.JavaScript.Array2(n.errorPages)),n.errorPages.forEach(function(e,t){t=base2.DOM.Element.querySelector(n.target.parentNode,"#"+h.behavior.CSS_PAGETAB+"_"+t);t&&(t.addClass||wFORMS.standardizeElement(t),t.addClass("errMsg"))})}c=document.getElementById(i);c.scrollIntoView?c.scrollIntoView():location.hash="#"+i,wFORMS.behaviors.validation.alert(r,c)},alert:function(e,t){alert(e),void 0!==t&&t.focus()},dateRegex:function(){var e="(\\d{1,4}|\\d{1,2})",t="(\\d{1,2}|((January)|(February)|(March)|(April)|(May)|(June)|(July)|(August)|(September)|(October)|(November)|(December)|(Jan)|(Feb)|(Mar)|(Apr)|(May)|(Jun)|(Jul)|(Aug)|(Sep)|(Oct)|(Nov)|(Dec)))",n="\\d{1,2}((th)|(rd)|(nd)|(st))?",i="\\s*[-/\\\\|\\,\\.]?\\s*",t="(("+t+i+n+")|("+n+i+t+")|("+t+"))",i="(("+e+i+t+")|("+t+i+e+")|"+t+")",e="((1[012]|[1-9])\\s*[:-]?\\s*([0-5][0-9])?\\s*(a|am|p|pm))",t="(([0-1]?[0-9]|2[0-4])\\s*[:-]?\\s*[0-5][0-9](\\s*[:-]?\\s*[0-5][0-9])?)";return[new RegExp("^"+i+"\\s+"+e+"$","i"),new RegExp("^"+i+"\\s+"+t+"$","i"),new RegExp("^"+e+"\\s+"+i+"$","i"),new RegExp("^"+t+"\\s+"+i+"$","i"),new RegExp("^"+i+"$","i"),new RegExp("^"+e+"$","i"),new RegExp("^"+t+"$","i")]}()},wFORMS.behaviors.validation.rules.isDate.fail=function(e,t){var n,a=this;function i(e,t,n){var e=base2.DOM.HTMLDocument.querySelector(a.target,wFORMS.helpers.escapeQuerySelector("#"+e)),i=base2.DOM.HTMLDocument.querySelector(a.target,wFORMS.helpers.escapeQuerySelector("#"+t));n&&a.addErrorMessage(e,wFORMS.behaviors.validation.messages.rangeDate.cont,!0);n=base2.DOM.HTMLDocument.querySelector(a.target,wFORMS.helpers.escapeQuerySelector("#"+e.id+wFORMS.behaviors.validation.ERROR_PLACEHOLDER_SUFFIX)),e=document.createElement("span");e.setAttribute("class","errLink"),e.textContent=wFORMS.behaviors.validation.messages.rangeDate.link,n.innerHTML=n.innerHTML.replace(/%1/,e.outerHTML),n.getElementsByClassName(wFORMS.behaviors.validation.styling.errorLink)[0].onclick=function(){wFORMS.behaviors.validation.moveToLinkedDate.call(i)}}t.match(/%%(.+)%%/)&&(n=t.match(/%%(.+)%%/)[1],t=t.replace(/%%(.+)%%/,"%1")),this.fail(e,t),n&&(i(n,e.id,!0),i(e.id,n))},wFORMS.behaviors.validation.applyTo=function(e){if(wFORMS.behaviors.validation.skip)return null;if(!e||!e.tagName)throw new Error("Can't apply behavior to "+e);if("FORM"!=e.tagName)if(e.form)e=e.form;else{var t=e;for(e=e.parentNode;e&&"FORM"!=e.tagName;e=e.parentNode)continue;e&&"FORM"==e.tagName||(e=t.getElementsByTagName("form"))}if(!e.tagName&&0<e.length)for(var n=new Array,i=0;i<e.length;
1i++){var a=new wFORMS.behaviors.validation.instance(e[i]);n.push(a),wFORMS.behaviors.validation.dispatchAppliedEvent(e[i]),a.onApply()}else{n=new wFORMS.behaviors.validation.instance(e);wFORMS.behaviors.validation.dispatchAppliedEvent(e),n.onApply()}return n},wFORMS.behaviors.validation.dispatchAppliedEvent=function(e){wFORMS.helpers.dispatchCustomEvent("form.validation",e,{moduleName:this.NAME,statusText:"applied"})},wFORMS.behaviors.validation.instance.prototype.onApply=function(){var t,n=this;wFORMS.behaviors.repeat&&!wFORMS.behaviors.repeat.handlingRepeatedErrors&&(wFORMS.behaviors.repeat.handlingRepeatedErrors=!0,t=wFORMS.behaviors.repeat.onRepeat,wFORMS.behaviors.repeat.onRepeat=function(e){e&&n.removeErrorMessage(e),base2.DOM.Element.querySelectorAll(e,"*").forEach(function(e){n.removeErrorMessage(e)}),t&&t.apply(this,arguments)},wFORMS.behaviors.repeat.observeRepeatComplete(this.repeatHandler))},wFORMS.behaviors.validation.instance.prototype.trimValue=function(e,t){return"string"!=typeof e?e:e.replace(/^[\s\ufeff\u200b]+|[\s\ufeff\u200b]+$/g,"")},wFORMS.behaviors.validation.instance.prototype.run=function(n,e){if(n&&n.pagingStopPropagation)return!1;function t(e){var t,n,i;wFORMS.behaviors.paging&&!wFORMS.behaviors.paging.showTabNavigation&&!wFORMS.behaviors.paging.isElementVisible(e)||o.isSwitchedOff(e)||(i=wFORMS.helpers.getFieldValue(e),i=o.trimValue(i,e),t=(s.check.call?s.check:o[s.check]).call(o,e,i),n=a,!t||void 0===s.range_verifier||!0!==(i=o[s.range_verifier].call(o,e,i,wFORMS.behaviors.validation.messages[s.range_error_message]))&&(t=!1)!==i&&(n=i),t?(o.elementsInError[e.id]||o.removeErrorMessage(e),(s.pass?s:o).pass.call(o,e)):(e.id||(e.id=wFORMS.helpers.randomId()),o.elementsInError[e.id]={id:e.id,rule:a},o.removeErrorMessage(e),(s.fail?s:o).fail.call(o,e,n),r++,wFORMS.helpers.dispatchCustomEvent("element.validation",e,{moduleName:wFORMS.behaviors.validation.NAME,statusText:"failed",validationRule:a})))}var a,r=0;for(a in this.elementsInError={},this.behavior.rules){var s=this.behavior.rules[a],o=this;e.matchesSelector||wFORMS.standardizeElement(e),!(e=!e.matchesSelector?base2.DOM.bind(e):e).matchesSelector&&e.msMatchesSelector&&(e.matchesSelector=e.msMatchesSelector),!e.matchesSelector&&e.mozMatchesSelector&&(e.matchesSelector=e.mozMatchesSelector),!e.matchesSelector&&e.webkitMatchesSelector&&(e.matchesSelector=e.webkitMatchesSelector),e.matchesSelector||(e.matchesSelector=base2.DOM.Element.matchesSelector),e.matchesSelector(s.selector)&&t(e),e.querySelectorAll(s.selector).forEach(t)}var i=n&&n.hasOwnProperty("target")?n.target:e;if(0<r)return n&&(n.preventDefault?n.preventDefault():n.returnValue=!1),i&&wFORMS.helpers.dispatchCustomEvent("form.validation",i,{moduleName:wFORMS.behaviors.validation.NAME,statusText:"failed",errorCount:r,errorFields:Object.keys(this.elementsInError)}),this.behavior.onFail&&this.behavior.onFail(this,n),!1;if(n&&"submit"==n.type){var l=base2.DOM.Element.querySelector(this.target,'.actions .primaryAction[type="submit"]'),u={disabled:l.getAttribute("disabled"),style:l.getAttribute("style"),value:l.getAttribute("value")};-1==l.className.indexOf("wfHideSubmit")&&wFORMS.behaviors.validation.instance.prototype.showSubmitButtonSubmittingState(l);var h=document.querySelector("altcha-widget");if(h){if("onsubmit"===h.getAttribute("auto"))return"verified"===h.getState?.()?!0:(h.addEventListener("statechange",function e(t){"error"===t.detail.state&&wFORMS.behaviors.validation.instance.prototype.restoreSubmitButton(l,u),["error","verified","expired"].includes(t.detail.state)&&h.removeEventListener("statechange",e)}),n.preventDefault(),!1);n.preventDefault();var c=function(e){var t;"verified"===e.detail.state?(h.removeEventListener("statechange",c),(t=document.createElement("input")).type="hidden",t.name="altcha",t.value=e.detail.payload,n.target.appendChild(t),n.target.submit()):"error"===e.detail.state&&(h.removeEventListener("statechange",c),wFORMS.behaviors.validation.instance.prototype.restoreSubmitButton(l,u))};return h.addEventListener("statechange",c),h.verify(),!1}}return i&&wFORMS.helpers.dispatchCustomEvent("form.validation",i,{moduleName:wFORMS.behaviors.val
1idation.NAME,statusText:"passed"}),this.behavior.onPass&&this.behavior.onPass(this,n),!0},wFORMS.behaviors.validation.instance.prototype.showSubmitButtonSubmittingState=function(e){e.setAttribute("disabled","disabled"),e.setAttribute("style","color: grey"),e.setAttribute("value",wFORMS.behaviors.validation.messages.wait)},wFORMS.behaviors.validation.instance.prototype.restoreSubmitButton=function(t,n){Object.keys(n).forEach(function(e){null==n[e]?t.removeAttribute(e):t.setAttribute(e,n[e])})},wFORMS.behaviors.validation.instance.prototype.getRepeatFieldContainerId=function(e){if(!e||!wFORMS.behaviors.repeat)return null;var t=e.replace(/(\[\d+\])+(\-[HED])?$/,"$2"),e=e.split(t).join("");return t+="-D",e&&(t+=e),t},wFORMS.behaviors.validation.instance.prototype.getFieldWrapperD=function(e){if(!e)return null;var t=document.getElementById(e+"-D");if(t)return t;e=this.getRepeatFieldContainerId(e);return e&&(t=document.getElementById(e))?t:null},wFORMS.behaviors.validation.instance.prototype.setInlineErrorPresentOnWrapper=function(e,t){var n;e&&e.id&&((n=!(n=this.getFieldWrapperD(e.id))&&"TR"===e.tagName?e:n)&&(n.classList||n.hasClass&&n.addClass||wFORMS.standardizeElement(n),t?n.classList?n.classList.add("tfa-inline-error-present"):n.addClass&&n.addClass("tfa-inline-error-present"):n.classList?n.classList.remove("tfa-inline-error-present"):n.removeClass&&n.removeClass("tfa-inline-error-present")))},wFORMS.behaviors.validation.instance.prototype.getAriaAnnouncementTarget=function(e){if(!e||!e.id)return e;var t=this.getFieldWrapperD(e.id);if(!t&&e.parentNode)for(var n=e.parentNode,i=this.getRepeatFieldContainerId(e.id);n&&1===n.nodeType;){if(n.id&&(n.id===e.id+"-D"||i&&n.id===i)){t=n;break}n=n.parentNode}if(!t)try{var a=e.id+"-D",r="undefined"!=typeof CSS&&"function"==typeof CSS.escape?CSS.escape(a):a.replace(/\\/g,"\\\\").replace(/"/g,'\\"'),s=document.querySelector('[id^="'+r+'"]');s&&(t=s)}catch(e){t=null}if(t){s=t.getAttribute("role");if("radiogroup"===s||"group"===s)return t}return e},wFORMS.behaviors.validation.instance.prototype.setChoiceInputsAriaInvalid=function(e,t){if(e&&e.hasClass&&e.hasClass("choices"))for(var n=e.getElementsByTagName("input"),i=0;i<n.length;i++){var a=n[i].type&&n[i].type.toLowerCase();"radio"!==a&&"checkbox"!==a||n[i].setAttribute("aria-invalid",t?"true":"false")}},wFORMS.behaviors.validation.instance.prototype.applyFieldErrorAriaState=function(e,t){var n,i;e&&e.getAttribute&&((n=e.getAttribute("id"))&&(i=n+"-E",n=this.getAriaAnnouncementTarget(e),t?(n.setAttribute("aria-invalid","true"),wformsMergeDescribedByErrorId(n,i,!0),n!==e&&(e.removeAttribute("aria-invalid"),wformsMergeDescribedByErrorId(e,i,!1)),this.setChoiceInputsAriaInvalid(e,!0)):(wformsMergeDescribedByErrorId(n,i,!1),n!==e&&wformsMergeDescribedByErrorId(e,i,!1),i=wformsAriaDescribedByHasErrorRef(n)||wformsAriaDescribedByHasErrorRef(e),n!==e?(n.setAttribute("aria-invalid",i?"true":"false"),e.removeAttribute("aria-invalid")):n.setAttribute("aria-invalid",i?"true":"false"),this.setChoiceInputsAriaInvalid(e,i))))},wFORMS.behaviors.validation.instance.prototype.fail=function(e,t){var n=this.getFieldWrapperD(e.id);n?(n.hasClass&&n.addClass||wFORMS.standardizeElement(n),n.addClass(this.behavior.styling.fieldError)):(e.hasClass&&e.addClass||wFORMS.standardizeElement(e),e.addClass(this.behavior.styling.fieldError));t=t in this.behavior.messages?this.behavior.messages[t]:t;this.addErrorMessage(e,t),e.id&&(e.hasClass||wFORMS.standardizeElement(e),!e.hasClass("choices")||(e=document.getElementById(e.id+"-L"))&&(e.addClass||wFORMS.standardizeElement(e),e.addClass(this.behavior.styling.errorMessage)))},wFORMS.behaviors.validation.instance.prototype.pass=function(e){},wFORMS.behaviors.validation.instance.prototype.addErrorMessage=function(e,t,n){e.id||(e.id=wFORMS.helpers.randomId());var i=document.createElement("span");i.appendChild(document.createTextNode(t)),e.removeClass&&e.hasClass&&e.addClass||wFORMS.standardizeElement(e),n&&i.setAttribute("class",wFORMS.behaviors.validation.styling.linkedErrorMessage);
1n=document.getElementById(e.id+wFORMS.behaviors.validation.ERROR_PLACEHOLDER_SUFFIX);n?n.appendChild(document.createElement("br")):((n=document.createElement("div")).setAttribute("id",e.id+wFORMS.behaviors.validation.ERROR_PLACEHOLDER_SUFFIX),n="TR"==e.tagName?(0<e.getElementsByTagName("TH").length?e.getElementsByTagName("TH"):e.getElementsByTagName("TD"))[0].appendChild(n):e.hasClass("wfSection")||e.hasClass("inlineSection")?e.appendChild(n):(a=this.getFieldWrapperD(e.id))?a.appendChild(n):e.parentNode.insertBefore(n,e.nextSibling));var a=document.createElement("i");a.setAttribute("class","fa fa-exclamation-circle"),a.setAttribute("aria-hidden","true"),n.appendChild(a),n.appendChild(document.createTextNode(" ")),n.appendChild(i),wFORMS.standardizeElement(n),n.addClass(wFORMS.behaviors.validation.styling.errorMessage),this.applyFieldErrorAriaState(e,!0),this.setInlineErrorPresentOnWrapper(e,!0),n.setAttribute("tabindex","-1")},wFORMS.behaviors.validation.instance.prototype.removeErrorMessage=function(e){var t=this.getFieldWrapperD(e.id);e.hasClass||wFORMS.standardizeElement(e),e.addClass||wFORMS.standardizeElement(e),e.removeClass||wFORMS.standardizeElement(e),t&&!t.hasClass&&wFORMS.standardizeElement(t),t&&!t.addClass&&wFORMS.standardizeElement(t),t&&!t.removeClass&&wFORMS.standardizeElement(t),e.hasClass(this.behavior.styling.fieldError)&&e.removeClass(this.behavior.styling.fieldError),t&&t.hasClass(this.behavior.styling.fieldError)&&t.removeClass(this.behavior.styling.fieldError),e.id&&(e.hasClass||wFORMS.standardizeElement(e),!e.hasClass("choices")||(n=document.getElementById(e.id+"-L"))&&(n.removeClass||wFORMS.standardizeElement(n),n.hasClass&&n.hasClass(this.behavior.styling.errorMessage)&&n.removeClass(this.behavior.styling.errorMessage))),this.applyFieldErrorAriaState(e,!1);var n,t=document.getElementById(e.id+this.behavior.ERROR_PLACEHOLDER_SUFFIX);t?t.parentNode.removeChild(t):e.id&&(n=e.id.split("-D").join(""),(t=document.getElementById(n+this.behavior.ERROR_PLACEHOLDER_SUFFIX))&&t.parentNode.removeChild(t)),this.setInlineErrorPresentOnWrapper(e,!1)},wFORMS.behaviors.validation.instance.prototype.isSwitchedOff=function(e){switch(e.tagName){case"INPUT":case"TEXTAREA":case"SELECT":return!!e.disabled;default:if(!0===e.disabled)return!0;for(var t=e.getElementsByTagName("INPUT"),n=0;n<t.length;n++)if(!t[n].disabled)return!1;for(t=e.getElementsByTagName("TEXTAREA"),n=0;n<t.length;n++)if(!t[n].disabled)return!1;t=e.getElementsByTagName("SELECT");for(n=0;n<t.length;n++)if(!t[n].disabled)return!1;return!0}},wFORMS.behaviors.validation.isErrorPlaceholderId=function(e){return null!=e.match(new RegExp(wFORMS.behaviors.validation.ERROR_PLACEHOLDER_SUFFIX+"$"))},wFORMS.behaviors.validation.instance.prototype.isEmpty=function(e){return null==e||0==e.length||/^\s+$/.test(e)},wFORMS.behaviors.validation.instance.prototype.validateRestrictAutosuggest=function(e,t){return""===t||t===e.getAttribute("data-selected")},wFORMS.behaviors.validation.instance.prototype.validateRequired=function(e,t){if(e.getAttribute("class")&&-1!=e.getAttribute("class").indexOf("tt-hint"))return!0;switch(e.tagName){case"INPUT":switch((e.getAttribute("type")||"text").toLowerCase()){case"checkbox":case"radio":return e.checked;case"file":var n=document.getElementById("tfa_uploadDelete_"+e.id);return this.isEmpty(t)?n&&!n.checked:!0;default:return!this.isEmpty(t)}break;case"SELECT":case"TEXTAREA":return!this.isEmpty(t);default:return this.validateOneRequired(e)}return!1},wFORMS.behaviors.validation.instance.prototype.validateOneRequired=function(e){if(1!=e.nodeType)return!1;if(this.isSwitchedOff(e))return!1;switch(e.tagName){case"INPUT":switch((e.getAttribute("type")||"text").toLowerCase()){case"checkbox":case"radio":return e.checked;case"file":var t=document.getElementById("tfa_uploadDelete_"+e.id);return this.isEmpty(wFORMS.helpers.getFieldValue(e))?t&&!t.checked:!0;default:return!this.isEmpty(wFORMS.helpers.getFieldValue(e))}break;case"SELECT":case"TEXTAREA":return!this.isEmpty(wFORMS.helpers.getFieldValue(e));default:for(var n=0;n<e.childNodes.length;n++)if(this.validateOneRequired(e.childNodes[n]))return!0}return!1}
1,wFORMS.behaviors.validation.instance.prototype.validateAlpha=function(e,t){return this.isEmpty(t)||/^[a-zA-Z\s]+$/.test(t)},wFORMS.behaviors.validation.instance.prototype.validateAlphanum=function(e,t){return this.isEmpty(t)||/^[\w\s]+$/.test(t)},wFORMS.behaviors.validation.instance.prototype.validateHostname=function(e,t){return this.isEmpty(t)||/^[a-z0-9](-(?!($|\.))|\.(?!$)|[a-z0-9]){0,}$/i.test(t)},wFORMS.behaviors.validation.instance.prototype.validateDateTime=function(e,t){if(this.isEmpty(t))return!0;for(var n=wFORMS.behaviors.validation.dateRegex,i=0;i<n.length-1;i++)if(n[i].test(t))return!0;return!1},wFORMS.behaviors.validation.instance.prototype.validateDate=function(e,t){return!!this.isEmpty(t)||!(null===this.analyzeDateComponents(t))},wFORMS.behaviors.validation.relativeDate=function(e,t,n,i){this.sign=e,this.qty=t||0,this.unit=n||"Days",this.target=i||""},wFORMS.behaviors.validation.relativeDate.prototype.toString=function(){return this.sign+"|"+this.qty+"_"+this.unit+"{"+this.target+"}"},wFORMS.behaviors.validation.parseRelativeDateString=function(e){try{var t=e.match(/^([+-])\|(\d*)\_?(Days?|Months?|Years?)?\{(tfa_.+)?\}/),n=t[1],i=t[2],a=t[3];switch(a){case"Days":a="Day";break;case"Months":a="Month";break;case"Years":a="Year"}var r=t[4];return new wFORMS.behaviors.validation.relativeDate(n,i,a,r)}catch(e){return null}},wFORMS.behaviors.validation.instance.prototype.getRelativeDateControllerIds=function(e){var t,n=[],i=[];for(t in e.getAttribute(wFORMS.behaviors.validation.LOWER_BOUND_ATTRIBUTE)&&n.push(e.getAttribute(wFORMS.behaviors.validation.LOWER_BOUND_ATTRIBUTE)),e.getAttribute(wFORMS.behaviors.validation.UPPER_BOUND_ATTRIBUTE)&&n.push(e.getAttribute(wFORMS.behaviors.validation.UPPER_BOUND_ATTRIBUTE)),n){var a=wFORMS.behaviors.validation.parseRelativeDateString(n[t]);a&&""!=a.target&&-1==i.indexOf(a.target)&&i.push(a.target)}return!!i.length&&i},wFORMS.behaviors.validation.instance.prototype.analyzeDateComponents=function(e){try{r=wFORMS.helpers.calendar.locale}catch(e){}r=r||{MDY_DAY_POSITION:1,MDY_MONTH_POSITION:2,MDY_YEAR_POSITION:3},-1!=e.indexOf("-")&&4==e.split("-")[0].length&&(r={MDY_DAY_POSITION:3,MDY_MONTH_POSITION:2,MDY_YEAR_POSITION:1});var t=e.split(/[\/\.\-\s]/);if(3!=t.length){var n=this.computeWformsRelativeDateString(e);return n||null}for(var i=0;i<3;i++)if(!/^\d+$/.test(t[i]))return null;if(2<t[r.MDY_DAY_POSITION-1].length||2<t[r.MDY_MONTH_POSITION-1].length||4<t[r.MDY_YEAR_POSITION-1].length)return null;var a=t[r.MDY_YEAR_POSITION-1];if((a=2==a.length?50<a?"19"+a:"20"+a:a)<0||3e3<a)return null;e=parseInt(t[r.MDY_MONTH_POSITION-1],10);if(e<0||12<e)return null;n=parseInt(t[r.MDY_DAY_POSITION-1],10);if(n<0||31<n)return null;var r=new Date(a,e-1,n);return r.getMonth()+1!=e||r.getDate()!=n||r.getFullYear()!=a?null:r},wFORMS.behaviors.validation.instance.prototype.computeWformsRelativeDateString=function(val,timeStamp){var wfDateObj=wFORMS.behaviors.validation.parseRelativeDateString(val);if(null==wfDateObj)return null;var base=new Date;if(timeStamp)base.setTime(timeStamp);else if(wfDateObj.target){var escaped=wFORMS.helpers.escapeQuerySelector("#"+wfDateObj.target),compTarget=base2.DOM.Element.querySelector(this.target,escaped),base=this.analyzeDateComponents(compTarget.value);if(!base)return null}else{var now=new Date;base=new Date(now.getFullYear(),now.getMonth(),now.getDate())}var preComp=base.getTime();"Day"==wfDateObj.unit&&(wfDateObj.unit="Date"),"Year"==wfDateObj.unit&&(wfDateObj.unit="FullYear");var toComp="base.set"+wfDateObj.unit+"(base.get"+wfDateObj.unit+"()"+wfDateObj.sign+wfDateObj.qty+")";return eval(toComp),isNaN(base)&&base.setTime(preComp),base},wFORMS.behaviors.validation.instance.prototype.toWformsLocaleDateString=function(e){var t,n,i,a=[];try{t=wFORMS.helpers.calendar.locale}catch(e){t={MDY_DAY_POSITION:1,MDY_MONTH_POSITION:2,MDY_YEAR_POSITION:3,DATE_FIELD_DELIMITER:"/"}}for(i in t)if(i.match(/position/i)){switch(i.match(/_(.*)_/)[1]){case"DAY":n=e.getDate();break;case"MONTH":n=e.getMonth()+1;break;case"YEAR":n=e.getFullYear()}a[t[i]-1]=n}return a.join(t.DATE_FIELD_DELIMITER)}
1,wFORMS.behaviors.validation.instance.prototype.repeatHandler=function(e,t,i){var a=wFORMS.behaviors.validation.LOWER_BOUND_ATTRIBUTE,r=wFORMS.behaviors.validation.UPPER_BOUND_ATTRIBUTE;function n(e){return base2.DOM.Element.querySelectorAll(e,".validate-date, .validate-datecal")}n(e).forEach(function(e){var t=wFORMS.behaviors.validation.parseRelativeDateString(e.getAttribute(a)),n=wFORMS.behaviors.validation.parseRelativeDateString(e.getAttribute(r));t&&i.master[t.target]&&(t.target=i.master[t.target],e.setAttribute(a,t.toString())),n&&i.master[n.target]&&(n.target=i.master[n.target],e.setAttribute(r,n.toString()))});var s,o={};for(s in i.repeat){var l=function(e,t){for(var n in t)if(t[n]==e)return n;return e}(s,i.master);o[l]=i.repeat[s]}n(t).forEach(function(e){var t=wFORMS.behaviors.validation.parseRelativeDateString(e.getAttribute(a)),n=wFORMS.behaviors.validation.parseRelativeDateString(e.getAttribute(r));t&&o[t.target]&&(t.target=o[t.target],e.setAttribute(a,t.toString())),n&&o[n.target]&&(n.target=o[n.target],e.setAttribute(r,n.toString()))})},wFORMS.behaviors.validation.instance.prototype.validateTime=function(e,t){return!!this.isEmpty(t)||null!==this.analyzeTimeComponents(t)},wFORMS.behaviors.validation.instance.prototype.analyzeTimeComponents=function(e){var t=!1,n=!1;if(o=e.match(/a[^\da-z]?m/gi)){if(1<o.length)return null;1==o.length&&(t=!0)}if(o=e.match(/p[^\da-z]?m/gi)){if(1<o.length)return null;1==o.length&&(n=!0)}if(t&&n)return null;var i=null,a=0,r=0,s=0,o=!1;if((i=e.match(/(\d{1,2})[-:](\d{1,2})[-:](\d{1,2})/))&&4==i.length?(a=parseInt(i[1]),r=parseInt(i[2]),s=parseInt(i[3]),o=!0):(i=e.match(/(\d{1,2})[-:](\d{1,2})/))&&3==i.length?(a=parseInt(i[1]),r=parseInt(i[2]),o=!0):(i=e.match(/(\d{1,2})/))&&2==i.length&&(a=parseInt(i[1]),o=!0),!o)return null;if(n&&12<a)return null;if(n&&a<12&&(a+=12),t&&12===a)a=0;else if(t&&12<a)return null;return a<0||23<a||r<0||59<r||s<0||59<s?null:new Date(0,0,0,a,r,s,0)},wFORMS.behaviors.validation.instance.prototype.validateEmail=function(e,t){var n=/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)*[a-zA-Z]{2,63}$/;if(this.isEmpty(t))return!0;for(var i=t.split(","),a=0;a<i.length;a++)if(!n.test(i[a]))return!1;return!0},wFORMS.behaviors.validation.instance.prototype.validateInteger=function(e,t){return this.isEmpty(t)||/^[\-+]?\d+$/.test(t)},wFORMS.behaviors.validation.instance.prototype.validateFloat=function(e,t){return this.isEmpty(t)||wFORMS.helpers.isNumericValue(t)},wFORMS.behaviors.validation.instance.prototype.validatePhone=function(e,t){if(this.isEmpty(t))return!0;var n,i=[/^[\d\-\. \+\(\)]+$/,/^[\d\-\. \+\(\)]+ # {0,1}\d+ *$/,/^[\d\-\. \+\(\)]+ ext\.{0,1} \d+ *$/];for(n in i)if(i[n].test(t))return!0;return!1},wFORMS.behaviors.validation.instance.prototype.validateCustom=function(e,t){var n=new RegExp("/(.*)/([gi]*)"),n=e.className.match(n);if(this.isEmpty(t))return!0;if(n&&n[0]){n=new RegExp(n[1],n[2]);if(!t.match(n))return!1}return!0},wFORMS.behaviors.validation.instance.prototype.ALLOWED_ELEMENT_TYPE=['input[type="text"][id^="tfa_"]','textarea[id^="tfa_"]'],wFORMS.behaviors.validation.instance.prototype.validateWordCount=function(e,t){return!(e.count>e.getAttribute("data-maxwords"))},wFORMS.behaviors.validation.instance.prototype.numberRangeTest=function(e,t,n){var i,a=null,r=null;if(this.isEmpty(t))return!0;if(null==(a=(i=e.getAttribute(wFORMS.behaviors.validation.LOWER_BOUND_ATTRIBUTE))&&(this.validateFloat(i)||this.validateInteger(i))?parseFloat(i):a)&&(a=-1/0),null==(r=(e=e.getAttribute(wFORMS.behaviors.validation.UPPER_BOUND_ATTRIBUTE))&&(this.validateFloat(e)||this.validateInteger(e))?parseFloat(e):r)&&(r=1/0),t=parseFloat(t),isNaN(t)||null==t)return!1;e=null;return t<a&&(e=(null==e?"":e)+n.min.replace(/%1/g,a)),null==(e=r<t?(null==e?"":e+" ")+n.max.replace(/%1/g,r):e)||e},wFORMS.behaviors.validation.instance.prototype.dateRangeTest=function(e,t,n){return this.dateTimeRangeTestCommon(e,t,n,"analyzeDateComponents")},wFORMS.behaviors.validation.instance.prototype.timeRangeTest=function(e,t,n){return this.dateTimeRangeTestCommon(e,t,n,"analyzeTimeComponents")}
1,wFORMS.behaviors.validation.moveToLinkedDate=function(){var e,t=null!=this.id.match(/\[/)?this.id.replace("[","-D["):this.id+"-D",n=document.getElementById(t);n&&!wFORMS.behaviors.paging.isElementVisible(n)&&(e=wFORMS.behaviors.paging.helpers.findPage(n),wFORMS.getBehaviorInstance(document.getElementById("tfa_0"),"paging").jumpTo(wFORMS.behaviors.paging.getPageIndex(e))),n&&n.scrollIntoView?n.scrollIntoView():location.hash="#"+t},wFORMS.behaviors.validation.instance.prototype.dateTimeRangeTestCommon=function(e,t,n,i){var a=null,r=null;if(this.isEmpty(t))return!0;if((s=e.getAttribute(wFORMS.behaviors.validation.LOWER_BOUND_ATTRIBUTE))&&(a=this[i](s)),(o=e.getAttribute(wFORMS.behaviors.validation.UPPER_BOUND_ATTRIBUTE))&&(r=this[i](o)),null===(t=this[i](t)))return!1;r&&r<a&&(r=new Date(r.getTime()+864e5),(i=new Date(t)).setHours(12),i.setMinutes(0),i.setSeconds(0),t<i&&(t=new Date(t.getTime()+864e5)));var s,o,l,u=this.getRelativeDateControllerIds(e);if(u){if(!a&&s||!r&&o&&t){var h=wFORMS.helpers.escapeQuerySelector("#"+u[!a&&s?0:u.length-1]),h=base2.DOM.HTMLDocument.querySelector(this.target,h);return this.isSwitchedOff(h)?!0:n.dep.replace(/%1/,"%%"+h.id+"%%")}var c,d=this.elementsInError;for(c in d)if(-1<u.indexOf(d[c].id))return n.dep.replace(/%1/,"%%"+d[c].id+"%%")}if(a&&r&&r<a)return!0;s&&(this.computeWformsRelativeDateString(s)instanceof Date?(p=new Date(this.computeWformsRelativeDateString(s).getTime()),s=this.toWformsLocaleDateString(p)):-1!=s.indexOf("-")&&4==s.split("-")[0].length&&(l=s.split("-"),p=new Date(l[0],l[1]-1,l[2]),s=this.toWformsLocaleDateString(p))),o&&(this.computeWformsRelativeDateString(o)instanceof Date?(h=new Date(this.computeWformsRelativeDateString(o).getTime()),o=this.toWformsLocaleDateString(h)):-1!=o.indexOf("-")&&4==o.split("-")[0].length&&(l=o.split("-"),p=new Date(l[0],l[1]-1,l[2]),o=this.toWformsLocaleDateString(p)));var p=a&&t.getTime()<a.getTime(),t=r&&t.getTime()>r.getTime();return(p||t)&&r&&a?n.both.replace(/%1/g,s).replace(/%2/g,o):p?n.min.replace(/%1/g,s):!t||n.max.replace(/%1/g,o)},wFORMS.behaviors.validation.enableResumeLater=function(){var e,t=document.getElementById("tfa_resumeLater");t&&(wFORMS.behaviors.validation.messages.isPasswordConfirmed||(wFORMS.behaviors.validation.messages.isPasswordConfirmed="Your password and confirmation field did not match."),wFORMS.behaviors.validation.instance.prototype.isPasswordConfirmed=function(e,t){return!document.getElementById("tfa_confirmPassword")||t==document.getElementById("tfa_confirmPassword").value},wFORMS.behaviors.validation.messages.userPasswordPolicy||(wFORMS.behaviors.validation.messages.userPasswordPolicy="Password must include 12 characters, 1 uppercase letter, 1 lowercase letter, 1 number, and 1 special character."),wFORMS.behaviors.validation.instance.prototype.userPasswordPolicy=function(e,t){for(var n=[/^([^\s]{12,})/,/[a-z]/i,/[A-Z]/i,/[0-9]/,/[\"!#$%&'()*+,-.\/:;<=>?@\[\]\\\^_`{|}~]/],i=0;i<n.length;i++)if(!t.match(n[i]))return!1;return!0},wFORMS.behaviors.validation.messages.isPasswordStrong||(wFORMS.behaviors.validation.messages.isPasswordStrong="Please choose a more secure password. Passwords must contain 8 or more characters, with at least 1 letter (a to z), 1 number (0 to 9), and 1 symbol (like '%', '$' or '!')."),wFORMS.behaviors.validation.instance.prototype.isPasswordStrong=function(e,t){for(var n=[/^([^\s]{8,})/,/[a-zA-Z]/i,/[0-9]/,/[\"!#$%&'()*+,-.\/:;<=>?@\[\]\\\^_`{|}~]/],i=0;i<n.length;i++)if(!t.match(n[i]))return!1;return!0},wFORMS.behaviors.validation.messages.isPasswordMedium||(wFORMS.behaviors.validation.messages.isPasswordMedium="Please choose a more secure password. Passwords must contain 4 or more characters, with at least 1 letter (a to z) and 1 number (0 to 9)."),wFORMS.behaviors.validation.instance.prototype.isPasswordMedium=function(e,t){for(var n=[/^([^\s]{4,})/,/[a-zA-Z]/i,/[0-9]/],i=0;i<n.length;i++)if(!t.match(n[i]))return!1;return!0},wFORMS.behaviors.validation.messages.isPasswordWeak||(wFORMS.behaviors.validation.messages.isPasswordWeak="Your password cannot be empty."),wFORMS.behaviors.val
1idation.instance.prototype.isPasswordWeak=function(e,t){for(var n=[/^([^\s]{1,})/],i=0;i<n.length;i++)if(!t.match(n[i]))return!1;return!0},(e=document.getElementById("tfa_saveForLaterLink"))&&(e.onclick=function(){for(f=this;f&&"FORM"!=f.tagName;)f=f.parentNode;elem=document.getElementById("tfa_saveForLater"),elem&&!elem.checked&&elem.click(),elem&&elem.scrollIntoView?elem.scrollIntoView():location.hash="#tfa_saveForLater",new wFORMS.behaviors.condition.Trigger("#tfa_saveForLater").trigger()}),(e=document.getElementById("tfa_saveForLater"))&&(e.onclick=function(){var e=document.getElementById("saveAndResumeFieldset");e&&(e.style.display="block")}),wFORMS.behaviors.validation.formSaveForLater&&(document.getElementById("tfa_saveForLater").click(),document.getElementById("tfa_resumeEmail")&&(document.getElementById("tfa_resumeEmail").value=wFORMS.behaviors.validation.resumeEmail),document.getElementsByClassName("errMsg tfa_resumePassword").length&&wFORMS.behaviors.validation.instance.prototype.addErrorMessage(document.getElementById("tfa_resumePassword"),document.getElementsByClassName("errMsg tfa_resumePassword")[0].text),document.getElementsByClassName("errMsg tfa_resumeEmail").length&&wFORMS.behaviors.validation.instance.prototype.addErrorMessage(document.getElementById("tfa_resumeEmail"),document.getElementsByClassName("errMsg tfa_resumeEmail")[0].text)),t.onclick=function(e){wFORMS.behaviors.validation.saveCheckFunc(e,t)})},document.querySelector('script[data-for="FA__DOMContentLoadedEventDispatch"]')?base2.DOM.Element.addEventListener(document,"FA__DOMContentLoaded",wFORMS.behaviors.validation.enableResumeLater,!1):base2.DOM.Element.addEventListener(document,"DOMContentLoaded",wFORMS.behaviors.validation.enableResumeLater,!1),wFORMS.behaviors.word_counter={ALLOWED_ELEMENT_TYPES:['input[type="text"][id^="tfa_"]','textarea[id^="tfa_"]'],CLASSNAME:"count-words",ATTRIBUTE:"data-maxwords",applyTo:function(e){for(var t=[],n=[],i=0;i<this.ALLOWED_ELEMENT_TYPES.length;i++)n.push(this.ALLOWED_ELEMENT_TYPES[i]+"."+this.CLASSNAME);for(var a=e.querySelectorAll(n.join(",")),i=0;i<a.length;i++){var r=a.item(i),r=new wFORMS.behaviors.word_counter.instance(r);t.push(r)}return t},instance:function(e){this.target=e,this.counter=null,this.wordCount=0,this.maxWords=parseInt(e.getAttribute(wFORMS.behaviors.word_counter.ATTRIBUTE)),this.addHandlers(e),this.addCounter(e)}},wFORMS.behaviors.word_counter.instance.prototype={addHandlers:function(e){var t=this;e.addEventListener||wFORMS.standardizeElement(e),e.addEventListener("keyup",function(){t.updateCounter(e)},!1),e.addEventListener("paste",function(){setTimeout(function(){t.updateCounter(e)},0)},!1),e.addEventListener("cut",function(){setTimeout(function(){t.updateCounter(e)},0)},!1),e.addEventListener("focus",function(){t.updateCounter(e)},!1),e.addEventListener("focus",function(){t.counter.style.visibility="visible"},!1),e.addEventListener("blur",function(){t.counter.style.visibility="hidden"},!1)},addCounter:function(e){var t=e.parentNode;this.counter=document.createElement("span"),this.counter.className=wFORMS.behaviors.word_counter.CLASSNAME,this.counter.message=wFORMS.behaviors.validation.messages.wordsRemPos,this.counter.style.marginLeft="10px",this.counter.style.visibility="hidden",this.counter.setAttribute("aria-live","assertive"),e.count=0,t.insertBefore(this.counter,e.nextSibling),this.updateCounter(e)},getWordCount:function(){return this.wordCount},updateCounter:function(e){try{this.wordCount=this.target.value.match(/\S+/g).length}catch(e){this.wordCount=0}0<=this.maxWords-this.wordCount?(this.counter.message=wFORMS.behaviors.validation.messages.wordsRemPos,this.counter.className=this.counter.className.replace(/errMsg/,"")):this.counter.className.match(/errMsg/)||(this.counter.message=wFORMS.behaviors.validation.messages.wordsRemNeg,this.counter.className+=" errMsg"),this.counter.innerHTML=Math.abs(this.maxWords-this.wordCount)+" "+this.counter.message,e.count=this.wordCount}},wFORMS.behaviors.validation.saveButtonIsEnabled=function(){var e=document.getElementById("tfa_resumeLater");return null!==e&&!e.hasAttribute("disabled")}
1,wFORMS.behaviors.validation.saveCheckFunc=function(e,t){document.getElementsByClassName("errorMessage errMsg")[0]&&(document.getElementsByClassName("errorMessage errMsg")[0].style.visibility="hidden");var n,i=t.form,a=wFORMS.getBehaviorInstance(i,"validation");a&&(n=a.behavior.rules,a.behavior.rules=[],a.behavior.rules.isEmail={selector:"#tfa_resumeEmail",check:"validateEmail"},a.behavior.rules.isRequired={selector:"#tfa_resumeEmail",check:"validateRequired"},a.behavior.rules.userPasswordPolicy={selector:"#tfa_resumePassword",check:"userPasswordPolicy"},a.behavior.rules.isPasswordConfirmed={selector:"#tfa_resumePassword",check:"isPasswordConfirmed"});var r=wFORMS.getBehaviorInstance(i,"paging");r&&(r.behavior.warnOnUnload=!1),a&&a.run(e,i)?(t.disabled=!0,a.behavior.rules=n,t.value=" ... ",i.submit()):(t.disabled=!1,a&&(a.behavior.rules=n))},"undefined"==typeof wFORMS)throw new Error("wFORMS core not found. This behavior depends on the wFORMS core.");if(wFORMS.behaviors.calculation={skip:!1,VARIABLE_SELECTOR_PREFIX:"calc-",CHOICE_VALUE_SELECTOR_PREFIX:"calcval-",CALCULATION_SELECTOR:'*[class*="formula="]',CALCULATION_ERROR_MESSAGE:"There was an error computing this field.",instance:function(e){var t=this;this.behavior=wFORMS.behaviors.calculation,this.target=e,this.calculations=[],this.dependencyIndex=new Map,e.__wFormsCalculationInstanceInitializationHandled||(e.addEventListener||wFORMS.standardizeElement(e),e.addEventListener("submit",function(e){t.refreshAll()},!1),e.__wFormsCalculationInstanceInitializationHandled=!0)}},wFORMS.behaviors.calculation.applyTo=function(l){if(wFORMS.behaviors.calculation.skip)return null;for(;l&&"FORM"!=l.tagName;)l=l.parentNode;var e,u=wFORMS.getBehaviorInstance(l,"calculation");return u?(u.calculations=[],u.dependencyIndex=new Map):u=new wFORMS.behaviors.calculation.instance(l),wFORMS.behaviors.repeat&&!u._repeatRemoveHandler&&(e=wFORMS.behaviors.repeat.onRemove,u._repeatRemoveHandler=function(){wFORMS.behaviors.calculation.applyTo(l),e&&e.apply(this,arguments)},wFORMS.behaviors.repeat.onRemove=u._repeatRemoveHandler),base2.DOM.Element.querySelectorAll(l,wFORMS.behaviors.calculation.CALCULATION_SELECTOR).forEach(function(e){var t=e.className.substr(e.className.indexOf("formula=")+8).split(" ")[0],i=(i=t.split(/[^a-zA-Z]+/g)).filter((e,t,n)=>n.indexOf(e)===t);u.varFields=[];for(var a=0;a<i.length;a++)""!=i[a]&&base2.DOM.Document.querySelectorAll(l,'*[class*="'+wFORMS.behaviors.calculation.VARIABLE_SELECTOR_PREFIX+i[a]+'"]').forEach(function(e){if(e.addEventListener||base2.DOM.bind(e),-1!=(" "+e.className+" ").indexOf(" "+wFORMS.behaviors.calculation.VARIABLE_SELECTOR_PREFIX+i[a]+" ")){if(!wFORMS.behaviors.calculation.isHandled(e)){var t=e.tagName.toLowerCase();if("input"==t||"textarea"==t){var n=e.type.toLowerCase();"input"!=t||"radio"!=n&&"checkbox"!=n?e.addEventListener("blur",function(e){return u.run(e,this)},!1):e.addEventListener("click",function(e){return u.run(e,this)},!1),wFORMS.behaviors.calculation.setHandledFlag(e)}else{if("select"!=t)return;e.addEventListener("change",function(e){return u.run(e,this)},!1),wFORMS.behaviors.calculation.setHandledFlag(e)}}u.varFields.push({name:i[a],field:e})}});var n={field:e,formula:t,variables:u.varFields};u.calculations.push(n);for(var r=0;r<n.variables.length;r++){var s,o=n.variables[r].field;u.inScope(n.field,o)&&((s=u.dependencyIndex.get(o))||(s=new Set,u.dependencyIndex.set(o,s)),s.add(n))}u.compute(n)}),u.onApply(),u},wFORMS.behaviors.calculation.instance.prototype.onApply=function(){},wFORMS.behaviors.calculation.instance.prototype.run=function(e,t){var n,t=this.dependencyIndex&&this.dependencyIndex.get(t);t&&(n=this,t.forEach(function(e){n.compute(e)}))},wFORMS.behaviors.calculation.instance.prototype.refresh=function(e,t){for(var n=0;n<this.calculations.length;n++){var i=this.calculations[n];t==i.field&&this.compute(i)}},wFORMS.behaviors.calculation.instance.prototype.refreshAll=function(){for(var e=0;e<this.calculations.length;e++){var t=this.calculations[e];this.compute(t)}},wFORMS.behaviors.calculation.instance.prototype.getCalculatedFields=function(e){for(var t=[],n=0;n<this.calculations.length;n++){this.calculations[n];for(var i=0;i<this.calculations[n].variables.length;i++)(e.nodeName&&this.calculations[n].variables[i].field==e||"string"==typeof e&&this.calculations[n].variables[i].name==e)&&t.push(this.calculations[n].field)}return t},wFORMS.behaviors.calculation.instance.prototype.compute=function(n){var e=this.assignVariables(n)+n.formula,i=this;this.evaluateFormula(e,function(e){var t;n.field.value!==e&&(n.field.value=e,t=new CustomEvent("change"),n.field.dispatchEvent(t)),i.runFieldValidation(e,n.field);e=new CustomEvent("blur");n.field.dispatchEvent(e),i.isVariable(n.field)&&i.run(null,n.field)})},wFORMS.behaviors.calculation.instance.prototype.runFieldValidation=function(e,t){var n=wFORMS.getBehaviorInstance(this.target,"validation");
1n&&(wFORMS.behaviors.validation.messages.calculation||(wFORMS.behaviors.validation.messages.calculation=this.behavior.CALCULATION_ERROR_MESSAGE),n.removeErrorMessage(t),"error"==e&&n.fail(t,"calculation"))},wFORMS.behaviors.calculation.instance.prototype.evaluateFormula=function(e,t){this.evaluateFormulaWithoutSandbox(e,t)},wFORMS.behaviors.calculation.instance.prototype.evaluateFormulaWithoutSandbox=function(formula,callback){var result;try{var calc=function(){return eval(formula)},result=calc();"Infinity"!=result&&"NaN"!=result&&!String(result).match("NaN")||(result="error")}catch(x){result="error"}callback(result)},wFORMS.behaviors.calculation.instance.prototype.assignVariables=function(a){for(var e="",t=new Array,r=!0,n=0;n<a.variables.length;n++){var i,s=a.variables[n],o=r?0:"",l=this;wFORMS.helpers.contains(t,s.name)||(t.push(s.name),base2.DOM.Document.querySelectorAll(this.target,'*[class*="'+l.behavior.VARIABLE_SELECTOR_PREFIX+s.name+'"]').forEach(function(e){var t=-1!=(" "+e.className+" ").indexOf(" "+wFORMS.behaviors.calculation.VARIABLE_SELECTOR_PREFIX+s.name+" ");if(t&&l.inScope(a.field,e)){if(e.disabled){t=e.getBoundingClientRect();if(0===t.height&&0===t.width)return}var n=l.hasValueInClassName(e)?l.getValueFromClassName(e):wFORMS.helpers.getFieldValue(e);if((n="string"!=typeof n&&!n?0:n).constructor==Array)for(var i=0;i<n.length;i++)(r=!wFORMS.helpers.isNumericValue(n[i])&&!wFORMS.helpers.isEmptyValue(n[i])?!1:r)?o+=wFORMS.helpers.getNumericValue(n[i]):o=o?String(o).concat(n[i]):n[i];else(r=!wFORMS.helpers.isNumericValue(n)&&!wFORMS.helpers.isEmptyValue(n)?!1:r)?o+=wFORMS.helpers.getNumericValue(n):o=o?String(o).concat(n):String(n)}}),e=r?"var "+s.name+" = "+o+"; "+e:(i=o.replace(/"/g,'\\"').replace(/\n/g,"\\n"),"var "+s.name+' = "'+i+'"; '+e))}return e},wFORMS.behaviors.calculation.instance.prototype.isVariable=function(e){return e.className&&-1!=e.className.indexOf(this.behavior.VARIABLE_SELECTOR_PREFIX)},wFORMS.behaviors.calculation.instance.prototype.hasValueInClassName=function(e){if("SELECT"!==e.tagName)return!(!e.className||-1==(" "+e.className).indexOf(" "+this.behavior.CHOICE_VALUE_SELECTOR_PREFIX));for(var t=0;t<e.options.length;t++)if(e.options[t].className&&-1!=e.options[t].className.indexOf(this.behavior.CHOICE_VALUE_SELECTOR_PREFIX))return!0;return!1},wFORMS.behaviors.calculation.instance.prototype.getValueFromClassName=function(e){switch(e.tagName){case"INPUT":if(!e.className||-1==e.className.indexOf(this.behavior.CHOICE_VALUE_SELECTOR_PREFIX))return null;var t=e.className.split(this.behavior.CHOICE_VALUE_SELECTOR_PREFIX)[1].split(" ")[0];return"checkbox"==e.type||"radio"==e.type?e.checked?t:wFORMS.helpers.isNumericValue(t)?0:"":t;case"SELECT":if(-1==e.selectedIndex)return null;for(var n=[],i=0;i<e.options.length;i++)e.options[i].selected&&e.options[i].className&&-1!=e.options[i].className.indexOf(this.behavior.CHOICE_VALUE_SELECTOR_PREFIX)&&(t=e.options[i].className.split(this.behavior.CHOICE_VALUE_SELECTOR_PREFIX)[1].split(" ")[0],n.push(t));return 0==n.length?null:n;case"TEXTAREA":return e.className&&-1!=e.className.indexOf(this.behavior.CHOICE_VALUE_SELECTOR_PREFIX)?t=e.className.split(this.behavior.CHOICE_VALUE_SELECTOR_PREFIX)[1].split(" ")[0]:null;default:return null}return null},wFORMS.behaviors.calculation.isHandled=function(e){return!0===e._wforms_calc_handled},wFORMS.behaviors.calculation.setHandledFlag=function(e){e._wforms_calc_handled=!0},wFORMS.behaviors.calculation.removeHandledFlag=function(t){try{delete t._wforms_calc_handled}catch(e){t._wforms_calc_handled=void 0}},wFORMS.behaviors.calculation.instance.prototype.inScope=function(e,t){if(wFORMS.behaviors.repeat){for(var n=[],i=[],a=wFORMS.behaviors.repeat.getRepeatedElement(e);a;)n.push(a),a=wFORMS.behaviors.repeat.getRepeatedElement(a.parentNode);for(a=wFORMS.behaviors.repeat.getRepeatedElement(t);a;)i.push(a),a=wFORMS.behaviors.repeat.getRepeatedElement(a.parentNode);t=function(e,t){for(var n=0;n<e.length;n++){for(var i=0;i<t.length&&e[n]!==t[i];i++);if(i==t.length)return!1}return!0};return t(n,i)||t(i,n)}return!0},"undefined"==typeof wFORMS)throw new Error("wFORMS core not found. This behavior depends on the wFORMS core.");if(wFORMS.behaviors.autoformat={ATTRIBUTE_SELECTOR:'input[autoformat][id^="tfa_"]',ALLOWED_ELEMENT_TYPE:['input[type="text"]'],NUMERIC_REGEX:new RegExp("\\d","u"),ALPHANUMERIC_REGEX:new RegExp("[\\p{L}\\d]","u"),_globalCache:{},instance:function(e){this.actorsInDomain=[]},Mask:function(e){if("undefined"==typeof IMask)throw new Error("IMask library n
1ot found. This behavior depends on the IMask library.");var t=this;this.element=e,wFORMS.standardizeElement(this.element),this.parentForm=this.element.form,wFORMS.standardizeElement(this.parentForm),this.handlers=this.getEventHandlers();e=IMask(this.element,{mask:this.element.getAttribute("autoformat").replace(/[0a*\[\]{}\\`]/g,"\\$&"),lazy:!1,blocks:{"#":{mask:"#",placeholderChar:"#",definitions:{"#":wFORMS.behaviors.autoformat.NUMERIC_REGEX}},$:{mask:"$",placeholderChar:"$",definitions:{$:wFORMS.behaviors.autoformat.ALPHANUMERIC_REGEX}}}});return window.setTimeout(function(){t.addListeners()},1),this.getRtl(this.element)&&(this.element.style.direction="ltr",this.element.style.textAlign="right"),e},applyTo:function(e){var t=base2.DOM.Element.querySelectorAll(e,wFORMS.behaviors.autoformat.ATTRIBUTE_SELECTOR),n=[];t.forEach(function(e){base2.DOM.Element.matchesSelector(e,wFORMS.behaviors.autoformat.ALLOWED_ELEMENT_TYPE[0])&&(e=wFORMS.behaviors.autoformat._getIDForActorElement(e),n.push(e))});var i,a,r,t=new wFORMS.behaviors.autoformat.instance(e);return t.actorsInDomain=n,wFORMS.behaviors.autoformat.applyToVisibleElements(t),wFORMS.behaviors.paging&&wFORMS.getBehaviorInstance(e,"paging")&&(i=wFORMS.getBehaviorInstance(e,"paging"),a=i.onPageChange,r=t,i.onPageChange=function(e){wFORMS.behaviors.autoformat.applyToVisibleElements(r),a.apply(i,arguments)}),t},_getIDForActorElement:function(e){if(""===e.id)for(;;){var t=wFORMS.helpers.randomId();if(null===document.getElementById(t)){e.id=t;break}}return e.id}},wFORMS.behaviors.autoformat.instance.prototype.onApply=function(){},wFORMS.behaviors.autoformat.instance.prototype.run=function(){},wFORMS.behaviors.autoformat.applyToVisibleElements=function(e){for(var t,n,i=0;i<e.actorsInDomain.length;i++){var a=e.actorsInDomain[i],r=document.getElementById(a);t=a,n=r,wFORMS.behaviors.autoformat._globalCache[t]||(wFORMS.behaviors.autoformat._globalCache[t]=new wFORMS.behaviors.autoformat.Mask(n))}},wFORMS.behaviors.autoformat.Mask.prototype.getRtl=function(){var e;return this.element&&(window.getComputedStyle?e=window.getComputedStyle(this.element).direction:this.element.currentStyle&&(e=this.element.currentStyle.direction)),"rtl"===e},wFORMS.behaviors.autoformat.Mask.prototype.getEventHandlers=function(){var e=this;return{focus:function(){e.focus()},blur:function(){e.blur()},submit:function(){e.submit()}}},wFORMS.behaviors.autoformat.Mask.prototype.addListeners=function(){this.parentForm.addEventListener("submit",this.handlers.submit),this.element.addEventListener("focus",this.handlers.focus),this.element.addEventListener("blur",this.handlers.blur)},wFORMS.behaviors.autoformat.Mask.prototype.removeListeners=function(){this.parentForm.removeEventListener("submit",this.handlers.submit),this.element.removeEventListener("focus",this.handlers.focus),this.element.removeEventListener("blur",this.handlers.blur)},wFORMS.behaviors.autoformat.Mask.prototype.submit=function(){var e=wFORMS.behaviors.autoformat._globalCache[this.element.id];e.rawInputValue&&e.value!==e.el.input.getAttribute("autoformat")?e.rawInputValue&&(/[#$]/.test(e.value)?e.el.input.value=e.masked._value:e.el.input.value=e.value):/[$#]/.test(e.masked.mask)?e.el.input.value="":e.el.input.value=e.el.input.getAttribute("autoformat")},wFORMS.behaviors.autoformat.Mask.prototype.focus=function(){var e=wFORMS.behaviors.autoformat._globalCache[this.element.id];e.rawInputValue?e.el.input.value=e.value:e.el.input.placeholder=e.el.input.getAttribute("autoformat")},wFORMS.behaviors.autoformat.Mask.prototype.blur=function(){var e=wFORMS.behaviors.autoformat._globalCache[this.element.id];e.el.input.placeholder="",e.rawInputValue?/[$#]/.test(e.value)?e.el.input.value=e.masked._value:e.el.input.value=e.value:/[$#]/.test(e.masked.mask)?e.el.input.value="":e.el.input.value=e.el.input.getAttribute("autoformat")},"undefined"==typeof wFORMS)throw new Error("wFORMS core not found. This behavior depends on the wFORMS core.");if(wFORMS.behaviors.lengthPrompt={ATTRIBUTE_SELECTOR:"maxLength",MASK_ATTRIBUTE_SELECTOR:"maskMaxLength",ALLOWED_ELEMENT_TYPE:['input[type="text"][id^="tfa_"]','input[type="color"][id^="tfa_"]','input[type="date"][id^="tfa_"]','input[type="datetime"][id^="tfa_"]','input[type="datetime-local"][id^="tfa_"]','input[type="email"][id^="tfa_"]','input[type="month"][id^="tfa_"]','input[type="number"][id^="tfa_"]','input[type="range"][id^="tfa_"]','input[type="search"][id^="tfa_"]','input[type="tel"][id^="tfa_"]','input[type="time"][id^="tfa_"]','input[type="url"][id^="tfa_"]','input[type="week"][id^="tfa_"]','textarea[id^="tfa_"]'],MONITOR_CHECK_TIMES:10,CUSTOM_INDICATOR_STYLE:"lengthIndicator",keyCode:{LEFT:37,RIGHT:39,END:35,HOME:36,DELETE:46,BACKSPACE:8,TAB:9},instance:function(e){this.element=e,this.ui_indicator=null,this.maxLength=-1,this.previousLength=-1,this._pasteMonitorHandler=null,this.inputCache=null},_globalCache:{},applyTo:function(e){"use strict";base2.DOM.Element.querySelectorAll(e,wFORMS.behaviors.lengthPrompt._getActorsSelector()).forEac
1h(function(e){var t,n=e.getAttribute(wFORMS.behaviors.lengthPrompt.ATTRIBUTE_SELECTOR)||e.getAttribute(wFORMS.behaviors.lengthPrompt.MASK_ATTRIBUTE_SELECTOR);null!=n&&((t=new wFORMS.behaviors.lengthPrompt.instance(e)).maxLength=parseInt(n),n=wFORMS.behaviors.lengthPrompt._getIDForActorElement(e),wFORMS.standardizeElement(e),t.deployUI(),t.bindEvents(),wFORMS.behaviors.lengthPrompt._globalCache[n]=t)})},eventHandlers:{focus:function(e){var t=wFORMS.behaviors.lengthPrompt._globalCache[this.id];t&&t.showIndicator()},blur:function(e){var t=wFORMS.behaviors.lengthPrompt._globalCache[this.id];t&&t.hideIndicator()},keyup:function(e){var t=wFORMS.behaviors.lengthPrompt._globalCache[this.id];t&&t.checkUpdate()},paste:function(e){var t,n,i=wFORMS.behaviors.lengthPrompt._globalCache[this.id];i&&(t=wFORMS.behaviors.lengthPrompt.getSelection(i.element),i.inputCache=this.value,i._pasteMonitorHandler=window.setInterval((n=0,function(){var e=i.checkCacheTempered(t);!1!==e&&(window.clearInterval(i._pasteMonitorHandler),i.handlePaste(e,t)),++n>=wFORMS.behaviors.lengthPrompt.MONITOR_CHECK_TIMES&&window.clearInterval(i._pasteMonitorHandler)}),10))},textarea_input:function(e){var t=wFORMS.behaviors.lengthPrompt._globalCache[this.id];t&&t.restrictInput(e)}},messages:"%1 characters left.",_getActorsSelector:function(){if(!wFORMS.behaviors.lengthPrompt.ACTORS_SELECTOR){for(var e="",t=0;t<wFORMS.behaviors.lengthPrompt.ALLOWED_ELEMENT_TYPE.length;t++)e+=wFORMS.behaviors.lengthPrompt.ALLOWED_ELEMENT_TYPE[t]+"["+wFORMS.behaviors.lengthPrompt.ATTRIBUTE_SELECTOR+"], ",e+=wFORMS.behaviors.lengthPrompt.ALLOWED_ELEMENT_TYPE[t]+"["+wFORMS.behaviors.lengthPrompt.MASK_ATTRIBUTE_SELECTOR+"], ";wFORMS.behaviors.lengthPrompt.ACTORS_SELECTOR=e.slice(0,-2)}return wFORMS.behaviors.lengthPrompt.ACTORS_SELECTOR},_getIDForActorElement:function(e){if(""===e.id)for(;;){var t=wFORMS.helpers.randomId();if(null==document.getElementById(t)){e.id=t;break}}return e.id},getSelection:function(e){var t,n,i,a=-1;return 0<=e.selectionStart?(a=e.selectionStart,t=e.selectionEnd-e.selectionStart):document.selection?(e.tagName&&"TEXTAREA"===e.tagName?(n=document.selection.createRange().duplicate(),(i=e.createTextRange()).collapse(!1),i.moveToBookmark(n.getBookmark()),""===n.text&&((e=i.duplicate()).moveEnd("character",1),n.boundingWidth===e.boundingWidth&&n.boundingHeight===e.boundingHeight&&(i=e))):i=document.selection.createRange().duplicate(),t=i.text.length,a=Math.abs(i.moveStart("character",-1e6))):document.getSelection&&(a=0,t=document.getSelection().length),{caret:a,length:t}},setCaretPosition:function(e,t){e.setSelectionRange?(e.focus(),e.setSelectionRange(t,t)):e.createTextRange&&((e=e.createTextRange()).collapse(!0),e.moveEnd("character",t),e.moveStart("character",t),e.select())}},function(e){"use strict";for(var t in e)wFORMS.behaviors.lengthPrompt.instance.prototype[t]=e[t]}({deployUI:function(){var e=this.element.parentNode;base2.DOM.Element.matchesSelector(this.element.parentNode,wFORMS.INPUT_CONTROL_WRAPPER_SELECTOR)||(e=this.mirrorWrapperDiv());var t=document.createElement("div");e.appendChild(t),t.style.display="none",t.className=wFORMS.behaviors.lengthPrompt.CUSTOM_INDICATOR_STYLE,t.setAttribute("aria-live","assertive"),this.ui_indicator=t,this.adjustIndicatorPosition(),this.checkUpdate()},adjustIndicatorPosition:function(){for(var t,e=(t=this.element,function(e){return parseFloat(base2.DOM.AbstractView.getComputedStyle(window,t,"").getPropertyValue(e).replace(/px$/,""))||0}),n=this.element.offsetWidth||e("width"),i=["margin-left","margin-right","border-left-width","border-right-width","padding-left","padding-right"],a=0,r=i.length;a<r;a++)n+=e(i[a])||0;this.ui_indicator.style.left=n+"px"},mirrorWrapperDiv:function(){var e=document.createElement("div");return this.element.parentNode.insertBefore(e,this.element),e.appendChild(this.element),e},bindEvents:function(){for(var e=0,t=["focus","blur"];e<t.length;e++){var n=t[e];this.element.addEventListener(n,wFORMS.behaviors.lengthPrompt.eventHandlers[n],!0)}"TEXTAREA"==this.element.tagName.toUpperCase()&&(this.element.addEventListener("paste",wFORMS.behaviors.lengthPrompt.eventHandlers.paste,!0),this.element.addEventListener("keydown",wFORMS.behaviors.lengthPrompt.eventHandlers.textarea_input,!0))},bindMonitorEvent:function(){for(var e=0,t=["keyup"];e<t.length;e++){var n=t[e];this.element.addEventListener(n,wFORMS.behaviors.lengthPrompt.eventHandlers[n],!0)}},releaseMonitorEvent:function(){for(var e=0,t=["keyup"];e<t.length;e++){var n=t[e];base2.DOM.Element.removeEventListener(this.element,n,wFORMS.behaviors.lengthPrompt.eventHandlers[n],!0)}},checkCacheTempered:function(e){var t=this.element.value;if(t==this.inputCache)return!1;var n=t.length-this.inputCache.length+e.length,e=wFORMS.behaviors.lengthPrompt.getSelection(this.element).caret-n;return{diff:t.substr(e,n),start:e,length:n}},handlePaste:function(e,t){var n=this.inputCache.length-t.length+e.length-this.maxLength,e=e.diff;0<n&&(e=e.substr(0,e.length-n)),this.element.value=this.inputCache.substr(0,t.caret)+e+this.inputCache.substr(t.caret+t.length,this.inputCache.length),wFORMS.behaviors.lengthPrompt.setCaretPosition(this.element,t.caret+e.length),this.checkUpdate()},restrictInput:function(e){this.getFieldLength()!=this.maxLength||this.testSpecialKey(e)||0!=wFORMS.behaviors.lengthPrompt.getSelection(this.element).length||e.preventDefault()},testSpecialKey:function(e){var t=e.which||e.keyCode;return e.ctrlKey&&(65==t||88==t||67==t||86==t)||t==wFORMS.behaviors.lengthPrompt.keyCode.END||t==wFORMS.behaviors.lengthPrompt.keyCode.HOME||t==wFORMS.behaviors.lengthPrompt.keyCode.LEFT||t==wFORMS.behaviors.lengthPrompt.keyCode.RIGHT||t==wFORMS.behaviors.lengthPrompt.keyCode.DELETE||t==wFORMS.behaviors.lengthPrompt.keyCode.BACKSPACE||t==wFORMS.behaviors.lengthPrompt.keyCode.TAB},showIndicator:function(){this.adjustIndicatorPosition(),this.ui_indicator.style.display="block",this.bindMonitorEvent()},hideIndicator:function(){this.ui_indicator.style.display="none",this.releaseMonitorEvent()},updateIndicator:function(){var e=this.getFieldLength(),e=this.maxLength-e;this.ui_indicator.innerHTML=wFORMS.behaviors.lengthPrompt.messages.replace(/%1/g,e)},checkUpdate:function(){var e=this.getFieldLength();e!=this.previousLength&&(this.updateIndicator(),this.previousLength=e)},getFieldLength:function(){var e=wFORMS.behaviors.autoformat&&wFORMS.behaviors.autoformat._globalCache[this.element.i
1d];return(e?e.rawInputValue:this.element.value).replace(/(\r\n|\n|\r)/g,"--").length}}),"undefined"==typeof wFORMS)throw new Error("wFORMS core not found. This behavior depends on the wFORMS core.");if(wFORMS.behaviors.dependent_list={skip:!1,instance:function(e){this.behavior=wFORMS.behaviors.dependent_list,this.target=e}},wFORMS.behaviors.dependent_list.applyTo=function(e){if(wFORMS.behaviors.dependent_list.skip)return null;var i=new wFORMS.behaviors.dependent_list.instance(e);e.querySelectorAll||base2.DOM.bind(e);e=e.querySelectorAll("option[data-filter-dependent], select[data-filter-dependent], input[data-filter-dependent]");return e.forEach(function(e){e.addEventListener||base2.DOM.bind(e),e.addEventListener("change",function(e){i.run(e,this)},!1),i.run(null,e)}),0<e.length&&wFORMS.behaviors.repeat&&(wFORMS.behaviors.repeat.observeRepeatComplete(function(e,t,n){i.onRepeatableDuplicated(e,t,n)}),wFORMS.behaviors.repeat.observeRemoveComplete(function(e){i.onRepeatableRemoved(e)})),i.onApply(),i},wFORMS.behaviors.dependent_list.instance.prototype.onApply=function(){},wFORMS.behaviors.dependent_list.instance.prototype.run=function(e,t){var n=this,i=wFORMS.helpers.getForm(this.target),t=t.getAttribute("data-filter-dependent");i.querySelectorAll(t).forEach(function(e){n.applyFiltersTo(e)})},wFORMS.behaviors.dependent_list.instance.prototype.applyFiltersTo=function(t){var n=this,e=wFORMS.helpers.getForm(this.target),i=t.getAttribute("data-filter-control");e.querySelectorAll(i).forEach(function(e){n.filter(e,t)})},wFORMS.behaviors.dependent_list.instance.prototype.filter=function(e,r){var s=this;this._dirtyCalculations={};function t(e,t){var n=(e.checked||e.selected)&&!e.disabled,i=e.getAttribute("data-filter-include"),a=e.getAttribute("data-filter-exclude");(i=!i&&!a?"optgroup[label='"+s.getChoiceLabel(e).replace(/\\/g,"\\\\").replace(/'/g,"\\'")+"']":i)&&(n?"selected"==t&&s.include(r,i):"deselected"==t&&s.exclude(r,i)),a&&(n?"selected"==t&&s.exclude(r,a):"deselected"==t&&s.include(r,a))}"INPUT"==e.tagName?(t(e,"deselected"),t(e,"selected")):((e=e.querySelectorAll("input[type=checkbox],input[type=radio],option")).forEach(function(e){t(e,"deselected")}),e.forEach(function(e){t(e,"selected")}));var n,i=wFORMS.getBehaviorInstance(wFORMS.helpers.getForm(this.target),"calculation");for(n in this._dirtyCalculations)i.run(null,this._dirtyCalculations[n]);this._dirtyCalculations={},r.getAttribute("data-filter-dependent")&&this.run(null,r)},wFORMS.behaviors.dependent_list.instance.prototype.include=function(e,t){e.querySelectorAll(t).forEach(function(e){var t;e.disabled=!1,e.style.display="","OPTGROUP"!=e.tagName&&"OPTION"!=e.tagName||"SPAN"==e.parentNode.tagName&&((t=e.parentNode).parentNode.insertBefore(e,t),t.parentNode.removeChild(t)),fields=e.querySelectorAll("input,select,textarea,option"),fields.forEach(function(e){e.disabled=!1})})},wFORMS.behaviors.dependent_list.instance.prototype.exclude=function(e,t){var t=e.querySelectorAll(t),n=wFORMS.getBehaviorInstance(wFORMS.helpers.getForm(this.target),"calculation"),i=this;t.forEach(function(e){if(e.disabled="disabled",e.style.display="none",e.selected&&(e.selected=!1),e.checked&&(e.checked=!1),"OPTGROUP"==e.tagName||"OPTION"==e.tagName){"SPAN"!=e.parentNode.tagName&&e.parentNode.insertBefore(document.createElement("span"),e).appendChild(e);for(var t=e.parentNode;t&&"SELECT"!=t.tagName;)t=t.parentNode;t&&n&&n.isVariable(t)&&(i._dirtyCalculations[t.id]=t)}else n&&n.isVariable(e)&&(i._dirtyCalculations[t.id]=t);fields=e.querySelectorAll("input,select,textarea,option"),fields.forEach(function(e){e.disabled="disabled",e.selected=!1,n&&n.isVariable(e)&&(i._dirtyCalculations[e.id]=e)})})},wFORMS.behaviors.dependent_list.instance.prototype.getChoiceLabel=function(e){return(e="OPTION"!=e.tagName?this.target.querySelector("label[for='"+e.getAttribute("id")+"']"):e).textContent||e.innerText},wFORMS.behaviors.dependent_list.instance.prototype.updateReference=function(e,t,n,i,a){var r=e.getAttribute(t),s=r?r.split(","):[];if(0<s.length){if(a){for(var o=0;o<s.length;o++)if(this.unescapeId(s[o])==n){s[o]=this.escapeId(i);break}}else s.push(this.escapeId(i));e.setAttribute(t,s.join(","))}return e},wFORMS.behaviors.dependent_list.instance.prototype.updateSelectors=function(e,t){for(var e=e?e.split(","):[],n=0;n<e.length;n++){var i=this.unescapeId(e[n]);t[i]&&(e[n]=this.escapeId(t[i]))}return e.join(",")},wFORMS.behaviors.dependent_list.instance.prototype.unescapeId=function(e){return e?e.replace(/^#/,"").replace(/\\\[/g,"[").replace(/\\\]/g,"]"):null},wFORMS.behaviors.dependent_list.instance.prototype.escapeId=function(e){return e?"#"+e.replace(/\[/g,"\\[").replace(/\]/g,"\\]"):null},wFORMS.behaviors.dependent_list.instance.prototype.isInSameScope=function(e,t){return wFORMS.behaviors.repeat.getRepeatedElement(e)===wFORMS.behaviors.repeat.getRepeatedElement(t)},wFORMS.behaviors.dependent_list.instance.prototype.onRepeatableDuplicated=function(e,t,r){function s(e,t){for(var n in t)if(t[n]==e)return n;return e}var o=wFORMS.helpers.getForm(e),l=this;if(0<(e=e.querySelectorAll("option[data-filter-dependent], select[data-filter-dependent], input[data-filter-dependent], option[data-filter-control], select[data-filter-control], input[data-filter-control]")).length){e.forEach(function(e){var t,n=e.id,i=s(n,r.master);n!=i&&((t=l.updateSelectors(e.getAttribute("data-filter-dependent"),r.master))&&o.querySelectorAll(t).forEach(function(e){l.updateReference(e,"data-filter-control",i,n,!0)}),(t=l.updateSelectors(e.getAttribute("data-filter-control"),r.master))&&o.querySelectorAll(t).forEach(function(e){l.updateReference(e,"data-filter-dependent",i,n,!0)}))});var n,e=t.querySelectorAll("option[data-filter-dependent], select[data-filter-dependent], input[data-filter-dependent], option[data-filter-control], select[data-filter-control], input[data-filter-control]"),u={};for(n in r.repeat){var i=s(n,r.master);u[i]=r.repeat[n]}e.forEach(function(n){var i=n.id,a=s(i,r.repeat),a=s(a,r.master),e=l.updateSelectors(n.getAttribute("data-filter-dependent"),u);e&&o.querySelectorAll(e).forEach(function(e){var t=l.isInSameScope(n,e);l.updateReference(e,"data-filter-control",a,i,t)}),(e=l.updateSelectors(n.getAttribute("data-filter-control"),r.repeat))&&o.querySelectorAll(e).forEach(function(e){var t=l.isInSameScope(n,e);l.updateReference(e,"data-filter-dependent",a,i,t)})})}},wFORMS.behaviors.dependent_list.instance.prototype.onRepeatableRemoved=function(e){},"undefined"==typeof wFORMS)throw new Error("wFORMS core not found. This behavior depends on the wFORMS core.");if(wFORMS.behaviors.prefill={instance:function(e){this.behavior=wFORMS.behaviors.prefill,this.target=e},skip:!1},wFORMS.behaviors.prefill.applyTo=function(e){if(!wFORMS.behaviors.prefill.skip){var t,n=new wFORMS.behaviors.prefill.instance(e),i=wFORMS.getBehaviorInstance(e,"switch"),a=wFORMS.getBehaviorInstance(e,"calculation"),r=n.getParameters();for(t in r)try{var s=e.elements[t];if(s)n.populateField(s,r[t],i,a);else for(var o=document.getElementById(t).getElementsByTagName("input"),l=0;l<o.length;l++)"checkbox"==o[l].getAttribute("type")&&n.populateField(o[l],r[t],i,a)}catch(e){}return n.onApply(),n}},wFORMS.behaviors.prefill.instance.prototype.onApply=function(){},wFORMS.behaviors.prefill.instance.prototype.populateField=function(e,t,n,i){if(e)if(e.tagName){if(("INPUT"!=e.tagName||"text"!=e.type&&"hidden"
1!=e.type&&"password"!=e.type)&&"TEXTAREA"!=e.tagName||(e.value=t,e.dispatchEvent(new CustomEvent("blur"))),"INPUT"==e.tagName&&"checkbox"==e.type)if("1"==t||this.getLabel(e)==t||e.id==t)e.checked=!0,e.dispatchEvent(new CustomEvent("click"));else for(var a=t.split(";"),r=0;r<a.length;r++)"1"!=(o=a[r].replace(/^\s\s*/,"").replace(/\s\s*$/,""))&&this.getLabel(e)!=o&&e.id!=o||(e.checked=!0,e.dispatchEvent(new CustomEvent("click")));if("SELECT"==e.tagName&&!e.multiple)for(var s=0;s<e.options.length;s++)e.options[s].value!=t&&e.options[s].text!=t||(e.options[s].selected=!0,e.dispatchEvent(new CustomEvent("change")));if("SELECT"==e.tagName&&e.multiple){for(a=t.split(";"),s=0;s<e.options.length;s++)if(e.options[s].value==t||e.options[s].text==t)e.options[s].selected=!0;else for(r=0;r<a.length;r++){var o=a[r].replace(/^\s\s*/,"").replace(/\s\s*$/,"");e.options[s].value!=o&&e.options[s].text!=o||(e.options[s].selected=!0)}e.dispatchEvent(new CustomEvent("change"))}n&&n.run(null,e),i&&i.run(null,e)}else for(r=0;r<e.length;r++)if(e[r].value==t||this.getLabel(e[r])==t){e[r].checked=!0,e[r].dispatchEvent(new CustomEvent("click")),n&&n.run(null,e[r]),i&&i.run(null,e[r]);break}},wFORMS.behaviors.prefill.instance.prototype.getLabel=function(e){if(!e||!e.form)return null;if(!e.form.querySelectorAll)return null;var t=e.getAttribute("id");return l=e.form.querySelectorAll("label[for="+t+"]"),l&&1<=l.length?l.item(0).innerHTML:null},wFORMS.behaviors.prefill.instance.prototype.getParameters=function(){var e,t,n=Array();if(0!=(e=1==arguments.length?arguments[0]:document.location.search).length){t=(e.split("?")[1]?e.split("?")[1]:e).split("&");for(var i=0;i<t.length;i++)n[t[i].split("=")[0]]=decodeURIComponent(t[i].split("=")[1].replace(/\+/g," "));return n}},wFORMS.behaviors.responseCaching={DEFAULT_OPTOUT:!0,OVERWRITE_VALUES:!1,instance:function(e){this.behavior=wFORMS.behaviors.responseCaching,this.target=e,this.run()},MESSAGES:{DIALOG_TITLE:"Remember these answers for next time?",DIALOG_INFO:'<p><strong>Fill out forms faster by saving these answers in your browser.</strong> Saved answers will be filled out automatically by your browser. <br><br>Choose âDonât Remember" if you are on a public computer.\n\nYou can also clear saved answers at any time by clearing your browser cache.</p>',CONFIRM_CACHE:"Remember",CANCEL_CACHE:"Don't Remember",DO_NOT_ASK_AGAIN:"Donât ask again"},applyTo:function(e){return new wFORMS.behaviors.responseCaching.instance(e)}},wFORMS.behaviors.responseCaching.instance.prototype.run=function(){this.restoreCachedData();var n=this,i=wFORMS.behaviors.validation.onPass,a=wFORMS.getBehaviorInstance(this.target,"paging");wFORMS.behaviors.validation.onPass=function(e,t){if("function"==typeof i&&i(e,t),!a||wFORMS.behaviors.paging.isLastPageIndex(a.currentPageIndex))return n.onSubmit(t)}},wFORMS.behaviors.responseCaching.instance.prototype.restoreCachedData=function(){for(var e=this.getCachedData(),t=this.getAllCacheEnabledFields(),n=0;n<t.length;n++){var i=t[n],a=this.getCacheKey(i);if(e.hasOwnProperty(a)){for(var r,s,o=!1,l=e[a].v,u=0;u<l.length;u++)switch(i.type){case"select-one":if(!i.value||wFORMS.behaviors.responseCaching.OVERWRITE_VALUES)for(var h=i.querySelectorAll("option"),c=0;c<h.length;c++)h.item(c).text!=l[u]||h.item(c).disabled||h.item(c).selected||(i.value=h.item(c).value,o=!0);break;case"select-multiple":if(this.noChoiceSelected(i)||wFORMS.behaviors.responseCaching.OVERWRITE_VALUES)for(h=i.querySelectorAll("option"),c=0;c<h.length;c++)h.item(c).text==l[u]&&(h.item(c).selected||(o=h.item(c).selected=!0));break;case"checkbox":case"radio":this.getLabelsAssociatedWithField(i).join("|")===l[u]&&(this.noChoiceSelected(i)||wFORMS.behaviors.responseCaching.OVERWRITE_VALUES)&&(o=i.checked=!0);break;default:i.value&&!wFORMS.behaviors.responseCaching.OVERWRITE_VALUES||(i.value=l[u],o=!0)}o&&(r=wFORMS.getBehaviorInstance(this.target,"condition"),s=wFORMS.getBehaviorInstance(this.target,"calculation"),a=wFORMS.getBehaviorInstance(this.target,"dependent_list"),s.run(null,i),r.refresh(i),a.run(null,i))}}}
1,wFORMS.behaviors.responseCaching.instance.prototype.onSubmit=function(e){try{var t,n,i=this.getCacheDataToAlwaysSave();this.isCacheDataEmpty(i)||this.saveCacheData(i),i=this.getCacheDataToApprove(),this.isCacheDataEmpty(i)||(t=function(e){this.saveCacheData(e),this.target.submit()}.bind(this),n=function(e){this.saveCacheData(e),this.target.submit()}.bind(this),this.showRememberDialog(i,t,n),e&&e.preventDefault())}catch(e){console.warn("Failed to handle response cache",e)}},wFORMS.behaviors.responseCaching.instance.prototype.getCachedData=function(){return JSON.parse(localStorage.getItem("tfa-cache")||"{}")},wFORMS.behaviors.responseCaching.instance.prototype.saveCacheData=function(e){void 0!==e&&(e=this.mergeCacheData(e),localStorage.setItem("tfa-cache",JSON.stringify(e)))},wFORMS.behaviors.responseCaching.instance.prototype.clearCacheData=function(){localStorage.removeItem("tfa-cache")},wFORMS.behaviors.responseCaching.instance.prototype.getCacheEnabledFields=function(){for(var e=[],t=this.target.querySelectorAll("*[data-tfa-cache-key]"),n=0;n<t.length;n++)this.isFieldConditionallyHidden(t.item(n))||e.push(t.item(n));return e},wFORMS.behaviors.responseCaching.instance.prototype.getAllCacheEnabledFields=function(){for(var e=[],t=this.target.querySelectorAll("*[data-tfa-cache-key]"),n=0;n<t.length;n++)e.push(t.item(n));return e},wFORMS.behaviors.responseCaching.instance.prototype.isFieldConditionallyHidden=function(e){if(e.disabled){e=e.getBoundingClientRect();if(0===e.height&&0===e.width)return!0}return!1},wFORMS.behaviors.responseCaching.instance.prototype.getCacheKey=function(e){return e.getAttribute("data-tfa-cache-key")},wFORMS.behaviors.responseCaching.instance.prototype.getCacheValuesFromField=function(e){var t=[];switch(e.type){case"select-one":case"select-multiple":for(var n=e.querySelectorAll("option:checked"),i=0;i<n.length;i++)n.item(i).value&&t.push(n.item(i).text.trim());break;case"radio":case"checkbox":e.checked&&(t=[(t=this.getLabelsAssociatedWithField(e)).join("|")]);break;default:t.push(e.value.trim())}return t},wFORMS.behaviors.responseCaching.instance.prototype.getLabelsAssociatedWithKey=function(e){e=this.target.querySelector("[data-tfa-cache-key="+e+"]");return this.getLabelsAssociatedWithField(e)},wFORMS.behaviors.responseCaching.instance.prototype.getLabelsAssociatedWithField=function(e){if(e){var t=this;if(e.hasAttribute("aria-labelledby"))return e.getAttribute("aria-labelledby").split(" ").map(function(e){e=t.target.querySelector("#"+e);return e?e.innerText.trim():"No Label"});e=e.id+"-L",e=this.target.querySelector("#"+e);if(e)return[e.innerText.trim()]}return["No Label"]},wFORMS.behaviors.responseCaching.instance.prototype.getQuestionAssociatedWithKey=function(e){e=this.target.querySelector("[data-tfa-cache-key="+e+"]");return this.getQuestionAssociatedWithField(e)},wFORMS.behaviors.responseCaching.instance.prototype.getQuestionAssociatedWithField=function(e){if(e){var t="",t=e.hasAttribute("data-tfa-labelledby")?e.getAttribute("data-tfa-labelledby").split(" ")[0]:e.id+"-L",t=this.target.querySelector("#"+t);if(t)return[t.innerText.trim()]}return["No Label"]},wFORMS.behaviors.responseCaching.instance.prototype.getDataFromCacheEnabledFields=function(){var e=this.getCacheEnabledFields(),n=this,i={};return e.map(function(e){var t=n.getCacheKey(e),e=n.getCacheValuesFromField(e);i.hasOwnProperty(t)?i[t]={v:i[t].v.concat(e),m:"ask"}:i[t]={v:e,m:"ask"}}),i},wFORMS.behaviors.responseCaching.instance.prototype.filterCacheData=function(e,t){var n,i={};for(n in t)e.hasOwnProperty(n)?"ask"===e[n].m&&e[n].v.join()!==t[n].v.join()&&(i[n]=t[n]):""!==t[n].v.join()&&(i[n]=t[n]);return i},wFORMS.behaviors.responseCaching.instance.prototype.getCacheDataToApprove=function(){var e=this.getDataFromCacheEnabledFields(),t=this.getCachedData();return this.filterCacheData(t,e)},wFORMS.behaviors.responseCaching.instance.prototype.getCacheDataToAlwaysSave=function(){var e,t=this.getDataFromCacheEnabledFields(),n=this.getCachedData(),i={};for(e in t)n.hasOwnProperty(e)&&"always"===n[e].m&&n[e].v.join()!==t[e].v.join()&&(i[e]={v:t[e].v,m:"always"});return i}
1,wFORMS.behaviors.responseCaching.instance.prototype.mergeCacheData=function(e){var t=this.getCachedData();for(key in e)e.hasOwnProperty(key)&&(t[key]=e[key]);return t},wFORMS.behaviors.responseCaching.instance.prototype.isCacheDataEmpty=function(e){for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!1;return!0},wFORMS.behaviors.responseCaching.instance.prototype.noChoiceSelected=function(e){switch(e.type){case"select-multiple":return e.__tfa_PrefillAlreadyChecked||(e.__tfa_PrefillAlreadyChecked=!e.value),e.__tfa_PrefillAlreadyChecked;case"radio":return!this.target.querySelector('input[name="'+e.name+'"]:checked');case"checkbox":for(var t=e.parentNode;t&&!t.classList.contains("choices");)t=t.parentNode;if(t)return t.__tfa_PrefillAlreadyChecked||(t.__tfa_PrefillAlreadyChecked=!t.querySelector("input:checked")),t.__tfa_PrefillAlreadyChecked}},wFORMS.behaviors.responseCaching.instance.prototype.showRememberDialog=function(r,s,n){this.dialog&&this.closeRememberDialog();var e=function(){var e="ask";this.dialog.querySelector("#do-not-ask-again").checked&&(e="always");for(var t,n=this.dialog.querySelectorAll("input:checked"),i={},a=0;a<n.length;a++)i[n.item(a).value]=!0;for(t in r)i.hasOwnProperty(t)?r[t].m=e:r[t]={v:[""],m:"ask"==e?"ask":"never"};this.closeRememberDialog(),s(r)}.bind(this),t=function(){var e,t="ask";for(e in this.dialog.querySelector("#do-not-ask-again").checked&&(t="never"),r)r[e]={v:[""],m:t};this.closeRememberDialog(),n(r)}.bind(this);return this.dialog=this.createRememberDialog(r,e,t),document.body.appendChild(this.dialog),this.dialog},wFORMS.behaviors.responseCaching.instance.prototype.closeRememberDialog=function(){this.dialog.parentNode.removeChild(this.dialog),this.dialog=null},wFORMS.behaviors.responseCaching.instance.prototype.createRememberDialog=function(e,t,n){var i=this.createRememberDialogBox(),a=i.querySelector(".content");a.appendChild(this.createRememberDialogTitle());a=a.appendChild(this.createRememberDialogForm());return a.appendChild(this.createRememberDialogInfo()),a.appendChild(this.createRememberDialogFieldList(e)),a.appendChild(this.createRememberDialogButtons(t,n)),i},wFORMS.behaviors.responseCaching.instance.prototype.createRememberDialogBox=function(){var e=document.createElement("div");e.classList.add("wFormOverlay");var t=document.createElement("div");t.id="save-to-cache-dialog",t.classList.add("wFormContainer");var n=document.createElement("div");return n.classList.add("content","wForm"),t.appendChild(n),e.appendChild(t),e},wFORMS.behaviors.responseCaching.instance.prototype.createRememberDialogTitle=function(){var e=document.createElement("H3");return e.innerHTML=this.behavior.MESSAGES.DIALOG_TITLE,e.classList.add("wFormTitle"),e},wFORMS.behaviors.responseCaching.instance.prototype.createRememberDialogForm=function(){var e=document.createElement("form");return e.setAttribute("action","javascript:void(0);"),e},wFORMS.behaviors.responseCaching.instance.prototype.createRememberDialogInfo=function(){var e=document.createElement("div");e.innerHTML=this.behavior.MESSAGES.DIALOG_INFO,e.classList.add("htmlContent");var t=document.createElement("div");return(t=t.appendChild(e)).classList.add("htmlSection"),t},wFORMS.behaviors.responseCaching.instance.prototype.createRememberDialogFieldList=function(e){var t=document.createElement("div");t.classList.add("oneField");var n=document.createElement("div");n.classList.add("inputWrapper"),t.appendChild(n);var i=document.createElement("div");i.classList.add("choices","vertical"),n.appendChild(i);for(var a=this.getCacheEnabledFields(),r=JSON.parse(JSON.stringify(e)),s=0;s<a.length;s++){var o,l=this.getCacheKey(a[s]);r.hasOwnProperty(l)&&(o=this.createRememberDialogFieldListItem(l,r[l]),o=i.appendChild(o),delete r[l])}return t},wFORMS.behaviors.responseCaching.instance.prototype.createRememberDialogFieldListItem=function(e,t){var n=document.createElement("div");n.classList.add("oneChoice");var i=document.createElement("input");i.type="checkbox",i.value=e,i.checked=wFORMS.behaviors.responseCaching.DEFAULT_OPTOUT,i.id=e,n.appendChild(i);var a=document.createElement("label");a.classList.add("label","postField"),a.setAttribute("for",i.id),v=[];for(var r=0;r<t.v.length;r++)v.push(t.v[r].split("|").pop());return v=v.join(", "),a.innerHTML=this.getQuestionAssociatedWithKey(e)+" : "+v,n.appendChild(a),n}
1,wFORMS.behaviors.responseCaching.instance.prototype.createRememberDialogDoNotAskAgain=function(){var e=document.createElement("div");e.classList.add("oneField","doNotAskAgain");var t=document.createElement("div");t.classList.add("inputWrapper"),e.appendChild(t);var n=document.createElement("div");n.classList.add("choices","vertical"),t.appendChild(n);var i=document.createElement("div");i.classList.add("oneChoice"),n.appendChild(i);t=document.createElement("input");t.type="checkbox",t.checked=!1,t.id="do-not-ask-again",i.appendChild(t);n=document.createElement("label");return n.classList.add("label","postField"),n.setAttribute("for",t.id),n.innerHTML=this.behavior.MESSAGES.DO_NOT_ASK_AGAIN,i.appendChild(n),e},wFORMS.behaviors.responseCaching.instance.prototype.createRememberDialogButtons=function(e,t){var n=document.createElement("div");n.classList.add("actions");var i=document.createElement("button");i.classList.add("primaryAction"),i.id="do-cache",i.innerHTML=this.behavior.MESSAGES.CONFIRM_CACHE,i.addEventListener("click",e),n.appendChild(i);i=document.createElement("button");return i.classList.add("secondaryAction"),i.id="do-not-cache",i.innerHTML=this.behavior.MESSAGES.CANCEL_CACHE,i.addEventListener("click",t),n.appendChild(i),n.appendChild(this.createRememberDialogDoNotAskAgain()),n},"undefined"==typeof wFORMS)throw new Error("wFORMS core not found. This behavior depends on the wFORMS core.");wFORMS.behaviors.responsive={skip:!1,instance:function(e){this.behavior=wFORMS.behaviors.responsive,this.target=e;this.run()}},wFORMS.behaviors.responsive.applyTo=function(e){return wFORMS.behaviors.responsive.skip?null:new wFORMS.behaviors.responsive.instance(e)},wFORMS.behaviors.responsive.instance.prototype.run=function(){this.handleAllMatrixLayouts(),this.handleAllGridLayouts()},wFORMS.behaviors.responsive.instance.prototype.handleAllMatrixLayouts=function(){for(var e=this.target.clientWidth,t=this.target.querySelectorAll("table.matrixLayout"),n=!1,i=0;i<t.length;i++)n=this.handleMatrixLayout(t.item(i),e)||n;return n},wFORMS.behaviors.responsive.instance.prototype.handleMatrixLayout=function(e,t){var n=!1;if(e.clientWidth&&e.clientWidth>t){-1<(""+e.className).search("stacked")||(e.className=e.className+" stacked");var i=e.querySelectorAll("input");if(!(-1<(""+e.className).search("isStackedAndLabeled"))){for(var a=0;a<i.length;a++){var r=this.createLabel(i.item(a).getAttribute("title"),i.item(a).id,"postField");i.item(a).parentNode.insertBefore(r,i.item(a).nextSibling),n=!0}e.className=e.className+" isStackedAndLabeled"}}return n},wFORMS.behaviors.responsive.instance.prototype.handleAllGridLayouts=function(){for(var e=this.target.clientWidth,t=this.target.querySelectorAll("table.gridLayout"),n=!1,i=0;i<t.length;i++)n=this.handleGridLayout(t.item(i),e)||n;return n},wFORMS.behaviors.responsive.instance.prototype.handleGridLayout=function(e,t){var n=!1,t=e.clientWidth&&e.clientWidth>t;if(t&&(-1<(""+e.className).search("stacked")||(e.className=e.className+" stacked"),!(-1<(""+e.className).search("isStackedAndLabeled")))){for(var i=e.querySelectorAll("input[type=text],input[type=password],input[type=file],textarea,select"),a=0;a<i.length;a++){var r=this.createLabel(i.item(a).getAttribute("title"),i.item(a).id,"preField");i.item(a).parentNode.insertBefore(r,i.item(a)),n=!0}e.className=e.className+" isStackedAndLabeled"}return n},wFORMS.behaviors.responsive.instance.prototype.createLabel=function(e,t,n){var i=document.createElement("label");return i.innerHTML=e,i.setAttribute("for",t),i.className=n,i},wFORMS.behaviors.autosuggest={MESSAGES:{NO_RESULTS:"No matches",SHOWING_OF:"Showing %1 of %2.",CONTINUE_TYPING:"Continue typing to narrow your options."},DISPLAY_KEY:"a",SUGGESTIONS_LIMIT:100,SELECTOR:'input[type="text"].wfAutosuggest',instance:function(e){this.behavior=wFORMS.behaviors.autosuggest,this.target=e,this.setupAutosuggest()},applyTo:function(e){if("undefined"!=typeof FA$){FA$.support.cors=!0;var n=new Array;return e.querySelectorAll(wFORMS.behaviors.autosuggest.SELECTOR).forEach(function(e){e=new wFORMS.behaviors.autosuggest.instance(e);n.push(e),e.onApply()}),wFORMS.behaviors.repeat.observeRepeatStart(function(e){e.querySelectorAll(wFORMS.behaviors.autosuggest.SELECTOR).not(".tt-hint").forEach(function(e){FA$(e).typeahead("destroy")})}),wFORMS.behaviors.repeat.observeRepeatComplete(function(e,t){e.querySelectorAll(wFORMS.behaviors.autosuggest.SELECTOR).forEac
1h(function(e){e=new wFORMS.behaviors.autosuggest.instance(e);n.push(e),e.onApply()})}),n}},onSuggestedListChanged:function(e,t){return this}},wFORMS.behaviors.autosuggest.bloodhoundTokenizer=function(e){if(e=null==e?"":e+"",!(e=FA$.trim(e)))return[];var t="!$()\\[\\]<>?,.",n=new RegExp("^["+t+"]+|["+t+"]+$","g");return FA$.map(e.split(/\s+/),function(e){return e.replace(n,"")})},wFORMS.behaviors.autosuggest.instance.prototype.showOrHideClearIcon=function(e){if(e&&"keyup"===e.type){const t=[37,38,39,40];if(t.includes(e.which))return}e=FA$(this.target).closest(".inputWrapper").find(".tt-clear");""===FA$(this.target).val()?e.hasClass("no-input")||e.addClass("no-input"):e.hasClass("no-input")&&e.removeClass("no-input")},wFORMS.behaviors.autosuggest.instance.prototype.hideClearIcon=function(){var e=FA$(this.target).closest(".inputWrapper").find(".tt-clear");e&&!e.hasClass("no-input")&&e.addClass("no-input")},wFORMS.behaviors.autosuggest.instance.prototype.resetAutosuggest=function(){FA$(this.target).off("typeahead:asynccancel typeahead:asyncreceive typeahead:asyncrequest typeahead:change typeahead:select typeahead:autocompleted blur keyup"),FA$(this.target).closest(".inputWrapper").find(".tt-clear").off("click"),FA$(this.target).closest(".inputWrapper").find(".tt-search").off("click"),this.unbindParameterFields(),this.engine.clear(),FA$(this.target).typeahead("destroy"),this.setupAutosuggest()},wFORMS.behaviors.autosuggest.instance.prototype.getParameterNames=function(){var e=this.target.getAttribute("data-dataset-parameters");if(!e)return[];var t=e.split(" "),e=this.target.id;if(!e)return t;e=e.match(/(\[\d+\])+$/);if(e){var n=e[0];return t.map(function(e){return!e.includes("[")&&document.querySelector('[id^="'+e+'["]')?e+n:e})}return t},wFORMS.behaviors.autosuggest.instance.prototype.bindParameterFields=function(){for(var e=0;e<this.queryParameters.length;e++){var t=document.querySelector('[name="'+this.queryParameters[e]+'"]');t&&FA$(t).change(this.resetAutosuggest)}},wFORMS.behaviors.autosuggest.instance.prototype.unbindParameterFields=function(){for(var e=0;e<this.queryParameters.length;e++){var t=document.querySelector('[name="'+this.queryParameters[e]+'"]');t&&FA$(t).off("change",this.resetAutosuggest)}},wFORMS.behaviors.autosuggest.instance.prototype.clearTypeaheadValue=function(e){if(e&&"keydown"===e.type){const t=[8,13,27,32,46];if(!t.includes(e.which))return}FA$(this.target).val(""),FA$(this.target).typeahead("val",""),FA$(this.target).closest(".inputWrapper").find(".tt-clear").addClass("no-input"),this.triggerFieldChangedUpdates(this.target),this.clearFieldMap()},wFORMS.behaviors.autosuggest.instance.prototype.focusTypeaheadField=function(){FA$(this.target).focus()},wFORMS.behaviors.autosuggest.instance.prototype.showSpinner=function(){FA$(this.target).closest(".inputWrapper").find(".tt-spinner").show()},wFORMS.behaviors.autosuggest.instance.prototype.hideSpinner=function(){FA$(this.target).closest(".inputWrapper").find(".tt-spinner").hide()},wFORMS.behaviors.autosuggest.instance.prototype.setIdSuffixIfRepeatedField=function(){var e=this.target.id.match(/(\[\d+\])+$/)||"";this.repeatSuffix=e?e[0].replace(/\[/g,"\\[").replace(/\]/g,"\\]"):""},wFORMS.behaviors.autosuggest.instance.prototype.getFieldMap=function(){var e=this.target.getAttribute("data-dataset-map");if(!e)return[];for(var t=[],n=(e=-1===e.indexOf("=")?"b="+e:e).split(","),i=0;i<n.length;i++)-1!==n[i].indexOf("=")&&t.push(n[i].split("="));return t},wFORMS.behaviors.autosuggest.instance.prototype.setFieldMap=function(e,t){var n,i=this.getFieldMap();this.setIdSuffixIfRepeatedField();for(var a=0;a<i.length;a++){n=document.getElementById(i[a][1]+this.repeatSuffix.replace(/\\/g,"")),(r=t[i[a][0]])&&FA$(n).val(r).trigger("change"),this.triggerFieldChangedUpdates(n);var r=new CustomEvent("blur");n.dispatchEvent(r)}},wFORMS.behaviors.autosuggest.instance.prototype.clearFieldMap=function(){var e=this.getFieldMap();if(!FA$(this.target).typeahead("val"))for(var t=0;t<e.length;t++){var n=document.getElementById(e[t][1]+this.repeatSuffix.replace(/\\/g,""));FA$(n).val("").trigger("change"),this.triggerFieldChangedUpdates(n);var i=new CustomEvent("blur");n.dispatchEvent(i)}},wFORMS.behaviors.autosuggest.instance.prototype.triggerFieldChangedUpdates=function(e){wFORMS.getBehaviorInstance(wFORMS.helpers.getForm(e),"calculation").run(null,e)},wFORMS.behaviors.autosuggest.instance.prototype.handleExactMatch=function(e){for(var t=FA$(this.target).val(),n=0;e&&n<e.length;n++){var i,a,r=!1;r=!this.target.hasAttribute("data-selected-json")||(i=JSON.parse(this.target.getAttribute("data-selected-json")),a=e[n],wFORMS.helpers.objectDeepEqual(i,a)),(t===e[n][wFORMS.behaviors.autosuggest.DISPLAY_KEY]&&r||t===e[n].b&&r||t&&this.engine.get(t)[0]&&null!=this.engine.get(t)[0].fa_ta_uid&&this.engine.get(t)[0].fa_ta_uid===e[n].fa_ta_uid)&&(r=e[n][wFORMS.behaviors.autosuggest.DISPLAY_KEY],this.target.setAttribute("data-selected",r),this.target.setAttribute("data-selected-json",JSON.stringify(e[n])),FA$(this.target).data("ttTypeahead").input.setQuery(r,!0),this.hideSpinner(),this.setFieldMap(null,e[n]))}},wFORMS.behaviors.autosuggest.instance.prototype.handleSalesforceDependencyChanges=function(){var t=this,n=FA$(this.target);if(n.data("dataset-parameters"))try{n.data("dataset-parameters").split(",").map(function(e){if(e.includes("["))return e!==n.attr("id")&&FA$("#"+e.replace("[","\\[").replace("]","\\]"));var t=FA$("#"+e);if(0<t.length&&e!==n.attr("id"))return t;t=n.attr("id").match(/(\[\d+\])+$/);if(t){e=e+t[0],t=FA$("#"+e.replace(/\[/g,"\\[").replace(/\]/g,"\\]"));if(0<t.length&&e!==n.attr("id"))return t}return null}
1).filter(Boolean).forEach(function(e){e.on("typeahead:change typeahead:autocomplete typeahead:select change",function(){t.showSpinner(),t.engine.search("",null,function(e){e[0]&&n.typeahead("val",e[0].a),t.clearTypeaheadValue(),t.engine.clear(),t.hideSpinner()})})})}catch(e){console.error("There was a problem handling salesforce picklist dependencies for field "+n.attr("name"),e)}},wFORMS.behaviors.autosuggest.instance.prototype.setupAutosuggest=function(){this.resetAutosuggest=this.resetAutosuggest.bind(this),this.clearTypeaheadValue=this.clearTypeaheadValue.bind(this),this.focusTypeaheadField=this.focusTypeaheadField.bind(this),this.showSpinner=this.showSpinner.bind(this),this.hideSpinner=this.hideSpinner.bind(this),this.setFieldMap=this.setFieldMap.bind(this),this.clearFieldMap=this.clearFieldMap.bind(this),this.handleExactMatch=this.handleExactMatch.bind(this),this.datasetType=this.target.getAttribute("data-dataset-type"),this.setIdSuffixIfRepeatedField(),this.matchingSetSize=null;var e=this.target.getAttribute("data-dataset-url"),t=this.target.getAttribute("data-dataset-id"),n=this.target.getAttribute("data-dataset-action"),i=this.target.getAttribute("data-dataset-json"),a=(this.target.getAttribute("data-dataset-timestamp"),null!==this.target.getAttribute("data-dataset-allow-free-responses")?this.target.getAttribute("data-dataset-allow-free-responses"):1),r=null,s=[],o=e,l=this;this.googleSessionToken={token:window.crypto.randomUUID(),expiration:(new Date).setMinutes((new Date).getMinutes()+3)},this.queryParameters=this.getParameterNames(),this.bindParameterFields(),"csv"===this.datasetType?o=o+"/"+n+"?uuid="+t+"&format=withTotal&query=%QUERY%":(o=o+"/"+t+"?query=%QUERY%","address-autocomplete"===this.datasetType&&(o+="&gst=%GOOGLESESSIONTOKEN%"),"salesforce-picklist"===this.datasetType&&(this.datasetType="salesforce",o=o+"&"+this.queryParameters.map(function(e){return e+"=%%"+e+"%%"}).join("&")));const u=this;t&&e?r={url:o,maxPendingRequests:100,prepare:function(e,n){e=FA$.trim(e),(new Date).getTime()>u.googleSessionToken.expiration&&(u.googleSessionToken={token:window.crypto.randomUUID(),expiration:(new Date).setMinutes((new Date).getMinutes()+3)}),n.url=n.url.replace("%QUERY%",encodeURIComponent(e)).replace("%GOOGLESESSIONTOKEN%",u.googleSessionToken.token);for(var t=[],i=/%%([^%]*)%%/g,a=i.exec(n.url);null!=a;)t.push(a[1]),a=i.exec(n.url);return t.map(function(e){var t=document.querySelector('[name="'+e+'"]');t&&(n.url=n.url.replace("%%"+e+"%%",encodeURIComponent(t.value)))}),n},transform:function(e){return l.datasetType,l.matchingSetSize=e.total,e.results||[]}}:i&&(s=JSON.parse(i),l.matchingSetSize=s.length);s={identify:function(e){return e.a},queryTokenizer:wFORMS.behaviors.autosuggest.bloodhoundTokenizer,datumTokenizer:function(e){return wFORMS.behaviors.autosuggest.bloodhoundTokenizer(e.a)},indexRemote:!0,remote:r,local:s};function h(e,t){let n=FA$(e).closest(".inputWrapper").find('[role="status"][aria-live="polite"]');0<n.length&&n.text(`${t} result${1!==t?"s are":" is"} available, use up and down arrow keys to navigate.`)}this.engine=new Bloodhound(s);const c=FA$.fn.typeahead;FA$.fn.typeahead=function(){var e=c.apply(this,arguments);const i="destroy"===arguments[0];return this.each(function(){const t=FA$(this);if(i){const n=t[0].attributes;for(let e=0;e<n.length;e++)n[e].name.startsWith("aria-")&&t.removeAttr(n[e].name)}else{var e=t.attr("aria-owns");e&&(t.attr("aria-controls",e),t.nextAll(".tt-menu").attr("id",e))}}),e},FA$(this.target).typeahead({minLength:0,hint:!0,highlight:!0},{source:function(e,t,n){if(e=null==e?"":FA$.trim(e+""),null===l.matchingSetSize){var i=0;for(k in l.engine.index.datums)l.engine.index.datums.hasOwnProperty(k)&&i++;l.matchingSetSize=i}var a=""===e&&!r;a?(n([]),t(l.engine.index.all())):l.engine.search(e,function(e){l.onSuggestionUpdate&&l.onSuggestionUpdate(e,"sync"),l.matchingSetSize=e.length,t.apply(this,arguments),h(l.target,l.matchingSetSize)},function(){l.onSuggestionUpdate&&l.onSuggestionUpdate(arguments[0],"async"),n.apply(this,arguments),h(l.target,l.matchingSetSize)})},displayKey:wFORMS.behaviors.autosuggest.DISPLAY_KEY,limit:wFORMS.behaviors.autosuggest.SUGGESTIONS_LIMIT,templates:{empty:'<div class="tt-empty-message">'+wFORMS.behaviors.autosuggest.MESSAGES.NO_RESULTS+"</div>
1",footer:function(e){if(e.suggestions.length<l.matchingSetSize)return'<div class="tt-more-message">'+wFORMS.behaviors.autosuggest.MESSAGES.SHOWING_OF.replace("%1",e.suggestions.length).replace("%2",l.matchingSetSize)+" "+wFORMS.behaviors.autosuggest.MESSAGES.CONTINUE_TYPING+"</div>"}}}).on("typeahead:asyncrequest",this.showSpinner).on("typeahead:asynccancel typeahead:asyncreceive typeahead:close",this.hideSpinner),FA$(this.target).data("ttTypeahead")._onTabKeyed=()=>{},0===parseInt(a)&&FA$(this.target).on("typeahead:select typeahead:autocompleted",function(e,t){this.target.setAttribute("data-selected",t[wFORMS.behaviors.autosuggest.DISPLAY_KEY]),this.target.setAttribute("data-selected-json",JSON.stringify(t))}.bind(l)),FA$(this.target).on("typeahead:change",function(){this.clearFieldMap();var e=FA$(this.target).val();e!==this.target.getAttribute("data-selected")&&this.engine.search(e,this.handleExactMatch,this.handleExactMatch)}.bind(l));a=FA$(this.target).val();""!==a&&("address-autocomplete"===this.datasetType&&this.engine.add([{a:a}]),this.engine.search(a,this.handleExactMatch,this.handleExactMatch)),this.showOrHideClearIcon(),FA$(this.target).closest(".inputWrapper").find(".tt-search").on("click",this.focusTypeaheadField),FA$(this.target).closest(".inputWrapper").find(".tt-clear").on("click keydown",this.clearTypeaheadValue),FA$(this.target).on("keyup typeahead:change typeahead:select blur",this.showOrHideClearIcon.bind(l)),FA$(this.target).on("typeahead:autocomplete typeahead:select",function(e,t){var n=FA$(this.target).val(),n=this.engine.get(n)&&this.engine.get(n)[0]?this.engine.get(n)[0].fa_ta_uid:null;n?(this.engine.search("selected_id:"+n,this.handleExactMatch,this.handleExactMatch),this.googleSessionToken={token:window.crypto.randomUUID(),expiration:(new Date).setMinutes((new Date).getMinutes()+3)}):this.setFieldMap(e,t)}.bind(l)),"salesforce"===this.datasetType&&this.handleSalesforceDependencyChanges()},wFORMS.behaviors.autosuggest.instance.prototype.setValue=function(e){FA$(this.target).typeahead("val",e)},wFORMS.behaviors.autosuggest.instance.prototype.onApply=function(){},wFORMS.behaviors.repeat.observeRepeatComplete((e,t,n)=>{var i=n=>{for(const a in n){var e=n[a],i=e.match(/\[\d+\]/g).join(""),t=document.getElementById(e),e=t.getAttribute("data-dataset-parameters");e&&(e=(e=e.replace(/\[(\d+)\]/g,"")).split(" ").map(e=>{const t=Object.values(n);return t.includes(e+i)?e+i:e}).join(" "),t.setAttribute("data-dataset-parameters",e))}};i(n.master),i(n.repeat)});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.