(self.AMP=self.AMP||[]).push({n:"amp-form",v:"2005012256000",f:(function(AMP,_){
var l,aa="function"==typeof Object.create?Object.create:function(a){function b(){}b.prototype=a;return new b},ba;if("function"==typeof Object.setPrototypeOf)ba=Object.setPrototypeOf;else{var ca;a:{var da={a:!0},ea={};try{ea.__proto__=da;ca=ea.a;break a}catch(a){}ca=!1}ba=ca?function(a,b){a.__proto__=b;if(a.__proto__!==b)throw new TypeError(a+" is not extensible");return a}:null}var fa=ba;
function n(a,b){a.prototype=aa(b.prototype);a.prototype.constructor=a;if(fa)fa(a,b);else for(var c in b)if("prototype"!=c)if(Object.defineProperties){var d=Object.getOwnPropertyDescriptor(b,c);d&&Object.defineProperty(a,c,d)}else a[c]=b[c];a.Va=b.prototype}var ha;function p(){return ha?ha:ha=Promise.resolve(void 0)};function ia(a,b){b=void 0===b?"":b;try{return decodeURIComponent(a)}catch(c){return b}};var ja=/(?:^[#?]?|&)([^=&]+)(?:=([^&]*))?/g;function q(a){var b=Object.create(null);if(!a)return b;for(var c;c=ja.exec(a);){var d=ia(c[1],c[1]),e=c[2]?ia(c[2].replace(/\+/g," "),c[2]):"";b[d]=e}return b};var ka="";
function la(){var a,b=a||self;if(b.__AMP_MODE)var c=b.__AMP_MODE;else{c=b;var d=self.AMP_CONFIG||{},e=!!d.test||!1,f=q(c.location.originalHash||c.location.hash);d=d.spt;var g=q(c.location.search);ka||(ka=c.AMP_CONFIG&&c.AMP_CONFIG.v?c.AMP_CONFIG.v:"012005012256000");c={localDev:!1,development:!!(0<=["1","actions","amp","amp4ads","amp4email"].indexOf(f.development)||c.AMP_DEV_MODE),examiner:"2"==f.development,esm:!1,geoOverride:f["amp-geo"],minified:!0,lite:void 0!=g.amp_lite,test:e,log:f.log,version:"2005012256000",
rtvVersion:ka,singlePassType:d};c=b.__AMP_MODE=c}return c};var ma=Object.prototype.toString;function na(a){return a?Array.prototype.slice.call(a):[]};var r=self.AMP_CONFIG||{},oa=("string"==typeof r.cdnProxyRegex?new RegExp(r.cdnProxyRegex):r.cdnProxyRegex)||/^https:\/\/([a-zA-Z0-9_-]+\.)?cdn\.ampproject\.org$/;function pa(a){if(!self.document||!self.document.head||self.location&&oa.test(self.location.origin))return null;var b=self.document.head.querySelector('meta[name="'+a+'"]');return b&&b.getAttribute("content")||null}
var qa={thirdParty:r.thirdPartyUrl||"https://3p.ampproject.net",thirdPartyFrameHost:r.thirdPartyFrameHost||"ampproject.net",thirdPartyFrameRegex:("string"==typeof r.thirdPartyFrameRegex?new RegExp(r.thirdPartyFrameRegex):r.thirdPartyFrameRegex)||/^d-\d+\.ampproject\.net$/,cdn:r.cdnUrl||pa("runtime-host")||"https://cdn.ampproject.org",cdnProxyRegex:oa,localhostRegex:/^https?:\/\/localhost(:\d+)?$/,errorReporting:r.errorReportingUrl||"https://us-central1-amp-error-reporting.cloudfunctions.net/r",betaErrorReporting:r.betaErrorReportingUrl||
"https://us-central1-amp-error-reporting.cloudfunctions.net/r-beta",localDev:r.localDev||!1,trustedViewerHosts:[/(^|\.)google\.(com?|[a-z]{2}|com?\.[a-z]{2}|cat)$/,/(^|\.)gmail\.(com|dev)$/],geoApi:r.geoApiUrl||pa("amp-geo-api")};self.__AMP_LOG=self.__AMP_LOG||{user:null,dev:null,userForEmbed:null};var ra=self.__AMP_LOG;function t(){if(!ra.user)throw Error("failed to call initLogConstructor");return ra.user}function v(){if(ra.dev)return ra.dev;throw Error("failed to call initLogConstructor");}function w(a,b,c,d){t().assert(a,b,c,d,void 0,void 0,void 0,void 0,void 0,void 0,void 0)};function sa(){var a,b;this.promise=new Promise(function(c,d){a=c;b=d});this.resolve=a;this.reject=b}function ta(a){return new Promise(function(b){b(a())})}function ua(){var a,b,c;this.wa=new Promise(function(a,d){b=a;c=d});this.Na=b;this.Ma=c;this.ga=0;if(a)for(var d=0;d<a.length;d++)this.add(a[d])}ua.prototype.add=function(a){var b=this,c=++this.ga;Promise.resolve(a).then(function(a){b.ga===c&&b.Na(a)},function(a){b.ga===c&&b.Ma(a)});return this.wa};
ua.prototype.then=function(a,b){return this.wa.then(a,b)};var va=Object.prototype.hasOwnProperty;function x(){var a,b=Object.create(null);a&&Object.assign(b,a);return b}function y(a){return a||{}}
function wa(a,b){var c=void 0===c?10:c;var d=[],e=[];e.push({t:a,s:b,d:0});for(a={};0<e.length;){b=e.shift();a.G=b.t;a.B=b.s;a.W=b.d;if(d.includes(a.B))throw Error("Source object has a circular reference.");d.push(a.B);a.G!==a.B&&(a.W>c?Object.assign(a.G,a.B):Object.keys(a.B).forEach(function(a){return function(b){var c=a.B[b];if(va.call(a.G,b)){var d=a.G[b];if("[object Object]"===ma.call(c)&&"[object Object]"===ma.call(d)){e.push({t:d,s:c,d:a.W+1});return}}a.G[b]=c}}(a)));a={B:a.B,G:a.G,W:a.W}}}
;function xa(){var a=100;this.Ia=a;this.fa=this.ma=0;this.Z=Object.create(null)}xa.prototype.has=function(a){return!!this.Z[a]};xa.prototype.get=function(a){var b=this.Z[a];if(b)return b.access=++this.fa,b.payload};xa.prototype.put=function(a,b){this.has(a)||this.ma++;this.Z[a]={payload:b,access:this.fa};if(!(this.ma<=this.Ia)){v().warn("lru-cache","Trimming LRU cache");a=this.Z;var c=this.fa+1,d;for(d in a){var e=a[d].access;if(e<c){c=e;var f=d}}void 0!==f&&(delete a[f],this.ma--)}};function ya(a,b){return b.length>a.length?!1:0==a.lastIndexOf(b,0)};var za=y({c:!0,v:!0,a:!0,ad:!0,action:!0}),Aa,Ba,Ca=/[?&]amp_js[^&]*/,Da=/[?&]amp_gsa[^&]*/,Ea=/[?&]amp_r[^&]*/,Fa=/[?&]amp_kit[^&]*/,Ga=/[?&]usqp[^&]*/;
function z(a){var b;Aa||(Aa=self.document.createElement("a"),Ba=self.__AMP_URL_CACHE||(self.__AMP_URL_CACHE=new xa));var c=b?null:Ba,d=Aa;if(c&&c.has(a))a=c.get(a);else{d.href=a;d.protocol||(d.href=d.href);var e={href:d.href,protocol:d.protocol,host:d.host,hostname:d.hostname,port:"0"==d.port?"":d.port,pathname:d.pathname,search:d.search,hash:d.hash,origin:null};"/"!==e.pathname[0]&&(e.pathname="/"+e.pathname);if("http:"==e.protocol&&80==e.port||"https:"==e.protocol&&443==e.port)e.port="",e.host=
e.hostname;e.origin=d.origin&&"null"!=d.origin?d.origin:"data:"!=e.protocol&&e.host?e.protocol+"//"+e.host:e.href;d=la().test&&Object.freeze?Object.freeze(e):e;c&&c.put(a,d);a=d}return a}function Ha(a,b,c){if(!b)return a;var d=a.split("#",2),e=d[0].split("?",2),f=e[0]+(e[1]?c?"?"+b+"&"+e[1]:"?"+e[1]+"&"+b:"?"+b);return f+=d[1]?"#"+d[1]:""}
function Ia(a){var b=[],c;for(c in a){var d=a[c];if(null!=d)if(Array.isArray(d))for(var e=0;e<d.length;e++){var f=d[e];b.push(encodeURIComponent(c)+"="+encodeURIComponent(f))}else e=d,b.push(encodeURIComponent(c)+"="+encodeURIComponent(e))}return b.join("&")}function Ja(a){"string"==typeof a&&(a=z(a));return qa.cdnProxyRegex.test(a.origin)};function Ka(a,b){if(a.__AMP__EXPERIMENT_TOGGLES)var c=a.__AMP__EXPERIMENT_TOGGLES;else{a.__AMP__EXPERIMENT_TOGGLES=Object.create(null);c=a.__AMP__EXPERIMENT_TOGGLES;if(a.AMP_CONFIG)for(var d in a.AMP_CONFIG){var e=a.AMP_CONFIG[d];"number"===typeof e&&0<=e&&1>=e&&(c[d]=Math.random()<e)}if(a.AMP_CONFIG&&Array.isArray(a.AMP_CONFIG["allow-doc-opt-in"])&&0<a.AMP_CONFIG["allow-doc-opt-in"].length&&(d=a.AMP_CONFIG["allow-doc-opt-in"],e=a.document.head.querySelector('meta[name="amp-experiments-opt-in"]'))){e=
e.getAttribute("content").split(",");for(var f=0;f<e.length;f++)-1!=d.indexOf(e[f])&&(c[e[f]]=!0)}Object.assign(c,La(a));if(a.AMP_CONFIG&&Array.isArray(a.AMP_CONFIG["allow-url-opt-in"])&&0<a.AMP_CONFIG["allow-url-opt-in"].length)for(d=a.AMP_CONFIG["allow-url-opt-in"],a=q(a.location.originalHash||a.location.hash),e=0;e<d.length;e++)f=a["e-"+d[e]],"1"==f&&(c[d[e]]=!0),"0"==f&&(c[d[e]]=!1)}var g=c;return!!g[b]}
function La(a){var b="";try{"localStorage"in a&&(b=a.localStorage.getItem("amp-experiment-toggles"))}catch(e){v().warn("EXPERIMENTS","Failed to retrieve experiments from localStorage.")}var c=b?b.split(/\s*,\s*/g):[];a=Object.create(null);for(var d=0;d<c.length;d++)0!=c[d].length&&("-"==c[d][0]?a[c[d].substr(1)]=!1:a[c[d]]=!0);return a};var Ma={},A=(Ma["ampdoc-fie"]={isTrafficEligible:function(){return!0},branches:[["21065001"],["21065002"]]},Ma);function B(a,b){var c=a.ownerDocument.defaultView,d=c.__AMP_TOP||(c.__AMP_TOP=c),e=c!=d;var f=d;if(Ka(f,"ampdoc-fie")){f.__AMP_EXPERIMENT_BRANCHES=f.__AMP_EXPERIMENT_BRANCHES||{};for(var g in A)if(va.call(A,g)&&!va.call(f.__AMP_EXPERIMENT_BRANCHES,g))if(A[g].isTrafficEligible&&A[g].isTrafficEligible(f)){if(!f.__AMP_EXPERIMENT_BRANCHES[g]&&Ka(f,g)){var h=A[g].branches;f.__AMP_EXPERIMENT_BRANCHES[g]=h[Math.floor(Math.random()*h.length)]||null}}else f.__AMP_EXPERIMENT_BRANCHES[g]=null;f="21065002"===
(f.__AMP_EXPERIMENT_BRANCHES?f.__AMP_EXPERIMENT_BRANCHES["ampdoc-fie"]:null)}else f=!1;var k=f;e&&!k?b=Na(c,b)?C(c,b):null:(a=D(a),a=E(a),b=Na(a,b)?C(a,b):null);return b}function F(a,b){a=a.__AMP_TOP||(a.__AMP_TOP=a);return C(a,b)}function G(a,b){var c=D(a);c=E(c);return C(c,b)}function Oa(a,b){return Pa(E(a),b)}function D(a){return a.nodeType?F((a.ownerDocument||a).defaultView,"ampdoc").getAmpDoc(a):a}function E(a){a=D(a);return a.isSingleDoc()?a.win:a}
function C(a,b){Na(a,b);var c=Qa(a);a=c[b];a.obj||(a.obj=new a.ctor(a.context),a.ctor=null,a.context=null,a.resolve&&a.resolve(a.obj));return a.obj}function Ra(a,b){var c=Pa(a,b);if(c)return c;a=Qa(a);a[b]=Sa();return a[b].promise}function Pa(a,b){var c=Qa(a)[b];if(c){if(c.promise)return c.promise;C(a,b);return c.promise=Promise.resolve(c.obj)}return null}function Qa(a){var b=a.__AMP_SERVICES;b||(b=a.__AMP_SERVICES={});return b}
function Na(a,b){a=a.__AMP_SERVICES&&a.__AMP_SERVICES[b];return!(!a||!a.ctor&&!a.obj)}function Sa(){var a=new sa,b=a,c=b.promise,d=b.resolve;b=b.reject;c.catch(function(){});return{obj:null,promise:c,resolve:d,reject:b,context:null,ctor:null}};/*
 https://mths.be/cssescape v1.5.1 by @mathias | MIT license */
var Ta=/(\0)|^(-)$|([\x01-\x1f\x7f]|^-?[0-9])|([\x80-\uffff0-9a-zA-Z_-]+)|[^]/g;function Ua(a,b,c,d,e){return e?e:b?"\ufffd":d?a.slice(0,-1)+"\\"+a.slice(-1).charCodeAt(0).toString(16)+" ":"\\"+a};var Va;function Wa(a,b){for(var c=[],d=a.parentElement;d;d=d.parentElement)b(d)&&c.push(d);return c}function Xa(a){var b="fieldset";/^[\w-]+$/.test(b);b=b.toUpperCase();return Wa(a,function(a){return a.tagName==b})}function H(a,b){for(var c=a.length,d=0;d<c;d++)b(a[d],d)};function Ya(a,b,c){var d=Oa(a,b);if(d)return d;var e=D(a);return e.waitForBodyOpen().then(function(){var a=e.win;var b=e.win.document.head;if(b){var d={};b=b.querySelectorAll("script[custom-element],script[custom-template]");for(var k=0;k<b.length;k++){var m=b[k];m=m.getAttribute("custom-element")||m.getAttribute("custom-template");d[m]=!0}d=Object.keys(d)}else d=[];a=d.includes(c)?F(a,"extensions").waitForExtension(a,c):p();return a}).then(function(){var d=e.win;return d.__AMP_EXTENDED_ELEMENTS&&
d.__AMP_EXTENDED_ELEMENTS[c]?Ra(E(a),b):null})};function I(a){return G(a,"mutator")};var Za,$a="Webkit webkit Moz moz ms O o".split(" ");function ab(a,b,c){var d;var e=a.style;if(!ya(b,"--")){Za||(Za=x());var f=Za[b];if(!f){f=b;if(void 0===e[b]){var g=b.charAt(0).toUpperCase()+b.slice(1);b:{for(var h=0;h<$a.length;h++){var k=$a[h]+g;if(void 0!==e[k]){g=k;break b}}g=""}void 0!==e[g]&&(f=g)}Za[b]=f}b=f}if(b){var m=d?c+d:c;ya(b,"--")?a.style.setProperty(b,m):a.style[b]=m}}
function bb(a,b){void 0===b&&(b=a.hasAttribute("hidden"));b?a.removeAttribute("hidden"):a.setAttribute("hidden","")};var J;function cb(a,b,c){var d=void 0,e=a,f=c;var g=function(a){try{return f(a)}catch(u){throw self.__AMP_REPORT_ERROR(u),u;}};var h=db(),k=!1;d&&(k=d.capture);e.addEventListener(b,g,h?d:k);return function(){e&&e.removeEventListener(b,g,h?d:k);g=e=f=null}}function db(){if(void 0!==J)return J;J=!1;try{var a={get capture(){J=!0}};self.addEventListener("test-options",null,a);self.removeEventListener("test-options",null,a)}catch(b){}return J};function K(a,b,c,d){var e={detail:c};Object.assign(e,d);if("function"==typeof a.CustomEvent)return new a.CustomEvent(b,e);a=a.document.createEvent("CustomEvent");a.initCustomEvent(b,!!e.bubbles,!!e.cancelable,c);return a}function eb(a,b,c){return cb(a,b,c)}function fb(a,b){var c=b,d=cb(a,"mouseup",function(a){try{c(a)}finally{c=null,d()}});return d}function gb(a){var b,c,d=new Promise(function(b){c=fb(a,b)});d.then(c,c);b&&b(c);return d};function hb(a,b){function c(c){g=null;f=a.setTimeout(d,e);b.apply(null,c)}function d(){f=0;g&&c(g)}var e=100,f=0,g=null;return function(a){for(var b=[],d=0;d<arguments.length;++d)b[d-0]=arguments[d];f?g=b:c(b)}};function ib(a){var b=a.getRootNode();this.Ja=b.ownerDocument||b;this.j=this.Ja.defaultView;this.oa=G(a,"viewport");this.S=[];this.S.push(eb(b,"input",function(a){a=a.target;"TEXTAREA"==a.tagName&&a.hasAttribute("autoexpand")&&kb(a)}));this.S.push(eb(b,"mousedown",function(a){1==a.which&&(a=a.target,"TEXTAREA"==a.tagName&&lb(a))}));var c=b.querySelectorAll("textarea");this.S.push(eb(b,"amp:dom-update",function(){c=b.querySelectorAll("textarea")}));var d=hb(this.j,function(a){a.relayoutAll&&mb(c)});
this.S.push(this.oa.onResize(d));nb(c)}function ob(a){function b(){var b=c.querySelector("textarea[autoexpand]");b&&!d?d=new ib(a):!b&&d&&(d.dispose(),d=null)}var c=a.getRootNode(),d=null;cb(c,"amp:dom-update",b);b()}ib.prototype.dispose=function(){this.S.forEach(function(a){return a()})};
function nb(a){Promise.all(na(a).map(function(a){return pb(a).then(function(b){b&&(t().warn("AMP-FORM",'"textarea[autoexpand]" with initially scrolling content will not autoexpand.\nSee https://github.com/ampproject/amphtml/issues/20839'),a.removeAttribute("autoexpand"))})}))}function pb(a){var b=I(a);return b.measureElement(function(){return a.scrollHeight>a.clientHeight})}function mb(a){H(a,function(a){"TEXTAREA"==a.tagName&&a.hasAttribute("autoexpand")&&kb(a)})}
function lb(a){var b=I(a);Promise.all([b.measureElement(function(){return a.scrollHeight}),gb(a)]).then(function(c){var d=c[0],e=0;return b.measureMutateElement(a,function(){e=a.scrollHeight},function(){d!=e&&a.removeAttribute("autoexpand")})})}
function kb(a){var b=I(a),c=a.ownerDocument.defaultView,d=0,e=0,f=0,g=qb(a);b.measureMutateElement(a,function(){var b=c.getComputedStyle(a)||x();e=a.scrollHeight;var g=parseInt(b.getPropertyValue("max-height"),10);f=isNaN(g)?Infinity:g;d="content-box"==b.getPropertyValue("box-sizing")?-parseInt(b.getPropertyValue("padding-top"),10)+-parseInt(b.getPropertyValue("padding-bottom"),10):parseInt(b.getPropertyValue("border-top-width"),10)+parseInt(b.getPropertyValue("border-bottom-width"),10)},function(){return g.then(function(b){a.classList.toggle("i-amphtml-textarea-max",
b+d>f);var c="iAmphtmlHasExpanded"in a.dataset,g=c||e<=b;g&&(a.dataset.iAmphtmlHasExpanded="",ab(a,"height",b+d+"px"))})})}
function qb(a){var b=a.ownerDocument,c=b.defaultView,d=b.body,e=I(a),f=a.cloneNode(!1);f.classList.add("i-amphtml-textarea-clone");var g=0,h=0,k=!1;return e.measureMutateElement(d,function(){var b=c.getComputedStyle(a)||x(),d=parseInt(b.getPropertyValue("max-height"),10);g=parseInt(b.getPropertyValue("width"),10);k=isNaN(d)||a.scrollHeight<d},function(){k&&(a.scrollTop=0);ab(f,"width",g+"px");b.body.appendChild(f)}).then(function(){return e.measureMutateElement(d,function(){h=f.scrollHeight},function(){var a=
f;a.parentElement&&a.parentElement.removeChild(a)})}).then(function(){return h})};function L(a){for(var b=a.elements,c={},d=/^(?:input|select|textarea)$/i,e=/^(?:submit|button|image|file|reset)$/i,f=/^(?:checkbox|radio)$/i,g={},h=0;h<b.length;g={F:g.F},h++){var k=b[h],m=k,u=m.checked;g.F=m.name;var kc=m.multiple,lc=m.options,mc=m.tagName,jb=m.type;m=m.value;!g.F||rb(k)||!d.test(mc)||e.test(jb)||f.test(jb)&&!u||(void 0===c[g.F]&&(c[g.F]=[]),kc?H(lc,function(a){return function(b){b.selected&&c[a.F].push(b.value)}}(g)):c[g.F].push(m))}var U=sb(a);U&&U.name&&(a=U.name,void 0===c[a]&&
(c[a]=[]),c[U.name].push(U.value));Object.keys(c).forEach(function(a){0==c[a].length&&delete c[a]});return c}function sb(a){var b=a.elements,c=b.length,d=a.ownerDocument.activeElement,e=null;for(a=0;a<c;a++){var f=b[a],g=f.type;if("BUTTON"==f.tagName||"submit"==g)if(e||(e=f),d==f)return d}return e}function rb(a){if(a.disabled)return!0;a=Xa(a);for(var b=0;b<a.length;b++)if(a[b].disabled)return!0;return!1}
function tb(a){switch(a.type){case "select-multiple":case "select-one":a=a.options;for(var b=0;b<a.length;b++)if(a[b].selected!==a[b].defaultSelected)return!1;break;case "checkbox":case "radio":return a.checked===a.defaultChecked;default:return a.value===a.defaultValue}return!0};function ub(a,b){return a.hasAttribute("verify-xhr")?new vb(a,b):new wb(a)}function M(a){this.h=a}M.prototype.onCommit=function(){xb(this);a:{var a=this.h.elements;for(var b=0;b<a.length;b++){var c=a[b];if(!c.disabled&&!tb(c)){a=!0;break a}}a=!1}return a?this.Aa():Promise.resolve({updatedElements:[],errors:[]})};M.prototype.Aa=function(){return Promise.resolve({updatedElements:[],errors:[]})};function xb(a){(a=a.h.elements)&&H(a,function(a){a.setCustomValidity("")})}
function wb(){M.apply(this,arguments)}n(wb,M);function vb(a,b){this.h=a;this.aa=b;this.V=null;this.va=[]}n(vb,M);vb.prototype.Aa=function(){var a=this,b=this.aa().then(function(){return[]},function(a){return yb(a)});return zb(this,b).then(function(b){return Ab(a,b)})};function zb(a,b){if(!a.V){a.V=new ua;var c=function(){return a.V=null};a.V.then(c,c)}return a.V.add(b)}
function Ab(a,b){function c(a){return b.every(function(b){return a.name!==b.name})}var d=[],e=a.va;a.va=b;for(var f=0;f<b.length;f++){var g=b[f],h=t().assertString(g.name,"Verification errors must have a name property");g=t().assertString(g.message,"Verification errors must have a message property");h=t().assertElement(a.h.querySelector('[name="'+h+'"]'),"Verification error name property must match a field name");h.checkValidity()&&(h.setCustomValidity(g),d.push(h))}var k=e.filter(c).map(function(b){return a.h.querySelector('[name="'+
b.name+'"]')});return{updatedElements:d.concat(k),errors:b}}function yb(a){return(a=a.response)?a.json().then(function(a){return a.verifyErrors||[]},function(){return[]}):Promise.resolve([])};function Bb(a,b){var c=F(a,"platform");return c.isIos()&&11==c.getMajorVersion()?new Cb(b):FormData.prototype.entries&&FormData.prototype.delete?new N(b):new O(b)}function O(a){this.C=a?L(a):x()}O.prototype.append=function(a,b){var c=String(a);this.C[c]=this.C[c]||[];this.C[c].push(String(b))};O.prototype.delete=function(a){delete this.C[a]};
O.prototype.entries=function(){var a=this,b=[];Object.keys(this.C).forEach(function(c){a.C[c].forEach(function(a){return b.push([c,a])})});var c=0;return{next:function(){return c<b.length?{value:b[c++],done:!1}:{value:void 0,done:!0}}}};O.prototype.getFormData=function(){var a=this,b=new FormData;Object.keys(this.C).forEach(function(c){a.C[c].forEach(function(a){return b.append(c,a)})});return b};function N(a){this.D=new FormData(a);a&&(a=sb(a))&&a.name&&this.append(a.name,a.value)}
N.prototype.append=function(a,b){this.D.append(a,b)};N.prototype.delete=function(a){this.D.delete(a)};N.prototype.entries=function(){return this.D.entries()};N.prototype.getFormData=function(){return this.D};function Cb(a){N.call(this,a);var b=this;a&&H(a.elements,function(a){"file"==a.type&&0==a.files.length&&(b.D.delete(a.name),b.D.append(a.name,new Blob([]),""))})}n(Cb,N);
Cb.prototype.append=function(a,b,c){b&&"object"==typeof b&&""==b.name&&0==b.size?this.D.append(a,new Blob([]),c||""):this.D.append(a,b)};var Db={INPUT:!0,SELECT:!0,TEXTAREA:!0};function Eb(a,b){this.h=a;this.j=b;this.P=0;this.K=x();this.na=null;this.Ca=this.ca=!1;this.la();for(a=0;a<this.h.elements.length;++a)Fb(this,this.h.elements[a]);P(this)}l=Eb.prototype;l.onSubmitting=function(){this.ca=!0;P(this)};l.onSubmitError=function(){this.ca=!1;P(this)};l.onSubmitSuccess=function(){this.ca=!1;this.na=Bb(this.j,this.h).getFormData();this.K=x();this.P=0;P(this)};
function P(a){var b=0<a.P&&!a.ca;if(b!==a.Ca){a.h.classList.toggle("amp-form-dirty",b);var c=K(a.j,"amp:form-dirtiness-change",y({isDirty:b}),{bubbles:!0});a.h.dispatchEvent(c)}a.Ca=b}l.la=function(){this.h.addEventListener("input",this.ua.bind(this));this.h.addEventListener("reset",this.La.bind(this));this.h.addEventListener("amp:form-value-change",this.ua.bind(this))};l.ua=function(a){Fb(this,a.target);P(this)};l.La=function(){this.K=x();this.P=0;P(this)};
function Fb(a,b){var c=b.hidden;if(Db[b.tagName]&&b.name&&!c&&!rb(b)){a:switch(b.tagName){case "INPUT":c="checkbox"==b.type||"radio"==b.type?!b.checked:!b.value;break a;case "TEXTAREA":c=!b.value;break a;case "SELECT":c=!1;break a;default:throw Error("isFieldEmpty: "+b.tagName+" is not a supported field element.");}(c=c||tb(b))||(a.na?(c=b.value,c=a.na.get(b.name)===c):c=!1);c?(b=b.name,a.K[b]&&(a.K[b]=!1,--a.P)):(b=b.name,a.K[b]||(a.K[b]=!0,++a.P))}};function Gb(){this.o=null}l=Gb.prototype;l.add=function(a){var b=this;this.o||(this.o=[]);this.o.push(a);return function(){b.remove(a)}};l.remove=function(a){this.o&&(a=this.o.indexOf(a),-1<a&&this.o.splice(a,1))};l.removeAll=function(){this.o&&(this.o.length=0)};l.fire=function(a){if(this.o)for(var b=this.o,c=0;c<b.length;c++)(0,b[c])(a)};l.getHandlerCount=function(){return this.o?this.o.length:0};function Hb(){this.ta=new Gb}Hb.prototype.beforeSubmit=function(a){return this.ta.add(a)};Hb.prototype.fire=function(a){this.ta.fire(a)};var Ib=["GET","POST"];function Jb(a){var b=a.getAttribute("crossorigin");return b&&"amp-viewer-auth-token-via-post"===b.trim()?Ya(a,"amp-viewer-assistance","amp-viewer-assistance").then(function(a){w(a,'crossorigin="amp-viewer-auth-token-post" requires amp-viewer-assistance extension.');return a.getIdTokenPromise()}).then(function(a){return a||""}).catch(function(){return""}):Promise.resolve(void 0)};function Q(a,b){var c="amp-form";this.L=a;this.A=b;this.Oa=c}Q.prototype.isEnabled=function(){var a=this.L.getAmpDoc();return a.isSingleDoc()&&a.getRootNode().documentElement.hasAttribute("allow-viewer-render-template")?this.L.hasCapability("viewerRenderTemplate"):!1};Q.prototype.assertTrustedViewer=function(a){return this.L.isTrustedViewer().then(function(b){w(b,"Refused to attempt SSR in untrusted viewer: ",a)})};
Q.prototype.ssr=function(a,b,c,d){var e=this;c=void 0===c?null:c;d=void 0===d?{}:d;var f;c||(f=this.A.maybeFindTemplate(a));return this.assertTrustedViewer(a).then(function(){return e.L.sendMessageAwaitResponse("viewerRenderTemplate",Kb(e,b,f,c,d))})};
Q.prototype.applySsrOrCsrTemplate=function(a,b){var c=this;if(this.isEnabled()){w("string"===typeof b.html,"Server side html response must be defined");var d=this.assertTrustedViewer(a).then(function(){return c.A.findAndSetHtmlForTemplate(a,b.html)})}else d=Array.isArray(b)?this.A.findAndRenderTemplateArray(a,b):this.A.findAndRenderTemplate(a,b);return d};
function Kb(a,b,c,d,e){e=void 0===e?{}:e;var f=y({type:a.Oa}),g="successTemplate",h=d&&d[g]?d[g]:c;h&&(f[g]={type:"amp-mustache",payload:h.innerHTML});var k="errorTemplate",m=d&&d[k]?d[k]:null;m&&(f[k]={type:"amp-mustache",payload:m.innerHTML});e&&Object.assign(f,e);a=b.xhrUrl;c=b.fetchOpt;b=Object.assign({},c);if((d=c.body)&&"function"==typeof d.getFormData){c=c.body;b.headers["Content-Type"]="multipart/form-data;charset=utf-8";c=c.entries();d=[];for(e=c.next();!e.done;e=c.next())d.push(e.value);
b.body=d}return y({originalRequest:{input:a,init:b},ampComponent:f})};function Lb(a,b){this.ka=b;this.oa=G(a,"viewport");this.Ba=F(a.win,"vsync");this.ia=null;this.ha="";this.da=!1;this.J=a.win.document.createElement("div");bb(this.J,!1);this.J.classList.add("i-amphtml-validation-bubble");this.J.__BUBBLE_OBJ=this;a.getBody().appendChild(this.J)}Lb.prototype.isActiveOn=function(a){return this.da&&a==this.ia};Lb.prototype.hide=function(){this.da&&(this.da=!1,this.ia=null,this.ha="",this.Ba.run({measure:void 0,mutate:Mb},{bubbleElement:this.J}))};
Lb.prototype.show=function(a,b){if(!this.isActiveOn(a)||b!=this.ha){this.da=!0;this.ia=a;this.ha=b;var c={message:b,targetElement:a,bubbleElement:this.J,viewport:this.oa,id:this.ka};this.Ba.run({measure:Nb,mutate:Ob},c)}};function Mb(a){a.bubbleElement.removeAttribute("aria-alert");a.bubbleElement.removeAttribute("role");for(var b=a.bubbleElement;b.firstChild;)b.removeChild(b.firstChild);bb(a.bubbleElement,!1)}function Nb(a){a.targetRect=a.viewport.getLayoutRect(a.targetElement)}
function Ob(a){for(var b=a.bubbleElement;b.firstChild;)b.removeChild(b.firstChild);var c=a.bubbleElement.ownerDocument.createElement("div");c.id="bubble-message-"+a.id;c.textContent=a.message;a.bubbleElement.setAttribute("aria-labeledby",c.id);a.bubbleElement.setAttribute("role","alert");a.bubbleElement.setAttribute("aria-live","assertive");a.bubbleElement.appendChild(c);bb(a.bubbleElement,!0);b=a.bubbleElement;a={top:a.targetRect.top-10+"px",left:a.targetRect.left+a.targetRect.width/2+"px"};for(var d in a)ab(b,
d,a[d])};var Pb,Qb,Rb=0;function R(a){this.form=a;this.ampdoc=D(a);this.mutator=I(a);this.root=this.ampdoc.getRootNode();this.ba=null}l=R.prototype;l.report=function(){};l.onBlur=function(){};l.onInput=function(){};l.inputs=function(){return this.form.querySelectorAll("input,select,textarea")};
l.checkInputValidity=function(a){if("TEXTAREA"===a.tagName&&a.hasAttribute("pattern")&&(a.checkValidity()||"Please match the requested format."===a.validationMessage)){var b=a.getAttribute("pattern"),c=new RegExp("^"+b+"$","m"),d=c.test(a.value);a.setCustomValidity(d?"":"Please match the requested format.")}return a.checkValidity()};l.checkFormValidity=function(a){Sb(this,a);return a.checkValidity()};l.reportFormValidity=function(a){Sb(this,a);return a.reportValidity()};
function Sb(a,b){H(b.elements,function(b){"TEXTAREA"==b.tagName&&a.checkInputValidity(b)})}l.fireValidityEventIfNecessary=function(){var a=this.ba;this.ba=this.checkFormValidity(this.form);if(a!==this.ba){var b=K(this.form.ownerDocument.defaultView,this.ba?"valid":"invalid",null,{bubbles:!0});this.form.dispatchEvent(b)}};function Tb(){R.apply(this,arguments)}n(Tb,R);Tb.prototype.report=function(){this.reportFormValidity(this.form);this.fireValidityEventIfNecessary()};
function S(a){R.call(this,a);var b="i-amphtml-validation-bubble-"+Rb++;this.T=new Lb(this.ampdoc,b)}n(S,R);S.prototype.report=function(){for(var a=this.inputs(),b=0;b<a.length;b++)if(!this.checkInputValidity(a[b])){a[b].focus();this.T.show(a[b],a[b].validationMessage);break}this.fireValidityEventIfNecessary()};S.prototype.onBlur=function(a){"submit"!=a.target.type&&this.T.hide()};
S.prototype.onInput=function(a){a=a.target;this.T.isActiveOn(a)&&(this.checkInputValidity(a)?(a.removeAttribute("aria-invalid"),this.T.hide()):(a.setAttribute("aria-invalid","true"),this.T.show(a,a.validationMessage)))};function T(a){R.call(this,a);this.Ra=this.form.id?this.form.id:String(Date.now()+Math.floor(100*Math.random()));this.Ha=0}n(T,R);l=T.prototype;l.reportInput=function(a){var b=Ub(a);b&&this.showValidationFor(a,b)};l.hideAllValidations=function(){for(var a=this.inputs(),b=0;b<a.length;b++)this.hideValidationFor(a[b])};
l.getValidationFor=function(a,b){if(!a.id)return null;var c=b;var d=a.validationMessage;c="TEXTAREA"===a.tagName&&"customError"===c&&"Please match the requested format."===d?"patternMismatch":c;d="__AMP_VALIDATION_"+c;d in a||(a[d]=this.root.querySelector("[visible-when-invalid="+c+"][validation-for="+(a.id+"]")));return a[d]};
l.showValidationFor=function(a,b){var c=this.getValidationFor(a,b);if(c){c.textContent.trim()||(c.textContent=a.validationMessage);a.__AMP_VISIBLE_VALIDATION=c;var d=c.getAttribute("id");d||(d="i-amphtml-aria-desc-"+this.Ra+"-"+this.Ha++,c.setAttribute("id",d));a.setAttribute("aria-invalid","true");a.setAttribute("aria-describedby",d);this.mutator.mutateElement(c,function(){return c.classList.add("visible")})}};
l.hideValidationFor=function(a){var b=this.getVisibleValidationFor(a);b&&(delete a.__AMP_VISIBLE_VALIDATION,a.removeAttribute("aria-invalid"),a.removeAttribute("aria-describedby"),this.mutator.mutateElement(b,function(){return b.classList.remove("visible")}))};l.getVisibleValidationFor=function(a){return a.__AMP_VISIBLE_VALIDATION};l.shouldValidateOnInteraction=function(){throw Error("Not Implemented");};
l.onInteraction=function(a){a=a.target;var b=!!a.checkValidity&&this.shouldValidateOnInteraction(a);this.hideValidationFor(a);b&&!this.checkInputValidity(a)&&this.reportInput(a)};l.onBlur=function(a){this.onInteraction(a)};l.onInput=function(a){this.onInteraction(a)};function Vb(){T.apply(this,arguments)}n(Vb,T);Vb.prototype.report=function(){this.hideAllValidations();for(var a=this.inputs(),b=0;b<a.length;b++)if(!this.checkInputValidity(a[b])){this.reportInput(a[b]);a[b].focus();break}this.fireValidityEventIfNecessary()};
Vb.prototype.shouldValidateOnInteraction=function(a){return!!this.getVisibleValidationFor(a)};function V(){T.apply(this,arguments)}n(V,T);V.prototype.report=function(){this.hideAllValidations();for(var a=null,b=this.inputs(),c=0;c<b.length;c++)this.checkInputValidity(b[c])||(a=a||b[c],this.reportInput(b[c]));a&&a.focus();this.fireValidityEventIfNecessary()};V.prototype.shouldValidateOnInteraction=function(a){return!!this.getVisibleValidationFor(a)};function Wb(){T.apply(this,arguments)}n(Wb,T);
Wb.prototype.shouldValidateOnInteraction=function(){return!0};Wb.prototype.onInteraction=function(a){T.prototype.onInteraction.call(this,a);this.fireValidityEventIfNecessary()};function Xb(){V.apply(this,arguments)}n(Xb,V);Xb.prototype.shouldValidateOnInteraction=function(){return!0};Xb.prototype.onInteraction=function(a){V.prototype.onInteraction.call(this,a);this.fireValidityEventIfNecessary()};
function Yb(a){var b=a.getAttribute("custom-validation-reporting");switch(b){case "as-you-go":return new Wb(a);case "show-all-on-submit":return new V(a);case "interact-and-submit":return new Xb(a);case "show-first-on-submit":return new Vb(a)}a.ownerDocument&&void 0===Pb&&(Pb=!!document.createElement("form").reportValidity);return Pb?new Tb(a):new S(a)}
function Ub(a){var b=["badInput"];for(c in a.validity)b.includes(c)||b.push(c);var c=b.filter(function(b){return!0===a.validity[b]});return c.length?c[0]:null};function Zb(a){var b=a.ownerDocument.defaultView;b.FormProxy||(b.FormProxy=$b(b));var c=b.FormProxy,d=new c(a);"action"in d||ac(a,d);a.$p=d}
function $b(a){function b(a){this.h=a}var c=b.prototype,d=a.Object,e=d.prototype,f=[a.HTMLFormElement,a.EventTarget],g=f.reduce(function(a,b){for(b=b&&b.prototype;b&&b!==e&&!(0<=a.indexOf(b));)a.push(b),b=d.getPrototypeOf(b);return a},[]);g.forEach(function(b){var d={},f;for(f in b){d.w=a.Object.getOwnPropertyDescriptor(b,f);if(d.w&&f.toUpperCase()!=f&&!ya(f,"on")&&!e.hasOwnProperty.call(c,f))if("function"==typeof d.w.value)d.ea=d.w.value,c[f]=function(a){return function(){return a.ea.apply(this.h,
arguments)}}(d);else{var g={};d.w.get&&(g.get=function(a){return function(){return a.w.get.call(this.h)}}(d));d.w.set&&(g.set=function(a){return function(b){return a.w.set.call(this.h,b)}}(d));a.Object.defineProperty(c,f,g)}d={ea:d.ea,w:d.w}}});return b}
function ac(a,b){var c=a.ownerDocument.defaultView.HTMLFormElement.prototype.cloneNode.call(a,!1),d={},e;for(e in c){d.l=e;if(!(d.l in b||d.l.toUpperCase()==d.l||ya(d.l,"on"))){d.m=bc[d.l];var f=a[d.l];if(d.m)if(d.m.access==W){d.N=void 0;if(f&&f.nodeType){var g=c=f,h=g.nextSibling;g=g.parentNode;g.removeChild(c);try{d.N=a[d.l]}finally{g.insertBefore(c,h)}}else d.N=f;Object.defineProperty(b,d.l,{get:function(a){return function(){return a.N}}(d)})}else d.m.access==X&&(d.O=d.m.attr||d.l,Object.defineProperty(b,
d.l,{get:function(c){return function(){var d=b.getAttribute(c.O);return null==d&&void 0!==c.m.def?c.m.def:c.m.type==cc?"true"===d:c.m.type==dc?null!=d:c.m.type==ec?(d=d||"",B(a,"url").parse(d).href):d}}(d),set:function(a){return function(c){a.m.type==dc&&(c=c?"":null);null!=c?b.setAttribute(a.O,c):b.removeAttribute(a.O)}}(d)}));else Object.defineProperty(b,d.l,{get:function(b){return function(){return a[b.l]}}(d),set:function(b){return function(c){a[b.l]=c}}(d)})}d={N:d.N,O:d.O,m:d.m,l:d.l}}}
var X=1,W=2,ec=1,cc=2,dc=3,bc={acceptCharset:{access:X,attr:"accept-charset"},accessKey:{access:X,attr:"accesskey"},action:{access:X,type:ec},attributes:{access:W},autocomplete:{access:X,def:"on"},children:{access:W},dataset:{access:W},dir:{access:X},draggable:{access:X,type:cc,def:!1},elements:{access:W},encoding:{access:W},enctype:{access:X},hidden:{access:X,type:dc,def:!1},id:{access:X,def:""},lang:{access:X},localName:{access:W},method:{access:X,def:"get"},name:{access:X},noValidate:{access:X,
attr:"novalidate",type:dc,def:!1},prefix:{access:W},spellcheck:{access:X},style:{access:W},target:{access:X,def:""},title:{access:X},translate:{access:X}};function fc(a,b){var c='form.amp-form-submit-error [submit-error],form.amp-form-submit-success [submit-success],form.amp-form-submitting [submitting]{display:block}textarea[autoexpand]:not(.i-amphtml-textarea-max){overflow:hidden!important}.i-amphtml-textarea-clone{visibility:hidden;position:absolute;top:-9999px;left:-9999px;height:0!important}.i-amphtml-validation-bubble{transform:translate(-50%,-100%);background-color:#fff;box-shadow:0 5px 15px 0 rgba(0,0,0,0.5);max-width:200px;position:absolute;display:block;box-sizing:border-box;padding:10px;border-radius:5px}.i-amphtml-validation-bubble:after{content:" ";position:absolute;bottom:-8px;left:30px;width:0;height:0;border-left:8px solid transparent;border-right:8px solid transparent;border-top:8px solid #fff}[visible-when-invalid]{color:red}\n/*# sourceURL=/extensions/amp-form/0.1/amp-form.css*/',
d=!1,e="amp-form",f=a.getHeadNode(),g=gc(f,hc(f,c),d||!1,e||null);if(b){var h=a.getRootNode();if(ic(h,g))b(g);else var k=setInterval(function(){ic(h,g)&&(clearInterval(k),b(g))},4)}}
function gc(a,b,c,d){var e=a.__AMP_CSS_SM;e||(e=a.__AMP_CSS_SM=x());var f=!c&&d&&"amp-custom"!=d&&"amp-keyframes"!=d,g=c?"amp-runtime":f?"amp-extension="+d:null;if(g){var h=jc(a,e,g);if(h)return h.textContent!==b&&(h.textContent=b),h}var k=(a.ownerDocument||a).createElement("style");k.textContent=b;var m=null;c?k.setAttribute("amp-runtime",""):f?(k.setAttribute("amp-extension",d||""),m=jc(a,e,"amp-runtime")):(d&&k.setAttribute(d,""),m=a.lastChild);b=m;(b=void 0===b?null:b)?a.insertBefore(k,b.nextSibling):
a.insertBefore(k,a.firstChild);g&&(e[g]=k);return k}function jc(a,b,c){return b[c]?b[c]:(a=a.querySelector("style["+c+"]"))?b[c]=a:null}function hc(a,b){return(a=a.__AMP_CSS_TR)?a(b):b}function ic(a,b){var c=a.styleSheets;for(a=0;a<c.length;a++){var d=c[a];if(d.ownerNode==b)return!0}return!1};function nc(a){var b=["\u26a14email","amp4email"],c=a.documentElement,d=b.some(function(a){return c.hasAttribute(a)});return d};function oc(a,b,c){Ya(a,"amp-analytics-instrumentation","amp-analytics").then(function(d){d&&d.triggerEventForTarget(a,b,c)})};function pc(a,b){try{return JSON.parse(a)}catch(c){return b&&b(c),null}};var qc=["amp-selector"];
function rc(a,b){var c=this;try{Zb(a)}catch(f){v().error("amp-form","form proxy failed to install",f)}a.__AMP_FORM=this;this.ka=b;this.j=a.ownerDocument.defaultView;this.Qa=F(this.j,"timer");this.za=B(a,"url-replace");this.ja=null;this.h=a;this.Ga=D(this.h);this.A=F(this.j,"templates");this.pa=F(this.j,"xhr");this.Y=B(this.h,"action");this.sa=I(this.h);this.L=G(this.h,"viewer");this.R=new Q(this.L,this.A);this.H=(this.h.getAttribute("method")||"GET").toUpperCase();this.Pa=this.h.getAttribute("target");
this.M=sc(this,"action-xhr");this.Ta=sc(this,"verify-xhr");this.Ka=tc(this);this.ya=!this.h.hasAttribute("novalidate");this.h.setAttribute("novalidate","");this.ya||this.h.setAttribute("amp-novalidate","");this.h.classList.add("i-amphtml-form");this.I="initial";b=this.h.elements;for(var d=0;d<b.length;d++){var e=b[d].name;w("__amp_source_origin"!=e&&"__amp_form_verify"!=e,"Illegal input name, %s found: %s",e,b[d])}this.$=new Eb(this.h,this.j);this.U=Yb(this.h);this.Sa=ub(this.h,function(){return uc(c)});
this.Y.installActionHandler(this.h,this.Fa.bind(this));this.la();vc(this);wc(this);this.qa=this.xa=this.Ea=null;Ra(E(a),"form-submit-service").then(function(a){c.qa=a})}function sc(a,b){var c=a.h.getAttribute(b);if(c){var d=B(a.h,"url");d.assertHttpsUrl(c,a.h,b);w(!d.isProxyOrigin(c),"form %s should not be on AMP CDN: %s",b,a.h)}return c}
function tc(a){var b=a.h.getAttribute("enctype");if("application/x-www-form-urlencoded"===b||"multipart/form-data"===b)return b;null!==b&&t().warn("amp-form","Unexpected enctype: "+b+". Defaulting to 'multipart/form-data'.");return"multipart/form-data"}l=rc.prototype;l.getXssiPrefix=function(){return this.h.getAttribute("xssi-prefix")};
l.requestForFormFetch=function(a,b,c,d){var e=y({Accept:"application/json"}),f="GET"==b||"HEAD"==b;if(f){xc(this);var g=L(this.h);d&&d.forEach(function(a){delete g[a]});c&&wa(g,c);var h=Ha(a,Ia(g))}else{h=a;if("application/x-www-form-urlencoded"===this.Ka){var k=Ia(L(this.h));e=y({Accept:"application/json","Content-Type":"application/x-www-form-urlencoded"})}else k=Bb(this.j,this.h);d&&d.forEach(function(a){k.delete(a)});for(var m in c)k.append(m,c[m])}var u={xhrUrl:h,fetchOpt:y({body:k,method:b,
credentials:"include",headers:e})};return Jb(this.h).then(function(a){a&&(w("POST"==u.fetchOpt.method,"Cannot attach auth token with GET request."),k.append("ampViewerAuthToken",a));return u})};l.setXhrAction=function(a){this.M=a};l.Fa=function(a){var b=this;if(!a.satisfiesTrust(2))return null;if("submit"==a.method)return yc(this).then(function(){var c=a;return"submitting"!=b.I&&zc(b)?Ac(b,c.trust,null):Promise.resolve(null)});"clear"===a.method&&Bc(this);return null};
function yc(a){if(a.ja)return a.ja;var b=a.h.querySelectorAll(qc.join(",")),c=na(b).map(function(a){return a.whenBuilt()});return a.ja=Cc(a,c,2E3)}
l.la=function(){var a=this;this.Ga.whenNextVisible().then(function(){var b=a.h.querySelector("[autofocus]");if(b)try{b.focus()}catch(c){}});this.h.addEventListener("submit",this.ra.bind(this),!0);this.h.addEventListener("blur",function(b){Dc(b.target);a.U.onBlur(b)},!0);this.h.addEventListener("amp:form-value-change",function(b){Dc(b.target);a.U.onInput(b)},!0);this.R.isEnabled()||this.h.addEventListener("change",function(b){a.Sa.onCommit().then(function(c){var d=c,e=d.updatedElements,f=d.errors;
e.forEach(Dc);a.U.onBlur(b);"verifying"===a.I&&(f.length?(Y(a,"verify-error"),Z(a,y({verifyErrors:f})).then(function(){Ec(a,"verify-error",f,2)})):Y(a,"initial"))})});this.h.addEventListener("input",function(b){Dc(b.target);a.U.onInput(b)})};function vc(a){Ya(a.h,"inputmask","amp-inputmask").then(function(a){a&&a.install()})}
function Fc(a,b){Gc(a,"Form analytics not supported");var c=y({}),d=L(a.h),e;for(e in d)Object.prototype.hasOwnProperty.call(d,e)&&(c["formFields["+e+"]"]=d[e].join(","));c.formId=a.h.id;oc(a.h,b,c)}
function Bc(a){a.h.reset();Y(a,"initial");a.h.classList.remove("user-valid");a.h.classList.remove("user-invalid");var b=a.h.querySelectorAll(".user-valid, .user-invalid");H(b,function(a){a.classList.remove("user-valid");a.classList.remove("user-invalid")});var c=a.h.querySelectorAll(".visible[validation-for]");H(c,function(a){a.classList.remove("visible")});Hc(a.h)}
l.ra=function(a){if("submitting"==this.I||!zc(this))return a.stopImmediatePropagation(),a.preventDefault(),Promise.resolve(null);(this.M||"POST"==this.H)&&a.preventDefault();return Ac(this,3,a)};
function Ac(a,b,c){try{var d={form:a.h,actionXhrMutator:a.setXhrAction.bind(a)};a.qa.fire(d)}catch(m){v().error("amp-form","Form submit service failed: %s",m)}var e=Ic(a),f=a.h.getElementsByClassName("i-amphtml-async-input");a.$.onSubmitting();if(!a.M&&"GET"==a.H){Gc(a,"Non-XHR GETs not supported.");xc(a);if(0===f.length){for(d=0;d<e.length;d++)a.za.expandInputValueSync(e[d]);var g=!c;Jc(a,g);a.$.onSubmitSuccess();return p()}c&&c.preventDefault()}Y(a,"submitting");var h=[],k=[];k.push(Kc(a,e));H(f,
function(b){var c=Lc(a,b);b.classList.contains("i-async-require-action")?h.push(c):k.push(c)});return Promise.all(h).then(function(){return Cc(a,k,1E4).then(function(){if(a.M)var c=Mc(a,b);else"POST"==a.H?w(!1,"Only XHR based (via action-xhr attribute) submissions are supported for POST requests. %s",a.h):"GET"==a.H&&Jc(a,!0),c=p();return c},function(c){return Nc(a,c,b)})},function(c){return Nc(a,c,b)})}function Nc(a,b,c){var d={};b&&b.message&&(d.error=b.message);return Oc(a,b,d,c)}
function Ic(a){return a.h.querySelectorAll('[type="hidden"][data-amp-replace]')}function uc(a){if("submitting"===a.I)return p();Y(a,"verifying");Ec(a,"verify",null,3);return Kc(a,Ic(a)).then(function(){return Pc(a)})}function Mc(a,b){if(a.R.isEnabled())var c=Qc(a,b);else Rc(a,b),c=a.aa(a.M,a.H).then(function(c){return Sc(a,c,b)},function(c){return Tc(a,c,b)});la().test&&(a.Ea=c);return c}
function Qc(a,b){var c,d=L(a.h);return Z(a,d).then(function(){return a.Y.trigger(a.h,"submit",null,b)}).then(function(){return a.requestForFormFetch(a.M,a.H)}).then(function(b){var d=c=b,e=c.fetchOpt||{};var h=e.method;void 0===h?h="GET":(h=h.toUpperCase(),Ib.includes(h));e.method=h;e.headers=e.headers||y({});d.fetchOpt=e;d=c;h=c.xhrUrl;e=(e=c.fetchOpt)||{};var k=a.j;k=k.origin||z(k.location.href).origin;h=z(h).origin;k==h&&(e.headers=e.headers||{},e.headers["AMP-Same-Origin"]="true");d.fetchOpt=
e;d=c;e=c.xhrUrl;if(!1!==c.fetchOpt.ampCors){h=a.j;k=z(e);k=q(k.search);w(!("__amp_source_origin"in k),"Source origin is not allowed in %s",e);h=h.location.href;"string"==typeof h&&(h=z(h));if(Ja(h)){k=h.pathname.split("/");w(za[k[1]],"Unknown path prefix in url %s",h.href);var m=k[2],u="s"==m?"https://"+decodeURIComponent(k[3]):"http://"+decodeURIComponent(m);w(0<u.indexOf("."),"Expected a . in origin %s",u);k.splice(1,"s"==m?3:2);k=u+k.join("/");m=(m=h.search)&&"?"!=m?(m=m.replace(Ca,"").replace(Da,
"").replace(Ea,"").replace(Fa,"").replace(Ga,"").replace(/^[?&]/,""))?"?"+m:"":"";h=k+m+(h.hash||"")}else h=h.href;h=z(h).origin;h=encodeURIComponent("__amp_source_origin")+"="+encodeURIComponent(h);e=Ha(e,h,void 0)}d.xhrUrl=e;return a.R.ssr(a.h,c,Uc(a))}).then(function(c){return Vc(a,c,b)},function(c){var d={};c&&c.message&&(d.error=c.message);return Oc(a,c,d,b)})}
function Uc(a){var b,c=a.h.querySelector("[submit-success]");c&&(b=a.A.maybeFindTemplate(c));var d,e=a.h.querySelector("[submit-error]");e&&(d=a.A.maybeFindTemplate(e));return{successTemplate:b,errorTemplate:d}}function Vc(a,b,c){var d=b.init,e=pc(b.body,function(a){return t().error("amp-form","Failed to parse response JSON: %s",a)});return d&&(d=d.status,300<=d)?Oc(a,d,b,c,e):Wc(a,b,c,e)}
function Rc(a,b){Fc(a,"amp-form-submit");var c=L(a.h);Z(a,c).then(function(){a.Y.trigger(a.h,"submit",null,b)})}function Kc(a,b){for(var c=[],d=0;d<b.length;d++)c.push(a.za.expandInputValueAsync(b[d]));return Cc(a,c,100)}
function Lc(a,b){return b.getImpl().then(function(a){return a.getValue()}).then(function(c){var d=b.getAttribute("name");d=a.h.querySelector("input[name="+String(d).replace(Ta,Ua)+"]");if(!d){d=y({name:b.getAttribute("name"),hidden:"true"});var e=a.j.document.createElement("input"),f;for(f in d)e.setAttribute(f,d[f]);d=e}d.setAttribute("value",c);a.h.appendChild(d)})}
function Pc(a){var b=na(a.h.querySelectorAll("["+"no-verify".replace(Ta,Ua)+"]")),c=b.map(function(a){return a.name||a.id}),d={};return a.aa(a.Ta,a.H,(d.__amp_form_verify=!0,d),c)}l.aa=function(a,b,c,d){var e=this;Gc(this,"XHRs should be proxied.");return this.requestForFormFetch(a,b,c,d).then(function(a){return e.pa.fetch(a.xhrUrl,a.fetchOpt)})};
function Xc(a,b){2>=b&&v().expectedError("amp-form","Recursive form submissions are scheduled to be deprecated by 1/1/2020. See https://github.com/ampproject/amphtml/issues/24894.");return(a=a.h.ownerDocument)&&nc(a)?b-1:b}function Sc(a,b,c){return a.pa.xssiJson(b,a.getXssiPrefix()).then(function(b){return Wc(a,b,c)},function(a){return t().error("amp-form","Failed to parse response JSON: %s",a)}).then(function(){Fc(a,"amp-form-submit-success");Yc(a,b)})}
function Wc(a,b,c,d){Y(a,"submit-success");return ta(function(){Z(a,b||{}).then(function(){var e=Xc(a,c);Ec(a,"submit-success",void 0===d?b:d,e);a.$.onSubmitSuccess()})})}function Tc(a,b,c){return(b&&b.response?a.pa.xssiJson(b.response,a.getXssiPrefix()).catch(function(){return null}):Promise.resolve(null)).then(function(d){Fc(a,"amp-form-submit-error");Oc(a,b,d,c);Yc(a,b.response)})}
function Oc(a,b,c,d,e){Y(a,"submit-error");t().error("amp-form","Form submission failed: %s",b);return ta(function(){Z(a,c).then(function(){var b=Xc(a,d);Ec(a,"submit-error",void 0===e?c:e,b);a.$.onSubmitError()})})}function Jc(a,b){Fc(a,"amp-form-submit");b&&a.h.submit();Y(a,"initial")}function Gc(a,b){var c=a.R.isEnabled();w(!1===c,"[amp-form]: viewerRenderTemplate | %s",b)}
function xc(a){var b=a.h.querySelectorAll("input[type=password],input[type=file]");w(0==b.length,"input[type=password] or input[type=file] may only appear in form[method=post]")}function zc(a){void 0===Qb&&(Qb=!!a.j.document.createElement("input").checkValidity);if(Qb){var b=Zc(a.h);if(a.ya)return a.U.report(),b}return!0}
function Yc(a,b){Gc(a,"Redirects not supported.");if(b&&b.headers){var c=b.headers.get("AMP-Redirect-To");if(c){b=a.h.ownerDocument;w(!(b&&nc(b)),"Redirects not supported in AMP4Email.",a.h);w("_blank"!=a.Pa,"Redirecting to target=_blank using AMP-Redirect-To is currently not supported, use target=_top instead. %s",a.h);try{var d=B(a.h,"url");d.assertAbsoluteHttpOrHttpsUrl(c);d.assertHttpsUrl(c,"AMP-Redirect-To","Url")}catch(e){w(!1,"The `AMP-Redirect-To` header value must be an absolute URL starting with https://. Found %s",
c)}G(a.h,"navigation").navigateTo(a.j,c,"AMP-Redirect-To")}}}function Ec(a,b,c,d){c=K(a.j,"amp-form."+b,y({response:c}));a.Y.trigger(a.h,b,c,d)}function Cc(a,b,c){return Promise.race([Promise.all(b),a.Qa.promise(c)])}
function Y(a,b){var c=a.I;a.h.classList.remove("amp-form-"+c);a.h.classList.add("amp-form-"+b);var d=a.h.querySelector("["+c+"]");if(d){/^[\w-]+$/.test("i-amphtml-rendered");if(void 0!==Va)var e=Va;else{try{var f=d.ownerDocument,g=f.createElement("div"),h=f.createElement("div");g.appendChild(h);e=g.querySelector(":scope div")===h}catch(k){e=!1}e=Va=e}e?d=d.querySelector("> [i-amphtml-rendered]".replace(/^|,/g,"$&:scope ")):(d.classList.add("i-amphtml-scoped"),e="> [i-amphtml-rendered]".replace(/^|,/g,
"$&.i-amphtml-scoped "),e=d.querySelectorAll(e),d.classList.remove("i-amphtml-scoped"),d=void 0===e[0]?null:e[0]);d&&d.parentElement&&d.parentElement.removeChild(d)}a.I=b}
function Z(a,b){Array.isArray(b)&&(b={},t().warn("amp-form","Unexpected data type: "+b+". Expected non JSON array."));var c=a.h.querySelector("["+a.I+"]"),d=p();if(c){var e="rendered-message-"+a.ka;c.setAttribute("role","alert");c.setAttribute("aria-labeledby",e);c.setAttribute("aria-live","assertive");a.A.hasTemplate(c)?d=a.R.applySsrOrCsrTemplate(c,b).then(function(b){b.id=e;b.setAttribute("i-amphtml-rendered","");return a.sa.mutateElement(c,function(){c.appendChild(b);var d=K(a.j,"amp:dom-update",
null,{bubbles:!0});c.dispatchEvent(d)})}):a.sa.mutateElement(c,function(){})}la().test&&(a.xa=d);return d}
function wc(a){if(!Ja(a.j.location)&&a.h.hasAttribute("data-initialize-from-url")){var b=["SELECT","TEXTAREA"],c="color date datetime-local email hidden month number range search tel text time url week".split(" "),d=["checkbox","radio"],e=function(a,e){if(!a.hasAttribute("data-amp-replace")&&a.hasAttribute("data-allow-initialization")){e=f[e]||"";var g=a.getAttribute("type")||"text",h=a.tagName;"INPUT"===h?c.includes(g.toLocaleLowerCase())?a.value!==e&&(a.value=e):d.includes(g)&&(e=a.value===e,a.checked!==
e&&(a.checked=e)):b.includes(h)&&a.value!==e&&(a.value=e)}},f=q(a.j.location.search);Object.keys(f).forEach(function(b){var c=a.h.elements[b];c&&(c.nodeType===Node.ELEMENT_NODE?e(c,b):c.length&&H(c,function(a){return e(a,b)}))})}}l.Ua=function(){return this.xa};l.Wa=function(){return this.Ea};function Zc(a){var b=a.querySelectorAll("input,select,textarea,fieldset");H(b,function(a){return $c(a)});return $c(a)}
function Hc(a){var b=document.createElement("input"),c={},d;for(d in b.validity){c.X=d;var e=a.querySelectorAll("."+String(c.X).replace(Ta,Ua));H(e,function(a){return function(b){b.classList.remove(a.X)}}(c));c={X:c.X}}}
function $c(a,b){b=void 0===b?!1:b;if(!a.checkValidity)return!0;var c=!1,d=a.classList.contains("user-valid")?"valid":a.classList.contains("user-invalid")?"invalid":"none",e=a.checkValidity();"valid"!=d&&e?(a.classList.add("user-valid"),a.classList.remove("user-invalid"),c="invalid"==d):"invalid"==d||e||(a.classList.add("user-invalid"),a.classList.remove("user-valid"),c=!0);if(a.validity)for(var f in a.validity)a.classList.toggle(f,a.validity[f]);if(b&&c){f=Xa(a);for(var g=0;g<f.length;g++)$c(f[g]);
a.form&&$c(a.form)}return e}function Dc(a){$c(a,!0)}function ad(a){this.Da=bd(a).then(function(){return cd(a)});la().test&&this.Da.then(function(){var b=a.win,c=K(b,"amp:form-service:initialize",null,{bubbles:!0});b.dispatchEvent(c)})}ad.prototype.whenInitialized=function(){return this.Da};function bd(a){var b=new sa;fc(a,b.resolve);return b.promise}function cd(a){return a.whenReady().then(function(){var b=a.getRootNode();dd(b.querySelectorAll("form"));ob(a);ed(b);fd(b)})}
function dd(a){a&&H(a,function(a,c){var b=a.__AMP_FORM||null;b||new rc(a,"amp-form-"+c)})}function ed(a){a.addEventListener("amp:dom-update",function(){dd(a.querySelectorAll("form"))})}function fd(a){a.addEventListener("keydown",function(a){if(!a.defaultPrevented&&"Enter"==a.key&&(a.ctrlKey||a.metaKey)&&"TEXTAREA"===a.target.tagName){var b=a.target.form,d=b?b.__AMP_FORM||null:null;d&&(d.ra(a),a.preventDefault())}})}
(function(a){a.registerServiceForDoc("form-submit-service",Hb);a.registerServiceForDoc("amp-form",ad)})(self.AMP);
})});

//# sourceMappingURL=amp-form-0.1.js.map
