window.kentico=window.kentico||{};window.kentico._forms=window.kentico._forms||{};window.kentico._forms.formFileUploaderComponent=function(n){function i(n){var i,t,r;for(n.fileUploaderDisabledElements=[],i=n.elements,t=0;t<i.length;t++)r=i[t],r.disabled||(n.fileUploaderDisabledElements.push(t),r.disabled=!0)}function t(n){n.fileUploaderDisabledElements.forEach(function(t){n.elements[t].disabled=!1})}function r(n,t,i,r,u,f,e){n.value=null;n.removeAttribute("hidden");t.setAttribute("hidden","hidden");i.innerText=i.originalText;r.value="";u.value="";f.setAttribute("hidden","hidden");e.setAttribute("data-icon","select");e.removeAttribute("title")}function u(u){var f=n.getElementById(u.fileInputId),s=n.getElementById(u.fileInputId+"-placeholder"),c=n.getElementById(u.fileInputId+"-replacement"),e=n.getElementById(u.fileInputId+"-button"),o=n.getElementById(u.fileInputId+"-icon"),h=n.getElementById(u.tempFileIdentifierInputId),l=n.getElementById(u.tempFileOriginalNameInputId),v=n.getElementById(u.systemFileNameInputId),y=n.getElementById(u.originalFileNameInputId),a=n.getElementById(u.deletePersistentFileInputId),p=u.deleteFileIconButtonTitle;s.originalText=s.innerText;e.originalText=e.innerText;(l.value||y.value&&a.value.toUpperCase()==="FALSE")&&(s.innerText=l.value||u.originalFileNamePlain,e.removeAttribute("hidden"),o.setAttribute("data-icon","remove"),o.setAttribute("title",p),c.removeAttribute("hidden"),f.setAttribute("hidden","hidden"));var w=function(){if(h.value){var n=new XMLHttpRequest;n.open("POST",u.deleteEndpoint+"&tempFileIdentifier="+h.value);n.send()}},b=function(){v.value&&(a.value=!0);w();r(f,c,s,h,l,e,o)},k=function(n){o.getAttribute("data-icon")==="remove"&&(n.preventDefault(),b())};e.addEventListener("click",b);o.addEventListener("click",k);f.addEventListener("change",function(){var r,b,n;if(f.value){if(e.removeAttribute("hidden"),o.setAttribute("data-icon","loading"),i(f.form),r=f.files[0],r!==undefined&&r.size>u.maxFileSize*1024){f.value=null;h.value="";y="";window.alert(u.maxFileSizeExceededErrorMessage);t(f.form);o.setAttribute("data-icon","select");return}b=new FormData;n=new XMLHttpRequest;n.contentType="multipart/form-data";b.append("file",r);n.addEventListener("load",function(){var i,r;n.readyState===4&&(n.status===200?(i=n.response,typeof i=="string"&&(i=JSON.parse(i)),i.errorMessage?(f.value=null,alert(i.errorMessage),o.setAttribute("data-icon","select"),e.setAttribute("hidden","hidden")):(v.value&&(a.value=!0),w(),r=f.files[0].name,h.value=i.fileIdentifier,l.value=r,s.innerText=r,e.removeAttribute("hidden"),o.setAttribute("data-icon","remove"),o.setAttribute("title",p),c.innerText=r,c.removeAttribute("hidden"),f.setAttribute("hidden","hidden"))):(alert("Error sending file: "+n.statusText),o.setAttribute("data-icon","select"),e.setAttribute("hidden","hidden")),e.innerHTML=e.originalText,t(f.form))});n.upload.addEventListener("progress",function(n){e.innerText=parseInt(n.loaded/n.total*100)+"%"});n.open("POST",u.submitEndpoint);n.responseType="json";n.send(b)}})}return{attachScript:u}}(document),function(n){typeof define=="function"&&define.amd?define(["../global/window"],n):typeof exports=="object"?module.exports=n(require("../global/window")):window.dependencyLib=n(window)}(function(n){function f(n,t){for(var i=0,r=n.length;i<r;i++)if(n[i]===t)return i;return-1}function r(n){return n!=null&&n===n.window}function e(n){var t="length"in n&&n.length,i=typeof n;return i==="function"||r(n)?!1:n.nodeType===1&&t?!0:i==="array"||t===0||typeof t=="number"&&t>0&&t-1 in n}function u(n){return n instanceof Element}function t(r){if(r instanceof t)return r;if(!(this instanceof t))return new t(r);r!==undefined&&r!==null&&r!==n&&(this[0]=r.nodeName?r:r[0]!==undefined&&r[0].nodeName?r[0]:i.querySelector(r),this[0]!==undefined&&this[0]!==null&&(this[0].eventRegistry=this[0].eventRegistry||{}))}var i=n.document;return t.prototype={on:function(n,t){var f;if(u(this[0])){var i=this[0].eventRegistry,r=this[0],s=function(n,u){r.addEventListener?r.addEventListener(n,t,!1):r.attachEvent&&r.attachEvent("on"+n,t);i[n]=i[n]||{};i[n][u]=i[n][u]||[];i[n][u].push(t)},e=n.split(" ");for(f=0;f<e.length;f++){var o=e[f].split("."),h=o[0],c=o[1]||"global";s(h,c)}}return this},off:function(n,t){var o,s,f,r,c;if(u(this[0])){var i=this[0].eventRegistry,e=this[0],l=function(n,t,r){if(n in i==!0)if(e.removeEventListener?e.removeEventListener(n,r,!1):e.detachEvent&&e.detachEvent("on"+n,r),t==="global")for(var u in i[n])i[n][u].splice(i[n][u].indexOf(r),1);else i[n][t].splice(i[n][t].indexOf(r),1)},a=function(n,r){var o=[],u,s,f,e;if(n.length>0)if(t===undefined)for(u=0,s=i[n][r].length;u<s;u++)o.push({ev:n,namespace:r&&r.length>0?r:"global",handler:i[n][r][u]});else o.push({ev:n,namespace:r&&r.length>0?r:"global",handler:t});else if(r.length>0)for(f in i)for(e in i[f])if(e===r)if(t===undefined)for(u=0,s=i[f][e].length;u<s;u++)o.push({ev:f,namespace:e,handler:i[f][e][u]});else o.push({ev:f,namespace:e,handler:t});return o},h=n.split(" ");for(o=0;o<h.length;o++)for(s=h[o].split("."),f=a(s[0],s[1]),r=0,c=f.length;r<c;r++)l(f[r].ev,f[r].namespace,f[r].handler)}return this},trigger:function(n){var c,r,e,s,a;if(u(this[0])){var o=this[0].eventRegistry,h=this[0],v=typeof n=="string"?n.split(" "):[n.type];for(c=0;c<v.length;c++){var y=v[c].split("."),f=y[0],l=y[1]||"global";if(i!==undefined&&l==="global")if(s={bubbles:!0,cancelable:!0,detail:arguments[1]},i.createEvent){try{r=new CustomEvent(f,s)}catch(p){r=i.createEvent("CustomEvent");r.initCustomEvent(f,s.bubbles,s.cancelable,s.detail)}n.type&&t.extend(r,n);h.dispatchEvent(r)}else r=i.createEventObject(),r.eventType=f,r.detail=arguments[1],n.type&&t.extend(r,n),h.fireEvent("on"+r.eventType,r);else if(o[f]!==undefined)if(arguments[0]=arguments[0].type?arguments[0]:t.Event(arguments[0]),l==="global")for(a in o[f])for(e=0;e<o[f][a].length;e++)o[f][a][e].apply(h,arguments);else for(e=0;e<o[f][l].length;e++)o[f][l][e].apply(h,arguments)}}return this}},t.isFunction=function(n){return typeof n=="function"},t.noop=function(){},t.isArray=Array.isArray,t.inArray=function(n,t,i){return t==null?-1:f(t,n,i)},t.valHooks=undefined,t.isPlainObject=function(n){return typeof n!="object"||n.nodeType||r(n)?!1:n.constructor&&!Object.hasOwnProperty.call(n.constructor.prototype,"isPrototypeOf")?!1:!0},t.extend=function(){var e,f,r,i,o,s,n=arguments[0]||{},u=1,c=arguments.length,h=!1;for(typeof n=="boolean"&&(h=n,n=arguments[u]||{},u++),typeof n=="object"||t.isFunction(n)||(n={}),u===c&&(n=this,u--);u<c;u++)if((e=arguments[u])!=null)for(f in e)(r=n[f],i=e[f],n!==i)&&(h&&i&&(t.isPlainObject(i)||(o=t.isArray(i)))?(o?(o=!1,s=r&&t.isArray(r)?r:[]):s=r&&t.isPlainObject(r)?r:{},n[f]=t.extend(h,s,i)):i!==undefined&&(n[f]=i));return n},t.each=function(n,t){var r,i=0,u;if(e(n)){for(u=n.length;i<u;i++)if(r=t.call(n[i],i,n[i]),r===!1)break}else for(i in n)if(r=t.call(n[i],i,n[i]),r===!1)break;return n},t.data=function(n,t,i){if(i===undefined)return n.__data?n.__data[t]:null;n.__data=n.__data||{};n.__data[t]=i},typeof n.CustomEvent=="function"?t.Event=n.CustomEvent:(t.Event=function(n,t){t=t||{bubbles:!1,cancelable:!1,detail:undefined};var r=i.createEvent("CustomEvent");return r.initCustomEvent(n,t.bubbles,t.cancelable,t.detail),r},t.Event.prototype=n.Event.prototype),t}),function(n){typeof define=="function"&&define.amd?define(["./dependencyLibs/inputmask.dependencyLib","./global/window"],n):typeof exports=="object"?module.exports=n(require("./dependencyLibs/inputmask.dependencyLib"),require("./global/window")):window.Inputmask=n(window.dependencyLib||jQuery,window)}(function(n,t,i){function r(t,u,f){if(!(this instanceof r))return new r(t,u,f);this.el=i;this.events={};this.maskset=i;this.refreshValue=!1;f!==!0&&(n.isPlainObject(t)?u=t:(u=u||{},t&&(u.alias=t)),this.opts=n.extend(!0,{},this.defaults,u),this.noMasksCache=u&&u.definitions!==i,this.userOptions=u||{},this.isRTL=this.opts.numericInput,c(this.opts.alias,u,this.opts))}function c(t,u,f){var e=r.prototype.aliases[t];return e?(e.alias&&c(e.alias,i,f),n.extend(!0,f,e),n.extend(!0,f,u),!0):(f.mask===null&&(f.mask=t),!1)}function e(t,u){function o(t,f,e){var o=!1,c,s,h;return(t===null||t==="")&&(o=e.regex!==null,o?(t=e.regex,t=t.replace(/^(\^)(.*)(\$)$/,"$2")):(o=!0,t=".*")),t.length===1&&e.greedy===!1&&e.repeat!==0&&(e.placeholder=""),(e.repeat>0||e.repeat==="*"||e.repeat==="+")&&(c=e.repeat==="*"?0:e.repeat==="+"?1:e.repeat,t=e.groupmarker[0]+t+e.groupmarker[1]+e.quantifiermarker[0]+c+","+e.repeat+e.quantifiermarker[1]),h=o?"regex_"+e.regex:e.numericInput?t.split("").reverse().join(""):t,r.prototype.masksCache[h]===i||u===!0?(s={mask:t,maskToken:r.prototype.analyseMask(t,o,e),validPositions:{},_buffer:i,buffer:i,tests:{},excludes:{},metadata:f,maskLength:i,jitOffset:{}},u!==!0&&(r.prototype.masksCache[h]=s,s=n.extend(!0,{},r.prototype.masksCache[h]))):s=n.extend(!0,{},r.prototype.masksCache[h]),s}var e,f;if(n.isFunction(t.mask)&&(t.mask=t.mask(t)),n.isArray(t.mask)){if(t.mask.length>1){if(t.keepStatic===null)for(t.keepStatic="auto",e=0;e<t.mask.length;e++)if(t.mask[e].charAt(0)!==t.mask[0].charAt(0)){t.keepStatic=!0;break}return f=t.groupmarker[0],n.each(t.isRTL?t.mask.reverse():t.mask,function(r,u){f.length>1&&(f+=t.groupmarker[1]+t.alternatormarker+t.groupmarker[0]);f+=u.mask===i||n.isFunction(u.mask)?u:u.mask}),f+=t.groupmarker[1],o(f,t.mask,t)}t.mask=t.mask.pop()}return t.mask&&t.mask.mask!==i&&!n.isFunction(t.mask.mask)?o(t.mask.mask,t.mask,t):o(t.mask,t.mask,t)}function a(n){var t=u.createElement("input"),i="on"+n,r=i in t;return r||(t.setAttribute(i,"return;"),r=typeof t[i]=="function"),t=null,r}function f(e,o,c){function y(){return o}function ot(n){var t=y();t.buffer=i;n!==!0&&(t.validPositions={},t.p=0)}function b(n,t,r){var f=-1,e=-1,o=r||y().validPositions,s,u;n===i&&(n=-1);for(s in o)u=parseInt(s),o[u]&&(t||o[u].generatedInput!==!0)&&(u<=n&&(f=u),u>=n&&(e=u));return f===-1||f==n?e:e==-1?f:n-f<e-n?f:e}function li(n){var t=n.locator[n.alternation];return typeof t=="string"&&t.length>0&&(t=t.split(",")[0]),t!==i?t.toString():""}function wi(n,t){var r=(n.alternation!=i?n.mloc[li(n)]:n.locator).join("");if(r!=="")while(r.length<t)r+="0";return r}function ui(n,t){var l,e,o,s,r,f,u,h;for(n=n>0?n-1:0,l=it(n),e=wi(l),f=0;f<t.length;f++)u=t[f],o=wi(u,e.length),h=Math.abs(o-e),(s===i||o!==""&&h<s||r&&!c.greedy&&r.match.optionality&&r.match.newBlockMarker==="master"&&(!u.match.optionality||!u.match.newBlockMarker)||r&&r.match.optionalQuantifier&&!u.match.optionalQuantifier)&&(s=h,r=u);return r}function kt(n,t,i){return y().validPositions[n]||ui(n,ct(n,t?t.slice():t,i))}function it(n,t){return y().validPositions[n]?y().validPositions[n]:(t||ct(n))[0]}function rr(n,t){for(var u=!1,r=ct(n),i=0;i<r.length;i++)if(r[i].match&&r[i].match.def===t){u=!0;break}return u}function ct(t,r,u){function p(r,u,s,h){function w(s,h,l){function st(t,i){var r=n.inArray(t,i.matches)===0;return r||n.each(i.matches,function(n,u){return u.isQuantifier===!0?r=st(t,i.matches[n-1]):u.hasOwnProperty("matches")&&(r=st(t,u)),r?!1:void 0}),r}function wt(t,r,u){var f,e,o,s;return(y().tests[t]||y().validPositions[t])&&n.each(y().tests[t]||[y().validPositions[t]],function(n,t){if(t.mloc[r])return f=t,!1;var s=u!==i?u:t.alternation,o=t.locator[s]!==i?t.locator[s].toString().indexOf(r):-1;(e===i||o<e)&&o!==-1&&(f=t,e=o)}),f?(o=f.locator[f.alternation],s=f.mloc[r]||f.mloc[o]||f.locator,s.slice((u!==i?u:f.alternation)+1)):u!==i?wt(t,r):i}function bt(n,t){function i(n){for(var i=[],r,u,t=0,f=n.length;t<f;t++)if(n.charAt(t)==="-")for(u=n.charCodeAt(t+1);++r<u;)i.push(String.fromCharCode(r));else r=n.charCodeAt(t),i.push(n.charAt(t));return i.join("")}return c.regex&&n.match.fn!==null&&t.match.fn!==null?i(t.match.def.replace(/[\[\]]/g,"")).indexOf(i(n.match.def.replace(/[\[\]]/g,"")))!==-1:n.match.def===t.match.nativeDef}function ii(n,i){var r=n.locator.slice(n.alternation).join(""),u=i.locator.slice(i.alternation).join(""),f=r==u;return f&&n.match.fn===null&&i.match.fn!==null?i.match.fn.test(n.match.def,y(),t,!1,c,!1):!1}function ft(n,t){var r,u;if(t===i||n.alternation===t.alternation&&n.locator[n.alternation].toString().indexOf(t.locator[t.alternation])===-1)if(n.mloc=n.mloc||{},r=n.locator[n.alternation],r===i)n.alternation=i;else{if(typeof r=="string"&&(r=r.split(",")[0]),n.mloc[r]===i&&(n.mloc[r]=n.locator.slice()),t!==i){for(u in t.mloc)typeof u=="string"&&(u=u.split(",")[0]),n.mloc[u]===i&&(n.mloc[u]=t.mloc[u]);n.locator[n.alternation]=Object.keys(n.mloc).join(",")}return!0}return!1}var kt,ni,ct,ti,pt,et,lt,b,ot,at,d,rt,it,ut;if(e>500&&l!==i)throw"Inputmask: There is probably an error in your mask definition or in the code. Create an issue on github with an example of the mask you are using. "+y().mask;if(e===t&&s.matches===i)return f.push({match:s,locator:h.reverse(),cd:v,mloc:{}}),!0;if(s.matches!==i){if(s.isGroup&&l!==s){if(s=w(r.matches[n.inArray(s,r.matches)+1],h,l),s)return!0}else if(s.isOptional){if(kt=s,s=p(s,u,h,l),s)if(n.each(f,function(n,t){t.match.optionality=!0}),o=f[f.length-1].match,l===i&&st(o,kt))a=!0,e=t;else return!0}else if(s.isAlternator){var ht=s,g=[],vt,ri=f.slice(),dt=h.length,nt=u.length>0?u.shift():-1;if(nt===-1||typeof nt=="string"){var gt=e,yt=u.slice(),k=[],tt;if(typeof nt=="string")k=nt.split(",");else for(tt=0;tt<ht.matches.length;tt++)k.push(tt.toString());if(y().excludes[t]){for(ni=k.slice(),ct=0,ti=y().excludes[t].length;ct<ti;ct++)k.splice(k.indexOf(y().excludes[t][ct].toString()),1);k.length===0&&(y().excludes[t]=i,k=ni)}for((c.keepStatic===!0||isFinite(parseInt(c.keepStatic))&&gt>=c.keepStatic)&&(k=k.slice(0,1)),pt=!1,et=0;et<k.length;et++)for(tt=parseInt(k[et]),f=[],u=typeof nt=="string"?wt(e,tt,dt)||yt.slice():yt.slice(),ht.matches[tt]&&w(ht.matches[tt],[tt].concat(h),l)?s=!0:et===0&&(pt=!0),vt=f.slice(),e=gt,f=[],lt=0;lt<vt.length;lt++){for(b=vt[lt],ot=!1,b.match.jit=b.match.jit||pt,b.alternation=b.alternation||dt,ft(b),at=0;at<g.length;at++)if(d=g[at],typeof nt!="string"||b.alternation!==i&&n.inArray(b.locator[b.alternation].toString(),k)!==-1)if(b.match.nativeDef===d.match.nativeDef){ot=!0;ft(d,b);break}else if(bt(b,d)){ft(b,d)&&(ot=!0,g.splice(g.indexOf(d),0,b));break}else if(bt(d,b)){ft(d,b);break}else if(ii(b,d)){ft(b,d)&&(ot=!0,g.splice(g.indexOf(d),0,b));break}ot||g.push(b)}f=ri.concat(g);e=t;a=f.length>0;s=g.length>0;u=yt.slice()}else s=w(ht.matches[nt]||r.matches[nt],[nt].concat(h),l);if(s)return!0}else if(s.isQuantifier&&l!==r.matches[n.inArray(s,r.matches)-1]){for(rt=s,it=u.length>0?u.shift():0;it<(isNaN(rt.quantifier.max)?it+1:rt.quantifier.max)&&e<=t;it++)if(ut=r.matches[n.inArray(rt,r.matches)-1],s=w(ut,[it].concat(h),ut),s){if(o=f[f.length-1].match,o.optionalQuantifier=it>=rt.quantifier.min,o.jit=(it||1)*ut.matches.indexOf(o)>=rt.quantifier.jit,o.optionalQuantifier&&st(o,ut)){a=!0;e=t;break}return o.jit&&(y().jitOffset[t]=ut.matches.indexOf(o)),!0}}else if(s=p(s,u,h,l),s)return!0}else e++}for(var b,l=u.length>0?u.shift():0;l<r.matches.length;l++)if(r.matches[l].isQuantifier!==!0){if(b=w(r.matches[l],[l].concat(s),h),b&&e===t)return b;if(e>t)break}}function d(t,r){var u=[];return n.isArray(r)||(r=[r]),r.length>0&&(r[0].alternation===i?(u=ui(t,r.slice()).locator.slice(),u.length===0&&(u=r[0].locator.slice())):n.each(r,function(n,t){if(t.def!=="")if(u.length===0)u=t.locator.slice();else for(var i=0;i<u.length;i++)t.locator[i]&&u[i].toString().indexOf(t.locator[i])===-1&&(u[i]+=","+t.locator[i])})),u}var b=y().maskToken,e=r?u:0,l=r?r.slice():[0],f=[],a=!1,o,v=r?r.join(""):"",s,w,h,k;if(t>-1){if(r===i){for(s=t-1;(w=y().validPositions[s]||y().tests[s])===i&&s>-1;)s--;w!==i&&s>-1&&(l=d(s,w),v=l.join(""),e=s)}if(y().tests[t]&&y().tests[t][0].cd===v)return y().tests[t];for(h=l.shift();h<b.length;h++)if(k=p(b[h],l,[h]),k&&e===t||e>t)break}return((f.length===0||a)&&f.push({match:{fn:null,optionality:!1,casing:null,def:"",placeholder:""},locator:[],mloc:{},cd:v}),r!==i&&y().tests[t])?n.extend(!0,[],f):(y().tests[t]=n.extend(!0,[],f),y().tests[t])}function ut(){return y()._buffer===i&&(y()._buffer=bt(!1,1),y().buffer===i&&(y().buffer=y()._buffer.slice())),y()._buffer}function w(n){return(y().buffer===i||n===!0)&&(y().buffer=bt(!0,b(),!0),y()._buffer===i&&(y()._buffer=y().buffer.slice())),y().buffer}function bi(n,t,r){var u,e,f;if(n===!0)ot(),n=0,t=r.length;else for(u=n;u<t;u++)delete y().validPositions[u];for(e=n,u=n;u<t;u++)ot(!0),r[u]!==c.skipOptionalPartCharacter&&(f=vt(e,r[u],!0,!0),f!==!1&&(ot(!0),e=f.caret!==i?f.caret:f.pos+1))}function ur(t,i,u){var f,e;switch(c.casing||i.casing){case"upper":t=t.toUpperCase();break;case"lower":t=t.toLowerCase();break;case"title":f=y().validPositions[u-1];t=u===0||f&&f.input===String.fromCharCode(r.keyCode.SPACE)?t.toUpperCase():t.toLowerCase();break;default:n.isFunction(c.casing)&&(e=Array.prototype.slice.call(arguments),e.push(y().validPositions),t=c.casing.apply(this,e))}return t}function fr(t,r,u){for(var f,l=c.greedy?r:r.slice(0,1),o=!1,s=u!==i?u.split(","):[],h,e=0;e<s.length;e++)(h=t.indexOf(s[e]))!==-1&&t.splice(h,1);for(f=0;f<t.length;f++)if(n.inArray(t[f],l)!==-1){o=!0;break}return o}function fi(t,r,u,f,e){var ft=n.extend(!0,{},y().validPositions),v,k,h=!1,l,c,s,a,o,p=e!==i?e:b(),d,g,w,nt,ut,tt,rt;if(p===-1&&e===i)v=0,c=it(v),k=c.alternation;else for(;p>=0;p--)if(l=y().validPositions[p],l&&l.alternation!==i){if(c&&c.locator[l.alternation]!==l.locator[l.alternation])break;v=p;k=y().validPositions[v].alternation;c=l}if(k!==i){for(o=parseInt(v),y().excludes[o]=y().excludes[o]||[],t!==!0&&y().excludes[o].push(li(c)),d=[],g=0,s=o;s<b(i,!0)+1;s++)a=y().validPositions[s],a&&a.generatedInput!==!0?d.push(a.input):s<t&&g++,delete y().validPositions[s];while(y().excludes[o]&&y().excludes[o].length<10){for(w=g*-1,nt=d.slice(),y().tests[o]=i,ot(!0),h=!0;nt.length>0;)if(ut=nt.shift(),!(h=vt(b(i,!0)+1,ut,!1,f,!0)))break;if(h&&r!==i){for(tt=b(t)+1,s=o;s<b()+1;s++)a=y().validPositions[s],(a===i||a.match.fn==null)&&s<t+w&&w++;t=t+w;h=vt(t>tt?tt:t,r,u,f,!0)}if(h)break;else if(ot(),c=it(o),y().validPositions=n.extend(!0,{},ft),y().excludes[o]){if(rt=li(c),y().excludes[o].indexOf(rt)!==-1){h=fi(t,r,u,f,o-1);break}for(y().excludes[o].push(rt),s=o;s<b(i,!0)+1;s++)delete y().validPositions[s]}else{h=fi(t,r,u,f,o-1);break}}}return y().excludes[o]=i,h}function vt(t,r,u,f,e,o){function b(n){return g?n.begin-n.end>1||n.begin-n.end==1:n.end-n.begin>1||n.end-n.begin==1}function d(r,u,e){var o=!1;return n.each(ct(r),function(s,h){var l=h.match,a,v;return w(!0),o=l.fn!=null?l.fn.test(u,y(),r,e,c,b(t)):(u===l.def||u===c.skipOptionalPartCharacter)&&l.def!==""?{c:ht(r,l,!0)||l.def,pos:r}:!1,o!==!1?(a=o.c!==i?o.c:u,v=r,a=a===c.skipOptionalPartCharacter&&l.fn===null?ht(r,l,!0)||l.def:a,o.remove!==i&&(n.isArray(o.remove)||(o.remove=[o.remove]),n.each(o.remove.sort(function(n,t){return t-n}),function(n,t){ei({begin:t,end:t+1})})),o.insert!==i&&(n.isArray(o.insert)||(o.insert=[o.insert]),n.each(o.insert.sort(function(n,t){return n-t}),function(n,t){vt(t.pos,t.c,!0,f)})),o!==!0&&o.pos!==i&&o.pos!==r&&(v=o.pos),o!==!0&&o.pos===i&&o.c===i)?!1:(ei(t,n.extend({},h,{input:ur(a,l,v)}),f,v)||(o=!1),!1):void 0}),o}var h,s,nt,p,a,tt,l,v;if(u=u===!0,h=t,t.begin!==i&&(h=g?t.end:t.begin),s=!0,nt=n.extend(!0,{},y().validPositions),n.isFunction(c.preValidation)&&!u&&f!==!0&&o!==!0&&(s=c.preValidation(w(),h,r,b(t),c,y())),s===!0){if(ai(i,h,!0),(at===i||h<at)&&(s=d(h,r,u),(!u||f===!0)&&s===!1&&o!==!0))if(p=y().validPositions[h],p&&p.match.fn===null&&(p.match.def===r||r===c.skipOptionalPartCharacter))s={caret:k(h)};else if((c.insertMode||y().validPositions[k(h)]===i)&&(!ft(h,!0)||y().jitOffset[h]))if(y().jitOffset[h]&&y().validPositions[k(h)]===i)s=vt(h+y().jitOffset[h],r,u),s!==!1&&(s.caret=h);else for(a=h+1,tt=k(h);a<=tt;a++)if(s=d(a,r,u),s!==!1){s=ai(h,s.pos!==i?s.pos:a)||s;h=a;break}s===!1&&c.keepStatic!==!1&&(c.regex==null||wt(w()))&&!u&&e!==!0&&(s=fi(h,r,u,f));s===!0&&(s={pos:h})}return n.isFunction(c.postValidation)&&s!==!1&&!u&&f!==!0&&o!==!0&&(l=c.postValidation(w(!0),t.begin!==i?g?t.end:t.begin:t,s,c),l!==i&&(l.refreshFromBuffer&&l.buffer&&(v=l.refreshFromBuffer,bi(v===!0?v:v.start,v.end,l.buffer)),s=l===!0?s:l)),s&&s.pos===i&&(s.pos=h),(s===!1||o===!0)&&(ot(!0),y().validPositions=n.extend(!0,{},nt)),s}function ai(t,r,u){var s,f,h,o,e,c;if(t===i)for(t=r-1;t>0;t--)if(y().validPositions[t])break;for(f=t;f<r;f++)y().validPositions[f]!==i||ft(f,!0)||(h=f==0?it(f):y().validPositions[f-1],h&&(o=ct(f).slice(),o[o.length-1].match.def===""&&o.pop(),e=ui(f,o),e=n.extend({},e,{input:ht(f,e.match,!0)||e.match.def}),e.generatedInput=!0,ei(f,e,!0),u!==!0&&(c=y().validPositions[r].input,y().validPositions[r]=i,s=vt(r,c,!0,!0))));return s}function ei(t,r,u,f){function g(n,t,r){var u=t[n],f,e;return u!==i&&(u.match.fn===null&&u.match.optionality!==!0||u.input===c.radixPoint)?(f=r.begin<=n-1?t[n-1]&&t[n-1].match.fn===null&&t[n-1]:t[n-1],e=r.end>n+1?t[n+1]&&t[n+1].match.fn===null&&t[n+1]:t[n+1],f&&e):!1}var h=t.begin!==i?t.begin:t,v=t.end!==i?t.end:t,a,k,o,s,w;if(t.begin>t.end&&(h=t.end,v=t.begin),f=f!==i?f:h,h!==v||c.insertMode&&y().validPositions[f]!==i&&u===i){for(a=n.extend(!0,{},y().validPositions),k=b(i,!0),y().p=h,o=k;o>=h;o--)y().validPositions[o]&&y().validPositions[o].match.nativeDef==="+"&&(c.isNegative=!1),delete y().validPositions[o];var l=!0,p=f,nt=y().validPositions,d=!1,e=p,o=p;for(r&&(y().validPositions[f]=n.extend(!0,{},r),e++,p++,h<v&&o++);o<=k;o++){if(s=a[o],s!==i&&(o>=v||o>=h&&s.generatedInput!==!0&&g(o,a,{begin:h,end:v}))){while(it(e).match.def!==""){if(d===!1&&a[e]&&a[e].match.nativeDef===s.match.nativeDef?(y().validPositions[e]=n.extend(!0,{},a[e]),y().validPositions[e].input=s.input,ai(i,e,!0),p=e+1,l=!0):c.shiftPositions&&rr(e,s.match.def)?(w=vt(e,s.input,!0,!0),l=w!==!1,p=w.caret||w.insert?b():e+1,d=!0):l=s.generatedInput===!0||s.input===c.radixPoint&&c.numericInput===!0,l)break;if(!l&&e>v&&ft(e,!0)&&(s.match.fn!==null||e>y().maskLength))break;e++}it(e).match.def==""&&(l=!1);e=p}if(!l)break}if(!l)return y().validPositions=n.extend(!0,{},a),ot(!0),!1}else r&&(y().validPositions[f]=n.extend(!0,{},r));return ot(!0),!0}function ft(n,t){var i=kt(n).match,r;return(i.def===""&&(i=it(n).match),i.fn!=null)?i.fn:t!==!0&&n>-1?(r=ct(n),r.length>1+(r[r.length-1].match.def===""?1:0)):!1}function k(n,t){for(var i=n+1;it(i).match.def!==""&&(t===!0&&(it(i).match.newBlockMarker!==!0||!ft(i))||t!==!0&&!ft(i));)i++;return i}function dt(n,t){var i=n,r;if(i<=0)return 0;while(--i>0&&(t===!0&&it(i).match.newBlockMarker!==!0||t!==!0&&!ft(i)&&(r=ct(i),r.length<2||r.length===2&&r[1].match.def==="")));return i}function st(t,r,u,f,e){var o,s,h,l;f&&n.isFunction(c.onBeforeWrite)&&(o=c.onBeforeWrite.call(yt,f,r,u,c),o&&(o.refreshFromBuffer&&(s=o.refreshFromBuffer,bi(s===!0?s:s.start,s.end,o.buffer||r),r=w(!0)),u!==i&&(u=o.caret!==i?o.caret:u)));t!==i&&(t.inputmask._valueSet(r.join("")),u!==i&&(f===i||f.type!=="blur")?nt(t,u):tr(t,u,r.length===0),e===!0&&(h=n(t),l=t.inputmask._valueGet(),ti=!0,h.trigger("input"),setTimeout(function(){l===ut().join("")?h.trigger("cleared"):wt(r)===!0&&h.trigger("complete")},0)))}function ht(t,r,u){var f,o,s,e;if(r=r||it(t).match,r.placeholder!==i||u===!0)return n.isFunction(r.placeholder)?r.placeholder(c):r.placeholder;if(r.fn===null){if(t>-1&&y().validPositions[t]===i&&(f=ct(t),o=[],f.length>1+(f[f.length-1].match.def===""?1:0)))for(e=0;e<f.length;e++)if(f[e].match.optionality!==!0&&f[e].match.optionalQuantifier!==!0&&(f[e].match.fn===null||s===i||f[e].match.fn.test(s.match.def,y(),t,!0,c)!==!1)&&(o.push(f[e]),f[e].match.fn===null&&(s=f[e]),o.length>1&&/[0-9a-bA-Z]/.test(o[0].match.def)))return c.placeholder.charAt(t%c.placeholder.length);return r.def}return c.placeholder.charAt(t%c.placeholder.length)}function vi(n,t){var i,r,u;v?n.inputmask._valueGet()!==t&&(n.placeholder!==t||n.placeholder==="")&&(i=w().slice(),r=n.inputmask._valueGet(),r!==t&&(u=b(),u===-1&&r===ut().join("")?i=[]:u!==-1&&gt(i),st(n,i))):n.placeholder!==t&&(n.placeholder=t,n.placeholder===""&&n.removeAttribute("placeholder"))}function pt(t,u,f,e,o){function nt(n,t){var i=bt(!0,0,!1).slice(n,k(n)).join("").replace(/'/g,"").indexOf(t);return i!==-1&&!ft(n)&&(it(n).match.nativeDef===t.charAt(0)||it(n).match.fn===null&&it(n).match.nativeDef==="'"+t.charAt(0)||it(n).match.nativeDef===" "&&(it(n+1).match.nativeDef===t.charAt(0)||it(n+1).match.fn===null&&it(n+1).match.nativeDef==="'"+t.charAt(0)))}var a=this||t.inputmask,l=e.slice(),p="",s=-1,h=i,g,v;ot();f||c.autoUnmask===!0?s=k(s):(g=ut().slice(0,k(-1)).join(""),v=l.join("").match(new RegExp("^"+r.escapeRegex(g),"g")),v&&v.length>0&&(l.splice(0,v.length*g.length),s=k(s)));s===-1?(y().p=k(s),s=0):y().p=s;a.caretPos={begin:s};n.each(l,function(r,u){var e,o;u!==i&&(y().validPositions[r]===i&&l[r]===ht(r)&&ft(r,!0)&&vt(r,l[r],!0,i,i,!0)===!1?y().p++:(e=new n.Event("_checkval"),e.which=u.charCodeAt(0),p+=u,o=b(i,!0),nt(s,p)?h=d.keypressEvent.call(t,e,!0,!1,f,o+1):(h=d.keypressEvent.call(t,e,!0,!1,f,a.caretPos.begin),h&&(s=a.caretPos.begin+1,p="")),h&&(st(i,w(),h.forwardPosition,e,!1),a.caretPos={begin:h.forwardPosition,end:h.forwardPosition})))});u&&st(t,w(),h?h.forwardPosition:i,o||new n.Event("checkval"),o&&o.type==="input")}function ki(t){var r,u,f,e,o;if(t){if(t.inputmask===i)return t.value;t.inputmask&&t.inputmask.refreshValue&&d.setValueEvent.call(t)}r=[];u=y().validPositions;for(f in u)u[f].match&&u[f].match.fn!=null&&r.push(u[f].input);return e=r.length===0?"":(g?r.reverse():r).join(""),n.isFunction(c.onUnMask)&&(o=(g?w().slice().reverse():w()).join(""),e=c.onUnMask.call(yt,o,e,c)),e}function nt(r,f,e,o){function h(n){return g&&typeof n=="number"&&(!c.greedy||c.placeholder!=="")&&p&&(n=p.inputmask._valueGet().length-n),n}var s,l,v,a;if(f!==i)n.isArray(f)&&(e=g?f[0]:f[1],f=g?f[1]:f[0]),f.begin!==i&&(e=g?f.begin:f.end,f=g?f.end:f.begin),typeof f=="number"&&(f=o?f:h(f),e=o?e:h(e),e=typeof e=="number"?e:f,l=parseInt(((r.ownerDocument.defaultView||t).getComputedStyle?(r.ownerDocument.defaultView||t).getComputedStyle(r,null):r.currentStyle).fontSize)*e,r.scrollLeft=l>r.scrollWidth?l:0,r.inputmask.caretPos={begin:f,end:e},r===u.activeElement&&("selectionStart"in r?(r.selectionStart=f,r.selectionEnd=e):t.getSelection?(s=u.createRange(),(r.firstChild===i||r.firstChild===null)&&(v=u.createTextNode(""),r.appendChild(v)),s.setStart(r.firstChild,f<r.inputmask._valueGet().length?f:r.inputmask._valueGet().length),s.setEnd(r.firstChild,e<r.inputmask._valueGet().length?e:r.inputmask._valueGet().length),s.collapse(!0),a=t.getSelection(),a.removeAllRanges(),a.addRange(s)):r.createTextRange&&(s=r.createTextRange(),s.collapse(!0),s.moveEnd("character",e),s.moveStart("character",f),s.select()),tr(r,{begin:f,end:e})));else return"selectionStart"in r?(f=r.selectionStart,e=r.selectionEnd):t.getSelection?(s=t.getSelection().getRangeAt(0),(s.commonAncestorContainer.parentNode===r||s.commonAncestorContainer===r)&&(f=s.startOffset,e=s.endOffset)):u.selection&&u.selection.createRange&&(s=u.selection.createRange(),f=0-s.duplicate().moveStart("character",-r.inputmask._valueGet().length),e=f+s.text.length),{begin:o?f:h(f),end:o?e:h(e)}}function di(t){for(var h=bt(!0,b(),!0,!0),e=h.length,c=b(),o={},f=y().validPositions[c],l=f!==i?f.locator.slice():i,u,s,r=c+1;r<h.length;r++)u=kt(r,l,r-1),l=u.locator.slice(),o[r]=n.extend(!0,{},u);for(s=f&&f.alternation!==i?f.locator[f.alternation]:i,r=e-1;r>c;r--)if(u=o[r],(u.match.optionality||u.match.optionalQuantifier&&u.match.newBlockMarker||s&&(s!==o[r].locator[f.alternation]&&u.match.fn!=null||u.match.fn===null&&u.locator[f.alternation]&&fr(u.locator[f.alternation].toString().split(","),s.toString().split(","))&&ct(r)[0].def!==""))&&h[r]===ht(r,u.match))e--;else break;return t?{l:e,def:o[e]?o[e].match:i}:e}function gt(n){n.length=0;for(var r=bt(!0,0,!0,i,!0),t;t=r.shift(),t!==i;)n.push(t);return n}function wt(t){var r,u;if(n.isFunction(c.isComplete))return c.isComplete(t,c);if(c.repeat==="*")return i;var e=!1,f=di(!0),o=dt(f.l);if(f.def===i||f.def.newBlockMarker||f.def.optionality||f.def.optionalQuantifier)for(e=!0,r=0;r<=o;r++)if(u=kt(r).match,u.fn!==null&&y().validPositions[r]===i&&u.optionality!==!0&&u.optionalQuantifier!==!0||u.fn===null&&t[r]!==ht(r,u)){e=!1;break}return e}function gi(n,t,u,f,e){var l,o,h,s;if((c.numericInput||g)&&(t===r.keyCode.BACKSPACE?t=r.keyCode.DELETE:t===r.keyCode.DELETE&&(t=r.keyCode.BACKSPACE),g&&(l=u.end,u.end=u.begin,u.begin=l)),t===r.keyCode.BACKSPACE&&u.end-u.begin<1?(u.begin=dt(u.begin),y().validPositions[u.begin]!==i&&y().validPositions[u.begin].input===c.groupSeparator&&u.begin--):t===r.keyCode.DELETE&&u.begin===u.end&&(u.end=ft(u.end,!0)&&y().validPositions[u.end]&&y().validPositions[u.end].input!==c.radixPoint?u.end+1:k(u.end)+1,y().validPositions[u.begin]!==i&&y().validPositions[u.begin].input===c.groupSeparator&&u.end++),ei(u),(f!==!0&&c.keepStatic!==!1||c.regex!==null)&&(o=fi(!0),o&&(h=o.caret!==i?o.caret:o.pos?k(o.pos.begin?o.pos.begin:o.pos):b(-1,!0),(t!==r.keyCode.DELETE||u.begin>h)&&u.begin==h)),s=b(u.begin,!0),s<u.begin||u.begin===-1)y().p=k(s);else if(f!==!0&&(y().p=u.begin,e!==!0))while(y().p<s&&y().validPositions[y().p]===i)y().p++}function nr(i){function e(n){var t=u.createElement("span"),f,e,o,s,c,h,l;for(e in r)isNaN(e)&&e.indexOf("font")!==-1&&(t.style[e]=r[e]);for(t.style.textTransform=r.textTransform,t.style.letterSpacing=r.letterSpacing,t.style.position="absolute",t.style.height="auto",t.style.width="auto",t.style.visibility="hidden",t.style.whiteSpace="nowrap",u.body.appendChild(t),o=i.inputmask._valueGet(),s=0,f=0,c=o.length;f<=c;f++){if(t.innerHTML+=o.charAt(f)||"_",t.offsetWidth>=n){h=n-s;l=t.offsetWidth-n;t.innerHTML=o.charAt(f);h-=t.offsetWidth/3;f=h<l?f-1:f;break}s=t.offsetWidth}return u.body.removeChild(t),f}var r=(i.ownerDocument.defaultView||t).getComputedStyle(i,null),f=u.createElement("div");f.style.width=r.width;f.style.textAlign=r.textAlign;rt=u.createElement("div");i.inputmask.colorMask=rt;rt.className="im-colormask";i.parentNode.insertBefore(rt,i);i.parentNode.removeChild(i);rt.appendChild(i);rt.appendChild(f);i.style.left=f.offsetLeft+"px";n(rt).on("mouseleave",function(n){return d.mouseleaveEvent.call(i,[n])});n(rt).on("mouseenter",function(n){return d.mouseenterEvent.call(i,[n])});n(rt).on("click",function(n){return nt(i,e(n.clientX)),d.clickEvent.call(i,[n])})}function tr(n,t,r){function a(n){if(n===i&&(n=""),h||o.fn!==null&&s.input!==i)if(h&&(o.fn!==null&&s.input!==i||o.def==="")){h=!1;var t=e.length;e[t-1]=e[t-1]+"<\/span>";e.push(n)}else e.push(n);else h=!0,e.push("<span class='im-static'>"+n)}function d(){u.activeElement===n&&(e.splice(t.begin,0,t.begin===t.end||t.end>y().maskLength?'<mark class="im-caret" style="border-right-width: 1px;border-right-style: solid;">':'<mark class="im-caret-select">'),e.splice(t.end+1,0,"<\/mark>"))}var e=[],h=!1,o,s,l,f=0,k,v,p;if(rt!==i){if(k=w(),t===i?t=nt(n):t.begin===i&&(t={begin:t,end:t}),r!==!0){v=b();do y().validPositions[f]?(s=y().validPositions[f],o=s.match,l=s.locator.slice(),a(k[f])):(s=kt(f,l,f-1),o=s.match,l=s.locator.slice(),c.jitMasking===!1||f<v||typeof c.jitMasking=="number"&&isFinite(c.jitMasking)&&c.jitMasking>f?a(ht(f,o)):h=!1),f++;while((at===i||f<at)&&(o.fn!==null||o.def!=="")||v>f||h);h&&a();d()}p=rt.getElementsByTagName("div")[0];p.innerHTML=e.join("");n.inputmask.positionColorMask(n,p)}}function er(t){function o(t,r){function s(t){function c(t){if(n.valHooks&&(n.valHooks[t]===i||n.valHooks[t].inputmaskpatch!==!0)){var u=n.valHooks[t]&&n.valHooks[t].get?n.valHooks[t].get:function(n){return n.value},f=n.valHooks[t]&&n.valHooks[t].set?n.valHooks[t].set:function(n,t){return n.value=t,n};n.valHooks[t]={get:function(n){if(n.inputmask){if(n.inputmask.opts.autoUnmask)return n.inputmask.unmaskedvalue();var t=u(n);return b(i,i,n.inputmask.maskset.validPositions)!==-1||r.nullable!==!0?t:""}return u(n)},set:function(t,i){var u=n(t),r;return r=f(t,i),t.inputmask&&u.trigger("setvalue",[i]),r},inputmaskpatch:!0}}}function s(){return this.inputmask?this.inputmask.opts.autoUnmask?this.inputmask.unmaskedvalue():b()!==-1||r.nullable!==!0?u.activeElement===this&&r.clearMaskOnLostFocus?(g?gt(w().slice()).reverse():gt(w().slice())).join(""):f.call(this):"":f.call(this)}function h(t){e.call(this,t);this.inputmask&&n(this).trigger("setvalue",[t])}function l(t){tt.on(t,"mouseenter",function(){var t=n(this),i=this,r=i.inputmask._valueGet();r!==w().join("")&&t.trigger("setvalue")})}var f,e,o;t.inputmask.__valueGet||(r.noValuePatching!==!0&&(Object.getOwnPropertyDescriptor?(typeof Object.getPrototypeOf!="function"&&(Object.getPrototypeOf=typeof"test".__proto__=="object"?function(n){return n.__proto__}:function(n){return n.constructor.prototype}),o=Object.getPrototypeOf?Object.getOwnPropertyDescriptor(Object.getPrototypeOf(t),"value"):i,o&&o.get&&o.set?(f=o.get,e=o.set,Object.defineProperty(t,"value",{get:s,set:h,configurable:!0})):t.tagName!=="INPUT"&&(f=function(){return this.textContent},e=function(n){this.textContent=n},Object.defineProperty(t,"value",{get:s,set:h,configurable:!0}))):u.__lookupGetter__&&t.__lookupGetter__("value")&&(f=t.__lookupGetter__("value"),e=t.__lookupSetter__("value"),t.__defineGetter__("value",s),t.__defineSetter__("value",h)),t.inputmask.__valueGet=f,t.inputmask.__valueSet=e),t.inputmask._valueGet=function(n){return g&&n!==!0?f.call(this.el).split("").reverse().join(""):f.call(this.el)},t.inputmask._valueSet=function(n,t){e.call(this.el,n===null||n===i?"":t!==!0&&g?n.split("").reverse().join(""):n)},f===i&&(f=function(){return this.value},e=function(n){this.value=n},c(t.type),l(t)))}var o=t.getAttribute("type"),f=t.tagName==="INPUT"&&n.inArray(o,r.supportsInputType)!==-1||t.isContentEditable||t.tagName==="TEXTAREA",e;return f||(t.tagName==="INPUT"?(e=u.createElement("input"),e.setAttribute("type",o),f=e.type==="text",e=null):f="partial"),f!==!1?s(t):t.inputmask=i,f}var f,e,r;if(tt.off(t),f=o(t,c),f!==!1){if(p=t,ni=n(p),ci=p.placeholder,at=p!==i?p.maxLength:i,at===-1&&(at=i),c.colorMask===!0&&nr(p),s&&("inputMode"in p&&(p.inputmode=c.inputmode,p.setAttribute("inputmode",c.inputmode)),c.disablePredictiveText===!0&&("autocorrect"in p?p.autocorrect=!1:(c.colorMask!==!0&&nr(p),p.type="password"))),f===!0){p.setAttribute("im-insert",c.insertMode);tt.on(p,"submit",d.submitEvent);tt.on(p,"reset",d.resetEvent);tt.on(p,"blur",d.blurEvent);tt.on(p,"focus",d.focusEvent);if(c.colorMask!==!0){tt.on(p,"click",d.clickEvent);tt.on(p,"mouseleave",d.mouseleaveEvent);tt.on(p,"mouseenter",d.mouseenterEvent)}tt.on(p,"paste",d.pasteEvent);tt.on(p,"cut",d.cutEvent);tt.on(p,"complete",c.oncomplete);tt.on(p,"incomplete",c.onincomplete);tt.on(p,"cleared",c.oncleared);if(s||c.inputEventOnly===!0)p.removeAttribute("maxLength");else{tt.on(p,"keydown",d.keydownEvent);tt.on(p,"keypress",d.keypressEvent)}tt.on(p,"input",d.inputFallBackEvent);tt.on(p,"beforeinput",d.beforeInputEvent)}tt.on(p,"setvalue",d.setValueEvent);et=ut().join("");(p.inputmask._valueGet(!0)!==""||c.clearMaskOnLostFocus===!1||u.activeElement===p)&&(e=n.isFunction(c.onBeforeMask)?c.onBeforeMask.call(yt,p.inputmask._valueGet(!0),c)||p.inputmask._valueGet(!0):p.inputmask._valueGet(!0),e!==""&&pt(p,!0,!1,e.split("")),r=w().slice(),et=r.join(""),wt(r)===!1&&c.clearIncomplete&&ot(),c.clearMaskOnLostFocus&&u.activeElement!==p&&(b()===-1?r=[]:gt(r)),(c.clearMaskOnLostFocus===!1||c.showMaskOnFocus&&u.activeElement===p||p.inputmask._valueGet(!0)!=="")&&st(p,r),u.activeElement===p&&nt(p,k(b())))}}var tt,d,lt,ir,si;o=o||this.maskset;c=c||this.opts;var yt=this,p=this.el,g=this.isRTL,et,ni,hi=!1,ti=!1,ii=!1,at,ri=!1,rt,ci,bt=function(n,t,r,u,f){var v=c.greedy,l;f&&(c.greedy=!1);t=t||0;var h=[],a,e=0,o,s,p=b();do n===!0&&y().validPositions[e]?(s=f&&y().validPositions[e].match.optionality===!0&&y().validPositions[e+1]===i&&(y().validPositions[e].generatedInput===!0||y().validPositions[e].input==c.skipOptionalPartCharacter&&e>0)?ui(e,ct(e,a,e-1)):y().validPositions[e],o=s.match,a=s.locator.slice(),h.push(r===!0?s.input:r===!1?o.nativeDef:ht(e,o))):(s=kt(e,a,e-1),o=s.match,a=s.locator.slice(),l=u===!0?!1:c.jitMasking!==!1?c.jitMasking:o.jit,(l===!1||l===i||typeof l=="number"&&isFinite(l)&&l>e)&&h.push(r===!1?o.nativeDef:ht(e,o))),c.keepStatic==="auto"&&o.newBlockMarker&&o.fn!==null&&(c.keepStatic=e-1),e++;while((at===i||e<at)&&(o.fn!==null||o.def!=="")||t>e);return h[h.length-1]===""&&h.pop(),(r!==!1||y().maskLength===i)&&(y().maskLength=e-1),c.greedy=v,h};if(tt={on:function(t,u,f){var e=function(t){var u=this,o,e,a;if(u.inputmask===i&&this.nodeName!=="FORM")o=n.data(u,"_inputmask_opts"),o?new r(o).mask(u):tt.off(u);else{if(t.type==="setvalue"||this.nodeName==="FORM"||!u.disabled&&(!u.readOnly||t.type==="keydown"&&t.ctrlKey&&t.keyCode===67||c.tabThrough===!1&&t.keyCode===r.keyCode.TAB)){switch(t.type){case"input":if(ti===!0)return ti=!1,t.preventDefault();if(s)return e=arguments,setTimeout(function(){f.apply(u,e);nt(u,u.inputmask.caretPos,i,!0)},0),!1;break;case"keydown":hi=!1;ti=!1;break;case"keypress":if(hi===!0)return t.preventDefault();hi=!0;break;case"click":if(h||l)return e=arguments,setTimeout(function(){f.apply(u,e)},0),!1}return a=f.apply(u,arguments),a===!1&&(t.preventDefault(),t.stopPropagation()),a}t.preventDefault()}};if(t.inputmask.events[u]=t.inputmask.events[u]||[],t.inputmask.events[u].push(e),n.inArray(u,["submit","reset"])!==-1){if(t.form!==null)n(t.form).on(u,e)}else n(t).on(u,e)},off:function(t,i){if(t.inputmask&&t.inputmask.events){var r;i?(r=[],r[i]=t.inputmask.events[i]):r=t.inputmask.events;n.each(r,function(i,r){while(r.length>0){var u=r.pop();n.inArray(i,["submit","reset"])!==-1?t.form!==null&&n(t.form).off(i,u):n(t).off(i,u)}delete t.inputmask.events[i]})}}},d={keydownEvent:function(t){var f=this,o=n(f),u=t.keyCode,i=nt(f),e;u===r.keyCode.BACKSPACE||u===r.keyCode.DELETE||l&&u===r.keyCode.BACKSPACE_SAFARI||t.ctrlKey&&u===r.keyCode.X&&!a("cut")?(t.preventDefault(),gi(f,u,i),st(f,w(!0),y().p,t,f.inputmask._valueGet()!==w().join(""))):u===r.keyCode.END||u===r.keyCode.PAGE_DOWN?(t.preventDefault(),e=k(b()),nt(f,t.shiftKey?i.begin:e,e,!0)):(u!==r.keyCode.HOME||t.shiftKey)&&u!==r.keyCode.PAGE_UP?(c.undoOnEscape&&u===r.keyCode.ESCAPE||u===90&&t.ctrlKey)&&t.altKey!==!0?(pt(f,!0,!1,et.split("")),o.trigger("click")):u!==r.keyCode.INSERT||t.shiftKey||t.ctrlKey?c.tabThrough===!0&&u===r.keyCode.TAB&&(t.shiftKey===!0?(it(i.begin).match.fn===null&&(i.begin=k(i.begin)),i.end=dt(i.begin,!0),i.begin=dt(i.end,!0)):(i.begin=k(i.begin,!0),i.end=k(i.begin,!0),i.end<y().maskLength&&i.end--),i.begin<y().maskLength&&(t.preventDefault(),nt(f,i.begin,i.end))):(c.insertMode=!c.insertMode,f.setAttribute("im-insert",c.insertMode)):(t.preventDefault(),nt(f,0,t.shiftKey?i.begin:0,!0));c.onKeyDown.call(this,t,w(),nt(f).begin,c);ii=n.inArray(u,c.ignorables)!==-1},keypressEvent:function(t,u,f,e,o){var a=this,g=n(a),h=t.which||t.charCode||t.keyCode,b,s,d;if(u===!0||t.ctrlKey&&t.altKey||!(t.ctrlKey||t.metaKey||ii)){if(h){h===46&&t.shiftKey===!1&&c.radixPoint!==""&&(h=c.radixPoint.charCodeAt(0));var v=u?{begin:o,end:o}:nt(a),l,tt=String.fromCharCode(h),p=0;if(c._radixDance&&c.numericInput&&(b=w().indexOf(c.radixPoint.charAt(0))+1,v.begin<=b&&(h===c.radixPoint.charCodeAt(0)&&(p=1),v.begin-=1,v.end-=1)),y().writeOutBuffer=!0,s=vt(v,tt,e),s!==!1&&(ot(!0),l=s.caret!==i?s.caret:k(s.pos.begin?s.pos.begin:s.pos),y().p=l),l=(c.numericInput&&s.caret===i?dt(l):l)+p,f!==!1&&(setTimeout(function(){c.onKeyValidation.call(a,h,s,c)},0),y().writeOutBuffer&&s!==!1&&(d=w(),st(a,d,l,t,u!==!0))),t.preventDefault(),u)return s!==!1&&(s.forwardPosition=l),s}}else return h===r.keyCode.ENTER&&et!==w().join("")&&(et=w().join(""),setTimeout(function(){g.trigger("change")},0)),!0},pasteEvent:function(i){var e=this,h=i.originalEvent||i,a=n(e),r=e.inputmask._valueGet(!0),u=nt(e),l,o,s,f;if(g&&(l=u.end,u.end=u.begin,u.begin=l),o=r.substr(0,u.begin),s=r.substr(u.end,r.length),o===(g?ut().reverse():ut()).slice(0,u.begin).join("")&&(o=""),s===(g?ut().reverse():ut()).slice(u.end).join("")&&(s=""),t.clipboardData&&t.clipboardData.getData)r=o+t.clipboardData.getData("Text")+s;else if(h.clipboardData&&h.clipboardData.getData)r=o+h.clipboardData.getData("text/plain")+s;else return!0;if(f=r,n.isFunction(c.onBeforePaste)){if(f=c.onBeforePaste.call(yt,r,c),f===!1)return i.preventDefault();f||(f=r)}return pt(e,!1,!1,f.toString().split("")),st(e,w(),k(b()),i,et!==w().join("")),i.preventDefault()},inputFallBackEvent:function(t){function it(n,t,i){return t.charAt(i.begin-1)==="."&&c.radixPoint!==""&&(t=t.split(""),t[i.begin-1]=c.radixPoint.charAt(0),t=t.join("")),t}function rt(n,t,i){var r,u;return h&&(r=t.replace(w().join(""),""),r.length===1&&(u=t.split(""),u.splice(i.begin,0,r),t=u.join(""))),t}var u=this,f=u.inputmask._valueGet(),e,tt,o,g;if(w().join("")!==f&&(e=nt(u),f=it(u,f,e),f=rt(u,f,e),w().join("")!==f)){var b=w().join(""),s=!c.numericInput&&f.length>b.length?-1:0,l=f.substr(0,e.begin),a=f.substr(e.begin),y=b.substr(0,e.begin+s),p=b.substr(e.begin+s),i=e,v="",k=!1;if(l!==y){for(tt=(k=l.length>=y.length)?l.length:y.length,o=0;l.charAt(o)===y.charAt(o)&&o<tt;o++);k&&(i.begin=o-s,v+=l.slice(o,i.end))}a!==p&&(a.length>p.length?v+=a.slice(0,1):a.length<p.length&&(i.end+=p.length-a.length,k||c.radixPoint===""||a!==""||l.charAt(i.begin+s-1)!==c.radixPoint||(i.begin--,v=c.radixPoint)));st(u,w(),{begin:i.begin+s,end:i.end+s});v.length>0?n.each(v.split(""),function(t,i){var r=new n.Event("keypress");r.which=i.charCodeAt(0);ii=!1;d.keypressEvent.call(u,r)}):(i.begin===i.end-1&&(i.begin=dt(i.begin+1),i.begin===i.end-1?nt(u,i.begin):nt(u,i.begin,i.end)),g=new n.Event("keydown"),g.keyCode=c.numericInput?r.keyCode.BACKSPACE:r.keyCode.DELETE,d.keydownEvent.call(u,g));t.preventDefault()}},beforeInputEvent:function(t){var u,i;if(t.cancelable){u=this;switch(t.inputType){case"insertText":return n.each(t.data.split(""),function(t,i){var r=new n.Event("keypress");r.which=i.charCodeAt(0);ii=!1;d.keypressEvent.call(u,r)}),t.preventDefault();case"deleteContentBackward":return i=new n.Event("keydown"),i.keyCode=r.keyCode.BACKSPACE,d.keydownEvent.call(u,i),t.preventDefault();case"deleteContentForward":return i=new n.Event("keydown"),i.keyCode=r.keyCode.DELETE,d.keydownEvent.call(u,i),t.preventDefault()}}},setValueEvent:function(t){this.inputmask.refreshValue=!1;var r=this,i=t&&t.detail?t.detail[0]:arguments[1],i=i||r.inputmask._valueGet(!0);n.isFunction(c.onBeforeMask)&&(i=c.onBeforeMask.call(yt,i,c)||i);i=i.toString().split("");pt(r,!0,!1,i);et=w().join("");(c.clearMaskOnLostFocus||c.clearIncomplete)&&r.inputmask._valueGet()===ut().join("")&&r.inputmask._valueSet("")},focusEvent:function(n){var t=this,i=t.inputmask._valueGet();c.showMaskOnFocus&&(i!==w().join("")?st(t,w(),k(b())):ri===!1&&nt(t,k(b())));c.positionCaretOnTab===!0&&ri===!1&&d.clickEvent.apply(t,[n,!0]);et=w().join("")},mouseleaveEvent:function(){var n=this;ri=!1;c.clearMaskOnLostFocus&&u.activeElement!==n&&vi(n,ci)},clickEvent:function(t,r){function e(t){var r,f,u;if(c.radixPoint!==""&&(r=y().validPositions,r[t]===i||r[t].input===ht(t))){if(t<k(-1))return!0;if(f=n.inArray(c.radixPoint,w()),f!==-1){for(u in r)if(f<u&&r[u].input!==ht(u))return!1;return!0}}return!1}var f=this;setTimeout(function(){var n,h,v;if(u.activeElement===f&&(n=nt(f),r&&(g?n.end=n.begin:n.begin=n.end),n.begin===n.end))switch(c.positionCaretOnClick){case"none":break;case"select":nt(f,0,w().length);break;case"ignore":nt(f,k(b()));break;case"radixFocus":if(e(n.begin)){h=w().join("").indexOf(c.radixPoint);nt(f,c.numericInput?k(h):h);break}default:var o=n.begin,p=b(o,!0),t=k(p);if(o<t)nt(f,!ft(o,!0)&&!ft(o-1,!0)?k(o):o);else{var l=y().validPositions[p],s=kt(t,l?l.match.locator:i,l),a=ht(t,s.match);(a===""||w()[t]===a||s.match.optionalQuantifier===!0||s.match.newBlockMarker===!0)&&(ft(t,c.keepStatic)||s.match.def!==a)||(v=k(t),(o>=v||o===t)&&(t=v));nt(f,t)}}},0)},cutEvent:function(i){var e=this,c=n(e),f=nt(e),s=i.originalEvent||i,h=t.clipboardData||s.clipboardData,o=g?w().slice(f.end,f.begin):w().slice(f.begin,f.end);h.setData("text",g?o.reverse().join(""):o.join(""));u.execCommand&&u.execCommand("copy");gi(e,r.keyCode.DELETE,f);st(e,w(),y().p,i,et!==w().join(""))},blurEvent:function(t){var e=n(this),u=this,f,r;u.inputmask&&(vi(u,ci),f=u.inputmask._valueGet(),r=w().slice(),(f!==""||rt!==i)&&(c.clearMaskOnLostFocus&&(b()===-1&&f===ut().join("")?r=[]:gt(r)),wt(r)===!1&&(setTimeout(function(){e.trigger("incomplete")},0),c.clearIncomplete&&(ot(),r=c.clearMaskOnLostFocus?[]:ut().slice())),st(u,r,i,t)),et!==w().join("")&&(et=r.join(""),e.trigger("change")))},mouseenterEvent:function(){var n=this;ri=!0;u.activeElement!==n&&c.showMaskOnHover&&vi(n,(g?w().slice().reverse():w()).join(""))},submitEvent:function(){et!==w().join("")&&ni.trigger("change");c.clearMaskOnLostFocus&&b()===-1&&p.inputmask._valueGet&&p.inputmask._valueGet()===ut().join("")&&p.inputmask._valueSet("");c.clearIncomplete&&wt(w())===!1&&p.inputmask._valueSet("");c.removeMaskOnSubmit&&(p.inputmask._valueSet(p.inputmask.unmaskedvalue(),!0),setTimeout(function(){st(p,w())},0))},resetEvent:function(){p.inputmask.refreshValue=!0;setTimeout(function(){ni.trigger("setvalue")},0)}},e!==i)switch(e.action){case"isComplete":return p=e.el,wt(w());case"unmaskedvalue":return(p===i||e.value!==i)&&(lt=e.value,lt=(n.isFunction(c.onBeforeMask)?c.onBeforeMask.call(yt,lt,c)||lt:lt).split(""),pt.call(this,i,!1,!1,lt),n.isFunction(c.onBeforeWrite)&&c.onBeforeWrite.call(yt,i,w(),0,c)),ki(p);case"mask":er(p);break;case"format":return(lt=(n.isFunction(c.onBeforeMask)?c.onBeforeMask.call(yt,e.value,c)||e.value:e.value).split(""),pt.call(this,i,!0,!1,lt),e.metadata)?{value:g?w().slice().reverse().join(""):w().join(""),metadata:f.call(this,{action:"getmetadata"},o,c)}:g?w().slice().reverse().join(""):w().join("");case"isValid":e.value?(lt=e.value.split(""),pt.call(this,i,!0,!0,lt)):e.value=w().join("");for(var yi=w(),pi=di(),oi=yi.length-1;oi>pi;oi--)if(ft(oi))break;return yi.splice(pi,oi+1-pi),wt(yi)&&e.value===w().join("");case"getemptymask":return ut().join("");case"remove":return p&&p.inputmask&&(n.data(p,"_inputmask_opts",null),ni=n(p),p.inputmask._valueSet(c.autoUnmask?ki(p):p.inputmask._valueGet(!0)),tt.off(p),p.inputmask.colorMask&&(rt=p.inputmask.colorMask,rt.removeChild(p),rt.parentNode.insertBefore(p,rt),rt.parentNode.removeChild(rt)),Object.getOwnPropertyDescriptor&&Object.getPrototypeOf?(ir=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(p),"value"),ir&&p.inputmask.__valueGet&&Object.defineProperty(p,"value",{get:p.inputmask.__valueGet,set:p.inputmask.__valueSet,configurable:!0})):u.__lookupGetter__&&p.__lookupGetter__("value")&&p.inputmask.__valueGet&&(p.__defineGetter__("value",p.inputmask.__valueGet),p.__defineSetter__("value",p.inputmask.__valueSet)),p.inputmask=i),p;case"getmetadata":return n.isArray(o.metadata)?(si=bt(!0,0,!1).join(""),n.each(o.metadata,function(n,t){if(t.mask===si)return si=t,!1}),si):o.metadata}}var u=t.document,o=navigator.userAgent,v=o.indexOf("MSIE ")>0||o.indexOf("Trident/")>0,s=a("touchstart"),h=/iemobile/i.test(o),l=/iphone/i.test(o)&&!h;return r.prototype={dataAttribute:"data-inputmask",defaults:{placeholder:"_",optionalmarker:["[","]"],quantifiermarker:["{","}"],groupmarker:["(",")"],alternatormarker:"|",escapeChar:"\\",mask:null,regex:null,oncomplete:n.noop,onincomplete:n.noop,oncleared:n.noop,repeat:0,greedy:!1,autoUnmask:!1,removeMaskOnSubmit:!1,clearMaskOnLostFocus:!0,insertMode:!0,clearIncomplete:!1,alias:null,onKeyDown:n.noop,onBeforeMask:null,onBeforePaste:function(t,i){return n.isFunction(i.onBeforeMask)?i.onBeforeMask.call(this,t,i):t},onBeforeWrite:null,onUnMask:null,showMaskOnFocus:!0,showMaskOnHover:!0,onKeyValidation:n.noop,skipOptionalPartCharacter:" ",numericInput:!1,rightAlign:!1,undoOnEscape:!0,radixPoint:"",_radixDance:!1,groupSeparator:"",keepStatic:null,positionCaretOnTab:!0,tabThrough:!1,supportsInputType:["text","tel","url","password","search"],ignorables:[8,9,13,19,27,33,34,35,36,37,38,39,40,45,46,93,112,113,114,115,116,117,118,119,120,121,122,123,0,229],isComplete:null,preValidation:null,postValidation:null,staticDefinitionSymbol:i,jitMasking:!1,nullable:!0,inputEventOnly:!1,noValuePatching:!1,positionCaretOnClick:"lvp",casing:null,inputmode:"verbatim",colorMask:!1,disablePredictiveText:!1,importDataAttributes:!0,shiftPositions:!0},definitions:{9:{validator:"[0-9１-９]",definitionSymbol:"*"},a:{validator:"[A-Za-zА-яЁёÀ-ÿµ]",definitionSymbol:"*"},"*":{validator:"[0-9１-９A-Za-zА-яЁёÀ-ÿµ]"}},aliases:{},masksCache:{},mask:function(o){function h(r,u,f,e){if(u.importDataAttributes===!0){var l=r.getAttribute(e),a,o,s,h,v=function(n,u){u=u!==i?u:r.getAttribute(e+"-"+n);u!==null&&(typeof u=="string"&&(n.indexOf("on")===0?u=t[u]:u==="false"?u=!1:u==="true"&&(u=!0)),f[n]=u)};if(l&&l!==""&&(l=l.replace(/'/g,'"'),o=JSON.parse("{"+l+"}")),o){s=i;for(h in o)if(h.toLowerCase()==="alias"){s=o[h];break}}v("alias",s);f.alias&&c(f.alias,f,u);for(a in u){if(o){s=i;for(h in o)if(h.toLowerCase()===a.toLowerCase()){s=o[h];break}}v(a,s)}}return n.extend(!0,u,f),(r.dir==="rtl"||u.rightAlign)&&(r.style.textAlign="right"),(r.dir==="rtl"||u.numericInput)&&(r.dir="ltr",r.removeAttribute("dir"),u.isRTL=!0),Object.keys(f).length}var s=this;return typeof o=="string"&&(o=u.getElementById(o)||u.querySelectorAll(o)),o=o.nodeName?[o]:o,n.each(o,function(t,u){var o=n.extend(!0,{},s.opts),c;h(u,o,n.extend(!0,{},s.userOptions),s.dataAttribute)&&(c=e(o,s.noMasksCache),c!==i&&(u.inputmask!==i&&(u.inputmask.opts.autoUnmask=!0,u.inputmask.remove()),u.inputmask=new r(i,i,!0),u.inputmask.opts=o,u.inputmask.noMasksCache=s.noMasksCache,u.inputmask.userOptions=n.extend(!0,{},s.userOptions),u.inputmask.isRTL=o.isRTL||o.numericInput,u.inputmask.el=u,u.inputmask.maskset=c,n.data(u,"_inputmask_opts",o),f.call(u.inputmask,{action:"mask"})))}),o&&o[0]?o[0].inputmask||this:this},option:function(t,i){return typeof t=="string"?this.opts[t]:typeof t=="object"?(n.extend(this.userOptions,t),this.el&&i!==!0&&this.mask(this.el),this):void 0},unmaskedvalue:function(n){return this.maskset=this.maskset||e(this.opts,this.noMasksCache),f.call(this,{action:"unmaskedvalue",value:n})},remove:function(){return f.call(this,{action:"remove"})},getemptymask:function(){return this.maskset=this.maskset||e(this.opts,this.noMasksCache),f.call(this,{action:"getemptymask"})},hasMaskedValue:function(){return!this.opts.autoUnmask},isComplete:function(){return this.maskset=this.maskset||e(this.opts,this.noMasksCache),f.call(this,{action:"isComplete"})},getmetadata:function(){return this.maskset=this.maskset||e(this.opts,this.noMasksCache),f.call(this,{action:"getmetadata"})},isValid:function(n){return this.maskset=this.maskset||e(this.opts,this.noMasksCache),f.call(this,{action:"isValid",value:n})},format:function(n,t){return this.maskset=this.maskset||e(this.opts,this.noMasksCache),f.call(this,{action:"format",value:n,metadata:t})},setValue:function(t){this.el&&n(this.el).trigger("setvalue",[t])},analyseMask:function(t,u,f){function p(n,t,i,r){this.matches=[];this.openGroup=n||!1;this.alternatorGroup=!1;this.isGroup=n||!1;this.isOptional=t||!1;this.isQuantifier=i||!1;this.isAlternator=r||!1;this.quantifier={min:1,max:1}}function g(t,e,o){var s,h;o=o!==i?o:t.matches.length;s=t.matches[o-1];u?(e.indexOf("[")===0||a&&/\\d|\\s|\\w]/i.test(e)||e==="."?t.matches.splice(o++,0,{fn:new RegExp(e,f.casing?"i":""),optionality:!1,newBlockMarker:s===i?"master":s.def!==e,casing:null,def:e,placeholder:i,nativeDef:e}):(a&&(e=e[e.length-1]),n.each(e.split(""),function(n,r){s=t.matches[o-1];t.matches.splice(o++,0,{fn:null,optionality:!1,newBlockMarker:s===i?"master":s.def!==r&&s.fn!==null,casing:null,def:f.staticDefinitionSymbol||r,placeholder:f.staticDefinitionSymbol!==i?r:i,nativeDef:(a?"'":"")+r})})),a=!1):(h=(f.definitions?f.definitions[e]:i)||r.prototype.definitions[e],h&&!a?t.matches.splice(o++,0,{fn:h.validator?typeof h.validator=="string"?new RegExp(h.validator,f.casing?"i":""):new function(){this.test=h.validator}:new RegExp("."),optionality:!1,newBlockMarker:s===i?"master":s.def!==(h.definitionSymbol||e),casing:h.casing,def:h.definitionSymbol||e,placeholder:h.placeholder,nativeDef:e}):(t.matches.splice(o++,0,{fn:null,optionality:!1,newBlockMarker:s===i?"master":s.def!==e&&s.fn!==null,casing:null,def:f.staticDefinitionSymbol||e,placeholder:f.staticDefinitionSymbol!==i?e:i,nativeDef:(a?"'":"")+e}),a=!1))}function ot(t){t&&t.matches&&n.each(t.matches,function(n,r){var e=t.matches[n+1];(e===i||e.matches===i||e.isQuantifier===!1)&&r&&r.isGroup&&(r.isGroup=!1,u||(g(r,f.groupmarker[0],0),r.openGroup!==!0&&g(r,f.groupmarker[1])));ot(r)})}function nt(){if(e.length>0){if(s=e[e.length-1],g(s,c),s.isAlternator){o=e.pop();for(var n=0;n<o.matches.length;n++)o.matches[n].isGroup&&(o.matches[n].isGroup=!1);e.length>0?(s=e[e.length-1],s.matches.push(o)):l.matches.push(o)}}else g(l,c)}function st(n){function e(n){return n===f.optionalmarker[0]?n=f.optionalmarker[1]:n===f.optionalmarker[1]?n=f.optionalmarker[0]:n===f.groupmarker[0]?n=f.groupmarker[1]:n===f.groupmarker[1]&&(n=f.groupmarker[0]),n}var t,r,u;n.matches=n.matches.reverse();for(t in n.matches)n.matches.hasOwnProperty(t)&&(r=parseInt(t),n.matches[t].isQuantifier&&n.matches[r+1]&&n.matches[r+1].isGroup&&(u=n.matches[t],n.matches.splice(t,1),n.matches.splice(r+1,0,u)),n.matches[t]=n.matches[t].matches!==i?st(n.matches[t]):e(n.matches[t]));return n}function ht(n){var t=new p(!0);return t.openGroup=!1,t.matches=n,t}var vt=/(?:[?*+]|\{[0-9\+\*]+(?:,[0-9\+\*]*)?(?:\|[0-9\+\*]*)?\})|[^.?*+^${[]()|\\]+|./g,yt=/\[\^?]?(?:[^\\\]]+|\\[\S\s]?)*]?|\\(?:0(?:[0-3][0-7]{0,2}|[4-7][0-7]?)?|[1-9][0-9]*|x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4}|c[A-Za-z]|[\S\s]?)|\((?:\?[:=!]?)?|(?:[?*+]|\{[0-9]+(?:,[0-9]*)?\})\??|[^.?*+^${[()|\\]+|./g,a=!1,l=new p,h,c,e=[],it=[],w,s,o,v,k,ut,y,rt,at,ft,tt,et;for(u&&(f.optionalmarker[0]=i,f.optionalmarker[1]=i);h=u?yt.exec(t):vt.exec(t);){if(c=h[0],u)switch(c.charAt(0)){case"?":c="{0,1}";break;case"+":case"*":c="{"+c+"}"}if(a){nt();continue}switch(c.charAt(0)){case"(?=":break;case"(?!":break;case"(?<=":break;case"(?<!":break;case f.escapeChar:a=!0;u&&nt();break;case f.optionalmarker[1]:case f.groupmarker[1]:if(w=e.pop(),w.openGroup=!1,w!==i)if(e.length>0){if(s=e[e.length-1],s.matches.push(w),s.isAlternator){for(o=e.pop(),k=0;k<o.matches.length;k++)o.matches[k].isGroup=!1,o.matches[k].alternatorGroup=!1;e.length>0?(s=e[e.length-1],s.matches.push(o)):l.matches.push(o)}}else l.matches.push(w);else nt();break;case f.optionalmarker[0]:e.push(new p(!1,!0));break;case f.groupmarker[0]:e.push(new p(!0));break;case f.quantifiermarker[0]:ut=new p(!1,!1,!0);c=c.replace(/[{}]/g,"");var ct=c.split("|"),b=ct[0].split(","),d=isNaN(b[0])?b[0]:parseInt(b[0]),lt=b.length===1?d:isNaN(b[1])?b[1]:parseInt(b[1]);(d==="*"||d==="+")&&(d=lt==="*"?0:1);ut.quantifier={min:d,max:lt,jit:ct[1]};y=e.length>0?e[e.length-1].matches:l.matches;h=y.pop();h.isAlternator&&(y.push(h),y=h.matches,rt=new p(!0),at=y.pop(),y.push(rt),y=rt.matches,h=at);h.isGroup||(h=ht([h]));y.push(h);y.push(ut);break;case f.alternatormarker:ft=function(n){var t=n.pop();return t.isQuantifier&&(t=ht([n.pop(),t])),t};e.length>0?(s=e[e.length-1],tt=s.matches[s.matches.length-1],v=s.openGroup&&(tt.matches===i||tt.isGroup===!1&&tt.isAlternator===!1)?e.pop():ft(s.matches)):v=ft(l.matches);v.isAlternator?e.push(v):(v.alternatorGroup?(o=e.pop(),v.alternatorGroup=!1):o=new p(!1,!1,!1,!0),o.matches.push(v),e.push(o),v.openGroup&&(v.openGroup=!1,et=new p(!0),et.alternatorGroup=!0,e.push(et)));break;default:nt()}}while(e.length>0)w=e.pop(),l.matches.push(w);return l.matches.length>0&&(ot(l),it.push(l)),(f.numericInput||f.isRTL)&&st(it[0]),it},positionColorMask:function(n,t){n.style.left=t.offsetLeft+"px"}},r.extendDefaults=function(t){n.extend(!0,r.prototype.defaults,t)},r.extendDefinitions=function(t){n.extend(!0,r.prototype.definitions,t)},r.extendAliases=function(t){n.extend(!0,r.prototype.aliases,t)},r.format=function(n,t,i){return r(t).format(n,i)},r.unmask=function(n,t){return r(t).unmaskedvalue(n)},r.isValid=function(n,t){return r(t).isValid(n)},r.remove=function(t){typeof t=="string"&&(t=u.getElementById(t)||u.querySelectorAll(t));t=t.nodeName?[t]:t;n.each(t,function(n,t){t.inputmask&&t.inputmask.remove()})},r.setValue=function(t,i){typeof t=="string"&&(t=u.getElementById(t)||u.querySelectorAll(t));t=t.nodeName?[t]:t;n.each(t,function(t,r){r.inputmask?r.inputmask.setValue(i):n(r).trigger("setvalue",[i])})},r.escapeRegex=function(n){return n.replace(new RegExp("(\\/|\\.|\\*|\\+|\\?|\\||\\(|\\)|\\[|\\]|\\{|\\}|\\\\|\\$|\\^)","gim"),"\\$1")},r.keyCode={BACKSPACE:8,BACKSPACE_SAFARI:127,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,PAGE_DOWN:34,PAGE_UP:33,RIGHT:39,SPACE:32,TAB:9,UP:38,X:88,CONTROL:17},r.dependencyLib=n,r});!function(n){"function"==typeof define&&define.amd?define(["../global/window","../global/document"],n):"object"==typeof exports?module.exports=n(require("../global/window"),require("../global/document")):window.dependencyLib=n(window,document)}(function(n,t){function u(n){return null!=n&&n===n.window}function r(n){return n instanceof Element}function i(r){return r instanceof i?r:this instanceof i?void(void 0!==r&&null!==r&&r!==n&&(this[0]=r.nodeName?r:void 0!==r[0]&&r[0].nodeName?r[0]:t.querySelector(r),void 0!==this[0]&&null!==this[0]&&(this[0].eventRegistry=this[0].eventRegistry||{}))):new i(r)}return i.prototype={on:function(n,t){var u,f,s,e,i,o;if(r(this[0]))for(u=this[0].eventRegistry,f=this[0],s=n.split(" "),e=0;e<s.length;e++){var h=s[e].split("."),c=h[0],l=h[1]||"global";i=c;o=l;f.addEventListener?f.addEventListener(i,t,!1):f.attachEvent&&f.attachEvent("on"+i,t);u[i]=u[i]||{};u[i][o]=u[i][o]||[];u[i][o].push(t)}return this},off:function(n,t){var i,u,s,e;if(r(this[0])){i=this[0].eventRegistry;u=this[0];function r(n,t,r){if(n in i==!0)if(u.removeEventListener?u.removeEventListener(n,r,!1):u.detachEvent&&u.detachEvent("on"+n,r),"global"===t)for(var f in i[n])i[n][f].splice(i[n][f].indexOf(r),1);else i[n][t].splice(i[n][t].indexOf(r),1)}function l(n,r){var u,s,o=[],f,e;if(n.length>0)if(void 0===t)for(u=0,s=i[n][r].length;u<s;u++)o.push({ev:n,namespace:r&&r.length>0?r:"global",handler:i[n][r][u]});else o.push({ev:n,namespace:r&&r.length>0?r:"global",handler:t});else if(r.length>0)for(f in i)for(e in i[f])if(e===r)if(void 0===t)for(u=0,s=i[f][e].length;u<s;u++)o.push({ev:f,namespace:e,handler:i[f][e][u]});else o.push({ev:f,namespace:e,handler:t});return o}for(s=n.split(" "),e=0;e<s.length;e++)for(var h=s[e].split("."),o=l(h[0],h[1]),f=0,c=o.length;f<c;f++)r(o[f].ev,o[f].namespace,o[f].handler)}return this},trigger:function(n){var f,e,s,a;if(r(this[0]))for(var o=this[0].eventRegistry,h=this[0],v="string"==typeof n?n.split(" "):[n.type],l=0;l<v.length;l++){var y=v[l].split("."),u=y[0],c=y[1]||"global";if(void 0!==t&&"global"===c)if(s={bubbles:!0,cancelable:!0,detail:arguments[1]},t.createEvent){try{f=new CustomEvent(u,s)}catch(n){(f=t.createEvent("CustomEvent")).initCustomEvent(u,s.bubbles,s.cancelable,s.detail)}n.type&&i.extend(f,n);h.dispatchEvent(f)}else(f=t.createEventObject()).eventType=u,f.detail=arguments[1],n.type&&i.extend(f,n),h.fireEvent("on"+f.eventType,f);else if(void 0!==o[u])if(arguments[0]=arguments[0].type?arguments[0]:i.Event(arguments[0]),"global"===c)for(a in o[u])for(e=0;e<o[u][a].length;e++)o[u][a][e].apply(h,arguments);else for(e=0;e<o[u][c].length;e++)o[u][c][e].apply(h,arguments)}return this}},i.isFunction=function(n){return"function"==typeof n},i.noop=function(){},i.isArray=Array.isArray,i.inArray=function(n,t){return null==t?-1:function(n,t){for(var i=0,r=n.length;i<r;i++)if(n[i]===t)return i;return-1}(t,n)},i.valHooks=void 0,i.isPlainObject=function(n){return"object"==typeof n&&!n.nodeType&&!u(n)&&!(n.constructor&&!Object.hasOwnProperty.call(n.constructor.prototype,"isPrototypeOf"))},i.extend=function(){var e,f,t,r,o,s,n=arguments[0]||{},u=1,c=arguments.length,h=!1;for("boolean"==typeof n&&(h=n,n=arguments[u]||{},u++),"object"==typeof n||i.isFunction(n)||(n={}),u===c&&(n=this,u--);u<c;u++)if(null!=(e=arguments[u]))for(f in e)t=n[f],n!==(r=e[f])&&(h&&r&&(i.isPlainObject(r)||(o=i.isArray(r)))?(o?(o=!1,s=t&&i.isArray(t)?t:[]):s=t&&i.isPlainObject(t)?t:{},n[f]=i.extend(h,s,r)):void 0!==r&&(n[f]=r));return n},i.each=function(n,t){var r,f,e,i=0,o;if(f="length"in(r=n)&&r.length,"function"!=(e=typeof r)&&!u(r)&&(1===r.nodeType&&f||"array"===e||0===f||"number"==typeof f&&f>0&&f-1 in r))for(o=n.length;i<o&&!1!==t.call(n[i],i,n[i]);i++);else for(i in n)if(!1===t.call(n[i],i,n[i]))break;return n},i.data=function(n,t,i){if(void 0===i)return n.__data?n.__data[t]:null;n.__data=n.__data||{};n.__data[t]=i},"function"==typeof n.CustomEvent?i.Event=n.CustomEvent:(i.Event=function(n,i){i=i||{bubbles:!1,cancelable:!1,detail:void 0};var r=t.createEvent("CustomEvent");return r.initCustomEvent(n,i.bubbles,i.cancelable,i.detail),r},i.Event.prototype=n.Event.prototype),i});window.kentico=window.kentico||{},function(n){if(n.pageBuilder){var i=function(n,t){var i=document.getElementById(n);i.getString=window.kentico.localization.getString;i.selectedData=t};const t=n._modalDialog=n._modalDialog||{},r=t.mediaFilesSelector=t.mediaFilesSelector||{};r.init=i}}(window.kentico);window.kentico=window.kentico||{},function(n){if(n.pageBuilder){var i=function(n,t){var i=document.getElementById(n);i.getString=window.kentico.localization.getString;i.selectedPageData=t};const t=n._modalDialog=n._modalDialog||{},r=t.pageSelector=t.pageSelector||{};r.init=i}}(window.kentico);window.kentico=window.kentico||{},function(n){if(n.pageBuilder){var i=function(n,t){var i=document.getElementById(n);i.getString=window.kentico.localization.getString;i.selectedPageData=t};const t=n._modalDialog=n._modalDialog||{},r=t.pathSelector=t.pathSelector||{};r.init=i}}(window.kentico);window.kentico=window.kentico||{};window.kentico.updatableFormHelper=function(){function u(t){var e,u,f,s,h;if(!t||!t.formId||!t.targetAttributeName||!t.unobservedAttributeName)throw new Error("Invalid configuration passed.");if(e=["email","number","password","search","tel","text","time"],u=document.getElementById(t.formId),u&&u.getAttribute(t.targetAttributeName))for(i=0;i<u.length;i++)f=u.elements[i],s=!f.hasAttribute(t.unobservedAttributeName)&&f.type!=="submit",s&&(h=f.tagName==="INPUT"&&e.indexOf(f.type)!==-1||f.tagName==="TEXTAREA",h&&(f.previousValue=f.value,f.addEventListener("keyup",o(function(t){setTimeout(function(){u.updating||t.target.previousValue===t.target.value||(u.keyupUpdate=!0,n(u,t.target))},0)},r)),f.addEventListener("blur",function(t){setTimeout(function(){u.updating||t.target.previousValue===t.target.value||n(u,t.relatedTarget)},0)})),f.addEventListener("change",function(){setTimeout(function(){u.updating||n(u)},0)}))}function n(n,i){var u,f,r,o;n&&(u=n.getAttribute("data-ktc-ajax-update"),u)&&($(n).find("input[type='submit']").attr("onclick","return false;"),n.updating=!0,f=new FormData(n),f.append("kentico_update_form","true"),r=i||document.activeElement,o=function(n){var i,f,t;n.target.response.data||(i=selectionEnd=null,r&&(r.type==="text"||r.type==="search"||r.type==="password"||r.type==="tel"||r.type==="url")&&(i=r.selectionStart,selectionEnd=r.selectionEnd),f=$(window).scrollTop(),$(u).replaceWith(n.target.responseText),$(window).scrollTop(f),r.id&&(t=document.getElementById(r.id),t&&(t.focus(),e(t,i,selectionEnd))))},t(n,f,o))}function f(n){n.preventDefault();var i=n.target,r=new FormData(i),u=function(n){var f=n.target.getResponseHeader("Content-Type"),t,r,u;f.indexOf("application/json")===-1?(t=$(window).scrollTop(),r=i.getAttribute("data-ktc-ajax-update"),$(r).replaceWith(n.target.response),$(window).scrollTop(t)):(u=JSON.parse(n.target.response),location.href=u.redirectTo)};t(i,r,u)}function t(n,t,i){var r=new XMLHttpRequest;r.addEventListener("load",i);r.open("POST",n.action);r.send(t)}function e(n,t,i){(t!==null||i!==null)&&n.setSelectionRange&&n.setSelectionRange(t,i)}function o(n,t,i){var r;return function(){var u=this,f=arguments,e=function(){r=null;i||n.apply(u,f)},o=i&&!r;clearTimeout(r);r=setTimeout(e,t||200);o&&n.apply(u,f)}}var r=800;return{registerEventListeners:u,updateForm:n,submitForm:f}}()